From 747519b0e7ab8a4707b5a4606f0b919ac7373b82 Mon Sep 17 00:00:00 2001 From: kwokhe <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:34:34 +0200 Subject: [PATCH 001/126] Include templates --- Adyen/Adyen.csproj | 4 + .../csharp/AbstractOpenAPISchema.mustache | 68 ++ templates-v7/csharp/ApiClient.mustache | 846 ++++++++++++++++++ templates-v7/csharp/ApiClient.v790.mustache | 838 +++++++++++++++++ templates-v7/csharp/ApiException.mustache | 60 ++ templates-v7/csharp/ApiResponse.mustache | 158 ++++ templates-v7/csharp/AssemblyInfo.mustache | 40 + templates-v7/csharp/ClientUtils.mustache | 269 ++++++ templates-v7/csharp/Configuration.mustache | 737 +++++++++++++++ .../csharp/Configuration.v790.mustache | 737 +++++++++++++++ templates-v7/csharp/ExceptionFactory.mustache | 14 + .../csharp/GlobalConfiguration.mustache | 59 ++ templates-v7/csharp/HttpMethod.mustache | 25 + .../csharp/HttpSigningConfiguration.mustache | 805 +++++++++++++++++ templates-v7/csharp/IApiAccessor.mustache | 29 + .../csharp/IAsynchronousClient.mustache | 92 ++ .../csharp/IReadableConfiguration.mustache | 178 ++++ .../IReadableConfiguration.v790.mustache | 178 ++++ .../csharp/ISynchronousClient.mustache | 85 ++ .../csharp/JsonSubTypesTests.mustache | 125 +++ templates-v7/csharp/Multimap.mustache | 287 ++++++ .../csharp/NullConditionalParameter.mustache | 1 + .../csharp/NullConditionalProperty.mustache | 1 + .../csharp/OpenAPIDateConverter.mustache | 21 + templates-v7/csharp/README.mustache | 267 ++++++ .../csharp/ReadOnlyDictionary.mustache | 137 +++ templates-v7/csharp/RequestOptions.mustache | 87 ++ .../csharp/RetryConfiguration.mustache | 41 + templates-v7/csharp/Solution.mustache | 27 + templates-v7/csharp/TestProject.mustache | 35 + templates-v7/csharp/ValidateRegex.mustache | 6 + .../csharp/WebRequestPathBuilder.mustache | 45 + templates-v7/csharp/api.mustache | 799 +++++++++++++++++ templates-v7/csharp/api_doc.mustache | 162 ++++ templates-v7/csharp/api_test.mustache | 77 ++ templates-v7/csharp/appveyor.mustache | 9 + .../csharp/auth/OAuthAuthenticator.mustache | 136 +++ templates-v7/csharp/auth/OAuthFlow.mustache | 19 + .../csharp/auth/TokenResponse.mustache | 24 + templates-v7/csharp/git_push.sh.mustache | 57 ++ templates-v7/csharp/gitignore.mustache | 362 ++++++++ ...terOperationDefaultImplementation.mustache | 2 + .../generichost/ApiException.mustache | 46 + .../libraries/generichost/ApiFactory.mustache | 49 + .../generichost/ApiKeyToken.mustache | 56 ++ .../ApiResponseEventArgs`1.mustache | 24 + .../generichost/ApiResponse`1.mustache | 170 ++++ .../generichost/ApiTestsBase.mustache | 65 ++ .../libraries/generichost/AsModel.mustache | 4 + .../libraries/generichost/Assembly.mustache | 2 + .../libraries/generichost/BasicToken.mustache | 46 + .../generichost/BearerToken.mustache | 41 + .../generichost/ClientUtils.mustache | 404 +++++++++ .../generichost/CookieContainer.mustache | 22 + .../generichost/DateFormats.mustache | 2 + .../DateOnlyJsonConverter.mustache | 51 ++ .../DateOnlyNullableJsonConverter.mustache | 56 ++ .../generichost/DateTimeFormats.mustache | 22 + .../DateTimeJsonConverter.mustache | 51 ++ .../DateTimeNullableJsonConverter.mustache | 56 ++ .../DependencyInjectionTests.mustache | 211 +++++ .../generichost/EnumValueDataType.mustache | 1 + .../generichost/ExceptionEventArgs.mustache | 24 + .../generichost/HostConfiguration.mustache | 166 ++++ .../HttpSigningConfiguration.mustache | 678 ++++++++++++++ .../generichost/HttpSigningToken.mustache | 45 + .../libraries/generichost/IApi.mustache | 15 + .../IHostBuilderExtensions.mustache | 55 ++ .../IHttpClientBuilderExtensions.mustache | 75 ++ .../IServiceCollectionExtensions.mustache | 69 ++ .../generichost/ImplementsIEquatable.mustache | 1 + .../ImplementsValidatable.mustache | 1 + .../generichost/JsonConverter.mustache | 648 ++++++++++++++ .../JsonSerializerOptionsProvider.mustache | 29 + .../generichost/ModelBaseSignature.mustache | 1 + .../generichost/ModelSignature.mustache | 1 + .../libraries/generichost/OAuthToken.mustache | 41 + .../OnDeserializationError.mustache | 2 + .../OnErrorDefaultImplementation.mustache | 2 + .../generichost/OperationSignature.mustache | 1 + .../libraries/generichost/Option.mustache | 47 + .../generichost/OptionProperty.mustache | 1 + .../generichost/README.client.mustache | 245 +++++ .../generichost/README.solution.mustache | 1 + .../generichost/README.test.mustache | 0 .../generichost/RateLimitProvider`1.mustache | 79 ++ .../SourceGenerationContext.mustache | 9 + .../libraries/generichost/TokenBase.mustache | 73 ++ .../generichost/TokenContainer`1.mustache | 39 + .../generichost/TokenProvider`1.mustache | 38 + .../generichost/ValidateRegex.mustache | 7 + .../generichost/WriteProperty.mustache | 9 + .../generichost/WritePropertyHelper.mustache | 10 + .../csharp/libraries/generichost/api.mustache | 803 +++++++++++++++++ .../libraries/generichost/api_test.mustache | 51 ++ .../generichost/git_push.ps1.mustache | 75 ++ .../generichost/git_push.sh.mustache | 49 + .../libraries/generichost/model.mustache | 50 ++ .../generichost/modelGeneric.mustache | 393 ++++++++ .../generichost/testInstructions.mustache | 18 + .../libraries/httpclient/ApiClient.mustache | 792 ++++++++++++++++ .../httpclient/FileParameter.mustache | 72 ++ .../httpclient/RequestOptions.mustache | 66 ++ .../csharp/libraries/httpclient/api.mustache | 766 ++++++++++++++++ .../libraries/httpclient/model.mustache | 51 ++ templates-v7/csharp/model.mustache | 50 ++ templates-v7/csharp/modelAnyOf.mustache | 275 ++++++ templates-v7/csharp/modelEnum.mustache | 185 ++++ templates-v7/csharp/modelGeneric.mustache | 432 +++++++++ templates-v7/csharp/modelInnerEnum.mustache | 99 ++ templates-v7/csharp/modelOneOf.mustache | 320 +++++++ templates-v7/csharp/model_doc.mustache | 22 + templates-v7/csharp/model_test.mustache | 87 ++ .../csharp/netcore_project.additions.mustache | 1 + templates-v7/csharp/netcore_project.mustache | 84 ++ .../netcore_testproject.additions.mustache | 1 + .../csharp/netcore_testproject.mustache | 20 + templates-v7/csharp/nuspec.mustache | 57 ++ templates-v7/csharp/openapi.mustache | 1 + templates-v7/csharp/partial_header.mustache | 17 + templates-v7/csharp/validatable.mustache | 135 +++ templates-v7/csharp/visibility.mustache | 1 + 122 files changed, 16713 insertions(+) create mode 100644 templates-v7/csharp/AbstractOpenAPISchema.mustache create mode 100644 templates-v7/csharp/ApiClient.mustache create mode 100644 templates-v7/csharp/ApiClient.v790.mustache create mode 100644 templates-v7/csharp/ApiException.mustache create mode 100644 templates-v7/csharp/ApiResponse.mustache create mode 100644 templates-v7/csharp/AssemblyInfo.mustache create mode 100644 templates-v7/csharp/ClientUtils.mustache create mode 100644 templates-v7/csharp/Configuration.mustache create mode 100644 templates-v7/csharp/Configuration.v790.mustache create mode 100644 templates-v7/csharp/ExceptionFactory.mustache create mode 100644 templates-v7/csharp/GlobalConfiguration.mustache create mode 100644 templates-v7/csharp/HttpMethod.mustache create mode 100644 templates-v7/csharp/HttpSigningConfiguration.mustache create mode 100644 templates-v7/csharp/IApiAccessor.mustache create mode 100644 templates-v7/csharp/IAsynchronousClient.mustache create mode 100644 templates-v7/csharp/IReadableConfiguration.mustache create mode 100644 templates-v7/csharp/IReadableConfiguration.v790.mustache create mode 100644 templates-v7/csharp/ISynchronousClient.mustache create mode 100644 templates-v7/csharp/JsonSubTypesTests.mustache create mode 100644 templates-v7/csharp/Multimap.mustache create mode 100644 templates-v7/csharp/NullConditionalParameter.mustache create mode 100644 templates-v7/csharp/NullConditionalProperty.mustache create mode 100644 templates-v7/csharp/OpenAPIDateConverter.mustache create mode 100644 templates-v7/csharp/README.mustache create mode 100644 templates-v7/csharp/ReadOnlyDictionary.mustache create mode 100644 templates-v7/csharp/RequestOptions.mustache create mode 100644 templates-v7/csharp/RetryConfiguration.mustache create mode 100644 templates-v7/csharp/Solution.mustache create mode 100644 templates-v7/csharp/TestProject.mustache create mode 100644 templates-v7/csharp/ValidateRegex.mustache create mode 100644 templates-v7/csharp/WebRequestPathBuilder.mustache create mode 100644 templates-v7/csharp/api.mustache create mode 100644 templates-v7/csharp/api_doc.mustache create mode 100644 templates-v7/csharp/api_test.mustache create mode 100644 templates-v7/csharp/appveyor.mustache create mode 100644 templates-v7/csharp/auth/OAuthAuthenticator.mustache create mode 100644 templates-v7/csharp/auth/OAuthFlow.mustache create mode 100644 templates-v7/csharp/auth/TokenResponse.mustache create mode 100644 templates-v7/csharp/git_push.sh.mustache create mode 100644 templates-v7/csharp/gitignore.mustache create mode 100644 templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache create mode 100644 templates-v7/csharp/libraries/generichost/ApiException.mustache create mode 100644 templates-v7/csharp/libraries/generichost/ApiFactory.mustache create mode 100644 templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache create mode 100644 templates-v7/csharp/libraries/generichost/ApiResponseEventArgs`1.mustache create mode 100644 templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache create mode 100644 templates-v7/csharp/libraries/generichost/ApiTestsBase.mustache create mode 100644 templates-v7/csharp/libraries/generichost/AsModel.mustache create mode 100644 templates-v7/csharp/libraries/generichost/Assembly.mustache create mode 100644 templates-v7/csharp/libraries/generichost/BasicToken.mustache create mode 100644 templates-v7/csharp/libraries/generichost/BearerToken.mustache create mode 100644 templates-v7/csharp/libraries/generichost/ClientUtils.mustache create mode 100644 templates-v7/csharp/libraries/generichost/CookieContainer.mustache create mode 100644 templates-v7/csharp/libraries/generichost/DateFormats.mustache create mode 100644 templates-v7/csharp/libraries/generichost/DateOnlyJsonConverter.mustache create mode 100644 templates-v7/csharp/libraries/generichost/DateOnlyNullableJsonConverter.mustache create mode 100644 templates-v7/csharp/libraries/generichost/DateTimeFormats.mustache create mode 100644 templates-v7/csharp/libraries/generichost/DateTimeJsonConverter.mustache create mode 100644 templates-v7/csharp/libraries/generichost/DateTimeNullableJsonConverter.mustache create mode 100644 templates-v7/csharp/libraries/generichost/DependencyInjectionTests.mustache create mode 100644 templates-v7/csharp/libraries/generichost/EnumValueDataType.mustache create mode 100644 templates-v7/csharp/libraries/generichost/ExceptionEventArgs.mustache create mode 100644 templates-v7/csharp/libraries/generichost/HostConfiguration.mustache create mode 100644 templates-v7/csharp/libraries/generichost/HttpSigningConfiguration.mustache create mode 100644 templates-v7/csharp/libraries/generichost/HttpSigningToken.mustache create mode 100644 templates-v7/csharp/libraries/generichost/IApi.mustache create mode 100644 templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache create mode 100644 templates-v7/csharp/libraries/generichost/IHttpClientBuilderExtensions.mustache create mode 100644 templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache create mode 100644 templates-v7/csharp/libraries/generichost/ImplementsIEquatable.mustache create mode 100644 templates-v7/csharp/libraries/generichost/ImplementsValidatable.mustache create mode 100644 templates-v7/csharp/libraries/generichost/JsonConverter.mustache create mode 100644 templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache create mode 100644 templates-v7/csharp/libraries/generichost/ModelBaseSignature.mustache create mode 100644 templates-v7/csharp/libraries/generichost/ModelSignature.mustache create mode 100644 templates-v7/csharp/libraries/generichost/OAuthToken.mustache create mode 100644 templates-v7/csharp/libraries/generichost/OnDeserializationError.mustache create mode 100644 templates-v7/csharp/libraries/generichost/OnErrorDefaultImplementation.mustache create mode 100644 templates-v7/csharp/libraries/generichost/OperationSignature.mustache create mode 100644 templates-v7/csharp/libraries/generichost/Option.mustache create mode 100644 templates-v7/csharp/libraries/generichost/OptionProperty.mustache create mode 100644 templates-v7/csharp/libraries/generichost/README.client.mustache create mode 100644 templates-v7/csharp/libraries/generichost/README.solution.mustache create mode 100644 templates-v7/csharp/libraries/generichost/README.test.mustache create mode 100644 templates-v7/csharp/libraries/generichost/RateLimitProvider`1.mustache create mode 100644 templates-v7/csharp/libraries/generichost/SourceGenerationContext.mustache create mode 100644 templates-v7/csharp/libraries/generichost/TokenBase.mustache create mode 100644 templates-v7/csharp/libraries/generichost/TokenContainer`1.mustache create mode 100644 templates-v7/csharp/libraries/generichost/TokenProvider`1.mustache create mode 100644 templates-v7/csharp/libraries/generichost/ValidateRegex.mustache create mode 100644 templates-v7/csharp/libraries/generichost/WriteProperty.mustache create mode 100644 templates-v7/csharp/libraries/generichost/WritePropertyHelper.mustache create mode 100644 templates-v7/csharp/libraries/generichost/api.mustache create mode 100644 templates-v7/csharp/libraries/generichost/api_test.mustache create mode 100644 templates-v7/csharp/libraries/generichost/git_push.ps1.mustache create mode 100644 templates-v7/csharp/libraries/generichost/git_push.sh.mustache create mode 100644 templates-v7/csharp/libraries/generichost/model.mustache create mode 100644 templates-v7/csharp/libraries/generichost/modelGeneric.mustache create mode 100644 templates-v7/csharp/libraries/generichost/testInstructions.mustache create mode 100644 templates-v7/csharp/libraries/httpclient/ApiClient.mustache create mode 100644 templates-v7/csharp/libraries/httpclient/FileParameter.mustache create mode 100644 templates-v7/csharp/libraries/httpclient/RequestOptions.mustache create mode 100644 templates-v7/csharp/libraries/httpclient/api.mustache create mode 100644 templates-v7/csharp/libraries/httpclient/model.mustache create mode 100644 templates-v7/csharp/model.mustache create mode 100644 templates-v7/csharp/modelAnyOf.mustache create mode 100644 templates-v7/csharp/modelEnum.mustache create mode 100644 templates-v7/csharp/modelGeneric.mustache create mode 100644 templates-v7/csharp/modelInnerEnum.mustache create mode 100644 templates-v7/csharp/modelOneOf.mustache create mode 100644 templates-v7/csharp/model_doc.mustache create mode 100644 templates-v7/csharp/model_test.mustache create mode 100644 templates-v7/csharp/netcore_project.additions.mustache create mode 100644 templates-v7/csharp/netcore_project.mustache create mode 100644 templates-v7/csharp/netcore_testproject.additions.mustache create mode 100644 templates-v7/csharp/netcore_testproject.mustache create mode 100644 templates-v7/csharp/nuspec.mustache create mode 100644 templates-v7/csharp/openapi.mustache create mode 100644 templates-v7/csharp/partial_header.mustache create mode 100644 templates-v7/csharp/validatable.mustache create mode 100644 templates-v7/csharp/visibility.mustache diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index fa180e07d..8dccb883d 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -54,4 +54,8 @@ + + + + diff --git a/templates-v7/csharp/AbstractOpenAPISchema.mustache b/templates-v7/csharp/AbstractOpenAPISchema.mustache new file mode 100644 index 000000000..05e782049 --- /dev/null +++ b/templates-v7/csharp/AbstractOpenAPISchema.mustache @@ -0,0 +1,68 @@ +{{>partial_header}} + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace {{packageName}}.{{modelPackage}} +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + {{>visibility}} abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Error, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Custom JSON serializer for objects with additional properties + /// + static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + } +} diff --git a/templates-v7/csharp/ApiClient.mustache b/templates-v7/csharp/ApiClient.mustache new file mode 100644 index 000000000..a96011d70 --- /dev/null +++ b/templates-v7/csharp/ApiClient.mustache @@ -0,0 +1,846 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +{{^net60OrLater}} +using System.Web; +{{/net60OrLater}} +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using RestSharp; +using RestSharp.Serializers; +using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; +{{#supportsRetry}} +using Polly; +{{/supportsRetry}} +{{#hasOAuthMethods}} +using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +using {{packageName}}.{{modelPackage}}; + +namespace {{packageName}}.Client +{ + /// + /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer + { + private readonly IReadableConfiguration _configuration; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); + + public T Deserialize(RestResponse response) + { + var result = (T)Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(RestResponse response, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return response.RawBytes; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = response.RawBytes; + if (response.Headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? global::System.IO.Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in response.Headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + FileIO.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public ISerializer Serializer => this; + public IDeserializer Deserializer => this; + + public string[] AcceptedContentTypes => ContentType.JsonAccept; + + public SupportsContentType SupportsContentType => contentType => + contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || + contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); + + public ContentType ContentType { get; set; } = ContentType.Json; + + public DataFormat DataFormat => DataFormat.Json; + } + {{! NOTE: Any changes related to RestSharp should be done in this class. All other client classes are for extensibility by consumers.}} + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + {{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptRequest(RestRequest request){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptResponse(RestRequest request, RestResponse response){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() + { + _baseUrl = GlobalConfiguration.Instance.BasePath; + } + + /// + /// Initializes a new instance of the + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Constructs the RestSharp version of an http method + /// + /// Swagger Client Custom HttpMethod + /// RestSharp's HttpMethod instance. + /// + private RestSharpMethod Method(HttpMethod method) + { + RestSharpMethod other; + switch (method) + { + case HttpMethod.Get: + other = RestSharpMethod.Get; + break; + case HttpMethod.Post: + other = RestSharpMethod.Post; + break; + case HttpMethod.Put: + other = RestSharpMethod.Put; + break; + case HttpMethod.Delete: + other = RestSharpMethod.Delete; + break; + case HttpMethod.Head: + other = RestSharpMethod.Head; + break; + case HttpMethod.Options: + other = RestSharpMethod.Options; + break; + case HttpMethod.Patch: + other = RestSharpMethod.Patch; + break; + default: + throw new ArgumentOutOfRangeException("method", method, null); + } + + return other; + } + + /// + /// Provides all logic for constructing a new RestSharp . + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// [private] A new RestRequest instance. + /// + private RestRequest NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + RestRequest request = new RestRequest(path, Method(method)); + + if (options.PathParameters != null) + { + foreach (var pathParam in options.PathParameters) + { + request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); + } + } + + if (options.QueryParameters != null) + { + foreach (var queryParam in options.QueryParameters) + { + foreach (var value in queryParam.Value) + { + request.AddQueryParameter(queryParam.Key, value); + } + } + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.AddHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + request.AddOrUpdateHeader(headerParam.Key, value); + } + } + } + + if (options.FormParameters != null) + { + foreach (var formParam in options.FormParameters) + { + request.AddParameter(formParam.Key, formParam.Value); + } + } + + if (options.Data != null) + { + if (options.Data is Stream stream) + { + var contentType = "application/octet-stream"; + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes[0]; + } + + var bytes = ClientUtils.ReadAsBytes(stream); + request.AddParameter(contentType, bytes, ParameterType.RequestBody); + } + else + { + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) + { + request.RequestFormat = DataFormat.Json; + } + else + { + // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. + } + } + else + { + // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. + request.RequestFormat = DataFormat.Json; + } + + request.AddJsonBody(options.Data); + } + } + + if (options.FileParameters != null) + { + foreach (var fileParam in options.FileParameters) + { + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); + else + request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); + } + } + } + + if (options.HeaderParameters != null) + { + if (options.HeaderParameters.TryGetValue("Content-Type", out var contentTypes) && contentTypes.Any(header => header.Contains("multipart/form-data"))) + { + request.AlwaysMultipartFormData = true; + } + } + + return request; + } + + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. + private ApiResponse ToApiResponse(RestResponse response) + { + T result = response.Data; + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) + { + ErrorText = response.ErrorMessage, + Cookies = new List() + }; + + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.ContentHeaders != null) + { + foreach (var responseHeader in response.ContentHeaders) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.Cookies != null) + { + foreach (var responseCookies in response.Cookies.Cast()) + { + transformed.Cookies.Add( + new Cookie( + responseCookies.Name, + responseCookies.Value, + responseCookies.Path, + responseCookies.Domain) + ); + } + } + + return transformed; + } + + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; + var clientOptions = new RestClientOptions(baseUrl) + { + ClientCertificates = configuration.ClientCertificates, + Timeout = configuration.Timeout, + Proxy = configuration.Proxy, + UserAgent = configuration.UserAgent, + UseDefaultCredentials = configuration.UseDefaultCredentials, + RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + }; + setOptions(clientOptions); + + {{#hasOAuthMethods}} + if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(configuration.OAuthClientId) && + !string.IsNullOrEmpty(configuration.OAuthClientSecret) && + configuration.OAuthFlow != null) + { + clientOptions.Authenticator = new OAuthAuthenticator( + configuration.OAuthTokenUrl, + configuration.OAuthClientId, + configuration.OAuthClientSecret, + configuration.OAuthScope, + configuration.OAuthFlow, + SerializerSettings, + configuration); + } + + {{/hasOAuthMethods}} + using (RestClient client = new RestClient(clientOptions, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) + { + InterceptRequest(request); + + RestResponse response = await getResponse(client); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + try + { + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + catch (Exception ex) + { + throw ex.InnerException != null ? ex.InnerException : ex; + } + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + else if (typeof(T).Name == "Byte[]") // for byte response + { + response.Data = (T)(object)response.RawBytes; + } + else if (typeof(T).Name == "String") // for string response + { + response.Data = (T)(object)response.Content; + } + + InterceptResponse(request, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies.Cast()) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + } + + private async Task> DeserializeRestResponseFromPolicyAsync(RestClient client, RestRequest request, PolicyResult policyResult, CancellationToken cancellationToken = default) + { + if (policyResult.Outcome == OutcomeType.Successful) + { + return await client.Deserialize(policyResult.Result, cancellationToken); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; + }; + + Func>> getResponse = (client) => + { + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicyAsync(client, request, policyResult); + } + else + { + return Task.FromResult(client.Execute(request)); + } + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); + } + + {{#supportsAsync}} + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; + + Func>> getResponse = async (client) => + { + {{#supportsRetry}} + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken); + } + else + { + {{/supportsRetry}} + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + {{#supportsRetry}} + } + {{/supportsRetry}} + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration); + } + + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); + } + #endregion IAsynchronousClient + {{/supportsAsync}} + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config); + } + #endregion ISynchronousClient + } +} diff --git a/templates-v7/csharp/ApiClient.v790.mustache b/templates-v7/csharp/ApiClient.v790.mustache new file mode 100644 index 000000000..a63d1c2be --- /dev/null +++ b/templates-v7/csharp/ApiClient.v790.mustache @@ -0,0 +1,838 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +{{^net60OrLater}} +using System.Web; +{{/net60OrLater}} +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using RestSharp; +using RestSharp.Serializers; +using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; +{{#supportsRetry}} +using Polly; +{{/supportsRetry}} +{{#hasOAuthMethods}} +using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +using {{packageName}}.{{modelPackage}}; + +namespace {{packageName}}.Client +{ + /// + /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer + { + private readonly IReadableConfiguration _configuration; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); + + public T Deserialize(RestResponse response) + { + var result = (T)Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(RestResponse response, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return response.RawBytes; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = response.RawBytes; + if (response.Headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? global::System.IO.Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in response.Headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + FileIO.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public ISerializer Serializer => this; + public IDeserializer Deserializer => this; + + public string[] AcceptedContentTypes => ContentType.JsonAccept; + + public SupportsContentType SupportsContentType => contentType => + contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || + contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); + + public ContentType ContentType { get; set; } = ContentType.Json; + + public DataFormat DataFormat => DataFormat.Json; + } + {{! NOTE: Any changes related to RestSharp should be done in this class. All other client classes are for extensibility by consumers.}} + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + {{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(RestRequest request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(RestRequest request, RestResponse response); + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() + { + _baseUrl = GlobalConfiguration.Instance.BasePath; + } + + /// + /// Initializes a new instance of the + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Constructs the RestSharp version of an http method + /// + /// Swagger Client Custom HttpMethod + /// RestSharp's HttpMethod instance. + /// + private RestSharpMethod Method(HttpMethod method) + { + RestSharpMethod other; + switch (method) + { + case HttpMethod.Get: + other = RestSharpMethod.Get; + break; + case HttpMethod.Post: + other = RestSharpMethod.Post; + break; + case HttpMethod.Put: + other = RestSharpMethod.Put; + break; + case HttpMethod.Delete: + other = RestSharpMethod.Delete; + break; + case HttpMethod.Head: + other = RestSharpMethod.Head; + break; + case HttpMethod.Options: + other = RestSharpMethod.Options; + break; + case HttpMethod.Patch: + other = RestSharpMethod.Patch; + break; + default: + throw new ArgumentOutOfRangeException("method", method, null); + } + + return other; + } + + /// + /// Provides all logic for constructing a new RestSharp . + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// [private] A new RestRequest instance. + /// + private RestRequest NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + RestRequest request = new RestRequest(path, Method(method)); + + if (options.PathParameters != null) + { + foreach (var pathParam in options.PathParameters) + { + request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); + } + } + + if (options.QueryParameters != null) + { + foreach (var queryParam in options.QueryParameters) + { + foreach (var value in queryParam.Value) + { + request.AddQueryParameter(queryParam.Key, value); + } + } + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.AddHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + request.AddHeader(headerParam.Key, value); + } + } + } + + if (options.FormParameters != null) + { + foreach (var formParam in options.FormParameters) + { + request.AddParameter(formParam.Key, formParam.Value); + } + } + + if (options.Data != null) + { + if (options.Data is Stream stream) + { + var contentType = "application/octet-stream"; + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes[0]; + } + + var bytes = ClientUtils.ReadAsBytes(stream); + request.AddParameter(contentType, bytes, ParameterType.RequestBody); + } + else + { + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) + { + request.RequestFormat = DataFormat.Json; + } + else + { + // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. + } + } + else + { + // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. + request.RequestFormat = DataFormat.Json; + } + + request.AddJsonBody(options.Data); + } + } + + if (options.FileParameters != null) + { + foreach (var fileParam in options.FileParameters) + { + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); + else + request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); + } + } + } + + return request; + } + + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. + private ApiResponse ToApiResponse(RestResponse response) + { + T result = response.Data; + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) + { + ErrorText = response.ErrorMessage, + Cookies = new List() + }; + + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.ContentHeaders != null) + { + foreach (var responseHeader in response.ContentHeaders) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.Cookies != null) + { + foreach (var responseCookies in response.Cookies.Cast()) + { + transformed.Cookies.Add( + new Cookie( + responseCookies.Name, + responseCookies.Value, + responseCookies.Path, + responseCookies.Domain) + ); + } + } + + return transformed; + } + + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; + var clientOptions = new RestClientOptions(baseUrl) + { + ClientCertificates = configuration.ClientCertificates, + MaxTimeout = configuration.Timeout, + Proxy = configuration.Proxy, + UserAgent = configuration.UserAgent, + UseDefaultCredentials = configuration.UseDefaultCredentials, + RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + }; + setOptions(clientOptions); + + {{#hasOAuthMethods}} + if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(configuration.OAuthClientId) && + !string.IsNullOrEmpty(configuration.OAuthClientSecret) && + configuration.OAuthFlow != null) + { + clientOptions.Authenticator = new OAuthAuthenticator( + configuration.OAuthTokenUrl, + configuration.OAuthClientId, + configuration.OAuthClientSecret, + configuration.OAuthScope, + configuration.OAuthFlow, + SerializerSettings, + configuration); + } + + {{/hasOAuthMethods}} + using (RestClient client = new RestClient(clientOptions, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) + { + InterceptRequest(request); + + RestResponse response = await getResponse(client); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + try + { + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + catch (Exception ex) + { + throw ex.InnerException != null ? ex.InnerException : ex; + } + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + else if (typeof(T).Name == "Byte[]") // for byte response + { + response.Data = (T)(object)response.RawBytes; + } + else if (typeof(T).Name == "String") // for string response + { + response.Data = (T)(object)response.Content; + } + + InterceptResponse(request, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies.Cast()) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + } + + private async Task> DeserializeRestResponseFromPolicyAsync(RestClient client, RestRequest request, PolicyResult policyResult, CancellationToken cancellationToken = default) + { + if (policyResult.Outcome == OutcomeType.Successful) + { + return await client.Deserialize(policyResult.Result, cancellationToken); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; + }; + + Func>> getResponse = (client) => + { + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicyAsync(client, request, policyResult); + } + else + { + return Task.FromResult(client.Execute(request)); + } + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); + } + + {{#supportsAsync}} + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; + + Func>> getResponse = async (client) => + { + {{#supportsRetry}} + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken); + } + else + { + {{/supportsRetry}} + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + {{#supportsRetry}} + } + {{/supportsRetry}} + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration); + } + + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); + } + #endregion IAsynchronousClient + {{/supportsAsync}} + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config); + } + #endregion ISynchronousClient + } +} diff --git a/templates-v7/csharp/ApiException.mustache b/templates-v7/csharp/ApiException.mustache new file mode 100644 index 000000000..f7dadc557 --- /dev/null +++ b/templates-v7/csharp/ApiException.mustache @@ -0,0 +1,60 @@ +{{>partial_header}} + +using System; + +namespace {{packageName}}.Client +{ + /// + /// API Exception + /// + {{>visibility}} class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public object ErrorContent { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() { } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + /// HTTP Headers. + public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + this.Headers = headers; + } + } + +} diff --git a/templates-v7/csharp/ApiResponse.mustache b/templates-v7/csharp/ApiResponse.mustache new file mode 100644 index 000000000..161c2acd1 --- /dev/null +++ b/templates-v7/csharp/ApiResponse.mustache @@ -0,0 +1,158 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Net; + +namespace {{packageName}}.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// The content of this response + /// + Object Content { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + Multimap Headers { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public class ApiResponse : IApiResponse + { + #region Properties + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + public string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + public List Cookies { get; set; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The data type of + /// + public object Content + { + get { return Data; } + } + + /// + /// The raw content + /// + public string RawContent { get; } + + #endregion Properties + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) + { + StatusCode = statusCode; + Headers = headers; + Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) + { + } + + #endregion Constructors + } +} diff --git a/templates-v7/csharp/AssemblyInfo.mustache b/templates-v7/csharp/AssemblyInfo.mustache new file mode 100644 index 000000000..d5d937dc1 --- /dev/null +++ b/templates-v7/csharp/AssemblyInfo.mustache @@ -0,0 +1,40 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("{{packageTitle}}")] +[assembly: AssemblyDescription("{{packageDescription}}")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("{{packageCompany}}")] +[assembly: AssemblyProduct("{{packageProductName}}")] +[assembly: AssemblyCopyright("{{packageCopyright}}")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("{{packageVersion}}")] +[assembly: AssemblyFileVersion("{{packageVersion}}")] +{{^supportsAsync}} +// Settings which don't support asynchronous operations rely on non-public constructors +// This is due to how RestSharp requires the type constraint `where T : new()` in places it probably shouldn't. +[assembly: InternalsVisibleTo("RestSharp")] +[assembly: InternalsVisibleTo("NewtonSoft.Json")] +[assembly: InternalsVisibleTo("JsonSubTypes")] +{{/supportsAsync}} diff --git a/templates-v7/csharp/ClientUtils.mustache b/templates-v7/csharp/ClientUtils.mustache new file mode 100644 index 000000000..5c42d2e4f --- /dev/null +++ b/templates-v7/csharp/ClientUtils.mustache @@ -0,0 +1,269 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +{{#useCompareNetObjects}} +using KellermanSoftware.CompareNetObjects; +{{/useCompareNetObjects}} + +namespace {{packageName}}.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + {{#useCompareNetObjects}} + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + {{#equatable}} + ComparisonConfig comparisonConfig = new{{^net70OrLater}} ComparisonConfig{{/net70OrLater}}(); + comparisonConfig.UseHashCodeIdentifier = true; + {{/equatable}} + compareLogic = new{{^net70OrLater}} CompareLogic{{/net70OrLater}}({{#equatable}}comparisonConfig{{/equatable}}); + } + + {{/useCompareNetObjects}} + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// + /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi + /// Key name. + /// Value object. + /// A multimap of keys with 1..n associated values. + public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) + { + var parameters = new Multimap(); + + if (value is ICollection collection && collectionFormat == "multi") + { + foreach (var item in collection) + { + parameters.Add(name, ParameterToString(item)); + } + } + else if (value is IDictionary dictionary) + { + if(collectionFormat == "deepObject") { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); + } + } + else { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); + } + } + } + else + { + parameters.Add(name, ParameterToString(value)); + } + + return parameters; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// An optional configuration instance, providing formatting options used in processing. + /// Formatted string. + public static string ParameterToString(object obj, IReadableConfiguration configuration = null) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); +{{#net60OrLater}} + if (obj is DateOnly dateOnly) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15 + return dateOnly.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); +{{/net60OrLater}} + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); + + return Convert.ToString(obj, CultureInfo.InvariantCulture); + } + + /// + /// Serializes the given object when not null. Otherwise return null. + /// + /// The object to serialize. + /// Serialized string. + public static string Serialize(object obj) + { + return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// Is the Enum decorated with EnumMember Attribute + /// + /// + /// true if found + private static bool HasEnumMemberAttrValue(object enumVal) + { + if (enumVal == null) + throw new ArgumentNullException(nameof(enumVal)); + var enumType = enumVal.GetType(); + var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); + var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); + if (attr != null) return true; + return false; + } + + /// + /// Get the EnumMember value + /// + /// + /// EnumMember value as string otherwise null + private static string GetEnumMemberAttrValue(object enumVal) + { + if (enumVal == null) + throw new ArgumentNullException(nameof(enumVal)); + var enumType = enumVal.GetType(); + var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); + var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); + if (attr != null) + { + return attr.Value; + } + return null; + } + } +} diff --git a/templates-v7/csharp/Configuration.mustache b/templates-v7/csharp/Configuration.mustache new file mode 100644 index 000000000..069758033 --- /dev/null +++ b/templates-v7/csharp/Configuration.mustache @@ -0,0 +1,737 @@ +{{>partial_header}} + +using System; +{{^net35}} +using System.Collections.Concurrent; +{{/net35}} +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Net.Http; +using System.Net.Security; +{{#useRestSharp}} +{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +{{/useRestSharp}} + +namespace {{packageName}}.Client +{ + /// + /// Represents a set of configuration settings + /// + {{>visibility}} class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "{{packageVersion}}"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent, response.Headers); + } + {{^netStandard}} + if (status == 0) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); + } + {{/netStandard}} + return null; + }; + + #endregion Static Members + + #region Private Members + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + private bool _useDefaultCredentials = false; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for accessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + {{#servers.0}} + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + {{/servers.0}} + + /// + /// Gets or sets the operation servers defined in the OpenAPI spec. + /// + /// The operation servers + private IReadOnlyDictionary>> _operationServers; + + {{#hasHttpSignatureMethods}} + + /// + /// HttpSigning configuration + /// + private HttpSigningConfiguration _HttpSigningConfiguration = null; + {{/hasHttpSignatureMethods}} + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration() + { + Proxy = null; + UserAgent = WebUtility.UrlEncode("{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"); + BasePath = "{{{basePath}}}"; + DefaultHeaders = new {{^net35}}Concurrent{{/net35}}Dictionary(); + ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); + ApiKeyPrefix = new {{^net35}}Concurrent{{/net35}}Dictionary(); + {{#servers}} + {{#-first}} + Servers = new List>() + { + {{/-first}} + { + new Dictionary { + {"url", "{{{url}}}"}, + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, + {{#variables}} + {{#-first}} + { + "variables", new Dictionary { + {{/-first}} + { + "{{{name}}}", new Dictionary { + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, + {"default_value", {{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}"{{{defaultValue}}}"}, + {{#enumValues}} + {{#-first}} + { + "enum_values", new List() { + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + } + } + {{/-last}} + {{/enumValues}} + } + }{{^-last}},{{/-last}} + {{#-last}} + } + } + {{/-last}} + {{/variables}} + } + }{{^-last}},{{/-last}} + {{#-last}} + }; + {{/-last}} + {{/servers}} + OperationServers = new Dictionary>>() + { + {{#apiInfo}} + {{#apis}} + {{#operations}} + {{#operation}} + {{#servers.0}} + { + "{{{classname}}}.{{{nickname}}}", new List> + { + {{#servers}} + { + new Dictionary + { + {"url", "{{{url}}}"}, + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"} + } + }, + {{/servers}} + } + }, + {{/servers.0}} + {{/operation}} + {{/operations}} + {{/apis}} + {{/apiInfo}} + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = TimeSpan.FromSeconds(100); + } + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "{{{basePath}}}") : this() + { + if (string.{{^net35}}IsNullOrWhiteSpace{{/net35}}{{#net35}}IsNullOrEmpty{{/net35}}(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeaders) + { + DefaultHeaders.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + #endregion Constructors + + #region Properties + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath + { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. + /// + public virtual TimeSpan Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + string apiKeyValue; + ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); + string apiKeyPrefix; + if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) + { + return apiKeyPrefix + " " + apiKeyValue; + } + + return apiKeyValue; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + {{#useRestSharp}} + {{#hasOAuthMethods}} + /// + /// Gets or sets the token URL for OAuth2 authentication. + /// + /// The OAuth Token URL. + public virtual string OAuthTokenUrl { get; set; } + + /// + /// Gets or sets the client ID for OAuth2 authentication. + /// + /// The OAuth Client ID. + public virtual string OAuthClientId { get; set; } + + /// + /// Gets or sets the client secret for OAuth2 authentication. + /// + /// The OAuth Client Secret. + public virtual string OAuthClientSecret { get; set; } + + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string{{nrt?}} OAuthScope { get; set; } + + /// + /// Gets or sets the flow for OAuth2 authentication. + /// + /// The OAuth Flow. + public virtual OAuthFlow? OAuthFlow { get; set; } + + {{/hasOAuthMethods}} + {{/useRestSharp}} + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// Whatever you set here will be prepended to the value defined in AddApiKey. + /// + /// An example invocation here might be: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + {{#servers.0}} + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Gets or sets the operation servers. + /// + /// The operation servers. + public virtual IReadOnlyDictionary>> OperationServers + { + get { return _operationServers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Operation servers may not be null."); + } + _operationServers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(Servers, index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + return GetServerUrl(Servers, index, inputVariables); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index) + { + return GetOperationServerUrl(operation, index, null); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) + { + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) + { + return GetServerUrl(operationServer, index, inputVariables); + } + + return null; + } + + /// + /// Returns URL based on server settings. + /// + /// Dictionary of server settings. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) + { + if (index < 0 || index >= servers.Count) + { + throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); + } + + if (inputVariables == null) + { + inputVariables = new Dictionary(); + } + + IReadOnlyDictionary server = servers[index]; + string url = (string)server["url"]; + + if (server.ContainsKey("variables")) + { + // go through each variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + { + url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); + } + else + { + throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); + } + } + else + { + // use default value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + } + + return url; + } + {{/servers.0}} + {{#hasHttpSignatureMethods}} + + /// + /// Gets and Sets the HttpSigningConfiguration + /// + public HttpSigningConfiguration HttpSigningConfiguration + { + get { return _HttpSigningConfiguration; } + set { _HttpSigningConfiguration = value; } + } + {{/hasHttpSignatureMethods}} + + /// + /// Gets and Sets the RemoteCertificateValidationCallback + /// + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + public static string ToDebugReport() + { + string report = "C# SDK ({{{packageName}}}) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: {{{version}}}\n"; + report += " SDK Package Version: {{{packageVersion}}}\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; + foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; + + var config = new Configuration + { + ApiKey = apiKey, + ApiKeyPrefix = apiKeyPrefix, + DefaultHeaders = defaultHeaders, + BasePath = second.BasePath ?? first.BasePath, + Timeout = second.Timeout, + Proxy = second.Proxy ?? first.Proxy, + UserAgent = second.UserAgent ?? first.UserAgent, + Username = second.Username ?? first.Username, + Password = second.Password ?? first.Password, + AccessToken = second.AccessToken ?? first.AccessToken, + {{#useRestSharp}} + {{#hasOAuthMethods}} + OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, + OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, + OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, + OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, + {{/hasOAuthMethods}} + {{/useRestSharp}} + {{#hasHttpSignatureMethods}} + HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, + {{/hasHttpSignatureMethods}} + TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, + DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, + ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, + UseDefaultCredentials = second.UseDefaultCredentials, + RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, + }; + return config; + } + #endregion Static Members + } +} diff --git a/templates-v7/csharp/Configuration.v790.mustache b/templates-v7/csharp/Configuration.v790.mustache new file mode 100644 index 000000000..2753aafb3 --- /dev/null +++ b/templates-v7/csharp/Configuration.v790.mustache @@ -0,0 +1,737 @@ +{{>partial_header}} + +using System; +{{^net35}} +using System.Collections.Concurrent; +{{/net35}} +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Net.Http; +using System.Net.Security; +{{#useRestSharp}} +{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +{{/useRestSharp}} + +namespace {{packageName}}.Client +{ + /// + /// Represents a set of configuration settings + /// + {{>visibility}} class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "{{packageVersion}}"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent, response.Headers); + } + {{^netStandard}} + if (status == 0) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); + } + {{/netStandard}} + return null; + }; + + #endregion Static Members + + #region Private Members + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + private bool _useDefaultCredentials = false; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for accessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + {{#servers.0}} + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + {{/servers.0}} + + /// + /// Gets or sets the operation servers defined in the OpenAPI spec. + /// + /// The operation servers + private IReadOnlyDictionary>> _operationServers; + + {{#hasHttpSignatureMethods}} + + /// + /// HttpSigning configuration + /// + private HttpSigningConfiguration _HttpSigningConfiguration = null; + {{/hasHttpSignatureMethods}} + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration() + { + Proxy = null; + UserAgent = WebUtility.UrlEncode("{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"); + BasePath = "{{{basePath}}}"; + DefaultHeaders = new {{^net35}}Concurrent{{/net35}}Dictionary(); + ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); + ApiKeyPrefix = new {{^net35}}Concurrent{{/net35}}Dictionary(); + {{#servers}} + {{#-first}} + Servers = new List>() + { + {{/-first}} + { + new Dictionary { + {"url", "{{{url}}}"}, + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, + {{#variables}} + {{#-first}} + { + "variables", new Dictionary { + {{/-first}} + { + "{{{name}}}", new Dictionary { + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, + {"default_value", {{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}"{{{defaultValue}}}"}, + {{#enumValues}} + {{#-first}} + { + "enum_values", new List() { + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + } + } + {{/-last}} + {{/enumValues}} + } + }{{^-last}},{{/-last}} + {{#-last}} + } + } + {{/-last}} + {{/variables}} + } + }{{^-last}},{{/-last}} + {{#-last}} + }; + {{/-last}} + {{/servers}} + OperationServers = new Dictionary>>() + { + {{#apiInfo}} + {{#apis}} + {{#operations}} + {{#operation}} + {{#servers.0}} + { + "{{{classname}}}.{{{nickname}}}", new List> + { + {{#servers}} + { + new Dictionary + { + {"url", "{{{url}}}"}, + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"} + } + }, + {{/servers}} + } + }, + {{/servers.0}} + {{/operation}} + {{/operations}} + {{/apis}} + {{/apiInfo}} + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "{{{basePath}}}") : this() + { + if (string.{{^net35}}IsNullOrWhiteSpace{{/net35}}{{#net35}}IsNullOrEmpty{{/net35}}(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeaders) + { + DefaultHeaders.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + #endregion Constructors + + #region Properties + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath + { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// + public virtual int Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + string apiKeyValue; + ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); + string apiKeyPrefix; + if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) + { + return apiKeyPrefix + " " + apiKeyValue; + } + + return apiKeyValue; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + {{#useRestSharp}} + {{#hasOAuthMethods}} + /// + /// Gets or sets the token URL for OAuth2 authentication. + /// + /// The OAuth Token URL. + public virtual string OAuthTokenUrl { get; set; } + + /// + /// Gets or sets the client ID for OAuth2 authentication. + /// + /// The OAuth Client ID. + public virtual string OAuthClientId { get; set; } + + /// + /// Gets or sets the client secret for OAuth2 authentication. + /// + /// The OAuth Client Secret. + public virtual string OAuthClientSecret { get; set; } + + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string{{nrt?}} OAuthScope { get; set; } + + /// + /// Gets or sets the flow for OAuth2 authentication. + /// + /// The OAuth Flow. + public virtual OAuthFlow? OAuthFlow { get; set; } + + {{/hasOAuthMethods}} + {{/useRestSharp}} + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// Whatever you set here will be prepended to the value defined in AddApiKey. + /// + /// An example invocation here might be: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + {{#servers.0}} + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Gets or sets the operation servers. + /// + /// The operation servers. + public virtual IReadOnlyDictionary>> OperationServers + { + get { return _operationServers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Operation servers may not be null."); + } + _operationServers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(Servers, index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + return GetServerUrl(Servers, index, inputVariables); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index) + { + return GetOperationServerUrl(operation, index, null); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) + { + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) + { + return GetServerUrl(operationServer, index, inputVariables); + } + + return null; + } + + /// + /// Returns URL based on server settings. + /// + /// Dictionary of server settings. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) + { + if (index < 0 || index >= servers.Count) + { + throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); + } + + if (inputVariables == null) + { + inputVariables = new Dictionary(); + } + + IReadOnlyDictionary server = servers[index]; + string url = (string)server["url"]; + + if (server.ContainsKey("variables")) + { + // go through each variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + { + url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); + } + else + { + throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); + } + } + else + { + // use default value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + } + + return url; + } + {{/servers.0}} + {{#hasHttpSignatureMethods}} + + /// + /// Gets and Sets the HttpSigningConfiguration + /// + public HttpSigningConfiguration HttpSigningConfiguration + { + get { return _HttpSigningConfiguration; } + set { _HttpSigningConfiguration = value; } + } + {{/hasHttpSignatureMethods}} + + /// + /// Gets and Sets the RemoteCertificateValidationCallback + /// + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + public static string ToDebugReport() + { + string report = "C# SDK ({{{packageName}}}) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: {{{version}}}\n"; + report += " SDK Package Version: {{{packageVersion}}}\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; + foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; + + var config = new Configuration + { + ApiKey = apiKey, + ApiKeyPrefix = apiKeyPrefix, + DefaultHeaders = defaultHeaders, + BasePath = second.BasePath ?? first.BasePath, + Timeout = second.Timeout, + Proxy = second.Proxy ?? first.Proxy, + UserAgent = second.UserAgent ?? first.UserAgent, + Username = second.Username ?? first.Username, + Password = second.Password ?? first.Password, + AccessToken = second.AccessToken ?? first.AccessToken, + {{#useRestSharp}} + {{#hasOAuthMethods}} + OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, + OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, + OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, + OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, + {{/hasOAuthMethods}} + {{/useRestSharp}} + {{#hasHttpSignatureMethods}} + HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, + {{/hasHttpSignatureMethods}} + TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, + DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, + ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, + UseDefaultCredentials = second.UseDefaultCredentials, + RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, + }; + return config; + } + #endregion Static Members + } +} diff --git a/templates-v7/csharp/ExceptionFactory.mustache b/templates-v7/csharp/ExceptionFactory.mustache new file mode 100644 index 000000000..4a141f6f1 --- /dev/null +++ b/templates-v7/csharp/ExceptionFactory.mustache @@ -0,0 +1,14 @@ +{{>partial_header}} + +using System; + +namespace {{packageName}}.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + {{>visibility}} delegate Exception ExceptionFactory(string methodName, IApiResponse response); +} diff --git a/templates-v7/csharp/GlobalConfiguration.mustache b/templates-v7/csharp/GlobalConfiguration.mustache new file mode 100644 index 000000000..93a9ab8aa --- /dev/null +++ b/templates-v7/csharp/GlobalConfiguration.mustache @@ -0,0 +1,59 @@ +{{>partial_header}} + +using System.Collections.Generic; + +namespace {{packageName}}.Client +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .openapi-generator-ignore file. + /// + {{>visibility}} partial class GlobalConfiguration : Configuration + { + #region Private Members + + private static readonly object GlobalConfigSync = new { }; + private static IReadableConfiguration _globalConfiguration; + + #endregion Private Members + + #region Constructors + + /// + private GlobalConfiguration() + { + } + + /// + public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) + { + } + + static GlobalConfiguration() + { + Instance = new GlobalConfiguration(); + } + + #endregion Constructors + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static IReadableConfiguration Instance + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + } +} diff --git a/templates-v7/csharp/HttpMethod.mustache b/templates-v7/csharp/HttpMethod.mustache new file mode 100644 index 000000000..904a042a9 --- /dev/null +++ b/templates-v7/csharp/HttpMethod.mustache @@ -0,0 +1,25 @@ +{{>partial_header}} + +namespace {{packageName}}.Client +{ + /// + /// Http methods supported by swagger + /// + public enum HttpMethod + { + /// HTTP GET request. + Get, + /// HTTP POST request. + Post, + /// HTTP PUT request. + Put, + /// HTTP DELETE request. + Delete, + /// HTTP HEAD request. + Head, + /// HTTP OPTIONS request. + Options, + /// HTTP PATCH request. + Patch + } +} diff --git a/templates-v7/csharp/HttpSigningConfiguration.mustache b/templates-v7/csharp/HttpSigningConfiguration.mustache new file mode 100644 index 000000000..97b855dc5 --- /dev/null +++ b/templates-v7/csharp/HttpSigningConfiguration.mustache @@ -0,0 +1,805 @@ +{{>partial_header}} + +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace {{packageName}}.Client +{ + /// + /// Class for HttpSigning auth related parameter and methods + /// + public class HttpSigningConfiguration + { + /// + /// Initialize the HashAlgorithm and SigningAlgorithm to default value + /// + public HttpSigningConfiguration() + { + HashAlgorithm = HashAlgorithmName.SHA256; + SigningAlgorithm = "PKCS1-v15"; + } + + /// + ///Gets the Api keyId + /// + public string KeyId { get; set; } + + /// + /// Gets the Key file path + /// + public string KeyFilePath { get; set; } + + /// + /// Specify the API key in the form of a string, either configure the KeyString property or configure the KeyFilePath property. + /// + public string KeyString { get; set; } + + /// + /// Gets the key pass phrase for password protected key + /// + public SecureString KeyPassPhrase { get; set; } + + /// + /// Gets the HTTP signing header + /// + public List HttpSigningHeader { get; set; } + + /// + /// Gets the hash algorithm sha256 or sha512 + /// + public HashAlgorithmName HashAlgorithm { get; set; } + + /// + /// Gets the signing algorithm + /// + public string SigningAlgorithm { get; set; } + + /// + /// Gets the Signature validity period in seconds + /// + public int SignatureValidityPeriod { get; set; } + + private enum PrivateKeyType + { + None = 0, + RSA = 1, + ECDSA = 2, + } + + /// + /// Gets the Headers for HttpSigning + /// + /// Base path + /// HTTP method + /// Path + /// Request options + /// Http signed headers + public Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + { + const string HEADER_REQUEST_TARGET = "(request-target)"; + //The time when the HTTP signature expires. The API server should reject HTTP requests + //that have expired. + const string HEADER_EXPIRES = "(expires)"; + //The 'Date' header. + const string HEADER_DATE = "Date"; + //The 'Host' header. + const string HEADER_HOST = "Host"; + //The time when the HTTP signature was generated. + const string HEADER_CREATED = "(created)"; + //When the 'Digest' header is included in the HTTP signature, the client automatically + //computes the digest of the HTTP request body, per RFC 3230. + const string HEADER_DIGEST = "Digest"; + //The 'Authorization' header is automatically generated by the client. It includes + //the list of signed headers and a base64-encoded signature. + const string HEADER_AUTHORIZATION = "Authorization"; + + //Read the api key from the file + if(File.Exists(KeyFilePath)) + { + this.KeyString = ReadApiKeyFromFile(KeyFilePath); + } + else if(string.IsNullOrEmpty(KeyString)) + { + throw new Exception("No API key has been provided. Supply it using either KeyFilePath or KeyString"); + } + + //Hash table to store singed headers + var HttpSignedRequestHeader = new Dictionary(); + var HttpSignatureHeader = new Dictionary(); + + if (HttpSigningHeader.Count == 0) + { + HttpSigningHeader.Add("(created)"); + } + + if (requestOptions.PathParameters != null) + { + foreach (var pathParam in requestOptions.PathParameters) + { + var tempPath = path.Replace(pathParam.Key, "0"); + path = string.Format(tempPath, pathParam.Value); + } + } + + var httpValues = HttpUtility.ParseQueryString(string.Empty); + foreach (var parameter in requestOptions.QueryParameters) + { +#if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + if (parameter.Value.Count > 1) + { // array + foreach (var value in parameter.Value) + { + httpValues.Add(key + "[]", value); + } + } + else + { + httpValues.Add(key, parameter.Value[0]); + } +#else + if (parameter.Value.Count > 1) + { // array + foreach (var value in parameter.Value) + { + httpValues.Add(parameter.Key + "[]", value); + } + } + else + { + httpValues.Add(parameter.Key, parameter.Value[0]); + } +#endif + } + var uriBuilder = new UriBuilder(string.Concat(basePath, path)); + uriBuilder.Query = httpValues.ToString().Replace("+", "%20"); + + var dateTime = DateTime.Now; + string Digest = string.Empty; + + //get the body + string requestBody = string.Empty; + if (requestOptions.Data != null) + { + var serializerSettings = new JsonSerializerSettings(); + requestBody = JsonConvert.SerializeObject(requestOptions.Data, serializerSettings); + } + + if (HashAlgorithm == HashAlgorithmName.SHA256) + { + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); + Digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); + } + else if (HashAlgorithm == HashAlgorithmName.SHA512) + { + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); + Digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); + } + else + { + throw new Exception(string.Format("{0} not supported", HashAlgorithm)); + } + + foreach (var header in HttpSigningHeader) + { + if (header.Equals(HEADER_REQUEST_TARGET)) + { + var targetUrl = string.Format("{0} {1}{2}", method.ToLower(), uriBuilder.Path, uriBuilder.Query); + HttpSignatureHeader.Add(header.ToLower(), targetUrl); + } + else if (header.Equals(HEADER_EXPIRES)) + { + var expireDateTime = dateTime.AddSeconds(SignatureValidityPeriod); + HttpSignatureHeader.Add(header.ToLower(), GetUnixTime(expireDateTime).ToString()); + } + else if (header.Equals(HEADER_DATE)) + { + var utcDateTime = dateTime.ToUniversalTime().ToString("r"); + HttpSignatureHeader.Add(header.ToLower(), utcDateTime); + HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); + } + else if (header.Equals(HEADER_HOST)) + { + HttpSignatureHeader.Add(header.ToLower(), uriBuilder.Host); + HttpSignedRequestHeader.Add(HEADER_HOST, uriBuilder.Host); + } + else if (header.Equals(HEADER_CREATED)) + { + HttpSignatureHeader.Add(header.ToLower(), GetUnixTime(dateTime).ToString()); + } + else if (header.Equals(HEADER_DIGEST)) + { + HttpSignedRequestHeader.Add(HEADER_DIGEST, Digest); + HttpSignatureHeader.Add(header.ToLower(), Digest); + } + else + { + bool isHeaderFound = false; + foreach (var item in requestOptions.HeaderParameters) + { + if (string.Equals(item.Key, header, StringComparison.OrdinalIgnoreCase)) + { + HttpSignatureHeader.Add(header.ToLower(), item.Value.ToString()); + isHeaderFound = true; + break; + } + } + if (!isHeaderFound) + { + throw new Exception(string.Format("Cannot sign HTTP request.Request does not contain the {0} header.",header)); + } + } + + } + var headersKeysString = string.Join(" ", HttpSignatureHeader.Keys); + var headerValuesList = new List(); + + foreach (var keyVal in HttpSignatureHeader) + { + headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); + } + //Concatenate headers value separated by new line + var headerValuesString = string.Join("\n", headerValuesList); + var signatureStringHash = GetStringHash(HashAlgorithm, headerValuesString); + string headerSignatureStr = null; + var keyType = GetKeyType(KeyString); + + if (keyType == PrivateKeyType.RSA) + { + headerSignatureStr = GetRSASignature(signatureStringHash); + } + else if (keyType == PrivateKeyType.ECDSA) + { + headerSignatureStr = GetECDSASignature(signatureStringHash); + } + else + { + throw new Exception(string.Format("Private key type {0} not supported", keyType)); + } + const string cryptographicScheme = "hs2019"; + var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", + KeyId, cryptographicScheme); + + if (HttpSignatureHeader.ContainsKey(HEADER_CREATED)) + { + authorizationHeaderValue += string.Format(",created={0}", HttpSignatureHeader[HEADER_CREATED]); + } + + if (HttpSignatureHeader.ContainsKey(HEADER_EXPIRES)) + { + authorizationHeaderValue += string.Format(",expires={0}", HttpSignatureHeader[HEADER_EXPIRES]); + } + + authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", + headersKeysString, headerSignatureStr); + HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); + return HttpSignedRequestHeader; + } + + private byte[] GetStringHash(HashAlgorithmName hashAlgorithmName, string stringToBeHashed) + { + HashAlgorithm{{nrt?}} hashAlgorithm = null; + + if (hashAlgorithmName == HashAlgorithmName.SHA1) + hashAlgorithm = SHA1.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA256) + hashAlgorithm = SHA256.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA512) + hashAlgorithm = SHA512.Create(); + + if (hashAlgorithmName == HashAlgorithmName.MD5) + hashAlgorithm = MD5.Create(); + + if (hashAlgorithm == null) + throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); + + byte[] bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + byte[] stringHash = hashAlgorithm.ComputeHash(bytes); + return stringHash; + } + + private int GetUnixTime(DateTime date2) + { + DateTime date1 = new DateTime(1970, 01, 01); + TimeSpan timeSpan = date2 - date1; + return (int)timeSpan.TotalSeconds; + } + + private string GetRSASignature(byte[] stringToSign) + { + if (string.IsNullOrEmpty(KeyString)) + { + throw new Exception("No API key has been provided."); + } + RSA rsa = GetRSAProviderFromPemFile(KeyString, KeyPassPhrase); + if (SigningAlgorithm == "RSASSA-PSS") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); + return Convert.ToBase64String(signedbytes); + } + else if (SigningAlgorithm == "PKCS1-v15") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); + return Convert.ToBase64String(signedbytes); + } + else + { + return string.Empty; + } + } + + /// + /// Gets the ECDSA signature + /// + /// + /// ECDSA signature + private string GetECDSASignature(byte[] dataToSign) + { + {{#net60OrLater}} + if (!File.Exists(KeyFilePath) && string.IsNullOrEmpty(KeyString)) + { + throw new Exception("No API key has been provided."); + } + + var keyStr = KeyString; + const string ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + const string ecKeyFooter = "-----END EC PRIVATE KEY-----"; + var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); + var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); + var ecdsa = ECDsa.Create(); + + var byteCount = 0; + if (KeyPassPhrase != null) + { + IntPtr unmanagedString = IntPtr.Zero; + try + { + // convert secure string to byte array + unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(KeyPassPhrase); + ecdsa.ImportEncryptedPkcs8PrivateKey(Encoding.UTF8.GetBytes(Marshal.PtrToStringUni(unmanagedString)), keyBytes, out byteCount); + } + finally + { + if (unmanagedString != IntPtr.Zero) + { + Marshal.ZeroFreeBSTR(unmanagedString); + } + } + } + else + ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); + + var derBytes = ecdsa.SignHash(dataToSign, DSASignatureFormat.Rfc3279DerSequence); + var signedString = System.Convert.ToBase64String(derBytes); + + return signedString; + {{/net60OrLater}} + {{^net60OrLater}} + throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); + {{/net60OrLater}} + } + + /// + /// Convert ANS1 format to DER format. Not recommended to use because it generate invalid signature occasionally. + /// + /// + /// + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + { + var derBytes = new List(); + byte derLength = 68; //default length for ECDSA code signing bit 0x44 + byte rbytesLength = 32; //R length 0x20 + byte sbytesLength = 32; //S length 0x20 + var rBytes = new List(); + var sBytes = new List(); + for (int i = 0; i < 32; i++) + { + rBytes.Add(signedBytes[i]); + } + for (int i = 32; i < 64; i++) + { + sBytes.Add(signedBytes[i]); + } + + if (rBytes[0] > 0x7F) + { + derLength++; + rbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(rBytes); + rBytes.Clear(); + rBytes.Add(0x00); + rBytes.AddRange(tempBytes); + } + + if (sBytes[0] > 0x7F) + { + derLength++; + sbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(sBytes); + sBytes.Clear(); + sBytes.Add(0x00); + sBytes.AddRange(tempBytes); + + } + + derBytes.Add(48); //start of the sequence 0x30 + derBytes.Add(derLength); //total length r length, type and r bytes + + derBytes.Add(2); //tag for integer + derBytes.Add(rbytesLength); //length of r + derBytes.AddRange(rBytes); + + derBytes.Add(2); //tag for integer + derBytes.Add(sbytesLength); //length of s + derBytes.AddRange(sBytes); + return derBytes.ToArray(); + } + + private RSACryptoServiceProvider GetRSAProviderFromPemFile(string keyString, SecureString keyPassPhrase = null) + { + if (string.IsNullOrEmpty(KeyString)) + { + throw new Exception("No API key has been provided."); + } + + const string pempubheader = "-----BEGIN PUBLIC KEY-----"; + const string pempubfooter = "-----END PUBLIC KEY-----"; + bool isPrivateKeyFile = true; + byte[] pemkey = null; + string pemstr = keyString; + + if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) + { + isPrivateKeyFile = false; + } + + if (isPrivateKeyFile) + { + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase); + if (pemkey == null) + { + return null; + } + return DecodeRSAPrivateKey(pemkey); + } + return null; + } + + private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase = null) + { + const string pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; + const string pemprivfooter = "-----END RSA PRIVATE KEY-----"; + string pemstr = instr.Trim(); + byte[] binkey; + + if (!pemstr.StartsWith(pemprivheader) || !pemstr.EndsWith(pemprivfooter)) + { + return null; + } + + StringBuilder sb = new StringBuilder(pemstr); + sb.Replace(pemprivheader, ""); + sb.Replace(pemprivfooter, ""); + string pvkstr = sb.ToString().Trim(); + + try + { // if there are no PEM encryption info lines, this is an UNencrypted PEM private key + binkey = Convert.FromBase64String(pvkstr); + return binkey; + } + catch (global::System.FormatException) + { + StringReader str = new StringReader(pvkstr); + + //-------- read PEM encryption info. lines and extract salt ----- + if (!str.ReadLine().StartsWith("Proc-Type: 4,ENCRYPTED")) + { + return null; + } + string saltline = str.ReadLine(); + if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + { + return null; + } + string saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); + byte[] salt = new byte[saltstr.Length / 2]; + for (int i = 0; i < salt.Length; i++) + salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); + if (str.ReadLine() != "") + { + return null; + } + + //------ remaining b64 data is encrypted RSA key ---- + string encryptedstr = str.ReadToEnd(); + + try + { //should have b64 encrypted RSA key now + binkey = Convert.FromBase64String(encryptedstr); + } + catch (global::System.FormatException) + { //data is not in base64 format + return null; + } + + byte[] deskey = GetEncryptedKey(salt, keyPassPhrase, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + if (deskey == null) + { + return null; + } + + //------ Decrypt the encrypted 3des-encrypted RSA private key ------ + byte[] rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV + return rsakey; + } + } + + private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) + { + byte[] bytesModulus, bytesE, bytesD, bytesP, bytesQ, bytesDP, bytesDQ, bytesIQ; + + // --------- Set up stream to decode the asn.1 encoded RSA private key ------ + MemoryStream mem = new MemoryStream(privkey); + BinaryReader binr = new BinaryReader(mem); //wrap Memory Stream with BinaryReader for easy reading + byte bt = 0; + ushort twobytes = 0; + int elems = 0; + try + { + twobytes = binr.ReadUInt16(); + if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + { + binr.ReadByte(); //advance 1 byte + } + else if (twobytes == 0x8230) + { + binr.ReadInt16(); //advance 2 bytes + } + else + { + return null; + } + + twobytes = binr.ReadUInt16(); + if (twobytes != 0x0102) //version number + { + return null; + } + bt = binr.ReadByte(); + if (bt != 0x00) + { + return null; + } + + //------ all private key components are Integer sequences ---- + elems = GetIntegerSize(binr); + bytesModulus = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesE = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesD = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesDP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesDQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesIQ = binr.ReadBytes(elems); + + // ------- create RSACryptoServiceProvider instance and initialize with public key ----- + RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSAParameters RSAparams = new RSAParameters(); + RSAparams.Modulus = bytesModulus; + RSAparams.Exponent = bytesE; + RSAparams.D = bytesD; + RSAparams.P = bytesP; + RSAparams.Q = bytesQ; + RSAparams.DP = bytesDP; + RSAparams.DQ = bytesDQ; + RSAparams.InverseQ = bytesIQ; + RSA.ImportParameters(RSAparams); + return RSA; + } + catch (Exception) + { + return null; + } + finally + { + binr.Close(); + } + } + + private int GetIntegerSize(BinaryReader binr) + { + byte bt = 0; + byte lowbyte = 0x00; + byte highbyte = 0x00; + int count = 0; + bt = binr.ReadByte(); + if (bt != 0x02) //expect integer + { + return 0; + } + bt = binr.ReadByte(); + + if (bt == 0x81) + { + count = binr.ReadByte(); // data size in next byte + } + else if (bt == 0x82) + { + highbyte = binr.ReadByte(); // data size in next 2 bytes + lowbyte = binr.ReadByte(); + byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; + count = BitConverter.ToInt32(modint, 0); + } + else + { + count = bt; // we already have the data size + } + while (binr.ReadByte() == 0x00) + { + //remove high order zeros in data + count -= 1; + } + binr.BaseStream.Seek(-1, SeekOrigin.Current); + //last ReadByte wasn't a removed zero, so back up a byte + return count; + } + + private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) + { + IntPtr unmanagedPswd = IntPtr.Zero; + const int HASHLENGTH = 16; //MD5 bytes + byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results + + byte[] psbytes = new byte[secpswd.Length]; + unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd); + Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length); + Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd); + + // --- concatenate salt and pswd bytes into fixed data array --- + byte[] data00 = new byte[psbytes.Length + salt.Length]; + Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes + Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes + + // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- + MD5 md5 = MD5.Create(); + byte[] result = null; + byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget + + for (int j = 0; j < miter; j++) + { + // ---- Now hash consecutively for count times ------ + if (j == 0) + { + result = data00; //initialize + } + else + { + Array.Copy(result, hashtarget, result.Length); + Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); + result = hashtarget; + } + + for (int i = 0; i < count; i++) + { + result = md5.ComputeHash(result); + } + Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial + } + byte[] deskey = new byte[24]; + Array.Copy(keymaterial, deskey, deskey.Length); + + Array.Clear(psbytes, 0, psbytes.Length); + Array.Clear(data00, 0, data00.Length); + Array.Clear(result, 0, result.Length); + Array.Clear(hashtarget, 0, hashtarget.Length); + Array.Clear(keymaterial, 0, keymaterial.Length); + return deskey; + } + + private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) + { + MemoryStream memst = new MemoryStream(); + TripleDES alg = TripleDES.Create(); + alg.Key = desKey; + alg.IV = IV; + try + { + CryptoStream cs = new CryptoStream(memst, alg.CreateDecryptor(), CryptoStreamMode.Write); + cs.Write(cipherData, 0, cipherData.Length); + cs.Close(); + } + catch (Exception) + { + return null; + } + byte[] decryptedData = memst.ToArray(); + return decryptedData; + } + + /// + /// Detect the key type from the pem file. + /// + /// api key in string format + /// Private Key Type + private PrivateKeyType GetKeyType(string keyString) + { + string[] key = null; + + if (string.IsNullOrEmpty(keyString)) + { + throw new Exception("No API key has been provided."); + } + + const string ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + const string ecPrivateKeyFooter = "END EC PRIVATE KEY"; + const string rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + const string rsaPrivateFooter = "END RSA PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; + PrivateKeyType keyType; + key = KeyString.TrimEnd().Split('\n'); + + if (key[0].Contains(rsaPrivateKeyHeader) && + key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) + { + keyType = PrivateKeyType.RSA; + } + else if (key[0].Contains(ecPrivateKeyHeader) && + key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + { + keyType = PrivateKeyType.ECDSA; + } + else + { + throw new Exception("The key file path does not exist or key is invalid or key is not supported"); + } + return keyType; + } + + /// + /// Read the api key form the api key file path and stored it in KeyString property. + /// + /// api key file path + private string ReadApiKeyFromFile(string apiKeyFilePath) + { + string apiKeyString = null; + + if(File.Exists(apiKeyFilePath)) + { + apiKeyString = File.ReadAllText(apiKeyFilePath); + } + else + { + throw new Exception("Provided API key file path does not exists."); + } + return apiKeyString; + } + } +} diff --git a/templates-v7/csharp/IApiAccessor.mustache b/templates-v7/csharp/IApiAccessor.mustache new file mode 100644 index 000000000..a269f56e9 --- /dev/null +++ b/templates-v7/csharp/IApiAccessor.mustache @@ -0,0 +1,29 @@ +{{>partial_header}} + +using System; + +namespace {{packageName}}.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + {{>visibility}} interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + IReadableConfiguration Configuration { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + string GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/templates-v7/csharp/IAsynchronousClient.mustache b/templates-v7/csharp/IAsynchronousClient.mustache new file mode 100644 index 000000000..76ddd4adb --- /dev/null +++ b/templates-v7/csharp/IAsynchronousClient.mustache @@ -0,0 +1,92 @@ +{{>partial_header}} + +using System; +using System.Threading.Tasks; + +namespace {{packageName}}.Client +{ + /// + /// Contract for Asynchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface IAsynchronousClient + { + /// + /// Executes a non-blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + } +} diff --git a/templates-v7/csharp/IReadableConfiguration.mustache b/templates-v7/csharp/IReadableConfiguration.mustache new file mode 100644 index 000000000..6712aa632 --- /dev/null +++ b/templates-v7/csharp/IReadableConfiguration.mustache @@ -0,0 +1,178 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; +{{#useRestSharp}} +{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +{{/useRestSharp}} + +namespace {{packageName}}.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + {{#useRestSharp}} + {{#hasOAuthMethods}} + /// + /// Gets the OAuth token URL. + /// + /// OAuth Token URL. + string OAuthTokenUrl { get; } + + /// + /// Gets the OAuth client ID. + /// + /// OAuth Client ID. + string OAuthClientId { get; } + + /// + /// Gets the OAuth client secret. + /// + /// OAuth Client Secret. + string OAuthClientSecret { get; } + + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string{{nrt?}} OAuthScope { get; } + + /// + /// Gets the OAuth flow. + /// + /// OAuth Flow. + OAuthFlow? OAuthFlow { get; } + + {{/hasOAuthMethods}} + {{/useRestSharp}} + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time format. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + [Obsolete("Use DefaultHeaders instead.")] + IDictionary DefaultHeader { get; } + + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout. + /// + /// HTTP connection timeout. + TimeSpan Timeout { get; } + + /// + /// Gets the proxy. + /// + /// Proxy. + WebProxy Proxy { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + bool UseDefaultCredentials { get; } + + /// + /// Get the servers associated with the operation. + /// + /// Operation servers. + IReadOnlyDictionary>> OperationServers { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// + /// Gets the Operation server url at the provided index. + /// + /// Operation server name. + /// Index of the operation server settings. + /// + string GetOperationServerUrl(string operation, int index); + + /// + /// Gets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + X509CertificateCollection ClientCertificates { get; } + {{#hasHttpSignatureMethods}} + + /// + /// Gets the HttpSigning configuration + /// + HttpSigningConfiguration HttpSigningConfiguration { get; } + {{/hasHttpSignatureMethods}} + + /// + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } + } +} diff --git a/templates-v7/csharp/IReadableConfiguration.v790.mustache b/templates-v7/csharp/IReadableConfiguration.v790.mustache new file mode 100644 index 000000000..5981728b4 --- /dev/null +++ b/templates-v7/csharp/IReadableConfiguration.v790.mustache @@ -0,0 +1,178 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; +{{#useRestSharp}} +{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +{{/useRestSharp}} + +namespace {{packageName}}.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + {{#useRestSharp}} + {{#hasOAuthMethods}} + /// + /// Gets the OAuth token URL. + /// + /// OAuth Token URL. + string OAuthTokenUrl { get; } + + /// + /// Gets the OAuth client ID. + /// + /// OAuth Client ID. + string OAuthClientId { get; } + + /// + /// Gets the OAuth client secret. + /// + /// OAuth Client Secret. + string OAuthClientSecret { get; } + + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string{{nrt?}} OAuthScope { get; } + + /// + /// Gets the OAuth flow. + /// + /// OAuth Flow. + OAuthFlow? OAuthFlow { get; } + + {{/hasOAuthMethods}} + {{/useRestSharp}} + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time format. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + [Obsolete("Use DefaultHeaders instead.")] + IDictionary DefaultHeader { get; } + + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout (in milliseconds) + /// + /// HTTP connection timeout. + int Timeout { get; } + + /// + /// Gets the proxy. + /// + /// Proxy. + WebProxy Proxy { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + bool UseDefaultCredentials { get; } + + /// + /// Get the servers associated with the operation. + /// + /// Operation servers. + IReadOnlyDictionary>> OperationServers { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// + /// Gets the Operation server url at the provided index. + /// + /// Operation server name. + /// Index of the operation server settings. + /// + string GetOperationServerUrl(string operation, int index); + + /// + /// Gets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + X509CertificateCollection ClientCertificates { get; } + {{#hasHttpSignatureMethods}} + + /// + /// Gets the HttpSigning configuration + /// + HttpSigningConfiguration HttpSigningConfiguration { get; } + {{/hasHttpSignatureMethods}} + + /// + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } + } +} diff --git a/templates-v7/csharp/ISynchronousClient.mustache b/templates-v7/csharp/ISynchronousClient.mustache new file mode 100644 index 000000000..c09bfbfed --- /dev/null +++ b/templates-v7/csharp/ISynchronousClient.mustache @@ -0,0 +1,85 @@ +{{>partial_header}} + +using System; +using System.IO; + +namespace {{packageName}}.Client +{ + /// + /// Contract for Synchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface ISynchronousClient + { + /// + /// Executes a blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); + } +} diff --git a/templates-v7/csharp/JsonSubTypesTests.mustache b/templates-v7/csharp/JsonSubTypesTests.mustache new file mode 100644 index 000000000..55b1d5183 --- /dev/null +++ b/templates-v7/csharp/JsonSubTypesTests.mustache @@ -0,0 +1,125 @@ +{{>partial_header}} + +using System.Collections.Generic; +using System.Linq; +using JsonSubTypes; +using Newtonsoft.Json; +using NUnit.Framework; + +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.{{modelPackage}}; +using {{packageName}}.Client; + +namespace {{packageName}}.Test.Client +{ + public class JsonSubTypesTests + { + [Test] + public void TestSimpleJsonSubTypesExample() + { + var animal = + JsonConvert.DeserializeObject("{\"Kind\":\"Dog\",\"Breed\":\"Jack Russell Terrier\"}"); + Assert.AreEqual("Jack Russell Terrier", (animal as Dog)?.Breed); + } + + [Test] + public void DeserializeObjectWithCustomMapping() + { + var animal = + JsonConvert.DeserializeObject("{\"Sound\":\"Bark\",\"Breed\":\"Jack Russell Terrier\"}"); + Assert.AreEqual("Jack Russell Terrier", (animal as Dog2)?.Breed); + } + + [Test] + public void DeserializeObjectMappingByPropertyPresence() + { + string json = + "[{\"Department\":\"Department1\",\"JobTitle\":\"JobTitle1\",\"FirstName\":\"FirstName1\",\"LastName\":\"LastName1\"}," + + "{\"Department\":\"Department1\",\"JobTitle\":\"JobTitle1\",\"FirstName\":\"FirstName1\",\"LastName\":\"LastName1\"}," + + "{\"Skill\":\"Painter\",\"FirstName\":\"FirstName1\",\"LastName\":\"LastName1\"}]"; + + + var persons = JsonConvert.DeserializeObject>(json); + Assert.AreEqual("Painter", (persons.Last() as Artist)?.Skill); + } + } + + [JsonConverter(typeof(JsonSubtypes), "Kind")] + public interface IAnimal + { + string Kind { get; } + } + + public class Dog : IAnimal + { + public Dog() + { + Kind = "Dog"; + } + + public string Kind { get; } + public string Breed { get; set; } + } + + class Cat : IAnimal + { + public Cat() + { + Kind = "Cat"; + } + + public string Kind { get; } + bool Declawed { get; set; } + } + + [JsonConverter(typeof(JsonSubtypes), "Sound")] + [JsonSubtypes.KnownSubType(typeof(Dog2), "Bark")] + [JsonSubtypes.KnownSubType(typeof(Cat2), "Meow")] + public class Animal2 + { + public virtual string Sound { get; } + public string Color { get; set; } + } + + public class Dog2 : Animal2 + { + public Dog2() + { + Sound = "Bark"; + } + + public override string Sound { get; } + public string Breed { get; set; } + } + + public class Cat2 : Animal2 + { + public Cat2() + { + Sound = "Meow"; + } + + public override string Sound { get; } + public bool Declawed { get; set; } + } + + [JsonConverter(typeof(JsonSubtypes))] + [JsonSubtypes.KnownSubTypeWithProperty(typeof(Employee), "JobTitle")] + [JsonSubtypes.KnownSubTypeWithProperty(typeof(Artist), "Skill")] + public class Person + { + public string FirstName { get; set; } + public string LastName { get; set; } + } + + public class Employee : Person + { + public string Department { get; set; } + public string JobTitle { get; set; } + } + + public class Artist : Person + { + public string Skill { get; set; } + } +} diff --git a/templates-v7/csharp/Multimap.mustache b/templates-v7/csharp/Multimap.mustache new file mode 100644 index 000000000..8624af009 --- /dev/null +++ b/templates-v7/csharp/Multimap.mustache @@ -0,0 +1,287 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace {{packageName}}.Client +{ + /// + /// A dictionary in which one key has many associated values. + /// + /// The type of the key + /// The type of the value associated with the key. + public class Multimap : IDictionary> + { + #region Private Fields + + private readonly Dictionary> _dictionary; + + #endregion Private Fields + + #region Constructors + + /// + /// Empty Constructor. + /// + public Multimap() + { + _dictionary = new Dictionary>(); + } + + /// + /// Constructor with comparer. + /// + /// + public Multimap(IEqualityComparer comparer) + { + _dictionary = new Dictionary>(comparer); + } + + #endregion Constructors + + #region Enumerators + + /// + /// To get the enumerator. + /// + /// Enumerator + public IEnumerator>> GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + /// + /// To get the enumerator. + /// + /// Enumerator + IEnumerator IEnumerable.GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + #endregion Enumerators + + #region Public Members + /// + /// Add values to Multimap + /// + /// Key value pair + public void Add(KeyValuePair> item) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + + /// + /// Add Multimap to Multimap + /// + /// Multimap + public void Add(Multimap multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + + /// + /// Clear Multimap + /// + public void Clear() + { + _dictionary.Clear(); + } + + /// + /// Determines whether Multimap contains the specified item. + /// + /// Key value pair + /// Method needs to be implemented + /// true if the Multimap contains the item; otherwise, false. + public bool Contains(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Copy items of the Multimap to an array, + /// starting at a particular array index. + /// + /// The array that is the destination of the items copied + /// from Multimap. The array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + /// Method needs to be implemented + public void CopyTo(KeyValuePair>[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + /// + /// Removes the specified item from the Multimap. + /// + /// Key value pair + /// true if the item is successfully removed; otherwise, false. + /// Method needs to be implemented + public bool Remove(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Gets the number of items contained in the Multimap. + /// + public int Count => _dictionary.Count; + + /// + /// Gets a value indicating whether the Multimap is read-only. + /// + public bool IsReadOnly => false; + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add the value to Multimap. + public void Add(TKey key, IList value) + { + if (value != null && value.Count > 0) + { + if (_dictionary.TryGetValue(key, out var list)) + { + foreach (var k in value) list.Add(k); + } + else + { + list = new List(value); + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + } + + /// + /// Determines whether the Multimap contains an item with the specified key. + /// + /// The key to locate in the Multimap. + /// true if the Multimap contains an item with + /// the key; otherwise, false. + public bool ContainsKey(TKey key) + { + return _dictionary.ContainsKey(key); + } + + /// + /// Removes item with the specified key from the Multimap. + /// + /// The key to locate in the Multimap. + /// true if the item is successfully removed; otherwise, false. + public bool Remove(TKey key) + { + return TryRemove(key, out var _); + } + + /// + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// When this method returns, the value associated with the specified key, if the + /// key is found; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// true if the object that implements Multimap contains + /// an item with the specified key; otherwise, false. + public bool TryGetValue(TKey key, out IList value) + { + return _dictionary.TryGetValue(key, out value); + } + + /// + /// Gets or sets the item with the specified key. + /// + /// The key of the item to get or set. + /// The value of the specified key. + public IList this[TKey key] + { + get => _dictionary[key]; + set => _dictionary[key] = value; + } + + /// + /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. + /// + public ICollection Keys => _dictionary.Keys; + + /// + /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. + /// + public ICollection> Values => _dictionary.Values; + + /// + /// Copy the items of the Multimap to an System.Array, + /// starting at a particular System.Array index. + /// + /// The one-dimensional System.Array that is the destination of the items copied + /// from Multimap. The System.Array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + public void CopyTo(Array array, int index) + { + ((ICollection)_dictionary).CopyTo(array, index); + } + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add value to Multimap. + public void Add(TKey key, TValue value) + { + if (value != null) + { + if (_dictionary.TryGetValue(key, out var list)) + { + list.Add(value); + } + else + { + list = new List { value }; + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add value to Multimap."); + } + } + } + + #endregion Public Members + + #region Private Members + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryRemove(TKey key, out IList value) + { + _dictionary.TryGetValue(key, out value); + return _dictionary.Remove(key); + } + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryAdd(TKey key, IList value) + { + try + { + _dictionary.Add(key, value); + } + catch (ArgumentException) + { + return false; + } + + return true; + } + #endregion Private Members + } +} diff --git a/templates-v7/csharp/NullConditionalParameter.mustache b/templates-v7/csharp/NullConditionalParameter.mustache new file mode 100644 index 000000000..d8ad92666 --- /dev/null +++ b/templates-v7/csharp/NullConditionalParameter.mustache @@ -0,0 +1 @@ +{{#isNullable}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}} \ No newline at end of file diff --git a/templates-v7/csharp/NullConditionalProperty.mustache b/templates-v7/csharp/NullConditionalProperty.mustache new file mode 100644 index 000000000..7dcafa803 --- /dev/null +++ b/templates-v7/csharp/NullConditionalProperty.mustache @@ -0,0 +1 @@ +{{#lambda.first}}{{#isNullable}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} \ No newline at end of file diff --git a/templates-v7/csharp/OpenAPIDateConverter.mustache b/templates-v7/csharp/OpenAPIDateConverter.mustache new file mode 100644 index 000000000..d79051025 --- /dev/null +++ b/templates-v7/csharp/OpenAPIDateConverter.mustache @@ -0,0 +1,21 @@ +{{>partial_header}} +using Newtonsoft.Json.Converters; + +namespace {{packageName}}.Client +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/templates-v7/csharp/README.mustache b/templates-v7/csharp/README.mustache new file mode 100644 index 000000000..0ef94566a --- /dev/null +++ b/templates-v7/csharp/README.mustache @@ -0,0 +1,267 @@ +# {{packageName}} - the C# library for the {{appName}} + +{{#appDescriptionWithNewLines}} +{{{.}}} +{{/appDescriptionWithNewLines}} + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- SDK version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} +- Build package: {{generatorClass}} +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + + +## Frameworks supported +{{#netStandard}} +- .NET Core >=1.0 +- .NET Framework >=4.6 +- Mono/Xamarin >=vNext +{{/netStandard}} + + +## Dependencies + +{{#useRestSharp}} +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 112.0.0 or later +{{/useRestSharp}} +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later +{{#useCompareNetObjects}} +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +{{/useCompareNetObjects}} +{{#validatable}} +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later +{{/validatable}} + +The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +``` +{{#useRestSharp}} +Install-Package RestSharp +{{/useRestSharp}} +Install-Package Newtonsoft.Json +Install-Package JsonSubTypes +{{#validatable}} +Install-Package System.ComponentModel.Annotations +{{/validatable}} +{{#useCompareNetObjects}} +Install-Package CompareNETObjects +{{/useCompareNetObjects}} +``` +{{#useRestSharp}} + +NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742). +NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406). + +{{/useRestSharp}} + +## Installation +{{#netStandard}} +Generate the DLL using your preferred tool (e.g. `dotnet build`) +{{/netStandard}} +{{^netStandard}} +Run the following command to generate the DLL +- [Mac/Linux] `/bin/sh build.sh` +- [Windows] `build.bat` +{{/netStandard}} + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; +``` +{{^netStandard}} + +## Packaging + +A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. + +This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly: + +``` +nuget pack -Build -OutputDirectory out {{packageName}}.csproj +``` + +Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. + +{{/netStandard}} + +## Usage + +To use the API client with a HTTP proxy, setup a `System.Net.WebProxy` +```csharp +Configuration c = new Configuration(); +System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/"); +webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; +c.Proxy = webProxy; +``` +{{#useHttpClient}} + +### Connections +Each ApiClass (properly the ApiClient inside it) will create an instance of HttpClient. It will use that for the entire lifecycle and dispose it when called the Dispose method. + +To better manager the connections it's a common practice to reuse the HttpClient and HttpClientHandler (see [here](https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net) for details). To use your own HttpClient instance just pass it to the ApiClass constructor. + +```csharp +HttpClientHandler yourHandler = new HttpClientHandler(); +HttpClient yourHttpClient = new HttpClient(yourHandler); +var api = new YourApiClass(yourHttpClient, yourHandler); +``` + +If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory. + +```csharp +HttpClient yourHttpClient = new HttpClient(); +var api = new YourApiClass(yourHttpClient); +``` +You'll loose some configuration settings, the features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. You need to either manually handle those in your setup of the HttpClient or they won't be available. + +Here an example of DI setup in a sample web project: + +```csharp +services.AddHttpClient(httpClient => + new PetApi(httpClient)); +``` + +{{/useHttpClient}} + + +## Getting Started + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +{{#useHttpClient}} +using System.Net.Http; +{{/useHttpClient}} +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace Example +{ + public class {{operationId}}Example + { + public static void Main() + { +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} + Configuration config = new Configuration(); + config.BasePath = "{{{basePath}}}"; + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + config.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + config.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + {{#useHttpClient}} + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new {{classname}}(httpClient, config, httpClientHandler); + {{/useHttpClient}} + {{^useHttpClient}} + var apiInstance = new {{classname}}(config); + {{/useHttpClient}} + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.WriteLine(result);{{/returnType}} + } + catch (ApiException e) + { + Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + + +## Documentation for Models + +{{#modelPackage}} +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} +{{/modelPackage}} +{{^modelPackage}} +No model defined in this package +{{/modelPackage}} + + +## Documentation for Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: Bearer Authentication +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} diff --git a/templates-v7/csharp/ReadOnlyDictionary.mustache b/templates-v7/csharp/ReadOnlyDictionary.mustache new file mode 100644 index 000000000..1299b2436 --- /dev/null +++ b/templates-v7/csharp/ReadOnlyDictionary.mustache @@ -0,0 +1,137 @@ +{{>partial_header}} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace {{packageName}}.Client +{ + public class ReadOnlyDictionary : IDictionary + { + private IDictionary _dictionaryImplementation; + public IEnumerator> GetEnumerator() + { + return _dictionaryImplementation.GetEnumerator(); + } + + public ReadOnlyDictionary() + { + _dictionaryImplementation = new Dictionary(); + } + + public ReadOnlyDictionary(IDictionary dictionaryImplementation) + { + if (dictionaryImplementation == null) throw new ArgumentNullException("dictionaryImplementation"); + _dictionaryImplementation = dictionaryImplementation; + } + + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable) _dictionaryImplementation).GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + throw new ReadonlyOperationException("This instance is readonly."); + } + + public void Clear() + { + throw new ReadonlyOperationException("This instance is readonly."); + } + + public bool Contains(KeyValuePair item) + { + return _dictionaryImplementation.Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int arrayIndex) + { + _dictionaryImplementation.CopyTo(array, arrayIndex); + } + + public bool Remove(KeyValuePair item) + { + throw new ReadonlyOperationException("This instance is readonly."); + } + + public int Count + { + get { return _dictionaryImplementation.Count; } + } + + public bool IsReadOnly + { + get { return true; } + } + + public void Add(T key, K value) + { + throw new ReadonlyOperationException("This instance is readonly."); + } + + public bool ContainsKey(T key) + { + return _dictionaryImplementation.ContainsKey(key); + } + + public bool Remove(T key) + { + throw new ReadonlyOperationException("This instance is readonly."); + } + + public bool TryGetValue(T key, out K value) + { + return _dictionaryImplementation.TryGetValue(key, out value); + } + + public K this[T key] + { + get { return _dictionaryImplementation[key]; } + set + { + throw new ReadonlyOperationException("This instance is readonly."); + + } + } + + public ICollection Keys + { + get { return _dictionaryImplementation.Keys; } + } + + public ICollection Values + { + get { return _dictionaryImplementation.Values; } + } + } + + [Serializable] + public class ReadonlyOperationException : Exception + { + // + // For guidelines regarding the creation of new exception types, see + // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp + // and + // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp + // + + public ReadonlyOperationException() + { + } + + public ReadonlyOperationException(string message) : base(message) + { + } + + public ReadonlyOperationException(string message, Exception inner) : base(message, inner) + { + } + + protected ReadonlyOperationException( + SerializationInfo info, + StreamingContext context) : base(info, context) + { + } + } +} diff --git a/templates-v7/csharp/RequestOptions.mustache b/templates-v7/csharp/RequestOptions.mustache new file mode 100644 index 000000000..cfc146925 --- /dev/null +++ b/templates-v7/csharp/RequestOptions.mustache @@ -0,0 +1,87 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace {{packageName}}.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + {{#supportsFileParameters}} + /// + /// File parameters to be sent along with the request. + /// + public Multimap FileParameters { get; set; } + {{/supportsFileParameters}} + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Operation associated with the request path. + /// + public string Operation { get; set; } + + /// + /// Index associated with the operation. + /// + public int OperationIndex { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + {{#hasOAuthMethods}} + /// + /// If request should be authenticated with OAuth. + /// + public bool OAuth { get; set; } + + {{/hasOAuthMethods}} + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + {{#supportsFileParameters}} + FileParameters = new Multimap(); + {{/supportsFileParameters}} + Cookies = new List(); + } + } +} diff --git a/templates-v7/csharp/RetryConfiguration.mustache b/templates-v7/csharp/RetryConfiguration.mustache new file mode 100644 index 000000000..78f45b572 --- /dev/null +++ b/templates-v7/csharp/RetryConfiguration.mustache @@ -0,0 +1,41 @@ +{{>partial_header}} + +using Polly; +{{#useRestSharp}} +using RestSharp; +{{/useRestSharp}} +{{#useHttpClient}} +using System.Net.Http; +{{/useHttpClient}} + +namespace {{packageName}}.Client +{ + /// + /// Configuration class to set the polly retry policies to be applied to the requests. + /// + public static class RetryConfiguration + { +{{#useRestSharp}} + /// + /// Retry policy + /// + public static ISyncPolicy RetryPolicy { get; set; } + + /// + /// Async retry policy + /// + public static IAsyncPolicy AsyncRetryPolicy { get; set; } +{{/useRestSharp}} +{{#useHttpClient}} + /// + /// Retry policy + /// + public static ISyncPolicy RetryPolicy { get; set; } + + /// + /// Async retry policy + /// + public static IAsyncPolicy AsyncRetryPolicy { get; set; } +{{/useHttpClient}} + } +} diff --git a/templates-v7/csharp/Solution.mustache b/templates-v7/csharp/Solution.mustache new file mode 100644 index 000000000..b17929b96 --- /dev/null +++ b/templates-v7/csharp/Solution.mustache @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio {{^netStandard}}2012{{/netStandard}}{{#netStandard}}14{{/netStandard}} +VisualStudioVersion = {{^netStandard}}12.0.0.0{{/netStandard}}{{#netStandard}}14.0.25420.1{{/netStandard}} +MinimumVisualStudioVersion = {{^netStandard}}10.0.0.1{{/netStandard}}{{#netStandard}}10.0.40219.1{{/netStandard}} +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "{{sourceFolder}}\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}" +EndProject +{{^excludeTests}}Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{testPackageName}}", "{{sourceFolder}}\{{testPackageName}}\{{testPackageName}}.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +{{/excludeTests}}Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {{packageGuid}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {{packageGuid}}.Debug|Any CPU.Build.0 = Debug|Any CPU + {{packageGuid}}.Release|Any CPU.ActiveCfg = Release|Any CPU + {{packageGuid}}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/templates-v7/csharp/TestProject.mustache b/templates-v7/csharp/TestProject.mustache new file mode 100644 index 000000000..2a27f6a9f --- /dev/null +++ b/templates-v7/csharp/TestProject.mustache @@ -0,0 +1,35 @@ + + + + + false + Properties + {{testPackageName}} + {{testPackageName}} + {{testTargetFramework}} + false + 512 + + + + + + + + + {{packageGuid}} + {{packageName}} + + + diff --git a/templates-v7/csharp/ValidateRegex.mustache b/templates-v7/csharp/ValidateRegex.mustache new file mode 100644 index 000000000..15cf626dc --- /dev/null +++ b/templates-v7/csharp/ValidateRegex.mustache @@ -0,0 +1,6 @@ +// {{{name}}} ({{{dataType}}}) pattern +Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); +if (!regex{{{name}}}.Match(this.{{{name}}}{{#isUuid}}.ToString(){{/isUuid}}).Success) +{ + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" }); +} \ No newline at end of file diff --git a/templates-v7/csharp/WebRequestPathBuilder.mustache b/templates-v7/csharp/WebRequestPathBuilder.mustache new file mode 100644 index 000000000..cc811ae4f --- /dev/null +++ b/templates-v7/csharp/WebRequestPathBuilder.mustache @@ -0,0 +1,45 @@ +{{>partial_header}} +using System; +using System.Collections.Generic; + +namespace {{packageName}}.Client +{ + /// + /// A URI builder + /// + class WebRequestPathBuilder + { + private string _baseUrl; + private string _path; + private string _query = "?"; + public WebRequestPathBuilder(string baseUrl, string path) + { + _baseUrl = baseUrl; + _path = path; + } + + public void AddPathParameters(Dictionary parameters) + { + foreach (var parameter in parameters) + { + _path = _path.Replace("{" + parameter.Key + "}", Uri.EscapeDataString(parameter.Value)); + } + } + + public void AddQueryParameters(Multimap parameters) + { + foreach (var parameter in parameters) + { + foreach (var value in parameter.Value) + { + _query = _query + parameter.Key + "=" + Uri.EscapeDataString(value) + "&"; + } + } + } + + public string GetFullUri() + { + return _baseUrl + _path + _query.Substring(0, _query.Length - 1); + } + } +} diff --git a/templates-v7/csharp/api.mustache b/templates-v7/csharp/api.mustache new file mode 100644 index 000000000..527434ba1 --- /dev/null +++ b/templates-v7/csharp/api.mustache @@ -0,0 +1,799 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using {{packageName}}.Client; +{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +{{#hasImport}}using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.{{apiPackage}} +{ + {{#operations}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor + { + #region Synchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + {{#notes}} + /// + /// {{.}} + /// + {{/notes}} + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// Index associated with the operation. + /// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// Index associated with the operation. + /// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); + {{/operation}} + #endregion Synchronous Operations + } + + {{#supportsAsync}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor + { + #region Asynchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + {{/operation}} + #endregion Asynchronous Operations + } + {{/supportsAsync}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} partial class {{classname}} : {{interfacePrefix}}{{classname}} + { + private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public {{classname}}() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public {{classname}}(string basePath) + { + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + new {{packageName}}.Client.Configuration { BasePath = basePath } + ); + this.Client = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + {{#supportsAsync}} + this.AsynchronousClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + {{/supportsAsync}} + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public {{classname}}({{packageName}}.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + {{#supportsAsync}} + this.AsynchronousClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + {{/supportsAsync}} + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access.{{#supportsAsync}} + /// The client interface for asynchronous API access.{{/supportsAsync}} + /// The configuration object. + public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + {{#supportsAsync}} + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + {{/supportsAsync}} + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + {{#supportsAsync}} + this.AsynchronousClient = asyncClient; + {{/supportsAsync}} + this.Configuration = configuration; + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + {{#supportsAsync}} + /// + /// The client for accessing this underlying API asynchronously. + /// + public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } + {{/supportsAsync}} + + /// + /// The client for accessing this underlying API synchronously. + /// + public {{packageName}}.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public {{packageName}}.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + {{#operation}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// Index associated with the operation. + /// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// Index associated with the operation. + /// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + { + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + } + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{paramName}}[{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}]", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + {{#isArray}} + {{#supportsFileParameters}} + foreach (var file in {{paramName}}) + { + localVarRequestOptions.FileParameters.Add("{{baseName}}", file); + } + {{/supportsFileParameters}} + {{/isArray}} + {{^isArray}} + {{#supportsFileParameters}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} + {{/isArray}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{#isPrimitiveType}}{{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}){{/isPrimitiveType}}{{^isPrimitiveType}}localVarMultipartFormData ? {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}) : {{packageName}}.Client.ClientUtils.Serialize({{paramName}}){{/isPrimitiveType}}); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + {{#isArray}} + {{#supportsFileParameters}} + foreach (var file in {{paramName}}) + { + localVarRequestOptions.FileParameters.Add("{{baseName}}", file); + } + {{/supportsFileParameters}} + {{/isArray}} + {{^isArray}} + {{#supportsFileParameters}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} + {{/isArray}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{#isPrimitiveType}}{{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}){{/isPrimitiveType}}{{^isPrimitiveType}}localVarMultipartFormData ? {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}) : {{packageName}}.Client.ClientUtils.Serialize({{paramName}}){{/isPrimitiveType}}); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + localVarRequestOptions.Operation = "{{classname}}.{{operationId}}"; + localVarRequestOptions.OperationIndex = operationIndex; + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{#isOAuth}} + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{#hasOAuthMethods}} + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + {{/hasOAuthMethods}} + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + {{#supportsAsync}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false);{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + { + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + } + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}}, {{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + {{#constantParams}} + {{#isPathParam}} + // Set client side default value of Path Param "{{baseName}}". + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant path parameter + {{/isPathParam}} + {{/constantParams}} + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + localVarRequestOptions.QueryParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant query parameter + {{/isQueryParam}} + {{/constantParams}} + {{#queryParams}} + {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{paramName}}[{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}]", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + } + {{/required}} + {{/queryParams}} + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + {{/isHeaderParam}} + {{/constantParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + {{#isArray}} + {{#supportsFileParameters}} + foreach (var file in {{paramName}}) + { + localVarRequestOptions.FileParameters.Add("{{baseName}}", file); + } + {{/supportsFileParameters}} + {{/isArray}} + {{^isArray}} + {{#supportsFileParameters}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} + {{/isArray}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + {{#isArray}} + {{#supportsFileParameters}} + foreach (var file in {{paramName}}) + { + localVarRequestOptions.FileParameters.Add("{{baseName}}", file); + } + {{/supportsFileParameters}} + {{/isArray}} + {{^isArray}} + {{#supportsFileParameters}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} + {{/isArray}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + localVarRequestOptions.Operation = "{{classname}}.{{operationId}}"; + localVarRequestOptions.OperationIndex = operationIndex; + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{#hasOAuthMethods}} + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + {{/hasOAuthMethods}} + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} +} diff --git a/templates-v7/csharp/api_doc.mustache b/templates-v7/csharp/api_doc.mustache new file mode 100644 index 000000000..da1654635 --- /dev/null +++ b/templates-v7/csharp/api_doc.mustache @@ -0,0 +1,162 @@ +# {{packageName}}.{{apiPackage}}.{{classname}}{{#description}} +{{.}}{{/description}} + +All URIs are relative to *{{{basePath}}}* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +{{#operations}} +{{#operation}} +| [**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} | +{{/operation}} +{{/operations}} + +{{#operations}} +{{#operation}} + +# **{{{operationId}}}** +> {{returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + +{{{summary}}}{{#notes}} + +{{{.}}}{{/notes}} + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +{{#useHttpClient}} +using System.Net.Http; +{{/useHttpClient}} +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace Example +{ + public class {{operationId}}Example + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "{{{basePath}}}"; + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + config.AddApiKey("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + config.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + {{#useHttpClient}} + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new {{classname}}(httpClient, config, httpClientHandler); + {{/useHttpClient}} + {{^useHttpClient}} + var apiInstance = new {{classname}}(config); + {{/useHttpClient}} + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.WriteLine(result);{{/returnType}} + } + catch (ApiException e) + { + Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the {{operationId}}WithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}ApiResponse<{{{.}}}> response = {{/returnType}}apiInstance.{{{operationId}}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data);{{/returnType}} +} +catch (ApiException e) +{ + Debug.Print("Exception when calling {{classname}}.{{operationId}}WithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +| Name | Type | Description | Notes | +|------|------|-------------|-------| +{{/-last}} +{{/allParams}} +{{#allParams}} +| **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{#responses.0}} + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} + +[[Back to top]](#) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) + +{{/operation}} +{{/operations}} diff --git a/templates-v7/csharp/api_test.mustache b/templates-v7/csharp/api_test.mustache new file mode 100644 index 000000000..78319978a --- /dev/null +++ b/templates-v7/csharp/api_test.mustache @@ -0,0 +1,77 @@ +{{>partial_header}} +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +{{#useRestSharp}} +using RestSharp; +{{/useRestSharp}} +using Xunit; + +using {{packageName}}.Client; +using {{packageName}}.{{apiPackage}}; +{{#hasImport}} +// uncomment below to import models +//using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.Test.Api +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class {{classname}}Tests : IDisposable + { + {{^nonPublicApi}} + private {{classname}} instance; + + {{/nonPublicApi}} + public {{classname}}Tests() + { + {{^nonPublicApi}} + instance = new {{classname}}(); + {{/nonPublicApi}} + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of {{classname}} + /// + [Fact] + public void {{operationId}}InstanceTest() + { + // TODO uncomment below to test 'IsType' {{classname}} + //Assert.IsType<{{classname}}>(instance); + } + {{#operations}} + {{#operation}} + + /// + /// Test {{operationId}} + /// + [Fact] + public void {{operationId}}Test() + { + // TODO uncomment below to test the method and replace null with proper value + {{#allParams}} + //{{{dataType}}} {{paramName}} = null; + {{/allParams}} + //{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}} + //Assert.IsType<{{{.}}}>(response); + {{/returnType}} + } + {{/operation}} + {{/operations}} + } +} diff --git a/templates-v7/csharp/appveyor.mustache b/templates-v7/csharp/appveyor.mustache new file mode 100644 index 000000000..eb85fc2a8 --- /dev/null +++ b/templates-v7/csharp/appveyor.mustache @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\{{{packageName}}}\{{{packageName}}}.csproj -o ../../output -c Release --no-build diff --git a/templates-v7/csharp/auth/OAuthAuthenticator.mustache b/templates-v7/csharp/auth/OAuthAuthenticator.mustache new file mode 100644 index 000000000..c336c8ad5 --- /dev/null +++ b/templates-v7/csharp/auth/OAuthAuthenticator.mustache @@ -0,0 +1,136 @@ +{{>partial_header}} + +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; +using RestSharp; +using RestSharp.Authenticators; + +namespace {{packageName}}.Client.Auth +{ + /// + /// An authenticator for OAuth2 authentication flows + /// + public class OAuthAuthenticator : IAuthenticator + { + private TokenResponse{{nrt?}} _token; + + /// + /// Returns the current authentication token. Can return null if there is no authentication token, or it has expired. + /// + public string{{nrt?}} Token + { + get + { + if (_token == null) return null; + if (_token.ExpiresIn == null) return _token.AccessToken; + if (_token.ExpiresAt < DateTime.Now) return null; + + return _token.AccessToken; + } + } + + readonly string _tokenUrl; + readonly string _clientId; + readonly string _clientSecret; + readonly string{{nrt?}} _scope; + readonly string _grantType; + readonly JsonSerializerSettings _serializerSettings; + readonly IReadableConfiguration _configuration; + + /// + /// Initialize the OAuth2 Authenticator + /// + public OAuthAuthenticator( + string tokenUrl, + string clientId, + string clientSecret, + string{{nrt?}} scope, + OAuthFlow? flow, + JsonSerializerSettings serializerSettings, + IReadableConfiguration configuration) + { + _tokenUrl = tokenUrl; + _clientId = clientId; + _clientSecret = clientSecret; + _scope = scope; + _serializerSettings = serializerSettings; + _configuration = configuration; + + switch (flow) + { + /*case OAuthFlow.ACCESS_CODE: + _grantType = "authorization_code"; + break; + case OAuthFlow.IMPLICIT: + _grantType = "implicit"; + break; + case OAuthFlow.PASSWORD: + _grantType = "password"; + break;*/ + case OAuthFlow.APPLICATION: + _grantType = "client_credentials"; + break; + default: + break; + } + } + + /// + /// Creates an authentication parameter from an access token. + /// + /// An authentication parameter. + protected async ValueTask GetAuthenticationParameter() + { + var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; + return new HeaderParameter(KnownHeaders.Authorization, token); + } + + /// + /// Gets the token from the OAuth2 server. + /// + /// An authentication token. + async Task GetToken() + { + var client = new RestClient(_tokenUrl, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(_serializerSettings, _configuration))); + + var request = new RestRequest(); + if (!string.IsNullOrWhiteSpace(_token?.RefreshToken)) + { + request.AddParameter("grant_type", "refresh_token") + .AddParameter("refresh_token", _token.RefreshToken); + } + else + { + request + .AddParameter("grant_type", _grantType) + .AddParameter("client_id", _clientId) + .AddParameter("client_secret", _clientSecret); + } + if (!string.IsNullOrEmpty(_scope)) + { + request.AddParameter("scope", _scope); + } + _token = await client.PostAsync(request).ConfigureAwait(false); + // RFC6749 - token_type is case insensitive. + // RFC6750 - In Authorization header Bearer should be capitalized. + // Fix the capitalization irrespective of token_type casing. + switch (_token?.TokenType?.ToLower()) + { + case "bearer": + return $"Bearer {_token.AccessToken}"; + default: + return $"{_token?.TokenType} {_token?.AccessToken}"; + } + } + + /// + /// Retrieves the authentication token (creating a new one if necessary) and adds it to the current request + /// + /// + /// + /// + public async ValueTask Authenticate(IRestClient client, RestRequest request) + => request.AddOrUpdateParameter(await GetAuthenticationParameter().ConfigureAwait(false)); + } +} diff --git a/templates-v7/csharp/auth/OAuthFlow.mustache b/templates-v7/csharp/auth/OAuthFlow.mustache new file mode 100644 index 000000000..768ddd0aa --- /dev/null +++ b/templates-v7/csharp/auth/OAuthFlow.mustache @@ -0,0 +1,19 @@ +{{>partial_header}} + +namespace {{packageName}}.Client.Auth +{ + /// + /// Available flows for OAuth2 authentication + /// + public enum OAuthFlow + { + /// Authorization code flow + ACCESS_CODE, + /// Implicit flow + IMPLICIT, + /// Password flow + PASSWORD, + /// Client credentials flow + APPLICATION + } +} \ No newline at end of file diff --git a/templates-v7/csharp/auth/TokenResponse.mustache b/templates-v7/csharp/auth/TokenResponse.mustache new file mode 100644 index 000000000..7a72e04c1 --- /dev/null +++ b/templates-v7/csharp/auth/TokenResponse.mustache @@ -0,0 +1,24 @@ +{{>partial_header}} + +using System; +using Newtonsoft.Json; + +namespace {{packageName}}.Client.Auth +{ + class TokenResponse + { + [JsonProperty("token_type")] + public string TokenType { get; set; } + [JsonProperty("access_token")] + public string AccessToken { get; set; } + [JsonProperty("expires_in")] + public int? ExpiresIn { get; set; } + [JsonProperty("created")] + public DateTime? Created { get; set; } + + [JsonProperty("refresh_token")] + public string{{nrt?}} RefreshToken { get; set; } + + public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value); + } +} \ No newline at end of file diff --git a/templates-v7/csharp/git_push.sh.mustache b/templates-v7/csharp/git_push.sh.mustache new file mode 100644 index 000000000..0e3776ae6 --- /dev/null +++ b/templates-v7/csharp/git_push.sh.mustache @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/templates-v7/csharp/gitignore.mustache b/templates-v7/csharp/gitignore.mustache new file mode 100644 index 000000000..1ee53850b --- /dev/null +++ b/templates-v7/csharp/gitignore.mustache @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache b/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache new file mode 100644 index 000000000..394c65720 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache @@ -0,0 +1,2 @@ + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ApiException.mustache b/templates-v7/csharp/libraries/generichost/ApiException.mustache new file mode 100644 index 000000000..c14c1010f --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/ApiException.mustache @@ -0,0 +1,46 @@ +// +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// API Exception + /// + {{>visibility}} class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string{{nrt?}} ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string{{nrt?}} reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/templates-v7/csharp/libraries/generichost/ApiFactory.mustache b/templates-v7/csharp/libraries/generichost/ApiFactory.mustache new file mode 100644 index 000000000..a445d2169 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/ApiFactory.mustache @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{apiPackage}}; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// An IApiFactory interface + /// + {{>visibility}} interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + {{>visibility}} class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache b/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache new file mode 100644 index 000000000..d3f1f5214 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache @@ -0,0 +1,56 @@ +// +{{partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// A token constructed from an apiKey. + /// + {{>visibility}} class ApiKeyToken : TokenBase + { + private string _raw; + + /// + /// The header that this token will be used with. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs an ApiKeyToken object. + /// + /// + /// + /// + /// + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + { + Header = header; + _raw = $"{ prefix }{ value }"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); + } + + /// + /// Places the token in the query. + /// + /// + /// + /// + public virtual void UseInQuery(global::System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) + { + parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(){{nrt!}}; + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ApiResponseEventArgs`1.mustache b/templates-v7/csharp/libraries/generichost/ApiResponseEventArgs`1.mustache new file mode 100644 index 000000000..aea35fae1 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/ApiResponseEventArgs`1.mustache @@ -0,0 +1,24 @@ +using System; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Useful for tracking server health + /// + {{>visibility}} class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache b/templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache new file mode 100644 index 000000000..1b12e4173 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache @@ -0,0 +1,170 @@ +// +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +{{^netStandard}} +using System.Diagnostics.CodeAnalysis; +{{/netStandard}} +using System.Net; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + {{>visibility}} partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string{{nrt?}} ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri{{nrt?}} RequestUri { get; } + } + + /// + /// API Response + /// + {{>visibility}} partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string{{nrt?}} ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri{{nrt?}} RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + {{#x-http-statuses-with-return}} + + /// + /// An interface for responses of type {{TType}} + /// + /// + {{>visibility}} interface I{{.}} : IApiResponse + { + /// + /// Deserializes the response if the response is {{.}} + /// + /// + TType {{.}}(); + + /// + /// Returns true if the response is {{.}} and the deserialized response is not null + /// + /// + /// + bool Try{{.}}({{#net60OrLater}}[NotNullWhen(true)]{{/net60OrLater}}out TType{{nrt?}} result); + } + {{/x-http-statuses-with-return}} +} diff --git a/templates-v7/csharp/libraries/generichost/ApiTestsBase.mustache b/templates-v7/csharp/libraries/generichost/ApiTestsBase.mustache new file mode 100644 index 000000000..c71bc79b9 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/ApiTestsBase.mustache @@ -0,0 +1,65 @@ +{{>partial_header}} +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using {{packageName}}.{{clientPackage}};{{#hasImport}} +using {{packageName}}.{{modelPackage}};{{/hasImport}} +using {{packageName}}.Extensions; + + +{{>testInstructions}} + + +namespace {{packageName}}.Test.{{apiPackage}} +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .Configure{{apiName}}((context, services, options) => + { + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + string apiKeyTokenValue{{-index}} = context.Configuration[""] ?? throw new Exception("Token not found."); + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}(apiKeyTokenValue{{-index}}, ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + string bearerTokenValue{{-index}} = context.Configuration[""] ?? throw new Exception("Token not found."); + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}(bearerTokenValue{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + string basicTokenUsername{{-index}} = context.Configuration[""] ?? throw new Exception("Username not found."); + string basicTokenPassword{{-index}} = context.Configuration[""] ?? throw new Exception("Password not found."); + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}(basicTokenUsername{{-index}}, basicTokenPassword{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + string oauthTokenValue{{-index}} = context.Configuration[""] ?? throw new Exception("Token not found."); + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}(oauthTokenValue{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} + }); + } +} diff --git a/templates-v7/csharp/libraries/generichost/AsModel.mustache b/templates-v7/csharp/libraries/generichost/AsModel.mustache new file mode 100644 index 000000000..96bedfa46 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/AsModel.mustache @@ -0,0 +1,4 @@ +// This logic may be modified with the AsModel.mustache template +return Is{{vendorExtensions.x-http-status}} + ? System.Text.Json.JsonSerializer.Deserialize<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}>(RawContent, _jsonSerializerOptions) + : {{#net60OrLater}}null{{/net60OrLater}}{{^net60OrLater}}default{{/net60OrLater}}; diff --git a/templates-v7/csharp/libraries/generichost/Assembly.mustache b/templates-v7/csharp/libraries/generichost/Assembly.mustache new file mode 100644 index 000000000..a22cc2326 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/Assembly.mustache @@ -0,0 +1,2 @@ +[assembly: InternalsVisibleTo("{{packageName}}.Test")] + diff --git a/templates-v7/csharp/libraries/generichost/BasicToken.mustache b/templates-v7/csharp/libraries/generichost/BasicToken.mustache new file mode 100644 index 000000000..ed6f53e54 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/BasicToken.mustache @@ -0,0 +1,46 @@ +// +{{partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// A token constructed from a username and password. + /// + {{>visibility}} class BasicToken : TokenBase + { + private string _username; + + private string _password; + + /// + /// Constructs a BasicToken object. + /// + /// + /// + /// + public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) + { + _username = username; + + _password = password; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", {{packageName}}.Client.ClientUtils.Base64Encode(_username + ":" + _password)); + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/BearerToken.mustache b/templates-v7/csharp/libraries/generichost/BearerToken.mustache new file mode 100644 index 000000000..761f598d8 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/BearerToken.mustache @@ -0,0 +1,41 @@ +// +{{partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// A token constructed from a token from a bearer token. + /// + {{>visibility}} class BearerToken : TokenBase + { + private string _raw; + + /// + /// Constructs a BearerToken object. + /// + /// + /// + public BearerToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache new file mode 100644 index 000000000..357d2197c --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache @@ -0,0 +1,404 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions;{{#useCompareNetObjects}} +using KellermanSoftware.CompareNetObjects;{{/useCompareNetObjects}} +{{#models}} +{{#-first}} +using {{packageName}}.{{modelPackage}}; +{{/-first}} +{{/models}} +using System.Runtime.CompilerServices; + +{{>Assembly}}namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + {{>visibility}} static {{#net70OrLater}}partial {{/net70OrLater}}class ClientUtils + { + {{#useCompareNetObjects}} + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + {{#equatable}} + ComparisonConfig comparisonConfig = new{{^net70OrLater}} ComparisonConfig{{/net70OrLater}}(); + comparisonConfig.UseHashCodeIdentifier = true; + {{/equatable}} + compareLogic = new{{^net70OrLater}} CompareLogic{{/net70OrLater}}({{#equatable}}comparisonConfig{{/equatable}}); + } + {{/useCompareNetObjects}} + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + {{#hasApiKeyMethods}} + /// + /// An enum of headers + /// + public enum ApiKeyHeader + { + {{#apiKeyMethods}} + /// + /// The {{keyParamName}} header + /// + {{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}{{^-last}},{{/-last}} + {{/apiKeyMethods}} + } + + /// + /// Converte an ApiKeyHeader to a string + /// + /// + /// + /// + {{>visibility}} static string ApiKeyHeaderToString(ApiKeyHeader value) + { + {{#net80OrLater}} + return value switch + { + {{#apiKeyMethods}} + ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}} => "{{keyParamName}}", + {{/apiKeyMethods}} + _ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)), + }; + {{/net80OrLater}} + {{^net80OrLater}} + switch(value) + { + {{#apiKeyMethods}} + case ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}: + return "{{keyParamName}}"; + {{/apiKeyMethods}} + default: + throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); + } + {{/net80OrLater}} + } + + {{/hasApiKeyMethods}} + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, {{#net60OrLater}}[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/net60OrLater}}out T{{#nrt}}{{#net60OrLater}}?{{/net60OrLater}}{{/nrt}} result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, {{#net60OrLater}}[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/net60OrLater}}out T{{#nrt}}{{#net60OrLater}}?{{/net60OrLater}}{{/nrt}} result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string{{nrt?}} ParameterToString(object{{nrt?}} obj, string{{nrt?}} format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + {{#net60OrLater}} + if (obj is DateOnly dateOnly) + return dateOnly.ToString(format); + {{/net60OrLater}} + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + {{#models}} + {{#model}} + {{#isEnum}} + if (obj is {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{classname}}ValueConverter.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/isEnum}} + {{^isEnum}} + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} + if (obj is {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} + if (obj is {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/complexType}} + {{/isEnum}} + {{/vars}} + {{/isEnum}} + {{/model}} + {{/models}} + if (obj is ICollection collection) + { + List entries = new{{^net70OrLater}} List{{/net70OrLater}}(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string{{nrt?}} SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string{{nrt?}} SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + {{#net70OrLater}} + [GeneratedRegex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$")] + private static partial Regex JsonRegex(); + {{/net70OrLater}} + {{^net70OrLater}} + private static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + {{/net70OrLater}} + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return {{#net70OrLater}}JsonRegex(){{/net70OrLater}}{{^net70OrLater}}JsonRegex{{/net70OrLater}}.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string{{nrt?}} GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string{{nrt?}} localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + + /// + /// The base path of the API + /// + public const string BASE_ADDRESS = "{{{basePath}}}"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "{{{scheme}}}"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = "{{contextPath}}"; + + /// + /// The host of the API + /// + public const string HOST = "{{{host}}}"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/templates-v7/csharp/libraries/generichost/CookieContainer.mustache b/templates-v7/csharp/libraries/generichost/CookieContainer.mustache new file mode 100644 index 000000000..f96d4fb41 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/CookieContainer.mustache @@ -0,0 +1,22 @@ +// +{{partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System.Linq; +using System.Collections.Generic; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// A class containing a CookieContainer + /// + {{>visibility}} sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/DateFormats.mustache b/templates-v7/csharp/libraries/generichost/DateFormats.mustache new file mode 100644 index 000000000..920ecda88 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/DateFormats.mustache @@ -0,0 +1,2 @@ + "yyyy'-'MM'-'dd", + "yyyyMMdd" diff --git a/templates-v7/csharp/libraries/generichost/DateOnlyJsonConverter.mustache b/templates-v7/csharp/libraries/generichost/DateOnlyJsonConverter.mustache new file mode 100644 index 000000000..209979c8d --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/DateOnlyJsonConverter.mustache @@ -0,0 +1,51 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateOnlyJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateFormats}} + }; + + /// + /// Returns a DateOnly from the Json object + /// + /// + /// + /// + /// + public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(){{nrt!}}; + + foreach(string format in Formats) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnly dateOnlyValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateOnlyValue.ToString("{{{dateFormat}}}", CultureInfo.InvariantCulture)); + } +} diff --git a/templates-v7/csharp/libraries/generichost/DateOnlyNullableJsonConverter.mustache b/templates-v7/csharp/libraries/generichost/DateOnlyNullableJsonConverter.mustache new file mode 100644 index 000000000..17c847365 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/DateOnlyNullableJsonConverter.mustache @@ -0,0 +1,56 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateOnlyNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateFormats}} + }; + + /// + /// Returns a DateOnly from the Json object + /// + /// + /// + /// + /// + public override DateOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(){{nrt!}}; + + foreach(string format in Formats) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnly? dateOnlyValue, JsonSerializerOptions options) + { + if (dateOnlyValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateOnlyValue.Value.ToString("{{{dateFormat}}}", CultureInfo.InvariantCulture)); + } + } +} diff --git a/templates-v7/csharp/libraries/generichost/DateTimeFormats.mustache b/templates-v7/csharp/libraries/generichost/DateTimeFormats.mustache new file mode 100644 index 000000000..85ed99a2c --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/DateTimeFormats.mustache @@ -0,0 +1,22 @@ + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + {{^supportsDateOnly}} + "yyyy'-'MM'-'dd", + {{/supportsDateOnly}} + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + {{^supportsDateOnly}} + "yyyyMMdd" + {{/supportsDateOnly}} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/DateTimeJsonConverter.mustache b/templates-v7/csharp/libraries/generichost/DateTimeJsonConverter.mustache new file mode 100644 index 000000000..c5187f508 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/DateTimeJsonConverter.mustache @@ -0,0 +1,51 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for {{#supportsDateOnly}}'date-time'{{/supportsDateOnly}}{{^supportsDateOnly}}'date' and 'date-time'{{/supportsDateOnly}} openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateTimeFormats}} + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(){{nrt!}}; + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("{{{dateTimeFormat}}}", CultureInfo.InvariantCulture)); + } +} diff --git a/templates-v7/csharp/libraries/generichost/DateTimeNullableJsonConverter.mustache b/templates-v7/csharp/libraries/generichost/DateTimeNullableJsonConverter.mustache new file mode 100644 index 000000000..646c72947 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/DateTimeNullableJsonConverter.mustache @@ -0,0 +1,56 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for {{#supportsDateOnly}}'date-time'{{/supportsDateOnly}}{{^supportsDateOnly}}'date' and 'date-time'{{/supportsDateOnly}} openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateTimeFormats}} + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(){{nrt!}}; + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("{{{dateTimeFormat}}}", CultureInfo.InvariantCulture)); + } + } +} diff --git a/templates-v7/csharp/libraries/generichost/DependencyInjectionTests.mustache b/templates-v7/csharp/libraries/generichost/DependencyInjectionTests.mustache new file mode 100644 index 000000000..6085b51e5 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/DependencyInjectionTests.mustache @@ -0,0 +1,211 @@ +{{>partial_header}} +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using {{packageName}}.{{clientPackage}}; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Extensions; +using Xunit; + +namespace {{packageName}}.Test.{{apiPackage}} +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).Configure{{apiName}}((context, services, options) => + { + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).Configure{{apiName}}((context, services, options) => + { + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} + options.Add{{apiName}}HttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).ConfigureServices((host, services) => + { + services.Add{{apiName}}(options => + { + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).ConfigureServices((host, services) => + { + services.Add{{apiName}}(options => + { + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} + options.Add{{apiName}}HttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingConfigureWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + + {{/-last}}{{/apis}}{{/apiInfo}} + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + + {{/-last}}{{/apis}}{{/apiInfo}} + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingAddWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + + {{/-last}}{{/apis}}{{/apiInfo}} + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingAddWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + + {{/-last}}{{/apis}}{{/apiInfo}} + } + } +} diff --git a/templates-v7/csharp/libraries/generichost/EnumValueDataType.mustache b/templates-v7/csharp/libraries/generichost/EnumValueDataType.mustache new file mode 100644 index 000000000..e92e67b36 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/EnumValueDataType.mustache @@ -0,0 +1 @@ +{{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}{{^isNumeric}}string{{/isNumeric}}{{/isString}}{{#isNumeric}}{{#isLong}}long{{/isLong}}{{#isFloat}}float{{/isFloat}}{{#isDouble}}double{{/isDouble}}{{#isDecimal}}decimal{{/isDecimal}}{{^isLong}}{{^isFloat}}{{^isDouble}}{{^isDecimal}}int{{/isDecimal}}{{/isDouble}}{{/isFloat}}{{/isLong}}{{/isNumeric}}{{/-first}}{{/enumVars}}{{/allowableValues}} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ExceptionEventArgs.mustache b/templates-v7/csharp/libraries/generichost/ExceptionEventArgs.mustache new file mode 100644 index 000000000..b74fcfa0a --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/ExceptionEventArgs.mustache @@ -0,0 +1,24 @@ +using System; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Useful for tracking server health + /// + {{>visibility}} class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExceptionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache new file mode 100644 index 000000000..1333f0e67 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -0,0 +1,166 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{apiPackage}}; +{{#models}} +{{#-first}} +using {{packageName}}.{{modelPackage}}; +{{/-first}} +{{/models}} + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Provides hosting configuration for {{packageName}} + /// + {{>visibility}} class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + {{#supportsDateOnly}} + _jsonOptions.Converters.Add(new DateOnlyJsonConverter()); + _jsonOptions.Converters.Add(new DateOnlyNullableJsonConverter()); + {{/supportsDateOnly}} + {{#models}} + {{#model}} + {{#isEnum}} + _jsonOptions.Converters.Add(new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter()); + _jsonOptions.Converters.Add(new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter()); + {{/isEnum}} + {{^isEnum}} + _jsonOptions.Converters.Add(new {{classname}}JsonConverter()); + {{/isEnum}} + {{/model}} + {{/models}} + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new{{^net60OrLater}} JsonSerializerOptionsProvider{{/net60OrLater}}(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + {{#useSourceGeneration}} + + {{#models}} + {{#-first}} + _jsonOptions.TypeInfoResolver = System.Text.Json.Serialization.Metadata.JsonTypeInfoResolver.Combine( + {{/-first}} + {{/models}} + {{#lambda.joinLinesWithComma}} + {{#models}} + {{#model}} + new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}SerializationContext(){{#-last}},{{/-last}} + {{/model}} + {{/models}} + {{/lambda.joinLinesWithComma}} + {{#models}} + {{#-last}} + + new System.Text.Json.Serialization.Metadata.DefaultJsonTypeInfoResolver() + ); + {{/-last}} + {{/models}} + + {{/useSourceGeneration}} + _services.AddSingleton();{{#apiInfo}}{{#apis}} + _services.AddSingleton<{{classname}}Events>(); + _services.AddTransient<{{interfacePrefix}}{{classname}}, {{classname}}>();{{/apis}}{{/apiInfo}} + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration Add{{apiName}}HttpClients + ( + Action{{nrt?}} client = null, Action{{nrt?}} builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + {{#apiInfo}}{{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, {{classname}}>(client)); + {{/apis}}{{/apiInfo}} + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/templates-v7/csharp/libraries/generichost/HttpSigningConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HttpSigningConfiguration.mustache new file mode 100644 index 000000000..357626fcc --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/HttpSigningConfiguration.mustache @@ -0,0 +1,678 @@ +// +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Class for HttpSigning auth related parameter and methods + /// + {{>visibility}} class HttpSigningConfiguration + { + /// + /// Create an instance + /// + public HttpSigningConfiguration(string keyId, string keyFilePath, SecureString{{nrt?}} keyPassPhrase, List httpSigningHeader, HashAlgorithmName hashAlgorithm, string signingAlgorithm, int signatureValidityPeriod) + { + KeyId = keyId; + KeyFilePath = keyFilePath; + KeyPassPhrase = keyPassPhrase; + HttpSigningHeader = httpSigningHeader; + HashAlgorithm = hashAlgorithm; + SigningAlgorithm = signingAlgorithm; + SignatureValidityPeriod = signatureValidityPeriod; + } + + /// + ///Gets the Api keyId + /// + public string KeyId { get; set; } + + /// + /// Gets the Key file path + /// + public string KeyFilePath { get; set; } + + /// + /// Gets the key pass phrase for password protected key + /// + public SecureString{{nrt?}} KeyPassPhrase { get; set; } + + /// + /// Gets the HTTP signing header + /// + public List HttpSigningHeader { get; set; } + + /// + /// Gets the hash algorithm sha256 or sha512 + /// + public HashAlgorithmName HashAlgorithm { get; set; } = HashAlgorithmName.SHA256; + + /// + /// Gets the signing algorithm + /// + public string SigningAlgorithm { get; set; } + + /// + /// Gets the Signature validity period in seconds + /// + public int SignatureValidityPeriod { get; set; } + + private enum PrivateKeyType + { + None = 0, + RSA = 1, + ECDSA = 2, + } + + /// + /// Gets the Headers for HttpSigning + /// + /// + /// + /// + internal Dictionary GetHttpSignedHeader(global::System.Net.Http.HttpRequestMessage request, string requestBody, System.Threading.CancellationToken cancellationToken = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) + { + if (request.RequestUri == null) + throw new NullReferenceException("The request URI was null"); + + const string HEADER_REQUEST_TARGET = "(request-target)"; + + // The time when the HTTP signature expires. The API server should reject HTTP requests that have expired. + const string HEADER_EXPIRES = "(expires)"; + + //The 'Date' header. + const string HEADER_DATE = "Date"; + + //The 'Host' header. + const string HEADER_HOST = "Host"; + + //The time when the HTTP signature was generated. + const string HEADER_CREATED = "(created)"; + + //When the 'Digest' header is included in the HTTP signature, the client automatically + //computes the digest of the HTTP request body, per RFC 3230. + const string HEADER_DIGEST = "Digest"; + + //The 'Authorization' header is automatically generated by the client. It includes + //the list of signed headers and a base64-encoded signature. + const string HEADER_AUTHORIZATION = "Authorization"; + + //Hash table to store singed headers + var HttpSignedRequestHeader = new Dictionary(); + + var httpSignatureHeader = new Dictionary(); + + if (HttpSigningHeader.Count == 0) + HttpSigningHeader.Add("(created)"); + + var dateTime = DateTime.Now; + string digest = String.Empty; + + if (HashAlgorithm == HashAlgorithmName.SHA256) + { + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); + digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); + } + else if (HashAlgorithm == HashAlgorithmName.SHA512) + { + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); + digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); + } + else + throw new Exception(string.Format("{0} not supported", HashAlgorithm)); + + foreach (var header in HttpSigningHeader) + if (header.Equals(HEADER_REQUEST_TARGET)) + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + else if (header.Equals(HEADER_EXPIRES)) + { + var expireDateTime = dateTime.AddSeconds(SignatureValidityPeriod); + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(expireDateTime).ToString()); + } + else if (header.Equals(HEADER_DATE)) + { + var utcDateTime = dateTime.ToString("r").ToString(); + httpSignatureHeader.Add(header.ToLower(), utcDateTime); + HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); + } + else if (header.Equals(HEADER_HOST)) + { + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + HttpSignedRequestHeader.Add(HEADER_HOST, request.RequestUri.ToString()); + } + else if (header.Equals(HEADER_CREATED)) + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(dateTime).ToString()); + else if (header.Equals(HEADER_DIGEST)) + { + HttpSignedRequestHeader.Add(HEADER_DIGEST, digest); + httpSignatureHeader.Add(header.ToLower(), digest); + } + else + { + bool isHeaderFound = false; + foreach (var item in request.Headers) + { + if (string.Equals(item.Key, header, StringComparison.OrdinalIgnoreCase)) + { + httpSignatureHeader.Add(header.ToLower(), item.Value.ToString()); + isHeaderFound = true; + break; + } + } + + if (!isHeaderFound) + throw new Exception(string.Format("Cannot sign HTTP request.Request does not contain the {0} header.",header)); + } + + var headersKeysString = String.Join(" ", httpSignatureHeader.Keys); + var headerValuesList = new List(); + + foreach (var keyVal in httpSignatureHeader) + headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); + + //Concatenate headers value separated by new line + var headerValuesString = string.Join("\n", headerValuesList); + var signatureStringHash = GetStringHash(HashAlgorithm, headerValuesString); + string{{nrt?}} headerSignatureStr = null; + var keyType = GetKeyType(KeyFilePath); + + if (keyType == PrivateKeyType.RSA) + headerSignatureStr = GetRSASignature(signatureStringHash); + + else if (keyType == PrivateKeyType.ECDSA) + headerSignatureStr = GetECDSASignature(signatureStringHash); + + var cryptographicScheme = "hs2019"; + var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", + KeyId, cryptographicScheme); + + if (httpSignatureHeader.ContainsKey(HEADER_CREATED)) + authorizationHeaderValue += string.Format(",created={0}", httpSignatureHeader[HEADER_CREATED]); + + if (httpSignatureHeader.ContainsKey(HEADER_EXPIRES)) + authorizationHeaderValue += string.Format(",expires={0}", httpSignatureHeader[HEADER_EXPIRES]); + + authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); + + HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); + + return HttpSignedRequestHeader; + } + + private byte[] GetStringHash(HashAlgorithmName hashAlgorithmName, string stringToBeHashed) + { + HashAlgorithm{{nrt?}} hashAlgorithm = null; + + if (hashAlgorithmName == HashAlgorithmName.SHA1) + hashAlgorithm = SHA1.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA256) + hashAlgorithm = SHA256.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA512) + hashAlgorithm = SHA512.Create(); + + if (hashAlgorithmName == HashAlgorithmName.MD5) + hashAlgorithm = MD5.Create(); + + if (hashAlgorithm == null) + throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); + + byte[] bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + byte[] stringHash = hashAlgorithm.ComputeHash(bytes); + return stringHash; + } + + private int GetUnixTime(DateTime date2) + { + DateTime date1 = new DateTime(1970, 01, 01); + TimeSpan timeSpan = date2 - date1; + return (int)timeSpan.TotalSeconds; + } + + private string GetRSASignature(byte[] stringToSign) + { + if (KeyPassPhrase == null) + throw new NullReferenceException($"{ nameof(KeyPassPhrase) } was null."); + + RSA{{nrt?}} rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + + if (rsa == null) + return string.Empty; + else if (SigningAlgorithm == "RSASSA-PSS") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); + return Convert.ToBase64String(signedbytes); + } + else if (SigningAlgorithm == "PKCS1-v15") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); + return Convert.ToBase64String(signedbytes); + } + + return string.Empty; + } + + /// + /// Gets the ECDSA signature + /// + /// + /// + private string GetECDSASignature(byte[] dataToSign) + { + {{#net60OrLater}} + if (!File.Exists(KeyFilePath)) + throw new Exception("key file path does not exist."); + + var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + var ecKeyFooter = "-----END EC PRIVATE KEY-----"; + var keyStr = File.ReadAllText(KeyFilePath); + var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); + var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); + var ecdsa = ECDsa.Create(); + + var byteCount = 0; + if (KeyPassPhrase != null) + { + IntPtr unmanagedString = IntPtr.Zero; + try + { + // convert secure string to byte array + unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(KeyPassPhrase); + + string ptrToStringUni = Marshal.PtrToStringUni(unmanagedString) ?? throw new NullReferenceException(); + + ecdsa.ImportEncryptedPkcs8PrivateKey(Encoding.UTF8.GetBytes(ptrToStringUni), keyBytes, out byteCount); + } + finally + { + if (unmanagedString != IntPtr.Zero) + Marshal.ZeroFreeBSTR(unmanagedString); + } + } + else + ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); + + var signedBytes = ecdsa.SignHash(dataToSign); + var derBytes = ConvertToECDSAANS1Format(signedBytes); + var signedString = System.Convert.ToBase64String(derBytes); + + return signedString; + {{/net60OrLater}} + {{^net60OrLater}} + throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); + {{/net60OrLater}} + } + + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + { + var derBytes = new List(); + byte derLength = 68; //default length for ECDSA code signing bit 0x44 + byte rbytesLength = 32; //R length 0x20 + byte sbytesLength = 32; //S length 0x20 + var rBytes = new List(); + var sBytes = new List(); + for (int i = 0; i < 32; i++) + rBytes.Add(signedBytes[i]); + + for (int i = 32; i < 64; i++) + sBytes.Add(signedBytes[i]); + + if (rBytes[0] > 0x7F) + { + derLength++; + rbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(rBytes); + rBytes.Clear(); + rBytes.Add(0x00); + rBytes.AddRange(tempBytes); + } + + if (sBytes[0] > 0x7F) + { + derLength++; + sbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(sBytes); + sBytes.Clear(); + sBytes.Add(0x00); + sBytes.AddRange(tempBytes); + + } + + derBytes.Add(48); //start of the sequence 0x30 + derBytes.Add(derLength); //total length r length, type and r bytes + + derBytes.Add(2); //tag for integer + derBytes.Add(rbytesLength); //length of r + derBytes.AddRange(rBytes); + + derBytes.Add(2); //tag for integer + derBytes.Add(sbytesLength); //length of s + derBytes.AddRange(sBytes); + return derBytes.ToArray(); + } + + private RSACryptoServiceProvider{{nrt?}} GetRSAProviderFromPemFile(String pemfile, SecureString{{nrt?}} keyPassPhrase = null) + { + const String pempubheader = "-----BEGIN PUBLIC KEY-----"; + const String pempubfooter = "-----END PUBLIC KEY-----"; + bool isPrivateKeyFile = true; + byte[]{{nrt?}} pemkey = null; + + if (!File.Exists(pemfile)) + throw new Exception("private key file does not exist."); + + string pemstr = File.ReadAllText(pemfile).Trim(); + + if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) + isPrivateKeyFile = false; + + if (isPrivateKeyFile) + { + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase); + + if (pemkey == null) + return null; + + return DecodeRSAPrivateKey(pemkey); + } + return null; + } + + private byte[]{{nrt?}} ConvertPrivateKeyToBytes(String instr, SecureString{{nrt?}} keyPassPhrase = null) + { + const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; + const String pemprivfooter = "-----END RSA PRIVATE KEY-----"; + String pemstr = instr.Trim(); + byte[] binkey; + + if (!pemstr.StartsWith(pemprivheader) || !pemstr.EndsWith(pemprivfooter)) + return null; + + StringBuilder sb = new StringBuilder(pemstr); + sb.Replace(pemprivheader, ""); + sb.Replace(pemprivfooter, ""); + String pvkstr = sb.ToString().Trim(); + + try + { // if there are no PEM encryption info lines, this is an UNencrypted PEM private key + binkey = Convert.FromBase64String(pvkstr); + return binkey; + } + catch (global::System.FormatException) + { + StringReader str = new StringReader(pvkstr); + + //-------- read PEM encryption info. lines and extract salt ----- + if (!str.ReadLine(){{nrt!}}.StartsWith("Proc-Type: 4,ENCRYPTED")) // TODO: what do we do here if ReadLine is null? + return null; + + String saltline = str.ReadLine(){{nrt!}}; // TODO: what do we do here if ReadLine is null? + if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + return null; + + String saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); + byte[] salt = new byte[saltstr.Length / 2]; + for (int i = 0; i < salt.Length; i++) + salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); + + if (!(str.ReadLine() == "")) + return null; + + //------ remaining b64 data is encrypted RSA key ---- + String encryptedstr = str.ReadToEnd(); + + try + { //should have b64 encrypted RSA key now + binkey = Convert.FromBase64String(encryptedstr); + } + catch (global::System.FormatException) + { //data is not in base64 format + return null; + } + + // TODO: what do we do here if keyPassPhrase is null? + byte[] deskey = GetEncryptedKey(salt, keyPassPhrase{{nrt!}}, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + if (deskey == null) + return null; + + //------ Decrypt the encrypted 3des-encrypted RSA private key ------ + byte[]{{nrt?}} rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV + + return rsakey; + } + } + + private RSACryptoServiceProvider{{nrt?}} DecodeRSAPrivateKey(byte[] privkey) + { + byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + + // --------- Set up stream to decode the asn.1 encoded RSA private key ------ + MemoryStream mem = new MemoryStream(privkey); + BinaryReader binr = new BinaryReader(mem); //wrap Memory Stream with BinaryReader for easy reading + byte bt = 0; + ushort twobytes = 0; + int elems = 0; + try + { + twobytes = binr.ReadUInt16(); + if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + binr.ReadByte(); //advance 1 byte + else if (twobytes == 0x8230) + binr.ReadInt16(); //advance 2 bytes + else + return null; + + twobytes = binr.ReadUInt16(); + if (twobytes != 0x0102) //version number + return null; + + bt = binr.ReadByte(); + if (bt != 0x00) + return null; + + //------ all private key components are Integer sequences ---- + elems = GetIntegerSize(binr); + MODULUS = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + E = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + D = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + P = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + Q = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + IQ = binr.ReadBytes(elems); + + // ------- create RSACryptoServiceProvider instance and initialize with public key ----- + RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSAParameters RSAparams = new RSAParameters(); + RSAparams.Modulus = MODULUS; + RSAparams.Exponent = E; + RSAparams.D = D; + RSAparams.P = P; + RSAparams.Q = Q; + RSAparams.DP = DP; + RSAparams.DQ = DQ; + RSAparams.InverseQ = IQ; + RSA.ImportParameters(RSAparams); + return RSA; + } + catch (Exception) + { + return null; + } + finally + { + binr.Close(); + } + } + + private int GetIntegerSize(BinaryReader binr) + { + byte bt = 0; + byte lowbyte = 0x00; + byte highbyte = 0x00; + int count = 0; + bt = binr.ReadByte(); + if (bt != 0x02) //expect integer + return 0; + + bt = binr.ReadByte(); + + if (bt == 0x81) + count = binr.ReadByte(); // data size in next byte + else if (bt == 0x82) + { + highbyte = binr.ReadByte(); // data size in next 2 bytes + lowbyte = binr.ReadByte(); + byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; + count = BitConverter.ToInt32(modint, 0); + } + else + count = bt; // we already have the data size + + while (binr.ReadByte() == 0x00) + //remove high order zeros in data + count -= 1; + + binr.BaseStream.Seek(-1, SeekOrigin.Current); + + //last ReadByte wasn't a removed zero, so back up a byte + return count; + } + + private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) + { + IntPtr unmanagedPswd = IntPtr.Zero; + int HASHLENGTH = 16; //MD5 bytes + byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results + + byte[] psbytes = new byte[secpswd.Length]; + unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd); + Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length); + Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd); + + // --- concatenate salt and pswd bytes into fixed data array --- + byte[] data00 = new byte[psbytes.Length + salt.Length]; + Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes + Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes + + // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- + MD5 md5 = MD5.Create(); + byte[]{{nrt?}} result = null; + byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget + + for (int j = 0; j < miter; j++) + { + // ---- Now hash consecutively for count times ------ + if (j == 0) + result = data00; //initialize + else + { + Array.Copy(result{{nrt!}}, hashtarget, result{{nrt!}}.Length); // TODO: what do we do if result is null here? + Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); + result = hashtarget; + } + + for (int i = 0; i < count; i++) + result = md5.ComputeHash(result); + + Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial + } + byte[] deskey = new byte[24]; + Array.Copy(keymaterial, deskey, deskey.Length); + + Array.Clear(psbytes, 0, psbytes.Length); + Array.Clear(data00, 0, data00.Length); + Array.Clear(result{{nrt!}}, 0, result{{nrt!}}.Length); // TODO: what do we do if result is null here? + Array.Clear(hashtarget, 0, hashtarget.Length); + Array.Clear(keymaterial, 0, keymaterial.Length); + return deskey; + } + + private byte[]{{nrt?}} DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) + { + MemoryStream memst = new MemoryStream(); + TripleDES alg = TripleDES.Create(); + alg.Key = desKey; + alg.IV = IV; + try + { + CryptoStream cs = new CryptoStream(memst, alg.CreateDecryptor(), CryptoStreamMode.Write); + cs.Write(cipherData, 0, cipherData.Length); + cs.Close(); + } + catch (Exception) + { + return null; + } + byte[] decryptedData = memst.ToArray(); + return decryptedData; + } + + /// + /// Detect the key type from the pem file. + /// + /// key file path in pem format + /// + private PrivateKeyType GetKeyType(string keyFilePath) + { + if (!File.Exists(keyFilePath)) + throw new Exception("Key file path does not exist."); + + var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + var ecPrivateKeyFooter = "END EC PRIVATE KEY"; + var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + var rsaPrivateFooter = "END RSA PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; + var keyType = PrivateKeyType.None; + var key = File.ReadAllLines(keyFilePath); + + if (key[0].ToString().Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) + keyType = PrivateKeyType.RSA; + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + keyType = PrivateKeyType.ECDSA; + + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + { + /* this type of key can hold many type different types of private key, but here due lack of pem header + Considering this as EC key + */ + //TODO :- update the key based on oid + keyType = PrivateKeyType.ECDSA; + } + else + throw new Exception("Either the key is invalid or key is not supported"); + + return keyType; + } + } +} diff --git a/templates-v7/csharp/libraries/generichost/HttpSigningToken.mustache b/templates-v7/csharp/libraries/generichost/HttpSigningToken.mustache new file mode 100644 index 000000000..881682e89 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/HttpSigningToken.mustache @@ -0,0 +1,45 @@ +// +{{partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// A token constructed from an HttpSigningConfiguration + /// + {{>visibility}} class HttpSignatureToken : TokenBase + { + private HttpSigningConfiguration _configuration; + + /// + /// Constructs an HttpSignatureToken object. + /// + /// + /// + public HttpSignatureToken(HttpSigningConfiguration configuration, TimeSpan? timeout = null) : base(timeout) + { + _configuration = configuration; + } + + /// + /// Places the token in the header. + /// + /// + /// + /// + public void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string requestBody, CancellationToken cancellationToken = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) + { + var signedHeaders = _configuration.GetHttpSignedHeader(request, requestBody, cancellationToken); + + foreach (var signedHeader in signedHeaders) + request.Headers.Add(signedHeader.Key, signedHeader.Value); + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/IApi.mustache b/templates-v7/csharp/libraries/generichost/IApi.mustache new file mode 100644 index 000000000..af31cffe9 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/IApi.mustache @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace {{packageName}}.{{apiPackage}} +{ + /// + /// Any Api client + /// + {{>visibility}} interface {{interfacePrefix}}Api + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache new file mode 100644 index 000000000..948f06648 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache @@ -0,0 +1,55 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using {{packageName}}.{{clientPackage}}; + +namespace {{packageName}}.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + {{>visibility}} static class IHostBuilderExtensions + { + {{^hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.Add{{apiName}}(services, config); + }); + + return builder; + } + + {{/hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.Add{{apiName}}(services, config); + }); + + return builder; + } + } +} diff --git a/templates-v7/csharp/libraries/generichost/IHttpClientBuilderExtensions.mustache b/templates-v7/csharp/libraries/generichost/IHttpClientBuilderExtensions.mustache new file mode 100644 index 000000000..053c0226a --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/IHttpClientBuilderExtensions.mustache @@ -0,0 +1,75 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection;{{#supportsRetry}} +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly;{{/supportsRetry}} + +namespace {{packageName}}.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + {{>visibility}} static class IHttpClientBuilderExtensions + { + {{#supportsRetry}} + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + {{/supportsRetry}} + } +} diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache new file mode 100644 index 000000000..14184ac4a --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -0,0 +1,69 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{clientPackage}}; + +namespace {{packageName}}.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + {{>visibility}} static class IServiceCollectionExtensions + { + {{^hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + public static void Add{{apiName}}(this IServiceCollection services) + { + HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); + Add{{apiName}}(services, config); + } + + {{/hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + /// + public static void Add{{apiName}}(this IServiceCollection services, Action options) + { + HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); + options(config); + Add{{apiName}}(services, config); + } + + internal static void Add{{apiName}}(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.Add{{apiName}}HttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/templates-v7/csharp/libraries/generichost/ImplementsIEquatable.mustache b/templates-v7/csharp/libraries/generichost/ImplementsIEquatable.mustache new file mode 100644 index 000000000..dd576dd0f --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/ImplementsIEquatable.mustache @@ -0,0 +1 @@ +{{#equatable}}{{#readOnlyVars}}{{#-first}}IEquatable<{{classname}}{{nrt?}}> {{/-first}}{{/readOnlyVars}}{{/equatable}} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ImplementsValidatable.mustache b/templates-v7/csharp/libraries/generichost/ImplementsValidatable.mustache new file mode 100644 index 000000000..7c3f0e02a --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/ImplementsValidatable.mustache @@ -0,0 +1 @@ +{{#validatable}}IValidatableObject {{/validatable}} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache new file mode 100644 index 000000000..0ff2753e3 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -0,0 +1,648 @@ + /// + /// A Json converter for type + /// + {{>visibility}} class {{classname}}JsonConverter : JsonConverter<{{classname}}> + { + {{#allVars}} + {{#isDateTime}} + /// + /// The format to use to serialize {{name}} + /// + public static string {{name}}Format { get; set; } = "{{{dateTimeFormat}}}"; + + {{/isDateTime}} + {{#isDate}} + /// + /// The format to use to serialize {{name}} + /// + public static string {{name}}Format { get; set; } = "{{{dateFormat}}}"; + + {{/isDate}} + {{/allVars}} + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override {{classname}} Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.trimLineBreaks}} + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + {{#allVars}} + Option<{{#isInnerEnum}}{{^isMap}}{{classname}}.{{/isMap}}{{/isInnerEnum}}{{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = default; + {{#-last}} + + {{/-last}} + {{/allVars}} + {{#discriminator}} + {{#children}} + {{#-first}} + string{{nrt?}} discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "{{discriminator.propertyBaseName}}"); + + {{/-first}} + if (discriminator != null && discriminator.Equals("{{name}}")) + return JsonSerializer.Deserialize<{{{classname}}}>(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + {{/children}} + {{/discriminator}} + {{#model.discriminator}} + {{#model.hasDiscriminatorWithNonEmptyMapping}} + {{#mappedModels}} + {{#model}} + {{^vendorExtensions.x-duplicated-data-type}} + {{classname}}{{nrt?}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}} = null; + {{#-last}} + + {{/-last}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/model}} + {{/mappedModels}} + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string{{nrt?}} localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName{{nrt?}}.Equals("{{propertyBaseName}}"){{#nrt}} ?? false{{/nrt}}) + { + string{{nrt?}} discriminator = utf8JsonReaderDiscriminator.GetString(); + {{#mappedModels}} + if (discriminator{{nrt?}}.Equals("{{mappingName}}"){{#nrt}} ?? false{{/nrt}}) + { + Utf8JsonReader utf8JsonReader{{model.classname}} = utf8JsonReader; + {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}} = JsonSerializer.Deserialize<{{{model.classname}}}>(ref utf8JsonReader{{model.classname}}, jsonSerializerOptions); + } + {{/mappedModels}} + } + } + } + + {{/model.hasDiscriminatorWithNonEmptyMapping}} + {{/model.discriminator}} + {{^model.discriminator}} + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = default; + {{#-last}} + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + {{#oneOf}} + Utf8JsonReader utf8JsonReader{{name}} = utf8JsonReader; + ClientUtils.TryDeserialize<{{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}>(ref utf8JsonReader{{name}}, jsonSerializerOptions, out {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); + {{^-last}} + + {{/-last}} + {{/oneOf}} + } + } + {{/-last}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = default; + {{#-last}} + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + {{#anyOf}} + Utf8JsonReader utf8JsonReader{{name}} = utf8JsonReader; + ClientUtils.TryDeserialize<{{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}>(ref utf8JsonReader{{name}}, jsonSerializerOptions, out {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); + {{^-last}} + + {{/-last}} + {{/anyOf}} + } + } + {{/-last}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + + {{/composedSchemas}} + {{/model.discriminator}} + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string{{nrt?}} localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + {{#allVars}} + case "{{baseName}}": + {{#isString}} + {{^isMap}} + {{^isEnum}} + {{^isUuid}} + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetString(){{^isNullable}}{{nrt!}}{{/isNullable}}); + {{/isUuid}} + {{/isEnum}} + {{/isMap}} + {{/isString}} + {{#isBoolean}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetBoolean()); + {{/isBoolean}} + {{#isNumeric}} + {{^isEnum}} + {{#isDouble}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDouble()); + {{/isDouble}} + {{#isDecimal}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDecimal()); + {{/isDecimal}} + {{#isFloat}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}(float)utf8JsonReader.GetDouble()); + {{/isFloat}} + {{#isLong}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64()); + {{/isLong}} + {{^isLong}} + {{^isFloat}} + {{^isDecimal}} + {{^isDouble}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); + {{/isDouble}} + {{/isDecimal}} + {{/isFloat}} + {{/isLong}} + {{/isEnum}} + {{/isNumeric}} + {{#isDate}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{#supportsDateOnly}}DateOnly{{/supportsDateOnly}}{{^supportsDateOnly}}DateTime{{/supportsDateOnly}}{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions)); + {{/isDate}} + {{#isDateTime}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + {{/isDateTime}} + {{#isEnum}} + {{^isMap}} + {{#isNumeric}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}})utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); + {{/isNumeric}} + {{^isNumeric}} + string{{nrt?}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = utf8JsonReader.GetString(); + {{^isInnerEnum}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}{{{datatypeWithEnum}}}ValueConverter.FromStringOrDefault({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue)); + {{/isInnerEnum}} + {{#isInnerEnum}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}{{classname}}.{{{datatypeWithEnum}}}FromStringOrDefault({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue)); + {{/isInnerEnum}} + {{/isNumeric}} + {{/isMap}} + {{/isEnum}} + {{#isUuid}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetGuid()); + {{/isUuid}} + {{^isUuid}} + {{^isEnum}} + {{^isString}} + {{^isBoolean}} + {{^isNumeric}} + {{^isDate}} + {{^isDateTime}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions){{^isNullable}}{{nrt!}}{{/isNullable}}); + {{/isDateTime}} + {{/isDate}} + {{/isNumeric}} + {{/isBoolean}} + {{/isString}} + {{/isEnum}} + {{/isUuid}} + break; + {{/allVars}} + default: + break; + } + } + } + + {{#allVars}} + {{#required}} + if (!{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.IsSet) + throw new ArgumentException("Property is required for class {{classname}}.", nameof({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}})); + + {{/required}} + {{/allVars}} + {{#allVars}} + {{^isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.IsSet && {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.Value == null) + throw new ArgumentNullException(nameof({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}), "Property is not nullable for class {{classname}}."); + + {{/isNullable}} + {{/allVars}} + {{^vendorExtensions.x-duplicated-data-type}} + {{#model.discriminator}} + {{#model.hasDiscriminatorWithNonEmptyMapping}} + {{#mappedModels}} + if ({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}} != null) + return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); + + {{#-last}} + throw new JsonException(); + {{/-last}} + {{/mappedModels}} + {{/model.hasDiscriminatorWithNonEmptyMapping}} + {{/model.discriminator}} + {{^composedSchemas.oneOf}} + {{^required}} + {{#model.composedSchemas.anyOf}} + Option<{{baseType}}{{>NullConditionalProperty}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null + ? default + : new Option<{{baseType}}{{>NullConditionalProperty}}>({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); + {{/model.composedSchemas.anyOf}} + {{#-last}} + + {{/-last}} + {{/required}} + return new {{classname}}({{#lambda.joinWithComma}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue{{#required}}.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/required}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); + {{/composedSchemas.oneOf}} + {{^model.discriminator}} + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} != null) + return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}ParsedValue{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); + + {{/vendorExtensions.x-duplicated-data-type}} + {{#-last}} + throw new JsonException(); + {{/-last}} + {{/oneOf}} + {{/composedSchemas}} + {{/model.discriminator}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/lambda.trimLineBreaks}} + {{/lambda.trimTrailingWithNewLine}} + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) + { + {{#lambda.trimLineBreaks}} + {{#lambda.copyText}} + {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}} + {{/lambda.copyText}} + {{#discriminator}} + {{#children}} + if ({{#lambda.paste}}{{/lambda.paste}} is {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}){ + JsonSerializer.Serialize<{{{classname}}}>(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); + return; + } + + {{/children}} + {{/discriminator}} + writer.WriteStartObject(); + + {{#model.discriminator}} + {{#model.hasDiscriminatorWithNonEmptyMapping}} + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) + {{#isPrimitiveType}} + {{#isString}} + writer.WriteString("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value); + {{/isString}} + {{#isBoolean}} + writer.WriteBoolean("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isBoolean}} + {{#isNumeric}} + writer.WriteNumber("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isNumeric}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + { + {{baseType}}JsonConverter {{#lambda.camelcase_sanitize_param}}{{baseType}}JsonConverter{{/lambda.camelcase_sanitize_param}} = ({{baseType}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}.GetType())); + {{#lambda.camelcase_sanitize_param}}{{baseType}}JsonConverter{{/lambda.camelcase_sanitize_param}}.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + } + {{/isPrimitiveType}} + + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + {{/model.hasDiscriminatorWithNonEmptyMapping}} + {{/model.discriminator}} + {{^model.discriminator}} + {{#composedSchemas}} + {{#anyOf}} + if ({{#lambda.joinWithAmpersand}}{{^required}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet {{/required}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}} != null{{/lambda.joinWithAmpersand}}) + {{#isPrimitiveType}} + {{#isString}} + writer.WriteString("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value); + {{/isString}} + {{#isBoolean}} + writer.WriteBoolean("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isBoolean}} + {{#isNumeric}} + writer.WriteNumber("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isNumeric}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + { + {{datatypeWithEnum}}JsonConverter {{datatypeWithEnum}}JsonConverter = ({{datatypeWithEnum}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}.GetType())); + {{datatypeWithEnum}}JsonConverter.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}, jsonSerializerOptions); + } + {{/isPrimitiveType}} + + {{/anyOf}} + {{/composedSchemas}} + {{/model.discriminator}} + WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); + writer.WriteEndObject(); + {{/lambda.trimLineBreaks}} + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) + { + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.trimLineBreaks}} + {{#allVars}} + {{^isDiscriminator}} + {{^isNullable}} + {{#vendorExtensions.x-is-reference-type}} + if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) + throw new ArgumentNullException(nameof({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}), "Property is required for class {{classname}}."); + + {{/vendorExtensions.x-is-reference-type}} + {{/isNullable}} + {{/isDiscriminator}} + {{/allVars}} + {{#allVars}} + {{#isDiscriminator}} + {{^model.composedSchemas.anyOf}} + {{^model.composedSchemas.oneOf}} + writer.WriteString("{{baseName}}", {{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{/isEnum}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}.Value{{/required}}){{/isEnum}}); + + {{/model.composedSchemas.oneOf}} + {{/model.composedSchemas.anyOf}} + {{/isDiscriminator}} + {{^isDiscriminator}} + {{#isString}} + {{^isMap}} + {{^isEnum}} + {{^isUuid}} + {{#lambda.copyText}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}); + {{/lambda.copyText}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isUuid}} + {{/isEnum}} + {{/isMap}} + {{/isString}} + {{#isBoolean}} + {{#lambda.copyText}} + writer.WriteBoolean("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); + {{/lambda.copyText}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isBoolean}} + {{^isEnum}} + {{#isNumeric}} + {{#lambda.copyText}} + writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); + {{/lambda.copyText}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isNumeric}} + {{/isEnum}} + {{#isDate}} + {{#lambda.copyText}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); + {{/lambda.copyText}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isDate}} + {{#isDateTime}} + {{#lambda.copyText}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); + {{/lambda.copyText}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isDateTime}} + {{#isEnum}} + {{#isNumeric}} + {{#lambda.copyText}} + writer.WriteNumber("{{baseName}}", {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}})); + {{/lambda.copyText}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isNumeric}} + {{^isMap}} + {{^isNumeric}} + {{#isInnerEnum}} + {{#isNullable}} + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); + else + writer.WriteNull("{{baseName}}"); + + {{/isNullable}} + {{^isNullable}} + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); + {{/isNullable}} + {{/isInnerEnum}} + {{^isInnerEnum}} + {{#lambda.copyText}} + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} + {{/lambda.copyText}} + {{#required}} + {{#isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) + writer.WriteNull("{{baseName}}"); + else + { + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}.Value); + {{#allowableValues}} + {{#enumVars}} + {{#-first}} + {{#isString}} + if ({{#lambda.paste}}{{/lambda.paste}}RawValue != null){{! we cant use name here because enumVar also has a name property, so use the paste lambda instead }} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{nameInPascalCase}}{{/lambda.camelcase_sanitize_param}}RawValue); + else + writer.WriteNull("{{baseName}}"); + {{/isString}} + {{^isString}} + writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{nameInPascalCase}}{{/lambda.camelcase_sanitize_param}}RawValue); + {{/isString}} + {{/-first}} + {{/enumVars}} + {{/allowableValues}} + } + {{/isNullable}} + {{^isNullable}} + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}); + {{#allowableValues}} + {{#enumVars}} + {{#-first}} + {{^isNumeric}} + writer.WriteString("{{baseName}}", {{#lambda.paste}}{{/lambda.paste}}RawValue); + {{/isNumeric}} + {{#isNumeric}} + writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{#lambda.paste}}{{/lambda.paste}}{{/lambda.camelcase_sanitize_param}}RawValue); + {{/isNumeric}} + {{/-first}} + {{/enumVars}} + {{/allowableValues}} + {{/isNullable}} + + {{/required}} + {{^required}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) + {{#isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option{{nrt!}}.Value != null) + { + var {{#lambda.paste}}{{/lambda.paste}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value{{nrt!}}.Value); + writer.{{#lambda.first}}{{#allowableValues}}{{#enumVars}}{{^isNumeric}}WriteString {{/isNumeric}}{{#isNumeric}}WriteNumber {{/isNumeric}}{{/enumVars}}{{/allowableValues}}{{/lambda.first}}("{{baseName}}", {{#lambda.paste}}{{/lambda.paste}}RawValue); + } + else + writer.WriteNull("{{baseName}}"); + {{/isNullable}} + {{^isNullable}} + { + var {{#lambda.paste}}{{/lambda.paste}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{nrt!}}.Value); + writer.{{#lambda.first}}{{#allowableValues}}{{#enumVars}}{{^isNumeric}}WriteString {{/isNumeric}}{{#isNumeric}}WriteNumber {{/isNumeric}}{{/enumVars}}{{/allowableValues}}{{/lambda.first}}("{{baseName}}", {{#lambda.paste}}{{/lambda.paste}}RawValue); + } + {{/isNullable}} + {{/required}} + {{/isInnerEnum}} + {{/isNumeric}} + {{/isMap}} + {{/isEnum}} + {{#isUuid}} + {{#lambda.copyText}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); + {{/lambda.copyText}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isUuid}} + {{^isUuid}} + {{^isEnum}} + {{^isString}} + {{^isBoolean}} + {{^isNumeric}} + {{^isDate}} + {{^isDateTime}} + {{#required}} + {{#isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) + { + writer.WritePropertyName("{{baseName}}"); + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + } + else + writer.WriteNull("{{baseName}}"); + {{/isNullable}} + {{^isNullable}} + writer.WritePropertyName("{{baseName}}"); + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + {{/isNullable}} + {{/required}} + {{^required}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) + {{#isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value != null) + { + writer.WritePropertyName("{{baseName}}"); + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + } + else + writer.WriteNull("{{baseName}}"); + {{/isNullable}} + {{^isNullable}} + { + writer.WritePropertyName("{{baseName}}"); + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + } + {{/isNullable}} + {{/required}} + {{/isDateTime}} + {{/isDate}} + {{/isNumeric}} + {{/isBoolean}} + {{/isString}} + {{/isEnum}} + {{/isUuid}} + {{/isDiscriminator}} + {{/allVars}} + {{/lambda.trimLineBreaks}} + {{/lambda.trimTrailingWithNewLine}} + } + } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache b/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache new file mode 100644 index 000000000..93f805403 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache @@ -0,0 +1,29 @@ +// +{{partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System.Text.Json; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Provides the JsonSerializerOptions + /// + {{>visibility}} class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ModelBaseSignature.mustache b/templates-v7/csharp/libraries/generichost/ModelBaseSignature.mustache new file mode 100644 index 000000000..909a68e35 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/ModelBaseSignature.mustache @@ -0,0 +1 @@ +{{#parentModel.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{parent}}{{/lambda.camelcase_sanitize_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#isInherited}}{{^isNew}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/isNew}}{{#isNew}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^required}}.Value{{/required}}){{/isEnum}}{{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.ToString(){{/isEnum}}{{/isNew}} {{/isInherited}}{{/isDiscriminator}}{{/allVars}} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ModelSignature.mustache b/templates-v7/csharp/libraries/generichost/ModelSignature.mustache new file mode 100644 index 000000000..39aa11f82 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/ModelSignature.mustache @@ -0,0 +1 @@ +{{#model.allVars}}{{^isDiscriminator}}{{^required}}Option<{{/required}}{{{datatypeWithEnum}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}{{#defaultValue}} = {{^required}}default{{/required}}{{#required}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{.}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/required}}{{/defaultValue}}{{^defaultValue}}{{#lambda.first}}{{#isNullable}} = default {{/isNullable}}{{^required}} = default {{/required}}{{/lambda.first}}{{/defaultValue}} {{/isDiscriminator}}{{/model.allVars}} diff --git a/templates-v7/csharp/libraries/generichost/OAuthToken.mustache b/templates-v7/csharp/libraries/generichost/OAuthToken.mustache new file mode 100644 index 000000000..23b3cab91 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/OAuthToken.mustache @@ -0,0 +1,41 @@ +// +{{partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// A token constructed with OAuth. + /// + {{>visibility}} class OAuthToken : TokenBase + { + private string _raw; + + /// + /// Consturcts an OAuthToken object. + /// + /// + /// + public OAuthToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/OnDeserializationError.mustache b/templates-v7/csharp/libraries/generichost/OnDeserializationError.mustache new file mode 100644 index 000000000..ff83a5076 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/OnDeserializationError.mustache @@ -0,0 +1,2 @@ +if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/OnErrorDefaultImplementation.mustache b/templates-v7/csharp/libraries/generichost/OnErrorDefaultImplementation.mustache new file mode 100644 index 000000000..a1a9fa976 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/OnErrorDefaultImplementation.mustache @@ -0,0 +1,2 @@ + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/OperationSignature.mustache b/templates-v7/csharp/libraries/generichost/OperationSignature.mustache new file mode 100644 index 000000000..caa9d144c --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/OperationSignature.mustache @@ -0,0 +1 @@ +{{#lambda.joinWithComma}}{{#allParams}}{{#required}}{{{dataType}}}{{>NullConditionalParameter}}{{/required}}{{^required}}Option<{{{dataType}}}{{>NullConditionalParameter}}>{{/required}} {{paramName}}{{#notRequiredOrIsNullable}} = default{{/notRequiredOrIsNullable}} {{/allParams}}System.Threading.CancellationToken cancellationToken = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}{{/lambda.joinWithComma}} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/Option.mustache b/templates-v7/csharp/libraries/generichost/Option.mustache new file mode 100644 index 000000000..eed49143e --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/Option.mustache @@ -0,0 +1,47 @@ +// +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/OptionProperty.mustache b/templates-v7/csharp/libraries/generichost/OptionProperty.mustache new file mode 100644 index 000000000..d75041887 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/OptionProperty.mustache @@ -0,0 +1 @@ +new Option<{{#isInnerEnum}}{{^isMap}}{{classname}}.{{/isMap}}{{/isInnerEnum}}{{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}>( \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/README.client.mustache b/templates-v7/csharp/libraries/generichost/README.client.mustache new file mode 100644 index 000000000..371b9daa9 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/README.client.mustache @@ -0,0 +1,245 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName={{apiName}}', + 'targetFramework={{targetFramework}}', + 'validatable={{validatable}}', + 'nullableReferenceTypes={{nullableReferenceTypes}}', + 'hideGenerationTimestamp={{hideGenerationTimestamp}}', + 'packageVersion={{packageVersion}}', + 'packageAuthors={{packageAuthors}}', + 'packageCompany={{packageCompany}}', + 'packageCopyright={{packageCopyright}}', + 'packageDescription={{packageDescription}}',{{#licenseId}} + 'licenseId={{.}}',{{/licenseId}} + 'packageName={{packageName}}', + 'packageTags={{packageTags}}', + 'packageTitle={{packageTitle}}' +) -join "," + +$global = @( + 'apiDocs={{generateApiDocs}}', + 'modelDocs={{generateModelDocs}}', + 'apiTests={{generateApiTests}}', + 'modelTests={{generateModelTests}}' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "{{gitHost}}" ` + --git-repo-id "{{gitRepoId}}" ` + --git-user-id "{{gitUserId}}" ` + --release-note "{{releaseNote}}" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.Api; +using {{packageName}}.Client; +using {{packageName}}.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build();{{#apiInfo}}{{#apis}}{{#-first}} + var api = host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + {{#operations}} + {{#-first}} + {{#operation}} + {{#-first}} + {{operationId}}ApiResponse apiResponse = await api.{{operationId}}Async("todo"); + {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}} model = apiResponse.Ok(); + {{/-first}} + {{/operation}} + {{/-first}} + {{/operations}} + {{/-first}} + {{/apis}} + {{/apiInfo}} + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .Configure{{apiName}}((context, options) => + { + {{#authMethods}} + {{#-first}} + // the type of token here depends on the api security specifications + ApiKeyToken token = new("", ClientUtils.ApiKeyHeader.Authorization); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + {{/-first}} + {{/authMethods}} + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.Add{{apiName}}HttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace {{packageName}}.Rest.DefaultApi. + Or provide your own class by using the generic Configure{{apiName}} method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later{{#supportsRetry}} +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later{{/supportsRetry}}{{#useCompareNetObjects}} +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later{{/useCompareNetObjects}}{{#validatable}} +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later{{/validatable}}{{#apiDocs}} + + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | -------------{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} +*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}{{/apiDocs}}{{#modelDocs}} + + +## Documentation for Models + +{{#modelPackage}}{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md){{/model}}{{/models}}{{/modelPackage}} +{{^modelPackage}}No model defined in this package{{/modelPackage}}{{/modelDocs}} + + +## Documentation for Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasicBasic}} +- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} +- **Type**: Bearer Authentication +{{/isBasicBearer}} +{{#isHttpSignature}} +- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{#isOAuth}} +- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}}{{#scopes}} +- {{scope}}: {{description}}{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Build +- SDK version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} +- Build package: {{generatorClass}} + +## Api Information +- appName: {{appName}} +- appVersion: {{appVersion}} +- appDescription: {{appDescription}} + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: {{generateAliasAsModel}} +- supportingFiles: {{supportingFiles}} +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: {{generateApiDocs}} +- modelDocs: {{generateModelDocs}} +- apiTests: {{generateApiTests}} +- modelTests: {{generateModelTests}} + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: {{allowUnicodeIdentifiers}} +- apiName: {{apiName}} +- caseInsensitiveResponseHeaders: {{caseInsensitiveResponseHeaders}} +- conditionalSerialization: {{conditionalSerialization}} +- disallowAdditionalPropertiesIfNotPresent: {{disallowAdditionalPropertiesIfNotPresent}} +- gitHost: {{gitHost}} +- gitRepoId: {{gitRepoId}} +- gitUserId: {{gitUserId}} +- hideGenerationTimestamp: {{hideGenerationTimestamp}} +- interfacePrefix: {{interfacePrefix}} +- library: {{library}} +- licenseId: {{licenseId}} +- modelPropertyNaming: {{modelPropertyNaming}} +- netCoreProjectFile: {{netCoreProjectFile}} +- nonPublicApi: {{nonPublicApi}} +- nullableReferenceTypes: {{nullableReferenceTypes}} +- optionalAssemblyInfo: {{optionalAssemblyInfo}} +- optionalEmitDefaultValues: {{optionalEmitDefaultValues}} +- optionalMethodArgument: {{optionalMethodArgument}} +- optionalProjectFile: {{optionalProjectFile}} +- packageAuthors: {{packageAuthors}} +- packageCompany: {{packageCompany}} +- packageCopyright: {{packageCopyright}} +- packageDescription: {{packageDescription}} +- packageGuid: {{packageGuid}} +- packageName: {{packageName}} +- packageTags: {{packageTags}} +- packageTitle: {{packageTitle}} +- packageVersion: {{packageVersion}} +- releaseNote: {{releaseNote}} +- returnICollection: {{returnICollection}} +- sortParamsByRequiredFlag: {{sortParamsByRequiredFlag}} +- sourceFolder: {{sourceFolder}} +- targetFramework: {{targetFramework}} +- useCollection: {{useCollection}} +- useDateTimeOffset: {{useDateTimeOffset}} +- useOneOfDiscriminatorLookup: {{useOneOfDiscriminatorLookup}} +- validatable: {{validatable}}{{#infoUrl}} +For more information, please visit [{{{.}}}]({{{.}}}){{/infoUrl}} + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/templates-v7/csharp/libraries/generichost/README.solution.mustache b/templates-v7/csharp/libraries/generichost/README.solution.mustache new file mode 100644 index 000000000..f9c1c7f74 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/README.solution.mustache @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/templates-v7/csharp/libraries/generichost/README.test.mustache b/templates-v7/csharp/libraries/generichost/README.test.mustache new file mode 100644 index 000000000..e69de29bb diff --git a/templates-v7/csharp/libraries/generichost/RateLimitProvider`1.mustache b/templates-v7/csharp/libraries/generichost/RateLimitProvider`1.mustache new file mode 100644 index 000000000..bafe525c0 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/RateLimitProvider`1.mustache @@ -0,0 +1,79 @@ +// +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Collections.Generic; +using System.Linq; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + {{>visibility}} class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary>{{/net70OrLater}}(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + {{#lambda.copy}} + global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length) + { + FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded(options)); + {{/lambda.copy}} + {{#hasApiKeyMethods}} + if (container is TokenContainer apiKeyTokenContainer) + { + string[] headers = apiKeyTokenContainer.Tokens.Select(t => ClientUtils.ApiKeyHeaderToString(t.Header)).Distinct().ToArray(); + + foreach (string header in headers) + { + global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) + { + FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(header, global::System.Threading.Channels.Channel.CreateBounded(options)); + } + } + else + { + {{#lambda.indentAll1}} + {{#lambda.paste}} + {{/lambda.paste}} + {{/lambda.indentAll1}} + } + {{/hasApiKeyMethods}} + {{^hasApiKeyMethods}} + {{#lambda.paste}} + {{/lambda.paste}} + {{/hasApiKeyMethods}} + + foreach(global::System.Threading.Channels.Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) + { + if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel{{nrt?}} tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/templates-v7/csharp/libraries/generichost/SourceGenerationContext.mustache b/templates-v7/csharp/libraries/generichost/SourceGenerationContext.mustache new file mode 100644 index 000000000..b1798c98e --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/SourceGenerationContext.mustache @@ -0,0 +1,9 @@ +{{#useSourceGeneration}} + + /// + /// The {{classname}}SerializationContext + /// + [JsonSourceGenerationOptions(WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof({{classname}}))] + {{>visibility}} partial class {{classname}}SerializationContext : JsonSerializerContext { } +{{/useSourceGeneration}} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/TokenBase.mustache b/templates-v7/csharp/libraries/generichost/TokenBase.mustache new file mode 100644 index 000000000..05f06b4a7 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/TokenBase.mustache @@ -0,0 +1,73 @@ +// +{{partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// The base for all tokens. + /// + {{>visibility}} abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler{{nrt?}} TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object{{nrt?}} sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/TokenContainer`1.mustache b/templates-v7/csharp/libraries/generichost/TokenContainer`1.mustache new file mode 100644 index 000000000..24c84a551 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/TokenContainer`1.mustache @@ -0,0 +1,39 @@ +// +{{partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System.Linq; +using System.Collections.Generic; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// A container for a collection of tokens. + /// + /// + {{>visibility}} sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(global::System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/TokenProvider`1.mustache b/templates-v7/csharp/libraries/generichost/TokenProvider`1.mustache new file mode 100644 index 000000000..7226551b7 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/TokenProvider`1.mustache @@ -0,0 +1,38 @@ +// +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Linq; +using System.Collections.Generic; +using {{packageName}}.{{clientPackage}}; + +namespace {{packageName}} +{ + /// + /// A class which will provide tokens. + /// + {{>visibility}} abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ValidateRegex.mustache b/templates-v7/csharp/libraries/generichost/ValidateRegex.mustache new file mode 100644 index 000000000..8918b8cf4 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/ValidateRegex.mustache @@ -0,0 +1,7 @@ +// {{{name}}} ({{{dataType}}}) pattern +Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); +{{#lambda.copy}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null && {{/lambda.copy}} +if ({{#lambda.first}}{{^required}}{{#lambda.paste}}{{/lambda.paste}} {{/required}}{{#isNullable}}{{#lambda.paste}}{{/lambda.paste}}{{/isNullable}}{{/lambda.first}}!regex{{{name}}}.Match(this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}}{{#isUuid}}.ToString(){{#lambda.first}}{{^required}}{{nrt!}} {{/required}}{{#isNullable}}! {{/isNullable}}{{/lambda.first}}{{/isUuid}}).Success) +{ + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" }); +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/WriteProperty.mustache b/templates-v7/csharp/libraries/generichost/WriteProperty.mustache new file mode 100644 index 000000000..99659ac26 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/WriteProperty.mustache @@ -0,0 +1,9 @@ +{{#required}} +{{>WritePropertyHelper}} +{{/required}} +{{^required}} +if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) + {{#lambda.indent1}} + {{>WritePropertyHelper}} + {{/lambda.indent1}} +{{/required}} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/WritePropertyHelper.mustache b/templates-v7/csharp/libraries/generichost/WritePropertyHelper.mustache new file mode 100644 index 000000000..616993bce --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/WritePropertyHelper.mustache @@ -0,0 +1,10 @@ +{{#isNullable}} +if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}} != null) + {{#lambda.paste}}{{/lambda.paste}} +else + writer.WriteNull("{{baseName}}"); +{{/isNullable}} +{{^isNullable}} +{{#lambda.paste}} +{{/lambda.paste}} +{{/isNullable}} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache new file mode 100644 index 000000000..b33115f0a --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -0,0 +1,803 @@ +{{#lambda.trimLineBreaks}} +// +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Collections.Generic; +{{#net80OrLater}} +{{#lambda.uniqueLines}} +{{#operations}} +{{#operation}} +{{#vendorExtensions.x-set-cookie}} +using System.Linq; +{{/vendorExtensions.x-set-cookie}} +{{/operation}} +{{/operations}} +{{/lambda.uniqueLines}} +{{/net80OrLater}} +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using {{packageName}}.{{clientPackage}}; +{{#hasImport}} +using {{packageName}}.{{modelPackage}}; +{{/hasImport}} +{{^netStandard}} +using System.Diagnostics.CodeAnalysis; +{{/netStandard}} + +namespace {{packageName}}.{{apiPackage}} +{ + {{#operations}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : IApi + { + /// + /// The class containing the events + /// + {{classname}}Events Events { get; } + + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// <> + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// <{{nrt?}}> + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + Task<{{interfacePrefix}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}); + {{^-last}} + + {{/-last}} + {{/operation}} + } + {{#operation}} + {{^vendorExtensions.x-duplicates}} + {{#responses}} + {{#-first}} + + /// + /// The + /// + {{>visibility}} interface {{interfacePrefix}}{{operationId}}ApiResponse : {{#lambda.joinWithComma}}{{packageName}}.{{clientPackage}}.{{interfacePrefix}}ApiResponse {{#responses}}{{#dataType}}{{interfacePrefix}}{{vendorExtensions.x-http-status}}<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{/dataType}}{{/responses}}{{/lambda.joinWithComma}} + { + {{#responses}} + {{#vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is the default response type + /// + /// + bool Is{{vendorExtensions.x-http-status}} { get; } + {{/vendorExtensions.x-http-status-is-default}} + {{^vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} + /// + /// + bool Is{{vendorExtensions.x-http-status}} { get; } + {{/vendorExtensions.x-http-status-is-default}} + {{^-last}} + + {{/-last}} + {{/responses}} + } + {{/-first}} + {{/responses}} + {{/vendorExtensions.x-duplicates}} + {{/operation}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} class {{classname}}Events + { + {{#lambda.trimTrailingWithNewLine}} + {{#operation}} + /// + /// The event raised after the server response + /// + public event EventHandler{{nrt?}} On{{operationId}}; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler{{nrt?}} OnError{{operationId}}; + + internal void ExecuteOn{{operationId}}({{#vendorExtensions.x-duplicates}}{{.}}{{/vendorExtensions.x-duplicates}}{{^vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}.{{operationId}}ApiResponse apiResponse) + { + On{{operationId}}?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnError{{operationId}}(Exception exception) + { + OnError{{operationId}}?.Invoke(this, new ExceptionEventArgs(exception)); + } + + {{/operation}} + {{/lambda.trimTrailingWithNewLine}} + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} sealed partial class {{classname}} : {{interfacePrefix}}{{classname}} + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger<{{classname}}> Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public {{classname}}Events Events { get; }{{#hasApiKeyMethods}} + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; }{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; }{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; }{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; }{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; }{{/hasOAuthMethods}} + + {{#net80OrLater}} + {{#lambda.unique}} + {{#operation}} + {{#vendorExtensions.x-set-cookie}} + /// + /// The token cookie container + /// + public {{packageName}}.{{clientPackage}}.CookieContainer CookieContainer { get; } + + {{/vendorExtensions.x-set-cookie}} + {{/operation}} + {{/lambda.unique}} + {{/net80OrLater}} + /// + /// Initializes a new instance of the class. + /// + /// + public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, + TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, + TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}, + TokenProvider basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}, + TokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, + TokenProvider oauthTokenProvider{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}}, + {{packageName}}.{{clientPackage}}.CookieContainer cookieContainer{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}}) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger<{{classname}}>(); + HttpClient = httpClient; + Events = {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}};{{#hasApiKeyMethods}} + ApiKeyProvider = apiKeyProvider;{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + BearerTokenProvider = bearerTokenProvider;{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} + BasicTokenProvider = basicTokenProvider;{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} + HttpSignatureTokenProvider = httpSignatureTokenProvider;{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + OauthTokenProvider = oauthTokenProvider;{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}} + CookieContainer = cookieContainer;{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}} + } + {{#operation}} + + {{#allParams}} + {{#-first}} + partial void Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + + {{/-first}} + {{/allParams}} + {{#vendorExtensions.x-has-not-nullable-reference-types}} + /// + /// Validates the request parameters + /// + {{#vendorExtensions.x-not-nullable-reference-types}} + /// + {{/vendorExtensions.x-not-nullable-reference-types}} + /// + private void Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}) + { + {{#lambda.trimTrailingWithNewLine}} + {{#vendorExtensions.x-not-nullable-reference-types}} + {{#required}} + {{^vendorExtensions.x-is-value-type}} + if ({{paramName}} == null) + throw new ArgumentNullException(nameof({{paramName}})); + + {{/vendorExtensions.x-is-value-type}} + {{/required}} + {{^required}} + {{^vendorExtensions.x-is-value-type}} + if ({{paramName}}.IsSet && {{paramName}}.Value == null) + throw new ArgumentNullException(nameof({{paramName}})); + + {{/vendorExtensions.x-is-value-type}} + {{/required}} + {{/vendorExtensions.x-not-nullable-reference-types}} + {{/lambda.trimTrailingWithNewLine}} + } + + {{/vendorExtensions.x-has-not-nullable-reference-types}} + /// + /// Processes the server response + /// + /// + {{#allParams}} + /// + {{/allParams}} + private void After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + { + bool suppressDefaultLog = false; + After{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); +{{>AfterOperationDefaultImplementation}} + } + + /// + /// Processes the server response + /// + /// + /// + {{#allParams}} + /// + {{/allParams}} + partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + {{#allParams}} + /// + {{/allParams}} + private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + { + bool suppressDefaultLogLocalVar = false; + OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLogLocalVar exceptionLocalVar pathFormatLocalVar pathLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); +{{>OnErrorDefaultImplementation}} + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + {{#allParams}} + /// + {{/allParams}} + partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLogLocalVar Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + + /// + /// {{summary}} {{notes}} + /// + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// <> + public async Task<{{interfacePrefix}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}) + { + try + { + return await {{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// <> + public async Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}) + { + {{#lambda.trimLineBreaks}} + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + {{#vendorExtensions.x-has-not-nullable-reference-types}} + Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}); + + {{/vendorExtensions.x-has-not-nullable-reference-types}} + {{#allParams}} + {{#-first}} + Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + + {{/-first}} + {{/allParams}} + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + {{^servers}} + uriBuilderLocalVar.Host = HttpClient.BaseAddress{{nrt!}}.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{{path}}}"; + {{/servers}} + {{#servers}} + {{#-first}} + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("{{url}}"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; + {{/-first}} + {{/servers}} + {{#constantParams}} + {{#isPathParam}} + // Set client side default value of Path Param "{{baseName}}". + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString(ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}}))); // Constant path parameter + {{/isPathParam}} + {{/constantParams}} + {{#pathParams}} + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString({{paramName}}.ToString())); + {{#-last}} + + {{/-last}} + {{/pathParams}} + {{#queryParams}} + {{#-first}} + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + {{/-first}} + {{/queryParams}} + {{^queryParams}} + {{#authMethods}} + {{#isApiKey}} + {{#isKeyInQuery}} + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + {{/isKeyInQuery}} + {{/isApiKey}} + {{/authMethods}} + {{/queryParams}} + {{#queryParams}} + {{#required}} + {{#-first}} + + {{/-first}} + parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{paramName}}); + {{/required}} + {{/queryParams}} + + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}}); // Constant query parameter + {{/isQueryParam}} + {{/constantParams}} + {{#queryParams}} + {{^required}} + if ({{paramName}}.IsSet) + parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{paramName}}.Value); + + {{/required}} + {{#-last}} + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + {{/-last}} + {{/queryParams}} + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + {{/isHeaderParam}} + {{/constantParams}} + {{#headerParams}} + {{#required}} + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}})); + + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value)); + + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#-first}} + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars));{{/-first}}{{^isFile}}{{#required}} + + formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}))); + + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value))); + + {{/required}} + {{/isFile}} + {{#isFile}} + {{#required}} + multipartContentLocalVar.Add(new StreamContent({{paramName}})); + + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + multipartContentLocalVar.Add(new StreamContent({{paramName}}.Value)); + + {{/required}} + {{/isFile}} + {{/formParams}} + {{#bodyParam}} + {{#required}} + httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); + {{/required}} + + {{/bodyParam}} + {{#authMethods}} + {{#-first}} + List tokenBaseLocalVars = new List(); + {{/-first}} + {{#isApiKey}} + {{^isKeyInCookie}} + ApiKeyToken apiKeyTokenLocalVar{{-index}} = (ApiKeyToken) await ApiKeyProvider.GetAsync("{{keyParamName}}", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar{{-index}}); + {{#isKeyInHeader}} + apiKeyTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar); + + {{/isKeyInHeader}} + {{/isKeyInCookie}} + {{#isKeyInQuery}} + + apiKeyTokenLocalVar{{-index}}.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + {{/isKeyInQuery}} + {{/isApiKey}} + {{/authMethods}} + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + {{#authMethods}} + {{#isBasicBasic}} + + BasicToken basicTokenLocalVar{{-index}} = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar{{-index}}); + + basicTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + {{/isBasicBasic}} + {{#isBasicBearer}} + + BearerToken bearerTokenLocalVar{{-index}} = (BearerToken) await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(bearerTokenLocalVar{{-index}}); + + bearerTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + {{/isBasicBearer}} + {{#isOAuth}} + + OAuthToken oauthTokenLocalVar{{-index}} = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar{{-index}}); + + oauthTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + {{/isOAuth}} + {{#isHttpSignature}} + + HttpSignatureToken httpSignatureTokenLocalVar{{-index}} = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar{{-index}}); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); + + httpSignatureTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + {{/isHttpSignature}} + {{/authMethods}} + {{#consumes}} + {{#-first}} + + {{=<% %>=}} + string[] contentTypes = new string[] {<%/-first%> + <%={{ }}=%> + "{{{mediaType}}}"{{^-last}},{{/-last}}{{#-last}} + }; + {{/-last}} + {{/consumes}} + {{#consumes}} + {{#-first}} + + string{{nrt?}} contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + {{/-first}} + {{/consumes}} + {{#produces}} + {{#-first}} + + {{=<% %>=}} + string[] acceptLocalVars = new string[] {<%/-first%> + <%={{ }}=%> + "{{{mediaType}}}"{{^-last}},{{/-last}}{{#-last}} + }; + {{/-last}} + {{/produces}} + {{#produces}} + {{#-first}} + + string{{nrt?}} acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + {{/-first}} + {{/produces}} + {{#net60OrLater}} + + httpRequestMessageLocalVar.Method = HttpMethod.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}; + {{/net60OrLater}} + {{^net60OrLater}} + httpRequestMessageLocalVar.Method = new HttpMethod("{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}"); + {{/net60OrLater}} + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); + + ILogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse> apiResponseLoggerLocalVar = LoggerFactory.CreateLogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse>(); + + {{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions); + + After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + + Events.ExecuteOn{{operationId}}(apiResponseLocalVar); + + {{#authMethods}} + {{#-first}} + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + {{/-first}} + {{/authMethods}} + {{#net80OrLater}} + {{#responses}} + {{#vendorExtensions.x-set-cookie}} + if (httpResponseMessageLocalVar.StatusCode == (HttpStatusCode) {{code}} && httpResponseMessageLocalVar.Headers.TryGetValues("Set-Cookie", out var cookieHeadersLocalVar)) + { + foreach(string cookieHeader in cookieHeadersLocalVar) + { + IList setCookieHeaderValuesLocalVar = Microsoft.Net.Http.Headers.SetCookieHeaderValue.ParseList(cookieHeadersLocalVar.ToArray()); + + foreach(Microsoft.Net.Http.Headers.SetCookieHeaderValue setCookieHeaderValueLocalVar in setCookieHeaderValuesLocalVar) + { + Cookie cookieLocalVar = new Cookie(setCookieHeaderValueLocalVar.Name.ToString(), setCookieHeaderValueLocalVar.Value.ToString()) + { + HttpOnly = setCookieHeaderValueLocalVar.HttpOnly + }; + + if (setCookieHeaderValueLocalVar.Expires.HasValue) + cookieLocalVar.Expires = setCookieHeaderValueLocalVar.Expires.Value.UtcDateTime; + + if (setCookieHeaderValueLocalVar.Path.HasValue) + cookieLocalVar.Path = setCookieHeaderValueLocalVar.Path.Value; + + if (setCookieHeaderValueLocalVar.Domain.HasValue) + cookieLocalVar.Domain = setCookieHeaderValueLocalVar.Domain.Value; + + CookieContainer.Value.Add(new Uri($"{uriBuilderLocalVar.Scheme}://{uriBuilderLocalVar.Host}"), cookieLocalVar); + } + } + } + + {{/vendorExtensions.x-set-cookie}} + {{/responses}} + {{/net80OrLater}} + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}e "{{{path}}}" uriBuilderLocalVar.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + Events.ExecuteOnError{{operationId}}(e); + throw; + } + {{/lambda.trimLineBreaks}} + } + {{^vendorExtensions.x-duplicates}} + {{#responses}} + {{#-first}} + + /// + /// The + /// + {{>visibility}} partial class {{operationId}}ApiResponse : {{packageName}}.{{clientPackage}}.ApiResponse, {{interfacePrefix}}{{operationId}}ApiResponse + { + /// + /// The logger + /// + public ILogger<{{operationId}}ApiResponse> Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public {{operationId}}ApiResponse(ILogger<{{operationId}}ApiResponse> logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + {{#responses}} + + {{#vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is the default response type + /// + /// + public bool Is{{vendorExtensions.x-http-status}} => {{#vendorExtensions.x-only-default}}true{{/vendorExtensions.x-only-default}}{{^vendorExtensions.x-only-default}}{{#lambda.joinConditions}}{{#responses}}{{^vendorExtensions.x-http-status-is-default}}!Is{{vendorExtensions.x-http-status}} {{/vendorExtensions.x-http-status-is-default}}{{/responses}}{{/lambda.joinConditions}}{{/vendorExtensions.x-only-default}}; + {{/vendorExtensions.x-http-status-is-default}} + {{^vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} + /// + /// + {{#vendorExtensions.x-http-status-range}} + public bool Is{{vendorExtensions.x-http-status}} + { + get + { + int statusCode = (int)StatusCode; + return {{vendorExtensions.x-http-status-range}}00 >= statusCode && {{vendorExtensions.x-http-status-range}}99 <= statusCode; + } + } + {{/vendorExtensions.x-http-status-range}} + {{^vendorExtensions.x-http-status-range}} + public bool Is{{vendorExtensions.x-http-status}} => {{code}} == (int)StatusCode; + {{/vendorExtensions.x-http-status-range}} + {{/vendorExtensions.x-http-status-is-default}} + {{#dataType}} + + /// + /// Deserializes the response if the response is {{code}} {{vendorExtensions.x-http-status}} + /// + /// + public {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{vendorExtensions.x-http-status}}() + { + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>AsModel}} + {{/lambda.indent4}} + {{/lambda.trimTrailingWithNewLine}} + } + + /// + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} and the deserialized response is not null + /// + /// + /// + public bool Try{{vendorExtensions.x-http-status}}({{#net60OrLater}}[NotNullWhen(true)]{{/net60OrLater}}out {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} result) + { + result = null; + + try + { + result = {{vendorExtensions.x-http-status}}(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode){{#vendorExtensions.x-http-status-range}}{{.}}{{/vendorExtensions.x-http-status-range}}{{^vendorExtensions.x-http-status-range}}{{code}}{{/vendorExtensions.x-http-status-range}}); + } + + return result != null; + } + {{/dataType}} + {{#-last}} + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>OnDeserializationError}} + {{/lambda.indent4}} + {{/lambda.trimTrailingWithNewLine}} + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + {{/-last}} + {{/responses}} + } + {{/-first}} + {{/responses}} + {{/vendorExtensions.x-duplicates}} + {{/operation}} + } + {{/operations}} +} +{{/lambda.trimLineBreaks}} diff --git a/templates-v7/csharp/libraries/generichost/api_test.mustache b/templates-v7/csharp/libraries/generichost/api_test.mustache new file mode 100644 index 000000000..02ce22168 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/api_test.mustache @@ -0,0 +1,51 @@ +{{>partial_header}} +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{apiPackage}};{{#hasImport}} +using {{packageName}}.{{modelPackage}};{{/hasImport}} + + +{{>testInstructions}} + + +namespace {{packageName}}.Test.{{apiPackage}} +{ + /// + /// Class for testing {{classname}} + /// + public sealed class {{classname}}Tests : ApiTestsBase + { + private readonly {{interfacePrefix}}{{classname}} _instance; + + public {{classname}}Tests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + } + {{#operations}} + {{#operation}} + + /// + /// Test {{operationId}} + /// + [Fact (Skip = "not implemented")] + public async Task {{operationId}}AsyncTest() + { + {{#allParams}} + {{^required}}Client.Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} = default{{nrt!}}; + {{/allParams}} + {{#returnType}} + var response = await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + var model = response.{{#lambda.first}}{{#responses}}{{vendorExtensions.x-http-status}} {{/responses}}{{/lambda.first}}(); + Assert.IsType<{{{.}}}>(model); + {{/returnType}} + {{^returnType}} + await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/returnType}} + } + {{/operation}} + {{/operations}} + } +} diff --git a/templates-v7/csharp/libraries/generichost/git_push.ps1.mustache b/templates-v7/csharp/libraries/generichost/git_push.ps1.mustache new file mode 100644 index 000000000..f263c2bc5 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/git_push.ps1.mustache @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "{{{gitHost}}}", + [Parameter()][Alias("u")][String]$GitUserId = "{{{gitUserId}}}", + [Parameter()][Alias("r")][String]$GitRepoId = "{{{gitRepoId}}}", + [Parameter()][Alias("m")][string]$Message = "{{{releaseNote}}}", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/git_push.sh.mustache b/templates-v7/csharp/libraries/generichost/git_push.sh.mustache new file mode 100644 index 000000000..3d4b710dc --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/git_push.sh.mustache @@ -0,0 +1,49 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=${1:-{{{gitUserId}}}} +git_repo_id=${2:-{{{gitRepoId}}}} +release_note=${3:-{{{releaseNote}}}} +git_host=${4:-{{{gitHost}}}} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +git_remote=$(git remote) + +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/templates-v7/csharp/libraries/generichost/model.mustache b/templates-v7/csharp/libraries/generichost/model.mustache new file mode 100644 index 000000000..f9931574d --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/model.mustache @@ -0,0 +1,50 @@ +// +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +{{^useGenericHost}} +using System.Runtime.Serialization; +{{/useGenericHost}} +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +{{#validatable}} +using System.ComponentModel.DataAnnotations; +{{/validatable}} +{{#useCompareNetObjects}} +using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; +{{/useCompareNetObjects}} +{{#useGenericHost}} +{{#useSourceGeneration}} +using System.Text.Json.Serialization.Metadata; +{{/useSourceGeneration}} +using {{packageName}}.{{clientPackage}}; +{{/useGenericHost}} +{{#models}} +{{#lambda.trimTrailingWithNewLine}} +{{#model}} + +namespace {{packageName}}.{{modelPackage}} +{ +{{#isEnum}} +{{>modelEnum}} +{{/isEnum}} +{{^isEnum}} +{{>modelGeneric}} + +{{>JsonConverter}} +{{/isEnum}} +{{>SourceGenerationContext}} +{{/model}} +{{/lambda.trimTrailingWithNewLine}} +{{/models}} +} diff --git a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache new file mode 100644 index 000000000..04fb37138 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache @@ -0,0 +1,393 @@ + /// + /// {{description}}{{^description}}{{classname}}{{/description}} + /// + {{>visibility}} partial class {{classname}}{{#lambda.firstDot}}{{#parent}} : .{{/parent}}{{#validatable}} : .{{/validatable}}{{#equatable}}{{#readOnlyVars}}{{#-first}} : .{{/-first}}{{/readOnlyVars}}{{/equatable}}{{/lambda.firstDot}}{{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{>ImplementsIEquatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} + { + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + /// + /// Initializes a new instance of the class. + /// + /// + {{#composedSchemas.anyOf}} + /// + {{/composedSchemas.anyOf}} + {{#allVars}} + {{^isDiscriminator}} + /// {{description}}{{^description}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} + {{/isDiscriminator}} + {{/allVars}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{{dataType}}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{#model.composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{baseType}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/model.composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{parent}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}.{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} + { + {{#composedSchemas.anyOf}} + {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{/composedSchemas.anyOf}} + {{name}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{#allVars}} + {{^isDiscriminator}} + {{^isInherited}} + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{/isInherited}} + {{#isInherited}} + {{#isNew}} + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{/isNew}} + {{/isInherited}} + {{/isDiscriminator}} + {{#vendorExtensions.x-is-base-or-new-discriminator}} + {{^model.composedSchemas.anyOf}} + {{^model.composedSchemas.oneOf}} + {{name}} = {{^isEnum}}this.GetType().Name{{/isEnum}}{{#isEnum}}({{datatypeWithEnum}})Enum.Parse(typeof({{datatypeWithEnum}}), this.GetType().Name){{/isEnum}}; + {{/model.composedSchemas.oneOf}} + {{/model.composedSchemas.anyOf}} + {{/vendorExtensions.x-is-base-or-new-discriminator}} + {{/allVars}} + OnCreated(); + } + + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + {{^composedSchemas.oneOf}} + /// + /// Initializes a new instance of the class. + /// + {{#composedSchemas.anyOf}} + /// + {{/composedSchemas.anyOf}} + {{#allVars}} + {{^isDiscriminator}} + /// {{description}}{{^description}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} + {{/isDiscriminator}} + {{/allVars}} + {{^composedSchemas.anyOf}} + [JsonConstructor] + {{/composedSchemas.anyOf}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{baseType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} + { + {{#composedSchemas.anyOf}} + {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{/composedSchemas.anyOf}} + {{#allVars}} + {{^isDiscriminator}} + {{^isInherited}} + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{/isInherited}} + {{#isInherited}} + {{#isNew}} + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{/isNew}} + {{/isInherited}} + {{/isDiscriminator}} + {{#vendorExtensions.x-is-base-or-new-discriminator}} + {{^model.composedSchemas.anyOf}} + {{^model.composedSchemas.oneOf}} + {{name}} = {{^isEnum}}this.GetType().Name{{/isEnum}}{{#isEnum}}({{datatypeWithEnum}})Enum.Parse(typeof({{datatypeWithEnum}}), this.GetType().Name){{/isEnum}}; + {{/model.composedSchemas.oneOf}} + {{/model.composedSchemas.anyOf}} + {{/vendorExtensions.x-is-base-or-new-discriminator}} + {{/allVars}} + OnCreated(); + } + + {{/composedSchemas.oneOf}} + partial void OnCreated(); + + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} +{{>modelInnerEnum}} + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} +{{>modelInnerEnum}} + {{/complexType}} + {{/isEnum}} + {{^isDiscriminator}} + {{#isEnum}} + {{^required}} + /// + /// Used to track the state of {{{name}}} + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + + {{/required}} + /// + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + /// + {{#description}} + /// {{.}} + {{/description}} + {{#example}} + /* {{.}} */ + {{/example}} + [JsonPropertyName("{{baseName}}")] + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{#isNew}}new {{/isNew}}{{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + + {{/isEnum}} + {{/isDiscriminator}} + {{/vars}} + {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^required}} + /// + /// Used to track the state of {{{name}}} + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + + {{/required}} + /// + /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{/description}} + /// {{#description}} + /// {{.}}{{/description}} + {{#example}} + /* {{.}} */ + {{/example}} + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option; } {{^isReadOnly}}set { this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.anyOf}} + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + /// + /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{/description}} + /// {{#description}} + /// {{.}}{{/description}} + {{#example}} + /* {{.}} */ + {{/example}} + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{{dataType}}}{{>NullConditionalProperty}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}} { get; {{^isReadOnly}}set; {{/isReadOnly}}} + + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + {{#allVars}} + {{#vendorExtensions.x-is-base-or-new-discriminator}} + {{^model.composedSchemas.anyOf}} + {{^model.composedSchemas.oneOf}} + /// + /// The discriminator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public {{#isNew}}new {{/isNew}}{{datatypeWithEnum}} {{name}} { get; } + + {{/model.composedSchemas.oneOf}} + {{/model.composedSchemas.anyOf}} + {{/vendorExtensions.x-is-base-or-new-discriminator}} + {{^vendorExtensions.x-is-base-or-new-discriminator}} + {{^isEnum}} + {{#isInherited}} + {{#isNew}} + {{^required}} + /// + /// Used to track the state of {{{name}}} + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public new Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + + {{/required}} + /// + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + /// {{#description}} + /// {{.}}{{/description}} + {{#example}} + /* {{.}} */ + {{/example}} + [JsonPropertyName("{{baseName}}")] + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public new {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + + {{/isNew}} + {{/isInherited}} + {{^isInherited}} + {{^required}} + /// + /// Used to track the state of {{{name}}} + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + + {{/required}} + /// + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + /// {{#description}} + /// {{.}}{{/description}} + {{#example}} + /* {{.}} */ + {{/example}} + [JsonPropertyName("{{baseName}}")] + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + + {{/isInherited}} + {{/isEnum}} + {{/vendorExtensions.x-is-base-or-new-discriminator}} + {{/allVars}} + {{#isAdditionalPropertiesTrue}} + {{^parentModel}} + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + {{/parentModel}} + {{/isAdditionalPropertiesTrue}} + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class {{classname}} {\n"); + {{#parent}} + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + {{/parent}} + {{#vars}} + {{^isDiscriminator}} + sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); + {{/isDiscriminator}} + {{/vars}} + {{#isAdditionalPropertiesTrue}} + {{^parentModel}} + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + {{/parentModel}} + {{/isAdditionalPropertiesTrue}} + sb.Append("}\n"); + return sb.ToString(); + } + {{#equatable}} + {{#readOnlyVars}} + {{#-first}} + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object{{nrt?}} input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + return this.Equals(input as {{classname}}); + {{/useCompareNetObjects}} + } + + /// + /// Returns true if {{classname}} instances are equal + /// + /// Instance of {{classname}} to be compared + /// Boolean + public bool Equals({{classname}}{{nrt?}} input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + if (input == null) + return false; + + return {{#parent}}base.Equals(input) && {{/parent}}{{#readOnlyVars}}{{^isInherited}}{{^isContainer}} + ( + {{name}} == input.{{name}} || + {{^vendorExtensions.x-is-value-type}} + ({{name}} != null && + {{name}}.Equals(input.{{name}})) + {{/vendorExtensions.x-is-value-type}} + {{#vendorExtensions.x-is-value-type}} + {{name}}.Equals(input.{{name}}) + {{/vendorExtensions.x-is-value-type}} + ){{^-last}} && {{/-last}}{{/isContainer}}{{#isContainer}} + ( + {{name}} == input.{{name}} || + {{^vendorExtensions.x-is-value-type}}{{name}} != null && + input.{{name}} != null && + {{/vendorExtensions.x-is-value-type}}{{name}}.SequenceEqual(input.{{name}}) + ){{^-last}} && {{/-last}}{{/isContainer}}{{/isInherited}}{{/readOnlyVars}}{{^readOnlyVars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/readOnlyVars}}{{^isAdditionalPropertiesTrue}};{{/isAdditionalPropertiesTrue}} + {{#isAdditionalPropertiesTrue}} + {{^parentModel}} + && (AdditionalProperties.Count == input.AdditionalProperties.Count && !AdditionalProperties.Except(input.AdditionalProperties).Any()); + {{/parentModel}} + {{/isAdditionalPropertiesTrue}} + {{/useCompareNetObjects}} + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + {{#parent}} + int hashCode = base.GetHashCode(); + {{/parent}} + {{^parent}} + int hashCode = 41; + {{/parent}} + {{#readOnlyVars}} + {{#required}} + {{^isNullable}} + hashCode = (hashCode * 59) + {{name}}.GetHashCode(); + {{/isNullable}} + {{/required}} + {{/readOnlyVars}} + {{#readOnlyVars}} + {{#lambda.copy}} + if ({{name}} != null) + hashCode = (hashCode * 59) + {{name}}.GetHashCode(); + + {{/lambda.copy}} + {{#isNullable}} + {{#lambda.pasteOnce}} + {{/lambda.pasteOnce}} + {{/isNullable}} + {{^required}} + {{#lambda.pasteOnce}} + {{/lambda.pasteOnce}} + {{/required}} + {{/readOnlyVars}} + {{#isAdditionalPropertiesTrue}} + {{^parentModel}} + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); + {{/parentModel}} + {{/isAdditionalPropertiesTrue}} + + return hashCode; + } + } + {{/-first}} + {{/readOnlyVars}} + {{/equatable}} +{{#validatable}} +{{^parentModel}} + +{{>validatable}} +{{/parentModel}} +{{/validatable}} + } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/testInstructions.mustache b/templates-v7/csharp/libraries/generichost/testInstructions.mustache new file mode 100644 index 000000000..7bf738e20 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/testInstructions.mustache @@ -0,0 +1,18 @@ +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ \ No newline at end of file diff --git a/templates-v7/csharp/libraries/httpclient/ApiClient.mustache b/templates-v7/csharp/libraries/httpclient/ApiClient.mustache new file mode 100644 index 000000000..d193fddd6 --- /dev/null +++ b/templates-v7/csharp/libraries/httpclient/ApiClient.mustache @@ -0,0 +1,792 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +{{^netStandard}} +using System.Web; +{{/netStandard}} +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using System.Net.Http; +using System.Net.Http.Headers; +{{#supportsRetry}} +using Polly; +{{/supportsRetry}} + +namespace {{packageName}}.Client +{ + /// + /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public async Task Deserialize(HttpResponseMessage response) + { + var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal async Task Deserialize(HttpResponseMessage response, Type type) + { + IList headers = new List(); + // process response headers, e.g. Access-Control-Allow-Methods + foreach (var responseHeader in response.Headers) + { + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + } + + // process response content headers, e.g. Content-Type + foreach (var responseHeader in response.Content.Headers) + { + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + } + + // RFC 2183 & RFC 2616 + var fileNameRegex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$", RegexOptions.IgnoreCase); + if (type == typeof(byte[])) // return byte array + { + return await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + } + else if (type == typeof(FileParameter)) + { + if (headers != null) { + foreach (var header in headers) + { + var match = fileNameRegex.Match(header.ToString()); + if (match.Success) + { + string fileName = ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + return new FileParameter(fileName, await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); + } + } + } + return new FileParameter(await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + if (headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? Path.GetTempPath() + : _configuration.TempFolderPath; + + foreach (var header in headers) + { + var match = fileNameRegex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(await response.Content.ReadAsStringAsync().ConfigureAwait(false), null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + /// + /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. + /// + {{>visibility}} partial class ApiClient : IDisposable, ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + { + private readonly string _baseUrl; + + private readonly HttpClientHandler _httpClientHandler; + private readonly HttpClient _httpClient; + private readonly bool _disposeClient; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + public ApiClient() : + this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) + { + } + + /// + /// Initializes a new instance of the . + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _httpClientHandler = new HttpClientHandler(); + _httpClient = new HttpClient(_httpClientHandler, true); + _disposeClient = true; + _baseUrl = basePath; + } + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + /// An instance of HttpClient. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public ApiClient(HttpClient client, HttpClientHandler handler = null) : + this(client, {{packageName}}.Client.GlobalConfiguration.Instance.BasePath, handler) + { + } + + /// + /// Initializes a new instance of the . + /// + /// An instance of HttpClient. + /// The target service's base path in URL format. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public ApiClient(HttpClient client, string basePath, HttpClientHandler handler = null) + { + if (client == null) throw new ArgumentNullException("client cannot be null"); + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _httpClientHandler = handler; + _httpClient = client; + _baseUrl = basePath; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + if(_disposeClient) { + _httpClient.Dispose(); + } + } + + /// Prepares multipart/form-data content + {{! TODO: Add handling of improper usage }} + HttpContent PrepareMultipartFormDataContent(RequestOptions options) + { + string boundary = "---------" + Guid.NewGuid().ToString().ToUpperInvariant(); + var multipartContent = new MultipartFormDataContent(boundary); + foreach (var formParameter in options.FormParameters) + { + multipartContent.Add(new StringContent(formParameter.Value), formParameter.Key); + } + + if (options.FileParameters != null && options.FileParameters.Count > 0) + { + foreach (var fileParam in options.FileParameters) + { + foreach (var file in fileParam.Value) + { + var content = new StreamContent(file.Content); + content.Headers.ContentType = new MediaTypeHeaderValue(file.ContentType); + multipartContent.Add(content, fileParam.Key, file.Name); + } + } + } + return multipartContent; + } + + /// + /// Provides all logic for constructing a new HttpRequestMessage. + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the a HttpRequestMessage. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new HttpRequestMessage instance. + /// + private HttpRequestMessage NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); + + builder.AddPathParameters(options.PathParameters); + + builder.AddQueryParameters(options.QueryParameters); + + HttpRequestMessage request = new HttpRequestMessage(method, builder.GetFullUri()); + + if (configuration.UserAgent != null) + { + request.Headers.TryAddWithoutValidation("User-Agent", configuration.UserAgent); + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.Headers.Add(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + // Todo make content headers actually content headers + request.Headers.TryAddWithoutValidation(headerParam.Key, value); + } + } + } + + List> contentList = new List>(); + + string contentType = null; + if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes.FirstOrDefault(); + } + + {{!// TODO Add error handling in case of improper usage}} + if (contentType == "multipart/form-data") + { + request.Content = PrepareMultipartFormDataContent(options); + } + else if (contentType == "application/x-www-form-urlencoded") + { + request.Content = new FormUrlEncodedContent(options.FormParameters); + } + else + { + if (options.Data != null) + { + if (options.Data is FileParameter fp) + { + contentType = contentType ?? "application/octet-stream"; + + var streamContent = new StreamContent(fp.Content); + streamContent.Headers.ContentType = new MediaTypeHeaderValue(contentType); + request.Content = streamContent; + } + else + { + var serializer = new CustomJsonCodec(SerializerSettings, configuration); + request.Content = new StringContent(serializer.Serialize(options.Data), new UTF8Encoding(), + "application/json"); + } + } + } + + + + // TODO provide an alternative that allows cookies per request instead of per API client + if (options.Cookies != null && options.Cookies.Count > 0) + { + request.Properties["CookieContainer"] = options.Cookies; + } + + return request; + } + + {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptRequest(HttpRequestMessage req){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} + {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} + + private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) + { + T result = (T) responseData; + string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + + var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) + { + ErrorText = response.ReasonPhrase, + Cookies = new List() + }; + + // process response headers, e.g. Access-Control-Allow-Methods + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + // process response content headers, e.g. Content-Type + if (response.Content.Headers != null) + { + foreach (var responseHeader in response.Content.Headers) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (_httpClientHandler != null && response != null) + { + try { + foreach (Cookie cookie in _httpClientHandler.CookieContainer.GetCookies(uri)) + { + transformed.Cookies.Add(cookie); + } + } + catch (PlatformNotSupportedException) {} + } + + return transformed; + } + + private ApiResponse Exec(HttpRequestMessage req, IReadableConfiguration configuration) + { + return ExecAsync(req, configuration).GetAwaiter().GetResult(); + } + + private async Task> ExecAsync(HttpRequestMessage req, + IReadableConfiguration configuration, + System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + CancellationTokenSource timeoutTokenSource = null; + CancellationTokenSource finalTokenSource = null; + var deserializer = new CustomJsonCodec(SerializerSettings, configuration); + var finalToken = cancellationToken; + + try + { + if (configuration.Timeout > TimeSpan.Zero) + { + timeoutTokenSource = new CancellationTokenSource(configuration.Timeout); + finalTokenSource = CancellationTokenSource.CreateLinkedTokenSource(finalToken, timeoutTokenSource.Token); + finalToken = finalTokenSource.Token; + } + + if (configuration.Proxy != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `Proxy` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + _httpClientHandler.Proxy = configuration.Proxy; + } + + if (configuration.ClientCertificates != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + _httpClientHandler.ClientCertificates.AddRange(configuration.ClientCertificates); + } + + var cookieContainer = req.Properties.ContainsKey("CookieContainer") ? req.Properties["CookieContainer"] as List : null; + + if (cookieContainer != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + foreach (var cookie in cookieContainer) + { + _httpClientHandler.CookieContainer.Add(cookie); + } + } + + InterceptRequest(req); + + HttpResponseMessage response; + {{#supportsRetry}} + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy + .ExecuteAndCaptureAsync(() => _httpClient.SendAsync(req, finalToken)) + .ConfigureAwait(false); + response = (policyResult.Outcome == OutcomeType.Successful) ? + policyResult.Result : new HttpResponseMessage() + { + ReasonPhrase = policyResult.FinalException.ToString(), + RequestMessage = req + }; + } + else + { + {{/supportsRetry}} + response = await _httpClient.SendAsync(req, finalToken).ConfigureAwait(false); + {{#supportsRetry}} + } + {{/supportsRetry}} + + if (!response.IsSuccessStatusCode) + { + return await ToApiResponse(response, default(T), req.RequestUri).ConfigureAwait(false); + } + + object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + } + + InterceptResponse(req, response); + + return await ToApiResponse(response, responseData, req.RequestUri).ConfigureAwait(false); + } + catch (OperationCanceledException original) + { + if (timeoutTokenSource != null && timeoutTokenSource.IsCancellationRequested) + { + throw new TaskCanceledException($"[{req.Method}] {req.RequestUri} was timeout.", + new TimeoutException(original.Message, original)); + } + throw; + } + finally + { + if (timeoutTokenSource != null) + { + timeoutTokenSource.Dispose(); + } + + if (finalTokenSource != null) + { + finalTokenSource.Dispose(); + } + } + } + + {{#supportsAsync}} + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); + } + #endregion IAsynchronousClient + {{/supportsAsync}} + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(new HttpMethod("PATCH"), path, options, config), config); + } + #endregion ISynchronousClient + } +} diff --git a/templates-v7/csharp/libraries/httpclient/FileParameter.mustache b/templates-v7/csharp/libraries/httpclient/FileParameter.mustache new file mode 100644 index 000000000..87e5fcdc9 --- /dev/null +++ b/templates-v7/csharp/libraries/httpclient/FileParameter.mustache @@ -0,0 +1,72 @@ +{{>partial_header}} + +using System.IO; + +namespace {{packageName}}.Client +{ + + /// + /// Represents a File passed to the API as a Parameter, allows using different backends for files + /// + public class FileParameter + { + /// + /// The filename + /// + public string Name { get; set; } = "no_name_provided"; + + /// + /// The content type of the file + /// + public string ContentType { get; set; } = "application/octet-stream"; + + /// + /// The content of the file + /// + public Stream Content { get; set; } + + /// + /// Construct a FileParameter just from the contents, will extract the filename from a filestream + /// + /// The file content + public FileParameter(Stream content) + { + if (content is FileStream fs) + { + Name = fs.Name; + } + Content = content; + } + + /// + /// Construct a FileParameter from name and content + /// + /// The filename + /// The file content + public FileParameter(string filename, Stream content) + { + Name = filename; + Content = content; + } + + /// + /// Construct a FileParameter from name and content + /// + /// The filename + /// The content type of the file + /// The file content + public FileParameter(string filename, string contentType, Stream content) + { + Name = filename; + ContentType = contentType; + Content = content; + } + + /// + /// Implicit conversion of stream to file parameter. Useful for backwards compatibility. + /// + /// Stream to convert + /// FileParameter + public static implicit operator FileParameter(Stream s) => new FileParameter(s); + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache b/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache new file mode 100644 index 000000000..25e76d03d --- /dev/null +++ b/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache @@ -0,0 +1,66 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace {{packageName}}.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// File parameters to be sent along with the request. + /// + public Multimap FileParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + FileParameters = new Multimap(); + Cookies = new List(); + } + } +} diff --git a/templates-v7/csharp/libraries/httpclient/api.mustache b/templates-v7/csharp/libraries/httpclient/api.mustache new file mode 100644 index 000000000..4a11de0e0 --- /dev/null +++ b/templates-v7/csharp/libraries/httpclient/api.mustache @@ -0,0 +1,766 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Mime; +using {{packageName}}.Client; +{{#hasImport}}using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.{{apiPackage}} +{ + {{#operations}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor + { + #region Synchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + {{#notes}} + /// + /// {{.}} + /// + {{/notes}} + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/operation}} + #endregion Synchronous Operations + } + + {{#supportsAsync}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor + { + #region Asynchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + {{/operation}} + #endregion Asynchronous Operations + } + {{/supportsAsync}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} partial class {{classname}} : IDisposable, {{interfacePrefix}}{{classname}} + { + private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public {{classname}}() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public {{classname}}(string basePath) + { + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + new {{packageName}}.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public {{classname}}({{packageName}}.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class. + /// + /// An instance of HttpClient. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public {{classname}}(HttpClient client, HttpClientHandler handler = null) : this(client, (string)null, handler) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// An instance of HttpClient. + /// The target service's base path in URL format. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public {{classname}}(HttpClient client, string basePath, HttpClientHandler handler = null) + { + if (client == null) throw new ArgumentNullException("client"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + new {{packageName}}.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(client, this.Configuration.BasePath, handler); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// + /// An instance of HttpClient. + /// An instance of Configuration. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public {{classname}}(HttpClient client, {{packageName}}.Client.Configuration configuration, HttpClientHandler handler = null) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + if (client == null) throw new ArgumentNullException("client"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(client, this.Configuration.BasePath, handler); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access.{{#supportsAsync}} + /// The client interface for asynchronous API access.{{/supportsAsync}} + /// The configuration object. + /// + public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + {{#supportsAsync}} + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + {{/supportsAsync}} + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + {{#supportsAsync}} + this.AsynchronousClient = asyncClient; + {{/supportsAsync}} + this.Configuration = configuration; + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public {{packageName}}.Client.ApiClient ApiClient { get; set; } = null; + + {{#supportsAsync}} + /// + /// The client for accessing this underlying API asynchronously. + /// + public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } + {{/supportsAsync}} + + /// + /// The client for accessing this underlying API synchronously. + /// + public {{packageName}}.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public {{packageName}}.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + {{#operation}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{#supportsAsync}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false);{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}}, {{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#constantParams}} + {{#isPathParam}} + // Set client side default value of Path Param "{{baseName}}". + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant path parameter + {{/isPathParam}} + {{/constantParams}} + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + localVarRequestOptions.QueryParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant query parameter + {{/isQueryParam}} + {{/constantParams}} + {{#queryParams}} + {{#required}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + } + {{/required}} + {{/queryParams}} + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + {{/isHeaderParam}} + {{/constantParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} +} diff --git a/templates-v7/csharp/libraries/httpclient/model.mustache b/templates-v7/csharp/libraries/httpclient/model.mustache new file mode 100644 index 000000000..f84de7f64 --- /dev/null +++ b/templates-v7/csharp/libraries/httpclient/model.mustache @@ -0,0 +1,51 @@ +{{>partial_header}} + +{{#models}} +{{#model}} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +{{#vendorExtensions.x-com-visible}} +using System.Runtime.InteropServices; +{{/vendorExtensions.x-com-visible}} +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +{{#discriminator}} +using JsonSubTypes; +{{/discriminator}} +{{/model}} +{{/models}} +{{#validatable}} +using System.ComponentModel.DataAnnotations; +{{/validatable}} +using FileParameter = {{packageName}}.Client.FileParameter; +using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; +{{#useCompareNetObjects}} +using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; +{{/useCompareNetObjects}} +{{#models}} +{{#model}} +{{#oneOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/oneOf}} +{{#anyOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/anyOf}} + +namespace {{packageName}}.{{modelPackage}} +{ +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} +} diff --git a/templates-v7/csharp/model.mustache b/templates-v7/csharp/model.mustache new file mode 100644 index 000000000..0d0c0b683 --- /dev/null +++ b/templates-v7/csharp/model.mustache @@ -0,0 +1,50 @@ +{{>partial_header}} + +{{#models}} +{{#model}} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +{{#vendorExtensions.x-com-visible}} +using System.Runtime.InteropServices; +{{/vendorExtensions.x-com-visible}} +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +{{#discriminator}} +using JsonSubTypes; +{{/discriminator}} +{{/model}} +{{/models}} +{{#validatable}} +using System.ComponentModel.DataAnnotations; +{{/validatable}} +using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; +{{#useCompareNetObjects}} +using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; +{{/useCompareNetObjects}} +{{#models}} +{{#model}} +{{#oneOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/oneOf}} +{{#anyOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/anyOf}} + +namespace {{packageName}}.{{modelPackage}} +{ +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} +} diff --git a/templates-v7/csharp/modelAnyOf.mustache b/templates-v7/csharp/modelAnyOf.mustache new file mode 100644 index 000000000..f3eac973d --- /dev/null +++ b/templates-v7/csharp/modelAnyOf.mustache @@ -0,0 +1,275 @@ +{{#model}} + /// + /// {{description}}{{^description}}{{classname}}{{/description}} + /// + {{#vendorExtensions.x-cls-compliant}} + [CLSCompliant({{{.}}})] + {{/vendorExtensions.x-cls-compliant}} + {{#vendorExtensions.x-com-visible}} + [ComVisible({{{.}}})] + {{/vendorExtensions.x-com-visible}} + [JsonConverter(typeof({{classname}}JsonConverter))] + [DataContract(Name = "{{{name}}}")] + {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} + { + {{#isNullable}} + /// + /// Initializes a new instance of the class. + /// + public {{classname}}() + { + IsNullable = true; + SchemaType= "anyOf"; + } + + {{/isNullable}} + {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^isNull}} + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of {{dataType}}. + public {{classname}}({{{dataType}}} actualInstance) + { + IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; + SchemaType= "anyOf"; + ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; + } + + {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.anyOf}} + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + {{#anyOf}} + {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) + { + _actualInstance = value; + } + {{/anyOf}} + else + { + throw new ArgumentException("Invalid instance found. Must be the following types:{{#anyOf}} {{{.}}}{{^-last}},{{/-last}}{{/anyOf}}"); + } + } + } + {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^isNull}} + + /// + /// Get the actual instance of `{{dataType}}`. If the actual instance is not `{{dataType}}`, + /// the InvalidClassException will be thrown + /// + /// An instance of {{dataType}} + public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}() + { + return ({{{dataType}}})ActualInstance; + } + {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.anyOf}} + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class {{classname}} {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, {{classname}}.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of {{classname}} + /// + /// JSON string + /// An instance of {{classname}} + public static {{classname}} FromJson(string jsonString) + { + {{classname}} new{{classname}} = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return new{{classname}}; + } + {{#anyOf}} + + try + { + new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return new{{classname}}; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into {{{.}}}: {1}", jsonString, exception.ToString())); + } + {{/anyOf}} + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + {{#equatable}} + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + return Equals(input as {{classname}}); + {{/useCompareNetObjects}} + } + + /// + /// Returns true if {{classname}} instances are equal + /// + /// Instance of {{classname}} to be compared + /// Boolean + public bool Equals({{classname}} input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + if (input == null) + return false; + + return ActualInstance.Equals(input.ActualInstance); + {{/useCompareNetObjects}} + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); + return hashCode; + } + } + {{/equatable}} + + {{#validatable}} + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + {{/validatable}} + } + + /// + /// Custom JSON converter for {{classname}} + /// + public class {{classname}}JsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{#isInteger}} + case JsonToken.Integer: + return new {{classname}}(Convert.ToInt32(reader.Value)); + {{/isInteger}} + {{#isNumber}} + case JsonToken.Float: + return new {{classname}}(Convert.ToDecimal(reader.Value)); + {{/isNumber}} + {{#isString}} + case JsonToken.String: + return new {{classname}}(Convert.ToString(reader.Value)); + {{/isString}} + {{#isBoolean}} + case JsonToken.Boolean: + return new {{classname}}(Convert.ToBoolean(reader.Value)); + {{/isBoolean}} + {{#isDate}} + case JsonToken.Date: + return new {{classname}}(Convert.ToDateTime(reader.Value)); + {{/isDate}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.anyOf}} + case JsonToken.StartObject: + return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return {{classname}}.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } +{{/model}} \ No newline at end of file diff --git a/templates-v7/csharp/modelEnum.mustache b/templates-v7/csharp/modelEnum.mustache new file mode 100644 index 000000000..37fb53f5f --- /dev/null +++ b/templates-v7/csharp/modelEnum.mustache @@ -0,0 +1,185 @@ + /// + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} + /// + {{#description}} + /// {{.}} + {{/description}} + {{#vendorExtensions.x-cls-compliant}} + [CLSCompliant({{{.}}})] + {{/vendorExtensions.x-cls-compliant}} + {{#vendorExtensions.x-com-visible}} + [ComVisible({{{.}}})] + {{/vendorExtensions.x-com-visible}} + {{#allowableValues}} + {{#enumVars}} + {{#-first}} + {{#isString}} + {{^useGenericHost}} + [JsonConverter(typeof(StringEnumConverter))] + {{/useGenericHost}} + {{/isString}} + {{/-first}} + {{/enumVars}} + {{/allowableValues}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + { + {{#allowableValues}} + {{#enumVars}} + /// + /// Enum {{name}} for value: {{value}} + /// + {{#isString}} + {{^useGenericHost}} + {{! EnumMember not currently supported in System.Text.Json, use a converter instead }} + [EnumMember(Value = "{{{value}}}")] + {{/useGenericHost}} + {{/isString}} + {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}}{{^vendorExtensions.x-zero-based-enum}} = {{-index}}{{/vendorExtensions.x-zero-based-enum}}{{/isString}}{{^-last}},{{/-last}} + {{^-last}} + + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + } + {{#useGenericHost}} + + /// + /// Converts to and from the JSON value + /// + public static class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} FromString(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Could not convert value to type {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? FromStringOrDefault(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static {{>EnumValueDataType}} ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} value) + { + {{^isString}} + return ({{>EnumValueDataType}}) value; + {{/isString}} + {{#isString}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isString}} + } + } + + /// + /// A Json converter for type + /// + /// + public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> + { + /// + /// Returns a {{datatypeWithEnum}} from the Json object + /// + /// + /// + /// + /// + public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string{{nrt?}} rawValue = reader.GetString(); + + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null + ? null + : {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) + { + writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}?> + { + /// + /// Returns a {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} from the Json object + /// + /// + /// + /// + /// + public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string{{nrt?}} rawValue = reader.GetString(); + + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null + ? null + : {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) + { + writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}?.ToString() ?? "null"); + } + } + {{/useGenericHost}} diff --git a/templates-v7/csharp/modelGeneric.mustache b/templates-v7/csharp/modelGeneric.mustache new file mode 100644 index 000000000..eed641273 --- /dev/null +++ b/templates-v7/csharp/modelGeneric.mustache @@ -0,0 +1,432 @@ + /// + /// {{description}}{{^description}}{{classname}}{{/description}} + /// + {{#vendorExtensions.x-cls-compliant}} + [CLSCompliant({{{vendorExtensions.x-cls-compliant}}})] + {{/vendorExtensions.x-cls-compliant}} + {{#vendorExtensions.x-com-visible}} + [ComVisible({{{vendorExtensions.x-com-visible}}})] + {{/vendorExtensions.x-com-visible}} + [DataContract(Name = "{{{name}}}")] + {{^useUnityWebRequest}} + {{#discriminator}} + {{#mappedModels.size}} + [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")] + {{/mappedModels.size}} + {{#mappedModels}} + [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] + {{/mappedModels}} + {{/discriminator}} + {{/useUnityWebRequest}} + {{>visibility}} partial class {{classname}}{{#lambda.firstDot}}{{#parent}} : .{{/parent}}{{#validatable}} : .{{/validatable}}{{#equatable}} : .{{/equatable}}{{/lambda.firstDot}}{{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} + { + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} +{{>modelInnerEnum}} + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} +{{>modelInnerEnum}} + {{/complexType}} + {{/isEnum}} + {{#isEnum}} + + /// + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + /// + {{#description}} + /// {{.}} + {{/description}} + {{#example}} + /* + {{.}} + */ + {{/example}} + {{^conditionalSerialization}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } + {{#isReadOnly}} + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{#conditionalSerialization}} + {{#isReadOnly}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } + + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + + {{^isReadOnly}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} + { + get{ return _{{name}};} + set + { + _{{name}} = value; + _flag{{name}} = true; + } + } + private {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} _{{name}}; + private bool _flag{{name}}; + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return _flag{{name}}; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{/isEnum}} + {{/vars}} + {{#hasRequired}} + {{^hasOnlyReadOnly}} + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + {{^isAdditionalPropertiesTrue}} + protected {{classname}}() { } + {{/isAdditionalPropertiesTrue}} + {{#isAdditionalPropertiesTrue}} + protected {{classname}}() + { + this.AdditionalProperties = new Dictionary(); + } + {{/isAdditionalPropertiesTrue}} + {{/hasOnlyReadOnly}} + {{/hasRequired}} + /// + /// Initializes a new instance of the class. + /// + {{#readWriteVars}} + /// {{description}}{{^description}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. + {{/readWriteVars}} + {{#hasOnlyReadOnly}} + [JsonConstructorAttribute] + {{/hasOnlyReadOnly}} + public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} + { + {{#vars}} + {{^isInherited}} + {{^isReadOnly}} + {{#required}} + {{^conditionalSerialization}} + {{^vendorExtensions.x-csharp-value-type}} + // to ensure "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" is required (not null) + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null) + { + throw new ArgumentNullException("{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} is a required property for {{classname}} and cannot be null"); + } + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{/conditionalSerialization}} + {{#conditionalSerialization}} + {{^vendorExtensions.x-csharp-value-type}} + // to ensure "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" is required (not null) + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null) + { + throw new ArgumentNullException("{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} is a required property for {{classname}} and cannot be null"); + } + this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{/conditionalSerialization}} + {{/required}} + {{/isReadOnly}} + {{/isInherited}} + {{/vars}} + {{#vars}} + {{^isInherited}} + {{^isReadOnly}} + {{^required}} + {{#defaultValue}} + {{^conditionalSerialization}} + {{^vendorExtensions.x-csharp-value-type}} + // use default value if no "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" provided + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} ?? {{#isString}}@{{/isString}}{{{defaultValue}}}; + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{/conditionalSerialization}} + {{/defaultValue}} + {{^defaultValue}} + {{^conditionalSerialization}} + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; + {{/conditionalSerialization}} + {{#conditionalSerialization}} + this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; + if (this.{{name}} != null) + { + this._flag{{name}} = true; + } + {{/conditionalSerialization}} + {{/defaultValue}} + {{/required}} + {{/isReadOnly}} + {{/isInherited}} + {{/vars}} + {{#isAdditionalPropertiesTrue}} + this.AdditionalProperties = new Dictionary(); + {{/isAdditionalPropertiesTrue}} + } + + {{#vars}} + {{^isInherited}} + {{^isEnum}} + /// + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + /// {{#description}} + /// {{.}}{{/description}} + {{#example}} + /* + {{.}} + */ + {{/example}} + {{^conditionalSerialization}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + {{#isDate}} + {{^supportsDateOnly}} + [JsonConverter(typeof(OpenAPIDateConverter))] + {{/supportsDateOnly}} + {{/isDate}} + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + + {{#isReadOnly}} + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{#conditionalSerialization}} + {{#isReadOnly}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + {{#isDate}} + [JsonConverter(typeof(OpenAPIDateConverter))] + {{/isDate}} + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{{dataType}}} {{name}} { get; private set; } + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + {{^isReadOnly}} + {{#isDate}} + [JsonConverter(typeof(OpenAPIDateConverter))] + {{/isDate}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + {{#deprecated}} + [Obsolete] + {{/deprecated}} + public {{{dataType}}} {{name}} + { + get{ return _{{name}};} + set + { + _{{name}} = value; + _flag{{name}} = true; + } + } + private {{{dataType}}} _{{name}}; + private bool _flag{{name}}; + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return _flag{{name}}; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{/isEnum}} + {{/isInherited}} + {{/vars}} + {{#isAdditionalPropertiesTrue}} + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + {{/isAdditionalPropertiesTrue}} + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class {{classname}} {\n"); + {{#parent}} + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + {{/parent}} + {{#vars}} + sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); + {{/vars}} + {{#isAdditionalPropertiesTrue}} + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + {{/isAdditionalPropertiesTrue}} + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public {{#parent}}{{^isArray}}{{^isMap}}override {{/isMap}}{{/isArray}}{{/parent}}{{^parent}}virtual {{/parent}}string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + {{#equatable}} + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + return this.Equals(input as {{classname}}); + {{/useCompareNetObjects}} + } + + /// + /// Returns true if {{classname}} instances are equal + /// + /// Instance of {{classname}} to be compared + /// Boolean + public bool Equals({{classname}} input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + if (input == null) + { + return false; + } + return {{#vars}}{{#parent}}base.Equals(input) && {{/parent}}{{^isContainer}} + ( + this.{{name}} == input.{{name}} || + {{^vendorExtensions.x-is-value-type}} + (this.{{name}} != null && + this.{{name}}.Equals(input.{{name}})) + {{/vendorExtensions.x-is-value-type}} + {{#vendorExtensions.x-is-value-type}} + this.{{name}}.Equals(input.{{name}}) + {{/vendorExtensions.x-is-value-type}} + ){{^-last}} && {{/-last}}{{/isContainer}}{{#isContainer}} + ( + this.{{name}} == input.{{name}} || + {{^vendorExtensions.x-is-value-type}}this.{{name}} != null && + input.{{name}} != null && + {{/vendorExtensions.x-is-value-type}}this.{{name}}.SequenceEqual(input.{{name}}) + ){{^-last}} && {{/-last}}{{/isContainer}}{{/vars}}{{^vars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/vars}}{{^isAdditionalPropertiesTrue}};{{/isAdditionalPropertiesTrue}} + {{#isAdditionalPropertiesTrue}} + && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); + {{/isAdditionalPropertiesTrue}} + {{/useCompareNetObjects}} + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + {{#parent}} + int hashCode = base.GetHashCode(); + {{/parent}} + {{^parent}} + int hashCode = 41; + {{/parent}} + {{#vars}} + {{^vendorExtensions.x-is-value-type}} + if (this.{{name}} != null) + { + hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); + } + {{/vendorExtensions.x-is-value-type}} + {{#vendorExtensions.x-is-value-type}} + hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); + {{/vendorExtensions.x-is-value-type}} + {{/vars}} + {{#isAdditionalPropertiesTrue}} + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + {{/isAdditionalPropertiesTrue}} + return hashCode; + } + } + {{/equatable}} + +{{#validatable}} +{{>validatable}} +{{/validatable}} + } diff --git a/templates-v7/csharp/modelInnerEnum.mustache b/templates-v7/csharp/modelInnerEnum.mustache new file mode 100644 index 000000000..462ded84d --- /dev/null +++ b/templates-v7/csharp/modelInnerEnum.mustache @@ -0,0 +1,99 @@ + {{^isContainer}} + /// + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} + /// + {{#description}} + /// {{.}} + {{/description}} + {{#isString}} + {{^useGenericHost}} + [JsonConverter(typeof(StringEnumConverter))] + {{/useGenericHost}} + {{/isString}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + { + {{#allowableValues}} + {{#enumVars}} + /// + /// Enum {{name}} for value: {{value}} + /// + {{^useGenericHost}} + {{#isString}} + [EnumMember(Value = "{{{value}}}")] + {{/isString}} + {{/useGenericHost}} + {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}}{{^vendorExtensions.x-zero-based-enum}} = {{-index}}{{/vendorExtensions.x-zero-based-enum}}{{/isString}}{{^-last}},{{/-last}} + {{^-last}} + + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + } + {{#useGenericHost}} + + /// + /// Returns a + /// + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}FromString(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Could not convert value to type {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}FromStringOrDefault(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + {{#isString}} + /// + {{/isString}} + public static {{>EnumValueDataType}}{{#lambda.first}}{{#nrt}}{{#isString}}{{#isNullable}}{{nrt?}} {{^nrt}}{{#vendorExtensions.x-is-value-type}}? {{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}}{{/isString}}{{/nrt}}{{/lambda.first}} {{datatypeWithEnum}}ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#isString}}{{>NullConditionalProperty}}{{/isString}} value) + { + {{^isString}} + return ({{>EnumValueDataType}}) value; + {{/isString}} + {{#isString}} + {{#isNullable}} + if (value == null) + return null; + + {{/isNullable}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isString}} + } + {{/useGenericHost}} + {{/isContainer}} \ No newline at end of file diff --git a/templates-v7/csharp/modelOneOf.mustache b/templates-v7/csharp/modelOneOf.mustache new file mode 100644 index 000000000..ab42e4eef --- /dev/null +++ b/templates-v7/csharp/modelOneOf.mustache @@ -0,0 +1,320 @@ +{{#model}} + /// + /// {{description}}{{^description}}{{classname}}{{/description}} + /// + {{#vendorExtensions.x-cls-compliant}} + [CLSCompliant({{{.}}})] + {{/vendorExtensions.x-cls-compliant}} + {{#vendorExtensions.x-com-visible}} + [ComVisible({{{.}}})] + {{/vendorExtensions.x-com-visible}} + [JsonConverter(typeof({{classname}}JsonConverter))] + [DataContract(Name = "{{{name}}}")] + {{>visibility}} partial class {{classname}} : {{#lambda.joinWithComma}}AbstractOpenAPISchema {{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} + { + {{#isNullable}} + /// + /// Initializes a new instance of the class. + /// + public {{classname}}() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + {{/isNullable}} + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^isNull}} + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of {{dataType}}. + public {{classname}}({{{dataType}}} actualInstance) + { + this.IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; + } + + {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + {{#oneOf}} + {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}}) || value is {{{.}}}) + { + this._actualInstance = value; + } + {{/oneOf}} + else + { + throw new ArgumentException("Invalid instance found. Must be the following types:{{#oneOf}} {{{.}}}{{^-last}},{{/-last}}{{/oneOf}}"); + } + } + } + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^isNull}} + + /// + /// Get the actual instance of `{{dataType}}`. If the actual instance is not `{{dataType}}`, + /// the InvalidClassException will be thrown + /// + /// An instance of {{dataType}} + public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}() + { + return ({{{dataType}}})this.ActualInstance; + } + {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class {{classname}} {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, {{classname}}.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of {{classname}} + /// + /// JSON string + /// An instance of {{classname}} + public static {{classname}} FromJson(string jsonString) + { + {{classname}} new{{classname}} = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return new{{classname}}; + } + {{#useOneOfDiscriminatorLookup}} + {{#discriminator}} + + try + { + var discriminatorObj = JObject.Parse(jsonString)["{{{propertyBaseName}}}"]; + string discriminatorValue = discriminatorObj == null ?string.Empty :discriminatorObj.ToString(); + switch (discriminatorValue) + { + {{#mappedModels}} + case "{{{mappingName}}}": + new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{modelName}}}>(jsonString, {{classname}}.AdditionalPropertiesSerializerSettings)); + return new{{classname}}; + {{/mappedModels}} + default: + System.Diagnostics.Debug.WriteLine(string.Format("Failed to lookup discriminator value `{0}` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); + break; + } + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(string.Format("Failed to parse the json data : `{0}` {1}", jsonString, ex.ToString())); + } + + {{/discriminator}} + {{/useOneOfDiscriminatorLookup}} + int match = 0; + List matchedTypes = new List(); + {{#oneOf}} + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof({{{.}}}).GetProperty("AdditionalProperties") == null) + { + new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.SerializerSettings)); + } + else + { + new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("{{{.}}}"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into {{{.}}}: {1}", jsonString, exception.ToString())); + } + {{/oneOf}} + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + String.Join(",", matchedTypes)); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return new{{classname}}; + } + + {{#equatable}} + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + return this.Equals(input as {{classname}}); + {{/useCompareNetObjects}} + } + + /// + /// Returns true if {{classname}} instances are equal + /// + /// Instance of {{classname}} to be compared + /// Boolean + public bool Equals({{classname}} input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + {{/useCompareNetObjects}} + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + {{/equatable}} + {{#validatable}} + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + {{/validatable}} + } + + /// + /// Custom JSON converter for {{classname}} + /// + public class {{classname}}JsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{#isInteger}} + case JsonToken.Integer: + return new {{classname}}(Convert.ToInt32(reader.Value)); + {{/isInteger}} + {{#isNumber}} + case JsonToken.Float: + return new {{classname}}(Convert.ToDecimal(reader.Value)); + {{/isNumber}} + {{#isString}} + case JsonToken.String: + return new {{classname}}(Convert.ToString(reader.Value)); + {{/isString}} + {{#isBoolean}} + case JsonToken.Boolean: + return new {{classname}}(Convert.ToBoolean(reader.Value)); + {{/isBoolean}} + {{#isDate}} + case JsonToken.Date: + return new {{classname}}(Convert.ToDateTime(reader.Value)); + {{/isDate}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + case JsonToken.StartObject: + return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return {{classname}}.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } +{{/model}} diff --git a/templates-v7/csharp/model_doc.mustache b/templates-v7/csharp/model_doc.mustache new file mode 100644 index 000000000..3c7f8b2db --- /dev/null +++ b/templates-v7/csharp/model_doc.mustache @@ -0,0 +1,22 @@ +{{#models}} +{{#model}} +# {{{packageName}}}.{{modelPackage}}.{{{classname}}} +{{#description}}{{&description}} +{{/description}} + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#parent}} +{{#parentVars}} +**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/parentVars}} +{{/parent}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/vars}} + +[[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) + +{{/model}} +{{/models}} diff --git a/templates-v7/csharp/model_test.mustache b/templates-v7/csharp/model_test.mustache new file mode 100644 index 000000000..1feaeb9d8 --- /dev/null +++ b/templates-v7/csharp/model_test.mustache @@ -0,0 +1,87 @@ +{{>partial_header}} + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using {{packageName}}.{{modelPackage}}; +using {{packageName}}.{{clientPackage}}; +using System.Reflection; +{{^useGenericHost}} +using Newtonsoft.Json; +{{/useGenericHost}} + +{{#models}} +{{#model}} +namespace {{packageName}}.Test.Model +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class {{classname}}Tests : IDisposable + { + // TODO uncomment below to declare an instance variable for {{classname}} + //private {{classname}} instance; + + public {{classname}}Tests() + { + // TODO uncomment below to create an instance of {{classname}} + //instance = new {{classname}}(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.trimLineBreaks}} + /// + /// Test an instance of {{classname}} + /// + [Fact] + public void {{classname}}InstanceTest() + { + // TODO uncomment below to test "IsType" {{classname}} + //Assert.IsType<{{classname}}>(instance); + } + + {{#discriminator}} + {{#children}} + + /// + /// Test deserialize a {{classname}} from type {{parent}} + /// + [Fact] + public void {{classname}}DeserializeFrom{{parent}}Test() + { + // TODO uncomment below to test deserialize a {{classname}} from type {{parent}} + //Assert.IsType<{{parent}}>(JsonConvert.DeserializeObject<{{parent}}>(new {{classname}}().ToJson())); + } + + {{/children}} + {{/discriminator}} + {{#vars}} + + + /// + /// Test the property '{{name}}' + /// + [Fact] + public void {{name}}Test() + { + // TODO unit test for the property '{{name}}' + } + {{/vars}} + {{/lambda.trimLineBreaks}} + {{/lambda.trimTrailingWithNewLine}} + } +} +{{/model}} +{{/models}} diff --git a/templates-v7/csharp/netcore_project.additions.mustache b/templates-v7/csharp/netcore_project.additions.mustache new file mode 100644 index 000000000..8c6f3ad52 --- /dev/null +++ b/templates-v7/csharp/netcore_project.additions.mustache @@ -0,0 +1 @@ +{{! if needed users can add this file to their templates folder to append to the csproj }} \ No newline at end of file diff --git a/templates-v7/csharp/netcore_project.mustache b/templates-v7/csharp/netcore_project.mustache new file mode 100644 index 000000000..ade2832cd --- /dev/null +++ b/templates-v7/csharp/netcore_project.mustache @@ -0,0 +1,84 @@ + + + {{#useGenericHost}} + true {{/useGenericHost}}{{^useGenericHost}} + false{{/useGenericHost}} + {{targetFramework}} + {{packageName}} + {{packageName}} + Library + {{packageAuthors}} + {{packageCompany}} + {{packageTitle}} + {{packageDescription}} + {{packageCopyright}} + {{packageName}} + {{packageVersion}} + bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml{{#licenseId}} + {{.}}{{/licenseId}} + https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git + git{{#releaseNote}} + {{.}}{{/releaseNote}}{{#packageTags}} + {{{.}}}{{/packageTags}}{{#nrt}} + {{#useGenericHost}}enable{{/useGenericHost}}{{^useGenericHost}}annotations{{/useGenericHost}}{{/nrt}} + false + + + + {{#useCompareNetObjects}} + + {{/useCompareNetObjects}} + {{^useGenericHost}} + + + {{/useGenericHost}} + {{#useRestSharp}} + + {{/useRestSharp}} + {{#useGenericHost}} + + + {{#supportsRetry}} + + {{/supportsRetry}} + {{#net80OrLater}} + + {{/net80OrLater}} + {{^net60OrLater}} + + {{#net47OrLater}} + + {{/net47OrLater}} + {{/net60OrLater}} + {{/useGenericHost}} + {{^useGenericHost}} + {{#supportsRetry}} + + {{/supportsRetry}} + {{/useGenericHost}} + {{#validatable}} + {{^net60OrLater}} + + {{/net60OrLater}} + {{/validatable}} + + +{{^useGenericHost}} + + {{^net60OrLater}} + + {{/net60OrLater}} + {{#net48}} + + {{/net48}} + + + {{^net60OrLater}} + + {{/net60OrLater}} + {{#net48}} + + {{/net48}} + +{{/useGenericHost}} +{{>netcore_project.additions}} diff --git a/templates-v7/csharp/netcore_testproject.additions.mustache b/templates-v7/csharp/netcore_testproject.additions.mustache new file mode 100644 index 000000000..8c6f3ad52 --- /dev/null +++ b/templates-v7/csharp/netcore_testproject.additions.mustache @@ -0,0 +1 @@ +{{! if needed users can add this file to their templates folder to append to the csproj }} \ No newline at end of file diff --git a/templates-v7/csharp/netcore_testproject.mustache b/templates-v7/csharp/netcore_testproject.mustache new file mode 100644 index 000000000..90434b77e --- /dev/null +++ b/templates-v7/csharp/netcore_testproject.mustache @@ -0,0 +1,20 @@ + + + + {{testPackageName}} + {{testPackageName}} + {{testTargetFramework}} + false{{#nrt}} + {{#useGenericHost}}enable{{/useGenericHost}}{{^useGenericHost}}annotations{{/useGenericHost}}{{/nrt}} + + + + + + + + + + + +{{>netcore_testproject.additions}} diff --git a/templates-v7/csharp/nuspec.mustache b/templates-v7/csharp/nuspec.mustache new file mode 100644 index 000000000..680ee2fe4 --- /dev/null +++ b/templates-v7/csharp/nuspec.mustache @@ -0,0 +1,57 @@ + + + + + $id$ + {{packageTitle}} + + + $version$ + + + $author$ + + + $author$ + false + false + + + {{packageDescription}} + {{#termsOfService}} + {{.}} + {{/termsOfService}} + {{#licenseUrl}} + {{.}} + {{/licenseUrl}} + + + + + + {{#useRestSharp}} + + {{/useRestSharp}} + {{#useCompareNetObjects}} + + {{/useCompareNetObjects}} + + {{#validatable}} + + {{/validatable}} + {{#supportsRetry}} + + {{/supportsRetry}} + + + + + + + + + + + diff --git a/templates-v7/csharp/openapi.mustache b/templates-v7/csharp/openapi.mustache new file mode 100644 index 000000000..34fbb53f3 --- /dev/null +++ b/templates-v7/csharp/openapi.mustache @@ -0,0 +1 @@ +{{{openapi-yaml}}} diff --git a/templates-v7/csharp/partial_header.mustache b/templates-v7/csharp/partial_header.mustache new file mode 100644 index 000000000..1562058ad --- /dev/null +++ b/templates-v7/csharp/partial_header.mustache @@ -0,0 +1,17 @@ +/* + {{#appName}} + * {{{.}}} + * + {{/appName}} + {{#appDescription}} + * {{{.}}} + * + {{/appDescription}} + {{#version}} + * The version of the OpenAPI document: {{{.}}} + {{/version}} + {{#infoEmail}} + * Contact: {{{.}}} + {{/infoEmail}} + * Generated by: https://github.com/openapitools/openapi-generator.git + */ diff --git a/templates-v7/csharp/validatable.mustache b/templates-v7/csharp/validatable.mustache new file mode 100644 index 000000000..429eed118 --- /dev/null +++ b/templates-v7/csharp/validatable.mustache @@ -0,0 +1,135 @@ +{{#discriminator}} + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { +{{/discriminator}} +{{^discriminator}} + {{#parent}} + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + {{/parent}} + {{^parent}} + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + {{/parent}} +{{/discriminator}} + {{#parent}} + {{^isArray}} + {{^isMap}} + foreach (var x in {{#discriminator}}base.{{/discriminator}}BaseValidate(validationContext)) + { + yield return x; + } + {{/isMap}} + {{/isArray}} + {{/parent}} + {{#vars}} + {{#hasValidation}} + {{^isEnum}} + {{#maxLength}} + // {{{name}}} ({{{dataType}}}) maxLength + if (this.{{{name}}} != null && this.{{{name}}}.Length > {{maxLength}}) + { + yield return new ValidationResult("Invalid value for {{{name}}}, length must be less than {{maxLength}}.", new [] { "{{{name}}}" }); + } + + {{/maxLength}} + {{#minLength}} + // {{{name}}} ({{{dataType}}}) minLength + if (this.{{{name}}} != null && this.{{{name}}}.Length < {{minLength}}) + { + yield return new ValidationResult("Invalid value for {{{name}}}, length must be greater than {{minLength}}.", new [] { "{{{name}}}" }); + } + + {{/minLength}} + {{#maximum}} + // {{{name}}} ({{{dataType}}}) maximum + if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} {{#exclusiveMaximum}}<={{/exclusiveMaximum}}{{^exclusiveMaximum}}>{{/exclusiveMaximum}} ({{{dataType}}}){{maximum}}) + { + yield return new ValidationResult("Invalid value for {{{name}}}, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.", new [] { "{{{name}}}" }); + } + + {{/maximum}} + {{#minimum}} + // {{{name}}} ({{{dataType}}}) minimum + if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} {{#exclusiveMaximum}}>={{/exclusiveMaximum}}{{^exclusiveMaximum}}<{{/exclusiveMaximum}} ({{{dataType}}}){{minimum}}) + { + yield return new ValidationResult("Invalid value for {{{name}}}, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.", new [] { "{{{name}}}" }); + } + + {{/minimum}} + {{#pattern}} + {{^isByteArray}} + {{#vendorExtensions.x-is-value-type}} + {{#isNullable}} + if (this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null){ + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>ValidateRegex}} + {{/lambda.indent4}} + + {{/lambda.trimTrailingWithNewLine}} + } + + {{/isNullable}} + {{^isNullable}} + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent3}} + {{>ValidateRegex}} + {{/lambda.indent3}} + + {{/lambda.trimTrailingWithNewLine}} + {{/isNullable}} + {{/vendorExtensions.x-is-value-type}} + {{^vendorExtensions.x-is-value-type}} + if (this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null) { + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>ValidateRegex}} + {{/lambda.indent4}} + + {{/lambda.trimTrailingWithNewLine}} + } + + {{/vendorExtensions.x-is-value-type}} + {{/isByteArray}} + {{/pattern}} + {{/isEnum}} + {{/hasValidation}} + {{/vars}} + yield break; + } \ No newline at end of file diff --git a/templates-v7/csharp/visibility.mustache b/templates-v7/csharp/visibility.mustache new file mode 100644 index 000000000..a1d1f4163 --- /dev/null +++ b/templates-v7/csharp/visibility.mustache @@ -0,0 +1 @@ +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} \ No newline at end of file From 15053ded55080dde3e18f2fd482cca625515f2fc Mon Sep 17 00:00:00 2001 From: kwokhe <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 5 Jun 2025 13:56:17 +0200 Subject: [PATCH 002/126] Rename Client to AdyenClient --- Adyen.IntegrationTest/BaseTest.cs | 4 +- .../CancellationTokenTest.cs | 2 +- Adyen.IntegrationTest/CheckoutTest.cs | 22 +- Adyen.IntegrationTest/ErrorTest.cs | 8 +- Adyen.IntegrationTest/PaymentTest.cs | 2 +- Adyen.IntegrationTest/PayoutTest.cs | 10 +- .../{ClientTest.cs => AdyenClientTest.cs} | 32 +- Adyen.Test/BaseTest.cs | 24 +- Adyen.Test/CheckoutTest.cs | 8 +- Adyen.Test/ExtensionsTest.cs | 14 +- Adyen.Test/ProxyTest.cs | 4 +- Adyen.Test/ReadmeTest.cs | 2 +- Adyen.Test/RecurringTest.cs | 16 +- Adyen.Test/TerminalApiAsyncServiceTest.cs | 20 +- Adyen.Test/TerminalApiLocalServiceTest.cs | 16 +- Adyen.Test/TerminalApiPosRequestTest.cs | 6 +- Adyen.Test/TerminalApiSyncServiceTest.cs | 16 +- Adyen/{Client.cs => AdyenClient.cs} | 274 +++++++++--------- Adyen/Config.cs | 10 +- Adyen/Service/AbstractService.cs | 8 +- Adyen/Service/BalanceControlService.cs | 2 +- .../BalancePlatform/AccountHoldersService.cs | 2 +- .../BalancePlatform/BalanceAccountsService.cs | 2 +- .../BankAccountValidationService.cs | 2 +- .../BalancePlatform/CardOrdersService.cs | 2 +- .../BalancePlatform/GrantAccountsService.cs | 2 +- .../BalancePlatform/GrantOffersService.cs | 2 +- .../BalancePlatform/ManageCardPINService.cs | 2 +- .../ManageSCADevicesService.cs | 2 +- .../BalancePlatform/NetworkTokensService.cs | 2 +- .../PaymentInstrumentGroupsService.cs | 2 +- .../PaymentInstrumentsService.cs | 2 +- .../BalancePlatform/PlatformService.cs | 2 +- .../TransactionRulesService.cs | 2 +- .../BalancePlatform/TransferRoutesService.cs | 2 +- Adyen/Service/BinLookupService.cs | 2 +- Adyen/Service/Checkout/DonationsService.cs | 2 +- .../Service/Checkout/ModificationsService.cs | 2 +- Adyen/Service/Checkout/OrdersService.cs | 2 +- Adyen/Service/Checkout/PaymentLinksService.cs | 2 +- Adyen/Service/Checkout/PaymentsService.cs | 2 +- Adyen/Service/Checkout/RecurringService.cs | 2 +- Adyen/Service/Checkout/UtilityService.cs | 2 +- Adyen/Service/DataProtectionService.cs | 2 +- Adyen/Service/DisputesService.cs | 2 +- .../BusinessLinesService.cs | 2 +- .../LegalEntityManagement/DocumentsService.cs | 2 +- .../HostedOnboardingService.cs | 2 +- .../LegalEntitiesService.cs | 2 +- .../PCIQuestionnairesService.cs | 2 +- .../TaxEDeliveryConsentService.cs | 2 +- .../TermsOfServiceService.cs | 2 +- .../TransferInstrumentsService.cs | 2 +- .../APICredentialsCompanyLevelService.cs | 2 +- .../APICredentialsMerchantLevelService.cs | 2 +- .../Management/APIKeyCompanyLevelService.cs | 2 +- .../Management/APIKeyMerchantLevelService.cs | 2 +- .../Management/AccountCompanyLevelService.cs | 2 +- .../Management/AccountMerchantLevelService.cs | 2 +- .../Management/AccountStoreLevelService.cs | 2 +- .../AllowedOriginsCompanyLevelService.cs | 2 +- .../AllowedOriginsMerchantLevelService.cs | 2 +- .../AndroidFilesCompanyLevelService.cs | 2 +- .../ClientKeyCompanyLevelService.cs | 2 +- .../ClientKeyMerchantLevelService.cs | 2 +- .../Management/MyAPICredentialService.cs | 2 +- .../PaymentMethodsMerchantLevelService.cs | 2 +- .../PayoutSettingsMerchantLevelService.cs | 2 +- .../SplitConfigurationMerchantLevelService.cs | 2 +- .../TerminalActionsCompanyLevelService.cs | 2 +- .../TerminalActionsTerminalLevelService.cs | 2 +- .../TerminalOrdersCompanyLevelService.cs | 2 +- .../TerminalOrdersMerchantLevelService.cs | 2 +- .../TerminalSettingsCompanyLevelService.cs | 2 +- .../TerminalSettingsMerchantLevelService.cs | 2 +- .../TerminalSettingsStoreLevelService.cs | 2 +- .../TerminalSettingsTerminalLevelService.cs | 2 +- .../TerminalsTerminalLevelService.cs | 2 +- .../Management/UsersCompanyLevelService.cs | 2 +- .../Management/UsersMerchantLevelService.cs | 2 +- .../Management/WebhooksCompanyLevelService.cs | 2 +- .../WebhooksMerchantLevelService.cs | 2 +- Adyen/Service/PaymentService.cs | 2 +- Adyen/Service/PaymentsAppService.cs | 2 +- Adyen/Service/Payout/InitializationService.cs | 2 +- Adyen/Service/Payout/InstantPayoutsService.cs | 2 +- Adyen/Service/Payout/ReviewingService.cs | 2 +- .../PlatformsAccount/AccountHoldersService.cs | 2 +- .../PlatformsAccount/AccountsService.cs | 2 +- .../PlatformsAccount/VerificationService.cs | 2 +- Adyen/Service/PlatformsFundService.cs | 2 +- .../HostedOnboardingPageService.cs | 2 +- .../PCIComplianceQuestionnairePageService.cs | 2 +- ...atformsNotificationConfigurationService.cs | 2 +- Adyen/Service/PosMobileService.cs | 2 +- Adyen/Service/PosTerminalManagementService.cs | 2 +- Adyen/Service/RecurringService.cs | 2 +- .../Service/Resource/Terminal/TerminalApi.cs | 4 +- .../Terminal/TerminalApiAsyncClient.cs | 2 +- .../Resource/Terminal/TerminalApiLocal.cs | 2 +- .../Terminal/TerminalApiLocalClient.cs | 2 +- .../Terminal/TerminalApiSyncClient.cs | 2 +- Adyen/Service/ServiceResource.cs | 8 +- Adyen/Service/StoredValueService.cs | 2 +- Adyen/Service/TerminalApiAsyncService.cs | 18 +- Adyen/Service/TerminalApiLocalService.cs | 22 +- Adyen/Service/TerminalApiSyncService.cs | 18 +- Adyen/Service/TerminalCloudApi.cs | 22 +- Adyen/Service/TerminalLocalApi.cs | 12 +- Adyen/Service/TerminalLocalApiUnencrypted.cs | 16 +- Adyen/Service/Transfers/CapitalService.cs | 2 +- .../Service/Transfers/TransactionsService.cs | 2 +- Adyen/Service/Transfers/TransfersService.cs | 2 +- 113 files changed, 394 insertions(+), 394 deletions(-) rename Adyen.Test/{ClientTest.cs => AdyenClientTest.cs} (85%) rename Adyen/{Client.cs => AdyenClient.cs} (90%) diff --git a/Adyen.IntegrationTest/BaseTest.cs b/Adyen.IntegrationTest/BaseTest.cs index 1fcb4e960..6de13b46f 100644 --- a/Adyen.IntegrationTest/BaseTest.cs +++ b/Adyen.IntegrationTest/BaseTest.cs @@ -144,14 +144,14 @@ protected AdjustAuthorisationRequest CreateAdjustAuthorisationtestRequest(string #endregion - protected Client CreateApiKeyTestClient() + protected AdyenClient CreateApiKeyTestClient() { var config = new Config() { XApiKey = ClientConstants.Xapikey, Environment = Environment.Test }; - return new Client(config); + return new AdyenClient(config); } private PaymentRequest CreateFullPaymentRequest() diff --git a/Adyen.IntegrationTest/CancellationTokenTest.cs b/Adyen.IntegrationTest/CancellationTokenTest.cs index 594f25938..b997f8589 100644 --- a/Adyen.IntegrationTest/CancellationTokenTest.cs +++ b/Adyen.IntegrationTest/CancellationTokenTest.cs @@ -17,7 +17,7 @@ public class CancellationTokenTest : BaseTest [TestMethod] public void CancellationTokenDelayTest() { - var client = new Client(new Config()) + var client = new AdyenClient(new Config()) { HttpClient = new MyDelayedClient(new Config(), new System.Net.Http.HttpClient()) }; diff --git a/Adyen.IntegrationTest/CheckoutTest.cs b/Adyen.IntegrationTest/CheckoutTest.cs index 1ca9a9c6f..f9fb18f98 100644 --- a/Adyen.IntegrationTest/CheckoutTest.cs +++ b/Adyen.IntegrationTest/CheckoutTest.cs @@ -12,7 +12,7 @@ namespace Adyen.IntegrationTest [TestClass] public class CheckoutTest : BaseTest { - private Client _client; + private AdyenClient _adyenClient; private PaymentsService _checkout; private RecurringService _recurring; private ModificationsService _modifications; @@ -23,19 +23,19 @@ public class CheckoutTest : BaseTest [TestInitialize] public void Init() { - _client = CreateApiKeyTestClient(); - _checkout = new PaymentsService(_client); - _recurring = new RecurringService(_client); - _modifications = new ModificationsService(_client); - _paymentLinksService = new PaymentLinksService(_client); + _adyenClient = CreateApiKeyTestClient(); + _checkout = new PaymentsService(_adyenClient); + _recurring = new RecurringService(_adyenClient); + _modifications = new ModificationsService(_adyenClient); + _paymentLinksService = new PaymentLinksService(_adyenClient); // _classicCheckoutSdkService = new ClassicCheckoutSDKService(_client); - _paymentsService = new PaymentsService(_client); + _paymentsService = new PaymentsService(_adyenClient); } [TestMethod] public void PaymentsFlowWithInvalidApiKey() { - _client.Config.XApiKey = "InvalidKey"; + _adyenClient.Config.XApiKey = "InvalidKey"; try { var paymentResponse = _checkout.Payments(CreatePaymentRequestCheckout()); @@ -49,7 +49,7 @@ public void PaymentsFlowWithInvalidApiKey() [TestMethod] public void PaymentsFlowWithEmptyApiKey() { - _client.Config.XApiKey = null; + _adyenClient.Config.XApiKey = null; try { var paymentResponse = _checkout.Payments(CreatePaymentRequestCheckout()); @@ -63,8 +63,8 @@ public void PaymentsFlowWithEmptyApiKey() [TestMethod] public void PaymentsFlowWithPartiallyCorrectKeyApiKey() { - var key = _client.Config.XApiKey; - _client.Config.XApiKey = "1" + key; + var key = _adyenClient.Config.XApiKey; + _adyenClient.Config.XApiKey = "1" + key; try { var paymentResponse = _checkout.Payments(CreatePaymentRequestCheckout()); diff --git a/Adyen.IntegrationTest/ErrorTest.cs b/Adyen.IntegrationTest/ErrorTest.cs index f803087cf..2143e9428 100644 --- a/Adyen.IntegrationTest/ErrorTest.cs +++ b/Adyen.IntegrationTest/ErrorTest.cs @@ -17,14 +17,14 @@ namespace Adyen.IntegrationTest [TestClass] public class ErrorTest : BaseTest { - private Client _client; + private AdyenClient _adyenClient; private static readonly string MerchantAccount = ClientConstants.MerchantAccount; private HttpClientWrapper _httpClientWrapper; [TestInitialize] public void Init() { - _client = CreateApiKeyTestClient(); + _adyenClient = CreateApiKeyTestClient(); _httpClientWrapper = new HttpClientWrapper(new Config() { Environment = Environment.Test, XApiKey = ClientConstants.Xapikey }, new System.Net.Http.HttpClient()); @@ -33,7 +33,7 @@ public void Init() [TestMethod] public void TestClassicPaymentErrorHandling() { - var payments = new PaymentService(_client); + var payments = new PaymentService(_adyenClient); var request = new PaymentRequest { Amount = new Amount(){ Value = 1500, @@ -69,7 +69,7 @@ public void TestClassicPaymentErrorHandling() [TestMethod] public void TestCheckoutErrorHandling() { - var payments = new PaymentsService(_client); + var payments = new PaymentsService(_adyenClient); var request = new Model.Checkout.PaymentRequest { Amount = new Model.Checkout.Amount(){ Value = 1500, diff --git a/Adyen.IntegrationTest/PaymentTest.cs b/Adyen.IntegrationTest/PaymentTest.cs index e4c0dcbb9..3325f0e91 100644 --- a/Adyen.IntegrationTest/PaymentTest.cs +++ b/Adyen.IntegrationTest/PaymentTest.cs @@ -65,7 +65,7 @@ public void ApiIdemptotencyKeySuccessTest() [TestMethod] public void StoredValueIssueFailIntegrationTest() { - var client = new Client(new Config() + var client = new AdyenClient(new Config() { Environment = Environment.Test, XApiKey = ClientConstants.Xapikey diff --git a/Adyen.IntegrationTest/PayoutTest.cs b/Adyen.IntegrationTest/PayoutTest.cs index f4a8e593a..3f36c1269 100644 --- a/Adyen.IntegrationTest/PayoutTest.cs +++ b/Adyen.IntegrationTest/PayoutTest.cs @@ -11,7 +11,7 @@ namespace Adyen.IntegrationTest [TestClass] public class PayoutTest : BaseTest { - private Client _client; + private AdyenClient _adyenClient; private InstantPayoutsService _instantPayoutsService; private InitializationService _initializationService; private ReviewingService _reviewingService; @@ -19,10 +19,10 @@ public class PayoutTest : BaseTest [TestInitialize] public void Init() { - _client = this.CreateApiKeyTestClient(); - _instantPayoutsService = new InstantPayoutsService(_client); - _initializationService = new InitializationService(_client); - _reviewingService = new ReviewingService(_client); + _adyenClient = this.CreateApiKeyTestClient(); + _instantPayoutsService = new InstantPayoutsService(_adyenClient); + _initializationService = new InitializationService(_adyenClient); + _reviewingService = new ReviewingService(_adyenClient); } [TestMethod] diff --git a/Adyen.Test/ClientTest.cs b/Adyen.Test/AdyenClientTest.cs similarity index 85% rename from Adyen.Test/ClientTest.cs rename to Adyen.Test/AdyenClientTest.cs index 99a712e62..b4134201d 100644 --- a/Adyen.Test/ClientTest.cs +++ b/Adyen.Test/AdyenClientTest.cs @@ -6,12 +6,12 @@ namespace Adyen.Test { [TestClass] - public class ClientTest + public class AdyenClientTest { [TestMethod] public void HttpClientFirstCallReturnsDefaultHttpClient() { - var client = new Client(new Config()); + var client = new AdyenClient(new Config()); var httpClient = client.HttpClient; Assert.IsNotNull(httpClient); } @@ -19,7 +19,7 @@ public void HttpClientFirstCallReturnsDefaultHttpClient() [TestMethod] public void TestSetEnvironment() { - var client = new Client(new Config()); + var client = new AdyenClient(new Config()); client.SetEnvironment(Environment.Live, "testPrefix.adyen.com"); Assert.AreEqual(Environment.Live, client.Config.Environment); @@ -32,14 +32,14 @@ public void TestSetEnvironment() Assert.AreEqual("https://terminal-api-test.adyen.com", client.Config.CloudApiEndPoint); } - Client testClient; + AdyenClient _testAdyenClient; String logLine; [TestInitialize] public void TestSetup() { - testClient = new Client(new Config()); - testClient.LogCallback += new Client.CallbackLogHandler((message) => { + _testAdyenClient = new AdyenClient(new Config()); + _testAdyenClient.LogCallback += new AdyenClient.CallbackLogHandler((message) => { logLine = message; }); @@ -47,7 +47,7 @@ public void TestSetup() [TestMethod] public void TestLogLine() { - testClient.LogLine("testMessage"); + _testAdyenClient.LogLine("testMessage"); Assert.AreEqual("testMessage", logLine); } @@ -63,7 +63,7 @@ public void When_Region_Specified_Returns_TerminalApi_LiveEndpointUrl(Environmen Environment = environment, TerminalApiRegion = region }; - var client = new Client(config); + var client = new AdyenClient(config); Assert.AreEqual(expectedEndpoint, client.Config.CloudApiEndPoint); } @@ -75,7 +75,7 @@ public void When_Region_Is_India_And_Environment_Is_Live_Throws_ArgumentOutOfRan Environment = Environment.Live, TerminalApiRegion = Region.IN }; - Assert.ThrowsException(() => new Client(config)); + Assert.ThrowsException(() => new AdyenClient(config)); } [DataTestMethod] @@ -91,7 +91,7 @@ public void Client_Should_Always_Return_TerminalApi_TestEndpointUrl(Environment Environment = environment, TerminalApiRegion = region }; - var client = new Client(config); + var client = new AdyenClient(config); Assert.AreEqual(expectedEndpoint, client.Config.CloudApiEndPoint); } @@ -114,26 +114,26 @@ public void When_Custom_CloudApiEndpoint_Is_Specified_And_Environment_Is_Test_Or TerminalApiRegion = region, CloudApiEndPoint = "https://localhost:443/nexo" }; - var client = new Client(config); + var client = new AdyenClient(config); Assert.AreEqual("https://localhost:443/nexo", client.Config.CloudApiEndPoint); } [TestMethod] public void TestSetTerminalApiRegion() { - var clientAU = new Client(new Config + var clientAU = new AdyenClient(new Config {Environment = Environment.Live, TerminalApiRegion = Region.AU}); Assert.AreEqual(clientAU.GetCloudApiEndpoint(), ClientConfig.CloudApiEndPointAULive); - var clientEU = new Client(new Config + var clientEU = new AdyenClient(new Config {Environment = Environment.Live, TerminalApiRegion = Region.EU}); Assert.AreEqual(clientEU.GetCloudApiEndpoint(), ClientConfig.CloudApiEndPointEULive); - var clientUS = new Client(new Config + var clientUS = new AdyenClient(new Config {Environment = Environment.Live, TerminalApiRegion = Region.US}); Assert.AreEqual(clientUS.GetCloudApiEndpoint(), ClientConfig.CloudApiEndPointUSLive); - var clientAPSE = new Client(new Config + var clientAPSE = new AdyenClient(new Config {Environment = Environment.Live, TerminalApiRegion = Region.APSE}); Assert.AreEqual(clientAPSE.GetCloudApiEndpoint(), ClientConfig.CloudApiEndPointAPSELive); - var clientDefault = new Client(new Config {Environment = Environment.Live}); + var clientDefault = new AdyenClient(new Config {Environment = Environment.Live}); Assert.AreEqual(clientDefault.GetCloudApiEndpoint(), ClientConfig.CloudApiEndPointEULive); } } diff --git a/Adyen.Test/BaseTest.cs b/Adyen.Test/BaseTest.cs index f9e195846..1348022aa 100644 --- a/Adyen.Test/BaseTest.cs +++ b/Adyen.Test/BaseTest.cs @@ -199,7 +199,7 @@ protected Amount.PaymentMethodsRequest CreatePaymentMethodRequest(string merchan /// Creates mock test client without any response /// /// IClient implementation - protected Client CreateMockForAdyenClientTest(Config config) + protected AdyenClient CreateMockForAdyenClientTest(Config config) { //Create a mock interface ClientInterfaceSubstitute = Substitute.For(); @@ -208,7 +208,7 @@ protected Client CreateMockForAdyenClientTest(Config config) Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()).Returns(Task.FromResult("")); - var clientMock = new Client(config) + var clientMock = new AdyenClient(config) { HttpClient = ClientInterfaceSubstitute, Config = config @@ -221,7 +221,7 @@ protected Client CreateMockForAdyenClientTest(Config config) /// /// The file that is returned /// IClient implementation - protected Client CreateMockTestClientRequest(string fileName) + protected AdyenClient CreateMockTestClientRequest(string fileName) { var mockPath = GetMockFilePath(fileName); var response = MockFileToString(mockPath); @@ -236,7 +236,7 @@ protected Client CreateMockTestClientRequest(string fileName) { Environment = Model.Environment.Test }; - var clientMock = new Client(config) + var clientMock = new AdyenClient(config) { HttpClient = ClientInterfaceSubstitute, Config = new Config @@ -254,7 +254,7 @@ protected Client CreateMockTestClientRequest(string fileName) /// /// The file that is returned /// IClient implementation - protected Client CreateMockTestClientApiKeyBasedRequestAsync(string fileName) + protected AdyenClient CreateMockTestClientApiKeyBasedRequestAsync(string fileName) { var mockPath = GetMockFilePath(fileName); var response = MockFileToString(mockPath); @@ -268,7 +268,7 @@ protected Client CreateMockTestClientApiKeyBasedRequestAsync(string fileName) { Environment = Model.Environment.Test }; - var clientMock = new Client(config) + var clientMock = new AdyenClient(config) { HttpClient = ClientInterfaceSubstitute, Config = new Config @@ -286,7 +286,7 @@ protected Client CreateMockTestClientApiKeyBasedRequestAsync(string fileName) /// /// The file that is returned /// IClient implementation - protected Client CreateAsyncMockTestClientApiKeyBasedRequest(string fileName) + protected AdyenClient CreateAsyncMockTestClientApiKeyBasedRequest(string fileName) { var mockPath = GetMockFilePath(fileName); var response = MockFileToString(mockPath); @@ -307,7 +307,7 @@ protected Client CreateAsyncMockTestClientApiKeyBasedRequest(string fileName) { Environment = Model.Environment.Test }; - var clientMock = new Client(config) + var clientMock = new AdyenClient(config) { HttpClient = ClientInterfaceSubstitute, Config = configWithApiKey @@ -320,7 +320,7 @@ protected Client CreateAsyncMockTestClientApiKeyBasedRequest(string fileName) /// /// The file that is returned /// IClient implementation - protected Client CreateMockTestClientPosCloudApiRequest(string fileName) + protected AdyenClient CreateMockTestClientPosCloudApiRequest(string fileName) { var config = new Config { CloudApiEndPoint = ClientConfig.CloudApiEndPointTest }; var mockPath = GetMockFilePath(fileName); @@ -339,7 +339,7 @@ protected Client CreateMockTestClientPosCloudApiRequest(string fileName) { Environment = Model.Environment.Test }; - var clientMock = new Client(anyConfig) + var clientMock = new AdyenClient(anyConfig) { HttpClient = ClientInterfaceSubstitute, Config = config @@ -352,7 +352,7 @@ protected Client CreateMockTestClientPosCloudApiRequest(string fileName) /// /// The file that is returned /// IClient implementation - protected Client CreateMockTestClientPosLocalApiRequest(string fileName) + protected AdyenClient CreateMockTestClientPosLocalApiRequest(string fileName) { var config = new Config { @@ -375,7 +375,7 @@ protected Client CreateMockTestClientPosLocalApiRequest(string fileName) { Environment = Model.Environment.Test }; - var clientMock = new Client(anyConfig) + var clientMock = new AdyenClient(anyConfig) { HttpClient = ClientInterfaceSubstitute, Config = config diff --git a/Adyen.Test/CheckoutTest.cs b/Adyen.Test/CheckoutTest.cs index ccdb78961..7a2be36af 100644 --- a/Adyen.Test/CheckoutTest.cs +++ b/Adyen.Test/CheckoutTest.cs @@ -60,7 +60,7 @@ public void CheckoutEndpointLiveEnvironmentSuccessTest() public void CheckoutEndpointLiveErrorTest() { var config = new Config(); - var client = new Client(config); + var client = new AdyenClient(config); client.SetEnvironment(Environment.Live, null); Assert.ThrowsException(() => new PaymentsService(client)); } @@ -71,7 +71,7 @@ public void CheckoutEndpointLiveErrorTest() [TestMethod] public void CheckoutEndpointLiveWithBasicAuthErrorTest() { - var client = new Client(new Config() + var client = new AdyenClient(new Config() { Username = "ws_*******", Password = "*******", @@ -1045,9 +1045,9 @@ public void CheckoutServiceInterfaceTest() public class MyRecurringService : IRecurringService { private readonly IClient _client; - public MyRecurringService(Client client) + public MyRecurringService(AdyenClient adyenClient) { - _client = client.HttpClient; + _client = adyenClient.HttpClient; } public void DeleteTokenForStoredPaymentDetails(string recurringId, string shopperReference = default, diff --git a/Adyen.Test/ExtensionsTest.cs b/Adyen.Test/ExtensionsTest.cs index defc01802..cf207eac8 100644 --- a/Adyen.Test/ExtensionsTest.cs +++ b/Adyen.Test/ExtensionsTest.cs @@ -14,14 +14,14 @@ namespace Adyen.Test [TestClass] public class ExtensionsTest : BaseTest { - private Client _client; + private AdyenClient _adyenClient; [TestInitialize] public void Init() { - _client = CreateMockTestClientApiKeyBasedRequestAsync(""); - _client.Config.Environment = Environment.Live; - _client.Config.LiveEndpointUrlPrefix = "prefix"; + _adyenClient = CreateMockTestClientApiKeyBasedRequestAsync(""); + _adyenClient.Config.Environment = Environment.Live; + _adyenClient.Config.LiveEndpointUrlPrefix = "prefix"; } [TestMethod] @@ -40,7 +40,7 @@ public void TestDeviceRenderOptionsObjectListToString() [TestMethod] public void TestPalLiveEndPoint() { - var service = new BalanceControlService(_client); + var service = new BalanceControlService(_adyenClient); service.BalanceTransfer(new BalanceTransferRequest()); ClientInterfaceSubstitute.Received().RequestAsync( "https://prefix-pal-live.adyenpayments.com/pal/servlet/BalanceControl/v1/balanceTransfer", @@ -50,7 +50,7 @@ public void TestPalLiveEndPoint() [TestMethod] public void TestCheckoutLiveEndPoint() { - var service = new DonationsService(_client); + var service = new DonationsService(_adyenClient); service.Donations(new DonationPaymentRequest()); ClientInterfaceSubstitute.Received().RequestAsync( "https://prefix-checkout-live.adyenpayments.com/checkout/v71/donations", @@ -60,7 +60,7 @@ public void TestCheckoutLiveEndPoint() [TestMethod] public void TestBclLiveEndPoint() { - var service = new AccountHoldersService(_client); + var service = new AccountHoldersService(_adyenClient); service.GetAllBalanceAccountsOfAccountHolder("id", offset: 3, limit: 5); ClientInterfaceSubstitute.Received().RequestAsync( "https://balanceplatform-api-live.adyen.com/bcl/v2/accountHolders/id/balanceAccounts?offset=3&limit=5", diff --git a/Adyen.Test/ProxyTest.cs b/Adyen.Test/ProxyTest.cs index 47b183ddb..39b5600ef 100644 --- a/Adyen.Test/ProxyTest.cs +++ b/Adyen.Test/ProxyTest.cs @@ -11,7 +11,7 @@ public void CreateClientWithNullProxyConfiguration() { var config = new Config(); config.Proxy = null; - var client = new Client(config); + var client = new AdyenClient(config); Assert.AreEqual(client.Config.Proxy, config.Proxy); } @@ -20,7 +20,7 @@ public void CreateClientWithProxyConfiguration() { var config = new Config(); config.Proxy = new WebProxy(); - var client = new Client(config); + var client = new AdyenClient(config); Assert.AreEqual(client.Config.Proxy, config.Proxy); } } diff --git a/Adyen.Test/ReadmeTest.cs b/Adyen.Test/ReadmeTest.cs index 414c693b9..b9e177d61 100644 --- a/Adyen.Test/ReadmeTest.cs +++ b/Adyen.Test/ReadmeTest.cs @@ -18,7 +18,7 @@ public void PaymentTest() XApiKey = "your-api-key", Environment = Environment.Test }; - var client = new Client(config); + var client = new AdyenClient(config); var paymentsService = new PaymentsService(client); var amount = new Model.Checkout.Amount("USD", 1000); var cardDetails = new CardDetails diff --git a/Adyen.Test/RecurringTest.cs b/Adyen.Test/RecurringTest.cs index 101fc6fa2..9d5899529 100644 --- a/Adyen.Test/RecurringTest.cs +++ b/Adyen.Test/RecurringTest.cs @@ -60,8 +60,8 @@ public async Task TestDisableAsync() [TestMethod] public void NotifyShopperTest() { - Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/notifyShopper-success.json"); - var recurring = new Service.RecurringService(client); + AdyenClient adyenClient = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/notifyShopper-success.json"); + var recurring = new Service.RecurringService(adyenClient); NotifyShopperRequest request = CreateNotifyShopperRequest(); NotifyShopperResult result = recurring.NotifyShopper(request); Assert.IsNotNull(result); @@ -76,8 +76,8 @@ public void NotifyShopperTest() [TestMethod] public void CreatePermitTest() { - Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/createPermit-success.json"); - var recurring = new Service.RecurringService(client); + AdyenClient adyenClient = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/createPermit-success.json"); + var recurring = new Service.RecurringService(adyenClient); var createPermitResult = recurring.CreatePermit(new CreatePermitRequest()); Assert.IsNotNull(createPermitResult); Assert.AreEqual("string", createPermitResult.PspReference); @@ -87,8 +87,8 @@ public void CreatePermitTest() [TestMethod] public void DisablePermitTest() { - Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/disablePermit-success.json"); - var recurring = new Service.RecurringService(client); + AdyenClient adyenClient = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/disablePermit-success.json"); + var recurring = new Service.RecurringService(adyenClient); var disablePermitResult = recurring.DisablePermit(new DisablePermitRequest()); Assert.IsNotNull(disablePermitResult); Assert.AreEqual("string", disablePermitResult.PspReference); @@ -98,8 +98,8 @@ public void DisablePermitTest() [TestMethod] public void ScheduleAccountUpdaterTest() { - Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/scheduleAccountUpdater-success.json"); - var recurring = new Service.RecurringService(client); + AdyenClient adyenClient = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/scheduleAccountUpdater-success.json"); + var recurring = new Service.RecurringService(adyenClient); var scheduleAccountUpdaterResult = recurring.ScheduleAccountUpdater(new ScheduleAccountUpdaterRequest()); Assert.IsNotNull(scheduleAccountUpdaterResult); Assert.AreEqual("string", scheduleAccountUpdaterResult.PspReference); diff --git a/Adyen.Test/TerminalApiAsyncServiceTest.cs b/Adyen.Test/TerminalApiAsyncServiceTest.cs index 916546171..e7d6f0772 100644 --- a/Adyen.Test/TerminalApiAsyncServiceTest.cs +++ b/Adyen.Test/TerminalApiAsyncServiceTest.cs @@ -22,8 +22,8 @@ public async Task RequestEncryptedAsync_Success() KeyIdentifier = "CryptoKeyIdentifier12345", Password = "p@ssw0rd123456" }; - Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); - ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); + ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); string response = await asyncService.RequestEncryptedAsync(saleToPoiRequest, encryptionCredentialDetails, new CancellationToken()); Assert.AreEqual(response, "ok"); } @@ -39,8 +39,8 @@ public void RequestEncrypted_Success() KeyIdentifier = "CryptoKeyIdentifier12345", Password = "p@ssw0rd123456" }; - Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); - ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); + ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); string response = asyncService.RequestEncrypted(saleToPoiRequest, encryptionCredentialDetails); Assert.AreEqual(response, "ok"); } @@ -49,8 +49,8 @@ public void RequestEncrypted_Success() public async Task RequestAsync_Success() { SaleToPOIRequest saleToPoiRequest = MockPosApiRequest.CreatePosPaymentRequest(); - Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); - ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); + ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); string response = await asyncService.RequestAsync(saleToPoiRequest, new CancellationToken()); Assert.AreEqual(response, "ok"); } @@ -60,8 +60,8 @@ public async Task RequestAsync_Success() public void Request_Success() { SaleToPOIRequest saleToPoiRequest = MockPosApiRequest.CreatePosPaymentRequest(); - Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); - ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); + ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); string response = asyncService.Request(saleToPoiRequest); Assert.AreEqual(response, "ok"); } @@ -78,8 +78,8 @@ public void DecryptNotification_Success() string encryptedNotification = @"{""SaleToPOIRequest"":{""SecurityTrailer"":{""AdyenCryptoVersion"":1,""Nonce"":""Be6rAx+vRju2aCHwPh6lrg=="",""KeyIdentifier"":""ncrkey"",""Hmac"":""LG8A9Re1M8xLMr7rDUk0NwsnvAOX+VLjHv9sPHWTl34="",""KeyVersion"":1},""NexoBlob"":""x2DY8J2M9ZCyjOZ8Gt7JdLBA\/6bT\/KXvvAbJf9kzguqO8dWp1I1pPLQpLstpdIiAVqSwG3PR0PrP\/lF82UmhmCnUJGCuEXilqvBNF1tF\/yEgnFOklNc1myR2IPW\/+2oZOWKFXlTo\/gX89EbODXOOGUqaJfSdpDhlqjyMz7mGczobTPvPGqCVx2BDHU8VTxI9nicwQv+QV48GqVZzxnP8ZOdQOQ5cac+bcS0Y3l7SmWpIoQsoicnjahTY9ICosLJmN4DvDHsN4Kh2DAetFO5b9I9Lqgm\/dvnXUVhb9tPbM7Pn+ratjYpaNbonbO5M+Tm8rDEIyKoUUuFXPWISymrCXtCDVKEb2B5S5pilUmokrXVa9Ldtsv3BKG7rbrglYEuql4WVs6kzr6ybgAKh1Q0LsAXEve3pydt72ay4U3FOJSBxJ3gNqmnG8mVW2HCXQVo1RgVaZmP5TBWYuksCKXYypnMulu1PlRI++oeW\/J2qjQU="",""MessageHeader"":{""ProtocolVersion"":""3.0"",""SaleID"":""null"",""MessageClass"":""Event"",""MessageCategory"":""Event"",""POIID"":""P400Plus-275102806"",""MessageType"":""Notification"",""DeviceID"":""5""}}}"; string expectedDecryption = @"{ ""SaleToPOIRequest"": { ""EventNotification"": { ""EventDetails"": ""reference_id=9876"", ""TimeStamp"": ""2020-11-13T09:02:35.697Z"", ""EventToNotify"": ""SaleWakeUp"" }, ""MessageHeader"": { ""ProtocolVersion"": ""3.0"", ""SaleID"": ""null"", ""MessageClass"": ""Event"", ""MessageCategory"": ""Event"", ""POIID"": ""P400Plus-275102806"", ""MessageType"": ""Notification"", ""DeviceID"": ""5"" } } }"; - Client client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); - ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + AdyenClient adyenClient = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); + ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); string decryptedNotification = asyncService.DecryptNotification(encryptedNotification, encryptionCredentialDetails); Assert.AreEqual(decryptedNotification, expectedDecryption); } diff --git a/Adyen.Test/TerminalApiLocalServiceTest.cs b/Adyen.Test/TerminalApiLocalServiceTest.cs index ad119cf44..ff3ae3f6b 100644 --- a/Adyen.Test/TerminalApiLocalServiceTest.cs +++ b/Adyen.Test/TerminalApiLocalServiceTest.cs @@ -24,8 +24,8 @@ public async Task RequestEncryptedAsync_Success() KeyIdentifier = "CryptoKeyIdentifier12345", Password = "p@ssw0rd123456" }; - Client client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); - ITerminalApiLocalService localService = new TerminalApiLocalService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + AdyenClient adyenClient = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); + ITerminalApiLocalService localService = new TerminalApiLocalService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = await localService.RequestEncryptedAsync(saleToPoiRequest, encryptionCredentialDetails, new CancellationToken()); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); @@ -42,8 +42,8 @@ public void RequestEncrypted_Success() KeyIdentifier = "CryptoKeyIdentifier12345", Password = "p@ssw0rd123456" }; - Client client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); - ITerminalApiLocalService localService = new TerminalApiLocalService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + AdyenClient adyenClient = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); + ITerminalApiLocalService localService = new TerminalApiLocalService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = localService.RequestEncrypted(saleToPoiRequest, encryptionCredentialDetails); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); @@ -53,8 +53,8 @@ public void RequestEncrypted_Success() public async Task RequestAsync_Success() { SaleToPOIRequest saleToPoiRequest = MockPosApiRequest.CreatePosPaymentRequest(); - Client client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-success.json"); - ITerminalApiLocalService localService = new TerminalApiLocalService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + AdyenClient adyenClient = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-success.json"); + ITerminalApiLocalService localService = new TerminalApiLocalService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = await localService.RequestAsync(saleToPoiRequest, new CancellationToken()); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); @@ -64,8 +64,8 @@ public async Task RequestAsync_Success() public void Request_Success() { SaleToPOIRequest saleToPoiRequest = MockPosApiRequest.CreatePosPaymentRequest(); - Client client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-success.json"); - ITerminalApiLocalService localService = new TerminalApiLocalService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + AdyenClient adyenClient = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-success.json"); + ITerminalApiLocalService localService = new TerminalApiLocalService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = localService.Request(saleToPoiRequest); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); diff --git a/Adyen.Test/TerminalApiPosRequestTest.cs b/Adyen.Test/TerminalApiPosRequestTest.cs index ecab163ca..651f24a08 100644 --- a/Adyen.Test/TerminalApiPosRequestTest.cs +++ b/Adyen.Test/TerminalApiPosRequestTest.cs @@ -32,7 +32,7 @@ public void TestTerminalApiRequest() //create a mock client var client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); var terminalLocalApi = new TerminalLocalApi(client); - var configEndpoint = terminalLocalApi.Client.Config.LocalTerminalApiEndpoint; + var configEndpoint = terminalLocalApi.AdyenClient.Config.LocalTerminalApiEndpoint; var saleToPoiResponse = terminalLocalApi.TerminalRequest(paymentRequest, _encryptionCredentialDetails); Assert.AreEqual(configEndpoint, @"https://_terminal_:8443/nexo/"); Assert.IsNotNull(saleToPoiResponse); @@ -53,7 +53,7 @@ public void TestTerminalApiAsyncRequest() //create a mock client var client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); var terminalLocalApi = new TerminalLocalApi(client); - var configEndpoint = terminalLocalApi.Client.Config.LocalTerminalApiEndpoint; + var configEndpoint = terminalLocalApi.AdyenClient.Config.LocalTerminalApiEndpoint; var saleToPoiResponse = terminalLocalApi.TerminalRequestAsync(paymentRequest, _encryptionCredentialDetails); Assert.AreEqual(configEndpoint, @"https://_terminal_:8443/nexo/"); Assert.IsNotNull(saleToPoiResponse); @@ -92,7 +92,7 @@ public void TestTerminalApiRequestEmptySecurityTrailer() //create a mock client var client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-no-security-trailer.json"); var terminalLocalApi = new TerminalLocalApi(client); - var configEndpoint = terminalLocalApi.Client.Config.LocalTerminalApiEndpoint; + var configEndpoint = terminalLocalApi.AdyenClient.Config.LocalTerminalApiEndpoint; var saleToPoiResponse = terminalLocalApi.TerminalRequest(paymentRequest, _encryptionCredentialDetails); Assert.AreEqual(configEndpoint, @"https://_terminal_:8443/nexo/"); } diff --git a/Adyen.Test/TerminalApiSyncServiceTest.cs b/Adyen.Test/TerminalApiSyncServiceTest.cs index e154c4e78..dd34ac428 100644 --- a/Adyen.Test/TerminalApiSyncServiceTest.cs +++ b/Adyen.Test/TerminalApiSyncServiceTest.cs @@ -23,8 +23,8 @@ public async Task RequestEncryptedAsync_Success() KeyIdentifier = "CryptoKeyIdentifier12345", Password = "p@ssw0rd123456" }; - Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); - ITerminalApiSyncService syncService = new TerminalApiSyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); + ITerminalApiSyncService syncService = new TerminalApiSyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = await syncService.RequestEncryptedAsync(saleToPoiRequest, encryptionCredentialDetails, new CancellationToken()); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); @@ -41,8 +41,8 @@ public void RequestEncrypted_Success() KeyIdentifier = "CryptoKeyIdentifier12345", Password = "p@ssw0rd123456" }; - Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); - ITerminalApiSyncService syncService = new TerminalApiSyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); + ITerminalApiSyncService syncService = new TerminalApiSyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = syncService.RequestEncrypted(saleToPoiRequest, encryptionCredentialDetails); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); @@ -52,8 +52,8 @@ public void RequestEncrypted_Success() public async Task RequestAsync_Success() { SaleToPOIRequest saleToPoiRequest = MockPosApiRequest.CreatePosPaymentRequest(); - Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-success.json"); - ITerminalApiSyncService syncService = new TerminalApiSyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-success.json"); + ITerminalApiSyncService syncService = new TerminalApiSyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = await syncService.RequestAsync(saleToPoiRequest, new CancellationToken()); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); @@ -63,8 +63,8 @@ public async Task RequestAsync_Success() public void Request_Success() { SaleToPOIRequest saleToPoiRequest = MockPosApiRequest.CreatePosPaymentRequest(); - Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-success.json"); - ITerminalApiSyncService syncService = new TerminalApiSyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-success.json"); + ITerminalApiSyncService syncService = new TerminalApiSyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = syncService.Request(saleToPoiRequest); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); diff --git a/Adyen/Client.cs b/Adyen/AdyenClient.cs similarity index 90% rename from Adyen/Client.cs rename to Adyen/AdyenClient.cs index 60a202ad9..dc6016bdb 100644 --- a/Adyen/Client.cs +++ b/Adyen/AdyenClient.cs @@ -1,137 +1,137 @@ -using System; -using System.Net.Http; -using Adyen.Constants; -using Adyen.HttpClient; -using Adyen.HttpClient.Interfaces; -using Environment = Adyen.Model.Environment; - -namespace Adyen -{ - public class Client - { - public Config Config { get; set; } - - public string ApplicationName { get; set; } - - public delegate void CallbackLogHandler(string message); - - public event CallbackLogHandler LogCallback; - private static System.Net.Http.HttpClient _httpClient; - - [Obsolete("Providing username and password are obsolete, please use Config instead.")] - public Client(string username, string password, Environment environment, string liveEndpointUrlPrefix = null) - { - Config = new Config - { - Username = username, - Password = password, - Environment = environment - }; - SetEnvironment(environment, liveEndpointUrlPrefix, Config.TerminalApiRegion, Config.CloudApiEndPoint); - - HttpClient = new HttpClientWrapper(Config, GetHttpClient()); - } - - [Obsolete("Providing x-api-key is obsolete, please use Config instead.")] - public Client(string xapikey, Environment environment, string liveEndpointUrlPrefix = null) - { - Config = new Config - { - XApiKey = xapikey, - Environment = environment, - LiveEndpointUrlPrefix = liveEndpointUrlPrefix - }; - SetEnvironment(environment, Config.LiveEndpointUrlPrefix, Config.TerminalApiRegion, Config.CloudApiEndPoint); - HttpClient = new HttpClientWrapper(Config, GetHttpClient()); - } - - public Client(Config config) - { - Config = config; - SetEnvironment(config.Environment, config.LiveEndpointUrlPrefix, config.TerminalApiRegion, config.CloudApiEndPoint); - HttpClient = new HttpClientWrapper(config, GetHttpClient()); - } - - public Client(Config config, System.Net.Http.HttpClient httpClient) - { - Config = config; - SetEnvironment(config.Environment, config.LiveEndpointUrlPrefix, config.TerminalApiRegion, config.CloudApiEndPoint); - HttpClient = new HttpClientWrapper(config, httpClient); - } - - public Client(Config config, IHttpClientFactory factory, string clientName = null) - { - Config = config; - SetEnvironment(config.Environment, config.LiveEndpointUrlPrefix, config.TerminalApiRegion, config.CloudApiEndPoint); - HttpClient = clientName != null ? new HttpClientWrapper(config, factory.CreateClient(clientName)) : new HttpClientWrapper(Config, factory.CreateClient()); - } - - /// - /// Configures the environment. - /// - /// Specifies whether the is Test or Live. - /// The prefix for live endpoint URLs. Required for live configurations, see: https://docs.adyen.com/development-resources/live-endpoints". - /// Specifies the geographical region for the Terminal API integration, the passed is used to automatically determine this endpoint URL, see: https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/#live-endpoints. - /// Specifies the cloud endpoint for the Terminal API integration. This URL is where your SaleToPOIMessage(s) are sent. You can override this value for (mock) testing purposes. - public void SetEnvironment(Environment environment, string liveEndpointUrlPrefix = "", Region region = Region.EU, string cloudApiEndpoint = null) - { - Config.Environment = environment; - Config.LiveEndpointUrlPrefix = liveEndpointUrlPrefix; - Config.TerminalApiRegion = region; - Config.CloudApiEndPoint = cloudApiEndpoint; - Config.CloudApiEndPoint = GetCloudApiEndpoint(); - } - - /// - /// Retrieves the current terminal-api endpoint URL for sending the SaleToPoiMessage(s). - /// - /// The full terminal-api endpoint URL for the Cloud Terminal API integration. - /// Thrown if the specified is not part of . - public string GetCloudApiEndpoint() - { - // Check if the cloud API endpoint has already been set - if (Config.CloudApiEndPoint != null) - { - return Config.CloudApiEndPoint; - } - - // For LIVE environment, handle region mapping - if (Config.Environment == Environment.Live) - { - if (!RegionMapping.TERMINAL_API_ENDPOINTS_MAPPING.TryGetValue(Config.TerminalApiRegion, out string endpointUrl)) - { - throw new ArgumentOutOfRangeException($"Currently not supported: {Config.TerminalApiRegion}"); - } - return endpointUrl; - } - - // Default to test endpoint if the environment is TEST (default). - return ClientConfig.CloudApiEndPointTest; - } - - // Get a new HttpClient and set a timeout - private System.Net.Http.HttpClient GetHttpClient() - { - if (_httpClient == null) - { - _httpClient = new System.Net.Http.HttpClient(HttpClientExtensions.ConfigureHttpMessageHandler(Config)) - { - Timeout = TimeSpan.FromMilliseconds(Config.Timeout) - }; - } - return _httpClient; - } - - public IClient HttpClient { get; set; } - - public string LibraryVersion => ClientConfig.LibVersion; - - public void LogLine(string message) - { - if (LogCallback != null) - { - LogCallback(message); - } - } - } -} +using System; +using System.Net.Http; +using Adyen.Constants; +using Adyen.HttpClient; +using Adyen.HttpClient.Interfaces; +using Environment = Adyen.Model.Environment; + +namespace Adyen +{ + public class AdyenClient + { + public Config Config { get; set; } + + public string ApplicationName { get; set; } + + public delegate void CallbackLogHandler(string message); + + public event CallbackLogHandler LogCallback; + private static System.Net.Http.HttpClient _httpClient; + + [Obsolete("Providing username and password are obsolete, please use Config instead.")] + public AdyenClient(string username, string password, Environment environment, string liveEndpointUrlPrefix = null) + { + Config = new Config + { + Username = username, + Password = password, + Environment = environment + }; + SetEnvironment(environment, liveEndpointUrlPrefix, Config.TerminalApiRegion, Config.CloudApiEndPoint); + + HttpClient = new HttpClientWrapper(Config, GetHttpClient()); + } + + [Obsolete("Providing x-api-key is obsolete, please use Config instead.")] + public AdyenClient(string xapikey, Environment environment, string liveEndpointUrlPrefix = null) + { + Config = new Config + { + XApiKey = xapikey, + Environment = environment, + LiveEndpointUrlPrefix = liveEndpointUrlPrefix + }; + SetEnvironment(environment, Config.LiveEndpointUrlPrefix, Config.TerminalApiRegion, Config.CloudApiEndPoint); + HttpClient = new HttpClientWrapper(Config, GetHttpClient()); + } + + public AdyenClient(Config config) + { + Config = config; + SetEnvironment(config.Environment, config.LiveEndpointUrlPrefix, config.TerminalApiRegion, config.CloudApiEndPoint); + HttpClient = new HttpClientWrapper(config, GetHttpClient()); + } + + public AdyenClient(Config config, System.Net.Http.HttpClient httpClient) + { + Config = config; + SetEnvironment(config.Environment, config.LiveEndpointUrlPrefix, config.TerminalApiRegion, config.CloudApiEndPoint); + HttpClient = new HttpClientWrapper(config, httpClient); + } + + public AdyenClient(Config config, IHttpClientFactory factory, string clientName = null) + { + Config = config; + SetEnvironment(config.Environment, config.LiveEndpointUrlPrefix, config.TerminalApiRegion, config.CloudApiEndPoint); + HttpClient = clientName != null ? new HttpClientWrapper(config, factory.CreateClient(clientName)) : new HttpClientWrapper(Config, factory.CreateClient()); + } + + /// + /// Configures the environment. + /// + /// Specifies whether the is Test or Live. + /// The prefix for live endpoint URLs. Required for live configurations, see: https://docs.adyen.com/development-resources/live-endpoints". + /// Specifies the geographical region for the Terminal API integration, the passed is used to automatically determine this endpoint URL, see: https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/#live-endpoints. + /// Specifies the cloud endpoint for the Terminal API integration. This URL is where your SaleToPOIMessage(s) are sent. You can override this value for (mock) testing purposes. + public void SetEnvironment(Environment environment, string liveEndpointUrlPrefix = "", Region region = Region.EU, string cloudApiEndpoint = null) + { + Config.Environment = environment; + Config.LiveEndpointUrlPrefix = liveEndpointUrlPrefix; + Config.TerminalApiRegion = region; + Config.CloudApiEndPoint = cloudApiEndpoint; + Config.CloudApiEndPoint = GetCloudApiEndpoint(); + } + + /// + /// Retrieves the current terminal-api endpoint URL for sending the SaleToPoiMessage(s). + /// + /// The full terminal-api endpoint URL for the Cloud Terminal API integration. + /// Thrown if the specified is not part of . + public string GetCloudApiEndpoint() + { + // Check if the cloud API endpoint has already been set + if (Config.CloudApiEndPoint != null) + { + return Config.CloudApiEndPoint; + } + + // For LIVE environment, handle region mapping + if (Config.Environment == Environment.Live) + { + if (!RegionMapping.TERMINAL_API_ENDPOINTS_MAPPING.TryGetValue(Config.TerminalApiRegion, out string endpointUrl)) + { + throw new ArgumentOutOfRangeException($"Currently not supported: {Config.TerminalApiRegion}"); + } + return endpointUrl; + } + + // Default to test endpoint if the environment is TEST (default). + return ClientConfig.CloudApiEndPointTest; + } + + // Get a new HttpClient and set a timeout + private System.Net.Http.HttpClient GetHttpClient() + { + if (_httpClient == null) + { + _httpClient = new System.Net.Http.HttpClient(HttpClientExtensions.ConfigureHttpMessageHandler(Config)) + { + Timeout = TimeSpan.FromMilliseconds(Config.Timeout) + }; + } + return _httpClient; + } + + public IClient HttpClient { get; set; } + + public string LibraryVersion => ClientConfig.LibVersion; + + public void LogLine(string message) + { + if (LogCallback != null) + { + LogCallback(message); + } + } + } +} diff --git a/Adyen/Config.cs b/Adyen/Config.cs index 0f6ce4cf1..25a1f4ba9 100644 --- a/Adyen/Config.cs +++ b/Adyen/Config.cs @@ -31,7 +31,7 @@ public class Config /// /// Only The amount of time it should take to establish the TCP Connection. - /// This value is only used in when no default was passed in the constructor. + /// This value is only used in when no default was passed in the constructor. /// In > NET6.0, we recommend configuring your own and pass it in the constructor. /// The values shown here are defaults, if no is provided. /// @@ -40,7 +40,7 @@ public class Config /// /// Force reconnection to refresh DNS and avoid stale connections. /// Once a connection exceeds the specified lifetime, it is no longer considered reusable and it is closed and removed from the pool. - /// This value is only used in when no default was passed in the constructor. + /// This value is only used in when no default was passed in the constructor. /// In > NET6.0, we recommend configuring your own and pass it in the constructor. /// The values shown here are defaults, if no is provided. /// @@ -48,7 +48,7 @@ public class Config /// /// Close idle connections after the specified time. - /// This value is only used in when no default was passed in the constructor. + /// This value is only used in when no default was passed in the constructor. /// In > NET6.0, we recommend configuring your own and pass it in the constructor. /// The values shown here are defaults, if no is provided. /// @@ -56,7 +56,7 @@ public class Config /// /// Maximum number of concurrent TCP connections per server. - /// This value is only used in when no default was passed in the constructor. + /// This value is only used in when no default was passed in the constructor. /// In > NET6.0, we recommend configuring your own and pass it in the constructor. /// The values shown here are defaults, if no is provided. /// @@ -64,7 +64,7 @@ public class Config /// /// The url of the Cloud Terminal Api endpoint. - /// This value is populated when specifying the in . + /// This value is populated when specifying the in . /// public string CloudApiEndPoint { get; set; } diff --git a/Adyen/Service/AbstractService.cs b/Adyen/Service/AbstractService.cs index 517317c16..3a89e446a 100644 --- a/Adyen/Service/AbstractService.cs +++ b/Adyen/Service/AbstractService.cs @@ -9,14 +9,14 @@ namespace Adyen.Service { public class AbstractService { - public Client Client { get; set; } + public AdyenClient AdyenClient { get; set; } private const string PaymentPrefix = "pal-"; private const string CheckoutPrefix = "checkout-"; - protected AbstractService(Client client) + protected AbstractService(AdyenClient adyenClient) { - Client = client; + AdyenClient = adyenClient; } /// @@ -49,7 +49,7 @@ private protected static string ToQueryString(IDictionary queryP /// baseURL private protected string CreateBaseUrl(string url) { - var config = Client.Config; + var config = AdyenClient.Config; return config.Environment == Environment.Live ? ConstructLiveUrl(config, url) diff --git a/Adyen/Service/BalanceControlService.cs b/Adyen/Service/BalanceControlService.cs index ef1052ff1..d853a6f30 100644 --- a/Adyen/Service/BalanceControlService.cs +++ b/Adyen/Service/BalanceControlService.cs @@ -52,7 +52,7 @@ public class BalanceControlService : AbstractService, IBalanceControlService { private readonly string _baseUrl; - public BalanceControlService(Client client) : base(client) + public BalanceControlService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/BalanceControl/v1"); } diff --git a/Adyen/Service/BalancePlatform/AccountHoldersService.cs b/Adyen/Service/BalancePlatform/AccountHoldersService.cs index 0bb03115c..03719d9ab 100644 --- a/Adyen/Service/BalancePlatform/AccountHoldersService.cs +++ b/Adyen/Service/BalancePlatform/AccountHoldersService.cs @@ -145,7 +145,7 @@ public class AccountHoldersService : AbstractService, IAccountHoldersService { private readonly string _baseUrl; - public AccountHoldersService(Client client) : base(client) + public AccountHoldersService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/BalanceAccountsService.cs b/Adyen/Service/BalancePlatform/BalanceAccountsService.cs index 36438a81d..456d71447 100644 --- a/Adyen/Service/BalancePlatform/BalanceAccountsService.cs +++ b/Adyen/Service/BalancePlatform/BalanceAccountsService.cs @@ -223,7 +223,7 @@ public class BalanceAccountsService : AbstractService, IBalanceAccountsService { private readonly string _baseUrl; - public BalanceAccountsService(Client client) : base(client) + public BalanceAccountsService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/BankAccountValidationService.cs b/Adyen/Service/BalancePlatform/BankAccountValidationService.cs index 0eb5228d1..6557717e1 100644 --- a/Adyen/Service/BalancePlatform/BankAccountValidationService.cs +++ b/Adyen/Service/BalancePlatform/BankAccountValidationService.cs @@ -48,7 +48,7 @@ public class BankAccountValidationService : AbstractService, IBankAccountValidat { private readonly string _baseUrl; - public BankAccountValidationService(Client client) : base(client) + public BankAccountValidationService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/CardOrdersService.cs b/Adyen/Service/BalancePlatform/CardOrdersService.cs index 9db6ccf97..80466fa53 100644 --- a/Adyen/Service/BalancePlatform/CardOrdersService.cs +++ b/Adyen/Service/BalancePlatform/CardOrdersService.cs @@ -91,7 +91,7 @@ public class CardOrdersService : AbstractService, ICardOrdersService { private readonly string _baseUrl; - public CardOrdersService(Client client) : base(client) + public CardOrdersService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/GrantAccountsService.cs b/Adyen/Service/BalancePlatform/GrantAccountsService.cs index 28bbcbc56..d3435a821 100644 --- a/Adyen/Service/BalancePlatform/GrantAccountsService.cs +++ b/Adyen/Service/BalancePlatform/GrantAccountsService.cs @@ -52,7 +52,7 @@ public class GrantAccountsService : AbstractService, IGrantAccountsService { private readonly string _baseUrl; - public GrantAccountsService(Client client) : base(client) + public GrantAccountsService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/GrantOffersService.cs b/Adyen/Service/BalancePlatform/GrantOffersService.cs index 347f55d5d..0e3ab9ef9 100644 --- a/Adyen/Service/BalancePlatform/GrantOffersService.cs +++ b/Adyen/Service/BalancePlatform/GrantOffersService.cs @@ -71,7 +71,7 @@ public class GrantOffersService : AbstractService, IGrantOffersService { private readonly string _baseUrl; - public GrantOffersService(Client client) : base(client) + public GrantOffersService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/ManageCardPINService.cs b/Adyen/Service/BalancePlatform/ManageCardPINService.cs index 01b16f43d..83498c74b 100644 --- a/Adyen/Service/BalancePlatform/ManageCardPINService.cs +++ b/Adyen/Service/BalancePlatform/ManageCardPINService.cs @@ -86,7 +86,7 @@ public class ManageCardPINService : AbstractService, IManageCardPINService { private readonly string _baseUrl; - public ManageCardPINService(Client client) : base(client) + public ManageCardPINService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/ManageSCADevicesService.cs b/Adyen/Service/BalancePlatform/ManageSCADevicesService.cs index be9278d7a..bb889e710 100644 --- a/Adyen/Service/BalancePlatform/ManageSCADevicesService.cs +++ b/Adyen/Service/BalancePlatform/ManageSCADevicesService.cs @@ -145,7 +145,7 @@ public class ManageSCADevicesService : AbstractService, IManageSCADevicesService { private readonly string _baseUrl; - public ManageSCADevicesService(Client client) : base(client) + public ManageSCADevicesService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/NetworkTokensService.cs b/Adyen/Service/BalancePlatform/NetworkTokensService.cs index bc270a550..0fcb925e9 100644 --- a/Adyen/Service/BalancePlatform/NetworkTokensService.cs +++ b/Adyen/Service/BalancePlatform/NetworkTokensService.cs @@ -67,7 +67,7 @@ public class NetworkTokensService : AbstractService, INetworkTokensService { private readonly string _baseUrl; - public NetworkTokensService(Client client) : base(client) + public NetworkTokensService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs b/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs index 9ec50ed2a..a05c3c56d 100644 --- a/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs +++ b/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs @@ -84,7 +84,7 @@ public class PaymentInstrumentGroupsService : AbstractService, IPaymentInstrumen { private readonly string _baseUrl; - public PaymentInstrumentGroupsService(Client client) : base(client) + public PaymentInstrumentGroupsService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs b/Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs index fa5fb9f7c..88c504b29 100644 --- a/Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs +++ b/Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs @@ -154,7 +154,7 @@ public class PaymentInstrumentsService : AbstractService, IPaymentInstrumentsSer { private readonly string _baseUrl; - public PaymentInstrumentsService(Client client) : base(client) + public PaymentInstrumentsService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/PlatformService.cs b/Adyen/Service/BalancePlatform/PlatformService.cs index a1209432d..d76d89684 100644 --- a/Adyen/Service/BalancePlatform/PlatformService.cs +++ b/Adyen/Service/BalancePlatform/PlatformService.cs @@ -88,7 +88,7 @@ public class PlatformService : AbstractService, IPlatformService { private readonly string _baseUrl; - public PlatformService(Client client) : base(client) + public PlatformService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/TransactionRulesService.cs b/Adyen/Service/BalancePlatform/TransactionRulesService.cs index 9e1b02719..6cbb731dd 100644 --- a/Adyen/Service/BalancePlatform/TransactionRulesService.cs +++ b/Adyen/Service/BalancePlatform/TransactionRulesService.cs @@ -103,7 +103,7 @@ public class TransactionRulesService : AbstractService, ITransactionRulesService { private readonly string _baseUrl; - public TransactionRulesService(Client client) : base(client) + public TransactionRulesService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/TransferRoutesService.cs b/Adyen/Service/BalancePlatform/TransferRoutesService.cs index 2f64bb58f..7f4fa3a66 100644 --- a/Adyen/Service/BalancePlatform/TransferRoutesService.cs +++ b/Adyen/Service/BalancePlatform/TransferRoutesService.cs @@ -50,7 +50,7 @@ public class TransferRoutesService : AbstractService, ITransferRoutesService { private readonly string _baseUrl; - public TransferRoutesService(Client client) : base(client) + public TransferRoutesService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BinLookupService.cs b/Adyen/Service/BinLookupService.cs index 2e77f2293..5cf2734ee 100644 --- a/Adyen/Service/BinLookupService.cs +++ b/Adyen/Service/BinLookupService.cs @@ -67,7 +67,7 @@ public class BinLookupService : AbstractService, IBinLookupService { private readonly string _baseUrl; - public BinLookupService(Client client) : base(client) + public BinLookupService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/BinLookup/v54"); } diff --git a/Adyen/Service/Checkout/DonationsService.cs b/Adyen/Service/Checkout/DonationsService.cs index c9e869252..d34883f9c 100644 --- a/Adyen/Service/Checkout/DonationsService.cs +++ b/Adyen/Service/Checkout/DonationsService.cs @@ -67,7 +67,7 @@ public class DonationsService : AbstractService, IDonationsService { private readonly string _baseUrl; - public DonationsService(Client client) : base(client) + public DonationsService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/Checkout/ModificationsService.cs b/Adyen/Service/Checkout/ModificationsService.cs index 6a2c6ac91..8a7e485a7 100644 --- a/Adyen/Service/Checkout/ModificationsService.cs +++ b/Adyen/Service/Checkout/ModificationsService.cs @@ -145,7 +145,7 @@ public class ModificationsService : AbstractService, IModificationsService { private readonly string _baseUrl; - public ModificationsService(Client client) : base(client) + public ModificationsService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/Checkout/OrdersService.cs b/Adyen/Service/Checkout/OrdersService.cs index d034ecd83..d2a8d4115 100644 --- a/Adyen/Service/Checkout/OrdersService.cs +++ b/Adyen/Service/Checkout/OrdersService.cs @@ -84,7 +84,7 @@ public class OrdersService : AbstractService, IOrdersService { private readonly string _baseUrl; - public OrdersService(Client client) : base(client) + public OrdersService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/Checkout/PaymentLinksService.cs b/Adyen/Service/Checkout/PaymentLinksService.cs index bb88e898c..a25aea28b 100644 --- a/Adyen/Service/Checkout/PaymentLinksService.cs +++ b/Adyen/Service/Checkout/PaymentLinksService.cs @@ -86,7 +86,7 @@ public class PaymentLinksService : AbstractService, IPaymentLinksService { private readonly string _baseUrl; - public PaymentLinksService(Client client) : base(client) + public PaymentLinksService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/Checkout/PaymentsService.cs b/Adyen/Service/Checkout/PaymentsService.cs index 363f8c1e5..8e5ff0a00 100644 --- a/Adyen/Service/Checkout/PaymentsService.cs +++ b/Adyen/Service/Checkout/PaymentsService.cs @@ -137,7 +137,7 @@ public class PaymentsService : AbstractService, IPaymentsService { private readonly string _baseUrl; - public PaymentsService(Client client) : base(client) + public PaymentsService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/Checkout/RecurringService.cs b/Adyen/Service/Checkout/RecurringService.cs index 2342ff512..002195611 100644 --- a/Adyen/Service/Checkout/RecurringService.cs +++ b/Adyen/Service/Checkout/RecurringService.cs @@ -88,7 +88,7 @@ public class RecurringService : AbstractService, IRecurringService { private readonly string _baseUrl; - public RecurringService(Client client) : base(client) + public RecurringService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/Checkout/UtilityService.cs b/Adyen/Service/Checkout/UtilityService.cs index c6360aa89..4b2dfec3c 100644 --- a/Adyen/Service/Checkout/UtilityService.cs +++ b/Adyen/Service/Checkout/UtilityService.cs @@ -86,7 +86,7 @@ public class UtilityService : AbstractService, IUtilityService { private readonly string _baseUrl; - public UtilityService(Client client) : base(client) + public UtilityService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/DataProtectionService.cs b/Adyen/Service/DataProtectionService.cs index be6c11ea1..cb488a5c6 100644 --- a/Adyen/Service/DataProtectionService.cs +++ b/Adyen/Service/DataProtectionService.cs @@ -50,7 +50,7 @@ public class DataProtectionService : AbstractService, IDataProtectionService { private readonly string _baseUrl; - public DataProtectionService(Client client) : base(client) + public DataProtectionService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://ca-test.adyen.com/ca/services/DataProtectionService/v1"); } diff --git a/Adyen/Service/DisputesService.cs b/Adyen/Service/DisputesService.cs index 4df6826b4..f8b48ee16 100644 --- a/Adyen/Service/DisputesService.cs +++ b/Adyen/Service/DisputesService.cs @@ -118,7 +118,7 @@ public class DisputesService : AbstractService, IDisputesService { private readonly string _baseUrl; - public DisputesService(Client client) : base(client) + public DisputesService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://ca-test.adyen.com/ca/services/DisputeService/v30"); } diff --git a/Adyen/Service/LegalEntityManagement/BusinessLinesService.cs b/Adyen/Service/LegalEntityManagement/BusinessLinesService.cs index b81bbbab4..be9b8f14a 100644 --- a/Adyen/Service/LegalEntityManagement/BusinessLinesService.cs +++ b/Adyen/Service/LegalEntityManagement/BusinessLinesService.cs @@ -101,7 +101,7 @@ public class BusinessLinesService : AbstractService, IBusinessLinesService { private readonly string _baseUrl; - public BusinessLinesService(Client client) : base(client) + public BusinessLinesService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/DocumentsService.cs b/Adyen/Service/LegalEntityManagement/DocumentsService.cs index 938f74ebc..e9bf605fd 100644 --- a/Adyen/Service/LegalEntityManagement/DocumentsService.cs +++ b/Adyen/Service/LegalEntityManagement/DocumentsService.cs @@ -103,7 +103,7 @@ public class DocumentsService : AbstractService, IDocumentsService { private readonly string _baseUrl; - public DocumentsService(Client client) : base(client) + public DocumentsService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs b/Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs index 447f2e34d..20e378143 100644 --- a/Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs +++ b/Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs @@ -84,7 +84,7 @@ public class HostedOnboardingService : AbstractService, IHostedOnboardingService { private readonly string _baseUrl; - public HostedOnboardingService(Client client) : base(client) + public HostedOnboardingService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs b/Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs index ea6ee0e56..e2a60993c 100644 --- a/Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs +++ b/Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs @@ -137,7 +137,7 @@ public class LegalEntitiesService : AbstractService, ILegalEntitiesService { private readonly string _baseUrl; - public LegalEntitiesService(Client client) : base(client) + public LegalEntitiesService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs b/Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs index dc818a201..d1816bc70 100644 --- a/Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs +++ b/Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs @@ -126,7 +126,7 @@ public class PCIQuestionnairesService : AbstractService, IPCIQuestionnairesServi { private readonly string _baseUrl; - public PCIQuestionnairesService(Client client) : base(client) + public PCIQuestionnairesService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs b/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs index 0a58b369c..61fa8c407 100644 --- a/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs +++ b/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs @@ -67,7 +67,7 @@ public class TaxEDeliveryConsentService : AbstractService, ITaxEDeliveryConsentS { private readonly string _baseUrl; - public TaxEDeliveryConsentService(Client client) : base(client) + public TaxEDeliveryConsentService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs b/Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs index 0f4677a9a..03b83de5e 100644 --- a/Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs +++ b/Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs @@ -128,7 +128,7 @@ public class TermsOfServiceService : AbstractService, ITermsOfServiceService { private readonly string _baseUrl; - public TermsOfServiceService(Client client) : base(client) + public TermsOfServiceService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs b/Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs index 7c09f1900..6f99079e9 100644 --- a/Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs +++ b/Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs @@ -101,7 +101,7 @@ public class TransferInstrumentsService : AbstractService, ITransferInstrumentsS { private readonly string _baseUrl; - public TransferInstrumentsService(Client client) : base(client) + public TransferInstrumentsService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/Management/APICredentialsCompanyLevelService.cs b/Adyen/Service/Management/APICredentialsCompanyLevelService.cs index 55e6938d6..e13581cc2 100644 --- a/Adyen/Service/Management/APICredentialsCompanyLevelService.cs +++ b/Adyen/Service/Management/APICredentialsCompanyLevelService.cs @@ -113,7 +113,7 @@ public class APICredentialsCompanyLevelService : AbstractService, IAPICredential { private readonly string _baseUrl; - public APICredentialsCompanyLevelService(Client client) : base(client) + public APICredentialsCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/APICredentialsMerchantLevelService.cs b/Adyen/Service/Management/APICredentialsMerchantLevelService.cs index 70c1f663b..d562253c1 100644 --- a/Adyen/Service/Management/APICredentialsMerchantLevelService.cs +++ b/Adyen/Service/Management/APICredentialsMerchantLevelService.cs @@ -113,7 +113,7 @@ public class APICredentialsMerchantLevelService : AbstractService, IAPICredentia { private readonly string _baseUrl; - public APICredentialsMerchantLevelService(Client client) : base(client) + public APICredentialsMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/APIKeyCompanyLevelService.cs b/Adyen/Service/Management/APIKeyCompanyLevelService.cs index edef15239..aea3e12ee 100644 --- a/Adyen/Service/Management/APIKeyCompanyLevelService.cs +++ b/Adyen/Service/Management/APIKeyCompanyLevelService.cs @@ -52,7 +52,7 @@ public class APIKeyCompanyLevelService : AbstractService, IAPIKeyCompanyLevelSer { private readonly string _baseUrl; - public APIKeyCompanyLevelService(Client client) : base(client) + public APIKeyCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/APIKeyMerchantLevelService.cs b/Adyen/Service/Management/APIKeyMerchantLevelService.cs index 0770db10c..9aca1ac7b 100644 --- a/Adyen/Service/Management/APIKeyMerchantLevelService.cs +++ b/Adyen/Service/Management/APIKeyMerchantLevelService.cs @@ -52,7 +52,7 @@ public class APIKeyMerchantLevelService : AbstractService, IAPIKeyMerchantLevelS { private readonly string _baseUrl; - public APIKeyMerchantLevelService(Client client) : base(client) + public APIKeyMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/AccountCompanyLevelService.cs b/Adyen/Service/Management/AccountCompanyLevelService.cs index eea8789a0..a5b8e2569 100644 --- a/Adyen/Service/Management/AccountCompanyLevelService.cs +++ b/Adyen/Service/Management/AccountCompanyLevelService.cs @@ -90,7 +90,7 @@ public class AccountCompanyLevelService : AbstractService, IAccountCompanyLevelS { private readonly string _baseUrl; - public AccountCompanyLevelService(Client client) : base(client) + public AccountCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/AccountMerchantLevelService.cs b/Adyen/Service/Management/AccountMerchantLevelService.cs index 700286e5a..d66b56cf3 100644 --- a/Adyen/Service/Management/AccountMerchantLevelService.cs +++ b/Adyen/Service/Management/AccountMerchantLevelService.cs @@ -103,7 +103,7 @@ public class AccountMerchantLevelService : AbstractService, IAccountMerchantLeve { private readonly string _baseUrl; - public AccountMerchantLevelService(Client client) : base(client) + public AccountMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/AccountStoreLevelService.cs b/Adyen/Service/Management/AccountStoreLevelService.cs index 2df2b47d7..7416394c1 100644 --- a/Adyen/Service/Management/AccountStoreLevelService.cs +++ b/Adyen/Service/Management/AccountStoreLevelService.cs @@ -191,7 +191,7 @@ public class AccountStoreLevelService : AbstractService, IAccountStoreLevelServi { private readonly string _baseUrl; - public AccountStoreLevelService(Client client) : base(client) + public AccountStoreLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs b/Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs index c354522d6..e26554fd4 100644 --- a/Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs +++ b/Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs @@ -113,7 +113,7 @@ public class AllowedOriginsCompanyLevelService : AbstractService, IAllowedOrigin { private readonly string _baseUrl; - public AllowedOriginsCompanyLevelService(Client client) : base(client) + public AllowedOriginsCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs b/Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs index f47988715..a5487a5bd 100644 --- a/Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs +++ b/Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs @@ -113,7 +113,7 @@ public class AllowedOriginsMerchantLevelService : AbstractService, IAllowedOrigi { private readonly string _baseUrl; - public AllowedOriginsMerchantLevelService(Client client) : base(client) + public AllowedOriginsMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/AndroidFilesCompanyLevelService.cs b/Adyen/Service/Management/AndroidFilesCompanyLevelService.cs index 55e259b7d..77d3b8393 100644 --- a/Adyen/Service/Management/AndroidFilesCompanyLevelService.cs +++ b/Adyen/Service/Management/AndroidFilesCompanyLevelService.cs @@ -153,7 +153,7 @@ public class AndroidFilesCompanyLevelService : AbstractService, IAndroidFilesCom { private readonly string _baseUrl; - public AndroidFilesCompanyLevelService(Client client) : base(client) + public AndroidFilesCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/ClientKeyCompanyLevelService.cs b/Adyen/Service/Management/ClientKeyCompanyLevelService.cs index 338b7f8d3..33348f3c4 100644 --- a/Adyen/Service/Management/ClientKeyCompanyLevelService.cs +++ b/Adyen/Service/Management/ClientKeyCompanyLevelService.cs @@ -52,7 +52,7 @@ public class ClientKeyCompanyLevelService : AbstractService, IClientKeyCompanyLe { private readonly string _baseUrl; - public ClientKeyCompanyLevelService(Client client) : base(client) + public ClientKeyCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/ClientKeyMerchantLevelService.cs b/Adyen/Service/Management/ClientKeyMerchantLevelService.cs index 5d6adce76..892a88c62 100644 --- a/Adyen/Service/Management/ClientKeyMerchantLevelService.cs +++ b/Adyen/Service/Management/ClientKeyMerchantLevelService.cs @@ -52,7 +52,7 @@ public class ClientKeyMerchantLevelService : AbstractService, IClientKeyMerchant { private readonly string _baseUrl; - public ClientKeyMerchantLevelService(Client client) : base(client) + public ClientKeyMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/MyAPICredentialService.cs b/Adyen/Service/Management/MyAPICredentialService.cs index 208fb6997..4820dd9a0 100644 --- a/Adyen/Service/Management/MyAPICredentialService.cs +++ b/Adyen/Service/Management/MyAPICredentialService.cs @@ -127,7 +127,7 @@ public class MyAPICredentialService : AbstractService, IMyAPICredentialService { private readonly string _baseUrl; - public MyAPICredentialService(Client client) : base(client) + public MyAPICredentialService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs b/Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs index 75d5ef32e..03cd3ffe4 100644 --- a/Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs +++ b/Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs @@ -155,7 +155,7 @@ public class PaymentMethodsMerchantLevelService : AbstractService, IPaymentMetho { private readonly string _baseUrl; - public PaymentMethodsMerchantLevelService(Client client) : base(client) + public PaymentMethodsMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs b/Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs index aaa3a2586..80451754c 100644 --- a/Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs +++ b/Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs @@ -126,7 +126,7 @@ public class PayoutSettingsMerchantLevelService : AbstractService, IPayoutSettin { private readonly string _baseUrl; - public PayoutSettingsMerchantLevelService(Client client) : base(client) + public PayoutSettingsMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs b/Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs index 6b217da75..c6ed64047 100644 --- a/Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs +++ b/Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs @@ -218,7 +218,7 @@ public class SplitConfigurationMerchantLevelService : AbstractService, ISplitCon { private readonly string _baseUrl; - public SplitConfigurationMerchantLevelService(Client client) : base(client) + public SplitConfigurationMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalActionsCompanyLevelService.cs b/Adyen/Service/Management/TerminalActionsCompanyLevelService.cs index 83e9cd364..b4afb6f85 100644 --- a/Adyen/Service/Management/TerminalActionsCompanyLevelService.cs +++ b/Adyen/Service/Management/TerminalActionsCompanyLevelService.cs @@ -77,7 +77,7 @@ public class TerminalActionsCompanyLevelService : AbstractService, ITerminalActi { private readonly string _baseUrl; - public TerminalActionsCompanyLevelService(Client client) : base(client) + public TerminalActionsCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalActionsTerminalLevelService.cs b/Adyen/Service/Management/TerminalActionsTerminalLevelService.cs index b71d84041..18424103e 100644 --- a/Adyen/Service/Management/TerminalActionsTerminalLevelService.cs +++ b/Adyen/Service/Management/TerminalActionsTerminalLevelService.cs @@ -50,7 +50,7 @@ public class TerminalActionsTerminalLevelService : AbstractService, ITerminalAct { private readonly string _baseUrl; - public TerminalActionsTerminalLevelService(Client client) : base(client) + public TerminalActionsTerminalLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs b/Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs index c432551fa..4f6508fc3 100644 --- a/Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs +++ b/Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs @@ -239,7 +239,7 @@ public class TerminalOrdersCompanyLevelService : AbstractService, ITerminalOrder { private readonly string _baseUrl; - public TerminalOrdersCompanyLevelService(Client client) : base(client) + public TerminalOrdersCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs b/Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs index 814550116..87ae8b4c9 100644 --- a/Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs +++ b/Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs @@ -239,7 +239,7 @@ public class TerminalOrdersMerchantLevelService : AbstractService, ITerminalOrde { private readonly string _baseUrl; - public TerminalOrdersMerchantLevelService(Client client) : base(client) + public TerminalOrdersMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs b/Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs index 70215e735..b2b496b90 100644 --- a/Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs +++ b/Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs @@ -109,7 +109,7 @@ public class TerminalSettingsCompanyLevelService : AbstractService, ITerminalSet { private readonly string _baseUrl; - public TerminalSettingsCompanyLevelService(Client client) : base(client) + public TerminalSettingsCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs b/Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs index f03b250b3..783824252 100644 --- a/Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs +++ b/Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs @@ -109,7 +109,7 @@ public class TerminalSettingsMerchantLevelService : AbstractService, ITerminalSe { private readonly string _baseUrl; - public TerminalSettingsMerchantLevelService(Client client) : base(client) + public TerminalSettingsMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalSettingsStoreLevelService.cs b/Adyen/Service/Management/TerminalSettingsStoreLevelService.cs index 8d894ba96..df95ef214 100644 --- a/Adyen/Service/Management/TerminalSettingsStoreLevelService.cs +++ b/Adyen/Service/Management/TerminalSettingsStoreLevelService.cs @@ -193,7 +193,7 @@ public class TerminalSettingsStoreLevelService : AbstractService, ITerminalSetti { private readonly string _baseUrl; - public TerminalSettingsStoreLevelService(Client client) : base(client) + public TerminalSettingsStoreLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs b/Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs index 34f045f70..c46b785bd 100644 --- a/Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs +++ b/Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs @@ -105,7 +105,7 @@ public class TerminalSettingsTerminalLevelService : AbstractService, ITerminalSe { private readonly string _baseUrl; - public TerminalSettingsTerminalLevelService(Client client) : base(client) + public TerminalSettingsTerminalLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalsTerminalLevelService.cs b/Adyen/Service/Management/TerminalsTerminalLevelService.cs index bd7299662..a90133e15 100644 --- a/Adyen/Service/Management/TerminalsTerminalLevelService.cs +++ b/Adyen/Service/Management/TerminalsTerminalLevelService.cs @@ -81,7 +81,7 @@ public class TerminalsTerminalLevelService : AbstractService, ITerminalsTerminal { private readonly string _baseUrl; - public TerminalsTerminalLevelService(Client client) : base(client) + public TerminalsTerminalLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/UsersCompanyLevelService.cs b/Adyen/Service/Management/UsersCompanyLevelService.cs index 1cf5d3828..eb84799f0 100644 --- a/Adyen/Service/Management/UsersCompanyLevelService.cs +++ b/Adyen/Service/Management/UsersCompanyLevelService.cs @@ -115,7 +115,7 @@ public class UsersCompanyLevelService : AbstractService, IUsersCompanyLevelServi { private readonly string _baseUrl; - public UsersCompanyLevelService(Client client) : base(client) + public UsersCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/UsersMerchantLevelService.cs b/Adyen/Service/Management/UsersMerchantLevelService.cs index 31213f25a..d49fb6796 100644 --- a/Adyen/Service/Management/UsersMerchantLevelService.cs +++ b/Adyen/Service/Management/UsersMerchantLevelService.cs @@ -115,7 +115,7 @@ public class UsersMerchantLevelService : AbstractService, IUsersMerchantLevelSer { private readonly string _baseUrl; - public UsersMerchantLevelService(Client client) : base(client) + public UsersMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/WebhooksCompanyLevelService.cs b/Adyen/Service/Management/WebhooksCompanyLevelService.cs index 44907edb7..ae692d704 100644 --- a/Adyen/Service/Management/WebhooksCompanyLevelService.cs +++ b/Adyen/Service/Management/WebhooksCompanyLevelService.cs @@ -170,7 +170,7 @@ public class WebhooksCompanyLevelService : AbstractService, IWebhooksCompanyLeve { private readonly string _baseUrl; - public WebhooksCompanyLevelService(Client client) : base(client) + public WebhooksCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/WebhooksMerchantLevelService.cs b/Adyen/Service/Management/WebhooksMerchantLevelService.cs index cf8867dbf..fdf01caf8 100644 --- a/Adyen/Service/Management/WebhooksMerchantLevelService.cs +++ b/Adyen/Service/Management/WebhooksMerchantLevelService.cs @@ -170,7 +170,7 @@ public class WebhooksMerchantLevelService : AbstractService, IWebhooksMerchantLe { private readonly string _baseUrl; - public WebhooksMerchantLevelService(Client client) : base(client) + public WebhooksMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/PaymentService.cs b/Adyen/Service/PaymentService.cs index e4191c398..5d0f3931a 100644 --- a/Adyen/Service/PaymentService.cs +++ b/Adyen/Service/PaymentService.cs @@ -256,7 +256,7 @@ public class PaymentService : AbstractService, IPaymentService { private readonly string _baseUrl; - public PaymentService(Client client) : base(client) + public PaymentService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/Payment/v68"); } diff --git a/Adyen/Service/PaymentsAppService.cs b/Adyen/Service/PaymentsAppService.cs index 1944da24c..596d8259a 100644 --- a/Adyen/Service/PaymentsAppService.cs +++ b/Adyen/Service/PaymentsAppService.cs @@ -138,7 +138,7 @@ public class PaymentsAppService : AbstractService, IPaymentsAppService { private readonly string _baseUrl; - public PaymentsAppService(Client client) : base(client) + public PaymentsAppService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://management-live.adyen.com/v1"); } diff --git a/Adyen/Service/Payout/InitializationService.cs b/Adyen/Service/Payout/InitializationService.cs index d2984a7d6..84fb4e6ef 100644 --- a/Adyen/Service/Payout/InitializationService.cs +++ b/Adyen/Service/Payout/InitializationService.cs @@ -84,7 +84,7 @@ public class InitializationService : AbstractService, IInitializationService { private readonly string _baseUrl; - public InitializationService(Client client) : base(client) + public InitializationService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/Payout/v68"); } diff --git a/Adyen/Service/Payout/InstantPayoutsService.cs b/Adyen/Service/Payout/InstantPayoutsService.cs index 5f0ccc982..b35f1f73d 100644 --- a/Adyen/Service/Payout/InstantPayoutsService.cs +++ b/Adyen/Service/Payout/InstantPayoutsService.cs @@ -50,7 +50,7 @@ public class InstantPayoutsService : AbstractService, IInstantPayoutsService { private readonly string _baseUrl; - public InstantPayoutsService(Client client) : base(client) + public InstantPayoutsService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/Payout/v68"); } diff --git a/Adyen/Service/Payout/ReviewingService.cs b/Adyen/Service/Payout/ReviewingService.cs index b748df02f..a7a8a07db 100644 --- a/Adyen/Service/Payout/ReviewingService.cs +++ b/Adyen/Service/Payout/ReviewingService.cs @@ -67,7 +67,7 @@ public class ReviewingService : AbstractService, IReviewingService { private readonly string _baseUrl; - public ReviewingService(Client client) : base(client) + public ReviewingService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/Payout/v68"); } diff --git a/Adyen/Service/PlatformsAccount/AccountHoldersService.cs b/Adyen/Service/PlatformsAccount/AccountHoldersService.cs index 947095844..2d11253a4 100644 --- a/Adyen/Service/PlatformsAccount/AccountHoldersService.cs +++ b/Adyen/Service/PlatformsAccount/AccountHoldersService.cs @@ -186,7 +186,7 @@ public class AccountHoldersService : AbstractService, IAccountHoldersService { private readonly string _baseUrl; - public AccountHoldersService(Client client) : base(client) + public AccountHoldersService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Account/v6"); } diff --git a/Adyen/Service/PlatformsAccount/AccountsService.cs b/Adyen/Service/PlatformsAccount/AccountsService.cs index 96d772086..a215c1e1d 100644 --- a/Adyen/Service/PlatformsAccount/AccountsService.cs +++ b/Adyen/Service/PlatformsAccount/AccountsService.cs @@ -84,7 +84,7 @@ public class AccountsService : AbstractService, IAccountsService { private readonly string _baseUrl; - public AccountsService(Client client) : base(client) + public AccountsService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Account/v6"); } diff --git a/Adyen/Service/PlatformsAccount/VerificationService.cs b/Adyen/Service/PlatformsAccount/VerificationService.cs index 4467d3d5f..8461c019d 100644 --- a/Adyen/Service/PlatformsAccount/VerificationService.cs +++ b/Adyen/Service/PlatformsAccount/VerificationService.cs @@ -169,7 +169,7 @@ public class VerificationService : AbstractService, IVerificationService { private readonly string _baseUrl; - public VerificationService(Client client) : base(client) + public VerificationService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Account/v6"); } diff --git a/Adyen/Service/PlatformsFundService.cs b/Adyen/Service/PlatformsFundService.cs index 5150e14ae..0ac7fc929 100644 --- a/Adyen/Service/PlatformsFundService.cs +++ b/Adyen/Service/PlatformsFundService.cs @@ -170,7 +170,7 @@ public class PlatformsFundService : AbstractService, IPlatformsFundService { private readonly string _baseUrl; - public PlatformsFundService(Client client) : base(client) + public PlatformsFundService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Fund/v6"); } diff --git a/Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs b/Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs index 19f0a8d0c..3e749ce25 100644 --- a/Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs +++ b/Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs @@ -50,7 +50,7 @@ public class HostedOnboardingPageService : AbstractService, IHostedOnboardingPag { private readonly string _baseUrl; - public HostedOnboardingPageService(Client client) : base(client) + public HostedOnboardingPageService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Hop/v6"); } diff --git a/Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs b/Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs index b41a064ef..45b884cb8 100644 --- a/Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs +++ b/Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs @@ -50,7 +50,7 @@ public class PCIComplianceQuestionnairePageService : AbstractService, IPCICompli { private readonly string _baseUrl; - public PCIComplianceQuestionnairePageService(Client client) : base(client) + public PCIComplianceQuestionnairePageService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Hop/v6"); } diff --git a/Adyen/Service/PlatformsNotificationConfigurationService.cs b/Adyen/Service/PlatformsNotificationConfigurationService.cs index 013a66792..e65b31115 100644 --- a/Adyen/Service/PlatformsNotificationConfigurationService.cs +++ b/Adyen/Service/PlatformsNotificationConfigurationService.cs @@ -136,7 +136,7 @@ public class PlatformsNotificationConfigurationService : AbstractService, IPlatf { private readonly string _baseUrl; - public PlatformsNotificationConfigurationService(Client client) : base(client) + public PlatformsNotificationConfigurationService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Notification/v6"); } diff --git a/Adyen/Service/PosMobileService.cs b/Adyen/Service/PosMobileService.cs index eba474151..b3c01c479 100644 --- a/Adyen/Service/PosMobileService.cs +++ b/Adyen/Service/PosMobileService.cs @@ -50,7 +50,7 @@ public class PosMobileService : AbstractService, IPosMobileService { private readonly string _baseUrl; - public PosMobileService(Client client) : base(client) + public PosMobileService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/checkout/possdk/v68"); } diff --git a/Adyen/Service/PosTerminalManagementService.cs b/Adyen/Service/PosTerminalManagementService.cs index 67df2e936..6aa83d0af 100644 --- a/Adyen/Service/PosTerminalManagementService.cs +++ b/Adyen/Service/PosTerminalManagementService.cs @@ -128,7 +128,7 @@ public class PosTerminalManagementService : AbstractService, IPosTerminalManagem { private readonly string _baseUrl; - public PosTerminalManagementService(Client client) : base(client) + public PosTerminalManagementService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://postfmapi-test.adyen.com/postfmapi/terminal/v1"); } diff --git a/Adyen/Service/RecurringService.cs b/Adyen/Service/RecurringService.cs index 21fcdc603..5851376e6 100644 --- a/Adyen/Service/RecurringService.cs +++ b/Adyen/Service/RecurringService.cs @@ -135,7 +135,7 @@ public class RecurringService : AbstractService, IRecurringService { private readonly string _baseUrl; - public RecurringService(Client client) : base(client) + public RecurringService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/Recurring/v68"); } diff --git a/Adyen/Service/Resource/Terminal/TerminalApi.cs b/Adyen/Service/Resource/Terminal/TerminalApi.cs index cf566c9d5..78f7efc39 100644 --- a/Adyen/Service/Resource/Terminal/TerminalApi.cs +++ b/Adyen/Service/Resource/Terminal/TerminalApi.cs @@ -10,9 +10,9 @@ public TerminalApi(AbstractService abstractService, bool asynchronous) : base(abstractService, null) { if (asynchronous) { - Endpoint = abstractService.Client.GetCloudApiEndpoint()+ "/async"; + Endpoint = abstractService.AdyenClient.GetCloudApiEndpoint()+ "/async"; } else { - Endpoint = abstractService.Client.GetCloudApiEndpoint() + "/sync"; + Endpoint = abstractService.AdyenClient.GetCloudApiEndpoint() + "/sync"; } } } diff --git a/Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs b/Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs index 67728b0d9..ea26de5e8 100644 --- a/Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs +++ b/Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs @@ -10,7 +10,7 @@ public class TerminalApiAsyncClient : ServiceResource /// /// . public TerminalApiAsyncClient(AbstractService abstractService) - : base(abstractService, abstractService.Client.GetCloudApiEndpoint() + "/async") + : base(abstractService, abstractService.AdyenClient.GetCloudApiEndpoint() + "/async") { } } diff --git a/Adyen/Service/Resource/Terminal/TerminalApiLocal.cs b/Adyen/Service/Resource/Terminal/TerminalApiLocal.cs index c8c3abb2e..0d59b11f3 100644 --- a/Adyen/Service/Resource/Terminal/TerminalApiLocal.cs +++ b/Adyen/Service/Resource/Terminal/TerminalApiLocal.cs @@ -7,7 +7,7 @@ public class TerminalApiLocal: ServiceResource { [Obsolete("Use TerminalApiLocalClient instead.")] public TerminalApiLocal(AbstractService abstractService) - : base(abstractService, abstractService.Client.Config.LocalTerminalApiEndpoint) + : base(abstractService, abstractService.AdyenClient.Config.LocalTerminalApiEndpoint) { } } diff --git a/Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs b/Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs index f99ac8d84..656e2d335 100644 --- a/Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs +++ b/Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs @@ -10,7 +10,7 @@ public class TerminalApiLocalClient : ServiceResource /// /// . public TerminalApiLocalClient(AbstractService abstractService) - : base(abstractService, abstractService.Client.Config.LocalTerminalApiEndpoint) + : base(abstractService, abstractService.AdyenClient.Config.LocalTerminalApiEndpoint) { } } diff --git a/Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs b/Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs index 11436aa44..5e160b15b 100644 --- a/Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs +++ b/Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs @@ -7,7 +7,7 @@ public class TerminalApiSyncClient : ServiceResource /// /// . public TerminalApiSyncClient(AbstractService abstractService) - : base(abstractService, abstractService.Client.GetCloudApiEndpoint() + "/sync") + : base(abstractService, abstractService.AdyenClient.GetCloudApiEndpoint() + "/sync") { } } diff --git a/Adyen/Service/ServiceResource.cs b/Adyen/Service/ServiceResource.cs index d5ffc3384..fd4dadb6e 100644 --- a/Adyen/Service/ServiceResource.cs +++ b/Adyen/Service/ServiceResource.cs @@ -19,26 +19,26 @@ public ServiceResource(AbstractService abstractService, string endpoint) public string Request(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null) { - var clientInterface = _abstractService.Client.HttpClient; + var clientInterface = _abstractService.AdyenClient.HttpClient; return clientInterface.Request(Endpoint, json, requestOptions, httpMethod); } public T Request(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null) { - var clientInterface = _abstractService.Client.HttpClient; + var clientInterface = _abstractService.AdyenClient.HttpClient; var jsonResponse = clientInterface.Request(Endpoint, json, requestOptions, httpMethod); return JsonConvert.DeserializeObject(jsonResponse); } public async Task RequestAsync(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null, CancellationToken cancellationToken = default) { - var clientInterface = _abstractService.Client.HttpClient; + var clientInterface = _abstractService.AdyenClient.HttpClient; return await clientInterface.RequestAsync(Endpoint, json, requestOptions, httpMethod, cancellationToken).ConfigureAwait(false); } public async Task RequestAsync(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null, CancellationToken cancellationToken = default) { - var clientInterface = _abstractService.Client.HttpClient; + var clientInterface = _abstractService.AdyenClient.HttpClient; var jsonResponse = await clientInterface.RequestAsync(Endpoint, json, requestOptions, httpMethod, cancellationToken).ConfigureAwait(false); return JsonConvert.DeserializeObject(jsonResponse); } diff --git a/Adyen/Service/StoredValueService.cs b/Adyen/Service/StoredValueService.cs index 574097af0..06b920333 100644 --- a/Adyen/Service/StoredValueService.cs +++ b/Adyen/Service/StoredValueService.cs @@ -135,7 +135,7 @@ public class StoredValueService : AbstractService, IStoredValueService { private readonly string _baseUrl; - public StoredValueService(Client client) : base(client) + public StoredValueService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/StoredValue/v46"); } diff --git a/Adyen/Service/TerminalApiAsyncService.cs b/Adyen/Service/TerminalApiAsyncService.cs index 18d94d389..91ddf9a50 100644 --- a/Adyen/Service/TerminalApiAsyncService.cs +++ b/Adyen/Service/TerminalApiAsyncService.cs @@ -67,7 +67,7 @@ public class TerminalApiAsyncService : AbstractService, ITerminalApiAsyncService /// /// Service that sends requests to the Adyen Cloud Terminal API `https://terminal-api-test.adyen.com/async` endpoint. /// - public TerminalApiAsyncService(Client client, SaleToPoiMessageSerializer saleToPoiMessageSerializer, SaleToPoiMessageSecuredEncryptor saleToPoiMessageSecuredEncryptor, SaleToPoiMessageSecuredSerializer saleToPoiMessageSecuredSerializer) : base(client) + public TerminalApiAsyncService(AdyenClient adyenClient, SaleToPoiMessageSerializer saleToPoiMessageSerializer, SaleToPoiMessageSecuredEncryptor saleToPoiMessageSecuredEncryptor, SaleToPoiMessageSecuredSerializer saleToPoiMessageSecuredSerializer) : base(adyenClient) { _saleToPoiMessageSerializer = saleToPoiMessageSerializer; _saleToPoiMessageSecuredEncryptor = saleToPoiMessageSecuredEncryptor; @@ -79,11 +79,11 @@ public TerminalApiAsyncService(Client client, SaleToPoiMessageSerializer saleToP public async Task RequestEncryptedAsync(SaleToPOIRequest saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails, CancellationToken cancellationToken) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n"+ serializedMessage); + AdyenClient.LogLine("Request: \n"+ serializedMessage); SaleToPoiMessageSecured securedMessage = _saleToPoiMessageSecuredEncryptor.Encrypt(serializedMessage, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); string serializedSecuredMessage = _saleToPoiMessageSerializer.Serialize(securedMessage); string response = await _asyncClient.RequestAsync(serializedSecuredMessage, cancellationToken: cancellationToken); - Client.LogLine("Response: \n" + response); + AdyenClient.LogLine("Response: \n" + response); return response; } @@ -91,11 +91,11 @@ public async Task RequestEncryptedAsync(SaleToPOIRequest saleToPoiReques public string RequestEncrypted(SaleToPOIRequest saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n"+ serializedMessage); + AdyenClient.LogLine("Request: \n"+ serializedMessage); SaleToPoiMessageSecured securedMessage = _saleToPoiMessageSecuredEncryptor.Encrypt(serializedMessage, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); string serializedSecuredMessage = _saleToPoiMessageSerializer.Serialize(securedMessage); string response = _asyncClient.Request(serializedSecuredMessage); - Client.LogLine("Response: \n" + response); + AdyenClient.LogLine("Response: \n" + response); return response; } @@ -103,9 +103,9 @@ public string RequestEncrypted(SaleToPOIRequest saleToPoiRequest, EncryptionCre public async Task RequestAsync(SaleToPOIRequest saleToPoiRequest, CancellationToken cancellationToken) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + serializedMessage); + AdyenClient.LogLine("Request: \n" + serializedMessage); string response = await _asyncClient.RequestAsync(serializedMessage, cancellationToken: cancellationToken); - Client.LogLine("Response: \n" + response); + AdyenClient.LogLine("Response: \n" + response); return response; } @@ -113,9 +113,9 @@ public async Task RequestAsync(SaleToPOIRequest saleToPoiRequest, Cancel public string Request(SaleToPOIRequest saleToPoiRequest) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + serializedMessage); + AdyenClient.LogLine("Request: \n" + serializedMessage); string response = _asyncClient.Request(serializedMessage); - Client.LogLine("Response: \n" + response); + AdyenClient.LogLine("Response: \n" + response); return response; } diff --git a/Adyen/Service/TerminalApiLocalService.cs b/Adyen/Service/TerminalApiLocalService.cs index b21b955a4..9c52afed1 100644 --- a/Adyen/Service/TerminalApiLocalService.cs +++ b/Adyen/Service/TerminalApiLocalService.cs @@ -38,7 +38,7 @@ public interface ITerminalApiLocalService /// /// Example: /// handler = new HttpClientHandler { ServerCertificateCustomValidationCallback = (message, certificate2, arg3, arg4) => true }; - /// var httpClient = new (, new (handler)); + /// var httpClient = new (, new (handler)); /// var terminalApiLocalService = new (httpClient, , , ); /// /// . @@ -52,7 +52,7 @@ public interface ITerminalApiLocalService /// /// Example: /// handler = new HttpClientHandler { ServerCertificateCustomValidationCallback = (message, certificate2, arg3, arg4) => true }; - /// var httpClient = new (, new (handler)); + /// var httpClient = new (, new (handler)); /// var terminalApiLocalService = new (httpClient, , , ); /// /// . @@ -81,7 +81,7 @@ public class TerminalApiLocalService: AbstractService, ITerminalApiLocalService /// /// Service that sends requests to the endpoint specified in (e.g. `https://198.51.100.1:8443/nexo`). /// - public TerminalApiLocalService(Client client, SaleToPoiMessageSerializer saleToPoiMessageSerializer, SaleToPoiMessageSecuredEncryptor saleToPoiMessageSecuredEncryptor, SaleToPoiMessageSecuredSerializer saleToPoiMessageSecuredSerializer) : base(client) + public TerminalApiLocalService(AdyenClient adyenClient, SaleToPoiMessageSerializer saleToPoiMessageSerializer, SaleToPoiMessageSecuredEncryptor saleToPoiMessageSecuredEncryptor, SaleToPoiMessageSecuredSerializer saleToPoiMessageSecuredSerializer) : base(adyenClient) { _saleToPoiMessageSerializer = saleToPoiMessageSerializer; _saleToPoiMessageSecuredEncryptor = saleToPoiMessageSecuredEncryptor; @@ -93,7 +93,7 @@ public TerminalApiLocalService(Client client, SaleToPoiMessageSerializer saleToP public async Task RequestEncryptedAsync(SaleToPOIRequest saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails, CancellationToken cancellationToken) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + serializedMessage); + AdyenClient.LogLine("Request: \n" + serializedMessage); SaleToPoiMessageSecured securedMessage = _saleToPoiMessageSecuredEncryptor.Encrypt(serializedMessage, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); string serializedSecuredMessage = _saleToPoiMessageSerializer.Serialize(securedMessage); string response = await _localClient.RequestAsync(serializedSecuredMessage, cancellationToken: cancellationToken); @@ -103,7 +103,7 @@ public async Task RequestEncryptedAsync(SaleToPOIRequest sale } SaleToPoiMessageSecured saleToPoiResponseSecured = _saleToPoiMessageSecuredSerializer.Deserialize(response); string decryptedResponse = _saleToPoiMessageSecuredEncryptor.Decrypt(saleToPoiResponseSecured, encryptionCredentialDetails); - Client.LogLine("Response: \n" + decryptedResponse); + AdyenClient.LogLine("Response: \n" + decryptedResponse); return _saleToPoiMessageSerializer.Deserialize(decryptedResponse); } @@ -111,7 +111,7 @@ public async Task RequestEncryptedAsync(SaleToPOIRequest sale public SaleToPOIResponse RequestEncrypted(SaleToPOIRequest saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + serializedMessage); + AdyenClient.LogLine("Request: \n" + serializedMessage); SaleToPoiMessageSecured securedMessage = _saleToPoiMessageSecuredEncryptor.Encrypt(serializedMessage, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); string serializedSecuredMessage = _saleToPoiMessageSerializer.Serialize(securedMessage); string response = _localClient.Request(serializedSecuredMessage); @@ -121,7 +121,7 @@ public SaleToPOIResponse RequestEncrypted(SaleToPOIRequest saleToPoiRequest, Enc } SaleToPoiMessageSecured saleToPoiResponseSecured = _saleToPoiMessageSecuredSerializer.Deserialize(response); string decryptedResponse = _saleToPoiMessageSecuredEncryptor.Decrypt(saleToPoiResponseSecured, encryptionCredentialDetails); - Client.LogLine("Response: \n" + decryptedResponse); + AdyenClient.LogLine("Response: \n" + decryptedResponse); return _saleToPoiMessageSerializer.Deserialize(decryptedResponse); } @@ -129,9 +129,9 @@ public SaleToPOIResponse RequestEncrypted(SaleToPOIRequest saleToPoiRequest, Enc public async Task RequestAsync(SaleToPOIRequest saleToPoiRequest, CancellationToken cancellationToken) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + serializedMessage); + AdyenClient.LogLine("Request: \n" + serializedMessage); string response = await _localClient.RequestAsync(serializedMessage, cancellationToken: cancellationToken); - Client.LogLine("Response: \n" + response); + AdyenClient.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; @@ -143,9 +143,9 @@ public async Task RequestAsync(SaleToPOIRequest saleToPoiRequ public SaleToPOIResponse Request(SaleToPOIRequest saleToPoiRequest) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + serializedMessage); + AdyenClient.LogLine("Request: \n" + serializedMessage); string response = _localClient.Request(serializedMessage); - Client.LogLine("Response: \n" + response); + AdyenClient.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; diff --git a/Adyen/Service/TerminalApiSyncService.cs b/Adyen/Service/TerminalApiSyncService.cs index 2fbb95714..e6525ae4e 100644 --- a/Adyen/Service/TerminalApiSyncService.cs +++ b/Adyen/Service/TerminalApiSyncService.cs @@ -67,7 +67,7 @@ public class TerminalApiSyncService : AbstractService, ITerminalApiSyncService /// /// Service that sends requests to the Adyen Cloud Terminal API `https://terminal-api-test.adyen.com/sync` endpoint. /// - public TerminalApiSyncService(Client client, SaleToPoiMessageSerializer saleToPoiMessageSerializer, SaleToPoiMessageSecuredEncryptor saleToPoiMessageSecuredEncryptor, SaleToPoiMessageSecuredSerializer saleToPoiMessageSecuredSerializer) : base(client) + public TerminalApiSyncService(AdyenClient adyenClient, SaleToPoiMessageSerializer saleToPoiMessageSerializer, SaleToPoiMessageSecuredEncryptor saleToPoiMessageSecuredEncryptor, SaleToPoiMessageSecuredSerializer saleToPoiMessageSecuredSerializer) : base(adyenClient) { _saleToPoiMessageSerializer = saleToPoiMessageSerializer; _saleToPoiMessageSecuredEncryptor = saleToPoiMessageSecuredEncryptor; @@ -79,7 +79,7 @@ public TerminalApiSyncService(Client client, SaleToPoiMessageSerializer saleToPo public async Task RequestEncryptedAsync(SaleToPOIRequest saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails, CancellationToken cancellationToken) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + serializedMessage); + AdyenClient.LogLine("Request: \n" + serializedMessage); SaleToPoiMessageSecured securedMessage = _saleToPoiMessageSecuredEncryptor.Encrypt(serializedMessage, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); string serializedSecuredMessage = _saleToPoiMessageSerializer.Serialize(securedMessage); string response = await _syncClient.RequestAsync(serializedSecuredMessage, cancellationToken: cancellationToken); @@ -89,7 +89,7 @@ public async Task RequestEncryptedAsync(SaleToPOIRequest sale } SaleToPoiMessageSecured saleToPoiResponseSecured = _saleToPoiMessageSecuredSerializer.Deserialize(response); string decryptedResponse = _saleToPoiMessageSecuredEncryptor.Decrypt(saleToPoiResponseSecured, encryptionCredentialDetails); - Client.LogLine("Response: \n" + decryptedResponse); + AdyenClient.LogLine("Response: \n" + decryptedResponse); return _saleToPoiMessageSerializer.Deserialize(decryptedResponse); } @@ -97,7 +97,7 @@ public async Task RequestEncryptedAsync(SaleToPOIRequest sale public SaleToPOIResponse RequestEncrypted(SaleToPOIRequest saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + serializedMessage); + AdyenClient.LogLine("Request: \n" + serializedMessage); SaleToPoiMessageSecured securedMessage = _saleToPoiMessageSecuredEncryptor.Encrypt(serializedMessage, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); string serializedSecuredMessage = _saleToPoiMessageSerializer.Serialize(securedMessage); string response = _syncClient.Request(serializedSecuredMessage); @@ -107,7 +107,7 @@ public SaleToPOIResponse RequestEncrypted(SaleToPOIRequest saleToPoiRequest, Enc } SaleToPoiMessageSecured saleToPoiResponseSecured = _saleToPoiMessageSecuredSerializer.Deserialize(response); string decryptedResponse = _saleToPoiMessageSecuredEncryptor.Decrypt(saleToPoiResponseSecured, encryptionCredentialDetails); - Client.LogLine("Response: \n" + decryptedResponse); + AdyenClient.LogLine("Response: \n" + decryptedResponse); return _saleToPoiMessageSerializer.Deserialize(decryptedResponse); } @@ -115,9 +115,9 @@ public SaleToPOIResponse RequestEncrypted(SaleToPOIRequest saleToPoiRequest, Enc public async Task RequestAsync(SaleToPOIRequest saleToPoiRequest, CancellationToken cancellationToken) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + serializedMessage); + AdyenClient.LogLine("Request: \n" + serializedMessage); string response = await _syncClient.RequestAsync(serializedMessage, cancellationToken: cancellationToken); - Client.LogLine("Response: \n" + response); + AdyenClient.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; @@ -129,9 +129,9 @@ public async Task RequestAsync(SaleToPOIRequest saleToPoiRequ public SaleToPOIResponse Request(SaleToPOIRequest saleToPoiRequest) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + serializedMessage); + AdyenClient.LogLine("Request: \n" + serializedMessage); string response = _syncClient.Request(serializedMessage); - Client.LogLine("Response: \n" + response); + AdyenClient.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; diff --git a/Adyen/Service/TerminalCloudApi.cs b/Adyen/Service/TerminalCloudApi.cs index 0b116a77f..5b948302e 100644 --- a/Adyen/Service/TerminalCloudApi.cs +++ b/Adyen/Service/TerminalCloudApi.cs @@ -54,13 +54,13 @@ public class TerminalCloudApi : AbstractService, ITerminalCloudApi private readonly string _baseUrl; [Obsolete("Use TerminalApiSyncService or TerminalApiAsyncService instead.")] - public TerminalCloudApi(Client client) - : base(client) + public TerminalCloudApi(AdyenClient adyenClient) + : base(adyenClient) { _saleToPoiMessageSerializer = new SaleToPoiMessageSerializer(); _terminalApiAsync = new TerminalApi(this, true); _terminalApiSync = new TerminalApi(this, false); - _baseUrl = client.GetCloudApiEndpoint(); + _baseUrl = adyenClient.GetCloudApiEndpoint(); } @@ -68,9 +68,9 @@ public TerminalCloudApi(Client client) public SaleToPOIResponse TerminalRequestAsync(SaleToPOIMessage saleToPoiRequest) { var serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + serializedMessage); + AdyenClient.LogLine("Request: \n" + serializedMessage); var response = _terminalApiAsync.Request(serializedMessage); - Client.LogLine("Response: \n" + response); + AdyenClient.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; @@ -82,9 +82,9 @@ public SaleToPOIResponse TerminalRequestAsync(SaleToPOIMessage saleToPoiRequest) public SaleToPOIResponse TerminalRequestSync(SaleToPOIMessage saleToPoiRequest) { var serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n"+ serializedMessage); + AdyenClient.LogLine("Request: \n"+ serializedMessage); var response = _terminalApiSync.Request(serializedMessage); - Client.LogLine("Response: \n"+ response); + AdyenClient.LogLine("Response: \n"+ response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; @@ -96,9 +96,9 @@ public SaleToPOIResponse TerminalRequestSync(SaleToPOIMessage saleToPoiRequest) public async Task TerminalRequestAsynchronousAsync(SaleToPOIMessage saleToPoiRequest, CancellationToken cancellationToken = default) { var serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + serializedMessage); + AdyenClient.LogLine("Request: \n" + serializedMessage); var response = await _terminalApiAsync.RequestAsync(serializedMessage, cancellationToken: cancellationToken); - Client.LogLine("Response: \n" + response); + AdyenClient.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; @@ -110,9 +110,9 @@ public async Task TerminalRequestAsynchronousAsync(SaleToPOIM public async Task TerminalRequestSynchronousAsync(SaleToPOIMessage saleToPoiRequest, CancellationToken cancellationToken = default) { var serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + serializedMessage); + AdyenClient.LogLine("Request: \n" + serializedMessage); var response = await _terminalApiSync.RequestAsync(serializedMessage, cancellationToken: cancellationToken); - Client.LogLine("Response: \n" + response); + AdyenClient.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; diff --git a/Adyen/Service/TerminalLocalApi.cs b/Adyen/Service/TerminalLocalApi.cs index 1588fa049..7061029b1 100644 --- a/Adyen/Service/TerminalLocalApi.cs +++ b/Adyen/Service/TerminalLocalApi.cs @@ -59,8 +59,8 @@ public class TerminalLocalApi: AbstractService, ITerminalLocalApi private readonly SaleToPoiMessageSecuredSerializer _saleToPoiMessageSecuredSerializer; [Obsolete("Use TerminalApiLocalService instead.")] - public TerminalLocalApi(Client client) - : base(client) + public TerminalLocalApi(AdyenClient adyenClient) + : base(adyenClient) { _terminalApiLocal = new TerminalApiLocal(this); _saleToPoiMessageSerializer = new SaleToPoiMessageSerializer(); @@ -72,7 +72,7 @@ public TerminalLocalApi(Client client) public SaleToPOIResponse TerminalRequest(SaleToPOIMessage saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails) { var saleToPoiRequestMessageSerialized = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + saleToPoiRequestMessageSerialized); + AdyenClient.LogLine("Request: \n" + saleToPoiRequestMessageSerialized); var saleToPoiRequestMessageSecured = _messageSecuredEncryptor.Encrypt(saleToPoiRequestMessageSerialized, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); var serializeSaleToPoiRequestMessageSecured = _saleToPoiMessageSerializer.Serialize(saleToPoiRequestMessageSecured); var response = _terminalApiLocal.Request(serializeSaleToPoiRequestMessageSecured); @@ -82,7 +82,7 @@ public SaleToPOIResponse TerminalRequest(SaleToPOIMessage saleToPoiRequest, Encr } var saleToPoiResponseSecured = _saleToPoiMessageSecuredSerializer.Deserialize(response); var decryptResponse = _messageSecuredEncryptor.Decrypt(saleToPoiResponseSecured, encryptionCredentialDetails); - Client.LogLine("Response: \n" + decryptResponse); + AdyenClient.LogLine("Response: \n" + decryptResponse); return _saleToPoiMessageSerializer.Deserialize(decryptResponse); } @@ -90,7 +90,7 @@ public SaleToPOIResponse TerminalRequest(SaleToPOIMessage saleToPoiRequest, Encr public async Task TerminalRequestAsync(SaleToPOIMessage saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails, CancellationToken cancellationToken = default) { var saleToPoiRequestMessageSerialized = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + saleToPoiRequestMessageSerialized); + AdyenClient.LogLine("Request: \n" + saleToPoiRequestMessageSerialized); var saleToPoiRequestMessageSecured = _messageSecuredEncryptor.Encrypt(saleToPoiRequestMessageSerialized, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); var serializeSaleToPoiRequestMessageSecured = _saleToPoiMessageSerializer.Serialize(saleToPoiRequestMessageSecured); var response = await _terminalApiLocal.RequestAsync(serializeSaleToPoiRequestMessageSecured, cancellationToken: cancellationToken).ConfigureAwait(false); @@ -100,7 +100,7 @@ public async Task TerminalRequestAsync(SaleToPOIMessage saleT } var saleToPoiResponseSecured = _saleToPoiMessageSecuredSerializer.Deserialize(response); var decryptResponse = _messageSecuredEncryptor.Decrypt(saleToPoiResponseSecured, encryptionCredentialDetails); - Client.LogLine("Response: \n" + decryptResponse); + AdyenClient.LogLine("Response: \n" + decryptResponse); return _saleToPoiMessageSerializer.Deserialize(decryptResponse); } diff --git a/Adyen/Service/TerminalLocalApiUnencrypted.cs b/Adyen/Service/TerminalLocalApiUnencrypted.cs index 720f16e6c..b5a251a82 100644 --- a/Adyen/Service/TerminalLocalApiUnencrypted.cs +++ b/Adyen/Service/TerminalLocalApiUnencrypted.cs @@ -19,16 +19,16 @@ public class TerminalLocalApiUnencrypted : AbstractService /// [UNENCRYPTED] Local Terminal Api. /// Use this class (in TEST only) to experiment with the Local Terminal API separately from the encryption implementation required for live payments. Be sure to remove the encryption key details on the Customer Area as it will not work with encryption key details set up. /// - /// Client + /// Client /// [Obsolete("Use TerminalApiLocalService instead.")] - public TerminalLocalApiUnencrypted(Client client) - : base(client) + public TerminalLocalApiUnencrypted(AdyenClient adyenClient) + : base(adyenClient) { // Set default server certificate validation to true so no certificate check is performed var handler = new HttpClientHandler { ServerCertificateCustomValidationCallback = (message, certificate2, arg3, arg4) => true }; - Client = new Client(Client.Config, new System.Net.Http.HttpClient(handler)); + AdyenClient = new AdyenClient(AdyenClient.Config, new System.Net.Http.HttpClient(handler)); _terminalApiLocal = new TerminalApiLocal(this); _saleToPoiMessageSerializer = new SaleToPoiMessageSerializer(); } @@ -42,9 +42,9 @@ public TerminalLocalApiUnencrypted(Client client) public SaleToPOIResponse TerminalRequest(SaleToPOIMessage saleToPoiRequest) { var saleToPoiRequestJson = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + saleToPoiRequestJson); + AdyenClient.LogLine("Request: \n" + saleToPoiRequestJson); var response = _terminalApiLocal.Request(saleToPoiRequestJson); - Client.LogLine("Request: \n" + response); + AdyenClient.LogLine("Request: \n" + response); return string.IsNullOrEmpty(response) ? null : _saleToPoiMessageSerializer.Deserialize(response); } @@ -58,9 +58,9 @@ public SaleToPOIResponse TerminalRequest(SaleToPOIMessage saleToPoiRequest) public async Task TerminalRequestAsync(SaleToPOIMessage saleToPoiRequest, CancellationToken cancellationToken = default) { var saleToPoiRequestJson = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - Client.LogLine("Request: \n" + saleToPoiRequestJson); + AdyenClient.LogLine("Request: \n" + saleToPoiRequestJson); var response = await _terminalApiLocal.RequestAsync(saleToPoiRequestJson, cancellationToken: cancellationToken).ConfigureAwait(false); - Client.LogLine("Response: \n" + response); + AdyenClient.LogLine("Response: \n" + response); return string.IsNullOrEmpty(response) ? null : _saleToPoiMessageSerializer.Deserialize(response); } } diff --git a/Adyen/Service/Transfers/CapitalService.cs b/Adyen/Service/Transfers/CapitalService.cs index 27eb9e95e..03bf51ae1 100644 --- a/Adyen/Service/Transfers/CapitalService.cs +++ b/Adyen/Service/Transfers/CapitalService.cs @@ -90,7 +90,7 @@ public class CapitalService : AbstractService, ICapitalService { private readonly string _baseUrl; - public CapitalService(Client client) : base(client) + public CapitalService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/btl/v4"); } diff --git a/Adyen/Service/Transfers/TransactionsService.cs b/Adyen/Service/Transfers/TransactionsService.cs index d9856add0..d2e001454 100644 --- a/Adyen/Service/Transfers/TransactionsService.cs +++ b/Adyen/Service/Transfers/TransactionsService.cs @@ -81,7 +81,7 @@ public class TransactionsService : AbstractService, ITransactionsService { private readonly string _baseUrl; - public TransactionsService(Client client) : base(client) + public TransactionsService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/btl/v4"); } diff --git a/Adyen/Service/Transfers/TransfersService.cs b/Adyen/Service/Transfers/TransfersService.cs index 860a47fcb..57767e977 100644 --- a/Adyen/Service/Transfers/TransfersService.cs +++ b/Adyen/Service/Transfers/TransfersService.cs @@ -151,7 +151,7 @@ public class TransfersService : AbstractService, ITransfersService { private readonly string _baseUrl; - public TransfersService(Client client) : base(client) + public TransfersService(AdyenClient adyenClient) : base(adyenClient) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/btl/v4"); } From a38fcafe8874dc570a89f144513a12b66a2d2d4b Mon Sep 17 00:00:00 2001 From: kwokhe <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 7 Jul 2025 10:55:26 +0200 Subject: [PATCH 003/126] TODO: revertt --- Adyen/Adyen.csproj | 2 +- Adyen/Client/ApiException.cs | 50 + Adyen/Client/ApiFactory.cs | 49 + Adyen/Client/ApiKeyToken.cs | 52 + Adyen/Client/ApiResponse.cs | 289 ++ Adyen/Client/ApiResponseEventArgs.cs | 24 + Adyen/Client/BasicToken.cs | 42 + Adyen/Client/ClientUtils.cs | 723 ++++ Adyen/Client/CookieContainer.cs | 18 + Adyen/Client/DateTimeJsonConverter.cs | 77 + Adyen/Client/DateTimeNullableJsonConverter.cs | 82 + Adyen/Client/ExceptionEventArgs.cs | 24 + Adyen/Client/HostConfiguration.cs | 361 ++ Adyen/Client/JsonSerializerOptionsProvider.cs | 25 + Adyen/Client/Option.cs | 51 + Adyen/Client/RateLimitProvider.cs | 71 + Adyen/Client/TokenBase.cs | 69 + Adyen/Client/TokenContainer.cs | 35 + Adyen/Client/TokenProvider.cs | 42 + Adyen/Model/Checkout/AbstractOpenAPISchema.cs | 81 - Adyen/Model/Checkout/AccountInfo.cs | 1241 ++++-- Adyen/Model/Checkout/AcctInfo.cs | 1205 ++++-- Adyen/Model/Checkout/AchDetails.cs | 780 ++-- .../Model/Checkout/AdditionalData3DSecure.cs | 437 ++- Adyen/Model/Checkout/AdditionalDataAirline.cs | 1210 +++--- .../Model/Checkout/AdditionalDataCarRental.cs | 980 +++-- Adyen/Model/Checkout/AdditionalDataCommon.cs | 960 +++-- Adyen/Model/Checkout/AdditionalDataLevel23.cs | 758 ++-- Adyen/Model/Checkout/AdditionalDataLodging.cs | 758 ++-- .../Checkout/AdditionalDataOpenInvoice.cs | 795 ++-- Adyen/Model/Checkout/AdditionalDataOpi.cs | 166 +- Adyen/Model/Checkout/AdditionalDataRatepay.cs | 425 +- Adyen/Model/Checkout/AdditionalDataRetry.cs | 240 +- Adyen/Model/Checkout/AdditionalDataRisk.cs | 906 +++-- .../Checkout/AdditionalDataRiskStandalone.cs | 684 ++-- .../Checkout/AdditionalDataSubMerchant.cs | 573 ++- .../AdditionalDataTemporaryServices.cs | 462 ++- Adyen/Model/Checkout/AdditionalDataWallets.cs | 351 +- Adyen/Model/Checkout/Address.cs | 363 +- Adyen/Model/Checkout/AffirmDetails.cs | 246 +- Adyen/Model/Checkout/AfterpayDetails.cs | 472 ++- Adyen/Model/Checkout/Agency.cs | 203 +- Adyen/Model/Checkout/Airline.cs | 627 +-- Adyen/Model/Checkout/AmazonPayDetails.cs | 320 +- Adyen/Model/Checkout/Amount.cs | 210 +- Adyen/Model/Checkout/Amounts.cs | 197 +- Adyen/Model/Checkout/AncvDetails.cs | 369 +- Adyen/Model/Checkout/AndroidPayDetails.cs | 246 +- Adyen/Model/Checkout/ApplePayDetails.cs | 460 ++- Adyen/Model/Checkout/ApplePayDonations.cs | 460 ++- .../Model/Checkout/ApplePaySessionRequest.cs | 234 +- .../Model/Checkout/ApplePaySessionResponse.cs | 164 +- Adyen/Model/Checkout/ApplicationInfo.cs | 370 +- Adyen/Model/Checkout/AuthenticationData.cs | 290 +- .../Model/Checkout/BacsDirectDebitDetails.cs | 480 ++- Adyen/Model/Checkout/BalanceCheckRequest.cs | 1953 +++++++--- Adyen/Model/Checkout/BalanceCheckResponse.cs | 458 ++- Adyen/Model/Checkout/BillDeskDetails.cs | 300 +- Adyen/Model/Checkout/BillingAddress.cs | 373 +- Adyen/Model/Checkout/BlikDetails.cs | 369 +- Adyen/Model/Checkout/BrowserInfo.cs | 397 +- Adyen/Model/Checkout/CancelOrderRequest.cs | 196 +- Adyen/Model/Checkout/CancelOrderResponse.cs | 240 +- Adyen/Model/Checkout/CardBrandDetails.cs | 197 +- Adyen/Model/Checkout/CardDetails.cs | 1237 ++++-- Adyen/Model/Checkout/CardDetailsRequest.cs | 326 +- Adyen/Model/Checkout/CardDetailsResponse.cs | 275 +- Adyen/Model/Checkout/CardDonations.cs | 1237 ++++-- Adyen/Model/Checkout/CashAppDetails.cs | 554 ++- Adyen/Model/Checkout/CellulantDetails.cs | 283 +- Adyen/Model/Checkout/CheckoutAwaitAction.cs | 320 +- Adyen/Model/Checkout/CheckoutBankAccount.cs | 601 ++- .../Checkout/CheckoutBankTransferAction.cs | 656 ++-- .../CheckoutDelegatedAuthenticationAction.cs | 394 +- .../Checkout/CheckoutNativeRedirectAction.cs | 398 +- Adyen/Model/Checkout/CheckoutOrderResponse.cs | 364 +- Adyen/Model/Checkout/CheckoutPaymentMethod.cs | 2260 ++++------- Adyen/Model/Checkout/CheckoutQrCodeAction.cs | 394 +- .../Model/Checkout/CheckoutRedirectAction.cs | 361 +- Adyen/Model/Checkout/CheckoutSDKAction.cs | 371 +- .../CheckoutSessionInstallmentOption.cs | 375 +- .../CheckoutSessionThreeDS2RequestData.cs | 379 +- .../Model/Checkout/CheckoutThreeDS2Action.cs | 431 ++- Adyen/Model/Checkout/CheckoutVoucherAction.cs | 958 +++-- Adyen/Model/Checkout/CommonField.cs | 205 +- Adyen/Model/Checkout/Company.cs | 351 +- .../Checkout/CreateCheckoutSessionRequest.cs | 2773 +++++++++---- .../Checkout/CreateCheckoutSessionResponse.cs | 2970 +++++++++----- Adyen/Model/Checkout/CreateOrderRequest.cs | 274 +- Adyen/Model/Checkout/CreateOrderResponse.cs | 549 ++- Adyen/Model/Checkout/DeliveryAddress.cs | 465 ++- Adyen/Model/Checkout/DeliveryMethod.cs | 354 +- .../DetailsRequestAuthenticationData.cs | 160 +- Adyen/Model/Checkout/DeviceRenderOptions.cs | 348 +- Adyen/Model/Checkout/DokuDetails.cs | 486 ++- Adyen/Model/Checkout/Donation.cs | 305 +- Adyen/Model/Checkout/DonationCampaign.cs | 542 ++- .../Checkout/DonationCampaignsRequest.cs | 243 +- .../Checkout/DonationCampaignsResponse.cs | 171 +- Adyen/Model/Checkout/DonationPaymentMethod.cs | 421 +- .../Model/Checkout/DonationPaymentRequest.cs | 1965 +++++++--- .../Model/Checkout/DonationPaymentResponse.cs | 457 ++- Adyen/Model/Checkout/DragonpayDetails.cs | 363 +- .../Model/Checkout/EBankingFinlandDetails.cs | 282 +- .../Model/Checkout/EcontextVoucherDetails.cs | 412 +- Adyen/Model/Checkout/EftDetails.cs | 480 ++- Adyen/Model/Checkout/EncryptedOrderData.cs | 204 +- Adyen/Model/Checkout/EnhancedSchemeData.cs | 170 +- Adyen/Model/Checkout/ExternalPlatform.cs | 242 +- Adyen/Model/Checkout/FastlaneDetails.cs | 365 +- Adyen/Model/Checkout/ForexQuote.cs | 589 ++- Adyen/Model/Checkout/FraudCheckResult.cs | 216 +- Adyen/Model/Checkout/FraudResult.cs | 202 +- Adyen/Model/Checkout/FundOrigin.cs | 320 +- Adyen/Model/Checkout/FundRecipient.cs | 686 ++-- .../GenericIssuerPaymentMethodDetails.cs | 396 +- Adyen/Model/Checkout/GooglePayDetails.cs | 548 ++- Adyen/Model/Checkout/GooglePayDonations.cs | 548 ++- Adyen/Model/Checkout/IdealDetails.cs | 369 +- Adyen/Model/Checkout/IdealDonations.cs | 369 +- Adyen/Model/Checkout/InputDetail.cs | 476 ++- Adyen/Model/Checkout/InstallmentOption.cs | 408 +- Adyen/Model/Checkout/Installments.cs | 367 +- Adyen/Model/Checkout/Item.cs | 203 +- Adyen/Model/Checkout/KlarnaDetails.cs | 539 ++- Adyen/Model/Checkout/Leg.cs | 455 ++- Adyen/Model/Checkout/LineItem.cs | 775 ++-- .../ListStoredPaymentMethodsResponse.cs | 245 +- Adyen/Model/Checkout/Mandate.cs | 753 ++-- Adyen/Model/Checkout/MasterpassDetails.cs | 370 +- Adyen/Model/Checkout/MbwayDetails.cs | 317 +- Adyen/Model/Checkout/MerchantDevice.cs | 240 +- Adyen/Model/Checkout/MerchantRiskIndicator.cs | 801 ++-- Adyen/Model/Checkout/MobilePayDetails.cs | 246 +- Adyen/Model/Checkout/MolPayDetails.cs | 300 +- Adyen/Model/Checkout/Name.cs | 214 +- Adyen/Model/Checkout/OpenInvoiceDetails.cs | 463 ++- Adyen/Model/Checkout/Passenger.cs | 314 +- .../PayByBankAISDirectDebitDetails.cs | 331 +- Adyen/Model/Checkout/PayByBankDetails.cs | 282 +- Adyen/Model/Checkout/PayPalDetails.cs | 572 ++- Adyen/Model/Checkout/PayPayDetails.cs | 332 +- Adyen/Model/Checkout/PayToDetails.cs | 369 +- Adyen/Model/Checkout/PayUUpiDetails.cs | 404 +- Adyen/Model/Checkout/PayWithGoogleDetails.cs | 511 ++- .../Model/Checkout/PayWithGoogleDonations.cs | 511 ++- Adyen/Model/Checkout/Payment.cs | 313 ++ .../Checkout/PaymentAmountUpdateRequest.cs | 462 ++- .../Checkout/PaymentAmountUpdateResponse.cs | 576 ++- Adyen/Model/Checkout/PaymentCancelRequest.cs | 249 +- Adyen/Model/Checkout/PaymentCancelResponse.cs | 338 +- Adyen/Model/Checkout/PaymentCaptureRequest.cs | 484 ++- .../Model/Checkout/PaymentCaptureResponse.cs | 551 ++- .../Checkout/PaymentCompletionDetails.cs | 911 +++-- Adyen/Model/Checkout/PaymentDetails.cs | 1106 +++++- Adyen/Model/Checkout/PaymentDetailsRequest.cs | 287 +- .../Model/Checkout/PaymentDetailsResponse.cs | 878 +++-- Adyen/Model/Checkout/PaymentLinkRequest.cs | 1966 +++++++--- Adyen/Model/Checkout/PaymentLinkResponse.cs | 2221 +++++++---- Adyen/Model/Checkout/PaymentMethod.cs | 578 ++- Adyen/Model/Checkout/PaymentMethodGroup.cs | 240 +- Adyen/Model/Checkout/PaymentMethodIssuer.cs | 235 +- Adyen/Model/Checkout/PaymentMethodToStore.cs | 607 +-- Adyen/Model/Checkout/PaymentMethodUPIApps.cs | 194 +- Adyen/Model/Checkout/PaymentMethodsRequest.cs | 921 +++-- .../Model/Checkout/PaymentMethodsResponse.cs | 212 +- Adyen/Model/Checkout/PaymentRefundRequest.cs | 522 ++- Adyen/Model/Checkout/PaymentRefundResponse.cs | 688 ++-- Adyen/Model/Checkout/PaymentRequest.cs | 3347 ++++++++++------ Adyen/Model/Checkout/PaymentResponse.cs | 881 +++-- Adyen/Model/Checkout/PaymentResponseAction.cs | 577 +-- .../Model/Checkout/PaymentReversalRequest.cs | 249 +- .../Model/Checkout/PaymentReversalResponse.cs | 338 +- .../Checkout/PaypalUpdateOrderRequest.cs | 362 +- .../Checkout/PaypalUpdateOrderResponse.cs | 250 +- Adyen/Model/Checkout/Phone.cs | 233 +- Adyen/Model/Checkout/PixDetails.cs | 368 +- Adyen/Model/Checkout/PixRecurring.cs | 544 ++- .../Model/Checkout/PlatformChargebackLogic.cs | 302 +- Adyen/Model/Checkout/PseDetails.cs | 383 +- Adyen/Model/Checkout/RakutenPayDetails.cs | 332 +- Adyen/Model/Checkout/RatepayDetails.cs | 452 ++- Adyen/Model/Checkout/Recurring.cs | 442 ++- .../ResponseAdditionalData3DSecure.cs | 308 +- .../ResponseAdditionalDataBillingAddress.cs | 351 +- .../Checkout/ResponseAdditionalDataCard.cs | 604 ++- .../Checkout/ResponseAdditionalDataCommon.cs | 2718 ++++++++----- .../ResponseAdditionalDataDomesticError.cs | 203 +- .../ResponseAdditionalDataInstallments.cs | 573 ++- .../ResponseAdditionalDataNetworkTokens.cs | 240 +- .../Checkout/ResponseAdditionalDataOpi.cs | 166 +- .../Checkout/ResponseAdditionalDataSepa.cs | 240 +- Adyen/Model/Checkout/ResponsePaymentMethod.cs | 203 +- Adyen/Model/Checkout/RiskData.cs | 281 +- Adyen/Model/Checkout/RivertyDetails.cs | 556 ++- Adyen/Model/Checkout/SDKEphemPubKey.cs | 277 +- Adyen/Model/Checkout/SamsungPayDetails.cs | 464 ++- .../Model/Checkout/SepaDirectDebitDetails.cs | 450 ++- Adyen/Model/Checkout/ServiceError.cs | 349 +- Adyen/Model/Checkout/SessionResultResponse.cs | 392 +- .../Checkout/ShopperInteractionDevice.cs | 240 +- Adyen/Model/Checkout/Split.cs | 510 ++- Adyen/Model/Checkout/SplitAmount.cs | 227 +- .../StandalonePaymentCancelRequest.cs | 279 +- .../StandalonePaymentCancelResponse.cs | 338 +- Adyen/Model/Checkout/StoredPaymentMethod.cs | 766 ++-- .../Checkout/StoredPaymentMethodDetails.cs | 502 ++- .../Checkout/StoredPaymentMethodRequest.cs | 406 +- .../Checkout/StoredPaymentMethodResource.cs | 780 ++-- Adyen/Model/Checkout/SubInputDetail.cs | 355 +- Adyen/Model/Checkout/SubMerchant.cs | 314 +- Adyen/Model/Checkout/SubMerchantInfo.cs | 529 ++- Adyen/Model/Checkout/Surcharge.cs | 160 +- Adyen/Model/Checkout/TaxTotal.cs | 170 +- Adyen/Model/Checkout/ThreeDS2RequestData.cs | 2015 +++++++--- Adyen/Model/Checkout/ThreeDS2RequestFields.cs | 1902 ++++++--- Adyen/Model/Checkout/ThreeDS2ResponseData.cs | 832 ++-- Adyen/Model/Checkout/ThreeDS2Result.cs | 903 +++-- Adyen/Model/Checkout/ThreeDSRequestData.cs | 508 ++- .../ThreeDSRequestorAuthenticationInfo.cs | 352 +- ...ThreeDSRequestorPriorAuthenticationInfo.cs | 381 +- Adyen/Model/Checkout/ThreeDSecureData.cs | 857 +++-- Adyen/Model/Checkout/Ticket.cs | 240 +- Adyen/Model/Checkout/TravelAgency.cs | 203 +- Adyen/Model/Checkout/TwintDetails.cs | 369 +- .../Checkout/UpdatePaymentLinkRequest.cs | 210 +- Adyen/Model/Checkout/UpiCollectDetails.cs | 436 ++- Adyen/Model/Checkout/UpiIntentDetails.cs | 405 +- Adyen/Model/Checkout/UtilityRequest.cs | 167 +- Adyen/Model/Checkout/UtilityResponse.cs | 171 +- Adyen/Model/Checkout/VippsDetails.cs | 373 +- Adyen/Model/Checkout/VisaCheckoutDetails.cs | 370 +- Adyen/Model/Checkout/WeChatPayDetails.cs | 256 +- .../Checkout/WeChatPayMiniProgramDetails.cs | 320 +- Adyen/Model/Checkout/ZipDetails.cs | 379 +- Adyen/Service/Checkout/DonationsService.cs | 1183 +++++- Adyen/Service/Checkout/IApi.cs | 15 + .../Service/Checkout/ModificationsService.cs | 3426 ++++++++++++++++- Adyen/Service/Checkout/OrdersService.cs | 1725 ++++++++- Adyen/Service/Checkout/PaymentLinksService.cs | 1697 +++++++- Adyen/Service/Checkout/PaymentsService.cs | 2686 ++++++++++++- Adyen/Service/Checkout/RecurringService.cs | 1032 ++++- Adyen/Service/Checkout/UtilityService.cs | 1511 +++++++- templates-v7/csharp/ApiClient.v790.mustache | 838 ---- .../csharp/Configuration.v790.mustache | 737 ---- .../IReadableConfiguration.v790.mustache | 178 - templates-v7/csharp/git_push.sh.mustache | 57 - ...sponse`1.mustache => ApiResponse.mustache} | 0 ...mustache => ApiResponseEventArgs.mustache} | 0 .../libraries/generichost/IApi.mustache | 2 +- .../generichost/ModelSignature.mustache | 2 +- ...`1.mustache => RateLimitProvider.mustache} | 0 ...ner`1.mustache => TokenContainer.mustache} | 0 ...ider`1.mustache => TokenProvider.mustache} | 0 .../csharp/libraries/generichost/api.mustache | 16 +- .../generichost/git_push.ps1.mustache | 75 - .../generichost/git_push.sh.mustache | 49 - .../libraries/httpclient/ApiClient.mustache | 792 ---- .../httpclient/FileParameter.mustache | 72 - .../httpclient/RequestOptions.mustache | 66 - .../csharp/libraries/httpclient/api.mustache | 766 ---- .../libraries/httpclient/model.mustache | 51 - 262 files changed, 91048 insertions(+), 43191 deletions(-) create mode 100644 Adyen/Client/ApiException.cs create mode 100644 Adyen/Client/ApiFactory.cs create mode 100644 Adyen/Client/ApiKeyToken.cs create mode 100644 Adyen/Client/ApiResponse.cs create mode 100644 Adyen/Client/ApiResponseEventArgs.cs create mode 100644 Adyen/Client/BasicToken.cs create mode 100644 Adyen/Client/ClientUtils.cs create mode 100644 Adyen/Client/CookieContainer.cs create mode 100644 Adyen/Client/DateTimeJsonConverter.cs create mode 100644 Adyen/Client/DateTimeNullableJsonConverter.cs create mode 100644 Adyen/Client/ExceptionEventArgs.cs create mode 100644 Adyen/Client/HostConfiguration.cs create mode 100644 Adyen/Client/JsonSerializerOptionsProvider.cs create mode 100644 Adyen/Client/Option.cs create mode 100644 Adyen/Client/RateLimitProvider.cs create mode 100644 Adyen/Client/TokenBase.cs create mode 100644 Adyen/Client/TokenContainer.cs create mode 100644 Adyen/Client/TokenProvider.cs delete mode 100644 Adyen/Model/Checkout/AbstractOpenAPISchema.cs create mode 100644 Adyen/Model/Checkout/Payment.cs create mode 100644 Adyen/Service/Checkout/IApi.cs delete mode 100644 templates-v7/csharp/ApiClient.v790.mustache delete mode 100644 templates-v7/csharp/Configuration.v790.mustache delete mode 100644 templates-v7/csharp/IReadableConfiguration.v790.mustache delete mode 100644 templates-v7/csharp/git_push.sh.mustache rename templates-v7/csharp/libraries/generichost/{ApiResponse`1.mustache => ApiResponse.mustache} (100%) rename templates-v7/csharp/libraries/generichost/{ApiResponseEventArgs`1.mustache => ApiResponseEventArgs.mustache} (100%) rename templates-v7/csharp/libraries/generichost/{RateLimitProvider`1.mustache => RateLimitProvider.mustache} (100%) rename templates-v7/csharp/libraries/generichost/{TokenContainer`1.mustache => TokenContainer.mustache} (100%) rename templates-v7/csharp/libraries/generichost/{TokenProvider`1.mustache => TokenProvider.mustache} (100%) delete mode 100644 templates-v7/csharp/libraries/generichost/git_push.ps1.mustache delete mode 100644 templates-v7/csharp/libraries/generichost/git_push.sh.mustache delete mode 100644 templates-v7/csharp/libraries/httpclient/ApiClient.mustache delete mode 100644 templates-v7/csharp/libraries/httpclient/FileParameter.mustache delete mode 100644 templates-v7/csharp/libraries/httpclient/RequestOptions.mustache delete mode 100644 templates-v7/csharp/libraries/httpclient/api.mustache delete mode 100644 templates-v7/csharp/libraries/httpclient/model.mustache diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index 8dccb883d..78b397dfd 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -1,7 +1,7 @@  - net8.0;net6.0;net462;netstandard2.0 + net8.0;net6.0 12 enable disable diff --git a/Adyen/Client/ApiException.cs b/Adyen/Client/ApiException.cs new file mode 100644 index 000000000..de579aba4 --- /dev/null +++ b/Adyen/Client/ApiException.cs @@ -0,0 +1,50 @@ +// +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Adyen.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/Adyen/Client/ApiFactory.cs b/Adyen/Client/ApiFactory.cs new file mode 100644 index 000000000..24e5a92d9 --- /dev/null +++ b/Adyen/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Adyen.Service.Checkout; + +namespace Adyen.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/Adyen/Client/ApiKeyToken.cs b/Adyen/Client/ApiKeyToken.cs new file mode 100644 index 000000000..22707f0f5 --- /dev/null +++ b/Adyen/Client/ApiKeyToken.cs @@ -0,0 +1,52 @@ +// + +using System; + +namespace Adyen.Client +{ + /// + /// A token constructed from an apiKey. + /// + public class ApiKeyToken : TokenBase + { + private string _raw; + + /// + /// The header that this token will be used with. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs an ApiKeyToken object. + /// + /// + /// + /// + /// + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + { + Header = header; + _raw = $"{ prefix }{ value }"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); + } + + /// + /// Places the token in the query. + /// + /// + /// + /// + public virtual void UseInQuery(global::System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) + { + parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(); + } + } +} \ No newline at end of file diff --git a/Adyen/Client/ApiResponse.cs b/Adyen/Client/ApiResponse.cs new file mode 100644 index 000000000..e15791bac --- /dev/null +++ b/Adyen/Client/ApiResponse.cs @@ -0,0 +1,289 @@ +// +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net; + +namespace Adyen.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IBadRequest : IApiResponse + { + /// + /// Deserializes the response if the response is BadRequest + /// + /// + TType BadRequest(); + + /// + /// Returns true if the response is BadRequest and the deserialized response is not null + /// + /// + /// + bool TryBadRequest(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IUnauthorized : IApiResponse + { + /// + /// Deserializes the response if the response is Unauthorized + /// + /// + TType Unauthorized(); + + /// + /// Returns true if the response is Unauthorized and the deserialized response is not null + /// + /// + /// + bool TryUnauthorized(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IForbidden : IApiResponse + { + /// + /// Deserializes the response if the response is Forbidden + /// + /// + TType Forbidden(); + + /// + /// Returns true if the response is Forbidden and the deserialized response is not null + /// + /// + /// + bool TryForbidden(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IUnprocessableContent : IApiResponse + { + /// + /// Deserializes the response if the response is UnprocessableContent + /// + /// + TType UnprocessableContent(); + + /// + /// Returns true if the response is UnprocessableContent and the deserialized response is not null + /// + /// + /// + bool TryUnprocessableContent(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IInternalServerError : IApiResponse + { + /// + /// Deserializes the response if the response is InternalServerError + /// + /// + TType InternalServerError(); + + /// + /// Returns true if the response is InternalServerError and the deserialized response is not null + /// + /// + /// + bool TryInternalServerError(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface ICreated : IApiResponse + { + /// + /// Deserializes the response if the response is Created + /// + /// + TType Created(); + + /// + /// Returns true if the response is Created and the deserialized response is not null + /// + /// + /// + bool TryCreated(out TType result); + } +} diff --git a/Adyen/Client/ApiResponseEventArgs.cs b/Adyen/Client/ApiResponseEventArgs.cs new file mode 100644 index 000000000..0bcd267ab --- /dev/null +++ b/Adyen/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Adyen.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/Adyen/Client/BasicToken.cs b/Adyen/Client/BasicToken.cs new file mode 100644 index 000000000..0fe32b3a9 --- /dev/null +++ b/Adyen/Client/BasicToken.cs @@ -0,0 +1,42 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Adyen.Client +{ + /// + /// A token constructed from a username and password. + /// + public class BasicToken : TokenBase + { + private string _username; + + private string _password; + + /// + /// Constructs a BasicToken object. + /// + /// + /// + /// + public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) + { + _username = username; + + _password = password; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Adyen.Client.ClientUtils.Base64Encode(_username + ":" + _password)); + } + } +} \ No newline at end of file diff --git a/Adyen/Client/ClientUtils.cs b/Adyen/Client/ClientUtils.cs new file mode 100644 index 000000000..1cc1cdf12 --- /dev/null +++ b/Adyen/Client/ClientUtils.cs @@ -0,0 +1,723 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using Adyen.Model.Checkout; +using System.Runtime.CompilerServices; + +namespace Adyen.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// An enum of headers + /// + public enum ApiKeyHeader + { + /// + /// The X-API-Key header + /// + X_API_Key + } + + /// + /// Converte an ApiKeyHeader to a string + /// + /// + /// + /// + public static string ApiKeyHeaderToString(ApiKeyHeader value) + { + switch(value) + { + case ApiKeyHeader.X_API_Key: + return "X-API-Key"; + default: + throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is AccountInfo.AccountAgeIndicatorEnum accountInfoAccountAgeIndicatorEnum) + return AccountInfo.AccountAgeIndicatorEnumToJsonValue(accountInfoAccountAgeIndicatorEnum); + if (obj is AccountInfo.AccountChangeIndicatorEnum accountInfoAccountChangeIndicatorEnum) + return AccountInfo.AccountChangeIndicatorEnumToJsonValue(accountInfoAccountChangeIndicatorEnum); + if (obj is AccountInfo.AccountTypeEnum accountInfoAccountTypeEnum) + return AccountInfo.AccountTypeEnumToJsonValue(accountInfoAccountTypeEnum); + if (obj is AccountInfo.DeliveryAddressUsageIndicatorEnum accountInfoDeliveryAddressUsageIndicatorEnum) + return AccountInfo.DeliveryAddressUsageIndicatorEnumToJsonValue(accountInfoDeliveryAddressUsageIndicatorEnum); + if (obj is AccountInfo.PasswordChangeIndicatorEnum accountInfoPasswordChangeIndicatorEnum) + return AccountInfo.PasswordChangeIndicatorEnumToJsonValue(accountInfoPasswordChangeIndicatorEnum); + if (obj is AccountInfo.PaymentAccountIndicatorEnum accountInfoPaymentAccountIndicatorEnum) + return AccountInfo.PaymentAccountIndicatorEnumToJsonValue(accountInfoPaymentAccountIndicatorEnum); + if (obj is AcctInfo.ChAccAgeIndEnum acctInfoChAccAgeIndEnum) + return AcctInfo.ChAccAgeIndEnumToJsonValue(acctInfoChAccAgeIndEnum); + if (obj is AcctInfo.ChAccChangeIndEnum acctInfoChAccChangeIndEnum) + return AcctInfo.ChAccChangeIndEnumToJsonValue(acctInfoChAccChangeIndEnum); + if (obj is AcctInfo.ChAccPwChangeIndEnum acctInfoChAccPwChangeIndEnum) + return AcctInfo.ChAccPwChangeIndEnumToJsonValue(acctInfoChAccPwChangeIndEnum); + if (obj is AcctInfo.PaymentAccIndEnum acctInfoPaymentAccIndEnum) + return AcctInfo.PaymentAccIndEnumToJsonValue(acctInfoPaymentAccIndEnum); + if (obj is AcctInfo.ShipAddressUsageIndEnum acctInfoShipAddressUsageIndEnum) + return AcctInfo.ShipAddressUsageIndEnumToJsonValue(acctInfoShipAddressUsageIndEnum); + if (obj is AcctInfo.ShipNameIndicatorEnum acctInfoShipNameIndicatorEnum) + return AcctInfo.ShipNameIndicatorEnumToJsonValue(acctInfoShipNameIndicatorEnum); + if (obj is AcctInfo.SuspiciousAccActivityEnum acctInfoSuspiciousAccActivityEnum) + return AcctInfo.SuspiciousAccActivityEnumToJsonValue(acctInfoSuspiciousAccActivityEnum); + if (obj is AchDetails.AccountHolderTypeEnum achDetailsAccountHolderTypeEnum) + return AchDetails.AccountHolderTypeEnumToJsonValue(achDetailsAccountHolderTypeEnum); + if (obj is AchDetails.BankAccountTypeEnum achDetailsBankAccountTypeEnum) + return AchDetails.BankAccountTypeEnumToJsonValue(achDetailsBankAccountTypeEnum); + if (obj is AchDetails.TypeEnum achDetailsTypeEnum) + return AchDetails.TypeEnumToJsonValue(achDetailsTypeEnum); + if (obj is AdditionalData3DSecure.ChallengeWindowSizeEnum additionalData3DSecureChallengeWindowSizeEnum) + return AdditionalData3DSecure.ChallengeWindowSizeEnumToJsonValue(additionalData3DSecureChallengeWindowSizeEnum); + if (obj is AdditionalDataCommon.IndustryUsageEnum additionalDataCommonIndustryUsageEnum) + return AdditionalDataCommon.IndustryUsageEnumToJsonValue(additionalDataCommonIndustryUsageEnum); + if (obj is AffirmDetails.TypeEnum affirmDetailsTypeEnum) + return AffirmDetails.TypeEnumToJsonValue(affirmDetailsTypeEnum); + if (obj is AfterpayDetails.TypeEnum afterpayDetailsTypeEnum) + return AfterpayDetails.TypeEnumToJsonValue(afterpayDetailsTypeEnum); + if (obj is AmazonPayDetails.TypeEnum amazonPayDetailsTypeEnum) + return AmazonPayDetails.TypeEnumToJsonValue(amazonPayDetailsTypeEnum); + if (obj is AncvDetails.TypeEnum ancvDetailsTypeEnum) + return AncvDetails.TypeEnumToJsonValue(ancvDetailsTypeEnum); + if (obj is AndroidPayDetails.TypeEnum androidPayDetailsTypeEnum) + return AndroidPayDetails.TypeEnumToJsonValue(androidPayDetailsTypeEnum); + if (obj is ApplePayDetails.FundingSourceEnum applePayDetailsFundingSourceEnum) + return ApplePayDetails.FundingSourceEnumToJsonValue(applePayDetailsFundingSourceEnum); + if (obj is ApplePayDetails.TypeEnum applePayDetailsTypeEnum) + return ApplePayDetails.TypeEnumToJsonValue(applePayDetailsTypeEnum); + if (obj is ApplePayDonations.FundingSourceEnum applePayDonationsFundingSourceEnum) + return ApplePayDonations.FundingSourceEnumToJsonValue(applePayDonationsFundingSourceEnum); + if (obj is ApplePayDonations.TypeEnum applePayDonationsTypeEnum) + return ApplePayDonations.TypeEnumToJsonValue(applePayDonationsTypeEnum); + if (obj is AuthenticationData.AttemptAuthenticationEnum authenticationDataAttemptAuthenticationEnum) + return AuthenticationData.AttemptAuthenticationEnumToJsonValue(authenticationDataAttemptAuthenticationEnum); + if (obj is BacsDirectDebitDetails.TypeEnum bacsDirectDebitDetailsTypeEnum) + return BacsDirectDebitDetails.TypeEnumToJsonValue(bacsDirectDebitDetailsTypeEnum); + if (obj is BalanceCheckRequest.RecurringProcessingModelEnum balanceCheckRequestRecurringProcessingModelEnum) + return BalanceCheckRequest.RecurringProcessingModelEnumToJsonValue(balanceCheckRequestRecurringProcessingModelEnum); + if (obj is BalanceCheckRequest.ShopperInteractionEnum balanceCheckRequestShopperInteractionEnum) + return BalanceCheckRequest.ShopperInteractionEnumToJsonValue(balanceCheckRequestShopperInteractionEnum); + if (obj is BalanceCheckResponse.ResultCodeEnum balanceCheckResponseResultCodeEnum) + return BalanceCheckResponse.ResultCodeEnumToJsonValue(balanceCheckResponseResultCodeEnum); + if (obj is BillDeskDetails.TypeEnum billDeskDetailsTypeEnum) + return BillDeskDetails.TypeEnumToJsonValue(billDeskDetailsTypeEnum); + if (obj is BlikDetails.TypeEnum blikDetailsTypeEnum) + return BlikDetails.TypeEnumToJsonValue(blikDetailsTypeEnum); + if (obj is CancelOrderResponse.ResultCodeEnum cancelOrderResponseResultCodeEnum) + return CancelOrderResponse.ResultCodeEnumToJsonValue(cancelOrderResponseResultCodeEnum); + if (obj is CardDetails.FundingSourceEnum cardDetailsFundingSourceEnum) + return CardDetails.FundingSourceEnumToJsonValue(cardDetailsFundingSourceEnum); + if (obj is CardDetails.TypeEnum cardDetailsTypeEnum) + return CardDetails.TypeEnumToJsonValue(cardDetailsTypeEnum); + if (obj is CardDonations.FundingSourceEnum cardDonationsFundingSourceEnum) + return CardDonations.FundingSourceEnumToJsonValue(cardDonationsFundingSourceEnum); + if (obj is CardDonations.TypeEnum cardDonationsTypeEnum) + return CardDonations.TypeEnumToJsonValue(cardDonationsTypeEnum); + if (obj is CashAppDetails.TypeEnum cashAppDetailsTypeEnum) + return CashAppDetails.TypeEnumToJsonValue(cashAppDetailsTypeEnum); + if (obj is CellulantDetails.TypeEnum cellulantDetailsTypeEnum) + return CellulantDetails.TypeEnumToJsonValue(cellulantDetailsTypeEnum); + if (obj is CheckoutAwaitAction.TypeEnum checkoutAwaitActionTypeEnum) + return CheckoutAwaitAction.TypeEnumToJsonValue(checkoutAwaitActionTypeEnum); + if (obj is CheckoutBankAccount.AccountTypeEnum checkoutBankAccountAccountTypeEnum) + return CheckoutBankAccount.AccountTypeEnumToJsonValue(checkoutBankAccountAccountTypeEnum); + if (obj is CheckoutBankTransferAction.TypeEnum checkoutBankTransferActionTypeEnum) + return CheckoutBankTransferAction.TypeEnumToJsonValue(checkoutBankTransferActionTypeEnum); + if (obj is CheckoutDelegatedAuthenticationAction.TypeEnum checkoutDelegatedAuthenticationActionTypeEnum) + return CheckoutDelegatedAuthenticationAction.TypeEnumToJsonValue(checkoutDelegatedAuthenticationActionTypeEnum); + if (obj is CheckoutNativeRedirectAction.TypeEnum checkoutNativeRedirectActionTypeEnum) + return CheckoutNativeRedirectAction.TypeEnumToJsonValue(checkoutNativeRedirectActionTypeEnum); + if (obj is CheckoutQrCodeAction.TypeEnum checkoutQrCodeActionTypeEnum) + return CheckoutQrCodeAction.TypeEnumToJsonValue(checkoutQrCodeActionTypeEnum); + if (obj is CheckoutRedirectAction.TypeEnum checkoutRedirectActionTypeEnum) + return CheckoutRedirectAction.TypeEnumToJsonValue(checkoutRedirectActionTypeEnum); + if (obj is CheckoutSDKAction.TypeEnum checkoutSDKActionTypeEnum) + return CheckoutSDKAction.TypeEnumToJsonValue(checkoutSDKActionTypeEnum); + if (obj is CheckoutSessionInstallmentOption.PlansEnum checkoutSessionInstallmentOptionPlansEnum) + return CheckoutSessionInstallmentOption.PlansEnumToJsonValue(checkoutSessionInstallmentOptionPlansEnum); + if (obj is CheckoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndEnum checkoutSessionThreeDS2RequestDataThreeDSRequestorChallengeIndEnum) + return CheckoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumToJsonValue(checkoutSessionThreeDS2RequestDataThreeDSRequestorChallengeIndEnum); + if (obj is CheckoutThreeDS2Action.TypeEnum checkoutThreeDS2ActionTypeEnum) + return CheckoutThreeDS2Action.TypeEnumToJsonValue(checkoutThreeDS2ActionTypeEnum); + if (obj is CheckoutVoucherAction.TypeEnum checkoutVoucherActionTypeEnum) + return CheckoutVoucherAction.TypeEnumToJsonValue(checkoutVoucherActionTypeEnum); + if (obj is CreateCheckoutSessionRequest.ChannelEnum createCheckoutSessionRequestChannelEnum) + return CreateCheckoutSessionRequest.ChannelEnumToJsonValue(createCheckoutSessionRequestChannelEnum); + if (obj is CreateCheckoutSessionRequest.ModeEnum createCheckoutSessionRequestModeEnum) + return CreateCheckoutSessionRequest.ModeEnumToJsonValue(createCheckoutSessionRequestModeEnum); + if (obj is CreateCheckoutSessionRequest.RecurringProcessingModelEnum createCheckoutSessionRequestRecurringProcessingModelEnum) + return CreateCheckoutSessionRequest.RecurringProcessingModelEnumToJsonValue(createCheckoutSessionRequestRecurringProcessingModelEnum); + if (obj is CreateCheckoutSessionRequest.ShopperInteractionEnum createCheckoutSessionRequestShopperInteractionEnum) + return CreateCheckoutSessionRequest.ShopperInteractionEnumToJsonValue(createCheckoutSessionRequestShopperInteractionEnum); + if (obj is CreateCheckoutSessionRequest.StoreFiltrationModeEnum createCheckoutSessionRequestStoreFiltrationModeEnum) + return CreateCheckoutSessionRequest.StoreFiltrationModeEnumToJsonValue(createCheckoutSessionRequestStoreFiltrationModeEnum); + if (obj is CreateCheckoutSessionRequest.StorePaymentMethodModeEnum createCheckoutSessionRequestStorePaymentMethodModeEnum) + return CreateCheckoutSessionRequest.StorePaymentMethodModeEnumToJsonValue(createCheckoutSessionRequestStorePaymentMethodModeEnum); + if (obj is CreateCheckoutSessionResponse.ChannelEnum createCheckoutSessionResponseChannelEnum) + return CreateCheckoutSessionResponse.ChannelEnumToJsonValue(createCheckoutSessionResponseChannelEnum); + if (obj is CreateCheckoutSessionResponse.ModeEnum createCheckoutSessionResponseModeEnum) + return CreateCheckoutSessionResponse.ModeEnumToJsonValue(createCheckoutSessionResponseModeEnum); + if (obj is CreateCheckoutSessionResponse.RecurringProcessingModelEnum createCheckoutSessionResponseRecurringProcessingModelEnum) + return CreateCheckoutSessionResponse.RecurringProcessingModelEnumToJsonValue(createCheckoutSessionResponseRecurringProcessingModelEnum); + if (obj is CreateCheckoutSessionResponse.ShopperInteractionEnum createCheckoutSessionResponseShopperInteractionEnum) + return CreateCheckoutSessionResponse.ShopperInteractionEnumToJsonValue(createCheckoutSessionResponseShopperInteractionEnum); + if (obj is CreateCheckoutSessionResponse.StoreFiltrationModeEnum createCheckoutSessionResponseStoreFiltrationModeEnum) + return CreateCheckoutSessionResponse.StoreFiltrationModeEnumToJsonValue(createCheckoutSessionResponseStoreFiltrationModeEnum); + if (obj is CreateCheckoutSessionResponse.StorePaymentMethodModeEnum createCheckoutSessionResponseStorePaymentMethodModeEnum) + return CreateCheckoutSessionResponse.StorePaymentMethodModeEnumToJsonValue(createCheckoutSessionResponseStorePaymentMethodModeEnum); + if (obj is CreateOrderResponse.ResultCodeEnum createOrderResponseResultCodeEnum) + return CreateOrderResponse.ResultCodeEnumToJsonValue(createOrderResponseResultCodeEnum); + if (obj is DeliveryMethod.TypeEnum deliveryMethodTypeEnum) + return DeliveryMethod.TypeEnumToJsonValue(deliveryMethodTypeEnum); + if (obj is DeviceRenderOptions.SdkInterfaceEnum deviceRenderOptionsSdkInterfaceEnum) + return DeviceRenderOptions.SdkInterfaceEnumToJsonValue(deviceRenderOptionsSdkInterfaceEnum); + if (obj is DeviceRenderOptions.SdkUiTypeEnum deviceRenderOptionsSdkUiTypeEnum) + return DeviceRenderOptions.SdkUiTypeEnumToJsonValue(deviceRenderOptionsSdkUiTypeEnum); + if (obj is DokuDetails.TypeEnum dokuDetailsTypeEnum) + return DokuDetails.TypeEnumToJsonValue(dokuDetailsTypeEnum); + if (obj is DonationPaymentRequest.ChannelEnum donationPaymentRequestChannelEnum) + return DonationPaymentRequest.ChannelEnumToJsonValue(donationPaymentRequestChannelEnum); + if (obj is DonationPaymentRequest.RecurringProcessingModelEnum donationPaymentRequestRecurringProcessingModelEnum) + return DonationPaymentRequest.RecurringProcessingModelEnumToJsonValue(donationPaymentRequestRecurringProcessingModelEnum); + if (obj is DonationPaymentRequest.ShopperInteractionEnum donationPaymentRequestShopperInteractionEnum) + return DonationPaymentRequest.ShopperInteractionEnumToJsonValue(donationPaymentRequestShopperInteractionEnum); + if (obj is DonationPaymentResponse.StatusEnum donationPaymentResponseStatusEnum) + return DonationPaymentResponse.StatusEnumToJsonValue(donationPaymentResponseStatusEnum); + if (obj is DragonpayDetails.TypeEnum dragonpayDetailsTypeEnum) + return DragonpayDetails.TypeEnumToJsonValue(dragonpayDetailsTypeEnum); + if (obj is EBankingFinlandDetails.TypeEnum eBankingFinlandDetailsTypeEnum) + return EBankingFinlandDetails.TypeEnumToJsonValue(eBankingFinlandDetailsTypeEnum); + if (obj is EcontextVoucherDetails.TypeEnum econtextVoucherDetailsTypeEnum) + return EcontextVoucherDetails.TypeEnumToJsonValue(econtextVoucherDetailsTypeEnum); + if (obj is EftDetails.TypeEnum eftDetailsTypeEnum) + return EftDetails.TypeEnumToJsonValue(eftDetailsTypeEnum); + if (obj is FastlaneDetails.TypeEnum fastlaneDetailsTypeEnum) + return FastlaneDetails.TypeEnumToJsonValue(fastlaneDetailsTypeEnum); + if (obj is FundRecipient.WalletPurposeEnum fundRecipientWalletPurposeEnum) + return FundRecipient.WalletPurposeEnumToJsonValue(fundRecipientWalletPurposeEnum); + if (obj is GenericIssuerPaymentMethodDetails.TypeEnum genericIssuerPaymentMethodDetailsTypeEnum) + return GenericIssuerPaymentMethodDetails.TypeEnumToJsonValue(genericIssuerPaymentMethodDetailsTypeEnum); + if (obj is GooglePayDetails.FundingSourceEnum googlePayDetailsFundingSourceEnum) + return GooglePayDetails.FundingSourceEnumToJsonValue(googlePayDetailsFundingSourceEnum); + if (obj is GooglePayDetails.TypeEnum googlePayDetailsTypeEnum) + return GooglePayDetails.TypeEnumToJsonValue(googlePayDetailsTypeEnum); + if (obj is GooglePayDonations.FundingSourceEnum googlePayDonationsFundingSourceEnum) + return GooglePayDonations.FundingSourceEnumToJsonValue(googlePayDonationsFundingSourceEnum); + if (obj is GooglePayDonations.TypeEnum googlePayDonationsTypeEnum) + return GooglePayDonations.TypeEnumToJsonValue(googlePayDonationsTypeEnum); + if (obj is IdealDetails.TypeEnum idealDetailsTypeEnum) + return IdealDetails.TypeEnumToJsonValue(idealDetailsTypeEnum); + if (obj is IdealDonations.TypeEnum idealDonationsTypeEnum) + return IdealDonations.TypeEnumToJsonValue(idealDonationsTypeEnum); + if (obj is InstallmentOption.PlansEnum installmentOptionPlansEnum) + return InstallmentOption.PlansEnumToJsonValue(installmentOptionPlansEnum); + if (obj is Installments.PlanEnum installmentsPlanEnum) + return Installments.PlanEnumToJsonValue(installmentsPlanEnum); + if (obj is KlarnaDetails.TypeEnum klarnaDetailsTypeEnum) + return KlarnaDetails.TypeEnumToJsonValue(klarnaDetailsTypeEnum); + if (obj is Mandate.FrequencyEnum mandateFrequencyEnum) + return Mandate.FrequencyEnumToJsonValue(mandateFrequencyEnum); + if (obj is Mandate.AmountRuleEnum mandateAmountRuleEnum) + return Mandate.AmountRuleEnumToJsonValue(mandateAmountRuleEnum); + if (obj is Mandate.BillingAttemptsRuleEnum mandateBillingAttemptsRuleEnum) + return Mandate.BillingAttemptsRuleEnumToJsonValue(mandateBillingAttemptsRuleEnum); + if (obj is MasterpassDetails.FundingSourceEnum masterpassDetailsFundingSourceEnum) + return MasterpassDetails.FundingSourceEnumToJsonValue(masterpassDetailsFundingSourceEnum); + if (obj is MasterpassDetails.TypeEnum masterpassDetailsTypeEnum) + return MasterpassDetails.TypeEnumToJsonValue(masterpassDetailsTypeEnum); + if (obj is MbwayDetails.TypeEnum mbwayDetailsTypeEnum) + return MbwayDetails.TypeEnumToJsonValue(mbwayDetailsTypeEnum); + if (obj is MerchantRiskIndicator.DeliveryAddressIndicatorEnum merchantRiskIndicatorDeliveryAddressIndicatorEnum) + return MerchantRiskIndicator.DeliveryAddressIndicatorEnumToJsonValue(merchantRiskIndicatorDeliveryAddressIndicatorEnum); + if (obj is MerchantRiskIndicator.DeliveryTimeframeEnum merchantRiskIndicatorDeliveryTimeframeEnum) + return MerchantRiskIndicator.DeliveryTimeframeEnumToJsonValue(merchantRiskIndicatorDeliveryTimeframeEnum); + if (obj is MobilePayDetails.TypeEnum mobilePayDetailsTypeEnum) + return MobilePayDetails.TypeEnumToJsonValue(mobilePayDetailsTypeEnum); + if (obj is MolPayDetails.TypeEnum molPayDetailsTypeEnum) + return MolPayDetails.TypeEnumToJsonValue(molPayDetailsTypeEnum); + if (obj is OpenInvoiceDetails.TypeEnum openInvoiceDetailsTypeEnum) + return OpenInvoiceDetails.TypeEnumToJsonValue(openInvoiceDetailsTypeEnum); + if (obj is PayByBankAISDirectDebitDetails.TypeEnum payByBankAISDirectDebitDetailsTypeEnum) + return PayByBankAISDirectDebitDetails.TypeEnumToJsonValue(payByBankAISDirectDebitDetailsTypeEnum); + if (obj is PayByBankDetails.TypeEnum payByBankDetailsTypeEnum) + return PayByBankDetails.TypeEnumToJsonValue(payByBankDetailsTypeEnum); + if (obj is PayPalDetails.SubtypeEnum payPalDetailsSubtypeEnum) + return PayPalDetails.SubtypeEnumToJsonValue(payPalDetailsSubtypeEnum); + if (obj is PayPalDetails.TypeEnum payPalDetailsTypeEnum) + return PayPalDetails.TypeEnumToJsonValue(payPalDetailsTypeEnum); + if (obj is PayPayDetails.TypeEnum payPayDetailsTypeEnum) + return PayPayDetails.TypeEnumToJsonValue(payPayDetailsTypeEnum); + if (obj is PayToDetails.TypeEnum payToDetailsTypeEnum) + return PayToDetails.TypeEnumToJsonValue(payToDetailsTypeEnum); + if (obj is PayUUpiDetails.TypeEnum payUUpiDetailsTypeEnum) + return PayUUpiDetails.TypeEnumToJsonValue(payUUpiDetailsTypeEnum); + if (obj is PayWithGoogleDetails.FundingSourceEnum payWithGoogleDetailsFundingSourceEnum) + return PayWithGoogleDetails.FundingSourceEnumToJsonValue(payWithGoogleDetailsFundingSourceEnum); + if (obj is PayWithGoogleDetails.TypeEnum payWithGoogleDetailsTypeEnum) + return PayWithGoogleDetails.TypeEnumToJsonValue(payWithGoogleDetailsTypeEnum); + if (obj is PayWithGoogleDonations.FundingSourceEnum payWithGoogleDonationsFundingSourceEnum) + return PayWithGoogleDonations.FundingSourceEnumToJsonValue(payWithGoogleDonationsFundingSourceEnum); + if (obj is PayWithGoogleDonations.TypeEnum payWithGoogleDonationsTypeEnum) + return PayWithGoogleDonations.TypeEnumToJsonValue(payWithGoogleDonationsTypeEnum); + if (obj is Payment.ResultCodeEnum paymentResultCodeEnum) + return Payment.ResultCodeEnumToJsonValue(paymentResultCodeEnum); + if (obj is PaymentAmountUpdateRequest.IndustryUsageEnum paymentAmountUpdateRequestIndustryUsageEnum) + return PaymentAmountUpdateRequest.IndustryUsageEnumToJsonValue(paymentAmountUpdateRequestIndustryUsageEnum); + if (obj is PaymentAmountUpdateResponse.StatusEnum paymentAmountUpdateResponseStatusEnum) + return PaymentAmountUpdateResponse.StatusEnumToJsonValue(paymentAmountUpdateResponseStatusEnum); + if (obj is PaymentAmountUpdateResponse.IndustryUsageEnum paymentAmountUpdateResponseIndustryUsageEnum) + return PaymentAmountUpdateResponse.IndustryUsageEnumToJsonValue(paymentAmountUpdateResponseIndustryUsageEnum); + if (obj is PaymentCancelResponse.StatusEnum paymentCancelResponseStatusEnum) + return PaymentCancelResponse.StatusEnumToJsonValue(paymentCancelResponseStatusEnum); + if (obj is PaymentCaptureResponse.StatusEnum paymentCaptureResponseStatusEnum) + return PaymentCaptureResponse.StatusEnumToJsonValue(paymentCaptureResponseStatusEnum); + if (obj is PaymentDetails.TypeEnum paymentDetailsTypeEnum) + return PaymentDetails.TypeEnumToJsonValue(paymentDetailsTypeEnum); + if (obj is PaymentDetailsResponse.ResultCodeEnum paymentDetailsResponseResultCodeEnum) + return PaymentDetailsResponse.ResultCodeEnumToJsonValue(paymentDetailsResponseResultCodeEnum); + if (obj is PaymentLinkRequest.RecurringProcessingModelEnum paymentLinkRequestRecurringProcessingModelEnum) + return PaymentLinkRequest.RecurringProcessingModelEnumToJsonValue(paymentLinkRequestRecurringProcessingModelEnum); + if (obj is PaymentLinkRequest.RequiredShopperFieldsEnum paymentLinkRequestRequiredShopperFieldsEnum) + return PaymentLinkRequest.RequiredShopperFieldsEnumToJsonValue(paymentLinkRequestRequiredShopperFieldsEnum); + if (obj is PaymentLinkRequest.StorePaymentMethodModeEnum paymentLinkRequestStorePaymentMethodModeEnum) + return PaymentLinkRequest.StorePaymentMethodModeEnumToJsonValue(paymentLinkRequestStorePaymentMethodModeEnum); + if (obj is PaymentLinkResponse.StatusEnum paymentLinkResponseStatusEnum) + return PaymentLinkResponse.StatusEnumToJsonValue(paymentLinkResponseStatusEnum); + if (obj is PaymentLinkResponse.RecurringProcessingModelEnum paymentLinkResponseRecurringProcessingModelEnum) + return PaymentLinkResponse.RecurringProcessingModelEnumToJsonValue(paymentLinkResponseRecurringProcessingModelEnum); + if (obj is PaymentLinkResponse.RequiredShopperFieldsEnum paymentLinkResponseRequiredShopperFieldsEnum) + return PaymentLinkResponse.RequiredShopperFieldsEnumToJsonValue(paymentLinkResponseRequiredShopperFieldsEnum); + if (obj is PaymentLinkResponse.StorePaymentMethodModeEnum paymentLinkResponseStorePaymentMethodModeEnum) + return PaymentLinkResponse.StorePaymentMethodModeEnumToJsonValue(paymentLinkResponseStorePaymentMethodModeEnum); + if (obj is PaymentMethod.FundingSourceEnum paymentMethodFundingSourceEnum) + return PaymentMethod.FundingSourceEnumToJsonValue(paymentMethodFundingSourceEnum); + if (obj is PaymentMethodsRequest.ChannelEnum paymentMethodsRequestChannelEnum) + return PaymentMethodsRequest.ChannelEnumToJsonValue(paymentMethodsRequestChannelEnum); + if (obj is PaymentMethodsRequest.StoreFiltrationModeEnum paymentMethodsRequestStoreFiltrationModeEnum) + return PaymentMethodsRequest.StoreFiltrationModeEnumToJsonValue(paymentMethodsRequestStoreFiltrationModeEnum); + if (obj is PaymentRefundRequest.MerchantRefundReasonEnum paymentRefundRequestMerchantRefundReasonEnum) + return PaymentRefundRequest.MerchantRefundReasonEnumToJsonValue(paymentRefundRequestMerchantRefundReasonEnum); + if (obj is PaymentRefundResponse.StatusEnum paymentRefundResponseStatusEnum) + return PaymentRefundResponse.StatusEnumToJsonValue(paymentRefundResponseStatusEnum); + if (obj is PaymentRefundResponse.MerchantRefundReasonEnum paymentRefundResponseMerchantRefundReasonEnum) + return PaymentRefundResponse.MerchantRefundReasonEnumToJsonValue(paymentRefundResponseMerchantRefundReasonEnum); + if (obj is PaymentRequest.ChannelEnum paymentRequestChannelEnum) + return PaymentRequest.ChannelEnumToJsonValue(paymentRequestChannelEnum); + if (obj is PaymentRequest.EntityTypeEnum paymentRequestEntityTypeEnum) + return PaymentRequest.EntityTypeEnumToJsonValue(paymentRequestEntityTypeEnum); + if (obj is PaymentRequest.IndustryUsageEnum paymentRequestIndustryUsageEnum) + return PaymentRequest.IndustryUsageEnumToJsonValue(paymentRequestIndustryUsageEnum); + if (obj is PaymentRequest.RecurringProcessingModelEnum paymentRequestRecurringProcessingModelEnum) + return PaymentRequest.RecurringProcessingModelEnumToJsonValue(paymentRequestRecurringProcessingModelEnum); + if (obj is PaymentRequest.ShopperInteractionEnum paymentRequestShopperInteractionEnum) + return PaymentRequest.ShopperInteractionEnumToJsonValue(paymentRequestShopperInteractionEnum); + if (obj is PaymentResponse.ResultCodeEnum paymentResponseResultCodeEnum) + return PaymentResponse.ResultCodeEnumToJsonValue(paymentResponseResultCodeEnum); + if (obj is PaymentReversalResponse.StatusEnum paymentReversalResponseStatusEnum) + return PaymentReversalResponse.StatusEnumToJsonValue(paymentReversalResponseStatusEnum); + if (obj is PaypalUpdateOrderResponse.StatusEnum paypalUpdateOrderResponseStatusEnum) + return PaypalUpdateOrderResponse.StatusEnumToJsonValue(paypalUpdateOrderResponseStatusEnum); + if (obj is PixDetails.TypeEnum pixDetailsTypeEnum) + return PixDetails.TypeEnumToJsonValue(pixDetailsTypeEnum); + if (obj is PixRecurring.FrequencyEnum pixRecurringFrequencyEnum) + return PixRecurring.FrequencyEnumToJsonValue(pixRecurringFrequencyEnum); + if (obj is PlatformChargebackLogic.BehaviorEnum platformChargebackLogicBehaviorEnum) + return PlatformChargebackLogic.BehaviorEnumToJsonValue(platformChargebackLogicBehaviorEnum); + if (obj is PseDetails.TypeEnum pseDetailsTypeEnum) + return PseDetails.TypeEnumToJsonValue(pseDetailsTypeEnum); + if (obj is RakutenPayDetails.TypeEnum rakutenPayDetailsTypeEnum) + return RakutenPayDetails.TypeEnumToJsonValue(rakutenPayDetailsTypeEnum); + if (obj is RatepayDetails.TypeEnum ratepayDetailsTypeEnum) + return RatepayDetails.TypeEnumToJsonValue(ratepayDetailsTypeEnum); + if (obj is Recurring.ContractEnum recurringContractEnum) + return Recurring.ContractEnumToJsonValue(recurringContractEnum); + if (obj is Recurring.TokenServiceEnum recurringTokenServiceEnum) + return Recurring.TokenServiceEnumToJsonValue(recurringTokenServiceEnum); + if (obj is ResponseAdditionalDataCard.CardProductIdEnum responseAdditionalDataCardCardProductIdEnum) + return ResponseAdditionalDataCard.CardProductIdEnumToJsonValue(responseAdditionalDataCardCardProductIdEnum); + if (obj is ResponseAdditionalDataCommon.FraudResultTypeEnum responseAdditionalDataCommonFraudResultTypeEnum) + return ResponseAdditionalDataCommon.FraudResultTypeEnumToJsonValue(responseAdditionalDataCommonFraudResultTypeEnum); + if (obj is ResponseAdditionalDataCommon.FraudRiskLevelEnum responseAdditionalDataCommonFraudRiskLevelEnum) + return ResponseAdditionalDataCommon.FraudRiskLevelEnumToJsonValue(responseAdditionalDataCommonFraudRiskLevelEnum); + if (obj is ResponseAdditionalDataCommon.RecurringProcessingModelEnum responseAdditionalDataCommonRecurringProcessingModelEnum) + return ResponseAdditionalDataCommon.RecurringProcessingModelEnumToJsonValue(responseAdditionalDataCommonRecurringProcessingModelEnum); + if (obj is ResponseAdditionalDataCommon.TokenizationStoreOperationTypeEnum responseAdditionalDataCommonTokenizationStoreOperationTypeEnum) + return ResponseAdditionalDataCommon.TokenizationStoreOperationTypeEnumToJsonValue(responseAdditionalDataCommonTokenizationStoreOperationTypeEnum); + if (obj is RivertyDetails.TypeEnum rivertyDetailsTypeEnum) + return RivertyDetails.TypeEnumToJsonValue(rivertyDetailsTypeEnum); + if (obj is SamsungPayDetails.FundingSourceEnum samsungPayDetailsFundingSourceEnum) + return SamsungPayDetails.FundingSourceEnumToJsonValue(samsungPayDetailsFundingSourceEnum); + if (obj is SamsungPayDetails.TypeEnum samsungPayDetailsTypeEnum) + return SamsungPayDetails.TypeEnumToJsonValue(samsungPayDetailsTypeEnum); + if (obj is SepaDirectDebitDetails.TypeEnum sepaDirectDebitDetailsTypeEnum) + return SepaDirectDebitDetails.TypeEnumToJsonValue(sepaDirectDebitDetailsTypeEnum); + if (obj is SessionResultResponse.StatusEnum sessionResultResponseStatusEnum) + return SessionResultResponse.StatusEnumToJsonValue(sessionResultResponseStatusEnum); + if (obj is Split.TypeEnum splitTypeEnum) + return Split.TypeEnumToJsonValue(splitTypeEnum); + if (obj is StandalonePaymentCancelResponse.StatusEnum standalonePaymentCancelResponseStatusEnum) + return StandalonePaymentCancelResponse.StatusEnumToJsonValue(standalonePaymentCancelResponseStatusEnum); + if (obj is StoredPaymentMethodDetails.TypeEnum storedPaymentMethodDetailsTypeEnum) + return StoredPaymentMethodDetails.TypeEnumToJsonValue(storedPaymentMethodDetailsTypeEnum); + if (obj is StoredPaymentMethodRequest.RecurringProcessingModelEnum storedPaymentMethodRequestRecurringProcessingModelEnum) + return StoredPaymentMethodRequest.RecurringProcessingModelEnumToJsonValue(storedPaymentMethodRequestRecurringProcessingModelEnum); + if (obj is ThreeDS2RequestData.AcctTypeEnum threeDS2RequestDataAcctTypeEnum) + return ThreeDS2RequestData.AcctTypeEnumToJsonValue(threeDS2RequestDataAcctTypeEnum); + if (obj is ThreeDS2RequestData.AddrMatchEnum threeDS2RequestDataAddrMatchEnum) + return ThreeDS2RequestData.AddrMatchEnumToJsonValue(threeDS2RequestDataAddrMatchEnum); + if (obj is ThreeDS2RequestData.ChallengeIndicatorEnum threeDS2RequestDataChallengeIndicatorEnum) + return ThreeDS2RequestData.ChallengeIndicatorEnumToJsonValue(threeDS2RequestDataChallengeIndicatorEnum); + if (obj is ThreeDS2RequestData.ThreeDSRequestorChallengeIndEnum threeDS2RequestDataThreeDSRequestorChallengeIndEnum) + return ThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2RequestDataThreeDSRequestorChallengeIndEnum); + if (obj is ThreeDS2RequestData.TransTypeEnum threeDS2RequestDataTransTypeEnum) + return ThreeDS2RequestData.TransTypeEnumToJsonValue(threeDS2RequestDataTransTypeEnum); + if (obj is ThreeDS2RequestData.TransactionTypeEnum threeDS2RequestDataTransactionTypeEnum) + return ThreeDS2RequestData.TransactionTypeEnumToJsonValue(threeDS2RequestDataTransactionTypeEnum); + if (obj is ThreeDS2RequestFields.AcctTypeEnum threeDS2RequestFieldsAcctTypeEnum) + return ThreeDS2RequestFields.AcctTypeEnumToJsonValue(threeDS2RequestFieldsAcctTypeEnum); + if (obj is ThreeDS2RequestFields.AddrMatchEnum threeDS2RequestFieldsAddrMatchEnum) + return ThreeDS2RequestFields.AddrMatchEnumToJsonValue(threeDS2RequestFieldsAddrMatchEnum); + if (obj is ThreeDS2RequestFields.ChallengeIndicatorEnum threeDS2RequestFieldsChallengeIndicatorEnum) + return ThreeDS2RequestFields.ChallengeIndicatorEnumToJsonValue(threeDS2RequestFieldsChallengeIndicatorEnum); + if (obj is ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnum threeDS2RequestFieldsThreeDSRequestorChallengeIndEnum) + return ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2RequestFieldsThreeDSRequestorChallengeIndEnum); + if (obj is ThreeDS2RequestFields.TransTypeEnum threeDS2RequestFieldsTransTypeEnum) + return ThreeDS2RequestFields.TransTypeEnumToJsonValue(threeDS2RequestFieldsTransTypeEnum); + if (obj is ThreeDS2RequestFields.TransactionTypeEnum threeDS2RequestFieldsTransactionTypeEnum) + return ThreeDS2RequestFields.TransactionTypeEnumToJsonValue(threeDS2RequestFieldsTransactionTypeEnum); + if (obj is ThreeDS2Result.ChallengeCancelEnum threeDS2ResultChallengeCancelEnum) + return ThreeDS2Result.ChallengeCancelEnumToJsonValue(threeDS2ResultChallengeCancelEnum); + if (obj is ThreeDS2Result.ExemptionIndicatorEnum threeDS2ResultExemptionIndicatorEnum) + return ThreeDS2Result.ExemptionIndicatorEnumToJsonValue(threeDS2ResultExemptionIndicatorEnum); + if (obj is ThreeDS2Result.ThreeDSRequestorChallengeIndEnum threeDS2ResultThreeDSRequestorChallengeIndEnum) + return ThreeDS2Result.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2ResultThreeDSRequestorChallengeIndEnum); + if (obj is ThreeDSRequestData.ChallengeWindowSizeEnum threeDSRequestDataChallengeWindowSizeEnum) + return ThreeDSRequestData.ChallengeWindowSizeEnumToJsonValue(threeDSRequestDataChallengeWindowSizeEnum); + if (obj is ThreeDSRequestData.DataOnlyEnum threeDSRequestDataDataOnlyEnum) + return ThreeDSRequestData.DataOnlyEnumToJsonValue(threeDSRequestDataDataOnlyEnum); + if (obj is ThreeDSRequestData.NativeThreeDSEnum threeDSRequestDataNativeThreeDSEnum) + return ThreeDSRequestData.NativeThreeDSEnumToJsonValue(threeDSRequestDataNativeThreeDSEnum); + if (obj is ThreeDSRequestData.ThreeDSVersionEnum threeDSRequestDataThreeDSVersionEnum) + return ThreeDSRequestData.ThreeDSVersionEnumToJsonValue(threeDSRequestDataThreeDSVersionEnum); + if (obj is ThreeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodEnum threeDSRequestorAuthenticationInfoThreeDSReqAuthMethodEnum) + return ThreeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodEnumToJsonValue(threeDSRequestorAuthenticationInfoThreeDSReqAuthMethodEnum); + if (obj is ThreeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodEnum threeDSRequestorPriorAuthenticationInfoThreeDSReqPriorAuthMethodEnum) + return ThreeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodEnumToJsonValue(threeDSRequestorPriorAuthenticationInfoThreeDSReqPriorAuthMethodEnum); + if (obj is ThreeDSecureData.AuthenticationResponseEnum threeDSecureDataAuthenticationResponseEnum) + return ThreeDSecureData.AuthenticationResponseEnumToJsonValue(threeDSecureDataAuthenticationResponseEnum); + if (obj is ThreeDSecureData.ChallengeCancelEnum threeDSecureDataChallengeCancelEnum) + return ThreeDSecureData.ChallengeCancelEnumToJsonValue(threeDSecureDataChallengeCancelEnum); + if (obj is ThreeDSecureData.DirectoryResponseEnum threeDSecureDataDirectoryResponseEnum) + return ThreeDSecureData.DirectoryResponseEnumToJsonValue(threeDSecureDataDirectoryResponseEnum); + if (obj is TwintDetails.TypeEnum twintDetailsTypeEnum) + return TwintDetails.TypeEnumToJsonValue(twintDetailsTypeEnum); + if (obj is UpdatePaymentLinkRequest.StatusEnum updatePaymentLinkRequestStatusEnum) + return UpdatePaymentLinkRequest.StatusEnumToJsonValue(updatePaymentLinkRequestStatusEnum); + if (obj is UpiCollectDetails.TypeEnum upiCollectDetailsTypeEnum) + return UpiCollectDetails.TypeEnumToJsonValue(upiCollectDetailsTypeEnum); + if (obj is UpiIntentDetails.TypeEnum upiIntentDetailsTypeEnum) + return UpiIntentDetails.TypeEnumToJsonValue(upiIntentDetailsTypeEnum); + if (obj is VippsDetails.TypeEnum vippsDetailsTypeEnum) + return VippsDetails.TypeEnumToJsonValue(vippsDetailsTypeEnum); + if (obj is VisaCheckoutDetails.FundingSourceEnum visaCheckoutDetailsFundingSourceEnum) + return VisaCheckoutDetails.FundingSourceEnumToJsonValue(visaCheckoutDetailsFundingSourceEnum); + if (obj is VisaCheckoutDetails.TypeEnum visaCheckoutDetailsTypeEnum) + return VisaCheckoutDetails.TypeEnumToJsonValue(visaCheckoutDetailsTypeEnum); + if (obj is WeChatPayDetails.TypeEnum weChatPayDetailsTypeEnum) + return WeChatPayDetails.TypeEnumToJsonValue(weChatPayDetailsTypeEnum); + if (obj is WeChatPayMiniProgramDetails.TypeEnum weChatPayMiniProgramDetailsTypeEnum) + return WeChatPayMiniProgramDetails.TypeEnumToJsonValue(weChatPayMiniProgramDetailsTypeEnum); + if (obj is ZipDetails.TypeEnum zipDetailsTypeEnum) + return ZipDetails.TypeEnumToJsonValue(zipDetailsTypeEnum); + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + private static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + + /// + /// The base path of the API + /// + public const string BASE_ADDRESS = "https://checkout-test.adyen.com/v71"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "https"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = "/v71"; + + /// + /// The host of the API + /// + public const string HOST = "checkout-test.adyen.com"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/Adyen/Client/CookieContainer.cs b/Adyen/Client/CookieContainer.cs new file mode 100644 index 000000000..b129934b7 --- /dev/null +++ b/Adyen/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Adyen.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/Adyen/Client/DateTimeJsonConverter.cs b/Adyen/Client/DateTimeJsonConverter.cs new file mode 100644 index 000000000..c76102996 --- /dev/null +++ b/Adyen/Client/DateTimeJsonConverter.cs @@ -0,0 +1,77 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Adyen.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/Adyen/Client/DateTimeNullableJsonConverter.cs b/Adyen/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 000000000..1d0a14d25 --- /dev/null +++ b/Adyen/Client/DateTimeNullableJsonConverter.cs @@ -0,0 +1,82 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Adyen.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/Adyen/Client/ExceptionEventArgs.cs b/Adyen/Client/ExceptionEventArgs.cs new file mode 100644 index 000000000..0e11b030b --- /dev/null +++ b/Adyen/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Adyen.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExceptionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/Adyen/Client/HostConfiguration.cs b/Adyen/Client/HostConfiguration.cs new file mode 100644 index 000000000..e07f3ec36 --- /dev/null +++ b/Adyen/Client/HostConfiguration.cs @@ -0,0 +1,361 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Adyen.Service.Checkout; +using Adyen.Model.Checkout; + +namespace Adyen.Client +{ + /// + /// Provides hosting configuration for Adyen + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new AccountInfoJsonConverter()); + _jsonOptions.Converters.Add(new AcctInfoJsonConverter()); + _jsonOptions.Converters.Add(new AchDetailsJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalData3DSecureJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataAirlineJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataCarRentalJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataCommonJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataLevel23JsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataLodgingJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataOpenInvoiceJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataOpiJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataRatepayJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataRetryJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataRiskJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataRiskStandaloneJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataSubMerchantJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataTemporaryServicesJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataWalletsJsonConverter()); + _jsonOptions.Converters.Add(new AddressJsonConverter()); + _jsonOptions.Converters.Add(new AffirmDetailsJsonConverter()); + _jsonOptions.Converters.Add(new AfterpayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new AgencyJsonConverter()); + _jsonOptions.Converters.Add(new AirlineJsonConverter()); + _jsonOptions.Converters.Add(new AmazonPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new AmountJsonConverter()); + _jsonOptions.Converters.Add(new AmountsJsonConverter()); + _jsonOptions.Converters.Add(new AncvDetailsJsonConverter()); + _jsonOptions.Converters.Add(new AndroidPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new ApplePayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new ApplePayDonationsJsonConverter()); + _jsonOptions.Converters.Add(new ApplePaySessionRequestJsonConverter()); + _jsonOptions.Converters.Add(new ApplePaySessionResponseJsonConverter()); + _jsonOptions.Converters.Add(new ApplicationInfoJsonConverter()); + _jsonOptions.Converters.Add(new AuthenticationDataJsonConverter()); + _jsonOptions.Converters.Add(new BacsDirectDebitDetailsJsonConverter()); + _jsonOptions.Converters.Add(new BalanceCheckRequestJsonConverter()); + _jsonOptions.Converters.Add(new BalanceCheckResponseJsonConverter()); + _jsonOptions.Converters.Add(new BillDeskDetailsJsonConverter()); + _jsonOptions.Converters.Add(new BillingAddressJsonConverter()); + _jsonOptions.Converters.Add(new BlikDetailsJsonConverter()); + _jsonOptions.Converters.Add(new BrowserInfoJsonConverter()); + _jsonOptions.Converters.Add(new CancelOrderRequestJsonConverter()); + _jsonOptions.Converters.Add(new CancelOrderResponseJsonConverter()); + _jsonOptions.Converters.Add(new CardBrandDetailsJsonConverter()); + _jsonOptions.Converters.Add(new CardDetailsJsonConverter()); + _jsonOptions.Converters.Add(new CardDetailsRequestJsonConverter()); + _jsonOptions.Converters.Add(new CardDetailsResponseJsonConverter()); + _jsonOptions.Converters.Add(new CardDonationsJsonConverter()); + _jsonOptions.Converters.Add(new CashAppDetailsJsonConverter()); + _jsonOptions.Converters.Add(new CellulantDetailsJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutAwaitActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutBankAccountJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutBankTransferActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutDelegatedAuthenticationActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutNativeRedirectActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutOrderResponseJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutPaymentMethodJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutQrCodeActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutRedirectActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutSDKActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutSessionInstallmentOptionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutSessionThreeDS2RequestDataJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutThreeDS2ActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutVoucherActionJsonConverter()); + _jsonOptions.Converters.Add(new CommonFieldJsonConverter()); + _jsonOptions.Converters.Add(new CompanyJsonConverter()); + _jsonOptions.Converters.Add(new CreateCheckoutSessionRequestJsonConverter()); + _jsonOptions.Converters.Add(new CreateCheckoutSessionResponseJsonConverter()); + _jsonOptions.Converters.Add(new CreateOrderRequestJsonConverter()); + _jsonOptions.Converters.Add(new CreateOrderResponseJsonConverter()); + _jsonOptions.Converters.Add(new DeliveryAddressJsonConverter()); + _jsonOptions.Converters.Add(new DeliveryMethodJsonConverter()); + _jsonOptions.Converters.Add(new DetailsRequestAuthenticationDataJsonConverter()); + _jsonOptions.Converters.Add(new DeviceRenderOptionsJsonConverter()); + _jsonOptions.Converters.Add(new DokuDetailsJsonConverter()); + _jsonOptions.Converters.Add(new DonationJsonConverter()); + _jsonOptions.Converters.Add(new DonationCampaignJsonConverter()); + _jsonOptions.Converters.Add(new DonationCampaignsRequestJsonConverter()); + _jsonOptions.Converters.Add(new DonationCampaignsResponseJsonConverter()); + _jsonOptions.Converters.Add(new DonationPaymentMethodJsonConverter()); + _jsonOptions.Converters.Add(new DonationPaymentRequestJsonConverter()); + _jsonOptions.Converters.Add(new DonationPaymentResponseJsonConverter()); + _jsonOptions.Converters.Add(new DragonpayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new EBankingFinlandDetailsJsonConverter()); + _jsonOptions.Converters.Add(new EcontextVoucherDetailsJsonConverter()); + _jsonOptions.Converters.Add(new EftDetailsJsonConverter()); + _jsonOptions.Converters.Add(new EncryptedOrderDataJsonConverter()); + _jsonOptions.Converters.Add(new EnhancedSchemeDataJsonConverter()); + _jsonOptions.Converters.Add(new ExternalPlatformJsonConverter()); + _jsonOptions.Converters.Add(new FastlaneDetailsJsonConverter()); + _jsonOptions.Converters.Add(new ForexQuoteJsonConverter()); + _jsonOptions.Converters.Add(new FraudCheckResultJsonConverter()); + _jsonOptions.Converters.Add(new FraudResultJsonConverter()); + _jsonOptions.Converters.Add(new FundOriginJsonConverter()); + _jsonOptions.Converters.Add(new FundRecipientJsonConverter()); + _jsonOptions.Converters.Add(new GenericIssuerPaymentMethodDetailsJsonConverter()); + _jsonOptions.Converters.Add(new GooglePayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new GooglePayDonationsJsonConverter()); + _jsonOptions.Converters.Add(new IdealDetailsJsonConverter()); + _jsonOptions.Converters.Add(new IdealDonationsJsonConverter()); + _jsonOptions.Converters.Add(new InputDetailJsonConverter()); + _jsonOptions.Converters.Add(new InstallmentOptionJsonConverter()); + _jsonOptions.Converters.Add(new InstallmentsJsonConverter()); + _jsonOptions.Converters.Add(new ItemJsonConverter()); + _jsonOptions.Converters.Add(new KlarnaDetailsJsonConverter()); + _jsonOptions.Converters.Add(new LegJsonConverter()); + _jsonOptions.Converters.Add(new LineItemJsonConverter()); + _jsonOptions.Converters.Add(new ListStoredPaymentMethodsResponseJsonConverter()); + _jsonOptions.Converters.Add(new MandateJsonConverter()); + _jsonOptions.Converters.Add(new MasterpassDetailsJsonConverter()); + _jsonOptions.Converters.Add(new MbwayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new MerchantDeviceJsonConverter()); + _jsonOptions.Converters.Add(new MerchantRiskIndicatorJsonConverter()); + _jsonOptions.Converters.Add(new MobilePayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new MolPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new NameJsonConverter()); + _jsonOptions.Converters.Add(new OpenInvoiceDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PassengerJsonConverter()); + _jsonOptions.Converters.Add(new PayByBankAISDirectDebitDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayByBankDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayPalDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayToDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayUUpiDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayWithGoogleDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayWithGoogleDonationsJsonConverter()); + _jsonOptions.Converters.Add(new PaymentJsonConverter()); + _jsonOptions.Converters.Add(new PaymentAmountUpdateRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentAmountUpdateResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentCancelRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentCancelResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentCaptureRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentCaptureResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentCompletionDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PaymentDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PaymentDetailsRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentDetailsResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentLinkRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentLinkResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodGroupJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodIssuerJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodToStoreJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodUPIAppsJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodsRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodsResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentRefundRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentRefundResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentResponseActionJsonConverter()); + _jsonOptions.Converters.Add(new PaymentReversalRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentReversalResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaypalUpdateOrderRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaypalUpdateOrderResponseJsonConverter()); + _jsonOptions.Converters.Add(new PhoneJsonConverter()); + _jsonOptions.Converters.Add(new PixDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PixRecurringJsonConverter()); + _jsonOptions.Converters.Add(new PlatformChargebackLogicJsonConverter()); + _jsonOptions.Converters.Add(new PseDetailsJsonConverter()); + _jsonOptions.Converters.Add(new RakutenPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new RatepayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new RecurringJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalData3DSecureJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataBillingAddressJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataCardJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataCommonJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataDomesticErrorJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataInstallmentsJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataNetworkTokensJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataOpiJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataSepaJsonConverter()); + _jsonOptions.Converters.Add(new ResponsePaymentMethodJsonConverter()); + _jsonOptions.Converters.Add(new RiskDataJsonConverter()); + _jsonOptions.Converters.Add(new RivertyDetailsJsonConverter()); + _jsonOptions.Converters.Add(new SDKEphemPubKeyJsonConverter()); + _jsonOptions.Converters.Add(new SamsungPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new SepaDirectDebitDetailsJsonConverter()); + _jsonOptions.Converters.Add(new ServiceErrorJsonConverter()); + _jsonOptions.Converters.Add(new SessionResultResponseJsonConverter()); + _jsonOptions.Converters.Add(new ShopperInteractionDeviceJsonConverter()); + _jsonOptions.Converters.Add(new SplitJsonConverter()); + _jsonOptions.Converters.Add(new SplitAmountJsonConverter()); + _jsonOptions.Converters.Add(new StandalonePaymentCancelRequestJsonConverter()); + _jsonOptions.Converters.Add(new StandalonePaymentCancelResponseJsonConverter()); + _jsonOptions.Converters.Add(new StoredPaymentMethodJsonConverter()); + _jsonOptions.Converters.Add(new StoredPaymentMethodDetailsJsonConverter()); + _jsonOptions.Converters.Add(new StoredPaymentMethodRequestJsonConverter()); + _jsonOptions.Converters.Add(new StoredPaymentMethodResourceJsonConverter()); + _jsonOptions.Converters.Add(new SubInputDetailJsonConverter()); + _jsonOptions.Converters.Add(new SubMerchantJsonConverter()); + _jsonOptions.Converters.Add(new SubMerchantInfoJsonConverter()); + _jsonOptions.Converters.Add(new SurchargeJsonConverter()); + _jsonOptions.Converters.Add(new TaxTotalJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDS2RequestDataJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDS2RequestFieldsJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDS2ResponseDataJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDS2ResultJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDSRequestDataJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDSRequestorAuthenticationInfoJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDSRequestorPriorAuthenticationInfoJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDSecureDataJsonConverter()); + _jsonOptions.Converters.Add(new TicketJsonConverter()); + _jsonOptions.Converters.Add(new TravelAgencyJsonConverter()); + _jsonOptions.Converters.Add(new TwintDetailsJsonConverter()); + _jsonOptions.Converters.Add(new UpdatePaymentLinkRequestJsonConverter()); + _jsonOptions.Converters.Add(new UpiCollectDetailsJsonConverter()); + _jsonOptions.Converters.Add(new UpiIntentDetailsJsonConverter()); + _jsonOptions.Converters.Add(new UtilityRequestJsonConverter()); + _jsonOptions.Converters.Add(new UtilityResponseJsonConverter()); + _jsonOptions.Converters.Add(new VippsDetailsJsonConverter()); + _jsonOptions.Converters.Add(new VisaCheckoutDetailsJsonConverter()); + _jsonOptions.Converters.Add(new WeChatPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new WeChatPayMiniProgramDetailsJsonConverter()); + _jsonOptions.Converters.Add(new ZipDetailsJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/Adyen/Client/JsonSerializerOptionsProvider.cs b/Adyen/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 000000000..fd7fbd8fc --- /dev/null +++ b/Adyen/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Adyen.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/Adyen/Client/Option.cs b/Adyen/Client/Option.cs new file mode 100644 index 000000000..78b0c63fa --- /dev/null +++ b/Adyen/Client/Option.cs @@ -0,0 +1,51 @@ +// +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Adyen.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/Adyen/Client/RateLimitProvider.cs b/Adyen/Client/RateLimitProvider.cs new file mode 100644 index 000000000..92b18587d --- /dev/null +++ b/Adyen/Client/RateLimitProvider.cs @@ -0,0 +1,71 @@ +// +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Adyen.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + if (container is TokenContainer apiKeyTokenContainer) + { + string[] headers = apiKeyTokenContainer.Tokens.Select(t => ClientUtils.ApiKeyHeaderToString(t.Header)).Distinct().ToArray(); + + foreach (string header in headers) + { + global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) + { + FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(header, global::System.Threading.Channels.Channel.CreateBounded(options)); + } + } + else + { + global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length) + { + FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded(options)); + } + + foreach(global::System.Threading.Channels.Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/Adyen/Client/TokenBase.cs b/Adyen/Client/TokenBase.cs new file mode 100644 index 000000000..79ed6dfda --- /dev/null +++ b/Adyen/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Adyen.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/Adyen/Client/TokenContainer.cs b/Adyen/Client/TokenContainer.cs new file mode 100644 index 000000000..a9f3d167f --- /dev/null +++ b/Adyen/Client/TokenContainer.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Adyen.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(global::System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/Adyen/Client/TokenProvider.cs b/Adyen/Client/TokenProvider.cs new file mode 100644 index 000000000..e0f3257b8 --- /dev/null +++ b/Adyen/Client/TokenProvider.cs @@ -0,0 +1,42 @@ +// +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Adyen.Client; + +namespace Adyen +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/AbstractOpenAPISchema.cs b/Adyen/Model/Checkout/AbstractOpenAPISchema.cs deleted file mode 100644 index 69c1440c8..000000000 --- a/Adyen/Model/Checkout/AbstractOpenAPISchema.cs +++ /dev/null @@ -1,81 +0,0 @@ -/* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; - -namespace Adyen.Model.Checkout -{ - /// - /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification - /// - public abstract partial class AbstractOpenAPISchema - { - /// - /// Custom JSON serializer - /// - static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - MissingMemberHandling = MissingMemberHandling.Ignore, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Gets or Sets the actual instance - /// - public abstract Object ActualInstance { get; set; } - - /// - /// Gets or Sets IsNullable to indicate whether the instance is nullable - /// - public bool IsNullable { get; protected set; } - - /// - /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` - /// - public string SchemaType { get; protected set; } - - /// - /// Converts the instance into JSON string. - /// - public abstract string ToJson(); - - // Check if the contains TypeEnum value - protected static bool ContainsValue(string type) where T : struct, IConvertible - { - // Search for type in .TypeEnum - List list = new List(); - var members = typeof(T).GetTypeInfo().DeclaredMembers; - foreach (var member in members) - { - var val = member?.GetCustomAttribute(false)?.Value; - if (!string.IsNullOrEmpty(val)) - { - list.Add(val); - } - } - - return list.Contains(type); - } - } -} diff --git a/Adyen/Model/Checkout/AccountInfo.cs b/Adyen/Model/Checkout/AccountInfo.cs index 0b3dbec79..ae13ff856 100644 --- a/Adyen/Model/Checkout/AccountInfo.cs +++ b/Adyen/Model/Checkout/AccountInfo.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,413 +14,935 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AccountInfo /// - [DataContract(Name = "AccountInfo")] - public partial class AccountInfo : IEquatable, IValidatableObject + public partial class AccountInfo : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + /// Date when the shopper's account was last changed. + /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + /// Date when the shopper's account was created. + /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit + /// Number of attempts the shopper tried to add a card to their account in the last day. + /// Date the selected delivery address was first used. + /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + /// Shopper's home phone number (including the country code). + /// Shopper's mobile phone number (including the country code). + /// Date when the shopper last changed their password. + /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + /// Number of all transactions (successful and abandoned) from this shopper in the past 24 hours. + /// Number of all transactions (successful and abandoned) from this shopper in the past year. + /// Date this payment method was added to the shopper's account. + /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + /// Number of successful purchases in the last six months. + /// Whether suspicious activity was recorded on this account. + /// Shopper's work phone number (including the country code). + [JsonConstructor] + public AccountInfo(Option accountAgeIndicator = default, Option accountChangeDate = default, Option accountChangeIndicator = default, Option accountCreationDate = default, Option accountType = default, Option addCardAttemptsDay = default, Option deliveryAddressUsageDate = default, Option deliveryAddressUsageIndicator = default, Option homePhone = default, Option mobilePhone = default, Option passwordChangeDate = default, Option passwordChangeIndicator = default, Option pastTransactionsDay = default, Option pastTransactionsYear = default, Option paymentAccountAge = default, Option paymentAccountIndicator = default, Option purchasesLast6Months = default, Option suspiciousActivity = default, Option workPhone = default) + { + AccountAgeIndicatorOption = accountAgeIndicator; + AccountChangeDateOption = accountChangeDate; + AccountChangeIndicatorOption = accountChangeIndicator; + AccountCreationDateOption = accountCreationDate; + AccountTypeOption = accountType; + AddCardAttemptsDayOption = addCardAttemptsDay; + DeliveryAddressUsageDateOption = deliveryAddressUsageDate; + DeliveryAddressUsageIndicatorOption = deliveryAddressUsageIndicator; + HomePhoneOption = homePhone; + MobilePhoneOption = mobilePhone; + PasswordChangeDateOption = passwordChangeDate; + PasswordChangeIndicatorOption = passwordChangeIndicator; + PastTransactionsDayOption = pastTransactionsDay; + PastTransactionsYearOption = pastTransactionsYear; + PaymentAccountAgeOption = paymentAccountAge; + PaymentAccountIndicatorOption = paymentAccountIndicator; + PurchasesLast6MonthsOption = purchasesLast6Months; + SuspiciousActivityOption = suspiciousActivity; + WorkPhoneOption = workPhone; + OnCreated(); + } + + partial void OnCreated(); + /// /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [JsonConverter(typeof(StringEnumConverter))] public enum AccountAgeIndicatorEnum { /// /// Enum NotApplicable for value: notApplicable /// - [EnumMember(Value = "notApplicable")] NotApplicable = 1, /// /// Enum ThisTransaction for value: thisTransaction /// - [EnumMember(Value = "thisTransaction")] ThisTransaction = 2, /// /// Enum LessThan30Days for value: lessThan30Days /// - [EnumMember(Value = "lessThan30Days")] LessThan30Days = 3, /// /// Enum From30To60Days for value: from30To60Days /// - [EnumMember(Value = "from30To60Days")] From30To60Days = 4, /// /// Enum MoreThan60Days for value: moreThan60Days /// - [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static AccountAgeIndicatorEnum AccountAgeIndicatorEnumFromString(string value) + { + if (value.Equals("notApplicable")) + return AccountAgeIndicatorEnum.NotApplicable; + + if (value.Equals("thisTransaction")) + return AccountAgeIndicatorEnum.ThisTransaction; + + if (value.Equals("lessThan30Days")) + return AccountAgeIndicatorEnum.LessThan30Days; + + if (value.Equals("from30To60Days")) + return AccountAgeIndicatorEnum.From30To60Days; + + if (value.Equals("moreThan60Days")) + return AccountAgeIndicatorEnum.MoreThan60Days; + + throw new NotImplementedException($"Could not convert value to type AccountAgeIndicatorEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static AccountAgeIndicatorEnum? AccountAgeIndicatorEnumFromStringOrDefault(string value) + { + if (value.Equals("notApplicable")) + return AccountAgeIndicatorEnum.NotApplicable; + + if (value.Equals("thisTransaction")) + return AccountAgeIndicatorEnum.ThisTransaction; + + if (value.Equals("lessThan30Days")) + return AccountAgeIndicatorEnum.LessThan30Days; + + if (value.Equals("from30To60Days")) + return AccountAgeIndicatorEnum.From30To60Days; + + if (value.Equals("moreThan60Days")) + return AccountAgeIndicatorEnum.MoreThan60Days; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string AccountAgeIndicatorEnumToJsonValue(AccountAgeIndicatorEnum? value) + { + if (value == AccountAgeIndicatorEnum.NotApplicable) + return "notApplicable"; + + if (value == AccountAgeIndicatorEnum.ThisTransaction) + return "thisTransaction"; + + if (value == AccountAgeIndicatorEnum.LessThan30Days) + return "lessThan30Days"; + + if (value == AccountAgeIndicatorEnum.From30To60Days) + return "from30To60Days"; + if (value == AccountAgeIndicatorEnum.MoreThan60Days) + return "moreThan60Days"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of AccountAgeIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountAgeIndicatorOption { get; private set; } /// /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [DataMember(Name = "accountAgeIndicator", EmitDefaultValue = false)] - public AccountAgeIndicatorEnum? AccountAgeIndicator { get; set; } + [JsonPropertyName("accountAgeIndicator")] + public AccountAgeIndicatorEnum? AccountAgeIndicator { get { return this.AccountAgeIndicatorOption; } set { this.AccountAgeIndicatorOption = new Option(value); } } + /// /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [JsonConverter(typeof(StringEnumConverter))] public enum AccountChangeIndicatorEnum { /// /// Enum ThisTransaction for value: thisTransaction /// - [EnumMember(Value = "thisTransaction")] ThisTransaction = 1, /// /// Enum LessThan30Days for value: lessThan30Days /// - [EnumMember(Value = "lessThan30Days")] LessThan30Days = 2, /// /// Enum From30To60Days for value: from30To60Days /// - [EnumMember(Value = "from30To60Days")] From30To60Days = 3, /// /// Enum MoreThan60Days for value: moreThan60Days /// - [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 4 + } + /// + /// Returns a + /// + /// + /// + /// + public static AccountChangeIndicatorEnum AccountChangeIndicatorEnumFromString(string value) + { + if (value.Equals("thisTransaction")) + return AccountChangeIndicatorEnum.ThisTransaction; + + if (value.Equals("lessThan30Days")) + return AccountChangeIndicatorEnum.LessThan30Days; + + if (value.Equals("from30To60Days")) + return AccountChangeIndicatorEnum.From30To60Days; + + if (value.Equals("moreThan60Days")) + return AccountChangeIndicatorEnum.MoreThan60Days; + + throw new NotImplementedException($"Could not convert value to type AccountChangeIndicatorEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static AccountChangeIndicatorEnum? AccountChangeIndicatorEnumFromStringOrDefault(string value) + { + if (value.Equals("thisTransaction")) + return AccountChangeIndicatorEnum.ThisTransaction; + + if (value.Equals("lessThan30Days")) + return AccountChangeIndicatorEnum.LessThan30Days; + + if (value.Equals("from30To60Days")) + return AccountChangeIndicatorEnum.From30To60Days; + + if (value.Equals("moreThan60Days")) + return AccountChangeIndicatorEnum.MoreThan60Days; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string AccountChangeIndicatorEnumToJsonValue(AccountChangeIndicatorEnum? value) + { + if (value == AccountChangeIndicatorEnum.ThisTransaction) + return "thisTransaction"; + + if (value == AccountChangeIndicatorEnum.LessThan30Days) + return "lessThan30Days"; + + if (value == AccountChangeIndicatorEnum.From30To60Days) + return "from30To60Days"; + + if (value == AccountChangeIndicatorEnum.MoreThan60Days) + return "moreThan60Days"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of AccountChangeIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountChangeIndicatorOption { get; private set; } /// /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [DataMember(Name = "accountChangeIndicator", EmitDefaultValue = false)] - public AccountChangeIndicatorEnum? AccountChangeIndicator { get; set; } + [JsonPropertyName("accountChangeIndicator")] + public AccountChangeIndicatorEnum? AccountChangeIndicator { get { return this.AccountChangeIndicatorOption; } set { this.AccountChangeIndicatorOption = new Option(value); } } + /// /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit /// /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit - [JsonConverter(typeof(StringEnumConverter))] public enum AccountTypeEnum { /// /// Enum NotApplicable for value: notApplicable /// - [EnumMember(Value = "notApplicable")] NotApplicable = 1, /// /// Enum Credit for value: credit /// - [EnumMember(Value = "credit")] Credit = 2, /// /// Enum Debit for value: debit /// - [EnumMember(Value = "debit")] Debit = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static AccountTypeEnum AccountTypeEnumFromString(string value) + { + if (value.Equals("notApplicable")) + return AccountTypeEnum.NotApplicable; + + if (value.Equals("credit")) + return AccountTypeEnum.Credit; + + if (value.Equals("debit")) + return AccountTypeEnum.Debit; + throw new NotImplementedException($"Could not convert value to type AccountTypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static AccountTypeEnum? AccountTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("notApplicable")) + return AccountTypeEnum.NotApplicable; + + if (value.Equals("credit")) + return AccountTypeEnum.Credit; + + if (value.Equals("debit")) + return AccountTypeEnum.Debit; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string AccountTypeEnumToJsonValue(AccountTypeEnum? value) + { + if (value == AccountTypeEnum.NotApplicable) + return "notApplicable"; + + if (value == AccountTypeEnum.Credit) + return "credit"; + + if (value == AccountTypeEnum.Debit) + return "debit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of AccountType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountTypeOption { get; private set; } /// /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit /// /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit - [DataMember(Name = "accountType", EmitDefaultValue = false)] - public AccountTypeEnum? AccountType { get; set; } + [JsonPropertyName("accountType")] + public AccountTypeEnum? AccountType { get { return this.AccountTypeOption; } set { this.AccountTypeOption = new Option(value); } } + /// /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [JsonConverter(typeof(StringEnumConverter))] public enum DeliveryAddressUsageIndicatorEnum { /// /// Enum ThisTransaction for value: thisTransaction /// - [EnumMember(Value = "thisTransaction")] ThisTransaction = 1, /// /// Enum LessThan30Days for value: lessThan30Days /// - [EnumMember(Value = "lessThan30Days")] LessThan30Days = 2, /// /// Enum From30To60Days for value: from30To60Days /// - [EnumMember(Value = "from30To60Days")] From30To60Days = 3, /// /// Enum MoreThan60Days for value: moreThan60Days /// - [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static DeliveryAddressUsageIndicatorEnum DeliveryAddressUsageIndicatorEnumFromString(string value) + { + if (value.Equals("thisTransaction")) + return DeliveryAddressUsageIndicatorEnum.ThisTransaction; + + if (value.Equals("lessThan30Days")) + return DeliveryAddressUsageIndicatorEnum.LessThan30Days; + if (value.Equals("from30To60Days")) + return DeliveryAddressUsageIndicatorEnum.From30To60Days; + + if (value.Equals("moreThan60Days")) + return DeliveryAddressUsageIndicatorEnum.MoreThan60Days; + + throw new NotImplementedException($"Could not convert value to type DeliveryAddressUsageIndicatorEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static DeliveryAddressUsageIndicatorEnum? DeliveryAddressUsageIndicatorEnumFromStringOrDefault(string value) + { + if (value.Equals("thisTransaction")) + return DeliveryAddressUsageIndicatorEnum.ThisTransaction; + + if (value.Equals("lessThan30Days")) + return DeliveryAddressUsageIndicatorEnum.LessThan30Days; + + if (value.Equals("from30To60Days")) + return DeliveryAddressUsageIndicatorEnum.From30To60Days; + + if (value.Equals("moreThan60Days")) + return DeliveryAddressUsageIndicatorEnum.MoreThan60Days; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string DeliveryAddressUsageIndicatorEnumToJsonValue(DeliveryAddressUsageIndicatorEnum? value) + { + if (value == DeliveryAddressUsageIndicatorEnum.ThisTransaction) + return "thisTransaction"; + + if (value == DeliveryAddressUsageIndicatorEnum.LessThan30Days) + return "lessThan30Days"; + + if (value == DeliveryAddressUsageIndicatorEnum.From30To60Days) + return "from30To60Days"; + + if (value == DeliveryAddressUsageIndicatorEnum.MoreThan60Days) + return "moreThan60Days"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of DeliveryAddressUsageIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryAddressUsageIndicatorOption { get; private set; } /// /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [DataMember(Name = "deliveryAddressUsageIndicator", EmitDefaultValue = false)] - public DeliveryAddressUsageIndicatorEnum? DeliveryAddressUsageIndicator { get; set; } + [JsonPropertyName("deliveryAddressUsageIndicator")] + public DeliveryAddressUsageIndicatorEnum? DeliveryAddressUsageIndicator { get { return this.DeliveryAddressUsageIndicatorOption; } set { this.DeliveryAddressUsageIndicatorOption = new Option(value); } } + /// /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [JsonConverter(typeof(StringEnumConverter))] public enum PasswordChangeIndicatorEnum { /// /// Enum NotApplicable for value: notApplicable /// - [EnumMember(Value = "notApplicable")] NotApplicable = 1, /// /// Enum ThisTransaction for value: thisTransaction /// - [EnumMember(Value = "thisTransaction")] ThisTransaction = 2, /// /// Enum LessThan30Days for value: lessThan30Days /// - [EnumMember(Value = "lessThan30Days")] LessThan30Days = 3, /// /// Enum From30To60Days for value: from30To60Days /// - [EnumMember(Value = "from30To60Days")] From30To60Days = 4, /// /// Enum MoreThan60Days for value: moreThan60Days /// - [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static PasswordChangeIndicatorEnum PasswordChangeIndicatorEnumFromString(string value) + { + if (value.Equals("notApplicable")) + return PasswordChangeIndicatorEnum.NotApplicable; + + if (value.Equals("thisTransaction")) + return PasswordChangeIndicatorEnum.ThisTransaction; + + if (value.Equals("lessThan30Days")) + return PasswordChangeIndicatorEnum.LessThan30Days; + if (value.Equals("from30To60Days")) + return PasswordChangeIndicatorEnum.From30To60Days; + + if (value.Equals("moreThan60Days")) + return PasswordChangeIndicatorEnum.MoreThan60Days; + + throw new NotImplementedException($"Could not convert value to type PasswordChangeIndicatorEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static PasswordChangeIndicatorEnum? PasswordChangeIndicatorEnumFromStringOrDefault(string value) + { + if (value.Equals("notApplicable")) + return PasswordChangeIndicatorEnum.NotApplicable; + + if (value.Equals("thisTransaction")) + return PasswordChangeIndicatorEnum.ThisTransaction; + + if (value.Equals("lessThan30Days")) + return PasswordChangeIndicatorEnum.LessThan30Days; + + if (value.Equals("from30To60Days")) + return PasswordChangeIndicatorEnum.From30To60Days; + + if (value.Equals("moreThan60Days")) + return PasswordChangeIndicatorEnum.MoreThan60Days; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string PasswordChangeIndicatorEnumToJsonValue(PasswordChangeIndicatorEnum? value) + { + if (value == PasswordChangeIndicatorEnum.NotApplicable) + return "notApplicable"; + + if (value == PasswordChangeIndicatorEnum.ThisTransaction) + return "thisTransaction"; + + if (value == PasswordChangeIndicatorEnum.LessThan30Days) + return "lessThan30Days"; + + if (value == PasswordChangeIndicatorEnum.From30To60Days) + return "from30To60Days"; + + if (value == PasswordChangeIndicatorEnum.MoreThan60Days) + return "moreThan60Days"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of PasswordChangeIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PasswordChangeIndicatorOption { get; private set; } /// /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [DataMember(Name = "passwordChangeIndicator", EmitDefaultValue = false)] - public PasswordChangeIndicatorEnum? PasswordChangeIndicator { get; set; } + [JsonPropertyName("passwordChangeIndicator")] + public PasswordChangeIndicatorEnum? PasswordChangeIndicator { get { return this.PasswordChangeIndicatorOption; } set { this.PasswordChangeIndicatorOption = new Option(value); } } + /// /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [JsonConverter(typeof(StringEnumConverter))] public enum PaymentAccountIndicatorEnum { /// /// Enum NotApplicable for value: notApplicable /// - [EnumMember(Value = "notApplicable")] NotApplicable = 1, /// /// Enum ThisTransaction for value: thisTransaction /// - [EnumMember(Value = "thisTransaction")] ThisTransaction = 2, /// /// Enum LessThan30Days for value: lessThan30Days /// - [EnumMember(Value = "lessThan30Days")] LessThan30Days = 3, /// /// Enum From30To60Days for value: from30To60Days /// - [EnumMember(Value = "from30To60Days")] From30To60Days = 4, /// /// Enum MoreThan60Days for value: moreThan60Days /// - [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 5 + } + /// + /// Returns a + /// + /// + /// + /// + public static PaymentAccountIndicatorEnum PaymentAccountIndicatorEnumFromString(string value) + { + if (value.Equals("notApplicable")) + return PaymentAccountIndicatorEnum.NotApplicable; + + if (value.Equals("thisTransaction")) + return PaymentAccountIndicatorEnum.ThisTransaction; + + if (value.Equals("lessThan30Days")) + return PaymentAccountIndicatorEnum.LessThan30Days; + + if (value.Equals("from30To60Days")) + return PaymentAccountIndicatorEnum.From30To60Days; + + if (value.Equals("moreThan60Days")) + return PaymentAccountIndicatorEnum.MoreThan60Days; + + throw new NotImplementedException($"Could not convert value to type PaymentAccountIndicatorEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static PaymentAccountIndicatorEnum? PaymentAccountIndicatorEnumFromStringOrDefault(string value) + { + if (value.Equals("notApplicable")) + return PaymentAccountIndicatorEnum.NotApplicable; + + if (value.Equals("thisTransaction")) + return PaymentAccountIndicatorEnum.ThisTransaction; + + if (value.Equals("lessThan30Days")) + return PaymentAccountIndicatorEnum.LessThan30Days; + + if (value.Equals("from30To60Days")) + return PaymentAccountIndicatorEnum.From30To60Days; + + if (value.Equals("moreThan60Days")) + return PaymentAccountIndicatorEnum.MoreThan60Days; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string PaymentAccountIndicatorEnumToJsonValue(PaymentAccountIndicatorEnum? value) + { + if (value == PaymentAccountIndicatorEnum.NotApplicable) + return "notApplicable"; + + if (value == PaymentAccountIndicatorEnum.ThisTransaction) + return "thisTransaction"; + + if (value == PaymentAccountIndicatorEnum.LessThan30Days) + return "lessThan30Days"; + + if (value == PaymentAccountIndicatorEnum.From30To60Days) + return "from30To60Days"; + + if (value == PaymentAccountIndicatorEnum.MoreThan60Days) + return "moreThan60Days"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of PaymentAccountIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentAccountIndicatorOption { get; private set; } /// /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [DataMember(Name = "paymentAccountIndicator", EmitDefaultValue = false)] - public PaymentAccountIndicatorEnum? PaymentAccountIndicator { get; set; } + [JsonPropertyName("paymentAccountIndicator")] + public PaymentAccountIndicatorEnum? PaymentAccountIndicator { get { return this.PaymentAccountIndicatorOption; } set { this.PaymentAccountIndicatorOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of AccountChangeDate /// - /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. - /// Date when the shopper's account was last changed.. - /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. - /// Date when the shopper's account was created.. - /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit. - /// Number of attempts the shopper tried to add a card to their account in the last day.. - /// Date the selected delivery address was first used.. - /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. - /// Shopper's home phone number (including the country code).. - /// Shopper's mobile phone number (including the country code).. - /// Date when the shopper last changed their password.. - /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. - /// Number of all transactions (successful and abandoned) from this shopper in the past 24 hours.. - /// Number of all transactions (successful and abandoned) from this shopper in the past year.. - /// Date this payment method was added to the shopper's account.. - /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. - /// Number of successful purchases in the last six months.. - /// Whether suspicious activity was recorded on this account.. - /// Shopper's work phone number (including the country code).. - public AccountInfo(AccountAgeIndicatorEnum? accountAgeIndicator = default(AccountAgeIndicatorEnum?), DateTime accountChangeDate = default(DateTime), AccountChangeIndicatorEnum? accountChangeIndicator = default(AccountChangeIndicatorEnum?), DateTime accountCreationDate = default(DateTime), AccountTypeEnum? accountType = default(AccountTypeEnum?), int? addCardAttemptsDay = default(int?), DateTime deliveryAddressUsageDate = default(DateTime), DeliveryAddressUsageIndicatorEnum? deliveryAddressUsageIndicator = default(DeliveryAddressUsageIndicatorEnum?), string homePhone = default(string), string mobilePhone = default(string), DateTime passwordChangeDate = default(DateTime), PasswordChangeIndicatorEnum? passwordChangeIndicator = default(PasswordChangeIndicatorEnum?), int? pastTransactionsDay = default(int?), int? pastTransactionsYear = default(int?), DateTime paymentAccountAge = default(DateTime), PaymentAccountIndicatorEnum? paymentAccountIndicator = default(PaymentAccountIndicatorEnum?), int? purchasesLast6Months = default(int?), bool? suspiciousActivity = default(bool?), string workPhone = default(string)) - { - this.AccountAgeIndicator = accountAgeIndicator; - this.AccountChangeDate = accountChangeDate; - this.AccountChangeIndicator = accountChangeIndicator; - this.AccountCreationDate = accountCreationDate; - this.AccountType = accountType; - this.AddCardAttemptsDay = addCardAttemptsDay; - this.DeliveryAddressUsageDate = deliveryAddressUsageDate; - this.DeliveryAddressUsageIndicator = deliveryAddressUsageIndicator; - this.HomePhone = homePhone; - this.MobilePhone = mobilePhone; - this.PasswordChangeDate = passwordChangeDate; - this.PasswordChangeIndicator = passwordChangeIndicator; - this.PastTransactionsDay = pastTransactionsDay; - this.PastTransactionsYear = pastTransactionsYear; - this.PaymentAccountAge = paymentAccountAge; - this.PaymentAccountIndicator = paymentAccountIndicator; - this.PurchasesLast6Months = purchasesLast6Months; - this.SuspiciousActivity = suspiciousActivity; - this.WorkPhone = workPhone; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountChangeDateOption { get; private set; } /// /// Date when the shopper's account was last changed. /// /// Date when the shopper's account was last changed. - [DataMember(Name = "accountChangeDate", EmitDefaultValue = false)] - public DateTime AccountChangeDate { get; set; } + [JsonPropertyName("accountChangeDate")] + public DateTime? AccountChangeDate { get { return this.AccountChangeDateOption; } set { this.AccountChangeDateOption = new Option(value); } } + + /// + /// Used to track the state of AccountCreationDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountCreationDateOption { get; private set; } /// /// Date when the shopper's account was created. /// /// Date when the shopper's account was created. - [DataMember(Name = "accountCreationDate", EmitDefaultValue = false)] - public DateTime AccountCreationDate { get; set; } + [JsonPropertyName("accountCreationDate")] + public DateTime? AccountCreationDate { get { return this.AccountCreationDateOption; } set { this.AccountCreationDateOption = new Option(value); } } + + /// + /// Used to track the state of AddCardAttemptsDay + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AddCardAttemptsDayOption { get; private set; } /// /// Number of attempts the shopper tried to add a card to their account in the last day. /// /// Number of attempts the shopper tried to add a card to their account in the last day. - [DataMember(Name = "addCardAttemptsDay", EmitDefaultValue = false)] - public int? AddCardAttemptsDay { get; set; } + [JsonPropertyName("addCardAttemptsDay")] + public int? AddCardAttemptsDay { get { return this.AddCardAttemptsDayOption; } set { this.AddCardAttemptsDayOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryAddressUsageDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryAddressUsageDateOption { get; private set; } /// /// Date the selected delivery address was first used. /// /// Date the selected delivery address was first used. - [DataMember(Name = "deliveryAddressUsageDate", EmitDefaultValue = false)] - public DateTime DeliveryAddressUsageDate { get; set; } + [JsonPropertyName("deliveryAddressUsageDate")] + public DateTime? DeliveryAddressUsageDate { get { return this.DeliveryAddressUsageDateOption; } set { this.DeliveryAddressUsageDateOption = new Option(value); } } + + /// + /// Used to track the state of HomePhone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option HomePhoneOption { get; private set; } /// /// Shopper's home phone number (including the country code). /// /// Shopper's home phone number (including the country code). - [DataMember(Name = "homePhone", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v68. Use `ThreeDS2RequestData.homePhone` instead.")] - public string HomePhone { get; set; } + [JsonPropertyName("homePhone")] + [Obsolete] + public string HomePhone { get { return this.HomePhoneOption; } set { this.HomePhoneOption = new Option(value); } } + + /// + /// Used to track the state of MobilePhone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MobilePhoneOption { get; private set; } /// /// Shopper's mobile phone number (including the country code). /// /// Shopper's mobile phone number (including the country code). - [DataMember(Name = "mobilePhone", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v68. Use `ThreeDS2RequestData.mobilePhone` instead.")] - public string MobilePhone { get; set; } + [JsonPropertyName("mobilePhone")] + [Obsolete] + public string MobilePhone { get { return this.MobilePhoneOption; } set { this.MobilePhoneOption = new Option(value); } } + + /// + /// Used to track the state of PasswordChangeDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PasswordChangeDateOption { get; private set; } /// /// Date when the shopper last changed their password. /// /// Date when the shopper last changed their password. - [DataMember(Name = "passwordChangeDate", EmitDefaultValue = false)] - public DateTime PasswordChangeDate { get; set; } + [JsonPropertyName("passwordChangeDate")] + public DateTime? PasswordChangeDate { get { return this.PasswordChangeDateOption; } set { this.PasswordChangeDateOption = new Option(value); } } + + /// + /// Used to track the state of PastTransactionsDay + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PastTransactionsDayOption { get; private set; } /// /// Number of all transactions (successful and abandoned) from this shopper in the past 24 hours. /// /// Number of all transactions (successful and abandoned) from this shopper in the past 24 hours. - [DataMember(Name = "pastTransactionsDay", EmitDefaultValue = false)] - public int? PastTransactionsDay { get; set; } + [JsonPropertyName("pastTransactionsDay")] + public int? PastTransactionsDay { get { return this.PastTransactionsDayOption; } set { this.PastTransactionsDayOption = new Option(value); } } + + /// + /// Used to track the state of PastTransactionsYear + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PastTransactionsYearOption { get; private set; } /// /// Number of all transactions (successful and abandoned) from this shopper in the past year. /// /// Number of all transactions (successful and abandoned) from this shopper in the past year. - [DataMember(Name = "pastTransactionsYear", EmitDefaultValue = false)] - public int? PastTransactionsYear { get; set; } + [JsonPropertyName("pastTransactionsYear")] + public int? PastTransactionsYear { get { return this.PastTransactionsYearOption; } set { this.PastTransactionsYearOption = new Option(value); } } + + /// + /// Used to track the state of PaymentAccountAge + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentAccountAgeOption { get; private set; } /// /// Date this payment method was added to the shopper's account. /// /// Date this payment method was added to the shopper's account. - [DataMember(Name = "paymentAccountAge", EmitDefaultValue = false)] - public DateTime PaymentAccountAge { get; set; } + [JsonPropertyName("paymentAccountAge")] + public DateTime? PaymentAccountAge { get { return this.PaymentAccountAgeOption; } set { this.PaymentAccountAgeOption = new Option(value); } } + + /// + /// Used to track the state of PurchasesLast6Months + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PurchasesLast6MonthsOption { get; private set; } /// /// Number of successful purchases in the last six months. /// /// Number of successful purchases in the last six months. - [DataMember(Name = "purchasesLast6Months", EmitDefaultValue = false)] - public int? PurchasesLast6Months { get; set; } + [JsonPropertyName("purchasesLast6Months")] + public int? PurchasesLast6Months { get { return this.PurchasesLast6MonthsOption; } set { this.PurchasesLast6MonthsOption = new Option(value); } } + + /// + /// Used to track the state of SuspiciousActivity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SuspiciousActivityOption { get; private set; } /// /// Whether suspicious activity was recorded on this account. /// /// Whether suspicious activity was recorded on this account. - [DataMember(Name = "suspiciousActivity", EmitDefaultValue = false)] - public bool? SuspiciousActivity { get; set; } + [JsonPropertyName("suspiciousActivity")] + public bool? SuspiciousActivity { get { return this.SuspiciousActivityOption; } set { this.SuspiciousActivityOption = new Option(value); } } + + /// + /// Used to track the state of WorkPhone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option WorkPhoneOption { get; private set; } /// /// Shopper's work phone number (including the country code). /// /// Shopper's work phone number (including the country code). - [DataMember(Name = "workPhone", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v68. Use `ThreeDS2RequestData.workPhone` instead.")] - public string WorkPhone { get; set; } + [JsonPropertyName("workPhone")] + [Obsolete] + public string WorkPhone { get { return this.WorkPhoneOption; } set { this.WorkPhoneOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -455,186 +976,326 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AccountInfoJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// The format to use to serialize AccountChangeDate /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as AccountInfo); - } + public static string AccountChangeDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// Returns true if AccountInfo instances are equal + /// The format to use to serialize AccountCreationDate /// - /// Instance of AccountInfo to be compared - /// Boolean - public bool Equals(AccountInfo input) - { - if (input == null) - { - return false; - } - return - ( - this.AccountAgeIndicator == input.AccountAgeIndicator || - this.AccountAgeIndicator.Equals(input.AccountAgeIndicator) - ) && - ( - this.AccountChangeDate == input.AccountChangeDate || - (this.AccountChangeDate != null && - this.AccountChangeDate.Equals(input.AccountChangeDate)) - ) && - ( - this.AccountChangeIndicator == input.AccountChangeIndicator || - this.AccountChangeIndicator.Equals(input.AccountChangeIndicator) - ) && - ( - this.AccountCreationDate == input.AccountCreationDate || - (this.AccountCreationDate != null && - this.AccountCreationDate.Equals(input.AccountCreationDate)) - ) && - ( - this.AccountType == input.AccountType || - this.AccountType.Equals(input.AccountType) - ) && - ( - this.AddCardAttemptsDay == input.AddCardAttemptsDay || - this.AddCardAttemptsDay.Equals(input.AddCardAttemptsDay) - ) && - ( - this.DeliveryAddressUsageDate == input.DeliveryAddressUsageDate || - (this.DeliveryAddressUsageDate != null && - this.DeliveryAddressUsageDate.Equals(input.DeliveryAddressUsageDate)) - ) && - ( - this.DeliveryAddressUsageIndicator == input.DeliveryAddressUsageIndicator || - this.DeliveryAddressUsageIndicator.Equals(input.DeliveryAddressUsageIndicator) - ) && - ( - this.HomePhone == input.HomePhone || - (this.HomePhone != null && - this.HomePhone.Equals(input.HomePhone)) - ) && - ( - this.MobilePhone == input.MobilePhone || - (this.MobilePhone != null && - this.MobilePhone.Equals(input.MobilePhone)) - ) && - ( - this.PasswordChangeDate == input.PasswordChangeDate || - (this.PasswordChangeDate != null && - this.PasswordChangeDate.Equals(input.PasswordChangeDate)) - ) && - ( - this.PasswordChangeIndicator == input.PasswordChangeIndicator || - this.PasswordChangeIndicator.Equals(input.PasswordChangeIndicator) - ) && - ( - this.PastTransactionsDay == input.PastTransactionsDay || - this.PastTransactionsDay.Equals(input.PastTransactionsDay) - ) && - ( - this.PastTransactionsYear == input.PastTransactionsYear || - this.PastTransactionsYear.Equals(input.PastTransactionsYear) - ) && - ( - this.PaymentAccountAge == input.PaymentAccountAge || - (this.PaymentAccountAge != null && - this.PaymentAccountAge.Equals(input.PaymentAccountAge)) - ) && - ( - this.PaymentAccountIndicator == input.PaymentAccountIndicator || - this.PaymentAccountIndicator.Equals(input.PaymentAccountIndicator) - ) && - ( - this.PurchasesLast6Months == input.PurchasesLast6Months || - this.PurchasesLast6Months.Equals(input.PurchasesLast6Months) - ) && - ( - this.SuspiciousActivity == input.SuspiciousActivity || - this.SuspiciousActivity.Equals(input.SuspiciousActivity) - ) && - ( - this.WorkPhone == input.WorkPhone || - (this.WorkPhone != null && - this.WorkPhone.Equals(input.WorkPhone)) - ); - } + public static string AccountCreationDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize DeliveryAddressUsageDate + /// + public static string DeliveryAddressUsageDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize PasswordChangeDate + /// + public static string PasswordChangeDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize PaymentAccountAge + /// + public static string PaymentAccountAgeFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// Gets the hash code + /// Deserializes json to /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + /// + public override AccountInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option accountAgeIndicator = default; + Option accountChangeDate = default; + Option accountChangeIndicator = default; + Option accountCreationDate = default; + Option accountType = default; + Option addCardAttemptsDay = default; + Option deliveryAddressUsageDate = default; + Option deliveryAddressUsageIndicator = default; + Option homePhone = default; + Option mobilePhone = default; + Option passwordChangeDate = default; + Option passwordChangeIndicator = default; + Option pastTransactionsDay = default; + Option pastTransactionsYear = default; + Option paymentAccountAge = default; + Option paymentAccountIndicator = default; + Option purchasesLast6Months = default; + Option suspiciousActivity = default; + Option workPhone = default; + + while (utf8JsonReader.Read()) { - int hashCode = 41; - hashCode = (hashCode * 59) + this.AccountAgeIndicator.GetHashCode(); - if (this.AccountChangeDate != null) - { - hashCode = (hashCode * 59) + this.AccountChangeDate.GetHashCode(); - } - hashCode = (hashCode * 59) + this.AccountChangeIndicator.GetHashCode(); - if (this.AccountCreationDate != null) - { - hashCode = (hashCode * 59) + this.AccountCreationDate.GetHashCode(); - } - hashCode = (hashCode * 59) + this.AccountType.GetHashCode(); - hashCode = (hashCode * 59) + this.AddCardAttemptsDay.GetHashCode(); - if (this.DeliveryAddressUsageDate != null) - { - hashCode = (hashCode * 59) + this.DeliveryAddressUsageDate.GetHashCode(); - } - hashCode = (hashCode * 59) + this.DeliveryAddressUsageIndicator.GetHashCode(); - if (this.HomePhone != null) - { - hashCode = (hashCode * 59) + this.HomePhone.GetHashCode(); - } - if (this.MobilePhone != null) - { - hashCode = (hashCode * 59) + this.MobilePhone.GetHashCode(); - } - if (this.PasswordChangeDate != null) - { - hashCode = (hashCode * 59) + this.PasswordChangeDate.GetHashCode(); - } - hashCode = (hashCode * 59) + this.PasswordChangeIndicator.GetHashCode(); - hashCode = (hashCode * 59) + this.PastTransactionsDay.GetHashCode(); - hashCode = (hashCode * 59) + this.PastTransactionsYear.GetHashCode(); - if (this.PaymentAccountAge != null) - { - hashCode = (hashCode * 59) + this.PaymentAccountAge.GetHashCode(); - } - hashCode = (hashCode * 59) + this.PaymentAccountIndicator.GetHashCode(); - hashCode = (hashCode * 59) + this.PurchasesLast6Months.GetHashCode(); - hashCode = (hashCode * 59) + this.SuspiciousActivity.GetHashCode(); - if (this.WorkPhone != null) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - hashCode = (hashCode * 59) + this.WorkPhone.GetHashCode(); + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "accountAgeIndicator": + string accountAgeIndicatorRawValue = utf8JsonReader.GetString(); + if (accountAgeIndicatorRawValue != null) + accountAgeIndicator = new Option(AccountInfo.AccountAgeIndicatorEnumFromStringOrDefault(accountAgeIndicatorRawValue)); + break; + case "accountChangeDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + accountChangeDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "accountChangeIndicator": + string accountChangeIndicatorRawValue = utf8JsonReader.GetString(); + if (accountChangeIndicatorRawValue != null) + accountChangeIndicator = new Option(AccountInfo.AccountChangeIndicatorEnumFromStringOrDefault(accountChangeIndicatorRawValue)); + break; + case "accountCreationDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + accountCreationDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "accountType": + string accountTypeRawValue = utf8JsonReader.GetString(); + if (accountTypeRawValue != null) + accountType = new Option(AccountInfo.AccountTypeEnumFromStringOrDefault(accountTypeRawValue)); + break; + case "addCardAttemptsDay": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + addCardAttemptsDay = new Option(utf8JsonReader.GetInt32()); + break; + case "deliveryAddressUsageDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliveryAddressUsageDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliveryAddressUsageIndicator": + string deliveryAddressUsageIndicatorRawValue = utf8JsonReader.GetString(); + if (deliveryAddressUsageIndicatorRawValue != null) + deliveryAddressUsageIndicator = new Option(AccountInfo.DeliveryAddressUsageIndicatorEnumFromStringOrDefault(deliveryAddressUsageIndicatorRawValue)); + break; + case "homePhone": + homePhone = new Option(utf8JsonReader.GetString()); + break; + case "mobilePhone": + mobilePhone = new Option(utf8JsonReader.GetString()); + break; + case "passwordChangeDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + passwordChangeDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "passwordChangeIndicator": + string passwordChangeIndicatorRawValue = utf8JsonReader.GetString(); + if (passwordChangeIndicatorRawValue != null) + passwordChangeIndicator = new Option(AccountInfo.PasswordChangeIndicatorEnumFromStringOrDefault(passwordChangeIndicatorRawValue)); + break; + case "pastTransactionsDay": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + pastTransactionsDay = new Option(utf8JsonReader.GetInt32()); + break; + case "pastTransactionsYear": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + pastTransactionsYear = new Option(utf8JsonReader.GetInt32()); + break; + case "paymentAccountAge": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + paymentAccountAge = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "paymentAccountIndicator": + string paymentAccountIndicatorRawValue = utf8JsonReader.GetString(); + if (paymentAccountIndicatorRawValue != null) + paymentAccountIndicator = new Option(AccountInfo.PaymentAccountIndicatorEnumFromStringOrDefault(paymentAccountIndicatorRawValue)); + break; + case "purchasesLast6Months": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + purchasesLast6Months = new Option(utf8JsonReader.GetInt32()); + break; + case "suspiciousActivity": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + suspiciousActivity = new Option(utf8JsonReader.GetBoolean()); + break; + case "workPhone": + workPhone = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } } - return hashCode; } + + if (accountAgeIndicator.IsSet && accountAgeIndicator.Value == null) + throw new ArgumentNullException(nameof(accountAgeIndicator), "Property is not nullable for class AccountInfo."); + + if (accountChangeDate.IsSet && accountChangeDate.Value == null) + throw new ArgumentNullException(nameof(accountChangeDate), "Property is not nullable for class AccountInfo."); + + if (accountChangeIndicator.IsSet && accountChangeIndicator.Value == null) + throw new ArgumentNullException(nameof(accountChangeIndicator), "Property is not nullable for class AccountInfo."); + + if (accountCreationDate.IsSet && accountCreationDate.Value == null) + throw new ArgumentNullException(nameof(accountCreationDate), "Property is not nullable for class AccountInfo."); + + if (accountType.IsSet && accountType.Value == null) + throw new ArgumentNullException(nameof(accountType), "Property is not nullable for class AccountInfo."); + + if (addCardAttemptsDay.IsSet && addCardAttemptsDay.Value == null) + throw new ArgumentNullException(nameof(addCardAttemptsDay), "Property is not nullable for class AccountInfo."); + + if (deliveryAddressUsageDate.IsSet && deliveryAddressUsageDate.Value == null) + throw new ArgumentNullException(nameof(deliveryAddressUsageDate), "Property is not nullable for class AccountInfo."); + + if (deliveryAddressUsageIndicator.IsSet && deliveryAddressUsageIndicator.Value == null) + throw new ArgumentNullException(nameof(deliveryAddressUsageIndicator), "Property is not nullable for class AccountInfo."); + + if (homePhone.IsSet && homePhone.Value == null) + throw new ArgumentNullException(nameof(homePhone), "Property is not nullable for class AccountInfo."); + + if (mobilePhone.IsSet && mobilePhone.Value == null) + throw new ArgumentNullException(nameof(mobilePhone), "Property is not nullable for class AccountInfo."); + + if (passwordChangeDate.IsSet && passwordChangeDate.Value == null) + throw new ArgumentNullException(nameof(passwordChangeDate), "Property is not nullable for class AccountInfo."); + + if (passwordChangeIndicator.IsSet && passwordChangeIndicator.Value == null) + throw new ArgumentNullException(nameof(passwordChangeIndicator), "Property is not nullable for class AccountInfo."); + + if (pastTransactionsDay.IsSet && pastTransactionsDay.Value == null) + throw new ArgumentNullException(nameof(pastTransactionsDay), "Property is not nullable for class AccountInfo."); + + if (pastTransactionsYear.IsSet && pastTransactionsYear.Value == null) + throw new ArgumentNullException(nameof(pastTransactionsYear), "Property is not nullable for class AccountInfo."); + + if (paymentAccountAge.IsSet && paymentAccountAge.Value == null) + throw new ArgumentNullException(nameof(paymentAccountAge), "Property is not nullable for class AccountInfo."); + + if (paymentAccountIndicator.IsSet && paymentAccountIndicator.Value == null) + throw new ArgumentNullException(nameof(paymentAccountIndicator), "Property is not nullable for class AccountInfo."); + + if (purchasesLast6Months.IsSet && purchasesLast6Months.Value == null) + throw new ArgumentNullException(nameof(purchasesLast6Months), "Property is not nullable for class AccountInfo."); + + if (suspiciousActivity.IsSet && suspiciousActivity.Value == null) + throw new ArgumentNullException(nameof(suspiciousActivity), "Property is not nullable for class AccountInfo."); + + if (workPhone.IsSet && workPhone.Value == null) + throw new ArgumentNullException(nameof(workPhone), "Property is not nullable for class AccountInfo."); + + return new AccountInfo(accountAgeIndicator, accountChangeDate, accountChangeIndicator, accountCreationDate, accountType, addCardAttemptsDay, deliveryAddressUsageDate, deliveryAddressUsageIndicator, homePhone, mobilePhone, passwordChangeDate, passwordChangeIndicator, pastTransactionsDay, pastTransactionsYear, paymentAccountAge, paymentAccountIndicator, purchasesLast6Months, suspiciousActivity, workPhone); } + /// - /// To validate all properties of the instance + /// Serializes a /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AccountInfo accountInfo, JsonSerializerOptions jsonSerializerOptions) { - yield break; + writer.WriteStartObject(); + + WriteProperties(writer, accountInfo, jsonSerializerOptions); + writer.WriteEndObject(); } - } + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AccountInfo accountInfo, JsonSerializerOptions jsonSerializerOptions) + { + if (accountInfo.HomePhoneOption.IsSet && accountInfo.HomePhone == null) + throw new ArgumentNullException(nameof(accountInfo.HomePhone), "Property is required for class AccountInfo."); + + if (accountInfo.MobilePhoneOption.IsSet && accountInfo.MobilePhone == null) + throw new ArgumentNullException(nameof(accountInfo.MobilePhone), "Property is required for class AccountInfo."); + + if (accountInfo.WorkPhoneOption.IsSet && accountInfo.WorkPhone == null) + throw new ArgumentNullException(nameof(accountInfo.WorkPhone), "Property is required for class AccountInfo."); + + var accountAgeIndicatorRawValue = AccountInfo.AccountAgeIndicatorEnumToJsonValue(accountInfo.AccountAgeIndicatorOption.Value.Value); + writer.WriteString("accountAgeIndicator", accountAgeIndicatorRawValue); + if (accountInfo.AccountChangeDateOption.IsSet) + writer.WriteString("accountChangeDate", accountInfo.AccountChangeDateOption.Value.Value.ToString(AccountChangeDateFormat)); + + var accountChangeIndicatorRawValue = AccountInfo.AccountChangeIndicatorEnumToJsonValue(accountInfo.AccountChangeIndicatorOption.Value.Value); + writer.WriteString("accountChangeIndicator", accountChangeIndicatorRawValue); + if (accountInfo.AccountCreationDateOption.IsSet) + writer.WriteString("accountCreationDate", accountInfo.AccountCreationDateOption.Value.Value.ToString(AccountCreationDateFormat)); + + var accountTypeRawValue = AccountInfo.AccountTypeEnumToJsonValue(accountInfo.AccountTypeOption.Value.Value); + writer.WriteString("accountType", accountTypeRawValue); + if (accountInfo.AddCardAttemptsDayOption.IsSet) + writer.WriteNumber("addCardAttemptsDay", accountInfo.AddCardAttemptsDayOption.Value.Value); + + if (accountInfo.DeliveryAddressUsageDateOption.IsSet) + writer.WriteString("deliveryAddressUsageDate", accountInfo.DeliveryAddressUsageDateOption.Value.Value.ToString(DeliveryAddressUsageDateFormat)); + + var deliveryAddressUsageIndicatorRawValue = AccountInfo.DeliveryAddressUsageIndicatorEnumToJsonValue(accountInfo.DeliveryAddressUsageIndicatorOption.Value.Value); + writer.WriteString("deliveryAddressUsageIndicator", deliveryAddressUsageIndicatorRawValue); + if (accountInfo.HomePhoneOption.IsSet) + writer.WriteString("homePhone", accountInfo.HomePhone); + + if (accountInfo.MobilePhoneOption.IsSet) + writer.WriteString("mobilePhone", accountInfo.MobilePhone); + + if (accountInfo.PasswordChangeDateOption.IsSet) + writer.WriteString("passwordChangeDate", accountInfo.PasswordChangeDateOption.Value.Value.ToString(PasswordChangeDateFormat)); + + var passwordChangeIndicatorRawValue = AccountInfo.PasswordChangeIndicatorEnumToJsonValue(accountInfo.PasswordChangeIndicatorOption.Value.Value); + writer.WriteString("passwordChangeIndicator", passwordChangeIndicatorRawValue); + if (accountInfo.PastTransactionsDayOption.IsSet) + writer.WriteNumber("pastTransactionsDay", accountInfo.PastTransactionsDayOption.Value.Value); + + if (accountInfo.PastTransactionsYearOption.IsSet) + writer.WriteNumber("pastTransactionsYear", accountInfo.PastTransactionsYearOption.Value.Value); + + if (accountInfo.PaymentAccountAgeOption.IsSet) + writer.WriteString("paymentAccountAge", accountInfo.PaymentAccountAgeOption.Value.Value.ToString(PaymentAccountAgeFormat)); + + var paymentAccountIndicatorRawValue = AccountInfo.PaymentAccountIndicatorEnumToJsonValue(accountInfo.PaymentAccountIndicatorOption.Value.Value); + writer.WriteString("paymentAccountIndicator", paymentAccountIndicatorRawValue); + if (accountInfo.PurchasesLast6MonthsOption.IsSet) + writer.WriteNumber("purchasesLast6Months", accountInfo.PurchasesLast6MonthsOption.Value.Value); + + if (accountInfo.SuspiciousActivityOption.IsSet) + writer.WriteBoolean("suspiciousActivity", accountInfo.SuspiciousActivityOption.Value.Value); + + if (accountInfo.WorkPhoneOption.IsSet) + writer.WriteString("workPhone", accountInfo.WorkPhone); + } + } } diff --git a/Adyen/Model/Checkout/AcctInfo.cs b/Adyen/Model/Checkout/AcctInfo.cs index 38ea62d99..4bd7b91c2 100644 --- a/Adyen/Model/Checkout/AcctInfo.cs +++ b/Adyen/Model/Checkout/AcctInfo.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,398 +14,937 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AcctInfo /// - [DataContract(Name = "AcctInfo")] - public partial class AcctInfo : IEquatable, IValidatableObject + public partial class AcctInfo : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + /// Date that the cardholder’s account with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Format: **YYYYMMDD** + /// Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days + /// Date that cardholder’s account with the 3DS Requestor had a password change or account reset. Format: **YYYYMMDD** + /// Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + /// Date that the cardholder opened the account with the 3DS Requestor. Format: **YYYYMMDD** + /// Number of purchases with this cardholder account during the previous six months. Max length: 4 characters. + /// String that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Format: **YYYYMMDD** + /// Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + /// Number of Add Card attempts in the last 24 hours. Max length: 3 characters. + /// String when the shipping address used for this transaction was first used with the 3DS Requestor. Format: **YYYYMMDD** + /// Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days + /// Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name + /// Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed + /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous 24 hours. Max length: 3 characters. + /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous year. Max length: 3 characters. + [JsonConstructor] + public AcctInfo(Option chAccAgeInd = default, Option chAccChange = default, Option chAccChangeInd = default, Option chAccPwChange = default, Option chAccPwChangeInd = default, Option chAccString = default, Option nbPurchaseAccount = default, Option paymentAccAge = default, Option paymentAccInd = default, Option provisionAttemptsDay = default, Option shipAddressUsage = default, Option shipAddressUsageInd = default, Option shipNameIndicator = default, Option suspiciousAccActivity = default, Option txnActivityDay = default, Option txnActivityYear = default) + { + ChAccAgeIndOption = chAccAgeInd; + ChAccChangeOption = chAccChange; + ChAccChangeIndOption = chAccChangeInd; + ChAccPwChangeOption = chAccPwChange; + ChAccPwChangeIndOption = chAccPwChangeInd; + ChAccStringOption = chAccString; + NbPurchaseAccountOption = nbPurchaseAccount; + PaymentAccAgeOption = paymentAccAge; + PaymentAccIndOption = paymentAccInd; + ProvisionAttemptsDayOption = provisionAttemptsDay; + ShipAddressUsageOption = shipAddressUsage; + ShipAddressUsageIndOption = shipAddressUsageInd; + ShipNameIndicatorOption = shipNameIndicator; + SuspiciousAccActivityOption = suspiciousAccActivity; + TxnActivityDayOption = txnActivityDay; + TxnActivityYearOption = txnActivityYear; + OnCreated(); + } + + partial void OnCreated(); + /// /// Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days /// /// Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days - [JsonConverter(typeof(StringEnumConverter))] public enum ChAccAgeIndEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// - [EnumMember(Value = "05")] _05 = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ChAccAgeIndEnum ChAccAgeIndEnumFromString(string value) + { + if (value.Equals("01")) + return ChAccAgeIndEnum._01; + + if (value.Equals("02")) + return ChAccAgeIndEnum._02; + + if (value.Equals("03")) + return ChAccAgeIndEnum._03; + + if (value.Equals("04")) + return ChAccAgeIndEnum._04; + + if (value.Equals("05")) + return ChAccAgeIndEnum._05; + + throw new NotImplementedException($"Could not convert value to type ChAccAgeIndEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ChAccAgeIndEnum? ChAccAgeIndEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ChAccAgeIndEnum._01; + + if (value.Equals("02")) + return ChAccAgeIndEnum._02; + + if (value.Equals("03")) + return ChAccAgeIndEnum._03; + if (value.Equals("04")) + return ChAccAgeIndEnum._04; + + if (value.Equals("05")) + return ChAccAgeIndEnum._05; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChAccAgeIndEnumToJsonValue(ChAccAgeIndEnum? value) + { + if (value == ChAccAgeIndEnum._01) + return "01"; + + if (value == ChAccAgeIndEnum._02) + return "02"; + + if (value == ChAccAgeIndEnum._03) + return "03"; + + if (value == ChAccAgeIndEnum._04) + return "04"; + + if (value == ChAccAgeIndEnum._05) + return "05"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ChAccAgeInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChAccAgeIndOption { get; private set; } /// /// Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days /// /// Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days - [DataMember(Name = "chAccAgeInd", EmitDefaultValue = false)] - public ChAccAgeIndEnum? ChAccAgeInd { get; set; } + [JsonPropertyName("chAccAgeInd")] + public ChAccAgeIndEnum? ChAccAgeInd { get { return this.ChAccAgeIndOption; } set { this.ChAccAgeIndOption = new Option(value); } } + /// /// Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days /// /// Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days - [JsonConverter(typeof(StringEnumConverter))] public enum ChAccChangeIndEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4 + } + /// + /// Returns a + /// + /// + /// + /// + public static ChAccChangeIndEnum ChAccChangeIndEnumFromString(string value) + { + if (value.Equals("01")) + return ChAccChangeIndEnum._01; + + if (value.Equals("02")) + return ChAccChangeIndEnum._02; + + if (value.Equals("03")) + return ChAccChangeIndEnum._03; + + if (value.Equals("04")) + return ChAccChangeIndEnum._04; + + throw new NotImplementedException($"Could not convert value to type ChAccChangeIndEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static ChAccChangeIndEnum? ChAccChangeIndEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ChAccChangeIndEnum._01; + + if (value.Equals("02")) + return ChAccChangeIndEnum._02; + + if (value.Equals("03")) + return ChAccChangeIndEnum._03; + + if (value.Equals("04")) + return ChAccChangeIndEnum._04; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChAccChangeIndEnumToJsonValue(ChAccChangeIndEnum? value) + { + if (value == ChAccChangeIndEnum._01) + return "01"; + + if (value == ChAccChangeIndEnum._02) + return "02"; + + if (value == ChAccChangeIndEnum._03) + return "03"; + + if (value == ChAccChangeIndEnum._04) + return "04"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ChAccChangeInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChAccChangeIndOption { get; private set; } /// /// Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days /// /// Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days - [DataMember(Name = "chAccChangeInd", EmitDefaultValue = false)] - public ChAccChangeIndEnum? ChAccChangeInd { get; set; } + [JsonPropertyName("chAccChangeInd")] + public ChAccChangeIndEnum? ChAccChangeInd { get { return this.ChAccChangeIndOption; } set { this.ChAccChangeIndOption = new Option(value); } } + /// /// Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days /// /// Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days - [JsonConverter(typeof(StringEnumConverter))] public enum ChAccPwChangeIndEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// - [EnumMember(Value = "05")] _05 = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ChAccPwChangeIndEnum ChAccPwChangeIndEnumFromString(string value) + { + if (value.Equals("01")) + return ChAccPwChangeIndEnum._01; + + if (value.Equals("02")) + return ChAccPwChangeIndEnum._02; + + if (value.Equals("03")) + return ChAccPwChangeIndEnum._03; + + if (value.Equals("04")) + return ChAccPwChangeIndEnum._04; + + if (value.Equals("05")) + return ChAccPwChangeIndEnum._05; + + throw new NotImplementedException($"Could not convert value to type ChAccPwChangeIndEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ChAccPwChangeIndEnum? ChAccPwChangeIndEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ChAccPwChangeIndEnum._01; + if (value.Equals("02")) + return ChAccPwChangeIndEnum._02; + + if (value.Equals("03")) + return ChAccPwChangeIndEnum._03; + + if (value.Equals("04")) + return ChAccPwChangeIndEnum._04; + + if (value.Equals("05")) + return ChAccPwChangeIndEnum._05; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChAccPwChangeIndEnumToJsonValue(ChAccPwChangeIndEnum? value) + { + if (value == ChAccPwChangeIndEnum._01) + return "01"; + + if (value == ChAccPwChangeIndEnum._02) + return "02"; + + if (value == ChAccPwChangeIndEnum._03) + return "03"; + + if (value == ChAccPwChangeIndEnum._04) + return "04"; + + if (value == ChAccPwChangeIndEnum._05) + return "05"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ChAccPwChangeInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChAccPwChangeIndOption { get; private set; } /// /// Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days /// /// Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days - [DataMember(Name = "chAccPwChangeInd", EmitDefaultValue = false)] - public ChAccPwChangeIndEnum? ChAccPwChangeInd { get; set; } + [JsonPropertyName("chAccPwChangeInd")] + public ChAccPwChangeIndEnum? ChAccPwChangeInd { get { return this.ChAccPwChangeIndOption; } set { this.ChAccPwChangeIndOption = new Option(value); } } + /// /// Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days /// /// Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days - [JsonConverter(typeof(StringEnumConverter))] public enum PaymentAccIndEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// - [EnumMember(Value = "05")] _05 = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static PaymentAccIndEnum PaymentAccIndEnumFromString(string value) + { + if (value.Equals("01")) + return PaymentAccIndEnum._01; + + if (value.Equals("02")) + return PaymentAccIndEnum._02; + + if (value.Equals("03")) + return PaymentAccIndEnum._03; + if (value.Equals("04")) + return PaymentAccIndEnum._04; + + if (value.Equals("05")) + return PaymentAccIndEnum._05; + + throw new NotImplementedException($"Could not convert value to type PaymentAccIndEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static PaymentAccIndEnum? PaymentAccIndEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return PaymentAccIndEnum._01; + + if (value.Equals("02")) + return PaymentAccIndEnum._02; + + if (value.Equals("03")) + return PaymentAccIndEnum._03; + + if (value.Equals("04")) + return PaymentAccIndEnum._04; + + if (value.Equals("05")) + return PaymentAccIndEnum._05; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string PaymentAccIndEnumToJsonValue(PaymentAccIndEnum? value) + { + if (value == PaymentAccIndEnum._01) + return "01"; + + if (value == PaymentAccIndEnum._02) + return "02"; + + if (value == PaymentAccIndEnum._03) + return "03"; + + if (value == PaymentAccIndEnum._04) + return "04"; + + if (value == PaymentAccIndEnum._05) + return "05"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of PaymentAccInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentAccIndOption { get; private set; } /// /// Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days /// /// Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days - [DataMember(Name = "paymentAccInd", EmitDefaultValue = false)] - public PaymentAccIndEnum? PaymentAccInd { get; set; } + [JsonPropertyName("paymentAccInd")] + public PaymentAccIndEnum? PaymentAccInd { get { return this.PaymentAccIndOption; } set { this.PaymentAccIndOption = new Option(value); } } + /// /// Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days /// /// Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days - [JsonConverter(typeof(StringEnumConverter))] public enum ShipAddressUsageIndEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4 + } + /// + /// Returns a + /// + /// + /// + /// + public static ShipAddressUsageIndEnum ShipAddressUsageIndEnumFromString(string value) + { + if (value.Equals("01")) + return ShipAddressUsageIndEnum._01; + + if (value.Equals("02")) + return ShipAddressUsageIndEnum._02; + + if (value.Equals("03")) + return ShipAddressUsageIndEnum._03; + + if (value.Equals("04")) + return ShipAddressUsageIndEnum._04; + + throw new NotImplementedException($"Could not convert value to type ShipAddressUsageIndEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static ShipAddressUsageIndEnum? ShipAddressUsageIndEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ShipAddressUsageIndEnum._01; + + if (value.Equals("02")) + return ShipAddressUsageIndEnum._02; + + if (value.Equals("03")) + return ShipAddressUsageIndEnum._03; + + if (value.Equals("04")) + return ShipAddressUsageIndEnum._04; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ShipAddressUsageIndEnumToJsonValue(ShipAddressUsageIndEnum? value) + { + if (value == ShipAddressUsageIndEnum._01) + return "01"; + + if (value == ShipAddressUsageIndEnum._02) + return "02"; + + if (value == ShipAddressUsageIndEnum._03) + return "03"; + + if (value == ShipAddressUsageIndEnum._04) + return "04"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ShipAddressUsageInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShipAddressUsageIndOption { get; private set; } /// /// Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days /// /// Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days - [DataMember(Name = "shipAddressUsageInd", EmitDefaultValue = false)] - public ShipAddressUsageIndEnum? ShipAddressUsageInd { get; set; } + [JsonPropertyName("shipAddressUsageInd")] + public ShipAddressUsageIndEnum? ShipAddressUsageInd { get { return this.ShipAddressUsageIndOption; } set { this.ShipAddressUsageIndOption = new Option(value); } } + /// /// Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name /// /// Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name - [JsonConverter(typeof(StringEnumConverter))] public enum ShipNameIndicatorEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ShipNameIndicatorEnum ShipNameIndicatorEnumFromString(string value) + { + if (value.Equals("01")) + return ShipNameIndicatorEnum._01; + if (value.Equals("02")) + return ShipNameIndicatorEnum._02; + + throw new NotImplementedException($"Could not convert value to type ShipNameIndicatorEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static ShipNameIndicatorEnum? ShipNameIndicatorEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ShipNameIndicatorEnum._01; + + if (value.Equals("02")) + return ShipNameIndicatorEnum._02; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ShipNameIndicatorEnumToJsonValue(ShipNameIndicatorEnum? value) + { + if (value == ShipNameIndicatorEnum._01) + return "01"; + + if (value == ShipNameIndicatorEnum._02) + return "02"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ShipNameIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShipNameIndicatorOption { get; private set; } /// /// Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name /// /// Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name - [DataMember(Name = "shipNameIndicator", EmitDefaultValue = false)] - public ShipNameIndicatorEnum? ShipNameIndicator { get; set; } + [JsonPropertyName("shipNameIndicator")] + public ShipNameIndicatorEnum? ShipNameIndicator { get { return this.ShipNameIndicatorOption; } set { this.ShipNameIndicatorOption = new Option(value); } } + /// /// Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed /// /// Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed - [JsonConverter(typeof(StringEnumConverter))] public enum SuspiciousAccActivityEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static SuspiciousAccActivityEnum SuspiciousAccActivityEnumFromString(string value) + { + if (value.Equals("01")) + return SuspiciousAccActivityEnum._01; + + if (value.Equals("02")) + return SuspiciousAccActivityEnum._02; + throw new NotImplementedException($"Could not convert value to type SuspiciousAccActivityEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static SuspiciousAccActivityEnum? SuspiciousAccActivityEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return SuspiciousAccActivityEnum._01; + + if (value.Equals("02")) + return SuspiciousAccActivityEnum._02; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string SuspiciousAccActivityEnumToJsonValue(SuspiciousAccActivityEnum? value) + { + if (value == SuspiciousAccActivityEnum._01) + return "01"; + + if (value == SuspiciousAccActivityEnum._02) + return "02"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of SuspiciousAccActivity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SuspiciousAccActivityOption { get; private set; } /// /// Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed /// /// Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed - [DataMember(Name = "suspiciousAccActivity", EmitDefaultValue = false)] - public SuspiciousAccActivityEnum? SuspiciousAccActivity { get; set; } + [JsonPropertyName("suspiciousAccActivity")] + public SuspiciousAccActivityEnum? SuspiciousAccActivity { get { return this.SuspiciousAccActivityOption; } set { this.SuspiciousAccActivityOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of ChAccChange /// - /// Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days. - /// Date that the cardholder’s account with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Format: **YYYYMMDD**. - /// Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days. - /// Date that cardholder’s account with the 3DS Requestor had a password change or account reset. Format: **YYYYMMDD**. - /// Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days. - /// Date that the cardholder opened the account with the 3DS Requestor. Format: **YYYYMMDD**. - /// Number of purchases with this cardholder account during the previous six months. Max length: 4 characters.. - /// String that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Format: **YYYYMMDD**. - /// Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days. - /// Number of Add Card attempts in the last 24 hours. Max length: 3 characters.. - /// String when the shipping address used for this transaction was first used with the 3DS Requestor. Format: **YYYYMMDD**. - /// Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days. - /// Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name. - /// Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed. - /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous 24 hours. Max length: 3 characters.. - /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous year. Max length: 3 characters.. - public AcctInfo(ChAccAgeIndEnum? chAccAgeInd = default(ChAccAgeIndEnum?), string chAccChange = default(string), ChAccChangeIndEnum? chAccChangeInd = default(ChAccChangeIndEnum?), string chAccPwChange = default(string), ChAccPwChangeIndEnum? chAccPwChangeInd = default(ChAccPwChangeIndEnum?), string chAccString = default(string), string nbPurchaseAccount = default(string), string paymentAccAge = default(string), PaymentAccIndEnum? paymentAccInd = default(PaymentAccIndEnum?), string provisionAttemptsDay = default(string), string shipAddressUsage = default(string), ShipAddressUsageIndEnum? shipAddressUsageInd = default(ShipAddressUsageIndEnum?), ShipNameIndicatorEnum? shipNameIndicator = default(ShipNameIndicatorEnum?), SuspiciousAccActivityEnum? suspiciousAccActivity = default(SuspiciousAccActivityEnum?), string txnActivityDay = default(string), string txnActivityYear = default(string)) - { - this.ChAccAgeInd = chAccAgeInd; - this.ChAccChange = chAccChange; - this.ChAccChangeInd = chAccChangeInd; - this.ChAccPwChange = chAccPwChange; - this.ChAccPwChangeInd = chAccPwChangeInd; - this.ChAccString = chAccString; - this.NbPurchaseAccount = nbPurchaseAccount; - this.PaymentAccAge = paymentAccAge; - this.PaymentAccInd = paymentAccInd; - this.ProvisionAttemptsDay = provisionAttemptsDay; - this.ShipAddressUsage = shipAddressUsage; - this.ShipAddressUsageInd = shipAddressUsageInd; - this.ShipNameIndicator = shipNameIndicator; - this.SuspiciousAccActivity = suspiciousAccActivity; - this.TxnActivityDay = txnActivityDay; - this.TxnActivityYear = txnActivityYear; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChAccChangeOption { get; private set; } /// /// Date that the cardholder’s account with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Format: **YYYYMMDD** /// /// Date that the cardholder’s account with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Format: **YYYYMMDD** - [DataMember(Name = "chAccChange", EmitDefaultValue = false)] - public string ChAccChange { get; set; } + [JsonPropertyName("chAccChange")] + public string ChAccChange { get { return this.ChAccChangeOption; } set { this.ChAccChangeOption = new Option(value); } } + + /// + /// Used to track the state of ChAccPwChange + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChAccPwChangeOption { get; private set; } /// /// Date that cardholder’s account with the 3DS Requestor had a password change or account reset. Format: **YYYYMMDD** /// /// Date that cardholder’s account with the 3DS Requestor had a password change or account reset. Format: **YYYYMMDD** - [DataMember(Name = "chAccPwChange", EmitDefaultValue = false)] - public string ChAccPwChange { get; set; } + [JsonPropertyName("chAccPwChange")] + public string ChAccPwChange { get { return this.ChAccPwChangeOption; } set { this.ChAccPwChangeOption = new Option(value); } } + + /// + /// Used to track the state of ChAccString + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChAccStringOption { get; private set; } /// /// Date that the cardholder opened the account with the 3DS Requestor. Format: **YYYYMMDD** /// /// Date that the cardholder opened the account with the 3DS Requestor. Format: **YYYYMMDD** - [DataMember(Name = "chAccString", EmitDefaultValue = false)] - public string ChAccString { get; set; } + [JsonPropertyName("chAccString")] + public string ChAccString { get { return this.ChAccStringOption; } set { this.ChAccStringOption = new Option(value); } } + + /// + /// Used to track the state of NbPurchaseAccount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NbPurchaseAccountOption { get; private set; } /// /// Number of purchases with this cardholder account during the previous six months. Max length: 4 characters. /// /// Number of purchases with this cardholder account during the previous six months. Max length: 4 characters. - [DataMember(Name = "nbPurchaseAccount", EmitDefaultValue = false)] - public string NbPurchaseAccount { get; set; } + [JsonPropertyName("nbPurchaseAccount")] + public string NbPurchaseAccount { get { return this.NbPurchaseAccountOption; } set { this.NbPurchaseAccountOption = new Option(value); } } + + /// + /// Used to track the state of PaymentAccAge + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentAccAgeOption { get; private set; } /// /// String that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Format: **YYYYMMDD** /// /// String that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Format: **YYYYMMDD** - [DataMember(Name = "paymentAccAge", EmitDefaultValue = false)] - public string PaymentAccAge { get; set; } + [JsonPropertyName("paymentAccAge")] + public string PaymentAccAge { get { return this.PaymentAccAgeOption; } set { this.PaymentAccAgeOption = new Option(value); } } + + /// + /// Used to track the state of ProvisionAttemptsDay + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ProvisionAttemptsDayOption { get; private set; } /// /// Number of Add Card attempts in the last 24 hours. Max length: 3 characters. /// /// Number of Add Card attempts in the last 24 hours. Max length: 3 characters. - [DataMember(Name = "provisionAttemptsDay", EmitDefaultValue = false)] - public string ProvisionAttemptsDay { get; set; } + [JsonPropertyName("provisionAttemptsDay")] + public string ProvisionAttemptsDay { get { return this.ProvisionAttemptsDayOption; } set { this.ProvisionAttemptsDayOption = new Option(value); } } + + /// + /// Used to track the state of ShipAddressUsage + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShipAddressUsageOption { get; private set; } /// /// String when the shipping address used for this transaction was first used with the 3DS Requestor. Format: **YYYYMMDD** /// /// String when the shipping address used for this transaction was first used with the 3DS Requestor. Format: **YYYYMMDD** - [DataMember(Name = "shipAddressUsage", EmitDefaultValue = false)] - public string ShipAddressUsage { get; set; } + [JsonPropertyName("shipAddressUsage")] + public string ShipAddressUsage { get { return this.ShipAddressUsageOption; } set { this.ShipAddressUsageOption = new Option(value); } } + + /// + /// Used to track the state of TxnActivityDay + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TxnActivityDayOption { get; private set; } /// /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous 24 hours. Max length: 3 characters. /// /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous 24 hours. Max length: 3 characters. - [DataMember(Name = "txnActivityDay", EmitDefaultValue = false)] - public string TxnActivityDay { get; set; } + [JsonPropertyName("txnActivityDay")] + public string TxnActivityDay { get { return this.TxnActivityDayOption; } set { this.TxnActivityDayOption = new Option(value); } } + + /// + /// Used to track the state of TxnActivityYear + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TxnActivityYearOption { get; private set; } /// /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous year. Max length: 3 characters. /// /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous year. Max length: 3 characters. - [DataMember(Name = "txnActivityYear", EmitDefaultValue = false)] - public string TxnActivityYear { get; set; } + [JsonPropertyName("txnActivityYear")] + public string TxnActivityYear { get { return this.TxnActivityYearOption; } set { this.TxnActivityYearOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -437,187 +975,292 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // TxnActivityDay (string) maxLength + if (this.TxnActivityDay != null && this.TxnActivityDay.Length > 3) + { + yield return new ValidationResult("Invalid value for TxnActivityDay, length must be less than 3.", new [] { "TxnActivityDay" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as AcctInfo); + // TxnActivityYear (string) maxLength + if (this.TxnActivityYear != null && this.TxnActivityYear.Length > 3) + { + yield return new ValidationResult("Invalid value for TxnActivityYear, length must be less than 3.", new [] { "TxnActivityYear" }); + } + + yield break; } + } + /// + /// A Json converter for type + /// + public class AcctInfoJsonConverter : JsonConverter + { /// - /// Returns true if AcctInfo instances are equal + /// Deserializes json to /// - /// Instance of AcctInfo to be compared - /// Boolean - public bool Equals(AcctInfo input) + /// + /// + /// + /// + /// + public override AcctInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) - { - return false; - } - return - ( - this.ChAccAgeInd == input.ChAccAgeInd || - this.ChAccAgeInd.Equals(input.ChAccAgeInd) - ) && - ( - this.ChAccChange == input.ChAccChange || - (this.ChAccChange != null && - this.ChAccChange.Equals(input.ChAccChange)) - ) && - ( - this.ChAccChangeInd == input.ChAccChangeInd || - this.ChAccChangeInd.Equals(input.ChAccChangeInd) - ) && - ( - this.ChAccPwChange == input.ChAccPwChange || - (this.ChAccPwChange != null && - this.ChAccPwChange.Equals(input.ChAccPwChange)) - ) && - ( - this.ChAccPwChangeInd == input.ChAccPwChangeInd || - this.ChAccPwChangeInd.Equals(input.ChAccPwChangeInd) - ) && - ( - this.ChAccString == input.ChAccString || - (this.ChAccString != null && - this.ChAccString.Equals(input.ChAccString)) - ) && - ( - this.NbPurchaseAccount == input.NbPurchaseAccount || - (this.NbPurchaseAccount != null && - this.NbPurchaseAccount.Equals(input.NbPurchaseAccount)) - ) && - ( - this.PaymentAccAge == input.PaymentAccAge || - (this.PaymentAccAge != null && - this.PaymentAccAge.Equals(input.PaymentAccAge)) - ) && - ( - this.PaymentAccInd == input.PaymentAccInd || - this.PaymentAccInd.Equals(input.PaymentAccInd) - ) && - ( - this.ProvisionAttemptsDay == input.ProvisionAttemptsDay || - (this.ProvisionAttemptsDay != null && - this.ProvisionAttemptsDay.Equals(input.ProvisionAttemptsDay)) - ) && - ( - this.ShipAddressUsage == input.ShipAddressUsage || - (this.ShipAddressUsage != null && - this.ShipAddressUsage.Equals(input.ShipAddressUsage)) - ) && - ( - this.ShipAddressUsageInd == input.ShipAddressUsageInd || - this.ShipAddressUsageInd.Equals(input.ShipAddressUsageInd) - ) && - ( - this.ShipNameIndicator == input.ShipNameIndicator || - this.ShipNameIndicator.Equals(input.ShipNameIndicator) - ) && - ( - this.SuspiciousAccActivity == input.SuspiciousAccActivity || - this.SuspiciousAccActivity.Equals(input.SuspiciousAccActivity) - ) && - ( - this.TxnActivityDay == input.TxnActivityDay || - (this.TxnActivityDay != null && - this.TxnActivityDay.Equals(input.TxnActivityDay)) - ) && - ( - this.TxnActivityYear == input.TxnActivityYear || - (this.TxnActivityYear != null && - this.TxnActivityYear.Equals(input.TxnActivityYear)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option chAccAgeInd = default; + Option chAccChange = default; + Option chAccChangeInd = default; + Option chAccPwChange = default; + Option chAccPwChangeInd = default; + Option chAccString = default; + Option nbPurchaseAccount = default; + Option paymentAccAge = default; + Option paymentAccInd = default; + Option provisionAttemptsDay = default; + Option shipAddressUsage = default; + Option shipAddressUsageInd = default; + Option shipNameIndicator = default; + Option suspiciousAccActivity = default; + Option txnActivityDay = default; + Option txnActivityYear = default; + + while (utf8JsonReader.Read()) { - int hashCode = 41; - hashCode = (hashCode * 59) + this.ChAccAgeInd.GetHashCode(); - if (this.ChAccChange != null) - { - hashCode = (hashCode * 59) + this.ChAccChange.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ChAccChangeInd.GetHashCode(); - if (this.ChAccPwChange != null) - { - hashCode = (hashCode * 59) + this.ChAccPwChange.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ChAccPwChangeInd.GetHashCode(); - if (this.ChAccString != null) - { - hashCode = (hashCode * 59) + this.ChAccString.GetHashCode(); - } - if (this.NbPurchaseAccount != null) - { - hashCode = (hashCode * 59) + this.NbPurchaseAccount.GetHashCode(); - } - if (this.PaymentAccAge != null) - { - hashCode = (hashCode * 59) + this.PaymentAccAge.GetHashCode(); - } - hashCode = (hashCode * 59) + this.PaymentAccInd.GetHashCode(); - if (this.ProvisionAttemptsDay != null) - { - hashCode = (hashCode * 59) + this.ProvisionAttemptsDay.GetHashCode(); - } - if (this.ShipAddressUsage != null) - { - hashCode = (hashCode * 59) + this.ShipAddressUsage.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ShipAddressUsageInd.GetHashCode(); - hashCode = (hashCode * 59) + this.ShipNameIndicator.GetHashCode(); - hashCode = (hashCode * 59) + this.SuspiciousAccActivity.GetHashCode(); - if (this.TxnActivityDay != null) - { - hashCode = (hashCode * 59) + this.TxnActivityDay.GetHashCode(); - } - if (this.TxnActivityYear != null) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - hashCode = (hashCode * 59) + this.TxnActivityYear.GetHashCode(); + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "chAccAgeInd": + string chAccAgeIndRawValue = utf8JsonReader.GetString(); + if (chAccAgeIndRawValue != null) + chAccAgeInd = new Option(AcctInfo.ChAccAgeIndEnumFromStringOrDefault(chAccAgeIndRawValue)); + break; + case "chAccChange": + chAccChange = new Option(utf8JsonReader.GetString()); + break; + case "chAccChangeInd": + string chAccChangeIndRawValue = utf8JsonReader.GetString(); + if (chAccChangeIndRawValue != null) + chAccChangeInd = new Option(AcctInfo.ChAccChangeIndEnumFromStringOrDefault(chAccChangeIndRawValue)); + break; + case "chAccPwChange": + chAccPwChange = new Option(utf8JsonReader.GetString()); + break; + case "chAccPwChangeInd": + string chAccPwChangeIndRawValue = utf8JsonReader.GetString(); + if (chAccPwChangeIndRawValue != null) + chAccPwChangeInd = new Option(AcctInfo.ChAccPwChangeIndEnumFromStringOrDefault(chAccPwChangeIndRawValue)); + break; + case "chAccString": + chAccString = new Option(utf8JsonReader.GetString()); + break; + case "nbPurchaseAccount": + nbPurchaseAccount = new Option(utf8JsonReader.GetString()); + break; + case "paymentAccAge": + paymentAccAge = new Option(utf8JsonReader.GetString()); + break; + case "paymentAccInd": + string paymentAccIndRawValue = utf8JsonReader.GetString(); + if (paymentAccIndRawValue != null) + paymentAccInd = new Option(AcctInfo.PaymentAccIndEnumFromStringOrDefault(paymentAccIndRawValue)); + break; + case "provisionAttemptsDay": + provisionAttemptsDay = new Option(utf8JsonReader.GetString()); + break; + case "shipAddressUsage": + shipAddressUsage = new Option(utf8JsonReader.GetString()); + break; + case "shipAddressUsageInd": + string shipAddressUsageIndRawValue = utf8JsonReader.GetString(); + if (shipAddressUsageIndRawValue != null) + shipAddressUsageInd = new Option(AcctInfo.ShipAddressUsageIndEnumFromStringOrDefault(shipAddressUsageIndRawValue)); + break; + case "shipNameIndicator": + string shipNameIndicatorRawValue = utf8JsonReader.GetString(); + if (shipNameIndicatorRawValue != null) + shipNameIndicator = new Option(AcctInfo.ShipNameIndicatorEnumFromStringOrDefault(shipNameIndicatorRawValue)); + break; + case "suspiciousAccActivity": + string suspiciousAccActivityRawValue = utf8JsonReader.GetString(); + if (suspiciousAccActivityRawValue != null) + suspiciousAccActivity = new Option(AcctInfo.SuspiciousAccActivityEnumFromStringOrDefault(suspiciousAccActivityRawValue)); + break; + case "txnActivityDay": + txnActivityDay = new Option(utf8JsonReader.GetString()); + break; + case "txnActivityYear": + txnActivityYear = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } } - return hashCode; } + + if (chAccAgeInd.IsSet && chAccAgeInd.Value == null) + throw new ArgumentNullException(nameof(chAccAgeInd), "Property is not nullable for class AcctInfo."); + + if (chAccChange.IsSet && chAccChange.Value == null) + throw new ArgumentNullException(nameof(chAccChange), "Property is not nullable for class AcctInfo."); + + if (chAccChangeInd.IsSet && chAccChangeInd.Value == null) + throw new ArgumentNullException(nameof(chAccChangeInd), "Property is not nullable for class AcctInfo."); + + if (chAccPwChange.IsSet && chAccPwChange.Value == null) + throw new ArgumentNullException(nameof(chAccPwChange), "Property is not nullable for class AcctInfo."); + + if (chAccPwChangeInd.IsSet && chAccPwChangeInd.Value == null) + throw new ArgumentNullException(nameof(chAccPwChangeInd), "Property is not nullable for class AcctInfo."); + + if (chAccString.IsSet && chAccString.Value == null) + throw new ArgumentNullException(nameof(chAccString), "Property is not nullable for class AcctInfo."); + + if (nbPurchaseAccount.IsSet && nbPurchaseAccount.Value == null) + throw new ArgumentNullException(nameof(nbPurchaseAccount), "Property is not nullable for class AcctInfo."); + + if (paymentAccAge.IsSet && paymentAccAge.Value == null) + throw new ArgumentNullException(nameof(paymentAccAge), "Property is not nullable for class AcctInfo."); + + if (paymentAccInd.IsSet && paymentAccInd.Value == null) + throw new ArgumentNullException(nameof(paymentAccInd), "Property is not nullable for class AcctInfo."); + + if (provisionAttemptsDay.IsSet && provisionAttemptsDay.Value == null) + throw new ArgumentNullException(nameof(provisionAttemptsDay), "Property is not nullable for class AcctInfo."); + + if (shipAddressUsage.IsSet && shipAddressUsage.Value == null) + throw new ArgumentNullException(nameof(shipAddressUsage), "Property is not nullable for class AcctInfo."); + + if (shipAddressUsageInd.IsSet && shipAddressUsageInd.Value == null) + throw new ArgumentNullException(nameof(shipAddressUsageInd), "Property is not nullable for class AcctInfo."); + + if (shipNameIndicator.IsSet && shipNameIndicator.Value == null) + throw new ArgumentNullException(nameof(shipNameIndicator), "Property is not nullable for class AcctInfo."); + + if (suspiciousAccActivity.IsSet && suspiciousAccActivity.Value == null) + throw new ArgumentNullException(nameof(suspiciousAccActivity), "Property is not nullable for class AcctInfo."); + + if (txnActivityDay.IsSet && txnActivityDay.Value == null) + throw new ArgumentNullException(nameof(txnActivityDay), "Property is not nullable for class AcctInfo."); + + if (txnActivityYear.IsSet && txnActivityYear.Value == null) + throw new ArgumentNullException(nameof(txnActivityYear), "Property is not nullable for class AcctInfo."); + + return new AcctInfo(chAccAgeInd, chAccChange, chAccChangeInd, chAccPwChange, chAccPwChangeInd, chAccString, nbPurchaseAccount, paymentAccAge, paymentAccInd, provisionAttemptsDay, shipAddressUsage, shipAddressUsageInd, shipNameIndicator, suspiciousAccActivity, txnActivityDay, txnActivityYear); } + /// - /// To validate all properties of the instance + /// Serializes a /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AcctInfo acctInfo, JsonSerializerOptions jsonSerializerOptions) { - // TxnActivityDay (string) maxLength - if (this.TxnActivityDay != null && this.TxnActivityDay.Length > 3) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TxnActivityDay, length must be less than 3.", new [] { "TxnActivityDay" }); - } + writer.WriteStartObject(); - // TxnActivityYear (string) maxLength - if (this.TxnActivityYear != null && this.TxnActivityYear.Length > 3) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TxnActivityYear, length must be less than 3.", new [] { "TxnActivityYear" }); - } + WriteProperties(writer, acctInfo, jsonSerializerOptions); + writer.WriteEndObject(); + } - yield break; + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AcctInfo acctInfo, JsonSerializerOptions jsonSerializerOptions) + { + if (acctInfo.ChAccChangeOption.IsSet && acctInfo.ChAccChange == null) + throw new ArgumentNullException(nameof(acctInfo.ChAccChange), "Property is required for class AcctInfo."); + + if (acctInfo.ChAccPwChangeOption.IsSet && acctInfo.ChAccPwChange == null) + throw new ArgumentNullException(nameof(acctInfo.ChAccPwChange), "Property is required for class AcctInfo."); + + if (acctInfo.ChAccStringOption.IsSet && acctInfo.ChAccString == null) + throw new ArgumentNullException(nameof(acctInfo.ChAccString), "Property is required for class AcctInfo."); + + if (acctInfo.NbPurchaseAccountOption.IsSet && acctInfo.NbPurchaseAccount == null) + throw new ArgumentNullException(nameof(acctInfo.NbPurchaseAccount), "Property is required for class AcctInfo."); + + if (acctInfo.PaymentAccAgeOption.IsSet && acctInfo.PaymentAccAge == null) + throw new ArgumentNullException(nameof(acctInfo.PaymentAccAge), "Property is required for class AcctInfo."); + + if (acctInfo.ProvisionAttemptsDayOption.IsSet && acctInfo.ProvisionAttemptsDay == null) + throw new ArgumentNullException(nameof(acctInfo.ProvisionAttemptsDay), "Property is required for class AcctInfo."); + + if (acctInfo.ShipAddressUsageOption.IsSet && acctInfo.ShipAddressUsage == null) + throw new ArgumentNullException(nameof(acctInfo.ShipAddressUsage), "Property is required for class AcctInfo."); + + if (acctInfo.TxnActivityDayOption.IsSet && acctInfo.TxnActivityDay == null) + throw new ArgumentNullException(nameof(acctInfo.TxnActivityDay), "Property is required for class AcctInfo."); + + if (acctInfo.TxnActivityYearOption.IsSet && acctInfo.TxnActivityYear == null) + throw new ArgumentNullException(nameof(acctInfo.TxnActivityYear), "Property is required for class AcctInfo."); + + var chAccAgeIndRawValue = AcctInfo.ChAccAgeIndEnumToJsonValue(acctInfo.ChAccAgeIndOption.Value.Value); + writer.WriteString("chAccAgeInd", chAccAgeIndRawValue); + if (acctInfo.ChAccChangeOption.IsSet) + writer.WriteString("chAccChange", acctInfo.ChAccChange); + + var chAccChangeIndRawValue = AcctInfo.ChAccChangeIndEnumToJsonValue(acctInfo.ChAccChangeIndOption.Value.Value); + writer.WriteString("chAccChangeInd", chAccChangeIndRawValue); + if (acctInfo.ChAccPwChangeOption.IsSet) + writer.WriteString("chAccPwChange", acctInfo.ChAccPwChange); + + var chAccPwChangeIndRawValue = AcctInfo.ChAccPwChangeIndEnumToJsonValue(acctInfo.ChAccPwChangeIndOption.Value.Value); + writer.WriteString("chAccPwChangeInd", chAccPwChangeIndRawValue); + if (acctInfo.ChAccStringOption.IsSet) + writer.WriteString("chAccString", acctInfo.ChAccString); + + if (acctInfo.NbPurchaseAccountOption.IsSet) + writer.WriteString("nbPurchaseAccount", acctInfo.NbPurchaseAccount); + + if (acctInfo.PaymentAccAgeOption.IsSet) + writer.WriteString("paymentAccAge", acctInfo.PaymentAccAge); + + var paymentAccIndRawValue = AcctInfo.PaymentAccIndEnumToJsonValue(acctInfo.PaymentAccIndOption.Value.Value); + writer.WriteString("paymentAccInd", paymentAccIndRawValue); + if (acctInfo.ProvisionAttemptsDayOption.IsSet) + writer.WriteString("provisionAttemptsDay", acctInfo.ProvisionAttemptsDay); + + if (acctInfo.ShipAddressUsageOption.IsSet) + writer.WriteString("shipAddressUsage", acctInfo.ShipAddressUsage); + + var shipAddressUsageIndRawValue = AcctInfo.ShipAddressUsageIndEnumToJsonValue(acctInfo.ShipAddressUsageIndOption.Value.Value); + writer.WriteString("shipAddressUsageInd", shipAddressUsageIndRawValue); + var shipNameIndicatorRawValue = AcctInfo.ShipNameIndicatorEnumToJsonValue(acctInfo.ShipNameIndicatorOption.Value.Value); + writer.WriteString("shipNameIndicator", shipNameIndicatorRawValue); + var suspiciousAccActivityRawValue = AcctInfo.SuspiciousAccActivityEnumToJsonValue(acctInfo.SuspiciousAccActivityOption.Value.Value); + writer.WriteString("suspiciousAccActivity", suspiciousAccActivityRawValue); + if (acctInfo.TxnActivityDayOption.IsSet) + writer.WriteString("txnActivityDay", acctInfo.TxnActivityDay); + + if (acctInfo.TxnActivityYearOption.IsSet) + writer.WriteString("txnActivityYear", acctInfo.TxnActivityYear); } } - } diff --git a/Adyen/Model/Checkout/AchDetails.cs b/Adyen/Model/Checkout/AchDetails.cs index 17a32245d..41fbd1755 100644 --- a/Adyen/Model/Checkout/AchDetails.cs +++ b/Adyen/Model/Checkout/AchDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,231 +14,494 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AchDetails /// - [DataContract(Name = "AchDetails")] - public partial class AchDetails : IEquatable, IValidatableObject + public partial class AchDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The account holder type (personal or business). + /// The bank account number (without separators). + /// The bank account type (checking, savings...). + /// The bank routing number of the account. The field value is `nil` in most cases. + /// The checkout attempt identifier. + /// Encrypted bank account number. The bank account number (without separators). + /// Encrypted location id. The bank routing number of the account. The field value is `nil` in most cases. + /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. + /// **ach** (default to TypeEnum.Ach) + [JsonConstructor] + public AchDetails(Option accountHolderType = default, Option bankAccountNumber = default, Option bankAccountType = default, Option bankLocationId = default, Option checkoutAttemptId = default, Option encryptedBankAccountNumber = default, Option encryptedBankLocationId = default, Option ownerName = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option transferInstrumentId = default, Option type = default) + { + AccountHolderTypeOption = accountHolderType; + BankAccountNumberOption = bankAccountNumber; + BankAccountTypeOption = bankAccountType; + BankLocationIdOption = bankLocationId; + CheckoutAttemptIdOption = checkoutAttemptId; + EncryptedBankAccountNumberOption = encryptedBankAccountNumber; + EncryptedBankLocationIdOption = encryptedBankLocationId; + OwnerNameOption = ownerName; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TransferInstrumentIdOption = transferInstrumentId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The account holder type (personal or business). /// /// The account holder type (personal or business). - [JsonConverter(typeof(StringEnumConverter))] public enum AccountHolderTypeEnum { /// /// Enum Business for value: business /// - [EnumMember(Value = "business")] Business = 1, /// /// Enum Personal for value: personal /// - [EnumMember(Value = "personal")] Personal = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static AccountHolderTypeEnum AccountHolderTypeEnumFromString(string value) + { + if (value.Equals("business")) + return AccountHolderTypeEnum.Business; + + if (value.Equals("personal")) + return AccountHolderTypeEnum.Personal; + + throw new NotImplementedException($"Could not convert value to type AccountHolderTypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static AccountHolderTypeEnum? AccountHolderTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("business")) + return AccountHolderTypeEnum.Business; + + if (value.Equals("personal")) + return AccountHolderTypeEnum.Personal; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string AccountHolderTypeEnumToJsonValue(AccountHolderTypeEnum? value) + { + if (value == AccountHolderTypeEnum.Business) + return "business"; + + if (value == AccountHolderTypeEnum.Personal) + return "personal"; + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of AccountHolderType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountHolderTypeOption { get; private set; } /// /// The account holder type (personal or business). /// /// The account holder type (personal or business). - [DataMember(Name = "accountHolderType", EmitDefaultValue = false)] - public AccountHolderTypeEnum? AccountHolderType { get; set; } + [JsonPropertyName("accountHolderType")] + public AccountHolderTypeEnum? AccountHolderType { get { return this.AccountHolderTypeOption; } set { this.AccountHolderTypeOption = new Option(value); } } + /// /// The bank account type (checking, savings...). /// /// The bank account type (checking, savings...). - [JsonConverter(typeof(StringEnumConverter))] public enum BankAccountTypeEnum { /// /// Enum Balance for value: balance /// - [EnumMember(Value = "balance")] Balance = 1, /// /// Enum Checking for value: checking /// - [EnumMember(Value = "checking")] Checking = 2, /// /// Enum Deposit for value: deposit /// - [EnumMember(Value = "deposit")] Deposit = 3, /// /// Enum General for value: general /// - [EnumMember(Value = "general")] General = 4, /// /// Enum Other for value: other /// - [EnumMember(Value = "other")] Other = 5, /// /// Enum Payment for value: payment /// - [EnumMember(Value = "payment")] Payment = 6, /// /// Enum Savings for value: savings /// - [EnumMember(Value = "savings")] Savings = 7 + } + + /// + /// Returns a + /// + /// + /// + /// + public static BankAccountTypeEnum BankAccountTypeEnumFromString(string value) + { + if (value.Equals("balance")) + return BankAccountTypeEnum.Balance; + + if (value.Equals("checking")) + return BankAccountTypeEnum.Checking; + + if (value.Equals("deposit")) + return BankAccountTypeEnum.Deposit; + + if (value.Equals("general")) + return BankAccountTypeEnum.General; + + if (value.Equals("other")) + return BankAccountTypeEnum.Other; + + if (value.Equals("payment")) + return BankAccountTypeEnum.Payment; + + if (value.Equals("savings")) + return BankAccountTypeEnum.Savings; + + throw new NotImplementedException($"Could not convert value to type BankAccountTypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static BankAccountTypeEnum? BankAccountTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("balance")) + return BankAccountTypeEnum.Balance; + + if (value.Equals("checking")) + return BankAccountTypeEnum.Checking; + + if (value.Equals("deposit")) + return BankAccountTypeEnum.Deposit; + + if (value.Equals("general")) + return BankAccountTypeEnum.General; + if (value.Equals("other")) + return BankAccountTypeEnum.Other; + + if (value.Equals("payment")) + return BankAccountTypeEnum.Payment; + + if (value.Equals("savings")) + return BankAccountTypeEnum.Savings; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string BankAccountTypeEnumToJsonValue(BankAccountTypeEnum? value) + { + if (value == BankAccountTypeEnum.Balance) + return "balance"; + + if (value == BankAccountTypeEnum.Checking) + return "checking"; + + if (value == BankAccountTypeEnum.Deposit) + return "deposit"; + + if (value == BankAccountTypeEnum.General) + return "general"; + + if (value == BankAccountTypeEnum.Other) + return "other"; + + if (value == BankAccountTypeEnum.Payment) + return "payment"; + + if (value == BankAccountTypeEnum.Savings) + return "savings"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of BankAccountType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankAccountTypeOption { get; private set; } /// /// The bank account type (checking, savings...). /// /// The bank account type (checking, savings...). - [DataMember(Name = "bankAccountType", EmitDefaultValue = false)] - public BankAccountTypeEnum? BankAccountType { get; set; } + [JsonPropertyName("bankAccountType")] + public BankAccountTypeEnum? BankAccountType { get { return this.BankAccountTypeOption; } set { this.BankAccountTypeOption = new Option(value); } } + /// /// **ach** /// /// **ach** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Ach for value: ach /// - [EnumMember(Value = "ach")] Ach = 1, /// /// Enum AchPlaid for value: ach_plaid /// - [EnumMember(Value = "ach_plaid")] AchPlaid = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("ach")) + return TypeEnum.Ach; + + if (value.Equals("ach_plaid")) + return TypeEnum.AchPlaid; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("ach")) + return TypeEnum.Ach; + + if (value.Equals("ach_plaid")) + return TypeEnum.AchPlaid; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Ach) + return "ach"; + + if (value == TypeEnum.AchPlaid) + return "ach_plaid"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **ach** /// /// **ach** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of BankAccountNumber /// - /// The account holder type (personal or business).. - /// The bank account number (without separators).. - /// The bank account type (checking, savings...).. - /// The bank routing number of the account. The field value is `nil` in most cases.. - /// The checkout attempt identifier.. - /// Encrypted bank account number. The bank account number (without separators).. - /// Encrypted location id. The bank routing number of the account. The field value is `nil` in most cases.. - /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts.. - /// **ach** (default to TypeEnum.Ach). - public AchDetails(AccountHolderTypeEnum? accountHolderType = default(AccountHolderTypeEnum?), string bankAccountNumber = default(string), BankAccountTypeEnum? bankAccountType = default(BankAccountTypeEnum?), string bankLocationId = default(string), string checkoutAttemptId = default(string), string encryptedBankAccountNumber = default(string), string encryptedBankLocationId = default(string), string ownerName = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string transferInstrumentId = default(string), TypeEnum? type = TypeEnum.Ach) - { - this.AccountHolderType = accountHolderType; - this.BankAccountNumber = bankAccountNumber; - this.BankAccountType = bankAccountType; - this.BankLocationId = bankLocationId; - this.CheckoutAttemptId = checkoutAttemptId; - this.EncryptedBankAccountNumber = encryptedBankAccountNumber; - this.EncryptedBankLocationId = encryptedBankLocationId; - this.OwnerName = ownerName; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.TransferInstrumentId = transferInstrumentId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankAccountNumberOption { get; private set; } /// /// The bank account number (without separators). /// /// The bank account number (without separators). - [DataMember(Name = "bankAccountNumber", EmitDefaultValue = false)] - public string BankAccountNumber { get; set; } + [JsonPropertyName("bankAccountNumber")] + public string BankAccountNumber { get { return this.BankAccountNumberOption; } set { this.BankAccountNumberOption = new Option(value); } } + + /// + /// Used to track the state of BankLocationId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankLocationIdOption { get; private set; } /// /// The bank routing number of the account. The field value is `nil` in most cases. /// /// The bank routing number of the account. The field value is `nil` in most cases. - [DataMember(Name = "bankLocationId", EmitDefaultValue = false)] - public string BankLocationId { get; set; } + [JsonPropertyName("bankLocationId")] + public string BankLocationId { get { return this.BankLocationIdOption; } set { this.BankLocationIdOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedBankAccountNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedBankAccountNumberOption { get; private set; } /// /// Encrypted bank account number. The bank account number (without separators). /// /// Encrypted bank account number. The bank account number (without separators). - [DataMember(Name = "encryptedBankAccountNumber", EmitDefaultValue = false)] - public string EncryptedBankAccountNumber { get; set; } + [JsonPropertyName("encryptedBankAccountNumber")] + public string EncryptedBankAccountNumber { get { return this.EncryptedBankAccountNumberOption; } set { this.EncryptedBankAccountNumberOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedBankLocationId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedBankLocationIdOption { get; private set; } /// /// Encrypted location id. The bank routing number of the account. The field value is `nil` in most cases. /// /// Encrypted location id. The bank routing number of the account. The field value is `nil` in most cases. - [DataMember(Name = "encryptedBankLocationId", EmitDefaultValue = false)] - public string EncryptedBankLocationId { get; set; } + [JsonPropertyName("encryptedBankLocationId")] + public string EncryptedBankLocationId { get { return this.EncryptedBankLocationIdOption; } set { this.EncryptedBankLocationIdOption = new Option(value); } } + + /// + /// Used to track the state of OwnerName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OwnerNameOption { get; private set; } /// /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. /// /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. - [DataMember(Name = "ownerName", EmitDefaultValue = false)] - public string OwnerName { get; set; } + [JsonPropertyName("ownerName")] + public string OwnerName { get { return this.OwnerNameOption; } set { this.OwnerNameOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of TransferInstrumentId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TransferInstrumentIdOption { get; private set; } /// /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. /// /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. - [DataMember(Name = "transferInstrumentId", EmitDefaultValue = false)] - public string TransferInstrumentId { get; set; } + [JsonPropertyName("transferInstrumentId")] + public string TransferInstrumentId { get { return this.TransferInstrumentIdOption; } set { this.TransferInstrumentIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -266,161 +528,243 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as AchDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class AchDetailsJsonConverter : JsonConverter + { /// - /// Returns true if AchDetails instances are equal + /// Deserializes json to /// - /// Instance of AchDetails to be compared - /// Boolean - public bool Equals(AchDetails input) + /// + /// + /// + /// + /// + public override AchDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option accountHolderType = default; + Option bankAccountNumber = default; + Option bankAccountType = default; + Option bankLocationId = default; + Option checkoutAttemptId = default; + Option encryptedBankAccountNumber = default; + Option encryptedBankLocationId = default; + Option ownerName = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option transferInstrumentId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "accountHolderType": + string accountHolderTypeRawValue = utf8JsonReader.GetString(); + if (accountHolderTypeRawValue != null) + accountHolderType = new Option(AchDetails.AccountHolderTypeEnumFromStringOrDefault(accountHolderTypeRawValue)); + break; + case "bankAccountNumber": + bankAccountNumber = new Option(utf8JsonReader.GetString()); + break; + case "bankAccountType": + string bankAccountTypeRawValue = utf8JsonReader.GetString(); + if (bankAccountTypeRawValue != null) + bankAccountType = new Option(AchDetails.BankAccountTypeEnumFromStringOrDefault(bankAccountTypeRawValue)); + break; + case "bankLocationId": + bankLocationId = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "encryptedBankAccountNumber": + encryptedBankAccountNumber = new Option(utf8JsonReader.GetString()); + break; + case "encryptedBankLocationId": + encryptedBankLocationId = new Option(utf8JsonReader.GetString()); + break; + case "ownerName": + ownerName = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "transferInstrumentId": + transferInstrumentId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(AchDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.AccountHolderType == input.AccountHolderType || - this.AccountHolderType.Equals(input.AccountHolderType) - ) && - ( - this.BankAccountNumber == input.BankAccountNumber || - (this.BankAccountNumber != null && - this.BankAccountNumber.Equals(input.BankAccountNumber)) - ) && - ( - this.BankAccountType == input.BankAccountType || - this.BankAccountType.Equals(input.BankAccountType) - ) && - ( - this.BankLocationId == input.BankLocationId || - (this.BankLocationId != null && - this.BankLocationId.Equals(input.BankLocationId)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.EncryptedBankAccountNumber == input.EncryptedBankAccountNumber || - (this.EncryptedBankAccountNumber != null && - this.EncryptedBankAccountNumber.Equals(input.EncryptedBankAccountNumber)) - ) && - ( - this.EncryptedBankLocationId == input.EncryptedBankLocationId || - (this.EncryptedBankLocationId != null && - this.EncryptedBankLocationId.Equals(input.EncryptedBankLocationId)) - ) && - ( - this.OwnerName == input.OwnerName || - (this.OwnerName != null && - this.OwnerName.Equals(input.OwnerName)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.TransferInstrumentId == input.TransferInstrumentId || - (this.TransferInstrumentId != null && - this.TransferInstrumentId.Equals(input.TransferInstrumentId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (accountHolderType.IsSet && accountHolderType.Value == null) + throw new ArgumentNullException(nameof(accountHolderType), "Property is not nullable for class AchDetails."); + + if (bankAccountNumber.IsSet && bankAccountNumber.Value == null) + throw new ArgumentNullException(nameof(bankAccountNumber), "Property is not nullable for class AchDetails."); + + if (bankAccountType.IsSet && bankAccountType.Value == null) + throw new ArgumentNullException(nameof(bankAccountType), "Property is not nullable for class AchDetails."); + + if (bankLocationId.IsSet && bankLocationId.Value == null) + throw new ArgumentNullException(nameof(bankLocationId), "Property is not nullable for class AchDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class AchDetails."); + + if (encryptedBankAccountNumber.IsSet && encryptedBankAccountNumber.Value == null) + throw new ArgumentNullException(nameof(encryptedBankAccountNumber), "Property is not nullable for class AchDetails."); + + if (encryptedBankLocationId.IsSet && encryptedBankLocationId.Value == null) + throw new ArgumentNullException(nameof(encryptedBankLocationId), "Property is not nullable for class AchDetails."); + + if (ownerName.IsSet && ownerName.Value == null) + throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class AchDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class AchDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class AchDetails."); + + if (transferInstrumentId.IsSet && transferInstrumentId.Value == null) + throw new ArgumentNullException(nameof(transferInstrumentId), "Property is not nullable for class AchDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class AchDetails."); + + return new AchDetails(accountHolderType, bankAccountNumber, bankAccountType, bankLocationId, checkoutAttemptId, encryptedBankAccountNumber, encryptedBankLocationId, ownerName, recurringDetailReference, storedPaymentMethodId, transferInstrumentId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AchDetails achDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.AccountHolderType.GetHashCode(); - if (this.BankAccountNumber != null) - { - hashCode = (hashCode * 59) + this.BankAccountNumber.GetHashCode(); - } - hashCode = (hashCode * 59) + this.BankAccountType.GetHashCode(); - if (this.BankLocationId != null) - { - hashCode = (hashCode * 59) + this.BankLocationId.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.EncryptedBankAccountNumber != null) - { - hashCode = (hashCode * 59) + this.EncryptedBankAccountNumber.GetHashCode(); - } - if (this.EncryptedBankLocationId != null) - { - hashCode = (hashCode * 59) + this.EncryptedBankLocationId.GetHashCode(); - } - if (this.OwnerName != null) - { - hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.TransferInstrumentId != null) - { - hashCode = (hashCode * 59) + this.TransferInstrumentId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, achDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AchDetails achDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (achDetails.BankAccountNumberOption.IsSet && achDetails.BankAccountNumber == null) + throw new ArgumentNullException(nameof(achDetails.BankAccountNumber), "Property is required for class AchDetails."); - yield break; + if (achDetails.BankLocationIdOption.IsSet && achDetails.BankLocationId == null) + throw new ArgumentNullException(nameof(achDetails.BankLocationId), "Property is required for class AchDetails."); + + if (achDetails.CheckoutAttemptIdOption.IsSet && achDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(achDetails.CheckoutAttemptId), "Property is required for class AchDetails."); + + if (achDetails.EncryptedBankAccountNumberOption.IsSet && achDetails.EncryptedBankAccountNumber == null) + throw new ArgumentNullException(nameof(achDetails.EncryptedBankAccountNumber), "Property is required for class AchDetails."); + + if (achDetails.EncryptedBankLocationIdOption.IsSet && achDetails.EncryptedBankLocationId == null) + throw new ArgumentNullException(nameof(achDetails.EncryptedBankLocationId), "Property is required for class AchDetails."); + + if (achDetails.OwnerNameOption.IsSet && achDetails.OwnerName == null) + throw new ArgumentNullException(nameof(achDetails.OwnerName), "Property is required for class AchDetails."); + + if (achDetails.RecurringDetailReferenceOption.IsSet && achDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(achDetails.RecurringDetailReference), "Property is required for class AchDetails."); + + if (achDetails.StoredPaymentMethodIdOption.IsSet && achDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(achDetails.StoredPaymentMethodId), "Property is required for class AchDetails."); + + if (achDetails.TransferInstrumentIdOption.IsSet && achDetails.TransferInstrumentId == null) + throw new ArgumentNullException(nameof(achDetails.TransferInstrumentId), "Property is required for class AchDetails."); + + var accountHolderTypeRawValue = AchDetails.AccountHolderTypeEnumToJsonValue(achDetails.AccountHolderTypeOption.Value.Value); + writer.WriteString("accountHolderType", accountHolderTypeRawValue); + if (achDetails.BankAccountNumberOption.IsSet) + writer.WriteString("bankAccountNumber", achDetails.BankAccountNumber); + + var bankAccountTypeRawValue = AchDetails.BankAccountTypeEnumToJsonValue(achDetails.BankAccountTypeOption.Value.Value); + writer.WriteString("bankAccountType", bankAccountTypeRawValue); + if (achDetails.BankLocationIdOption.IsSet) + writer.WriteString("bankLocationId", achDetails.BankLocationId); + + if (achDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", achDetails.CheckoutAttemptId); + + if (achDetails.EncryptedBankAccountNumberOption.IsSet) + writer.WriteString("encryptedBankAccountNumber", achDetails.EncryptedBankAccountNumber); + + if (achDetails.EncryptedBankLocationIdOption.IsSet) + writer.WriteString("encryptedBankLocationId", achDetails.EncryptedBankLocationId); + + if (achDetails.OwnerNameOption.IsSet) + writer.WriteString("ownerName", achDetails.OwnerName); + + if (achDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", achDetails.RecurringDetailReference); + + if (achDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", achDetails.StoredPaymentMethodId); + + if (achDetails.TransferInstrumentIdOption.IsSet) + writer.WriteString("transferInstrumentId", achDetails.TransferInstrumentId); + + var typeRawValue = AchDetails.TypeEnumToJsonValue(achDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/AdditionalData3DSecure.cs b/Adyen/Model/Checkout/AdditionalData3DSecure.cs index 3afeb1d89..7a8effda5 100644 --- a/Adyen/Model/Checkout/AdditionalData3DSecure.cs +++ b/Adyen/Model/Checkout/AdditionalData3DSecure.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,124 +14,237 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalData3DSecure /// - [DataContract(Name = "AdditionalData3DSecure")] - public partial class AdditionalData3DSecure : IEquatable, IValidatableObject + public partial class AdditionalData3DSecure : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen selects redirect or native authentication based on your configuration to optimize authorization rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen offers redirect 3D Secure 2 authentication instead, based on your configuration. + /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen + /// Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. + /// In case of Secure+, this field must be set to **CUPSecurePlus**. + /// Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + /// Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. * If you the BIN is not enrolled, you will receive an error. + [JsonConstructor] + public AdditionalData3DSecure(Option allow3DS2 = default, Option challengeWindowSize = default, Option executeThreeD = default, Option mpiImplementationType = default, Option scaExemption = default, Option threeDSVersion = default) + { + Allow3DS2Option = allow3DS2; + ChallengeWindowSizeOption = challengeWindowSize; + ExecuteThreeDOption = executeThreeD; + MpiImplementationTypeOption = mpiImplementationType; + ScaExemptionOption = scaExemption; + ThreeDSVersionOption = threeDSVersion; + OnCreated(); + } + + partial void OnCreated(); + /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen - [JsonConverter(typeof(StringEnumConverter))] public enum ChallengeWindowSizeEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// - [EnumMember(Value = "05")] _05 = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ChallengeWindowSizeEnum ChallengeWindowSizeEnumFromString(string value) + { + if (value.Equals("01")) + return ChallengeWindowSizeEnum._01; + + if (value.Equals("02")) + return ChallengeWindowSizeEnum._02; + + if (value.Equals("03")) + return ChallengeWindowSizeEnum._03; + if (value.Equals("04")) + return ChallengeWindowSizeEnum._04; + + if (value.Equals("05")) + return ChallengeWindowSizeEnum._05; + + throw new NotImplementedException($"Could not convert value to type ChallengeWindowSizeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static ChallengeWindowSizeEnum? ChallengeWindowSizeEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ChallengeWindowSizeEnum._01; + + if (value.Equals("02")) + return ChallengeWindowSizeEnum._02; + + if (value.Equals("03")) + return ChallengeWindowSizeEnum._03; + + if (value.Equals("04")) + return ChallengeWindowSizeEnum._04; + + if (value.Equals("05")) + return ChallengeWindowSizeEnum._05; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChallengeWindowSizeEnumToJsonValue(ChallengeWindowSizeEnum? value) + { + if (value == ChallengeWindowSizeEnum._01) + return "01"; + + if (value == ChallengeWindowSizeEnum._02) + return "02"; + + if (value == ChallengeWindowSizeEnum._03) + return "03"; + + if (value == ChallengeWindowSizeEnum._04) + return "04"; + + if (value == ChallengeWindowSizeEnum._05) + return "05"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ChallengeWindowSize + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChallengeWindowSizeOption { get; private set; } /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen - [DataMember(Name = "challengeWindowSize", EmitDefaultValue = false)] - public ChallengeWindowSizeEnum? ChallengeWindowSize { get; set; } + [JsonPropertyName("challengeWindowSize")] + public ChallengeWindowSizeEnum? ChallengeWindowSize { get { return this.ChallengeWindowSizeOption; } set { this.ChallengeWindowSizeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of Allow3DS2 /// - /// Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen selects redirect or native authentication based on your configuration to optimize authorization rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen offers redirect 3D Secure 2 authentication instead, based on your configuration. . - /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen. - /// Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. . - /// In case of Secure+, this field must be set to **CUPSecurePlus**.. - /// Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** . - /// Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. * If you the BIN is not enrolled, you will receive an error. . - public AdditionalData3DSecure(string allow3DS2 = default(string), ChallengeWindowSizeEnum? challengeWindowSize = default(ChallengeWindowSizeEnum?), string executeThreeD = default(string), string mpiImplementationType = default(string), string scaExemption = default(string), string threeDSVersion = default(string)) - { - this.Allow3DS2 = allow3DS2; - this.ChallengeWindowSize = challengeWindowSize; - this.ExecuteThreeD = executeThreeD; - this.MpiImplementationType = mpiImplementationType; - this.ScaExemption = scaExemption; - this.ThreeDSVersion = threeDSVersion; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option Allow3DS2Option { get; private set; } /// /// Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen selects redirect or native authentication based on your configuration to optimize authorization rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen offers redirect 3D Secure 2 authentication instead, based on your configuration. /// /// Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen selects redirect or native authentication based on your configuration to optimize authorization rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen offers redirect 3D Secure 2 authentication instead, based on your configuration. - [DataMember(Name = "allow3DS2", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.threeDSRequestData.nativeThreeDS` instead.")] - public string Allow3DS2 { get; set; } + [JsonPropertyName("allow3DS2")] + [Obsolete] + public string Allow3DS2 { get { return this.Allow3DS2Option; } set { this.Allow3DS2Option = new Option(value); } } + + /// + /// Used to track the state of ExecuteThreeD + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExecuteThreeDOption { get; private set; } /// /// Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. /// /// Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. - [DataMember(Name = "executeThreeD", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v69. Use [`authenticationData.attemptAuthentication`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments?target=_blank#request-authenticationData-attemptAuthentication) instead")] - public string ExecuteThreeD { get; set; } + [JsonPropertyName("executeThreeD")] + [Obsolete] + public string ExecuteThreeD { get { return this.ExecuteThreeDOption; } set { this.ExecuteThreeDOption = new Option(value); } } + + /// + /// Used to track the state of MpiImplementationType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MpiImplementationTypeOption { get; private set; } /// /// In case of Secure+, this field must be set to **CUPSecurePlus**. /// /// In case of Secure+, this field must be set to **CUPSecurePlus**. - [DataMember(Name = "mpiImplementationType", EmitDefaultValue = false)] - public string MpiImplementationType { get; set; } + [JsonPropertyName("mpiImplementationType")] + public string MpiImplementationType { get { return this.MpiImplementationTypeOption; } set { this.MpiImplementationTypeOption = new Option(value); } } + + /// + /// Used to track the state of ScaExemption + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ScaExemptionOption { get; private set; } /// /// Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** /// /// Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** - [DataMember(Name = "scaExemption", EmitDefaultValue = false)] - public string ScaExemption { get; set; } + [JsonPropertyName("scaExemption")] + public string ScaExemption { get { return this.ScaExemptionOption; } set { this.ScaExemptionOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSVersionOption { get; private set; } /// /// Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. * If you the BIN is not enrolled, you will receive an error. /// /// Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. * If you the BIN is not enrolled, you will receive an error. - [DataMember(Name = "threeDSVersion", EmitDefaultValue = false)] - public string ThreeDSVersion { get; set; } + [JsonPropertyName("threeDSVersion")] + public string ThreeDSVersion { get { return this.ThreeDSVersionOption; } set { this.ThreeDSVersionOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -153,109 +265,162 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalData3DSecureJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AdditionalData3DSecure Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AdditionalData3DSecure); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AdditionalData3DSecure instances are equal - /// - /// Instance of AdditionalData3DSecure to be compared - /// Boolean - public bool Equals(AdditionalData3DSecure input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option allow3DS2 = default; + Option challengeWindowSize = default; + Option executeThreeD = default; + Option mpiImplementationType = default; + Option scaExemption = default; + Option threeDSVersion = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "allow3DS2": + allow3DS2 = new Option(utf8JsonReader.GetString()); + break; + case "challengeWindowSize": + string challengeWindowSizeRawValue = utf8JsonReader.GetString(); + if (challengeWindowSizeRawValue != null) + challengeWindowSize = new Option(AdditionalData3DSecure.ChallengeWindowSizeEnumFromStringOrDefault(challengeWindowSizeRawValue)); + break; + case "executeThreeD": + executeThreeD = new Option(utf8JsonReader.GetString()); + break; + case "mpiImplementationType": + mpiImplementationType = new Option(utf8JsonReader.GetString()); + break; + case "scaExemption": + scaExemption = new Option(utf8JsonReader.GetString()); + break; + case "threeDSVersion": + threeDSVersion = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Allow3DS2 == input.Allow3DS2 || - (this.Allow3DS2 != null && - this.Allow3DS2.Equals(input.Allow3DS2)) - ) && - ( - this.ChallengeWindowSize == input.ChallengeWindowSize || - this.ChallengeWindowSize.Equals(input.ChallengeWindowSize) - ) && - ( - this.ExecuteThreeD == input.ExecuteThreeD || - (this.ExecuteThreeD != null && - this.ExecuteThreeD.Equals(input.ExecuteThreeD)) - ) && - ( - this.MpiImplementationType == input.MpiImplementationType || - (this.MpiImplementationType != null && - this.MpiImplementationType.Equals(input.MpiImplementationType)) - ) && - ( - this.ScaExemption == input.ScaExemption || - (this.ScaExemption != null && - this.ScaExemption.Equals(input.ScaExemption)) - ) && - ( - this.ThreeDSVersion == input.ThreeDSVersion || - (this.ThreeDSVersion != null && - this.ThreeDSVersion.Equals(input.ThreeDSVersion)) - ); + + if (allow3DS2.IsSet && allow3DS2.Value == null) + throw new ArgumentNullException(nameof(allow3DS2), "Property is not nullable for class AdditionalData3DSecure."); + + if (challengeWindowSize.IsSet && challengeWindowSize.Value == null) + throw new ArgumentNullException(nameof(challengeWindowSize), "Property is not nullable for class AdditionalData3DSecure."); + + if (executeThreeD.IsSet && executeThreeD.Value == null) + throw new ArgumentNullException(nameof(executeThreeD), "Property is not nullable for class AdditionalData3DSecure."); + + if (mpiImplementationType.IsSet && mpiImplementationType.Value == null) + throw new ArgumentNullException(nameof(mpiImplementationType), "Property is not nullable for class AdditionalData3DSecure."); + + if (scaExemption.IsSet && scaExemption.Value == null) + throw new ArgumentNullException(nameof(scaExemption), "Property is not nullable for class AdditionalData3DSecure."); + + if (threeDSVersion.IsSet && threeDSVersion.Value == null) + throw new ArgumentNullException(nameof(threeDSVersion), "Property is not nullable for class AdditionalData3DSecure."); + + return new AdditionalData3DSecure(allow3DS2, challengeWindowSize, executeThreeD, mpiImplementationType, scaExemption, threeDSVersion); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalData3DSecure additionalData3DSecure, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Allow3DS2 != null) - { - hashCode = (hashCode * 59) + this.Allow3DS2.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ChallengeWindowSize.GetHashCode(); - if (this.ExecuteThreeD != null) - { - hashCode = (hashCode * 59) + this.ExecuteThreeD.GetHashCode(); - } - if (this.MpiImplementationType != null) - { - hashCode = (hashCode * 59) + this.MpiImplementationType.GetHashCode(); - } - if (this.ScaExemption != null) - { - hashCode = (hashCode * 59) + this.ScaExemption.GetHashCode(); - } - if (this.ThreeDSVersion != null) - { - hashCode = (hashCode * 59) + this.ThreeDSVersion.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalData3DSecure, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalData3DSecure additionalData3DSecure, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalData3DSecure.Allow3DS2Option.IsSet && additionalData3DSecure.Allow3DS2 == null) + throw new ArgumentNullException(nameof(additionalData3DSecure.Allow3DS2), "Property is required for class AdditionalData3DSecure."); + + if (additionalData3DSecure.ExecuteThreeDOption.IsSet && additionalData3DSecure.ExecuteThreeD == null) + throw new ArgumentNullException(nameof(additionalData3DSecure.ExecuteThreeD), "Property is required for class AdditionalData3DSecure."); + + if (additionalData3DSecure.MpiImplementationTypeOption.IsSet && additionalData3DSecure.MpiImplementationType == null) + throw new ArgumentNullException(nameof(additionalData3DSecure.MpiImplementationType), "Property is required for class AdditionalData3DSecure."); + + if (additionalData3DSecure.ScaExemptionOption.IsSet && additionalData3DSecure.ScaExemption == null) + throw new ArgumentNullException(nameof(additionalData3DSecure.ScaExemption), "Property is required for class AdditionalData3DSecure."); + + if (additionalData3DSecure.ThreeDSVersionOption.IsSet && additionalData3DSecure.ThreeDSVersion == null) + throw new ArgumentNullException(nameof(additionalData3DSecure.ThreeDSVersion), "Property is required for class AdditionalData3DSecure."); + + if (additionalData3DSecure.Allow3DS2Option.IsSet) + writer.WriteString("allow3DS2", additionalData3DSecure.Allow3DS2); + + var challengeWindowSizeRawValue = AdditionalData3DSecure.ChallengeWindowSizeEnumToJsonValue(additionalData3DSecure.ChallengeWindowSizeOption.Value.Value); + writer.WriteString("challengeWindowSize", challengeWindowSizeRawValue); + if (additionalData3DSecure.ExecuteThreeDOption.IsSet) + writer.WriteString("executeThreeD", additionalData3DSecure.ExecuteThreeD); + + if (additionalData3DSecure.MpiImplementationTypeOption.IsSet) + writer.WriteString("mpiImplementationType", additionalData3DSecure.MpiImplementationType); + + if (additionalData3DSecure.ScaExemptionOption.IsSet) + writer.WriteString("scaExemption", additionalData3DSecure.ScaExemption); + + if (additionalData3DSecure.ThreeDSVersionOption.IsSet) + writer.WriteString("threeDSVersion", additionalData3DSecure.ThreeDSVersion); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataAirline.cs b/Adyen/Model/Checkout/AdditionalDataAirline.cs index 76180793a..fa5b95c07 100644 --- a/Adyen/Model/Checkout/AdditionalDataAirline.cs +++ b/Adyen/Model/Checkout/AdditionalDataAirline.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,295 +14,487 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataAirline /// - [DataContract(Name = "AdditionalDataAirline")] - public partial class AdditionalDataAirline : IEquatable, IValidatableObject + public partial class AdditionalDataAirline : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected AdditionalDataAirline() { } - /// - /// Initializes a new instance of the class. - /// - /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters. - /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters. - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros.. - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros.. - /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters. - /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters. - /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces. - /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters. - /// The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters. - /// The date that the ticket was issued to the passenger. * minLength: 6 characters * maxLength: 6 characters * Date format: YYMMDD. - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros.. - /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros.. - /// Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters. - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros.. - /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros.. - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros.. - /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros.. - /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros.. - /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character. - /// The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10. - /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII. - /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII. - /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters. - /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters. - /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros. (required). - /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters. - /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros.. - /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros.. - /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros.. - public AdditionalDataAirline(string airlineAgencyInvoiceNumber = default(string), string airlineAgencyPlanName = default(string), string airlineAirlineCode = default(string), string airlineAirlineDesignatorCode = default(string), string airlineBoardingFee = default(string), string airlineComputerizedReservationSystem = default(string), string airlineCustomerReferenceNumber = default(string), string airlineDocumentType = default(string), string airlineFlightDate = default(string), string airlineIssueDate = default(string), string airlineLegCarrierCode = default(string), string airlineLegClassOfTravel = default(string), string airlineLegDateOfTravel = default(string), string airlineLegDepartAirport = default(string), string airlineLegDepartTax = default(string), string airlineLegDestinationCode = default(string), string airlineLegFareBaseCode = default(string), string airlineLegFlightNumber = default(string), string airlineLegStopOverCode = default(string), string airlinePassengerDateOfBirth = default(string), string airlinePassengerFirstName = default(string), string airlinePassengerLastName = default(string), string airlinePassengerPhoneNumber = default(string), string airlinePassengerTravellerType = default(string), string airlinePassengerName = default(string), string airlineTicketIssueAddress = default(string), string airlineTicketNumber = default(string), string airlineTravelAgencyCode = default(string), string airlineTravelAgencyName = default(string)) + /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros. + /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters + /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros. + /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters + /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters + /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces + /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters + /// The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters + /// The date that the ticket was issued to the passenger. * minLength: 6 characters * maxLength: 6 characters * Date format: YYMMDD + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros. + /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros. + /// Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. + /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros. + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. + /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros. + /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros. + /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character + /// The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 + /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII + /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII + /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters + /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters + /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters + /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros. + /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros. + /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros. + [JsonConstructor] + public AdditionalDataAirline(string airlinePassengerName, Option airlineAgencyInvoiceNumber = default, Option airlineAgencyPlanName = default, Option airlineAirlineCode = default, Option airlineAirlineDesignatorCode = default, Option airlineBoardingFee = default, Option airlineComputerizedReservationSystem = default, Option airlineCustomerReferenceNumber = default, Option airlineDocumentType = default, Option airlineFlightDate = default, Option airlineIssueDate = default, Option airlineLegCarrierCode = default, Option airlineLegClassOfTravel = default, Option airlineLegDateOfTravel = default, Option airlineLegDepartAirport = default, Option airlineLegDepartTax = default, Option airlineLegDestinationCode = default, Option airlineLegFareBaseCode = default, Option airlineLegFlightNumber = default, Option airlineLegStopOverCode = default, Option airlinePassengerDateOfBirth = default, Option airlinePassengerFirstName = default, Option airlinePassengerLastName = default, Option airlinePassengerPhoneNumber = default, Option airlinePassengerTravellerType = default, Option airlineTicketIssueAddress = default, Option airlineTicketNumber = default, Option airlineTravelAgencyCode = default, Option airlineTravelAgencyName = default) { - this.AirlinePassengerName = airlinePassengerName; - this.AirlineAgencyInvoiceNumber = airlineAgencyInvoiceNumber; - this.AirlineAgencyPlanName = airlineAgencyPlanName; - this.AirlineAirlineCode = airlineAirlineCode; - this.AirlineAirlineDesignatorCode = airlineAirlineDesignatorCode; - this.AirlineBoardingFee = airlineBoardingFee; - this.AirlineComputerizedReservationSystem = airlineComputerizedReservationSystem; - this.AirlineCustomerReferenceNumber = airlineCustomerReferenceNumber; - this.AirlineDocumentType = airlineDocumentType; - this.AirlineFlightDate = airlineFlightDate; - this.AirlineIssueDate = airlineIssueDate; - this.AirlineLegCarrierCode = airlineLegCarrierCode; - this.AirlineLegClassOfTravel = airlineLegClassOfTravel; - this.AirlineLegDateOfTravel = airlineLegDateOfTravel; - this.AirlineLegDepartAirport = airlineLegDepartAirport; - this.AirlineLegDepartTax = airlineLegDepartTax; - this.AirlineLegDestinationCode = airlineLegDestinationCode; - this.AirlineLegFareBaseCode = airlineLegFareBaseCode; - this.AirlineLegFlightNumber = airlineLegFlightNumber; - this.AirlineLegStopOverCode = airlineLegStopOverCode; - this.AirlinePassengerDateOfBirth = airlinePassengerDateOfBirth; - this.AirlinePassengerFirstName = airlinePassengerFirstName; - this.AirlinePassengerLastName = airlinePassengerLastName; - this.AirlinePassengerPhoneNumber = airlinePassengerPhoneNumber; - this.AirlinePassengerTravellerType = airlinePassengerTravellerType; - this.AirlineTicketIssueAddress = airlineTicketIssueAddress; - this.AirlineTicketNumber = airlineTicketNumber; - this.AirlineTravelAgencyCode = airlineTravelAgencyCode; - this.AirlineTravelAgencyName = airlineTravelAgencyName; + AirlinePassengerName = airlinePassengerName; + AirlineAgencyInvoiceNumberOption = airlineAgencyInvoiceNumber; + AirlineAgencyPlanNameOption = airlineAgencyPlanName; + AirlineAirlineCodeOption = airlineAirlineCode; + AirlineAirlineDesignatorCodeOption = airlineAirlineDesignatorCode; + AirlineBoardingFeeOption = airlineBoardingFee; + AirlineComputerizedReservationSystemOption = airlineComputerizedReservationSystem; + AirlineCustomerReferenceNumberOption = airlineCustomerReferenceNumber; + AirlineDocumentTypeOption = airlineDocumentType; + AirlineFlightDateOption = airlineFlightDate; + AirlineIssueDateOption = airlineIssueDate; + AirlineLegCarrierCodeOption = airlineLegCarrierCode; + AirlineLegClassOfTravelOption = airlineLegClassOfTravel; + AirlineLegDateOfTravelOption = airlineLegDateOfTravel; + AirlineLegDepartAirportOption = airlineLegDepartAirport; + AirlineLegDepartTaxOption = airlineLegDepartTax; + AirlineLegDestinationCodeOption = airlineLegDestinationCode; + AirlineLegFareBaseCodeOption = airlineLegFareBaseCode; + AirlineLegFlightNumberOption = airlineLegFlightNumber; + AirlineLegStopOverCodeOption = airlineLegStopOverCode; + AirlinePassengerDateOfBirthOption = airlinePassengerDateOfBirth; + AirlinePassengerFirstNameOption = airlinePassengerFirstName; + AirlinePassengerLastNameOption = airlinePassengerLastName; + AirlinePassengerPhoneNumberOption = airlinePassengerPhoneNumber; + AirlinePassengerTravellerTypeOption = airlinePassengerTravellerType; + AirlineTicketIssueAddressOption = airlineTicketIssueAddress; + AirlineTicketNumberOption = airlineTicketNumber; + AirlineTravelAgencyCodeOption = airlineTravelAgencyCode; + AirlineTravelAgencyNameOption = airlineTravelAgencyName; + OnCreated(); } + partial void OnCreated(); + + /// + /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros. + /// + /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros. + [JsonPropertyName("airline.passenger_name")] + public string AirlinePassengerName { get; set; } + + /// + /// Used to track the state of AirlineAgencyInvoiceNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineAgencyInvoiceNumberOption { get; private set; } + /// /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters /// /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters - [DataMember(Name = "airline.agency_invoice_number", EmitDefaultValue = false)] - public string AirlineAgencyInvoiceNumber { get; set; } + [JsonPropertyName("airline.agency_invoice_number")] + public string AirlineAgencyInvoiceNumber { get { return this.AirlineAgencyInvoiceNumberOption; } set { this.AirlineAgencyInvoiceNumberOption = new Option(value); } } + + /// + /// Used to track the state of AirlineAgencyPlanName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineAgencyPlanNameOption { get; private set; } /// /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters /// /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters - [DataMember(Name = "airline.agency_plan_name", EmitDefaultValue = false)] - public string AirlineAgencyPlanName { get; set; } + [JsonPropertyName("airline.agency_plan_name")] + public string AirlineAgencyPlanName { get { return this.AirlineAgencyPlanNameOption; } set { this.AirlineAgencyPlanNameOption = new Option(value); } } + + /// + /// Used to track the state of AirlineAirlineCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineAirlineCodeOption { get; private set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. - [DataMember(Name = "airline.airline_code", EmitDefaultValue = false)] - public string AirlineAirlineCode { get; set; } + [JsonPropertyName("airline.airline_code")] + public string AirlineAirlineCode { get { return this.AirlineAirlineCodeOption; } set { this.AirlineAirlineCodeOption = new Option(value); } } + + /// + /// Used to track the state of AirlineAirlineDesignatorCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineAirlineDesignatorCodeOption { get; private set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros. - [DataMember(Name = "airline.airline_designator_code", EmitDefaultValue = false)] - public string AirlineAirlineDesignatorCode { get; set; } + [JsonPropertyName("airline.airline_designator_code")] + public string AirlineAirlineDesignatorCode { get { return this.AirlineAirlineDesignatorCodeOption; } set { this.AirlineAirlineDesignatorCodeOption = new Option(value); } } + + /// + /// Used to track the state of AirlineBoardingFee + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineBoardingFeeOption { get; private set; } /// /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters /// /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters - [DataMember(Name = "airline.boarding_fee", EmitDefaultValue = false)] - public string AirlineBoardingFee { get; set; } + [JsonPropertyName("airline.boarding_fee")] + public string AirlineBoardingFee { get { return this.AirlineBoardingFeeOption; } set { this.AirlineBoardingFeeOption = new Option(value); } } + + /// + /// Used to track the state of AirlineComputerizedReservationSystem + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineComputerizedReservationSystemOption { get; private set; } /// /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters /// /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters - [DataMember(Name = "airline.computerized_reservation_system", EmitDefaultValue = false)] - public string AirlineComputerizedReservationSystem { get; set; } + [JsonPropertyName("airline.computerized_reservation_system")] + public string AirlineComputerizedReservationSystem { get { return this.AirlineComputerizedReservationSystemOption; } set { this.AirlineComputerizedReservationSystemOption = new Option(value); } } + + /// + /// Used to track the state of AirlineCustomerReferenceNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineCustomerReferenceNumberOption { get; private set; } /// /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces /// /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces - [DataMember(Name = "airline.customer_reference_number", EmitDefaultValue = false)] - public string AirlineCustomerReferenceNumber { get; set; } + [JsonPropertyName("airline.customer_reference_number")] + public string AirlineCustomerReferenceNumber { get { return this.AirlineCustomerReferenceNumberOption; } set { this.AirlineCustomerReferenceNumberOption = new Option(value); } } + + /// + /// Used to track the state of AirlineDocumentType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineDocumentTypeOption { get; private set; } /// /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters /// /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters - [DataMember(Name = "airline.document_type", EmitDefaultValue = false)] - public string AirlineDocumentType { get; set; } + [JsonPropertyName("airline.document_type")] + public string AirlineDocumentType { get { return this.AirlineDocumentTypeOption; } set { this.AirlineDocumentTypeOption = new Option(value); } } + + /// + /// Used to track the state of AirlineFlightDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineFlightDateOption { get; private set; } /// /// The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters /// /// The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters - [DataMember(Name = "airline.flight_date", EmitDefaultValue = false)] - public string AirlineFlightDate { get; set; } + [JsonPropertyName("airline.flight_date")] + public string AirlineFlightDate { get { return this.AirlineFlightDateOption; } set { this.AirlineFlightDateOption = new Option(value); } } + + /// + /// Used to track the state of AirlineIssueDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineIssueDateOption { get; private set; } /// /// The date that the ticket was issued to the passenger. * minLength: 6 characters * maxLength: 6 characters * Date format: YYMMDD /// /// The date that the ticket was issued to the passenger. * minLength: 6 characters * maxLength: 6 characters * Date format: YYMMDD - [DataMember(Name = "airline.issue_date", EmitDefaultValue = false)] - public string AirlineIssueDate { get; set; } + [JsonPropertyName("airline.issue_date")] + public string AirlineIssueDate { get { return this.AirlineIssueDateOption; } set { this.AirlineIssueDateOption = new Option(value); } } + + /// + /// Used to track the state of AirlineLegCarrierCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineLegCarrierCodeOption { get; private set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros. - [DataMember(Name = "airline.leg.carrier_code", EmitDefaultValue = false)] - public string AirlineLegCarrierCode { get; set; } + [JsonPropertyName("airline.leg.carrier_code")] + public string AirlineLegCarrierCode { get { return this.AirlineLegCarrierCodeOption; } set { this.AirlineLegCarrierCodeOption = new Option(value); } } + + /// + /// Used to track the state of AirlineLegClassOfTravel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineLegClassOfTravelOption { get; private set; } /// /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros. /// /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros. - [DataMember(Name = "airline.leg.class_of_travel", EmitDefaultValue = false)] - public string AirlineLegClassOfTravel { get; set; } + [JsonPropertyName("airline.leg.class_of_travel")] + public string AirlineLegClassOfTravel { get { return this.AirlineLegClassOfTravelOption; } set { this.AirlineLegClassOfTravelOption = new Option(value); } } + + /// + /// Used to track the state of AirlineLegDateOfTravel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineLegDateOfTravelOption { get; private set; } /// /// Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters /// /// Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters - [DataMember(Name = "airline.leg.date_of_travel", EmitDefaultValue = false)] - public string AirlineLegDateOfTravel { get; set; } + [JsonPropertyName("airline.leg.date_of_travel")] + public string AirlineLegDateOfTravel { get { return this.AirlineLegDateOfTravelOption; } set { this.AirlineLegDateOfTravelOption = new Option(value); } } + + /// + /// Used to track the state of AirlineLegDepartAirport + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineLegDepartAirportOption { get; private set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. - [DataMember(Name = "airline.leg.depart_airport", EmitDefaultValue = false)] - public string AirlineLegDepartAirport { get; set; } + [JsonPropertyName("airline.leg.depart_airport")] + public string AirlineLegDepartAirport { get { return this.AirlineLegDepartAirportOption; } set { this.AirlineLegDepartAirportOption = new Option(value); } } + + /// + /// Used to track the state of AirlineLegDepartTax + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineLegDepartTaxOption { get; private set; } /// /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros. /// /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros. - [DataMember(Name = "airline.leg.depart_tax", EmitDefaultValue = false)] - public string AirlineLegDepartTax { get; set; } + [JsonPropertyName("airline.leg.depart_tax")] + public string AirlineLegDepartTax { get { return this.AirlineLegDepartTaxOption; } set { this.AirlineLegDepartTaxOption = new Option(value); } } + + /// + /// Used to track the state of AirlineLegDestinationCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineLegDestinationCodeOption { get; private set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. - [DataMember(Name = "airline.leg.destination_code", EmitDefaultValue = false)] - public string AirlineLegDestinationCode { get; set; } + [JsonPropertyName("airline.leg.destination_code")] + public string AirlineLegDestinationCode { get { return this.AirlineLegDestinationCodeOption; } set { this.AirlineLegDestinationCodeOption = new Option(value); } } + + /// + /// Used to track the state of AirlineLegFareBaseCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineLegFareBaseCodeOption { get; private set; } /// /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros. /// /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros. - [DataMember(Name = "airline.leg.fare_base_code", EmitDefaultValue = false)] - public string AirlineLegFareBaseCode { get; set; } + [JsonPropertyName("airline.leg.fare_base_code")] + public string AirlineLegFareBaseCode { get { return this.AirlineLegFareBaseCodeOption; } set { this.AirlineLegFareBaseCodeOption = new Option(value); } } + + /// + /// Used to track the state of AirlineLegFlightNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineLegFlightNumberOption { get; private set; } /// /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros. /// /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros. - [DataMember(Name = "airline.leg.flight_number", EmitDefaultValue = false)] - public string AirlineLegFlightNumber { get; set; } + [JsonPropertyName("airline.leg.flight_number")] + public string AirlineLegFlightNumber { get { return this.AirlineLegFlightNumberOption; } set { this.AirlineLegFlightNumberOption = new Option(value); } } + + /// + /// Used to track the state of AirlineLegStopOverCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineLegStopOverCodeOption { get; private set; } /// /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character /// /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character - [DataMember(Name = "airline.leg.stop_over_code", EmitDefaultValue = false)] - public string AirlineLegStopOverCode { get; set; } + [JsonPropertyName("airline.leg.stop_over_code")] + public string AirlineLegStopOverCode { get { return this.AirlineLegStopOverCodeOption; } set { this.AirlineLegStopOverCodeOption = new Option(value); } } + + /// + /// Used to track the state of AirlinePassengerDateOfBirth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlinePassengerDateOfBirthOption { get; private set; } /// /// The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 /// /// The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 - [DataMember(Name = "airline.passenger.date_of_birth", EmitDefaultValue = false)] - public string AirlinePassengerDateOfBirth { get; set; } + [JsonPropertyName("airline.passenger.date_of_birth")] + public string AirlinePassengerDateOfBirth { get { return this.AirlinePassengerDateOfBirthOption; } set { this.AirlinePassengerDateOfBirthOption = new Option(value); } } + + /// + /// Used to track the state of AirlinePassengerFirstName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlinePassengerFirstNameOption { get; private set; } /// /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII /// /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII - [DataMember(Name = "airline.passenger.first_name", EmitDefaultValue = false)] - public string AirlinePassengerFirstName { get; set; } + [JsonPropertyName("airline.passenger.first_name")] + public string AirlinePassengerFirstName { get { return this.AirlinePassengerFirstNameOption; } set { this.AirlinePassengerFirstNameOption = new Option(value); } } + + /// + /// Used to track the state of AirlinePassengerLastName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlinePassengerLastNameOption { get; private set; } /// /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII /// /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII - [DataMember(Name = "airline.passenger.last_name", EmitDefaultValue = false)] - public string AirlinePassengerLastName { get; set; } + [JsonPropertyName("airline.passenger.last_name")] + public string AirlinePassengerLastName { get { return this.AirlinePassengerLastNameOption; } set { this.AirlinePassengerLastNameOption = new Option(value); } } + + /// + /// Used to track the state of AirlinePassengerPhoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlinePassengerPhoneNumberOption { get; private set; } /// /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters /// /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters - [DataMember(Name = "airline.passenger.phone_number", EmitDefaultValue = false)] - public string AirlinePassengerPhoneNumber { get; set; } + [JsonPropertyName("airline.passenger.phone_number")] + public string AirlinePassengerPhoneNumber { get { return this.AirlinePassengerPhoneNumberOption; } set { this.AirlinePassengerPhoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of AirlinePassengerTravellerType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlinePassengerTravellerTypeOption { get; private set; } /// /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters /// /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters - [DataMember(Name = "airline.passenger.traveller_type", EmitDefaultValue = false)] - public string AirlinePassengerTravellerType { get; set; } + [JsonPropertyName("airline.passenger.traveller_type")] + public string AirlinePassengerTravellerType { get { return this.AirlinePassengerTravellerTypeOption; } set { this.AirlinePassengerTravellerTypeOption = new Option(value); } } /// - /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros. + /// Used to track the state of AirlineTicketIssueAddress /// - /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros. - [DataMember(Name = "airline.passenger_name", IsRequired = false, EmitDefaultValue = false)] - public string AirlinePassengerName { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineTicketIssueAddressOption { get; private set; } /// /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters /// /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters - [DataMember(Name = "airline.ticket_issue_address", EmitDefaultValue = false)] - public string AirlineTicketIssueAddress { get; set; } + [JsonPropertyName("airline.ticket_issue_address")] + public string AirlineTicketIssueAddress { get { return this.AirlineTicketIssueAddressOption; } set { this.AirlineTicketIssueAddressOption = new Option(value); } } + + /// + /// Used to track the state of AirlineTicketNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineTicketNumberOption { get; private set; } /// /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros. /// /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros. - [DataMember(Name = "airline.ticket_number", EmitDefaultValue = false)] - public string AirlineTicketNumber { get; set; } + [JsonPropertyName("airline.ticket_number")] + public string AirlineTicketNumber { get { return this.AirlineTicketNumberOption; } set { this.AirlineTicketNumberOption = new Option(value); } } + + /// + /// Used to track the state of AirlineTravelAgencyCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineTravelAgencyCodeOption { get; private set; } /// /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros. /// /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros. - [DataMember(Name = "airline.travel_agency_code", EmitDefaultValue = false)] - public string AirlineTravelAgencyCode { get; set; } + [JsonPropertyName("airline.travel_agency_code")] + public string AirlineTravelAgencyCode { get { return this.AirlineTravelAgencyCodeOption; } set { this.AirlineTravelAgencyCodeOption = new Option(value); } } + + /// + /// Used to track the state of AirlineTravelAgencyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineTravelAgencyNameOption { get; private set; } /// /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros. /// /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros. - [DataMember(Name = "airline.travel_agency_name", EmitDefaultValue = false)] - public string AirlineTravelAgencyName { get; set; } + [JsonPropertyName("airline.travel_agency_name")] + public string AirlineTravelAgencyName { get { return this.AirlineTravelAgencyNameOption; } set { this.AirlineTravelAgencyNameOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -313,6 +504,7 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class AdditionalDataAirline {\n"); + sb.Append(" AirlinePassengerName: ").Append(AirlinePassengerName).Append("\n"); sb.Append(" AirlineAgencyInvoiceNumber: ").Append(AirlineAgencyInvoiceNumber).Append("\n"); sb.Append(" AirlineAgencyPlanName: ").Append(AirlineAgencyPlanName).Append("\n"); sb.Append(" AirlineAirlineCode: ").Append(AirlineAirlineCode).Append("\n"); @@ -337,7 +529,6 @@ public override string ToString() sb.Append(" AirlinePassengerLastName: ").Append(AirlinePassengerLastName).Append("\n"); sb.Append(" AirlinePassengerPhoneNumber: ").Append(AirlinePassengerPhoneNumber).Append("\n"); sb.Append(" AirlinePassengerTravellerType: ").Append(AirlinePassengerTravellerType).Append("\n"); - sb.Append(" AirlinePassengerName: ").Append(AirlinePassengerName).Append("\n"); sb.Append(" AirlineTicketIssueAddress: ").Append(AirlineTicketIssueAddress).Append("\n"); sb.Append(" AirlineTicketNumber: ").Append(AirlineTicketNumber).Append("\n"); sb.Append(" AirlineTravelAgencyCode: ").Append(AirlineTravelAgencyCode).Append("\n"); @@ -347,320 +538,465 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal + /// To validate all properties of the instance /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return this.Equals(input as AdditionalDataAirline); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataAirlineJsonConverter : JsonConverter + { /// - /// Returns true if AdditionalDataAirline instances are equal + /// Deserializes json to /// - /// Instance of AdditionalDataAirline to be compared - /// Boolean - public bool Equals(AdditionalDataAirline input) + /// + /// + /// + /// + /// + public override AdditionalDataAirline Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option airlinePassengerName = default; + Option airlineAgencyInvoiceNumber = default; + Option airlineAgencyPlanName = default; + Option airlineAirlineCode = default; + Option airlineAirlineDesignatorCode = default; + Option airlineBoardingFee = default; + Option airlineComputerizedReservationSystem = default; + Option airlineCustomerReferenceNumber = default; + Option airlineDocumentType = default; + Option airlineFlightDate = default; + Option airlineIssueDate = default; + Option airlineLegCarrierCode = default; + Option airlineLegClassOfTravel = default; + Option airlineLegDateOfTravel = default; + Option airlineLegDepartAirport = default; + Option airlineLegDepartTax = default; + Option airlineLegDestinationCode = default; + Option airlineLegFareBaseCode = default; + Option airlineLegFlightNumber = default; + Option airlineLegStopOverCode = default; + Option airlinePassengerDateOfBirth = default; + Option airlinePassengerFirstName = default; + Option airlinePassengerLastName = default; + Option airlinePassengerPhoneNumber = default; + Option airlinePassengerTravellerType = default; + Option airlineTicketIssueAddress = default; + Option airlineTicketNumber = default; + Option airlineTravelAgencyCode = default; + Option airlineTravelAgencyName = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "airline.passenger_name": + airlinePassengerName = new Option(utf8JsonReader.GetString()); + break; + case "airline.agency_invoice_number": + airlineAgencyInvoiceNumber = new Option(utf8JsonReader.GetString()); + break; + case "airline.agency_plan_name": + airlineAgencyPlanName = new Option(utf8JsonReader.GetString()); + break; + case "airline.airline_code": + airlineAirlineCode = new Option(utf8JsonReader.GetString()); + break; + case "airline.airline_designator_code": + airlineAirlineDesignatorCode = new Option(utf8JsonReader.GetString()); + break; + case "airline.boarding_fee": + airlineBoardingFee = new Option(utf8JsonReader.GetString()); + break; + case "airline.computerized_reservation_system": + airlineComputerizedReservationSystem = new Option(utf8JsonReader.GetString()); + break; + case "airline.customer_reference_number": + airlineCustomerReferenceNumber = new Option(utf8JsonReader.GetString()); + break; + case "airline.document_type": + airlineDocumentType = new Option(utf8JsonReader.GetString()); + break; + case "airline.flight_date": + airlineFlightDate = new Option(utf8JsonReader.GetString()); + break; + case "airline.issue_date": + airlineIssueDate = new Option(utf8JsonReader.GetString()); + break; + case "airline.leg.carrier_code": + airlineLegCarrierCode = new Option(utf8JsonReader.GetString()); + break; + case "airline.leg.class_of_travel": + airlineLegClassOfTravel = new Option(utf8JsonReader.GetString()); + break; + case "airline.leg.date_of_travel": + airlineLegDateOfTravel = new Option(utf8JsonReader.GetString()); + break; + case "airline.leg.depart_airport": + airlineLegDepartAirport = new Option(utf8JsonReader.GetString()); + break; + case "airline.leg.depart_tax": + airlineLegDepartTax = new Option(utf8JsonReader.GetString()); + break; + case "airline.leg.destination_code": + airlineLegDestinationCode = new Option(utf8JsonReader.GetString()); + break; + case "airline.leg.fare_base_code": + airlineLegFareBaseCode = new Option(utf8JsonReader.GetString()); + break; + case "airline.leg.flight_number": + airlineLegFlightNumber = new Option(utf8JsonReader.GetString()); + break; + case "airline.leg.stop_over_code": + airlineLegStopOverCode = new Option(utf8JsonReader.GetString()); + break; + case "airline.passenger.date_of_birth": + airlinePassengerDateOfBirth = new Option(utf8JsonReader.GetString()); + break; + case "airline.passenger.first_name": + airlinePassengerFirstName = new Option(utf8JsonReader.GetString()); + break; + case "airline.passenger.last_name": + airlinePassengerLastName = new Option(utf8JsonReader.GetString()); + break; + case "airline.passenger.phone_number": + airlinePassengerPhoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "airline.passenger.traveller_type": + airlinePassengerTravellerType = new Option(utf8JsonReader.GetString()); + break; + case "airline.ticket_issue_address": + airlineTicketIssueAddress = new Option(utf8JsonReader.GetString()); + break; + case "airline.ticket_number": + airlineTicketNumber = new Option(utf8JsonReader.GetString()); + break; + case "airline.travel_agency_code": + airlineTravelAgencyCode = new Option(utf8JsonReader.GetString()); + break; + case "airline.travel_agency_name": + airlineTravelAgencyName = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AirlineAgencyInvoiceNumber == input.AirlineAgencyInvoiceNumber || - (this.AirlineAgencyInvoiceNumber != null && - this.AirlineAgencyInvoiceNumber.Equals(input.AirlineAgencyInvoiceNumber)) - ) && - ( - this.AirlineAgencyPlanName == input.AirlineAgencyPlanName || - (this.AirlineAgencyPlanName != null && - this.AirlineAgencyPlanName.Equals(input.AirlineAgencyPlanName)) - ) && - ( - this.AirlineAirlineCode == input.AirlineAirlineCode || - (this.AirlineAirlineCode != null && - this.AirlineAirlineCode.Equals(input.AirlineAirlineCode)) - ) && - ( - this.AirlineAirlineDesignatorCode == input.AirlineAirlineDesignatorCode || - (this.AirlineAirlineDesignatorCode != null && - this.AirlineAirlineDesignatorCode.Equals(input.AirlineAirlineDesignatorCode)) - ) && - ( - this.AirlineBoardingFee == input.AirlineBoardingFee || - (this.AirlineBoardingFee != null && - this.AirlineBoardingFee.Equals(input.AirlineBoardingFee)) - ) && - ( - this.AirlineComputerizedReservationSystem == input.AirlineComputerizedReservationSystem || - (this.AirlineComputerizedReservationSystem != null && - this.AirlineComputerizedReservationSystem.Equals(input.AirlineComputerizedReservationSystem)) - ) && - ( - this.AirlineCustomerReferenceNumber == input.AirlineCustomerReferenceNumber || - (this.AirlineCustomerReferenceNumber != null && - this.AirlineCustomerReferenceNumber.Equals(input.AirlineCustomerReferenceNumber)) - ) && - ( - this.AirlineDocumentType == input.AirlineDocumentType || - (this.AirlineDocumentType != null && - this.AirlineDocumentType.Equals(input.AirlineDocumentType)) - ) && - ( - this.AirlineFlightDate == input.AirlineFlightDate || - (this.AirlineFlightDate != null && - this.AirlineFlightDate.Equals(input.AirlineFlightDate)) - ) && - ( - this.AirlineIssueDate == input.AirlineIssueDate || - (this.AirlineIssueDate != null && - this.AirlineIssueDate.Equals(input.AirlineIssueDate)) - ) && - ( - this.AirlineLegCarrierCode == input.AirlineLegCarrierCode || - (this.AirlineLegCarrierCode != null && - this.AirlineLegCarrierCode.Equals(input.AirlineLegCarrierCode)) - ) && - ( - this.AirlineLegClassOfTravel == input.AirlineLegClassOfTravel || - (this.AirlineLegClassOfTravel != null && - this.AirlineLegClassOfTravel.Equals(input.AirlineLegClassOfTravel)) - ) && - ( - this.AirlineLegDateOfTravel == input.AirlineLegDateOfTravel || - (this.AirlineLegDateOfTravel != null && - this.AirlineLegDateOfTravel.Equals(input.AirlineLegDateOfTravel)) - ) && - ( - this.AirlineLegDepartAirport == input.AirlineLegDepartAirport || - (this.AirlineLegDepartAirport != null && - this.AirlineLegDepartAirport.Equals(input.AirlineLegDepartAirport)) - ) && - ( - this.AirlineLegDepartTax == input.AirlineLegDepartTax || - (this.AirlineLegDepartTax != null && - this.AirlineLegDepartTax.Equals(input.AirlineLegDepartTax)) - ) && - ( - this.AirlineLegDestinationCode == input.AirlineLegDestinationCode || - (this.AirlineLegDestinationCode != null && - this.AirlineLegDestinationCode.Equals(input.AirlineLegDestinationCode)) - ) && - ( - this.AirlineLegFareBaseCode == input.AirlineLegFareBaseCode || - (this.AirlineLegFareBaseCode != null && - this.AirlineLegFareBaseCode.Equals(input.AirlineLegFareBaseCode)) - ) && - ( - this.AirlineLegFlightNumber == input.AirlineLegFlightNumber || - (this.AirlineLegFlightNumber != null && - this.AirlineLegFlightNumber.Equals(input.AirlineLegFlightNumber)) - ) && - ( - this.AirlineLegStopOverCode == input.AirlineLegStopOverCode || - (this.AirlineLegStopOverCode != null && - this.AirlineLegStopOverCode.Equals(input.AirlineLegStopOverCode)) - ) && - ( - this.AirlinePassengerDateOfBirth == input.AirlinePassengerDateOfBirth || - (this.AirlinePassengerDateOfBirth != null && - this.AirlinePassengerDateOfBirth.Equals(input.AirlinePassengerDateOfBirth)) - ) && - ( - this.AirlinePassengerFirstName == input.AirlinePassengerFirstName || - (this.AirlinePassengerFirstName != null && - this.AirlinePassengerFirstName.Equals(input.AirlinePassengerFirstName)) - ) && - ( - this.AirlinePassengerLastName == input.AirlinePassengerLastName || - (this.AirlinePassengerLastName != null && - this.AirlinePassengerLastName.Equals(input.AirlinePassengerLastName)) - ) && - ( - this.AirlinePassengerPhoneNumber == input.AirlinePassengerPhoneNumber || - (this.AirlinePassengerPhoneNumber != null && - this.AirlinePassengerPhoneNumber.Equals(input.AirlinePassengerPhoneNumber)) - ) && - ( - this.AirlinePassengerTravellerType == input.AirlinePassengerTravellerType || - (this.AirlinePassengerTravellerType != null && - this.AirlinePassengerTravellerType.Equals(input.AirlinePassengerTravellerType)) - ) && - ( - this.AirlinePassengerName == input.AirlinePassengerName || - (this.AirlinePassengerName != null && - this.AirlinePassengerName.Equals(input.AirlinePassengerName)) - ) && - ( - this.AirlineTicketIssueAddress == input.AirlineTicketIssueAddress || - (this.AirlineTicketIssueAddress != null && - this.AirlineTicketIssueAddress.Equals(input.AirlineTicketIssueAddress)) - ) && - ( - this.AirlineTicketNumber == input.AirlineTicketNumber || - (this.AirlineTicketNumber != null && - this.AirlineTicketNumber.Equals(input.AirlineTicketNumber)) - ) && - ( - this.AirlineTravelAgencyCode == input.AirlineTravelAgencyCode || - (this.AirlineTravelAgencyCode != null && - this.AirlineTravelAgencyCode.Equals(input.AirlineTravelAgencyCode)) - ) && - ( - this.AirlineTravelAgencyName == input.AirlineTravelAgencyName || - (this.AirlineTravelAgencyName != null && - this.AirlineTravelAgencyName.Equals(input.AirlineTravelAgencyName)) - ); + + if (!airlinePassengerName.IsSet) + throw new ArgumentException("Property is required for class AdditionalDataAirline.", nameof(airlinePassengerName)); + + if (airlinePassengerName.IsSet && airlinePassengerName.Value == null) + throw new ArgumentNullException(nameof(airlinePassengerName), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineAgencyInvoiceNumber.IsSet && airlineAgencyInvoiceNumber.Value == null) + throw new ArgumentNullException(nameof(airlineAgencyInvoiceNumber), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineAgencyPlanName.IsSet && airlineAgencyPlanName.Value == null) + throw new ArgumentNullException(nameof(airlineAgencyPlanName), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineAirlineCode.IsSet && airlineAirlineCode.Value == null) + throw new ArgumentNullException(nameof(airlineAirlineCode), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineAirlineDesignatorCode.IsSet && airlineAirlineDesignatorCode.Value == null) + throw new ArgumentNullException(nameof(airlineAirlineDesignatorCode), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineBoardingFee.IsSet && airlineBoardingFee.Value == null) + throw new ArgumentNullException(nameof(airlineBoardingFee), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineComputerizedReservationSystem.IsSet && airlineComputerizedReservationSystem.Value == null) + throw new ArgumentNullException(nameof(airlineComputerizedReservationSystem), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineCustomerReferenceNumber.IsSet && airlineCustomerReferenceNumber.Value == null) + throw new ArgumentNullException(nameof(airlineCustomerReferenceNumber), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineDocumentType.IsSet && airlineDocumentType.Value == null) + throw new ArgumentNullException(nameof(airlineDocumentType), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineFlightDate.IsSet && airlineFlightDate.Value == null) + throw new ArgumentNullException(nameof(airlineFlightDate), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineIssueDate.IsSet && airlineIssueDate.Value == null) + throw new ArgumentNullException(nameof(airlineIssueDate), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineLegCarrierCode.IsSet && airlineLegCarrierCode.Value == null) + throw new ArgumentNullException(nameof(airlineLegCarrierCode), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineLegClassOfTravel.IsSet && airlineLegClassOfTravel.Value == null) + throw new ArgumentNullException(nameof(airlineLegClassOfTravel), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineLegDateOfTravel.IsSet && airlineLegDateOfTravel.Value == null) + throw new ArgumentNullException(nameof(airlineLegDateOfTravel), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineLegDepartAirport.IsSet && airlineLegDepartAirport.Value == null) + throw new ArgumentNullException(nameof(airlineLegDepartAirport), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineLegDepartTax.IsSet && airlineLegDepartTax.Value == null) + throw new ArgumentNullException(nameof(airlineLegDepartTax), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineLegDestinationCode.IsSet && airlineLegDestinationCode.Value == null) + throw new ArgumentNullException(nameof(airlineLegDestinationCode), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineLegFareBaseCode.IsSet && airlineLegFareBaseCode.Value == null) + throw new ArgumentNullException(nameof(airlineLegFareBaseCode), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineLegFlightNumber.IsSet && airlineLegFlightNumber.Value == null) + throw new ArgumentNullException(nameof(airlineLegFlightNumber), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineLegStopOverCode.IsSet && airlineLegStopOverCode.Value == null) + throw new ArgumentNullException(nameof(airlineLegStopOverCode), "Property is not nullable for class AdditionalDataAirline."); + + if (airlinePassengerDateOfBirth.IsSet && airlinePassengerDateOfBirth.Value == null) + throw new ArgumentNullException(nameof(airlinePassengerDateOfBirth), "Property is not nullable for class AdditionalDataAirline."); + + if (airlinePassengerFirstName.IsSet && airlinePassengerFirstName.Value == null) + throw new ArgumentNullException(nameof(airlinePassengerFirstName), "Property is not nullable for class AdditionalDataAirline."); + + if (airlinePassengerLastName.IsSet && airlinePassengerLastName.Value == null) + throw new ArgumentNullException(nameof(airlinePassengerLastName), "Property is not nullable for class AdditionalDataAirline."); + + if (airlinePassengerPhoneNumber.IsSet && airlinePassengerPhoneNumber.Value == null) + throw new ArgumentNullException(nameof(airlinePassengerPhoneNumber), "Property is not nullable for class AdditionalDataAirline."); + + if (airlinePassengerTravellerType.IsSet && airlinePassengerTravellerType.Value == null) + throw new ArgumentNullException(nameof(airlinePassengerTravellerType), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineTicketIssueAddress.IsSet && airlineTicketIssueAddress.Value == null) + throw new ArgumentNullException(nameof(airlineTicketIssueAddress), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineTicketNumber.IsSet && airlineTicketNumber.Value == null) + throw new ArgumentNullException(nameof(airlineTicketNumber), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineTravelAgencyCode.IsSet && airlineTravelAgencyCode.Value == null) + throw new ArgumentNullException(nameof(airlineTravelAgencyCode), "Property is not nullable for class AdditionalDataAirline."); + + if (airlineTravelAgencyName.IsSet && airlineTravelAgencyName.Value == null) + throw new ArgumentNullException(nameof(airlineTravelAgencyName), "Property is not nullable for class AdditionalDataAirline."); + + return new AdditionalDataAirline(airlinePassengerName.Value, airlineAgencyInvoiceNumber, airlineAgencyPlanName, airlineAirlineCode, airlineAirlineDesignatorCode, airlineBoardingFee, airlineComputerizedReservationSystem, airlineCustomerReferenceNumber, airlineDocumentType, airlineFlightDate, airlineIssueDate, airlineLegCarrierCode, airlineLegClassOfTravel, airlineLegDateOfTravel, airlineLegDepartAirport, airlineLegDepartTax, airlineLegDestinationCode, airlineLegFareBaseCode, airlineLegFlightNumber, airlineLegStopOverCode, airlinePassengerDateOfBirth, airlinePassengerFirstName, airlinePassengerLastName, airlinePassengerPhoneNumber, airlinePassengerTravellerType, airlineTicketIssueAddress, airlineTicketNumber, airlineTravelAgencyCode, airlineTravelAgencyName); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataAirline additionalDataAirline, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AirlineAgencyInvoiceNumber != null) - { - hashCode = (hashCode * 59) + this.AirlineAgencyInvoiceNumber.GetHashCode(); - } - if (this.AirlineAgencyPlanName != null) - { - hashCode = (hashCode * 59) + this.AirlineAgencyPlanName.GetHashCode(); - } - if (this.AirlineAirlineCode != null) - { - hashCode = (hashCode * 59) + this.AirlineAirlineCode.GetHashCode(); - } - if (this.AirlineAirlineDesignatorCode != null) - { - hashCode = (hashCode * 59) + this.AirlineAirlineDesignatorCode.GetHashCode(); - } - if (this.AirlineBoardingFee != null) - { - hashCode = (hashCode * 59) + this.AirlineBoardingFee.GetHashCode(); - } - if (this.AirlineComputerizedReservationSystem != null) - { - hashCode = (hashCode * 59) + this.AirlineComputerizedReservationSystem.GetHashCode(); - } - if (this.AirlineCustomerReferenceNumber != null) - { - hashCode = (hashCode * 59) + this.AirlineCustomerReferenceNumber.GetHashCode(); - } - if (this.AirlineDocumentType != null) - { - hashCode = (hashCode * 59) + this.AirlineDocumentType.GetHashCode(); - } - if (this.AirlineFlightDate != null) - { - hashCode = (hashCode * 59) + this.AirlineFlightDate.GetHashCode(); - } - if (this.AirlineIssueDate != null) - { - hashCode = (hashCode * 59) + this.AirlineIssueDate.GetHashCode(); - } - if (this.AirlineLegCarrierCode != null) - { - hashCode = (hashCode * 59) + this.AirlineLegCarrierCode.GetHashCode(); - } - if (this.AirlineLegClassOfTravel != null) - { - hashCode = (hashCode * 59) + this.AirlineLegClassOfTravel.GetHashCode(); - } - if (this.AirlineLegDateOfTravel != null) - { - hashCode = (hashCode * 59) + this.AirlineLegDateOfTravel.GetHashCode(); - } - if (this.AirlineLegDepartAirport != null) - { - hashCode = (hashCode * 59) + this.AirlineLegDepartAirport.GetHashCode(); - } - if (this.AirlineLegDepartTax != null) - { - hashCode = (hashCode * 59) + this.AirlineLegDepartTax.GetHashCode(); - } - if (this.AirlineLegDestinationCode != null) - { - hashCode = (hashCode * 59) + this.AirlineLegDestinationCode.GetHashCode(); - } - if (this.AirlineLegFareBaseCode != null) - { - hashCode = (hashCode * 59) + this.AirlineLegFareBaseCode.GetHashCode(); - } - if (this.AirlineLegFlightNumber != null) - { - hashCode = (hashCode * 59) + this.AirlineLegFlightNumber.GetHashCode(); - } - if (this.AirlineLegStopOverCode != null) - { - hashCode = (hashCode * 59) + this.AirlineLegStopOverCode.GetHashCode(); - } - if (this.AirlinePassengerDateOfBirth != null) - { - hashCode = (hashCode * 59) + this.AirlinePassengerDateOfBirth.GetHashCode(); - } - if (this.AirlinePassengerFirstName != null) - { - hashCode = (hashCode * 59) + this.AirlinePassengerFirstName.GetHashCode(); - } - if (this.AirlinePassengerLastName != null) - { - hashCode = (hashCode * 59) + this.AirlinePassengerLastName.GetHashCode(); - } - if (this.AirlinePassengerPhoneNumber != null) - { - hashCode = (hashCode * 59) + this.AirlinePassengerPhoneNumber.GetHashCode(); - } - if (this.AirlinePassengerTravellerType != null) - { - hashCode = (hashCode * 59) + this.AirlinePassengerTravellerType.GetHashCode(); - } - if (this.AirlinePassengerName != null) - { - hashCode = (hashCode * 59) + this.AirlinePassengerName.GetHashCode(); - } - if (this.AirlineTicketIssueAddress != null) - { - hashCode = (hashCode * 59) + this.AirlineTicketIssueAddress.GetHashCode(); - } - if (this.AirlineTicketNumber != null) - { - hashCode = (hashCode * 59) + this.AirlineTicketNumber.GetHashCode(); - } - if (this.AirlineTravelAgencyCode != null) - { - hashCode = (hashCode * 59) + this.AirlineTravelAgencyCode.GetHashCode(); - } - if (this.AirlineTravelAgencyName != null) - { - hashCode = (hashCode * 59) + this.AirlineTravelAgencyName.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataAirline, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataAirline additionalDataAirline, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataAirline.AirlinePassengerName == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlinePassengerName), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineAgencyInvoiceNumberOption.IsSet && additionalDataAirline.AirlineAgencyInvoiceNumber == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineAgencyInvoiceNumber), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineAgencyPlanNameOption.IsSet && additionalDataAirline.AirlineAgencyPlanName == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineAgencyPlanName), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineAirlineCodeOption.IsSet && additionalDataAirline.AirlineAirlineCode == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineAirlineCode), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineAirlineDesignatorCodeOption.IsSet && additionalDataAirline.AirlineAirlineDesignatorCode == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineAirlineDesignatorCode), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineBoardingFeeOption.IsSet && additionalDataAirline.AirlineBoardingFee == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineBoardingFee), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineComputerizedReservationSystemOption.IsSet && additionalDataAirline.AirlineComputerizedReservationSystem == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineComputerizedReservationSystem), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineCustomerReferenceNumberOption.IsSet && additionalDataAirline.AirlineCustomerReferenceNumber == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineCustomerReferenceNumber), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineDocumentTypeOption.IsSet && additionalDataAirline.AirlineDocumentType == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineDocumentType), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineFlightDateOption.IsSet && additionalDataAirline.AirlineFlightDate == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineFlightDate), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineIssueDateOption.IsSet && additionalDataAirline.AirlineIssueDate == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineIssueDate), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineLegCarrierCodeOption.IsSet && additionalDataAirline.AirlineLegCarrierCode == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegCarrierCode), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineLegClassOfTravelOption.IsSet && additionalDataAirline.AirlineLegClassOfTravel == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegClassOfTravel), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineLegDateOfTravelOption.IsSet && additionalDataAirline.AirlineLegDateOfTravel == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegDateOfTravel), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineLegDepartAirportOption.IsSet && additionalDataAirline.AirlineLegDepartAirport == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegDepartAirport), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineLegDepartTaxOption.IsSet && additionalDataAirline.AirlineLegDepartTax == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegDepartTax), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineLegDestinationCodeOption.IsSet && additionalDataAirline.AirlineLegDestinationCode == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegDestinationCode), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineLegFareBaseCodeOption.IsSet && additionalDataAirline.AirlineLegFareBaseCode == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegFareBaseCode), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineLegFlightNumberOption.IsSet && additionalDataAirline.AirlineLegFlightNumber == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegFlightNumber), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineLegStopOverCodeOption.IsSet && additionalDataAirline.AirlineLegStopOverCode == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegStopOverCode), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlinePassengerDateOfBirthOption.IsSet && additionalDataAirline.AirlinePassengerDateOfBirth == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlinePassengerDateOfBirth), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlinePassengerFirstNameOption.IsSet && additionalDataAirline.AirlinePassengerFirstName == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlinePassengerFirstName), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlinePassengerLastNameOption.IsSet && additionalDataAirline.AirlinePassengerLastName == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlinePassengerLastName), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlinePassengerPhoneNumberOption.IsSet && additionalDataAirline.AirlinePassengerPhoneNumber == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlinePassengerPhoneNumber), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlinePassengerTravellerTypeOption.IsSet && additionalDataAirline.AirlinePassengerTravellerType == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlinePassengerTravellerType), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineTicketIssueAddressOption.IsSet && additionalDataAirline.AirlineTicketIssueAddress == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineTicketIssueAddress), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineTicketNumberOption.IsSet && additionalDataAirline.AirlineTicketNumber == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineTicketNumber), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineTravelAgencyCodeOption.IsSet && additionalDataAirline.AirlineTravelAgencyCode == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineTravelAgencyCode), "Property is required for class AdditionalDataAirline."); + + if (additionalDataAirline.AirlineTravelAgencyNameOption.IsSet && additionalDataAirline.AirlineTravelAgencyName == null) + throw new ArgumentNullException(nameof(additionalDataAirline.AirlineTravelAgencyName), "Property is required for class AdditionalDataAirline."); + + writer.WriteString("airline.passenger_name", additionalDataAirline.AirlinePassengerName); + + if (additionalDataAirline.AirlineAgencyInvoiceNumberOption.IsSet) + writer.WriteString("airline.agency_invoice_number", additionalDataAirline.AirlineAgencyInvoiceNumber); + + if (additionalDataAirline.AirlineAgencyPlanNameOption.IsSet) + writer.WriteString("airline.agency_plan_name", additionalDataAirline.AirlineAgencyPlanName); + + if (additionalDataAirline.AirlineAirlineCodeOption.IsSet) + writer.WriteString("airline.airline_code", additionalDataAirline.AirlineAirlineCode); + + if (additionalDataAirline.AirlineAirlineDesignatorCodeOption.IsSet) + writer.WriteString("airline.airline_designator_code", additionalDataAirline.AirlineAirlineDesignatorCode); + + if (additionalDataAirline.AirlineBoardingFeeOption.IsSet) + writer.WriteString("airline.boarding_fee", additionalDataAirline.AirlineBoardingFee); + + if (additionalDataAirline.AirlineComputerizedReservationSystemOption.IsSet) + writer.WriteString("airline.computerized_reservation_system", additionalDataAirline.AirlineComputerizedReservationSystem); + + if (additionalDataAirline.AirlineCustomerReferenceNumberOption.IsSet) + writer.WriteString("airline.customer_reference_number", additionalDataAirline.AirlineCustomerReferenceNumber); + + if (additionalDataAirline.AirlineDocumentTypeOption.IsSet) + writer.WriteString("airline.document_type", additionalDataAirline.AirlineDocumentType); + + if (additionalDataAirline.AirlineFlightDateOption.IsSet) + writer.WriteString("airline.flight_date", additionalDataAirline.AirlineFlightDate); + + if (additionalDataAirline.AirlineIssueDateOption.IsSet) + writer.WriteString("airline.issue_date", additionalDataAirline.AirlineIssueDate); + + if (additionalDataAirline.AirlineLegCarrierCodeOption.IsSet) + writer.WriteString("airline.leg.carrier_code", additionalDataAirline.AirlineLegCarrierCode); + + if (additionalDataAirline.AirlineLegClassOfTravelOption.IsSet) + writer.WriteString("airline.leg.class_of_travel", additionalDataAirline.AirlineLegClassOfTravel); + + if (additionalDataAirline.AirlineLegDateOfTravelOption.IsSet) + writer.WriteString("airline.leg.date_of_travel", additionalDataAirline.AirlineLegDateOfTravel); + + if (additionalDataAirline.AirlineLegDepartAirportOption.IsSet) + writer.WriteString("airline.leg.depart_airport", additionalDataAirline.AirlineLegDepartAirport); + + if (additionalDataAirline.AirlineLegDepartTaxOption.IsSet) + writer.WriteString("airline.leg.depart_tax", additionalDataAirline.AirlineLegDepartTax); + + if (additionalDataAirline.AirlineLegDestinationCodeOption.IsSet) + writer.WriteString("airline.leg.destination_code", additionalDataAirline.AirlineLegDestinationCode); + + if (additionalDataAirline.AirlineLegFareBaseCodeOption.IsSet) + writer.WriteString("airline.leg.fare_base_code", additionalDataAirline.AirlineLegFareBaseCode); + + if (additionalDataAirline.AirlineLegFlightNumberOption.IsSet) + writer.WriteString("airline.leg.flight_number", additionalDataAirline.AirlineLegFlightNumber); + + if (additionalDataAirline.AirlineLegStopOverCodeOption.IsSet) + writer.WriteString("airline.leg.stop_over_code", additionalDataAirline.AirlineLegStopOverCode); + + if (additionalDataAirline.AirlinePassengerDateOfBirthOption.IsSet) + writer.WriteString("airline.passenger.date_of_birth", additionalDataAirline.AirlinePassengerDateOfBirth); + + if (additionalDataAirline.AirlinePassengerFirstNameOption.IsSet) + writer.WriteString("airline.passenger.first_name", additionalDataAirline.AirlinePassengerFirstName); + + if (additionalDataAirline.AirlinePassengerLastNameOption.IsSet) + writer.WriteString("airline.passenger.last_name", additionalDataAirline.AirlinePassengerLastName); + + if (additionalDataAirline.AirlinePassengerPhoneNumberOption.IsSet) + writer.WriteString("airline.passenger.phone_number", additionalDataAirline.AirlinePassengerPhoneNumber); + + if (additionalDataAirline.AirlinePassengerTravellerTypeOption.IsSet) + writer.WriteString("airline.passenger.traveller_type", additionalDataAirline.AirlinePassengerTravellerType); + + if (additionalDataAirline.AirlineTicketIssueAddressOption.IsSet) + writer.WriteString("airline.ticket_issue_address", additionalDataAirline.AirlineTicketIssueAddress); + + if (additionalDataAirline.AirlineTicketNumberOption.IsSet) + writer.WriteString("airline.ticket_number", additionalDataAirline.AirlineTicketNumber); + + if (additionalDataAirline.AirlineTravelAgencyCodeOption.IsSet) + writer.WriteString("airline.travel_agency_code", additionalDataAirline.AirlineTravelAgencyCode); + + if (additionalDataAirline.AirlineTravelAgencyNameOption.IsSet) + writer.WriteString("airline.travel_agency_name", additionalDataAirline.AirlineTravelAgencyName); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataCarRental.cs b/Adyen/Model/Checkout/AdditionalDataCarRental.cs index 2b7a8b7e7..d7c29b6ed 100644 --- a/Adyen/Model/Checkout/AdditionalDataCarRental.cs +++ b/Adyen/Model/Checkout/AdditionalDataCarRental.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,236 +14,398 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataCarRental /// - [DataContract(Name = "AdditionalDataCarRental")] - public partial class AdditionalDataCarRental : IEquatable, IValidatableObject + public partial class AdditionalDataCarRental : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The pick-up date. * Date format: `yyyyMMdd`. - /// The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros.. - /// Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces. - /// Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12. - /// Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces *Must not be all zeros.. - /// The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros.. - /// The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2. - /// The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces *Must not be all zeros.. - /// Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable. - /// The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12. - /// The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12. - /// Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate. - /// The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces *Must not be all zeros.. - /// The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces *Must not be all zeros.. - /// The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces *Must not be all zeros.. - /// The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros.. - /// The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2. - /// The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8. - /// The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces *Must not be all zeros.. - /// The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces *Must not be all zeros.. - /// Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected. - /// Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 4. - /// Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1. - public AdditionalDataCarRental(string carRentalCheckOutDate = default(string), string carRentalCustomerServiceTollFreeNumber = default(string), string carRentalDaysRented = default(string), string carRentalFuelCharges = default(string), string carRentalInsuranceCharges = default(string), string carRentalLocationCity = default(string), string carRentalLocationCountry = default(string), string carRentalLocationStateProvince = default(string), string carRentalNoShowIndicator = default(string), string carRentalOneWayDropOffCharges = default(string), string carRentalRate = default(string), string carRentalRateIndicator = default(string), string carRentalRentalAgreementNumber = default(string), string carRentalRentalClassId = default(string), string carRentalRenterName = default(string), string carRentalReturnCity = default(string), string carRentalReturnCountry = default(string), string carRentalReturnDate = default(string), string carRentalReturnLocationId = default(string), string carRentalReturnStateProvince = default(string), string carRentalTaxExemptIndicator = default(string), string travelEntertainmentAuthDataDuration = default(string), string travelEntertainmentAuthDataMarket = default(string)) + /// The pick-up date. * Date format: `yyyyMMdd` + /// The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. + /// Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces + /// Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 + /// Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces *Must not be all zeros. + /// The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. + /// The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 + /// The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces *Must not be all zeros. + /// Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable + /// The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12 + /// The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12 + /// Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate + /// The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces *Must not be all zeros. + /// The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces *Must not be all zeros. + /// The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces *Must not be all zeros. + /// The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. + /// The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 + /// The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 + /// The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces *Must not be all zeros. + /// The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces *Must not be all zeros. + /// Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected + /// Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 4 + /// Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + [JsonConstructor] + public AdditionalDataCarRental(Option carRentalCheckOutDate = default, Option carRentalCustomerServiceTollFreeNumber = default, Option carRentalDaysRented = default, Option carRentalFuelCharges = default, Option carRentalInsuranceCharges = default, Option carRentalLocationCity = default, Option carRentalLocationCountry = default, Option carRentalLocationStateProvince = default, Option carRentalNoShowIndicator = default, Option carRentalOneWayDropOffCharges = default, Option carRentalRate = default, Option carRentalRateIndicator = default, Option carRentalRentalAgreementNumber = default, Option carRentalRentalClassId = default, Option carRentalRenterName = default, Option carRentalReturnCity = default, Option carRentalReturnCountry = default, Option carRentalReturnDate = default, Option carRentalReturnLocationId = default, Option carRentalReturnStateProvince = default, Option carRentalTaxExemptIndicator = default, Option travelEntertainmentAuthDataDuration = default, Option travelEntertainmentAuthDataMarket = default) { - this.CarRentalCheckOutDate = carRentalCheckOutDate; - this.CarRentalCustomerServiceTollFreeNumber = carRentalCustomerServiceTollFreeNumber; - this.CarRentalDaysRented = carRentalDaysRented; - this.CarRentalFuelCharges = carRentalFuelCharges; - this.CarRentalInsuranceCharges = carRentalInsuranceCharges; - this.CarRentalLocationCity = carRentalLocationCity; - this.CarRentalLocationCountry = carRentalLocationCountry; - this.CarRentalLocationStateProvince = carRentalLocationStateProvince; - this.CarRentalNoShowIndicator = carRentalNoShowIndicator; - this.CarRentalOneWayDropOffCharges = carRentalOneWayDropOffCharges; - this.CarRentalRate = carRentalRate; - this.CarRentalRateIndicator = carRentalRateIndicator; - this.CarRentalRentalAgreementNumber = carRentalRentalAgreementNumber; - this.CarRentalRentalClassId = carRentalRentalClassId; - this.CarRentalRenterName = carRentalRenterName; - this.CarRentalReturnCity = carRentalReturnCity; - this.CarRentalReturnCountry = carRentalReturnCountry; - this.CarRentalReturnDate = carRentalReturnDate; - this.CarRentalReturnLocationId = carRentalReturnLocationId; - this.CarRentalReturnStateProvince = carRentalReturnStateProvince; - this.CarRentalTaxExemptIndicator = carRentalTaxExemptIndicator; - this.TravelEntertainmentAuthDataDuration = travelEntertainmentAuthDataDuration; - this.TravelEntertainmentAuthDataMarket = travelEntertainmentAuthDataMarket; + CarRentalCheckOutDateOption = carRentalCheckOutDate; + CarRentalCustomerServiceTollFreeNumberOption = carRentalCustomerServiceTollFreeNumber; + CarRentalDaysRentedOption = carRentalDaysRented; + CarRentalFuelChargesOption = carRentalFuelCharges; + CarRentalInsuranceChargesOption = carRentalInsuranceCharges; + CarRentalLocationCityOption = carRentalLocationCity; + CarRentalLocationCountryOption = carRentalLocationCountry; + CarRentalLocationStateProvinceOption = carRentalLocationStateProvince; + CarRentalNoShowIndicatorOption = carRentalNoShowIndicator; + CarRentalOneWayDropOffChargesOption = carRentalOneWayDropOffCharges; + CarRentalRateOption = carRentalRate; + CarRentalRateIndicatorOption = carRentalRateIndicator; + CarRentalRentalAgreementNumberOption = carRentalRentalAgreementNumber; + CarRentalRentalClassIdOption = carRentalRentalClassId; + CarRentalRenterNameOption = carRentalRenterName; + CarRentalReturnCityOption = carRentalReturnCity; + CarRentalReturnCountryOption = carRentalReturnCountry; + CarRentalReturnDateOption = carRentalReturnDate; + CarRentalReturnLocationIdOption = carRentalReturnLocationId; + CarRentalReturnStateProvinceOption = carRentalReturnStateProvince; + CarRentalTaxExemptIndicatorOption = carRentalTaxExemptIndicator; + TravelEntertainmentAuthDataDurationOption = travelEntertainmentAuthDataDuration; + TravelEntertainmentAuthDataMarketOption = travelEntertainmentAuthDataMarket; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of CarRentalCheckOutDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalCheckOutDateOption { get; private set; } + /// /// The pick-up date. * Date format: `yyyyMMdd` /// /// The pick-up date. * Date format: `yyyyMMdd` - [DataMember(Name = "carRental.checkOutDate", EmitDefaultValue = false)] - public string CarRentalCheckOutDate { get; set; } + [JsonPropertyName("carRental.checkOutDate")] + public string CarRentalCheckOutDate { get { return this.CarRentalCheckOutDateOption; } set { this.CarRentalCheckOutDateOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalCustomerServiceTollFreeNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalCustomerServiceTollFreeNumberOption { get; private set; } /// /// The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. /// /// The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. - [DataMember(Name = "carRental.customerServiceTollFreeNumber", EmitDefaultValue = false)] - public string CarRentalCustomerServiceTollFreeNumber { get; set; } + [JsonPropertyName("carRental.customerServiceTollFreeNumber")] + public string CarRentalCustomerServiceTollFreeNumber { get { return this.CarRentalCustomerServiceTollFreeNumberOption; } set { this.CarRentalCustomerServiceTollFreeNumberOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalDaysRented + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalDaysRentedOption { get; private set; } /// /// Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces /// /// Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces - [DataMember(Name = "carRental.daysRented", EmitDefaultValue = false)] - public string CarRentalDaysRented { get; set; } + [JsonPropertyName("carRental.daysRented")] + public string CarRentalDaysRented { get { return this.CarRentalDaysRentedOption; } set { this.CarRentalDaysRentedOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalFuelCharges + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalFuelChargesOption { get; private set; } /// /// Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 /// /// Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 - [DataMember(Name = "carRental.fuelCharges", EmitDefaultValue = false)] - public string CarRentalFuelCharges { get; set; } + [JsonPropertyName("carRental.fuelCharges")] + public string CarRentalFuelCharges { get { return this.CarRentalFuelChargesOption; } set { this.CarRentalFuelChargesOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalInsuranceCharges + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalInsuranceChargesOption { get; private set; } /// /// Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces *Must not be all zeros. /// /// Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces *Must not be all zeros. - [DataMember(Name = "carRental.insuranceCharges", EmitDefaultValue = false)] - public string CarRentalInsuranceCharges { get; set; } + [JsonPropertyName("carRental.insuranceCharges")] + public string CarRentalInsuranceCharges { get { return this.CarRentalInsuranceChargesOption; } set { this.CarRentalInsuranceChargesOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalLocationCity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalLocationCityOption { get; private set; } /// /// The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. - [DataMember(Name = "carRental.locationCity", EmitDefaultValue = false)] - public string CarRentalLocationCity { get; set; } + [JsonPropertyName("carRental.locationCity")] + public string CarRentalLocationCity { get { return this.CarRentalLocationCityOption; } set { this.CarRentalLocationCityOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalLocationCountry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalLocationCountryOption { get; private set; } /// /// The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 /// /// The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 - [DataMember(Name = "carRental.locationCountry", EmitDefaultValue = false)] - public string CarRentalLocationCountry { get; set; } + [JsonPropertyName("carRental.locationCountry")] + public string CarRentalLocationCountry { get { return this.CarRentalLocationCountryOption; } set { this.CarRentalLocationCountryOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalLocationStateProvince + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalLocationStateProvinceOption { get; private set; } /// /// The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces *Must not be all zeros. - [DataMember(Name = "carRental.locationStateProvince", EmitDefaultValue = false)] - public string CarRentalLocationStateProvince { get; set; } + [JsonPropertyName("carRental.locationStateProvince")] + public string CarRentalLocationStateProvince { get { return this.CarRentalLocationStateProvinceOption; } set { this.CarRentalLocationStateProvinceOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalNoShowIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalNoShowIndicatorOption { get; private set; } /// /// Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable /// /// Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable - [DataMember(Name = "carRental.noShowIndicator", EmitDefaultValue = false)] - public string CarRentalNoShowIndicator { get; set; } + [JsonPropertyName("carRental.noShowIndicator")] + public string CarRentalNoShowIndicator { get { return this.CarRentalNoShowIndicatorOption; } set { this.CarRentalNoShowIndicatorOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalOneWayDropOffCharges + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalOneWayDropOffChargesOption { get; private set; } /// /// The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12 /// /// The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12 - [DataMember(Name = "carRental.oneWayDropOffCharges", EmitDefaultValue = false)] - public string CarRentalOneWayDropOffCharges { get; set; } + [JsonPropertyName("carRental.oneWayDropOffCharges")] + public string CarRentalOneWayDropOffCharges { get { return this.CarRentalOneWayDropOffChargesOption; } set { this.CarRentalOneWayDropOffChargesOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalRate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalRateOption { get; private set; } /// /// The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12 /// /// The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12 - [DataMember(Name = "carRental.rate", EmitDefaultValue = false)] - public string CarRentalRate { get; set; } + [JsonPropertyName("carRental.rate")] + public string CarRentalRate { get { return this.CarRentalRateOption; } set { this.CarRentalRateOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalRateIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalRateIndicatorOption { get; private set; } /// /// Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate /// /// Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate - [DataMember(Name = "carRental.rateIndicator", EmitDefaultValue = false)] - public string CarRentalRateIndicator { get; set; } + [JsonPropertyName("carRental.rateIndicator")] + public string CarRentalRateIndicator { get { return this.CarRentalRateIndicatorOption; } set { this.CarRentalRateIndicatorOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalRentalAgreementNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalRentalAgreementNumberOption { get; private set; } /// /// The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces *Must not be all zeros. - [DataMember(Name = "carRental.rentalAgreementNumber", EmitDefaultValue = false)] - public string CarRentalRentalAgreementNumber { get; set; } + [JsonPropertyName("carRental.rentalAgreementNumber")] + public string CarRentalRentalAgreementNumber { get { return this.CarRentalRentalAgreementNumberOption; } set { this.CarRentalRentalAgreementNumberOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalRentalClassId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalRentalClassIdOption { get; private set; } /// /// The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces *Must not be all zeros. - [DataMember(Name = "carRental.rentalClassId", EmitDefaultValue = false)] - public string CarRentalRentalClassId { get; set; } + [JsonPropertyName("carRental.rentalClassId")] + public string CarRentalRentalClassId { get { return this.CarRentalRentalClassIdOption; } set { this.CarRentalRentalClassIdOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalRenterName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalRenterNameOption { get; private set; } /// /// The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces *Must not be all zeros. /// /// The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces *Must not be all zeros. - [DataMember(Name = "carRental.renterName", EmitDefaultValue = false)] - public string CarRentalRenterName { get; set; } + [JsonPropertyName("carRental.renterName")] + public string CarRentalRenterName { get { return this.CarRentalRenterNameOption; } set { this.CarRentalRenterNameOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalReturnCity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalReturnCityOption { get; private set; } /// /// The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. - [DataMember(Name = "carRental.returnCity", EmitDefaultValue = false)] - public string CarRentalReturnCity { get; set; } + [JsonPropertyName("carRental.returnCity")] + public string CarRentalReturnCity { get { return this.CarRentalReturnCityOption; } set { this.CarRentalReturnCityOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalReturnCountry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalReturnCountryOption { get; private set; } /// /// The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 /// /// The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 - [DataMember(Name = "carRental.returnCountry", EmitDefaultValue = false)] - public string CarRentalReturnCountry { get; set; } + [JsonPropertyName("carRental.returnCountry")] + public string CarRentalReturnCountry { get { return this.CarRentalReturnCountryOption; } set { this.CarRentalReturnCountryOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalReturnDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalReturnDateOption { get; private set; } /// /// The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 /// /// The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 - [DataMember(Name = "carRental.returnDate", EmitDefaultValue = false)] - public string CarRentalReturnDate { get; set; } + [JsonPropertyName("carRental.returnDate")] + public string CarRentalReturnDate { get { return this.CarRentalReturnDateOption; } set { this.CarRentalReturnDateOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalReturnLocationId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalReturnLocationIdOption { get; private set; } /// /// The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces *Must not be all zeros. - [DataMember(Name = "carRental.returnLocationId", EmitDefaultValue = false)] - public string CarRentalReturnLocationId { get; set; } + [JsonPropertyName("carRental.returnLocationId")] + public string CarRentalReturnLocationId { get { return this.CarRentalReturnLocationIdOption; } set { this.CarRentalReturnLocationIdOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalReturnStateProvince + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalReturnStateProvinceOption { get; private set; } /// /// The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces *Must not be all zeros. - [DataMember(Name = "carRental.returnStateProvince", EmitDefaultValue = false)] - public string CarRentalReturnStateProvince { get; set; } + [JsonPropertyName("carRental.returnStateProvince")] + public string CarRentalReturnStateProvince { get { return this.CarRentalReturnStateProvinceOption; } set { this.CarRentalReturnStateProvinceOption = new Option(value); } } + + /// + /// Used to track the state of CarRentalTaxExemptIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarRentalTaxExemptIndicatorOption { get; private set; } /// /// Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected /// /// Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected - [DataMember(Name = "carRental.taxExemptIndicator", EmitDefaultValue = false)] - public string CarRentalTaxExemptIndicator { get; set; } + [JsonPropertyName("carRental.taxExemptIndicator")] + public string CarRentalTaxExemptIndicator { get { return this.CarRentalTaxExemptIndicatorOption; } set { this.CarRentalTaxExemptIndicatorOption = new Option(value); } } + + /// + /// Used to track the state of TravelEntertainmentAuthDataDuration + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TravelEntertainmentAuthDataDurationOption { get; private set; } /// /// Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 4 /// /// Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 4 - [DataMember(Name = "travelEntertainmentAuthData.duration", EmitDefaultValue = false)] - public string TravelEntertainmentAuthDataDuration { get; set; } + [JsonPropertyName("travelEntertainmentAuthData.duration")] + public string TravelEntertainmentAuthDataDuration { get { return this.TravelEntertainmentAuthDataDurationOption; } set { this.TravelEntertainmentAuthDataDurationOption = new Option(value); } } + + /// + /// Used to track the state of TravelEntertainmentAuthDataMarket + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TravelEntertainmentAuthDataMarketOption { get; private set; } /// /// Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 /// /// Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 - [DataMember(Name = "travelEntertainmentAuthData.market", EmitDefaultValue = false)] - public string TravelEntertainmentAuthDataMarket { get; set; } + [JsonPropertyName("travelEntertainmentAuthData.market")] + public string TravelEntertainmentAuthDataMarket { get { return this.TravelEntertainmentAuthDataMarketOption; } set { this.TravelEntertainmentAuthDataMarketOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -282,266 +443,385 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataCarRentalJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AdditionalDataCarRental Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AdditionalDataCarRental); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AdditionalDataCarRental instances are equal - /// - /// Instance of AdditionalDataCarRental to be compared - /// Boolean - public bool Equals(AdditionalDataCarRental input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option carRentalCheckOutDate = default; + Option carRentalCustomerServiceTollFreeNumber = default; + Option carRentalDaysRented = default; + Option carRentalFuelCharges = default; + Option carRentalInsuranceCharges = default; + Option carRentalLocationCity = default; + Option carRentalLocationCountry = default; + Option carRentalLocationStateProvince = default; + Option carRentalNoShowIndicator = default; + Option carRentalOneWayDropOffCharges = default; + Option carRentalRate = default; + Option carRentalRateIndicator = default; + Option carRentalRentalAgreementNumber = default; + Option carRentalRentalClassId = default; + Option carRentalRenterName = default; + Option carRentalReturnCity = default; + Option carRentalReturnCountry = default; + Option carRentalReturnDate = default; + Option carRentalReturnLocationId = default; + Option carRentalReturnStateProvince = default; + Option carRentalTaxExemptIndicator = default; + Option travelEntertainmentAuthDataDuration = default; + Option travelEntertainmentAuthDataMarket = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "carRental.checkOutDate": + carRentalCheckOutDate = new Option(utf8JsonReader.GetString()); + break; + case "carRental.customerServiceTollFreeNumber": + carRentalCustomerServiceTollFreeNumber = new Option(utf8JsonReader.GetString()); + break; + case "carRental.daysRented": + carRentalDaysRented = new Option(utf8JsonReader.GetString()); + break; + case "carRental.fuelCharges": + carRentalFuelCharges = new Option(utf8JsonReader.GetString()); + break; + case "carRental.insuranceCharges": + carRentalInsuranceCharges = new Option(utf8JsonReader.GetString()); + break; + case "carRental.locationCity": + carRentalLocationCity = new Option(utf8JsonReader.GetString()); + break; + case "carRental.locationCountry": + carRentalLocationCountry = new Option(utf8JsonReader.GetString()); + break; + case "carRental.locationStateProvince": + carRentalLocationStateProvince = new Option(utf8JsonReader.GetString()); + break; + case "carRental.noShowIndicator": + carRentalNoShowIndicator = new Option(utf8JsonReader.GetString()); + break; + case "carRental.oneWayDropOffCharges": + carRentalOneWayDropOffCharges = new Option(utf8JsonReader.GetString()); + break; + case "carRental.rate": + carRentalRate = new Option(utf8JsonReader.GetString()); + break; + case "carRental.rateIndicator": + carRentalRateIndicator = new Option(utf8JsonReader.GetString()); + break; + case "carRental.rentalAgreementNumber": + carRentalRentalAgreementNumber = new Option(utf8JsonReader.GetString()); + break; + case "carRental.rentalClassId": + carRentalRentalClassId = new Option(utf8JsonReader.GetString()); + break; + case "carRental.renterName": + carRentalRenterName = new Option(utf8JsonReader.GetString()); + break; + case "carRental.returnCity": + carRentalReturnCity = new Option(utf8JsonReader.GetString()); + break; + case "carRental.returnCountry": + carRentalReturnCountry = new Option(utf8JsonReader.GetString()); + break; + case "carRental.returnDate": + carRentalReturnDate = new Option(utf8JsonReader.GetString()); + break; + case "carRental.returnLocationId": + carRentalReturnLocationId = new Option(utf8JsonReader.GetString()); + break; + case "carRental.returnStateProvince": + carRentalReturnStateProvince = new Option(utf8JsonReader.GetString()); + break; + case "carRental.taxExemptIndicator": + carRentalTaxExemptIndicator = new Option(utf8JsonReader.GetString()); + break; + case "travelEntertainmentAuthData.duration": + travelEntertainmentAuthDataDuration = new Option(utf8JsonReader.GetString()); + break; + case "travelEntertainmentAuthData.market": + travelEntertainmentAuthDataMarket = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.CarRentalCheckOutDate == input.CarRentalCheckOutDate || - (this.CarRentalCheckOutDate != null && - this.CarRentalCheckOutDate.Equals(input.CarRentalCheckOutDate)) - ) && - ( - this.CarRentalCustomerServiceTollFreeNumber == input.CarRentalCustomerServiceTollFreeNumber || - (this.CarRentalCustomerServiceTollFreeNumber != null && - this.CarRentalCustomerServiceTollFreeNumber.Equals(input.CarRentalCustomerServiceTollFreeNumber)) - ) && - ( - this.CarRentalDaysRented == input.CarRentalDaysRented || - (this.CarRentalDaysRented != null && - this.CarRentalDaysRented.Equals(input.CarRentalDaysRented)) - ) && - ( - this.CarRentalFuelCharges == input.CarRentalFuelCharges || - (this.CarRentalFuelCharges != null && - this.CarRentalFuelCharges.Equals(input.CarRentalFuelCharges)) - ) && - ( - this.CarRentalInsuranceCharges == input.CarRentalInsuranceCharges || - (this.CarRentalInsuranceCharges != null && - this.CarRentalInsuranceCharges.Equals(input.CarRentalInsuranceCharges)) - ) && - ( - this.CarRentalLocationCity == input.CarRentalLocationCity || - (this.CarRentalLocationCity != null && - this.CarRentalLocationCity.Equals(input.CarRentalLocationCity)) - ) && - ( - this.CarRentalLocationCountry == input.CarRentalLocationCountry || - (this.CarRentalLocationCountry != null && - this.CarRentalLocationCountry.Equals(input.CarRentalLocationCountry)) - ) && - ( - this.CarRentalLocationStateProvince == input.CarRentalLocationStateProvince || - (this.CarRentalLocationStateProvince != null && - this.CarRentalLocationStateProvince.Equals(input.CarRentalLocationStateProvince)) - ) && - ( - this.CarRentalNoShowIndicator == input.CarRentalNoShowIndicator || - (this.CarRentalNoShowIndicator != null && - this.CarRentalNoShowIndicator.Equals(input.CarRentalNoShowIndicator)) - ) && - ( - this.CarRentalOneWayDropOffCharges == input.CarRentalOneWayDropOffCharges || - (this.CarRentalOneWayDropOffCharges != null && - this.CarRentalOneWayDropOffCharges.Equals(input.CarRentalOneWayDropOffCharges)) - ) && - ( - this.CarRentalRate == input.CarRentalRate || - (this.CarRentalRate != null && - this.CarRentalRate.Equals(input.CarRentalRate)) - ) && - ( - this.CarRentalRateIndicator == input.CarRentalRateIndicator || - (this.CarRentalRateIndicator != null && - this.CarRentalRateIndicator.Equals(input.CarRentalRateIndicator)) - ) && - ( - this.CarRentalRentalAgreementNumber == input.CarRentalRentalAgreementNumber || - (this.CarRentalRentalAgreementNumber != null && - this.CarRentalRentalAgreementNumber.Equals(input.CarRentalRentalAgreementNumber)) - ) && - ( - this.CarRentalRentalClassId == input.CarRentalRentalClassId || - (this.CarRentalRentalClassId != null && - this.CarRentalRentalClassId.Equals(input.CarRentalRentalClassId)) - ) && - ( - this.CarRentalRenterName == input.CarRentalRenterName || - (this.CarRentalRenterName != null && - this.CarRentalRenterName.Equals(input.CarRentalRenterName)) - ) && - ( - this.CarRentalReturnCity == input.CarRentalReturnCity || - (this.CarRentalReturnCity != null && - this.CarRentalReturnCity.Equals(input.CarRentalReturnCity)) - ) && - ( - this.CarRentalReturnCountry == input.CarRentalReturnCountry || - (this.CarRentalReturnCountry != null && - this.CarRentalReturnCountry.Equals(input.CarRentalReturnCountry)) - ) && - ( - this.CarRentalReturnDate == input.CarRentalReturnDate || - (this.CarRentalReturnDate != null && - this.CarRentalReturnDate.Equals(input.CarRentalReturnDate)) - ) && - ( - this.CarRentalReturnLocationId == input.CarRentalReturnLocationId || - (this.CarRentalReturnLocationId != null && - this.CarRentalReturnLocationId.Equals(input.CarRentalReturnLocationId)) - ) && - ( - this.CarRentalReturnStateProvince == input.CarRentalReturnStateProvince || - (this.CarRentalReturnStateProvince != null && - this.CarRentalReturnStateProvince.Equals(input.CarRentalReturnStateProvince)) - ) && - ( - this.CarRentalTaxExemptIndicator == input.CarRentalTaxExemptIndicator || - (this.CarRentalTaxExemptIndicator != null && - this.CarRentalTaxExemptIndicator.Equals(input.CarRentalTaxExemptIndicator)) - ) && - ( - this.TravelEntertainmentAuthDataDuration == input.TravelEntertainmentAuthDataDuration || - (this.TravelEntertainmentAuthDataDuration != null && - this.TravelEntertainmentAuthDataDuration.Equals(input.TravelEntertainmentAuthDataDuration)) - ) && - ( - this.TravelEntertainmentAuthDataMarket == input.TravelEntertainmentAuthDataMarket || - (this.TravelEntertainmentAuthDataMarket != null && - this.TravelEntertainmentAuthDataMarket.Equals(input.TravelEntertainmentAuthDataMarket)) - ); + + if (carRentalCheckOutDate.IsSet && carRentalCheckOutDate.Value == null) + throw new ArgumentNullException(nameof(carRentalCheckOutDate), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalCustomerServiceTollFreeNumber.IsSet && carRentalCustomerServiceTollFreeNumber.Value == null) + throw new ArgumentNullException(nameof(carRentalCustomerServiceTollFreeNumber), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalDaysRented.IsSet && carRentalDaysRented.Value == null) + throw new ArgumentNullException(nameof(carRentalDaysRented), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalFuelCharges.IsSet && carRentalFuelCharges.Value == null) + throw new ArgumentNullException(nameof(carRentalFuelCharges), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalInsuranceCharges.IsSet && carRentalInsuranceCharges.Value == null) + throw new ArgumentNullException(nameof(carRentalInsuranceCharges), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalLocationCity.IsSet && carRentalLocationCity.Value == null) + throw new ArgumentNullException(nameof(carRentalLocationCity), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalLocationCountry.IsSet && carRentalLocationCountry.Value == null) + throw new ArgumentNullException(nameof(carRentalLocationCountry), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalLocationStateProvince.IsSet && carRentalLocationStateProvince.Value == null) + throw new ArgumentNullException(nameof(carRentalLocationStateProvince), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalNoShowIndicator.IsSet && carRentalNoShowIndicator.Value == null) + throw new ArgumentNullException(nameof(carRentalNoShowIndicator), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalOneWayDropOffCharges.IsSet && carRentalOneWayDropOffCharges.Value == null) + throw new ArgumentNullException(nameof(carRentalOneWayDropOffCharges), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalRate.IsSet && carRentalRate.Value == null) + throw new ArgumentNullException(nameof(carRentalRate), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalRateIndicator.IsSet && carRentalRateIndicator.Value == null) + throw new ArgumentNullException(nameof(carRentalRateIndicator), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalRentalAgreementNumber.IsSet && carRentalRentalAgreementNumber.Value == null) + throw new ArgumentNullException(nameof(carRentalRentalAgreementNumber), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalRentalClassId.IsSet && carRentalRentalClassId.Value == null) + throw new ArgumentNullException(nameof(carRentalRentalClassId), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalRenterName.IsSet && carRentalRenterName.Value == null) + throw new ArgumentNullException(nameof(carRentalRenterName), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalReturnCity.IsSet && carRentalReturnCity.Value == null) + throw new ArgumentNullException(nameof(carRentalReturnCity), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalReturnCountry.IsSet && carRentalReturnCountry.Value == null) + throw new ArgumentNullException(nameof(carRentalReturnCountry), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalReturnDate.IsSet && carRentalReturnDate.Value == null) + throw new ArgumentNullException(nameof(carRentalReturnDate), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalReturnLocationId.IsSet && carRentalReturnLocationId.Value == null) + throw new ArgumentNullException(nameof(carRentalReturnLocationId), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalReturnStateProvince.IsSet && carRentalReturnStateProvince.Value == null) + throw new ArgumentNullException(nameof(carRentalReturnStateProvince), "Property is not nullable for class AdditionalDataCarRental."); + + if (carRentalTaxExemptIndicator.IsSet && carRentalTaxExemptIndicator.Value == null) + throw new ArgumentNullException(nameof(carRentalTaxExemptIndicator), "Property is not nullable for class AdditionalDataCarRental."); + + if (travelEntertainmentAuthDataDuration.IsSet && travelEntertainmentAuthDataDuration.Value == null) + throw new ArgumentNullException(nameof(travelEntertainmentAuthDataDuration), "Property is not nullable for class AdditionalDataCarRental."); + + if (travelEntertainmentAuthDataMarket.IsSet && travelEntertainmentAuthDataMarket.Value == null) + throw new ArgumentNullException(nameof(travelEntertainmentAuthDataMarket), "Property is not nullable for class AdditionalDataCarRental."); + + return new AdditionalDataCarRental(carRentalCheckOutDate, carRentalCustomerServiceTollFreeNumber, carRentalDaysRented, carRentalFuelCharges, carRentalInsuranceCharges, carRentalLocationCity, carRentalLocationCountry, carRentalLocationStateProvince, carRentalNoShowIndicator, carRentalOneWayDropOffCharges, carRentalRate, carRentalRateIndicator, carRentalRentalAgreementNumber, carRentalRentalClassId, carRentalRenterName, carRentalReturnCity, carRentalReturnCountry, carRentalReturnDate, carRentalReturnLocationId, carRentalReturnStateProvince, carRentalTaxExemptIndicator, travelEntertainmentAuthDataDuration, travelEntertainmentAuthDataMarket); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataCarRental additionalDataCarRental, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CarRentalCheckOutDate != null) - { - hashCode = (hashCode * 59) + this.CarRentalCheckOutDate.GetHashCode(); - } - if (this.CarRentalCustomerServiceTollFreeNumber != null) - { - hashCode = (hashCode * 59) + this.CarRentalCustomerServiceTollFreeNumber.GetHashCode(); - } - if (this.CarRentalDaysRented != null) - { - hashCode = (hashCode * 59) + this.CarRentalDaysRented.GetHashCode(); - } - if (this.CarRentalFuelCharges != null) - { - hashCode = (hashCode * 59) + this.CarRentalFuelCharges.GetHashCode(); - } - if (this.CarRentalInsuranceCharges != null) - { - hashCode = (hashCode * 59) + this.CarRentalInsuranceCharges.GetHashCode(); - } - if (this.CarRentalLocationCity != null) - { - hashCode = (hashCode * 59) + this.CarRentalLocationCity.GetHashCode(); - } - if (this.CarRentalLocationCountry != null) - { - hashCode = (hashCode * 59) + this.CarRentalLocationCountry.GetHashCode(); - } - if (this.CarRentalLocationStateProvince != null) - { - hashCode = (hashCode * 59) + this.CarRentalLocationStateProvince.GetHashCode(); - } - if (this.CarRentalNoShowIndicator != null) - { - hashCode = (hashCode * 59) + this.CarRentalNoShowIndicator.GetHashCode(); - } - if (this.CarRentalOneWayDropOffCharges != null) - { - hashCode = (hashCode * 59) + this.CarRentalOneWayDropOffCharges.GetHashCode(); - } - if (this.CarRentalRate != null) - { - hashCode = (hashCode * 59) + this.CarRentalRate.GetHashCode(); - } - if (this.CarRentalRateIndicator != null) - { - hashCode = (hashCode * 59) + this.CarRentalRateIndicator.GetHashCode(); - } - if (this.CarRentalRentalAgreementNumber != null) - { - hashCode = (hashCode * 59) + this.CarRentalRentalAgreementNumber.GetHashCode(); - } - if (this.CarRentalRentalClassId != null) - { - hashCode = (hashCode * 59) + this.CarRentalRentalClassId.GetHashCode(); - } - if (this.CarRentalRenterName != null) - { - hashCode = (hashCode * 59) + this.CarRentalRenterName.GetHashCode(); - } - if (this.CarRentalReturnCity != null) - { - hashCode = (hashCode * 59) + this.CarRentalReturnCity.GetHashCode(); - } - if (this.CarRentalReturnCountry != null) - { - hashCode = (hashCode * 59) + this.CarRentalReturnCountry.GetHashCode(); - } - if (this.CarRentalReturnDate != null) - { - hashCode = (hashCode * 59) + this.CarRentalReturnDate.GetHashCode(); - } - if (this.CarRentalReturnLocationId != null) - { - hashCode = (hashCode * 59) + this.CarRentalReturnLocationId.GetHashCode(); - } - if (this.CarRentalReturnStateProvince != null) - { - hashCode = (hashCode * 59) + this.CarRentalReturnStateProvince.GetHashCode(); - } - if (this.CarRentalTaxExemptIndicator != null) - { - hashCode = (hashCode * 59) + this.CarRentalTaxExemptIndicator.GetHashCode(); - } - if (this.TravelEntertainmentAuthDataDuration != null) - { - hashCode = (hashCode * 59) + this.TravelEntertainmentAuthDataDuration.GetHashCode(); - } - if (this.TravelEntertainmentAuthDataMarket != null) - { - hashCode = (hashCode * 59) + this.TravelEntertainmentAuthDataMarket.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataCarRental, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataCarRental additionalDataCarRental, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataCarRental.CarRentalCheckOutDateOption.IsSet && additionalDataCarRental.CarRentalCheckOutDate == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalCheckOutDate), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalCustomerServiceTollFreeNumberOption.IsSet && additionalDataCarRental.CarRentalCustomerServiceTollFreeNumber == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalCustomerServiceTollFreeNumber), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalDaysRentedOption.IsSet && additionalDataCarRental.CarRentalDaysRented == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalDaysRented), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalFuelChargesOption.IsSet && additionalDataCarRental.CarRentalFuelCharges == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalFuelCharges), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalInsuranceChargesOption.IsSet && additionalDataCarRental.CarRentalInsuranceCharges == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalInsuranceCharges), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalLocationCityOption.IsSet && additionalDataCarRental.CarRentalLocationCity == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalLocationCity), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalLocationCountryOption.IsSet && additionalDataCarRental.CarRentalLocationCountry == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalLocationCountry), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalLocationStateProvinceOption.IsSet && additionalDataCarRental.CarRentalLocationStateProvince == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalLocationStateProvince), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalNoShowIndicatorOption.IsSet && additionalDataCarRental.CarRentalNoShowIndicator == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalNoShowIndicator), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalOneWayDropOffChargesOption.IsSet && additionalDataCarRental.CarRentalOneWayDropOffCharges == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalOneWayDropOffCharges), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalRateOption.IsSet && additionalDataCarRental.CarRentalRate == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalRate), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalRateIndicatorOption.IsSet && additionalDataCarRental.CarRentalRateIndicator == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalRateIndicator), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalRentalAgreementNumberOption.IsSet && additionalDataCarRental.CarRentalRentalAgreementNumber == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalRentalAgreementNumber), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalRentalClassIdOption.IsSet && additionalDataCarRental.CarRentalRentalClassId == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalRentalClassId), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalRenterNameOption.IsSet && additionalDataCarRental.CarRentalRenterName == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalRenterName), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalReturnCityOption.IsSet && additionalDataCarRental.CarRentalReturnCity == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalReturnCity), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalReturnCountryOption.IsSet && additionalDataCarRental.CarRentalReturnCountry == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalReturnCountry), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalReturnDateOption.IsSet && additionalDataCarRental.CarRentalReturnDate == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalReturnDate), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalReturnLocationIdOption.IsSet && additionalDataCarRental.CarRentalReturnLocationId == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalReturnLocationId), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalReturnStateProvinceOption.IsSet && additionalDataCarRental.CarRentalReturnStateProvince == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalReturnStateProvince), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalTaxExemptIndicatorOption.IsSet && additionalDataCarRental.CarRentalTaxExemptIndicator == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalTaxExemptIndicator), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.TravelEntertainmentAuthDataDurationOption.IsSet && additionalDataCarRental.TravelEntertainmentAuthDataDuration == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.TravelEntertainmentAuthDataDuration), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.TravelEntertainmentAuthDataMarketOption.IsSet && additionalDataCarRental.TravelEntertainmentAuthDataMarket == null) + throw new ArgumentNullException(nameof(additionalDataCarRental.TravelEntertainmentAuthDataMarket), "Property is required for class AdditionalDataCarRental."); + + if (additionalDataCarRental.CarRentalCheckOutDateOption.IsSet) + writer.WriteString("carRental.checkOutDate", additionalDataCarRental.CarRentalCheckOutDate); + + if (additionalDataCarRental.CarRentalCustomerServiceTollFreeNumberOption.IsSet) + writer.WriteString("carRental.customerServiceTollFreeNumber", additionalDataCarRental.CarRentalCustomerServiceTollFreeNumber); + + if (additionalDataCarRental.CarRentalDaysRentedOption.IsSet) + writer.WriteString("carRental.daysRented", additionalDataCarRental.CarRentalDaysRented); + + if (additionalDataCarRental.CarRentalFuelChargesOption.IsSet) + writer.WriteString("carRental.fuelCharges", additionalDataCarRental.CarRentalFuelCharges); + + if (additionalDataCarRental.CarRentalInsuranceChargesOption.IsSet) + writer.WriteString("carRental.insuranceCharges", additionalDataCarRental.CarRentalInsuranceCharges); + + if (additionalDataCarRental.CarRentalLocationCityOption.IsSet) + writer.WriteString("carRental.locationCity", additionalDataCarRental.CarRentalLocationCity); + + if (additionalDataCarRental.CarRentalLocationCountryOption.IsSet) + writer.WriteString("carRental.locationCountry", additionalDataCarRental.CarRentalLocationCountry); + + if (additionalDataCarRental.CarRentalLocationStateProvinceOption.IsSet) + writer.WriteString("carRental.locationStateProvince", additionalDataCarRental.CarRentalLocationStateProvince); + + if (additionalDataCarRental.CarRentalNoShowIndicatorOption.IsSet) + writer.WriteString("carRental.noShowIndicator", additionalDataCarRental.CarRentalNoShowIndicator); + + if (additionalDataCarRental.CarRentalOneWayDropOffChargesOption.IsSet) + writer.WriteString("carRental.oneWayDropOffCharges", additionalDataCarRental.CarRentalOneWayDropOffCharges); + + if (additionalDataCarRental.CarRentalRateOption.IsSet) + writer.WriteString("carRental.rate", additionalDataCarRental.CarRentalRate); + + if (additionalDataCarRental.CarRentalRateIndicatorOption.IsSet) + writer.WriteString("carRental.rateIndicator", additionalDataCarRental.CarRentalRateIndicator); + + if (additionalDataCarRental.CarRentalRentalAgreementNumberOption.IsSet) + writer.WriteString("carRental.rentalAgreementNumber", additionalDataCarRental.CarRentalRentalAgreementNumber); + + if (additionalDataCarRental.CarRentalRentalClassIdOption.IsSet) + writer.WriteString("carRental.rentalClassId", additionalDataCarRental.CarRentalRentalClassId); + + if (additionalDataCarRental.CarRentalRenterNameOption.IsSet) + writer.WriteString("carRental.renterName", additionalDataCarRental.CarRentalRenterName); + + if (additionalDataCarRental.CarRentalReturnCityOption.IsSet) + writer.WriteString("carRental.returnCity", additionalDataCarRental.CarRentalReturnCity); + + if (additionalDataCarRental.CarRentalReturnCountryOption.IsSet) + writer.WriteString("carRental.returnCountry", additionalDataCarRental.CarRentalReturnCountry); + + if (additionalDataCarRental.CarRentalReturnDateOption.IsSet) + writer.WriteString("carRental.returnDate", additionalDataCarRental.CarRentalReturnDate); + + if (additionalDataCarRental.CarRentalReturnLocationIdOption.IsSet) + writer.WriteString("carRental.returnLocationId", additionalDataCarRental.CarRentalReturnLocationId); + + if (additionalDataCarRental.CarRentalReturnStateProvinceOption.IsSet) + writer.WriteString("carRental.returnStateProvince", additionalDataCarRental.CarRentalReturnStateProvince); + + if (additionalDataCarRental.CarRentalTaxExemptIndicatorOption.IsSet) + writer.WriteString("carRental.taxExemptIndicator", additionalDataCarRental.CarRentalTaxExemptIndicator); + + if (additionalDataCarRental.TravelEntertainmentAuthDataDurationOption.IsSet) + writer.WriteString("travelEntertainmentAuthData.duration", additionalDataCarRental.TravelEntertainmentAuthDataDuration); + + if (additionalDataCarRental.TravelEntertainmentAuthDataMarketOption.IsSet) + writer.WriteString("travelEntertainmentAuthData.market", additionalDataCarRental.TravelEntertainmentAuthDataMarket); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataCommon.cs b/Adyen/Model/Checkout/AdditionalDataCommon.cs index 3d17a1c2c..b4ecca19c 100644 --- a/Adyen/Model/Checkout/AdditionalDataCommon.cs +++ b/Adyen/Model/Checkout/AdditionalDataCommon.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,239 +14,433 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataCommon /// - [DataContract(Name = "AdditionalDataCommon")] - public partial class AdditionalDataCommon : IEquatable, IValidatableObject + public partial class AdditionalDataCommon : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Triggers test scenarios that allow to replicate certain acquirer response codes. See [Testing result codes and refusal reasons](https://docs.adyen.com/development-resources/testing/result-codes/) to learn about the possible values, and the `refusalReason` values you can trigger. + /// Triggers test scenarios that allow to replicate certain communication errors. Allowed values: * **NO_CONNECTION_AVAILABLE** – There wasn't a connection available to service the outgoing communication. This is a transient, retriable error since no messaging could be initiated to an issuing system (or third-party acquiring system). Therefore, the header Transient-Error: true is returned in the response. A subsequent request using the same idempotency key will be processed as if it was the first request. * **IOEXCEPTION_RECEIVED** – Something went wrong during transmission of the message or receiving the response. This is a classified as non-transient because the message could have been received by the issuing party and been acted upon. No transient error header is returned. If using idempotency, the (error) response is stored as the final result for the idempotency key. Subsequent messages with the same idempotency key not be processed beyond returning the stored response. + /// Set to true to authorise a part of the requested amount in case the cardholder does not have enough funds on their account. If a payment was partially authorised, the response includes resultCode: PartiallyAuthorised and the authorised amount in additionalData.authorisedAmountValue. To enable this functionality, contact our Support Team. + /// Flags a card payment request for either pre-authorisation or final authorisation. For more information, refer to [Authorisation types](https://docs.adyen.com/online-payments/adjust-authorisation#authorisation-types). Allowed values: * **PreAuth** – flags the payment request to be handled as a pre-authorisation. * **FinalAuth** – flags the payment request to be handled as a final authorisation. + /// Set to **true** to enable [Auto Rescue](https://docs.adyen.com/online-payments/auto-rescue/) for a transaction. Use the `maxDaysToRescue` to specify a rescue window. + /// Allows you to determine or override the acquirer account that should be used for the transaction. If you need to process a payment with an acquirer different from a default one, you can set up a corresponding configuration on the Adyen payments platform. Then you can pass a custom routing flag in a payment request's additional data to target a specific acquirer. To enable this functionality, contact [Support](https://www.adyen.help/hc/en-us/requests/new). + /// In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed. + /// Set to **true** to require [manual capture](https://docs.adyen.com/online-payments/capture) for the transaction. + /// The rescue window for a transaction, in days, when `autoRescue` is set to **true**. You can specify a value between 1 and 48. * For [cards](https://docs.adyen.com/online-payments/auto-rescue/cards/), the default is one calendar month. * For [SEPA](https://docs.adyen.com/online-payments/auto-rescue/sepa/), the default is 42 days. + /// Allows you to link the transaction to the original or previous one in a subscription/card-on-file chain. This field is required for token-based transactions where Adyen does not tokenize the card. Transaction identifier from card schemes, for example, Mastercard Trace ID or the Visa Transaction ID. Submit the original transaction ID of the contract in your payment request if you are not tokenizing card details with Adyen and are making a merchant-initiated transaction (MIT) for subsequent charges. Make sure you are sending `shopperInteraction` **ContAuth** and `recurringProcessingModel` **Subscription** or **UnscheduledCardOnFile** to ensure that the transaction is classified as MIT. + /// Boolean indicator that can be optionally used for performing debit transactions on combo cards (for example, combo cards in Brazil). This is not mandatory but we recommend that you set this to true if you want to use the `selectedBrand` value to specify how to process the transaction. + /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the city of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 13 characters. + /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the three-letter country code of the actual merchant's address. * Format: alpha-numeric. * Fixed length: 3 characters. + /// This field is required for transactions performed by registered payment facilitators. This field contains the email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters + /// This field contains an identifier of the actual merchant when a transaction is submitted via a payment facilitator. The payment facilitator must send in this unique ID. A unique identifier per submerchant that is required if the transaction is performed by a registered payment facilitator. * Format: alpha-numeric. * Fixed length: 15 characters. + /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the name of the actual merchant. * Format: alpha-numeric. * Maximum length: 22 characters. + /// This field is required for transactions performed by registered payment facilitators. This field contains the phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters + /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the postal code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 10 characters. + /// This field is required if the transaction is performed by a registered payment facilitator, and if applicable to the country. This field must contain the state code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 3 characters. + /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the street of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 60 characters. + /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the tax ID of the actual merchant. * Format: alpha-numeric. * Fixed length: 11 or 14 characters. + [JsonConstructor] + public AdditionalDataCommon(Option requestedTestAcquirerResponseCode = default, Option requestedTestErrorResponseCode = default, Option allowPartialAuth = default, Option authorisationType = default, Option autoRescue = default, Option customRoutingFlag = default, Option industryUsage = default, Option manualCapture = default, Option maxDaysToRescue = default, Option networkTxReference = default, Option overwriteBrand = default, Option subMerchantCity = default, Option subMerchantCountry = default, Option subMerchantEmail = default, Option subMerchantID = default, Option subMerchantName = default, Option subMerchantPhoneNumber = default, Option subMerchantPostalCode = default, Option subMerchantState = default, Option subMerchantStreet = default, Option subMerchantTaxId = default) + { + RequestedTestAcquirerResponseCodeOption = requestedTestAcquirerResponseCode; + RequestedTestErrorResponseCodeOption = requestedTestErrorResponseCode; + AllowPartialAuthOption = allowPartialAuth; + AuthorisationTypeOption = authorisationType; + AutoRescueOption = autoRescue; + CustomRoutingFlagOption = customRoutingFlag; + IndustryUsageOption = industryUsage; + ManualCaptureOption = manualCapture; + MaxDaysToRescueOption = maxDaysToRescue; + NetworkTxReferenceOption = networkTxReference; + OverwriteBrandOption = overwriteBrand; + SubMerchantCityOption = subMerchantCity; + SubMerchantCountryOption = subMerchantCountry; + SubMerchantEmailOption = subMerchantEmail; + SubMerchantIDOption = subMerchantID; + SubMerchantNameOption = subMerchantName; + SubMerchantPhoneNumberOption = subMerchantPhoneNumber; + SubMerchantPostalCodeOption = subMerchantPostalCode; + SubMerchantStateOption = subMerchantState; + SubMerchantStreetOption = subMerchantStreet; + SubMerchantTaxIdOption = subMerchantTaxId; + OnCreated(); + } + + partial void OnCreated(); + /// /// In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed. /// /// In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed. - [JsonConverter(typeof(StringEnumConverter))] public enum IndustryUsageEnum { /// /// Enum NoShow for value: NoShow /// - [EnumMember(Value = "NoShow")] NoShow = 1, /// /// Enum DelayedCharge for value: DelayedCharge /// - [EnumMember(Value = "DelayedCharge")] DelayedCharge = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static IndustryUsageEnum IndustryUsageEnumFromString(string value) + { + if (value.Equals("NoShow")) + return IndustryUsageEnum.NoShow; + + if (value.Equals("DelayedCharge")) + return IndustryUsageEnum.DelayedCharge; + + throw new NotImplementedException($"Could not convert value to type IndustryUsageEnum: '{value}'"); + } + /// + /// Returns a + /// + /// + /// + public static IndustryUsageEnum? IndustryUsageEnumFromStringOrDefault(string value) + { + if (value.Equals("NoShow")) + return IndustryUsageEnum.NoShow; + + if (value.Equals("DelayedCharge")) + return IndustryUsageEnum.DelayedCharge; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string IndustryUsageEnumToJsonValue(IndustryUsageEnum? value) + { + if (value == IndustryUsageEnum.NoShow) + return "NoShow"; + + if (value == IndustryUsageEnum.DelayedCharge) + return "DelayedCharge"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of IndustryUsage + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IndustryUsageOption { get; private set; } /// /// In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed. /// /// In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed. - [DataMember(Name = "industryUsage", EmitDefaultValue = false)] - public IndustryUsageEnum? IndustryUsage { get; set; } + [JsonPropertyName("industryUsage")] + public IndustryUsageEnum? IndustryUsage { get { return this.IndustryUsageOption; } set { this.IndustryUsageOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of RequestedTestAcquirerResponseCode /// - /// Triggers test scenarios that allow to replicate certain acquirer response codes. See [Testing result codes and refusal reasons](https://docs.adyen.com/development-resources/testing/result-codes/) to learn about the possible values, and the `refusalReason` values you can trigger. . - /// Triggers test scenarios that allow to replicate certain communication errors. Allowed values: * **NO_CONNECTION_AVAILABLE** – There wasn't a connection available to service the outgoing communication. This is a transient, retriable error since no messaging could be initiated to an issuing system (or third-party acquiring system). Therefore, the header Transient-Error: true is returned in the response. A subsequent request using the same idempotency key will be processed as if it was the first request. * **IOEXCEPTION_RECEIVED** – Something went wrong during transmission of the message or receiving the response. This is a classified as non-transient because the message could have been received by the issuing party and been acted upon. No transient error header is returned. If using idempotency, the (error) response is stored as the final result for the idempotency key. Subsequent messages with the same idempotency key not be processed beyond returning the stored response.. - /// Set to true to authorise a part of the requested amount in case the cardholder does not have enough funds on their account. If a payment was partially authorised, the response includes resultCode: PartiallyAuthorised and the authorised amount in additionalData.authorisedAmountValue. To enable this functionality, contact our Support Team.. - /// Flags a card payment request for either pre-authorisation or final authorisation. For more information, refer to [Authorisation types](https://docs.adyen.com/online-payments/adjust-authorisation#authorisation-types). Allowed values: * **PreAuth** – flags the payment request to be handled as a pre-authorisation. * **FinalAuth** – flags the payment request to be handled as a final authorisation.. - /// Set to **true** to enable [Auto Rescue](https://docs.adyen.com/online-payments/auto-rescue/) for a transaction. Use the `maxDaysToRescue` to specify a rescue window.. - /// Allows you to determine or override the acquirer account that should be used for the transaction. If you need to process a payment with an acquirer different from a default one, you can set up a corresponding configuration on the Adyen payments platform. Then you can pass a custom routing flag in a payment request's additional data to target a specific acquirer. To enable this functionality, contact [Support](https://www.adyen.help/hc/en-us/requests/new).. - /// In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed.. - /// Set to **true** to require [manual capture](https://docs.adyen.com/online-payments/capture) for the transaction.. - /// The rescue window for a transaction, in days, when `autoRescue` is set to **true**. You can specify a value between 1 and 48. * For [cards](https://docs.adyen.com/online-payments/auto-rescue/cards/), the default is one calendar month. * For [SEPA](https://docs.adyen.com/online-payments/auto-rescue/sepa/), the default is 42 days.. - /// Allows you to link the transaction to the original or previous one in a subscription/card-on-file chain. This field is required for token-based transactions where Adyen does not tokenize the card. Transaction identifier from card schemes, for example, Mastercard Trace ID or the Visa Transaction ID. Submit the original transaction ID of the contract in your payment request if you are not tokenizing card details with Adyen and are making a merchant-initiated transaction (MIT) for subsequent charges. Make sure you are sending `shopperInteraction` **ContAuth** and `recurringProcessingModel` **Subscription** or **UnscheduledCardOnFile** to ensure that the transaction is classified as MIT.. - /// Boolean indicator that can be optionally used for performing debit transactions on combo cards (for example, combo cards in Brazil). This is not mandatory but we recommend that you set this to true if you want to use the `selectedBrand` value to specify how to process the transaction.. - /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the city of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 13 characters.. - /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the three-letter country code of the actual merchant's address. * Format: alpha-numeric. * Fixed length: 3 characters.. - /// This field is required for transactions performed by registered payment facilitators. This field contains the email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters. - /// This field contains an identifier of the actual merchant when a transaction is submitted via a payment facilitator. The payment facilitator must send in this unique ID. A unique identifier per submerchant that is required if the transaction is performed by a registered payment facilitator. * Format: alpha-numeric. * Fixed length: 15 characters.. - /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the name of the actual merchant. * Format: alpha-numeric. * Maximum length: 22 characters.. - /// This field is required for transactions performed by registered payment facilitators. This field contains the phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters. - /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the postal code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 10 characters.. - /// This field is required if the transaction is performed by a registered payment facilitator, and if applicable to the country. This field must contain the state code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 3 characters.. - /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the street of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 60 characters.. - /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the tax ID of the actual merchant. * Format: alpha-numeric. * Fixed length: 11 or 14 characters.. - public AdditionalDataCommon(string requestedTestAcquirerResponseCode = default(string), string requestedTestErrorResponseCode = default(string), string allowPartialAuth = default(string), string authorisationType = default(string), string autoRescue = default(string), string customRoutingFlag = default(string), IndustryUsageEnum? industryUsage = default(IndustryUsageEnum?), string manualCapture = default(string), string maxDaysToRescue = default(string), string networkTxReference = default(string), string overwriteBrand = default(string), string subMerchantCity = default(string), string subMerchantCountry = default(string), string subMerchantEmail = default(string), string subMerchantID = default(string), string subMerchantName = default(string), string subMerchantPhoneNumber = default(string), string subMerchantPostalCode = default(string), string subMerchantState = default(string), string subMerchantStreet = default(string), string subMerchantTaxId = default(string)) - { - this.RequestedTestAcquirerResponseCode = requestedTestAcquirerResponseCode; - this.RequestedTestErrorResponseCode = requestedTestErrorResponseCode; - this.AllowPartialAuth = allowPartialAuth; - this.AuthorisationType = authorisationType; - this.AutoRescue = autoRescue; - this.CustomRoutingFlag = customRoutingFlag; - this.IndustryUsage = industryUsage; - this.ManualCapture = manualCapture; - this.MaxDaysToRescue = maxDaysToRescue; - this.NetworkTxReference = networkTxReference; - this.OverwriteBrand = overwriteBrand; - this.SubMerchantCity = subMerchantCity; - this.SubMerchantCountry = subMerchantCountry; - this.SubMerchantEmail = subMerchantEmail; - this.SubMerchantID = subMerchantID; - this.SubMerchantName = subMerchantName; - this.SubMerchantPhoneNumber = subMerchantPhoneNumber; - this.SubMerchantPostalCode = subMerchantPostalCode; - this.SubMerchantState = subMerchantState; - this.SubMerchantStreet = subMerchantStreet; - this.SubMerchantTaxId = subMerchantTaxId; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RequestedTestAcquirerResponseCodeOption { get; private set; } /// /// Triggers test scenarios that allow to replicate certain acquirer response codes. See [Testing result codes and refusal reasons](https://docs.adyen.com/development-resources/testing/result-codes/) to learn about the possible values, and the `refusalReason` values you can trigger. /// /// Triggers test scenarios that allow to replicate certain acquirer response codes. See [Testing result codes and refusal reasons](https://docs.adyen.com/development-resources/testing/result-codes/) to learn about the possible values, and the `refusalReason` values you can trigger. - [DataMember(Name = "RequestedTestAcquirerResponseCode", EmitDefaultValue = false)] - public string RequestedTestAcquirerResponseCode { get; set; } + [JsonPropertyName("RequestedTestAcquirerResponseCode")] + public string RequestedTestAcquirerResponseCode { get { return this.RequestedTestAcquirerResponseCodeOption; } set { this.RequestedTestAcquirerResponseCodeOption = new Option(value); } } + + /// + /// Used to track the state of RequestedTestErrorResponseCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RequestedTestErrorResponseCodeOption { get; private set; } /// /// Triggers test scenarios that allow to replicate certain communication errors. Allowed values: * **NO_CONNECTION_AVAILABLE** – There wasn't a connection available to service the outgoing communication. This is a transient, retriable error since no messaging could be initiated to an issuing system (or third-party acquiring system). Therefore, the header Transient-Error: true is returned in the response. A subsequent request using the same idempotency key will be processed as if it was the first request. * **IOEXCEPTION_RECEIVED** – Something went wrong during transmission of the message or receiving the response. This is a classified as non-transient because the message could have been received by the issuing party and been acted upon. No transient error header is returned. If using idempotency, the (error) response is stored as the final result for the idempotency key. Subsequent messages with the same idempotency key not be processed beyond returning the stored response. /// /// Triggers test scenarios that allow to replicate certain communication errors. Allowed values: * **NO_CONNECTION_AVAILABLE** – There wasn't a connection available to service the outgoing communication. This is a transient, retriable error since no messaging could be initiated to an issuing system (or third-party acquiring system). Therefore, the header Transient-Error: true is returned in the response. A subsequent request using the same idempotency key will be processed as if it was the first request. * **IOEXCEPTION_RECEIVED** – Something went wrong during transmission of the message or receiving the response. This is a classified as non-transient because the message could have been received by the issuing party and been acted upon. No transient error header is returned. If using idempotency, the (error) response is stored as the final result for the idempotency key. Subsequent messages with the same idempotency key not be processed beyond returning the stored response. - [DataMember(Name = "RequestedTestErrorResponseCode", EmitDefaultValue = false)] - public string RequestedTestErrorResponseCode { get; set; } + [JsonPropertyName("RequestedTestErrorResponseCode")] + public string RequestedTestErrorResponseCode { get { return this.RequestedTestErrorResponseCodeOption; } set { this.RequestedTestErrorResponseCodeOption = new Option(value); } } + + /// + /// Used to track the state of AllowPartialAuth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AllowPartialAuthOption { get; private set; } /// /// Set to true to authorise a part of the requested amount in case the cardholder does not have enough funds on their account. If a payment was partially authorised, the response includes resultCode: PartiallyAuthorised and the authorised amount in additionalData.authorisedAmountValue. To enable this functionality, contact our Support Team. /// /// Set to true to authorise a part of the requested amount in case the cardholder does not have enough funds on their account. If a payment was partially authorised, the response includes resultCode: PartiallyAuthorised and the authorised amount in additionalData.authorisedAmountValue. To enable this functionality, contact our Support Team. - [DataMember(Name = "allowPartialAuth", EmitDefaultValue = false)] - public string AllowPartialAuth { get; set; } + [JsonPropertyName("allowPartialAuth")] + public string AllowPartialAuth { get { return this.AllowPartialAuthOption; } set { this.AllowPartialAuthOption = new Option(value); } } + + /// + /// Used to track the state of AuthorisationType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthorisationTypeOption { get; private set; } /// /// Flags a card payment request for either pre-authorisation or final authorisation. For more information, refer to [Authorisation types](https://docs.adyen.com/online-payments/adjust-authorisation#authorisation-types). Allowed values: * **PreAuth** – flags the payment request to be handled as a pre-authorisation. * **FinalAuth** – flags the payment request to be handled as a final authorisation. /// /// Flags a card payment request for either pre-authorisation or final authorisation. For more information, refer to [Authorisation types](https://docs.adyen.com/online-payments/adjust-authorisation#authorisation-types). Allowed values: * **PreAuth** – flags the payment request to be handled as a pre-authorisation. * **FinalAuth** – flags the payment request to be handled as a final authorisation. - [DataMember(Name = "authorisationType", EmitDefaultValue = false)] - public string AuthorisationType { get; set; } + [JsonPropertyName("authorisationType")] + public string AuthorisationType { get { return this.AuthorisationTypeOption; } set { this.AuthorisationTypeOption = new Option(value); } } + + /// + /// Used to track the state of AutoRescue + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AutoRescueOption { get; private set; } /// /// Set to **true** to enable [Auto Rescue](https://docs.adyen.com/online-payments/auto-rescue/) for a transaction. Use the `maxDaysToRescue` to specify a rescue window. /// /// Set to **true** to enable [Auto Rescue](https://docs.adyen.com/online-payments/auto-rescue/) for a transaction. Use the `maxDaysToRescue` to specify a rescue window. - [DataMember(Name = "autoRescue", EmitDefaultValue = false)] - public string AutoRescue { get; set; } + [JsonPropertyName("autoRescue")] + public string AutoRescue { get { return this.AutoRescueOption; } set { this.AutoRescueOption = new Option(value); } } + + /// + /// Used to track the state of CustomRoutingFlag + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CustomRoutingFlagOption { get; private set; } /// /// Allows you to determine or override the acquirer account that should be used for the transaction. If you need to process a payment with an acquirer different from a default one, you can set up a corresponding configuration on the Adyen payments platform. Then you can pass a custom routing flag in a payment request's additional data to target a specific acquirer. To enable this functionality, contact [Support](https://www.adyen.help/hc/en-us/requests/new). /// /// Allows you to determine or override the acquirer account that should be used for the transaction. If you need to process a payment with an acquirer different from a default one, you can set up a corresponding configuration on the Adyen payments platform. Then you can pass a custom routing flag in a payment request's additional data to target a specific acquirer. To enable this functionality, contact [Support](https://www.adyen.help/hc/en-us/requests/new). - [DataMember(Name = "customRoutingFlag", EmitDefaultValue = false)] - public string CustomRoutingFlag { get; set; } + [JsonPropertyName("customRoutingFlag")] + public string CustomRoutingFlag { get { return this.CustomRoutingFlagOption; } set { this.CustomRoutingFlagOption = new Option(value); } } + + /// + /// Used to track the state of ManualCapture + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ManualCaptureOption { get; private set; } /// /// Set to **true** to require [manual capture](https://docs.adyen.com/online-payments/capture) for the transaction. /// /// Set to **true** to require [manual capture](https://docs.adyen.com/online-payments/capture) for the transaction. - [DataMember(Name = "manualCapture", EmitDefaultValue = false)] - public string ManualCapture { get; set; } + [JsonPropertyName("manualCapture")] + public string ManualCapture { get { return this.ManualCaptureOption; } set { this.ManualCaptureOption = new Option(value); } } + + /// + /// Used to track the state of MaxDaysToRescue + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MaxDaysToRescueOption { get; private set; } /// /// The rescue window for a transaction, in days, when `autoRescue` is set to **true**. You can specify a value between 1 and 48. * For [cards](https://docs.adyen.com/online-payments/auto-rescue/cards/), the default is one calendar month. * For [SEPA](https://docs.adyen.com/online-payments/auto-rescue/sepa/), the default is 42 days. /// /// The rescue window for a transaction, in days, when `autoRescue` is set to **true**. You can specify a value between 1 and 48. * For [cards](https://docs.adyen.com/online-payments/auto-rescue/cards/), the default is one calendar month. * For [SEPA](https://docs.adyen.com/online-payments/auto-rescue/sepa/), the default is 42 days. - [DataMember(Name = "maxDaysToRescue", EmitDefaultValue = false)] - public string MaxDaysToRescue { get; set; } + [JsonPropertyName("maxDaysToRescue")] + public string MaxDaysToRescue { get { return this.MaxDaysToRescueOption; } set { this.MaxDaysToRescueOption = new Option(value); } } + + /// + /// Used to track the state of NetworkTxReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NetworkTxReferenceOption { get; private set; } /// /// Allows you to link the transaction to the original or previous one in a subscription/card-on-file chain. This field is required for token-based transactions where Adyen does not tokenize the card. Transaction identifier from card schemes, for example, Mastercard Trace ID or the Visa Transaction ID. Submit the original transaction ID of the contract in your payment request if you are not tokenizing card details with Adyen and are making a merchant-initiated transaction (MIT) for subsequent charges. Make sure you are sending `shopperInteraction` **ContAuth** and `recurringProcessingModel` **Subscription** or **UnscheduledCardOnFile** to ensure that the transaction is classified as MIT. /// /// Allows you to link the transaction to the original or previous one in a subscription/card-on-file chain. This field is required for token-based transactions where Adyen does not tokenize the card. Transaction identifier from card schemes, for example, Mastercard Trace ID or the Visa Transaction ID. Submit the original transaction ID of the contract in your payment request if you are not tokenizing card details with Adyen and are making a merchant-initiated transaction (MIT) for subsequent charges. Make sure you are sending `shopperInteraction` **ContAuth** and `recurringProcessingModel` **Subscription** or **UnscheduledCardOnFile** to ensure that the transaction is classified as MIT. - [DataMember(Name = "networkTxReference", EmitDefaultValue = false)] - public string NetworkTxReference { get; set; } + [JsonPropertyName("networkTxReference")] + public string NetworkTxReference { get { return this.NetworkTxReferenceOption; } set { this.NetworkTxReferenceOption = new Option(value); } } + + /// + /// Used to track the state of OverwriteBrand + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OverwriteBrandOption { get; private set; } /// /// Boolean indicator that can be optionally used for performing debit transactions on combo cards (for example, combo cards in Brazil). This is not mandatory but we recommend that you set this to true if you want to use the `selectedBrand` value to specify how to process the transaction. /// /// Boolean indicator that can be optionally used for performing debit transactions on combo cards (for example, combo cards in Brazil). This is not mandatory but we recommend that you set this to true if you want to use the `selectedBrand` value to specify how to process the transaction. - [DataMember(Name = "overwriteBrand", EmitDefaultValue = false)] - public string OverwriteBrand { get; set; } + [JsonPropertyName("overwriteBrand")] + public string OverwriteBrand { get { return this.OverwriteBrandOption; } set { this.OverwriteBrandOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantCity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantCityOption { get; private set; } /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the city of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 13 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the city of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 13 characters. - [DataMember(Name = "subMerchantCity", EmitDefaultValue = false)] - public string SubMerchantCity { get; set; } + [JsonPropertyName("subMerchantCity")] + public string SubMerchantCity { get { return this.SubMerchantCityOption; } set { this.SubMerchantCityOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantCountry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantCountryOption { get; private set; } /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the three-letter country code of the actual merchant's address. * Format: alpha-numeric. * Fixed length: 3 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the three-letter country code of the actual merchant's address. * Format: alpha-numeric. * Fixed length: 3 characters. - [DataMember(Name = "subMerchantCountry", EmitDefaultValue = false)] - public string SubMerchantCountry { get; set; } + [JsonPropertyName("subMerchantCountry")] + public string SubMerchantCountry { get { return this.SubMerchantCountryOption; } set { this.SubMerchantCountryOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantEmailOption { get; private set; } /// /// This field is required for transactions performed by registered payment facilitators. This field contains the email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters /// /// This field is required for transactions performed by registered payment facilitators. This field contains the email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters - [DataMember(Name = "subMerchantEmail", EmitDefaultValue = false)] - public string SubMerchantEmail { get; set; } + [JsonPropertyName("subMerchantEmail")] + public string SubMerchantEmail { get { return this.SubMerchantEmailOption; } set { this.SubMerchantEmailOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantIDOption { get; private set; } /// /// This field contains an identifier of the actual merchant when a transaction is submitted via a payment facilitator. The payment facilitator must send in this unique ID. A unique identifier per submerchant that is required if the transaction is performed by a registered payment facilitator. * Format: alpha-numeric. * Fixed length: 15 characters. /// /// This field contains an identifier of the actual merchant when a transaction is submitted via a payment facilitator. The payment facilitator must send in this unique ID. A unique identifier per submerchant that is required if the transaction is performed by a registered payment facilitator. * Format: alpha-numeric. * Fixed length: 15 characters. - [DataMember(Name = "subMerchantID", EmitDefaultValue = false)] - public string SubMerchantID { get; set; } + [JsonPropertyName("subMerchantID")] + public string SubMerchantID { get { return this.SubMerchantIDOption; } set { this.SubMerchantIDOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantNameOption { get; private set; } /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the name of the actual merchant. * Format: alpha-numeric. * Maximum length: 22 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the name of the actual merchant. * Format: alpha-numeric. * Maximum length: 22 characters. - [DataMember(Name = "subMerchantName", EmitDefaultValue = false)] - public string SubMerchantName { get; set; } + [JsonPropertyName("subMerchantName")] + public string SubMerchantName { get { return this.SubMerchantNameOption; } set { this.SubMerchantNameOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantPhoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantPhoneNumberOption { get; private set; } /// /// This field is required for transactions performed by registered payment facilitators. This field contains the phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters /// /// This field is required for transactions performed by registered payment facilitators. This field contains the phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters - [DataMember(Name = "subMerchantPhoneNumber", EmitDefaultValue = false)] - public string SubMerchantPhoneNumber { get; set; } + [JsonPropertyName("subMerchantPhoneNumber")] + public string SubMerchantPhoneNumber { get { return this.SubMerchantPhoneNumberOption; } set { this.SubMerchantPhoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantPostalCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantPostalCodeOption { get; private set; } /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the postal code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 10 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the postal code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 10 characters. - [DataMember(Name = "subMerchantPostalCode", EmitDefaultValue = false)] - public string SubMerchantPostalCode { get; set; } + [JsonPropertyName("subMerchantPostalCode")] + public string SubMerchantPostalCode { get { return this.SubMerchantPostalCodeOption; } set { this.SubMerchantPostalCodeOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantState + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantStateOption { get; private set; } /// /// This field is required if the transaction is performed by a registered payment facilitator, and if applicable to the country. This field must contain the state code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 3 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator, and if applicable to the country. This field must contain the state code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 3 characters. - [DataMember(Name = "subMerchantState", EmitDefaultValue = false)] - public string SubMerchantState { get; set; } + [JsonPropertyName("subMerchantState")] + public string SubMerchantState { get { return this.SubMerchantStateOption; } set { this.SubMerchantStateOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantStreet + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantStreetOption { get; private set; } /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the street of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 60 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the street of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 60 characters. - [DataMember(Name = "subMerchantStreet", EmitDefaultValue = false)] - public string SubMerchantStreet { get; set; } + [JsonPropertyName("subMerchantStreet")] + public string SubMerchantStreet { get { return this.SubMerchantStreetOption; } set { this.SubMerchantStreetOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantTaxId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantTaxIdOption { get; private set; } /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the tax ID of the actual merchant. * Format: alpha-numeric. * Fixed length: 11 or 14 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the tax ID of the actual merchant. * Format: alpha-numeric. * Fixed length: 11 or 14 characters. - [DataMember(Name = "subMerchantTaxId", EmitDefaultValue = false)] - public string SubMerchantTaxId { get; set; } + [JsonPropertyName("subMerchantTaxId")] + public string SubMerchantTaxId { get { return this.SubMerchantTaxIdOption; } set { this.SubMerchantTaxIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -283,244 +476,357 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal + /// To validate all properties of the instance /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return this.Equals(input as AdditionalDataCommon); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataCommonJsonConverter : JsonConverter + { /// - /// Returns true if AdditionalDataCommon instances are equal + /// Deserializes json to /// - /// Instance of AdditionalDataCommon to be compared - /// Boolean - public bool Equals(AdditionalDataCommon input) + /// + /// + /// + /// + /// + public override AdditionalDataCommon Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option requestedTestAcquirerResponseCode = default; + Option requestedTestErrorResponseCode = default; + Option allowPartialAuth = default; + Option authorisationType = default; + Option autoRescue = default; + Option customRoutingFlag = default; + Option industryUsage = default; + Option manualCapture = default; + Option maxDaysToRescue = default; + Option networkTxReference = default; + Option overwriteBrand = default; + Option subMerchantCity = default; + Option subMerchantCountry = default; + Option subMerchantEmail = default; + Option subMerchantID = default; + Option subMerchantName = default; + Option subMerchantPhoneNumber = default; + Option subMerchantPostalCode = default; + Option subMerchantState = default; + Option subMerchantStreet = default; + Option subMerchantTaxId = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "RequestedTestAcquirerResponseCode": + requestedTestAcquirerResponseCode = new Option(utf8JsonReader.GetString()); + break; + case "RequestedTestErrorResponseCode": + requestedTestErrorResponseCode = new Option(utf8JsonReader.GetString()); + break; + case "allowPartialAuth": + allowPartialAuth = new Option(utf8JsonReader.GetString()); + break; + case "authorisationType": + authorisationType = new Option(utf8JsonReader.GetString()); + break; + case "autoRescue": + autoRescue = new Option(utf8JsonReader.GetString()); + break; + case "customRoutingFlag": + customRoutingFlag = new Option(utf8JsonReader.GetString()); + break; + case "industryUsage": + string industryUsageRawValue = utf8JsonReader.GetString(); + if (industryUsageRawValue != null) + industryUsage = new Option(AdditionalDataCommon.IndustryUsageEnumFromStringOrDefault(industryUsageRawValue)); + break; + case "manualCapture": + manualCapture = new Option(utf8JsonReader.GetString()); + break; + case "maxDaysToRescue": + maxDaysToRescue = new Option(utf8JsonReader.GetString()); + break; + case "networkTxReference": + networkTxReference = new Option(utf8JsonReader.GetString()); + break; + case "overwriteBrand": + overwriteBrand = new Option(utf8JsonReader.GetString()); + break; + case "subMerchantCity": + subMerchantCity = new Option(utf8JsonReader.GetString()); + break; + case "subMerchantCountry": + subMerchantCountry = new Option(utf8JsonReader.GetString()); + break; + case "subMerchantEmail": + subMerchantEmail = new Option(utf8JsonReader.GetString()); + break; + case "subMerchantID": + subMerchantID = new Option(utf8JsonReader.GetString()); + break; + case "subMerchantName": + subMerchantName = new Option(utf8JsonReader.GetString()); + break; + case "subMerchantPhoneNumber": + subMerchantPhoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "subMerchantPostalCode": + subMerchantPostalCode = new Option(utf8JsonReader.GetString()); + break; + case "subMerchantState": + subMerchantState = new Option(utf8JsonReader.GetString()); + break; + case "subMerchantStreet": + subMerchantStreet = new Option(utf8JsonReader.GetString()); + break; + case "subMerchantTaxId": + subMerchantTaxId = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.RequestedTestAcquirerResponseCode == input.RequestedTestAcquirerResponseCode || - (this.RequestedTestAcquirerResponseCode != null && - this.RequestedTestAcquirerResponseCode.Equals(input.RequestedTestAcquirerResponseCode)) - ) && - ( - this.RequestedTestErrorResponseCode == input.RequestedTestErrorResponseCode || - (this.RequestedTestErrorResponseCode != null && - this.RequestedTestErrorResponseCode.Equals(input.RequestedTestErrorResponseCode)) - ) && - ( - this.AllowPartialAuth == input.AllowPartialAuth || - (this.AllowPartialAuth != null && - this.AllowPartialAuth.Equals(input.AllowPartialAuth)) - ) && - ( - this.AuthorisationType == input.AuthorisationType || - (this.AuthorisationType != null && - this.AuthorisationType.Equals(input.AuthorisationType)) - ) && - ( - this.AutoRescue == input.AutoRescue || - (this.AutoRescue != null && - this.AutoRescue.Equals(input.AutoRescue)) - ) && - ( - this.CustomRoutingFlag == input.CustomRoutingFlag || - (this.CustomRoutingFlag != null && - this.CustomRoutingFlag.Equals(input.CustomRoutingFlag)) - ) && - ( - this.IndustryUsage == input.IndustryUsage || - this.IndustryUsage.Equals(input.IndustryUsage) - ) && - ( - this.ManualCapture == input.ManualCapture || - (this.ManualCapture != null && - this.ManualCapture.Equals(input.ManualCapture)) - ) && - ( - this.MaxDaysToRescue == input.MaxDaysToRescue || - (this.MaxDaysToRescue != null && - this.MaxDaysToRescue.Equals(input.MaxDaysToRescue)) - ) && - ( - this.NetworkTxReference == input.NetworkTxReference || - (this.NetworkTxReference != null && - this.NetworkTxReference.Equals(input.NetworkTxReference)) - ) && - ( - this.OverwriteBrand == input.OverwriteBrand || - (this.OverwriteBrand != null && - this.OverwriteBrand.Equals(input.OverwriteBrand)) - ) && - ( - this.SubMerchantCity == input.SubMerchantCity || - (this.SubMerchantCity != null && - this.SubMerchantCity.Equals(input.SubMerchantCity)) - ) && - ( - this.SubMerchantCountry == input.SubMerchantCountry || - (this.SubMerchantCountry != null && - this.SubMerchantCountry.Equals(input.SubMerchantCountry)) - ) && - ( - this.SubMerchantEmail == input.SubMerchantEmail || - (this.SubMerchantEmail != null && - this.SubMerchantEmail.Equals(input.SubMerchantEmail)) - ) && - ( - this.SubMerchantID == input.SubMerchantID || - (this.SubMerchantID != null && - this.SubMerchantID.Equals(input.SubMerchantID)) - ) && - ( - this.SubMerchantName == input.SubMerchantName || - (this.SubMerchantName != null && - this.SubMerchantName.Equals(input.SubMerchantName)) - ) && - ( - this.SubMerchantPhoneNumber == input.SubMerchantPhoneNumber || - (this.SubMerchantPhoneNumber != null && - this.SubMerchantPhoneNumber.Equals(input.SubMerchantPhoneNumber)) - ) && - ( - this.SubMerchantPostalCode == input.SubMerchantPostalCode || - (this.SubMerchantPostalCode != null && - this.SubMerchantPostalCode.Equals(input.SubMerchantPostalCode)) - ) && - ( - this.SubMerchantState == input.SubMerchantState || - (this.SubMerchantState != null && - this.SubMerchantState.Equals(input.SubMerchantState)) - ) && - ( - this.SubMerchantStreet == input.SubMerchantStreet || - (this.SubMerchantStreet != null && - this.SubMerchantStreet.Equals(input.SubMerchantStreet)) - ) && - ( - this.SubMerchantTaxId == input.SubMerchantTaxId || - (this.SubMerchantTaxId != null && - this.SubMerchantTaxId.Equals(input.SubMerchantTaxId)) - ); + + if (requestedTestAcquirerResponseCode.IsSet && requestedTestAcquirerResponseCode.Value == null) + throw new ArgumentNullException(nameof(requestedTestAcquirerResponseCode), "Property is not nullable for class AdditionalDataCommon."); + + if (requestedTestErrorResponseCode.IsSet && requestedTestErrorResponseCode.Value == null) + throw new ArgumentNullException(nameof(requestedTestErrorResponseCode), "Property is not nullable for class AdditionalDataCommon."); + + if (allowPartialAuth.IsSet && allowPartialAuth.Value == null) + throw new ArgumentNullException(nameof(allowPartialAuth), "Property is not nullable for class AdditionalDataCommon."); + + if (authorisationType.IsSet && authorisationType.Value == null) + throw new ArgumentNullException(nameof(authorisationType), "Property is not nullable for class AdditionalDataCommon."); + + if (autoRescue.IsSet && autoRescue.Value == null) + throw new ArgumentNullException(nameof(autoRescue), "Property is not nullable for class AdditionalDataCommon."); + + if (customRoutingFlag.IsSet && customRoutingFlag.Value == null) + throw new ArgumentNullException(nameof(customRoutingFlag), "Property is not nullable for class AdditionalDataCommon."); + + if (industryUsage.IsSet && industryUsage.Value == null) + throw new ArgumentNullException(nameof(industryUsage), "Property is not nullable for class AdditionalDataCommon."); + + if (manualCapture.IsSet && manualCapture.Value == null) + throw new ArgumentNullException(nameof(manualCapture), "Property is not nullable for class AdditionalDataCommon."); + + if (maxDaysToRescue.IsSet && maxDaysToRescue.Value == null) + throw new ArgumentNullException(nameof(maxDaysToRescue), "Property is not nullable for class AdditionalDataCommon."); + + if (networkTxReference.IsSet && networkTxReference.Value == null) + throw new ArgumentNullException(nameof(networkTxReference), "Property is not nullable for class AdditionalDataCommon."); + + if (overwriteBrand.IsSet && overwriteBrand.Value == null) + throw new ArgumentNullException(nameof(overwriteBrand), "Property is not nullable for class AdditionalDataCommon."); + + if (subMerchantCity.IsSet && subMerchantCity.Value == null) + throw new ArgumentNullException(nameof(subMerchantCity), "Property is not nullable for class AdditionalDataCommon."); + + if (subMerchantCountry.IsSet && subMerchantCountry.Value == null) + throw new ArgumentNullException(nameof(subMerchantCountry), "Property is not nullable for class AdditionalDataCommon."); + + if (subMerchantEmail.IsSet && subMerchantEmail.Value == null) + throw new ArgumentNullException(nameof(subMerchantEmail), "Property is not nullable for class AdditionalDataCommon."); + + if (subMerchantID.IsSet && subMerchantID.Value == null) + throw new ArgumentNullException(nameof(subMerchantID), "Property is not nullable for class AdditionalDataCommon."); + + if (subMerchantName.IsSet && subMerchantName.Value == null) + throw new ArgumentNullException(nameof(subMerchantName), "Property is not nullable for class AdditionalDataCommon."); + + if (subMerchantPhoneNumber.IsSet && subMerchantPhoneNumber.Value == null) + throw new ArgumentNullException(nameof(subMerchantPhoneNumber), "Property is not nullable for class AdditionalDataCommon."); + + if (subMerchantPostalCode.IsSet && subMerchantPostalCode.Value == null) + throw new ArgumentNullException(nameof(subMerchantPostalCode), "Property is not nullable for class AdditionalDataCommon."); + + if (subMerchantState.IsSet && subMerchantState.Value == null) + throw new ArgumentNullException(nameof(subMerchantState), "Property is not nullable for class AdditionalDataCommon."); + + if (subMerchantStreet.IsSet && subMerchantStreet.Value == null) + throw new ArgumentNullException(nameof(subMerchantStreet), "Property is not nullable for class AdditionalDataCommon."); + + if (subMerchantTaxId.IsSet && subMerchantTaxId.Value == null) + throw new ArgumentNullException(nameof(subMerchantTaxId), "Property is not nullable for class AdditionalDataCommon."); + + return new AdditionalDataCommon(requestedTestAcquirerResponseCode, requestedTestErrorResponseCode, allowPartialAuth, authorisationType, autoRescue, customRoutingFlag, industryUsage, manualCapture, maxDaysToRescue, networkTxReference, overwriteBrand, subMerchantCity, subMerchantCountry, subMerchantEmail, subMerchantID, subMerchantName, subMerchantPhoneNumber, subMerchantPostalCode, subMerchantState, subMerchantStreet, subMerchantTaxId); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataCommon additionalDataCommon, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.RequestedTestAcquirerResponseCode != null) - { - hashCode = (hashCode * 59) + this.RequestedTestAcquirerResponseCode.GetHashCode(); - } - if (this.RequestedTestErrorResponseCode != null) - { - hashCode = (hashCode * 59) + this.RequestedTestErrorResponseCode.GetHashCode(); - } - if (this.AllowPartialAuth != null) - { - hashCode = (hashCode * 59) + this.AllowPartialAuth.GetHashCode(); - } - if (this.AuthorisationType != null) - { - hashCode = (hashCode * 59) + this.AuthorisationType.GetHashCode(); - } - if (this.AutoRescue != null) - { - hashCode = (hashCode * 59) + this.AutoRescue.GetHashCode(); - } - if (this.CustomRoutingFlag != null) - { - hashCode = (hashCode * 59) + this.CustomRoutingFlag.GetHashCode(); - } - hashCode = (hashCode * 59) + this.IndustryUsage.GetHashCode(); - if (this.ManualCapture != null) - { - hashCode = (hashCode * 59) + this.ManualCapture.GetHashCode(); - } - if (this.MaxDaysToRescue != null) - { - hashCode = (hashCode * 59) + this.MaxDaysToRescue.GetHashCode(); - } - if (this.NetworkTxReference != null) - { - hashCode = (hashCode * 59) + this.NetworkTxReference.GetHashCode(); - } - if (this.OverwriteBrand != null) - { - hashCode = (hashCode * 59) + this.OverwriteBrand.GetHashCode(); - } - if (this.SubMerchantCity != null) - { - hashCode = (hashCode * 59) + this.SubMerchantCity.GetHashCode(); - } - if (this.SubMerchantCountry != null) - { - hashCode = (hashCode * 59) + this.SubMerchantCountry.GetHashCode(); - } - if (this.SubMerchantEmail != null) - { - hashCode = (hashCode * 59) + this.SubMerchantEmail.GetHashCode(); - } - if (this.SubMerchantID != null) - { - hashCode = (hashCode * 59) + this.SubMerchantID.GetHashCode(); - } - if (this.SubMerchantName != null) - { - hashCode = (hashCode * 59) + this.SubMerchantName.GetHashCode(); - } - if (this.SubMerchantPhoneNumber != null) - { - hashCode = (hashCode * 59) + this.SubMerchantPhoneNumber.GetHashCode(); - } - if (this.SubMerchantPostalCode != null) - { - hashCode = (hashCode * 59) + this.SubMerchantPostalCode.GetHashCode(); - } - if (this.SubMerchantState != null) - { - hashCode = (hashCode * 59) + this.SubMerchantState.GetHashCode(); - } - if (this.SubMerchantStreet != null) - { - hashCode = (hashCode * 59) + this.SubMerchantStreet.GetHashCode(); - } - if (this.SubMerchantTaxId != null) - { - hashCode = (hashCode * 59) + this.SubMerchantTaxId.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataCommon, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataCommon additionalDataCommon, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataCommon.RequestedTestAcquirerResponseCodeOption.IsSet && additionalDataCommon.RequestedTestAcquirerResponseCode == null) + throw new ArgumentNullException(nameof(additionalDataCommon.RequestedTestAcquirerResponseCode), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.RequestedTestErrorResponseCodeOption.IsSet && additionalDataCommon.RequestedTestErrorResponseCode == null) + throw new ArgumentNullException(nameof(additionalDataCommon.RequestedTestErrorResponseCode), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.AllowPartialAuthOption.IsSet && additionalDataCommon.AllowPartialAuth == null) + throw new ArgumentNullException(nameof(additionalDataCommon.AllowPartialAuth), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.AuthorisationTypeOption.IsSet && additionalDataCommon.AuthorisationType == null) + throw new ArgumentNullException(nameof(additionalDataCommon.AuthorisationType), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.AutoRescueOption.IsSet && additionalDataCommon.AutoRescue == null) + throw new ArgumentNullException(nameof(additionalDataCommon.AutoRescue), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.CustomRoutingFlagOption.IsSet && additionalDataCommon.CustomRoutingFlag == null) + throw new ArgumentNullException(nameof(additionalDataCommon.CustomRoutingFlag), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.ManualCaptureOption.IsSet && additionalDataCommon.ManualCapture == null) + throw new ArgumentNullException(nameof(additionalDataCommon.ManualCapture), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.MaxDaysToRescueOption.IsSet && additionalDataCommon.MaxDaysToRescue == null) + throw new ArgumentNullException(nameof(additionalDataCommon.MaxDaysToRescue), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.NetworkTxReferenceOption.IsSet && additionalDataCommon.NetworkTxReference == null) + throw new ArgumentNullException(nameof(additionalDataCommon.NetworkTxReference), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.OverwriteBrandOption.IsSet && additionalDataCommon.OverwriteBrand == null) + throw new ArgumentNullException(nameof(additionalDataCommon.OverwriteBrand), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.SubMerchantCityOption.IsSet && additionalDataCommon.SubMerchantCity == null) + throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantCity), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.SubMerchantCountryOption.IsSet && additionalDataCommon.SubMerchantCountry == null) + throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantCountry), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.SubMerchantEmailOption.IsSet && additionalDataCommon.SubMerchantEmail == null) + throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantEmail), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.SubMerchantIDOption.IsSet && additionalDataCommon.SubMerchantID == null) + throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantID), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.SubMerchantNameOption.IsSet && additionalDataCommon.SubMerchantName == null) + throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantName), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.SubMerchantPhoneNumberOption.IsSet && additionalDataCommon.SubMerchantPhoneNumber == null) + throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantPhoneNumber), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.SubMerchantPostalCodeOption.IsSet && additionalDataCommon.SubMerchantPostalCode == null) + throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantPostalCode), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.SubMerchantStateOption.IsSet && additionalDataCommon.SubMerchantState == null) + throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantState), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.SubMerchantStreetOption.IsSet && additionalDataCommon.SubMerchantStreet == null) + throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantStreet), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.SubMerchantTaxIdOption.IsSet && additionalDataCommon.SubMerchantTaxId == null) + throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantTaxId), "Property is required for class AdditionalDataCommon."); + + if (additionalDataCommon.RequestedTestAcquirerResponseCodeOption.IsSet) + writer.WriteString("RequestedTestAcquirerResponseCode", additionalDataCommon.RequestedTestAcquirerResponseCode); + + if (additionalDataCommon.RequestedTestErrorResponseCodeOption.IsSet) + writer.WriteString("RequestedTestErrorResponseCode", additionalDataCommon.RequestedTestErrorResponseCode); + + if (additionalDataCommon.AllowPartialAuthOption.IsSet) + writer.WriteString("allowPartialAuth", additionalDataCommon.AllowPartialAuth); + + if (additionalDataCommon.AuthorisationTypeOption.IsSet) + writer.WriteString("authorisationType", additionalDataCommon.AuthorisationType); + + if (additionalDataCommon.AutoRescueOption.IsSet) + writer.WriteString("autoRescue", additionalDataCommon.AutoRescue); + + if (additionalDataCommon.CustomRoutingFlagOption.IsSet) + writer.WriteString("customRoutingFlag", additionalDataCommon.CustomRoutingFlag); + + var industryUsageRawValue = AdditionalDataCommon.IndustryUsageEnumToJsonValue(additionalDataCommon.IndustryUsageOption.Value.Value); + writer.WriteString("industryUsage", industryUsageRawValue); + if (additionalDataCommon.ManualCaptureOption.IsSet) + writer.WriteString("manualCapture", additionalDataCommon.ManualCapture); + + if (additionalDataCommon.MaxDaysToRescueOption.IsSet) + writer.WriteString("maxDaysToRescue", additionalDataCommon.MaxDaysToRescue); + + if (additionalDataCommon.NetworkTxReferenceOption.IsSet) + writer.WriteString("networkTxReference", additionalDataCommon.NetworkTxReference); + + if (additionalDataCommon.OverwriteBrandOption.IsSet) + writer.WriteString("overwriteBrand", additionalDataCommon.OverwriteBrand); + + if (additionalDataCommon.SubMerchantCityOption.IsSet) + writer.WriteString("subMerchantCity", additionalDataCommon.SubMerchantCity); + + if (additionalDataCommon.SubMerchantCountryOption.IsSet) + writer.WriteString("subMerchantCountry", additionalDataCommon.SubMerchantCountry); + + if (additionalDataCommon.SubMerchantEmailOption.IsSet) + writer.WriteString("subMerchantEmail", additionalDataCommon.SubMerchantEmail); + + if (additionalDataCommon.SubMerchantIDOption.IsSet) + writer.WriteString("subMerchantID", additionalDataCommon.SubMerchantID); + + if (additionalDataCommon.SubMerchantNameOption.IsSet) + writer.WriteString("subMerchantName", additionalDataCommon.SubMerchantName); + + if (additionalDataCommon.SubMerchantPhoneNumberOption.IsSet) + writer.WriteString("subMerchantPhoneNumber", additionalDataCommon.SubMerchantPhoneNumber); + + if (additionalDataCommon.SubMerchantPostalCodeOption.IsSet) + writer.WriteString("subMerchantPostalCode", additionalDataCommon.SubMerchantPostalCode); + + if (additionalDataCommon.SubMerchantStateOption.IsSet) + writer.WriteString("subMerchantState", additionalDataCommon.SubMerchantState); + + if (additionalDataCommon.SubMerchantStreetOption.IsSet) + writer.WriteString("subMerchantStreet", additionalDataCommon.SubMerchantStreet); + + if (additionalDataCommon.SubMerchantTaxIdOption.IsSet) + writer.WriteString("subMerchantTaxId", additionalDataCommon.SubMerchantTaxId); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataLevel23.cs b/Adyen/Model/Checkout/AdditionalDataLevel23.cs index 687ceb857..a91a85835 100644 --- a/Adyen/Model/Checkout/AdditionalDataLevel23.cs +++ b/Adyen/Model/Checkout/AdditionalDataLevel23.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,182 +14,302 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataLevel23 /// - [DataContract(Name = "AdditionalDataLevel23")] - public partial class AdditionalDataLevel23 : IEquatable, IValidatableObject + public partial class AdditionalDataLevel23 : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The reference number to identify the customer and their order. * Encoding: ASCII * Max length: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - /// The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. * Encoding: ASCII * Fixed length: 3 characters. - /// The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * Must not start with a space. * For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5.. - /// The state or province code of the destination address. * Encoding: ASCII * Max length: 3 characters * Must not start with a space.. - /// The duty tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters. - /// The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters. - /// The code that identifies the item in a standardized commodity coding scheme. There are different commodity coding schemes: * [UNSPSC commodity codes](https://www.unspsc.org/) * [HS commodity codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity codes](https://www.census.gov/naics/) * [NAPCS commodity codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - /// A description of the item. * Encoding: ASCII * Max length: 26 characters * Must not be a single character. * Must not be blank. * Must not start with a space or be all spaces. * Must not be all zeros.. - /// The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters. - /// The product code. Must be a unique product code associated with the item or service. This can be your unique code for the item, or the manufacturer's product code. * Encoding: ASCII. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - /// The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces.. - /// The total amount for the line item, in [minor units](https://docs.adyen.com/development-resources/currency-codes). See [Amount requirements for level 2/3 ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) to learn more about how to calculate the line item total. * For example, 2000 means USD 20.00. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - /// The unit of measurement for an item. * Encoding: ASCII * Max length: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - /// The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros.. - /// The order date. * Format: `ddMMyy` * Encoding: ASCII * Max length: 6 characters. - /// The postal code of the address where the item is shipped from. * Encoding: ASCII * Max length: 10 characters * Must not start with a space or be all spaces. * Must not be all zeros.For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5.. - /// The amount of state or provincial [tax included in the total transaction amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros.. - public AdditionalDataLevel23(string enhancedSchemeDataCustomerReference = default(string), string enhancedSchemeDataDestinationCountryCode = default(string), string enhancedSchemeDataDestinationPostalCode = default(string), string enhancedSchemeDataDestinationStateProvinceCode = default(string), string enhancedSchemeDataDutyAmount = default(string), string enhancedSchemeDataFreightAmount = default(string), string enhancedSchemeDataItemDetailLineItemNrCommodityCode = default(string), string enhancedSchemeDataItemDetailLineItemNrDescription = default(string), string enhancedSchemeDataItemDetailLineItemNrDiscountAmount = default(string), string enhancedSchemeDataItemDetailLineItemNrProductCode = default(string), string enhancedSchemeDataItemDetailLineItemNrQuantity = default(string), string enhancedSchemeDataItemDetailLineItemNrTotalAmount = default(string), string enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = default(string), string enhancedSchemeDataItemDetailLineItemNrUnitPrice = default(string), string enhancedSchemeDataOrderDate = default(string), string enhancedSchemeDataShipFromPostalCode = default(string), string enhancedSchemeDataTotalTaxAmount = default(string)) + /// The reference number to identify the customer and their order. * Encoding: ASCII * Max length: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros. + /// The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. * Encoding: ASCII * Fixed length: 3 characters + /// The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * Must not start with a space. * For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. + /// The state or province code of the destination address. * Encoding: ASCII * Max length: 3 characters * Must not start with a space. + /// The duty tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters + /// The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters + /// The code that identifies the item in a standardized commodity coding scheme. There are different commodity coding schemes: * [UNSPSC commodity codes](https://www.unspsc.org/) * [HS commodity codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity codes](https://www.census.gov/naics/) * [NAPCS commodity codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. + /// A description of the item. * Encoding: ASCII * Max length: 26 characters * Must not be a single character. * Must not be blank. * Must not start with a space or be all spaces. * Must not be all zeros. + /// The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters + /// The product code. Must be a unique product code associated with the item or service. This can be your unique code for the item, or the manufacturer's product code. * Encoding: ASCII. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. + /// The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces. + /// The total amount for the line item, in [minor units](https://docs.adyen.com/development-resources/currency-codes). See [Amount requirements for level 2/3 ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) to learn more about how to calculate the line item total. * For example, 2000 means USD 20.00. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. + /// The unit of measurement for an item. * Encoding: ASCII * Max length: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. + /// The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. + /// The order date. * Format: `ddMMyy` * Encoding: ASCII * Max length: 6 characters + /// The postal code of the address where the item is shipped from. * Encoding: ASCII * Max length: 10 characters * Must not start with a space or be all spaces. * Must not be all zeros.For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. + /// The amount of state or provincial [tax included in the total transaction amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. + [JsonConstructor] + public AdditionalDataLevel23(Option enhancedSchemeDataCustomerReference = default, Option enhancedSchemeDataDestinationCountryCode = default, Option enhancedSchemeDataDestinationPostalCode = default, Option enhancedSchemeDataDestinationStateProvinceCode = default, Option enhancedSchemeDataDutyAmount = default, Option enhancedSchemeDataFreightAmount = default, Option enhancedSchemeDataItemDetailLineItemNrCommodityCode = default, Option enhancedSchemeDataItemDetailLineItemNrDescription = default, Option enhancedSchemeDataItemDetailLineItemNrDiscountAmount = default, Option enhancedSchemeDataItemDetailLineItemNrProductCode = default, Option enhancedSchemeDataItemDetailLineItemNrQuantity = default, Option enhancedSchemeDataItemDetailLineItemNrTotalAmount = default, Option enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = default, Option enhancedSchemeDataItemDetailLineItemNrUnitPrice = default, Option enhancedSchemeDataOrderDate = default, Option enhancedSchemeDataShipFromPostalCode = default, Option enhancedSchemeDataTotalTaxAmount = default) { - this.EnhancedSchemeDataCustomerReference = enhancedSchemeDataCustomerReference; - this.EnhancedSchemeDataDestinationCountryCode = enhancedSchemeDataDestinationCountryCode; - this.EnhancedSchemeDataDestinationPostalCode = enhancedSchemeDataDestinationPostalCode; - this.EnhancedSchemeDataDestinationStateProvinceCode = enhancedSchemeDataDestinationStateProvinceCode; - this.EnhancedSchemeDataDutyAmount = enhancedSchemeDataDutyAmount; - this.EnhancedSchemeDataFreightAmount = enhancedSchemeDataFreightAmount; - this.EnhancedSchemeDataItemDetailLineItemNrCommodityCode = enhancedSchemeDataItemDetailLineItemNrCommodityCode; - this.EnhancedSchemeDataItemDetailLineItemNrDescription = enhancedSchemeDataItemDetailLineItemNrDescription; - this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount = enhancedSchemeDataItemDetailLineItemNrDiscountAmount; - this.EnhancedSchemeDataItemDetailLineItemNrProductCode = enhancedSchemeDataItemDetailLineItemNrProductCode; - this.EnhancedSchemeDataItemDetailLineItemNrQuantity = enhancedSchemeDataItemDetailLineItemNrQuantity; - this.EnhancedSchemeDataItemDetailLineItemNrTotalAmount = enhancedSchemeDataItemDetailLineItemNrTotalAmount; - this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure; - this.EnhancedSchemeDataItemDetailLineItemNrUnitPrice = enhancedSchemeDataItemDetailLineItemNrUnitPrice; - this.EnhancedSchemeDataOrderDate = enhancedSchemeDataOrderDate; - this.EnhancedSchemeDataShipFromPostalCode = enhancedSchemeDataShipFromPostalCode; - this.EnhancedSchemeDataTotalTaxAmount = enhancedSchemeDataTotalTaxAmount; + EnhancedSchemeDataCustomerReferenceOption = enhancedSchemeDataCustomerReference; + EnhancedSchemeDataDestinationCountryCodeOption = enhancedSchemeDataDestinationCountryCode; + EnhancedSchemeDataDestinationPostalCodeOption = enhancedSchemeDataDestinationPostalCode; + EnhancedSchemeDataDestinationStateProvinceCodeOption = enhancedSchemeDataDestinationStateProvinceCode; + EnhancedSchemeDataDutyAmountOption = enhancedSchemeDataDutyAmount; + EnhancedSchemeDataFreightAmountOption = enhancedSchemeDataFreightAmount; + EnhancedSchemeDataItemDetailLineItemNrCommodityCodeOption = enhancedSchemeDataItemDetailLineItemNrCommodityCode; + EnhancedSchemeDataItemDetailLineItemNrDescriptionOption = enhancedSchemeDataItemDetailLineItemNrDescription; + EnhancedSchemeDataItemDetailLineItemNrDiscountAmountOption = enhancedSchemeDataItemDetailLineItemNrDiscountAmount; + EnhancedSchemeDataItemDetailLineItemNrProductCodeOption = enhancedSchemeDataItemDetailLineItemNrProductCode; + EnhancedSchemeDataItemDetailLineItemNrQuantityOption = enhancedSchemeDataItemDetailLineItemNrQuantity; + EnhancedSchemeDataItemDetailLineItemNrTotalAmountOption = enhancedSchemeDataItemDetailLineItemNrTotalAmount; + EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasureOption = enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure; + EnhancedSchemeDataItemDetailLineItemNrUnitPriceOption = enhancedSchemeDataItemDetailLineItemNrUnitPrice; + EnhancedSchemeDataOrderDateOption = enhancedSchemeDataOrderDate; + EnhancedSchemeDataShipFromPostalCodeOption = enhancedSchemeDataShipFromPostalCode; + EnhancedSchemeDataTotalTaxAmountOption = enhancedSchemeDataTotalTaxAmount; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of EnhancedSchemeDataCustomerReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataCustomerReferenceOption { get; private set; } + /// /// The reference number to identify the customer and their order. * Encoding: ASCII * Max length: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The reference number to identify the customer and their order. * Encoding: ASCII * Max length: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "enhancedSchemeData.customerReference", EmitDefaultValue = false)] - public string EnhancedSchemeDataCustomerReference { get; set; } + [JsonPropertyName("enhancedSchemeData.customerReference")] + public string EnhancedSchemeDataCustomerReference { get { return this.EnhancedSchemeDataCustomerReferenceOption; } set { this.EnhancedSchemeDataCustomerReferenceOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataDestinationCountryCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataDestinationCountryCodeOption { get; private set; } /// /// The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. * Encoding: ASCII * Fixed length: 3 characters /// /// The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. * Encoding: ASCII * Fixed length: 3 characters - [DataMember(Name = "enhancedSchemeData.destinationCountryCode", EmitDefaultValue = false)] - public string EnhancedSchemeDataDestinationCountryCode { get; set; } + [JsonPropertyName("enhancedSchemeData.destinationCountryCode")] + public string EnhancedSchemeDataDestinationCountryCode { get { return this.EnhancedSchemeDataDestinationCountryCodeOption; } set { this.EnhancedSchemeDataDestinationCountryCodeOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataDestinationPostalCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataDestinationPostalCodeOption { get; private set; } /// /// The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * Must not start with a space. * For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. /// /// The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * Must not start with a space. * For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. - [DataMember(Name = "enhancedSchemeData.destinationPostalCode", EmitDefaultValue = false)] - public string EnhancedSchemeDataDestinationPostalCode { get; set; } + [JsonPropertyName("enhancedSchemeData.destinationPostalCode")] + public string EnhancedSchemeDataDestinationPostalCode { get { return this.EnhancedSchemeDataDestinationPostalCodeOption; } set { this.EnhancedSchemeDataDestinationPostalCodeOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataDestinationStateProvinceCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataDestinationStateProvinceCodeOption { get; private set; } /// /// The state or province code of the destination address. * Encoding: ASCII * Max length: 3 characters * Must not start with a space. /// /// The state or province code of the destination address. * Encoding: ASCII * Max length: 3 characters * Must not start with a space. - [DataMember(Name = "enhancedSchemeData.destinationStateProvinceCode", EmitDefaultValue = false)] - public string EnhancedSchemeDataDestinationStateProvinceCode { get; set; } + [JsonPropertyName("enhancedSchemeData.destinationStateProvinceCode")] + public string EnhancedSchemeDataDestinationStateProvinceCode { get { return this.EnhancedSchemeDataDestinationStateProvinceCodeOption; } set { this.EnhancedSchemeDataDestinationStateProvinceCodeOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataDutyAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataDutyAmountOption { get; private set; } /// /// The duty tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters /// /// The duty tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters - [DataMember(Name = "enhancedSchemeData.dutyAmount", EmitDefaultValue = false)] - public string EnhancedSchemeDataDutyAmount { get; set; } + [JsonPropertyName("enhancedSchemeData.dutyAmount")] + public string EnhancedSchemeDataDutyAmount { get { return this.EnhancedSchemeDataDutyAmountOption; } set { this.EnhancedSchemeDataDutyAmountOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataFreightAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataFreightAmountOption { get; private set; } /// /// The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters /// /// The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters - [DataMember(Name = "enhancedSchemeData.freightAmount", EmitDefaultValue = false)] - public string EnhancedSchemeDataFreightAmount { get; set; } + [JsonPropertyName("enhancedSchemeData.freightAmount")] + public string EnhancedSchemeDataFreightAmount { get { return this.EnhancedSchemeDataFreightAmountOption; } set { this.EnhancedSchemeDataFreightAmountOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrCommodityCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataItemDetailLineItemNrCommodityCodeOption { get; private set; } /// /// The code that identifies the item in a standardized commodity coding scheme. There are different commodity coding schemes: * [UNSPSC commodity codes](https://www.unspsc.org/) * [HS commodity codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity codes](https://www.census.gov/naics/) * [NAPCS commodity codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The code that identifies the item in a standardized commodity coding scheme. There are different commodity coding schemes: * [UNSPSC commodity codes](https://www.unspsc.org/) * [HS commodity codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity codes](https://www.census.gov/naics/) * [NAPCS commodity codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].commodityCode", EmitDefaultValue = false)] - public string EnhancedSchemeDataItemDetailLineItemNrCommodityCode { get; set; } + [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].commodityCode")] + public string EnhancedSchemeDataItemDetailLineItemNrCommodityCode { get { return this.EnhancedSchemeDataItemDetailLineItemNrCommodityCodeOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrCommodityCodeOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrDescription + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataItemDetailLineItemNrDescriptionOption { get; private set; } /// /// A description of the item. * Encoding: ASCII * Max length: 26 characters * Must not be a single character. * Must not be blank. * Must not start with a space or be all spaces. * Must not be all zeros. /// /// A description of the item. * Encoding: ASCII * Max length: 26 characters * Must not be a single character. * Must not be blank. * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].description", EmitDefaultValue = false)] - public string EnhancedSchemeDataItemDetailLineItemNrDescription { get; set; } + [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].description")] + public string EnhancedSchemeDataItemDetailLineItemNrDescription { get { return this.EnhancedSchemeDataItemDetailLineItemNrDescriptionOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrDescriptionOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrDiscountAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataItemDetailLineItemNrDiscountAmountOption { get; private set; } /// /// The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters /// /// The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters - [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].discountAmount", EmitDefaultValue = false)] - public string EnhancedSchemeDataItemDetailLineItemNrDiscountAmount { get; set; } + [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].discountAmount")] + public string EnhancedSchemeDataItemDetailLineItemNrDiscountAmount { get { return this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmountOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmountOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrProductCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataItemDetailLineItemNrProductCodeOption { get; private set; } /// /// The product code. Must be a unique product code associated with the item or service. This can be your unique code for the item, or the manufacturer's product code. * Encoding: ASCII. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The product code. Must be a unique product code associated with the item or service. This can be your unique code for the item, or the manufacturer's product code. * Encoding: ASCII. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].productCode", EmitDefaultValue = false)] - public string EnhancedSchemeDataItemDetailLineItemNrProductCode { get; set; } + [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].productCode")] + public string EnhancedSchemeDataItemDetailLineItemNrProductCode { get { return this.EnhancedSchemeDataItemDetailLineItemNrProductCodeOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrProductCodeOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrQuantity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataItemDetailLineItemNrQuantityOption { get; private set; } /// /// The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces. /// /// The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces. - [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].quantity", EmitDefaultValue = false)] - public string EnhancedSchemeDataItemDetailLineItemNrQuantity { get; set; } + [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].quantity")] + public string EnhancedSchemeDataItemDetailLineItemNrQuantity { get { return this.EnhancedSchemeDataItemDetailLineItemNrQuantityOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrQuantityOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrTotalAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataItemDetailLineItemNrTotalAmountOption { get; private set; } /// /// The total amount for the line item, in [minor units](https://docs.adyen.com/development-resources/currency-codes). See [Amount requirements for level 2/3 ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) to learn more about how to calculate the line item total. * For example, 2000 means USD 20.00. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The total amount for the line item, in [minor units](https://docs.adyen.com/development-resources/currency-codes). See [Amount requirements for level 2/3 ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) to learn more about how to calculate the line item total. * For example, 2000 means USD 20.00. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].totalAmount", EmitDefaultValue = false)] - public string EnhancedSchemeDataItemDetailLineItemNrTotalAmount { get; set; } + [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].totalAmount")] + public string EnhancedSchemeDataItemDetailLineItemNrTotalAmount { get { return this.EnhancedSchemeDataItemDetailLineItemNrTotalAmountOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrTotalAmountOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasureOption { get; private set; } /// /// The unit of measurement for an item. * Encoding: ASCII * Max length: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The unit of measurement for an item. * Encoding: ASCII * Max length: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure", EmitDefaultValue = false)] - public string EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure { get; set; } + [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure")] + public string EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure { get { return this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasureOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasureOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrUnitPrice + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataItemDetailLineItemNrUnitPriceOption { get; private set; } /// /// The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. /// /// The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. - [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].unitPrice", EmitDefaultValue = false)] - public string EnhancedSchemeDataItemDetailLineItemNrUnitPrice { get; set; } + [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].unitPrice")] + public string EnhancedSchemeDataItemDetailLineItemNrUnitPrice { get { return this.EnhancedSchemeDataItemDetailLineItemNrUnitPriceOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrUnitPriceOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataOrderDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataOrderDateOption { get; private set; } /// /// The order date. * Format: `ddMMyy` * Encoding: ASCII * Max length: 6 characters /// /// The order date. * Format: `ddMMyy` * Encoding: ASCII * Max length: 6 characters - [DataMember(Name = "enhancedSchemeData.orderDate", EmitDefaultValue = false)] - public string EnhancedSchemeDataOrderDate { get; set; } + [JsonPropertyName("enhancedSchemeData.orderDate")] + public string EnhancedSchemeDataOrderDate { get { return this.EnhancedSchemeDataOrderDateOption; } set { this.EnhancedSchemeDataOrderDateOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataShipFromPostalCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataShipFromPostalCodeOption { get; private set; } /// /// The postal code of the address where the item is shipped from. * Encoding: ASCII * Max length: 10 characters * Must not start with a space or be all spaces. * Must not be all zeros.For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. /// /// The postal code of the address where the item is shipped from. * Encoding: ASCII * Max length: 10 characters * Must not start with a space or be all spaces. * Must not be all zeros.For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. - [DataMember(Name = "enhancedSchemeData.shipFromPostalCode", EmitDefaultValue = false)] - public string EnhancedSchemeDataShipFromPostalCode { get; set; } + [JsonPropertyName("enhancedSchemeData.shipFromPostalCode")] + public string EnhancedSchemeDataShipFromPostalCode { get { return this.EnhancedSchemeDataShipFromPostalCodeOption; } set { this.EnhancedSchemeDataShipFromPostalCodeOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataTotalTaxAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataTotalTaxAmountOption { get; private set; } /// /// The amount of state or provincial [tax included in the total transaction amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. /// /// The amount of state or provincial [tax included in the total transaction amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. - [DataMember(Name = "enhancedSchemeData.totalTaxAmount", EmitDefaultValue = false)] - public string EnhancedSchemeDataTotalTaxAmount { get; set; } + [JsonPropertyName("enhancedSchemeData.totalTaxAmount")] + public string EnhancedSchemeDataTotalTaxAmount { get { return this.EnhancedSchemeDataTotalTaxAmountOption; } set { this.EnhancedSchemeDataTotalTaxAmountOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -222,212 +341,307 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataLevel23JsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AdditionalDataLevel23 Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AdditionalDataLevel23); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AdditionalDataLevel23 instances are equal - /// - /// Instance of AdditionalDataLevel23 to be compared - /// Boolean - public bool Equals(AdditionalDataLevel23 input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option enhancedSchemeDataCustomerReference = default; + Option enhancedSchemeDataDestinationCountryCode = default; + Option enhancedSchemeDataDestinationPostalCode = default; + Option enhancedSchemeDataDestinationStateProvinceCode = default; + Option enhancedSchemeDataDutyAmount = default; + Option enhancedSchemeDataFreightAmount = default; + Option enhancedSchemeDataItemDetailLineItemNrCommodityCode = default; + Option enhancedSchemeDataItemDetailLineItemNrDescription = default; + Option enhancedSchemeDataItemDetailLineItemNrDiscountAmount = default; + Option enhancedSchemeDataItemDetailLineItemNrProductCode = default; + Option enhancedSchemeDataItemDetailLineItemNrQuantity = default; + Option enhancedSchemeDataItemDetailLineItemNrTotalAmount = default; + Option enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = default; + Option enhancedSchemeDataItemDetailLineItemNrUnitPrice = default; + Option enhancedSchemeDataOrderDate = default; + Option enhancedSchemeDataShipFromPostalCode = default; + Option enhancedSchemeDataTotalTaxAmount = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "enhancedSchemeData.customerReference": + enhancedSchemeDataCustomerReference = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.destinationCountryCode": + enhancedSchemeDataDestinationCountryCode = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.destinationPostalCode": + enhancedSchemeDataDestinationPostalCode = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.destinationStateProvinceCode": + enhancedSchemeDataDestinationStateProvinceCode = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.dutyAmount": + enhancedSchemeDataDutyAmount = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.freightAmount": + enhancedSchemeDataFreightAmount = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.itemDetailLine[itemNr].commodityCode": + enhancedSchemeDataItemDetailLineItemNrCommodityCode = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.itemDetailLine[itemNr].description": + enhancedSchemeDataItemDetailLineItemNrDescription = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.itemDetailLine[itemNr].discountAmount": + enhancedSchemeDataItemDetailLineItemNrDiscountAmount = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.itemDetailLine[itemNr].productCode": + enhancedSchemeDataItemDetailLineItemNrProductCode = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.itemDetailLine[itemNr].quantity": + enhancedSchemeDataItemDetailLineItemNrQuantity = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.itemDetailLine[itemNr].totalAmount": + enhancedSchemeDataItemDetailLineItemNrTotalAmount = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure": + enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.itemDetailLine[itemNr].unitPrice": + enhancedSchemeDataItemDetailLineItemNrUnitPrice = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.orderDate": + enhancedSchemeDataOrderDate = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.shipFromPostalCode": + enhancedSchemeDataShipFromPostalCode = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.totalTaxAmount": + enhancedSchemeDataTotalTaxAmount = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.EnhancedSchemeDataCustomerReference == input.EnhancedSchemeDataCustomerReference || - (this.EnhancedSchemeDataCustomerReference != null && - this.EnhancedSchemeDataCustomerReference.Equals(input.EnhancedSchemeDataCustomerReference)) - ) && - ( - this.EnhancedSchemeDataDestinationCountryCode == input.EnhancedSchemeDataDestinationCountryCode || - (this.EnhancedSchemeDataDestinationCountryCode != null && - this.EnhancedSchemeDataDestinationCountryCode.Equals(input.EnhancedSchemeDataDestinationCountryCode)) - ) && - ( - this.EnhancedSchemeDataDestinationPostalCode == input.EnhancedSchemeDataDestinationPostalCode || - (this.EnhancedSchemeDataDestinationPostalCode != null && - this.EnhancedSchemeDataDestinationPostalCode.Equals(input.EnhancedSchemeDataDestinationPostalCode)) - ) && - ( - this.EnhancedSchemeDataDestinationStateProvinceCode == input.EnhancedSchemeDataDestinationStateProvinceCode || - (this.EnhancedSchemeDataDestinationStateProvinceCode != null && - this.EnhancedSchemeDataDestinationStateProvinceCode.Equals(input.EnhancedSchemeDataDestinationStateProvinceCode)) - ) && - ( - this.EnhancedSchemeDataDutyAmount == input.EnhancedSchemeDataDutyAmount || - (this.EnhancedSchemeDataDutyAmount != null && - this.EnhancedSchemeDataDutyAmount.Equals(input.EnhancedSchemeDataDutyAmount)) - ) && - ( - this.EnhancedSchemeDataFreightAmount == input.EnhancedSchemeDataFreightAmount || - (this.EnhancedSchemeDataFreightAmount != null && - this.EnhancedSchemeDataFreightAmount.Equals(input.EnhancedSchemeDataFreightAmount)) - ) && - ( - this.EnhancedSchemeDataItemDetailLineItemNrCommodityCode == input.EnhancedSchemeDataItemDetailLineItemNrCommodityCode || - (this.EnhancedSchemeDataItemDetailLineItemNrCommodityCode != null && - this.EnhancedSchemeDataItemDetailLineItemNrCommodityCode.Equals(input.EnhancedSchemeDataItemDetailLineItemNrCommodityCode)) - ) && - ( - this.EnhancedSchemeDataItemDetailLineItemNrDescription == input.EnhancedSchemeDataItemDetailLineItemNrDescription || - (this.EnhancedSchemeDataItemDetailLineItemNrDescription != null && - this.EnhancedSchemeDataItemDetailLineItemNrDescription.Equals(input.EnhancedSchemeDataItemDetailLineItemNrDescription)) - ) && - ( - this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount == input.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount || - (this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount != null && - this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount.Equals(input.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount)) - ) && - ( - this.EnhancedSchemeDataItemDetailLineItemNrProductCode == input.EnhancedSchemeDataItemDetailLineItemNrProductCode || - (this.EnhancedSchemeDataItemDetailLineItemNrProductCode != null && - this.EnhancedSchemeDataItemDetailLineItemNrProductCode.Equals(input.EnhancedSchemeDataItemDetailLineItemNrProductCode)) - ) && - ( - this.EnhancedSchemeDataItemDetailLineItemNrQuantity == input.EnhancedSchemeDataItemDetailLineItemNrQuantity || - (this.EnhancedSchemeDataItemDetailLineItemNrQuantity != null && - this.EnhancedSchemeDataItemDetailLineItemNrQuantity.Equals(input.EnhancedSchemeDataItemDetailLineItemNrQuantity)) - ) && - ( - this.EnhancedSchemeDataItemDetailLineItemNrTotalAmount == input.EnhancedSchemeDataItemDetailLineItemNrTotalAmount || - (this.EnhancedSchemeDataItemDetailLineItemNrTotalAmount != null && - this.EnhancedSchemeDataItemDetailLineItemNrTotalAmount.Equals(input.EnhancedSchemeDataItemDetailLineItemNrTotalAmount)) - ) && - ( - this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure == input.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure || - (this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure != null && - this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure.Equals(input.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure)) - ) && - ( - this.EnhancedSchemeDataItemDetailLineItemNrUnitPrice == input.EnhancedSchemeDataItemDetailLineItemNrUnitPrice || - (this.EnhancedSchemeDataItemDetailLineItemNrUnitPrice != null && - this.EnhancedSchemeDataItemDetailLineItemNrUnitPrice.Equals(input.EnhancedSchemeDataItemDetailLineItemNrUnitPrice)) - ) && - ( - this.EnhancedSchemeDataOrderDate == input.EnhancedSchemeDataOrderDate || - (this.EnhancedSchemeDataOrderDate != null && - this.EnhancedSchemeDataOrderDate.Equals(input.EnhancedSchemeDataOrderDate)) - ) && - ( - this.EnhancedSchemeDataShipFromPostalCode == input.EnhancedSchemeDataShipFromPostalCode || - (this.EnhancedSchemeDataShipFromPostalCode != null && - this.EnhancedSchemeDataShipFromPostalCode.Equals(input.EnhancedSchemeDataShipFromPostalCode)) - ) && - ( - this.EnhancedSchemeDataTotalTaxAmount == input.EnhancedSchemeDataTotalTaxAmount || - (this.EnhancedSchemeDataTotalTaxAmount != null && - this.EnhancedSchemeDataTotalTaxAmount.Equals(input.EnhancedSchemeDataTotalTaxAmount)) - ); + + if (enhancedSchemeDataCustomerReference.IsSet && enhancedSchemeDataCustomerReference.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataCustomerReference), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataDestinationCountryCode.IsSet && enhancedSchemeDataDestinationCountryCode.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataDestinationCountryCode), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataDestinationPostalCode.IsSet && enhancedSchemeDataDestinationPostalCode.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataDestinationPostalCode), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataDestinationStateProvinceCode.IsSet && enhancedSchemeDataDestinationStateProvinceCode.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataDestinationStateProvinceCode), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataDutyAmount.IsSet && enhancedSchemeDataDutyAmount.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataDutyAmount), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataFreightAmount.IsSet && enhancedSchemeDataFreightAmount.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataFreightAmount), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataItemDetailLineItemNrCommodityCode.IsSet && enhancedSchemeDataItemDetailLineItemNrCommodityCode.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrCommodityCode), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataItemDetailLineItemNrDescription.IsSet && enhancedSchemeDataItemDetailLineItemNrDescription.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrDescription), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataItemDetailLineItemNrDiscountAmount.IsSet && enhancedSchemeDataItemDetailLineItemNrDiscountAmount.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrDiscountAmount), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataItemDetailLineItemNrProductCode.IsSet && enhancedSchemeDataItemDetailLineItemNrProductCode.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrProductCode), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataItemDetailLineItemNrQuantity.IsSet && enhancedSchemeDataItemDetailLineItemNrQuantity.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrQuantity), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataItemDetailLineItemNrTotalAmount.IsSet && enhancedSchemeDataItemDetailLineItemNrTotalAmount.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrTotalAmount), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure.IsSet && enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataItemDetailLineItemNrUnitPrice.IsSet && enhancedSchemeDataItemDetailLineItemNrUnitPrice.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrUnitPrice), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataOrderDate.IsSet && enhancedSchemeDataOrderDate.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataOrderDate), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataShipFromPostalCode.IsSet && enhancedSchemeDataShipFromPostalCode.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataShipFromPostalCode), "Property is not nullable for class AdditionalDataLevel23."); + + if (enhancedSchemeDataTotalTaxAmount.IsSet && enhancedSchemeDataTotalTaxAmount.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataTotalTaxAmount), "Property is not nullable for class AdditionalDataLevel23."); + + return new AdditionalDataLevel23(enhancedSchemeDataCustomerReference, enhancedSchemeDataDestinationCountryCode, enhancedSchemeDataDestinationPostalCode, enhancedSchemeDataDestinationStateProvinceCode, enhancedSchemeDataDutyAmount, enhancedSchemeDataFreightAmount, enhancedSchemeDataItemDetailLineItemNrCommodityCode, enhancedSchemeDataItemDetailLineItemNrDescription, enhancedSchemeDataItemDetailLineItemNrDiscountAmount, enhancedSchemeDataItemDetailLineItemNrProductCode, enhancedSchemeDataItemDetailLineItemNrQuantity, enhancedSchemeDataItemDetailLineItemNrTotalAmount, enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure, enhancedSchemeDataItemDetailLineItemNrUnitPrice, enhancedSchemeDataOrderDate, enhancedSchemeDataShipFromPostalCode, enhancedSchemeDataTotalTaxAmount); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataLevel23 additionalDataLevel23, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.EnhancedSchemeDataCustomerReference != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataCustomerReference.GetHashCode(); - } - if (this.EnhancedSchemeDataDestinationCountryCode != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataDestinationCountryCode.GetHashCode(); - } - if (this.EnhancedSchemeDataDestinationPostalCode != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataDestinationPostalCode.GetHashCode(); - } - if (this.EnhancedSchemeDataDestinationStateProvinceCode != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataDestinationStateProvinceCode.GetHashCode(); - } - if (this.EnhancedSchemeDataDutyAmount != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataDutyAmount.GetHashCode(); - } - if (this.EnhancedSchemeDataFreightAmount != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataFreightAmount.GetHashCode(); - } - if (this.EnhancedSchemeDataItemDetailLineItemNrCommodityCode != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrCommodityCode.GetHashCode(); - } - if (this.EnhancedSchemeDataItemDetailLineItemNrDescription != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrDescription.GetHashCode(); - } - if (this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount.GetHashCode(); - } - if (this.EnhancedSchemeDataItemDetailLineItemNrProductCode != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrProductCode.GetHashCode(); - } - if (this.EnhancedSchemeDataItemDetailLineItemNrQuantity != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrQuantity.GetHashCode(); - } - if (this.EnhancedSchemeDataItemDetailLineItemNrTotalAmount != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrTotalAmount.GetHashCode(); - } - if (this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure.GetHashCode(); - } - if (this.EnhancedSchemeDataItemDetailLineItemNrUnitPrice != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrUnitPrice.GetHashCode(); - } - if (this.EnhancedSchemeDataOrderDate != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataOrderDate.GetHashCode(); - } - if (this.EnhancedSchemeDataShipFromPostalCode != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataShipFromPostalCode.GetHashCode(); - } - if (this.EnhancedSchemeDataTotalTaxAmount != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataTotalTaxAmount.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataLevel23, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataLevel23 additionalDataLevel23, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataLevel23.EnhancedSchemeDataCustomerReferenceOption.IsSet && additionalDataLevel23.EnhancedSchemeDataCustomerReference == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataCustomerReference), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataDestinationCountryCodeOption.IsSet && additionalDataLevel23.EnhancedSchemeDataDestinationCountryCode == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataDestinationCountryCode), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataDestinationPostalCodeOption.IsSet && additionalDataLevel23.EnhancedSchemeDataDestinationPostalCode == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataDestinationPostalCode), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataDestinationStateProvinceCodeOption.IsSet && additionalDataLevel23.EnhancedSchemeDataDestinationStateProvinceCode == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataDestinationStateProvinceCode), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataDutyAmountOption.IsSet && additionalDataLevel23.EnhancedSchemeDataDutyAmount == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataDutyAmount), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataFreightAmountOption.IsSet && additionalDataLevel23.EnhancedSchemeDataFreightAmount == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataFreightAmount), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrCommodityCodeOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrCommodityCode == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrCommodityCode), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDescriptionOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDescription == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDescription), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDiscountAmountOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrProductCodeOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrProductCode == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrProductCode), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrQuantityOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrQuantity == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrQuantity), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrTotalAmountOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrTotalAmount == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrTotalAmount), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasureOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitPriceOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitPrice == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitPrice), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataOrderDateOption.IsSet && additionalDataLevel23.EnhancedSchemeDataOrderDate == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataOrderDate), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataShipFromPostalCodeOption.IsSet && additionalDataLevel23.EnhancedSchemeDataShipFromPostalCode == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataShipFromPostalCode), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataTotalTaxAmountOption.IsSet && additionalDataLevel23.EnhancedSchemeDataTotalTaxAmount == null) + throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataTotalTaxAmount), "Property is required for class AdditionalDataLevel23."); + + if (additionalDataLevel23.EnhancedSchemeDataCustomerReferenceOption.IsSet) + writer.WriteString("enhancedSchemeData.customerReference", additionalDataLevel23.EnhancedSchemeDataCustomerReference); + + if (additionalDataLevel23.EnhancedSchemeDataDestinationCountryCodeOption.IsSet) + writer.WriteString("enhancedSchemeData.destinationCountryCode", additionalDataLevel23.EnhancedSchemeDataDestinationCountryCode); + + if (additionalDataLevel23.EnhancedSchemeDataDestinationPostalCodeOption.IsSet) + writer.WriteString("enhancedSchemeData.destinationPostalCode", additionalDataLevel23.EnhancedSchemeDataDestinationPostalCode); + + if (additionalDataLevel23.EnhancedSchemeDataDestinationStateProvinceCodeOption.IsSet) + writer.WriteString("enhancedSchemeData.destinationStateProvinceCode", additionalDataLevel23.EnhancedSchemeDataDestinationStateProvinceCode); + + if (additionalDataLevel23.EnhancedSchemeDataDutyAmountOption.IsSet) + writer.WriteString("enhancedSchemeData.dutyAmount", additionalDataLevel23.EnhancedSchemeDataDutyAmount); + + if (additionalDataLevel23.EnhancedSchemeDataFreightAmountOption.IsSet) + writer.WriteString("enhancedSchemeData.freightAmount", additionalDataLevel23.EnhancedSchemeDataFreightAmount); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrCommodityCodeOption.IsSet) + writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].commodityCode", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrCommodityCode); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDescriptionOption.IsSet) + writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].description", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDescription); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDiscountAmountOption.IsSet) + writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].discountAmount", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrProductCodeOption.IsSet) + writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].productCode", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrProductCode); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrQuantityOption.IsSet) + writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].quantity", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrQuantity); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrTotalAmountOption.IsSet) + writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].totalAmount", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrTotalAmount); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasureOption.IsSet) + writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure); + + if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitPriceOption.IsSet) + writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].unitPrice", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitPrice); + + if (additionalDataLevel23.EnhancedSchemeDataOrderDateOption.IsSet) + writer.WriteString("enhancedSchemeData.orderDate", additionalDataLevel23.EnhancedSchemeDataOrderDate); + + if (additionalDataLevel23.EnhancedSchemeDataShipFromPostalCodeOption.IsSet) + writer.WriteString("enhancedSchemeData.shipFromPostalCode", additionalDataLevel23.EnhancedSchemeDataShipFromPostalCode); + + if (additionalDataLevel23.EnhancedSchemeDataTotalTaxAmountOption.IsSet) + writer.WriteString("enhancedSchemeData.totalTaxAmount", additionalDataLevel23.EnhancedSchemeDataTotalTaxAmount); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataLodging.cs b/Adyen/Model/Checkout/AdditionalDataLodging.cs index 3382ee07a..696e07b98 100644 --- a/Adyen/Model/Checkout/AdditionalDataLodging.cs +++ b/Adyen/Model/Checkout/AdditionalDataLodging.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,182 +14,302 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataLodging /// - [DataContract(Name = "AdditionalDataLodging")] - public partial class AdditionalDataLodging : IEquatable, IValidatableObject + public partial class AdditionalDataLodging : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// A code that corresponds to the category of lodging charges for the payment. Possible values: * 1: Lodging * 2: No show reservation * 3: Advanced deposit. - /// The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**.. - /// The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**.. - /// The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros.. - /// Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character. - /// The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters. - /// The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters * Must not start with a space * Must not contain any special characters * Must not be all zeros.. - /// Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters. - /// Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in. - /// The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters. - /// The lodging property location's phone number. * Format: numeric * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros.. - /// The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters. - /// The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number. - /// The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number. - /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number. - /// The number of nights. This should be included in the auth message. * Format: numeric * Max length: 4 characters. - /// Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character. - public AdditionalDataLodging(string lodgingSpecialProgramCode = default(string), string lodgingCheckInDate = default(string), string lodgingCheckOutDate = default(string), string lodgingCustomerServiceTollFreeNumber = default(string), string lodgingFireSafetyActIndicator = default(string), string lodgingFolioCashAdvances = default(string), string lodgingFolioNumber = default(string), string lodgingFoodBeverageCharges = default(string), string lodgingNoShowIndicator = default(string), string lodgingPrepaidExpenses = default(string), string lodgingPropertyPhoneNumber = default(string), string lodgingRoom1NumberOfNights = default(string), string lodgingRoom1Rate = default(string), string lodgingTotalRoomTax = default(string), string lodgingTotalTax = default(string), string travelEntertainmentAuthDataDuration = default(string), string travelEntertainmentAuthDataMarket = default(string)) + /// A code that corresponds to the category of lodging charges for the payment. Possible values: * 1: Lodging * 2: No show reservation * 3: Advanced deposit + /// The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. + /// The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. + /// The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros. + /// Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character + /// The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters + /// The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters * Must not start with a space * Must not contain any special characters * Must not be all zeros. + /// Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters + /// Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in + /// The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters + /// The lodging property location's phone number. * Format: numeric * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros. + /// The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters + /// The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number + /// The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number + /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number + /// The number of nights. This should be included in the auth message. * Format: numeric * Max length: 4 characters + /// Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character + [JsonConstructor] + public AdditionalDataLodging(Option lodgingSpecialProgramCode = default, Option lodgingCheckInDate = default, Option lodgingCheckOutDate = default, Option lodgingCustomerServiceTollFreeNumber = default, Option lodgingFireSafetyActIndicator = default, Option lodgingFolioCashAdvances = default, Option lodgingFolioNumber = default, Option lodgingFoodBeverageCharges = default, Option lodgingNoShowIndicator = default, Option lodgingPrepaidExpenses = default, Option lodgingPropertyPhoneNumber = default, Option lodgingRoom1NumberOfNights = default, Option lodgingRoom1Rate = default, Option lodgingTotalRoomTax = default, Option lodgingTotalTax = default, Option travelEntertainmentAuthDataDuration = default, Option travelEntertainmentAuthDataMarket = default) { - this.LodgingSpecialProgramCode = lodgingSpecialProgramCode; - this.LodgingCheckInDate = lodgingCheckInDate; - this.LodgingCheckOutDate = lodgingCheckOutDate; - this.LodgingCustomerServiceTollFreeNumber = lodgingCustomerServiceTollFreeNumber; - this.LodgingFireSafetyActIndicator = lodgingFireSafetyActIndicator; - this.LodgingFolioCashAdvances = lodgingFolioCashAdvances; - this.LodgingFolioNumber = lodgingFolioNumber; - this.LodgingFoodBeverageCharges = lodgingFoodBeverageCharges; - this.LodgingNoShowIndicator = lodgingNoShowIndicator; - this.LodgingPrepaidExpenses = lodgingPrepaidExpenses; - this.LodgingPropertyPhoneNumber = lodgingPropertyPhoneNumber; - this.LodgingRoom1NumberOfNights = lodgingRoom1NumberOfNights; - this.LodgingRoom1Rate = lodgingRoom1Rate; - this.LodgingTotalRoomTax = lodgingTotalRoomTax; - this.LodgingTotalTax = lodgingTotalTax; - this.TravelEntertainmentAuthDataDuration = travelEntertainmentAuthDataDuration; - this.TravelEntertainmentAuthDataMarket = travelEntertainmentAuthDataMarket; + LodgingSpecialProgramCodeOption = lodgingSpecialProgramCode; + LodgingCheckInDateOption = lodgingCheckInDate; + LodgingCheckOutDateOption = lodgingCheckOutDate; + LodgingCustomerServiceTollFreeNumberOption = lodgingCustomerServiceTollFreeNumber; + LodgingFireSafetyActIndicatorOption = lodgingFireSafetyActIndicator; + LodgingFolioCashAdvancesOption = lodgingFolioCashAdvances; + LodgingFolioNumberOption = lodgingFolioNumber; + LodgingFoodBeverageChargesOption = lodgingFoodBeverageCharges; + LodgingNoShowIndicatorOption = lodgingNoShowIndicator; + LodgingPrepaidExpensesOption = lodgingPrepaidExpenses; + LodgingPropertyPhoneNumberOption = lodgingPropertyPhoneNumber; + LodgingRoom1NumberOfNightsOption = lodgingRoom1NumberOfNights; + LodgingRoom1RateOption = lodgingRoom1Rate; + LodgingTotalRoomTaxOption = lodgingTotalRoomTax; + LodgingTotalTaxOption = lodgingTotalTax; + TravelEntertainmentAuthDataDurationOption = travelEntertainmentAuthDataDuration; + TravelEntertainmentAuthDataMarketOption = travelEntertainmentAuthDataMarket; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of LodgingSpecialProgramCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingSpecialProgramCodeOption { get; private set; } + /// /// A code that corresponds to the category of lodging charges for the payment. Possible values: * 1: Lodging * 2: No show reservation * 3: Advanced deposit /// /// A code that corresponds to the category of lodging charges for the payment. Possible values: * 1: Lodging * 2: No show reservation * 3: Advanced deposit - [DataMember(Name = "lodging.SpecialProgramCode", EmitDefaultValue = false)] - public string LodgingSpecialProgramCode { get; set; } + [JsonPropertyName("lodging.SpecialProgramCode")] + public string LodgingSpecialProgramCode { get { return this.LodgingSpecialProgramCodeOption; } set { this.LodgingSpecialProgramCodeOption = new Option(value); } } + + /// + /// Used to track the state of LodgingCheckInDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingCheckInDateOption { get; private set; } /// /// The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. /// /// The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. - [DataMember(Name = "lodging.checkInDate", EmitDefaultValue = false)] - public string LodgingCheckInDate { get; set; } + [JsonPropertyName("lodging.checkInDate")] + public string LodgingCheckInDate { get { return this.LodgingCheckInDateOption; } set { this.LodgingCheckInDateOption = new Option(value); } } + + /// + /// Used to track the state of LodgingCheckOutDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingCheckOutDateOption { get; private set; } /// /// The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. /// /// The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. - [DataMember(Name = "lodging.checkOutDate", EmitDefaultValue = false)] - public string LodgingCheckOutDate { get; set; } + [JsonPropertyName("lodging.checkOutDate")] + public string LodgingCheckOutDate { get { return this.LodgingCheckOutDateOption; } set { this.LodgingCheckOutDateOption = new Option(value); } } + + /// + /// Used to track the state of LodgingCustomerServiceTollFreeNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingCustomerServiceTollFreeNumberOption { get; private set; } /// /// The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros. /// /// The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros. - [DataMember(Name = "lodging.customerServiceTollFreeNumber", EmitDefaultValue = false)] - public string LodgingCustomerServiceTollFreeNumber { get; set; } + [JsonPropertyName("lodging.customerServiceTollFreeNumber")] + public string LodgingCustomerServiceTollFreeNumber { get { return this.LodgingCustomerServiceTollFreeNumberOption; } set { this.LodgingCustomerServiceTollFreeNumberOption = new Option(value); } } + + /// + /// Used to track the state of LodgingFireSafetyActIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingFireSafetyActIndicatorOption { get; private set; } /// /// Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character /// /// Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character - [DataMember(Name = "lodging.fireSafetyActIndicator", EmitDefaultValue = false)] - public string LodgingFireSafetyActIndicator { get; set; } + [JsonPropertyName("lodging.fireSafetyActIndicator")] + public string LodgingFireSafetyActIndicator { get { return this.LodgingFireSafetyActIndicatorOption; } set { this.LodgingFireSafetyActIndicatorOption = new Option(value); } } + + /// + /// Used to track the state of LodgingFolioCashAdvances + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingFolioCashAdvancesOption { get; private set; } /// /// The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters /// /// The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters - [DataMember(Name = "lodging.folioCashAdvances", EmitDefaultValue = false)] - public string LodgingFolioCashAdvances { get; set; } + [JsonPropertyName("lodging.folioCashAdvances")] + public string LodgingFolioCashAdvances { get { return this.LodgingFolioCashAdvancesOption; } set { this.LodgingFolioCashAdvancesOption = new Option(value); } } + + /// + /// Used to track the state of LodgingFolioNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingFolioNumberOption { get; private set; } /// /// The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters * Must not start with a space * Must not contain any special characters * Must not be all zeros. /// /// The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters * Must not start with a space * Must not contain any special characters * Must not be all zeros. - [DataMember(Name = "lodging.folioNumber", EmitDefaultValue = false)] - public string LodgingFolioNumber { get; set; } + [JsonPropertyName("lodging.folioNumber")] + public string LodgingFolioNumber { get { return this.LodgingFolioNumberOption; } set { this.LodgingFolioNumberOption = new Option(value); } } + + /// + /// Used to track the state of LodgingFoodBeverageCharges + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingFoodBeverageChargesOption { get; private set; } /// /// Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters /// /// Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters - [DataMember(Name = "lodging.foodBeverageCharges", EmitDefaultValue = false)] - public string LodgingFoodBeverageCharges { get; set; } + [JsonPropertyName("lodging.foodBeverageCharges")] + public string LodgingFoodBeverageCharges { get { return this.LodgingFoodBeverageChargesOption; } set { this.LodgingFoodBeverageChargesOption = new Option(value); } } + + /// + /// Used to track the state of LodgingNoShowIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingNoShowIndicatorOption { get; private set; } /// /// Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in /// /// Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in - [DataMember(Name = "lodging.noShowIndicator", EmitDefaultValue = false)] - public string LodgingNoShowIndicator { get; set; } + [JsonPropertyName("lodging.noShowIndicator")] + public string LodgingNoShowIndicator { get { return this.LodgingNoShowIndicatorOption; } set { this.LodgingNoShowIndicatorOption = new Option(value); } } + + /// + /// Used to track the state of LodgingPrepaidExpenses + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingPrepaidExpensesOption { get; private set; } /// /// The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters /// /// The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters - [DataMember(Name = "lodging.prepaidExpenses", EmitDefaultValue = false)] - public string LodgingPrepaidExpenses { get; set; } + [JsonPropertyName("lodging.prepaidExpenses")] + public string LodgingPrepaidExpenses { get { return this.LodgingPrepaidExpensesOption; } set { this.LodgingPrepaidExpensesOption = new Option(value); } } + + /// + /// Used to track the state of LodgingPropertyPhoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingPropertyPhoneNumberOption { get; private set; } /// /// The lodging property location's phone number. * Format: numeric * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros. /// /// The lodging property location's phone number. * Format: numeric * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros. - [DataMember(Name = "lodging.propertyPhoneNumber", EmitDefaultValue = false)] - public string LodgingPropertyPhoneNumber { get; set; } + [JsonPropertyName("lodging.propertyPhoneNumber")] + public string LodgingPropertyPhoneNumber { get { return this.LodgingPropertyPhoneNumberOption; } set { this.LodgingPropertyPhoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of LodgingRoom1NumberOfNights + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingRoom1NumberOfNightsOption { get; private set; } /// /// The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters /// /// The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters - [DataMember(Name = "lodging.room1.numberOfNights", EmitDefaultValue = false)] - public string LodgingRoom1NumberOfNights { get; set; } + [JsonPropertyName("lodging.room1.numberOfNights")] + public string LodgingRoom1NumberOfNights { get { return this.LodgingRoom1NumberOfNightsOption; } set { this.LodgingRoom1NumberOfNightsOption = new Option(value); } } + + /// + /// Used to track the state of LodgingRoom1Rate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingRoom1RateOption { get; private set; } /// /// The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number /// /// The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number - [DataMember(Name = "lodging.room1.rate", EmitDefaultValue = false)] - public string LodgingRoom1Rate { get; set; } + [JsonPropertyName("lodging.room1.rate")] + public string LodgingRoom1Rate { get { return this.LodgingRoom1RateOption; } set { this.LodgingRoom1RateOption = new Option(value); } } + + /// + /// Used to track the state of LodgingTotalRoomTax + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingTotalRoomTaxOption { get; private set; } /// /// The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number /// /// The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number - [DataMember(Name = "lodging.totalRoomTax", EmitDefaultValue = false)] - public string LodgingTotalRoomTax { get; set; } + [JsonPropertyName("lodging.totalRoomTax")] + public string LodgingTotalRoomTax { get { return this.LodgingTotalRoomTaxOption; } set { this.LodgingTotalRoomTaxOption = new Option(value); } } + + /// + /// Used to track the state of LodgingTotalTax + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LodgingTotalTaxOption { get; private set; } /// /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number /// /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number - [DataMember(Name = "lodging.totalTax", EmitDefaultValue = false)] - public string LodgingTotalTax { get; set; } + [JsonPropertyName("lodging.totalTax")] + public string LodgingTotalTax { get { return this.LodgingTotalTaxOption; } set { this.LodgingTotalTaxOption = new Option(value); } } + + /// + /// Used to track the state of TravelEntertainmentAuthDataDuration + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TravelEntertainmentAuthDataDurationOption { get; private set; } /// /// The number of nights. This should be included in the auth message. * Format: numeric * Max length: 4 characters /// /// The number of nights. This should be included in the auth message. * Format: numeric * Max length: 4 characters - [DataMember(Name = "travelEntertainmentAuthData.duration", EmitDefaultValue = false)] - public string TravelEntertainmentAuthDataDuration { get; set; } + [JsonPropertyName("travelEntertainmentAuthData.duration")] + public string TravelEntertainmentAuthDataDuration { get { return this.TravelEntertainmentAuthDataDurationOption; } set { this.TravelEntertainmentAuthDataDurationOption = new Option(value); } } + + /// + /// Used to track the state of TravelEntertainmentAuthDataMarket + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TravelEntertainmentAuthDataMarketOption { get; private set; } /// /// Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character /// /// Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character - [DataMember(Name = "travelEntertainmentAuthData.market", EmitDefaultValue = false)] - public string TravelEntertainmentAuthDataMarket { get; set; } + [JsonPropertyName("travelEntertainmentAuthData.market")] + public string TravelEntertainmentAuthDataMarket { get { return this.TravelEntertainmentAuthDataMarketOption; } set { this.TravelEntertainmentAuthDataMarketOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -222,212 +341,307 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataLodgingJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AdditionalDataLodging Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AdditionalDataLodging); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AdditionalDataLodging instances are equal - /// - /// Instance of AdditionalDataLodging to be compared - /// Boolean - public bool Equals(AdditionalDataLodging input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option lodgingSpecialProgramCode = default; + Option lodgingCheckInDate = default; + Option lodgingCheckOutDate = default; + Option lodgingCustomerServiceTollFreeNumber = default; + Option lodgingFireSafetyActIndicator = default; + Option lodgingFolioCashAdvances = default; + Option lodgingFolioNumber = default; + Option lodgingFoodBeverageCharges = default; + Option lodgingNoShowIndicator = default; + Option lodgingPrepaidExpenses = default; + Option lodgingPropertyPhoneNumber = default; + Option lodgingRoom1NumberOfNights = default; + Option lodgingRoom1Rate = default; + Option lodgingTotalRoomTax = default; + Option lodgingTotalTax = default; + Option travelEntertainmentAuthDataDuration = default; + Option travelEntertainmentAuthDataMarket = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "lodging.SpecialProgramCode": + lodgingSpecialProgramCode = new Option(utf8JsonReader.GetString()); + break; + case "lodging.checkInDate": + lodgingCheckInDate = new Option(utf8JsonReader.GetString()); + break; + case "lodging.checkOutDate": + lodgingCheckOutDate = new Option(utf8JsonReader.GetString()); + break; + case "lodging.customerServiceTollFreeNumber": + lodgingCustomerServiceTollFreeNumber = new Option(utf8JsonReader.GetString()); + break; + case "lodging.fireSafetyActIndicator": + lodgingFireSafetyActIndicator = new Option(utf8JsonReader.GetString()); + break; + case "lodging.folioCashAdvances": + lodgingFolioCashAdvances = new Option(utf8JsonReader.GetString()); + break; + case "lodging.folioNumber": + lodgingFolioNumber = new Option(utf8JsonReader.GetString()); + break; + case "lodging.foodBeverageCharges": + lodgingFoodBeverageCharges = new Option(utf8JsonReader.GetString()); + break; + case "lodging.noShowIndicator": + lodgingNoShowIndicator = new Option(utf8JsonReader.GetString()); + break; + case "lodging.prepaidExpenses": + lodgingPrepaidExpenses = new Option(utf8JsonReader.GetString()); + break; + case "lodging.propertyPhoneNumber": + lodgingPropertyPhoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "lodging.room1.numberOfNights": + lodgingRoom1NumberOfNights = new Option(utf8JsonReader.GetString()); + break; + case "lodging.room1.rate": + lodgingRoom1Rate = new Option(utf8JsonReader.GetString()); + break; + case "lodging.totalRoomTax": + lodgingTotalRoomTax = new Option(utf8JsonReader.GetString()); + break; + case "lodging.totalTax": + lodgingTotalTax = new Option(utf8JsonReader.GetString()); + break; + case "travelEntertainmentAuthData.duration": + travelEntertainmentAuthDataDuration = new Option(utf8JsonReader.GetString()); + break; + case "travelEntertainmentAuthData.market": + travelEntertainmentAuthDataMarket = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.LodgingSpecialProgramCode == input.LodgingSpecialProgramCode || - (this.LodgingSpecialProgramCode != null && - this.LodgingSpecialProgramCode.Equals(input.LodgingSpecialProgramCode)) - ) && - ( - this.LodgingCheckInDate == input.LodgingCheckInDate || - (this.LodgingCheckInDate != null && - this.LodgingCheckInDate.Equals(input.LodgingCheckInDate)) - ) && - ( - this.LodgingCheckOutDate == input.LodgingCheckOutDate || - (this.LodgingCheckOutDate != null && - this.LodgingCheckOutDate.Equals(input.LodgingCheckOutDate)) - ) && - ( - this.LodgingCustomerServiceTollFreeNumber == input.LodgingCustomerServiceTollFreeNumber || - (this.LodgingCustomerServiceTollFreeNumber != null && - this.LodgingCustomerServiceTollFreeNumber.Equals(input.LodgingCustomerServiceTollFreeNumber)) - ) && - ( - this.LodgingFireSafetyActIndicator == input.LodgingFireSafetyActIndicator || - (this.LodgingFireSafetyActIndicator != null && - this.LodgingFireSafetyActIndicator.Equals(input.LodgingFireSafetyActIndicator)) - ) && - ( - this.LodgingFolioCashAdvances == input.LodgingFolioCashAdvances || - (this.LodgingFolioCashAdvances != null && - this.LodgingFolioCashAdvances.Equals(input.LodgingFolioCashAdvances)) - ) && - ( - this.LodgingFolioNumber == input.LodgingFolioNumber || - (this.LodgingFolioNumber != null && - this.LodgingFolioNumber.Equals(input.LodgingFolioNumber)) - ) && - ( - this.LodgingFoodBeverageCharges == input.LodgingFoodBeverageCharges || - (this.LodgingFoodBeverageCharges != null && - this.LodgingFoodBeverageCharges.Equals(input.LodgingFoodBeverageCharges)) - ) && - ( - this.LodgingNoShowIndicator == input.LodgingNoShowIndicator || - (this.LodgingNoShowIndicator != null && - this.LodgingNoShowIndicator.Equals(input.LodgingNoShowIndicator)) - ) && - ( - this.LodgingPrepaidExpenses == input.LodgingPrepaidExpenses || - (this.LodgingPrepaidExpenses != null && - this.LodgingPrepaidExpenses.Equals(input.LodgingPrepaidExpenses)) - ) && - ( - this.LodgingPropertyPhoneNumber == input.LodgingPropertyPhoneNumber || - (this.LodgingPropertyPhoneNumber != null && - this.LodgingPropertyPhoneNumber.Equals(input.LodgingPropertyPhoneNumber)) - ) && - ( - this.LodgingRoom1NumberOfNights == input.LodgingRoom1NumberOfNights || - (this.LodgingRoom1NumberOfNights != null && - this.LodgingRoom1NumberOfNights.Equals(input.LodgingRoom1NumberOfNights)) - ) && - ( - this.LodgingRoom1Rate == input.LodgingRoom1Rate || - (this.LodgingRoom1Rate != null && - this.LodgingRoom1Rate.Equals(input.LodgingRoom1Rate)) - ) && - ( - this.LodgingTotalRoomTax == input.LodgingTotalRoomTax || - (this.LodgingTotalRoomTax != null && - this.LodgingTotalRoomTax.Equals(input.LodgingTotalRoomTax)) - ) && - ( - this.LodgingTotalTax == input.LodgingTotalTax || - (this.LodgingTotalTax != null && - this.LodgingTotalTax.Equals(input.LodgingTotalTax)) - ) && - ( - this.TravelEntertainmentAuthDataDuration == input.TravelEntertainmentAuthDataDuration || - (this.TravelEntertainmentAuthDataDuration != null && - this.TravelEntertainmentAuthDataDuration.Equals(input.TravelEntertainmentAuthDataDuration)) - ) && - ( - this.TravelEntertainmentAuthDataMarket == input.TravelEntertainmentAuthDataMarket || - (this.TravelEntertainmentAuthDataMarket != null && - this.TravelEntertainmentAuthDataMarket.Equals(input.TravelEntertainmentAuthDataMarket)) - ); + + if (lodgingSpecialProgramCode.IsSet && lodgingSpecialProgramCode.Value == null) + throw new ArgumentNullException(nameof(lodgingSpecialProgramCode), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingCheckInDate.IsSet && lodgingCheckInDate.Value == null) + throw new ArgumentNullException(nameof(lodgingCheckInDate), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingCheckOutDate.IsSet && lodgingCheckOutDate.Value == null) + throw new ArgumentNullException(nameof(lodgingCheckOutDate), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingCustomerServiceTollFreeNumber.IsSet && lodgingCustomerServiceTollFreeNumber.Value == null) + throw new ArgumentNullException(nameof(lodgingCustomerServiceTollFreeNumber), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingFireSafetyActIndicator.IsSet && lodgingFireSafetyActIndicator.Value == null) + throw new ArgumentNullException(nameof(lodgingFireSafetyActIndicator), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingFolioCashAdvances.IsSet && lodgingFolioCashAdvances.Value == null) + throw new ArgumentNullException(nameof(lodgingFolioCashAdvances), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingFolioNumber.IsSet && lodgingFolioNumber.Value == null) + throw new ArgumentNullException(nameof(lodgingFolioNumber), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingFoodBeverageCharges.IsSet && lodgingFoodBeverageCharges.Value == null) + throw new ArgumentNullException(nameof(lodgingFoodBeverageCharges), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingNoShowIndicator.IsSet && lodgingNoShowIndicator.Value == null) + throw new ArgumentNullException(nameof(lodgingNoShowIndicator), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingPrepaidExpenses.IsSet && lodgingPrepaidExpenses.Value == null) + throw new ArgumentNullException(nameof(lodgingPrepaidExpenses), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingPropertyPhoneNumber.IsSet && lodgingPropertyPhoneNumber.Value == null) + throw new ArgumentNullException(nameof(lodgingPropertyPhoneNumber), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingRoom1NumberOfNights.IsSet && lodgingRoom1NumberOfNights.Value == null) + throw new ArgumentNullException(nameof(lodgingRoom1NumberOfNights), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingRoom1Rate.IsSet && lodgingRoom1Rate.Value == null) + throw new ArgumentNullException(nameof(lodgingRoom1Rate), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingTotalRoomTax.IsSet && lodgingTotalRoomTax.Value == null) + throw new ArgumentNullException(nameof(lodgingTotalRoomTax), "Property is not nullable for class AdditionalDataLodging."); + + if (lodgingTotalTax.IsSet && lodgingTotalTax.Value == null) + throw new ArgumentNullException(nameof(lodgingTotalTax), "Property is not nullable for class AdditionalDataLodging."); + + if (travelEntertainmentAuthDataDuration.IsSet && travelEntertainmentAuthDataDuration.Value == null) + throw new ArgumentNullException(nameof(travelEntertainmentAuthDataDuration), "Property is not nullable for class AdditionalDataLodging."); + + if (travelEntertainmentAuthDataMarket.IsSet && travelEntertainmentAuthDataMarket.Value == null) + throw new ArgumentNullException(nameof(travelEntertainmentAuthDataMarket), "Property is not nullable for class AdditionalDataLodging."); + + return new AdditionalDataLodging(lodgingSpecialProgramCode, lodgingCheckInDate, lodgingCheckOutDate, lodgingCustomerServiceTollFreeNumber, lodgingFireSafetyActIndicator, lodgingFolioCashAdvances, lodgingFolioNumber, lodgingFoodBeverageCharges, lodgingNoShowIndicator, lodgingPrepaidExpenses, lodgingPropertyPhoneNumber, lodgingRoom1NumberOfNights, lodgingRoom1Rate, lodgingTotalRoomTax, lodgingTotalTax, travelEntertainmentAuthDataDuration, travelEntertainmentAuthDataMarket); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataLodging additionalDataLodging, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.LodgingSpecialProgramCode != null) - { - hashCode = (hashCode * 59) + this.LodgingSpecialProgramCode.GetHashCode(); - } - if (this.LodgingCheckInDate != null) - { - hashCode = (hashCode * 59) + this.LodgingCheckInDate.GetHashCode(); - } - if (this.LodgingCheckOutDate != null) - { - hashCode = (hashCode * 59) + this.LodgingCheckOutDate.GetHashCode(); - } - if (this.LodgingCustomerServiceTollFreeNumber != null) - { - hashCode = (hashCode * 59) + this.LodgingCustomerServiceTollFreeNumber.GetHashCode(); - } - if (this.LodgingFireSafetyActIndicator != null) - { - hashCode = (hashCode * 59) + this.LodgingFireSafetyActIndicator.GetHashCode(); - } - if (this.LodgingFolioCashAdvances != null) - { - hashCode = (hashCode * 59) + this.LodgingFolioCashAdvances.GetHashCode(); - } - if (this.LodgingFolioNumber != null) - { - hashCode = (hashCode * 59) + this.LodgingFolioNumber.GetHashCode(); - } - if (this.LodgingFoodBeverageCharges != null) - { - hashCode = (hashCode * 59) + this.LodgingFoodBeverageCharges.GetHashCode(); - } - if (this.LodgingNoShowIndicator != null) - { - hashCode = (hashCode * 59) + this.LodgingNoShowIndicator.GetHashCode(); - } - if (this.LodgingPrepaidExpenses != null) - { - hashCode = (hashCode * 59) + this.LodgingPrepaidExpenses.GetHashCode(); - } - if (this.LodgingPropertyPhoneNumber != null) - { - hashCode = (hashCode * 59) + this.LodgingPropertyPhoneNumber.GetHashCode(); - } - if (this.LodgingRoom1NumberOfNights != null) - { - hashCode = (hashCode * 59) + this.LodgingRoom1NumberOfNights.GetHashCode(); - } - if (this.LodgingRoom1Rate != null) - { - hashCode = (hashCode * 59) + this.LodgingRoom1Rate.GetHashCode(); - } - if (this.LodgingTotalRoomTax != null) - { - hashCode = (hashCode * 59) + this.LodgingTotalRoomTax.GetHashCode(); - } - if (this.LodgingTotalTax != null) - { - hashCode = (hashCode * 59) + this.LodgingTotalTax.GetHashCode(); - } - if (this.TravelEntertainmentAuthDataDuration != null) - { - hashCode = (hashCode * 59) + this.TravelEntertainmentAuthDataDuration.GetHashCode(); - } - if (this.TravelEntertainmentAuthDataMarket != null) - { - hashCode = (hashCode * 59) + this.TravelEntertainmentAuthDataMarket.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataLodging, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataLodging additionalDataLodging, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataLodging.LodgingSpecialProgramCodeOption.IsSet && additionalDataLodging.LodgingSpecialProgramCode == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingSpecialProgramCode), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingCheckInDateOption.IsSet && additionalDataLodging.LodgingCheckInDate == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingCheckInDate), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingCheckOutDateOption.IsSet && additionalDataLodging.LodgingCheckOutDate == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingCheckOutDate), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingCustomerServiceTollFreeNumberOption.IsSet && additionalDataLodging.LodgingCustomerServiceTollFreeNumber == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingCustomerServiceTollFreeNumber), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingFireSafetyActIndicatorOption.IsSet && additionalDataLodging.LodgingFireSafetyActIndicator == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingFireSafetyActIndicator), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingFolioCashAdvancesOption.IsSet && additionalDataLodging.LodgingFolioCashAdvances == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingFolioCashAdvances), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingFolioNumberOption.IsSet && additionalDataLodging.LodgingFolioNumber == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingFolioNumber), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingFoodBeverageChargesOption.IsSet && additionalDataLodging.LodgingFoodBeverageCharges == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingFoodBeverageCharges), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingNoShowIndicatorOption.IsSet && additionalDataLodging.LodgingNoShowIndicator == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingNoShowIndicator), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingPrepaidExpensesOption.IsSet && additionalDataLodging.LodgingPrepaidExpenses == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingPrepaidExpenses), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingPropertyPhoneNumberOption.IsSet && additionalDataLodging.LodgingPropertyPhoneNumber == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingPropertyPhoneNumber), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingRoom1NumberOfNightsOption.IsSet && additionalDataLodging.LodgingRoom1NumberOfNights == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingRoom1NumberOfNights), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingRoom1RateOption.IsSet && additionalDataLodging.LodgingRoom1Rate == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingRoom1Rate), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingTotalRoomTaxOption.IsSet && additionalDataLodging.LodgingTotalRoomTax == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingTotalRoomTax), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingTotalTaxOption.IsSet && additionalDataLodging.LodgingTotalTax == null) + throw new ArgumentNullException(nameof(additionalDataLodging.LodgingTotalTax), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.TravelEntertainmentAuthDataDurationOption.IsSet && additionalDataLodging.TravelEntertainmentAuthDataDuration == null) + throw new ArgumentNullException(nameof(additionalDataLodging.TravelEntertainmentAuthDataDuration), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.TravelEntertainmentAuthDataMarketOption.IsSet && additionalDataLodging.TravelEntertainmentAuthDataMarket == null) + throw new ArgumentNullException(nameof(additionalDataLodging.TravelEntertainmentAuthDataMarket), "Property is required for class AdditionalDataLodging."); + + if (additionalDataLodging.LodgingSpecialProgramCodeOption.IsSet) + writer.WriteString("lodging.SpecialProgramCode", additionalDataLodging.LodgingSpecialProgramCode); + + if (additionalDataLodging.LodgingCheckInDateOption.IsSet) + writer.WriteString("lodging.checkInDate", additionalDataLodging.LodgingCheckInDate); + + if (additionalDataLodging.LodgingCheckOutDateOption.IsSet) + writer.WriteString("lodging.checkOutDate", additionalDataLodging.LodgingCheckOutDate); + + if (additionalDataLodging.LodgingCustomerServiceTollFreeNumberOption.IsSet) + writer.WriteString("lodging.customerServiceTollFreeNumber", additionalDataLodging.LodgingCustomerServiceTollFreeNumber); + + if (additionalDataLodging.LodgingFireSafetyActIndicatorOption.IsSet) + writer.WriteString("lodging.fireSafetyActIndicator", additionalDataLodging.LodgingFireSafetyActIndicator); + + if (additionalDataLodging.LodgingFolioCashAdvancesOption.IsSet) + writer.WriteString("lodging.folioCashAdvances", additionalDataLodging.LodgingFolioCashAdvances); + + if (additionalDataLodging.LodgingFolioNumberOption.IsSet) + writer.WriteString("lodging.folioNumber", additionalDataLodging.LodgingFolioNumber); + + if (additionalDataLodging.LodgingFoodBeverageChargesOption.IsSet) + writer.WriteString("lodging.foodBeverageCharges", additionalDataLodging.LodgingFoodBeverageCharges); + + if (additionalDataLodging.LodgingNoShowIndicatorOption.IsSet) + writer.WriteString("lodging.noShowIndicator", additionalDataLodging.LodgingNoShowIndicator); + + if (additionalDataLodging.LodgingPrepaidExpensesOption.IsSet) + writer.WriteString("lodging.prepaidExpenses", additionalDataLodging.LodgingPrepaidExpenses); + + if (additionalDataLodging.LodgingPropertyPhoneNumberOption.IsSet) + writer.WriteString("lodging.propertyPhoneNumber", additionalDataLodging.LodgingPropertyPhoneNumber); + + if (additionalDataLodging.LodgingRoom1NumberOfNightsOption.IsSet) + writer.WriteString("lodging.room1.numberOfNights", additionalDataLodging.LodgingRoom1NumberOfNights); + + if (additionalDataLodging.LodgingRoom1RateOption.IsSet) + writer.WriteString("lodging.room1.rate", additionalDataLodging.LodgingRoom1Rate); + + if (additionalDataLodging.LodgingTotalRoomTaxOption.IsSet) + writer.WriteString("lodging.totalRoomTax", additionalDataLodging.LodgingTotalRoomTax); + + if (additionalDataLodging.LodgingTotalTaxOption.IsSet) + writer.WriteString("lodging.totalTax", additionalDataLodging.LodgingTotalTax); + + if (additionalDataLodging.TravelEntertainmentAuthDataDurationOption.IsSet) + writer.WriteString("travelEntertainmentAuthData.duration", additionalDataLodging.TravelEntertainmentAuthDataDuration); + + if (additionalDataLodging.TravelEntertainmentAuthDataMarketOption.IsSet) + writer.WriteString("travelEntertainmentAuthData.market", additionalDataLodging.TravelEntertainmentAuthDataMarket); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs b/Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs index 8b3216c85..4f4db3350 100644 --- a/Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs +++ b/Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,191 +14,318 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataOpenInvoice /// - [DataContract(Name = "AdditionalDataOpenInvoice")] - public partial class AdditionalDataOpenInvoice : IEquatable, IValidatableObject + public partial class AdditionalDataOpenInvoice : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Holds different merchant data points like product, purchase, customer, and so on. It takes data in a Base64 encoded string. The `merchantData` parameter needs to be added to the `openinvoicedata` signature at the end. Since the field is optional, if it's not included it does not impact computing the merchant signature. Applies only to Klarna. You can contact Klarna for the format and structure of the string.. - /// The number of invoice lines included in `openinvoicedata`. There needs to be at least one line, so `numberOfLines` needs to be at least 1.. - /// First name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna.. - /// Last name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna.. - /// The three-character ISO currency code.. - /// A text description of the product the invoice line refers to.. - /// The price for one item in the invoice line, represented in minor units. The due amount for the item, VAT excluded.. - /// A unique id for this item. Required for RatePay if the description of each item is not unique.. - /// The VAT due for one item in the invoice line, represented in minor units.. - /// The VAT percentage for one item in the invoice line, represented in minor units. For example, 19% VAT is specified as 1900.. - /// The number of units purchased of a specific product.. - /// Name of the shipping company handling the the return shipment.. - /// The tracking number for the return of the shipment.. - /// URI where the customer can track the return of their shipment.. - /// Name of the shipping company handling the delivery.. - /// Shipping method.. - /// The tracking number for the shipment.. - /// URI where the customer can track their shipment.. - public AdditionalDataOpenInvoice(string openinvoicedataMerchantData = default(string), string openinvoicedataNumberOfLines = default(string), string openinvoicedataRecipientFirstName = default(string), string openinvoicedataRecipientLastName = default(string), string openinvoicedataLineItemNrCurrencyCode = default(string), string openinvoicedataLineItemNrDescription = default(string), string openinvoicedataLineItemNrItemAmount = default(string), string openinvoicedataLineItemNrItemId = default(string), string openinvoicedataLineItemNrItemVatAmount = default(string), string openinvoicedataLineItemNrItemVatPercentage = default(string), string openinvoicedataLineItemNrNumberOfItems = default(string), string openinvoicedataLineItemNrReturnShippingCompany = default(string), string openinvoicedataLineItemNrReturnTrackingNumber = default(string), string openinvoicedataLineItemNrReturnTrackingUri = default(string), string openinvoicedataLineItemNrShippingCompany = default(string), string openinvoicedataLineItemNrShippingMethod = default(string), string openinvoicedataLineItemNrTrackingNumber = default(string), string openinvoicedataLineItemNrTrackingUri = default(string)) + /// Holds different merchant data points like product, purchase, customer, and so on. It takes data in a Base64 encoded string. The `merchantData` parameter needs to be added to the `openinvoicedata` signature at the end. Since the field is optional, if it's not included it does not impact computing the merchant signature. Applies only to Klarna. You can contact Klarna for the format and structure of the string. + /// The number of invoice lines included in `openinvoicedata`. There needs to be at least one line, so `numberOfLines` needs to be at least 1. + /// First name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. + /// Last name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. + /// The three-character ISO currency code. + /// A text description of the product the invoice line refers to. + /// The price for one item in the invoice line, represented in minor units. The due amount for the item, VAT excluded. + /// A unique id for this item. Required for RatePay if the description of each item is not unique. + /// The VAT due for one item in the invoice line, represented in minor units. + /// The VAT percentage for one item in the invoice line, represented in minor units. For example, 19% VAT is specified as 1900. + /// The number of units purchased of a specific product. + /// Name of the shipping company handling the the return shipment. + /// The tracking number for the return of the shipment. + /// URI where the customer can track the return of their shipment. + /// Name of the shipping company handling the delivery. + /// Shipping method. + /// The tracking number for the shipment. + /// URI where the customer can track their shipment. + [JsonConstructor] + public AdditionalDataOpenInvoice(Option openinvoicedataMerchantData = default, Option openinvoicedataNumberOfLines = default, Option openinvoicedataRecipientFirstName = default, Option openinvoicedataRecipientLastName = default, Option openinvoicedataLineItemNrCurrencyCode = default, Option openinvoicedataLineItemNrDescription = default, Option openinvoicedataLineItemNrItemAmount = default, Option openinvoicedataLineItemNrItemId = default, Option openinvoicedataLineItemNrItemVatAmount = default, Option openinvoicedataLineItemNrItemVatPercentage = default, Option openinvoicedataLineItemNrNumberOfItems = default, Option openinvoicedataLineItemNrReturnShippingCompany = default, Option openinvoicedataLineItemNrReturnTrackingNumber = default, Option openinvoicedataLineItemNrReturnTrackingUri = default, Option openinvoicedataLineItemNrShippingCompany = default, Option openinvoicedataLineItemNrShippingMethod = default, Option openinvoicedataLineItemNrTrackingNumber = default, Option openinvoicedataLineItemNrTrackingUri = default) { - this.OpeninvoicedataMerchantData = openinvoicedataMerchantData; - this.OpeninvoicedataNumberOfLines = openinvoicedataNumberOfLines; - this.OpeninvoicedataRecipientFirstName = openinvoicedataRecipientFirstName; - this.OpeninvoicedataRecipientLastName = openinvoicedataRecipientLastName; - this.OpeninvoicedataLineItemNrCurrencyCode = openinvoicedataLineItemNrCurrencyCode; - this.OpeninvoicedataLineItemNrDescription = openinvoicedataLineItemNrDescription; - this.OpeninvoicedataLineItemNrItemAmount = openinvoicedataLineItemNrItemAmount; - this.OpeninvoicedataLineItemNrItemId = openinvoicedataLineItemNrItemId; - this.OpeninvoicedataLineItemNrItemVatAmount = openinvoicedataLineItemNrItemVatAmount; - this.OpeninvoicedataLineItemNrItemVatPercentage = openinvoicedataLineItemNrItemVatPercentage; - this.OpeninvoicedataLineItemNrNumberOfItems = openinvoicedataLineItemNrNumberOfItems; - this.OpeninvoicedataLineItemNrReturnShippingCompany = openinvoicedataLineItemNrReturnShippingCompany; - this.OpeninvoicedataLineItemNrReturnTrackingNumber = openinvoicedataLineItemNrReturnTrackingNumber; - this.OpeninvoicedataLineItemNrReturnTrackingUri = openinvoicedataLineItemNrReturnTrackingUri; - this.OpeninvoicedataLineItemNrShippingCompany = openinvoicedataLineItemNrShippingCompany; - this.OpeninvoicedataLineItemNrShippingMethod = openinvoicedataLineItemNrShippingMethod; - this.OpeninvoicedataLineItemNrTrackingNumber = openinvoicedataLineItemNrTrackingNumber; - this.OpeninvoicedataLineItemNrTrackingUri = openinvoicedataLineItemNrTrackingUri; + OpeninvoicedataMerchantDataOption = openinvoicedataMerchantData; + OpeninvoicedataNumberOfLinesOption = openinvoicedataNumberOfLines; + OpeninvoicedataRecipientFirstNameOption = openinvoicedataRecipientFirstName; + OpeninvoicedataRecipientLastNameOption = openinvoicedataRecipientLastName; + OpeninvoicedataLineItemNrCurrencyCodeOption = openinvoicedataLineItemNrCurrencyCode; + OpeninvoicedataLineItemNrDescriptionOption = openinvoicedataLineItemNrDescription; + OpeninvoicedataLineItemNrItemAmountOption = openinvoicedataLineItemNrItemAmount; + OpeninvoicedataLineItemNrItemIdOption = openinvoicedataLineItemNrItemId; + OpeninvoicedataLineItemNrItemVatAmountOption = openinvoicedataLineItemNrItemVatAmount; + OpeninvoicedataLineItemNrItemVatPercentageOption = openinvoicedataLineItemNrItemVatPercentage; + OpeninvoicedataLineItemNrNumberOfItemsOption = openinvoicedataLineItemNrNumberOfItems; + OpeninvoicedataLineItemNrReturnShippingCompanyOption = openinvoicedataLineItemNrReturnShippingCompany; + OpeninvoicedataLineItemNrReturnTrackingNumberOption = openinvoicedataLineItemNrReturnTrackingNumber; + OpeninvoicedataLineItemNrReturnTrackingUriOption = openinvoicedataLineItemNrReturnTrackingUri; + OpeninvoicedataLineItemNrShippingCompanyOption = openinvoicedataLineItemNrShippingCompany; + OpeninvoicedataLineItemNrShippingMethodOption = openinvoicedataLineItemNrShippingMethod; + OpeninvoicedataLineItemNrTrackingNumberOption = openinvoicedataLineItemNrTrackingNumber; + OpeninvoicedataLineItemNrTrackingUriOption = openinvoicedataLineItemNrTrackingUri; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of OpeninvoicedataMerchantData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataMerchantDataOption { get; private set; } + /// /// Holds different merchant data points like product, purchase, customer, and so on. It takes data in a Base64 encoded string. The `merchantData` parameter needs to be added to the `openinvoicedata` signature at the end. Since the field is optional, if it's not included it does not impact computing the merchant signature. Applies only to Klarna. You can contact Klarna for the format and structure of the string. /// /// Holds different merchant data points like product, purchase, customer, and so on. It takes data in a Base64 encoded string. The `merchantData` parameter needs to be added to the `openinvoicedata` signature at the end. Since the field is optional, if it's not included it does not impact computing the merchant signature. Applies only to Klarna. You can contact Klarna for the format and structure of the string. - [DataMember(Name = "openinvoicedata.merchantData", EmitDefaultValue = false)] - public string OpeninvoicedataMerchantData { get; set; } + [JsonPropertyName("openinvoicedata.merchantData")] + public string OpeninvoicedataMerchantData { get { return this.OpeninvoicedataMerchantDataOption; } set { this.OpeninvoicedataMerchantDataOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataNumberOfLines + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataNumberOfLinesOption { get; private set; } /// /// The number of invoice lines included in `openinvoicedata`. There needs to be at least one line, so `numberOfLines` needs to be at least 1. /// /// The number of invoice lines included in `openinvoicedata`. There needs to be at least one line, so `numberOfLines` needs to be at least 1. - [DataMember(Name = "openinvoicedata.numberOfLines", EmitDefaultValue = false)] - public string OpeninvoicedataNumberOfLines { get; set; } + [JsonPropertyName("openinvoicedata.numberOfLines")] + public string OpeninvoicedataNumberOfLines { get { return this.OpeninvoicedataNumberOfLinesOption; } set { this.OpeninvoicedataNumberOfLinesOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataRecipientFirstName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataRecipientFirstNameOption { get; private set; } /// /// First name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. /// /// First name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. - [DataMember(Name = "openinvoicedata.recipientFirstName", EmitDefaultValue = false)] - public string OpeninvoicedataRecipientFirstName { get; set; } + [JsonPropertyName("openinvoicedata.recipientFirstName")] + public string OpeninvoicedataRecipientFirstName { get { return this.OpeninvoicedataRecipientFirstNameOption; } set { this.OpeninvoicedataRecipientFirstNameOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataRecipientLastName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataRecipientLastNameOption { get; private set; } /// /// Last name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. /// /// Last name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. - [DataMember(Name = "openinvoicedata.recipientLastName", EmitDefaultValue = false)] - public string OpeninvoicedataRecipientLastName { get; set; } + [JsonPropertyName("openinvoicedata.recipientLastName")] + public string OpeninvoicedataRecipientLastName { get { return this.OpeninvoicedataRecipientLastNameOption; } set { this.OpeninvoicedataRecipientLastNameOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrCurrencyCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrCurrencyCodeOption { get; private set; } /// /// The three-character ISO currency code. /// /// The three-character ISO currency code. - [DataMember(Name = "openinvoicedataLine[itemNr].currencyCode", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrCurrencyCode { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].currencyCode")] + public string OpeninvoicedataLineItemNrCurrencyCode { get { return this.OpeninvoicedataLineItemNrCurrencyCodeOption; } set { this.OpeninvoicedataLineItemNrCurrencyCodeOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrDescription + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrDescriptionOption { get; private set; } /// /// A text description of the product the invoice line refers to. /// /// A text description of the product the invoice line refers to. - [DataMember(Name = "openinvoicedataLine[itemNr].description", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrDescription { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].description")] + public string OpeninvoicedataLineItemNrDescription { get { return this.OpeninvoicedataLineItemNrDescriptionOption; } set { this.OpeninvoicedataLineItemNrDescriptionOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrItemAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrItemAmountOption { get; private set; } /// /// The price for one item in the invoice line, represented in minor units. The due amount for the item, VAT excluded. /// /// The price for one item in the invoice line, represented in minor units. The due amount for the item, VAT excluded. - [DataMember(Name = "openinvoicedataLine[itemNr].itemAmount", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrItemAmount { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].itemAmount")] + public string OpeninvoicedataLineItemNrItemAmount { get { return this.OpeninvoicedataLineItemNrItemAmountOption; } set { this.OpeninvoicedataLineItemNrItemAmountOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrItemId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrItemIdOption { get; private set; } /// /// A unique id for this item. Required for RatePay if the description of each item is not unique. /// /// A unique id for this item. Required for RatePay if the description of each item is not unique. - [DataMember(Name = "openinvoicedataLine[itemNr].itemId", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrItemId { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].itemId")] + public string OpeninvoicedataLineItemNrItemId { get { return this.OpeninvoicedataLineItemNrItemIdOption; } set { this.OpeninvoicedataLineItemNrItemIdOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrItemVatAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrItemVatAmountOption { get; private set; } /// /// The VAT due for one item in the invoice line, represented in minor units. /// /// The VAT due for one item in the invoice line, represented in minor units. - [DataMember(Name = "openinvoicedataLine[itemNr].itemVatAmount", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrItemVatAmount { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].itemVatAmount")] + public string OpeninvoicedataLineItemNrItemVatAmount { get { return this.OpeninvoicedataLineItemNrItemVatAmountOption; } set { this.OpeninvoicedataLineItemNrItemVatAmountOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrItemVatPercentage + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrItemVatPercentageOption { get; private set; } /// /// The VAT percentage for one item in the invoice line, represented in minor units. For example, 19% VAT is specified as 1900. /// /// The VAT percentage for one item in the invoice line, represented in minor units. For example, 19% VAT is specified as 1900. - [DataMember(Name = "openinvoicedataLine[itemNr].itemVatPercentage", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrItemVatPercentage { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].itemVatPercentage")] + public string OpeninvoicedataLineItemNrItemVatPercentage { get { return this.OpeninvoicedataLineItemNrItemVatPercentageOption; } set { this.OpeninvoicedataLineItemNrItemVatPercentageOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrNumberOfItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrNumberOfItemsOption { get; private set; } /// /// The number of units purchased of a specific product. /// /// The number of units purchased of a specific product. - [DataMember(Name = "openinvoicedataLine[itemNr].numberOfItems", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrNumberOfItems { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].numberOfItems")] + public string OpeninvoicedataLineItemNrNumberOfItems { get { return this.OpeninvoicedataLineItemNrNumberOfItemsOption; } set { this.OpeninvoicedataLineItemNrNumberOfItemsOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrReturnShippingCompany + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrReturnShippingCompanyOption { get; private set; } /// /// Name of the shipping company handling the the return shipment. /// /// Name of the shipping company handling the the return shipment. - [DataMember(Name = "openinvoicedataLine[itemNr].returnShippingCompany", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrReturnShippingCompany { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].returnShippingCompany")] + public string OpeninvoicedataLineItemNrReturnShippingCompany { get { return this.OpeninvoicedataLineItemNrReturnShippingCompanyOption; } set { this.OpeninvoicedataLineItemNrReturnShippingCompanyOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrReturnTrackingNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrReturnTrackingNumberOption { get; private set; } /// /// The tracking number for the return of the shipment. /// /// The tracking number for the return of the shipment. - [DataMember(Name = "openinvoicedataLine[itemNr].returnTrackingNumber", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrReturnTrackingNumber { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].returnTrackingNumber")] + public string OpeninvoicedataLineItemNrReturnTrackingNumber { get { return this.OpeninvoicedataLineItemNrReturnTrackingNumberOption; } set { this.OpeninvoicedataLineItemNrReturnTrackingNumberOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrReturnTrackingUri + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrReturnTrackingUriOption { get; private set; } /// /// URI where the customer can track the return of their shipment. /// /// URI where the customer can track the return of their shipment. - [DataMember(Name = "openinvoicedataLine[itemNr].returnTrackingUri", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrReturnTrackingUri { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].returnTrackingUri")] + public string OpeninvoicedataLineItemNrReturnTrackingUri { get { return this.OpeninvoicedataLineItemNrReturnTrackingUriOption; } set { this.OpeninvoicedataLineItemNrReturnTrackingUriOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrShippingCompany + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrShippingCompanyOption { get; private set; } /// /// Name of the shipping company handling the delivery. /// /// Name of the shipping company handling the delivery. - [DataMember(Name = "openinvoicedataLine[itemNr].shippingCompany", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrShippingCompany { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].shippingCompany")] + public string OpeninvoicedataLineItemNrShippingCompany { get { return this.OpeninvoicedataLineItemNrShippingCompanyOption; } set { this.OpeninvoicedataLineItemNrShippingCompanyOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrShippingMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrShippingMethodOption { get; private set; } /// /// Shipping method. /// /// Shipping method. - [DataMember(Name = "openinvoicedataLine[itemNr].shippingMethod", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrShippingMethod { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].shippingMethod")] + public string OpeninvoicedataLineItemNrShippingMethod { get { return this.OpeninvoicedataLineItemNrShippingMethodOption; } set { this.OpeninvoicedataLineItemNrShippingMethodOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrTrackingNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrTrackingNumberOption { get; private set; } /// /// The tracking number for the shipment. /// /// The tracking number for the shipment. - [DataMember(Name = "openinvoicedataLine[itemNr].trackingNumber", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrTrackingNumber { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].trackingNumber")] + public string OpeninvoicedataLineItemNrTrackingNumber { get { return this.OpeninvoicedataLineItemNrTrackingNumberOption; } set { this.OpeninvoicedataLineItemNrTrackingNumberOption = new Option(value); } } + + /// + /// Used to track the state of OpeninvoicedataLineItemNrTrackingUri + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpeninvoicedataLineItemNrTrackingUriOption { get; private set; } /// /// URI where the customer can track their shipment. /// /// URI where the customer can track their shipment. - [DataMember(Name = "openinvoicedataLine[itemNr].trackingUri", EmitDefaultValue = false)] - public string OpeninvoicedataLineItemNrTrackingUri { get; set; } + [JsonPropertyName("openinvoicedataLine[itemNr].trackingUri")] + public string OpeninvoicedataLineItemNrTrackingUri { get { return this.OpeninvoicedataLineItemNrTrackingUriOption; } set { this.OpeninvoicedataLineItemNrTrackingUriOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -232,221 +358,320 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataOpenInvoiceJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AdditionalDataOpenInvoice Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AdditionalDataOpenInvoice); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AdditionalDataOpenInvoice instances are equal - /// - /// Instance of AdditionalDataOpenInvoice to be compared - /// Boolean - public bool Equals(AdditionalDataOpenInvoice input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option openinvoicedataMerchantData = default; + Option openinvoicedataNumberOfLines = default; + Option openinvoicedataRecipientFirstName = default; + Option openinvoicedataRecipientLastName = default; + Option openinvoicedataLineItemNrCurrencyCode = default; + Option openinvoicedataLineItemNrDescription = default; + Option openinvoicedataLineItemNrItemAmount = default; + Option openinvoicedataLineItemNrItemId = default; + Option openinvoicedataLineItemNrItemVatAmount = default; + Option openinvoicedataLineItemNrItemVatPercentage = default; + Option openinvoicedataLineItemNrNumberOfItems = default; + Option openinvoicedataLineItemNrReturnShippingCompany = default; + Option openinvoicedataLineItemNrReturnTrackingNumber = default; + Option openinvoicedataLineItemNrReturnTrackingUri = default; + Option openinvoicedataLineItemNrShippingCompany = default; + Option openinvoicedataLineItemNrShippingMethod = default; + Option openinvoicedataLineItemNrTrackingNumber = default; + Option openinvoicedataLineItemNrTrackingUri = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "openinvoicedata.merchantData": + openinvoicedataMerchantData = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedata.numberOfLines": + openinvoicedataNumberOfLines = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedata.recipientFirstName": + openinvoicedataRecipientFirstName = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedata.recipientLastName": + openinvoicedataRecipientLastName = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].currencyCode": + openinvoicedataLineItemNrCurrencyCode = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].description": + openinvoicedataLineItemNrDescription = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].itemAmount": + openinvoicedataLineItemNrItemAmount = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].itemId": + openinvoicedataLineItemNrItemId = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].itemVatAmount": + openinvoicedataLineItemNrItemVatAmount = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].itemVatPercentage": + openinvoicedataLineItemNrItemVatPercentage = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].numberOfItems": + openinvoicedataLineItemNrNumberOfItems = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].returnShippingCompany": + openinvoicedataLineItemNrReturnShippingCompany = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].returnTrackingNumber": + openinvoicedataLineItemNrReturnTrackingNumber = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].returnTrackingUri": + openinvoicedataLineItemNrReturnTrackingUri = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].shippingCompany": + openinvoicedataLineItemNrShippingCompany = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].shippingMethod": + openinvoicedataLineItemNrShippingMethod = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].trackingNumber": + openinvoicedataLineItemNrTrackingNumber = new Option(utf8JsonReader.GetString()); + break; + case "openinvoicedataLine[itemNr].trackingUri": + openinvoicedataLineItemNrTrackingUri = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.OpeninvoicedataMerchantData == input.OpeninvoicedataMerchantData || - (this.OpeninvoicedataMerchantData != null && - this.OpeninvoicedataMerchantData.Equals(input.OpeninvoicedataMerchantData)) - ) && - ( - this.OpeninvoicedataNumberOfLines == input.OpeninvoicedataNumberOfLines || - (this.OpeninvoicedataNumberOfLines != null && - this.OpeninvoicedataNumberOfLines.Equals(input.OpeninvoicedataNumberOfLines)) - ) && - ( - this.OpeninvoicedataRecipientFirstName == input.OpeninvoicedataRecipientFirstName || - (this.OpeninvoicedataRecipientFirstName != null && - this.OpeninvoicedataRecipientFirstName.Equals(input.OpeninvoicedataRecipientFirstName)) - ) && - ( - this.OpeninvoicedataRecipientLastName == input.OpeninvoicedataRecipientLastName || - (this.OpeninvoicedataRecipientLastName != null && - this.OpeninvoicedataRecipientLastName.Equals(input.OpeninvoicedataRecipientLastName)) - ) && - ( - this.OpeninvoicedataLineItemNrCurrencyCode == input.OpeninvoicedataLineItemNrCurrencyCode || - (this.OpeninvoicedataLineItemNrCurrencyCode != null && - this.OpeninvoicedataLineItemNrCurrencyCode.Equals(input.OpeninvoicedataLineItemNrCurrencyCode)) - ) && - ( - this.OpeninvoicedataLineItemNrDescription == input.OpeninvoicedataLineItemNrDescription || - (this.OpeninvoicedataLineItemNrDescription != null && - this.OpeninvoicedataLineItemNrDescription.Equals(input.OpeninvoicedataLineItemNrDescription)) - ) && - ( - this.OpeninvoicedataLineItemNrItemAmount == input.OpeninvoicedataLineItemNrItemAmount || - (this.OpeninvoicedataLineItemNrItemAmount != null && - this.OpeninvoicedataLineItemNrItemAmount.Equals(input.OpeninvoicedataLineItemNrItemAmount)) - ) && - ( - this.OpeninvoicedataLineItemNrItemId == input.OpeninvoicedataLineItemNrItemId || - (this.OpeninvoicedataLineItemNrItemId != null && - this.OpeninvoicedataLineItemNrItemId.Equals(input.OpeninvoicedataLineItemNrItemId)) - ) && - ( - this.OpeninvoicedataLineItemNrItemVatAmount == input.OpeninvoicedataLineItemNrItemVatAmount || - (this.OpeninvoicedataLineItemNrItemVatAmount != null && - this.OpeninvoicedataLineItemNrItemVatAmount.Equals(input.OpeninvoicedataLineItemNrItemVatAmount)) - ) && - ( - this.OpeninvoicedataLineItemNrItemVatPercentage == input.OpeninvoicedataLineItemNrItemVatPercentage || - (this.OpeninvoicedataLineItemNrItemVatPercentage != null && - this.OpeninvoicedataLineItemNrItemVatPercentage.Equals(input.OpeninvoicedataLineItemNrItemVatPercentage)) - ) && - ( - this.OpeninvoicedataLineItemNrNumberOfItems == input.OpeninvoicedataLineItemNrNumberOfItems || - (this.OpeninvoicedataLineItemNrNumberOfItems != null && - this.OpeninvoicedataLineItemNrNumberOfItems.Equals(input.OpeninvoicedataLineItemNrNumberOfItems)) - ) && - ( - this.OpeninvoicedataLineItemNrReturnShippingCompany == input.OpeninvoicedataLineItemNrReturnShippingCompany || - (this.OpeninvoicedataLineItemNrReturnShippingCompany != null && - this.OpeninvoicedataLineItemNrReturnShippingCompany.Equals(input.OpeninvoicedataLineItemNrReturnShippingCompany)) - ) && - ( - this.OpeninvoicedataLineItemNrReturnTrackingNumber == input.OpeninvoicedataLineItemNrReturnTrackingNumber || - (this.OpeninvoicedataLineItemNrReturnTrackingNumber != null && - this.OpeninvoicedataLineItemNrReturnTrackingNumber.Equals(input.OpeninvoicedataLineItemNrReturnTrackingNumber)) - ) && - ( - this.OpeninvoicedataLineItemNrReturnTrackingUri == input.OpeninvoicedataLineItemNrReturnTrackingUri || - (this.OpeninvoicedataLineItemNrReturnTrackingUri != null && - this.OpeninvoicedataLineItemNrReturnTrackingUri.Equals(input.OpeninvoicedataLineItemNrReturnTrackingUri)) - ) && - ( - this.OpeninvoicedataLineItemNrShippingCompany == input.OpeninvoicedataLineItemNrShippingCompany || - (this.OpeninvoicedataLineItemNrShippingCompany != null && - this.OpeninvoicedataLineItemNrShippingCompany.Equals(input.OpeninvoicedataLineItemNrShippingCompany)) - ) && - ( - this.OpeninvoicedataLineItemNrShippingMethod == input.OpeninvoicedataLineItemNrShippingMethod || - (this.OpeninvoicedataLineItemNrShippingMethod != null && - this.OpeninvoicedataLineItemNrShippingMethod.Equals(input.OpeninvoicedataLineItemNrShippingMethod)) - ) && - ( - this.OpeninvoicedataLineItemNrTrackingNumber == input.OpeninvoicedataLineItemNrTrackingNumber || - (this.OpeninvoicedataLineItemNrTrackingNumber != null && - this.OpeninvoicedataLineItemNrTrackingNumber.Equals(input.OpeninvoicedataLineItemNrTrackingNumber)) - ) && - ( - this.OpeninvoicedataLineItemNrTrackingUri == input.OpeninvoicedataLineItemNrTrackingUri || - (this.OpeninvoicedataLineItemNrTrackingUri != null && - this.OpeninvoicedataLineItemNrTrackingUri.Equals(input.OpeninvoicedataLineItemNrTrackingUri)) - ); + + if (openinvoicedataMerchantData.IsSet && openinvoicedataMerchantData.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataMerchantData), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataNumberOfLines.IsSet && openinvoicedataNumberOfLines.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataNumberOfLines), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataRecipientFirstName.IsSet && openinvoicedataRecipientFirstName.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataRecipientFirstName), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataRecipientLastName.IsSet && openinvoicedataRecipientLastName.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataRecipientLastName), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrCurrencyCode.IsSet && openinvoicedataLineItemNrCurrencyCode.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrCurrencyCode), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrDescription.IsSet && openinvoicedataLineItemNrDescription.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrDescription), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrItemAmount.IsSet && openinvoicedataLineItemNrItemAmount.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrItemAmount), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrItemId.IsSet && openinvoicedataLineItemNrItemId.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrItemId), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrItemVatAmount.IsSet && openinvoicedataLineItemNrItemVatAmount.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrItemVatAmount), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrItemVatPercentage.IsSet && openinvoicedataLineItemNrItemVatPercentage.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrItemVatPercentage), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrNumberOfItems.IsSet && openinvoicedataLineItemNrNumberOfItems.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrNumberOfItems), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrReturnShippingCompany.IsSet && openinvoicedataLineItemNrReturnShippingCompany.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrReturnShippingCompany), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrReturnTrackingNumber.IsSet && openinvoicedataLineItemNrReturnTrackingNumber.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrReturnTrackingNumber), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrReturnTrackingUri.IsSet && openinvoicedataLineItemNrReturnTrackingUri.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrReturnTrackingUri), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrShippingCompany.IsSet && openinvoicedataLineItemNrShippingCompany.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrShippingCompany), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrShippingMethod.IsSet && openinvoicedataLineItemNrShippingMethod.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrShippingMethod), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrTrackingNumber.IsSet && openinvoicedataLineItemNrTrackingNumber.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrTrackingNumber), "Property is not nullable for class AdditionalDataOpenInvoice."); + + if (openinvoicedataLineItemNrTrackingUri.IsSet && openinvoicedataLineItemNrTrackingUri.Value == null) + throw new ArgumentNullException(nameof(openinvoicedataLineItemNrTrackingUri), "Property is not nullable for class AdditionalDataOpenInvoice."); + + return new AdditionalDataOpenInvoice(openinvoicedataMerchantData, openinvoicedataNumberOfLines, openinvoicedataRecipientFirstName, openinvoicedataRecipientLastName, openinvoicedataLineItemNrCurrencyCode, openinvoicedataLineItemNrDescription, openinvoicedataLineItemNrItemAmount, openinvoicedataLineItemNrItemId, openinvoicedataLineItemNrItemVatAmount, openinvoicedataLineItemNrItemVatPercentage, openinvoicedataLineItemNrNumberOfItems, openinvoicedataLineItemNrReturnShippingCompany, openinvoicedataLineItemNrReturnTrackingNumber, openinvoicedataLineItemNrReturnTrackingUri, openinvoicedataLineItemNrShippingCompany, openinvoicedataLineItemNrShippingMethod, openinvoicedataLineItemNrTrackingNumber, openinvoicedataLineItemNrTrackingUri); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataOpenInvoice additionalDataOpenInvoice, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.OpeninvoicedataMerchantData != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataMerchantData.GetHashCode(); - } - if (this.OpeninvoicedataNumberOfLines != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataNumberOfLines.GetHashCode(); - } - if (this.OpeninvoicedataRecipientFirstName != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataRecipientFirstName.GetHashCode(); - } - if (this.OpeninvoicedataRecipientLastName != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataRecipientLastName.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrCurrencyCode != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrCurrencyCode.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrDescription != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrDescription.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrItemAmount != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrItemAmount.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrItemId != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrItemId.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrItemVatAmount != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrItemVatAmount.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrItemVatPercentage != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrItemVatPercentage.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrNumberOfItems != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrNumberOfItems.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrReturnShippingCompany != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrReturnShippingCompany.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrReturnTrackingNumber != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrReturnTrackingNumber.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrReturnTrackingUri != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrReturnTrackingUri.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrShippingCompany != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrShippingCompany.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrShippingMethod != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrShippingMethod.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrTrackingNumber != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrTrackingNumber.GetHashCode(); - } - if (this.OpeninvoicedataLineItemNrTrackingUri != null) - { - hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrTrackingUri.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataOpenInvoice, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataOpenInvoice additionalDataOpenInvoice, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataOpenInvoice.OpeninvoicedataMerchantDataOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataMerchantData == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataMerchantData), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataNumberOfLinesOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataNumberOfLines == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataNumberOfLines), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataRecipientFirstNameOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataRecipientFirstName == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataRecipientFirstName), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataRecipientLastNameOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataRecipientLastName == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataRecipientLastName), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrCurrencyCodeOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrCurrencyCode == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrCurrencyCode), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrDescriptionOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrDescription == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrDescription), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemAmountOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemAmount == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemAmount), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemIdOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemId == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemId), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatAmountOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatAmount == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatAmount), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatPercentageOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatPercentage == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatPercentage), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrNumberOfItemsOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrNumberOfItems == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrNumberOfItems), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnShippingCompanyOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnShippingCompany == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnShippingCompany), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingNumberOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingNumber == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingNumber), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingUriOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingUri == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingUri), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingCompanyOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingCompany == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingCompany), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingMethodOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingMethod == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingMethod), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingNumberOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingNumber == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingNumber), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingUriOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingUri == null) + throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingUri), "Property is required for class AdditionalDataOpenInvoice."); + + if (additionalDataOpenInvoice.OpeninvoicedataMerchantDataOption.IsSet) + writer.WriteString("openinvoicedata.merchantData", additionalDataOpenInvoice.OpeninvoicedataMerchantData); + + if (additionalDataOpenInvoice.OpeninvoicedataNumberOfLinesOption.IsSet) + writer.WriteString("openinvoicedata.numberOfLines", additionalDataOpenInvoice.OpeninvoicedataNumberOfLines); + + if (additionalDataOpenInvoice.OpeninvoicedataRecipientFirstNameOption.IsSet) + writer.WriteString("openinvoicedata.recipientFirstName", additionalDataOpenInvoice.OpeninvoicedataRecipientFirstName); + + if (additionalDataOpenInvoice.OpeninvoicedataRecipientLastNameOption.IsSet) + writer.WriteString("openinvoicedata.recipientLastName", additionalDataOpenInvoice.OpeninvoicedataRecipientLastName); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrCurrencyCodeOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].currencyCode", additionalDataOpenInvoice.OpeninvoicedataLineItemNrCurrencyCode); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrDescriptionOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].description", additionalDataOpenInvoice.OpeninvoicedataLineItemNrDescription); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemAmountOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].itemAmount", additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemAmount); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemIdOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].itemId", additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemId); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatAmountOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].itemVatAmount", additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatAmount); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatPercentageOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].itemVatPercentage", additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatPercentage); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrNumberOfItemsOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].numberOfItems", additionalDataOpenInvoice.OpeninvoicedataLineItemNrNumberOfItems); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnShippingCompanyOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].returnShippingCompany", additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnShippingCompany); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingNumberOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].returnTrackingNumber", additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingNumber); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingUriOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].returnTrackingUri", additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingUri); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingCompanyOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].shippingCompany", additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingCompany); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingMethodOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].shippingMethod", additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingMethod); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingNumberOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].trackingNumber", additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingNumber); + + if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingUriOption.IsSet) + writer.WriteString("openinvoicedataLine[itemNr].trackingUri", additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingUri); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataOpi.cs b/Adyen/Model/Checkout/AdditionalDataOpi.cs index 19f3a472f..48f33b856 100644 --- a/Adyen/Model/Checkout/AdditionalDataOpi.cs +++ b/Adyen/Model/Checkout/AdditionalDataOpi.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,38 +14,46 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataOpi /// - [DataContract(Name = "AdditionalDataOpi")] - public partial class AdditionalDataOpi : IEquatable, IValidatableObject + public partial class AdditionalDataOpi : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Optional boolean indicator. Set to **true** if you want an ecommerce transaction to return an `opi.transToken` as additional data in the response. You can store this Oracle Payment Interface token in your Oracle Opera database. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce).. - public AdditionalDataOpi(string opiIncludeTransToken = default(string)) + /// Optional boolean indicator. Set to **true** if you want an ecommerce transaction to return an `opi.transToken` as additional data in the response. You can store this Oracle Payment Interface token in your Oracle Opera database. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). + [JsonConstructor] + public AdditionalDataOpi(Option opiIncludeTransToken = default) { - this.OpiIncludeTransToken = opiIncludeTransToken; + OpiIncludeTransTokenOption = opiIncludeTransToken; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of OpiIncludeTransToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpiIncludeTransTokenOption { get; private set; } + /// /// Optional boolean indicator. Set to **true** if you want an ecommerce transaction to return an `opi.transToken` as additional data in the response. You can store this Oracle Payment Interface token in your Oracle Opera database. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). /// /// Optional boolean indicator. Set to **true** if you want an ecommerce transaction to return an `opi.transToken` as additional data in the response. You can store this Oracle Payment Interface token in your Oracle Opera database. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). - [DataMember(Name = "opi.includeTransToken", EmitDefaultValue = false)] - public string OpiIncludeTransToken { get; set; } + [JsonPropertyName("opi.includeTransToken")] + public string OpiIncludeTransToken { get { return this.OpiIncludeTransTokenOption; } set { this.OpiIncludeTransTokenOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -62,68 +69,99 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataOpiJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AdditionalDataOpi Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AdditionalDataOpi); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AdditionalDataOpi instances are equal - /// - /// Instance of AdditionalDataOpi to be compared - /// Boolean - public bool Equals(AdditionalDataOpi input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option opiIncludeTransToken = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "opi.includeTransToken": + opiIncludeTransToken = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.OpiIncludeTransToken == input.OpiIncludeTransToken || - (this.OpiIncludeTransToken != null && - this.OpiIncludeTransToken.Equals(input.OpiIncludeTransToken)) - ); + + if (opiIncludeTransToken.IsSet && opiIncludeTransToken.Value == null) + throw new ArgumentNullException(nameof(opiIncludeTransToken), "Property is not nullable for class AdditionalDataOpi."); + + return new AdditionalDataOpi(opiIncludeTransToken); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataOpi additionalDataOpi, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.OpiIncludeTransToken != null) - { - hashCode = (hashCode * 59) + this.OpiIncludeTransToken.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataOpi, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataOpi additionalDataOpi, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataOpi.OpiIncludeTransTokenOption.IsSet && additionalDataOpi.OpiIncludeTransToken == null) + throw new ArgumentNullException(nameof(additionalDataOpi.OpiIncludeTransToken), "Property is required for class AdditionalDataOpi."); + + if (additionalDataOpi.OpiIncludeTransTokenOption.IsSet) + writer.WriteString("opi.includeTransToken", additionalDataOpi.OpiIncludeTransToken); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataRatepay.cs b/Adyen/Model/Checkout/AdditionalDataRatepay.cs index 9e8a5a351..0d622ad47 100644 --- a/Adyen/Model/Checkout/AdditionalDataRatepay.cs +++ b/Adyen/Model/Checkout/AdditionalDataRatepay.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,101 +14,158 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataRatepay /// - [DataContract(Name = "AdditionalDataRatepay")] - public partial class AdditionalDataRatepay : IEquatable, IValidatableObject + public partial class AdditionalDataRatepay : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Amount the customer has to pay each month.. - /// Interest rate of this installment.. - /// Amount of the last installment.. - /// Calendar day of the first payment.. - /// Date the merchant delivered the goods to the customer.. - /// Date by which the customer must settle the payment.. - /// Invoice date, defined by the merchant. If not included, the invoice date is set to the delivery date.. - /// Identification name or number for the invoice, defined by the merchant.. - public AdditionalDataRatepay(string ratepayInstallmentAmount = default(string), string ratepayInterestRate = default(string), string ratepayLastInstallmentAmount = default(string), string ratepayPaymentFirstday = default(string), string ratepaydataDeliveryDate = default(string), string ratepaydataDueDate = default(string), string ratepaydataInvoiceDate = default(string), string ratepaydataInvoiceId = default(string)) + /// Amount the customer has to pay each month. + /// Interest rate of this installment. + /// Amount of the last installment. + /// Calendar day of the first payment. + /// Date the merchant delivered the goods to the customer. + /// Date by which the customer must settle the payment. + /// Invoice date, defined by the merchant. If not included, the invoice date is set to the delivery date. + /// Identification name or number for the invoice, defined by the merchant. + [JsonConstructor] + public AdditionalDataRatepay(Option ratepayInstallmentAmount = default, Option ratepayInterestRate = default, Option ratepayLastInstallmentAmount = default, Option ratepayPaymentFirstday = default, Option ratepaydataDeliveryDate = default, Option ratepaydataDueDate = default, Option ratepaydataInvoiceDate = default, Option ratepaydataInvoiceId = default) { - this.RatepayInstallmentAmount = ratepayInstallmentAmount; - this.RatepayInterestRate = ratepayInterestRate; - this.RatepayLastInstallmentAmount = ratepayLastInstallmentAmount; - this.RatepayPaymentFirstday = ratepayPaymentFirstday; - this.RatepaydataDeliveryDate = ratepaydataDeliveryDate; - this.RatepaydataDueDate = ratepaydataDueDate; - this.RatepaydataInvoiceDate = ratepaydataInvoiceDate; - this.RatepaydataInvoiceId = ratepaydataInvoiceId; + RatepayInstallmentAmountOption = ratepayInstallmentAmount; + RatepayInterestRateOption = ratepayInterestRate; + RatepayLastInstallmentAmountOption = ratepayLastInstallmentAmount; + RatepayPaymentFirstdayOption = ratepayPaymentFirstday; + RatepaydataDeliveryDateOption = ratepaydataDeliveryDate; + RatepaydataDueDateOption = ratepaydataDueDate; + RatepaydataInvoiceDateOption = ratepaydataInvoiceDate; + RatepaydataInvoiceIdOption = ratepaydataInvoiceId; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of RatepayInstallmentAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RatepayInstallmentAmountOption { get; private set; } + /// /// Amount the customer has to pay each month. /// /// Amount the customer has to pay each month. - [DataMember(Name = "ratepay.installmentAmount", EmitDefaultValue = false)] - public string RatepayInstallmentAmount { get; set; } + [JsonPropertyName("ratepay.installmentAmount")] + public string RatepayInstallmentAmount { get { return this.RatepayInstallmentAmountOption; } set { this.RatepayInstallmentAmountOption = new Option(value); } } + + /// + /// Used to track the state of RatepayInterestRate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RatepayInterestRateOption { get; private set; } /// /// Interest rate of this installment. /// /// Interest rate of this installment. - [DataMember(Name = "ratepay.interestRate", EmitDefaultValue = false)] - public string RatepayInterestRate { get; set; } + [JsonPropertyName("ratepay.interestRate")] + public string RatepayInterestRate { get { return this.RatepayInterestRateOption; } set { this.RatepayInterestRateOption = new Option(value); } } + + /// + /// Used to track the state of RatepayLastInstallmentAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RatepayLastInstallmentAmountOption { get; private set; } /// /// Amount of the last installment. /// /// Amount of the last installment. - [DataMember(Name = "ratepay.lastInstallmentAmount", EmitDefaultValue = false)] - public string RatepayLastInstallmentAmount { get; set; } + [JsonPropertyName("ratepay.lastInstallmentAmount")] + public string RatepayLastInstallmentAmount { get { return this.RatepayLastInstallmentAmountOption; } set { this.RatepayLastInstallmentAmountOption = new Option(value); } } + + /// + /// Used to track the state of RatepayPaymentFirstday + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RatepayPaymentFirstdayOption { get; private set; } /// /// Calendar day of the first payment. /// /// Calendar day of the first payment. - [DataMember(Name = "ratepay.paymentFirstday", EmitDefaultValue = false)] - public string RatepayPaymentFirstday { get; set; } + [JsonPropertyName("ratepay.paymentFirstday")] + public string RatepayPaymentFirstday { get { return this.RatepayPaymentFirstdayOption; } set { this.RatepayPaymentFirstdayOption = new Option(value); } } + + /// + /// Used to track the state of RatepaydataDeliveryDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RatepaydataDeliveryDateOption { get; private set; } /// /// Date the merchant delivered the goods to the customer. /// /// Date the merchant delivered the goods to the customer. - [DataMember(Name = "ratepaydata.deliveryDate", EmitDefaultValue = false)] - public string RatepaydataDeliveryDate { get; set; } + [JsonPropertyName("ratepaydata.deliveryDate")] + public string RatepaydataDeliveryDate { get { return this.RatepaydataDeliveryDateOption; } set { this.RatepaydataDeliveryDateOption = new Option(value); } } + + /// + /// Used to track the state of RatepaydataDueDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RatepaydataDueDateOption { get; private set; } /// /// Date by which the customer must settle the payment. /// /// Date by which the customer must settle the payment. - [DataMember(Name = "ratepaydata.dueDate", EmitDefaultValue = false)] - public string RatepaydataDueDate { get; set; } + [JsonPropertyName("ratepaydata.dueDate")] + public string RatepaydataDueDate { get { return this.RatepaydataDueDateOption; } set { this.RatepaydataDueDateOption = new Option(value); } } + + /// + /// Used to track the state of RatepaydataInvoiceDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RatepaydataInvoiceDateOption { get; private set; } /// /// Invoice date, defined by the merchant. If not included, the invoice date is set to the delivery date. /// /// Invoice date, defined by the merchant. If not included, the invoice date is set to the delivery date. - [DataMember(Name = "ratepaydata.invoiceDate", EmitDefaultValue = false)] - public string RatepaydataInvoiceDate { get; set; } + [JsonPropertyName("ratepaydata.invoiceDate")] + public string RatepaydataInvoiceDate { get { return this.RatepaydataInvoiceDateOption; } set { this.RatepaydataInvoiceDateOption = new Option(value); } } + + /// + /// Used to track the state of RatepaydataInvoiceId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RatepaydataInvoiceIdOption { get; private set; } /// /// Identification name or number for the invoice, defined by the merchant. /// /// Identification name or number for the invoice, defined by the merchant. - [DataMember(Name = "ratepaydata.invoiceId", EmitDefaultValue = false)] - public string RatepaydataInvoiceId { get; set; } + [JsonPropertyName("ratepaydata.invoiceId")] + public string RatepaydataInvoiceId { get { return this.RatepaydataInvoiceIdOption; } set { this.RatepaydataInvoiceIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -132,131 +188,190 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataRatepayJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AdditionalDataRatepay Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AdditionalDataRatepay); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AdditionalDataRatepay instances are equal - /// - /// Instance of AdditionalDataRatepay to be compared - /// Boolean - public bool Equals(AdditionalDataRatepay input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option ratepayInstallmentAmount = default; + Option ratepayInterestRate = default; + Option ratepayLastInstallmentAmount = default; + Option ratepayPaymentFirstday = default; + Option ratepaydataDeliveryDate = default; + Option ratepaydataDueDate = default; + Option ratepaydataInvoiceDate = default; + Option ratepaydataInvoiceId = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "ratepay.installmentAmount": + ratepayInstallmentAmount = new Option(utf8JsonReader.GetString()); + break; + case "ratepay.interestRate": + ratepayInterestRate = new Option(utf8JsonReader.GetString()); + break; + case "ratepay.lastInstallmentAmount": + ratepayLastInstallmentAmount = new Option(utf8JsonReader.GetString()); + break; + case "ratepay.paymentFirstday": + ratepayPaymentFirstday = new Option(utf8JsonReader.GetString()); + break; + case "ratepaydata.deliveryDate": + ratepaydataDeliveryDate = new Option(utf8JsonReader.GetString()); + break; + case "ratepaydata.dueDate": + ratepaydataDueDate = new Option(utf8JsonReader.GetString()); + break; + case "ratepaydata.invoiceDate": + ratepaydataInvoiceDate = new Option(utf8JsonReader.GetString()); + break; + case "ratepaydata.invoiceId": + ratepaydataInvoiceId = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.RatepayInstallmentAmount == input.RatepayInstallmentAmount || - (this.RatepayInstallmentAmount != null && - this.RatepayInstallmentAmount.Equals(input.RatepayInstallmentAmount)) - ) && - ( - this.RatepayInterestRate == input.RatepayInterestRate || - (this.RatepayInterestRate != null && - this.RatepayInterestRate.Equals(input.RatepayInterestRate)) - ) && - ( - this.RatepayLastInstallmentAmount == input.RatepayLastInstallmentAmount || - (this.RatepayLastInstallmentAmount != null && - this.RatepayLastInstallmentAmount.Equals(input.RatepayLastInstallmentAmount)) - ) && - ( - this.RatepayPaymentFirstday == input.RatepayPaymentFirstday || - (this.RatepayPaymentFirstday != null && - this.RatepayPaymentFirstday.Equals(input.RatepayPaymentFirstday)) - ) && - ( - this.RatepaydataDeliveryDate == input.RatepaydataDeliveryDate || - (this.RatepaydataDeliveryDate != null && - this.RatepaydataDeliveryDate.Equals(input.RatepaydataDeliveryDate)) - ) && - ( - this.RatepaydataDueDate == input.RatepaydataDueDate || - (this.RatepaydataDueDate != null && - this.RatepaydataDueDate.Equals(input.RatepaydataDueDate)) - ) && - ( - this.RatepaydataInvoiceDate == input.RatepaydataInvoiceDate || - (this.RatepaydataInvoiceDate != null && - this.RatepaydataInvoiceDate.Equals(input.RatepaydataInvoiceDate)) - ) && - ( - this.RatepaydataInvoiceId == input.RatepaydataInvoiceId || - (this.RatepaydataInvoiceId != null && - this.RatepaydataInvoiceId.Equals(input.RatepaydataInvoiceId)) - ); + + if (ratepayInstallmentAmount.IsSet && ratepayInstallmentAmount.Value == null) + throw new ArgumentNullException(nameof(ratepayInstallmentAmount), "Property is not nullable for class AdditionalDataRatepay."); + + if (ratepayInterestRate.IsSet && ratepayInterestRate.Value == null) + throw new ArgumentNullException(nameof(ratepayInterestRate), "Property is not nullable for class AdditionalDataRatepay."); + + if (ratepayLastInstallmentAmount.IsSet && ratepayLastInstallmentAmount.Value == null) + throw new ArgumentNullException(nameof(ratepayLastInstallmentAmount), "Property is not nullable for class AdditionalDataRatepay."); + + if (ratepayPaymentFirstday.IsSet && ratepayPaymentFirstday.Value == null) + throw new ArgumentNullException(nameof(ratepayPaymentFirstday), "Property is not nullable for class AdditionalDataRatepay."); + + if (ratepaydataDeliveryDate.IsSet && ratepaydataDeliveryDate.Value == null) + throw new ArgumentNullException(nameof(ratepaydataDeliveryDate), "Property is not nullable for class AdditionalDataRatepay."); + + if (ratepaydataDueDate.IsSet && ratepaydataDueDate.Value == null) + throw new ArgumentNullException(nameof(ratepaydataDueDate), "Property is not nullable for class AdditionalDataRatepay."); + + if (ratepaydataInvoiceDate.IsSet && ratepaydataInvoiceDate.Value == null) + throw new ArgumentNullException(nameof(ratepaydataInvoiceDate), "Property is not nullable for class AdditionalDataRatepay."); + + if (ratepaydataInvoiceId.IsSet && ratepaydataInvoiceId.Value == null) + throw new ArgumentNullException(nameof(ratepaydataInvoiceId), "Property is not nullable for class AdditionalDataRatepay."); + + return new AdditionalDataRatepay(ratepayInstallmentAmount, ratepayInterestRate, ratepayLastInstallmentAmount, ratepayPaymentFirstday, ratepaydataDeliveryDate, ratepaydataDueDate, ratepaydataInvoiceDate, ratepaydataInvoiceId); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataRatepay additionalDataRatepay, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.RatepayInstallmentAmount != null) - { - hashCode = (hashCode * 59) + this.RatepayInstallmentAmount.GetHashCode(); - } - if (this.RatepayInterestRate != null) - { - hashCode = (hashCode * 59) + this.RatepayInterestRate.GetHashCode(); - } - if (this.RatepayLastInstallmentAmount != null) - { - hashCode = (hashCode * 59) + this.RatepayLastInstallmentAmount.GetHashCode(); - } - if (this.RatepayPaymentFirstday != null) - { - hashCode = (hashCode * 59) + this.RatepayPaymentFirstday.GetHashCode(); - } - if (this.RatepaydataDeliveryDate != null) - { - hashCode = (hashCode * 59) + this.RatepaydataDeliveryDate.GetHashCode(); - } - if (this.RatepaydataDueDate != null) - { - hashCode = (hashCode * 59) + this.RatepaydataDueDate.GetHashCode(); - } - if (this.RatepaydataInvoiceDate != null) - { - hashCode = (hashCode * 59) + this.RatepaydataInvoiceDate.GetHashCode(); - } - if (this.RatepaydataInvoiceId != null) - { - hashCode = (hashCode * 59) + this.RatepaydataInvoiceId.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataRatepay, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataRatepay additionalDataRatepay, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataRatepay.RatepayInstallmentAmountOption.IsSet && additionalDataRatepay.RatepayInstallmentAmount == null) + throw new ArgumentNullException(nameof(additionalDataRatepay.RatepayInstallmentAmount), "Property is required for class AdditionalDataRatepay."); + + if (additionalDataRatepay.RatepayInterestRateOption.IsSet && additionalDataRatepay.RatepayInterestRate == null) + throw new ArgumentNullException(nameof(additionalDataRatepay.RatepayInterestRate), "Property is required for class AdditionalDataRatepay."); + + if (additionalDataRatepay.RatepayLastInstallmentAmountOption.IsSet && additionalDataRatepay.RatepayLastInstallmentAmount == null) + throw new ArgumentNullException(nameof(additionalDataRatepay.RatepayLastInstallmentAmount), "Property is required for class AdditionalDataRatepay."); + + if (additionalDataRatepay.RatepayPaymentFirstdayOption.IsSet && additionalDataRatepay.RatepayPaymentFirstday == null) + throw new ArgumentNullException(nameof(additionalDataRatepay.RatepayPaymentFirstday), "Property is required for class AdditionalDataRatepay."); + + if (additionalDataRatepay.RatepaydataDeliveryDateOption.IsSet && additionalDataRatepay.RatepaydataDeliveryDate == null) + throw new ArgumentNullException(nameof(additionalDataRatepay.RatepaydataDeliveryDate), "Property is required for class AdditionalDataRatepay."); + + if (additionalDataRatepay.RatepaydataDueDateOption.IsSet && additionalDataRatepay.RatepaydataDueDate == null) + throw new ArgumentNullException(nameof(additionalDataRatepay.RatepaydataDueDate), "Property is required for class AdditionalDataRatepay."); + + if (additionalDataRatepay.RatepaydataInvoiceDateOption.IsSet && additionalDataRatepay.RatepaydataInvoiceDate == null) + throw new ArgumentNullException(nameof(additionalDataRatepay.RatepaydataInvoiceDate), "Property is required for class AdditionalDataRatepay."); + + if (additionalDataRatepay.RatepaydataInvoiceIdOption.IsSet && additionalDataRatepay.RatepaydataInvoiceId == null) + throw new ArgumentNullException(nameof(additionalDataRatepay.RatepaydataInvoiceId), "Property is required for class AdditionalDataRatepay."); + + if (additionalDataRatepay.RatepayInstallmentAmountOption.IsSet) + writer.WriteString("ratepay.installmentAmount", additionalDataRatepay.RatepayInstallmentAmount); + + if (additionalDataRatepay.RatepayInterestRateOption.IsSet) + writer.WriteString("ratepay.interestRate", additionalDataRatepay.RatepayInterestRate); + + if (additionalDataRatepay.RatepayLastInstallmentAmountOption.IsSet) + writer.WriteString("ratepay.lastInstallmentAmount", additionalDataRatepay.RatepayLastInstallmentAmount); + + if (additionalDataRatepay.RatepayPaymentFirstdayOption.IsSet) + writer.WriteString("ratepay.paymentFirstday", additionalDataRatepay.RatepayPaymentFirstday); + + if (additionalDataRatepay.RatepaydataDeliveryDateOption.IsSet) + writer.WriteString("ratepaydata.deliveryDate", additionalDataRatepay.RatepaydataDeliveryDate); + + if (additionalDataRatepay.RatepaydataDueDateOption.IsSet) + writer.WriteString("ratepaydata.dueDate", additionalDataRatepay.RatepaydataDueDate); + + if (additionalDataRatepay.RatepaydataInvoiceDateOption.IsSet) + writer.WriteString("ratepaydata.invoiceDate", additionalDataRatepay.RatepaydataInvoiceDate); + + if (additionalDataRatepay.RatepaydataInvoiceIdOption.IsSet) + writer.WriteString("ratepaydata.invoiceId", additionalDataRatepay.RatepaydataInvoiceId); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataRetry.cs b/Adyen/Model/Checkout/AdditionalDataRetry.cs index 80d25b5b4..e1bd917f8 100644 --- a/Adyen/Model/Checkout/AdditionalDataRetry.cs +++ b/Adyen/Model/Checkout/AdditionalDataRetry.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,56 +14,78 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataRetry /// - [DataContract(Name = "AdditionalDataRetry")] - public partial class AdditionalDataRetry : IEquatable, IValidatableObject + public partial class AdditionalDataRetry : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The number of times the transaction (not order) has been retried between different payment service providers. For instance, the `chainAttemptNumber` set to 2 means that this transaction has been recently tried on another provider before being sent to Adyen. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together.. - /// The index of the attempt to bill a particular order, which is identified by the `merchantOrderReference` field. For example, if a recurring transaction fails and is retried one day later, then the order number for these attempts would be 1 and 2, respectively. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together.. - /// The Boolean value indicating whether Adyen should skip or retry this transaction, if possible. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together.. - public AdditionalDataRetry(string retryChainAttemptNumber = default(string), string retryOrderAttemptNumber = default(string), string retrySkipRetry = default(string)) + /// The number of times the transaction (not order) has been retried between different payment service providers. For instance, the `chainAttemptNumber` set to 2 means that this transaction has been recently tried on another provider before being sent to Adyen. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. + /// The index of the attempt to bill a particular order, which is identified by the `merchantOrderReference` field. For example, if a recurring transaction fails and is retried one day later, then the order number for these attempts would be 1 and 2, respectively. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. + /// The Boolean value indicating whether Adyen should skip or retry this transaction, if possible. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. + [JsonConstructor] + public AdditionalDataRetry(Option retryChainAttemptNumber = default, Option retryOrderAttemptNumber = default, Option retrySkipRetry = default) { - this.RetryChainAttemptNumber = retryChainAttemptNumber; - this.RetryOrderAttemptNumber = retryOrderAttemptNumber; - this.RetrySkipRetry = retrySkipRetry; + RetryChainAttemptNumberOption = retryChainAttemptNumber; + RetryOrderAttemptNumberOption = retryOrderAttemptNumber; + RetrySkipRetryOption = retrySkipRetry; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of RetryChainAttemptNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RetryChainAttemptNumberOption { get; private set; } + /// /// The number of times the transaction (not order) has been retried between different payment service providers. For instance, the `chainAttemptNumber` set to 2 means that this transaction has been recently tried on another provider before being sent to Adyen. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. /// /// The number of times the transaction (not order) has been retried between different payment service providers. For instance, the `chainAttemptNumber` set to 2 means that this transaction has been recently tried on another provider before being sent to Adyen. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. - [DataMember(Name = "retry.chainAttemptNumber", EmitDefaultValue = false)] - public string RetryChainAttemptNumber { get; set; } + [JsonPropertyName("retry.chainAttemptNumber")] + public string RetryChainAttemptNumber { get { return this.RetryChainAttemptNumberOption; } set { this.RetryChainAttemptNumberOption = new Option(value); } } + + /// + /// Used to track the state of RetryOrderAttemptNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RetryOrderAttemptNumberOption { get; private set; } /// /// The index of the attempt to bill a particular order, which is identified by the `merchantOrderReference` field. For example, if a recurring transaction fails and is retried one day later, then the order number for these attempts would be 1 and 2, respectively. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. /// /// The index of the attempt to bill a particular order, which is identified by the `merchantOrderReference` field. For example, if a recurring transaction fails and is retried one day later, then the order number for these attempts would be 1 and 2, respectively. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. - [DataMember(Name = "retry.orderAttemptNumber", EmitDefaultValue = false)] - public string RetryOrderAttemptNumber { get; set; } + [JsonPropertyName("retry.orderAttemptNumber")] + public string RetryOrderAttemptNumber { get { return this.RetryOrderAttemptNumberOption; } set { this.RetryOrderAttemptNumberOption = new Option(value); } } + + /// + /// Used to track the state of RetrySkipRetry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RetrySkipRetryOption { get; private set; } /// /// The Boolean value indicating whether Adyen should skip or retry this transaction, if possible. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. /// /// The Boolean value indicating whether Adyen should skip or retry this transaction, if possible. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. - [DataMember(Name = "retry.skipRetry", EmitDefaultValue = false)] - public string RetrySkipRetry { get; set; } + [JsonPropertyName("retry.skipRetry")] + public string RetrySkipRetry { get { return this.RetrySkipRetryOption; } set { this.RetrySkipRetryOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -82,86 +103,125 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataRetryJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AdditionalDataRetry Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AdditionalDataRetry); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AdditionalDataRetry instances are equal - /// - /// Instance of AdditionalDataRetry to be compared - /// Boolean - public bool Equals(AdditionalDataRetry input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option retryChainAttemptNumber = default; + Option retryOrderAttemptNumber = default; + Option retrySkipRetry = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "retry.chainAttemptNumber": + retryChainAttemptNumber = new Option(utf8JsonReader.GetString()); + break; + case "retry.orderAttemptNumber": + retryOrderAttemptNumber = new Option(utf8JsonReader.GetString()); + break; + case "retry.skipRetry": + retrySkipRetry = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.RetryChainAttemptNumber == input.RetryChainAttemptNumber || - (this.RetryChainAttemptNumber != null && - this.RetryChainAttemptNumber.Equals(input.RetryChainAttemptNumber)) - ) && - ( - this.RetryOrderAttemptNumber == input.RetryOrderAttemptNumber || - (this.RetryOrderAttemptNumber != null && - this.RetryOrderAttemptNumber.Equals(input.RetryOrderAttemptNumber)) - ) && - ( - this.RetrySkipRetry == input.RetrySkipRetry || - (this.RetrySkipRetry != null && - this.RetrySkipRetry.Equals(input.RetrySkipRetry)) - ); + + if (retryChainAttemptNumber.IsSet && retryChainAttemptNumber.Value == null) + throw new ArgumentNullException(nameof(retryChainAttemptNumber), "Property is not nullable for class AdditionalDataRetry."); + + if (retryOrderAttemptNumber.IsSet && retryOrderAttemptNumber.Value == null) + throw new ArgumentNullException(nameof(retryOrderAttemptNumber), "Property is not nullable for class AdditionalDataRetry."); + + if (retrySkipRetry.IsSet && retrySkipRetry.Value == null) + throw new ArgumentNullException(nameof(retrySkipRetry), "Property is not nullable for class AdditionalDataRetry."); + + return new AdditionalDataRetry(retryChainAttemptNumber, retryOrderAttemptNumber, retrySkipRetry); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataRetry additionalDataRetry, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.RetryChainAttemptNumber != null) - { - hashCode = (hashCode * 59) + this.RetryChainAttemptNumber.GetHashCode(); - } - if (this.RetryOrderAttemptNumber != null) - { - hashCode = (hashCode * 59) + this.RetryOrderAttemptNumber.GetHashCode(); - } - if (this.RetrySkipRetry != null) - { - hashCode = (hashCode * 59) + this.RetrySkipRetry.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataRetry, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataRetry additionalDataRetry, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataRetry.RetryChainAttemptNumberOption.IsSet && additionalDataRetry.RetryChainAttemptNumber == null) + throw new ArgumentNullException(nameof(additionalDataRetry.RetryChainAttemptNumber), "Property is required for class AdditionalDataRetry."); + + if (additionalDataRetry.RetryOrderAttemptNumberOption.IsSet && additionalDataRetry.RetryOrderAttemptNumber == null) + throw new ArgumentNullException(nameof(additionalDataRetry.RetryOrderAttemptNumber), "Property is required for class AdditionalDataRetry."); + + if (additionalDataRetry.RetrySkipRetryOption.IsSet && additionalDataRetry.RetrySkipRetry == null) + throw new ArgumentNullException(nameof(additionalDataRetry.RetrySkipRetry), "Property is required for class AdditionalDataRetry."); + + if (additionalDataRetry.RetryChainAttemptNumberOption.IsSet) + writer.WriteString("retry.chainAttemptNumber", additionalDataRetry.RetryChainAttemptNumber); + + if (additionalDataRetry.RetryOrderAttemptNumberOption.IsSet) + writer.WriteString("retry.orderAttemptNumber", additionalDataRetry.RetryOrderAttemptNumber); + + if (additionalDataRetry.RetrySkipRetryOption.IsSet) + writer.WriteString("retry.skipRetry", additionalDataRetry.RetrySkipRetry); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataRisk.cs b/Adyen/Model/Checkout/AdditionalDataRisk.cs index 734fff71c..7112d3982 100644 --- a/Adyen/Model/Checkout/AdditionalDataRisk.cs +++ b/Adyen/Model/Checkout/AdditionalDataRisk.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,218 +14,366 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataRisk /// - [DataContract(Name = "AdditionalDataRisk")] - public partial class AdditionalDataRisk : IEquatable, IValidatableObject + public partial class AdditionalDataRisk : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The data for your custom risk field. For more information, refer to [Create custom risk fields](https://docs.adyen.com/risk-management/configure-custom-risk-rules#step-1-create-custom-risk-fields).. - /// The price of item in the basket, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes).. - /// Brand of the item.. - /// Category of the item.. - /// Color of the item.. - /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217).. - /// ID of the item.. - /// Manufacturer of the item.. - /// A text description of the product the invoice line refers to.. - /// Quantity of the item purchased.. - /// Email associated with the given product in the basket (usually in electronic gift cards).. - /// Size of the item.. - /// [Stock keeping unit](https://en.wikipedia.org/wiki/Stock_keeping_unit).. - /// [Universal Product Code](https://en.wikipedia.org/wiki/Universal_Product_Code).. - /// Code of the promotion.. - /// The discount amount of the promotion, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes).. - /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217).. - /// Promotion's percentage discount. It is represented in percentage value and there is no need to include the '%' sign. e.g. for a promotion discount of 30%, the value of the field should be 30.. - /// Name of the promotion.. - /// Reference number of the risk profile that you want to apply to the payment. If not provided or left blank, the merchant-level account's default risk profile will be applied to the payment. For more information, see [dynamically assign a risk profile to a payment](https://docs.adyen.com/risk-management/create-and-use-risk-profiles#dynamically-assign-a-risk-profile-to-a-payment).. - /// If this parameter is provided with the value **true**, risk checks for the payment request are skipped and the transaction will not get a risk score.. - public AdditionalDataRisk(string riskdataCustomFieldName = default(string), string riskdataBasketItemItemNrAmountPerItem = default(string), string riskdataBasketItemItemNrBrand = default(string), string riskdataBasketItemItemNrCategory = default(string), string riskdataBasketItemItemNrColor = default(string), string riskdataBasketItemItemNrCurrency = default(string), string riskdataBasketItemItemNrItemID = default(string), string riskdataBasketItemItemNrManufacturer = default(string), string riskdataBasketItemItemNrProductTitle = default(string), string riskdataBasketItemItemNrQuantity = default(string), string riskdataBasketItemItemNrReceiverEmail = default(string), string riskdataBasketItemItemNrSize = default(string), string riskdataBasketItemItemNrSku = default(string), string riskdataBasketItemItemNrUpc = default(string), string riskdataPromotionsPromotionItemNrPromotionCode = default(string), string riskdataPromotionsPromotionItemNrPromotionDiscountAmount = default(string), string riskdataPromotionsPromotionItemNrPromotionDiscountCurrency = default(string), string riskdataPromotionsPromotionItemNrPromotionDiscountPercentage = default(string), string riskdataPromotionsPromotionItemNrPromotionName = default(string), string riskdataRiskProfileReference = default(string), string riskdataSkipRisk = default(string)) + /// The data for your custom risk field. For more information, refer to [Create custom risk fields](https://docs.adyen.com/risk-management/configure-custom-risk-rules#step-1-create-custom-risk-fields). + /// The price of item in the basket, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). + /// Brand of the item. + /// Category of the item. + /// Color of the item. + /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). + /// ID of the item. + /// Manufacturer of the item. + /// A text description of the product the invoice line refers to. + /// Quantity of the item purchased. + /// Email associated with the given product in the basket (usually in electronic gift cards). + /// Size of the item. + /// [Stock keeping unit](https://en.wikipedia.org/wiki/Stock_keeping_unit). + /// [Universal Product Code](https://en.wikipedia.org/wiki/Universal_Product_Code). + /// Code of the promotion. + /// The discount amount of the promotion, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). + /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). + /// Promotion's percentage discount. It is represented in percentage value and there is no need to include the '%' sign. e.g. for a promotion discount of 30%, the value of the field should be 30. + /// Name of the promotion. + /// Reference number of the risk profile that you want to apply to the payment. If not provided or left blank, the merchant-level account's default risk profile will be applied to the payment. For more information, see [dynamically assign a risk profile to a payment](https://docs.adyen.com/risk-management/create-and-use-risk-profiles#dynamically-assign-a-risk-profile-to-a-payment). + /// If this parameter is provided with the value **true**, risk checks for the payment request are skipped and the transaction will not get a risk score. + [JsonConstructor] + public AdditionalDataRisk(Option riskdataCustomFieldName = default, Option riskdataBasketItemItemNrAmountPerItem = default, Option riskdataBasketItemItemNrBrand = default, Option riskdataBasketItemItemNrCategory = default, Option riskdataBasketItemItemNrColor = default, Option riskdataBasketItemItemNrCurrency = default, Option riskdataBasketItemItemNrItemID = default, Option riskdataBasketItemItemNrManufacturer = default, Option riskdataBasketItemItemNrProductTitle = default, Option riskdataBasketItemItemNrQuantity = default, Option riskdataBasketItemItemNrReceiverEmail = default, Option riskdataBasketItemItemNrSize = default, Option riskdataBasketItemItemNrSku = default, Option riskdataBasketItemItemNrUpc = default, Option riskdataPromotionsPromotionItemNrPromotionCode = default, Option riskdataPromotionsPromotionItemNrPromotionDiscountAmount = default, Option riskdataPromotionsPromotionItemNrPromotionDiscountCurrency = default, Option riskdataPromotionsPromotionItemNrPromotionDiscountPercentage = default, Option riskdataPromotionsPromotionItemNrPromotionName = default, Option riskdataRiskProfileReference = default, Option riskdataSkipRisk = default) { - this.RiskdataCustomFieldName = riskdataCustomFieldName; - this.RiskdataBasketItemItemNrAmountPerItem = riskdataBasketItemItemNrAmountPerItem; - this.RiskdataBasketItemItemNrBrand = riskdataBasketItemItemNrBrand; - this.RiskdataBasketItemItemNrCategory = riskdataBasketItemItemNrCategory; - this.RiskdataBasketItemItemNrColor = riskdataBasketItemItemNrColor; - this.RiskdataBasketItemItemNrCurrency = riskdataBasketItemItemNrCurrency; - this.RiskdataBasketItemItemNrItemID = riskdataBasketItemItemNrItemID; - this.RiskdataBasketItemItemNrManufacturer = riskdataBasketItemItemNrManufacturer; - this.RiskdataBasketItemItemNrProductTitle = riskdataBasketItemItemNrProductTitle; - this.RiskdataBasketItemItemNrQuantity = riskdataBasketItemItemNrQuantity; - this.RiskdataBasketItemItemNrReceiverEmail = riskdataBasketItemItemNrReceiverEmail; - this.RiskdataBasketItemItemNrSize = riskdataBasketItemItemNrSize; - this.RiskdataBasketItemItemNrSku = riskdataBasketItemItemNrSku; - this.RiskdataBasketItemItemNrUpc = riskdataBasketItemItemNrUpc; - this.RiskdataPromotionsPromotionItemNrPromotionCode = riskdataPromotionsPromotionItemNrPromotionCode; - this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount = riskdataPromotionsPromotionItemNrPromotionDiscountAmount; - this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency = riskdataPromotionsPromotionItemNrPromotionDiscountCurrency; - this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage = riskdataPromotionsPromotionItemNrPromotionDiscountPercentage; - this.RiskdataPromotionsPromotionItemNrPromotionName = riskdataPromotionsPromotionItemNrPromotionName; - this.RiskdataRiskProfileReference = riskdataRiskProfileReference; - this.RiskdataSkipRisk = riskdataSkipRisk; + RiskdataCustomFieldNameOption = riskdataCustomFieldName; + RiskdataBasketItemItemNrAmountPerItemOption = riskdataBasketItemItemNrAmountPerItem; + RiskdataBasketItemItemNrBrandOption = riskdataBasketItemItemNrBrand; + RiskdataBasketItemItemNrCategoryOption = riskdataBasketItemItemNrCategory; + RiskdataBasketItemItemNrColorOption = riskdataBasketItemItemNrColor; + RiskdataBasketItemItemNrCurrencyOption = riskdataBasketItemItemNrCurrency; + RiskdataBasketItemItemNrItemIDOption = riskdataBasketItemItemNrItemID; + RiskdataBasketItemItemNrManufacturerOption = riskdataBasketItemItemNrManufacturer; + RiskdataBasketItemItemNrProductTitleOption = riskdataBasketItemItemNrProductTitle; + RiskdataBasketItemItemNrQuantityOption = riskdataBasketItemItemNrQuantity; + RiskdataBasketItemItemNrReceiverEmailOption = riskdataBasketItemItemNrReceiverEmail; + RiskdataBasketItemItemNrSizeOption = riskdataBasketItemItemNrSize; + RiskdataBasketItemItemNrSkuOption = riskdataBasketItemItemNrSku; + RiskdataBasketItemItemNrUpcOption = riskdataBasketItemItemNrUpc; + RiskdataPromotionsPromotionItemNrPromotionCodeOption = riskdataPromotionsPromotionItemNrPromotionCode; + RiskdataPromotionsPromotionItemNrPromotionDiscountAmountOption = riskdataPromotionsPromotionItemNrPromotionDiscountAmount; + RiskdataPromotionsPromotionItemNrPromotionDiscountCurrencyOption = riskdataPromotionsPromotionItemNrPromotionDiscountCurrency; + RiskdataPromotionsPromotionItemNrPromotionDiscountPercentageOption = riskdataPromotionsPromotionItemNrPromotionDiscountPercentage; + RiskdataPromotionsPromotionItemNrPromotionNameOption = riskdataPromotionsPromotionItemNrPromotionName; + RiskdataRiskProfileReferenceOption = riskdataRiskProfileReference; + RiskdataSkipRiskOption = riskdataSkipRisk; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of RiskdataCustomFieldName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataCustomFieldNameOption { get; private set; } + /// /// The data for your custom risk field. For more information, refer to [Create custom risk fields](https://docs.adyen.com/risk-management/configure-custom-risk-rules#step-1-create-custom-risk-fields). /// /// The data for your custom risk field. For more information, refer to [Create custom risk fields](https://docs.adyen.com/risk-management/configure-custom-risk-rules#step-1-create-custom-risk-fields). - [DataMember(Name = "riskdata.[customFieldName]", EmitDefaultValue = false)] - public string RiskdataCustomFieldName { get; set; } + [JsonPropertyName("riskdata.[customFieldName]")] + public string RiskdataCustomFieldName { get { return this.RiskdataCustomFieldNameOption; } set { this.RiskdataCustomFieldNameOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataBasketItemItemNrAmountPerItem + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataBasketItemItemNrAmountPerItemOption { get; private set; } /// /// The price of item in the basket, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). /// /// The price of item in the basket, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). - [DataMember(Name = "riskdata.basket.item[itemNr].amountPerItem", EmitDefaultValue = false)] - public string RiskdataBasketItemItemNrAmountPerItem { get; set; } + [JsonPropertyName("riskdata.basket.item[itemNr].amountPerItem")] + public string RiskdataBasketItemItemNrAmountPerItem { get { return this.RiskdataBasketItemItemNrAmountPerItemOption; } set { this.RiskdataBasketItemItemNrAmountPerItemOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataBasketItemItemNrBrand + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataBasketItemItemNrBrandOption { get; private set; } /// /// Brand of the item. /// /// Brand of the item. - [DataMember(Name = "riskdata.basket.item[itemNr].brand", EmitDefaultValue = false)] - public string RiskdataBasketItemItemNrBrand { get; set; } + [JsonPropertyName("riskdata.basket.item[itemNr].brand")] + public string RiskdataBasketItemItemNrBrand { get { return this.RiskdataBasketItemItemNrBrandOption; } set { this.RiskdataBasketItemItemNrBrandOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataBasketItemItemNrCategory + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataBasketItemItemNrCategoryOption { get; private set; } /// /// Category of the item. /// /// Category of the item. - [DataMember(Name = "riskdata.basket.item[itemNr].category", EmitDefaultValue = false)] - public string RiskdataBasketItemItemNrCategory { get; set; } + [JsonPropertyName("riskdata.basket.item[itemNr].category")] + public string RiskdataBasketItemItemNrCategory { get { return this.RiskdataBasketItemItemNrCategoryOption; } set { this.RiskdataBasketItemItemNrCategoryOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataBasketItemItemNrColor + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataBasketItemItemNrColorOption { get; private set; } /// /// Color of the item. /// /// Color of the item. - [DataMember(Name = "riskdata.basket.item[itemNr].color", EmitDefaultValue = false)] - public string RiskdataBasketItemItemNrColor { get; set; } + [JsonPropertyName("riskdata.basket.item[itemNr].color")] + public string RiskdataBasketItemItemNrColor { get { return this.RiskdataBasketItemItemNrColorOption; } set { this.RiskdataBasketItemItemNrColorOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataBasketItemItemNrCurrency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataBasketItemItemNrCurrencyOption { get; private set; } /// /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). /// /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). - [DataMember(Name = "riskdata.basket.item[itemNr].currency", EmitDefaultValue = false)] - public string RiskdataBasketItemItemNrCurrency { get; set; } + [JsonPropertyName("riskdata.basket.item[itemNr].currency")] + public string RiskdataBasketItemItemNrCurrency { get { return this.RiskdataBasketItemItemNrCurrencyOption; } set { this.RiskdataBasketItemItemNrCurrencyOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataBasketItemItemNrItemID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataBasketItemItemNrItemIDOption { get; private set; } /// /// ID of the item. /// /// ID of the item. - [DataMember(Name = "riskdata.basket.item[itemNr].itemID", EmitDefaultValue = false)] - public string RiskdataBasketItemItemNrItemID { get; set; } + [JsonPropertyName("riskdata.basket.item[itemNr].itemID")] + public string RiskdataBasketItemItemNrItemID { get { return this.RiskdataBasketItemItemNrItemIDOption; } set { this.RiskdataBasketItemItemNrItemIDOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataBasketItemItemNrManufacturer + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataBasketItemItemNrManufacturerOption { get; private set; } /// /// Manufacturer of the item. /// /// Manufacturer of the item. - [DataMember(Name = "riskdata.basket.item[itemNr].manufacturer", EmitDefaultValue = false)] - public string RiskdataBasketItemItemNrManufacturer { get; set; } + [JsonPropertyName("riskdata.basket.item[itemNr].manufacturer")] + public string RiskdataBasketItemItemNrManufacturer { get { return this.RiskdataBasketItemItemNrManufacturerOption; } set { this.RiskdataBasketItemItemNrManufacturerOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataBasketItemItemNrProductTitle + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataBasketItemItemNrProductTitleOption { get; private set; } /// /// A text description of the product the invoice line refers to. /// /// A text description of the product the invoice line refers to. - [DataMember(Name = "riskdata.basket.item[itemNr].productTitle", EmitDefaultValue = false)] - public string RiskdataBasketItemItemNrProductTitle { get; set; } + [JsonPropertyName("riskdata.basket.item[itemNr].productTitle")] + public string RiskdataBasketItemItemNrProductTitle { get { return this.RiskdataBasketItemItemNrProductTitleOption; } set { this.RiskdataBasketItemItemNrProductTitleOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataBasketItemItemNrQuantity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataBasketItemItemNrQuantityOption { get; private set; } /// /// Quantity of the item purchased. /// /// Quantity of the item purchased. - [DataMember(Name = "riskdata.basket.item[itemNr].quantity", EmitDefaultValue = false)] - public string RiskdataBasketItemItemNrQuantity { get; set; } + [JsonPropertyName("riskdata.basket.item[itemNr].quantity")] + public string RiskdataBasketItemItemNrQuantity { get { return this.RiskdataBasketItemItemNrQuantityOption; } set { this.RiskdataBasketItemItemNrQuantityOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataBasketItemItemNrReceiverEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataBasketItemItemNrReceiverEmailOption { get; private set; } /// /// Email associated with the given product in the basket (usually in electronic gift cards). /// /// Email associated with the given product in the basket (usually in electronic gift cards). - [DataMember(Name = "riskdata.basket.item[itemNr].receiverEmail", EmitDefaultValue = false)] - public string RiskdataBasketItemItemNrReceiverEmail { get; set; } + [JsonPropertyName("riskdata.basket.item[itemNr].receiverEmail")] + public string RiskdataBasketItemItemNrReceiverEmail { get { return this.RiskdataBasketItemItemNrReceiverEmailOption; } set { this.RiskdataBasketItemItemNrReceiverEmailOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataBasketItemItemNrSize + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataBasketItemItemNrSizeOption { get; private set; } /// /// Size of the item. /// /// Size of the item. - [DataMember(Name = "riskdata.basket.item[itemNr].size", EmitDefaultValue = false)] - public string RiskdataBasketItemItemNrSize { get; set; } + [JsonPropertyName("riskdata.basket.item[itemNr].size")] + public string RiskdataBasketItemItemNrSize { get { return this.RiskdataBasketItemItemNrSizeOption; } set { this.RiskdataBasketItemItemNrSizeOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataBasketItemItemNrSku + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataBasketItemItemNrSkuOption { get; private set; } /// /// [Stock keeping unit](https://en.wikipedia.org/wiki/Stock_keeping_unit). /// /// [Stock keeping unit](https://en.wikipedia.org/wiki/Stock_keeping_unit). - [DataMember(Name = "riskdata.basket.item[itemNr].sku", EmitDefaultValue = false)] - public string RiskdataBasketItemItemNrSku { get; set; } + [JsonPropertyName("riskdata.basket.item[itemNr].sku")] + public string RiskdataBasketItemItemNrSku { get { return this.RiskdataBasketItemItemNrSkuOption; } set { this.RiskdataBasketItemItemNrSkuOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataBasketItemItemNrUpc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataBasketItemItemNrUpcOption { get; private set; } /// /// [Universal Product Code](https://en.wikipedia.org/wiki/Universal_Product_Code). /// /// [Universal Product Code](https://en.wikipedia.org/wiki/Universal_Product_Code). - [DataMember(Name = "riskdata.basket.item[itemNr].upc", EmitDefaultValue = false)] - public string RiskdataBasketItemItemNrUpc { get; set; } + [JsonPropertyName("riskdata.basket.item[itemNr].upc")] + public string RiskdataBasketItemItemNrUpc { get { return this.RiskdataBasketItemItemNrUpcOption; } set { this.RiskdataBasketItemItemNrUpcOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataPromotionsPromotionItemNrPromotionCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataPromotionsPromotionItemNrPromotionCodeOption { get; private set; } /// /// Code of the promotion. /// /// Code of the promotion. - [DataMember(Name = "riskdata.promotions.promotion[itemNr].promotionCode", EmitDefaultValue = false)] - public string RiskdataPromotionsPromotionItemNrPromotionCode { get; set; } + [JsonPropertyName("riskdata.promotions.promotion[itemNr].promotionCode")] + public string RiskdataPromotionsPromotionItemNrPromotionCode { get { return this.RiskdataPromotionsPromotionItemNrPromotionCodeOption; } set { this.RiskdataPromotionsPromotionItemNrPromotionCodeOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataPromotionsPromotionItemNrPromotionDiscountAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataPromotionsPromotionItemNrPromotionDiscountAmountOption { get; private set; } /// /// The discount amount of the promotion, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). /// /// The discount amount of the promotion, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). - [DataMember(Name = "riskdata.promotions.promotion[itemNr].promotionDiscountAmount", EmitDefaultValue = false)] - public string RiskdataPromotionsPromotionItemNrPromotionDiscountAmount { get; set; } + [JsonPropertyName("riskdata.promotions.promotion[itemNr].promotionDiscountAmount")] + public string RiskdataPromotionsPromotionItemNrPromotionDiscountAmount { get { return this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmountOption; } set { this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmountOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataPromotionsPromotionItemNrPromotionDiscountCurrencyOption { get; private set; } /// /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). /// /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). - [DataMember(Name = "riskdata.promotions.promotion[itemNr].promotionDiscountCurrency", EmitDefaultValue = false)] - public string RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency { get; set; } + [JsonPropertyName("riskdata.promotions.promotion[itemNr].promotionDiscountCurrency")] + public string RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency { get { return this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrencyOption; } set { this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrencyOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataPromotionsPromotionItemNrPromotionDiscountPercentageOption { get; private set; } /// /// Promotion's percentage discount. It is represented in percentage value and there is no need to include the '%' sign. e.g. for a promotion discount of 30%, the value of the field should be 30. /// /// Promotion's percentage discount. It is represented in percentage value and there is no need to include the '%' sign. e.g. for a promotion discount of 30%, the value of the field should be 30. - [DataMember(Name = "riskdata.promotions.promotion[itemNr].promotionDiscountPercentage", EmitDefaultValue = false)] - public string RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage { get; set; } + [JsonPropertyName("riskdata.promotions.promotion[itemNr].promotionDiscountPercentage")] + public string RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage { get { return this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentageOption; } set { this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentageOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataPromotionsPromotionItemNrPromotionName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataPromotionsPromotionItemNrPromotionNameOption { get; private set; } /// /// Name of the promotion. /// /// Name of the promotion. - [DataMember(Name = "riskdata.promotions.promotion[itemNr].promotionName", EmitDefaultValue = false)] - public string RiskdataPromotionsPromotionItemNrPromotionName { get; set; } + [JsonPropertyName("riskdata.promotions.promotion[itemNr].promotionName")] + public string RiskdataPromotionsPromotionItemNrPromotionName { get { return this.RiskdataPromotionsPromotionItemNrPromotionNameOption; } set { this.RiskdataPromotionsPromotionItemNrPromotionNameOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataRiskProfileReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataRiskProfileReferenceOption { get; private set; } /// /// Reference number of the risk profile that you want to apply to the payment. If not provided or left blank, the merchant-level account's default risk profile will be applied to the payment. For more information, see [dynamically assign a risk profile to a payment](https://docs.adyen.com/risk-management/create-and-use-risk-profiles#dynamically-assign-a-risk-profile-to-a-payment). /// /// Reference number of the risk profile that you want to apply to the payment. If not provided or left blank, the merchant-level account's default risk profile will be applied to the payment. For more information, see [dynamically assign a risk profile to a payment](https://docs.adyen.com/risk-management/create-and-use-risk-profiles#dynamically-assign-a-risk-profile-to-a-payment). - [DataMember(Name = "riskdata.riskProfileReference", EmitDefaultValue = false)] - public string RiskdataRiskProfileReference { get; set; } + [JsonPropertyName("riskdata.riskProfileReference")] + public string RiskdataRiskProfileReference { get { return this.RiskdataRiskProfileReferenceOption; } set { this.RiskdataRiskProfileReferenceOption = new Option(value); } } + + /// + /// Used to track the state of RiskdataSkipRisk + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskdataSkipRiskOption { get; private set; } /// /// If this parameter is provided with the value **true**, risk checks for the payment request are skipped and the transaction will not get a risk score. /// /// If this parameter is provided with the value **true**, risk checks for the payment request are skipped and the transaction will not get a risk score. - [DataMember(Name = "riskdata.skipRisk", EmitDefaultValue = false)] - public string RiskdataSkipRisk { get; set; } + [JsonPropertyName("riskdata.skipRisk")] + public string RiskdataSkipRisk { get { return this.RiskdataSkipRiskOption; } set { this.RiskdataSkipRiskOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -262,248 +409,359 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataRiskJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AdditionalDataRisk Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AdditionalDataRisk); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AdditionalDataRisk instances are equal - /// - /// Instance of AdditionalDataRisk to be compared - /// Boolean - public bool Equals(AdditionalDataRisk input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option riskdataCustomFieldName = default; + Option riskdataBasketItemItemNrAmountPerItem = default; + Option riskdataBasketItemItemNrBrand = default; + Option riskdataBasketItemItemNrCategory = default; + Option riskdataBasketItemItemNrColor = default; + Option riskdataBasketItemItemNrCurrency = default; + Option riskdataBasketItemItemNrItemID = default; + Option riskdataBasketItemItemNrManufacturer = default; + Option riskdataBasketItemItemNrProductTitle = default; + Option riskdataBasketItemItemNrQuantity = default; + Option riskdataBasketItemItemNrReceiverEmail = default; + Option riskdataBasketItemItemNrSize = default; + Option riskdataBasketItemItemNrSku = default; + Option riskdataBasketItemItemNrUpc = default; + Option riskdataPromotionsPromotionItemNrPromotionCode = default; + Option riskdataPromotionsPromotionItemNrPromotionDiscountAmount = default; + Option riskdataPromotionsPromotionItemNrPromotionDiscountCurrency = default; + Option riskdataPromotionsPromotionItemNrPromotionDiscountPercentage = default; + Option riskdataPromotionsPromotionItemNrPromotionName = default; + Option riskdataRiskProfileReference = default; + Option riskdataSkipRisk = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "riskdata.[customFieldName]": + riskdataCustomFieldName = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.basket.item[itemNr].amountPerItem": + riskdataBasketItemItemNrAmountPerItem = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.basket.item[itemNr].brand": + riskdataBasketItemItemNrBrand = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.basket.item[itemNr].category": + riskdataBasketItemItemNrCategory = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.basket.item[itemNr].color": + riskdataBasketItemItemNrColor = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.basket.item[itemNr].currency": + riskdataBasketItemItemNrCurrency = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.basket.item[itemNr].itemID": + riskdataBasketItemItemNrItemID = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.basket.item[itemNr].manufacturer": + riskdataBasketItemItemNrManufacturer = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.basket.item[itemNr].productTitle": + riskdataBasketItemItemNrProductTitle = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.basket.item[itemNr].quantity": + riskdataBasketItemItemNrQuantity = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.basket.item[itemNr].receiverEmail": + riskdataBasketItemItemNrReceiverEmail = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.basket.item[itemNr].size": + riskdataBasketItemItemNrSize = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.basket.item[itemNr].sku": + riskdataBasketItemItemNrSku = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.basket.item[itemNr].upc": + riskdataBasketItemItemNrUpc = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.promotions.promotion[itemNr].promotionCode": + riskdataPromotionsPromotionItemNrPromotionCode = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.promotions.promotion[itemNr].promotionDiscountAmount": + riskdataPromotionsPromotionItemNrPromotionDiscountAmount = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.promotions.promotion[itemNr].promotionDiscountCurrency": + riskdataPromotionsPromotionItemNrPromotionDiscountCurrency = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.promotions.promotion[itemNr].promotionDiscountPercentage": + riskdataPromotionsPromotionItemNrPromotionDiscountPercentage = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.promotions.promotion[itemNr].promotionName": + riskdataPromotionsPromotionItemNrPromotionName = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.riskProfileReference": + riskdataRiskProfileReference = new Option(utf8JsonReader.GetString()); + break; + case "riskdata.skipRisk": + riskdataSkipRisk = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.RiskdataCustomFieldName == input.RiskdataCustomFieldName || - (this.RiskdataCustomFieldName != null && - this.RiskdataCustomFieldName.Equals(input.RiskdataCustomFieldName)) - ) && - ( - this.RiskdataBasketItemItemNrAmountPerItem == input.RiskdataBasketItemItemNrAmountPerItem || - (this.RiskdataBasketItemItemNrAmountPerItem != null && - this.RiskdataBasketItemItemNrAmountPerItem.Equals(input.RiskdataBasketItemItemNrAmountPerItem)) - ) && - ( - this.RiskdataBasketItemItemNrBrand == input.RiskdataBasketItemItemNrBrand || - (this.RiskdataBasketItemItemNrBrand != null && - this.RiskdataBasketItemItemNrBrand.Equals(input.RiskdataBasketItemItemNrBrand)) - ) && - ( - this.RiskdataBasketItemItemNrCategory == input.RiskdataBasketItemItemNrCategory || - (this.RiskdataBasketItemItemNrCategory != null && - this.RiskdataBasketItemItemNrCategory.Equals(input.RiskdataBasketItemItemNrCategory)) - ) && - ( - this.RiskdataBasketItemItemNrColor == input.RiskdataBasketItemItemNrColor || - (this.RiskdataBasketItemItemNrColor != null && - this.RiskdataBasketItemItemNrColor.Equals(input.RiskdataBasketItemItemNrColor)) - ) && - ( - this.RiskdataBasketItemItemNrCurrency == input.RiskdataBasketItemItemNrCurrency || - (this.RiskdataBasketItemItemNrCurrency != null && - this.RiskdataBasketItemItemNrCurrency.Equals(input.RiskdataBasketItemItemNrCurrency)) - ) && - ( - this.RiskdataBasketItemItemNrItemID == input.RiskdataBasketItemItemNrItemID || - (this.RiskdataBasketItemItemNrItemID != null && - this.RiskdataBasketItemItemNrItemID.Equals(input.RiskdataBasketItemItemNrItemID)) - ) && - ( - this.RiskdataBasketItemItemNrManufacturer == input.RiskdataBasketItemItemNrManufacturer || - (this.RiskdataBasketItemItemNrManufacturer != null && - this.RiskdataBasketItemItemNrManufacturer.Equals(input.RiskdataBasketItemItemNrManufacturer)) - ) && - ( - this.RiskdataBasketItemItemNrProductTitle == input.RiskdataBasketItemItemNrProductTitle || - (this.RiskdataBasketItemItemNrProductTitle != null && - this.RiskdataBasketItemItemNrProductTitle.Equals(input.RiskdataBasketItemItemNrProductTitle)) - ) && - ( - this.RiskdataBasketItemItemNrQuantity == input.RiskdataBasketItemItemNrQuantity || - (this.RiskdataBasketItemItemNrQuantity != null && - this.RiskdataBasketItemItemNrQuantity.Equals(input.RiskdataBasketItemItemNrQuantity)) - ) && - ( - this.RiskdataBasketItemItemNrReceiverEmail == input.RiskdataBasketItemItemNrReceiverEmail || - (this.RiskdataBasketItemItemNrReceiverEmail != null && - this.RiskdataBasketItemItemNrReceiverEmail.Equals(input.RiskdataBasketItemItemNrReceiverEmail)) - ) && - ( - this.RiskdataBasketItemItemNrSize == input.RiskdataBasketItemItemNrSize || - (this.RiskdataBasketItemItemNrSize != null && - this.RiskdataBasketItemItemNrSize.Equals(input.RiskdataBasketItemItemNrSize)) - ) && - ( - this.RiskdataBasketItemItemNrSku == input.RiskdataBasketItemItemNrSku || - (this.RiskdataBasketItemItemNrSku != null && - this.RiskdataBasketItemItemNrSku.Equals(input.RiskdataBasketItemItemNrSku)) - ) && - ( - this.RiskdataBasketItemItemNrUpc == input.RiskdataBasketItemItemNrUpc || - (this.RiskdataBasketItemItemNrUpc != null && - this.RiskdataBasketItemItemNrUpc.Equals(input.RiskdataBasketItemItemNrUpc)) - ) && - ( - this.RiskdataPromotionsPromotionItemNrPromotionCode == input.RiskdataPromotionsPromotionItemNrPromotionCode || - (this.RiskdataPromotionsPromotionItemNrPromotionCode != null && - this.RiskdataPromotionsPromotionItemNrPromotionCode.Equals(input.RiskdataPromotionsPromotionItemNrPromotionCode)) - ) && - ( - this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount == input.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount || - (this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount != null && - this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount.Equals(input.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount)) - ) && - ( - this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency == input.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency || - (this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency != null && - this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency.Equals(input.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency)) - ) && - ( - this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage == input.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage || - (this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage != null && - this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage.Equals(input.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage)) - ) && - ( - this.RiskdataPromotionsPromotionItemNrPromotionName == input.RiskdataPromotionsPromotionItemNrPromotionName || - (this.RiskdataPromotionsPromotionItemNrPromotionName != null && - this.RiskdataPromotionsPromotionItemNrPromotionName.Equals(input.RiskdataPromotionsPromotionItemNrPromotionName)) - ) && - ( - this.RiskdataRiskProfileReference == input.RiskdataRiskProfileReference || - (this.RiskdataRiskProfileReference != null && - this.RiskdataRiskProfileReference.Equals(input.RiskdataRiskProfileReference)) - ) && - ( - this.RiskdataSkipRisk == input.RiskdataSkipRisk || - (this.RiskdataSkipRisk != null && - this.RiskdataSkipRisk.Equals(input.RiskdataSkipRisk)) - ); + + if (riskdataCustomFieldName.IsSet && riskdataCustomFieldName.Value == null) + throw new ArgumentNullException(nameof(riskdataCustomFieldName), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataBasketItemItemNrAmountPerItem.IsSet && riskdataBasketItemItemNrAmountPerItem.Value == null) + throw new ArgumentNullException(nameof(riskdataBasketItemItemNrAmountPerItem), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataBasketItemItemNrBrand.IsSet && riskdataBasketItemItemNrBrand.Value == null) + throw new ArgumentNullException(nameof(riskdataBasketItemItemNrBrand), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataBasketItemItemNrCategory.IsSet && riskdataBasketItemItemNrCategory.Value == null) + throw new ArgumentNullException(nameof(riskdataBasketItemItemNrCategory), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataBasketItemItemNrColor.IsSet && riskdataBasketItemItemNrColor.Value == null) + throw new ArgumentNullException(nameof(riskdataBasketItemItemNrColor), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataBasketItemItemNrCurrency.IsSet && riskdataBasketItemItemNrCurrency.Value == null) + throw new ArgumentNullException(nameof(riskdataBasketItemItemNrCurrency), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataBasketItemItemNrItemID.IsSet && riskdataBasketItemItemNrItemID.Value == null) + throw new ArgumentNullException(nameof(riskdataBasketItemItemNrItemID), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataBasketItemItemNrManufacturer.IsSet && riskdataBasketItemItemNrManufacturer.Value == null) + throw new ArgumentNullException(nameof(riskdataBasketItemItemNrManufacturer), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataBasketItemItemNrProductTitle.IsSet && riskdataBasketItemItemNrProductTitle.Value == null) + throw new ArgumentNullException(nameof(riskdataBasketItemItemNrProductTitle), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataBasketItemItemNrQuantity.IsSet && riskdataBasketItemItemNrQuantity.Value == null) + throw new ArgumentNullException(nameof(riskdataBasketItemItemNrQuantity), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataBasketItemItemNrReceiverEmail.IsSet && riskdataBasketItemItemNrReceiverEmail.Value == null) + throw new ArgumentNullException(nameof(riskdataBasketItemItemNrReceiverEmail), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataBasketItemItemNrSize.IsSet && riskdataBasketItemItemNrSize.Value == null) + throw new ArgumentNullException(nameof(riskdataBasketItemItemNrSize), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataBasketItemItemNrSku.IsSet && riskdataBasketItemItemNrSku.Value == null) + throw new ArgumentNullException(nameof(riskdataBasketItemItemNrSku), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataBasketItemItemNrUpc.IsSet && riskdataBasketItemItemNrUpc.Value == null) + throw new ArgumentNullException(nameof(riskdataBasketItemItemNrUpc), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataPromotionsPromotionItemNrPromotionCode.IsSet && riskdataPromotionsPromotionItemNrPromotionCode.Value == null) + throw new ArgumentNullException(nameof(riskdataPromotionsPromotionItemNrPromotionCode), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataPromotionsPromotionItemNrPromotionDiscountAmount.IsSet && riskdataPromotionsPromotionItemNrPromotionDiscountAmount.Value == null) + throw new ArgumentNullException(nameof(riskdataPromotionsPromotionItemNrPromotionDiscountAmount), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataPromotionsPromotionItemNrPromotionDiscountCurrency.IsSet && riskdataPromotionsPromotionItemNrPromotionDiscountCurrency.Value == null) + throw new ArgumentNullException(nameof(riskdataPromotionsPromotionItemNrPromotionDiscountCurrency), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataPromotionsPromotionItemNrPromotionDiscountPercentage.IsSet && riskdataPromotionsPromotionItemNrPromotionDiscountPercentage.Value == null) + throw new ArgumentNullException(nameof(riskdataPromotionsPromotionItemNrPromotionDiscountPercentage), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataPromotionsPromotionItemNrPromotionName.IsSet && riskdataPromotionsPromotionItemNrPromotionName.Value == null) + throw new ArgumentNullException(nameof(riskdataPromotionsPromotionItemNrPromotionName), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataRiskProfileReference.IsSet && riskdataRiskProfileReference.Value == null) + throw new ArgumentNullException(nameof(riskdataRiskProfileReference), "Property is not nullable for class AdditionalDataRisk."); + + if (riskdataSkipRisk.IsSet && riskdataSkipRisk.Value == null) + throw new ArgumentNullException(nameof(riskdataSkipRisk), "Property is not nullable for class AdditionalDataRisk."); + + return new AdditionalDataRisk(riskdataCustomFieldName, riskdataBasketItemItemNrAmountPerItem, riskdataBasketItemItemNrBrand, riskdataBasketItemItemNrCategory, riskdataBasketItemItemNrColor, riskdataBasketItemItemNrCurrency, riskdataBasketItemItemNrItemID, riskdataBasketItemItemNrManufacturer, riskdataBasketItemItemNrProductTitle, riskdataBasketItemItemNrQuantity, riskdataBasketItemItemNrReceiverEmail, riskdataBasketItemItemNrSize, riskdataBasketItemItemNrSku, riskdataBasketItemItemNrUpc, riskdataPromotionsPromotionItemNrPromotionCode, riskdataPromotionsPromotionItemNrPromotionDiscountAmount, riskdataPromotionsPromotionItemNrPromotionDiscountCurrency, riskdataPromotionsPromotionItemNrPromotionDiscountPercentage, riskdataPromotionsPromotionItemNrPromotionName, riskdataRiskProfileReference, riskdataSkipRisk); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataRisk additionalDataRisk, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.RiskdataCustomFieldName != null) - { - hashCode = (hashCode * 59) + this.RiskdataCustomFieldName.GetHashCode(); - } - if (this.RiskdataBasketItemItemNrAmountPerItem != null) - { - hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrAmountPerItem.GetHashCode(); - } - if (this.RiskdataBasketItemItemNrBrand != null) - { - hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrBrand.GetHashCode(); - } - if (this.RiskdataBasketItemItemNrCategory != null) - { - hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrCategory.GetHashCode(); - } - if (this.RiskdataBasketItemItemNrColor != null) - { - hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrColor.GetHashCode(); - } - if (this.RiskdataBasketItemItemNrCurrency != null) - { - hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrCurrency.GetHashCode(); - } - if (this.RiskdataBasketItemItemNrItemID != null) - { - hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrItemID.GetHashCode(); - } - if (this.RiskdataBasketItemItemNrManufacturer != null) - { - hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrManufacturer.GetHashCode(); - } - if (this.RiskdataBasketItemItemNrProductTitle != null) - { - hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrProductTitle.GetHashCode(); - } - if (this.RiskdataBasketItemItemNrQuantity != null) - { - hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrQuantity.GetHashCode(); - } - if (this.RiskdataBasketItemItemNrReceiverEmail != null) - { - hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrReceiverEmail.GetHashCode(); - } - if (this.RiskdataBasketItemItemNrSize != null) - { - hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrSize.GetHashCode(); - } - if (this.RiskdataBasketItemItemNrSku != null) - { - hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrSku.GetHashCode(); - } - if (this.RiskdataBasketItemItemNrUpc != null) - { - hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrUpc.GetHashCode(); - } - if (this.RiskdataPromotionsPromotionItemNrPromotionCode != null) - { - hashCode = (hashCode * 59) + this.RiskdataPromotionsPromotionItemNrPromotionCode.GetHashCode(); - } - if (this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount != null) - { - hashCode = (hashCode * 59) + this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount.GetHashCode(); - } - if (this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency != null) - { - hashCode = (hashCode * 59) + this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency.GetHashCode(); - } - if (this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage != null) - { - hashCode = (hashCode * 59) + this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage.GetHashCode(); - } - if (this.RiskdataPromotionsPromotionItemNrPromotionName != null) - { - hashCode = (hashCode * 59) + this.RiskdataPromotionsPromotionItemNrPromotionName.GetHashCode(); - } - if (this.RiskdataRiskProfileReference != null) - { - hashCode = (hashCode * 59) + this.RiskdataRiskProfileReference.GetHashCode(); - } - if (this.RiskdataSkipRisk != null) - { - hashCode = (hashCode * 59) + this.RiskdataSkipRisk.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataRisk, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataRisk additionalDataRisk, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataRisk.RiskdataCustomFieldNameOption.IsSet && additionalDataRisk.RiskdataCustomFieldName == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataCustomFieldName), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataBasketItemItemNrAmountPerItemOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrAmountPerItem == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrAmountPerItem), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataBasketItemItemNrBrandOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrBrand == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrBrand), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataBasketItemItemNrCategoryOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrCategory == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrCategory), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataBasketItemItemNrColorOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrColor == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrColor), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataBasketItemItemNrCurrencyOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrCurrency == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrCurrency), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataBasketItemItemNrItemIDOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrItemID == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrItemID), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataBasketItemItemNrManufacturerOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrManufacturer == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrManufacturer), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataBasketItemItemNrProductTitleOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrProductTitle == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrProductTitle), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataBasketItemItemNrQuantityOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrQuantity == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrQuantity), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataBasketItemItemNrReceiverEmailOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrReceiverEmail == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrReceiverEmail), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataBasketItemItemNrSizeOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrSize == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrSize), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataBasketItemItemNrSkuOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrSku == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrSku), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataBasketItemItemNrUpcOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrUpc == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrUpc), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionCodeOption.IsSet && additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionCode == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionCode), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountAmountOption.IsSet && additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrencyOption.IsSet && additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentageOption.IsSet && additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionNameOption.IsSet && additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionName == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionName), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataRiskProfileReferenceOption.IsSet && additionalDataRisk.RiskdataRiskProfileReference == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataRiskProfileReference), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataSkipRiskOption.IsSet && additionalDataRisk.RiskdataSkipRisk == null) + throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataSkipRisk), "Property is required for class AdditionalDataRisk."); + + if (additionalDataRisk.RiskdataCustomFieldNameOption.IsSet) + writer.WriteString("riskdata.[customFieldName]", additionalDataRisk.RiskdataCustomFieldName); + + if (additionalDataRisk.RiskdataBasketItemItemNrAmountPerItemOption.IsSet) + writer.WriteString("riskdata.basket.item[itemNr].amountPerItem", additionalDataRisk.RiskdataBasketItemItemNrAmountPerItem); + + if (additionalDataRisk.RiskdataBasketItemItemNrBrandOption.IsSet) + writer.WriteString("riskdata.basket.item[itemNr].brand", additionalDataRisk.RiskdataBasketItemItemNrBrand); + + if (additionalDataRisk.RiskdataBasketItemItemNrCategoryOption.IsSet) + writer.WriteString("riskdata.basket.item[itemNr].category", additionalDataRisk.RiskdataBasketItemItemNrCategory); + + if (additionalDataRisk.RiskdataBasketItemItemNrColorOption.IsSet) + writer.WriteString("riskdata.basket.item[itemNr].color", additionalDataRisk.RiskdataBasketItemItemNrColor); + + if (additionalDataRisk.RiskdataBasketItemItemNrCurrencyOption.IsSet) + writer.WriteString("riskdata.basket.item[itemNr].currency", additionalDataRisk.RiskdataBasketItemItemNrCurrency); + + if (additionalDataRisk.RiskdataBasketItemItemNrItemIDOption.IsSet) + writer.WriteString("riskdata.basket.item[itemNr].itemID", additionalDataRisk.RiskdataBasketItemItemNrItemID); + + if (additionalDataRisk.RiskdataBasketItemItemNrManufacturerOption.IsSet) + writer.WriteString("riskdata.basket.item[itemNr].manufacturer", additionalDataRisk.RiskdataBasketItemItemNrManufacturer); + + if (additionalDataRisk.RiskdataBasketItemItemNrProductTitleOption.IsSet) + writer.WriteString("riskdata.basket.item[itemNr].productTitle", additionalDataRisk.RiskdataBasketItemItemNrProductTitle); + + if (additionalDataRisk.RiskdataBasketItemItemNrQuantityOption.IsSet) + writer.WriteString("riskdata.basket.item[itemNr].quantity", additionalDataRisk.RiskdataBasketItemItemNrQuantity); + + if (additionalDataRisk.RiskdataBasketItemItemNrReceiverEmailOption.IsSet) + writer.WriteString("riskdata.basket.item[itemNr].receiverEmail", additionalDataRisk.RiskdataBasketItemItemNrReceiverEmail); + + if (additionalDataRisk.RiskdataBasketItemItemNrSizeOption.IsSet) + writer.WriteString("riskdata.basket.item[itemNr].size", additionalDataRisk.RiskdataBasketItemItemNrSize); + + if (additionalDataRisk.RiskdataBasketItemItemNrSkuOption.IsSet) + writer.WriteString("riskdata.basket.item[itemNr].sku", additionalDataRisk.RiskdataBasketItemItemNrSku); + + if (additionalDataRisk.RiskdataBasketItemItemNrUpcOption.IsSet) + writer.WriteString("riskdata.basket.item[itemNr].upc", additionalDataRisk.RiskdataBasketItemItemNrUpc); + + if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionCodeOption.IsSet) + writer.WriteString("riskdata.promotions.promotion[itemNr].promotionCode", additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionCode); + + if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountAmountOption.IsSet) + writer.WriteString("riskdata.promotions.promotion[itemNr].promotionDiscountAmount", additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount); + + if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrencyOption.IsSet) + writer.WriteString("riskdata.promotions.promotion[itemNr].promotionDiscountCurrency", additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency); + + if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentageOption.IsSet) + writer.WriteString("riskdata.promotions.promotion[itemNr].promotionDiscountPercentage", additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage); + + if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionNameOption.IsSet) + writer.WriteString("riskdata.promotions.promotion[itemNr].promotionName", additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionName); + + if (additionalDataRisk.RiskdataRiskProfileReferenceOption.IsSet) + writer.WriteString("riskdata.riskProfileReference", additionalDataRisk.RiskdataRiskProfileReference); + + if (additionalDataRisk.RiskdataSkipRiskOption.IsSet) + writer.WriteString("riskdata.skipRisk", additionalDataRisk.RiskdataSkipRisk); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs b/Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs index 80f9583a4..232061ec8 100644 --- a/Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs +++ b/Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,164 +14,270 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataRiskStandalone /// - [DataContract(Name = "AdditionalDataRiskStandalone")] - public partial class AdditionalDataRiskStandalone : IEquatable, IValidatableObject + public partial class AdditionalDataRiskStandalone : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Shopper's country of residence in the form of ISO standard 3166 2-character country codes.. - /// Shopper's email.. - /// Shopper's first name.. - /// Shopper's last name.. - /// Unique PayPal Customer Account identification number. Character length and limitations: 13 single-byte alphanumeric characters.. - /// Shopper's phone number.. - /// Allowed values: * **Eligible** — Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received. * **PartiallyEligible** — Merchant is protected by PayPal's Seller Protection Policy for Item Not Received. * **Ineligible** — Merchant is not protected under the Seller Protection Policy.. - /// Unique transaction ID of the payment.. - /// Raw AVS result received from the acquirer, where available. Example: D. - /// The Bank Identification Number of a credit card, which is the first six digits of a card number. Required for [tokenized card request](https://docs.adyen.com/online-payments/tokenization).. - /// Raw CVC result received from the acquirer, where available. Example: 1. - /// Unique identifier or token for the shopper's card details.. - /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true. - /// A Boolean value indicating whether 3DS was offered for this payment. Example: true. - /// Required for PayPal payments only. The only supported value is: **paypal**.. - public AdditionalDataRiskStandalone(string payPalCountryCode = default(string), string payPalEmailId = default(string), string payPalFirstName = default(string), string payPalLastName = default(string), string payPalPayerId = default(string), string payPalPhone = default(string), string payPalProtectionEligibility = default(string), string payPalTransactionId = default(string), string avsResultRaw = default(string), string bin = default(string), string cvcResultRaw = default(string), string riskToken = default(string), string threeDAuthenticated = default(string), string threeDOffered = default(string), string tokenDataType = default(string)) + /// Shopper's country of residence in the form of ISO standard 3166 2-character country codes. + /// Shopper's email. + /// Shopper's first name. + /// Shopper's last name. + /// Unique PayPal Customer Account identification number. Character length and limitations: 13 single-byte alphanumeric characters. + /// Shopper's phone number. + /// Allowed values: * **Eligible** — Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received. * **PartiallyEligible** — Merchant is protected by PayPal's Seller Protection Policy for Item Not Received. * **Ineligible** — Merchant is not protected under the Seller Protection Policy. + /// Unique transaction ID of the payment. + /// Raw AVS result received from the acquirer, where available. Example: D + /// The Bank Identification Number of a credit card, which is the first six digits of a card number. Required for [tokenized card request](https://docs.adyen.com/online-payments/tokenization). + /// Raw CVC result received from the acquirer, where available. Example: 1 + /// Unique identifier or token for the shopper's card details. + /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true + /// A Boolean value indicating whether 3DS was offered for this payment. Example: true + /// Required for PayPal payments only. The only supported value is: **paypal**. + [JsonConstructor] + public AdditionalDataRiskStandalone(Option payPalCountryCode = default, Option payPalEmailId = default, Option payPalFirstName = default, Option payPalLastName = default, Option payPalPayerId = default, Option payPalPhone = default, Option payPalProtectionEligibility = default, Option payPalTransactionId = default, Option avsResultRaw = default, Option bin = default, Option cvcResultRaw = default, Option riskToken = default, Option threeDAuthenticated = default, Option threeDOffered = default, Option tokenDataType = default) { - this.PayPalCountryCode = payPalCountryCode; - this.PayPalEmailId = payPalEmailId; - this.PayPalFirstName = payPalFirstName; - this.PayPalLastName = payPalLastName; - this.PayPalPayerId = payPalPayerId; - this.PayPalPhone = payPalPhone; - this.PayPalProtectionEligibility = payPalProtectionEligibility; - this.PayPalTransactionId = payPalTransactionId; - this.AvsResultRaw = avsResultRaw; - this.Bin = bin; - this.CvcResultRaw = cvcResultRaw; - this.RiskToken = riskToken; - this.ThreeDAuthenticated = threeDAuthenticated; - this.ThreeDOffered = threeDOffered; - this.TokenDataType = tokenDataType; + PayPalCountryCodeOption = payPalCountryCode; + PayPalEmailIdOption = payPalEmailId; + PayPalFirstNameOption = payPalFirstName; + PayPalLastNameOption = payPalLastName; + PayPalPayerIdOption = payPalPayerId; + PayPalPhoneOption = payPalPhone; + PayPalProtectionEligibilityOption = payPalProtectionEligibility; + PayPalTransactionIdOption = payPalTransactionId; + AvsResultRawOption = avsResultRaw; + BinOption = bin; + CvcResultRawOption = cvcResultRaw; + RiskTokenOption = riskToken; + ThreeDAuthenticatedOption = threeDAuthenticated; + ThreeDOfferedOption = threeDOffered; + TokenDataTypeOption = tokenDataType; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of PayPalCountryCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayPalCountryCodeOption { get; private set; } + /// /// Shopper's country of residence in the form of ISO standard 3166 2-character country codes. /// /// Shopper's country of residence in the form of ISO standard 3166 2-character country codes. - [DataMember(Name = "PayPal.CountryCode", EmitDefaultValue = false)] - public string PayPalCountryCode { get; set; } + [JsonPropertyName("PayPal.CountryCode")] + public string PayPalCountryCode { get { return this.PayPalCountryCodeOption; } set { this.PayPalCountryCodeOption = new Option(value); } } + + /// + /// Used to track the state of PayPalEmailId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayPalEmailIdOption { get; private set; } /// /// Shopper's email. /// /// Shopper's email. - [DataMember(Name = "PayPal.EmailId", EmitDefaultValue = false)] - public string PayPalEmailId { get; set; } + [JsonPropertyName("PayPal.EmailId")] + public string PayPalEmailId { get { return this.PayPalEmailIdOption; } set { this.PayPalEmailIdOption = new Option(value); } } + + /// + /// Used to track the state of PayPalFirstName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayPalFirstNameOption { get; private set; } /// /// Shopper's first name. /// /// Shopper's first name. - [DataMember(Name = "PayPal.FirstName", EmitDefaultValue = false)] - public string PayPalFirstName { get; set; } + [JsonPropertyName("PayPal.FirstName")] + public string PayPalFirstName { get { return this.PayPalFirstNameOption; } set { this.PayPalFirstNameOption = new Option(value); } } + + /// + /// Used to track the state of PayPalLastName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayPalLastNameOption { get; private set; } /// /// Shopper's last name. /// /// Shopper's last name. - [DataMember(Name = "PayPal.LastName", EmitDefaultValue = false)] - public string PayPalLastName { get; set; } + [JsonPropertyName("PayPal.LastName")] + public string PayPalLastName { get { return this.PayPalLastNameOption; } set { this.PayPalLastNameOption = new Option(value); } } + + /// + /// Used to track the state of PayPalPayerId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayPalPayerIdOption { get; private set; } /// /// Unique PayPal Customer Account identification number. Character length and limitations: 13 single-byte alphanumeric characters. /// /// Unique PayPal Customer Account identification number. Character length and limitations: 13 single-byte alphanumeric characters. - [DataMember(Name = "PayPal.PayerId", EmitDefaultValue = false)] - public string PayPalPayerId { get; set; } + [JsonPropertyName("PayPal.PayerId")] + public string PayPalPayerId { get { return this.PayPalPayerIdOption; } set { this.PayPalPayerIdOption = new Option(value); } } + + /// + /// Used to track the state of PayPalPhone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayPalPhoneOption { get; private set; } /// /// Shopper's phone number. /// /// Shopper's phone number. - [DataMember(Name = "PayPal.Phone", EmitDefaultValue = false)] - public string PayPalPhone { get; set; } + [JsonPropertyName("PayPal.Phone")] + public string PayPalPhone { get { return this.PayPalPhoneOption; } set { this.PayPalPhoneOption = new Option(value); } } + + /// + /// Used to track the state of PayPalProtectionEligibility + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayPalProtectionEligibilityOption { get; private set; } /// /// Allowed values: * **Eligible** — Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received. * **PartiallyEligible** — Merchant is protected by PayPal's Seller Protection Policy for Item Not Received. * **Ineligible** — Merchant is not protected under the Seller Protection Policy. /// /// Allowed values: * **Eligible** — Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received. * **PartiallyEligible** — Merchant is protected by PayPal's Seller Protection Policy for Item Not Received. * **Ineligible** — Merchant is not protected under the Seller Protection Policy. - [DataMember(Name = "PayPal.ProtectionEligibility", EmitDefaultValue = false)] - public string PayPalProtectionEligibility { get; set; } + [JsonPropertyName("PayPal.ProtectionEligibility")] + public string PayPalProtectionEligibility { get { return this.PayPalProtectionEligibilityOption; } set { this.PayPalProtectionEligibilityOption = new Option(value); } } + + /// + /// Used to track the state of PayPalTransactionId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayPalTransactionIdOption { get; private set; } /// /// Unique transaction ID of the payment. /// /// Unique transaction ID of the payment. - [DataMember(Name = "PayPal.TransactionId", EmitDefaultValue = false)] - public string PayPalTransactionId { get; set; } + [JsonPropertyName("PayPal.TransactionId")] + public string PayPalTransactionId { get { return this.PayPalTransactionIdOption; } set { this.PayPalTransactionIdOption = new Option(value); } } + + /// + /// Used to track the state of AvsResultRaw + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AvsResultRawOption { get; private set; } /// /// Raw AVS result received from the acquirer, where available. Example: D /// /// Raw AVS result received from the acquirer, where available. Example: D - [DataMember(Name = "avsResultRaw", EmitDefaultValue = false)] - public string AvsResultRaw { get; set; } + [JsonPropertyName("avsResultRaw")] + public string AvsResultRaw { get { return this.AvsResultRawOption; } set { this.AvsResultRawOption = new Option(value); } } + + /// + /// Used to track the state of Bin + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BinOption { get; private set; } /// /// The Bank Identification Number of a credit card, which is the first six digits of a card number. Required for [tokenized card request](https://docs.adyen.com/online-payments/tokenization). /// /// The Bank Identification Number of a credit card, which is the first six digits of a card number. Required for [tokenized card request](https://docs.adyen.com/online-payments/tokenization). - [DataMember(Name = "bin", EmitDefaultValue = false)] - public string Bin { get; set; } + [JsonPropertyName("bin")] + public string Bin { get { return this.BinOption; } set { this.BinOption = new Option(value); } } + + /// + /// Used to track the state of CvcResultRaw + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CvcResultRawOption { get; private set; } /// /// Raw CVC result received from the acquirer, where available. Example: 1 /// /// Raw CVC result received from the acquirer, where available. Example: 1 - [DataMember(Name = "cvcResultRaw", EmitDefaultValue = false)] - public string CvcResultRaw { get; set; } + [JsonPropertyName("cvcResultRaw")] + public string CvcResultRaw { get { return this.CvcResultRawOption; } set { this.CvcResultRawOption = new Option(value); } } + + /// + /// Used to track the state of RiskToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskTokenOption { get; private set; } /// /// Unique identifier or token for the shopper's card details. /// /// Unique identifier or token for the shopper's card details. - [DataMember(Name = "riskToken", EmitDefaultValue = false)] - public string RiskToken { get; set; } + [JsonPropertyName("riskToken")] + public string RiskToken { get { return this.RiskTokenOption; } set { this.RiskTokenOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDAuthenticated + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDAuthenticatedOption { get; private set; } /// /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true /// /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true - [DataMember(Name = "threeDAuthenticated", EmitDefaultValue = false)] - public string ThreeDAuthenticated { get; set; } + [JsonPropertyName("threeDAuthenticated")] + public string ThreeDAuthenticated { get { return this.ThreeDAuthenticatedOption; } set { this.ThreeDAuthenticatedOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDOffered + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDOfferedOption { get; private set; } /// /// A Boolean value indicating whether 3DS was offered for this payment. Example: true /// /// A Boolean value indicating whether 3DS was offered for this payment. Example: true - [DataMember(Name = "threeDOffered", EmitDefaultValue = false)] - public string ThreeDOffered { get; set; } + [JsonPropertyName("threeDOffered")] + public string ThreeDOffered { get { return this.ThreeDOfferedOption; } set { this.ThreeDOfferedOption = new Option(value); } } + + /// + /// Used to track the state of TokenDataType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TokenDataTypeOption { get; private set; } /// /// Required for PayPal payments only. The only supported value is: **paypal**. /// /// Required for PayPal payments only. The only supported value is: **paypal**. - [DataMember(Name = "tokenDataType", EmitDefaultValue = false)] - public string TokenDataType { get; set; } + [JsonPropertyName("tokenDataType")] + public string TokenDataType { get { return this.TokenDataTypeOption; } set { this.TokenDataTypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -202,194 +307,281 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataRiskStandaloneJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AdditionalDataRiskStandalone Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AdditionalDataRiskStandalone); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AdditionalDataRiskStandalone instances are equal - /// - /// Instance of AdditionalDataRiskStandalone to be compared - /// Boolean - public bool Equals(AdditionalDataRiskStandalone input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option payPalCountryCode = default; + Option payPalEmailId = default; + Option payPalFirstName = default; + Option payPalLastName = default; + Option payPalPayerId = default; + Option payPalPhone = default; + Option payPalProtectionEligibility = default; + Option payPalTransactionId = default; + Option avsResultRaw = default; + Option bin = default; + Option cvcResultRaw = default; + Option riskToken = default; + Option threeDAuthenticated = default; + Option threeDOffered = default; + Option tokenDataType = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "PayPal.CountryCode": + payPalCountryCode = new Option(utf8JsonReader.GetString()); + break; + case "PayPal.EmailId": + payPalEmailId = new Option(utf8JsonReader.GetString()); + break; + case "PayPal.FirstName": + payPalFirstName = new Option(utf8JsonReader.GetString()); + break; + case "PayPal.LastName": + payPalLastName = new Option(utf8JsonReader.GetString()); + break; + case "PayPal.PayerId": + payPalPayerId = new Option(utf8JsonReader.GetString()); + break; + case "PayPal.Phone": + payPalPhone = new Option(utf8JsonReader.GetString()); + break; + case "PayPal.ProtectionEligibility": + payPalProtectionEligibility = new Option(utf8JsonReader.GetString()); + break; + case "PayPal.TransactionId": + payPalTransactionId = new Option(utf8JsonReader.GetString()); + break; + case "avsResultRaw": + avsResultRaw = new Option(utf8JsonReader.GetString()); + break; + case "bin": + bin = new Option(utf8JsonReader.GetString()); + break; + case "cvcResultRaw": + cvcResultRaw = new Option(utf8JsonReader.GetString()); + break; + case "riskToken": + riskToken = new Option(utf8JsonReader.GetString()); + break; + case "threeDAuthenticated": + threeDAuthenticated = new Option(utf8JsonReader.GetString()); + break; + case "threeDOffered": + threeDOffered = new Option(utf8JsonReader.GetString()); + break; + case "tokenDataType": + tokenDataType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.PayPalCountryCode == input.PayPalCountryCode || - (this.PayPalCountryCode != null && - this.PayPalCountryCode.Equals(input.PayPalCountryCode)) - ) && - ( - this.PayPalEmailId == input.PayPalEmailId || - (this.PayPalEmailId != null && - this.PayPalEmailId.Equals(input.PayPalEmailId)) - ) && - ( - this.PayPalFirstName == input.PayPalFirstName || - (this.PayPalFirstName != null && - this.PayPalFirstName.Equals(input.PayPalFirstName)) - ) && - ( - this.PayPalLastName == input.PayPalLastName || - (this.PayPalLastName != null && - this.PayPalLastName.Equals(input.PayPalLastName)) - ) && - ( - this.PayPalPayerId == input.PayPalPayerId || - (this.PayPalPayerId != null && - this.PayPalPayerId.Equals(input.PayPalPayerId)) - ) && - ( - this.PayPalPhone == input.PayPalPhone || - (this.PayPalPhone != null && - this.PayPalPhone.Equals(input.PayPalPhone)) - ) && - ( - this.PayPalProtectionEligibility == input.PayPalProtectionEligibility || - (this.PayPalProtectionEligibility != null && - this.PayPalProtectionEligibility.Equals(input.PayPalProtectionEligibility)) - ) && - ( - this.PayPalTransactionId == input.PayPalTransactionId || - (this.PayPalTransactionId != null && - this.PayPalTransactionId.Equals(input.PayPalTransactionId)) - ) && - ( - this.AvsResultRaw == input.AvsResultRaw || - (this.AvsResultRaw != null && - this.AvsResultRaw.Equals(input.AvsResultRaw)) - ) && - ( - this.Bin == input.Bin || - (this.Bin != null && - this.Bin.Equals(input.Bin)) - ) && - ( - this.CvcResultRaw == input.CvcResultRaw || - (this.CvcResultRaw != null && - this.CvcResultRaw.Equals(input.CvcResultRaw)) - ) && - ( - this.RiskToken == input.RiskToken || - (this.RiskToken != null && - this.RiskToken.Equals(input.RiskToken)) - ) && - ( - this.ThreeDAuthenticated == input.ThreeDAuthenticated || - (this.ThreeDAuthenticated != null && - this.ThreeDAuthenticated.Equals(input.ThreeDAuthenticated)) - ) && - ( - this.ThreeDOffered == input.ThreeDOffered || - (this.ThreeDOffered != null && - this.ThreeDOffered.Equals(input.ThreeDOffered)) - ) && - ( - this.TokenDataType == input.TokenDataType || - (this.TokenDataType != null && - this.TokenDataType.Equals(input.TokenDataType)) - ); + + if (payPalCountryCode.IsSet && payPalCountryCode.Value == null) + throw new ArgumentNullException(nameof(payPalCountryCode), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (payPalEmailId.IsSet && payPalEmailId.Value == null) + throw new ArgumentNullException(nameof(payPalEmailId), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (payPalFirstName.IsSet && payPalFirstName.Value == null) + throw new ArgumentNullException(nameof(payPalFirstName), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (payPalLastName.IsSet && payPalLastName.Value == null) + throw new ArgumentNullException(nameof(payPalLastName), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (payPalPayerId.IsSet && payPalPayerId.Value == null) + throw new ArgumentNullException(nameof(payPalPayerId), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (payPalPhone.IsSet && payPalPhone.Value == null) + throw new ArgumentNullException(nameof(payPalPhone), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (payPalProtectionEligibility.IsSet && payPalProtectionEligibility.Value == null) + throw new ArgumentNullException(nameof(payPalProtectionEligibility), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (payPalTransactionId.IsSet && payPalTransactionId.Value == null) + throw new ArgumentNullException(nameof(payPalTransactionId), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (avsResultRaw.IsSet && avsResultRaw.Value == null) + throw new ArgumentNullException(nameof(avsResultRaw), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (bin.IsSet && bin.Value == null) + throw new ArgumentNullException(nameof(bin), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (cvcResultRaw.IsSet && cvcResultRaw.Value == null) + throw new ArgumentNullException(nameof(cvcResultRaw), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (riskToken.IsSet && riskToken.Value == null) + throw new ArgumentNullException(nameof(riskToken), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (threeDAuthenticated.IsSet && threeDAuthenticated.Value == null) + throw new ArgumentNullException(nameof(threeDAuthenticated), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (threeDOffered.IsSet && threeDOffered.Value == null) + throw new ArgumentNullException(nameof(threeDOffered), "Property is not nullable for class AdditionalDataRiskStandalone."); + + if (tokenDataType.IsSet && tokenDataType.Value == null) + throw new ArgumentNullException(nameof(tokenDataType), "Property is not nullable for class AdditionalDataRiskStandalone."); + + return new AdditionalDataRiskStandalone(payPalCountryCode, payPalEmailId, payPalFirstName, payPalLastName, payPalPayerId, payPalPhone, payPalProtectionEligibility, payPalTransactionId, avsResultRaw, bin, cvcResultRaw, riskToken, threeDAuthenticated, threeDOffered, tokenDataType); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataRiskStandalone additionalDataRiskStandalone, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.PayPalCountryCode != null) - { - hashCode = (hashCode * 59) + this.PayPalCountryCode.GetHashCode(); - } - if (this.PayPalEmailId != null) - { - hashCode = (hashCode * 59) + this.PayPalEmailId.GetHashCode(); - } - if (this.PayPalFirstName != null) - { - hashCode = (hashCode * 59) + this.PayPalFirstName.GetHashCode(); - } - if (this.PayPalLastName != null) - { - hashCode = (hashCode * 59) + this.PayPalLastName.GetHashCode(); - } - if (this.PayPalPayerId != null) - { - hashCode = (hashCode * 59) + this.PayPalPayerId.GetHashCode(); - } - if (this.PayPalPhone != null) - { - hashCode = (hashCode * 59) + this.PayPalPhone.GetHashCode(); - } - if (this.PayPalProtectionEligibility != null) - { - hashCode = (hashCode * 59) + this.PayPalProtectionEligibility.GetHashCode(); - } - if (this.PayPalTransactionId != null) - { - hashCode = (hashCode * 59) + this.PayPalTransactionId.GetHashCode(); - } - if (this.AvsResultRaw != null) - { - hashCode = (hashCode * 59) + this.AvsResultRaw.GetHashCode(); - } - if (this.Bin != null) - { - hashCode = (hashCode * 59) + this.Bin.GetHashCode(); - } - if (this.CvcResultRaw != null) - { - hashCode = (hashCode * 59) + this.CvcResultRaw.GetHashCode(); - } - if (this.RiskToken != null) - { - hashCode = (hashCode * 59) + this.RiskToken.GetHashCode(); - } - if (this.ThreeDAuthenticated != null) - { - hashCode = (hashCode * 59) + this.ThreeDAuthenticated.GetHashCode(); - } - if (this.ThreeDOffered != null) - { - hashCode = (hashCode * 59) + this.ThreeDOffered.GetHashCode(); - } - if (this.TokenDataType != null) - { - hashCode = (hashCode * 59) + this.TokenDataType.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataRiskStandalone, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataRiskStandalone additionalDataRiskStandalone, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataRiskStandalone.PayPalCountryCodeOption.IsSet && additionalDataRiskStandalone.PayPalCountryCode == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalCountryCode), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.PayPalEmailIdOption.IsSet && additionalDataRiskStandalone.PayPalEmailId == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalEmailId), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.PayPalFirstNameOption.IsSet && additionalDataRiskStandalone.PayPalFirstName == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalFirstName), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.PayPalLastNameOption.IsSet && additionalDataRiskStandalone.PayPalLastName == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalLastName), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.PayPalPayerIdOption.IsSet && additionalDataRiskStandalone.PayPalPayerId == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalPayerId), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.PayPalPhoneOption.IsSet && additionalDataRiskStandalone.PayPalPhone == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalPhone), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.PayPalProtectionEligibilityOption.IsSet && additionalDataRiskStandalone.PayPalProtectionEligibility == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalProtectionEligibility), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.PayPalTransactionIdOption.IsSet && additionalDataRiskStandalone.PayPalTransactionId == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalTransactionId), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.AvsResultRawOption.IsSet && additionalDataRiskStandalone.AvsResultRaw == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.AvsResultRaw), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.BinOption.IsSet && additionalDataRiskStandalone.Bin == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.Bin), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.CvcResultRawOption.IsSet && additionalDataRiskStandalone.CvcResultRaw == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.CvcResultRaw), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.RiskTokenOption.IsSet && additionalDataRiskStandalone.RiskToken == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.RiskToken), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.ThreeDAuthenticatedOption.IsSet && additionalDataRiskStandalone.ThreeDAuthenticated == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.ThreeDAuthenticated), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.ThreeDOfferedOption.IsSet && additionalDataRiskStandalone.ThreeDOffered == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.ThreeDOffered), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.TokenDataTypeOption.IsSet && additionalDataRiskStandalone.TokenDataType == null) + throw new ArgumentNullException(nameof(additionalDataRiskStandalone.TokenDataType), "Property is required for class AdditionalDataRiskStandalone."); + + if (additionalDataRiskStandalone.PayPalCountryCodeOption.IsSet) + writer.WriteString("PayPal.CountryCode", additionalDataRiskStandalone.PayPalCountryCode); + + if (additionalDataRiskStandalone.PayPalEmailIdOption.IsSet) + writer.WriteString("PayPal.EmailId", additionalDataRiskStandalone.PayPalEmailId); + + if (additionalDataRiskStandalone.PayPalFirstNameOption.IsSet) + writer.WriteString("PayPal.FirstName", additionalDataRiskStandalone.PayPalFirstName); + + if (additionalDataRiskStandalone.PayPalLastNameOption.IsSet) + writer.WriteString("PayPal.LastName", additionalDataRiskStandalone.PayPalLastName); + + if (additionalDataRiskStandalone.PayPalPayerIdOption.IsSet) + writer.WriteString("PayPal.PayerId", additionalDataRiskStandalone.PayPalPayerId); + + if (additionalDataRiskStandalone.PayPalPhoneOption.IsSet) + writer.WriteString("PayPal.Phone", additionalDataRiskStandalone.PayPalPhone); + + if (additionalDataRiskStandalone.PayPalProtectionEligibilityOption.IsSet) + writer.WriteString("PayPal.ProtectionEligibility", additionalDataRiskStandalone.PayPalProtectionEligibility); + + if (additionalDataRiskStandalone.PayPalTransactionIdOption.IsSet) + writer.WriteString("PayPal.TransactionId", additionalDataRiskStandalone.PayPalTransactionId); + + if (additionalDataRiskStandalone.AvsResultRawOption.IsSet) + writer.WriteString("avsResultRaw", additionalDataRiskStandalone.AvsResultRaw); + + if (additionalDataRiskStandalone.BinOption.IsSet) + writer.WriteString("bin", additionalDataRiskStandalone.Bin); + + if (additionalDataRiskStandalone.CvcResultRawOption.IsSet) + writer.WriteString("cvcResultRaw", additionalDataRiskStandalone.CvcResultRaw); + + if (additionalDataRiskStandalone.RiskTokenOption.IsSet) + writer.WriteString("riskToken", additionalDataRiskStandalone.RiskToken); + + if (additionalDataRiskStandalone.ThreeDAuthenticatedOption.IsSet) + writer.WriteString("threeDAuthenticated", additionalDataRiskStandalone.ThreeDAuthenticated); + + if (additionalDataRiskStandalone.ThreeDOfferedOption.IsSet) + writer.WriteString("threeDOffered", additionalDataRiskStandalone.ThreeDOffered); + + if (additionalDataRiskStandalone.TokenDataTypeOption.IsSet) + writer.WriteString("tokenDataType", additionalDataRiskStandalone.TokenDataType); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataSubMerchant.cs b/Adyen/Model/Checkout/AdditionalDataSubMerchant.cs index 883cfbb5f..990622341 100644 --- a/Adyen/Model/Checkout/AdditionalDataSubMerchant.cs +++ b/Adyen/Model/Checkout/AdditionalDataSubMerchant.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,137 +14,222 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataSubMerchant /// - [DataContract(Name = "AdditionalDataSubMerchant")] - public partial class AdditionalDataSubMerchant : IEquatable, IValidatableObject + public partial class AdditionalDataSubMerchant : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Required for transactions performed by registered payment facilitators. Indicates the number of sub-merchants contained in the request. For example, **3**.. - /// Required for transactions performed by registered payment facilitators. The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters. - /// Required for transactions performed by registered payment facilitators. The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters. - /// Required for transactions performed by registered payment facilitators. The email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters. - /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters. - /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits. - /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters. - /// Required for transactions performed by registered payment facilitators. The phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters. - /// Required for transactions performed by registered payment facilitators. The postal code of the sub-merchant's address, without dashes. * Format: Numeric * Fixed length: 8 digits. - /// Required for transactions performed by registered payment facilitators. The state code of the sub-merchant's address, if applicable to the country. * Format: Alphanumeric * Maximum length: 2 characters. - /// Required for transactions performed by registered payment facilitators. The street name and house number of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 60 characters. - /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ. - public AdditionalDataSubMerchant(string subMerchantNumberOfSubSellers = default(string), string subMerchantSubSellerSubSellerNrCity = default(string), string subMerchantSubSellerSubSellerNrCountry = default(string), string subMerchantSubSellerSubSellerNrEmail = default(string), string subMerchantSubSellerSubSellerNrId = default(string), string subMerchantSubSellerSubSellerNrMcc = default(string), string subMerchantSubSellerSubSellerNrName = default(string), string subMerchantSubSellerSubSellerNrPhoneNumber = default(string), string subMerchantSubSellerSubSellerNrPostalCode = default(string), string subMerchantSubSellerSubSellerNrState = default(string), string subMerchantSubSellerSubSellerNrStreet = default(string), string subMerchantSubSellerSubSellerNrTaxId = default(string)) + /// Required for transactions performed by registered payment facilitators. Indicates the number of sub-merchants contained in the request. For example, **3**. + /// Required for transactions performed by registered payment facilitators. The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters + /// Required for transactions performed by registered payment facilitators. The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters + /// Required for transactions performed by registered payment facilitators. The email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters + /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters + /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits + /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters + /// Required for transactions performed by registered payment facilitators. The phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters + /// Required for transactions performed by registered payment facilitators. The postal code of the sub-merchant's address, without dashes. * Format: Numeric * Fixed length: 8 digits + /// Required for transactions performed by registered payment facilitators. The state code of the sub-merchant's address, if applicable to the country. * Format: Alphanumeric * Maximum length: 2 characters + /// Required for transactions performed by registered payment facilitators. The street name and house number of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 60 characters + /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ + [JsonConstructor] + public AdditionalDataSubMerchant(Option subMerchantNumberOfSubSellers = default, Option subMerchantSubSellerSubSellerNrCity = default, Option subMerchantSubSellerSubSellerNrCountry = default, Option subMerchantSubSellerSubSellerNrEmail = default, Option subMerchantSubSellerSubSellerNrId = default, Option subMerchantSubSellerSubSellerNrMcc = default, Option subMerchantSubSellerSubSellerNrName = default, Option subMerchantSubSellerSubSellerNrPhoneNumber = default, Option subMerchantSubSellerSubSellerNrPostalCode = default, Option subMerchantSubSellerSubSellerNrState = default, Option subMerchantSubSellerSubSellerNrStreet = default, Option subMerchantSubSellerSubSellerNrTaxId = default) { - this.SubMerchantNumberOfSubSellers = subMerchantNumberOfSubSellers; - this.SubMerchantSubSellerSubSellerNrCity = subMerchantSubSellerSubSellerNrCity; - this.SubMerchantSubSellerSubSellerNrCountry = subMerchantSubSellerSubSellerNrCountry; - this.SubMerchantSubSellerSubSellerNrEmail = subMerchantSubSellerSubSellerNrEmail; - this.SubMerchantSubSellerSubSellerNrId = subMerchantSubSellerSubSellerNrId; - this.SubMerchantSubSellerSubSellerNrMcc = subMerchantSubSellerSubSellerNrMcc; - this.SubMerchantSubSellerSubSellerNrName = subMerchantSubSellerSubSellerNrName; - this.SubMerchantSubSellerSubSellerNrPhoneNumber = subMerchantSubSellerSubSellerNrPhoneNumber; - this.SubMerchantSubSellerSubSellerNrPostalCode = subMerchantSubSellerSubSellerNrPostalCode; - this.SubMerchantSubSellerSubSellerNrState = subMerchantSubSellerSubSellerNrState; - this.SubMerchantSubSellerSubSellerNrStreet = subMerchantSubSellerSubSellerNrStreet; - this.SubMerchantSubSellerSubSellerNrTaxId = subMerchantSubSellerSubSellerNrTaxId; + SubMerchantNumberOfSubSellersOption = subMerchantNumberOfSubSellers; + SubMerchantSubSellerSubSellerNrCityOption = subMerchantSubSellerSubSellerNrCity; + SubMerchantSubSellerSubSellerNrCountryOption = subMerchantSubSellerSubSellerNrCountry; + SubMerchantSubSellerSubSellerNrEmailOption = subMerchantSubSellerSubSellerNrEmail; + SubMerchantSubSellerSubSellerNrIdOption = subMerchantSubSellerSubSellerNrId; + SubMerchantSubSellerSubSellerNrMccOption = subMerchantSubSellerSubSellerNrMcc; + SubMerchantSubSellerSubSellerNrNameOption = subMerchantSubSellerSubSellerNrName; + SubMerchantSubSellerSubSellerNrPhoneNumberOption = subMerchantSubSellerSubSellerNrPhoneNumber; + SubMerchantSubSellerSubSellerNrPostalCodeOption = subMerchantSubSellerSubSellerNrPostalCode; + SubMerchantSubSellerSubSellerNrStateOption = subMerchantSubSellerSubSellerNrState; + SubMerchantSubSellerSubSellerNrStreetOption = subMerchantSubSellerSubSellerNrStreet; + SubMerchantSubSellerSubSellerNrTaxIdOption = subMerchantSubSellerSubSellerNrTaxId; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of SubMerchantNumberOfSubSellers + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantNumberOfSubSellersOption { get; private set; } + /// /// Required for transactions performed by registered payment facilitators. Indicates the number of sub-merchants contained in the request. For example, **3**. /// /// Required for transactions performed by registered payment facilitators. Indicates the number of sub-merchants contained in the request. For example, **3**. - [DataMember(Name = "subMerchant.numberOfSubSellers", EmitDefaultValue = false)] - public string SubMerchantNumberOfSubSellers { get; set; } + [JsonPropertyName("subMerchant.numberOfSubSellers")] + public string SubMerchantNumberOfSubSellers { get { return this.SubMerchantNumberOfSubSellersOption; } set { this.SubMerchantNumberOfSubSellersOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantSubSellerSubSellerNrCity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantSubSellerSubSellerNrCityOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters /// /// Required for transactions performed by registered payment facilitators. The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters - [DataMember(Name = "subMerchant.subSeller[subSellerNr].city", EmitDefaultValue = false)] - public string SubMerchantSubSellerSubSellerNrCity { get; set; } + [JsonPropertyName("subMerchant.subSeller[subSellerNr].city")] + public string SubMerchantSubSellerSubSellerNrCity { get { return this.SubMerchantSubSellerSubSellerNrCityOption; } set { this.SubMerchantSubSellerSubSellerNrCityOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantSubSellerSubSellerNrCountry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantSubSellerSubSellerNrCountryOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters /// /// Required for transactions performed by registered payment facilitators. The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters - [DataMember(Name = "subMerchant.subSeller[subSellerNr].country", EmitDefaultValue = false)] - public string SubMerchantSubSellerSubSellerNrCountry { get; set; } + [JsonPropertyName("subMerchant.subSeller[subSellerNr].country")] + public string SubMerchantSubSellerSubSellerNrCountry { get { return this.SubMerchantSubSellerSubSellerNrCountryOption; } set { this.SubMerchantSubSellerSubSellerNrCountryOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantSubSellerSubSellerNrEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantSubSellerSubSellerNrEmailOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters /// /// Required for transactions performed by registered payment facilitators. The email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters - [DataMember(Name = "subMerchant.subSeller[subSellerNr].email", EmitDefaultValue = false)] - public string SubMerchantSubSellerSubSellerNrEmail { get; set; } + [JsonPropertyName("subMerchant.subSeller[subSellerNr].email")] + public string SubMerchantSubSellerSubSellerNrEmail { get { return this.SubMerchantSubSellerSubSellerNrEmailOption; } set { this.SubMerchantSubSellerSubSellerNrEmailOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantSubSellerSubSellerNrId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantSubSellerSubSellerNrIdOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters /// /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters - [DataMember(Name = "subMerchant.subSeller[subSellerNr].id", EmitDefaultValue = false)] - public string SubMerchantSubSellerSubSellerNrId { get; set; } + [JsonPropertyName("subMerchant.subSeller[subSellerNr].id")] + public string SubMerchantSubSellerSubSellerNrId { get { return this.SubMerchantSubSellerSubSellerNrIdOption; } set { this.SubMerchantSubSellerSubSellerNrIdOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantSubSellerSubSellerNrMcc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantSubSellerSubSellerNrMccOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits /// /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits - [DataMember(Name = "subMerchant.subSeller[subSellerNr].mcc", EmitDefaultValue = false)] - public string SubMerchantSubSellerSubSellerNrMcc { get; set; } + [JsonPropertyName("subMerchant.subSeller[subSellerNr].mcc")] + public string SubMerchantSubSellerSubSellerNrMcc { get { return this.SubMerchantSubSellerSubSellerNrMccOption; } set { this.SubMerchantSubSellerSubSellerNrMccOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantSubSellerSubSellerNrName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantSubSellerSubSellerNrNameOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters /// /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters - [DataMember(Name = "subMerchant.subSeller[subSellerNr].name", EmitDefaultValue = false)] - public string SubMerchantSubSellerSubSellerNrName { get; set; } + [JsonPropertyName("subMerchant.subSeller[subSellerNr].name")] + public string SubMerchantSubSellerSubSellerNrName { get { return this.SubMerchantSubSellerSubSellerNrNameOption; } set { this.SubMerchantSubSellerSubSellerNrNameOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantSubSellerSubSellerNrPhoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantSubSellerSubSellerNrPhoneNumberOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters /// /// Required for transactions performed by registered payment facilitators. The phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters - [DataMember(Name = "subMerchant.subSeller[subSellerNr].phoneNumber", EmitDefaultValue = false)] - public string SubMerchantSubSellerSubSellerNrPhoneNumber { get; set; } + [JsonPropertyName("subMerchant.subSeller[subSellerNr].phoneNumber")] + public string SubMerchantSubSellerSubSellerNrPhoneNumber { get { return this.SubMerchantSubSellerSubSellerNrPhoneNumberOption; } set { this.SubMerchantSubSellerSubSellerNrPhoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantSubSellerSubSellerNrPostalCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantSubSellerSubSellerNrPostalCodeOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The postal code of the sub-merchant's address, without dashes. * Format: Numeric * Fixed length: 8 digits /// /// Required for transactions performed by registered payment facilitators. The postal code of the sub-merchant's address, without dashes. * Format: Numeric * Fixed length: 8 digits - [DataMember(Name = "subMerchant.subSeller[subSellerNr].postalCode", EmitDefaultValue = false)] - public string SubMerchantSubSellerSubSellerNrPostalCode { get; set; } + [JsonPropertyName("subMerchant.subSeller[subSellerNr].postalCode")] + public string SubMerchantSubSellerSubSellerNrPostalCode { get { return this.SubMerchantSubSellerSubSellerNrPostalCodeOption; } set { this.SubMerchantSubSellerSubSellerNrPostalCodeOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantSubSellerSubSellerNrState + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantSubSellerSubSellerNrStateOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The state code of the sub-merchant's address, if applicable to the country. * Format: Alphanumeric * Maximum length: 2 characters /// /// Required for transactions performed by registered payment facilitators. The state code of the sub-merchant's address, if applicable to the country. * Format: Alphanumeric * Maximum length: 2 characters - [DataMember(Name = "subMerchant.subSeller[subSellerNr].state", EmitDefaultValue = false)] - public string SubMerchantSubSellerSubSellerNrState { get; set; } + [JsonPropertyName("subMerchant.subSeller[subSellerNr].state")] + public string SubMerchantSubSellerSubSellerNrState { get { return this.SubMerchantSubSellerSubSellerNrStateOption; } set { this.SubMerchantSubSellerSubSellerNrStateOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantSubSellerSubSellerNrStreet + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantSubSellerSubSellerNrStreetOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The street name and house number of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 60 characters /// /// Required for transactions performed by registered payment facilitators. The street name and house number of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 60 characters - [DataMember(Name = "subMerchant.subSeller[subSellerNr].street", EmitDefaultValue = false)] - public string SubMerchantSubSellerSubSellerNrStreet { get; set; } + [JsonPropertyName("subMerchant.subSeller[subSellerNr].street")] + public string SubMerchantSubSellerSubSellerNrStreet { get { return this.SubMerchantSubSellerSubSellerNrStreetOption; } set { this.SubMerchantSubSellerSubSellerNrStreetOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchantSubSellerSubSellerNrTaxId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantSubSellerSubSellerNrTaxIdOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ /// /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ - [DataMember(Name = "subMerchant.subSeller[subSellerNr].taxId", EmitDefaultValue = false)] - public string SubMerchantSubSellerSubSellerNrTaxId { get; set; } + [JsonPropertyName("subMerchant.subSeller[subSellerNr].taxId")] + public string SubMerchantSubSellerSubSellerNrTaxId { get { return this.SubMerchantSubSellerSubSellerNrTaxIdOption; } set { this.SubMerchantSubSellerSubSellerNrTaxIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -172,167 +256,242 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataSubMerchantJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AdditionalDataSubMerchant Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AdditionalDataSubMerchant); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AdditionalDataSubMerchant instances are equal - /// - /// Instance of AdditionalDataSubMerchant to be compared - /// Boolean - public bool Equals(AdditionalDataSubMerchant input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option subMerchantNumberOfSubSellers = default; + Option subMerchantSubSellerSubSellerNrCity = default; + Option subMerchantSubSellerSubSellerNrCountry = default; + Option subMerchantSubSellerSubSellerNrEmail = default; + Option subMerchantSubSellerSubSellerNrId = default; + Option subMerchantSubSellerSubSellerNrMcc = default; + Option subMerchantSubSellerSubSellerNrName = default; + Option subMerchantSubSellerSubSellerNrPhoneNumber = default; + Option subMerchantSubSellerSubSellerNrPostalCode = default; + Option subMerchantSubSellerSubSellerNrState = default; + Option subMerchantSubSellerSubSellerNrStreet = default; + Option subMerchantSubSellerSubSellerNrTaxId = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "subMerchant.numberOfSubSellers": + subMerchantNumberOfSubSellers = new Option(utf8JsonReader.GetString()); + break; + case "subMerchant.subSeller[subSellerNr].city": + subMerchantSubSellerSubSellerNrCity = new Option(utf8JsonReader.GetString()); + break; + case "subMerchant.subSeller[subSellerNr].country": + subMerchantSubSellerSubSellerNrCountry = new Option(utf8JsonReader.GetString()); + break; + case "subMerchant.subSeller[subSellerNr].email": + subMerchantSubSellerSubSellerNrEmail = new Option(utf8JsonReader.GetString()); + break; + case "subMerchant.subSeller[subSellerNr].id": + subMerchantSubSellerSubSellerNrId = new Option(utf8JsonReader.GetString()); + break; + case "subMerchant.subSeller[subSellerNr].mcc": + subMerchantSubSellerSubSellerNrMcc = new Option(utf8JsonReader.GetString()); + break; + case "subMerchant.subSeller[subSellerNr].name": + subMerchantSubSellerSubSellerNrName = new Option(utf8JsonReader.GetString()); + break; + case "subMerchant.subSeller[subSellerNr].phoneNumber": + subMerchantSubSellerSubSellerNrPhoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "subMerchant.subSeller[subSellerNr].postalCode": + subMerchantSubSellerSubSellerNrPostalCode = new Option(utf8JsonReader.GetString()); + break; + case "subMerchant.subSeller[subSellerNr].state": + subMerchantSubSellerSubSellerNrState = new Option(utf8JsonReader.GetString()); + break; + case "subMerchant.subSeller[subSellerNr].street": + subMerchantSubSellerSubSellerNrStreet = new Option(utf8JsonReader.GetString()); + break; + case "subMerchant.subSeller[subSellerNr].taxId": + subMerchantSubSellerSubSellerNrTaxId = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.SubMerchantNumberOfSubSellers == input.SubMerchantNumberOfSubSellers || - (this.SubMerchantNumberOfSubSellers != null && - this.SubMerchantNumberOfSubSellers.Equals(input.SubMerchantNumberOfSubSellers)) - ) && - ( - this.SubMerchantSubSellerSubSellerNrCity == input.SubMerchantSubSellerSubSellerNrCity || - (this.SubMerchantSubSellerSubSellerNrCity != null && - this.SubMerchantSubSellerSubSellerNrCity.Equals(input.SubMerchantSubSellerSubSellerNrCity)) - ) && - ( - this.SubMerchantSubSellerSubSellerNrCountry == input.SubMerchantSubSellerSubSellerNrCountry || - (this.SubMerchantSubSellerSubSellerNrCountry != null && - this.SubMerchantSubSellerSubSellerNrCountry.Equals(input.SubMerchantSubSellerSubSellerNrCountry)) - ) && - ( - this.SubMerchantSubSellerSubSellerNrEmail == input.SubMerchantSubSellerSubSellerNrEmail || - (this.SubMerchantSubSellerSubSellerNrEmail != null && - this.SubMerchantSubSellerSubSellerNrEmail.Equals(input.SubMerchantSubSellerSubSellerNrEmail)) - ) && - ( - this.SubMerchantSubSellerSubSellerNrId == input.SubMerchantSubSellerSubSellerNrId || - (this.SubMerchantSubSellerSubSellerNrId != null && - this.SubMerchantSubSellerSubSellerNrId.Equals(input.SubMerchantSubSellerSubSellerNrId)) - ) && - ( - this.SubMerchantSubSellerSubSellerNrMcc == input.SubMerchantSubSellerSubSellerNrMcc || - (this.SubMerchantSubSellerSubSellerNrMcc != null && - this.SubMerchantSubSellerSubSellerNrMcc.Equals(input.SubMerchantSubSellerSubSellerNrMcc)) - ) && - ( - this.SubMerchantSubSellerSubSellerNrName == input.SubMerchantSubSellerSubSellerNrName || - (this.SubMerchantSubSellerSubSellerNrName != null && - this.SubMerchantSubSellerSubSellerNrName.Equals(input.SubMerchantSubSellerSubSellerNrName)) - ) && - ( - this.SubMerchantSubSellerSubSellerNrPhoneNumber == input.SubMerchantSubSellerSubSellerNrPhoneNumber || - (this.SubMerchantSubSellerSubSellerNrPhoneNumber != null && - this.SubMerchantSubSellerSubSellerNrPhoneNumber.Equals(input.SubMerchantSubSellerSubSellerNrPhoneNumber)) - ) && - ( - this.SubMerchantSubSellerSubSellerNrPostalCode == input.SubMerchantSubSellerSubSellerNrPostalCode || - (this.SubMerchantSubSellerSubSellerNrPostalCode != null && - this.SubMerchantSubSellerSubSellerNrPostalCode.Equals(input.SubMerchantSubSellerSubSellerNrPostalCode)) - ) && - ( - this.SubMerchantSubSellerSubSellerNrState == input.SubMerchantSubSellerSubSellerNrState || - (this.SubMerchantSubSellerSubSellerNrState != null && - this.SubMerchantSubSellerSubSellerNrState.Equals(input.SubMerchantSubSellerSubSellerNrState)) - ) && - ( - this.SubMerchantSubSellerSubSellerNrStreet == input.SubMerchantSubSellerSubSellerNrStreet || - (this.SubMerchantSubSellerSubSellerNrStreet != null && - this.SubMerchantSubSellerSubSellerNrStreet.Equals(input.SubMerchantSubSellerSubSellerNrStreet)) - ) && - ( - this.SubMerchantSubSellerSubSellerNrTaxId == input.SubMerchantSubSellerSubSellerNrTaxId || - (this.SubMerchantSubSellerSubSellerNrTaxId != null && - this.SubMerchantSubSellerSubSellerNrTaxId.Equals(input.SubMerchantSubSellerSubSellerNrTaxId)) - ); + + if (subMerchantNumberOfSubSellers.IsSet && subMerchantNumberOfSubSellers.Value == null) + throw new ArgumentNullException(nameof(subMerchantNumberOfSubSellers), "Property is not nullable for class AdditionalDataSubMerchant."); + + if (subMerchantSubSellerSubSellerNrCity.IsSet && subMerchantSubSellerSubSellerNrCity.Value == null) + throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrCity), "Property is not nullable for class AdditionalDataSubMerchant."); + + if (subMerchantSubSellerSubSellerNrCountry.IsSet && subMerchantSubSellerSubSellerNrCountry.Value == null) + throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrCountry), "Property is not nullable for class AdditionalDataSubMerchant."); + + if (subMerchantSubSellerSubSellerNrEmail.IsSet && subMerchantSubSellerSubSellerNrEmail.Value == null) + throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrEmail), "Property is not nullable for class AdditionalDataSubMerchant."); + + if (subMerchantSubSellerSubSellerNrId.IsSet && subMerchantSubSellerSubSellerNrId.Value == null) + throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrId), "Property is not nullable for class AdditionalDataSubMerchant."); + + if (subMerchantSubSellerSubSellerNrMcc.IsSet && subMerchantSubSellerSubSellerNrMcc.Value == null) + throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrMcc), "Property is not nullable for class AdditionalDataSubMerchant."); + + if (subMerchantSubSellerSubSellerNrName.IsSet && subMerchantSubSellerSubSellerNrName.Value == null) + throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrName), "Property is not nullable for class AdditionalDataSubMerchant."); + + if (subMerchantSubSellerSubSellerNrPhoneNumber.IsSet && subMerchantSubSellerSubSellerNrPhoneNumber.Value == null) + throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrPhoneNumber), "Property is not nullable for class AdditionalDataSubMerchant."); + + if (subMerchantSubSellerSubSellerNrPostalCode.IsSet && subMerchantSubSellerSubSellerNrPostalCode.Value == null) + throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrPostalCode), "Property is not nullable for class AdditionalDataSubMerchant."); + + if (subMerchantSubSellerSubSellerNrState.IsSet && subMerchantSubSellerSubSellerNrState.Value == null) + throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrState), "Property is not nullable for class AdditionalDataSubMerchant."); + + if (subMerchantSubSellerSubSellerNrStreet.IsSet && subMerchantSubSellerSubSellerNrStreet.Value == null) + throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrStreet), "Property is not nullable for class AdditionalDataSubMerchant."); + + if (subMerchantSubSellerSubSellerNrTaxId.IsSet && subMerchantSubSellerSubSellerNrTaxId.Value == null) + throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrTaxId), "Property is not nullable for class AdditionalDataSubMerchant."); + + return new AdditionalDataSubMerchant(subMerchantNumberOfSubSellers, subMerchantSubSellerSubSellerNrCity, subMerchantSubSellerSubSellerNrCountry, subMerchantSubSellerSubSellerNrEmail, subMerchantSubSellerSubSellerNrId, subMerchantSubSellerSubSellerNrMcc, subMerchantSubSellerSubSellerNrName, subMerchantSubSellerSubSellerNrPhoneNumber, subMerchantSubSellerSubSellerNrPostalCode, subMerchantSubSellerSubSellerNrState, subMerchantSubSellerSubSellerNrStreet, subMerchantSubSellerSubSellerNrTaxId); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataSubMerchant additionalDataSubMerchant, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.SubMerchantNumberOfSubSellers != null) - { - hashCode = (hashCode * 59) + this.SubMerchantNumberOfSubSellers.GetHashCode(); - } - if (this.SubMerchantSubSellerSubSellerNrCity != null) - { - hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrCity.GetHashCode(); - } - if (this.SubMerchantSubSellerSubSellerNrCountry != null) - { - hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrCountry.GetHashCode(); - } - if (this.SubMerchantSubSellerSubSellerNrEmail != null) - { - hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrEmail.GetHashCode(); - } - if (this.SubMerchantSubSellerSubSellerNrId != null) - { - hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrId.GetHashCode(); - } - if (this.SubMerchantSubSellerSubSellerNrMcc != null) - { - hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrMcc.GetHashCode(); - } - if (this.SubMerchantSubSellerSubSellerNrName != null) - { - hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrName.GetHashCode(); - } - if (this.SubMerchantSubSellerSubSellerNrPhoneNumber != null) - { - hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrPhoneNumber.GetHashCode(); - } - if (this.SubMerchantSubSellerSubSellerNrPostalCode != null) - { - hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrPostalCode.GetHashCode(); - } - if (this.SubMerchantSubSellerSubSellerNrState != null) - { - hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrState.GetHashCode(); - } - if (this.SubMerchantSubSellerSubSellerNrStreet != null) - { - hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrStreet.GetHashCode(); - } - if (this.SubMerchantSubSellerSubSellerNrTaxId != null) - { - hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrTaxId.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataSubMerchant, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataSubMerchant additionalDataSubMerchant, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataSubMerchant.SubMerchantNumberOfSubSellersOption.IsSet && additionalDataSubMerchant.SubMerchantNumberOfSubSellers == null) + throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantNumberOfSubSellers), "Property is required for class AdditionalDataSubMerchant."); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCityOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCity == null) + throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCity), "Property is required for class AdditionalDataSubMerchant."); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCountryOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCountry == null) + throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCountry), "Property is required for class AdditionalDataSubMerchant."); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrEmailOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrEmail == null) + throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrEmail), "Property is required for class AdditionalDataSubMerchant."); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrIdOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrId == null) + throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrId), "Property is required for class AdditionalDataSubMerchant."); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrMccOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrMcc == null) + throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrMcc), "Property is required for class AdditionalDataSubMerchant."); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrNameOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrName == null) + throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrName), "Property is required for class AdditionalDataSubMerchant."); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPhoneNumberOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPhoneNumber == null) + throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPhoneNumber), "Property is required for class AdditionalDataSubMerchant."); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPostalCodeOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPostalCode == null) + throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPostalCode), "Property is required for class AdditionalDataSubMerchant."); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStateOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrState == null) + throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrState), "Property is required for class AdditionalDataSubMerchant."); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStreetOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStreet == null) + throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStreet), "Property is required for class AdditionalDataSubMerchant."); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrTaxIdOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrTaxId == null) + throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrTaxId), "Property is required for class AdditionalDataSubMerchant."); + + if (additionalDataSubMerchant.SubMerchantNumberOfSubSellersOption.IsSet) + writer.WriteString("subMerchant.numberOfSubSellers", additionalDataSubMerchant.SubMerchantNumberOfSubSellers); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCityOption.IsSet) + writer.WriteString("subMerchant.subSeller[subSellerNr].city", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCity); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCountryOption.IsSet) + writer.WriteString("subMerchant.subSeller[subSellerNr].country", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCountry); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrEmailOption.IsSet) + writer.WriteString("subMerchant.subSeller[subSellerNr].email", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrEmail); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrIdOption.IsSet) + writer.WriteString("subMerchant.subSeller[subSellerNr].id", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrId); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrMccOption.IsSet) + writer.WriteString("subMerchant.subSeller[subSellerNr].mcc", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrMcc); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrNameOption.IsSet) + writer.WriteString("subMerchant.subSeller[subSellerNr].name", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrName); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPhoneNumberOption.IsSet) + writer.WriteString("subMerchant.subSeller[subSellerNr].phoneNumber", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPhoneNumber); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPostalCodeOption.IsSet) + writer.WriteString("subMerchant.subSeller[subSellerNr].postalCode", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPostalCode); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStateOption.IsSet) + writer.WriteString("subMerchant.subSeller[subSellerNr].state", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrState); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStreetOption.IsSet) + writer.WriteString("subMerchant.subSeller[subSellerNr].street", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStreet); + + if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrTaxIdOption.IsSet) + writer.WriteString("subMerchant.subSeller[subSellerNr].taxId", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrTaxId); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs b/Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs index 787a7cbfe..57110975c 100644 --- a/Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs +++ b/Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,110 +14,174 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataTemporaryServices /// - [DataContract(Name = "AdditionalDataTemporaryServices")] - public partial class AdditionalDataTemporaryServices : IEquatable, IValidatableObject + public partial class AdditionalDataTemporaryServices : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25. - /// The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros.. - /// The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros.. - /// The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros. - /// The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros. - /// The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces. - /// The billing period start date. * Format: ddMMyy * maxLength: 6. - /// The billing period end date. * Format: ddMMyy * maxLength: 6. - /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12. - public AdditionalDataTemporaryServices(string enhancedSchemeDataCustomerReference = default(string), string enhancedSchemeDataEmployeeName = default(string), string enhancedSchemeDataJobDescription = default(string), string enhancedSchemeDataRegularHoursRate = default(string), string enhancedSchemeDataRegularHoursWorked = default(string), string enhancedSchemeDataRequestName = default(string), string enhancedSchemeDataTempStartDate = default(string), string enhancedSchemeDataTempWeekEnding = default(string), string enhancedSchemeDataTotalTaxAmount = default(string)) + /// The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 + /// The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros. + /// The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros. + /// The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros + /// The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros + /// The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces + /// The billing period start date. * Format: ddMMyy * maxLength: 6 + /// The billing period end date. * Format: ddMMyy * maxLength: 6 + /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12 + [JsonConstructor] + public AdditionalDataTemporaryServices(Option enhancedSchemeDataCustomerReference = default, Option enhancedSchemeDataEmployeeName = default, Option enhancedSchemeDataJobDescription = default, Option enhancedSchemeDataRegularHoursRate = default, Option enhancedSchemeDataRegularHoursWorked = default, Option enhancedSchemeDataRequestName = default, Option enhancedSchemeDataTempStartDate = default, Option enhancedSchemeDataTempWeekEnding = default, Option enhancedSchemeDataTotalTaxAmount = default) { - this.EnhancedSchemeDataCustomerReference = enhancedSchemeDataCustomerReference; - this.EnhancedSchemeDataEmployeeName = enhancedSchemeDataEmployeeName; - this.EnhancedSchemeDataJobDescription = enhancedSchemeDataJobDescription; - this.EnhancedSchemeDataRegularHoursRate = enhancedSchemeDataRegularHoursRate; - this.EnhancedSchemeDataRegularHoursWorked = enhancedSchemeDataRegularHoursWorked; - this.EnhancedSchemeDataRequestName = enhancedSchemeDataRequestName; - this.EnhancedSchemeDataTempStartDate = enhancedSchemeDataTempStartDate; - this.EnhancedSchemeDataTempWeekEnding = enhancedSchemeDataTempWeekEnding; - this.EnhancedSchemeDataTotalTaxAmount = enhancedSchemeDataTotalTaxAmount; + EnhancedSchemeDataCustomerReferenceOption = enhancedSchemeDataCustomerReference; + EnhancedSchemeDataEmployeeNameOption = enhancedSchemeDataEmployeeName; + EnhancedSchemeDataJobDescriptionOption = enhancedSchemeDataJobDescription; + EnhancedSchemeDataRegularHoursRateOption = enhancedSchemeDataRegularHoursRate; + EnhancedSchemeDataRegularHoursWorkedOption = enhancedSchemeDataRegularHoursWorked; + EnhancedSchemeDataRequestNameOption = enhancedSchemeDataRequestName; + EnhancedSchemeDataTempStartDateOption = enhancedSchemeDataTempStartDate; + EnhancedSchemeDataTempWeekEndingOption = enhancedSchemeDataTempWeekEnding; + EnhancedSchemeDataTotalTaxAmountOption = enhancedSchemeDataTotalTaxAmount; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of EnhancedSchemeDataCustomerReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataCustomerReferenceOption { get; private set; } + /// /// The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 /// /// The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 - [DataMember(Name = "enhancedSchemeData.customerReference", EmitDefaultValue = false)] - public string EnhancedSchemeDataCustomerReference { get; set; } + [JsonPropertyName("enhancedSchemeData.customerReference")] + public string EnhancedSchemeDataCustomerReference { get { return this.EnhancedSchemeDataCustomerReferenceOption; } set { this.EnhancedSchemeDataCustomerReferenceOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataEmployeeName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataEmployeeNameOption { get; private set; } /// /// The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros. /// /// The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros. - [DataMember(Name = "enhancedSchemeData.employeeName", EmitDefaultValue = false)] - public string EnhancedSchemeDataEmployeeName { get; set; } + [JsonPropertyName("enhancedSchemeData.employeeName")] + public string EnhancedSchemeDataEmployeeName { get { return this.EnhancedSchemeDataEmployeeNameOption; } set { this.EnhancedSchemeDataEmployeeNameOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataJobDescription + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataJobDescriptionOption { get; private set; } /// /// The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros. /// /// The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros. - [DataMember(Name = "enhancedSchemeData.jobDescription", EmitDefaultValue = false)] - public string EnhancedSchemeDataJobDescription { get; set; } + [JsonPropertyName("enhancedSchemeData.jobDescription")] + public string EnhancedSchemeDataJobDescription { get { return this.EnhancedSchemeDataJobDescriptionOption; } set { this.EnhancedSchemeDataJobDescriptionOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataRegularHoursRate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataRegularHoursRateOption { get; private set; } /// /// The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros /// /// The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros - [DataMember(Name = "enhancedSchemeData.regularHoursRate", EmitDefaultValue = false)] - public string EnhancedSchemeDataRegularHoursRate { get; set; } + [JsonPropertyName("enhancedSchemeData.regularHoursRate")] + public string EnhancedSchemeDataRegularHoursRate { get { return this.EnhancedSchemeDataRegularHoursRateOption; } set { this.EnhancedSchemeDataRegularHoursRateOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataRegularHoursWorked + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataRegularHoursWorkedOption { get; private set; } /// /// The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros /// /// The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros - [DataMember(Name = "enhancedSchemeData.regularHoursWorked", EmitDefaultValue = false)] - public string EnhancedSchemeDataRegularHoursWorked { get; set; } + [JsonPropertyName("enhancedSchemeData.regularHoursWorked")] + public string EnhancedSchemeDataRegularHoursWorked { get { return this.EnhancedSchemeDataRegularHoursWorkedOption; } set { this.EnhancedSchemeDataRegularHoursWorkedOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataRequestName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataRequestNameOption { get; private set; } /// /// The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces /// /// The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces - [DataMember(Name = "enhancedSchemeData.requestName", EmitDefaultValue = false)] - public string EnhancedSchemeDataRequestName { get; set; } + [JsonPropertyName("enhancedSchemeData.requestName")] + public string EnhancedSchemeDataRequestName { get { return this.EnhancedSchemeDataRequestNameOption; } set { this.EnhancedSchemeDataRequestNameOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataTempStartDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataTempStartDateOption { get; private set; } /// /// The billing period start date. * Format: ddMMyy * maxLength: 6 /// /// The billing period start date. * Format: ddMMyy * maxLength: 6 - [DataMember(Name = "enhancedSchemeData.tempStartDate", EmitDefaultValue = false)] - public string EnhancedSchemeDataTempStartDate { get; set; } + [JsonPropertyName("enhancedSchemeData.tempStartDate")] + public string EnhancedSchemeDataTempStartDate { get { return this.EnhancedSchemeDataTempStartDateOption; } set { this.EnhancedSchemeDataTempStartDateOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataTempWeekEnding + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataTempWeekEndingOption { get; private set; } /// /// The billing period end date. * Format: ddMMyy * maxLength: 6 /// /// The billing period end date. * Format: ddMMyy * maxLength: 6 - [DataMember(Name = "enhancedSchemeData.tempWeekEnding", EmitDefaultValue = false)] - public string EnhancedSchemeDataTempWeekEnding { get; set; } + [JsonPropertyName("enhancedSchemeData.tempWeekEnding")] + public string EnhancedSchemeDataTempWeekEnding { get { return this.EnhancedSchemeDataTempWeekEndingOption; } set { this.EnhancedSchemeDataTempWeekEndingOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeDataTotalTaxAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataTotalTaxAmountOption { get; private set; } /// /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12 /// /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12 - [DataMember(Name = "enhancedSchemeData.totalTaxAmount", EmitDefaultValue = false)] - public string EnhancedSchemeDataTotalTaxAmount { get; set; } + [JsonPropertyName("enhancedSchemeData.totalTaxAmount")] + public string EnhancedSchemeDataTotalTaxAmount { get { return this.EnhancedSchemeDataTotalTaxAmountOption; } set { this.EnhancedSchemeDataTotalTaxAmountOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -142,140 +205,203 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataTemporaryServicesJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AdditionalDataTemporaryServices Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AdditionalDataTemporaryServices); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AdditionalDataTemporaryServices instances are equal - /// - /// Instance of AdditionalDataTemporaryServices to be compared - /// Boolean - public bool Equals(AdditionalDataTemporaryServices input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option enhancedSchemeDataCustomerReference = default; + Option enhancedSchemeDataEmployeeName = default; + Option enhancedSchemeDataJobDescription = default; + Option enhancedSchemeDataRegularHoursRate = default; + Option enhancedSchemeDataRegularHoursWorked = default; + Option enhancedSchemeDataRequestName = default; + Option enhancedSchemeDataTempStartDate = default; + Option enhancedSchemeDataTempWeekEnding = default; + Option enhancedSchemeDataTotalTaxAmount = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "enhancedSchemeData.customerReference": + enhancedSchemeDataCustomerReference = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.employeeName": + enhancedSchemeDataEmployeeName = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.jobDescription": + enhancedSchemeDataJobDescription = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.regularHoursRate": + enhancedSchemeDataRegularHoursRate = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.regularHoursWorked": + enhancedSchemeDataRegularHoursWorked = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.requestName": + enhancedSchemeDataRequestName = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.tempStartDate": + enhancedSchemeDataTempStartDate = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.tempWeekEnding": + enhancedSchemeDataTempWeekEnding = new Option(utf8JsonReader.GetString()); + break; + case "enhancedSchemeData.totalTaxAmount": + enhancedSchemeDataTotalTaxAmount = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.EnhancedSchemeDataCustomerReference == input.EnhancedSchemeDataCustomerReference || - (this.EnhancedSchemeDataCustomerReference != null && - this.EnhancedSchemeDataCustomerReference.Equals(input.EnhancedSchemeDataCustomerReference)) - ) && - ( - this.EnhancedSchemeDataEmployeeName == input.EnhancedSchemeDataEmployeeName || - (this.EnhancedSchemeDataEmployeeName != null && - this.EnhancedSchemeDataEmployeeName.Equals(input.EnhancedSchemeDataEmployeeName)) - ) && - ( - this.EnhancedSchemeDataJobDescription == input.EnhancedSchemeDataJobDescription || - (this.EnhancedSchemeDataJobDescription != null && - this.EnhancedSchemeDataJobDescription.Equals(input.EnhancedSchemeDataJobDescription)) - ) && - ( - this.EnhancedSchemeDataRegularHoursRate == input.EnhancedSchemeDataRegularHoursRate || - (this.EnhancedSchemeDataRegularHoursRate != null && - this.EnhancedSchemeDataRegularHoursRate.Equals(input.EnhancedSchemeDataRegularHoursRate)) - ) && - ( - this.EnhancedSchemeDataRegularHoursWorked == input.EnhancedSchemeDataRegularHoursWorked || - (this.EnhancedSchemeDataRegularHoursWorked != null && - this.EnhancedSchemeDataRegularHoursWorked.Equals(input.EnhancedSchemeDataRegularHoursWorked)) - ) && - ( - this.EnhancedSchemeDataRequestName == input.EnhancedSchemeDataRequestName || - (this.EnhancedSchemeDataRequestName != null && - this.EnhancedSchemeDataRequestName.Equals(input.EnhancedSchemeDataRequestName)) - ) && - ( - this.EnhancedSchemeDataTempStartDate == input.EnhancedSchemeDataTempStartDate || - (this.EnhancedSchemeDataTempStartDate != null && - this.EnhancedSchemeDataTempStartDate.Equals(input.EnhancedSchemeDataTempStartDate)) - ) && - ( - this.EnhancedSchemeDataTempWeekEnding == input.EnhancedSchemeDataTempWeekEnding || - (this.EnhancedSchemeDataTempWeekEnding != null && - this.EnhancedSchemeDataTempWeekEnding.Equals(input.EnhancedSchemeDataTempWeekEnding)) - ) && - ( - this.EnhancedSchemeDataTotalTaxAmount == input.EnhancedSchemeDataTotalTaxAmount || - (this.EnhancedSchemeDataTotalTaxAmount != null && - this.EnhancedSchemeDataTotalTaxAmount.Equals(input.EnhancedSchemeDataTotalTaxAmount)) - ); + + if (enhancedSchemeDataCustomerReference.IsSet && enhancedSchemeDataCustomerReference.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataCustomerReference), "Property is not nullable for class AdditionalDataTemporaryServices."); + + if (enhancedSchemeDataEmployeeName.IsSet && enhancedSchemeDataEmployeeName.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataEmployeeName), "Property is not nullable for class AdditionalDataTemporaryServices."); + + if (enhancedSchemeDataJobDescription.IsSet && enhancedSchemeDataJobDescription.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataJobDescription), "Property is not nullable for class AdditionalDataTemporaryServices."); + + if (enhancedSchemeDataRegularHoursRate.IsSet && enhancedSchemeDataRegularHoursRate.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataRegularHoursRate), "Property is not nullable for class AdditionalDataTemporaryServices."); + + if (enhancedSchemeDataRegularHoursWorked.IsSet && enhancedSchemeDataRegularHoursWorked.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataRegularHoursWorked), "Property is not nullable for class AdditionalDataTemporaryServices."); + + if (enhancedSchemeDataRequestName.IsSet && enhancedSchemeDataRequestName.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataRequestName), "Property is not nullable for class AdditionalDataTemporaryServices."); + + if (enhancedSchemeDataTempStartDate.IsSet && enhancedSchemeDataTempStartDate.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataTempStartDate), "Property is not nullable for class AdditionalDataTemporaryServices."); + + if (enhancedSchemeDataTempWeekEnding.IsSet && enhancedSchemeDataTempWeekEnding.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataTempWeekEnding), "Property is not nullable for class AdditionalDataTemporaryServices."); + + if (enhancedSchemeDataTotalTaxAmount.IsSet && enhancedSchemeDataTotalTaxAmount.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeDataTotalTaxAmount), "Property is not nullable for class AdditionalDataTemporaryServices."); + + return new AdditionalDataTemporaryServices(enhancedSchemeDataCustomerReference, enhancedSchemeDataEmployeeName, enhancedSchemeDataJobDescription, enhancedSchemeDataRegularHoursRate, enhancedSchemeDataRegularHoursWorked, enhancedSchemeDataRequestName, enhancedSchemeDataTempStartDate, enhancedSchemeDataTempWeekEnding, enhancedSchemeDataTotalTaxAmount); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataTemporaryServices additionalDataTemporaryServices, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.EnhancedSchemeDataCustomerReference != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataCustomerReference.GetHashCode(); - } - if (this.EnhancedSchemeDataEmployeeName != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataEmployeeName.GetHashCode(); - } - if (this.EnhancedSchemeDataJobDescription != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataJobDescription.GetHashCode(); - } - if (this.EnhancedSchemeDataRegularHoursRate != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataRegularHoursRate.GetHashCode(); - } - if (this.EnhancedSchemeDataRegularHoursWorked != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataRegularHoursWorked.GetHashCode(); - } - if (this.EnhancedSchemeDataRequestName != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataRequestName.GetHashCode(); - } - if (this.EnhancedSchemeDataTempStartDate != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataTempStartDate.GetHashCode(); - } - if (this.EnhancedSchemeDataTempWeekEnding != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataTempWeekEnding.GetHashCode(); - } - if (this.EnhancedSchemeDataTotalTaxAmount != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeDataTotalTaxAmount.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataTemporaryServices, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataTemporaryServices additionalDataTemporaryServices, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataTemporaryServices.EnhancedSchemeDataCustomerReferenceOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataCustomerReference == null) + throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataCustomerReference), "Property is required for class AdditionalDataTemporaryServices."); + + if (additionalDataTemporaryServices.EnhancedSchemeDataEmployeeNameOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataEmployeeName == null) + throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataEmployeeName), "Property is required for class AdditionalDataTemporaryServices."); + + if (additionalDataTemporaryServices.EnhancedSchemeDataJobDescriptionOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataJobDescription == null) + throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataJobDescription), "Property is required for class AdditionalDataTemporaryServices."); + + if (additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursRateOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursRate == null) + throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursRate), "Property is required for class AdditionalDataTemporaryServices."); + + if (additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursWorkedOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursWorked == null) + throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursWorked), "Property is required for class AdditionalDataTemporaryServices."); + + if (additionalDataTemporaryServices.EnhancedSchemeDataRequestNameOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataRequestName == null) + throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataRequestName), "Property is required for class AdditionalDataTemporaryServices."); + + if (additionalDataTemporaryServices.EnhancedSchemeDataTempStartDateOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataTempStartDate == null) + throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataTempStartDate), "Property is required for class AdditionalDataTemporaryServices."); + + if (additionalDataTemporaryServices.EnhancedSchemeDataTempWeekEndingOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataTempWeekEnding == null) + throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataTempWeekEnding), "Property is required for class AdditionalDataTemporaryServices."); + + if (additionalDataTemporaryServices.EnhancedSchemeDataTotalTaxAmountOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataTotalTaxAmount == null) + throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataTotalTaxAmount), "Property is required for class AdditionalDataTemporaryServices."); + + if (additionalDataTemporaryServices.EnhancedSchemeDataCustomerReferenceOption.IsSet) + writer.WriteString("enhancedSchemeData.customerReference", additionalDataTemporaryServices.EnhancedSchemeDataCustomerReference); + + if (additionalDataTemporaryServices.EnhancedSchemeDataEmployeeNameOption.IsSet) + writer.WriteString("enhancedSchemeData.employeeName", additionalDataTemporaryServices.EnhancedSchemeDataEmployeeName); + + if (additionalDataTemporaryServices.EnhancedSchemeDataJobDescriptionOption.IsSet) + writer.WriteString("enhancedSchemeData.jobDescription", additionalDataTemporaryServices.EnhancedSchemeDataJobDescription); + + if (additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursRateOption.IsSet) + writer.WriteString("enhancedSchemeData.regularHoursRate", additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursRate); + + if (additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursWorkedOption.IsSet) + writer.WriteString("enhancedSchemeData.regularHoursWorked", additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursWorked); + + if (additionalDataTemporaryServices.EnhancedSchemeDataRequestNameOption.IsSet) + writer.WriteString("enhancedSchemeData.requestName", additionalDataTemporaryServices.EnhancedSchemeDataRequestName); + + if (additionalDataTemporaryServices.EnhancedSchemeDataTempStartDateOption.IsSet) + writer.WriteString("enhancedSchemeData.tempStartDate", additionalDataTemporaryServices.EnhancedSchemeDataTempStartDate); + + if (additionalDataTemporaryServices.EnhancedSchemeDataTempWeekEndingOption.IsSet) + writer.WriteString("enhancedSchemeData.tempWeekEnding", additionalDataTemporaryServices.EnhancedSchemeDataTempWeekEnding); + + if (additionalDataTemporaryServices.EnhancedSchemeDataTotalTaxAmountOption.IsSet) + writer.WriteString("enhancedSchemeData.totalTaxAmount", additionalDataTemporaryServices.EnhancedSchemeDataTotalTaxAmount); } } - } diff --git a/Adyen/Model/Checkout/AdditionalDataWallets.cs b/Adyen/Model/Checkout/AdditionalDataWallets.cs index 023dd11ca..51743e572 100644 --- a/Adyen/Model/Checkout/AdditionalDataWallets.cs +++ b/Adyen/Model/Checkout/AdditionalDataWallets.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,83 +14,126 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AdditionalDataWallets /// - [DataContract(Name = "AdditionalDataWallets")] - public partial class AdditionalDataWallets : IEquatable, IValidatableObject + public partial class AdditionalDataWallets : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The Android Pay token retrieved from the SDK.. - /// The Mastercard Masterpass Transaction ID retrieved from the SDK.. - /// The Apple Pay token retrieved from the SDK.. - /// The Google Pay token retrieved from the SDK.. - /// The Samsung Pay token retrieved from the SDK.. - /// The Visa Checkout Call ID retrieved from the SDK.. - public AdditionalDataWallets(string androidpayToken = default(string), string masterpassTransactionId = default(string), string paymentToken = default(string), string paywithgoogleToken = default(string), string samsungpayToken = default(string), string visacheckoutCallId = default(string)) + /// The Android Pay token retrieved from the SDK. + /// The Mastercard Masterpass Transaction ID retrieved from the SDK. + /// The Apple Pay token retrieved from the SDK. + /// The Google Pay token retrieved from the SDK. + /// The Samsung Pay token retrieved from the SDK. + /// The Visa Checkout Call ID retrieved from the SDK. + [JsonConstructor] + public AdditionalDataWallets(Option androidpayToken = default, Option masterpassTransactionId = default, Option paymentToken = default, Option paywithgoogleToken = default, Option samsungpayToken = default, Option visacheckoutCallId = default) { - this.AndroidpayToken = androidpayToken; - this.MasterpassTransactionId = masterpassTransactionId; - this.PaymentToken = paymentToken; - this.PaywithgoogleToken = paywithgoogleToken; - this.SamsungpayToken = samsungpayToken; - this.VisacheckoutCallId = visacheckoutCallId; + AndroidpayTokenOption = androidpayToken; + MasterpassTransactionIdOption = masterpassTransactionId; + PaymentTokenOption = paymentToken; + PaywithgoogleTokenOption = paywithgoogleToken; + SamsungpayTokenOption = samsungpayToken; + VisacheckoutCallIdOption = visacheckoutCallId; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of AndroidpayToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AndroidpayTokenOption { get; private set; } + /// /// The Android Pay token retrieved from the SDK. /// /// The Android Pay token retrieved from the SDK. - [DataMember(Name = "androidpay.token", EmitDefaultValue = false)] - public string AndroidpayToken { get; set; } + [JsonPropertyName("androidpay.token")] + public string AndroidpayToken { get { return this.AndroidpayTokenOption; } set { this.AndroidpayTokenOption = new Option(value); } } + + /// + /// Used to track the state of MasterpassTransactionId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MasterpassTransactionIdOption { get; private set; } /// /// The Mastercard Masterpass Transaction ID retrieved from the SDK. /// /// The Mastercard Masterpass Transaction ID retrieved from the SDK. - [DataMember(Name = "masterpass.transactionId", EmitDefaultValue = false)] - public string MasterpassTransactionId { get; set; } + [JsonPropertyName("masterpass.transactionId")] + public string MasterpassTransactionId { get { return this.MasterpassTransactionIdOption; } set { this.MasterpassTransactionIdOption = new Option(value); } } + + /// + /// Used to track the state of PaymentToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentTokenOption { get; private set; } /// /// The Apple Pay token retrieved from the SDK. /// /// The Apple Pay token retrieved from the SDK. - [DataMember(Name = "payment.token", EmitDefaultValue = false)] - public string PaymentToken { get; set; } + [JsonPropertyName("payment.token")] + public string PaymentToken { get { return this.PaymentTokenOption; } set { this.PaymentTokenOption = new Option(value); } } + + /// + /// Used to track the state of PaywithgoogleToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaywithgoogleTokenOption { get; private set; } /// /// The Google Pay token retrieved from the SDK. /// /// The Google Pay token retrieved from the SDK. - [DataMember(Name = "paywithgoogle.token", EmitDefaultValue = false)] - public string PaywithgoogleToken { get; set; } + [JsonPropertyName("paywithgoogle.token")] + public string PaywithgoogleToken { get { return this.PaywithgoogleTokenOption; } set { this.PaywithgoogleTokenOption = new Option(value); } } + + /// + /// Used to track the state of SamsungpayToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SamsungpayTokenOption { get; private set; } /// /// The Samsung Pay token retrieved from the SDK. /// /// The Samsung Pay token retrieved from the SDK. - [DataMember(Name = "samsungpay.token", EmitDefaultValue = false)] - public string SamsungpayToken { get; set; } + [JsonPropertyName("samsungpay.token")] + public string SamsungpayToken { get { return this.SamsungpayTokenOption; } set { this.SamsungpayTokenOption = new Option(value); } } + + /// + /// Used to track the state of VisacheckoutCallId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VisacheckoutCallIdOption { get; private set; } /// /// The Visa Checkout Call ID retrieved from the SDK. /// /// The Visa Checkout Call ID retrieved from the SDK. - [DataMember(Name = "visacheckout.callId", EmitDefaultValue = false)] - public string VisacheckoutCallId { get; set; } + [JsonPropertyName("visacheckout.callId")] + public string VisacheckoutCallId { get { return this.VisacheckoutCallIdOption; } set { this.VisacheckoutCallIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -112,113 +154,164 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AdditionalDataWalletsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AdditionalDataWallets Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AdditionalDataWallets); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AdditionalDataWallets instances are equal - /// - /// Instance of AdditionalDataWallets to be compared - /// Boolean - public bool Equals(AdditionalDataWallets input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option androidpayToken = default; + Option masterpassTransactionId = default; + Option paymentToken = default; + Option paywithgoogleToken = default; + Option samsungpayToken = default; + Option visacheckoutCallId = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "androidpay.token": + androidpayToken = new Option(utf8JsonReader.GetString()); + break; + case "masterpass.transactionId": + masterpassTransactionId = new Option(utf8JsonReader.GetString()); + break; + case "payment.token": + paymentToken = new Option(utf8JsonReader.GetString()); + break; + case "paywithgoogle.token": + paywithgoogleToken = new Option(utf8JsonReader.GetString()); + break; + case "samsungpay.token": + samsungpayToken = new Option(utf8JsonReader.GetString()); + break; + case "visacheckout.callId": + visacheckoutCallId = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AndroidpayToken == input.AndroidpayToken || - (this.AndroidpayToken != null && - this.AndroidpayToken.Equals(input.AndroidpayToken)) - ) && - ( - this.MasterpassTransactionId == input.MasterpassTransactionId || - (this.MasterpassTransactionId != null && - this.MasterpassTransactionId.Equals(input.MasterpassTransactionId)) - ) && - ( - this.PaymentToken == input.PaymentToken || - (this.PaymentToken != null && - this.PaymentToken.Equals(input.PaymentToken)) - ) && - ( - this.PaywithgoogleToken == input.PaywithgoogleToken || - (this.PaywithgoogleToken != null && - this.PaywithgoogleToken.Equals(input.PaywithgoogleToken)) - ) && - ( - this.SamsungpayToken == input.SamsungpayToken || - (this.SamsungpayToken != null && - this.SamsungpayToken.Equals(input.SamsungpayToken)) - ) && - ( - this.VisacheckoutCallId == input.VisacheckoutCallId || - (this.VisacheckoutCallId != null && - this.VisacheckoutCallId.Equals(input.VisacheckoutCallId)) - ); + + if (androidpayToken.IsSet && androidpayToken.Value == null) + throw new ArgumentNullException(nameof(androidpayToken), "Property is not nullable for class AdditionalDataWallets."); + + if (masterpassTransactionId.IsSet && masterpassTransactionId.Value == null) + throw new ArgumentNullException(nameof(masterpassTransactionId), "Property is not nullable for class AdditionalDataWallets."); + + if (paymentToken.IsSet && paymentToken.Value == null) + throw new ArgumentNullException(nameof(paymentToken), "Property is not nullable for class AdditionalDataWallets."); + + if (paywithgoogleToken.IsSet && paywithgoogleToken.Value == null) + throw new ArgumentNullException(nameof(paywithgoogleToken), "Property is not nullable for class AdditionalDataWallets."); + + if (samsungpayToken.IsSet && samsungpayToken.Value == null) + throw new ArgumentNullException(nameof(samsungpayToken), "Property is not nullable for class AdditionalDataWallets."); + + if (visacheckoutCallId.IsSet && visacheckoutCallId.Value == null) + throw new ArgumentNullException(nameof(visacheckoutCallId), "Property is not nullable for class AdditionalDataWallets."); + + return new AdditionalDataWallets(androidpayToken, masterpassTransactionId, paymentToken, paywithgoogleToken, samsungpayToken, visacheckoutCallId); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalDataWallets additionalDataWallets, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AndroidpayToken != null) - { - hashCode = (hashCode * 59) + this.AndroidpayToken.GetHashCode(); - } - if (this.MasterpassTransactionId != null) - { - hashCode = (hashCode * 59) + this.MasterpassTransactionId.GetHashCode(); - } - if (this.PaymentToken != null) - { - hashCode = (hashCode * 59) + this.PaymentToken.GetHashCode(); - } - if (this.PaywithgoogleToken != null) - { - hashCode = (hashCode * 59) + this.PaywithgoogleToken.GetHashCode(); - } - if (this.SamsungpayToken != null) - { - hashCode = (hashCode * 59) + this.SamsungpayToken.GetHashCode(); - } - if (this.VisacheckoutCallId != null) - { - hashCode = (hashCode * 59) + this.VisacheckoutCallId.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, additionalDataWallets, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AdditionalDataWallets additionalDataWallets, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (additionalDataWallets.AndroidpayTokenOption.IsSet && additionalDataWallets.AndroidpayToken == null) + throw new ArgumentNullException(nameof(additionalDataWallets.AndroidpayToken), "Property is required for class AdditionalDataWallets."); + + if (additionalDataWallets.MasterpassTransactionIdOption.IsSet && additionalDataWallets.MasterpassTransactionId == null) + throw new ArgumentNullException(nameof(additionalDataWallets.MasterpassTransactionId), "Property is required for class AdditionalDataWallets."); + + if (additionalDataWallets.PaymentTokenOption.IsSet && additionalDataWallets.PaymentToken == null) + throw new ArgumentNullException(nameof(additionalDataWallets.PaymentToken), "Property is required for class AdditionalDataWallets."); + + if (additionalDataWallets.PaywithgoogleTokenOption.IsSet && additionalDataWallets.PaywithgoogleToken == null) + throw new ArgumentNullException(nameof(additionalDataWallets.PaywithgoogleToken), "Property is required for class AdditionalDataWallets."); + + if (additionalDataWallets.SamsungpayTokenOption.IsSet && additionalDataWallets.SamsungpayToken == null) + throw new ArgumentNullException(nameof(additionalDataWallets.SamsungpayToken), "Property is required for class AdditionalDataWallets."); + + if (additionalDataWallets.VisacheckoutCallIdOption.IsSet && additionalDataWallets.VisacheckoutCallId == null) + throw new ArgumentNullException(nameof(additionalDataWallets.VisacheckoutCallId), "Property is required for class AdditionalDataWallets."); + + if (additionalDataWallets.AndroidpayTokenOption.IsSet) + writer.WriteString("androidpay.token", additionalDataWallets.AndroidpayToken); + + if (additionalDataWallets.MasterpassTransactionIdOption.IsSet) + writer.WriteString("masterpass.transactionId", additionalDataWallets.MasterpassTransactionId); + + if (additionalDataWallets.PaymentTokenOption.IsSet) + writer.WriteString("payment.token", additionalDataWallets.PaymentToken); + + if (additionalDataWallets.PaywithgoogleTokenOption.IsSet) + writer.WriteString("paywithgoogle.token", additionalDataWallets.PaywithgoogleToken); + + if (additionalDataWallets.SamsungpayTokenOption.IsSet) + writer.WriteString("samsungpay.token", additionalDataWallets.SamsungpayToken); + + if (additionalDataWallets.VisacheckoutCallIdOption.IsSet) + writer.WriteString("visacheckout.callId", additionalDataWallets.VisacheckoutCallId); } } - } diff --git a/Adyen/Model/Checkout/Address.cs b/Adyen/Model/Checkout/Address.cs index 089bbaee7..d8df84966 100644 --- a/Adyen/Model/Checkout/Address.cs +++ b/Adyen/Model/Checkout/Address.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,89 +14,92 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Address /// - [DataContract(Name = "Address")] - public partial class Address : IEquatable
, IValidatableObject + public partial class Address : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected Address() { } - /// - /// Initializes a new instance of the class. - /// - /// The name of the city. Maximum length: 3000 characters. (required). - /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. (required). - /// The number or name of the house. Maximum length: 3000 characters. (required). - /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. (required). - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada.. - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. (required). - public Address(string city = default(string), string country = default(string), string houseNumberOrName = default(string), string postalCode = default(string), string stateOrProvince = default(string), string street = default(string)) + /// The name of the city. Maximum length: 3000 characters. + /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + /// The number or name of the house. Maximum length: 3000 characters. + /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + [JsonConstructor] + public Address(string city, string country, string houseNumberOrName, string postalCode, string street, Option stateOrProvince = default) { - this.City = city; - this.Country = country; - this.HouseNumberOrName = houseNumberOrName; - this.PostalCode = postalCode; - this.Street = street; - this.StateOrProvince = stateOrProvince; + City = city; + Country = country; + HouseNumberOrName = houseNumberOrName; + PostalCode = postalCode; + Street = street; + StateOrProvinceOption = stateOrProvince; + OnCreated(); } + partial void OnCreated(); + /// /// The name of the city. Maximum length: 3000 characters. /// /// The name of the city. Maximum length: 3000 characters. - [DataMember(Name = "city", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("city")] public string City { get; set; } /// /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. /// /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. - [DataMember(Name = "country", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("country")] public string Country { get; set; } /// /// The number or name of the house. Maximum length: 3000 characters. /// /// The number or name of the house. Maximum length: 3000 characters. - [DataMember(Name = "houseNumberOrName", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("houseNumberOrName")] public string HouseNumberOrName { get; set; } /// /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. /// /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. - [DataMember(Name = "postalCode", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("postalCode")] public string PostalCode { get; set; } - /// - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. - /// - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. - [DataMember(Name = "stateOrProvince", EmitDefaultValue = false)] - public string StateOrProvince { get; set; } - /// /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. /// /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. - [DataMember(Name = "street", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("street")] public string Street { get; set; } + /// + /// Used to track the state of StateOrProvince + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StateOrProvinceOption { get; private set; } + + /// + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + /// + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + [JsonPropertyName("stateOrProvince")] + public string StateOrProvince { get { return this.StateOrProvinceOption; } set { this.StateOrProvinceOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -110,138 +112,199 @@ public override string ToString() sb.Append(" Country: ").Append(Country).Append("\n"); sb.Append(" HouseNumberOrName: ").Append(HouseNumberOrName).Append("\n"); sb.Append(" PostalCode: ").Append(PostalCode).Append("\n"); - sb.Append(" StateOrProvince: ").Append(StateOrProvince).Append("\n"); sb.Append(" Street: ").Append(Street).Append("\n"); + sb.Append(" StateOrProvince: ").Append(StateOrProvince).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Address); - } - - /// - /// Returns true if Address instances are equal - /// - /// Instance of Address to be compared - /// Boolean - public bool Equals(Address input) - { - if (input == null) - { - return false; - } - return - ( - this.City == input.City || - (this.City != null && - this.City.Equals(input.City)) - ) && - ( - this.Country == input.Country || - (this.Country != null && - this.Country.Equals(input.Country)) - ) && - ( - this.HouseNumberOrName == input.HouseNumberOrName || - (this.HouseNumberOrName != null && - this.HouseNumberOrName.Equals(input.HouseNumberOrName)) - ) && - ( - this.PostalCode == input.PostalCode || - (this.PostalCode != null && - this.PostalCode.Equals(input.PostalCode)) - ) && - ( - this.StateOrProvince == input.StateOrProvince || - (this.StateOrProvince != null && - this.StateOrProvince.Equals(input.StateOrProvince)) - ) && - ( - this.Street == input.Street || - (this.Street != null && - this.Street.Equals(input.Street)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.City != null) - { - hashCode = (hashCode * 59) + this.City.GetHashCode(); - } - if (this.Country != null) - { - hashCode = (hashCode * 59) + this.Country.GetHashCode(); - } - if (this.HouseNumberOrName != null) - { - hashCode = (hashCode * 59) + this.HouseNumberOrName.GetHashCode(); - } - if (this.PostalCode != null) - { - hashCode = (hashCode * 59) + this.PostalCode.GetHashCode(); - } - if (this.StateOrProvince != null) - { - hashCode = (hashCode * 59) + this.StateOrProvince.GetHashCode(); - } - if (this.Street != null) - { - hashCode = (hashCode * 59) + this.Street.GetHashCode(); - } - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // City (string) maxLength if (this.City != null && this.City.Length > 3000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for City, length must be less than 3000.", new [] { "City" }); + yield return new ValidationResult("Invalid value for City, length must be less than 3000.", new [] { "City" }); } // HouseNumberOrName (string) maxLength if (this.HouseNumberOrName != null && this.HouseNumberOrName.Length > 3000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for HouseNumberOrName, length must be less than 3000.", new [] { "HouseNumberOrName" }); + yield return new ValidationResult("Invalid value for HouseNumberOrName, length must be less than 3000.", new [] { "HouseNumberOrName" }); } // Street (string) maxLength if (this.Street != null && this.Street.Length > 3000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Street, length must be less than 3000.", new [] { "Street" }); + yield return new ValidationResult("Invalid value for Street, length must be less than 3000.", new [] { "Street" }); } yield break; } } + /// + /// A Json converter for type + /// + public class AddressJsonConverter : JsonConverter
+ { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Address Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option city = default; + Option country = default; + Option houseNumberOrName = default; + Option postalCode = default; + Option street = default; + Option stateOrProvince = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "city": + city = new Option(utf8JsonReader.GetString()); + break; + case "country": + country = new Option(utf8JsonReader.GetString()); + break; + case "houseNumberOrName": + houseNumberOrName = new Option(utf8JsonReader.GetString()); + break; + case "postalCode": + postalCode = new Option(utf8JsonReader.GetString()); + break; + case "street": + street = new Option(utf8JsonReader.GetString()); + break; + case "stateOrProvince": + stateOrProvince = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!city.IsSet) + throw new ArgumentException("Property is required for class Address.", nameof(city)); + + if (!country.IsSet) + throw new ArgumentException("Property is required for class Address.", nameof(country)); + + if (!houseNumberOrName.IsSet) + throw new ArgumentException("Property is required for class Address.", nameof(houseNumberOrName)); + + if (!postalCode.IsSet) + throw new ArgumentException("Property is required for class Address.", nameof(postalCode)); + + if (!street.IsSet) + throw new ArgumentException("Property is required for class Address.", nameof(street)); + + if (city.IsSet && city.Value == null) + throw new ArgumentNullException(nameof(city), "Property is not nullable for class Address."); + + if (country.IsSet && country.Value == null) + throw new ArgumentNullException(nameof(country), "Property is not nullable for class Address."); + + if (houseNumberOrName.IsSet && houseNumberOrName.Value == null) + throw new ArgumentNullException(nameof(houseNumberOrName), "Property is not nullable for class Address."); + + if (postalCode.IsSet && postalCode.Value == null) + throw new ArgumentNullException(nameof(postalCode), "Property is not nullable for class Address."); + + if (street.IsSet && street.Value == null) + throw new ArgumentNullException(nameof(street), "Property is not nullable for class Address."); + + if (stateOrProvince.IsSet && stateOrProvince.Value == null) + throw new ArgumentNullException(nameof(stateOrProvince), "Property is not nullable for class Address."); + + return new Address(city.Value, country.Value, houseNumberOrName.Value, postalCode.Value, street.Value, stateOrProvince); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Address address, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, address, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Address address, JsonSerializerOptions jsonSerializerOptions) + { + if (address.City == null) + throw new ArgumentNullException(nameof(address.City), "Property is required for class Address."); + + if (address.Country == null) + throw new ArgumentNullException(nameof(address.Country), "Property is required for class Address."); + + if (address.HouseNumberOrName == null) + throw new ArgumentNullException(nameof(address.HouseNumberOrName), "Property is required for class Address."); + + if (address.PostalCode == null) + throw new ArgumentNullException(nameof(address.PostalCode), "Property is required for class Address."); + + if (address.Street == null) + throw new ArgumentNullException(nameof(address.Street), "Property is required for class Address."); + + if (address.StateOrProvinceOption.IsSet && address.StateOrProvince == null) + throw new ArgumentNullException(nameof(address.StateOrProvince), "Property is required for class Address."); + + writer.WriteString("city", address.City); + + writer.WriteString("country", address.Country); + + writer.WriteString("houseNumberOrName", address.HouseNumberOrName); + + writer.WriteString("postalCode", address.PostalCode); + + writer.WriteString("street", address.Street); + + if (address.StateOrProvinceOption.IsSet) + writer.WriteString("stateOrProvince", address.StateOrProvince); + } + } } diff --git a/Adyen/Model/Checkout/AffirmDetails.cs b/Adyen/Model/Checkout/AffirmDetails.cs index d3ff4747b..2037a6693 100644 --- a/Adyen/Model/Checkout/AffirmDetails.cs +++ b/Adyen/Model/Checkout/AffirmDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,62 +14,115 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AffirmDetails /// - [DataContract(Name = "AffirmDetails")] - public partial class AffirmDetails : IEquatable, IValidatableObject + public partial class AffirmDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// **affirm** (default to TypeEnum.Affirm) + [JsonConstructor] + public AffirmDetails(Option checkoutAttemptId = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **affirm** /// /// **affirm** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Affirm for value: affirm /// - [EnumMember(Value = "affirm")] Affirm = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("affirm")) + return TypeEnum.Affirm; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("affirm")) + return TypeEnum.Affirm; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Affirm) + return "affirm"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **affirm** /// /// **affirm** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// **affirm** (default to TypeEnum.Affirm). - public AffirmDetails(string checkoutAttemptId = default(string), TypeEnum? type = TypeEnum.Affirm) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -87,73 +139,111 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AffirmDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AffirmDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AffirmDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AffirmDetails instances are equal - /// - /// Instance of AffirmDetails to be compared - /// Boolean - public bool Equals(AffirmDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(AffirmDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class AffirmDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class AffirmDetails."); + + return new AffirmDetails(checkoutAttemptId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AffirmDetails affirmDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, affirmDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AffirmDetails affirmDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (affirmDetails.CheckoutAttemptIdOption.IsSet && affirmDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(affirmDetails.CheckoutAttemptId), "Property is required for class AffirmDetails."); + + if (affirmDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", affirmDetails.CheckoutAttemptId); + + var typeRawValue = AffirmDetails.TypeEnumToJsonValue(affirmDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/AfterpayDetails.cs b/Adyen/Model/Checkout/AfterpayDetails.cs index ba49680ac..aa78d59dc 100644 --- a/Adyen/Model/Checkout/AfterpayDetails.cs +++ b/Adyen/Model/Checkout/AfterpayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,131 +14,231 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AfterpayDetails /// - [DataContract(Name = "AfterpayDetails")] - public partial class AfterpayDetails : IEquatable, IValidatableObject + public partial class AfterpayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The address where to send the invoice. + /// The checkout attempt identifier. + /// The address where the goods should be delivered. + /// Shopper name, date of birth, phone number, and email address. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **afterpay_default** (default to TypeEnum.AfterpayDefault) + [JsonConstructor] + public AfterpayDetails(Option billingAddress = default, Option checkoutAttemptId = default, Option deliveryAddress = default, Option personalDetails = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.AfterpayDefault) + { + BillingAddressOption = billingAddress; + CheckoutAttemptIdOption = checkoutAttemptId; + DeliveryAddressOption = deliveryAddress; + PersonalDetailsOption = personalDetails; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + Type = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **afterpay_default** /// /// **afterpay_default** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum AfterpayDefault for value: afterpay_default /// - [EnumMember(Value = "afterpay_default")] AfterpayDefault = 1, /// /// Enum Afterpaytouch for value: afterpaytouch /// - [EnumMember(Value = "afterpaytouch")] Afterpaytouch = 2, /// /// Enum AfterpayB2b for value: afterpay_b2b /// - [EnumMember(Value = "afterpay_b2b")] AfterpayB2b = 3, /// /// Enum Clearpay for value: clearpay /// - [EnumMember(Value = "clearpay")] Clearpay = 4 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("afterpay_default")) + return TypeEnum.AfterpayDefault; + + if (value.Equals("afterpaytouch")) + return TypeEnum.Afterpaytouch; + + if (value.Equals("afterpay_b2b")) + return TypeEnum.AfterpayB2b; + + if (value.Equals("clearpay")) + return TypeEnum.Clearpay; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("afterpay_default")) + return TypeEnum.AfterpayDefault; + + if (value.Equals("afterpaytouch")) + return TypeEnum.Afterpaytouch; + + if (value.Equals("afterpay_b2b")) + return TypeEnum.AfterpayB2b; + + if (value.Equals("clearpay")) + return TypeEnum.Clearpay; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.AfterpayDefault) + return "afterpay_default"; + + if (value == TypeEnum.Afterpaytouch) + return "afterpaytouch"; + + if (value == TypeEnum.AfterpayB2b) + return "afterpay_b2b"; + + if (value == TypeEnum.Clearpay) + return "clearpay"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **afterpay_default** /// /// **afterpay_default** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected AfterpayDetails() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of BillingAddress /// - /// The address where to send the invoice.. - /// The checkout attempt identifier.. - /// The address where the goods should be delivered.. - /// Shopper name, date of birth, phone number, and email address.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **afterpay_default** (required) (default to TypeEnum.AfterpayDefault). - public AfterpayDetails(string billingAddress = default(string), string checkoutAttemptId = default(string), string deliveryAddress = default(string), string personalDetails = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.AfterpayDefault) - { - this.Type = type; - this.BillingAddress = billingAddress; - this.CheckoutAttemptId = checkoutAttemptId; - this.DeliveryAddress = deliveryAddress; - this.PersonalDetails = personalDetails; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressOption { get; private set; } /// /// The address where to send the invoice. /// /// The address where to send the invoice. - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public string BillingAddress { get; set; } + [JsonPropertyName("billingAddress")] + public string BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryAddressOption { get; private set; } /// /// The address where the goods should be delivered. /// /// The address where the goods should be delivered. - [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] - public string DeliveryAddress { get; set; } + [JsonPropertyName("deliveryAddress")] + public string DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } + + /// + /// Used to track the state of PersonalDetails + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PersonalDetailsOption { get; private set; } /// /// Shopper name, date of birth, phone number, and email address. /// /// Shopper name, date of birth, phone number, and email address. - [DataMember(Name = "personalDetails", EmitDefaultValue = false)] - public string PersonalDetails { get; set; } + [JsonPropertyName("personalDetails")] + public string PersonalDetails { get { return this.PersonalDetailsOption; } set { this.PersonalDetailsOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -161,124 +260,185 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as AfterpayDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class AfterpayDetailsJsonConverter : JsonConverter + { /// - /// Returns true if AfterpayDetails instances are equal + /// Deserializes json to /// - /// Instance of AfterpayDetails to be compared - /// Boolean - public bool Equals(AfterpayDetails input) + /// + /// + /// + /// + /// + public override AfterpayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option billingAddress = default; + Option checkoutAttemptId = default; + Option deliveryAddress = default; + Option personalDetails = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "billingAddress": + billingAddress = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "deliveryAddress": + deliveryAddress = new Option(utf8JsonReader.GetString()); + break; + case "personalDetails": + personalDetails = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(AfterpayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) - ) && - ( - this.PersonalDetails == input.PersonalDetails || - (this.PersonalDetails != null && - this.PersonalDetails.Equals(input.PersonalDetails)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class AfterpayDetails.", nameof(type)); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class AfterpayDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class AfterpayDetails."); + + if (deliveryAddress.IsSet && deliveryAddress.Value == null) + throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class AfterpayDetails."); + + if (personalDetails.IsSet && personalDetails.Value == null) + throw new ArgumentNullException(nameof(personalDetails), "Property is not nullable for class AfterpayDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class AfterpayDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class AfterpayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class AfterpayDetails."); + + return new AfterpayDetails(billingAddress, checkoutAttemptId, deliveryAddress, personalDetails, recurringDetailReference, storedPaymentMethodId, type.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AfterpayDetails afterpayDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.DeliveryAddress != null) - { - hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); - } - if (this.PersonalDetails != null) - { - hashCode = (hashCode * 59) + this.PersonalDetails.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, afterpayDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AfterpayDetails afterpayDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (afterpayDetails.BillingAddressOption.IsSet && afterpayDetails.BillingAddress == null) + throw new ArgumentNullException(nameof(afterpayDetails.BillingAddress), "Property is required for class AfterpayDetails."); - yield break; + if (afterpayDetails.CheckoutAttemptIdOption.IsSet && afterpayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(afterpayDetails.CheckoutAttemptId), "Property is required for class AfterpayDetails."); + + if (afterpayDetails.DeliveryAddressOption.IsSet && afterpayDetails.DeliveryAddress == null) + throw new ArgumentNullException(nameof(afterpayDetails.DeliveryAddress), "Property is required for class AfterpayDetails."); + + if (afterpayDetails.PersonalDetailsOption.IsSet && afterpayDetails.PersonalDetails == null) + throw new ArgumentNullException(nameof(afterpayDetails.PersonalDetails), "Property is required for class AfterpayDetails."); + + if (afterpayDetails.RecurringDetailReferenceOption.IsSet && afterpayDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(afterpayDetails.RecurringDetailReference), "Property is required for class AfterpayDetails."); + + if (afterpayDetails.StoredPaymentMethodIdOption.IsSet && afterpayDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(afterpayDetails.StoredPaymentMethodId), "Property is required for class AfterpayDetails."); + + if (afterpayDetails.BillingAddressOption.IsSet) + writer.WriteString("billingAddress", afterpayDetails.BillingAddress); + + if (afterpayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", afterpayDetails.CheckoutAttemptId); + + if (afterpayDetails.DeliveryAddressOption.IsSet) + writer.WriteString("deliveryAddress", afterpayDetails.DeliveryAddress); + + if (afterpayDetails.PersonalDetailsOption.IsSet) + writer.WriteString("personalDetails", afterpayDetails.PersonalDetails); + + if (afterpayDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", afterpayDetails.RecurringDetailReference); + + if (afterpayDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", afterpayDetails.StoredPaymentMethodId); + + var typeRawValue = AfterpayDetails.TypeEnumToJsonValue(afterpayDetails.Type); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/Agency.cs b/Adyen/Model/Checkout/Agency.cs index f77419dd5..d49b4a3ab 100644 --- a/Adyen/Model/Checkout/Agency.cs +++ b/Adyen/Model/Checkout/Agency.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,47 +14,62 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Agency /// - [DataContract(Name = "Agency")] - public partial class Agency : IEquatable, IValidatableObject + public partial class Agency : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters. - /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters. - public Agency(string invoiceNumber = default(string), string planName = default(string)) + /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters + /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters + [JsonConstructor] + public Agency(Option invoiceNumber = default, Option planName = default) { - this.InvoiceNumber = invoiceNumber; - this.PlanName = planName; + InvoiceNumberOption = invoiceNumber; + PlanNameOption = planName; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of InvoiceNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InvoiceNumberOption { get; private set; } + /// /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters /// /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters - [DataMember(Name = "invoiceNumber", EmitDefaultValue = false)] - public string InvoiceNumber { get; set; } + [JsonPropertyName("invoiceNumber")] + public string InvoiceNumber { get { return this.InvoiceNumberOption; } set { this.InvoiceNumberOption = new Option(value); } } + + /// + /// Used to track the state of PlanName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PlanNameOption { get; private set; } /// /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters /// /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters - [DataMember(Name = "planName", EmitDefaultValue = false)] - public string PlanName { get; set; } + [JsonPropertyName("planName")] + public string PlanName { get { return this.PlanNameOption; } set { this.PlanNameOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -72,77 +86,112 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AgencyJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override Agency Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as Agency); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if Agency instances are equal - /// - /// Instance of Agency to be compared - /// Boolean - public bool Equals(Agency input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option invoiceNumber = default; + Option planName = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "invoiceNumber": + invoiceNumber = new Option(utf8JsonReader.GetString()); + break; + case "planName": + planName = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.InvoiceNumber == input.InvoiceNumber || - (this.InvoiceNumber != null && - this.InvoiceNumber.Equals(input.InvoiceNumber)) - ) && - ( - this.PlanName == input.PlanName || - (this.PlanName != null && - this.PlanName.Equals(input.PlanName)) - ); + + if (invoiceNumber.IsSet && invoiceNumber.Value == null) + throw new ArgumentNullException(nameof(invoiceNumber), "Property is not nullable for class Agency."); + + if (planName.IsSet && planName.Value == null) + throw new ArgumentNullException(nameof(planName), "Property is not nullable for class Agency."); + + return new Agency(invoiceNumber, planName); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Agency agency, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.InvoiceNumber != null) - { - hashCode = (hashCode * 59) + this.InvoiceNumber.GetHashCode(); - } - if (this.PlanName != null) - { - hashCode = (hashCode * 59) + this.PlanName.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, agency, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Agency agency, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (agency.InvoiceNumberOption.IsSet && agency.InvoiceNumber == null) + throw new ArgumentNullException(nameof(agency.InvoiceNumber), "Property is required for class Agency."); + + if (agency.PlanNameOption.IsSet && agency.PlanName == null) + throw new ArgumentNullException(nameof(agency.PlanName), "Property is required for class Agency."); + + if (agency.InvoiceNumberOption.IsSet) + writer.WriteString("invoiceNumber", agency.InvoiceNumber); + + if (agency.PlanNameOption.IsSet) + writer.WriteString("planName", agency.PlanName); } } - } diff --git a/Adyen/Model/Checkout/Airline.cs b/Adyen/Model/Checkout/Airline.cs index 224947ca9..239cd551e 100644 --- a/Adyen/Model/Checkout/Airline.cs +++ b/Adyen/Model/Checkout/Airline.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,146 +14,226 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Airline /// - [DataContract(Name = "Airline")] - public partial class Airline : IEquatable, IValidatableObject + public partial class Airline : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected Airline() { } - /// - /// Initializes a new instance of the class. - /// - /// agency. - /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 11 characters. - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters. - /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not start with a space or be all spaces.. - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces.. - /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters. - /// The flight departure date. Time is optional. * Format for date only: `yyyy-MM-dd` * Format for date and time: `yyyy-MM-ddTHH:mm` * Use local time of departure airport. * minLength: 10 characters * maxLength: 16 characters. - /// legs. - /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not start with a space or be all spaces. * Must not be all zeros. (required). - /// passengers. - /// ticket. - /// travelAgency. - public Airline(Agency agency = default(Agency), long? boardingFee = default(long?), string code = default(string), string computerizedReservationSystem = default(string), string customerReferenceNumber = default(string), string designatorCode = default(string), string documentType = default(string), DateTime flightDate = default(DateTime), List legs = default(List), string passengerName = default(string), List passengers = default(List), Ticket ticket = default(Ticket), TravelAgency travelAgency = default(TravelAgency)) + /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not start with a space or be all spaces. * Must not be all zeros. + /// agency + /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 11 characters + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. + /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters + /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not start with a space or be all spaces. + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. + /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters + /// The flight departure date. Time is optional. * Format for date only: `yyyy-MM-dd` * Format for date and time: `yyyy-MM-ddTHH:mm` * Use local time of departure airport. * minLength: 10 characters * maxLength: 16 characters + /// legs + /// passengers + /// ticket + /// travelAgency + [JsonConstructor] + public Airline(string passengerName, Option agency = default, Option boardingFee = default, Option code = default, Option computerizedReservationSystem = default, Option customerReferenceNumber = default, Option designatorCode = default, Option documentType = default, Option flightDate = default, Option> legs = default, Option> passengers = default, Option ticket = default, Option travelAgency = default) { - this.PassengerName = passengerName; - this.Agency = agency; - this.BoardingFee = boardingFee; - this.Code = code; - this.ComputerizedReservationSystem = computerizedReservationSystem; - this.CustomerReferenceNumber = customerReferenceNumber; - this.DesignatorCode = designatorCode; - this.DocumentType = documentType; - this.FlightDate = flightDate; - this.Legs = legs; - this.Passengers = passengers; - this.Ticket = ticket; - this.TravelAgency = travelAgency; + PassengerName = passengerName; + AgencyOption = agency; + BoardingFeeOption = boardingFee; + CodeOption = code; + ComputerizedReservationSystemOption = computerizedReservationSystem; + CustomerReferenceNumberOption = customerReferenceNumber; + DesignatorCodeOption = designatorCode; + DocumentTypeOption = documentType; + FlightDateOption = flightDate; + LegsOption = legs; + PassengersOption = passengers; + TicketOption = ticket; + TravelAgencyOption = travelAgency; + OnCreated(); } + partial void OnCreated(); + + /// + /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not start with a space or be all spaces. * Must not be all zeros. + /// + /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not start with a space or be all spaces. * Must not be all zeros. + [JsonPropertyName("passengerName")] + public string PassengerName { get; set; } + + /// + /// Used to track the state of Agency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AgencyOption { get; private set; } + /// /// Gets or Sets Agency /// - [DataMember(Name = "agency", EmitDefaultValue = false)] - public Agency Agency { get; set; } + [JsonPropertyName("agency")] + public Agency Agency { get { return this.AgencyOption; } set { this.AgencyOption = new Option(value); } } + + /// + /// Used to track the state of BoardingFee + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BoardingFeeOption { get; private set; } /// /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 11 characters /// /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 11 characters - [DataMember(Name = "boardingFee", EmitDefaultValue = false)] - public long? BoardingFee { get; set; } + [JsonPropertyName("boardingFee")] + public long? BoardingFee { get { return this.BoardingFeeOption; } set { this.BoardingFeeOption = new Option(value); } } + + /// + /// Used to track the state of Code + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CodeOption { get; private set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "code", EmitDefaultValue = false)] - public string Code { get; set; } + [JsonPropertyName("code")] + public string Code { get { return this.CodeOption; } set { this.CodeOption = new Option(value); } } + + /// + /// Used to track the state of ComputerizedReservationSystem + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ComputerizedReservationSystemOption { get; private set; } /// /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters /// /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters - [DataMember(Name = "computerizedReservationSystem", EmitDefaultValue = false)] - public string ComputerizedReservationSystem { get; set; } + [JsonPropertyName("computerizedReservationSystem")] + public string ComputerizedReservationSystem { get { return this.ComputerizedReservationSystemOption; } set { this.ComputerizedReservationSystemOption = new Option(value); } } + + /// + /// Used to track the state of CustomerReferenceNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CustomerReferenceNumberOption { get; private set; } /// /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not start with a space or be all spaces. /// /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not start with a space or be all spaces. - [DataMember(Name = "customerReferenceNumber", EmitDefaultValue = false)] - public string CustomerReferenceNumber { get; set; } + [JsonPropertyName("customerReferenceNumber")] + public string CustomerReferenceNumber { get { return this.CustomerReferenceNumberOption; } set { this.CustomerReferenceNumberOption = new Option(value); } } + + /// + /// Used to track the state of DesignatorCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DesignatorCodeOption { get; private set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. - [DataMember(Name = "designatorCode", EmitDefaultValue = false)] - public string DesignatorCode { get; set; } + [JsonPropertyName("designatorCode")] + public string DesignatorCode { get { return this.DesignatorCodeOption; } set { this.DesignatorCodeOption = new Option(value); } } + + /// + /// Used to track the state of DocumentType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DocumentTypeOption { get; private set; } /// /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters /// /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters - [DataMember(Name = "documentType", EmitDefaultValue = false)] - public string DocumentType { get; set; } + [JsonPropertyName("documentType")] + public string DocumentType { get { return this.DocumentTypeOption; } set { this.DocumentTypeOption = new Option(value); } } + + /// + /// Used to track the state of FlightDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FlightDateOption { get; private set; } /// /// The flight departure date. Time is optional. * Format for date only: `yyyy-MM-dd` * Format for date and time: `yyyy-MM-ddTHH:mm` * Use local time of departure airport. * minLength: 10 characters * maxLength: 16 characters /// /// The flight departure date. Time is optional. * Format for date only: `yyyy-MM-dd` * Format for date and time: `yyyy-MM-ddTHH:mm` * Use local time of departure airport. * minLength: 10 characters * maxLength: 16 characters - [DataMember(Name = "flightDate", EmitDefaultValue = false)] - public DateTime FlightDate { get; set; } + [JsonPropertyName("flightDate")] + public DateTime? FlightDate { get { return this.FlightDateOption; } set { this.FlightDateOption = new Option(value); } } + + /// + /// Used to track the state of Legs + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LegsOption { get; private set; } /// /// Gets or Sets Legs /// - [DataMember(Name = "legs", EmitDefaultValue = false)] - public List Legs { get; set; } + [JsonPropertyName("legs")] + public List Legs { get { return this.LegsOption; } set { this.LegsOption = new Option>(value); } } /// - /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not start with a space or be all spaces. * Must not be all zeros. + /// Used to track the state of Passengers /// - /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "passengerName", IsRequired = false, EmitDefaultValue = false)] - public string PassengerName { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> PassengersOption { get; private set; } /// /// Gets or Sets Passengers /// - [DataMember(Name = "passengers", EmitDefaultValue = false)] - public List Passengers { get; set; } + [JsonPropertyName("passengers")] + public List Passengers { get { return this.PassengersOption; } set { this.PassengersOption = new Option>(value); } } + + /// + /// Used to track the state of Ticket + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TicketOption { get; private set; } /// /// Gets or Sets Ticket /// - [DataMember(Name = "ticket", EmitDefaultValue = false)] - public Ticket Ticket { get; set; } + [JsonPropertyName("ticket")] + public Ticket Ticket { get { return this.TicketOption; } set { this.TicketOption = new Option(value); } } + + /// + /// Used to track the state of TravelAgency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TravelAgencyOption { get; private set; } /// /// Gets or Sets TravelAgency /// - [DataMember(Name = "travelAgency", EmitDefaultValue = false)] - public TravelAgency TravelAgency { get; set; } + [JsonPropertyName("travelAgency")] + public TravelAgency TravelAgency { get { return this.TravelAgencyOption; } set { this.TravelAgencyOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -164,6 +243,7 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Airline {\n"); + sb.Append(" PassengerName: ").Append(PassengerName).Append("\n"); sb.Append(" Agency: ").Append(Agency).Append("\n"); sb.Append(" BoardingFee: ").Append(BoardingFee).Append("\n"); sb.Append(" Code: ").Append(Code).Append("\n"); @@ -173,7 +253,6 @@ public override string ToString() sb.Append(" DocumentType: ").Append(DocumentType).Append("\n"); sb.Append(" FlightDate: ").Append(FlightDate).Append("\n"); sb.Append(" Legs: ").Append(Legs).Append("\n"); - sb.Append(" PassengerName: ").Append(PassengerName).Append("\n"); sb.Append(" Passengers: ").Append(Passengers).Append("\n"); sb.Append(" Ticket: ").Append(Ticket).Append("\n"); sb.Append(" TravelAgency: ").Append(TravelAgency).Append("\n"); @@ -182,174 +261,274 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AirlineJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// The format to use to serialize FlightDate /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Airline); - } + public static string FlightDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// Returns true if Airline instances are equal + /// Deserializes json to /// - /// Instance of Airline to be compared - /// Boolean - public bool Equals(Airline input) + /// + /// + /// + /// + /// + public override Airline Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option passengerName = default; + Option agency = default; + Option boardingFee = default; + Option code = default; + Option computerizedReservationSystem = default; + Option customerReferenceNumber = default; + Option designatorCode = default; + Option documentType = default; + Option flightDate = default; + Option> legs = default; + Option> passengers = default; + Option ticket = default; + Option travelAgency = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "passengerName": + passengerName = new Option(utf8JsonReader.GetString()); + break; + case "agency": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + agency = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "boardingFee": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + boardingFee = new Option(utf8JsonReader.GetInt64()); + break; + case "code": + code = new Option(utf8JsonReader.GetString()); + break; + case "computerizedReservationSystem": + computerizedReservationSystem = new Option(utf8JsonReader.GetString()); + break; + case "customerReferenceNumber": + customerReferenceNumber = new Option(utf8JsonReader.GetString()); + break; + case "designatorCode": + designatorCode = new Option(utf8JsonReader.GetString()); + break; + case "documentType": + documentType = new Option(utf8JsonReader.GetString()); + break; + case "flightDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + flightDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "legs": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + legs = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "passengers": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + passengers = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "ticket": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + ticket = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "travelAgency": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + travelAgency = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.Agency == input.Agency || - (this.Agency != null && - this.Agency.Equals(input.Agency)) - ) && - ( - this.BoardingFee == input.BoardingFee || - this.BoardingFee.Equals(input.BoardingFee) - ) && - ( - this.Code == input.Code || - (this.Code != null && - this.Code.Equals(input.Code)) - ) && - ( - this.ComputerizedReservationSystem == input.ComputerizedReservationSystem || - (this.ComputerizedReservationSystem != null && - this.ComputerizedReservationSystem.Equals(input.ComputerizedReservationSystem)) - ) && - ( - this.CustomerReferenceNumber == input.CustomerReferenceNumber || - (this.CustomerReferenceNumber != null && - this.CustomerReferenceNumber.Equals(input.CustomerReferenceNumber)) - ) && - ( - this.DesignatorCode == input.DesignatorCode || - (this.DesignatorCode != null && - this.DesignatorCode.Equals(input.DesignatorCode)) - ) && - ( - this.DocumentType == input.DocumentType || - (this.DocumentType != null && - this.DocumentType.Equals(input.DocumentType)) - ) && - ( - this.FlightDate == input.FlightDate || - (this.FlightDate != null && - this.FlightDate.Equals(input.FlightDate)) - ) && - ( - this.Legs == input.Legs || - this.Legs != null && - input.Legs != null && - this.Legs.SequenceEqual(input.Legs) - ) && - ( - this.PassengerName == input.PassengerName || - (this.PassengerName != null && - this.PassengerName.Equals(input.PassengerName)) - ) && - ( - this.Passengers == input.Passengers || - this.Passengers != null && - input.Passengers != null && - this.Passengers.SequenceEqual(input.Passengers) - ) && - ( - this.Ticket == input.Ticket || - (this.Ticket != null && - this.Ticket.Equals(input.Ticket)) - ) && - ( - this.TravelAgency == input.TravelAgency || - (this.TravelAgency != null && - this.TravelAgency.Equals(input.TravelAgency)) - ); + + if (!passengerName.IsSet) + throw new ArgumentException("Property is required for class Airline.", nameof(passengerName)); + + if (passengerName.IsSet && passengerName.Value == null) + throw new ArgumentNullException(nameof(passengerName), "Property is not nullable for class Airline."); + + if (agency.IsSet && agency.Value == null) + throw new ArgumentNullException(nameof(agency), "Property is not nullable for class Airline."); + + if (boardingFee.IsSet && boardingFee.Value == null) + throw new ArgumentNullException(nameof(boardingFee), "Property is not nullable for class Airline."); + + if (code.IsSet && code.Value == null) + throw new ArgumentNullException(nameof(code), "Property is not nullable for class Airline."); + + if (computerizedReservationSystem.IsSet && computerizedReservationSystem.Value == null) + throw new ArgumentNullException(nameof(computerizedReservationSystem), "Property is not nullable for class Airline."); + + if (customerReferenceNumber.IsSet && customerReferenceNumber.Value == null) + throw new ArgumentNullException(nameof(customerReferenceNumber), "Property is not nullable for class Airline."); + + if (designatorCode.IsSet && designatorCode.Value == null) + throw new ArgumentNullException(nameof(designatorCode), "Property is not nullable for class Airline."); + + if (documentType.IsSet && documentType.Value == null) + throw new ArgumentNullException(nameof(documentType), "Property is not nullable for class Airline."); + + if (flightDate.IsSet && flightDate.Value == null) + throw new ArgumentNullException(nameof(flightDate), "Property is not nullable for class Airline."); + + if (legs.IsSet && legs.Value == null) + throw new ArgumentNullException(nameof(legs), "Property is not nullable for class Airline."); + + if (passengers.IsSet && passengers.Value == null) + throw new ArgumentNullException(nameof(passengers), "Property is not nullable for class Airline."); + + if (ticket.IsSet && ticket.Value == null) + throw new ArgumentNullException(nameof(ticket), "Property is not nullable for class Airline."); + + if (travelAgency.IsSet && travelAgency.Value == null) + throw new ArgumentNullException(nameof(travelAgency), "Property is not nullable for class Airline."); + + return new Airline(passengerName.Value, agency, boardingFee, code, computerizedReservationSystem, customerReferenceNumber, designatorCode, documentType, flightDate, legs, passengers, ticket, travelAgency); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Airline airline, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Agency != null) - { - hashCode = (hashCode * 59) + this.Agency.GetHashCode(); - } - hashCode = (hashCode * 59) + this.BoardingFee.GetHashCode(); - if (this.Code != null) - { - hashCode = (hashCode * 59) + this.Code.GetHashCode(); - } - if (this.ComputerizedReservationSystem != null) - { - hashCode = (hashCode * 59) + this.ComputerizedReservationSystem.GetHashCode(); - } - if (this.CustomerReferenceNumber != null) - { - hashCode = (hashCode * 59) + this.CustomerReferenceNumber.GetHashCode(); - } - if (this.DesignatorCode != null) - { - hashCode = (hashCode * 59) + this.DesignatorCode.GetHashCode(); - } - if (this.DocumentType != null) - { - hashCode = (hashCode * 59) + this.DocumentType.GetHashCode(); - } - if (this.FlightDate != null) - { - hashCode = (hashCode * 59) + this.FlightDate.GetHashCode(); - } - if (this.Legs != null) - { - hashCode = (hashCode * 59) + this.Legs.GetHashCode(); - } - if (this.PassengerName != null) - { - hashCode = (hashCode * 59) + this.PassengerName.GetHashCode(); - } - if (this.Passengers != null) - { - hashCode = (hashCode * 59) + this.Passengers.GetHashCode(); - } - if (this.Ticket != null) - { - hashCode = (hashCode * 59) + this.Ticket.GetHashCode(); - } - if (this.TravelAgency != null) - { - hashCode = (hashCode * 59) + this.TravelAgency.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, airline, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Airline airline, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (airline.PassengerName == null) + throw new ArgumentNullException(nameof(airline.PassengerName), "Property is required for class Airline."); + + if (airline.AgencyOption.IsSet && airline.Agency == null) + throw new ArgumentNullException(nameof(airline.Agency), "Property is required for class Airline."); + + if (airline.CodeOption.IsSet && airline.Code == null) + throw new ArgumentNullException(nameof(airline.Code), "Property is required for class Airline."); + + if (airline.ComputerizedReservationSystemOption.IsSet && airline.ComputerizedReservationSystem == null) + throw new ArgumentNullException(nameof(airline.ComputerizedReservationSystem), "Property is required for class Airline."); + + if (airline.CustomerReferenceNumberOption.IsSet && airline.CustomerReferenceNumber == null) + throw new ArgumentNullException(nameof(airline.CustomerReferenceNumber), "Property is required for class Airline."); + + if (airline.DesignatorCodeOption.IsSet && airline.DesignatorCode == null) + throw new ArgumentNullException(nameof(airline.DesignatorCode), "Property is required for class Airline."); + + if (airline.DocumentTypeOption.IsSet && airline.DocumentType == null) + throw new ArgumentNullException(nameof(airline.DocumentType), "Property is required for class Airline."); + + if (airline.LegsOption.IsSet && airline.Legs == null) + throw new ArgumentNullException(nameof(airline.Legs), "Property is required for class Airline."); + + if (airline.PassengersOption.IsSet && airline.Passengers == null) + throw new ArgumentNullException(nameof(airline.Passengers), "Property is required for class Airline."); + + if (airline.TicketOption.IsSet && airline.Ticket == null) + throw new ArgumentNullException(nameof(airline.Ticket), "Property is required for class Airline."); + + if (airline.TravelAgencyOption.IsSet && airline.TravelAgency == null) + throw new ArgumentNullException(nameof(airline.TravelAgency), "Property is required for class Airline."); + + writer.WriteString("passengerName", airline.PassengerName); + + if (airline.AgencyOption.IsSet) + { + writer.WritePropertyName("agency"); + JsonSerializer.Serialize(writer, airline.Agency, jsonSerializerOptions); + } + if (airline.BoardingFeeOption.IsSet) + writer.WriteNumber("boardingFee", airline.BoardingFeeOption.Value.Value); + + if (airline.CodeOption.IsSet) + writer.WriteString("code", airline.Code); + + if (airline.ComputerizedReservationSystemOption.IsSet) + writer.WriteString("computerizedReservationSystem", airline.ComputerizedReservationSystem); + + if (airline.CustomerReferenceNumberOption.IsSet) + writer.WriteString("customerReferenceNumber", airline.CustomerReferenceNumber); + + if (airline.DesignatorCodeOption.IsSet) + writer.WriteString("designatorCode", airline.DesignatorCode); + + if (airline.DocumentTypeOption.IsSet) + writer.WriteString("documentType", airline.DocumentType); + + if (airline.FlightDateOption.IsSet) + writer.WriteString("flightDate", airline.FlightDateOption.Value.Value.ToString(FlightDateFormat)); + + if (airline.LegsOption.IsSet) + { + writer.WritePropertyName("legs"); + JsonSerializer.Serialize(writer, airline.Legs, jsonSerializerOptions); + } + if (airline.PassengersOption.IsSet) + { + writer.WritePropertyName("passengers"); + JsonSerializer.Serialize(writer, airline.Passengers, jsonSerializerOptions); + } + if (airline.TicketOption.IsSet) + { + writer.WritePropertyName("ticket"); + JsonSerializer.Serialize(writer, airline.Ticket, jsonSerializerOptions); + } + if (airline.TravelAgencyOption.IsSet) + { + writer.WritePropertyName("travelAgency"); + JsonSerializer.Serialize(writer, airline.TravelAgency, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/AmazonPayDetails.cs b/Adyen/Model/Checkout/AmazonPayDetails.cs index df075513d..b47c7dc86 100644 --- a/Adyen/Model/Checkout/AmazonPayDetails.cs +++ b/Adyen/Model/Checkout/AmazonPayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,80 +14,147 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AmazonPayDetails /// - [DataContract(Name = "AmazonPayDetails")] - public partial class AmazonPayDetails : IEquatable, IValidatableObject + public partial class AmazonPayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// This is the `amazonPayToken` that you obtained from the [Get Checkout Session](https://amazon-pay-acquirer-guide.s3-eu-west-1.amazonaws.com/v1/amazon-pay-api-v2/checkout-session.html#get-checkout-session) response. This token is used for API only integration specifically. + /// The checkout attempt identifier. + /// The `checkoutSessionId` is used to identify the checkout session at the Amazon Pay side. This field is required only for drop-in and components integration, where it replaces the amazonPayToken. + /// **amazonpay** (default to TypeEnum.Amazonpay) + [JsonConstructor] + public AmazonPayDetails(Option amazonPayToken = default, Option checkoutAttemptId = default, Option checkoutSessionId = default, Option type = default) + { + AmazonPayTokenOption = amazonPayToken; + CheckoutAttemptIdOption = checkoutAttemptId; + CheckoutSessionIdOption = checkoutSessionId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **amazonpay** /// /// **amazonpay** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Amazonpay for value: amazonpay /// - [EnumMember(Value = "amazonpay")] Amazonpay = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("amazonpay")) + return TypeEnum.Amazonpay; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("amazonpay")) + return TypeEnum.Amazonpay; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Amazonpay) + return "amazonpay"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **amazonpay** /// /// **amazonpay** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of AmazonPayToken /// - /// This is the `amazonPayToken` that you obtained from the [Get Checkout Session](https://amazon-pay-acquirer-guide.s3-eu-west-1.amazonaws.com/v1/amazon-pay-api-v2/checkout-session.html#get-checkout-session) response. This token is used for API only integration specifically.. - /// The checkout attempt identifier.. - /// The `checkoutSessionId` is used to identify the checkout session at the Amazon Pay side. This field is required only for drop-in and components integration, where it replaces the amazonPayToken.. - /// **amazonpay** (default to TypeEnum.Amazonpay). - public AmazonPayDetails(string amazonPayToken = default(string), string checkoutAttemptId = default(string), string checkoutSessionId = default(string), TypeEnum? type = TypeEnum.Amazonpay) - { - this.AmazonPayToken = amazonPayToken; - this.CheckoutAttemptId = checkoutAttemptId; - this.CheckoutSessionId = checkoutSessionId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmazonPayTokenOption { get; private set; } /// /// This is the `amazonPayToken` that you obtained from the [Get Checkout Session](https://amazon-pay-acquirer-guide.s3-eu-west-1.amazonaws.com/v1/amazon-pay-api-v2/checkout-session.html#get-checkout-session) response. This token is used for API only integration specifically. /// /// This is the `amazonPayToken` that you obtained from the [Get Checkout Session](https://amazon-pay-acquirer-guide.s3-eu-west-1.amazonaws.com/v1/amazon-pay-api-v2/checkout-session.html#get-checkout-session) response. This token is used for API only integration specifically. - [DataMember(Name = "amazonPayToken", EmitDefaultValue = false)] - public string AmazonPayToken { get; set; } + [JsonPropertyName("amazonPayToken")] + public string AmazonPayToken { get { return this.AmazonPayTokenOption; } set { this.AmazonPayTokenOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutSessionId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutSessionIdOption { get; private set; } /// /// The `checkoutSessionId` is used to identify the checkout session at the Amazon Pay side. This field is required only for drop-in and components integration, where it replaces the amazonPayToken. /// /// The `checkoutSessionId` is used to identify the checkout session at the Amazon Pay side. This field is required only for drop-in and components integration, where it replaces the amazonPayToken. - [DataMember(Name = "checkoutSessionId", EmitDefaultValue = false)] - public string CheckoutSessionId { get; set; } + [JsonPropertyName("checkoutSessionId")] + public string CheckoutSessionId { get { return this.CheckoutSessionIdOption; } set { this.CheckoutSessionIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -107,91 +173,137 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AmazonPayDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AmazonPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AmazonPayDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AmazonPayDetails instances are equal - /// - /// Instance of AmazonPayDetails to be compared - /// Boolean - public bool Equals(AmazonPayDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amazonPayToken = default; + Option checkoutAttemptId = default; + Option checkoutSessionId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amazonPayToken": + amazonPayToken = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "checkoutSessionId": + checkoutSessionId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(AmazonPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.AmazonPayToken == input.AmazonPayToken || - (this.AmazonPayToken != null && - this.AmazonPayToken.Equals(input.AmazonPayToken)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.CheckoutSessionId == input.CheckoutSessionId || - (this.CheckoutSessionId != null && - this.CheckoutSessionId.Equals(input.CheckoutSessionId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (amazonPayToken.IsSet && amazonPayToken.Value == null) + throw new ArgumentNullException(nameof(amazonPayToken), "Property is not nullable for class AmazonPayDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class AmazonPayDetails."); + + if (checkoutSessionId.IsSet && checkoutSessionId.Value == null) + throw new ArgumentNullException(nameof(checkoutSessionId), "Property is not nullable for class AmazonPayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class AmazonPayDetails."); + + return new AmazonPayDetails(amazonPayToken, checkoutAttemptId, checkoutSessionId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AmazonPayDetails amazonPayDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AmazonPayToken != null) - { - hashCode = (hashCode * 59) + this.AmazonPayToken.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.CheckoutSessionId != null) - { - hashCode = (hashCode * 59) + this.CheckoutSessionId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, amazonPayDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AmazonPayDetails amazonPayDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (amazonPayDetails.AmazonPayTokenOption.IsSet && amazonPayDetails.AmazonPayToken == null) + throw new ArgumentNullException(nameof(amazonPayDetails.AmazonPayToken), "Property is required for class AmazonPayDetails."); + + if (amazonPayDetails.CheckoutAttemptIdOption.IsSet && amazonPayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(amazonPayDetails.CheckoutAttemptId), "Property is required for class AmazonPayDetails."); + + if (amazonPayDetails.CheckoutSessionIdOption.IsSet && amazonPayDetails.CheckoutSessionId == null) + throw new ArgumentNullException(nameof(amazonPayDetails.CheckoutSessionId), "Property is required for class AmazonPayDetails."); + + if (amazonPayDetails.AmazonPayTokenOption.IsSet) + writer.WriteString("amazonPayToken", amazonPayDetails.AmazonPayToken); + + if (amazonPayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", amazonPayDetails.CheckoutAttemptId); + + if (amazonPayDetails.CheckoutSessionIdOption.IsSet) + writer.WriteString("checkoutSessionId", amazonPayDetails.CheckoutSessionId); + + var typeRawValue = AmazonPayDetails.TypeEnumToJsonValue(amazonPayDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/Amount.cs b/Adyen/Model/Checkout/Amount.cs index 86a10a75e..4381cc577 100644 --- a/Adyen/Model/Checkout/Amount.cs +++ b/Adyen/Model/Checkout/Amount.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,52 +14,48 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Amount /// - [DataContract(Name = "Amount")] - public partial class Amount : IEquatable, IValidatableObject + public partial class Amount : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected Amount() { } - /// - /// Initializes a new instance of the class. - /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). (required). - /// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). (required). - public Amount(string currency = default(string), long? value = default(long?)) + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + /// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + [JsonConstructor] + public Amount(string currency, long value) { - this.Currency = currency; - this.Value = value; + Currency = currency; + Value = value; + OnCreated(); } + partial void OnCreated(); + /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). - [DataMember(Name = "currency", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("currency")] public string Currency { get; set; } /// /// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). /// /// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). - [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] - public long? Value { get; set; } + [JsonPropertyName("value")] + public long Value { get; set; } /// /// Returns the string presentation of the object @@ -77,85 +72,126 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // Currency (string) maxLength + if (this.Currency != null && this.Currency.Length > 3) + { + yield return new ValidationResult("Invalid value for Currency, length must be less than 3.", new [] { "Currency" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Amount); + // Currency (string) minLength + if (this.Currency != null && this.Currency.Length < 3) + { + yield return new ValidationResult("Invalid value for Currency, length must be greater than 3.", new [] { "Currency" }); + } + + yield break; } + } + /// + /// A Json converter for type + /// + public class AmountJsonConverter : JsonConverter + { /// - /// Returns true if Amount instances are equal + /// Deserializes json to /// - /// Instance of Amount to be compared - /// Boolean - public bool Equals(Amount input) + /// + /// + /// + /// + /// + public override Amount Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option currency = default; + Option value = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "currency": + currency = new Option(utf8JsonReader.GetString()); + break; + case "value": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + value = new Option(utf8JsonReader.GetInt64()); + break; + default: + break; + } + } } - return - ( - this.Currency == input.Currency || - (this.Currency != null && - this.Currency.Equals(input.Currency)) - ) && - ( - this.Value == input.Value || - this.Value.Equals(input.Value) - ); + + if (!currency.IsSet) + throw new ArgumentException("Property is required for class Amount.", nameof(currency)); + + if (!value.IsSet) + throw new ArgumentException("Property is required for class Amount.", nameof(value)); + + if (currency.IsSet && currency.Value == null) + throw new ArgumentNullException(nameof(currency), "Property is not nullable for class Amount."); + + if (value.IsSet && value.Value == null) + throw new ArgumentNullException(nameof(value), "Property is not nullable for class Amount."); + + return new Amount(currency.Value, value.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Amount amount, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Currency != null) - { - hashCode = (hashCode * 59) + this.Currency.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Value.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, amount, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Amount amount, JsonSerializerOptions jsonSerializerOptions) { - // Currency (string) maxLength - if (this.Currency != null && this.Currency.Length > 3) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Currency, length must be less than 3.", new [] { "Currency" }); - } + if (amount.Currency == null) + throw new ArgumentNullException(nameof(amount.Currency), "Property is required for class Amount."); - // Currency (string) minLength - if (this.Currency != null && this.Currency.Length < 3) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Currency, length must be greater than 3.", new [] { "Currency" }); - } + writer.WriteString("currency", amount.Currency); - yield break; + writer.WriteNumber("value", amount.Value); } } - } diff --git a/Adyen/Model/Checkout/Amounts.cs b/Adyen/Model/Checkout/Amounts.cs index 0383533bf..3512a6c0d 100644 --- a/Adyen/Model/Checkout/Amounts.cs +++ b/Adyen/Model/Checkout/Amounts.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,51 +14,47 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Amounts /// - [DataContract(Name = "Amounts")] - public partial class Amounts : IEquatable, IValidatableObject + public partial class Amounts : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected Amounts() { } - /// - /// Initializes a new instance of the class. - /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). (required). - /// The amounts of the donation (in [minor units](https://docs.adyen.com/development-resources/currency-codes/)). (required). - public Amounts(string currency = default(string), List values = default(List)) + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). + /// The amounts of the donation (in [minor units](https://docs.adyen.com/development-resources/currency-codes/)). + [JsonConstructor] + public Amounts(string currency, List values) { - this.Currency = currency; - this.Values = values; + Currency = currency; + Values = values; + OnCreated(); } + partial void OnCreated(); + /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). - [DataMember(Name = "currency", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("currency")] public string Currency { get; set; } /// /// The amounts of the donation (in [minor units](https://docs.adyen.com/development-resources/currency-codes/)). /// /// The amounts of the donation (in [minor units](https://docs.adyen.com/development-resources/currency-codes/)). - [DataMember(Name = "values", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("values")] public List Values { get; set; } /// @@ -77,78 +72,118 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AmountsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override Amounts Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as Amounts); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if Amounts instances are equal - /// - /// Instance of Amounts to be compared - /// Boolean - public bool Equals(Amounts input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option currency = default; + Option> values = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "currency": + currency = new Option(utf8JsonReader.GetString()); + break; + case "values": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + values = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.Currency == input.Currency || - (this.Currency != null && - this.Currency.Equals(input.Currency)) - ) && - ( - this.Values == input.Values || - this.Values != null && - input.Values != null && - this.Values.SequenceEqual(input.Values) - ); + + if (!currency.IsSet) + throw new ArgumentException("Property is required for class Amounts.", nameof(currency)); + + if (!values.IsSet) + throw new ArgumentException("Property is required for class Amounts.", nameof(values)); + + if (currency.IsSet && currency.Value == null) + throw new ArgumentNullException(nameof(currency), "Property is not nullable for class Amounts."); + + if (values.IsSet && values.Value == null) + throw new ArgumentNullException(nameof(values), "Property is not nullable for class Amounts."); + + return new Amounts(currency.Value, values.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Amounts amounts, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Currency != null) - { - hashCode = (hashCode * 59) + this.Currency.GetHashCode(); - } - if (this.Values != null) - { - hashCode = (hashCode * 59) + this.Values.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, amounts, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Amounts amounts, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (amounts.Currency == null) + throw new ArgumentNullException(nameof(amounts.Currency), "Property is required for class Amounts."); + + if (amounts.Values == null) + throw new ArgumentNullException(nameof(amounts.Values), "Property is required for class Amounts."); + + writer.WriteString("currency", amounts.Currency); + + writer.WritePropertyName("values"); + JsonSerializer.Serialize(writer, amounts.Values, jsonSerializerOptions); } } - } diff --git a/Adyen/Model/Checkout/AncvDetails.cs b/Adyen/Model/Checkout/AncvDetails.cs index d2b7365a6..ff61ee681 100644 --- a/Adyen/Model/Checkout/AncvDetails.cs +++ b/Adyen/Model/Checkout/AncvDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,90 +14,164 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AncvDetails /// - [DataContract(Name = "AncvDetails")] - public partial class AncvDetails : IEquatable, IValidatableObject + public partial class AncvDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// ANCV account identification (email or account number) + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **ancv** + [JsonConstructor] + public AncvDetails(Option beneficiaryId = default, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + BeneficiaryIdOption = beneficiaryId; + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **ancv** /// /// **ancv** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Ancv for value: ancv /// - [EnumMember(Value = "ancv")] Ancv = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("ancv")) + return TypeEnum.Ancv; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("ancv")) + return TypeEnum.Ancv; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Ancv) + return "ancv"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **ancv** /// /// **ancv** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of BeneficiaryId /// - /// ANCV account identification (email or account number). - /// The checkout attempt identifier.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **ancv**. - public AncvDetails(string beneficiaryId = default(string), string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = default(TypeEnum?)) - { - this.BeneficiaryId = beneficiaryId; - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BeneficiaryIdOption { get; private set; } /// /// ANCV account identification (email or account number) /// /// ANCV account identification (email or account number) - [DataMember(Name = "beneficiaryId", EmitDefaultValue = false)] - public string BeneficiaryId { get; set; } + [JsonPropertyName("beneficiaryId")] + public string BeneficiaryId { get { return this.BeneficiaryIdOption; } set { this.BeneficiaryIdOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -118,106 +191,156 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as AncvDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class AncvDetailsJsonConverter : JsonConverter + { /// - /// Returns true if AncvDetails instances are equal + /// Deserializes json to /// - /// Instance of AncvDetails to be compared - /// Boolean - public bool Equals(AncvDetails input) + /// + /// + /// + /// + /// + public override AncvDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option beneficiaryId = default; + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "beneficiaryId": + beneficiaryId = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(AncvDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.BeneficiaryId == input.BeneficiaryId || - (this.BeneficiaryId != null && - this.BeneficiaryId.Equals(input.BeneficiaryId)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (beneficiaryId.IsSet && beneficiaryId.Value == null) + throw new ArgumentNullException(nameof(beneficiaryId), "Property is not nullable for class AncvDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class AncvDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class AncvDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class AncvDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class AncvDetails."); + + return new AncvDetails(beneficiaryId, checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AncvDetails ancvDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BeneficiaryId != null) - { - hashCode = (hashCode * 59) + this.BeneficiaryId.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, ancvDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AncvDetails ancvDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (ancvDetails.BeneficiaryIdOption.IsSet && ancvDetails.BeneficiaryId == null) + throw new ArgumentNullException(nameof(ancvDetails.BeneficiaryId), "Property is required for class AncvDetails."); - yield break; + if (ancvDetails.CheckoutAttemptIdOption.IsSet && ancvDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(ancvDetails.CheckoutAttemptId), "Property is required for class AncvDetails."); + + if (ancvDetails.RecurringDetailReferenceOption.IsSet && ancvDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(ancvDetails.RecurringDetailReference), "Property is required for class AncvDetails."); + + if (ancvDetails.StoredPaymentMethodIdOption.IsSet && ancvDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(ancvDetails.StoredPaymentMethodId), "Property is required for class AncvDetails."); + + if (ancvDetails.BeneficiaryIdOption.IsSet) + writer.WriteString("beneficiaryId", ancvDetails.BeneficiaryId); + + if (ancvDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", ancvDetails.CheckoutAttemptId); + + if (ancvDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", ancvDetails.RecurringDetailReference); + + if (ancvDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", ancvDetails.StoredPaymentMethodId); + + var typeRawValue = AncvDetails.TypeEnumToJsonValue(ancvDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/AndroidPayDetails.cs b/Adyen/Model/Checkout/AndroidPayDetails.cs index 13933bbb6..420fd8bf2 100644 --- a/Adyen/Model/Checkout/AndroidPayDetails.cs +++ b/Adyen/Model/Checkout/AndroidPayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,62 +14,115 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AndroidPayDetails /// - [DataContract(Name = "AndroidPayDetails")] - public partial class AndroidPayDetails : IEquatable, IValidatableObject + public partial class AndroidPayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// **androidpay** (default to TypeEnum.Androidpay) + [JsonConstructor] + public AndroidPayDetails(Option checkoutAttemptId = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **androidpay** /// /// **androidpay** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Androidpay for value: androidpay /// - [EnumMember(Value = "androidpay")] Androidpay = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("androidpay")) + return TypeEnum.Androidpay; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("androidpay")) + return TypeEnum.Androidpay; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Androidpay) + return "androidpay"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **androidpay** /// /// **androidpay** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// **androidpay** (default to TypeEnum.Androidpay). - public AndroidPayDetails(string checkoutAttemptId = default(string), TypeEnum? type = TypeEnum.Androidpay) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -87,73 +139,111 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AndroidPayDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AndroidPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AndroidPayDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AndroidPayDetails instances are equal - /// - /// Instance of AndroidPayDetails to be compared - /// Boolean - public bool Equals(AndroidPayDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(AndroidPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class AndroidPayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class AndroidPayDetails."); + + return new AndroidPayDetails(checkoutAttemptId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AndroidPayDetails androidPayDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, androidPayDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AndroidPayDetails androidPayDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (androidPayDetails.CheckoutAttemptIdOption.IsSet && androidPayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(androidPayDetails.CheckoutAttemptId), "Property is required for class AndroidPayDetails."); + + if (androidPayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", androidPayDetails.CheckoutAttemptId); + + var typeRawValue = AndroidPayDetails.TypeEnumToJsonValue(androidPayDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/ApplePayDetails.cs b/Adyen/Model/Checkout/ApplePayDetails.cs index 03f028850..f86d0db97 100644 --- a/Adyen/Model/Checkout/ApplePayDetails.cs +++ b/Adyen/Model/Checkout/ApplePayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,125 +14,240 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ApplePayDetails /// - [DataContract(Name = "ApplePayDetails")] - public partial class ApplePayDetails : IEquatable, IValidatableObject + public partial class ApplePayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. + /// The checkout attempt identifier. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **applepay** (default to TypeEnum.Applepay) + [JsonConstructor] + public ApplePayDetails(string applePayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + ApplePayToken = applePayToken; + CheckoutAttemptIdOption = checkoutAttemptId; + FundingSourceOption = fundingSource; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// - [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// - [EnumMember(Value = "debit")] Debit = 2 + } + /// + /// Returns a + /// + /// + /// + /// + public static FundingSourceEnum FundingSourceEnumFromString(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) + { + if (value == FundingSourceEnum.Credit) + return "credit"; + + if (value == FundingSourceEnum.Debit) + return "debit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public FundingSourceEnum? FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + /// /// **applepay** /// /// **applepay** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Applepay for value: applepay /// - [EnumMember(Value = "applepay")] Applepay = 1 - } - /// - /// **applepay** + /// Returns a /// - /// **applepay** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("applepay")) + return TypeEnum.Applepay; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected ApplePayDetails() { } + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("applepay")) + return TypeEnum.Applepay; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. (required). - /// The checkout attempt identifier.. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **applepay** (default to TypeEnum.Applepay). - public ApplePayDetails(string applePayToken = default(string), string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Applepay) + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) { - this.ApplePayToken = applePayToken; - this.CheckoutAttemptId = checkoutAttemptId; - this.FundingSource = fundingSource; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; + if (value == TypeEnum.Applepay) + return "applepay"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } + + /// + /// **applepay** + /// + /// **applepay** + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. /// /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. - [DataMember(Name = "applePayToken", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("applePayToken")] public string ApplePayToken { get; set; } + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } + /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -154,117 +268,175 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // ApplePayToken (string) maxLength + if (this.ApplePayToken != null && this.ApplePayToken.Length > 10000) + { + yield return new ValidationResult("Invalid value for ApplePayToken, length must be less than 10000.", new [] { "ApplePayToken" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ApplePayDetails); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } + + yield break; } + } + /// + /// A Json converter for type + /// + public class ApplePayDetailsJsonConverter : JsonConverter + { /// - /// Returns true if ApplePayDetails instances are equal + /// Deserializes json to /// - /// Instance of ApplePayDetails to be compared - /// Boolean - public bool Equals(ApplePayDetails input) + /// + /// + /// + /// + /// + public override ApplePayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option applePayToken = default; + Option checkoutAttemptId = default; + Option fundingSource = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "applePayToken": + applePayToken = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "fundingSource": + string fundingSourceRawValue = utf8JsonReader.GetString(); + if (fundingSourceRawValue != null) + fundingSource = new Option(ApplePayDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(ApplePayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.ApplePayToken == input.ApplePayToken || - (this.ApplePayToken != null && - this.ApplePayToken.Equals(input.ApplePayToken)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.FundingSource == input.FundingSource || - this.FundingSource.Equals(input.FundingSource) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!applePayToken.IsSet) + throw new ArgumentException("Property is required for class ApplePayDetails.", nameof(applePayToken)); + + if (applePayToken.IsSet && applePayToken.Value == null) + throw new ArgumentNullException(nameof(applePayToken), "Property is not nullable for class ApplePayDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class ApplePayDetails."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class ApplePayDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class ApplePayDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class ApplePayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class ApplePayDetails."); + + return new ApplePayDetails(applePayToken.Value, checkoutAttemptId, fundingSource, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ApplePayDetails applePayDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ApplePayToken != null) - { - hashCode = (hashCode * 59) + this.ApplePayToken.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, applePayDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ApplePayDetails applePayDetails, JsonSerializerOptions jsonSerializerOptions) { - // ApplePayToken (string) maxLength - if (this.ApplePayToken != null && this.ApplePayToken.Length > 10000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ApplePayToken, length must be less than 10000.", new [] { "ApplePayToken" }); - } + if (applePayDetails.ApplePayToken == null) + throw new ArgumentNullException(nameof(applePayDetails.ApplePayToken), "Property is required for class ApplePayDetails."); - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (applePayDetails.CheckoutAttemptIdOption.IsSet && applePayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(applePayDetails.CheckoutAttemptId), "Property is required for class ApplePayDetails."); - yield break; + if (applePayDetails.RecurringDetailReferenceOption.IsSet && applePayDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(applePayDetails.RecurringDetailReference), "Property is required for class ApplePayDetails."); + + if (applePayDetails.StoredPaymentMethodIdOption.IsSet && applePayDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(applePayDetails.StoredPaymentMethodId), "Property is required for class ApplePayDetails."); + + writer.WriteString("applePayToken", applePayDetails.ApplePayToken); + + if (applePayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", applePayDetails.CheckoutAttemptId); + + var fundingSourceRawValue = ApplePayDetails.FundingSourceEnumToJsonValue(applePayDetails.FundingSourceOption.Value.Value); + writer.WriteString("fundingSource", fundingSourceRawValue); + if (applePayDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", applePayDetails.RecurringDetailReference); + + if (applePayDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", applePayDetails.StoredPaymentMethodId); + + var typeRawValue = ApplePayDetails.TypeEnumToJsonValue(applePayDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/ApplePayDonations.cs b/Adyen/Model/Checkout/ApplePayDonations.cs index ca15916c5..fb430459e 100644 --- a/Adyen/Model/Checkout/ApplePayDonations.cs +++ b/Adyen/Model/Checkout/ApplePayDonations.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,125 +14,240 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ApplePayDonations /// - [DataContract(Name = "ApplePayDonations")] - public partial class ApplePayDonations : IEquatable, IValidatableObject + public partial class ApplePayDonations : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. + /// The checkout attempt identifier. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **applepay** (default to TypeEnum.Applepay) + [JsonConstructor] + public ApplePayDonations(string applePayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + ApplePayToken = applePayToken; + CheckoutAttemptIdOption = checkoutAttemptId; + FundingSourceOption = fundingSource; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// - [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// - [EnumMember(Value = "debit")] Debit = 2 + } + /// + /// Returns a + /// + /// + /// + /// + public static FundingSourceEnum FundingSourceEnumFromString(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) + { + if (value == FundingSourceEnum.Credit) + return "credit"; + + if (value == FundingSourceEnum.Debit) + return "debit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public FundingSourceEnum? FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + /// /// **applepay** /// /// **applepay** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Applepay for value: applepay /// - [EnumMember(Value = "applepay")] Applepay = 1 - } - /// - /// **applepay** + /// Returns a /// - /// **applepay** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("applepay")) + return TypeEnum.Applepay; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected ApplePayDonations() { } + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("applepay")) + return TypeEnum.Applepay; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. (required). - /// The checkout attempt identifier.. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **applepay** (default to TypeEnum.Applepay). - public ApplePayDonations(string applePayToken = default(string), string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Applepay) + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) { - this.ApplePayToken = applePayToken; - this.CheckoutAttemptId = checkoutAttemptId; - this.FundingSource = fundingSource; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; + if (value == TypeEnum.Applepay) + return "applepay"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } + + /// + /// **applepay** + /// + /// **applepay** + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. /// /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. - [DataMember(Name = "applePayToken", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("applePayToken")] public string ApplePayToken { get; set; } + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } + /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -154,117 +268,175 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // ApplePayToken (string) maxLength + if (this.ApplePayToken != null && this.ApplePayToken.Length > 10000) + { + yield return new ValidationResult("Invalid value for ApplePayToken, length must be less than 10000.", new [] { "ApplePayToken" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ApplePayDonations); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } + + yield break; } + } + /// + /// A Json converter for type + /// + public class ApplePayDonationsJsonConverter : JsonConverter + { /// - /// Returns true if ApplePayDonations instances are equal + /// Deserializes json to /// - /// Instance of ApplePayDonations to be compared - /// Boolean - public bool Equals(ApplePayDonations input) + /// + /// + /// + /// + /// + public override ApplePayDonations Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option applePayToken = default; + Option checkoutAttemptId = default; + Option fundingSource = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "applePayToken": + applePayToken = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "fundingSource": + string fundingSourceRawValue = utf8JsonReader.GetString(); + if (fundingSourceRawValue != null) + fundingSource = new Option(ApplePayDonations.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(ApplePayDonations.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.ApplePayToken == input.ApplePayToken || - (this.ApplePayToken != null && - this.ApplePayToken.Equals(input.ApplePayToken)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.FundingSource == input.FundingSource || - this.FundingSource.Equals(input.FundingSource) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!applePayToken.IsSet) + throw new ArgumentException("Property is required for class ApplePayDonations.", nameof(applePayToken)); + + if (applePayToken.IsSet && applePayToken.Value == null) + throw new ArgumentNullException(nameof(applePayToken), "Property is not nullable for class ApplePayDonations."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class ApplePayDonations."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class ApplePayDonations."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class ApplePayDonations."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class ApplePayDonations."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class ApplePayDonations."); + + return new ApplePayDonations(applePayToken.Value, checkoutAttemptId, fundingSource, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ApplePayDonations applePayDonations, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ApplePayToken != null) - { - hashCode = (hashCode * 59) + this.ApplePayToken.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, applePayDonations, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ApplePayDonations applePayDonations, JsonSerializerOptions jsonSerializerOptions) { - // ApplePayToken (string) maxLength - if (this.ApplePayToken != null && this.ApplePayToken.Length > 10000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ApplePayToken, length must be less than 10000.", new [] { "ApplePayToken" }); - } + if (applePayDonations.ApplePayToken == null) + throw new ArgumentNullException(nameof(applePayDonations.ApplePayToken), "Property is required for class ApplePayDonations."); - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (applePayDonations.CheckoutAttemptIdOption.IsSet && applePayDonations.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(applePayDonations.CheckoutAttemptId), "Property is required for class ApplePayDonations."); - yield break; + if (applePayDonations.RecurringDetailReferenceOption.IsSet && applePayDonations.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(applePayDonations.RecurringDetailReference), "Property is required for class ApplePayDonations."); + + if (applePayDonations.StoredPaymentMethodIdOption.IsSet && applePayDonations.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(applePayDonations.StoredPaymentMethodId), "Property is required for class ApplePayDonations."); + + writer.WriteString("applePayToken", applePayDonations.ApplePayToken); + + if (applePayDonations.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", applePayDonations.CheckoutAttemptId); + + var fundingSourceRawValue = ApplePayDonations.FundingSourceEnumToJsonValue(applePayDonations.FundingSourceOption.Value.Value); + writer.WriteString("fundingSource", fundingSourceRawValue); + if (applePayDonations.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", applePayDonations.RecurringDetailReference); + + if (applePayDonations.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", applePayDonations.StoredPaymentMethodId); + + var typeRawValue = ApplePayDonations.TypeEnumToJsonValue(applePayDonations.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/ApplePaySessionRequest.cs b/Adyen/Model/Checkout/ApplePaySessionRequest.cs index 4f113ca85..9507eb727 100644 --- a/Adyen/Model/Checkout/ApplePaySessionRequest.cs +++ b/Adyen/Model/Checkout/ApplePaySessionRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,60 +14,56 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ApplePaySessionRequest /// - [DataContract(Name = "ApplePaySessionRequest")] - public partial class ApplePaySessionRequest : IEquatable, IValidatableObject + public partial class ApplePaySessionRequest : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected ApplePaySessionRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// This is the name that your shoppers will see in the Apple Pay interface. The value returned as `configuration.merchantName` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. (required). - /// The domain name you provided when you added Apple Pay in your Customer Area. This must match the `window.location.hostname` of the web shop. (required). - /// Your merchant identifier registered with Apple Pay. Use the value of the `configuration.merchantId` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. (required). - public ApplePaySessionRequest(string displayName = default(string), string domainName = default(string), string merchantIdentifier = default(string)) + /// This is the name that your shoppers will see in the Apple Pay interface. The value returned as `configuration.merchantName` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. + /// The domain name you provided when you added Apple Pay in your Customer Area. This must match the `window.location.hostname` of the web shop. + /// Your merchant identifier registered with Apple Pay. Use the value of the `configuration.merchantId` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. + [JsonConstructor] + public ApplePaySessionRequest(string displayName, string domainName, string merchantIdentifier) { - this.DisplayName = displayName; - this.DomainName = domainName; - this.MerchantIdentifier = merchantIdentifier; + DisplayName = displayName; + DomainName = domainName; + MerchantIdentifier = merchantIdentifier; + OnCreated(); } + partial void OnCreated(); + /// /// This is the name that your shoppers will see in the Apple Pay interface. The value returned as `configuration.merchantName` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. /// /// This is the name that your shoppers will see in the Apple Pay interface. The value returned as `configuration.merchantName` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. - [DataMember(Name = "displayName", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("displayName")] public string DisplayName { get; set; } /// /// The domain name you provided when you added Apple Pay in your Customer Area. This must match the `window.location.hostname` of the web shop. /// /// The domain name you provided when you added Apple Pay in your Customer Area. This must match the `window.location.hostname` of the web shop. - [DataMember(Name = "domainName", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("domainName")] public string DomainName { get; set; } /// /// Your merchant identifier registered with Apple Pay. Use the value of the `configuration.merchantId` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. /// /// Your merchant identifier registered with Apple Pay. Use the value of the `configuration.merchantId` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. - [DataMember(Name = "merchantIdentifier", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantIdentifier")] public string MerchantIdentifier { get; set; } /// @@ -87,92 +82,137 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // DisplayName (string) maxLength + if (this.DisplayName != null && this.DisplayName.Length > 64) + { + yield return new ValidationResult("Invalid value for DisplayName, length must be less than 64.", new [] { "DisplayName" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ApplePaySessionRequest); + yield break; } + } + /// + /// A Json converter for type + /// + public class ApplePaySessionRequestJsonConverter : JsonConverter + { /// - /// Returns true if ApplePaySessionRequest instances are equal + /// Deserializes json to /// - /// Instance of ApplePaySessionRequest to be compared - /// Boolean - public bool Equals(ApplePaySessionRequest input) + /// + /// + /// + /// + /// + public override ApplePaySessionRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option displayName = default; + Option domainName = default; + Option merchantIdentifier = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "displayName": + displayName = new Option(utf8JsonReader.GetString()); + break; + case "domainName": + domainName = new Option(utf8JsonReader.GetString()); + break; + case "merchantIdentifier": + merchantIdentifier = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.DisplayName == input.DisplayName || - (this.DisplayName != null && - this.DisplayName.Equals(input.DisplayName)) - ) && - ( - this.DomainName == input.DomainName || - (this.DomainName != null && - this.DomainName.Equals(input.DomainName)) - ) && - ( - this.MerchantIdentifier == input.MerchantIdentifier || - (this.MerchantIdentifier != null && - this.MerchantIdentifier.Equals(input.MerchantIdentifier)) - ); + + if (!displayName.IsSet) + throw new ArgumentException("Property is required for class ApplePaySessionRequest.", nameof(displayName)); + + if (!domainName.IsSet) + throw new ArgumentException("Property is required for class ApplePaySessionRequest.", nameof(domainName)); + + if (!merchantIdentifier.IsSet) + throw new ArgumentException("Property is required for class ApplePaySessionRequest.", nameof(merchantIdentifier)); + + if (displayName.IsSet && displayName.Value == null) + throw new ArgumentNullException(nameof(displayName), "Property is not nullable for class ApplePaySessionRequest."); + + if (domainName.IsSet && domainName.Value == null) + throw new ArgumentNullException(nameof(domainName), "Property is not nullable for class ApplePaySessionRequest."); + + if (merchantIdentifier.IsSet && merchantIdentifier.Value == null) + throw new ArgumentNullException(nameof(merchantIdentifier), "Property is not nullable for class ApplePaySessionRequest."); + + return new ApplePaySessionRequest(displayName.Value, domainName.Value, merchantIdentifier.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ApplePaySessionRequest applePaySessionRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.DisplayName != null) - { - hashCode = (hashCode * 59) + this.DisplayName.GetHashCode(); - } - if (this.DomainName != null) - { - hashCode = (hashCode * 59) + this.DomainName.GetHashCode(); - } - if (this.MerchantIdentifier != null) - { - hashCode = (hashCode * 59) + this.MerchantIdentifier.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, applePaySessionRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ApplePaySessionRequest applePaySessionRequest, JsonSerializerOptions jsonSerializerOptions) { - // DisplayName (string) maxLength - if (this.DisplayName != null && this.DisplayName.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DisplayName, length must be less than 64.", new [] { "DisplayName" }); - } + if (applePaySessionRequest.DisplayName == null) + throw new ArgumentNullException(nameof(applePaySessionRequest.DisplayName), "Property is required for class ApplePaySessionRequest."); - yield break; + if (applePaySessionRequest.DomainName == null) + throw new ArgumentNullException(nameof(applePaySessionRequest.DomainName), "Property is required for class ApplePaySessionRequest."); + + if (applePaySessionRequest.MerchantIdentifier == null) + throw new ArgumentNullException(nameof(applePaySessionRequest.MerchantIdentifier), "Property is required for class ApplePaySessionRequest."); + + writer.WriteString("displayName", applePaySessionRequest.DisplayName); + + writer.WriteString("domainName", applePaySessionRequest.DomainName); + + writer.WriteString("merchantIdentifier", applePaySessionRequest.MerchantIdentifier); } } - } diff --git a/Adyen/Model/Checkout/ApplePaySessionResponse.cs b/Adyen/Model/Checkout/ApplePaySessionResponse.cs index 5f314d423..ac8b772ef 100644 --- a/Adyen/Model/Checkout/ApplePaySessionResponse.cs +++ b/Adyen/Model/Checkout/ApplePaySessionResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,42 +14,38 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ApplePaySessionResponse /// - [DataContract(Name = "ApplePaySessionResponse")] - public partial class ApplePaySessionResponse : IEquatable, IValidatableObject + public partial class ApplePaySessionResponse : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected ApplePaySessionResponse() { } - /// - /// Initializes a new instance of the class. - /// - /// Base64 encoded data you need to [complete the Apple Pay merchant validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). (required). - public ApplePaySessionResponse(string data = default(string)) + /// Base64 encoded data you need to [complete the Apple Pay merchant validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). + [JsonConstructor] + public ApplePaySessionResponse(string data) { - this.Data = data; + Data = data; + OnCreated(); } + partial void OnCreated(); + /// /// Base64 encoded data you need to [complete the Apple Pay merchant validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). /// /// Base64 encoded data you need to [complete the Apple Pay merchant validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). - [DataMember(Name = "data", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("data")] public string Data { get; set; } /// @@ -67,68 +62,101 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ApplePaySessionResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ApplePaySessionResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ApplePaySessionResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ApplePaySessionResponse instances are equal - /// - /// Instance of ApplePaySessionResponse to be compared - /// Boolean - public bool Equals(ApplePaySessionResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option data = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "data": + data = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) - ); + + if (!data.IsSet) + throw new ArgumentException("Property is required for class ApplePaySessionResponse.", nameof(data)); + + if (data.IsSet && data.Value == null) + throw new ArgumentNullException(nameof(data), "Property is not nullable for class ApplePaySessionResponse."); + + return new ApplePaySessionResponse(data.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ApplePaySessionResponse applePaySessionResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - { - hashCode = (hashCode * 59) + this.Data.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, applePaySessionResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ApplePaySessionResponse applePaySessionResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (applePaySessionResponse.Data == null) + throw new ArgumentNullException(nameof(applePaySessionResponse.Data), "Property is required for class ApplePaySessionResponse."); + + writer.WriteString("data", applePaySessionResponse.Data); } } - } diff --git a/Adyen/Model/Checkout/ApplicationInfo.cs b/Adyen/Model/Checkout/ApplicationInfo.cs index b560f848b..445f7495e 100644 --- a/Adyen/Model/Checkout/ApplicationInfo.cs +++ b/Adyen/Model/Checkout/ApplicationInfo.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,77 +14,120 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ApplicationInfo /// - [DataContract(Name = "ApplicationInfo")] - public partial class ApplicationInfo : IEquatable, IValidatableObject + public partial class ApplicationInfo : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// adyenLibrary. - /// adyenPaymentSource. - /// externalPlatform. - /// merchantApplication. - /// merchantDevice. - /// shopperInteractionDevice. - public ApplicationInfo(CommonField adyenLibrary = default(CommonField), CommonField adyenPaymentSource = default(CommonField), ExternalPlatform externalPlatform = default(ExternalPlatform), CommonField merchantApplication = default(CommonField), MerchantDevice merchantDevice = default(MerchantDevice), ShopperInteractionDevice shopperInteractionDevice = default(ShopperInteractionDevice)) + /// adyenLibrary + /// adyenPaymentSource + /// externalPlatform + /// merchantApplication + /// merchantDevice + /// shopperInteractionDevice + [JsonConstructor] + public ApplicationInfo(Option adyenLibrary = default, Option adyenPaymentSource = default, Option externalPlatform = default, Option merchantApplication = default, Option merchantDevice = default, Option shopperInteractionDevice = default) { - this.AdyenLibrary = adyenLibrary; - this.AdyenPaymentSource = adyenPaymentSource; - this.ExternalPlatform = externalPlatform; - this.MerchantApplication = merchantApplication; - this.MerchantDevice = merchantDevice; - this.ShopperInteractionDevice = shopperInteractionDevice; + AdyenLibraryOption = adyenLibrary; + AdyenPaymentSourceOption = adyenPaymentSource; + ExternalPlatformOption = externalPlatform; + MerchantApplicationOption = merchantApplication; + MerchantDeviceOption = merchantDevice; + ShopperInteractionDeviceOption = shopperInteractionDevice; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of AdyenLibrary + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AdyenLibraryOption { get; private set; } + /// /// Gets or Sets AdyenLibrary /// - [DataMember(Name = "adyenLibrary", EmitDefaultValue = false)] - public CommonField AdyenLibrary { get; set; } + [JsonPropertyName("adyenLibrary")] + public CommonField AdyenLibrary { get { return this.AdyenLibraryOption; } set { this.AdyenLibraryOption = new Option(value); } } + + /// + /// Used to track the state of AdyenPaymentSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AdyenPaymentSourceOption { get; private set; } /// /// Gets or Sets AdyenPaymentSource /// - [DataMember(Name = "adyenPaymentSource", EmitDefaultValue = false)] - public CommonField AdyenPaymentSource { get; set; } + [JsonPropertyName("adyenPaymentSource")] + public CommonField AdyenPaymentSource { get { return this.AdyenPaymentSourceOption; } set { this.AdyenPaymentSourceOption = new Option(value); } } + + /// + /// Used to track the state of ExternalPlatform + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExternalPlatformOption { get; private set; } /// /// Gets or Sets ExternalPlatform /// - [DataMember(Name = "externalPlatform", EmitDefaultValue = false)] - public ExternalPlatform ExternalPlatform { get; set; } + [JsonPropertyName("externalPlatform")] + public ExternalPlatform ExternalPlatform { get { return this.ExternalPlatformOption; } set { this.ExternalPlatformOption = new Option(value); } } + + /// + /// Used to track the state of MerchantApplication + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantApplicationOption { get; private set; } /// /// Gets or Sets MerchantApplication /// - [DataMember(Name = "merchantApplication", EmitDefaultValue = false)] - public CommonField MerchantApplication { get; set; } + [JsonPropertyName("merchantApplication")] + public CommonField MerchantApplication { get { return this.MerchantApplicationOption; } set { this.MerchantApplicationOption = new Option(value); } } + + /// + /// Used to track the state of MerchantDevice + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantDeviceOption { get; private set; } /// /// Gets or Sets MerchantDevice /// - [DataMember(Name = "merchantDevice", EmitDefaultValue = false)] - public MerchantDevice MerchantDevice { get; set; } + [JsonPropertyName("merchantDevice")] + public MerchantDevice MerchantDevice { get { return this.MerchantDeviceOption; } set { this.MerchantDeviceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperInteractionDevice + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperInteractionDeviceOption { get; private set; } /// /// Gets or Sets ShopperInteractionDevice /// - [DataMember(Name = "shopperInteractionDevice", EmitDefaultValue = false)] - public ShopperInteractionDevice ShopperInteractionDevice { get; set; } + [JsonPropertyName("shopperInteractionDevice")] + public ShopperInteractionDevice ShopperInteractionDevice { get { return this.ShopperInteractionDeviceOption; } set { this.ShopperInteractionDeviceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -106,113 +148,183 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ApplicationInfoJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ApplicationInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ApplicationInfo); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ApplicationInfo instances are equal - /// - /// Instance of ApplicationInfo to be compared - /// Boolean - public bool Equals(ApplicationInfo input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option adyenLibrary = default; + Option adyenPaymentSource = default; + Option externalPlatform = default; + Option merchantApplication = default; + Option merchantDevice = default; + Option shopperInteractionDevice = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "adyenLibrary": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + adyenLibrary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "adyenPaymentSource": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + adyenPaymentSource = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "externalPlatform": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + externalPlatform = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantApplication": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + merchantApplication = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantDevice": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + merchantDevice = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperInteractionDevice": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopperInteractionDevice = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.AdyenLibrary == input.AdyenLibrary || - (this.AdyenLibrary != null && - this.AdyenLibrary.Equals(input.AdyenLibrary)) - ) && - ( - this.AdyenPaymentSource == input.AdyenPaymentSource || - (this.AdyenPaymentSource != null && - this.AdyenPaymentSource.Equals(input.AdyenPaymentSource)) - ) && - ( - this.ExternalPlatform == input.ExternalPlatform || - (this.ExternalPlatform != null && - this.ExternalPlatform.Equals(input.ExternalPlatform)) - ) && - ( - this.MerchantApplication == input.MerchantApplication || - (this.MerchantApplication != null && - this.MerchantApplication.Equals(input.MerchantApplication)) - ) && - ( - this.MerchantDevice == input.MerchantDevice || - (this.MerchantDevice != null && - this.MerchantDevice.Equals(input.MerchantDevice)) - ) && - ( - this.ShopperInteractionDevice == input.ShopperInteractionDevice || - (this.ShopperInteractionDevice != null && - this.ShopperInteractionDevice.Equals(input.ShopperInteractionDevice)) - ); + + if (adyenLibrary.IsSet && adyenLibrary.Value == null) + throw new ArgumentNullException(nameof(adyenLibrary), "Property is not nullable for class ApplicationInfo."); + + if (adyenPaymentSource.IsSet && adyenPaymentSource.Value == null) + throw new ArgumentNullException(nameof(adyenPaymentSource), "Property is not nullable for class ApplicationInfo."); + + if (externalPlatform.IsSet && externalPlatform.Value == null) + throw new ArgumentNullException(nameof(externalPlatform), "Property is not nullable for class ApplicationInfo."); + + if (merchantApplication.IsSet && merchantApplication.Value == null) + throw new ArgumentNullException(nameof(merchantApplication), "Property is not nullable for class ApplicationInfo."); + + if (merchantDevice.IsSet && merchantDevice.Value == null) + throw new ArgumentNullException(nameof(merchantDevice), "Property is not nullable for class ApplicationInfo."); + + if (shopperInteractionDevice.IsSet && shopperInteractionDevice.Value == null) + throw new ArgumentNullException(nameof(shopperInteractionDevice), "Property is not nullable for class ApplicationInfo."); + + return new ApplicationInfo(adyenLibrary, adyenPaymentSource, externalPlatform, merchantApplication, merchantDevice, shopperInteractionDevice); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ApplicationInfo applicationInfo, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AdyenLibrary != null) - { - hashCode = (hashCode * 59) + this.AdyenLibrary.GetHashCode(); - } - if (this.AdyenPaymentSource != null) - { - hashCode = (hashCode * 59) + this.AdyenPaymentSource.GetHashCode(); - } - if (this.ExternalPlatform != null) - { - hashCode = (hashCode * 59) + this.ExternalPlatform.GetHashCode(); - } - if (this.MerchantApplication != null) - { - hashCode = (hashCode * 59) + this.MerchantApplication.GetHashCode(); - } - if (this.MerchantDevice != null) - { - hashCode = (hashCode * 59) + this.MerchantDevice.GetHashCode(); - } - if (this.ShopperInteractionDevice != null) - { - hashCode = (hashCode * 59) + this.ShopperInteractionDevice.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, applicationInfo, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ApplicationInfo applicationInfo, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (applicationInfo.AdyenLibraryOption.IsSet && applicationInfo.AdyenLibrary == null) + throw new ArgumentNullException(nameof(applicationInfo.AdyenLibrary), "Property is required for class ApplicationInfo."); + + if (applicationInfo.AdyenPaymentSourceOption.IsSet && applicationInfo.AdyenPaymentSource == null) + throw new ArgumentNullException(nameof(applicationInfo.AdyenPaymentSource), "Property is required for class ApplicationInfo."); + + if (applicationInfo.ExternalPlatformOption.IsSet && applicationInfo.ExternalPlatform == null) + throw new ArgumentNullException(nameof(applicationInfo.ExternalPlatform), "Property is required for class ApplicationInfo."); + + if (applicationInfo.MerchantApplicationOption.IsSet && applicationInfo.MerchantApplication == null) + throw new ArgumentNullException(nameof(applicationInfo.MerchantApplication), "Property is required for class ApplicationInfo."); + + if (applicationInfo.MerchantDeviceOption.IsSet && applicationInfo.MerchantDevice == null) + throw new ArgumentNullException(nameof(applicationInfo.MerchantDevice), "Property is required for class ApplicationInfo."); + + if (applicationInfo.ShopperInteractionDeviceOption.IsSet && applicationInfo.ShopperInteractionDevice == null) + throw new ArgumentNullException(nameof(applicationInfo.ShopperInteractionDevice), "Property is required for class ApplicationInfo."); + + if (applicationInfo.AdyenLibraryOption.IsSet) + { + writer.WritePropertyName("adyenLibrary"); + JsonSerializer.Serialize(writer, applicationInfo.AdyenLibrary, jsonSerializerOptions); + } + if (applicationInfo.AdyenPaymentSourceOption.IsSet) + { + writer.WritePropertyName("adyenPaymentSource"); + JsonSerializer.Serialize(writer, applicationInfo.AdyenPaymentSource, jsonSerializerOptions); + } + if (applicationInfo.ExternalPlatformOption.IsSet) + { + writer.WritePropertyName("externalPlatform"); + JsonSerializer.Serialize(writer, applicationInfo.ExternalPlatform, jsonSerializerOptions); + } + if (applicationInfo.MerchantApplicationOption.IsSet) + { + writer.WritePropertyName("merchantApplication"); + JsonSerializer.Serialize(writer, applicationInfo.MerchantApplication, jsonSerializerOptions); + } + if (applicationInfo.MerchantDeviceOption.IsSet) + { + writer.WritePropertyName("merchantDevice"); + JsonSerializer.Serialize(writer, applicationInfo.MerchantDevice, jsonSerializerOptions); + } + if (applicationInfo.ShopperInteractionDeviceOption.IsSet) + { + writer.WritePropertyName("shopperInteractionDevice"); + JsonSerializer.Serialize(writer, applicationInfo.ShopperInteractionDevice, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/AuthenticationData.cs b/Adyen/Model/Checkout/AuthenticationData.cs index 991c56b3c..28bcf8726 100644 --- a/Adyen/Model/Checkout/AuthenticationData.cs +++ b/Adyen/Model/Checkout/AuthenticationData.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,76 +14,144 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// AuthenticationData /// - [DataContract(Name = "AuthenticationData")] - public partial class AuthenticationData : IEquatable, IValidatableObject + public partial class AuthenticationData : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: **false**. (default to false) + /// threeDSRequestData + [JsonConstructor] + public AuthenticationData(Option attemptAuthentication = default, Option authenticationOnly = default, Option threeDSRequestData = default) + { + AttemptAuthenticationOption = attemptAuthentication; + AuthenticationOnlyOption = authenticationOnly; + ThreeDSRequestDataOption = threeDSRequestData; + OnCreated(); + } + + partial void OnCreated(); + /// /// Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. /// /// Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. - [JsonConverter(typeof(StringEnumConverter))] public enum AttemptAuthenticationEnum { /// /// Enum Always for value: always /// - [EnumMember(Value = "always")] Always = 1, /// /// Enum Never for value: never /// - [EnumMember(Value = "never")] Never = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static AttemptAuthenticationEnum AttemptAuthenticationEnumFromString(string value) + { + if (value.Equals("always")) + return AttemptAuthenticationEnum.Always; + + if (value.Equals("never")) + return AttemptAuthenticationEnum.Never; + + throw new NotImplementedException($"Could not convert value to type AttemptAuthenticationEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static AttemptAuthenticationEnum? AttemptAuthenticationEnumFromStringOrDefault(string value) + { + if (value.Equals("always")) + return AttemptAuthenticationEnum.Always; + if (value.Equals("never")) + return AttemptAuthenticationEnum.Never; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string AttemptAuthenticationEnumToJsonValue(AttemptAuthenticationEnum? value) + { + if (value == AttemptAuthenticationEnum.Always) + return "always"; + + if (value == AttemptAuthenticationEnum.Never) + return "never"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of AttemptAuthentication + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AttemptAuthenticationOption { get; private set; } /// /// Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. /// /// Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. - [DataMember(Name = "attemptAuthentication", EmitDefaultValue = false)] - public AttemptAuthenticationEnum? AttemptAuthentication { get; set; } + [JsonPropertyName("attemptAuthentication")] + public AttemptAuthenticationEnum? AttemptAuthentication { get { return this.AttemptAuthenticationOption; } set { this.AttemptAuthenticationOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of AuthenticationOnly /// - /// Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined.. - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: **false**. (default to false). - /// threeDSRequestData. - public AuthenticationData(AttemptAuthenticationEnum? attemptAuthentication = default(AttemptAuthenticationEnum?), bool? authenticationOnly = false, ThreeDSRequestData threeDSRequestData = default(ThreeDSRequestData)) - { - this.AttemptAuthentication = attemptAuthentication; - this.AuthenticationOnly = authenticationOnly; - this.ThreeDSRequestData = threeDSRequestData; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthenticationOnlyOption { get; private set; } /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: **false**. /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: **false**. - [DataMember(Name = "authenticationOnly", EmitDefaultValue = false)] - public bool? AuthenticationOnly { get; set; } + [JsonPropertyName("authenticationOnly")] + public bool? AuthenticationOnly { get { return this.AuthenticationOnlyOption; } set { this.AuthenticationOnlyOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSRequestData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestDataOption { get; private set; } /// /// Gets or Sets ThreeDSRequestData /// - [DataMember(Name = "threeDSRequestData", EmitDefaultValue = false)] - public ThreeDSRequestData ThreeDSRequestData { get; set; } + [JsonPropertyName("threeDSRequestData")] + public ThreeDSRequestData ThreeDSRequestData { get { return this.ThreeDSRequestDataOption; } set { this.ThreeDSRequestDataOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -102,78 +169,125 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class AuthenticationDataJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override AuthenticationData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as AuthenticationData); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if AuthenticationData instances are equal - /// - /// Instance of AuthenticationData to be compared - /// Boolean - public bool Equals(AuthenticationData input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option attemptAuthentication = default; + Option authenticationOnly = default; + Option threeDSRequestData = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "attemptAuthentication": + string attemptAuthenticationRawValue = utf8JsonReader.GetString(); + if (attemptAuthenticationRawValue != null) + attemptAuthentication = new Option(AuthenticationData.AttemptAuthenticationEnumFromStringOrDefault(attemptAuthenticationRawValue)); + break; + case "authenticationOnly": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + authenticationOnly = new Option(utf8JsonReader.GetBoolean()); + break; + case "threeDSRequestData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDSRequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.AttemptAuthentication == input.AttemptAuthentication || - this.AttemptAuthentication.Equals(input.AttemptAuthentication) - ) && - ( - this.AuthenticationOnly == input.AuthenticationOnly || - this.AuthenticationOnly.Equals(input.AuthenticationOnly) - ) && - ( - this.ThreeDSRequestData == input.ThreeDSRequestData || - (this.ThreeDSRequestData != null && - this.ThreeDSRequestData.Equals(input.ThreeDSRequestData)) - ); + + if (attemptAuthentication.IsSet && attemptAuthentication.Value == null) + throw new ArgumentNullException(nameof(attemptAuthentication), "Property is not nullable for class AuthenticationData."); + + if (authenticationOnly.IsSet && authenticationOnly.Value == null) + throw new ArgumentNullException(nameof(authenticationOnly), "Property is not nullable for class AuthenticationData."); + + if (threeDSRequestData.IsSet && threeDSRequestData.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestData), "Property is not nullable for class AuthenticationData."); + + return new AuthenticationData(attemptAuthentication, authenticationOnly, threeDSRequestData); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AuthenticationData authenticationData, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.AttemptAuthentication.GetHashCode(); - hashCode = (hashCode * 59) + this.AuthenticationOnly.GetHashCode(); - if (this.ThreeDSRequestData != null) - { - hashCode = (hashCode * 59) + this.ThreeDSRequestData.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, authenticationData, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, AuthenticationData authenticationData, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (authenticationData.ThreeDSRequestDataOption.IsSet && authenticationData.ThreeDSRequestData == null) + throw new ArgumentNullException(nameof(authenticationData.ThreeDSRequestData), "Property is required for class AuthenticationData."); + + var attemptAuthenticationRawValue = AuthenticationData.AttemptAuthenticationEnumToJsonValue(authenticationData.AttemptAuthenticationOption.Value.Value); + writer.WriteString("attemptAuthentication", attemptAuthenticationRawValue); + if (authenticationData.AuthenticationOnlyOption.IsSet) + writer.WriteBoolean("authenticationOnly", authenticationData.AuthenticationOnlyOption.Value.Value); + + if (authenticationData.ThreeDSRequestDataOption.IsSet) + { + writer.WritePropertyName("threeDSRequestData"); + JsonSerializer.Serialize(writer, authenticationData.ThreeDSRequestData, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/BacsDirectDebitDetails.cs b/Adyen/Model/Checkout/BacsDirectDebitDetails.cs index e5db52c40..3ba351db1 100644 --- a/Adyen/Model/Checkout/BacsDirectDebitDetails.cs +++ b/Adyen/Model/Checkout/BacsDirectDebitDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,117 +14,212 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// BacsDirectDebitDetails /// - [DataContract(Name = "BacsDirectDebitDetails")] - public partial class BacsDirectDebitDetails : IEquatable, IValidatableObject + public partial class BacsDirectDebitDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The bank account number (without separators). + /// The bank routing number of the account. + /// The checkout attempt identifier. + /// The name of the bank account holder. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. + /// **directdebit_GB** (default to TypeEnum.DirectdebitGB) + [JsonConstructor] + public BacsDirectDebitDetails(Option bankAccountNumber = default, Option bankLocationId = default, Option checkoutAttemptId = default, Option holderName = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option transferInstrumentId = default, Option type = default) + { + BankAccountNumberOption = bankAccountNumber; + BankLocationIdOption = bankLocationId; + CheckoutAttemptIdOption = checkoutAttemptId; + HolderNameOption = holderName; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TransferInstrumentIdOption = transferInstrumentId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **directdebit_GB** /// /// **directdebit_GB** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum DirectdebitGB for value: directdebit_GB /// - [EnumMember(Value = "directdebit_GB")] DirectdebitGB = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("directdebit_GB")) + return TypeEnum.DirectdebitGB; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("directdebit_GB")) + return TypeEnum.DirectdebitGB; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.DirectdebitGB) + return "directdebit_GB"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **directdebit_GB** /// /// **directdebit_GB** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of BankAccountNumber /// - /// The bank account number (without separators).. - /// The bank routing number of the account.. - /// The checkout attempt identifier.. - /// The name of the bank account holder.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts.. - /// **directdebit_GB** (default to TypeEnum.DirectdebitGB). - public BacsDirectDebitDetails(string bankAccountNumber = default(string), string bankLocationId = default(string), string checkoutAttemptId = default(string), string holderName = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string transferInstrumentId = default(string), TypeEnum? type = TypeEnum.DirectdebitGB) - { - this.BankAccountNumber = bankAccountNumber; - this.BankLocationId = bankLocationId; - this.CheckoutAttemptId = checkoutAttemptId; - this.HolderName = holderName; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.TransferInstrumentId = transferInstrumentId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankAccountNumberOption { get; private set; } /// /// The bank account number (without separators). /// /// The bank account number (without separators). - [DataMember(Name = "bankAccountNumber", EmitDefaultValue = false)] - public string BankAccountNumber { get; set; } + [JsonPropertyName("bankAccountNumber")] + public string BankAccountNumber { get { return this.BankAccountNumberOption; } set { this.BankAccountNumberOption = new Option(value); } } + + /// + /// Used to track the state of BankLocationId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankLocationIdOption { get; private set; } /// /// The bank routing number of the account. /// /// The bank routing number of the account. - [DataMember(Name = "bankLocationId", EmitDefaultValue = false)] - public string BankLocationId { get; set; } + [JsonPropertyName("bankLocationId")] + public string BankLocationId { get { return this.BankLocationIdOption; } set { this.BankLocationIdOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of HolderName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option HolderNameOption { get; private set; } /// /// The name of the bank account holder. /// /// The name of the bank account holder. - [DataMember(Name = "holderName", EmitDefaultValue = false)] - public string HolderName { get; set; } + [JsonPropertyName("holderName")] + public string HolderName { get { return this.HolderNameOption; } set { this.HolderNameOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of TransferInstrumentId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TransferInstrumentIdOption { get; private set; } /// /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. /// /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. - [DataMember(Name = "transferInstrumentId", EmitDefaultValue = false)] - public string TransferInstrumentId { get; set; } + [JsonPropertyName("transferInstrumentId")] + public string TransferInstrumentId { get { return this.TransferInstrumentIdOption; } set { this.TransferInstrumentIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -148,133 +242,195 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as BacsDirectDebitDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class BacsDirectDebitDetailsJsonConverter : JsonConverter + { /// - /// Returns true if BacsDirectDebitDetails instances are equal + /// Deserializes json to /// - /// Instance of BacsDirectDebitDetails to be compared - /// Boolean - public bool Equals(BacsDirectDebitDetails input) + /// + /// + /// + /// + /// + public override BacsDirectDebitDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option bankAccountNumber = default; + Option bankLocationId = default; + Option checkoutAttemptId = default; + Option holderName = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option transferInstrumentId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "bankAccountNumber": + bankAccountNumber = new Option(utf8JsonReader.GetString()); + break; + case "bankLocationId": + bankLocationId = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "holderName": + holderName = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "transferInstrumentId": + transferInstrumentId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(BacsDirectDebitDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.BankAccountNumber == input.BankAccountNumber || - (this.BankAccountNumber != null && - this.BankAccountNumber.Equals(input.BankAccountNumber)) - ) && - ( - this.BankLocationId == input.BankLocationId || - (this.BankLocationId != null && - this.BankLocationId.Equals(input.BankLocationId)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.HolderName == input.HolderName || - (this.HolderName != null && - this.HolderName.Equals(input.HolderName)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.TransferInstrumentId == input.TransferInstrumentId || - (this.TransferInstrumentId != null && - this.TransferInstrumentId.Equals(input.TransferInstrumentId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (bankAccountNumber.IsSet && bankAccountNumber.Value == null) + throw new ArgumentNullException(nameof(bankAccountNumber), "Property is not nullable for class BacsDirectDebitDetails."); + + if (bankLocationId.IsSet && bankLocationId.Value == null) + throw new ArgumentNullException(nameof(bankLocationId), "Property is not nullable for class BacsDirectDebitDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class BacsDirectDebitDetails."); + + if (holderName.IsSet && holderName.Value == null) + throw new ArgumentNullException(nameof(holderName), "Property is not nullable for class BacsDirectDebitDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class BacsDirectDebitDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class BacsDirectDebitDetails."); + + if (transferInstrumentId.IsSet && transferInstrumentId.Value == null) + throw new ArgumentNullException(nameof(transferInstrumentId), "Property is not nullable for class BacsDirectDebitDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class BacsDirectDebitDetails."); + + return new BacsDirectDebitDetails(bankAccountNumber, bankLocationId, checkoutAttemptId, holderName, recurringDetailReference, storedPaymentMethodId, transferInstrumentId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BacsDirectDebitDetails bacsDirectDebitDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BankAccountNumber != null) - { - hashCode = (hashCode * 59) + this.BankAccountNumber.GetHashCode(); - } - if (this.BankLocationId != null) - { - hashCode = (hashCode * 59) + this.BankLocationId.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.HolderName != null) - { - hashCode = (hashCode * 59) + this.HolderName.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.TransferInstrumentId != null) - { - hashCode = (hashCode * 59) + this.TransferInstrumentId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, bacsDirectDebitDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, BacsDirectDebitDetails bacsDirectDebitDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (bacsDirectDebitDetails.BankAccountNumberOption.IsSet && bacsDirectDebitDetails.BankAccountNumber == null) + throw new ArgumentNullException(nameof(bacsDirectDebitDetails.BankAccountNumber), "Property is required for class BacsDirectDebitDetails."); - yield break; + if (bacsDirectDebitDetails.BankLocationIdOption.IsSet && bacsDirectDebitDetails.BankLocationId == null) + throw new ArgumentNullException(nameof(bacsDirectDebitDetails.BankLocationId), "Property is required for class BacsDirectDebitDetails."); + + if (bacsDirectDebitDetails.CheckoutAttemptIdOption.IsSet && bacsDirectDebitDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(bacsDirectDebitDetails.CheckoutAttemptId), "Property is required for class BacsDirectDebitDetails."); + + if (bacsDirectDebitDetails.HolderNameOption.IsSet && bacsDirectDebitDetails.HolderName == null) + throw new ArgumentNullException(nameof(bacsDirectDebitDetails.HolderName), "Property is required for class BacsDirectDebitDetails."); + + if (bacsDirectDebitDetails.RecurringDetailReferenceOption.IsSet && bacsDirectDebitDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(bacsDirectDebitDetails.RecurringDetailReference), "Property is required for class BacsDirectDebitDetails."); + + if (bacsDirectDebitDetails.StoredPaymentMethodIdOption.IsSet && bacsDirectDebitDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(bacsDirectDebitDetails.StoredPaymentMethodId), "Property is required for class BacsDirectDebitDetails."); + + if (bacsDirectDebitDetails.TransferInstrumentIdOption.IsSet && bacsDirectDebitDetails.TransferInstrumentId == null) + throw new ArgumentNullException(nameof(bacsDirectDebitDetails.TransferInstrumentId), "Property is required for class BacsDirectDebitDetails."); + + if (bacsDirectDebitDetails.BankAccountNumberOption.IsSet) + writer.WriteString("bankAccountNumber", bacsDirectDebitDetails.BankAccountNumber); + + if (bacsDirectDebitDetails.BankLocationIdOption.IsSet) + writer.WriteString("bankLocationId", bacsDirectDebitDetails.BankLocationId); + + if (bacsDirectDebitDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", bacsDirectDebitDetails.CheckoutAttemptId); + + if (bacsDirectDebitDetails.HolderNameOption.IsSet) + writer.WriteString("holderName", bacsDirectDebitDetails.HolderName); + + if (bacsDirectDebitDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", bacsDirectDebitDetails.RecurringDetailReference); + + if (bacsDirectDebitDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", bacsDirectDebitDetails.StoredPaymentMethodId); + + if (bacsDirectDebitDetails.TransferInstrumentIdOption.IsSet) + writer.WriteString("transferInstrumentId", bacsDirectDebitDetails.TransferInstrumentId); + + var typeRawValue = BacsDirectDebitDetails.TypeEnumToJsonValue(bacsDirectDebitDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/BalanceCheckRequest.cs b/Adyen/Model/Checkout/BalanceCheckRequest.cs index e15c595f7..d814b9622 100644 --- a/Adyen/Model/Checkout/BalanceCheckRequest.cs +++ b/Adyen/Model/Checkout/BalanceCheckRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,479 +14,877 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// BalanceCheckRequest /// - [DataContract(Name = "BalanceCheckRequest")] - public partial class BalanceCheckRequest : IEquatable, IValidatableObject + public partial class BalanceCheckRequest : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The merchant account identifier, with which you want to process the transaction. + /// The collection that contains the type of the payment method and its specific information. + /// accountInfo + /// additionalAmount + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + /// applicationInfo + /// billingAddress + /// browserInfo + /// The delay between the authorisation and scheduled auto-capture, specified in hours. + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// dccQuote + /// deliveryAddress + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + /// An integer value that is added to the normal fraud score. The value can be either positive or negative. + /// installments + /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana and ja-Hani character set for Visa, Mastercard and JCB payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, Kanji, capital letters, numbers and special characters. * Half-width or full-width characters. + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// merchantRiskIndicator + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + /// recurring + /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + /// A session ID used to identify a payment session. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// The combination of a language code and a country code to specify the language to be used in the payment. + /// shopperName + /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. + /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + /// The shopper's social security number. + /// An array of objects specifying how the payment should be split when using either Adyen for Platforms for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/split-payments), or standalone [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). + /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. + /// The shopper's telephone number. + /// threeDS2RequestData + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) + /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + /// Set to true if the payment should be routed to a trusted MID. + [JsonConstructor] + public BalanceCheckRequest(Amount amount, string merchantAccount, Dictionary paymentMethod, Option accountInfo = default, Option additionalAmount = default, Option> additionalData = default, Option applicationInfo = default, Option
billingAddress = default, Option browserInfo = default, Option captureDelayHours = default, Option dateOfBirth = default, Option dccQuote = default, Option
deliveryAddress = default, Option deliveryDate = default, Option deviceFingerprint = default, Option fraudOffset = default, Option installments = default, Option> localizedShopperStatement = default, Option mcc = default, Option merchantOrderReference = default, Option merchantRiskIndicator = default, Option> metadata = default, Option orderReference = default, Option recurring = default, Option recurringProcessingModel = default, Option reference = default, Option selectedBrand = default, Option selectedRecurringDetailReference = default, Option sessionId = default, Option shopperEmail = default, Option shopperIP = default, Option shopperInteraction = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option shopperStatement = default, Option socialSecurityNumber = default, Option> splits = default, Option store = default, Option telephoneNumber = default, Option threeDS2RequestData = default, Option threeDSAuthenticationOnly = default, Option totalsGroup = default, Option trustedShopper = default) + { + Amount = amount; + MerchantAccount = merchantAccount; + PaymentMethod = paymentMethod; + AccountInfoOption = accountInfo; + AdditionalAmountOption = additionalAmount; + AdditionalDataOption = additionalData; + ApplicationInfoOption = applicationInfo; + BillingAddressOption = billingAddress; + BrowserInfoOption = browserInfo; + CaptureDelayHoursOption = captureDelayHours; + DateOfBirthOption = dateOfBirth; + DccQuoteOption = dccQuote; + DeliveryAddressOption = deliveryAddress; + DeliveryDateOption = deliveryDate; + DeviceFingerprintOption = deviceFingerprint; + FraudOffsetOption = fraudOffset; + InstallmentsOption = installments; + LocalizedShopperStatementOption = localizedShopperStatement; + MccOption = mcc; + MerchantOrderReferenceOption = merchantOrderReference; + MerchantRiskIndicatorOption = merchantRiskIndicator; + MetadataOption = metadata; + OrderReferenceOption = orderReference; + RecurringOption = recurring; + RecurringProcessingModelOption = recurringProcessingModel; + ReferenceOption = reference; + SelectedBrandOption = selectedBrand; + SelectedRecurringDetailReferenceOption = selectedRecurringDetailReference; + SessionIdOption = sessionId; + ShopperEmailOption = shopperEmail; + ShopperIPOption = shopperIP; + ShopperInteractionOption = shopperInteraction; + ShopperLocaleOption = shopperLocale; + ShopperNameOption = shopperName; + ShopperReferenceOption = shopperReference; + ShopperStatementOption = shopperStatement; + SocialSecurityNumberOption = socialSecurityNumber; + SplitsOption = splits; + StoreOption = store; + TelephoneNumberOption = telephoneNumber; + ThreeDS2RequestDataOption = threeDS2RequestData; + ThreeDSAuthenticationOnlyOption = threeDSAuthenticationOnly; + TotalsGroupOption = totalsGroup; + TrustedShopperOption = trustedShopper; + OnCreated(); + } + + partial void OnCreated(); + /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// - [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// - [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// - [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) + { + if (value == RecurringProcessingModelEnum.CardOnFile) + return "CardOnFile"; + + if (value == RecurringProcessingModelEnum.Subscription) + return "Subscription"; + if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) + return "UnscheduledCardOnFile"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of RecurringProcessingModel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] - public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } + [JsonPropertyName("recurringProcessingModel")] + public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } + /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [JsonConverter(typeof(StringEnumConverter))] public enum ShopperInteractionEnum { /// /// Enum Ecommerce for value: Ecommerce /// - [EnumMember(Value = "Ecommerce")] Ecommerce = 1, /// /// Enum ContAuth for value: ContAuth /// - [EnumMember(Value = "ContAuth")] ContAuth = 2, /// /// Enum Moto for value: Moto /// - [EnumMember(Value = "Moto")] Moto = 3, /// /// Enum POS for value: POS /// - [EnumMember(Value = "POS")] POS = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ShopperInteractionEnum ShopperInteractionEnumFromString(string value) + { + if (value.Equals("Ecommerce")) + return ShopperInteractionEnum.Ecommerce; + + if (value.Equals("ContAuth")) + return ShopperInteractionEnum.ContAuth; + + if (value.Equals("Moto")) + return ShopperInteractionEnum.Moto; + + if (value.Equals("POS")) + return ShopperInteractionEnum.POS; + + throw new NotImplementedException($"Could not convert value to type ShopperInteractionEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ShopperInteractionEnum? ShopperInteractionEnumFromStringOrDefault(string value) + { + if (value.Equals("Ecommerce")) + return ShopperInteractionEnum.Ecommerce; + + if (value.Equals("ContAuth")) + return ShopperInteractionEnum.ContAuth; + + if (value.Equals("Moto")) + return ShopperInteractionEnum.Moto; + + if (value.Equals("POS")) + return ShopperInteractionEnum.POS; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ShopperInteractionEnumToJsonValue(ShopperInteractionEnum? value) + { + if (value == ShopperInteractionEnum.Ecommerce) + return "Ecommerce"; + + if (value == ShopperInteractionEnum.ContAuth) + return "ContAuth"; + + if (value == ShopperInteractionEnum.Moto) + return "Moto"; + if (value == ShopperInteractionEnum.POS) + return "POS"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of ShopperInteraction + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperInteractionOption { get; private set; } /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] - public ShopperInteractionEnum? ShopperInteraction { get; set; } + [JsonPropertyName("shopperInteraction")] + public ShopperInteractionEnum? ShopperInteraction { get { return this.ShopperInteractionOption; } set { this.ShopperInteractionOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Gets or Sets Amount /// - [JsonConstructorAttribute] - protected BalanceCheckRequest() { } + [JsonPropertyName("amount")] + public Amount Amount { get; set; } + /// - /// Initializes a new instance of the class. + /// The merchant account identifier, with which you want to process the transaction. /// - /// accountInfo. - /// additionalAmount. - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. - /// amount (required). - /// applicationInfo. - /// billingAddress. - /// browserInfo. - /// The delay between the authorisation and scheduled auto-capture, specified in hours.. - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. - /// dccQuote. - /// deliveryAddress. - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00. - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting).. - /// An integer value that is added to the normal fraud score. The value can be either positive or negative.. - /// installments. - /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana and ja-Hani character set for Visa, Mastercard and JCB payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, Kanji, capital letters, numbers and special characters. * Half-width or full-width characters.. - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. - /// The merchant account identifier, with which you want to process the transaction. (required). - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.. - /// merchantRiskIndicator. - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. . - /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead.. - /// The collection that contains the type of the payment method and its specific information. (required). - /// recurring. - /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.. - /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card.. - /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail.. - /// A session ID used to identify a payment session.. - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations.. - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new).. - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. - /// The combination of a language code and a country code to specify the language to be used in the payment.. - /// shopperName. - /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. - /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**.. - /// The shopper's social security number.. - /// An array of objects specifying how the payment should be split when using either Adyen for Platforms for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/split-payments), or standalone [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split).. - /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment.. - /// The shopper's telephone number.. - /// threeDS2RequestData. - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false). - /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available).. - /// Set to true if the payment should be routed to a trusted MID.. - public BalanceCheckRequest(AccountInfo accountInfo = default(AccountInfo), Amount additionalAmount = default(Amount), Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), Address billingAddress = default(Address), BrowserInfo browserInfo = default(BrowserInfo), int? captureDelayHours = default(int?), DateTime dateOfBirth = default(DateTime), ForexQuote dccQuote = default(ForexQuote), Address deliveryAddress = default(Address), DateTime deliveryDate = default(DateTime), string deviceFingerprint = default(string), int? fraudOffset = default(int?), Installments installments = default(Installments), Dictionary localizedShopperStatement = default(Dictionary), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), MerchantRiskIndicator merchantRiskIndicator = default(MerchantRiskIndicator), Dictionary metadata = default(Dictionary), string orderReference = default(string), Dictionary paymentMethod = default(Dictionary), Recurring recurring = default(Recurring), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string reference = default(string), string selectedBrand = default(string), string selectedRecurringDetailReference = default(string), string sessionId = default(string), string shopperEmail = default(string), string shopperIP = default(string), ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), string socialSecurityNumber = default(string), List splits = default(List), string store = default(string), string telephoneNumber = default(string), ThreeDS2RequestData threeDS2RequestData = default(ThreeDS2RequestData), bool? threeDSAuthenticationOnly = false, string totalsGroup = default(string), bool? trustedShopper = default(bool?)) - { - this.Amount = amount; - this.MerchantAccount = merchantAccount; - this.PaymentMethod = paymentMethod; - this.AccountInfo = accountInfo; - this.AdditionalAmount = additionalAmount; - this.AdditionalData = additionalData; - this.ApplicationInfo = applicationInfo; - this.BillingAddress = billingAddress; - this.BrowserInfo = browserInfo; - this.CaptureDelayHours = captureDelayHours; - this.DateOfBirth = dateOfBirth; - this.DccQuote = dccQuote; - this.DeliveryAddress = deliveryAddress; - this.DeliveryDate = deliveryDate; - this.DeviceFingerprint = deviceFingerprint; - this.FraudOffset = fraudOffset; - this.Installments = installments; - this.LocalizedShopperStatement = localizedShopperStatement; - this.Mcc = mcc; - this.MerchantOrderReference = merchantOrderReference; - this.MerchantRiskIndicator = merchantRiskIndicator; - this.Metadata = metadata; - this.OrderReference = orderReference; - this.Recurring = recurring; - this.RecurringProcessingModel = recurringProcessingModel; - this.Reference = reference; - this.SelectedBrand = selectedBrand; - this.SelectedRecurringDetailReference = selectedRecurringDetailReference; - this.SessionId = sessionId; - this.ShopperEmail = shopperEmail; - this.ShopperIP = shopperIP; - this.ShopperInteraction = shopperInteraction; - this.ShopperLocale = shopperLocale; - this.ShopperName = shopperName; - this.ShopperReference = shopperReference; - this.ShopperStatement = shopperStatement; - this.SocialSecurityNumber = socialSecurityNumber; - this.Splits = splits; - this.Store = store; - this.TelephoneNumber = telephoneNumber; - this.ThreeDS2RequestData = threeDS2RequestData; - this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; - this.TotalsGroup = totalsGroup; - this.TrustedShopper = trustedShopper; - } + /// The merchant account identifier, with which you want to process the transaction. + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get; set; } + + /// + /// The collection that contains the type of the payment method and its specific information. + /// + /// The collection that contains the type of the payment method and its specific information. + [JsonPropertyName("paymentMethod")] + public Dictionary PaymentMethod { get; set; } + + /// + /// Used to track the state of AccountInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountInfoOption { get; private set; } /// /// Gets or Sets AccountInfo /// - [DataMember(Name = "accountInfo", EmitDefaultValue = false)] - public AccountInfo AccountInfo { get; set; } + [JsonPropertyName("accountInfo")] + public AccountInfo AccountInfo { get { return this.AccountInfoOption; } set { this.AccountInfoOption = new Option(value); } } + + /// + /// Used to track the state of AdditionalAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AdditionalAmountOption { get; private set; } /// /// Gets or Sets AdditionalAmount /// - [DataMember(Name = "additionalAmount", EmitDefaultValue = false)] - public Amount AdditionalAmount { get; set; } + [JsonPropertyName("additionalAmount")] + public Amount AdditionalAmount { get { return this.AdditionalAmountOption; } set { this.AdditionalAmountOption = new Option(value); } } + + /// + /// Used to track the state of AdditionalData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AdditionalDataOption { get; private set; } /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - [DataMember(Name = "additionalData", EmitDefaultValue = false)] - public Dictionary AdditionalData { get; set; } + [JsonPropertyName("additionalData")] + public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } /// - /// Gets or Sets Amount + /// Used to track the state of ApplicationInfo /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ApplicationInfoOption { get; private set; } /// /// Gets or Sets ApplicationInfo /// - [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; set; } + [JsonPropertyName("applicationInfo")] + public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + + /// + /// Used to track the state of BillingAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option
BillingAddressOption { get; private set; } /// /// Gets or Sets BillingAddress /// - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public Address BillingAddress { get; set; } + [JsonPropertyName("billingAddress")] + public Address BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option
(value); } } + + /// + /// Used to track the state of BrowserInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BrowserInfoOption { get; private set; } /// /// Gets or Sets BrowserInfo /// - [DataMember(Name = "browserInfo", EmitDefaultValue = false)] - public BrowserInfo BrowserInfo { get; set; } + [JsonPropertyName("browserInfo")] + public BrowserInfo BrowserInfo { get { return this.BrowserInfoOption; } set { this.BrowserInfoOption = new Option(value); } } + + /// + /// Used to track the state of CaptureDelayHours + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CaptureDelayHoursOption { get; private set; } /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. - [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] - public int? CaptureDelayHours { get; set; } + [JsonPropertyName("captureDelayHours")] + public int? CaptureDelayHours { get { return this.CaptureDelayHoursOption; } set { this.CaptureDelayHoursOption = new Option(value); } } + + /// + /// Used to track the state of DateOfBirth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DateOfBirthOption { get; private set; } /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] - [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime DateOfBirth { get; set; } + [JsonPropertyName("dateOfBirth")] + public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } + + /// + /// Used to track the state of DccQuote + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DccQuoteOption { get; private set; } /// /// Gets or Sets DccQuote /// - [DataMember(Name = "dccQuote", EmitDefaultValue = false)] - public ForexQuote DccQuote { get; set; } + [JsonPropertyName("dccQuote")] + public ForexQuote DccQuote { get { return this.DccQuoteOption; } set { this.DccQuoteOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option
DeliveryAddressOption { get; private set; } /// /// Gets or Sets DeliveryAddress /// - [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] - public Address DeliveryAddress { get; set; } + [JsonPropertyName("deliveryAddress")] + public Address DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option
(value); } } + + /// + /// Used to track the state of DeliveryDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryDateOption { get; private set; } /// /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 /// /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - [DataMember(Name = "deliveryDate", EmitDefaultValue = false)] - public DateTime DeliveryDate { get; set; } + [JsonPropertyName("deliveryDate")] + public DateTime? DeliveryDate { get { return this.DeliveryDateOption; } set { this.DeliveryDateOption = new Option(value); } } + + /// + /// Used to track the state of DeviceFingerprint + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeviceFingerprintOption { get; private set; } /// /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). /// /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - [DataMember(Name = "deviceFingerprint", EmitDefaultValue = false)] - public string DeviceFingerprint { get; set; } + [JsonPropertyName("deviceFingerprint")] + public string DeviceFingerprint { get { return this.DeviceFingerprintOption; } set { this.DeviceFingerprintOption = new Option(value); } } + + /// + /// Used to track the state of FraudOffset + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FraudOffsetOption { get; private set; } /// /// An integer value that is added to the normal fraud score. The value can be either positive or negative. /// /// An integer value that is added to the normal fraud score. The value can be either positive or negative. - [DataMember(Name = "fraudOffset", EmitDefaultValue = false)] - public int? FraudOffset { get; set; } + [JsonPropertyName("fraudOffset")] + public int? FraudOffset { get { return this.FraudOffsetOption; } set { this.FraudOffsetOption = new Option(value); } } + + /// + /// Used to track the state of Installments + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentsOption { get; private set; } /// /// Gets or Sets Installments /// - [DataMember(Name = "installments", EmitDefaultValue = false)] - public Installments Installments { get; set; } + [JsonPropertyName("installments")] + public Installments Installments { get { return this.InstallmentsOption; } set { this.InstallmentsOption = new Option(value); } } + + /// + /// Used to track the state of LocalizedShopperStatement + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LocalizedShopperStatementOption { get; private set; } /// /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana and ja-Hani character set for Visa, Mastercard and JCB payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, Kanji, capital letters, numbers and special characters. * Half-width or full-width characters. /// /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana and ja-Hani character set for Visa, Mastercard and JCB payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, Kanji, capital letters, numbers and special characters. * Half-width or full-width characters. - [DataMember(Name = "localizedShopperStatement", EmitDefaultValue = false)] - public Dictionary LocalizedShopperStatement { get; set; } + [JsonPropertyName("localizedShopperStatement")] + public Dictionary LocalizedShopperStatement { get { return this.LocalizedShopperStatementOption; } set { this.LocalizedShopperStatementOption = new Option>(value); } } + + /// + /// Used to track the state of Mcc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MccOption { get; private set; } /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - [DataMember(Name = "mcc", EmitDefaultValue = false)] - public string Mcc { get; set; } + [JsonPropertyName("mcc")] + public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } /// - /// The merchant account identifier, with which you want to process the transaction. + /// Used to track the state of MerchantOrderReference /// - /// The merchant account identifier, with which you want to process the transaction. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantOrderReferenceOption { get; private set; } /// /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. /// /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] - public string MerchantOrderReference { get; set; } + [JsonPropertyName("merchantOrderReference")] + public string MerchantOrderReference { get { return this.MerchantOrderReferenceOption; } set { this.MerchantOrderReferenceOption = new Option(value); } } + + /// + /// Used to track the state of MerchantRiskIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantRiskIndicatorOption { get; private set; } /// /// Gets or Sets MerchantRiskIndicator /// - [DataMember(Name = "merchantRiskIndicator", EmitDefaultValue = false)] - public MerchantRiskIndicator MerchantRiskIndicator { get; set; } + [JsonPropertyName("merchantRiskIndicator")] + public MerchantRiskIndicator MerchantRiskIndicator { get { return this.MerchantRiskIndicatorOption; } set { this.MerchantRiskIndicatorOption = new Option(value); } } + + /// + /// Used to track the state of Metadata + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> MetadataOption { get; private set; } /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - [DataMember(Name = "metadata", EmitDefaultValue = false)] - public Dictionary Metadata { get; set; } + [JsonPropertyName("metadata")] + public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } + + /// + /// Used to track the state of OrderReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OrderReferenceOption { get; private set; } /// /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. /// /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - [DataMember(Name = "orderReference", EmitDefaultValue = false)] - public string OrderReference { get; set; } + [JsonPropertyName("orderReference")] + public string OrderReference { get { return this.OrderReferenceOption; } set { this.OrderReferenceOption = new Option(value); } } /// - /// The collection that contains the type of the payment method and its specific information. + /// Used to track the state of Recurring /// - /// The collection that contains the type of the payment method and its specific information. - [DataMember(Name = "paymentMethod", IsRequired = false, EmitDefaultValue = false)] - public Dictionary PaymentMethod { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringOption { get; private set; } /// /// Gets or Sets Recurring /// - [DataMember(Name = "recurring", EmitDefaultValue = false)] - public Recurring Recurring { get; set; } + [JsonPropertyName("recurring")] + public Recurring Recurring { get { return this.RecurringOption; } set { this.RecurringOption = new Option(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. /// /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + + /// + /// Used to track the state of SelectedBrand + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SelectedBrandOption { get; private set; } /// /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. /// /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. - [DataMember(Name = "selectedBrand", EmitDefaultValue = false)] - public string SelectedBrand { get; set; } + [JsonPropertyName("selectedBrand")] + public string SelectedBrand { get { return this.SelectedBrandOption; } set { this.SelectedBrandOption = new Option(value); } } + + /// + /// Used to track the state of SelectedRecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SelectedRecurringDetailReferenceOption { get; private set; } /// /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. /// /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. - [DataMember(Name = "selectedRecurringDetailReference", EmitDefaultValue = false)] - public string SelectedRecurringDetailReference { get; set; } + [JsonPropertyName("selectedRecurringDetailReference")] + public string SelectedRecurringDetailReference { get { return this.SelectedRecurringDetailReferenceOption; } set { this.SelectedRecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of SessionId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SessionIdOption { get; private set; } /// /// A session ID used to identify a payment session. /// /// A session ID used to identify a payment session. - [DataMember(Name = "sessionId", EmitDefaultValue = false)] - public string SessionId { get; set; } + [JsonPropertyName("sessionId")] + public string SessionId { get { return this.SessionIdOption; } set { this.SessionIdOption = new Option(value); } } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. /// /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of ShopperIP + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperIPOption { get; private set; } /// /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). /// /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - [DataMember(Name = "shopperIP", EmitDefaultValue = false)] - public string ShopperIP { get; set; } + [JsonPropertyName("shopperIP")] + public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } + + /// + /// Used to track the state of ShopperLocale + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperLocaleOption { get; private set; } /// /// The combination of a language code and a country code to specify the language to be used in the payment. /// /// The combination of a language code and a country code to specify the language to be used in the payment. - [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] - public string ShopperLocale { get; set; } + [JsonPropertyName("shopperLocale")] + public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } + + /// + /// Used to track the state of ShopperName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNameOption { get; private set; } /// /// Gets or Sets ShopperName /// - [DataMember(Name = "shopperName", EmitDefaultValue = false)] - public Name ShopperName { get; set; } + [JsonPropertyName("shopperName")] + public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } + + /// + /// Used to track the state of ShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperReferenceOption { get; private set; } /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [DataMember(Name = "shopperReference", EmitDefaultValue = false)] - public string ShopperReference { get; set; } + [JsonPropertyName("shopperReference")] + public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperStatement + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperStatementOption { get; private set; } /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] - public string ShopperStatement { get; set; } + [JsonPropertyName("shopperStatement")] + public string ShopperStatement { get { return this.ShopperStatementOption; } set { this.ShopperStatementOption = new Option(value); } } + + /// + /// Used to track the state of SocialSecurityNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SocialSecurityNumberOption { get; private set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] - public string SocialSecurityNumber { get; set; } + [JsonPropertyName("socialSecurityNumber")] + public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } + + /// + /// Used to track the state of Splits + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SplitsOption { get; private set; } /// /// An array of objects specifying how the payment should be split when using either Adyen for Platforms for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/split-payments), or standalone [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). /// /// An array of objects specifying how the payment should be split when using either Adyen for Platforms for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/split-payments), or standalone [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). - [DataMember(Name = "splits", EmitDefaultValue = false)] - public List Splits { get; set; } + [JsonPropertyName("splits")] + public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } + + /// + /// Used to track the state of Store + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoreOption { get; private set; } /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - [DataMember(Name = "store", EmitDefaultValue = false)] - public string Store { get; set; } + [JsonPropertyName("store")] + public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } + + /// + /// Used to track the state of TelephoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TelephoneNumberOption { get; private set; } /// /// The shopper's telephone number. /// /// The shopper's telephone number. - [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] - public string TelephoneNumber { get; set; } + [JsonPropertyName("telephoneNumber")] + public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2RequestData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2RequestDataOption { get; private set; } /// /// Gets or Sets ThreeDS2RequestData /// - [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] - public ThreeDS2RequestData ThreeDS2RequestData { get; set; } + [JsonPropertyName("threeDS2RequestData")] + public ThreeDS2RequestData ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSAuthenticationOnly + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSAuthenticationOnlyOption { get; private set; } /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.authenticationOnly` instead.")] - public bool? ThreeDSAuthenticationOnly { get; set; } + [JsonPropertyName("threeDSAuthenticationOnly")] + [Obsolete] + public bool? ThreeDSAuthenticationOnly { get { return this.ThreeDSAuthenticationOnlyOption; } set { this.ThreeDSAuthenticationOnlyOption = new Option(value); } } + + /// + /// Used to track the state of TotalsGroup + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TotalsGroupOption { get; private set; } /// /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). /// /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). - [DataMember(Name = "totalsGroup", EmitDefaultValue = false)] - public string TotalsGroup { get; set; } + [JsonPropertyName("totalsGroup")] + public string TotalsGroup { get { return this.TotalsGroupOption; } set { this.TotalsGroupOption = new Option(value); } } + + /// + /// Used to track the state of TrustedShopper + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TrustedShopperOption { get; private set; } /// /// Set to true if the payment should be routed to a trusted MID. /// /// Set to true if the payment should be routed to a trusted MID. - [DataMember(Name = "trustedShopper", EmitDefaultValue = false)] - public bool? TrustedShopper { get; set; } + [JsonPropertyName("trustedShopper")] + public bool? TrustedShopper { get { return this.TrustedShopperOption; } set { this.TrustedShopperOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -497,10 +894,12 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class BalanceCheckRequest {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); sb.Append(" AccountInfo: ").Append(AccountInfo).Append("\n"); sb.Append(" AdditionalAmount: ").Append(AdditionalAmount).Append("\n"); sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); - sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); sb.Append(" BrowserInfo: ").Append(BrowserInfo).Append("\n"); @@ -514,12 +913,10 @@ public override string ToString() sb.Append(" Installments: ").Append(Installments).Append("\n"); sb.Append(" LocalizedShopperStatement: ").Append(LocalizedShopperStatement).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); sb.Append(" MerchantRiskIndicator: ").Append(MerchantRiskIndicator).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append(" OrderReference: ").Append(OrderReference).Append("\n"); - sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); sb.Append(" Recurring: ").Append(Recurring).Append("\n"); sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); @@ -546,466 +943,738 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + // DeviceFingerprint (string) maxLength + if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) + { + yield return new ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); + } + + // Store (string) maxLength + if (this.Store != null && this.Store.Length > 16) + { + yield return new ValidationResult("Invalid value for Store, length must be less than 16.", new [] { "Store" }); + } + + // Store (string) minLength + if (this.Store != null && this.Store.Length < 1) + { + yield return new ValidationResult("Invalid value for Store, length must be greater than 1.", new [] { "Store" }); + } + + // TotalsGroup (string) maxLength + if (this.TotalsGroup != null && this.TotalsGroup.Length > 16) + { + yield return new ValidationResult("Invalid value for TotalsGroup, length must be less than 16.", new [] { "TotalsGroup" }); + } + + // TotalsGroup (string) minLength + if (this.TotalsGroup != null && this.TotalsGroup.Length < 1) + { + yield return new ValidationResult("Invalid value for TotalsGroup, length must be greater than 1.", new [] { "TotalsGroup" }); + } + + yield break; } + } + /// + /// A Json converter for type + /// + public class BalanceCheckRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// The format to use to serialize DateOfBirth /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as BalanceCheckRequest); - } + public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd"; /// - /// Returns true if BalanceCheckRequest instances are equal + /// The format to use to serialize DeliveryDate /// - /// Instance of BalanceCheckRequest to be compared - /// Boolean - public bool Equals(BalanceCheckRequest input) - { - if (input == null) - { - return false; - } - return - ( - this.AccountInfo == input.AccountInfo || - (this.AccountInfo != null && - this.AccountInfo.Equals(input.AccountInfo)) - ) && - ( - this.AdditionalAmount == input.AdditionalAmount || - (this.AdditionalAmount != null && - this.AdditionalAmount.Equals(input.AdditionalAmount)) - ) && - ( - this.AdditionalData == input.AdditionalData || - this.AdditionalData != null && - input.AdditionalData != null && - this.AdditionalData.SequenceEqual(input.AdditionalData) - ) && - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.BrowserInfo == input.BrowserInfo || - (this.BrowserInfo != null && - this.BrowserInfo.Equals(input.BrowserInfo)) - ) && - ( - this.CaptureDelayHours == input.CaptureDelayHours || - this.CaptureDelayHours.Equals(input.CaptureDelayHours) - ) && - ( - this.DateOfBirth == input.DateOfBirth || - (this.DateOfBirth != null && - this.DateOfBirth.Equals(input.DateOfBirth)) - ) && - ( - this.DccQuote == input.DccQuote || - (this.DccQuote != null && - this.DccQuote.Equals(input.DccQuote)) - ) && - ( - this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) - ) && - ( - this.DeliveryDate == input.DeliveryDate || - (this.DeliveryDate != null && - this.DeliveryDate.Equals(input.DeliveryDate)) - ) && - ( - this.DeviceFingerprint == input.DeviceFingerprint || - (this.DeviceFingerprint != null && - this.DeviceFingerprint.Equals(input.DeviceFingerprint)) - ) && - ( - this.FraudOffset == input.FraudOffset || - this.FraudOffset.Equals(input.FraudOffset) - ) && - ( - this.Installments == input.Installments || - (this.Installments != null && - this.Installments.Equals(input.Installments)) - ) && - ( - this.LocalizedShopperStatement == input.LocalizedShopperStatement || - this.LocalizedShopperStatement != null && - input.LocalizedShopperStatement != null && - this.LocalizedShopperStatement.SequenceEqual(input.LocalizedShopperStatement) - ) && - ( - this.Mcc == input.Mcc || - (this.Mcc != null && - this.Mcc.Equals(input.Mcc)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.MerchantOrderReference == input.MerchantOrderReference || - (this.MerchantOrderReference != null && - this.MerchantOrderReference.Equals(input.MerchantOrderReference)) - ) && - ( - this.MerchantRiskIndicator == input.MerchantRiskIndicator || - (this.MerchantRiskIndicator != null && - this.MerchantRiskIndicator.Equals(input.MerchantRiskIndicator)) - ) && - ( - this.Metadata == input.Metadata || - this.Metadata != null && - input.Metadata != null && - this.Metadata.SequenceEqual(input.Metadata) - ) && - ( - this.OrderReference == input.OrderReference || - (this.OrderReference != null && - this.OrderReference.Equals(input.OrderReference)) - ) && - ( - this.PaymentMethod == input.PaymentMethod || - this.PaymentMethod != null && - input.PaymentMethod != null && - this.PaymentMethod.SequenceEqual(input.PaymentMethod) - ) && - ( - this.Recurring == input.Recurring || - (this.Recurring != null && - this.Recurring.Equals(input.Recurring)) - ) && - ( - this.RecurringProcessingModel == input.RecurringProcessingModel || - this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.SelectedBrand == input.SelectedBrand || - (this.SelectedBrand != null && - this.SelectedBrand.Equals(input.SelectedBrand)) - ) && - ( - this.SelectedRecurringDetailReference == input.SelectedRecurringDetailReference || - (this.SelectedRecurringDetailReference != null && - this.SelectedRecurringDetailReference.Equals(input.SelectedRecurringDetailReference)) - ) && - ( - this.SessionId == input.SessionId || - (this.SessionId != null && - this.SessionId.Equals(input.SessionId)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.ShopperIP == input.ShopperIP || - (this.ShopperIP != null && - this.ShopperIP.Equals(input.ShopperIP)) - ) && - ( - this.ShopperInteraction == input.ShopperInteraction || - this.ShopperInteraction.Equals(input.ShopperInteraction) - ) && - ( - this.ShopperLocale == input.ShopperLocale || - (this.ShopperLocale != null && - this.ShopperLocale.Equals(input.ShopperLocale)) - ) && - ( - this.ShopperName == input.ShopperName || - (this.ShopperName != null && - this.ShopperName.Equals(input.ShopperName)) - ) && - ( - this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) - ) && - ( - this.ShopperStatement == input.ShopperStatement || - (this.ShopperStatement != null && - this.ShopperStatement.Equals(input.ShopperStatement)) - ) && - ( - this.SocialSecurityNumber == input.SocialSecurityNumber || - (this.SocialSecurityNumber != null && - this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) - ) && - ( - this.Splits == input.Splits || - this.Splits != null && - input.Splits != null && - this.Splits.SequenceEqual(input.Splits) - ) && - ( - this.Store == input.Store || - (this.Store != null && - this.Store.Equals(input.Store)) - ) && - ( - this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) - ) && - ( - this.ThreeDS2RequestData == input.ThreeDS2RequestData || - (this.ThreeDS2RequestData != null && - this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) - ) && - ( - this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || - this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) - ) && - ( - this.TotalsGroup == input.TotalsGroup || - (this.TotalsGroup != null && - this.TotalsGroup.Equals(input.TotalsGroup)) - ) && - ( - this.TrustedShopper == input.TrustedShopper || - this.TrustedShopper.Equals(input.TrustedShopper) - ); - } + public static string DeliveryDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// Gets the hash code + /// Deserializes json to /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + /// + public override BalanceCheckRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option merchantAccount = default; + Option> paymentMethod = default; + Option accountInfo = default; + Option additionalAmount = default; + Option> additionalData = default; + Option applicationInfo = default; + Option
billingAddress = default; + Option browserInfo = default; + Option captureDelayHours = default; + Option dateOfBirth = default; + Option dccQuote = default; + Option
deliveryAddress = default; + Option deliveryDate = default; + Option deviceFingerprint = default; + Option fraudOffset = default; + Option installments = default; + Option> localizedShopperStatement = default; + Option mcc = default; + Option merchantOrderReference = default; + Option merchantRiskIndicator = default; + Option> metadata = default; + Option orderReference = default; + Option recurring = default; + Option recurringProcessingModel = default; + Option reference = default; + Option selectedBrand = default; + Option selectedRecurringDetailReference = default; + Option sessionId = default; + Option shopperEmail = default; + Option shopperIP = default; + Option shopperInteraction = default; + Option shopperLocale = default; + Option shopperName = default; + Option shopperReference = default; + Option shopperStatement = default; + Option socialSecurityNumber = default; + Option> splits = default; + Option store = default; + Option telephoneNumber = default; + Option threeDS2RequestData = default; + Option threeDSAuthenticationOnly = default; + Option totalsGroup = default; + Option trustedShopper = default; + + while (utf8JsonReader.Read()) { - int hashCode = 41; - if (this.AccountInfo != null) - { - hashCode = (hashCode * 59) + this.AccountInfo.GetHashCode(); - } - if (this.AdditionalAmount != null) - { - hashCode = (hashCode * 59) + this.AdditionalAmount.GetHashCode(); - } - if (this.AdditionalData != null) - { - hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); - } - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.ApplicationInfo != null) - { - hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); - } - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.BrowserInfo != null) - { - hashCode = (hashCode * 59) + this.BrowserInfo.GetHashCode(); - } - hashCode = (hashCode * 59) + this.CaptureDelayHours.GetHashCode(); - if (this.DateOfBirth != null) - { - hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); - } - if (this.DccQuote != null) - { - hashCode = (hashCode * 59) + this.DccQuote.GetHashCode(); - } - if (this.DeliveryAddress != null) - { - hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); - } - if (this.DeliveryDate != null) - { - hashCode = (hashCode * 59) + this.DeliveryDate.GetHashCode(); - } - if (this.DeviceFingerprint != null) - { - hashCode = (hashCode * 59) + this.DeviceFingerprint.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FraudOffset.GetHashCode(); - if (this.Installments != null) - { - hashCode = (hashCode * 59) + this.Installments.GetHashCode(); - } - if (this.LocalizedShopperStatement != null) - { - hashCode = (hashCode * 59) + this.LocalizedShopperStatement.GetHashCode(); - } - if (this.Mcc != null) - { - hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.MerchantOrderReference != null) - { - hashCode = (hashCode * 59) + this.MerchantOrderReference.GetHashCode(); - } - if (this.MerchantRiskIndicator != null) - { - hashCode = (hashCode * 59) + this.MerchantRiskIndicator.GetHashCode(); - } - if (this.Metadata != null) - { - hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); - } - if (this.OrderReference != null) - { - hashCode = (hashCode * 59) + this.OrderReference.GetHashCode(); - } - if (this.PaymentMethod != null) - { - hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); - } - if (this.Recurring != null) - { - hashCode = (hashCode * 59) + this.Recurring.GetHashCode(); - } - hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.SelectedBrand != null) - { - hashCode = (hashCode * 59) + this.SelectedBrand.GetHashCode(); - } - if (this.SelectedRecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.SelectedRecurringDetailReference.GetHashCode(); - } - if (this.SessionId != null) - { - hashCode = (hashCode * 59) + this.SessionId.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.ShopperIP != null) - { - hashCode = (hashCode * 59) + this.ShopperIP.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ShopperInteraction.GetHashCode(); - if (this.ShopperLocale != null) - { - hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); - } - if (this.ShopperName != null) - { - hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); - } - if (this.ShopperReference != null) - { - hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); - } - if (this.ShopperStatement != null) - { - hashCode = (hashCode * 59) + this.ShopperStatement.GetHashCode(); - } - if (this.SocialSecurityNumber != null) - { - hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); - } - if (this.Splits != null) - { - hashCode = (hashCode * 59) + this.Splits.GetHashCode(); - } - if (this.Store != null) - { - hashCode = (hashCode * 59) + this.Store.GetHashCode(); - } - if (this.TelephoneNumber != null) - { - hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); - } - if (this.ThreeDS2RequestData != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ThreeDSAuthenticationOnly.GetHashCode(); - if (this.TotalsGroup != null) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - hashCode = (hashCode * 59) + this.TotalsGroup.GetHashCode(); + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethod": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + paymentMethod = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "accountInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + accountInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "additionalAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "additionalData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "applicationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "billingAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + billingAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "browserInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + browserInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "captureDelayHours": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + captureDelayHours = new Option(utf8JsonReader.GetInt32()); + break; + case "dateOfBirth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "dccQuote": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dccQuote = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliveryAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliveryAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliveryDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliveryDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deviceFingerprint": + deviceFingerprint = new Option(utf8JsonReader.GetString()); + break; + case "fraudOffset": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fraudOffset = new Option(utf8JsonReader.GetInt32()); + break; + case "installments": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + installments = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "localizedShopperStatement": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + localizedShopperStatement = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mcc": + mcc = new Option(utf8JsonReader.GetString()); + break; + case "merchantOrderReference": + merchantOrderReference = new Option(utf8JsonReader.GetString()); + break; + case "merchantRiskIndicator": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + merchantRiskIndicator = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "metadata": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "orderReference": + orderReference = new Option(utf8JsonReader.GetString()); + break; + case "recurring": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + recurring = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "recurringProcessingModel": + string recurringProcessingModelRawValue = utf8JsonReader.GetString(); + if (recurringProcessingModelRawValue != null) + recurringProcessingModel = new Option(BalanceCheckRequest.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "selectedBrand": + selectedBrand = new Option(utf8JsonReader.GetString()); + break; + case "selectedRecurringDetailReference": + selectedRecurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "sessionId": + sessionId = new Option(utf8JsonReader.GetString()); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "shopperIP": + shopperIP = new Option(utf8JsonReader.GetString()); + break; + case "shopperInteraction": + string shopperInteractionRawValue = utf8JsonReader.GetString(); + if (shopperInteractionRawValue != null) + shopperInteraction = new Option(BalanceCheckRequest.ShopperInteractionEnumFromStringOrDefault(shopperInteractionRawValue)); + break; + case "shopperLocale": + shopperLocale = new Option(utf8JsonReader.GetString()); + break; + case "shopperName": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperReference": + shopperReference = new Option(utf8JsonReader.GetString()); + break; + case "shopperStatement": + shopperStatement = new Option(utf8JsonReader.GetString()); + break; + case "socialSecurityNumber": + socialSecurityNumber = new Option(utf8JsonReader.GetString()); + break; + case "splits": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "store": + store = new Option(utf8JsonReader.GetString()); + break; + case "telephoneNumber": + telephoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2RequestData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDSAuthenticationOnly": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDSAuthenticationOnly = new Option(utf8JsonReader.GetBoolean()); + break; + case "totalsGroup": + totalsGroup = new Option(utf8JsonReader.GetString()); + break; + case "trustedShopper": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + trustedShopper = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } } - hashCode = (hashCode * 59) + this.TrustedShopper.GetHashCode(); - return hashCode; } + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class BalanceCheckRequest.", nameof(amount)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class BalanceCheckRequest.", nameof(merchantAccount)); + + if (!paymentMethod.IsSet) + throw new ArgumentException("Property is required for class BalanceCheckRequest.", nameof(paymentMethod)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class BalanceCheckRequest."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class BalanceCheckRequest."); + + if (paymentMethod.IsSet && paymentMethod.Value == null) + throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class BalanceCheckRequest."); + + if (accountInfo.IsSet && accountInfo.Value == null) + throw new ArgumentNullException(nameof(accountInfo), "Property is not nullable for class BalanceCheckRequest."); + + if (additionalAmount.IsSet && additionalAmount.Value == null) + throw new ArgumentNullException(nameof(additionalAmount), "Property is not nullable for class BalanceCheckRequest."); + + if (additionalData.IsSet && additionalData.Value == null) + throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class BalanceCheckRequest."); + + if (applicationInfo.IsSet && applicationInfo.Value == null) + throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class BalanceCheckRequest."); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class BalanceCheckRequest."); + + if (browserInfo.IsSet && browserInfo.Value == null) + throw new ArgumentNullException(nameof(browserInfo), "Property is not nullable for class BalanceCheckRequest."); + + if (captureDelayHours.IsSet && captureDelayHours.Value == null) + throw new ArgumentNullException(nameof(captureDelayHours), "Property is not nullable for class BalanceCheckRequest."); + + if (dateOfBirth.IsSet && dateOfBirth.Value == null) + throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class BalanceCheckRequest."); + + if (dccQuote.IsSet && dccQuote.Value == null) + throw new ArgumentNullException(nameof(dccQuote), "Property is not nullable for class BalanceCheckRequest."); + + if (deliveryAddress.IsSet && deliveryAddress.Value == null) + throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class BalanceCheckRequest."); + + if (deliveryDate.IsSet && deliveryDate.Value == null) + throw new ArgumentNullException(nameof(deliveryDate), "Property is not nullable for class BalanceCheckRequest."); + + if (deviceFingerprint.IsSet && deviceFingerprint.Value == null) + throw new ArgumentNullException(nameof(deviceFingerprint), "Property is not nullable for class BalanceCheckRequest."); + + if (fraudOffset.IsSet && fraudOffset.Value == null) + throw new ArgumentNullException(nameof(fraudOffset), "Property is not nullable for class BalanceCheckRequest."); + + if (installments.IsSet && installments.Value == null) + throw new ArgumentNullException(nameof(installments), "Property is not nullable for class BalanceCheckRequest."); + + if (localizedShopperStatement.IsSet && localizedShopperStatement.Value == null) + throw new ArgumentNullException(nameof(localizedShopperStatement), "Property is not nullable for class BalanceCheckRequest."); + + if (mcc.IsSet && mcc.Value == null) + throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class BalanceCheckRequest."); + + if (merchantOrderReference.IsSet && merchantOrderReference.Value == null) + throw new ArgumentNullException(nameof(merchantOrderReference), "Property is not nullable for class BalanceCheckRequest."); + + if (merchantRiskIndicator.IsSet && merchantRiskIndicator.Value == null) + throw new ArgumentNullException(nameof(merchantRiskIndicator), "Property is not nullable for class BalanceCheckRequest."); + + if (metadata.IsSet && metadata.Value == null) + throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class BalanceCheckRequest."); + + if (orderReference.IsSet && orderReference.Value == null) + throw new ArgumentNullException(nameof(orderReference), "Property is not nullable for class BalanceCheckRequest."); + + if (recurring.IsSet && recurring.Value == null) + throw new ArgumentNullException(nameof(recurring), "Property is not nullable for class BalanceCheckRequest."); + + if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) + throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class BalanceCheckRequest."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class BalanceCheckRequest."); + + if (selectedBrand.IsSet && selectedBrand.Value == null) + throw new ArgumentNullException(nameof(selectedBrand), "Property is not nullable for class BalanceCheckRequest."); + + if (selectedRecurringDetailReference.IsSet && selectedRecurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(selectedRecurringDetailReference), "Property is not nullable for class BalanceCheckRequest."); + + if (sessionId.IsSet && sessionId.Value == null) + throw new ArgumentNullException(nameof(sessionId), "Property is not nullable for class BalanceCheckRequest."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class BalanceCheckRequest."); + + if (shopperIP.IsSet && shopperIP.Value == null) + throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class BalanceCheckRequest."); + + if (shopperInteraction.IsSet && shopperInteraction.Value == null) + throw new ArgumentNullException(nameof(shopperInteraction), "Property is not nullable for class BalanceCheckRequest."); + + if (shopperLocale.IsSet && shopperLocale.Value == null) + throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class BalanceCheckRequest."); + + if (shopperName.IsSet && shopperName.Value == null) + throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class BalanceCheckRequest."); + + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class BalanceCheckRequest."); + + if (shopperStatement.IsSet && shopperStatement.Value == null) + throw new ArgumentNullException(nameof(shopperStatement), "Property is not nullable for class BalanceCheckRequest."); + + if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) + throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class BalanceCheckRequest."); + + if (splits.IsSet && splits.Value == null) + throw new ArgumentNullException(nameof(splits), "Property is not nullable for class BalanceCheckRequest."); + + if (store.IsSet && store.Value == null) + throw new ArgumentNullException(nameof(store), "Property is not nullable for class BalanceCheckRequest."); + + if (telephoneNumber.IsSet && telephoneNumber.Value == null) + throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class BalanceCheckRequest."); + + if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) + throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class BalanceCheckRequest."); + + if (threeDSAuthenticationOnly.IsSet && threeDSAuthenticationOnly.Value == null) + throw new ArgumentNullException(nameof(threeDSAuthenticationOnly), "Property is not nullable for class BalanceCheckRequest."); + + if (totalsGroup.IsSet && totalsGroup.Value == null) + throw new ArgumentNullException(nameof(totalsGroup), "Property is not nullable for class BalanceCheckRequest."); + + if (trustedShopper.IsSet && trustedShopper.Value == null) + throw new ArgumentNullException(nameof(trustedShopper), "Property is not nullable for class BalanceCheckRequest."); + + return new BalanceCheckRequest(amount.Value, merchantAccount.Value, paymentMethod.Value, accountInfo, additionalAmount, additionalData, applicationInfo, billingAddress, browserInfo, captureDelayHours, dateOfBirth, dccQuote, deliveryAddress, deliveryDate, deviceFingerprint, fraudOffset, installments, localizedShopperStatement, mcc, merchantOrderReference, merchantRiskIndicator, metadata, orderReference, recurring, recurringProcessingModel, reference, selectedBrand, selectedRecurringDetailReference, sessionId, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, socialSecurityNumber, splits, store, telephoneNumber, threeDS2RequestData, threeDSAuthenticationOnly, totalsGroup, trustedShopper); } + /// - /// To validate all properties of the instance + /// Serializes a /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BalanceCheckRequest balanceCheckRequest, JsonSerializerOptions jsonSerializerOptions) { - // DeviceFingerprint (string) maxLength - if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) + writer.WriteStartObject(); + + WriteProperties(writer, balanceCheckRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, BalanceCheckRequest balanceCheckRequest, JsonSerializerOptions jsonSerializerOptions) + { + if (balanceCheckRequest.Amount == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.Amount), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.MerchantAccount), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.PaymentMethod == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.PaymentMethod), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.AccountInfoOption.IsSet && balanceCheckRequest.AccountInfo == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.AccountInfo), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.AdditionalAmountOption.IsSet && balanceCheckRequest.AdditionalAmount == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.AdditionalAmount), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.AdditionalDataOption.IsSet && balanceCheckRequest.AdditionalData == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.AdditionalData), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.ApplicationInfoOption.IsSet && balanceCheckRequest.ApplicationInfo == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.ApplicationInfo), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.BillingAddressOption.IsSet && balanceCheckRequest.BillingAddress == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.BillingAddress), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.BrowserInfoOption.IsSet && balanceCheckRequest.BrowserInfo == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.BrowserInfo), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.DccQuoteOption.IsSet && balanceCheckRequest.DccQuote == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.DccQuote), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.DeliveryAddressOption.IsSet && balanceCheckRequest.DeliveryAddress == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.DeliveryAddress), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.DeviceFingerprintOption.IsSet && balanceCheckRequest.DeviceFingerprint == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.DeviceFingerprint), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.InstallmentsOption.IsSet && balanceCheckRequest.Installments == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.Installments), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.LocalizedShopperStatementOption.IsSet && balanceCheckRequest.LocalizedShopperStatement == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.LocalizedShopperStatement), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.MccOption.IsSet && balanceCheckRequest.Mcc == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.Mcc), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.MerchantOrderReferenceOption.IsSet && balanceCheckRequest.MerchantOrderReference == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.MerchantOrderReference), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.MerchantRiskIndicatorOption.IsSet && balanceCheckRequest.MerchantRiskIndicator == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.MerchantRiskIndicator), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.MetadataOption.IsSet && balanceCheckRequest.Metadata == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.Metadata), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.OrderReferenceOption.IsSet && balanceCheckRequest.OrderReference == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.OrderReference), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.RecurringOption.IsSet && balanceCheckRequest.Recurring == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.Recurring), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.ReferenceOption.IsSet && balanceCheckRequest.Reference == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.Reference), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.SelectedBrandOption.IsSet && balanceCheckRequest.SelectedBrand == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.SelectedBrand), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.SelectedRecurringDetailReferenceOption.IsSet && balanceCheckRequest.SelectedRecurringDetailReference == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.SelectedRecurringDetailReference), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.SessionIdOption.IsSet && balanceCheckRequest.SessionId == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.SessionId), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.ShopperEmailOption.IsSet && balanceCheckRequest.ShopperEmail == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.ShopperEmail), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.ShopperIPOption.IsSet && balanceCheckRequest.ShopperIP == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.ShopperIP), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.ShopperLocaleOption.IsSet && balanceCheckRequest.ShopperLocale == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.ShopperLocale), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.ShopperNameOption.IsSet && balanceCheckRequest.ShopperName == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.ShopperName), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.ShopperReferenceOption.IsSet && balanceCheckRequest.ShopperReference == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.ShopperReference), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.ShopperStatementOption.IsSet && balanceCheckRequest.ShopperStatement == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.ShopperStatement), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.SocialSecurityNumberOption.IsSet && balanceCheckRequest.SocialSecurityNumber == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.SocialSecurityNumber), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.SplitsOption.IsSet && balanceCheckRequest.Splits == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.Splits), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.StoreOption.IsSet && balanceCheckRequest.Store == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.Store), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.TelephoneNumberOption.IsSet && balanceCheckRequest.TelephoneNumber == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.TelephoneNumber), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.ThreeDS2RequestDataOption.IsSet && balanceCheckRequest.ThreeDS2RequestData == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.ThreeDS2RequestData), "Property is required for class BalanceCheckRequest."); + + if (balanceCheckRequest.TotalsGroupOption.IsSet && balanceCheckRequest.TotalsGroup == null) + throw new ArgumentNullException(nameof(balanceCheckRequest.TotalsGroup), "Property is required for class BalanceCheckRequest."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, balanceCheckRequest.Amount, jsonSerializerOptions); + writer.WriteString("merchantAccount", balanceCheckRequest.MerchantAccount); + + writer.WritePropertyName("paymentMethod"); + JsonSerializer.Serialize(writer, balanceCheckRequest.PaymentMethod, jsonSerializerOptions); + if (balanceCheckRequest.AccountInfoOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); + writer.WritePropertyName("accountInfo"); + JsonSerializer.Serialize(writer, balanceCheckRequest.AccountInfo, jsonSerializerOptions); } + if (balanceCheckRequest.AdditionalAmountOption.IsSet) + { + writer.WritePropertyName("additionalAmount"); + JsonSerializer.Serialize(writer, balanceCheckRequest.AdditionalAmount, jsonSerializerOptions); + } + if (balanceCheckRequest.AdditionalDataOption.IsSet) + { + writer.WritePropertyName("additionalData"); + JsonSerializer.Serialize(writer, balanceCheckRequest.AdditionalData, jsonSerializerOptions); + } + if (balanceCheckRequest.ApplicationInfoOption.IsSet) + { + writer.WritePropertyName("applicationInfo"); + JsonSerializer.Serialize(writer, balanceCheckRequest.ApplicationInfo, jsonSerializerOptions); + } + if (balanceCheckRequest.BillingAddressOption.IsSet) + { + writer.WritePropertyName("billingAddress"); + JsonSerializer.Serialize(writer, balanceCheckRequest.BillingAddress, jsonSerializerOptions); + } + if (balanceCheckRequest.BrowserInfoOption.IsSet) + { + writer.WritePropertyName("browserInfo"); + JsonSerializer.Serialize(writer, balanceCheckRequest.BrowserInfo, jsonSerializerOptions); + } + if (balanceCheckRequest.CaptureDelayHoursOption.IsSet) + writer.WriteNumber("captureDelayHours", balanceCheckRequest.CaptureDelayHoursOption.Value.Value); - // Store (string) maxLength - if (this.Store != null && this.Store.Length > 16) + if (balanceCheckRequest.DateOfBirthOption.IsSet) + writer.WriteString("dateOfBirth", balanceCheckRequest.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); + + if (balanceCheckRequest.DccQuoteOption.IsSet) + { + writer.WritePropertyName("dccQuote"); + JsonSerializer.Serialize(writer, balanceCheckRequest.DccQuote, jsonSerializerOptions); + } + if (balanceCheckRequest.DeliveryAddressOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be less than 16.", new [] { "Store" }); + writer.WritePropertyName("deliveryAddress"); + JsonSerializer.Serialize(writer, balanceCheckRequest.DeliveryAddress, jsonSerializerOptions); } + if (balanceCheckRequest.DeliveryDateOption.IsSet) + writer.WriteString("deliveryDate", balanceCheckRequest.DeliveryDateOption.Value.Value.ToString(DeliveryDateFormat)); - // Store (string) minLength - if (this.Store != null && this.Store.Length < 1) + if (balanceCheckRequest.DeviceFingerprintOption.IsSet) + writer.WriteString("deviceFingerprint", balanceCheckRequest.DeviceFingerprint); + + if (balanceCheckRequest.FraudOffsetOption.IsSet) + writer.WriteNumber("fraudOffset", balanceCheckRequest.FraudOffsetOption.Value.Value); + + if (balanceCheckRequest.InstallmentsOption.IsSet) + { + writer.WritePropertyName("installments"); + JsonSerializer.Serialize(writer, balanceCheckRequest.Installments, jsonSerializerOptions); + } + if (balanceCheckRequest.LocalizedShopperStatementOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be greater than 1.", new [] { "Store" }); + writer.WritePropertyName("localizedShopperStatement"); + JsonSerializer.Serialize(writer, balanceCheckRequest.LocalizedShopperStatement, jsonSerializerOptions); } + if (balanceCheckRequest.MccOption.IsSet) + writer.WriteString("mcc", balanceCheckRequest.Mcc); - // TotalsGroup (string) maxLength - if (this.TotalsGroup != null && this.TotalsGroup.Length > 16) + if (balanceCheckRequest.MerchantOrderReferenceOption.IsSet) + writer.WriteString("merchantOrderReference", balanceCheckRequest.MerchantOrderReference); + + if (balanceCheckRequest.MerchantRiskIndicatorOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TotalsGroup, length must be less than 16.", new [] { "TotalsGroup" }); + writer.WritePropertyName("merchantRiskIndicator"); + JsonSerializer.Serialize(writer, balanceCheckRequest.MerchantRiskIndicator, jsonSerializerOptions); } + if (balanceCheckRequest.MetadataOption.IsSet) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, balanceCheckRequest.Metadata, jsonSerializerOptions); + } + if (balanceCheckRequest.OrderReferenceOption.IsSet) + writer.WriteString("orderReference", balanceCheckRequest.OrderReference); - // TotalsGroup (string) minLength - if (this.TotalsGroup != null && this.TotalsGroup.Length < 1) + if (balanceCheckRequest.RecurringOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TotalsGroup, length must be greater than 1.", new [] { "TotalsGroup" }); + writer.WritePropertyName("recurring"); + JsonSerializer.Serialize(writer, balanceCheckRequest.Recurring, jsonSerializerOptions); } + var recurringProcessingModelRawValue = BalanceCheckRequest.RecurringProcessingModelEnumToJsonValue(balanceCheckRequest.RecurringProcessingModelOption.Value.Value); + writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); + if (balanceCheckRequest.ReferenceOption.IsSet) + writer.WriteString("reference", balanceCheckRequest.Reference); - yield break; + if (balanceCheckRequest.SelectedBrandOption.IsSet) + writer.WriteString("selectedBrand", balanceCheckRequest.SelectedBrand); + + if (balanceCheckRequest.SelectedRecurringDetailReferenceOption.IsSet) + writer.WriteString("selectedRecurringDetailReference", balanceCheckRequest.SelectedRecurringDetailReference); + + if (balanceCheckRequest.SessionIdOption.IsSet) + writer.WriteString("sessionId", balanceCheckRequest.SessionId); + + if (balanceCheckRequest.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", balanceCheckRequest.ShopperEmail); + + if (balanceCheckRequest.ShopperIPOption.IsSet) + writer.WriteString("shopperIP", balanceCheckRequest.ShopperIP); + + var shopperInteractionRawValue = BalanceCheckRequest.ShopperInteractionEnumToJsonValue(balanceCheckRequest.ShopperInteractionOption.Value.Value); + writer.WriteString("shopperInteraction", shopperInteractionRawValue); + if (balanceCheckRequest.ShopperLocaleOption.IsSet) + writer.WriteString("shopperLocale", balanceCheckRequest.ShopperLocale); + + if (balanceCheckRequest.ShopperNameOption.IsSet) + { + writer.WritePropertyName("shopperName"); + JsonSerializer.Serialize(writer, balanceCheckRequest.ShopperName, jsonSerializerOptions); + } + if (balanceCheckRequest.ShopperReferenceOption.IsSet) + writer.WriteString("shopperReference", balanceCheckRequest.ShopperReference); + + if (balanceCheckRequest.ShopperStatementOption.IsSet) + writer.WriteString("shopperStatement", balanceCheckRequest.ShopperStatement); + + if (balanceCheckRequest.SocialSecurityNumberOption.IsSet) + writer.WriteString("socialSecurityNumber", balanceCheckRequest.SocialSecurityNumber); + + if (balanceCheckRequest.SplitsOption.IsSet) + { + writer.WritePropertyName("splits"); + JsonSerializer.Serialize(writer, balanceCheckRequest.Splits, jsonSerializerOptions); + } + if (balanceCheckRequest.StoreOption.IsSet) + writer.WriteString("store", balanceCheckRequest.Store); + + if (balanceCheckRequest.TelephoneNumberOption.IsSet) + writer.WriteString("telephoneNumber", balanceCheckRequest.TelephoneNumber); + + if (balanceCheckRequest.ThreeDS2RequestDataOption.IsSet) + { + writer.WritePropertyName("threeDS2RequestData"); + JsonSerializer.Serialize(writer, balanceCheckRequest.ThreeDS2RequestData, jsonSerializerOptions); + } + if (balanceCheckRequest.ThreeDSAuthenticationOnlyOption.IsSet) + writer.WriteBoolean("threeDSAuthenticationOnly", balanceCheckRequest.ThreeDSAuthenticationOnlyOption.Value.Value); + + if (balanceCheckRequest.TotalsGroupOption.IsSet) + writer.WriteString("totalsGroup", balanceCheckRequest.TotalsGroup); + + if (balanceCheckRequest.TrustedShopperOption.IsSet) + writer.WriteBoolean("trustedShopper", balanceCheckRequest.TrustedShopperOption.Value.Value); } } - } diff --git a/Adyen/Model/Checkout/BalanceCheckResponse.cs b/Adyen/Model/Checkout/BalanceCheckResponse.cs index e6f833b19..8bf2091ca 100644 --- a/Adyen/Model/Checkout/BalanceCheckResponse.cs +++ b/Adyen/Model/Checkout/BalanceCheckResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,121 +14,206 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// BalanceCheckResponse /// - [DataContract(Name = "BalanceCheckResponse")] - public partial class BalanceCheckResponse : IEquatable, IValidatableObject + public partial class BalanceCheckResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// balance + /// The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. + /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + /// fraudResult + /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + /// transactionLimit + [JsonConstructor] + public BalanceCheckResponse(Amount balance, ResultCodeEnum resultCode, Option> additionalData = default, Option fraudResult = default, Option pspReference = default, Option refusalReason = default, Option transactionLimit = default) + { + Balance = balance; + ResultCode = resultCode; + AdditionalDataOption = additionalData; + FraudResultOption = fraudResult; + PspReferenceOption = pspReference; + RefusalReasonOption = refusalReason; + TransactionLimitOption = transactionLimit; + OnCreated(); + } + + partial void OnCreated(); + /// /// The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. /// /// The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. - [JsonConverter(typeof(StringEnumConverter))] public enum ResultCodeEnum { /// /// Enum Success for value: Success /// - [EnumMember(Value = "Success")] Success = 1, /// /// Enum NotEnoughBalance for value: NotEnoughBalance /// - [EnumMember(Value = "NotEnoughBalance")] NotEnoughBalance = 2, /// /// Enum Failed for value: Failed /// - [EnumMember(Value = "Failed")] Failed = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ResultCodeEnum ResultCodeEnumFromString(string value) + { + if (value.Equals("Success")) + return ResultCodeEnum.Success; + + if (value.Equals("NotEnoughBalance")) + return ResultCodeEnum.NotEnoughBalance; + + if (value.Equals("Failed")) + return ResultCodeEnum.Failed; + + throw new NotImplementedException($"Could not convert value to type ResultCodeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ResultCodeEnum? ResultCodeEnumFromStringOrDefault(string value) + { + if (value.Equals("Success")) + return ResultCodeEnum.Success; + + if (value.Equals("NotEnoughBalance")) + return ResultCodeEnum.NotEnoughBalance; + if (value.Equals("Failed")) + return ResultCodeEnum.Failed; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ResultCodeEnumToJsonValue(ResultCodeEnum value) + { + if (value == ResultCodeEnum.Success) + return "Success"; + + if (value == ResultCodeEnum.NotEnoughBalance) + return "NotEnoughBalance"; + + if (value == ResultCodeEnum.Failed) + return "Failed"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. /// /// The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. - [DataMember(Name = "resultCode", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("resultCode")] public ResultCodeEnum ResultCode { get; set; } + /// - /// Initializes a new instance of the class. + /// Gets or Sets Balance /// - [JsonConstructorAttribute] - protected BalanceCheckResponse() { } + [JsonPropertyName("balance")] + public Amount Balance { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of AdditionalData /// - /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**.. - /// balance (required). - /// fraudResult. - /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request.. - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. - /// The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. (required). - /// transactionLimit. - public BalanceCheckResponse(Dictionary additionalData = default(Dictionary), Amount balance = default(Amount), FraudResult fraudResult = default(FraudResult), string pspReference = default(string), string refusalReason = default(string), ResultCodeEnum resultCode = default(ResultCodeEnum), Amount transactionLimit = default(Amount)) - { - this.Balance = balance; - this.ResultCode = resultCode; - this.AdditionalData = additionalData; - this.FraudResult = fraudResult; - this.PspReference = pspReference; - this.RefusalReason = refusalReason; - this.TransactionLimit = transactionLimit; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AdditionalDataOption { get; private set; } /// /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. /// /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - [DataMember(Name = "additionalData", EmitDefaultValue = false)] - public Dictionary AdditionalData { get; set; } + [JsonPropertyName("additionalData")] + public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } /// - /// Gets or Sets Balance + /// Used to track the state of FraudResult /// - [DataMember(Name = "balance", IsRequired = false, EmitDefaultValue = false)] - public Amount Balance { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FraudResultOption { get; private set; } /// /// Gets or Sets FraudResult /// - [DataMember(Name = "fraudResult", EmitDefaultValue = false)] - public FraudResult FraudResult { get; set; } + [JsonPropertyName("fraudResult")] + public FraudResult FraudResult { get { return this.FraudResultOption; } set { this.FraudResultOption = new Option(value); } } + + /// + /// Used to track the state of PspReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PspReferenceOption { get; private set; } /// /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. /// /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - [DataMember(Name = "pspReference", EmitDefaultValue = false)] - public string PspReference { get; set; } + [JsonPropertyName("pspReference")] + public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } + + /// + /// Used to track the state of RefusalReason + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RefusalReasonOption { get; private set; } /// /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). /// /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [DataMember(Name = "refusalReason", EmitDefaultValue = false)] - public string RefusalReason { get; set; } + [JsonPropertyName("refusalReason")] + public string RefusalReason { get { return this.RefusalReasonOption; } set { this.RefusalReasonOption = new Option(value); } } + + /// + /// Used to track the state of TransactionLimit + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TransactionLimitOption { get; private set; } /// /// Gets or Sets TransactionLimit /// - [DataMember(Name = "transactionLimit", EmitDefaultValue = false)] - public Amount TransactionLimit { get; set; } + [JsonPropertyName("transactionLimit")] + public Amount TransactionLimit { get { return this.TransactionLimitOption; } set { this.TransactionLimitOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -139,131 +223,203 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class BalanceCheckResponse {\n"); - sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); sb.Append(" Balance: ").Append(Balance).Append("\n"); + sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); + sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); sb.Append(" FraudResult: ").Append(FraudResult).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); sb.Append(" RefusalReason: ").Append(RefusalReason).Append("\n"); - sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); sb.Append(" TransactionLimit: ").Append(TransactionLimit).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class BalanceCheckResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override BalanceCheckResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as BalanceCheckResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if BalanceCheckResponse instances are equal - /// - /// Instance of BalanceCheckResponse to be compared - /// Boolean - public bool Equals(BalanceCheckResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option balance = default; + Option resultCode = default; + Option> additionalData = default; + Option fraudResult = default; + Option pspReference = default; + Option refusalReason = default; + Option transactionLimit = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "balance": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + balance = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "resultCode": + string resultCodeRawValue = utf8JsonReader.GetString(); + if (resultCodeRawValue != null) + resultCode = new Option(BalanceCheckResponse.ResultCodeEnumFromStringOrDefault(resultCodeRawValue)); + break; + case "additionalData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fraudResult": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fraudResult = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "refusalReason": + refusalReason = new Option(utf8JsonReader.GetString()); + break; + case "transactionLimit": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + transactionLimit = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.AdditionalData == input.AdditionalData || - this.AdditionalData != null && - input.AdditionalData != null && - this.AdditionalData.SequenceEqual(input.AdditionalData) - ) && - ( - this.Balance == input.Balance || - (this.Balance != null && - this.Balance.Equals(input.Balance)) - ) && - ( - this.FraudResult == input.FraudResult || - (this.FraudResult != null && - this.FraudResult.Equals(input.FraudResult)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.RefusalReason == input.RefusalReason || - (this.RefusalReason != null && - this.RefusalReason.Equals(input.RefusalReason)) - ) && - ( - this.ResultCode == input.ResultCode || - this.ResultCode.Equals(input.ResultCode) - ) && - ( - this.TransactionLimit == input.TransactionLimit || - (this.TransactionLimit != null && - this.TransactionLimit.Equals(input.TransactionLimit)) - ); + + if (!balance.IsSet) + throw new ArgumentException("Property is required for class BalanceCheckResponse.", nameof(balance)); + + if (!resultCode.IsSet) + throw new ArgumentException("Property is required for class BalanceCheckResponse.", nameof(resultCode)); + + if (balance.IsSet && balance.Value == null) + throw new ArgumentNullException(nameof(balance), "Property is not nullable for class BalanceCheckResponse."); + + if (resultCode.IsSet && resultCode.Value == null) + throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class BalanceCheckResponse."); + + if (additionalData.IsSet && additionalData.Value == null) + throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class BalanceCheckResponse."); + + if (fraudResult.IsSet && fraudResult.Value == null) + throw new ArgumentNullException(nameof(fraudResult), "Property is not nullable for class BalanceCheckResponse."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class BalanceCheckResponse."); + + if (refusalReason.IsSet && refusalReason.Value == null) + throw new ArgumentNullException(nameof(refusalReason), "Property is not nullable for class BalanceCheckResponse."); + + if (transactionLimit.IsSet && transactionLimit.Value == null) + throw new ArgumentNullException(nameof(transactionLimit), "Property is not nullable for class BalanceCheckResponse."); + + return new BalanceCheckResponse(balance.Value, resultCode.Value.Value, additionalData, fraudResult, pspReference, refusalReason, transactionLimit); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BalanceCheckResponse balanceCheckResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AdditionalData != null) - { - hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); - } - if (this.Balance != null) - { - hashCode = (hashCode * 59) + this.Balance.GetHashCode(); - } - if (this.FraudResult != null) - { - hashCode = (hashCode * 59) + this.FraudResult.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - if (this.RefusalReason != null) - { - hashCode = (hashCode * 59) + this.RefusalReason.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ResultCode.GetHashCode(); - if (this.TransactionLimit != null) - { - hashCode = (hashCode * 59) + this.TransactionLimit.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, balanceCheckResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, BalanceCheckResponse balanceCheckResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (balanceCheckResponse.Balance == null) + throw new ArgumentNullException(nameof(balanceCheckResponse.Balance), "Property is required for class BalanceCheckResponse."); + + if (balanceCheckResponse.AdditionalDataOption.IsSet && balanceCheckResponse.AdditionalData == null) + throw new ArgumentNullException(nameof(balanceCheckResponse.AdditionalData), "Property is required for class BalanceCheckResponse."); + + if (balanceCheckResponse.FraudResultOption.IsSet && balanceCheckResponse.FraudResult == null) + throw new ArgumentNullException(nameof(balanceCheckResponse.FraudResult), "Property is required for class BalanceCheckResponse."); + + if (balanceCheckResponse.PspReferenceOption.IsSet && balanceCheckResponse.PspReference == null) + throw new ArgumentNullException(nameof(balanceCheckResponse.PspReference), "Property is required for class BalanceCheckResponse."); + + if (balanceCheckResponse.RefusalReasonOption.IsSet && balanceCheckResponse.RefusalReason == null) + throw new ArgumentNullException(nameof(balanceCheckResponse.RefusalReason), "Property is required for class BalanceCheckResponse."); + + if (balanceCheckResponse.TransactionLimitOption.IsSet && balanceCheckResponse.TransactionLimit == null) + throw new ArgumentNullException(nameof(balanceCheckResponse.TransactionLimit), "Property is required for class BalanceCheckResponse."); + + writer.WritePropertyName("balance"); + JsonSerializer.Serialize(writer, balanceCheckResponse.Balance, jsonSerializerOptions); + var resultCodeRawValue = BalanceCheckResponse.ResultCodeEnumToJsonValue(balanceCheckResponse.ResultCode); + writer.WriteString("resultCode", resultCodeRawValue); + if (balanceCheckResponse.AdditionalDataOption.IsSet) + { + writer.WritePropertyName("additionalData"); + JsonSerializer.Serialize(writer, balanceCheckResponse.AdditionalData, jsonSerializerOptions); + } + if (balanceCheckResponse.FraudResultOption.IsSet) + { + writer.WritePropertyName("fraudResult"); + JsonSerializer.Serialize(writer, balanceCheckResponse.FraudResult, jsonSerializerOptions); + } + if (balanceCheckResponse.PspReferenceOption.IsSet) + writer.WriteString("pspReference", balanceCheckResponse.PspReference); + + if (balanceCheckResponse.RefusalReasonOption.IsSet) + writer.WriteString("refusalReason", balanceCheckResponse.RefusalReason); + + if (balanceCheckResponse.TransactionLimitOption.IsSet) + { + writer.WritePropertyName("transactionLimit"); + JsonSerializer.Serialize(writer, balanceCheckResponse.TransactionLimit, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/BillDeskDetails.cs b/Adyen/Model/Checkout/BillDeskDetails.cs index ef006b764..5b59613f8 100644 --- a/Adyen/Model/Checkout/BillDeskDetails.cs +++ b/Adyen/Model/Checkout/BillDeskDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,83 +14,132 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// BillDeskDetails /// - [DataContract(Name = "BillDeskDetails")] - public partial class BillDeskDetails : IEquatable, IValidatableObject + public partial class BillDeskDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The issuer id of the shopper's selected bank. + /// **billdesk** + /// The checkout attempt identifier. + [JsonConstructor] + public BillDeskDetails(string issuer, TypeEnum type, Option checkoutAttemptId = default) + { + Issuer = issuer; + Type = type; + CheckoutAttemptIdOption = checkoutAttemptId; + OnCreated(); + } + + partial void OnCreated(); + /// /// **billdesk** /// /// **billdesk** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// - /// Enum Online for value: billdesk_online + /// Enum BilldeskOnline for value: billdesk_online /// - [EnumMember(Value = "billdesk_online")] - Online = 1, + BilldeskOnline = 1, /// - /// Enum Wallet for value: billdesk_wallet + /// Enum BilldeskWallet for value: billdesk_wallet /// - [EnumMember(Value = "billdesk_wallet")] - Wallet = 2 - + BilldeskWallet = 2 } - /// - /// **billdesk** + /// Returns a /// - /// **billdesk** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public TypeEnum Type { get; set; } + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("billdesk_online")) + return TypeEnum.BilldeskOnline; + + if (value.Equals("billdesk_wallet")) + return TypeEnum.BilldeskWallet; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected BillDeskDetails() { } + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("billdesk_online")) + return TypeEnum.BilldeskOnline; + + if (value.Equals("billdesk_wallet")) + return TypeEnum.BilldeskWallet; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The checkout attempt identifier.. - /// The issuer id of the shopper's selected bank. (required). - /// **billdesk** (required). - public BillDeskDetails(string checkoutAttemptId = default(string), string issuer = default(string), TypeEnum type = default(TypeEnum)) + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) { - this.Issuer = issuer; - this.Type = type; - this.CheckoutAttemptId = checkoutAttemptId; + if (value == TypeEnum.BilldeskOnline) + return "billdesk_online"; + + if (value == TypeEnum.BilldeskWallet) + return "billdesk_wallet"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// The checkout attempt identifier. + /// **billdesk** /// - /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + /// **billdesk** + [JsonPropertyName("type")] + public TypeEnum Type { get; set; } /// /// The issuer id of the shopper's selected bank. /// /// The issuer id of the shopper's selected bank. - [DataMember(Name = "issuer", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("issuer")] public string Issuer { get; set; } + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } + + /// + /// The checkout attempt identifier. + /// + /// The checkout attempt identifier. + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -100,90 +148,136 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class BillDeskDetails {\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" Issuer: ").Append(Issuer).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class BillDeskDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override BillDeskDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as BillDeskDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if BillDeskDetails instances are equal - /// - /// Instance of BillDeskDetails to be compared - /// Boolean - public bool Equals(BillDeskDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option issuer = default; + Option type = default; + Option checkoutAttemptId = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "issuer": + issuer = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(BillDeskDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Issuer == input.Issuer || - (this.Issuer != null && - this.Issuer.Equals(input.Issuer)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!issuer.IsSet) + throw new ArgumentException("Property is required for class BillDeskDetails.", nameof(issuer)); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class BillDeskDetails.", nameof(type)); + + if (issuer.IsSet && issuer.Value == null) + throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class BillDeskDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class BillDeskDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class BillDeskDetails."); + + return new BillDeskDetails(issuer.Value, type.Value.Value, checkoutAttemptId); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BillDeskDetails billDeskDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.Issuer != null) - { - hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, billDeskDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, BillDeskDetails billDeskDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (billDeskDetails.Issuer == null) + throw new ArgumentNullException(nameof(billDeskDetails.Issuer), "Property is required for class BillDeskDetails."); + + if (billDeskDetails.CheckoutAttemptIdOption.IsSet && billDeskDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(billDeskDetails.CheckoutAttemptId), "Property is required for class BillDeskDetails."); + + writer.WriteString("issuer", billDeskDetails.Issuer); + + var typeRawValue = BillDeskDetails.TypeEnumToJsonValue(billDeskDetails.Type); + writer.WriteString("type", typeRawValue); + if (billDeskDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", billDeskDetails.CheckoutAttemptId); } } - } diff --git a/Adyen/Model/Checkout/BillingAddress.cs b/Adyen/Model/Checkout/BillingAddress.cs index 4b1e4119e..dfd873f10 100644 --- a/Adyen/Model/Checkout/BillingAddress.cs +++ b/Adyen/Model/Checkout/BillingAddress.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,89 +14,92 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// BillingAddress /// - [DataContract(Name = "BillingAddress")] - public partial class BillingAddress : IEquatable, IValidatableObject + public partial class BillingAddress : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected BillingAddress() { } - /// - /// Initializes a new instance of the class. - /// - /// The name of the city. Maximum length: 3000 characters. (required). - /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. (required). - /// The number or name of the house. Maximum length: 3000 characters. (required). - /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. (required). - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada.. - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. (required). - public BillingAddress(string city = default(string), string country = default(string), string houseNumberOrName = default(string), string postalCode = default(string), string stateOrProvince = default(string), string street = default(string)) + /// The name of the city. Maximum length: 3000 characters. + /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + /// The number or name of the house. Maximum length: 3000 characters. + /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + [JsonConstructor] + public BillingAddress(string city, string country, string houseNumberOrName, string postalCode, string street, Option stateOrProvince = default) { - this.City = city; - this.Country = country; - this.HouseNumberOrName = houseNumberOrName; - this.PostalCode = postalCode; - this.Street = street; - this.StateOrProvince = stateOrProvince; + City = city; + Country = country; + HouseNumberOrName = houseNumberOrName; + PostalCode = postalCode; + Street = street; + StateOrProvinceOption = stateOrProvince; + OnCreated(); } + partial void OnCreated(); + /// /// The name of the city. Maximum length: 3000 characters. /// /// The name of the city. Maximum length: 3000 characters. - [DataMember(Name = "city", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("city")] public string City { get; set; } /// /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. /// /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. - [DataMember(Name = "country", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("country")] public string Country { get; set; } /// /// The number or name of the house. Maximum length: 3000 characters. /// /// The number or name of the house. Maximum length: 3000 characters. - [DataMember(Name = "houseNumberOrName", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("houseNumberOrName")] public string HouseNumberOrName { get; set; } /// /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. /// /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. - [DataMember(Name = "postalCode", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("postalCode")] public string PostalCode { get; set; } - /// - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. - /// - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. - [DataMember(Name = "stateOrProvince", EmitDefaultValue = false)] - public string StateOrProvince { get; set; } - /// /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. /// /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. - [DataMember(Name = "street", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("street")] public string Street { get; set; } + /// + /// Used to track the state of StateOrProvince + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StateOrProvinceOption { get; private set; } + + /// + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + /// + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + [JsonPropertyName("stateOrProvince")] + public string StateOrProvince { get { return this.StateOrProvinceOption; } set { this.StateOrProvinceOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -110,144 +112,205 @@ public override string ToString() sb.Append(" Country: ").Append(Country).Append("\n"); sb.Append(" HouseNumberOrName: ").Append(HouseNumberOrName).Append("\n"); sb.Append(" PostalCode: ").Append(PostalCode).Append("\n"); - sb.Append(" StateOrProvince: ").Append(StateOrProvince).Append("\n"); sb.Append(" Street: ").Append(Street).Append("\n"); + sb.Append(" StateOrProvince: ").Append(StateOrProvince).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as BillingAddress); - } - - /// - /// Returns true if BillingAddress instances are equal - /// - /// Instance of BillingAddress to be compared - /// Boolean - public bool Equals(BillingAddress input) - { - if (input == null) - { - return false; - } - return - ( - this.City == input.City || - (this.City != null && - this.City.Equals(input.City)) - ) && - ( - this.Country == input.Country || - (this.Country != null && - this.Country.Equals(input.Country)) - ) && - ( - this.HouseNumberOrName == input.HouseNumberOrName || - (this.HouseNumberOrName != null && - this.HouseNumberOrName.Equals(input.HouseNumberOrName)) - ) && - ( - this.PostalCode == input.PostalCode || - (this.PostalCode != null && - this.PostalCode.Equals(input.PostalCode)) - ) && - ( - this.StateOrProvince == input.StateOrProvince || - (this.StateOrProvince != null && - this.StateOrProvince.Equals(input.StateOrProvince)) - ) && - ( - this.Street == input.Street || - (this.Street != null && - this.Street.Equals(input.Street)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.City != null) - { - hashCode = (hashCode * 59) + this.City.GetHashCode(); - } - if (this.Country != null) - { - hashCode = (hashCode * 59) + this.Country.GetHashCode(); - } - if (this.HouseNumberOrName != null) - { - hashCode = (hashCode * 59) + this.HouseNumberOrName.GetHashCode(); - } - if (this.PostalCode != null) - { - hashCode = (hashCode * 59) + this.PostalCode.GetHashCode(); - } - if (this.StateOrProvince != null) - { - hashCode = (hashCode * 59) + this.StateOrProvince.GetHashCode(); - } - if (this.Street != null) - { - hashCode = (hashCode * 59) + this.Street.GetHashCode(); - } - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // City (string) maxLength if (this.City != null && this.City.Length > 3000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for City, length must be less than 3000.", new [] { "City" }); + yield return new ValidationResult("Invalid value for City, length must be less than 3000.", new [] { "City" }); } // HouseNumberOrName (string) maxLength if (this.HouseNumberOrName != null && this.HouseNumberOrName.Length > 3000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for HouseNumberOrName, length must be less than 3000.", new [] { "HouseNumberOrName" }); + yield return new ValidationResult("Invalid value for HouseNumberOrName, length must be less than 3000.", new [] { "HouseNumberOrName" }); } - // StateOrProvince (string) maxLength - if (this.StateOrProvince != null && this.StateOrProvince.Length > 1000) + // Street (string) maxLength + if (this.Street != null && this.Street.Length > 3000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StateOrProvince, length must be less than 1000.", new [] { "StateOrProvince" }); + yield return new ValidationResult("Invalid value for Street, length must be less than 3000.", new [] { "Street" }); } - // Street (string) maxLength - if (this.Street != null && this.Street.Length > 3000) + // StateOrProvince (string) maxLength + if (this.StateOrProvince != null && this.StateOrProvince.Length > 1000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Street, length must be less than 3000.", new [] { "Street" }); + yield return new ValidationResult("Invalid value for StateOrProvince, length must be less than 1000.", new [] { "StateOrProvince" }); } yield break; } } + /// + /// A Json converter for type + /// + public class BillingAddressJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override BillingAddress Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option city = default; + Option country = default; + Option houseNumberOrName = default; + Option postalCode = default; + Option street = default; + Option stateOrProvince = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "city": + city = new Option(utf8JsonReader.GetString()); + break; + case "country": + country = new Option(utf8JsonReader.GetString()); + break; + case "houseNumberOrName": + houseNumberOrName = new Option(utf8JsonReader.GetString()); + break; + case "postalCode": + postalCode = new Option(utf8JsonReader.GetString()); + break; + case "street": + street = new Option(utf8JsonReader.GetString()); + break; + case "stateOrProvince": + stateOrProvince = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!city.IsSet) + throw new ArgumentException("Property is required for class BillingAddress.", nameof(city)); + + if (!country.IsSet) + throw new ArgumentException("Property is required for class BillingAddress.", nameof(country)); + + if (!houseNumberOrName.IsSet) + throw new ArgumentException("Property is required for class BillingAddress.", nameof(houseNumberOrName)); + + if (!postalCode.IsSet) + throw new ArgumentException("Property is required for class BillingAddress.", nameof(postalCode)); + + if (!street.IsSet) + throw new ArgumentException("Property is required for class BillingAddress.", nameof(street)); + + if (city.IsSet && city.Value == null) + throw new ArgumentNullException(nameof(city), "Property is not nullable for class BillingAddress."); + + if (country.IsSet && country.Value == null) + throw new ArgumentNullException(nameof(country), "Property is not nullable for class BillingAddress."); + + if (houseNumberOrName.IsSet && houseNumberOrName.Value == null) + throw new ArgumentNullException(nameof(houseNumberOrName), "Property is not nullable for class BillingAddress."); + + if (postalCode.IsSet && postalCode.Value == null) + throw new ArgumentNullException(nameof(postalCode), "Property is not nullable for class BillingAddress."); + + if (street.IsSet && street.Value == null) + throw new ArgumentNullException(nameof(street), "Property is not nullable for class BillingAddress."); + + if (stateOrProvince.IsSet && stateOrProvince.Value == null) + throw new ArgumentNullException(nameof(stateOrProvince), "Property is not nullable for class BillingAddress."); + + return new BillingAddress(city.Value, country.Value, houseNumberOrName.Value, postalCode.Value, street.Value, stateOrProvince); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BillingAddress billingAddress, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, billingAddress, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, BillingAddress billingAddress, JsonSerializerOptions jsonSerializerOptions) + { + if (billingAddress.City == null) + throw new ArgumentNullException(nameof(billingAddress.City), "Property is required for class BillingAddress."); + + if (billingAddress.Country == null) + throw new ArgumentNullException(nameof(billingAddress.Country), "Property is required for class BillingAddress."); + + if (billingAddress.HouseNumberOrName == null) + throw new ArgumentNullException(nameof(billingAddress.HouseNumberOrName), "Property is required for class BillingAddress."); + + if (billingAddress.PostalCode == null) + throw new ArgumentNullException(nameof(billingAddress.PostalCode), "Property is required for class BillingAddress."); + + if (billingAddress.Street == null) + throw new ArgumentNullException(nameof(billingAddress.Street), "Property is required for class BillingAddress."); + + if (billingAddress.StateOrProvinceOption.IsSet && billingAddress.StateOrProvince == null) + throw new ArgumentNullException(nameof(billingAddress.StateOrProvince), "Property is required for class BillingAddress."); + + writer.WriteString("city", billingAddress.City); + + writer.WriteString("country", billingAddress.Country); + + writer.WriteString("houseNumberOrName", billingAddress.HouseNumberOrName); + + writer.WriteString("postalCode", billingAddress.PostalCode); + + writer.WriteString("street", billingAddress.Street); + + if (billingAddress.StateOrProvinceOption.IsSet) + writer.WriteString("stateOrProvince", billingAddress.StateOrProvince); + } + } } diff --git a/Adyen/Model/Checkout/BlikDetails.cs b/Adyen/Model/Checkout/BlikDetails.cs index 0a5cd33cf..be80ed5ad 100644 --- a/Adyen/Model/Checkout/BlikDetails.cs +++ b/Adyen/Model/Checkout/BlikDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,90 +14,164 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// BlikDetails /// - [DataContract(Name = "BlikDetails")] - public partial class BlikDetails : IEquatable, IValidatableObject + public partial class BlikDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// BLIK code consisting of 6 digits. + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **blik** + [JsonConstructor] + public BlikDetails(Option blikCode = default, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + BlikCodeOption = blikCode; + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **blik** /// /// **blik** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Blik for value: blik /// - [EnumMember(Value = "blik")] Blik = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("blik")) + return TypeEnum.Blik; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("blik")) + return TypeEnum.Blik; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Blik) + return "blik"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **blik** /// /// **blik** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of BlikCode /// - /// BLIK code consisting of 6 digits.. - /// The checkout attempt identifier.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **blik**. - public BlikDetails(string blikCode = default(string), string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = default(TypeEnum?)) - { - this.BlikCode = blikCode; - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BlikCodeOption { get; private set; } /// /// BLIK code consisting of 6 digits. /// /// BLIK code consisting of 6 digits. - [DataMember(Name = "blikCode", EmitDefaultValue = false)] - public string BlikCode { get; set; } + [JsonPropertyName("blikCode")] + public string BlikCode { get { return this.BlikCodeOption; } set { this.BlikCodeOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -118,106 +191,156 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as BlikDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class BlikDetailsJsonConverter : JsonConverter + { /// - /// Returns true if BlikDetails instances are equal + /// Deserializes json to /// - /// Instance of BlikDetails to be compared - /// Boolean - public bool Equals(BlikDetails input) + /// + /// + /// + /// + /// + public override BlikDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option blikCode = default; + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "blikCode": + blikCode = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(BlikDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.BlikCode == input.BlikCode || - (this.BlikCode != null && - this.BlikCode.Equals(input.BlikCode)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (blikCode.IsSet && blikCode.Value == null) + throw new ArgumentNullException(nameof(blikCode), "Property is not nullable for class BlikDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class BlikDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class BlikDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class BlikDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class BlikDetails."); + + return new BlikDetails(blikCode, checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BlikDetails blikDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BlikCode != null) - { - hashCode = (hashCode * 59) + this.BlikCode.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, blikDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, BlikDetails blikDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (blikDetails.BlikCodeOption.IsSet && blikDetails.BlikCode == null) + throw new ArgumentNullException(nameof(blikDetails.BlikCode), "Property is required for class BlikDetails."); - yield break; + if (blikDetails.CheckoutAttemptIdOption.IsSet && blikDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(blikDetails.CheckoutAttemptId), "Property is required for class BlikDetails."); + + if (blikDetails.RecurringDetailReferenceOption.IsSet && blikDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(blikDetails.RecurringDetailReference), "Property is required for class BlikDetails."); + + if (blikDetails.StoredPaymentMethodIdOption.IsSet && blikDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(blikDetails.StoredPaymentMethodId), "Property is required for class BlikDetails."); + + if (blikDetails.BlikCodeOption.IsSet) + writer.WriteString("blikCode", blikDetails.BlikCode); + + if (blikDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", blikDetails.CheckoutAttemptId); + + if (blikDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", blikDetails.RecurringDetailReference); + + if (blikDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", blikDetails.StoredPaymentMethodId); + + var typeRawValue = BlikDetails.TypeEnumToJsonValue(blikDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/BrowserInfo.cs b/Adyen/Model/Checkout/BrowserInfo.cs index 7f6560ead..5779e58be 100644 --- a/Adyen/Model/Checkout/BrowserInfo.cs +++ b/Adyen/Model/Checkout/BrowserInfo.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,116 +14,119 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// BrowserInfo /// - [DataContract(Name = "BrowserInfo")] - public partial class BrowserInfo : IEquatable, IValidatableObject + public partial class BrowserInfo : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected BrowserInfo() { } - /// - /// Initializes a new instance of the class. - /// - /// The accept header value of the shopper's browser. (required). - /// The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. (required). - /// Boolean value indicating if the shopper's browser is able to execute Java. (required). - /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. (default to true). - /// The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). (required). - /// The total height of the shopper's device screen in pixels. (required). - /// The total width of the shopper's device screen in pixels. (required). - /// Time difference between UTC time and the shopper's browser local time, in minutes. (required). - /// The user agent value of the shopper's browser. (required). - public BrowserInfo(string acceptHeader = default(string), int? colorDepth = default(int?), bool? javaEnabled = default(bool?), bool? javaScriptEnabled = true, string language = default(string), int? screenHeight = default(int?), int? screenWidth = default(int?), int? timeZoneOffset = default(int?), string userAgent = default(string)) + /// The accept header value of the shopper's browser. + /// The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. + /// Boolean value indicating if the shopper's browser is able to execute Java. + /// The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). + /// The total height of the shopper's device screen in pixels. + /// The total width of the shopper's device screen in pixels. + /// Time difference between UTC time and the shopper's browser local time, in minutes. + /// The user agent value of the shopper's browser. + /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. (default to true) + [JsonConstructor] + public BrowserInfo(string acceptHeader, int colorDepth, bool javaEnabled, string language, int screenHeight, int screenWidth, int timeZoneOffset, string userAgent, Option javaScriptEnabled = default) { - this.AcceptHeader = acceptHeader; - this.ColorDepth = colorDepth; - this.JavaEnabled = javaEnabled; - this.Language = language; - this.ScreenHeight = screenHeight; - this.ScreenWidth = screenWidth; - this.TimeZoneOffset = timeZoneOffset; - this.UserAgent = userAgent; - this.JavaScriptEnabled = javaScriptEnabled; + AcceptHeader = acceptHeader; + ColorDepth = colorDepth; + JavaEnabled = javaEnabled; + Language = language; + ScreenHeight = screenHeight; + ScreenWidth = screenWidth; + TimeZoneOffset = timeZoneOffset; + UserAgent = userAgent; + JavaScriptEnabledOption = javaScriptEnabled; + OnCreated(); } + partial void OnCreated(); + /// /// The accept header value of the shopper's browser. /// /// The accept header value of the shopper's browser. - [DataMember(Name = "acceptHeader", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("acceptHeader")] public string AcceptHeader { get; set; } /// /// The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. /// /// The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. - [DataMember(Name = "colorDepth", IsRequired = false, EmitDefaultValue = false)] - public int? ColorDepth { get; set; } + [JsonPropertyName("colorDepth")] + public int ColorDepth { get; set; } /// /// Boolean value indicating if the shopper's browser is able to execute Java. /// /// Boolean value indicating if the shopper's browser is able to execute Java. - [DataMember(Name = "javaEnabled", IsRequired = false, EmitDefaultValue = false)] - public bool? JavaEnabled { get; set; } - - /// - /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. - /// - /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. - [DataMember(Name = "javaScriptEnabled", EmitDefaultValue = false)] - public bool? JavaScriptEnabled { get; set; } + [JsonPropertyName("javaEnabled")] + public bool JavaEnabled { get; set; } /// /// The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). /// /// The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). - [DataMember(Name = "language", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("language")] public string Language { get; set; } /// /// The total height of the shopper's device screen in pixels. /// /// The total height of the shopper's device screen in pixels. - [DataMember(Name = "screenHeight", IsRequired = false, EmitDefaultValue = false)] - public int? ScreenHeight { get; set; } + [JsonPropertyName("screenHeight")] + public int ScreenHeight { get; set; } /// /// The total width of the shopper's device screen in pixels. /// /// The total width of the shopper's device screen in pixels. - [DataMember(Name = "screenWidth", IsRequired = false, EmitDefaultValue = false)] - public int? ScreenWidth { get; set; } + [JsonPropertyName("screenWidth")] + public int ScreenWidth { get; set; } /// /// Time difference between UTC time and the shopper's browser local time, in minutes. /// /// Time difference between UTC time and the shopper's browser local time, in minutes. - [DataMember(Name = "timeZoneOffset", IsRequired = false, EmitDefaultValue = false)] - public int? TimeZoneOffset { get; set; } + [JsonPropertyName("timeZoneOffset")] + public int TimeZoneOffset { get; set; } /// /// The user agent value of the shopper's browser. /// /// The user agent value of the shopper's browser. - [DataMember(Name = "userAgent", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("userAgent")] public string UserAgent { get; set; } + /// + /// Used to track the state of JavaScriptEnabled + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option JavaScriptEnabledOption { get; private set; } + + /// + /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. + /// + /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. + [JsonPropertyName("javaScriptEnabled")] + public bool? JavaScriptEnabled { get { return this.JavaScriptEnabledOption; } set { this.JavaScriptEnabledOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -136,127 +138,218 @@ public override string ToString() sb.Append(" AcceptHeader: ").Append(AcceptHeader).Append("\n"); sb.Append(" ColorDepth: ").Append(ColorDepth).Append("\n"); sb.Append(" JavaEnabled: ").Append(JavaEnabled).Append("\n"); - sb.Append(" JavaScriptEnabled: ").Append(JavaScriptEnabled).Append("\n"); sb.Append(" Language: ").Append(Language).Append("\n"); sb.Append(" ScreenHeight: ").Append(ScreenHeight).Append("\n"); sb.Append(" ScreenWidth: ").Append(ScreenWidth).Append("\n"); sb.Append(" TimeZoneOffset: ").Append(TimeZoneOffset).Append("\n"); sb.Append(" UserAgent: ").Append(UserAgent).Append("\n"); + sb.Append(" JavaScriptEnabled: ").Append(JavaScriptEnabled).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class BrowserInfoJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override BrowserInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as BrowserInfo); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if BrowserInfo instances are equal - /// - /// Instance of BrowserInfo to be compared - /// Boolean - public bool Equals(BrowserInfo input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option acceptHeader = default; + Option colorDepth = default; + Option javaEnabled = default; + Option language = default; + Option screenHeight = default; + Option screenWidth = default; + Option timeZoneOffset = default; + Option userAgent = default; + Option javaScriptEnabled = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "acceptHeader": + acceptHeader = new Option(utf8JsonReader.GetString()); + break; + case "colorDepth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + colorDepth = new Option(utf8JsonReader.GetInt32()); + break; + case "javaEnabled": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + javaEnabled = new Option(utf8JsonReader.GetBoolean()); + break; + case "language": + language = new Option(utf8JsonReader.GetString()); + break; + case "screenHeight": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + screenHeight = new Option(utf8JsonReader.GetInt32()); + break; + case "screenWidth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + screenWidth = new Option(utf8JsonReader.GetInt32()); + break; + case "timeZoneOffset": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + timeZoneOffset = new Option(utf8JsonReader.GetInt32()); + break; + case "userAgent": + userAgent = new Option(utf8JsonReader.GetString()); + break; + case "javaScriptEnabled": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + javaScriptEnabled = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } } - return - ( - this.AcceptHeader == input.AcceptHeader || - (this.AcceptHeader != null && - this.AcceptHeader.Equals(input.AcceptHeader)) - ) && - ( - this.ColorDepth == input.ColorDepth || - this.ColorDepth.Equals(input.ColorDepth) - ) && - ( - this.JavaEnabled == input.JavaEnabled || - this.JavaEnabled.Equals(input.JavaEnabled) - ) && - ( - this.JavaScriptEnabled == input.JavaScriptEnabled || - this.JavaScriptEnabled.Equals(input.JavaScriptEnabled) - ) && - ( - this.Language == input.Language || - (this.Language != null && - this.Language.Equals(input.Language)) - ) && - ( - this.ScreenHeight == input.ScreenHeight || - this.ScreenHeight.Equals(input.ScreenHeight) - ) && - ( - this.ScreenWidth == input.ScreenWidth || - this.ScreenWidth.Equals(input.ScreenWidth) - ) && - ( - this.TimeZoneOffset == input.TimeZoneOffset || - this.TimeZoneOffset.Equals(input.TimeZoneOffset) - ) && - ( - this.UserAgent == input.UserAgent || - (this.UserAgent != null && - this.UserAgent.Equals(input.UserAgent)) - ); + + if (!acceptHeader.IsSet) + throw new ArgumentException("Property is required for class BrowserInfo.", nameof(acceptHeader)); + + if (!colorDepth.IsSet) + throw new ArgumentException("Property is required for class BrowserInfo.", nameof(colorDepth)); + + if (!javaEnabled.IsSet) + throw new ArgumentException("Property is required for class BrowserInfo.", nameof(javaEnabled)); + + if (!language.IsSet) + throw new ArgumentException("Property is required for class BrowserInfo.", nameof(language)); + + if (!screenHeight.IsSet) + throw new ArgumentException("Property is required for class BrowserInfo.", nameof(screenHeight)); + + if (!screenWidth.IsSet) + throw new ArgumentException("Property is required for class BrowserInfo.", nameof(screenWidth)); + + if (!timeZoneOffset.IsSet) + throw new ArgumentException("Property is required for class BrowserInfo.", nameof(timeZoneOffset)); + + if (!userAgent.IsSet) + throw new ArgumentException("Property is required for class BrowserInfo.", nameof(userAgent)); + + if (acceptHeader.IsSet && acceptHeader.Value == null) + throw new ArgumentNullException(nameof(acceptHeader), "Property is not nullable for class BrowserInfo."); + + if (colorDepth.IsSet && colorDepth.Value == null) + throw new ArgumentNullException(nameof(colorDepth), "Property is not nullable for class BrowserInfo."); + + if (javaEnabled.IsSet && javaEnabled.Value == null) + throw new ArgumentNullException(nameof(javaEnabled), "Property is not nullable for class BrowserInfo."); + + if (language.IsSet && language.Value == null) + throw new ArgumentNullException(nameof(language), "Property is not nullable for class BrowserInfo."); + + if (screenHeight.IsSet && screenHeight.Value == null) + throw new ArgumentNullException(nameof(screenHeight), "Property is not nullable for class BrowserInfo."); + + if (screenWidth.IsSet && screenWidth.Value == null) + throw new ArgumentNullException(nameof(screenWidth), "Property is not nullable for class BrowserInfo."); + + if (timeZoneOffset.IsSet && timeZoneOffset.Value == null) + throw new ArgumentNullException(nameof(timeZoneOffset), "Property is not nullable for class BrowserInfo."); + + if (userAgent.IsSet && userAgent.Value == null) + throw new ArgumentNullException(nameof(userAgent), "Property is not nullable for class BrowserInfo."); + + if (javaScriptEnabled.IsSet && javaScriptEnabled.Value == null) + throw new ArgumentNullException(nameof(javaScriptEnabled), "Property is not nullable for class BrowserInfo."); + + return new BrowserInfo(acceptHeader.Value, colorDepth.Value.Value, javaEnabled.Value.Value, language.Value, screenHeight.Value.Value, screenWidth.Value.Value, timeZoneOffset.Value.Value, userAgent.Value, javaScriptEnabled); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BrowserInfo browserInfo, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AcceptHeader != null) - { - hashCode = (hashCode * 59) + this.AcceptHeader.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ColorDepth.GetHashCode(); - hashCode = (hashCode * 59) + this.JavaEnabled.GetHashCode(); - hashCode = (hashCode * 59) + this.JavaScriptEnabled.GetHashCode(); - if (this.Language != null) - { - hashCode = (hashCode * 59) + this.Language.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ScreenHeight.GetHashCode(); - hashCode = (hashCode * 59) + this.ScreenWidth.GetHashCode(); - hashCode = (hashCode * 59) + this.TimeZoneOffset.GetHashCode(); - if (this.UserAgent != null) - { - hashCode = (hashCode * 59) + this.UserAgent.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, browserInfo, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, BrowserInfo browserInfo, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (browserInfo.AcceptHeader == null) + throw new ArgumentNullException(nameof(browserInfo.AcceptHeader), "Property is required for class BrowserInfo."); + + if (browserInfo.Language == null) + throw new ArgumentNullException(nameof(browserInfo.Language), "Property is required for class BrowserInfo."); + + if (browserInfo.UserAgent == null) + throw new ArgumentNullException(nameof(browserInfo.UserAgent), "Property is required for class BrowserInfo."); + + writer.WriteString("acceptHeader", browserInfo.AcceptHeader); + + writer.WriteNumber("colorDepth", browserInfo.ColorDepth); + + writer.WriteBoolean("javaEnabled", browserInfo.JavaEnabled); + + writer.WriteString("language", browserInfo.Language); + + writer.WriteNumber("screenHeight", browserInfo.ScreenHeight); + + writer.WriteNumber("screenWidth", browserInfo.ScreenWidth); + + writer.WriteNumber("timeZoneOffset", browserInfo.TimeZoneOffset); + + writer.WriteString("userAgent", browserInfo.UserAgent); + + if (browserInfo.JavaScriptEnabledOption.IsSet) + writer.WriteBoolean("javaScriptEnabled", browserInfo.JavaScriptEnabledOption.Value.Value); } } - } diff --git a/Adyen/Model/Checkout/CancelOrderRequest.cs b/Adyen/Model/Checkout/CancelOrderRequest.cs index d9f25067d..a9fd159e9 100644 --- a/Adyen/Model/Checkout/CancelOrderRequest.cs +++ b/Adyen/Model/Checkout/CancelOrderRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,50 +14,46 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CancelOrderRequest /// - [DataContract(Name = "CancelOrderRequest")] - public partial class CancelOrderRequest : IEquatable, IValidatableObject + public partial class CancelOrderRequest : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected CancelOrderRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// The merchant account identifier that orderData belongs to. (required). - /// order (required). - public CancelOrderRequest(string merchantAccount = default(string), EncryptedOrderData order = default(EncryptedOrderData)) + /// The merchant account identifier that orderData belongs to. + /// order + [JsonConstructor] + public CancelOrderRequest(string merchantAccount, EncryptedOrderData order) { - this.MerchantAccount = merchantAccount; - this.Order = order; + MerchantAccount = merchantAccount; + Order = order; + OnCreated(); } + partial void OnCreated(); + /// /// The merchant account identifier that orderData belongs to. /// /// The merchant account identifier that orderData belongs to. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantAccount")] public string MerchantAccount { get; set; } /// /// Gets or Sets Order /// - [DataMember(Name = "order", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("order")] public EncryptedOrderData Order { get; set; } /// @@ -76,77 +71,118 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CancelOrderRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CancelOrderRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CancelOrderRequest); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CancelOrderRequest instances are equal - /// - /// Instance of CancelOrderRequest to be compared - /// Boolean - public bool Equals(CancelOrderRequest input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option merchantAccount = default; + Option order = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "order": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + order = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.Order == input.Order || - (this.Order != null && - this.Order.Equals(input.Order)) - ); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class CancelOrderRequest.", nameof(merchantAccount)); + + if (!order.IsSet) + throw new ArgumentException("Property is required for class CancelOrderRequest.", nameof(order)); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class CancelOrderRequest."); + + if (order.IsSet && order.Value == null) + throw new ArgumentNullException(nameof(order), "Property is not nullable for class CancelOrderRequest."); + + return new CancelOrderRequest(merchantAccount.Value, order.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CancelOrderRequest cancelOrderRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.Order != null) - { - hashCode = (hashCode * 59) + this.Order.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, cancelOrderRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CancelOrderRequest cancelOrderRequest, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (cancelOrderRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(cancelOrderRequest.MerchantAccount), "Property is required for class CancelOrderRequest."); + + if (cancelOrderRequest.Order == null) + throw new ArgumentNullException(nameof(cancelOrderRequest.Order), "Property is required for class CancelOrderRequest."); + + writer.WriteString("merchantAccount", cancelOrderRequest.MerchantAccount); + + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, cancelOrderRequest.Order, jsonSerializerOptions); } } - } diff --git a/Adyen/Model/Checkout/CancelOrderResponse.cs b/Adyen/Model/Checkout/CancelOrderResponse.cs index 417804736..3e34866cf 100644 --- a/Adyen/Model/Checkout/CancelOrderResponse.cs +++ b/Adyen/Model/Checkout/CancelOrderResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,66 +14,100 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CancelOrderResponse /// - [DataContract(Name = "CancelOrderResponse")] - public partial class CancelOrderResponse : IEquatable, IValidatableObject + public partial class CancelOrderResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// A unique reference of the cancellation request. + /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. + [JsonConstructor] + public CancelOrderResponse(string pspReference, ResultCodeEnum resultCode) + { + PspReference = pspReference; + ResultCode = resultCode; + OnCreated(); + } + + partial void OnCreated(); + /// /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. /// /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. - [JsonConverter(typeof(StringEnumConverter))] public enum ResultCodeEnum { /// /// Enum Received for value: Received /// - [EnumMember(Value = "Received")] Received = 1 - } - /// - /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. + /// Returns a /// - /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. - [DataMember(Name = "resultCode", IsRequired = false, EmitDefaultValue = false)] - public ResultCodeEnum ResultCode { get; set; } + /// + /// + /// + public static ResultCodeEnum ResultCodeEnumFromString(string value) + { + if (value.Equals("Received")) + return ResultCodeEnum.Received; + + throw new NotImplementedException($"Could not convert value to type ResultCodeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected CancelOrderResponse() { } + /// + /// + public static ResultCodeEnum? ResultCodeEnumFromStringOrDefault(string value) + { + if (value.Equals("Received")) + return ResultCodeEnum.Received; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// A unique reference of the cancellation request. (required). - /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. (required). - public CancelOrderResponse(string pspReference = default(string), ResultCodeEnum resultCode = default(ResultCodeEnum)) + /// + /// + /// + public static string ResultCodeEnumToJsonValue(ResultCodeEnum value) { - this.PspReference = pspReference; - this.ResultCode = resultCode; + if (value == ResultCodeEnum.Received) + return "Received"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. + /// + /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. + [JsonPropertyName("resultCode")] + public ResultCodeEnum ResultCode { get; set; } + /// /// A unique reference of the cancellation request. /// /// A unique reference of the cancellation request. - [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("pspReference")] public string PspReference { get; set; } /// @@ -92,73 +125,116 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CancelOrderResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CancelOrderResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CancelOrderResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CancelOrderResponse instances are equal - /// - /// Instance of CancelOrderResponse to be compared - /// Boolean - public bool Equals(CancelOrderResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option pspReference = default; + Option resultCode = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "resultCode": + string resultCodeRawValue = utf8JsonReader.GetString(); + if (resultCodeRawValue != null) + resultCode = new Option(CancelOrderResponse.ResultCodeEnumFromStringOrDefault(resultCodeRawValue)); + break; + default: + break; + } + } } - return - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.ResultCode == input.ResultCode || - this.ResultCode.Equals(input.ResultCode) - ); + + if (!pspReference.IsSet) + throw new ArgumentException("Property is required for class CancelOrderResponse.", nameof(pspReference)); + + if (!resultCode.IsSet) + throw new ArgumentException("Property is required for class CancelOrderResponse.", nameof(resultCode)); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class CancelOrderResponse."); + + if (resultCode.IsSet && resultCode.Value == null) + throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class CancelOrderResponse."); + + return new CancelOrderResponse(pspReference.Value, resultCode.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CancelOrderResponse cancelOrderResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ResultCode.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, cancelOrderResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CancelOrderResponse cancelOrderResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (cancelOrderResponse.PspReference == null) + throw new ArgumentNullException(nameof(cancelOrderResponse.PspReference), "Property is required for class CancelOrderResponse."); + + writer.WriteString("pspReference", cancelOrderResponse.PspReference); + + var resultCodeRawValue = CancelOrderResponse.ResultCodeEnumToJsonValue(cancelOrderResponse.ResultCode); + writer.WriteString("resultCode", resultCodeRawValue); } } - } diff --git a/Adyen/Model/Checkout/CardBrandDetails.cs b/Adyen/Model/Checkout/CardBrandDetails.cs index 68cc25910..a704e252b 100644 --- a/Adyen/Model/Checkout/CardBrandDetails.cs +++ b/Adyen/Model/Checkout/CardBrandDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,47 +14,62 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CardBrandDetails /// - [DataContract(Name = "CardBrandDetails")] - public partial class CardBrandDetails : IEquatable, IValidatableObject + public partial class CardBrandDetails : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Indicates if you support the card brand.. - /// The name of the card brand.. - public CardBrandDetails(bool? supported = default(bool?), string type = default(string)) + /// Indicates if you support the card brand. + /// The name of the card brand. + [JsonConstructor] + public CardBrandDetails(Option supported = default, Option type = default) { - this.Supported = supported; - this.Type = type; + SupportedOption = supported; + TypeOption = type; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Supported + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SupportedOption { get; private set; } + /// /// Indicates if you support the card brand. /// /// Indicates if you support the card brand. - [DataMember(Name = "supported", EmitDefaultValue = false)] - public bool? Supported { get; set; } + [JsonPropertyName("supported")] + public bool? Supported { get { return this.SupportedOption; } set { this.SupportedOption = new Option(value); } } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The name of the card brand. /// /// The name of the card brand. - [DataMember(Name = "type", EmitDefaultValue = false)] - public string Type { get; set; } + [JsonPropertyName("type")] + public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -72,73 +86,110 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CardBrandDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CardBrandDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CardBrandDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CardBrandDetails instances are equal - /// - /// Instance of CardBrandDetails to be compared - /// Boolean - public bool Equals(CardBrandDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option supported = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "supported": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + supported = new Option(utf8JsonReader.GetBoolean()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Supported == input.Supported || - this.Supported.Equals(input.Supported) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ); + + if (supported.IsSet && supported.Value == null) + throw new ArgumentNullException(nameof(supported), "Property is not nullable for class CardBrandDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CardBrandDetails."); + + return new CardBrandDetails(supported, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CardBrandDetails cardBrandDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Supported.GetHashCode(); - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, cardBrandDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CardBrandDetails cardBrandDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (cardBrandDetails.TypeOption.IsSet && cardBrandDetails.Type == null) + throw new ArgumentNullException(nameof(cardBrandDetails.Type), "Property is required for class CardBrandDetails."); + + if (cardBrandDetails.SupportedOption.IsSet) + writer.WriteBoolean("supported", cardBrandDetails.SupportedOption.Value.Value); + + if (cardBrandDetails.TypeOption.IsSet) + writer.WriteString("type", cardBrandDetails.Type); } } - } diff --git a/Adyen/Model/Checkout/CardDetails.cs b/Adyen/Model/Checkout/CardDetails.cs index 1d87040d4..611cad8af 100644 --- a/Adyen/Model/Checkout/CardDetails.cs +++ b/Adyen/Model/Checkout/CardDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,321 +14,621 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CardDetails /// - [DataContract(Name = "CardDetails")] - public partial class CardDetails : IEquatable, IValidatableObject + public partial class CardDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Secondary brand of the card. For example: **plastix**, **hmclub**. + /// The checkout attempt identifier. + /// cupsecureplusSmscode + /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. + /// The encrypted card number. + /// The encrypted card expiry month. + /// The encrypted card expiry year. + /// The encrypted card verification code. + /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + /// The encoded fastlane data blob + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + /// The name of the card holder. + /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. + /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. + /// An identifier used for the Click to Pay transaction. + /// The SRC reference for the Click to Pay token. + /// The scheme that is being used for Click to Pay. + /// The reference for the Click to Pay token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. + /// Default payment method details. Common for scheme payment methods, and for simple payment method details. (default to TypeEnum.Scheme) + [JsonConstructor] + public CardDetails(Option brand = default, Option checkoutAttemptId = default, Option cupsecureplusSmscode = default, Option cvc = default, Option encryptedCard = default, Option encryptedCardNumber = default, Option encryptedExpiryMonth = default, Option encryptedExpiryYear = default, Option encryptedSecurityCode = default, Option expiryMonth = default, Option expiryYear = default, Option fastlaneData = default, Option fundingSource = default, Option holderName = default, Option networkPaymentReference = default, Option number = default, Option recurringDetailReference = default, Option shopperNotificationReference = default, Option srcCorrelationId = default, Option srcDigitalCardId = default, Option srcScheme = default, Option srcTokenReference = default, Option storedPaymentMethodId = default, Option threeDS2SdkVersion = default, Option type = default) + { + BrandOption = brand; + CheckoutAttemptIdOption = checkoutAttemptId; + CupsecureplusSmscodeOption = cupsecureplusSmscode; + CvcOption = cvc; + EncryptedCardOption = encryptedCard; + EncryptedCardNumberOption = encryptedCardNumber; + EncryptedExpiryMonthOption = encryptedExpiryMonth; + EncryptedExpiryYearOption = encryptedExpiryYear; + EncryptedSecurityCodeOption = encryptedSecurityCode; + ExpiryMonthOption = expiryMonth; + ExpiryYearOption = expiryYear; + FastlaneDataOption = fastlaneData; + FundingSourceOption = fundingSource; + HolderNameOption = holderName; + NetworkPaymentReferenceOption = networkPaymentReference; + NumberOption = number; + RecurringDetailReferenceOption = recurringDetailReference; + ShopperNotificationReferenceOption = shopperNotificationReference; + SrcCorrelationIdOption = srcCorrelationId; + SrcDigitalCardIdOption = srcDigitalCardId; + SrcSchemeOption = srcScheme; + SrcTokenReferenceOption = srcTokenReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + ThreeDS2SdkVersionOption = threeDS2SdkVersion; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// - [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// - [EnumMember(Value = "debit")] Debit = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static FundingSourceEnum FundingSourceEnumFromString(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) + { + if (value == FundingSourceEnum.Credit) + return "credit"; + + if (value == FundingSourceEnum.Debit) + return "debit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public FundingSourceEnum? FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Bcmc for value: bcmc /// - [EnumMember(Value = "bcmc")] Bcmc = 1, /// /// Enum Scheme for value: scheme /// - [EnumMember(Value = "scheme")] Scheme = 2, /// /// Enum NetworkToken for value: networkToken /// - [EnumMember(Value = "networkToken")] NetworkToken = 3, /// /// Enum Giftcard for value: giftcard /// - [EnumMember(Value = "giftcard")] Giftcard = 4, /// /// Enum Card for value: card /// - [EnumMember(Value = "card")] Card = 5, /// /// Enum Clicktopay for value: clicktopay /// - [EnumMember(Value = "clicktopay")] Clicktopay = 6 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("bcmc")) + return TypeEnum.Bcmc; + + if (value.Equals("scheme")) + return TypeEnum.Scheme; + + if (value.Equals("networkToken")) + return TypeEnum.NetworkToken; + + if (value.Equals("giftcard")) + return TypeEnum.Giftcard; + + if (value.Equals("card")) + return TypeEnum.Card; + if (value.Equals("clicktopay")) + return TypeEnum.Clicktopay; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("bcmc")) + return TypeEnum.Bcmc; + + if (value.Equals("scheme")) + return TypeEnum.Scheme; + + if (value.Equals("networkToken")) + return TypeEnum.NetworkToken; + + if (value.Equals("giftcard")) + return TypeEnum.Giftcard; + + if (value.Equals("card")) + return TypeEnum.Card; + + if (value.Equals("clicktopay")) + return TypeEnum.Clicktopay; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Bcmc) + return "bcmc"; + + if (value == TypeEnum.Scheme) + return "scheme"; + + if (value == TypeEnum.NetworkToken) + return "networkToken"; + + if (value == TypeEnum.Giftcard) + return "giftcard"; + + if (value == TypeEnum.Card) + return "card"; + + if (value == TypeEnum.Clicktopay) + return "clicktopay"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of Brand /// - /// Secondary brand of the card. For example: **plastix**, **hmclub**.. - /// The checkout attempt identifier.. - /// cupsecureplusSmscode. - /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. - /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details.. - /// The encrypted card number.. - /// The encrypted card expiry month.. - /// The encrypted card expiry year.. - /// The encrypted card verification code.. - /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. - /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. - /// The encoded fastlane data blob. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. - /// The name of the card holder.. - /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment.. - /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India.. - /// An identifier used for the Click to Pay transaction.. - /// The SRC reference for the Click to Pay token.. - /// The scheme that is being used for Click to Pay.. - /// The reference for the Click to Pay token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK.. - /// Default payment method details. Common for scheme payment methods, and for simple payment method details. (default to TypeEnum.Scheme). - public CardDetails(string brand = default(string), string checkoutAttemptId = default(string), string cupsecureplusSmscode = default(string), string cvc = default(string), string encryptedCard = default(string), string encryptedCardNumber = default(string), string encryptedExpiryMonth = default(string), string encryptedExpiryYear = default(string), string encryptedSecurityCode = default(string), string expiryMonth = default(string), string expiryYear = default(string), string fastlaneData = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string holderName = default(string), string networkPaymentReference = default(string), string number = default(string), string recurringDetailReference = default(string), string shopperNotificationReference = default(string), string srcCorrelationId = default(string), string srcDigitalCardId = default(string), string srcScheme = default(string), string srcTokenReference = default(string), string storedPaymentMethodId = default(string), string threeDS2SdkVersion = default(string), TypeEnum? type = TypeEnum.Scheme) - { - this.Brand = brand; - this.CheckoutAttemptId = checkoutAttemptId; - this.CupsecureplusSmscode = cupsecureplusSmscode; - this.Cvc = cvc; - this.EncryptedCard = encryptedCard; - this.EncryptedCardNumber = encryptedCardNumber; - this.EncryptedExpiryMonth = encryptedExpiryMonth; - this.EncryptedExpiryYear = encryptedExpiryYear; - this.EncryptedSecurityCode = encryptedSecurityCode; - this.ExpiryMonth = expiryMonth; - this.ExpiryYear = expiryYear; - this.FastlaneData = fastlaneData; - this.FundingSource = fundingSource; - this.HolderName = holderName; - this.NetworkPaymentReference = networkPaymentReference; - this.Number = number; - this.RecurringDetailReference = recurringDetailReference; - this.ShopperNotificationReference = shopperNotificationReference; - this.SrcCorrelationId = srcCorrelationId; - this.SrcDigitalCardId = srcDigitalCardId; - this.SrcScheme = srcScheme; - this.SrcTokenReference = srcTokenReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.ThreeDS2SdkVersion = threeDS2SdkVersion; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandOption { get; private set; } /// /// Secondary brand of the card. For example: **plastix**, **hmclub**. /// /// Secondary brand of the card. For example: **plastix**, **hmclub**. - [DataMember(Name = "brand", EmitDefaultValue = false)] - public string Brand { get; set; } + [JsonPropertyName("brand")] + public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of CupsecureplusSmscode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CupsecureplusSmscodeOption { get; private set; } /// /// Gets or Sets CupsecureplusSmscode /// - [DataMember(Name = "cupsecureplus.smscode", EmitDefaultValue = false)] - [Obsolete("")] - public string CupsecureplusSmscode { get; set; } + [JsonPropertyName("cupsecureplus.smscode")] + [Obsolete] + public string CupsecureplusSmscode { get { return this.CupsecureplusSmscodeOption; } set { this.CupsecureplusSmscodeOption = new Option(value); } } + + /// + /// Used to track the state of Cvc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CvcOption { get; private set; } /// /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [DataMember(Name = "cvc", EmitDefaultValue = false)] - public string Cvc { get; set; } + [JsonPropertyName("cvc")] + public string Cvc { get { return this.CvcOption; } set { this.CvcOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedCard + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedCardOption { get; private set; } /// /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. /// /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. - [DataMember(Name = "encryptedCard", EmitDefaultValue = false)] - public string EncryptedCard { get; set; } + [JsonPropertyName("encryptedCard")] + public string EncryptedCard { get { return this.EncryptedCardOption; } set { this.EncryptedCardOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedCardNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedCardNumberOption { get; private set; } /// /// The encrypted card number. /// /// The encrypted card number. - [DataMember(Name = "encryptedCardNumber", EmitDefaultValue = false)] - public string EncryptedCardNumber { get; set; } + [JsonPropertyName("encryptedCardNumber")] + public string EncryptedCardNumber { get { return this.EncryptedCardNumberOption; } set { this.EncryptedCardNumberOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedExpiryMonth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedExpiryMonthOption { get; private set; } /// /// The encrypted card expiry month. /// /// The encrypted card expiry month. - [DataMember(Name = "encryptedExpiryMonth", EmitDefaultValue = false)] - public string EncryptedExpiryMonth { get; set; } + [JsonPropertyName("encryptedExpiryMonth")] + public string EncryptedExpiryMonth { get { return this.EncryptedExpiryMonthOption; } set { this.EncryptedExpiryMonthOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedExpiryYear + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedExpiryYearOption { get; private set; } /// /// The encrypted card expiry year. /// /// The encrypted card expiry year. - [DataMember(Name = "encryptedExpiryYear", EmitDefaultValue = false)] - public string EncryptedExpiryYear { get; set; } + [JsonPropertyName("encryptedExpiryYear")] + public string EncryptedExpiryYear { get { return this.EncryptedExpiryYearOption; } set { this.EncryptedExpiryYearOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedSecurityCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedSecurityCodeOption { get; private set; } /// /// The encrypted card verification code. /// /// The encrypted card verification code. - [DataMember(Name = "encryptedSecurityCode", EmitDefaultValue = false)] - public string EncryptedSecurityCode { get; set; } + [JsonPropertyName("encryptedSecurityCode")] + public string EncryptedSecurityCode { get { return this.EncryptedSecurityCodeOption; } set { this.EncryptedSecurityCodeOption = new Option(value); } } + + /// + /// Used to track the state of ExpiryMonth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiryMonthOption { get; private set; } /// /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [DataMember(Name = "expiryMonth", EmitDefaultValue = false)] - public string ExpiryMonth { get; set; } + [JsonPropertyName("expiryMonth")] + public string ExpiryMonth { get { return this.ExpiryMonthOption; } set { this.ExpiryMonthOption = new Option(value); } } + + /// + /// Used to track the state of ExpiryYear + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiryYearOption { get; private set; } /// /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [DataMember(Name = "expiryYear", EmitDefaultValue = false)] - public string ExpiryYear { get; set; } + [JsonPropertyName("expiryYear")] + public string ExpiryYear { get { return this.ExpiryYearOption; } set { this.ExpiryYearOption = new Option(value); } } + + /// + /// Used to track the state of FastlaneData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FastlaneDataOption { get; private set; } /// /// The encoded fastlane data blob /// /// The encoded fastlane data blob - [DataMember(Name = "fastlaneData", EmitDefaultValue = false)] - public string FastlaneData { get; set; } + [JsonPropertyName("fastlaneData")] + public string FastlaneData { get { return this.FastlaneDataOption; } set { this.FastlaneDataOption = new Option(value); } } + + /// + /// Used to track the state of HolderName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option HolderNameOption { get; private set; } /// /// The name of the card holder. /// /// The name of the card holder. - [DataMember(Name = "holderName", EmitDefaultValue = false)] - public string HolderName { get; set; } + [JsonPropertyName("holderName")] + public string HolderName { get { return this.HolderNameOption; } set { this.HolderNameOption = new Option(value); } } + + /// + /// Used to track the state of NetworkPaymentReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NetworkPaymentReferenceOption { get; private set; } /// /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. /// /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. - [DataMember(Name = "networkPaymentReference", EmitDefaultValue = false)] - public string NetworkPaymentReference { get; set; } + [JsonPropertyName("networkPaymentReference")] + public string NetworkPaymentReference { get { return this.NetworkPaymentReferenceOption; } set { this.NetworkPaymentReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Number + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NumberOption { get; private set; } /// /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [DataMember(Name = "number", EmitDefaultValue = false)] - public string Number { get; set; } + [JsonPropertyName("number")] + public string Number { get { return this.NumberOption; } set { this.NumberOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperNotificationReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNotificationReferenceOption { get; private set; } /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. - [DataMember(Name = "shopperNotificationReference", EmitDefaultValue = false)] - public string ShopperNotificationReference { get; set; } + [JsonPropertyName("shopperNotificationReference")] + public string ShopperNotificationReference { get { return this.ShopperNotificationReferenceOption; } set { this.ShopperNotificationReferenceOption = new Option(value); } } + + /// + /// Used to track the state of SrcCorrelationId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SrcCorrelationIdOption { get; private set; } /// /// An identifier used for the Click to Pay transaction. /// /// An identifier used for the Click to Pay transaction. - [DataMember(Name = "srcCorrelationId", EmitDefaultValue = false)] - public string SrcCorrelationId { get; set; } + [JsonPropertyName("srcCorrelationId")] + public string SrcCorrelationId { get { return this.SrcCorrelationIdOption; } set { this.SrcCorrelationIdOption = new Option(value); } } + + /// + /// Used to track the state of SrcDigitalCardId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SrcDigitalCardIdOption { get; private set; } /// /// The SRC reference for the Click to Pay token. /// /// The SRC reference for the Click to Pay token. - [DataMember(Name = "srcDigitalCardId", EmitDefaultValue = false)] - public string SrcDigitalCardId { get; set; } + [JsonPropertyName("srcDigitalCardId")] + public string SrcDigitalCardId { get { return this.SrcDigitalCardIdOption; } set { this.SrcDigitalCardIdOption = new Option(value); } } + + /// + /// Used to track the state of SrcScheme + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SrcSchemeOption { get; private set; } /// /// The scheme that is being used for Click to Pay. /// /// The scheme that is being used for Click to Pay. - [DataMember(Name = "srcScheme", EmitDefaultValue = false)] - public string SrcScheme { get; set; } + [JsonPropertyName("srcScheme")] + public string SrcScheme { get { return this.SrcSchemeOption; } set { this.SrcSchemeOption = new Option(value); } } + + /// + /// Used to track the state of SrcTokenReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SrcTokenReferenceOption { get; private set; } /// /// The reference for the Click to Pay token. /// /// The reference for the Click to Pay token. - [DataMember(Name = "srcTokenReference", EmitDefaultValue = false)] - public string SrcTokenReference { get; set; } + [JsonPropertyName("srcTokenReference")] + public string SrcTokenReference { get { return this.SrcTokenReferenceOption; } set { this.SrcTokenReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2SdkVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2SdkVersionOption { get; private set; } /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - [DataMember(Name = "threeDS2SdkVersion", EmitDefaultValue = false)] - public string ThreeDS2SdkVersion { get; set; } + [JsonPropertyName("threeDS2SdkVersion")] + public string ThreeDS2SdkVersion { get { return this.ThreeDS2SdkVersionOption; } set { this.ThreeDS2SdkVersionOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -368,325 +667,457 @@ public override string ToString() return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as CardDetails); - } - - /// - /// Returns true if CardDetails instances are equal - /// - /// Instance of CardDetails to be compared - /// Boolean - public bool Equals(CardDetails input) - { - if (input == null) - { - return false; - } - return - ( - this.Brand == input.Brand || - (this.Brand != null && - this.Brand.Equals(input.Brand)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.CupsecureplusSmscode == input.CupsecureplusSmscode || - (this.CupsecureplusSmscode != null && - this.CupsecureplusSmscode.Equals(input.CupsecureplusSmscode)) - ) && - ( - this.Cvc == input.Cvc || - (this.Cvc != null && - this.Cvc.Equals(input.Cvc)) - ) && - ( - this.EncryptedCard == input.EncryptedCard || - (this.EncryptedCard != null && - this.EncryptedCard.Equals(input.EncryptedCard)) - ) && - ( - this.EncryptedCardNumber == input.EncryptedCardNumber || - (this.EncryptedCardNumber != null && - this.EncryptedCardNumber.Equals(input.EncryptedCardNumber)) - ) && - ( - this.EncryptedExpiryMonth == input.EncryptedExpiryMonth || - (this.EncryptedExpiryMonth != null && - this.EncryptedExpiryMonth.Equals(input.EncryptedExpiryMonth)) - ) && - ( - this.EncryptedExpiryYear == input.EncryptedExpiryYear || - (this.EncryptedExpiryYear != null && - this.EncryptedExpiryYear.Equals(input.EncryptedExpiryYear)) - ) && - ( - this.EncryptedSecurityCode == input.EncryptedSecurityCode || - (this.EncryptedSecurityCode != null && - this.EncryptedSecurityCode.Equals(input.EncryptedSecurityCode)) - ) && - ( - this.ExpiryMonth == input.ExpiryMonth || - (this.ExpiryMonth != null && - this.ExpiryMonth.Equals(input.ExpiryMonth)) - ) && - ( - this.ExpiryYear == input.ExpiryYear || - (this.ExpiryYear != null && - this.ExpiryYear.Equals(input.ExpiryYear)) - ) && - ( - this.FastlaneData == input.FastlaneData || - (this.FastlaneData != null && - this.FastlaneData.Equals(input.FastlaneData)) - ) && - ( - this.FundingSource == input.FundingSource || - this.FundingSource.Equals(input.FundingSource) - ) && - ( - this.HolderName == input.HolderName || - (this.HolderName != null && - this.HolderName.Equals(input.HolderName)) - ) && - ( - this.NetworkPaymentReference == input.NetworkPaymentReference || - (this.NetworkPaymentReference != null && - this.NetworkPaymentReference.Equals(input.NetworkPaymentReference)) - ) && - ( - this.Number == input.Number || - (this.Number != null && - this.Number.Equals(input.Number)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.ShopperNotificationReference == input.ShopperNotificationReference || - (this.ShopperNotificationReference != null && - this.ShopperNotificationReference.Equals(input.ShopperNotificationReference)) - ) && - ( - this.SrcCorrelationId == input.SrcCorrelationId || - (this.SrcCorrelationId != null && - this.SrcCorrelationId.Equals(input.SrcCorrelationId)) - ) && - ( - this.SrcDigitalCardId == input.SrcDigitalCardId || - (this.SrcDigitalCardId != null && - this.SrcDigitalCardId.Equals(input.SrcDigitalCardId)) - ) && - ( - this.SrcScheme == input.SrcScheme || - (this.SrcScheme != null && - this.SrcScheme.Equals(input.SrcScheme)) - ) && - ( - this.SrcTokenReference == input.SrcTokenReference || - (this.SrcTokenReference != null && - this.SrcTokenReference.Equals(input.SrcTokenReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.ThreeDS2SdkVersion == input.ThreeDS2SdkVersion || - (this.ThreeDS2SdkVersion != null && - this.ThreeDS2SdkVersion.Equals(input.ThreeDS2SdkVersion)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Brand != null) - { - hashCode = (hashCode * 59) + this.Brand.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.CupsecureplusSmscode != null) - { - hashCode = (hashCode * 59) + this.CupsecureplusSmscode.GetHashCode(); - } - if (this.Cvc != null) - { - hashCode = (hashCode * 59) + this.Cvc.GetHashCode(); - } - if (this.EncryptedCard != null) - { - hashCode = (hashCode * 59) + this.EncryptedCard.GetHashCode(); - } - if (this.EncryptedCardNumber != null) - { - hashCode = (hashCode * 59) + this.EncryptedCardNumber.GetHashCode(); - } - if (this.EncryptedExpiryMonth != null) - { - hashCode = (hashCode * 59) + this.EncryptedExpiryMonth.GetHashCode(); - } - if (this.EncryptedExpiryYear != null) - { - hashCode = (hashCode * 59) + this.EncryptedExpiryYear.GetHashCode(); - } - if (this.EncryptedSecurityCode != null) - { - hashCode = (hashCode * 59) + this.EncryptedSecurityCode.GetHashCode(); - } - if (this.ExpiryMonth != null) - { - hashCode = (hashCode * 59) + this.ExpiryMonth.GetHashCode(); - } - if (this.ExpiryYear != null) - { - hashCode = (hashCode * 59) + this.ExpiryYear.GetHashCode(); - } - if (this.FastlaneData != null) - { - hashCode = (hashCode * 59) + this.FastlaneData.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - if (this.HolderName != null) - { - hashCode = (hashCode * 59) + this.HolderName.GetHashCode(); - } - if (this.NetworkPaymentReference != null) - { - hashCode = (hashCode * 59) + this.NetworkPaymentReference.GetHashCode(); - } - if (this.Number != null) - { - hashCode = (hashCode * 59) + this.Number.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.ShopperNotificationReference != null) - { - hashCode = (hashCode * 59) + this.ShopperNotificationReference.GetHashCode(); - } - if (this.SrcCorrelationId != null) - { - hashCode = (hashCode * 59) + this.SrcCorrelationId.GetHashCode(); - } - if (this.SrcDigitalCardId != null) - { - hashCode = (hashCode * 59) + this.SrcDigitalCardId.GetHashCode(); - } - if (this.SrcScheme != null) - { - hashCode = (hashCode * 59) + this.SrcScheme.GetHashCode(); - } - if (this.SrcTokenReference != null) - { - hashCode = (hashCode * 59) + this.SrcTokenReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.ThreeDS2SdkVersion != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2SdkVersion.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // EncryptedCard (string) maxLength if (this.EncryptedCard != null && this.EncryptedCard.Length > 40000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCard, length must be less than 40000.", new [] { "EncryptedCard" }); + yield return new ValidationResult("Invalid value for EncryptedCard, length must be less than 40000.", new [] { "EncryptedCard" }); } // EncryptedCardNumber (string) maxLength if (this.EncryptedCardNumber != null && this.EncryptedCardNumber.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); + yield return new ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); } // EncryptedExpiryMonth (string) maxLength if (this.EncryptedExpiryMonth != null && this.EncryptedExpiryMonth.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedExpiryMonth, length must be less than 15000.", new [] { "EncryptedExpiryMonth" }); + yield return new ValidationResult("Invalid value for EncryptedExpiryMonth, length must be less than 15000.", new [] { "EncryptedExpiryMonth" }); } // EncryptedExpiryYear (string) maxLength if (this.EncryptedExpiryYear != null && this.EncryptedExpiryYear.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedExpiryYear, length must be less than 15000.", new [] { "EncryptedExpiryYear" }); + yield return new ValidationResult("Invalid value for EncryptedExpiryYear, length must be less than 15000.", new [] { "EncryptedExpiryYear" }); } // EncryptedSecurityCode (string) maxLength if (this.EncryptedSecurityCode != null && this.EncryptedSecurityCode.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedSecurityCode, length must be less than 15000.", new [] { "EncryptedSecurityCode" }); + yield return new ValidationResult("Invalid value for EncryptedSecurityCode, length must be less than 15000.", new [] { "EncryptedSecurityCode" }); } // HolderName (string) maxLength if (this.HolderName != null && this.HolderName.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for HolderName, length must be less than 15000.", new [] { "HolderName" }); + yield return new ValidationResult("Invalid value for HolderName, length must be less than 15000.", new [] { "HolderName" }); } // StoredPaymentMethodId (string) maxLength if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); } // ThreeDS2SdkVersion (string) maxLength if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); + yield return new ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); } yield break; } } + /// + /// A Json converter for type + /// + public class CardDetailsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override CardDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option brand = default; + Option checkoutAttemptId = default; + Option cupsecureplusSmscode = default; + Option cvc = default; + Option encryptedCard = default; + Option encryptedCardNumber = default; + Option encryptedExpiryMonth = default; + Option encryptedExpiryYear = default; + Option encryptedSecurityCode = default; + Option expiryMonth = default; + Option expiryYear = default; + Option fastlaneData = default; + Option fundingSource = default; + Option holderName = default; + Option networkPaymentReference = default; + Option number = default; + Option recurringDetailReference = default; + Option shopperNotificationReference = default; + Option srcCorrelationId = default; + Option srcDigitalCardId = default; + Option srcScheme = default; + Option srcTokenReference = default; + Option storedPaymentMethodId = default; + Option threeDS2SdkVersion = default; + Option type = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "brand": + brand = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "cupsecureplus.smscode": + cupsecureplusSmscode = new Option(utf8JsonReader.GetString()); + break; + case "cvc": + cvc = new Option(utf8JsonReader.GetString()); + break; + case "encryptedCard": + encryptedCard = new Option(utf8JsonReader.GetString()); + break; + case "encryptedCardNumber": + encryptedCardNumber = new Option(utf8JsonReader.GetString()); + break; + case "encryptedExpiryMonth": + encryptedExpiryMonth = new Option(utf8JsonReader.GetString()); + break; + case "encryptedExpiryYear": + encryptedExpiryYear = new Option(utf8JsonReader.GetString()); + break; + case "encryptedSecurityCode": + encryptedSecurityCode = new Option(utf8JsonReader.GetString()); + break; + case "expiryMonth": + expiryMonth = new Option(utf8JsonReader.GetString()); + break; + case "expiryYear": + expiryYear = new Option(utf8JsonReader.GetString()); + break; + case "fastlaneData": + fastlaneData = new Option(utf8JsonReader.GetString()); + break; + case "fundingSource": + string fundingSourceRawValue = utf8JsonReader.GetString(); + if (fundingSourceRawValue != null) + fundingSource = new Option(CardDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); + break; + case "holderName": + holderName = new Option(utf8JsonReader.GetString()); + break; + case "networkPaymentReference": + networkPaymentReference = new Option(utf8JsonReader.GetString()); + break; + case "number": + number = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "shopperNotificationReference": + shopperNotificationReference = new Option(utf8JsonReader.GetString()); + break; + case "srcCorrelationId": + srcCorrelationId = new Option(utf8JsonReader.GetString()); + break; + case "srcDigitalCardId": + srcDigitalCardId = new Option(utf8JsonReader.GetString()); + break; + case "srcScheme": + srcScheme = new Option(utf8JsonReader.GetString()); + break; + case "srcTokenReference": + srcTokenReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2SdkVersion": + threeDS2SdkVersion = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(CardDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } + } + + if (brand.IsSet && brand.Value == null) + throw new ArgumentNullException(nameof(brand), "Property is not nullable for class CardDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class CardDetails."); + + if (cupsecureplusSmscode.IsSet && cupsecureplusSmscode.Value == null) + throw new ArgumentNullException(nameof(cupsecureplusSmscode), "Property is not nullable for class CardDetails."); + + if (cvc.IsSet && cvc.Value == null) + throw new ArgumentNullException(nameof(cvc), "Property is not nullable for class CardDetails."); + + if (encryptedCard.IsSet && encryptedCard.Value == null) + throw new ArgumentNullException(nameof(encryptedCard), "Property is not nullable for class CardDetails."); + + if (encryptedCardNumber.IsSet && encryptedCardNumber.Value == null) + throw new ArgumentNullException(nameof(encryptedCardNumber), "Property is not nullable for class CardDetails."); + + if (encryptedExpiryMonth.IsSet && encryptedExpiryMonth.Value == null) + throw new ArgumentNullException(nameof(encryptedExpiryMonth), "Property is not nullable for class CardDetails."); + + if (encryptedExpiryYear.IsSet && encryptedExpiryYear.Value == null) + throw new ArgumentNullException(nameof(encryptedExpiryYear), "Property is not nullable for class CardDetails."); + + if (encryptedSecurityCode.IsSet && encryptedSecurityCode.Value == null) + throw new ArgumentNullException(nameof(encryptedSecurityCode), "Property is not nullable for class CardDetails."); + + if (expiryMonth.IsSet && expiryMonth.Value == null) + throw new ArgumentNullException(nameof(expiryMonth), "Property is not nullable for class CardDetails."); + + if (expiryYear.IsSet && expiryYear.Value == null) + throw new ArgumentNullException(nameof(expiryYear), "Property is not nullable for class CardDetails."); + + if (fastlaneData.IsSet && fastlaneData.Value == null) + throw new ArgumentNullException(nameof(fastlaneData), "Property is not nullable for class CardDetails."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class CardDetails."); + + if (holderName.IsSet && holderName.Value == null) + throw new ArgumentNullException(nameof(holderName), "Property is not nullable for class CardDetails."); + + if (networkPaymentReference.IsSet && networkPaymentReference.Value == null) + throw new ArgumentNullException(nameof(networkPaymentReference), "Property is not nullable for class CardDetails."); + + if (number.IsSet && number.Value == null) + throw new ArgumentNullException(nameof(number), "Property is not nullable for class CardDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class CardDetails."); + + if (shopperNotificationReference.IsSet && shopperNotificationReference.Value == null) + throw new ArgumentNullException(nameof(shopperNotificationReference), "Property is not nullable for class CardDetails."); + + if (srcCorrelationId.IsSet && srcCorrelationId.Value == null) + throw new ArgumentNullException(nameof(srcCorrelationId), "Property is not nullable for class CardDetails."); + + if (srcDigitalCardId.IsSet && srcDigitalCardId.Value == null) + throw new ArgumentNullException(nameof(srcDigitalCardId), "Property is not nullable for class CardDetails."); + + if (srcScheme.IsSet && srcScheme.Value == null) + throw new ArgumentNullException(nameof(srcScheme), "Property is not nullable for class CardDetails."); + + if (srcTokenReference.IsSet && srcTokenReference.Value == null) + throw new ArgumentNullException(nameof(srcTokenReference), "Property is not nullable for class CardDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class CardDetails."); + + if (threeDS2SdkVersion.IsSet && threeDS2SdkVersion.Value == null) + throw new ArgumentNullException(nameof(threeDS2SdkVersion), "Property is not nullable for class CardDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CardDetails."); + + return new CardDetails(brand, checkoutAttemptId, cupsecureplusSmscode, cvc, encryptedCard, encryptedCardNumber, encryptedExpiryMonth, encryptedExpiryYear, encryptedSecurityCode, expiryMonth, expiryYear, fastlaneData, fundingSource, holderName, networkPaymentReference, number, recurringDetailReference, shopperNotificationReference, srcCorrelationId, srcDigitalCardId, srcScheme, srcTokenReference, storedPaymentMethodId, threeDS2SdkVersion, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CardDetails cardDetails, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, cardDetails, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CardDetails cardDetails, JsonSerializerOptions jsonSerializerOptions) + { + if (cardDetails.BrandOption.IsSet && cardDetails.Brand == null) + throw new ArgumentNullException(nameof(cardDetails.Brand), "Property is required for class CardDetails."); + + if (cardDetails.CheckoutAttemptIdOption.IsSet && cardDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(cardDetails.CheckoutAttemptId), "Property is required for class CardDetails."); + + if (cardDetails.CupsecureplusSmscodeOption.IsSet && cardDetails.CupsecureplusSmscode == null) + throw new ArgumentNullException(nameof(cardDetails.CupsecureplusSmscode), "Property is required for class CardDetails."); + + if (cardDetails.CvcOption.IsSet && cardDetails.Cvc == null) + throw new ArgumentNullException(nameof(cardDetails.Cvc), "Property is required for class CardDetails."); + + if (cardDetails.EncryptedCardOption.IsSet && cardDetails.EncryptedCard == null) + throw new ArgumentNullException(nameof(cardDetails.EncryptedCard), "Property is required for class CardDetails."); + + if (cardDetails.EncryptedCardNumberOption.IsSet && cardDetails.EncryptedCardNumber == null) + throw new ArgumentNullException(nameof(cardDetails.EncryptedCardNumber), "Property is required for class CardDetails."); + + if (cardDetails.EncryptedExpiryMonthOption.IsSet && cardDetails.EncryptedExpiryMonth == null) + throw new ArgumentNullException(nameof(cardDetails.EncryptedExpiryMonth), "Property is required for class CardDetails."); + + if (cardDetails.EncryptedExpiryYearOption.IsSet && cardDetails.EncryptedExpiryYear == null) + throw new ArgumentNullException(nameof(cardDetails.EncryptedExpiryYear), "Property is required for class CardDetails."); + + if (cardDetails.EncryptedSecurityCodeOption.IsSet && cardDetails.EncryptedSecurityCode == null) + throw new ArgumentNullException(nameof(cardDetails.EncryptedSecurityCode), "Property is required for class CardDetails."); + + if (cardDetails.ExpiryMonthOption.IsSet && cardDetails.ExpiryMonth == null) + throw new ArgumentNullException(nameof(cardDetails.ExpiryMonth), "Property is required for class CardDetails."); + + if (cardDetails.ExpiryYearOption.IsSet && cardDetails.ExpiryYear == null) + throw new ArgumentNullException(nameof(cardDetails.ExpiryYear), "Property is required for class CardDetails."); + + if (cardDetails.FastlaneDataOption.IsSet && cardDetails.FastlaneData == null) + throw new ArgumentNullException(nameof(cardDetails.FastlaneData), "Property is required for class CardDetails."); + + if (cardDetails.HolderNameOption.IsSet && cardDetails.HolderName == null) + throw new ArgumentNullException(nameof(cardDetails.HolderName), "Property is required for class CardDetails."); + + if (cardDetails.NetworkPaymentReferenceOption.IsSet && cardDetails.NetworkPaymentReference == null) + throw new ArgumentNullException(nameof(cardDetails.NetworkPaymentReference), "Property is required for class CardDetails."); + + if (cardDetails.NumberOption.IsSet && cardDetails.Number == null) + throw new ArgumentNullException(nameof(cardDetails.Number), "Property is required for class CardDetails."); + + if (cardDetails.RecurringDetailReferenceOption.IsSet && cardDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(cardDetails.RecurringDetailReference), "Property is required for class CardDetails."); + + if (cardDetails.ShopperNotificationReferenceOption.IsSet && cardDetails.ShopperNotificationReference == null) + throw new ArgumentNullException(nameof(cardDetails.ShopperNotificationReference), "Property is required for class CardDetails."); + + if (cardDetails.SrcCorrelationIdOption.IsSet && cardDetails.SrcCorrelationId == null) + throw new ArgumentNullException(nameof(cardDetails.SrcCorrelationId), "Property is required for class CardDetails."); + + if (cardDetails.SrcDigitalCardIdOption.IsSet && cardDetails.SrcDigitalCardId == null) + throw new ArgumentNullException(nameof(cardDetails.SrcDigitalCardId), "Property is required for class CardDetails."); + + if (cardDetails.SrcSchemeOption.IsSet && cardDetails.SrcScheme == null) + throw new ArgumentNullException(nameof(cardDetails.SrcScheme), "Property is required for class CardDetails."); + + if (cardDetails.SrcTokenReferenceOption.IsSet && cardDetails.SrcTokenReference == null) + throw new ArgumentNullException(nameof(cardDetails.SrcTokenReference), "Property is required for class CardDetails."); + + if (cardDetails.StoredPaymentMethodIdOption.IsSet && cardDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(cardDetails.StoredPaymentMethodId), "Property is required for class CardDetails."); + + if (cardDetails.ThreeDS2SdkVersionOption.IsSet && cardDetails.ThreeDS2SdkVersion == null) + throw new ArgumentNullException(nameof(cardDetails.ThreeDS2SdkVersion), "Property is required for class CardDetails."); + + if (cardDetails.BrandOption.IsSet) + writer.WriteString("brand", cardDetails.Brand); + + if (cardDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", cardDetails.CheckoutAttemptId); + + if (cardDetails.CupsecureplusSmscodeOption.IsSet) + writer.WriteString("cupsecureplus.smscode", cardDetails.CupsecureplusSmscode); + + if (cardDetails.CvcOption.IsSet) + writer.WriteString("cvc", cardDetails.Cvc); + + if (cardDetails.EncryptedCardOption.IsSet) + writer.WriteString("encryptedCard", cardDetails.EncryptedCard); + + if (cardDetails.EncryptedCardNumberOption.IsSet) + writer.WriteString("encryptedCardNumber", cardDetails.EncryptedCardNumber); + + if (cardDetails.EncryptedExpiryMonthOption.IsSet) + writer.WriteString("encryptedExpiryMonth", cardDetails.EncryptedExpiryMonth); + + if (cardDetails.EncryptedExpiryYearOption.IsSet) + writer.WriteString("encryptedExpiryYear", cardDetails.EncryptedExpiryYear); + + if (cardDetails.EncryptedSecurityCodeOption.IsSet) + writer.WriteString("encryptedSecurityCode", cardDetails.EncryptedSecurityCode); + + if (cardDetails.ExpiryMonthOption.IsSet) + writer.WriteString("expiryMonth", cardDetails.ExpiryMonth); + + if (cardDetails.ExpiryYearOption.IsSet) + writer.WriteString("expiryYear", cardDetails.ExpiryYear); + + if (cardDetails.FastlaneDataOption.IsSet) + writer.WriteString("fastlaneData", cardDetails.FastlaneData); + + var fundingSourceRawValue = CardDetails.FundingSourceEnumToJsonValue(cardDetails.FundingSourceOption.Value.Value); + writer.WriteString("fundingSource", fundingSourceRawValue); + if (cardDetails.HolderNameOption.IsSet) + writer.WriteString("holderName", cardDetails.HolderName); + + if (cardDetails.NetworkPaymentReferenceOption.IsSet) + writer.WriteString("networkPaymentReference", cardDetails.NetworkPaymentReference); + + if (cardDetails.NumberOption.IsSet) + writer.WriteString("number", cardDetails.Number); + + if (cardDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", cardDetails.RecurringDetailReference); + + if (cardDetails.ShopperNotificationReferenceOption.IsSet) + writer.WriteString("shopperNotificationReference", cardDetails.ShopperNotificationReference); + + if (cardDetails.SrcCorrelationIdOption.IsSet) + writer.WriteString("srcCorrelationId", cardDetails.SrcCorrelationId); + + if (cardDetails.SrcDigitalCardIdOption.IsSet) + writer.WriteString("srcDigitalCardId", cardDetails.SrcDigitalCardId); + + if (cardDetails.SrcSchemeOption.IsSet) + writer.WriteString("srcScheme", cardDetails.SrcScheme); + + if (cardDetails.SrcTokenReferenceOption.IsSet) + writer.WriteString("srcTokenReference", cardDetails.SrcTokenReference); + + if (cardDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", cardDetails.StoredPaymentMethodId); + + if (cardDetails.ThreeDS2SdkVersionOption.IsSet) + writer.WriteString("threeDS2SdkVersion", cardDetails.ThreeDS2SdkVersion); + + var typeRawValue = CardDetails.TypeEnumToJsonValue(cardDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); + } + } } diff --git a/Adyen/Model/Checkout/CardDetailsRequest.cs b/Adyen/Model/Checkout/CardDetailsRequest.cs index f1a6b32f2..b0907cfa7 100644 --- a/Adyen/Model/Checkout/CardDetailsRequest.cs +++ b/Adyen/Model/Checkout/CardDetailsRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,79 +14,96 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CardDetailsRequest /// - [DataContract(Name = "CardDetailsRequest")] - public partial class CardDetailsRequest : IEquatable, IValidatableObject + public partial class CardDetailsRequest : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected CardDetailsRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// A minimum of the first eight digits of the card number. The full card number gives the best result. You must be [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide) to collect raw card data. Alternatively, you can use the `encryptedCardNumber` field. (required). - /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE. - /// The encrypted card number.. - /// The merchant account identifier, with which you want to process the transaction. (required). - /// The card brands you support. This is the [`brands`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods__resParam_paymentMethods-brands) array from your [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. If not included, our API uses the ones configured for your merchant account and, if provided, the country code.. - public CardDetailsRequest(string cardNumber = default(string), string countryCode = default(string), string encryptedCardNumber = default(string), string merchantAccount = default(string), List supportedBrands = default(List)) + /// A minimum of the first eight digits of the card number. The full card number gives the best result. You must be [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide) to collect raw card data. Alternatively, you can use the `encryptedCardNumber` field. + /// The merchant account identifier, with which you want to process the transaction. + /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE + /// The encrypted card number. + /// The card brands you support. This is the [`brands`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods__resParam_paymentMethods-brands) array from your [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. If not included, our API uses the ones configured for your merchant account and, if provided, the country code. + [JsonConstructor] + public CardDetailsRequest(string cardNumber, string merchantAccount, Option countryCode = default, Option encryptedCardNumber = default, Option> supportedBrands = default) { - this.CardNumber = cardNumber; - this.MerchantAccount = merchantAccount; - this.CountryCode = countryCode; - this.EncryptedCardNumber = encryptedCardNumber; - this.SupportedBrands = supportedBrands; + CardNumber = cardNumber; + MerchantAccount = merchantAccount; + CountryCodeOption = countryCode; + EncryptedCardNumberOption = encryptedCardNumber; + SupportedBrandsOption = supportedBrands; + OnCreated(); } + partial void OnCreated(); + /// /// A minimum of the first eight digits of the card number. The full card number gives the best result. You must be [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide) to collect raw card data. Alternatively, you can use the `encryptedCardNumber` field. /// /// A minimum of the first eight digits of the card number. The full card number gives the best result. You must be [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide) to collect raw card data. Alternatively, you can use the `encryptedCardNumber` field. - [DataMember(Name = "cardNumber", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("cardNumber")] public string CardNumber { get; set; } + /// + /// The merchant account identifier, with which you want to process the transaction. + /// + /// The merchant account identifier, with which you want to process the transaction. + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get; set; } + + /// + /// Used to track the state of CountryCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryCodeOption { get; private set; } + /// /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE /// /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE - [DataMember(Name = "countryCode", EmitDefaultValue = false)] - public string CountryCode { get; set; } + [JsonPropertyName("countryCode")] + public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedCardNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedCardNumberOption { get; private set; } /// /// The encrypted card number. /// /// The encrypted card number. - [DataMember(Name = "encryptedCardNumber", EmitDefaultValue = false)] - public string EncryptedCardNumber { get; set; } + [JsonPropertyName("encryptedCardNumber")] + public string EncryptedCardNumber { get { return this.EncryptedCardNumberOption; } set { this.EncryptedCardNumberOption = new Option(value); } } /// - /// The merchant account identifier, with which you want to process the transaction. + /// Used to track the state of SupportedBrands /// - /// The merchant account identifier, with which you want to process the transaction. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SupportedBrandsOption { get; private set; } /// /// The card brands you support. This is the [`brands`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods__resParam_paymentMethods-brands) array from your [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. If not included, our API uses the ones configured for your merchant account and, if provided, the country code. /// /// The card brands you support. This is the [`brands`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods__resParam_paymentMethods-brands) array from your [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. If not included, our API uses the ones configured for your merchant account and, if provided, the country code. - [DataMember(Name = "supportedBrands", EmitDefaultValue = false)] - public List SupportedBrands { get; set; } + [JsonPropertyName("supportedBrands")] + public List SupportedBrands { get { return this.SupportedBrandsOption; } set { this.SupportedBrandsOption = new Option>(value); } } /// /// Returns the string presentation of the object @@ -98,120 +114,174 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class CardDetailsRequest {\n"); sb.Append(" CardNumber: ").Append(CardNumber).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" CountryCode: ").Append(CountryCode).Append("\n"); sb.Append(" EncryptedCardNumber: ").Append(EncryptedCardNumber).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" SupportedBrands: ").Append(SupportedBrands).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // EncryptedCardNumber (string) maxLength + if (this.EncryptedCardNumber != null && this.EncryptedCardNumber.Length > 15000) + { + yield return new ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as CardDetailsRequest); + yield break; } + } + /// + /// A Json converter for type + /// + public class CardDetailsRequestJsonConverter : JsonConverter + { /// - /// Returns true if CardDetailsRequest instances are equal + /// Deserializes json to /// - /// Instance of CardDetailsRequest to be compared - /// Boolean - public bool Equals(CardDetailsRequest input) + /// + /// + /// + /// + /// + public override CardDetailsRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option cardNumber = default; + Option merchantAccount = default; + Option countryCode = default; + Option encryptedCardNumber = default; + Option> supportedBrands = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "cardNumber": + cardNumber = new Option(utf8JsonReader.GetString()); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "countryCode": + countryCode = new Option(utf8JsonReader.GetString()); + break; + case "encryptedCardNumber": + encryptedCardNumber = new Option(utf8JsonReader.GetString()); + break; + case "supportedBrands": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + supportedBrands = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.CardNumber == input.CardNumber || - (this.CardNumber != null && - this.CardNumber.Equals(input.CardNumber)) - ) && - ( - this.CountryCode == input.CountryCode || - (this.CountryCode != null && - this.CountryCode.Equals(input.CountryCode)) - ) && - ( - this.EncryptedCardNumber == input.EncryptedCardNumber || - (this.EncryptedCardNumber != null && - this.EncryptedCardNumber.Equals(input.EncryptedCardNumber)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.SupportedBrands == input.SupportedBrands || - this.SupportedBrands != null && - input.SupportedBrands != null && - this.SupportedBrands.SequenceEqual(input.SupportedBrands) - ); + + if (!cardNumber.IsSet) + throw new ArgumentException("Property is required for class CardDetailsRequest.", nameof(cardNumber)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class CardDetailsRequest.", nameof(merchantAccount)); + + if (cardNumber.IsSet && cardNumber.Value == null) + throw new ArgumentNullException(nameof(cardNumber), "Property is not nullable for class CardDetailsRequest."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class CardDetailsRequest."); + + if (countryCode.IsSet && countryCode.Value == null) + throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class CardDetailsRequest."); + + if (encryptedCardNumber.IsSet && encryptedCardNumber.Value == null) + throw new ArgumentNullException(nameof(encryptedCardNumber), "Property is not nullable for class CardDetailsRequest."); + + if (supportedBrands.IsSet && supportedBrands.Value == null) + throw new ArgumentNullException(nameof(supportedBrands), "Property is not nullable for class CardDetailsRequest."); + + return new CardDetailsRequest(cardNumber.Value, merchantAccount.Value, countryCode, encryptedCardNumber, supportedBrands); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CardDetailsRequest cardDetailsRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CardNumber != null) - { - hashCode = (hashCode * 59) + this.CardNumber.GetHashCode(); - } - if (this.CountryCode != null) - { - hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); - } - if (this.EncryptedCardNumber != null) - { - hashCode = (hashCode * 59) + this.EncryptedCardNumber.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.SupportedBrands != null) - { - hashCode = (hashCode * 59) + this.SupportedBrands.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, cardDetailsRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CardDetailsRequest cardDetailsRequest, JsonSerializerOptions jsonSerializerOptions) { - // EncryptedCardNumber (string) maxLength - if (this.EncryptedCardNumber != null && this.EncryptedCardNumber.Length > 15000) + if (cardDetailsRequest.CardNumber == null) + throw new ArgumentNullException(nameof(cardDetailsRequest.CardNumber), "Property is required for class CardDetailsRequest."); + + if (cardDetailsRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(cardDetailsRequest.MerchantAccount), "Property is required for class CardDetailsRequest."); + + if (cardDetailsRequest.CountryCodeOption.IsSet && cardDetailsRequest.CountryCode == null) + throw new ArgumentNullException(nameof(cardDetailsRequest.CountryCode), "Property is required for class CardDetailsRequest."); + + if (cardDetailsRequest.EncryptedCardNumberOption.IsSet && cardDetailsRequest.EncryptedCardNumber == null) + throw new ArgumentNullException(nameof(cardDetailsRequest.EncryptedCardNumber), "Property is required for class CardDetailsRequest."); + + if (cardDetailsRequest.SupportedBrandsOption.IsSet && cardDetailsRequest.SupportedBrands == null) + throw new ArgumentNullException(nameof(cardDetailsRequest.SupportedBrands), "Property is required for class CardDetailsRequest."); + + writer.WriteString("cardNumber", cardDetailsRequest.CardNumber); + + writer.WriteString("merchantAccount", cardDetailsRequest.MerchantAccount); + + if (cardDetailsRequest.CountryCodeOption.IsSet) + writer.WriteString("countryCode", cardDetailsRequest.CountryCode); + + if (cardDetailsRequest.EncryptedCardNumberOption.IsSet) + writer.WriteString("encryptedCardNumber", cardDetailsRequest.EncryptedCardNumber); + + if (cardDetailsRequest.SupportedBrandsOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); + writer.WritePropertyName("supportedBrands"); + JsonSerializer.Serialize(writer, cardDetailsRequest.SupportedBrands, jsonSerializerOptions); } - - yield break; } } - } diff --git a/Adyen/Model/Checkout/CardDetailsResponse.cs b/Adyen/Model/Checkout/CardDetailsResponse.cs index 02ef1affc..17d77c682 100644 --- a/Adyen/Model/Checkout/CardDetailsResponse.cs +++ b/Adyen/Model/Checkout/CardDetailsResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,65 +14,94 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CardDetailsResponse /// - [DataContract(Name = "CardDetailsResponse")] - public partial class CardDetailsResponse : IEquatable, IValidatableObject + public partial class CardDetailsResponse : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The list of brands identified for the card.. - /// The funding source of the card, for example **DEBIT**, **CREDIT**, or **PREPAID**.. - /// Indicates if this is a commercial card or a consumer card. If **true**, it is a commercial card. If **false**, it is a consumer card.. - /// The two-letter country code of the country where the card was issued.. - public CardDetailsResponse(List brands = default(List), string fundingSource = default(string), bool? isCardCommercial = default(bool?), string issuingCountryCode = default(string)) + /// The list of brands identified for the card. + /// The funding source of the card, for example **DEBIT**, **CREDIT**, or **PREPAID**. + /// Indicates if this is a commercial card or a consumer card. If **true**, it is a commercial card. If **false**, it is a consumer card. + /// The two-letter country code of the country where the card was issued. + [JsonConstructor] + public CardDetailsResponse(Option> brands = default, Option fundingSource = default, Option isCardCommercial = default, Option issuingCountryCode = default) { - this.Brands = brands; - this.FundingSource = fundingSource; - this.IsCardCommercial = isCardCommercial; - this.IssuingCountryCode = issuingCountryCode; + BrandsOption = brands; + FundingSourceOption = fundingSource; + IsCardCommercialOption = isCardCommercial; + IssuingCountryCodeOption = issuingCountryCode; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Brands + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> BrandsOption { get; private set; } + /// /// The list of brands identified for the card. /// /// The list of brands identified for the card. - [DataMember(Name = "brands", EmitDefaultValue = false)] - public List Brands { get; set; } + [JsonPropertyName("brands")] + public List Brands { get { return this.BrandsOption; } set { this.BrandsOption = new Option>(value); } } + + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// The funding source of the card, for example **DEBIT**, **CREDIT**, or **PREPAID**. /// /// The funding source of the card, for example **DEBIT**, **CREDIT**, or **PREPAID**. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public string FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public string FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + + /// + /// Used to track the state of IsCardCommercial + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IsCardCommercialOption { get; private set; } /// /// Indicates if this is a commercial card or a consumer card. If **true**, it is a commercial card. If **false**, it is a consumer card. /// /// Indicates if this is a commercial card or a consumer card. If **true**, it is a commercial card. If **false**, it is a consumer card. - [DataMember(Name = "isCardCommercial", EmitDefaultValue = false)] - public bool? IsCardCommercial { get; set; } + [JsonPropertyName("isCardCommercial")] + public bool? IsCardCommercial { get { return this.IsCardCommercialOption; } set { this.IsCardCommercialOption = new Option(value); } } + + /// + /// Used to track the state of IssuingCountryCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IssuingCountryCodeOption { get; private set; } /// /// The two-letter country code of the country where the card was issued. /// /// The two-letter country code of the country where the card was issued. - [DataMember(Name = "issuingCountryCode", EmitDefaultValue = false)] - public string IssuingCountryCode { get; set; } + [JsonPropertyName("issuingCountryCode")] + public string IssuingCountryCode { get { return this.IssuingCountryCodeOption; } set { this.IssuingCountryCodeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -92,92 +120,139 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CardDetailsResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CardDetailsResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CardDetailsResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CardDetailsResponse instances are equal - /// - /// Instance of CardDetailsResponse to be compared - /// Boolean - public bool Equals(CardDetailsResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option> brands = default; + Option fundingSource = default; + Option isCardCommercial = default; + Option issuingCountryCode = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "brands": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + brands = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fundingSource": + fundingSource = new Option(utf8JsonReader.GetString()); + break; + case "isCardCommercial": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + isCardCommercial = new Option(utf8JsonReader.GetBoolean()); + break; + case "issuingCountryCode": + issuingCountryCode = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Brands == input.Brands || - this.Brands != null && - input.Brands != null && - this.Brands.SequenceEqual(input.Brands) - ) && - ( - this.FundingSource == input.FundingSource || - (this.FundingSource != null && - this.FundingSource.Equals(input.FundingSource)) - ) && - ( - this.IsCardCommercial == input.IsCardCommercial || - this.IsCardCommercial.Equals(input.IsCardCommercial) - ) && - ( - this.IssuingCountryCode == input.IssuingCountryCode || - (this.IssuingCountryCode != null && - this.IssuingCountryCode.Equals(input.IssuingCountryCode)) - ); + + if (brands.IsSet && brands.Value == null) + throw new ArgumentNullException(nameof(brands), "Property is not nullable for class CardDetailsResponse."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class CardDetailsResponse."); + + if (isCardCommercial.IsSet && isCardCommercial.Value == null) + throw new ArgumentNullException(nameof(isCardCommercial), "Property is not nullable for class CardDetailsResponse."); + + if (issuingCountryCode.IsSet && issuingCountryCode.Value == null) + throw new ArgumentNullException(nameof(issuingCountryCode), "Property is not nullable for class CardDetailsResponse."); + + return new CardDetailsResponse(brands, fundingSource, isCardCommercial, issuingCountryCode); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CardDetailsResponse cardDetailsResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Brands != null) - { - hashCode = (hashCode * 59) + this.Brands.GetHashCode(); - } - if (this.FundingSource != null) - { - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - } - hashCode = (hashCode * 59) + this.IsCardCommercial.GetHashCode(); - if (this.IssuingCountryCode != null) - { - hashCode = (hashCode * 59) + this.IssuingCountryCode.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, cardDetailsResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CardDetailsResponse cardDetailsResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (cardDetailsResponse.BrandsOption.IsSet && cardDetailsResponse.Brands == null) + throw new ArgumentNullException(nameof(cardDetailsResponse.Brands), "Property is required for class CardDetailsResponse."); + + if (cardDetailsResponse.FundingSourceOption.IsSet && cardDetailsResponse.FundingSource == null) + throw new ArgumentNullException(nameof(cardDetailsResponse.FundingSource), "Property is required for class CardDetailsResponse."); + + if (cardDetailsResponse.IssuingCountryCodeOption.IsSet && cardDetailsResponse.IssuingCountryCode == null) + throw new ArgumentNullException(nameof(cardDetailsResponse.IssuingCountryCode), "Property is required for class CardDetailsResponse."); + + if (cardDetailsResponse.BrandsOption.IsSet) + { + writer.WritePropertyName("brands"); + JsonSerializer.Serialize(writer, cardDetailsResponse.Brands, jsonSerializerOptions); + } + if (cardDetailsResponse.FundingSourceOption.IsSet) + writer.WriteString("fundingSource", cardDetailsResponse.FundingSource); + + if (cardDetailsResponse.IsCardCommercialOption.IsSet) + writer.WriteBoolean("isCardCommercial", cardDetailsResponse.IsCardCommercialOption.Value.Value); + + if (cardDetailsResponse.IssuingCountryCodeOption.IsSet) + writer.WriteString("issuingCountryCode", cardDetailsResponse.IssuingCountryCode); } } - } diff --git a/Adyen/Model/Checkout/CardDonations.cs b/Adyen/Model/Checkout/CardDonations.cs index 13a88d4f8..0b8b14ae5 100644 --- a/Adyen/Model/Checkout/CardDonations.cs +++ b/Adyen/Model/Checkout/CardDonations.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,321 +14,621 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CardDonations /// - [DataContract(Name = "CardDonations")] - public partial class CardDonations : IEquatable, IValidatableObject + public partial class CardDonations : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Secondary brand of the card. For example: **plastix**, **hmclub**. + /// The checkout attempt identifier. + /// cupsecureplusSmscode + /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. + /// The encrypted card number. + /// The encrypted card expiry month. + /// The encrypted card expiry year. + /// The encrypted card verification code. + /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + /// The encoded fastlane data blob + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + /// The name of the card holder. + /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. + /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. + /// An identifier used for the Click to Pay transaction. + /// The SRC reference for the Click to Pay token. + /// The scheme that is being used for Click to Pay. + /// The reference for the Click to Pay token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. + /// Default payment method details. Common for scheme payment methods, and for simple payment method details. (default to TypeEnum.Scheme) + [JsonConstructor] + public CardDonations(Option brand = default, Option checkoutAttemptId = default, Option cupsecureplusSmscode = default, Option cvc = default, Option encryptedCard = default, Option encryptedCardNumber = default, Option encryptedExpiryMonth = default, Option encryptedExpiryYear = default, Option encryptedSecurityCode = default, Option expiryMonth = default, Option expiryYear = default, Option fastlaneData = default, Option fundingSource = default, Option holderName = default, Option networkPaymentReference = default, Option number = default, Option recurringDetailReference = default, Option shopperNotificationReference = default, Option srcCorrelationId = default, Option srcDigitalCardId = default, Option srcScheme = default, Option srcTokenReference = default, Option storedPaymentMethodId = default, Option threeDS2SdkVersion = default, Option type = default) + { + BrandOption = brand; + CheckoutAttemptIdOption = checkoutAttemptId; + CupsecureplusSmscodeOption = cupsecureplusSmscode; + CvcOption = cvc; + EncryptedCardOption = encryptedCard; + EncryptedCardNumberOption = encryptedCardNumber; + EncryptedExpiryMonthOption = encryptedExpiryMonth; + EncryptedExpiryYearOption = encryptedExpiryYear; + EncryptedSecurityCodeOption = encryptedSecurityCode; + ExpiryMonthOption = expiryMonth; + ExpiryYearOption = expiryYear; + FastlaneDataOption = fastlaneData; + FundingSourceOption = fundingSource; + HolderNameOption = holderName; + NetworkPaymentReferenceOption = networkPaymentReference; + NumberOption = number; + RecurringDetailReferenceOption = recurringDetailReference; + ShopperNotificationReferenceOption = shopperNotificationReference; + SrcCorrelationIdOption = srcCorrelationId; + SrcDigitalCardIdOption = srcDigitalCardId; + SrcSchemeOption = srcScheme; + SrcTokenReferenceOption = srcTokenReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + ThreeDS2SdkVersionOption = threeDS2SdkVersion; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// - [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// - [EnumMember(Value = "debit")] Debit = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static FundingSourceEnum FundingSourceEnumFromString(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) + { + if (value == FundingSourceEnum.Credit) + return "credit"; + + if (value == FundingSourceEnum.Debit) + return "debit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public FundingSourceEnum? FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Bcmc for value: bcmc /// - [EnumMember(Value = "bcmc")] Bcmc = 1, /// /// Enum Scheme for value: scheme /// - [EnumMember(Value = "scheme")] Scheme = 2, /// /// Enum NetworkToken for value: networkToken /// - [EnumMember(Value = "networkToken")] NetworkToken = 3, /// /// Enum Giftcard for value: giftcard /// - [EnumMember(Value = "giftcard")] Giftcard = 4, /// /// Enum Card for value: card /// - [EnumMember(Value = "card")] Card = 5, /// /// Enum Clicktopay for value: clicktopay /// - [EnumMember(Value = "clicktopay")] Clicktopay = 6 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("bcmc")) + return TypeEnum.Bcmc; + + if (value.Equals("scheme")) + return TypeEnum.Scheme; + + if (value.Equals("networkToken")) + return TypeEnum.NetworkToken; + + if (value.Equals("giftcard")) + return TypeEnum.Giftcard; + + if (value.Equals("card")) + return TypeEnum.Card; + if (value.Equals("clicktopay")) + return TypeEnum.Clicktopay; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("bcmc")) + return TypeEnum.Bcmc; + + if (value.Equals("scheme")) + return TypeEnum.Scheme; + + if (value.Equals("networkToken")) + return TypeEnum.NetworkToken; + + if (value.Equals("giftcard")) + return TypeEnum.Giftcard; + + if (value.Equals("card")) + return TypeEnum.Card; + + if (value.Equals("clicktopay")) + return TypeEnum.Clicktopay; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Bcmc) + return "bcmc"; + + if (value == TypeEnum.Scheme) + return "scheme"; + + if (value == TypeEnum.NetworkToken) + return "networkToken"; + + if (value == TypeEnum.Giftcard) + return "giftcard"; + + if (value == TypeEnum.Card) + return "card"; + + if (value == TypeEnum.Clicktopay) + return "clicktopay"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of Brand /// - /// Secondary brand of the card. For example: **plastix**, **hmclub**.. - /// The checkout attempt identifier.. - /// cupsecureplusSmscode. - /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. - /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details.. - /// The encrypted card number.. - /// The encrypted card expiry month.. - /// The encrypted card expiry year.. - /// The encrypted card verification code.. - /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. - /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. - /// The encoded fastlane data blob. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. - /// The name of the card holder.. - /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment.. - /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India.. - /// An identifier used for the Click to Pay transaction.. - /// The SRC reference for the Click to Pay token.. - /// The scheme that is being used for Click to Pay.. - /// The reference for the Click to Pay token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK.. - /// Default payment method details. Common for scheme payment methods, and for simple payment method details. (default to TypeEnum.Scheme). - public CardDonations(string brand = default(string), string checkoutAttemptId = default(string), string cupsecureplusSmscode = default(string), string cvc = default(string), string encryptedCard = default(string), string encryptedCardNumber = default(string), string encryptedExpiryMonth = default(string), string encryptedExpiryYear = default(string), string encryptedSecurityCode = default(string), string expiryMonth = default(string), string expiryYear = default(string), string fastlaneData = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string holderName = default(string), string networkPaymentReference = default(string), string number = default(string), string recurringDetailReference = default(string), string shopperNotificationReference = default(string), string srcCorrelationId = default(string), string srcDigitalCardId = default(string), string srcScheme = default(string), string srcTokenReference = default(string), string storedPaymentMethodId = default(string), string threeDS2SdkVersion = default(string), TypeEnum? type = TypeEnum.Scheme) - { - this.Brand = brand; - this.CheckoutAttemptId = checkoutAttemptId; - this.CupsecureplusSmscode = cupsecureplusSmscode; - this.Cvc = cvc; - this.EncryptedCard = encryptedCard; - this.EncryptedCardNumber = encryptedCardNumber; - this.EncryptedExpiryMonth = encryptedExpiryMonth; - this.EncryptedExpiryYear = encryptedExpiryYear; - this.EncryptedSecurityCode = encryptedSecurityCode; - this.ExpiryMonth = expiryMonth; - this.ExpiryYear = expiryYear; - this.FastlaneData = fastlaneData; - this.FundingSource = fundingSource; - this.HolderName = holderName; - this.NetworkPaymentReference = networkPaymentReference; - this.Number = number; - this.RecurringDetailReference = recurringDetailReference; - this.ShopperNotificationReference = shopperNotificationReference; - this.SrcCorrelationId = srcCorrelationId; - this.SrcDigitalCardId = srcDigitalCardId; - this.SrcScheme = srcScheme; - this.SrcTokenReference = srcTokenReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.ThreeDS2SdkVersion = threeDS2SdkVersion; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandOption { get; private set; } /// /// Secondary brand of the card. For example: **plastix**, **hmclub**. /// /// Secondary brand of the card. For example: **plastix**, **hmclub**. - [DataMember(Name = "brand", EmitDefaultValue = false)] - public string Brand { get; set; } + [JsonPropertyName("brand")] + public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of CupsecureplusSmscode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CupsecureplusSmscodeOption { get; private set; } /// /// Gets or Sets CupsecureplusSmscode /// - [DataMember(Name = "cupsecureplus.smscode", EmitDefaultValue = false)] - [Obsolete("")] - public string CupsecureplusSmscode { get; set; } + [JsonPropertyName("cupsecureplus.smscode")] + [Obsolete] + public string CupsecureplusSmscode { get { return this.CupsecureplusSmscodeOption; } set { this.CupsecureplusSmscodeOption = new Option(value); } } + + /// + /// Used to track the state of Cvc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CvcOption { get; private set; } /// /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [DataMember(Name = "cvc", EmitDefaultValue = false)] - public string Cvc { get; set; } + [JsonPropertyName("cvc")] + public string Cvc { get { return this.CvcOption; } set { this.CvcOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedCard + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedCardOption { get; private set; } /// /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. /// /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. - [DataMember(Name = "encryptedCard", EmitDefaultValue = false)] - public string EncryptedCard { get; set; } + [JsonPropertyName("encryptedCard")] + public string EncryptedCard { get { return this.EncryptedCardOption; } set { this.EncryptedCardOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedCardNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedCardNumberOption { get; private set; } /// /// The encrypted card number. /// /// The encrypted card number. - [DataMember(Name = "encryptedCardNumber", EmitDefaultValue = false)] - public string EncryptedCardNumber { get; set; } + [JsonPropertyName("encryptedCardNumber")] + public string EncryptedCardNumber { get { return this.EncryptedCardNumberOption; } set { this.EncryptedCardNumberOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedExpiryMonth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedExpiryMonthOption { get; private set; } /// /// The encrypted card expiry month. /// /// The encrypted card expiry month. - [DataMember(Name = "encryptedExpiryMonth", EmitDefaultValue = false)] - public string EncryptedExpiryMonth { get; set; } + [JsonPropertyName("encryptedExpiryMonth")] + public string EncryptedExpiryMonth { get { return this.EncryptedExpiryMonthOption; } set { this.EncryptedExpiryMonthOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedExpiryYear + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedExpiryYearOption { get; private set; } /// /// The encrypted card expiry year. /// /// The encrypted card expiry year. - [DataMember(Name = "encryptedExpiryYear", EmitDefaultValue = false)] - public string EncryptedExpiryYear { get; set; } + [JsonPropertyName("encryptedExpiryYear")] + public string EncryptedExpiryYear { get { return this.EncryptedExpiryYearOption; } set { this.EncryptedExpiryYearOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedSecurityCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedSecurityCodeOption { get; private set; } /// /// The encrypted card verification code. /// /// The encrypted card verification code. - [DataMember(Name = "encryptedSecurityCode", EmitDefaultValue = false)] - public string EncryptedSecurityCode { get; set; } + [JsonPropertyName("encryptedSecurityCode")] + public string EncryptedSecurityCode { get { return this.EncryptedSecurityCodeOption; } set { this.EncryptedSecurityCodeOption = new Option(value); } } + + /// + /// Used to track the state of ExpiryMonth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiryMonthOption { get; private set; } /// /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [DataMember(Name = "expiryMonth", EmitDefaultValue = false)] - public string ExpiryMonth { get; set; } + [JsonPropertyName("expiryMonth")] + public string ExpiryMonth { get { return this.ExpiryMonthOption; } set { this.ExpiryMonthOption = new Option(value); } } + + /// + /// Used to track the state of ExpiryYear + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiryYearOption { get; private set; } /// /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [DataMember(Name = "expiryYear", EmitDefaultValue = false)] - public string ExpiryYear { get; set; } + [JsonPropertyName("expiryYear")] + public string ExpiryYear { get { return this.ExpiryYearOption; } set { this.ExpiryYearOption = new Option(value); } } + + /// + /// Used to track the state of FastlaneData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FastlaneDataOption { get; private set; } /// /// The encoded fastlane data blob /// /// The encoded fastlane data blob - [DataMember(Name = "fastlaneData", EmitDefaultValue = false)] - public string FastlaneData { get; set; } + [JsonPropertyName("fastlaneData")] + public string FastlaneData { get { return this.FastlaneDataOption; } set { this.FastlaneDataOption = new Option(value); } } + + /// + /// Used to track the state of HolderName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option HolderNameOption { get; private set; } /// /// The name of the card holder. /// /// The name of the card holder. - [DataMember(Name = "holderName", EmitDefaultValue = false)] - public string HolderName { get; set; } + [JsonPropertyName("holderName")] + public string HolderName { get { return this.HolderNameOption; } set { this.HolderNameOption = new Option(value); } } + + /// + /// Used to track the state of NetworkPaymentReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NetworkPaymentReferenceOption { get; private set; } /// /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. /// /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. - [DataMember(Name = "networkPaymentReference", EmitDefaultValue = false)] - public string NetworkPaymentReference { get; set; } + [JsonPropertyName("networkPaymentReference")] + public string NetworkPaymentReference { get { return this.NetworkPaymentReferenceOption; } set { this.NetworkPaymentReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Number + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NumberOption { get; private set; } /// /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [DataMember(Name = "number", EmitDefaultValue = false)] - public string Number { get; set; } + [JsonPropertyName("number")] + public string Number { get { return this.NumberOption; } set { this.NumberOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperNotificationReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNotificationReferenceOption { get; private set; } /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. - [DataMember(Name = "shopperNotificationReference", EmitDefaultValue = false)] - public string ShopperNotificationReference { get; set; } + [JsonPropertyName("shopperNotificationReference")] + public string ShopperNotificationReference { get { return this.ShopperNotificationReferenceOption; } set { this.ShopperNotificationReferenceOption = new Option(value); } } + + /// + /// Used to track the state of SrcCorrelationId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SrcCorrelationIdOption { get; private set; } /// /// An identifier used for the Click to Pay transaction. /// /// An identifier used for the Click to Pay transaction. - [DataMember(Name = "srcCorrelationId", EmitDefaultValue = false)] - public string SrcCorrelationId { get; set; } + [JsonPropertyName("srcCorrelationId")] + public string SrcCorrelationId { get { return this.SrcCorrelationIdOption; } set { this.SrcCorrelationIdOption = new Option(value); } } + + /// + /// Used to track the state of SrcDigitalCardId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SrcDigitalCardIdOption { get; private set; } /// /// The SRC reference for the Click to Pay token. /// /// The SRC reference for the Click to Pay token. - [DataMember(Name = "srcDigitalCardId", EmitDefaultValue = false)] - public string SrcDigitalCardId { get; set; } + [JsonPropertyName("srcDigitalCardId")] + public string SrcDigitalCardId { get { return this.SrcDigitalCardIdOption; } set { this.SrcDigitalCardIdOption = new Option(value); } } + + /// + /// Used to track the state of SrcScheme + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SrcSchemeOption { get; private set; } /// /// The scheme that is being used for Click to Pay. /// /// The scheme that is being used for Click to Pay. - [DataMember(Name = "srcScheme", EmitDefaultValue = false)] - public string SrcScheme { get; set; } + [JsonPropertyName("srcScheme")] + public string SrcScheme { get { return this.SrcSchemeOption; } set { this.SrcSchemeOption = new Option(value); } } + + /// + /// Used to track the state of SrcTokenReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SrcTokenReferenceOption { get; private set; } /// /// The reference for the Click to Pay token. /// /// The reference for the Click to Pay token. - [DataMember(Name = "srcTokenReference", EmitDefaultValue = false)] - public string SrcTokenReference { get; set; } + [JsonPropertyName("srcTokenReference")] + public string SrcTokenReference { get { return this.SrcTokenReferenceOption; } set { this.SrcTokenReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2SdkVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2SdkVersionOption { get; private set; } /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - [DataMember(Name = "threeDS2SdkVersion", EmitDefaultValue = false)] - public string ThreeDS2SdkVersion { get; set; } + [JsonPropertyName("threeDS2SdkVersion")] + public string ThreeDS2SdkVersion { get { return this.ThreeDS2SdkVersionOption; } set { this.ThreeDS2SdkVersionOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -368,325 +667,457 @@ public override string ToString() return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as CardDonations); - } - - /// - /// Returns true if CardDonations instances are equal - /// - /// Instance of CardDonations to be compared - /// Boolean - public bool Equals(CardDonations input) - { - if (input == null) - { - return false; - } - return - ( - this.Brand == input.Brand || - (this.Brand != null && - this.Brand.Equals(input.Brand)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.CupsecureplusSmscode == input.CupsecureplusSmscode || - (this.CupsecureplusSmscode != null && - this.CupsecureplusSmscode.Equals(input.CupsecureplusSmscode)) - ) && - ( - this.Cvc == input.Cvc || - (this.Cvc != null && - this.Cvc.Equals(input.Cvc)) - ) && - ( - this.EncryptedCard == input.EncryptedCard || - (this.EncryptedCard != null && - this.EncryptedCard.Equals(input.EncryptedCard)) - ) && - ( - this.EncryptedCardNumber == input.EncryptedCardNumber || - (this.EncryptedCardNumber != null && - this.EncryptedCardNumber.Equals(input.EncryptedCardNumber)) - ) && - ( - this.EncryptedExpiryMonth == input.EncryptedExpiryMonth || - (this.EncryptedExpiryMonth != null && - this.EncryptedExpiryMonth.Equals(input.EncryptedExpiryMonth)) - ) && - ( - this.EncryptedExpiryYear == input.EncryptedExpiryYear || - (this.EncryptedExpiryYear != null && - this.EncryptedExpiryYear.Equals(input.EncryptedExpiryYear)) - ) && - ( - this.EncryptedSecurityCode == input.EncryptedSecurityCode || - (this.EncryptedSecurityCode != null && - this.EncryptedSecurityCode.Equals(input.EncryptedSecurityCode)) - ) && - ( - this.ExpiryMonth == input.ExpiryMonth || - (this.ExpiryMonth != null && - this.ExpiryMonth.Equals(input.ExpiryMonth)) - ) && - ( - this.ExpiryYear == input.ExpiryYear || - (this.ExpiryYear != null && - this.ExpiryYear.Equals(input.ExpiryYear)) - ) && - ( - this.FastlaneData == input.FastlaneData || - (this.FastlaneData != null && - this.FastlaneData.Equals(input.FastlaneData)) - ) && - ( - this.FundingSource == input.FundingSource || - this.FundingSource.Equals(input.FundingSource) - ) && - ( - this.HolderName == input.HolderName || - (this.HolderName != null && - this.HolderName.Equals(input.HolderName)) - ) && - ( - this.NetworkPaymentReference == input.NetworkPaymentReference || - (this.NetworkPaymentReference != null && - this.NetworkPaymentReference.Equals(input.NetworkPaymentReference)) - ) && - ( - this.Number == input.Number || - (this.Number != null && - this.Number.Equals(input.Number)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.ShopperNotificationReference == input.ShopperNotificationReference || - (this.ShopperNotificationReference != null && - this.ShopperNotificationReference.Equals(input.ShopperNotificationReference)) - ) && - ( - this.SrcCorrelationId == input.SrcCorrelationId || - (this.SrcCorrelationId != null && - this.SrcCorrelationId.Equals(input.SrcCorrelationId)) - ) && - ( - this.SrcDigitalCardId == input.SrcDigitalCardId || - (this.SrcDigitalCardId != null && - this.SrcDigitalCardId.Equals(input.SrcDigitalCardId)) - ) && - ( - this.SrcScheme == input.SrcScheme || - (this.SrcScheme != null && - this.SrcScheme.Equals(input.SrcScheme)) - ) && - ( - this.SrcTokenReference == input.SrcTokenReference || - (this.SrcTokenReference != null && - this.SrcTokenReference.Equals(input.SrcTokenReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.ThreeDS2SdkVersion == input.ThreeDS2SdkVersion || - (this.ThreeDS2SdkVersion != null && - this.ThreeDS2SdkVersion.Equals(input.ThreeDS2SdkVersion)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Brand != null) - { - hashCode = (hashCode * 59) + this.Brand.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.CupsecureplusSmscode != null) - { - hashCode = (hashCode * 59) + this.CupsecureplusSmscode.GetHashCode(); - } - if (this.Cvc != null) - { - hashCode = (hashCode * 59) + this.Cvc.GetHashCode(); - } - if (this.EncryptedCard != null) - { - hashCode = (hashCode * 59) + this.EncryptedCard.GetHashCode(); - } - if (this.EncryptedCardNumber != null) - { - hashCode = (hashCode * 59) + this.EncryptedCardNumber.GetHashCode(); - } - if (this.EncryptedExpiryMonth != null) - { - hashCode = (hashCode * 59) + this.EncryptedExpiryMonth.GetHashCode(); - } - if (this.EncryptedExpiryYear != null) - { - hashCode = (hashCode * 59) + this.EncryptedExpiryYear.GetHashCode(); - } - if (this.EncryptedSecurityCode != null) - { - hashCode = (hashCode * 59) + this.EncryptedSecurityCode.GetHashCode(); - } - if (this.ExpiryMonth != null) - { - hashCode = (hashCode * 59) + this.ExpiryMonth.GetHashCode(); - } - if (this.ExpiryYear != null) - { - hashCode = (hashCode * 59) + this.ExpiryYear.GetHashCode(); - } - if (this.FastlaneData != null) - { - hashCode = (hashCode * 59) + this.FastlaneData.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - if (this.HolderName != null) - { - hashCode = (hashCode * 59) + this.HolderName.GetHashCode(); - } - if (this.NetworkPaymentReference != null) - { - hashCode = (hashCode * 59) + this.NetworkPaymentReference.GetHashCode(); - } - if (this.Number != null) - { - hashCode = (hashCode * 59) + this.Number.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.ShopperNotificationReference != null) - { - hashCode = (hashCode * 59) + this.ShopperNotificationReference.GetHashCode(); - } - if (this.SrcCorrelationId != null) - { - hashCode = (hashCode * 59) + this.SrcCorrelationId.GetHashCode(); - } - if (this.SrcDigitalCardId != null) - { - hashCode = (hashCode * 59) + this.SrcDigitalCardId.GetHashCode(); - } - if (this.SrcScheme != null) - { - hashCode = (hashCode * 59) + this.SrcScheme.GetHashCode(); - } - if (this.SrcTokenReference != null) - { - hashCode = (hashCode * 59) + this.SrcTokenReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.ThreeDS2SdkVersion != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2SdkVersion.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // EncryptedCard (string) maxLength if (this.EncryptedCard != null && this.EncryptedCard.Length > 40000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCard, length must be less than 40000.", new [] { "EncryptedCard" }); + yield return new ValidationResult("Invalid value for EncryptedCard, length must be less than 40000.", new [] { "EncryptedCard" }); } // EncryptedCardNumber (string) maxLength if (this.EncryptedCardNumber != null && this.EncryptedCardNumber.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); + yield return new ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); } // EncryptedExpiryMonth (string) maxLength if (this.EncryptedExpiryMonth != null && this.EncryptedExpiryMonth.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedExpiryMonth, length must be less than 15000.", new [] { "EncryptedExpiryMonth" }); + yield return new ValidationResult("Invalid value for EncryptedExpiryMonth, length must be less than 15000.", new [] { "EncryptedExpiryMonth" }); } // EncryptedExpiryYear (string) maxLength if (this.EncryptedExpiryYear != null && this.EncryptedExpiryYear.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedExpiryYear, length must be less than 15000.", new [] { "EncryptedExpiryYear" }); + yield return new ValidationResult("Invalid value for EncryptedExpiryYear, length must be less than 15000.", new [] { "EncryptedExpiryYear" }); } // EncryptedSecurityCode (string) maxLength if (this.EncryptedSecurityCode != null && this.EncryptedSecurityCode.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedSecurityCode, length must be less than 15000.", new [] { "EncryptedSecurityCode" }); + yield return new ValidationResult("Invalid value for EncryptedSecurityCode, length must be less than 15000.", new [] { "EncryptedSecurityCode" }); } // HolderName (string) maxLength if (this.HolderName != null && this.HolderName.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for HolderName, length must be less than 15000.", new [] { "HolderName" }); + yield return new ValidationResult("Invalid value for HolderName, length must be less than 15000.", new [] { "HolderName" }); } // StoredPaymentMethodId (string) maxLength if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); } // ThreeDS2SdkVersion (string) maxLength if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); + yield return new ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); } yield break; } } + /// + /// A Json converter for type + /// + public class CardDonationsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override CardDonations Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option brand = default; + Option checkoutAttemptId = default; + Option cupsecureplusSmscode = default; + Option cvc = default; + Option encryptedCard = default; + Option encryptedCardNumber = default; + Option encryptedExpiryMonth = default; + Option encryptedExpiryYear = default; + Option encryptedSecurityCode = default; + Option expiryMonth = default; + Option expiryYear = default; + Option fastlaneData = default; + Option fundingSource = default; + Option holderName = default; + Option networkPaymentReference = default; + Option number = default; + Option recurringDetailReference = default; + Option shopperNotificationReference = default; + Option srcCorrelationId = default; + Option srcDigitalCardId = default; + Option srcScheme = default; + Option srcTokenReference = default; + Option storedPaymentMethodId = default; + Option threeDS2SdkVersion = default; + Option type = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "brand": + brand = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "cupsecureplus.smscode": + cupsecureplusSmscode = new Option(utf8JsonReader.GetString()); + break; + case "cvc": + cvc = new Option(utf8JsonReader.GetString()); + break; + case "encryptedCard": + encryptedCard = new Option(utf8JsonReader.GetString()); + break; + case "encryptedCardNumber": + encryptedCardNumber = new Option(utf8JsonReader.GetString()); + break; + case "encryptedExpiryMonth": + encryptedExpiryMonth = new Option(utf8JsonReader.GetString()); + break; + case "encryptedExpiryYear": + encryptedExpiryYear = new Option(utf8JsonReader.GetString()); + break; + case "encryptedSecurityCode": + encryptedSecurityCode = new Option(utf8JsonReader.GetString()); + break; + case "expiryMonth": + expiryMonth = new Option(utf8JsonReader.GetString()); + break; + case "expiryYear": + expiryYear = new Option(utf8JsonReader.GetString()); + break; + case "fastlaneData": + fastlaneData = new Option(utf8JsonReader.GetString()); + break; + case "fundingSource": + string fundingSourceRawValue = utf8JsonReader.GetString(); + if (fundingSourceRawValue != null) + fundingSource = new Option(CardDonations.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); + break; + case "holderName": + holderName = new Option(utf8JsonReader.GetString()); + break; + case "networkPaymentReference": + networkPaymentReference = new Option(utf8JsonReader.GetString()); + break; + case "number": + number = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "shopperNotificationReference": + shopperNotificationReference = new Option(utf8JsonReader.GetString()); + break; + case "srcCorrelationId": + srcCorrelationId = new Option(utf8JsonReader.GetString()); + break; + case "srcDigitalCardId": + srcDigitalCardId = new Option(utf8JsonReader.GetString()); + break; + case "srcScheme": + srcScheme = new Option(utf8JsonReader.GetString()); + break; + case "srcTokenReference": + srcTokenReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2SdkVersion": + threeDS2SdkVersion = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(CardDonations.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } + } + + if (brand.IsSet && brand.Value == null) + throw new ArgumentNullException(nameof(brand), "Property is not nullable for class CardDonations."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class CardDonations."); + + if (cupsecureplusSmscode.IsSet && cupsecureplusSmscode.Value == null) + throw new ArgumentNullException(nameof(cupsecureplusSmscode), "Property is not nullable for class CardDonations."); + + if (cvc.IsSet && cvc.Value == null) + throw new ArgumentNullException(nameof(cvc), "Property is not nullable for class CardDonations."); + + if (encryptedCard.IsSet && encryptedCard.Value == null) + throw new ArgumentNullException(nameof(encryptedCard), "Property is not nullable for class CardDonations."); + + if (encryptedCardNumber.IsSet && encryptedCardNumber.Value == null) + throw new ArgumentNullException(nameof(encryptedCardNumber), "Property is not nullable for class CardDonations."); + + if (encryptedExpiryMonth.IsSet && encryptedExpiryMonth.Value == null) + throw new ArgumentNullException(nameof(encryptedExpiryMonth), "Property is not nullable for class CardDonations."); + + if (encryptedExpiryYear.IsSet && encryptedExpiryYear.Value == null) + throw new ArgumentNullException(nameof(encryptedExpiryYear), "Property is not nullable for class CardDonations."); + + if (encryptedSecurityCode.IsSet && encryptedSecurityCode.Value == null) + throw new ArgumentNullException(nameof(encryptedSecurityCode), "Property is not nullable for class CardDonations."); + + if (expiryMonth.IsSet && expiryMonth.Value == null) + throw new ArgumentNullException(nameof(expiryMonth), "Property is not nullable for class CardDonations."); + + if (expiryYear.IsSet && expiryYear.Value == null) + throw new ArgumentNullException(nameof(expiryYear), "Property is not nullable for class CardDonations."); + + if (fastlaneData.IsSet && fastlaneData.Value == null) + throw new ArgumentNullException(nameof(fastlaneData), "Property is not nullable for class CardDonations."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class CardDonations."); + + if (holderName.IsSet && holderName.Value == null) + throw new ArgumentNullException(nameof(holderName), "Property is not nullable for class CardDonations."); + + if (networkPaymentReference.IsSet && networkPaymentReference.Value == null) + throw new ArgumentNullException(nameof(networkPaymentReference), "Property is not nullable for class CardDonations."); + + if (number.IsSet && number.Value == null) + throw new ArgumentNullException(nameof(number), "Property is not nullable for class CardDonations."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class CardDonations."); + + if (shopperNotificationReference.IsSet && shopperNotificationReference.Value == null) + throw new ArgumentNullException(nameof(shopperNotificationReference), "Property is not nullable for class CardDonations."); + + if (srcCorrelationId.IsSet && srcCorrelationId.Value == null) + throw new ArgumentNullException(nameof(srcCorrelationId), "Property is not nullable for class CardDonations."); + + if (srcDigitalCardId.IsSet && srcDigitalCardId.Value == null) + throw new ArgumentNullException(nameof(srcDigitalCardId), "Property is not nullable for class CardDonations."); + + if (srcScheme.IsSet && srcScheme.Value == null) + throw new ArgumentNullException(nameof(srcScheme), "Property is not nullable for class CardDonations."); + + if (srcTokenReference.IsSet && srcTokenReference.Value == null) + throw new ArgumentNullException(nameof(srcTokenReference), "Property is not nullable for class CardDonations."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class CardDonations."); + + if (threeDS2SdkVersion.IsSet && threeDS2SdkVersion.Value == null) + throw new ArgumentNullException(nameof(threeDS2SdkVersion), "Property is not nullable for class CardDonations."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CardDonations."); + + return new CardDonations(brand, checkoutAttemptId, cupsecureplusSmscode, cvc, encryptedCard, encryptedCardNumber, encryptedExpiryMonth, encryptedExpiryYear, encryptedSecurityCode, expiryMonth, expiryYear, fastlaneData, fundingSource, holderName, networkPaymentReference, number, recurringDetailReference, shopperNotificationReference, srcCorrelationId, srcDigitalCardId, srcScheme, srcTokenReference, storedPaymentMethodId, threeDS2SdkVersion, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CardDonations cardDonations, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, cardDonations, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CardDonations cardDonations, JsonSerializerOptions jsonSerializerOptions) + { + if (cardDonations.BrandOption.IsSet && cardDonations.Brand == null) + throw new ArgumentNullException(nameof(cardDonations.Brand), "Property is required for class CardDonations."); + + if (cardDonations.CheckoutAttemptIdOption.IsSet && cardDonations.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(cardDonations.CheckoutAttemptId), "Property is required for class CardDonations."); + + if (cardDonations.CupsecureplusSmscodeOption.IsSet && cardDonations.CupsecureplusSmscode == null) + throw new ArgumentNullException(nameof(cardDonations.CupsecureplusSmscode), "Property is required for class CardDonations."); + + if (cardDonations.CvcOption.IsSet && cardDonations.Cvc == null) + throw new ArgumentNullException(nameof(cardDonations.Cvc), "Property is required for class CardDonations."); + + if (cardDonations.EncryptedCardOption.IsSet && cardDonations.EncryptedCard == null) + throw new ArgumentNullException(nameof(cardDonations.EncryptedCard), "Property is required for class CardDonations."); + + if (cardDonations.EncryptedCardNumberOption.IsSet && cardDonations.EncryptedCardNumber == null) + throw new ArgumentNullException(nameof(cardDonations.EncryptedCardNumber), "Property is required for class CardDonations."); + + if (cardDonations.EncryptedExpiryMonthOption.IsSet && cardDonations.EncryptedExpiryMonth == null) + throw new ArgumentNullException(nameof(cardDonations.EncryptedExpiryMonth), "Property is required for class CardDonations."); + + if (cardDonations.EncryptedExpiryYearOption.IsSet && cardDonations.EncryptedExpiryYear == null) + throw new ArgumentNullException(nameof(cardDonations.EncryptedExpiryYear), "Property is required for class CardDonations."); + + if (cardDonations.EncryptedSecurityCodeOption.IsSet && cardDonations.EncryptedSecurityCode == null) + throw new ArgumentNullException(nameof(cardDonations.EncryptedSecurityCode), "Property is required for class CardDonations."); + + if (cardDonations.ExpiryMonthOption.IsSet && cardDonations.ExpiryMonth == null) + throw new ArgumentNullException(nameof(cardDonations.ExpiryMonth), "Property is required for class CardDonations."); + + if (cardDonations.ExpiryYearOption.IsSet && cardDonations.ExpiryYear == null) + throw new ArgumentNullException(nameof(cardDonations.ExpiryYear), "Property is required for class CardDonations."); + + if (cardDonations.FastlaneDataOption.IsSet && cardDonations.FastlaneData == null) + throw new ArgumentNullException(nameof(cardDonations.FastlaneData), "Property is required for class CardDonations."); + + if (cardDonations.HolderNameOption.IsSet && cardDonations.HolderName == null) + throw new ArgumentNullException(nameof(cardDonations.HolderName), "Property is required for class CardDonations."); + + if (cardDonations.NetworkPaymentReferenceOption.IsSet && cardDonations.NetworkPaymentReference == null) + throw new ArgumentNullException(nameof(cardDonations.NetworkPaymentReference), "Property is required for class CardDonations."); + + if (cardDonations.NumberOption.IsSet && cardDonations.Number == null) + throw new ArgumentNullException(nameof(cardDonations.Number), "Property is required for class CardDonations."); + + if (cardDonations.RecurringDetailReferenceOption.IsSet && cardDonations.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(cardDonations.RecurringDetailReference), "Property is required for class CardDonations."); + + if (cardDonations.ShopperNotificationReferenceOption.IsSet && cardDonations.ShopperNotificationReference == null) + throw new ArgumentNullException(nameof(cardDonations.ShopperNotificationReference), "Property is required for class CardDonations."); + + if (cardDonations.SrcCorrelationIdOption.IsSet && cardDonations.SrcCorrelationId == null) + throw new ArgumentNullException(nameof(cardDonations.SrcCorrelationId), "Property is required for class CardDonations."); + + if (cardDonations.SrcDigitalCardIdOption.IsSet && cardDonations.SrcDigitalCardId == null) + throw new ArgumentNullException(nameof(cardDonations.SrcDigitalCardId), "Property is required for class CardDonations."); + + if (cardDonations.SrcSchemeOption.IsSet && cardDonations.SrcScheme == null) + throw new ArgumentNullException(nameof(cardDonations.SrcScheme), "Property is required for class CardDonations."); + + if (cardDonations.SrcTokenReferenceOption.IsSet && cardDonations.SrcTokenReference == null) + throw new ArgumentNullException(nameof(cardDonations.SrcTokenReference), "Property is required for class CardDonations."); + + if (cardDonations.StoredPaymentMethodIdOption.IsSet && cardDonations.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(cardDonations.StoredPaymentMethodId), "Property is required for class CardDonations."); + + if (cardDonations.ThreeDS2SdkVersionOption.IsSet && cardDonations.ThreeDS2SdkVersion == null) + throw new ArgumentNullException(nameof(cardDonations.ThreeDS2SdkVersion), "Property is required for class CardDonations."); + + if (cardDonations.BrandOption.IsSet) + writer.WriteString("brand", cardDonations.Brand); + + if (cardDonations.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", cardDonations.CheckoutAttemptId); + + if (cardDonations.CupsecureplusSmscodeOption.IsSet) + writer.WriteString("cupsecureplus.smscode", cardDonations.CupsecureplusSmscode); + + if (cardDonations.CvcOption.IsSet) + writer.WriteString("cvc", cardDonations.Cvc); + + if (cardDonations.EncryptedCardOption.IsSet) + writer.WriteString("encryptedCard", cardDonations.EncryptedCard); + + if (cardDonations.EncryptedCardNumberOption.IsSet) + writer.WriteString("encryptedCardNumber", cardDonations.EncryptedCardNumber); + + if (cardDonations.EncryptedExpiryMonthOption.IsSet) + writer.WriteString("encryptedExpiryMonth", cardDonations.EncryptedExpiryMonth); + + if (cardDonations.EncryptedExpiryYearOption.IsSet) + writer.WriteString("encryptedExpiryYear", cardDonations.EncryptedExpiryYear); + + if (cardDonations.EncryptedSecurityCodeOption.IsSet) + writer.WriteString("encryptedSecurityCode", cardDonations.EncryptedSecurityCode); + + if (cardDonations.ExpiryMonthOption.IsSet) + writer.WriteString("expiryMonth", cardDonations.ExpiryMonth); + + if (cardDonations.ExpiryYearOption.IsSet) + writer.WriteString("expiryYear", cardDonations.ExpiryYear); + + if (cardDonations.FastlaneDataOption.IsSet) + writer.WriteString("fastlaneData", cardDonations.FastlaneData); + + var fundingSourceRawValue = CardDonations.FundingSourceEnumToJsonValue(cardDonations.FundingSourceOption.Value.Value); + writer.WriteString("fundingSource", fundingSourceRawValue); + if (cardDonations.HolderNameOption.IsSet) + writer.WriteString("holderName", cardDonations.HolderName); + + if (cardDonations.NetworkPaymentReferenceOption.IsSet) + writer.WriteString("networkPaymentReference", cardDonations.NetworkPaymentReference); + + if (cardDonations.NumberOption.IsSet) + writer.WriteString("number", cardDonations.Number); + + if (cardDonations.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", cardDonations.RecurringDetailReference); + + if (cardDonations.ShopperNotificationReferenceOption.IsSet) + writer.WriteString("shopperNotificationReference", cardDonations.ShopperNotificationReference); + + if (cardDonations.SrcCorrelationIdOption.IsSet) + writer.WriteString("srcCorrelationId", cardDonations.SrcCorrelationId); + + if (cardDonations.SrcDigitalCardIdOption.IsSet) + writer.WriteString("srcDigitalCardId", cardDonations.SrcDigitalCardId); + + if (cardDonations.SrcSchemeOption.IsSet) + writer.WriteString("srcScheme", cardDonations.SrcScheme); + + if (cardDonations.SrcTokenReferenceOption.IsSet) + writer.WriteString("srcTokenReference", cardDonations.SrcTokenReference); + + if (cardDonations.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", cardDonations.StoredPaymentMethodId); + + if (cardDonations.ThreeDS2SdkVersionOption.IsSet) + writer.WriteString("threeDS2SdkVersion", cardDonations.ThreeDS2SdkVersion); + + var typeRawValue = CardDonations.TypeEnumToJsonValue(cardDonations.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); + } + } } diff --git a/Adyen/Model/Checkout/CashAppDetails.cs b/Adyen/Model/Checkout/CashAppDetails.cs index b001e3386..517d68070 100644 --- a/Adyen/Model/Checkout/CashAppDetails.cs +++ b/Adyen/Model/Checkout/CashAppDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,135 +14,244 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CashAppDetails /// - [DataContract(Name = "CashAppDetails")] - public partial class CashAppDetails : IEquatable, IValidatableObject + public partial class CashAppDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Cash App issued cashtag for recurring payment + /// The checkout attempt identifier. + /// Cash App issued customerId for recurring payment + /// Cash App issued grantId for one time payment + /// Cash App issued onFileGrantId for recurring payment + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// Cash App request id + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The payment method subtype. + /// cashapp (default to TypeEnum.Cashapp) + [JsonConstructor] + public CashAppDetails(Option cashtag = default, Option checkoutAttemptId = default, Option customerId = default, Option grantId = default, Option onFileGrantId = default, Option recurringDetailReference = default, Option requestId = default, Option storedPaymentMethodId = default, Option subtype = default, Option type = default) + { + CashtagOption = cashtag; + CheckoutAttemptIdOption = checkoutAttemptId; + CustomerIdOption = customerId; + GrantIdOption = grantId; + OnFileGrantIdOption = onFileGrantId; + RecurringDetailReferenceOption = recurringDetailReference; + RequestIdOption = requestId; + StoredPaymentMethodIdOption = storedPaymentMethodId; + SubtypeOption = subtype; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// cashapp /// /// cashapp - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Cashapp for value: cashapp /// - [EnumMember(Value = "cashapp")] Cashapp = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("cashapp")) + return TypeEnum.Cashapp; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("cashapp")) + return TypeEnum.Cashapp; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Cashapp) + return "cashapp"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// cashapp /// /// cashapp - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of Cashtag /// - /// Cash App issued cashtag for recurring payment. - /// The checkout attempt identifier.. - /// Cash App issued customerId for recurring payment. - /// Cash App issued grantId for one time payment. - /// Cash App issued onFileGrantId for recurring payment. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// Cash App request id. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The payment method subtype.. - /// cashapp (default to TypeEnum.Cashapp). - public CashAppDetails(string cashtag = default(string), string checkoutAttemptId = default(string), string customerId = default(string), string grantId = default(string), string onFileGrantId = default(string), string recurringDetailReference = default(string), string requestId = default(string), string storedPaymentMethodId = default(string), string subtype = default(string), TypeEnum? type = TypeEnum.Cashapp) - { - this.Cashtag = cashtag; - this.CheckoutAttemptId = checkoutAttemptId; - this.CustomerId = customerId; - this.GrantId = grantId; - this.OnFileGrantId = onFileGrantId; - this.RecurringDetailReference = recurringDetailReference; - this.RequestId = requestId; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Subtype = subtype; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CashtagOption { get; private set; } /// /// Cash App issued cashtag for recurring payment /// /// Cash App issued cashtag for recurring payment - [DataMember(Name = "cashtag", EmitDefaultValue = false)] - public string Cashtag { get; set; } + [JsonPropertyName("cashtag")] + public string Cashtag { get { return this.CashtagOption; } set { this.CashtagOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of CustomerId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CustomerIdOption { get; private set; } /// /// Cash App issued customerId for recurring payment /// /// Cash App issued customerId for recurring payment - [DataMember(Name = "customerId", EmitDefaultValue = false)] - public string CustomerId { get; set; } + [JsonPropertyName("customerId")] + public string CustomerId { get { return this.CustomerIdOption; } set { this.CustomerIdOption = new Option(value); } } + + /// + /// Used to track the state of GrantId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option GrantIdOption { get; private set; } /// /// Cash App issued grantId for one time payment /// /// Cash App issued grantId for one time payment - [DataMember(Name = "grantId", EmitDefaultValue = false)] - public string GrantId { get; set; } + [JsonPropertyName("grantId")] + public string GrantId { get { return this.GrantIdOption; } set { this.GrantIdOption = new Option(value); } } + + /// + /// Used to track the state of OnFileGrantId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OnFileGrantIdOption { get; private set; } /// /// Cash App issued onFileGrantId for recurring payment /// /// Cash App issued onFileGrantId for recurring payment - [DataMember(Name = "onFileGrantId", EmitDefaultValue = false)] - public string OnFileGrantId { get; set; } + [JsonPropertyName("onFileGrantId")] + public string OnFileGrantId { get { return this.OnFileGrantIdOption; } set { this.OnFileGrantIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of RequestId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RequestIdOption { get; private set; } /// /// Cash App request id /// /// Cash App request id - [DataMember(Name = "requestId", EmitDefaultValue = false)] - public string RequestId { get; set; } + [JsonPropertyName("requestId")] + public string RequestId { get { return this.RequestIdOption; } set { this.RequestIdOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of Subtype + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubtypeOption { get; private set; } /// /// The payment method subtype. /// /// The payment method subtype. - [DataMember(Name = "subtype", EmitDefaultValue = false)] - public string Subtype { get; set; } + [JsonPropertyName("subtype")] + public string Subtype { get { return this.SubtypeOption; } set { this.SubtypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -168,151 +276,221 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as CashAppDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class CashAppDetailsJsonConverter : JsonConverter + { /// - /// Returns true if CashAppDetails instances are equal + /// Deserializes json to /// - /// Instance of CashAppDetails to be compared - /// Boolean - public bool Equals(CashAppDetails input) + /// + /// + /// + /// + /// + public override CashAppDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option cashtag = default; + Option checkoutAttemptId = default; + Option customerId = default; + Option grantId = default; + Option onFileGrantId = default; + Option recurringDetailReference = default; + Option requestId = default; + Option storedPaymentMethodId = default; + Option subtype = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "cashtag": + cashtag = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "customerId": + customerId = new Option(utf8JsonReader.GetString()); + break; + case "grantId": + grantId = new Option(utf8JsonReader.GetString()); + break; + case "onFileGrantId": + onFileGrantId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "requestId": + requestId = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "subtype": + subtype = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(CashAppDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.Cashtag == input.Cashtag || - (this.Cashtag != null && - this.Cashtag.Equals(input.Cashtag)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.CustomerId == input.CustomerId || - (this.CustomerId != null && - this.CustomerId.Equals(input.CustomerId)) - ) && - ( - this.GrantId == input.GrantId || - (this.GrantId != null && - this.GrantId.Equals(input.GrantId)) - ) && - ( - this.OnFileGrantId == input.OnFileGrantId || - (this.OnFileGrantId != null && - this.OnFileGrantId.Equals(input.OnFileGrantId)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.RequestId == input.RequestId || - (this.RequestId != null && - this.RequestId.Equals(input.RequestId)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Subtype == input.Subtype || - (this.Subtype != null && - this.Subtype.Equals(input.Subtype)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (cashtag.IsSet && cashtag.Value == null) + throw new ArgumentNullException(nameof(cashtag), "Property is not nullable for class CashAppDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class CashAppDetails."); + + if (customerId.IsSet && customerId.Value == null) + throw new ArgumentNullException(nameof(customerId), "Property is not nullable for class CashAppDetails."); + + if (grantId.IsSet && grantId.Value == null) + throw new ArgumentNullException(nameof(grantId), "Property is not nullable for class CashAppDetails."); + + if (onFileGrantId.IsSet && onFileGrantId.Value == null) + throw new ArgumentNullException(nameof(onFileGrantId), "Property is not nullable for class CashAppDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class CashAppDetails."); + + if (requestId.IsSet && requestId.Value == null) + throw new ArgumentNullException(nameof(requestId), "Property is not nullable for class CashAppDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class CashAppDetails."); + + if (subtype.IsSet && subtype.Value == null) + throw new ArgumentNullException(nameof(subtype), "Property is not nullable for class CashAppDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CashAppDetails."); + + return new CashAppDetails(cashtag, checkoutAttemptId, customerId, grantId, onFileGrantId, recurringDetailReference, requestId, storedPaymentMethodId, subtype, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CashAppDetails cashAppDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Cashtag != null) - { - hashCode = (hashCode * 59) + this.Cashtag.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.CustomerId != null) - { - hashCode = (hashCode * 59) + this.CustomerId.GetHashCode(); - } - if (this.GrantId != null) - { - hashCode = (hashCode * 59) + this.GrantId.GetHashCode(); - } - if (this.OnFileGrantId != null) - { - hashCode = (hashCode * 59) + this.OnFileGrantId.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.RequestId != null) - { - hashCode = (hashCode * 59) + this.RequestId.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.Subtype != null) - { - hashCode = (hashCode * 59) + this.Subtype.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, cashAppDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CashAppDetails cashAppDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (cashAppDetails.CashtagOption.IsSet && cashAppDetails.Cashtag == null) + throw new ArgumentNullException(nameof(cashAppDetails.Cashtag), "Property is required for class CashAppDetails."); - yield break; + if (cashAppDetails.CheckoutAttemptIdOption.IsSet && cashAppDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(cashAppDetails.CheckoutAttemptId), "Property is required for class CashAppDetails."); + + if (cashAppDetails.CustomerIdOption.IsSet && cashAppDetails.CustomerId == null) + throw new ArgumentNullException(nameof(cashAppDetails.CustomerId), "Property is required for class CashAppDetails."); + + if (cashAppDetails.GrantIdOption.IsSet && cashAppDetails.GrantId == null) + throw new ArgumentNullException(nameof(cashAppDetails.GrantId), "Property is required for class CashAppDetails."); + + if (cashAppDetails.OnFileGrantIdOption.IsSet && cashAppDetails.OnFileGrantId == null) + throw new ArgumentNullException(nameof(cashAppDetails.OnFileGrantId), "Property is required for class CashAppDetails."); + + if (cashAppDetails.RecurringDetailReferenceOption.IsSet && cashAppDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(cashAppDetails.RecurringDetailReference), "Property is required for class CashAppDetails."); + + if (cashAppDetails.RequestIdOption.IsSet && cashAppDetails.RequestId == null) + throw new ArgumentNullException(nameof(cashAppDetails.RequestId), "Property is required for class CashAppDetails."); + + if (cashAppDetails.StoredPaymentMethodIdOption.IsSet && cashAppDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(cashAppDetails.StoredPaymentMethodId), "Property is required for class CashAppDetails."); + + if (cashAppDetails.SubtypeOption.IsSet && cashAppDetails.Subtype == null) + throw new ArgumentNullException(nameof(cashAppDetails.Subtype), "Property is required for class CashAppDetails."); + + if (cashAppDetails.CashtagOption.IsSet) + writer.WriteString("cashtag", cashAppDetails.Cashtag); + + if (cashAppDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", cashAppDetails.CheckoutAttemptId); + + if (cashAppDetails.CustomerIdOption.IsSet) + writer.WriteString("customerId", cashAppDetails.CustomerId); + + if (cashAppDetails.GrantIdOption.IsSet) + writer.WriteString("grantId", cashAppDetails.GrantId); + + if (cashAppDetails.OnFileGrantIdOption.IsSet) + writer.WriteString("onFileGrantId", cashAppDetails.OnFileGrantId); + + if (cashAppDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", cashAppDetails.RecurringDetailReference); + + if (cashAppDetails.RequestIdOption.IsSet) + writer.WriteString("requestId", cashAppDetails.RequestId); + + if (cashAppDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", cashAppDetails.StoredPaymentMethodId); + + if (cashAppDetails.SubtypeOption.IsSet) + writer.WriteString("subtype", cashAppDetails.Subtype); + + var typeRawValue = CashAppDetails.TypeEnumToJsonValue(cashAppDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/CellulantDetails.cs b/Adyen/Model/Checkout/CellulantDetails.cs index 44022dfc1..4929077f7 100644 --- a/Adyen/Model/Checkout/CellulantDetails.cs +++ b/Adyen/Model/Checkout/CellulantDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,71 +14,131 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CellulantDetails /// - [DataContract(Name = "CellulantDetails")] - public partial class CellulantDetails : IEquatable, IValidatableObject + public partial class CellulantDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// The Cellulant issuer. + /// **Cellulant** (default to TypeEnum.Cellulant) + [JsonConstructor] + public CellulantDetails(Option checkoutAttemptId = default, Option issuer = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + IssuerOption = issuer; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **Cellulant** /// /// **Cellulant** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Cellulant for value: cellulant /// - [EnumMember(Value = "cellulant")] Cellulant = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("cellulant")) + return TypeEnum.Cellulant; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("cellulant")) + return TypeEnum.Cellulant; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Cellulant) + return "cellulant"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **Cellulant** /// /// **Cellulant** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The Cellulant issuer.. - /// **Cellulant** (default to TypeEnum.Cellulant). - public CellulantDetails(string checkoutAttemptId = default(string), string issuer = default(string), TypeEnum? type = TypeEnum.Cellulant) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.Issuer = issuer; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of Issuer + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IssuerOption { get; private set; } /// /// The Cellulant issuer. /// /// The Cellulant issuer. - [DataMember(Name = "issuer", EmitDefaultValue = false)] - public string Issuer { get; set; } + [JsonPropertyName("issuer")] + public string Issuer { get { return this.IssuerOption; } set { this.IssuerOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -97,82 +156,124 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CellulantDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CellulantDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CellulantDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CellulantDetails instances are equal - /// - /// Instance of CellulantDetails to be compared - /// Boolean - public bool Equals(CellulantDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option issuer = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "issuer": + issuer = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(CellulantDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Issuer == input.Issuer || - (this.Issuer != null && - this.Issuer.Equals(input.Issuer)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class CellulantDetails."); + + if (issuer.IsSet && issuer.Value == null) + throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class CellulantDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CellulantDetails."); + + return new CellulantDetails(checkoutAttemptId, issuer, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CellulantDetails cellulantDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.Issuer != null) - { - hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, cellulantDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CellulantDetails cellulantDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (cellulantDetails.CheckoutAttemptIdOption.IsSet && cellulantDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(cellulantDetails.CheckoutAttemptId), "Property is required for class CellulantDetails."); + + if (cellulantDetails.IssuerOption.IsSet && cellulantDetails.Issuer == null) + throw new ArgumentNullException(nameof(cellulantDetails.Issuer), "Property is required for class CellulantDetails."); + + if (cellulantDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", cellulantDetails.CheckoutAttemptId); + + if (cellulantDetails.IssuerOption.IsSet) + writer.WriteString("issuer", cellulantDetails.Issuer); + + var typeRawValue = CellulantDetails.TypeEnumToJsonValue(cellulantDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/CheckoutAwaitAction.cs b/Adyen/Model/Checkout/CheckoutAwaitAction.cs index bee9cfb58..9b84d2bc9 100644 --- a/Adyen/Model/Checkout/CheckoutAwaitAction.cs +++ b/Adyen/Model/Checkout/CheckoutAwaitAction.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,85 +14,140 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CheckoutAwaitAction /// - [DataContract(Name = "CheckoutAwaitAction")] - public partial class CheckoutAwaitAction : IEquatable, IValidatableObject + public partial class CheckoutAwaitAction : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// **await** + /// Encoded payment data. + /// Specifies the payment method. + /// Specifies the URL to redirect to. + [JsonConstructor] + public CheckoutAwaitAction(TypeEnum type, Option paymentData = default, Option paymentMethodType = default, Option url = default) + { + Type = type; + PaymentDataOption = paymentData; + PaymentMethodTypeOption = paymentMethodType; + UrlOption = url; + OnCreated(); + } + + partial void OnCreated(); + /// /// **await** /// /// **await** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Await for value: await /// - [EnumMember(Value = "await")] Await = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("await")) + return TypeEnum.Await; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("await")) + return TypeEnum.Await; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.Await) + return "await"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **await** /// /// **await** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of PaymentData /// - [JsonConstructorAttribute] - protected CheckoutAwaitAction() { } - /// - /// Initializes a new instance of the class. - /// - /// Encoded payment data.. - /// Specifies the payment method.. - /// **await** (required). - /// Specifies the URL to redirect to.. - public CheckoutAwaitAction(string paymentData = default(string), string paymentMethodType = default(string), TypeEnum type = default(TypeEnum), string url = default(string)) - { - this.Type = type; - this.PaymentData = paymentData; - this.PaymentMethodType = paymentMethodType; - this.Url = url; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentDataOption { get; private set; } /// /// Encoded payment data. /// /// Encoded payment data. - [DataMember(Name = "paymentData", EmitDefaultValue = false)] - public string PaymentData { get; set; } + [JsonPropertyName("paymentData")] + public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethodType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodTypeOption { get; private set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] - public string PaymentMethodType { get; set; } + [JsonPropertyName("paymentMethodType")] + public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } + + /// + /// Used to track the state of Url + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UrlOption { get; private set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [DataMember(Name = "url", EmitDefaultValue = false)] - public string Url { get; set; } + [JsonPropertyName("url")] + public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -103,100 +157,148 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutAwaitAction {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutAwaitActionJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CheckoutAwaitAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CheckoutAwaitAction); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CheckoutAwaitAction instances are equal - /// - /// Instance of CheckoutAwaitAction to be compared - /// Boolean - public bool Equals(CheckoutAwaitAction input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option type = default; + Option paymentData = default; + Option paymentMethodType = default; + Option url = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(CheckoutAwaitAction.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "paymentData": + paymentData = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethodType": + paymentMethodType = new Option(utf8JsonReader.GetString()); + break; + case "url": + url = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.PaymentData == input.PaymentData || - (this.PaymentData != null && - this.PaymentData.Equals(input.PaymentData)) - ) && - ( - this.PaymentMethodType == input.PaymentMethodType || - (this.PaymentMethodType != null && - this.PaymentMethodType.Equals(input.PaymentMethodType)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class CheckoutAwaitAction.", nameof(type)); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutAwaitAction."); + + if (paymentData.IsSet && paymentData.Value == null) + throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class CheckoutAwaitAction."); + + if (paymentMethodType.IsSet && paymentMethodType.Value == null) + throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutAwaitAction."); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutAwaitAction."); + + return new CheckoutAwaitAction(type.Value.Value, paymentData, paymentMethodType, url); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutAwaitAction checkoutAwaitAction, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.PaymentData != null) - { - hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); - } - if (this.PaymentMethodType != null) - { - hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.Url != null) - { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, checkoutAwaitAction, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutAwaitAction checkoutAwaitAction, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (checkoutAwaitAction.PaymentDataOption.IsSet && checkoutAwaitAction.PaymentData == null) + throw new ArgumentNullException(nameof(checkoutAwaitAction.PaymentData), "Property is required for class CheckoutAwaitAction."); + + if (checkoutAwaitAction.PaymentMethodTypeOption.IsSet && checkoutAwaitAction.PaymentMethodType == null) + throw new ArgumentNullException(nameof(checkoutAwaitAction.PaymentMethodType), "Property is required for class CheckoutAwaitAction."); + + if (checkoutAwaitAction.UrlOption.IsSet && checkoutAwaitAction.Url == null) + throw new ArgumentNullException(nameof(checkoutAwaitAction.Url), "Property is required for class CheckoutAwaitAction."); + + var typeRawValue = CheckoutAwaitAction.TypeEnumToJsonValue(checkoutAwaitAction.Type); + writer.WriteString("type", typeRawValue); + if (checkoutAwaitAction.PaymentDataOption.IsSet) + writer.WriteString("paymentData", checkoutAwaitAction.PaymentData); + + if (checkoutAwaitAction.PaymentMethodTypeOption.IsSet) + writer.WriteString("paymentMethodType", checkoutAwaitAction.PaymentMethodType); + + if (checkoutAwaitAction.UrlOption.IsSet) + writer.WriteString("url", checkoutAwaitAction.Url); } } - } diff --git a/Adyen/Model/Checkout/CheckoutBankAccount.cs b/Adyen/Model/Checkout/CheckoutBankAccount.cs index fb4c247c8..e910b9c91 100644 --- a/Adyen/Model/Checkout/CheckoutBankAccount.cs +++ b/Adyen/Model/Checkout/CheckoutBankAccount.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,170 +14,327 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CheckoutBankAccount /// - [DataContract(Name = "CheckoutBankAccount")] - public partial class CheckoutBankAccount : IEquatable, IValidatableObject + public partial class CheckoutBankAccount : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The type of the bank account. + /// The bank account number (without separators). + /// The bank city. + /// The location id of the bank. The field value is `nil` in most cases. + /// The name of the bank. + /// The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases. + /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL'). + /// The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN). + /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. + /// The bank account holder's tax ID. + [JsonConstructor] + public CheckoutBankAccount(Option accountType = default, Option bankAccountNumber = default, Option bankCity = default, Option bankLocationId = default, Option bankName = default, Option bic = default, Option countryCode = default, Option iban = default, Option ownerName = default, Option taxId = default) + { + AccountTypeOption = accountType; + BankAccountNumberOption = bankAccountNumber; + BankCityOption = bankCity; + BankLocationIdOption = bankLocationId; + BankNameOption = bankName; + BicOption = bic; + CountryCodeOption = countryCode; + IbanOption = iban; + OwnerNameOption = ownerName; + TaxIdOption = taxId; + OnCreated(); + } + + partial void OnCreated(); + /// /// The type of the bank account. /// /// The type of the bank account. - [JsonConverter(typeof(StringEnumConverter))] public enum AccountTypeEnum { /// /// Enum Balance for value: balance /// - [EnumMember(Value = "balance")] Balance = 1, /// /// Enum Checking for value: checking /// - [EnumMember(Value = "checking")] Checking = 2, /// /// Enum Deposit for value: deposit /// - [EnumMember(Value = "deposit")] Deposit = 3, /// /// Enum General for value: general /// - [EnumMember(Value = "general")] General = 4, /// /// Enum Other for value: other /// - [EnumMember(Value = "other")] Other = 5, /// /// Enum Payment for value: payment /// - [EnumMember(Value = "payment")] Payment = 6, /// /// Enum Savings for value: savings /// - [EnumMember(Value = "savings")] Savings = 7 + } + + /// + /// Returns a + /// + /// + /// + /// + public static AccountTypeEnum AccountTypeEnumFromString(string value) + { + if (value.Equals("balance")) + return AccountTypeEnum.Balance; + + if (value.Equals("checking")) + return AccountTypeEnum.Checking; + + if (value.Equals("deposit")) + return AccountTypeEnum.Deposit; + + if (value.Equals("general")) + return AccountTypeEnum.General; + + if (value.Equals("other")) + return AccountTypeEnum.Other; + + if (value.Equals("payment")) + return AccountTypeEnum.Payment; + + if (value.Equals("savings")) + return AccountTypeEnum.Savings; + + throw new NotImplementedException($"Could not convert value to type AccountTypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static AccountTypeEnum? AccountTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("balance")) + return AccountTypeEnum.Balance; + + if (value.Equals("checking")) + return AccountTypeEnum.Checking; + + if (value.Equals("deposit")) + return AccountTypeEnum.Deposit; + + if (value.Equals("general")) + return AccountTypeEnum.General; + + if (value.Equals("other")) + return AccountTypeEnum.Other; + + if (value.Equals("payment")) + return AccountTypeEnum.Payment; + + if (value.Equals("savings")) + return AccountTypeEnum.Savings; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string AccountTypeEnumToJsonValue(AccountTypeEnum? value) + { + if (value == AccountTypeEnum.Balance) + return "balance"; + + if (value == AccountTypeEnum.Checking) + return "checking"; + if (value == AccountTypeEnum.Deposit) + return "deposit"; + + if (value == AccountTypeEnum.General) + return "general"; + + if (value == AccountTypeEnum.Other) + return "other"; + + if (value == AccountTypeEnum.Payment) + return "payment"; + + if (value == AccountTypeEnum.Savings) + return "savings"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of AccountType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountTypeOption { get; private set; } /// /// The type of the bank account. /// /// The type of the bank account. - [DataMember(Name = "accountType", EmitDefaultValue = false)] - public AccountTypeEnum? AccountType { get; set; } + [JsonPropertyName("accountType")] + public AccountTypeEnum? AccountType { get { return this.AccountTypeOption; } set { this.AccountTypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of BankAccountNumber /// - /// The type of the bank account.. - /// The bank account number (without separators).. - /// The bank city.. - /// The location id of the bank. The field value is `nil` in most cases.. - /// The name of the bank.. - /// The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases.. - /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL').. - /// The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN).. - /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'.. - /// The bank account holder's tax ID.. - public CheckoutBankAccount(AccountTypeEnum? accountType = default(AccountTypeEnum?), string bankAccountNumber = default(string), string bankCity = default(string), string bankLocationId = default(string), string bankName = default(string), string bic = default(string), string countryCode = default(string), string iban = default(string), string ownerName = default(string), string taxId = default(string)) - { - this.AccountType = accountType; - this.BankAccountNumber = bankAccountNumber; - this.BankCity = bankCity; - this.BankLocationId = bankLocationId; - this.BankName = bankName; - this.Bic = bic; - this.CountryCode = countryCode; - this.Iban = iban; - this.OwnerName = ownerName; - this.TaxId = taxId; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankAccountNumberOption { get; private set; } /// /// The bank account number (without separators). /// /// The bank account number (without separators). - [DataMember(Name = "bankAccountNumber", EmitDefaultValue = false)] - public string BankAccountNumber { get; set; } + [JsonPropertyName("bankAccountNumber")] + public string BankAccountNumber { get { return this.BankAccountNumberOption; } set { this.BankAccountNumberOption = new Option(value); } } + + /// + /// Used to track the state of BankCity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankCityOption { get; private set; } /// /// The bank city. /// /// The bank city. - [DataMember(Name = "bankCity", EmitDefaultValue = false)] - public string BankCity { get; set; } + [JsonPropertyName("bankCity")] + public string BankCity { get { return this.BankCityOption; } set { this.BankCityOption = new Option(value); } } + + /// + /// Used to track the state of BankLocationId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankLocationIdOption { get; private set; } /// /// The location id of the bank. The field value is `nil` in most cases. /// /// The location id of the bank. The field value is `nil` in most cases. - [DataMember(Name = "bankLocationId", EmitDefaultValue = false)] - public string BankLocationId { get; set; } + [JsonPropertyName("bankLocationId")] + public string BankLocationId { get { return this.BankLocationIdOption; } set { this.BankLocationIdOption = new Option(value); } } + + /// + /// Used to track the state of BankName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankNameOption { get; private set; } /// /// The name of the bank. /// /// The name of the bank. - [DataMember(Name = "bankName", EmitDefaultValue = false)] - public string BankName { get; set; } + [JsonPropertyName("bankName")] + public string BankName { get { return this.BankNameOption; } set { this.BankNameOption = new Option(value); } } + + /// + /// Used to track the state of Bic + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BicOption { get; private set; } /// /// The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases. /// /// The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases. - [DataMember(Name = "bic", EmitDefaultValue = false)] - public string Bic { get; set; } + [JsonPropertyName("bic")] + public string Bic { get { return this.BicOption; } set { this.BicOption = new Option(value); } } + + /// + /// Used to track the state of CountryCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryCodeOption { get; private set; } /// /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL'). /// /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL'). - [DataMember(Name = "countryCode", EmitDefaultValue = false)] - public string CountryCode { get; set; } + [JsonPropertyName("countryCode")] + public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } + + /// + /// Used to track the state of Iban + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IbanOption { get; private set; } /// /// The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN). /// /// The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN). - [DataMember(Name = "iban", EmitDefaultValue = false)] - public string Iban { get; set; } + [JsonPropertyName("iban")] + public string Iban { get { return this.IbanOption; } set { this.IbanOption = new Option(value); } } + + /// + /// Used to track the state of OwnerName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OwnerNameOption { get; private set; } /// /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. /// /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. - [DataMember(Name = "ownerName", EmitDefaultValue = false)] - public string OwnerName { get; set; } + [JsonPropertyName("ownerName")] + public string OwnerName { get { return this.OwnerNameOption; } set { this.OwnerNameOption = new Option(value); } } + + /// + /// Used to track the state of TaxId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TaxIdOption { get; private set; } /// /// The bank account holder's tax ID. /// /// The bank account holder's tax ID. - [DataMember(Name = "taxId", EmitDefaultValue = false)] - public string TaxId { get; set; } + [JsonPropertyName("taxId")] + public string TaxId { get { return this.TaxIdOption; } set { this.TaxIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -203,145 +359,214 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutBankAccountJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CheckoutBankAccount Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CheckoutBankAccount); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CheckoutBankAccount instances are equal - /// - /// Instance of CheckoutBankAccount to be compared - /// Boolean - public bool Equals(CheckoutBankAccount input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option accountType = default; + Option bankAccountNumber = default; + Option bankCity = default; + Option bankLocationId = default; + Option bankName = default; + Option bic = default; + Option countryCode = default; + Option iban = default; + Option ownerName = default; + Option taxId = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "accountType": + string accountTypeRawValue = utf8JsonReader.GetString(); + if (accountTypeRawValue != null) + accountType = new Option(CheckoutBankAccount.AccountTypeEnumFromStringOrDefault(accountTypeRawValue)); + break; + case "bankAccountNumber": + bankAccountNumber = new Option(utf8JsonReader.GetString()); + break; + case "bankCity": + bankCity = new Option(utf8JsonReader.GetString()); + break; + case "bankLocationId": + bankLocationId = new Option(utf8JsonReader.GetString()); + break; + case "bankName": + bankName = new Option(utf8JsonReader.GetString()); + break; + case "bic": + bic = new Option(utf8JsonReader.GetString()); + break; + case "countryCode": + countryCode = new Option(utf8JsonReader.GetString()); + break; + case "iban": + iban = new Option(utf8JsonReader.GetString()); + break; + case "ownerName": + ownerName = new Option(utf8JsonReader.GetString()); + break; + case "taxId": + taxId = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AccountType == input.AccountType || - this.AccountType.Equals(input.AccountType) - ) && - ( - this.BankAccountNumber == input.BankAccountNumber || - (this.BankAccountNumber != null && - this.BankAccountNumber.Equals(input.BankAccountNumber)) - ) && - ( - this.BankCity == input.BankCity || - (this.BankCity != null && - this.BankCity.Equals(input.BankCity)) - ) && - ( - this.BankLocationId == input.BankLocationId || - (this.BankLocationId != null && - this.BankLocationId.Equals(input.BankLocationId)) - ) && - ( - this.BankName == input.BankName || - (this.BankName != null && - this.BankName.Equals(input.BankName)) - ) && - ( - this.Bic == input.Bic || - (this.Bic != null && - this.Bic.Equals(input.Bic)) - ) && - ( - this.CountryCode == input.CountryCode || - (this.CountryCode != null && - this.CountryCode.Equals(input.CountryCode)) - ) && - ( - this.Iban == input.Iban || - (this.Iban != null && - this.Iban.Equals(input.Iban)) - ) && - ( - this.OwnerName == input.OwnerName || - (this.OwnerName != null && - this.OwnerName.Equals(input.OwnerName)) - ) && - ( - this.TaxId == input.TaxId || - (this.TaxId != null && - this.TaxId.Equals(input.TaxId)) - ); + + if (accountType.IsSet && accountType.Value == null) + throw new ArgumentNullException(nameof(accountType), "Property is not nullable for class CheckoutBankAccount."); + + if (bankAccountNumber.IsSet && bankAccountNumber.Value == null) + throw new ArgumentNullException(nameof(bankAccountNumber), "Property is not nullable for class CheckoutBankAccount."); + + if (bankCity.IsSet && bankCity.Value == null) + throw new ArgumentNullException(nameof(bankCity), "Property is not nullable for class CheckoutBankAccount."); + + if (bankLocationId.IsSet && bankLocationId.Value == null) + throw new ArgumentNullException(nameof(bankLocationId), "Property is not nullable for class CheckoutBankAccount."); + + if (bankName.IsSet && bankName.Value == null) + throw new ArgumentNullException(nameof(bankName), "Property is not nullable for class CheckoutBankAccount."); + + if (bic.IsSet && bic.Value == null) + throw new ArgumentNullException(nameof(bic), "Property is not nullable for class CheckoutBankAccount."); + + if (countryCode.IsSet && countryCode.Value == null) + throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class CheckoutBankAccount."); + + if (iban.IsSet && iban.Value == null) + throw new ArgumentNullException(nameof(iban), "Property is not nullable for class CheckoutBankAccount."); + + if (ownerName.IsSet && ownerName.Value == null) + throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class CheckoutBankAccount."); + + if (taxId.IsSet && taxId.Value == null) + throw new ArgumentNullException(nameof(taxId), "Property is not nullable for class CheckoutBankAccount."); + + return new CheckoutBankAccount(accountType, bankAccountNumber, bankCity, bankLocationId, bankName, bic, countryCode, iban, ownerName, taxId); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutBankAccount checkoutBankAccount, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.AccountType.GetHashCode(); - if (this.BankAccountNumber != null) - { - hashCode = (hashCode * 59) + this.BankAccountNumber.GetHashCode(); - } - if (this.BankCity != null) - { - hashCode = (hashCode * 59) + this.BankCity.GetHashCode(); - } - if (this.BankLocationId != null) - { - hashCode = (hashCode * 59) + this.BankLocationId.GetHashCode(); - } - if (this.BankName != null) - { - hashCode = (hashCode * 59) + this.BankName.GetHashCode(); - } - if (this.Bic != null) - { - hashCode = (hashCode * 59) + this.Bic.GetHashCode(); - } - if (this.CountryCode != null) - { - hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); - } - if (this.Iban != null) - { - hashCode = (hashCode * 59) + this.Iban.GetHashCode(); - } - if (this.OwnerName != null) - { - hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); - } - if (this.TaxId != null) - { - hashCode = (hashCode * 59) + this.TaxId.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, checkoutBankAccount, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutBankAccount checkoutBankAccount, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (checkoutBankAccount.BankAccountNumberOption.IsSet && checkoutBankAccount.BankAccountNumber == null) + throw new ArgumentNullException(nameof(checkoutBankAccount.BankAccountNumber), "Property is required for class CheckoutBankAccount."); + + if (checkoutBankAccount.BankCityOption.IsSet && checkoutBankAccount.BankCity == null) + throw new ArgumentNullException(nameof(checkoutBankAccount.BankCity), "Property is required for class CheckoutBankAccount."); + + if (checkoutBankAccount.BankLocationIdOption.IsSet && checkoutBankAccount.BankLocationId == null) + throw new ArgumentNullException(nameof(checkoutBankAccount.BankLocationId), "Property is required for class CheckoutBankAccount."); + + if (checkoutBankAccount.BankNameOption.IsSet && checkoutBankAccount.BankName == null) + throw new ArgumentNullException(nameof(checkoutBankAccount.BankName), "Property is required for class CheckoutBankAccount."); + + if (checkoutBankAccount.BicOption.IsSet && checkoutBankAccount.Bic == null) + throw new ArgumentNullException(nameof(checkoutBankAccount.Bic), "Property is required for class CheckoutBankAccount."); + + if (checkoutBankAccount.CountryCodeOption.IsSet && checkoutBankAccount.CountryCode == null) + throw new ArgumentNullException(nameof(checkoutBankAccount.CountryCode), "Property is required for class CheckoutBankAccount."); + + if (checkoutBankAccount.IbanOption.IsSet && checkoutBankAccount.Iban == null) + throw new ArgumentNullException(nameof(checkoutBankAccount.Iban), "Property is required for class CheckoutBankAccount."); + + if (checkoutBankAccount.OwnerNameOption.IsSet && checkoutBankAccount.OwnerName == null) + throw new ArgumentNullException(nameof(checkoutBankAccount.OwnerName), "Property is required for class CheckoutBankAccount."); + + if (checkoutBankAccount.TaxIdOption.IsSet && checkoutBankAccount.TaxId == null) + throw new ArgumentNullException(nameof(checkoutBankAccount.TaxId), "Property is required for class CheckoutBankAccount."); + + var accountTypeRawValue = CheckoutBankAccount.AccountTypeEnumToJsonValue(checkoutBankAccount.AccountTypeOption.Value.Value); + writer.WriteString("accountType", accountTypeRawValue); + if (checkoutBankAccount.BankAccountNumberOption.IsSet) + writer.WriteString("bankAccountNumber", checkoutBankAccount.BankAccountNumber); + + if (checkoutBankAccount.BankCityOption.IsSet) + writer.WriteString("bankCity", checkoutBankAccount.BankCity); + + if (checkoutBankAccount.BankLocationIdOption.IsSet) + writer.WriteString("bankLocationId", checkoutBankAccount.BankLocationId); + + if (checkoutBankAccount.BankNameOption.IsSet) + writer.WriteString("bankName", checkoutBankAccount.BankName); + + if (checkoutBankAccount.BicOption.IsSet) + writer.WriteString("bic", checkoutBankAccount.Bic); + + if (checkoutBankAccount.CountryCodeOption.IsSet) + writer.WriteString("countryCode", checkoutBankAccount.CountryCode); + + if (checkoutBankAccount.IbanOption.IsSet) + writer.WriteString("iban", checkoutBankAccount.Iban); + + if (checkoutBankAccount.OwnerNameOption.IsSet) + writer.WriteString("ownerName", checkoutBankAccount.OwnerName); + + if (checkoutBankAccount.TaxIdOption.IsSet) + writer.WriteString("taxId", checkoutBankAccount.TaxId); } } - } diff --git a/Adyen/Model/Checkout/CheckoutBankTransferAction.cs b/Adyen/Model/Checkout/CheckoutBankTransferAction.cs index c0e83599b..e47b8f8cf 100644 --- a/Adyen/Model/Checkout/CheckoutBankTransferAction.cs +++ b/Adyen/Model/Checkout/CheckoutBankTransferAction.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,165 +14,283 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CheckoutBankTransferAction /// - [DataContract(Name = "CheckoutBankTransferAction")] - public partial class CheckoutBankTransferAction : IEquatable, IValidatableObject + public partial class CheckoutBankTransferAction : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The type of the action. + /// The account number of the bank transfer. + /// The name of the account holder. + /// The BIC of the IBAN. + /// The url to download payment details with. + /// The IBAN of the bank transfer. + /// Specifies the payment method. + /// The transfer reference. + /// The routing number of the bank transfer. + /// The e-mail of the shopper, included if an e-mail was sent to the shopper. + /// The sort code of the bank transfer. + /// totalAmount + /// Specifies the URL to redirect to. + [JsonConstructor] + public CheckoutBankTransferAction(TypeEnum type, Option accountNumber = default, Option beneficiary = default, Option bic = default, Option downloadUrl = default, Option iban = default, Option paymentMethodType = default, Option reference = default, Option routingNumber = default, Option shopperEmail = default, Option sortCode = default, Option totalAmount = default, Option url = default) + { + Type = type; + AccountNumberOption = accountNumber; + BeneficiaryOption = beneficiary; + BicOption = bic; + DownloadUrlOption = downloadUrl; + IbanOption = iban; + PaymentMethodTypeOption = paymentMethodType; + ReferenceOption = reference; + RoutingNumberOption = routingNumber; + ShopperEmailOption = shopperEmail; + SortCodeOption = sortCode; + TotalAmountOption = totalAmount; + UrlOption = url; + OnCreated(); + } + + partial void OnCreated(); + /// /// The type of the action. /// /// The type of the action. - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum BankTransfer for value: bankTransfer /// - [EnumMember(Value = "bankTransfer")] BankTransfer = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("bankTransfer")) + return TypeEnum.BankTransfer; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("bankTransfer")) + return TypeEnum.BankTransfer; + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.BankTransfer) + return "bankTransfer"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// The type of the action. /// /// The type of the action. - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected CheckoutBankTransferAction() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of AccountNumber /// - /// The account number of the bank transfer.. - /// The name of the account holder.. - /// The BIC of the IBAN.. - /// The url to download payment details with.. - /// The IBAN of the bank transfer.. - /// Specifies the payment method.. - /// The transfer reference.. - /// The routing number of the bank transfer.. - /// The e-mail of the shopper, included if an e-mail was sent to the shopper.. - /// The sort code of the bank transfer.. - /// totalAmount. - /// The type of the action. (required). - /// Specifies the URL to redirect to.. - public CheckoutBankTransferAction(string accountNumber = default(string), string beneficiary = default(string), string bic = default(string), string downloadUrl = default(string), string iban = default(string), string paymentMethodType = default(string), string reference = default(string), string routingNumber = default(string), string shopperEmail = default(string), string sortCode = default(string), Amount totalAmount = default(Amount), TypeEnum type = default(TypeEnum), string url = default(string)) - { - this.Type = type; - this.AccountNumber = accountNumber; - this.Beneficiary = beneficiary; - this.Bic = bic; - this.DownloadUrl = downloadUrl; - this.Iban = iban; - this.PaymentMethodType = paymentMethodType; - this.Reference = reference; - this.RoutingNumber = routingNumber; - this.ShopperEmail = shopperEmail; - this.SortCode = sortCode; - this.TotalAmount = totalAmount; - this.Url = url; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountNumberOption { get; private set; } /// /// The account number of the bank transfer. /// /// The account number of the bank transfer. - [DataMember(Name = "accountNumber", EmitDefaultValue = false)] - public string AccountNumber { get; set; } + [JsonPropertyName("accountNumber")] + public string AccountNumber { get { return this.AccountNumberOption; } set { this.AccountNumberOption = new Option(value); } } + + /// + /// Used to track the state of Beneficiary + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BeneficiaryOption { get; private set; } /// /// The name of the account holder. /// /// The name of the account holder. - [DataMember(Name = "beneficiary", EmitDefaultValue = false)] - public string Beneficiary { get; set; } + [JsonPropertyName("beneficiary")] + public string Beneficiary { get { return this.BeneficiaryOption; } set { this.BeneficiaryOption = new Option(value); } } + + /// + /// Used to track the state of Bic + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BicOption { get; private set; } /// /// The BIC of the IBAN. /// /// The BIC of the IBAN. - [DataMember(Name = "bic", EmitDefaultValue = false)] - public string Bic { get; set; } + [JsonPropertyName("bic")] + public string Bic { get { return this.BicOption; } set { this.BicOption = new Option(value); } } + + /// + /// Used to track the state of DownloadUrl + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DownloadUrlOption { get; private set; } /// /// The url to download payment details with. /// /// The url to download payment details with. - [DataMember(Name = "downloadUrl", EmitDefaultValue = false)] - public string DownloadUrl { get; set; } + [JsonPropertyName("downloadUrl")] + public string DownloadUrl { get { return this.DownloadUrlOption; } set { this.DownloadUrlOption = new Option(value); } } + + /// + /// Used to track the state of Iban + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IbanOption { get; private set; } /// /// The IBAN of the bank transfer. /// /// The IBAN of the bank transfer. - [DataMember(Name = "iban", EmitDefaultValue = false)] - public string Iban { get; set; } + [JsonPropertyName("iban")] + public string Iban { get { return this.IbanOption; } set { this.IbanOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethodType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodTypeOption { get; private set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] - public string PaymentMethodType { get; set; } + [JsonPropertyName("paymentMethodType")] + public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// The transfer reference. /// /// The transfer reference. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + + /// + /// Used to track the state of RoutingNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RoutingNumberOption { get; private set; } /// /// The routing number of the bank transfer. /// /// The routing number of the bank transfer. - [DataMember(Name = "routingNumber", EmitDefaultValue = false)] - public string RoutingNumber { get; set; } + [JsonPropertyName("routingNumber")] + public string RoutingNumber { get { return this.RoutingNumberOption; } set { this.RoutingNumberOption = new Option(value); } } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The e-mail of the shopper, included if an e-mail was sent to the shopper. /// /// The e-mail of the shopper, included if an e-mail was sent to the shopper. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of SortCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SortCodeOption { get; private set; } /// /// The sort code of the bank transfer. /// /// The sort code of the bank transfer. - [DataMember(Name = "sortCode", EmitDefaultValue = false)] - public string SortCode { get; set; } + [JsonPropertyName("sortCode")] + public string SortCode { get { return this.SortCodeOption; } set { this.SortCodeOption = new Option(value); } } + + /// + /// Used to track the state of TotalAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TotalAmountOption { get; private set; } /// /// Gets or Sets TotalAmount /// - [DataMember(Name = "totalAmount", EmitDefaultValue = false)] - public Amount TotalAmount { get; set; } + [JsonPropertyName("totalAmount")] + public Amount TotalAmount { get { return this.TotalAmountOption; } set { this.TotalAmountOption = new Option(value); } } + + /// + /// Used to track the state of Url + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UrlOption { get; private set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [DataMember(Name = "url", EmitDefaultValue = false)] - public string Url { get; set; } + [JsonPropertyName("url")] + public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -183,6 +300,7 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutBankTransferAction {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" AccountNumber: ").Append(AccountNumber).Append("\n"); sb.Append(" Beneficiary: ").Append(Beneficiary).Append("\n"); sb.Append(" Bic: ").Append(Bic).Append("\n"); @@ -194,179 +312,265 @@ public override string ToString() sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" SortCode: ").Append(SortCode).Append("\n"); sb.Append(" TotalAmount: ").Append(TotalAmount).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutBankTransferActionJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CheckoutBankTransferAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CheckoutBankTransferAction); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CheckoutBankTransferAction instances are equal - /// - /// Instance of CheckoutBankTransferAction to be compared - /// Boolean - public bool Equals(CheckoutBankTransferAction input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option type = default; + Option accountNumber = default; + Option beneficiary = default; + Option bic = default; + Option downloadUrl = default; + Option iban = default; + Option paymentMethodType = default; + Option reference = default; + Option routingNumber = default; + Option shopperEmail = default; + Option sortCode = default; + Option totalAmount = default; + Option url = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(CheckoutBankTransferAction.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "accountNumber": + accountNumber = new Option(utf8JsonReader.GetString()); + break; + case "beneficiary": + beneficiary = new Option(utf8JsonReader.GetString()); + break; + case "bic": + bic = new Option(utf8JsonReader.GetString()); + break; + case "downloadUrl": + downloadUrl = new Option(utf8JsonReader.GetString()); + break; + case "iban": + iban = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethodType": + paymentMethodType = new Option(utf8JsonReader.GetString()); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "routingNumber": + routingNumber = new Option(utf8JsonReader.GetString()); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "sortCode": + sortCode = new Option(utf8JsonReader.GetString()); + break; + case "totalAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "url": + url = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AccountNumber == input.AccountNumber || - (this.AccountNumber != null && - this.AccountNumber.Equals(input.AccountNumber)) - ) && - ( - this.Beneficiary == input.Beneficiary || - (this.Beneficiary != null && - this.Beneficiary.Equals(input.Beneficiary)) - ) && - ( - this.Bic == input.Bic || - (this.Bic != null && - this.Bic.Equals(input.Bic)) - ) && - ( - this.DownloadUrl == input.DownloadUrl || - (this.DownloadUrl != null && - this.DownloadUrl.Equals(input.DownloadUrl)) - ) && - ( - this.Iban == input.Iban || - (this.Iban != null && - this.Iban.Equals(input.Iban)) - ) && - ( - this.PaymentMethodType == input.PaymentMethodType || - (this.PaymentMethodType != null && - this.PaymentMethodType.Equals(input.PaymentMethodType)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.RoutingNumber == input.RoutingNumber || - (this.RoutingNumber != null && - this.RoutingNumber.Equals(input.RoutingNumber)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.SortCode == input.SortCode || - (this.SortCode != null && - this.SortCode.Equals(input.SortCode)) - ) && - ( - this.TotalAmount == input.TotalAmount || - (this.TotalAmount != null && - this.TotalAmount.Equals(input.TotalAmount)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class CheckoutBankTransferAction.", nameof(type)); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutBankTransferAction."); + + if (accountNumber.IsSet && accountNumber.Value == null) + throw new ArgumentNullException(nameof(accountNumber), "Property is not nullable for class CheckoutBankTransferAction."); + + if (beneficiary.IsSet && beneficiary.Value == null) + throw new ArgumentNullException(nameof(beneficiary), "Property is not nullable for class CheckoutBankTransferAction."); + + if (bic.IsSet && bic.Value == null) + throw new ArgumentNullException(nameof(bic), "Property is not nullable for class CheckoutBankTransferAction."); + + if (downloadUrl.IsSet && downloadUrl.Value == null) + throw new ArgumentNullException(nameof(downloadUrl), "Property is not nullable for class CheckoutBankTransferAction."); + + if (iban.IsSet && iban.Value == null) + throw new ArgumentNullException(nameof(iban), "Property is not nullable for class CheckoutBankTransferAction."); + + if (paymentMethodType.IsSet && paymentMethodType.Value == null) + throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutBankTransferAction."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CheckoutBankTransferAction."); + + if (routingNumber.IsSet && routingNumber.Value == null) + throw new ArgumentNullException(nameof(routingNumber), "Property is not nullable for class CheckoutBankTransferAction."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class CheckoutBankTransferAction."); + + if (sortCode.IsSet && sortCode.Value == null) + throw new ArgumentNullException(nameof(sortCode), "Property is not nullable for class CheckoutBankTransferAction."); + + if (totalAmount.IsSet && totalAmount.Value == null) + throw new ArgumentNullException(nameof(totalAmount), "Property is not nullable for class CheckoutBankTransferAction."); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutBankTransferAction."); + + return new CheckoutBankTransferAction(type.Value.Value, accountNumber, beneficiary, bic, downloadUrl, iban, paymentMethodType, reference, routingNumber, shopperEmail, sortCode, totalAmount, url); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutBankTransferAction checkoutBankTransferAction, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AccountNumber != null) - { - hashCode = (hashCode * 59) + this.AccountNumber.GetHashCode(); - } - if (this.Beneficiary != null) - { - hashCode = (hashCode * 59) + this.Beneficiary.GetHashCode(); - } - if (this.Bic != null) - { - hashCode = (hashCode * 59) + this.Bic.GetHashCode(); - } - if (this.DownloadUrl != null) - { - hashCode = (hashCode * 59) + this.DownloadUrl.GetHashCode(); - } - if (this.Iban != null) - { - hashCode = (hashCode * 59) + this.Iban.GetHashCode(); - } - if (this.PaymentMethodType != null) - { - hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.RoutingNumber != null) - { - hashCode = (hashCode * 59) + this.RoutingNumber.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.SortCode != null) - { - hashCode = (hashCode * 59) + this.SortCode.GetHashCode(); - } - if (this.TotalAmount != null) - { - hashCode = (hashCode * 59) + this.TotalAmount.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.Url != null) - { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, checkoutBankTransferAction, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutBankTransferAction checkoutBankTransferAction, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (checkoutBankTransferAction.AccountNumberOption.IsSet && checkoutBankTransferAction.AccountNumber == null) + throw new ArgumentNullException(nameof(checkoutBankTransferAction.AccountNumber), "Property is required for class CheckoutBankTransferAction."); + + if (checkoutBankTransferAction.BeneficiaryOption.IsSet && checkoutBankTransferAction.Beneficiary == null) + throw new ArgumentNullException(nameof(checkoutBankTransferAction.Beneficiary), "Property is required for class CheckoutBankTransferAction."); + + if (checkoutBankTransferAction.BicOption.IsSet && checkoutBankTransferAction.Bic == null) + throw new ArgumentNullException(nameof(checkoutBankTransferAction.Bic), "Property is required for class CheckoutBankTransferAction."); + + if (checkoutBankTransferAction.DownloadUrlOption.IsSet && checkoutBankTransferAction.DownloadUrl == null) + throw new ArgumentNullException(nameof(checkoutBankTransferAction.DownloadUrl), "Property is required for class CheckoutBankTransferAction."); + + if (checkoutBankTransferAction.IbanOption.IsSet && checkoutBankTransferAction.Iban == null) + throw new ArgumentNullException(nameof(checkoutBankTransferAction.Iban), "Property is required for class CheckoutBankTransferAction."); + + if (checkoutBankTransferAction.PaymentMethodTypeOption.IsSet && checkoutBankTransferAction.PaymentMethodType == null) + throw new ArgumentNullException(nameof(checkoutBankTransferAction.PaymentMethodType), "Property is required for class CheckoutBankTransferAction."); + + if (checkoutBankTransferAction.ReferenceOption.IsSet && checkoutBankTransferAction.Reference == null) + throw new ArgumentNullException(nameof(checkoutBankTransferAction.Reference), "Property is required for class CheckoutBankTransferAction."); + + if (checkoutBankTransferAction.RoutingNumberOption.IsSet && checkoutBankTransferAction.RoutingNumber == null) + throw new ArgumentNullException(nameof(checkoutBankTransferAction.RoutingNumber), "Property is required for class CheckoutBankTransferAction."); + + if (checkoutBankTransferAction.ShopperEmailOption.IsSet && checkoutBankTransferAction.ShopperEmail == null) + throw new ArgumentNullException(nameof(checkoutBankTransferAction.ShopperEmail), "Property is required for class CheckoutBankTransferAction."); + + if (checkoutBankTransferAction.SortCodeOption.IsSet && checkoutBankTransferAction.SortCode == null) + throw new ArgumentNullException(nameof(checkoutBankTransferAction.SortCode), "Property is required for class CheckoutBankTransferAction."); + + if (checkoutBankTransferAction.TotalAmountOption.IsSet && checkoutBankTransferAction.TotalAmount == null) + throw new ArgumentNullException(nameof(checkoutBankTransferAction.TotalAmount), "Property is required for class CheckoutBankTransferAction."); + + if (checkoutBankTransferAction.UrlOption.IsSet && checkoutBankTransferAction.Url == null) + throw new ArgumentNullException(nameof(checkoutBankTransferAction.Url), "Property is required for class CheckoutBankTransferAction."); + + var typeRawValue = CheckoutBankTransferAction.TypeEnumToJsonValue(checkoutBankTransferAction.Type); + writer.WriteString("type", typeRawValue); + if (checkoutBankTransferAction.AccountNumberOption.IsSet) + writer.WriteString("accountNumber", checkoutBankTransferAction.AccountNumber); + + if (checkoutBankTransferAction.BeneficiaryOption.IsSet) + writer.WriteString("beneficiary", checkoutBankTransferAction.Beneficiary); + + if (checkoutBankTransferAction.BicOption.IsSet) + writer.WriteString("bic", checkoutBankTransferAction.Bic); + + if (checkoutBankTransferAction.DownloadUrlOption.IsSet) + writer.WriteString("downloadUrl", checkoutBankTransferAction.DownloadUrl); + + if (checkoutBankTransferAction.IbanOption.IsSet) + writer.WriteString("iban", checkoutBankTransferAction.Iban); + + if (checkoutBankTransferAction.PaymentMethodTypeOption.IsSet) + writer.WriteString("paymentMethodType", checkoutBankTransferAction.PaymentMethodType); + + if (checkoutBankTransferAction.ReferenceOption.IsSet) + writer.WriteString("reference", checkoutBankTransferAction.Reference); + + if (checkoutBankTransferAction.RoutingNumberOption.IsSet) + writer.WriteString("routingNumber", checkoutBankTransferAction.RoutingNumber); + + if (checkoutBankTransferAction.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", checkoutBankTransferAction.ShopperEmail); + + if (checkoutBankTransferAction.SortCodeOption.IsSet) + writer.WriteString("sortCode", checkoutBankTransferAction.SortCode); + + if (checkoutBankTransferAction.TotalAmountOption.IsSet) + { + writer.WritePropertyName("totalAmount"); + JsonSerializer.Serialize(writer, checkoutBankTransferAction.TotalAmount, jsonSerializerOptions); + } + if (checkoutBankTransferAction.UrlOption.IsSet) + writer.WriteString("url", checkoutBankTransferAction.Url); } } - } diff --git a/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs b/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs index 87781b5f4..79a699557 100644 --- a/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs +++ b/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,103 +14,172 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CheckoutDelegatedAuthenticationAction /// - [DataContract(Name = "CheckoutDelegatedAuthenticationAction")] - public partial class CheckoutDelegatedAuthenticationAction : IEquatable, IValidatableObject + public partial class CheckoutDelegatedAuthenticationAction : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// **delegatedAuthentication** + /// A token needed to authorise a payment. + /// Encoded payment data. + /// Specifies the payment method. + /// A token to pass to the delegatedAuthentication component. + /// Specifies the URL to redirect to. + [JsonConstructor] + public CheckoutDelegatedAuthenticationAction(TypeEnum type, Option authorisationToken = default, Option paymentData = default, Option paymentMethodType = default, Option token = default, Option url = default) + { + Type = type; + AuthorisationTokenOption = authorisationToken; + PaymentDataOption = paymentData; + PaymentMethodTypeOption = paymentMethodType; + TokenOption = token; + UrlOption = url; + OnCreated(); + } + + partial void OnCreated(); + /// /// **delegatedAuthentication** /// /// **delegatedAuthentication** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum DelegatedAuthentication for value: delegatedAuthentication /// - [EnumMember(Value = "delegatedAuthentication")] DelegatedAuthentication = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("delegatedAuthentication")) + return TypeEnum.DelegatedAuthentication; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("delegatedAuthentication")) + return TypeEnum.DelegatedAuthentication; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.DelegatedAuthentication) + return "delegatedAuthentication"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **delegatedAuthentication** /// /// **delegatedAuthentication** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected CheckoutDelegatedAuthenticationAction() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of AuthorisationToken /// - /// A token needed to authorise a payment.. - /// Encoded payment data.. - /// Specifies the payment method.. - /// A token to pass to the delegatedAuthentication component.. - /// **delegatedAuthentication** (required). - /// Specifies the URL to redirect to.. - public CheckoutDelegatedAuthenticationAction(string authorisationToken = default(string), string paymentData = default(string), string paymentMethodType = default(string), string token = default(string), TypeEnum type = default(TypeEnum), string url = default(string)) - { - this.Type = type; - this.AuthorisationToken = authorisationToken; - this.PaymentData = paymentData; - this.PaymentMethodType = paymentMethodType; - this.Token = token; - this.Url = url; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthorisationTokenOption { get; private set; } /// /// A token needed to authorise a payment. /// /// A token needed to authorise a payment. - [DataMember(Name = "authorisationToken", EmitDefaultValue = false)] - public string AuthorisationToken { get; set; } + [JsonPropertyName("authorisationToken")] + public string AuthorisationToken { get { return this.AuthorisationTokenOption; } set { this.AuthorisationTokenOption = new Option(value); } } + + /// + /// Used to track the state of PaymentData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentDataOption { get; private set; } /// /// Encoded payment data. /// /// Encoded payment data. - [DataMember(Name = "paymentData", EmitDefaultValue = false)] - public string PaymentData { get; set; } + [JsonPropertyName("paymentData")] + public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethodType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodTypeOption { get; private set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] - public string PaymentMethodType { get; set; } + [JsonPropertyName("paymentMethodType")] + public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } + + /// + /// Used to track the state of Token + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TokenOption { get; private set; } /// /// A token to pass to the delegatedAuthentication component. /// /// A token to pass to the delegatedAuthentication component. - [DataMember(Name = "token", EmitDefaultValue = false)] - public string Token { get; set; } + [JsonPropertyName("token")] + public string Token { get { return this.TokenOption; } set { this.TokenOption = new Option(value); } } + + /// + /// Used to track the state of Url + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UrlOption { get; private set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [DataMember(Name = "url", EmitDefaultValue = false)] - public string Url { get; set; } + [JsonPropertyName("url")] + public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -121,120 +189,176 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutDelegatedAuthenticationAction {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" AuthorisationToken: ").Append(AuthorisationToken).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); sb.Append(" Token: ").Append(Token).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutDelegatedAuthenticationActionJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CheckoutDelegatedAuthenticationAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CheckoutDelegatedAuthenticationAction); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CheckoutDelegatedAuthenticationAction instances are equal - /// - /// Instance of CheckoutDelegatedAuthenticationAction to be compared - /// Boolean - public bool Equals(CheckoutDelegatedAuthenticationAction input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option type = default; + Option authorisationToken = default; + Option paymentData = default; + Option paymentMethodType = default; + Option token = default; + Option url = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(CheckoutDelegatedAuthenticationAction.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "authorisationToken": + authorisationToken = new Option(utf8JsonReader.GetString()); + break; + case "paymentData": + paymentData = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethodType": + paymentMethodType = new Option(utf8JsonReader.GetString()); + break; + case "token": + token = new Option(utf8JsonReader.GetString()); + break; + case "url": + url = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AuthorisationToken == input.AuthorisationToken || - (this.AuthorisationToken != null && - this.AuthorisationToken.Equals(input.AuthorisationToken)) - ) && - ( - this.PaymentData == input.PaymentData || - (this.PaymentData != null && - this.PaymentData.Equals(input.PaymentData)) - ) && - ( - this.PaymentMethodType == input.PaymentMethodType || - (this.PaymentMethodType != null && - this.PaymentMethodType.Equals(input.PaymentMethodType)) - ) && - ( - this.Token == input.Token || - (this.Token != null && - this.Token.Equals(input.Token)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class CheckoutDelegatedAuthenticationAction.", nameof(type)); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutDelegatedAuthenticationAction."); + + if (authorisationToken.IsSet && authorisationToken.Value == null) + throw new ArgumentNullException(nameof(authorisationToken), "Property is not nullable for class CheckoutDelegatedAuthenticationAction."); + + if (paymentData.IsSet && paymentData.Value == null) + throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class CheckoutDelegatedAuthenticationAction."); + + if (paymentMethodType.IsSet && paymentMethodType.Value == null) + throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutDelegatedAuthenticationAction."); + + if (token.IsSet && token.Value == null) + throw new ArgumentNullException(nameof(token), "Property is not nullable for class CheckoutDelegatedAuthenticationAction."); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutDelegatedAuthenticationAction."); + + return new CheckoutDelegatedAuthenticationAction(type.Value.Value, authorisationToken, paymentData, paymentMethodType, token, url); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutDelegatedAuthenticationAction checkoutDelegatedAuthenticationAction, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AuthorisationToken != null) - { - hashCode = (hashCode * 59) + this.AuthorisationToken.GetHashCode(); - } - if (this.PaymentData != null) - { - hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); - } - if (this.PaymentMethodType != null) - { - hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); - } - if (this.Token != null) - { - hashCode = (hashCode * 59) + this.Token.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.Url != null) - { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, checkoutDelegatedAuthenticationAction, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutDelegatedAuthenticationAction checkoutDelegatedAuthenticationAction, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (checkoutDelegatedAuthenticationAction.AuthorisationTokenOption.IsSet && checkoutDelegatedAuthenticationAction.AuthorisationToken == null) + throw new ArgumentNullException(nameof(checkoutDelegatedAuthenticationAction.AuthorisationToken), "Property is required for class CheckoutDelegatedAuthenticationAction."); + + if (checkoutDelegatedAuthenticationAction.PaymentDataOption.IsSet && checkoutDelegatedAuthenticationAction.PaymentData == null) + throw new ArgumentNullException(nameof(checkoutDelegatedAuthenticationAction.PaymentData), "Property is required for class CheckoutDelegatedAuthenticationAction."); + + if (checkoutDelegatedAuthenticationAction.PaymentMethodTypeOption.IsSet && checkoutDelegatedAuthenticationAction.PaymentMethodType == null) + throw new ArgumentNullException(nameof(checkoutDelegatedAuthenticationAction.PaymentMethodType), "Property is required for class CheckoutDelegatedAuthenticationAction."); + + if (checkoutDelegatedAuthenticationAction.TokenOption.IsSet && checkoutDelegatedAuthenticationAction.Token == null) + throw new ArgumentNullException(nameof(checkoutDelegatedAuthenticationAction.Token), "Property is required for class CheckoutDelegatedAuthenticationAction."); + + if (checkoutDelegatedAuthenticationAction.UrlOption.IsSet && checkoutDelegatedAuthenticationAction.Url == null) + throw new ArgumentNullException(nameof(checkoutDelegatedAuthenticationAction.Url), "Property is required for class CheckoutDelegatedAuthenticationAction."); + + var typeRawValue = CheckoutDelegatedAuthenticationAction.TypeEnumToJsonValue(checkoutDelegatedAuthenticationAction.Type); + writer.WriteString("type", typeRawValue); + if (checkoutDelegatedAuthenticationAction.AuthorisationTokenOption.IsSet) + writer.WriteString("authorisationToken", checkoutDelegatedAuthenticationAction.AuthorisationToken); + + if (checkoutDelegatedAuthenticationAction.PaymentDataOption.IsSet) + writer.WriteString("paymentData", checkoutDelegatedAuthenticationAction.PaymentData); + + if (checkoutDelegatedAuthenticationAction.PaymentMethodTypeOption.IsSet) + writer.WriteString("paymentMethodType", checkoutDelegatedAuthenticationAction.PaymentMethodType); + + if (checkoutDelegatedAuthenticationAction.TokenOption.IsSet) + writer.WriteString("token", checkoutDelegatedAuthenticationAction.Token); + + if (checkoutDelegatedAuthenticationAction.UrlOption.IsSet) + writer.WriteString("url", checkoutDelegatedAuthenticationAction.Url); } } - } diff --git a/Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs b/Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs index c30bf7a47..569ae0451 100644 --- a/Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs +++ b/Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,103 +14,172 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CheckoutNativeRedirectAction /// - [DataContract(Name = "CheckoutNativeRedirectAction")] - public partial class CheckoutNativeRedirectAction : IEquatable, IValidatableObject + public partial class CheckoutNativeRedirectAction : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// **nativeRedirect** + /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. + /// Specifies the HTTP method, for example GET or POST. + /// Native SDK's redirect data containing the direct issuer link and state data that must be submitted to the /v1/nativeRedirect/redirectResult. + /// Specifies the payment method. + /// Specifies the URL to redirect to. + [JsonConstructor] + public CheckoutNativeRedirectAction(TypeEnum type, Option> data = default, Option method = default, Option nativeRedirectData = default, Option paymentMethodType = default, Option url = default) + { + Type = type; + DataOption = data; + MethodOption = method; + NativeRedirectDataOption = nativeRedirectData; + PaymentMethodTypeOption = paymentMethodType; + UrlOption = url; + OnCreated(); + } + + partial void OnCreated(); + /// /// **nativeRedirect** /// /// **nativeRedirect** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum NativeRedirect for value: nativeRedirect /// - [EnumMember(Value = "nativeRedirect")] NativeRedirect = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("nativeRedirect")) + return TypeEnum.NativeRedirect; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("nativeRedirect")) + return TypeEnum.NativeRedirect; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.NativeRedirect) + return "nativeRedirect"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **nativeRedirect** /// /// **nativeRedirect** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected CheckoutNativeRedirectAction() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of Data /// - /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL.. - /// Specifies the HTTP method, for example GET or POST.. - /// Native SDK's redirect data containing the direct issuer link and state data that must be submitted to the /v1/nativeRedirect/redirectResult.. - /// Specifies the payment method.. - /// **nativeRedirect** (required). - /// Specifies the URL to redirect to.. - public CheckoutNativeRedirectAction(Dictionary data = default(Dictionary), string method = default(string), string nativeRedirectData = default(string), string paymentMethodType = default(string), TypeEnum type = default(TypeEnum), string url = default(string)) - { - this.Type = type; - this.Data = data; - this.Method = method; - this.NativeRedirectData = nativeRedirectData; - this.PaymentMethodType = paymentMethodType; - this.Url = url; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> DataOption { get; private set; } /// /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. /// /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. - [DataMember(Name = "data", EmitDefaultValue = false)] - public Dictionary Data { get; set; } + [JsonPropertyName("data")] + public Dictionary Data { get { return this.DataOption; } set { this.DataOption = new Option>(value); } } + + /// + /// Used to track the state of Method + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MethodOption { get; private set; } /// /// Specifies the HTTP method, for example GET or POST. /// /// Specifies the HTTP method, for example GET or POST. - [DataMember(Name = "method", EmitDefaultValue = false)] - public string Method { get; set; } + [JsonPropertyName("method")] + public string Method { get { return this.MethodOption; } set { this.MethodOption = new Option(value); } } + + /// + /// Used to track the state of NativeRedirectData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NativeRedirectDataOption { get; private set; } /// /// Native SDK's redirect data containing the direct issuer link and state data that must be submitted to the /v1/nativeRedirect/redirectResult. /// /// Native SDK's redirect data containing the direct issuer link and state data that must be submitted to the /v1/nativeRedirect/redirectResult. - [DataMember(Name = "nativeRedirectData", EmitDefaultValue = false)] - public string NativeRedirectData { get; set; } + [JsonPropertyName("nativeRedirectData")] + public string NativeRedirectData { get { return this.NativeRedirectDataOption; } set { this.NativeRedirectDataOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethodType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodTypeOption { get; private set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] - public string PaymentMethodType { get; set; } + [JsonPropertyName("paymentMethodType")] + public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } + + /// + /// Used to track the state of Url + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UrlOption { get; private set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [DataMember(Name = "url", EmitDefaultValue = false)] - public string Url { get; set; } + [JsonPropertyName("url")] + public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -121,121 +189,179 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutNativeRedirectAction {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Data: ").Append(Data).Append("\n"); sb.Append(" Method: ").Append(Method).Append("\n"); sb.Append(" NativeRedirectData: ").Append(NativeRedirectData).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutNativeRedirectActionJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CheckoutNativeRedirectAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CheckoutNativeRedirectAction); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CheckoutNativeRedirectAction instances are equal - /// - /// Instance of CheckoutNativeRedirectAction to be compared - /// Boolean - public bool Equals(CheckoutNativeRedirectAction input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option type = default; + Option> data = default; + Option method = default; + Option nativeRedirectData = default; + Option paymentMethodType = default; + Option url = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(CheckoutNativeRedirectAction.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "data": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + data = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "method": + method = new Option(utf8JsonReader.GetString()); + break; + case "nativeRedirectData": + nativeRedirectData = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethodType": + paymentMethodType = new Option(utf8JsonReader.GetString()); + break; + case "url": + url = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Data == input.Data || - this.Data != null && - input.Data != null && - this.Data.SequenceEqual(input.Data) - ) && - ( - this.Method == input.Method || - (this.Method != null && - this.Method.Equals(input.Method)) - ) && - ( - this.NativeRedirectData == input.NativeRedirectData || - (this.NativeRedirectData != null && - this.NativeRedirectData.Equals(input.NativeRedirectData)) - ) && - ( - this.PaymentMethodType == input.PaymentMethodType || - (this.PaymentMethodType != null && - this.PaymentMethodType.Equals(input.PaymentMethodType)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class CheckoutNativeRedirectAction.", nameof(type)); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutNativeRedirectAction."); + + if (data.IsSet && data.Value == null) + throw new ArgumentNullException(nameof(data), "Property is not nullable for class CheckoutNativeRedirectAction."); + + if (method.IsSet && method.Value == null) + throw new ArgumentNullException(nameof(method), "Property is not nullable for class CheckoutNativeRedirectAction."); + + if (nativeRedirectData.IsSet && nativeRedirectData.Value == null) + throw new ArgumentNullException(nameof(nativeRedirectData), "Property is not nullable for class CheckoutNativeRedirectAction."); + + if (paymentMethodType.IsSet && paymentMethodType.Value == null) + throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutNativeRedirectAction."); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutNativeRedirectAction."); + + return new CheckoutNativeRedirectAction(type.Value.Value, data, method, nativeRedirectData, paymentMethodType, url); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutNativeRedirectAction checkoutNativeRedirectAction, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - { - hashCode = (hashCode * 59) + this.Data.GetHashCode(); - } - if (this.Method != null) - { - hashCode = (hashCode * 59) + this.Method.GetHashCode(); - } - if (this.NativeRedirectData != null) - { - hashCode = (hashCode * 59) + this.NativeRedirectData.GetHashCode(); - } - if (this.PaymentMethodType != null) - { - hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.Url != null) - { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, checkoutNativeRedirectAction, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutNativeRedirectAction checkoutNativeRedirectAction, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (checkoutNativeRedirectAction.DataOption.IsSet && checkoutNativeRedirectAction.Data == null) + throw new ArgumentNullException(nameof(checkoutNativeRedirectAction.Data), "Property is required for class CheckoutNativeRedirectAction."); + + if (checkoutNativeRedirectAction.MethodOption.IsSet && checkoutNativeRedirectAction.Method == null) + throw new ArgumentNullException(nameof(checkoutNativeRedirectAction.Method), "Property is required for class CheckoutNativeRedirectAction."); + + if (checkoutNativeRedirectAction.NativeRedirectDataOption.IsSet && checkoutNativeRedirectAction.NativeRedirectData == null) + throw new ArgumentNullException(nameof(checkoutNativeRedirectAction.NativeRedirectData), "Property is required for class CheckoutNativeRedirectAction."); + + if (checkoutNativeRedirectAction.PaymentMethodTypeOption.IsSet && checkoutNativeRedirectAction.PaymentMethodType == null) + throw new ArgumentNullException(nameof(checkoutNativeRedirectAction.PaymentMethodType), "Property is required for class CheckoutNativeRedirectAction."); + + if (checkoutNativeRedirectAction.UrlOption.IsSet && checkoutNativeRedirectAction.Url == null) + throw new ArgumentNullException(nameof(checkoutNativeRedirectAction.Url), "Property is required for class CheckoutNativeRedirectAction."); + + var typeRawValue = CheckoutNativeRedirectAction.TypeEnumToJsonValue(checkoutNativeRedirectAction.Type); + writer.WriteString("type", typeRawValue); + if (checkoutNativeRedirectAction.DataOption.IsSet) + { + writer.WritePropertyName("data"); + JsonSerializer.Serialize(writer, checkoutNativeRedirectAction.Data, jsonSerializerOptions); + } + if (checkoutNativeRedirectAction.MethodOption.IsSet) + writer.WriteString("method", checkoutNativeRedirectAction.Method); + + if (checkoutNativeRedirectAction.NativeRedirectDataOption.IsSet) + writer.WriteString("nativeRedirectData", checkoutNativeRedirectAction.NativeRedirectData); + + if (checkoutNativeRedirectAction.PaymentMethodTypeOption.IsSet) + writer.WriteString("paymentMethodType", checkoutNativeRedirectAction.PaymentMethodType); + + if (checkoutNativeRedirectAction.UrlOption.IsSet) + writer.WriteString("url", checkoutNativeRedirectAction.Url); } } - } diff --git a/Adyen/Model/Checkout/CheckoutOrderResponse.cs b/Adyen/Model/Checkout/CheckoutOrderResponse.cs index c72484841..3eb86bac3 100644 --- a/Adyen/Model/Checkout/CheckoutOrderResponse.cs +++ b/Adyen/Model/Checkout/CheckoutOrderResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,86 +14,117 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CheckoutOrderResponse /// - [DataContract(Name = "CheckoutOrderResponse")] - public partial class CheckoutOrderResponse : IEquatable, IValidatableObject + public partial class CheckoutOrderResponse : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected CheckoutOrderResponse() { } - /// - /// Initializes a new instance of the class. - /// - /// amount. - /// The expiry date for the order.. - /// The encrypted order data.. - /// The `pspReference` that belongs to the order. (required). - /// The merchant reference for the order.. - /// remainingAmount. - public CheckoutOrderResponse(Amount amount = default(Amount), string expiresAt = default(string), string orderData = default(string), string pspReference = default(string), string reference = default(string), Amount remainingAmount = default(Amount)) + /// The `pspReference` that belongs to the order. + /// amount + /// The expiry date for the order. + /// The encrypted order data. + /// The merchant reference for the order. + /// remainingAmount + [JsonConstructor] + public CheckoutOrderResponse(string pspReference, Option amount = default, Option expiresAt = default, Option orderData = default, Option reference = default, Option remainingAmount = default) { - this.PspReference = pspReference; - this.Amount = amount; - this.ExpiresAt = expiresAt; - this.OrderData = orderData; - this.Reference = reference; - this.RemainingAmount = remainingAmount; + PspReference = pspReference; + AmountOption = amount; + ExpiresAtOption = expiresAt; + OrderDataOption = orderData; + ReferenceOption = reference; + RemainingAmountOption = remainingAmount; + OnCreated(); } + partial void OnCreated(); + + /// + /// The `pspReference` that belongs to the order. + /// + /// The `pspReference` that belongs to the order. + [JsonPropertyName("pspReference")] + public string PspReference { get; set; } + + /// + /// Used to track the state of Amount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountOption { get; private set; } + /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonPropertyName("amount")] + public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } + + /// + /// Used to track the state of ExpiresAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiresAtOption { get; private set; } /// /// The expiry date for the order. /// /// The expiry date for the order. - [DataMember(Name = "expiresAt", EmitDefaultValue = false)] - public string ExpiresAt { get; set; } + [JsonPropertyName("expiresAt")] + public string ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } + + /// + /// Used to track the state of OrderData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OrderDataOption { get; private set; } /// /// The encrypted order data. /// /// The encrypted order data. - [DataMember(Name = "orderData", EmitDefaultValue = false)] - public string OrderData { get; set; } + [JsonPropertyName("orderData")] + public string OrderData { get { return this.OrderDataOption; } set { this.OrderDataOption = new Option(value); } } /// - /// The `pspReference` that belongs to the order. + /// Used to track the state of Reference /// - /// The `pspReference` that belongs to the order. - [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] - public string PspReference { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// The merchant reference for the order. /// /// The merchant reference for the order. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + + /// + /// Used to track the state of RemainingAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RemainingAmountOption { get; private set; } /// /// Gets or Sets RemainingAmount /// - [DataMember(Name = "remainingAmount", EmitDefaultValue = false)] - public Amount RemainingAmount { get; set; } + [JsonPropertyName("remainingAmount")] + public Amount RemainingAmount { get { return this.RemainingAmountOption; } set { this.RemainingAmountOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -104,10 +134,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutOrderResponse {\n"); + sb.Append(" PspReference: ").Append(PspReference).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append(" OrderData: ").Append(OrderData).Append("\n"); - sb.Append(" PspReference: ").Append(PspReference).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" RemainingAmount: ").Append(RemainingAmount).Append("\n"); sb.Append("}\n"); @@ -115,113 +145,173 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutOrderResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CheckoutOrderResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CheckoutOrderResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CheckoutOrderResponse instances are equal - /// - /// Instance of CheckoutOrderResponse to be compared - /// Boolean - public bool Equals(CheckoutOrderResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option pspReference = default; + Option amount = default; + Option expiresAt = default; + Option orderData = default; + Option reference = default; + Option remainingAmount = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "expiresAt": + expiresAt = new Option(utf8JsonReader.GetString()); + break; + case "orderData": + orderData = new Option(utf8JsonReader.GetString()); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "remainingAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + remainingAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.ExpiresAt == input.ExpiresAt || - (this.ExpiresAt != null && - this.ExpiresAt.Equals(input.ExpiresAt)) - ) && - ( - this.OrderData == input.OrderData || - (this.OrderData != null && - this.OrderData.Equals(input.OrderData)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.RemainingAmount == input.RemainingAmount || - (this.RemainingAmount != null && - this.RemainingAmount.Equals(input.RemainingAmount)) - ); + + if (!pspReference.IsSet) + throw new ArgumentException("Property is required for class CheckoutOrderResponse.", nameof(pspReference)); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class CheckoutOrderResponse."); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class CheckoutOrderResponse."); + + if (expiresAt.IsSet && expiresAt.Value == null) + throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CheckoutOrderResponse."); + + if (orderData.IsSet && orderData.Value == null) + throw new ArgumentNullException(nameof(orderData), "Property is not nullable for class CheckoutOrderResponse."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CheckoutOrderResponse."); + + if (remainingAmount.IsSet && remainingAmount.Value == null) + throw new ArgumentNullException(nameof(remainingAmount), "Property is not nullable for class CheckoutOrderResponse."); + + return new CheckoutOrderResponse(pspReference.Value, amount, expiresAt, orderData, reference, remainingAmount); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutOrderResponse checkoutOrderResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.ExpiresAt != null) - { - hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); - } - if (this.OrderData != null) - { - hashCode = (hashCode * 59) + this.OrderData.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.RemainingAmount != null) - { - hashCode = (hashCode * 59) + this.RemainingAmount.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, checkoutOrderResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutOrderResponse checkoutOrderResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (checkoutOrderResponse.PspReference == null) + throw new ArgumentNullException(nameof(checkoutOrderResponse.PspReference), "Property is required for class CheckoutOrderResponse."); + + if (checkoutOrderResponse.AmountOption.IsSet && checkoutOrderResponse.Amount == null) + throw new ArgumentNullException(nameof(checkoutOrderResponse.Amount), "Property is required for class CheckoutOrderResponse."); + + if (checkoutOrderResponse.ExpiresAtOption.IsSet && checkoutOrderResponse.ExpiresAt == null) + throw new ArgumentNullException(nameof(checkoutOrderResponse.ExpiresAt), "Property is required for class CheckoutOrderResponse."); + + if (checkoutOrderResponse.OrderDataOption.IsSet && checkoutOrderResponse.OrderData == null) + throw new ArgumentNullException(nameof(checkoutOrderResponse.OrderData), "Property is required for class CheckoutOrderResponse."); + + if (checkoutOrderResponse.ReferenceOption.IsSet && checkoutOrderResponse.Reference == null) + throw new ArgumentNullException(nameof(checkoutOrderResponse.Reference), "Property is required for class CheckoutOrderResponse."); + + if (checkoutOrderResponse.RemainingAmountOption.IsSet && checkoutOrderResponse.RemainingAmount == null) + throw new ArgumentNullException(nameof(checkoutOrderResponse.RemainingAmount), "Property is required for class CheckoutOrderResponse."); + + writer.WriteString("pspReference", checkoutOrderResponse.PspReference); + + if (checkoutOrderResponse.AmountOption.IsSet) + { + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, checkoutOrderResponse.Amount, jsonSerializerOptions); + } + if (checkoutOrderResponse.ExpiresAtOption.IsSet) + writer.WriteString("expiresAt", checkoutOrderResponse.ExpiresAt); + + if (checkoutOrderResponse.OrderDataOption.IsSet) + writer.WriteString("orderData", checkoutOrderResponse.OrderData); + + if (checkoutOrderResponse.ReferenceOption.IsSet) + writer.WriteString("reference", checkoutOrderResponse.Reference); + + if (checkoutOrderResponse.RemainingAmountOption.IsSet) + { + writer.WritePropertyName("remainingAmount"); + JsonSerializer.Serialize(writer, checkoutOrderResponse.RemainingAmount, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/CheckoutPaymentMethod.cs b/Adyen/Model/Checkout/CheckoutPaymentMethod.cs index 36e4632ac..5a142e324 100644 --- a/Adyen/Model/Checkout/CheckoutPaymentMethod.cs +++ b/Adyen/Model/Checkout/CheckoutPaymentMethod.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,1397 +14,801 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; -using System.Reflection; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// The type and required details of a payment method to use. /// - [JsonConverter(typeof(CheckoutPaymentMethodJsonConverter))] - [DataContract(Name = "CheckoutPaymentMethod")] - public partial class CheckoutPaymentMethod : AbstractOpenAPISchema, IEquatable, IValidatableObject + public partial class CheckoutPaymentMethod : IValidatableObject { /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of AchDetails. - public CheckoutPaymentMethod(AchDetails actualInstance) + /// + public CheckoutPaymentMethod(AchDetails achDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + AchDetails = achDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of AffirmDetails. - public CheckoutPaymentMethod(AffirmDetails actualInstance) + /// + public CheckoutPaymentMethod(AffirmDetails affirmDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + AffirmDetails = affirmDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of AfterpayDetails. - public CheckoutPaymentMethod(AfterpayDetails actualInstance) + /// + public CheckoutPaymentMethod(AfterpayDetails afterpayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + AfterpayDetails = afterpayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of AmazonPayDetails. - public CheckoutPaymentMethod(AmazonPayDetails actualInstance) + /// + public CheckoutPaymentMethod(AmazonPayDetails amazonPayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + AmazonPayDetails = amazonPayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of AncvDetails. - public CheckoutPaymentMethod(AncvDetails actualInstance) + /// + public CheckoutPaymentMethod(AncvDetails ancvDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + AncvDetails = ancvDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of AndroidPayDetails. - public CheckoutPaymentMethod(AndroidPayDetails actualInstance) + /// + public CheckoutPaymentMethod(AndroidPayDetails androidPayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + AndroidPayDetails = androidPayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of ApplePayDetails. - public CheckoutPaymentMethod(ApplePayDetails actualInstance) + /// + public CheckoutPaymentMethod(ApplePayDetails applePayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + ApplePayDetails = applePayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of BacsDirectDebitDetails. - public CheckoutPaymentMethod(BacsDirectDebitDetails actualInstance) + /// + public CheckoutPaymentMethod(BacsDirectDebitDetails bacsDirectDebitDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + BacsDirectDebitDetails = bacsDirectDebitDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of BillDeskDetails. - public CheckoutPaymentMethod(BillDeskDetails actualInstance) + /// + public CheckoutPaymentMethod(BillDeskDetails billDeskDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + BillDeskDetails = billDeskDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of BlikDetails. - public CheckoutPaymentMethod(BlikDetails actualInstance) + /// + public CheckoutPaymentMethod(BlikDetails blikDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + BlikDetails = blikDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of CardDetails. - public CheckoutPaymentMethod(CardDetails actualInstance) + /// + public CheckoutPaymentMethod(CardDetails cardDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + CardDetails = cardDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of CashAppDetails. - public CheckoutPaymentMethod(CashAppDetails actualInstance) + /// + public CheckoutPaymentMethod(CashAppDetails cashAppDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + CashAppDetails = cashAppDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of CellulantDetails. - public CheckoutPaymentMethod(CellulantDetails actualInstance) + /// + public CheckoutPaymentMethod(CellulantDetails cellulantDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + CellulantDetails = cellulantDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of DokuDetails. - public CheckoutPaymentMethod(DokuDetails actualInstance) + /// + public CheckoutPaymentMethod(DokuDetails dokuDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + DokuDetails = dokuDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of DragonpayDetails. - public CheckoutPaymentMethod(DragonpayDetails actualInstance) + /// + public CheckoutPaymentMethod(DragonpayDetails dragonpayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + DragonpayDetails = dragonpayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of EBankingFinlandDetails. - public CheckoutPaymentMethod(EBankingFinlandDetails actualInstance) + /// + public CheckoutPaymentMethod(EBankingFinlandDetails eBankingFinlandDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + EBankingFinlandDetails = eBankingFinlandDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of EcontextVoucherDetails. - public CheckoutPaymentMethod(EcontextVoucherDetails actualInstance) + /// + public CheckoutPaymentMethod(EcontextVoucherDetails econtextVoucherDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + EcontextVoucherDetails = econtextVoucherDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of EftDetails. - public CheckoutPaymentMethod(EftDetails actualInstance) + /// + public CheckoutPaymentMethod(EftDetails eftDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + EftDetails = eftDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of FastlaneDetails. - public CheckoutPaymentMethod(FastlaneDetails actualInstance) + /// + public CheckoutPaymentMethod(FastlaneDetails fastlaneDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + FastlaneDetails = fastlaneDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of GenericIssuerPaymentMethodDetails. - public CheckoutPaymentMethod(GenericIssuerPaymentMethodDetails actualInstance) + /// + public CheckoutPaymentMethod(GenericIssuerPaymentMethodDetails genericIssuerPaymentMethodDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + GenericIssuerPaymentMethodDetails = genericIssuerPaymentMethodDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of GooglePayDetails. - public CheckoutPaymentMethod(GooglePayDetails actualInstance) + /// + public CheckoutPaymentMethod(GooglePayDetails googlePayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + GooglePayDetails = googlePayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of IdealDetails. - public CheckoutPaymentMethod(IdealDetails actualInstance) + /// + public CheckoutPaymentMethod(IdealDetails idealDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IdealDetails = idealDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of KlarnaDetails. - public CheckoutPaymentMethod(KlarnaDetails actualInstance) + /// + public CheckoutPaymentMethod(KlarnaDetails klarnaDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + KlarnaDetails = klarnaDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of MasterpassDetails. - public CheckoutPaymentMethod(MasterpassDetails actualInstance) + /// + public CheckoutPaymentMethod(MasterpassDetails masterpassDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + MasterpassDetails = masterpassDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of MbwayDetails. - public CheckoutPaymentMethod(MbwayDetails actualInstance) + /// + public CheckoutPaymentMethod(MbwayDetails mbwayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + MbwayDetails = mbwayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of MobilePayDetails. - public CheckoutPaymentMethod(MobilePayDetails actualInstance) + /// + public CheckoutPaymentMethod(MobilePayDetails mobilePayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + MobilePayDetails = mobilePayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of MolPayDetails. - public CheckoutPaymentMethod(MolPayDetails actualInstance) + /// + public CheckoutPaymentMethod(MolPayDetails molPayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + MolPayDetails = molPayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of OpenInvoiceDetails. - public CheckoutPaymentMethod(OpenInvoiceDetails actualInstance) + /// + public CheckoutPaymentMethod(OpenInvoiceDetails openInvoiceDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + OpenInvoiceDetails = openInvoiceDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of PayByBankAISDirectDebitDetails. - public CheckoutPaymentMethod(PayByBankAISDirectDebitDetails actualInstance) + /// + public CheckoutPaymentMethod(PayByBankAISDirectDebitDetails payByBankAISDirectDebitDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + PayByBankAISDirectDebitDetails = payByBankAISDirectDebitDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of PayByBankDetails. - public CheckoutPaymentMethod(PayByBankDetails actualInstance) + /// + public CheckoutPaymentMethod(PayByBankDetails payByBankDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + PayByBankDetails = payByBankDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of PayPalDetails. - public CheckoutPaymentMethod(PayPalDetails actualInstance) + /// + public CheckoutPaymentMethod(PayPalDetails payPalDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + PayPalDetails = payPalDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of PayPayDetails. - public CheckoutPaymentMethod(PayPayDetails actualInstance) + /// + public CheckoutPaymentMethod(PayPayDetails payPayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + PayPayDetails = payPayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of PayToDetails. - public CheckoutPaymentMethod(PayToDetails actualInstance) + /// + public CheckoutPaymentMethod(PayToDetails payToDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + PayToDetails = payToDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of PayUUpiDetails. - public CheckoutPaymentMethod(PayUUpiDetails actualInstance) + /// + public CheckoutPaymentMethod(PayUUpiDetails payUUpiDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + PayUUpiDetails = payUUpiDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of PayWithGoogleDetails. - public CheckoutPaymentMethod(PayWithGoogleDetails actualInstance) + /// + public CheckoutPaymentMethod(PayWithGoogleDetails payWithGoogleDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + PayWithGoogleDetails = payWithGoogleDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of PaymentDetails. - public CheckoutPaymentMethod(PaymentDetails actualInstance) + /// + public CheckoutPaymentMethod(PaymentDetails paymentDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + PaymentDetails = paymentDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of PixDetails. - public CheckoutPaymentMethod(PixDetails actualInstance) + /// + public CheckoutPaymentMethod(PixDetails pixDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + PixDetails = pixDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of PseDetails. - public CheckoutPaymentMethod(PseDetails actualInstance) + /// + public CheckoutPaymentMethod(PseDetails pseDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + PseDetails = pseDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of RakutenPayDetails. - public CheckoutPaymentMethod(RakutenPayDetails actualInstance) + /// + public CheckoutPaymentMethod(RakutenPayDetails rakutenPayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + RakutenPayDetails = rakutenPayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of RatepayDetails. - public CheckoutPaymentMethod(RatepayDetails actualInstance) + /// + public CheckoutPaymentMethod(RatepayDetails ratepayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + RatepayDetails = ratepayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of RivertyDetails. - public CheckoutPaymentMethod(RivertyDetails actualInstance) + /// + public CheckoutPaymentMethod(RivertyDetails rivertyDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + RivertyDetails = rivertyDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of SamsungPayDetails. - public CheckoutPaymentMethod(SamsungPayDetails actualInstance) + /// + public CheckoutPaymentMethod(SamsungPayDetails samsungPayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + SamsungPayDetails = samsungPayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of SepaDirectDebitDetails. - public CheckoutPaymentMethod(SepaDirectDebitDetails actualInstance) + /// + public CheckoutPaymentMethod(SepaDirectDebitDetails sepaDirectDebitDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + SepaDirectDebitDetails = sepaDirectDebitDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of StoredPaymentMethodDetails. - public CheckoutPaymentMethod(StoredPaymentMethodDetails actualInstance) + /// + public CheckoutPaymentMethod(StoredPaymentMethodDetails storedPaymentMethodDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + StoredPaymentMethodDetails = storedPaymentMethodDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of TwintDetails. - public CheckoutPaymentMethod(TwintDetails actualInstance) + /// + public CheckoutPaymentMethod(TwintDetails twintDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + TwintDetails = twintDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of UpiCollectDetails. - public CheckoutPaymentMethod(UpiCollectDetails actualInstance) + /// + public CheckoutPaymentMethod(UpiCollectDetails upiCollectDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + UpiCollectDetails = upiCollectDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of UpiIntentDetails. - public CheckoutPaymentMethod(UpiIntentDetails actualInstance) + /// + public CheckoutPaymentMethod(UpiIntentDetails upiIntentDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + UpiIntentDetails = upiIntentDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of VippsDetails. - public CheckoutPaymentMethod(VippsDetails actualInstance) + /// + public CheckoutPaymentMethod(VippsDetails vippsDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + VippsDetails = vippsDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of VisaCheckoutDetails. - public CheckoutPaymentMethod(VisaCheckoutDetails actualInstance) + /// + public CheckoutPaymentMethod(VisaCheckoutDetails visaCheckoutDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + VisaCheckoutDetails = visaCheckoutDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of WeChatPayDetails. - public CheckoutPaymentMethod(WeChatPayDetails actualInstance) + /// + public CheckoutPaymentMethod(WeChatPayDetails weChatPayDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + WeChatPayDetails = weChatPayDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of WeChatPayMiniProgramDetails. - public CheckoutPaymentMethod(WeChatPayMiniProgramDetails actualInstance) + /// + public CheckoutPaymentMethod(WeChatPayMiniProgramDetails weChatPayMiniProgramDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + WeChatPayMiniProgramDetails = weChatPayMiniProgramDetails; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of ZipDetails. - public CheckoutPaymentMethod(ZipDetails actualInstance) + /// + public CheckoutPaymentMethod(ZipDetails zipDetails) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + ZipDetails = zipDetails; + OnCreated(); } - - private Object _actualInstance; + partial void OnCreated(); /// - /// Gets or Sets ActualInstance + /// Gets or Sets AchDetails /// - public override Object ActualInstance - { - get - { - return _actualInstance; - } - set - { - if (value.GetType() == typeof(AchDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(AffirmDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(AfterpayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(AmazonPayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(AncvDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(AndroidPayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(ApplePayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(BacsDirectDebitDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(BillDeskDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(BlikDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(CardDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(CashAppDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(CellulantDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(DokuDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(DragonpayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(EBankingFinlandDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(EcontextVoucherDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(EftDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(FastlaneDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(GenericIssuerPaymentMethodDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(GooglePayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(IdealDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(KlarnaDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(MasterpassDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(MbwayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(MobilePayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(MolPayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(OpenInvoiceDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(PayByBankAISDirectDebitDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(PayByBankDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(PayPalDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(PayPayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(PayToDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(PayUUpiDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(PayWithGoogleDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(PaymentDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(PixDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(PseDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(RakutenPayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(RatepayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(RivertyDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(SamsungPayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(SepaDirectDebitDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(StoredPaymentMethodDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(TwintDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(UpiCollectDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(UpiIntentDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(VippsDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(VisaCheckoutDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(WeChatPayDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(WeChatPayMiniProgramDetails)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(ZipDetails)) - { - this._actualInstance = value; - } - else - { - throw new ArgumentException("Invalid instance found. Must be the following types: AchDetails, AffirmDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, FastlaneDetails, GenericIssuerPaymentMethodDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayPayDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PixDetails, PseDetails, RakutenPayDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails"); - } - } - } + public AchDetails AchDetails { get; set; } /// - /// Get the actual instance of `AchDetails`. If the actual instance is not `AchDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets AffirmDetails /// - /// An instance of AchDetails - public AchDetails GetAchDetails() - { - return (AchDetails)this.ActualInstance; - } + public AffirmDetails AffirmDetails { get; set; } /// - /// Get the actual instance of `AffirmDetails`. If the actual instance is not `AffirmDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets AfterpayDetails /// - /// An instance of AffirmDetails - public AffirmDetails GetAffirmDetails() - { - return (AffirmDetails)this.ActualInstance; - } + public AfterpayDetails AfterpayDetails { get; set; } /// - /// Get the actual instance of `AfterpayDetails`. If the actual instance is not `AfterpayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets AmazonPayDetails /// - /// An instance of AfterpayDetails - public AfterpayDetails GetAfterpayDetails() - { - return (AfterpayDetails)this.ActualInstance; - } + public AmazonPayDetails AmazonPayDetails { get; set; } /// - /// Get the actual instance of `AmazonPayDetails`. If the actual instance is not `AmazonPayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets AncvDetails /// - /// An instance of AmazonPayDetails - public AmazonPayDetails GetAmazonPayDetails() - { - return (AmazonPayDetails)this.ActualInstance; - } + public AncvDetails AncvDetails { get; set; } /// - /// Get the actual instance of `AncvDetails`. If the actual instance is not `AncvDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets AndroidPayDetails /// - /// An instance of AncvDetails - public AncvDetails GetAncvDetails() - { - return (AncvDetails)this.ActualInstance; - } + public AndroidPayDetails AndroidPayDetails { get; set; } /// - /// Get the actual instance of `AndroidPayDetails`. If the actual instance is not `AndroidPayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets ApplePayDetails /// - /// An instance of AndroidPayDetails - public AndroidPayDetails GetAndroidPayDetails() - { - return (AndroidPayDetails)this.ActualInstance; - } + public ApplePayDetails ApplePayDetails { get; set; } /// - /// Get the actual instance of `ApplePayDetails`. If the actual instance is not `ApplePayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets BacsDirectDebitDetails /// - /// An instance of ApplePayDetails - public ApplePayDetails GetApplePayDetails() - { - return (ApplePayDetails)this.ActualInstance; - } + public BacsDirectDebitDetails BacsDirectDebitDetails { get; set; } /// - /// Get the actual instance of `BacsDirectDebitDetails`. If the actual instance is not `BacsDirectDebitDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets BillDeskDetails /// - /// An instance of BacsDirectDebitDetails - public BacsDirectDebitDetails GetBacsDirectDebitDetails() - { - return (BacsDirectDebitDetails)this.ActualInstance; - } + public BillDeskDetails BillDeskDetails { get; set; } /// - /// Get the actual instance of `BillDeskDetails`. If the actual instance is not `BillDeskDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets BlikDetails /// - /// An instance of BillDeskDetails - public BillDeskDetails GetBillDeskDetails() - { - return (BillDeskDetails)this.ActualInstance; - } + public BlikDetails BlikDetails { get; set; } /// - /// Get the actual instance of `BlikDetails`. If the actual instance is not `BlikDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets CardDetails /// - /// An instance of BlikDetails - public BlikDetails GetBlikDetails() - { - return (BlikDetails)this.ActualInstance; - } + public CardDetails CardDetails { get; set; } /// - /// Get the actual instance of `CardDetails`. If the actual instance is not `CardDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets CashAppDetails /// - /// An instance of CardDetails - public CardDetails GetCardDetails() - { - return (CardDetails)this.ActualInstance; - } + public CashAppDetails CashAppDetails { get; set; } /// - /// Get the actual instance of `CashAppDetails`. If the actual instance is not `CashAppDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets CellulantDetails /// - /// An instance of CashAppDetails - public CashAppDetails GetCashAppDetails() - { - return (CashAppDetails)this.ActualInstance; - } + public CellulantDetails CellulantDetails { get; set; } /// - /// Get the actual instance of `CellulantDetails`. If the actual instance is not `CellulantDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets DokuDetails /// - /// An instance of CellulantDetails - public CellulantDetails GetCellulantDetails() - { - return (CellulantDetails)this.ActualInstance; - } + public DokuDetails DokuDetails { get; set; } /// - /// Get the actual instance of `DokuDetails`. If the actual instance is not `DokuDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets DragonpayDetails /// - /// An instance of DokuDetails - public DokuDetails GetDokuDetails() - { - return (DokuDetails)this.ActualInstance; - } + public DragonpayDetails DragonpayDetails { get; set; } /// - /// Get the actual instance of `DragonpayDetails`. If the actual instance is not `DragonpayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets EBankingFinlandDetails /// - /// An instance of DragonpayDetails - public DragonpayDetails GetDragonpayDetails() - { - return (DragonpayDetails)this.ActualInstance; - } + public EBankingFinlandDetails EBankingFinlandDetails { get; set; } /// - /// Get the actual instance of `EBankingFinlandDetails`. If the actual instance is not `EBankingFinlandDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets EcontextVoucherDetails /// - /// An instance of EBankingFinlandDetails - public EBankingFinlandDetails GetEBankingFinlandDetails() - { - return (EBankingFinlandDetails)this.ActualInstance; - } + public EcontextVoucherDetails EcontextVoucherDetails { get; set; } /// - /// Get the actual instance of `EcontextVoucherDetails`. If the actual instance is not `EcontextVoucherDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets EftDetails /// - /// An instance of EcontextVoucherDetails - public EcontextVoucherDetails GetEcontextVoucherDetails() - { - return (EcontextVoucherDetails)this.ActualInstance; - } + public EftDetails EftDetails { get; set; } /// - /// Get the actual instance of `EftDetails`. If the actual instance is not `EftDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets FastlaneDetails /// - /// An instance of EftDetails - public EftDetails GetEftDetails() - { - return (EftDetails)this.ActualInstance; - } + public FastlaneDetails FastlaneDetails { get; set; } /// - /// Get the actual instance of `FastlaneDetails`. If the actual instance is not `FastlaneDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets GenericIssuerPaymentMethodDetails /// - /// An instance of FastlaneDetails - public FastlaneDetails GetFastlaneDetails() - { - return (FastlaneDetails)this.ActualInstance; - } + public GenericIssuerPaymentMethodDetails GenericIssuerPaymentMethodDetails { get; set; } /// - /// Get the actual instance of `GenericIssuerPaymentMethodDetails`. If the actual instance is not `GenericIssuerPaymentMethodDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets GooglePayDetails /// - /// An instance of GenericIssuerPaymentMethodDetails - public GenericIssuerPaymentMethodDetails GetGenericIssuerPaymentMethodDetails() - { - return (GenericIssuerPaymentMethodDetails)this.ActualInstance; - } + public GooglePayDetails GooglePayDetails { get; set; } /// - /// Get the actual instance of `GooglePayDetails`. If the actual instance is not `GooglePayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets IdealDetails /// - /// An instance of GooglePayDetails - public GooglePayDetails GetGooglePayDetails() - { - return (GooglePayDetails)this.ActualInstance; - } + public IdealDetails IdealDetails { get; set; } /// - /// Get the actual instance of `IdealDetails`. If the actual instance is not `IdealDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets KlarnaDetails /// - /// An instance of IdealDetails - public IdealDetails GetIdealDetails() - { - return (IdealDetails)this.ActualInstance; - } + public KlarnaDetails KlarnaDetails { get; set; } /// - /// Get the actual instance of `KlarnaDetails`. If the actual instance is not `KlarnaDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets MasterpassDetails /// - /// An instance of KlarnaDetails - public KlarnaDetails GetKlarnaDetails() - { - return (KlarnaDetails)this.ActualInstance; - } + public MasterpassDetails MasterpassDetails { get; set; } /// - /// Get the actual instance of `MasterpassDetails`. If the actual instance is not `MasterpassDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets MbwayDetails /// - /// An instance of MasterpassDetails - public MasterpassDetails GetMasterpassDetails() - { - return (MasterpassDetails)this.ActualInstance; - } + public MbwayDetails MbwayDetails { get; set; } /// - /// Get the actual instance of `MbwayDetails`. If the actual instance is not `MbwayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets MobilePayDetails /// - /// An instance of MbwayDetails - public MbwayDetails GetMbwayDetails() - { - return (MbwayDetails)this.ActualInstance; - } + public MobilePayDetails MobilePayDetails { get; set; } /// - /// Get the actual instance of `MobilePayDetails`. If the actual instance is not `MobilePayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets MolPayDetails /// - /// An instance of MobilePayDetails - public MobilePayDetails GetMobilePayDetails() - { - return (MobilePayDetails)this.ActualInstance; - } + public MolPayDetails MolPayDetails { get; set; } /// - /// Get the actual instance of `MolPayDetails`. If the actual instance is not `MolPayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets OpenInvoiceDetails /// - /// An instance of MolPayDetails - public MolPayDetails GetMolPayDetails() - { - return (MolPayDetails)this.ActualInstance; - } + public OpenInvoiceDetails OpenInvoiceDetails { get; set; } /// - /// Get the actual instance of `OpenInvoiceDetails`. If the actual instance is not `OpenInvoiceDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets PayByBankAISDirectDebitDetails /// - /// An instance of OpenInvoiceDetails - public OpenInvoiceDetails GetOpenInvoiceDetails() - { - return (OpenInvoiceDetails)this.ActualInstance; - } + public PayByBankAISDirectDebitDetails PayByBankAISDirectDebitDetails { get; set; } /// - /// Get the actual instance of `PayByBankAISDirectDebitDetails`. If the actual instance is not `PayByBankAISDirectDebitDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets PayByBankDetails /// - /// An instance of PayByBankAISDirectDebitDetails - public PayByBankAISDirectDebitDetails GetPayByBankAISDirectDebitDetails() - { - return (PayByBankAISDirectDebitDetails)this.ActualInstance; - } + public PayByBankDetails PayByBankDetails { get; set; } /// - /// Get the actual instance of `PayByBankDetails`. If the actual instance is not `PayByBankDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets PayPalDetails /// - /// An instance of PayByBankDetails - public PayByBankDetails GetPayByBankDetails() - { - return (PayByBankDetails)this.ActualInstance; - } + public PayPalDetails PayPalDetails { get; set; } /// - /// Get the actual instance of `PayPalDetails`. If the actual instance is not `PayPalDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets PayPayDetails /// - /// An instance of PayPalDetails - public PayPalDetails GetPayPalDetails() - { - return (PayPalDetails)this.ActualInstance; - } + public PayPayDetails PayPayDetails { get; set; } /// - /// Get the actual instance of `PayPayDetails`. If the actual instance is not `PayPayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets PayToDetails /// - /// An instance of PayPayDetails - public PayPayDetails GetPayPayDetails() - { - return (PayPayDetails)this.ActualInstance; - } + public PayToDetails PayToDetails { get; set; } /// - /// Get the actual instance of `PayToDetails`. If the actual instance is not `PayToDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets PayUUpiDetails /// - /// An instance of PayToDetails - public PayToDetails GetPayToDetails() - { - return (PayToDetails)this.ActualInstance; - } + public PayUUpiDetails PayUUpiDetails { get; set; } /// - /// Get the actual instance of `PayUUpiDetails`. If the actual instance is not `PayUUpiDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets PayWithGoogleDetails /// - /// An instance of PayUUpiDetails - public PayUUpiDetails GetPayUUpiDetails() - { - return (PayUUpiDetails)this.ActualInstance; - } + public PayWithGoogleDetails PayWithGoogleDetails { get; set; } /// - /// Get the actual instance of `PayWithGoogleDetails`. If the actual instance is not `PayWithGoogleDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets PaymentDetails /// - /// An instance of PayWithGoogleDetails - public PayWithGoogleDetails GetPayWithGoogleDetails() - { - return (PayWithGoogleDetails)this.ActualInstance; - } + public PaymentDetails PaymentDetails { get; set; } /// - /// Get the actual instance of `PaymentDetails`. If the actual instance is not `PaymentDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets PixDetails /// - /// An instance of PaymentDetails - public PaymentDetails GetPaymentDetails() - { - return (PaymentDetails)this.ActualInstance; - } + public PixDetails PixDetails { get; set; } /// - /// Get the actual instance of `PixDetails`. If the actual instance is not `PixDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets PseDetails /// - /// An instance of PixDetails - public PixDetails GetPixDetails() - { - return (PixDetails)this.ActualInstance; - } + public PseDetails PseDetails { get; set; } /// - /// Get the actual instance of `PseDetails`. If the actual instance is not `PseDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets RakutenPayDetails /// - /// An instance of PseDetails - public PseDetails GetPseDetails() - { - return (PseDetails)this.ActualInstance; - } + public RakutenPayDetails RakutenPayDetails { get; set; } /// - /// Get the actual instance of `RakutenPayDetails`. If the actual instance is not `RakutenPayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets RatepayDetails /// - /// An instance of RakutenPayDetails - public RakutenPayDetails GetRakutenPayDetails() - { - return (RakutenPayDetails)this.ActualInstance; - } + public RatepayDetails RatepayDetails { get; set; } /// - /// Get the actual instance of `RatepayDetails`. If the actual instance is not `RatepayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets RivertyDetails /// - /// An instance of RatepayDetails - public RatepayDetails GetRatepayDetails() - { - return (RatepayDetails)this.ActualInstance; - } + public RivertyDetails RivertyDetails { get; set; } /// - /// Get the actual instance of `RivertyDetails`. If the actual instance is not `RivertyDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets SamsungPayDetails /// - /// An instance of RivertyDetails - public RivertyDetails GetRivertyDetails() - { - return (RivertyDetails)this.ActualInstance; - } + public SamsungPayDetails SamsungPayDetails { get; set; } /// - /// Get the actual instance of `SamsungPayDetails`. If the actual instance is not `SamsungPayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets SepaDirectDebitDetails /// - /// An instance of SamsungPayDetails - public SamsungPayDetails GetSamsungPayDetails() - { - return (SamsungPayDetails)this.ActualInstance; - } + public SepaDirectDebitDetails SepaDirectDebitDetails { get; set; } /// - /// Get the actual instance of `SepaDirectDebitDetails`. If the actual instance is not `SepaDirectDebitDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets StoredPaymentMethodDetails /// - /// An instance of SepaDirectDebitDetails - public SepaDirectDebitDetails GetSepaDirectDebitDetails() - { - return (SepaDirectDebitDetails)this.ActualInstance; - } + public StoredPaymentMethodDetails StoredPaymentMethodDetails { get; set; } /// - /// Get the actual instance of `StoredPaymentMethodDetails`. If the actual instance is not `StoredPaymentMethodDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets TwintDetails /// - /// An instance of StoredPaymentMethodDetails - public StoredPaymentMethodDetails GetStoredPaymentMethodDetails() - { - return (StoredPaymentMethodDetails)this.ActualInstance; - } + public TwintDetails TwintDetails { get; set; } /// - /// Get the actual instance of `TwintDetails`. If the actual instance is not `TwintDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets UpiCollectDetails /// - /// An instance of TwintDetails - public TwintDetails GetTwintDetails() - { - return (TwintDetails)this.ActualInstance; - } + public UpiCollectDetails UpiCollectDetails { get; set; } /// - /// Get the actual instance of `UpiCollectDetails`. If the actual instance is not `UpiCollectDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets UpiIntentDetails /// - /// An instance of UpiCollectDetails - public UpiCollectDetails GetUpiCollectDetails() - { - return (UpiCollectDetails)this.ActualInstance; - } + public UpiIntentDetails UpiIntentDetails { get; set; } /// - /// Get the actual instance of `UpiIntentDetails`. If the actual instance is not `UpiIntentDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets VippsDetails /// - /// An instance of UpiIntentDetails - public UpiIntentDetails GetUpiIntentDetails() - { - return (UpiIntentDetails)this.ActualInstance; - } + public VippsDetails VippsDetails { get; set; } /// - /// Get the actual instance of `VippsDetails`. If the actual instance is not `VippsDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets VisaCheckoutDetails /// - /// An instance of VippsDetails - public VippsDetails GetVippsDetails() - { - return (VippsDetails)this.ActualInstance; - } + public VisaCheckoutDetails VisaCheckoutDetails { get; set; } /// - /// Get the actual instance of `VisaCheckoutDetails`. If the actual instance is not `VisaCheckoutDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets WeChatPayDetails /// - /// An instance of VisaCheckoutDetails - public VisaCheckoutDetails GetVisaCheckoutDetails() - { - return (VisaCheckoutDetails)this.ActualInstance; - } + public WeChatPayDetails WeChatPayDetails { get; set; } /// - /// Get the actual instance of `WeChatPayDetails`. If the actual instance is not `WeChatPayDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets WeChatPayMiniProgramDetails /// - /// An instance of WeChatPayDetails - public WeChatPayDetails GetWeChatPayDetails() - { - return (WeChatPayDetails)this.ActualInstance; - } + public WeChatPayMiniProgramDetails WeChatPayMiniProgramDetails { get; set; } /// - /// Get the actual instance of `WeChatPayMiniProgramDetails`. If the actual instance is not `WeChatPayMiniProgramDetails`, - /// the InvalidClassException will be thrown + /// Gets or Sets ZipDetails /// - /// An instance of WeChatPayMiniProgramDetails - public WeChatPayMiniProgramDetails GetWeChatPayMiniProgramDetails() - { - return (WeChatPayMiniProgramDetails)this.ActualInstance; - } - - /// - /// Get the actual instance of `ZipDetails`. If the actual instance is not `ZipDetails`, - /// the InvalidClassException will be thrown - /// - /// An instance of ZipDetails - public ZipDetails GetZipDetails() - { - return (ZipDetails)this.ActualInstance; - } + public ZipDetails ZipDetails { get; set; } /// /// Returns the string presentation of the object @@ -1413,519 +816,472 @@ public ZipDetails GetZipDetails() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutPaymentMethod {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public override string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return JsonConvert.SerializeObject(this.ActualInstance, CheckoutPaymentMethod.SerializerSettings); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutPaymentMethodJsonConverter : JsonConverter + { /// - /// Converts the JSON string into an instance of CheckoutPaymentMethod - /// - /// JSON string - /// An instance of CheckoutPaymentMethod - public static CheckoutPaymentMethod FromJson(string jsonString) - { - CheckoutPaymentMethod newCheckoutPaymentMethod = null; - - if (string.IsNullOrEmpty(jsonString)) - { - return newCheckoutPaymentMethod; - } - int match = 0; - List matchedTypes = new List(); - JToken typeToken = JObject.Parse(jsonString).GetValue("type"); - string type = typeToken?.Value(); - // Throw exception if jsonString does not contain type param - if (type == null) - { - throw new InvalidDataException("JsonString does not contain required enum type for deserialization."); - } - try + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override CheckoutPaymentMethod Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + AchDetails achDetails = default; + AffirmDetails affirmDetails = default; + AfterpayDetails afterpayDetails = default; + AmazonPayDetails amazonPayDetails = default; + AncvDetails ancvDetails = default; + AndroidPayDetails androidPayDetails = default; + ApplePayDetails applePayDetails = default; + BacsDirectDebitDetails bacsDirectDebitDetails = default; + BillDeskDetails billDeskDetails = default; + BlikDetails blikDetails = default; + CardDetails cardDetails = default; + CashAppDetails cashAppDetails = default; + CellulantDetails cellulantDetails = default; + DokuDetails dokuDetails = default; + DragonpayDetails dragonpayDetails = default; + EBankingFinlandDetails eBankingFinlandDetails = default; + EcontextVoucherDetails econtextVoucherDetails = default; + EftDetails eftDetails = default; + FastlaneDetails fastlaneDetails = default; + GenericIssuerPaymentMethodDetails genericIssuerPaymentMethodDetails = default; + GooglePayDetails googlePayDetails = default; + IdealDetails idealDetails = default; + KlarnaDetails klarnaDetails = default; + MasterpassDetails masterpassDetails = default; + MbwayDetails mbwayDetails = default; + MobilePayDetails mobilePayDetails = default; + MolPayDetails molPayDetails = default; + OpenInvoiceDetails openInvoiceDetails = default; + PayByBankAISDirectDebitDetails payByBankAISDirectDebitDetails = default; + PayByBankDetails payByBankDetails = default; + PayPalDetails payPalDetails = default; + PayPayDetails payPayDetails = default; + PayToDetails payToDetails = default; + PayUUpiDetails payUUpiDetails = default; + PayWithGoogleDetails payWithGoogleDetails = default; + PaymentDetails paymentDetails = default; + PixDetails pixDetails = default; + PseDetails pseDetails = default; + RakutenPayDetails rakutenPayDetails = default; + RatepayDetails ratepayDetails = default; + RivertyDetails rivertyDetails = default; + SamsungPayDetails samsungPayDetails = default; + SepaDirectDebitDetails sepaDirectDebitDetails = default; + StoredPaymentMethodDetails storedPaymentMethodDetails = default; + TwintDetails twintDetails = default; + UpiCollectDetails upiCollectDetails = default; + UpiIntentDetails upiIntentDetails = default; + VippsDetails vippsDetails = default; + VisaCheckoutDetails visaCheckoutDetails = default; + WeChatPayDetails weChatPayDetails = default; + WeChatPayMiniProgramDetails weChatPayMiniProgramDetails = default; + ZipDetails zipDetails = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) { - // Check if the jsonString type enum matches the AchDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("AchDetails"); - match++; - } - // Check if the jsonString type enum matches the AffirmDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("AffirmDetails"); - match++; - } - // Check if the jsonString type enum matches the AfterpayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("AfterpayDetails"); - match++; - } - // Check if the jsonString type enum matches the AmazonPayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("AmazonPayDetails"); - match++; - } - // Check if the jsonString type enum matches the AncvDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("AncvDetails"); - match++; - } - // Check if the jsonString type enum matches the AndroidPayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("AndroidPayDetails"); - match++; - } - // Check if the jsonString type enum matches the ApplePayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("ApplePayDetails"); - match++; - } - // Check if the jsonString type enum matches the BacsDirectDebitDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("BacsDirectDebitDetails"); - match++; - } - // Check if the jsonString type enum matches the BillDeskDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("BillDeskDetails"); - match++; - } - // Check if the jsonString type enum matches the BlikDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("BlikDetails"); - match++; - } - // Check if the jsonString type enum matches the CardDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("CardDetails"); - match++; - } - // Check if the jsonString type enum matches the CashAppDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("CashAppDetails"); - match++; - } - // Check if the jsonString type enum matches the CellulantDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("CellulantDetails"); - match++; - } - // Check if the jsonString type enum matches the DokuDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("DokuDetails"); - match++; - } - // Check if the jsonString type enum matches the DragonpayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("DragonpayDetails"); - match++; - } - // Check if the jsonString type enum matches the EBankingFinlandDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("EBankingFinlandDetails"); - match++; - } - // Check if the jsonString type enum matches the EcontextVoucherDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("EcontextVoucherDetails"); - match++; - } - // Check if the jsonString type enum matches the EftDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("EftDetails"); - match++; - } - // Check if the jsonString type enum matches the FastlaneDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("FastlaneDetails"); - match++; - } - // Check if the jsonString type enum matches the GenericIssuerPaymentMethodDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("GenericIssuerPaymentMethodDetails"); - match++; - } - // Check if the jsonString type enum matches the GooglePayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("GooglePayDetails"); - match++; - } - // Check if the jsonString type enum matches the IdealDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("IdealDetails"); - match++; - } - // Check if the jsonString type enum matches the KlarnaDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("KlarnaDetails"); - match++; - } - // Check if the jsonString type enum matches the MasterpassDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("MasterpassDetails"); - match++; - } - // Check if the jsonString type enum matches the MbwayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("MbwayDetails"); - match++; - } - // Check if the jsonString type enum matches the MobilePayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("MobilePayDetails"); - match++; - } - // Check if the jsonString type enum matches the MolPayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("MolPayDetails"); - match++; - } - // Check if the jsonString type enum matches the OpenInvoiceDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("OpenInvoiceDetails"); - match++; - } - // Check if the jsonString type enum matches the PayByBankAISDirectDebitDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("PayByBankAISDirectDebitDetails"); - match++; - } - // Check if the jsonString type enum matches the PayByBankDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("PayByBankDetails"); - match++; - } - // Check if the jsonString type enum matches the PayPalDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("PayPalDetails"); - match++; - } - // Check if the jsonString type enum matches the PayPayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("PayPayDetails"); - match++; - } - // Check if the jsonString type enum matches the PayToDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("PayToDetails"); - match++; - } - // Check if the jsonString type enum matches the PayUUpiDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("PayUUpiDetails"); - match++; - } - // Check if the jsonString type enum matches the PayWithGoogleDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("PayWithGoogleDetails"); - match++; - } - // Check if the jsonString type enum matches the PaymentDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("PaymentDetails"); - match++; - } - // Check if the jsonString type enum matches the PixDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("PixDetails"); - match++; - } - // Check if the jsonString type enum matches the PseDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("PseDetails"); - match++; - } - // Check if the jsonString type enum matches the RakutenPayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("RakutenPayDetails"); - match++; - } - // Check if the jsonString type enum matches the RatepayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("RatepayDetails"); - match++; - } - // Check if the jsonString type enum matches the RivertyDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("RivertyDetails"); - match++; - } - // Check if the jsonString type enum matches the SamsungPayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("SamsungPayDetails"); - match++; - } - // Check if the jsonString type enum matches the SepaDirectDebitDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("SepaDirectDebitDetails"); - match++; - } - // Check if the jsonString type enum matches the StoredPaymentMethodDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("StoredPaymentMethodDetails"); - match++; - } - // Check if the jsonString type enum matches the TwintDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("TwintDetails"); - match++; - } - // Check if the jsonString type enum matches the UpiCollectDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("UpiCollectDetails"); - match++; - } - // Check if the jsonString type enum matches the UpiIntentDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("UpiIntentDetails"); - match++; - } - // Check if the jsonString type enum matches the VippsDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("VippsDetails"); - match++; - } - // Check if the jsonString type enum matches the VisaCheckoutDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("VisaCheckoutDetails"); - match++; - } - // Check if the jsonString type enum matches the WeChatPayDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("WeChatPayDetails"); - match++; - } - // Check if the jsonString type enum matches the WeChatPayMiniProgramDetails type enums - if (ContainsValue(type)) - { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("WeChatPayMiniProgramDetails"); - match++; - } - // Check if the jsonString type enum matches the ZipDetails type enums - if (ContainsValue(type)) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) { - newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); - matchedTypes.Add("ZipDetails"); - match++; + Utf8JsonReader utf8JsonReaderAchDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderAchDetails, jsonSerializerOptions, out achDetails); + + Utf8JsonReader utf8JsonReaderAffirmDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderAffirmDetails, jsonSerializerOptions, out affirmDetails); + + Utf8JsonReader utf8JsonReaderAfterpayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderAfterpayDetails, jsonSerializerOptions, out afterpayDetails); + + Utf8JsonReader utf8JsonReaderAmazonPayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderAmazonPayDetails, jsonSerializerOptions, out amazonPayDetails); + + Utf8JsonReader utf8JsonReaderAncvDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderAncvDetails, jsonSerializerOptions, out ancvDetails); + + Utf8JsonReader utf8JsonReaderAndroidPayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderAndroidPayDetails, jsonSerializerOptions, out androidPayDetails); + + Utf8JsonReader utf8JsonReaderApplePayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApplePayDetails, jsonSerializerOptions, out applePayDetails); + + Utf8JsonReader utf8JsonReaderBacsDirectDebitDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBacsDirectDebitDetails, jsonSerializerOptions, out bacsDirectDebitDetails); + + Utf8JsonReader utf8JsonReaderBillDeskDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBillDeskDetails, jsonSerializerOptions, out billDeskDetails); + + Utf8JsonReader utf8JsonReaderBlikDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBlikDetails, jsonSerializerOptions, out blikDetails); + + Utf8JsonReader utf8JsonReaderCardDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderCardDetails, jsonSerializerOptions, out cardDetails); + + Utf8JsonReader utf8JsonReaderCashAppDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderCashAppDetails, jsonSerializerOptions, out cashAppDetails); + + Utf8JsonReader utf8JsonReaderCellulantDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderCellulantDetails, jsonSerializerOptions, out cellulantDetails); + + Utf8JsonReader utf8JsonReaderDokuDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDokuDetails, jsonSerializerOptions, out dokuDetails); + + Utf8JsonReader utf8JsonReaderDragonpayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDragonpayDetails, jsonSerializerOptions, out dragonpayDetails); + + Utf8JsonReader utf8JsonReaderEBankingFinlandDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderEBankingFinlandDetails, jsonSerializerOptions, out eBankingFinlandDetails); + + Utf8JsonReader utf8JsonReaderEcontextVoucherDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderEcontextVoucherDetails, jsonSerializerOptions, out econtextVoucherDetails); + + Utf8JsonReader utf8JsonReaderEftDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderEftDetails, jsonSerializerOptions, out eftDetails); + + Utf8JsonReader utf8JsonReaderFastlaneDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderFastlaneDetails, jsonSerializerOptions, out fastlaneDetails); + + Utf8JsonReader utf8JsonReaderGenericIssuerPaymentMethodDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderGenericIssuerPaymentMethodDetails, jsonSerializerOptions, out genericIssuerPaymentMethodDetails); + + Utf8JsonReader utf8JsonReaderGooglePayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderGooglePayDetails, jsonSerializerOptions, out googlePayDetails); + + Utf8JsonReader utf8JsonReaderIdealDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderIdealDetails, jsonSerializerOptions, out idealDetails); + + Utf8JsonReader utf8JsonReaderKlarnaDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderKlarnaDetails, jsonSerializerOptions, out klarnaDetails); + + Utf8JsonReader utf8JsonReaderMasterpassDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMasterpassDetails, jsonSerializerOptions, out masterpassDetails); + + Utf8JsonReader utf8JsonReaderMbwayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMbwayDetails, jsonSerializerOptions, out mbwayDetails); + + Utf8JsonReader utf8JsonReaderMobilePayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMobilePayDetails, jsonSerializerOptions, out mobilePayDetails); + + Utf8JsonReader utf8JsonReaderMolPayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMolPayDetails, jsonSerializerOptions, out molPayDetails); + + Utf8JsonReader utf8JsonReaderOpenInvoiceDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderOpenInvoiceDetails, jsonSerializerOptions, out openInvoiceDetails); + + Utf8JsonReader utf8JsonReaderPayByBankAISDirectDebitDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderPayByBankAISDirectDebitDetails, jsonSerializerOptions, out payByBankAISDirectDebitDetails); + + Utf8JsonReader utf8JsonReaderPayByBankDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderPayByBankDetails, jsonSerializerOptions, out payByBankDetails); + + Utf8JsonReader utf8JsonReaderPayPalDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderPayPalDetails, jsonSerializerOptions, out payPalDetails); + + Utf8JsonReader utf8JsonReaderPayPayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderPayPayDetails, jsonSerializerOptions, out payPayDetails); + + Utf8JsonReader utf8JsonReaderPayToDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderPayToDetails, jsonSerializerOptions, out payToDetails); + + Utf8JsonReader utf8JsonReaderPayUUpiDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderPayUUpiDetails, jsonSerializerOptions, out payUUpiDetails); + + Utf8JsonReader utf8JsonReaderPayWithGoogleDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderPayWithGoogleDetails, jsonSerializerOptions, out payWithGoogleDetails); + + Utf8JsonReader utf8JsonReaderPaymentDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderPaymentDetails, jsonSerializerOptions, out paymentDetails); + + Utf8JsonReader utf8JsonReaderPixDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderPixDetails, jsonSerializerOptions, out pixDetails); + + Utf8JsonReader utf8JsonReaderPseDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderPseDetails, jsonSerializerOptions, out pseDetails); + + Utf8JsonReader utf8JsonReaderRakutenPayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderRakutenPayDetails, jsonSerializerOptions, out rakutenPayDetails); + + Utf8JsonReader utf8JsonReaderRatepayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderRatepayDetails, jsonSerializerOptions, out ratepayDetails); + + Utf8JsonReader utf8JsonReaderRivertyDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderRivertyDetails, jsonSerializerOptions, out rivertyDetails); + + Utf8JsonReader utf8JsonReaderSamsungPayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderSamsungPayDetails, jsonSerializerOptions, out samsungPayDetails); + + Utf8JsonReader utf8JsonReaderSepaDirectDebitDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderSepaDirectDebitDetails, jsonSerializerOptions, out sepaDirectDebitDetails); + + Utf8JsonReader utf8JsonReaderStoredPaymentMethodDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderStoredPaymentMethodDetails, jsonSerializerOptions, out storedPaymentMethodDetails); + + Utf8JsonReader utf8JsonReaderTwintDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderTwintDetails, jsonSerializerOptions, out twintDetails); + + Utf8JsonReader utf8JsonReaderUpiCollectDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderUpiCollectDetails, jsonSerializerOptions, out upiCollectDetails); + + Utf8JsonReader utf8JsonReaderUpiIntentDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderUpiIntentDetails, jsonSerializerOptions, out upiIntentDetails); + + Utf8JsonReader utf8JsonReaderVippsDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderVippsDetails, jsonSerializerOptions, out vippsDetails); + + Utf8JsonReader utf8JsonReaderVisaCheckoutDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderVisaCheckoutDetails, jsonSerializerOptions, out visaCheckoutDetails); + + Utf8JsonReader utf8JsonReaderWeChatPayDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderWeChatPayDetails, jsonSerializerOptions, out weChatPayDetails); + + Utf8JsonReader utf8JsonReaderWeChatPayMiniProgramDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderWeChatPayMiniProgramDetails, jsonSerializerOptions, out weChatPayMiniProgramDetails); + + Utf8JsonReader utf8JsonReaderZipDetails = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderZipDetails, jsonSerializerOptions, out zipDetails); } - } - catch (Exception ex) + } + + while (utf8JsonReader.Read()) { - if (!(ex is JsonSerializationException)) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - throw new InvalidDataException(string.Format("Failed to deserialize `{0}` into target: {1}", jsonString, ex.ToString())); + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + default: + break; + } } } - if (match != 1) - { - throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined. MatchedTypes are: " + matchedTypes); - } - - // deserialization is considered successful at this point if no exception has been thrown. - return newCheckoutPaymentMethod; - } + if (achDetails != null) + return new CheckoutPaymentMethod(achDetails); - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as CheckoutPaymentMethod); - } + if (affirmDetails != null) + return new CheckoutPaymentMethod(affirmDetails); - /// - /// Returns true if CheckoutPaymentMethod instances are equal - /// - /// Instance of CheckoutPaymentMethod to be compared - /// Boolean - public bool Equals(CheckoutPaymentMethod input) - { - if (input == null) - return false; + if (afterpayDetails != null) + return new CheckoutPaymentMethod(afterpayDetails); - return this.ActualInstance.Equals(input.ActualInstance); - } + if (amazonPayDetails != null) + return new CheckoutPaymentMethod(amazonPayDetails); - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); - return hashCode; - } - } + if (ancvDetails != null) + return new CheckoutPaymentMethod(ancvDetails); - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } + if (androidPayDetails != null) + return new CheckoutPaymentMethod(androidPayDetails); - /// - /// Custom JSON converter for CheckoutPaymentMethod - /// - public class CheckoutPaymentMethodJsonConverter : JsonConverter - { - /// - /// To write the JSON string - /// - /// JSON writer - /// Object to be converted into a JSON string - /// JSON Serializer - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - writer.WriteRawValue((string)(typeof(CheckoutPaymentMethod).GetMethod("ToJson").Invoke(value, null))); + if (applePayDetails != null) + return new CheckoutPaymentMethod(applePayDetails); + + if (bacsDirectDebitDetails != null) + return new CheckoutPaymentMethod(bacsDirectDebitDetails); + + if (billDeskDetails != null) + return new CheckoutPaymentMethod(billDeskDetails); + + if (blikDetails != null) + return new CheckoutPaymentMethod(blikDetails); + + if (cardDetails != null) + return new CheckoutPaymentMethod(cardDetails); + + if (cashAppDetails != null) + return new CheckoutPaymentMethod(cashAppDetails); + + if (cellulantDetails != null) + return new CheckoutPaymentMethod(cellulantDetails); + + if (dokuDetails != null) + return new CheckoutPaymentMethod(dokuDetails); + + if (dragonpayDetails != null) + return new CheckoutPaymentMethod(dragonpayDetails); + + if (eBankingFinlandDetails != null) + return new CheckoutPaymentMethod(eBankingFinlandDetails); + + if (econtextVoucherDetails != null) + return new CheckoutPaymentMethod(econtextVoucherDetails); + + if (eftDetails != null) + return new CheckoutPaymentMethod(eftDetails); + + if (fastlaneDetails != null) + return new CheckoutPaymentMethod(fastlaneDetails); + + if (genericIssuerPaymentMethodDetails != null) + return new CheckoutPaymentMethod(genericIssuerPaymentMethodDetails); + + if (googlePayDetails != null) + return new CheckoutPaymentMethod(googlePayDetails); + + if (idealDetails != null) + return new CheckoutPaymentMethod(idealDetails); + + if (klarnaDetails != null) + return new CheckoutPaymentMethod(klarnaDetails); + + if (masterpassDetails != null) + return new CheckoutPaymentMethod(masterpassDetails); + + if (mbwayDetails != null) + return new CheckoutPaymentMethod(mbwayDetails); + + if (mobilePayDetails != null) + return new CheckoutPaymentMethod(mobilePayDetails); + + if (molPayDetails != null) + return new CheckoutPaymentMethod(molPayDetails); + + if (openInvoiceDetails != null) + return new CheckoutPaymentMethod(openInvoiceDetails); + + if (payByBankAISDirectDebitDetails != null) + return new CheckoutPaymentMethod(payByBankAISDirectDebitDetails); + + if (payByBankDetails != null) + return new CheckoutPaymentMethod(payByBankDetails); + + if (payPalDetails != null) + return new CheckoutPaymentMethod(payPalDetails); + + if (payPayDetails != null) + return new CheckoutPaymentMethod(payPayDetails); + + if (payToDetails != null) + return new CheckoutPaymentMethod(payToDetails); + + if (payUUpiDetails != null) + return new CheckoutPaymentMethod(payUUpiDetails); + + if (payWithGoogleDetails != null) + return new CheckoutPaymentMethod(payWithGoogleDetails); + + if (paymentDetails != null) + return new CheckoutPaymentMethod(paymentDetails); + + if (pixDetails != null) + return new CheckoutPaymentMethod(pixDetails); + + if (pseDetails != null) + return new CheckoutPaymentMethod(pseDetails); + + if (rakutenPayDetails != null) + return new CheckoutPaymentMethod(rakutenPayDetails); + + if (ratepayDetails != null) + return new CheckoutPaymentMethod(ratepayDetails); + + if (rivertyDetails != null) + return new CheckoutPaymentMethod(rivertyDetails); + + if (samsungPayDetails != null) + return new CheckoutPaymentMethod(samsungPayDetails); + + if (sepaDirectDebitDetails != null) + return new CheckoutPaymentMethod(sepaDirectDebitDetails); + + if (storedPaymentMethodDetails != null) + return new CheckoutPaymentMethod(storedPaymentMethodDetails); + + if (twintDetails != null) + return new CheckoutPaymentMethod(twintDetails); + + if (upiCollectDetails != null) + return new CheckoutPaymentMethod(upiCollectDetails); + + if (upiIntentDetails != null) + return new CheckoutPaymentMethod(upiIntentDetails); + + if (vippsDetails != null) + return new CheckoutPaymentMethod(vippsDetails); + + if (visaCheckoutDetails != null) + return new CheckoutPaymentMethod(visaCheckoutDetails); + + if (weChatPayDetails != null) + return new CheckoutPaymentMethod(weChatPayDetails); + + if (weChatPayMiniProgramDetails != null) + return new CheckoutPaymentMethod(weChatPayMiniProgramDetails); + + if (zipDetails != null) + return new CheckoutPaymentMethod(zipDetails); + + throw new JsonException(); } /// - /// To convert a JSON string into an object + /// Serializes a /// - /// JSON reader - /// Object type - /// Existing value - /// JSON Serializer - /// The object converted from the JSON string - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutPaymentMethod checkoutPaymentMethod, JsonSerializerOptions jsonSerializerOptions) { - if(reader.TokenType != JsonToken.Null) - { - return CheckoutPaymentMethod.FromJson(JObject.Load(reader).ToString(Formatting.None)); - } - return null; + writer.WriteStartObject(); + + WriteProperties(writer, checkoutPaymentMethod, jsonSerializerOptions); + writer.WriteEndObject(); } /// - /// Check if the object can be converted + /// Serializes the properties of /// - /// Object type - /// True if the object can be converted - public override bool CanConvert(Type objectType) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutPaymentMethod checkoutPaymentMethod, JsonSerializerOptions jsonSerializerOptions) { - return false; + } } - } diff --git a/Adyen/Model/Checkout/CheckoutQrCodeAction.cs b/Adyen/Model/Checkout/CheckoutQrCodeAction.cs index 074401e07..14f87ee07 100644 --- a/Adyen/Model/Checkout/CheckoutQrCodeAction.cs +++ b/Adyen/Model/Checkout/CheckoutQrCodeAction.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,103 +14,172 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CheckoutQrCodeAction /// - [DataContract(Name = "CheckoutQrCodeAction")] - public partial class CheckoutQrCodeAction : IEquatable, IValidatableObject + public partial class CheckoutQrCodeAction : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// **qrCode** + /// Expiry time of the QR code. + /// Encoded payment data. + /// Specifies the payment method. + /// The contents of the QR code as a UTF8 string. + /// Specifies the URL to redirect to. + [JsonConstructor] + public CheckoutQrCodeAction(TypeEnum type, Option expiresAt = default, Option paymentData = default, Option paymentMethodType = default, Option qrCodeData = default, Option url = default) + { + Type = type; + ExpiresAtOption = expiresAt; + PaymentDataOption = paymentData; + PaymentMethodTypeOption = paymentMethodType; + QrCodeDataOption = qrCodeData; + UrlOption = url; + OnCreated(); + } + + partial void OnCreated(); + /// /// **qrCode** /// /// **qrCode** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum QrCode for value: qrCode /// - [EnumMember(Value = "qrCode")] QrCode = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("qrCode")) + return TypeEnum.QrCode; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("qrCode")) + return TypeEnum.QrCode; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.QrCode) + return "qrCode"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **qrCode** /// /// **qrCode** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected CheckoutQrCodeAction() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of ExpiresAt /// - /// Expiry time of the QR code.. - /// Encoded payment data.. - /// Specifies the payment method.. - /// The contents of the QR code as a UTF8 string.. - /// **qrCode** (required). - /// Specifies the URL to redirect to.. - public CheckoutQrCodeAction(string expiresAt = default(string), string paymentData = default(string), string paymentMethodType = default(string), string qrCodeData = default(string), TypeEnum type = default(TypeEnum), string url = default(string)) - { - this.Type = type; - this.ExpiresAt = expiresAt; - this.PaymentData = paymentData; - this.PaymentMethodType = paymentMethodType; - this.QrCodeData = qrCodeData; - this.Url = url; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiresAtOption { get; private set; } /// /// Expiry time of the QR code. /// /// Expiry time of the QR code. - [DataMember(Name = "expiresAt", EmitDefaultValue = false)] - public string ExpiresAt { get; set; } + [JsonPropertyName("expiresAt")] + public string ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } + + /// + /// Used to track the state of PaymentData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentDataOption { get; private set; } /// /// Encoded payment data. /// /// Encoded payment data. - [DataMember(Name = "paymentData", EmitDefaultValue = false)] - public string PaymentData { get; set; } + [JsonPropertyName("paymentData")] + public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethodType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodTypeOption { get; private set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] - public string PaymentMethodType { get; set; } + [JsonPropertyName("paymentMethodType")] + public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } + + /// + /// Used to track the state of QrCodeData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option QrCodeDataOption { get; private set; } /// /// The contents of the QR code as a UTF8 string. /// /// The contents of the QR code as a UTF8 string. - [DataMember(Name = "qrCodeData", EmitDefaultValue = false)] - public string QrCodeData { get; set; } + [JsonPropertyName("qrCodeData")] + public string QrCodeData { get { return this.QrCodeDataOption; } set { this.QrCodeDataOption = new Option(value); } } + + /// + /// Used to track the state of Url + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UrlOption { get; private set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [DataMember(Name = "url", EmitDefaultValue = false)] - public string Url { get; set; } + [JsonPropertyName("url")] + public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -121,120 +189,176 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutQrCodeAction {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); sb.Append(" QrCodeData: ").Append(QrCodeData).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutQrCodeActionJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CheckoutQrCodeAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CheckoutQrCodeAction); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CheckoutQrCodeAction instances are equal - /// - /// Instance of CheckoutQrCodeAction to be compared - /// Boolean - public bool Equals(CheckoutQrCodeAction input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option type = default; + Option expiresAt = default; + Option paymentData = default; + Option paymentMethodType = default; + Option qrCodeData = default; + Option url = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(CheckoutQrCodeAction.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "expiresAt": + expiresAt = new Option(utf8JsonReader.GetString()); + break; + case "paymentData": + paymentData = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethodType": + paymentMethodType = new Option(utf8JsonReader.GetString()); + break; + case "qrCodeData": + qrCodeData = new Option(utf8JsonReader.GetString()); + break; + case "url": + url = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.ExpiresAt == input.ExpiresAt || - (this.ExpiresAt != null && - this.ExpiresAt.Equals(input.ExpiresAt)) - ) && - ( - this.PaymentData == input.PaymentData || - (this.PaymentData != null && - this.PaymentData.Equals(input.PaymentData)) - ) && - ( - this.PaymentMethodType == input.PaymentMethodType || - (this.PaymentMethodType != null && - this.PaymentMethodType.Equals(input.PaymentMethodType)) - ) && - ( - this.QrCodeData == input.QrCodeData || - (this.QrCodeData != null && - this.QrCodeData.Equals(input.QrCodeData)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class CheckoutQrCodeAction.", nameof(type)); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutQrCodeAction."); + + if (expiresAt.IsSet && expiresAt.Value == null) + throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CheckoutQrCodeAction."); + + if (paymentData.IsSet && paymentData.Value == null) + throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class CheckoutQrCodeAction."); + + if (paymentMethodType.IsSet && paymentMethodType.Value == null) + throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutQrCodeAction."); + + if (qrCodeData.IsSet && qrCodeData.Value == null) + throw new ArgumentNullException(nameof(qrCodeData), "Property is not nullable for class CheckoutQrCodeAction."); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutQrCodeAction."); + + return new CheckoutQrCodeAction(type.Value.Value, expiresAt, paymentData, paymentMethodType, qrCodeData, url); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutQrCodeAction checkoutQrCodeAction, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ExpiresAt != null) - { - hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); - } - if (this.PaymentData != null) - { - hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); - } - if (this.PaymentMethodType != null) - { - hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); - } - if (this.QrCodeData != null) - { - hashCode = (hashCode * 59) + this.QrCodeData.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.Url != null) - { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, checkoutQrCodeAction, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutQrCodeAction checkoutQrCodeAction, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (checkoutQrCodeAction.ExpiresAtOption.IsSet && checkoutQrCodeAction.ExpiresAt == null) + throw new ArgumentNullException(nameof(checkoutQrCodeAction.ExpiresAt), "Property is required for class CheckoutQrCodeAction."); + + if (checkoutQrCodeAction.PaymentDataOption.IsSet && checkoutQrCodeAction.PaymentData == null) + throw new ArgumentNullException(nameof(checkoutQrCodeAction.PaymentData), "Property is required for class CheckoutQrCodeAction."); + + if (checkoutQrCodeAction.PaymentMethodTypeOption.IsSet && checkoutQrCodeAction.PaymentMethodType == null) + throw new ArgumentNullException(nameof(checkoutQrCodeAction.PaymentMethodType), "Property is required for class CheckoutQrCodeAction."); + + if (checkoutQrCodeAction.QrCodeDataOption.IsSet && checkoutQrCodeAction.QrCodeData == null) + throw new ArgumentNullException(nameof(checkoutQrCodeAction.QrCodeData), "Property is required for class CheckoutQrCodeAction."); + + if (checkoutQrCodeAction.UrlOption.IsSet && checkoutQrCodeAction.Url == null) + throw new ArgumentNullException(nameof(checkoutQrCodeAction.Url), "Property is required for class CheckoutQrCodeAction."); + + var typeRawValue = CheckoutQrCodeAction.TypeEnumToJsonValue(checkoutQrCodeAction.Type); + writer.WriteString("type", typeRawValue); + if (checkoutQrCodeAction.ExpiresAtOption.IsSet) + writer.WriteString("expiresAt", checkoutQrCodeAction.ExpiresAt); + + if (checkoutQrCodeAction.PaymentDataOption.IsSet) + writer.WriteString("paymentData", checkoutQrCodeAction.PaymentData); + + if (checkoutQrCodeAction.PaymentMethodTypeOption.IsSet) + writer.WriteString("paymentMethodType", checkoutQrCodeAction.PaymentMethodType); + + if (checkoutQrCodeAction.QrCodeDataOption.IsSet) + writer.WriteString("qrCodeData", checkoutQrCodeAction.QrCodeData); + + if (checkoutQrCodeAction.UrlOption.IsSet) + writer.WriteString("url", checkoutQrCodeAction.Url); } } - } diff --git a/Adyen/Model/Checkout/CheckoutRedirectAction.cs b/Adyen/Model/Checkout/CheckoutRedirectAction.cs index 9819c80c3..8d682d9e0 100644 --- a/Adyen/Model/Checkout/CheckoutRedirectAction.cs +++ b/Adyen/Model/Checkout/CheckoutRedirectAction.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,94 +14,156 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CheckoutRedirectAction /// - [DataContract(Name = "CheckoutRedirectAction")] - public partial class CheckoutRedirectAction : IEquatable, IValidatableObject + public partial class CheckoutRedirectAction : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// **redirect** + /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. + /// Specifies the HTTP method, for example GET or POST. + /// Specifies the payment method. + /// Specifies the URL to redirect to. + [JsonConstructor] + public CheckoutRedirectAction(TypeEnum type, Option> data = default, Option method = default, Option paymentMethodType = default, Option url = default) + { + Type = type; + DataOption = data; + MethodOption = method; + PaymentMethodTypeOption = paymentMethodType; + UrlOption = url; + OnCreated(); + } + + partial void OnCreated(); + /// /// **redirect** /// /// **redirect** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Redirect for value: redirect /// - [EnumMember(Value = "redirect")] Redirect = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("redirect")) + return TypeEnum.Redirect; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("redirect")) + return TypeEnum.Redirect; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.Redirect) + return "redirect"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **redirect** /// /// **redirect** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected CheckoutRedirectAction() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of Data /// - /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL.. - /// Specifies the HTTP method, for example GET or POST.. - /// Specifies the payment method.. - /// **redirect** (required). - /// Specifies the URL to redirect to.. - public CheckoutRedirectAction(Dictionary data = default(Dictionary), string method = default(string), string paymentMethodType = default(string), TypeEnum type = default(TypeEnum), string url = default(string)) - { - this.Type = type; - this.Data = data; - this.Method = method; - this.PaymentMethodType = paymentMethodType; - this.Url = url; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> DataOption { get; private set; } /// /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. /// /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. - [DataMember(Name = "data", EmitDefaultValue = false)] - public Dictionary Data { get; set; } + [JsonPropertyName("data")] + public Dictionary Data { get { return this.DataOption; } set { this.DataOption = new Option>(value); } } + + /// + /// Used to track the state of Method + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MethodOption { get; private set; } /// /// Specifies the HTTP method, for example GET or POST. /// /// Specifies the HTTP method, for example GET or POST. - [DataMember(Name = "method", EmitDefaultValue = false)] - public string Method { get; set; } + [JsonPropertyName("method")] + public string Method { get { return this.MethodOption; } set { this.MethodOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethodType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodTypeOption { get; private set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] - public string PaymentMethodType { get; set; } + [JsonPropertyName("paymentMethodType")] + public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } + + /// + /// Used to track the state of Url + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UrlOption { get; private set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [DataMember(Name = "url", EmitDefaultValue = false)] - public string Url { get; set; } + [JsonPropertyName("url")] + public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -112,111 +173,165 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutRedirectAction {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Data: ").Append(Data).Append("\n"); sb.Append(" Method: ").Append(Method).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutRedirectActionJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CheckoutRedirectAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CheckoutRedirectAction); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CheckoutRedirectAction instances are equal - /// - /// Instance of CheckoutRedirectAction to be compared - /// Boolean - public bool Equals(CheckoutRedirectAction input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option type = default; + Option> data = default; + Option method = default; + Option paymentMethodType = default; + Option url = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(CheckoutRedirectAction.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "data": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + data = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "method": + method = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethodType": + paymentMethodType = new Option(utf8JsonReader.GetString()); + break; + case "url": + url = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Data == input.Data || - this.Data != null && - input.Data != null && - this.Data.SequenceEqual(input.Data) - ) && - ( - this.Method == input.Method || - (this.Method != null && - this.Method.Equals(input.Method)) - ) && - ( - this.PaymentMethodType == input.PaymentMethodType || - (this.PaymentMethodType != null && - this.PaymentMethodType.Equals(input.PaymentMethodType)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class CheckoutRedirectAction.", nameof(type)); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutRedirectAction."); + + if (data.IsSet && data.Value == null) + throw new ArgumentNullException(nameof(data), "Property is not nullable for class CheckoutRedirectAction."); + + if (method.IsSet && method.Value == null) + throw new ArgumentNullException(nameof(method), "Property is not nullable for class CheckoutRedirectAction."); + + if (paymentMethodType.IsSet && paymentMethodType.Value == null) + throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutRedirectAction."); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutRedirectAction."); + + return new CheckoutRedirectAction(type.Value.Value, data, method, paymentMethodType, url); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutRedirectAction checkoutRedirectAction, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Data != null) - { - hashCode = (hashCode * 59) + this.Data.GetHashCode(); - } - if (this.Method != null) - { - hashCode = (hashCode * 59) + this.Method.GetHashCode(); - } - if (this.PaymentMethodType != null) - { - hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.Url != null) - { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, checkoutRedirectAction, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutRedirectAction checkoutRedirectAction, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (checkoutRedirectAction.DataOption.IsSet && checkoutRedirectAction.Data == null) + throw new ArgumentNullException(nameof(checkoutRedirectAction.Data), "Property is required for class CheckoutRedirectAction."); + + if (checkoutRedirectAction.MethodOption.IsSet && checkoutRedirectAction.Method == null) + throw new ArgumentNullException(nameof(checkoutRedirectAction.Method), "Property is required for class CheckoutRedirectAction."); + + if (checkoutRedirectAction.PaymentMethodTypeOption.IsSet && checkoutRedirectAction.PaymentMethodType == null) + throw new ArgumentNullException(nameof(checkoutRedirectAction.PaymentMethodType), "Property is required for class CheckoutRedirectAction."); + + if (checkoutRedirectAction.UrlOption.IsSet && checkoutRedirectAction.Url == null) + throw new ArgumentNullException(nameof(checkoutRedirectAction.Url), "Property is required for class CheckoutRedirectAction."); + + var typeRawValue = CheckoutRedirectAction.TypeEnumToJsonValue(checkoutRedirectAction.Type); + writer.WriteString("type", typeRawValue); + if (checkoutRedirectAction.DataOption.IsSet) + { + writer.WritePropertyName("data"); + JsonSerializer.Serialize(writer, checkoutRedirectAction.Data, jsonSerializerOptions); + } + if (checkoutRedirectAction.MethodOption.IsSet) + writer.WriteString("method", checkoutRedirectAction.Method); + + if (checkoutRedirectAction.PaymentMethodTypeOption.IsSet) + writer.WriteString("paymentMethodType", checkoutRedirectAction.PaymentMethodType); + + if (checkoutRedirectAction.UrlOption.IsSet) + writer.WriteString("url", checkoutRedirectAction.Url); } } - } diff --git a/Adyen/Model/Checkout/CheckoutSDKAction.cs b/Adyen/Model/Checkout/CheckoutSDKAction.cs index bdf8abdca..34c532634 100644 --- a/Adyen/Model/Checkout/CheckoutSDKAction.cs +++ b/Adyen/Model/Checkout/CheckoutSDKAction.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,100 +14,170 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CheckoutSDKAction /// - [DataContract(Name = "CheckoutSDKAction")] - public partial class CheckoutSDKAction : IEquatable, IValidatableObject + public partial class CheckoutSDKAction : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The type of the action. + /// Encoded payment data. + /// Specifies the payment method. + /// The data to pass to the SDK. + /// Specifies the URL to redirect to. + [JsonConstructor] + public CheckoutSDKAction(TypeEnum type, Option paymentData = default, Option paymentMethodType = default, Option> sdkData = default, Option url = default) + { + Type = type; + PaymentDataOption = paymentData; + PaymentMethodTypeOption = paymentMethodType; + SdkDataOption = sdkData; + UrlOption = url; + OnCreated(); + } + + partial void OnCreated(); + /// /// The type of the action. /// /// The type of the action. - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Sdk for value: sdk /// - [EnumMember(Value = "sdk")] Sdk = 1, /// /// Enum WechatpaySDK for value: wechatpaySDK /// - [EnumMember(Value = "wechatpaySDK")] WechatpaySDK = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("sdk")) + return TypeEnum.Sdk; + if (value.Equals("wechatpaySDK")) + return TypeEnum.WechatpaySDK; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("sdk")) + return TypeEnum.Sdk; + + if (value.Equals("wechatpaySDK")) + return TypeEnum.WechatpaySDK; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.Sdk) + return "sdk"; + + if (value == TypeEnum.WechatpaySDK) + return "wechatpaySDK"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// The type of the action. /// /// The type of the action. - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected CheckoutSDKAction() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of PaymentData /// - /// Encoded payment data.. - /// Specifies the payment method.. - /// The data to pass to the SDK.. - /// The type of the action. (required). - /// Specifies the URL to redirect to.. - public CheckoutSDKAction(string paymentData = default(string), string paymentMethodType = default(string), Dictionary sdkData = default(Dictionary), TypeEnum type = default(TypeEnum), string url = default(string)) - { - this.Type = type; - this.PaymentData = paymentData; - this.PaymentMethodType = paymentMethodType; - this.SdkData = sdkData; - this.Url = url; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentDataOption { get; private set; } /// /// Encoded payment data. /// /// Encoded payment data. - [DataMember(Name = "paymentData", EmitDefaultValue = false)] - public string PaymentData { get; set; } + [JsonPropertyName("paymentData")] + public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethodType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodTypeOption { get; private set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] - public string PaymentMethodType { get; set; } + [JsonPropertyName("paymentMethodType")] + public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } + + /// + /// Used to track the state of SdkData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SdkDataOption { get; private set; } /// /// The data to pass to the SDK. /// /// The data to pass to the SDK. - [DataMember(Name = "sdkData", EmitDefaultValue = false)] - public Dictionary SdkData { get; set; } + [JsonPropertyName("sdkData")] + public Dictionary SdkData { get { return this.SdkDataOption; } set { this.SdkDataOption = new Option>(value); } } + + /// + /// Used to track the state of Url + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UrlOption { get; private set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [DataMember(Name = "url", EmitDefaultValue = false)] - public string Url { get; set; } + [JsonPropertyName("url")] + public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -118,111 +187,165 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutSDKAction {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); sb.Append(" SdkData: ").Append(SdkData).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutSDKActionJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CheckoutSDKAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CheckoutSDKAction); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CheckoutSDKAction instances are equal - /// - /// Instance of CheckoutSDKAction to be compared - /// Boolean - public bool Equals(CheckoutSDKAction input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option type = default; + Option paymentData = default; + Option paymentMethodType = default; + Option> sdkData = default; + Option url = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(CheckoutSDKAction.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "paymentData": + paymentData = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethodType": + paymentMethodType = new Option(utf8JsonReader.GetString()); + break; + case "sdkData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sdkData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "url": + url = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.PaymentData == input.PaymentData || - (this.PaymentData != null && - this.PaymentData.Equals(input.PaymentData)) - ) && - ( - this.PaymentMethodType == input.PaymentMethodType || - (this.PaymentMethodType != null && - this.PaymentMethodType.Equals(input.PaymentMethodType)) - ) && - ( - this.SdkData == input.SdkData || - this.SdkData != null && - input.SdkData != null && - this.SdkData.SequenceEqual(input.SdkData) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class CheckoutSDKAction.", nameof(type)); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutSDKAction."); + + if (paymentData.IsSet && paymentData.Value == null) + throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class CheckoutSDKAction."); + + if (paymentMethodType.IsSet && paymentMethodType.Value == null) + throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutSDKAction."); + + if (sdkData.IsSet && sdkData.Value == null) + throw new ArgumentNullException(nameof(sdkData), "Property is not nullable for class CheckoutSDKAction."); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutSDKAction."); + + return new CheckoutSDKAction(type.Value.Value, paymentData, paymentMethodType, sdkData, url); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutSDKAction checkoutSDKAction, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.PaymentData != null) - { - hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); - } - if (this.PaymentMethodType != null) - { - hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); - } - if (this.SdkData != null) - { - hashCode = (hashCode * 59) + this.SdkData.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.Url != null) - { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, checkoutSDKAction, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutSDKAction checkoutSDKAction, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (checkoutSDKAction.PaymentDataOption.IsSet && checkoutSDKAction.PaymentData == null) + throw new ArgumentNullException(nameof(checkoutSDKAction.PaymentData), "Property is required for class CheckoutSDKAction."); + + if (checkoutSDKAction.PaymentMethodTypeOption.IsSet && checkoutSDKAction.PaymentMethodType == null) + throw new ArgumentNullException(nameof(checkoutSDKAction.PaymentMethodType), "Property is required for class CheckoutSDKAction."); + + if (checkoutSDKAction.SdkDataOption.IsSet && checkoutSDKAction.SdkData == null) + throw new ArgumentNullException(nameof(checkoutSDKAction.SdkData), "Property is required for class CheckoutSDKAction."); + + if (checkoutSDKAction.UrlOption.IsSet && checkoutSDKAction.Url == null) + throw new ArgumentNullException(nameof(checkoutSDKAction.Url), "Property is required for class CheckoutSDKAction."); + + var typeRawValue = CheckoutSDKAction.TypeEnumToJsonValue(checkoutSDKAction.Type); + writer.WriteString("type", typeRawValue); + if (checkoutSDKAction.PaymentDataOption.IsSet) + writer.WriteString("paymentData", checkoutSDKAction.PaymentData); + + if (checkoutSDKAction.PaymentMethodTypeOption.IsSet) + writer.WriteString("paymentMethodType", checkoutSDKAction.PaymentMethodType); + + if (checkoutSDKAction.SdkDataOption.IsSet) + { + writer.WritePropertyName("sdkData"); + JsonSerializer.Serialize(writer, checkoutSDKAction.SdkData, jsonSerializerOptions); + } + if (checkoutSDKAction.UrlOption.IsSet) + writer.WriteString("url", checkoutSDKAction.Url); } } - } diff --git a/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs b/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs index 5a9459259..63bc76d96 100644 --- a/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs +++ b/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,125 +14,256 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CheckoutSessionInstallmentOption /// - [DataContract(Name = "CheckoutSessionInstallmentOption")] - public partial class CheckoutSessionInstallmentOption : IEquatable, IValidatableObject + public partial class CheckoutSessionInstallmentOption : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving*** **bonus** * **with_interest** * **buynow_paylater** * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * **nointeres_refund_prctg** * **interes_refund_prctg** + /// Preselected number of installments offered for this payment method. + /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. + [JsonConstructor] + public CheckoutSessionInstallmentOption(Option> plans = default, Option preselectedValue = default, Option> values = default) + { + PlansOption = plans; + PreselectedValueOption = preselectedValue; + ValuesOption = values; + OnCreated(); + } + + partial void OnCreated(); + /// /// Defines Plans /// - [JsonConverter(typeof(StringEnumConverter))] public enum PlansEnum { /// /// Enum Bonus for value: bonus /// - [EnumMember(Value = "bonus")] Bonus = 1, /// /// Enum BuynowPaylater for value: buynow_paylater /// - [EnumMember(Value = "buynow_paylater")] BuynowPaylater = 2, /// /// Enum InteresRefundPrctg for value: interes_refund_prctg /// - [EnumMember(Value = "interes_refund_prctg")] InteresRefundPrctg = 3, /// /// Enum InterestBonus for value: interest_bonus /// - [EnumMember(Value = "interest_bonus")] InterestBonus = 4, /// /// Enum NointeresRefundPrctg for value: nointeres_refund_prctg /// - [EnumMember(Value = "nointeres_refund_prctg")] NointeresRefundPrctg = 5, /// /// Enum NointerestBonus for value: nointerest_bonus /// - [EnumMember(Value = "nointerest_bonus")] NointerestBonus = 6, /// /// Enum RefundPrctg for value: refund_prctg /// - [EnumMember(Value = "refund_prctg")] RefundPrctg = 7, /// /// Enum Regular for value: regular /// - [EnumMember(Value = "regular")] Regular = 8, /// /// Enum Revolving for value: revolving /// - [EnumMember(Value = "revolving")] Revolving = 9, /// /// Enum WithInterest for value: with_interest /// - [EnumMember(Value = "with_interest")] WithInterest = 10 + } + + /// + /// Returns a + /// + /// + /// + /// + public static PlansEnum PlansEnumFromString(string value) + { + if (value.Equals("bonus")) + return PlansEnum.Bonus; + + if (value.Equals("buynow_paylater")) + return PlansEnum.BuynowPaylater; + if (value.Equals("interes_refund_prctg")) + return PlansEnum.InteresRefundPrctg; + + if (value.Equals("interest_bonus")) + return PlansEnum.InterestBonus; + + if (value.Equals("nointeres_refund_prctg")) + return PlansEnum.NointeresRefundPrctg; + + if (value.Equals("nointerest_bonus")) + return PlansEnum.NointerestBonus; + + if (value.Equals("refund_prctg")) + return PlansEnum.RefundPrctg; + + if (value.Equals("regular")) + return PlansEnum.Regular; + + if (value.Equals("revolving")) + return PlansEnum.Revolving; + + if (value.Equals("with_interest")) + return PlansEnum.WithInterest; + + throw new NotImplementedException($"Could not convert value to type PlansEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static PlansEnum? PlansEnumFromStringOrDefault(string value) + { + if (value.Equals("bonus")) + return PlansEnum.Bonus; + + if (value.Equals("buynow_paylater")) + return PlansEnum.BuynowPaylater; + + if (value.Equals("interes_refund_prctg")) + return PlansEnum.InteresRefundPrctg; + if (value.Equals("interest_bonus")) + return PlansEnum.InterestBonus; + + if (value.Equals("nointeres_refund_prctg")) + return PlansEnum.NointeresRefundPrctg; + + if (value.Equals("nointerest_bonus")) + return PlansEnum.NointerestBonus; + + if (value.Equals("refund_prctg")) + return PlansEnum.RefundPrctg; + + if (value.Equals("regular")) + return PlansEnum.Regular; + + if (value.Equals("revolving")) + return PlansEnum.Revolving; + + if (value.Equals("with_interest")) + return PlansEnum.WithInterest; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string PlansEnumToJsonValue(PlansEnum value) + { + if (value == PlansEnum.Bonus) + return "bonus"; + + if (value == PlansEnum.BuynowPaylater) + return "buynow_paylater"; + + if (value == PlansEnum.InteresRefundPrctg) + return "interes_refund_prctg"; + + if (value == PlansEnum.InterestBonus) + return "interest_bonus"; + + if (value == PlansEnum.NointeresRefundPrctg) + return "nointeres_refund_prctg"; + + if (value == PlansEnum.NointerestBonus) + return "nointerest_bonus"; + + if (value == PlansEnum.RefundPrctg) + return "refund_prctg"; + + if (value == PlansEnum.Regular) + return "regular"; + + if (value == PlansEnum.Revolving) + return "revolving"; + + if (value == PlansEnum.WithInterest) + return "with_interest"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Plans + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> PlansOption { get; private set; } /// /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving*** **bonus** * **with_interest** * **buynow_paylater** * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * **nointeres_refund_prctg** * **interes_refund_prctg** /// /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving*** **bonus** * **with_interest** * **buynow_paylater** * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * **nointeres_refund_prctg** * **interes_refund_prctg** - [DataMember(Name = "plans", EmitDefaultValue = false)] - public List Plans { get; set; } + [JsonPropertyName("plans")] + public List Plans { get { return this.PlansOption; } set { this.PlansOption = new Option>(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of PreselectedValue /// - /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving*** **bonus** * **with_interest** * **buynow_paylater** * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * **nointeres_refund_prctg** * **interes_refund_prctg**. - /// Preselected number of installments offered for this payment method.. - /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`.. - public CheckoutSessionInstallmentOption(List plans = default(List), int? preselectedValue = default(int?), List values = default(List)) - { - this.Plans = plans; - this.PreselectedValue = preselectedValue; - this.Values = values; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PreselectedValueOption { get; private set; } /// /// Preselected number of installments offered for this payment method. /// /// Preselected number of installments offered for this payment method. - [DataMember(Name = "preselectedValue", EmitDefaultValue = false)] - public int? PreselectedValue { get; set; } + [JsonPropertyName("preselectedValue")] + public int? PreselectedValue { get { return this.PreselectedValueOption; } set { this.PreselectedValueOption = new Option(value); } } + + /// + /// Used to track the state of Values + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> ValuesOption { get; private set; } /// /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. /// /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. - [DataMember(Name = "values", EmitDefaultValue = false)] - public List Values { get; set; } + [JsonPropertyName("values")] + public List Values { get { return this.ValuesOption; } set { this.ValuesOption = new Option>(value); } } /// /// Returns the string presentation of the object @@ -151,79 +281,130 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutSessionInstallmentOptionJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CheckoutSessionInstallmentOption Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CheckoutSessionInstallmentOption); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CheckoutSessionInstallmentOption instances are equal - /// - /// Instance of CheckoutSessionInstallmentOption to be compared - /// Boolean - public bool Equals(CheckoutSessionInstallmentOption input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option> plans = default; + Option preselectedValue = default; + Option> values = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "plans": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + plans = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "preselectedValue": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + preselectedValue = new Option(utf8JsonReader.GetInt32()); + break; + case "values": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + values = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.Plans == input.Plans || - this.Plans.SequenceEqual(input.Plans) - ) && - ( - this.PreselectedValue == input.PreselectedValue || - this.PreselectedValue.Equals(input.PreselectedValue) - ) && - ( - this.Values == input.Values || - this.Values != null && - input.Values != null && - this.Values.SequenceEqual(input.Values) - ); + + if (plans.IsSet && plans.Value == null) + throw new ArgumentNullException(nameof(plans), "Property is not nullable for class CheckoutSessionInstallmentOption."); + + if (preselectedValue.IsSet && preselectedValue.Value == null) + throw new ArgumentNullException(nameof(preselectedValue), "Property is not nullable for class CheckoutSessionInstallmentOption."); + + if (values.IsSet && values.Value == null) + throw new ArgumentNullException(nameof(values), "Property is not nullable for class CheckoutSessionInstallmentOption."); + + return new CheckoutSessionInstallmentOption(plans, preselectedValue, values); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutSessionInstallmentOption checkoutSessionInstallmentOption, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Plans.GetHashCode(); - hashCode = (hashCode * 59) + this.PreselectedValue.GetHashCode(); - if (this.Values != null) - { - hashCode = (hashCode * 59) + this.Values.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, checkoutSessionInstallmentOption, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutSessionInstallmentOption checkoutSessionInstallmentOption, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (checkoutSessionInstallmentOption.PlansOption.IsSet && checkoutSessionInstallmentOption.Plans == null) + throw new ArgumentNullException(nameof(checkoutSessionInstallmentOption.Plans), "Property is required for class CheckoutSessionInstallmentOption."); + + if (checkoutSessionInstallmentOption.ValuesOption.IsSet && checkoutSessionInstallmentOption.Values == null) + throw new ArgumentNullException(nameof(checkoutSessionInstallmentOption.Values), "Property is required for class CheckoutSessionInstallmentOption."); + + if (checkoutSessionInstallmentOption.PlansOption.IsSet) + { + writer.WritePropertyName("plans"); + JsonSerializer.Serialize(writer, checkoutSessionInstallmentOption.Plans, jsonSerializerOptions); + } + if (checkoutSessionInstallmentOption.PreselectedValueOption.IsSet) + writer.WriteNumber("preselectedValue", checkoutSessionInstallmentOption.PreselectedValueOption.Value.Value); + + if (checkoutSessionInstallmentOption.ValuesOption.IsSet) + { + writer.WritePropertyName("values"); + JsonSerializer.Serialize(writer, checkoutSessionInstallmentOption.Values, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs b/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs index 4c76f48c2..0952b65dd 100644 --- a/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs +++ b/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,107 +14,214 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CheckoutSessionThreeDS2RequestData /// - [DataContract(Name = "CheckoutSessionThreeDS2RequestData")] - public partial class CheckoutSessionThreeDS2RequestData : IEquatable, IValidatableObject + public partial class CheckoutSessionThreeDS2RequestData : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// homePhone + /// mobilePhone + /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + /// workPhone + [JsonConstructor] + public CheckoutSessionThreeDS2RequestData(Option homePhone = default, Option mobilePhone = default, Option threeDSRequestorChallengeInd = default, Option workPhone = default) + { + HomePhoneOption = homePhone; + MobilePhoneOption = mobilePhone; + ThreeDSRequestorChallengeIndOption = threeDSRequestorChallengeInd; + WorkPhoneOption = workPhone; + OnCreated(); + } + + partial void OnCreated(); + /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSRequestorChallengeIndEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// - [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// - [EnumMember(Value = "06")] _06 = 6 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ThreeDSRequestorChallengeIndEnum ThreeDSRequestorChallengeIndEnumFromString(string value) + { + if (value.Equals("01")) + return ThreeDSRequestorChallengeIndEnum._01; + + if (value.Equals("02")) + return ThreeDSRequestorChallengeIndEnum._02; + + if (value.Equals("03")) + return ThreeDSRequestorChallengeIndEnum._03; + + if (value.Equals("04")) + return ThreeDSRequestorChallengeIndEnum._04; + + if (value.Equals("05")) + return ThreeDSRequestorChallengeIndEnum._05; + + if (value.Equals("06")) + return ThreeDSRequestorChallengeIndEnum._06; + + throw new NotImplementedException($"Could not convert value to type ThreeDSRequestorChallengeIndEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeIndEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ThreeDSRequestorChallengeIndEnum._01; + + if (value.Equals("02")) + return ThreeDSRequestorChallengeIndEnum._02; + + if (value.Equals("03")) + return ThreeDSRequestorChallengeIndEnum._03; + if (value.Equals("04")) + return ThreeDSRequestorChallengeIndEnum._04; + + if (value.Equals("05")) + return ThreeDSRequestorChallengeIndEnum._05; + + if (value.Equals("06")) + return ThreeDSRequestorChallengeIndEnum._06; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ThreeDSRequestorChallengeIndEnumToJsonValue(ThreeDSRequestorChallengeIndEnum? value) + { + if (value == ThreeDSRequestorChallengeIndEnum._01) + return "01"; + + if (value == ThreeDSRequestorChallengeIndEnum._02) + return "02"; + + if (value == ThreeDSRequestorChallengeIndEnum._03) + return "03"; + + if (value == ThreeDSRequestorChallengeIndEnum._04) + return "04"; + + if (value == ThreeDSRequestorChallengeIndEnum._05) + return "05"; + + if (value == ThreeDSRequestorChallengeIndEnum._06) + return "06"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ThreeDSRequestorChallengeInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorChallengeIndOption { get; private set; } /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - [DataMember(Name = "threeDSRequestorChallengeInd", EmitDefaultValue = false)] - public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get; set; } + [JsonPropertyName("threeDSRequestorChallengeInd")] + public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get { return this.ThreeDSRequestorChallengeIndOption; } set { this.ThreeDSRequestorChallengeIndOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of HomePhone /// - /// homePhone. - /// mobilePhone. - /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only. - /// workPhone. - public CheckoutSessionThreeDS2RequestData(Phone homePhone = default(Phone), Phone mobilePhone = default(Phone), ThreeDSRequestorChallengeIndEnum? threeDSRequestorChallengeInd = default(ThreeDSRequestorChallengeIndEnum?), Phone workPhone = default(Phone)) - { - this.HomePhone = homePhone; - this.MobilePhone = mobilePhone; - this.ThreeDSRequestorChallengeInd = threeDSRequestorChallengeInd; - this.WorkPhone = workPhone; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option HomePhoneOption { get; private set; } /// /// Gets or Sets HomePhone /// - [DataMember(Name = "homePhone", EmitDefaultValue = false)] - public Phone HomePhone { get; set; } + [JsonPropertyName("homePhone")] + public Phone HomePhone { get { return this.HomePhoneOption; } set { this.HomePhoneOption = new Option(value); } } + + /// + /// Used to track the state of MobilePhone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MobilePhoneOption { get; private set; } /// /// Gets or Sets MobilePhone /// - [DataMember(Name = "mobilePhone", EmitDefaultValue = false)] - public Phone MobilePhone { get; set; } + [JsonPropertyName("mobilePhone")] + public Phone MobilePhone { get { return this.MobilePhoneOption; } set { this.MobilePhoneOption = new Option(value); } } + + /// + /// Used to track the state of WorkPhone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option WorkPhoneOption { get; private set; } /// /// Gets or Sets WorkPhone /// - [DataMember(Name = "workPhone", EmitDefaultValue = false)] - public Phone WorkPhone { get; set; } + [JsonPropertyName("workPhone")] + public Phone WorkPhone { get { return this.WorkPhoneOption; } set { this.WorkPhoneOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -134,91 +240,146 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutSessionThreeDS2RequestDataJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CheckoutSessionThreeDS2RequestData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CheckoutSessionThreeDS2RequestData); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CheckoutSessionThreeDS2RequestData instances are equal - /// - /// Instance of CheckoutSessionThreeDS2RequestData to be compared - /// Boolean - public bool Equals(CheckoutSessionThreeDS2RequestData input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option homePhone = default; + Option mobilePhone = default; + Option threeDSRequestorChallengeInd = default; + Option workPhone = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "homePhone": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + homePhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mobilePhone": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mobilePhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDSRequestorChallengeInd": + string threeDSRequestorChallengeIndRawValue = utf8JsonReader.GetString(); + if (threeDSRequestorChallengeIndRawValue != null) + threeDSRequestorChallengeInd = new Option(CheckoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumFromStringOrDefault(threeDSRequestorChallengeIndRawValue)); + break; + case "workPhone": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + workPhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.HomePhone == input.HomePhone || - (this.HomePhone != null && - this.HomePhone.Equals(input.HomePhone)) - ) && - ( - this.MobilePhone == input.MobilePhone || - (this.MobilePhone != null && - this.MobilePhone.Equals(input.MobilePhone)) - ) && - ( - this.ThreeDSRequestorChallengeInd == input.ThreeDSRequestorChallengeInd || - this.ThreeDSRequestorChallengeInd.Equals(input.ThreeDSRequestorChallengeInd) - ) && - ( - this.WorkPhone == input.WorkPhone || - (this.WorkPhone != null && - this.WorkPhone.Equals(input.WorkPhone)) - ); + + if (homePhone.IsSet && homePhone.Value == null) + throw new ArgumentNullException(nameof(homePhone), "Property is not nullable for class CheckoutSessionThreeDS2RequestData."); + + if (mobilePhone.IsSet && mobilePhone.Value == null) + throw new ArgumentNullException(nameof(mobilePhone), "Property is not nullable for class CheckoutSessionThreeDS2RequestData."); + + if (threeDSRequestorChallengeInd.IsSet && threeDSRequestorChallengeInd.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorChallengeInd), "Property is not nullable for class CheckoutSessionThreeDS2RequestData."); + + if (workPhone.IsSet && workPhone.Value == null) + throw new ArgumentNullException(nameof(workPhone), "Property is not nullable for class CheckoutSessionThreeDS2RequestData."); + + return new CheckoutSessionThreeDS2RequestData(homePhone, mobilePhone, threeDSRequestorChallengeInd, workPhone); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutSessionThreeDS2RequestData checkoutSessionThreeDS2RequestData, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.HomePhone != null) - { - hashCode = (hashCode * 59) + this.HomePhone.GetHashCode(); - } - if (this.MobilePhone != null) - { - hashCode = (hashCode * 59) + this.MobilePhone.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ThreeDSRequestorChallengeInd.GetHashCode(); - if (this.WorkPhone != null) - { - hashCode = (hashCode * 59) + this.WorkPhone.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, checkoutSessionThreeDS2RequestData, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutSessionThreeDS2RequestData checkoutSessionThreeDS2RequestData, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (checkoutSessionThreeDS2RequestData.HomePhoneOption.IsSet && checkoutSessionThreeDS2RequestData.HomePhone == null) + throw new ArgumentNullException(nameof(checkoutSessionThreeDS2RequestData.HomePhone), "Property is required for class CheckoutSessionThreeDS2RequestData."); + + if (checkoutSessionThreeDS2RequestData.MobilePhoneOption.IsSet && checkoutSessionThreeDS2RequestData.MobilePhone == null) + throw new ArgumentNullException(nameof(checkoutSessionThreeDS2RequestData.MobilePhone), "Property is required for class CheckoutSessionThreeDS2RequestData."); + + if (checkoutSessionThreeDS2RequestData.WorkPhoneOption.IsSet && checkoutSessionThreeDS2RequestData.WorkPhone == null) + throw new ArgumentNullException(nameof(checkoutSessionThreeDS2RequestData.WorkPhone), "Property is required for class CheckoutSessionThreeDS2RequestData."); + + if (checkoutSessionThreeDS2RequestData.HomePhoneOption.IsSet) + { + writer.WritePropertyName("homePhone"); + JsonSerializer.Serialize(writer, checkoutSessionThreeDS2RequestData.HomePhone, jsonSerializerOptions); + } + if (checkoutSessionThreeDS2RequestData.MobilePhoneOption.IsSet) + { + writer.WritePropertyName("mobilePhone"); + JsonSerializer.Serialize(writer, checkoutSessionThreeDS2RequestData.MobilePhone, jsonSerializerOptions); + } + var threeDSRequestorChallengeIndRawValue = CheckoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumToJsonValue(checkoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndOption.Value.Value); + writer.WriteString("threeDSRequestorChallengeInd", threeDSRequestorChallengeIndRawValue); + if (checkoutSessionThreeDS2RequestData.WorkPhoneOption.IsSet) + { + writer.WritePropertyName("workPhone"); + JsonSerializer.Serialize(writer, checkoutSessionThreeDS2RequestData.WorkPhone, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/CheckoutThreeDS2Action.cs b/Adyen/Model/Checkout/CheckoutThreeDS2Action.cs index 562036df8..cb5df61a3 100644 --- a/Adyen/Model/Checkout/CheckoutThreeDS2Action.cs +++ b/Adyen/Model/Checkout/CheckoutThreeDS2Action.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,112 +14,188 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CheckoutThreeDS2Action /// - [DataContract(Name = "CheckoutThreeDS2Action")] - public partial class CheckoutThreeDS2Action : IEquatable, IValidatableObject + public partial class CheckoutThreeDS2Action : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// **threeDS2** + /// A token needed to authorise a payment. + /// Encoded payment data. + /// Specifies the payment method. + /// A subtype of the token. + /// A token to pass to the 3DS2 Component to get the fingerprint. + /// Specifies the URL to redirect to. + [JsonConstructor] + public CheckoutThreeDS2Action(TypeEnum type, Option authorisationToken = default, Option paymentData = default, Option paymentMethodType = default, Option subtype = default, Option token = default, Option url = default) + { + Type = type; + AuthorisationTokenOption = authorisationToken; + PaymentDataOption = paymentData; + PaymentMethodTypeOption = paymentMethodType; + SubtypeOption = subtype; + TokenOption = token; + UrlOption = url; + OnCreated(); + } + + partial void OnCreated(); + /// /// **threeDS2** /// /// **threeDS2** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum ThreeDS2 for value: threeDS2 /// - [EnumMember(Value = "threeDS2")] ThreeDS2 = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("threeDS2")) + return TypeEnum.ThreeDS2; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("threeDS2")) + return TypeEnum.ThreeDS2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.ThreeDS2) + return "threeDS2"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **threeDS2** /// /// **threeDS2** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected CheckoutThreeDS2Action() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of AuthorisationToken /// - /// A token needed to authorise a payment.. - /// Encoded payment data.. - /// Specifies the payment method.. - /// A subtype of the token.. - /// A token to pass to the 3DS2 Component to get the fingerprint.. - /// **threeDS2** (required). - /// Specifies the URL to redirect to.. - public CheckoutThreeDS2Action(string authorisationToken = default(string), string paymentData = default(string), string paymentMethodType = default(string), string subtype = default(string), string token = default(string), TypeEnum type = default(TypeEnum), string url = default(string)) - { - this.Type = type; - this.AuthorisationToken = authorisationToken; - this.PaymentData = paymentData; - this.PaymentMethodType = paymentMethodType; - this.Subtype = subtype; - this.Token = token; - this.Url = url; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthorisationTokenOption { get; private set; } /// /// A token needed to authorise a payment. /// /// A token needed to authorise a payment. - [DataMember(Name = "authorisationToken", EmitDefaultValue = false)] - public string AuthorisationToken { get; set; } + [JsonPropertyName("authorisationToken")] + public string AuthorisationToken { get { return this.AuthorisationTokenOption; } set { this.AuthorisationTokenOption = new Option(value); } } + + /// + /// Used to track the state of PaymentData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentDataOption { get; private set; } /// /// Encoded payment data. /// /// Encoded payment data. - [DataMember(Name = "paymentData", EmitDefaultValue = false)] - public string PaymentData { get; set; } + [JsonPropertyName("paymentData")] + public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethodType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodTypeOption { get; private set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] - public string PaymentMethodType { get; set; } + [JsonPropertyName("paymentMethodType")] + public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } + + /// + /// Used to track the state of Subtype + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubtypeOption { get; private set; } /// /// A subtype of the token. /// /// A subtype of the token. - [DataMember(Name = "subtype", EmitDefaultValue = false)] - public string Subtype { get; set; } + [JsonPropertyName("subtype")] + public string Subtype { get { return this.SubtypeOption; } set { this.SubtypeOption = new Option(value); } } + + /// + /// Used to track the state of Token + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TokenOption { get; private set; } /// /// A token to pass to the 3DS2 Component to get the fingerprint. /// /// A token to pass to the 3DS2 Component to get the fingerprint. - [DataMember(Name = "token", EmitDefaultValue = false)] - public string Token { get; set; } + [JsonPropertyName("token")] + public string Token { get { return this.TokenOption; } set { this.TokenOption = new Option(value); } } + + /// + /// Used to track the state of Url + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UrlOption { get; private set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [DataMember(Name = "url", EmitDefaultValue = false)] - public string Url { get; set; } + [JsonPropertyName("url")] + public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -130,130 +205,190 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutThreeDS2Action {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" AuthorisationToken: ").Append(AuthorisationToken).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); sb.Append(" Subtype: ").Append(Subtype).Append("\n"); sb.Append(" Token: ").Append(Token).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutThreeDS2ActionJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CheckoutThreeDS2Action Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CheckoutThreeDS2Action); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CheckoutThreeDS2Action instances are equal - /// - /// Instance of CheckoutThreeDS2Action to be compared - /// Boolean - public bool Equals(CheckoutThreeDS2Action input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option type = default; + Option authorisationToken = default; + Option paymentData = default; + Option paymentMethodType = default; + Option subtype = default; + Option token = default; + Option url = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(CheckoutThreeDS2Action.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "authorisationToken": + authorisationToken = new Option(utf8JsonReader.GetString()); + break; + case "paymentData": + paymentData = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethodType": + paymentMethodType = new Option(utf8JsonReader.GetString()); + break; + case "subtype": + subtype = new Option(utf8JsonReader.GetString()); + break; + case "token": + token = new Option(utf8JsonReader.GetString()); + break; + case "url": + url = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AuthorisationToken == input.AuthorisationToken || - (this.AuthorisationToken != null && - this.AuthorisationToken.Equals(input.AuthorisationToken)) - ) && - ( - this.PaymentData == input.PaymentData || - (this.PaymentData != null && - this.PaymentData.Equals(input.PaymentData)) - ) && - ( - this.PaymentMethodType == input.PaymentMethodType || - (this.PaymentMethodType != null && - this.PaymentMethodType.Equals(input.PaymentMethodType)) - ) && - ( - this.Subtype == input.Subtype || - (this.Subtype != null && - this.Subtype.Equals(input.Subtype)) - ) && - ( - this.Token == input.Token || - (this.Token != null && - this.Token.Equals(input.Token)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class CheckoutThreeDS2Action.", nameof(type)); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutThreeDS2Action."); + + if (authorisationToken.IsSet && authorisationToken.Value == null) + throw new ArgumentNullException(nameof(authorisationToken), "Property is not nullable for class CheckoutThreeDS2Action."); + + if (paymentData.IsSet && paymentData.Value == null) + throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class CheckoutThreeDS2Action."); + + if (paymentMethodType.IsSet && paymentMethodType.Value == null) + throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutThreeDS2Action."); + + if (subtype.IsSet && subtype.Value == null) + throw new ArgumentNullException(nameof(subtype), "Property is not nullable for class CheckoutThreeDS2Action."); + + if (token.IsSet && token.Value == null) + throw new ArgumentNullException(nameof(token), "Property is not nullable for class CheckoutThreeDS2Action."); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutThreeDS2Action."); + + return new CheckoutThreeDS2Action(type.Value.Value, authorisationToken, paymentData, paymentMethodType, subtype, token, url); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutThreeDS2Action checkoutThreeDS2Action, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AuthorisationToken != null) - { - hashCode = (hashCode * 59) + this.AuthorisationToken.GetHashCode(); - } - if (this.PaymentData != null) - { - hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); - } - if (this.PaymentMethodType != null) - { - hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); - } - if (this.Subtype != null) - { - hashCode = (hashCode * 59) + this.Subtype.GetHashCode(); - } - if (this.Token != null) - { - hashCode = (hashCode * 59) + this.Token.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.Url != null) - { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, checkoutThreeDS2Action, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutThreeDS2Action checkoutThreeDS2Action, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (checkoutThreeDS2Action.AuthorisationTokenOption.IsSet && checkoutThreeDS2Action.AuthorisationToken == null) + throw new ArgumentNullException(nameof(checkoutThreeDS2Action.AuthorisationToken), "Property is required for class CheckoutThreeDS2Action."); + + if (checkoutThreeDS2Action.PaymentDataOption.IsSet && checkoutThreeDS2Action.PaymentData == null) + throw new ArgumentNullException(nameof(checkoutThreeDS2Action.PaymentData), "Property is required for class CheckoutThreeDS2Action."); + + if (checkoutThreeDS2Action.PaymentMethodTypeOption.IsSet && checkoutThreeDS2Action.PaymentMethodType == null) + throw new ArgumentNullException(nameof(checkoutThreeDS2Action.PaymentMethodType), "Property is required for class CheckoutThreeDS2Action."); + + if (checkoutThreeDS2Action.SubtypeOption.IsSet && checkoutThreeDS2Action.Subtype == null) + throw new ArgumentNullException(nameof(checkoutThreeDS2Action.Subtype), "Property is required for class CheckoutThreeDS2Action."); + + if (checkoutThreeDS2Action.TokenOption.IsSet && checkoutThreeDS2Action.Token == null) + throw new ArgumentNullException(nameof(checkoutThreeDS2Action.Token), "Property is required for class CheckoutThreeDS2Action."); + + if (checkoutThreeDS2Action.UrlOption.IsSet && checkoutThreeDS2Action.Url == null) + throw new ArgumentNullException(nameof(checkoutThreeDS2Action.Url), "Property is required for class CheckoutThreeDS2Action."); + + var typeRawValue = CheckoutThreeDS2Action.TypeEnumToJsonValue(checkoutThreeDS2Action.Type); + writer.WriteString("type", typeRawValue); + if (checkoutThreeDS2Action.AuthorisationTokenOption.IsSet) + writer.WriteString("authorisationToken", checkoutThreeDS2Action.AuthorisationToken); + + if (checkoutThreeDS2Action.PaymentDataOption.IsSet) + writer.WriteString("paymentData", checkoutThreeDS2Action.PaymentData); + + if (checkoutThreeDS2Action.PaymentMethodTypeOption.IsSet) + writer.WriteString("paymentMethodType", checkoutThreeDS2Action.PaymentMethodType); + + if (checkoutThreeDS2Action.SubtypeOption.IsSet) + writer.WriteString("subtype", checkoutThreeDS2Action.Subtype); + + if (checkoutThreeDS2Action.TokenOption.IsSet) + writer.WriteString("token", checkoutThreeDS2Action.Token); + + if (checkoutThreeDS2Action.UrlOption.IsSet) + writer.WriteString("url", checkoutThreeDS2Action.Url); } } - } diff --git a/Adyen/Model/Checkout/CheckoutVoucherAction.cs b/Adyen/Model/Checkout/CheckoutVoucherAction.cs index 891756064..8381003d1 100644 --- a/Adyen/Model/Checkout/CheckoutVoucherAction.cs +++ b/Adyen/Model/Checkout/CheckoutVoucherAction.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,235 +14,409 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CheckoutVoucherAction /// - [DataContract(Name = "CheckoutVoucherAction")] - public partial class CheckoutVoucherAction : IEquatable, IValidatableObject + public partial class CheckoutVoucherAction : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// **voucher** + /// The voucher alternative reference code. + /// A collection institution number (store number) for Econtext Pay-Easy ATM. + /// The URL to download the voucher. + /// An entity number of Multibanco. + /// The date time of the voucher expiry. + /// initialAmount + /// The URL to the detailed instructions to make payment using the voucher. + /// The issuer of the voucher. + /// The shopper telephone number (partially masked). + /// The merchant name. + /// The merchant reference. + /// A Base64-encoded token containing all properties of the voucher. For iOS, you can use this to pass a voucher to Apple Wallet. + /// Encoded payment data. + /// Specifies the payment method. + /// The voucher reference code. + /// The shopper email. + /// The shopper name. + /// surcharge + /// totalAmount + /// Specifies the URL to redirect to. + [JsonConstructor] + public CheckoutVoucherAction(TypeEnum type, Option alternativeReference = default, Option collectionInstitutionNumber = default, Option downloadUrl = default, Option entity = default, Option expiresAt = default, Option initialAmount = default, Option instructionsUrl = default, Option issuer = default, Option maskedTelephoneNumber = default, Option merchantName = default, Option merchantReference = default, Option passCreationToken = default, Option paymentData = default, Option paymentMethodType = default, Option reference = default, Option shopperEmail = default, Option shopperName = default, Option surcharge = default, Option totalAmount = default, Option url = default) + { + Type = type; + AlternativeReferenceOption = alternativeReference; + CollectionInstitutionNumberOption = collectionInstitutionNumber; + DownloadUrlOption = downloadUrl; + EntityOption = entity; + ExpiresAtOption = expiresAt; + InitialAmountOption = initialAmount; + InstructionsUrlOption = instructionsUrl; + IssuerOption = issuer; + MaskedTelephoneNumberOption = maskedTelephoneNumber; + MerchantNameOption = merchantName; + MerchantReferenceOption = merchantReference; + PassCreationTokenOption = passCreationToken; + PaymentDataOption = paymentData; + PaymentMethodTypeOption = paymentMethodType; + ReferenceOption = reference; + ShopperEmailOption = shopperEmail; + ShopperNameOption = shopperName; + SurchargeOption = surcharge; + TotalAmountOption = totalAmount; + UrlOption = url; + OnCreated(); + } + + partial void OnCreated(); + /// /// **voucher** /// /// **voucher** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Voucher for value: voucher /// - [EnumMember(Value = "voucher")] Voucher = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("voucher")) + return TypeEnum.Voucher; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("voucher")) + return TypeEnum.Voucher; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.Voucher) + return "voucher"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **voucher** /// /// **voucher** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected CheckoutVoucherAction() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of AlternativeReference /// - /// The voucher alternative reference code.. - /// A collection institution number (store number) for Econtext Pay-Easy ATM.. - /// The URL to download the voucher.. - /// An entity number of Multibanco.. - /// The date time of the voucher expiry.. - /// initialAmount. - /// The URL to the detailed instructions to make payment using the voucher.. - /// The issuer of the voucher.. - /// The shopper telephone number (partially masked).. - /// The merchant name.. - /// The merchant reference.. - /// A Base64-encoded token containing all properties of the voucher. For iOS, you can use this to pass a voucher to Apple Wallet.. - /// Encoded payment data.. - /// Specifies the payment method.. - /// The voucher reference code.. - /// The shopper email.. - /// The shopper name.. - /// surcharge. - /// totalAmount. - /// **voucher** (required). - /// Specifies the URL to redirect to.. - public CheckoutVoucherAction(string alternativeReference = default(string), string collectionInstitutionNumber = default(string), string downloadUrl = default(string), string entity = default(string), string expiresAt = default(string), Amount initialAmount = default(Amount), string instructionsUrl = default(string), string issuer = default(string), string maskedTelephoneNumber = default(string), string merchantName = default(string), string merchantReference = default(string), string passCreationToken = default(string), string paymentData = default(string), string paymentMethodType = default(string), string reference = default(string), string shopperEmail = default(string), string shopperName = default(string), Amount surcharge = default(Amount), Amount totalAmount = default(Amount), TypeEnum type = default(TypeEnum), string url = default(string)) - { - this.Type = type; - this.AlternativeReference = alternativeReference; - this.CollectionInstitutionNumber = collectionInstitutionNumber; - this.DownloadUrl = downloadUrl; - this.Entity = entity; - this.ExpiresAt = expiresAt; - this.InitialAmount = initialAmount; - this.InstructionsUrl = instructionsUrl; - this.Issuer = issuer; - this.MaskedTelephoneNumber = maskedTelephoneNumber; - this.MerchantName = merchantName; - this.MerchantReference = merchantReference; - this.PassCreationToken = passCreationToken; - this.PaymentData = paymentData; - this.PaymentMethodType = paymentMethodType; - this.Reference = reference; - this.ShopperEmail = shopperEmail; - this.ShopperName = shopperName; - this.Surcharge = surcharge; - this.TotalAmount = totalAmount; - this.Url = url; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AlternativeReferenceOption { get; private set; } /// /// The voucher alternative reference code. /// /// The voucher alternative reference code. - [DataMember(Name = "alternativeReference", EmitDefaultValue = false)] - public string AlternativeReference { get; set; } + [JsonPropertyName("alternativeReference")] + public string AlternativeReference { get { return this.AlternativeReferenceOption; } set { this.AlternativeReferenceOption = new Option(value); } } + + /// + /// Used to track the state of CollectionInstitutionNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CollectionInstitutionNumberOption { get; private set; } /// /// A collection institution number (store number) for Econtext Pay-Easy ATM. /// /// A collection institution number (store number) for Econtext Pay-Easy ATM. - [DataMember(Name = "collectionInstitutionNumber", EmitDefaultValue = false)] - public string CollectionInstitutionNumber { get; set; } + [JsonPropertyName("collectionInstitutionNumber")] + public string CollectionInstitutionNumber { get { return this.CollectionInstitutionNumberOption; } set { this.CollectionInstitutionNumberOption = new Option(value); } } + + /// + /// Used to track the state of DownloadUrl + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DownloadUrlOption { get; private set; } /// /// The URL to download the voucher. /// /// The URL to download the voucher. - [DataMember(Name = "downloadUrl", EmitDefaultValue = false)] - public string DownloadUrl { get; set; } + [JsonPropertyName("downloadUrl")] + public string DownloadUrl { get { return this.DownloadUrlOption; } set { this.DownloadUrlOption = new Option(value); } } + + /// + /// Used to track the state of Entity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EntityOption { get; private set; } /// /// An entity number of Multibanco. /// /// An entity number of Multibanco. - [DataMember(Name = "entity", EmitDefaultValue = false)] - public string Entity { get; set; } + [JsonPropertyName("entity")] + public string Entity { get { return this.EntityOption; } set { this.EntityOption = new Option(value); } } + + /// + /// Used to track the state of ExpiresAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiresAtOption { get; private set; } /// /// The date time of the voucher expiry. /// /// The date time of the voucher expiry. - [DataMember(Name = "expiresAt", EmitDefaultValue = false)] - public string ExpiresAt { get; set; } + [JsonPropertyName("expiresAt")] + public string ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } + + /// + /// Used to track the state of InitialAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InitialAmountOption { get; private set; } /// /// Gets or Sets InitialAmount /// - [DataMember(Name = "initialAmount", EmitDefaultValue = false)] - public Amount InitialAmount { get; set; } + [JsonPropertyName("initialAmount")] + public Amount InitialAmount { get { return this.InitialAmountOption; } set { this.InitialAmountOption = new Option(value); } } + + /// + /// Used to track the state of InstructionsUrl + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstructionsUrlOption { get; private set; } /// /// The URL to the detailed instructions to make payment using the voucher. /// /// The URL to the detailed instructions to make payment using the voucher. - [DataMember(Name = "instructionsUrl", EmitDefaultValue = false)] - public string InstructionsUrl { get; set; } + [JsonPropertyName("instructionsUrl")] + public string InstructionsUrl { get { return this.InstructionsUrlOption; } set { this.InstructionsUrlOption = new Option(value); } } + + /// + /// Used to track the state of Issuer + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IssuerOption { get; private set; } /// /// The issuer of the voucher. /// /// The issuer of the voucher. - [DataMember(Name = "issuer", EmitDefaultValue = false)] - public string Issuer { get; set; } + [JsonPropertyName("issuer")] + public string Issuer { get { return this.IssuerOption; } set { this.IssuerOption = new Option(value); } } + + /// + /// Used to track the state of MaskedTelephoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MaskedTelephoneNumberOption { get; private set; } /// /// The shopper telephone number (partially masked). /// /// The shopper telephone number (partially masked). - [DataMember(Name = "maskedTelephoneNumber", EmitDefaultValue = false)] - public string MaskedTelephoneNumber { get; set; } + [JsonPropertyName("maskedTelephoneNumber")] + public string MaskedTelephoneNumber { get { return this.MaskedTelephoneNumberOption; } set { this.MaskedTelephoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of MerchantName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantNameOption { get; private set; } /// /// The merchant name. /// /// The merchant name. - [DataMember(Name = "merchantName", EmitDefaultValue = false)] - public string MerchantName { get; set; } + [JsonPropertyName("merchantName")] + public string MerchantName { get { return this.MerchantNameOption; } set { this.MerchantNameOption = new Option(value); } } + + /// + /// Used to track the state of MerchantReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantReferenceOption { get; private set; } /// /// The merchant reference. /// /// The merchant reference. - [DataMember(Name = "merchantReference", EmitDefaultValue = false)] - public string MerchantReference { get; set; } + [JsonPropertyName("merchantReference")] + public string MerchantReference { get { return this.MerchantReferenceOption; } set { this.MerchantReferenceOption = new Option(value); } } + + /// + /// Used to track the state of PassCreationToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PassCreationTokenOption { get; private set; } /// /// A Base64-encoded token containing all properties of the voucher. For iOS, you can use this to pass a voucher to Apple Wallet. /// /// A Base64-encoded token containing all properties of the voucher. For iOS, you can use this to pass a voucher to Apple Wallet. - [DataMember(Name = "passCreationToken", EmitDefaultValue = false)] - public string PassCreationToken { get; set; } + [JsonPropertyName("passCreationToken")] + public string PassCreationToken { get { return this.PassCreationTokenOption; } set { this.PassCreationTokenOption = new Option(value); } } + + /// + /// Used to track the state of PaymentData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentDataOption { get; private set; } /// /// Encoded payment data. /// /// Encoded payment data. - [DataMember(Name = "paymentData", EmitDefaultValue = false)] - public string PaymentData { get; set; } + [JsonPropertyName("paymentData")] + public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethodType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodTypeOption { get; private set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] - public string PaymentMethodType { get; set; } + [JsonPropertyName("paymentMethodType")] + public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// The voucher reference code. /// /// The voucher reference code. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The shopper email. /// /// The shopper email. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of ShopperName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNameOption { get; private set; } /// /// The shopper name. /// /// The shopper name. - [DataMember(Name = "shopperName", EmitDefaultValue = false)] - public string ShopperName { get; set; } + [JsonPropertyName("shopperName")] + public string ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } + + /// + /// Used to track the state of Surcharge + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SurchargeOption { get; private set; } /// /// Gets or Sets Surcharge /// - [DataMember(Name = "surcharge", EmitDefaultValue = false)] - public Amount Surcharge { get; set; } + [JsonPropertyName("surcharge")] + public Amount Surcharge { get { return this.SurchargeOption; } set { this.SurchargeOption = new Option(value); } } + + /// + /// Used to track the state of TotalAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TotalAmountOption { get; private set; } /// /// Gets or Sets TotalAmount /// - [DataMember(Name = "totalAmount", EmitDefaultValue = false)] - public Amount TotalAmount { get; set; } + [JsonPropertyName("totalAmount")] + public Amount TotalAmount { get { return this.TotalAmountOption; } set { this.TotalAmountOption = new Option(value); } } + + /// + /// Used to track the state of Url + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UrlOption { get; private set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [DataMember(Name = "url", EmitDefaultValue = false)] - public string Url { get; set; } + [JsonPropertyName("url")] + public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -253,6 +426,7 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutVoucherAction {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" AlternativeReference: ").Append(AlternativeReference).Append("\n"); sb.Append(" CollectionInstitutionNumber: ").Append(CollectionInstitutionNumber).Append("\n"); sb.Append(" DownloadUrl: ").Append(DownloadUrl).Append("\n"); @@ -272,251 +446,375 @@ public override string ToString() sb.Append(" ShopperName: ").Append(ShopperName).Append("\n"); sb.Append(" Surcharge: ").Append(Surcharge).Append("\n"); sb.Append(" TotalAmount: ").Append(TotalAmount).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CheckoutVoucherActionJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CheckoutVoucherAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CheckoutVoucherAction); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CheckoutVoucherAction instances are equal - /// - /// Instance of CheckoutVoucherAction to be compared - /// Boolean - public bool Equals(CheckoutVoucherAction input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option type = default; + Option alternativeReference = default; + Option collectionInstitutionNumber = default; + Option downloadUrl = default; + Option entity = default; + Option expiresAt = default; + Option initialAmount = default; + Option instructionsUrl = default; + Option issuer = default; + Option maskedTelephoneNumber = default; + Option merchantName = default; + Option merchantReference = default; + Option passCreationToken = default; + Option paymentData = default; + Option paymentMethodType = default; + Option reference = default; + Option shopperEmail = default; + Option shopperName = default; + Option surcharge = default; + Option totalAmount = default; + Option url = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(CheckoutVoucherAction.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "alternativeReference": + alternativeReference = new Option(utf8JsonReader.GetString()); + break; + case "collectionInstitutionNumber": + collectionInstitutionNumber = new Option(utf8JsonReader.GetString()); + break; + case "downloadUrl": + downloadUrl = new Option(utf8JsonReader.GetString()); + break; + case "entity": + entity = new Option(utf8JsonReader.GetString()); + break; + case "expiresAt": + expiresAt = new Option(utf8JsonReader.GetString()); + break; + case "initialAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + initialAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "instructionsUrl": + instructionsUrl = new Option(utf8JsonReader.GetString()); + break; + case "issuer": + issuer = new Option(utf8JsonReader.GetString()); + break; + case "maskedTelephoneNumber": + maskedTelephoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "merchantName": + merchantName = new Option(utf8JsonReader.GetString()); + break; + case "merchantReference": + merchantReference = new Option(utf8JsonReader.GetString()); + break; + case "passCreationToken": + passCreationToken = new Option(utf8JsonReader.GetString()); + break; + case "paymentData": + paymentData = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethodType": + paymentMethodType = new Option(utf8JsonReader.GetString()); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "shopperName": + shopperName = new Option(utf8JsonReader.GetString()); + break; + case "surcharge": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + surcharge = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "totalAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "url": + url = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AlternativeReference == input.AlternativeReference || - (this.AlternativeReference != null && - this.AlternativeReference.Equals(input.AlternativeReference)) - ) && - ( - this.CollectionInstitutionNumber == input.CollectionInstitutionNumber || - (this.CollectionInstitutionNumber != null && - this.CollectionInstitutionNumber.Equals(input.CollectionInstitutionNumber)) - ) && - ( - this.DownloadUrl == input.DownloadUrl || - (this.DownloadUrl != null && - this.DownloadUrl.Equals(input.DownloadUrl)) - ) && - ( - this.Entity == input.Entity || - (this.Entity != null && - this.Entity.Equals(input.Entity)) - ) && - ( - this.ExpiresAt == input.ExpiresAt || - (this.ExpiresAt != null && - this.ExpiresAt.Equals(input.ExpiresAt)) - ) && - ( - this.InitialAmount == input.InitialAmount || - (this.InitialAmount != null && - this.InitialAmount.Equals(input.InitialAmount)) - ) && - ( - this.InstructionsUrl == input.InstructionsUrl || - (this.InstructionsUrl != null && - this.InstructionsUrl.Equals(input.InstructionsUrl)) - ) && - ( - this.Issuer == input.Issuer || - (this.Issuer != null && - this.Issuer.Equals(input.Issuer)) - ) && - ( - this.MaskedTelephoneNumber == input.MaskedTelephoneNumber || - (this.MaskedTelephoneNumber != null && - this.MaskedTelephoneNumber.Equals(input.MaskedTelephoneNumber)) - ) && - ( - this.MerchantName == input.MerchantName || - (this.MerchantName != null && - this.MerchantName.Equals(input.MerchantName)) - ) && - ( - this.MerchantReference == input.MerchantReference || - (this.MerchantReference != null && - this.MerchantReference.Equals(input.MerchantReference)) - ) && - ( - this.PassCreationToken == input.PassCreationToken || - (this.PassCreationToken != null && - this.PassCreationToken.Equals(input.PassCreationToken)) - ) && - ( - this.PaymentData == input.PaymentData || - (this.PaymentData != null && - this.PaymentData.Equals(input.PaymentData)) - ) && - ( - this.PaymentMethodType == input.PaymentMethodType || - (this.PaymentMethodType != null && - this.PaymentMethodType.Equals(input.PaymentMethodType)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.ShopperName == input.ShopperName || - (this.ShopperName != null && - this.ShopperName.Equals(input.ShopperName)) - ) && - ( - this.Surcharge == input.Surcharge || - (this.Surcharge != null && - this.Surcharge.Equals(input.Surcharge)) - ) && - ( - this.TotalAmount == input.TotalAmount || - (this.TotalAmount != null && - this.TotalAmount.Equals(input.TotalAmount)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class CheckoutVoucherAction.", nameof(type)); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutVoucherAction."); + + if (alternativeReference.IsSet && alternativeReference.Value == null) + throw new ArgumentNullException(nameof(alternativeReference), "Property is not nullable for class CheckoutVoucherAction."); + + if (collectionInstitutionNumber.IsSet && collectionInstitutionNumber.Value == null) + throw new ArgumentNullException(nameof(collectionInstitutionNumber), "Property is not nullable for class CheckoutVoucherAction."); + + if (downloadUrl.IsSet && downloadUrl.Value == null) + throw new ArgumentNullException(nameof(downloadUrl), "Property is not nullable for class CheckoutVoucherAction."); + + if (entity.IsSet && entity.Value == null) + throw new ArgumentNullException(nameof(entity), "Property is not nullable for class CheckoutVoucherAction."); + + if (expiresAt.IsSet && expiresAt.Value == null) + throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CheckoutVoucherAction."); + + if (initialAmount.IsSet && initialAmount.Value == null) + throw new ArgumentNullException(nameof(initialAmount), "Property is not nullable for class CheckoutVoucherAction."); + + if (instructionsUrl.IsSet && instructionsUrl.Value == null) + throw new ArgumentNullException(nameof(instructionsUrl), "Property is not nullable for class CheckoutVoucherAction."); + + if (issuer.IsSet && issuer.Value == null) + throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class CheckoutVoucherAction."); + + if (maskedTelephoneNumber.IsSet && maskedTelephoneNumber.Value == null) + throw new ArgumentNullException(nameof(maskedTelephoneNumber), "Property is not nullable for class CheckoutVoucherAction."); + + if (merchantName.IsSet && merchantName.Value == null) + throw new ArgumentNullException(nameof(merchantName), "Property is not nullable for class CheckoutVoucherAction."); + + if (merchantReference.IsSet && merchantReference.Value == null) + throw new ArgumentNullException(nameof(merchantReference), "Property is not nullable for class CheckoutVoucherAction."); + + if (passCreationToken.IsSet && passCreationToken.Value == null) + throw new ArgumentNullException(nameof(passCreationToken), "Property is not nullable for class CheckoutVoucherAction."); + + if (paymentData.IsSet && paymentData.Value == null) + throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class CheckoutVoucherAction."); + + if (paymentMethodType.IsSet && paymentMethodType.Value == null) + throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutVoucherAction."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CheckoutVoucherAction."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class CheckoutVoucherAction."); + + if (shopperName.IsSet && shopperName.Value == null) + throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class CheckoutVoucherAction."); + + if (surcharge.IsSet && surcharge.Value == null) + throw new ArgumentNullException(nameof(surcharge), "Property is not nullable for class CheckoutVoucherAction."); + + if (totalAmount.IsSet && totalAmount.Value == null) + throw new ArgumentNullException(nameof(totalAmount), "Property is not nullable for class CheckoutVoucherAction."); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutVoucherAction."); + + return new CheckoutVoucherAction(type.Value.Value, alternativeReference, collectionInstitutionNumber, downloadUrl, entity, expiresAt, initialAmount, instructionsUrl, issuer, maskedTelephoneNumber, merchantName, merchantReference, passCreationToken, paymentData, paymentMethodType, reference, shopperEmail, shopperName, surcharge, totalAmount, url); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CheckoutVoucherAction checkoutVoucherAction, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AlternativeReference != null) - { - hashCode = (hashCode * 59) + this.AlternativeReference.GetHashCode(); - } - if (this.CollectionInstitutionNumber != null) - { - hashCode = (hashCode * 59) + this.CollectionInstitutionNumber.GetHashCode(); - } - if (this.DownloadUrl != null) - { - hashCode = (hashCode * 59) + this.DownloadUrl.GetHashCode(); - } - if (this.Entity != null) - { - hashCode = (hashCode * 59) + this.Entity.GetHashCode(); - } - if (this.ExpiresAt != null) - { - hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); - } - if (this.InitialAmount != null) - { - hashCode = (hashCode * 59) + this.InitialAmount.GetHashCode(); - } - if (this.InstructionsUrl != null) - { - hashCode = (hashCode * 59) + this.InstructionsUrl.GetHashCode(); - } - if (this.Issuer != null) - { - hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); - } - if (this.MaskedTelephoneNumber != null) - { - hashCode = (hashCode * 59) + this.MaskedTelephoneNumber.GetHashCode(); - } - if (this.MerchantName != null) - { - hashCode = (hashCode * 59) + this.MerchantName.GetHashCode(); - } - if (this.MerchantReference != null) - { - hashCode = (hashCode * 59) + this.MerchantReference.GetHashCode(); - } - if (this.PassCreationToken != null) - { - hashCode = (hashCode * 59) + this.PassCreationToken.GetHashCode(); - } - if (this.PaymentData != null) - { - hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); - } - if (this.PaymentMethodType != null) - { - hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.ShopperName != null) - { - hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); - } - if (this.Surcharge != null) - { - hashCode = (hashCode * 59) + this.Surcharge.GetHashCode(); - } - if (this.TotalAmount != null) - { - hashCode = (hashCode * 59) + this.TotalAmount.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.Url != null) - { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, checkoutVoucherAction, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CheckoutVoucherAction checkoutVoucherAction, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (checkoutVoucherAction.AlternativeReferenceOption.IsSet && checkoutVoucherAction.AlternativeReference == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.AlternativeReference), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.CollectionInstitutionNumberOption.IsSet && checkoutVoucherAction.CollectionInstitutionNumber == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.CollectionInstitutionNumber), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.DownloadUrlOption.IsSet && checkoutVoucherAction.DownloadUrl == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.DownloadUrl), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.EntityOption.IsSet && checkoutVoucherAction.Entity == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.Entity), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.ExpiresAtOption.IsSet && checkoutVoucherAction.ExpiresAt == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.ExpiresAt), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.InitialAmountOption.IsSet && checkoutVoucherAction.InitialAmount == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.InitialAmount), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.InstructionsUrlOption.IsSet && checkoutVoucherAction.InstructionsUrl == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.InstructionsUrl), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.IssuerOption.IsSet && checkoutVoucherAction.Issuer == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.Issuer), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.MaskedTelephoneNumberOption.IsSet && checkoutVoucherAction.MaskedTelephoneNumber == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.MaskedTelephoneNumber), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.MerchantNameOption.IsSet && checkoutVoucherAction.MerchantName == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.MerchantName), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.MerchantReferenceOption.IsSet && checkoutVoucherAction.MerchantReference == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.MerchantReference), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.PassCreationTokenOption.IsSet && checkoutVoucherAction.PassCreationToken == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.PassCreationToken), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.PaymentDataOption.IsSet && checkoutVoucherAction.PaymentData == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.PaymentData), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.PaymentMethodTypeOption.IsSet && checkoutVoucherAction.PaymentMethodType == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.PaymentMethodType), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.ReferenceOption.IsSet && checkoutVoucherAction.Reference == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.Reference), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.ShopperEmailOption.IsSet && checkoutVoucherAction.ShopperEmail == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.ShopperEmail), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.ShopperNameOption.IsSet && checkoutVoucherAction.ShopperName == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.ShopperName), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.SurchargeOption.IsSet && checkoutVoucherAction.Surcharge == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.Surcharge), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.TotalAmountOption.IsSet && checkoutVoucherAction.TotalAmount == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.TotalAmount), "Property is required for class CheckoutVoucherAction."); + + if (checkoutVoucherAction.UrlOption.IsSet && checkoutVoucherAction.Url == null) + throw new ArgumentNullException(nameof(checkoutVoucherAction.Url), "Property is required for class CheckoutVoucherAction."); + + var typeRawValue = CheckoutVoucherAction.TypeEnumToJsonValue(checkoutVoucherAction.Type); + writer.WriteString("type", typeRawValue); + if (checkoutVoucherAction.AlternativeReferenceOption.IsSet) + writer.WriteString("alternativeReference", checkoutVoucherAction.AlternativeReference); + + if (checkoutVoucherAction.CollectionInstitutionNumberOption.IsSet) + writer.WriteString("collectionInstitutionNumber", checkoutVoucherAction.CollectionInstitutionNumber); + + if (checkoutVoucherAction.DownloadUrlOption.IsSet) + writer.WriteString("downloadUrl", checkoutVoucherAction.DownloadUrl); + + if (checkoutVoucherAction.EntityOption.IsSet) + writer.WriteString("entity", checkoutVoucherAction.Entity); + + if (checkoutVoucherAction.ExpiresAtOption.IsSet) + writer.WriteString("expiresAt", checkoutVoucherAction.ExpiresAt); + + if (checkoutVoucherAction.InitialAmountOption.IsSet) + { + writer.WritePropertyName("initialAmount"); + JsonSerializer.Serialize(writer, checkoutVoucherAction.InitialAmount, jsonSerializerOptions); + } + if (checkoutVoucherAction.InstructionsUrlOption.IsSet) + writer.WriteString("instructionsUrl", checkoutVoucherAction.InstructionsUrl); + + if (checkoutVoucherAction.IssuerOption.IsSet) + writer.WriteString("issuer", checkoutVoucherAction.Issuer); + + if (checkoutVoucherAction.MaskedTelephoneNumberOption.IsSet) + writer.WriteString("maskedTelephoneNumber", checkoutVoucherAction.MaskedTelephoneNumber); + + if (checkoutVoucherAction.MerchantNameOption.IsSet) + writer.WriteString("merchantName", checkoutVoucherAction.MerchantName); + + if (checkoutVoucherAction.MerchantReferenceOption.IsSet) + writer.WriteString("merchantReference", checkoutVoucherAction.MerchantReference); + + if (checkoutVoucherAction.PassCreationTokenOption.IsSet) + writer.WriteString("passCreationToken", checkoutVoucherAction.PassCreationToken); + + if (checkoutVoucherAction.PaymentDataOption.IsSet) + writer.WriteString("paymentData", checkoutVoucherAction.PaymentData); + + if (checkoutVoucherAction.PaymentMethodTypeOption.IsSet) + writer.WriteString("paymentMethodType", checkoutVoucherAction.PaymentMethodType); + + if (checkoutVoucherAction.ReferenceOption.IsSet) + writer.WriteString("reference", checkoutVoucherAction.Reference); + + if (checkoutVoucherAction.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", checkoutVoucherAction.ShopperEmail); + + if (checkoutVoucherAction.ShopperNameOption.IsSet) + writer.WriteString("shopperName", checkoutVoucherAction.ShopperName); + + if (checkoutVoucherAction.SurchargeOption.IsSet) + { + writer.WritePropertyName("surcharge"); + JsonSerializer.Serialize(writer, checkoutVoucherAction.Surcharge, jsonSerializerOptions); + } + if (checkoutVoucherAction.TotalAmountOption.IsSet) + { + writer.WritePropertyName("totalAmount"); + JsonSerializer.Serialize(writer, checkoutVoucherAction.TotalAmount, jsonSerializerOptions); + } + if (checkoutVoucherAction.UrlOption.IsSet) + writer.WriteString("url", checkoutVoucherAction.Url); } } - } diff --git a/Adyen/Model/Checkout/CommonField.cs b/Adyen/Model/Checkout/CommonField.cs index 3176cf6c8..194aafd83 100644 --- a/Adyen/Model/Checkout/CommonField.cs +++ b/Adyen/Model/Checkout/CommonField.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,47 +14,62 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CommonField /// - [DataContract(Name = "CommonField")] - public partial class CommonField : IEquatable, IValidatableObject + public partial class CommonField : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Name of the field. For example, Name of External Platform.. - /// Version of the field. For example, Version of External Platform.. - public CommonField(string name = default(string), string version = default(string)) + /// Name of the field. For example, Name of External Platform. + /// Version of the field. For example, Version of External Platform. + [JsonConstructor] + public CommonField(Option name = default, Option varVersion = default) { - this.Name = name; - this.Version = version; + NameOption = name; + VarVersionOption = varVersion; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + /// /// Name of the field. For example, Name of External Platform. /// /// Name of the field. For example, Name of External Platform. - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + + /// + /// Used to track the state of VarVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VarVersionOption { get; private set; } /// /// Version of the field. For example, Version of External Platform. /// /// Version of the field. For example, Version of External Platform. - [DataMember(Name = "version", EmitDefaultValue = false)] - public string Version { get; set; } + [JsonPropertyName("version")] + public string VarVersion { get { return this.VarVersionOption; } set { this.VarVersionOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -66,83 +80,118 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class CommonField {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Version: ").Append(Version).Append("\n"); + sb.Append(" VarVersion: ").Append(VarVersion).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CommonFieldJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CommonField Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CommonField); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CommonField instances are equal - /// - /// Instance of CommonField to be compared - /// Boolean - public bool Equals(CommonField input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option name = default; + Option varVersion = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "version": + varVersion = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Version == input.Version || - (this.Version != null && - this.Version.Equals(input.Version)) - ); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class CommonField."); + + if (varVersion.IsSet && varVersion.Value == null) + throw new ArgumentNullException(nameof(varVersion), "Property is not nullable for class CommonField."); + + return new CommonField(name, varVersion); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CommonField commonField, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.Version != null) - { - hashCode = (hashCode * 59) + this.Version.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, commonField, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CommonField commonField, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (commonField.NameOption.IsSet && commonField.Name == null) + throw new ArgumentNullException(nameof(commonField.Name), "Property is required for class CommonField."); + + if (commonField.VarVersionOption.IsSet && commonField.VarVersion == null) + throw new ArgumentNullException(nameof(commonField.VarVersion), "Property is required for class CommonField."); + + if (commonField.NameOption.IsSet) + writer.WriteString("name", commonField.Name); + + if (commonField.VarVersionOption.IsSet) + writer.WriteString("version", commonField.VarVersion); } } - } diff --git a/Adyen/Model/Checkout/Company.cs b/Adyen/Model/Checkout/Company.cs index 2dd3fbb1c..1c4f1faba 100644 --- a/Adyen/Model/Checkout/Company.cs +++ b/Adyen/Model/Checkout/Company.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,83 +14,126 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Company /// - [DataContract(Name = "Company")] - public partial class Company : IEquatable, IValidatableObject + public partial class Company : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The company website's home page.. - /// The company name.. - /// Registration number of the company.. - /// Registry location of the company.. - /// Tax ID of the company.. - /// The company type.. - public Company(string homepage = default(string), string name = default(string), string registrationNumber = default(string), string registryLocation = default(string), string taxId = default(string), string type = default(string)) + /// The company website's home page. + /// The company name. + /// Registration number of the company. + /// Registry location of the company. + /// Tax ID of the company. + /// The company type. + [JsonConstructor] + public Company(Option homepage = default, Option name = default, Option registrationNumber = default, Option registryLocation = default, Option taxId = default, Option type = default) { - this.Homepage = homepage; - this.Name = name; - this.RegistrationNumber = registrationNumber; - this.RegistryLocation = registryLocation; - this.TaxId = taxId; - this.Type = type; + HomepageOption = homepage; + NameOption = name; + RegistrationNumberOption = registrationNumber; + RegistryLocationOption = registryLocation; + TaxIdOption = taxId; + TypeOption = type; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Homepage + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option HomepageOption { get; private set; } + /// /// The company website's home page. /// /// The company website's home page. - [DataMember(Name = "homepage", EmitDefaultValue = false)] - public string Homepage { get; set; } + [JsonPropertyName("homepage")] + public string Homepage { get { return this.HomepageOption; } set { this.HomepageOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } /// /// The company name. /// /// The company name. - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + + /// + /// Used to track the state of RegistrationNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RegistrationNumberOption { get; private set; } /// /// Registration number of the company. /// /// Registration number of the company. - [DataMember(Name = "registrationNumber", EmitDefaultValue = false)] - public string RegistrationNumber { get; set; } + [JsonPropertyName("registrationNumber")] + public string RegistrationNumber { get { return this.RegistrationNumberOption; } set { this.RegistrationNumberOption = new Option(value); } } + + /// + /// Used to track the state of RegistryLocation + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RegistryLocationOption { get; private set; } /// /// Registry location of the company. /// /// Registry location of the company. - [DataMember(Name = "registryLocation", EmitDefaultValue = false)] - public string RegistryLocation { get; set; } + [JsonPropertyName("registryLocation")] + public string RegistryLocation { get { return this.RegistryLocationOption; } set { this.RegistryLocationOption = new Option(value); } } + + /// + /// Used to track the state of TaxId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TaxIdOption { get; private set; } /// /// Tax ID of the company. /// /// Tax ID of the company. - [DataMember(Name = "taxId", EmitDefaultValue = false)] - public string TaxId { get; set; } + [JsonPropertyName("taxId")] + public string TaxId { get { return this.TaxIdOption; } set { this.TaxIdOption = new Option(value); } } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The company type. /// /// The company type. - [DataMember(Name = "type", EmitDefaultValue = false)] - public string Type { get; set; } + [JsonPropertyName("type")] + public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -112,113 +154,164 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CompanyJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override Company Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as Company); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if Company instances are equal - /// - /// Instance of Company to be compared - /// Boolean - public bool Equals(Company input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option homepage = default; + Option name = default; + Option registrationNumber = default; + Option registryLocation = default; + Option taxId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "homepage": + homepage = new Option(utf8JsonReader.GetString()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "registrationNumber": + registrationNumber = new Option(utf8JsonReader.GetString()); + break; + case "registryLocation": + registryLocation = new Option(utf8JsonReader.GetString()); + break; + case "taxId": + taxId = new Option(utf8JsonReader.GetString()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Homepage == input.Homepage || - (this.Homepage != null && - this.Homepage.Equals(input.Homepage)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.RegistrationNumber == input.RegistrationNumber || - (this.RegistrationNumber != null && - this.RegistrationNumber.Equals(input.RegistrationNumber)) - ) && - ( - this.RegistryLocation == input.RegistryLocation || - (this.RegistryLocation != null && - this.RegistryLocation.Equals(input.RegistryLocation)) - ) && - ( - this.TaxId == input.TaxId || - (this.TaxId != null && - this.TaxId.Equals(input.TaxId)) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ); + + if (homepage.IsSet && homepage.Value == null) + throw new ArgumentNullException(nameof(homepage), "Property is not nullable for class Company."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Company."); + + if (registrationNumber.IsSet && registrationNumber.Value == null) + throw new ArgumentNullException(nameof(registrationNumber), "Property is not nullable for class Company."); + + if (registryLocation.IsSet && registryLocation.Value == null) + throw new ArgumentNullException(nameof(registryLocation), "Property is not nullable for class Company."); + + if (taxId.IsSet && taxId.Value == null) + throw new ArgumentNullException(nameof(taxId), "Property is not nullable for class Company."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class Company."); + + return new Company(homepage, name, registrationNumber, registryLocation, taxId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Company company, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Homepage != null) - { - hashCode = (hashCode * 59) + this.Homepage.GetHashCode(); - } - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.RegistrationNumber != null) - { - hashCode = (hashCode * 59) + this.RegistrationNumber.GetHashCode(); - } - if (this.RegistryLocation != null) - { - hashCode = (hashCode * 59) + this.RegistryLocation.GetHashCode(); - } - if (this.TaxId != null) - { - hashCode = (hashCode * 59) + this.TaxId.GetHashCode(); - } - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, company, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Company company, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (company.HomepageOption.IsSet && company.Homepage == null) + throw new ArgumentNullException(nameof(company.Homepage), "Property is required for class Company."); + + if (company.NameOption.IsSet && company.Name == null) + throw new ArgumentNullException(nameof(company.Name), "Property is required for class Company."); + + if (company.RegistrationNumberOption.IsSet && company.RegistrationNumber == null) + throw new ArgumentNullException(nameof(company.RegistrationNumber), "Property is required for class Company."); + + if (company.RegistryLocationOption.IsSet && company.RegistryLocation == null) + throw new ArgumentNullException(nameof(company.RegistryLocation), "Property is required for class Company."); + + if (company.TaxIdOption.IsSet && company.TaxId == null) + throw new ArgumentNullException(nameof(company.TaxId), "Property is required for class Company."); + + if (company.TypeOption.IsSet && company.Type == null) + throw new ArgumentNullException(nameof(company.Type), "Property is required for class Company."); + + if (company.HomepageOption.IsSet) + writer.WriteString("homepage", company.Homepage); + + if (company.NameOption.IsSet) + writer.WriteString("name", company.Name); + + if (company.RegistrationNumberOption.IsSet) + writer.WriteString("registrationNumber", company.RegistrationNumber); + + if (company.RegistryLocationOption.IsSet) + writer.WriteString("registryLocation", company.RegistryLocation); + + if (company.TaxIdOption.IsSet) + writer.WriteString("taxId", company.TaxId); + + if (company.TypeOption.IsSet) + writer.WriteString("type", company.Type); } } - } diff --git a/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs b/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs index 8ea96dc09..1b424a1d2 100644 --- a/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs +++ b/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,731 +14,1449 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CreateCheckoutSessionRequest /// - [DataContract(Name = "CreateCheckoutSessionRequest")] - public partial class CreateCheckoutSessionRequest : IEquatable, IValidatableObject + public partial class CreateCheckoutSessionRequest : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The merchant account identifier, with which you want to process the transaction. + /// The reference to uniquely identify a payment. + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// accountInfo + /// additionalAmount + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` + /// applicationInfo + /// authenticationData + /// billingAddress + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` + /// The delay between the authorisation and scheduled auto-capture, specified in hours. + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** + /// company + /// The shopper's two-letter country code. + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + /// deliveryAddress + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. + /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. + /// fundOrigin + /// fundRecipient + /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. + /// mandate + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. + /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration (default to ModeEnum.Embedded) + /// mpiData + /// platformChargebackLogic + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + /// Minimum number of days between authorisations. Only for 3D Secure 2. + /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + /// riskData + /// The shopper's email address. + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// The combination of a language code and a country code to specify the language to be used in the payment. + /// shopperName + /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. + /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + /// Set to true to show the payment amount per installment. + /// Set to **true** to show a button that lets the shopper remove a stored payment method. + /// The shopper's social security number. + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false) + /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. + /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. + /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). + /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + /// The shopper's telephone number. + /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. + /// threeDS2RequestData + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) + /// Set to true if the payment should be routed to a trusted MID. + [JsonConstructor] + public CreateCheckoutSessionRequest(Amount amount, string merchantAccount, string reference, string returnUrl, Option accountInfo = default, Option additionalAmount = default, Option> additionalData = default, Option> allowedPaymentMethods = default, Option applicationInfo = default, Option authenticationData = default, Option billingAddress = default, Option> blockedPaymentMethods = default, Option captureDelayHours = default, Option channel = default, Option company = default, Option countryCode = default, Option dateOfBirth = default, Option deliverAt = default, Option deliveryAddress = default, Option enableOneClick = default, Option enablePayOut = default, Option enableRecurring = default, Option expiresAt = default, Option fundOrigin = default, Option fundRecipient = default, Option> installmentOptions = default, Option> lineItems = default, Option mandate = default, Option mcc = default, Option merchantOrderReference = default, Option> metadata = default, Option mode = default, Option mpiData = default, Option platformChargebackLogic = default, Option recurringExpiry = default, Option recurringFrequency = default, Option recurringProcessingModel = default, Option redirectFromIssuerMethod = default, Option redirectToIssuerMethod = default, Option riskData = default, Option shopperEmail = default, Option shopperIP = default, Option shopperInteraction = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option shopperStatement = default, Option showInstallmentAmount = default, Option showRemovePaymentMethodButton = default, Option socialSecurityNumber = default, Option splitCardFundingSources = default, Option> splits = default, Option store = default, Option storeFiltrationMode = default, Option storePaymentMethod = default, Option storePaymentMethodMode = default, Option telephoneNumber = default, Option themeId = default, Option threeDS2RequestData = default, Option threeDSAuthenticationOnly = default, Option trustedShopper = default) + { + Amount = amount; + MerchantAccount = merchantAccount; + Reference = reference; + ReturnUrl = returnUrl; + AccountInfoOption = accountInfo; + AdditionalAmountOption = additionalAmount; + AdditionalDataOption = additionalData; + AllowedPaymentMethodsOption = allowedPaymentMethods; + ApplicationInfoOption = applicationInfo; + AuthenticationDataOption = authenticationData; + BillingAddressOption = billingAddress; + BlockedPaymentMethodsOption = blockedPaymentMethods; + CaptureDelayHoursOption = captureDelayHours; + ChannelOption = channel; + CompanyOption = company; + CountryCodeOption = countryCode; + DateOfBirthOption = dateOfBirth; + DeliverAtOption = deliverAt; + DeliveryAddressOption = deliveryAddress; + EnableOneClickOption = enableOneClick; + EnablePayOutOption = enablePayOut; + EnableRecurringOption = enableRecurring; + ExpiresAtOption = expiresAt; + FundOriginOption = fundOrigin; + FundRecipientOption = fundRecipient; + InstallmentOptionsOption = installmentOptions; + LineItemsOption = lineItems; + MandateOption = mandate; + MccOption = mcc; + MerchantOrderReferenceOption = merchantOrderReference; + MetadataOption = metadata; + ModeOption = mode; + MpiDataOption = mpiData; + PlatformChargebackLogicOption = platformChargebackLogic; + RecurringExpiryOption = recurringExpiry; + RecurringFrequencyOption = recurringFrequency; + RecurringProcessingModelOption = recurringProcessingModel; + RedirectFromIssuerMethodOption = redirectFromIssuerMethod; + RedirectToIssuerMethodOption = redirectToIssuerMethod; + RiskDataOption = riskData; + ShopperEmailOption = shopperEmail; + ShopperIPOption = shopperIP; + ShopperInteractionOption = shopperInteraction; + ShopperLocaleOption = shopperLocale; + ShopperNameOption = shopperName; + ShopperReferenceOption = shopperReference; + ShopperStatementOption = shopperStatement; + ShowInstallmentAmountOption = showInstallmentAmount; + ShowRemovePaymentMethodButtonOption = showRemovePaymentMethodButton; + SocialSecurityNumberOption = socialSecurityNumber; + SplitCardFundingSourcesOption = splitCardFundingSources; + SplitsOption = splits; + StoreOption = store; + StoreFiltrationModeOption = storeFiltrationMode; + StorePaymentMethodOption = storePaymentMethod; + StorePaymentMethodModeOption = storePaymentMethodMode; + TelephoneNumberOption = telephoneNumber; + ThemeIdOption = themeId; + ThreeDS2RequestDataOption = threeDS2RequestData; + ThreeDSAuthenticationOnlyOption = threeDSAuthenticationOnly; + TrustedShopperOption = trustedShopper; + OnCreated(); + } + + partial void OnCreated(); + /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** - [JsonConverter(typeof(StringEnumConverter))] public enum ChannelEnum { /// /// Enum IOS for value: iOS /// - [EnumMember(Value = "iOS")] IOS = 1, /// /// Enum Android for value: Android /// - [EnumMember(Value = "Android")] Android = 2, /// /// Enum Web for value: Web /// - [EnumMember(Value = "Web")] Web = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ChannelEnum ChannelEnumFromString(string value) + { + if (value.Equals("iOS")) + return ChannelEnum.IOS; + + if (value.Equals("Android")) + return ChannelEnum.Android; + + if (value.Equals("Web")) + return ChannelEnum.Web; + + throw new NotImplementedException($"Could not convert value to type ChannelEnum: '{value}'"); + } + /// + /// Returns a + /// + /// + /// + public static ChannelEnum? ChannelEnumFromStringOrDefault(string value) + { + if (value.Equals("iOS")) + return ChannelEnum.IOS; + + if (value.Equals("Android")) + return ChannelEnum.Android; + + if (value.Equals("Web")) + return ChannelEnum.Web; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChannelEnumToJsonValue(ChannelEnum? value) + { + if (value == ChannelEnum.IOS) + return "iOS"; + + if (value == ChannelEnum.Android) + return "Android"; + + if (value == ChannelEnum.Web) + return "Web"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Channel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChannelOption { get; private set; } /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** - [DataMember(Name = "channel", EmitDefaultValue = false)] - public ChannelEnum? Channel { get; set; } + [JsonPropertyName("channel")] + public ChannelEnum? Channel { get { return this.ChannelOption; } set { this.ChannelOption = new Option(value); } } + /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration - [JsonConverter(typeof(StringEnumConverter))] public enum ModeEnum { /// /// Enum Embedded for value: embedded /// - [EnumMember(Value = "embedded")] Embedded = 1, /// /// Enum Hosted for value: hosted /// - [EnumMember(Value = "hosted")] Hosted = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ModeEnum ModeEnumFromString(string value) + { + if (value.Equals("embedded")) + return ModeEnum.Embedded; + + if (value.Equals("hosted")) + return ModeEnum.Hosted; + + throw new NotImplementedException($"Could not convert value to type ModeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ModeEnum? ModeEnumFromStringOrDefault(string value) + { + if (value.Equals("embedded")) + return ModeEnum.Embedded; + + if (value.Equals("hosted")) + return ModeEnum.Hosted; + + return null; + } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ModeEnumToJsonValue(ModeEnum? value) + { + if (value == ModeEnum.Embedded) + return "embedded"; + + if (value == ModeEnum.Hosted) + return "hosted"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Mode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ModeOption { get; private set; } /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration - [DataMember(Name = "mode", EmitDefaultValue = false)] - public ModeEnum? Mode { get; set; } + [JsonPropertyName("mode")] + public ModeEnum? Mode { get { return this.ModeOption; } set { this.ModeOption = new Option(value); } } + /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// - [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// - [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// - [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) + { + if (value == RecurringProcessingModelEnum.CardOnFile) + return "CardOnFile"; + + if (value == RecurringProcessingModelEnum.Subscription) + return "Subscription"; + if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) + return "UnscheduledCardOnFile"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of RecurringProcessingModel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] - public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } + [JsonPropertyName("recurringProcessingModel")] + public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } + /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [JsonConverter(typeof(StringEnumConverter))] public enum ShopperInteractionEnum { /// /// Enum Ecommerce for value: Ecommerce /// - [EnumMember(Value = "Ecommerce")] Ecommerce = 1, /// /// Enum ContAuth for value: ContAuth /// - [EnumMember(Value = "ContAuth")] ContAuth = 2, /// /// Enum Moto for value: Moto /// - [EnumMember(Value = "Moto")] Moto = 3, /// /// Enum POS for value: POS /// - [EnumMember(Value = "POS")] POS = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ShopperInteractionEnum ShopperInteractionEnumFromString(string value) + { + if (value.Equals("Ecommerce")) + return ShopperInteractionEnum.Ecommerce; + + if (value.Equals("ContAuth")) + return ShopperInteractionEnum.ContAuth; + + if (value.Equals("Moto")) + return ShopperInteractionEnum.Moto; + + if (value.Equals("POS")) + return ShopperInteractionEnum.POS; + + throw new NotImplementedException($"Could not convert value to type ShopperInteractionEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ShopperInteractionEnum? ShopperInteractionEnumFromStringOrDefault(string value) + { + if (value.Equals("Ecommerce")) + return ShopperInteractionEnum.Ecommerce; + if (value.Equals("ContAuth")) + return ShopperInteractionEnum.ContAuth; + + if (value.Equals("Moto")) + return ShopperInteractionEnum.Moto; + + if (value.Equals("POS")) + return ShopperInteractionEnum.POS; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ShopperInteractionEnumToJsonValue(ShopperInteractionEnum? value) + { + if (value == ShopperInteractionEnum.Ecommerce) + return "Ecommerce"; + + if (value == ShopperInteractionEnum.ContAuth) + return "ContAuth"; + + if (value == ShopperInteractionEnum.Moto) + return "Moto"; + + if (value == ShopperInteractionEnum.POS) + return "POS"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of ShopperInteraction + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperInteractionOption { get; private set; } /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] - public ShopperInteractionEnum? ShopperInteraction { get; set; } + [JsonPropertyName("shopperInteraction")] + public ShopperInteractionEnum? ShopperInteraction { get { return this.ShopperInteractionOption; } set { this.ShopperInteractionOption = new Option(value); } } + /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - [JsonConverter(typeof(StringEnumConverter))] public enum StoreFiltrationModeEnum { /// /// Enum Exclusive for value: exclusive /// - [EnumMember(Value = "exclusive")] Exclusive = 1, /// /// Enum Inclusive for value: inclusive /// - [EnumMember(Value = "inclusive")] Inclusive = 2, /// /// Enum SkipFilter for value: skipFilter /// - [EnumMember(Value = "skipFilter")] SkipFilter = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static StoreFiltrationModeEnum StoreFiltrationModeEnumFromString(string value) + { + if (value.Equals("exclusive")) + return StoreFiltrationModeEnum.Exclusive; + + if (value.Equals("inclusive")) + return StoreFiltrationModeEnum.Inclusive; + + if (value.Equals("skipFilter")) + return StoreFiltrationModeEnum.SkipFilter; + + throw new NotImplementedException($"Could not convert value to type StoreFiltrationModeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static StoreFiltrationModeEnum? StoreFiltrationModeEnumFromStringOrDefault(string value) + { + if (value.Equals("exclusive")) + return StoreFiltrationModeEnum.Exclusive; + + if (value.Equals("inclusive")) + return StoreFiltrationModeEnum.Inclusive; + + if (value.Equals("skipFilter")) + return StoreFiltrationModeEnum.SkipFilter; + + return null; + } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StoreFiltrationModeEnumToJsonValue(StoreFiltrationModeEnum? value) + { + if (value == StoreFiltrationModeEnum.Exclusive) + return "exclusive"; + + if (value == StoreFiltrationModeEnum.Inclusive) + return "inclusive"; + + if (value == StoreFiltrationModeEnum.SkipFilter) + return "skipFilter"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of StoreFiltrationMode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoreFiltrationModeOption { get; private set; } /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - [DataMember(Name = "storeFiltrationMode", EmitDefaultValue = false)] - public StoreFiltrationModeEnum? StoreFiltrationMode { get; set; } + [JsonPropertyName("storeFiltrationMode")] + public StoreFiltrationModeEnum? StoreFiltrationMode { get { return this.StoreFiltrationModeOption; } set { this.StoreFiltrationModeOption = new Option(value); } } + /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. - [JsonConverter(typeof(StringEnumConverter))] public enum StorePaymentMethodModeEnum { /// /// Enum AskForConsent for value: askForConsent /// - [EnumMember(Value = "askForConsent")] AskForConsent = 1, /// /// Enum Disabled for value: disabled /// - [EnumMember(Value = "disabled")] Disabled = 2, /// /// Enum Enabled for value: enabled /// - [EnumMember(Value = "enabled")] Enabled = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static StorePaymentMethodModeEnum StorePaymentMethodModeEnumFromString(string value) + { + if (value.Equals("askForConsent")) + return StorePaymentMethodModeEnum.AskForConsent; + + if (value.Equals("disabled")) + return StorePaymentMethodModeEnum.Disabled; + + if (value.Equals("enabled")) + return StorePaymentMethodModeEnum.Enabled; + + throw new NotImplementedException($"Could not convert value to type StorePaymentMethodModeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static StorePaymentMethodModeEnum? StorePaymentMethodModeEnumFromStringOrDefault(string value) + { + if (value.Equals("askForConsent")) + return StorePaymentMethodModeEnum.AskForConsent; + + if (value.Equals("disabled")) + return StorePaymentMethodModeEnum.Disabled; + + if (value.Equals("enabled")) + return StorePaymentMethodModeEnum.Enabled; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StorePaymentMethodModeEnumToJsonValue(StorePaymentMethodModeEnum? value) + { + if (value == StorePaymentMethodModeEnum.AskForConsent) + return "askForConsent"; + + if (value == StorePaymentMethodModeEnum.Disabled) + return "disabled"; + + if (value == StorePaymentMethodModeEnum.Enabled) + return "enabled"; + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of StorePaymentMethodMode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StorePaymentMethodModeOption { get; private set; } /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. - [DataMember(Name = "storePaymentMethodMode", EmitDefaultValue = false)] - public StorePaymentMethodModeEnum? StorePaymentMethodMode { get; set; } + [JsonPropertyName("storePaymentMethodMode")] + public StorePaymentMethodModeEnum? StorePaymentMethodMode { get { return this.StorePaymentMethodModeOption; } set { this.StorePaymentMethodModeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Gets or Sets Amount /// - [JsonConstructorAttribute] - protected CreateCheckoutSessionRequest() { } + [JsonPropertyName("amount")] + public Amount Amount { get; set; } + /// - /// Initializes a new instance of the class. + /// The merchant account identifier, with which you want to process the transaction. /// - /// accountInfo. - /// additionalAmount. - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. - /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]`. - /// amount (required). - /// applicationInfo. - /// authenticationData. - /// billingAddress. - /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]`. - /// The delay between the authorisation and scheduled auto-capture, specified in hours.. - /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web**. - /// company. - /// The shopper's two-letter country code.. - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. - /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.. - /// deliveryAddress. - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition).. - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts.. - /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments.. - /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation.. - /// fundOrigin. - /// fundRecipient. - /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options.. - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip.. - /// mandate. - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. - /// The merchant account identifier, with which you want to process the transaction. (required). - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.. - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. . - /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration (default to ModeEnum.Embedded). - /// mpiData. - /// platformChargebackLogic. - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2.. - /// Minimum number of days between authorisations. Only for 3D Secure 2.. - /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer.. - /// Specifies the redirect method (GET or POST) when redirecting to the issuer.. - /// The reference to uniquely identify a payment. (required). - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. (required). - /// riskData. - /// The shopper's email address.. - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new).. - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. - /// The combination of a language code and a country code to specify the language to be used in the payment.. - /// shopperName. - /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. - /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**.. - /// Set to true to show the payment amount per installment.. - /// Set to **true** to show a button that lets the shopper remove a stored payment method.. - /// The shopper's social security number.. - /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false). - /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).. - /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment.. - /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned.. - /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types).. - /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent.. - /// The shopper's telephone number.. - /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area.. - /// threeDS2RequestData. - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false). - /// Set to true if the payment should be routed to a trusted MID.. - public CreateCheckoutSessionRequest(AccountInfo accountInfo = default(AccountInfo), Amount additionalAmount = default(Amount), Dictionary additionalData = default(Dictionary), List allowedPaymentMethods = default(List), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), AuthenticationData authenticationData = default(AuthenticationData), BillingAddress billingAddress = default(BillingAddress), List blockedPaymentMethods = default(List), int? captureDelayHours = default(int?), ChannelEnum? channel = default(ChannelEnum?), Company company = default(Company), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), DateTime deliverAt = default(DateTime), DeliveryAddress deliveryAddress = default(DeliveryAddress), bool? enableOneClick = default(bool?), bool? enablePayOut = default(bool?), bool? enableRecurring = default(bool?), DateTime expiresAt = default(DateTime), FundOrigin fundOrigin = default(FundOrigin), FundRecipient fundRecipient = default(FundRecipient), Dictionary installmentOptions = default(Dictionary), List lineItems = default(List), Mandate mandate = default(Mandate), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), Dictionary metadata = default(Dictionary), ModeEnum? mode = ModeEnum.Embedded, ThreeDSecureData mpiData = default(ThreeDSecureData), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), string recurringExpiry = default(string), string recurringFrequency = default(string), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string redirectFromIssuerMethod = default(string), string redirectToIssuerMethod = default(string), string reference = default(string), string returnUrl = default(string), RiskData riskData = default(RiskData), string shopperEmail = default(string), string shopperIP = default(string), ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), bool? showInstallmentAmount = default(bool?), bool? showRemovePaymentMethodButton = default(bool?), string socialSecurityNumber = default(string), bool? splitCardFundingSources = false, List splits = default(List), string store = default(string), StoreFiltrationModeEnum? storeFiltrationMode = default(StoreFiltrationModeEnum?), bool? storePaymentMethod = default(bool?), StorePaymentMethodModeEnum? storePaymentMethodMode = default(StorePaymentMethodModeEnum?), string telephoneNumber = default(string), string themeId = default(string), CheckoutSessionThreeDS2RequestData threeDS2RequestData = default(CheckoutSessionThreeDS2RequestData), bool? threeDSAuthenticationOnly = false, bool? trustedShopper = default(bool?)) - { - this.Amount = amount; - this.MerchantAccount = merchantAccount; - this.Reference = reference; - this.ReturnUrl = returnUrl; - this.AccountInfo = accountInfo; - this.AdditionalAmount = additionalAmount; - this.AdditionalData = additionalData; - this.AllowedPaymentMethods = allowedPaymentMethods; - this.ApplicationInfo = applicationInfo; - this.AuthenticationData = authenticationData; - this.BillingAddress = billingAddress; - this.BlockedPaymentMethods = blockedPaymentMethods; - this.CaptureDelayHours = captureDelayHours; - this.Channel = channel; - this.Company = company; - this.CountryCode = countryCode; - this.DateOfBirth = dateOfBirth; - this.DeliverAt = deliverAt; - this.DeliveryAddress = deliveryAddress; - this.EnableOneClick = enableOneClick; - this.EnablePayOut = enablePayOut; - this.EnableRecurring = enableRecurring; - this.ExpiresAt = expiresAt; - this.FundOrigin = fundOrigin; - this.FundRecipient = fundRecipient; - this.InstallmentOptions = installmentOptions; - this.LineItems = lineItems; - this.Mandate = mandate; - this.Mcc = mcc; - this.MerchantOrderReference = merchantOrderReference; - this.Metadata = metadata; - this.Mode = mode; - this.MpiData = mpiData; - this.PlatformChargebackLogic = platformChargebackLogic; - this.RecurringExpiry = recurringExpiry; - this.RecurringFrequency = recurringFrequency; - this.RecurringProcessingModel = recurringProcessingModel; - this.RedirectFromIssuerMethod = redirectFromIssuerMethod; - this.RedirectToIssuerMethod = redirectToIssuerMethod; - this.RiskData = riskData; - this.ShopperEmail = shopperEmail; - this.ShopperIP = shopperIP; - this.ShopperInteraction = shopperInteraction; - this.ShopperLocale = shopperLocale; - this.ShopperName = shopperName; - this.ShopperReference = shopperReference; - this.ShopperStatement = shopperStatement; - this.ShowInstallmentAmount = showInstallmentAmount; - this.ShowRemovePaymentMethodButton = showRemovePaymentMethodButton; - this.SocialSecurityNumber = socialSecurityNumber; - this.SplitCardFundingSources = splitCardFundingSources; - this.Splits = splits; - this.Store = store; - this.StoreFiltrationMode = storeFiltrationMode; - this.StorePaymentMethod = storePaymentMethod; - this.StorePaymentMethodMode = storePaymentMethodMode; - this.TelephoneNumber = telephoneNumber; - this.ThemeId = themeId; - this.ThreeDS2RequestData = threeDS2RequestData; - this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; - this.TrustedShopper = trustedShopper; - } + /// The merchant account identifier, with which you want to process the transaction. + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get; set; } + + /// + /// The reference to uniquely identify a payment. + /// + /// The reference to uniquely identify a payment. + [JsonPropertyName("reference")] + public string Reference { get; set; } + + /// + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + [JsonPropertyName("returnUrl")] + public string ReturnUrl { get; set; } + + /// + /// Used to track the state of AccountInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountInfoOption { get; private set; } /// /// Gets or Sets AccountInfo /// - [DataMember(Name = "accountInfo", EmitDefaultValue = false)] - public AccountInfo AccountInfo { get; set; } + [JsonPropertyName("accountInfo")] + public AccountInfo AccountInfo { get { return this.AccountInfoOption; } set { this.AccountInfoOption = new Option(value); } } + + /// + /// Used to track the state of AdditionalAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AdditionalAmountOption { get; private set; } /// /// Gets or Sets AdditionalAmount /// - [DataMember(Name = "additionalAmount", EmitDefaultValue = false)] - public Amount AdditionalAmount { get; set; } + [JsonPropertyName("additionalAmount")] + public Amount AdditionalAmount { get { return this.AdditionalAmountOption; } set { this.AdditionalAmountOption = new Option(value); } } + + /// + /// Used to track the state of AdditionalData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AdditionalDataOption { get; private set; } /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - [DataMember(Name = "additionalData", EmitDefaultValue = false)] - public Dictionary AdditionalData { get; set; } + [JsonPropertyName("additionalData")] + public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } + + /// + /// Used to track the state of AllowedPaymentMethods + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AllowedPaymentMethodsOption { get; private set; } /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] - public List AllowedPaymentMethods { get; set; } + [JsonPropertyName("allowedPaymentMethods")] + public List AllowedPaymentMethods { get { return this.AllowedPaymentMethodsOption; } set { this.AllowedPaymentMethodsOption = new Option>(value); } } /// - /// Gets or Sets Amount + /// Used to track the state of ApplicationInfo /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ApplicationInfoOption { get; private set; } /// /// Gets or Sets ApplicationInfo /// - [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; set; } + [JsonPropertyName("applicationInfo")] + public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + + /// + /// Used to track the state of AuthenticationData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthenticationDataOption { get; private set; } /// /// Gets or Sets AuthenticationData /// - [DataMember(Name = "authenticationData", EmitDefaultValue = false)] - public AuthenticationData AuthenticationData { get; set; } + [JsonPropertyName("authenticationData")] + public AuthenticationData AuthenticationData { get { return this.AuthenticationDataOption; } set { this.AuthenticationDataOption = new Option(value); } } + + /// + /// Used to track the state of BillingAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressOption { get; private set; } /// /// Gets or Sets BillingAddress /// - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public BillingAddress BillingAddress { get; set; } + [JsonPropertyName("billingAddress")] + public BillingAddress BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } + + /// + /// Used to track the state of BlockedPaymentMethods + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> BlockedPaymentMethodsOption { get; private set; } /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] - public List BlockedPaymentMethods { get; set; } + [JsonPropertyName("blockedPaymentMethods")] + public List BlockedPaymentMethods { get { return this.BlockedPaymentMethodsOption; } set { this.BlockedPaymentMethodsOption = new Option>(value); } } + + /// + /// Used to track the state of CaptureDelayHours + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CaptureDelayHoursOption { get; private set; } /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. - [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] - public int? CaptureDelayHours { get; set; } + [JsonPropertyName("captureDelayHours")] + public int? CaptureDelayHours { get { return this.CaptureDelayHoursOption; } set { this.CaptureDelayHoursOption = new Option(value); } } + + /// + /// Used to track the state of Company + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CompanyOption { get; private set; } /// /// Gets or Sets Company /// - [DataMember(Name = "company", EmitDefaultValue = false)] - public Company Company { get; set; } + [JsonPropertyName("company")] + public Company Company { get { return this.CompanyOption; } set { this.CompanyOption = new Option(value); } } + + /// + /// Used to track the state of CountryCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryCodeOption { get; private set; } /// /// The shopper's two-letter country code. /// /// The shopper's two-letter country code. - [DataMember(Name = "countryCode", EmitDefaultValue = false)] - public string CountryCode { get; set; } + [JsonPropertyName("countryCode")] + public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } + + /// + /// Used to track the state of DateOfBirth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DateOfBirthOption { get; private set; } /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] - [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime DateOfBirth { get; set; } + [JsonPropertyName("dateOfBirth")] + public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } + + /// + /// Used to track the state of DeliverAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliverAtOption { get; private set; } /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [DataMember(Name = "deliverAt", EmitDefaultValue = false)] - public DateTime DeliverAt { get; set; } + [JsonPropertyName("deliverAt")] + public DateTime? DeliverAt { get { return this.DeliverAtOption; } set { this.DeliverAtOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryAddressOption { get; private set; } /// /// Gets or Sets DeliveryAddress /// - [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] - public DeliveryAddress DeliveryAddress { get; set; } + [JsonPropertyName("deliveryAddress")] + public DeliveryAddress DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } + + /// + /// Used to track the state of EnableOneClick + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnableOneClickOption { get; private set; } /// /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). /// /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). - [DataMember(Name = "enableOneClick", EmitDefaultValue = false)] - public bool? EnableOneClick { get; set; } + [JsonPropertyName("enableOneClick")] + public bool? EnableOneClick { get { return this.EnableOneClickOption; } set { this.EnableOneClickOption = new Option(value); } } + + /// + /// Used to track the state of EnablePayOut + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnablePayOutOption { get; private set; } /// /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. /// /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. - [DataMember(Name = "enablePayOut", EmitDefaultValue = false)] - public bool? EnablePayOut { get; set; } + [JsonPropertyName("enablePayOut")] + public bool? EnablePayOut { get { return this.EnablePayOutOption; } set { this.EnablePayOutOption = new Option(value); } } + + /// + /// Used to track the state of EnableRecurring + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnableRecurringOption { get; private set; } /// /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. /// /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. - [DataMember(Name = "enableRecurring", EmitDefaultValue = false)] - public bool? EnableRecurring { get; set; } + [JsonPropertyName("enableRecurring")] + public bool? EnableRecurring { get { return this.EnableRecurringOption; } set { this.EnableRecurringOption = new Option(value); } } + + /// + /// Used to track the state of ExpiresAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiresAtOption { get; private set; } /// /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. /// /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. - [DataMember(Name = "expiresAt", EmitDefaultValue = false)] - public DateTime ExpiresAt { get; set; } + [JsonPropertyName("expiresAt")] + public DateTime? ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } + + /// + /// Used to track the state of FundOrigin + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundOriginOption { get; private set; } /// /// Gets or Sets FundOrigin /// - [DataMember(Name = "fundOrigin", EmitDefaultValue = false)] - public FundOrigin FundOrigin { get; set; } + [JsonPropertyName("fundOrigin")] + public FundOrigin FundOrigin { get { return this.FundOriginOption; } set { this.FundOriginOption = new Option(value); } } + + /// + /// Used to track the state of FundRecipient + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundRecipientOption { get; private set; } /// /// Gets or Sets FundRecipient /// - [DataMember(Name = "fundRecipient", EmitDefaultValue = false)] - public FundRecipient FundRecipient { get; set; } + [JsonPropertyName("fundRecipient")] + public FundRecipient FundRecipient { get { return this.FundRecipientOption; } set { this.FundRecipientOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentOptions + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> InstallmentOptionsOption { get; private set; } /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. - [DataMember(Name = "installmentOptions", EmitDefaultValue = false)] - public Dictionary InstallmentOptions { get; set; } + [JsonPropertyName("installmentOptions")] + public Dictionary InstallmentOptions { get { return this.InstallmentOptionsOption; } set { this.InstallmentOptionsOption = new Option>(value); } } + + /// + /// Used to track the state of LineItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LineItemsOption { get; private set; } /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. - [DataMember(Name = "lineItems", EmitDefaultValue = false)] - public List LineItems { get; set; } + [JsonPropertyName("lineItems")] + public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } + + /// + /// Used to track the state of Mandate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MandateOption { get; private set; } /// /// Gets or Sets Mandate /// - [DataMember(Name = "mandate", EmitDefaultValue = false)] - public Mandate Mandate { get; set; } + [JsonPropertyName("mandate")] + public Mandate Mandate { get { return this.MandateOption; } set { this.MandateOption = new Option(value); } } + + /// + /// Used to track the state of Mcc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MccOption { get; private set; } /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - [DataMember(Name = "mcc", EmitDefaultValue = false)] - public string Mcc { get; set; } + [JsonPropertyName("mcc")] + public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } /// - /// The merchant account identifier, with which you want to process the transaction. + /// Used to track the state of MerchantOrderReference /// - /// The merchant account identifier, with which you want to process the transaction. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantOrderReferenceOption { get; private set; } /// /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. /// /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] - public string MerchantOrderReference { get; set; } + [JsonPropertyName("merchantOrderReference")] + public string MerchantOrderReference { get { return this.MerchantOrderReferenceOption; } set { this.MerchantOrderReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Metadata + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> MetadataOption { get; private set; } /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. - [DataMember(Name = "metadata", EmitDefaultValue = false)] - public Dictionary Metadata { get; set; } + [JsonPropertyName("metadata")] + public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } + + /// + /// Used to track the state of MpiData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MpiDataOption { get; private set; } /// /// Gets or Sets MpiData /// - [DataMember(Name = "mpiData", EmitDefaultValue = false)] - public ThreeDSecureData MpiData { get; set; } + [JsonPropertyName("mpiData")] + public ThreeDSecureData MpiData { get { return this.MpiDataOption; } set { this.MpiDataOption = new Option(value); } } + + /// + /// Used to track the state of PlatformChargebackLogic + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PlatformChargebackLogicOption { get; private set; } /// /// Gets or Sets PlatformChargebackLogic /// - [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] - public PlatformChargebackLogic PlatformChargebackLogic { get; set; } + [JsonPropertyName("platformChargebackLogic")] + public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } + + /// + /// Used to track the state of RecurringExpiry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringExpiryOption { get; private set; } /// /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. /// /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. - [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] - public string RecurringExpiry { get; set; } + [JsonPropertyName("recurringExpiry")] + public string RecurringExpiry { get { return this.RecurringExpiryOption; } set { this.RecurringExpiryOption = new Option(value); } } + + /// + /// Used to track the state of RecurringFrequency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringFrequencyOption { get; private set; } /// /// Minimum number of days between authorisations. Only for 3D Secure 2. /// /// Minimum number of days between authorisations. Only for 3D Secure 2. - [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] - public string RecurringFrequency { get; set; } + [JsonPropertyName("recurringFrequency")] + public string RecurringFrequency { get { return this.RecurringFrequencyOption; } set { this.RecurringFrequencyOption = new Option(value); } } + + /// + /// Used to track the state of RedirectFromIssuerMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RedirectFromIssuerMethodOption { get; private set; } /// /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. /// /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. - [DataMember(Name = "redirectFromIssuerMethod", EmitDefaultValue = false)] - public string RedirectFromIssuerMethod { get; set; } + [JsonPropertyName("redirectFromIssuerMethod")] + public string RedirectFromIssuerMethod { get { return this.RedirectFromIssuerMethodOption; } set { this.RedirectFromIssuerMethodOption = new Option(value); } } + + /// + /// Used to track the state of RedirectToIssuerMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RedirectToIssuerMethodOption { get; private set; } /// /// Specifies the redirect method (GET or POST) when redirecting to the issuer. /// /// Specifies the redirect method (GET or POST) when redirecting to the issuer. - [DataMember(Name = "redirectToIssuerMethod", EmitDefaultValue = false)] - public string RedirectToIssuerMethod { get; set; } + [JsonPropertyName("redirectToIssuerMethod")] + public string RedirectToIssuerMethod { get { return this.RedirectToIssuerMethodOption; } set { this.RedirectToIssuerMethodOption = new Option(value); } } /// - /// The reference to uniquely identify a payment. + /// Used to track the state of RiskData /// - /// The reference to uniquely identify a payment. - [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskDataOption { get; private set; } /// - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// Gets or Sets RiskData /// - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. - [DataMember(Name = "returnUrl", IsRequired = false, EmitDefaultValue = false)] - public string ReturnUrl { get; set; } + [JsonPropertyName("riskData")] + public RiskData RiskData { get { return this.RiskDataOption; } set { this.RiskDataOption = new Option(value); } } /// - /// Gets or Sets RiskData + /// Used to track the state of ShopperEmail /// - [DataMember(Name = "riskData", EmitDefaultValue = false)] - public RiskData RiskData { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The shopper's email address. /// /// The shopper's email address. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of ShopperIP + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperIPOption { get; private set; } /// /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). /// /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - [DataMember(Name = "shopperIP", EmitDefaultValue = false)] - public string ShopperIP { get; set; } + [JsonPropertyName("shopperIP")] + public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } + + /// + /// Used to track the state of ShopperLocale + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperLocaleOption { get; private set; } /// /// The combination of a language code and a country code to specify the language to be used in the payment. /// /// The combination of a language code and a country code to specify the language to be used in the payment. - [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] - public string ShopperLocale { get; set; } + [JsonPropertyName("shopperLocale")] + public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } + + /// + /// Used to track the state of ShopperName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNameOption { get; private set; } /// /// Gets or Sets ShopperName /// - [DataMember(Name = "shopperName", EmitDefaultValue = false)] - public Name ShopperName { get; set; } + [JsonPropertyName("shopperName")] + public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } + + /// + /// Used to track the state of ShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperReferenceOption { get; private set; } /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [DataMember(Name = "shopperReference", EmitDefaultValue = false)] - public string ShopperReference { get; set; } + [JsonPropertyName("shopperReference")] + public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperStatement + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperStatementOption { get; private set; } /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] - public string ShopperStatement { get; set; } + [JsonPropertyName("shopperStatement")] + public string ShopperStatement { get { return this.ShopperStatementOption; } set { this.ShopperStatementOption = new Option(value); } } + + /// + /// Used to track the state of ShowInstallmentAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShowInstallmentAmountOption { get; private set; } /// /// Set to true to show the payment amount per installment. /// /// Set to true to show the payment amount per installment. - [DataMember(Name = "showInstallmentAmount", EmitDefaultValue = false)] - public bool? ShowInstallmentAmount { get; set; } + [JsonPropertyName("showInstallmentAmount")] + public bool? ShowInstallmentAmount { get { return this.ShowInstallmentAmountOption; } set { this.ShowInstallmentAmountOption = new Option(value); } } + + /// + /// Used to track the state of ShowRemovePaymentMethodButton + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShowRemovePaymentMethodButtonOption { get; private set; } /// /// Set to **true** to show a button that lets the shopper remove a stored payment method. /// /// Set to **true** to show a button that lets the shopper remove a stored payment method. - [DataMember(Name = "showRemovePaymentMethodButton", EmitDefaultValue = false)] - public bool? ShowRemovePaymentMethodButton { get; set; } + [JsonPropertyName("showRemovePaymentMethodButton")] + public bool? ShowRemovePaymentMethodButton { get { return this.ShowRemovePaymentMethodButtonOption; } set { this.ShowRemovePaymentMethodButtonOption = new Option(value); } } + + /// + /// Used to track the state of SocialSecurityNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SocialSecurityNumberOption { get; private set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] - public string SocialSecurityNumber { get; set; } + [JsonPropertyName("socialSecurityNumber")] + public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } + + /// + /// Used to track the state of SplitCardFundingSources + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SplitCardFundingSourcesOption { get; private set; } /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. - [DataMember(Name = "splitCardFundingSources", EmitDefaultValue = false)] - public bool? SplitCardFundingSources { get; set; } + [JsonPropertyName("splitCardFundingSources")] + public bool? SplitCardFundingSources { get { return this.SplitCardFundingSourcesOption; } set { this.SplitCardFundingSourcesOption = new Option(value); } } + + /// + /// Used to track the state of Splits + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SplitsOption { get; private set; } /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - [DataMember(Name = "splits", EmitDefaultValue = false)] - public List Splits { get; set; } + [JsonPropertyName("splits")] + public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } + + /// + /// Used to track the state of Store + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoreOption { get; private set; } /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - [DataMember(Name = "store", EmitDefaultValue = false)] - public string Store { get; set; } + [JsonPropertyName("store")] + public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } + + /// + /// Used to track the state of StorePaymentMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StorePaymentMethodOption { get; private set; } /// /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). /// /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). - [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] - public bool? StorePaymentMethod { get; set; } + [JsonPropertyName("storePaymentMethod")] + public bool? StorePaymentMethod { get { return this.StorePaymentMethodOption; } set { this.StorePaymentMethodOption = new Option(value); } } + + /// + /// Used to track the state of TelephoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TelephoneNumberOption { get; private set; } /// /// The shopper's telephone number. /// /// The shopper's telephone number. - [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] - public string TelephoneNumber { get; set; } + [JsonPropertyName("telephoneNumber")] + public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of ThemeId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThemeIdOption { get; private set; } /// /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. /// /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. - [DataMember(Name = "themeId", EmitDefaultValue = false)] - public string ThemeId { get; set; } + [JsonPropertyName("themeId")] + public string ThemeId { get { return this.ThemeIdOption; } set { this.ThemeIdOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2RequestData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2RequestDataOption { get; private set; } /// /// Gets or Sets ThreeDS2RequestData /// - [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] - public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get; set; } + [JsonPropertyName("threeDS2RequestData")] + public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSAuthenticationOnly + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSAuthenticationOnlyOption { get; private set; } /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.authenticationOnly` instead.")] - public bool? ThreeDSAuthenticationOnly { get; set; } + [JsonPropertyName("threeDSAuthenticationOnly")] + [Obsolete] + public bool? ThreeDSAuthenticationOnly { get { return this.ThreeDSAuthenticationOnlyOption; } set { this.ThreeDSAuthenticationOnlyOption = new Option(value); } } + + /// + /// Used to track the state of TrustedShopper + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TrustedShopperOption { get; private set; } /// /// Set to true if the payment should be routed to a trusted MID. /// /// Set to true if the payment should be routed to a trusted MID. - [DataMember(Name = "trustedShopper", EmitDefaultValue = false)] - public bool? TrustedShopper { get; set; } + [JsonPropertyName("trustedShopper")] + public bool? TrustedShopper { get { return this.TrustedShopperOption; } set { this.TrustedShopperOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -749,11 +1466,14 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CreateCheckoutSessionRequest {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" AccountInfo: ").Append(AccountInfo).Append("\n"); sb.Append(" AdditionalAmount: ").Append(AdditionalAmount).Append("\n"); sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); - sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" AuthenticationData: ").Append(AuthenticationData).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); @@ -775,7 +1495,6 @@ public override string ToString() sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" Mandate: ").Append(Mandate).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append(" Mode: ").Append(Mode).Append("\n"); @@ -786,8 +1505,6 @@ public override string ToString() sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); sb.Append(" RedirectFromIssuerMethod: ").Append(RedirectFromIssuerMethod).Append("\n"); sb.Append(" RedirectToIssuerMethod: ").Append(RedirectToIssuerMethod).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" RiskData: ").Append(RiskData).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" ShopperIP: ").Append(ShopperIP).Append("\n"); @@ -815,569 +1532,949 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + // ReturnUrl (string) maxLength + if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) + { + yield return new ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); + } + + // ShopperReference (string) maxLength + if (this.ShopperReference != null && this.ShopperReference.Length > 256) + { + yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + } + + // ShopperReference (string) minLength + if (this.ShopperReference != null && this.ShopperReference.Length < 3) + { + yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + } + + yield break; } + } + /// + /// A Json converter for type + /// + public class CreateCheckoutSessionRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// The format to use to serialize DateOfBirth /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as CreateCheckoutSessionRequest); - } + public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd"; /// - /// Returns true if CreateCheckoutSessionRequest instances are equal + /// The format to use to serialize DeliverAt /// - /// Instance of CreateCheckoutSessionRequest to be compared - /// Boolean - public bool Equals(CreateCheckoutSessionRequest input) - { - if (input == null) - { - return false; - } - return - ( - this.AccountInfo == input.AccountInfo || - (this.AccountInfo != null && - this.AccountInfo.Equals(input.AccountInfo)) - ) && - ( - this.AdditionalAmount == input.AdditionalAmount || - (this.AdditionalAmount != null && - this.AdditionalAmount.Equals(input.AdditionalAmount)) - ) && - ( - this.AdditionalData == input.AdditionalData || - this.AdditionalData != null && - input.AdditionalData != null && - this.AdditionalData.SequenceEqual(input.AdditionalData) - ) && - ( - this.AllowedPaymentMethods == input.AllowedPaymentMethods || - this.AllowedPaymentMethods != null && - input.AllowedPaymentMethods != null && - this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) - ) && - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.AuthenticationData == input.AuthenticationData || - (this.AuthenticationData != null && - this.AuthenticationData.Equals(input.AuthenticationData)) - ) && - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.BlockedPaymentMethods == input.BlockedPaymentMethods || - this.BlockedPaymentMethods != null && - input.BlockedPaymentMethods != null && - this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) - ) && - ( - this.CaptureDelayHours == input.CaptureDelayHours || - this.CaptureDelayHours.Equals(input.CaptureDelayHours) - ) && - ( - this.Channel == input.Channel || - this.Channel.Equals(input.Channel) - ) && - ( - this.Company == input.Company || - (this.Company != null && - this.Company.Equals(input.Company)) - ) && - ( - this.CountryCode == input.CountryCode || - (this.CountryCode != null && - this.CountryCode.Equals(input.CountryCode)) - ) && - ( - this.DateOfBirth == input.DateOfBirth || - (this.DateOfBirth != null && - this.DateOfBirth.Equals(input.DateOfBirth)) - ) && - ( - this.DeliverAt == input.DeliverAt || - (this.DeliverAt != null && - this.DeliverAt.Equals(input.DeliverAt)) - ) && - ( - this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) - ) && - ( - this.EnableOneClick == input.EnableOneClick || - this.EnableOneClick.Equals(input.EnableOneClick) - ) && - ( - this.EnablePayOut == input.EnablePayOut || - this.EnablePayOut.Equals(input.EnablePayOut) - ) && - ( - this.EnableRecurring == input.EnableRecurring || - this.EnableRecurring.Equals(input.EnableRecurring) - ) && - ( - this.ExpiresAt == input.ExpiresAt || - (this.ExpiresAt != null && - this.ExpiresAt.Equals(input.ExpiresAt)) - ) && - ( - this.FundOrigin == input.FundOrigin || - (this.FundOrigin != null && - this.FundOrigin.Equals(input.FundOrigin)) - ) && - ( - this.FundRecipient == input.FundRecipient || - (this.FundRecipient != null && - this.FundRecipient.Equals(input.FundRecipient)) - ) && - ( - this.InstallmentOptions == input.InstallmentOptions || - this.InstallmentOptions != null && - input.InstallmentOptions != null && - this.InstallmentOptions.SequenceEqual(input.InstallmentOptions) - ) && - ( - this.LineItems == input.LineItems || - this.LineItems != null && - input.LineItems != null && - this.LineItems.SequenceEqual(input.LineItems) - ) && - ( - this.Mandate == input.Mandate || - (this.Mandate != null && - this.Mandate.Equals(input.Mandate)) - ) && - ( - this.Mcc == input.Mcc || - (this.Mcc != null && - this.Mcc.Equals(input.Mcc)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.MerchantOrderReference == input.MerchantOrderReference || - (this.MerchantOrderReference != null && - this.MerchantOrderReference.Equals(input.MerchantOrderReference)) - ) && - ( - this.Metadata == input.Metadata || - this.Metadata != null && - input.Metadata != null && - this.Metadata.SequenceEqual(input.Metadata) - ) && - ( - this.Mode == input.Mode || - this.Mode.Equals(input.Mode) - ) && - ( - this.MpiData == input.MpiData || - (this.MpiData != null && - this.MpiData.Equals(input.MpiData)) - ) && - ( - this.PlatformChargebackLogic == input.PlatformChargebackLogic || - (this.PlatformChargebackLogic != null && - this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) - ) && - ( - this.RecurringExpiry == input.RecurringExpiry || - (this.RecurringExpiry != null && - this.RecurringExpiry.Equals(input.RecurringExpiry)) - ) && - ( - this.RecurringFrequency == input.RecurringFrequency || - (this.RecurringFrequency != null && - this.RecurringFrequency.Equals(input.RecurringFrequency)) - ) && - ( - this.RecurringProcessingModel == input.RecurringProcessingModel || - this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) - ) && - ( - this.RedirectFromIssuerMethod == input.RedirectFromIssuerMethod || - (this.RedirectFromIssuerMethod != null && - this.RedirectFromIssuerMethod.Equals(input.RedirectFromIssuerMethod)) - ) && - ( - this.RedirectToIssuerMethod == input.RedirectToIssuerMethod || - (this.RedirectToIssuerMethod != null && - this.RedirectToIssuerMethod.Equals(input.RedirectToIssuerMethod)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.ReturnUrl == input.ReturnUrl || - (this.ReturnUrl != null && - this.ReturnUrl.Equals(input.ReturnUrl)) - ) && - ( - this.RiskData == input.RiskData || - (this.RiskData != null && - this.RiskData.Equals(input.RiskData)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.ShopperIP == input.ShopperIP || - (this.ShopperIP != null && - this.ShopperIP.Equals(input.ShopperIP)) - ) && - ( - this.ShopperInteraction == input.ShopperInteraction || - this.ShopperInteraction.Equals(input.ShopperInteraction) - ) && - ( - this.ShopperLocale == input.ShopperLocale || - (this.ShopperLocale != null && - this.ShopperLocale.Equals(input.ShopperLocale)) - ) && - ( - this.ShopperName == input.ShopperName || - (this.ShopperName != null && - this.ShopperName.Equals(input.ShopperName)) - ) && - ( - this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) - ) && - ( - this.ShopperStatement == input.ShopperStatement || - (this.ShopperStatement != null && - this.ShopperStatement.Equals(input.ShopperStatement)) - ) && - ( - this.ShowInstallmentAmount == input.ShowInstallmentAmount || - this.ShowInstallmentAmount.Equals(input.ShowInstallmentAmount) - ) && - ( - this.ShowRemovePaymentMethodButton == input.ShowRemovePaymentMethodButton || - this.ShowRemovePaymentMethodButton.Equals(input.ShowRemovePaymentMethodButton) - ) && - ( - this.SocialSecurityNumber == input.SocialSecurityNumber || - (this.SocialSecurityNumber != null && - this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) - ) && - ( - this.SplitCardFundingSources == input.SplitCardFundingSources || - this.SplitCardFundingSources.Equals(input.SplitCardFundingSources) - ) && - ( - this.Splits == input.Splits || - this.Splits != null && - input.Splits != null && - this.Splits.SequenceEqual(input.Splits) - ) && - ( - this.Store == input.Store || - (this.Store != null && - this.Store.Equals(input.Store)) - ) && - ( - this.StoreFiltrationMode == input.StoreFiltrationMode || - this.StoreFiltrationMode.Equals(input.StoreFiltrationMode) - ) && - ( - this.StorePaymentMethod == input.StorePaymentMethod || - this.StorePaymentMethod.Equals(input.StorePaymentMethod) - ) && - ( - this.StorePaymentMethodMode == input.StorePaymentMethodMode || - this.StorePaymentMethodMode.Equals(input.StorePaymentMethodMode) - ) && - ( - this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) - ) && - ( - this.ThemeId == input.ThemeId || - (this.ThemeId != null && - this.ThemeId.Equals(input.ThemeId)) - ) && - ( - this.ThreeDS2RequestData == input.ThreeDS2RequestData || - (this.ThreeDS2RequestData != null && - this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) - ) && - ( - this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || - this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) - ) && - ( - this.TrustedShopper == input.TrustedShopper || - this.TrustedShopper.Equals(input.TrustedShopper) - ); - } + public static string DeliverAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// Gets the hash code + /// The format to use to serialize ExpiresAt /// - /// Hash code - public override int GetHashCode() + public static string ExpiresAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override CreateCheckoutSessionRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option merchantAccount = default; + Option reference = default; + Option returnUrl = default; + Option accountInfo = default; + Option additionalAmount = default; + Option> additionalData = default; + Option> allowedPaymentMethods = default; + Option applicationInfo = default; + Option authenticationData = default; + Option billingAddress = default; + Option> blockedPaymentMethods = default; + Option captureDelayHours = default; + Option channel = default; + Option company = default; + Option countryCode = default; + Option dateOfBirth = default; + Option deliverAt = default; + Option deliveryAddress = default; + Option enableOneClick = default; + Option enablePayOut = default; + Option enableRecurring = default; + Option expiresAt = default; + Option fundOrigin = default; + Option fundRecipient = default; + Option> installmentOptions = default; + Option> lineItems = default; + Option mandate = default; + Option mcc = default; + Option merchantOrderReference = default; + Option> metadata = default; + Option mode = default; + Option mpiData = default; + Option platformChargebackLogic = default; + Option recurringExpiry = default; + Option recurringFrequency = default; + Option recurringProcessingModel = default; + Option redirectFromIssuerMethod = default; + Option redirectToIssuerMethod = default; + Option riskData = default; + Option shopperEmail = default; + Option shopperIP = default; + Option shopperInteraction = default; + Option shopperLocale = default; + Option shopperName = default; + Option shopperReference = default; + Option shopperStatement = default; + Option showInstallmentAmount = default; + Option showRemovePaymentMethodButton = default; + Option socialSecurityNumber = default; + Option splitCardFundingSources = default; + Option> splits = default; + Option store = default; + Option storeFiltrationMode = default; + Option storePaymentMethod = default; + Option storePaymentMethodMode = default; + Option telephoneNumber = default; + Option themeId = default; + Option threeDS2RequestData = default; + Option threeDSAuthenticationOnly = default; + Option trustedShopper = default; + + while (utf8JsonReader.Read()) { - int hashCode = 41; - if (this.AccountInfo != null) - { - hashCode = (hashCode * 59) + this.AccountInfo.GetHashCode(); - } - if (this.AdditionalAmount != null) - { - hashCode = (hashCode * 59) + this.AdditionalAmount.GetHashCode(); - } - if (this.AdditionalData != null) - { - hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); - } - if (this.AllowedPaymentMethods != null) - { - hashCode = (hashCode * 59) + this.AllowedPaymentMethods.GetHashCode(); - } - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.ApplicationInfo != null) - { - hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); - } - if (this.AuthenticationData != null) - { - hashCode = (hashCode * 59) + this.AuthenticationData.GetHashCode(); - } - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.BlockedPaymentMethods != null) - { - hashCode = (hashCode * 59) + this.BlockedPaymentMethods.GetHashCode(); - } - hashCode = (hashCode * 59) + this.CaptureDelayHours.GetHashCode(); - hashCode = (hashCode * 59) + this.Channel.GetHashCode(); - if (this.Company != null) - { - hashCode = (hashCode * 59) + this.Company.GetHashCode(); - } - if (this.CountryCode != null) - { - hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); - } - if (this.DateOfBirth != null) - { - hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); - } - if (this.DeliverAt != null) - { - hashCode = (hashCode * 59) + this.DeliverAt.GetHashCode(); - } - if (this.DeliveryAddress != null) - { - hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); - } - hashCode = (hashCode * 59) + this.EnableOneClick.GetHashCode(); - hashCode = (hashCode * 59) + this.EnablePayOut.GetHashCode(); - hashCode = (hashCode * 59) + this.EnableRecurring.GetHashCode(); - if (this.ExpiresAt != null) - { - hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); - } - if (this.FundOrigin != null) - { - hashCode = (hashCode * 59) + this.FundOrigin.GetHashCode(); - } - if (this.FundRecipient != null) - { - hashCode = (hashCode * 59) + this.FundRecipient.GetHashCode(); - } - if (this.InstallmentOptions != null) - { - hashCode = (hashCode * 59) + this.InstallmentOptions.GetHashCode(); - } - if (this.LineItems != null) - { - hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); - } - if (this.Mandate != null) - { - hashCode = (hashCode * 59) + this.Mandate.GetHashCode(); - } - if (this.Mcc != null) - { - hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.MerchantOrderReference != null) - { - hashCode = (hashCode * 59) + this.MerchantOrderReference.GetHashCode(); - } - if (this.Metadata != null) - { - hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Mode.GetHashCode(); - if (this.MpiData != null) - { - hashCode = (hashCode * 59) + this.MpiData.GetHashCode(); - } - if (this.PlatformChargebackLogic != null) - { - hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); - } - if (this.RecurringExpiry != null) - { - hashCode = (hashCode * 59) + this.RecurringExpiry.GetHashCode(); - } - if (this.RecurringFrequency != null) - { - hashCode = (hashCode * 59) + this.RecurringFrequency.GetHashCode(); - } - hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); - if (this.RedirectFromIssuerMethod != null) - { - hashCode = (hashCode * 59) + this.RedirectFromIssuerMethod.GetHashCode(); - } - if (this.RedirectToIssuerMethod != null) - { - hashCode = (hashCode * 59) + this.RedirectToIssuerMethod.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.ReturnUrl != null) - { - hashCode = (hashCode * 59) + this.ReturnUrl.GetHashCode(); - } - if (this.RiskData != null) - { - hashCode = (hashCode * 59) + this.RiskData.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.ShopperIP != null) - { - hashCode = (hashCode * 59) + this.ShopperIP.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ShopperInteraction.GetHashCode(); - if (this.ShopperLocale != null) - { - hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); - } - if (this.ShopperName != null) - { - hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); - } - if (this.ShopperReference != null) - { - hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); - } - if (this.ShopperStatement != null) - { - hashCode = (hashCode * 59) + this.ShopperStatement.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ShowInstallmentAmount.GetHashCode(); - hashCode = (hashCode * 59) + this.ShowRemovePaymentMethodButton.GetHashCode(); - if (this.SocialSecurityNumber != null) - { - hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); - } - hashCode = (hashCode * 59) + this.SplitCardFundingSources.GetHashCode(); - if (this.Splits != null) - { - hashCode = (hashCode * 59) + this.Splits.GetHashCode(); - } - if (this.Store != null) - { - hashCode = (hashCode * 59) + this.Store.GetHashCode(); - } - hashCode = (hashCode * 59) + this.StoreFiltrationMode.GetHashCode(); - hashCode = (hashCode * 59) + this.StorePaymentMethod.GetHashCode(); - hashCode = (hashCode * 59) + this.StorePaymentMethodMode.GetHashCode(); - if (this.TelephoneNumber != null) - { - hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); - } - if (this.ThemeId != null) - { - hashCode = (hashCode * 59) + this.ThemeId.GetHashCode(); - } - if (this.ThreeDS2RequestData != null) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "returnUrl": + returnUrl = new Option(utf8JsonReader.GetString()); + break; + case "accountInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + accountInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "additionalAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "additionalData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "allowedPaymentMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + allowedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "applicationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "authenticationData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + authenticationData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "billingAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + billingAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "blockedPaymentMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + blockedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "captureDelayHours": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + captureDelayHours = new Option(utf8JsonReader.GetInt32()); + break; + case "channel": + string channelRawValue = utf8JsonReader.GetString(); + if (channelRawValue != null) + channel = new Option(CreateCheckoutSessionRequest.ChannelEnumFromStringOrDefault(channelRawValue)); + break; + case "company": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + company = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "countryCode": + countryCode = new Option(utf8JsonReader.GetString()); + break; + case "dateOfBirth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliverAt": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliverAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliveryAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliveryAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "enableOneClick": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enableOneClick = new Option(utf8JsonReader.GetBoolean()); + break; + case "enablePayOut": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enablePayOut = new Option(utf8JsonReader.GetBoolean()); + break; + case "enableRecurring": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enableRecurring = new Option(utf8JsonReader.GetBoolean()); + break; + case "expiresAt": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + expiresAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fundOrigin": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fundOrigin = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fundRecipient": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fundRecipient = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "installmentOptions": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + installmentOptions = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "lineItems": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mandate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mandate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mcc": + mcc = new Option(utf8JsonReader.GetString()); + break; + case "merchantOrderReference": + merchantOrderReference = new Option(utf8JsonReader.GetString()); + break; + case "metadata": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mode": + string modeRawValue = utf8JsonReader.GetString(); + if (modeRawValue != null) + mode = new Option(CreateCheckoutSessionRequest.ModeEnumFromStringOrDefault(modeRawValue)); + break; + case "mpiData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mpiData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "platformChargebackLogic": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "recurringExpiry": + recurringExpiry = new Option(utf8JsonReader.GetString()); + break; + case "recurringFrequency": + recurringFrequency = new Option(utf8JsonReader.GetString()); + break; + case "recurringProcessingModel": + string recurringProcessingModelRawValue = utf8JsonReader.GetString(); + if (recurringProcessingModelRawValue != null) + recurringProcessingModel = new Option(CreateCheckoutSessionRequest.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); + break; + case "redirectFromIssuerMethod": + redirectFromIssuerMethod = new Option(utf8JsonReader.GetString()); + break; + case "redirectToIssuerMethod": + redirectToIssuerMethod = new Option(utf8JsonReader.GetString()); + break; + case "riskData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + riskData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "shopperIP": + shopperIP = new Option(utf8JsonReader.GetString()); + break; + case "shopperInteraction": + string shopperInteractionRawValue = utf8JsonReader.GetString(); + if (shopperInteractionRawValue != null) + shopperInteraction = new Option(CreateCheckoutSessionRequest.ShopperInteractionEnumFromStringOrDefault(shopperInteractionRawValue)); + break; + case "shopperLocale": + shopperLocale = new Option(utf8JsonReader.GetString()); + break; + case "shopperName": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperReference": + shopperReference = new Option(utf8JsonReader.GetString()); + break; + case "shopperStatement": + shopperStatement = new Option(utf8JsonReader.GetString()); + break; + case "showInstallmentAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + showInstallmentAmount = new Option(utf8JsonReader.GetBoolean()); + break; + case "showRemovePaymentMethodButton": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + showRemovePaymentMethodButton = new Option(utf8JsonReader.GetBoolean()); + break; + case "socialSecurityNumber": + socialSecurityNumber = new Option(utf8JsonReader.GetString()); + break; + case "splitCardFundingSources": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splitCardFundingSources = new Option(utf8JsonReader.GetBoolean()); + break; + case "splits": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "store": + store = new Option(utf8JsonReader.GetString()); + break; + case "storeFiltrationMode": + string storeFiltrationModeRawValue = utf8JsonReader.GetString(); + if (storeFiltrationModeRawValue != null) + storeFiltrationMode = new Option(CreateCheckoutSessionRequest.StoreFiltrationModeEnumFromStringOrDefault(storeFiltrationModeRawValue)); + break; + case "storePaymentMethod": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + storePaymentMethod = new Option(utf8JsonReader.GetBoolean()); + break; + case "storePaymentMethodMode": + string storePaymentMethodModeRawValue = utf8JsonReader.GetString(); + if (storePaymentMethodModeRawValue != null) + storePaymentMethodMode = new Option(CreateCheckoutSessionRequest.StorePaymentMethodModeEnumFromStringOrDefault(storePaymentMethodModeRawValue)); + break; + case "telephoneNumber": + telephoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "themeId": + themeId = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2RequestData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDSAuthenticationOnly": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDSAuthenticationOnly = new Option(utf8JsonReader.GetBoolean()); + break; + case "trustedShopper": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + trustedShopper = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } } - hashCode = (hashCode * 59) + this.ThreeDSAuthenticationOnly.GetHashCode(); - hashCode = (hashCode * 59) + this.TrustedShopper.GetHashCode(); - return hashCode; } + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class CreateCheckoutSessionRequest.", nameof(amount)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class CreateCheckoutSessionRequest.", nameof(merchantAccount)); + + if (!reference.IsSet) + throw new ArgumentException("Property is required for class CreateCheckoutSessionRequest.", nameof(reference)); + + if (!returnUrl.IsSet) + throw new ArgumentException("Property is required for class CreateCheckoutSessionRequest.", nameof(returnUrl)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (returnUrl.IsSet && returnUrl.Value == null) + throw new ArgumentNullException(nameof(returnUrl), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (accountInfo.IsSet && accountInfo.Value == null) + throw new ArgumentNullException(nameof(accountInfo), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (additionalAmount.IsSet && additionalAmount.Value == null) + throw new ArgumentNullException(nameof(additionalAmount), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (additionalData.IsSet && additionalData.Value == null) + throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (allowedPaymentMethods.IsSet && allowedPaymentMethods.Value == null) + throw new ArgumentNullException(nameof(allowedPaymentMethods), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (applicationInfo.IsSet && applicationInfo.Value == null) + throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (authenticationData.IsSet && authenticationData.Value == null) + throw new ArgumentNullException(nameof(authenticationData), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (blockedPaymentMethods.IsSet && blockedPaymentMethods.Value == null) + throw new ArgumentNullException(nameof(blockedPaymentMethods), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (captureDelayHours.IsSet && captureDelayHours.Value == null) + throw new ArgumentNullException(nameof(captureDelayHours), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (channel.IsSet && channel.Value == null) + throw new ArgumentNullException(nameof(channel), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (company.IsSet && company.Value == null) + throw new ArgumentNullException(nameof(company), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (countryCode.IsSet && countryCode.Value == null) + throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (dateOfBirth.IsSet && dateOfBirth.Value == null) + throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (deliverAt.IsSet && deliverAt.Value == null) + throw new ArgumentNullException(nameof(deliverAt), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (deliveryAddress.IsSet && deliveryAddress.Value == null) + throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (enableOneClick.IsSet && enableOneClick.Value == null) + throw new ArgumentNullException(nameof(enableOneClick), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (enablePayOut.IsSet && enablePayOut.Value == null) + throw new ArgumentNullException(nameof(enablePayOut), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (enableRecurring.IsSet && enableRecurring.Value == null) + throw new ArgumentNullException(nameof(enableRecurring), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (expiresAt.IsSet && expiresAt.Value == null) + throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (fundOrigin.IsSet && fundOrigin.Value == null) + throw new ArgumentNullException(nameof(fundOrigin), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (fundRecipient.IsSet && fundRecipient.Value == null) + throw new ArgumentNullException(nameof(fundRecipient), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (installmentOptions.IsSet && installmentOptions.Value == null) + throw new ArgumentNullException(nameof(installmentOptions), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (lineItems.IsSet && lineItems.Value == null) + throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (mandate.IsSet && mandate.Value == null) + throw new ArgumentNullException(nameof(mandate), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (mcc.IsSet && mcc.Value == null) + throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (merchantOrderReference.IsSet && merchantOrderReference.Value == null) + throw new ArgumentNullException(nameof(merchantOrderReference), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (metadata.IsSet && metadata.Value == null) + throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (mode.IsSet && mode.Value == null) + throw new ArgumentNullException(nameof(mode), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (mpiData.IsSet && mpiData.Value == null) + throw new ArgumentNullException(nameof(mpiData), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) + throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (recurringExpiry.IsSet && recurringExpiry.Value == null) + throw new ArgumentNullException(nameof(recurringExpiry), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (recurringFrequency.IsSet && recurringFrequency.Value == null) + throw new ArgumentNullException(nameof(recurringFrequency), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) + throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (redirectFromIssuerMethod.IsSet && redirectFromIssuerMethod.Value == null) + throw new ArgumentNullException(nameof(redirectFromIssuerMethod), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (redirectToIssuerMethod.IsSet && redirectToIssuerMethod.Value == null) + throw new ArgumentNullException(nameof(redirectToIssuerMethod), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (riskData.IsSet && riskData.Value == null) + throw new ArgumentNullException(nameof(riskData), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (shopperIP.IsSet && shopperIP.Value == null) + throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (shopperInteraction.IsSet && shopperInteraction.Value == null) + throw new ArgumentNullException(nameof(shopperInteraction), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (shopperLocale.IsSet && shopperLocale.Value == null) + throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (shopperName.IsSet && shopperName.Value == null) + throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (shopperStatement.IsSet && shopperStatement.Value == null) + throw new ArgumentNullException(nameof(shopperStatement), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (showInstallmentAmount.IsSet && showInstallmentAmount.Value == null) + throw new ArgumentNullException(nameof(showInstallmentAmount), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (showRemovePaymentMethodButton.IsSet && showRemovePaymentMethodButton.Value == null) + throw new ArgumentNullException(nameof(showRemovePaymentMethodButton), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) + throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (splitCardFundingSources.IsSet && splitCardFundingSources.Value == null) + throw new ArgumentNullException(nameof(splitCardFundingSources), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (splits.IsSet && splits.Value == null) + throw new ArgumentNullException(nameof(splits), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (store.IsSet && store.Value == null) + throw new ArgumentNullException(nameof(store), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (storeFiltrationMode.IsSet && storeFiltrationMode.Value == null) + throw new ArgumentNullException(nameof(storeFiltrationMode), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (storePaymentMethod.IsSet && storePaymentMethod.Value == null) + throw new ArgumentNullException(nameof(storePaymentMethod), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (storePaymentMethodMode.IsSet && storePaymentMethodMode.Value == null) + throw new ArgumentNullException(nameof(storePaymentMethodMode), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (telephoneNumber.IsSet && telephoneNumber.Value == null) + throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (themeId.IsSet && themeId.Value == null) + throw new ArgumentNullException(nameof(themeId), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) + throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (threeDSAuthenticationOnly.IsSet && threeDSAuthenticationOnly.Value == null) + throw new ArgumentNullException(nameof(threeDSAuthenticationOnly), "Property is not nullable for class CreateCheckoutSessionRequest."); + + if (trustedShopper.IsSet && trustedShopper.Value == null) + throw new ArgumentNullException(nameof(trustedShopper), "Property is not nullable for class CreateCheckoutSessionRequest."); + + return new CreateCheckoutSessionRequest(amount.Value, merchantAccount.Value, reference.Value, returnUrl.Value, accountInfo, additionalAmount, additionalData, allowedPaymentMethods, applicationInfo, authenticationData, billingAddress, blockedPaymentMethods, captureDelayHours, channel, company, countryCode, dateOfBirth, deliverAt, deliveryAddress, enableOneClick, enablePayOut, enableRecurring, expiresAt, fundOrigin, fundRecipient, installmentOptions, lineItems, mandate, mcc, merchantOrderReference, metadata, mode, mpiData, platformChargebackLogic, recurringExpiry, recurringFrequency, recurringProcessingModel, redirectFromIssuerMethod, redirectToIssuerMethod, riskData, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, showInstallmentAmount, showRemovePaymentMethodButton, socialSecurityNumber, splitCardFundingSources, splits, store, storeFiltrationMode, storePaymentMethod, storePaymentMethodMode, telephoneNumber, themeId, threeDS2RequestData, threeDSAuthenticationOnly, trustedShopper); } + /// - /// To validate all properties of the instance + /// Serializes a /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CreateCheckoutSessionRequest createCheckoutSessionRequest, JsonSerializerOptions jsonSerializerOptions) { - // ReturnUrl (string) maxLength - if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) + writer.WriteStartObject(); + + WriteProperties(writer, createCheckoutSessionRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CreateCheckoutSessionRequest createCheckoutSessionRequest, JsonSerializerOptions jsonSerializerOptions) + { + if (createCheckoutSessionRequest.Amount == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Amount), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.MerchantAccount), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.Reference == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Reference), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.ReturnUrl == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ReturnUrl), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.AccountInfoOption.IsSet && createCheckoutSessionRequest.AccountInfo == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.AccountInfo), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.AdditionalAmountOption.IsSet && createCheckoutSessionRequest.AdditionalAmount == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.AdditionalAmount), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.AdditionalDataOption.IsSet && createCheckoutSessionRequest.AdditionalData == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.AdditionalData), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.AllowedPaymentMethodsOption.IsSet && createCheckoutSessionRequest.AllowedPaymentMethods == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.AllowedPaymentMethods), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.ApplicationInfoOption.IsSet && createCheckoutSessionRequest.ApplicationInfo == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ApplicationInfo), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.AuthenticationDataOption.IsSet && createCheckoutSessionRequest.AuthenticationData == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.AuthenticationData), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.BillingAddressOption.IsSet && createCheckoutSessionRequest.BillingAddress == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.BillingAddress), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.BlockedPaymentMethodsOption.IsSet && createCheckoutSessionRequest.BlockedPaymentMethods == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.BlockedPaymentMethods), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.CompanyOption.IsSet && createCheckoutSessionRequest.Company == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Company), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.CountryCodeOption.IsSet && createCheckoutSessionRequest.CountryCode == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.CountryCode), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.DeliveryAddressOption.IsSet && createCheckoutSessionRequest.DeliveryAddress == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.DeliveryAddress), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.FundOriginOption.IsSet && createCheckoutSessionRequest.FundOrigin == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.FundOrigin), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.FundRecipientOption.IsSet && createCheckoutSessionRequest.FundRecipient == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.FundRecipient), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.InstallmentOptionsOption.IsSet && createCheckoutSessionRequest.InstallmentOptions == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.InstallmentOptions), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.LineItemsOption.IsSet && createCheckoutSessionRequest.LineItems == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.LineItems), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.MandateOption.IsSet && createCheckoutSessionRequest.Mandate == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Mandate), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.MccOption.IsSet && createCheckoutSessionRequest.Mcc == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Mcc), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.MerchantOrderReferenceOption.IsSet && createCheckoutSessionRequest.MerchantOrderReference == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.MerchantOrderReference), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.MetadataOption.IsSet && createCheckoutSessionRequest.Metadata == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Metadata), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.MpiDataOption.IsSet && createCheckoutSessionRequest.MpiData == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.MpiData), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.PlatformChargebackLogicOption.IsSet && createCheckoutSessionRequest.PlatformChargebackLogic == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.PlatformChargebackLogic), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.RecurringExpiryOption.IsSet && createCheckoutSessionRequest.RecurringExpiry == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.RecurringExpiry), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.RecurringFrequencyOption.IsSet && createCheckoutSessionRequest.RecurringFrequency == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.RecurringFrequency), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.RedirectFromIssuerMethodOption.IsSet && createCheckoutSessionRequest.RedirectFromIssuerMethod == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.RedirectFromIssuerMethod), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.RedirectToIssuerMethodOption.IsSet && createCheckoutSessionRequest.RedirectToIssuerMethod == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.RedirectToIssuerMethod), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.RiskDataOption.IsSet && createCheckoutSessionRequest.RiskData == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.RiskData), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.ShopperEmailOption.IsSet && createCheckoutSessionRequest.ShopperEmail == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ShopperEmail), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.ShopperIPOption.IsSet && createCheckoutSessionRequest.ShopperIP == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ShopperIP), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.ShopperLocaleOption.IsSet && createCheckoutSessionRequest.ShopperLocale == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ShopperLocale), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.ShopperNameOption.IsSet && createCheckoutSessionRequest.ShopperName == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ShopperName), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.ShopperReferenceOption.IsSet && createCheckoutSessionRequest.ShopperReference == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ShopperReference), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.ShopperStatementOption.IsSet && createCheckoutSessionRequest.ShopperStatement == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ShopperStatement), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.SocialSecurityNumberOption.IsSet && createCheckoutSessionRequest.SocialSecurityNumber == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.SocialSecurityNumber), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.SplitsOption.IsSet && createCheckoutSessionRequest.Splits == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Splits), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.StoreOption.IsSet && createCheckoutSessionRequest.Store == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Store), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.TelephoneNumberOption.IsSet && createCheckoutSessionRequest.TelephoneNumber == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.TelephoneNumber), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.ThemeIdOption.IsSet && createCheckoutSessionRequest.ThemeId == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ThemeId), "Property is required for class CreateCheckoutSessionRequest."); + + if (createCheckoutSessionRequest.ThreeDS2RequestDataOption.IsSet && createCheckoutSessionRequest.ThreeDS2RequestData == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ThreeDS2RequestData), "Property is required for class CreateCheckoutSessionRequest."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.Amount, jsonSerializerOptions); + writer.WriteString("merchantAccount", createCheckoutSessionRequest.MerchantAccount); + + writer.WriteString("reference", createCheckoutSessionRequest.Reference); + + writer.WriteString("returnUrl", createCheckoutSessionRequest.ReturnUrl); + + if (createCheckoutSessionRequest.AccountInfoOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); + writer.WritePropertyName("accountInfo"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.AccountInfo, jsonSerializerOptions); } + if (createCheckoutSessionRequest.AdditionalAmountOption.IsSet) + { + writer.WritePropertyName("additionalAmount"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.AdditionalAmount, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.AdditionalDataOption.IsSet) + { + writer.WritePropertyName("additionalData"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.AdditionalData, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.AllowedPaymentMethodsOption.IsSet) + { + writer.WritePropertyName("allowedPaymentMethods"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.AllowedPaymentMethods, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.ApplicationInfoOption.IsSet) + { + writer.WritePropertyName("applicationInfo"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.ApplicationInfo, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.AuthenticationDataOption.IsSet) + { + writer.WritePropertyName("authenticationData"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.AuthenticationData, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.BillingAddressOption.IsSet) + { + writer.WritePropertyName("billingAddress"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.BillingAddress, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.BlockedPaymentMethodsOption.IsSet) + { + writer.WritePropertyName("blockedPaymentMethods"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.BlockedPaymentMethods, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.CaptureDelayHoursOption.IsSet) + writer.WriteNumber("captureDelayHours", createCheckoutSessionRequest.CaptureDelayHoursOption.Value.Value); - // ShopperReference (string) maxLength - if (this.ShopperReference != null && this.ShopperReference.Length > 256) + var channelRawValue = CreateCheckoutSessionRequest.ChannelEnumToJsonValue(createCheckoutSessionRequest.ChannelOption.Value.Value); + writer.WriteString("channel", channelRawValue); + if (createCheckoutSessionRequest.CompanyOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + writer.WritePropertyName("company"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.Company, jsonSerializerOptions); } + if (createCheckoutSessionRequest.CountryCodeOption.IsSet) + writer.WriteString("countryCode", createCheckoutSessionRequest.CountryCode); - // ShopperReference (string) minLength - if (this.ShopperReference != null && this.ShopperReference.Length < 3) + if (createCheckoutSessionRequest.DateOfBirthOption.IsSet) + writer.WriteString("dateOfBirth", createCheckoutSessionRequest.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); + + if (createCheckoutSessionRequest.DeliverAtOption.IsSet) + writer.WriteString("deliverAt", createCheckoutSessionRequest.DeliverAtOption.Value.Value.ToString(DeliverAtFormat)); + + if (createCheckoutSessionRequest.DeliveryAddressOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + writer.WritePropertyName("deliveryAddress"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.DeliveryAddress, jsonSerializerOptions); } + if (createCheckoutSessionRequest.EnableOneClickOption.IsSet) + writer.WriteBoolean("enableOneClick", createCheckoutSessionRequest.EnableOneClickOption.Value.Value); - yield break; + if (createCheckoutSessionRequest.EnablePayOutOption.IsSet) + writer.WriteBoolean("enablePayOut", createCheckoutSessionRequest.EnablePayOutOption.Value.Value); + + if (createCheckoutSessionRequest.EnableRecurringOption.IsSet) + writer.WriteBoolean("enableRecurring", createCheckoutSessionRequest.EnableRecurringOption.Value.Value); + + if (createCheckoutSessionRequest.ExpiresAtOption.IsSet) + writer.WriteString("expiresAt", createCheckoutSessionRequest.ExpiresAtOption.Value.Value.ToString(ExpiresAtFormat)); + + if (createCheckoutSessionRequest.FundOriginOption.IsSet) + { + writer.WritePropertyName("fundOrigin"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.FundOrigin, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.FundRecipientOption.IsSet) + { + writer.WritePropertyName("fundRecipient"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.FundRecipient, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.InstallmentOptionsOption.IsSet) + { + writer.WritePropertyName("installmentOptions"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.InstallmentOptions, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.LineItemsOption.IsSet) + { + writer.WritePropertyName("lineItems"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.LineItems, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.MandateOption.IsSet) + { + writer.WritePropertyName("mandate"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.Mandate, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.MccOption.IsSet) + writer.WriteString("mcc", createCheckoutSessionRequest.Mcc); + + if (createCheckoutSessionRequest.MerchantOrderReferenceOption.IsSet) + writer.WriteString("merchantOrderReference", createCheckoutSessionRequest.MerchantOrderReference); + + if (createCheckoutSessionRequest.MetadataOption.IsSet) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.Metadata, jsonSerializerOptions); + } + var modeRawValue = CreateCheckoutSessionRequest.ModeEnumToJsonValue(createCheckoutSessionRequest.ModeOption.Value.Value); + writer.WriteString("mode", modeRawValue); + if (createCheckoutSessionRequest.MpiDataOption.IsSet) + { + writer.WritePropertyName("mpiData"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.MpiData, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.PlatformChargebackLogicOption.IsSet) + { + writer.WritePropertyName("platformChargebackLogic"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.PlatformChargebackLogic, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.RecurringExpiryOption.IsSet) + writer.WriteString("recurringExpiry", createCheckoutSessionRequest.RecurringExpiry); + + if (createCheckoutSessionRequest.RecurringFrequencyOption.IsSet) + writer.WriteString("recurringFrequency", createCheckoutSessionRequest.RecurringFrequency); + + var recurringProcessingModelRawValue = CreateCheckoutSessionRequest.RecurringProcessingModelEnumToJsonValue(createCheckoutSessionRequest.RecurringProcessingModelOption.Value.Value); + writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); + if (createCheckoutSessionRequest.RedirectFromIssuerMethodOption.IsSet) + writer.WriteString("redirectFromIssuerMethod", createCheckoutSessionRequest.RedirectFromIssuerMethod); + + if (createCheckoutSessionRequest.RedirectToIssuerMethodOption.IsSet) + writer.WriteString("redirectToIssuerMethod", createCheckoutSessionRequest.RedirectToIssuerMethod); + + if (createCheckoutSessionRequest.RiskDataOption.IsSet) + { + writer.WritePropertyName("riskData"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.RiskData, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", createCheckoutSessionRequest.ShopperEmail); + + if (createCheckoutSessionRequest.ShopperIPOption.IsSet) + writer.WriteString("shopperIP", createCheckoutSessionRequest.ShopperIP); + + var shopperInteractionRawValue = CreateCheckoutSessionRequest.ShopperInteractionEnumToJsonValue(createCheckoutSessionRequest.ShopperInteractionOption.Value.Value); + writer.WriteString("shopperInteraction", shopperInteractionRawValue); + if (createCheckoutSessionRequest.ShopperLocaleOption.IsSet) + writer.WriteString("shopperLocale", createCheckoutSessionRequest.ShopperLocale); + + if (createCheckoutSessionRequest.ShopperNameOption.IsSet) + { + writer.WritePropertyName("shopperName"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.ShopperName, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.ShopperReferenceOption.IsSet) + writer.WriteString("shopperReference", createCheckoutSessionRequest.ShopperReference); + + if (createCheckoutSessionRequest.ShopperStatementOption.IsSet) + writer.WriteString("shopperStatement", createCheckoutSessionRequest.ShopperStatement); + + if (createCheckoutSessionRequest.ShowInstallmentAmountOption.IsSet) + writer.WriteBoolean("showInstallmentAmount", createCheckoutSessionRequest.ShowInstallmentAmountOption.Value.Value); + + if (createCheckoutSessionRequest.ShowRemovePaymentMethodButtonOption.IsSet) + writer.WriteBoolean("showRemovePaymentMethodButton", createCheckoutSessionRequest.ShowRemovePaymentMethodButtonOption.Value.Value); + + if (createCheckoutSessionRequest.SocialSecurityNumberOption.IsSet) + writer.WriteString("socialSecurityNumber", createCheckoutSessionRequest.SocialSecurityNumber); + + if (createCheckoutSessionRequest.SplitCardFundingSourcesOption.IsSet) + writer.WriteBoolean("splitCardFundingSources", createCheckoutSessionRequest.SplitCardFundingSourcesOption.Value.Value); + + if (createCheckoutSessionRequest.SplitsOption.IsSet) + { + writer.WritePropertyName("splits"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.Splits, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.StoreOption.IsSet) + writer.WriteString("store", createCheckoutSessionRequest.Store); + + var storeFiltrationModeRawValue = CreateCheckoutSessionRequest.StoreFiltrationModeEnumToJsonValue(createCheckoutSessionRequest.StoreFiltrationModeOption.Value.Value); + writer.WriteString("storeFiltrationMode", storeFiltrationModeRawValue); + if (createCheckoutSessionRequest.StorePaymentMethodOption.IsSet) + writer.WriteBoolean("storePaymentMethod", createCheckoutSessionRequest.StorePaymentMethodOption.Value.Value); + + var storePaymentMethodModeRawValue = CreateCheckoutSessionRequest.StorePaymentMethodModeEnumToJsonValue(createCheckoutSessionRequest.StorePaymentMethodModeOption.Value.Value); + writer.WriteString("storePaymentMethodMode", storePaymentMethodModeRawValue); + if (createCheckoutSessionRequest.TelephoneNumberOption.IsSet) + writer.WriteString("telephoneNumber", createCheckoutSessionRequest.TelephoneNumber); + + if (createCheckoutSessionRequest.ThemeIdOption.IsSet) + writer.WriteString("themeId", createCheckoutSessionRequest.ThemeId); + + if (createCheckoutSessionRequest.ThreeDS2RequestDataOption.IsSet) + { + writer.WritePropertyName("threeDS2RequestData"); + JsonSerializer.Serialize(writer, createCheckoutSessionRequest.ThreeDS2RequestData, jsonSerializerOptions); + } + if (createCheckoutSessionRequest.ThreeDSAuthenticationOnlyOption.IsSet) + writer.WriteBoolean("threeDSAuthenticationOnly", createCheckoutSessionRequest.ThreeDSAuthenticationOnlyOption.Value.Value); + + if (createCheckoutSessionRequest.TrustedShopperOption.IsSet) + writer.WriteBoolean("trustedShopper", createCheckoutSessionRequest.TrustedShopperOption.Value.Value); } } - } diff --git a/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs b/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs index b1db134a1..9aeac9c4a 100644 --- a/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs +++ b/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,755 +14,1483 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CreateCheckoutSessionResponse /// - [DataContract(Name = "CreateCheckoutSessionResponse")] public partial class CreateCheckoutSessionResponse : IEquatable, IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. + /// A unique identifier of the session. + /// The merchant account identifier, with which you want to process the transaction. + /// The reference to uniquely identify a payment. + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// accountInfo + /// additionalAmount + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` + /// applicationInfo + /// authenticationData + /// billingAddress + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` + /// The delay between the authorisation and scheduled auto-capture, specified in hours. + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** + /// company + /// The shopper's two-letter country code. + /// The shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + /// deliveryAddress + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. + /// fundOrigin + /// fundRecipient + /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. + /// mandate + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. + /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration (default to ModeEnum.Embedded) + /// mpiData + /// platformChargebackLogic + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + /// Minimum number of days between authorisations. Only for 3D Secure 2. + /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + /// riskData + /// The payment session data you need to pass to your front end. + /// The shopper's email address. + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// The combination of a language code and a country code to specify the language to be used in the payment. + /// shopperName + /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. + /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + /// Set to true to show the payment amount per installment. + /// Set to **true** to show a button that lets the shopper remove a stored payment method. + /// The shopper's social security number. + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false) + /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. + /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. + /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). + /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + /// The shopper's telephone number. + /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. + /// threeDS2RequestData + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) + /// Set to true if the payment should be routed to a trusted MID. + /// The URL for the Hosted Checkout page. Redirect the shopper to this URL so they can make the payment. + [JsonConstructor] + public CreateCheckoutSessionResponse(Amount amount, DateTime expiresAt, string id, string merchantAccount, string reference, string returnUrl, Option accountInfo = default, Option additionalAmount = default, Option> additionalData = default, Option> allowedPaymentMethods = default, Option applicationInfo = default, Option authenticationData = default, Option billingAddress = default, Option> blockedPaymentMethods = default, Option captureDelayHours = default, Option channel = default, Option company = default, Option countryCode = default, Option dateOfBirth = default, Option deliverAt = default, Option deliveryAddress = default, Option enableOneClick = default, Option enablePayOut = default, Option enableRecurring = default, Option fundOrigin = default, Option fundRecipient = default, Option> installmentOptions = default, Option> lineItems = default, Option mandate = default, Option mcc = default, Option merchantOrderReference = default, Option> metadata = default, Option mode = default, Option mpiData = default, Option platformChargebackLogic = default, Option recurringExpiry = default, Option recurringFrequency = default, Option recurringProcessingModel = default, Option redirectFromIssuerMethod = default, Option redirectToIssuerMethod = default, Option riskData = default, Option sessionData = default, Option shopperEmail = default, Option shopperIP = default, Option shopperInteraction = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option shopperStatement = default, Option showInstallmentAmount = default, Option showRemovePaymentMethodButton = default, Option socialSecurityNumber = default, Option splitCardFundingSources = default, Option> splits = default, Option store = default, Option storeFiltrationMode = default, Option storePaymentMethod = default, Option storePaymentMethodMode = default, Option telephoneNumber = default, Option themeId = default, Option threeDS2RequestData = default, Option threeDSAuthenticationOnly = default, Option trustedShopper = default, Option url = default) + { + Amount = amount; + ExpiresAt = expiresAt; + Id = id; + MerchantAccount = merchantAccount; + Reference = reference; + ReturnUrl = returnUrl; + AccountInfoOption = accountInfo; + AdditionalAmountOption = additionalAmount; + AdditionalDataOption = additionalData; + AllowedPaymentMethodsOption = allowedPaymentMethods; + ApplicationInfoOption = applicationInfo; + AuthenticationDataOption = authenticationData; + BillingAddressOption = billingAddress; + BlockedPaymentMethodsOption = blockedPaymentMethods; + CaptureDelayHoursOption = captureDelayHours; + ChannelOption = channel; + CompanyOption = company; + CountryCodeOption = countryCode; + DateOfBirthOption = dateOfBirth; + DeliverAtOption = deliverAt; + DeliveryAddressOption = deliveryAddress; + EnableOneClickOption = enableOneClick; + EnablePayOutOption = enablePayOut; + EnableRecurringOption = enableRecurring; + FundOriginOption = fundOrigin; + FundRecipientOption = fundRecipient; + InstallmentOptionsOption = installmentOptions; + LineItemsOption = lineItems; + MandateOption = mandate; + MccOption = mcc; + MerchantOrderReferenceOption = merchantOrderReference; + MetadataOption = metadata; + ModeOption = mode; + MpiDataOption = mpiData; + PlatformChargebackLogicOption = platformChargebackLogic; + RecurringExpiryOption = recurringExpiry; + RecurringFrequencyOption = recurringFrequency; + RecurringProcessingModelOption = recurringProcessingModel; + RedirectFromIssuerMethodOption = redirectFromIssuerMethod; + RedirectToIssuerMethodOption = redirectToIssuerMethod; + RiskDataOption = riskData; + SessionDataOption = sessionData; + ShopperEmailOption = shopperEmail; + ShopperIPOption = shopperIP; + ShopperInteractionOption = shopperInteraction; + ShopperLocaleOption = shopperLocale; + ShopperNameOption = shopperName; + ShopperReferenceOption = shopperReference; + ShopperStatementOption = shopperStatement; + ShowInstallmentAmountOption = showInstallmentAmount; + ShowRemovePaymentMethodButtonOption = showRemovePaymentMethodButton; + SocialSecurityNumberOption = socialSecurityNumber; + SplitCardFundingSourcesOption = splitCardFundingSources; + SplitsOption = splits; + StoreOption = store; + StoreFiltrationModeOption = storeFiltrationMode; + StorePaymentMethodOption = storePaymentMethod; + StorePaymentMethodModeOption = storePaymentMethodMode; + TelephoneNumberOption = telephoneNumber; + ThemeIdOption = themeId; + ThreeDS2RequestDataOption = threeDS2RequestData; + ThreeDSAuthenticationOnlyOption = threeDSAuthenticationOnly; + TrustedShopperOption = trustedShopper; + UrlOption = url; + OnCreated(); + } + + partial void OnCreated(); + /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** - [JsonConverter(typeof(StringEnumConverter))] public enum ChannelEnum { /// /// Enum IOS for value: iOS /// - [EnumMember(Value = "iOS")] IOS = 1, /// /// Enum Android for value: Android /// - [EnumMember(Value = "Android")] Android = 2, /// /// Enum Web for value: Web /// - [EnumMember(Value = "Web")] Web = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ChannelEnum ChannelEnumFromString(string value) + { + if (value.Equals("iOS")) + return ChannelEnum.IOS; + + if (value.Equals("Android")) + return ChannelEnum.Android; + + if (value.Equals("Web")) + return ChannelEnum.Web; + + throw new NotImplementedException($"Could not convert value to type ChannelEnum: '{value}'"); + } + /// + /// Returns a + /// + /// + /// + public static ChannelEnum? ChannelEnumFromStringOrDefault(string value) + { + if (value.Equals("iOS")) + return ChannelEnum.IOS; + + if (value.Equals("Android")) + return ChannelEnum.Android; + + if (value.Equals("Web")) + return ChannelEnum.Web; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChannelEnumToJsonValue(ChannelEnum? value) + { + if (value == ChannelEnum.IOS) + return "iOS"; + + if (value == ChannelEnum.Android) + return "Android"; + + if (value == ChannelEnum.Web) + return "Web"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Channel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChannelOption { get; private set; } /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** - [DataMember(Name = "channel", EmitDefaultValue = false)] - public ChannelEnum? Channel { get; set; } + [JsonPropertyName("channel")] + public ChannelEnum? Channel { get { return this.ChannelOption; } set { this.ChannelOption = new Option(value); } } + /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration - [JsonConverter(typeof(StringEnumConverter))] public enum ModeEnum { /// /// Enum Embedded for value: embedded /// - [EnumMember(Value = "embedded")] Embedded = 1, /// /// Enum Hosted for value: hosted /// - [EnumMember(Value = "hosted")] Hosted = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ModeEnum ModeEnumFromString(string value) + { + if (value.Equals("embedded")) + return ModeEnum.Embedded; + + if (value.Equals("hosted")) + return ModeEnum.Hosted; + + throw new NotImplementedException($"Could not convert value to type ModeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ModeEnum? ModeEnumFromStringOrDefault(string value) + { + if (value.Equals("embedded")) + return ModeEnum.Embedded; + + if (value.Equals("hosted")) + return ModeEnum.Hosted; + + return null; + } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ModeEnumToJsonValue(ModeEnum? value) + { + if (value == ModeEnum.Embedded) + return "embedded"; + + if (value == ModeEnum.Hosted) + return "hosted"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Mode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ModeOption { get; private set; } /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration - [DataMember(Name = "mode", EmitDefaultValue = false)] - public ModeEnum? Mode { get; set; } + [JsonPropertyName("mode")] + public ModeEnum? Mode { get { return this.ModeOption; } set { this.ModeOption = new Option(value); } } + /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// - [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// - [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// - [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) + { + if (value == RecurringProcessingModelEnum.CardOnFile) + return "CardOnFile"; + + if (value == RecurringProcessingModelEnum.Subscription) + return "Subscription"; + if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) + return "UnscheduledCardOnFile"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of RecurringProcessingModel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] - public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } + [JsonPropertyName("recurringProcessingModel")] + public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } + /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [JsonConverter(typeof(StringEnumConverter))] public enum ShopperInteractionEnum { /// /// Enum Ecommerce for value: Ecommerce /// - [EnumMember(Value = "Ecommerce")] Ecommerce = 1, /// /// Enum ContAuth for value: ContAuth /// - [EnumMember(Value = "ContAuth")] ContAuth = 2, /// /// Enum Moto for value: Moto /// - [EnumMember(Value = "Moto")] Moto = 3, /// /// Enum POS for value: POS /// - [EnumMember(Value = "POS")] POS = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ShopperInteractionEnum ShopperInteractionEnumFromString(string value) + { + if (value.Equals("Ecommerce")) + return ShopperInteractionEnum.Ecommerce; + + if (value.Equals("ContAuth")) + return ShopperInteractionEnum.ContAuth; + + if (value.Equals("Moto")) + return ShopperInteractionEnum.Moto; + + if (value.Equals("POS")) + return ShopperInteractionEnum.POS; + + throw new NotImplementedException($"Could not convert value to type ShopperInteractionEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ShopperInteractionEnum? ShopperInteractionEnumFromStringOrDefault(string value) + { + if (value.Equals("Ecommerce")) + return ShopperInteractionEnum.Ecommerce; + if (value.Equals("ContAuth")) + return ShopperInteractionEnum.ContAuth; + + if (value.Equals("Moto")) + return ShopperInteractionEnum.Moto; + + if (value.Equals("POS")) + return ShopperInteractionEnum.POS; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ShopperInteractionEnumToJsonValue(ShopperInteractionEnum? value) + { + if (value == ShopperInteractionEnum.Ecommerce) + return "Ecommerce"; + + if (value == ShopperInteractionEnum.ContAuth) + return "ContAuth"; + + if (value == ShopperInteractionEnum.Moto) + return "Moto"; + + if (value == ShopperInteractionEnum.POS) + return "POS"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of ShopperInteraction + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperInteractionOption { get; private set; } /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] - public ShopperInteractionEnum? ShopperInteraction { get; set; } + [JsonPropertyName("shopperInteraction")] + public ShopperInteractionEnum? ShopperInteraction { get { return this.ShopperInteractionOption; } set { this.ShopperInteractionOption = new Option(value); } } + /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - [JsonConverter(typeof(StringEnumConverter))] public enum StoreFiltrationModeEnum { /// /// Enum Exclusive for value: exclusive /// - [EnumMember(Value = "exclusive")] Exclusive = 1, /// /// Enum Inclusive for value: inclusive /// - [EnumMember(Value = "inclusive")] Inclusive = 2, /// /// Enum SkipFilter for value: skipFilter /// - [EnumMember(Value = "skipFilter")] SkipFilter = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static StoreFiltrationModeEnum StoreFiltrationModeEnumFromString(string value) + { + if (value.Equals("exclusive")) + return StoreFiltrationModeEnum.Exclusive; + + if (value.Equals("inclusive")) + return StoreFiltrationModeEnum.Inclusive; + + if (value.Equals("skipFilter")) + return StoreFiltrationModeEnum.SkipFilter; + + throw new NotImplementedException($"Could not convert value to type StoreFiltrationModeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static StoreFiltrationModeEnum? StoreFiltrationModeEnumFromStringOrDefault(string value) + { + if (value.Equals("exclusive")) + return StoreFiltrationModeEnum.Exclusive; + + if (value.Equals("inclusive")) + return StoreFiltrationModeEnum.Inclusive; + + if (value.Equals("skipFilter")) + return StoreFiltrationModeEnum.SkipFilter; + + return null; + } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StoreFiltrationModeEnumToJsonValue(StoreFiltrationModeEnum? value) + { + if (value == StoreFiltrationModeEnum.Exclusive) + return "exclusive"; + + if (value == StoreFiltrationModeEnum.Inclusive) + return "inclusive"; + + if (value == StoreFiltrationModeEnum.SkipFilter) + return "skipFilter"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of StoreFiltrationMode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoreFiltrationModeOption { get; private set; } /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - [DataMember(Name = "storeFiltrationMode", EmitDefaultValue = false)] - public StoreFiltrationModeEnum? StoreFiltrationMode { get; set; } + [JsonPropertyName("storeFiltrationMode")] + public StoreFiltrationModeEnum? StoreFiltrationMode { get { return this.StoreFiltrationModeOption; } set { this.StoreFiltrationModeOption = new Option(value); } } + /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. - [JsonConverter(typeof(StringEnumConverter))] public enum StorePaymentMethodModeEnum { /// /// Enum AskForConsent for value: askForConsent /// - [EnumMember(Value = "askForConsent")] AskForConsent = 1, /// /// Enum Disabled for value: disabled /// - [EnumMember(Value = "disabled")] Disabled = 2, /// /// Enum Enabled for value: enabled /// - [EnumMember(Value = "enabled")] Enabled = 3 - } - /// - /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + /// Returns a /// - /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. - [DataMember(Name = "storePaymentMethodMode", EmitDefaultValue = false)] - public StorePaymentMethodModeEnum? StorePaymentMethodMode { get; set; } + /// + /// + /// + public static StorePaymentMethodModeEnum StorePaymentMethodModeEnumFromString(string value) + { + if (value.Equals("askForConsent")) + return StorePaymentMethodModeEnum.AskForConsent; + + if (value.Equals("disabled")) + return StorePaymentMethodModeEnum.Disabled; + + if (value.Equals("enabled")) + return StorePaymentMethodModeEnum.Enabled; + + throw new NotImplementedException($"Could not convert value to type StorePaymentMethodModeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected CreateCheckoutSessionResponse() { } + /// + /// + public static StorePaymentMethodModeEnum? StorePaymentMethodModeEnumFromStringOrDefault(string value) + { + if (value.Equals("askForConsent")) + return StorePaymentMethodModeEnum.AskForConsent; + + if (value.Equals("disabled")) + return StorePaymentMethodModeEnum.Disabled; + + if (value.Equals("enabled")) + return StorePaymentMethodModeEnum.Enabled; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// accountInfo. - /// additionalAmount. - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. - /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]`. - /// amount (required). - /// applicationInfo. - /// authenticationData. - /// billingAddress. - /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]`. - /// The delay between the authorisation and scheduled auto-capture, specified in hours.. - /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web**. - /// company. - /// The shopper's two-letter country code.. - /// The shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.. - /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.. - /// deliveryAddress. - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition).. - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts.. - /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments.. - /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. (required). - /// fundOrigin. - /// fundRecipient. - /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options.. - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip.. - /// mandate. - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. - /// The merchant account identifier, with which you want to process the transaction. (required). - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.. - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. . - /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration (default to ModeEnum.Embedded). - /// mpiData. - /// platformChargebackLogic. - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2.. - /// Minimum number of days between authorisations. Only for 3D Secure 2.. - /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer.. - /// Specifies the redirect method (GET or POST) when redirecting to the issuer.. - /// The reference to uniquely identify a payment. (required). - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. (required). - /// riskData. - /// The payment session data you need to pass to your front end.. - /// The shopper's email address.. - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new).. - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. - /// The combination of a language code and a country code to specify the language to be used in the payment.. - /// shopperName. - /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. - /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**.. - /// Set to true to show the payment amount per installment.. - /// Set to **true** to show a button that lets the shopper remove a stored payment method.. - /// The shopper's social security number.. - /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false). - /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).. - /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment.. - /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned.. - /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types).. - /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent.. - /// The shopper's telephone number.. - /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area.. - /// threeDS2RequestData. - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false). - /// Set to true if the payment should be routed to a trusted MID.. - /// The URL for the Hosted Checkout page. Redirect the shopper to this URL so they can make the payment.. - public CreateCheckoutSessionResponse(AccountInfo accountInfo = default(AccountInfo), Amount additionalAmount = default(Amount), Dictionary additionalData = default(Dictionary), List allowedPaymentMethods = default(List), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), AuthenticationData authenticationData = default(AuthenticationData), BillingAddress billingAddress = default(BillingAddress), List blockedPaymentMethods = default(List), int? captureDelayHours = default(int?), ChannelEnum? channel = default(ChannelEnum?), Company company = default(Company), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), DateTime deliverAt = default(DateTime), DeliveryAddress deliveryAddress = default(DeliveryAddress), bool? enableOneClick = default(bool?), bool? enablePayOut = default(bool?), bool? enableRecurring = default(bool?), DateTime expiresAt = default(DateTime), FundOrigin fundOrigin = default(FundOrigin), FundRecipient fundRecipient = default(FundRecipient), Dictionary installmentOptions = default(Dictionary), List lineItems = default(List), Mandate mandate = default(Mandate), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), Dictionary metadata = default(Dictionary), ModeEnum? mode = ModeEnum.Embedded, ThreeDSecureData mpiData = default(ThreeDSecureData), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), string recurringExpiry = default(string), string recurringFrequency = default(string), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string redirectFromIssuerMethod = default(string), string redirectToIssuerMethod = default(string), string reference = default(string), string returnUrl = default(string), RiskData riskData = default(RiskData), string sessionData = default(string), string shopperEmail = default(string), string shopperIP = default(string), ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), bool? showInstallmentAmount = default(bool?), bool? showRemovePaymentMethodButton = default(bool?), string socialSecurityNumber = default(string), bool? splitCardFundingSources = false, List splits = default(List), string store = default(string), StoreFiltrationModeEnum? storeFiltrationMode = default(StoreFiltrationModeEnum?), bool? storePaymentMethod = default(bool?), StorePaymentMethodModeEnum? storePaymentMethodMode = default(StorePaymentMethodModeEnum?), string telephoneNumber = default(string), string themeId = default(string), CheckoutSessionThreeDS2RequestData threeDS2RequestData = default(CheckoutSessionThreeDS2RequestData), bool? threeDSAuthenticationOnly = false, bool? trustedShopper = default(bool?), string url = default(string)) + /// + /// + /// + public static string StorePaymentMethodModeEnumToJsonValue(StorePaymentMethodModeEnum? value) { - this.Amount = amount; - this.ExpiresAt = expiresAt; - this.MerchantAccount = merchantAccount; - this.Reference = reference; - this.ReturnUrl = returnUrl; - this.AccountInfo = accountInfo; - this.AdditionalAmount = additionalAmount; - this.AdditionalData = additionalData; - this.AllowedPaymentMethods = allowedPaymentMethods; - this.ApplicationInfo = applicationInfo; - this.AuthenticationData = authenticationData; - this.BillingAddress = billingAddress; - this.BlockedPaymentMethods = blockedPaymentMethods; - this.CaptureDelayHours = captureDelayHours; - this.Channel = channel; - this.Company = company; - this.CountryCode = countryCode; - this.DateOfBirth = dateOfBirth; - this.DeliverAt = deliverAt; - this.DeliveryAddress = deliveryAddress; - this.EnableOneClick = enableOneClick; - this.EnablePayOut = enablePayOut; - this.EnableRecurring = enableRecurring; - this.FundOrigin = fundOrigin; - this.FundRecipient = fundRecipient; - this.InstallmentOptions = installmentOptions; - this.LineItems = lineItems; - this.Mandate = mandate; - this.Mcc = mcc; - this.MerchantOrderReference = merchantOrderReference; - this.Metadata = metadata; - this.Mode = mode; - this.MpiData = mpiData; - this.PlatformChargebackLogic = platformChargebackLogic; - this.RecurringExpiry = recurringExpiry; - this.RecurringFrequency = recurringFrequency; - this.RecurringProcessingModel = recurringProcessingModel; - this.RedirectFromIssuerMethod = redirectFromIssuerMethod; - this.RedirectToIssuerMethod = redirectToIssuerMethod; - this.RiskData = riskData; - this.SessionData = sessionData; - this.ShopperEmail = shopperEmail; - this.ShopperIP = shopperIP; - this.ShopperInteraction = shopperInteraction; - this.ShopperLocale = shopperLocale; - this.ShopperName = shopperName; - this.ShopperReference = shopperReference; - this.ShopperStatement = shopperStatement; - this.ShowInstallmentAmount = showInstallmentAmount; - this.ShowRemovePaymentMethodButton = showRemovePaymentMethodButton; - this.SocialSecurityNumber = socialSecurityNumber; - this.SplitCardFundingSources = splitCardFundingSources; - this.Splits = splits; - this.Store = store; - this.StoreFiltrationMode = storeFiltrationMode; - this.StorePaymentMethod = storePaymentMethod; - this.StorePaymentMethodMode = storePaymentMethodMode; - this.TelephoneNumber = telephoneNumber; - this.ThemeId = themeId; - this.ThreeDS2RequestData = threeDS2RequestData; - this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; - this.TrustedShopper = trustedShopper; - this.Url = url; + if (value == StorePaymentMethodModeEnum.AskForConsent) + return "askForConsent"; + + if (value == StorePaymentMethodModeEnum.Disabled) + return "disabled"; + + if (value == StorePaymentMethodModeEnum.Enabled) + return "enabled"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// Gets or Sets AccountInfo + /// Used to track the state of StorePaymentMethodMode /// - [DataMember(Name = "accountInfo", EmitDefaultValue = false)] - public AccountInfo AccountInfo { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StorePaymentMethodModeOption { get; private set; } /// - /// Gets or Sets AdditionalAmount + /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. /// - [DataMember(Name = "additionalAmount", EmitDefaultValue = false)] - public Amount AdditionalAmount { get; set; } + /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + [JsonPropertyName("storePaymentMethodMode")] + public StorePaymentMethodModeEnum? StorePaymentMethodMode { get { return this.StorePaymentMethodModeOption; } set { this.StorePaymentMethodModeOption = new Option(value); } } /// - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + /// Gets or Sets Amount /// - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - [DataMember(Name = "additionalData", EmitDefaultValue = false)] - public Dictionary AdditionalData { get; set; } + [JsonPropertyName("amount")] + public Amount Amount { get; set; } /// - /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` + /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. /// - /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] - public List AllowedPaymentMethods { get; set; } + /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. + [JsonPropertyName("expiresAt")] + public DateTime ExpiresAt { get; set; } /// - /// Gets or Sets Amount + /// A unique identifier of the session. /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] - public Amount Amount { get; set; } + /// A unique identifier of the session. + [JsonPropertyName("id")] + public string Id { get; } /// - /// Gets or Sets ApplicationInfo + /// The merchant account identifier, with which you want to process the transaction. /// - [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; set; } + /// The merchant account identifier, with which you want to process the transaction. + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get; set; } /// - /// Gets or Sets AuthenticationData + /// The reference to uniquely identify a payment. /// - [DataMember(Name = "authenticationData", EmitDefaultValue = false)] - public AuthenticationData AuthenticationData { get; set; } + /// The reference to uniquely identify a payment. + [JsonPropertyName("reference")] + public string Reference { get; set; } /// - /// Gets or Sets BillingAddress + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. /// - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public BillingAddress BillingAddress { get; set; } + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + [JsonPropertyName("returnUrl")] + public string ReturnUrl { get; set; } /// - /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` + /// Used to track the state of AccountInfo /// - /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] - public List BlockedPaymentMethods { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountInfoOption { get; private set; } /// - /// The delay between the authorisation and scheduled auto-capture, specified in hours. + /// Gets or Sets AccountInfo /// - /// The delay between the authorisation and scheduled auto-capture, specified in hours. - [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] - public int? CaptureDelayHours { get; set; } + [JsonPropertyName("accountInfo")] + public AccountInfo AccountInfo { get { return this.AccountInfoOption; } set { this.AccountInfoOption = new Option(value); } } /// - /// Gets or Sets Company + /// Used to track the state of AdditionalAmount /// - [DataMember(Name = "company", EmitDefaultValue = false)] - public Company Company { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AdditionalAmountOption { get; private set; } /// - /// The shopper's two-letter country code. + /// Gets or Sets AdditionalAmount /// - /// The shopper's two-letter country code. - [DataMember(Name = "countryCode", EmitDefaultValue = false)] - public string CountryCode { get; set; } + [JsonPropertyName("additionalAmount")] + public Amount AdditionalAmount { get { return this.AdditionalAmountOption; } set { this.AdditionalAmountOption = new Option(value); } } /// - /// The shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + /// Used to track the state of AdditionalData /// - /// The shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] - public DateTime DateOfBirth { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AdditionalDataOption { get; private set; } /// - /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// - /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [DataMember(Name = "deliverAt", EmitDefaultValue = false)] - public DateTime DeliverAt { get; set; } + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + [JsonPropertyName("additionalData")] + public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } /// - /// Gets or Sets DeliveryAddress + /// Used to track the state of AllowedPaymentMethods /// - [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] - public DeliveryAddress DeliveryAddress { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AllowedPaymentMethodsOption { get; private set; } /// - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` /// - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). - [DataMember(Name = "enableOneClick", EmitDefaultValue = false)] - public bool? EnableOneClick { get; set; } + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` + [JsonPropertyName("allowedPaymentMethods")] + public List AllowedPaymentMethods { get { return this.AllowedPaymentMethodsOption; } set { this.AllowedPaymentMethodsOption = new Option>(value); } } /// - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + /// Used to track the state of ApplicationInfo /// - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. - [DataMember(Name = "enablePayOut", EmitDefaultValue = false)] - public bool? EnablePayOut { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ApplicationInfoOption { get; private set; } /// - /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. + /// Gets or Sets ApplicationInfo /// - /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. - [DataMember(Name = "enableRecurring", EmitDefaultValue = false)] - public bool? EnableRecurring { get; set; } + [JsonPropertyName("applicationInfo")] + public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } /// - /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. + /// Used to track the state of AuthenticationData /// - /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. - [DataMember(Name = "expiresAt", IsRequired = false, EmitDefaultValue = false)] - public DateTime ExpiresAt { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthenticationDataOption { get; private set; } /// - /// Gets or Sets FundOrigin + /// Gets or Sets AuthenticationData /// - [DataMember(Name = "fundOrigin", EmitDefaultValue = false)] - public FundOrigin FundOrigin { get; set; } + [JsonPropertyName("authenticationData")] + public AuthenticationData AuthenticationData { get { return this.AuthenticationDataOption; } set { this.AuthenticationDataOption = new Option(value); } } /// - /// Gets or Sets FundRecipient + /// Used to track the state of BillingAddress /// - [DataMember(Name = "fundRecipient", EmitDefaultValue = false)] - public FundRecipient FundRecipient { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressOption { get; private set; } /// - /// A unique identifier of the session. + /// Gets or Sets BillingAddress /// - /// A unique identifier of the session. - [DataMember(Name = "id", IsRequired = false, EmitDefaultValue = false)] - public string Id { get; private set; } + [JsonPropertyName("billingAddress")] + public BillingAddress BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } /// - /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. + /// Used to track the state of BlockedPaymentMethods /// - /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. - [DataMember(Name = "installmentOptions", EmitDefaultValue = false)] - public Dictionary InstallmentOptions { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> BlockedPaymentMethodsOption { get; private set; } /// - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` /// - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. - [DataMember(Name = "lineItems", EmitDefaultValue = false)] - public List LineItems { get; set; } + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` + [JsonPropertyName("blockedPaymentMethods")] + public List BlockedPaymentMethods { get { return this.BlockedPaymentMethodsOption; } set { this.BlockedPaymentMethodsOption = new Option>(value); } } /// - /// Gets or Sets Mandate + /// Used to track the state of CaptureDelayHours /// - [DataMember(Name = "mandate", EmitDefaultValue = false)] - public Mandate Mandate { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CaptureDelayHoursOption { get; private set; } /// - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + /// The delay between the authorisation and scheduled auto-capture, specified in hours. /// - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - [DataMember(Name = "mcc", EmitDefaultValue = false)] - public string Mcc { get; set; } + /// The delay between the authorisation and scheduled auto-capture, specified in hours. + [JsonPropertyName("captureDelayHours")] + public int? CaptureDelayHours { get { return this.CaptureDelayHoursOption; } set { this.CaptureDelayHoursOption = new Option(value); } } /// - /// The merchant account identifier, with which you want to process the transaction. + /// Used to track the state of Company /// - /// The merchant account identifier, with which you want to process the transaction. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CompanyOption { get; private set; } /// - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// Gets or Sets Company /// - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] - public string MerchantOrderReference { get; set; } + [JsonPropertyName("company")] + public Company Company { get { return this.CompanyOption; } set { this.CompanyOption = new Option(value); } } /// - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. + /// Used to track the state of CountryCode /// - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. - [DataMember(Name = "metadata", EmitDefaultValue = false)] - public Dictionary Metadata { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryCodeOption { get; private set; } /// - /// Gets or Sets MpiData + /// The shopper's two-letter country code. /// - [DataMember(Name = "mpiData", EmitDefaultValue = false)] - public ThreeDSecureData MpiData { get; set; } + /// The shopper's two-letter country code. + [JsonPropertyName("countryCode")] + public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } /// - /// Gets or Sets PlatformChargebackLogic + /// Used to track the state of DateOfBirth /// - [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] - public PlatformChargebackLogic PlatformChargebackLogic { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DateOfBirthOption { get; private set; } /// - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + /// The shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. /// - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. - [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] - public string RecurringExpiry { get; set; } + /// The shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + [JsonPropertyName("dateOfBirth")] + public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } /// - /// Minimum number of days between authorisations. Only for 3D Secure 2. + /// Used to track the state of DeliverAt /// - /// Minimum number of days between authorisations. Only for 3D Secure 2. - [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] - public string RecurringFrequency { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliverAtOption { get; private set; } /// - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. + /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. /// - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. - [DataMember(Name = "redirectFromIssuerMethod", EmitDefaultValue = false)] - public string RedirectFromIssuerMethod { get; set; } + /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + [JsonPropertyName("deliverAt")] + public DateTime? DeliverAt { get { return this.DeliverAtOption; } set { this.DeliverAtOption = new Option(value); } } /// - /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + /// Used to track the state of DeliveryAddress /// - /// Specifies the redirect method (GET or POST) when redirecting to the issuer. - [DataMember(Name = "redirectToIssuerMethod", EmitDefaultValue = false)] - public string RedirectToIssuerMethod { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryAddressOption { get; private set; } /// - /// The reference to uniquely identify a payment. + /// Gets or Sets DeliveryAddress /// - /// The reference to uniquely identify a payment. - [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("deliveryAddress")] + public DeliveryAddress DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } /// - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// Used to track the state of EnableOneClick /// - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. - [DataMember(Name = "returnUrl", IsRequired = false, EmitDefaultValue = false)] - public string ReturnUrl { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnableOneClickOption { get; private set; } + + /// + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). + /// + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). + [JsonPropertyName("enableOneClick")] + public bool? EnableOneClick { get { return this.EnableOneClickOption; } set { this.EnableOneClickOption = new Option(value); } } + + /// + /// Used to track the state of EnablePayOut + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnablePayOutOption { get; private set; } + + /// + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + /// + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + [JsonPropertyName("enablePayOut")] + public bool? EnablePayOut { get { return this.EnablePayOutOption; } set { this.EnablePayOutOption = new Option(value); } } + + /// + /// Used to track the state of EnableRecurring + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnableRecurringOption { get; private set; } + + /// + /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. + /// + /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. + [JsonPropertyName("enableRecurring")] + public bool? EnableRecurring { get { return this.EnableRecurringOption; } set { this.EnableRecurringOption = new Option(value); } } + + /// + /// Used to track the state of FundOrigin + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundOriginOption { get; private set; } + + /// + /// Gets or Sets FundOrigin + /// + [JsonPropertyName("fundOrigin")] + public FundOrigin FundOrigin { get { return this.FundOriginOption; } set { this.FundOriginOption = new Option(value); } } + + /// + /// Used to track the state of FundRecipient + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundRecipientOption { get; private set; } + + /// + /// Gets or Sets FundRecipient + /// + [JsonPropertyName("fundRecipient")] + public FundRecipient FundRecipient { get { return this.FundRecipientOption; } set { this.FundRecipientOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentOptions + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> InstallmentOptionsOption { get; private set; } + + /// + /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. + /// + /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. + [JsonPropertyName("installmentOptions")] + public Dictionary InstallmentOptions { get { return this.InstallmentOptionsOption; } set { this.InstallmentOptionsOption = new Option>(value); } } + + /// + /// Used to track the state of LineItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LineItemsOption { get; private set; } + + /// + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. + /// + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. + [JsonPropertyName("lineItems")] + public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } + + /// + /// Used to track the state of Mandate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MandateOption { get; private set; } + + /// + /// Gets or Sets Mandate + /// + [JsonPropertyName("mandate")] + public Mandate Mandate { get { return this.MandateOption; } set { this.MandateOption = new Option(value); } } + + /// + /// Used to track the state of Mcc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MccOption { get; private set; } + + /// + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + /// + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + [JsonPropertyName("mcc")] + public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } + + /// + /// Used to track the state of MerchantOrderReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantOrderReferenceOption { get; private set; } + + /// + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + [JsonPropertyName("merchantOrderReference")] + public string MerchantOrderReference { get { return this.MerchantOrderReferenceOption; } set { this.MerchantOrderReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Metadata + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> MetadataOption { get; private set; } + + /// + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. + /// + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. + [JsonPropertyName("metadata")] + public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } + + /// + /// Used to track the state of MpiData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MpiDataOption { get; private set; } + + /// + /// Gets or Sets MpiData + /// + [JsonPropertyName("mpiData")] + public ThreeDSecureData MpiData { get { return this.MpiDataOption; } set { this.MpiDataOption = new Option(value); } } + + /// + /// Used to track the state of PlatformChargebackLogic + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PlatformChargebackLogicOption { get; private set; } + + /// + /// Gets or Sets PlatformChargebackLogic + /// + [JsonPropertyName("platformChargebackLogic")] + public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } + + /// + /// Used to track the state of RecurringExpiry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringExpiryOption { get; private set; } + + /// + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + /// + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + [JsonPropertyName("recurringExpiry")] + public string RecurringExpiry { get { return this.RecurringExpiryOption; } set { this.RecurringExpiryOption = new Option(value); } } + + /// + /// Used to track the state of RecurringFrequency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringFrequencyOption { get; private set; } + + /// + /// Minimum number of days between authorisations. Only for 3D Secure 2. + /// + /// Minimum number of days between authorisations. Only for 3D Secure 2. + [JsonPropertyName("recurringFrequency")] + public string RecurringFrequency { get { return this.RecurringFrequencyOption; } set { this.RecurringFrequencyOption = new Option(value); } } + + /// + /// Used to track the state of RedirectFromIssuerMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RedirectFromIssuerMethodOption { get; private set; } + + /// + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. + /// + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. + [JsonPropertyName("redirectFromIssuerMethod")] + public string RedirectFromIssuerMethod { get { return this.RedirectFromIssuerMethodOption; } set { this.RedirectFromIssuerMethodOption = new Option(value); } } + + /// + /// Used to track the state of RedirectToIssuerMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RedirectToIssuerMethodOption { get; private set; } + + /// + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + /// + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + [JsonPropertyName("redirectToIssuerMethod")] + public string RedirectToIssuerMethod { get { return this.RedirectToIssuerMethodOption; } set { this.RedirectToIssuerMethodOption = new Option(value); } } + + /// + /// Used to track the state of RiskData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskDataOption { get; private set; } /// /// Gets or Sets RiskData /// - [DataMember(Name = "riskData", EmitDefaultValue = false)] - public RiskData RiskData { get; set; } + [JsonPropertyName("riskData")] + public RiskData RiskData { get { return this.RiskDataOption; } set { this.RiskDataOption = new Option(value); } } + + /// + /// Used to track the state of SessionData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SessionDataOption { get; private set; } /// /// The payment session data you need to pass to your front end. /// /// The payment session data you need to pass to your front end. - [DataMember(Name = "sessionData", EmitDefaultValue = false)] - public string SessionData { get; set; } + [JsonPropertyName("sessionData")] + public string SessionData { get { return this.SessionDataOption; } set { this.SessionDataOption = new Option(value); } } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The shopper's email address. /// /// The shopper's email address. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of ShopperIP + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperIPOption { get; private set; } /// /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). /// /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - [DataMember(Name = "shopperIP", EmitDefaultValue = false)] - public string ShopperIP { get; set; } + [JsonPropertyName("shopperIP")] + public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } + + /// + /// Used to track the state of ShopperLocale + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperLocaleOption { get; private set; } /// /// The combination of a language code and a country code to specify the language to be used in the payment. /// /// The combination of a language code and a country code to specify the language to be used in the payment. - [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] - public string ShopperLocale { get; set; } + [JsonPropertyName("shopperLocale")] + public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } + + /// + /// Used to track the state of ShopperName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNameOption { get; private set; } /// /// Gets or Sets ShopperName /// - [DataMember(Name = "shopperName", EmitDefaultValue = false)] - public Name ShopperName { get; set; } + [JsonPropertyName("shopperName")] + public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } + + /// + /// Used to track the state of ShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperReferenceOption { get; private set; } /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [DataMember(Name = "shopperReference", EmitDefaultValue = false)] - public string ShopperReference { get; set; } + [JsonPropertyName("shopperReference")] + public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperStatement + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperStatementOption { get; private set; } /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] - public string ShopperStatement { get; set; } + [JsonPropertyName("shopperStatement")] + public string ShopperStatement { get { return this.ShopperStatementOption; } set { this.ShopperStatementOption = new Option(value); } } + + /// + /// Used to track the state of ShowInstallmentAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShowInstallmentAmountOption { get; private set; } /// /// Set to true to show the payment amount per installment. /// /// Set to true to show the payment amount per installment. - [DataMember(Name = "showInstallmentAmount", EmitDefaultValue = false)] - public bool? ShowInstallmentAmount { get; set; } + [JsonPropertyName("showInstallmentAmount")] + public bool? ShowInstallmentAmount { get { return this.ShowInstallmentAmountOption; } set { this.ShowInstallmentAmountOption = new Option(value); } } + + /// + /// Used to track the state of ShowRemovePaymentMethodButton + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShowRemovePaymentMethodButtonOption { get; private set; } /// /// Set to **true** to show a button that lets the shopper remove a stored payment method. /// /// Set to **true** to show a button that lets the shopper remove a stored payment method. - [DataMember(Name = "showRemovePaymentMethodButton", EmitDefaultValue = false)] - public bool? ShowRemovePaymentMethodButton { get; set; } + [JsonPropertyName("showRemovePaymentMethodButton")] + public bool? ShowRemovePaymentMethodButton { get { return this.ShowRemovePaymentMethodButtonOption; } set { this.ShowRemovePaymentMethodButtonOption = new Option(value); } } + + /// + /// Used to track the state of SocialSecurityNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SocialSecurityNumberOption { get; private set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] - public string SocialSecurityNumber { get; set; } + [JsonPropertyName("socialSecurityNumber")] + public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } + + /// + /// Used to track the state of SplitCardFundingSources + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SplitCardFundingSourcesOption { get; private set; } /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. - [DataMember(Name = "splitCardFundingSources", EmitDefaultValue = false)] - public bool? SplitCardFundingSources { get; set; } + [JsonPropertyName("splitCardFundingSources")] + public bool? SplitCardFundingSources { get { return this.SplitCardFundingSourcesOption; } set { this.SplitCardFundingSourcesOption = new Option(value); } } + + /// + /// Used to track the state of Splits + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SplitsOption { get; private set; } /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - [DataMember(Name = "splits", EmitDefaultValue = false)] - public List Splits { get; set; } + [JsonPropertyName("splits")] + public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } + + /// + /// Used to track the state of Store + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoreOption { get; private set; } /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - [DataMember(Name = "store", EmitDefaultValue = false)] - public string Store { get; set; } + [JsonPropertyName("store")] + public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } + + /// + /// Used to track the state of StorePaymentMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StorePaymentMethodOption { get; private set; } /// /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). /// /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). - [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] - public bool? StorePaymentMethod { get; set; } + [JsonPropertyName("storePaymentMethod")] + public bool? StorePaymentMethod { get { return this.StorePaymentMethodOption; } set { this.StorePaymentMethodOption = new Option(value); } } + + /// + /// Used to track the state of TelephoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TelephoneNumberOption { get; private set; } /// /// The shopper's telephone number. /// /// The shopper's telephone number. - [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] - public string TelephoneNumber { get; set; } + [JsonPropertyName("telephoneNumber")] + public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of ThemeId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThemeIdOption { get; private set; } /// /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. /// /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. - [DataMember(Name = "themeId", EmitDefaultValue = false)] - public string ThemeId { get; set; } + [JsonPropertyName("themeId")] + public string ThemeId { get { return this.ThemeIdOption; } set { this.ThemeIdOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2RequestData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2RequestDataOption { get; private set; } /// /// Gets or Sets ThreeDS2RequestData /// - [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] - public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get; set; } + [JsonPropertyName("threeDS2RequestData")] + public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSAuthenticationOnly + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSAuthenticationOnlyOption { get; private set; } /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.authenticationOnly` instead.")] - public bool? ThreeDSAuthenticationOnly { get; set; } + [JsonPropertyName("threeDSAuthenticationOnly")] + [Obsolete] + public bool? ThreeDSAuthenticationOnly { get { return this.ThreeDSAuthenticationOnlyOption; } set { this.ThreeDSAuthenticationOnlyOption = new Option(value); } } + + /// + /// Used to track the state of TrustedShopper + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TrustedShopperOption { get; private set; } /// /// Set to true if the payment should be routed to a trusted MID. /// /// Set to true if the payment should be routed to a trusted MID. - [DataMember(Name = "trustedShopper", EmitDefaultValue = false)] - public bool? TrustedShopper { get; set; } + [JsonPropertyName("trustedShopper")] + public bool? TrustedShopper { get { return this.TrustedShopperOption; } set { this.TrustedShopperOption = new Option(value); } } + + /// + /// Used to track the state of Url + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UrlOption { get; private set; } /// /// The URL for the Hosted Checkout page. Redirect the shopper to this URL so they can make the payment. /// /// The URL for the Hosted Checkout page. Redirect the shopper to this URL so they can make the payment. - [DataMember(Name = "url", EmitDefaultValue = false)] - public string Url { get; set; } + [JsonPropertyName("url")] + public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -773,11 +1500,16 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CreateCheckoutSessionResponse {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" AccountInfo: ").Append(AccountInfo).Append("\n"); sb.Append(" AdditionalAmount: ").Append(AdditionalAmount).Append("\n"); sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); - sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" AuthenticationData: ").Append(AuthenticationData).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); @@ -792,15 +1524,12 @@ public override string ToString() sb.Append(" EnableOneClick: ").Append(EnableOneClick).Append("\n"); sb.Append(" EnablePayOut: ").Append(EnablePayOut).Append("\n"); sb.Append(" EnableRecurring: ").Append(EnableRecurring).Append("\n"); - sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append(" FundOrigin: ").Append(FundOrigin).Append("\n"); sb.Append(" FundRecipient: ").Append(FundRecipient).Append("\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" InstallmentOptions: ").Append(InstallmentOptions).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" Mandate: ").Append(Mandate).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append(" Mode: ").Append(Mode).Append("\n"); @@ -811,8 +1540,6 @@ public override string ToString() sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); sb.Append(" RedirectFromIssuerMethod: ").Append(RedirectFromIssuerMethod).Append("\n"); sb.Append(" RedirectToIssuerMethod: ").Append(RedirectToIssuerMethod).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" RiskData: ").Append(RiskData).Append("\n"); sb.Append(" SessionData: ").Append(SessionData).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); @@ -841,15 +1568,6 @@ public override string ToString() return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - /// /// Returns true if objects are equal /// @@ -868,320 +1586,13 @@ public override bool Equals(object input) public bool Equals(CreateCheckoutSessionResponse input) { if (input == null) - { return false; - } + return ( - this.AccountInfo == input.AccountInfo || - (this.AccountInfo != null && - this.AccountInfo.Equals(input.AccountInfo)) - ) && - ( - this.AdditionalAmount == input.AdditionalAmount || - (this.AdditionalAmount != null && - this.AdditionalAmount.Equals(input.AdditionalAmount)) - ) && - ( - this.AdditionalData == input.AdditionalData || - this.AdditionalData != null && - input.AdditionalData != null && - this.AdditionalData.SequenceEqual(input.AdditionalData) - ) && - ( - this.AllowedPaymentMethods == input.AllowedPaymentMethods || - this.AllowedPaymentMethods != null && - input.AllowedPaymentMethods != null && - this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) - ) && - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.AuthenticationData == input.AuthenticationData || - (this.AuthenticationData != null && - this.AuthenticationData.Equals(input.AuthenticationData)) - ) && - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.BlockedPaymentMethods == input.BlockedPaymentMethods || - this.BlockedPaymentMethods != null && - input.BlockedPaymentMethods != null && - this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) - ) && - ( - this.CaptureDelayHours == input.CaptureDelayHours || - this.CaptureDelayHours.Equals(input.CaptureDelayHours) - ) && - ( - this.Channel == input.Channel || - this.Channel.Equals(input.Channel) - ) && - ( - this.Company == input.Company || - (this.Company != null && - this.Company.Equals(input.Company)) - ) && - ( - this.CountryCode == input.CountryCode || - (this.CountryCode != null && - this.CountryCode.Equals(input.CountryCode)) - ) && - ( - this.DateOfBirth == input.DateOfBirth || - (this.DateOfBirth != null && - this.DateOfBirth.Equals(input.DateOfBirth)) - ) && - ( - this.DeliverAt == input.DeliverAt || - (this.DeliverAt != null && - this.DeliverAt.Equals(input.DeliverAt)) - ) && - ( - this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) - ) && - ( - this.EnableOneClick == input.EnableOneClick || - this.EnableOneClick.Equals(input.EnableOneClick) - ) && - ( - this.EnablePayOut == input.EnablePayOut || - this.EnablePayOut.Equals(input.EnablePayOut) - ) && - ( - this.EnableRecurring == input.EnableRecurring || - this.EnableRecurring.Equals(input.EnableRecurring) - ) && - ( - this.ExpiresAt == input.ExpiresAt || - (this.ExpiresAt != null && - this.ExpiresAt.Equals(input.ExpiresAt)) - ) && - ( - this.FundOrigin == input.FundOrigin || - (this.FundOrigin != null && - this.FundOrigin.Equals(input.FundOrigin)) - ) && - ( - this.FundRecipient == input.FundRecipient || - (this.FundRecipient != null && - this.FundRecipient.Equals(input.FundRecipient)) - ) && - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.InstallmentOptions == input.InstallmentOptions || - this.InstallmentOptions != null && - input.InstallmentOptions != null && - this.InstallmentOptions.SequenceEqual(input.InstallmentOptions) - ) && - ( - this.LineItems == input.LineItems || - this.LineItems != null && - input.LineItems != null && - this.LineItems.SequenceEqual(input.LineItems) - ) && - ( - this.Mandate == input.Mandate || - (this.Mandate != null && - this.Mandate.Equals(input.Mandate)) - ) && - ( - this.Mcc == input.Mcc || - (this.Mcc != null && - this.Mcc.Equals(input.Mcc)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.MerchantOrderReference == input.MerchantOrderReference || - (this.MerchantOrderReference != null && - this.MerchantOrderReference.Equals(input.MerchantOrderReference)) - ) && - ( - this.Metadata == input.Metadata || - this.Metadata != null && - input.Metadata != null && - this.Metadata.SequenceEqual(input.Metadata) - ) && - ( - this.Mode == input.Mode || - this.Mode.Equals(input.Mode) - ) && - ( - this.MpiData == input.MpiData || - (this.MpiData != null && - this.MpiData.Equals(input.MpiData)) - ) && - ( - this.PlatformChargebackLogic == input.PlatformChargebackLogic || - (this.PlatformChargebackLogic != null && - this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) - ) && - ( - this.RecurringExpiry == input.RecurringExpiry || - (this.RecurringExpiry != null && - this.RecurringExpiry.Equals(input.RecurringExpiry)) - ) && - ( - this.RecurringFrequency == input.RecurringFrequency || - (this.RecurringFrequency != null && - this.RecurringFrequency.Equals(input.RecurringFrequency)) - ) && - ( - this.RecurringProcessingModel == input.RecurringProcessingModel || - this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) - ) && - ( - this.RedirectFromIssuerMethod == input.RedirectFromIssuerMethod || - (this.RedirectFromIssuerMethod != null && - this.RedirectFromIssuerMethod.Equals(input.RedirectFromIssuerMethod)) - ) && - ( - this.RedirectToIssuerMethod == input.RedirectToIssuerMethod || - (this.RedirectToIssuerMethod != null && - this.RedirectToIssuerMethod.Equals(input.RedirectToIssuerMethod)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.ReturnUrl == input.ReturnUrl || - (this.ReturnUrl != null && - this.ReturnUrl.Equals(input.ReturnUrl)) - ) && - ( - this.RiskData == input.RiskData || - (this.RiskData != null && - this.RiskData.Equals(input.RiskData)) - ) && - ( - this.SessionData == input.SessionData || - (this.SessionData != null && - this.SessionData.Equals(input.SessionData)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.ShopperIP == input.ShopperIP || - (this.ShopperIP != null && - this.ShopperIP.Equals(input.ShopperIP)) - ) && - ( - this.ShopperInteraction == input.ShopperInteraction || - this.ShopperInteraction.Equals(input.ShopperInteraction) - ) && - ( - this.ShopperLocale == input.ShopperLocale || - (this.ShopperLocale != null && - this.ShopperLocale.Equals(input.ShopperLocale)) - ) && - ( - this.ShopperName == input.ShopperName || - (this.ShopperName != null && - this.ShopperName.Equals(input.ShopperName)) - ) && - ( - this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) - ) && - ( - this.ShopperStatement == input.ShopperStatement || - (this.ShopperStatement != null && - this.ShopperStatement.Equals(input.ShopperStatement)) - ) && - ( - this.ShowInstallmentAmount == input.ShowInstallmentAmount || - this.ShowInstallmentAmount.Equals(input.ShowInstallmentAmount) - ) && - ( - this.ShowRemovePaymentMethodButton == input.ShowRemovePaymentMethodButton || - this.ShowRemovePaymentMethodButton.Equals(input.ShowRemovePaymentMethodButton) - ) && - ( - this.SocialSecurityNumber == input.SocialSecurityNumber || - (this.SocialSecurityNumber != null && - this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) - ) && - ( - this.SplitCardFundingSources == input.SplitCardFundingSources || - this.SplitCardFundingSources.Equals(input.SplitCardFundingSources) - ) && - ( - this.Splits == input.Splits || - this.Splits != null && - input.Splits != null && - this.Splits.SequenceEqual(input.Splits) - ) && - ( - this.Store == input.Store || - (this.Store != null && - this.Store.Equals(input.Store)) - ) && - ( - this.StoreFiltrationMode == input.StoreFiltrationMode || - this.StoreFiltrationMode.Equals(input.StoreFiltrationMode) - ) && - ( - this.StorePaymentMethod == input.StorePaymentMethod || - this.StorePaymentMethod.Equals(input.StorePaymentMethod) - ) && - ( - this.StorePaymentMethodMode == input.StorePaymentMethodMode || - this.StorePaymentMethodMode.Equals(input.StorePaymentMethodMode) - ) && - ( - this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) - ) && - ( - this.ThemeId == input.ThemeId || - (this.ThemeId != null && - this.ThemeId.Equals(input.ThemeId)) - ) && - ( - this.ThreeDS2RequestData == input.ThreeDS2RequestData || - (this.ThreeDS2RequestData != null && - this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) - ) && - ( - this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || - this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) - ) && - ( - this.TrustedShopper == input.TrustedShopper || - this.TrustedShopper.Equals(input.TrustedShopper) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) + Id == input.Id || + (Id != null && + Id.Equals(input.Id)) ); } @@ -1194,244 +1605,999 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.AccountInfo != null) - { - hashCode = (hashCode * 59) + this.AccountInfo.GetHashCode(); - } - if (this.AdditionalAmount != null) - { - hashCode = (hashCode * 59) + this.AdditionalAmount.GetHashCode(); - } - if (this.AdditionalData != null) - { - hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); - } - if (this.AllowedPaymentMethods != null) - { - hashCode = (hashCode * 59) + this.AllowedPaymentMethods.GetHashCode(); - } - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.ApplicationInfo != null) - { - hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); - } - if (this.AuthenticationData != null) - { - hashCode = (hashCode * 59) + this.AuthenticationData.GetHashCode(); - } - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.BlockedPaymentMethods != null) - { - hashCode = (hashCode * 59) + this.BlockedPaymentMethods.GetHashCode(); - } - hashCode = (hashCode * 59) + this.CaptureDelayHours.GetHashCode(); - hashCode = (hashCode * 59) + this.Channel.GetHashCode(); - if (this.Company != null) - { - hashCode = (hashCode * 59) + this.Company.GetHashCode(); - } - if (this.CountryCode != null) - { - hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); - } - if (this.DateOfBirth != null) - { - hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); - } - if (this.DeliverAt != null) - { - hashCode = (hashCode * 59) + this.DeliverAt.GetHashCode(); - } - if (this.DeliveryAddress != null) - { - hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); - } - hashCode = (hashCode * 59) + this.EnableOneClick.GetHashCode(); - hashCode = (hashCode * 59) + this.EnablePayOut.GetHashCode(); - hashCode = (hashCode * 59) + this.EnableRecurring.GetHashCode(); - if (this.ExpiresAt != null) - { - hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); - } - if (this.FundOrigin != null) - { - hashCode = (hashCode * 59) + this.FundOrigin.GetHashCode(); - } - if (this.FundRecipient != null) - { - hashCode = (hashCode * 59) + this.FundRecipient.GetHashCode(); - } - if (this.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - if (this.InstallmentOptions != null) - { - hashCode = (hashCode * 59) + this.InstallmentOptions.GetHashCode(); - } - if (this.LineItems != null) - { - hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); - } - if (this.Mandate != null) - { - hashCode = (hashCode * 59) + this.Mandate.GetHashCode(); - } - if (this.Mcc != null) - { - hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.MerchantOrderReference != null) - { - hashCode = (hashCode * 59) + this.MerchantOrderReference.GetHashCode(); - } - if (this.Metadata != null) - { - hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Mode.GetHashCode(); - if (this.MpiData != null) - { - hashCode = (hashCode * 59) + this.MpiData.GetHashCode(); - } - if (this.PlatformChargebackLogic != null) - { - hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); - } - if (this.RecurringExpiry != null) - { - hashCode = (hashCode * 59) + this.RecurringExpiry.GetHashCode(); - } - if (this.RecurringFrequency != null) - { - hashCode = (hashCode * 59) + this.RecurringFrequency.GetHashCode(); - } - hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); - if (this.RedirectFromIssuerMethod != null) - { - hashCode = (hashCode * 59) + this.RedirectFromIssuerMethod.GetHashCode(); - } - if (this.RedirectToIssuerMethod != null) - { - hashCode = (hashCode * 59) + this.RedirectToIssuerMethod.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.ReturnUrl != null) - { - hashCode = (hashCode * 59) + this.ReturnUrl.GetHashCode(); - } - if (this.RiskData != null) - { - hashCode = (hashCode * 59) + this.RiskData.GetHashCode(); - } - if (this.SessionData != null) - { - hashCode = (hashCode * 59) + this.SessionData.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.ShopperIP != null) - { - hashCode = (hashCode * 59) + this.ShopperIP.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ShopperInteraction.GetHashCode(); - if (this.ShopperLocale != null) - { - hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); - } - if (this.ShopperName != null) - { - hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); - } - if (this.ShopperReference != null) - { - hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); - } - if (this.ShopperStatement != null) - { - hashCode = (hashCode * 59) + this.ShopperStatement.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ShowInstallmentAmount.GetHashCode(); - hashCode = (hashCode * 59) + this.ShowRemovePaymentMethodButton.GetHashCode(); - if (this.SocialSecurityNumber != null) - { - hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); - } - hashCode = (hashCode * 59) + this.SplitCardFundingSources.GetHashCode(); - if (this.Splits != null) - { - hashCode = (hashCode * 59) + this.Splits.GetHashCode(); - } - if (this.Store != null) - { - hashCode = (hashCode * 59) + this.Store.GetHashCode(); - } - hashCode = (hashCode * 59) + this.StoreFiltrationMode.GetHashCode(); - hashCode = (hashCode * 59) + this.StorePaymentMethod.GetHashCode(); - hashCode = (hashCode * 59) + this.StorePaymentMethodMode.GetHashCode(); - if (this.TelephoneNumber != null) - { - hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); - } - if (this.ThemeId != null) - { - hashCode = (hashCode * 59) + this.ThemeId.GetHashCode(); - } - if (this.ThreeDS2RequestData != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ThreeDSAuthenticationOnly.GetHashCode(); - hashCode = (hashCode * 59) + this.TrustedShopper.GetHashCode(); - if (this.Url != null) - { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); - } + hashCode = (hashCode * 59) + Id.GetHashCode(); + return hashCode; } } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // ReturnUrl (string) maxLength if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); + yield return new ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); } // ShopperReference (string) maxLength if (this.ShopperReference != null && this.ShopperReference.Length > 256) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); } // ShopperReference (string) minLength if (this.ShopperReference != null && this.ShopperReference.Length < 3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); } yield break; } } + /// + /// A Json converter for type + /// + public class CreateCheckoutSessionResponseJsonConverter : JsonConverter + { + /// + /// The format to use to serialize ExpiresAt + /// + public static string ExpiresAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize DateOfBirth + /// + public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize DeliverAt + /// + public static string DeliverAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override CreateCheckoutSessionResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option expiresAt = default; + Option id = default; + Option merchantAccount = default; + Option reference = default; + Option returnUrl = default; + Option accountInfo = default; + Option additionalAmount = default; + Option> additionalData = default; + Option> allowedPaymentMethods = default; + Option applicationInfo = default; + Option authenticationData = default; + Option billingAddress = default; + Option> blockedPaymentMethods = default; + Option captureDelayHours = default; + Option channel = default; + Option company = default; + Option countryCode = default; + Option dateOfBirth = default; + Option deliverAt = default; + Option deliveryAddress = default; + Option enableOneClick = default; + Option enablePayOut = default; + Option enableRecurring = default; + Option fundOrigin = default; + Option fundRecipient = default; + Option> installmentOptions = default; + Option> lineItems = default; + Option mandate = default; + Option mcc = default; + Option merchantOrderReference = default; + Option> metadata = default; + Option mode = default; + Option mpiData = default; + Option platformChargebackLogic = default; + Option recurringExpiry = default; + Option recurringFrequency = default; + Option recurringProcessingModel = default; + Option redirectFromIssuerMethod = default; + Option redirectToIssuerMethod = default; + Option riskData = default; + Option sessionData = default; + Option shopperEmail = default; + Option shopperIP = default; + Option shopperInteraction = default; + Option shopperLocale = default; + Option shopperName = default; + Option shopperReference = default; + Option shopperStatement = default; + Option showInstallmentAmount = default; + Option showRemovePaymentMethodButton = default; + Option socialSecurityNumber = default; + Option splitCardFundingSources = default; + Option> splits = default; + Option store = default; + Option storeFiltrationMode = default; + Option storePaymentMethod = default; + Option storePaymentMethodMode = default; + Option telephoneNumber = default; + Option themeId = default; + Option threeDS2RequestData = default; + Option threeDSAuthenticationOnly = default; + Option trustedShopper = default; + Option url = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "expiresAt": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + expiresAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "returnUrl": + returnUrl = new Option(utf8JsonReader.GetString()); + break; + case "accountInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + accountInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "additionalAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "additionalData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "allowedPaymentMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + allowedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "applicationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "authenticationData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + authenticationData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "billingAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + billingAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "blockedPaymentMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + blockedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "captureDelayHours": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + captureDelayHours = new Option(utf8JsonReader.GetInt32()); + break; + case "channel": + string channelRawValue = utf8JsonReader.GetString(); + if (channelRawValue != null) + channel = new Option(CreateCheckoutSessionResponse.ChannelEnumFromStringOrDefault(channelRawValue)); + break; + case "company": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + company = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "countryCode": + countryCode = new Option(utf8JsonReader.GetString()); + break; + case "dateOfBirth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliverAt": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliverAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliveryAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliveryAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "enableOneClick": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enableOneClick = new Option(utf8JsonReader.GetBoolean()); + break; + case "enablePayOut": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enablePayOut = new Option(utf8JsonReader.GetBoolean()); + break; + case "enableRecurring": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enableRecurring = new Option(utf8JsonReader.GetBoolean()); + break; + case "fundOrigin": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fundOrigin = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fundRecipient": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fundRecipient = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "installmentOptions": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + installmentOptions = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "lineItems": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mandate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mandate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mcc": + mcc = new Option(utf8JsonReader.GetString()); + break; + case "merchantOrderReference": + merchantOrderReference = new Option(utf8JsonReader.GetString()); + break; + case "metadata": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mode": + string modeRawValue = utf8JsonReader.GetString(); + if (modeRawValue != null) + mode = new Option(CreateCheckoutSessionResponse.ModeEnumFromStringOrDefault(modeRawValue)); + break; + case "mpiData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mpiData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "platformChargebackLogic": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "recurringExpiry": + recurringExpiry = new Option(utf8JsonReader.GetString()); + break; + case "recurringFrequency": + recurringFrequency = new Option(utf8JsonReader.GetString()); + break; + case "recurringProcessingModel": + string recurringProcessingModelRawValue = utf8JsonReader.GetString(); + if (recurringProcessingModelRawValue != null) + recurringProcessingModel = new Option(CreateCheckoutSessionResponse.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); + break; + case "redirectFromIssuerMethod": + redirectFromIssuerMethod = new Option(utf8JsonReader.GetString()); + break; + case "redirectToIssuerMethod": + redirectToIssuerMethod = new Option(utf8JsonReader.GetString()); + break; + case "riskData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + riskData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "sessionData": + sessionData = new Option(utf8JsonReader.GetString()); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "shopperIP": + shopperIP = new Option(utf8JsonReader.GetString()); + break; + case "shopperInteraction": + string shopperInteractionRawValue = utf8JsonReader.GetString(); + if (shopperInteractionRawValue != null) + shopperInteraction = new Option(CreateCheckoutSessionResponse.ShopperInteractionEnumFromStringOrDefault(shopperInteractionRawValue)); + break; + case "shopperLocale": + shopperLocale = new Option(utf8JsonReader.GetString()); + break; + case "shopperName": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperReference": + shopperReference = new Option(utf8JsonReader.GetString()); + break; + case "shopperStatement": + shopperStatement = new Option(utf8JsonReader.GetString()); + break; + case "showInstallmentAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + showInstallmentAmount = new Option(utf8JsonReader.GetBoolean()); + break; + case "showRemovePaymentMethodButton": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + showRemovePaymentMethodButton = new Option(utf8JsonReader.GetBoolean()); + break; + case "socialSecurityNumber": + socialSecurityNumber = new Option(utf8JsonReader.GetString()); + break; + case "splitCardFundingSources": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splitCardFundingSources = new Option(utf8JsonReader.GetBoolean()); + break; + case "splits": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "store": + store = new Option(utf8JsonReader.GetString()); + break; + case "storeFiltrationMode": + string storeFiltrationModeRawValue = utf8JsonReader.GetString(); + if (storeFiltrationModeRawValue != null) + storeFiltrationMode = new Option(CreateCheckoutSessionResponse.StoreFiltrationModeEnumFromStringOrDefault(storeFiltrationModeRawValue)); + break; + case "storePaymentMethod": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + storePaymentMethod = new Option(utf8JsonReader.GetBoolean()); + break; + case "storePaymentMethodMode": + string storePaymentMethodModeRawValue = utf8JsonReader.GetString(); + if (storePaymentMethodModeRawValue != null) + storePaymentMethodMode = new Option(CreateCheckoutSessionResponse.StorePaymentMethodModeEnumFromStringOrDefault(storePaymentMethodModeRawValue)); + break; + case "telephoneNumber": + telephoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "themeId": + themeId = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2RequestData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDSAuthenticationOnly": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDSAuthenticationOnly = new Option(utf8JsonReader.GetBoolean()); + break; + case "trustedShopper": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + trustedShopper = new Option(utf8JsonReader.GetBoolean()); + break; + case "url": + url = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class CreateCheckoutSessionResponse.", nameof(amount)); + + if (!expiresAt.IsSet) + throw new ArgumentException("Property is required for class CreateCheckoutSessionResponse.", nameof(expiresAt)); + + if (!id.IsSet) + throw new ArgumentException("Property is required for class CreateCheckoutSessionResponse.", nameof(id)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class CreateCheckoutSessionResponse.", nameof(merchantAccount)); + + if (!reference.IsSet) + throw new ArgumentException("Property is required for class CreateCheckoutSessionResponse.", nameof(reference)); + + if (!returnUrl.IsSet) + throw new ArgumentException("Property is required for class CreateCheckoutSessionResponse.", nameof(returnUrl)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (expiresAt.IsSet && expiresAt.Value == null) + throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (returnUrl.IsSet && returnUrl.Value == null) + throw new ArgumentNullException(nameof(returnUrl), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (accountInfo.IsSet && accountInfo.Value == null) + throw new ArgumentNullException(nameof(accountInfo), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (additionalAmount.IsSet && additionalAmount.Value == null) + throw new ArgumentNullException(nameof(additionalAmount), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (additionalData.IsSet && additionalData.Value == null) + throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (allowedPaymentMethods.IsSet && allowedPaymentMethods.Value == null) + throw new ArgumentNullException(nameof(allowedPaymentMethods), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (applicationInfo.IsSet && applicationInfo.Value == null) + throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (authenticationData.IsSet && authenticationData.Value == null) + throw new ArgumentNullException(nameof(authenticationData), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (blockedPaymentMethods.IsSet && blockedPaymentMethods.Value == null) + throw new ArgumentNullException(nameof(blockedPaymentMethods), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (captureDelayHours.IsSet && captureDelayHours.Value == null) + throw new ArgumentNullException(nameof(captureDelayHours), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (channel.IsSet && channel.Value == null) + throw new ArgumentNullException(nameof(channel), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (company.IsSet && company.Value == null) + throw new ArgumentNullException(nameof(company), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (countryCode.IsSet && countryCode.Value == null) + throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (dateOfBirth.IsSet && dateOfBirth.Value == null) + throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (deliverAt.IsSet && deliverAt.Value == null) + throw new ArgumentNullException(nameof(deliverAt), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (deliveryAddress.IsSet && deliveryAddress.Value == null) + throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (enableOneClick.IsSet && enableOneClick.Value == null) + throw new ArgumentNullException(nameof(enableOneClick), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (enablePayOut.IsSet && enablePayOut.Value == null) + throw new ArgumentNullException(nameof(enablePayOut), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (enableRecurring.IsSet && enableRecurring.Value == null) + throw new ArgumentNullException(nameof(enableRecurring), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (fundOrigin.IsSet && fundOrigin.Value == null) + throw new ArgumentNullException(nameof(fundOrigin), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (fundRecipient.IsSet && fundRecipient.Value == null) + throw new ArgumentNullException(nameof(fundRecipient), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (installmentOptions.IsSet && installmentOptions.Value == null) + throw new ArgumentNullException(nameof(installmentOptions), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (lineItems.IsSet && lineItems.Value == null) + throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (mandate.IsSet && mandate.Value == null) + throw new ArgumentNullException(nameof(mandate), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (mcc.IsSet && mcc.Value == null) + throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (merchantOrderReference.IsSet && merchantOrderReference.Value == null) + throw new ArgumentNullException(nameof(merchantOrderReference), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (metadata.IsSet && metadata.Value == null) + throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (mode.IsSet && mode.Value == null) + throw new ArgumentNullException(nameof(mode), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (mpiData.IsSet && mpiData.Value == null) + throw new ArgumentNullException(nameof(mpiData), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) + throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (recurringExpiry.IsSet && recurringExpiry.Value == null) + throw new ArgumentNullException(nameof(recurringExpiry), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (recurringFrequency.IsSet && recurringFrequency.Value == null) + throw new ArgumentNullException(nameof(recurringFrequency), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) + throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (redirectFromIssuerMethod.IsSet && redirectFromIssuerMethod.Value == null) + throw new ArgumentNullException(nameof(redirectFromIssuerMethod), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (redirectToIssuerMethod.IsSet && redirectToIssuerMethod.Value == null) + throw new ArgumentNullException(nameof(redirectToIssuerMethod), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (riskData.IsSet && riskData.Value == null) + throw new ArgumentNullException(nameof(riskData), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (sessionData.IsSet && sessionData.Value == null) + throw new ArgumentNullException(nameof(sessionData), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (shopperIP.IsSet && shopperIP.Value == null) + throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (shopperInteraction.IsSet && shopperInteraction.Value == null) + throw new ArgumentNullException(nameof(shopperInteraction), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (shopperLocale.IsSet && shopperLocale.Value == null) + throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (shopperName.IsSet && shopperName.Value == null) + throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (shopperStatement.IsSet && shopperStatement.Value == null) + throw new ArgumentNullException(nameof(shopperStatement), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (showInstallmentAmount.IsSet && showInstallmentAmount.Value == null) + throw new ArgumentNullException(nameof(showInstallmentAmount), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (showRemovePaymentMethodButton.IsSet && showRemovePaymentMethodButton.Value == null) + throw new ArgumentNullException(nameof(showRemovePaymentMethodButton), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) + throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (splitCardFundingSources.IsSet && splitCardFundingSources.Value == null) + throw new ArgumentNullException(nameof(splitCardFundingSources), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (splits.IsSet && splits.Value == null) + throw new ArgumentNullException(nameof(splits), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (store.IsSet && store.Value == null) + throw new ArgumentNullException(nameof(store), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (storeFiltrationMode.IsSet && storeFiltrationMode.Value == null) + throw new ArgumentNullException(nameof(storeFiltrationMode), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (storePaymentMethod.IsSet && storePaymentMethod.Value == null) + throw new ArgumentNullException(nameof(storePaymentMethod), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (storePaymentMethodMode.IsSet && storePaymentMethodMode.Value == null) + throw new ArgumentNullException(nameof(storePaymentMethodMode), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (telephoneNumber.IsSet && telephoneNumber.Value == null) + throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (themeId.IsSet && themeId.Value == null) + throw new ArgumentNullException(nameof(themeId), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) + throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (threeDSAuthenticationOnly.IsSet && threeDSAuthenticationOnly.Value == null) + throw new ArgumentNullException(nameof(threeDSAuthenticationOnly), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (trustedShopper.IsSet && trustedShopper.Value == null) + throw new ArgumentNullException(nameof(trustedShopper), "Property is not nullable for class CreateCheckoutSessionResponse."); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url), "Property is not nullable for class CreateCheckoutSessionResponse."); + + return new CreateCheckoutSessionResponse(amount.Value, expiresAt.Value.Value, id.Value, merchantAccount.Value, reference.Value, returnUrl.Value, accountInfo, additionalAmount, additionalData, allowedPaymentMethods, applicationInfo, authenticationData, billingAddress, blockedPaymentMethods, captureDelayHours, channel, company, countryCode, dateOfBirth, deliverAt, deliveryAddress, enableOneClick, enablePayOut, enableRecurring, fundOrigin, fundRecipient, installmentOptions, lineItems, mandate, mcc, merchantOrderReference, metadata, mode, mpiData, platformChargebackLogic, recurringExpiry, recurringFrequency, recurringProcessingModel, redirectFromIssuerMethod, redirectToIssuerMethod, riskData, sessionData, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, showInstallmentAmount, showRemovePaymentMethodButton, socialSecurityNumber, splitCardFundingSources, splits, store, storeFiltrationMode, storePaymentMethod, storePaymentMethodMode, telephoneNumber, themeId, threeDS2RequestData, threeDSAuthenticationOnly, trustedShopper, url); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CreateCheckoutSessionResponse createCheckoutSessionResponse, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, createCheckoutSessionResponse, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CreateCheckoutSessionResponse createCheckoutSessionResponse, JsonSerializerOptions jsonSerializerOptions) + { + if (createCheckoutSessionResponse.Amount == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Amount), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.Id == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Id), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.MerchantAccount == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.MerchantAccount), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.Reference == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Reference), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.ReturnUrl == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ReturnUrl), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.AccountInfoOption.IsSet && createCheckoutSessionResponse.AccountInfo == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.AccountInfo), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.AdditionalAmountOption.IsSet && createCheckoutSessionResponse.AdditionalAmount == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.AdditionalAmount), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.AdditionalDataOption.IsSet && createCheckoutSessionResponse.AdditionalData == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.AdditionalData), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.AllowedPaymentMethodsOption.IsSet && createCheckoutSessionResponse.AllowedPaymentMethods == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.AllowedPaymentMethods), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.ApplicationInfoOption.IsSet && createCheckoutSessionResponse.ApplicationInfo == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ApplicationInfo), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.AuthenticationDataOption.IsSet && createCheckoutSessionResponse.AuthenticationData == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.AuthenticationData), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.BillingAddressOption.IsSet && createCheckoutSessionResponse.BillingAddress == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.BillingAddress), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.BlockedPaymentMethodsOption.IsSet && createCheckoutSessionResponse.BlockedPaymentMethods == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.BlockedPaymentMethods), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.CompanyOption.IsSet && createCheckoutSessionResponse.Company == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Company), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.CountryCodeOption.IsSet && createCheckoutSessionResponse.CountryCode == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.CountryCode), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.DeliveryAddressOption.IsSet && createCheckoutSessionResponse.DeliveryAddress == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.DeliveryAddress), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.FundOriginOption.IsSet && createCheckoutSessionResponse.FundOrigin == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.FundOrigin), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.FundRecipientOption.IsSet && createCheckoutSessionResponse.FundRecipient == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.FundRecipient), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.InstallmentOptionsOption.IsSet && createCheckoutSessionResponse.InstallmentOptions == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.InstallmentOptions), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.LineItemsOption.IsSet && createCheckoutSessionResponse.LineItems == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.LineItems), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.MandateOption.IsSet && createCheckoutSessionResponse.Mandate == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Mandate), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.MccOption.IsSet && createCheckoutSessionResponse.Mcc == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Mcc), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.MerchantOrderReferenceOption.IsSet && createCheckoutSessionResponse.MerchantOrderReference == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.MerchantOrderReference), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.MetadataOption.IsSet && createCheckoutSessionResponse.Metadata == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Metadata), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.MpiDataOption.IsSet && createCheckoutSessionResponse.MpiData == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.MpiData), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.PlatformChargebackLogicOption.IsSet && createCheckoutSessionResponse.PlatformChargebackLogic == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.PlatformChargebackLogic), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.RecurringExpiryOption.IsSet && createCheckoutSessionResponse.RecurringExpiry == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.RecurringExpiry), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.RecurringFrequencyOption.IsSet && createCheckoutSessionResponse.RecurringFrequency == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.RecurringFrequency), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.RedirectFromIssuerMethodOption.IsSet && createCheckoutSessionResponse.RedirectFromIssuerMethod == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.RedirectFromIssuerMethod), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.RedirectToIssuerMethodOption.IsSet && createCheckoutSessionResponse.RedirectToIssuerMethod == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.RedirectToIssuerMethod), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.RiskDataOption.IsSet && createCheckoutSessionResponse.RiskData == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.RiskData), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.SessionDataOption.IsSet && createCheckoutSessionResponse.SessionData == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.SessionData), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.ShopperEmailOption.IsSet && createCheckoutSessionResponse.ShopperEmail == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ShopperEmail), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.ShopperIPOption.IsSet && createCheckoutSessionResponse.ShopperIP == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ShopperIP), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.ShopperLocaleOption.IsSet && createCheckoutSessionResponse.ShopperLocale == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ShopperLocale), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.ShopperNameOption.IsSet && createCheckoutSessionResponse.ShopperName == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ShopperName), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.ShopperReferenceOption.IsSet && createCheckoutSessionResponse.ShopperReference == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ShopperReference), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.ShopperStatementOption.IsSet && createCheckoutSessionResponse.ShopperStatement == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ShopperStatement), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.SocialSecurityNumberOption.IsSet && createCheckoutSessionResponse.SocialSecurityNumber == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.SocialSecurityNumber), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.SplitsOption.IsSet && createCheckoutSessionResponse.Splits == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Splits), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.StoreOption.IsSet && createCheckoutSessionResponse.Store == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Store), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.TelephoneNumberOption.IsSet && createCheckoutSessionResponse.TelephoneNumber == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.TelephoneNumber), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.ThemeIdOption.IsSet && createCheckoutSessionResponse.ThemeId == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ThemeId), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.ThreeDS2RequestDataOption.IsSet && createCheckoutSessionResponse.ThreeDS2RequestData == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ThreeDS2RequestData), "Property is required for class CreateCheckoutSessionResponse."); + + if (createCheckoutSessionResponse.UrlOption.IsSet && createCheckoutSessionResponse.Url == null) + throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Url), "Property is required for class CreateCheckoutSessionResponse."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.Amount, jsonSerializerOptions); + writer.WriteString("expiresAt", createCheckoutSessionResponse.ExpiresAt.ToString(ExpiresAtFormat)); + + writer.WriteString("id", createCheckoutSessionResponse.Id); + + writer.WriteString("merchantAccount", createCheckoutSessionResponse.MerchantAccount); + + writer.WriteString("reference", createCheckoutSessionResponse.Reference); + + writer.WriteString("returnUrl", createCheckoutSessionResponse.ReturnUrl); + + if (createCheckoutSessionResponse.AccountInfoOption.IsSet) + { + writer.WritePropertyName("accountInfo"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.AccountInfo, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.AdditionalAmountOption.IsSet) + { + writer.WritePropertyName("additionalAmount"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.AdditionalAmount, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.AdditionalDataOption.IsSet) + { + writer.WritePropertyName("additionalData"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.AdditionalData, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.AllowedPaymentMethodsOption.IsSet) + { + writer.WritePropertyName("allowedPaymentMethods"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.AllowedPaymentMethods, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.ApplicationInfoOption.IsSet) + { + writer.WritePropertyName("applicationInfo"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.ApplicationInfo, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.AuthenticationDataOption.IsSet) + { + writer.WritePropertyName("authenticationData"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.AuthenticationData, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.BillingAddressOption.IsSet) + { + writer.WritePropertyName("billingAddress"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.BillingAddress, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.BlockedPaymentMethodsOption.IsSet) + { + writer.WritePropertyName("blockedPaymentMethods"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.BlockedPaymentMethods, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.CaptureDelayHoursOption.IsSet) + writer.WriteNumber("captureDelayHours", createCheckoutSessionResponse.CaptureDelayHoursOption.Value.Value); + + var channelRawValue = CreateCheckoutSessionResponse.ChannelEnumToJsonValue(createCheckoutSessionResponse.ChannelOption.Value.Value); + writer.WriteString("channel", channelRawValue); + if (createCheckoutSessionResponse.CompanyOption.IsSet) + { + writer.WritePropertyName("company"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.Company, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.CountryCodeOption.IsSet) + writer.WriteString("countryCode", createCheckoutSessionResponse.CountryCode); + + if (createCheckoutSessionResponse.DateOfBirthOption.IsSet) + writer.WriteString("dateOfBirth", createCheckoutSessionResponse.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); + + if (createCheckoutSessionResponse.DeliverAtOption.IsSet) + writer.WriteString("deliverAt", createCheckoutSessionResponse.DeliverAtOption.Value.Value.ToString(DeliverAtFormat)); + + if (createCheckoutSessionResponse.DeliveryAddressOption.IsSet) + { + writer.WritePropertyName("deliveryAddress"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.DeliveryAddress, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.EnableOneClickOption.IsSet) + writer.WriteBoolean("enableOneClick", createCheckoutSessionResponse.EnableOneClickOption.Value.Value); + + if (createCheckoutSessionResponse.EnablePayOutOption.IsSet) + writer.WriteBoolean("enablePayOut", createCheckoutSessionResponse.EnablePayOutOption.Value.Value); + + if (createCheckoutSessionResponse.EnableRecurringOption.IsSet) + writer.WriteBoolean("enableRecurring", createCheckoutSessionResponse.EnableRecurringOption.Value.Value); + + if (createCheckoutSessionResponse.FundOriginOption.IsSet) + { + writer.WritePropertyName("fundOrigin"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.FundOrigin, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.FundRecipientOption.IsSet) + { + writer.WritePropertyName("fundRecipient"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.FundRecipient, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.InstallmentOptionsOption.IsSet) + { + writer.WritePropertyName("installmentOptions"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.InstallmentOptions, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.LineItemsOption.IsSet) + { + writer.WritePropertyName("lineItems"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.LineItems, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.MandateOption.IsSet) + { + writer.WritePropertyName("mandate"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.Mandate, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.MccOption.IsSet) + writer.WriteString("mcc", createCheckoutSessionResponse.Mcc); + + if (createCheckoutSessionResponse.MerchantOrderReferenceOption.IsSet) + writer.WriteString("merchantOrderReference", createCheckoutSessionResponse.MerchantOrderReference); + + if (createCheckoutSessionResponse.MetadataOption.IsSet) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.Metadata, jsonSerializerOptions); + } + var modeRawValue = CreateCheckoutSessionResponse.ModeEnumToJsonValue(createCheckoutSessionResponse.ModeOption.Value.Value); + writer.WriteString("mode", modeRawValue); + if (createCheckoutSessionResponse.MpiDataOption.IsSet) + { + writer.WritePropertyName("mpiData"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.MpiData, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.PlatformChargebackLogicOption.IsSet) + { + writer.WritePropertyName("platformChargebackLogic"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.PlatformChargebackLogic, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.RecurringExpiryOption.IsSet) + writer.WriteString("recurringExpiry", createCheckoutSessionResponse.RecurringExpiry); + + if (createCheckoutSessionResponse.RecurringFrequencyOption.IsSet) + writer.WriteString("recurringFrequency", createCheckoutSessionResponse.RecurringFrequency); + + var recurringProcessingModelRawValue = CreateCheckoutSessionResponse.RecurringProcessingModelEnumToJsonValue(createCheckoutSessionResponse.RecurringProcessingModelOption.Value.Value); + writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); + if (createCheckoutSessionResponse.RedirectFromIssuerMethodOption.IsSet) + writer.WriteString("redirectFromIssuerMethod", createCheckoutSessionResponse.RedirectFromIssuerMethod); + + if (createCheckoutSessionResponse.RedirectToIssuerMethodOption.IsSet) + writer.WriteString("redirectToIssuerMethod", createCheckoutSessionResponse.RedirectToIssuerMethod); + + if (createCheckoutSessionResponse.RiskDataOption.IsSet) + { + writer.WritePropertyName("riskData"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.RiskData, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.SessionDataOption.IsSet) + writer.WriteString("sessionData", createCheckoutSessionResponse.SessionData); + + if (createCheckoutSessionResponse.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", createCheckoutSessionResponse.ShopperEmail); + + if (createCheckoutSessionResponse.ShopperIPOption.IsSet) + writer.WriteString("shopperIP", createCheckoutSessionResponse.ShopperIP); + + var shopperInteractionRawValue = CreateCheckoutSessionResponse.ShopperInteractionEnumToJsonValue(createCheckoutSessionResponse.ShopperInteractionOption.Value.Value); + writer.WriteString("shopperInteraction", shopperInteractionRawValue); + if (createCheckoutSessionResponse.ShopperLocaleOption.IsSet) + writer.WriteString("shopperLocale", createCheckoutSessionResponse.ShopperLocale); + + if (createCheckoutSessionResponse.ShopperNameOption.IsSet) + { + writer.WritePropertyName("shopperName"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.ShopperName, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.ShopperReferenceOption.IsSet) + writer.WriteString("shopperReference", createCheckoutSessionResponse.ShopperReference); + + if (createCheckoutSessionResponse.ShopperStatementOption.IsSet) + writer.WriteString("shopperStatement", createCheckoutSessionResponse.ShopperStatement); + + if (createCheckoutSessionResponse.ShowInstallmentAmountOption.IsSet) + writer.WriteBoolean("showInstallmentAmount", createCheckoutSessionResponse.ShowInstallmentAmountOption.Value.Value); + + if (createCheckoutSessionResponse.ShowRemovePaymentMethodButtonOption.IsSet) + writer.WriteBoolean("showRemovePaymentMethodButton", createCheckoutSessionResponse.ShowRemovePaymentMethodButtonOption.Value.Value); + + if (createCheckoutSessionResponse.SocialSecurityNumberOption.IsSet) + writer.WriteString("socialSecurityNumber", createCheckoutSessionResponse.SocialSecurityNumber); + + if (createCheckoutSessionResponse.SplitCardFundingSourcesOption.IsSet) + writer.WriteBoolean("splitCardFundingSources", createCheckoutSessionResponse.SplitCardFundingSourcesOption.Value.Value); + + if (createCheckoutSessionResponse.SplitsOption.IsSet) + { + writer.WritePropertyName("splits"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.Splits, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.StoreOption.IsSet) + writer.WriteString("store", createCheckoutSessionResponse.Store); + + var storeFiltrationModeRawValue = CreateCheckoutSessionResponse.StoreFiltrationModeEnumToJsonValue(createCheckoutSessionResponse.StoreFiltrationModeOption.Value.Value); + writer.WriteString("storeFiltrationMode", storeFiltrationModeRawValue); + if (createCheckoutSessionResponse.StorePaymentMethodOption.IsSet) + writer.WriteBoolean("storePaymentMethod", createCheckoutSessionResponse.StorePaymentMethodOption.Value.Value); + + var storePaymentMethodModeRawValue = CreateCheckoutSessionResponse.StorePaymentMethodModeEnumToJsonValue(createCheckoutSessionResponse.StorePaymentMethodModeOption.Value.Value); + writer.WriteString("storePaymentMethodMode", storePaymentMethodModeRawValue); + if (createCheckoutSessionResponse.TelephoneNumberOption.IsSet) + writer.WriteString("telephoneNumber", createCheckoutSessionResponse.TelephoneNumber); + + if (createCheckoutSessionResponse.ThemeIdOption.IsSet) + writer.WriteString("themeId", createCheckoutSessionResponse.ThemeId); + + if (createCheckoutSessionResponse.ThreeDS2RequestDataOption.IsSet) + { + writer.WritePropertyName("threeDS2RequestData"); + JsonSerializer.Serialize(writer, createCheckoutSessionResponse.ThreeDS2RequestData, jsonSerializerOptions); + } + if (createCheckoutSessionResponse.ThreeDSAuthenticationOnlyOption.IsSet) + writer.WriteBoolean("threeDSAuthenticationOnly", createCheckoutSessionResponse.ThreeDSAuthenticationOnlyOption.Value.Value); + + if (createCheckoutSessionResponse.TrustedShopperOption.IsSet) + writer.WriteBoolean("trustedShopper", createCheckoutSessionResponse.TrustedShopperOption.Value.Value); + + if (createCheckoutSessionResponse.UrlOption.IsSet) + writer.WriteString("url", createCheckoutSessionResponse.Url); + } + } } diff --git a/Adyen/Model/Checkout/CreateOrderRequest.cs b/Adyen/Model/Checkout/CreateOrderRequest.cs index 383c79ee2..0831f378a 100644 --- a/Adyen/Model/Checkout/CreateOrderRequest.cs +++ b/Adyen/Model/Checkout/CreateOrderRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,70 +14,73 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CreateOrderRequest /// - [DataContract(Name = "CreateOrderRequest")] - public partial class CreateOrderRequest : IEquatable, IValidatableObject + public partial class CreateOrderRequest : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected CreateOrderRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// amount (required). - /// The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.. - /// The merchant account identifier, with which you want to process the order. (required). - /// A custom reference identifying the order. (required). - public CreateOrderRequest(Amount amount = default(Amount), string expiresAt = default(string), string merchantAccount = default(string), string reference = default(string)) + /// amount + /// The merchant account identifier, with which you want to process the order. + /// A custom reference identifying the order. + /// The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + [JsonConstructor] + public CreateOrderRequest(Amount amount, string merchantAccount, string reference, Option expiresAt = default) { - this.Amount = amount; - this.MerchantAccount = merchantAccount; - this.Reference = reference; - this.ExpiresAt = expiresAt; + Amount = amount; + MerchantAccount = merchantAccount; + Reference = reference; + ExpiresAtOption = expiresAt; + OnCreated(); } + partial void OnCreated(); + /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("amount")] public Amount Amount { get; set; } - /// - /// The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - /// - /// The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [DataMember(Name = "expiresAt", EmitDefaultValue = false)] - public string ExpiresAt { get; set; } - /// /// The merchant account identifier, with which you want to process the order. /// /// The merchant account identifier, with which you want to process the order. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantAccount")] public string MerchantAccount { get; set; } /// /// A custom reference identifying the order. /// /// A custom reference identifying the order. - [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("reference")] public string Reference { get; set; } + /// + /// Used to track the state of ExpiresAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiresAtOption { get; private set; } + + /// + /// The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + /// + /// The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + [JsonPropertyName("expiresAt")] + public string ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -88,103 +90,153 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class CreateOrderRequest {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CreateOrderRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CreateOrderRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CreateOrderRequest); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CreateOrderRequest instances are equal - /// - /// Instance of CreateOrderRequest to be compared - /// Boolean - public bool Equals(CreateOrderRequest input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option merchantAccount = default; + Option reference = default; + Option expiresAt = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "expiresAt": + expiresAt = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.ExpiresAt == input.ExpiresAt || - (this.ExpiresAt != null && - this.ExpiresAt.Equals(input.ExpiresAt)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ); + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class CreateOrderRequest.", nameof(amount)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class CreateOrderRequest.", nameof(merchantAccount)); + + if (!reference.IsSet) + throw new ArgumentException("Property is required for class CreateOrderRequest.", nameof(reference)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class CreateOrderRequest."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class CreateOrderRequest."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CreateOrderRequest."); + + if (expiresAt.IsSet && expiresAt.Value == null) + throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CreateOrderRequest."); + + return new CreateOrderRequest(amount.Value, merchantAccount.Value, reference.Value, expiresAt); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CreateOrderRequest createOrderRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.ExpiresAt != null) - { - hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, createOrderRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CreateOrderRequest createOrderRequest, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (createOrderRequest.Amount == null) + throw new ArgumentNullException(nameof(createOrderRequest.Amount), "Property is required for class CreateOrderRequest."); + + if (createOrderRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(createOrderRequest.MerchantAccount), "Property is required for class CreateOrderRequest."); + + if (createOrderRequest.Reference == null) + throw new ArgumentNullException(nameof(createOrderRequest.Reference), "Property is required for class CreateOrderRequest."); + + if (createOrderRequest.ExpiresAtOption.IsSet && createOrderRequest.ExpiresAt == null) + throw new ArgumentNullException(nameof(createOrderRequest.ExpiresAt), "Property is required for class CreateOrderRequest."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, createOrderRequest.Amount, jsonSerializerOptions); + writer.WriteString("merchantAccount", createOrderRequest.MerchantAccount); + + writer.WriteString("reference", createOrderRequest.Reference); + + if (createOrderRequest.ExpiresAtOption.IsSet) + writer.WriteString("expiresAt", createOrderRequest.ExpiresAt); } } - } diff --git a/Adyen/Model/Checkout/CreateOrderResponse.cs b/Adyen/Model/Checkout/CreateOrderResponse.cs index 00e5cbc82..cd7457879 100644 --- a/Adyen/Model/Checkout/CreateOrderResponse.cs +++ b/Adyen/Model/Checkout/CreateOrderResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,136 +14,205 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// CreateOrderResponse /// - [DataContract(Name = "CreateOrderResponse")] - public partial class CreateOrderResponse : IEquatable, IValidatableObject + public partial class CreateOrderResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The date that the order will expire. + /// The encrypted data that will be used by merchant for adding payments to the order. + /// remainingAmount + /// The result of the order creation request. The value is always **Success**. + /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + /// fraudResult + /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + /// The reference provided by merchant for creating the order. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + [JsonConstructor] + public CreateOrderResponse(Amount amount, string expiresAt, string orderData, Amount remainingAmount, ResultCodeEnum resultCode, Option> additionalData = default, Option fraudResult = default, Option pspReference = default, Option reference = default, Option refusalReason = default) + { + Amount = amount; + ExpiresAt = expiresAt; + OrderData = orderData; + RemainingAmount = remainingAmount; + ResultCode = resultCode; + AdditionalDataOption = additionalData; + FraudResultOption = fraudResult; + PspReferenceOption = pspReference; + ReferenceOption = reference; + RefusalReasonOption = refusalReason; + OnCreated(); + } + + partial void OnCreated(); + /// /// The result of the order creation request. The value is always **Success**. /// /// The result of the order creation request. The value is always **Success**. - [JsonConverter(typeof(StringEnumConverter))] public enum ResultCodeEnum { /// /// Enum Success for value: Success /// - [EnumMember(Value = "Success")] Success = 1 - } - /// - /// The result of the order creation request. The value is always **Success**. + /// Returns a /// - /// The result of the order creation request. The value is always **Success**. - [DataMember(Name = "resultCode", IsRequired = false, EmitDefaultValue = false)] - public ResultCodeEnum ResultCode { get; set; } + /// + /// + /// + public static ResultCodeEnum ResultCodeEnumFromString(string value) + { + if (value.Equals("Success")) + return ResultCodeEnum.Success; + + throw new NotImplementedException($"Could not convert value to type ResultCodeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected CreateOrderResponse() { } + /// + /// + public static ResultCodeEnum? ResultCodeEnumFromStringOrDefault(string value) + { + if (value.Equals("Success")) + return ResultCodeEnum.Success; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**.. - /// amount (required). - /// The date that the order will expire. (required). - /// fraudResult. - /// The encrypted data that will be used by merchant for adding payments to the order. (required). - /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request.. - /// The reference provided by merchant for creating the order.. - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. - /// remainingAmount (required). - /// The result of the order creation request. The value is always **Success**. (required). - public CreateOrderResponse(Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), string expiresAt = default(string), FraudResult fraudResult = default(FraudResult), string orderData = default(string), string pspReference = default(string), string reference = default(string), string refusalReason = default(string), Amount remainingAmount = default(Amount), ResultCodeEnum resultCode = default(ResultCodeEnum)) + /// + /// + /// + public static string ResultCodeEnumToJsonValue(ResultCodeEnum value) { - this.Amount = amount; - this.ExpiresAt = expiresAt; - this.OrderData = orderData; - this.RemainingAmount = remainingAmount; - this.ResultCode = resultCode; - this.AdditionalData = additionalData; - this.FraudResult = fraudResult; - this.PspReference = pspReference; - this.Reference = reference; - this.RefusalReason = refusalReason; + if (value == ResultCodeEnum.Success) + return "Success"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + /// The result of the order creation request. The value is always **Success**. /// - /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - [DataMember(Name = "additionalData", EmitDefaultValue = false)] - public Dictionary AdditionalData { get; set; } + /// The result of the order creation request. The value is always **Success**. + [JsonPropertyName("resultCode")] + public ResultCodeEnum ResultCode { get; set; } /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("amount")] public Amount Amount { get; set; } /// /// The date that the order will expire. /// /// The date that the order will expire. - [DataMember(Name = "expiresAt", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("expiresAt")] public string ExpiresAt { get; set; } + /// + /// The encrypted data that will be used by merchant for adding payments to the order. + /// + /// The encrypted data that will be used by merchant for adding payments to the order. + [JsonPropertyName("orderData")] + public string OrderData { get; set; } + + /// + /// Gets or Sets RemainingAmount + /// + [JsonPropertyName("remainingAmount")] + public Amount RemainingAmount { get; set; } + + /// + /// Used to track the state of AdditionalData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AdditionalDataOption { get; private set; } + + /// + /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + /// + /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + [JsonPropertyName("additionalData")] + public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } + + /// + /// Used to track the state of FraudResult + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FraudResultOption { get; private set; } + /// /// Gets or Sets FraudResult /// - [DataMember(Name = "fraudResult", EmitDefaultValue = false)] - public FraudResult FraudResult { get; set; } + [JsonPropertyName("fraudResult")] + public FraudResult FraudResult { get { return this.FraudResultOption; } set { this.FraudResultOption = new Option(value); } } /// - /// The encrypted data that will be used by merchant for adding payments to the order. + /// Used to track the state of PspReference /// - /// The encrypted data that will be used by merchant for adding payments to the order. - [DataMember(Name = "orderData", IsRequired = false, EmitDefaultValue = false)] - public string OrderData { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PspReferenceOption { get; private set; } /// /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. /// /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - [DataMember(Name = "pspReference", EmitDefaultValue = false)] - public string PspReference { get; set; } + [JsonPropertyName("pspReference")] + public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// The reference provided by merchant for creating the order. /// /// The reference provided by merchant for creating the order. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } /// - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + /// Used to track the state of RefusalReason /// - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [DataMember(Name = "refusalReason", EmitDefaultValue = false)] - public string RefusalReason { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RefusalReasonOption { get; private set; } /// - /// Gets or Sets RemainingAmount + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). /// - [DataMember(Name = "remainingAmount", IsRequired = false, EmitDefaultValue = false)] - public Amount RemainingAmount { get; set; } + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + [JsonPropertyName("refusalReason")] + public string RefusalReason { get { return this.RefusalReasonOption; } set { this.RefusalReasonOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -154,161 +222,248 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CreateOrderResponse {\n"); - sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); - sb.Append(" FraudResult: ").Append(FraudResult).Append("\n"); sb.Append(" OrderData: ").Append(OrderData).Append("\n"); + sb.Append(" RemainingAmount: ").Append(RemainingAmount).Append("\n"); + sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); + sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); + sb.Append(" FraudResult: ").Append(FraudResult).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" RefusalReason: ").Append(RefusalReason).Append("\n"); - sb.Append(" RemainingAmount: ").Append(RemainingAmount).Append("\n"); - sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class CreateOrderResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override CreateOrderResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as CreateOrderResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if CreateOrderResponse instances are equal - /// - /// Instance of CreateOrderResponse to be compared - /// Boolean - public bool Equals(CreateOrderResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option expiresAt = default; + Option orderData = default; + Option remainingAmount = default; + Option resultCode = default; + Option> additionalData = default; + Option fraudResult = default; + Option pspReference = default; + Option reference = default; + Option refusalReason = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "expiresAt": + expiresAt = new Option(utf8JsonReader.GetString()); + break; + case "orderData": + orderData = new Option(utf8JsonReader.GetString()); + break; + case "remainingAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + remainingAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "resultCode": + string resultCodeRawValue = utf8JsonReader.GetString(); + if (resultCodeRawValue != null) + resultCode = new Option(CreateOrderResponse.ResultCodeEnumFromStringOrDefault(resultCodeRawValue)); + break; + case "additionalData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fraudResult": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fraudResult = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "refusalReason": + refusalReason = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AdditionalData == input.AdditionalData || - this.AdditionalData != null && - input.AdditionalData != null && - this.AdditionalData.SequenceEqual(input.AdditionalData) - ) && - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.ExpiresAt == input.ExpiresAt || - (this.ExpiresAt != null && - this.ExpiresAt.Equals(input.ExpiresAt)) - ) && - ( - this.FraudResult == input.FraudResult || - (this.FraudResult != null && - this.FraudResult.Equals(input.FraudResult)) - ) && - ( - this.OrderData == input.OrderData || - (this.OrderData != null && - this.OrderData.Equals(input.OrderData)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.RefusalReason == input.RefusalReason || - (this.RefusalReason != null && - this.RefusalReason.Equals(input.RefusalReason)) - ) && - ( - this.RemainingAmount == input.RemainingAmount || - (this.RemainingAmount != null && - this.RemainingAmount.Equals(input.RemainingAmount)) - ) && - ( - this.ResultCode == input.ResultCode || - this.ResultCode.Equals(input.ResultCode) - ); + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class CreateOrderResponse.", nameof(amount)); + + if (!expiresAt.IsSet) + throw new ArgumentException("Property is required for class CreateOrderResponse.", nameof(expiresAt)); + + if (!orderData.IsSet) + throw new ArgumentException("Property is required for class CreateOrderResponse.", nameof(orderData)); + + if (!remainingAmount.IsSet) + throw new ArgumentException("Property is required for class CreateOrderResponse.", nameof(remainingAmount)); + + if (!resultCode.IsSet) + throw new ArgumentException("Property is required for class CreateOrderResponse.", nameof(resultCode)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class CreateOrderResponse."); + + if (expiresAt.IsSet && expiresAt.Value == null) + throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CreateOrderResponse."); + + if (orderData.IsSet && orderData.Value == null) + throw new ArgumentNullException(nameof(orderData), "Property is not nullable for class CreateOrderResponse."); + + if (remainingAmount.IsSet && remainingAmount.Value == null) + throw new ArgumentNullException(nameof(remainingAmount), "Property is not nullable for class CreateOrderResponse."); + + if (resultCode.IsSet && resultCode.Value == null) + throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class CreateOrderResponse."); + + if (additionalData.IsSet && additionalData.Value == null) + throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class CreateOrderResponse."); + + if (fraudResult.IsSet && fraudResult.Value == null) + throw new ArgumentNullException(nameof(fraudResult), "Property is not nullable for class CreateOrderResponse."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class CreateOrderResponse."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CreateOrderResponse."); + + if (refusalReason.IsSet && refusalReason.Value == null) + throw new ArgumentNullException(nameof(refusalReason), "Property is not nullable for class CreateOrderResponse."); + + return new CreateOrderResponse(amount.Value, expiresAt.Value, orderData.Value, remainingAmount.Value, resultCode.Value.Value, additionalData, fraudResult, pspReference, reference, refusalReason); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, CreateOrderResponse createOrderResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AdditionalData != null) - { - hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); - } - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.ExpiresAt != null) - { - hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); - } - if (this.FraudResult != null) - { - hashCode = (hashCode * 59) + this.FraudResult.GetHashCode(); - } - if (this.OrderData != null) - { - hashCode = (hashCode * 59) + this.OrderData.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.RefusalReason != null) - { - hashCode = (hashCode * 59) + this.RefusalReason.GetHashCode(); - } - if (this.RemainingAmount != null) - { - hashCode = (hashCode * 59) + this.RemainingAmount.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ResultCode.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, createOrderResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, CreateOrderResponse createOrderResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (createOrderResponse.Amount == null) + throw new ArgumentNullException(nameof(createOrderResponse.Amount), "Property is required for class CreateOrderResponse."); + + if (createOrderResponse.ExpiresAt == null) + throw new ArgumentNullException(nameof(createOrderResponse.ExpiresAt), "Property is required for class CreateOrderResponse."); + + if (createOrderResponse.OrderData == null) + throw new ArgumentNullException(nameof(createOrderResponse.OrderData), "Property is required for class CreateOrderResponse."); + + if (createOrderResponse.RemainingAmount == null) + throw new ArgumentNullException(nameof(createOrderResponse.RemainingAmount), "Property is required for class CreateOrderResponse."); + + if (createOrderResponse.AdditionalDataOption.IsSet && createOrderResponse.AdditionalData == null) + throw new ArgumentNullException(nameof(createOrderResponse.AdditionalData), "Property is required for class CreateOrderResponse."); + + if (createOrderResponse.FraudResultOption.IsSet && createOrderResponse.FraudResult == null) + throw new ArgumentNullException(nameof(createOrderResponse.FraudResult), "Property is required for class CreateOrderResponse."); + + if (createOrderResponse.PspReferenceOption.IsSet && createOrderResponse.PspReference == null) + throw new ArgumentNullException(nameof(createOrderResponse.PspReference), "Property is required for class CreateOrderResponse."); + + if (createOrderResponse.ReferenceOption.IsSet && createOrderResponse.Reference == null) + throw new ArgumentNullException(nameof(createOrderResponse.Reference), "Property is required for class CreateOrderResponse."); + + if (createOrderResponse.RefusalReasonOption.IsSet && createOrderResponse.RefusalReason == null) + throw new ArgumentNullException(nameof(createOrderResponse.RefusalReason), "Property is required for class CreateOrderResponse."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, createOrderResponse.Amount, jsonSerializerOptions); + writer.WriteString("expiresAt", createOrderResponse.ExpiresAt); + + writer.WriteString("orderData", createOrderResponse.OrderData); + + writer.WritePropertyName("remainingAmount"); + JsonSerializer.Serialize(writer, createOrderResponse.RemainingAmount, jsonSerializerOptions); + var resultCodeRawValue = CreateOrderResponse.ResultCodeEnumToJsonValue(createOrderResponse.ResultCode); + writer.WriteString("resultCode", resultCodeRawValue); + if (createOrderResponse.AdditionalDataOption.IsSet) + { + writer.WritePropertyName("additionalData"); + JsonSerializer.Serialize(writer, createOrderResponse.AdditionalData, jsonSerializerOptions); + } + if (createOrderResponse.FraudResultOption.IsSet) + { + writer.WritePropertyName("fraudResult"); + JsonSerializer.Serialize(writer, createOrderResponse.FraudResult, jsonSerializerOptions); + } + if (createOrderResponse.PspReferenceOption.IsSet) + writer.WriteString("pspReference", createOrderResponse.PspReference); + + if (createOrderResponse.ReferenceOption.IsSet) + writer.WriteString("reference", createOrderResponse.Reference); + + if (createOrderResponse.RefusalReasonOption.IsSet) + writer.WriteString("refusalReason", createOrderResponse.RefusalReason); } } - } diff --git a/Adyen/Model/Checkout/DeliveryAddress.cs b/Adyen/Model/Checkout/DeliveryAddress.cs index 06985b57d..0b6fdbe66 100644 --- a/Adyen/Model/Checkout/DeliveryAddress.cs +++ b/Adyen/Model/Checkout/DeliveryAddress.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,104 +14,121 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// DeliveryAddress /// - [DataContract(Name = "DeliveryAddress")] - public partial class DeliveryAddress : IEquatable, IValidatableObject + public partial class DeliveryAddress : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected DeliveryAddress() { } - /// - /// Initializes a new instance of the class. - /// - /// The name of the city. Maximum length: 3000 characters. (required). - /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. (required). - /// firstName. - /// The number or name of the house. Maximum length: 3000 characters. (required). - /// lastName. - /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. (required). - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada.. - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. (required). - public DeliveryAddress(string city = default(string), string country = default(string), string firstName = default(string), string houseNumberOrName = default(string), string lastName = default(string), string postalCode = default(string), string stateOrProvince = default(string), string street = default(string)) + /// The name of the city. Maximum length: 3000 characters. + /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + /// The number or name of the house. Maximum length: 3000 characters. + /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + /// firstName + /// lastName + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + [JsonConstructor] + public DeliveryAddress(string city, string country, string houseNumberOrName, string postalCode, string street, Option firstName = default, Option lastName = default, Option stateOrProvince = default) { - this.City = city; - this.Country = country; - this.HouseNumberOrName = houseNumberOrName; - this.PostalCode = postalCode; - this.Street = street; - this.FirstName = firstName; - this.LastName = lastName; - this.StateOrProvince = stateOrProvince; + City = city; + Country = country; + HouseNumberOrName = houseNumberOrName; + PostalCode = postalCode; + Street = street; + FirstNameOption = firstName; + LastNameOption = lastName; + StateOrProvinceOption = stateOrProvince; + OnCreated(); } + partial void OnCreated(); + /// /// The name of the city. Maximum length: 3000 characters. /// /// The name of the city. Maximum length: 3000 characters. - [DataMember(Name = "city", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("city")] public string City { get; set; } /// /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. /// /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. - [DataMember(Name = "country", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("country")] public string Country { get; set; } + /// + /// The number or name of the house. Maximum length: 3000 characters. + /// + /// The number or name of the house. Maximum length: 3000 characters. + [JsonPropertyName("houseNumberOrName")] + public string HouseNumberOrName { get; set; } + + /// + /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + /// + /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + [JsonPropertyName("postalCode")] + public string PostalCode { get; set; } + + /// + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + /// + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + [JsonPropertyName("street")] + public string Street { get; set; } + + /// + /// Used to track the state of FirstName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FirstNameOption { get; private set; } + /// /// Gets or Sets FirstName /// - [DataMember(Name = "firstName", EmitDefaultValue = false)] - public string FirstName { get; set; } + [JsonPropertyName("firstName")] + public string FirstName { get { return this.FirstNameOption; } set { this.FirstNameOption = new Option(value); } } /// - /// The number or name of the house. Maximum length: 3000 characters. + /// Used to track the state of LastName /// - /// The number or name of the house. Maximum length: 3000 characters. - [DataMember(Name = "houseNumberOrName", IsRequired = false, EmitDefaultValue = false)] - public string HouseNumberOrName { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LastNameOption { get; private set; } /// /// Gets or Sets LastName /// - [DataMember(Name = "lastName", EmitDefaultValue = false)] - public string LastName { get; set; } + [JsonPropertyName("lastName")] + public string LastName { get { return this.LastNameOption; } set { this.LastNameOption = new Option(value); } } /// - /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + /// Used to track the state of StateOrProvince /// - /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. - [DataMember(Name = "postalCode", IsRequired = false, EmitDefaultValue = false)] - public string PostalCode { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StateOrProvinceOption { get; private set; } /// /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. /// /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. - [DataMember(Name = "stateOrProvince", EmitDefaultValue = false)] - public string StateOrProvince { get; set; } - - /// - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. - /// - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. - [DataMember(Name = "street", IsRequired = false, EmitDefaultValue = false)] - public string Street { get; set; } + [JsonPropertyName("stateOrProvince")] + public string StateOrProvince { get { return this.StateOrProvinceOption; } set { this.StateOrProvinceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -124,166 +140,235 @@ public override string ToString() sb.Append("class DeliveryAddress {\n"); sb.Append(" City: ").Append(City).Append("\n"); sb.Append(" Country: ").Append(Country).Append("\n"); - sb.Append(" FirstName: ").Append(FirstName).Append("\n"); sb.Append(" HouseNumberOrName: ").Append(HouseNumberOrName).Append("\n"); - sb.Append(" LastName: ").Append(LastName).Append("\n"); sb.Append(" PostalCode: ").Append(PostalCode).Append("\n"); - sb.Append(" StateOrProvince: ").Append(StateOrProvince).Append("\n"); sb.Append(" Street: ").Append(Street).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" StateOrProvince: ").Append(StateOrProvince).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as DeliveryAddress); - } - - /// - /// Returns true if DeliveryAddress instances are equal - /// - /// Instance of DeliveryAddress to be compared - /// Boolean - public bool Equals(DeliveryAddress input) - { - if (input == null) - { - return false; - } - return - ( - this.City == input.City || - (this.City != null && - this.City.Equals(input.City)) - ) && - ( - this.Country == input.Country || - (this.Country != null && - this.Country.Equals(input.Country)) - ) && - ( - this.FirstName == input.FirstName || - (this.FirstName != null && - this.FirstName.Equals(input.FirstName)) - ) && - ( - this.HouseNumberOrName == input.HouseNumberOrName || - (this.HouseNumberOrName != null && - this.HouseNumberOrName.Equals(input.HouseNumberOrName)) - ) && - ( - this.LastName == input.LastName || - (this.LastName != null && - this.LastName.Equals(input.LastName)) - ) && - ( - this.PostalCode == input.PostalCode || - (this.PostalCode != null && - this.PostalCode.Equals(input.PostalCode)) - ) && - ( - this.StateOrProvince == input.StateOrProvince || - (this.StateOrProvince != null && - this.StateOrProvince.Equals(input.StateOrProvince)) - ) && - ( - this.Street == input.Street || - (this.Street != null && - this.Street.Equals(input.Street)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.City != null) - { - hashCode = (hashCode * 59) + this.City.GetHashCode(); - } - if (this.Country != null) - { - hashCode = (hashCode * 59) + this.Country.GetHashCode(); - } - if (this.FirstName != null) - { - hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); - } - if (this.HouseNumberOrName != null) - { - hashCode = (hashCode * 59) + this.HouseNumberOrName.GetHashCode(); - } - if (this.LastName != null) - { - hashCode = (hashCode * 59) + this.LastName.GetHashCode(); - } - if (this.PostalCode != null) - { - hashCode = (hashCode * 59) + this.PostalCode.GetHashCode(); - } - if (this.StateOrProvince != null) - { - hashCode = (hashCode * 59) + this.StateOrProvince.GetHashCode(); - } - if (this.Street != null) - { - hashCode = (hashCode * 59) + this.Street.GetHashCode(); - } - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // City (string) maxLength if (this.City != null && this.City.Length > 3000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for City, length must be less than 3000.", new [] { "City" }); + yield return new ValidationResult("Invalid value for City, length must be less than 3000.", new [] { "City" }); } // HouseNumberOrName (string) maxLength if (this.HouseNumberOrName != null && this.HouseNumberOrName.Length > 3000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for HouseNumberOrName, length must be less than 3000.", new [] { "HouseNumberOrName" }); + yield return new ValidationResult("Invalid value for HouseNumberOrName, length must be less than 3000.", new [] { "HouseNumberOrName" }); } - // StateOrProvince (string) maxLength - if (this.StateOrProvince != null && this.StateOrProvince.Length > 1000) + // Street (string) maxLength + if (this.Street != null && this.Street.Length > 3000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StateOrProvince, length must be less than 1000.", new [] { "StateOrProvince" }); + yield return new ValidationResult("Invalid value for Street, length must be less than 3000.", new [] { "Street" }); } - // Street (string) maxLength - if (this.Street != null && this.Street.Length > 3000) + // StateOrProvince (string) maxLength + if (this.StateOrProvince != null && this.StateOrProvince.Length > 1000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Street, length must be less than 3000.", new [] { "Street" }); + yield return new ValidationResult("Invalid value for StateOrProvince, length must be less than 1000.", new [] { "StateOrProvince" }); } yield break; } } + /// + /// A Json converter for type + /// + public class DeliveryAddressJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override DeliveryAddress Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option city = default; + Option country = default; + Option houseNumberOrName = default; + Option postalCode = default; + Option street = default; + Option firstName = default; + Option lastName = default; + Option stateOrProvince = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "city": + city = new Option(utf8JsonReader.GetString()); + break; + case "country": + country = new Option(utf8JsonReader.GetString()); + break; + case "houseNumberOrName": + houseNumberOrName = new Option(utf8JsonReader.GetString()); + break; + case "postalCode": + postalCode = new Option(utf8JsonReader.GetString()); + break; + case "street": + street = new Option(utf8JsonReader.GetString()); + break; + case "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "stateOrProvince": + stateOrProvince = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!city.IsSet) + throw new ArgumentException("Property is required for class DeliveryAddress.", nameof(city)); + + if (!country.IsSet) + throw new ArgumentException("Property is required for class DeliveryAddress.", nameof(country)); + + if (!houseNumberOrName.IsSet) + throw new ArgumentException("Property is required for class DeliveryAddress.", nameof(houseNumberOrName)); + + if (!postalCode.IsSet) + throw new ArgumentException("Property is required for class DeliveryAddress.", nameof(postalCode)); + + if (!street.IsSet) + throw new ArgumentException("Property is required for class DeliveryAddress.", nameof(street)); + + if (city.IsSet && city.Value == null) + throw new ArgumentNullException(nameof(city), "Property is not nullable for class DeliveryAddress."); + + if (country.IsSet && country.Value == null) + throw new ArgumentNullException(nameof(country), "Property is not nullable for class DeliveryAddress."); + + if (houseNumberOrName.IsSet && houseNumberOrName.Value == null) + throw new ArgumentNullException(nameof(houseNumberOrName), "Property is not nullable for class DeliveryAddress."); + + if (postalCode.IsSet && postalCode.Value == null) + throw new ArgumentNullException(nameof(postalCode), "Property is not nullable for class DeliveryAddress."); + + if (street.IsSet && street.Value == null) + throw new ArgumentNullException(nameof(street), "Property is not nullable for class DeliveryAddress."); + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class DeliveryAddress."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class DeliveryAddress."); + + if (stateOrProvince.IsSet && stateOrProvince.Value == null) + throw new ArgumentNullException(nameof(stateOrProvince), "Property is not nullable for class DeliveryAddress."); + + return new DeliveryAddress(city.Value, country.Value, houseNumberOrName.Value, postalCode.Value, street.Value, firstName, lastName, stateOrProvince); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DeliveryAddress deliveryAddress, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, deliveryAddress, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DeliveryAddress deliveryAddress, JsonSerializerOptions jsonSerializerOptions) + { + if (deliveryAddress.City == null) + throw new ArgumentNullException(nameof(deliveryAddress.City), "Property is required for class DeliveryAddress."); + + if (deliveryAddress.Country == null) + throw new ArgumentNullException(nameof(deliveryAddress.Country), "Property is required for class DeliveryAddress."); + + if (deliveryAddress.HouseNumberOrName == null) + throw new ArgumentNullException(nameof(deliveryAddress.HouseNumberOrName), "Property is required for class DeliveryAddress."); + + if (deliveryAddress.PostalCode == null) + throw new ArgumentNullException(nameof(deliveryAddress.PostalCode), "Property is required for class DeliveryAddress."); + + if (deliveryAddress.Street == null) + throw new ArgumentNullException(nameof(deliveryAddress.Street), "Property is required for class DeliveryAddress."); + + if (deliveryAddress.FirstNameOption.IsSet && deliveryAddress.FirstName == null) + throw new ArgumentNullException(nameof(deliveryAddress.FirstName), "Property is required for class DeliveryAddress."); + + if (deliveryAddress.LastNameOption.IsSet && deliveryAddress.LastName == null) + throw new ArgumentNullException(nameof(deliveryAddress.LastName), "Property is required for class DeliveryAddress."); + + if (deliveryAddress.StateOrProvinceOption.IsSet && deliveryAddress.StateOrProvince == null) + throw new ArgumentNullException(nameof(deliveryAddress.StateOrProvince), "Property is required for class DeliveryAddress."); + + writer.WriteString("city", deliveryAddress.City); + + writer.WriteString("country", deliveryAddress.Country); + + writer.WriteString("houseNumberOrName", deliveryAddress.HouseNumberOrName); + + writer.WriteString("postalCode", deliveryAddress.PostalCode); + + writer.WriteString("street", deliveryAddress.Street); + + if (deliveryAddress.FirstNameOption.IsSet) + writer.WriteString("firstName", deliveryAddress.FirstName); + + if (deliveryAddress.LastNameOption.IsSet) + writer.WriteString("lastName", deliveryAddress.LastName); + + if (deliveryAddress.StateOrProvinceOption.IsSet) + writer.WriteString("stateOrProvince", deliveryAddress.StateOrProvince); + } + } } diff --git a/Adyen/Model/Checkout/DeliveryMethod.cs b/Adyen/Model/Checkout/DeliveryMethod.cs index 7b1b8867a..16e596d61 100644 --- a/Adyen/Model/Checkout/DeliveryMethod.cs +++ b/Adyen/Model/Checkout/DeliveryMethod.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,88 +14,162 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// DeliveryMethod /// - [DataContract(Name = "DeliveryMethod")] - public partial class DeliveryMethod : IEquatable, IValidatableObject + public partial class DeliveryMethod : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The name of the delivery method as shown to the shopper. + /// The reference of the delivery method. + /// If you display the PayPal lightbox with delivery methods, set to **true** for the delivery method that is selected. Only one delivery method can be selected at a time. + /// The type of the delivery method. + [JsonConstructor] + public DeliveryMethod(Option amount = default, Option description = default, Option reference = default, Option selected = default, Option type = default) + { + AmountOption = amount; + DescriptionOption = description; + ReferenceOption = reference; + SelectedOption = selected; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The type of the delivery method. /// /// The type of the delivery method. - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Shipping for value: Shipping /// - [EnumMember(Value = "Shipping")] Shipping = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("Shipping")) + return TypeEnum.Shipping; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("Shipping")) + return TypeEnum.Shipping; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Shipping) + return "Shipping"; + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The type of the delivery method. /// /// The type of the delivery method. - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of Amount /// - /// amount. - /// The name of the delivery method as shown to the shopper.. - /// The reference of the delivery method.. - /// If you display the PayPal lightbox with delivery methods, set to **true** for the delivery method that is selected. Only one delivery method can be selected at a time.. - /// The type of the delivery method.. - public DeliveryMethod(Amount amount = default(Amount), string description = default(string), string reference = default(string), bool? selected = default(bool?), TypeEnum? type = default(TypeEnum?)) - { - this.Amount = amount; - this.Description = description; - this.Reference = reference; - this.Selected = selected; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountOption { get; private set; } /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonPropertyName("amount")] + public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } + + /// + /// Used to track the state of Description + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DescriptionOption { get; private set; } /// /// The name of the delivery method as shown to the shopper. /// /// The name of the delivery method as shown to the shopper. - [DataMember(Name = "description", EmitDefaultValue = false)] - public string Description { get; set; } + [JsonPropertyName("description")] + public string Description { get { return this.DescriptionOption; } set { this.DescriptionOption = new Option(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// The reference of the delivery method. /// /// The reference of the delivery method. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Selected + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SelectedOption { get; private set; } /// /// If you display the PayPal lightbox with delivery methods, set to **true** for the delivery method that is selected. Only one delivery method can be selected at a time. /// /// If you display the PayPal lightbox with delivery methods, set to **true** for the delivery method that is selected. Only one delivery method can be selected at a time. - [DataMember(Name = "selected", EmitDefaultValue = false)] - public bool? Selected { get; set; } + [JsonPropertyName("selected")] + public bool? Selected { get { return this.SelectedOption; } set { this.SelectedOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -116,96 +189,151 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class DeliveryMethodJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override DeliveryMethod Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as DeliveryMethod); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if DeliveryMethod instances are equal - /// - /// Instance of DeliveryMethod to be compared - /// Boolean - public bool Equals(DeliveryMethod input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option description = default; + Option reference = default; + Option selected = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "description": + description = new Option(utf8JsonReader.GetString()); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "selected": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + selected = new Option(utf8JsonReader.GetBoolean()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(DeliveryMethod.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.Description == input.Description || - (this.Description != null && - this.Description.Equals(input.Description)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.Selected == input.Selected || - this.Selected.Equals(input.Selected) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class DeliveryMethod."); + + if (description.IsSet && description.Value == null) + throw new ArgumentNullException(nameof(description), "Property is not nullable for class DeliveryMethod."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class DeliveryMethod."); + + if (selected.IsSet && selected.Value == null) + throw new ArgumentNullException(nameof(selected), "Property is not nullable for class DeliveryMethod."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class DeliveryMethod."); + + return new DeliveryMethod(amount, description, reference, selected, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DeliveryMethod deliveryMethod, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.Description != null) - { - hashCode = (hashCode * 59) + this.Description.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Selected.GetHashCode(); - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, deliveryMethod, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DeliveryMethod deliveryMethod, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (deliveryMethod.AmountOption.IsSet && deliveryMethod.Amount == null) + throw new ArgumentNullException(nameof(deliveryMethod.Amount), "Property is required for class DeliveryMethod."); + + if (deliveryMethod.DescriptionOption.IsSet && deliveryMethod.Description == null) + throw new ArgumentNullException(nameof(deliveryMethod.Description), "Property is required for class DeliveryMethod."); + + if (deliveryMethod.ReferenceOption.IsSet && deliveryMethod.Reference == null) + throw new ArgumentNullException(nameof(deliveryMethod.Reference), "Property is required for class DeliveryMethod."); + + if (deliveryMethod.AmountOption.IsSet) + { + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, deliveryMethod.Amount, jsonSerializerOptions); + } + if (deliveryMethod.DescriptionOption.IsSet) + writer.WriteString("description", deliveryMethod.Description); + + if (deliveryMethod.ReferenceOption.IsSet) + writer.WriteString("reference", deliveryMethod.Reference); + + if (deliveryMethod.SelectedOption.IsSet) + writer.WriteBoolean("selected", deliveryMethod.SelectedOption.Value.Value); + + var typeRawValue = DeliveryMethod.TypeEnumToJsonValue(deliveryMethod.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs b/Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs index 26c9d1432..b36beaeb8 100644 --- a/Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs +++ b/Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,38 +14,46 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// DetailsRequestAuthenticationData /// - [DataContract(Name = "DetailsRequestAuthenticationData")] - public partial class DetailsRequestAuthenticationData : IEquatable, IValidatableObject + public partial class DetailsRequestAuthenticationData : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: *false**. (default to false). - public DetailsRequestAuthenticationData(bool? authenticationOnly = false) + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: *false**. (default to false) + [JsonConstructor] + public DetailsRequestAuthenticationData(Option authenticationOnly = default) { - this.AuthenticationOnly = authenticationOnly; + AuthenticationOnlyOption = authenticationOnly; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of AuthenticationOnly + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthenticationOnlyOption { get; private set; } + /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: *false**. /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: *false**. - [DataMember(Name = "authenticationOnly", EmitDefaultValue = false)] - public bool? AuthenticationOnly { get; set; } + [JsonPropertyName("authenticationOnly")] + public bool? AuthenticationOnly { get { return this.AuthenticationOnlyOption; } set { this.AuthenticationOnlyOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -62,64 +69,97 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class DetailsRequestAuthenticationDataJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override DetailsRequestAuthenticationData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as DetailsRequestAuthenticationData); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if DetailsRequestAuthenticationData instances are equal - /// - /// Instance of DetailsRequestAuthenticationData to be compared - /// Boolean - public bool Equals(DetailsRequestAuthenticationData input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option authenticationOnly = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "authenticationOnly": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + authenticationOnly = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } } - return - ( - this.AuthenticationOnly == input.AuthenticationOnly || - this.AuthenticationOnly.Equals(input.AuthenticationOnly) - ); + + if (authenticationOnly.IsSet && authenticationOnly.Value == null) + throw new ArgumentNullException(nameof(authenticationOnly), "Property is not nullable for class DetailsRequestAuthenticationData."); + + return new DetailsRequestAuthenticationData(authenticationOnly); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DetailsRequestAuthenticationData detailsRequestAuthenticationData, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.AuthenticationOnly.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, detailsRequestAuthenticationData, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DetailsRequestAuthenticationData detailsRequestAuthenticationData, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (detailsRequestAuthenticationData.AuthenticationOnlyOption.IsSet) + writer.WriteBoolean("authenticationOnly", detailsRequestAuthenticationData.AuthenticationOnlyOption.Value.Value); } } - } diff --git a/Adyen/Model/Checkout/DeviceRenderOptions.cs b/Adyen/Model/Checkout/DeviceRenderOptions.cs index a74655b04..c7de50d45 100644 --- a/Adyen/Model/Checkout/DeviceRenderOptions.cs +++ b/Adyen/Model/Checkout/DeviceRenderOptions.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,114 +14,252 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// DeviceRenderOptions /// - [DataContract(Name = "DeviceRenderOptions")] - public partial class DeviceRenderOptions : IEquatable, IValidatableObject + public partial class DeviceRenderOptions : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Supported SDK interface types. Allowed values: * native * html * both (default to SdkInterfaceEnum.Both) + /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect + [JsonConstructor] + public DeviceRenderOptions(Option sdkInterface = default, Option> sdkUiType = default) + { + SdkInterfaceOption = sdkInterface; + SdkUiTypeOption = sdkUiType; + OnCreated(); + } + + partial void OnCreated(); + /// /// Supported SDK interface types. Allowed values: * native * html * both /// /// Supported SDK interface types. Allowed values: * native * html * both - [JsonConverter(typeof(StringEnumConverter))] public enum SdkInterfaceEnum { /// /// Enum Native for value: native /// - [EnumMember(Value = "native")] Native = 1, /// /// Enum Html for value: html /// - [EnumMember(Value = "html")] Html = 2, /// /// Enum Both for value: both /// - [EnumMember(Value = "both")] Both = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static SdkInterfaceEnum SdkInterfaceEnumFromString(string value) + { + if (value.Equals("native")) + return SdkInterfaceEnum.Native; + + if (value.Equals("html")) + return SdkInterfaceEnum.Html; + + if (value.Equals("both")) + return SdkInterfaceEnum.Both; + + throw new NotImplementedException($"Could not convert value to type SdkInterfaceEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static SdkInterfaceEnum? SdkInterfaceEnumFromStringOrDefault(string value) + { + if (value.Equals("native")) + return SdkInterfaceEnum.Native; + + if (value.Equals("html")) + return SdkInterfaceEnum.Html; + + if (value.Equals("both")) + return SdkInterfaceEnum.Both; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string SdkInterfaceEnumToJsonValue(SdkInterfaceEnum? value) + { + if (value == SdkInterfaceEnum.Native) + return "native"; + + if (value == SdkInterfaceEnum.Html) + return "html"; + if (value == SdkInterfaceEnum.Both) + return "both"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of SdkInterface + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkInterfaceOption { get; private set; } /// /// Supported SDK interface types. Allowed values: * native * html * both /// /// Supported SDK interface types. Allowed values: * native * html * both - [DataMember(Name = "sdkInterface", EmitDefaultValue = false)] - public SdkInterfaceEnum? SdkInterface { get; set; } + [JsonPropertyName("sdkInterface")] + public SdkInterfaceEnum? SdkInterface { get { return this.SdkInterfaceOption; } set { this.SdkInterfaceOption = new Option(value); } } + /// /// Defines SdkUiType /// - [JsonConverter(typeof(StringEnumConverter))] public enum SdkUiTypeEnum { /// /// Enum MultiSelect for value: multiSelect /// - [EnumMember(Value = "multiSelect")] MultiSelect = 1, /// /// Enum OtherHtml for value: otherHtml /// - [EnumMember(Value = "otherHtml")] OtherHtml = 2, /// /// Enum OutOfBand for value: outOfBand /// - [EnumMember(Value = "outOfBand")] OutOfBand = 3, /// /// Enum SingleSelect for value: singleSelect /// - [EnumMember(Value = "singleSelect")] SingleSelect = 4, /// /// Enum Text for value: text /// - [EnumMember(Value = "text")] Text = 5 - } + /// + /// Returns a + /// + /// + /// + /// + public static SdkUiTypeEnum SdkUiTypeEnumFromString(string value) + { + if (value.Equals("multiSelect")) + return SdkUiTypeEnum.MultiSelect; + + if (value.Equals("otherHtml")) + return SdkUiTypeEnum.OtherHtml; + if (value.Equals("outOfBand")) + return SdkUiTypeEnum.OutOfBand; + + if (value.Equals("singleSelect")) + return SdkUiTypeEnum.SingleSelect; + + if (value.Equals("text")) + return SdkUiTypeEnum.Text; + + throw new NotImplementedException($"Could not convert value to type SdkUiTypeEnum: '{value}'"); + } /// - /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect + /// Returns a /// - /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect - [DataMember(Name = "sdkUiType", EmitDefaultValue = false)] - public List SdkUiType { get; set; } + /// + /// + public static SdkUiTypeEnum? SdkUiTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("multiSelect")) + return SdkUiTypeEnum.MultiSelect; + + if (value.Equals("otherHtml")) + return SdkUiTypeEnum.OtherHtml; + + if (value.Equals("outOfBand")) + return SdkUiTypeEnum.OutOfBand; + + if (value.Equals("singleSelect")) + return SdkUiTypeEnum.SingleSelect; + + if (value.Equals("text")) + return SdkUiTypeEnum.Text; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// Supported SDK interface types. Allowed values: * native * html * both (default to SdkInterfaceEnum.Both). - /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect. - public DeviceRenderOptions(SdkInterfaceEnum? sdkInterface = SdkInterfaceEnum.Both, List sdkUiType = default(List)) + /// + /// + /// + public static string SdkUiTypeEnumToJsonValue(SdkUiTypeEnum value) { - this.SdkInterface = sdkInterface; - this.SdkUiType = sdkUiType; + if (value == SdkUiTypeEnum.MultiSelect) + return "multiSelect"; + + if (value == SdkUiTypeEnum.OtherHtml) + return "otherHtml"; + + if (value == SdkUiTypeEnum.OutOfBand) + return "outOfBand"; + + if (value == SdkUiTypeEnum.SingleSelect) + return "singleSelect"; + + if (value == SdkUiTypeEnum.Text) + return "text"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of SdkUiType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SdkUiTypeOption { get; private set; } + + /// + /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect + /// + /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect + [JsonPropertyName("sdkUiType")] + public List SdkUiType { get { return this.SdkUiTypeOption; } set { this.SdkUiTypeOption = new Option>(value); } } + /// /// Returns the string presentation of the object /// @@ -138,69 +275,114 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class DeviceRenderOptionsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override DeviceRenderOptions Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as DeviceRenderOptions); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if DeviceRenderOptions instances are equal - /// - /// Instance of DeviceRenderOptions to be compared - /// Boolean - public bool Equals(DeviceRenderOptions input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option sdkInterface = default; + Option> sdkUiType = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "sdkInterface": + string sdkInterfaceRawValue = utf8JsonReader.GetString(); + if (sdkInterfaceRawValue != null) + sdkInterface = new Option(DeviceRenderOptions.SdkInterfaceEnumFromStringOrDefault(sdkInterfaceRawValue)); + break; + case "sdkUiType": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sdkUiType = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.SdkInterface == input.SdkInterface || - this.SdkInterface.Equals(input.SdkInterface) - ) && - ( - this.SdkUiType == input.SdkUiType || - this.SdkUiType.SequenceEqual(input.SdkUiType) - ); + + if (sdkInterface.IsSet && sdkInterface.Value == null) + throw new ArgumentNullException(nameof(sdkInterface), "Property is not nullable for class DeviceRenderOptions."); + + if (sdkUiType.IsSet && sdkUiType.Value == null) + throw new ArgumentNullException(nameof(sdkUiType), "Property is not nullable for class DeviceRenderOptions."); + + return new DeviceRenderOptions(sdkInterface, sdkUiType); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DeviceRenderOptions deviceRenderOptions, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.SdkInterface.GetHashCode(); - hashCode = (hashCode * 59) + this.SdkUiType.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, deviceRenderOptions, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DeviceRenderOptions deviceRenderOptions, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (deviceRenderOptions.SdkUiTypeOption.IsSet && deviceRenderOptions.SdkUiType == null) + throw new ArgumentNullException(nameof(deviceRenderOptions.SdkUiType), "Property is required for class DeviceRenderOptions."); + + var sdkInterfaceRawValue = DeviceRenderOptions.SdkInterfaceEnumToJsonValue(deviceRenderOptions.SdkInterfaceOption.Value.Value); + writer.WriteString("sdkInterface", sdkInterfaceRawValue); + if (deviceRenderOptions.SdkUiTypeOption.IsSet) + { + writer.WritePropertyName("sdkUiType"); + JsonSerializer.Serialize(writer, deviceRenderOptions.SdkUiType, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/DokuDetails.cs b/Adyen/Model/Checkout/DokuDetails.cs index b35178f38..57b89db69 100644 --- a/Adyen/Model/Checkout/DokuDetails.cs +++ b/Adyen/Model/Checkout/DokuDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,155 +14,276 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// DokuDetails /// - [DataContract(Name = "DokuDetails")] - public partial class DokuDetails : IEquatable, IValidatableObject + public partial class DokuDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The shopper's first name. + /// The shopper's last name. + /// The shopper's email. + /// **doku** + /// The checkout attempt identifier. + [JsonConstructor] + public DokuDetails(string firstName, string lastName, string shopperEmail, TypeEnum type, Option checkoutAttemptId = default) + { + FirstName = firstName; + LastName = lastName; + ShopperEmail = shopperEmail; + Type = type; + CheckoutAttemptIdOption = checkoutAttemptId; + OnCreated(); + } + + partial void OnCreated(); + /// /// **doku** /// /// **doku** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// - /// Enum MandiriVa for value: doku_mandiri_va + /// Enum DokuMandiriVa for value: doku_mandiri_va /// - [EnumMember(Value = "doku_mandiri_va")] - MandiriVa = 1, + DokuMandiriVa = 1, /// - /// Enum CimbVa for value: doku_cimb_va + /// Enum DokuCimbVa for value: doku_cimb_va /// - [EnumMember(Value = "doku_cimb_va")] - CimbVa = 2, + DokuCimbVa = 2, /// - /// Enum DanamonVa for value: doku_danamon_va + /// Enum DokuDanamonVa for value: doku_danamon_va /// - [EnumMember(Value = "doku_danamon_va")] - DanamonVa = 3, + DokuDanamonVa = 3, /// - /// Enum BniVa for value: doku_bni_va + /// Enum DokuBniVa for value: doku_bni_va /// - [EnumMember(Value = "doku_bni_va")] - BniVa = 4, + DokuBniVa = 4, /// - /// Enum PermataLiteAtm for value: doku_permata_lite_atm + /// Enum DokuPermataLiteAtm for value: doku_permata_lite_atm /// - [EnumMember(Value = "doku_permata_lite_atm")] - PermataLiteAtm = 5, + DokuPermataLiteAtm = 5, /// - /// Enum BriVa for value: doku_bri_va + /// Enum DokuBriVa for value: doku_bri_va /// - [EnumMember(Value = "doku_bri_va")] - BriVa = 6, + DokuBriVa = 6, /// - /// Enum BcaVa for value: doku_bca_va + /// Enum DokuBcaVa for value: doku_bca_va /// - [EnumMember(Value = "doku_bca_va")] - BcaVa = 7, + DokuBcaVa = 7, /// - /// Enum Alfamart for value: doku_alfamart + /// Enum DokuAlfamart for value: doku_alfamart /// - [EnumMember(Value = "doku_alfamart")] - Alfamart = 8, + DokuAlfamart = 8, /// - /// Enum Indomaret for value: doku_indomaret + /// Enum DokuIndomaret for value: doku_indomaret /// - [EnumMember(Value = "doku_indomaret")] - Indomaret = 9, + DokuIndomaret = 9, /// - /// Enum Wallet for value: doku_wallet + /// Enum DokuWallet for value: doku_wallet /// - [EnumMember(Value = "doku_wallet")] - Wallet = 10, + DokuWallet = 10, /// - /// Enum Ovo for value: doku_ovo + /// Enum DokuOvo for value: doku_ovo /// - [EnumMember(Value = "doku_ovo")] - Ovo = 11 - + DokuOvo = 11 } - /// - /// **doku** + /// Returns a /// - /// **doku** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public TypeEnum Type { get; set; } + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("doku_mandiri_va")) + return TypeEnum.DokuMandiriVa; + + if (value.Equals("doku_cimb_va")) + return TypeEnum.DokuCimbVa; + + if (value.Equals("doku_danamon_va")) + return TypeEnum.DokuDanamonVa; + + if (value.Equals("doku_bni_va")) + return TypeEnum.DokuBniVa; + + if (value.Equals("doku_permata_lite_atm")) + return TypeEnum.DokuPermataLiteAtm; + + if (value.Equals("doku_bri_va")) + return TypeEnum.DokuBriVa; + + if (value.Equals("doku_bca_va")) + return TypeEnum.DokuBcaVa; + + if (value.Equals("doku_alfamart")) + return TypeEnum.DokuAlfamart; + + if (value.Equals("doku_indomaret")) + return TypeEnum.DokuIndomaret; + + if (value.Equals("doku_wallet")) + return TypeEnum.DokuWallet; + + if (value.Equals("doku_ovo")) + return TypeEnum.DokuOvo; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected DokuDetails() { } + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("doku_mandiri_va")) + return TypeEnum.DokuMandiriVa; + + if (value.Equals("doku_cimb_va")) + return TypeEnum.DokuCimbVa; + + if (value.Equals("doku_danamon_va")) + return TypeEnum.DokuDanamonVa; + + if (value.Equals("doku_bni_va")) + return TypeEnum.DokuBniVa; + + if (value.Equals("doku_permata_lite_atm")) + return TypeEnum.DokuPermataLiteAtm; + + if (value.Equals("doku_bri_va")) + return TypeEnum.DokuBriVa; + + if (value.Equals("doku_bca_va")) + return TypeEnum.DokuBcaVa; + + if (value.Equals("doku_alfamart")) + return TypeEnum.DokuAlfamart; + + if (value.Equals("doku_indomaret")) + return TypeEnum.DokuIndomaret; + + if (value.Equals("doku_wallet")) + return TypeEnum.DokuWallet; + + if (value.Equals("doku_ovo")) + return TypeEnum.DokuOvo; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The checkout attempt identifier.. - /// The shopper's first name. (required). - /// The shopper's last name. (required). - /// The shopper's email. (required). - /// **doku** (required). - public DokuDetails(string checkoutAttemptId = default(string), string firstName = default(string), string lastName = default(string), string shopperEmail = default(string), TypeEnum type = default(TypeEnum)) + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) { - this.FirstName = firstName; - this.LastName = lastName; - this.ShopperEmail = shopperEmail; - this.Type = type; - this.CheckoutAttemptId = checkoutAttemptId; + if (value == TypeEnum.DokuMandiriVa) + return "doku_mandiri_va"; + + if (value == TypeEnum.DokuCimbVa) + return "doku_cimb_va"; + + if (value == TypeEnum.DokuDanamonVa) + return "doku_danamon_va"; + + if (value == TypeEnum.DokuBniVa) + return "doku_bni_va"; + + if (value == TypeEnum.DokuPermataLiteAtm) + return "doku_permata_lite_atm"; + + if (value == TypeEnum.DokuBriVa) + return "doku_bri_va"; + + if (value == TypeEnum.DokuBcaVa) + return "doku_bca_va"; + + if (value == TypeEnum.DokuAlfamart) + return "doku_alfamart"; + + if (value == TypeEnum.DokuIndomaret) + return "doku_indomaret"; + + if (value == TypeEnum.DokuWallet) + return "doku_wallet"; + + if (value == TypeEnum.DokuOvo) + return "doku_ovo"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// The checkout attempt identifier. + /// **doku** /// - /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + /// **doku** + [JsonPropertyName("type")] + public TypeEnum Type { get; set; } /// /// The shopper's first name. /// /// The shopper's first name. - [DataMember(Name = "firstName", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("firstName")] public string FirstName { get; set; } /// /// The shopper's last name. /// /// The shopper's last name. - [DataMember(Name = "lastName", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("lastName")] public string LastName { get; set; } /// /// The shopper's email. /// /// The shopper's email. - [DataMember(Name = "shopperEmail", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("shopperEmail")] public string ShopperEmail { get; set; } + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } + + /// + /// The checkout attempt identifier. + /// + /// The checkout attempt identifier. + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -172,110 +292,168 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class DokuDetails {\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FirstName: ").Append(FirstName).Append("\n"); sb.Append(" LastName: ").Append(LastName).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class DokuDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override DokuDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as DokuDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if DokuDetails instances are equal - /// - /// Instance of DokuDetails to be compared - /// Boolean - public bool Equals(DokuDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option firstName = default; + Option lastName = default; + Option shopperEmail = default; + Option type = default; + Option checkoutAttemptId = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(DokuDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.FirstName == input.FirstName || - (this.FirstName != null && - this.FirstName.Equals(input.FirstName)) - ) && - ( - this.LastName == input.LastName || - (this.LastName != null && - this.LastName.Equals(input.LastName)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!firstName.IsSet) + throw new ArgumentException("Property is required for class DokuDetails.", nameof(firstName)); + + if (!lastName.IsSet) + throw new ArgumentException("Property is required for class DokuDetails.", nameof(lastName)); + + if (!shopperEmail.IsSet) + throw new ArgumentException("Property is required for class DokuDetails.", nameof(shopperEmail)); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class DokuDetails.", nameof(type)); + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class DokuDetails."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class DokuDetails."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class DokuDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class DokuDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class DokuDetails."); + + return new DokuDetails(firstName.Value, lastName.Value, shopperEmail.Value, type.Value.Value, checkoutAttemptId); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DokuDetails dokuDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.FirstName != null) - { - hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); - } - if (this.LastName != null) - { - hashCode = (hashCode * 59) + this.LastName.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, dokuDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DokuDetails dokuDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (dokuDetails.FirstName == null) + throw new ArgumentNullException(nameof(dokuDetails.FirstName), "Property is required for class DokuDetails."); + + if (dokuDetails.LastName == null) + throw new ArgumentNullException(nameof(dokuDetails.LastName), "Property is required for class DokuDetails."); + + if (dokuDetails.ShopperEmail == null) + throw new ArgumentNullException(nameof(dokuDetails.ShopperEmail), "Property is required for class DokuDetails."); + + if (dokuDetails.CheckoutAttemptIdOption.IsSet && dokuDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(dokuDetails.CheckoutAttemptId), "Property is required for class DokuDetails."); + + writer.WriteString("firstName", dokuDetails.FirstName); + + writer.WriteString("lastName", dokuDetails.LastName); + + writer.WriteString("shopperEmail", dokuDetails.ShopperEmail); + + var typeRawValue = DokuDetails.TypeEnumToJsonValue(dokuDetails.Type); + writer.WriteString("type", typeRawValue); + if (dokuDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", dokuDetails.CheckoutAttemptId); } } - } diff --git a/Adyen/Model/Checkout/Donation.cs b/Adyen/Model/Checkout/Donation.cs index 5f360c5ed..0917993bb 100644 --- a/Adyen/Model/Checkout/Donation.cs +++ b/Adyen/Model/Checkout/Donation.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,79 +14,89 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Donation /// - [DataContract(Name = "Donation")] - public partial class Donation : IEquatable, IValidatableObject + public partial class Donation : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected Donation() { } - /// - /// Initializes a new instance of the class. - /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). (required). - /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donations amounts that the shopper can select from. (required). - /// The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**.. - /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donation amounts that the shopper can select from. (required). - /// The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units). This field is only present when `donationType` is **fixedAmounts**.. - public Donation(string currency = default(string), string donationType = default(string), long? maxRoundupAmount = default(long?), string type = default(string), List values = default(List)) + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). + /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donations amounts that the shopper can select from. + /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donation amounts that the shopper can select from. + /// The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**. + /// The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units). This field is only present when `donationType` is **fixedAmounts**. + [JsonConstructor] + public Donation(string currency, string donationType, string type, Option maxRoundupAmount = default, Option> values = default) { - this.Currency = currency; - this.DonationType = donationType; - this.Type = type; - this.MaxRoundupAmount = maxRoundupAmount; - this.Values = values; + Currency = currency; + DonationType = donationType; + Type = type; + MaxRoundupAmountOption = maxRoundupAmount; + ValuesOption = values; + OnCreated(); } + partial void OnCreated(); + /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). - [DataMember(Name = "currency", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("currency")] public string Currency { get; set; } /// /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donations amounts that the shopper can select from. /// /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donations amounts that the shopper can select from. - [DataMember(Name = "donationType", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("donationType")] public string DonationType { get; set; } + /// + /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donation amounts that the shopper can select from. + /// + /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donation amounts that the shopper can select from. + [JsonPropertyName("type")] + public string Type { get; set; } + + /// + /// Used to track the state of MaxRoundupAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MaxRoundupAmountOption { get; private set; } + /// /// The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**. /// /// The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**. - [DataMember(Name = "maxRoundupAmount", EmitDefaultValue = false)] - public long? MaxRoundupAmount { get; set; } + [JsonPropertyName("maxRoundupAmount")] + public long? MaxRoundupAmount { get { return this.MaxRoundupAmountOption; } set { this.MaxRoundupAmountOption = new Option(value); } } /// - /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donation amounts that the shopper can select from. + /// Used to track the state of Values /// - /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donation amounts that the shopper can select from. - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public string Type { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> ValuesOption { get; private set; } /// /// The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units). This field is only present when `donationType` is **fixedAmounts**. /// /// The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units). This field is only present when `donationType` is **fixedAmounts**. - [DataMember(Name = "values", EmitDefaultValue = false)] - public List Values { get; set; } + [JsonPropertyName("values")] + public List Values { get { return this.ValuesOption; } set { this.ValuesOption = new Option>(value); } } /// /// Returns the string presentation of the object @@ -99,109 +108,167 @@ public override string ToString() sb.Append("class Donation {\n"); sb.Append(" Currency: ").Append(Currency).Append("\n"); sb.Append(" DonationType: ").Append(DonationType).Append("\n"); - sb.Append(" MaxRoundupAmount: ").Append(MaxRoundupAmount).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" MaxRoundupAmount: ").Append(MaxRoundupAmount).Append("\n"); sb.Append(" Values: ").Append(Values).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class DonationJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override Donation Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as Donation); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if Donation instances are equal - /// - /// Instance of Donation to be compared - /// Boolean - public bool Equals(Donation input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option currency = default; + Option donationType = default; + Option type = default; + Option maxRoundupAmount = default; + Option> values = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "currency": + currency = new Option(utf8JsonReader.GetString()); + break; + case "donationType": + donationType = new Option(utf8JsonReader.GetString()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + case "maxRoundupAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + maxRoundupAmount = new Option(utf8JsonReader.GetInt64()); + break; + case "values": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + values = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.Currency == input.Currency || - (this.Currency != null && - this.Currency.Equals(input.Currency)) - ) && - ( - this.DonationType == input.DonationType || - (this.DonationType != null && - this.DonationType.Equals(input.DonationType)) - ) && - ( - this.MaxRoundupAmount == input.MaxRoundupAmount || - this.MaxRoundupAmount.Equals(input.MaxRoundupAmount) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ) && - ( - this.Values == input.Values || - this.Values != null && - input.Values != null && - this.Values.SequenceEqual(input.Values) - ); + + if (!currency.IsSet) + throw new ArgumentException("Property is required for class Donation.", nameof(currency)); + + if (!donationType.IsSet) + throw new ArgumentException("Property is required for class Donation.", nameof(donationType)); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class Donation.", nameof(type)); + + if (currency.IsSet && currency.Value == null) + throw new ArgumentNullException(nameof(currency), "Property is not nullable for class Donation."); + + if (donationType.IsSet && donationType.Value == null) + throw new ArgumentNullException(nameof(donationType), "Property is not nullable for class Donation."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class Donation."); + + if (maxRoundupAmount.IsSet && maxRoundupAmount.Value == null) + throw new ArgumentNullException(nameof(maxRoundupAmount), "Property is not nullable for class Donation."); + + if (values.IsSet && values.Value == null) + throw new ArgumentNullException(nameof(values), "Property is not nullable for class Donation."); + + return new Donation(currency.Value, donationType.Value, type.Value, maxRoundupAmount, values); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Donation donation, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Currency != null) - { - hashCode = (hashCode * 59) + this.Currency.GetHashCode(); - } - if (this.DonationType != null) - { - hashCode = (hashCode * 59) + this.DonationType.GetHashCode(); - } - hashCode = (hashCode * 59) + this.MaxRoundupAmount.GetHashCode(); - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - if (this.Values != null) - { - hashCode = (hashCode * 59) + this.Values.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, donation, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Donation donation, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (donation.Currency == null) + throw new ArgumentNullException(nameof(donation.Currency), "Property is required for class Donation."); + + if (donation.DonationType == null) + throw new ArgumentNullException(nameof(donation.DonationType), "Property is required for class Donation."); + + if (donation.Type == null) + throw new ArgumentNullException(nameof(donation.Type), "Property is required for class Donation."); + + if (donation.ValuesOption.IsSet && donation.Values == null) + throw new ArgumentNullException(nameof(donation.Values), "Property is required for class Donation."); + + writer.WriteString("currency", donation.Currency); + + writer.WriteString("donationType", donation.DonationType); + + writer.WriteString("type", donation.Type); + + if (donation.MaxRoundupAmountOption.IsSet) + writer.WriteNumber("maxRoundupAmount", donation.MaxRoundupAmountOption.Value.Value); + + if (donation.ValuesOption.IsSet) + { + writer.WritePropertyName("values"); + JsonSerializer.Serialize(writer, donation.Values, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/DonationCampaign.cs b/Adyen/Model/Checkout/DonationCampaign.cs index 86c7db288..6e4a0500f 100644 --- a/Adyen/Model/Checkout/DonationCampaign.cs +++ b/Adyen/Model/Checkout/DonationCampaign.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,126 +14,204 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// DonationCampaign /// - [DataContract(Name = "DonationCampaign")] - public partial class DonationCampaign : IEquatable, IValidatableObject + public partial class DonationCampaign : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// amounts. - /// The URL for the banner of the nonprofit or campaign.. - /// The name of the donation campaign... - /// The cause of the nonprofit.. - /// donation. - /// The unique campaign ID of the donation campaign.. - /// The URL for the logo of the nonprofit.. - /// The description of the nonprofit.. - /// The name of the nonprofit organization that receives the donation.. - /// The website URL of the nonprofit.. - /// The URL of the terms and conditions page of the nonprofit and the campaign.. - public DonationCampaign(Amounts amounts = default(Amounts), string bannerUrl = default(string), string campaignName = default(string), string causeName = default(string), Donation donation = default(Donation), string id = default(string), string logoUrl = default(string), string nonprofitDescription = default(string), string nonprofitName = default(string), string nonprofitUrl = default(string), string termsAndConditionsUrl = default(string)) + /// amounts + /// The URL for the banner of the nonprofit or campaign. + /// The name of the donation campaign.. + /// The cause of the nonprofit. + /// donation + /// The unique campaign ID of the donation campaign. + /// The URL for the logo of the nonprofit. + /// The description of the nonprofit. + /// The name of the nonprofit organization that receives the donation. + /// The website URL of the nonprofit. + /// The URL of the terms and conditions page of the nonprofit and the campaign. + [JsonConstructor] + public DonationCampaign(Option amounts = default, Option bannerUrl = default, Option campaignName = default, Option causeName = default, Option donation = default, Option id = default, Option logoUrl = default, Option nonprofitDescription = default, Option nonprofitName = default, Option nonprofitUrl = default, Option termsAndConditionsUrl = default) { - this.Amounts = amounts; - this.BannerUrl = bannerUrl; - this.CampaignName = campaignName; - this.CauseName = causeName; - this.Donation = donation; - this.Id = id; - this.LogoUrl = logoUrl; - this.NonprofitDescription = nonprofitDescription; - this.NonprofitName = nonprofitName; - this.NonprofitUrl = nonprofitUrl; - this.TermsAndConditionsUrl = termsAndConditionsUrl; + AmountsOption = amounts; + BannerUrlOption = bannerUrl; + CampaignNameOption = campaignName; + CauseNameOption = causeName; + DonationOption = donation; + IdOption = id; + LogoUrlOption = logoUrl; + NonprofitDescriptionOption = nonprofitDescription; + NonprofitNameOption = nonprofitName; + NonprofitUrlOption = nonprofitUrl; + TermsAndConditionsUrlOption = termsAndConditionsUrl; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Amounts + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountsOption { get; private set; } + /// /// Gets or Sets Amounts /// - [DataMember(Name = "amounts", EmitDefaultValue = false)] - public Amounts Amounts { get; set; } + [JsonPropertyName("amounts")] + public Amounts Amounts { get { return this.AmountsOption; } set { this.AmountsOption = new Option(value); } } + + /// + /// Used to track the state of BannerUrl + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BannerUrlOption { get; private set; } /// /// The URL for the banner of the nonprofit or campaign. /// /// The URL for the banner of the nonprofit or campaign. - [DataMember(Name = "bannerUrl", EmitDefaultValue = false)] - public string BannerUrl { get; set; } + [JsonPropertyName("bannerUrl")] + public string BannerUrl { get { return this.BannerUrlOption; } set { this.BannerUrlOption = new Option(value); } } + + /// + /// Used to track the state of CampaignName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CampaignNameOption { get; private set; } /// /// The name of the donation campaign.. /// /// The name of the donation campaign.. - [DataMember(Name = "campaignName", EmitDefaultValue = false)] - public string CampaignName { get; set; } + [JsonPropertyName("campaignName")] + public string CampaignName { get { return this.CampaignNameOption; } set { this.CampaignNameOption = new Option(value); } } + + /// + /// Used to track the state of CauseName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CauseNameOption { get; private set; } /// /// The cause of the nonprofit. /// /// The cause of the nonprofit. - [DataMember(Name = "causeName", EmitDefaultValue = false)] - public string CauseName { get; set; } + [JsonPropertyName("causeName")] + public string CauseName { get { return this.CauseNameOption; } set { this.CauseNameOption = new Option(value); } } + + /// + /// Used to track the state of Donation + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DonationOption { get; private set; } /// /// Gets or Sets Donation /// - [DataMember(Name = "donation", EmitDefaultValue = false)] - public Donation Donation { get; set; } + [JsonPropertyName("donation")] + public Donation Donation { get { return this.DonationOption; } set { this.DonationOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } /// /// The unique campaign ID of the donation campaign. /// /// The unique campaign ID of the donation campaign. - [DataMember(Name = "id", EmitDefaultValue = false)] - public string Id { get; set; } + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of LogoUrl + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LogoUrlOption { get; private set; } /// /// The URL for the logo of the nonprofit. /// /// The URL for the logo of the nonprofit. - [DataMember(Name = "logoUrl", EmitDefaultValue = false)] - public string LogoUrl { get; set; } + [JsonPropertyName("logoUrl")] + public string LogoUrl { get { return this.LogoUrlOption; } set { this.LogoUrlOption = new Option(value); } } + + /// + /// Used to track the state of NonprofitDescription + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NonprofitDescriptionOption { get; private set; } /// /// The description of the nonprofit. /// /// The description of the nonprofit. - [DataMember(Name = "nonprofitDescription", EmitDefaultValue = false)] - public string NonprofitDescription { get; set; } + [JsonPropertyName("nonprofitDescription")] + public string NonprofitDescription { get { return this.NonprofitDescriptionOption; } set { this.NonprofitDescriptionOption = new Option(value); } } + + /// + /// Used to track the state of NonprofitName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NonprofitNameOption { get; private set; } /// /// The name of the nonprofit organization that receives the donation. /// /// The name of the nonprofit organization that receives the donation. - [DataMember(Name = "nonprofitName", EmitDefaultValue = false)] - public string NonprofitName { get; set; } + [JsonPropertyName("nonprofitName")] + public string NonprofitName { get { return this.NonprofitNameOption; } set { this.NonprofitNameOption = new Option(value); } } + + /// + /// Used to track the state of NonprofitUrl + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NonprofitUrlOption { get; private set; } /// /// The website URL of the nonprofit. /// /// The website URL of the nonprofit. - [DataMember(Name = "nonprofitUrl", EmitDefaultValue = false)] - public string NonprofitUrl { get; set; } + [JsonPropertyName("nonprofitUrl")] + public string NonprofitUrl { get { return this.NonprofitUrlOption; } set { this.NonprofitUrlOption = new Option(value); } } + + /// + /// Used to track the state of TermsAndConditionsUrl + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TermsAndConditionsUrlOption { get; private set; } /// /// The URL of the terms and conditions page of the nonprofit and the campaign. /// /// The URL of the terms and conditions page of the nonprofit and the campaign. - [DataMember(Name = "termsAndConditionsUrl", EmitDefaultValue = false)] - public string TermsAndConditionsUrl { get; set; } + [JsonPropertyName("termsAndConditionsUrl")] + public string TermsAndConditionsUrl { get { return this.TermsAndConditionsUrlOption; } set { this.TermsAndConditionsUrlOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -160,158 +237,235 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class DonationCampaignJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override DonationCampaign Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as DonationCampaign); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if DonationCampaign instances are equal - /// - /// Instance of DonationCampaign to be compared - /// Boolean - public bool Equals(DonationCampaign input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amounts = default; + Option bannerUrl = default; + Option campaignName = default; + Option causeName = default; + Option donation = default; + Option id = default; + Option logoUrl = default; + Option nonprofitDescription = default; + Option nonprofitName = default; + Option nonprofitUrl = default; + Option termsAndConditionsUrl = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amounts": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amounts = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "bannerUrl": + bannerUrl = new Option(utf8JsonReader.GetString()); + break; + case "campaignName": + campaignName = new Option(utf8JsonReader.GetString()); + break; + case "causeName": + causeName = new Option(utf8JsonReader.GetString()); + break; + case "donation": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + donation = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "logoUrl": + logoUrl = new Option(utf8JsonReader.GetString()); + break; + case "nonprofitDescription": + nonprofitDescription = new Option(utf8JsonReader.GetString()); + break; + case "nonprofitName": + nonprofitName = new Option(utf8JsonReader.GetString()); + break; + case "nonprofitUrl": + nonprofitUrl = new Option(utf8JsonReader.GetString()); + break; + case "termsAndConditionsUrl": + termsAndConditionsUrl = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Amounts == input.Amounts || - (this.Amounts != null && - this.Amounts.Equals(input.Amounts)) - ) && - ( - this.BannerUrl == input.BannerUrl || - (this.BannerUrl != null && - this.BannerUrl.Equals(input.BannerUrl)) - ) && - ( - this.CampaignName == input.CampaignName || - (this.CampaignName != null && - this.CampaignName.Equals(input.CampaignName)) - ) && - ( - this.CauseName == input.CauseName || - (this.CauseName != null && - this.CauseName.Equals(input.CauseName)) - ) && - ( - this.Donation == input.Donation || - (this.Donation != null && - this.Donation.Equals(input.Donation)) - ) && - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.LogoUrl == input.LogoUrl || - (this.LogoUrl != null && - this.LogoUrl.Equals(input.LogoUrl)) - ) && - ( - this.NonprofitDescription == input.NonprofitDescription || - (this.NonprofitDescription != null && - this.NonprofitDescription.Equals(input.NonprofitDescription)) - ) && - ( - this.NonprofitName == input.NonprofitName || - (this.NonprofitName != null && - this.NonprofitName.Equals(input.NonprofitName)) - ) && - ( - this.NonprofitUrl == input.NonprofitUrl || - (this.NonprofitUrl != null && - this.NonprofitUrl.Equals(input.NonprofitUrl)) - ) && - ( - this.TermsAndConditionsUrl == input.TermsAndConditionsUrl || - (this.TermsAndConditionsUrl != null && - this.TermsAndConditionsUrl.Equals(input.TermsAndConditionsUrl)) - ); + + if (amounts.IsSet && amounts.Value == null) + throw new ArgumentNullException(nameof(amounts), "Property is not nullable for class DonationCampaign."); + + if (bannerUrl.IsSet && bannerUrl.Value == null) + throw new ArgumentNullException(nameof(bannerUrl), "Property is not nullable for class DonationCampaign."); + + if (campaignName.IsSet && campaignName.Value == null) + throw new ArgumentNullException(nameof(campaignName), "Property is not nullable for class DonationCampaign."); + + if (causeName.IsSet && causeName.Value == null) + throw new ArgumentNullException(nameof(causeName), "Property is not nullable for class DonationCampaign."); + + if (donation.IsSet && donation.Value == null) + throw new ArgumentNullException(nameof(donation), "Property is not nullable for class DonationCampaign."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class DonationCampaign."); + + if (logoUrl.IsSet && logoUrl.Value == null) + throw new ArgumentNullException(nameof(logoUrl), "Property is not nullable for class DonationCampaign."); + + if (nonprofitDescription.IsSet && nonprofitDescription.Value == null) + throw new ArgumentNullException(nameof(nonprofitDescription), "Property is not nullable for class DonationCampaign."); + + if (nonprofitName.IsSet && nonprofitName.Value == null) + throw new ArgumentNullException(nameof(nonprofitName), "Property is not nullable for class DonationCampaign."); + + if (nonprofitUrl.IsSet && nonprofitUrl.Value == null) + throw new ArgumentNullException(nameof(nonprofitUrl), "Property is not nullable for class DonationCampaign."); + + if (termsAndConditionsUrl.IsSet && termsAndConditionsUrl.Value == null) + throw new ArgumentNullException(nameof(termsAndConditionsUrl), "Property is not nullable for class DonationCampaign."); + + return new DonationCampaign(amounts, bannerUrl, campaignName, causeName, donation, id, logoUrl, nonprofitDescription, nonprofitName, nonprofitUrl, termsAndConditionsUrl); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DonationCampaign donationCampaign, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amounts != null) - { - hashCode = (hashCode * 59) + this.Amounts.GetHashCode(); - } - if (this.BannerUrl != null) - { - hashCode = (hashCode * 59) + this.BannerUrl.GetHashCode(); - } - if (this.CampaignName != null) - { - hashCode = (hashCode * 59) + this.CampaignName.GetHashCode(); - } - if (this.CauseName != null) - { - hashCode = (hashCode * 59) + this.CauseName.GetHashCode(); - } - if (this.Donation != null) - { - hashCode = (hashCode * 59) + this.Donation.GetHashCode(); - } - if (this.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - if (this.LogoUrl != null) - { - hashCode = (hashCode * 59) + this.LogoUrl.GetHashCode(); - } - if (this.NonprofitDescription != null) - { - hashCode = (hashCode * 59) + this.NonprofitDescription.GetHashCode(); - } - if (this.NonprofitName != null) - { - hashCode = (hashCode * 59) + this.NonprofitName.GetHashCode(); - } - if (this.NonprofitUrl != null) - { - hashCode = (hashCode * 59) + this.NonprofitUrl.GetHashCode(); - } - if (this.TermsAndConditionsUrl != null) - { - hashCode = (hashCode * 59) + this.TermsAndConditionsUrl.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, donationCampaign, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DonationCampaign donationCampaign, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (donationCampaign.AmountsOption.IsSet && donationCampaign.Amounts == null) + throw new ArgumentNullException(nameof(donationCampaign.Amounts), "Property is required for class DonationCampaign."); + + if (donationCampaign.BannerUrlOption.IsSet && donationCampaign.BannerUrl == null) + throw new ArgumentNullException(nameof(donationCampaign.BannerUrl), "Property is required for class DonationCampaign."); + + if (donationCampaign.CampaignNameOption.IsSet && donationCampaign.CampaignName == null) + throw new ArgumentNullException(nameof(donationCampaign.CampaignName), "Property is required for class DonationCampaign."); + + if (donationCampaign.CauseNameOption.IsSet && donationCampaign.CauseName == null) + throw new ArgumentNullException(nameof(donationCampaign.CauseName), "Property is required for class DonationCampaign."); + + if (donationCampaign.DonationOption.IsSet && donationCampaign.Donation == null) + throw new ArgumentNullException(nameof(donationCampaign.Donation), "Property is required for class DonationCampaign."); + + if (donationCampaign.IdOption.IsSet && donationCampaign.Id == null) + throw new ArgumentNullException(nameof(donationCampaign.Id), "Property is required for class DonationCampaign."); + + if (donationCampaign.LogoUrlOption.IsSet && donationCampaign.LogoUrl == null) + throw new ArgumentNullException(nameof(donationCampaign.LogoUrl), "Property is required for class DonationCampaign."); + + if (donationCampaign.NonprofitDescriptionOption.IsSet && donationCampaign.NonprofitDescription == null) + throw new ArgumentNullException(nameof(donationCampaign.NonprofitDescription), "Property is required for class DonationCampaign."); + + if (donationCampaign.NonprofitNameOption.IsSet && donationCampaign.NonprofitName == null) + throw new ArgumentNullException(nameof(donationCampaign.NonprofitName), "Property is required for class DonationCampaign."); + + if (donationCampaign.NonprofitUrlOption.IsSet && donationCampaign.NonprofitUrl == null) + throw new ArgumentNullException(nameof(donationCampaign.NonprofitUrl), "Property is required for class DonationCampaign."); + + if (donationCampaign.TermsAndConditionsUrlOption.IsSet && donationCampaign.TermsAndConditionsUrl == null) + throw new ArgumentNullException(nameof(donationCampaign.TermsAndConditionsUrl), "Property is required for class DonationCampaign."); + + if (donationCampaign.AmountsOption.IsSet) + { + writer.WritePropertyName("amounts"); + JsonSerializer.Serialize(writer, donationCampaign.Amounts, jsonSerializerOptions); + } + if (donationCampaign.BannerUrlOption.IsSet) + writer.WriteString("bannerUrl", donationCampaign.BannerUrl); + + if (donationCampaign.CampaignNameOption.IsSet) + writer.WriteString("campaignName", donationCampaign.CampaignName); + + if (donationCampaign.CauseNameOption.IsSet) + writer.WriteString("causeName", donationCampaign.CauseName); + + if (donationCampaign.DonationOption.IsSet) + { + writer.WritePropertyName("donation"); + JsonSerializer.Serialize(writer, donationCampaign.Donation, jsonSerializerOptions); + } + if (donationCampaign.IdOption.IsSet) + writer.WriteString("id", donationCampaign.Id); + + if (donationCampaign.LogoUrlOption.IsSet) + writer.WriteString("logoUrl", donationCampaign.LogoUrl); + + if (donationCampaign.NonprofitDescriptionOption.IsSet) + writer.WriteString("nonprofitDescription", donationCampaign.NonprofitDescription); + + if (donationCampaign.NonprofitNameOption.IsSet) + writer.WriteString("nonprofitName", donationCampaign.NonprofitName); + + if (donationCampaign.NonprofitUrlOption.IsSet) + writer.WriteString("nonprofitUrl", donationCampaign.NonprofitUrl); + + if (donationCampaign.TermsAndConditionsUrlOption.IsSet) + writer.WriteString("termsAndConditionsUrl", donationCampaign.TermsAndConditionsUrl); } } - } diff --git a/Adyen/Model/Checkout/DonationCampaignsRequest.cs b/Adyen/Model/Checkout/DonationCampaignsRequest.cs index 3a223fac1..ee068154a 100644 --- a/Adyen/Model/Checkout/DonationCampaignsRequest.cs +++ b/Adyen/Model/Checkout/DonationCampaignsRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,62 +14,65 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// DonationCampaignsRequest /// - [DataContract(Name = "DonationCampaignsRequest")] - public partial class DonationCampaignsRequest : IEquatable, IValidatableObject + public partial class DonationCampaignsRequest : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected DonationCampaignsRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). (required). - /// Locale on the shopper interaction device.. - /// Your merchant account identifier. (required). - public DonationCampaignsRequest(string currency = default(string), string locale = default(string), string merchantAccount = default(string)) + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). + /// Your merchant account identifier. + /// Locale on the shopper interaction device. + [JsonConstructor] + public DonationCampaignsRequest(string currency, string merchantAccount, Option locale = default) { - this.Currency = currency; - this.MerchantAccount = merchantAccount; - this.Locale = locale; + Currency = currency; + MerchantAccount = merchantAccount; + LocaleOption = locale; + OnCreated(); } + partial void OnCreated(); + /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). - [DataMember(Name = "currency", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("currency")] public string Currency { get; set; } - /// - /// Locale on the shopper interaction device. - /// - /// Locale on the shopper interaction device. - [DataMember(Name = "locale", EmitDefaultValue = false)] - public string Locale { get; set; } - /// /// Your merchant account identifier. /// /// Your merchant account identifier. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantAccount")] public string MerchantAccount { get; set; } + /// + /// Used to track the state of Locale + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LocaleOption { get; private set; } + + /// + /// Locale on the shopper interaction device. + /// + /// Locale on the shopper interaction device. + [JsonPropertyName("locale")] + public string Locale { get { return this.LocaleOption; } set { this.LocaleOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -80,93 +82,136 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class DonationCampaignsRequest {\n"); sb.Append(" Currency: ").Append(Currency).Append("\n"); - sb.Append(" Locale: ").Append(Locale).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" Locale: ").Append(Locale).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class DonationCampaignsRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override DonationCampaignsRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as DonationCampaignsRequest); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if DonationCampaignsRequest instances are equal - /// - /// Instance of DonationCampaignsRequest to be compared - /// Boolean - public bool Equals(DonationCampaignsRequest input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option currency = default; + Option merchantAccount = default; + Option locale = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "currency": + currency = new Option(utf8JsonReader.GetString()); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "locale": + locale = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Currency == input.Currency || - (this.Currency != null && - this.Currency.Equals(input.Currency)) - ) && - ( - this.Locale == input.Locale || - (this.Locale != null && - this.Locale.Equals(input.Locale)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ); + + if (!currency.IsSet) + throw new ArgumentException("Property is required for class DonationCampaignsRequest.", nameof(currency)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class DonationCampaignsRequest.", nameof(merchantAccount)); + + if (currency.IsSet && currency.Value == null) + throw new ArgumentNullException(nameof(currency), "Property is not nullable for class DonationCampaignsRequest."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class DonationCampaignsRequest."); + + if (locale.IsSet && locale.Value == null) + throw new ArgumentNullException(nameof(locale), "Property is not nullable for class DonationCampaignsRequest."); + + return new DonationCampaignsRequest(currency.Value, merchantAccount.Value, locale); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DonationCampaignsRequest donationCampaignsRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Currency != null) - { - hashCode = (hashCode * 59) + this.Currency.GetHashCode(); - } - if (this.Locale != null) - { - hashCode = (hashCode * 59) + this.Locale.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, donationCampaignsRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DonationCampaignsRequest donationCampaignsRequest, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (donationCampaignsRequest.Currency == null) + throw new ArgumentNullException(nameof(donationCampaignsRequest.Currency), "Property is required for class DonationCampaignsRequest."); + + if (donationCampaignsRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(donationCampaignsRequest.MerchantAccount), "Property is required for class DonationCampaignsRequest."); + + if (donationCampaignsRequest.LocaleOption.IsSet && donationCampaignsRequest.Locale == null) + throw new ArgumentNullException(nameof(donationCampaignsRequest.Locale), "Property is required for class DonationCampaignsRequest."); + + writer.WriteString("currency", donationCampaignsRequest.Currency); + + writer.WriteString("merchantAccount", donationCampaignsRequest.MerchantAccount); + + if (donationCampaignsRequest.LocaleOption.IsSet) + writer.WriteString("locale", donationCampaignsRequest.Locale); } } - } diff --git a/Adyen/Model/Checkout/DonationCampaignsResponse.cs b/Adyen/Model/Checkout/DonationCampaignsResponse.cs index 3793ecbb6..d7cb7db44 100644 --- a/Adyen/Model/Checkout/DonationCampaignsResponse.cs +++ b/Adyen/Model/Checkout/DonationCampaignsResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,38 +14,46 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// DonationCampaignsResponse /// - [DataContract(Name = "DonationCampaignsResponse")] - public partial class DonationCampaignsResponse : IEquatable, IValidatableObject + public partial class DonationCampaignsResponse : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// List of active donation campaigns for your merchant account.. - public DonationCampaignsResponse(List donationCampaigns = default(List)) + /// List of active donation campaigns for your merchant account. + [JsonConstructor] + public DonationCampaignsResponse(Option> donationCampaigns = default) { - this.DonationCampaigns = donationCampaigns; + DonationCampaignsOption = donationCampaigns; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of DonationCampaigns + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> DonationCampaignsOption { get; private set; } + /// /// List of active donation campaigns for your merchant account. /// /// List of active donation campaigns for your merchant account. - [DataMember(Name = "donationCampaigns", EmitDefaultValue = false)] - public List DonationCampaigns { get; set; } + [JsonPropertyName("donationCampaigns")] + public List DonationCampaigns { get { return this.DonationCampaignsOption; } set { this.DonationCampaignsOption = new Option>(value); } } /// /// Returns the string presentation of the object @@ -62,69 +69,103 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class DonationCampaignsResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override DonationCampaignsResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as DonationCampaignsResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if DonationCampaignsResponse instances are equal - /// - /// Instance of DonationCampaignsResponse to be compared - /// Boolean - public bool Equals(DonationCampaignsResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option> donationCampaigns = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "donationCampaigns": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + donationCampaigns = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.DonationCampaigns == input.DonationCampaigns || - this.DonationCampaigns != null && - input.DonationCampaigns != null && - this.DonationCampaigns.SequenceEqual(input.DonationCampaigns) - ); + + if (donationCampaigns.IsSet && donationCampaigns.Value == null) + throw new ArgumentNullException(nameof(donationCampaigns), "Property is not nullable for class DonationCampaignsResponse."); + + return new DonationCampaignsResponse(donationCampaigns); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DonationCampaignsResponse donationCampaignsResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.DonationCampaigns != null) - { - hashCode = (hashCode * 59) + this.DonationCampaigns.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, donationCampaignsResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DonationCampaignsResponse donationCampaignsResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (donationCampaignsResponse.DonationCampaignsOption.IsSet && donationCampaignsResponse.DonationCampaigns == null) + throw new ArgumentNullException(nameof(donationCampaignsResponse.DonationCampaigns), "Property is required for class DonationCampaignsResponse."); + + if (donationCampaignsResponse.DonationCampaignsOption.IsSet) + { + writer.WritePropertyName("donationCampaigns"); + JsonSerializer.Serialize(writer, donationCampaignsResponse.DonationCampaigns, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/DonationPaymentMethod.cs b/Adyen/Model/Checkout/DonationPaymentMethod.cs index 4049c4ae2..0daced182 100644 --- a/Adyen/Model/Checkout/DonationPaymentMethod.cs +++ b/Adyen/Model/Checkout/DonationPaymentMethod.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,175 +14,96 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; -using System.Reflection; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// The type and required details of a payment method to use. /// - [JsonConverter(typeof(DonationPaymentMethodJsonConverter))] - [DataContract(Name = "DonationPaymentMethod")] - public partial class DonationPaymentMethod : AbstractOpenAPISchema, IEquatable, IValidatableObject + public partial class DonationPaymentMethod : IValidatableObject { /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of ApplePayDonations. - public DonationPaymentMethod(ApplePayDonations actualInstance) + /// + public DonationPaymentMethod(ApplePayDonations applePayDonations) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + ApplePayDonations = applePayDonations; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of CardDonations. - public DonationPaymentMethod(CardDonations actualInstance) + /// + public DonationPaymentMethod(CardDonations cardDonations) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + CardDonations = cardDonations; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of GooglePayDonations. - public DonationPaymentMethod(GooglePayDonations actualInstance) + /// + public DonationPaymentMethod(GooglePayDonations googlePayDonations) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + GooglePayDonations = googlePayDonations; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of IdealDonations. - public DonationPaymentMethod(IdealDonations actualInstance) + /// + public DonationPaymentMethod(IdealDonations idealDonations) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IdealDonations = idealDonations; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of PayWithGoogleDonations. - public DonationPaymentMethod(PayWithGoogleDonations actualInstance) + /// + public DonationPaymentMethod(PayWithGoogleDonations payWithGoogleDonations) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + PayWithGoogleDonations = payWithGoogleDonations; + OnCreated(); } - - private Object _actualInstance; + partial void OnCreated(); /// - /// Gets or Sets ActualInstance + /// Gets or Sets ApplePayDonations /// - public override Object ActualInstance - { - get - { - return _actualInstance; - } - set - { - if (value.GetType() == typeof(ApplePayDonations)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(CardDonations)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(GooglePayDonations)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(IdealDonations)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(PayWithGoogleDonations)) - { - this._actualInstance = value; - } - else - { - throw new ArgumentException("Invalid instance found. Must be the following types: ApplePayDonations, CardDonations, GooglePayDonations, IdealDonations, PayWithGoogleDonations"); - } - } - } + public ApplePayDonations ApplePayDonations { get; set; } /// - /// Get the actual instance of `ApplePayDonations`. If the actual instance is not `ApplePayDonations`, - /// the InvalidClassException will be thrown + /// Gets or Sets CardDonations /// - /// An instance of ApplePayDonations - public ApplePayDonations GetApplePayDonations() - { - return (ApplePayDonations)this.ActualInstance; - } + public CardDonations CardDonations { get; set; } /// - /// Get the actual instance of `CardDonations`. If the actual instance is not `CardDonations`, - /// the InvalidClassException will be thrown + /// Gets or Sets GooglePayDonations /// - /// An instance of CardDonations - public CardDonations GetCardDonations() - { - return (CardDonations)this.ActualInstance; - } + public GooglePayDonations GooglePayDonations { get; set; } /// - /// Get the actual instance of `GooglePayDonations`. If the actual instance is not `GooglePayDonations`, - /// the InvalidClassException will be thrown + /// Gets or Sets IdealDonations /// - /// An instance of GooglePayDonations - public GooglePayDonations GetGooglePayDonations() - { - return (GooglePayDonations)this.ActualInstance; - } + public IdealDonations IdealDonations { get; set; } /// - /// Get the actual instance of `IdealDonations`. If the actual instance is not `IdealDonations`, - /// the InvalidClassException will be thrown + /// Gets or Sets PayWithGoogleDonations /// - /// An instance of IdealDonations - public IdealDonations GetIdealDonations() - { - return (IdealDonations)this.ActualInstance; - } - - /// - /// Get the actual instance of `PayWithGoogleDonations`. If the actual instance is not `PayWithGoogleDonations`, - /// the InvalidClassException will be thrown - /// - /// An instance of PayWithGoogleDonations - public PayWithGoogleDonations GetPayWithGoogleDonations() - { - return (PayWithGoogleDonations)this.ActualInstance; - } + public PayWithGoogleDonations PayWithGoogleDonations { get; set; } /// /// Returns the string presentation of the object @@ -191,190 +111,143 @@ public PayWithGoogleDonations GetPayWithGoogleDonations() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DonationPaymentMethod {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public override string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return JsonConvert.SerializeObject(this.ActualInstance, DonationPaymentMethod.SerializerSettings); + yield break; } + } + /// + /// A Json converter for type + /// + public class DonationPaymentMethodJsonConverter : JsonConverter + { /// - /// Converts the JSON string into an instance of DonationPaymentMethod + /// Deserializes json to /// - /// JSON string - /// An instance of DonationPaymentMethod - public static DonationPaymentMethod FromJson(string jsonString) + /// + /// + /// + /// + /// + public override DonationPaymentMethod Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - DonationPaymentMethod newDonationPaymentMethod = null; + int currentDepth = utf8JsonReader.CurrentDepth; - if (string.IsNullOrEmpty(jsonString)) - { - return newDonationPaymentMethod; - } - int match = 0; - List matchedTypes = new List(); - JToken typeToken = JObject.Parse(jsonString).GetValue("type"); - string type = typeToken?.Value(); - // Throw exception if jsonString does not contain type param - if (type == null) - { - throw new InvalidDataException("JsonString does not contain required enum type for deserialization."); - } - try + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + ApplePayDonations applePayDonations = default; + CardDonations cardDonations = default; + GooglePayDonations googlePayDonations = default; + IdealDonations idealDonations = default; + PayWithGoogleDonations payWithGoogleDonations = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) { - // Check if the jsonString type enum matches the ApplePayDonations type enums - if (ContainsValue(type)) - { - newDonationPaymentMethod = new DonationPaymentMethod(JsonConvert.DeserializeObject(jsonString, DonationPaymentMethod.SerializerSettings)); - matchedTypes.Add("ApplePayDonations"); - match++; - } - // Check if the jsonString type enum matches the CardDonations type enums - if (ContainsValue(type)) - { - newDonationPaymentMethod = new DonationPaymentMethod(JsonConvert.DeserializeObject(jsonString, DonationPaymentMethod.SerializerSettings)); - matchedTypes.Add("CardDonations"); - match++; - } - // Check if the jsonString type enum matches the GooglePayDonations type enums - if (ContainsValue(type)) - { - newDonationPaymentMethod = new DonationPaymentMethod(JsonConvert.DeserializeObject(jsonString, DonationPaymentMethod.SerializerSettings)); - matchedTypes.Add("GooglePayDonations"); - match++; - } - // Check if the jsonString type enum matches the IdealDonations type enums - if (ContainsValue(type)) - { - newDonationPaymentMethod = new DonationPaymentMethod(JsonConvert.DeserializeObject(jsonString, DonationPaymentMethod.SerializerSettings)); - matchedTypes.Add("IdealDonations"); - match++; - } - // Check if the jsonString type enum matches the PayWithGoogleDonations type enums - if (ContainsValue(type)) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) { - newDonationPaymentMethod = new DonationPaymentMethod(JsonConvert.DeserializeObject(jsonString, DonationPaymentMethod.SerializerSettings)); - matchedTypes.Add("PayWithGoogleDonations"); - match++; + Utf8JsonReader utf8JsonReaderApplePayDonations = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApplePayDonations, jsonSerializerOptions, out applePayDonations); + + Utf8JsonReader utf8JsonReaderCardDonations = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderCardDonations, jsonSerializerOptions, out cardDonations); + + Utf8JsonReader utf8JsonReaderGooglePayDonations = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderGooglePayDonations, jsonSerializerOptions, out googlePayDonations); + + Utf8JsonReader utf8JsonReaderIdealDonations = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderIdealDonations, jsonSerializerOptions, out idealDonations); + + Utf8JsonReader utf8JsonReaderPayWithGoogleDonations = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderPayWithGoogleDonations, jsonSerializerOptions, out payWithGoogleDonations); } - } - catch (Exception ex) + } + + while (utf8JsonReader.Read()) { - if (!(ex is JsonSerializationException)) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - throw new InvalidDataException(string.Format("Failed to deserialize `{0}` into target: {1}", jsonString, ex.ToString())); + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + default: + break; + } } } - if (match != 1) - { - throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined. MatchedTypes are: " + matchedTypes); - } - - // deserialization is considered successful at this point if no exception has been thrown. - return newDonationPaymentMethod; - } + if (applePayDonations != null) + return new DonationPaymentMethod(applePayDonations); - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as DonationPaymentMethod); - } + if (cardDonations != null) + return new DonationPaymentMethod(cardDonations); - /// - /// Returns true if DonationPaymentMethod instances are equal - /// - /// Instance of DonationPaymentMethod to be compared - /// Boolean - public bool Equals(DonationPaymentMethod input) - { - if (input == null) - return false; + if (googlePayDonations != null) + return new DonationPaymentMethod(googlePayDonations); - return this.ActualInstance.Equals(input.ActualInstance); - } + if (idealDonations != null) + return new DonationPaymentMethod(idealDonations); - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); - return hashCode; - } - } + if (payWithGoogleDonations != null) + return new DonationPaymentMethod(payWithGoogleDonations); - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; + throw new JsonException(); } - } - /// - /// Custom JSON converter for DonationPaymentMethod - /// - public class DonationPaymentMethodJsonConverter : JsonConverter - { /// - /// To write the JSON string + /// Serializes a /// - /// JSON writer - /// Object to be converted into a JSON string - /// JSON Serializer - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DonationPaymentMethod donationPaymentMethod, JsonSerializerOptions jsonSerializerOptions) { - writer.WriteRawValue((string)(typeof(DonationPaymentMethod).GetMethod("ToJson").Invoke(value, null))); - } + writer.WriteStartObject(); - /// - /// To convert a JSON string into an object - /// - /// JSON reader - /// Object type - /// Existing value - /// JSON Serializer - /// The object converted from the JSON string - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - if(reader.TokenType != JsonToken.Null) - { - return DonationPaymentMethod.FromJson(JObject.Load(reader).ToString(Formatting.None)); - } - return null; + WriteProperties(writer, donationPaymentMethod, jsonSerializerOptions); + writer.WriteEndObject(); } /// - /// Check if the object can be converted + /// Serializes the properties of /// - /// Object type - /// True if the object can be converted - public override bool CanConvert(Type objectType) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DonationPaymentMethod donationPaymentMethod, JsonSerializerOptions jsonSerializerOptions) { - return false; + } } - } diff --git a/Adyen/Model/Checkout/DonationPaymentRequest.cs b/Adyen/Model/Checkout/DonationPaymentRequest.cs index bec73d6fa..656d5d7f7 100644 --- a/Adyen/Model/Checkout/DonationPaymentRequest.cs +++ b/Adyen/Model/Checkout/DonationPaymentRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,489 +14,914 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// DonationPaymentRequest /// - [DataContract(Name = "DonationPaymentRequest")] - public partial class DonationPaymentRequest : IEquatable, IValidatableObject + public partial class DonationPaymentRequest : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The merchant account identifier, with which you want to process the transaction. + /// paymentMethod + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// accountInfo + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + /// applicationInfo + /// authenticationData + /// billingAddress + /// browserInfo + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web + /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + /// deliveryAddress + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + /// Donation account to which the transaction is credited. + /// The donation campaign ID received in the `/donationCampaigns` call. + /// PSP reference of the transaction from which the donation token is generated. Required when `donationToken` is provided. + /// Donation token received in the `/payments` call. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. + /// merchantRiskIndicator + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + /// mpiData + /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. + /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// The combination of a language code and a country code to specify the language to be used in the payment. + /// shopperName + /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + /// The shopper's social security number. + /// The shopper's telephone number. + /// threeDS2RequestData + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) + [JsonConstructor] + public DonationPaymentRequest(Amount amount, string merchantAccount, DonationPaymentMethod paymentMethod, string reference, string returnUrl, Option accountInfo = default, Option> additionalData = default, Option applicationInfo = default, Option authenticationData = default, Option billingAddress = default, Option browserInfo = default, Option channel = default, Option checkoutAttemptId = default, Option conversionId = default, Option countryCode = default, Option dateOfBirth = default, Option deliverAt = default, Option deliveryAddress = default, Option deviceFingerprint = default, Option donationAccount = default, Option donationCampaignId = default, Option donationOriginalPspReference = default, Option donationToken = default, Option> lineItems = default, Option merchantRiskIndicator = default, Option> metadata = default, Option mpiData = default, Option origin = default, Option recurringProcessingModel = default, Option redirectFromIssuerMethod = default, Option redirectToIssuerMethod = default, Option sessionValidity = default, Option shopperEmail = default, Option shopperIP = default, Option shopperInteraction = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option socialSecurityNumber = default, Option telephoneNumber = default, Option threeDS2RequestData = default, Option threeDSAuthenticationOnly = default) + { + Amount = amount; + MerchantAccount = merchantAccount; + PaymentMethod = paymentMethod; + Reference = reference; + ReturnUrl = returnUrl; + AccountInfoOption = accountInfo; + AdditionalDataOption = additionalData; + ApplicationInfoOption = applicationInfo; + AuthenticationDataOption = authenticationData; + BillingAddressOption = billingAddress; + BrowserInfoOption = browserInfo; + ChannelOption = channel; + CheckoutAttemptIdOption = checkoutAttemptId; + ConversionIdOption = conversionId; + CountryCodeOption = countryCode; + DateOfBirthOption = dateOfBirth; + DeliverAtOption = deliverAt; + DeliveryAddressOption = deliveryAddress; + DeviceFingerprintOption = deviceFingerprint; + DonationAccountOption = donationAccount; + DonationCampaignIdOption = donationCampaignId; + DonationOriginalPspReferenceOption = donationOriginalPspReference; + DonationTokenOption = donationToken; + LineItemsOption = lineItems; + MerchantRiskIndicatorOption = merchantRiskIndicator; + MetadataOption = metadata; + MpiDataOption = mpiData; + OriginOption = origin; + RecurringProcessingModelOption = recurringProcessingModel; + RedirectFromIssuerMethodOption = redirectFromIssuerMethod; + RedirectToIssuerMethodOption = redirectToIssuerMethod; + SessionValidityOption = sessionValidity; + ShopperEmailOption = shopperEmail; + ShopperIPOption = shopperIP; + ShopperInteractionOption = shopperInteraction; + ShopperLocaleOption = shopperLocale; + ShopperNameOption = shopperName; + ShopperReferenceOption = shopperReference; + SocialSecurityNumberOption = socialSecurityNumber; + TelephoneNumberOption = telephoneNumber; + ThreeDS2RequestDataOption = threeDS2RequestData; + ThreeDSAuthenticationOnlyOption = threeDSAuthenticationOnly; + OnCreated(); + } + + partial void OnCreated(); + /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web - [JsonConverter(typeof(StringEnumConverter))] public enum ChannelEnum { /// /// Enum IOS for value: iOS /// - [EnumMember(Value = "iOS")] IOS = 1, /// /// Enum Android for value: Android /// - [EnumMember(Value = "Android")] Android = 2, /// /// Enum Web for value: Web /// - [EnumMember(Value = "Web")] Web = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ChannelEnum ChannelEnumFromString(string value) + { + if (value.Equals("iOS")) + return ChannelEnum.IOS; + + if (value.Equals("Android")) + return ChannelEnum.Android; + + if (value.Equals("Web")) + return ChannelEnum.Web; + + throw new NotImplementedException($"Could not convert value to type ChannelEnum: '{value}'"); + } + /// + /// Returns a + /// + /// + /// + public static ChannelEnum? ChannelEnumFromStringOrDefault(string value) + { + if (value.Equals("iOS")) + return ChannelEnum.IOS; + + if (value.Equals("Android")) + return ChannelEnum.Android; + + if (value.Equals("Web")) + return ChannelEnum.Web; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChannelEnumToJsonValue(ChannelEnum? value) + { + if (value == ChannelEnum.IOS) + return "iOS"; + + if (value == ChannelEnum.Android) + return "Android"; + + if (value == ChannelEnum.Web) + return "Web"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Channel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChannelOption { get; private set; } /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web - [DataMember(Name = "channel", EmitDefaultValue = false)] - public ChannelEnum? Channel { get; set; } + [JsonPropertyName("channel")] + public ChannelEnum? Channel { get { return this.ChannelOption; } set { this.ChannelOption = new Option(value); } } + /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// - [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// - [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// - [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) + { + if (value == RecurringProcessingModelEnum.CardOnFile) + return "CardOnFile"; + + if (value == RecurringProcessingModelEnum.Subscription) + return "Subscription"; + + if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) + return "UnscheduledCardOnFile"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of RecurringProcessingModel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] - public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } + [JsonPropertyName("recurringProcessingModel")] + public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } + /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [JsonConverter(typeof(StringEnumConverter))] public enum ShopperInteractionEnum { /// /// Enum Ecommerce for value: Ecommerce /// - [EnumMember(Value = "Ecommerce")] Ecommerce = 1, /// /// Enum ContAuth for value: ContAuth /// - [EnumMember(Value = "ContAuth")] ContAuth = 2, /// /// Enum Moto for value: Moto /// - [EnumMember(Value = "Moto")] Moto = 3, /// /// Enum POS for value: POS /// - [EnumMember(Value = "POS")] POS = 4 + } + /// + /// Returns a + /// + /// + /// + /// + public static ShopperInteractionEnum ShopperInteractionEnumFromString(string value) + { + if (value.Equals("Ecommerce")) + return ShopperInteractionEnum.Ecommerce; + + if (value.Equals("ContAuth")) + return ShopperInteractionEnum.ContAuth; + + if (value.Equals("Moto")) + return ShopperInteractionEnum.Moto; + + if (value.Equals("POS")) + return ShopperInteractionEnum.POS; + + throw new NotImplementedException($"Could not convert value to type ShopperInteractionEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static ShopperInteractionEnum? ShopperInteractionEnumFromStringOrDefault(string value) + { + if (value.Equals("Ecommerce")) + return ShopperInteractionEnum.Ecommerce; + + if (value.Equals("ContAuth")) + return ShopperInteractionEnum.ContAuth; + + if (value.Equals("Moto")) + return ShopperInteractionEnum.Moto; + + if (value.Equals("POS")) + return ShopperInteractionEnum.POS; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ShopperInteractionEnumToJsonValue(ShopperInteractionEnum? value) + { + if (value == ShopperInteractionEnum.Ecommerce) + return "Ecommerce"; + + if (value == ShopperInteractionEnum.ContAuth) + return "ContAuth"; + + if (value == ShopperInteractionEnum.Moto) + return "Moto"; + + if (value == ShopperInteractionEnum.POS) + return "POS"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ShopperInteraction + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperInteractionOption { get; private set; } /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] - public ShopperInteractionEnum? ShopperInteraction { get; set; } + [JsonPropertyName("shopperInteraction")] + public ShopperInteractionEnum? ShopperInteraction { get { return this.ShopperInteractionOption; } set { this.ShopperInteractionOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Gets or Sets Amount /// - [JsonConstructorAttribute] - protected DonationPaymentRequest() { } + [JsonPropertyName("amount")] + public Amount Amount { get; set; } + /// - /// Initializes a new instance of the class. + /// The merchant account identifier, with which you want to process the transaction. /// - /// accountInfo. - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. - /// amount (required). - /// applicationInfo. - /// authenticationData. - /// billingAddress. - /// browserInfo. - /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web. - /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey.. - /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey.. - /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE. - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00. - /// deliveryAddress. - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting).. - /// Donation account to which the transaction is credited.. - /// The donation campaign ID received in the `/donationCampaigns` call.. - /// PSP reference of the transaction from which the donation token is generated. Required when `donationToken` is provided.. - /// Donation token received in the `/payments` call.. - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip.. - /// The merchant account identifier, with which you want to process the transaction. (required). - /// merchantRiskIndicator. - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. . - /// mpiData. - /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from.. - /// paymentMethod (required). - /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer.. - /// Specifies the redirect method (GET or POST) when redirecting to the issuer.. - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. (required). - /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. (required). - /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00. - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations.. - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new).. - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. - /// The combination of a language code and a country code to specify the language to be used in the payment.. - /// shopperName. - /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address.. - /// The shopper's social security number.. - /// The shopper's telephone number.. - /// threeDS2RequestData. - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false). - public DonationPaymentRequest(AccountInfo accountInfo = default(AccountInfo), Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), AuthenticationData authenticationData = default(AuthenticationData), BillingAddress billingAddress = default(BillingAddress), BrowserInfo browserInfo = default(BrowserInfo), ChannelEnum? channel = default(ChannelEnum?), string checkoutAttemptId = default(string), string conversionId = default(string), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), DateTime deliverAt = default(DateTime), DeliveryAddress deliveryAddress = default(DeliveryAddress), string deviceFingerprint = default(string), string donationAccount = default(string), string donationCampaignId = default(string), string donationOriginalPspReference = default(string), string donationToken = default(string), List lineItems = default(List), string merchantAccount = default(string), MerchantRiskIndicator merchantRiskIndicator = default(MerchantRiskIndicator), Dictionary metadata = default(Dictionary), ThreeDSecureData mpiData = default(ThreeDSecureData), string origin = default(string), DonationPaymentMethod paymentMethod = default(DonationPaymentMethod), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string redirectFromIssuerMethod = default(string), string redirectToIssuerMethod = default(string), string reference = default(string), string returnUrl = default(string), string sessionValidity = default(string), string shopperEmail = default(string), string shopperIP = default(string), ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string socialSecurityNumber = default(string), string telephoneNumber = default(string), ThreeDS2RequestFields threeDS2RequestData = default(ThreeDS2RequestFields), bool? threeDSAuthenticationOnly = false) - { - this.Amount = amount; - this.MerchantAccount = merchantAccount; - this.PaymentMethod = paymentMethod; - this.Reference = reference; - this.ReturnUrl = returnUrl; - this.AccountInfo = accountInfo; - this.AdditionalData = additionalData; - this.ApplicationInfo = applicationInfo; - this.AuthenticationData = authenticationData; - this.BillingAddress = billingAddress; - this.BrowserInfo = browserInfo; - this.Channel = channel; - this.CheckoutAttemptId = checkoutAttemptId; - this.ConversionId = conversionId; - this.CountryCode = countryCode; - this.DateOfBirth = dateOfBirth; - this.DeliverAt = deliverAt; - this.DeliveryAddress = deliveryAddress; - this.DeviceFingerprint = deviceFingerprint; - this.DonationAccount = donationAccount; - this.DonationCampaignId = donationCampaignId; - this.DonationOriginalPspReference = donationOriginalPspReference; - this.DonationToken = donationToken; - this.LineItems = lineItems; - this.MerchantRiskIndicator = merchantRiskIndicator; - this.Metadata = metadata; - this.MpiData = mpiData; - this.Origin = origin; - this.RecurringProcessingModel = recurringProcessingModel; - this.RedirectFromIssuerMethod = redirectFromIssuerMethod; - this.RedirectToIssuerMethod = redirectToIssuerMethod; - this.SessionValidity = sessionValidity; - this.ShopperEmail = shopperEmail; - this.ShopperIP = shopperIP; - this.ShopperInteraction = shopperInteraction; - this.ShopperLocale = shopperLocale; - this.ShopperName = shopperName; - this.ShopperReference = shopperReference; - this.SocialSecurityNumber = socialSecurityNumber; - this.TelephoneNumber = telephoneNumber; - this.ThreeDS2RequestData = threeDS2RequestData; - this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; - } + /// The merchant account identifier, with which you want to process the transaction. + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get; set; } + + /// + /// Gets or Sets PaymentMethod + /// + [JsonPropertyName("paymentMethod")] + public DonationPaymentMethod PaymentMethod { get; set; } + + /// + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + /// + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + [JsonPropertyName("reference")] + public string Reference { get; set; } + + /// + /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// + /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + [JsonPropertyName("returnUrl")] + public string ReturnUrl { get; set; } + + /// + /// Used to track the state of AccountInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountInfoOption { get; private set; } /// /// Gets or Sets AccountInfo /// - [DataMember(Name = "accountInfo", EmitDefaultValue = false)] - public AccountInfo AccountInfo { get; set; } + [JsonPropertyName("accountInfo")] + public AccountInfo AccountInfo { get { return this.AccountInfoOption; } set { this.AccountInfoOption = new Option(value); } } + + /// + /// Used to track the state of AdditionalData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AdditionalDataOption { get; private set; } /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - [DataMember(Name = "additionalData", EmitDefaultValue = false)] - public Dictionary AdditionalData { get; set; } + [JsonPropertyName("additionalData")] + public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } /// - /// Gets or Sets Amount + /// Used to track the state of ApplicationInfo /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ApplicationInfoOption { get; private set; } /// /// Gets or Sets ApplicationInfo /// - [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; set; } + [JsonPropertyName("applicationInfo")] + public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + + /// + /// Used to track the state of AuthenticationData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthenticationDataOption { get; private set; } /// /// Gets or Sets AuthenticationData /// - [DataMember(Name = "authenticationData", EmitDefaultValue = false)] - public AuthenticationData AuthenticationData { get; set; } + [JsonPropertyName("authenticationData")] + public AuthenticationData AuthenticationData { get { return this.AuthenticationDataOption; } set { this.AuthenticationDataOption = new Option(value); } } + + /// + /// Used to track the state of BillingAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressOption { get; private set; } /// /// Gets or Sets BillingAddress /// - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public BillingAddress BillingAddress { get; set; } + [JsonPropertyName("billingAddress")] + public BillingAddress BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } + + /// + /// Used to track the state of BrowserInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BrowserInfoOption { get; private set; } /// /// Gets or Sets BrowserInfo /// - [DataMember(Name = "browserInfo", EmitDefaultValue = false)] - public BrowserInfo BrowserInfo { get; set; } + [JsonPropertyName("browserInfo")] + public BrowserInfo BrowserInfo { get { return this.BrowserInfoOption; } set { this.BrowserInfoOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. /// /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of ConversionId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ConversionIdOption { get; private set; } /// /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. /// /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - [DataMember(Name = "conversionId", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v68. Use `checkoutAttemptId` instead")] - public string ConversionId { get; set; } + [JsonPropertyName("conversionId")] + [Obsolete] + public string ConversionId { get { return this.ConversionIdOption; } set { this.ConversionIdOption = new Option(value); } } + + /// + /// Used to track the state of CountryCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryCodeOption { get; private set; } /// /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE /// /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE - [DataMember(Name = "countryCode", EmitDefaultValue = false)] - public string CountryCode { get; set; } + [JsonPropertyName("countryCode")] + public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } + + /// + /// Used to track the state of DateOfBirth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DateOfBirthOption { get; private set; } /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] - public DateTime DateOfBirth { get; set; } + [JsonPropertyName("dateOfBirth")] + public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } + + /// + /// Used to track the state of DeliverAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliverAtOption { get; private set; } /// /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 /// /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - [DataMember(Name = "deliverAt", EmitDefaultValue = false)] - public DateTime DeliverAt { get; set; } + [JsonPropertyName("deliverAt")] + public DateTime? DeliverAt { get { return this.DeliverAtOption; } set { this.DeliverAtOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryAddressOption { get; private set; } /// /// Gets or Sets DeliveryAddress /// - [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] - public DeliveryAddress DeliveryAddress { get; set; } + [JsonPropertyName("deliveryAddress")] + public DeliveryAddress DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } + + /// + /// Used to track the state of DeviceFingerprint + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeviceFingerprintOption { get; private set; } /// /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). /// /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - [DataMember(Name = "deviceFingerprint", EmitDefaultValue = false)] - public string DeviceFingerprint { get; set; } + [JsonPropertyName("deviceFingerprint")] + public string DeviceFingerprint { get { return this.DeviceFingerprintOption; } set { this.DeviceFingerprintOption = new Option(value); } } + + /// + /// Used to track the state of DonationAccount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DonationAccountOption { get; private set; } /// /// Donation account to which the transaction is credited. /// /// Donation account to which the transaction is credited. - [DataMember(Name = "donationAccount", EmitDefaultValue = false)] - public string DonationAccount { get; set; } + [JsonPropertyName("donationAccount")] + public string DonationAccount { get { return this.DonationAccountOption; } set { this.DonationAccountOption = new Option(value); } } + + /// + /// Used to track the state of DonationCampaignId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DonationCampaignIdOption { get; private set; } /// /// The donation campaign ID received in the `/donationCampaigns` call. /// /// The donation campaign ID received in the `/donationCampaigns` call. - [DataMember(Name = "donationCampaignId", EmitDefaultValue = false)] - public string DonationCampaignId { get; set; } + [JsonPropertyName("donationCampaignId")] + public string DonationCampaignId { get { return this.DonationCampaignIdOption; } set { this.DonationCampaignIdOption = new Option(value); } } + + /// + /// Used to track the state of DonationOriginalPspReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DonationOriginalPspReferenceOption { get; private set; } /// /// PSP reference of the transaction from which the donation token is generated. Required when `donationToken` is provided. /// /// PSP reference of the transaction from which the donation token is generated. Required when `donationToken` is provided. - [DataMember(Name = "donationOriginalPspReference", EmitDefaultValue = false)] - public string DonationOriginalPspReference { get; set; } + [JsonPropertyName("donationOriginalPspReference")] + public string DonationOriginalPspReference { get { return this.DonationOriginalPspReferenceOption; } set { this.DonationOriginalPspReferenceOption = new Option(value); } } + + /// + /// Used to track the state of DonationToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DonationTokenOption { get; private set; } /// /// Donation token received in the `/payments` call. /// /// Donation token received in the `/payments` call. - [DataMember(Name = "donationToken", EmitDefaultValue = false)] - public string DonationToken { get; set; } + [JsonPropertyName("donationToken")] + public string DonationToken { get { return this.DonationTokenOption; } set { this.DonationTokenOption = new Option(value); } } + + /// + /// Used to track the state of LineItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LineItemsOption { get; private set; } /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. - [DataMember(Name = "lineItems", EmitDefaultValue = false)] - public List LineItems { get; set; } + [JsonPropertyName("lineItems")] + public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } /// - /// The merchant account identifier, with which you want to process the transaction. + /// Used to track the state of MerchantRiskIndicator /// - /// The merchant account identifier, with which you want to process the transaction. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantRiskIndicatorOption { get; private set; } /// /// Gets or Sets MerchantRiskIndicator /// - [DataMember(Name = "merchantRiskIndicator", EmitDefaultValue = false)] - public MerchantRiskIndicator MerchantRiskIndicator { get; set; } + [JsonPropertyName("merchantRiskIndicator")] + public MerchantRiskIndicator MerchantRiskIndicator { get { return this.MerchantRiskIndicatorOption; } set { this.MerchantRiskIndicatorOption = new Option(value); } } + + /// + /// Used to track the state of Metadata + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> MetadataOption { get; private set; } /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - [DataMember(Name = "metadata", EmitDefaultValue = false)] - public Dictionary Metadata { get; set; } + [JsonPropertyName("metadata")] + public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } + + /// + /// Used to track the state of MpiData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MpiDataOption { get; private set; } /// /// Gets or Sets MpiData /// - [DataMember(Name = "mpiData", EmitDefaultValue = false)] - public ThreeDSecureData MpiData { get; set; } + [JsonPropertyName("mpiData")] + public ThreeDSecureData MpiData { get { return this.MpiDataOption; } set { this.MpiDataOption = new Option(value); } } + + /// + /// Used to track the state of Origin + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OriginOption { get; private set; } /// /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. /// /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. - [DataMember(Name = "origin", EmitDefaultValue = false)] - public string Origin { get; set; } + [JsonPropertyName("origin")] + public string Origin { get { return this.OriginOption; } set { this.OriginOption = new Option(value); } } /// - /// Gets or Sets PaymentMethod + /// Used to track the state of RedirectFromIssuerMethod /// - [DataMember(Name = "paymentMethod", IsRequired = false, EmitDefaultValue = false)] - public DonationPaymentMethod PaymentMethod { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RedirectFromIssuerMethodOption { get; private set; } /// /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. /// /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. - [DataMember(Name = "redirectFromIssuerMethod", EmitDefaultValue = false)] - public string RedirectFromIssuerMethod { get; set; } + [JsonPropertyName("redirectFromIssuerMethod")] + public string RedirectFromIssuerMethod { get { return this.RedirectFromIssuerMethodOption; } set { this.RedirectFromIssuerMethodOption = new Option(value); } } /// - /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + /// Used to track the state of RedirectToIssuerMethod /// - /// Specifies the redirect method (GET or POST) when redirecting to the issuer. - [DataMember(Name = "redirectToIssuerMethod", EmitDefaultValue = false)] - public string RedirectToIssuerMethod { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RedirectToIssuerMethodOption { get; private set; } /// - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. /// - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] - public string Reference { get; set; } + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + [JsonPropertyName("redirectToIssuerMethod")] + public string RedirectToIssuerMethod { get { return this.RedirectToIssuerMethodOption; } set { this.RedirectToIssuerMethodOption = new Option(value); } } /// - /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// Used to track the state of SessionValidity /// - /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. - [DataMember(Name = "returnUrl", IsRequired = false, EmitDefaultValue = false)] - public string ReturnUrl { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SessionValidityOption { get; private set; } /// /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 /// /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 - [DataMember(Name = "sessionValidity", EmitDefaultValue = false)] - public string SessionValidity { get; set; } + [JsonPropertyName("sessionValidity")] + public string SessionValidity { get { return this.SessionValidityOption; } set { this.SessionValidityOption = new Option(value); } } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. /// /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of ShopperIP + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperIPOption { get; private set; } /// /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). /// /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - [DataMember(Name = "shopperIP", EmitDefaultValue = false)] - public string ShopperIP { get; set; } + [JsonPropertyName("shopperIP")] + public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } + + /// + /// Used to track the state of ShopperLocale + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperLocaleOption { get; private set; } /// /// The combination of a language code and a country code to specify the language to be used in the payment. /// /// The combination of a language code and a country code to specify the language to be used in the payment. - [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] - public string ShopperLocale { get; set; } + [JsonPropertyName("shopperLocale")] + public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } + + /// + /// Used to track the state of ShopperName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNameOption { get; private set; } /// /// Gets or Sets ShopperName /// - [DataMember(Name = "shopperName", EmitDefaultValue = false)] - public Name ShopperName { get; set; } + [JsonPropertyName("shopperName")] + public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } + + /// + /// Used to track the state of ShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperReferenceOption { get; private set; } /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - [DataMember(Name = "shopperReference", EmitDefaultValue = false)] - public string ShopperReference { get; set; } + [JsonPropertyName("shopperReference")] + public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of SocialSecurityNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SocialSecurityNumberOption { get; private set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] - public string SocialSecurityNumber { get; set; } + [JsonPropertyName("socialSecurityNumber")] + public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } + + /// + /// Used to track the state of TelephoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TelephoneNumberOption { get; private set; } /// /// The shopper's telephone number. /// /// The shopper's telephone number. - [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] - public string TelephoneNumber { get; set; } + [JsonPropertyName("telephoneNumber")] + public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2RequestData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2RequestDataOption { get; private set; } /// /// Gets or Sets ThreeDS2RequestData /// - [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] - public ThreeDS2RequestFields ThreeDS2RequestData { get; set; } + [JsonPropertyName("threeDS2RequestData")] + public ThreeDS2RequestFields ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSAuthenticationOnly + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSAuthenticationOnlyOption { get; private set; } /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.authenticationOnly` instead.")] - public bool? ThreeDSAuthenticationOnly { get; set; } + [JsonPropertyName("threeDSAuthenticationOnly")] + [Obsolete] + public bool? ThreeDSAuthenticationOnly { get { return this.ThreeDSAuthenticationOnlyOption; } set { this.ThreeDSAuthenticationOnlyOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -507,9 +931,13 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class DonationPaymentRequest {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" AccountInfo: ").Append(AccountInfo).Append("\n"); sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); - sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" AuthenticationData: ").Append(AuthenticationData).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); @@ -527,17 +955,13 @@ public override string ToString() sb.Append(" DonationOriginalPspReference: ").Append(DonationOriginalPspReference).Append("\n"); sb.Append(" DonationToken: ").Append(DonationToken).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantRiskIndicator: ").Append(MerchantRiskIndicator).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append(" MpiData: ").Append(MpiData).Append("\n"); sb.Append(" Origin: ").Append(Origin).Append("\n"); - sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); sb.Append(" RedirectFromIssuerMethod: ").Append(RedirectFromIssuerMethod).Append("\n"); sb.Append(" RedirectToIssuerMethod: ").Append(RedirectToIssuerMethod).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" SessionValidity: ").Append(SessionValidity).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" ShopperIP: ").Append(ShopperIP).Append("\n"); @@ -554,466 +978,723 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + // ReturnUrl (string) maxLength + if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) + { + yield return new ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); + } + + // CountryCode (string) maxLength + if (this.CountryCode != null && this.CountryCode.Length > 100) + { + yield return new ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); + } + + // DeviceFingerprint (string) maxLength + if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) + { + yield return new ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); + } + + // Origin (string) maxLength + if (this.Origin != null && this.Origin.Length > 80) + { + yield return new ValidationResult("Invalid value for Origin, length must be less than 80.", new [] { "Origin" }); + } + + // ShopperIP (string) maxLength + if (this.ShopperIP != null && this.ShopperIP.Length > 1000) + { + yield return new ValidationResult("Invalid value for ShopperIP, length must be less than 1000.", new [] { "ShopperIP" }); + } + + // ShopperReference (string) maxLength + if (this.ShopperReference != null && this.ShopperReference.Length > 256) + { + yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + } + + // ShopperReference (string) minLength + if (this.ShopperReference != null && this.ShopperReference.Length < 3) + { + yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + } + + yield break; } + } + /// + /// A Json converter for type + /// + public class DonationPaymentRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// The format to use to serialize DateOfBirth /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as DonationPaymentRequest); - } + public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// Returns true if DonationPaymentRequest instances are equal + /// The format to use to serialize DeliverAt /// - /// Instance of DonationPaymentRequest to be compared - /// Boolean - public bool Equals(DonationPaymentRequest input) - { - if (input == null) - { - return false; - } - return - ( - this.AccountInfo == input.AccountInfo || - (this.AccountInfo != null && - this.AccountInfo.Equals(input.AccountInfo)) - ) && - ( - this.AdditionalData == input.AdditionalData || - this.AdditionalData != null && - input.AdditionalData != null && - this.AdditionalData.SequenceEqual(input.AdditionalData) - ) && - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.AuthenticationData == input.AuthenticationData || - (this.AuthenticationData != null && - this.AuthenticationData.Equals(input.AuthenticationData)) - ) && - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.BrowserInfo == input.BrowserInfo || - (this.BrowserInfo != null && - this.BrowserInfo.Equals(input.BrowserInfo)) - ) && - ( - this.Channel == input.Channel || - this.Channel.Equals(input.Channel) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.ConversionId == input.ConversionId || - (this.ConversionId != null && - this.ConversionId.Equals(input.ConversionId)) - ) && - ( - this.CountryCode == input.CountryCode || - (this.CountryCode != null && - this.CountryCode.Equals(input.CountryCode)) - ) && - ( - this.DateOfBirth == input.DateOfBirth || - (this.DateOfBirth != null && - this.DateOfBirth.Equals(input.DateOfBirth)) - ) && - ( - this.DeliverAt == input.DeliverAt || - (this.DeliverAt != null && - this.DeliverAt.Equals(input.DeliverAt)) - ) && - ( - this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) - ) && - ( - this.DeviceFingerprint == input.DeviceFingerprint || - (this.DeviceFingerprint != null && - this.DeviceFingerprint.Equals(input.DeviceFingerprint)) - ) && - ( - this.DonationAccount == input.DonationAccount || - (this.DonationAccount != null && - this.DonationAccount.Equals(input.DonationAccount)) - ) && - ( - this.DonationCampaignId == input.DonationCampaignId || - (this.DonationCampaignId != null && - this.DonationCampaignId.Equals(input.DonationCampaignId)) - ) && - ( - this.DonationOriginalPspReference == input.DonationOriginalPspReference || - (this.DonationOriginalPspReference != null && - this.DonationOriginalPspReference.Equals(input.DonationOriginalPspReference)) - ) && - ( - this.DonationToken == input.DonationToken || - (this.DonationToken != null && - this.DonationToken.Equals(input.DonationToken)) - ) && - ( - this.LineItems == input.LineItems || - this.LineItems != null && - input.LineItems != null && - this.LineItems.SequenceEqual(input.LineItems) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.MerchantRiskIndicator == input.MerchantRiskIndicator || - (this.MerchantRiskIndicator != null && - this.MerchantRiskIndicator.Equals(input.MerchantRiskIndicator)) - ) && - ( - this.Metadata == input.Metadata || - this.Metadata != null && - input.Metadata != null && - this.Metadata.SequenceEqual(input.Metadata) - ) && - ( - this.MpiData == input.MpiData || - (this.MpiData != null && - this.MpiData.Equals(input.MpiData)) - ) && - ( - this.Origin == input.Origin || - (this.Origin != null && - this.Origin.Equals(input.Origin)) - ) && - ( - this.PaymentMethod == input.PaymentMethod || - (this.PaymentMethod != null && - this.PaymentMethod.Equals(input.PaymentMethod)) - ) && - ( - this.RecurringProcessingModel == input.RecurringProcessingModel || - this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) - ) && - ( - this.RedirectFromIssuerMethod == input.RedirectFromIssuerMethod || - (this.RedirectFromIssuerMethod != null && - this.RedirectFromIssuerMethod.Equals(input.RedirectFromIssuerMethod)) - ) && - ( - this.RedirectToIssuerMethod == input.RedirectToIssuerMethod || - (this.RedirectToIssuerMethod != null && - this.RedirectToIssuerMethod.Equals(input.RedirectToIssuerMethod)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.ReturnUrl == input.ReturnUrl || - (this.ReturnUrl != null && - this.ReturnUrl.Equals(input.ReturnUrl)) - ) && - ( - this.SessionValidity == input.SessionValidity || - (this.SessionValidity != null && - this.SessionValidity.Equals(input.SessionValidity)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.ShopperIP == input.ShopperIP || - (this.ShopperIP != null && - this.ShopperIP.Equals(input.ShopperIP)) - ) && - ( - this.ShopperInteraction == input.ShopperInteraction || - this.ShopperInteraction.Equals(input.ShopperInteraction) - ) && - ( - this.ShopperLocale == input.ShopperLocale || - (this.ShopperLocale != null && - this.ShopperLocale.Equals(input.ShopperLocale)) - ) && - ( - this.ShopperName == input.ShopperName || - (this.ShopperName != null && - this.ShopperName.Equals(input.ShopperName)) - ) && - ( - this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) - ) && - ( - this.SocialSecurityNumber == input.SocialSecurityNumber || - (this.SocialSecurityNumber != null && - this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) - ) && - ( - this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) - ) && - ( - this.ThreeDS2RequestData == input.ThreeDS2RequestData || - (this.ThreeDS2RequestData != null && - this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) - ) && - ( - this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || - this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) - ); - } + public static string DeliverAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// Gets the hash code + /// Deserializes json to /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + /// + public override DonationPaymentRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option merchantAccount = default; + Option paymentMethod = default; + Option reference = default; + Option returnUrl = default; + Option accountInfo = default; + Option> additionalData = default; + Option applicationInfo = default; + Option authenticationData = default; + Option billingAddress = default; + Option browserInfo = default; + Option channel = default; + Option checkoutAttemptId = default; + Option conversionId = default; + Option countryCode = default; + Option dateOfBirth = default; + Option deliverAt = default; + Option deliveryAddress = default; + Option deviceFingerprint = default; + Option donationAccount = default; + Option donationCampaignId = default; + Option donationOriginalPspReference = default; + Option donationToken = default; + Option> lineItems = default; + Option merchantRiskIndicator = default; + Option> metadata = default; + Option mpiData = default; + Option origin = default; + Option recurringProcessingModel = default; + Option redirectFromIssuerMethod = default; + Option redirectToIssuerMethod = default; + Option sessionValidity = default; + Option shopperEmail = default; + Option shopperIP = default; + Option shopperInteraction = default; + Option shopperLocale = default; + Option shopperName = default; + Option shopperReference = default; + Option socialSecurityNumber = default; + Option telephoneNumber = default; + Option threeDS2RequestData = default; + Option threeDSAuthenticationOnly = default; + + while (utf8JsonReader.Read()) { - int hashCode = 41; - if (this.AccountInfo != null) - { - hashCode = (hashCode * 59) + this.AccountInfo.GetHashCode(); - } - if (this.AdditionalData != null) - { - hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); - } - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.ApplicationInfo != null) - { - hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); - } - if (this.AuthenticationData != null) - { - hashCode = (hashCode * 59) + this.AuthenticationData.GetHashCode(); - } - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.BrowserInfo != null) - { - hashCode = (hashCode * 59) + this.BrowserInfo.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Channel.GetHashCode(); - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.ConversionId != null) - { - hashCode = (hashCode * 59) + this.ConversionId.GetHashCode(); - } - if (this.CountryCode != null) - { - hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); - } - if (this.DateOfBirth != null) - { - hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); - } - if (this.DeliverAt != null) - { - hashCode = (hashCode * 59) + this.DeliverAt.GetHashCode(); - } - if (this.DeliveryAddress != null) - { - hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); - } - if (this.DeviceFingerprint != null) - { - hashCode = (hashCode * 59) + this.DeviceFingerprint.GetHashCode(); - } - if (this.DonationAccount != null) - { - hashCode = (hashCode * 59) + this.DonationAccount.GetHashCode(); - } - if (this.DonationCampaignId != null) - { - hashCode = (hashCode * 59) + this.DonationCampaignId.GetHashCode(); - } - if (this.DonationOriginalPspReference != null) - { - hashCode = (hashCode * 59) + this.DonationOriginalPspReference.GetHashCode(); - } - if (this.DonationToken != null) - { - hashCode = (hashCode * 59) + this.DonationToken.GetHashCode(); - } - if (this.LineItems != null) - { - hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.MerchantRiskIndicator != null) - { - hashCode = (hashCode * 59) + this.MerchantRiskIndicator.GetHashCode(); - } - if (this.Metadata != null) - { - hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); - } - if (this.MpiData != null) - { - hashCode = (hashCode * 59) + this.MpiData.GetHashCode(); - } - if (this.Origin != null) - { - hashCode = (hashCode * 59) + this.Origin.GetHashCode(); - } - if (this.PaymentMethod != null) - { - hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); - } - hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); - if (this.RedirectFromIssuerMethod != null) - { - hashCode = (hashCode * 59) + this.RedirectFromIssuerMethod.GetHashCode(); - } - if (this.RedirectToIssuerMethod != null) - { - hashCode = (hashCode * 59) + this.RedirectToIssuerMethod.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.ReturnUrl != null) - { - hashCode = (hashCode * 59) + this.ReturnUrl.GetHashCode(); - } - if (this.SessionValidity != null) - { - hashCode = (hashCode * 59) + this.SessionValidity.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.ShopperIP != null) - { - hashCode = (hashCode * 59) + this.ShopperIP.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ShopperInteraction.GetHashCode(); - if (this.ShopperLocale != null) - { - hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); - } - if (this.ShopperName != null) - { - hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); - } - if (this.ShopperReference != null) - { - hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); - } - if (this.SocialSecurityNumber != null) - { - hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); - } - if (this.TelephoneNumber != null) - { - hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); - } - if (this.ThreeDS2RequestData != null) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethod": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "returnUrl": + returnUrl = new Option(utf8JsonReader.GetString()); + break; + case "accountInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + accountInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "additionalData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "applicationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "authenticationData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + authenticationData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "billingAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + billingAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "browserInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + browserInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "channel": + string channelRawValue = utf8JsonReader.GetString(); + if (channelRawValue != null) + channel = new Option(DonationPaymentRequest.ChannelEnumFromStringOrDefault(channelRawValue)); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "conversionId": + conversionId = new Option(utf8JsonReader.GetString()); + break; + case "countryCode": + countryCode = new Option(utf8JsonReader.GetString()); + break; + case "dateOfBirth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliverAt": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliverAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliveryAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliveryAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deviceFingerprint": + deviceFingerprint = new Option(utf8JsonReader.GetString()); + break; + case "donationAccount": + donationAccount = new Option(utf8JsonReader.GetString()); + break; + case "donationCampaignId": + donationCampaignId = new Option(utf8JsonReader.GetString()); + break; + case "donationOriginalPspReference": + donationOriginalPspReference = new Option(utf8JsonReader.GetString()); + break; + case "donationToken": + donationToken = new Option(utf8JsonReader.GetString()); + break; + case "lineItems": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantRiskIndicator": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + merchantRiskIndicator = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "metadata": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mpiData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mpiData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "origin": + origin = new Option(utf8JsonReader.GetString()); + break; + case "recurringProcessingModel": + string recurringProcessingModelRawValue = utf8JsonReader.GetString(); + if (recurringProcessingModelRawValue != null) + recurringProcessingModel = new Option(DonationPaymentRequest.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); + break; + case "redirectFromIssuerMethod": + redirectFromIssuerMethod = new Option(utf8JsonReader.GetString()); + break; + case "redirectToIssuerMethod": + redirectToIssuerMethod = new Option(utf8JsonReader.GetString()); + break; + case "sessionValidity": + sessionValidity = new Option(utf8JsonReader.GetString()); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "shopperIP": + shopperIP = new Option(utf8JsonReader.GetString()); + break; + case "shopperInteraction": + string shopperInteractionRawValue = utf8JsonReader.GetString(); + if (shopperInteractionRawValue != null) + shopperInteraction = new Option(DonationPaymentRequest.ShopperInteractionEnumFromStringOrDefault(shopperInteractionRawValue)); + break; + case "shopperLocale": + shopperLocale = new Option(utf8JsonReader.GetString()); + break; + case "shopperName": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperReference": + shopperReference = new Option(utf8JsonReader.GetString()); + break; + case "socialSecurityNumber": + socialSecurityNumber = new Option(utf8JsonReader.GetString()); + break; + case "telephoneNumber": + telephoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2RequestData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDSAuthenticationOnly": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDSAuthenticationOnly = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } } - hashCode = (hashCode * 59) + this.ThreeDSAuthenticationOnly.GetHashCode(); - return hashCode; } + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class DonationPaymentRequest.", nameof(amount)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class DonationPaymentRequest.", nameof(merchantAccount)); + + if (!paymentMethod.IsSet) + throw new ArgumentException("Property is required for class DonationPaymentRequest.", nameof(paymentMethod)); + + if (!reference.IsSet) + throw new ArgumentException("Property is required for class DonationPaymentRequest.", nameof(reference)); + + if (!returnUrl.IsSet) + throw new ArgumentException("Property is required for class DonationPaymentRequest.", nameof(returnUrl)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class DonationPaymentRequest."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class DonationPaymentRequest."); + + if (paymentMethod.IsSet && paymentMethod.Value == null) + throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class DonationPaymentRequest."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class DonationPaymentRequest."); + + if (returnUrl.IsSet && returnUrl.Value == null) + throw new ArgumentNullException(nameof(returnUrl), "Property is not nullable for class DonationPaymentRequest."); + + if (accountInfo.IsSet && accountInfo.Value == null) + throw new ArgumentNullException(nameof(accountInfo), "Property is not nullable for class DonationPaymentRequest."); + + if (additionalData.IsSet && additionalData.Value == null) + throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class DonationPaymentRequest."); + + if (applicationInfo.IsSet && applicationInfo.Value == null) + throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class DonationPaymentRequest."); + + if (authenticationData.IsSet && authenticationData.Value == null) + throw new ArgumentNullException(nameof(authenticationData), "Property is not nullable for class DonationPaymentRequest."); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class DonationPaymentRequest."); + + if (browserInfo.IsSet && browserInfo.Value == null) + throw new ArgumentNullException(nameof(browserInfo), "Property is not nullable for class DonationPaymentRequest."); + + if (channel.IsSet && channel.Value == null) + throw new ArgumentNullException(nameof(channel), "Property is not nullable for class DonationPaymentRequest."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class DonationPaymentRequest."); + + if (conversionId.IsSet && conversionId.Value == null) + throw new ArgumentNullException(nameof(conversionId), "Property is not nullable for class DonationPaymentRequest."); + + if (countryCode.IsSet && countryCode.Value == null) + throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class DonationPaymentRequest."); + + if (dateOfBirth.IsSet && dateOfBirth.Value == null) + throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class DonationPaymentRequest."); + + if (deliverAt.IsSet && deliverAt.Value == null) + throw new ArgumentNullException(nameof(deliverAt), "Property is not nullable for class DonationPaymentRequest."); + + if (deliveryAddress.IsSet && deliveryAddress.Value == null) + throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class DonationPaymentRequest."); + + if (deviceFingerprint.IsSet && deviceFingerprint.Value == null) + throw new ArgumentNullException(nameof(deviceFingerprint), "Property is not nullable for class DonationPaymentRequest."); + + if (donationAccount.IsSet && donationAccount.Value == null) + throw new ArgumentNullException(nameof(donationAccount), "Property is not nullable for class DonationPaymentRequest."); + + if (donationCampaignId.IsSet && donationCampaignId.Value == null) + throw new ArgumentNullException(nameof(donationCampaignId), "Property is not nullable for class DonationPaymentRequest."); + + if (donationOriginalPspReference.IsSet && donationOriginalPspReference.Value == null) + throw new ArgumentNullException(nameof(donationOriginalPspReference), "Property is not nullable for class DonationPaymentRequest."); + + if (donationToken.IsSet && donationToken.Value == null) + throw new ArgumentNullException(nameof(donationToken), "Property is not nullable for class DonationPaymentRequest."); + + if (lineItems.IsSet && lineItems.Value == null) + throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class DonationPaymentRequest."); + + if (merchantRiskIndicator.IsSet && merchantRiskIndicator.Value == null) + throw new ArgumentNullException(nameof(merchantRiskIndicator), "Property is not nullable for class DonationPaymentRequest."); + + if (metadata.IsSet && metadata.Value == null) + throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class DonationPaymentRequest."); + + if (mpiData.IsSet && mpiData.Value == null) + throw new ArgumentNullException(nameof(mpiData), "Property is not nullable for class DonationPaymentRequest."); + + if (origin.IsSet && origin.Value == null) + throw new ArgumentNullException(nameof(origin), "Property is not nullable for class DonationPaymentRequest."); + + if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) + throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class DonationPaymentRequest."); + + if (redirectFromIssuerMethod.IsSet && redirectFromIssuerMethod.Value == null) + throw new ArgumentNullException(nameof(redirectFromIssuerMethod), "Property is not nullable for class DonationPaymentRequest."); + + if (redirectToIssuerMethod.IsSet && redirectToIssuerMethod.Value == null) + throw new ArgumentNullException(nameof(redirectToIssuerMethod), "Property is not nullable for class DonationPaymentRequest."); + + if (sessionValidity.IsSet && sessionValidity.Value == null) + throw new ArgumentNullException(nameof(sessionValidity), "Property is not nullable for class DonationPaymentRequest."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class DonationPaymentRequest."); + + if (shopperIP.IsSet && shopperIP.Value == null) + throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class DonationPaymentRequest."); + + if (shopperInteraction.IsSet && shopperInteraction.Value == null) + throw new ArgumentNullException(nameof(shopperInteraction), "Property is not nullable for class DonationPaymentRequest."); + + if (shopperLocale.IsSet && shopperLocale.Value == null) + throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class DonationPaymentRequest."); + + if (shopperName.IsSet && shopperName.Value == null) + throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class DonationPaymentRequest."); + + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class DonationPaymentRequest."); + + if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) + throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class DonationPaymentRequest."); + + if (telephoneNumber.IsSet && telephoneNumber.Value == null) + throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class DonationPaymentRequest."); + + if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) + throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class DonationPaymentRequest."); + + if (threeDSAuthenticationOnly.IsSet && threeDSAuthenticationOnly.Value == null) + throw new ArgumentNullException(nameof(threeDSAuthenticationOnly), "Property is not nullable for class DonationPaymentRequest."); + + return new DonationPaymentRequest(amount.Value, merchantAccount.Value, paymentMethod.Value, reference.Value, returnUrl.Value, accountInfo, additionalData, applicationInfo, authenticationData, billingAddress, browserInfo, channel, checkoutAttemptId, conversionId, countryCode, dateOfBirth, deliverAt, deliveryAddress, deviceFingerprint, donationAccount, donationCampaignId, donationOriginalPspReference, donationToken, lineItems, merchantRiskIndicator, metadata, mpiData, origin, recurringProcessingModel, redirectFromIssuerMethod, redirectToIssuerMethod, sessionValidity, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, socialSecurityNumber, telephoneNumber, threeDS2RequestData, threeDSAuthenticationOnly); } + /// - /// To validate all properties of the instance + /// Serializes a /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DonationPaymentRequest donationPaymentRequest, JsonSerializerOptions jsonSerializerOptions) { - // CountryCode (string) maxLength - if (this.CountryCode != null && this.CountryCode.Length > 100) + writer.WriteStartObject(); + + WriteProperties(writer, donationPaymentRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DonationPaymentRequest donationPaymentRequest, JsonSerializerOptions jsonSerializerOptions) + { + if (donationPaymentRequest.Amount == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.Amount), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.MerchantAccount), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.PaymentMethod == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.PaymentMethod), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.Reference == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.Reference), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.ReturnUrl == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.ReturnUrl), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.AccountInfoOption.IsSet && donationPaymentRequest.AccountInfo == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.AccountInfo), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.AdditionalDataOption.IsSet && donationPaymentRequest.AdditionalData == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.AdditionalData), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.ApplicationInfoOption.IsSet && donationPaymentRequest.ApplicationInfo == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.ApplicationInfo), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.AuthenticationDataOption.IsSet && donationPaymentRequest.AuthenticationData == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.AuthenticationData), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.BillingAddressOption.IsSet && donationPaymentRequest.BillingAddress == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.BillingAddress), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.BrowserInfoOption.IsSet && donationPaymentRequest.BrowserInfo == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.BrowserInfo), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.CheckoutAttemptIdOption.IsSet && donationPaymentRequest.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.CheckoutAttemptId), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.ConversionIdOption.IsSet && donationPaymentRequest.ConversionId == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.ConversionId), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.CountryCodeOption.IsSet && donationPaymentRequest.CountryCode == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.CountryCode), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.DeliveryAddressOption.IsSet && donationPaymentRequest.DeliveryAddress == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.DeliveryAddress), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.DeviceFingerprintOption.IsSet && donationPaymentRequest.DeviceFingerprint == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.DeviceFingerprint), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.DonationAccountOption.IsSet && donationPaymentRequest.DonationAccount == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.DonationAccount), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.DonationCampaignIdOption.IsSet && donationPaymentRequest.DonationCampaignId == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.DonationCampaignId), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.DonationOriginalPspReferenceOption.IsSet && donationPaymentRequest.DonationOriginalPspReference == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.DonationOriginalPspReference), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.DonationTokenOption.IsSet && donationPaymentRequest.DonationToken == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.DonationToken), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.LineItemsOption.IsSet && donationPaymentRequest.LineItems == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.LineItems), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.MerchantRiskIndicatorOption.IsSet && donationPaymentRequest.MerchantRiskIndicator == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.MerchantRiskIndicator), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.MetadataOption.IsSet && donationPaymentRequest.Metadata == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.Metadata), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.MpiDataOption.IsSet && donationPaymentRequest.MpiData == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.MpiData), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.OriginOption.IsSet && donationPaymentRequest.Origin == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.Origin), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.RedirectFromIssuerMethodOption.IsSet && donationPaymentRequest.RedirectFromIssuerMethod == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.RedirectFromIssuerMethod), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.RedirectToIssuerMethodOption.IsSet && donationPaymentRequest.RedirectToIssuerMethod == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.RedirectToIssuerMethod), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.SessionValidityOption.IsSet && donationPaymentRequest.SessionValidity == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.SessionValidity), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.ShopperEmailOption.IsSet && donationPaymentRequest.ShopperEmail == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.ShopperEmail), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.ShopperIPOption.IsSet && donationPaymentRequest.ShopperIP == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.ShopperIP), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.ShopperLocaleOption.IsSet && donationPaymentRequest.ShopperLocale == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.ShopperLocale), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.ShopperNameOption.IsSet && donationPaymentRequest.ShopperName == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.ShopperName), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.ShopperReferenceOption.IsSet && donationPaymentRequest.ShopperReference == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.ShopperReference), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.SocialSecurityNumberOption.IsSet && donationPaymentRequest.SocialSecurityNumber == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.SocialSecurityNumber), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.TelephoneNumberOption.IsSet && donationPaymentRequest.TelephoneNumber == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.TelephoneNumber), "Property is required for class DonationPaymentRequest."); + + if (donationPaymentRequest.ThreeDS2RequestDataOption.IsSet && donationPaymentRequest.ThreeDS2RequestData == null) + throw new ArgumentNullException(nameof(donationPaymentRequest.ThreeDS2RequestData), "Property is required for class DonationPaymentRequest."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, donationPaymentRequest.Amount, jsonSerializerOptions); + writer.WriteString("merchantAccount", donationPaymentRequest.MerchantAccount); + + writer.WritePropertyName("paymentMethod"); + JsonSerializer.Serialize(writer, donationPaymentRequest.PaymentMethod, jsonSerializerOptions); + writer.WriteString("reference", donationPaymentRequest.Reference); + + writer.WriteString("returnUrl", donationPaymentRequest.ReturnUrl); + + if (donationPaymentRequest.AccountInfoOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); + writer.WritePropertyName("accountInfo"); + JsonSerializer.Serialize(writer, donationPaymentRequest.AccountInfo, jsonSerializerOptions); } - - // DeviceFingerprint (string) maxLength - if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) + if (donationPaymentRequest.AdditionalDataOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); + writer.WritePropertyName("additionalData"); + JsonSerializer.Serialize(writer, donationPaymentRequest.AdditionalData, jsonSerializerOptions); } - - // Origin (string) maxLength - if (this.Origin != null && this.Origin.Length > 80) + if (donationPaymentRequest.ApplicationInfoOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, length must be less than 80.", new [] { "Origin" }); + writer.WritePropertyName("applicationInfo"); + JsonSerializer.Serialize(writer, donationPaymentRequest.ApplicationInfo, jsonSerializerOptions); } - - // ReturnUrl (string) maxLength - if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) + if (donationPaymentRequest.AuthenticationDataOption.IsSet) + { + writer.WritePropertyName("authenticationData"); + JsonSerializer.Serialize(writer, donationPaymentRequest.AuthenticationData, jsonSerializerOptions); + } + if (donationPaymentRequest.BillingAddressOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); + writer.WritePropertyName("billingAddress"); + JsonSerializer.Serialize(writer, donationPaymentRequest.BillingAddress, jsonSerializerOptions); } + if (donationPaymentRequest.BrowserInfoOption.IsSet) + { + writer.WritePropertyName("browserInfo"); + JsonSerializer.Serialize(writer, donationPaymentRequest.BrowserInfo, jsonSerializerOptions); + } + var channelRawValue = DonationPaymentRequest.ChannelEnumToJsonValue(donationPaymentRequest.ChannelOption.Value.Value); + writer.WriteString("channel", channelRawValue); + if (donationPaymentRequest.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", donationPaymentRequest.CheckoutAttemptId); - // ShopperIP (string) maxLength - if (this.ShopperIP != null && this.ShopperIP.Length > 1000) + if (donationPaymentRequest.ConversionIdOption.IsSet) + writer.WriteString("conversionId", donationPaymentRequest.ConversionId); + + if (donationPaymentRequest.CountryCodeOption.IsSet) + writer.WriteString("countryCode", donationPaymentRequest.CountryCode); + + if (donationPaymentRequest.DateOfBirthOption.IsSet) + writer.WriteString("dateOfBirth", donationPaymentRequest.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); + + if (donationPaymentRequest.DeliverAtOption.IsSet) + writer.WriteString("deliverAt", donationPaymentRequest.DeliverAtOption.Value.Value.ToString(DeliverAtFormat)); + + if (donationPaymentRequest.DeliveryAddressOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperIP, length must be less than 1000.", new [] { "ShopperIP" }); + writer.WritePropertyName("deliveryAddress"); + JsonSerializer.Serialize(writer, donationPaymentRequest.DeliveryAddress, jsonSerializerOptions); } + if (donationPaymentRequest.DeviceFingerprintOption.IsSet) + writer.WriteString("deviceFingerprint", donationPaymentRequest.DeviceFingerprint); - // ShopperReference (string) maxLength - if (this.ShopperReference != null && this.ShopperReference.Length > 256) + if (donationPaymentRequest.DonationAccountOption.IsSet) + writer.WriteString("donationAccount", donationPaymentRequest.DonationAccount); + + if (donationPaymentRequest.DonationCampaignIdOption.IsSet) + writer.WriteString("donationCampaignId", donationPaymentRequest.DonationCampaignId); + + if (donationPaymentRequest.DonationOriginalPspReferenceOption.IsSet) + writer.WriteString("donationOriginalPspReference", donationPaymentRequest.DonationOriginalPspReference); + + if (donationPaymentRequest.DonationTokenOption.IsSet) + writer.WriteString("donationToken", donationPaymentRequest.DonationToken); + + if (donationPaymentRequest.LineItemsOption.IsSet) + { + writer.WritePropertyName("lineItems"); + JsonSerializer.Serialize(writer, donationPaymentRequest.LineItems, jsonSerializerOptions); + } + if (donationPaymentRequest.MerchantRiskIndicatorOption.IsSet) + { + writer.WritePropertyName("merchantRiskIndicator"); + JsonSerializer.Serialize(writer, donationPaymentRequest.MerchantRiskIndicator, jsonSerializerOptions); + } + if (donationPaymentRequest.MetadataOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, donationPaymentRequest.Metadata, jsonSerializerOptions); } + if (donationPaymentRequest.MpiDataOption.IsSet) + { + writer.WritePropertyName("mpiData"); + JsonSerializer.Serialize(writer, donationPaymentRequest.MpiData, jsonSerializerOptions); + } + if (donationPaymentRequest.OriginOption.IsSet) + writer.WriteString("origin", donationPaymentRequest.Origin); - // ShopperReference (string) minLength - if (this.ShopperReference != null && this.ShopperReference.Length < 3) + var recurringProcessingModelRawValue = DonationPaymentRequest.RecurringProcessingModelEnumToJsonValue(donationPaymentRequest.RecurringProcessingModelOption.Value.Value); + writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); + if (donationPaymentRequest.RedirectFromIssuerMethodOption.IsSet) + writer.WriteString("redirectFromIssuerMethod", donationPaymentRequest.RedirectFromIssuerMethod); + + if (donationPaymentRequest.RedirectToIssuerMethodOption.IsSet) + writer.WriteString("redirectToIssuerMethod", donationPaymentRequest.RedirectToIssuerMethod); + + if (donationPaymentRequest.SessionValidityOption.IsSet) + writer.WriteString("sessionValidity", donationPaymentRequest.SessionValidity); + + if (donationPaymentRequest.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", donationPaymentRequest.ShopperEmail); + + if (donationPaymentRequest.ShopperIPOption.IsSet) + writer.WriteString("shopperIP", donationPaymentRequest.ShopperIP); + + var shopperInteractionRawValue = DonationPaymentRequest.ShopperInteractionEnumToJsonValue(donationPaymentRequest.ShopperInteractionOption.Value.Value); + writer.WriteString("shopperInteraction", shopperInteractionRawValue); + if (donationPaymentRequest.ShopperLocaleOption.IsSet) + writer.WriteString("shopperLocale", donationPaymentRequest.ShopperLocale); + + if (donationPaymentRequest.ShopperNameOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + writer.WritePropertyName("shopperName"); + JsonSerializer.Serialize(writer, donationPaymentRequest.ShopperName, jsonSerializerOptions); } + if (donationPaymentRequest.ShopperReferenceOption.IsSet) + writer.WriteString("shopperReference", donationPaymentRequest.ShopperReference); - yield break; + if (donationPaymentRequest.SocialSecurityNumberOption.IsSet) + writer.WriteString("socialSecurityNumber", donationPaymentRequest.SocialSecurityNumber); + + if (donationPaymentRequest.TelephoneNumberOption.IsSet) + writer.WriteString("telephoneNumber", donationPaymentRequest.TelephoneNumber); + + if (donationPaymentRequest.ThreeDS2RequestDataOption.IsSet) + { + writer.WritePropertyName("threeDS2RequestData"); + JsonSerializer.Serialize(writer, donationPaymentRequest.ThreeDS2RequestData, jsonSerializerOptions); + } + if (donationPaymentRequest.ThreeDSAuthenticationOnlyOption.IsSet) + writer.WriteBoolean("threeDSAuthenticationOnly", donationPaymentRequest.ThreeDSAuthenticationOnlyOption.Value.Value); } } - } diff --git a/Adyen/Model/Checkout/DonationPaymentResponse.cs b/Adyen/Model/Checkout/DonationPaymentResponse.cs index 66364902b..52f70bc3e 100644 --- a/Adyen/Model/Checkout/DonationPaymentResponse.cs +++ b/Adyen/Model/Checkout/DonationPaymentResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,117 +14,221 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// DonationPaymentResponse /// - [DataContract(Name = "DonationPaymentResponse")] - public partial class DonationPaymentResponse : IEquatable, IValidatableObject + public partial class DonationPaymentResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The Adyen account name of your charity. We will provide you with this account name once your chosen charity has been [onboarded](https://docs.adyen.com/online-payments/donations#onboarding). + /// Your unique resource identifier. + /// The merchant account identifier, with which you want to process the transaction. + /// payment + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + /// The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** + [JsonConstructor] + public DonationPaymentResponse(Option amount = default, Option donationAccount = default, Option id = default, Option merchantAccount = default, Option payment = default, Option reference = default, Option status = default) + { + AmountOption = amount; + DonationAccountOption = donationAccount; + IdOption = id; + MerchantAccountOption = merchantAccount; + PaymentOption = payment; + ReferenceOption = reference; + StatusOption = status; + OnCreated(); + } + + partial void OnCreated(); + /// /// The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** /// /// The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** - [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Completed for value: completed /// - [EnumMember(Value = "completed")] Completed = 1, /// /// Enum Pending for value: pending /// - [EnumMember(Value = "pending")] Pending = 2, /// /// Enum Refused for value: refused /// - [EnumMember(Value = "refused")] Refused = 3 + } + /// + /// Returns a + /// + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("completed")) + return StatusEnum.Completed; + + if (value.Equals("pending")) + return StatusEnum.Pending; + + if (value.Equals("refused")) + return StatusEnum.Refused; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("completed")) + return StatusEnum.Completed; + + if (value.Equals("pending")) + return StatusEnum.Pending; + + if (value.Equals("refused")) + return StatusEnum.Refused; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum? value) + { + if (value == StatusEnum.Completed) + return "completed"; + + if (value == StatusEnum.Pending) + return "pending"; + + if (value == StatusEnum.Refused) + return "refused"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Status + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StatusOption { get; private set; } /// /// The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** /// /// The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** - [DataMember(Name = "status", EmitDefaultValue = false)] - public StatusEnum? Status { get; set; } + [JsonPropertyName("status")] + public StatusEnum? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of Amount /// - /// amount. - /// The Adyen account name of your charity. We will provide you with this account name once your chosen charity has been [onboarded](https://docs.adyen.com/online-payments/donations#onboarding).. - /// Your unique resource identifier.. - /// The merchant account identifier, with which you want to process the transaction.. - /// payment. - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.. - /// The status of the donation transaction. Possible values: * **completed** * **pending** * **refused**. - public DonationPaymentResponse(Amount amount = default(Amount), string donationAccount = default(string), string id = default(string), string merchantAccount = default(string), PaymentResponse payment = default(PaymentResponse), string reference = default(string), StatusEnum? status = default(StatusEnum?)) - { - this.Amount = amount; - this.DonationAccount = donationAccount; - this.Id = id; - this.MerchantAccount = merchantAccount; - this.Payment = payment; - this.Reference = reference; - this.Status = status; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountOption { get; private set; } /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonPropertyName("amount")] + public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } + + /// + /// Used to track the state of DonationAccount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DonationAccountOption { get; private set; } /// /// The Adyen account name of your charity. We will provide you with this account name once your chosen charity has been [onboarded](https://docs.adyen.com/online-payments/donations#onboarding). /// /// The Adyen account name of your charity. We will provide you with this account name once your chosen charity has been [onboarded](https://docs.adyen.com/online-payments/donations#onboarding). - [DataMember(Name = "donationAccount", EmitDefaultValue = false)] - public string DonationAccount { get; set; } + [JsonPropertyName("donationAccount")] + public string DonationAccount { get { return this.DonationAccountOption; } set { this.DonationAccountOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } /// /// Your unique resource identifier. /// /// Your unique resource identifier. - [DataMember(Name = "id", EmitDefaultValue = false)] - public string Id { get; set; } + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of MerchantAccount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantAccountOption { get; private set; } /// /// The merchant account identifier, with which you want to process the transaction. /// /// The merchant account identifier, with which you want to process the transaction. - [DataMember(Name = "merchantAccount", EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get { return this.MerchantAccountOption; } set { this.MerchantAccountOption = new Option(value); } } + + /// + /// Used to track the state of Payment + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentOption { get; private set; } /// /// Gets or Sets Payment /// - [DataMember(Name = "payment", EmitDefaultValue = false)] - public PaymentResponse Payment { get; set; } + [JsonPropertyName("payment")] + public PaymentResponse Payment { get { return this.PaymentOption; } set { this.PaymentOption = new Option(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. /// /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -147,118 +250,182 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class DonationPaymentResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override DonationPaymentResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as DonationPaymentResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if DonationPaymentResponse instances are equal - /// - /// Instance of DonationPaymentResponse to be compared - /// Boolean - public bool Equals(DonationPaymentResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option donationAccount = default; + Option id = default; + Option merchantAccount = default; + Option payment = default; + Option reference = default; + Option status = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "donationAccount": + donationAccount = new Option(utf8JsonReader.GetString()); + break; + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "payment": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + payment = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(DonationPaymentResponse.StatusEnumFromStringOrDefault(statusRawValue)); + break; + default: + break; + } + } } - return - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.DonationAccount == input.DonationAccount || - (this.DonationAccount != null && - this.DonationAccount.Equals(input.DonationAccount)) - ) && - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.Payment == input.Payment || - (this.Payment != null && - this.Payment.Equals(input.Payment)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class DonationPaymentResponse."); + + if (donationAccount.IsSet && donationAccount.Value == null) + throw new ArgumentNullException(nameof(donationAccount), "Property is not nullable for class DonationPaymentResponse."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class DonationPaymentResponse."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class DonationPaymentResponse."); + + if (payment.IsSet && payment.Value == null) + throw new ArgumentNullException(nameof(payment), "Property is not nullable for class DonationPaymentResponse."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class DonationPaymentResponse."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class DonationPaymentResponse."); + + return new DonationPaymentResponse(amount, donationAccount, id, merchantAccount, payment, reference, status); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DonationPaymentResponse donationPaymentResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.DonationAccount != null) - { - hashCode = (hashCode * 59) + this.DonationAccount.GetHashCode(); - } - if (this.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.Payment != null) - { - hashCode = (hashCode * 59) + this.Payment.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, donationPaymentResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DonationPaymentResponse donationPaymentResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (donationPaymentResponse.AmountOption.IsSet && donationPaymentResponse.Amount == null) + throw new ArgumentNullException(nameof(donationPaymentResponse.Amount), "Property is required for class DonationPaymentResponse."); + + if (donationPaymentResponse.DonationAccountOption.IsSet && donationPaymentResponse.DonationAccount == null) + throw new ArgumentNullException(nameof(donationPaymentResponse.DonationAccount), "Property is required for class DonationPaymentResponse."); + + if (donationPaymentResponse.IdOption.IsSet && donationPaymentResponse.Id == null) + throw new ArgumentNullException(nameof(donationPaymentResponse.Id), "Property is required for class DonationPaymentResponse."); + + if (donationPaymentResponse.MerchantAccountOption.IsSet && donationPaymentResponse.MerchantAccount == null) + throw new ArgumentNullException(nameof(donationPaymentResponse.MerchantAccount), "Property is required for class DonationPaymentResponse."); + + if (donationPaymentResponse.PaymentOption.IsSet && donationPaymentResponse.Payment == null) + throw new ArgumentNullException(nameof(donationPaymentResponse.Payment), "Property is required for class DonationPaymentResponse."); + + if (donationPaymentResponse.ReferenceOption.IsSet && donationPaymentResponse.Reference == null) + throw new ArgumentNullException(nameof(donationPaymentResponse.Reference), "Property is required for class DonationPaymentResponse."); + + if (donationPaymentResponse.AmountOption.IsSet) + { + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, donationPaymentResponse.Amount, jsonSerializerOptions); + } + if (donationPaymentResponse.DonationAccountOption.IsSet) + writer.WriteString("donationAccount", donationPaymentResponse.DonationAccount); + + if (donationPaymentResponse.IdOption.IsSet) + writer.WriteString("id", donationPaymentResponse.Id); + + if (donationPaymentResponse.MerchantAccountOption.IsSet) + writer.WriteString("merchantAccount", donationPaymentResponse.MerchantAccount); + + if (donationPaymentResponse.PaymentOption.IsSet) + { + writer.WritePropertyName("payment"); + JsonSerializer.Serialize(writer, donationPaymentResponse.Payment, jsonSerializerOptions); + } + if (donationPaymentResponse.ReferenceOption.IsSet) + writer.WriteString("reference", donationPaymentResponse.Reference); + + var statusRawValue = DonationPaymentResponse.StatusEnumToJsonValue(donationPaymentResponse.StatusOption.Value.Value); + writer.WriteString("status", statusRawValue); } } - } diff --git a/Adyen/Model/Checkout/DragonpayDetails.cs b/Adyen/Model/Checkout/DragonpayDetails.cs index a0392b39d..6b5a391c9 100644 --- a/Adyen/Model/Checkout/DragonpayDetails.cs +++ b/Adyen/Model/Checkout/DragonpayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,103 +14,175 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// DragonpayDetails /// - [DataContract(Name = "DragonpayDetails")] - public partial class DragonpayDetails : IEquatable, IValidatableObject + public partial class DragonpayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The Dragonpay issuer value of the shopper's selected bank. Set this to an **id** of a Dragonpay issuer to preselect it. + /// **dragonpay** + /// The checkout attempt identifier. + /// The shopper’s email address. + [JsonConstructor] + public DragonpayDetails(string issuer, TypeEnum type, Option checkoutAttemptId = default, Option shopperEmail = default) + { + Issuer = issuer; + Type = type; + CheckoutAttemptIdOption = checkoutAttemptId; + ShopperEmailOption = shopperEmail; + OnCreated(); + } + + partial void OnCreated(); + /// /// **dragonpay** /// /// **dragonpay** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// - /// Enum Ebanking for value: dragonpay_ebanking + /// Enum DragonpayEbanking for value: dragonpay_ebanking /// - [EnumMember(Value = "dragonpay_ebanking")] - Ebanking = 1, + DragonpayEbanking = 1, /// - /// Enum OtcBanking for value: dragonpay_otc_banking + /// Enum DragonpayOtcBanking for value: dragonpay_otc_banking /// - [EnumMember(Value = "dragonpay_otc_banking")] - OtcBanking = 2, + DragonpayOtcBanking = 2, /// - /// Enum OtcNonBanking for value: dragonpay_otc_non_banking + /// Enum DragonpayOtcNonBanking for value: dragonpay_otc_non_banking /// - [EnumMember(Value = "dragonpay_otc_non_banking")] - OtcNonBanking = 3, + DragonpayOtcNonBanking = 3, /// - /// Enum OtcPhilippines for value: dragonpay_otc_philippines + /// Enum DragonpayOtcPhilippines for value: dragonpay_otc_philippines /// - [EnumMember(Value = "dragonpay_otc_philippines")] - OtcPhilippines = 4 + DragonpayOtcPhilippines = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("dragonpay_ebanking")) + return TypeEnum.DragonpayEbanking; + + if (value.Equals("dragonpay_otc_banking")) + return TypeEnum.DragonpayOtcBanking; + + if (value.Equals("dragonpay_otc_non_banking")) + return TypeEnum.DragonpayOtcNonBanking; + + if (value.Equals("dragonpay_otc_philippines")) + return TypeEnum.DragonpayOtcPhilippines; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("dragonpay_ebanking")) + return TypeEnum.DragonpayEbanking; + + if (value.Equals("dragonpay_otc_banking")) + return TypeEnum.DragonpayOtcBanking; + + if (value.Equals("dragonpay_otc_non_banking")) + return TypeEnum.DragonpayOtcNonBanking; + + if (value.Equals("dragonpay_otc_philippines")) + return TypeEnum.DragonpayOtcPhilippines; + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.DragonpayEbanking) + return "dragonpay_ebanking"; + + if (value == TypeEnum.DragonpayOtcBanking) + return "dragonpay_otc_banking"; + + if (value == TypeEnum.DragonpayOtcNonBanking) + return "dragonpay_otc_non_banking"; + + if (value == TypeEnum.DragonpayOtcPhilippines) + return "dragonpay_otc_philippines"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **dragonpay** /// /// **dragonpay** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. + /// The Dragonpay issuer value of the shopper's selected bank. Set this to an **id** of a Dragonpay issuer to preselect it. /// - [JsonConstructorAttribute] - protected DragonpayDetails() { } + /// The Dragonpay issuer value of the shopper's selected bank. Set this to an **id** of a Dragonpay issuer to preselect it. + [JsonPropertyName("issuer")] + public string Issuer { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The Dragonpay issuer value of the shopper's selected bank. Set this to an **id** of a Dragonpay issuer to preselect it. (required). - /// The shopper’s email address.. - /// **dragonpay** (required). - public DragonpayDetails(string checkoutAttemptId = default(string), string issuer = default(string), string shopperEmail = default(string), TypeEnum type = default(TypeEnum)) - { - this.Issuer = issuer; - this.Type = type; - this.CheckoutAttemptId = checkoutAttemptId; - this.ShopperEmail = shopperEmail; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } /// - /// The Dragonpay issuer value of the shopper's selected bank. Set this to an **id** of a Dragonpay issuer to preselect it. + /// Used to track the state of ShopperEmail /// - /// The Dragonpay issuer value of the shopper's selected bank. Set this to an **id** of a Dragonpay issuer to preselect it. - [DataMember(Name = "issuer", IsRequired = false, EmitDefaultValue = false)] - public string Issuer { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The shopper’s email address. /// /// The shopper’s email address. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -121,100 +192,150 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class DragonpayDetails {\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" Issuer: ").Append(Issuer).Append("\n"); - sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); + sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class DragonpayDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override DragonpayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as DragonpayDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if DragonpayDetails instances are equal - /// - /// Instance of DragonpayDetails to be compared - /// Boolean - public bool Equals(DragonpayDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option issuer = default; + Option type = default; + Option checkoutAttemptId = default; + Option shopperEmail = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "issuer": + issuer = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(DragonpayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Issuer == input.Issuer || - (this.Issuer != null && - this.Issuer.Equals(input.Issuer)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!issuer.IsSet) + throw new ArgumentException("Property is required for class DragonpayDetails.", nameof(issuer)); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class DragonpayDetails.", nameof(type)); + + if (issuer.IsSet && issuer.Value == null) + throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class DragonpayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class DragonpayDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class DragonpayDetails."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class DragonpayDetails."); + + return new DragonpayDetails(issuer.Value, type.Value.Value, checkoutAttemptId, shopperEmail); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DragonpayDetails dragonpayDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.Issuer != null) - { - hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, dragonpayDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, DragonpayDetails dragonpayDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (dragonpayDetails.Issuer == null) + throw new ArgumentNullException(nameof(dragonpayDetails.Issuer), "Property is required for class DragonpayDetails."); + + if (dragonpayDetails.CheckoutAttemptIdOption.IsSet && dragonpayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(dragonpayDetails.CheckoutAttemptId), "Property is required for class DragonpayDetails."); + + if (dragonpayDetails.ShopperEmailOption.IsSet && dragonpayDetails.ShopperEmail == null) + throw new ArgumentNullException(nameof(dragonpayDetails.ShopperEmail), "Property is required for class DragonpayDetails."); + + writer.WriteString("issuer", dragonpayDetails.Issuer); + + var typeRawValue = DragonpayDetails.TypeEnumToJsonValue(dragonpayDetails.Type); + writer.WriteString("type", typeRawValue); + if (dragonpayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", dragonpayDetails.CheckoutAttemptId); + + if (dragonpayDetails.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", dragonpayDetails.ShopperEmail); } } - } diff --git a/Adyen/Model/Checkout/EBankingFinlandDetails.cs b/Adyen/Model/Checkout/EBankingFinlandDetails.cs index 1bd64ad57..e90572bf0 100644 --- a/Adyen/Model/Checkout/EBankingFinlandDetails.cs +++ b/Adyen/Model/Checkout/EBankingFinlandDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,76 +14,124 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// EBankingFinlandDetails /// - [DataContract(Name = "EBankingFinlandDetails")] - public partial class EBankingFinlandDetails : IEquatable, IValidatableObject + public partial class EBankingFinlandDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// The Ebanking Finland issuer value of the shopper's selected bank. + /// **ebanking_FI** (default to TypeEnum.EbankingFI) + [JsonConstructor] + public EBankingFinlandDetails(Option checkoutAttemptId = default, Option issuer = default, TypeEnum type = TypeEnum.EbankingFI) + { + CheckoutAttemptIdOption = checkoutAttemptId; + IssuerOption = issuer; + Type = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **ebanking_FI** /// /// **ebanking_FI** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum EbankingFI for value: ebanking_FI /// - [EnumMember(Value = "ebanking_FI")] EbankingFI = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("ebanking_FI")) + return TypeEnum.EbankingFI; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("ebanking_FI")) + return TypeEnum.EbankingFI; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.EbankingFI) + return "ebanking_FI"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **ebanking_FI** /// /// **ebanking_FI** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected EBankingFinlandDetails() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The Ebanking Finland issuer value of the shopper's selected bank.. - /// **ebanking_FI** (required) (default to TypeEnum.EbankingFI). - public EBankingFinlandDetails(string checkoutAttemptId = default(string), string issuer = default(string), TypeEnum type = TypeEnum.EbankingFI) - { - this.Type = type; - this.CheckoutAttemptId = checkoutAttemptId; - this.Issuer = issuer; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of Issuer + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IssuerOption { get; private set; } /// /// The Ebanking Finland issuer value of the shopper's selected bank. /// /// The Ebanking Finland issuer value of the shopper's selected bank. - [DataMember(Name = "issuer", EmitDefaultValue = false)] - public string Issuer { get; set; } + [JsonPropertyName("issuer")] + public string Issuer { get { return this.IssuerOption; } set { this.IssuerOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -102,82 +149,127 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class EBankingFinlandDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override EBankingFinlandDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as EBankingFinlandDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if EBankingFinlandDetails instances are equal - /// - /// Instance of EBankingFinlandDetails to be compared - /// Boolean - public bool Equals(EBankingFinlandDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option issuer = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "issuer": + issuer = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(EBankingFinlandDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Issuer == input.Issuer || - (this.Issuer != null && - this.Issuer.Equals(input.Issuer)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class EBankingFinlandDetails.", nameof(type)); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class EBankingFinlandDetails."); + + if (issuer.IsSet && issuer.Value == null) + throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class EBankingFinlandDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class EBankingFinlandDetails."); + + return new EBankingFinlandDetails(checkoutAttemptId, issuer, type.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EBankingFinlandDetails eBankingFinlandDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.Issuer != null) - { - hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, eBankingFinlandDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, EBankingFinlandDetails eBankingFinlandDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (eBankingFinlandDetails.CheckoutAttemptIdOption.IsSet && eBankingFinlandDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(eBankingFinlandDetails.CheckoutAttemptId), "Property is required for class EBankingFinlandDetails."); + + if (eBankingFinlandDetails.IssuerOption.IsSet && eBankingFinlandDetails.Issuer == null) + throw new ArgumentNullException(nameof(eBankingFinlandDetails.Issuer), "Property is required for class EBankingFinlandDetails."); + + if (eBankingFinlandDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", eBankingFinlandDetails.CheckoutAttemptId); + + if (eBankingFinlandDetails.IssuerOption.IsSet) + writer.WriteString("issuer", eBankingFinlandDetails.Issuer); + + var typeRawValue = EBankingFinlandDetails.TypeEnumToJsonValue(eBankingFinlandDetails.Type); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/EcontextVoucherDetails.cs b/Adyen/Model/Checkout/EcontextVoucherDetails.cs index 4365ff260..5f0f7d44d 100644 --- a/Adyen/Model/Checkout/EcontextVoucherDetails.cs +++ b/Adyen/Model/Checkout/EcontextVoucherDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,128 +14,201 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// EcontextVoucherDetails /// - [DataContract(Name = "EcontextVoucherDetails")] - public partial class EcontextVoucherDetails : IEquatable, IValidatableObject + public partial class EcontextVoucherDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The shopper's first name. + /// The shopper's last name. + /// The shopper's email. + /// The shopper's contact number. It must have an international number format, for example **+31 20 779 1846**. Formats like **+31 (0)20 779 1846** or **0031 20 779 1846** are not accepted. + /// **econtextvoucher** + /// The checkout attempt identifier. + [JsonConstructor] + public EcontextVoucherDetails(string firstName, string lastName, string shopperEmail, string telephoneNumber, TypeEnum type, Option checkoutAttemptId = default) + { + FirstName = firstName; + LastName = lastName; + ShopperEmail = shopperEmail; + TelephoneNumber = telephoneNumber; + Type = type; + CheckoutAttemptIdOption = checkoutAttemptId; + OnCreated(); + } + + partial void OnCreated(); + /// /// **econtextvoucher** /// /// **econtextvoucher** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum EcontextSevenEleven for value: econtext_seven_eleven /// - [EnumMember(Value = "econtext_seven_eleven")] EcontextSevenEleven = 1, /// /// Enum EcontextOnline for value: econtext_online /// - [EnumMember(Value = "econtext_online")] EcontextOnline = 2, /// /// Enum Econtext for value: econtext /// - [EnumMember(Value = "econtext")] Econtext = 3, /// /// Enum EcontextStores for value: econtext_stores /// - [EnumMember(Value = "econtext_stores")] EcontextStores = 4, /// /// Enum EcontextAtm for value: econtext_atm /// - [EnumMember(Value = "econtext_atm")] EcontextAtm = 5 - } - /// - /// **econtextvoucher** + /// Returns a /// - /// **econtextvoucher** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public TypeEnum Type { get; set; } + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("econtext_seven_eleven")) + return TypeEnum.EcontextSevenEleven; + + if (value.Equals("econtext_online")) + return TypeEnum.EcontextOnline; + + if (value.Equals("econtext")) + return TypeEnum.Econtext; + + if (value.Equals("econtext_stores")) + return TypeEnum.EcontextStores; + + if (value.Equals("econtext_atm")) + return TypeEnum.EcontextAtm; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected EcontextVoucherDetails() { } + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("econtext_seven_eleven")) + return TypeEnum.EcontextSevenEleven; + + if (value.Equals("econtext_online")) + return TypeEnum.EcontextOnline; + + if (value.Equals("econtext")) + return TypeEnum.Econtext; + + if (value.Equals("econtext_stores")) + return TypeEnum.EcontextStores; + + if (value.Equals("econtext_atm")) + return TypeEnum.EcontextAtm; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The checkout attempt identifier.. - /// The shopper's first name. (required). - /// The shopper's last name. (required). - /// The shopper's email. (required). - /// The shopper's contact number. It must have an international number format, for example **+31 20 779 1846**. Formats like **+31 (0)20 779 1846** or **0031 20 779 1846** are not accepted. (required). - /// **econtextvoucher** (required). - public EcontextVoucherDetails(string checkoutAttemptId = default(string), string firstName = default(string), string lastName = default(string), string shopperEmail = default(string), string telephoneNumber = default(string), TypeEnum type = default(TypeEnum)) + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) { - this.FirstName = firstName; - this.LastName = lastName; - this.ShopperEmail = shopperEmail; - this.TelephoneNumber = telephoneNumber; - this.Type = type; - this.CheckoutAttemptId = checkoutAttemptId; + if (value == TypeEnum.EcontextSevenEleven) + return "econtext_seven_eleven"; + + if (value == TypeEnum.EcontextOnline) + return "econtext_online"; + + if (value == TypeEnum.Econtext) + return "econtext"; + + if (value == TypeEnum.EcontextStores) + return "econtext_stores"; + + if (value == TypeEnum.EcontextAtm) + return "econtext_atm"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// The checkout attempt identifier. + /// **econtextvoucher** /// - /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + /// **econtextvoucher** + [JsonPropertyName("type")] + public TypeEnum Type { get; set; } /// /// The shopper's first name. /// /// The shopper's first name. - [DataMember(Name = "firstName", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("firstName")] public string FirstName { get; set; } /// /// The shopper's last name. /// /// The shopper's last name. - [DataMember(Name = "lastName", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("lastName")] public string LastName { get; set; } /// /// The shopper's email. /// /// The shopper's email. - [DataMember(Name = "shopperEmail", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("shopperEmail")] public string ShopperEmail { get; set; } /// /// The shopper's contact number. It must have an international number format, for example **+31 20 779 1846**. Formats like **+31 (0)20 779 1846** or **0031 20 779 1846** are not accepted. /// /// The shopper's contact number. It must have an international number format, for example **+31 20 779 1846**. Formats like **+31 (0)20 779 1846** or **0031 20 779 1846** are not accepted. - [DataMember(Name = "telephoneNumber", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("telephoneNumber")] public string TelephoneNumber { get; set; } + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } + + /// + /// The checkout attempt identifier. + /// + /// The checkout attempt identifier. + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -145,120 +217,184 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class EcontextVoucherDetails {\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FirstName: ").Append(FirstName).Append("\n"); sb.Append(" LastName: ").Append(LastName).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class EcontextVoucherDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override EcontextVoucherDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as EcontextVoucherDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if EcontextVoucherDetails instances are equal - /// - /// Instance of EcontextVoucherDetails to be compared - /// Boolean - public bool Equals(EcontextVoucherDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option firstName = default; + Option lastName = default; + Option shopperEmail = default; + Option telephoneNumber = default; + Option type = default; + Option checkoutAttemptId = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "telephoneNumber": + telephoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(EcontextVoucherDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.FirstName == input.FirstName || - (this.FirstName != null && - this.FirstName.Equals(input.FirstName)) - ) && - ( - this.LastName == input.LastName || - (this.LastName != null && - this.LastName.Equals(input.LastName)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!firstName.IsSet) + throw new ArgumentException("Property is required for class EcontextVoucherDetails.", nameof(firstName)); + + if (!lastName.IsSet) + throw new ArgumentException("Property is required for class EcontextVoucherDetails.", nameof(lastName)); + + if (!shopperEmail.IsSet) + throw new ArgumentException("Property is required for class EcontextVoucherDetails.", nameof(shopperEmail)); + + if (!telephoneNumber.IsSet) + throw new ArgumentException("Property is required for class EcontextVoucherDetails.", nameof(telephoneNumber)); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class EcontextVoucherDetails.", nameof(type)); + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class EcontextVoucherDetails."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class EcontextVoucherDetails."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class EcontextVoucherDetails."); + + if (telephoneNumber.IsSet && telephoneNumber.Value == null) + throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class EcontextVoucherDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class EcontextVoucherDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class EcontextVoucherDetails."); + + return new EcontextVoucherDetails(firstName.Value, lastName.Value, shopperEmail.Value, telephoneNumber.Value, type.Value.Value, checkoutAttemptId); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EcontextVoucherDetails econtextVoucherDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.FirstName != null) - { - hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); - } - if (this.LastName != null) - { - hashCode = (hashCode * 59) + this.LastName.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.TelephoneNumber != null) - { - hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, econtextVoucherDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, EcontextVoucherDetails econtextVoucherDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (econtextVoucherDetails.FirstName == null) + throw new ArgumentNullException(nameof(econtextVoucherDetails.FirstName), "Property is required for class EcontextVoucherDetails."); + + if (econtextVoucherDetails.LastName == null) + throw new ArgumentNullException(nameof(econtextVoucherDetails.LastName), "Property is required for class EcontextVoucherDetails."); + + if (econtextVoucherDetails.ShopperEmail == null) + throw new ArgumentNullException(nameof(econtextVoucherDetails.ShopperEmail), "Property is required for class EcontextVoucherDetails."); + + if (econtextVoucherDetails.TelephoneNumber == null) + throw new ArgumentNullException(nameof(econtextVoucherDetails.TelephoneNumber), "Property is required for class EcontextVoucherDetails."); + + if (econtextVoucherDetails.CheckoutAttemptIdOption.IsSet && econtextVoucherDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(econtextVoucherDetails.CheckoutAttemptId), "Property is required for class EcontextVoucherDetails."); + + writer.WriteString("firstName", econtextVoucherDetails.FirstName); + + writer.WriteString("lastName", econtextVoucherDetails.LastName); + + writer.WriteString("shopperEmail", econtextVoucherDetails.ShopperEmail); + + writer.WriteString("telephoneNumber", econtextVoucherDetails.TelephoneNumber); + + var typeRawValue = EcontextVoucherDetails.TypeEnumToJsonValue(econtextVoucherDetails.Type); + writer.WriteString("type", typeRawValue); + if (econtextVoucherDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", econtextVoucherDetails.CheckoutAttemptId); } } - } diff --git a/Adyen/Model/Checkout/EftDetails.cs b/Adyen/Model/Checkout/EftDetails.cs index 326b7600f..5bf29e533 100644 --- a/Adyen/Model/Checkout/EftDetails.cs +++ b/Adyen/Model/Checkout/EftDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,117 +14,212 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// EftDetails /// - [DataContract(Name = "EftDetails")] - public partial class EftDetails : IEquatable, IValidatableObject + public partial class EftDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The bank account number (without separators). + /// The financial institution code. + /// The bank routing number of the account. + /// The checkout attempt identifier. + /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **eft** (default to TypeEnum.EftDirectdebitCA) + [JsonConstructor] + public EftDetails(Option bankAccountNumber = default, Option bankCode = default, Option bankLocationId = default, Option checkoutAttemptId = default, Option ownerName = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + BankAccountNumberOption = bankAccountNumber; + BankCodeOption = bankCode; + BankLocationIdOption = bankLocationId; + CheckoutAttemptIdOption = checkoutAttemptId; + OwnerNameOption = ownerName; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **eft** /// /// **eft** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum EftDirectdebitCA for value: eft_directdebit_CA /// - [EnumMember(Value = "eft_directdebit_CA")] EftDirectdebitCA = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("eft_directdebit_CA")) + return TypeEnum.EftDirectdebitCA; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("eft_directdebit_CA")) + return TypeEnum.EftDirectdebitCA; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.EftDirectdebitCA) + return "eft_directdebit_CA"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **eft** /// /// **eft** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of BankAccountNumber /// - /// The bank account number (without separators).. - /// The financial institution code.. - /// The bank routing number of the account.. - /// The checkout attempt identifier.. - /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **eft** (default to TypeEnum.EftDirectdebitCA). - public EftDetails(string bankAccountNumber = default(string), string bankCode = default(string), string bankLocationId = default(string), string checkoutAttemptId = default(string), string ownerName = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.EftDirectdebitCA) - { - this.BankAccountNumber = bankAccountNumber; - this.BankCode = bankCode; - this.BankLocationId = bankLocationId; - this.CheckoutAttemptId = checkoutAttemptId; - this.OwnerName = ownerName; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankAccountNumberOption { get; private set; } /// /// The bank account number (without separators). /// /// The bank account number (without separators). - [DataMember(Name = "bankAccountNumber", EmitDefaultValue = false)] - public string BankAccountNumber { get; set; } + [JsonPropertyName("bankAccountNumber")] + public string BankAccountNumber { get { return this.BankAccountNumberOption; } set { this.BankAccountNumberOption = new Option(value); } } + + /// + /// Used to track the state of BankCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankCodeOption { get; private set; } /// /// The financial institution code. /// /// The financial institution code. - [DataMember(Name = "bankCode", EmitDefaultValue = false)] - public string BankCode { get; set; } + [JsonPropertyName("bankCode")] + public string BankCode { get { return this.BankCodeOption; } set { this.BankCodeOption = new Option(value); } } + + /// + /// Used to track the state of BankLocationId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankLocationIdOption { get; private set; } /// /// The bank routing number of the account. /// /// The bank routing number of the account. - [DataMember(Name = "bankLocationId", EmitDefaultValue = false)] - public string BankLocationId { get; set; } + [JsonPropertyName("bankLocationId")] + public string BankLocationId { get { return this.BankLocationIdOption; } set { this.BankLocationIdOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of OwnerName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OwnerNameOption { get; private set; } /// /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. /// /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. - [DataMember(Name = "ownerName", EmitDefaultValue = false)] - public string OwnerName { get; set; } + [JsonPropertyName("ownerName")] + public string OwnerName { get { return this.OwnerNameOption; } set { this.OwnerNameOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -148,133 +242,195 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as EftDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class EftDetailsJsonConverter : JsonConverter + { /// - /// Returns true if EftDetails instances are equal + /// Deserializes json to /// - /// Instance of EftDetails to be compared - /// Boolean - public bool Equals(EftDetails input) + /// + /// + /// + /// + /// + public override EftDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option bankAccountNumber = default; + Option bankCode = default; + Option bankLocationId = default; + Option checkoutAttemptId = default; + Option ownerName = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "bankAccountNumber": + bankAccountNumber = new Option(utf8JsonReader.GetString()); + break; + case "bankCode": + bankCode = new Option(utf8JsonReader.GetString()); + break; + case "bankLocationId": + bankLocationId = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "ownerName": + ownerName = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(EftDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.BankAccountNumber == input.BankAccountNumber || - (this.BankAccountNumber != null && - this.BankAccountNumber.Equals(input.BankAccountNumber)) - ) && - ( - this.BankCode == input.BankCode || - (this.BankCode != null && - this.BankCode.Equals(input.BankCode)) - ) && - ( - this.BankLocationId == input.BankLocationId || - (this.BankLocationId != null && - this.BankLocationId.Equals(input.BankLocationId)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.OwnerName == input.OwnerName || - (this.OwnerName != null && - this.OwnerName.Equals(input.OwnerName)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (bankAccountNumber.IsSet && bankAccountNumber.Value == null) + throw new ArgumentNullException(nameof(bankAccountNumber), "Property is not nullable for class EftDetails."); + + if (bankCode.IsSet && bankCode.Value == null) + throw new ArgumentNullException(nameof(bankCode), "Property is not nullable for class EftDetails."); + + if (bankLocationId.IsSet && bankLocationId.Value == null) + throw new ArgumentNullException(nameof(bankLocationId), "Property is not nullable for class EftDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class EftDetails."); + + if (ownerName.IsSet && ownerName.Value == null) + throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class EftDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class EftDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class EftDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class EftDetails."); + + return new EftDetails(bankAccountNumber, bankCode, bankLocationId, checkoutAttemptId, ownerName, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EftDetails eftDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BankAccountNumber != null) - { - hashCode = (hashCode * 59) + this.BankAccountNumber.GetHashCode(); - } - if (this.BankCode != null) - { - hashCode = (hashCode * 59) + this.BankCode.GetHashCode(); - } - if (this.BankLocationId != null) - { - hashCode = (hashCode * 59) + this.BankLocationId.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.OwnerName != null) - { - hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, eftDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, EftDetails eftDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (eftDetails.BankAccountNumberOption.IsSet && eftDetails.BankAccountNumber == null) + throw new ArgumentNullException(nameof(eftDetails.BankAccountNumber), "Property is required for class EftDetails."); - yield break; + if (eftDetails.BankCodeOption.IsSet && eftDetails.BankCode == null) + throw new ArgumentNullException(nameof(eftDetails.BankCode), "Property is required for class EftDetails."); + + if (eftDetails.BankLocationIdOption.IsSet && eftDetails.BankLocationId == null) + throw new ArgumentNullException(nameof(eftDetails.BankLocationId), "Property is required for class EftDetails."); + + if (eftDetails.CheckoutAttemptIdOption.IsSet && eftDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(eftDetails.CheckoutAttemptId), "Property is required for class EftDetails."); + + if (eftDetails.OwnerNameOption.IsSet && eftDetails.OwnerName == null) + throw new ArgumentNullException(nameof(eftDetails.OwnerName), "Property is required for class EftDetails."); + + if (eftDetails.RecurringDetailReferenceOption.IsSet && eftDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(eftDetails.RecurringDetailReference), "Property is required for class EftDetails."); + + if (eftDetails.StoredPaymentMethodIdOption.IsSet && eftDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(eftDetails.StoredPaymentMethodId), "Property is required for class EftDetails."); + + if (eftDetails.BankAccountNumberOption.IsSet) + writer.WriteString("bankAccountNumber", eftDetails.BankAccountNumber); + + if (eftDetails.BankCodeOption.IsSet) + writer.WriteString("bankCode", eftDetails.BankCode); + + if (eftDetails.BankLocationIdOption.IsSet) + writer.WriteString("bankLocationId", eftDetails.BankLocationId); + + if (eftDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", eftDetails.CheckoutAttemptId); + + if (eftDetails.OwnerNameOption.IsSet) + writer.WriteString("ownerName", eftDetails.OwnerName); + + if (eftDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", eftDetails.RecurringDetailReference); + + if (eftDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", eftDetails.StoredPaymentMethodId); + + var typeRawValue = EftDetails.TypeEnumToJsonValue(eftDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/EncryptedOrderData.cs b/Adyen/Model/Checkout/EncryptedOrderData.cs index 0f73d11a0..0466d0841 100644 --- a/Adyen/Model/Checkout/EncryptedOrderData.cs +++ b/Adyen/Model/Checkout/EncryptedOrderData.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,51 +14,47 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// EncryptedOrderData /// - [DataContract(Name = "EncryptedOrderData")] - public partial class EncryptedOrderData : IEquatable, IValidatableObject + public partial class EncryptedOrderData : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected EncryptedOrderData() { } - /// - /// Initializes a new instance of the class. - /// - /// The encrypted order data. (required). - /// The `pspReference` that belongs to the order. (required). - public EncryptedOrderData(string orderData = default(string), string pspReference = default(string)) + /// The encrypted order data. + /// The `pspReference` that belongs to the order. + [JsonConstructor] + public EncryptedOrderData(string orderData, string pspReference) { - this.OrderData = orderData; - this.PspReference = pspReference; + OrderData = orderData; + PspReference = pspReference; + OnCreated(); } + partial void OnCreated(); + /// /// The encrypted order data. /// /// The encrypted order data. - [DataMember(Name = "orderData", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("orderData")] public string OrderData { get; set; } /// /// The `pspReference` that belongs to the order. /// /// The `pspReference` that belongs to the order. - [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("pspReference")] public string PspReference { get; set; } /// @@ -77,83 +72,122 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // OrderData (string) maxLength + if (this.OrderData != null && this.OrderData.Length > 5000) + { + yield return new ValidationResult("Invalid value for OrderData, length must be less than 5000.", new [] { "OrderData" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as EncryptedOrderData); + yield break; } + } + /// + /// A Json converter for type + /// + public class EncryptedOrderDataJsonConverter : JsonConverter + { /// - /// Returns true if EncryptedOrderData instances are equal + /// Deserializes json to /// - /// Instance of EncryptedOrderData to be compared - /// Boolean - public bool Equals(EncryptedOrderData input) + /// + /// + /// + /// + /// + public override EncryptedOrderData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option orderData = default; + Option pspReference = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "orderData": + orderData = new Option(utf8JsonReader.GetString()); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.OrderData == input.OrderData || - (this.OrderData != null && - this.OrderData.Equals(input.OrderData)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ); + + if (!orderData.IsSet) + throw new ArgumentException("Property is required for class EncryptedOrderData.", nameof(orderData)); + + if (!pspReference.IsSet) + throw new ArgumentException("Property is required for class EncryptedOrderData.", nameof(pspReference)); + + if (orderData.IsSet && orderData.Value == null) + throw new ArgumentNullException(nameof(orderData), "Property is not nullable for class EncryptedOrderData."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class EncryptedOrderData."); + + return new EncryptedOrderData(orderData.Value, pspReference.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EncryptedOrderData encryptedOrderData, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.OrderData != null) - { - hashCode = (hashCode * 59) + this.OrderData.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, encryptedOrderData, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, EncryptedOrderData encryptedOrderData, JsonSerializerOptions jsonSerializerOptions) { - // OrderData (string) maxLength - if (this.OrderData != null && this.OrderData.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for OrderData, length must be less than 5000.", new [] { "OrderData" }); - } + if (encryptedOrderData.OrderData == null) + throw new ArgumentNullException(nameof(encryptedOrderData.OrderData), "Property is required for class EncryptedOrderData."); - yield break; + if (encryptedOrderData.PspReference == null) + throw new ArgumentNullException(nameof(encryptedOrderData.PspReference), "Property is required for class EncryptedOrderData."); + + writer.WriteString("orderData", encryptedOrderData.OrderData); + + writer.WriteString("pspReference", encryptedOrderData.PspReference); } } - } diff --git a/Adyen/Model/Checkout/EnhancedSchemeData.cs b/Adyen/Model/Checkout/EnhancedSchemeData.cs index 9a272d4c1..a339c8882 100644 --- a/Adyen/Model/Checkout/EnhancedSchemeData.cs +++ b/Adyen/Model/Checkout/EnhancedSchemeData.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,37 +14,45 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// EnhancedSchemeData /// - [DataContract(Name = "EnhancedSchemeData")] - public partial class EnhancedSchemeData : IEquatable, IValidatableObject + public partial class EnhancedSchemeData : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// airline. - public EnhancedSchemeData(Airline airline = default(Airline)) + /// airline + [JsonConstructor] + public EnhancedSchemeData(Option airline = default) { - this.Airline = airline; + AirlineOption = airline; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Airline + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AirlineOption { get; private set; } + /// /// Gets or Sets Airline /// - [DataMember(Name = "airline", EmitDefaultValue = false)] - public Airline Airline { get; set; } + [JsonPropertyName("airline")] + public Airline Airline { get { return this.AirlineOption; } set { this.AirlineOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -61,68 +68,103 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class EnhancedSchemeDataJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override EnhancedSchemeData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as EnhancedSchemeData); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if EnhancedSchemeData instances are equal - /// - /// Instance of EnhancedSchemeData to be compared - /// Boolean - public bool Equals(EnhancedSchemeData input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option airline = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "airline": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + airline = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.Airline == input.Airline || - (this.Airline != null && - this.Airline.Equals(input.Airline)) - ); + + if (airline.IsSet && airline.Value == null) + throw new ArgumentNullException(nameof(airline), "Property is not nullable for class EnhancedSchemeData."); + + return new EnhancedSchemeData(airline); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnhancedSchemeData enhancedSchemeData, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Airline != null) - { - hashCode = (hashCode * 59) + this.Airline.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, enhancedSchemeData, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, EnhancedSchemeData enhancedSchemeData, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (enhancedSchemeData.AirlineOption.IsSet && enhancedSchemeData.Airline == null) + throw new ArgumentNullException(nameof(enhancedSchemeData.Airline), "Property is required for class EnhancedSchemeData."); + + if (enhancedSchemeData.AirlineOption.IsSet) + { + writer.WritePropertyName("airline"); + JsonSerializer.Serialize(writer, enhancedSchemeData.Airline, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/ExternalPlatform.cs b/Adyen/Model/Checkout/ExternalPlatform.cs index 755539a78..7b791bc5a 100644 --- a/Adyen/Model/Checkout/ExternalPlatform.cs +++ b/Adyen/Model/Checkout/ExternalPlatform.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,56 +14,78 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ExternalPlatform /// - [DataContract(Name = "ExternalPlatform")] - public partial class ExternalPlatform : IEquatable, IValidatableObject + public partial class ExternalPlatform : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// External platform integrator.. - /// Name of the field. For example, Name of External Platform.. - /// Version of the field. For example, Version of External Platform.. - public ExternalPlatform(string integrator = default(string), string name = default(string), string version = default(string)) + /// External platform integrator. + /// Name of the field. For example, Name of External Platform. + /// Version of the field. For example, Version of External Platform. + [JsonConstructor] + public ExternalPlatform(Option integrator = default, Option name = default, Option varVersion = default) { - this.Integrator = integrator; - this.Name = name; - this.Version = version; + IntegratorOption = integrator; + NameOption = name; + VarVersionOption = varVersion; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Integrator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IntegratorOption { get; private set; } + /// /// External platform integrator. /// /// External platform integrator. - [DataMember(Name = "integrator", EmitDefaultValue = false)] - public string Integrator { get; set; } + [JsonPropertyName("integrator")] + public string Integrator { get { return this.IntegratorOption; } set { this.IntegratorOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } /// /// Name of the field. For example, Name of External Platform. /// /// Name of the field. For example, Name of External Platform. - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + + /// + /// Used to track the state of VarVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VarVersionOption { get; private set; } /// /// Version of the field. For example, Version of External Platform. /// /// Version of the field. For example, Version of External Platform. - [DataMember(Name = "version", EmitDefaultValue = false)] - public string Version { get; set; } + [JsonPropertyName("version")] + public string VarVersion { get { return this.VarVersionOption; } set { this.VarVersionOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -76,92 +97,131 @@ public override string ToString() sb.Append("class ExternalPlatform {\n"); sb.Append(" Integrator: ").Append(Integrator).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Version: ").Append(Version).Append("\n"); + sb.Append(" VarVersion: ").Append(VarVersion).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ExternalPlatformJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ExternalPlatform Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ExternalPlatform); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ExternalPlatform instances are equal - /// - /// Instance of ExternalPlatform to be compared - /// Boolean - public bool Equals(ExternalPlatform input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option integrator = default; + Option name = default; + Option varVersion = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "integrator": + integrator = new Option(utf8JsonReader.GetString()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "version": + varVersion = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Integrator == input.Integrator || - (this.Integrator != null && - this.Integrator.Equals(input.Integrator)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Version == input.Version || - (this.Version != null && - this.Version.Equals(input.Version)) - ); + + if (integrator.IsSet && integrator.Value == null) + throw new ArgumentNullException(nameof(integrator), "Property is not nullable for class ExternalPlatform."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class ExternalPlatform."); + + if (varVersion.IsSet && varVersion.Value == null) + throw new ArgumentNullException(nameof(varVersion), "Property is not nullable for class ExternalPlatform."); + + return new ExternalPlatform(integrator, name, varVersion); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ExternalPlatform externalPlatform, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Integrator != null) - { - hashCode = (hashCode * 59) + this.Integrator.GetHashCode(); - } - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.Version != null) - { - hashCode = (hashCode * 59) + this.Version.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, externalPlatform, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ExternalPlatform externalPlatform, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (externalPlatform.IntegratorOption.IsSet && externalPlatform.Integrator == null) + throw new ArgumentNullException(nameof(externalPlatform.Integrator), "Property is required for class ExternalPlatform."); + + if (externalPlatform.NameOption.IsSet && externalPlatform.Name == null) + throw new ArgumentNullException(nameof(externalPlatform.Name), "Property is required for class ExternalPlatform."); + + if (externalPlatform.VarVersionOption.IsSet && externalPlatform.VarVersion == null) + throw new ArgumentNullException(nameof(externalPlatform.VarVersion), "Property is required for class ExternalPlatform."); + + if (externalPlatform.IntegratorOption.IsSet) + writer.WriteString("integrator", externalPlatform.Integrator); + + if (externalPlatform.NameOption.IsSet) + writer.WriteString("name", externalPlatform.Name); + + if (externalPlatform.VarVersionOption.IsSet) + writer.WriteString("version", externalPlatform.VarVersion); } } - } diff --git a/Adyen/Model/Checkout/FastlaneDetails.cs b/Adyen/Model/Checkout/FastlaneDetails.cs index 4eb2cce34..808b1e1e8 100644 --- a/Adyen/Model/Checkout/FastlaneDetails.cs +++ b/Adyen/Model/Checkout/FastlaneDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,95 +14,150 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// FastlaneDetails /// - [DataContract(Name = "FastlaneDetails")] - public partial class FastlaneDetails : IEquatable, IValidatableObject + public partial class FastlaneDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The encoded fastlane data blob + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **fastlane** (default to TypeEnum.Fastlane) + [JsonConstructor] + public FastlaneDetails(string fastlaneData, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.Fastlane) + { + FastlaneData = fastlaneData; + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + Type = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **fastlane** /// /// **fastlane** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Fastlane for value: fastlane /// - [EnumMember(Value = "fastlane")] Fastlane = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("fastlane")) + return TypeEnum.Fastlane; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("fastlane")) + return TypeEnum.Fastlane; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.Fastlane) + return "fastlane"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **fastlane** /// /// **fastlane** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. + /// The encoded fastlane data blob /// - [JsonConstructorAttribute] - protected FastlaneDetails() { } + /// The encoded fastlane data blob + [JsonPropertyName("fastlaneData")] + public string FastlaneData { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The encoded fastlane data blob (required). - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **fastlane** (required) (default to TypeEnum.Fastlane). - public FastlaneDetails(string checkoutAttemptId = default(string), string fastlaneData = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.Fastlane) - { - this.FastlaneData = fastlaneData; - this.Type = type; - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } /// - /// The encoded fastlane data blob + /// Used to track the state of RecurringDetailReference /// - /// The encoded fastlane data blob - [DataMember(Name = "fastlaneData", IsRequired = false, EmitDefaultValue = false)] - public string FastlaneData { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -113,8 +167,8 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class FastlaneDetails {\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FastlaneData: ").Append(FastlaneData).Append("\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -123,106 +177,161 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as FastlaneDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class FastlaneDetailsJsonConverter : JsonConverter + { /// - /// Returns true if FastlaneDetails instances are equal + /// Deserializes json to /// - /// Instance of FastlaneDetails to be compared - /// Boolean - public bool Equals(FastlaneDetails input) + /// + /// + /// + /// + /// + public override FastlaneDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option fastlaneData = default; + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "fastlaneData": + fastlaneData = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(FastlaneDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.FastlaneData == input.FastlaneData || - (this.FastlaneData != null && - this.FastlaneData.Equals(input.FastlaneData)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!fastlaneData.IsSet) + throw new ArgumentException("Property is required for class FastlaneDetails.", nameof(fastlaneData)); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class FastlaneDetails.", nameof(type)); + + if (fastlaneData.IsSet && fastlaneData.Value == null) + throw new ArgumentNullException(nameof(fastlaneData), "Property is not nullable for class FastlaneDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class FastlaneDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class FastlaneDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class FastlaneDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class FastlaneDetails."); + + return new FastlaneDetails(fastlaneData.Value, checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FastlaneDetails fastlaneDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.FastlaneData != null) - { - hashCode = (hashCode * 59) + this.FastlaneData.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, fastlaneDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, FastlaneDetails fastlaneDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (fastlaneDetails.FastlaneData == null) + throw new ArgumentNullException(nameof(fastlaneDetails.FastlaneData), "Property is required for class FastlaneDetails."); - yield break; + if (fastlaneDetails.CheckoutAttemptIdOption.IsSet && fastlaneDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(fastlaneDetails.CheckoutAttemptId), "Property is required for class FastlaneDetails."); + + if (fastlaneDetails.RecurringDetailReferenceOption.IsSet && fastlaneDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(fastlaneDetails.RecurringDetailReference), "Property is required for class FastlaneDetails."); + + if (fastlaneDetails.StoredPaymentMethodIdOption.IsSet && fastlaneDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(fastlaneDetails.StoredPaymentMethodId), "Property is required for class FastlaneDetails."); + + writer.WriteString("fastlaneData", fastlaneDetails.FastlaneData); + + if (fastlaneDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", fastlaneDetails.CheckoutAttemptId); + + if (fastlaneDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", fastlaneDetails.RecurringDetailReference); + + if (fastlaneDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", fastlaneDetails.StoredPaymentMethodId); + + var typeRawValue = FastlaneDetails.TypeEnumToJsonValue(fastlaneDetails.Type); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/ForexQuote.cs b/Adyen/Model/Checkout/ForexQuote.cs index 67180acfc..f9ffdf98f 100644 --- a/Adyen/Model/Checkout/ForexQuote.cs +++ b/Adyen/Model/Checkout/ForexQuote.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,138 +14,204 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ForexQuote /// - [DataContract(Name = "ForexQuote")] - public partial class ForexQuote : IEquatable, IValidatableObject + public partial class ForexQuote : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected ForexQuote() { } - /// - /// Initializes a new instance of the class. - /// - /// The account name.. - /// The account type.. - /// baseAmount. - /// The base points. (required). - /// buy. - /// interbank. - /// The reference assigned to the forex quote request.. - /// sell. - /// The signature to validate the integrity.. - /// The source of the forex quote.. - /// The type of forex.. - /// The date until which the forex quote is valid. (required). - public ForexQuote(string account = default(string), string accountType = default(string), Amount baseAmount = default(Amount), int? basePoints = default(int?), Amount buy = default(Amount), Amount interbank = default(Amount), string reference = default(string), Amount sell = default(Amount), string signature = default(string), string source = default(string), string type = default(string), DateTime validTill = default(DateTime)) + /// The base points. + /// The date until which the forex quote is valid. + /// The account name. + /// The account type. + /// baseAmount + /// buy + /// interbank + /// The reference assigned to the forex quote request. + /// sell + /// The signature to validate the integrity. + /// The source of the forex quote. + /// The type of forex. + [JsonConstructor] + public ForexQuote(int basePoints, DateTime validTill, Option account = default, Option accountType = default, Option baseAmount = default, Option buy = default, Option interbank = default, Option reference = default, Option sell = default, Option signature = default, Option source = default, Option type = default) { - this.BasePoints = basePoints; - this.ValidTill = validTill; - this.Account = account; - this.AccountType = accountType; - this.BaseAmount = baseAmount; - this.Buy = buy; - this.Interbank = interbank; - this.Reference = reference; - this.Sell = sell; - this.Signature = signature; - this.Source = source; - this.Type = type; + BasePoints = basePoints; + ValidTill = validTill; + AccountOption = account; + AccountTypeOption = accountType; + BaseAmountOption = baseAmount; + BuyOption = buy; + InterbankOption = interbank; + ReferenceOption = reference; + SellOption = sell; + SignatureOption = signature; + SourceOption = source; + TypeOption = type; + OnCreated(); } + partial void OnCreated(); + + /// + /// The base points. + /// + /// The base points. + [JsonPropertyName("basePoints")] + public int BasePoints { get; set; } + + /// + /// The date until which the forex quote is valid. + /// + /// The date until which the forex quote is valid. + [JsonPropertyName("validTill")] + public DateTime ValidTill { get; set; } + + /// + /// Used to track the state of Account + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountOption { get; private set; } + /// /// The account name. /// /// The account name. - [DataMember(Name = "account", EmitDefaultValue = false)] - public string Account { get; set; } + [JsonPropertyName("account")] + public string Account { get { return this.AccountOption; } set { this.AccountOption = new Option(value); } } + + /// + /// Used to track the state of AccountType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountTypeOption { get; private set; } /// /// The account type. /// /// The account type. - [DataMember(Name = "accountType", EmitDefaultValue = false)] - public string AccountType { get; set; } + [JsonPropertyName("accountType")] + public string AccountType { get { return this.AccountTypeOption; } set { this.AccountTypeOption = new Option(value); } } + + /// + /// Used to track the state of BaseAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BaseAmountOption { get; private set; } /// /// Gets or Sets BaseAmount /// - [DataMember(Name = "baseAmount", EmitDefaultValue = false)] - public Amount BaseAmount { get; set; } + [JsonPropertyName("baseAmount")] + public Amount BaseAmount { get { return this.BaseAmountOption; } set { this.BaseAmountOption = new Option(value); } } /// - /// The base points. + /// Used to track the state of Buy /// - /// The base points. - [DataMember(Name = "basePoints", IsRequired = false, EmitDefaultValue = false)] - public int? BasePoints { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BuyOption { get; private set; } /// /// Gets or Sets Buy /// - [DataMember(Name = "buy", EmitDefaultValue = false)] - public Amount Buy { get; set; } + [JsonPropertyName("buy")] + public Amount Buy { get { return this.BuyOption; } set { this.BuyOption = new Option(value); } } + + /// + /// Used to track the state of Interbank + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InterbankOption { get; private set; } /// /// Gets or Sets Interbank /// - [DataMember(Name = "interbank", EmitDefaultValue = false)] - public Amount Interbank { get; set; } + [JsonPropertyName("interbank")] + public Amount Interbank { get { return this.InterbankOption; } set { this.InterbankOption = new Option(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// The reference assigned to the forex quote request. /// /// The reference assigned to the forex quote request. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Sell + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SellOption { get; private set; } /// /// Gets or Sets Sell /// - [DataMember(Name = "sell", EmitDefaultValue = false)] - public Amount Sell { get; set; } + [JsonPropertyName("sell")] + public Amount Sell { get { return this.SellOption; } set { this.SellOption = new Option(value); } } + + /// + /// Used to track the state of Signature + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SignatureOption { get; private set; } /// /// The signature to validate the integrity. /// /// The signature to validate the integrity. - [DataMember(Name = "signature", EmitDefaultValue = false)] - public string Signature { get; set; } + [JsonPropertyName("signature")] + public string Signature { get { return this.SignatureOption; } set { this.SignatureOption = new Option(value); } } + + /// + /// Used to track the state of Source + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SourceOption { get; private set; } /// /// The source of the forex quote. /// /// The source of the forex quote. - [DataMember(Name = "source", EmitDefaultValue = false)] - public string Source { get; set; } + [JsonPropertyName("source")] + public string Source { get { return this.SourceOption; } set { this.SourceOption = new Option(value); } } /// - /// The type of forex. + /// Used to track the state of Type /// - /// The type of forex. - [DataMember(Name = "type", EmitDefaultValue = false)] - public string Type { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// - /// The date until which the forex quote is valid. + /// The type of forex. /// - /// The date until which the forex quote is valid. - [DataMember(Name = "validTill", IsRequired = false, EmitDefaultValue = false)] - public DateTime ValidTill { get; set; } + /// The type of forex. + [JsonPropertyName("type")] + public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -156,10 +221,11 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class ForexQuote {\n"); + sb.Append(" BasePoints: ").Append(BasePoints).Append("\n"); + sb.Append(" ValidTill: ").Append(ValidTill).Append("\n"); sb.Append(" Account: ").Append(Account).Append("\n"); sb.Append(" AccountType: ").Append(AccountType).Append("\n"); sb.Append(" BaseAmount: ").Append(BaseAmount).Append("\n"); - sb.Append(" BasePoints: ").Append(BasePoints).Append("\n"); sb.Append(" Buy: ").Append(Buy).Append("\n"); sb.Append(" Interbank: ").Append(Interbank).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); @@ -167,169 +233,264 @@ public override string ToString() sb.Append(" Signature: ").Append(Signature).Append("\n"); sb.Append(" Source: ").Append(Source).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" ValidTill: ").Append(ValidTill).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ForexQuoteJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// The format to use to serialize ValidTill /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ForexQuote); - } + public static string ValidTillFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// Returns true if ForexQuote instances are equal + /// Deserializes json to /// - /// Instance of ForexQuote to be compared - /// Boolean - public bool Equals(ForexQuote input) + /// + /// + /// + /// + /// + public override ForexQuote Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option basePoints = default; + Option validTill = default; + Option account = default; + Option accountType = default; + Option baseAmount = default; + Option buy = default; + Option interbank = default; + Option reference = default; + Option sell = default; + Option signature = default; + Option source = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "basePoints": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + basePoints = new Option(utf8JsonReader.GetInt32()); + break; + case "validTill": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + validTill = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "account": + account = new Option(utf8JsonReader.GetString()); + break; + case "accountType": + accountType = new Option(utf8JsonReader.GetString()); + break; + case "baseAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + baseAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "buy": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + buy = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "interbank": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + interbank = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "sell": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sell = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "signature": + signature = new Option(utf8JsonReader.GetString()); + break; + case "source": + source = new Option(utf8JsonReader.GetString()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Account == input.Account || - (this.Account != null && - this.Account.Equals(input.Account)) - ) && - ( - this.AccountType == input.AccountType || - (this.AccountType != null && - this.AccountType.Equals(input.AccountType)) - ) && - ( - this.BaseAmount == input.BaseAmount || - (this.BaseAmount != null && - this.BaseAmount.Equals(input.BaseAmount)) - ) && - ( - this.BasePoints == input.BasePoints || - this.BasePoints.Equals(input.BasePoints) - ) && - ( - this.Buy == input.Buy || - (this.Buy != null && - this.Buy.Equals(input.Buy)) - ) && - ( - this.Interbank == input.Interbank || - (this.Interbank != null && - this.Interbank.Equals(input.Interbank)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.Sell == input.Sell || - (this.Sell != null && - this.Sell.Equals(input.Sell)) - ) && - ( - this.Signature == input.Signature || - (this.Signature != null && - this.Signature.Equals(input.Signature)) - ) && - ( - this.Source == input.Source || - (this.Source != null && - this.Source.Equals(input.Source)) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ) && - ( - this.ValidTill == input.ValidTill || - (this.ValidTill != null && - this.ValidTill.Equals(input.ValidTill)) - ); + + if (!basePoints.IsSet) + throw new ArgumentException("Property is required for class ForexQuote.", nameof(basePoints)); + + if (!validTill.IsSet) + throw new ArgumentException("Property is required for class ForexQuote.", nameof(validTill)); + + if (basePoints.IsSet && basePoints.Value == null) + throw new ArgumentNullException(nameof(basePoints), "Property is not nullable for class ForexQuote."); + + if (validTill.IsSet && validTill.Value == null) + throw new ArgumentNullException(nameof(validTill), "Property is not nullable for class ForexQuote."); + + if (account.IsSet && account.Value == null) + throw new ArgumentNullException(nameof(account), "Property is not nullable for class ForexQuote."); + + if (accountType.IsSet && accountType.Value == null) + throw new ArgumentNullException(nameof(accountType), "Property is not nullable for class ForexQuote."); + + if (baseAmount.IsSet && baseAmount.Value == null) + throw new ArgumentNullException(nameof(baseAmount), "Property is not nullable for class ForexQuote."); + + if (buy.IsSet && buy.Value == null) + throw new ArgumentNullException(nameof(buy), "Property is not nullable for class ForexQuote."); + + if (interbank.IsSet && interbank.Value == null) + throw new ArgumentNullException(nameof(interbank), "Property is not nullable for class ForexQuote."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class ForexQuote."); + + if (sell.IsSet && sell.Value == null) + throw new ArgumentNullException(nameof(sell), "Property is not nullable for class ForexQuote."); + + if (signature.IsSet && signature.Value == null) + throw new ArgumentNullException(nameof(signature), "Property is not nullable for class ForexQuote."); + + if (source.IsSet && source.Value == null) + throw new ArgumentNullException(nameof(source), "Property is not nullable for class ForexQuote."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class ForexQuote."); + + return new ForexQuote(basePoints.Value.Value, validTill.Value.Value, account, accountType, baseAmount, buy, interbank, reference, sell, signature, source, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ForexQuote forexQuote, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Account != null) - { - hashCode = (hashCode * 59) + this.Account.GetHashCode(); - } - if (this.AccountType != null) - { - hashCode = (hashCode * 59) + this.AccountType.GetHashCode(); - } - if (this.BaseAmount != null) - { - hashCode = (hashCode * 59) + this.BaseAmount.GetHashCode(); - } - hashCode = (hashCode * 59) + this.BasePoints.GetHashCode(); - if (this.Buy != null) - { - hashCode = (hashCode * 59) + this.Buy.GetHashCode(); - } - if (this.Interbank != null) - { - hashCode = (hashCode * 59) + this.Interbank.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.Sell != null) - { - hashCode = (hashCode * 59) + this.Sell.GetHashCode(); - } - if (this.Signature != null) - { - hashCode = (hashCode * 59) + this.Signature.GetHashCode(); - } - if (this.Source != null) - { - hashCode = (hashCode * 59) + this.Source.GetHashCode(); - } - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - if (this.ValidTill != null) - { - hashCode = (hashCode * 59) + this.ValidTill.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, forexQuote, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ForexQuote forexQuote, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (forexQuote.AccountOption.IsSet && forexQuote.Account == null) + throw new ArgumentNullException(nameof(forexQuote.Account), "Property is required for class ForexQuote."); + + if (forexQuote.AccountTypeOption.IsSet && forexQuote.AccountType == null) + throw new ArgumentNullException(nameof(forexQuote.AccountType), "Property is required for class ForexQuote."); + + if (forexQuote.BaseAmountOption.IsSet && forexQuote.BaseAmount == null) + throw new ArgumentNullException(nameof(forexQuote.BaseAmount), "Property is required for class ForexQuote."); + + if (forexQuote.BuyOption.IsSet && forexQuote.Buy == null) + throw new ArgumentNullException(nameof(forexQuote.Buy), "Property is required for class ForexQuote."); + + if (forexQuote.InterbankOption.IsSet && forexQuote.Interbank == null) + throw new ArgumentNullException(nameof(forexQuote.Interbank), "Property is required for class ForexQuote."); + + if (forexQuote.ReferenceOption.IsSet && forexQuote.Reference == null) + throw new ArgumentNullException(nameof(forexQuote.Reference), "Property is required for class ForexQuote."); + + if (forexQuote.SellOption.IsSet && forexQuote.Sell == null) + throw new ArgumentNullException(nameof(forexQuote.Sell), "Property is required for class ForexQuote."); + + if (forexQuote.SignatureOption.IsSet && forexQuote.Signature == null) + throw new ArgumentNullException(nameof(forexQuote.Signature), "Property is required for class ForexQuote."); + + if (forexQuote.SourceOption.IsSet && forexQuote.Source == null) + throw new ArgumentNullException(nameof(forexQuote.Source), "Property is required for class ForexQuote."); + + if (forexQuote.TypeOption.IsSet && forexQuote.Type == null) + throw new ArgumentNullException(nameof(forexQuote.Type), "Property is required for class ForexQuote."); + + writer.WriteNumber("basePoints", forexQuote.BasePoints); + + writer.WriteString("validTill", forexQuote.ValidTill.ToString(ValidTillFormat)); + + if (forexQuote.AccountOption.IsSet) + writer.WriteString("account", forexQuote.Account); + + if (forexQuote.AccountTypeOption.IsSet) + writer.WriteString("accountType", forexQuote.AccountType); + + if (forexQuote.BaseAmountOption.IsSet) + { + writer.WritePropertyName("baseAmount"); + JsonSerializer.Serialize(writer, forexQuote.BaseAmount, jsonSerializerOptions); + } + if (forexQuote.BuyOption.IsSet) + { + writer.WritePropertyName("buy"); + JsonSerializer.Serialize(writer, forexQuote.Buy, jsonSerializerOptions); + } + if (forexQuote.InterbankOption.IsSet) + { + writer.WritePropertyName("interbank"); + JsonSerializer.Serialize(writer, forexQuote.Interbank, jsonSerializerOptions); + } + if (forexQuote.ReferenceOption.IsSet) + writer.WriteString("reference", forexQuote.Reference); + + if (forexQuote.SellOption.IsSet) + { + writer.WritePropertyName("sell"); + JsonSerializer.Serialize(writer, forexQuote.Sell, jsonSerializerOptions); + } + if (forexQuote.SignatureOption.IsSet) + writer.WriteString("signature", forexQuote.Signature); + + if (forexQuote.SourceOption.IsSet) + writer.WriteString("source", forexQuote.Source); + + if (forexQuote.TypeOption.IsSet) + writer.WriteString("type", forexQuote.Type); } } - } diff --git a/Adyen/Model/Checkout/FraudCheckResult.cs b/Adyen/Model/Checkout/FraudCheckResult.cs index 74901ba76..77e8213dc 100644 --- a/Adyen/Model/Checkout/FraudCheckResult.cs +++ b/Adyen/Model/Checkout/FraudCheckResult.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,60 +14,56 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// FraudCheckResult /// - [DataContract(Name = "FraudCheckResult")] - public partial class FraudCheckResult : IEquatable, IValidatableObject + public partial class FraudCheckResult : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected FraudCheckResult() { } - /// - /// Initializes a new instance of the class. - /// - /// The fraud score generated by the risk check. (required). - /// The ID of the risk check. (required). - /// The name of the risk check. (required). - public FraudCheckResult(int? accountScore = default(int?), int? checkId = default(int?), string name = default(string)) + /// The fraud score generated by the risk check. + /// The ID of the risk check. + /// The name of the risk check. + [JsonConstructor] + public FraudCheckResult(int accountScore, int checkId, string name) { - this.AccountScore = accountScore; - this.CheckId = checkId; - this.Name = name; + AccountScore = accountScore; + CheckId = checkId; + Name = name; + OnCreated(); } + partial void OnCreated(); + /// /// The fraud score generated by the risk check. /// /// The fraud score generated by the risk check. - [DataMember(Name = "accountScore", IsRequired = false, EmitDefaultValue = false)] - public int? AccountScore { get; set; } + [JsonPropertyName("accountScore")] + public int AccountScore { get; set; } /// /// The ID of the risk check. /// /// The ID of the risk check. - [DataMember(Name = "checkId", IsRequired = false, EmitDefaultValue = false)] - public int? CheckId { get; set; } + [JsonPropertyName("checkId")] + public int CheckId { get; set; } /// /// The name of the risk check. /// /// The name of the risk check. - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("name")] public string Name { get; set; } /// @@ -87,78 +82,127 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class FraudCheckResultJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override FraudCheckResult Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as FraudCheckResult); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if FraudCheckResult instances are equal - /// - /// Instance of FraudCheckResult to be compared - /// Boolean - public bool Equals(FraudCheckResult input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option accountScore = default; + Option checkId = default; + Option name = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "accountScore": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + accountScore = new Option(utf8JsonReader.GetInt32()); + break; + case "checkId": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + checkId = new Option(utf8JsonReader.GetInt32()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AccountScore == input.AccountScore || - this.AccountScore.Equals(input.AccountScore) - ) && - ( - this.CheckId == input.CheckId || - this.CheckId.Equals(input.CheckId) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ); + + if (!accountScore.IsSet) + throw new ArgumentException("Property is required for class FraudCheckResult.", nameof(accountScore)); + + if (!checkId.IsSet) + throw new ArgumentException("Property is required for class FraudCheckResult.", nameof(checkId)); + + if (!name.IsSet) + throw new ArgumentException("Property is required for class FraudCheckResult.", nameof(name)); + + if (accountScore.IsSet && accountScore.Value == null) + throw new ArgumentNullException(nameof(accountScore), "Property is not nullable for class FraudCheckResult."); + + if (checkId.IsSet && checkId.Value == null) + throw new ArgumentNullException(nameof(checkId), "Property is not nullable for class FraudCheckResult."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class FraudCheckResult."); + + return new FraudCheckResult(accountScore.Value.Value, checkId.Value.Value, name.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FraudCheckResult fraudCheckResult, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.AccountScore.GetHashCode(); - hashCode = (hashCode * 59) + this.CheckId.GetHashCode(); - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, fraudCheckResult, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, FraudCheckResult fraudCheckResult, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (fraudCheckResult.Name == null) + throw new ArgumentNullException(nameof(fraudCheckResult.Name), "Property is required for class FraudCheckResult."); + + writer.WriteNumber("accountScore", fraudCheckResult.AccountScore); + + writer.WriteNumber("checkId", fraudCheckResult.CheckId); + + writer.WriteString("name", fraudCheckResult.Name); } } - } diff --git a/Adyen/Model/Checkout/FraudResult.cs b/Adyen/Model/Checkout/FraudResult.cs index bc85adb54..54ebe6f08 100644 --- a/Adyen/Model/Checkout/FraudResult.cs +++ b/Adyen/Model/Checkout/FraudResult.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,52 +14,55 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// FraudResult /// - [DataContract(Name = "FraudResult")] - public partial class FraudResult : IEquatable, IValidatableObject + public partial class FraudResult : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected FraudResult() { } - /// - /// Initializes a new instance of the class. - /// - /// The total fraud score generated by the risk checks. (required). - /// The result of the individual risk checks.. - public FraudResult(int? accountScore = default(int?), List results = default(List)) + /// The total fraud score generated by the risk checks. + /// The result of the individual risk checks. + [JsonConstructor] + public FraudResult(int accountScore, Option> results = default) { - this.AccountScore = accountScore; - this.Results = results; + AccountScore = accountScore; + ResultsOption = results; + OnCreated(); } + partial void OnCreated(); + /// /// The total fraud score generated by the risk checks. /// /// The total fraud score generated by the risk checks. - [DataMember(Name = "accountScore", IsRequired = false, EmitDefaultValue = false)] - public int? AccountScore { get; set; } + [JsonPropertyName("accountScore")] + public int AccountScore { get; set; } + + /// + /// Used to track the state of Results + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> ResultsOption { get; private set; } /// /// The result of the individual risk checks. /// /// The result of the individual risk checks. - [DataMember(Name = "results", EmitDefaultValue = false)] - public List Results { get; set; } + [JsonPropertyName("results")] + public List Results { get { return this.ResultsOption; } set { this.ResultsOption = new Option>(value); } } /// /// Returns the string presentation of the object @@ -77,74 +79,116 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class FraudResultJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override FraudResult Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as FraudResult); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if FraudResult instances are equal - /// - /// Instance of FraudResult to be compared - /// Boolean - public bool Equals(FraudResult input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option accountScore = default; + Option> results = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "accountScore": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + accountScore = new Option(utf8JsonReader.GetInt32()); + break; + case "results": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + results = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.AccountScore == input.AccountScore || - this.AccountScore.Equals(input.AccountScore) - ) && - ( - this.Results == input.Results || - this.Results != null && - input.Results != null && - this.Results.SequenceEqual(input.Results) - ); + + if (!accountScore.IsSet) + throw new ArgumentException("Property is required for class FraudResult.", nameof(accountScore)); + + if (accountScore.IsSet && accountScore.Value == null) + throw new ArgumentNullException(nameof(accountScore), "Property is not nullable for class FraudResult."); + + if (results.IsSet && results.Value == null) + throw new ArgumentNullException(nameof(results), "Property is not nullable for class FraudResult."); + + return new FraudResult(accountScore.Value.Value, results); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FraudResult fraudResult, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.AccountScore.GetHashCode(); - if (this.Results != null) - { - hashCode = (hashCode * 59) + this.Results.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, fraudResult, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, FraudResult fraudResult, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (fraudResult.ResultsOption.IsSet && fraudResult.Results == null) + throw new ArgumentNullException(nameof(fraudResult.Results), "Property is required for class FraudResult."); + + writer.WriteNumber("accountScore", fraudResult.AccountScore); + + if (fraudResult.ResultsOption.IsSet) + { + writer.WritePropertyName("results"); + JsonSerializer.Serialize(writer, fraudResult.Results, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/FundOrigin.cs b/Adyen/Model/Checkout/FundOrigin.cs index a21b41e7b..0e4893205 100644 --- a/Adyen/Model/Checkout/FundOrigin.cs +++ b/Adyen/Model/Checkout/FundOrigin.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,72 +14,108 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// FundOrigin /// - [DataContract(Name = "FundOrigin")] - public partial class FundOrigin : IEquatable, IValidatableObject + public partial class FundOrigin : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// billingAddress. - /// The email address of the person funding the money.. - /// shopperName. - /// The phone number of the person funding the money.. - /// The unique identifier of the wallet where the funds are coming from.. - public FundOrigin(Address billingAddress = default(Address), string shopperEmail = default(string), Name shopperName = default(Name), string telephoneNumber = default(string), string walletIdentifier = default(string)) + /// billingAddress + /// The email address of the person funding the money. + /// shopperName + /// The phone number of the person funding the money. + /// The unique identifier of the wallet where the funds are coming from. + [JsonConstructor] + public FundOrigin(Option
billingAddress = default, Option shopperEmail = default, Option shopperName = default, Option telephoneNumber = default, Option walletIdentifier = default) { - this.BillingAddress = billingAddress; - this.ShopperEmail = shopperEmail; - this.ShopperName = shopperName; - this.TelephoneNumber = telephoneNumber; - this.WalletIdentifier = walletIdentifier; + BillingAddressOption = billingAddress; + ShopperEmailOption = shopperEmail; + ShopperNameOption = shopperName; + TelephoneNumberOption = telephoneNumber; + WalletIdentifierOption = walletIdentifier; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of BillingAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option
BillingAddressOption { get; private set; } + /// /// Gets or Sets BillingAddress /// - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public Address BillingAddress { get; set; } + [JsonPropertyName("billingAddress")] + public Address BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option
(value); } } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The email address of the person funding the money. /// /// The email address of the person funding the money. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of ShopperName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNameOption { get; private set; } /// /// Gets or Sets ShopperName /// - [DataMember(Name = "shopperName", EmitDefaultValue = false)] - public Name ShopperName { get; set; } + [JsonPropertyName("shopperName")] + public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } + + /// + /// Used to track the state of TelephoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TelephoneNumberOption { get; private set; } /// /// The phone number of the person funding the money. /// /// The phone number of the person funding the money. - [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] - public string TelephoneNumber { get; set; } + [JsonPropertyName("telephoneNumber")] + public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of WalletIdentifier + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option WalletIdentifierOption { get; private set; } /// /// The unique identifier of the wallet where the funds are coming from. /// /// The unique identifier of the wallet where the funds are coming from. - [DataMember(Name = "walletIdentifier", EmitDefaultValue = false)] - public string WalletIdentifier { get; set; } + [JsonPropertyName("walletIdentifier")] + public string WalletIdentifier { get { return this.WalletIdentifierOption; } set { this.WalletIdentifierOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -100,104 +135,157 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class FundOriginJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override FundOrigin Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as FundOrigin); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if FundOrigin instances are equal - /// - /// Instance of FundOrigin to be compared - /// Boolean - public bool Equals(FundOrigin input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option
billingAddress = default; + Option shopperEmail = default; + Option shopperName = default; + Option telephoneNumber = default; + Option walletIdentifier = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "billingAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + billingAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "shopperName": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "telephoneNumber": + telephoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "walletIdentifier": + walletIdentifier = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.ShopperName == input.ShopperName || - (this.ShopperName != null && - this.ShopperName.Equals(input.ShopperName)) - ) && - ( - this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) - ) && - ( - this.WalletIdentifier == input.WalletIdentifier || - (this.WalletIdentifier != null && - this.WalletIdentifier.Equals(input.WalletIdentifier)) - ); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class FundOrigin."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class FundOrigin."); + + if (shopperName.IsSet && shopperName.Value == null) + throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class FundOrigin."); + + if (telephoneNumber.IsSet && telephoneNumber.Value == null) + throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class FundOrigin."); + + if (walletIdentifier.IsSet && walletIdentifier.Value == null) + throw new ArgumentNullException(nameof(walletIdentifier), "Property is not nullable for class FundOrigin."); + + return new FundOrigin(billingAddress, shopperEmail, shopperName, telephoneNumber, walletIdentifier); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FundOrigin fundOrigin, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.ShopperName != null) - { - hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); - } - if (this.TelephoneNumber != null) - { - hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); - } - if (this.WalletIdentifier != null) - { - hashCode = (hashCode * 59) + this.WalletIdentifier.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, fundOrigin, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, FundOrigin fundOrigin, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (fundOrigin.BillingAddressOption.IsSet && fundOrigin.BillingAddress == null) + throw new ArgumentNullException(nameof(fundOrigin.BillingAddress), "Property is required for class FundOrigin."); + + if (fundOrigin.ShopperEmailOption.IsSet && fundOrigin.ShopperEmail == null) + throw new ArgumentNullException(nameof(fundOrigin.ShopperEmail), "Property is required for class FundOrigin."); + + if (fundOrigin.ShopperNameOption.IsSet && fundOrigin.ShopperName == null) + throw new ArgumentNullException(nameof(fundOrigin.ShopperName), "Property is required for class FundOrigin."); + + if (fundOrigin.TelephoneNumberOption.IsSet && fundOrigin.TelephoneNumber == null) + throw new ArgumentNullException(nameof(fundOrigin.TelephoneNumber), "Property is required for class FundOrigin."); + + if (fundOrigin.WalletIdentifierOption.IsSet && fundOrigin.WalletIdentifier == null) + throw new ArgumentNullException(nameof(fundOrigin.WalletIdentifier), "Property is required for class FundOrigin."); + + if (fundOrigin.BillingAddressOption.IsSet) + { + writer.WritePropertyName("billingAddress"); + JsonSerializer.Serialize(writer, fundOrigin.BillingAddress, jsonSerializerOptions); + } + if (fundOrigin.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", fundOrigin.ShopperEmail); + + if (fundOrigin.ShopperNameOption.IsSet) + { + writer.WritePropertyName("shopperName"); + JsonSerializer.Serialize(writer, fundOrigin.ShopperName, jsonSerializerOptions); + } + if (fundOrigin.TelephoneNumberOption.IsSet) + writer.WriteString("telephoneNumber", fundOrigin.TelephoneNumber); + + if (fundOrigin.WalletIdentifierOption.IsSet) + writer.WriteString("walletIdentifier", fundOrigin.WalletIdentifier); } } - } diff --git a/Adyen/Model/Checkout/FundRecipient.cs b/Adyen/Model/Checkout/FundRecipient.cs index eb14fa2e7..2d3ab0ed0 100644 --- a/Adyen/Model/Checkout/FundRecipient.cs +++ b/Adyen/Model/Checkout/FundRecipient.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,172 +14,327 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// FundRecipient /// - [DataContract(Name = "FundRecipient")] - public partial class FundRecipient : IEquatable, IValidatableObject + public partial class FundRecipient : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The IBAN of the bank account where the funds are being transferred to. + /// billingAddress + /// paymentMethod + /// The email address of the shopper. + /// shopperName + /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// subMerchant + /// The telephone number of the shopper. + /// The unique identifier for the wallet the funds are being transferred to. You can use the shopper reference or any other identifier. + /// The tax identifier of the person receiving the funds. + /// The purpose of a digital wallet transaction. + [JsonConstructor] + public FundRecipient(Option iBAN = default, Option
billingAddress = default, Option paymentMethod = default, Option shopperEmail = default, Option shopperName = default, Option shopperReference = default, Option storedPaymentMethodId = default, Option subMerchant = default, Option telephoneNumber = default, Option walletIdentifier = default, Option walletOwnerTaxId = default, Option walletPurpose = default) + { + IBANOption = iBAN; + BillingAddressOption = billingAddress; + PaymentMethodOption = paymentMethod; + ShopperEmailOption = shopperEmail; + ShopperNameOption = shopperName; + ShopperReferenceOption = shopperReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + SubMerchantOption = subMerchant; + TelephoneNumberOption = telephoneNumber; + WalletIdentifierOption = walletIdentifier; + WalletOwnerTaxIdOption = walletOwnerTaxId; + WalletPurposeOption = walletPurpose; + OnCreated(); + } + + partial void OnCreated(); + /// /// The purpose of a digital wallet transaction. /// /// The purpose of a digital wallet transaction. - [JsonConverter(typeof(StringEnumConverter))] public enum WalletPurposeEnum { /// /// Enum IdentifiedBoleto for value: identifiedBoleto /// - [EnumMember(Value = "identifiedBoleto")] IdentifiedBoleto = 1, /// /// Enum TransferDifferentWallet for value: transferDifferentWallet /// - [EnumMember(Value = "transferDifferentWallet")] TransferDifferentWallet = 2, /// /// Enum TransferOwnWallet for value: transferOwnWallet /// - [EnumMember(Value = "transferOwnWallet")] TransferOwnWallet = 3, /// /// Enum TransferSameWallet for value: transferSameWallet /// - [EnumMember(Value = "transferSameWallet")] TransferSameWallet = 4, /// /// Enum UnidentifiedBoleto for value: unidentifiedBoleto /// - [EnumMember(Value = "unidentifiedBoleto")] UnidentifiedBoleto = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static WalletPurposeEnum WalletPurposeEnumFromString(string value) + { + if (value.Equals("identifiedBoleto")) + return WalletPurposeEnum.IdentifiedBoleto; + + if (value.Equals("transferDifferentWallet")) + return WalletPurposeEnum.TransferDifferentWallet; + + if (value.Equals("transferOwnWallet")) + return WalletPurposeEnum.TransferOwnWallet; + + if (value.Equals("transferSameWallet")) + return WalletPurposeEnum.TransferSameWallet; + + if (value.Equals("unidentifiedBoleto")) + return WalletPurposeEnum.UnidentifiedBoleto; + + throw new NotImplementedException($"Could not convert value to type WalletPurposeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static WalletPurposeEnum? WalletPurposeEnumFromStringOrDefault(string value) + { + if (value.Equals("identifiedBoleto")) + return WalletPurposeEnum.IdentifiedBoleto; + if (value.Equals("transferDifferentWallet")) + return WalletPurposeEnum.TransferDifferentWallet; + + if (value.Equals("transferOwnWallet")) + return WalletPurposeEnum.TransferOwnWallet; + + if (value.Equals("transferSameWallet")) + return WalletPurposeEnum.TransferSameWallet; + + if (value.Equals("unidentifiedBoleto")) + return WalletPurposeEnum.UnidentifiedBoleto; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string WalletPurposeEnumToJsonValue(WalletPurposeEnum? value) + { + if (value == WalletPurposeEnum.IdentifiedBoleto) + return "identifiedBoleto"; + + if (value == WalletPurposeEnum.TransferDifferentWallet) + return "transferDifferentWallet"; + + if (value == WalletPurposeEnum.TransferOwnWallet) + return "transferOwnWallet"; + + if (value == WalletPurposeEnum.TransferSameWallet) + return "transferSameWallet"; + + if (value == WalletPurposeEnum.UnidentifiedBoleto) + return "unidentifiedBoleto"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of WalletPurpose + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option WalletPurposeOption { get; private set; } /// /// The purpose of a digital wallet transaction. /// /// The purpose of a digital wallet transaction. - [DataMember(Name = "walletPurpose", EmitDefaultValue = false)] - public WalletPurposeEnum? WalletPurpose { get; set; } + [JsonPropertyName("walletPurpose")] + public WalletPurposeEnum? WalletPurpose { get { return this.WalletPurposeOption; } set { this.WalletPurposeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of IBAN /// - /// The IBAN of the bank account where the funds are being transferred to.. - /// billingAddress. - /// paymentMethod. - /// The email address of the shopper.. - /// shopperName. - /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// subMerchant. - /// The telephone number of the shopper.. - /// The unique identifier for the wallet the funds are being transferred to. You can use the shopper reference or any other identifier.. - /// The tax identifier of the person receiving the funds.. - /// The purpose of a digital wallet transaction.. - public FundRecipient(string iBAN = default(string), Address billingAddress = default(Address), CardDetails paymentMethod = default(CardDetails), string shopperEmail = default(string), Name shopperName = default(Name), string shopperReference = default(string), string storedPaymentMethodId = default(string), SubMerchant subMerchant = default(SubMerchant), string telephoneNumber = default(string), string walletIdentifier = default(string), string walletOwnerTaxId = default(string), WalletPurposeEnum? walletPurpose = default(WalletPurposeEnum?)) - { - this.IBAN = iBAN; - this.BillingAddress = billingAddress; - this.PaymentMethod = paymentMethod; - this.ShopperEmail = shopperEmail; - this.ShopperName = shopperName; - this.ShopperReference = shopperReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.SubMerchant = subMerchant; - this.TelephoneNumber = telephoneNumber; - this.WalletIdentifier = walletIdentifier; - this.WalletOwnerTaxId = walletOwnerTaxId; - this.WalletPurpose = walletPurpose; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IBANOption { get; private set; } /// /// The IBAN of the bank account where the funds are being transferred to. /// /// The IBAN of the bank account where the funds are being transferred to. - [DataMember(Name = "IBAN", EmitDefaultValue = false)] - public string IBAN { get; set; } + [JsonPropertyName("IBAN")] + public string IBAN { get { return this.IBANOption; } set { this.IBANOption = new Option(value); } } + + /// + /// Used to track the state of BillingAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option
BillingAddressOption { get; private set; } /// /// Gets or Sets BillingAddress /// - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public Address BillingAddress { get; set; } + [JsonPropertyName("billingAddress")] + public Address BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option
(value); } } + + /// + /// Used to track the state of PaymentMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodOption { get; private set; } /// /// Gets or Sets PaymentMethod /// - [DataMember(Name = "paymentMethod", EmitDefaultValue = false)] - public CardDetails PaymentMethod { get; set; } + [JsonPropertyName("paymentMethod")] + public CardDetails PaymentMethod { get { return this.PaymentMethodOption; } set { this.PaymentMethodOption = new Option(value); } } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The email address of the shopper. /// /// The email address of the shopper. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of ShopperName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNameOption { get; private set; } /// /// Gets or Sets ShopperName /// - [DataMember(Name = "shopperName", EmitDefaultValue = false)] - public Name ShopperName { get; set; } + [JsonPropertyName("shopperName")] + public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } + + /// + /// Used to track the state of ShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperReferenceOption { get; private set; } /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [DataMember(Name = "shopperReference", EmitDefaultValue = false)] - public string ShopperReference { get; set; } + [JsonPropertyName("shopperReference")] + public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchant + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubMerchantOption { get; private set; } /// /// Gets or Sets SubMerchant /// - [DataMember(Name = "subMerchant", EmitDefaultValue = false)] - public SubMerchant SubMerchant { get; set; } + [JsonPropertyName("subMerchant")] + public SubMerchant SubMerchant { get { return this.SubMerchantOption; } set { this.SubMerchantOption = new Option(value); } } + + /// + /// Used to track the state of TelephoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TelephoneNumberOption { get; private set; } /// /// The telephone number of the shopper. /// /// The telephone number of the shopper. - [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] - public string TelephoneNumber { get; set; } + [JsonPropertyName("telephoneNumber")] + public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of WalletIdentifier + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option WalletIdentifierOption { get; private set; } /// /// The unique identifier for the wallet the funds are being transferred to. You can use the shopper reference or any other identifier. /// /// The unique identifier for the wallet the funds are being transferred to. You can use the shopper reference or any other identifier. - [DataMember(Name = "walletIdentifier", EmitDefaultValue = false)] - public string WalletIdentifier { get; set; } + [JsonPropertyName("walletIdentifier")] + public string WalletIdentifier { get { return this.WalletIdentifierOption; } set { this.WalletIdentifierOption = new Option(value); } } + + /// + /// Used to track the state of WalletOwnerTaxId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option WalletOwnerTaxIdOption { get; private set; } /// /// The tax identifier of the person receiving the funds. /// /// The tax identifier of the person receiving the funds. - [DataMember(Name = "walletOwnerTaxId", EmitDefaultValue = false)] - public string WalletOwnerTaxId { get; set; } + [JsonPropertyName("walletOwnerTaxId")] + public string WalletOwnerTaxId { get { return this.WalletOwnerTaxIdOption; } set { this.WalletOwnerTaxIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -207,181 +361,271 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // ShopperReference (string) maxLength + if (this.ShopperReference != null && this.ShopperReference.Length > 256) + { + yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as FundRecipient); - } + // ShopperReference (string) minLength + if (this.ShopperReference != null && this.ShopperReference.Length < 3) + { + yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + } - /// - /// Returns true if FundRecipient instances are equal - /// - /// Instance of FundRecipient to be compared - /// Boolean - public bool Equals(FundRecipient input) - { - if (input == null) + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) { - return false; + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); } - return - ( - this.IBAN == input.IBAN || - (this.IBAN != null && - this.IBAN.Equals(input.IBAN)) - ) && - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.PaymentMethod == input.PaymentMethod || - (this.PaymentMethod != null && - this.PaymentMethod.Equals(input.PaymentMethod)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.ShopperName == input.ShopperName || - (this.ShopperName != null && - this.ShopperName.Equals(input.ShopperName)) - ) && - ( - this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.SubMerchant == input.SubMerchant || - (this.SubMerchant != null && - this.SubMerchant.Equals(input.SubMerchant)) - ) && - ( - this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) - ) && - ( - this.WalletIdentifier == input.WalletIdentifier || - (this.WalletIdentifier != null && - this.WalletIdentifier.Equals(input.WalletIdentifier)) - ) && - ( - this.WalletOwnerTaxId == input.WalletOwnerTaxId || - (this.WalletOwnerTaxId != null && - this.WalletOwnerTaxId.Equals(input.WalletOwnerTaxId)) - ) && - ( - this.WalletPurpose == input.WalletPurpose || - this.WalletPurpose.Equals(input.WalletPurpose) - ); + + yield break; } + } + /// + /// A Json converter for type + /// + public class FundRecipientJsonConverter : JsonConverter + { /// - /// Gets the hash code + /// Deserializes json to /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + /// + public override FundRecipient Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option iBAN = default; + Option
billingAddress = default; + Option paymentMethod = default; + Option shopperEmail = default; + Option shopperName = default; + Option shopperReference = default; + Option storedPaymentMethodId = default; + Option subMerchant = default; + Option telephoneNumber = default; + Option walletIdentifier = default; + Option walletOwnerTaxId = default; + Option walletPurpose = default; + + while (utf8JsonReader.Read()) { - int hashCode = 41; - if (this.IBAN != null) - { - hashCode = (hashCode * 59) + this.IBAN.GetHashCode(); - } - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.PaymentMethod != null) - { - hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.ShopperName != null) - { - hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); - } - if (this.ShopperReference != null) - { - hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.SubMerchant != null) - { - hashCode = (hashCode * 59) + this.SubMerchant.GetHashCode(); - } - if (this.TelephoneNumber != null) - { - hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); - } - if (this.WalletIdentifier != null) - { - hashCode = (hashCode * 59) + this.WalletIdentifier.GetHashCode(); - } - if (this.WalletOwnerTaxId != null) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - hashCode = (hashCode * 59) + this.WalletOwnerTaxId.GetHashCode(); + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "IBAN": + iBAN = new Option(utf8JsonReader.GetString()); + break; + case "billingAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + billingAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "paymentMethod": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "shopperName": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperReference": + shopperReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "subMerchant": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + subMerchant = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "telephoneNumber": + telephoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "walletIdentifier": + walletIdentifier = new Option(utf8JsonReader.GetString()); + break; + case "walletOwnerTaxId": + walletOwnerTaxId = new Option(utf8JsonReader.GetString()); + break; + case "walletPurpose": + string walletPurposeRawValue = utf8JsonReader.GetString(); + if (walletPurposeRawValue != null) + walletPurpose = new Option(FundRecipient.WalletPurposeEnumFromStringOrDefault(walletPurposeRawValue)); + break; + default: + break; + } } - hashCode = (hashCode * 59) + this.WalletPurpose.GetHashCode(); - return hashCode; } + + if (iBAN.IsSet && iBAN.Value == null) + throw new ArgumentNullException(nameof(iBAN), "Property is not nullable for class FundRecipient."); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class FundRecipient."); + + if (paymentMethod.IsSet && paymentMethod.Value == null) + throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class FundRecipient."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class FundRecipient."); + + if (shopperName.IsSet && shopperName.Value == null) + throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class FundRecipient."); + + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class FundRecipient."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class FundRecipient."); + + if (subMerchant.IsSet && subMerchant.Value == null) + throw new ArgumentNullException(nameof(subMerchant), "Property is not nullable for class FundRecipient."); + + if (telephoneNumber.IsSet && telephoneNumber.Value == null) + throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class FundRecipient."); + + if (walletIdentifier.IsSet && walletIdentifier.Value == null) + throw new ArgumentNullException(nameof(walletIdentifier), "Property is not nullable for class FundRecipient."); + + if (walletOwnerTaxId.IsSet && walletOwnerTaxId.Value == null) + throw new ArgumentNullException(nameof(walletOwnerTaxId), "Property is not nullable for class FundRecipient."); + + if (walletPurpose.IsSet && walletPurpose.Value == null) + throw new ArgumentNullException(nameof(walletPurpose), "Property is not nullable for class FundRecipient."); + + return new FundRecipient(iBAN, billingAddress, paymentMethod, shopperEmail, shopperName, shopperReference, storedPaymentMethodId, subMerchant, telephoneNumber, walletIdentifier, walletOwnerTaxId, walletPurpose); } + /// - /// To validate all properties of the instance + /// Serializes a /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FundRecipient fundRecipient, JsonSerializerOptions jsonSerializerOptions) { - // ShopperReference (string) maxLength - if (this.ShopperReference != null && this.ShopperReference.Length > 256) + writer.WriteStartObject(); + + WriteProperties(writer, fundRecipient, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, FundRecipient fundRecipient, JsonSerializerOptions jsonSerializerOptions) + { + if (fundRecipient.IBANOption.IsSet && fundRecipient.IBAN == null) + throw new ArgumentNullException(nameof(fundRecipient.IBAN), "Property is required for class FundRecipient."); + + if (fundRecipient.BillingAddressOption.IsSet && fundRecipient.BillingAddress == null) + throw new ArgumentNullException(nameof(fundRecipient.BillingAddress), "Property is required for class FundRecipient."); + + if (fundRecipient.PaymentMethodOption.IsSet && fundRecipient.PaymentMethod == null) + throw new ArgumentNullException(nameof(fundRecipient.PaymentMethod), "Property is required for class FundRecipient."); + + if (fundRecipient.ShopperEmailOption.IsSet && fundRecipient.ShopperEmail == null) + throw new ArgumentNullException(nameof(fundRecipient.ShopperEmail), "Property is required for class FundRecipient."); + + if (fundRecipient.ShopperNameOption.IsSet && fundRecipient.ShopperName == null) + throw new ArgumentNullException(nameof(fundRecipient.ShopperName), "Property is required for class FundRecipient."); + + if (fundRecipient.ShopperReferenceOption.IsSet && fundRecipient.ShopperReference == null) + throw new ArgumentNullException(nameof(fundRecipient.ShopperReference), "Property is required for class FundRecipient."); + + if (fundRecipient.StoredPaymentMethodIdOption.IsSet && fundRecipient.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(fundRecipient.StoredPaymentMethodId), "Property is required for class FundRecipient."); + + if (fundRecipient.SubMerchantOption.IsSet && fundRecipient.SubMerchant == null) + throw new ArgumentNullException(nameof(fundRecipient.SubMerchant), "Property is required for class FundRecipient."); + + if (fundRecipient.TelephoneNumberOption.IsSet && fundRecipient.TelephoneNumber == null) + throw new ArgumentNullException(nameof(fundRecipient.TelephoneNumber), "Property is required for class FundRecipient."); + + if (fundRecipient.WalletIdentifierOption.IsSet && fundRecipient.WalletIdentifier == null) + throw new ArgumentNullException(nameof(fundRecipient.WalletIdentifier), "Property is required for class FundRecipient."); + + if (fundRecipient.WalletOwnerTaxIdOption.IsSet && fundRecipient.WalletOwnerTaxId == null) + throw new ArgumentNullException(nameof(fundRecipient.WalletOwnerTaxId), "Property is required for class FundRecipient."); + + if (fundRecipient.IBANOption.IsSet) + writer.WriteString("IBAN", fundRecipient.IBAN); + + if (fundRecipient.BillingAddressOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + writer.WritePropertyName("billingAddress"); + JsonSerializer.Serialize(writer, fundRecipient.BillingAddress, jsonSerializerOptions); } + if (fundRecipient.PaymentMethodOption.IsSet) + { + writer.WritePropertyName("paymentMethod"); + JsonSerializer.Serialize(writer, fundRecipient.PaymentMethod, jsonSerializerOptions); + } + if (fundRecipient.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", fundRecipient.ShopperEmail); - // ShopperReference (string) minLength - if (this.ShopperReference != null && this.ShopperReference.Length < 3) + if (fundRecipient.ShopperNameOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + writer.WritePropertyName("shopperName"); + JsonSerializer.Serialize(writer, fundRecipient.ShopperName, jsonSerializerOptions); } + if (fundRecipient.ShopperReferenceOption.IsSet) + writer.WriteString("shopperReference", fundRecipient.ShopperReference); - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + if (fundRecipient.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", fundRecipient.StoredPaymentMethodId); + + if (fundRecipient.SubMerchantOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + writer.WritePropertyName("subMerchant"); + JsonSerializer.Serialize(writer, fundRecipient.SubMerchant, jsonSerializerOptions); } + if (fundRecipient.TelephoneNumberOption.IsSet) + writer.WriteString("telephoneNumber", fundRecipient.TelephoneNumber); - yield break; + if (fundRecipient.WalletIdentifierOption.IsSet) + writer.WriteString("walletIdentifier", fundRecipient.WalletIdentifier); + + if (fundRecipient.WalletOwnerTaxIdOption.IsSet) + writer.WriteString("walletOwnerTaxId", fundRecipient.WalletOwnerTaxId); + + var walletPurposeRawValue = FundRecipient.WalletPurposeEnumToJsonValue(fundRecipient.WalletPurposeOption.Value.Value); + writer.WriteString("walletPurpose", walletPurposeRawValue); } } - } diff --git a/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs b/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs index 1723bfce3..20d3c7e39 100644 --- a/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs +++ b/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,113 +14,192 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// GenericIssuerPaymentMethodDetails /// - [DataContract(Name = "GenericIssuerPaymentMethodDetails")] - public partial class GenericIssuerPaymentMethodDetails : IEquatable, IValidatableObject + public partial class GenericIssuerPaymentMethodDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The issuer id of the shopper's selected bank. + /// **genericissuer** + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + [JsonConstructor] + public GenericIssuerPaymentMethodDetails(string issuer, TypeEnum type, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default) + { + Issuer = issuer; + Type = type; + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + OnCreated(); + } + + partial void OnCreated(); + /// /// **genericissuer** /// /// **genericissuer** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum OnlineBankingPL for value: onlineBanking_PL /// - [EnumMember(Value = "onlineBanking_PL")] OnlineBankingPL = 1, /// /// Enum Eps for value: eps /// - [EnumMember(Value = "eps")] Eps = 2, /// /// Enum OnlineBankingSK for value: onlineBanking_SK /// - [EnumMember(Value = "onlineBanking_SK")] OnlineBankingSK = 3, /// /// Enum OnlineBankingCZ for value: onlineBanking_CZ /// - [EnumMember(Value = "onlineBanking_CZ")] OnlineBankingCZ = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("onlineBanking_PL")) + return TypeEnum.OnlineBankingPL; + + if (value.Equals("eps")) + return TypeEnum.Eps; + + if (value.Equals("onlineBanking_SK")) + return TypeEnum.OnlineBankingSK; + if (value.Equals("onlineBanking_CZ")) + return TypeEnum.OnlineBankingCZ; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("onlineBanking_PL")) + return TypeEnum.OnlineBankingPL; + + if (value.Equals("eps")) + return TypeEnum.Eps; + + if (value.Equals("onlineBanking_SK")) + return TypeEnum.OnlineBankingSK; + + if (value.Equals("onlineBanking_CZ")) + return TypeEnum.OnlineBankingCZ; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.OnlineBankingPL) + return "onlineBanking_PL"; + + if (value == TypeEnum.Eps) + return "eps"; + + if (value == TypeEnum.OnlineBankingSK) + return "onlineBanking_SK"; + + if (value == TypeEnum.OnlineBankingCZ) + return "onlineBanking_CZ"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **genericissuer** /// /// **genericissuer** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. + /// The issuer id of the shopper's selected bank. /// - [JsonConstructorAttribute] - protected GenericIssuerPaymentMethodDetails() { } + /// The issuer id of the shopper's selected bank. + [JsonPropertyName("issuer")] + public string Issuer { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The issuer id of the shopper's selected bank. (required). - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **genericissuer** (required). - public GenericIssuerPaymentMethodDetails(string checkoutAttemptId = default(string), string issuer = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = default(TypeEnum)) - { - this.Issuer = issuer; - this.Type = type; - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } /// - /// The issuer id of the shopper's selected bank. + /// Used to track the state of RecurringDetailReference /// - /// The issuer id of the shopper's selected bank. - [DataMember(Name = "issuer", IsRequired = false, EmitDefaultValue = false)] - public string Issuer { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -131,116 +209,170 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class GenericIssuerPaymentMethodDetails {\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" Issuer: ").Append(Issuer).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as GenericIssuerPaymentMethodDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class GenericIssuerPaymentMethodDetailsJsonConverter : JsonConverter + { /// - /// Returns true if GenericIssuerPaymentMethodDetails instances are equal + /// Deserializes json to /// - /// Instance of GenericIssuerPaymentMethodDetails to be compared - /// Boolean - public bool Equals(GenericIssuerPaymentMethodDetails input) + /// + /// + /// + /// + /// + public override GenericIssuerPaymentMethodDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option issuer = default; + Option type = default; + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "issuer": + issuer = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(GenericIssuerPaymentMethodDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Issuer == input.Issuer || - (this.Issuer != null && - this.Issuer.Equals(input.Issuer)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!issuer.IsSet) + throw new ArgumentException("Property is required for class GenericIssuerPaymentMethodDetails.", nameof(issuer)); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class GenericIssuerPaymentMethodDetails.", nameof(type)); + + if (issuer.IsSet && issuer.Value == null) + throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class GenericIssuerPaymentMethodDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class GenericIssuerPaymentMethodDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class GenericIssuerPaymentMethodDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class GenericIssuerPaymentMethodDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class GenericIssuerPaymentMethodDetails."); + + return new GenericIssuerPaymentMethodDetails(issuer.Value, type.Value.Value, checkoutAttemptId, recurringDetailReference, storedPaymentMethodId); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, GenericIssuerPaymentMethodDetails genericIssuerPaymentMethodDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.Issuer != null) - { - hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, genericIssuerPaymentMethodDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, GenericIssuerPaymentMethodDetails genericIssuerPaymentMethodDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (genericIssuerPaymentMethodDetails.Issuer == null) + throw new ArgumentNullException(nameof(genericIssuerPaymentMethodDetails.Issuer), "Property is required for class GenericIssuerPaymentMethodDetails."); - yield break; + if (genericIssuerPaymentMethodDetails.CheckoutAttemptIdOption.IsSet && genericIssuerPaymentMethodDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(genericIssuerPaymentMethodDetails.CheckoutAttemptId), "Property is required for class GenericIssuerPaymentMethodDetails."); + + if (genericIssuerPaymentMethodDetails.RecurringDetailReferenceOption.IsSet && genericIssuerPaymentMethodDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(genericIssuerPaymentMethodDetails.RecurringDetailReference), "Property is required for class GenericIssuerPaymentMethodDetails."); + + if (genericIssuerPaymentMethodDetails.StoredPaymentMethodIdOption.IsSet && genericIssuerPaymentMethodDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(genericIssuerPaymentMethodDetails.StoredPaymentMethodId), "Property is required for class GenericIssuerPaymentMethodDetails."); + + writer.WriteString("issuer", genericIssuerPaymentMethodDetails.Issuer); + + var typeRawValue = GenericIssuerPaymentMethodDetails.TypeEnumToJsonValue(genericIssuerPaymentMethodDetails.Type); + writer.WriteString("type", typeRawValue); + if (genericIssuerPaymentMethodDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", genericIssuerPaymentMethodDetails.CheckoutAttemptId); + + if (genericIssuerPaymentMethodDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", genericIssuerPaymentMethodDetails.RecurringDetailReference); + + if (genericIssuerPaymentMethodDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", genericIssuerPaymentMethodDetails.StoredPaymentMethodId); } } - } diff --git a/Adyen/Model/Checkout/GooglePayDetails.cs b/Adyen/Model/Checkout/GooglePayDetails.cs index ece11396a..c13bee7c2 100644 --- a/Adyen/Model/Checkout/GooglePayDetails.cs +++ b/Adyen/Model/Checkout/GooglePayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,143 +14,272 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// GooglePayDetails /// - [DataContract(Name = "GooglePayDetails")] - public partial class GooglePayDetails : IEquatable, IValidatableObject + public partial class GooglePayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + /// The checkout attempt identifier. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + /// The selected payment card network. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. + /// **googlepay**, **paywithgoogle** (default to TypeEnum.Googlepay) + [JsonConstructor] + public GooglePayDetails(string googlePayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option googlePayCardNetwork = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option threeDS2SdkVersion = default, Option type = default) + { + GooglePayToken = googlePayToken; + CheckoutAttemptIdOption = checkoutAttemptId; + FundingSourceOption = fundingSource; + GooglePayCardNetworkOption = googlePayCardNetwork; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + ThreeDS2SdkVersionOption = threeDS2SdkVersion; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// - [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// - [EnumMember(Value = "debit")] Debit = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static FundingSourceEnum FundingSourceEnumFromString(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) + { + if (value == FundingSourceEnum.Credit) + return "credit"; + + if (value == FundingSourceEnum.Debit) + return "debit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public FundingSourceEnum? FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + /// /// **googlepay**, **paywithgoogle** /// /// **googlepay**, **paywithgoogle** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Googlepay for value: googlepay /// - [EnumMember(Value = "googlepay")] Googlepay = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("googlepay")) + return TypeEnum.Googlepay; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("googlepay")) + return TypeEnum.Googlepay; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Googlepay) + return "googlepay"; + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **googlepay**, **paywithgoogle** /// /// **googlepay**, **paywithgoogle** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. /// - [JsonConstructorAttribute] - protected GooglePayDetails() { } + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + [JsonPropertyName("googlePayToken")] + public string GooglePayToken { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. - /// The selected payment card network. . - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. (required). - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK.. - /// **googlepay**, **paywithgoogle** (default to TypeEnum.Googlepay). - public GooglePayDetails(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string googlePayCardNetwork = default(string), string googlePayToken = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string threeDS2SdkVersion = default(string), TypeEnum? type = TypeEnum.Googlepay) - { - this.GooglePayToken = googlePayToken; - this.CheckoutAttemptId = checkoutAttemptId; - this.FundingSource = fundingSource; - this.GooglePayCardNetwork = googlePayCardNetwork; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.ThreeDS2SdkVersion = threeDS2SdkVersion; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of GooglePayCardNetwork + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option GooglePayCardNetworkOption { get; private set; } /// /// The selected payment card network. /// /// The selected payment card network. - [DataMember(Name = "googlePayCardNetwork", EmitDefaultValue = false)] - public string GooglePayCardNetwork { get; set; } + [JsonPropertyName("googlePayCardNetwork")] + public string GooglePayCardNetwork { get { return this.GooglePayCardNetworkOption; } set { this.GooglePayCardNetworkOption = new Option(value); } } /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + /// Used to track the state of RecurringDetailReference /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - [DataMember(Name = "googlePayToken", IsRequired = false, EmitDefaultValue = false)] - public string GooglePayToken { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2SdkVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2SdkVersionOption { get; private set; } /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - [DataMember(Name = "threeDS2SdkVersion", EmitDefaultValue = false)] - public string ThreeDS2SdkVersion { get; set; } + [JsonPropertyName("threeDS2SdkVersion")] + public string ThreeDS2SdkVersion { get { return this.ThreeDS2SdkVersionOption; } set { this.ThreeDS2SdkVersionOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -161,10 +289,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class GooglePayDetails {\n"); + sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); sb.Append(" GooglePayCardNetwork: ").Append(GooglePayCardNetwork).Append("\n"); - sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" ThreeDS2SdkVersion: ").Append(ThreeDS2SdkVersion).Append("\n"); @@ -173,142 +301,208 @@ public override string ToString() return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as GooglePayDetails); - } - - /// - /// Returns true if GooglePayDetails instances are equal - /// - /// Instance of GooglePayDetails to be compared - /// Boolean - public bool Equals(GooglePayDetails input) - { - if (input == null) - { - return false; - } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.FundingSource == input.FundingSource || - this.FundingSource.Equals(input.FundingSource) - ) && - ( - this.GooglePayCardNetwork == input.GooglePayCardNetwork || - (this.GooglePayCardNetwork != null && - this.GooglePayCardNetwork.Equals(input.GooglePayCardNetwork)) - ) && - ( - this.GooglePayToken == input.GooglePayToken || - (this.GooglePayToken != null && - this.GooglePayToken.Equals(input.GooglePayToken)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.ThreeDS2SdkVersion == input.ThreeDS2SdkVersion || - (this.ThreeDS2SdkVersion != null && - this.ThreeDS2SdkVersion.Equals(input.ThreeDS2SdkVersion)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - if (this.GooglePayCardNetwork != null) - { - hashCode = (hashCode * 59) + this.GooglePayCardNetwork.GetHashCode(); - } - if (this.GooglePayToken != null) - { - hashCode = (hashCode * 59) + this.GooglePayToken.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.ThreeDS2SdkVersion != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2SdkVersion.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // GooglePayToken (string) maxLength if (this.GooglePayToken != null && this.GooglePayToken.Length > 10000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for GooglePayToken, length must be less than 10000.", new [] { "GooglePayToken" }); + yield return new ValidationResult("Invalid value for GooglePayToken, length must be less than 10000.", new [] { "GooglePayToken" }); } // StoredPaymentMethodId (string) maxLength if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); } // ThreeDS2SdkVersion (string) maxLength if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); + yield return new ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); } yield break; } } + /// + /// A Json converter for type + /// + public class GooglePayDetailsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override GooglePayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option googlePayToken = default; + Option checkoutAttemptId = default; + Option fundingSource = default; + Option googlePayCardNetwork = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option threeDS2SdkVersion = default; + Option type = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "googlePayToken": + googlePayToken = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "fundingSource": + string fundingSourceRawValue = utf8JsonReader.GetString(); + if (fundingSourceRawValue != null) + fundingSource = new Option(GooglePayDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); + break; + case "googlePayCardNetwork": + googlePayCardNetwork = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2SdkVersion": + threeDS2SdkVersion = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(GooglePayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } + } + + if (!googlePayToken.IsSet) + throw new ArgumentException("Property is required for class GooglePayDetails.", nameof(googlePayToken)); + + if (googlePayToken.IsSet && googlePayToken.Value == null) + throw new ArgumentNullException(nameof(googlePayToken), "Property is not nullable for class GooglePayDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class GooglePayDetails."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class GooglePayDetails."); + + if (googlePayCardNetwork.IsSet && googlePayCardNetwork.Value == null) + throw new ArgumentNullException(nameof(googlePayCardNetwork), "Property is not nullable for class GooglePayDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class GooglePayDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class GooglePayDetails."); + + if (threeDS2SdkVersion.IsSet && threeDS2SdkVersion.Value == null) + throw new ArgumentNullException(nameof(threeDS2SdkVersion), "Property is not nullable for class GooglePayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class GooglePayDetails."); + + return new GooglePayDetails(googlePayToken.Value, checkoutAttemptId, fundingSource, googlePayCardNetwork, recurringDetailReference, storedPaymentMethodId, threeDS2SdkVersion, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, GooglePayDetails googlePayDetails, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, googlePayDetails, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, GooglePayDetails googlePayDetails, JsonSerializerOptions jsonSerializerOptions) + { + if (googlePayDetails.GooglePayToken == null) + throw new ArgumentNullException(nameof(googlePayDetails.GooglePayToken), "Property is required for class GooglePayDetails."); + + if (googlePayDetails.CheckoutAttemptIdOption.IsSet && googlePayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(googlePayDetails.CheckoutAttemptId), "Property is required for class GooglePayDetails."); + + if (googlePayDetails.GooglePayCardNetworkOption.IsSet && googlePayDetails.GooglePayCardNetwork == null) + throw new ArgumentNullException(nameof(googlePayDetails.GooglePayCardNetwork), "Property is required for class GooglePayDetails."); + + if (googlePayDetails.RecurringDetailReferenceOption.IsSet && googlePayDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(googlePayDetails.RecurringDetailReference), "Property is required for class GooglePayDetails."); + + if (googlePayDetails.StoredPaymentMethodIdOption.IsSet && googlePayDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(googlePayDetails.StoredPaymentMethodId), "Property is required for class GooglePayDetails."); + + if (googlePayDetails.ThreeDS2SdkVersionOption.IsSet && googlePayDetails.ThreeDS2SdkVersion == null) + throw new ArgumentNullException(nameof(googlePayDetails.ThreeDS2SdkVersion), "Property is required for class GooglePayDetails."); + + writer.WriteString("googlePayToken", googlePayDetails.GooglePayToken); + + if (googlePayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", googlePayDetails.CheckoutAttemptId); + + var fundingSourceRawValue = GooglePayDetails.FundingSourceEnumToJsonValue(googlePayDetails.FundingSourceOption.Value.Value); + writer.WriteString("fundingSource", fundingSourceRawValue); + if (googlePayDetails.GooglePayCardNetworkOption.IsSet) + writer.WriteString("googlePayCardNetwork", googlePayDetails.GooglePayCardNetwork); + + if (googlePayDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", googlePayDetails.RecurringDetailReference); + + if (googlePayDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", googlePayDetails.StoredPaymentMethodId); + + if (googlePayDetails.ThreeDS2SdkVersionOption.IsSet) + writer.WriteString("threeDS2SdkVersion", googlePayDetails.ThreeDS2SdkVersion); + + var typeRawValue = GooglePayDetails.TypeEnumToJsonValue(googlePayDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); + } + } } diff --git a/Adyen/Model/Checkout/GooglePayDonations.cs b/Adyen/Model/Checkout/GooglePayDonations.cs index 610475245..6fee1b7b7 100644 --- a/Adyen/Model/Checkout/GooglePayDonations.cs +++ b/Adyen/Model/Checkout/GooglePayDonations.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,143 +14,272 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// GooglePayDonations /// - [DataContract(Name = "GooglePayDonations")] - public partial class GooglePayDonations : IEquatable, IValidatableObject + public partial class GooglePayDonations : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + /// The checkout attempt identifier. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + /// The selected payment card network. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. + /// **googlepay**, **paywithgoogle** (default to TypeEnum.Googlepay) + [JsonConstructor] + public GooglePayDonations(string googlePayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option googlePayCardNetwork = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option threeDS2SdkVersion = default, Option type = default) + { + GooglePayToken = googlePayToken; + CheckoutAttemptIdOption = checkoutAttemptId; + FundingSourceOption = fundingSource; + GooglePayCardNetworkOption = googlePayCardNetwork; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + ThreeDS2SdkVersionOption = threeDS2SdkVersion; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// - [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// - [EnumMember(Value = "debit")] Debit = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static FundingSourceEnum FundingSourceEnumFromString(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) + { + if (value == FundingSourceEnum.Credit) + return "credit"; + + if (value == FundingSourceEnum.Debit) + return "debit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public FundingSourceEnum? FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + /// /// **googlepay**, **paywithgoogle** /// /// **googlepay**, **paywithgoogle** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Googlepay for value: googlepay /// - [EnumMember(Value = "googlepay")] Googlepay = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("googlepay")) + return TypeEnum.Googlepay; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("googlepay")) + return TypeEnum.Googlepay; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Googlepay) + return "googlepay"; + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **googlepay**, **paywithgoogle** /// /// **googlepay**, **paywithgoogle** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. /// - [JsonConstructorAttribute] - protected GooglePayDonations() { } + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + [JsonPropertyName("googlePayToken")] + public string GooglePayToken { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. - /// The selected payment card network. . - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. (required). - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK.. - /// **googlepay**, **paywithgoogle** (default to TypeEnum.Googlepay). - public GooglePayDonations(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string googlePayCardNetwork = default(string), string googlePayToken = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string threeDS2SdkVersion = default(string), TypeEnum? type = TypeEnum.Googlepay) - { - this.GooglePayToken = googlePayToken; - this.CheckoutAttemptId = checkoutAttemptId; - this.FundingSource = fundingSource; - this.GooglePayCardNetwork = googlePayCardNetwork; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.ThreeDS2SdkVersion = threeDS2SdkVersion; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of GooglePayCardNetwork + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option GooglePayCardNetworkOption { get; private set; } /// /// The selected payment card network. /// /// The selected payment card network. - [DataMember(Name = "googlePayCardNetwork", EmitDefaultValue = false)] - public string GooglePayCardNetwork { get; set; } + [JsonPropertyName("googlePayCardNetwork")] + public string GooglePayCardNetwork { get { return this.GooglePayCardNetworkOption; } set { this.GooglePayCardNetworkOption = new Option(value); } } /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + /// Used to track the state of RecurringDetailReference /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - [DataMember(Name = "googlePayToken", IsRequired = false, EmitDefaultValue = false)] - public string GooglePayToken { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2SdkVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2SdkVersionOption { get; private set; } /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - [DataMember(Name = "threeDS2SdkVersion", EmitDefaultValue = false)] - public string ThreeDS2SdkVersion { get; set; } + [JsonPropertyName("threeDS2SdkVersion")] + public string ThreeDS2SdkVersion { get { return this.ThreeDS2SdkVersionOption; } set { this.ThreeDS2SdkVersionOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -161,10 +289,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class GooglePayDonations {\n"); + sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); sb.Append(" GooglePayCardNetwork: ").Append(GooglePayCardNetwork).Append("\n"); - sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" ThreeDS2SdkVersion: ").Append(ThreeDS2SdkVersion).Append("\n"); @@ -173,142 +301,208 @@ public override string ToString() return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as GooglePayDonations); - } - - /// - /// Returns true if GooglePayDonations instances are equal - /// - /// Instance of GooglePayDonations to be compared - /// Boolean - public bool Equals(GooglePayDonations input) - { - if (input == null) - { - return false; - } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.FundingSource == input.FundingSource || - this.FundingSource.Equals(input.FundingSource) - ) && - ( - this.GooglePayCardNetwork == input.GooglePayCardNetwork || - (this.GooglePayCardNetwork != null && - this.GooglePayCardNetwork.Equals(input.GooglePayCardNetwork)) - ) && - ( - this.GooglePayToken == input.GooglePayToken || - (this.GooglePayToken != null && - this.GooglePayToken.Equals(input.GooglePayToken)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.ThreeDS2SdkVersion == input.ThreeDS2SdkVersion || - (this.ThreeDS2SdkVersion != null && - this.ThreeDS2SdkVersion.Equals(input.ThreeDS2SdkVersion)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - if (this.GooglePayCardNetwork != null) - { - hashCode = (hashCode * 59) + this.GooglePayCardNetwork.GetHashCode(); - } - if (this.GooglePayToken != null) - { - hashCode = (hashCode * 59) + this.GooglePayToken.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.ThreeDS2SdkVersion != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2SdkVersion.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // GooglePayToken (string) maxLength if (this.GooglePayToken != null && this.GooglePayToken.Length > 10000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for GooglePayToken, length must be less than 10000.", new [] { "GooglePayToken" }); + yield return new ValidationResult("Invalid value for GooglePayToken, length must be less than 10000.", new [] { "GooglePayToken" }); } // StoredPaymentMethodId (string) maxLength if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); } // ThreeDS2SdkVersion (string) maxLength if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); + yield return new ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); } yield break; } } + /// + /// A Json converter for type + /// + public class GooglePayDonationsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override GooglePayDonations Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option googlePayToken = default; + Option checkoutAttemptId = default; + Option fundingSource = default; + Option googlePayCardNetwork = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option threeDS2SdkVersion = default; + Option type = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "googlePayToken": + googlePayToken = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "fundingSource": + string fundingSourceRawValue = utf8JsonReader.GetString(); + if (fundingSourceRawValue != null) + fundingSource = new Option(GooglePayDonations.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); + break; + case "googlePayCardNetwork": + googlePayCardNetwork = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2SdkVersion": + threeDS2SdkVersion = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(GooglePayDonations.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } + } + + if (!googlePayToken.IsSet) + throw new ArgumentException("Property is required for class GooglePayDonations.", nameof(googlePayToken)); + + if (googlePayToken.IsSet && googlePayToken.Value == null) + throw new ArgumentNullException(nameof(googlePayToken), "Property is not nullable for class GooglePayDonations."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class GooglePayDonations."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class GooglePayDonations."); + + if (googlePayCardNetwork.IsSet && googlePayCardNetwork.Value == null) + throw new ArgumentNullException(nameof(googlePayCardNetwork), "Property is not nullable for class GooglePayDonations."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class GooglePayDonations."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class GooglePayDonations."); + + if (threeDS2SdkVersion.IsSet && threeDS2SdkVersion.Value == null) + throw new ArgumentNullException(nameof(threeDS2SdkVersion), "Property is not nullable for class GooglePayDonations."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class GooglePayDonations."); + + return new GooglePayDonations(googlePayToken.Value, checkoutAttemptId, fundingSource, googlePayCardNetwork, recurringDetailReference, storedPaymentMethodId, threeDS2SdkVersion, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, GooglePayDonations googlePayDonations, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, googlePayDonations, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, GooglePayDonations googlePayDonations, JsonSerializerOptions jsonSerializerOptions) + { + if (googlePayDonations.GooglePayToken == null) + throw new ArgumentNullException(nameof(googlePayDonations.GooglePayToken), "Property is required for class GooglePayDonations."); + + if (googlePayDonations.CheckoutAttemptIdOption.IsSet && googlePayDonations.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(googlePayDonations.CheckoutAttemptId), "Property is required for class GooglePayDonations."); + + if (googlePayDonations.GooglePayCardNetworkOption.IsSet && googlePayDonations.GooglePayCardNetwork == null) + throw new ArgumentNullException(nameof(googlePayDonations.GooglePayCardNetwork), "Property is required for class GooglePayDonations."); + + if (googlePayDonations.RecurringDetailReferenceOption.IsSet && googlePayDonations.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(googlePayDonations.RecurringDetailReference), "Property is required for class GooglePayDonations."); + + if (googlePayDonations.StoredPaymentMethodIdOption.IsSet && googlePayDonations.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(googlePayDonations.StoredPaymentMethodId), "Property is required for class GooglePayDonations."); + + if (googlePayDonations.ThreeDS2SdkVersionOption.IsSet && googlePayDonations.ThreeDS2SdkVersion == null) + throw new ArgumentNullException(nameof(googlePayDonations.ThreeDS2SdkVersion), "Property is required for class GooglePayDonations."); + + writer.WriteString("googlePayToken", googlePayDonations.GooglePayToken); + + if (googlePayDonations.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", googlePayDonations.CheckoutAttemptId); + + var fundingSourceRawValue = GooglePayDonations.FundingSourceEnumToJsonValue(googlePayDonations.FundingSourceOption.Value.Value); + writer.WriteString("fundingSource", fundingSourceRawValue); + if (googlePayDonations.GooglePayCardNetworkOption.IsSet) + writer.WriteString("googlePayCardNetwork", googlePayDonations.GooglePayCardNetwork); + + if (googlePayDonations.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", googlePayDonations.RecurringDetailReference); + + if (googlePayDonations.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", googlePayDonations.StoredPaymentMethodId); + + if (googlePayDonations.ThreeDS2SdkVersionOption.IsSet) + writer.WriteString("threeDS2SdkVersion", googlePayDonations.ThreeDS2SdkVersion); + + var typeRawValue = GooglePayDonations.TypeEnumToJsonValue(googlePayDonations.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); + } + } } diff --git a/Adyen/Model/Checkout/IdealDetails.cs b/Adyen/Model/Checkout/IdealDetails.cs index 5468a7ffd..84d1963c2 100644 --- a/Adyen/Model/Checkout/IdealDetails.cs +++ b/Adyen/Model/Checkout/IdealDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,90 +14,164 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// IdealDetails /// - [DataContract(Name = "IdealDetails")] - public partial class IdealDetails : IEquatable, IValidatableObject + public partial class IdealDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **ideal** (default to TypeEnum.Ideal) + [JsonConstructor] + public IdealDetails(Option checkoutAttemptId = default, Option issuer = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + IssuerOption = issuer; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **ideal** /// /// **ideal** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Ideal for value: ideal /// - [EnumMember(Value = "ideal")] Ideal = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("ideal")) + return TypeEnum.Ideal; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("ideal")) + return TypeEnum.Ideal; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Ideal) + return "ideal"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **ideal** /// /// **ideal** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **ideal** (default to TypeEnum.Ideal). - public IdealDetails(string checkoutAttemptId = default(string), string issuer = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Ideal) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.Issuer = issuer; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of Issuer + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IssuerOption { get; private set; } /// /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. /// /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. - [DataMember(Name = "issuer", EmitDefaultValue = false)] - public string Issuer { get; set; } + [JsonPropertyName("issuer")] + public string Issuer { get { return this.IssuerOption; } set { this.IssuerOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -118,106 +191,156 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as IdealDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class IdealDetailsJsonConverter : JsonConverter + { /// - /// Returns true if IdealDetails instances are equal + /// Deserializes json to /// - /// Instance of IdealDetails to be compared - /// Boolean - public bool Equals(IdealDetails input) + /// + /// + /// + /// + /// + public override IdealDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option issuer = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "issuer": + issuer = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(IdealDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Issuer == input.Issuer || - (this.Issuer != null && - this.Issuer.Equals(input.Issuer)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class IdealDetails."); + + if (issuer.IsSet && issuer.Value == null) + throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class IdealDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class IdealDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class IdealDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class IdealDetails."); + + return new IdealDetails(checkoutAttemptId, issuer, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, IdealDetails idealDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.Issuer != null) - { - hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, idealDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, IdealDetails idealDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (idealDetails.CheckoutAttemptIdOption.IsSet && idealDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(idealDetails.CheckoutAttemptId), "Property is required for class IdealDetails."); - yield break; + if (idealDetails.IssuerOption.IsSet && idealDetails.Issuer == null) + throw new ArgumentNullException(nameof(idealDetails.Issuer), "Property is required for class IdealDetails."); + + if (idealDetails.RecurringDetailReferenceOption.IsSet && idealDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(idealDetails.RecurringDetailReference), "Property is required for class IdealDetails."); + + if (idealDetails.StoredPaymentMethodIdOption.IsSet && idealDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(idealDetails.StoredPaymentMethodId), "Property is required for class IdealDetails."); + + if (idealDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", idealDetails.CheckoutAttemptId); + + if (idealDetails.IssuerOption.IsSet) + writer.WriteString("issuer", idealDetails.Issuer); + + if (idealDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", idealDetails.RecurringDetailReference); + + if (idealDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", idealDetails.StoredPaymentMethodId); + + var typeRawValue = IdealDetails.TypeEnumToJsonValue(idealDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/IdealDonations.cs b/Adyen/Model/Checkout/IdealDonations.cs index 421a40fa4..3b78c20bb 100644 --- a/Adyen/Model/Checkout/IdealDonations.cs +++ b/Adyen/Model/Checkout/IdealDonations.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,90 +14,164 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// IdealDonations /// - [DataContract(Name = "IdealDonations")] - public partial class IdealDonations : IEquatable, IValidatableObject + public partial class IdealDonations : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **ideal** (default to TypeEnum.Ideal) + [JsonConstructor] + public IdealDonations(Option checkoutAttemptId = default, Option issuer = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + IssuerOption = issuer; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **ideal** /// /// **ideal** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Ideal for value: ideal /// - [EnumMember(Value = "ideal")] Ideal = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("ideal")) + return TypeEnum.Ideal; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("ideal")) + return TypeEnum.Ideal; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Ideal) + return "ideal"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **ideal** /// /// **ideal** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **ideal** (default to TypeEnum.Ideal). - public IdealDonations(string checkoutAttemptId = default(string), string issuer = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Ideal) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.Issuer = issuer; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of Issuer + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IssuerOption { get; private set; } /// /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. /// /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. - [DataMember(Name = "issuer", EmitDefaultValue = false)] - public string Issuer { get; set; } + [JsonPropertyName("issuer")] + public string Issuer { get { return this.IssuerOption; } set { this.IssuerOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -118,106 +191,156 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as IdealDonations); + yield break; } + } + /// + /// A Json converter for type + /// + public class IdealDonationsJsonConverter : JsonConverter + { /// - /// Returns true if IdealDonations instances are equal + /// Deserializes json to /// - /// Instance of IdealDonations to be compared - /// Boolean - public bool Equals(IdealDonations input) + /// + /// + /// + /// + /// + public override IdealDonations Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option issuer = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "issuer": + issuer = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(IdealDonations.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Issuer == input.Issuer || - (this.Issuer != null && - this.Issuer.Equals(input.Issuer)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class IdealDonations."); + + if (issuer.IsSet && issuer.Value == null) + throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class IdealDonations."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class IdealDonations."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class IdealDonations."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class IdealDonations."); + + return new IdealDonations(checkoutAttemptId, issuer, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, IdealDonations idealDonations, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.Issuer != null) - { - hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, idealDonations, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, IdealDonations idealDonations, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (idealDonations.CheckoutAttemptIdOption.IsSet && idealDonations.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(idealDonations.CheckoutAttemptId), "Property is required for class IdealDonations."); - yield break; + if (idealDonations.IssuerOption.IsSet && idealDonations.Issuer == null) + throw new ArgumentNullException(nameof(idealDonations.Issuer), "Property is required for class IdealDonations."); + + if (idealDonations.RecurringDetailReferenceOption.IsSet && idealDonations.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(idealDonations.RecurringDetailReference), "Property is required for class IdealDonations."); + + if (idealDonations.StoredPaymentMethodIdOption.IsSet && idealDonations.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(idealDonations.StoredPaymentMethodId), "Property is required for class IdealDonations."); + + if (idealDonations.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", idealDonations.CheckoutAttemptId); + + if (idealDonations.IssuerOption.IsSet) + writer.WriteString("issuer", idealDonations.Issuer); + + if (idealDonations.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", idealDonations.RecurringDetailReference); + + if (idealDonations.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", idealDonations.StoredPaymentMethodId); + + var typeRawValue = IdealDonations.TypeEnumToJsonValue(idealDonations.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/InputDetail.cs b/Adyen/Model/Checkout/InputDetail.cs index 5d3c25f0a..8c27d77b9 100644 --- a/Adyen/Model/Checkout/InputDetail.cs +++ b/Adyen/Model/Checkout/InputDetail.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,111 +14,175 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// InputDetail /// - [DataContract(Name = "InputDetail")] - public partial class InputDetail : IEquatable, IValidatableObject + public partial class InputDetail : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Configuration parameters for the required input.. - /// Input details can also be provided recursively.. - /// Input details can also be provided recursively (deprecated).. - /// In case of a select, the URL from which to query the items.. - /// In case of a select, the items to choose from.. - /// The value to provide in the result.. - /// True if this input value is optional.. - /// The type of the required input.. - /// The value can be pre-filled, if available.. - public InputDetail(Dictionary configuration = default(Dictionary), List details = default(List), List inputDetails = default(List), string itemSearchUrl = default(string), List items = default(List), string key = default(string), bool? optional = default(bool?), string type = default(string), string value = default(string)) + /// Configuration parameters for the required input. + /// Input details can also be provided recursively. + /// Input details can also be provided recursively (deprecated). + /// In case of a select, the URL from which to query the items. + /// In case of a select, the items to choose from. + /// The value to provide in the result. + /// True if this input value is optional. + /// The type of the required input. + /// The value can be pre-filled, if available. + [JsonConstructor] + public InputDetail(Option> varConfiguration = default, Option> details = default, Option> inputDetails = default, Option itemSearchUrl = default, Option> items = default, Option key = default, Option optional = default, Option type = default, Option value = default) { - this._Configuration = configuration; - this.Details = details; - this.InputDetails = inputDetails; - this.ItemSearchUrl = itemSearchUrl; - this.Items = items; - this.Key = key; - this.Optional = optional; - this.Type = type; - this.Value = value; + VarConfigurationOption = varConfiguration; + DetailsOption = details; + InputDetailsOption = inputDetails; + ItemSearchUrlOption = itemSearchUrl; + ItemsOption = items; + KeyOption = key; + OptionalOption = optional; + TypeOption = type; + ValueOption = value; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of VarConfiguration + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> VarConfigurationOption { get; private set; } + /// /// Configuration parameters for the required input. /// /// Configuration parameters for the required input. - [DataMember(Name = "configuration", EmitDefaultValue = false)] - public Dictionary _Configuration { get; set; } + [JsonPropertyName("configuration")] + public Dictionary VarConfiguration { get { return this.VarConfigurationOption; } set { this.VarConfigurationOption = new Option>(value); } } + + /// + /// Used to track the state of Details + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> DetailsOption { get; private set; } /// /// Input details can also be provided recursively. /// /// Input details can also be provided recursively. - [DataMember(Name = "details", EmitDefaultValue = false)] - public List Details { get; set; } + [JsonPropertyName("details")] + public List Details { get { return this.DetailsOption; } set { this.DetailsOption = new Option>(value); } } + + /// + /// Used to track the state of InputDetails + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> InputDetailsOption { get; private set; } /// /// Input details can also be provided recursively (deprecated). /// /// Input details can also be provided recursively (deprecated). - [DataMember(Name = "inputDetails", EmitDefaultValue = false)] - [Obsolete("")] - public List InputDetails { get; set; } + [JsonPropertyName("inputDetails")] + [Obsolete] + public List InputDetails { get { return this.InputDetailsOption; } set { this.InputDetailsOption = new Option>(value); } } + + /// + /// Used to track the state of ItemSearchUrl + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ItemSearchUrlOption { get; private set; } /// /// In case of a select, the URL from which to query the items. /// /// In case of a select, the URL from which to query the items. - [DataMember(Name = "itemSearchUrl", EmitDefaultValue = false)] - public string ItemSearchUrl { get; set; } + [JsonPropertyName("itemSearchUrl")] + public string ItemSearchUrl { get { return this.ItemSearchUrlOption; } set { this.ItemSearchUrlOption = new Option(value); } } + + /// + /// Used to track the state of Items + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> ItemsOption { get; private set; } /// /// In case of a select, the items to choose from. /// /// In case of a select, the items to choose from. - [DataMember(Name = "items", EmitDefaultValue = false)] - public List Items { get; set; } + [JsonPropertyName("items")] + public List Items { get { return this.ItemsOption; } set { this.ItemsOption = new Option>(value); } } + + /// + /// Used to track the state of Key + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option KeyOption { get; private set; } /// /// The value to provide in the result. /// /// The value to provide in the result. - [DataMember(Name = "key", EmitDefaultValue = false)] - public string Key { get; set; } + [JsonPropertyName("key")] + public string Key { get { return this.KeyOption; } set { this.KeyOption = new Option(value); } } + + /// + /// Used to track the state of Optional + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OptionalOption { get; private set; } /// /// True if this input value is optional. /// /// True if this input value is optional. - [DataMember(Name = "optional", EmitDefaultValue = false)] - public bool? Optional { get; set; } + [JsonPropertyName("optional")] + public bool? Optional { get { return this.OptionalOption; } set { this.OptionalOption = new Option(value); } } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The type of the required input. /// /// The type of the required input. - [DataMember(Name = "type", EmitDefaultValue = false)] - public string Type { get; set; } + [JsonPropertyName("type")] + public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + + /// + /// Used to track the state of Value + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ValueOption { get; private set; } /// /// The value can be pre-filled, if available. /// /// The value can be pre-filled, if available. - [DataMember(Name = "value", EmitDefaultValue = false)] - public string Value { get; set; } + [JsonPropertyName("value")] + public string Value { get { return this.ValueOption; } set { this.ValueOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -129,7 +192,7 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class InputDetail {\n"); - sb.Append(" _Configuration: ").Append(_Configuration).Append("\n"); + sb.Append(" VarConfiguration: ").Append(VarConfiguration).Append("\n"); sb.Append(" Details: ").Append(Details).Append("\n"); sb.Append(" InputDetails: ").Append(InputDetails).Append("\n"); sb.Append(" ItemSearchUrl: ").Append(ItemSearchUrl).Append("\n"); @@ -143,140 +206,213 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class InputDetailJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override InputDetail Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as InputDetail); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if InputDetail instances are equal - /// - /// Instance of InputDetail to be compared - /// Boolean - public bool Equals(InputDetail input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option> varConfiguration = default; + Option> details = default; + Option> inputDetails = default; + Option itemSearchUrl = default; + Option> items = default; + Option key = default; + Option optional = default; + Option type = default; + Option value = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "configuration": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varConfiguration = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "details": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + details = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "inputDetails": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + inputDetails = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "itemSearchUrl": + itemSearchUrl = new Option(utf8JsonReader.GetString()); + break; + case "items": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + items = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "key": + key = new Option(utf8JsonReader.GetString()); + break; + case "optional": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + optional = new Option(utf8JsonReader.GetBoolean()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + case "value": + value = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this._Configuration == input._Configuration || - this._Configuration != null && - input._Configuration != null && - this._Configuration.SequenceEqual(input._Configuration) - ) && - ( - this.Details == input.Details || - this.Details != null && - input.Details != null && - this.Details.SequenceEqual(input.Details) - ) && - ( - this.InputDetails == input.InputDetails || - this.InputDetails != null && - input.InputDetails != null && - this.InputDetails.SequenceEqual(input.InputDetails) - ) && - ( - this.ItemSearchUrl == input.ItemSearchUrl || - (this.ItemSearchUrl != null && - this.ItemSearchUrl.Equals(input.ItemSearchUrl)) - ) && - ( - this.Items == input.Items || - this.Items != null && - input.Items != null && - this.Items.SequenceEqual(input.Items) - ) && - ( - this.Key == input.Key || - (this.Key != null && - this.Key.Equals(input.Key)) - ) && - ( - this.Optional == input.Optional || - this.Optional.Equals(input.Optional) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ) && - ( - this.Value == input.Value || - (this.Value != null && - this.Value.Equals(input.Value)) - ); + + if (varConfiguration.IsSet && varConfiguration.Value == null) + throw new ArgumentNullException(nameof(varConfiguration), "Property is not nullable for class InputDetail."); + + if (details.IsSet && details.Value == null) + throw new ArgumentNullException(nameof(details), "Property is not nullable for class InputDetail."); + + if (inputDetails.IsSet && inputDetails.Value == null) + throw new ArgumentNullException(nameof(inputDetails), "Property is not nullable for class InputDetail."); + + if (itemSearchUrl.IsSet && itemSearchUrl.Value == null) + throw new ArgumentNullException(nameof(itemSearchUrl), "Property is not nullable for class InputDetail."); + + if (items.IsSet && items.Value == null) + throw new ArgumentNullException(nameof(items), "Property is not nullable for class InputDetail."); + + if (key.IsSet && key.Value == null) + throw new ArgumentNullException(nameof(key), "Property is not nullable for class InputDetail."); + + if (optional.IsSet && optional.Value == null) + throw new ArgumentNullException(nameof(optional), "Property is not nullable for class InputDetail."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class InputDetail."); + + if (value.IsSet && value.Value == null) + throw new ArgumentNullException(nameof(value), "Property is not nullable for class InputDetail."); + + return new InputDetail(varConfiguration, details, inputDetails, itemSearchUrl, items, key, optional, type, value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, InputDetail inputDetail, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this._Configuration != null) - { - hashCode = (hashCode * 59) + this._Configuration.GetHashCode(); - } - if (this.Details != null) - { - hashCode = (hashCode * 59) + this.Details.GetHashCode(); - } - if (this.InputDetails != null) - { - hashCode = (hashCode * 59) + this.InputDetails.GetHashCode(); - } - if (this.ItemSearchUrl != null) - { - hashCode = (hashCode * 59) + this.ItemSearchUrl.GetHashCode(); - } - if (this.Items != null) - { - hashCode = (hashCode * 59) + this.Items.GetHashCode(); - } - if (this.Key != null) - { - hashCode = (hashCode * 59) + this.Key.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Optional.GetHashCode(); - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - if (this.Value != null) - { - hashCode = (hashCode * 59) + this.Value.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, inputDetail, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, InputDetail inputDetail, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (inputDetail.VarConfigurationOption.IsSet && inputDetail.VarConfiguration == null) + throw new ArgumentNullException(nameof(inputDetail.VarConfiguration), "Property is required for class InputDetail."); + + if (inputDetail.DetailsOption.IsSet && inputDetail.Details == null) + throw new ArgumentNullException(nameof(inputDetail.Details), "Property is required for class InputDetail."); + + if (inputDetail.InputDetailsOption.IsSet && inputDetail.InputDetails == null) + throw new ArgumentNullException(nameof(inputDetail.InputDetails), "Property is required for class InputDetail."); + + if (inputDetail.ItemSearchUrlOption.IsSet && inputDetail.ItemSearchUrl == null) + throw new ArgumentNullException(nameof(inputDetail.ItemSearchUrl), "Property is required for class InputDetail."); + + if (inputDetail.ItemsOption.IsSet && inputDetail.Items == null) + throw new ArgumentNullException(nameof(inputDetail.Items), "Property is required for class InputDetail."); + + if (inputDetail.KeyOption.IsSet && inputDetail.Key == null) + throw new ArgumentNullException(nameof(inputDetail.Key), "Property is required for class InputDetail."); + + if (inputDetail.TypeOption.IsSet && inputDetail.Type == null) + throw new ArgumentNullException(nameof(inputDetail.Type), "Property is required for class InputDetail."); + + if (inputDetail.ValueOption.IsSet && inputDetail.Value == null) + throw new ArgumentNullException(nameof(inputDetail.Value), "Property is required for class InputDetail."); + + if (inputDetail.VarConfigurationOption.IsSet) + { + writer.WritePropertyName("configuration"); + JsonSerializer.Serialize(writer, inputDetail.VarConfiguration, jsonSerializerOptions); + } + if (inputDetail.DetailsOption.IsSet) + { + writer.WritePropertyName("details"); + JsonSerializer.Serialize(writer, inputDetail.Details, jsonSerializerOptions); + } + if (inputDetail.InputDetailsOption.IsSet) + { + writer.WritePropertyName("inputDetails"); + JsonSerializer.Serialize(writer, inputDetail.InputDetails, jsonSerializerOptions); + } + if (inputDetail.ItemSearchUrlOption.IsSet) + writer.WriteString("itemSearchUrl", inputDetail.ItemSearchUrl); + + if (inputDetail.ItemsOption.IsSet) + { + writer.WritePropertyName("items"); + JsonSerializer.Serialize(writer, inputDetail.Items, jsonSerializerOptions); + } + if (inputDetail.KeyOption.IsSet) + writer.WriteString("key", inputDetail.Key); + + if (inputDetail.OptionalOption.IsSet) + writer.WriteBoolean("optional", inputDetail.OptionalOption.Value.Value); + + if (inputDetail.TypeOption.IsSet) + writer.WriteString("type", inputDetail.Type); + + if (inputDetail.ValueOption.IsSet) + writer.WriteString("value", inputDetail.Value); } } - } diff --git a/Adyen/Model/Checkout/InstallmentOption.cs b/Adyen/Model/Checkout/InstallmentOption.cs index e3fbf4b0b..e4c8d8f7e 100644 --- a/Adyen/Model/Checkout/InstallmentOption.cs +++ b/Adyen/Model/Checkout/InstallmentOption.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,134 +14,272 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// InstallmentOption /// - [DataContract(Name = "InstallmentOption")] - public partial class InstallmentOption : IEquatable, IValidatableObject + public partial class InstallmentOption : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The maximum number of installments offered for this payment method. + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** + /// Preselected number of installments offered for this payment method. + /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. + [JsonConstructor] + public InstallmentOption(Option maxValue = default, Option> plans = default, Option preselectedValue = default, Option> values = default) + { + MaxValueOption = maxValue; + PlansOption = plans; + PreselectedValueOption = preselectedValue; + ValuesOption = values; + OnCreated(); + } + + partial void OnCreated(); + /// /// Defines Plans /// - [JsonConverter(typeof(StringEnumConverter))] public enum PlansEnum { /// /// Enum Bonus for value: bonus /// - [EnumMember(Value = "bonus")] Bonus = 1, /// /// Enum BuynowPaylater for value: buynow_paylater /// - [EnumMember(Value = "buynow_paylater")] BuynowPaylater = 2, /// /// Enum InteresRefundPrctg for value: interes_refund_prctg /// - [EnumMember(Value = "interes_refund_prctg")] InteresRefundPrctg = 3, /// /// Enum InterestBonus for value: interest_bonus /// - [EnumMember(Value = "interest_bonus")] InterestBonus = 4, /// /// Enum NointeresRefundPrctg for value: nointeres_refund_prctg /// - [EnumMember(Value = "nointeres_refund_prctg")] NointeresRefundPrctg = 5, /// /// Enum NointerestBonus for value: nointerest_bonus /// - [EnumMember(Value = "nointerest_bonus")] NointerestBonus = 6, /// /// Enum RefundPrctg for value: refund_prctg /// - [EnumMember(Value = "refund_prctg")] RefundPrctg = 7, /// /// Enum Regular for value: regular /// - [EnumMember(Value = "regular")] Regular = 8, /// /// Enum Revolving for value: revolving /// - [EnumMember(Value = "revolving")] Revolving = 9, /// /// Enum WithInterest for value: with_interest /// - [EnumMember(Value = "with_interest")] WithInterest = 10 - } + /// + /// Returns a + /// + /// + /// + /// + public static PlansEnum PlansEnumFromString(string value) + { + if (value.Equals("bonus")) + return PlansEnum.Bonus; + + if (value.Equals("buynow_paylater")) + return PlansEnum.BuynowPaylater; + + if (value.Equals("interes_refund_prctg")) + return PlansEnum.InteresRefundPrctg; + + if (value.Equals("interest_bonus")) + return PlansEnum.InterestBonus; + if (value.Equals("nointeres_refund_prctg")) + return PlansEnum.NointeresRefundPrctg; + + if (value.Equals("nointerest_bonus")) + return PlansEnum.NointerestBonus; + + if (value.Equals("refund_prctg")) + return PlansEnum.RefundPrctg; + + if (value.Equals("regular")) + return PlansEnum.Regular; + + if (value.Equals("revolving")) + return PlansEnum.Revolving; + + if (value.Equals("with_interest")) + return PlansEnum.WithInterest; + + throw new NotImplementedException($"Could not convert value to type PlansEnum: '{value}'"); + } /// - /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** + /// Returns a /// - /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** - [DataMember(Name = "plans", EmitDefaultValue = false)] - public List Plans { get; set; } + /// + /// + public static PlansEnum? PlansEnumFromStringOrDefault(string value) + { + if (value.Equals("bonus")) + return PlansEnum.Bonus; + + if (value.Equals("buynow_paylater")) + return PlansEnum.BuynowPaylater; + + if (value.Equals("interes_refund_prctg")) + return PlansEnum.InteresRefundPrctg; + + if (value.Equals("interest_bonus")) + return PlansEnum.InterestBonus; + + if (value.Equals("nointeres_refund_prctg")) + return PlansEnum.NointeresRefundPrctg; + + if (value.Equals("nointerest_bonus")) + return PlansEnum.NointerestBonus; + + if (value.Equals("refund_prctg")) + return PlansEnum.RefundPrctg; + + if (value.Equals("regular")) + return PlansEnum.Regular; + + if (value.Equals("revolving")) + return PlansEnum.Revolving; + + if (value.Equals("with_interest")) + return PlansEnum.WithInterest; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The maximum number of installments offered for this payment method.. - /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving**. - /// Preselected number of installments offered for this payment method.. - /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`.. - public InstallmentOption(int? maxValue = default(int?), List plans = default(List), int? preselectedValue = default(int?), List values = default(List)) + /// + /// + /// + public static string PlansEnumToJsonValue(PlansEnum value) { - this.MaxValue = maxValue; - this.Plans = plans; - this.PreselectedValue = preselectedValue; - this.Values = values; + if (value == PlansEnum.Bonus) + return "bonus"; + + if (value == PlansEnum.BuynowPaylater) + return "buynow_paylater"; + + if (value == PlansEnum.InteresRefundPrctg) + return "interes_refund_prctg"; + + if (value == PlansEnum.InterestBonus) + return "interest_bonus"; + + if (value == PlansEnum.NointeresRefundPrctg) + return "nointeres_refund_prctg"; + + if (value == PlansEnum.NointerestBonus) + return "nointerest_bonus"; + + if (value == PlansEnum.RefundPrctg) + return "refund_prctg"; + + if (value == PlansEnum.Regular) + return "regular"; + + if (value == PlansEnum.Revolving) + return "revolving"; + + if (value == PlansEnum.WithInterest) + return "with_interest"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of MaxValue + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MaxValueOption { get; private set; } + /// /// The maximum number of installments offered for this payment method. /// /// The maximum number of installments offered for this payment method. - [DataMember(Name = "maxValue", EmitDefaultValue = false)] - public int? MaxValue { get; set; } + [JsonPropertyName("maxValue")] + public int? MaxValue { get { return this.MaxValueOption; } set { this.MaxValueOption = new Option(value); } } + + /// + /// Used to track the state of Plans + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> PlansOption { get; private set; } + + /// + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** + /// + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** + [JsonPropertyName("plans")] + public List Plans { get { return this.PlansOption; } set { this.PlansOption = new Option>(value); } } + + /// + /// Used to track the state of PreselectedValue + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PreselectedValueOption { get; private set; } /// /// Preselected number of installments offered for this payment method. /// /// Preselected number of installments offered for this payment method. - [DataMember(Name = "preselectedValue", EmitDefaultValue = false)] - public int? PreselectedValue { get; set; } + [JsonPropertyName("preselectedValue")] + public int? PreselectedValue { get { return this.PreselectedValueOption; } set { this.PreselectedValueOption = new Option(value); } } + + /// + /// Used to track the state of Values + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> ValuesOption { get; private set; } /// /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. /// /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. - [DataMember(Name = "values", EmitDefaultValue = false)] - public List Values { get; set; } + [JsonPropertyName("values")] + public List Values { get { return this.ValuesOption; } set { this.ValuesOption = new Option>(value); } } /// /// Returns the string presentation of the object @@ -161,84 +298,141 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class InstallmentOptionJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override InstallmentOption Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as InstallmentOption); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if InstallmentOption instances are equal - /// - /// Instance of InstallmentOption to be compared - /// Boolean - public bool Equals(InstallmentOption input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option maxValue = default; + Option> plans = default; + Option preselectedValue = default; + Option> values = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "maxValue": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + maxValue = new Option(utf8JsonReader.GetInt32()); + break; + case "plans": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + plans = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "preselectedValue": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + preselectedValue = new Option(utf8JsonReader.GetInt32()); + break; + case "values": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + values = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.MaxValue == input.MaxValue || - this.MaxValue.Equals(input.MaxValue) - ) && - ( - this.Plans == input.Plans || - this.Plans.SequenceEqual(input.Plans) - ) && - ( - this.PreselectedValue == input.PreselectedValue || - this.PreselectedValue.Equals(input.PreselectedValue) - ) && - ( - this.Values == input.Values || - this.Values != null && - input.Values != null && - this.Values.SequenceEqual(input.Values) - ); + + if (maxValue.IsSet && maxValue.Value == null) + throw new ArgumentNullException(nameof(maxValue), "Property is not nullable for class InstallmentOption."); + + if (plans.IsSet && plans.Value == null) + throw new ArgumentNullException(nameof(plans), "Property is not nullable for class InstallmentOption."); + + if (preselectedValue.IsSet && preselectedValue.Value == null) + throw new ArgumentNullException(nameof(preselectedValue), "Property is not nullable for class InstallmentOption."); + + if (values.IsSet && values.Value == null) + throw new ArgumentNullException(nameof(values), "Property is not nullable for class InstallmentOption."); + + return new InstallmentOption(maxValue, plans, preselectedValue, values); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, InstallmentOption installmentOption, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.MaxValue.GetHashCode(); - hashCode = (hashCode * 59) + this.Plans.GetHashCode(); - hashCode = (hashCode * 59) + this.PreselectedValue.GetHashCode(); - if (this.Values != null) - { - hashCode = (hashCode * 59) + this.Values.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, installmentOption, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, InstallmentOption installmentOption, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (installmentOption.PlansOption.IsSet && installmentOption.Plans == null) + throw new ArgumentNullException(nameof(installmentOption.Plans), "Property is required for class InstallmentOption."); + + if (installmentOption.ValuesOption.IsSet && installmentOption.Values == null) + throw new ArgumentNullException(nameof(installmentOption.Values), "Property is required for class InstallmentOption."); + + if (installmentOption.MaxValueOption.IsSet) + writer.WriteNumber("maxValue", installmentOption.MaxValueOption.Value.Value); + + if (installmentOption.PlansOption.IsSet) + { + writer.WritePropertyName("plans"); + JsonSerializer.Serialize(writer, installmentOption.Plans, jsonSerializerOptions); + } + if (installmentOption.PreselectedValueOption.IsSet) + writer.WriteNumber("preselectedValue", installmentOption.PreselectedValueOption.Value.Value); + + if (installmentOption.ValuesOption.IsSet) + { + writer.WritePropertyName("values"); + JsonSerializer.Serialize(writer, installmentOption.Values, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/Installments.cs b/Adyen/Model/Checkout/Installments.cs index 9d589e83c..a9a957624 100644 --- a/Adyen/Model/Checkout/Installments.cs +++ b/Adyen/Model/Checkout/Installments.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,130 +14,250 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Installments /// - [DataContract(Name = "Installments")] - public partial class Installments : IEquatable, IValidatableObject + public partial class Installments : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Defines the number of installments. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. This value can be zero for Installments processed in Mexico. + /// Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico) + /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. + [JsonConstructor] + public Installments(int value, Option extra = default, Option plan = default) + { + Value = value; + ExtraOption = extra; + PlanOption = plan; + OnCreated(); + } + + partial void OnCreated(); + /// /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. /// /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. - [JsonConverter(typeof(StringEnumConverter))] public enum PlanEnum { /// /// Enum Bonus for value: bonus /// - [EnumMember(Value = "bonus")] Bonus = 1, /// /// Enum BuynowPaylater for value: buynow_paylater /// - [EnumMember(Value = "buynow_paylater")] BuynowPaylater = 2, /// /// Enum InteresRefundPrctg for value: interes_refund_prctg /// - [EnumMember(Value = "interes_refund_prctg")] InteresRefundPrctg = 3, /// /// Enum InterestBonus for value: interest_bonus /// - [EnumMember(Value = "interest_bonus")] InterestBonus = 4, /// /// Enum NointeresRefundPrctg for value: nointeres_refund_prctg /// - [EnumMember(Value = "nointeres_refund_prctg")] NointeresRefundPrctg = 5, /// /// Enum NointerestBonus for value: nointerest_bonus /// - [EnumMember(Value = "nointerest_bonus")] NointerestBonus = 6, /// /// Enum RefundPrctg for value: refund_prctg /// - [EnumMember(Value = "refund_prctg")] RefundPrctg = 7, /// /// Enum Regular for value: regular /// - [EnumMember(Value = "regular")] Regular = 8, /// /// Enum Revolving for value: revolving /// - [EnumMember(Value = "revolving")] Revolving = 9, /// /// Enum WithInterest for value: with_interest /// - [EnumMember(Value = "with_interest")] WithInterest = 10 - } - /// - /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. + /// Returns a /// - /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. - [DataMember(Name = "plan", EmitDefaultValue = false)] - public PlanEnum? Plan { get; set; } + /// + /// + /// + public static PlanEnum PlanEnumFromString(string value) + { + if (value.Equals("bonus")) + return PlanEnum.Bonus; + + if (value.Equals("buynow_paylater")) + return PlanEnum.BuynowPaylater; + + if (value.Equals("interes_refund_prctg")) + return PlanEnum.InteresRefundPrctg; + + if (value.Equals("interest_bonus")) + return PlanEnum.InterestBonus; + + if (value.Equals("nointeres_refund_prctg")) + return PlanEnum.NointeresRefundPrctg; + + if (value.Equals("nointerest_bonus")) + return PlanEnum.NointerestBonus; + + if (value.Equals("refund_prctg")) + return PlanEnum.RefundPrctg; + + if (value.Equals("regular")) + return PlanEnum.Regular; + + if (value.Equals("revolving")) + return PlanEnum.Revolving; + + if (value.Equals("with_interest")) + return PlanEnum.WithInterest; + + throw new NotImplementedException($"Could not convert value to type PlanEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected Installments() { } + /// + /// + public static PlanEnum? PlanEnumFromStringOrDefault(string value) + { + if (value.Equals("bonus")) + return PlanEnum.Bonus; + + if (value.Equals("buynow_paylater")) + return PlanEnum.BuynowPaylater; + + if (value.Equals("interes_refund_prctg")) + return PlanEnum.InteresRefundPrctg; + + if (value.Equals("interest_bonus")) + return PlanEnum.InterestBonus; + + if (value.Equals("nointeres_refund_prctg")) + return PlanEnum.NointeresRefundPrctg; + + if (value.Equals("nointerest_bonus")) + return PlanEnum.NointerestBonus; + + if (value.Equals("refund_prctg")) + return PlanEnum.RefundPrctg; + + if (value.Equals("regular")) + return PlanEnum.Regular; + + if (value.Equals("revolving")) + return PlanEnum.Revolving; + + if (value.Equals("with_interest")) + return PlanEnum.WithInterest; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico) . - /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. . - /// Defines the number of installments. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. This value can be zero for Installments processed in Mexico. (required). - public Installments(int? extra = default(int?), PlanEnum? plan = default(PlanEnum?), int? value = default(int?)) + /// + /// + /// + public static string PlanEnumToJsonValue(PlanEnum? value) { - this.Value = value; - this.Extra = extra; - this.Plan = plan; + if (value == PlanEnum.Bonus) + return "bonus"; + + if (value == PlanEnum.BuynowPaylater) + return "buynow_paylater"; + + if (value == PlanEnum.InteresRefundPrctg) + return "interes_refund_prctg"; + + if (value == PlanEnum.InterestBonus) + return "interest_bonus"; + + if (value == PlanEnum.NointeresRefundPrctg) + return "nointeres_refund_prctg"; + + if (value == PlanEnum.NointerestBonus) + return "nointerest_bonus"; + + if (value == PlanEnum.RefundPrctg) + return "refund_prctg"; + + if (value == PlanEnum.Regular) + return "regular"; + + if (value == PlanEnum.Revolving) + return "revolving"; + + if (value == PlanEnum.WithInterest) + return "with_interest"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico) + /// Used to track the state of Plan /// - /// Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico) - [DataMember(Name = "extra", EmitDefaultValue = false)] - public int? Extra { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PlanOption { get; private set; } + + /// + /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. + /// + /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. + [JsonPropertyName("plan")] + public PlanEnum? Plan { get { return this.PlanOption; } set { this.PlanOption = new Option(value); } } /// /// Defines the number of installments. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. This value can be zero for Installments processed in Mexico. /// /// Defines the number of installments. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. This value can be zero for Installments processed in Mexico. - [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] - public int? Value { get; set; } + [JsonPropertyName("value")] + public int Value { get; set; } + + /// + /// Used to track the state of Extra + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExtraOption { get; private set; } + + /// + /// Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico) + /// + /// Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico) + [JsonPropertyName("extra")] + public int? Extra { get { return this.ExtraOption; } set { this.ExtraOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -148,82 +267,130 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Installments {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); sb.Append(" Extra: ").Append(Extra).Append("\n"); sb.Append(" Plan: ").Append(Plan).Append("\n"); - sb.Append(" Value: ").Append(Value).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class InstallmentsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override Installments Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as Installments); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if Installments instances are equal - /// - /// Instance of Installments to be compared - /// Boolean - public bool Equals(Installments input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option value = default; + Option extra = default; + Option plan = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "value": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + value = new Option(utf8JsonReader.GetInt32()); + break; + case "extra": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + extra = new Option(utf8JsonReader.GetInt32()); + break; + case "plan": + string planRawValue = utf8JsonReader.GetString(); + if (planRawValue != null) + plan = new Option(Installments.PlanEnumFromStringOrDefault(planRawValue)); + break; + default: + break; + } + } } - return - ( - this.Extra == input.Extra || - this.Extra.Equals(input.Extra) - ) && - ( - this.Plan == input.Plan || - this.Plan.Equals(input.Plan) - ) && - ( - this.Value == input.Value || - this.Value.Equals(input.Value) - ); + + if (!value.IsSet) + throw new ArgumentException("Property is required for class Installments.", nameof(value)); + + if (value.IsSet && value.Value == null) + throw new ArgumentNullException(nameof(value), "Property is not nullable for class Installments."); + + if (extra.IsSet && extra.Value == null) + throw new ArgumentNullException(nameof(extra), "Property is not nullable for class Installments."); + + if (plan.IsSet && plan.Value == null) + throw new ArgumentNullException(nameof(plan), "Property is not nullable for class Installments."); + + return new Installments(value.Value.Value, extra, plan); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Installments installments, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Extra.GetHashCode(); - hashCode = (hashCode * 59) + this.Plan.GetHashCode(); - hashCode = (hashCode * 59) + this.Value.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, installments, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Installments installments, JsonSerializerOptions jsonSerializerOptions) { - yield break; + writer.WriteNumber("value", installments.Value); + + if (installments.ExtraOption.IsSet) + writer.WriteNumber("extra", installments.ExtraOption.Value.Value); + + var planRawValue = Installments.PlanEnumToJsonValue(installments.PlanOption.Value.Value); + writer.WriteString("plan", planRawValue); } } - } diff --git a/Adyen/Model/Checkout/Item.cs b/Adyen/Model/Checkout/Item.cs index 5576c9b63..4d1d42912 100644 --- a/Adyen/Model/Checkout/Item.cs +++ b/Adyen/Model/Checkout/Item.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,47 +14,62 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Item /// - [DataContract(Name = "Item")] - public partial class Item : IEquatable, IValidatableObject + public partial class Item : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The value to provide in the result.. - /// The display name.. - public Item(string id = default(string), string name = default(string)) + /// The value to provide in the result. + /// The display name. + [JsonConstructor] + public Item(Option id = default, Option name = default) { - this.Id = id; - this.Name = name; + IdOption = id; + NameOption = name; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + /// /// The value to provide in the result. /// /// The value to provide in the result. - [DataMember(Name = "id", EmitDefaultValue = false)] - public string Id { get; set; } + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } /// /// The display name. /// /// The display name. - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -72,77 +86,112 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ItemJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override Item Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as Item); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if Item instances are equal - /// - /// Instance of Item to be compared - /// Boolean - public bool Equals(Item input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option id = default; + Option name = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Item."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Item."); + + return new Item(id, name); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Item item, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, item, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Item item, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (item.IdOption.IsSet && item.Id == null) + throw new ArgumentNullException(nameof(item.Id), "Property is required for class Item."); + + if (item.NameOption.IsSet && item.Name == null) + throw new ArgumentNullException(nameof(item.Name), "Property is required for class Item."); + + if (item.IdOption.IsSet) + writer.WriteString("id", item.Id); + + if (item.NameOption.IsSet) + writer.WriteString("name", item.Name); } } - } diff --git a/Adyen/Model/Checkout/KlarnaDetails.cs b/Adyen/Model/Checkout/KlarnaDetails.cs index 49d130722..3f7b01428 100644 --- a/Adyen/Model/Checkout/KlarnaDetails.cs +++ b/Adyen/Model/Checkout/KlarnaDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,158 +14,289 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// KlarnaDetails /// - [DataContract(Name = "KlarnaDetails")] - public partial class KlarnaDetails : IEquatable, IValidatableObject + public partial class KlarnaDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The address where to send the invoice. + /// The checkout attempt identifier. + /// The address where the goods should be delivered. + /// Shopper name, date of birth, phone number, and email address. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The type of flow to initiate. + /// **klarna** (default to TypeEnum.Klarna) + [JsonConstructor] + public KlarnaDetails(Option billingAddress = default, Option checkoutAttemptId = default, Option deliveryAddress = default, Option personalDetails = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option subtype = default, TypeEnum type = TypeEnum.Klarna) + { + BillingAddressOption = billingAddress; + CheckoutAttemptIdOption = checkoutAttemptId; + DeliveryAddressOption = deliveryAddress; + PersonalDetailsOption = personalDetails; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + SubtypeOption = subtype; + Type = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **klarna** /// /// **klarna** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Klarna for value: klarna /// - [EnumMember(Value = "klarna")] Klarna = 1, /// /// Enum Klarnapayments for value: klarnapayments /// - [EnumMember(Value = "klarnapayments")] Klarnapayments = 2, /// /// Enum KlarnapaymentsAccount for value: klarnapayments_account /// - [EnumMember(Value = "klarnapayments_account")] KlarnapaymentsAccount = 3, /// /// Enum KlarnapaymentsB2b for value: klarnapayments_b2b /// - [EnumMember(Value = "klarnapayments_b2b")] KlarnapaymentsB2b = 4, /// /// Enum KlarnaPaynow for value: klarna_paynow /// - [EnumMember(Value = "klarna_paynow")] KlarnaPaynow = 5, /// /// Enum KlarnaAccount for value: klarna_account /// - [EnumMember(Value = "klarna_account")] KlarnaAccount = 6, /// /// Enum KlarnaB2b for value: klarna_b2b /// - [EnumMember(Value = "klarna_b2b")] KlarnaB2b = 7 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("klarna")) + return TypeEnum.Klarna; + + if (value.Equals("klarnapayments")) + return TypeEnum.Klarnapayments; + + if (value.Equals("klarnapayments_account")) + return TypeEnum.KlarnapaymentsAccount; + + if (value.Equals("klarnapayments_b2b")) + return TypeEnum.KlarnapaymentsB2b; + + if (value.Equals("klarna_paynow")) + return TypeEnum.KlarnaPaynow; + + if (value.Equals("klarna_account")) + return TypeEnum.KlarnaAccount; + + if (value.Equals("klarna_b2b")) + return TypeEnum.KlarnaB2b; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("klarna")) + return TypeEnum.Klarna; + + if (value.Equals("klarnapayments")) + return TypeEnum.Klarnapayments; + + if (value.Equals("klarnapayments_account")) + return TypeEnum.KlarnapaymentsAccount; + + if (value.Equals("klarnapayments_b2b")) + return TypeEnum.KlarnapaymentsB2b; + + if (value.Equals("klarna_paynow")) + return TypeEnum.KlarnaPaynow; + + if (value.Equals("klarna_account")) + return TypeEnum.KlarnaAccount; + + if (value.Equals("klarna_b2b")) + return TypeEnum.KlarnaB2b; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.Klarna) + return "klarna"; + + if (value == TypeEnum.Klarnapayments) + return "klarnapayments"; + + if (value == TypeEnum.KlarnapaymentsAccount) + return "klarnapayments_account"; + + if (value == TypeEnum.KlarnapaymentsB2b) + return "klarnapayments_b2b"; + + if (value == TypeEnum.KlarnaPaynow) + return "klarna_paynow"; + + if (value == TypeEnum.KlarnaAccount) + return "klarna_account"; + + if (value == TypeEnum.KlarnaB2b) + return "klarna_b2b"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **klarna** /// /// **klarna** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected KlarnaDetails() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of BillingAddress /// - /// The address where to send the invoice.. - /// The checkout attempt identifier.. - /// The address where the goods should be delivered.. - /// Shopper name, date of birth, phone number, and email address.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The type of flow to initiate.. - /// **klarna** (required) (default to TypeEnum.Klarna). - public KlarnaDetails(string billingAddress = default(string), string checkoutAttemptId = default(string), string deliveryAddress = default(string), string personalDetails = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string subtype = default(string), TypeEnum type = TypeEnum.Klarna) - { - this.Type = type; - this.BillingAddress = billingAddress; - this.CheckoutAttemptId = checkoutAttemptId; - this.DeliveryAddress = deliveryAddress; - this.PersonalDetails = personalDetails; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Subtype = subtype; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressOption { get; private set; } /// /// The address where to send the invoice. /// /// The address where to send the invoice. - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public string BillingAddress { get; set; } + [JsonPropertyName("billingAddress")] + public string BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryAddressOption { get; private set; } /// /// The address where the goods should be delivered. /// /// The address where the goods should be delivered. - [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] - public string DeliveryAddress { get; set; } + [JsonPropertyName("deliveryAddress")] + public string DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } + + /// + /// Used to track the state of PersonalDetails + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PersonalDetailsOption { get; private set; } /// /// Shopper name, date of birth, phone number, and email address. /// /// Shopper name, date of birth, phone number, and email address. - [DataMember(Name = "personalDetails", EmitDefaultValue = false)] - public string PersonalDetails { get; set; } + [JsonPropertyName("personalDetails")] + public string PersonalDetails { get { return this.PersonalDetailsOption; } set { this.PersonalDetailsOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of Subtype + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubtypeOption { get; private set; } /// /// The type of flow to initiate. /// /// The type of flow to initiate. - [DataMember(Name = "subtype", EmitDefaultValue = false)] - public string Subtype { get; set; } + [JsonPropertyName("subtype")] + public string Subtype { get { return this.SubtypeOption; } set { this.SubtypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -189,133 +319,198 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as KlarnaDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class KlarnaDetailsJsonConverter : JsonConverter + { /// - /// Returns true if KlarnaDetails instances are equal + /// Deserializes json to /// - /// Instance of KlarnaDetails to be compared - /// Boolean - public bool Equals(KlarnaDetails input) + /// + /// + /// + /// + /// + public override KlarnaDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option billingAddress = default; + Option checkoutAttemptId = default; + Option deliveryAddress = default; + Option personalDetails = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option subtype = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "billingAddress": + billingAddress = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "deliveryAddress": + deliveryAddress = new Option(utf8JsonReader.GetString()); + break; + case "personalDetails": + personalDetails = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "subtype": + subtype = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(KlarnaDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) - ) && - ( - this.PersonalDetails == input.PersonalDetails || - (this.PersonalDetails != null && - this.PersonalDetails.Equals(input.PersonalDetails)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Subtype == input.Subtype || - (this.Subtype != null && - this.Subtype.Equals(input.Subtype)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class KlarnaDetails.", nameof(type)); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class KlarnaDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class KlarnaDetails."); + + if (deliveryAddress.IsSet && deliveryAddress.Value == null) + throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class KlarnaDetails."); + + if (personalDetails.IsSet && personalDetails.Value == null) + throw new ArgumentNullException(nameof(personalDetails), "Property is not nullable for class KlarnaDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class KlarnaDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class KlarnaDetails."); + + if (subtype.IsSet && subtype.Value == null) + throw new ArgumentNullException(nameof(subtype), "Property is not nullable for class KlarnaDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class KlarnaDetails."); + + return new KlarnaDetails(billingAddress, checkoutAttemptId, deliveryAddress, personalDetails, recurringDetailReference, storedPaymentMethodId, subtype, type.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, KlarnaDetails klarnaDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.DeliveryAddress != null) - { - hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); - } - if (this.PersonalDetails != null) - { - hashCode = (hashCode * 59) + this.PersonalDetails.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.Subtype != null) - { - hashCode = (hashCode * 59) + this.Subtype.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, klarnaDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, KlarnaDetails klarnaDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (klarnaDetails.BillingAddressOption.IsSet && klarnaDetails.BillingAddress == null) + throw new ArgumentNullException(nameof(klarnaDetails.BillingAddress), "Property is required for class KlarnaDetails."); - yield break; + if (klarnaDetails.CheckoutAttemptIdOption.IsSet && klarnaDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(klarnaDetails.CheckoutAttemptId), "Property is required for class KlarnaDetails."); + + if (klarnaDetails.DeliveryAddressOption.IsSet && klarnaDetails.DeliveryAddress == null) + throw new ArgumentNullException(nameof(klarnaDetails.DeliveryAddress), "Property is required for class KlarnaDetails."); + + if (klarnaDetails.PersonalDetailsOption.IsSet && klarnaDetails.PersonalDetails == null) + throw new ArgumentNullException(nameof(klarnaDetails.PersonalDetails), "Property is required for class KlarnaDetails."); + + if (klarnaDetails.RecurringDetailReferenceOption.IsSet && klarnaDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(klarnaDetails.RecurringDetailReference), "Property is required for class KlarnaDetails."); + + if (klarnaDetails.StoredPaymentMethodIdOption.IsSet && klarnaDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(klarnaDetails.StoredPaymentMethodId), "Property is required for class KlarnaDetails."); + + if (klarnaDetails.SubtypeOption.IsSet && klarnaDetails.Subtype == null) + throw new ArgumentNullException(nameof(klarnaDetails.Subtype), "Property is required for class KlarnaDetails."); + + if (klarnaDetails.BillingAddressOption.IsSet) + writer.WriteString("billingAddress", klarnaDetails.BillingAddress); + + if (klarnaDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", klarnaDetails.CheckoutAttemptId); + + if (klarnaDetails.DeliveryAddressOption.IsSet) + writer.WriteString("deliveryAddress", klarnaDetails.DeliveryAddress); + + if (klarnaDetails.PersonalDetailsOption.IsSet) + writer.WriteString("personalDetails", klarnaDetails.PersonalDetails); + + if (klarnaDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", klarnaDetails.RecurringDetailReference); + + if (klarnaDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", klarnaDetails.StoredPaymentMethodId); + + if (klarnaDetails.SubtypeOption.IsSet) + writer.WriteString("subtype", klarnaDetails.Subtype); + + var typeRawValue = KlarnaDetails.TypeEnumToJsonValue(klarnaDetails.Type); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/Leg.cs b/Adyen/Model/Checkout/Leg.cs index 72aa82eca..bc73fbfda 100644 --- a/Adyen/Model/Checkout/Leg.cs +++ b/Adyen/Model/Checkout/Leg.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,110 +14,174 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Leg /// - [DataContract(Name = "Leg")] - public partial class Leg : IEquatable, IValidatableObject + public partial class Leg : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros.. - /// Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters. - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros.. - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character. - public Leg(string carrierCode = default(string), string classOfTravel = default(string), DateTime dateOfTravel = default(DateTime), string departureAirportCode = default(string), long? departureTax = default(long?), string destinationAirportCode = default(string), string fareBasisCode = default(string), string flightNumber = default(string), string stopOverCode = default(string)) + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros. + /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros. + /// Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. + /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros. + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. + /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros. + /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros. + /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character + [JsonConstructor] + public Leg(Option carrierCode = default, Option classOfTravel = default, Option dateOfTravel = default, Option departureAirportCode = default, Option departureTax = default, Option destinationAirportCode = default, Option fareBasisCode = default, Option flightNumber = default, Option stopOverCode = default) { - this.CarrierCode = carrierCode; - this.ClassOfTravel = classOfTravel; - this.DateOfTravel = dateOfTravel; - this.DepartureAirportCode = departureAirportCode; - this.DepartureTax = departureTax; - this.DestinationAirportCode = destinationAirportCode; - this.FareBasisCode = fareBasisCode; - this.FlightNumber = flightNumber; - this.StopOverCode = stopOverCode; + CarrierCodeOption = carrierCode; + ClassOfTravelOption = classOfTravel; + DateOfTravelOption = dateOfTravel; + DepartureAirportCodeOption = departureAirportCode; + DepartureTaxOption = departureTax; + DestinationAirportCodeOption = destinationAirportCode; + FareBasisCodeOption = fareBasisCode; + FlightNumberOption = flightNumber; + StopOverCodeOption = stopOverCode; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of CarrierCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CarrierCodeOption { get; private set; } + /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "carrierCode", EmitDefaultValue = false)] - public string CarrierCode { get; set; } + [JsonPropertyName("carrierCode")] + public string CarrierCode { get { return this.CarrierCodeOption; } set { this.CarrierCodeOption = new Option(value); } } + + /// + /// Used to track the state of ClassOfTravel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ClassOfTravelOption { get; private set; } /// /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros. /// /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "classOfTravel", EmitDefaultValue = false)] - public string ClassOfTravel { get; set; } + [JsonPropertyName("classOfTravel")] + public string ClassOfTravel { get { return this.ClassOfTravelOption; } set { this.ClassOfTravelOption = new Option(value); } } + + /// + /// Used to track the state of DateOfTravel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DateOfTravelOption { get; private set; } /// /// Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters /// /// Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters - [DataMember(Name = "dateOfTravel", EmitDefaultValue = false)] - public DateTime DateOfTravel { get; set; } + [JsonPropertyName("dateOfTravel")] + public DateTime? DateOfTravel { get { return this.DateOfTravelOption; } set { this.DateOfTravelOption = new Option(value); } } + + /// + /// Used to track the state of DepartureAirportCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DepartureAirportCodeOption { get; private set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "departureAirportCode", EmitDefaultValue = false)] - public string DepartureAirportCode { get; set; } + [JsonPropertyName("departureAirportCode")] + public string DepartureAirportCode { get { return this.DepartureAirportCodeOption; } set { this.DepartureAirportCodeOption = new Option(value); } } + + /// + /// Used to track the state of DepartureTax + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DepartureTaxOption { get; private set; } /// /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros. /// /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros. - [DataMember(Name = "departureTax", EmitDefaultValue = false)] - public long? DepartureTax { get; set; } + [JsonPropertyName("departureTax")] + public long? DepartureTax { get { return this.DepartureTaxOption; } set { this.DepartureTaxOption = new Option(value); } } + + /// + /// Used to track the state of DestinationAirportCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DestinationAirportCodeOption { get; private set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "destinationAirportCode", EmitDefaultValue = false)] - public string DestinationAirportCode { get; set; } + [JsonPropertyName("destinationAirportCode")] + public string DestinationAirportCode { get { return this.DestinationAirportCodeOption; } set { this.DestinationAirportCodeOption = new Option(value); } } + + /// + /// Used to track the state of FareBasisCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FareBasisCodeOption { get; private set; } /// /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "fareBasisCode", EmitDefaultValue = false)] - public string FareBasisCode { get; set; } + [JsonPropertyName("fareBasisCode")] + public string FareBasisCode { get { return this.FareBasisCodeOption; } set { this.FareBasisCodeOption = new Option(value); } } + + /// + /// Used to track the state of FlightNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FlightNumberOption { get; private set; } /// /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "flightNumber", EmitDefaultValue = false)] - public string FlightNumber { get; set; } + [JsonPropertyName("flightNumber")] + public string FlightNumber { get { return this.FlightNumberOption; } set { this.FlightNumberOption = new Option(value); } } + + /// + /// Used to track the state of StopOverCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StopOverCodeOption { get; private set; } /// /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character /// /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character - [DataMember(Name = "stopOverCode", EmitDefaultValue = false)] - public string StopOverCode { get; set; } + [JsonPropertyName("stopOverCode")] + public string StopOverCode { get { return this.StopOverCodeOption; } set { this.StopOverCodeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -142,136 +205,204 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class LegJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// The format to use to serialize DateOfTravel /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Leg); - } + public static string DateOfTravelFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// Returns true if Leg instances are equal + /// Deserializes json to /// - /// Instance of Leg to be compared - /// Boolean - public bool Equals(Leg input) + /// + /// + /// + /// + /// + public override Leg Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option carrierCode = default; + Option classOfTravel = default; + Option dateOfTravel = default; + Option departureAirportCode = default; + Option departureTax = default; + Option destinationAirportCode = default; + Option fareBasisCode = default; + Option flightNumber = default; + Option stopOverCode = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "carrierCode": + carrierCode = new Option(utf8JsonReader.GetString()); + break; + case "classOfTravel": + classOfTravel = new Option(utf8JsonReader.GetString()); + break; + case "dateOfTravel": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOfTravel = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "departureAirportCode": + departureAirportCode = new Option(utf8JsonReader.GetString()); + break; + case "departureTax": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + departureTax = new Option(utf8JsonReader.GetInt64()); + break; + case "destinationAirportCode": + destinationAirportCode = new Option(utf8JsonReader.GetString()); + break; + case "fareBasisCode": + fareBasisCode = new Option(utf8JsonReader.GetString()); + break; + case "flightNumber": + flightNumber = new Option(utf8JsonReader.GetString()); + break; + case "stopOverCode": + stopOverCode = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.CarrierCode == input.CarrierCode || - (this.CarrierCode != null && - this.CarrierCode.Equals(input.CarrierCode)) - ) && - ( - this.ClassOfTravel == input.ClassOfTravel || - (this.ClassOfTravel != null && - this.ClassOfTravel.Equals(input.ClassOfTravel)) - ) && - ( - this.DateOfTravel == input.DateOfTravel || - (this.DateOfTravel != null && - this.DateOfTravel.Equals(input.DateOfTravel)) - ) && - ( - this.DepartureAirportCode == input.DepartureAirportCode || - (this.DepartureAirportCode != null && - this.DepartureAirportCode.Equals(input.DepartureAirportCode)) - ) && - ( - this.DepartureTax == input.DepartureTax || - this.DepartureTax.Equals(input.DepartureTax) - ) && - ( - this.DestinationAirportCode == input.DestinationAirportCode || - (this.DestinationAirportCode != null && - this.DestinationAirportCode.Equals(input.DestinationAirportCode)) - ) && - ( - this.FareBasisCode == input.FareBasisCode || - (this.FareBasisCode != null && - this.FareBasisCode.Equals(input.FareBasisCode)) - ) && - ( - this.FlightNumber == input.FlightNumber || - (this.FlightNumber != null && - this.FlightNumber.Equals(input.FlightNumber)) - ) && - ( - this.StopOverCode == input.StopOverCode || - (this.StopOverCode != null && - this.StopOverCode.Equals(input.StopOverCode)) - ); + + if (carrierCode.IsSet && carrierCode.Value == null) + throw new ArgumentNullException(nameof(carrierCode), "Property is not nullable for class Leg."); + + if (classOfTravel.IsSet && classOfTravel.Value == null) + throw new ArgumentNullException(nameof(classOfTravel), "Property is not nullable for class Leg."); + + if (dateOfTravel.IsSet && dateOfTravel.Value == null) + throw new ArgumentNullException(nameof(dateOfTravel), "Property is not nullable for class Leg."); + + if (departureAirportCode.IsSet && departureAirportCode.Value == null) + throw new ArgumentNullException(nameof(departureAirportCode), "Property is not nullable for class Leg."); + + if (departureTax.IsSet && departureTax.Value == null) + throw new ArgumentNullException(nameof(departureTax), "Property is not nullable for class Leg."); + + if (destinationAirportCode.IsSet && destinationAirportCode.Value == null) + throw new ArgumentNullException(nameof(destinationAirportCode), "Property is not nullable for class Leg."); + + if (fareBasisCode.IsSet && fareBasisCode.Value == null) + throw new ArgumentNullException(nameof(fareBasisCode), "Property is not nullable for class Leg."); + + if (flightNumber.IsSet && flightNumber.Value == null) + throw new ArgumentNullException(nameof(flightNumber), "Property is not nullable for class Leg."); + + if (stopOverCode.IsSet && stopOverCode.Value == null) + throw new ArgumentNullException(nameof(stopOverCode), "Property is not nullable for class Leg."); + + return new Leg(carrierCode, classOfTravel, dateOfTravel, departureAirportCode, departureTax, destinationAirportCode, fareBasisCode, flightNumber, stopOverCode); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Leg leg, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CarrierCode != null) - { - hashCode = (hashCode * 59) + this.CarrierCode.GetHashCode(); - } - if (this.ClassOfTravel != null) - { - hashCode = (hashCode * 59) + this.ClassOfTravel.GetHashCode(); - } - if (this.DateOfTravel != null) - { - hashCode = (hashCode * 59) + this.DateOfTravel.GetHashCode(); - } - if (this.DepartureAirportCode != null) - { - hashCode = (hashCode * 59) + this.DepartureAirportCode.GetHashCode(); - } - hashCode = (hashCode * 59) + this.DepartureTax.GetHashCode(); - if (this.DestinationAirportCode != null) - { - hashCode = (hashCode * 59) + this.DestinationAirportCode.GetHashCode(); - } - if (this.FareBasisCode != null) - { - hashCode = (hashCode * 59) + this.FareBasisCode.GetHashCode(); - } - if (this.FlightNumber != null) - { - hashCode = (hashCode * 59) + this.FlightNumber.GetHashCode(); - } - if (this.StopOverCode != null) - { - hashCode = (hashCode * 59) + this.StopOverCode.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, leg, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Leg leg, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (leg.CarrierCodeOption.IsSet && leg.CarrierCode == null) + throw new ArgumentNullException(nameof(leg.CarrierCode), "Property is required for class Leg."); + + if (leg.ClassOfTravelOption.IsSet && leg.ClassOfTravel == null) + throw new ArgumentNullException(nameof(leg.ClassOfTravel), "Property is required for class Leg."); + + if (leg.DepartureAirportCodeOption.IsSet && leg.DepartureAirportCode == null) + throw new ArgumentNullException(nameof(leg.DepartureAirportCode), "Property is required for class Leg."); + + if (leg.DestinationAirportCodeOption.IsSet && leg.DestinationAirportCode == null) + throw new ArgumentNullException(nameof(leg.DestinationAirportCode), "Property is required for class Leg."); + + if (leg.FareBasisCodeOption.IsSet && leg.FareBasisCode == null) + throw new ArgumentNullException(nameof(leg.FareBasisCode), "Property is required for class Leg."); + + if (leg.FlightNumberOption.IsSet && leg.FlightNumber == null) + throw new ArgumentNullException(nameof(leg.FlightNumber), "Property is required for class Leg."); + + if (leg.StopOverCodeOption.IsSet && leg.StopOverCode == null) + throw new ArgumentNullException(nameof(leg.StopOverCode), "Property is required for class Leg."); + + if (leg.CarrierCodeOption.IsSet) + writer.WriteString("carrierCode", leg.CarrierCode); + + if (leg.ClassOfTravelOption.IsSet) + writer.WriteString("classOfTravel", leg.ClassOfTravel); + + if (leg.DateOfTravelOption.IsSet) + writer.WriteString("dateOfTravel", leg.DateOfTravelOption.Value.Value.ToString(DateOfTravelFormat)); + + if (leg.DepartureAirportCodeOption.IsSet) + writer.WriteString("departureAirportCode", leg.DepartureAirportCode); + + if (leg.DepartureTaxOption.IsSet) + writer.WriteNumber("departureTax", leg.DepartureTaxOption.Value.Value); + + if (leg.DestinationAirportCodeOption.IsSet) + writer.WriteString("destinationAirportCode", leg.DestinationAirportCode); + + if (leg.FareBasisCodeOption.IsSet) + writer.WriteString("fareBasisCode", leg.FareBasisCode); + + if (leg.FlightNumberOption.IsSet) + writer.WriteString("flightNumber", leg.FlightNumber); + + if (leg.StopOverCodeOption.IsSet) + writer.WriteString("stopOverCode", leg.StopOverCode); } } - } diff --git a/Adyen/Model/Checkout/LineItem.cs b/Adyen/Model/Checkout/LineItem.cs index 987a173fa..40df613c1 100644 --- a/Adyen/Model/Checkout/LineItem.cs +++ b/Adyen/Model/Checkout/LineItem.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,191 +14,318 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// LineItem /// - [DataContract(Name = "LineItem")] - public partial class LineItem : IEquatable, IValidatableObject + public partial class LineItem : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Item amount excluding the tax, in minor units.. - /// Item amount including the tax, in minor units.. - /// Brand of the item.. - /// Color of the item.. - /// Description of the line item.. - /// ID of the line item.. - /// Link to the picture of the purchased item.. - /// Item category, used by the payment methods PayPal and Ratepay.. - /// Manufacturer of the item.. - /// Marketplace seller id.. - /// Link to the purchased item.. - /// Number of items.. - /// Email associated with the given product in the basket (usually in electronic gift cards).. - /// Size of the item.. - /// Stock keeping unit.. - /// Tax amount, in minor units.. - /// Tax percentage, in minor units.. - /// Universal Product Code.. - public LineItem(long? amountExcludingTax = default(long?), long? amountIncludingTax = default(long?), string brand = default(string), string color = default(string), string description = default(string), string id = default(string), string imageUrl = default(string), string itemCategory = default(string), string manufacturer = default(string), string marketplaceSellerId = default(string), string productUrl = default(string), long? quantity = default(long?), string receiverEmail = default(string), string size = default(string), string sku = default(string), long? taxAmount = default(long?), long? taxPercentage = default(long?), string upc = default(string)) + /// Item amount excluding the tax, in minor units. + /// Item amount including the tax, in minor units. + /// Brand of the item. + /// Color of the item. + /// Description of the line item. + /// ID of the line item. + /// Link to the picture of the purchased item. + /// Item category, used by the payment methods PayPal and Ratepay. + /// Manufacturer of the item. + /// Marketplace seller id. + /// Link to the purchased item. + /// Number of items. + /// Email associated with the given product in the basket (usually in electronic gift cards). + /// Size of the item. + /// Stock keeping unit. + /// Tax amount, in minor units. + /// Tax percentage, in minor units. + /// Universal Product Code. + [JsonConstructor] + public LineItem(Option amountExcludingTax = default, Option amountIncludingTax = default, Option brand = default, Option color = default, Option description = default, Option id = default, Option imageUrl = default, Option itemCategory = default, Option manufacturer = default, Option marketplaceSellerId = default, Option productUrl = default, Option quantity = default, Option receiverEmail = default, Option size = default, Option sku = default, Option taxAmount = default, Option taxPercentage = default, Option upc = default) { - this.AmountExcludingTax = amountExcludingTax; - this.AmountIncludingTax = amountIncludingTax; - this.Brand = brand; - this.Color = color; - this.Description = description; - this.Id = id; - this.ImageUrl = imageUrl; - this.ItemCategory = itemCategory; - this.Manufacturer = manufacturer; - this.MarketplaceSellerId = marketplaceSellerId; - this.ProductUrl = productUrl; - this.Quantity = quantity; - this.ReceiverEmail = receiverEmail; - this.Size = size; - this.Sku = sku; - this.TaxAmount = taxAmount; - this.TaxPercentage = taxPercentage; - this.Upc = upc; + AmountExcludingTaxOption = amountExcludingTax; + AmountIncludingTaxOption = amountIncludingTax; + BrandOption = brand; + ColorOption = color; + DescriptionOption = description; + IdOption = id; + ImageUrlOption = imageUrl; + ItemCategoryOption = itemCategory; + ManufacturerOption = manufacturer; + MarketplaceSellerIdOption = marketplaceSellerId; + ProductUrlOption = productUrl; + QuantityOption = quantity; + ReceiverEmailOption = receiverEmail; + SizeOption = size; + SkuOption = sku; + TaxAmountOption = taxAmount; + TaxPercentageOption = taxPercentage; + UpcOption = upc; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of AmountExcludingTax + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountExcludingTaxOption { get; private set; } + /// /// Item amount excluding the tax, in minor units. /// /// Item amount excluding the tax, in minor units. - [DataMember(Name = "amountExcludingTax", EmitDefaultValue = false)] - public long? AmountExcludingTax { get; set; } + [JsonPropertyName("amountExcludingTax")] + public long? AmountExcludingTax { get { return this.AmountExcludingTaxOption; } set { this.AmountExcludingTaxOption = new Option(value); } } + + /// + /// Used to track the state of AmountIncludingTax + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountIncludingTaxOption { get; private set; } /// /// Item amount including the tax, in minor units. /// /// Item amount including the tax, in minor units. - [DataMember(Name = "amountIncludingTax", EmitDefaultValue = false)] - public long? AmountIncludingTax { get; set; } + [JsonPropertyName("amountIncludingTax")] + public long? AmountIncludingTax { get { return this.AmountIncludingTaxOption; } set { this.AmountIncludingTaxOption = new Option(value); } } + + /// + /// Used to track the state of Brand + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandOption { get; private set; } /// /// Brand of the item. /// /// Brand of the item. - [DataMember(Name = "brand", EmitDefaultValue = false)] - public string Brand { get; set; } + [JsonPropertyName("brand")] + public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } /// /// Color of the item. /// /// Color of the item. - [DataMember(Name = "color", EmitDefaultValue = false)] - public string Color { get; set; } + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = new Option(value); } } + + /// + /// Used to track the state of Description + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DescriptionOption { get; private set; } /// /// Description of the line item. /// /// Description of the line item. - [DataMember(Name = "description", EmitDefaultValue = false)] - public string Description { get; set; } + [JsonPropertyName("description")] + public string Description { get { return this.DescriptionOption; } set { this.DescriptionOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } /// /// ID of the line item. /// /// ID of the line item. - [DataMember(Name = "id", EmitDefaultValue = false)] - public string Id { get; set; } + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of ImageUrl + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ImageUrlOption { get; private set; } /// /// Link to the picture of the purchased item. /// /// Link to the picture of the purchased item. - [DataMember(Name = "imageUrl", EmitDefaultValue = false)] - public string ImageUrl { get; set; } + [JsonPropertyName("imageUrl")] + public string ImageUrl { get { return this.ImageUrlOption; } set { this.ImageUrlOption = new Option(value); } } + + /// + /// Used to track the state of ItemCategory + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ItemCategoryOption { get; private set; } /// /// Item category, used by the payment methods PayPal and Ratepay. /// /// Item category, used by the payment methods PayPal and Ratepay. - [DataMember(Name = "itemCategory", EmitDefaultValue = false)] - public string ItemCategory { get; set; } + [JsonPropertyName("itemCategory")] + public string ItemCategory { get { return this.ItemCategoryOption; } set { this.ItemCategoryOption = new Option(value); } } + + /// + /// Used to track the state of Manufacturer + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ManufacturerOption { get; private set; } /// /// Manufacturer of the item. /// /// Manufacturer of the item. - [DataMember(Name = "manufacturer", EmitDefaultValue = false)] - public string Manufacturer { get; set; } + [JsonPropertyName("manufacturer")] + public string Manufacturer { get { return this.ManufacturerOption; } set { this.ManufacturerOption = new Option(value); } } + + /// + /// Used to track the state of MarketplaceSellerId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MarketplaceSellerIdOption { get; private set; } /// /// Marketplace seller id. /// /// Marketplace seller id. - [DataMember(Name = "marketplaceSellerId", EmitDefaultValue = false)] - public string MarketplaceSellerId { get; set; } + [JsonPropertyName("marketplaceSellerId")] + public string MarketplaceSellerId { get { return this.MarketplaceSellerIdOption; } set { this.MarketplaceSellerIdOption = new Option(value); } } + + /// + /// Used to track the state of ProductUrl + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductUrlOption { get; private set; } /// /// Link to the purchased item. /// /// Link to the purchased item. - [DataMember(Name = "productUrl", EmitDefaultValue = false)] - public string ProductUrl { get; set; } + [JsonPropertyName("productUrl")] + public string ProductUrl { get { return this.ProductUrlOption; } set { this.ProductUrlOption = new Option(value); } } + + /// + /// Used to track the state of Quantity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option QuantityOption { get; private set; } /// /// Number of items. /// /// Number of items. - [DataMember(Name = "quantity", EmitDefaultValue = false)] - public long? Quantity { get; set; } + [JsonPropertyName("quantity")] + public long? Quantity { get { return this.QuantityOption; } set { this.QuantityOption = new Option(value); } } + + /// + /// Used to track the state of ReceiverEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReceiverEmailOption { get; private set; } /// /// Email associated with the given product in the basket (usually in electronic gift cards). /// /// Email associated with the given product in the basket (usually in electronic gift cards). - [DataMember(Name = "receiverEmail", EmitDefaultValue = false)] - public string ReceiverEmail { get; set; } + [JsonPropertyName("receiverEmail")] + public string ReceiverEmail { get { return this.ReceiverEmailOption; } set { this.ReceiverEmailOption = new Option(value); } } + + /// + /// Used to track the state of Size + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SizeOption { get; private set; } /// /// Size of the item. /// /// Size of the item. - [DataMember(Name = "size", EmitDefaultValue = false)] - public string Size { get; set; } + [JsonPropertyName("size")] + public string Size { get { return this.SizeOption; } set { this.SizeOption = new Option(value); } } + + /// + /// Used to track the state of Sku + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SkuOption { get; private set; } /// /// Stock keeping unit. /// /// Stock keeping unit. - [DataMember(Name = "sku", EmitDefaultValue = false)] - public string Sku { get; set; } + [JsonPropertyName("sku")] + public string Sku { get { return this.SkuOption; } set { this.SkuOption = new Option(value); } } + + /// + /// Used to track the state of TaxAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TaxAmountOption { get; private set; } /// /// Tax amount, in minor units. /// /// Tax amount, in minor units. - [DataMember(Name = "taxAmount", EmitDefaultValue = false)] - public long? TaxAmount { get; set; } + [JsonPropertyName("taxAmount")] + public long? TaxAmount { get { return this.TaxAmountOption; } set { this.TaxAmountOption = new Option(value); } } + + /// + /// Used to track the state of TaxPercentage + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TaxPercentageOption { get; private set; } /// /// Tax percentage, in minor units. /// /// Tax percentage, in minor units. - [DataMember(Name = "taxPercentage", EmitDefaultValue = false)] - public long? TaxPercentage { get; set; } + [JsonPropertyName("taxPercentage")] + public long? TaxPercentage { get { return this.TaxPercentageOption; } set { this.TaxPercentageOption = new Option(value); } } + + /// + /// Used to track the state of Upc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UpcOption { get; private set; } /// /// Universal Product Code. /// /// Universal Product Code. - [DataMember(Name = "upc", EmitDefaultValue = false)] - public string Upc { get; set; } + [JsonPropertyName("upc")] + public string Upc { get { return this.UpcOption; } set { this.UpcOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -232,207 +358,316 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // Description (string) maxLength + if (this.Description != null && this.Description.Length > 10000) + { + yield return new ValidationResult("Invalid value for Description, length must be less than 10000.", new [] { "Description" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as LineItem); + yield break; } + } + /// + /// A Json converter for type + /// + public class LineItemJsonConverter : JsonConverter + { /// - /// Returns true if LineItem instances are equal + /// Deserializes json to /// - /// Instance of LineItem to be compared - /// Boolean - public bool Equals(LineItem input) + /// + /// + /// + /// + /// + public override LineItem Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amountExcludingTax = default; + Option amountIncludingTax = default; + Option brand = default; + Option color = default; + Option description = default; + Option id = default; + Option imageUrl = default; + Option itemCategory = default; + Option manufacturer = default; + Option marketplaceSellerId = default; + Option productUrl = default; + Option quantity = default; + Option receiverEmail = default; + Option size = default; + Option sku = default; + Option taxAmount = default; + Option taxPercentage = default; + Option upc = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amountExcludingTax": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amountExcludingTax = new Option(utf8JsonReader.GetInt64()); + break; + case "amountIncludingTax": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amountIncludingTax = new Option(utf8JsonReader.GetInt64()); + break; + case "brand": + brand = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + case "description": + description = new Option(utf8JsonReader.GetString()); + break; + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "imageUrl": + imageUrl = new Option(utf8JsonReader.GetString()); + break; + case "itemCategory": + itemCategory = new Option(utf8JsonReader.GetString()); + break; + case "manufacturer": + manufacturer = new Option(utf8JsonReader.GetString()); + break; + case "marketplaceSellerId": + marketplaceSellerId = new Option(utf8JsonReader.GetString()); + break; + case "productUrl": + productUrl = new Option(utf8JsonReader.GetString()); + break; + case "quantity": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + quantity = new Option(utf8JsonReader.GetInt64()); + break; + case "receiverEmail": + receiverEmail = new Option(utf8JsonReader.GetString()); + break; + case "size": + size = new Option(utf8JsonReader.GetString()); + break; + case "sku": + sku = new Option(utf8JsonReader.GetString()); + break; + case "taxAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + taxAmount = new Option(utf8JsonReader.GetInt64()); + break; + case "taxPercentage": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + taxPercentage = new Option(utf8JsonReader.GetInt64()); + break; + case "upc": + upc = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AmountExcludingTax == input.AmountExcludingTax || - this.AmountExcludingTax.Equals(input.AmountExcludingTax) - ) && - ( - this.AmountIncludingTax == input.AmountIncludingTax || - this.AmountIncludingTax.Equals(input.AmountIncludingTax) - ) && - ( - this.Brand == input.Brand || - (this.Brand != null && - this.Brand.Equals(input.Brand)) - ) && - ( - this.Color == input.Color || - (this.Color != null && - this.Color.Equals(input.Color)) - ) && - ( - this.Description == input.Description || - (this.Description != null && - this.Description.Equals(input.Description)) - ) && - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.ImageUrl == input.ImageUrl || - (this.ImageUrl != null && - this.ImageUrl.Equals(input.ImageUrl)) - ) && - ( - this.ItemCategory == input.ItemCategory || - (this.ItemCategory != null && - this.ItemCategory.Equals(input.ItemCategory)) - ) && - ( - this.Manufacturer == input.Manufacturer || - (this.Manufacturer != null && - this.Manufacturer.Equals(input.Manufacturer)) - ) && - ( - this.MarketplaceSellerId == input.MarketplaceSellerId || - (this.MarketplaceSellerId != null && - this.MarketplaceSellerId.Equals(input.MarketplaceSellerId)) - ) && - ( - this.ProductUrl == input.ProductUrl || - (this.ProductUrl != null && - this.ProductUrl.Equals(input.ProductUrl)) - ) && - ( - this.Quantity == input.Quantity || - this.Quantity.Equals(input.Quantity) - ) && - ( - this.ReceiverEmail == input.ReceiverEmail || - (this.ReceiverEmail != null && - this.ReceiverEmail.Equals(input.ReceiverEmail)) - ) && - ( - this.Size == input.Size || - (this.Size != null && - this.Size.Equals(input.Size)) - ) && - ( - this.Sku == input.Sku || - (this.Sku != null && - this.Sku.Equals(input.Sku)) - ) && - ( - this.TaxAmount == input.TaxAmount || - this.TaxAmount.Equals(input.TaxAmount) - ) && - ( - this.TaxPercentage == input.TaxPercentage || - this.TaxPercentage.Equals(input.TaxPercentage) - ) && - ( - this.Upc == input.Upc || - (this.Upc != null && - this.Upc.Equals(input.Upc)) - ); + + if (amountExcludingTax.IsSet && amountExcludingTax.Value == null) + throw new ArgumentNullException(nameof(amountExcludingTax), "Property is not nullable for class LineItem."); + + if (amountIncludingTax.IsSet && amountIncludingTax.Value == null) + throw new ArgumentNullException(nameof(amountIncludingTax), "Property is not nullable for class LineItem."); + + if (brand.IsSet && brand.Value == null) + throw new ArgumentNullException(nameof(brand), "Property is not nullable for class LineItem."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class LineItem."); + + if (description.IsSet && description.Value == null) + throw new ArgumentNullException(nameof(description), "Property is not nullable for class LineItem."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class LineItem."); + + if (imageUrl.IsSet && imageUrl.Value == null) + throw new ArgumentNullException(nameof(imageUrl), "Property is not nullable for class LineItem."); + + if (itemCategory.IsSet && itemCategory.Value == null) + throw new ArgumentNullException(nameof(itemCategory), "Property is not nullable for class LineItem."); + + if (manufacturer.IsSet && manufacturer.Value == null) + throw new ArgumentNullException(nameof(manufacturer), "Property is not nullable for class LineItem."); + + if (marketplaceSellerId.IsSet && marketplaceSellerId.Value == null) + throw new ArgumentNullException(nameof(marketplaceSellerId), "Property is not nullable for class LineItem."); + + if (productUrl.IsSet && productUrl.Value == null) + throw new ArgumentNullException(nameof(productUrl), "Property is not nullable for class LineItem."); + + if (quantity.IsSet && quantity.Value == null) + throw new ArgumentNullException(nameof(quantity), "Property is not nullable for class LineItem."); + + if (receiverEmail.IsSet && receiverEmail.Value == null) + throw new ArgumentNullException(nameof(receiverEmail), "Property is not nullable for class LineItem."); + + if (size.IsSet && size.Value == null) + throw new ArgumentNullException(nameof(size), "Property is not nullable for class LineItem."); + + if (sku.IsSet && sku.Value == null) + throw new ArgumentNullException(nameof(sku), "Property is not nullable for class LineItem."); + + if (taxAmount.IsSet && taxAmount.Value == null) + throw new ArgumentNullException(nameof(taxAmount), "Property is not nullable for class LineItem."); + + if (taxPercentage.IsSet && taxPercentage.Value == null) + throw new ArgumentNullException(nameof(taxPercentage), "Property is not nullable for class LineItem."); + + if (upc.IsSet && upc.Value == null) + throw new ArgumentNullException(nameof(upc), "Property is not nullable for class LineItem."); + + return new LineItem(amountExcludingTax, amountIncludingTax, brand, color, description, id, imageUrl, itemCategory, manufacturer, marketplaceSellerId, productUrl, quantity, receiverEmail, size, sku, taxAmount, taxPercentage, upc); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, LineItem lineItem, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.AmountExcludingTax.GetHashCode(); - hashCode = (hashCode * 59) + this.AmountIncludingTax.GetHashCode(); - if (this.Brand != null) - { - hashCode = (hashCode * 59) + this.Brand.GetHashCode(); - } - if (this.Color != null) - { - hashCode = (hashCode * 59) + this.Color.GetHashCode(); - } - if (this.Description != null) - { - hashCode = (hashCode * 59) + this.Description.GetHashCode(); - } - if (this.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - if (this.ImageUrl != null) - { - hashCode = (hashCode * 59) + this.ImageUrl.GetHashCode(); - } - if (this.ItemCategory != null) - { - hashCode = (hashCode * 59) + this.ItemCategory.GetHashCode(); - } - if (this.Manufacturer != null) - { - hashCode = (hashCode * 59) + this.Manufacturer.GetHashCode(); - } - if (this.MarketplaceSellerId != null) - { - hashCode = (hashCode * 59) + this.MarketplaceSellerId.GetHashCode(); - } - if (this.ProductUrl != null) - { - hashCode = (hashCode * 59) + this.ProductUrl.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); - if (this.ReceiverEmail != null) - { - hashCode = (hashCode * 59) + this.ReceiverEmail.GetHashCode(); - } - if (this.Size != null) - { - hashCode = (hashCode * 59) + this.Size.GetHashCode(); - } - if (this.Sku != null) - { - hashCode = (hashCode * 59) + this.Sku.GetHashCode(); - } - hashCode = (hashCode * 59) + this.TaxAmount.GetHashCode(); - hashCode = (hashCode * 59) + this.TaxPercentage.GetHashCode(); - if (this.Upc != null) - { - hashCode = (hashCode * 59) + this.Upc.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, lineItem, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, LineItem lineItem, JsonSerializerOptions jsonSerializerOptions) { - // Description (string) maxLength - if (this.Description != null && this.Description.Length > 10000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Description, length must be less than 10000.", new [] { "Description" }); - } + if (lineItem.BrandOption.IsSet && lineItem.Brand == null) + throw new ArgumentNullException(nameof(lineItem.Brand), "Property is required for class LineItem."); - yield break; + if (lineItem.ColorOption.IsSet && lineItem.Color == null) + throw new ArgumentNullException(nameof(lineItem.Color), "Property is required for class LineItem."); + + if (lineItem.DescriptionOption.IsSet && lineItem.Description == null) + throw new ArgumentNullException(nameof(lineItem.Description), "Property is required for class LineItem."); + + if (lineItem.IdOption.IsSet && lineItem.Id == null) + throw new ArgumentNullException(nameof(lineItem.Id), "Property is required for class LineItem."); + + if (lineItem.ImageUrlOption.IsSet && lineItem.ImageUrl == null) + throw new ArgumentNullException(nameof(lineItem.ImageUrl), "Property is required for class LineItem."); + + if (lineItem.ItemCategoryOption.IsSet && lineItem.ItemCategory == null) + throw new ArgumentNullException(nameof(lineItem.ItemCategory), "Property is required for class LineItem."); + + if (lineItem.ManufacturerOption.IsSet && lineItem.Manufacturer == null) + throw new ArgumentNullException(nameof(lineItem.Manufacturer), "Property is required for class LineItem."); + + if (lineItem.MarketplaceSellerIdOption.IsSet && lineItem.MarketplaceSellerId == null) + throw new ArgumentNullException(nameof(lineItem.MarketplaceSellerId), "Property is required for class LineItem."); + + if (lineItem.ProductUrlOption.IsSet && lineItem.ProductUrl == null) + throw new ArgumentNullException(nameof(lineItem.ProductUrl), "Property is required for class LineItem."); + + if (lineItem.ReceiverEmailOption.IsSet && lineItem.ReceiverEmail == null) + throw new ArgumentNullException(nameof(lineItem.ReceiverEmail), "Property is required for class LineItem."); + + if (lineItem.SizeOption.IsSet && lineItem.Size == null) + throw new ArgumentNullException(nameof(lineItem.Size), "Property is required for class LineItem."); + + if (lineItem.SkuOption.IsSet && lineItem.Sku == null) + throw new ArgumentNullException(nameof(lineItem.Sku), "Property is required for class LineItem."); + + if (lineItem.UpcOption.IsSet && lineItem.Upc == null) + throw new ArgumentNullException(nameof(lineItem.Upc), "Property is required for class LineItem."); + + if (lineItem.AmountExcludingTaxOption.IsSet) + writer.WriteNumber("amountExcludingTax", lineItem.AmountExcludingTaxOption.Value.Value); + + if (lineItem.AmountIncludingTaxOption.IsSet) + writer.WriteNumber("amountIncludingTax", lineItem.AmountIncludingTaxOption.Value.Value); + + if (lineItem.BrandOption.IsSet) + writer.WriteString("brand", lineItem.Brand); + + if (lineItem.ColorOption.IsSet) + writer.WriteString("color", lineItem.Color); + + if (lineItem.DescriptionOption.IsSet) + writer.WriteString("description", lineItem.Description); + + if (lineItem.IdOption.IsSet) + writer.WriteString("id", lineItem.Id); + + if (lineItem.ImageUrlOption.IsSet) + writer.WriteString("imageUrl", lineItem.ImageUrl); + + if (lineItem.ItemCategoryOption.IsSet) + writer.WriteString("itemCategory", lineItem.ItemCategory); + + if (lineItem.ManufacturerOption.IsSet) + writer.WriteString("manufacturer", lineItem.Manufacturer); + + if (lineItem.MarketplaceSellerIdOption.IsSet) + writer.WriteString("marketplaceSellerId", lineItem.MarketplaceSellerId); + + if (lineItem.ProductUrlOption.IsSet) + writer.WriteString("productUrl", lineItem.ProductUrl); + + if (lineItem.QuantityOption.IsSet) + writer.WriteNumber("quantity", lineItem.QuantityOption.Value.Value); + + if (lineItem.ReceiverEmailOption.IsSet) + writer.WriteString("receiverEmail", lineItem.ReceiverEmail); + + if (lineItem.SizeOption.IsSet) + writer.WriteString("size", lineItem.Size); + + if (lineItem.SkuOption.IsSet) + writer.WriteString("sku", lineItem.Sku); + + if (lineItem.TaxAmountOption.IsSet) + writer.WriteNumber("taxAmount", lineItem.TaxAmountOption.Value.Value); + + if (lineItem.TaxPercentageOption.IsSet) + writer.WriteNumber("taxPercentage", lineItem.TaxPercentageOption.Value.Value); + + if (lineItem.UpcOption.IsSet) + writer.WriteString("upc", lineItem.Upc); } } - } diff --git a/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs b/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs index f91f5d14d..a048a4e88 100644 --- a/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs +++ b/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,56 +14,78 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ListStoredPaymentMethodsResponse /// - [DataContract(Name = "ListStoredPaymentMethodsResponse")] - public partial class ListStoredPaymentMethodsResponse : IEquatable, IValidatableObject + public partial class ListStoredPaymentMethodsResponse : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Your merchant account.. - /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address.. - /// List of all stored payment methods.. - public ListStoredPaymentMethodsResponse(string merchantAccount = default(string), string shopperReference = default(string), List storedPaymentMethods = default(List)) + /// Your merchant account. + /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + /// List of all stored payment methods. + [JsonConstructor] + public ListStoredPaymentMethodsResponse(Option merchantAccount = default, Option shopperReference = default, Option> storedPaymentMethods = default) { - this.MerchantAccount = merchantAccount; - this.ShopperReference = shopperReference; - this.StoredPaymentMethods = storedPaymentMethods; + MerchantAccountOption = merchantAccount; + ShopperReferenceOption = shopperReference; + StoredPaymentMethodsOption = storedPaymentMethods; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of MerchantAccount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantAccountOption { get; private set; } + /// /// Your merchant account. /// /// Your merchant account. - [DataMember(Name = "merchantAccount", EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get { return this.MerchantAccountOption; } set { this.MerchantAccountOption = new Option(value); } } + + /// + /// Used to track the state of ShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperReferenceOption { get; private set; } /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - [DataMember(Name = "shopperReference", EmitDefaultValue = false)] - public string ShopperReference { get; set; } + [JsonPropertyName("shopperReference")] + public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethods + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> StoredPaymentMethodsOption { get; private set; } /// /// List of all stored payment methods. /// /// List of all stored payment methods. - [DataMember(Name = "storedPaymentMethods", EmitDefaultValue = false)] - public List StoredPaymentMethods { get; set; } + [JsonPropertyName("storedPaymentMethods")] + public List StoredPaymentMethods { get { return this.StoredPaymentMethodsOption; } set { this.StoredPaymentMethodsOption = new Option>(value); } } /// /// Returns the string presentation of the object @@ -82,87 +103,129 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ListStoredPaymentMethodsResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ListStoredPaymentMethodsResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ListStoredPaymentMethodsResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ListStoredPaymentMethodsResponse instances are equal - /// - /// Instance of ListStoredPaymentMethodsResponse to be compared - /// Boolean - public bool Equals(ListStoredPaymentMethodsResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option merchantAccount = default; + Option shopperReference = default; + Option> storedPaymentMethods = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "shopperReference": + shopperReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + storedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) - ) && - ( - this.StoredPaymentMethods == input.StoredPaymentMethods || - this.StoredPaymentMethods != null && - input.StoredPaymentMethods != null && - this.StoredPaymentMethods.SequenceEqual(input.StoredPaymentMethods) - ); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class ListStoredPaymentMethodsResponse."); + + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class ListStoredPaymentMethodsResponse."); + + if (storedPaymentMethods.IsSet && storedPaymentMethods.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethods), "Property is not nullable for class ListStoredPaymentMethodsResponse."); + + return new ListStoredPaymentMethodsResponse(merchantAccount, shopperReference, storedPaymentMethods); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ListStoredPaymentMethodsResponse listStoredPaymentMethodsResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.ShopperReference != null) - { - hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); - } - if (this.StoredPaymentMethods != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethods.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, listStoredPaymentMethodsResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ListStoredPaymentMethodsResponse listStoredPaymentMethodsResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (listStoredPaymentMethodsResponse.MerchantAccountOption.IsSet && listStoredPaymentMethodsResponse.MerchantAccount == null) + throw new ArgumentNullException(nameof(listStoredPaymentMethodsResponse.MerchantAccount), "Property is required for class ListStoredPaymentMethodsResponse."); + + if (listStoredPaymentMethodsResponse.ShopperReferenceOption.IsSet && listStoredPaymentMethodsResponse.ShopperReference == null) + throw new ArgumentNullException(nameof(listStoredPaymentMethodsResponse.ShopperReference), "Property is required for class ListStoredPaymentMethodsResponse."); + + if (listStoredPaymentMethodsResponse.StoredPaymentMethodsOption.IsSet && listStoredPaymentMethodsResponse.StoredPaymentMethods == null) + throw new ArgumentNullException(nameof(listStoredPaymentMethodsResponse.StoredPaymentMethods), "Property is required for class ListStoredPaymentMethodsResponse."); + + if (listStoredPaymentMethodsResponse.MerchantAccountOption.IsSet) + writer.WriteString("merchantAccount", listStoredPaymentMethodsResponse.MerchantAccount); + + if (listStoredPaymentMethodsResponse.ShopperReferenceOption.IsSet) + writer.WriteString("shopperReference", listStoredPaymentMethodsResponse.ShopperReference); + + if (listStoredPaymentMethodsResponse.StoredPaymentMethodsOption.IsSet) + { + writer.WritePropertyName("storedPaymentMethods"); + JsonSerializer.Serialize(writer, listStoredPaymentMethodsResponse.StoredPaymentMethods, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/Mandate.cs b/Adyen/Model/Checkout/Mandate.cs index 8a41d68e2..eb480047f 100644 --- a/Adyen/Model/Checkout/Mandate.cs +++ b/Adyen/Model/Checkout/Mandate.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,220 +14,452 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Mandate /// - [DataContract(Name = "Mandate")] - public partial class Mandate : IEquatable, IValidatableObject + public partial class Mandate : IValidatableObject { /// - /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + /// Initializes a new instance of the class. /// - /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. - [JsonConverter(typeof(StringEnumConverter))] - public enum AmountRuleEnum + /// The billing amount (in minor units) of the recurring transactions. + /// End date of the billing plan, in YYYY-MM-DD format. + /// The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. + /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + /// The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. + /// The number of transactions that can be performed within the given frequency. + /// The message shown by UPI to the shopper on the approval screen. + /// Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date. + [JsonConstructor] + public Mandate(string amount, string endsAt, FrequencyEnum frequency, Option amountRule = default, Option billingAttemptsRule = default, Option billingDay = default, Option count = default, Option remarks = default, Option startsAt = default) { - /// - /// Enum Max for value: max - /// - [EnumMember(Value = "max")] - Max = 1, - - /// - /// Enum Exact for value: exact - /// - [EnumMember(Value = "exact")] - Exact = 2 - + Amount = amount; + EndsAt = endsAt; + Frequency = frequency; + AmountRuleOption = amountRule; + BillingAttemptsRuleOption = billingAttemptsRule; + BillingDayOption = billingDay; + CountOption = count; + RemarksOption = remarks; + StartsAtOption = startsAt; + OnCreated(); } + partial void OnCreated(); - /// - /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. - /// - /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. - [DataMember(Name = "amountRule", EmitDefaultValue = false)] - public AmountRuleEnum? AmountRule { get; set; } - /// - /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. - /// - /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. - [JsonConverter(typeof(StringEnumConverter))] - public enum BillingAttemptsRuleEnum - { - /// - /// Enum On for value: on - /// - [EnumMember(Value = "on")] - On = 1, - - /// - /// Enum Before for value: before - /// - [EnumMember(Value = "before")] - Before = 2, - - /// - /// Enum After for value: after - /// - [EnumMember(Value = "after")] - After = 3 - - } - - - /// - /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. - /// - /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. - [DataMember(Name = "billingAttemptsRule", EmitDefaultValue = false)] - public BillingAttemptsRuleEnum? BillingAttemptsRule { get; set; } /// /// The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. /// /// The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. - [JsonConverter(typeof(StringEnumConverter))] public enum FrequencyEnum { /// /// Enum Adhoc for value: adhoc /// - [EnumMember(Value = "adhoc")] Adhoc = 1, /// /// Enum Daily for value: daily /// - [EnumMember(Value = "daily")] Daily = 2, /// /// Enum Weekly for value: weekly /// - [EnumMember(Value = "weekly")] Weekly = 3, /// /// Enum BiWeekly for value: biWeekly /// - [EnumMember(Value = "biWeekly")] BiWeekly = 4, /// /// Enum Monthly for value: monthly /// - [EnumMember(Value = "monthly")] Monthly = 5, /// /// Enum Quarterly for value: quarterly /// - [EnumMember(Value = "quarterly")] Quarterly = 6, /// /// Enum HalfYearly for value: halfYearly /// - [EnumMember(Value = "halfYearly")] HalfYearly = 7, /// /// Enum Yearly for value: yearly /// - [EnumMember(Value = "yearly")] Yearly = 8 + } + + /// + /// Returns a + /// + /// + /// + /// + public static FrequencyEnum FrequencyEnumFromString(string value) + { + if (value.Equals("adhoc")) + return FrequencyEnum.Adhoc; + if (value.Equals("daily")) + return FrequencyEnum.Daily; + + if (value.Equals("weekly")) + return FrequencyEnum.Weekly; + + if (value.Equals("biWeekly")) + return FrequencyEnum.BiWeekly; + + if (value.Equals("monthly")) + return FrequencyEnum.Monthly; + + if (value.Equals("quarterly")) + return FrequencyEnum.Quarterly; + + if (value.Equals("halfYearly")) + return FrequencyEnum.HalfYearly; + + if (value.Equals("yearly")) + return FrequencyEnum.Yearly; + + throw new NotImplementedException($"Could not convert value to type FrequencyEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static FrequencyEnum? FrequencyEnumFromStringOrDefault(string value) + { + if (value.Equals("adhoc")) + return FrequencyEnum.Adhoc; + + if (value.Equals("daily")) + return FrequencyEnum.Daily; + + if (value.Equals("weekly")) + return FrequencyEnum.Weekly; + + if (value.Equals("biWeekly")) + return FrequencyEnum.BiWeekly; + + if (value.Equals("monthly")) + return FrequencyEnum.Monthly; + + if (value.Equals("quarterly")) + return FrequencyEnum.Quarterly; + + if (value.Equals("halfYearly")) + return FrequencyEnum.HalfYearly; + + if (value.Equals("yearly")) + return FrequencyEnum.Yearly; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FrequencyEnumToJsonValue(FrequencyEnum value) + { + if (value == FrequencyEnum.Adhoc) + return "adhoc"; + + if (value == FrequencyEnum.Daily) + return "daily"; + + if (value == FrequencyEnum.Weekly) + return "weekly"; + + if (value == FrequencyEnum.BiWeekly) + return "biWeekly"; + + if (value == FrequencyEnum.Monthly) + return "monthly"; + + if (value == FrequencyEnum.Quarterly) + return "quarterly"; + + if (value == FrequencyEnum.HalfYearly) + return "halfYearly"; + + if (value == FrequencyEnum.Yearly) + return "yearly"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. /// /// The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. - [DataMember(Name = "frequency", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("frequency")] public FrequencyEnum Frequency { get; set; } + /// - /// Initializes a new instance of the class. + /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + /// + /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + public enum AmountRuleEnum + { + /// + /// Enum Max for value: max + /// + Max = 1, + + /// + /// Enum Exact for value: exact + /// + Exact = 2 + } + + /// + /// Returns a /// - [JsonConstructorAttribute] - protected Mandate() { } + /// + /// + /// + public static AmountRuleEnum AmountRuleEnumFromString(string value) + { + if (value.Equals("max")) + return AmountRuleEnum.Max; + + if (value.Equals("exact")) + return AmountRuleEnum.Exact; + + throw new NotImplementedException($"Could not convert value to type AmountRuleEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - /// The billing amount (in minor units) of the recurring transactions. (required). - /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. . - /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. . - /// The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`.. - /// The number of transactions that can be performed within the given frequency.. - /// End date of the billing plan, in YYYY-MM-DD format. (required). - /// The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. (required). - /// The message shown by UPI to the shopper on the approval screen.. - /// Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date.. - public Mandate(string amount = default(string), AmountRuleEnum? amountRule = default(AmountRuleEnum?), BillingAttemptsRuleEnum? billingAttemptsRule = default(BillingAttemptsRuleEnum?), string billingDay = default(string), string count = default(string), string endsAt = default(string), FrequencyEnum frequency = default(FrequencyEnum), string remarks = default(string), string startsAt = default(string)) + /// + /// + public static AmountRuleEnum? AmountRuleEnumFromStringOrDefault(string value) { - this.Amount = amount; - this.EndsAt = endsAt; - this.Frequency = frequency; - this.AmountRule = amountRule; - this.BillingAttemptsRule = billingAttemptsRule; - this.BillingDay = billingDay; - this.Count = count; - this.Remarks = remarks; - this.StartsAt = startsAt; + if (value.Equals("max")) + return AmountRuleEnum.Max; + + if (value.Equals("exact")) + return AmountRuleEnum.Exact; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string AmountRuleEnumToJsonValue(AmountRuleEnum? value) + { + if (value == AmountRuleEnum.Max) + return "max"; + + if (value == AmountRuleEnum.Exact) + return "exact"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of AmountRule + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountRuleOption { get; private set; } + + /// + /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + /// + /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + [JsonPropertyName("amountRule")] + public AmountRuleEnum? AmountRule { get { return this.AmountRuleOption; } set { this.AmountRuleOption = new Option(value); } } + + /// + /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + /// + /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + public enum BillingAttemptsRuleEnum + { + /// + /// Enum On for value: on + /// + On = 1, + + /// + /// Enum Before for value: before + /// + Before = 2, + + /// + /// Enum After for value: after + /// + After = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static BillingAttemptsRuleEnum BillingAttemptsRuleEnumFromString(string value) + { + if (value.Equals("on")) + return BillingAttemptsRuleEnum.On; + + if (value.Equals("before")) + return BillingAttemptsRuleEnum.Before; + + if (value.Equals("after")) + return BillingAttemptsRuleEnum.After; + + throw new NotImplementedException($"Could not convert value to type BillingAttemptsRuleEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static BillingAttemptsRuleEnum? BillingAttemptsRuleEnumFromStringOrDefault(string value) + { + if (value.Equals("on")) + return BillingAttemptsRuleEnum.On; + + if (value.Equals("before")) + return BillingAttemptsRuleEnum.Before; + + if (value.Equals("after")) + return BillingAttemptsRuleEnum.After; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string BillingAttemptsRuleEnumToJsonValue(BillingAttemptsRuleEnum? value) + { + if (value == BillingAttemptsRuleEnum.On) + return "on"; + + if (value == BillingAttemptsRuleEnum.Before) + return "before"; + + if (value == BillingAttemptsRuleEnum.After) + return "after"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of BillingAttemptsRule + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAttemptsRuleOption { get; private set; } + + /// + /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + /// + /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + [JsonPropertyName("billingAttemptsRule")] + public BillingAttemptsRuleEnum? BillingAttemptsRule { get { return this.BillingAttemptsRuleOption; } set { this.BillingAttemptsRuleOption = new Option(value); } } + /// /// The billing amount (in minor units) of the recurring transactions. /// /// The billing amount (in minor units) of the recurring transactions. - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("amount")] public string Amount { get; set; } + /// + /// End date of the billing plan, in YYYY-MM-DD format. + /// + /// End date of the billing plan, in YYYY-MM-DD format. + [JsonPropertyName("endsAt")] + public string EndsAt { get; set; } + + /// + /// Used to track the state of BillingDay + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingDayOption { get; private set; } + /// /// The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. /// /// The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. - [DataMember(Name = "billingDay", EmitDefaultValue = false)] - public string BillingDay { get; set; } + [JsonPropertyName("billingDay")] + public string BillingDay { get { return this.BillingDayOption; } set { this.BillingDayOption = new Option(value); } } + + /// + /// Used to track the state of Count + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CountOption { get; private set; } /// /// The number of transactions that can be performed within the given frequency. /// /// The number of transactions that can be performed within the given frequency. - [DataMember(Name = "count", EmitDefaultValue = false)] - public string Count { get; set; } + [JsonPropertyName("count")] + public string Count { get { return this.CountOption; } set { this.CountOption = new Option(value); } } /// - /// End date of the billing plan, in YYYY-MM-DD format. + /// Used to track the state of Remarks /// - /// End date of the billing plan, in YYYY-MM-DD format. - [DataMember(Name = "endsAt", IsRequired = false, EmitDefaultValue = false)] - public string EndsAt { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RemarksOption { get; private set; } /// /// The message shown by UPI to the shopper on the approval screen. /// /// The message shown by UPI to the shopper on the approval screen. - [DataMember(Name = "remarks", EmitDefaultValue = false)] - public string Remarks { get; set; } + [JsonPropertyName("remarks")] + public string Remarks { get { return this.RemarksOption; } set { this.RemarksOption = new Option(value); } } + + /// + /// Used to track the state of StartsAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StartsAtOption { get; private set; } /// /// Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date. /// /// Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date. - [DataMember(Name = "startsAt", EmitDefaultValue = false)] - public string StartsAt { get; set; } + [JsonPropertyName("startsAt")] + public string StartsAt { get { return this.StartsAtOption; } set { this.StartsAtOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -239,12 +470,12 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class Mandate {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" EndsAt: ").Append(EndsAt).Append("\n"); + sb.Append(" Frequency: ").Append(Frequency).Append("\n"); sb.Append(" AmountRule: ").Append(AmountRule).Append("\n"); sb.Append(" BillingAttemptsRule: ").Append(BillingAttemptsRule).Append("\n"); sb.Append(" BillingDay: ").Append(BillingDay).Append("\n"); sb.Append(" Count: ").Append(Count).Append("\n"); - sb.Append(" EndsAt: ").Append(EndsAt).Append("\n"); - sb.Append(" Frequency: ").Append(Frequency).Append("\n"); sb.Append(" Remarks: ").Append(Remarks).Append("\n"); sb.Append(" StartsAt: ").Append(StartsAt).Append("\n"); sb.Append("}\n"); @@ -252,128 +483,204 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class MandateJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override Mandate Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as Mandate); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if Mandate instances are equal - /// - /// Instance of Mandate to be compared - /// Boolean - public bool Equals(Mandate input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option endsAt = default; + Option frequency = default; + Option amountRule = default; + Option billingAttemptsRule = default; + Option billingDay = default; + Option count = default; + Option remarks = default; + Option startsAt = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + amount = new Option(utf8JsonReader.GetString()); + break; + case "endsAt": + endsAt = new Option(utf8JsonReader.GetString()); + break; + case "frequency": + string frequencyRawValue = utf8JsonReader.GetString(); + if (frequencyRawValue != null) + frequency = new Option(Mandate.FrequencyEnumFromStringOrDefault(frequencyRawValue)); + break; + case "amountRule": + string amountRuleRawValue = utf8JsonReader.GetString(); + if (amountRuleRawValue != null) + amountRule = new Option(Mandate.AmountRuleEnumFromStringOrDefault(amountRuleRawValue)); + break; + case "billingAttemptsRule": + string billingAttemptsRuleRawValue = utf8JsonReader.GetString(); + if (billingAttemptsRuleRawValue != null) + billingAttemptsRule = new Option(Mandate.BillingAttemptsRuleEnumFromStringOrDefault(billingAttemptsRuleRawValue)); + break; + case "billingDay": + billingDay = new Option(utf8JsonReader.GetString()); + break; + case "count": + count = new Option(utf8JsonReader.GetString()); + break; + case "remarks": + remarks = new Option(utf8JsonReader.GetString()); + break; + case "startsAt": + startsAt = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.AmountRule == input.AmountRule || - this.AmountRule.Equals(input.AmountRule) - ) && - ( - this.BillingAttemptsRule == input.BillingAttemptsRule || - this.BillingAttemptsRule.Equals(input.BillingAttemptsRule) - ) && - ( - this.BillingDay == input.BillingDay || - (this.BillingDay != null && - this.BillingDay.Equals(input.BillingDay)) - ) && - ( - this.Count == input.Count || - (this.Count != null && - this.Count.Equals(input.Count)) - ) && - ( - this.EndsAt == input.EndsAt || - (this.EndsAt != null && - this.EndsAt.Equals(input.EndsAt)) - ) && - ( - this.Frequency == input.Frequency || - this.Frequency.Equals(input.Frequency) - ) && - ( - this.Remarks == input.Remarks || - (this.Remarks != null && - this.Remarks.Equals(input.Remarks)) - ) && - ( - this.StartsAt == input.StartsAt || - (this.StartsAt != null && - this.StartsAt.Equals(input.StartsAt)) - ); + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class Mandate.", nameof(amount)); + + if (!endsAt.IsSet) + throw new ArgumentException("Property is required for class Mandate.", nameof(endsAt)); + + if (!frequency.IsSet) + throw new ArgumentException("Property is required for class Mandate.", nameof(frequency)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class Mandate."); + + if (endsAt.IsSet && endsAt.Value == null) + throw new ArgumentNullException(nameof(endsAt), "Property is not nullable for class Mandate."); + + if (frequency.IsSet && frequency.Value == null) + throw new ArgumentNullException(nameof(frequency), "Property is not nullable for class Mandate."); + + if (amountRule.IsSet && amountRule.Value == null) + throw new ArgumentNullException(nameof(amountRule), "Property is not nullable for class Mandate."); + + if (billingAttemptsRule.IsSet && billingAttemptsRule.Value == null) + throw new ArgumentNullException(nameof(billingAttemptsRule), "Property is not nullable for class Mandate."); + + if (billingDay.IsSet && billingDay.Value == null) + throw new ArgumentNullException(nameof(billingDay), "Property is not nullable for class Mandate."); + + if (count.IsSet && count.Value == null) + throw new ArgumentNullException(nameof(count), "Property is not nullable for class Mandate."); + + if (remarks.IsSet && remarks.Value == null) + throw new ArgumentNullException(nameof(remarks), "Property is not nullable for class Mandate."); + + if (startsAt.IsSet && startsAt.Value == null) + throw new ArgumentNullException(nameof(startsAt), "Property is not nullable for class Mandate."); + + return new Mandate(amount.Value, endsAt.Value, frequency.Value.Value, amountRule, billingAttemptsRule, billingDay, count, remarks, startsAt); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Mandate mandate, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - hashCode = (hashCode * 59) + this.AmountRule.GetHashCode(); - hashCode = (hashCode * 59) + this.BillingAttemptsRule.GetHashCode(); - if (this.BillingDay != null) - { - hashCode = (hashCode * 59) + this.BillingDay.GetHashCode(); - } - if (this.Count != null) - { - hashCode = (hashCode * 59) + this.Count.GetHashCode(); - } - if (this.EndsAt != null) - { - hashCode = (hashCode * 59) + this.EndsAt.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Frequency.GetHashCode(); - if (this.Remarks != null) - { - hashCode = (hashCode * 59) + this.Remarks.GetHashCode(); - } - if (this.StartsAt != null) - { - hashCode = (hashCode * 59) + this.StartsAt.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, mandate, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Mandate mandate, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (mandate.Amount == null) + throw new ArgumentNullException(nameof(mandate.Amount), "Property is required for class Mandate."); + + if (mandate.EndsAt == null) + throw new ArgumentNullException(nameof(mandate.EndsAt), "Property is required for class Mandate."); + + if (mandate.BillingDayOption.IsSet && mandate.BillingDay == null) + throw new ArgumentNullException(nameof(mandate.BillingDay), "Property is required for class Mandate."); + + if (mandate.CountOption.IsSet && mandate.Count == null) + throw new ArgumentNullException(nameof(mandate.Count), "Property is required for class Mandate."); + + if (mandate.RemarksOption.IsSet && mandate.Remarks == null) + throw new ArgumentNullException(nameof(mandate.Remarks), "Property is required for class Mandate."); + + if (mandate.StartsAtOption.IsSet && mandate.StartsAt == null) + throw new ArgumentNullException(nameof(mandate.StartsAt), "Property is required for class Mandate."); + + writer.WriteString("amount", mandate.Amount); + + writer.WriteString("endsAt", mandate.EndsAt); + + var frequencyRawValue = Mandate.FrequencyEnumToJsonValue(mandate.Frequency); + writer.WriteString("frequency", frequencyRawValue); + var amountRuleRawValue = Mandate.AmountRuleEnumToJsonValue(mandate.AmountRuleOption.Value.Value); + writer.WriteString("amountRule", amountRuleRawValue); + var billingAttemptsRuleRawValue = Mandate.BillingAttemptsRuleEnumToJsonValue(mandate.BillingAttemptsRuleOption.Value.Value); + writer.WriteString("billingAttemptsRule", billingAttemptsRuleRawValue); + if (mandate.BillingDayOption.IsSet) + writer.WriteString("billingDay", mandate.BillingDay); + + if (mandate.CountOption.IsSet) + writer.WriteString("count", mandate.Count); + + if (mandate.RemarksOption.IsSet) + writer.WriteString("remarks", mandate.Remarks); + + if (mandate.StartsAtOption.IsSet) + writer.WriteString("startsAt", mandate.StartsAt); } } - } diff --git a/Adyen/Model/Checkout/MasterpassDetails.cs b/Adyen/Model/Checkout/MasterpassDetails.cs index c78db8bd8..a483c3a5e 100644 --- a/Adyen/Model/Checkout/MasterpassDetails.cs +++ b/Adyen/Model/Checkout/MasterpassDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,107 +14,208 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// MasterpassDetails /// - [DataContract(Name = "MasterpassDetails")] - public partial class MasterpassDetails : IEquatable, IValidatableObject + public partial class MasterpassDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The Masterpass transaction ID. + /// The checkout attempt identifier. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + /// **masterpass** (default to TypeEnum.Masterpass) + [JsonConstructor] + public MasterpassDetails(string masterpassTransactionId, Option checkoutAttemptId = default, Option fundingSource = default, Option type = default) + { + MasterpassTransactionId = masterpassTransactionId; + CheckoutAttemptIdOption = checkoutAttemptId; + FundingSourceOption = fundingSource; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// - [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// - [EnumMember(Value = "debit")] Debit = 2 + } + /// + /// Returns a + /// + /// + /// + /// + public static FundingSourceEnum FundingSourceEnumFromString(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) + { + if (value == FundingSourceEnum.Credit) + return "credit"; + + if (value == FundingSourceEnum.Debit) + return "debit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public FundingSourceEnum? FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + /// /// **masterpass** /// /// **masterpass** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Masterpass for value: masterpass /// - [EnumMember(Value = "masterpass")] Masterpass = 1 - } - /// - /// **masterpass** + /// Returns a /// - /// **masterpass** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("masterpass")) + return TypeEnum.Masterpass; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected MasterpassDetails() { } + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("masterpass")) + return TypeEnum.Masterpass; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The checkout attempt identifier.. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. - /// The Masterpass transaction ID. (required). - /// **masterpass** (default to TypeEnum.Masterpass). - public MasterpassDetails(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string masterpassTransactionId = default(string), TypeEnum? type = TypeEnum.Masterpass) + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) { - this.MasterpassTransactionId = masterpassTransactionId; - this.CheckoutAttemptId = checkoutAttemptId; - this.FundingSource = fundingSource; - this.Type = type; + if (value == TypeEnum.Masterpass) + return "masterpass"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// The checkout attempt identifier. + /// Used to track the state of Type /// - /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } + + /// + /// **masterpass** + /// + /// **masterpass** + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } /// /// The Masterpass transaction ID. /// /// The Masterpass transaction ID. - [DataMember(Name = "masterpassTransactionId", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("masterpassTransactionId")] public string MasterpassTransactionId { get; set; } + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } + + /// + /// The checkout attempt identifier. + /// + /// The checkout attempt identifier. + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -124,96 +224,146 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class MasterpassDetails {\n"); + sb.Append(" MasterpassTransactionId: ").Append(MasterpassTransactionId).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); - sb.Append(" MasterpassTransactionId: ").Append(MasterpassTransactionId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class MasterpassDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override MasterpassDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as MasterpassDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if MasterpassDetails instances are equal - /// - /// Instance of MasterpassDetails to be compared - /// Boolean - public bool Equals(MasterpassDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option masterpassTransactionId = default; + Option checkoutAttemptId = default; + Option fundingSource = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "masterpassTransactionId": + masterpassTransactionId = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "fundingSource": + string fundingSourceRawValue = utf8JsonReader.GetString(); + if (fundingSourceRawValue != null) + fundingSource = new Option(MasterpassDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(MasterpassDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.FundingSource == input.FundingSource || - this.FundingSource.Equals(input.FundingSource) - ) && - ( - this.MasterpassTransactionId == input.MasterpassTransactionId || - (this.MasterpassTransactionId != null && - this.MasterpassTransactionId.Equals(input.MasterpassTransactionId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!masterpassTransactionId.IsSet) + throw new ArgumentException("Property is required for class MasterpassDetails.", nameof(masterpassTransactionId)); + + if (masterpassTransactionId.IsSet && masterpassTransactionId.Value == null) + throw new ArgumentNullException(nameof(masterpassTransactionId), "Property is not nullable for class MasterpassDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class MasterpassDetails."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class MasterpassDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class MasterpassDetails."); + + return new MasterpassDetails(masterpassTransactionId.Value, checkoutAttemptId, fundingSource, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MasterpassDetails masterpassDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - if (this.MasterpassTransactionId != null) - { - hashCode = (hashCode * 59) + this.MasterpassTransactionId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, masterpassDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MasterpassDetails masterpassDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (masterpassDetails.MasterpassTransactionId == null) + throw new ArgumentNullException(nameof(masterpassDetails.MasterpassTransactionId), "Property is required for class MasterpassDetails."); + + if (masterpassDetails.CheckoutAttemptIdOption.IsSet && masterpassDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(masterpassDetails.CheckoutAttemptId), "Property is required for class MasterpassDetails."); + + writer.WriteString("masterpassTransactionId", masterpassDetails.MasterpassTransactionId); + + if (masterpassDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", masterpassDetails.CheckoutAttemptId); + + var fundingSourceRawValue = MasterpassDetails.FundingSourceEnumToJsonValue(masterpassDetails.FundingSourceOption.Value.Value); + writer.WriteString("fundingSource", fundingSourceRawValue); + var typeRawValue = MasterpassDetails.TypeEnumToJsonValue(masterpassDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/MbwayDetails.cs b/Adyen/Model/Checkout/MbwayDetails.cs index 01098eacb..33b4a39c6 100644 --- a/Adyen/Model/Checkout/MbwayDetails.cs +++ b/Adyen/Model/Checkout/MbwayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,84 +14,132 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// MbwayDetails /// - [DataContract(Name = "MbwayDetails")] - public partial class MbwayDetails : IEquatable, IValidatableObject + public partial class MbwayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// shopperEmail + /// telephoneNumber + /// The checkout attempt identifier. + /// **mbway** (default to TypeEnum.Mbway) + [JsonConstructor] + public MbwayDetails(string shopperEmail, string telephoneNumber, Option checkoutAttemptId = default, Option type = default) + { + ShopperEmail = shopperEmail; + TelephoneNumber = telephoneNumber; + CheckoutAttemptIdOption = checkoutAttemptId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **mbway** /// /// **mbway** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Mbway for value: mbway /// - [EnumMember(Value = "mbway")] Mbway = 1 - } - /// - /// **mbway** + /// Returns a /// - /// **mbway** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("mbway")) + return TypeEnum.Mbway; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected MbwayDetails() { } + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("mbway")) + return TypeEnum.Mbway; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The checkout attempt identifier.. - /// shopperEmail (required). - /// telephoneNumber (required). - /// **mbway** (default to TypeEnum.Mbway). - public MbwayDetails(string checkoutAttemptId = default(string), string shopperEmail = default(string), string telephoneNumber = default(string), TypeEnum? type = TypeEnum.Mbway) + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) { - this.ShopperEmail = shopperEmail; - this.TelephoneNumber = telephoneNumber; - this.CheckoutAttemptId = checkoutAttemptId; - this.Type = type; + if (value == TypeEnum.Mbway) + return "mbway"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// The checkout attempt identifier. + /// Used to track the state of Type /// - /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } + + /// + /// **mbway** + /// + /// **mbway** + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } /// /// Gets or Sets ShopperEmail /// - [DataMember(Name = "shopperEmail", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("shopperEmail")] public string ShopperEmail { get; set; } /// /// Gets or Sets TelephoneNumber /// - [DataMember(Name = "telephoneNumber", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("telephoneNumber")] public string TelephoneNumber { get; set; } + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } + + /// + /// The checkout attempt identifier. + /// + /// The checkout attempt identifier. + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -101,100 +148,150 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class MbwayDetails {\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class MbwayDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override MbwayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as MbwayDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if MbwayDetails instances are equal - /// - /// Instance of MbwayDetails to be compared - /// Boolean - public bool Equals(MbwayDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option shopperEmail = default; + Option telephoneNumber = default; + Option checkoutAttemptId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "telephoneNumber": + telephoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(MbwayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!shopperEmail.IsSet) + throw new ArgumentException("Property is required for class MbwayDetails.", nameof(shopperEmail)); + + if (!telephoneNumber.IsSet) + throw new ArgumentException("Property is required for class MbwayDetails.", nameof(telephoneNumber)); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class MbwayDetails."); + + if (telephoneNumber.IsSet && telephoneNumber.Value == null) + throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class MbwayDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class MbwayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class MbwayDetails."); + + return new MbwayDetails(shopperEmail.Value, telephoneNumber.Value, checkoutAttemptId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MbwayDetails mbwayDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.TelephoneNumber != null) - { - hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, mbwayDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MbwayDetails mbwayDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (mbwayDetails.ShopperEmail == null) + throw new ArgumentNullException(nameof(mbwayDetails.ShopperEmail), "Property is required for class MbwayDetails."); + + if (mbwayDetails.TelephoneNumber == null) + throw new ArgumentNullException(nameof(mbwayDetails.TelephoneNumber), "Property is required for class MbwayDetails."); + + if (mbwayDetails.CheckoutAttemptIdOption.IsSet && mbwayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(mbwayDetails.CheckoutAttemptId), "Property is required for class MbwayDetails."); + + writer.WriteString("shopperEmail", mbwayDetails.ShopperEmail); + + writer.WriteString("telephoneNumber", mbwayDetails.TelephoneNumber); + + if (mbwayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", mbwayDetails.CheckoutAttemptId); + + var typeRawValue = MbwayDetails.TypeEnumToJsonValue(mbwayDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/MerchantDevice.cs b/Adyen/Model/Checkout/MerchantDevice.cs index 099896191..d0cd99e99 100644 --- a/Adyen/Model/Checkout/MerchantDevice.cs +++ b/Adyen/Model/Checkout/MerchantDevice.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,56 +14,78 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// MerchantDevice /// - [DataContract(Name = "MerchantDevice")] - public partial class MerchantDevice : IEquatable, IValidatableObject + public partial class MerchantDevice : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Operating system running on the merchant device.. - /// Version of the operating system on the merchant device.. - /// Merchant device reference.. - public MerchantDevice(string os = default(string), string osVersion = default(string), string reference = default(string)) + /// Operating system running on the merchant device. + /// Version of the operating system on the merchant device. + /// Merchant device reference. + [JsonConstructor] + public MerchantDevice(Option os = default, Option osVersion = default, Option reference = default) { - this.Os = os; - this.OsVersion = osVersion; - this.Reference = reference; + OsOption = os; + OsVersionOption = osVersion; + ReferenceOption = reference; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Os + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OsOption { get; private set; } + /// /// Operating system running on the merchant device. /// /// Operating system running on the merchant device. - [DataMember(Name = "os", EmitDefaultValue = false)] - public string Os { get; set; } + [JsonPropertyName("os")] + public string Os { get { return this.OsOption; } set { this.OsOption = new Option(value); } } + + /// + /// Used to track the state of OsVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OsVersionOption { get; private set; } /// /// Version of the operating system on the merchant device. /// /// Version of the operating system on the merchant device. - [DataMember(Name = "osVersion", EmitDefaultValue = false)] - public string OsVersion { get; set; } + [JsonPropertyName("osVersion")] + public string OsVersion { get { return this.OsVersionOption; } set { this.OsVersionOption = new Option(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// Merchant device reference. /// /// Merchant device reference. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -82,86 +103,125 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class MerchantDeviceJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override MerchantDevice Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as MerchantDevice); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if MerchantDevice instances are equal - /// - /// Instance of MerchantDevice to be compared - /// Boolean - public bool Equals(MerchantDevice input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option os = default; + Option osVersion = default; + Option reference = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "os": + os = new Option(utf8JsonReader.GetString()); + break; + case "osVersion": + osVersion = new Option(utf8JsonReader.GetString()); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Os == input.Os || - (this.Os != null && - this.Os.Equals(input.Os)) - ) && - ( - this.OsVersion == input.OsVersion || - (this.OsVersion != null && - this.OsVersion.Equals(input.OsVersion)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ); + + if (os.IsSet && os.Value == null) + throw new ArgumentNullException(nameof(os), "Property is not nullable for class MerchantDevice."); + + if (osVersion.IsSet && osVersion.Value == null) + throw new ArgumentNullException(nameof(osVersion), "Property is not nullable for class MerchantDevice."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class MerchantDevice."); + + return new MerchantDevice(os, osVersion, reference); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MerchantDevice merchantDevice, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Os != null) - { - hashCode = (hashCode * 59) + this.Os.GetHashCode(); - } - if (this.OsVersion != null) - { - hashCode = (hashCode * 59) + this.OsVersion.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, merchantDevice, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MerchantDevice merchantDevice, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (merchantDevice.OsOption.IsSet && merchantDevice.Os == null) + throw new ArgumentNullException(nameof(merchantDevice.Os), "Property is required for class MerchantDevice."); + + if (merchantDevice.OsVersionOption.IsSet && merchantDevice.OsVersion == null) + throw new ArgumentNullException(nameof(merchantDevice.OsVersion), "Property is required for class MerchantDevice."); + + if (merchantDevice.ReferenceOption.IsSet && merchantDevice.Reference == null) + throw new ArgumentNullException(nameof(merchantDevice.Reference), "Property is required for class MerchantDevice."); + + if (merchantDevice.OsOption.IsSet) + writer.WriteString("os", merchantDevice.Os); + + if (merchantDevice.OsVersionOption.IsSet) + writer.WriteString("osVersion", merchantDevice.OsVersion); + + if (merchantDevice.ReferenceOption.IsSet) + writer.WriteString("reference", merchantDevice.Reference); } } - } diff --git a/Adyen/Model/Checkout/MerchantRiskIndicator.cs b/Adyen/Model/Checkout/MerchantRiskIndicator.cs index 0c4728a09..1d5bdbff5 100644 --- a/Adyen/Model/Checkout/MerchantRiskIndicator.cs +++ b/Adyen/Model/Checkout/MerchantRiskIndicator.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,239 +14,486 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// MerchantRiskIndicator /// - [DataContract(Name = "MerchantRiskIndicator")] - public partial class MerchantRiskIndicator : IEquatable, IValidatableObject + public partial class MerchantRiskIndicator : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Whether the chosen delivery address is identical to the billing address. + /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` + /// The delivery email address (for digital goods). + /// For Electronic delivery, the email address to which the merchandise was delivered. Maximum length: 254 characters. + /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` + /// giftCardAmount + /// For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. + /// For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. + /// For pre-order purchases, the expected date this product will be available to the shopper. + /// Indicator for whether this transaction is for pre-ordering a product. + /// Indicates whether Cardholder is placing an order for merchandise with a future availability or release date. + /// Indicator for whether the shopper has already purchased the same items in the past. + /// Indicates whether the cardholder is reordering previously purchased merchandise. + /// Indicates shipping method chosen for the transaction. + [JsonConstructor] + public MerchantRiskIndicator(Option addressMatch = default, Option deliveryAddressIndicator = default, Option deliveryEmail = default, Option deliveryEmailAddress = default, Option deliveryTimeframe = default, Option giftCardAmount = default, Option giftCardCount = default, Option giftCardCurr = default, Option preOrderDate = default, Option preOrderPurchase = default, Option preOrderPurchaseInd = default, Option reorderItems = default, Option reorderItemsInd = default, Option shipIndicator = default) + { + AddressMatchOption = addressMatch; + DeliveryAddressIndicatorOption = deliveryAddressIndicator; + DeliveryEmailOption = deliveryEmail; + DeliveryEmailAddressOption = deliveryEmailAddress; + DeliveryTimeframeOption = deliveryTimeframe; + GiftCardAmountOption = giftCardAmount; + GiftCardCountOption = giftCardCount; + GiftCardCurrOption = giftCardCurr; + PreOrderDateOption = preOrderDate; + PreOrderPurchaseOption = preOrderPurchase; + PreOrderPurchaseIndOption = preOrderPurchaseInd; + ReorderItemsOption = reorderItems; + ReorderItemsIndOption = reorderItemsInd; + ShipIndicatorOption = shipIndicator; + OnCreated(); + } + + partial void OnCreated(); + /// /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` /// /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` - [JsonConverter(typeof(StringEnumConverter))] public enum DeliveryAddressIndicatorEnum { /// /// Enum ShipToBillingAddress for value: shipToBillingAddress /// - [EnumMember(Value = "shipToBillingAddress")] ShipToBillingAddress = 1, /// /// Enum ShipToVerifiedAddress for value: shipToVerifiedAddress /// - [EnumMember(Value = "shipToVerifiedAddress")] ShipToVerifiedAddress = 2, /// /// Enum ShipToNewAddress for value: shipToNewAddress /// - [EnumMember(Value = "shipToNewAddress")] ShipToNewAddress = 3, /// /// Enum ShipToStore for value: shipToStore /// - [EnumMember(Value = "shipToStore")] ShipToStore = 4, /// /// Enum DigitalGoods for value: digitalGoods /// - [EnumMember(Value = "digitalGoods")] DigitalGoods = 5, /// /// Enum GoodsNotShipped for value: goodsNotShipped /// - [EnumMember(Value = "goodsNotShipped")] GoodsNotShipped = 6, /// /// Enum Other for value: other /// - [EnumMember(Value = "other")] Other = 7 + } + + /// + /// Returns a + /// + /// + /// + /// + public static DeliveryAddressIndicatorEnum DeliveryAddressIndicatorEnumFromString(string value) + { + if (value.Equals("shipToBillingAddress")) + return DeliveryAddressIndicatorEnum.ShipToBillingAddress; + if (value.Equals("shipToVerifiedAddress")) + return DeliveryAddressIndicatorEnum.ShipToVerifiedAddress; + + if (value.Equals("shipToNewAddress")) + return DeliveryAddressIndicatorEnum.ShipToNewAddress; + + if (value.Equals("shipToStore")) + return DeliveryAddressIndicatorEnum.ShipToStore; + + if (value.Equals("digitalGoods")) + return DeliveryAddressIndicatorEnum.DigitalGoods; + + if (value.Equals("goodsNotShipped")) + return DeliveryAddressIndicatorEnum.GoodsNotShipped; + + if (value.Equals("other")) + return DeliveryAddressIndicatorEnum.Other; + + throw new NotImplementedException($"Could not convert value to type DeliveryAddressIndicatorEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static DeliveryAddressIndicatorEnum? DeliveryAddressIndicatorEnumFromStringOrDefault(string value) + { + if (value.Equals("shipToBillingAddress")) + return DeliveryAddressIndicatorEnum.ShipToBillingAddress; + + if (value.Equals("shipToVerifiedAddress")) + return DeliveryAddressIndicatorEnum.ShipToVerifiedAddress; + + if (value.Equals("shipToNewAddress")) + return DeliveryAddressIndicatorEnum.ShipToNewAddress; + + if (value.Equals("shipToStore")) + return DeliveryAddressIndicatorEnum.ShipToStore; + + if (value.Equals("digitalGoods")) + return DeliveryAddressIndicatorEnum.DigitalGoods; + + if (value.Equals("goodsNotShipped")) + return DeliveryAddressIndicatorEnum.GoodsNotShipped; + + if (value.Equals("other")) + return DeliveryAddressIndicatorEnum.Other; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string DeliveryAddressIndicatorEnumToJsonValue(DeliveryAddressIndicatorEnum? value) + { + if (value == DeliveryAddressIndicatorEnum.ShipToBillingAddress) + return "shipToBillingAddress"; + + if (value == DeliveryAddressIndicatorEnum.ShipToVerifiedAddress) + return "shipToVerifiedAddress"; + + if (value == DeliveryAddressIndicatorEnum.ShipToNewAddress) + return "shipToNewAddress"; + + if (value == DeliveryAddressIndicatorEnum.ShipToStore) + return "shipToStore"; + + if (value == DeliveryAddressIndicatorEnum.DigitalGoods) + return "digitalGoods"; + + if (value == DeliveryAddressIndicatorEnum.GoodsNotShipped) + return "goodsNotShipped"; + + if (value == DeliveryAddressIndicatorEnum.Other) + return "other"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of DeliveryAddressIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryAddressIndicatorOption { get; private set; } /// /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` /// /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` - [DataMember(Name = "deliveryAddressIndicator", EmitDefaultValue = false)] - public DeliveryAddressIndicatorEnum? DeliveryAddressIndicator { get; set; } + [JsonPropertyName("deliveryAddressIndicator")] + public DeliveryAddressIndicatorEnum? DeliveryAddressIndicator { get { return this.DeliveryAddressIndicatorOption; } set { this.DeliveryAddressIndicatorOption = new Option(value); } } + /// /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` /// /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` - [JsonConverter(typeof(StringEnumConverter))] public enum DeliveryTimeframeEnum { /// /// Enum ElectronicDelivery for value: electronicDelivery /// - [EnumMember(Value = "electronicDelivery")] ElectronicDelivery = 1, /// /// Enum SameDayShipping for value: sameDayShipping /// - [EnumMember(Value = "sameDayShipping")] SameDayShipping = 2, /// /// Enum OvernightShipping for value: overnightShipping /// - [EnumMember(Value = "overnightShipping")] OvernightShipping = 3, /// /// Enum TwoOrMoreDaysShipping for value: twoOrMoreDaysShipping /// - [EnumMember(Value = "twoOrMoreDaysShipping")] TwoOrMoreDaysShipping = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static DeliveryTimeframeEnum DeliveryTimeframeEnumFromString(string value) + { + if (value.Equals("electronicDelivery")) + return DeliveryTimeframeEnum.ElectronicDelivery; + + if (value.Equals("sameDayShipping")) + return DeliveryTimeframeEnum.SameDayShipping; + + if (value.Equals("overnightShipping")) + return DeliveryTimeframeEnum.OvernightShipping; + + if (value.Equals("twoOrMoreDaysShipping")) + return DeliveryTimeframeEnum.TwoOrMoreDaysShipping; + + throw new NotImplementedException($"Could not convert value to type DeliveryTimeframeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static DeliveryTimeframeEnum? DeliveryTimeframeEnumFromStringOrDefault(string value) + { + if (value.Equals("electronicDelivery")) + return DeliveryTimeframeEnum.ElectronicDelivery; + if (value.Equals("sameDayShipping")) + return DeliveryTimeframeEnum.SameDayShipping; + + if (value.Equals("overnightShipping")) + return DeliveryTimeframeEnum.OvernightShipping; + + if (value.Equals("twoOrMoreDaysShipping")) + return DeliveryTimeframeEnum.TwoOrMoreDaysShipping; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string DeliveryTimeframeEnumToJsonValue(DeliveryTimeframeEnum? value) + { + if (value == DeliveryTimeframeEnum.ElectronicDelivery) + return "electronicDelivery"; + + if (value == DeliveryTimeframeEnum.SameDayShipping) + return "sameDayShipping"; + + if (value == DeliveryTimeframeEnum.OvernightShipping) + return "overnightShipping"; + + if (value == DeliveryTimeframeEnum.TwoOrMoreDaysShipping) + return "twoOrMoreDaysShipping"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of DeliveryTimeframe + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryTimeframeOption { get; private set; } /// /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` /// /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` - [DataMember(Name = "deliveryTimeframe", EmitDefaultValue = false)] - public DeliveryTimeframeEnum? DeliveryTimeframe { get; set; } + [JsonPropertyName("deliveryTimeframe")] + public DeliveryTimeframeEnum? DeliveryTimeframe { get { return this.DeliveryTimeframeOption; } set { this.DeliveryTimeframeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of AddressMatch /// - /// Whether the chosen delivery address is identical to the billing address.. - /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other`. - /// The delivery email address (for digital goods).. - /// For Electronic delivery, the email address to which the merchandise was delivered. Maximum length: 254 characters.. - /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping`. - /// giftCardAmount. - /// For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased.. - /// For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification.. - /// For pre-order purchases, the expected date this product will be available to the shopper.. - /// Indicator for whether this transaction is for pre-ordering a product.. - /// Indicates whether Cardholder is placing an order for merchandise with a future availability or release date.. - /// Indicator for whether the shopper has already purchased the same items in the past.. - /// Indicates whether the cardholder is reordering previously purchased merchandise.. - /// Indicates shipping method chosen for the transaction.. - public MerchantRiskIndicator(bool? addressMatch = default(bool?), DeliveryAddressIndicatorEnum? deliveryAddressIndicator = default(DeliveryAddressIndicatorEnum?), string deliveryEmail = default(string), string deliveryEmailAddress = default(string), DeliveryTimeframeEnum? deliveryTimeframe = default(DeliveryTimeframeEnum?), Amount giftCardAmount = default(Amount), int? giftCardCount = default(int?), string giftCardCurr = default(string), DateTime preOrderDate = default(DateTime), bool? preOrderPurchase = default(bool?), string preOrderPurchaseInd = default(string), bool? reorderItems = default(bool?), string reorderItemsInd = default(string), string shipIndicator = default(string)) - { - this.AddressMatch = addressMatch; - this.DeliveryAddressIndicator = deliveryAddressIndicator; - this.DeliveryEmail = deliveryEmail; - this.DeliveryEmailAddress = deliveryEmailAddress; - this.DeliveryTimeframe = deliveryTimeframe; - this.GiftCardAmount = giftCardAmount; - this.GiftCardCount = giftCardCount; - this.GiftCardCurr = giftCardCurr; - this.PreOrderDate = preOrderDate; - this.PreOrderPurchase = preOrderPurchase; - this.PreOrderPurchaseInd = preOrderPurchaseInd; - this.ReorderItems = reorderItems; - this.ReorderItemsInd = reorderItemsInd; - this.ShipIndicator = shipIndicator; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AddressMatchOption { get; private set; } /// /// Whether the chosen delivery address is identical to the billing address. /// /// Whether the chosen delivery address is identical to the billing address. - [DataMember(Name = "addressMatch", EmitDefaultValue = false)] - public bool? AddressMatch { get; set; } + [JsonPropertyName("addressMatch")] + public bool? AddressMatch { get { return this.AddressMatchOption; } set { this.AddressMatchOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryEmailOption { get; private set; } /// /// The delivery email address (for digital goods). /// /// The delivery email address (for digital goods). - [DataMember(Name = "deliveryEmail", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v68. Use `deliveryEmailAddress` instead.")] - public string DeliveryEmail { get; set; } + [JsonPropertyName("deliveryEmail")] + [Obsolete] + public string DeliveryEmail { get { return this.DeliveryEmailOption; } set { this.DeliveryEmailOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryEmailAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryEmailAddressOption { get; private set; } /// /// For Electronic delivery, the email address to which the merchandise was delivered. Maximum length: 254 characters. /// /// For Electronic delivery, the email address to which the merchandise was delivered. Maximum length: 254 characters. - [DataMember(Name = "deliveryEmailAddress", EmitDefaultValue = false)] - public string DeliveryEmailAddress { get; set; } + [JsonPropertyName("deliveryEmailAddress")] + public string DeliveryEmailAddress { get { return this.DeliveryEmailAddressOption; } set { this.DeliveryEmailAddressOption = new Option(value); } } + + /// + /// Used to track the state of GiftCardAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option GiftCardAmountOption { get; private set; } /// /// Gets or Sets GiftCardAmount /// - [DataMember(Name = "giftCardAmount", EmitDefaultValue = false)] - public Amount GiftCardAmount { get; set; } + [JsonPropertyName("giftCardAmount")] + public Amount GiftCardAmount { get { return this.GiftCardAmountOption; } set { this.GiftCardAmountOption = new Option(value); } } + + /// + /// Used to track the state of GiftCardCount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option GiftCardCountOption { get; private set; } /// /// For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. /// /// For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. - [DataMember(Name = "giftCardCount", EmitDefaultValue = false)] - public int? GiftCardCount { get; set; } + [JsonPropertyName("giftCardCount")] + public int? GiftCardCount { get { return this.GiftCardCountOption; } set { this.GiftCardCountOption = new Option(value); } } + + /// + /// Used to track the state of GiftCardCurr + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option GiftCardCurrOption { get; private set; } /// /// For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. /// /// For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. - [DataMember(Name = "giftCardCurr", EmitDefaultValue = false)] - public string GiftCardCurr { get; set; } + [JsonPropertyName("giftCardCurr")] + public string GiftCardCurr { get { return this.GiftCardCurrOption; } set { this.GiftCardCurrOption = new Option(value); } } + + /// + /// Used to track the state of PreOrderDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PreOrderDateOption { get; private set; } /// /// For pre-order purchases, the expected date this product will be available to the shopper. /// /// For pre-order purchases, the expected date this product will be available to the shopper. - [DataMember(Name = "preOrderDate", EmitDefaultValue = false)] - public DateTime PreOrderDate { get; set; } + [JsonPropertyName("preOrderDate")] + public DateTime? PreOrderDate { get { return this.PreOrderDateOption; } set { this.PreOrderDateOption = new Option(value); } } + + /// + /// Used to track the state of PreOrderPurchase + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PreOrderPurchaseOption { get; private set; } /// /// Indicator for whether this transaction is for pre-ordering a product. /// /// Indicator for whether this transaction is for pre-ordering a product. - [DataMember(Name = "preOrderPurchase", EmitDefaultValue = false)] - public bool? PreOrderPurchase { get; set; } + [JsonPropertyName("preOrderPurchase")] + public bool? PreOrderPurchase { get { return this.PreOrderPurchaseOption; } set { this.PreOrderPurchaseOption = new Option(value); } } + + /// + /// Used to track the state of PreOrderPurchaseInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PreOrderPurchaseIndOption { get; private set; } /// /// Indicates whether Cardholder is placing an order for merchandise with a future availability or release date. /// /// Indicates whether Cardholder is placing an order for merchandise with a future availability or release date. - [DataMember(Name = "preOrderPurchaseInd", EmitDefaultValue = false)] - public string PreOrderPurchaseInd { get; set; } + [JsonPropertyName("preOrderPurchaseInd")] + public string PreOrderPurchaseInd { get { return this.PreOrderPurchaseIndOption; } set { this.PreOrderPurchaseIndOption = new Option(value); } } + + /// + /// Used to track the state of ReorderItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReorderItemsOption { get; private set; } /// /// Indicator for whether the shopper has already purchased the same items in the past. /// /// Indicator for whether the shopper has already purchased the same items in the past. - [DataMember(Name = "reorderItems", EmitDefaultValue = false)] - public bool? ReorderItems { get; set; } + [JsonPropertyName("reorderItems")] + public bool? ReorderItems { get { return this.ReorderItemsOption; } set { this.ReorderItemsOption = new Option(value); } } + + /// + /// Used to track the state of ReorderItemsInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReorderItemsIndOption { get; private set; } /// /// Indicates whether the cardholder is reordering previously purchased merchandise. /// /// Indicates whether the cardholder is reordering previously purchased merchandise. - [DataMember(Name = "reorderItemsInd", EmitDefaultValue = false)] - public string ReorderItemsInd { get; set; } + [JsonPropertyName("reorderItemsInd")] + public string ReorderItemsInd { get { return this.ReorderItemsIndOption; } set { this.ReorderItemsIndOption = new Option(value); } } + + /// + /// Used to track the state of ShipIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShipIndicatorOption { get; private set; } /// /// Indicates shipping method chosen for the transaction. /// /// Indicates shipping method chosen for the transaction. - [DataMember(Name = "shipIndicator", EmitDefaultValue = false)] - public string ShipIndicator { get; set; } + [JsonPropertyName("shipIndicator")] + public string ShipIndicator { get { return this.ShipIndicatorOption; } set { this.ShipIndicatorOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -276,167 +522,268 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + // DeliveryEmailAddress (string) maxLength + if (this.DeliveryEmailAddress != null && this.DeliveryEmailAddress.Length > 254) + { + yield return new ValidationResult("Invalid value for DeliveryEmailAddress, length must be less than 254.", new [] { "DeliveryEmailAddress" }); + } + + yield break; } + } + /// + /// A Json converter for type + /// + public class MerchantRiskIndicatorJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// The format to use to serialize PreOrderDate /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as MerchantRiskIndicator); - } + public static string PreOrderDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// Returns true if MerchantRiskIndicator instances are equal + /// Deserializes json to /// - /// Instance of MerchantRiskIndicator to be compared - /// Boolean - public bool Equals(MerchantRiskIndicator input) + /// + /// + /// + /// + /// + public override MerchantRiskIndicator Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option addressMatch = default; + Option deliveryAddressIndicator = default; + Option deliveryEmail = default; + Option deliveryEmailAddress = default; + Option deliveryTimeframe = default; + Option giftCardAmount = default; + Option giftCardCount = default; + Option giftCardCurr = default; + Option preOrderDate = default; + Option preOrderPurchase = default; + Option preOrderPurchaseInd = default; + Option reorderItems = default; + Option reorderItemsInd = default; + Option shipIndicator = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "addressMatch": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + addressMatch = new Option(utf8JsonReader.GetBoolean()); + break; + case "deliveryAddressIndicator": + string deliveryAddressIndicatorRawValue = utf8JsonReader.GetString(); + if (deliveryAddressIndicatorRawValue != null) + deliveryAddressIndicator = new Option(MerchantRiskIndicator.DeliveryAddressIndicatorEnumFromStringOrDefault(deliveryAddressIndicatorRawValue)); + break; + case "deliveryEmail": + deliveryEmail = new Option(utf8JsonReader.GetString()); + break; + case "deliveryEmailAddress": + deliveryEmailAddress = new Option(utf8JsonReader.GetString()); + break; + case "deliveryTimeframe": + string deliveryTimeframeRawValue = utf8JsonReader.GetString(); + if (deliveryTimeframeRawValue != null) + deliveryTimeframe = new Option(MerchantRiskIndicator.DeliveryTimeframeEnumFromStringOrDefault(deliveryTimeframeRawValue)); + break; + case "giftCardAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + giftCardAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "giftCardCount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + giftCardCount = new Option(utf8JsonReader.GetInt32()); + break; + case "giftCardCurr": + giftCardCurr = new Option(utf8JsonReader.GetString()); + break; + case "preOrderDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + preOrderDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "preOrderPurchase": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + preOrderPurchase = new Option(utf8JsonReader.GetBoolean()); + break; + case "preOrderPurchaseInd": + preOrderPurchaseInd = new Option(utf8JsonReader.GetString()); + break; + case "reorderItems": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + reorderItems = new Option(utf8JsonReader.GetBoolean()); + break; + case "reorderItemsInd": + reorderItemsInd = new Option(utf8JsonReader.GetString()); + break; + case "shipIndicator": + shipIndicator = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AddressMatch == input.AddressMatch || - this.AddressMatch.Equals(input.AddressMatch) - ) && - ( - this.DeliveryAddressIndicator == input.DeliveryAddressIndicator || - this.DeliveryAddressIndicator.Equals(input.DeliveryAddressIndicator) - ) && - ( - this.DeliveryEmail == input.DeliveryEmail || - (this.DeliveryEmail != null && - this.DeliveryEmail.Equals(input.DeliveryEmail)) - ) && - ( - this.DeliveryEmailAddress == input.DeliveryEmailAddress || - (this.DeliveryEmailAddress != null && - this.DeliveryEmailAddress.Equals(input.DeliveryEmailAddress)) - ) && - ( - this.DeliveryTimeframe == input.DeliveryTimeframe || - this.DeliveryTimeframe.Equals(input.DeliveryTimeframe) - ) && - ( - this.GiftCardAmount == input.GiftCardAmount || - (this.GiftCardAmount != null && - this.GiftCardAmount.Equals(input.GiftCardAmount)) - ) && - ( - this.GiftCardCount == input.GiftCardCount || - this.GiftCardCount.Equals(input.GiftCardCount) - ) && - ( - this.GiftCardCurr == input.GiftCardCurr || - (this.GiftCardCurr != null && - this.GiftCardCurr.Equals(input.GiftCardCurr)) - ) && - ( - this.PreOrderDate == input.PreOrderDate || - (this.PreOrderDate != null && - this.PreOrderDate.Equals(input.PreOrderDate)) - ) && - ( - this.PreOrderPurchase == input.PreOrderPurchase || - this.PreOrderPurchase.Equals(input.PreOrderPurchase) - ) && - ( - this.PreOrderPurchaseInd == input.PreOrderPurchaseInd || - (this.PreOrderPurchaseInd != null && - this.PreOrderPurchaseInd.Equals(input.PreOrderPurchaseInd)) - ) && - ( - this.ReorderItems == input.ReorderItems || - this.ReorderItems.Equals(input.ReorderItems) - ) && - ( - this.ReorderItemsInd == input.ReorderItemsInd || - (this.ReorderItemsInd != null && - this.ReorderItemsInd.Equals(input.ReorderItemsInd)) - ) && - ( - this.ShipIndicator == input.ShipIndicator || - (this.ShipIndicator != null && - this.ShipIndicator.Equals(input.ShipIndicator)) - ); + + if (addressMatch.IsSet && addressMatch.Value == null) + throw new ArgumentNullException(nameof(addressMatch), "Property is not nullable for class MerchantRiskIndicator."); + + if (deliveryAddressIndicator.IsSet && deliveryAddressIndicator.Value == null) + throw new ArgumentNullException(nameof(deliveryAddressIndicator), "Property is not nullable for class MerchantRiskIndicator."); + + if (deliveryEmail.IsSet && deliveryEmail.Value == null) + throw new ArgumentNullException(nameof(deliveryEmail), "Property is not nullable for class MerchantRiskIndicator."); + + if (deliveryEmailAddress.IsSet && deliveryEmailAddress.Value == null) + throw new ArgumentNullException(nameof(deliveryEmailAddress), "Property is not nullable for class MerchantRiskIndicator."); + + if (deliveryTimeframe.IsSet && deliveryTimeframe.Value == null) + throw new ArgumentNullException(nameof(deliveryTimeframe), "Property is not nullable for class MerchantRiskIndicator."); + + if (giftCardAmount.IsSet && giftCardAmount.Value == null) + throw new ArgumentNullException(nameof(giftCardAmount), "Property is not nullable for class MerchantRiskIndicator."); + + if (giftCardCount.IsSet && giftCardCount.Value == null) + throw new ArgumentNullException(nameof(giftCardCount), "Property is not nullable for class MerchantRiskIndicator."); + + if (giftCardCurr.IsSet && giftCardCurr.Value == null) + throw new ArgumentNullException(nameof(giftCardCurr), "Property is not nullable for class MerchantRiskIndicator."); + + if (preOrderDate.IsSet && preOrderDate.Value == null) + throw new ArgumentNullException(nameof(preOrderDate), "Property is not nullable for class MerchantRiskIndicator."); + + if (preOrderPurchase.IsSet && preOrderPurchase.Value == null) + throw new ArgumentNullException(nameof(preOrderPurchase), "Property is not nullable for class MerchantRiskIndicator."); + + if (preOrderPurchaseInd.IsSet && preOrderPurchaseInd.Value == null) + throw new ArgumentNullException(nameof(preOrderPurchaseInd), "Property is not nullable for class MerchantRiskIndicator."); + + if (reorderItems.IsSet && reorderItems.Value == null) + throw new ArgumentNullException(nameof(reorderItems), "Property is not nullable for class MerchantRiskIndicator."); + + if (reorderItemsInd.IsSet && reorderItemsInd.Value == null) + throw new ArgumentNullException(nameof(reorderItemsInd), "Property is not nullable for class MerchantRiskIndicator."); + + if (shipIndicator.IsSet && shipIndicator.Value == null) + throw new ArgumentNullException(nameof(shipIndicator), "Property is not nullable for class MerchantRiskIndicator."); + + return new MerchantRiskIndicator(addressMatch, deliveryAddressIndicator, deliveryEmail, deliveryEmailAddress, deliveryTimeframe, giftCardAmount, giftCardCount, giftCardCurr, preOrderDate, preOrderPurchase, preOrderPurchaseInd, reorderItems, reorderItemsInd, shipIndicator); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MerchantRiskIndicator merchantRiskIndicator, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.AddressMatch.GetHashCode(); - hashCode = (hashCode * 59) + this.DeliveryAddressIndicator.GetHashCode(); - if (this.DeliveryEmail != null) - { - hashCode = (hashCode * 59) + this.DeliveryEmail.GetHashCode(); - } - if (this.DeliveryEmailAddress != null) - { - hashCode = (hashCode * 59) + this.DeliveryEmailAddress.GetHashCode(); - } - hashCode = (hashCode * 59) + this.DeliveryTimeframe.GetHashCode(); - if (this.GiftCardAmount != null) - { - hashCode = (hashCode * 59) + this.GiftCardAmount.GetHashCode(); - } - hashCode = (hashCode * 59) + this.GiftCardCount.GetHashCode(); - if (this.GiftCardCurr != null) - { - hashCode = (hashCode * 59) + this.GiftCardCurr.GetHashCode(); - } - if (this.PreOrderDate != null) - { - hashCode = (hashCode * 59) + this.PreOrderDate.GetHashCode(); - } - hashCode = (hashCode * 59) + this.PreOrderPurchase.GetHashCode(); - if (this.PreOrderPurchaseInd != null) - { - hashCode = (hashCode * 59) + this.PreOrderPurchaseInd.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ReorderItems.GetHashCode(); - if (this.ReorderItemsInd != null) - { - hashCode = (hashCode * 59) + this.ReorderItemsInd.GetHashCode(); - } - if (this.ShipIndicator != null) - { - hashCode = (hashCode * 59) + this.ShipIndicator.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, merchantRiskIndicator, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MerchantRiskIndicator merchantRiskIndicator, JsonSerializerOptions jsonSerializerOptions) { - // DeliveryEmailAddress (string) maxLength - if (this.DeliveryEmailAddress != null && this.DeliveryEmailAddress.Length > 254) + if (merchantRiskIndicator.DeliveryEmailOption.IsSet && merchantRiskIndicator.DeliveryEmail == null) + throw new ArgumentNullException(nameof(merchantRiskIndicator.DeliveryEmail), "Property is required for class MerchantRiskIndicator."); + + if (merchantRiskIndicator.DeliveryEmailAddressOption.IsSet && merchantRiskIndicator.DeliveryEmailAddress == null) + throw new ArgumentNullException(nameof(merchantRiskIndicator.DeliveryEmailAddress), "Property is required for class MerchantRiskIndicator."); + + if (merchantRiskIndicator.GiftCardAmountOption.IsSet && merchantRiskIndicator.GiftCardAmount == null) + throw new ArgumentNullException(nameof(merchantRiskIndicator.GiftCardAmount), "Property is required for class MerchantRiskIndicator."); + + if (merchantRiskIndicator.GiftCardCurrOption.IsSet && merchantRiskIndicator.GiftCardCurr == null) + throw new ArgumentNullException(nameof(merchantRiskIndicator.GiftCardCurr), "Property is required for class MerchantRiskIndicator."); + + if (merchantRiskIndicator.PreOrderPurchaseIndOption.IsSet && merchantRiskIndicator.PreOrderPurchaseInd == null) + throw new ArgumentNullException(nameof(merchantRiskIndicator.PreOrderPurchaseInd), "Property is required for class MerchantRiskIndicator."); + + if (merchantRiskIndicator.ReorderItemsIndOption.IsSet && merchantRiskIndicator.ReorderItemsInd == null) + throw new ArgumentNullException(nameof(merchantRiskIndicator.ReorderItemsInd), "Property is required for class MerchantRiskIndicator."); + + if (merchantRiskIndicator.ShipIndicatorOption.IsSet && merchantRiskIndicator.ShipIndicator == null) + throw new ArgumentNullException(nameof(merchantRiskIndicator.ShipIndicator), "Property is required for class MerchantRiskIndicator."); + + if (merchantRiskIndicator.AddressMatchOption.IsSet) + writer.WriteBoolean("addressMatch", merchantRiskIndicator.AddressMatchOption.Value.Value); + + var deliveryAddressIndicatorRawValue = MerchantRiskIndicator.DeliveryAddressIndicatorEnumToJsonValue(merchantRiskIndicator.DeliveryAddressIndicatorOption.Value.Value); + writer.WriteString("deliveryAddressIndicator", deliveryAddressIndicatorRawValue); + if (merchantRiskIndicator.DeliveryEmailOption.IsSet) + writer.WriteString("deliveryEmail", merchantRiskIndicator.DeliveryEmail); + + if (merchantRiskIndicator.DeliveryEmailAddressOption.IsSet) + writer.WriteString("deliveryEmailAddress", merchantRiskIndicator.DeliveryEmailAddress); + + var deliveryTimeframeRawValue = MerchantRiskIndicator.DeliveryTimeframeEnumToJsonValue(merchantRiskIndicator.DeliveryTimeframeOption.Value.Value); + writer.WriteString("deliveryTimeframe", deliveryTimeframeRawValue); + if (merchantRiskIndicator.GiftCardAmountOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DeliveryEmailAddress, length must be less than 254.", new [] { "DeliveryEmailAddress" }); + writer.WritePropertyName("giftCardAmount"); + JsonSerializer.Serialize(writer, merchantRiskIndicator.GiftCardAmount, jsonSerializerOptions); } + if (merchantRiskIndicator.GiftCardCountOption.IsSet) + writer.WriteNumber("giftCardCount", merchantRiskIndicator.GiftCardCountOption.Value.Value); - yield break; + if (merchantRiskIndicator.GiftCardCurrOption.IsSet) + writer.WriteString("giftCardCurr", merchantRiskIndicator.GiftCardCurr); + + if (merchantRiskIndicator.PreOrderDateOption.IsSet) + writer.WriteString("preOrderDate", merchantRiskIndicator.PreOrderDateOption.Value.Value.ToString(PreOrderDateFormat)); + + if (merchantRiskIndicator.PreOrderPurchaseOption.IsSet) + writer.WriteBoolean("preOrderPurchase", merchantRiskIndicator.PreOrderPurchaseOption.Value.Value); + + if (merchantRiskIndicator.PreOrderPurchaseIndOption.IsSet) + writer.WriteString("preOrderPurchaseInd", merchantRiskIndicator.PreOrderPurchaseInd); + + if (merchantRiskIndicator.ReorderItemsOption.IsSet) + writer.WriteBoolean("reorderItems", merchantRiskIndicator.ReorderItemsOption.Value.Value); + + if (merchantRiskIndicator.ReorderItemsIndOption.IsSet) + writer.WriteString("reorderItemsInd", merchantRiskIndicator.ReorderItemsInd); + + if (merchantRiskIndicator.ShipIndicatorOption.IsSet) + writer.WriteString("shipIndicator", merchantRiskIndicator.ShipIndicator); } } - } diff --git a/Adyen/Model/Checkout/MobilePayDetails.cs b/Adyen/Model/Checkout/MobilePayDetails.cs index 6b6e06a05..561b89b14 100644 --- a/Adyen/Model/Checkout/MobilePayDetails.cs +++ b/Adyen/Model/Checkout/MobilePayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,62 +14,115 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// MobilePayDetails /// - [DataContract(Name = "MobilePayDetails")] - public partial class MobilePayDetails : IEquatable, IValidatableObject + public partial class MobilePayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// **mobilepay** (default to TypeEnum.Mobilepay) + [JsonConstructor] + public MobilePayDetails(Option checkoutAttemptId = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **mobilepay** /// /// **mobilepay** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Mobilepay for value: mobilepay /// - [EnumMember(Value = "mobilepay")] Mobilepay = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("mobilepay")) + return TypeEnum.Mobilepay; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("mobilepay")) + return TypeEnum.Mobilepay; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Mobilepay) + return "mobilepay"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **mobilepay** /// /// **mobilepay** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// **mobilepay** (default to TypeEnum.Mobilepay). - public MobilePayDetails(string checkoutAttemptId = default(string), TypeEnum? type = TypeEnum.Mobilepay) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -87,73 +139,111 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class MobilePayDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override MobilePayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as MobilePayDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if MobilePayDetails instances are equal - /// - /// Instance of MobilePayDetails to be compared - /// Boolean - public bool Equals(MobilePayDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(MobilePayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class MobilePayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class MobilePayDetails."); + + return new MobilePayDetails(checkoutAttemptId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MobilePayDetails mobilePayDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, mobilePayDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MobilePayDetails mobilePayDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (mobilePayDetails.CheckoutAttemptIdOption.IsSet && mobilePayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(mobilePayDetails.CheckoutAttemptId), "Property is required for class MobilePayDetails."); + + if (mobilePayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", mobilePayDetails.CheckoutAttemptId); + + var typeRawValue = MobilePayDetails.TypeEnumToJsonValue(mobilePayDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/MolPayDetails.cs b/Adyen/Model/Checkout/MolPayDetails.cs index e6b7f6a2d..a909a04a2 100644 --- a/Adyen/Model/Checkout/MolPayDetails.cs +++ b/Adyen/Model/Checkout/MolPayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,83 +14,132 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// MolPayDetails /// - [DataContract(Name = "MolPayDetails")] - public partial class MolPayDetails : IEquatable, IValidatableObject + public partial class MolPayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The shopper's bank. Specify this with the issuer value that corresponds to this bank. + /// **molpay** + /// The checkout attempt identifier. + [JsonConstructor] + public MolPayDetails(string issuer, TypeEnum type, Option checkoutAttemptId = default) + { + Issuer = issuer; + Type = type; + CheckoutAttemptIdOption = checkoutAttemptId; + OnCreated(); + } + + partial void OnCreated(); + /// /// **molpay** /// /// **molpay** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// - /// Enum FpxMY for value: molpay_ebanking_fpx_MY + /// Enum MolpayEbankingFpxMY for value: molpay_ebanking_fpx_MY /// - [EnumMember(Value = "molpay_ebanking_fpx_MY")] - FpxMY = 1, + MolpayEbankingFpxMY = 1, /// - /// Enum TH for value: molpay_ebanking_TH + /// Enum MolpayEbankingTH for value: molpay_ebanking_TH /// - [EnumMember(Value = "molpay_ebanking_TH")] - TH = 2 - + MolpayEbankingTH = 2 } - /// - /// **molpay** + /// Returns a /// - /// **molpay** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public TypeEnum Type { get; set; } + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("molpay_ebanking_fpx_MY")) + return TypeEnum.MolpayEbankingFpxMY; + + if (value.Equals("molpay_ebanking_TH")) + return TypeEnum.MolpayEbankingTH; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected MolPayDetails() { } + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("molpay_ebanking_fpx_MY")) + return TypeEnum.MolpayEbankingFpxMY; + + if (value.Equals("molpay_ebanking_TH")) + return TypeEnum.MolpayEbankingTH; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The checkout attempt identifier.. - /// The shopper's bank. Specify this with the issuer value that corresponds to this bank. (required). - /// **molpay** (required). - public MolPayDetails(string checkoutAttemptId = default(string), string issuer = default(string), TypeEnum type = default(TypeEnum)) + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) { - this.Issuer = issuer; - this.Type = type; - this.CheckoutAttemptId = checkoutAttemptId; + if (value == TypeEnum.MolpayEbankingFpxMY) + return "molpay_ebanking_fpx_MY"; + + if (value == TypeEnum.MolpayEbankingTH) + return "molpay_ebanking_TH"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// The checkout attempt identifier. + /// **molpay** /// - /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + /// **molpay** + [JsonPropertyName("type")] + public TypeEnum Type { get; set; } /// /// The shopper's bank. Specify this with the issuer value that corresponds to this bank. /// /// The shopper's bank. Specify this with the issuer value that corresponds to this bank. - [DataMember(Name = "issuer", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("issuer")] public string Issuer { get; set; } + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } + + /// + /// The checkout attempt identifier. + /// + /// The checkout attempt identifier. + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -100,90 +148,136 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class MolPayDetails {\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" Issuer: ").Append(Issuer).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class MolPayDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override MolPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as MolPayDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if MolPayDetails instances are equal - /// - /// Instance of MolPayDetails to be compared - /// Boolean - public bool Equals(MolPayDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option issuer = default; + Option type = default; + Option checkoutAttemptId = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "issuer": + issuer = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(MolPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Issuer == input.Issuer || - (this.Issuer != null && - this.Issuer.Equals(input.Issuer)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!issuer.IsSet) + throw new ArgumentException("Property is required for class MolPayDetails.", nameof(issuer)); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class MolPayDetails.", nameof(type)); + + if (issuer.IsSet && issuer.Value == null) + throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class MolPayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class MolPayDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class MolPayDetails."); + + return new MolPayDetails(issuer.Value, type.Value.Value, checkoutAttemptId); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MolPayDetails molPayDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.Issuer != null) - { - hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, molPayDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MolPayDetails molPayDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (molPayDetails.Issuer == null) + throw new ArgumentNullException(nameof(molPayDetails.Issuer), "Property is required for class MolPayDetails."); + + if (molPayDetails.CheckoutAttemptIdOption.IsSet && molPayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(molPayDetails.CheckoutAttemptId), "Property is required for class MolPayDetails."); + + writer.WriteString("issuer", molPayDetails.Issuer); + + var typeRawValue = MolPayDetails.TypeEnumToJsonValue(molPayDetails.Type); + writer.WriteString("type", typeRawValue); + if (molPayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", molPayDetails.CheckoutAttemptId); } } - } diff --git a/Adyen/Model/Checkout/Name.cs b/Adyen/Model/Checkout/Name.cs index 0839df0a6..cb917d7e4 100644 --- a/Adyen/Model/Checkout/Name.cs +++ b/Adyen/Model/Checkout/Name.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,51 +14,47 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Name /// - [DataContract(Name = "Name")] - public partial class Name : IEquatable, IValidatableObject + public partial class Name : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected Name() { } - /// - /// Initializes a new instance of the class. - /// - /// The first name. (required). - /// The last name. (required). - public Name(string firstName = default(string), string lastName = default(string)) + /// The first name. + /// The last name. + [JsonConstructor] + public Name(string firstName, string lastName) { - this.FirstName = firstName; - this.LastName = lastName; + FirstName = firstName; + LastName = lastName; + OnCreated(); } + partial void OnCreated(); + /// /// The first name. /// /// The first name. - [DataMember(Name = "firstName", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("firstName")] public string FirstName { get; set; } /// /// The last name. /// /// The last name. - [DataMember(Name = "lastName", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("lastName")] public string LastName { get; set; } /// @@ -77,89 +72,128 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // FirstName (string) maxLength + if (this.FirstName != null && this.FirstName.Length > 80) + { + yield return new ValidationResult("Invalid value for FirstName, length must be less than 80.", new [] { "FirstName" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Name); + // LastName (string) maxLength + if (this.LastName != null && this.LastName.Length > 80) + { + yield return new ValidationResult("Invalid value for LastName, length must be less than 80.", new [] { "LastName" }); + } + + yield break; } + } + /// + /// A Json converter for type + /// + public class NameJsonConverter : JsonConverter + { /// - /// Returns true if Name instances are equal + /// Deserializes json to /// - /// Instance of Name to be compared - /// Boolean - public bool Equals(Name input) + /// + /// + /// + /// + /// + public override Name Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option firstName = default; + Option lastName = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.FirstName == input.FirstName || - (this.FirstName != null && - this.FirstName.Equals(input.FirstName)) - ) && - ( - this.LastName == input.LastName || - (this.LastName != null && - this.LastName.Equals(input.LastName)) - ); + + if (!firstName.IsSet) + throw new ArgumentException("Property is required for class Name.", nameof(firstName)); + + if (!lastName.IsSet) + throw new ArgumentException("Property is required for class Name.", nameof(lastName)); + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Name."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class Name."); + + return new Name(firstName.Value, lastName.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.FirstName != null) - { - hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); - } - if (this.LastName != null) - { - hashCode = (hashCode * 59) + this.LastName.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, name, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) { - // FirstName (string) maxLength - if (this.FirstName != null && this.FirstName.Length > 80) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for FirstName, length must be less than 80.", new [] { "FirstName" }); - } + if (name.FirstName == null) + throw new ArgumentNullException(nameof(name.FirstName), "Property is required for class Name."); - // LastName (string) maxLength - if (this.LastName != null && this.LastName.Length > 80) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for LastName, length must be less than 80.", new [] { "LastName" }); - } + if (name.LastName == null) + throw new ArgumentNullException(nameof(name.LastName), "Property is required for class Name."); - yield break; + writer.WriteString("firstName", name.FirstName); + + writer.WriteString("lastName", name.LastName); } } - } diff --git a/Adyen/Model/Checkout/OpenInvoiceDetails.cs b/Adyen/Model/Checkout/OpenInvoiceDetails.cs index 18a35115f..02da0e71c 100644 --- a/Adyen/Model/Checkout/OpenInvoiceDetails.cs +++ b/Adyen/Model/Checkout/OpenInvoiceDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,120 +14,224 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// OpenInvoiceDetails /// - [DataContract(Name = "OpenInvoiceDetails")] - public partial class OpenInvoiceDetails : IEquatable, IValidatableObject + public partial class OpenInvoiceDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The address where to send the invoice. + /// The checkout attempt identifier. + /// The address where the goods should be delivered. + /// Shopper name, date of birth, phone number, and email address. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **openinvoice** (default to TypeEnum.Openinvoice) + [JsonConstructor] + public OpenInvoiceDetails(Option billingAddress = default, Option checkoutAttemptId = default, Option deliveryAddress = default, Option personalDetails = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + BillingAddressOption = billingAddress; + CheckoutAttemptIdOption = checkoutAttemptId; + DeliveryAddressOption = deliveryAddress; + PersonalDetailsOption = personalDetails; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **openinvoice** /// /// **openinvoice** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Openinvoice for value: openinvoice /// - [EnumMember(Value = "openinvoice")] Openinvoice = 1, /// /// Enum AfterpayDirectdebit for value: afterpay_directdebit /// - [EnumMember(Value = "afterpay_directdebit")] AfterpayDirectdebit = 2, /// /// Enum AtomePos for value: atome_pos /// - [EnumMember(Value = "atome_pos")] AtomePos = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("openinvoice")) + return TypeEnum.Openinvoice; + + if (value.Equals("afterpay_directdebit")) + return TypeEnum.AfterpayDirectdebit; + + if (value.Equals("atome_pos")) + return TypeEnum.AtomePos; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("openinvoice")) + return TypeEnum.Openinvoice; + + if (value.Equals("afterpay_directdebit")) + return TypeEnum.AfterpayDirectdebit; + + if (value.Equals("atome_pos")) + return TypeEnum.AtomePos; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Openinvoice) + return "openinvoice"; + + if (value == TypeEnum.AfterpayDirectdebit) + return "afterpay_directdebit"; + + if (value == TypeEnum.AtomePos) + return "atome_pos"; + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **openinvoice** /// /// **openinvoice** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of BillingAddress /// - /// The address where to send the invoice.. - /// The checkout attempt identifier.. - /// The address where the goods should be delivered.. - /// Shopper name, date of birth, phone number, and email address.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **openinvoice** (default to TypeEnum.Openinvoice). - public OpenInvoiceDetails(string billingAddress = default(string), string checkoutAttemptId = default(string), string deliveryAddress = default(string), string personalDetails = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Openinvoice) - { - this.BillingAddress = billingAddress; - this.CheckoutAttemptId = checkoutAttemptId; - this.DeliveryAddress = deliveryAddress; - this.PersonalDetails = personalDetails; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressOption { get; private set; } /// /// The address where to send the invoice. /// /// The address where to send the invoice. - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public string BillingAddress { get; set; } + [JsonPropertyName("billingAddress")] + public string BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryAddressOption { get; private set; } /// /// The address where the goods should be delivered. /// /// The address where the goods should be delivered. - [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] - public string DeliveryAddress { get; set; } + [JsonPropertyName("deliveryAddress")] + public string DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } + + /// + /// Used to track the state of PersonalDetails + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PersonalDetailsOption { get; private set; } /// /// Shopper name, date of birth, phone number, and email address. /// /// Shopper name, date of birth, phone number, and email address. - [DataMember(Name = "personalDetails", EmitDefaultValue = false)] - public string PersonalDetails { get; set; } + [JsonPropertyName("personalDetails")] + public string PersonalDetails { get { return this.PersonalDetailsOption; } set { this.PersonalDetailsOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -150,124 +253,182 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OpenInvoiceDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class OpenInvoiceDetailsJsonConverter : JsonConverter + { /// - /// Returns true if OpenInvoiceDetails instances are equal + /// Deserializes json to /// - /// Instance of OpenInvoiceDetails to be compared - /// Boolean - public bool Equals(OpenInvoiceDetails input) + /// + /// + /// + /// + /// + public override OpenInvoiceDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option billingAddress = default; + Option checkoutAttemptId = default; + Option deliveryAddress = default; + Option personalDetails = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "billingAddress": + billingAddress = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "deliveryAddress": + deliveryAddress = new Option(utf8JsonReader.GetString()); + break; + case "personalDetails": + personalDetails = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(OpenInvoiceDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) - ) && - ( - this.PersonalDetails == input.PersonalDetails || - (this.PersonalDetails != null && - this.PersonalDetails.Equals(input.PersonalDetails)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class OpenInvoiceDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class OpenInvoiceDetails."); + + if (deliveryAddress.IsSet && deliveryAddress.Value == null) + throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class OpenInvoiceDetails."); + + if (personalDetails.IsSet && personalDetails.Value == null) + throw new ArgumentNullException(nameof(personalDetails), "Property is not nullable for class OpenInvoiceDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class OpenInvoiceDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class OpenInvoiceDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class OpenInvoiceDetails."); + + return new OpenInvoiceDetails(billingAddress, checkoutAttemptId, deliveryAddress, personalDetails, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OpenInvoiceDetails openInvoiceDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.DeliveryAddress != null) - { - hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); - } - if (this.PersonalDetails != null) - { - hashCode = (hashCode * 59) + this.PersonalDetails.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, openInvoiceDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, OpenInvoiceDetails openInvoiceDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (openInvoiceDetails.BillingAddressOption.IsSet && openInvoiceDetails.BillingAddress == null) + throw new ArgumentNullException(nameof(openInvoiceDetails.BillingAddress), "Property is required for class OpenInvoiceDetails."); - yield break; + if (openInvoiceDetails.CheckoutAttemptIdOption.IsSet && openInvoiceDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(openInvoiceDetails.CheckoutAttemptId), "Property is required for class OpenInvoiceDetails."); + + if (openInvoiceDetails.DeliveryAddressOption.IsSet && openInvoiceDetails.DeliveryAddress == null) + throw new ArgumentNullException(nameof(openInvoiceDetails.DeliveryAddress), "Property is required for class OpenInvoiceDetails."); + + if (openInvoiceDetails.PersonalDetailsOption.IsSet && openInvoiceDetails.PersonalDetails == null) + throw new ArgumentNullException(nameof(openInvoiceDetails.PersonalDetails), "Property is required for class OpenInvoiceDetails."); + + if (openInvoiceDetails.RecurringDetailReferenceOption.IsSet && openInvoiceDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(openInvoiceDetails.RecurringDetailReference), "Property is required for class OpenInvoiceDetails."); + + if (openInvoiceDetails.StoredPaymentMethodIdOption.IsSet && openInvoiceDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(openInvoiceDetails.StoredPaymentMethodId), "Property is required for class OpenInvoiceDetails."); + + if (openInvoiceDetails.BillingAddressOption.IsSet) + writer.WriteString("billingAddress", openInvoiceDetails.BillingAddress); + + if (openInvoiceDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", openInvoiceDetails.CheckoutAttemptId); + + if (openInvoiceDetails.DeliveryAddressOption.IsSet) + writer.WriteString("deliveryAddress", openInvoiceDetails.DeliveryAddress); + + if (openInvoiceDetails.PersonalDetailsOption.IsSet) + writer.WriteString("personalDetails", openInvoiceDetails.PersonalDetails); + + if (openInvoiceDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", openInvoiceDetails.RecurringDetailReference); + + if (openInvoiceDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", openInvoiceDetails.StoredPaymentMethodId); + + var typeRawValue = OpenInvoiceDetails.TypeEnumToJsonValue(openInvoiceDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/Passenger.cs b/Adyen/Model/Checkout/Passenger.cs index 63cc593c3..00f3b1be4 100644 --- a/Adyen/Model/Checkout/Passenger.cs +++ b/Adyen/Model/Checkout/Passenger.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,75 +14,110 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Passenger /// - [DataContract(Name = "Passenger")] - public partial class Passenger : IEquatable, IValidatableObject + public partial class Passenger : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10. - /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII. - /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII. - /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters. - /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters. - public Passenger(DateTime dateOfBirth = default(DateTime), string firstName = default(string), string lastName = default(string), string phoneNumber = default(string), string travellerType = default(string)) + /// The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10 + /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII + /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII + /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters + /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters + [JsonConstructor] + public Passenger(Option dateOfBirth = default, Option firstName = default, Option lastName = default, Option phoneNumber = default, Option travellerType = default) { - this.DateOfBirth = dateOfBirth; - this.FirstName = firstName; - this.LastName = lastName; - this.PhoneNumber = phoneNumber; - this.TravellerType = travellerType; + DateOfBirthOption = dateOfBirth; + FirstNameOption = firstName; + LastNameOption = lastName; + PhoneNumberOption = phoneNumber; + TravellerTypeOption = travellerType; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of DateOfBirth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DateOfBirthOption { get; private set; } + /// /// The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10 /// /// The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10 - [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] - [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime DateOfBirth { get; set; } + [JsonPropertyName("dateOfBirth")] + public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } + + /// + /// Used to track the state of FirstName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FirstNameOption { get; private set; } /// /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII /// /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII - [DataMember(Name = "firstName", EmitDefaultValue = false)] - public string FirstName { get; set; } + [JsonPropertyName("firstName")] + public string FirstName { get { return this.FirstNameOption; } set { this.FirstNameOption = new Option(value); } } + + /// + /// Used to track the state of LastName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LastNameOption { get; private set; } /// /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII /// /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII - [DataMember(Name = "lastName", EmitDefaultValue = false)] - public string LastName { get; set; } + [JsonPropertyName("lastName")] + public string LastName { get { return this.LastNameOption; } set { this.LastNameOption = new Option(value); } } + + /// + /// Used to track the state of PhoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PhoneNumberOption { get; private set; } /// /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters /// /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters - [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] - public string PhoneNumber { get; set; } + [JsonPropertyName("phoneNumber")] + public string PhoneNumber { get { return this.PhoneNumberOption; } set { this.PhoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of TravellerType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TravellerTypeOption { get; private set; } /// /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters /// /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters - [DataMember(Name = "travellerType", EmitDefaultValue = false)] - public string TravellerType { get; set; } + [JsonPropertyName("travellerType")] + public string TravellerType { get { return this.TravellerTypeOption; } set { this.TravellerTypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -103,104 +137,154 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PassengerJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// The format to use to serialize DateOfBirth /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Passenger); - } + public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd"; /// - /// Returns true if Passenger instances are equal + /// Deserializes json to /// - /// Instance of Passenger to be compared - /// Boolean - public bool Equals(Passenger input) + /// + /// + /// + /// + /// + public override Passenger Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option dateOfBirth = default; + Option firstName = default; + Option lastName = default; + Option phoneNumber = default; + Option travellerType = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "dateOfBirth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "phoneNumber": + phoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "travellerType": + travellerType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.DateOfBirth == input.DateOfBirth || - (this.DateOfBirth != null && - this.DateOfBirth.Equals(input.DateOfBirth)) - ) && - ( - this.FirstName == input.FirstName || - (this.FirstName != null && - this.FirstName.Equals(input.FirstName)) - ) && - ( - this.LastName == input.LastName || - (this.LastName != null && - this.LastName.Equals(input.LastName)) - ) && - ( - this.PhoneNumber == input.PhoneNumber || - (this.PhoneNumber != null && - this.PhoneNumber.Equals(input.PhoneNumber)) - ) && - ( - this.TravellerType == input.TravellerType || - (this.TravellerType != null && - this.TravellerType.Equals(input.TravellerType)) - ); + + if (dateOfBirth.IsSet && dateOfBirth.Value == null) + throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class Passenger."); + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Passenger."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class Passenger."); + + if (phoneNumber.IsSet && phoneNumber.Value == null) + throw new ArgumentNullException(nameof(phoneNumber), "Property is not nullable for class Passenger."); + + if (travellerType.IsSet && travellerType.Value == null) + throw new ArgumentNullException(nameof(travellerType), "Property is not nullable for class Passenger."); + + return new Passenger(dateOfBirth, firstName, lastName, phoneNumber, travellerType); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Passenger passenger, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.DateOfBirth != null) - { - hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); - } - if (this.FirstName != null) - { - hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); - } - if (this.LastName != null) - { - hashCode = (hashCode * 59) + this.LastName.GetHashCode(); - } - if (this.PhoneNumber != null) - { - hashCode = (hashCode * 59) + this.PhoneNumber.GetHashCode(); - } - if (this.TravellerType != null) - { - hashCode = (hashCode * 59) + this.TravellerType.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, passenger, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Passenger passenger, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (passenger.FirstNameOption.IsSet && passenger.FirstName == null) + throw new ArgumentNullException(nameof(passenger.FirstName), "Property is required for class Passenger."); + + if (passenger.LastNameOption.IsSet && passenger.LastName == null) + throw new ArgumentNullException(nameof(passenger.LastName), "Property is required for class Passenger."); + + if (passenger.PhoneNumberOption.IsSet && passenger.PhoneNumber == null) + throw new ArgumentNullException(nameof(passenger.PhoneNumber), "Property is required for class Passenger."); + + if (passenger.TravellerTypeOption.IsSet && passenger.TravellerType == null) + throw new ArgumentNullException(nameof(passenger.TravellerType), "Property is required for class Passenger."); + + if (passenger.DateOfBirthOption.IsSet) + writer.WriteString("dateOfBirth", passenger.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); + + if (passenger.FirstNameOption.IsSet) + writer.WriteString("firstName", passenger.FirstName); + + if (passenger.LastNameOption.IsSet) + writer.WriteString("lastName", passenger.LastName); + + if (passenger.PhoneNumberOption.IsSet) + writer.WriteString("phoneNumber", passenger.PhoneNumber); + + if (passenger.TravellerTypeOption.IsSet) + writer.WriteString("travellerType", passenger.TravellerType); } } - } diff --git a/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs b/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs index 4daaccd99..0aa3ab001 100644 --- a/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs +++ b/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,86 +14,141 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PayByBankAISDirectDebitDetails /// - [DataContract(Name = "PayByBankAISDirectDebitDetails")] - public partial class PayByBankAISDirectDebitDetails : IEquatable, IValidatableObject + public partial class PayByBankAISDirectDebitDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **paybybank_AIS_DD** (default to TypeEnum.PaybybankAISDD) + [JsonConstructor] + public PayByBankAISDirectDebitDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.PaybybankAISDD) + { + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + Type = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **paybybank_AIS_DD** /// /// **paybybank_AIS_DD** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum PaybybankAISDD for value: paybybank_AIS_DD /// - [EnumMember(Value = "paybybank_AIS_DD")] PaybybankAISDD = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("paybybank_AIS_DD")) + return TypeEnum.PaybybankAISDD; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("paybybank_AIS_DD")) + return TypeEnum.PaybybankAISDD; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.PaybybankAISDD) + return "paybybank_AIS_DD"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **paybybank_AIS_DD** /// /// **paybybank_AIS_DD** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected PayByBankAISDirectDebitDetails() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **paybybank_AIS_DD** (required) (default to TypeEnum.PaybybankAISDD). - public PayByBankAISDirectDebitDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.PaybybankAISDD) - { - this.Type = type; - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -113,97 +167,146 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PayByBankAISDirectDebitDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class PayByBankAISDirectDebitDetailsJsonConverter : JsonConverter + { /// - /// Returns true if PayByBankAISDirectDebitDetails instances are equal + /// Deserializes json to /// - /// Instance of PayByBankAISDirectDebitDetails to be compared - /// Boolean - public bool Equals(PayByBankAISDirectDebitDetails input) + /// + /// + /// + /// + /// + public override PayByBankAISDirectDebitDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(PayByBankAISDirectDebitDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class PayByBankAISDirectDebitDetails.", nameof(type)); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayByBankAISDirectDebitDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayByBankAISDirectDebitDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayByBankAISDirectDebitDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayByBankAISDirectDebitDetails."); + + return new PayByBankAISDirectDebitDetails(checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PayByBankAISDirectDebitDetails payByBankAISDirectDebitDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, payByBankAISDirectDebitDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PayByBankAISDirectDebitDetails payByBankAISDirectDebitDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (payByBankAISDirectDebitDetails.CheckoutAttemptIdOption.IsSet && payByBankAISDirectDebitDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(payByBankAISDirectDebitDetails.CheckoutAttemptId), "Property is required for class PayByBankAISDirectDebitDetails."); - yield break; + if (payByBankAISDirectDebitDetails.RecurringDetailReferenceOption.IsSet && payByBankAISDirectDebitDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(payByBankAISDirectDebitDetails.RecurringDetailReference), "Property is required for class PayByBankAISDirectDebitDetails."); + + if (payByBankAISDirectDebitDetails.StoredPaymentMethodIdOption.IsSet && payByBankAISDirectDebitDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(payByBankAISDirectDebitDetails.StoredPaymentMethodId), "Property is required for class PayByBankAISDirectDebitDetails."); + + if (payByBankAISDirectDebitDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", payByBankAISDirectDebitDetails.CheckoutAttemptId); + + if (payByBankAISDirectDebitDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", payByBankAISDirectDebitDetails.RecurringDetailReference); + + if (payByBankAISDirectDebitDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", payByBankAISDirectDebitDetails.StoredPaymentMethodId); + + var typeRawValue = PayByBankAISDirectDebitDetails.TypeEnumToJsonValue(payByBankAISDirectDebitDetails.Type); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/PayByBankDetails.cs b/Adyen/Model/Checkout/PayByBankDetails.cs index b34dca7de..5c79c8075 100644 --- a/Adyen/Model/Checkout/PayByBankDetails.cs +++ b/Adyen/Model/Checkout/PayByBankDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,76 +14,124 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PayByBankDetails /// - [DataContract(Name = "PayByBankDetails")] - public partial class PayByBankDetails : IEquatable, IValidatableObject + public partial class PayByBankDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// The PayByBank issuer value of the shopper's selected bank. + /// **paybybank** (default to TypeEnum.Paybybank) + [JsonConstructor] + public PayByBankDetails(Option checkoutAttemptId = default, Option issuer = default, TypeEnum type = TypeEnum.Paybybank) + { + CheckoutAttemptIdOption = checkoutAttemptId; + IssuerOption = issuer; + Type = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **paybybank** /// /// **paybybank** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Paybybank for value: paybybank /// - [EnumMember(Value = "paybybank")] Paybybank = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("paybybank")) + return TypeEnum.Paybybank; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("paybybank")) + return TypeEnum.Paybybank; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.Paybybank) + return "paybybank"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **paybybank** /// /// **paybybank** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected PayByBankDetails() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The PayByBank issuer value of the shopper's selected bank.. - /// **paybybank** (required) (default to TypeEnum.Paybybank). - public PayByBankDetails(string checkoutAttemptId = default(string), string issuer = default(string), TypeEnum type = TypeEnum.Paybybank) - { - this.Type = type; - this.CheckoutAttemptId = checkoutAttemptId; - this.Issuer = issuer; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of Issuer + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IssuerOption { get; private set; } /// /// The PayByBank issuer value of the shopper's selected bank. /// /// The PayByBank issuer value of the shopper's selected bank. - [DataMember(Name = "issuer", EmitDefaultValue = false)] - public string Issuer { get; set; } + [JsonPropertyName("issuer")] + public string Issuer { get { return this.IssuerOption; } set { this.IssuerOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -102,82 +149,127 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PayByBankDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PayByBankDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PayByBankDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PayByBankDetails instances are equal - /// - /// Instance of PayByBankDetails to be compared - /// Boolean - public bool Equals(PayByBankDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option issuer = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "issuer": + issuer = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(PayByBankDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Issuer == input.Issuer || - (this.Issuer != null && - this.Issuer.Equals(input.Issuer)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class PayByBankDetails.", nameof(type)); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayByBankDetails."); + + if (issuer.IsSet && issuer.Value == null) + throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class PayByBankDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayByBankDetails."); + + return new PayByBankDetails(checkoutAttemptId, issuer, type.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PayByBankDetails payByBankDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.Issuer != null) - { - hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, payByBankDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PayByBankDetails payByBankDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (payByBankDetails.CheckoutAttemptIdOption.IsSet && payByBankDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(payByBankDetails.CheckoutAttemptId), "Property is required for class PayByBankDetails."); + + if (payByBankDetails.IssuerOption.IsSet && payByBankDetails.Issuer == null) + throw new ArgumentNullException(nameof(payByBankDetails.Issuer), "Property is required for class PayByBankDetails."); + + if (payByBankDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", payByBankDetails.CheckoutAttemptId); + + if (payByBankDetails.IssuerOption.IsSet) + writer.WriteString("issuer", payByBankDetails.Issuer); + + var typeRawValue = PayByBankDetails.TypeEnumToJsonValue(payByBankDetails.Type); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/PayPalDetails.cs b/Adyen/Model/Checkout/PayPalDetails.cs index 3faf34a69..0a552c15c 100644 --- a/Adyen/Model/Checkout/PayPalDetails.cs +++ b/Adyen/Model/Checkout/PayPalDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,158 +14,302 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PayPalDetails /// - [DataContract(Name = "PayPalDetails")] - public partial class PayPalDetails : IEquatable, IValidatableObject + public partial class PayPalDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// The unique ID associated with the order. + /// IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED + /// The unique ID associated with the payer. + /// PAYPAL or PAYPAL_CREDIT + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The type of flow to initiate. + /// **paypal** (default to TypeEnum.Paypal) + [JsonConstructor] + public PayPalDetails(Option checkoutAttemptId = default, Option orderID = default, Option payeePreferred = default, Option payerID = default, Option payerSelected = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option subtype = default, TypeEnum type = TypeEnum.Paypal) + { + CheckoutAttemptIdOption = checkoutAttemptId; + OrderIDOption = orderID; + PayeePreferredOption = payeePreferred; + PayerIDOption = payerID; + PayerSelectedOption = payerSelected; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + SubtypeOption = subtype; + Type = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The type of flow to initiate. /// /// The type of flow to initiate. - [JsonConverter(typeof(StringEnumConverter))] public enum SubtypeEnum { /// /// Enum Express for value: express /// - [EnumMember(Value = "express")] Express = 1, /// /// Enum Redirect for value: redirect /// - [EnumMember(Value = "redirect")] Redirect = 2, /// /// Enum Sdk for value: sdk /// - [EnumMember(Value = "sdk")] Sdk = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static SubtypeEnum SubtypeEnumFromString(string value) + { + if (value.Equals("express")) + return SubtypeEnum.Express; + + if (value.Equals("redirect")) + return SubtypeEnum.Redirect; + + if (value.Equals("sdk")) + return SubtypeEnum.Sdk; + + throw new NotImplementedException($"Could not convert value to type SubtypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static SubtypeEnum? SubtypeEnumFromStringOrDefault(string value) + { + if (value.Equals("express")) + return SubtypeEnum.Express; + + if (value.Equals("redirect")) + return SubtypeEnum.Redirect; + + if (value.Equals("sdk")) + return SubtypeEnum.Sdk; + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string SubtypeEnumToJsonValue(SubtypeEnum? value) + { + if (value == SubtypeEnum.Express) + return "express"; + + if (value == SubtypeEnum.Redirect) + return "redirect"; + + if (value == SubtypeEnum.Sdk) + return "sdk"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Subtype + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubtypeOption { get; private set; } /// /// The type of flow to initiate. /// /// The type of flow to initiate. - [DataMember(Name = "subtype", EmitDefaultValue = false)] - public SubtypeEnum? Subtype { get; set; } + [JsonPropertyName("subtype")] + public SubtypeEnum? Subtype { get { return this.SubtypeOption; } set { this.SubtypeOption = new Option(value); } } + /// /// **paypal** /// /// **paypal** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Paypal for value: paypal /// - [EnumMember(Value = "paypal")] Paypal = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("paypal")) + return TypeEnum.Paypal; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("paypal")) + return TypeEnum.Paypal; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.Paypal) + return "paypal"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **paypal** /// /// **paypal** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - [JsonConstructorAttribute] - protected PayPalDetails() { } - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier.. - /// The unique ID associated with the order.. - /// IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED. - /// The unique ID associated with the payer.. - /// PAYPAL or PAYPAL_CREDIT. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The type of flow to initiate.. - /// **paypal** (required) (default to TypeEnum.Paypal). - public PayPalDetails(string checkoutAttemptId = default(string), string orderID = default(string), string payeePreferred = default(string), string payerID = default(string), string payerSelected = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), SubtypeEnum? subtype = default(SubtypeEnum?), TypeEnum type = TypeEnum.Paypal) - { - this.Type = type; - this.CheckoutAttemptId = checkoutAttemptId; - this.OrderID = orderID; - this.PayeePreferred = payeePreferred; - this.PayerID = payerID; - this.PayerSelected = payerSelected; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Subtype = subtype; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of OrderID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OrderIDOption { get; private set; } /// /// The unique ID associated with the order. /// /// The unique ID associated with the order. - [DataMember(Name = "orderID", EmitDefaultValue = false)] - public string OrderID { get; set; } + [JsonPropertyName("orderID")] + public string OrderID { get { return this.OrderIDOption; } set { this.OrderIDOption = new Option(value); } } + + /// + /// Used to track the state of PayeePreferred + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayeePreferredOption { get; private set; } /// /// IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED /// /// IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED - [DataMember(Name = "payeePreferred", EmitDefaultValue = false)] - public string PayeePreferred { get; set; } + [JsonPropertyName("payeePreferred")] + public string PayeePreferred { get { return this.PayeePreferredOption; } set { this.PayeePreferredOption = new Option(value); } } + + /// + /// Used to track the state of PayerID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayerIDOption { get; private set; } /// /// The unique ID associated with the payer. /// /// The unique ID associated with the payer. - [DataMember(Name = "payerID", EmitDefaultValue = false)] - public string PayerID { get; set; } + [JsonPropertyName("payerID")] + public string PayerID { get { return this.PayerIDOption; } set { this.PayerIDOption = new Option(value); } } + + /// + /// Used to track the state of PayerSelected + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayerSelectedOption { get; private set; } /// /// PAYPAL or PAYPAL_CREDIT /// /// PAYPAL or PAYPAL_CREDIT - [DataMember(Name = "payerSelected", EmitDefaultValue = false)] - public string PayerSelected { get; set; } + [JsonPropertyName("payerSelected")] + public string PayerSelected { get { return this.PayerSelectedOption; } set { this.PayerSelectedOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -190,138 +333,209 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PayPalDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class PayPalDetailsJsonConverter : JsonConverter + { /// - /// Returns true if PayPalDetails instances are equal + /// Deserializes json to /// - /// Instance of PayPalDetails to be compared - /// Boolean - public bool Equals(PayPalDetails input) + /// + /// + /// + /// + /// + public override PayPalDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option orderID = default; + Option payeePreferred = default; + Option payerID = default; + Option payerSelected = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option subtype = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "orderID": + orderID = new Option(utf8JsonReader.GetString()); + break; + case "payeePreferred": + payeePreferred = new Option(utf8JsonReader.GetString()); + break; + case "payerID": + payerID = new Option(utf8JsonReader.GetString()); + break; + case "payerSelected": + payerSelected = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "subtype": + string subtypeRawValue = utf8JsonReader.GetString(); + if (subtypeRawValue != null) + subtype = new Option(PayPalDetails.SubtypeEnumFromStringOrDefault(subtypeRawValue)); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(PayPalDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.OrderID == input.OrderID || - (this.OrderID != null && - this.OrderID.Equals(input.OrderID)) - ) && - ( - this.PayeePreferred == input.PayeePreferred || - (this.PayeePreferred != null && - this.PayeePreferred.Equals(input.PayeePreferred)) - ) && - ( - this.PayerID == input.PayerID || - (this.PayerID != null && - this.PayerID.Equals(input.PayerID)) - ) && - ( - this.PayerSelected == input.PayerSelected || - (this.PayerSelected != null && - this.PayerSelected.Equals(input.PayerSelected)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Subtype == input.Subtype || - this.Subtype.Equals(input.Subtype) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class PayPalDetails.", nameof(type)); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayPalDetails."); + + if (orderID.IsSet && orderID.Value == null) + throw new ArgumentNullException(nameof(orderID), "Property is not nullable for class PayPalDetails."); + + if (payeePreferred.IsSet && payeePreferred.Value == null) + throw new ArgumentNullException(nameof(payeePreferred), "Property is not nullable for class PayPalDetails."); + + if (payerID.IsSet && payerID.Value == null) + throw new ArgumentNullException(nameof(payerID), "Property is not nullable for class PayPalDetails."); + + if (payerSelected.IsSet && payerSelected.Value == null) + throw new ArgumentNullException(nameof(payerSelected), "Property is not nullable for class PayPalDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayPalDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayPalDetails."); + + if (subtype.IsSet && subtype.Value == null) + throw new ArgumentNullException(nameof(subtype), "Property is not nullable for class PayPalDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayPalDetails."); + + return new PayPalDetails(checkoutAttemptId, orderID, payeePreferred, payerID, payerSelected, recurringDetailReference, storedPaymentMethodId, subtype, type.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PayPalDetails payPalDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.OrderID != null) - { - hashCode = (hashCode * 59) + this.OrderID.GetHashCode(); - } - if (this.PayeePreferred != null) - { - hashCode = (hashCode * 59) + this.PayeePreferred.GetHashCode(); - } - if (this.PayerID != null) - { - hashCode = (hashCode * 59) + this.PayerID.GetHashCode(); - } - if (this.PayerSelected != null) - { - hashCode = (hashCode * 59) + this.PayerSelected.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Subtype.GetHashCode(); - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, payPalDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PayPalDetails payPalDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (payPalDetails.CheckoutAttemptIdOption.IsSet && payPalDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(payPalDetails.CheckoutAttemptId), "Property is required for class PayPalDetails."); - yield break; + if (payPalDetails.OrderIDOption.IsSet && payPalDetails.OrderID == null) + throw new ArgumentNullException(nameof(payPalDetails.OrderID), "Property is required for class PayPalDetails."); + + if (payPalDetails.PayeePreferredOption.IsSet && payPalDetails.PayeePreferred == null) + throw new ArgumentNullException(nameof(payPalDetails.PayeePreferred), "Property is required for class PayPalDetails."); + + if (payPalDetails.PayerIDOption.IsSet && payPalDetails.PayerID == null) + throw new ArgumentNullException(nameof(payPalDetails.PayerID), "Property is required for class PayPalDetails."); + + if (payPalDetails.PayerSelectedOption.IsSet && payPalDetails.PayerSelected == null) + throw new ArgumentNullException(nameof(payPalDetails.PayerSelected), "Property is required for class PayPalDetails."); + + if (payPalDetails.RecurringDetailReferenceOption.IsSet && payPalDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(payPalDetails.RecurringDetailReference), "Property is required for class PayPalDetails."); + + if (payPalDetails.StoredPaymentMethodIdOption.IsSet && payPalDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(payPalDetails.StoredPaymentMethodId), "Property is required for class PayPalDetails."); + + if (payPalDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", payPalDetails.CheckoutAttemptId); + + if (payPalDetails.OrderIDOption.IsSet) + writer.WriteString("orderID", payPalDetails.OrderID); + + if (payPalDetails.PayeePreferredOption.IsSet) + writer.WriteString("payeePreferred", payPalDetails.PayeePreferred); + + if (payPalDetails.PayerIDOption.IsSet) + writer.WriteString("payerID", payPalDetails.PayerID); + + if (payPalDetails.PayerSelectedOption.IsSet) + writer.WriteString("payerSelected", payPalDetails.PayerSelected); + + if (payPalDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", payPalDetails.RecurringDetailReference); + + if (payPalDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", payPalDetails.StoredPaymentMethodId); + + var subtypeRawValue = PayPalDetails.SubtypeEnumToJsonValue(payPalDetails.SubtypeOption.Value.Value); + writer.WriteString("subtype", subtypeRawValue); + var typeRawValue = PayPalDetails.TypeEnumToJsonValue(payPalDetails.Type); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/PayPayDetails.cs b/Adyen/Model/Checkout/PayPayDetails.cs index 796bc2287..32efdd794 100644 --- a/Adyen/Model/Checkout/PayPayDetails.cs +++ b/Adyen/Model/Checkout/PayPayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,81 +14,148 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PayPayDetails /// - [DataContract(Name = "PayPayDetails")] - public partial class PayPayDetails : IEquatable, IValidatableObject + public partial class PayPayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **paypay** (default to TypeEnum.Paypay) + [JsonConstructor] + public PayPayDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **paypay** /// /// **paypay** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Paypay for value: paypay /// - [EnumMember(Value = "paypay")] Paypay = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("paypay")) + return TypeEnum.Paypay; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("paypay")) + return TypeEnum.Paypay; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Paypay) + return "paypay"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **paypay** /// /// **paypay** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **paypay** (default to TypeEnum.Paypay). - public PayPayDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Paypay) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -108,97 +174,143 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PayPayDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class PayPayDetailsJsonConverter : JsonConverter + { /// - /// Returns true if PayPayDetails instances are equal + /// Deserializes json to /// - /// Instance of PayPayDetails to be compared - /// Boolean - public bool Equals(PayPayDetails input) + /// + /// + /// + /// + /// + public override PayPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(PayPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayPayDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayPayDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayPayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayPayDetails."); + + return new PayPayDetails(checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PayPayDetails payPayDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, payPayDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PayPayDetails payPayDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (payPayDetails.CheckoutAttemptIdOption.IsSet && payPayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(payPayDetails.CheckoutAttemptId), "Property is required for class PayPayDetails."); - yield break; + if (payPayDetails.RecurringDetailReferenceOption.IsSet && payPayDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(payPayDetails.RecurringDetailReference), "Property is required for class PayPayDetails."); + + if (payPayDetails.StoredPaymentMethodIdOption.IsSet && payPayDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(payPayDetails.StoredPaymentMethodId), "Property is required for class PayPayDetails."); + + if (payPayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", payPayDetails.CheckoutAttemptId); + + if (payPayDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", payPayDetails.RecurringDetailReference); + + if (payPayDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", payPayDetails.StoredPaymentMethodId); + + var typeRawValue = PayPayDetails.TypeEnumToJsonValue(payPayDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/PayToDetails.cs b/Adyen/Model/Checkout/PayToDetails.cs index 718ee3940..39d7575d5 100644 --- a/Adyen/Model/Checkout/PayToDetails.cs +++ b/Adyen/Model/Checkout/PayToDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,90 +14,164 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PayToDetails /// - [DataContract(Name = "PayToDetails")] - public partial class PayToDetails : IEquatable, IValidatableObject + public partial class PayToDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The shopper's banking details or payId reference, used to complete payment. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **payto** (default to TypeEnum.Payto) + [JsonConstructor] + public PayToDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option shopperAccountIdentifier = default, Option storedPaymentMethodId = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + ShopperAccountIdentifierOption = shopperAccountIdentifier; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **payto** /// /// **payto** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Payto for value: payto /// - [EnumMember(Value = "payto")] Payto = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("payto")) + return TypeEnum.Payto; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("payto")) + return TypeEnum.Payto; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Payto) + return "payto"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **payto** /// /// **payto** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The shopper's banking details or payId reference, used to complete payment.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **payto** (default to TypeEnum.Payto). - public PayToDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string shopperAccountIdentifier = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Payto) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.ShopperAccountIdentifier = shopperAccountIdentifier; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperAccountIdentifier + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperAccountIdentifierOption { get; private set; } /// /// The shopper's banking details or payId reference, used to complete payment. /// /// The shopper's banking details or payId reference, used to complete payment. - [DataMember(Name = "shopperAccountIdentifier", EmitDefaultValue = false)] - public string ShopperAccountIdentifier { get; set; } + [JsonPropertyName("shopperAccountIdentifier")] + public string ShopperAccountIdentifier { get { return this.ShopperAccountIdentifierOption; } set { this.ShopperAccountIdentifierOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -118,106 +191,156 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PayToDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class PayToDetailsJsonConverter : JsonConverter + { /// - /// Returns true if PayToDetails instances are equal + /// Deserializes json to /// - /// Instance of PayToDetails to be compared - /// Boolean - public bool Equals(PayToDetails input) + /// + /// + /// + /// + /// + public override PayToDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option shopperAccountIdentifier = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "shopperAccountIdentifier": + shopperAccountIdentifier = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(PayToDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.ShopperAccountIdentifier == input.ShopperAccountIdentifier || - (this.ShopperAccountIdentifier != null && - this.ShopperAccountIdentifier.Equals(input.ShopperAccountIdentifier)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayToDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayToDetails."); + + if (shopperAccountIdentifier.IsSet && shopperAccountIdentifier.Value == null) + throw new ArgumentNullException(nameof(shopperAccountIdentifier), "Property is not nullable for class PayToDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayToDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayToDetails."); + + return new PayToDetails(checkoutAttemptId, recurringDetailReference, shopperAccountIdentifier, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PayToDetails payToDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.ShopperAccountIdentifier != null) - { - hashCode = (hashCode * 59) + this.ShopperAccountIdentifier.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, payToDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PayToDetails payToDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (payToDetails.CheckoutAttemptIdOption.IsSet && payToDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(payToDetails.CheckoutAttemptId), "Property is required for class PayToDetails."); - yield break; + if (payToDetails.RecurringDetailReferenceOption.IsSet && payToDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(payToDetails.RecurringDetailReference), "Property is required for class PayToDetails."); + + if (payToDetails.ShopperAccountIdentifierOption.IsSet && payToDetails.ShopperAccountIdentifier == null) + throw new ArgumentNullException(nameof(payToDetails.ShopperAccountIdentifier), "Property is required for class PayToDetails."); + + if (payToDetails.StoredPaymentMethodIdOption.IsSet && payToDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(payToDetails.StoredPaymentMethodId), "Property is required for class PayToDetails."); + + if (payToDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", payToDetails.CheckoutAttemptId); + + if (payToDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", payToDetails.RecurringDetailReference); + + if (payToDetails.ShopperAccountIdentifierOption.IsSet) + writer.WriteString("shopperAccountIdentifier", payToDetails.ShopperAccountIdentifier); + + if (payToDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", payToDetails.StoredPaymentMethodId); + + var typeRawValue = PayToDetails.TypeEnumToJsonValue(payToDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/PayUUpiDetails.cs b/Adyen/Model/Checkout/PayUUpiDetails.cs index e61d26df4..7b7d2a83a 100644 --- a/Adyen/Model/Checkout/PayUUpiDetails.cs +++ b/Adyen/Model/Checkout/PayUUpiDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,104 +14,173 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PayUUpiDetails /// - [DataContract(Name = "PayUUpiDetails")] - public partial class PayUUpiDetails : IEquatable, IValidatableObject + public partial class PayUUpiDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **payu_IN_upi** (default to TypeEnum.PayuINUpi) + /// The virtual payment address for UPI. + [JsonConstructor] + public PayUUpiDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option shopperNotificationReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.PayuINUpi, Option virtualPaymentAddress = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + ShopperNotificationReferenceOption = shopperNotificationReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + Type = type; + VirtualPaymentAddressOption = virtualPaymentAddress; + OnCreated(); + } + + partial void OnCreated(); + /// /// **payu_IN_upi** /// /// **payu_IN_upi** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum PayuINUpi for value: payu_IN_upi /// - [EnumMember(Value = "payu_IN_upi")] PayuINUpi = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("payu_IN_upi")) + return TypeEnum.PayuINUpi; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("payu_IN_upi")) + return TypeEnum.PayuINUpi; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.PayuINUpi) + return "payu_IN_upi"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **payu_IN_upi** /// /// **payu_IN_upi** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - [JsonConstructorAttribute] - protected PayUUpiDetails() { } - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **payu_IN_upi** (required) (default to TypeEnum.PayuINUpi). - /// The virtual payment address for UPI.. - public PayUUpiDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string shopperNotificationReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.PayuINUpi, string virtualPaymentAddress = default(string)) - { - this.Type = type; - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.ShopperNotificationReference = shopperNotificationReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.VirtualPaymentAddress = virtualPaymentAddress; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperNotificationReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNotificationReferenceOption { get; private set; } /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. - [DataMember(Name = "shopperNotificationReference", EmitDefaultValue = false)] - public string ShopperNotificationReference { get; set; } + [JsonPropertyName("shopperNotificationReference")] + public string ShopperNotificationReference { get { return this.ShopperNotificationReferenceOption; } set { this.ShopperNotificationReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of VirtualPaymentAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VirtualPaymentAddressOption { get; private set; } /// /// The virtual payment address for UPI. /// /// The virtual payment address for UPI. - [DataMember(Name = "virtualPaymentAddress", EmitDefaultValue = false)] - public string VirtualPaymentAddress { get; set; } + [JsonPropertyName("virtualPaymentAddress")] + public string VirtualPaymentAddress { get { return this.VirtualPaymentAddressOption; } set { this.VirtualPaymentAddressOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -133,115 +201,171 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PayUUpiDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class PayUUpiDetailsJsonConverter : JsonConverter + { /// - /// Returns true if PayUUpiDetails instances are equal + /// Deserializes json to /// - /// Instance of PayUUpiDetails to be compared - /// Boolean - public bool Equals(PayUUpiDetails input) + /// + /// + /// + /// + /// + public override PayUUpiDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option shopperNotificationReference = default; + Option storedPaymentMethodId = default; + Option type = default; + Option virtualPaymentAddress = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "shopperNotificationReference": + shopperNotificationReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(PayUUpiDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "virtualPaymentAddress": + virtualPaymentAddress = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.ShopperNotificationReference == input.ShopperNotificationReference || - (this.ShopperNotificationReference != null && - this.ShopperNotificationReference.Equals(input.ShopperNotificationReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.VirtualPaymentAddress == input.VirtualPaymentAddress || - (this.VirtualPaymentAddress != null && - this.VirtualPaymentAddress.Equals(input.VirtualPaymentAddress)) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class PayUUpiDetails.", nameof(type)); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayUUpiDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayUUpiDetails."); + + if (shopperNotificationReference.IsSet && shopperNotificationReference.Value == null) + throw new ArgumentNullException(nameof(shopperNotificationReference), "Property is not nullable for class PayUUpiDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayUUpiDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayUUpiDetails."); + + if (virtualPaymentAddress.IsSet && virtualPaymentAddress.Value == null) + throw new ArgumentNullException(nameof(virtualPaymentAddress), "Property is not nullable for class PayUUpiDetails."); + + return new PayUUpiDetails(checkoutAttemptId, recurringDetailReference, shopperNotificationReference, storedPaymentMethodId, type.Value.Value, virtualPaymentAddress); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PayUUpiDetails payUUpiDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.ShopperNotificationReference != null) - { - hashCode = (hashCode * 59) + this.ShopperNotificationReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.VirtualPaymentAddress != null) - { - hashCode = (hashCode * 59) + this.VirtualPaymentAddress.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, payUUpiDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PayUUpiDetails payUUpiDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (payUUpiDetails.CheckoutAttemptIdOption.IsSet && payUUpiDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(payUUpiDetails.CheckoutAttemptId), "Property is required for class PayUUpiDetails."); - yield break; + if (payUUpiDetails.RecurringDetailReferenceOption.IsSet && payUUpiDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(payUUpiDetails.RecurringDetailReference), "Property is required for class PayUUpiDetails."); + + if (payUUpiDetails.ShopperNotificationReferenceOption.IsSet && payUUpiDetails.ShopperNotificationReference == null) + throw new ArgumentNullException(nameof(payUUpiDetails.ShopperNotificationReference), "Property is required for class PayUUpiDetails."); + + if (payUUpiDetails.StoredPaymentMethodIdOption.IsSet && payUUpiDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(payUUpiDetails.StoredPaymentMethodId), "Property is required for class PayUUpiDetails."); + + if (payUUpiDetails.VirtualPaymentAddressOption.IsSet && payUUpiDetails.VirtualPaymentAddress == null) + throw new ArgumentNullException(nameof(payUUpiDetails.VirtualPaymentAddress), "Property is required for class PayUUpiDetails."); + + if (payUUpiDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", payUUpiDetails.CheckoutAttemptId); + + if (payUUpiDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", payUUpiDetails.RecurringDetailReference); + + if (payUUpiDetails.ShopperNotificationReferenceOption.IsSet) + writer.WriteString("shopperNotificationReference", payUUpiDetails.ShopperNotificationReference); + + if (payUUpiDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", payUUpiDetails.StoredPaymentMethodId); + + var typeRawValue = PayUUpiDetails.TypeEnumToJsonValue(payUUpiDetails.Type); + writer.WriteString("type", typeRawValue); + if (payUUpiDetails.VirtualPaymentAddressOption.IsSet) + writer.WriteString("virtualPaymentAddress", payUUpiDetails.VirtualPaymentAddress); } } - } diff --git a/Adyen/Model/Checkout/PayWithGoogleDetails.cs b/Adyen/Model/Checkout/PayWithGoogleDetails.cs index 39b4bfc98..b8702d8fd 100644 --- a/Adyen/Model/Checkout/PayWithGoogleDetails.cs +++ b/Adyen/Model/Checkout/PayWithGoogleDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,134 +14,256 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PayWithGoogleDetails /// - [DataContract(Name = "PayWithGoogleDetails")] - public partial class PayWithGoogleDetails : IEquatable, IValidatableObject + public partial class PayWithGoogleDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + /// The checkout attempt identifier. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. + /// **paywithgoogle** (default to TypeEnum.Paywithgoogle) + [JsonConstructor] + public PayWithGoogleDetails(string googlePayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option threeDS2SdkVersion = default, Option type = default) + { + GooglePayToken = googlePayToken; + CheckoutAttemptIdOption = checkoutAttemptId; + FundingSourceOption = fundingSource; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + ThreeDS2SdkVersionOption = threeDS2SdkVersion; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// - [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// - [EnumMember(Value = "debit")] Debit = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static FundingSourceEnum FundingSourceEnumFromString(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) + { + if (value == FundingSourceEnum.Credit) + return "credit"; + + if (value == FundingSourceEnum.Debit) + return "debit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public FundingSourceEnum? FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + /// /// **paywithgoogle** /// /// **paywithgoogle** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Paywithgoogle for value: paywithgoogle /// - [EnumMember(Value = "paywithgoogle")] Paywithgoogle = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("paywithgoogle")) + return TypeEnum.Paywithgoogle; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("paywithgoogle")) + return TypeEnum.Paywithgoogle; + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Paywithgoogle) + return "paywithgoogle"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **paywithgoogle** /// /// **paywithgoogle** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. /// - [JsonConstructorAttribute] - protected PayWithGoogleDetails() { } + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + [JsonPropertyName("googlePayToken")] + public string GooglePayToken { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. (required). - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK.. - /// **paywithgoogle** (default to TypeEnum.Paywithgoogle). - public PayWithGoogleDetails(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string googlePayToken = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string threeDS2SdkVersion = default(string), TypeEnum? type = TypeEnum.Paywithgoogle) - { - this.GooglePayToken = googlePayToken; - this.CheckoutAttemptId = checkoutAttemptId; - this.FundingSource = fundingSource; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.ThreeDS2SdkVersion = threeDS2SdkVersion; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + /// Used to track the state of RecurringDetailReference /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - [DataMember(Name = "googlePayToken", IsRequired = false, EmitDefaultValue = false)] - public string GooglePayToken { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2SdkVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2SdkVersionOption { get; private set; } /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - [DataMember(Name = "threeDS2SdkVersion", EmitDefaultValue = false)] - public string ThreeDS2SdkVersion { get; set; } + [JsonPropertyName("threeDS2SdkVersion")] + public string ThreeDS2SdkVersion { get { return this.ThreeDS2SdkVersionOption; } set { this.ThreeDS2SdkVersionOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -152,9 +273,9 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PayWithGoogleDetails {\n"); + sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); - sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" ThreeDS2SdkVersion: ").Append(ThreeDS2SdkVersion).Append("\n"); @@ -163,133 +284,195 @@ public override string ToString() return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PayWithGoogleDetails); - } - - /// - /// Returns true if PayWithGoogleDetails instances are equal - /// - /// Instance of PayWithGoogleDetails to be compared - /// Boolean - public bool Equals(PayWithGoogleDetails input) - { - if (input == null) - { - return false; - } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.FundingSource == input.FundingSource || - this.FundingSource.Equals(input.FundingSource) - ) && - ( - this.GooglePayToken == input.GooglePayToken || - (this.GooglePayToken != null && - this.GooglePayToken.Equals(input.GooglePayToken)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.ThreeDS2SdkVersion == input.ThreeDS2SdkVersion || - (this.ThreeDS2SdkVersion != null && - this.ThreeDS2SdkVersion.Equals(input.ThreeDS2SdkVersion)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - if (this.GooglePayToken != null) - { - hashCode = (hashCode * 59) + this.GooglePayToken.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.ThreeDS2SdkVersion != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2SdkVersion.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // GooglePayToken (string) maxLength if (this.GooglePayToken != null && this.GooglePayToken.Length > 5000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for GooglePayToken, length must be less than 5000.", new [] { "GooglePayToken" }); + yield return new ValidationResult("Invalid value for GooglePayToken, length must be less than 5000.", new [] { "GooglePayToken" }); } // StoredPaymentMethodId (string) maxLength if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); } // ThreeDS2SdkVersion (string) maxLength if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); + yield return new ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); } yield break; } } + /// + /// A Json converter for type + /// + public class PayWithGoogleDetailsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override PayWithGoogleDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option googlePayToken = default; + Option checkoutAttemptId = default; + Option fundingSource = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option threeDS2SdkVersion = default; + Option type = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "googlePayToken": + googlePayToken = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "fundingSource": + string fundingSourceRawValue = utf8JsonReader.GetString(); + if (fundingSourceRawValue != null) + fundingSource = new Option(PayWithGoogleDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2SdkVersion": + threeDS2SdkVersion = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(PayWithGoogleDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } + } + + if (!googlePayToken.IsSet) + throw new ArgumentException("Property is required for class PayWithGoogleDetails.", nameof(googlePayToken)); + + if (googlePayToken.IsSet && googlePayToken.Value == null) + throw new ArgumentNullException(nameof(googlePayToken), "Property is not nullable for class PayWithGoogleDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayWithGoogleDetails."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class PayWithGoogleDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayWithGoogleDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayWithGoogleDetails."); + + if (threeDS2SdkVersion.IsSet && threeDS2SdkVersion.Value == null) + throw new ArgumentNullException(nameof(threeDS2SdkVersion), "Property is not nullable for class PayWithGoogleDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayWithGoogleDetails."); + + return new PayWithGoogleDetails(googlePayToken.Value, checkoutAttemptId, fundingSource, recurringDetailReference, storedPaymentMethodId, threeDS2SdkVersion, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PayWithGoogleDetails payWithGoogleDetails, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, payWithGoogleDetails, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PayWithGoogleDetails payWithGoogleDetails, JsonSerializerOptions jsonSerializerOptions) + { + if (payWithGoogleDetails.GooglePayToken == null) + throw new ArgumentNullException(nameof(payWithGoogleDetails.GooglePayToken), "Property is required for class PayWithGoogleDetails."); + + if (payWithGoogleDetails.CheckoutAttemptIdOption.IsSet && payWithGoogleDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(payWithGoogleDetails.CheckoutAttemptId), "Property is required for class PayWithGoogleDetails."); + + if (payWithGoogleDetails.RecurringDetailReferenceOption.IsSet && payWithGoogleDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(payWithGoogleDetails.RecurringDetailReference), "Property is required for class PayWithGoogleDetails."); + + if (payWithGoogleDetails.StoredPaymentMethodIdOption.IsSet && payWithGoogleDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(payWithGoogleDetails.StoredPaymentMethodId), "Property is required for class PayWithGoogleDetails."); + + if (payWithGoogleDetails.ThreeDS2SdkVersionOption.IsSet && payWithGoogleDetails.ThreeDS2SdkVersion == null) + throw new ArgumentNullException(nameof(payWithGoogleDetails.ThreeDS2SdkVersion), "Property is required for class PayWithGoogleDetails."); + + writer.WriteString("googlePayToken", payWithGoogleDetails.GooglePayToken); + + if (payWithGoogleDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", payWithGoogleDetails.CheckoutAttemptId); + + var fundingSourceRawValue = PayWithGoogleDetails.FundingSourceEnumToJsonValue(payWithGoogleDetails.FundingSourceOption.Value.Value); + writer.WriteString("fundingSource", fundingSourceRawValue); + if (payWithGoogleDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", payWithGoogleDetails.RecurringDetailReference); + + if (payWithGoogleDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", payWithGoogleDetails.StoredPaymentMethodId); + + if (payWithGoogleDetails.ThreeDS2SdkVersionOption.IsSet) + writer.WriteString("threeDS2SdkVersion", payWithGoogleDetails.ThreeDS2SdkVersion); + + var typeRawValue = PayWithGoogleDetails.TypeEnumToJsonValue(payWithGoogleDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); + } + } } diff --git a/Adyen/Model/Checkout/PayWithGoogleDonations.cs b/Adyen/Model/Checkout/PayWithGoogleDonations.cs index 3062f2d61..e20baa034 100644 --- a/Adyen/Model/Checkout/PayWithGoogleDonations.cs +++ b/Adyen/Model/Checkout/PayWithGoogleDonations.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,134 +14,256 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PayWithGoogleDonations /// - [DataContract(Name = "PayWithGoogleDonations")] - public partial class PayWithGoogleDonations : IEquatable, IValidatableObject + public partial class PayWithGoogleDonations : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + /// The checkout attempt identifier. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. + /// **paywithgoogle** (default to TypeEnum.Paywithgoogle) + [JsonConstructor] + public PayWithGoogleDonations(string googlePayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option threeDS2SdkVersion = default, Option type = default) + { + GooglePayToken = googlePayToken; + CheckoutAttemptIdOption = checkoutAttemptId; + FundingSourceOption = fundingSource; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + ThreeDS2SdkVersionOption = threeDS2SdkVersion; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// - [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// - [EnumMember(Value = "debit")] Debit = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static FundingSourceEnum FundingSourceEnumFromString(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) + { + if (value == FundingSourceEnum.Credit) + return "credit"; + + if (value == FundingSourceEnum.Debit) + return "debit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public FundingSourceEnum? FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + /// /// **paywithgoogle** /// /// **paywithgoogle** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Paywithgoogle for value: paywithgoogle /// - [EnumMember(Value = "paywithgoogle")] Paywithgoogle = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("paywithgoogle")) + return TypeEnum.Paywithgoogle; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("paywithgoogle")) + return TypeEnum.Paywithgoogle; + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Paywithgoogle) + return "paywithgoogle"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **paywithgoogle** /// /// **paywithgoogle** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. /// - [JsonConstructorAttribute] - protected PayWithGoogleDonations() { } + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + [JsonPropertyName("googlePayToken")] + public string GooglePayToken { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. (required). - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK.. - /// **paywithgoogle** (default to TypeEnum.Paywithgoogle). - public PayWithGoogleDonations(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string googlePayToken = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string threeDS2SdkVersion = default(string), TypeEnum? type = TypeEnum.Paywithgoogle) - { - this.GooglePayToken = googlePayToken; - this.CheckoutAttemptId = checkoutAttemptId; - this.FundingSource = fundingSource; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.ThreeDS2SdkVersion = threeDS2SdkVersion; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + /// Used to track the state of RecurringDetailReference /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - [DataMember(Name = "googlePayToken", IsRequired = false, EmitDefaultValue = false)] - public string GooglePayToken { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2SdkVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2SdkVersionOption { get; private set; } /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - [DataMember(Name = "threeDS2SdkVersion", EmitDefaultValue = false)] - public string ThreeDS2SdkVersion { get; set; } + [JsonPropertyName("threeDS2SdkVersion")] + public string ThreeDS2SdkVersion { get { return this.ThreeDS2SdkVersionOption; } set { this.ThreeDS2SdkVersionOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -152,9 +273,9 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PayWithGoogleDonations {\n"); + sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); - sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" ThreeDS2SdkVersion: ").Append(ThreeDS2SdkVersion).Append("\n"); @@ -163,133 +284,195 @@ public override string ToString() return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PayWithGoogleDonations); - } - - /// - /// Returns true if PayWithGoogleDonations instances are equal - /// - /// Instance of PayWithGoogleDonations to be compared - /// Boolean - public bool Equals(PayWithGoogleDonations input) - { - if (input == null) - { - return false; - } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.FundingSource == input.FundingSource || - this.FundingSource.Equals(input.FundingSource) - ) && - ( - this.GooglePayToken == input.GooglePayToken || - (this.GooglePayToken != null && - this.GooglePayToken.Equals(input.GooglePayToken)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.ThreeDS2SdkVersion == input.ThreeDS2SdkVersion || - (this.ThreeDS2SdkVersion != null && - this.ThreeDS2SdkVersion.Equals(input.ThreeDS2SdkVersion)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - if (this.GooglePayToken != null) - { - hashCode = (hashCode * 59) + this.GooglePayToken.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.ThreeDS2SdkVersion != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2SdkVersion.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // GooglePayToken (string) maxLength if (this.GooglePayToken != null && this.GooglePayToken.Length > 5000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for GooglePayToken, length must be less than 5000.", new [] { "GooglePayToken" }); + yield return new ValidationResult("Invalid value for GooglePayToken, length must be less than 5000.", new [] { "GooglePayToken" }); } // StoredPaymentMethodId (string) maxLength if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); } // ThreeDS2SdkVersion (string) maxLength if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); + yield return new ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); } yield break; } } + /// + /// A Json converter for type + /// + public class PayWithGoogleDonationsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override PayWithGoogleDonations Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option googlePayToken = default; + Option checkoutAttemptId = default; + Option fundingSource = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option threeDS2SdkVersion = default; + Option type = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "googlePayToken": + googlePayToken = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "fundingSource": + string fundingSourceRawValue = utf8JsonReader.GetString(); + if (fundingSourceRawValue != null) + fundingSource = new Option(PayWithGoogleDonations.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2SdkVersion": + threeDS2SdkVersion = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(PayWithGoogleDonations.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } + } + + if (!googlePayToken.IsSet) + throw new ArgumentException("Property is required for class PayWithGoogleDonations.", nameof(googlePayToken)); + + if (googlePayToken.IsSet && googlePayToken.Value == null) + throw new ArgumentNullException(nameof(googlePayToken), "Property is not nullable for class PayWithGoogleDonations."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayWithGoogleDonations."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class PayWithGoogleDonations."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayWithGoogleDonations."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayWithGoogleDonations."); + + if (threeDS2SdkVersion.IsSet && threeDS2SdkVersion.Value == null) + throw new ArgumentNullException(nameof(threeDS2SdkVersion), "Property is not nullable for class PayWithGoogleDonations."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayWithGoogleDonations."); + + return new PayWithGoogleDonations(googlePayToken.Value, checkoutAttemptId, fundingSource, recurringDetailReference, storedPaymentMethodId, threeDS2SdkVersion, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PayWithGoogleDonations payWithGoogleDonations, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, payWithGoogleDonations, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PayWithGoogleDonations payWithGoogleDonations, JsonSerializerOptions jsonSerializerOptions) + { + if (payWithGoogleDonations.GooglePayToken == null) + throw new ArgumentNullException(nameof(payWithGoogleDonations.GooglePayToken), "Property is required for class PayWithGoogleDonations."); + + if (payWithGoogleDonations.CheckoutAttemptIdOption.IsSet && payWithGoogleDonations.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(payWithGoogleDonations.CheckoutAttemptId), "Property is required for class PayWithGoogleDonations."); + + if (payWithGoogleDonations.RecurringDetailReferenceOption.IsSet && payWithGoogleDonations.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(payWithGoogleDonations.RecurringDetailReference), "Property is required for class PayWithGoogleDonations."); + + if (payWithGoogleDonations.StoredPaymentMethodIdOption.IsSet && payWithGoogleDonations.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(payWithGoogleDonations.StoredPaymentMethodId), "Property is required for class PayWithGoogleDonations."); + + if (payWithGoogleDonations.ThreeDS2SdkVersionOption.IsSet && payWithGoogleDonations.ThreeDS2SdkVersion == null) + throw new ArgumentNullException(nameof(payWithGoogleDonations.ThreeDS2SdkVersion), "Property is required for class PayWithGoogleDonations."); + + writer.WriteString("googlePayToken", payWithGoogleDonations.GooglePayToken); + + if (payWithGoogleDonations.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", payWithGoogleDonations.CheckoutAttemptId); + + var fundingSourceRawValue = PayWithGoogleDonations.FundingSourceEnumToJsonValue(payWithGoogleDonations.FundingSourceOption.Value.Value); + writer.WriteString("fundingSource", fundingSourceRawValue); + if (payWithGoogleDonations.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", payWithGoogleDonations.RecurringDetailReference); + + if (payWithGoogleDonations.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", payWithGoogleDonations.StoredPaymentMethodId); + + if (payWithGoogleDonations.ThreeDS2SdkVersionOption.IsSet) + writer.WriteString("threeDS2SdkVersion", payWithGoogleDonations.ThreeDS2SdkVersion); + + var typeRawValue = PayWithGoogleDonations.TypeEnumToJsonValue(payWithGoogleDonations.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); + } + } } diff --git a/Adyen/Model/Checkout/Payment.cs b/Adyen/Model/Checkout/Payment.cs new file mode 100644 index 000000000..5cbfd1b3e --- /dev/null +++ b/Adyen/Model/Checkout/Payment.cs @@ -0,0 +1,313 @@ +// +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using Adyen.Client; + +namespace Adyen.Model.Checkout +{ + /// + /// Payment + /// + public partial class Payment : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// paymentMethod + /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique. Use this reference when you communicate with us about this request. + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. + [JsonConstructor] + public Payment(Option amount = default, Option paymentMethod = default, Option pspReference = default, Option resultCode = default) + { + AmountOption = amount; + PaymentMethodOption = paymentMethod; + PspReferenceOption = pspReference; + ResultCodeOption = resultCode; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. + /// + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. + public enum ResultCodeEnum + { + /// + /// Enum Authorised for value: Authorised + /// + Authorised = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ResultCodeEnum ResultCodeEnumFromString(string value) + { + if (value.Equals("Authorised")) + return ResultCodeEnum.Authorised; + + throw new NotImplementedException($"Could not convert value to type ResultCodeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ResultCodeEnum? ResultCodeEnumFromStringOrDefault(string value) + { + if (value.Equals("Authorised")) + return ResultCodeEnum.Authorised; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ResultCodeEnumToJsonValue(ResultCodeEnum? value) + { + if (value == ResultCodeEnum.Authorised) + return "Authorised"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ResultCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ResultCodeOption { get; private set; } + + /// + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. + /// + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. + [JsonPropertyName("resultCode")] + public ResultCodeEnum? ResultCode { get { return this.ResultCodeOption; } set { this.ResultCodeOption = new Option(value); } } + + /// + /// Used to track the state of Amount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountOption { get; private set; } + + /// + /// Gets or Sets Amount + /// + [JsonPropertyName("amount")] + public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodOption { get; private set; } + + /// + /// Gets or Sets PaymentMethod + /// + [JsonPropertyName("paymentMethod")] + public ResponsePaymentMethod PaymentMethod { get { return this.PaymentMethodOption; } set { this.PaymentMethodOption = new Option(value); } } + + /// + /// Used to track the state of PspReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PspReferenceOption { get; private set; } + + /// + /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique. Use this reference when you communicate with us about this request. + /// + /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique. Use this reference when you communicate with us about this request. + [JsonPropertyName("pspReference")] + public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Payment {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).Append("\n"); + sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class PaymentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Payment Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option paymentMethod = default; + Option pspReference = default; + Option resultCode = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "paymentMethod": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "resultCode": + string resultCodeRawValue = utf8JsonReader.GetString(); + if (resultCodeRawValue != null) + resultCode = new Option(Payment.ResultCodeEnumFromStringOrDefault(resultCodeRawValue)); + break; + default: + break; + } + } + } + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class Payment."); + + if (paymentMethod.IsSet && paymentMethod.Value == null) + throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class Payment."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class Payment."); + + if (resultCode.IsSet && resultCode.Value == null) + throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class Payment."); + + return new Payment(amount, paymentMethod, pspReference, resultCode); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Payment payment, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, payment, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Payment payment, JsonSerializerOptions jsonSerializerOptions) + { + if (payment.AmountOption.IsSet && payment.Amount == null) + throw new ArgumentNullException(nameof(payment.Amount), "Property is required for class Payment."); + + if (payment.PaymentMethodOption.IsSet && payment.PaymentMethod == null) + throw new ArgumentNullException(nameof(payment.PaymentMethod), "Property is required for class Payment."); + + if (payment.PspReferenceOption.IsSet && payment.PspReference == null) + throw new ArgumentNullException(nameof(payment.PspReference), "Property is required for class Payment."); + + if (payment.AmountOption.IsSet) + { + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, payment.Amount, jsonSerializerOptions); + } + if (payment.PaymentMethodOption.IsSet) + { + writer.WritePropertyName("paymentMethod"); + JsonSerializer.Serialize(writer, payment.PaymentMethod, jsonSerializerOptions); + } + if (payment.PspReferenceOption.IsSet) + writer.WriteString("pspReference", payment.PspReference); + + var resultCodeRawValue = Payment.ResultCodeEnumToJsonValue(payment.ResultCodeOption.Value.Value); + writer.WriteString("resultCode", resultCodeRawValue); + } + } +} diff --git a/Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs b/Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs index 5aac0b522..e989b535b 100644 --- a/Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs +++ b/Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,122 +14,207 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentAmountUpdateRequest /// - [DataContract(Name = "PaymentAmountUpdateRequest")] - public partial class PaymentAmountUpdateRequest : IEquatable, IValidatableObject + public partial class PaymentAmountUpdateRequest : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The merchant account that is used to process the payment. + /// applicationInfo + /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + /// Your reference for the amount update request. Maximum length: 80 characters. + /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments). + [JsonConstructor] + public PaymentAmountUpdateRequest(Amount amount, string merchantAccount, Option applicationInfo = default, Option industryUsage = default, Option> lineItems = default, Option reference = default, Option> splits = default) + { + Amount = amount; + MerchantAccount = merchantAccount; + ApplicationInfoOption = applicationInfo; + IndustryUsageOption = industryUsage; + LineItemsOption = lineItems; + ReferenceOption = reference; + SplitsOption = splits; + OnCreated(); + } + + partial void OnCreated(); + /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - [JsonConverter(typeof(StringEnumConverter))] public enum IndustryUsageEnum { /// /// Enum DelayedCharge for value: delayedCharge /// - [EnumMember(Value = "delayedCharge")] DelayedCharge = 1, /// /// Enum Installment for value: installment /// - [EnumMember(Value = "installment")] Installment = 2, /// /// Enum NoShow for value: noShow /// - [EnumMember(Value = "noShow")] NoShow = 3 - } - /// - /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + /// Returns a /// - /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - [DataMember(Name = "industryUsage", EmitDefaultValue = false)] - public IndustryUsageEnum? IndustryUsage { get; set; } + /// + /// + /// + public static IndustryUsageEnum IndustryUsageEnumFromString(string value) + { + if (value.Equals("delayedCharge")) + return IndustryUsageEnum.DelayedCharge; + + if (value.Equals("installment")) + return IndustryUsageEnum.Installment; + + if (value.Equals("noShow")) + return IndustryUsageEnum.NoShow; + + throw new NotImplementedException($"Could not convert value to type IndustryUsageEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected PaymentAmountUpdateRequest() { } + /// + /// + public static IndustryUsageEnum? IndustryUsageEnumFromStringOrDefault(string value) + { + if (value.Equals("delayedCharge")) + return IndustryUsageEnum.DelayedCharge; + + if (value.Equals("installment")) + return IndustryUsageEnum.Installment; + + if (value.Equals("noShow")) + return IndustryUsageEnum.NoShow; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// amount (required). - /// applicationInfo. - /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment**. - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.. - /// The merchant account that is used to process the payment. (required). - /// Your reference for the amount update request. Maximum length: 80 characters.. - /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments).. - public PaymentAmountUpdateRequest(Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), IndustryUsageEnum? industryUsage = default(IndustryUsageEnum?), List lineItems = default(List), string merchantAccount = default(string), string reference = default(string), List splits = default(List)) + /// + /// + /// + public static string IndustryUsageEnumToJsonValue(IndustryUsageEnum? value) { - this.Amount = amount; - this.MerchantAccount = merchantAccount; - this.ApplicationInfo = applicationInfo; - this.IndustryUsage = industryUsage; - this.LineItems = lineItems; - this.Reference = reference; - this.Splits = splits; + if (value == IndustryUsageEnum.DelayedCharge) + return "delayedCharge"; + + if (value == IndustryUsageEnum.Installment) + return "installment"; + + if (value == IndustryUsageEnum.NoShow) + return "noShow"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of IndustryUsage + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IndustryUsageOption { get; private set; } + + /// + /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + /// + /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + [JsonPropertyName("industryUsage")] + public IndustryUsageEnum? IndustryUsage { get { return this.IndustryUsageOption; } set { this.IndustryUsageOption = new Option(value); } } + /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("amount")] public Amount Amount { get; set; } + /// + /// The merchant account that is used to process the payment. + /// + /// The merchant account that is used to process the payment. + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get; set; } + + /// + /// Used to track the state of ApplicationInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ApplicationInfoOption { get; private set; } + /// /// Gets or Sets ApplicationInfo /// - [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; set; } + [JsonPropertyName("applicationInfo")] + public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + + /// + /// Used to track the state of LineItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LineItemsOption { get; private set; } /// /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. /// /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - [DataMember(Name = "lineItems", EmitDefaultValue = false)] - public List LineItems { get; set; } + [JsonPropertyName("lineItems")] + public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } /// - /// The merchant account that is used to process the payment. + /// Used to track the state of Reference /// - /// The merchant account that is used to process the payment. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// Your reference for the amount update request. Maximum length: 80 characters. /// /// Your reference for the amount update request. Maximum length: 80 characters. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Splits + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SplitsOption { get; private set; } /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments). /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments). - [DataMember(Name = "splits", EmitDefaultValue = false)] - public List Splits { get; set; } + [JsonPropertyName("splits")] + public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } /// /// Returns the string presentation of the object @@ -141,10 +225,10 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PaymentAmountUpdateRequest {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" IndustryUsage: ").Append(IndustryUsage).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); sb.Append("}\n"); @@ -152,120 +236,190 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentAmountUpdateRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentAmountUpdateRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentAmountUpdateRequest); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentAmountUpdateRequest instances are equal - /// - /// Instance of PaymentAmountUpdateRequest to be compared - /// Boolean - public bool Equals(PaymentAmountUpdateRequest input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option merchantAccount = default; + Option applicationInfo = default; + Option industryUsage = default; + Option> lineItems = default; + Option reference = default; + Option> splits = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "applicationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "industryUsage": + string industryUsageRawValue = utf8JsonReader.GetString(); + if (industryUsageRawValue != null) + industryUsage = new Option(PaymentAmountUpdateRequest.IndustryUsageEnumFromStringOrDefault(industryUsageRawValue)); + break; + case "lineItems": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "splits": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.IndustryUsage == input.IndustryUsage || - this.IndustryUsage.Equals(input.IndustryUsage) - ) && - ( - this.LineItems == input.LineItems || - this.LineItems != null && - input.LineItems != null && - this.LineItems.SequenceEqual(input.LineItems) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.Splits == input.Splits || - this.Splits != null && - input.Splits != null && - this.Splits.SequenceEqual(input.Splits) - ); + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class PaymentAmountUpdateRequest.", nameof(amount)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentAmountUpdateRequest.", nameof(merchantAccount)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentAmountUpdateRequest."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentAmountUpdateRequest."); + + if (applicationInfo.IsSet && applicationInfo.Value == null) + throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentAmountUpdateRequest."); + + if (industryUsage.IsSet && industryUsage.Value == null) + throw new ArgumentNullException(nameof(industryUsage), "Property is not nullable for class PaymentAmountUpdateRequest."); + + if (lineItems.IsSet && lineItems.Value == null) + throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentAmountUpdateRequest."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentAmountUpdateRequest."); + + if (splits.IsSet && splits.Value == null) + throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentAmountUpdateRequest."); + + return new PaymentAmountUpdateRequest(amount.Value, merchantAccount.Value, applicationInfo, industryUsage, lineItems, reference, splits); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentAmountUpdateRequest paymentAmountUpdateRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.ApplicationInfo != null) - { - hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); - } - hashCode = (hashCode * 59) + this.IndustryUsage.GetHashCode(); - if (this.LineItems != null) - { - hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.Splits != null) - { - hashCode = (hashCode * 59) + this.Splits.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentAmountUpdateRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentAmountUpdateRequest paymentAmountUpdateRequest, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentAmountUpdateRequest.Amount == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateRequest.Amount), "Property is required for class PaymentAmountUpdateRequest."); + + if (paymentAmountUpdateRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateRequest.MerchantAccount), "Property is required for class PaymentAmountUpdateRequest."); + + if (paymentAmountUpdateRequest.ApplicationInfoOption.IsSet && paymentAmountUpdateRequest.ApplicationInfo == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateRequest.ApplicationInfo), "Property is required for class PaymentAmountUpdateRequest."); + + if (paymentAmountUpdateRequest.LineItemsOption.IsSet && paymentAmountUpdateRequest.LineItems == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateRequest.LineItems), "Property is required for class PaymentAmountUpdateRequest."); + + if (paymentAmountUpdateRequest.ReferenceOption.IsSet && paymentAmountUpdateRequest.Reference == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateRequest.Reference), "Property is required for class PaymentAmountUpdateRequest."); + + if (paymentAmountUpdateRequest.SplitsOption.IsSet && paymentAmountUpdateRequest.Splits == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateRequest.Splits), "Property is required for class PaymentAmountUpdateRequest."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, paymentAmountUpdateRequest.Amount, jsonSerializerOptions); + writer.WriteString("merchantAccount", paymentAmountUpdateRequest.MerchantAccount); + + if (paymentAmountUpdateRequest.ApplicationInfoOption.IsSet) + { + writer.WritePropertyName("applicationInfo"); + JsonSerializer.Serialize(writer, paymentAmountUpdateRequest.ApplicationInfo, jsonSerializerOptions); + } + var industryUsageRawValue = PaymentAmountUpdateRequest.IndustryUsageEnumToJsonValue(paymentAmountUpdateRequest.IndustryUsageOption.Value.Value); + writer.WriteString("industryUsage", industryUsageRawValue); + if (paymentAmountUpdateRequest.LineItemsOption.IsSet) + { + writer.WritePropertyName("lineItems"); + JsonSerializer.Serialize(writer, paymentAmountUpdateRequest.LineItems, jsonSerializerOptions); + } + if (paymentAmountUpdateRequest.ReferenceOption.IsSet) + writer.WriteString("reference", paymentAmountUpdateRequest.Reference); + + if (paymentAmountUpdateRequest.SplitsOption.IsSet) + { + writer.WritePropertyName("splits"); + JsonSerializer.Serialize(writer, paymentAmountUpdateRequest.Splits, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs b/Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs index 12681ad55..099af8864 100644 --- a/Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs +++ b/Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,156 +14,265 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentAmountUpdateResponse /// - [DataContract(Name = "PaymentAmountUpdateResponse")] - public partial class PaymentAmountUpdateResponse : IEquatable, IValidatableObject + public partial class PaymentAmountUpdateResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The merchant account that is used to process the payment. + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. + /// Adyen's 16-character reference associated with the amount update request. + /// Your reference for the amount update request. Maximum length: 80 characters. + /// The status of your request. This will always have the value **received**. + /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments). + [JsonConstructor] + public PaymentAmountUpdateResponse(Amount amount, string merchantAccount, string paymentPspReference, string pspReference, string reference, StatusEnum status, Option industryUsage = default, Option> lineItems = default, Option> splits = default) + { + Amount = amount; + MerchantAccount = merchantAccount; + PaymentPspReference = paymentPspReference; + PspReference = pspReference; + Reference = reference; + Status = status; + IndustryUsageOption = industryUsage; + LineItemsOption = lineItems; + SplitsOption = splits; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The status of your request. This will always have the value **received**. + /// + /// The status of your request. This will always have the value **received**. + public enum StatusEnum + { + /// + /// Enum Received for value: received + /// + Received = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("received")) + return StatusEnum.Received; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("received")) + return StatusEnum.Received; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum value) + { + if (value == StatusEnum.Received) + return "received"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// The status of your request. This will always have the value **received**. + /// + /// The status of your request. This will always have the value **received**. + [JsonPropertyName("status")] + public StatusEnum Status { get; set; } + /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - [JsonConverter(typeof(StringEnumConverter))] public enum IndustryUsageEnum { /// /// Enum DelayedCharge for value: delayedCharge /// - [EnumMember(Value = "delayedCharge")] DelayedCharge = 1, /// /// Enum Installment for value: installment /// - [EnumMember(Value = "installment")] Installment = 2, /// /// Enum NoShow for value: noShow /// - [EnumMember(Value = "noShow")] NoShow = 3 - } - /// - /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + /// Returns a /// - /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - [DataMember(Name = "industryUsage", EmitDefaultValue = false)] - public IndustryUsageEnum? IndustryUsage { get; set; } + /// + /// + /// + public static IndustryUsageEnum IndustryUsageEnumFromString(string value) + { + if (value.Equals("delayedCharge")) + return IndustryUsageEnum.DelayedCharge; + + if (value.Equals("installment")) + return IndustryUsageEnum.Installment; + + if (value.Equals("noShow")) + return IndustryUsageEnum.NoShow; + + throw new NotImplementedException($"Could not convert value to type IndustryUsageEnum: '{value}'"); + } + /// - /// The status of your request. This will always have the value **received**. + /// Returns a /// - /// The status of your request. This will always have the value **received**. - [JsonConverter(typeof(StringEnumConverter))] - public enum StatusEnum + /// + /// + public static IndustryUsageEnum? IndustryUsageEnumFromStringOrDefault(string value) { - /// - /// Enum Received for value: received - /// - [EnumMember(Value = "received")] - Received = 1 + if (value.Equals("delayedCharge")) + return IndustryUsageEnum.DelayedCharge; - } + if (value.Equals("installment")) + return IndustryUsageEnum.Installment; + if (value.Equals("noShow")) + return IndustryUsageEnum.NoShow; + + return null; + } /// - /// The status of your request. This will always have the value **received**. + /// Converts the to the json value /// - /// The status of your request. This will always have the value **received**. - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public StatusEnum Status { get; set; } + /// + /// + /// + public static string IndustryUsageEnumToJsonValue(IndustryUsageEnum? value) + { + if (value == IndustryUsageEnum.DelayedCharge) + return "delayedCharge"; + + if (value == IndustryUsageEnum.Installment) + return "installment"; + + if (value == IndustryUsageEnum.NoShow) + return "noShow"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Used to track the state of IndustryUsage /// - [JsonConstructorAttribute] - protected PaymentAmountUpdateResponse() { } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IndustryUsageOption { get; private set; } + /// - /// Initializes a new instance of the class. + /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** /// - /// amount (required). - /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment**. - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.. - /// The merchant account that is used to process the payment. (required). - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. (required). - /// Adyen's 16-character reference associated with the amount update request. (required). - /// Your reference for the amount update request. Maximum length: 80 characters. (required). - /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments).. - /// The status of your request. This will always have the value **received**. (required). - public PaymentAmountUpdateResponse(Amount amount = default(Amount), IndustryUsageEnum? industryUsage = default(IndustryUsageEnum?), List lineItems = default(List), string merchantAccount = default(string), string paymentPspReference = default(string), string pspReference = default(string), string reference = default(string), List splits = default(List), StatusEnum status = default(StatusEnum)) - { - this.Amount = amount; - this.MerchantAccount = merchantAccount; - this.PaymentPspReference = paymentPspReference; - this.PspReference = pspReference; - this.Reference = reference; - this.Status = status; - this.IndustryUsage = industryUsage; - this.LineItems = lineItems; - this.Splits = splits; - } + /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + [JsonPropertyName("industryUsage")] + public IndustryUsageEnum? IndustryUsage { get { return this.IndustryUsageOption; } set { this.IndustryUsageOption = new Option(value); } } /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("amount")] public Amount Amount { get; set; } - /// - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - /// - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - [DataMember(Name = "lineItems", EmitDefaultValue = false)] - public List LineItems { get; set; } - /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantAccount")] public string MerchantAccount { get; set; } /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. - [DataMember(Name = "paymentPspReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("paymentPspReference")] public string PaymentPspReference { get; set; } /// /// Adyen's 16-character reference associated with the amount update request. /// /// Adyen's 16-character reference associated with the amount update request. - [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("pspReference")] public string PspReference { get; set; } /// /// Your reference for the amount update request. Maximum length: 80 characters. /// /// Your reference for the amount update request. Maximum length: 80 characters. - [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("reference")] public string Reference { get; set; } + /// + /// Used to track the state of LineItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LineItemsOption { get; private set; } + + /// + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + /// + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + [JsonPropertyName("lineItems")] + public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } + + /// + /// Used to track the state of Splits + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SplitsOption { get; private set; } + /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments). /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments). - [DataMember(Name = "splits", EmitDefaultValue = false)] - public List Splits { get; set; } + [JsonPropertyName("splits")] + public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } /// /// Returns the string presentation of the object @@ -175,147 +283,233 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PaymentAmountUpdateResponse {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" IndustryUsage: ").Append(IndustryUsage).Append("\n"); - sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentPspReference: ").Append(PaymentPspReference).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" Splits: ").Append(Splits).Append("\n"); sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" IndustryUsage: ").Append(IndustryUsage).Append("\n"); + sb.Append(" LineItems: ").Append(LineItems).Append("\n"); + sb.Append(" Splits: ").Append(Splits).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentAmountUpdateResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentAmountUpdateResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentAmountUpdateResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentAmountUpdateResponse instances are equal - /// - /// Instance of PaymentAmountUpdateResponse to be compared - /// Boolean - public bool Equals(PaymentAmountUpdateResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option merchantAccount = default; + Option paymentPspReference = default; + Option pspReference = default; + Option reference = default; + Option status = default; + Option industryUsage = default; + Option> lineItems = default; + Option> splits = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "paymentPspReference": + paymentPspReference = new Option(utf8JsonReader.GetString()); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(PaymentAmountUpdateResponse.StatusEnumFromStringOrDefault(statusRawValue)); + break; + case "industryUsage": + string industryUsageRawValue = utf8JsonReader.GetString(); + if (industryUsageRawValue != null) + industryUsage = new Option(PaymentAmountUpdateResponse.IndustryUsageEnumFromStringOrDefault(industryUsageRawValue)); + break; + case "lineItems": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "splits": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.IndustryUsage == input.IndustryUsage || - this.IndustryUsage.Equals(input.IndustryUsage) - ) && - ( - this.LineItems == input.LineItems || - this.LineItems != null && - input.LineItems != null && - this.LineItems.SequenceEqual(input.LineItems) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.PaymentPspReference == input.PaymentPspReference || - (this.PaymentPspReference != null && - this.PaymentPspReference.Equals(input.PaymentPspReference)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.Splits == input.Splits || - this.Splits != null && - input.Splits != null && - this.Splits.SequenceEqual(input.Splits) - ) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ); + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class PaymentAmountUpdateResponse.", nameof(amount)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentAmountUpdateResponse.", nameof(merchantAccount)); + + if (!paymentPspReference.IsSet) + throw new ArgumentException("Property is required for class PaymentAmountUpdateResponse.", nameof(paymentPspReference)); + + if (!pspReference.IsSet) + throw new ArgumentException("Property is required for class PaymentAmountUpdateResponse.", nameof(pspReference)); + + if (!reference.IsSet) + throw new ArgumentException("Property is required for class PaymentAmountUpdateResponse.", nameof(reference)); + + if (!status.IsSet) + throw new ArgumentException("Property is required for class PaymentAmountUpdateResponse.", nameof(status)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentAmountUpdateResponse."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentAmountUpdateResponse."); + + if (paymentPspReference.IsSet && paymentPspReference.Value == null) + throw new ArgumentNullException(nameof(paymentPspReference), "Property is not nullable for class PaymentAmountUpdateResponse."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentAmountUpdateResponse."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentAmountUpdateResponse."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaymentAmountUpdateResponse."); + + if (industryUsage.IsSet && industryUsage.Value == null) + throw new ArgumentNullException(nameof(industryUsage), "Property is not nullable for class PaymentAmountUpdateResponse."); + + if (lineItems.IsSet && lineItems.Value == null) + throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentAmountUpdateResponse."); + + if (splits.IsSet && splits.Value == null) + throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentAmountUpdateResponse."); + + return new PaymentAmountUpdateResponse(amount.Value, merchantAccount.Value, paymentPspReference.Value, pspReference.Value, reference.Value, status.Value.Value, industryUsage, lineItems, splits); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentAmountUpdateResponse paymentAmountUpdateResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - hashCode = (hashCode * 59) + this.IndustryUsage.GetHashCode(); - if (this.LineItems != null) - { - hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.PaymentPspReference != null) - { - hashCode = (hashCode * 59) + this.PaymentPspReference.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.Splits != null) - { - hashCode = (hashCode * 59) + this.Splits.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentAmountUpdateResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentAmountUpdateResponse paymentAmountUpdateResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentAmountUpdateResponse.Amount == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.Amount), "Property is required for class PaymentAmountUpdateResponse."); + + if (paymentAmountUpdateResponse.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.MerchantAccount), "Property is required for class PaymentAmountUpdateResponse."); + + if (paymentAmountUpdateResponse.PaymentPspReference == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.PaymentPspReference), "Property is required for class PaymentAmountUpdateResponse."); + + if (paymentAmountUpdateResponse.PspReference == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.PspReference), "Property is required for class PaymentAmountUpdateResponse."); + + if (paymentAmountUpdateResponse.Reference == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.Reference), "Property is required for class PaymentAmountUpdateResponse."); + + if (paymentAmountUpdateResponse.LineItemsOption.IsSet && paymentAmountUpdateResponse.LineItems == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.LineItems), "Property is required for class PaymentAmountUpdateResponse."); + + if (paymentAmountUpdateResponse.SplitsOption.IsSet && paymentAmountUpdateResponse.Splits == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.Splits), "Property is required for class PaymentAmountUpdateResponse."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, paymentAmountUpdateResponse.Amount, jsonSerializerOptions); + writer.WriteString("merchantAccount", paymentAmountUpdateResponse.MerchantAccount); + + writer.WriteString("paymentPspReference", paymentAmountUpdateResponse.PaymentPspReference); + + writer.WriteString("pspReference", paymentAmountUpdateResponse.PspReference); + + writer.WriteString("reference", paymentAmountUpdateResponse.Reference); + + var statusRawValue = PaymentAmountUpdateResponse.StatusEnumToJsonValue(paymentAmountUpdateResponse.Status); + writer.WriteString("status", statusRawValue); + var industryUsageRawValue = PaymentAmountUpdateResponse.IndustryUsageEnumToJsonValue(paymentAmountUpdateResponse.IndustryUsageOption.Value.Value); + writer.WriteString("industryUsage", industryUsageRawValue); + if (paymentAmountUpdateResponse.LineItemsOption.IsSet) + { + writer.WritePropertyName("lineItems"); + JsonSerializer.Serialize(writer, paymentAmountUpdateResponse.LineItems, jsonSerializerOptions); + } + if (paymentAmountUpdateResponse.SplitsOption.IsSet) + { + writer.WritePropertyName("splits"); + JsonSerializer.Serialize(writer, paymentAmountUpdateResponse.Splits, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/PaymentCancelRequest.cs b/Adyen/Model/Checkout/PaymentCancelRequest.cs index 3795b9a0f..3bf19c2f3 100644 --- a/Adyen/Model/Checkout/PaymentCancelRequest.cs +++ b/Adyen/Model/Checkout/PaymentCancelRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,60 +14,70 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentCancelRequest /// - [DataContract(Name = "PaymentCancelRequest")] - public partial class PaymentCancelRequest : IEquatable, IValidatableObject + public partial class PaymentCancelRequest : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected PaymentCancelRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// applicationInfo. - /// The merchant account that is used to process the payment. (required). - /// Your reference for the cancel request. Maximum length: 80 characters.. - public PaymentCancelRequest(ApplicationInfo applicationInfo = default(ApplicationInfo), string merchantAccount = default(string), string reference = default(string)) + /// The merchant account that is used to process the payment. + /// applicationInfo + /// Your reference for the cancel request. Maximum length: 80 characters. + [JsonConstructor] + public PaymentCancelRequest(string merchantAccount, Option applicationInfo = default, Option reference = default) { - this.MerchantAccount = merchantAccount; - this.ApplicationInfo = applicationInfo; - this.Reference = reference; + MerchantAccount = merchantAccount; + ApplicationInfoOption = applicationInfo; + ReferenceOption = reference; + OnCreated(); } - /// - /// Gets or Sets ApplicationInfo - /// - [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; set; } + partial void OnCreated(); /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantAccount")] public string MerchantAccount { get; set; } + /// + /// Used to track the state of ApplicationInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ApplicationInfoOption { get; private set; } + + /// + /// Gets or Sets ApplicationInfo + /// + [JsonPropertyName("applicationInfo")] + public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } + /// /// Your reference for the cancel request. Maximum length: 80 characters. /// /// Your reference for the cancel request. Maximum length: 80 characters. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -78,94 +87,138 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentCancelRequest {\n"); - sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentCancelRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentCancelRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentCancelRequest); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentCancelRequest instances are equal - /// - /// Instance of PaymentCancelRequest to be compared - /// Boolean - public bool Equals(PaymentCancelRequest input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option merchantAccount = default; + Option applicationInfo = default; + Option reference = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "applicationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentCancelRequest.", nameof(merchantAccount)); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentCancelRequest."); + + if (applicationInfo.IsSet && applicationInfo.Value == null) + throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentCancelRequest."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentCancelRequest."); + + return new PaymentCancelRequest(merchantAccount.Value, applicationInfo, reference); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentCancelRequest paymentCancelRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ApplicationInfo != null) - { - hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentCancelRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentCancelRequest paymentCancelRequest, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentCancelRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentCancelRequest.MerchantAccount), "Property is required for class PaymentCancelRequest."); + + if (paymentCancelRequest.ApplicationInfoOption.IsSet && paymentCancelRequest.ApplicationInfo == null) + throw new ArgumentNullException(nameof(paymentCancelRequest.ApplicationInfo), "Property is required for class PaymentCancelRequest."); + + if (paymentCancelRequest.ReferenceOption.IsSet && paymentCancelRequest.Reference == null) + throw new ArgumentNullException(nameof(paymentCancelRequest.Reference), "Property is required for class PaymentCancelRequest."); + + writer.WriteString("merchantAccount", paymentCancelRequest.MerchantAccount); + + if (paymentCancelRequest.ApplicationInfoOption.IsSet) + { + writer.WritePropertyName("applicationInfo"); + JsonSerializer.Serialize(writer, paymentCancelRequest.ApplicationInfo, jsonSerializerOptions); + } + if (paymentCancelRequest.ReferenceOption.IsSet) + writer.WriteString("reference", paymentCancelRequest.Reference); } } - } diff --git a/Adyen/Model/Checkout/PaymentCancelResponse.cs b/Adyen/Model/Checkout/PaymentCancelResponse.cs index 97fee4ab7..8cc30fb8a 100644 --- a/Adyen/Model/Checkout/PaymentCancelResponse.cs +++ b/Adyen/Model/Checkout/PaymentCancelResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,94 +14,135 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentCancelResponse /// - [DataContract(Name = "PaymentCancelResponse")] - public partial class PaymentCancelResponse : IEquatable, IValidatableObject + public partial class PaymentCancelResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The merchant account that is used to process the payment. + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. + /// Adyen's 16-character reference associated with the cancel request. + /// The status of your request. This will always have the value **received**. + /// Your reference for the cancel request. + [JsonConstructor] + public PaymentCancelResponse(string merchantAccount, string paymentPspReference, string pspReference, StatusEnum status, Option reference = default) + { + MerchantAccount = merchantAccount; + PaymentPspReference = paymentPspReference; + PspReference = pspReference; + Status = status; + ReferenceOption = reference; + OnCreated(); + } + + partial void OnCreated(); + /// /// The status of your request. This will always have the value **received**. /// /// The status of your request. This will always have the value **received**. - [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Received for value: received /// - [EnumMember(Value = "received")] Received = 1 - } - /// - /// The status of your request. This will always have the value **received**. + /// Returns a /// - /// The status of your request. This will always have the value **received**. - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public StatusEnum Status { get; set; } + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("received")) + return StatusEnum.Received; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected PaymentCancelResponse() { } + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("received")) + return StatusEnum.Received; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The merchant account that is used to process the payment. (required). - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. (required). - /// Adyen's 16-character reference associated with the cancel request. (required). - /// Your reference for the cancel request.. - /// The status of your request. This will always have the value **received**. (required). - public PaymentCancelResponse(string merchantAccount = default(string), string paymentPspReference = default(string), string pspReference = default(string), string reference = default(string), StatusEnum status = default(StatusEnum)) + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum value) { - this.MerchantAccount = merchantAccount; - this.PaymentPspReference = paymentPspReference; - this.PspReference = pspReference; - this.Status = status; - this.Reference = reference; + if (value == StatusEnum.Received) + return "received"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// The status of your request. This will always have the value **received**. + /// + /// The status of your request. This will always have the value **received**. + [JsonPropertyName("status")] + public StatusEnum Status { get; set; } + /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantAccount")] public string MerchantAccount { get; set; } /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. - [DataMember(Name = "paymentPspReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("paymentPspReference")] public string PaymentPspReference { get; set; } /// /// Adyen's 16-character reference associated with the cancel request. /// /// Adyen's 16-character reference associated with the cancel request. - [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("pspReference")] public string PspReference { get; set; } + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } + /// /// Your reference for the cancel request. /// /// Your reference for the cancel request. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -115,107 +155,165 @@ public override string ToString() sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentPspReference: ").Append(PaymentPspReference).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentCancelResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentCancelResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentCancelResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentCancelResponse instances are equal - /// - /// Instance of PaymentCancelResponse to be compared - /// Boolean - public bool Equals(PaymentCancelResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option merchantAccount = default; + Option paymentPspReference = default; + Option pspReference = default; + Option status = default; + Option reference = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "paymentPspReference": + paymentPspReference = new Option(utf8JsonReader.GetString()); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(PaymentCancelResponse.StatusEnumFromStringOrDefault(statusRawValue)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.PaymentPspReference == input.PaymentPspReference || - (this.PaymentPspReference != null && - this.PaymentPspReference.Equals(input.PaymentPspReference)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentCancelResponse.", nameof(merchantAccount)); + + if (!paymentPspReference.IsSet) + throw new ArgumentException("Property is required for class PaymentCancelResponse.", nameof(paymentPspReference)); + + if (!pspReference.IsSet) + throw new ArgumentException("Property is required for class PaymentCancelResponse.", nameof(pspReference)); + + if (!status.IsSet) + throw new ArgumentException("Property is required for class PaymentCancelResponse.", nameof(status)); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentCancelResponse."); + + if (paymentPspReference.IsSet && paymentPspReference.Value == null) + throw new ArgumentNullException(nameof(paymentPspReference), "Property is not nullable for class PaymentCancelResponse."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentCancelResponse."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaymentCancelResponse."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentCancelResponse."); + + return new PaymentCancelResponse(merchantAccount.Value, paymentPspReference.Value, pspReference.Value, status.Value.Value, reference); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentCancelResponse paymentCancelResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.PaymentPspReference != null) - { - hashCode = (hashCode * 59) + this.PaymentPspReference.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentCancelResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentCancelResponse paymentCancelResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentCancelResponse.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentCancelResponse.MerchantAccount), "Property is required for class PaymentCancelResponse."); + + if (paymentCancelResponse.PaymentPspReference == null) + throw new ArgumentNullException(nameof(paymentCancelResponse.PaymentPspReference), "Property is required for class PaymentCancelResponse."); + + if (paymentCancelResponse.PspReference == null) + throw new ArgumentNullException(nameof(paymentCancelResponse.PspReference), "Property is required for class PaymentCancelResponse."); + + if (paymentCancelResponse.ReferenceOption.IsSet && paymentCancelResponse.Reference == null) + throw new ArgumentNullException(nameof(paymentCancelResponse.Reference), "Property is required for class PaymentCancelResponse."); + + writer.WriteString("merchantAccount", paymentCancelResponse.MerchantAccount); + + writer.WriteString("paymentPspReference", paymentCancelResponse.PaymentPspReference); + + writer.WriteString("pspReference", paymentCancelResponse.PspReference); + + var statusRawValue = PaymentCancelResponse.StatusEnumToJsonValue(paymentCancelResponse.Status); + writer.WriteString("status", statusRawValue); + if (paymentCancelResponse.ReferenceOption.IsSet) + writer.WriteString("reference", paymentCancelResponse.Reference); } } - } diff --git a/Adyen/Model/Checkout/PaymentCaptureRequest.cs b/Adyen/Model/Checkout/PaymentCaptureRequest.cs index 7b9a3c0b7..e78f6def0 100644 --- a/Adyen/Model/Checkout/PaymentCaptureRequest.cs +++ b/Adyen/Model/Checkout/PaymentCaptureRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,111 +14,156 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentCaptureRequest /// - [DataContract(Name = "PaymentCaptureRequest")] - public partial class PaymentCaptureRequest : IEquatable, IValidatableObject + public partial class PaymentCaptureRequest : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected PaymentCaptureRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// amount (required). - /// applicationInfo. - /// enhancedSchemeData. - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.. - /// The merchant account that is used to process the payment. (required). - /// platformChargebackLogic. - /// Your reference for the capture request. Maximum length: 80 characters.. - /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/).. - /// A List of sub-merchants.. - public PaymentCaptureRequest(Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), EnhancedSchemeData enhancedSchemeData = default(EnhancedSchemeData), List lineItems = default(List), string merchantAccount = default(string), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), string reference = default(string), List splits = default(List), List subMerchants = default(List)) + /// amount + /// The merchant account that is used to process the payment. + /// applicationInfo + /// enhancedSchemeData + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + /// platformChargebackLogic + /// Your reference for the capture request. Maximum length: 80 characters. + /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). + /// A List of sub-merchants. + [JsonConstructor] + public PaymentCaptureRequest(Amount amount, string merchantAccount, Option applicationInfo = default, Option enhancedSchemeData = default, Option> lineItems = default, Option platformChargebackLogic = default, Option reference = default, Option> splits = default, Option> subMerchants = default) { - this.Amount = amount; - this.MerchantAccount = merchantAccount; - this.ApplicationInfo = applicationInfo; - this.EnhancedSchemeData = enhancedSchemeData; - this.LineItems = lineItems; - this.PlatformChargebackLogic = platformChargebackLogic; - this.Reference = reference; - this.Splits = splits; - this.SubMerchants = subMerchants; + Amount = amount; + MerchantAccount = merchantAccount; + ApplicationInfoOption = applicationInfo; + EnhancedSchemeDataOption = enhancedSchemeData; + LineItemsOption = lineItems; + PlatformChargebackLogicOption = platformChargebackLogic; + ReferenceOption = reference; + SplitsOption = splits; + SubMerchantsOption = subMerchants; + OnCreated(); } + partial void OnCreated(); + /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("amount")] public Amount Amount { get; set; } + /// + /// The merchant account that is used to process the payment. + /// + /// The merchant account that is used to process the payment. + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get; set; } + + /// + /// Used to track the state of ApplicationInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ApplicationInfoOption { get; private set; } + /// /// Gets or Sets ApplicationInfo /// - [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; set; } + [JsonPropertyName("applicationInfo")] + public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataOption { get; private set; } /// /// Gets or Sets EnhancedSchemeData /// - [DataMember(Name = "enhancedSchemeData", EmitDefaultValue = false)] - public EnhancedSchemeData EnhancedSchemeData { get; set; } + [JsonPropertyName("enhancedSchemeData")] + public EnhancedSchemeData EnhancedSchemeData { get { return this.EnhancedSchemeDataOption; } set { this.EnhancedSchemeDataOption = new Option(value); } } + + /// + /// Used to track the state of LineItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LineItemsOption { get; private set; } /// /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. /// /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - [DataMember(Name = "lineItems", EmitDefaultValue = false)] - public List LineItems { get; set; } + [JsonPropertyName("lineItems")] + public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } /// - /// The merchant account that is used to process the payment. + /// Used to track the state of PlatformChargebackLogic /// - /// The merchant account that is used to process the payment. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PlatformChargebackLogicOption { get; private set; } /// /// Gets or Sets PlatformChargebackLogic /// - [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] - public PlatformChargebackLogic PlatformChargebackLogic { get; set; } + [JsonPropertyName("platformChargebackLogic")] + public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// Your reference for the capture request. Maximum length: 80 characters. /// /// Your reference for the capture request. Maximum length: 80 characters. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Splits + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SplitsOption { get; private set; } /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). - [DataMember(Name = "splits", EmitDefaultValue = false)] - public List Splits { get; set; } + [JsonPropertyName("splits")] + public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } + + /// + /// Used to track the state of SubMerchants + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SubMerchantsOption { get; private set; } /// /// A List of sub-merchants. /// /// A List of sub-merchants. - [DataMember(Name = "subMerchants", EmitDefaultValue = false)] - public List SubMerchants { get; set; } + [JsonPropertyName("subMerchants")] + public List SubMerchants { get { return this.SubMerchantsOption; } set { this.SubMerchantsOption = new Option>(value); } } /// /// Returns the string presentation of the object @@ -130,10 +174,10 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PaymentCaptureRequest {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" EnhancedSchemeData: ").Append(EnhancedSchemeData).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PlatformChargebackLogic: ").Append(PlatformChargebackLogic).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); @@ -143,143 +187,227 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentCaptureRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentCaptureRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentCaptureRequest); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentCaptureRequest instances are equal - /// - /// Instance of PaymentCaptureRequest to be compared - /// Boolean - public bool Equals(PaymentCaptureRequest input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option merchantAccount = default; + Option applicationInfo = default; + Option enhancedSchemeData = default; + Option> lineItems = default; + Option platformChargebackLogic = default; + Option reference = default; + Option> splits = default; + Option> subMerchants = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "applicationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "enhancedSchemeData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enhancedSchemeData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "lineItems": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "platformChargebackLogic": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "splits": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "subMerchants": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + subMerchants = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.EnhancedSchemeData == input.EnhancedSchemeData || - (this.EnhancedSchemeData != null && - this.EnhancedSchemeData.Equals(input.EnhancedSchemeData)) - ) && - ( - this.LineItems == input.LineItems || - this.LineItems != null && - input.LineItems != null && - this.LineItems.SequenceEqual(input.LineItems) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.PlatformChargebackLogic == input.PlatformChargebackLogic || - (this.PlatformChargebackLogic != null && - this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.Splits == input.Splits || - this.Splits != null && - input.Splits != null && - this.Splits.SequenceEqual(input.Splits) - ) && - ( - this.SubMerchants == input.SubMerchants || - this.SubMerchants != null && - input.SubMerchants != null && - this.SubMerchants.SequenceEqual(input.SubMerchants) - ); + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class PaymentCaptureRequest.", nameof(amount)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentCaptureRequest.", nameof(merchantAccount)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentCaptureRequest."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentCaptureRequest."); + + if (applicationInfo.IsSet && applicationInfo.Value == null) + throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentCaptureRequest."); + + if (enhancedSchemeData.IsSet && enhancedSchemeData.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeData), "Property is not nullable for class PaymentCaptureRequest."); + + if (lineItems.IsSet && lineItems.Value == null) + throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentCaptureRequest."); + + if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) + throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class PaymentCaptureRequest."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentCaptureRequest."); + + if (splits.IsSet && splits.Value == null) + throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentCaptureRequest."); + + if (subMerchants.IsSet && subMerchants.Value == null) + throw new ArgumentNullException(nameof(subMerchants), "Property is not nullable for class PaymentCaptureRequest."); + + return new PaymentCaptureRequest(amount.Value, merchantAccount.Value, applicationInfo, enhancedSchemeData, lineItems, platformChargebackLogic, reference, splits, subMerchants); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentCaptureRequest paymentCaptureRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.ApplicationInfo != null) - { - hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); - } - if (this.EnhancedSchemeData != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeData.GetHashCode(); - } - if (this.LineItems != null) - { - hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.PlatformChargebackLogic != null) - { - hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.Splits != null) - { - hashCode = (hashCode * 59) + this.Splits.GetHashCode(); - } - if (this.SubMerchants != null) - { - hashCode = (hashCode * 59) + this.SubMerchants.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentCaptureRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentCaptureRequest paymentCaptureRequest, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentCaptureRequest.Amount == null) + throw new ArgumentNullException(nameof(paymentCaptureRequest.Amount), "Property is required for class PaymentCaptureRequest."); + + if (paymentCaptureRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentCaptureRequest.MerchantAccount), "Property is required for class PaymentCaptureRequest."); + + if (paymentCaptureRequest.ApplicationInfoOption.IsSet && paymentCaptureRequest.ApplicationInfo == null) + throw new ArgumentNullException(nameof(paymentCaptureRequest.ApplicationInfo), "Property is required for class PaymentCaptureRequest."); + + if (paymentCaptureRequest.EnhancedSchemeDataOption.IsSet && paymentCaptureRequest.EnhancedSchemeData == null) + throw new ArgumentNullException(nameof(paymentCaptureRequest.EnhancedSchemeData), "Property is required for class PaymentCaptureRequest."); + + if (paymentCaptureRequest.LineItemsOption.IsSet && paymentCaptureRequest.LineItems == null) + throw new ArgumentNullException(nameof(paymentCaptureRequest.LineItems), "Property is required for class PaymentCaptureRequest."); + + if (paymentCaptureRequest.PlatformChargebackLogicOption.IsSet && paymentCaptureRequest.PlatformChargebackLogic == null) + throw new ArgumentNullException(nameof(paymentCaptureRequest.PlatformChargebackLogic), "Property is required for class PaymentCaptureRequest."); + + if (paymentCaptureRequest.ReferenceOption.IsSet && paymentCaptureRequest.Reference == null) + throw new ArgumentNullException(nameof(paymentCaptureRequest.Reference), "Property is required for class PaymentCaptureRequest."); + + if (paymentCaptureRequest.SplitsOption.IsSet && paymentCaptureRequest.Splits == null) + throw new ArgumentNullException(nameof(paymentCaptureRequest.Splits), "Property is required for class PaymentCaptureRequest."); + + if (paymentCaptureRequest.SubMerchantsOption.IsSet && paymentCaptureRequest.SubMerchants == null) + throw new ArgumentNullException(nameof(paymentCaptureRequest.SubMerchants), "Property is required for class PaymentCaptureRequest."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, paymentCaptureRequest.Amount, jsonSerializerOptions); + writer.WriteString("merchantAccount", paymentCaptureRequest.MerchantAccount); + + if (paymentCaptureRequest.ApplicationInfoOption.IsSet) + { + writer.WritePropertyName("applicationInfo"); + JsonSerializer.Serialize(writer, paymentCaptureRequest.ApplicationInfo, jsonSerializerOptions); + } + if (paymentCaptureRequest.EnhancedSchemeDataOption.IsSet) + { + writer.WritePropertyName("enhancedSchemeData"); + JsonSerializer.Serialize(writer, paymentCaptureRequest.EnhancedSchemeData, jsonSerializerOptions); + } + if (paymentCaptureRequest.LineItemsOption.IsSet) + { + writer.WritePropertyName("lineItems"); + JsonSerializer.Serialize(writer, paymentCaptureRequest.LineItems, jsonSerializerOptions); + } + if (paymentCaptureRequest.PlatformChargebackLogicOption.IsSet) + { + writer.WritePropertyName("platformChargebackLogic"); + JsonSerializer.Serialize(writer, paymentCaptureRequest.PlatformChargebackLogic, jsonSerializerOptions); + } + if (paymentCaptureRequest.ReferenceOption.IsSet) + writer.WriteString("reference", paymentCaptureRequest.Reference); + + if (paymentCaptureRequest.SplitsOption.IsSet) + { + writer.WritePropertyName("splits"); + JsonSerializer.Serialize(writer, paymentCaptureRequest.Splits, jsonSerializerOptions); + } + if (paymentCaptureRequest.SubMerchantsOption.IsSet) + { + writer.WritePropertyName("subMerchants"); + JsonSerializer.Serialize(writer, paymentCaptureRequest.SubMerchants, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/PaymentCaptureResponse.cs b/Adyen/Model/Checkout/PaymentCaptureResponse.cs index 9f8c1ab45..191f120de 100644 --- a/Adyen/Model/Checkout/PaymentCaptureResponse.cs +++ b/Adyen/Model/Checkout/PaymentCaptureResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,137 +14,206 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentCaptureResponse /// - [DataContract(Name = "PaymentCaptureResponse")] - public partial class PaymentCaptureResponse : IEquatable, IValidatableObject + public partial class PaymentCaptureResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The merchant account that is used to process the payment. + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. + /// Adyen's 16-character reference associated with the capture request. + /// The status of your request. This will always have the value **received**. + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + /// platformChargebackLogic + /// Your reference for the capture request. + /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). + /// List of sub-merchants. + [JsonConstructor] + public PaymentCaptureResponse(Amount amount, string merchantAccount, string paymentPspReference, string pspReference, StatusEnum status, Option> lineItems = default, Option platformChargebackLogic = default, Option reference = default, Option> splits = default, Option> subMerchants = default) + { + Amount = amount; + MerchantAccount = merchantAccount; + PaymentPspReference = paymentPspReference; + PspReference = pspReference; + Status = status; + LineItemsOption = lineItems; + PlatformChargebackLogicOption = platformChargebackLogic; + ReferenceOption = reference; + SplitsOption = splits; + SubMerchantsOption = subMerchants; + OnCreated(); + } + + partial void OnCreated(); + /// /// The status of your request. This will always have the value **received**. /// /// The status of your request. This will always have the value **received**. - [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Received for value: received /// - [EnumMember(Value = "received")] Received = 1 - } - /// - /// The status of your request. This will always have the value **received**. + /// Returns a /// - /// The status of your request. This will always have the value **received**. - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public StatusEnum Status { get; set; } + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("received")) + return StatusEnum.Received; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected PaymentCaptureResponse() { } + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("received")) + return StatusEnum.Received; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// amount (required). - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.. - /// The merchant account that is used to process the payment. (required). - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. (required). - /// platformChargebackLogic. - /// Adyen's 16-character reference associated with the capture request. (required). - /// Your reference for the capture request.. - /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/).. - /// The status of your request. This will always have the value **received**. (required). - /// List of sub-merchants.. - public PaymentCaptureResponse(Amount amount = default(Amount), List lineItems = default(List), string merchantAccount = default(string), string paymentPspReference = default(string), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), string pspReference = default(string), string reference = default(string), List splits = default(List), StatusEnum status = default(StatusEnum), List subMerchants = default(List)) + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum value) { - this.Amount = amount; - this.MerchantAccount = merchantAccount; - this.PaymentPspReference = paymentPspReference; - this.PspReference = pspReference; - this.Status = status; - this.LineItems = lineItems; - this.PlatformChargebackLogic = platformChargebackLogic; - this.Reference = reference; - this.Splits = splits; - this.SubMerchants = subMerchants; + if (value == StatusEnum.Received) + return "received"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// Gets or Sets Amount + /// The status of your request. This will always have the value **received**. /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] - public Amount Amount { get; set; } + /// The status of your request. This will always have the value **received**. + [JsonPropertyName("status")] + public StatusEnum Status { get; set; } /// - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + /// Gets or Sets Amount /// - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - [DataMember(Name = "lineItems", EmitDefaultValue = false)] - public List LineItems { get; set; } + [JsonPropertyName("amount")] + public Amount Amount { get; set; } /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantAccount")] public string MerchantAccount { get; set; } /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. - [DataMember(Name = "paymentPspReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("paymentPspReference")] public string PaymentPspReference { get; set; } + /// + /// Adyen's 16-character reference associated with the capture request. + /// + /// Adyen's 16-character reference associated with the capture request. + [JsonPropertyName("pspReference")] + public string PspReference { get; set; } + + /// + /// Used to track the state of LineItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LineItemsOption { get; private set; } + + /// + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + /// + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + [JsonPropertyName("lineItems")] + public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } + + /// + /// Used to track the state of PlatformChargebackLogic + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PlatformChargebackLogicOption { get; private set; } + /// /// Gets or Sets PlatformChargebackLogic /// - [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] - public PlatformChargebackLogic PlatformChargebackLogic { get; set; } + [JsonPropertyName("platformChargebackLogic")] + public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } /// - /// Adyen's 16-character reference associated with the capture request. + /// Used to track the state of Reference /// - /// Adyen's 16-character reference associated with the capture request. - [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] - public string PspReference { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// Your reference for the capture request. /// /// Your reference for the capture request. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Splits + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SplitsOption { get; private set; } /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). - [DataMember(Name = "splits", EmitDefaultValue = false)] - public List Splits { get; set; } + [JsonPropertyName("splits")] + public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } + + /// + /// Used to track the state of SubMerchants + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SubMerchantsOption { get; private set; } /// /// List of sub-merchants. /// /// List of sub-merchants. - [DataMember(Name = "subMerchants", EmitDefaultValue = false)] - public List SubMerchants { get; set; } + [JsonPropertyName("subMerchants")] + public List SubMerchants { get { return this.SubMerchantsOption; } set { this.SubMerchantsOption = new Option>(value); } } /// /// Returns the string presentation of the object @@ -156,162 +224,253 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PaymentCaptureResponse {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentPspReference: ").Append(PaymentPspReference).Append("\n"); - sb.Append(" PlatformChargebackLogic: ").Append(PlatformChargebackLogic).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" LineItems: ").Append(LineItems).Append("\n"); + sb.Append(" PlatformChargebackLogic: ").Append(PlatformChargebackLogic).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" SubMerchants: ").Append(SubMerchants).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentCaptureResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentCaptureResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentCaptureResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentCaptureResponse instances are equal - /// - /// Instance of PaymentCaptureResponse to be compared - /// Boolean - public bool Equals(PaymentCaptureResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option merchantAccount = default; + Option paymentPspReference = default; + Option pspReference = default; + Option status = default; + Option> lineItems = default; + Option platformChargebackLogic = default; + Option reference = default; + Option> splits = default; + Option> subMerchants = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "paymentPspReference": + paymentPspReference = new Option(utf8JsonReader.GetString()); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(PaymentCaptureResponse.StatusEnumFromStringOrDefault(statusRawValue)); + break; + case "lineItems": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "platformChargebackLogic": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "splits": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "subMerchants": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + subMerchants = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.LineItems == input.LineItems || - this.LineItems != null && - input.LineItems != null && - this.LineItems.SequenceEqual(input.LineItems) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.PaymentPspReference == input.PaymentPspReference || - (this.PaymentPspReference != null && - this.PaymentPspReference.Equals(input.PaymentPspReference)) - ) && - ( - this.PlatformChargebackLogic == input.PlatformChargebackLogic || - (this.PlatformChargebackLogic != null && - this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.Splits == input.Splits || - this.Splits != null && - input.Splits != null && - this.Splits.SequenceEqual(input.Splits) - ) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ) && - ( - this.SubMerchants == input.SubMerchants || - this.SubMerchants != null && - input.SubMerchants != null && - this.SubMerchants.SequenceEqual(input.SubMerchants) - ); + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class PaymentCaptureResponse.", nameof(amount)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentCaptureResponse.", nameof(merchantAccount)); + + if (!paymentPspReference.IsSet) + throw new ArgumentException("Property is required for class PaymentCaptureResponse.", nameof(paymentPspReference)); + + if (!pspReference.IsSet) + throw new ArgumentException("Property is required for class PaymentCaptureResponse.", nameof(pspReference)); + + if (!status.IsSet) + throw new ArgumentException("Property is required for class PaymentCaptureResponse.", nameof(status)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentCaptureResponse."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentCaptureResponse."); + + if (paymentPspReference.IsSet && paymentPspReference.Value == null) + throw new ArgumentNullException(nameof(paymentPspReference), "Property is not nullable for class PaymentCaptureResponse."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentCaptureResponse."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaymentCaptureResponse."); + + if (lineItems.IsSet && lineItems.Value == null) + throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentCaptureResponse."); + + if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) + throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class PaymentCaptureResponse."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentCaptureResponse."); + + if (splits.IsSet && splits.Value == null) + throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentCaptureResponse."); + + if (subMerchants.IsSet && subMerchants.Value == null) + throw new ArgumentNullException(nameof(subMerchants), "Property is not nullable for class PaymentCaptureResponse."); + + return new PaymentCaptureResponse(amount.Value, merchantAccount.Value, paymentPspReference.Value, pspReference.Value, status.Value.Value, lineItems, platformChargebackLogic, reference, splits, subMerchants); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentCaptureResponse paymentCaptureResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.LineItems != null) - { - hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.PaymentPspReference != null) - { - hashCode = (hashCode * 59) + this.PaymentPspReference.GetHashCode(); - } - if (this.PlatformChargebackLogic != null) - { - hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.Splits != null) - { - hashCode = (hashCode * 59) + this.Splits.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - if (this.SubMerchants != null) - { - hashCode = (hashCode * 59) + this.SubMerchants.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentCaptureResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentCaptureResponse paymentCaptureResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentCaptureResponse.Amount == null) + throw new ArgumentNullException(nameof(paymentCaptureResponse.Amount), "Property is required for class PaymentCaptureResponse."); + + if (paymentCaptureResponse.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentCaptureResponse.MerchantAccount), "Property is required for class PaymentCaptureResponse."); + + if (paymentCaptureResponse.PaymentPspReference == null) + throw new ArgumentNullException(nameof(paymentCaptureResponse.PaymentPspReference), "Property is required for class PaymentCaptureResponse."); + + if (paymentCaptureResponse.PspReference == null) + throw new ArgumentNullException(nameof(paymentCaptureResponse.PspReference), "Property is required for class PaymentCaptureResponse."); + + if (paymentCaptureResponse.LineItemsOption.IsSet && paymentCaptureResponse.LineItems == null) + throw new ArgumentNullException(nameof(paymentCaptureResponse.LineItems), "Property is required for class PaymentCaptureResponse."); + + if (paymentCaptureResponse.PlatformChargebackLogicOption.IsSet && paymentCaptureResponse.PlatformChargebackLogic == null) + throw new ArgumentNullException(nameof(paymentCaptureResponse.PlatformChargebackLogic), "Property is required for class PaymentCaptureResponse."); + + if (paymentCaptureResponse.ReferenceOption.IsSet && paymentCaptureResponse.Reference == null) + throw new ArgumentNullException(nameof(paymentCaptureResponse.Reference), "Property is required for class PaymentCaptureResponse."); + + if (paymentCaptureResponse.SplitsOption.IsSet && paymentCaptureResponse.Splits == null) + throw new ArgumentNullException(nameof(paymentCaptureResponse.Splits), "Property is required for class PaymentCaptureResponse."); + + if (paymentCaptureResponse.SubMerchantsOption.IsSet && paymentCaptureResponse.SubMerchants == null) + throw new ArgumentNullException(nameof(paymentCaptureResponse.SubMerchants), "Property is required for class PaymentCaptureResponse."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, paymentCaptureResponse.Amount, jsonSerializerOptions); + writer.WriteString("merchantAccount", paymentCaptureResponse.MerchantAccount); + + writer.WriteString("paymentPspReference", paymentCaptureResponse.PaymentPspReference); + + writer.WriteString("pspReference", paymentCaptureResponse.PspReference); + + var statusRawValue = PaymentCaptureResponse.StatusEnumToJsonValue(paymentCaptureResponse.Status); + writer.WriteString("status", statusRawValue); + if (paymentCaptureResponse.LineItemsOption.IsSet) + { + writer.WritePropertyName("lineItems"); + JsonSerializer.Serialize(writer, paymentCaptureResponse.LineItems, jsonSerializerOptions); + } + if (paymentCaptureResponse.PlatformChargebackLogicOption.IsSet) + { + writer.WritePropertyName("platformChargebackLogic"); + JsonSerializer.Serialize(writer, paymentCaptureResponse.PlatformChargebackLogic, jsonSerializerOptions); + } + if (paymentCaptureResponse.ReferenceOption.IsSet) + writer.WriteString("reference", paymentCaptureResponse.Reference); + + if (paymentCaptureResponse.SplitsOption.IsSet) + { + writer.WritePropertyName("splits"); + JsonSerializer.Serialize(writer, paymentCaptureResponse.Splits, jsonSerializerOptions); + } + if (paymentCaptureResponse.SubMerchantsOption.IsSet) + { + writer.WritePropertyName("subMerchants"); + JsonSerializer.Serialize(writer, paymentCaptureResponse.SubMerchants, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/PaymentCompletionDetails.cs b/Adyen/Model/Checkout/PaymentCompletionDetails.cs index 499717c02..ca2c94a4e 100644 --- a/Adyen/Model/Checkout/PaymentCompletionDetails.cs +++ b/Adyen/Model/Checkout/PaymentCompletionDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,208 +14,349 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentCompletionDetails /// - [DataContract(Name = "PaymentCompletionDetails")] - public partial class PaymentCompletionDetails : IEquatable, IValidatableObject + public partial class PaymentCompletionDetails : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// A payment session identifier returned by the card issuer.. - /// (3D) Payment Authentication Request data for the card issuer.. - /// (3D) Payment Authentication Response data by the card issuer.. - /// authorizationToken. - /// PayPal-generated token for recurring payments.. - /// The SMS verification code collected from the shopper.. - /// PayPal-generated third party access token.. - /// A random number sent to the mobile phone number of the shopper to verify the payment.. - /// PayPal-assigned ID for the order.. - /// PayPal-assigned ID for the payer (shopper).. - /// Payload appended to the `returnURL` as a result of the redirect.. - /// PayPal-generated ID for the payment.. - /// Value passed from the WeChat MiniProgram `wx.requestPayment` **complete** callback. Possible values: any value starting with `requestPayment:`.. - /// The result of the redirect as appended to the `returnURL`.. - /// Value you received from the WeChat Pay SDK.. - /// The query string as appended to the `returnURL` when using direct issuer links .. - /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameters: `transStatus`, `authorisationToken`.. - /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `transStatus`.. - /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `threeDSCompInd`.. - /// PayPalv2-generated token for recurring payments.. - public PaymentCompletionDetails(string mD = default(string), string paReq = default(string), string paRes = default(string), string authorizationToken = default(string), string billingToken = default(string), string cupsecureplusSmscode = default(string), string facilitatorAccessToken = default(string), string oneTimePasscode = default(string), string orderID = default(string), string payerID = default(string), string payload = default(string), string paymentID = default(string), string paymentStatus = default(string), string redirectResult = default(string), string resultCode = default(string), string returnUrlQueryString = default(string), string threeDSResult = default(string), string threeds2ChallengeResult = default(string), string threeds2Fingerprint = default(string), string vaultToken = default(string)) + /// A payment session identifier returned by the card issuer. + /// (3D) Payment Authentication Request data for the card issuer. + /// (3D) Payment Authentication Response data by the card issuer. + /// authorizationToken + /// PayPal-generated token for recurring payments. + /// The SMS verification code collected from the shopper. + /// PayPal-generated third party access token. + /// A random number sent to the mobile phone number of the shopper to verify the payment. + /// PayPal-assigned ID for the order. + /// PayPal-assigned ID for the payer (shopper). + /// Payload appended to the `returnURL` as a result of the redirect. + /// PayPal-generated ID for the payment. + /// Value passed from the WeChat MiniProgram `wx.requestPayment` **complete** callback. Possible values: any value starting with `requestPayment:`. + /// The result of the redirect as appended to the `returnURL`. + /// Value you received from the WeChat Pay SDK. + /// The query string as appended to the `returnURL` when using direct issuer links . + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameters: `transStatus`, `authorisationToken`. + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `transStatus`. + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `threeDSCompInd`. + /// PayPalv2-generated token for recurring payments. + [JsonConstructor] + public PaymentCompletionDetails(Option mD = default, Option paReq = default, Option paRes = default, Option authorizationToken = default, Option billingToken = default, Option cupsecureplusSmscode = default, Option facilitatorAccessToken = default, Option oneTimePasscode = default, Option orderID = default, Option payerID = default, Option payload = default, Option paymentID = default, Option paymentStatus = default, Option redirectResult = default, Option resultCode = default, Option returnUrlQueryString = default, Option threeDSResult = default, Option threeds2ChallengeResult = default, Option threeds2Fingerprint = default, Option vaultToken = default) { - this.MD = mD; - this.PaReq = paReq; - this.PaRes = paRes; - this.AuthorizationToken = authorizationToken; - this.BillingToken = billingToken; - this.CupsecureplusSmscode = cupsecureplusSmscode; - this.FacilitatorAccessToken = facilitatorAccessToken; - this.OneTimePasscode = oneTimePasscode; - this.OrderID = orderID; - this.PayerID = payerID; - this.Payload = payload; - this.PaymentID = paymentID; - this.PaymentStatus = paymentStatus; - this.RedirectResult = redirectResult; - this.ResultCode = resultCode; - this.ReturnUrlQueryString = returnUrlQueryString; - this.ThreeDSResult = threeDSResult; - this.Threeds2ChallengeResult = threeds2ChallengeResult; - this.Threeds2Fingerprint = threeds2Fingerprint; - this.VaultToken = vaultToken; + MDOption = mD; + PaReqOption = paReq; + PaResOption = paRes; + AuthorizationTokenOption = authorizationToken; + BillingTokenOption = billingToken; + CupsecureplusSmscodeOption = cupsecureplusSmscode; + FacilitatorAccessTokenOption = facilitatorAccessToken; + OneTimePasscodeOption = oneTimePasscode; + OrderIDOption = orderID; + PayerIDOption = payerID; + PayloadOption = payload; + PaymentIDOption = paymentID; + PaymentStatusOption = paymentStatus; + RedirectResultOption = redirectResult; + ResultCodeOption = resultCode; + ReturnUrlQueryStringOption = returnUrlQueryString; + ThreeDSResultOption = threeDSResult; + Threeds2ChallengeResultOption = threeds2ChallengeResult; + Threeds2FingerprintOption = threeds2Fingerprint; + VaultTokenOption = vaultToken; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of MD + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MDOption { get; private set; } + /// /// A payment session identifier returned by the card issuer. /// /// A payment session identifier returned by the card issuer. - [DataMember(Name = "MD", EmitDefaultValue = false)] - public string MD { get; set; } + [JsonPropertyName("MD")] + public string MD { get { return this.MDOption; } set { this.MDOption = new Option(value); } } + + /// + /// Used to track the state of PaReq + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaReqOption { get; private set; } /// /// (3D) Payment Authentication Request data for the card issuer. /// /// (3D) Payment Authentication Request data for the card issuer. - [DataMember(Name = "PaReq", EmitDefaultValue = false)] - public string PaReq { get; set; } + [JsonPropertyName("PaReq")] + public string PaReq { get { return this.PaReqOption; } set { this.PaReqOption = new Option(value); } } + + /// + /// Used to track the state of PaRes + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaResOption { get; private set; } /// /// (3D) Payment Authentication Response data by the card issuer. /// /// (3D) Payment Authentication Response data by the card issuer. - [DataMember(Name = "PaRes", EmitDefaultValue = false)] - public string PaRes { get; set; } + [JsonPropertyName("PaRes")] + public string PaRes { get { return this.PaResOption; } set { this.PaResOption = new Option(value); } } + + /// + /// Used to track the state of AuthorizationToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthorizationTokenOption { get; private set; } /// /// Gets or Sets AuthorizationToken /// - [DataMember(Name = "authorization_token", EmitDefaultValue = false)] - public string AuthorizationToken { get; set; } + [JsonPropertyName("authorization_token")] + public string AuthorizationToken { get { return this.AuthorizationTokenOption; } set { this.AuthorizationTokenOption = new Option(value); } } + + /// + /// Used to track the state of BillingToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingTokenOption { get; private set; } /// /// PayPal-generated token for recurring payments. /// /// PayPal-generated token for recurring payments. - [DataMember(Name = "billingToken", EmitDefaultValue = false)] - public string BillingToken { get; set; } + [JsonPropertyName("billingToken")] + public string BillingToken { get { return this.BillingTokenOption; } set { this.BillingTokenOption = new Option(value); } } + + /// + /// Used to track the state of CupsecureplusSmscode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CupsecureplusSmscodeOption { get; private set; } /// /// The SMS verification code collected from the shopper. /// /// The SMS verification code collected from the shopper. - [DataMember(Name = "cupsecureplus.smscode", EmitDefaultValue = false)] - public string CupsecureplusSmscode { get; set; } + [JsonPropertyName("cupsecureplus.smscode")] + public string CupsecureplusSmscode { get { return this.CupsecureplusSmscodeOption; } set { this.CupsecureplusSmscodeOption = new Option(value); } } + + /// + /// Used to track the state of FacilitatorAccessToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FacilitatorAccessTokenOption { get; private set; } /// /// PayPal-generated third party access token. /// /// PayPal-generated third party access token. - [DataMember(Name = "facilitatorAccessToken", EmitDefaultValue = false)] - public string FacilitatorAccessToken { get; set; } + [JsonPropertyName("facilitatorAccessToken")] + public string FacilitatorAccessToken { get { return this.FacilitatorAccessTokenOption; } set { this.FacilitatorAccessTokenOption = new Option(value); } } + + /// + /// Used to track the state of OneTimePasscode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OneTimePasscodeOption { get; private set; } /// /// A random number sent to the mobile phone number of the shopper to verify the payment. /// /// A random number sent to the mobile phone number of the shopper to verify the payment. - [DataMember(Name = "oneTimePasscode", EmitDefaultValue = false)] - public string OneTimePasscode { get; set; } + [JsonPropertyName("oneTimePasscode")] + public string OneTimePasscode { get { return this.OneTimePasscodeOption; } set { this.OneTimePasscodeOption = new Option(value); } } + + /// + /// Used to track the state of OrderID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OrderIDOption { get; private set; } /// /// PayPal-assigned ID for the order. /// /// PayPal-assigned ID for the order. - [DataMember(Name = "orderID", EmitDefaultValue = false)] - public string OrderID { get; set; } + [JsonPropertyName("orderID")] + public string OrderID { get { return this.OrderIDOption; } set { this.OrderIDOption = new Option(value); } } + + /// + /// Used to track the state of PayerID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayerIDOption { get; private set; } /// /// PayPal-assigned ID for the payer (shopper). /// /// PayPal-assigned ID for the payer (shopper). - [DataMember(Name = "payerID", EmitDefaultValue = false)] - public string PayerID { get; set; } + [JsonPropertyName("payerID")] + public string PayerID { get { return this.PayerIDOption; } set { this.PayerIDOption = new Option(value); } } + + /// + /// Used to track the state of Payload + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayloadOption { get; private set; } /// /// Payload appended to the `returnURL` as a result of the redirect. /// /// Payload appended to the `returnURL` as a result of the redirect. - [DataMember(Name = "payload", EmitDefaultValue = false)] - public string Payload { get; set; } + [JsonPropertyName("payload")] + public string Payload { get { return this.PayloadOption; } set { this.PayloadOption = new Option(value); } } + + /// + /// Used to track the state of PaymentID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentIDOption { get; private set; } /// /// PayPal-generated ID for the payment. /// /// PayPal-generated ID for the payment. - [DataMember(Name = "paymentID", EmitDefaultValue = false)] - public string PaymentID { get; set; } + [JsonPropertyName("paymentID")] + public string PaymentID { get { return this.PaymentIDOption; } set { this.PaymentIDOption = new Option(value); } } + + /// + /// Used to track the state of PaymentStatus + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentStatusOption { get; private set; } /// /// Value passed from the WeChat MiniProgram `wx.requestPayment` **complete** callback. Possible values: any value starting with `requestPayment:`. /// /// Value passed from the WeChat MiniProgram `wx.requestPayment` **complete** callback. Possible values: any value starting with `requestPayment:`. - [DataMember(Name = "paymentStatus", EmitDefaultValue = false)] - public string PaymentStatus { get; set; } + [JsonPropertyName("paymentStatus")] + public string PaymentStatus { get { return this.PaymentStatusOption; } set { this.PaymentStatusOption = new Option(value); } } + + /// + /// Used to track the state of RedirectResult + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RedirectResultOption { get; private set; } /// /// The result of the redirect as appended to the `returnURL`. /// /// The result of the redirect as appended to the `returnURL`. - [DataMember(Name = "redirectResult", EmitDefaultValue = false)] - public string RedirectResult { get; set; } + [JsonPropertyName("redirectResult")] + public string RedirectResult { get { return this.RedirectResultOption; } set { this.RedirectResultOption = new Option(value); } } + + /// + /// Used to track the state of ResultCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ResultCodeOption { get; private set; } /// /// Value you received from the WeChat Pay SDK. /// /// Value you received from the WeChat Pay SDK. - [DataMember(Name = "resultCode", EmitDefaultValue = false)] - public string ResultCode { get; set; } + [JsonPropertyName("resultCode")] + public string ResultCode { get { return this.ResultCodeOption; } set { this.ResultCodeOption = new Option(value); } } + + /// + /// Used to track the state of ReturnUrlQueryString + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReturnUrlQueryStringOption { get; private set; } /// /// The query string as appended to the `returnURL` when using direct issuer links . /// /// The query string as appended to the `returnURL` when using direct issuer links . - [DataMember(Name = "returnUrlQueryString", EmitDefaultValue = false)] - public string ReturnUrlQueryString { get; set; } + [JsonPropertyName("returnUrlQueryString")] + public string ReturnUrlQueryString { get { return this.ReturnUrlQueryStringOption; } set { this.ReturnUrlQueryStringOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSResult + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSResultOption { get; private set; } /// /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameters: `transStatus`, `authorisationToken`. /// /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameters: `transStatus`, `authorisationToken`. - [DataMember(Name = "threeDSResult", EmitDefaultValue = false)] - public string ThreeDSResult { get; set; } + [JsonPropertyName("threeDSResult")] + public string ThreeDSResult { get { return this.ThreeDSResultOption; } set { this.ThreeDSResultOption = new Option(value); } } + + /// + /// Used to track the state of Threeds2ChallengeResult + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option Threeds2ChallengeResultOption { get; private set; } /// /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `transStatus`. /// /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `transStatus`. - [DataMember(Name = "threeds2.challengeResult", EmitDefaultValue = false)] - public string Threeds2ChallengeResult { get; set; } + [JsonPropertyName("threeds2.challengeResult")] + public string Threeds2ChallengeResult { get { return this.Threeds2ChallengeResultOption; } set { this.Threeds2ChallengeResultOption = new Option(value); } } + + /// + /// Used to track the state of Threeds2Fingerprint + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option Threeds2FingerprintOption { get; private set; } /// /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `threeDSCompInd`. /// /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `threeDSCompInd`. - [DataMember(Name = "threeds2.fingerprint", EmitDefaultValue = false)] - public string Threeds2Fingerprint { get; set; } + [JsonPropertyName("threeds2.fingerprint")] + public string Threeds2Fingerprint { get { return this.Threeds2FingerprintOption; } set { this.Threeds2FingerprintOption = new Option(value); } } + + /// + /// Used to track the state of VaultToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VaultTokenOption { get; private set; } /// /// PayPalv2-generated token for recurring payments. /// /// PayPalv2-generated token for recurring payments. - [DataMember(Name = "vaultToken", EmitDefaultValue = false)] - public string VaultToken { get; set; } + [JsonPropertyName("vaultToken")] + public string VaultToken { get { return this.VaultTokenOption; } set { this.VaultTokenOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -250,294 +390,401 @@ public override string ToString() return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PaymentCompletionDetails); - } - - /// - /// Returns true if PaymentCompletionDetails instances are equal - /// - /// Instance of PaymentCompletionDetails to be compared - /// Boolean - public bool Equals(PaymentCompletionDetails input) - { - if (input == null) - { - return false; - } - return - ( - this.MD == input.MD || - (this.MD != null && - this.MD.Equals(input.MD)) - ) && - ( - this.PaReq == input.PaReq || - (this.PaReq != null && - this.PaReq.Equals(input.PaReq)) - ) && - ( - this.PaRes == input.PaRes || - (this.PaRes != null && - this.PaRes.Equals(input.PaRes)) - ) && - ( - this.AuthorizationToken == input.AuthorizationToken || - (this.AuthorizationToken != null && - this.AuthorizationToken.Equals(input.AuthorizationToken)) - ) && - ( - this.BillingToken == input.BillingToken || - (this.BillingToken != null && - this.BillingToken.Equals(input.BillingToken)) - ) && - ( - this.CupsecureplusSmscode == input.CupsecureplusSmscode || - (this.CupsecureplusSmscode != null && - this.CupsecureplusSmscode.Equals(input.CupsecureplusSmscode)) - ) && - ( - this.FacilitatorAccessToken == input.FacilitatorAccessToken || - (this.FacilitatorAccessToken != null && - this.FacilitatorAccessToken.Equals(input.FacilitatorAccessToken)) - ) && - ( - this.OneTimePasscode == input.OneTimePasscode || - (this.OneTimePasscode != null && - this.OneTimePasscode.Equals(input.OneTimePasscode)) - ) && - ( - this.OrderID == input.OrderID || - (this.OrderID != null && - this.OrderID.Equals(input.OrderID)) - ) && - ( - this.PayerID == input.PayerID || - (this.PayerID != null && - this.PayerID.Equals(input.PayerID)) - ) && - ( - this.Payload == input.Payload || - (this.Payload != null && - this.Payload.Equals(input.Payload)) - ) && - ( - this.PaymentID == input.PaymentID || - (this.PaymentID != null && - this.PaymentID.Equals(input.PaymentID)) - ) && - ( - this.PaymentStatus == input.PaymentStatus || - (this.PaymentStatus != null && - this.PaymentStatus.Equals(input.PaymentStatus)) - ) && - ( - this.RedirectResult == input.RedirectResult || - (this.RedirectResult != null && - this.RedirectResult.Equals(input.RedirectResult)) - ) && - ( - this.ResultCode == input.ResultCode || - (this.ResultCode != null && - this.ResultCode.Equals(input.ResultCode)) - ) && - ( - this.ReturnUrlQueryString == input.ReturnUrlQueryString || - (this.ReturnUrlQueryString != null && - this.ReturnUrlQueryString.Equals(input.ReturnUrlQueryString)) - ) && - ( - this.ThreeDSResult == input.ThreeDSResult || - (this.ThreeDSResult != null && - this.ThreeDSResult.Equals(input.ThreeDSResult)) - ) && - ( - this.Threeds2ChallengeResult == input.Threeds2ChallengeResult || - (this.Threeds2ChallengeResult != null && - this.Threeds2ChallengeResult.Equals(input.Threeds2ChallengeResult)) - ) && - ( - this.Threeds2Fingerprint == input.Threeds2Fingerprint || - (this.Threeds2Fingerprint != null && - this.Threeds2Fingerprint.Equals(input.Threeds2Fingerprint)) - ) && - ( - this.VaultToken == input.VaultToken || - (this.VaultToken != null && - this.VaultToken.Equals(input.VaultToken)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.MD != null) - { - hashCode = (hashCode * 59) + this.MD.GetHashCode(); - } - if (this.PaReq != null) - { - hashCode = (hashCode * 59) + this.PaReq.GetHashCode(); - } - if (this.PaRes != null) - { - hashCode = (hashCode * 59) + this.PaRes.GetHashCode(); - } - if (this.AuthorizationToken != null) - { - hashCode = (hashCode * 59) + this.AuthorizationToken.GetHashCode(); - } - if (this.BillingToken != null) - { - hashCode = (hashCode * 59) + this.BillingToken.GetHashCode(); - } - if (this.CupsecureplusSmscode != null) - { - hashCode = (hashCode * 59) + this.CupsecureplusSmscode.GetHashCode(); - } - if (this.FacilitatorAccessToken != null) - { - hashCode = (hashCode * 59) + this.FacilitatorAccessToken.GetHashCode(); - } - if (this.OneTimePasscode != null) - { - hashCode = (hashCode * 59) + this.OneTimePasscode.GetHashCode(); - } - if (this.OrderID != null) - { - hashCode = (hashCode * 59) + this.OrderID.GetHashCode(); - } - if (this.PayerID != null) - { - hashCode = (hashCode * 59) + this.PayerID.GetHashCode(); - } - if (this.Payload != null) - { - hashCode = (hashCode * 59) + this.Payload.GetHashCode(); - } - if (this.PaymentID != null) - { - hashCode = (hashCode * 59) + this.PaymentID.GetHashCode(); - } - if (this.PaymentStatus != null) - { - hashCode = (hashCode * 59) + this.PaymentStatus.GetHashCode(); - } - if (this.RedirectResult != null) - { - hashCode = (hashCode * 59) + this.RedirectResult.GetHashCode(); - } - if (this.ResultCode != null) - { - hashCode = (hashCode * 59) + this.ResultCode.GetHashCode(); - } - if (this.ReturnUrlQueryString != null) - { - hashCode = (hashCode * 59) + this.ReturnUrlQueryString.GetHashCode(); - } - if (this.ThreeDSResult != null) - { - hashCode = (hashCode * 59) + this.ThreeDSResult.GetHashCode(); - } - if (this.Threeds2ChallengeResult != null) - { - hashCode = (hashCode * 59) + this.Threeds2ChallengeResult.GetHashCode(); - } - if (this.Threeds2Fingerprint != null) - { - hashCode = (hashCode * 59) + this.Threeds2Fingerprint.GetHashCode(); - } - if (this.VaultToken != null) - { - hashCode = (hashCode * 59) + this.VaultToken.GetHashCode(); - } - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // MD (string) maxLength if (this.MD != null && this.MD.Length > 20000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for MD, length must be less than 20000.", new [] { "MD" }); + yield return new ValidationResult("Invalid value for MD, length must be less than 20000.", new [] { "MD" }); } // PaReq (string) maxLength if (this.PaReq != null && this.PaReq.Length > 20000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PaReq, length must be less than 20000.", new [] { "PaReq" }); + yield return new ValidationResult("Invalid value for PaReq, length must be less than 20000.", new [] { "PaReq" }); } // PaRes (string) maxLength if (this.PaRes != null && this.PaRes.Length > 20000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PaRes, length must be less than 20000.", new [] { "PaRes" }); + yield return new ValidationResult("Invalid value for PaRes, length must be less than 20000.", new [] { "PaRes" }); } // Payload (string) maxLength if (this.Payload != null && this.Payload.Length > 20000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Payload, length must be less than 20000.", new [] { "Payload" }); + yield return new ValidationResult("Invalid value for Payload, length must be less than 20000.", new [] { "Payload" }); } // RedirectResult (string) maxLength if (this.RedirectResult != null && this.RedirectResult.Length > 20000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for RedirectResult, length must be less than 20000.", new [] { "RedirectResult" }); + yield return new ValidationResult("Invalid value for RedirectResult, length must be less than 20000.", new [] { "RedirectResult" }); } // ReturnUrlQueryString (string) maxLength if (this.ReturnUrlQueryString != null && this.ReturnUrlQueryString.Length > 20000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ReturnUrlQueryString, length must be less than 20000.", new [] { "ReturnUrlQueryString" }); + yield return new ValidationResult("Invalid value for ReturnUrlQueryString, length must be less than 20000.", new [] { "ReturnUrlQueryString" }); } // ThreeDSResult (string) maxLength if (this.ThreeDSResult != null && this.ThreeDSResult.Length > 50000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSResult, length must be less than 50000.", new [] { "ThreeDSResult" }); + yield return new ValidationResult("Invalid value for ThreeDSResult, length must be less than 50000.", new [] { "ThreeDSResult" }); } // Threeds2ChallengeResult (string) maxLength if (this.Threeds2ChallengeResult != null && this.Threeds2ChallengeResult.Length > 50000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Threeds2ChallengeResult, length must be less than 50000.", new [] { "Threeds2ChallengeResult" }); + yield return new ValidationResult("Invalid value for Threeds2ChallengeResult, length must be less than 50000.", new [] { "Threeds2ChallengeResult" }); } // Threeds2Fingerprint (string) maxLength if (this.Threeds2Fingerprint != null && this.Threeds2Fingerprint.Length > 100000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Threeds2Fingerprint, length must be less than 100000.", new [] { "Threeds2Fingerprint" }); + yield return new ValidationResult("Invalid value for Threeds2Fingerprint, length must be less than 100000.", new [] { "Threeds2Fingerprint" }); } yield break; } } + /// + /// A Json converter for type + /// + public class PaymentCompletionDetailsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override PaymentCompletionDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option mD = default; + Option paReq = default; + Option paRes = default; + Option authorizationToken = default; + Option billingToken = default; + Option cupsecureplusSmscode = default; + Option facilitatorAccessToken = default; + Option oneTimePasscode = default; + Option orderID = default; + Option payerID = default; + Option payload = default; + Option paymentID = default; + Option paymentStatus = default; + Option redirectResult = default; + Option resultCode = default; + Option returnUrlQueryString = default; + Option threeDSResult = default; + Option threeds2ChallengeResult = default; + Option threeds2Fingerprint = default; + Option vaultToken = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "MD": + mD = new Option(utf8JsonReader.GetString()); + break; + case "PaReq": + paReq = new Option(utf8JsonReader.GetString()); + break; + case "PaRes": + paRes = new Option(utf8JsonReader.GetString()); + break; + case "authorization_token": + authorizationToken = new Option(utf8JsonReader.GetString()); + break; + case "billingToken": + billingToken = new Option(utf8JsonReader.GetString()); + break; + case "cupsecureplus.smscode": + cupsecureplusSmscode = new Option(utf8JsonReader.GetString()); + break; + case "facilitatorAccessToken": + facilitatorAccessToken = new Option(utf8JsonReader.GetString()); + break; + case "oneTimePasscode": + oneTimePasscode = new Option(utf8JsonReader.GetString()); + break; + case "orderID": + orderID = new Option(utf8JsonReader.GetString()); + break; + case "payerID": + payerID = new Option(utf8JsonReader.GetString()); + break; + case "payload": + payload = new Option(utf8JsonReader.GetString()); + break; + case "paymentID": + paymentID = new Option(utf8JsonReader.GetString()); + break; + case "paymentStatus": + paymentStatus = new Option(utf8JsonReader.GetString()); + break; + case "redirectResult": + redirectResult = new Option(utf8JsonReader.GetString()); + break; + case "resultCode": + resultCode = new Option(utf8JsonReader.GetString()); + break; + case "returnUrlQueryString": + returnUrlQueryString = new Option(utf8JsonReader.GetString()); + break; + case "threeDSResult": + threeDSResult = new Option(utf8JsonReader.GetString()); + break; + case "threeds2.challengeResult": + threeds2ChallengeResult = new Option(utf8JsonReader.GetString()); + break; + case "threeds2.fingerprint": + threeds2Fingerprint = new Option(utf8JsonReader.GetString()); + break; + case "vaultToken": + vaultToken = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (mD.IsSet && mD.Value == null) + throw new ArgumentNullException(nameof(mD), "Property is not nullable for class PaymentCompletionDetails."); + + if (paReq.IsSet && paReq.Value == null) + throw new ArgumentNullException(nameof(paReq), "Property is not nullable for class PaymentCompletionDetails."); + + if (paRes.IsSet && paRes.Value == null) + throw new ArgumentNullException(nameof(paRes), "Property is not nullable for class PaymentCompletionDetails."); + + if (authorizationToken.IsSet && authorizationToken.Value == null) + throw new ArgumentNullException(nameof(authorizationToken), "Property is not nullable for class PaymentCompletionDetails."); + + if (billingToken.IsSet && billingToken.Value == null) + throw new ArgumentNullException(nameof(billingToken), "Property is not nullable for class PaymentCompletionDetails."); + + if (cupsecureplusSmscode.IsSet && cupsecureplusSmscode.Value == null) + throw new ArgumentNullException(nameof(cupsecureplusSmscode), "Property is not nullable for class PaymentCompletionDetails."); + + if (facilitatorAccessToken.IsSet && facilitatorAccessToken.Value == null) + throw new ArgumentNullException(nameof(facilitatorAccessToken), "Property is not nullable for class PaymentCompletionDetails."); + + if (oneTimePasscode.IsSet && oneTimePasscode.Value == null) + throw new ArgumentNullException(nameof(oneTimePasscode), "Property is not nullable for class PaymentCompletionDetails."); + + if (orderID.IsSet && orderID.Value == null) + throw new ArgumentNullException(nameof(orderID), "Property is not nullable for class PaymentCompletionDetails."); + + if (payerID.IsSet && payerID.Value == null) + throw new ArgumentNullException(nameof(payerID), "Property is not nullable for class PaymentCompletionDetails."); + + if (payload.IsSet && payload.Value == null) + throw new ArgumentNullException(nameof(payload), "Property is not nullable for class PaymentCompletionDetails."); + + if (paymentID.IsSet && paymentID.Value == null) + throw new ArgumentNullException(nameof(paymentID), "Property is not nullable for class PaymentCompletionDetails."); + + if (paymentStatus.IsSet && paymentStatus.Value == null) + throw new ArgumentNullException(nameof(paymentStatus), "Property is not nullable for class PaymentCompletionDetails."); + + if (redirectResult.IsSet && redirectResult.Value == null) + throw new ArgumentNullException(nameof(redirectResult), "Property is not nullable for class PaymentCompletionDetails."); + + if (resultCode.IsSet && resultCode.Value == null) + throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class PaymentCompletionDetails."); + + if (returnUrlQueryString.IsSet && returnUrlQueryString.Value == null) + throw new ArgumentNullException(nameof(returnUrlQueryString), "Property is not nullable for class PaymentCompletionDetails."); + + if (threeDSResult.IsSet && threeDSResult.Value == null) + throw new ArgumentNullException(nameof(threeDSResult), "Property is not nullable for class PaymentCompletionDetails."); + + if (threeds2ChallengeResult.IsSet && threeds2ChallengeResult.Value == null) + throw new ArgumentNullException(nameof(threeds2ChallengeResult), "Property is not nullable for class PaymentCompletionDetails."); + + if (threeds2Fingerprint.IsSet && threeds2Fingerprint.Value == null) + throw new ArgumentNullException(nameof(threeds2Fingerprint), "Property is not nullable for class PaymentCompletionDetails."); + + if (vaultToken.IsSet && vaultToken.Value == null) + throw new ArgumentNullException(nameof(vaultToken), "Property is not nullable for class PaymentCompletionDetails."); + + return new PaymentCompletionDetails(mD, paReq, paRes, authorizationToken, billingToken, cupsecureplusSmscode, facilitatorAccessToken, oneTimePasscode, orderID, payerID, payload, paymentID, paymentStatus, redirectResult, resultCode, returnUrlQueryString, threeDSResult, threeds2ChallengeResult, threeds2Fingerprint, vaultToken); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentCompletionDetails paymentCompletionDetails, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, paymentCompletionDetails, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentCompletionDetails paymentCompletionDetails, JsonSerializerOptions jsonSerializerOptions) + { + if (paymentCompletionDetails.MDOption.IsSet && paymentCompletionDetails.MD == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.MD), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.PaReqOption.IsSet && paymentCompletionDetails.PaReq == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.PaReq), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.PaResOption.IsSet && paymentCompletionDetails.PaRes == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.PaRes), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.AuthorizationTokenOption.IsSet && paymentCompletionDetails.AuthorizationToken == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.AuthorizationToken), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.BillingTokenOption.IsSet && paymentCompletionDetails.BillingToken == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.BillingToken), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.CupsecureplusSmscodeOption.IsSet && paymentCompletionDetails.CupsecureplusSmscode == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.CupsecureplusSmscode), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.FacilitatorAccessTokenOption.IsSet && paymentCompletionDetails.FacilitatorAccessToken == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.FacilitatorAccessToken), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.OneTimePasscodeOption.IsSet && paymentCompletionDetails.OneTimePasscode == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.OneTimePasscode), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.OrderIDOption.IsSet && paymentCompletionDetails.OrderID == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.OrderID), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.PayerIDOption.IsSet && paymentCompletionDetails.PayerID == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.PayerID), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.PayloadOption.IsSet && paymentCompletionDetails.Payload == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.Payload), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.PaymentIDOption.IsSet && paymentCompletionDetails.PaymentID == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.PaymentID), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.PaymentStatusOption.IsSet && paymentCompletionDetails.PaymentStatus == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.PaymentStatus), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.RedirectResultOption.IsSet && paymentCompletionDetails.RedirectResult == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.RedirectResult), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.ResultCodeOption.IsSet && paymentCompletionDetails.ResultCode == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.ResultCode), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.ReturnUrlQueryStringOption.IsSet && paymentCompletionDetails.ReturnUrlQueryString == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.ReturnUrlQueryString), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.ThreeDSResultOption.IsSet && paymentCompletionDetails.ThreeDSResult == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.ThreeDSResult), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.Threeds2ChallengeResultOption.IsSet && paymentCompletionDetails.Threeds2ChallengeResult == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.Threeds2ChallengeResult), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.Threeds2FingerprintOption.IsSet && paymentCompletionDetails.Threeds2Fingerprint == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.Threeds2Fingerprint), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.VaultTokenOption.IsSet && paymentCompletionDetails.VaultToken == null) + throw new ArgumentNullException(nameof(paymentCompletionDetails.VaultToken), "Property is required for class PaymentCompletionDetails."); + + if (paymentCompletionDetails.MDOption.IsSet) + writer.WriteString("MD", paymentCompletionDetails.MD); + + if (paymentCompletionDetails.PaReqOption.IsSet) + writer.WriteString("PaReq", paymentCompletionDetails.PaReq); + + if (paymentCompletionDetails.PaResOption.IsSet) + writer.WriteString("PaRes", paymentCompletionDetails.PaRes); + + if (paymentCompletionDetails.AuthorizationTokenOption.IsSet) + writer.WriteString("authorization_token", paymentCompletionDetails.AuthorizationToken); + + if (paymentCompletionDetails.BillingTokenOption.IsSet) + writer.WriteString("billingToken", paymentCompletionDetails.BillingToken); + + if (paymentCompletionDetails.CupsecureplusSmscodeOption.IsSet) + writer.WriteString("cupsecureplus.smscode", paymentCompletionDetails.CupsecureplusSmscode); + + if (paymentCompletionDetails.FacilitatorAccessTokenOption.IsSet) + writer.WriteString("facilitatorAccessToken", paymentCompletionDetails.FacilitatorAccessToken); + + if (paymentCompletionDetails.OneTimePasscodeOption.IsSet) + writer.WriteString("oneTimePasscode", paymentCompletionDetails.OneTimePasscode); + + if (paymentCompletionDetails.OrderIDOption.IsSet) + writer.WriteString("orderID", paymentCompletionDetails.OrderID); + + if (paymentCompletionDetails.PayerIDOption.IsSet) + writer.WriteString("payerID", paymentCompletionDetails.PayerID); + + if (paymentCompletionDetails.PayloadOption.IsSet) + writer.WriteString("payload", paymentCompletionDetails.Payload); + + if (paymentCompletionDetails.PaymentIDOption.IsSet) + writer.WriteString("paymentID", paymentCompletionDetails.PaymentID); + + if (paymentCompletionDetails.PaymentStatusOption.IsSet) + writer.WriteString("paymentStatus", paymentCompletionDetails.PaymentStatus); + + if (paymentCompletionDetails.RedirectResultOption.IsSet) + writer.WriteString("redirectResult", paymentCompletionDetails.RedirectResult); + + if (paymentCompletionDetails.ResultCodeOption.IsSet) + writer.WriteString("resultCode", paymentCompletionDetails.ResultCode); + + if (paymentCompletionDetails.ReturnUrlQueryStringOption.IsSet) + writer.WriteString("returnUrlQueryString", paymentCompletionDetails.ReturnUrlQueryString); + + if (paymentCompletionDetails.ThreeDSResultOption.IsSet) + writer.WriteString("threeDSResult", paymentCompletionDetails.ThreeDSResult); + + if (paymentCompletionDetails.Threeds2ChallengeResultOption.IsSet) + writer.WriteString("threeds2.challengeResult", paymentCompletionDetails.Threeds2ChallengeResult); + + if (paymentCompletionDetails.Threeds2FingerprintOption.IsSet) + writer.WriteString("threeds2.fingerprint", paymentCompletionDetails.Threeds2Fingerprint); + + if (paymentCompletionDetails.VaultTokenOption.IsSet) + writer.WriteString("vaultToken", paymentCompletionDetails.VaultToken); + } + } } diff --git a/Adyen/Model/Checkout/PaymentDetails.cs b/Adyen/Model/Checkout/PaymentDetails.cs index bbb87300a..9cfac6144 100644 --- a/Adyen/Model/Checkout/PaymentDetails.cs +++ b/Adyen/Model/Checkout/PaymentDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,578 +14,1319 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentDetails /// - [DataContract(Name = "PaymentDetails")] - public partial class PaymentDetails : IEquatable, IValidatableObject + public partial class PaymentDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// The payment method type. + [JsonConstructor] + public PaymentDetails(Option checkoutAttemptId = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The payment method type. /// /// The payment method type. - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Alipay for value: alipay /// - [EnumMember(Value = "alipay")] Alipay = 1, /// /// Enum Multibanco for value: multibanco /// - [EnumMember(Value = "multibanco")] Multibanco = 2, /// /// Enum BankTransferIBAN for value: bankTransfer_IBAN /// - [EnumMember(Value = "bankTransfer_IBAN")] BankTransferIBAN = 3, /// /// Enum Paybright for value: paybright /// - [EnumMember(Value = "paybright")] Paybright = 4, /// /// Enum Paynow for value: paynow /// - [EnumMember(Value = "paynow")] Paynow = 5, /// /// Enum AffirmPos for value: affirm_pos /// - [EnumMember(Value = "affirm_pos")] AffirmPos = 6, /// /// Enum Trustly for value: trustly /// - [EnumMember(Value = "trustly")] Trustly = 7, /// /// Enum Trustlyvector for value: trustlyvector /// - [EnumMember(Value = "trustlyvector")] Trustlyvector = 8, /// /// Enum Oney for value: oney /// - [EnumMember(Value = "oney")] Oney = 9, /// /// Enum Facilypay for value: facilypay /// - [EnumMember(Value = "facilypay")] Facilypay = 10, /// /// Enum Facilypay3x for value: facilypay_3x /// - [EnumMember(Value = "facilypay_3x")] Facilypay3x = 11, /// /// Enum Facilypay4x for value: facilypay_4x /// - [EnumMember(Value = "facilypay_4x")] Facilypay4x = 12, /// /// Enum Facilypay6x for value: facilypay_6x /// - [EnumMember(Value = "facilypay_6x")] Facilypay6x = 13, /// /// Enum Facilypay10x for value: facilypay_10x /// - [EnumMember(Value = "facilypay_10x")] Facilypay10x = 14, /// /// Enum Facilypay12x for value: facilypay_12x /// - [EnumMember(Value = "facilypay_12x")] Facilypay12x = 15, /// /// Enum Unionpay for value: unionpay /// - [EnumMember(Value = "unionpay")] Unionpay = 16, /// /// Enum KcpBanktransfer for value: kcp_banktransfer /// - [EnumMember(Value = "kcp_banktransfer")] KcpBanktransfer = 17, /// /// Enum KcpPayco for value: kcp_payco /// - [EnumMember(Value = "kcp_payco")] KcpPayco = 18, /// /// Enum KcpCreditcard for value: kcp_creditcard /// - [EnumMember(Value = "kcp_creditcard")] KcpCreditcard = 19, /// /// Enum WechatpaySDK for value: wechatpaySDK /// - [EnumMember(Value = "wechatpaySDK")] WechatpaySDK = 20, /// /// Enum WechatpayQR for value: wechatpayQR /// - [EnumMember(Value = "wechatpayQR")] WechatpayQR = 21, /// /// Enum WechatpayWeb for value: wechatpayWeb /// - [EnumMember(Value = "wechatpayWeb")] WechatpayWeb = 22, /// /// Enum MolpayBoost for value: molpay_boost /// - [EnumMember(Value = "molpay_boost")] MolpayBoost = 23, /// /// Enum WalletIN for value: wallet_IN /// - [EnumMember(Value = "wallet_IN")] WalletIN = 24, /// /// Enum PayuINCashcard for value: payu_IN_cashcard /// - [EnumMember(Value = "payu_IN_cashcard")] PayuINCashcard = 25, /// /// Enum PayuINNb for value: payu_IN_nb /// - [EnumMember(Value = "payu_IN_nb")] PayuINNb = 26, /// /// Enum UpiQr for value: upi_qr /// - [EnumMember(Value = "upi_qr")] UpiQr = 27, /// /// Enum Paytm for value: paytm /// - [EnumMember(Value = "paytm")] Paytm = 28, /// /// Enum MolpayEbankingVN for value: molpay_ebanking_VN /// - [EnumMember(Value = "molpay_ebanking_VN")] MolpayEbankingVN = 29, /// /// Enum MolpayEbankingMY for value: molpay_ebanking_MY /// - [EnumMember(Value = "molpay_ebanking_MY")] MolpayEbankingMY = 30, /// /// Enum MolpayEbankingDirectMY for value: molpay_ebanking_direct_MY /// - [EnumMember(Value = "molpay_ebanking_direct_MY")] MolpayEbankingDirectMY = 31, /// /// Enum Swish for value: swish /// - [EnumMember(Value = "swish")] Swish = 32, /// /// Enum Bizum for value: bizum /// - [EnumMember(Value = "bizum")] Bizum = 33, /// /// Enum Walley for value: walley /// - [EnumMember(Value = "walley")] Walley = 34, /// /// Enum WalleyB2b for value: walley_b2b /// - [EnumMember(Value = "walley_b2b")] WalleyB2b = 35, /// /// Enum Alma for value: alma /// - [EnumMember(Value = "alma")] Alma = 36, /// /// Enum Paypo for value: paypo /// - [EnumMember(Value = "paypo")] Paypo = 37, /// /// Enum Scalapay for value: scalapay /// - [EnumMember(Value = "scalapay")] Scalapay = 38, /// /// Enum Scalapay3x for value: scalapay_3x /// - [EnumMember(Value = "scalapay_3x")] Scalapay3x = 39, /// /// Enum Scalapay4x for value: scalapay_4x /// - [EnumMember(Value = "scalapay_4x")] Scalapay4x = 40, /// /// Enum MolpayFpx for value: molpay_fpx /// - [EnumMember(Value = "molpay_fpx")] MolpayFpx = 41, /// /// Enum Konbini for value: konbini /// - [EnumMember(Value = "konbini")] Konbini = 42, /// /// Enum DirectEbanking for value: directEbanking /// - [EnumMember(Value = "directEbanking")] DirectEbanking = 43, /// /// Enum Boletobancario for value: boletobancario /// - [EnumMember(Value = "boletobancario")] Boletobancario = 44, /// /// Enum Neteller for value: neteller /// - [EnumMember(Value = "neteller")] Neteller = 45, /// /// Enum Cashticket for value: cashticket /// - [EnumMember(Value = "cashticket")] Cashticket = 46, /// /// Enum Ikano for value: ikano /// - [EnumMember(Value = "ikano")] Ikano = 47, /// /// Enum Karenmillen for value: karenmillen /// - [EnumMember(Value = "karenmillen")] Karenmillen = 48, /// /// Enum Oasis for value: oasis /// - [EnumMember(Value = "oasis")] Oasis = 49, /// /// Enum Warehouse for value: warehouse /// - [EnumMember(Value = "warehouse")] Warehouse = 50, /// /// Enum PrimeiropayBoleto for value: primeiropay_boleto /// - [EnumMember(Value = "primeiropay_boleto")] PrimeiropayBoleto = 51, /// /// Enum Mada for value: mada /// - [EnumMember(Value = "mada")] Mada = 52, /// /// Enum Benefit for value: benefit /// - [EnumMember(Value = "benefit")] Benefit = 53, /// /// Enum Knet for value: knet /// - [EnumMember(Value = "knet")] Knet = 54, /// /// Enum Omannet for value: omannet /// - [EnumMember(Value = "omannet")] Omannet = 55, /// /// Enum GopayWallet for value: gopay_wallet /// - [EnumMember(Value = "gopay_wallet")] GopayWallet = 56, /// /// Enum KcpNaverpay for value: kcp_naverpay /// - [EnumMember(Value = "kcp_naverpay")] KcpNaverpay = 57, /// /// Enum OnlinebankingIN for value: onlinebanking_IN /// - [EnumMember(Value = "onlinebanking_IN")] OnlinebankingIN = 58, /// /// Enum Fawry for value: fawry /// - [EnumMember(Value = "fawry")] Fawry = 59, /// /// Enum Atome for value: atome /// - [EnumMember(Value = "atome")] Atome = 60, /// /// Enum Moneybookers for value: moneybookers /// - [EnumMember(Value = "moneybookers")] Moneybookers = 61, /// /// Enum Naps for value: naps /// - [EnumMember(Value = "naps")] Naps = 62, /// /// Enum Nordea for value: nordea /// - [EnumMember(Value = "nordea")] Nordea = 63, /// /// Enum BoletobancarioBradesco for value: boletobancario_bradesco /// - [EnumMember(Value = "boletobancario_bradesco")] BoletobancarioBradesco = 64, /// /// Enum BoletobancarioItau for value: boletobancario_itau /// - [EnumMember(Value = "boletobancario_itau")] BoletobancarioItau = 65, /// /// Enum BoletobancarioSantander for value: boletobancario_santander /// - [EnumMember(Value = "boletobancario_santander")] BoletobancarioSantander = 66, /// /// Enum BoletobancarioBancodobrasil for value: boletobancario_bancodobrasil /// - [EnumMember(Value = "boletobancario_bancodobrasil")] BoletobancarioBancodobrasil = 67, /// /// Enum BoletobancarioHsbc for value: boletobancario_hsbc /// - [EnumMember(Value = "boletobancario_hsbc")] BoletobancarioHsbc = 68, /// /// Enum MolpayMaybank2u for value: molpay_maybank2u /// - [EnumMember(Value = "molpay_maybank2u")] MolpayMaybank2u = 69, /// /// Enum MolpayCimb for value: molpay_cimb /// - [EnumMember(Value = "molpay_cimb")] MolpayCimb = 70, /// /// Enum MolpayRhb for value: molpay_rhb /// - [EnumMember(Value = "molpay_rhb")] MolpayRhb = 71, /// /// Enum MolpayAmb for value: molpay_amb /// - [EnumMember(Value = "molpay_amb")] MolpayAmb = 72, /// /// Enum MolpayHlb for value: molpay_hlb /// - [EnumMember(Value = "molpay_hlb")] MolpayHlb = 73, /// /// Enum MolpayAffinEpg for value: molpay_affin_epg /// - [EnumMember(Value = "molpay_affin_epg")] MolpayAffinEpg = 74, /// /// Enum MolpayBankislam for value: molpay_bankislam /// - [EnumMember(Value = "molpay_bankislam")] MolpayBankislam = 75, /// /// Enum MolpayPublicbank for value: molpay_publicbank /// - [EnumMember(Value = "molpay_publicbank")] MolpayPublicbank = 76, /// /// Enum FpxAgrobank for value: fpx_agrobank /// - [EnumMember(Value = "fpx_agrobank")] FpxAgrobank = 77, /// /// Enum Touchngo for value: touchngo /// - [EnumMember(Value = "touchngo")] Touchngo = 78, /// /// Enum Maybank2uMae for value: maybank2u_mae /// - [EnumMember(Value = "maybank2u_mae")] Maybank2uMae = 79, /// /// Enum Duitnow for value: duitnow /// - [EnumMember(Value = "duitnow")] Duitnow = 80, /// /// Enum Promptpay for value: promptpay /// - [EnumMember(Value = "promptpay")] Promptpay = 81, /// /// Enum TwintPos for value: twint_pos /// - [EnumMember(Value = "twint_pos")] TwintPos = 82, /// /// Enum AlipayHk for value: alipay_hk /// - [EnumMember(Value = "alipay_hk")] AlipayHk = 83, /// /// Enum AlipayHkWeb for value: alipay_hk_web /// - [EnumMember(Value = "alipay_hk_web")] AlipayHkWeb = 84, /// /// Enum AlipayHkWap for value: alipay_hk_wap /// - [EnumMember(Value = "alipay_hk_wap")] AlipayHkWap = 85, /// /// Enum AlipayWap for value: alipay_wap /// - [EnumMember(Value = "alipay_wap")] AlipayWap = 86, /// /// Enum Balanceplatform for value: balanceplatform /// - [EnumMember(Value = "balanceplatform")] Balanceplatform = 87 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("alipay")) + return TypeEnum.Alipay; + + if (value.Equals("multibanco")) + return TypeEnum.Multibanco; + + if (value.Equals("bankTransfer_IBAN")) + return TypeEnum.BankTransferIBAN; + + if (value.Equals("paybright")) + return TypeEnum.Paybright; + + if (value.Equals("paynow")) + return TypeEnum.Paynow; + + if (value.Equals("affirm_pos")) + return TypeEnum.AffirmPos; + + if (value.Equals("trustly")) + return TypeEnum.Trustly; + + if (value.Equals("trustlyvector")) + return TypeEnum.Trustlyvector; + + if (value.Equals("oney")) + return TypeEnum.Oney; + + if (value.Equals("facilypay")) + return TypeEnum.Facilypay; + + if (value.Equals("facilypay_3x")) + return TypeEnum.Facilypay3x; + + if (value.Equals("facilypay_4x")) + return TypeEnum.Facilypay4x; + + if (value.Equals("facilypay_6x")) + return TypeEnum.Facilypay6x; + + if (value.Equals("facilypay_10x")) + return TypeEnum.Facilypay10x; + + if (value.Equals("facilypay_12x")) + return TypeEnum.Facilypay12x; + + if (value.Equals("unionpay")) + return TypeEnum.Unionpay; + + if (value.Equals("kcp_banktransfer")) + return TypeEnum.KcpBanktransfer; + + if (value.Equals("kcp_payco")) + return TypeEnum.KcpPayco; + + if (value.Equals("kcp_creditcard")) + return TypeEnum.KcpCreditcard; + + if (value.Equals("wechatpaySDK")) + return TypeEnum.WechatpaySDK; + + if (value.Equals("wechatpayQR")) + return TypeEnum.WechatpayQR; + + if (value.Equals("wechatpayWeb")) + return TypeEnum.WechatpayWeb; + + if (value.Equals("molpay_boost")) + return TypeEnum.MolpayBoost; + + if (value.Equals("wallet_IN")) + return TypeEnum.WalletIN; + + if (value.Equals("payu_IN_cashcard")) + return TypeEnum.PayuINCashcard; + + if (value.Equals("payu_IN_nb")) + return TypeEnum.PayuINNb; + + if (value.Equals("upi_qr")) + return TypeEnum.UpiQr; + + if (value.Equals("paytm")) + return TypeEnum.Paytm; + + if (value.Equals("molpay_ebanking_VN")) + return TypeEnum.MolpayEbankingVN; + + if (value.Equals("molpay_ebanking_MY")) + return TypeEnum.MolpayEbankingMY; + + if (value.Equals("molpay_ebanking_direct_MY")) + return TypeEnum.MolpayEbankingDirectMY; + + if (value.Equals("swish")) + return TypeEnum.Swish; + + if (value.Equals("bizum")) + return TypeEnum.Bizum; + + if (value.Equals("walley")) + return TypeEnum.Walley; + + if (value.Equals("walley_b2b")) + return TypeEnum.WalleyB2b; + + if (value.Equals("alma")) + return TypeEnum.Alma; + + if (value.Equals("paypo")) + return TypeEnum.Paypo; + + if (value.Equals("scalapay")) + return TypeEnum.Scalapay; + + if (value.Equals("scalapay_3x")) + return TypeEnum.Scalapay3x; + + if (value.Equals("scalapay_4x")) + return TypeEnum.Scalapay4x; + + if (value.Equals("molpay_fpx")) + return TypeEnum.MolpayFpx; + + if (value.Equals("konbini")) + return TypeEnum.Konbini; + + if (value.Equals("directEbanking")) + return TypeEnum.DirectEbanking; + + if (value.Equals("boletobancario")) + return TypeEnum.Boletobancario; + + if (value.Equals("neteller")) + return TypeEnum.Neteller; + + if (value.Equals("cashticket")) + return TypeEnum.Cashticket; + + if (value.Equals("ikano")) + return TypeEnum.Ikano; + + if (value.Equals("karenmillen")) + return TypeEnum.Karenmillen; + + if (value.Equals("oasis")) + return TypeEnum.Oasis; + + if (value.Equals("warehouse")) + return TypeEnum.Warehouse; + + if (value.Equals("primeiropay_boleto")) + return TypeEnum.PrimeiropayBoleto; + + if (value.Equals("mada")) + return TypeEnum.Mada; + + if (value.Equals("benefit")) + return TypeEnum.Benefit; + + if (value.Equals("knet")) + return TypeEnum.Knet; + + if (value.Equals("omannet")) + return TypeEnum.Omannet; + + if (value.Equals("gopay_wallet")) + return TypeEnum.GopayWallet; + + if (value.Equals("kcp_naverpay")) + return TypeEnum.KcpNaverpay; + + if (value.Equals("onlinebanking_IN")) + return TypeEnum.OnlinebankingIN; + + if (value.Equals("fawry")) + return TypeEnum.Fawry; + + if (value.Equals("atome")) + return TypeEnum.Atome; + + if (value.Equals("moneybookers")) + return TypeEnum.Moneybookers; + + if (value.Equals("naps")) + return TypeEnum.Naps; + + if (value.Equals("nordea")) + return TypeEnum.Nordea; + + if (value.Equals("boletobancario_bradesco")) + return TypeEnum.BoletobancarioBradesco; + + if (value.Equals("boletobancario_itau")) + return TypeEnum.BoletobancarioItau; + + if (value.Equals("boletobancario_santander")) + return TypeEnum.BoletobancarioSantander; + + if (value.Equals("boletobancario_bancodobrasil")) + return TypeEnum.BoletobancarioBancodobrasil; + + if (value.Equals("boletobancario_hsbc")) + return TypeEnum.BoletobancarioHsbc; + + if (value.Equals("molpay_maybank2u")) + return TypeEnum.MolpayMaybank2u; + + if (value.Equals("molpay_cimb")) + return TypeEnum.MolpayCimb; + if (value.Equals("molpay_rhb")) + return TypeEnum.MolpayRhb; + + if (value.Equals("molpay_amb")) + return TypeEnum.MolpayAmb; + + if (value.Equals("molpay_hlb")) + return TypeEnum.MolpayHlb; + + if (value.Equals("molpay_affin_epg")) + return TypeEnum.MolpayAffinEpg; + + if (value.Equals("molpay_bankislam")) + return TypeEnum.MolpayBankislam; + + if (value.Equals("molpay_publicbank")) + return TypeEnum.MolpayPublicbank; + + if (value.Equals("fpx_agrobank")) + return TypeEnum.FpxAgrobank; + + if (value.Equals("touchngo")) + return TypeEnum.Touchngo; + + if (value.Equals("maybank2u_mae")) + return TypeEnum.Maybank2uMae; + + if (value.Equals("duitnow")) + return TypeEnum.Duitnow; + + if (value.Equals("promptpay")) + return TypeEnum.Promptpay; + + if (value.Equals("twint_pos")) + return TypeEnum.TwintPos; + + if (value.Equals("alipay_hk")) + return TypeEnum.AlipayHk; + + if (value.Equals("alipay_hk_web")) + return TypeEnum.AlipayHkWeb; + + if (value.Equals("alipay_hk_wap")) + return TypeEnum.AlipayHkWap; + + if (value.Equals("alipay_wap")) + return TypeEnum.AlipayWap; + + if (value.Equals("balanceplatform")) + return TypeEnum.Balanceplatform; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("alipay")) + return TypeEnum.Alipay; + + if (value.Equals("multibanco")) + return TypeEnum.Multibanco; + + if (value.Equals("bankTransfer_IBAN")) + return TypeEnum.BankTransferIBAN; + + if (value.Equals("paybright")) + return TypeEnum.Paybright; + + if (value.Equals("paynow")) + return TypeEnum.Paynow; + + if (value.Equals("affirm_pos")) + return TypeEnum.AffirmPos; + + if (value.Equals("trustly")) + return TypeEnum.Trustly; + + if (value.Equals("trustlyvector")) + return TypeEnum.Trustlyvector; + + if (value.Equals("oney")) + return TypeEnum.Oney; + + if (value.Equals("facilypay")) + return TypeEnum.Facilypay; + + if (value.Equals("facilypay_3x")) + return TypeEnum.Facilypay3x; + + if (value.Equals("facilypay_4x")) + return TypeEnum.Facilypay4x; + + if (value.Equals("facilypay_6x")) + return TypeEnum.Facilypay6x; + + if (value.Equals("facilypay_10x")) + return TypeEnum.Facilypay10x; + + if (value.Equals("facilypay_12x")) + return TypeEnum.Facilypay12x; + + if (value.Equals("unionpay")) + return TypeEnum.Unionpay; + + if (value.Equals("kcp_banktransfer")) + return TypeEnum.KcpBanktransfer; + + if (value.Equals("kcp_payco")) + return TypeEnum.KcpPayco; + + if (value.Equals("kcp_creditcard")) + return TypeEnum.KcpCreditcard; + + if (value.Equals("wechatpaySDK")) + return TypeEnum.WechatpaySDK; + + if (value.Equals("wechatpayQR")) + return TypeEnum.WechatpayQR; + + if (value.Equals("wechatpayWeb")) + return TypeEnum.WechatpayWeb; + + if (value.Equals("molpay_boost")) + return TypeEnum.MolpayBoost; + + if (value.Equals("wallet_IN")) + return TypeEnum.WalletIN; + + if (value.Equals("payu_IN_cashcard")) + return TypeEnum.PayuINCashcard; + + if (value.Equals("payu_IN_nb")) + return TypeEnum.PayuINNb; + + if (value.Equals("upi_qr")) + return TypeEnum.UpiQr; + + if (value.Equals("paytm")) + return TypeEnum.Paytm; + + if (value.Equals("molpay_ebanking_VN")) + return TypeEnum.MolpayEbankingVN; + + if (value.Equals("molpay_ebanking_MY")) + return TypeEnum.MolpayEbankingMY; + + if (value.Equals("molpay_ebanking_direct_MY")) + return TypeEnum.MolpayEbankingDirectMY; + + if (value.Equals("swish")) + return TypeEnum.Swish; + + if (value.Equals("bizum")) + return TypeEnum.Bizum; + + if (value.Equals("walley")) + return TypeEnum.Walley; + + if (value.Equals("walley_b2b")) + return TypeEnum.WalleyB2b; + + if (value.Equals("alma")) + return TypeEnum.Alma; + + if (value.Equals("paypo")) + return TypeEnum.Paypo; + + if (value.Equals("scalapay")) + return TypeEnum.Scalapay; + + if (value.Equals("scalapay_3x")) + return TypeEnum.Scalapay3x; + + if (value.Equals("scalapay_4x")) + return TypeEnum.Scalapay4x; + + if (value.Equals("molpay_fpx")) + return TypeEnum.MolpayFpx; + + if (value.Equals("konbini")) + return TypeEnum.Konbini; + + if (value.Equals("directEbanking")) + return TypeEnum.DirectEbanking; + + if (value.Equals("boletobancario")) + return TypeEnum.Boletobancario; + + if (value.Equals("neteller")) + return TypeEnum.Neteller; + + if (value.Equals("cashticket")) + return TypeEnum.Cashticket; + + if (value.Equals("ikano")) + return TypeEnum.Ikano; + + if (value.Equals("karenmillen")) + return TypeEnum.Karenmillen; + + if (value.Equals("oasis")) + return TypeEnum.Oasis; + + if (value.Equals("warehouse")) + return TypeEnum.Warehouse; + + if (value.Equals("primeiropay_boleto")) + return TypeEnum.PrimeiropayBoleto; + + if (value.Equals("mada")) + return TypeEnum.Mada; + + if (value.Equals("benefit")) + return TypeEnum.Benefit; + + if (value.Equals("knet")) + return TypeEnum.Knet; + + if (value.Equals("omannet")) + return TypeEnum.Omannet; + + if (value.Equals("gopay_wallet")) + return TypeEnum.GopayWallet; + + if (value.Equals("kcp_naverpay")) + return TypeEnum.KcpNaverpay; + + if (value.Equals("onlinebanking_IN")) + return TypeEnum.OnlinebankingIN; + + if (value.Equals("fawry")) + return TypeEnum.Fawry; + + if (value.Equals("atome")) + return TypeEnum.Atome; + + if (value.Equals("moneybookers")) + return TypeEnum.Moneybookers; + + if (value.Equals("naps")) + return TypeEnum.Naps; + + if (value.Equals("nordea")) + return TypeEnum.Nordea; + + if (value.Equals("boletobancario_bradesco")) + return TypeEnum.BoletobancarioBradesco; + + if (value.Equals("boletobancario_itau")) + return TypeEnum.BoletobancarioItau; + + if (value.Equals("boletobancario_santander")) + return TypeEnum.BoletobancarioSantander; + + if (value.Equals("boletobancario_bancodobrasil")) + return TypeEnum.BoletobancarioBancodobrasil; + + if (value.Equals("boletobancario_hsbc")) + return TypeEnum.BoletobancarioHsbc; + + if (value.Equals("molpay_maybank2u")) + return TypeEnum.MolpayMaybank2u; + + if (value.Equals("molpay_cimb")) + return TypeEnum.MolpayCimb; + + if (value.Equals("molpay_rhb")) + return TypeEnum.MolpayRhb; + + if (value.Equals("molpay_amb")) + return TypeEnum.MolpayAmb; + + if (value.Equals("molpay_hlb")) + return TypeEnum.MolpayHlb; + + if (value.Equals("molpay_affin_epg")) + return TypeEnum.MolpayAffinEpg; + + if (value.Equals("molpay_bankislam")) + return TypeEnum.MolpayBankislam; + + if (value.Equals("molpay_publicbank")) + return TypeEnum.MolpayPublicbank; + + if (value.Equals("fpx_agrobank")) + return TypeEnum.FpxAgrobank; + + if (value.Equals("touchngo")) + return TypeEnum.Touchngo; + + if (value.Equals("maybank2u_mae")) + return TypeEnum.Maybank2uMae; + + if (value.Equals("duitnow")) + return TypeEnum.Duitnow; + + if (value.Equals("promptpay")) + return TypeEnum.Promptpay; + + if (value.Equals("twint_pos")) + return TypeEnum.TwintPos; + + if (value.Equals("alipay_hk")) + return TypeEnum.AlipayHk; + + if (value.Equals("alipay_hk_web")) + return TypeEnum.AlipayHkWeb; + + if (value.Equals("alipay_hk_wap")) + return TypeEnum.AlipayHkWap; + + if (value.Equals("alipay_wap")) + return TypeEnum.AlipayWap; + + if (value.Equals("balanceplatform")) + return TypeEnum.Balanceplatform; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Alipay) + return "alipay"; + + if (value == TypeEnum.Multibanco) + return "multibanco"; + + if (value == TypeEnum.BankTransferIBAN) + return "bankTransfer_IBAN"; + + if (value == TypeEnum.Paybright) + return "paybright"; + + if (value == TypeEnum.Paynow) + return "paynow"; + + if (value == TypeEnum.AffirmPos) + return "affirm_pos"; + + if (value == TypeEnum.Trustly) + return "trustly"; + + if (value == TypeEnum.Trustlyvector) + return "trustlyvector"; + + if (value == TypeEnum.Oney) + return "oney"; + + if (value == TypeEnum.Facilypay) + return "facilypay"; + + if (value == TypeEnum.Facilypay3x) + return "facilypay_3x"; + + if (value == TypeEnum.Facilypay4x) + return "facilypay_4x"; + + if (value == TypeEnum.Facilypay6x) + return "facilypay_6x"; + + if (value == TypeEnum.Facilypay10x) + return "facilypay_10x"; + + if (value == TypeEnum.Facilypay12x) + return "facilypay_12x"; + + if (value == TypeEnum.Unionpay) + return "unionpay"; + + if (value == TypeEnum.KcpBanktransfer) + return "kcp_banktransfer"; + + if (value == TypeEnum.KcpPayco) + return "kcp_payco"; + + if (value == TypeEnum.KcpCreditcard) + return "kcp_creditcard"; + + if (value == TypeEnum.WechatpaySDK) + return "wechatpaySDK"; + + if (value == TypeEnum.WechatpayQR) + return "wechatpayQR"; + + if (value == TypeEnum.WechatpayWeb) + return "wechatpayWeb"; + + if (value == TypeEnum.MolpayBoost) + return "molpay_boost"; + + if (value == TypeEnum.WalletIN) + return "wallet_IN"; + + if (value == TypeEnum.PayuINCashcard) + return "payu_IN_cashcard"; + + if (value == TypeEnum.PayuINNb) + return "payu_IN_nb"; + + if (value == TypeEnum.UpiQr) + return "upi_qr"; + + if (value == TypeEnum.Paytm) + return "paytm"; + + if (value == TypeEnum.MolpayEbankingVN) + return "molpay_ebanking_VN"; + + if (value == TypeEnum.MolpayEbankingMY) + return "molpay_ebanking_MY"; + + if (value == TypeEnum.MolpayEbankingDirectMY) + return "molpay_ebanking_direct_MY"; + + if (value == TypeEnum.Swish) + return "swish"; + + if (value == TypeEnum.Bizum) + return "bizum"; + + if (value == TypeEnum.Walley) + return "walley"; + + if (value == TypeEnum.WalleyB2b) + return "walley_b2b"; + + if (value == TypeEnum.Alma) + return "alma"; + + if (value == TypeEnum.Paypo) + return "paypo"; + + if (value == TypeEnum.Scalapay) + return "scalapay"; + + if (value == TypeEnum.Scalapay3x) + return "scalapay_3x"; + + if (value == TypeEnum.Scalapay4x) + return "scalapay_4x"; + + if (value == TypeEnum.MolpayFpx) + return "molpay_fpx"; + + if (value == TypeEnum.Konbini) + return "konbini"; + + if (value == TypeEnum.DirectEbanking) + return "directEbanking"; + + if (value == TypeEnum.Boletobancario) + return "boletobancario"; + + if (value == TypeEnum.Neteller) + return "neteller"; + + if (value == TypeEnum.Cashticket) + return "cashticket"; + + if (value == TypeEnum.Ikano) + return "ikano"; + + if (value == TypeEnum.Karenmillen) + return "karenmillen"; + + if (value == TypeEnum.Oasis) + return "oasis"; + + if (value == TypeEnum.Warehouse) + return "warehouse"; + + if (value == TypeEnum.PrimeiropayBoleto) + return "primeiropay_boleto"; + + if (value == TypeEnum.Mada) + return "mada"; + + if (value == TypeEnum.Benefit) + return "benefit"; + + if (value == TypeEnum.Knet) + return "knet"; + + if (value == TypeEnum.Omannet) + return "omannet"; + + if (value == TypeEnum.GopayWallet) + return "gopay_wallet"; + + if (value == TypeEnum.KcpNaverpay) + return "kcp_naverpay"; + + if (value == TypeEnum.OnlinebankingIN) + return "onlinebanking_IN"; + + if (value == TypeEnum.Fawry) + return "fawry"; + + if (value == TypeEnum.Atome) + return "atome"; + + if (value == TypeEnum.Moneybookers) + return "moneybookers"; + + if (value == TypeEnum.Naps) + return "naps"; + + if (value == TypeEnum.Nordea) + return "nordea"; + + if (value == TypeEnum.BoletobancarioBradesco) + return "boletobancario_bradesco"; + + if (value == TypeEnum.BoletobancarioItau) + return "boletobancario_itau"; + + if (value == TypeEnum.BoletobancarioSantander) + return "boletobancario_santander"; + + if (value == TypeEnum.BoletobancarioBancodobrasil) + return "boletobancario_bancodobrasil"; + + if (value == TypeEnum.BoletobancarioHsbc) + return "boletobancario_hsbc"; + + if (value == TypeEnum.MolpayMaybank2u) + return "molpay_maybank2u"; + + if (value == TypeEnum.MolpayCimb) + return "molpay_cimb"; + + if (value == TypeEnum.MolpayRhb) + return "molpay_rhb"; + + if (value == TypeEnum.MolpayAmb) + return "molpay_amb"; + + if (value == TypeEnum.MolpayHlb) + return "molpay_hlb"; + + if (value == TypeEnum.MolpayAffinEpg) + return "molpay_affin_epg"; + + if (value == TypeEnum.MolpayBankislam) + return "molpay_bankislam"; + + if (value == TypeEnum.MolpayPublicbank) + return "molpay_publicbank"; + + if (value == TypeEnum.FpxAgrobank) + return "fpx_agrobank"; + + if (value == TypeEnum.Touchngo) + return "touchngo"; + + if (value == TypeEnum.Maybank2uMae) + return "maybank2u_mae"; + + if (value == TypeEnum.Duitnow) + return "duitnow"; + + if (value == TypeEnum.Promptpay) + return "promptpay"; + + if (value == TypeEnum.TwintPos) + return "twint_pos"; + + if (value == TypeEnum.AlipayHk) + return "alipay_hk"; + + if (value == TypeEnum.AlipayHkWeb) + return "alipay_hk_web"; + + if (value == TypeEnum.AlipayHkWap) + return "alipay_hk_wap"; + + if (value == TypeEnum.AlipayWap) + return "alipay_wap"; + + if (value == TypeEnum.Balanceplatform) + return "balanceplatform"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The payment method type. /// /// The payment method type. - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The payment method type.. - public PaymentDetails(string checkoutAttemptId = default(string), TypeEnum? type = default(TypeEnum?)) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -603,73 +1343,111 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentDetails instances are equal - /// - /// Instance of PaymentDetails to be compared - /// Boolean - public bool Equals(PaymentDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(PaymentDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PaymentDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PaymentDetails."); + + return new PaymentDetails(checkoutAttemptId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentDetails paymentDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentDetails paymentDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentDetails.CheckoutAttemptIdOption.IsSet && paymentDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(paymentDetails.CheckoutAttemptId), "Property is required for class PaymentDetails."); + + if (paymentDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", paymentDetails.CheckoutAttemptId); + + var typeRawValue = PaymentDetails.TypeEnumToJsonValue(paymentDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/PaymentDetailsRequest.cs b/Adyen/Model/Checkout/PaymentDetailsRequest.cs index 0761390a4..a19378c84 100644 --- a/Adyen/Model/Checkout/PaymentDetailsRequest.cs +++ b/Adyen/Model/Checkout/PaymentDetailsRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,69 +14,86 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentDetailsRequest /// - [DataContract(Name = "PaymentDetailsRequest")] - public partial class PaymentDetailsRequest : IEquatable, IValidatableObject + public partial class PaymentDetailsRequest : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected PaymentDetailsRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// authenticationData. - /// details (required). - /// Encoded payment data. For [authorizing a payment after using 3D Secure 2 Authentication-only](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only/#authorise-the-payment-with-adyen): If you received `resultCode`: **AuthenticationNotRequired** in the `/payments` response, use the `threeDSPaymentData` from the same response. If you received `resultCode`: **AuthenticationFinished** in the `/payments` response, use the `action.paymentData` from the same response.. - /// Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously.. - public PaymentDetailsRequest(DetailsRequestAuthenticationData authenticationData = default(DetailsRequestAuthenticationData), PaymentCompletionDetails details = default(PaymentCompletionDetails), string paymentData = default(string), bool? threeDSAuthenticationOnly = default(bool?)) + /// details + /// authenticationData + /// Encoded payment data. For [authorizing a payment after using 3D Secure 2 Authentication-only](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only/#authorise-the-payment-with-adyen): If you received `resultCode`: **AuthenticationNotRequired** in the `/payments` response, use the `threeDSPaymentData` from the same response. If you received `resultCode`: **AuthenticationFinished** in the `/payments` response, use the `action.paymentData` from the same response. + /// Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously. + [JsonConstructor] + public PaymentDetailsRequest(PaymentCompletionDetails details, Option authenticationData = default, Option paymentData = default, Option threeDSAuthenticationOnly = default) { - this.Details = details; - this.AuthenticationData = authenticationData; - this.PaymentData = paymentData; - this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; + Details = details; + AuthenticationDataOption = authenticationData; + PaymentDataOption = paymentData; + ThreeDSAuthenticationOnlyOption = threeDSAuthenticationOnly; + OnCreated(); } + partial void OnCreated(); + + /// + /// Gets or Sets Details + /// + [JsonPropertyName("details")] + public PaymentCompletionDetails Details { get; set; } + + /// + /// Used to track the state of AuthenticationData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthenticationDataOption { get; private set; } + /// /// Gets or Sets AuthenticationData /// - [DataMember(Name = "authenticationData", EmitDefaultValue = false)] - public DetailsRequestAuthenticationData AuthenticationData { get; set; } + [JsonPropertyName("authenticationData")] + public DetailsRequestAuthenticationData AuthenticationData { get { return this.AuthenticationDataOption; } set { this.AuthenticationDataOption = new Option(value); } } /// - /// Gets or Sets Details + /// Used to track the state of PaymentData /// - [DataMember(Name = "details", IsRequired = false, EmitDefaultValue = false)] - public PaymentCompletionDetails Details { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentDataOption { get; private set; } /// /// Encoded payment data. For [authorizing a payment after using 3D Secure 2 Authentication-only](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only/#authorise-the-payment-with-adyen): If you received `resultCode`: **AuthenticationNotRequired** in the `/payments` response, use the `threeDSPaymentData` from the same response. If you received `resultCode`: **AuthenticationFinished** in the `/payments` response, use the `action.paymentData` from the same response. /// /// Encoded payment data. For [authorizing a payment after using 3D Secure 2 Authentication-only](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only/#authorise-the-payment-with-adyen): If you received `resultCode`: **AuthenticationNotRequired** in the `/payments` response, use the `threeDSPaymentData` from the same response. If you received `resultCode`: **AuthenticationFinished** in the `/payments` response, use the `action.paymentData` from the same response. - [DataMember(Name = "paymentData", EmitDefaultValue = false)] - public string PaymentData { get; set; } + [JsonPropertyName("paymentData")] + public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSAuthenticationOnly + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSAuthenticationOnlyOption { get; private set; } /// /// Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously. /// /// Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously. - [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.authenticationOnly` instead.")] - public bool? ThreeDSAuthenticationOnly { get; set; } + [JsonPropertyName("threeDSAuthenticationOnly")] + [Obsolete] + public bool? ThreeDSAuthenticationOnly { get { return this.ThreeDSAuthenticationOnlyOption; } set { this.ThreeDSAuthenticationOnlyOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -87,8 +103,8 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentDetailsRequest {\n"); - sb.Append(" AuthenticationData: ").Append(AuthenticationData).Append("\n"); sb.Append(" Details: ").Append(Details).Append("\n"); + sb.Append(" AuthenticationData: ").Append(AuthenticationData).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); sb.Append(" ThreeDSAuthenticationOnly: ").Append(ThreeDSAuthenticationOnly).Append("\n"); sb.Append("}\n"); @@ -96,97 +112,148 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // PaymentData (string) maxLength + if (this.PaymentData != null && this.PaymentData.Length > 200000) + { + yield return new ValidationResult("Invalid value for PaymentData, length must be less than 200000.", new [] { "PaymentData" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PaymentDetailsRequest); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentDetailsRequestJsonConverter : JsonConverter + { /// - /// Returns true if PaymentDetailsRequest instances are equal + /// Deserializes json to /// - /// Instance of PaymentDetailsRequest to be compared - /// Boolean - public bool Equals(PaymentDetailsRequest input) + /// + /// + /// + /// + /// + public override PaymentDetailsRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option details = default; + Option authenticationData = default; + Option paymentData = default; + Option threeDSAuthenticationOnly = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "details": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + details = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "authenticationData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + authenticationData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "paymentData": + paymentData = new Option(utf8JsonReader.GetString()); + break; + case "threeDSAuthenticationOnly": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDSAuthenticationOnly = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } } - return - ( - this.AuthenticationData == input.AuthenticationData || - (this.AuthenticationData != null && - this.AuthenticationData.Equals(input.AuthenticationData)) - ) && - ( - this.Details == input.Details || - (this.Details != null && - this.Details.Equals(input.Details)) - ) && - ( - this.PaymentData == input.PaymentData || - (this.PaymentData != null && - this.PaymentData.Equals(input.PaymentData)) - ) && - ( - this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || - this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) - ); + + if (!details.IsSet) + throw new ArgumentException("Property is required for class PaymentDetailsRequest.", nameof(details)); + + if (details.IsSet && details.Value == null) + throw new ArgumentNullException(nameof(details), "Property is not nullable for class PaymentDetailsRequest."); + + if (authenticationData.IsSet && authenticationData.Value == null) + throw new ArgumentNullException(nameof(authenticationData), "Property is not nullable for class PaymentDetailsRequest."); + + if (paymentData.IsSet && paymentData.Value == null) + throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class PaymentDetailsRequest."); + + if (threeDSAuthenticationOnly.IsSet && threeDSAuthenticationOnly.Value == null) + throw new ArgumentNullException(nameof(threeDSAuthenticationOnly), "Property is not nullable for class PaymentDetailsRequest."); + + return new PaymentDetailsRequest(details.Value, authenticationData, paymentData, threeDSAuthenticationOnly); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentDetailsRequest paymentDetailsRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AuthenticationData != null) - { - hashCode = (hashCode * 59) + this.AuthenticationData.GetHashCode(); - } - if (this.Details != null) - { - hashCode = (hashCode * 59) + this.Details.GetHashCode(); - } - if (this.PaymentData != null) - { - hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ThreeDSAuthenticationOnly.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentDetailsRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentDetailsRequest paymentDetailsRequest, JsonSerializerOptions jsonSerializerOptions) { - // PaymentData (string) maxLength - if (this.PaymentData != null && this.PaymentData.Length > 200000) + if (paymentDetailsRequest.Details == null) + throw new ArgumentNullException(nameof(paymentDetailsRequest.Details), "Property is required for class PaymentDetailsRequest."); + + if (paymentDetailsRequest.AuthenticationDataOption.IsSet && paymentDetailsRequest.AuthenticationData == null) + throw new ArgumentNullException(nameof(paymentDetailsRequest.AuthenticationData), "Property is required for class PaymentDetailsRequest."); + + if (paymentDetailsRequest.PaymentDataOption.IsSet && paymentDetailsRequest.PaymentData == null) + throw new ArgumentNullException(nameof(paymentDetailsRequest.PaymentData), "Property is required for class PaymentDetailsRequest."); + + writer.WritePropertyName("details"); + JsonSerializer.Serialize(writer, paymentDetailsRequest.Details, jsonSerializerOptions); + if (paymentDetailsRequest.AuthenticationDataOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PaymentData, length must be less than 200000.", new [] { "PaymentData" }); + writer.WritePropertyName("authenticationData"); + JsonSerializer.Serialize(writer, paymentDetailsRequest.AuthenticationData, jsonSerializerOptions); } + if (paymentDetailsRequest.PaymentDataOption.IsSet) + writer.WriteString("paymentData", paymentDetailsRequest.PaymentData); - yield break; + if (paymentDetailsRequest.ThreeDSAuthenticationOnlyOption.IsSet) + writer.WriteBoolean("threeDSAuthenticationOnly", paymentDetailsRequest.ThreeDSAuthenticationOnlyOption.Value.Value); } } - } diff --git a/Adyen/Model/Checkout/PaymentDetailsResponse.cs b/Adyen/Model/Checkout/PaymentDetailsResponse.cs index 857e1cd3b..ebf4e9a06 100644 --- a/Adyen/Model/Checkout/PaymentDetailsResponse.cs +++ b/Adyen/Model/Checkout/PaymentDetailsResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,251 +14,499 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentDetailsResponse /// - [DataContract(Name = "PaymentDetailsResponse")] - public partial class PaymentDetailsResponse : IEquatable, IValidatableObject + public partial class PaymentDetailsResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + /// amount + /// Donation Token containing payment details for Adyen Giving. + /// fraudResult + /// The reference used during the /payments request. + /// order + /// paymentMethod + /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + /// The shopperLocale. + /// threeDS2ResponseData + /// threeDS2Result + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. + [JsonConstructor] + public PaymentDetailsResponse(Option> additionalData = default, Option amount = default, Option donationToken = default, Option fraudResult = default, Option merchantReference = default, Option order = default, Option paymentMethod = default, Option pspReference = default, Option refusalReason = default, Option refusalReasonCode = default, Option resultCode = default, Option shopperLocale = default, Option threeDS2ResponseData = default, Option threeDS2Result = default, Option threeDSPaymentData = default) + { + AdditionalDataOption = additionalData; + AmountOption = amount; + DonationTokenOption = donationToken; + FraudResultOption = fraudResult; + MerchantReferenceOption = merchantReference; + OrderOption = order; + PaymentMethodOption = paymentMethod; + PspReferenceOption = pspReference; + RefusalReasonOption = refusalReason; + RefusalReasonCodeOption = refusalReasonCode; + ResultCodeOption = resultCode; + ShopperLocaleOption = shopperLocale; + ThreeDS2ResponseDataOption = threeDS2ResponseData; + ThreeDS2ResultOption = threeDS2Result; + ThreeDSPaymentDataOption = threeDSPaymentData; + OnCreated(); + } + + partial void OnCreated(); + /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - [JsonConverter(typeof(StringEnumConverter))] public enum ResultCodeEnum { /// /// Enum AuthenticationFinished for value: AuthenticationFinished /// - [EnumMember(Value = "AuthenticationFinished")] AuthenticationFinished = 1, /// /// Enum AuthenticationNotRequired for value: AuthenticationNotRequired /// - [EnumMember(Value = "AuthenticationNotRequired")] AuthenticationNotRequired = 2, /// /// Enum Authorised for value: Authorised /// - [EnumMember(Value = "Authorised")] Authorised = 3, /// /// Enum Cancelled for value: Cancelled /// - [EnumMember(Value = "Cancelled")] Cancelled = 4, /// /// Enum ChallengeShopper for value: ChallengeShopper /// - [EnumMember(Value = "ChallengeShopper")] ChallengeShopper = 5, /// /// Enum Error for value: Error /// - [EnumMember(Value = "Error")] Error = 6, /// /// Enum IdentifyShopper for value: IdentifyShopper /// - [EnumMember(Value = "IdentifyShopper")] IdentifyShopper = 7, /// /// Enum PartiallyAuthorised for value: PartiallyAuthorised /// - [EnumMember(Value = "PartiallyAuthorised")] PartiallyAuthorised = 8, /// /// Enum Pending for value: Pending /// - [EnumMember(Value = "Pending")] Pending = 9, /// /// Enum PresentToShopper for value: PresentToShopper /// - [EnumMember(Value = "PresentToShopper")] PresentToShopper = 10, /// /// Enum Received for value: Received /// - [EnumMember(Value = "Received")] Received = 11, /// /// Enum RedirectShopper for value: RedirectShopper /// - [EnumMember(Value = "RedirectShopper")] RedirectShopper = 12, /// /// Enum Refused for value: Refused /// - [EnumMember(Value = "Refused")] Refused = 13, /// /// Enum Success for value: Success /// - [EnumMember(Value = "Success")] Success = 14 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ResultCodeEnum ResultCodeEnumFromString(string value) + { + if (value.Equals("AuthenticationFinished")) + return ResultCodeEnum.AuthenticationFinished; + + if (value.Equals("AuthenticationNotRequired")) + return ResultCodeEnum.AuthenticationNotRequired; + + if (value.Equals("Authorised")) + return ResultCodeEnum.Authorised; + if (value.Equals("Cancelled")) + return ResultCodeEnum.Cancelled; + + if (value.Equals("ChallengeShopper")) + return ResultCodeEnum.ChallengeShopper; + + if (value.Equals("Error")) + return ResultCodeEnum.Error; + + if (value.Equals("IdentifyShopper")) + return ResultCodeEnum.IdentifyShopper; + + if (value.Equals("PartiallyAuthorised")) + return ResultCodeEnum.PartiallyAuthorised; + + if (value.Equals("Pending")) + return ResultCodeEnum.Pending; + + if (value.Equals("PresentToShopper")) + return ResultCodeEnum.PresentToShopper; + + if (value.Equals("Received")) + return ResultCodeEnum.Received; + + if (value.Equals("RedirectShopper")) + return ResultCodeEnum.RedirectShopper; + + if (value.Equals("Refused")) + return ResultCodeEnum.Refused; + + if (value.Equals("Success")) + return ResultCodeEnum.Success; + + throw new NotImplementedException($"Could not convert value to type ResultCodeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static ResultCodeEnum? ResultCodeEnumFromStringOrDefault(string value) + { + if (value.Equals("AuthenticationFinished")) + return ResultCodeEnum.AuthenticationFinished; + + if (value.Equals("AuthenticationNotRequired")) + return ResultCodeEnum.AuthenticationNotRequired; + + if (value.Equals("Authorised")) + return ResultCodeEnum.Authorised; + + if (value.Equals("Cancelled")) + return ResultCodeEnum.Cancelled; + + if (value.Equals("ChallengeShopper")) + return ResultCodeEnum.ChallengeShopper; + + if (value.Equals("Error")) + return ResultCodeEnum.Error; + + if (value.Equals("IdentifyShopper")) + return ResultCodeEnum.IdentifyShopper; + + if (value.Equals("PartiallyAuthorised")) + return ResultCodeEnum.PartiallyAuthorised; + + if (value.Equals("Pending")) + return ResultCodeEnum.Pending; + + if (value.Equals("PresentToShopper")) + return ResultCodeEnum.PresentToShopper; + + if (value.Equals("Received")) + return ResultCodeEnum.Received; + + if (value.Equals("RedirectShopper")) + return ResultCodeEnum.RedirectShopper; + + if (value.Equals("Refused")) + return ResultCodeEnum.Refused; + + if (value.Equals("Success")) + return ResultCodeEnum.Success; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ResultCodeEnumToJsonValue(ResultCodeEnum? value) + { + if (value == ResultCodeEnum.AuthenticationFinished) + return "AuthenticationFinished"; + + if (value == ResultCodeEnum.AuthenticationNotRequired) + return "AuthenticationNotRequired"; + + if (value == ResultCodeEnum.Authorised) + return "Authorised"; + + if (value == ResultCodeEnum.Cancelled) + return "Cancelled"; + + if (value == ResultCodeEnum.ChallengeShopper) + return "ChallengeShopper"; + + if (value == ResultCodeEnum.Error) + return "Error"; + + if (value == ResultCodeEnum.IdentifyShopper) + return "IdentifyShopper"; + + if (value == ResultCodeEnum.PartiallyAuthorised) + return "PartiallyAuthorised"; + + if (value == ResultCodeEnum.Pending) + return "Pending"; + + if (value == ResultCodeEnum.PresentToShopper) + return "PresentToShopper"; + + if (value == ResultCodeEnum.Received) + return "Received"; + + if (value == ResultCodeEnum.RedirectShopper) + return "RedirectShopper"; + + if (value == ResultCodeEnum.Refused) + return "Refused"; + + if (value == ResultCodeEnum.Success) + return "Success"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ResultCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ResultCodeOption { get; private set; } /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - [DataMember(Name = "resultCode", EmitDefaultValue = false)] - public ResultCodeEnum? ResultCode { get; set; } + [JsonPropertyName("resultCode")] + public ResultCodeEnum? ResultCode { get { return this.ResultCodeOption; } set { this.ResultCodeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of AdditionalData /// - /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**.. - /// amount. - /// Donation Token containing payment details for Adyen Giving.. - /// fraudResult. - /// The reference used during the /payments request.. - /// order. - /// paymentMethod. - /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request.. - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. - /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. - /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state.. - /// The shopperLocale.. - /// threeDS2ResponseData. - /// threeDS2Result. - /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`.. - public PaymentDetailsResponse(Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), string donationToken = default(string), FraudResult fraudResult = default(FraudResult), string merchantReference = default(string), CheckoutOrderResponse order = default(CheckoutOrderResponse), ResponsePaymentMethod paymentMethod = default(ResponsePaymentMethod), string pspReference = default(string), string refusalReason = default(string), string refusalReasonCode = default(string), ResultCodeEnum? resultCode = default(ResultCodeEnum?), string shopperLocale = default(string), ThreeDS2ResponseData threeDS2ResponseData = default(ThreeDS2ResponseData), ThreeDS2Result threeDS2Result = default(ThreeDS2Result), string threeDSPaymentData = default(string)) - { - this.AdditionalData = additionalData; - this.Amount = amount; - this.DonationToken = donationToken; - this.FraudResult = fraudResult; - this.MerchantReference = merchantReference; - this.Order = order; - this.PaymentMethod = paymentMethod; - this.PspReference = pspReference; - this.RefusalReason = refusalReason; - this.RefusalReasonCode = refusalReasonCode; - this.ResultCode = resultCode; - this.ShopperLocale = shopperLocale; - this.ThreeDS2ResponseData = threeDS2ResponseData; - this.ThreeDS2Result = threeDS2Result; - this.ThreeDSPaymentData = threeDSPaymentData; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AdditionalDataOption { get; private set; } /// /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. /// /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - [DataMember(Name = "additionalData", EmitDefaultValue = false)] - public Dictionary AdditionalData { get; set; } + [JsonPropertyName("additionalData")] + public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } + + /// + /// Used to track the state of Amount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountOption { get; private set; } /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonPropertyName("amount")] + public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } + + /// + /// Used to track the state of DonationToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DonationTokenOption { get; private set; } /// /// Donation Token containing payment details for Adyen Giving. /// /// Donation Token containing payment details for Adyen Giving. - [DataMember(Name = "donationToken", EmitDefaultValue = false)] - public string DonationToken { get; set; } + [JsonPropertyName("donationToken")] + public string DonationToken { get { return this.DonationTokenOption; } set { this.DonationTokenOption = new Option(value); } } + + /// + /// Used to track the state of FraudResult + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FraudResultOption { get; private set; } /// /// Gets or Sets FraudResult /// - [DataMember(Name = "fraudResult", EmitDefaultValue = false)] - public FraudResult FraudResult { get; set; } + [JsonPropertyName("fraudResult")] + public FraudResult FraudResult { get { return this.FraudResultOption; } set { this.FraudResultOption = new Option(value); } } + + /// + /// Used to track the state of MerchantReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantReferenceOption { get; private set; } /// /// The reference used during the /payments request. /// /// The reference used during the /payments request. - [DataMember(Name = "merchantReference", EmitDefaultValue = false)] - public string MerchantReference { get; set; } + [JsonPropertyName("merchantReference")] + public string MerchantReference { get { return this.MerchantReferenceOption; } set { this.MerchantReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Order + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OrderOption { get; private set; } /// /// Gets or Sets Order /// - [DataMember(Name = "order", EmitDefaultValue = false)] - public CheckoutOrderResponse Order { get; set; } + [JsonPropertyName("order")] + public CheckoutOrderResponse Order { get { return this.OrderOption; } set { this.OrderOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodOption { get; private set; } /// /// Gets or Sets PaymentMethod /// - [DataMember(Name = "paymentMethod", EmitDefaultValue = false)] - public ResponsePaymentMethod PaymentMethod { get; set; } + [JsonPropertyName("paymentMethod")] + public ResponsePaymentMethod PaymentMethod { get { return this.PaymentMethodOption; } set { this.PaymentMethodOption = new Option(value); } } + + /// + /// Used to track the state of PspReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PspReferenceOption { get; private set; } /// /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. /// /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - [DataMember(Name = "pspReference", EmitDefaultValue = false)] - public string PspReference { get; set; } + [JsonPropertyName("pspReference")] + public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } + + /// + /// Used to track the state of RefusalReason + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RefusalReasonOption { get; private set; } /// /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). /// /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [DataMember(Name = "refusalReason", EmitDefaultValue = false)] - public string RefusalReason { get; set; } + [JsonPropertyName("refusalReason")] + public string RefusalReason { get { return this.RefusalReasonOption; } set { this.RefusalReasonOption = new Option(value); } } + + /// + /// Used to track the state of RefusalReasonCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RefusalReasonCodeOption { get; private set; } /// /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). /// /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [DataMember(Name = "refusalReasonCode", EmitDefaultValue = false)] - public string RefusalReasonCode { get; set; } + [JsonPropertyName("refusalReasonCode")] + public string RefusalReasonCode { get { return this.RefusalReasonCodeOption; } set { this.RefusalReasonCodeOption = new Option(value); } } + + /// + /// Used to track the state of ShopperLocale + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperLocaleOption { get; private set; } /// /// The shopperLocale. /// /// The shopperLocale. - [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] - public string ShopperLocale { get; set; } + [JsonPropertyName("shopperLocale")] + public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2ResponseData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2ResponseDataOption { get; private set; } /// /// Gets or Sets ThreeDS2ResponseData /// - [DataMember(Name = "threeDS2ResponseData", EmitDefaultValue = false)] - public ThreeDS2ResponseData ThreeDS2ResponseData { get; set; } + [JsonPropertyName("threeDS2ResponseData")] + public ThreeDS2ResponseData ThreeDS2ResponseData { get { return this.ThreeDS2ResponseDataOption; } set { this.ThreeDS2ResponseDataOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2Result + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2ResultOption { get; private set; } /// /// Gets or Sets ThreeDS2Result /// - [DataMember(Name = "threeDS2Result", EmitDefaultValue = false)] - public ThreeDS2Result ThreeDS2Result { get; set; } + [JsonPropertyName("threeDS2Result")] + public ThreeDS2Result ThreeDS2Result { get { return this.ThreeDS2ResultOption; } set { this.ThreeDS2ResultOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSPaymentData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSPaymentDataOption { get; private set; } /// /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. /// /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. - [DataMember(Name = "threeDSPaymentData", EmitDefaultValue = false)] - public string ThreeDSPaymentData { get; set; } + [JsonPropertyName("threeDSPaymentData")] + public string ThreeDSPaymentData { get { return this.ThreeDSPaymentDataOption; } set { this.ThreeDSPaymentDataOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -289,191 +536,300 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentDetailsResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentDetailsResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentDetailsResponse); + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option> additionalData = default; + Option amount = default; + Option donationToken = default; + Option fraudResult = default; + Option merchantReference = default; + Option order = default; + Option paymentMethod = default; + Option pspReference = default; + Option refusalReason = default; + Option refusalReasonCode = default; + Option resultCode = default; + Option shopperLocale = default; + Option threeDS2ResponseData = default; + Option threeDS2Result = default; + Option threeDSPaymentData = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "additionalData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "donationToken": + donationToken = new Option(utf8JsonReader.GetString()); + break; + case "fraudResult": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fraudResult = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantReference": + merchantReference = new Option(utf8JsonReader.GetString()); + break; + case "order": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + order = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "paymentMethod": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "refusalReason": + refusalReason = new Option(utf8JsonReader.GetString()); + break; + case "refusalReasonCode": + refusalReasonCode = new Option(utf8JsonReader.GetString()); + break; + case "resultCode": + string resultCodeRawValue = utf8JsonReader.GetString(); + if (resultCodeRawValue != null) + resultCode = new Option(PaymentDetailsResponse.ResultCodeEnumFromStringOrDefault(resultCodeRawValue)); + break; + case "shopperLocale": + shopperLocale = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2ResponseData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDS2ResponseData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDS2Result": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDS2Result = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDSPaymentData": + threeDSPaymentData = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (additionalData.IsSet && additionalData.Value == null) + throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class PaymentDetailsResponse."); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentDetailsResponse."); + + if (donationToken.IsSet && donationToken.Value == null) + throw new ArgumentNullException(nameof(donationToken), "Property is not nullable for class PaymentDetailsResponse."); + + if (fraudResult.IsSet && fraudResult.Value == null) + throw new ArgumentNullException(nameof(fraudResult), "Property is not nullable for class PaymentDetailsResponse."); + + if (merchantReference.IsSet && merchantReference.Value == null) + throw new ArgumentNullException(nameof(merchantReference), "Property is not nullable for class PaymentDetailsResponse."); + + if (order.IsSet && order.Value == null) + throw new ArgumentNullException(nameof(order), "Property is not nullable for class PaymentDetailsResponse."); + + if (paymentMethod.IsSet && paymentMethod.Value == null) + throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class PaymentDetailsResponse."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentDetailsResponse."); + + if (refusalReason.IsSet && refusalReason.Value == null) + throw new ArgumentNullException(nameof(refusalReason), "Property is not nullable for class PaymentDetailsResponse."); + + if (refusalReasonCode.IsSet && refusalReasonCode.Value == null) + throw new ArgumentNullException(nameof(refusalReasonCode), "Property is not nullable for class PaymentDetailsResponse."); + + if (resultCode.IsSet && resultCode.Value == null) + throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class PaymentDetailsResponse."); + + if (shopperLocale.IsSet && shopperLocale.Value == null) + throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class PaymentDetailsResponse."); + + if (threeDS2ResponseData.IsSet && threeDS2ResponseData.Value == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData), "Property is not nullable for class PaymentDetailsResponse."); + + if (threeDS2Result.IsSet && threeDS2Result.Value == null) + throw new ArgumentNullException(nameof(threeDS2Result), "Property is not nullable for class PaymentDetailsResponse."); + + if (threeDSPaymentData.IsSet && threeDSPaymentData.Value == null) + throw new ArgumentNullException(nameof(threeDSPaymentData), "Property is not nullable for class PaymentDetailsResponse."); + + return new PaymentDetailsResponse(additionalData, amount, donationToken, fraudResult, merchantReference, order, paymentMethod, pspReference, refusalReason, refusalReasonCode, resultCode, shopperLocale, threeDS2ResponseData, threeDS2Result, threeDSPaymentData); } /// - /// Returns true if PaymentDetailsResponse instances are equal + /// Serializes a /// - /// Instance of PaymentDetailsResponse to be compared - /// Boolean - public bool Equals(PaymentDetailsResponse input) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentDetailsResponse paymentDetailsResponse, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) - { - return false; - } - return - ( - this.AdditionalData == input.AdditionalData || - this.AdditionalData != null && - input.AdditionalData != null && - this.AdditionalData.SequenceEqual(input.AdditionalData) - ) && - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.DonationToken == input.DonationToken || - (this.DonationToken != null && - this.DonationToken.Equals(input.DonationToken)) - ) && - ( - this.FraudResult == input.FraudResult || - (this.FraudResult != null && - this.FraudResult.Equals(input.FraudResult)) - ) && - ( - this.MerchantReference == input.MerchantReference || - (this.MerchantReference != null && - this.MerchantReference.Equals(input.MerchantReference)) - ) && - ( - this.Order == input.Order || - (this.Order != null && - this.Order.Equals(input.Order)) - ) && - ( - this.PaymentMethod == input.PaymentMethod || - (this.PaymentMethod != null && - this.PaymentMethod.Equals(input.PaymentMethod)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.RefusalReason == input.RefusalReason || - (this.RefusalReason != null && - this.RefusalReason.Equals(input.RefusalReason)) - ) && - ( - this.RefusalReasonCode == input.RefusalReasonCode || - (this.RefusalReasonCode != null && - this.RefusalReasonCode.Equals(input.RefusalReasonCode)) - ) && - ( - this.ResultCode == input.ResultCode || - this.ResultCode.Equals(input.ResultCode) - ) && - ( - this.ShopperLocale == input.ShopperLocale || - (this.ShopperLocale != null && - this.ShopperLocale.Equals(input.ShopperLocale)) - ) && - ( - this.ThreeDS2ResponseData == input.ThreeDS2ResponseData || - (this.ThreeDS2ResponseData != null && - this.ThreeDS2ResponseData.Equals(input.ThreeDS2ResponseData)) - ) && - ( - this.ThreeDS2Result == input.ThreeDS2Result || - (this.ThreeDS2Result != null && - this.ThreeDS2Result.Equals(input.ThreeDS2Result)) - ) && - ( - this.ThreeDSPaymentData == input.ThreeDSPaymentData || - (this.ThreeDSPaymentData != null && - this.ThreeDSPaymentData.Equals(input.ThreeDSPaymentData)) - ); + writer.WriteStartObject(); + + WriteProperties(writer, paymentDetailsResponse, jsonSerializerOptions); + writer.WriteEndObject(); } /// - /// Gets the hash code + /// Serializes the properties of /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentDetailsResponse paymentDetailsResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap + if (paymentDetailsResponse.AdditionalDataOption.IsSet && paymentDetailsResponse.AdditionalData == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.AdditionalData), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.AmountOption.IsSet && paymentDetailsResponse.Amount == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.Amount), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.DonationTokenOption.IsSet && paymentDetailsResponse.DonationToken == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.DonationToken), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.FraudResultOption.IsSet && paymentDetailsResponse.FraudResult == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.FraudResult), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.MerchantReferenceOption.IsSet && paymentDetailsResponse.MerchantReference == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.MerchantReference), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.OrderOption.IsSet && paymentDetailsResponse.Order == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.Order), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.PaymentMethodOption.IsSet && paymentDetailsResponse.PaymentMethod == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.PaymentMethod), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.PspReferenceOption.IsSet && paymentDetailsResponse.PspReference == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.PspReference), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.RefusalReasonOption.IsSet && paymentDetailsResponse.RefusalReason == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.RefusalReason), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.RefusalReasonCodeOption.IsSet && paymentDetailsResponse.RefusalReasonCode == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.RefusalReasonCode), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.ShopperLocaleOption.IsSet && paymentDetailsResponse.ShopperLocale == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.ShopperLocale), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.ThreeDS2ResponseDataOption.IsSet && paymentDetailsResponse.ThreeDS2ResponseData == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.ThreeDS2ResponseData), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.ThreeDS2ResultOption.IsSet && paymentDetailsResponse.ThreeDS2Result == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.ThreeDS2Result), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.ThreeDSPaymentDataOption.IsSet && paymentDetailsResponse.ThreeDSPaymentData == null) + throw new ArgumentNullException(nameof(paymentDetailsResponse.ThreeDSPaymentData), "Property is required for class PaymentDetailsResponse."); + + if (paymentDetailsResponse.AdditionalDataOption.IsSet) { - int hashCode = 41; - if (this.AdditionalData != null) - { - hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); - } - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.DonationToken != null) - { - hashCode = (hashCode * 59) + this.DonationToken.GetHashCode(); - } - if (this.FraudResult != null) - { - hashCode = (hashCode * 59) + this.FraudResult.GetHashCode(); - } - if (this.MerchantReference != null) - { - hashCode = (hashCode * 59) + this.MerchantReference.GetHashCode(); - } - if (this.Order != null) - { - hashCode = (hashCode * 59) + this.Order.GetHashCode(); - } - if (this.PaymentMethod != null) - { - hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - if (this.RefusalReason != null) - { - hashCode = (hashCode * 59) + this.RefusalReason.GetHashCode(); - } - if (this.RefusalReasonCode != null) - { - hashCode = (hashCode * 59) + this.RefusalReasonCode.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ResultCode.GetHashCode(); - if (this.ShopperLocale != null) - { - hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); - } - if (this.ThreeDS2ResponseData != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2ResponseData.GetHashCode(); - } - if (this.ThreeDS2Result != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2Result.GetHashCode(); - } - if (this.ThreeDSPaymentData != null) - { - hashCode = (hashCode * 59) + this.ThreeDSPaymentData.GetHashCode(); - } - return hashCode; + writer.WritePropertyName("additionalData"); + JsonSerializer.Serialize(writer, paymentDetailsResponse.AdditionalData, jsonSerializerOptions); } - } - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; + if (paymentDetailsResponse.AmountOption.IsSet) + { + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, paymentDetailsResponse.Amount, jsonSerializerOptions); + } + if (paymentDetailsResponse.DonationTokenOption.IsSet) + writer.WriteString("donationToken", paymentDetailsResponse.DonationToken); + + if (paymentDetailsResponse.FraudResultOption.IsSet) + { + writer.WritePropertyName("fraudResult"); + JsonSerializer.Serialize(writer, paymentDetailsResponse.FraudResult, jsonSerializerOptions); + } + if (paymentDetailsResponse.MerchantReferenceOption.IsSet) + writer.WriteString("merchantReference", paymentDetailsResponse.MerchantReference); + + if (paymentDetailsResponse.OrderOption.IsSet) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, paymentDetailsResponse.Order, jsonSerializerOptions); + } + if (paymentDetailsResponse.PaymentMethodOption.IsSet) + { + writer.WritePropertyName("paymentMethod"); + JsonSerializer.Serialize(writer, paymentDetailsResponse.PaymentMethod, jsonSerializerOptions); + } + if (paymentDetailsResponse.PspReferenceOption.IsSet) + writer.WriteString("pspReference", paymentDetailsResponse.PspReference); + + if (paymentDetailsResponse.RefusalReasonOption.IsSet) + writer.WriteString("refusalReason", paymentDetailsResponse.RefusalReason); + + if (paymentDetailsResponse.RefusalReasonCodeOption.IsSet) + writer.WriteString("refusalReasonCode", paymentDetailsResponse.RefusalReasonCode); + + var resultCodeRawValue = PaymentDetailsResponse.ResultCodeEnumToJsonValue(paymentDetailsResponse.ResultCodeOption.Value.Value); + writer.WriteString("resultCode", resultCodeRawValue); + if (paymentDetailsResponse.ShopperLocaleOption.IsSet) + writer.WriteString("shopperLocale", paymentDetailsResponse.ShopperLocale); + + if (paymentDetailsResponse.ThreeDS2ResponseDataOption.IsSet) + { + writer.WritePropertyName("threeDS2ResponseData"); + JsonSerializer.Serialize(writer, paymentDetailsResponse.ThreeDS2ResponseData, jsonSerializerOptions); + } + if (paymentDetailsResponse.ThreeDS2ResultOption.IsSet) + { + writer.WritePropertyName("threeDS2Result"); + JsonSerializer.Serialize(writer, paymentDetailsResponse.ThreeDS2Result, jsonSerializerOptions); + } + if (paymentDetailsResponse.ThreeDSPaymentDataOption.IsSet) + writer.WriteString("threeDSPaymentData", paymentDetailsResponse.ThreeDSPaymentData); } } - } diff --git a/Adyen/Model/Checkout/PaymentLinkRequest.cs b/Adyen/Model/Checkout/PaymentLinkRequest.cs index 2053acec1..db78e3b1f 100644 --- a/Adyen/Model/Checkout/PaymentLinkRequest.cs +++ b/Adyen/Model/Checkout/PaymentLinkRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,496 +14,941 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentLinkRequest /// - [DataContract(Name = "PaymentLinkRequest")] - public partial class PaymentLinkRequest : IEquatable, IValidatableObject + public partial class PaymentLinkRequest : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The merchant account identifier for which the payment link is created. + /// A reference that is used to uniquely identify the payment in future communications about the payment status. + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` + /// applicationInfo + /// billingAddress + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` + /// The delay between the authorisation and scheduled auto-capture, specified in hours. + /// The shopper's two-letter country code. + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + /// deliveryAddress + /// A short description visible on the payment page. Maximum length: 280 characters. + /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. + /// fundOrigin + /// fundRecipient + /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip. + /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. + /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. + /// platformChargebackLogic + /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. + /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. + /// riskData + /// The shopper's email address. + /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). + /// shopperName + /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. + /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + /// Set to **false** to hide the button that lets the shopper remove a stored payment method. (default to true) + /// The shopper's social security number. + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false) + /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + /// The physical store, for which this payment is processed. + /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. + /// The shopper's telephone number. + /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. + /// threeDS2RequestData + [JsonConstructor] + public PaymentLinkRequest(Amount amount, string merchantAccount, string reference, Option> allowedPaymentMethods = default, Option applicationInfo = default, Option
billingAddress = default, Option> blockedPaymentMethods = default, Option captureDelayHours = default, Option countryCode = default, Option dateOfBirth = default, Option deliverAt = default, Option
deliveryAddress = default, Option description = default, Option expiresAt = default, Option fundOrigin = default, Option fundRecipient = default, Option> installmentOptions = default, Option> lineItems = default, Option manualCapture = default, Option mcc = default, Option merchantOrderReference = default, Option> metadata = default, Option platformChargebackLogic = default, Option recurringProcessingModel = default, Option> requiredShopperFields = default, Option returnUrl = default, Option reusable = default, Option riskData = default, Option shopperEmail = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option shopperStatement = default, Option showRemovePaymentMethodButton = default, Option socialSecurityNumber = default, Option splitCardFundingSources = default, Option> splits = default, Option store = default, Option storePaymentMethodMode = default, Option telephoneNumber = default, Option themeId = default, Option threeDS2RequestData = default) + { + Amount = amount; + MerchantAccount = merchantAccount; + Reference = reference; + AllowedPaymentMethodsOption = allowedPaymentMethods; + ApplicationInfoOption = applicationInfo; + BillingAddressOption = billingAddress; + BlockedPaymentMethodsOption = blockedPaymentMethods; + CaptureDelayHoursOption = captureDelayHours; + CountryCodeOption = countryCode; + DateOfBirthOption = dateOfBirth; + DeliverAtOption = deliverAt; + DeliveryAddressOption = deliveryAddress; + DescriptionOption = description; + ExpiresAtOption = expiresAt; + FundOriginOption = fundOrigin; + FundRecipientOption = fundRecipient; + InstallmentOptionsOption = installmentOptions; + LineItemsOption = lineItems; + ManualCaptureOption = manualCapture; + MccOption = mcc; + MerchantOrderReferenceOption = merchantOrderReference; + MetadataOption = metadata; + PlatformChargebackLogicOption = platformChargebackLogic; + RecurringProcessingModelOption = recurringProcessingModel; + RequiredShopperFieldsOption = requiredShopperFields; + ReturnUrlOption = returnUrl; + ReusableOption = reusable; + RiskDataOption = riskData; + ShopperEmailOption = shopperEmail; + ShopperLocaleOption = shopperLocale; + ShopperNameOption = shopperName; + ShopperReferenceOption = shopperReference; + ShopperStatementOption = shopperStatement; + ShowRemovePaymentMethodButtonOption = showRemovePaymentMethodButton; + SocialSecurityNumberOption = socialSecurityNumber; + SplitCardFundingSourcesOption = splitCardFundingSources; + SplitsOption = splits; + StoreOption = store; + StorePaymentMethodModeOption = storePaymentMethodMode; + TelephoneNumberOption = telephoneNumber; + ThemeIdOption = themeId; + ThreeDS2RequestDataOption = threeDS2RequestData; + OnCreated(); + } + + partial void OnCreated(); + /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// - [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// - [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// - [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 + } + /// + /// Returns a + /// + /// + /// + /// + public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) + { + if (value == RecurringProcessingModelEnum.CardOnFile) + return "CardOnFile"; + + if (value == RecurringProcessingModelEnum.Subscription) + return "Subscription"; + + if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) + return "UnscheduledCardOnFile"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of RecurringProcessingModel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] - public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } + [JsonPropertyName("recurringProcessingModel")] + public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } + /// /// Defines RequiredShopperFields /// - [JsonConverter(typeof(StringEnumConverter))] public enum RequiredShopperFieldsEnum { /// /// Enum BillingAddress for value: billingAddress /// - [EnumMember(Value = "billingAddress")] BillingAddress = 1, /// /// Enum DeliveryAddress for value: deliveryAddress /// - [EnumMember(Value = "deliveryAddress")] DeliveryAddress = 2, /// /// Enum ShopperEmail for value: shopperEmail /// - [EnumMember(Value = "shopperEmail")] ShopperEmail = 3, /// /// Enum ShopperName for value: shopperName /// - [EnumMember(Value = "shopperName")] ShopperName = 4, /// /// Enum TelephoneNumber for value: telephoneNumber /// - [EnumMember(Value = "telephoneNumber")] TelephoneNumber = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredShopperFieldsEnum RequiredShopperFieldsEnumFromString(string value) + { + if (value.Equals("billingAddress")) + return RequiredShopperFieldsEnum.BillingAddress; + + if (value.Equals("deliveryAddress")) + return RequiredShopperFieldsEnum.DeliveryAddress; + if (value.Equals("shopperEmail")) + return RequiredShopperFieldsEnum.ShopperEmail; + + if (value.Equals("shopperName")) + return RequiredShopperFieldsEnum.ShopperName; + + if (value.Equals("telephoneNumber")) + return RequiredShopperFieldsEnum.TelephoneNumber; + + throw new NotImplementedException($"Could not convert value to type RequiredShopperFieldsEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static RequiredShopperFieldsEnum? RequiredShopperFieldsEnumFromStringOrDefault(string value) + { + if (value.Equals("billingAddress")) + return RequiredShopperFieldsEnum.BillingAddress; + + if (value.Equals("deliveryAddress")) + return RequiredShopperFieldsEnum.DeliveryAddress; + if (value.Equals("shopperEmail")) + return RequiredShopperFieldsEnum.ShopperEmail; + + if (value.Equals("shopperName")) + return RequiredShopperFieldsEnum.ShopperName; + + if (value.Equals("telephoneNumber")) + return RequiredShopperFieldsEnum.TelephoneNumber; + + return null; + } /// - /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + /// Converts the to the json value /// - /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. - [DataMember(Name = "requiredShopperFields", EmitDefaultValue = false)] - public List RequiredShopperFields { get; set; } + /// + /// + /// + public static string RequiredShopperFieldsEnumToJsonValue(RequiredShopperFieldsEnum value) + { + if (value == RequiredShopperFieldsEnum.BillingAddress) + return "billingAddress"; + + if (value == RequiredShopperFieldsEnum.DeliveryAddress) + return "deliveryAddress"; + + if (value == RequiredShopperFieldsEnum.ShopperEmail) + return "shopperEmail"; + + if (value == RequiredShopperFieldsEnum.ShopperName) + return "shopperName"; + + if (value == RequiredShopperFieldsEnum.TelephoneNumber) + return "telephoneNumber"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. - [JsonConverter(typeof(StringEnumConverter))] public enum StorePaymentMethodModeEnum { /// /// Enum AskForConsent for value: askForConsent /// - [EnumMember(Value = "askForConsent")] AskForConsent = 1, /// /// Enum Disabled for value: disabled /// - [EnumMember(Value = "disabled")] Disabled = 2, /// /// Enum Enabled for value: enabled /// - [EnumMember(Value = "enabled")] Enabled = 3 + } + /// + /// Returns a + /// + /// + /// + /// + public static StorePaymentMethodModeEnum StorePaymentMethodModeEnumFromString(string value) + { + if (value.Equals("askForConsent")) + return StorePaymentMethodModeEnum.AskForConsent; + + if (value.Equals("disabled")) + return StorePaymentMethodModeEnum.Disabled; + + if (value.Equals("enabled")) + return StorePaymentMethodModeEnum.Enabled; + + throw new NotImplementedException($"Could not convert value to type StorePaymentMethodModeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static StorePaymentMethodModeEnum? StorePaymentMethodModeEnumFromStringOrDefault(string value) + { + if (value.Equals("askForConsent")) + return StorePaymentMethodModeEnum.AskForConsent; + + if (value.Equals("disabled")) + return StorePaymentMethodModeEnum.Disabled; + + if (value.Equals("enabled")) + return StorePaymentMethodModeEnum.Enabled; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StorePaymentMethodModeEnumToJsonValue(StorePaymentMethodModeEnum? value) + { + if (value == StorePaymentMethodModeEnum.AskForConsent) + return "askForConsent"; + + if (value == StorePaymentMethodModeEnum.Disabled) + return "disabled"; + + if (value == StorePaymentMethodModeEnum.Enabled) + return "enabled"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of StorePaymentMethodMode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StorePaymentMethodModeOption { get; private set; } /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. - [DataMember(Name = "storePaymentMethodMode", EmitDefaultValue = false)] - public StorePaymentMethodModeEnum? StorePaymentMethodMode { get; set; } + [JsonPropertyName("storePaymentMethodMode")] + public StorePaymentMethodModeEnum? StorePaymentMethodMode { get { return this.StorePaymentMethodModeOption; } set { this.StorePaymentMethodModeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Gets or Sets Amount /// - [JsonConstructorAttribute] - protected PaymentLinkRequest() { } + [JsonPropertyName("amount")] + public Amount Amount { get; set; } + /// - /// Initializes a new instance of the class. + /// The merchant account identifier for which the payment link is created. /// - /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]`. - /// amount (required). - /// applicationInfo. - /// billingAddress. - /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]`. - /// The delay between the authorisation and scheduled auto-capture, specified in hours.. - /// The shopper's two-letter country code.. - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. - /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.. - /// deliveryAddress. - /// A short description visible on the payment page. Maximum length: 280 characters.. - /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created.. - /// fundOrigin. - /// fundRecipient. - /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options.. - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip.. - /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture).. - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. - /// The merchant account identifier for which the payment link is created. (required). - /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle.. - /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID.. - /// platformChargebackLogic. - /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . - /// A reference that is used to uniquely identify the payment in future communications about the payment status. (required). - /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. . - /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL.. - /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only.. - /// riskData. - /// The shopper's email address.. - /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language).. - /// shopperName. - /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. - /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**.. - /// Set to **false** to hide the button that lets the shopper remove a stored payment method. (default to true). - /// The shopper's social security number.. - /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false). - /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).. - /// The physical store, for which this payment is processed.. - /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter.. - /// The shopper's telephone number.. - /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area.. - /// threeDS2RequestData. - public PaymentLinkRequest(List allowedPaymentMethods = default(List), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), Address billingAddress = default(Address), List blockedPaymentMethods = default(List), int? captureDelayHours = default(int?), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), DateTime deliverAt = default(DateTime), Address deliveryAddress = default(Address), string description = default(string), DateTime expiresAt = default(DateTime), FundOrigin fundOrigin = default(FundOrigin), FundRecipient fundRecipient = default(FundRecipient), Dictionary installmentOptions = default(Dictionary), List lineItems = default(List), bool? manualCapture = default(bool?), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), Dictionary metadata = default(Dictionary), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string reference = default(string), List requiredShopperFields = default(List), string returnUrl = default(string), bool? reusable = default(bool?), RiskData riskData = default(RiskData), string shopperEmail = default(string), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), bool? showRemovePaymentMethodButton = true, string socialSecurityNumber = default(string), bool? splitCardFundingSources = false, List splits = default(List), string store = default(string), StorePaymentMethodModeEnum? storePaymentMethodMode = default(StorePaymentMethodModeEnum?), string telephoneNumber = default(string), string themeId = default(string), CheckoutSessionThreeDS2RequestData threeDS2RequestData = default(CheckoutSessionThreeDS2RequestData)) - { - this.Amount = amount; - this.MerchantAccount = merchantAccount; - this.Reference = reference; - this.AllowedPaymentMethods = allowedPaymentMethods; - this.ApplicationInfo = applicationInfo; - this.BillingAddress = billingAddress; - this.BlockedPaymentMethods = blockedPaymentMethods; - this.CaptureDelayHours = captureDelayHours; - this.CountryCode = countryCode; - this.DateOfBirth = dateOfBirth; - this.DeliverAt = deliverAt; - this.DeliveryAddress = deliveryAddress; - this.Description = description; - this.ExpiresAt = expiresAt; - this.FundOrigin = fundOrigin; - this.FundRecipient = fundRecipient; - this.InstallmentOptions = installmentOptions; - this.LineItems = lineItems; - this.ManualCapture = manualCapture; - this.Mcc = mcc; - this.MerchantOrderReference = merchantOrderReference; - this.Metadata = metadata; - this.PlatformChargebackLogic = platformChargebackLogic; - this.RecurringProcessingModel = recurringProcessingModel; - this.RequiredShopperFields = requiredShopperFields; - this.ReturnUrl = returnUrl; - this.Reusable = reusable; - this.RiskData = riskData; - this.ShopperEmail = shopperEmail; - this.ShopperLocale = shopperLocale; - this.ShopperName = shopperName; - this.ShopperReference = shopperReference; - this.ShopperStatement = shopperStatement; - this.ShowRemovePaymentMethodButton = showRemovePaymentMethodButton; - this.SocialSecurityNumber = socialSecurityNumber; - this.SplitCardFundingSources = splitCardFundingSources; - this.Splits = splits; - this.Store = store; - this.StorePaymentMethodMode = storePaymentMethodMode; - this.TelephoneNumber = telephoneNumber; - this.ThemeId = themeId; - this.ThreeDS2RequestData = threeDS2RequestData; - } + /// The merchant account identifier for which the payment link is created. + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get; set; } + + /// + /// A reference that is used to uniquely identify the payment in future communications about the payment status. + /// + /// A reference that is used to uniquely identify the payment in future communications about the payment status. + [JsonPropertyName("reference")] + public string Reference { get; set; } + + /// + /// Used to track the state of AllowedPaymentMethods + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AllowedPaymentMethodsOption { get; private set; } /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] - public List AllowedPaymentMethods { get; set; } + [JsonPropertyName("allowedPaymentMethods")] + public List AllowedPaymentMethods { get { return this.AllowedPaymentMethodsOption; } set { this.AllowedPaymentMethodsOption = new Option>(value); } } /// - /// Gets or Sets Amount + /// Used to track the state of ApplicationInfo /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ApplicationInfoOption { get; private set; } /// /// Gets or Sets ApplicationInfo /// - [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; set; } + [JsonPropertyName("applicationInfo")] + public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + + /// + /// Used to track the state of BillingAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option
BillingAddressOption { get; private set; } /// /// Gets or Sets BillingAddress /// - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public Address BillingAddress { get; set; } + [JsonPropertyName("billingAddress")] + public Address BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option
(value); } } + + /// + /// Used to track the state of BlockedPaymentMethods + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> BlockedPaymentMethodsOption { get; private set; } /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] - public List BlockedPaymentMethods { get; set; } + [JsonPropertyName("blockedPaymentMethods")] + public List BlockedPaymentMethods { get { return this.BlockedPaymentMethodsOption; } set { this.BlockedPaymentMethodsOption = new Option>(value); } } + + /// + /// Used to track the state of CaptureDelayHours + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CaptureDelayHoursOption { get; private set; } /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. - [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] - public int? CaptureDelayHours { get; set; } + [JsonPropertyName("captureDelayHours")] + public int? CaptureDelayHours { get { return this.CaptureDelayHoursOption; } set { this.CaptureDelayHoursOption = new Option(value); } } + + /// + /// Used to track the state of CountryCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryCodeOption { get; private set; } /// /// The shopper's two-letter country code. /// /// The shopper's two-letter country code. - [DataMember(Name = "countryCode", EmitDefaultValue = false)] - public string CountryCode { get; set; } + [JsonPropertyName("countryCode")] + public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } + + /// + /// Used to track the state of DateOfBirth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DateOfBirthOption { get; private set; } /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] - [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime DateOfBirth { get; set; } + [JsonPropertyName("dateOfBirth")] + public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } + + /// + /// Used to track the state of DeliverAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliverAtOption { get; private set; } /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [DataMember(Name = "deliverAt", EmitDefaultValue = false)] - public DateTime DeliverAt { get; set; } + [JsonPropertyName("deliverAt")] + public DateTime? DeliverAt { get { return this.DeliverAtOption; } set { this.DeliverAtOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option
DeliveryAddressOption { get; private set; } /// /// Gets or Sets DeliveryAddress /// - [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] - public Address DeliveryAddress { get; set; } + [JsonPropertyName("deliveryAddress")] + public Address DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option
(value); } } + + /// + /// Used to track the state of Description + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DescriptionOption { get; private set; } /// /// A short description visible on the payment page. Maximum length: 280 characters. /// /// A short description visible on the payment page. Maximum length: 280 characters. - [DataMember(Name = "description", EmitDefaultValue = false)] - public string Description { get; set; } + [JsonPropertyName("description")] + public string Description { get { return this.DescriptionOption; } set { this.DescriptionOption = new Option(value); } } + + /// + /// Used to track the state of ExpiresAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiresAtOption { get; private set; } /// /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. /// /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. - [DataMember(Name = "expiresAt", EmitDefaultValue = false)] - public DateTime ExpiresAt { get; set; } + [JsonPropertyName("expiresAt")] + public DateTime? ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } + + /// + /// Used to track the state of FundOrigin + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundOriginOption { get; private set; } /// /// Gets or Sets FundOrigin /// - [DataMember(Name = "fundOrigin", EmitDefaultValue = false)] - public FundOrigin FundOrigin { get; set; } + [JsonPropertyName("fundOrigin")] + public FundOrigin FundOrigin { get { return this.FundOriginOption; } set { this.FundOriginOption = new Option(value); } } + + /// + /// Used to track the state of FundRecipient + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundRecipientOption { get; private set; } /// /// Gets or Sets FundRecipient /// - [DataMember(Name = "fundRecipient", EmitDefaultValue = false)] - public FundRecipient FundRecipient { get; set; } + [JsonPropertyName("fundRecipient")] + public FundRecipient FundRecipient { get { return this.FundRecipientOption; } set { this.FundRecipientOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentOptions + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> InstallmentOptionsOption { get; private set; } /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. - [DataMember(Name = "installmentOptions", EmitDefaultValue = false)] - public Dictionary InstallmentOptions { get; set; } + [JsonPropertyName("installmentOptions")] + public Dictionary InstallmentOptions { get { return this.InstallmentOptionsOption; } set { this.InstallmentOptionsOption = new Option>(value); } } + + /// + /// Used to track the state of LineItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LineItemsOption { get; private set; } /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip. /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip. - [DataMember(Name = "lineItems", EmitDefaultValue = false)] - public List LineItems { get; set; } + [JsonPropertyName("lineItems")] + public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } + + /// + /// Used to track the state of ManualCapture + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ManualCaptureOption { get; private set; } /// /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). /// /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). - [DataMember(Name = "manualCapture", EmitDefaultValue = false)] - public bool? ManualCapture { get; set; } + [JsonPropertyName("manualCapture")] + public bool? ManualCapture { get { return this.ManualCaptureOption; } set { this.ManualCaptureOption = new Option(value); } } + + /// + /// Used to track the state of Mcc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MccOption { get; private set; } /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - [DataMember(Name = "mcc", EmitDefaultValue = false)] - public string Mcc { get; set; } + [JsonPropertyName("mcc")] + public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } /// - /// The merchant account identifier for which the payment link is created. + /// Used to track the state of MerchantOrderReference /// - /// The merchant account identifier for which the payment link is created. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantOrderReferenceOption { get; private set; } /// /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. /// /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. - [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] - public string MerchantOrderReference { get; set; } + [JsonPropertyName("merchantOrderReference")] + public string MerchantOrderReference { get { return this.MerchantOrderReferenceOption; } set { this.MerchantOrderReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Metadata + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> MetadataOption { get; private set; } /// /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. /// /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. - [DataMember(Name = "metadata", EmitDefaultValue = false)] - public Dictionary Metadata { get; set; } + [JsonPropertyName("metadata")] + public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } + + /// + /// Used to track the state of PlatformChargebackLogic + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PlatformChargebackLogicOption { get; private set; } /// /// Gets or Sets PlatformChargebackLogic /// - [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] - public PlatformChargebackLogic PlatformChargebackLogic { get; set; } + [JsonPropertyName("platformChargebackLogic")] + public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } /// - /// A reference that is used to uniquely identify the payment in future communications about the payment status. + /// Used to track the state of RequiredShopperFields /// - /// A reference that is used to uniquely identify the payment in future communications about the payment status. - [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> RequiredShopperFieldsOption { get; private set; } + + /// + /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + /// + /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + [JsonPropertyName("requiredShopperFields")] + public List RequiredShopperFields { get { return this.RequiredShopperFieldsOption; } set { this.RequiredShopperFieldsOption = new Option>(value); } } + + /// + /// Used to track the state of ReturnUrl + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReturnUrlOption { get; private set; } /// /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. /// /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. - [DataMember(Name = "returnUrl", EmitDefaultValue = false)] - public string ReturnUrl { get; set; } + [JsonPropertyName("returnUrl")] + public string ReturnUrl { get { return this.ReturnUrlOption; } set { this.ReturnUrlOption = new Option(value); } } + + /// + /// Used to track the state of Reusable + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReusableOption { get; private set; } /// /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. /// /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. - [DataMember(Name = "reusable", EmitDefaultValue = false)] - public bool? Reusable { get; set; } + [JsonPropertyName("reusable")] + public bool? Reusable { get { return this.ReusableOption; } set { this.ReusableOption = new Option(value); } } + + /// + /// Used to track the state of RiskData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskDataOption { get; private set; } /// /// Gets or Sets RiskData /// - [DataMember(Name = "riskData", EmitDefaultValue = false)] - public RiskData RiskData { get; set; } + [JsonPropertyName("riskData")] + public RiskData RiskData { get { return this.RiskDataOption; } set { this.RiskDataOption = new Option(value); } } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The shopper's email address. /// /// The shopper's email address. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of ShopperLocale + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperLocaleOption { get; private set; } /// /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). /// /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). - [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] - public string ShopperLocale { get; set; } + [JsonPropertyName("shopperLocale")] + public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } + + /// + /// Used to track the state of ShopperName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNameOption { get; private set; } /// /// Gets or Sets ShopperName /// - [DataMember(Name = "shopperName", EmitDefaultValue = false)] - public Name ShopperName { get; set; } + [JsonPropertyName("shopperName")] + public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } + + /// + /// Used to track the state of ShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperReferenceOption { get; private set; } /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [DataMember(Name = "shopperReference", EmitDefaultValue = false)] - public string ShopperReference { get; set; } + [JsonPropertyName("shopperReference")] + public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperStatement + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperStatementOption { get; private set; } /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] - public string ShopperStatement { get; set; } + [JsonPropertyName("shopperStatement")] + public string ShopperStatement { get { return this.ShopperStatementOption; } set { this.ShopperStatementOption = new Option(value); } } + + /// + /// Used to track the state of ShowRemovePaymentMethodButton + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShowRemovePaymentMethodButtonOption { get; private set; } /// /// Set to **false** to hide the button that lets the shopper remove a stored payment method. /// /// Set to **false** to hide the button that lets the shopper remove a stored payment method. - [DataMember(Name = "showRemovePaymentMethodButton", EmitDefaultValue = false)] - public bool? ShowRemovePaymentMethodButton { get; set; } + [JsonPropertyName("showRemovePaymentMethodButton")] + public bool? ShowRemovePaymentMethodButton { get { return this.ShowRemovePaymentMethodButtonOption; } set { this.ShowRemovePaymentMethodButtonOption = new Option(value); } } + + /// + /// Used to track the state of SocialSecurityNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SocialSecurityNumberOption { get; private set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] - public string SocialSecurityNumber { get; set; } + [JsonPropertyName("socialSecurityNumber")] + public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } + + /// + /// Used to track the state of SplitCardFundingSources + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SplitCardFundingSourcesOption { get; private set; } /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. - [DataMember(Name = "splitCardFundingSources", EmitDefaultValue = false)] - public bool? SplitCardFundingSources { get; set; } + [JsonPropertyName("splitCardFundingSources")] + public bool? SplitCardFundingSources { get { return this.SplitCardFundingSourcesOption; } set { this.SplitCardFundingSourcesOption = new Option(value); } } + + /// + /// Used to track the state of Splits + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SplitsOption { get; private set; } /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - [DataMember(Name = "splits", EmitDefaultValue = false)] - public List Splits { get; set; } + [JsonPropertyName("splits")] + public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } + + /// + /// Used to track the state of Store + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoreOption { get; private set; } /// /// The physical store, for which this payment is processed. /// /// The physical store, for which this payment is processed. - [DataMember(Name = "store", EmitDefaultValue = false)] - public string Store { get; set; } + [JsonPropertyName("store")] + public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } + + /// + /// Used to track the state of TelephoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TelephoneNumberOption { get; private set; } /// /// The shopper's telephone number. /// /// The shopper's telephone number. - [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] - public string TelephoneNumber { get; set; } + [JsonPropertyName("telephoneNumber")] + public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of ThemeId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThemeIdOption { get; private set; } /// /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. /// /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. - [DataMember(Name = "themeId", EmitDefaultValue = false)] - public string ThemeId { get; set; } + [JsonPropertyName("themeId")] + public string ThemeId { get { return this.ThemeIdOption; } set { this.ThemeIdOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2RequestData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2RequestDataOption { get; private set; } /// /// Gets or Sets ThreeDS2RequestData /// - [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] - public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get; set; } + [JsonPropertyName("threeDS2RequestData")] + public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -514,8 +958,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentLinkRequest {\n"); - sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); sb.Append(" BlockedPaymentMethods: ").Append(BlockedPaymentMethods).Append("\n"); @@ -532,12 +978,10 @@ public override string ToString() sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" ManualCapture: ").Append(ManualCapture).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append(" PlatformChargebackLogic: ").Append(PlatformChargebackLogic).Append("\n"); sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" RequiredShopperFields: ").Append(RequiredShopperFields).Append("\n"); sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" Reusable: ").Append(Reusable).Append("\n"); @@ -560,478 +1004,750 @@ public override string ToString() return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PaymentLinkRequest); - } - - /// - /// Returns true if PaymentLinkRequest instances are equal - /// - /// Instance of PaymentLinkRequest to be compared - /// Boolean - public bool Equals(PaymentLinkRequest input) - { - if (input == null) - { - return false; - } - return - ( - this.AllowedPaymentMethods == input.AllowedPaymentMethods || - this.AllowedPaymentMethods != null && - input.AllowedPaymentMethods != null && - this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) - ) && - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.BlockedPaymentMethods == input.BlockedPaymentMethods || - this.BlockedPaymentMethods != null && - input.BlockedPaymentMethods != null && - this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) - ) && - ( - this.CaptureDelayHours == input.CaptureDelayHours || - this.CaptureDelayHours.Equals(input.CaptureDelayHours) - ) && - ( - this.CountryCode == input.CountryCode || - (this.CountryCode != null && - this.CountryCode.Equals(input.CountryCode)) - ) && - ( - this.DateOfBirth == input.DateOfBirth || - (this.DateOfBirth != null && - this.DateOfBirth.Equals(input.DateOfBirth)) - ) && - ( - this.DeliverAt == input.DeliverAt || - (this.DeliverAt != null && - this.DeliverAt.Equals(input.DeliverAt)) - ) && - ( - this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) - ) && - ( - this.Description == input.Description || - (this.Description != null && - this.Description.Equals(input.Description)) - ) && - ( - this.ExpiresAt == input.ExpiresAt || - (this.ExpiresAt != null && - this.ExpiresAt.Equals(input.ExpiresAt)) - ) && - ( - this.FundOrigin == input.FundOrigin || - (this.FundOrigin != null && - this.FundOrigin.Equals(input.FundOrigin)) - ) && - ( - this.FundRecipient == input.FundRecipient || - (this.FundRecipient != null && - this.FundRecipient.Equals(input.FundRecipient)) - ) && - ( - this.InstallmentOptions == input.InstallmentOptions || - this.InstallmentOptions != null && - input.InstallmentOptions != null && - this.InstallmentOptions.SequenceEqual(input.InstallmentOptions) - ) && - ( - this.LineItems == input.LineItems || - this.LineItems != null && - input.LineItems != null && - this.LineItems.SequenceEqual(input.LineItems) - ) && - ( - this.ManualCapture == input.ManualCapture || - this.ManualCapture.Equals(input.ManualCapture) - ) && - ( - this.Mcc == input.Mcc || - (this.Mcc != null && - this.Mcc.Equals(input.Mcc)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.MerchantOrderReference == input.MerchantOrderReference || - (this.MerchantOrderReference != null && - this.MerchantOrderReference.Equals(input.MerchantOrderReference)) - ) && - ( - this.Metadata == input.Metadata || - this.Metadata != null && - input.Metadata != null && - this.Metadata.SequenceEqual(input.Metadata) - ) && - ( - this.PlatformChargebackLogic == input.PlatformChargebackLogic || - (this.PlatformChargebackLogic != null && - this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) - ) && - ( - this.RecurringProcessingModel == input.RecurringProcessingModel || - this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.RequiredShopperFields == input.RequiredShopperFields || - this.RequiredShopperFields.SequenceEqual(input.RequiredShopperFields) - ) && - ( - this.ReturnUrl == input.ReturnUrl || - (this.ReturnUrl != null && - this.ReturnUrl.Equals(input.ReturnUrl)) - ) && - ( - this.Reusable == input.Reusable || - this.Reusable.Equals(input.Reusable) - ) && - ( - this.RiskData == input.RiskData || - (this.RiskData != null && - this.RiskData.Equals(input.RiskData)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.ShopperLocale == input.ShopperLocale || - (this.ShopperLocale != null && - this.ShopperLocale.Equals(input.ShopperLocale)) - ) && - ( - this.ShopperName == input.ShopperName || - (this.ShopperName != null && - this.ShopperName.Equals(input.ShopperName)) - ) && - ( - this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) - ) && - ( - this.ShopperStatement == input.ShopperStatement || - (this.ShopperStatement != null && - this.ShopperStatement.Equals(input.ShopperStatement)) - ) && - ( - this.ShowRemovePaymentMethodButton == input.ShowRemovePaymentMethodButton || - this.ShowRemovePaymentMethodButton.Equals(input.ShowRemovePaymentMethodButton) - ) && - ( - this.SocialSecurityNumber == input.SocialSecurityNumber || - (this.SocialSecurityNumber != null && - this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) - ) && - ( - this.SplitCardFundingSources == input.SplitCardFundingSources || - this.SplitCardFundingSources.Equals(input.SplitCardFundingSources) - ) && - ( - this.Splits == input.Splits || - this.Splits != null && - input.Splits != null && - this.Splits.SequenceEqual(input.Splits) - ) && - ( - this.Store == input.Store || - (this.Store != null && - this.Store.Equals(input.Store)) - ) && - ( - this.StorePaymentMethodMode == input.StorePaymentMethodMode || - this.StorePaymentMethodMode.Equals(input.StorePaymentMethodMode) - ) && - ( - this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) - ) && - ( - this.ThemeId == input.ThemeId || - (this.ThemeId != null && - this.ThemeId.Equals(input.ThemeId)) - ) && - ( - this.ThreeDS2RequestData == input.ThreeDS2RequestData || - (this.ThreeDS2RequestData != null && - this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AllowedPaymentMethods != null) - { - hashCode = (hashCode * 59) + this.AllowedPaymentMethods.GetHashCode(); - } - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.ApplicationInfo != null) - { - hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); - } - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.BlockedPaymentMethods != null) - { - hashCode = (hashCode * 59) + this.BlockedPaymentMethods.GetHashCode(); - } - hashCode = (hashCode * 59) + this.CaptureDelayHours.GetHashCode(); - if (this.CountryCode != null) - { - hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); - } - if (this.DateOfBirth != null) - { - hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); - } - if (this.DeliverAt != null) - { - hashCode = (hashCode * 59) + this.DeliverAt.GetHashCode(); - } - if (this.DeliveryAddress != null) - { - hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); - } - if (this.Description != null) - { - hashCode = (hashCode * 59) + this.Description.GetHashCode(); - } - if (this.ExpiresAt != null) - { - hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); - } - if (this.FundOrigin != null) - { - hashCode = (hashCode * 59) + this.FundOrigin.GetHashCode(); - } - if (this.FundRecipient != null) - { - hashCode = (hashCode * 59) + this.FundRecipient.GetHashCode(); - } - if (this.InstallmentOptions != null) - { - hashCode = (hashCode * 59) + this.InstallmentOptions.GetHashCode(); - } - if (this.LineItems != null) - { - hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ManualCapture.GetHashCode(); - if (this.Mcc != null) - { - hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.MerchantOrderReference != null) - { - hashCode = (hashCode * 59) + this.MerchantOrderReference.GetHashCode(); - } - if (this.Metadata != null) - { - hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); - } - if (this.PlatformChargebackLogic != null) - { - hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); - } - hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - hashCode = (hashCode * 59) + this.RequiredShopperFields.GetHashCode(); - if (this.ReturnUrl != null) - { - hashCode = (hashCode * 59) + this.ReturnUrl.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Reusable.GetHashCode(); - if (this.RiskData != null) - { - hashCode = (hashCode * 59) + this.RiskData.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.ShopperLocale != null) - { - hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); - } - if (this.ShopperName != null) - { - hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); - } - if (this.ShopperReference != null) - { - hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); - } - if (this.ShopperStatement != null) - { - hashCode = (hashCode * 59) + this.ShopperStatement.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ShowRemovePaymentMethodButton.GetHashCode(); - if (this.SocialSecurityNumber != null) - { - hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); - } - hashCode = (hashCode * 59) + this.SplitCardFundingSources.GetHashCode(); - if (this.Splits != null) - { - hashCode = (hashCode * 59) + this.Splits.GetHashCode(); - } - if (this.Store != null) - { - hashCode = (hashCode * 59) + this.Store.GetHashCode(); - } - hashCode = (hashCode * 59) + this.StorePaymentMethodMode.GetHashCode(); - if (this.TelephoneNumber != null) - { - hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); - } - if (this.ThemeId != null) - { - hashCode = (hashCode * 59) + this.ThemeId.GetHashCode(); - } - if (this.ThreeDS2RequestData != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); - } - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // CountryCode (string) maxLength if (this.CountryCode != null && this.CountryCode.Length > 100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); + yield return new ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); } // Mcc (string) maxLength if (this.Mcc != null && this.Mcc.Length > 16) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Mcc, length must be less than 16.", new [] { "Mcc" }); + yield return new ValidationResult("Invalid value for Mcc, length must be less than 16.", new [] { "Mcc" }); } // MerchantOrderReference (string) maxLength if (this.MerchantOrderReference != null && this.MerchantOrderReference.Length > 1000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for MerchantOrderReference, length must be less than 1000.", new [] { "MerchantOrderReference" }); + yield return new ValidationResult("Invalid value for MerchantOrderReference, length must be less than 1000.", new [] { "MerchantOrderReference" }); } // ReturnUrl (string) maxLength if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); + yield return new ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); } // ShopperEmail (string) maxLength if (this.ShopperEmail != null && this.ShopperEmail.Length > 500) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperEmail, length must be less than 500.", new [] { "ShopperEmail" }); + yield return new ValidationResult("Invalid value for ShopperEmail, length must be less than 500.", new [] { "ShopperEmail" }); } // ShopperLocale (string) maxLength if (this.ShopperLocale != null && this.ShopperLocale.Length > 32) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperLocale, length must be less than 32.", new [] { "ShopperLocale" }); + yield return new ValidationResult("Invalid value for ShopperLocale, length must be less than 32.", new [] { "ShopperLocale" }); } // ShopperReference (string) maxLength if (this.ShopperReference != null && this.ShopperReference.Length > 256) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); } // ShopperReference (string) minLength if (this.ShopperReference != null && this.ShopperReference.Length < 3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); } // ShopperStatement (string) maxLength if (this.ShopperStatement != null && this.ShopperStatement.Length > 10000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperStatement, length must be less than 10000.", new [] { "ShopperStatement" }); + yield return new ValidationResult("Invalid value for ShopperStatement, length must be less than 10000.", new [] { "ShopperStatement" }); } // SocialSecurityNumber (string) maxLength if (this.SocialSecurityNumber != null && this.SocialSecurityNumber.Length > 32) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for SocialSecurityNumber, length must be less than 32.", new [] { "SocialSecurityNumber" }); + yield return new ValidationResult("Invalid value for SocialSecurityNumber, length must be less than 32.", new [] { "SocialSecurityNumber" }); } // TelephoneNumber (string) maxLength if (this.TelephoneNumber != null && this.TelephoneNumber.Length > 32) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TelephoneNumber, length must be less than 32.", new [] { "TelephoneNumber" }); + yield return new ValidationResult("Invalid value for TelephoneNumber, length must be less than 32.", new [] { "TelephoneNumber" }); } yield break; } } + /// + /// A Json converter for type + /// + public class PaymentLinkRequestJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateOfBirth + /// + public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize DeliverAt + /// + public static string DeliverAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize ExpiresAt + /// + public static string ExpiresAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override PaymentLinkRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option merchantAccount = default; + Option reference = default; + Option> allowedPaymentMethods = default; + Option applicationInfo = default; + Option
billingAddress = default; + Option> blockedPaymentMethods = default; + Option captureDelayHours = default; + Option countryCode = default; + Option dateOfBirth = default; + Option deliverAt = default; + Option
deliveryAddress = default; + Option description = default; + Option expiresAt = default; + Option fundOrigin = default; + Option fundRecipient = default; + Option> installmentOptions = default; + Option> lineItems = default; + Option manualCapture = default; + Option mcc = default; + Option merchantOrderReference = default; + Option> metadata = default; + Option platformChargebackLogic = default; + Option recurringProcessingModel = default; + Option> requiredShopperFields = default; + Option returnUrl = default; + Option reusable = default; + Option riskData = default; + Option shopperEmail = default; + Option shopperLocale = default; + Option shopperName = default; + Option shopperReference = default; + Option shopperStatement = default; + Option showRemovePaymentMethodButton = default; + Option socialSecurityNumber = default; + Option splitCardFundingSources = default; + Option> splits = default; + Option store = default; + Option storePaymentMethodMode = default; + Option telephoneNumber = default; + Option themeId = default; + Option threeDS2RequestData = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "allowedPaymentMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + allowedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "applicationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "billingAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + billingAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "blockedPaymentMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + blockedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "captureDelayHours": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + captureDelayHours = new Option(utf8JsonReader.GetInt32()); + break; + case "countryCode": + countryCode = new Option(utf8JsonReader.GetString()); + break; + case "dateOfBirth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliverAt": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliverAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliveryAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliveryAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "description": + description = new Option(utf8JsonReader.GetString()); + break; + case "expiresAt": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + expiresAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fundOrigin": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fundOrigin = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fundRecipient": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fundRecipient = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "installmentOptions": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + installmentOptions = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "lineItems": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "manualCapture": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + manualCapture = new Option(utf8JsonReader.GetBoolean()); + break; + case "mcc": + mcc = new Option(utf8JsonReader.GetString()); + break; + case "merchantOrderReference": + merchantOrderReference = new Option(utf8JsonReader.GetString()); + break; + case "metadata": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "platformChargebackLogic": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "recurringProcessingModel": + string recurringProcessingModelRawValue = utf8JsonReader.GetString(); + if (recurringProcessingModelRawValue != null) + recurringProcessingModel = new Option(PaymentLinkRequest.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); + break; + case "requiredShopperFields": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredShopperFields = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "returnUrl": + returnUrl = new Option(utf8JsonReader.GetString()); + break; + case "reusable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + reusable = new Option(utf8JsonReader.GetBoolean()); + break; + case "riskData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + riskData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "shopperLocale": + shopperLocale = new Option(utf8JsonReader.GetString()); + break; + case "shopperName": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperReference": + shopperReference = new Option(utf8JsonReader.GetString()); + break; + case "shopperStatement": + shopperStatement = new Option(utf8JsonReader.GetString()); + break; + case "showRemovePaymentMethodButton": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + showRemovePaymentMethodButton = new Option(utf8JsonReader.GetBoolean()); + break; + case "socialSecurityNumber": + socialSecurityNumber = new Option(utf8JsonReader.GetString()); + break; + case "splitCardFundingSources": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splitCardFundingSources = new Option(utf8JsonReader.GetBoolean()); + break; + case "splits": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "store": + store = new Option(utf8JsonReader.GetString()); + break; + case "storePaymentMethodMode": + string storePaymentMethodModeRawValue = utf8JsonReader.GetString(); + if (storePaymentMethodModeRawValue != null) + storePaymentMethodMode = new Option(PaymentLinkRequest.StorePaymentMethodModeEnumFromStringOrDefault(storePaymentMethodModeRawValue)); + break; + case "telephoneNumber": + telephoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "themeId": + themeId = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2RequestData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class PaymentLinkRequest.", nameof(amount)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentLinkRequest.", nameof(merchantAccount)); + + if (!reference.IsSet) + throw new ArgumentException("Property is required for class PaymentLinkRequest.", nameof(reference)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentLinkRequest."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentLinkRequest."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentLinkRequest."); + + if (allowedPaymentMethods.IsSet && allowedPaymentMethods.Value == null) + throw new ArgumentNullException(nameof(allowedPaymentMethods), "Property is not nullable for class PaymentLinkRequest."); + + if (applicationInfo.IsSet && applicationInfo.Value == null) + throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentLinkRequest."); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class PaymentLinkRequest."); + + if (blockedPaymentMethods.IsSet && blockedPaymentMethods.Value == null) + throw new ArgumentNullException(nameof(blockedPaymentMethods), "Property is not nullable for class PaymentLinkRequest."); + + if (captureDelayHours.IsSet && captureDelayHours.Value == null) + throw new ArgumentNullException(nameof(captureDelayHours), "Property is not nullable for class PaymentLinkRequest."); + + if (countryCode.IsSet && countryCode.Value == null) + throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class PaymentLinkRequest."); + + if (dateOfBirth.IsSet && dateOfBirth.Value == null) + throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class PaymentLinkRequest."); + + if (deliverAt.IsSet && deliverAt.Value == null) + throw new ArgumentNullException(nameof(deliverAt), "Property is not nullable for class PaymentLinkRequest."); + + if (deliveryAddress.IsSet && deliveryAddress.Value == null) + throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class PaymentLinkRequest."); + + if (description.IsSet && description.Value == null) + throw new ArgumentNullException(nameof(description), "Property is not nullable for class PaymentLinkRequest."); + + if (expiresAt.IsSet && expiresAt.Value == null) + throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class PaymentLinkRequest."); + + if (fundOrigin.IsSet && fundOrigin.Value == null) + throw new ArgumentNullException(nameof(fundOrigin), "Property is not nullable for class PaymentLinkRequest."); + + if (fundRecipient.IsSet && fundRecipient.Value == null) + throw new ArgumentNullException(nameof(fundRecipient), "Property is not nullable for class PaymentLinkRequest."); + + if (installmentOptions.IsSet && installmentOptions.Value == null) + throw new ArgumentNullException(nameof(installmentOptions), "Property is not nullable for class PaymentLinkRequest."); + + if (lineItems.IsSet && lineItems.Value == null) + throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentLinkRequest."); + + if (manualCapture.IsSet && manualCapture.Value == null) + throw new ArgumentNullException(nameof(manualCapture), "Property is not nullable for class PaymentLinkRequest."); + + if (mcc.IsSet && mcc.Value == null) + throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class PaymentLinkRequest."); + + if (merchantOrderReference.IsSet && merchantOrderReference.Value == null) + throw new ArgumentNullException(nameof(merchantOrderReference), "Property is not nullable for class PaymentLinkRequest."); + + if (metadata.IsSet && metadata.Value == null) + throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class PaymentLinkRequest."); + + if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) + throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class PaymentLinkRequest."); + + if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) + throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class PaymentLinkRequest."); + + if (requiredShopperFields.IsSet && requiredShopperFields.Value == null) + throw new ArgumentNullException(nameof(requiredShopperFields), "Property is not nullable for class PaymentLinkRequest."); + + if (returnUrl.IsSet && returnUrl.Value == null) + throw new ArgumentNullException(nameof(returnUrl), "Property is not nullable for class PaymentLinkRequest."); + + if (reusable.IsSet && reusable.Value == null) + throw new ArgumentNullException(nameof(reusable), "Property is not nullable for class PaymentLinkRequest."); + + if (riskData.IsSet && riskData.Value == null) + throw new ArgumentNullException(nameof(riskData), "Property is not nullable for class PaymentLinkRequest."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class PaymentLinkRequest."); + + if (shopperLocale.IsSet && shopperLocale.Value == null) + throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class PaymentLinkRequest."); + + if (shopperName.IsSet && shopperName.Value == null) + throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class PaymentLinkRequest."); + + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class PaymentLinkRequest."); + + if (shopperStatement.IsSet && shopperStatement.Value == null) + throw new ArgumentNullException(nameof(shopperStatement), "Property is not nullable for class PaymentLinkRequest."); + + if (showRemovePaymentMethodButton.IsSet && showRemovePaymentMethodButton.Value == null) + throw new ArgumentNullException(nameof(showRemovePaymentMethodButton), "Property is not nullable for class PaymentLinkRequest."); + + if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) + throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class PaymentLinkRequest."); + + if (splitCardFundingSources.IsSet && splitCardFundingSources.Value == null) + throw new ArgumentNullException(nameof(splitCardFundingSources), "Property is not nullable for class PaymentLinkRequest."); + + if (splits.IsSet && splits.Value == null) + throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentLinkRequest."); + + if (store.IsSet && store.Value == null) + throw new ArgumentNullException(nameof(store), "Property is not nullable for class PaymentLinkRequest."); + + if (storePaymentMethodMode.IsSet && storePaymentMethodMode.Value == null) + throw new ArgumentNullException(nameof(storePaymentMethodMode), "Property is not nullable for class PaymentLinkRequest."); + + if (telephoneNumber.IsSet && telephoneNumber.Value == null) + throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class PaymentLinkRequest."); + + if (themeId.IsSet && themeId.Value == null) + throw new ArgumentNullException(nameof(themeId), "Property is not nullable for class PaymentLinkRequest."); + + if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) + throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class PaymentLinkRequest."); + + return new PaymentLinkRequest(amount.Value, merchantAccount.Value, reference.Value, allowedPaymentMethods, applicationInfo, billingAddress, blockedPaymentMethods, captureDelayHours, countryCode, dateOfBirth, deliverAt, deliveryAddress, description, expiresAt, fundOrigin, fundRecipient, installmentOptions, lineItems, manualCapture, mcc, merchantOrderReference, metadata, platformChargebackLogic, recurringProcessingModel, requiredShopperFields, returnUrl, reusable, riskData, shopperEmail, shopperLocale, shopperName, shopperReference, shopperStatement, showRemovePaymentMethodButton, socialSecurityNumber, splitCardFundingSources, splits, store, storePaymentMethodMode, telephoneNumber, themeId, threeDS2RequestData); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentLinkRequest paymentLinkRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, paymentLinkRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentLinkRequest paymentLinkRequest, JsonSerializerOptions jsonSerializerOptions) + { + if (paymentLinkRequest.Amount == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.Amount), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.MerchantAccount), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.Reference == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.Reference), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.AllowedPaymentMethodsOption.IsSet && paymentLinkRequest.AllowedPaymentMethods == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.AllowedPaymentMethods), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.ApplicationInfoOption.IsSet && paymentLinkRequest.ApplicationInfo == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.ApplicationInfo), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.BillingAddressOption.IsSet && paymentLinkRequest.BillingAddress == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.BillingAddress), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.BlockedPaymentMethodsOption.IsSet && paymentLinkRequest.BlockedPaymentMethods == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.BlockedPaymentMethods), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.CountryCodeOption.IsSet && paymentLinkRequest.CountryCode == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.CountryCode), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.DeliveryAddressOption.IsSet && paymentLinkRequest.DeliveryAddress == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.DeliveryAddress), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.DescriptionOption.IsSet && paymentLinkRequest.Description == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.Description), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.FundOriginOption.IsSet && paymentLinkRequest.FundOrigin == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.FundOrigin), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.FundRecipientOption.IsSet && paymentLinkRequest.FundRecipient == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.FundRecipient), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.InstallmentOptionsOption.IsSet && paymentLinkRequest.InstallmentOptions == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.InstallmentOptions), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.LineItemsOption.IsSet && paymentLinkRequest.LineItems == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.LineItems), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.MccOption.IsSet && paymentLinkRequest.Mcc == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.Mcc), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.MerchantOrderReferenceOption.IsSet && paymentLinkRequest.MerchantOrderReference == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.MerchantOrderReference), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.MetadataOption.IsSet && paymentLinkRequest.Metadata == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.Metadata), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.PlatformChargebackLogicOption.IsSet && paymentLinkRequest.PlatformChargebackLogic == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.PlatformChargebackLogic), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.RequiredShopperFieldsOption.IsSet && paymentLinkRequest.RequiredShopperFields == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.RequiredShopperFields), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.ReturnUrlOption.IsSet && paymentLinkRequest.ReturnUrl == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.ReturnUrl), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.RiskDataOption.IsSet && paymentLinkRequest.RiskData == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.RiskData), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.ShopperEmailOption.IsSet && paymentLinkRequest.ShopperEmail == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.ShopperEmail), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.ShopperLocaleOption.IsSet && paymentLinkRequest.ShopperLocale == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.ShopperLocale), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.ShopperNameOption.IsSet && paymentLinkRequest.ShopperName == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.ShopperName), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.ShopperReferenceOption.IsSet && paymentLinkRequest.ShopperReference == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.ShopperReference), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.ShopperStatementOption.IsSet && paymentLinkRequest.ShopperStatement == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.ShopperStatement), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.SocialSecurityNumberOption.IsSet && paymentLinkRequest.SocialSecurityNumber == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.SocialSecurityNumber), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.SplitsOption.IsSet && paymentLinkRequest.Splits == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.Splits), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.StoreOption.IsSet && paymentLinkRequest.Store == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.Store), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.TelephoneNumberOption.IsSet && paymentLinkRequest.TelephoneNumber == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.TelephoneNumber), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.ThemeIdOption.IsSet && paymentLinkRequest.ThemeId == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.ThemeId), "Property is required for class PaymentLinkRequest."); + + if (paymentLinkRequest.ThreeDS2RequestDataOption.IsSet && paymentLinkRequest.ThreeDS2RequestData == null) + throw new ArgumentNullException(nameof(paymentLinkRequest.ThreeDS2RequestData), "Property is required for class PaymentLinkRequest."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, paymentLinkRequest.Amount, jsonSerializerOptions); + writer.WriteString("merchantAccount", paymentLinkRequest.MerchantAccount); + + writer.WriteString("reference", paymentLinkRequest.Reference); + + if (paymentLinkRequest.AllowedPaymentMethodsOption.IsSet) + { + writer.WritePropertyName("allowedPaymentMethods"); + JsonSerializer.Serialize(writer, paymentLinkRequest.AllowedPaymentMethods, jsonSerializerOptions); + } + if (paymentLinkRequest.ApplicationInfoOption.IsSet) + { + writer.WritePropertyName("applicationInfo"); + JsonSerializer.Serialize(writer, paymentLinkRequest.ApplicationInfo, jsonSerializerOptions); + } + if (paymentLinkRequest.BillingAddressOption.IsSet) + { + writer.WritePropertyName("billingAddress"); + JsonSerializer.Serialize(writer, paymentLinkRequest.BillingAddress, jsonSerializerOptions); + } + if (paymentLinkRequest.BlockedPaymentMethodsOption.IsSet) + { + writer.WritePropertyName("blockedPaymentMethods"); + JsonSerializer.Serialize(writer, paymentLinkRequest.BlockedPaymentMethods, jsonSerializerOptions); + } + if (paymentLinkRequest.CaptureDelayHoursOption.IsSet) + writer.WriteNumber("captureDelayHours", paymentLinkRequest.CaptureDelayHoursOption.Value.Value); + + if (paymentLinkRequest.CountryCodeOption.IsSet) + writer.WriteString("countryCode", paymentLinkRequest.CountryCode); + + if (paymentLinkRequest.DateOfBirthOption.IsSet) + writer.WriteString("dateOfBirth", paymentLinkRequest.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); + + if (paymentLinkRequest.DeliverAtOption.IsSet) + writer.WriteString("deliverAt", paymentLinkRequest.DeliverAtOption.Value.Value.ToString(DeliverAtFormat)); + + if (paymentLinkRequest.DeliveryAddressOption.IsSet) + { + writer.WritePropertyName("deliveryAddress"); + JsonSerializer.Serialize(writer, paymentLinkRequest.DeliveryAddress, jsonSerializerOptions); + } + if (paymentLinkRequest.DescriptionOption.IsSet) + writer.WriteString("description", paymentLinkRequest.Description); + + if (paymentLinkRequest.ExpiresAtOption.IsSet) + writer.WriteString("expiresAt", paymentLinkRequest.ExpiresAtOption.Value.Value.ToString(ExpiresAtFormat)); + + if (paymentLinkRequest.FundOriginOption.IsSet) + { + writer.WritePropertyName("fundOrigin"); + JsonSerializer.Serialize(writer, paymentLinkRequest.FundOrigin, jsonSerializerOptions); + } + if (paymentLinkRequest.FundRecipientOption.IsSet) + { + writer.WritePropertyName("fundRecipient"); + JsonSerializer.Serialize(writer, paymentLinkRequest.FundRecipient, jsonSerializerOptions); + } + if (paymentLinkRequest.InstallmentOptionsOption.IsSet) + { + writer.WritePropertyName("installmentOptions"); + JsonSerializer.Serialize(writer, paymentLinkRequest.InstallmentOptions, jsonSerializerOptions); + } + if (paymentLinkRequest.LineItemsOption.IsSet) + { + writer.WritePropertyName("lineItems"); + JsonSerializer.Serialize(writer, paymentLinkRequest.LineItems, jsonSerializerOptions); + } + if (paymentLinkRequest.ManualCaptureOption.IsSet) + writer.WriteBoolean("manualCapture", paymentLinkRequest.ManualCaptureOption.Value.Value); + + if (paymentLinkRequest.MccOption.IsSet) + writer.WriteString("mcc", paymentLinkRequest.Mcc); + + if (paymentLinkRequest.MerchantOrderReferenceOption.IsSet) + writer.WriteString("merchantOrderReference", paymentLinkRequest.MerchantOrderReference); + + if (paymentLinkRequest.MetadataOption.IsSet) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, paymentLinkRequest.Metadata, jsonSerializerOptions); + } + if (paymentLinkRequest.PlatformChargebackLogicOption.IsSet) + { + writer.WritePropertyName("platformChargebackLogic"); + JsonSerializer.Serialize(writer, paymentLinkRequest.PlatformChargebackLogic, jsonSerializerOptions); + } + var recurringProcessingModelRawValue = PaymentLinkRequest.RecurringProcessingModelEnumToJsonValue(paymentLinkRequest.RecurringProcessingModelOption.Value.Value); + writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); + if (paymentLinkRequest.RequiredShopperFieldsOption.IsSet) + { + writer.WritePropertyName("requiredShopperFields"); + JsonSerializer.Serialize(writer, paymentLinkRequest.RequiredShopperFields, jsonSerializerOptions); + } + if (paymentLinkRequest.ReturnUrlOption.IsSet) + writer.WriteString("returnUrl", paymentLinkRequest.ReturnUrl); + + if (paymentLinkRequest.ReusableOption.IsSet) + writer.WriteBoolean("reusable", paymentLinkRequest.ReusableOption.Value.Value); + + if (paymentLinkRequest.RiskDataOption.IsSet) + { + writer.WritePropertyName("riskData"); + JsonSerializer.Serialize(writer, paymentLinkRequest.RiskData, jsonSerializerOptions); + } + if (paymentLinkRequest.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", paymentLinkRequest.ShopperEmail); + + if (paymentLinkRequest.ShopperLocaleOption.IsSet) + writer.WriteString("shopperLocale", paymentLinkRequest.ShopperLocale); + + if (paymentLinkRequest.ShopperNameOption.IsSet) + { + writer.WritePropertyName("shopperName"); + JsonSerializer.Serialize(writer, paymentLinkRequest.ShopperName, jsonSerializerOptions); + } + if (paymentLinkRequest.ShopperReferenceOption.IsSet) + writer.WriteString("shopperReference", paymentLinkRequest.ShopperReference); + + if (paymentLinkRequest.ShopperStatementOption.IsSet) + writer.WriteString("shopperStatement", paymentLinkRequest.ShopperStatement); + + if (paymentLinkRequest.ShowRemovePaymentMethodButtonOption.IsSet) + writer.WriteBoolean("showRemovePaymentMethodButton", paymentLinkRequest.ShowRemovePaymentMethodButtonOption.Value.Value); + + if (paymentLinkRequest.SocialSecurityNumberOption.IsSet) + writer.WriteString("socialSecurityNumber", paymentLinkRequest.SocialSecurityNumber); + + if (paymentLinkRequest.SplitCardFundingSourcesOption.IsSet) + writer.WriteBoolean("splitCardFundingSources", paymentLinkRequest.SplitCardFundingSourcesOption.Value.Value); + + if (paymentLinkRequest.SplitsOption.IsSet) + { + writer.WritePropertyName("splits"); + JsonSerializer.Serialize(writer, paymentLinkRequest.Splits, jsonSerializerOptions); + } + if (paymentLinkRequest.StoreOption.IsSet) + writer.WriteString("store", paymentLinkRequest.Store); + + var storePaymentMethodModeRawValue = PaymentLinkRequest.StorePaymentMethodModeEnumToJsonValue(paymentLinkRequest.StorePaymentMethodModeOption.Value.Value); + writer.WriteString("storePaymentMethodMode", storePaymentMethodModeRawValue); + if (paymentLinkRequest.TelephoneNumberOption.IsSet) + writer.WriteString("telephoneNumber", paymentLinkRequest.TelephoneNumber); + + if (paymentLinkRequest.ThemeIdOption.IsSet) + writer.WriteString("themeId", paymentLinkRequest.ThemeId); + + if (paymentLinkRequest.ThreeDS2RequestDataOption.IsSet) + { + writer.WritePropertyName("threeDS2RequestData"); + JsonSerializer.Serialize(writer, paymentLinkRequest.ThreeDS2RequestData, jsonSerializerOptions); + } + } + } } diff --git a/Adyen/Model/Checkout/PaymentLinkResponse.cs b/Adyen/Model/Checkout/PaymentLinkResponse.cs index ad21bf01e..cf6c381c4 100644 --- a/Adyen/Model/Checkout/PaymentLinkResponse.cs +++ b/Adyen/Model/Checkout/PaymentLinkResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,567 +14,1093 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentLinkResponse /// - [DataContract(Name = "PaymentLinkResponse")] public partial class PaymentLinkResponse : IEquatable, IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// A unique identifier of the payment link. + /// The merchant account identifier for which the payment link is created. + /// A reference that is used to uniquely identify the payment in future communications about the payment status. + /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. + /// The URL at which the shopper can complete the payment. + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` + /// applicationInfo + /// billingAddress + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` + /// The delay between the authorisation and scheduled auto-capture, specified in hours. + /// The shopper's two-letter country code. + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + /// deliveryAddress + /// A short description visible on the payment page. Maximum length: 280 characters. + /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. + /// fundOrigin + /// fundRecipient + /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip. + /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. + /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. + /// platformChargebackLogic + /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. + /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. + /// riskData + /// The shopper's email address. + /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). + /// shopperName + /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. + /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + /// Set to **false** to hide the button that lets the shopper remove a stored payment method. (default to true) + /// The shopper's social security number. + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false) + /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + /// The physical store, for which this payment is processed. + /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. + /// The shopper's telephone number. + /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. + /// threeDS2RequestData + /// The date when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + [JsonConstructor] + public PaymentLinkResponse(Amount amount, string id, string merchantAccount, string reference, StatusEnum status, string url, Option> allowedPaymentMethods = default, Option applicationInfo = default, Option
billingAddress = default, Option> blockedPaymentMethods = default, Option captureDelayHours = default, Option countryCode = default, Option dateOfBirth = default, Option deliverAt = default, Option
deliveryAddress = default, Option description = default, Option expiresAt = default, Option fundOrigin = default, Option fundRecipient = default, Option> installmentOptions = default, Option> lineItems = default, Option manualCapture = default, Option mcc = default, Option merchantOrderReference = default, Option> metadata = default, Option platformChargebackLogic = default, Option recurringProcessingModel = default, Option> requiredShopperFields = default, Option returnUrl = default, Option reusable = default, Option riskData = default, Option shopperEmail = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option shopperStatement = default, Option showRemovePaymentMethodButton = default, Option socialSecurityNumber = default, Option splitCardFundingSources = default, Option> splits = default, Option store = default, Option storePaymentMethodMode = default, Option telephoneNumber = default, Option themeId = default, Option threeDS2RequestData = default, Option updatedAt = default) + { + Amount = amount; + Id = id; + MerchantAccount = merchantAccount; + Reference = reference; + Status = status; + Url = url; + AllowedPaymentMethodsOption = allowedPaymentMethods; + ApplicationInfoOption = applicationInfo; + BillingAddressOption = billingAddress; + BlockedPaymentMethodsOption = blockedPaymentMethods; + CaptureDelayHoursOption = captureDelayHours; + CountryCodeOption = countryCode; + DateOfBirthOption = dateOfBirth; + DeliverAtOption = deliverAt; + DeliveryAddressOption = deliveryAddress; + DescriptionOption = description; + ExpiresAtOption = expiresAt; + FundOriginOption = fundOrigin; + FundRecipientOption = fundRecipient; + InstallmentOptionsOption = installmentOptions; + LineItemsOption = lineItems; + ManualCaptureOption = manualCapture; + MccOption = mcc; + MerchantOrderReferenceOption = merchantOrderReference; + MetadataOption = metadata; + PlatformChargebackLogicOption = platformChargebackLogic; + RecurringProcessingModelOption = recurringProcessingModel; + RequiredShopperFieldsOption = requiredShopperFields; + ReturnUrlOption = returnUrl; + ReusableOption = reusable; + RiskDataOption = riskData; + ShopperEmailOption = shopperEmail; + ShopperLocaleOption = shopperLocale; + ShopperNameOption = shopperName; + ShopperReferenceOption = shopperReference; + ShopperStatementOption = shopperStatement; + ShowRemovePaymentMethodButtonOption = showRemovePaymentMethodButton; + SocialSecurityNumberOption = socialSecurityNumber; + SplitCardFundingSourcesOption = splitCardFundingSources; + SplitsOption = splits; + StoreOption = store; + StorePaymentMethodModeOption = storePaymentMethodMode; + TelephoneNumberOption = telephoneNumber; + ThemeIdOption = themeId; + ThreeDS2RequestDataOption = threeDS2RequestData; + UpdatedAtOption = updatedAt; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. + /// + /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. + public enum StatusEnum + { + /// + /// Enum Active for value: active + /// + Active = 1, + + /// + /// Enum Completed for value: completed + /// + Completed = 2, + + /// + /// Enum Expired for value: expired + /// + Expired = 3, + + /// + /// Enum Paid for value: paid + /// + Paid = 4, + + /// + /// Enum PaymentPending for value: paymentPending + /// + PaymentPending = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("active")) + return StatusEnum.Active; + + if (value.Equals("completed")) + return StatusEnum.Completed; + + if (value.Equals("expired")) + return StatusEnum.Expired; + + if (value.Equals("paid")) + return StatusEnum.Paid; + + if (value.Equals("paymentPending")) + return StatusEnum.PaymentPending; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("active")) + return StatusEnum.Active; + + if (value.Equals("completed")) + return StatusEnum.Completed; + + if (value.Equals("expired")) + return StatusEnum.Expired; + + if (value.Equals("paid")) + return StatusEnum.Paid; + + if (value.Equals("paymentPending")) + return StatusEnum.PaymentPending; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum value) + { + if (value == StatusEnum.Active) + return "active"; + + if (value == StatusEnum.Completed) + return "completed"; + + if (value == StatusEnum.Expired) + return "expired"; + + if (value == StatusEnum.Paid) + return "paid"; + + if (value == StatusEnum.PaymentPending) + return "paymentPending"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. + /// + /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. + [JsonPropertyName("status")] + public StatusEnum Status { get; set; } + /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// - [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// - [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// - [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) + { + if (value == RecurringProcessingModelEnum.CardOnFile) + return "CardOnFile"; + if (value == RecurringProcessingModelEnum.Subscription) + return "Subscription"; + + if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) + return "UnscheduledCardOnFile"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of RecurringProcessingModel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] - public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } + [JsonPropertyName("recurringProcessingModel")] + public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } + /// /// Defines RequiredShopperFields /// - [JsonConverter(typeof(StringEnumConverter))] public enum RequiredShopperFieldsEnum { /// /// Enum BillingAddress for value: billingAddress /// - [EnumMember(Value = "billingAddress")] BillingAddress = 1, /// /// Enum DeliveryAddress for value: deliveryAddress /// - [EnumMember(Value = "deliveryAddress")] DeliveryAddress = 2, /// /// Enum ShopperEmail for value: shopperEmail /// - [EnumMember(Value = "shopperEmail")] ShopperEmail = 3, /// /// Enum ShopperName for value: shopperName /// - [EnumMember(Value = "shopperName")] ShopperName = 4, /// /// Enum TelephoneNumber for value: telephoneNumber /// - [EnumMember(Value = "telephoneNumber")] TelephoneNumber = 5 - } - - /// - /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + /// Returns a /// - /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. - [DataMember(Name = "requiredShopperFields", EmitDefaultValue = false)] - public List RequiredShopperFields { get; set; } + /// + /// + /// + public static RequiredShopperFieldsEnum RequiredShopperFieldsEnumFromString(string value) + { + if (value.Equals("billingAddress")) + return RequiredShopperFieldsEnum.BillingAddress; + + if (value.Equals("deliveryAddress")) + return RequiredShopperFieldsEnum.DeliveryAddress; + + if (value.Equals("shopperEmail")) + return RequiredShopperFieldsEnum.ShopperEmail; + + if (value.Equals("shopperName")) + return RequiredShopperFieldsEnum.ShopperName; + + if (value.Equals("telephoneNumber")) + return RequiredShopperFieldsEnum.TelephoneNumber; + + throw new NotImplementedException($"Could not convert value to type RequiredShopperFieldsEnum: '{value}'"); + } + /// - /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. + /// Returns a /// - /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. - [JsonConverter(typeof(StringEnumConverter))] - public enum StatusEnum + /// + /// + public static RequiredShopperFieldsEnum? RequiredShopperFieldsEnumFromStringOrDefault(string value) { - /// - /// Enum Active for value: active - /// - [EnumMember(Value = "active")] - Active = 1, + if (value.Equals("billingAddress")) + return RequiredShopperFieldsEnum.BillingAddress; - /// - /// Enum Completed for value: completed - /// - [EnumMember(Value = "completed")] - Completed = 2, + if (value.Equals("deliveryAddress")) + return RequiredShopperFieldsEnum.DeliveryAddress; - /// - /// Enum Expired for value: expired - /// - [EnumMember(Value = "expired")] - Expired = 3, + if (value.Equals("shopperEmail")) + return RequiredShopperFieldsEnum.ShopperEmail; - /// - /// Enum Paid for value: paid - /// - [EnumMember(Value = "paid")] - Paid = 4, + if (value.Equals("shopperName")) + return RequiredShopperFieldsEnum.ShopperName; - /// - /// Enum PaymentPending for value: paymentPending - /// - [EnumMember(Value = "paymentPending")] - PaymentPending = 5 + if (value.Equals("telephoneNumber")) + return RequiredShopperFieldsEnum.TelephoneNumber; + return null; } - /// - /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. + /// Converts the to the json value /// - /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public StatusEnum Status { get; set; } + /// + /// + /// + public static string RequiredShopperFieldsEnumToJsonValue(RequiredShopperFieldsEnum value) + { + if (value == RequiredShopperFieldsEnum.BillingAddress) + return "billingAddress"; + + if (value == RequiredShopperFieldsEnum.DeliveryAddress) + return "deliveryAddress"; + + if (value == RequiredShopperFieldsEnum.ShopperEmail) + return "shopperEmail"; + + if (value == RequiredShopperFieldsEnum.ShopperName) + return "shopperName"; + + if (value == RequiredShopperFieldsEnum.TelephoneNumber) + return "telephoneNumber"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. - [JsonConverter(typeof(StringEnumConverter))] public enum StorePaymentMethodModeEnum { /// /// Enum AskForConsent for value: askForConsent /// - [EnumMember(Value = "askForConsent")] AskForConsent = 1, /// /// Enum Disabled for value: disabled /// - [EnumMember(Value = "disabled")] Disabled = 2, /// /// Enum Enabled for value: enabled /// - [EnumMember(Value = "enabled")] Enabled = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static StorePaymentMethodModeEnum StorePaymentMethodModeEnumFromString(string value) + { + if (value.Equals("askForConsent")) + return StorePaymentMethodModeEnum.AskForConsent; + + if (value.Equals("disabled")) + return StorePaymentMethodModeEnum.Disabled; + + if (value.Equals("enabled")) + return StorePaymentMethodModeEnum.Enabled; + + throw new NotImplementedException($"Could not convert value to type StorePaymentMethodModeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static StorePaymentMethodModeEnum? StorePaymentMethodModeEnumFromStringOrDefault(string value) + { + if (value.Equals("askForConsent")) + return StorePaymentMethodModeEnum.AskForConsent; + + if (value.Equals("disabled")) + return StorePaymentMethodModeEnum.Disabled; + + if (value.Equals("enabled")) + return StorePaymentMethodModeEnum.Enabled; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StorePaymentMethodModeEnumToJsonValue(StorePaymentMethodModeEnum? value) + { + if (value == StorePaymentMethodModeEnum.AskForConsent) + return "askForConsent"; + + if (value == StorePaymentMethodModeEnum.Disabled) + return "disabled"; + + if (value == StorePaymentMethodModeEnum.Enabled) + return "enabled"; + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of StorePaymentMethodMode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StorePaymentMethodModeOption { get; private set; } /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. - [DataMember(Name = "storePaymentMethodMode", EmitDefaultValue = false)] - public StorePaymentMethodModeEnum? StorePaymentMethodMode { get; set; } + [JsonPropertyName("storePaymentMethodMode")] + public StorePaymentMethodModeEnum? StorePaymentMethodMode { get { return this.StorePaymentMethodModeOption; } set { this.StorePaymentMethodModeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Gets or Sets Amount /// - [JsonConstructorAttribute] - protected PaymentLinkResponse() { } + [JsonPropertyName("amount")] + public Amount Amount { get; set; } + /// - /// Initializes a new instance of the class. + /// A unique identifier of the payment link. /// - /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]`. - /// amount (required). - /// applicationInfo. - /// billingAddress. - /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]`. - /// The delay between the authorisation and scheduled auto-capture, specified in hours.. - /// The shopper's two-letter country code.. - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. - /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.. - /// deliveryAddress. - /// A short description visible on the payment page. Maximum length: 280 characters.. - /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created.. - /// fundOrigin. - /// fundRecipient. - /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options.. - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip.. - /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture).. - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. - /// The merchant account identifier for which the payment link is created. (required). - /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle.. - /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID.. - /// platformChargebackLogic. - /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . - /// A reference that is used to uniquely identify the payment in future communications about the payment status. (required). - /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. . - /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL.. - /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only.. - /// riskData. - /// The shopper's email address.. - /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language).. - /// shopperName. - /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. - /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**.. - /// Set to **false** to hide the button that lets the shopper remove a stored payment method. (default to true). - /// The shopper's social security number.. - /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false). - /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).. - /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. (required). - /// The physical store, for which this payment is processed.. - /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter.. - /// The shopper's telephone number.. - /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area.. - /// threeDS2RequestData. - /// The date when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.. - public PaymentLinkResponse(List allowedPaymentMethods = default(List), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), Address billingAddress = default(Address), List blockedPaymentMethods = default(List), int? captureDelayHours = default(int?), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), DateTime deliverAt = default(DateTime), Address deliveryAddress = default(Address), string description = default(string), DateTime expiresAt = default(DateTime), FundOrigin fundOrigin = default(FundOrigin), FundRecipient fundRecipient = default(FundRecipient), Dictionary installmentOptions = default(Dictionary), List lineItems = default(List), bool? manualCapture = default(bool?), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), Dictionary metadata = default(Dictionary), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string reference = default(string), List requiredShopperFields = default(List), string returnUrl = default(string), bool? reusable = default(bool?), RiskData riskData = default(RiskData), string shopperEmail = default(string), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), bool? showRemovePaymentMethodButton = true, string socialSecurityNumber = default(string), bool? splitCardFundingSources = false, List splits = default(List), StatusEnum status = default(StatusEnum), string store = default(string), StorePaymentMethodModeEnum? storePaymentMethodMode = default(StorePaymentMethodModeEnum?), string telephoneNumber = default(string), string themeId = default(string), CheckoutSessionThreeDS2RequestData threeDS2RequestData = default(CheckoutSessionThreeDS2RequestData), DateTime updatedAt = default(DateTime)) - { - this.Amount = amount; - this.MerchantAccount = merchantAccount; - this.Reference = reference; - this.Status = status; - this.AllowedPaymentMethods = allowedPaymentMethods; - this.ApplicationInfo = applicationInfo; - this.BillingAddress = billingAddress; - this.BlockedPaymentMethods = blockedPaymentMethods; - this.CaptureDelayHours = captureDelayHours; - this.CountryCode = countryCode; - this.DateOfBirth = dateOfBirth; - this.DeliverAt = deliverAt; - this.DeliveryAddress = deliveryAddress; - this.Description = description; - this.ExpiresAt = expiresAt; - this.FundOrigin = fundOrigin; - this.FundRecipient = fundRecipient; - this.InstallmentOptions = installmentOptions; - this.LineItems = lineItems; - this.ManualCapture = manualCapture; - this.Mcc = mcc; - this.MerchantOrderReference = merchantOrderReference; - this.Metadata = metadata; - this.PlatformChargebackLogic = platformChargebackLogic; - this.RecurringProcessingModel = recurringProcessingModel; - this.RequiredShopperFields = requiredShopperFields; - this.ReturnUrl = returnUrl; - this.Reusable = reusable; - this.RiskData = riskData; - this.ShopperEmail = shopperEmail; - this.ShopperLocale = shopperLocale; - this.ShopperName = shopperName; - this.ShopperReference = shopperReference; - this.ShopperStatement = shopperStatement; - this.ShowRemovePaymentMethodButton = showRemovePaymentMethodButton; - this.SocialSecurityNumber = socialSecurityNumber; - this.SplitCardFundingSources = splitCardFundingSources; - this.Splits = splits; - this.Store = store; - this.StorePaymentMethodMode = storePaymentMethodMode; - this.TelephoneNumber = telephoneNumber; - this.ThemeId = themeId; - this.ThreeDS2RequestData = threeDS2RequestData; - this.UpdatedAt = updatedAt; - } + /// A unique identifier of the payment link. + [JsonPropertyName("id")] + public string Id { get; } + + /// + /// The merchant account identifier for which the payment link is created. + /// + /// The merchant account identifier for which the payment link is created. + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get; set; } + + /// + /// A reference that is used to uniquely identify the payment in future communications about the payment status. + /// + /// A reference that is used to uniquely identify the payment in future communications about the payment status. + [JsonPropertyName("reference")] + public string Reference { get; set; } + + /// + /// The URL at which the shopper can complete the payment. + /// + /// The URL at which the shopper can complete the payment. + [JsonPropertyName("url")] + public string Url { get; } + + /// + /// Used to track the state of AllowedPaymentMethods + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AllowedPaymentMethodsOption { get; private set; } /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] - public List AllowedPaymentMethods { get; set; } + [JsonPropertyName("allowedPaymentMethods")] + public List AllowedPaymentMethods { get { return this.AllowedPaymentMethodsOption; } set { this.AllowedPaymentMethodsOption = new Option>(value); } } /// - /// Gets or Sets Amount + /// Used to track the state of ApplicationInfo /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ApplicationInfoOption { get; private set; } /// /// Gets or Sets ApplicationInfo /// - [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; set; } + [JsonPropertyName("applicationInfo")] + public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + + /// + /// Used to track the state of BillingAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option
BillingAddressOption { get; private set; } /// /// Gets or Sets BillingAddress /// - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public Address BillingAddress { get; set; } + [JsonPropertyName("billingAddress")] + public Address BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option
(value); } } + + /// + /// Used to track the state of BlockedPaymentMethods + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> BlockedPaymentMethodsOption { get; private set; } /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] - public List BlockedPaymentMethods { get; set; } + [JsonPropertyName("blockedPaymentMethods")] + public List BlockedPaymentMethods { get { return this.BlockedPaymentMethodsOption; } set { this.BlockedPaymentMethodsOption = new Option>(value); } } + + /// + /// Used to track the state of CaptureDelayHours + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CaptureDelayHoursOption { get; private set; } /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. - [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] - public int? CaptureDelayHours { get; set; } + [JsonPropertyName("captureDelayHours")] + public int? CaptureDelayHours { get { return this.CaptureDelayHoursOption; } set { this.CaptureDelayHoursOption = new Option(value); } } + + /// + /// Used to track the state of CountryCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryCodeOption { get; private set; } /// /// The shopper's two-letter country code. /// /// The shopper's two-letter country code. - [DataMember(Name = "countryCode", EmitDefaultValue = false)] - public string CountryCode { get; set; } + [JsonPropertyName("countryCode")] + public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } + + /// + /// Used to track the state of DateOfBirth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DateOfBirthOption { get; private set; } /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] - [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime DateOfBirth { get; set; } + [JsonPropertyName("dateOfBirth")] + public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } + + /// + /// Used to track the state of DeliverAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliverAtOption { get; private set; } /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [DataMember(Name = "deliverAt", EmitDefaultValue = false)] - public DateTime DeliverAt { get; set; } + [JsonPropertyName("deliverAt")] + public DateTime? DeliverAt { get { return this.DeliverAtOption; } set { this.DeliverAtOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option
DeliveryAddressOption { get; private set; } /// /// Gets or Sets DeliveryAddress /// - [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] - public Address DeliveryAddress { get; set; } + [JsonPropertyName("deliveryAddress")] + public Address DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option
(value); } } + + /// + /// Used to track the state of Description + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DescriptionOption { get; private set; } /// /// A short description visible on the payment page. Maximum length: 280 characters. /// /// A short description visible on the payment page. Maximum length: 280 characters. - [DataMember(Name = "description", EmitDefaultValue = false)] - public string Description { get; set; } + [JsonPropertyName("description")] + public string Description { get { return this.DescriptionOption; } set { this.DescriptionOption = new Option(value); } } + + /// + /// Used to track the state of ExpiresAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiresAtOption { get; private set; } /// /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. /// /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. - [DataMember(Name = "expiresAt", EmitDefaultValue = false)] - public DateTime ExpiresAt { get; set; } + [JsonPropertyName("expiresAt")] + public DateTime? ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } + + /// + /// Used to track the state of FundOrigin + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundOriginOption { get; private set; } /// /// Gets or Sets FundOrigin /// - [DataMember(Name = "fundOrigin", EmitDefaultValue = false)] - public FundOrigin FundOrigin { get; set; } + [JsonPropertyName("fundOrigin")] + public FundOrigin FundOrigin { get { return this.FundOriginOption; } set { this.FundOriginOption = new Option(value); } } + + /// + /// Used to track the state of FundRecipient + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundRecipientOption { get; private set; } /// /// Gets or Sets FundRecipient /// - [DataMember(Name = "fundRecipient", EmitDefaultValue = false)] - public FundRecipient FundRecipient { get; set; } + [JsonPropertyName("fundRecipient")] + public FundRecipient FundRecipient { get { return this.FundRecipientOption; } set { this.FundRecipientOption = new Option(value); } } /// - /// A unique identifier of the payment link. + /// Used to track the state of InstallmentOptions /// - /// A unique identifier of the payment link. - [DataMember(Name = "id", IsRequired = false, EmitDefaultValue = false)] - public string Id { get; private set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> InstallmentOptionsOption { get; private set; } /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. - [DataMember(Name = "installmentOptions", EmitDefaultValue = false)] - public Dictionary InstallmentOptions { get; set; } + [JsonPropertyName("installmentOptions")] + public Dictionary InstallmentOptions { get { return this.InstallmentOptionsOption; } set { this.InstallmentOptionsOption = new Option>(value); } } + + /// + /// Used to track the state of LineItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LineItemsOption { get; private set; } /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip. /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip. - [DataMember(Name = "lineItems", EmitDefaultValue = false)] - public List LineItems { get; set; } + [JsonPropertyName("lineItems")] + public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } + + /// + /// Used to track the state of ManualCapture + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ManualCaptureOption { get; private set; } /// /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). /// /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). - [DataMember(Name = "manualCapture", EmitDefaultValue = false)] - public bool? ManualCapture { get; set; } + [JsonPropertyName("manualCapture")] + public bool? ManualCapture { get { return this.ManualCaptureOption; } set { this.ManualCaptureOption = new Option(value); } } + + /// + /// Used to track the state of Mcc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MccOption { get; private set; } /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - [DataMember(Name = "mcc", EmitDefaultValue = false)] - public string Mcc { get; set; } + [JsonPropertyName("mcc")] + public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } /// - /// The merchant account identifier for which the payment link is created. + /// Used to track the state of MerchantOrderReference /// - /// The merchant account identifier for which the payment link is created. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantOrderReferenceOption { get; private set; } /// /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. /// /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. - [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] - public string MerchantOrderReference { get; set; } + [JsonPropertyName("merchantOrderReference")] + public string MerchantOrderReference { get { return this.MerchantOrderReferenceOption; } set { this.MerchantOrderReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Metadata + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> MetadataOption { get; private set; } /// /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. /// /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. - [DataMember(Name = "metadata", EmitDefaultValue = false)] - public Dictionary Metadata { get; set; } + [JsonPropertyName("metadata")] + public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } + + /// + /// Used to track the state of PlatformChargebackLogic + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PlatformChargebackLogicOption { get; private set; } /// /// Gets or Sets PlatformChargebackLogic /// - [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] - public PlatformChargebackLogic PlatformChargebackLogic { get; set; } + [JsonPropertyName("platformChargebackLogic")] + public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } /// - /// A reference that is used to uniquely identify the payment in future communications about the payment status. + /// Used to track the state of RequiredShopperFields /// - /// A reference that is used to uniquely identify the payment in future communications about the payment status. - [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> RequiredShopperFieldsOption { get; private set; } + + /// + /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + /// + /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + [JsonPropertyName("requiredShopperFields")] + public List RequiredShopperFields { get { return this.RequiredShopperFieldsOption; } set { this.RequiredShopperFieldsOption = new Option>(value); } } + + /// + /// Used to track the state of ReturnUrl + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReturnUrlOption { get; private set; } /// /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. /// /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. - [DataMember(Name = "returnUrl", EmitDefaultValue = false)] - public string ReturnUrl { get; set; } + [JsonPropertyName("returnUrl")] + public string ReturnUrl { get { return this.ReturnUrlOption; } set { this.ReturnUrlOption = new Option(value); } } + + /// + /// Used to track the state of Reusable + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReusableOption { get; private set; } /// /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. /// /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. - [DataMember(Name = "reusable", EmitDefaultValue = false)] - public bool? Reusable { get; set; } + [JsonPropertyName("reusable")] + public bool? Reusable { get { return this.ReusableOption; } set { this.ReusableOption = new Option(value); } } + + /// + /// Used to track the state of RiskData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskDataOption { get; private set; } /// /// Gets or Sets RiskData /// - [DataMember(Name = "riskData", EmitDefaultValue = false)] - public RiskData RiskData { get; set; } + [JsonPropertyName("riskData")] + public RiskData RiskData { get { return this.RiskDataOption; } set { this.RiskDataOption = new Option(value); } } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The shopper's email address. /// /// The shopper's email address. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of ShopperLocale + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperLocaleOption { get; private set; } /// /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). /// /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). - [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] - public string ShopperLocale { get; set; } + [JsonPropertyName("shopperLocale")] + public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } + + /// + /// Used to track the state of ShopperName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNameOption { get; private set; } /// /// Gets or Sets ShopperName /// - [DataMember(Name = "shopperName", EmitDefaultValue = false)] - public Name ShopperName { get; set; } + [JsonPropertyName("shopperName")] + public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } + + /// + /// Used to track the state of ShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperReferenceOption { get; private set; } /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [DataMember(Name = "shopperReference", EmitDefaultValue = false)] - public string ShopperReference { get; set; } + [JsonPropertyName("shopperReference")] + public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperStatement + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperStatementOption { get; private set; } /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] - public string ShopperStatement { get; set; } + [JsonPropertyName("shopperStatement")] + public string ShopperStatement { get { return this.ShopperStatementOption; } set { this.ShopperStatementOption = new Option(value); } } + + /// + /// Used to track the state of ShowRemovePaymentMethodButton + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShowRemovePaymentMethodButtonOption { get; private set; } /// /// Set to **false** to hide the button that lets the shopper remove a stored payment method. /// /// Set to **false** to hide the button that lets the shopper remove a stored payment method. - [DataMember(Name = "showRemovePaymentMethodButton", EmitDefaultValue = false)] - public bool? ShowRemovePaymentMethodButton { get; set; } + [JsonPropertyName("showRemovePaymentMethodButton")] + public bool? ShowRemovePaymentMethodButton { get { return this.ShowRemovePaymentMethodButtonOption; } set { this.ShowRemovePaymentMethodButtonOption = new Option(value); } } + + /// + /// Used to track the state of SocialSecurityNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SocialSecurityNumberOption { get; private set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] - public string SocialSecurityNumber { get; set; } + [JsonPropertyName("socialSecurityNumber")] + public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } + + /// + /// Used to track the state of SplitCardFundingSources + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SplitCardFundingSourcesOption { get; private set; } /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. - [DataMember(Name = "splitCardFundingSources", EmitDefaultValue = false)] - public bool? SplitCardFundingSources { get; set; } + [JsonPropertyName("splitCardFundingSources")] + public bool? SplitCardFundingSources { get { return this.SplitCardFundingSourcesOption; } set { this.SplitCardFundingSourcesOption = new Option(value); } } + + /// + /// Used to track the state of Splits + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SplitsOption { get; private set; } /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - [DataMember(Name = "splits", EmitDefaultValue = false)] - public List Splits { get; set; } + [JsonPropertyName("splits")] + public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } + + /// + /// Used to track the state of Store + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoreOption { get; private set; } /// /// The physical store, for which this payment is processed. /// /// The physical store, for which this payment is processed. - [DataMember(Name = "store", EmitDefaultValue = false)] - public string Store { get; set; } + [JsonPropertyName("store")] + public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } + + /// + /// Used to track the state of TelephoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TelephoneNumberOption { get; private set; } /// /// The shopper's telephone number. /// /// The shopper's telephone number. - [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] - public string TelephoneNumber { get; set; } + [JsonPropertyName("telephoneNumber")] + public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of ThemeId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThemeIdOption { get; private set; } /// /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. /// /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. - [DataMember(Name = "themeId", EmitDefaultValue = false)] - public string ThemeId { get; set; } + [JsonPropertyName("themeId")] + public string ThemeId { get { return this.ThemeIdOption; } set { this.ThemeIdOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2RequestData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2RequestDataOption { get; private set; } /// /// Gets or Sets ThreeDS2RequestData /// - [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] - public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get; set; } + [JsonPropertyName("threeDS2RequestData")] + public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } /// - /// The date when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + /// Used to track the state of UpdatedAt /// - /// The date when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [DataMember(Name = "updatedAt", EmitDefaultValue = false)] - public DateTime UpdatedAt { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UpdatedAtOption { get; private set; } /// - /// The URL at which the shopper can complete the payment. + /// The date when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. /// - /// The URL at which the shopper can complete the payment. - [DataMember(Name = "url", IsRequired = false, EmitDefaultValue = false)] - public string Url { get; private set; } + /// The date when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + [JsonPropertyName("updatedAt")] + public DateTime? UpdatedAt { get { return this.UpdatedAtOption; } set { this.UpdatedAtOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -585,8 +1110,13 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentLinkResponse {\n"); - sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); sb.Append(" BlockedPaymentMethods: ").Append(BlockedPaymentMethods).Append("\n"); @@ -599,17 +1129,14 @@ public override string ToString() sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append(" FundOrigin: ").Append(FundOrigin).Append("\n"); sb.Append(" FundRecipient: ").Append(FundRecipient).Append("\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" InstallmentOptions: ").Append(InstallmentOptions).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" ManualCapture: ").Append(ManualCapture).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append(" PlatformChargebackLogic: ").Append(PlatformChargebackLogic).Append("\n"); sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" RequiredShopperFields: ").Append(RequiredShopperFields).Append("\n"); sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" Reusable: ").Append(Reusable).Append("\n"); @@ -623,27 +1150,16 @@ public override string ToString() sb.Append(" SocialSecurityNumber: ").Append(SocialSecurityNumber).Append("\n"); sb.Append(" SplitCardFundingSources: ").Append(SplitCardFundingSources).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" Store: ").Append(Store).Append("\n"); sb.Append(" StorePaymentMethodMode: ").Append(StorePaymentMethodMode).Append("\n"); sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); sb.Append(" ThemeId: ").Append(ThemeId).Append("\n"); sb.Append(" ThreeDS2RequestData: ").Append(ThreeDS2RequestData).Append("\n"); sb.Append(" UpdatedAt: ").Append(UpdatedAt).Append("\n"); - sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - /// /// Returns true if objects are equal /// @@ -662,236 +1178,18 @@ public override bool Equals(object input) public bool Equals(PaymentLinkResponse input) { if (input == null) - { return false; - } + return ( - this.AllowedPaymentMethods == input.AllowedPaymentMethods || - this.AllowedPaymentMethods != null && - input.AllowedPaymentMethods != null && - this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) - ) && - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.BlockedPaymentMethods == input.BlockedPaymentMethods || - this.BlockedPaymentMethods != null && - input.BlockedPaymentMethods != null && - this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) - ) && - ( - this.CaptureDelayHours == input.CaptureDelayHours || - this.CaptureDelayHours.Equals(input.CaptureDelayHours) + Id == input.Id || + (Id != null && + Id.Equals(input.Id)) ) && ( - this.CountryCode == input.CountryCode || - (this.CountryCode != null && - this.CountryCode.Equals(input.CountryCode)) - ) && - ( - this.DateOfBirth == input.DateOfBirth || - (this.DateOfBirth != null && - this.DateOfBirth.Equals(input.DateOfBirth)) - ) && - ( - this.DeliverAt == input.DeliverAt || - (this.DeliverAt != null && - this.DeliverAt.Equals(input.DeliverAt)) - ) && - ( - this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) - ) && - ( - this.Description == input.Description || - (this.Description != null && - this.Description.Equals(input.Description)) - ) && - ( - this.ExpiresAt == input.ExpiresAt || - (this.ExpiresAt != null && - this.ExpiresAt.Equals(input.ExpiresAt)) - ) && - ( - this.FundOrigin == input.FundOrigin || - (this.FundOrigin != null && - this.FundOrigin.Equals(input.FundOrigin)) - ) && - ( - this.FundRecipient == input.FundRecipient || - (this.FundRecipient != null && - this.FundRecipient.Equals(input.FundRecipient)) - ) && - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.InstallmentOptions == input.InstallmentOptions || - this.InstallmentOptions != null && - input.InstallmentOptions != null && - this.InstallmentOptions.SequenceEqual(input.InstallmentOptions) - ) && - ( - this.LineItems == input.LineItems || - this.LineItems != null && - input.LineItems != null && - this.LineItems.SequenceEqual(input.LineItems) - ) && - ( - this.ManualCapture == input.ManualCapture || - this.ManualCapture.Equals(input.ManualCapture) - ) && - ( - this.Mcc == input.Mcc || - (this.Mcc != null && - this.Mcc.Equals(input.Mcc)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.MerchantOrderReference == input.MerchantOrderReference || - (this.MerchantOrderReference != null && - this.MerchantOrderReference.Equals(input.MerchantOrderReference)) - ) && - ( - this.Metadata == input.Metadata || - this.Metadata != null && - input.Metadata != null && - this.Metadata.SequenceEqual(input.Metadata) - ) && - ( - this.PlatformChargebackLogic == input.PlatformChargebackLogic || - (this.PlatformChargebackLogic != null && - this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) - ) && - ( - this.RecurringProcessingModel == input.RecurringProcessingModel || - this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.RequiredShopperFields == input.RequiredShopperFields || - this.RequiredShopperFields.SequenceEqual(input.RequiredShopperFields) - ) && - ( - this.ReturnUrl == input.ReturnUrl || - (this.ReturnUrl != null && - this.ReturnUrl.Equals(input.ReturnUrl)) - ) && - ( - this.Reusable == input.Reusable || - this.Reusable.Equals(input.Reusable) - ) && - ( - this.RiskData == input.RiskData || - (this.RiskData != null && - this.RiskData.Equals(input.RiskData)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.ShopperLocale == input.ShopperLocale || - (this.ShopperLocale != null && - this.ShopperLocale.Equals(input.ShopperLocale)) - ) && - ( - this.ShopperName == input.ShopperName || - (this.ShopperName != null && - this.ShopperName.Equals(input.ShopperName)) - ) && - ( - this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) - ) && - ( - this.ShopperStatement == input.ShopperStatement || - (this.ShopperStatement != null && - this.ShopperStatement.Equals(input.ShopperStatement)) - ) && - ( - this.ShowRemovePaymentMethodButton == input.ShowRemovePaymentMethodButton || - this.ShowRemovePaymentMethodButton.Equals(input.ShowRemovePaymentMethodButton) - ) && - ( - this.SocialSecurityNumber == input.SocialSecurityNumber || - (this.SocialSecurityNumber != null && - this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) - ) && - ( - this.SplitCardFundingSources == input.SplitCardFundingSources || - this.SplitCardFundingSources.Equals(input.SplitCardFundingSources) - ) && - ( - this.Splits == input.Splits || - this.Splits != null && - input.Splits != null && - this.Splits.SequenceEqual(input.Splits) - ) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ) && - ( - this.Store == input.Store || - (this.Store != null && - this.Store.Equals(input.Store)) - ) && - ( - this.StorePaymentMethodMode == input.StorePaymentMethodMode || - this.StorePaymentMethodMode.Equals(input.StorePaymentMethodMode) - ) && - ( - this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) - ) && - ( - this.ThemeId == input.ThemeId || - (this.ThemeId != null && - this.ThemeId.Equals(input.ThemeId)) - ) && - ( - this.ThreeDS2RequestData == input.ThreeDS2RequestData || - (this.ThreeDS2RequestData != null && - this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) - ) && - ( - this.UpdatedAt == input.UpdatedAt || - (this.UpdatedAt != null && - this.UpdatedAt.Equals(input.UpdatedAt)) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) + Url == input.Url || + (Url != null && + Url.Equals(input.Url)) ); } @@ -904,241 +1202,816 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.AllowedPaymentMethods != null) - { - hashCode = (hashCode * 59) + this.AllowedPaymentMethods.GetHashCode(); - } - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.ApplicationInfo != null) - { - hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); - } - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.BlockedPaymentMethods != null) - { - hashCode = (hashCode * 59) + this.BlockedPaymentMethods.GetHashCode(); - } - hashCode = (hashCode * 59) + this.CaptureDelayHours.GetHashCode(); - if (this.CountryCode != null) - { - hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); - } - if (this.DateOfBirth != null) - { - hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); - } - if (this.DeliverAt != null) - { - hashCode = (hashCode * 59) + this.DeliverAt.GetHashCode(); - } - if (this.DeliveryAddress != null) - { - hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); - } - if (this.Description != null) - { - hashCode = (hashCode * 59) + this.Description.GetHashCode(); - } - if (this.ExpiresAt != null) - { - hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); - } - if (this.FundOrigin != null) - { - hashCode = (hashCode * 59) + this.FundOrigin.GetHashCode(); - } - if (this.FundRecipient != null) - { - hashCode = (hashCode * 59) + this.FundRecipient.GetHashCode(); - } - if (this.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - if (this.InstallmentOptions != null) - { - hashCode = (hashCode * 59) + this.InstallmentOptions.GetHashCode(); - } - if (this.LineItems != null) - { - hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ManualCapture.GetHashCode(); - if (this.Mcc != null) - { - hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.MerchantOrderReference != null) - { - hashCode = (hashCode * 59) + this.MerchantOrderReference.GetHashCode(); - } - if (this.Metadata != null) - { - hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); - } - if (this.PlatformChargebackLogic != null) - { - hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); - } - hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - hashCode = (hashCode * 59) + this.RequiredShopperFields.GetHashCode(); - if (this.ReturnUrl != null) - { - hashCode = (hashCode * 59) + this.ReturnUrl.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Reusable.GetHashCode(); - if (this.RiskData != null) - { - hashCode = (hashCode * 59) + this.RiskData.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.ShopperLocale != null) - { - hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); - } - if (this.ShopperName != null) - { - hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); - } - if (this.ShopperReference != null) - { - hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); - } - if (this.ShopperStatement != null) - { - hashCode = (hashCode * 59) + this.ShopperStatement.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ShowRemovePaymentMethodButton.GetHashCode(); - if (this.SocialSecurityNumber != null) - { - hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); - } - hashCode = (hashCode * 59) + this.SplitCardFundingSources.GetHashCode(); - if (this.Splits != null) - { - hashCode = (hashCode * 59) + this.Splits.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - if (this.Store != null) - { - hashCode = (hashCode * 59) + this.Store.GetHashCode(); - } - hashCode = (hashCode * 59) + this.StorePaymentMethodMode.GetHashCode(); - if (this.TelephoneNumber != null) - { - hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); - } - if (this.ThemeId != null) - { - hashCode = (hashCode * 59) + this.ThemeId.GetHashCode(); - } - if (this.ThreeDS2RequestData != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); - } - if (this.UpdatedAt != null) - { - hashCode = (hashCode * 59) + this.UpdatedAt.GetHashCode(); - } - if (this.Url != null) - { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); - } + hashCode = (hashCode * 59) + Id.GetHashCode(); + hashCode = (hashCode * 59) + Url.GetHashCode(); + return hashCode; } } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // CountryCode (string) maxLength if (this.CountryCode != null && this.CountryCode.Length > 100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); + yield return new ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); } // Mcc (string) maxLength if (this.Mcc != null && this.Mcc.Length > 16) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Mcc, length must be less than 16.", new [] { "Mcc" }); + yield return new ValidationResult("Invalid value for Mcc, length must be less than 16.", new [] { "Mcc" }); } // MerchantOrderReference (string) maxLength if (this.MerchantOrderReference != null && this.MerchantOrderReference.Length > 1000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for MerchantOrderReference, length must be less than 1000.", new [] { "MerchantOrderReference" }); + yield return new ValidationResult("Invalid value for MerchantOrderReference, length must be less than 1000.", new [] { "MerchantOrderReference" }); } // ReturnUrl (string) maxLength if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); + yield return new ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); } // ShopperEmail (string) maxLength if (this.ShopperEmail != null && this.ShopperEmail.Length > 500) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperEmail, length must be less than 500.", new [] { "ShopperEmail" }); + yield return new ValidationResult("Invalid value for ShopperEmail, length must be less than 500.", new [] { "ShopperEmail" }); } // ShopperLocale (string) maxLength if (this.ShopperLocale != null && this.ShopperLocale.Length > 32) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperLocale, length must be less than 32.", new [] { "ShopperLocale" }); + yield return new ValidationResult("Invalid value for ShopperLocale, length must be less than 32.", new [] { "ShopperLocale" }); } // ShopperReference (string) maxLength if (this.ShopperReference != null && this.ShopperReference.Length > 256) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); } // ShopperReference (string) minLength if (this.ShopperReference != null && this.ShopperReference.Length < 3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); } // ShopperStatement (string) maxLength if (this.ShopperStatement != null && this.ShopperStatement.Length > 10000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperStatement, length must be less than 10000.", new [] { "ShopperStatement" }); + yield return new ValidationResult("Invalid value for ShopperStatement, length must be less than 10000.", new [] { "ShopperStatement" }); } // SocialSecurityNumber (string) maxLength if (this.SocialSecurityNumber != null && this.SocialSecurityNumber.Length > 32) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for SocialSecurityNumber, length must be less than 32.", new [] { "SocialSecurityNumber" }); + yield return new ValidationResult("Invalid value for SocialSecurityNumber, length must be less than 32.", new [] { "SocialSecurityNumber" }); } // TelephoneNumber (string) maxLength if (this.TelephoneNumber != null && this.TelephoneNumber.Length > 32) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TelephoneNumber, length must be less than 32.", new [] { "TelephoneNumber" }); + yield return new ValidationResult("Invalid value for TelephoneNumber, length must be less than 32.", new [] { "TelephoneNumber" }); } yield break; } } + /// + /// A Json converter for type + /// + public class PaymentLinkResponseJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateOfBirth + /// + public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize DeliverAt + /// + public static string DeliverAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize ExpiresAt + /// + public static string ExpiresAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize UpdatedAt + /// + public static string UpdatedAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override PaymentLinkResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option id = default; + Option merchantAccount = default; + Option reference = default; + Option status = default; + Option url = default; + Option> allowedPaymentMethods = default; + Option applicationInfo = default; + Option
billingAddress = default; + Option> blockedPaymentMethods = default; + Option captureDelayHours = default; + Option countryCode = default; + Option dateOfBirth = default; + Option deliverAt = default; + Option
deliveryAddress = default; + Option description = default; + Option expiresAt = default; + Option fundOrigin = default; + Option fundRecipient = default; + Option> installmentOptions = default; + Option> lineItems = default; + Option manualCapture = default; + Option mcc = default; + Option merchantOrderReference = default; + Option> metadata = default; + Option platformChargebackLogic = default; + Option recurringProcessingModel = default; + Option> requiredShopperFields = default; + Option returnUrl = default; + Option reusable = default; + Option riskData = default; + Option shopperEmail = default; + Option shopperLocale = default; + Option shopperName = default; + Option shopperReference = default; + Option shopperStatement = default; + Option showRemovePaymentMethodButton = default; + Option socialSecurityNumber = default; + Option splitCardFundingSources = default; + Option> splits = default; + Option store = default; + Option storePaymentMethodMode = default; + Option telephoneNumber = default; + Option themeId = default; + Option threeDS2RequestData = default; + Option updatedAt = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(PaymentLinkResponse.StatusEnumFromStringOrDefault(statusRawValue)); + break; + case "url": + url = new Option(utf8JsonReader.GetString()); + break; + case "allowedPaymentMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + allowedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "applicationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "billingAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + billingAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "blockedPaymentMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + blockedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "captureDelayHours": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + captureDelayHours = new Option(utf8JsonReader.GetInt32()); + break; + case "countryCode": + countryCode = new Option(utf8JsonReader.GetString()); + break; + case "dateOfBirth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliverAt": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliverAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliveryAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliveryAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "description": + description = new Option(utf8JsonReader.GetString()); + break; + case "expiresAt": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + expiresAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fundOrigin": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fundOrigin = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fundRecipient": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fundRecipient = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "installmentOptions": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + installmentOptions = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "lineItems": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "manualCapture": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + manualCapture = new Option(utf8JsonReader.GetBoolean()); + break; + case "mcc": + mcc = new Option(utf8JsonReader.GetString()); + break; + case "merchantOrderReference": + merchantOrderReference = new Option(utf8JsonReader.GetString()); + break; + case "metadata": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "platformChargebackLogic": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "recurringProcessingModel": + string recurringProcessingModelRawValue = utf8JsonReader.GetString(); + if (recurringProcessingModelRawValue != null) + recurringProcessingModel = new Option(PaymentLinkResponse.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); + break; + case "requiredShopperFields": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredShopperFields = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "returnUrl": + returnUrl = new Option(utf8JsonReader.GetString()); + break; + case "reusable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + reusable = new Option(utf8JsonReader.GetBoolean()); + break; + case "riskData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + riskData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "shopperLocale": + shopperLocale = new Option(utf8JsonReader.GetString()); + break; + case "shopperName": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperReference": + shopperReference = new Option(utf8JsonReader.GetString()); + break; + case "shopperStatement": + shopperStatement = new Option(utf8JsonReader.GetString()); + break; + case "showRemovePaymentMethodButton": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + showRemovePaymentMethodButton = new Option(utf8JsonReader.GetBoolean()); + break; + case "socialSecurityNumber": + socialSecurityNumber = new Option(utf8JsonReader.GetString()); + break; + case "splitCardFundingSources": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splitCardFundingSources = new Option(utf8JsonReader.GetBoolean()); + break; + case "splits": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "store": + store = new Option(utf8JsonReader.GetString()); + break; + case "storePaymentMethodMode": + string storePaymentMethodModeRawValue = utf8JsonReader.GetString(); + if (storePaymentMethodModeRawValue != null) + storePaymentMethodMode = new Option(PaymentLinkResponse.StorePaymentMethodModeEnumFromStringOrDefault(storePaymentMethodModeRawValue)); + break; + case "telephoneNumber": + telephoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "themeId": + themeId = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2RequestData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "updatedAt": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + updatedAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class PaymentLinkResponse.", nameof(amount)); + + if (!id.IsSet) + throw new ArgumentException("Property is required for class PaymentLinkResponse.", nameof(id)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentLinkResponse.", nameof(merchantAccount)); + + if (!reference.IsSet) + throw new ArgumentException("Property is required for class PaymentLinkResponse.", nameof(reference)); + + if (!status.IsSet) + throw new ArgumentException("Property is required for class PaymentLinkResponse.", nameof(status)); + + if (!url.IsSet) + throw new ArgumentException("Property is required for class PaymentLinkResponse.", nameof(url)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentLinkResponse."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class PaymentLinkResponse."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentLinkResponse."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentLinkResponse."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaymentLinkResponse."); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url), "Property is not nullable for class PaymentLinkResponse."); + + if (allowedPaymentMethods.IsSet && allowedPaymentMethods.Value == null) + throw new ArgumentNullException(nameof(allowedPaymentMethods), "Property is not nullable for class PaymentLinkResponse."); + + if (applicationInfo.IsSet && applicationInfo.Value == null) + throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentLinkResponse."); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class PaymentLinkResponse."); + + if (blockedPaymentMethods.IsSet && blockedPaymentMethods.Value == null) + throw new ArgumentNullException(nameof(blockedPaymentMethods), "Property is not nullable for class PaymentLinkResponse."); + + if (captureDelayHours.IsSet && captureDelayHours.Value == null) + throw new ArgumentNullException(nameof(captureDelayHours), "Property is not nullable for class PaymentLinkResponse."); + + if (countryCode.IsSet && countryCode.Value == null) + throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class PaymentLinkResponse."); + + if (dateOfBirth.IsSet && dateOfBirth.Value == null) + throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class PaymentLinkResponse."); + + if (deliverAt.IsSet && deliverAt.Value == null) + throw new ArgumentNullException(nameof(deliverAt), "Property is not nullable for class PaymentLinkResponse."); + + if (deliveryAddress.IsSet && deliveryAddress.Value == null) + throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class PaymentLinkResponse."); + + if (description.IsSet && description.Value == null) + throw new ArgumentNullException(nameof(description), "Property is not nullable for class PaymentLinkResponse."); + + if (expiresAt.IsSet && expiresAt.Value == null) + throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class PaymentLinkResponse."); + + if (fundOrigin.IsSet && fundOrigin.Value == null) + throw new ArgumentNullException(nameof(fundOrigin), "Property is not nullable for class PaymentLinkResponse."); + + if (fundRecipient.IsSet && fundRecipient.Value == null) + throw new ArgumentNullException(nameof(fundRecipient), "Property is not nullable for class PaymentLinkResponse."); + + if (installmentOptions.IsSet && installmentOptions.Value == null) + throw new ArgumentNullException(nameof(installmentOptions), "Property is not nullable for class PaymentLinkResponse."); + + if (lineItems.IsSet && lineItems.Value == null) + throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentLinkResponse."); + + if (manualCapture.IsSet && manualCapture.Value == null) + throw new ArgumentNullException(nameof(manualCapture), "Property is not nullable for class PaymentLinkResponse."); + + if (mcc.IsSet && mcc.Value == null) + throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class PaymentLinkResponse."); + + if (merchantOrderReference.IsSet && merchantOrderReference.Value == null) + throw new ArgumentNullException(nameof(merchantOrderReference), "Property is not nullable for class PaymentLinkResponse."); + + if (metadata.IsSet && metadata.Value == null) + throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class PaymentLinkResponse."); + + if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) + throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class PaymentLinkResponse."); + + if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) + throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class PaymentLinkResponse."); + + if (requiredShopperFields.IsSet && requiredShopperFields.Value == null) + throw new ArgumentNullException(nameof(requiredShopperFields), "Property is not nullable for class PaymentLinkResponse."); + + if (returnUrl.IsSet && returnUrl.Value == null) + throw new ArgumentNullException(nameof(returnUrl), "Property is not nullable for class PaymentLinkResponse."); + + if (reusable.IsSet && reusable.Value == null) + throw new ArgumentNullException(nameof(reusable), "Property is not nullable for class PaymentLinkResponse."); + + if (riskData.IsSet && riskData.Value == null) + throw new ArgumentNullException(nameof(riskData), "Property is not nullable for class PaymentLinkResponse."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class PaymentLinkResponse."); + + if (shopperLocale.IsSet && shopperLocale.Value == null) + throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class PaymentLinkResponse."); + + if (shopperName.IsSet && shopperName.Value == null) + throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class PaymentLinkResponse."); + + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class PaymentLinkResponse."); + + if (shopperStatement.IsSet && shopperStatement.Value == null) + throw new ArgumentNullException(nameof(shopperStatement), "Property is not nullable for class PaymentLinkResponse."); + + if (showRemovePaymentMethodButton.IsSet && showRemovePaymentMethodButton.Value == null) + throw new ArgumentNullException(nameof(showRemovePaymentMethodButton), "Property is not nullable for class PaymentLinkResponse."); + + if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) + throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class PaymentLinkResponse."); + + if (splitCardFundingSources.IsSet && splitCardFundingSources.Value == null) + throw new ArgumentNullException(nameof(splitCardFundingSources), "Property is not nullable for class PaymentLinkResponse."); + + if (splits.IsSet && splits.Value == null) + throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentLinkResponse."); + + if (store.IsSet && store.Value == null) + throw new ArgumentNullException(nameof(store), "Property is not nullable for class PaymentLinkResponse."); + + if (storePaymentMethodMode.IsSet && storePaymentMethodMode.Value == null) + throw new ArgumentNullException(nameof(storePaymentMethodMode), "Property is not nullable for class PaymentLinkResponse."); + + if (telephoneNumber.IsSet && telephoneNumber.Value == null) + throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class PaymentLinkResponse."); + + if (themeId.IsSet && themeId.Value == null) + throw new ArgumentNullException(nameof(themeId), "Property is not nullable for class PaymentLinkResponse."); + + if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) + throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class PaymentLinkResponse."); + + if (updatedAt.IsSet && updatedAt.Value == null) + throw new ArgumentNullException(nameof(updatedAt), "Property is not nullable for class PaymentLinkResponse."); + + return new PaymentLinkResponse(amount.Value, id.Value, merchantAccount.Value, reference.Value, status.Value.Value, url.Value, allowedPaymentMethods, applicationInfo, billingAddress, blockedPaymentMethods, captureDelayHours, countryCode, dateOfBirth, deliverAt, deliveryAddress, description, expiresAt, fundOrigin, fundRecipient, installmentOptions, lineItems, manualCapture, mcc, merchantOrderReference, metadata, platformChargebackLogic, recurringProcessingModel, requiredShopperFields, returnUrl, reusable, riskData, shopperEmail, shopperLocale, shopperName, shopperReference, shopperStatement, showRemovePaymentMethodButton, socialSecurityNumber, splitCardFundingSources, splits, store, storePaymentMethodMode, telephoneNumber, themeId, threeDS2RequestData, updatedAt); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentLinkResponse paymentLinkResponse, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, paymentLinkResponse, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentLinkResponse paymentLinkResponse, JsonSerializerOptions jsonSerializerOptions) + { + if (paymentLinkResponse.Amount == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.Amount), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.Id == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.Id), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.MerchantAccount), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.Reference == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.Reference), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.Url == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.Url), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.AllowedPaymentMethodsOption.IsSet && paymentLinkResponse.AllowedPaymentMethods == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.AllowedPaymentMethods), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.ApplicationInfoOption.IsSet && paymentLinkResponse.ApplicationInfo == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.ApplicationInfo), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.BillingAddressOption.IsSet && paymentLinkResponse.BillingAddress == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.BillingAddress), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.BlockedPaymentMethodsOption.IsSet && paymentLinkResponse.BlockedPaymentMethods == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.BlockedPaymentMethods), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.CountryCodeOption.IsSet && paymentLinkResponse.CountryCode == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.CountryCode), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.DeliveryAddressOption.IsSet && paymentLinkResponse.DeliveryAddress == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.DeliveryAddress), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.DescriptionOption.IsSet && paymentLinkResponse.Description == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.Description), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.FundOriginOption.IsSet && paymentLinkResponse.FundOrigin == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.FundOrigin), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.FundRecipientOption.IsSet && paymentLinkResponse.FundRecipient == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.FundRecipient), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.InstallmentOptionsOption.IsSet && paymentLinkResponse.InstallmentOptions == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.InstallmentOptions), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.LineItemsOption.IsSet && paymentLinkResponse.LineItems == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.LineItems), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.MccOption.IsSet && paymentLinkResponse.Mcc == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.Mcc), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.MerchantOrderReferenceOption.IsSet && paymentLinkResponse.MerchantOrderReference == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.MerchantOrderReference), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.MetadataOption.IsSet && paymentLinkResponse.Metadata == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.Metadata), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.PlatformChargebackLogicOption.IsSet && paymentLinkResponse.PlatformChargebackLogic == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.PlatformChargebackLogic), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.RequiredShopperFieldsOption.IsSet && paymentLinkResponse.RequiredShopperFields == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.RequiredShopperFields), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.ReturnUrlOption.IsSet && paymentLinkResponse.ReturnUrl == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.ReturnUrl), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.RiskDataOption.IsSet && paymentLinkResponse.RiskData == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.RiskData), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.ShopperEmailOption.IsSet && paymentLinkResponse.ShopperEmail == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.ShopperEmail), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.ShopperLocaleOption.IsSet && paymentLinkResponse.ShopperLocale == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.ShopperLocale), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.ShopperNameOption.IsSet && paymentLinkResponse.ShopperName == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.ShopperName), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.ShopperReferenceOption.IsSet && paymentLinkResponse.ShopperReference == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.ShopperReference), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.ShopperStatementOption.IsSet && paymentLinkResponse.ShopperStatement == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.ShopperStatement), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.SocialSecurityNumberOption.IsSet && paymentLinkResponse.SocialSecurityNumber == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.SocialSecurityNumber), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.SplitsOption.IsSet && paymentLinkResponse.Splits == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.Splits), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.StoreOption.IsSet && paymentLinkResponse.Store == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.Store), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.TelephoneNumberOption.IsSet && paymentLinkResponse.TelephoneNumber == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.TelephoneNumber), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.ThemeIdOption.IsSet && paymentLinkResponse.ThemeId == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.ThemeId), "Property is required for class PaymentLinkResponse."); + + if (paymentLinkResponse.ThreeDS2RequestDataOption.IsSet && paymentLinkResponse.ThreeDS2RequestData == null) + throw new ArgumentNullException(nameof(paymentLinkResponse.ThreeDS2RequestData), "Property is required for class PaymentLinkResponse."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, paymentLinkResponse.Amount, jsonSerializerOptions); + writer.WriteString("id", paymentLinkResponse.Id); + + writer.WriteString("merchantAccount", paymentLinkResponse.MerchantAccount); + + writer.WriteString("reference", paymentLinkResponse.Reference); + + var statusRawValue = PaymentLinkResponse.StatusEnumToJsonValue(paymentLinkResponse.Status); + writer.WriteString("status", statusRawValue); + writer.WriteString("url", paymentLinkResponse.Url); + + if (paymentLinkResponse.AllowedPaymentMethodsOption.IsSet) + { + writer.WritePropertyName("allowedPaymentMethods"); + JsonSerializer.Serialize(writer, paymentLinkResponse.AllowedPaymentMethods, jsonSerializerOptions); + } + if (paymentLinkResponse.ApplicationInfoOption.IsSet) + { + writer.WritePropertyName("applicationInfo"); + JsonSerializer.Serialize(writer, paymentLinkResponse.ApplicationInfo, jsonSerializerOptions); + } + if (paymentLinkResponse.BillingAddressOption.IsSet) + { + writer.WritePropertyName("billingAddress"); + JsonSerializer.Serialize(writer, paymentLinkResponse.BillingAddress, jsonSerializerOptions); + } + if (paymentLinkResponse.BlockedPaymentMethodsOption.IsSet) + { + writer.WritePropertyName("blockedPaymentMethods"); + JsonSerializer.Serialize(writer, paymentLinkResponse.BlockedPaymentMethods, jsonSerializerOptions); + } + if (paymentLinkResponse.CaptureDelayHoursOption.IsSet) + writer.WriteNumber("captureDelayHours", paymentLinkResponse.CaptureDelayHoursOption.Value.Value); + + if (paymentLinkResponse.CountryCodeOption.IsSet) + writer.WriteString("countryCode", paymentLinkResponse.CountryCode); + + if (paymentLinkResponse.DateOfBirthOption.IsSet) + writer.WriteString("dateOfBirth", paymentLinkResponse.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); + + if (paymentLinkResponse.DeliverAtOption.IsSet) + writer.WriteString("deliverAt", paymentLinkResponse.DeliverAtOption.Value.Value.ToString(DeliverAtFormat)); + + if (paymentLinkResponse.DeliveryAddressOption.IsSet) + { + writer.WritePropertyName("deliveryAddress"); + JsonSerializer.Serialize(writer, paymentLinkResponse.DeliveryAddress, jsonSerializerOptions); + } + if (paymentLinkResponse.DescriptionOption.IsSet) + writer.WriteString("description", paymentLinkResponse.Description); + + if (paymentLinkResponse.ExpiresAtOption.IsSet) + writer.WriteString("expiresAt", paymentLinkResponse.ExpiresAtOption.Value.Value.ToString(ExpiresAtFormat)); + + if (paymentLinkResponse.FundOriginOption.IsSet) + { + writer.WritePropertyName("fundOrigin"); + JsonSerializer.Serialize(writer, paymentLinkResponse.FundOrigin, jsonSerializerOptions); + } + if (paymentLinkResponse.FundRecipientOption.IsSet) + { + writer.WritePropertyName("fundRecipient"); + JsonSerializer.Serialize(writer, paymentLinkResponse.FundRecipient, jsonSerializerOptions); + } + if (paymentLinkResponse.InstallmentOptionsOption.IsSet) + { + writer.WritePropertyName("installmentOptions"); + JsonSerializer.Serialize(writer, paymentLinkResponse.InstallmentOptions, jsonSerializerOptions); + } + if (paymentLinkResponse.LineItemsOption.IsSet) + { + writer.WritePropertyName("lineItems"); + JsonSerializer.Serialize(writer, paymentLinkResponse.LineItems, jsonSerializerOptions); + } + if (paymentLinkResponse.ManualCaptureOption.IsSet) + writer.WriteBoolean("manualCapture", paymentLinkResponse.ManualCaptureOption.Value.Value); + + if (paymentLinkResponse.MccOption.IsSet) + writer.WriteString("mcc", paymentLinkResponse.Mcc); + + if (paymentLinkResponse.MerchantOrderReferenceOption.IsSet) + writer.WriteString("merchantOrderReference", paymentLinkResponse.MerchantOrderReference); + + if (paymentLinkResponse.MetadataOption.IsSet) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, paymentLinkResponse.Metadata, jsonSerializerOptions); + } + if (paymentLinkResponse.PlatformChargebackLogicOption.IsSet) + { + writer.WritePropertyName("platformChargebackLogic"); + JsonSerializer.Serialize(writer, paymentLinkResponse.PlatformChargebackLogic, jsonSerializerOptions); + } + var recurringProcessingModelRawValue = PaymentLinkResponse.RecurringProcessingModelEnumToJsonValue(paymentLinkResponse.RecurringProcessingModelOption.Value.Value); + writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); + if (paymentLinkResponse.RequiredShopperFieldsOption.IsSet) + { + writer.WritePropertyName("requiredShopperFields"); + JsonSerializer.Serialize(writer, paymentLinkResponse.RequiredShopperFields, jsonSerializerOptions); + } + if (paymentLinkResponse.ReturnUrlOption.IsSet) + writer.WriteString("returnUrl", paymentLinkResponse.ReturnUrl); + + if (paymentLinkResponse.ReusableOption.IsSet) + writer.WriteBoolean("reusable", paymentLinkResponse.ReusableOption.Value.Value); + + if (paymentLinkResponse.RiskDataOption.IsSet) + { + writer.WritePropertyName("riskData"); + JsonSerializer.Serialize(writer, paymentLinkResponse.RiskData, jsonSerializerOptions); + } + if (paymentLinkResponse.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", paymentLinkResponse.ShopperEmail); + + if (paymentLinkResponse.ShopperLocaleOption.IsSet) + writer.WriteString("shopperLocale", paymentLinkResponse.ShopperLocale); + + if (paymentLinkResponse.ShopperNameOption.IsSet) + { + writer.WritePropertyName("shopperName"); + JsonSerializer.Serialize(writer, paymentLinkResponse.ShopperName, jsonSerializerOptions); + } + if (paymentLinkResponse.ShopperReferenceOption.IsSet) + writer.WriteString("shopperReference", paymentLinkResponse.ShopperReference); + + if (paymentLinkResponse.ShopperStatementOption.IsSet) + writer.WriteString("shopperStatement", paymentLinkResponse.ShopperStatement); + + if (paymentLinkResponse.ShowRemovePaymentMethodButtonOption.IsSet) + writer.WriteBoolean("showRemovePaymentMethodButton", paymentLinkResponse.ShowRemovePaymentMethodButtonOption.Value.Value); + + if (paymentLinkResponse.SocialSecurityNumberOption.IsSet) + writer.WriteString("socialSecurityNumber", paymentLinkResponse.SocialSecurityNumber); + + if (paymentLinkResponse.SplitCardFundingSourcesOption.IsSet) + writer.WriteBoolean("splitCardFundingSources", paymentLinkResponse.SplitCardFundingSourcesOption.Value.Value); + + if (paymentLinkResponse.SplitsOption.IsSet) + { + writer.WritePropertyName("splits"); + JsonSerializer.Serialize(writer, paymentLinkResponse.Splits, jsonSerializerOptions); + } + if (paymentLinkResponse.StoreOption.IsSet) + writer.WriteString("store", paymentLinkResponse.Store); + + var storePaymentMethodModeRawValue = PaymentLinkResponse.StorePaymentMethodModeEnumToJsonValue(paymentLinkResponse.StorePaymentMethodModeOption.Value.Value); + writer.WriteString("storePaymentMethodMode", storePaymentMethodModeRawValue); + if (paymentLinkResponse.TelephoneNumberOption.IsSet) + writer.WriteString("telephoneNumber", paymentLinkResponse.TelephoneNumber); + + if (paymentLinkResponse.ThemeIdOption.IsSet) + writer.WriteString("themeId", paymentLinkResponse.ThemeId); + + if (paymentLinkResponse.ThreeDS2RequestDataOption.IsSet) + { + writer.WritePropertyName("threeDS2RequestData"); + JsonSerializer.Serialize(writer, paymentLinkResponse.ThreeDS2RequestData, jsonSerializerOptions); + } + if (paymentLinkResponse.UpdatedAtOption.IsSet) + writer.WriteString("updatedAt", paymentLinkResponse.UpdatedAtOption.Value.Value.ToString(UpdatedAtFormat)); + } + } } diff --git a/Adyen/Model/Checkout/PaymentMethod.cs b/Adyen/Model/Checkout/PaymentMethod.cs index 2e34268ad..74ef075b5 100644 --- a/Adyen/Model/Checkout/PaymentMethod.cs +++ b/Adyen/Model/Checkout/PaymentMethod.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,140 +14,257 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentMethod /// - [DataContract(Name = "PaymentMethod")] - public partial class PaymentMethod : IEquatable, IValidatableObject + public partial class PaymentMethod : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// A list of apps for this payment method. + /// Brand for the selected gift card. For example: plastix, hmclub. + /// List of possible brands. For example: visa, mc. + /// The configuration of the payment method. + /// The funding source of the payment method. + /// group + /// All input details to be provided to complete the payment with this payment method. + /// A list of issuers for this payment method. + /// The displayable name of this payment method. + /// The unique payment method code. + [JsonConstructor] + public PaymentMethod(Option> apps = default, Option brand = default, Option> brands = default, Option> varConfiguration = default, Option fundingSource = default, Option group = default, Option> inputDetails = default, Option> issuers = default, Option name = default, Option type = default) + { + AppsOption = apps; + BrandOption = brand; + BrandsOption = brands; + VarConfigurationOption = varConfiguration; + FundingSourceOption = fundingSource; + GroupOption = group; + InputDetailsOption = inputDetails; + IssuersOption = issuers; + NameOption = name; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The funding source of the payment method. /// /// The funding source of the payment method. - [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// - [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// - [EnumMember(Value = "debit")] Debit = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static FundingSourceEnum FundingSourceEnumFromString(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) + { + if (value == FundingSourceEnum.Credit) + return "credit"; + + if (value == FundingSourceEnum.Debit) + return "debit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// The funding source of the payment method. /// /// The funding source of the payment method. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public FundingSourceEnum? FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of Apps /// - /// A list of apps for this payment method.. - /// Brand for the selected gift card. For example: plastix, hmclub.. - /// List of possible brands. For example: visa, mc.. - /// The configuration of the payment method.. - /// The funding source of the payment method.. - /// group. - /// All input details to be provided to complete the payment with this payment method.. - /// A list of issuers for this payment method.. - /// The displayable name of this payment method.. - /// The unique payment method code.. - public PaymentMethod(List apps = default(List), string brand = default(string), List brands = default(List), Dictionary configuration = default(Dictionary), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), PaymentMethodGroup group = default(PaymentMethodGroup), List inputDetails = default(List), List issuers = default(List), string name = default(string), string type = default(string)) - { - this.Apps = apps; - this.Brand = brand; - this.Brands = brands; - this._Configuration = configuration; - this.FundingSource = fundingSource; - this.Group = group; - this.InputDetails = inputDetails; - this.Issuers = issuers; - this.Name = name; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AppsOption { get; private set; } /// /// A list of apps for this payment method. /// /// A list of apps for this payment method. - [DataMember(Name = "apps", EmitDefaultValue = false)] - public List Apps { get; set; } + [JsonPropertyName("apps")] + public List Apps { get { return this.AppsOption; } set { this.AppsOption = new Option>(value); } } + + /// + /// Used to track the state of Brand + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandOption { get; private set; } /// /// Brand for the selected gift card. For example: plastix, hmclub. /// /// Brand for the selected gift card. For example: plastix, hmclub. - [DataMember(Name = "brand", EmitDefaultValue = false)] - public string Brand { get; set; } + [JsonPropertyName("brand")] + public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } + + /// + /// Used to track the state of Brands + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> BrandsOption { get; private set; } /// /// List of possible brands. For example: visa, mc. /// /// List of possible brands. For example: visa, mc. - [DataMember(Name = "brands", EmitDefaultValue = false)] - public List Brands { get; set; } + [JsonPropertyName("brands")] + public List Brands { get { return this.BrandsOption; } set { this.BrandsOption = new Option>(value); } } + + /// + /// Used to track the state of VarConfiguration + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> VarConfigurationOption { get; private set; } /// /// The configuration of the payment method. /// /// The configuration of the payment method. - [DataMember(Name = "configuration", EmitDefaultValue = false)] - public Dictionary _Configuration { get; set; } + [JsonPropertyName("configuration")] + public Dictionary VarConfiguration { get { return this.VarConfigurationOption; } set { this.VarConfigurationOption = new Option>(value); } } + + /// + /// Used to track the state of Group + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option GroupOption { get; private set; } /// /// Gets or Sets Group /// - [DataMember(Name = "group", EmitDefaultValue = false)] - public PaymentMethodGroup Group { get; set; } + [JsonPropertyName("group")] + public PaymentMethodGroup Group { get { return this.GroupOption; } set { this.GroupOption = new Option(value); } } + + /// + /// Used to track the state of InputDetails + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> InputDetailsOption { get; private set; } /// /// All input details to be provided to complete the payment with this payment method. /// /// All input details to be provided to complete the payment with this payment method. - [DataMember(Name = "inputDetails", EmitDefaultValue = false)] - [Obsolete("")] - public List InputDetails { get; set; } + [JsonPropertyName("inputDetails")] + [Obsolete] + public List InputDetails { get { return this.InputDetailsOption; } set { this.InputDetailsOption = new Option>(value); } } + + /// + /// Used to track the state of Issuers + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> IssuersOption { get; private set; } /// /// A list of issuers for this payment method. /// /// A list of issuers for this payment method. - [DataMember(Name = "issuers", EmitDefaultValue = false)] - public List Issuers { get; set; } + [JsonPropertyName("issuers")] + public List Issuers { get { return this.IssuersOption; } set { this.IssuersOption = new Option>(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } /// /// The displayable name of this payment method. /// /// The displayable name of this payment method. - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The unique payment method code. /// /// The unique payment method code. - [DataMember(Name = "type", EmitDefaultValue = false)] - public string Type { get; set; } + [JsonPropertyName("type")] + public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -161,7 +277,7 @@ public override string ToString() sb.Append(" Apps: ").Append(Apps).Append("\n"); sb.Append(" Brand: ").Append(Brand).Append("\n"); sb.Append(" Brands: ").Append(Brands).Append("\n"); - sb.Append(" _Configuration: ").Append(_Configuration).Append("\n"); + sb.Append(" VarConfiguration: ").Append(VarConfiguration).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); sb.Append(" Group: ").Append(Group).Append("\n"); sb.Append(" InputDetails: ").Append(InputDetails).Append("\n"); @@ -173,150 +289,232 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentMethodJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentMethod Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentMethod); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentMethod instances are equal - /// - /// Instance of PaymentMethod to be compared - /// Boolean - public bool Equals(PaymentMethod input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option> apps = default; + Option brand = default; + Option> brands = default; + Option> varConfiguration = default; + Option fundingSource = default; + Option group = default; + Option> inputDetails = default; + Option> issuers = default; + Option name = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "apps": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + apps = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "brand": + brand = new Option(utf8JsonReader.GetString()); + break; + case "brands": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + brands = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "configuration": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varConfiguration = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fundingSource": + string fundingSourceRawValue = utf8JsonReader.GetString(); + if (fundingSourceRawValue != null) + fundingSource = new Option(PaymentMethod.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); + break; + case "group": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + group = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "inputDetails": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + inputDetails = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "issuers": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + issuers = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Apps == input.Apps || - this.Apps != null && - input.Apps != null && - this.Apps.SequenceEqual(input.Apps) - ) && - ( - this.Brand == input.Brand || - (this.Brand != null && - this.Brand.Equals(input.Brand)) - ) && - ( - this.Brands == input.Brands || - this.Brands != null && - input.Brands != null && - this.Brands.SequenceEqual(input.Brands) - ) && - ( - this._Configuration == input._Configuration || - this._Configuration != null && - input._Configuration != null && - this._Configuration.SequenceEqual(input._Configuration) - ) && - ( - this.FundingSource == input.FundingSource || - this.FundingSource.Equals(input.FundingSource) - ) && - ( - this.Group == input.Group || - (this.Group != null && - this.Group.Equals(input.Group)) - ) && - ( - this.InputDetails == input.InputDetails || - this.InputDetails != null && - input.InputDetails != null && - this.InputDetails.SequenceEqual(input.InputDetails) - ) && - ( - this.Issuers == input.Issuers || - this.Issuers != null && - input.Issuers != null && - this.Issuers.SequenceEqual(input.Issuers) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ); + + if (apps.IsSet && apps.Value == null) + throw new ArgumentNullException(nameof(apps), "Property is not nullable for class PaymentMethod."); + + if (brand.IsSet && brand.Value == null) + throw new ArgumentNullException(nameof(brand), "Property is not nullable for class PaymentMethod."); + + if (brands.IsSet && brands.Value == null) + throw new ArgumentNullException(nameof(brands), "Property is not nullable for class PaymentMethod."); + + if (varConfiguration.IsSet && varConfiguration.Value == null) + throw new ArgumentNullException(nameof(varConfiguration), "Property is not nullable for class PaymentMethod."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class PaymentMethod."); + + if (group.IsSet && group.Value == null) + throw new ArgumentNullException(nameof(group), "Property is not nullable for class PaymentMethod."); + + if (inputDetails.IsSet && inputDetails.Value == null) + throw new ArgumentNullException(nameof(inputDetails), "Property is not nullable for class PaymentMethod."); + + if (issuers.IsSet && issuers.Value == null) + throw new ArgumentNullException(nameof(issuers), "Property is not nullable for class PaymentMethod."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class PaymentMethod."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PaymentMethod."); + + return new PaymentMethod(apps, brand, brands, varConfiguration, fundingSource, group, inputDetails, issuers, name, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentMethod paymentMethod, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Apps != null) - { - hashCode = (hashCode * 59) + this.Apps.GetHashCode(); - } - if (this.Brand != null) - { - hashCode = (hashCode * 59) + this.Brand.GetHashCode(); - } - if (this.Brands != null) - { - hashCode = (hashCode * 59) + this.Brands.GetHashCode(); - } - if (this._Configuration != null) - { - hashCode = (hashCode * 59) + this._Configuration.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - if (this.Group != null) - { - hashCode = (hashCode * 59) + this.Group.GetHashCode(); - } - if (this.InputDetails != null) - { - hashCode = (hashCode * 59) + this.InputDetails.GetHashCode(); - } - if (this.Issuers != null) - { - hashCode = (hashCode * 59) + this.Issuers.GetHashCode(); - } - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentMethod, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentMethod paymentMethod, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentMethod.AppsOption.IsSet && paymentMethod.Apps == null) + throw new ArgumentNullException(nameof(paymentMethod.Apps), "Property is required for class PaymentMethod."); + + if (paymentMethod.BrandOption.IsSet && paymentMethod.Brand == null) + throw new ArgumentNullException(nameof(paymentMethod.Brand), "Property is required for class PaymentMethod."); + + if (paymentMethod.BrandsOption.IsSet && paymentMethod.Brands == null) + throw new ArgumentNullException(nameof(paymentMethod.Brands), "Property is required for class PaymentMethod."); + + if (paymentMethod.VarConfigurationOption.IsSet && paymentMethod.VarConfiguration == null) + throw new ArgumentNullException(nameof(paymentMethod.VarConfiguration), "Property is required for class PaymentMethod."); + + if (paymentMethod.GroupOption.IsSet && paymentMethod.Group == null) + throw new ArgumentNullException(nameof(paymentMethod.Group), "Property is required for class PaymentMethod."); + + if (paymentMethod.InputDetailsOption.IsSet && paymentMethod.InputDetails == null) + throw new ArgumentNullException(nameof(paymentMethod.InputDetails), "Property is required for class PaymentMethod."); + + if (paymentMethod.IssuersOption.IsSet && paymentMethod.Issuers == null) + throw new ArgumentNullException(nameof(paymentMethod.Issuers), "Property is required for class PaymentMethod."); + + if (paymentMethod.NameOption.IsSet && paymentMethod.Name == null) + throw new ArgumentNullException(nameof(paymentMethod.Name), "Property is required for class PaymentMethod."); + + if (paymentMethod.TypeOption.IsSet && paymentMethod.Type == null) + throw new ArgumentNullException(nameof(paymentMethod.Type), "Property is required for class PaymentMethod."); + + if (paymentMethod.AppsOption.IsSet) + { + writer.WritePropertyName("apps"); + JsonSerializer.Serialize(writer, paymentMethod.Apps, jsonSerializerOptions); + } + if (paymentMethod.BrandOption.IsSet) + writer.WriteString("brand", paymentMethod.Brand); + + if (paymentMethod.BrandsOption.IsSet) + { + writer.WritePropertyName("brands"); + JsonSerializer.Serialize(writer, paymentMethod.Brands, jsonSerializerOptions); + } + if (paymentMethod.VarConfigurationOption.IsSet) + { + writer.WritePropertyName("configuration"); + JsonSerializer.Serialize(writer, paymentMethod.VarConfiguration, jsonSerializerOptions); + } + var fundingSourceRawValue = PaymentMethod.FundingSourceEnumToJsonValue(paymentMethod.FundingSourceOption.Value.Value); + writer.WriteString("fundingSource", fundingSourceRawValue); + if (paymentMethod.GroupOption.IsSet) + { + writer.WritePropertyName("group"); + JsonSerializer.Serialize(writer, paymentMethod.Group, jsonSerializerOptions); + } + if (paymentMethod.InputDetailsOption.IsSet) + { + writer.WritePropertyName("inputDetails"); + JsonSerializer.Serialize(writer, paymentMethod.InputDetails, jsonSerializerOptions); + } + if (paymentMethod.IssuersOption.IsSet) + { + writer.WritePropertyName("issuers"); + JsonSerializer.Serialize(writer, paymentMethod.Issuers, jsonSerializerOptions); + } + if (paymentMethod.NameOption.IsSet) + writer.WriteString("name", paymentMethod.Name); + + if (paymentMethod.TypeOption.IsSet) + writer.WriteString("type", paymentMethod.Type); } } - } diff --git a/Adyen/Model/Checkout/PaymentMethodGroup.cs b/Adyen/Model/Checkout/PaymentMethodGroup.cs index 4feff3ada..1672f2cce 100644 --- a/Adyen/Model/Checkout/PaymentMethodGroup.cs +++ b/Adyen/Model/Checkout/PaymentMethodGroup.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,56 +14,78 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentMethodGroup /// - [DataContract(Name = "PaymentMethodGroup")] - public partial class PaymentMethodGroup : IEquatable, IValidatableObject + public partial class PaymentMethodGroup : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The name of the group.. - /// Echo data to be used if the payment method is displayed as part of this group.. - /// The unique code of the group.. - public PaymentMethodGroup(string name = default(string), string paymentMethodData = default(string), string type = default(string)) + /// The name of the group. + /// Echo data to be used if the payment method is displayed as part of this group. + /// The unique code of the group. + [JsonConstructor] + public PaymentMethodGroup(Option name = default, Option paymentMethodData = default, Option type = default) { - this.Name = name; - this.PaymentMethodData = paymentMethodData; - this.Type = type; + NameOption = name; + PaymentMethodDataOption = paymentMethodData; + TypeOption = type; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + /// /// The name of the group. /// /// The name of the group. - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethodData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodDataOption { get; private set; } /// /// Echo data to be used if the payment method is displayed as part of this group. /// /// Echo data to be used if the payment method is displayed as part of this group. - [DataMember(Name = "paymentMethodData", EmitDefaultValue = false)] - public string PaymentMethodData { get; set; } + [JsonPropertyName("paymentMethodData")] + public string PaymentMethodData { get { return this.PaymentMethodDataOption; } set { this.PaymentMethodDataOption = new Option(value); } } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The unique code of the group. /// /// The unique code of the group. - [DataMember(Name = "type", EmitDefaultValue = false)] - public string Type { get; set; } + [JsonPropertyName("type")] + public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -82,86 +103,125 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentMethodGroupJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentMethodGroup Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentMethodGroup); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentMethodGroup instances are equal - /// - /// Instance of PaymentMethodGroup to be compared - /// Boolean - public bool Equals(PaymentMethodGroup input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option name = default; + Option paymentMethodData = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethodData": + paymentMethodData = new Option(utf8JsonReader.GetString()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.PaymentMethodData == input.PaymentMethodData || - (this.PaymentMethodData != null && - this.PaymentMethodData.Equals(input.PaymentMethodData)) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class PaymentMethodGroup."); + + if (paymentMethodData.IsSet && paymentMethodData.Value == null) + throw new ArgumentNullException(nameof(paymentMethodData), "Property is not nullable for class PaymentMethodGroup."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PaymentMethodGroup."); + + return new PaymentMethodGroup(name, paymentMethodData, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentMethodGroup paymentMethodGroup, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.PaymentMethodData != null) - { - hashCode = (hashCode * 59) + this.PaymentMethodData.GetHashCode(); - } - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentMethodGroup, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentMethodGroup paymentMethodGroup, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentMethodGroup.NameOption.IsSet && paymentMethodGroup.Name == null) + throw new ArgumentNullException(nameof(paymentMethodGroup.Name), "Property is required for class PaymentMethodGroup."); + + if (paymentMethodGroup.PaymentMethodDataOption.IsSet && paymentMethodGroup.PaymentMethodData == null) + throw new ArgumentNullException(nameof(paymentMethodGroup.PaymentMethodData), "Property is required for class PaymentMethodGroup."); + + if (paymentMethodGroup.TypeOption.IsSet && paymentMethodGroup.Type == null) + throw new ArgumentNullException(nameof(paymentMethodGroup.Type), "Property is required for class PaymentMethodGroup."); + + if (paymentMethodGroup.NameOption.IsSet) + writer.WriteString("name", paymentMethodGroup.Name); + + if (paymentMethodGroup.PaymentMethodDataOption.IsSet) + writer.WriteString("paymentMethodData", paymentMethodGroup.PaymentMethodData); + + if (paymentMethodGroup.TypeOption.IsSet) + writer.WriteString("type", paymentMethodGroup.Type); } } - } diff --git a/Adyen/Model/Checkout/PaymentMethodIssuer.cs b/Adyen/Model/Checkout/PaymentMethodIssuer.cs index 82fae51a2..5d1ec5950 100644 --- a/Adyen/Model/Checkout/PaymentMethodIssuer.cs +++ b/Adyen/Model/Checkout/PaymentMethodIssuer.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,62 +14,65 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentMethodIssuer /// - [DataContract(Name = "PaymentMethodIssuer")] - public partial class PaymentMethodIssuer : IEquatable, IValidatableObject + public partial class PaymentMethodIssuer : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected PaymentMethodIssuer() { } - /// - /// Initializes a new instance of the class. - /// - /// A boolean value indicating whether this issuer is unavailable. Can be `true` whenever the issuer is offline. (default to false). - /// The unique identifier of this issuer, to submit in requests to /payments. (required). - /// A localized name of the issuer. (required). - public PaymentMethodIssuer(bool? disabled = false, string id = default(string), string name = default(string)) + /// The unique identifier of this issuer, to submit in requests to /payments. + /// A localized name of the issuer. + /// A boolean value indicating whether this issuer is unavailable. Can be `true` whenever the issuer is offline. (default to false) + [JsonConstructor] + public PaymentMethodIssuer(string id, string name, Option disabled = default) { - this.Id = id; - this.Name = name; - this.Disabled = disabled; + Id = id; + Name = name; + DisabledOption = disabled; + OnCreated(); } - /// - /// A boolean value indicating whether this issuer is unavailable. Can be `true` whenever the issuer is offline. - /// - /// A boolean value indicating whether this issuer is unavailable. Can be `true` whenever the issuer is offline. - [DataMember(Name = "disabled", EmitDefaultValue = false)] - public bool? Disabled { get; set; } + partial void OnCreated(); /// /// The unique identifier of this issuer, to submit in requests to /payments. /// /// The unique identifier of this issuer, to submit in requests to /payments. - [DataMember(Name = "id", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("id")] public string Id { get; set; } /// /// A localized name of the issuer. /// /// A localized name of the issuer. - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("name")] public string Name { get; set; } + /// + /// Used to track the state of Disabled + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DisabledOption { get; private set; } + + /// + /// A boolean value indicating whether this issuer is unavailable. Can be `true` whenever the issuer is offline. + /// + /// A boolean value indicating whether this issuer is unavailable. Can be `true` whenever the issuer is offline. + [JsonPropertyName("disabled")] + public bool? Disabled { get { return this.DisabledOption; } set { this.DisabledOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -79,90 +81,135 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentMethodIssuer {\n"); - sb.Append(" Disabled: ").Append(Disabled).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Disabled: ").Append(Disabled).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentMethodIssuerJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentMethodIssuer Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentMethodIssuer); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentMethodIssuer instances are equal - /// - /// Instance of PaymentMethodIssuer to be compared - /// Boolean - public bool Equals(PaymentMethodIssuer input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option id = default; + Option name = default; + Option disabled = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "disabled": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + disabled = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } } - return - ( - this.Disabled == input.Disabled || - this.Disabled.Equals(input.Disabled) - ) && - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ); + + if (!id.IsSet) + throw new ArgumentException("Property is required for class PaymentMethodIssuer.", nameof(id)); + + if (!name.IsSet) + throw new ArgumentException("Property is required for class PaymentMethodIssuer.", nameof(name)); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class PaymentMethodIssuer."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class PaymentMethodIssuer."); + + if (disabled.IsSet && disabled.Value == null) + throw new ArgumentNullException(nameof(disabled), "Property is not nullable for class PaymentMethodIssuer."); + + return new PaymentMethodIssuer(id.Value, name.Value, disabled); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentMethodIssuer paymentMethodIssuer, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Disabled.GetHashCode(); - if (this.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentMethodIssuer, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentMethodIssuer paymentMethodIssuer, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentMethodIssuer.Id == null) + throw new ArgumentNullException(nameof(paymentMethodIssuer.Id), "Property is required for class PaymentMethodIssuer."); + + if (paymentMethodIssuer.Name == null) + throw new ArgumentNullException(nameof(paymentMethodIssuer.Name), "Property is required for class PaymentMethodIssuer."); + + writer.WriteString("id", paymentMethodIssuer.Id); + + writer.WriteString("name", paymentMethodIssuer.Name); + + if (paymentMethodIssuer.DisabledOption.IsSet) + writer.WriteBoolean("disabled", paymentMethodIssuer.DisabledOption.Value.Value); } } - } diff --git a/Adyen/Model/Checkout/PaymentMethodToStore.cs b/Adyen/Model/Checkout/PaymentMethodToStore.cs index a42d81f91..8e5cc9346 100644 --- a/Adyen/Model/Checkout/PaymentMethodToStore.cs +++ b/Adyen/Model/Checkout/PaymentMethodToStore.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,137 +14,222 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentMethodToStore /// - [DataContract(Name = "PaymentMethodToStore")] - public partial class PaymentMethodToStore : IEquatable, IValidatableObject + public partial class PaymentMethodToStore : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Secondary brand of the card. For example: **plastix**, **hmclub**.. - /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. - /// The encrypted card.. - /// The encrypted card number.. - /// The encrypted card expiry month.. - /// The encrypted card expiry year.. - /// The encrypted card verification code.. - /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. - /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. - /// The name of the card holder.. - /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. - /// Set to **scheme**.. - public PaymentMethodToStore(string brand = default(string), string cvc = default(string), string encryptedCard = default(string), string encryptedCardNumber = default(string), string encryptedExpiryMonth = default(string), string encryptedExpiryYear = default(string), string encryptedSecurityCode = default(string), string expiryMonth = default(string), string expiryYear = default(string), string holderName = default(string), string number = default(string), string type = default(string)) + /// Secondary brand of the card. For example: **plastix**, **hmclub**. + /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + /// The encrypted card. + /// The encrypted card number. + /// The encrypted card expiry month. + /// The encrypted card expiry year. + /// The encrypted card verification code. + /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + /// The name of the card holder. + /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + /// Set to **scheme**. + [JsonConstructor] + public PaymentMethodToStore(Option brand = default, Option cvc = default, Option encryptedCard = default, Option encryptedCardNumber = default, Option encryptedExpiryMonth = default, Option encryptedExpiryYear = default, Option encryptedSecurityCode = default, Option expiryMonth = default, Option expiryYear = default, Option holderName = default, Option number = default, Option type = default) { - this.Brand = brand; - this.Cvc = cvc; - this.EncryptedCard = encryptedCard; - this.EncryptedCardNumber = encryptedCardNumber; - this.EncryptedExpiryMonth = encryptedExpiryMonth; - this.EncryptedExpiryYear = encryptedExpiryYear; - this.EncryptedSecurityCode = encryptedSecurityCode; - this.ExpiryMonth = expiryMonth; - this.ExpiryYear = expiryYear; - this.HolderName = holderName; - this.Number = number; - this.Type = type; + BrandOption = brand; + CvcOption = cvc; + EncryptedCardOption = encryptedCard; + EncryptedCardNumberOption = encryptedCardNumber; + EncryptedExpiryMonthOption = encryptedExpiryMonth; + EncryptedExpiryYearOption = encryptedExpiryYear; + EncryptedSecurityCodeOption = encryptedSecurityCode; + ExpiryMonthOption = expiryMonth; + ExpiryYearOption = expiryYear; + HolderNameOption = holderName; + NumberOption = number; + TypeOption = type; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Brand + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandOption { get; private set; } + /// /// Secondary brand of the card. For example: **plastix**, **hmclub**. /// /// Secondary brand of the card. For example: **plastix**, **hmclub**. - [DataMember(Name = "brand", EmitDefaultValue = false)] - public string Brand { get; set; } + [JsonPropertyName("brand")] + public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } + + /// + /// Used to track the state of Cvc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CvcOption { get; private set; } /// /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [DataMember(Name = "cvc", EmitDefaultValue = false)] - public string Cvc { get; set; } + [JsonPropertyName("cvc")] + public string Cvc { get { return this.CvcOption; } set { this.CvcOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedCard + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedCardOption { get; private set; } /// /// The encrypted card. /// /// The encrypted card. - [DataMember(Name = "encryptedCard", EmitDefaultValue = false)] - public string EncryptedCard { get; set; } + [JsonPropertyName("encryptedCard")] + public string EncryptedCard { get { return this.EncryptedCardOption; } set { this.EncryptedCardOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedCardNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedCardNumberOption { get; private set; } /// /// The encrypted card number. /// /// The encrypted card number. - [DataMember(Name = "encryptedCardNumber", EmitDefaultValue = false)] - public string EncryptedCardNumber { get; set; } + [JsonPropertyName("encryptedCardNumber")] + public string EncryptedCardNumber { get { return this.EncryptedCardNumberOption; } set { this.EncryptedCardNumberOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedExpiryMonth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedExpiryMonthOption { get; private set; } /// /// The encrypted card expiry month. /// /// The encrypted card expiry month. - [DataMember(Name = "encryptedExpiryMonth", EmitDefaultValue = false)] - public string EncryptedExpiryMonth { get; set; } + [JsonPropertyName("encryptedExpiryMonth")] + public string EncryptedExpiryMonth { get { return this.EncryptedExpiryMonthOption; } set { this.EncryptedExpiryMonthOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedExpiryYear + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedExpiryYearOption { get; private set; } /// /// The encrypted card expiry year. /// /// The encrypted card expiry year. - [DataMember(Name = "encryptedExpiryYear", EmitDefaultValue = false)] - public string EncryptedExpiryYear { get; set; } + [JsonPropertyName("encryptedExpiryYear")] + public string EncryptedExpiryYear { get { return this.EncryptedExpiryYearOption; } set { this.EncryptedExpiryYearOption = new Option(value); } } + + /// + /// Used to track the state of EncryptedSecurityCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EncryptedSecurityCodeOption { get; private set; } /// /// The encrypted card verification code. /// /// The encrypted card verification code. - [DataMember(Name = "encryptedSecurityCode", EmitDefaultValue = false)] - public string EncryptedSecurityCode { get; set; } + [JsonPropertyName("encryptedSecurityCode")] + public string EncryptedSecurityCode { get { return this.EncryptedSecurityCodeOption; } set { this.EncryptedSecurityCodeOption = new Option(value); } } + + /// + /// Used to track the state of ExpiryMonth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiryMonthOption { get; private set; } /// /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [DataMember(Name = "expiryMonth", EmitDefaultValue = false)] - public string ExpiryMonth { get; set; } + [JsonPropertyName("expiryMonth")] + public string ExpiryMonth { get { return this.ExpiryMonthOption; } set { this.ExpiryMonthOption = new Option(value); } } + + /// + /// Used to track the state of ExpiryYear + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiryYearOption { get; private set; } /// /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [DataMember(Name = "expiryYear", EmitDefaultValue = false)] - public string ExpiryYear { get; set; } + [JsonPropertyName("expiryYear")] + public string ExpiryYear { get { return this.ExpiryYearOption; } set { this.ExpiryYearOption = new Option(value); } } + + /// + /// Used to track the state of HolderName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option HolderNameOption { get; private set; } /// /// The name of the card holder. /// /// The name of the card holder. - [DataMember(Name = "holderName", EmitDefaultValue = false)] - public string HolderName { get; set; } + [JsonPropertyName("holderName")] + public string HolderName { get { return this.HolderNameOption; } set { this.HolderNameOption = new Option(value); } } + + /// + /// Used to track the state of Number + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NumberOption { get; private set; } /// /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [DataMember(Name = "number", EmitDefaultValue = false)] - public string Number { get; set; } + [JsonPropertyName("number")] + public string Number { get { return this.NumberOption; } set { this.NumberOption = new Option(value); } } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// Set to **scheme**. /// /// Set to **scheme**. - [DataMember(Name = "type", EmitDefaultValue = false)] - public string Type { get; set; } + [JsonPropertyName("type")] + public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -171,198 +255,273 @@ public override string ToString() return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PaymentMethodToStore); - } - - /// - /// Returns true if PaymentMethodToStore instances are equal - /// - /// Instance of PaymentMethodToStore to be compared - /// Boolean - public bool Equals(PaymentMethodToStore input) - { - if (input == null) - { - return false; - } - return - ( - this.Brand == input.Brand || - (this.Brand != null && - this.Brand.Equals(input.Brand)) - ) && - ( - this.Cvc == input.Cvc || - (this.Cvc != null && - this.Cvc.Equals(input.Cvc)) - ) && - ( - this.EncryptedCard == input.EncryptedCard || - (this.EncryptedCard != null && - this.EncryptedCard.Equals(input.EncryptedCard)) - ) && - ( - this.EncryptedCardNumber == input.EncryptedCardNumber || - (this.EncryptedCardNumber != null && - this.EncryptedCardNumber.Equals(input.EncryptedCardNumber)) - ) && - ( - this.EncryptedExpiryMonth == input.EncryptedExpiryMonth || - (this.EncryptedExpiryMonth != null && - this.EncryptedExpiryMonth.Equals(input.EncryptedExpiryMonth)) - ) && - ( - this.EncryptedExpiryYear == input.EncryptedExpiryYear || - (this.EncryptedExpiryYear != null && - this.EncryptedExpiryYear.Equals(input.EncryptedExpiryYear)) - ) && - ( - this.EncryptedSecurityCode == input.EncryptedSecurityCode || - (this.EncryptedSecurityCode != null && - this.EncryptedSecurityCode.Equals(input.EncryptedSecurityCode)) - ) && - ( - this.ExpiryMonth == input.ExpiryMonth || - (this.ExpiryMonth != null && - this.ExpiryMonth.Equals(input.ExpiryMonth)) - ) && - ( - this.ExpiryYear == input.ExpiryYear || - (this.ExpiryYear != null && - this.ExpiryYear.Equals(input.ExpiryYear)) - ) && - ( - this.HolderName == input.HolderName || - (this.HolderName != null && - this.HolderName.Equals(input.HolderName)) - ) && - ( - this.Number == input.Number || - (this.Number != null && - this.Number.Equals(input.Number)) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Brand != null) - { - hashCode = (hashCode * 59) + this.Brand.GetHashCode(); - } - if (this.Cvc != null) - { - hashCode = (hashCode * 59) + this.Cvc.GetHashCode(); - } - if (this.EncryptedCard != null) - { - hashCode = (hashCode * 59) + this.EncryptedCard.GetHashCode(); - } - if (this.EncryptedCardNumber != null) - { - hashCode = (hashCode * 59) + this.EncryptedCardNumber.GetHashCode(); - } - if (this.EncryptedExpiryMonth != null) - { - hashCode = (hashCode * 59) + this.EncryptedExpiryMonth.GetHashCode(); - } - if (this.EncryptedExpiryYear != null) - { - hashCode = (hashCode * 59) + this.EncryptedExpiryYear.GetHashCode(); - } - if (this.EncryptedSecurityCode != null) - { - hashCode = (hashCode * 59) + this.EncryptedSecurityCode.GetHashCode(); - } - if (this.ExpiryMonth != null) - { - hashCode = (hashCode * 59) + this.ExpiryMonth.GetHashCode(); - } - if (this.ExpiryYear != null) - { - hashCode = (hashCode * 59) + this.ExpiryYear.GetHashCode(); - } - if (this.HolderName != null) - { - hashCode = (hashCode * 59) + this.HolderName.GetHashCode(); - } - if (this.Number != null) - { - hashCode = (hashCode * 59) + this.Number.GetHashCode(); - } - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // EncryptedCard (string) maxLength if (this.EncryptedCard != null && this.EncryptedCard.Length > 40000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCard, length must be less than 40000.", new [] { "EncryptedCard" }); + yield return new ValidationResult("Invalid value for EncryptedCard, length must be less than 40000.", new [] { "EncryptedCard" }); } // EncryptedCardNumber (string) maxLength if (this.EncryptedCardNumber != null && this.EncryptedCardNumber.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); + yield return new ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); } // EncryptedExpiryMonth (string) maxLength if (this.EncryptedExpiryMonth != null && this.EncryptedExpiryMonth.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedExpiryMonth, length must be less than 15000.", new [] { "EncryptedExpiryMonth" }); + yield return new ValidationResult("Invalid value for EncryptedExpiryMonth, length must be less than 15000.", new [] { "EncryptedExpiryMonth" }); } // EncryptedExpiryYear (string) maxLength if (this.EncryptedExpiryYear != null && this.EncryptedExpiryYear.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedExpiryYear, length must be less than 15000.", new [] { "EncryptedExpiryYear" }); + yield return new ValidationResult("Invalid value for EncryptedExpiryYear, length must be less than 15000.", new [] { "EncryptedExpiryYear" }); } // EncryptedSecurityCode (string) maxLength if (this.EncryptedSecurityCode != null && this.EncryptedSecurityCode.Length > 15000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedSecurityCode, length must be less than 15000.", new [] { "EncryptedSecurityCode" }); + yield return new ValidationResult("Invalid value for EncryptedSecurityCode, length must be less than 15000.", new [] { "EncryptedSecurityCode" }); } yield break; } } + /// + /// A Json converter for type + /// + public class PaymentMethodToStoreJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override PaymentMethodToStore Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option brand = default; + Option cvc = default; + Option encryptedCard = default; + Option encryptedCardNumber = default; + Option encryptedExpiryMonth = default; + Option encryptedExpiryYear = default; + Option encryptedSecurityCode = default; + Option expiryMonth = default; + Option expiryYear = default; + Option holderName = default; + Option number = default; + Option type = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "brand": + brand = new Option(utf8JsonReader.GetString()); + break; + case "cvc": + cvc = new Option(utf8JsonReader.GetString()); + break; + case "encryptedCard": + encryptedCard = new Option(utf8JsonReader.GetString()); + break; + case "encryptedCardNumber": + encryptedCardNumber = new Option(utf8JsonReader.GetString()); + break; + case "encryptedExpiryMonth": + encryptedExpiryMonth = new Option(utf8JsonReader.GetString()); + break; + case "encryptedExpiryYear": + encryptedExpiryYear = new Option(utf8JsonReader.GetString()); + break; + case "encryptedSecurityCode": + encryptedSecurityCode = new Option(utf8JsonReader.GetString()); + break; + case "expiryMonth": + expiryMonth = new Option(utf8JsonReader.GetString()); + break; + case "expiryYear": + expiryYear = new Option(utf8JsonReader.GetString()); + break; + case "holderName": + holderName = new Option(utf8JsonReader.GetString()); + break; + case "number": + number = new Option(utf8JsonReader.GetString()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (brand.IsSet && brand.Value == null) + throw new ArgumentNullException(nameof(brand), "Property is not nullable for class PaymentMethodToStore."); + + if (cvc.IsSet && cvc.Value == null) + throw new ArgumentNullException(nameof(cvc), "Property is not nullable for class PaymentMethodToStore."); + + if (encryptedCard.IsSet && encryptedCard.Value == null) + throw new ArgumentNullException(nameof(encryptedCard), "Property is not nullable for class PaymentMethodToStore."); + + if (encryptedCardNumber.IsSet && encryptedCardNumber.Value == null) + throw new ArgumentNullException(nameof(encryptedCardNumber), "Property is not nullable for class PaymentMethodToStore."); + + if (encryptedExpiryMonth.IsSet && encryptedExpiryMonth.Value == null) + throw new ArgumentNullException(nameof(encryptedExpiryMonth), "Property is not nullable for class PaymentMethodToStore."); + + if (encryptedExpiryYear.IsSet && encryptedExpiryYear.Value == null) + throw new ArgumentNullException(nameof(encryptedExpiryYear), "Property is not nullable for class PaymentMethodToStore."); + + if (encryptedSecurityCode.IsSet && encryptedSecurityCode.Value == null) + throw new ArgumentNullException(nameof(encryptedSecurityCode), "Property is not nullable for class PaymentMethodToStore."); + + if (expiryMonth.IsSet && expiryMonth.Value == null) + throw new ArgumentNullException(nameof(expiryMonth), "Property is not nullable for class PaymentMethodToStore."); + + if (expiryYear.IsSet && expiryYear.Value == null) + throw new ArgumentNullException(nameof(expiryYear), "Property is not nullable for class PaymentMethodToStore."); + + if (holderName.IsSet && holderName.Value == null) + throw new ArgumentNullException(nameof(holderName), "Property is not nullable for class PaymentMethodToStore."); + + if (number.IsSet && number.Value == null) + throw new ArgumentNullException(nameof(number), "Property is not nullable for class PaymentMethodToStore."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PaymentMethodToStore."); + + return new PaymentMethodToStore(brand, cvc, encryptedCard, encryptedCardNumber, encryptedExpiryMonth, encryptedExpiryYear, encryptedSecurityCode, expiryMonth, expiryYear, holderName, number, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentMethodToStore paymentMethodToStore, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, paymentMethodToStore, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentMethodToStore paymentMethodToStore, JsonSerializerOptions jsonSerializerOptions) + { + if (paymentMethodToStore.BrandOption.IsSet && paymentMethodToStore.Brand == null) + throw new ArgumentNullException(nameof(paymentMethodToStore.Brand), "Property is required for class PaymentMethodToStore."); + + if (paymentMethodToStore.CvcOption.IsSet && paymentMethodToStore.Cvc == null) + throw new ArgumentNullException(nameof(paymentMethodToStore.Cvc), "Property is required for class PaymentMethodToStore."); + + if (paymentMethodToStore.EncryptedCardOption.IsSet && paymentMethodToStore.EncryptedCard == null) + throw new ArgumentNullException(nameof(paymentMethodToStore.EncryptedCard), "Property is required for class PaymentMethodToStore."); + + if (paymentMethodToStore.EncryptedCardNumberOption.IsSet && paymentMethodToStore.EncryptedCardNumber == null) + throw new ArgumentNullException(nameof(paymentMethodToStore.EncryptedCardNumber), "Property is required for class PaymentMethodToStore."); + + if (paymentMethodToStore.EncryptedExpiryMonthOption.IsSet && paymentMethodToStore.EncryptedExpiryMonth == null) + throw new ArgumentNullException(nameof(paymentMethodToStore.EncryptedExpiryMonth), "Property is required for class PaymentMethodToStore."); + + if (paymentMethodToStore.EncryptedExpiryYearOption.IsSet && paymentMethodToStore.EncryptedExpiryYear == null) + throw new ArgumentNullException(nameof(paymentMethodToStore.EncryptedExpiryYear), "Property is required for class PaymentMethodToStore."); + + if (paymentMethodToStore.EncryptedSecurityCodeOption.IsSet && paymentMethodToStore.EncryptedSecurityCode == null) + throw new ArgumentNullException(nameof(paymentMethodToStore.EncryptedSecurityCode), "Property is required for class PaymentMethodToStore."); + + if (paymentMethodToStore.ExpiryMonthOption.IsSet && paymentMethodToStore.ExpiryMonth == null) + throw new ArgumentNullException(nameof(paymentMethodToStore.ExpiryMonth), "Property is required for class PaymentMethodToStore."); + + if (paymentMethodToStore.ExpiryYearOption.IsSet && paymentMethodToStore.ExpiryYear == null) + throw new ArgumentNullException(nameof(paymentMethodToStore.ExpiryYear), "Property is required for class PaymentMethodToStore."); + + if (paymentMethodToStore.HolderNameOption.IsSet && paymentMethodToStore.HolderName == null) + throw new ArgumentNullException(nameof(paymentMethodToStore.HolderName), "Property is required for class PaymentMethodToStore."); + + if (paymentMethodToStore.NumberOption.IsSet && paymentMethodToStore.Number == null) + throw new ArgumentNullException(nameof(paymentMethodToStore.Number), "Property is required for class PaymentMethodToStore."); + + if (paymentMethodToStore.TypeOption.IsSet && paymentMethodToStore.Type == null) + throw new ArgumentNullException(nameof(paymentMethodToStore.Type), "Property is required for class PaymentMethodToStore."); + + if (paymentMethodToStore.BrandOption.IsSet) + writer.WriteString("brand", paymentMethodToStore.Brand); + + if (paymentMethodToStore.CvcOption.IsSet) + writer.WriteString("cvc", paymentMethodToStore.Cvc); + + if (paymentMethodToStore.EncryptedCardOption.IsSet) + writer.WriteString("encryptedCard", paymentMethodToStore.EncryptedCard); + + if (paymentMethodToStore.EncryptedCardNumberOption.IsSet) + writer.WriteString("encryptedCardNumber", paymentMethodToStore.EncryptedCardNumber); + + if (paymentMethodToStore.EncryptedExpiryMonthOption.IsSet) + writer.WriteString("encryptedExpiryMonth", paymentMethodToStore.EncryptedExpiryMonth); + + if (paymentMethodToStore.EncryptedExpiryYearOption.IsSet) + writer.WriteString("encryptedExpiryYear", paymentMethodToStore.EncryptedExpiryYear); + + if (paymentMethodToStore.EncryptedSecurityCodeOption.IsSet) + writer.WriteString("encryptedSecurityCode", paymentMethodToStore.EncryptedSecurityCode); + + if (paymentMethodToStore.ExpiryMonthOption.IsSet) + writer.WriteString("expiryMonth", paymentMethodToStore.ExpiryMonth); + + if (paymentMethodToStore.ExpiryYearOption.IsSet) + writer.WriteString("expiryYear", paymentMethodToStore.ExpiryYear); + + if (paymentMethodToStore.HolderNameOption.IsSet) + writer.WriteString("holderName", paymentMethodToStore.HolderName); + + if (paymentMethodToStore.NumberOption.IsSet) + writer.WriteString("number", paymentMethodToStore.Number); + + if (paymentMethodToStore.TypeOption.IsSet) + writer.WriteString("type", paymentMethodToStore.Type); + } + } } diff --git a/Adyen/Model/Checkout/PaymentMethodUPIApps.cs b/Adyen/Model/Checkout/PaymentMethodUPIApps.cs index b7af1ba93..ebb779e50 100644 --- a/Adyen/Model/Checkout/PaymentMethodUPIApps.cs +++ b/Adyen/Model/Checkout/PaymentMethodUPIApps.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,51 +14,47 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentMethodUPIApps /// - [DataContract(Name = "PaymentMethodUPIApps")] - public partial class PaymentMethodUPIApps : IEquatable, IValidatableObject + public partial class PaymentMethodUPIApps : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected PaymentMethodUPIApps() { } - /// - /// Initializes a new instance of the class. - /// - /// The unique identifier of this app, to submit in requests to /payments. (required). - /// A localized name of the app. (required). - public PaymentMethodUPIApps(string id = default(string), string name = default(string)) + /// The unique identifier of this app, to submit in requests to /payments. + /// A localized name of the app. + [JsonConstructor] + public PaymentMethodUPIApps(string id, string name) { - this.Id = id; - this.Name = name; + Id = id; + Name = name; + OnCreated(); } + partial void OnCreated(); + /// /// The unique identifier of this app, to submit in requests to /payments. /// /// The unique identifier of this app, to submit in requests to /payments. - [DataMember(Name = "id", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("id")] public string Id { get; set; } /// /// A localized name of the app. /// /// A localized name of the app. - [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("name")] public string Name { get; set; } /// @@ -77,77 +72,116 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentMethodUPIAppsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentMethodUPIApps Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentMethodUPIApps); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentMethodUPIApps instances are equal - /// - /// Instance of PaymentMethodUPIApps to be compared - /// Boolean - public bool Equals(PaymentMethodUPIApps input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option id = default; + Option name = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ); + + if (!id.IsSet) + throw new ArgumentException("Property is required for class PaymentMethodUPIApps.", nameof(id)); + + if (!name.IsSet) + throw new ArgumentException("Property is required for class PaymentMethodUPIApps.", nameof(name)); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class PaymentMethodUPIApps."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class PaymentMethodUPIApps."); + + return new PaymentMethodUPIApps(id.Value, name.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentMethodUPIApps paymentMethodUPIApps, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentMethodUPIApps, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentMethodUPIApps paymentMethodUPIApps, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentMethodUPIApps.Id == null) + throw new ArgumentNullException(nameof(paymentMethodUPIApps.Id), "Property is required for class PaymentMethodUPIApps."); + + if (paymentMethodUPIApps.Name == null) + throw new ArgumentNullException(nameof(paymentMethodUPIApps.Name), "Property is required for class PaymentMethodUPIApps."); + + writer.WriteString("id", paymentMethodUPIApps.Id); + + writer.WriteString("name", paymentMethodUPIApps.Name); } } - } diff --git a/Adyen/Model/Checkout/PaymentMethodsRequest.cs b/Adyen/Model/Checkout/PaymentMethodsRequest.cs index 5ea97d524..0bd7ebdb1 100644 --- a/Adyen/Model/Checkout/PaymentMethodsRequest.cs +++ b/Adyen/Model/Checkout/PaymentMethodsRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,212 +14,470 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentMethodsRequest /// - [DataContract(Name = "PaymentMethodsRequest")] - public partial class PaymentMethodsRequest : IEquatable, IValidatableObject + public partial class PaymentMethodsRequest : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The merchant account identifier, with which you want to process the transaction. + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` + /// amount + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` + /// browserInfo + /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web + /// The shopper's country code. + /// order + /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + /// The combination of a language code and a country code to specify the language to be used in the payment. + /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false) + /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. + /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. + /// The shopper's telephone number. + [JsonConstructor] + public PaymentMethodsRequest(string merchantAccount, Option> additionalData = default, Option> allowedPaymentMethods = default, Option amount = default, Option> blockedPaymentMethods = default, Option browserInfo = default, Option channel = default, Option countryCode = default, Option order = default, Option shopperConversionId = default, Option shopperEmail = default, Option shopperIP = default, Option shopperLocale = default, Option shopperReference = default, Option splitCardFundingSources = default, Option store = default, Option storeFiltrationMode = default, Option telephoneNumber = default) + { + MerchantAccount = merchantAccount; + AdditionalDataOption = additionalData; + AllowedPaymentMethodsOption = allowedPaymentMethods; + AmountOption = amount; + BlockedPaymentMethodsOption = blockedPaymentMethods; + BrowserInfoOption = browserInfo; + ChannelOption = channel; + CountryCodeOption = countryCode; + OrderOption = order; + ShopperConversionIdOption = shopperConversionId; + ShopperEmailOption = shopperEmail; + ShopperIPOption = shopperIP; + ShopperLocaleOption = shopperLocale; + ShopperReferenceOption = shopperReference; + SplitCardFundingSourcesOption = splitCardFundingSources; + StoreOption = store; + StoreFiltrationModeOption = storeFiltrationMode; + TelephoneNumberOption = telephoneNumber; + OnCreated(); + } + + partial void OnCreated(); + /// /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web /// /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web - [JsonConverter(typeof(StringEnumConverter))] public enum ChannelEnum { /// /// Enum IOS for value: iOS /// - [EnumMember(Value = "iOS")] IOS = 1, /// /// Enum Android for value: Android /// - [EnumMember(Value = "Android")] Android = 2, /// /// Enum Web for value: Web /// - [EnumMember(Value = "Web")] Web = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ChannelEnum ChannelEnumFromString(string value) + { + if (value.Equals("iOS")) + return ChannelEnum.IOS; + + if (value.Equals("Android")) + return ChannelEnum.Android; + + if (value.Equals("Web")) + return ChannelEnum.Web; + + throw new NotImplementedException($"Could not convert value to type ChannelEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ChannelEnum? ChannelEnumFromStringOrDefault(string value) + { + if (value.Equals("iOS")) + return ChannelEnum.IOS; + + if (value.Equals("Android")) + return ChannelEnum.Android; + + if (value.Equals("Web")) + return ChannelEnum.Web; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChannelEnumToJsonValue(ChannelEnum? value) + { + if (value == ChannelEnum.IOS) + return "iOS"; + + if (value == ChannelEnum.Android) + return "Android"; + + if (value == ChannelEnum.Web) + return "Web"; + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Channel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChannelOption { get; private set; } /// /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web /// /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web - [DataMember(Name = "channel", EmitDefaultValue = false)] - public ChannelEnum? Channel { get; set; } + [JsonPropertyName("channel")] + public ChannelEnum? Channel { get { return this.ChannelOption; } set { this.ChannelOption = new Option(value); } } + /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - [JsonConverter(typeof(StringEnumConverter))] public enum StoreFiltrationModeEnum { /// /// Enum Exclusive for value: exclusive /// - [EnumMember(Value = "exclusive")] Exclusive = 1, /// /// Enum Inclusive for value: inclusive /// - [EnumMember(Value = "inclusive")] Inclusive = 2, /// /// Enum SkipFilter for value: skipFilter /// - [EnumMember(Value = "skipFilter")] SkipFilter = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static StoreFiltrationModeEnum StoreFiltrationModeEnumFromString(string value) + { + if (value.Equals("exclusive")) + return StoreFiltrationModeEnum.Exclusive; + + if (value.Equals("inclusive")) + return StoreFiltrationModeEnum.Inclusive; + + if (value.Equals("skipFilter")) + return StoreFiltrationModeEnum.SkipFilter; + + throw new NotImplementedException($"Could not convert value to type StoreFiltrationModeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static StoreFiltrationModeEnum? StoreFiltrationModeEnumFromStringOrDefault(string value) + { + if (value.Equals("exclusive")) + return StoreFiltrationModeEnum.Exclusive; + + if (value.Equals("inclusive")) + return StoreFiltrationModeEnum.Inclusive; + if (value.Equals("skipFilter")) + return StoreFiltrationModeEnum.SkipFilter; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StoreFiltrationModeEnumToJsonValue(StoreFiltrationModeEnum? value) + { + if (value == StoreFiltrationModeEnum.Exclusive) + return "exclusive"; + + if (value == StoreFiltrationModeEnum.Inclusive) + return "inclusive"; + + if (value == StoreFiltrationModeEnum.SkipFilter) + return "skipFilter"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of StoreFiltrationMode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoreFiltrationModeOption { get; private set; } /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - [DataMember(Name = "storeFiltrationMode", EmitDefaultValue = false)] - public StoreFiltrationModeEnum? StoreFiltrationMode { get; set; } + [JsonPropertyName("storeFiltrationMode")] + public StoreFiltrationModeEnum? StoreFiltrationMode { get { return this.StoreFiltrationModeOption; } set { this.StoreFiltrationModeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// The merchant account identifier, with which you want to process the transaction. /// - [JsonConstructorAttribute] - protected PaymentMethodsRequest() { } + /// The merchant account identifier, with which you want to process the transaction. + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of AdditionalData /// - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. - /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]`. - /// amount. - /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]`. - /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web. - /// The shopper's country code.. - /// The merchant account identifier, with which you want to process the transaction. (required). - /// order. - /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates.. - /// The combination of a language code and a country code to specify the language to be used in the payment.. - /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. - /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false). - /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment.. - /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned.. - public PaymentMethodsRequest(Dictionary additionalData = default(Dictionary), List allowedPaymentMethods = default(List), Amount amount = default(Amount), List blockedPaymentMethods = default(List), ChannelEnum? channel = default(ChannelEnum?), string countryCode = default(string), string merchantAccount = default(string), EncryptedOrderData order = default(EncryptedOrderData), string shopperConversionId = default(string), string shopperLocale = default(string), string shopperReference = default(string), bool? splitCardFundingSources = false, string store = default(string), StoreFiltrationModeEnum? storeFiltrationMode = default(StoreFiltrationModeEnum?)) - { - this.MerchantAccount = merchantAccount; - this.AdditionalData = additionalData; - this.AllowedPaymentMethods = allowedPaymentMethods; - this.Amount = amount; - this.BlockedPaymentMethods = blockedPaymentMethods; - this.Channel = channel; - this.CountryCode = countryCode; - this.Order = order; - this.ShopperConversionId = shopperConversionId; - this.ShopperLocale = shopperLocale; - this.ShopperReference = shopperReference; - this.SplitCardFundingSources = splitCardFundingSources; - this.Store = store; - this.StoreFiltrationMode = storeFiltrationMode; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AdditionalDataOption { get; private set; } /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - [DataMember(Name = "additionalData", EmitDefaultValue = false)] - public Dictionary AdditionalData { get; set; } + [JsonPropertyName("additionalData")] + public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } + + /// + /// Used to track the state of AllowedPaymentMethods + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AllowedPaymentMethodsOption { get; private set; } /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] - public List AllowedPaymentMethods { get; set; } + [JsonPropertyName("allowedPaymentMethods")] + public List AllowedPaymentMethods { get { return this.AllowedPaymentMethodsOption; } set { this.AllowedPaymentMethodsOption = new Option>(value); } } + + /// + /// Used to track the state of Amount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountOption { get; private set; } /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonPropertyName("amount")] + public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } + + /// + /// Used to track the state of BlockedPaymentMethods + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> BlockedPaymentMethodsOption { get; private set; } /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] - public List BlockedPaymentMethods { get; set; } + [JsonPropertyName("blockedPaymentMethods")] + public List BlockedPaymentMethods { get { return this.BlockedPaymentMethodsOption; } set { this.BlockedPaymentMethodsOption = new Option>(value); } } + + /// + /// Used to track the state of BrowserInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BrowserInfoOption { get; private set; } + + /// + /// Gets or Sets BrowserInfo + /// + [JsonPropertyName("browserInfo")] + public BrowserInfo BrowserInfo { get { return this.BrowserInfoOption; } set { this.BrowserInfoOption = new Option(value); } } + + /// + /// Used to track the state of CountryCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryCodeOption { get; private set; } /// /// The shopper's country code. /// /// The shopper's country code. - [DataMember(Name = "countryCode", EmitDefaultValue = false)] - public string CountryCode { get; set; } + [JsonPropertyName("countryCode")] + public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } /// - /// The merchant account identifier, with which you want to process the transaction. + /// Used to track the state of Order /// - /// The merchant account identifier, with which you want to process the transaction. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OrderOption { get; private set; } /// /// Gets or Sets Order /// - [DataMember(Name = "order", EmitDefaultValue = false)] - public EncryptedOrderData Order { get; set; } + [JsonPropertyName("order")] + public EncryptedOrderData Order { get { return this.OrderOption; } set { this.OrderOption = new Option(value); } } + + /// + /// Used to track the state of ShopperConversionId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperConversionIdOption { get; private set; } /// /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. /// /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. - [DataMember(Name = "shopperConversionId", EmitDefaultValue = false)] - public string ShopperConversionId { get; set; } + [JsonPropertyName("shopperConversionId")] + public string ShopperConversionId { get { return this.ShopperConversionIdOption; } set { this.ShopperConversionIdOption = new Option(value); } } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } + + /// + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + /// + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of ShopperIP + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperIPOption { get; private set; } + + /// + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + /// + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + [JsonPropertyName("shopperIP")] + public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } + + /// + /// Used to track the state of ShopperLocale + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperLocaleOption { get; private set; } /// /// The combination of a language code and a country code to specify the language to be used in the payment. /// /// The combination of a language code and a country code to specify the language to be used in the payment. - [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] - public string ShopperLocale { get; set; } + [JsonPropertyName("shopperLocale")] + public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } + + /// + /// Used to track the state of ShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperReferenceOption { get; private set; } /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [DataMember(Name = "shopperReference", EmitDefaultValue = false)] - public string ShopperReference { get; set; } + [JsonPropertyName("shopperReference")] + public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of SplitCardFundingSources + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SplitCardFundingSourcesOption { get; private set; } /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. - [DataMember(Name = "splitCardFundingSources", EmitDefaultValue = false)] - public bool? SplitCardFundingSources { get; set; } + [JsonPropertyName("splitCardFundingSources")] + public bool? SplitCardFundingSources { get { return this.SplitCardFundingSourcesOption; } set { this.SplitCardFundingSourcesOption = new Option(value); } } + + /// + /// Used to track the state of Store + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoreOption { get; private set; } /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - [DataMember(Name = "store", EmitDefaultValue = false)] - public string Store { get; set; } + [JsonPropertyName("store")] + public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } + + /// + /// Used to track the state of TelephoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TelephoneNumberOption { get; private set; } + + /// + /// The shopper's telephone number. + /// + /// The shopper's telephone number. + [JsonPropertyName("telephoneNumber")] + public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -230,213 +487,375 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentMethodsRequest {\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" BlockedPaymentMethods: ").Append(BlockedPaymentMethods).Append("\n"); + sb.Append(" BrowserInfo: ").Append(BrowserInfo).Append("\n"); sb.Append(" Channel: ").Append(Channel).Append("\n"); sb.Append(" CountryCode: ").Append(CountryCode).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" Order: ").Append(Order).Append("\n"); sb.Append(" ShopperConversionId: ").Append(ShopperConversionId).Append("\n"); + sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); + sb.Append(" ShopperIP: ").Append(ShopperIP).Append("\n"); sb.Append(" ShopperLocale: ").Append(ShopperLocale).Append("\n"); sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n"); sb.Append(" SplitCardFundingSources: ").Append(SplitCardFundingSources).Append("\n"); sb.Append(" Store: ").Append(Store).Append("\n"); sb.Append(" StoreFiltrationMode: ").Append(StoreFiltrationMode).Append("\n"); + sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // ShopperConversionId (string) maxLength + if (this.ShopperConversionId != null && this.ShopperConversionId.Length > 256) + { + yield return new ValidationResult("Invalid value for ShopperConversionId, length must be less than 256.", new [] { "ShopperConversionId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PaymentMethodsRequest); - } + // Store (string) maxLength + if (this.Store != null && this.Store.Length > 16) + { + yield return new ValidationResult("Invalid value for Store, length must be less than 16.", new [] { "Store" }); + } - /// - /// Returns true if PaymentMethodsRequest instances are equal - /// - /// Instance of PaymentMethodsRequest to be compared - /// Boolean - public bool Equals(PaymentMethodsRequest input) - { - if (input == null) + // Store (string) minLength + if (this.Store != null && this.Store.Length < 1) { - return false; + yield return new ValidationResult("Invalid value for Store, length must be greater than 1.", new [] { "Store" }); } - return - ( - this.AdditionalData == input.AdditionalData || - this.AdditionalData != null && - input.AdditionalData != null && - this.AdditionalData.SequenceEqual(input.AdditionalData) - ) && - ( - this.AllowedPaymentMethods == input.AllowedPaymentMethods || - this.AllowedPaymentMethods != null && - input.AllowedPaymentMethods != null && - this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) - ) && - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.BlockedPaymentMethods == input.BlockedPaymentMethods || - this.BlockedPaymentMethods != null && - input.BlockedPaymentMethods != null && - this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) - ) && - ( - this.Channel == input.Channel || - this.Channel.Equals(input.Channel) - ) && - ( - this.CountryCode == input.CountryCode || - (this.CountryCode != null && - this.CountryCode.Equals(input.CountryCode)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.Order == input.Order || - (this.Order != null && - this.Order.Equals(input.Order)) - ) && - ( - this.ShopperConversionId == input.ShopperConversionId || - (this.ShopperConversionId != null && - this.ShopperConversionId.Equals(input.ShopperConversionId)) - ) && - ( - this.ShopperLocale == input.ShopperLocale || - (this.ShopperLocale != null && - this.ShopperLocale.Equals(input.ShopperLocale)) - ) && - ( - this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) - ) && - ( - this.SplitCardFundingSources == input.SplitCardFundingSources || - this.SplitCardFundingSources.Equals(input.SplitCardFundingSources) - ) && - ( - this.Store == input.Store || - (this.Store != null && - this.Store.Equals(input.Store)) - ) && - ( - this.StoreFiltrationMode == input.StoreFiltrationMode || - this.StoreFiltrationMode.Equals(input.StoreFiltrationMode) - ); + + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentMethodsRequestJsonConverter : JsonConverter + { /// - /// Gets the hash code + /// Deserializes json to /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + /// + public override PaymentMethodsRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option merchantAccount = default; + Option> additionalData = default; + Option> allowedPaymentMethods = default; + Option amount = default; + Option> blockedPaymentMethods = default; + Option browserInfo = default; + Option channel = default; + Option countryCode = default; + Option order = default; + Option shopperConversionId = default; + Option shopperEmail = default; + Option shopperIP = default; + Option shopperLocale = default; + Option shopperReference = default; + Option splitCardFundingSources = default; + Option store = default; + Option storeFiltrationMode = default; + Option telephoneNumber = default; + + while (utf8JsonReader.Read()) { - int hashCode = 41; - if (this.AdditionalData != null) - { - hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); - } - if (this.AllowedPaymentMethods != null) - { - hashCode = (hashCode * 59) + this.AllowedPaymentMethods.GetHashCode(); - } - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.BlockedPaymentMethods != null) - { - hashCode = (hashCode * 59) + this.BlockedPaymentMethods.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Channel.GetHashCode(); - if (this.CountryCode != null) - { - hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.Order != null) - { - hashCode = (hashCode * 59) + this.Order.GetHashCode(); - } - if (this.ShopperConversionId != null) - { - hashCode = (hashCode * 59) + this.ShopperConversionId.GetHashCode(); - } - if (this.ShopperLocale != null) - { - hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); - } - if (this.ShopperReference != null) - { - hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); - } - hashCode = (hashCode * 59) + this.SplitCardFundingSources.GetHashCode(); - if (this.Store != null) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - hashCode = (hashCode * 59) + this.Store.GetHashCode(); + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "additionalData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "allowedPaymentMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + allowedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "blockedPaymentMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + blockedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "browserInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + browserInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "channel": + string channelRawValue = utf8JsonReader.GetString(); + if (channelRawValue != null) + channel = new Option(PaymentMethodsRequest.ChannelEnumFromStringOrDefault(channelRawValue)); + break; + case "countryCode": + countryCode = new Option(utf8JsonReader.GetString()); + break; + case "order": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + order = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperConversionId": + shopperConversionId = new Option(utf8JsonReader.GetString()); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "shopperIP": + shopperIP = new Option(utf8JsonReader.GetString()); + break; + case "shopperLocale": + shopperLocale = new Option(utf8JsonReader.GetString()); + break; + case "shopperReference": + shopperReference = new Option(utf8JsonReader.GetString()); + break; + case "splitCardFundingSources": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splitCardFundingSources = new Option(utf8JsonReader.GetBoolean()); + break; + case "store": + store = new Option(utf8JsonReader.GetString()); + break; + case "storeFiltrationMode": + string storeFiltrationModeRawValue = utf8JsonReader.GetString(); + if (storeFiltrationModeRawValue != null) + storeFiltrationMode = new Option(PaymentMethodsRequest.StoreFiltrationModeEnumFromStringOrDefault(storeFiltrationModeRawValue)); + break; + case "telephoneNumber": + telephoneNumber = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } } - hashCode = (hashCode * 59) + this.StoreFiltrationMode.GetHashCode(); - return hashCode; } + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentMethodsRequest.", nameof(merchantAccount)); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentMethodsRequest."); + + if (additionalData.IsSet && additionalData.Value == null) + throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class PaymentMethodsRequest."); + + if (allowedPaymentMethods.IsSet && allowedPaymentMethods.Value == null) + throw new ArgumentNullException(nameof(allowedPaymentMethods), "Property is not nullable for class PaymentMethodsRequest."); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentMethodsRequest."); + + if (blockedPaymentMethods.IsSet && blockedPaymentMethods.Value == null) + throw new ArgumentNullException(nameof(blockedPaymentMethods), "Property is not nullable for class PaymentMethodsRequest."); + + if (browserInfo.IsSet && browserInfo.Value == null) + throw new ArgumentNullException(nameof(browserInfo), "Property is not nullable for class PaymentMethodsRequest."); + + if (channel.IsSet && channel.Value == null) + throw new ArgumentNullException(nameof(channel), "Property is not nullable for class PaymentMethodsRequest."); + + if (countryCode.IsSet && countryCode.Value == null) + throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class PaymentMethodsRequest."); + + if (order.IsSet && order.Value == null) + throw new ArgumentNullException(nameof(order), "Property is not nullable for class PaymentMethodsRequest."); + + if (shopperConversionId.IsSet && shopperConversionId.Value == null) + throw new ArgumentNullException(nameof(shopperConversionId), "Property is not nullable for class PaymentMethodsRequest."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class PaymentMethodsRequest."); + + if (shopperIP.IsSet && shopperIP.Value == null) + throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class PaymentMethodsRequest."); + + if (shopperLocale.IsSet && shopperLocale.Value == null) + throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class PaymentMethodsRequest."); + + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class PaymentMethodsRequest."); + + if (splitCardFundingSources.IsSet && splitCardFundingSources.Value == null) + throw new ArgumentNullException(nameof(splitCardFundingSources), "Property is not nullable for class PaymentMethodsRequest."); + + if (store.IsSet && store.Value == null) + throw new ArgumentNullException(nameof(store), "Property is not nullable for class PaymentMethodsRequest."); + + if (storeFiltrationMode.IsSet && storeFiltrationMode.Value == null) + throw new ArgumentNullException(nameof(storeFiltrationMode), "Property is not nullable for class PaymentMethodsRequest."); + + if (telephoneNumber.IsSet && telephoneNumber.Value == null) + throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class PaymentMethodsRequest."); + + return new PaymentMethodsRequest(merchantAccount.Value, additionalData, allowedPaymentMethods, amount, blockedPaymentMethods, browserInfo, channel, countryCode, order, shopperConversionId, shopperEmail, shopperIP, shopperLocale, shopperReference, splitCardFundingSources, store, storeFiltrationMode, telephoneNumber); } + /// - /// To validate all properties of the instance + /// Serializes a /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentMethodsRequest paymentMethodsRequest, JsonSerializerOptions jsonSerializerOptions) { - // ShopperConversionId (string) maxLength - if (this.ShopperConversionId != null && this.ShopperConversionId.Length > 256) + writer.WriteStartObject(); + + WriteProperties(writer, paymentMethodsRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentMethodsRequest paymentMethodsRequest, JsonSerializerOptions jsonSerializerOptions) + { + if (paymentMethodsRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.MerchantAccount), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.AdditionalDataOption.IsSet && paymentMethodsRequest.AdditionalData == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.AdditionalData), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.AllowedPaymentMethodsOption.IsSet && paymentMethodsRequest.AllowedPaymentMethods == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.AllowedPaymentMethods), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.AmountOption.IsSet && paymentMethodsRequest.Amount == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.Amount), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.BlockedPaymentMethodsOption.IsSet && paymentMethodsRequest.BlockedPaymentMethods == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.BlockedPaymentMethods), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.BrowserInfoOption.IsSet && paymentMethodsRequest.BrowserInfo == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.BrowserInfo), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.CountryCodeOption.IsSet && paymentMethodsRequest.CountryCode == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.CountryCode), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.OrderOption.IsSet && paymentMethodsRequest.Order == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.Order), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.ShopperConversionIdOption.IsSet && paymentMethodsRequest.ShopperConversionId == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.ShopperConversionId), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.ShopperEmailOption.IsSet && paymentMethodsRequest.ShopperEmail == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.ShopperEmail), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.ShopperIPOption.IsSet && paymentMethodsRequest.ShopperIP == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.ShopperIP), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.ShopperLocaleOption.IsSet && paymentMethodsRequest.ShopperLocale == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.ShopperLocale), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.ShopperReferenceOption.IsSet && paymentMethodsRequest.ShopperReference == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.ShopperReference), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.StoreOption.IsSet && paymentMethodsRequest.Store == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.Store), "Property is required for class PaymentMethodsRequest."); + + if (paymentMethodsRequest.TelephoneNumberOption.IsSet && paymentMethodsRequest.TelephoneNumber == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest.TelephoneNumber), "Property is required for class PaymentMethodsRequest."); + + writer.WriteString("merchantAccount", paymentMethodsRequest.MerchantAccount); + + if (paymentMethodsRequest.AdditionalDataOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperConversionId, length must be less than 256.", new [] { "ShopperConversionId" }); + writer.WritePropertyName("additionalData"); + JsonSerializer.Serialize(writer, paymentMethodsRequest.AdditionalData, jsonSerializerOptions); } - - // Store (string) maxLength - if (this.Store != null && this.Store.Length > 16) + if (paymentMethodsRequest.AllowedPaymentMethodsOption.IsSet) + { + writer.WritePropertyName("allowedPaymentMethods"); + JsonSerializer.Serialize(writer, paymentMethodsRequest.AllowedPaymentMethods, jsonSerializerOptions); + } + if (paymentMethodsRequest.AmountOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be less than 16.", new [] { "Store" }); + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, paymentMethodsRequest.Amount, jsonSerializerOptions); } + if (paymentMethodsRequest.BlockedPaymentMethodsOption.IsSet) + { + writer.WritePropertyName("blockedPaymentMethods"); + JsonSerializer.Serialize(writer, paymentMethodsRequest.BlockedPaymentMethods, jsonSerializerOptions); + } + if (paymentMethodsRequest.BrowserInfoOption.IsSet) + { + writer.WritePropertyName("browserInfo"); + JsonSerializer.Serialize(writer, paymentMethodsRequest.BrowserInfo, jsonSerializerOptions); + } + var channelRawValue = PaymentMethodsRequest.ChannelEnumToJsonValue(paymentMethodsRequest.ChannelOption.Value.Value); + writer.WriteString("channel", channelRawValue); + if (paymentMethodsRequest.CountryCodeOption.IsSet) + writer.WriteString("countryCode", paymentMethodsRequest.CountryCode); - // Store (string) minLength - if (this.Store != null && this.Store.Length < 1) + if (paymentMethodsRequest.OrderOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be greater than 1.", new [] { "Store" }); + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, paymentMethodsRequest.Order, jsonSerializerOptions); } + if (paymentMethodsRequest.ShopperConversionIdOption.IsSet) + writer.WriteString("shopperConversionId", paymentMethodsRequest.ShopperConversionId); - yield break; + if (paymentMethodsRequest.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", paymentMethodsRequest.ShopperEmail); + + if (paymentMethodsRequest.ShopperIPOption.IsSet) + writer.WriteString("shopperIP", paymentMethodsRequest.ShopperIP); + + if (paymentMethodsRequest.ShopperLocaleOption.IsSet) + writer.WriteString("shopperLocale", paymentMethodsRequest.ShopperLocale); + + if (paymentMethodsRequest.ShopperReferenceOption.IsSet) + writer.WriteString("shopperReference", paymentMethodsRequest.ShopperReference); + + if (paymentMethodsRequest.SplitCardFundingSourcesOption.IsSet) + writer.WriteBoolean("splitCardFundingSources", paymentMethodsRequest.SplitCardFundingSourcesOption.Value.Value); + + if (paymentMethodsRequest.StoreOption.IsSet) + writer.WriteString("store", paymentMethodsRequest.Store); + + var storeFiltrationModeRawValue = PaymentMethodsRequest.StoreFiltrationModeEnumToJsonValue(paymentMethodsRequest.StoreFiltrationModeOption.Value.Value); + writer.WriteString("storeFiltrationMode", storeFiltrationModeRawValue); + if (paymentMethodsRequest.TelephoneNumberOption.IsSet) + writer.WriteString("telephoneNumber", paymentMethodsRequest.TelephoneNumber); } } - } diff --git a/Adyen/Model/Checkout/PaymentMethodsResponse.cs b/Adyen/Model/Checkout/PaymentMethodsResponse.cs index 28780af40..8eafdf230 100644 --- a/Adyen/Model/Checkout/PaymentMethodsResponse.cs +++ b/Adyen/Model/Checkout/PaymentMethodsResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,47 +14,62 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentMethodsResponse /// - [DataContract(Name = "PaymentMethodsResponse")] - public partial class PaymentMethodsResponse : IEquatable, IValidatableObject + public partial class PaymentMethodsResponse : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Detailed list of payment methods required to generate payment forms.. - /// List of all stored payment methods.. - public PaymentMethodsResponse(List paymentMethods = default(List), List storedPaymentMethods = default(List)) + /// Detailed list of payment methods required to generate payment forms. + /// List of all stored payment methods. + [JsonConstructor] + public PaymentMethodsResponse(Option> paymentMethods = default, Option> storedPaymentMethods = default) { - this.PaymentMethods = paymentMethods; - this.StoredPaymentMethods = storedPaymentMethods; + PaymentMethodsOption = paymentMethods; + StoredPaymentMethodsOption = storedPaymentMethods; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of PaymentMethods + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> PaymentMethodsOption { get; private set; } + /// /// Detailed list of payment methods required to generate payment forms. /// /// Detailed list of payment methods required to generate payment forms. - [DataMember(Name = "paymentMethods", EmitDefaultValue = false)] - public List PaymentMethods { get; set; } + [JsonPropertyName("paymentMethods")] + public List PaymentMethods { get { return this.PaymentMethodsOption; } set { this.PaymentMethodsOption = new Option>(value); } } + + /// + /// Used to track the state of StoredPaymentMethods + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> StoredPaymentMethodsOption { get; private set; } /// /// List of all stored payment methods. /// /// List of all stored payment methods. - [DataMember(Name = "storedPaymentMethods", EmitDefaultValue = false)] - public List StoredPaymentMethods { get; set; } + [JsonPropertyName("storedPaymentMethods")] + public List StoredPaymentMethods { get { return this.StoredPaymentMethodsOption; } set { this.StoredPaymentMethodsOption = new Option>(value); } } /// /// Returns the string presentation of the object @@ -72,79 +86,119 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentMethodsResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentMethodsResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentMethodsResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentMethodsResponse instances are equal - /// - /// Instance of PaymentMethodsResponse to be compared - /// Boolean - public bool Equals(PaymentMethodsResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option> paymentMethods = default; + Option> storedPaymentMethods = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "paymentMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + paymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "storedPaymentMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + storedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.PaymentMethods == input.PaymentMethods || - this.PaymentMethods != null && - input.PaymentMethods != null && - this.PaymentMethods.SequenceEqual(input.PaymentMethods) - ) && - ( - this.StoredPaymentMethods == input.StoredPaymentMethods || - this.StoredPaymentMethods != null && - input.StoredPaymentMethods != null && - this.StoredPaymentMethods.SequenceEqual(input.StoredPaymentMethods) - ); + + if (paymentMethods.IsSet && paymentMethods.Value == null) + throw new ArgumentNullException(nameof(paymentMethods), "Property is not nullable for class PaymentMethodsResponse."); + + if (storedPaymentMethods.IsSet && storedPaymentMethods.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethods), "Property is not nullable for class PaymentMethodsResponse."); + + return new PaymentMethodsResponse(paymentMethods, storedPaymentMethods); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentMethodsResponse paymentMethodsResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.PaymentMethods != null) - { - hashCode = (hashCode * 59) + this.PaymentMethods.GetHashCode(); - } - if (this.StoredPaymentMethods != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethods.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentMethodsResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentMethodsResponse paymentMethodsResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentMethodsResponse.PaymentMethodsOption.IsSet && paymentMethodsResponse.PaymentMethods == null) + throw new ArgumentNullException(nameof(paymentMethodsResponse.PaymentMethods), "Property is required for class PaymentMethodsResponse."); + + if (paymentMethodsResponse.StoredPaymentMethodsOption.IsSet && paymentMethodsResponse.StoredPaymentMethods == null) + throw new ArgumentNullException(nameof(paymentMethodsResponse.StoredPaymentMethods), "Property is required for class PaymentMethodsResponse."); + + if (paymentMethodsResponse.PaymentMethodsOption.IsSet) + { + writer.WritePropertyName("paymentMethods"); + JsonSerializer.Serialize(writer, paymentMethodsResponse.PaymentMethods, jsonSerializerOptions); + } + if (paymentMethodsResponse.StoredPaymentMethodsOption.IsSet) + { + writer.WritePropertyName("storedPaymentMethods"); + JsonSerializer.Serialize(writer, paymentMethodsResponse.StoredPaymentMethods, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/PaymentRefundRequest.cs b/Adyen/Model/Checkout/PaymentRefundRequest.cs index 646667bb5..72fca00bc 100644 --- a/Adyen/Model/Checkout/PaymentRefundRequest.cs +++ b/Adyen/Model/Checkout/PaymentRefundRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,143 +14,254 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentRefundRequest /// - [DataContract(Name = "PaymentRefundRequest")] - public partial class PaymentRefundRequest : IEquatable, IValidatableObject + public partial class PaymentRefundRequest : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The merchant account that is used to process the payment. + /// applicationInfo + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** + /// Your reference for the refund request. Maximum length: 80 characters. + /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). + /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. + [JsonConstructor] + public PaymentRefundRequest(Amount amount, string merchantAccount, Option applicationInfo = default, Option> lineItems = default, Option merchantRefundReason = default, Option reference = default, Option> splits = default, Option store = default) + { + Amount = amount; + MerchantAccount = merchantAccount; + ApplicationInfoOption = applicationInfo; + LineItemsOption = lineItems; + MerchantRefundReasonOption = merchantRefundReason; + ReferenceOption = reference; + SplitsOption = splits; + StoreOption = store; + OnCreated(); + } + + partial void OnCreated(); + /// /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** /// /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** - [JsonConverter(typeof(StringEnumConverter))] public enum MerchantRefundReasonEnum { /// /// Enum FRAUD for value: FRAUD /// - [EnumMember(Value = "FRAUD")] FRAUD = 1, /// /// Enum CUSTOMERREQUEST for value: CUSTOMER REQUEST /// - [EnumMember(Value = "CUSTOMER REQUEST")] CUSTOMERREQUEST = 2, /// /// Enum RETURN for value: RETURN /// - [EnumMember(Value = "RETURN")] RETURN = 3, /// /// Enum DUPLICATE for value: DUPLICATE /// - [EnumMember(Value = "DUPLICATE")] DUPLICATE = 4, /// /// Enum OTHER for value: OTHER /// - [EnumMember(Value = "OTHER")] OTHER = 5 - } - /// - /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** + /// Returns a /// - /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** - [DataMember(Name = "merchantRefundReason", EmitDefaultValue = false)] - public MerchantRefundReasonEnum? MerchantRefundReason { get; set; } + /// + /// + /// + public static MerchantRefundReasonEnum MerchantRefundReasonEnumFromString(string value) + { + if (value.Equals("FRAUD")) + return MerchantRefundReasonEnum.FRAUD; + + if (value.Equals("CUSTOMER REQUEST")) + return MerchantRefundReasonEnum.CUSTOMERREQUEST; + + if (value.Equals("RETURN")) + return MerchantRefundReasonEnum.RETURN; + + if (value.Equals("DUPLICATE")) + return MerchantRefundReasonEnum.DUPLICATE; + + if (value.Equals("OTHER")) + return MerchantRefundReasonEnum.OTHER; + + throw new NotImplementedException($"Could not convert value to type MerchantRefundReasonEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected PaymentRefundRequest() { } + /// + /// + public static MerchantRefundReasonEnum? MerchantRefundReasonEnumFromStringOrDefault(string value) + { + if (value.Equals("FRAUD")) + return MerchantRefundReasonEnum.FRAUD; + + if (value.Equals("CUSTOMER REQUEST")) + return MerchantRefundReasonEnum.CUSTOMERREQUEST; + + if (value.Equals("RETURN")) + return MerchantRefundReasonEnum.RETURN; + + if (value.Equals("DUPLICATE")) + return MerchantRefundReasonEnum.DUPLICATE; + + if (value.Equals("OTHER")) + return MerchantRefundReasonEnum.OTHER; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// amount (required). - /// applicationInfo. - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.. - /// The merchant account that is used to process the payment. (required). - /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** . - /// Your reference for the refund request. Maximum length: 80 characters.. - /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/).. - /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails.. - public PaymentRefundRequest(Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), List lineItems = default(List), string merchantAccount = default(string), MerchantRefundReasonEnum? merchantRefundReason = default(MerchantRefundReasonEnum?), string reference = default(string), List splits = default(List), string store = default(string)) + /// + /// + /// + public static string MerchantRefundReasonEnumToJsonValue(MerchantRefundReasonEnum? value) { - this.Amount = amount; - this.MerchantAccount = merchantAccount; - this.ApplicationInfo = applicationInfo; - this.LineItems = lineItems; - this.MerchantRefundReason = merchantRefundReason; - this.Reference = reference; - this.Splits = splits; - this.Store = store; + if (value == null) + return null; + + if (value == MerchantRefundReasonEnum.FRAUD) + return "FRAUD"; + + if (value == MerchantRefundReasonEnum.CUSTOMERREQUEST) + return "CUSTOMER REQUEST"; + + if (value == MerchantRefundReasonEnum.RETURN) + return "RETURN"; + + if (value == MerchantRefundReasonEnum.DUPLICATE) + return "DUPLICATE"; + + if (value == MerchantRefundReasonEnum.OTHER) + return "OTHER"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of MerchantRefundReason + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantRefundReasonOption { get; private set; } + + /// + /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** + /// + /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** + [JsonPropertyName("merchantRefundReason")] + public MerchantRefundReasonEnum? MerchantRefundReason { get { return this.MerchantRefundReasonOption; } set { this.MerchantRefundReasonOption = new Option(value); } } + /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("amount")] public Amount Amount { get; set; } + /// + /// The merchant account that is used to process the payment. + /// + /// The merchant account that is used to process the payment. + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get; set; } + + /// + /// Used to track the state of ApplicationInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ApplicationInfoOption { get; private set; } + /// /// Gets or Sets ApplicationInfo /// - [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; set; } + [JsonPropertyName("applicationInfo")] + public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + + /// + /// Used to track the state of LineItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LineItemsOption { get; private set; } /// /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. /// /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - [DataMember(Name = "lineItems", EmitDefaultValue = false)] - public List LineItems { get; set; } + [JsonPropertyName("lineItems")] + public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } /// - /// The merchant account that is used to process the payment. + /// Used to track the state of Reference /// - /// The merchant account that is used to process the payment. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// Your reference for the refund request. Maximum length: 80 characters. /// /// Your reference for the refund request. Maximum length: 80 characters. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Splits + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SplitsOption { get; private set; } /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). - [DataMember(Name = "splits", EmitDefaultValue = false)] - public List Splits { get; set; } + [JsonPropertyName("splits")] + public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } + + /// + /// Used to track the state of Store + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoreOption { get; private set; } /// /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. /// /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. - [DataMember(Name = "store", EmitDefaultValue = false)] - public string Store { get; set; } + [JsonPropertyName("store")] + public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -162,9 +272,9 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PaymentRefundRequest {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantRefundReason: ").Append(MerchantRefundReason).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); @@ -174,129 +284,203 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentRefundRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentRefundRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentRefundRequest); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentRefundRequest instances are equal - /// - /// Instance of PaymentRefundRequest to be compared - /// Boolean - public bool Equals(PaymentRefundRequest input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option merchantAccount = default; + Option applicationInfo = default; + Option> lineItems = default; + Option merchantRefundReason = default; + Option reference = default; + Option> splits = default; + Option store = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "applicationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "lineItems": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantRefundReason": + string merchantRefundReasonRawValue = utf8JsonReader.GetString(); + if (merchantRefundReasonRawValue != null) + merchantRefundReason = new Option(PaymentRefundRequest.MerchantRefundReasonEnumFromStringOrDefault(merchantRefundReasonRawValue)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "splits": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "store": + store = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.LineItems == input.LineItems || - this.LineItems != null && - input.LineItems != null && - this.LineItems.SequenceEqual(input.LineItems) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.MerchantRefundReason == input.MerchantRefundReason || - this.MerchantRefundReason.Equals(input.MerchantRefundReason) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.Splits == input.Splits || - this.Splits != null && - input.Splits != null && - this.Splits.SequenceEqual(input.Splits) - ) && - ( - this.Store == input.Store || - (this.Store != null && - this.Store.Equals(input.Store)) - ); + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class PaymentRefundRequest.", nameof(amount)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentRefundRequest.", nameof(merchantAccount)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentRefundRequest."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentRefundRequest."); + + if (applicationInfo.IsSet && applicationInfo.Value == null) + throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentRefundRequest."); + + if (lineItems.IsSet && lineItems.Value == null) + throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentRefundRequest."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentRefundRequest."); + + if (splits.IsSet && splits.Value == null) + throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentRefundRequest."); + + if (store.IsSet && store.Value == null) + throw new ArgumentNullException(nameof(store), "Property is not nullable for class PaymentRefundRequest."); + + return new PaymentRefundRequest(amount.Value, merchantAccount.Value, applicationInfo, lineItems, merchantRefundReason, reference, splits, store); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentRefundRequest paymentRefundRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.ApplicationInfo != null) - { - hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); - } - if (this.LineItems != null) - { - hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - hashCode = (hashCode * 59) + this.MerchantRefundReason.GetHashCode(); - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.Splits != null) - { - hashCode = (hashCode * 59) + this.Splits.GetHashCode(); - } - if (this.Store != null) - { - hashCode = (hashCode * 59) + this.Store.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentRefundRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentRefundRequest paymentRefundRequest, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentRefundRequest.Amount == null) + throw new ArgumentNullException(nameof(paymentRefundRequest.Amount), "Property is required for class PaymentRefundRequest."); + + if (paymentRefundRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentRefundRequest.MerchantAccount), "Property is required for class PaymentRefundRequest."); + + if (paymentRefundRequest.ApplicationInfoOption.IsSet && paymentRefundRequest.ApplicationInfo == null) + throw new ArgumentNullException(nameof(paymentRefundRequest.ApplicationInfo), "Property is required for class PaymentRefundRequest."); + + if (paymentRefundRequest.LineItemsOption.IsSet && paymentRefundRequest.LineItems == null) + throw new ArgumentNullException(nameof(paymentRefundRequest.LineItems), "Property is required for class PaymentRefundRequest."); + + if (paymentRefundRequest.ReferenceOption.IsSet && paymentRefundRequest.Reference == null) + throw new ArgumentNullException(nameof(paymentRefundRequest.Reference), "Property is required for class PaymentRefundRequest."); + + if (paymentRefundRequest.SplitsOption.IsSet && paymentRefundRequest.Splits == null) + throw new ArgumentNullException(nameof(paymentRefundRequest.Splits), "Property is required for class PaymentRefundRequest."); + + if (paymentRefundRequest.StoreOption.IsSet && paymentRefundRequest.Store == null) + throw new ArgumentNullException(nameof(paymentRefundRequest.Store), "Property is required for class PaymentRefundRequest."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, paymentRefundRequest.Amount, jsonSerializerOptions); + writer.WriteString("merchantAccount", paymentRefundRequest.MerchantAccount); + + if (paymentRefundRequest.ApplicationInfoOption.IsSet) + { + writer.WritePropertyName("applicationInfo"); + JsonSerializer.Serialize(writer, paymentRefundRequest.ApplicationInfo, jsonSerializerOptions); + } + if (paymentRefundRequest.LineItemsOption.IsSet) + { + writer.WritePropertyName("lineItems"); + JsonSerializer.Serialize(writer, paymentRefundRequest.LineItems, jsonSerializerOptions); + } + var merchantRefundReasonRawValue = PaymentRefundRequest.MerchantRefundReasonEnumToJsonValue(paymentRefundRequest.MerchantRefundReasonOption.Value.Value); + if (merchantRefundReasonRawValue != null) + writer.WriteString("merchantRefundReason", merchantRefundReasonRawValue); + else + writer.WriteNull("merchantRefundReason"); + + if (paymentRefundRequest.ReferenceOption.IsSet) + writer.WriteString("reference", paymentRefundRequest.Reference); + + if (paymentRefundRequest.SplitsOption.IsSet) + { + writer.WritePropertyName("splits"); + JsonSerializer.Serialize(writer, paymentRefundRequest.Splits, jsonSerializerOptions); + } + if (paymentRefundRequest.StoreOption.IsSet) + writer.WriteString("store", paymentRefundRequest.Store); } } - } diff --git a/Adyen/Model/Checkout/PaymentRefundResponse.cs b/Adyen/Model/Checkout/PaymentRefundResponse.cs index a4478de85..9e2249c41 100644 --- a/Adyen/Model/Checkout/PaymentRefundResponse.cs +++ b/Adyen/Model/Checkout/PaymentRefundResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,186 +14,335 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentRefundResponse /// - [DataContract(Name = "PaymentRefundResponse")] - public partial class PaymentRefundResponse : IEquatable, IValidatableObject + public partial class PaymentRefundResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The merchant account that is used to process the payment. + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. + /// Adyen's 16-character reference associated with the refund request. + /// The status of your request. This will always have the value **received**. + /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund. + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + /// Your reason for the refund request. + /// Your reference for the refund request. + /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). + /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. + [JsonConstructor] + public PaymentRefundResponse(Amount amount, string merchantAccount, string paymentPspReference, string pspReference, StatusEnum status, Option capturePspReference = default, Option> lineItems = default, Option merchantRefundReason = default, Option reference = default, Option> splits = default, Option store = default) + { + Amount = amount; + MerchantAccount = merchantAccount; + PaymentPspReference = paymentPspReference; + PspReference = pspReference; + Status = status; + CapturePspReferenceOption = capturePspReference; + LineItemsOption = lineItems; + MerchantRefundReasonOption = merchantRefundReason; + ReferenceOption = reference; + SplitsOption = splits; + StoreOption = store; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The status of your request. This will always have the value **received**. + /// + /// The status of your request. This will always have the value **received**. + public enum StatusEnum + { + /// + /// Enum Received for value: received + /// + Received = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("received")) + return StatusEnum.Received; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("received")) + return StatusEnum.Received; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum value) + { + if (value == StatusEnum.Received) + return "received"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// The status of your request. This will always have the value **received**. + /// + /// The status of your request. This will always have the value **received**. + [JsonPropertyName("status")] + public StatusEnum Status { get; set; } + /// /// Your reason for the refund request. /// /// Your reason for the refund request. - [JsonConverter(typeof(StringEnumConverter))] public enum MerchantRefundReasonEnum { /// /// Enum FRAUD for value: FRAUD /// - [EnumMember(Value = "FRAUD")] FRAUD = 1, /// /// Enum CUSTOMERREQUEST for value: CUSTOMER REQUEST /// - [EnumMember(Value = "CUSTOMER REQUEST")] CUSTOMERREQUEST = 2, /// /// Enum RETURN for value: RETURN /// - [EnumMember(Value = "RETURN")] RETURN = 3, /// /// Enum DUPLICATE for value: DUPLICATE /// - [EnumMember(Value = "DUPLICATE")] DUPLICATE = 4, /// /// Enum OTHER for value: OTHER /// - [EnumMember(Value = "OTHER")] OTHER = 5 - } - /// - /// Your reason for the refund request. + /// Returns a /// - /// Your reason for the refund request. - [DataMember(Name = "merchantRefundReason", EmitDefaultValue = false)] - public MerchantRefundReasonEnum? MerchantRefundReason { get; set; } - /// - /// The status of your request. This will always have the value **received**. - /// - /// The status of your request. This will always have the value **received**. - [JsonConverter(typeof(StringEnumConverter))] - public enum StatusEnum + /// + /// + /// + public static MerchantRefundReasonEnum MerchantRefundReasonEnumFromString(string value) { - /// - /// Enum Received for value: received - /// - [EnumMember(Value = "received")] - Received = 1 + if (value.Equals("FRAUD")) + return MerchantRefundReasonEnum.FRAUD; - } + if (value.Equals("CUSTOMER REQUEST")) + return MerchantRefundReasonEnum.CUSTOMERREQUEST; + if (value.Equals("RETURN")) + return MerchantRefundReasonEnum.RETURN; + + if (value.Equals("DUPLICATE")) + return MerchantRefundReasonEnum.DUPLICATE; + + if (value.Equals("OTHER")) + return MerchantRefundReasonEnum.OTHER; + + throw new NotImplementedException($"Could not convert value to type MerchantRefundReasonEnum: '{value}'"); + } /// - /// The status of your request. This will always have the value **received**. - /// - /// The status of your request. This will always have the value **received**. - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public StatusEnum Status { get; set; } - /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected PaymentRefundResponse() { } + /// + /// + public static MerchantRefundReasonEnum? MerchantRefundReasonEnumFromStringOrDefault(string value) + { + if (value.Equals("FRAUD")) + return MerchantRefundReasonEnum.FRAUD; + + if (value.Equals("CUSTOMER REQUEST")) + return MerchantRefundReasonEnum.CUSTOMERREQUEST; + + if (value.Equals("RETURN")) + return MerchantRefundReasonEnum.RETURN; + + if (value.Equals("DUPLICATE")) + return MerchantRefundReasonEnum.DUPLICATE; + + if (value.Equals("OTHER")) + return MerchantRefundReasonEnum.OTHER; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// amount (required). - /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund.. - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.. - /// The merchant account that is used to process the payment. (required). - /// Your reason for the refund request.. - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. (required). - /// Adyen's 16-character reference associated with the refund request. (required). - /// Your reference for the refund request.. - /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/).. - /// The status of your request. This will always have the value **received**. (required). - /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails.. - public PaymentRefundResponse(Amount amount = default(Amount), string capturePspReference = default(string), List lineItems = default(List), string merchantAccount = default(string), MerchantRefundReasonEnum? merchantRefundReason = default(MerchantRefundReasonEnum?), string paymentPspReference = default(string), string pspReference = default(string), string reference = default(string), List splits = default(List), StatusEnum status = default(StatusEnum), string store = default(string)) + /// + /// + /// + public static string MerchantRefundReasonEnumToJsonValue(MerchantRefundReasonEnum? value) { - this.Amount = amount; - this.MerchantAccount = merchantAccount; - this.PaymentPspReference = paymentPspReference; - this.PspReference = pspReference; - this.Status = status; - this.CapturePspReference = capturePspReference; - this.LineItems = lineItems; - this.MerchantRefundReason = merchantRefundReason; - this.Reference = reference; - this.Splits = splits; - this.Store = store; + if (value == null) + return null; + + if (value == MerchantRefundReasonEnum.FRAUD) + return "FRAUD"; + + if (value == MerchantRefundReasonEnum.CUSTOMERREQUEST) + return "CUSTOMER REQUEST"; + + if (value == MerchantRefundReasonEnum.RETURN) + return "RETURN"; + + if (value == MerchantRefundReasonEnum.DUPLICATE) + return "DUPLICATE"; + + if (value == MerchantRefundReasonEnum.OTHER) + return "OTHER"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// Gets or Sets Amount + /// Used to track the state of MerchantRefundReason /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantRefundReasonOption { get; private set; } /// - /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund. + /// Your reason for the refund request. /// - /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund. - [DataMember(Name = "capturePspReference", EmitDefaultValue = false)] - public string CapturePspReference { get; set; } + /// Your reason for the refund request. + [JsonPropertyName("merchantRefundReason")] + public MerchantRefundReasonEnum? MerchantRefundReason { get { return this.MerchantRefundReasonOption; } set { this.MerchantRefundReasonOption = new Option(value); } } /// - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + /// Gets or Sets Amount /// - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - [DataMember(Name = "lineItems", EmitDefaultValue = false)] - public List LineItems { get; set; } + [JsonPropertyName("amount")] + public Amount Amount { get; set; } /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantAccount")] public string MerchantAccount { get; set; } /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. - [DataMember(Name = "paymentPspReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("paymentPspReference")] public string PaymentPspReference { get; set; } /// /// Adyen's 16-character reference associated with the refund request. /// /// Adyen's 16-character reference associated with the refund request. - [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("pspReference")] public string PspReference { get; set; } + /// + /// Used to track the state of CapturePspReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CapturePspReferenceOption { get; private set; } + + /// + /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund. + /// + /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund. + [JsonPropertyName("capturePspReference")] + public string CapturePspReference { get { return this.CapturePspReferenceOption; } set { this.CapturePspReferenceOption = new Option(value); } } + + /// + /// Used to track the state of LineItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LineItemsOption { get; private set; } + + /// + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + /// + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + [JsonPropertyName("lineItems")] + public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } + /// /// Your reference for the refund request. /// /// Your reference for the refund request. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Splits + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SplitsOption { get; private set; } /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). - [DataMember(Name = "splits", EmitDefaultValue = false)] - public List Splits { get; set; } + [JsonPropertyName("splits")] + public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } + + /// + /// Used to track the state of Store + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoreOption { get; private set; } /// /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. /// /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. - [DataMember(Name = "store", EmitDefaultValue = false)] - public string Store { get; set; } + [JsonPropertyName("store")] + public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -205,167 +353,259 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PaymentRefundResponse {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" CapturePspReference: ").Append(CapturePspReference).Append("\n"); - sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); - sb.Append(" MerchantRefundReason: ").Append(MerchantRefundReason).Append("\n"); sb.Append(" PaymentPspReference: ").Append(PaymentPspReference).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" CapturePspReference: ").Append(CapturePspReference).Append("\n"); + sb.Append(" LineItems: ").Append(LineItems).Append("\n"); + sb.Append(" MerchantRefundReason: ").Append(MerchantRefundReason).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" Store: ").Append(Store).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentRefundResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentRefundResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentRefundResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentRefundResponse instances are equal - /// - /// Instance of PaymentRefundResponse to be compared - /// Boolean - public bool Equals(PaymentRefundResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option merchantAccount = default; + Option paymentPspReference = default; + Option pspReference = default; + Option status = default; + Option capturePspReference = default; + Option> lineItems = default; + Option merchantRefundReason = default; + Option reference = default; + Option> splits = default; + Option store = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "paymentPspReference": + paymentPspReference = new Option(utf8JsonReader.GetString()); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(PaymentRefundResponse.StatusEnumFromStringOrDefault(statusRawValue)); + break; + case "capturePspReference": + capturePspReference = new Option(utf8JsonReader.GetString()); + break; + case "lineItems": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantRefundReason": + string merchantRefundReasonRawValue = utf8JsonReader.GetString(); + if (merchantRefundReasonRawValue != null) + merchantRefundReason = new Option(PaymentRefundResponse.MerchantRefundReasonEnumFromStringOrDefault(merchantRefundReasonRawValue)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "splits": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "store": + store = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.CapturePspReference == input.CapturePspReference || - (this.CapturePspReference != null && - this.CapturePspReference.Equals(input.CapturePspReference)) - ) && - ( - this.LineItems == input.LineItems || - this.LineItems != null && - input.LineItems != null && - this.LineItems.SequenceEqual(input.LineItems) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.MerchantRefundReason == input.MerchantRefundReason || - this.MerchantRefundReason.Equals(input.MerchantRefundReason) - ) && - ( - this.PaymentPspReference == input.PaymentPspReference || - (this.PaymentPspReference != null && - this.PaymentPspReference.Equals(input.PaymentPspReference)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.Splits == input.Splits || - this.Splits != null && - input.Splits != null && - this.Splits.SequenceEqual(input.Splits) - ) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ) && - ( - this.Store == input.Store || - (this.Store != null && - this.Store.Equals(input.Store)) - ); + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class PaymentRefundResponse.", nameof(amount)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentRefundResponse.", nameof(merchantAccount)); + + if (!paymentPspReference.IsSet) + throw new ArgumentException("Property is required for class PaymentRefundResponse.", nameof(paymentPspReference)); + + if (!pspReference.IsSet) + throw new ArgumentException("Property is required for class PaymentRefundResponse.", nameof(pspReference)); + + if (!status.IsSet) + throw new ArgumentException("Property is required for class PaymentRefundResponse.", nameof(status)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentRefundResponse."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentRefundResponse."); + + if (paymentPspReference.IsSet && paymentPspReference.Value == null) + throw new ArgumentNullException(nameof(paymentPspReference), "Property is not nullable for class PaymentRefundResponse."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentRefundResponse."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaymentRefundResponse."); + + if (capturePspReference.IsSet && capturePspReference.Value == null) + throw new ArgumentNullException(nameof(capturePspReference), "Property is not nullable for class PaymentRefundResponse."); + + if (lineItems.IsSet && lineItems.Value == null) + throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentRefundResponse."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentRefundResponse."); + + if (splits.IsSet && splits.Value == null) + throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentRefundResponse."); + + if (store.IsSet && store.Value == null) + throw new ArgumentNullException(nameof(store), "Property is not nullable for class PaymentRefundResponse."); + + return new PaymentRefundResponse(amount.Value, merchantAccount.Value, paymentPspReference.Value, pspReference.Value, status.Value.Value, capturePspReference, lineItems, merchantRefundReason, reference, splits, store); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentRefundResponse paymentRefundResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.CapturePspReference != null) - { - hashCode = (hashCode * 59) + this.CapturePspReference.GetHashCode(); - } - if (this.LineItems != null) - { - hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - hashCode = (hashCode * 59) + this.MerchantRefundReason.GetHashCode(); - if (this.PaymentPspReference != null) - { - hashCode = (hashCode * 59) + this.PaymentPspReference.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.Splits != null) - { - hashCode = (hashCode * 59) + this.Splits.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - if (this.Store != null) - { - hashCode = (hashCode * 59) + this.Store.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentRefundResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentRefundResponse paymentRefundResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentRefundResponse.Amount == null) + throw new ArgumentNullException(nameof(paymentRefundResponse.Amount), "Property is required for class PaymentRefundResponse."); + + if (paymentRefundResponse.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentRefundResponse.MerchantAccount), "Property is required for class PaymentRefundResponse."); + + if (paymentRefundResponse.PaymentPspReference == null) + throw new ArgumentNullException(nameof(paymentRefundResponse.PaymentPspReference), "Property is required for class PaymentRefundResponse."); + + if (paymentRefundResponse.PspReference == null) + throw new ArgumentNullException(nameof(paymentRefundResponse.PspReference), "Property is required for class PaymentRefundResponse."); + + if (paymentRefundResponse.CapturePspReferenceOption.IsSet && paymentRefundResponse.CapturePspReference == null) + throw new ArgumentNullException(nameof(paymentRefundResponse.CapturePspReference), "Property is required for class PaymentRefundResponse."); + + if (paymentRefundResponse.LineItemsOption.IsSet && paymentRefundResponse.LineItems == null) + throw new ArgumentNullException(nameof(paymentRefundResponse.LineItems), "Property is required for class PaymentRefundResponse."); + + if (paymentRefundResponse.ReferenceOption.IsSet && paymentRefundResponse.Reference == null) + throw new ArgumentNullException(nameof(paymentRefundResponse.Reference), "Property is required for class PaymentRefundResponse."); + + if (paymentRefundResponse.SplitsOption.IsSet && paymentRefundResponse.Splits == null) + throw new ArgumentNullException(nameof(paymentRefundResponse.Splits), "Property is required for class PaymentRefundResponse."); + + if (paymentRefundResponse.StoreOption.IsSet && paymentRefundResponse.Store == null) + throw new ArgumentNullException(nameof(paymentRefundResponse.Store), "Property is required for class PaymentRefundResponse."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, paymentRefundResponse.Amount, jsonSerializerOptions); + writer.WriteString("merchantAccount", paymentRefundResponse.MerchantAccount); + + writer.WriteString("paymentPspReference", paymentRefundResponse.PaymentPspReference); + + writer.WriteString("pspReference", paymentRefundResponse.PspReference); + + var statusRawValue = PaymentRefundResponse.StatusEnumToJsonValue(paymentRefundResponse.Status); + writer.WriteString("status", statusRawValue); + if (paymentRefundResponse.CapturePspReferenceOption.IsSet) + writer.WriteString("capturePspReference", paymentRefundResponse.CapturePspReference); + + if (paymentRefundResponse.LineItemsOption.IsSet) + { + writer.WritePropertyName("lineItems"); + JsonSerializer.Serialize(writer, paymentRefundResponse.LineItems, jsonSerializerOptions); + } + var merchantRefundReasonRawValue = PaymentRefundResponse.MerchantRefundReasonEnumToJsonValue(paymentRefundResponse.MerchantRefundReasonOption.Value.Value); + if (merchantRefundReasonRawValue != null) + writer.WriteString("merchantRefundReason", merchantRefundReasonRawValue); + else + writer.WriteNull("merchantRefundReason"); + + if (paymentRefundResponse.ReferenceOption.IsSet) + writer.WriteString("reference", paymentRefundResponse.Reference); + + if (paymentRefundResponse.SplitsOption.IsSet) + { + writer.WritePropertyName("splits"); + JsonSerializer.Serialize(writer, paymentRefundResponse.Splits, jsonSerializerOptions); + } + if (paymentRefundResponse.StoreOption.IsSet) + writer.WriteString("store", paymentRefundResponse.Store); } } - } diff --git a/Adyen/Model/Checkout/PaymentRequest.cs b/Adyen/Model/Checkout/PaymentRequest.cs index 621c5c153..394488449 100644 --- a/Adyen/Model/Checkout/PaymentRequest.cs +++ b/Adyen/Model/Checkout/PaymentRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,795 +14,1530 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentRequest /// - [DataContract(Name = "PaymentRequest")] - public partial class PaymentRequest : IEquatable, IValidatableObject + public partial class PaymentRequest : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// amount + /// The merchant account identifier, with which you want to process the transaction. + /// paymentMethod + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.example.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// accountInfo + /// additionalAmount + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + /// applicationInfo + /// authenticationData + /// bankAccount + /// billingAddress + /// browserInfo + /// The delay between the authorisation and scheduled auto-capture, specified in hours. + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web + /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + /// company + /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// dccQuote + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + /// deliveryAddress + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. + /// enhancedSchemeData + /// The type of the entity the payment is processed for. + /// An integer value that is added to the normal fraud score. The value can be either positive or negative. + /// fundOrigin + /// fundRecipient + /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + /// installments + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. + /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. + /// mandate + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// merchantRiskIndicator + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + /// mpiData + /// order + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. + /// platformChargebackLogic + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + /// Minimum number of days between authorisations. Only for 3D Secure 2. + /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + /// riskData + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 + /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// The combination of a language code and a country code to specify the language to be used in the payment. + /// shopperName + /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. + /// The shopper's social security number. + /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. + /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). + /// This field contains additional information on the submerchant, who is onboarded to an acquirer through a payment facilitator or aggregator + /// surcharge + /// The shopper's telephone number. + /// threeDS2RequestData + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) + /// Set to true if the payment should be routed to a trusted MID. + [JsonConstructor] + public PaymentRequest(Amount amount, string merchantAccount, CheckoutPaymentMethod paymentMethod, string reference, string returnUrl, Option accountInfo = default, Option additionalAmount = default, Option> additionalData = default, Option applicationInfo = default, Option authenticationData = default, Option bankAccount = default, Option billingAddress = default, Option browserInfo = default, Option captureDelayHours = default, Option channel = default, Option checkoutAttemptId = default, Option company = default, Option conversionId = default, Option countryCode = default, Option dateOfBirth = default, Option dccQuote = default, Option deliverAt = default, Option deliveryAddress = default, Option deliveryDate = default, Option deviceFingerprint = default, Option enableOneClick = default, Option enablePayOut = default, Option enableRecurring = default, Option enhancedSchemeData = default, Option entityType = default, Option fraudOffset = default, Option fundOrigin = default, Option fundRecipient = default, Option industryUsage = default, Option installments = default, Option> lineItems = default, Option> localizedShopperStatement = default, Option mandate = default, Option mcc = default, Option merchantOrderReference = default, Option merchantRiskIndicator = default, Option> metadata = default, Option mpiData = default, Option order = default, Option orderReference = default, Option origin = default, Option platformChargebackLogic = default, Option recurringExpiry = default, Option recurringFrequency = default, Option recurringProcessingModel = default, Option redirectFromIssuerMethod = default, Option redirectToIssuerMethod = default, Option riskData = default, Option sessionValidity = default, Option shopperConversionId = default, Option shopperEmail = default, Option shopperIP = default, Option shopperInteraction = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option shopperStatement = default, Option socialSecurityNumber = default, Option> splits = default, Option store = default, Option storePaymentMethod = default, Option> subMerchants = default, Option surcharge = default, Option telephoneNumber = default, Option threeDS2RequestData = default, Option threeDSAuthenticationOnly = default, Option trustedShopper = default) + { + Amount = amount; + MerchantAccount = merchantAccount; + PaymentMethod = paymentMethod; + Reference = reference; + ReturnUrl = returnUrl; + AccountInfoOption = accountInfo; + AdditionalAmountOption = additionalAmount; + AdditionalDataOption = additionalData; + ApplicationInfoOption = applicationInfo; + AuthenticationDataOption = authenticationData; + BankAccountOption = bankAccount; + BillingAddressOption = billingAddress; + BrowserInfoOption = browserInfo; + CaptureDelayHoursOption = captureDelayHours; + ChannelOption = channel; + CheckoutAttemptIdOption = checkoutAttemptId; + CompanyOption = company; + ConversionIdOption = conversionId; + CountryCodeOption = countryCode; + DateOfBirthOption = dateOfBirth; + DccQuoteOption = dccQuote; + DeliverAtOption = deliverAt; + DeliveryAddressOption = deliveryAddress; + DeliveryDateOption = deliveryDate; + DeviceFingerprintOption = deviceFingerprint; + EnableOneClickOption = enableOneClick; + EnablePayOutOption = enablePayOut; + EnableRecurringOption = enableRecurring; + EnhancedSchemeDataOption = enhancedSchemeData; + EntityTypeOption = entityType; + FraudOffsetOption = fraudOffset; + FundOriginOption = fundOrigin; + FundRecipientOption = fundRecipient; + IndustryUsageOption = industryUsage; + InstallmentsOption = installments; + LineItemsOption = lineItems; + LocalizedShopperStatementOption = localizedShopperStatement; + MandateOption = mandate; + MccOption = mcc; + MerchantOrderReferenceOption = merchantOrderReference; + MerchantRiskIndicatorOption = merchantRiskIndicator; + MetadataOption = metadata; + MpiDataOption = mpiData; + OrderOption = order; + OrderReferenceOption = orderReference; + OriginOption = origin; + PlatformChargebackLogicOption = platformChargebackLogic; + RecurringExpiryOption = recurringExpiry; + RecurringFrequencyOption = recurringFrequency; + RecurringProcessingModelOption = recurringProcessingModel; + RedirectFromIssuerMethodOption = redirectFromIssuerMethod; + RedirectToIssuerMethodOption = redirectToIssuerMethod; + RiskDataOption = riskData; + SessionValidityOption = sessionValidity; + ShopperConversionIdOption = shopperConversionId; + ShopperEmailOption = shopperEmail; + ShopperIPOption = shopperIP; + ShopperInteractionOption = shopperInteraction; + ShopperLocaleOption = shopperLocale; + ShopperNameOption = shopperName; + ShopperReferenceOption = shopperReference; + ShopperStatementOption = shopperStatement; + SocialSecurityNumberOption = socialSecurityNumber; + SplitsOption = splits; + StoreOption = store; + StorePaymentMethodOption = storePaymentMethod; + SubMerchantsOption = subMerchants; + SurchargeOption = surcharge; + TelephoneNumberOption = telephoneNumber; + ThreeDS2RequestDataOption = threeDS2RequestData; + ThreeDSAuthenticationOnlyOption = threeDSAuthenticationOnly; + TrustedShopperOption = trustedShopper; + OnCreated(); + } + + partial void OnCreated(); + /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web - [JsonConverter(typeof(StringEnumConverter))] public enum ChannelEnum { /// /// Enum IOS for value: iOS /// - [EnumMember(Value = "iOS")] IOS = 1, /// /// Enum Android for value: Android /// - [EnumMember(Value = "Android")] Android = 2, /// /// Enum Web for value: Web /// - [EnumMember(Value = "Web")] Web = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ChannelEnum ChannelEnumFromString(string value) + { + if (value.Equals("iOS")) + return ChannelEnum.IOS; + + if (value.Equals("Android")) + return ChannelEnum.Android; + + if (value.Equals("Web")) + return ChannelEnum.Web; + + throw new NotImplementedException($"Could not convert value to type ChannelEnum: '{value}'"); + } + /// + /// Returns a + /// + /// + /// + public static ChannelEnum? ChannelEnumFromStringOrDefault(string value) + { + if (value.Equals("iOS")) + return ChannelEnum.IOS; + + if (value.Equals("Android")) + return ChannelEnum.Android; + + if (value.Equals("Web")) + return ChannelEnum.Web; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChannelEnumToJsonValue(ChannelEnum? value) + { + if (value == ChannelEnum.IOS) + return "iOS"; + + if (value == ChannelEnum.Android) + return "Android"; + + if (value == ChannelEnum.Web) + return "Web"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Channel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChannelOption { get; private set; } /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web - [DataMember(Name = "channel", EmitDefaultValue = false)] - public ChannelEnum? Channel { get; set; } + [JsonPropertyName("channel")] + public ChannelEnum? Channel { get { return this.ChannelOption; } set { this.ChannelOption = new Option(value); } } + /// /// The type of the entity the payment is processed for. /// /// The type of the entity the payment is processed for. - [JsonConverter(typeof(StringEnumConverter))] public enum EntityTypeEnum { /// /// Enum NaturalPerson for value: NaturalPerson /// - [EnumMember(Value = "NaturalPerson")] NaturalPerson = 1, /// /// Enum CompanyName for value: CompanyName /// - [EnumMember(Value = "CompanyName")] CompanyName = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static EntityTypeEnum EntityTypeEnumFromString(string value) + { + if (value.Equals("NaturalPerson")) + return EntityTypeEnum.NaturalPerson; + + if (value.Equals("CompanyName")) + return EntityTypeEnum.CompanyName; + + throw new NotImplementedException($"Could not convert value to type EntityTypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static EntityTypeEnum? EntityTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("NaturalPerson")) + return EntityTypeEnum.NaturalPerson; + + if (value.Equals("CompanyName")) + return EntityTypeEnum.CompanyName; + + return null; + } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string EntityTypeEnumToJsonValue(EntityTypeEnum? value) + { + if (value == EntityTypeEnum.NaturalPerson) + return "NaturalPerson"; + + if (value == EntityTypeEnum.CompanyName) + return "CompanyName"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of EntityType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EntityTypeOption { get; private set; } /// /// The type of the entity the payment is processed for. /// /// The type of the entity the payment is processed for. - [DataMember(Name = "entityType", EmitDefaultValue = false)] - public EntityTypeEnum? EntityType { get; set; } + [JsonPropertyName("entityType")] + public EntityTypeEnum? EntityType { get { return this.EntityTypeOption; } set { this.EntityTypeOption = new Option(value); } } + /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - [JsonConverter(typeof(StringEnumConverter))] public enum IndustryUsageEnum { /// /// Enum DelayedCharge for value: delayedCharge /// - [EnumMember(Value = "delayedCharge")] DelayedCharge = 1, /// /// Enum Installment for value: installment /// - [EnumMember(Value = "installment")] Installment = 2, /// /// Enum NoShow for value: noShow /// - [EnumMember(Value = "noShow")] NoShow = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static IndustryUsageEnum IndustryUsageEnumFromString(string value) + { + if (value.Equals("delayedCharge")) + return IndustryUsageEnum.DelayedCharge; + + if (value.Equals("installment")) + return IndustryUsageEnum.Installment; + + if (value.Equals("noShow")) + return IndustryUsageEnum.NoShow; + + throw new NotImplementedException($"Could not convert value to type IndustryUsageEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static IndustryUsageEnum? IndustryUsageEnumFromStringOrDefault(string value) + { + if (value.Equals("delayedCharge")) + return IndustryUsageEnum.DelayedCharge; + + if (value.Equals("installment")) + return IndustryUsageEnum.Installment; + + if (value.Equals("noShow")) + return IndustryUsageEnum.NoShow; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string IndustryUsageEnumToJsonValue(IndustryUsageEnum? value) + { + if (value == IndustryUsageEnum.DelayedCharge) + return "delayedCharge"; + + if (value == IndustryUsageEnum.Installment) + return "installment"; + if (value == IndustryUsageEnum.NoShow) + return "noShow"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of IndustryUsage + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IndustryUsageOption { get; private set; } /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - [DataMember(Name = "industryUsage", EmitDefaultValue = false)] - public IndustryUsageEnum? IndustryUsage { get; set; } + [JsonPropertyName("industryUsage")] + public IndustryUsageEnum? IndustryUsage { get { return this.IndustryUsageOption; } set { this.IndustryUsageOption = new Option(value); } } + /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// - [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// - [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// - [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) + { + if (value == RecurringProcessingModelEnum.CardOnFile) + return "CardOnFile"; + + if (value == RecurringProcessingModelEnum.Subscription) + return "Subscription"; + + if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) + return "UnscheduledCardOnFile"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of RecurringProcessingModel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] - public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } + [JsonPropertyName("recurringProcessingModel")] + public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } + /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [JsonConverter(typeof(StringEnumConverter))] public enum ShopperInteractionEnum { /// /// Enum Ecommerce for value: Ecommerce /// - [EnumMember(Value = "Ecommerce")] Ecommerce = 1, /// /// Enum ContAuth for value: ContAuth /// - [EnumMember(Value = "ContAuth")] ContAuth = 2, /// /// Enum Moto for value: Moto /// - [EnumMember(Value = "Moto")] Moto = 3, /// /// Enum POS for value: POS /// - [EnumMember(Value = "POS")] POS = 4 - } - - /// - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - /// - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] - public ShopperInteractionEnum? ShopperInteraction { get; set; } /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected PaymentRequest() { } + /// + /// + /// + public static ShopperInteractionEnum ShopperInteractionEnumFromString(string value) + { + if (value.Equals("Ecommerce")) + return ShopperInteractionEnum.Ecommerce; + + if (value.Equals("ContAuth")) + return ShopperInteractionEnum.ContAuth; + + if (value.Equals("Moto")) + return ShopperInteractionEnum.Moto; + + if (value.Equals("POS")) + return ShopperInteractionEnum.POS; + + throw new NotImplementedException($"Could not convert value to type ShopperInteractionEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - /// accountInfo. - /// additionalAmount. - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. - /// amount (required). - /// applicationInfo. - /// authenticationData. - /// bankAccount. - /// billingAddress. - /// browserInfo. - /// The delay between the authorisation and scheduled auto-capture, specified in hours.. - /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web. - /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey.. - /// company. - /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey.. - /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE. - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. - /// dccQuote. - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00. - /// deliveryAddress. - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00. - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting).. - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition).. - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts.. - /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments.. - /// enhancedSchemeData. - /// The type of the entity the payment is processed for.. - /// An integer value that is added to the normal fraud score. The value can be either positive or negative.. - /// fundOrigin. - /// fundRecipient. - /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment**. - /// installments. - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip.. - /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters.. - /// mandate. - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. - /// The merchant account identifier, with which you want to process the transaction. (required). - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.. - /// merchantRiskIndicator. - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. . - /// mpiData. - /// order. - /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead.. - /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from.. - /// paymentMethod (required). - /// platformChargebackLogic. - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2.. - /// Minimum number of days between authorisations. Only for 3D Secure 2.. - /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer.. - /// Specifies the redirect method (GET or POST) when redirecting to the issuer.. - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. (required). - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.example.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. (required). - /// riskData. - /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00. - /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates.. - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations.. - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new).. - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. - /// The combination of a language code and a country code to specify the language to be used in the payment.. - /// shopperName. - /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address.. - /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**.. - /// The shopper's social security number.. - /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).. - /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment.. - /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types).. - /// This field contains additional information on the submerchant, who is onboarded to an acquirer through a payment facilitator or aggregator. - /// surcharge. - /// The shopper's telephone number.. - /// threeDS2RequestData. - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false). - /// Set to true if the payment should be routed to a trusted MID.. - public PaymentRequest(AccountInfo accountInfo = default(AccountInfo), Amount additionalAmount = default(Amount), Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), AuthenticationData authenticationData = default(AuthenticationData), CheckoutBankAccount bankAccount = default(CheckoutBankAccount), BillingAddress billingAddress = default(BillingAddress), BrowserInfo browserInfo = default(BrowserInfo), int? captureDelayHours = default(int?), ChannelEnum? channel = default(ChannelEnum?), string checkoutAttemptId = default(string), Company company = default(Company), string conversionId = default(string), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), ForexQuote dccQuote = default(ForexQuote), DateTime deliverAt = default(DateTime), DeliveryAddress deliveryAddress = default(DeliveryAddress), DateTime deliveryDate = default(DateTime), string deviceFingerprint = default(string), bool? enableOneClick = default(bool?), bool? enablePayOut = default(bool?), bool? enableRecurring = default(bool?), EnhancedSchemeData enhancedSchemeData = default(EnhancedSchemeData), EntityTypeEnum? entityType = default(EntityTypeEnum?), int? fraudOffset = default(int?), FundOrigin fundOrigin = default(FundOrigin), FundRecipient fundRecipient = default(FundRecipient), IndustryUsageEnum? industryUsage = default(IndustryUsageEnum?), Installments installments = default(Installments), List lineItems = default(List), Dictionary localizedShopperStatement = default(Dictionary), Mandate mandate = default(Mandate), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), MerchantRiskIndicator merchantRiskIndicator = default(MerchantRiskIndicator), Dictionary metadata = default(Dictionary), ThreeDSecureData mpiData = default(ThreeDSecureData), EncryptedOrderData order = default(EncryptedOrderData), string orderReference = default(string), string origin = default(string), CheckoutPaymentMethod paymentMethod = default(CheckoutPaymentMethod), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), string recurringExpiry = default(string), string recurringFrequency = default(string), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string redirectFromIssuerMethod = default(string), string redirectToIssuerMethod = default(string), string reference = default(string), string returnUrl = default(string), RiskData riskData = default(RiskData), string sessionValidity = default(string), string shopperConversionId = default(string), string shopperEmail = default(string), string shopperIP = default(string), ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), string socialSecurityNumber = default(string), List splits = default(List), string store = default(string), bool? storePaymentMethod = default(bool?), List subMerchants = default(List), Surcharge surcharge = default(Surcharge), string telephoneNumber = default(string), ThreeDS2RequestFields threeDS2RequestData = default(ThreeDS2RequestFields), bool? threeDSAuthenticationOnly = false, bool? trustedShopper = default(bool?)) + /// + /// + public static ShopperInteractionEnum? ShopperInteractionEnumFromStringOrDefault(string value) { - this.Amount = amount; - this.MerchantAccount = merchantAccount; - this.PaymentMethod = paymentMethod; - this.Reference = reference; - this.ReturnUrl = returnUrl; - this.AccountInfo = accountInfo; - this.AdditionalAmount = additionalAmount; - this.AdditionalData = additionalData; - this.ApplicationInfo = applicationInfo; - this.AuthenticationData = authenticationData; - this.BankAccount = bankAccount; - this.BillingAddress = billingAddress; - this.BrowserInfo = browserInfo; - this.CaptureDelayHours = captureDelayHours; - this.Channel = channel; - this.CheckoutAttemptId = checkoutAttemptId; - this.Company = company; - this.ConversionId = conversionId; - this.CountryCode = countryCode; - this.DateOfBirth = dateOfBirth; - this.DccQuote = dccQuote; - this.DeliverAt = deliverAt; - this.DeliveryAddress = deliveryAddress; - this.DeliveryDate = deliveryDate; - this.DeviceFingerprint = deviceFingerprint; - this.EnableOneClick = enableOneClick; - this.EnablePayOut = enablePayOut; - this.EnableRecurring = enableRecurring; - this.EnhancedSchemeData = enhancedSchemeData; - this.EntityType = entityType; - this.FraudOffset = fraudOffset; - this.FundOrigin = fundOrigin; - this.FundRecipient = fundRecipient; - this.IndustryUsage = industryUsage; - this.Installments = installments; - this.LineItems = lineItems; - this.LocalizedShopperStatement = localizedShopperStatement; - this.Mandate = mandate; - this.Mcc = mcc; - this.MerchantOrderReference = merchantOrderReference; - this.MerchantRiskIndicator = merchantRiskIndicator; - this.Metadata = metadata; - this.MpiData = mpiData; - this.Order = order; - this.OrderReference = orderReference; - this.Origin = origin; - this.PlatformChargebackLogic = platformChargebackLogic; - this.RecurringExpiry = recurringExpiry; - this.RecurringFrequency = recurringFrequency; - this.RecurringProcessingModel = recurringProcessingModel; - this.RedirectFromIssuerMethod = redirectFromIssuerMethod; - this.RedirectToIssuerMethod = redirectToIssuerMethod; - this.RiskData = riskData; - this.SessionValidity = sessionValidity; - this.ShopperConversionId = shopperConversionId; - this.ShopperEmail = shopperEmail; - this.ShopperIP = shopperIP; - this.ShopperInteraction = shopperInteraction; - this.ShopperLocale = shopperLocale; - this.ShopperName = shopperName; - this.ShopperReference = shopperReference; - this.ShopperStatement = shopperStatement; - this.SocialSecurityNumber = socialSecurityNumber; - this.Splits = splits; - this.Store = store; - this.StorePaymentMethod = storePaymentMethod; - this.SubMerchants = subMerchants; - this.Surcharge = surcharge; - this.TelephoneNumber = telephoneNumber; - this.ThreeDS2RequestData = threeDS2RequestData; - this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; - this.TrustedShopper = trustedShopper; + if (value.Equals("Ecommerce")) + return ShopperInteractionEnum.Ecommerce; + + if (value.Equals("ContAuth")) + return ShopperInteractionEnum.ContAuth; + + if (value.Equals("Moto")) + return ShopperInteractionEnum.Moto; + + if (value.Equals("POS")) + return ShopperInteractionEnum.POS; + + return null; } /// - /// Gets or Sets AccountInfo + /// Converts the to the json value /// - [DataMember(Name = "accountInfo", EmitDefaultValue = false)] - public AccountInfo AccountInfo { get; set; } + /// + /// + /// + public static string ShopperInteractionEnumToJsonValue(ShopperInteractionEnum? value) + { + if (value == ShopperInteractionEnum.Ecommerce) + return "Ecommerce"; + + if (value == ShopperInteractionEnum.ContAuth) + return "ContAuth"; + + if (value == ShopperInteractionEnum.Moto) + return "Moto"; + + if (value == ShopperInteractionEnum.POS) + return "POS"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// - /// Gets or Sets AdditionalAmount + /// Used to track the state of ShopperInteraction /// - [DataMember(Name = "additionalAmount", EmitDefaultValue = false)] - public Amount AdditionalAmount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperInteractionOption { get; private set; } /// - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - [DataMember(Name = "additionalData", EmitDefaultValue = false)] - public Dictionary AdditionalData { get; set; } + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + [JsonPropertyName("shopperInteraction")] + public ShopperInteractionEnum? ShopperInteraction { get { return this.ShopperInteractionOption; } set { this.ShopperInteractionOption = new Option(value); } } /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("amount")] public Amount Amount { get; set; } /// - /// Gets or Sets ApplicationInfo + /// The merchant account identifier, with which you want to process the transaction. /// - [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; set; } + /// The merchant account identifier, with which you want to process the transaction. + [JsonPropertyName("merchantAccount")] + public string MerchantAccount { get; set; } /// - /// Gets or Sets AuthenticationData + /// Gets or Sets PaymentMethod /// - [DataMember(Name = "authenticationData", EmitDefaultValue = false)] - public AuthenticationData AuthenticationData { get; set; } + [JsonPropertyName("paymentMethod")] + public CheckoutPaymentMethod PaymentMethod { get; set; } /// - /// Gets or Sets BankAccount + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. /// - [DataMember(Name = "bankAccount", EmitDefaultValue = false)] - public CheckoutBankAccount BankAccount { get; set; } + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + [JsonPropertyName("reference")] + public string Reference { get; set; } /// - /// Gets or Sets BillingAddress + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.example.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. /// - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public BillingAddress BillingAddress { get; set; } + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.example.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + [JsonPropertyName("returnUrl")] + public string ReturnUrl { get; set; } /// - /// Gets or Sets BrowserInfo + /// Used to track the state of AccountInfo /// - [DataMember(Name = "browserInfo", EmitDefaultValue = false)] - public BrowserInfo BrowserInfo { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountInfoOption { get; private set; } /// - /// The delay between the authorisation and scheduled auto-capture, specified in hours. + /// Gets or Sets AccountInfo /// - /// The delay between the authorisation and scheduled auto-capture, specified in hours. - [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] - public int? CaptureDelayHours { get; set; } + [JsonPropertyName("accountInfo")] + public AccountInfo AccountInfo { get { return this.AccountInfoOption; } set { this.AccountInfoOption = new Option(value); } } /// - /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + /// Used to track the state of AdditionalAmount /// - /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AdditionalAmountOption { get; private set; } /// - /// Gets or Sets Company + /// Gets or Sets AdditionalAmount /// - [DataMember(Name = "company", EmitDefaultValue = false)] - public Company Company { get; set; } + [JsonPropertyName("additionalAmount")] + public Amount AdditionalAmount { get { return this.AdditionalAmountOption; } set { this.AdditionalAmountOption = new Option(value); } } /// - /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + /// Used to track the state of AdditionalData /// - /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - [DataMember(Name = "conversionId", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v68. Use `checkoutAttemptId` instead")] - public string ConversionId { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AdditionalDataOption { get; private set; } /// - /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// - /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE - [DataMember(Name = "countryCode", EmitDefaultValue = false)] - public string CountryCode { get; set; } + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + [JsonPropertyName("additionalData")] + public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } /// - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// Used to track the state of ApplicationInfo /// - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] - public DateTime DateOfBirth { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ApplicationInfoOption { get; private set; } /// - /// Gets or Sets DccQuote + /// Gets or Sets ApplicationInfo /// - [DataMember(Name = "dccQuote", EmitDefaultValue = false)] - public ForexQuote DccQuote { get; set; } + [JsonPropertyName("applicationInfo")] + public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } /// - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + /// Used to track the state of AuthenticationData /// - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - [DataMember(Name = "deliverAt", EmitDefaultValue = false)] - public DateTime DeliverAt { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthenticationDataOption { get; private set; } /// - /// Gets or Sets DeliveryAddress + /// Gets or Sets AuthenticationData /// - [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] - public DeliveryAddress DeliveryAddress { get; set; } + [JsonPropertyName("authenticationData")] + public AuthenticationData AuthenticationData { get { return this.AuthenticationDataOption; } set { this.AuthenticationDataOption = new Option(value); } } /// - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + /// Used to track the state of BankAccount /// - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - [DataMember(Name = "deliveryDate", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v70. Use `deliverAt` instead.")] - public DateTime DeliveryDate { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankAccountOption { get; private set; } /// - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + /// Gets or Sets BankAccount /// - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - [DataMember(Name = "deviceFingerprint", EmitDefaultValue = false)] - public string DeviceFingerprint { get; set; } + [JsonPropertyName("bankAccount")] + public CheckoutBankAccount BankAccount { get { return this.BankAccountOption; } set { this.BankAccountOption = new Option(value); } } /// - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). + /// Used to track the state of BillingAddress /// - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). - [DataMember(Name = "enableOneClick", EmitDefaultValue = false)] - public bool? EnableOneClick { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressOption { get; private set; } /// - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + /// Gets or Sets BillingAddress /// - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. - [DataMember(Name = "enablePayOut", EmitDefaultValue = false)] - public bool? EnablePayOut { get; set; } + [JsonPropertyName("billingAddress")] + public BillingAddress BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } /// - /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. + /// Used to track the state of BrowserInfo /// - /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. - [DataMember(Name = "enableRecurring", EmitDefaultValue = false)] - public bool? EnableRecurring { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BrowserInfoOption { get; private set; } /// - /// Gets or Sets EnhancedSchemeData + /// Gets or Sets BrowserInfo /// - [DataMember(Name = "enhancedSchemeData", EmitDefaultValue = false)] - public EnhancedSchemeData EnhancedSchemeData { get; set; } + [JsonPropertyName("browserInfo")] + public BrowserInfo BrowserInfo { get { return this.BrowserInfoOption; } set { this.BrowserInfoOption = new Option(value); } } /// - /// An integer value that is added to the normal fraud score. The value can be either positive or negative. + /// Used to track the state of CaptureDelayHours /// - /// An integer value that is added to the normal fraud score. The value can be either positive or negative. - [DataMember(Name = "fraudOffset", EmitDefaultValue = false)] - public int? FraudOffset { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CaptureDelayHoursOption { get; private set; } /// - /// Gets or Sets FundOrigin + /// The delay between the authorisation and scheduled auto-capture, specified in hours. /// - [DataMember(Name = "fundOrigin", EmitDefaultValue = false)] - public FundOrigin FundOrigin { get; set; } + /// The delay between the authorisation and scheduled auto-capture, specified in hours. + [JsonPropertyName("captureDelayHours")] + public int? CaptureDelayHours { get { return this.CaptureDelayHoursOption; } set { this.CaptureDelayHoursOption = new Option(value); } } /// - /// Gets or Sets FundRecipient + /// Used to track the state of CheckoutAttemptId /// - [DataMember(Name = "fundRecipient", EmitDefaultValue = false)] - public FundRecipient FundRecipient { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// - /// Gets or Sets Installments + /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. /// - [DataMember(Name = "installments", EmitDefaultValue = false)] - public Installments Installments { get; set; } + /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } /// - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. + /// Used to track the state of Company /// - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. - [DataMember(Name = "lineItems", EmitDefaultValue = false)] - public List LineItems { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CompanyOption { get; private set; } /// - /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. + /// Gets or Sets Company /// - /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. - [DataMember(Name = "localizedShopperStatement", EmitDefaultValue = false)] - public Dictionary LocalizedShopperStatement { get; set; } + [JsonPropertyName("company")] + public Company Company { get { return this.CompanyOption; } set { this.CompanyOption = new Option(value); } } /// - /// Gets or Sets Mandate + /// Used to track the state of ConversionId /// - [DataMember(Name = "mandate", EmitDefaultValue = false)] - public Mandate Mandate { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ConversionIdOption { get; private set; } /// - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. /// - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - [DataMember(Name = "mcc", EmitDefaultValue = false)] - public string Mcc { get; set; } + /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + [JsonPropertyName("conversionId")] + [Obsolete] + public string ConversionId { get { return this.ConversionIdOption; } set { this.ConversionIdOption = new Option(value); } } /// - /// The merchant account identifier, with which you want to process the transaction. + /// Used to track the state of CountryCode /// - /// The merchant account identifier, with which you want to process the transaction. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] - public string MerchantAccount { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryCodeOption { get; private set; } /// - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE /// - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] - public string MerchantOrderReference { get; set; } + /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE + [JsonPropertyName("countryCode")] + public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } /// - /// Gets or Sets MerchantRiskIndicator + /// Used to track the state of DateOfBirth /// - [DataMember(Name = "merchantRiskIndicator", EmitDefaultValue = false)] - public MerchantRiskIndicator MerchantRiskIndicator { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DateOfBirthOption { get; private set; } /// - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - [DataMember(Name = "metadata", EmitDefaultValue = false)] - public Dictionary Metadata { get; set; } + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + [JsonPropertyName("dateOfBirth")] + public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } /// - /// Gets or Sets MpiData + /// Used to track the state of DccQuote /// - [DataMember(Name = "mpiData", EmitDefaultValue = false)] - public ThreeDSecureData MpiData { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DccQuoteOption { get; private set; } /// - /// Gets or Sets Order + /// Gets or Sets DccQuote /// - [DataMember(Name = "order", EmitDefaultValue = false)] - public EncryptedOrderData Order { get; set; } + [JsonPropertyName("dccQuote")] + public ForexQuote DccQuote { get { return this.DccQuoteOption; } set { this.DccQuoteOption = new Option(value); } } /// - /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + /// Used to track the state of DeliverAt /// - /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - [DataMember(Name = "orderReference", EmitDefaultValue = false)] - public string OrderReference { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliverAtOption { get; private set; } /// - /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 /// - /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. - [DataMember(Name = "origin", EmitDefaultValue = false)] - public string Origin { get; set; } + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + [JsonPropertyName("deliverAt")] + public DateTime? DeliverAt { get { return this.DeliverAtOption; } set { this.DeliverAtOption = new Option(value); } } /// - /// Gets or Sets PaymentMethod + /// Used to track the state of DeliveryAddress /// - [DataMember(Name = "paymentMethod", IsRequired = false, EmitDefaultValue = false)] - public CheckoutPaymentMethod PaymentMethod { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryAddressOption { get; private set; } /// - /// Gets or Sets PlatformChargebackLogic + /// Gets or Sets DeliveryAddress /// - [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] - public PlatformChargebackLogic PlatformChargebackLogic { get; set; } + [JsonPropertyName("deliveryAddress")] + public DeliveryAddress DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } /// - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + /// Used to track the state of DeliveryDate /// - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. - [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] - public string RecurringExpiry { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryDateOption { get; private set; } /// - /// Minimum number of days between authorisations. Only for 3D Secure 2. + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 /// - /// Minimum number of days between authorisations. Only for 3D Secure 2. - [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] - public string RecurringFrequency { get; set; } + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + [JsonPropertyName("deliveryDate")] + [Obsolete] + public DateTime? DeliveryDate { get { return this.DeliveryDateOption; } set { this.DeliveryDateOption = new Option(value); } } /// - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. + /// Used to track the state of DeviceFingerprint /// - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. - [DataMember(Name = "redirectFromIssuerMethod", EmitDefaultValue = false)] - public string RedirectFromIssuerMethod { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeviceFingerprintOption { get; private set; } /// - /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). /// - /// Specifies the redirect method (GET or POST) when redirecting to the issuer. - [DataMember(Name = "redirectToIssuerMethod", EmitDefaultValue = false)] - public string RedirectToIssuerMethod { get; set; } + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + [JsonPropertyName("deviceFingerprint")] + public string DeviceFingerprint { get { return this.DeviceFingerprintOption; } set { this.DeviceFingerprintOption = new Option(value); } } /// - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + /// Used to track the state of EnableOneClick /// - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnableOneClickOption { get; private set; } /// - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.example.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). /// - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.example.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. - [DataMember(Name = "returnUrl", IsRequired = false, EmitDefaultValue = false)] - public string ReturnUrl { get; set; } + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). + [JsonPropertyName("enableOneClick")] + public bool? EnableOneClick { get { return this.EnableOneClickOption; } set { this.EnableOneClickOption = new Option(value); } } /// - /// Gets or Sets RiskData + /// Used to track the state of EnablePayOut /// - [DataMember(Name = "riskData", EmitDefaultValue = false)] - public RiskData RiskData { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnablePayOutOption { get; private set; } /// - /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + /// + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + [JsonPropertyName("enablePayOut")] + public bool? EnablePayOut { get { return this.EnablePayOutOption; } set { this.EnablePayOutOption = new Option(value); } } + + /// + /// Used to track the state of EnableRecurring + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnableRecurringOption { get; private set; } + + /// + /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. + /// + /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. + [JsonPropertyName("enableRecurring")] + public bool? EnableRecurring { get { return this.EnableRecurringOption; } set { this.EnableRecurringOption = new Option(value); } } + + /// + /// Used to track the state of EnhancedSchemeData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EnhancedSchemeDataOption { get; private set; } + + /// + /// Gets or Sets EnhancedSchemeData + /// + [JsonPropertyName("enhancedSchemeData")] + public EnhancedSchemeData EnhancedSchemeData { get { return this.EnhancedSchemeDataOption; } set { this.EnhancedSchemeDataOption = new Option(value); } } + + /// + /// Used to track the state of FraudOffset + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FraudOffsetOption { get; private set; } + + /// + /// An integer value that is added to the normal fraud score. The value can be either positive or negative. + /// + /// An integer value that is added to the normal fraud score. The value can be either positive or negative. + [JsonPropertyName("fraudOffset")] + public int? FraudOffset { get { return this.FraudOffsetOption; } set { this.FraudOffsetOption = new Option(value); } } + + /// + /// Used to track the state of FundOrigin + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundOriginOption { get; private set; } + + /// + /// Gets or Sets FundOrigin + /// + [JsonPropertyName("fundOrigin")] + public FundOrigin FundOrigin { get { return this.FundOriginOption; } set { this.FundOriginOption = new Option(value); } } + + /// + /// Used to track the state of FundRecipient + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundRecipientOption { get; private set; } + + /// + /// Gets or Sets FundRecipient + /// + [JsonPropertyName("fundRecipient")] + public FundRecipient FundRecipient { get { return this.FundRecipientOption; } set { this.FundRecipientOption = new Option(value); } } + + /// + /// Used to track the state of Installments + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentsOption { get; private set; } + + /// + /// Gets or Sets Installments + /// + [JsonPropertyName("installments")] + public Installments Installments { get { return this.InstallmentsOption; } set { this.InstallmentsOption = new Option(value); } } + + /// + /// Used to track the state of LineItems + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LineItemsOption { get; private set; } + + /// + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. + /// + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. + [JsonPropertyName("lineItems")] + public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } + + /// + /// Used to track the state of LocalizedShopperStatement + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> LocalizedShopperStatementOption { get; private set; } + + /// + /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. + /// + /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. + [JsonPropertyName("localizedShopperStatement")] + public Dictionary LocalizedShopperStatement { get { return this.LocalizedShopperStatementOption; } set { this.LocalizedShopperStatementOption = new Option>(value); } } + + /// + /// Used to track the state of Mandate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MandateOption { get; private set; } + + /// + /// Gets or Sets Mandate + /// + [JsonPropertyName("mandate")] + public Mandate Mandate { get { return this.MandateOption; } set { this.MandateOption = new Option(value); } } + + /// + /// Used to track the state of Mcc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MccOption { get; private set; } + + /// + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + /// + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + [JsonPropertyName("mcc")] + public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } + + /// + /// Used to track the state of MerchantOrderReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantOrderReferenceOption { get; private set; } + + /// + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + [JsonPropertyName("merchantOrderReference")] + public string MerchantOrderReference { get { return this.MerchantOrderReferenceOption; } set { this.MerchantOrderReferenceOption = new Option(value); } } + + /// + /// Used to track the state of MerchantRiskIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantRiskIndicatorOption { get; private set; } + + /// + /// Gets or Sets MerchantRiskIndicator + /// + [JsonPropertyName("merchantRiskIndicator")] + public MerchantRiskIndicator MerchantRiskIndicator { get { return this.MerchantRiskIndicatorOption; } set { this.MerchantRiskIndicatorOption = new Option(value); } } + + /// + /// Used to track the state of Metadata + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> MetadataOption { get; private set; } + + /// + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + /// + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + [JsonPropertyName("metadata")] + public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } + + /// + /// Used to track the state of MpiData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MpiDataOption { get; private set; } + + /// + /// Gets or Sets MpiData + /// + [JsonPropertyName("mpiData")] + public ThreeDSecureData MpiData { get { return this.MpiDataOption; } set { this.MpiDataOption = new Option(value); } } + + /// + /// Used to track the state of Order + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OrderOption { get; private set; } + + /// + /// Gets or Sets Order + /// + [JsonPropertyName("order")] + public EncryptedOrderData Order { get { return this.OrderOption; } set { this.OrderOption = new Option(value); } } + + /// + /// Used to track the state of OrderReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OrderReferenceOption { get; private set; } + + /// + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + /// + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + [JsonPropertyName("orderReference")] + public string OrderReference { get { return this.OrderReferenceOption; } set { this.OrderReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Origin + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OriginOption { get; private set; } + + /// + /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. + /// + /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. + [JsonPropertyName("origin")] + public string Origin { get { return this.OriginOption; } set { this.OriginOption = new Option(value); } } + + /// + /// Used to track the state of PlatformChargebackLogic + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PlatformChargebackLogicOption { get; private set; } + + /// + /// Gets or Sets PlatformChargebackLogic + /// + [JsonPropertyName("platformChargebackLogic")] + public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } + + /// + /// Used to track the state of RecurringExpiry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringExpiryOption { get; private set; } + + /// + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + /// + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + [JsonPropertyName("recurringExpiry")] + public string RecurringExpiry { get { return this.RecurringExpiryOption; } set { this.RecurringExpiryOption = new Option(value); } } + + /// + /// Used to track the state of RecurringFrequency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringFrequencyOption { get; private set; } + + /// + /// Minimum number of days between authorisations. Only for 3D Secure 2. + /// + /// Minimum number of days between authorisations. Only for 3D Secure 2. + [JsonPropertyName("recurringFrequency")] + public string RecurringFrequency { get { return this.RecurringFrequencyOption; } set { this.RecurringFrequencyOption = new Option(value); } } + + /// + /// Used to track the state of RedirectFromIssuerMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RedirectFromIssuerMethodOption { get; private set; } + + /// + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. + /// + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. + [JsonPropertyName("redirectFromIssuerMethod")] + public string RedirectFromIssuerMethod { get { return this.RedirectFromIssuerMethodOption; } set { this.RedirectFromIssuerMethodOption = new Option(value); } } + + /// + /// Used to track the state of RedirectToIssuerMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RedirectToIssuerMethodOption { get; private set; } + + /// + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + /// + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + [JsonPropertyName("redirectToIssuerMethod")] + public string RedirectToIssuerMethod { get { return this.RedirectToIssuerMethodOption; } set { this.RedirectToIssuerMethodOption = new Option(value); } } + + /// + /// Used to track the state of RiskData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskDataOption { get; private set; } + + /// + /// Gets or Sets RiskData + /// + [JsonPropertyName("riskData")] + public RiskData RiskData { get { return this.RiskDataOption; } set { this.RiskDataOption = new Option(value); } } + + /// + /// Used to track the state of SessionValidity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SessionValidityOption { get; private set; } + + /// + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 /// /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 - [DataMember(Name = "sessionValidity", EmitDefaultValue = false)] - public string SessionValidity { get; set; } + [JsonPropertyName("sessionValidity")] + public string SessionValidity { get { return this.SessionValidityOption; } set { this.SessionValidityOption = new Option(value); } } + + /// + /// Used to track the state of ShopperConversionId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperConversionIdOption { get; private set; } /// /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. /// /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. - [DataMember(Name = "shopperConversionId", EmitDefaultValue = false)] - public string ShopperConversionId { get; set; } + [JsonPropertyName("shopperConversionId")] + public string ShopperConversionId { get { return this.ShopperConversionIdOption; } set { this.ShopperConversionIdOption = new Option(value); } } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. /// /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of ShopperIP + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperIPOption { get; private set; } /// /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). /// /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - [DataMember(Name = "shopperIP", EmitDefaultValue = false)] - public string ShopperIP { get; set; } + [JsonPropertyName("shopperIP")] + public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } + + /// + /// Used to track the state of ShopperLocale + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperLocaleOption { get; private set; } /// /// The combination of a language code and a country code to specify the language to be used in the payment. /// /// The combination of a language code and a country code to specify the language to be used in the payment. - [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] - public string ShopperLocale { get; set; } + [JsonPropertyName("shopperLocale")] + public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } + + /// + /// Used to track the state of ShopperName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNameOption { get; private set; } /// /// Gets or Sets ShopperName /// - [DataMember(Name = "shopperName", EmitDefaultValue = false)] - public Name ShopperName { get; set; } + [JsonPropertyName("shopperName")] + public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } + + /// + /// Used to track the state of ShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperReferenceOption { get; private set; } /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - [DataMember(Name = "shopperReference", EmitDefaultValue = false)] - public string ShopperReference { get; set; } + [JsonPropertyName("shopperReference")] + public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperStatement + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperStatementOption { get; private set; } /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] - public string ShopperStatement { get; set; } + [JsonPropertyName("shopperStatement")] + public string ShopperStatement { get { return this.ShopperStatementOption; } set { this.ShopperStatementOption = new Option(value); } } + + /// + /// Used to track the state of SocialSecurityNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SocialSecurityNumberOption { get; private set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] - public string SocialSecurityNumber { get; set; } + [JsonPropertyName("socialSecurityNumber")] + public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } + + /// + /// Used to track the state of Splits + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SplitsOption { get; private set; } /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - [DataMember(Name = "splits", EmitDefaultValue = false)] - public List Splits { get; set; } + [JsonPropertyName("splits")] + public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } + + /// + /// Used to track the state of Store + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoreOption { get; private set; } /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - [DataMember(Name = "store", EmitDefaultValue = false)] - public string Store { get; set; } + [JsonPropertyName("store")] + public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } + + /// + /// Used to track the state of StorePaymentMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StorePaymentMethodOption { get; private set; } /// /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). /// /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). - [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] - public bool? StorePaymentMethod { get; set; } + [JsonPropertyName("storePaymentMethod")] + public bool? StorePaymentMethod { get { return this.StorePaymentMethodOption; } set { this.StorePaymentMethodOption = new Option(value); } } + + /// + /// Used to track the state of SubMerchants + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SubMerchantsOption { get; private set; } /// /// This field contains additional information on the submerchant, who is onboarded to an acquirer through a payment facilitator or aggregator /// /// This field contains additional information on the submerchant, who is onboarded to an acquirer through a payment facilitator or aggregator - [DataMember(Name = "subMerchants", EmitDefaultValue = false)] - public List SubMerchants { get; set; } + [JsonPropertyName("subMerchants")] + public List SubMerchants { get { return this.SubMerchantsOption; } set { this.SubMerchantsOption = new Option>(value); } } + + /// + /// Used to track the state of Surcharge + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SurchargeOption { get; private set; } /// /// Gets or Sets Surcharge /// - [DataMember(Name = "surcharge", EmitDefaultValue = false)] - public Surcharge Surcharge { get; set; } + [JsonPropertyName("surcharge")] + public Surcharge Surcharge { get { return this.SurchargeOption; } set { this.SurchargeOption = new Option(value); } } + + /// + /// Used to track the state of TelephoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TelephoneNumberOption { get; private set; } /// /// The shopper's telephone number. /// /// The shopper's telephone number. - [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] - public string TelephoneNumber { get; set; } + [JsonPropertyName("telephoneNumber")] + public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2RequestData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2RequestDataOption { get; private set; } /// /// Gets or Sets ThreeDS2RequestData /// - [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] - public ThreeDS2RequestFields ThreeDS2RequestData { get; set; } + [JsonPropertyName("threeDS2RequestData")] + public ThreeDS2RequestFields ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSAuthenticationOnly + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSAuthenticationOnlyOption { get; private set; } /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.authenticationOnly` instead.")] - public bool? ThreeDSAuthenticationOnly { get; set; } + [JsonPropertyName("threeDSAuthenticationOnly")] + [Obsolete] + public bool? ThreeDSAuthenticationOnly { get { return this.ThreeDSAuthenticationOnlyOption; } set { this.ThreeDSAuthenticationOnlyOption = new Option(value); } } + + /// + /// Used to track the state of TrustedShopper + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TrustedShopperOption { get; private set; } /// /// Set to true if the payment should be routed to a trusted MID. /// /// Set to true if the payment should be routed to a trusted MID. - [DataMember(Name = "trustedShopper", EmitDefaultValue = false)] - public bool? TrustedShopper { get; set; } + [JsonPropertyName("trustedShopper")] + public bool? TrustedShopper { get { return this.TrustedShopperOption; } set { this.TrustedShopperOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -813,10 +1547,14 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentRequest {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" AccountInfo: ").Append(AccountInfo).Append("\n"); sb.Append(" AdditionalAmount: ").Append(AdditionalAmount).Append("\n"); sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); - sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" AuthenticationData: ").Append(AuthenticationData).Append("\n"); sb.Append(" BankAccount: ").Append(BankAccount).Append("\n"); @@ -848,7 +1586,6 @@ public override string ToString() sb.Append(" LocalizedShopperStatement: ").Append(LocalizedShopperStatement).Append("\n"); sb.Append(" Mandate: ").Append(Mandate).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); sb.Append(" MerchantRiskIndicator: ").Append(MerchantRiskIndicator).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); @@ -856,15 +1593,12 @@ public override string ToString() sb.Append(" Order: ").Append(Order).Append("\n"); sb.Append(" OrderReference: ").Append(OrderReference).Append("\n"); sb.Append(" Origin: ").Append(Origin).Append("\n"); - sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); sb.Append(" PlatformChargebackLogic: ").Append(PlatformChargebackLogic).Append("\n"); sb.Append(" RecurringExpiry: ").Append(RecurringExpiry).Append("\n"); sb.Append(" RecurringFrequency: ").Append(RecurringFrequency).Append("\n"); sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); sb.Append(" RedirectFromIssuerMethod: ").Append(RedirectFromIssuerMethod).Append("\n"); sb.Append(" RedirectToIssuerMethod: ").Append(RedirectToIssuerMethod).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" RiskData: ").Append(RiskData).Append("\n"); sb.Append(" SessionValidity: ").Append(SessionValidity).Append("\n"); sb.Append(" ShopperConversionId: ").Append(ShopperConversionId).Append("\n"); @@ -890,733 +1624,1176 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PaymentRequest); - } - - /// - /// Returns true if PaymentRequest instances are equal - /// - /// Instance of PaymentRequest to be compared - /// Boolean - public bool Equals(PaymentRequest input) - { - if (input == null) - { - return false; - } - return - ( - this.AccountInfo == input.AccountInfo || - (this.AccountInfo != null && - this.AccountInfo.Equals(input.AccountInfo)) - ) && - ( - this.AdditionalAmount == input.AdditionalAmount || - (this.AdditionalAmount != null && - this.AdditionalAmount.Equals(input.AdditionalAmount)) - ) && - ( - this.AdditionalData == input.AdditionalData || - this.AdditionalData != null && - input.AdditionalData != null && - this.AdditionalData.SequenceEqual(input.AdditionalData) - ) && - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.AuthenticationData == input.AuthenticationData || - (this.AuthenticationData != null && - this.AuthenticationData.Equals(input.AuthenticationData)) - ) && - ( - this.BankAccount == input.BankAccount || - (this.BankAccount != null && - this.BankAccount.Equals(input.BankAccount)) - ) && - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.BrowserInfo == input.BrowserInfo || - (this.BrowserInfo != null && - this.BrowserInfo.Equals(input.BrowserInfo)) - ) && - ( - this.CaptureDelayHours == input.CaptureDelayHours || - this.CaptureDelayHours.Equals(input.CaptureDelayHours) - ) && - ( - this.Channel == input.Channel || - this.Channel.Equals(input.Channel) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Company == input.Company || - (this.Company != null && - this.Company.Equals(input.Company)) - ) && - ( - this.ConversionId == input.ConversionId || - (this.ConversionId != null && - this.ConversionId.Equals(input.ConversionId)) - ) && - ( - this.CountryCode == input.CountryCode || - (this.CountryCode != null && - this.CountryCode.Equals(input.CountryCode)) - ) && - ( - this.DateOfBirth == input.DateOfBirth || - (this.DateOfBirth != null && - this.DateOfBirth.Equals(input.DateOfBirth)) - ) && - ( - this.DccQuote == input.DccQuote || - (this.DccQuote != null && - this.DccQuote.Equals(input.DccQuote)) - ) && - ( - this.DeliverAt == input.DeliverAt || - (this.DeliverAt != null && - this.DeliverAt.Equals(input.DeliverAt)) - ) && - ( - this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) - ) && - ( - this.DeliveryDate == input.DeliveryDate || - (this.DeliveryDate != null && - this.DeliveryDate.Equals(input.DeliveryDate)) - ) && - ( - this.DeviceFingerprint == input.DeviceFingerprint || - (this.DeviceFingerprint != null && - this.DeviceFingerprint.Equals(input.DeviceFingerprint)) - ) && - ( - this.EnableOneClick == input.EnableOneClick || - this.EnableOneClick.Equals(input.EnableOneClick) - ) && - ( - this.EnablePayOut == input.EnablePayOut || - this.EnablePayOut.Equals(input.EnablePayOut) - ) && - ( - this.EnableRecurring == input.EnableRecurring || - this.EnableRecurring.Equals(input.EnableRecurring) - ) && - ( - this.EnhancedSchemeData == input.EnhancedSchemeData || - (this.EnhancedSchemeData != null && - this.EnhancedSchemeData.Equals(input.EnhancedSchemeData)) - ) && - ( - this.EntityType == input.EntityType || - this.EntityType.Equals(input.EntityType) - ) && - ( - this.FraudOffset == input.FraudOffset || - this.FraudOffset.Equals(input.FraudOffset) - ) && - ( - this.FundOrigin == input.FundOrigin || - (this.FundOrigin != null && - this.FundOrigin.Equals(input.FundOrigin)) - ) && - ( - this.FundRecipient == input.FundRecipient || - (this.FundRecipient != null && - this.FundRecipient.Equals(input.FundRecipient)) - ) && - ( - this.IndustryUsage == input.IndustryUsage || - this.IndustryUsage.Equals(input.IndustryUsage) - ) && - ( - this.Installments == input.Installments || - (this.Installments != null && - this.Installments.Equals(input.Installments)) - ) && - ( - this.LineItems == input.LineItems || - this.LineItems != null && - input.LineItems != null && - this.LineItems.SequenceEqual(input.LineItems) - ) && - ( - this.LocalizedShopperStatement == input.LocalizedShopperStatement || - this.LocalizedShopperStatement != null && - input.LocalizedShopperStatement != null && - this.LocalizedShopperStatement.SequenceEqual(input.LocalizedShopperStatement) - ) && - ( - this.Mandate == input.Mandate || - (this.Mandate != null && - this.Mandate.Equals(input.Mandate)) - ) && - ( - this.Mcc == input.Mcc || - (this.Mcc != null && - this.Mcc.Equals(input.Mcc)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.MerchantOrderReference == input.MerchantOrderReference || - (this.MerchantOrderReference != null && - this.MerchantOrderReference.Equals(input.MerchantOrderReference)) - ) && - ( - this.MerchantRiskIndicator == input.MerchantRiskIndicator || - (this.MerchantRiskIndicator != null && - this.MerchantRiskIndicator.Equals(input.MerchantRiskIndicator)) - ) && - ( - this.Metadata == input.Metadata || - this.Metadata != null && - input.Metadata != null && - this.Metadata.SequenceEqual(input.Metadata) - ) && - ( - this.MpiData == input.MpiData || - (this.MpiData != null && - this.MpiData.Equals(input.MpiData)) - ) && - ( - this.Order == input.Order || - (this.Order != null && - this.Order.Equals(input.Order)) - ) && - ( - this.OrderReference == input.OrderReference || - (this.OrderReference != null && - this.OrderReference.Equals(input.OrderReference)) - ) && - ( - this.Origin == input.Origin || - (this.Origin != null && - this.Origin.Equals(input.Origin)) - ) && - ( - this.PaymentMethod == input.PaymentMethod || - (this.PaymentMethod != null && - this.PaymentMethod.Equals(input.PaymentMethod)) - ) && - ( - this.PlatformChargebackLogic == input.PlatformChargebackLogic || - (this.PlatformChargebackLogic != null && - this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) - ) && - ( - this.RecurringExpiry == input.RecurringExpiry || - (this.RecurringExpiry != null && - this.RecurringExpiry.Equals(input.RecurringExpiry)) - ) && - ( - this.RecurringFrequency == input.RecurringFrequency || - (this.RecurringFrequency != null && - this.RecurringFrequency.Equals(input.RecurringFrequency)) - ) && - ( - this.RecurringProcessingModel == input.RecurringProcessingModel || - this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) - ) && - ( - this.RedirectFromIssuerMethod == input.RedirectFromIssuerMethod || - (this.RedirectFromIssuerMethod != null && - this.RedirectFromIssuerMethod.Equals(input.RedirectFromIssuerMethod)) - ) && - ( - this.RedirectToIssuerMethod == input.RedirectToIssuerMethod || - (this.RedirectToIssuerMethod != null && - this.RedirectToIssuerMethod.Equals(input.RedirectToIssuerMethod)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.ReturnUrl == input.ReturnUrl || - (this.ReturnUrl != null && - this.ReturnUrl.Equals(input.ReturnUrl)) - ) && - ( - this.RiskData == input.RiskData || - (this.RiskData != null && - this.RiskData.Equals(input.RiskData)) - ) && - ( - this.SessionValidity == input.SessionValidity || - (this.SessionValidity != null && - this.SessionValidity.Equals(input.SessionValidity)) - ) && - ( - this.ShopperConversionId == input.ShopperConversionId || - (this.ShopperConversionId != null && - this.ShopperConversionId.Equals(input.ShopperConversionId)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.ShopperIP == input.ShopperIP || - (this.ShopperIP != null && - this.ShopperIP.Equals(input.ShopperIP)) - ) && - ( - this.ShopperInteraction == input.ShopperInteraction || - this.ShopperInteraction.Equals(input.ShopperInteraction) - ) && - ( - this.ShopperLocale == input.ShopperLocale || - (this.ShopperLocale != null && - this.ShopperLocale.Equals(input.ShopperLocale)) - ) && - ( - this.ShopperName == input.ShopperName || - (this.ShopperName != null && - this.ShopperName.Equals(input.ShopperName)) - ) && - ( - this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) - ) && - ( - this.ShopperStatement == input.ShopperStatement || - (this.ShopperStatement != null && - this.ShopperStatement.Equals(input.ShopperStatement)) - ) && - ( - this.SocialSecurityNumber == input.SocialSecurityNumber || - (this.SocialSecurityNumber != null && - this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) - ) && - ( - this.Splits == input.Splits || - this.Splits != null && - input.Splits != null && - this.Splits.SequenceEqual(input.Splits) - ) && - ( - this.Store == input.Store || - (this.Store != null && - this.Store.Equals(input.Store)) - ) && - ( - this.StorePaymentMethod == input.StorePaymentMethod || - this.StorePaymentMethod.Equals(input.StorePaymentMethod) - ) && - ( - this.SubMerchants == input.SubMerchants || - this.SubMerchants != null && - input.SubMerchants != null && - this.SubMerchants.SequenceEqual(input.SubMerchants) - ) && - ( - this.Surcharge == input.Surcharge || - (this.Surcharge != null && - this.Surcharge.Equals(input.Surcharge)) - ) && - ( - this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) - ) && - ( - this.ThreeDS2RequestData == input.ThreeDS2RequestData || - (this.ThreeDS2RequestData != null && - this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) - ) && - ( - this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || - this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) - ) && - ( - this.TrustedShopper == input.TrustedShopper || - this.TrustedShopper.Equals(input.TrustedShopper) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AccountInfo != null) - { - hashCode = (hashCode * 59) + this.AccountInfo.GetHashCode(); - } - if (this.AdditionalAmount != null) - { - hashCode = (hashCode * 59) + this.AdditionalAmount.GetHashCode(); - } - if (this.AdditionalData != null) - { - hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); - } - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.ApplicationInfo != null) - { - hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); - } - if (this.AuthenticationData != null) - { - hashCode = (hashCode * 59) + this.AuthenticationData.GetHashCode(); - } - if (this.BankAccount != null) - { - hashCode = (hashCode * 59) + this.BankAccount.GetHashCode(); - } - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.BrowserInfo != null) - { - hashCode = (hashCode * 59) + this.BrowserInfo.GetHashCode(); - } - hashCode = (hashCode * 59) + this.CaptureDelayHours.GetHashCode(); - hashCode = (hashCode * 59) + this.Channel.GetHashCode(); - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.Company != null) - { - hashCode = (hashCode * 59) + this.Company.GetHashCode(); - } - if (this.ConversionId != null) - { - hashCode = (hashCode * 59) + this.ConversionId.GetHashCode(); - } - if (this.CountryCode != null) - { - hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); - } - if (this.DateOfBirth != null) - { - hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); - } - if (this.DccQuote != null) - { - hashCode = (hashCode * 59) + this.DccQuote.GetHashCode(); - } - if (this.DeliverAt != null) - { - hashCode = (hashCode * 59) + this.DeliverAt.GetHashCode(); - } - if (this.DeliveryAddress != null) - { - hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); - } - if (this.DeliveryDate != null) - { - hashCode = (hashCode * 59) + this.DeliveryDate.GetHashCode(); - } - if (this.DeviceFingerprint != null) - { - hashCode = (hashCode * 59) + this.DeviceFingerprint.GetHashCode(); - } - hashCode = (hashCode * 59) + this.EnableOneClick.GetHashCode(); - hashCode = (hashCode * 59) + this.EnablePayOut.GetHashCode(); - hashCode = (hashCode * 59) + this.EnableRecurring.GetHashCode(); - if (this.EnhancedSchemeData != null) - { - hashCode = (hashCode * 59) + this.EnhancedSchemeData.GetHashCode(); - } - hashCode = (hashCode * 59) + this.EntityType.GetHashCode(); - hashCode = (hashCode * 59) + this.FraudOffset.GetHashCode(); - if (this.FundOrigin != null) - { - hashCode = (hashCode * 59) + this.FundOrigin.GetHashCode(); - } - if (this.FundRecipient != null) - { - hashCode = (hashCode * 59) + this.FundRecipient.GetHashCode(); - } - hashCode = (hashCode * 59) + this.IndustryUsage.GetHashCode(); - if (this.Installments != null) - { - hashCode = (hashCode * 59) + this.Installments.GetHashCode(); - } - if (this.LineItems != null) - { - hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); - } - if (this.LocalizedShopperStatement != null) - { - hashCode = (hashCode * 59) + this.LocalizedShopperStatement.GetHashCode(); - } - if (this.Mandate != null) - { - hashCode = (hashCode * 59) + this.Mandate.GetHashCode(); - } - if (this.Mcc != null) - { - hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.MerchantOrderReference != null) - { - hashCode = (hashCode * 59) + this.MerchantOrderReference.GetHashCode(); - } - if (this.MerchantRiskIndicator != null) - { - hashCode = (hashCode * 59) + this.MerchantRiskIndicator.GetHashCode(); - } - if (this.Metadata != null) - { - hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); - } - if (this.MpiData != null) - { - hashCode = (hashCode * 59) + this.MpiData.GetHashCode(); - } - if (this.Order != null) - { - hashCode = (hashCode * 59) + this.Order.GetHashCode(); - } - if (this.OrderReference != null) - { - hashCode = (hashCode * 59) + this.OrderReference.GetHashCode(); - } - if (this.Origin != null) - { - hashCode = (hashCode * 59) + this.Origin.GetHashCode(); - } - if (this.PaymentMethod != null) - { - hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); - } - if (this.PlatformChargebackLogic != null) - { - hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); - } - if (this.RecurringExpiry != null) - { - hashCode = (hashCode * 59) + this.RecurringExpiry.GetHashCode(); - } - if (this.RecurringFrequency != null) - { - hashCode = (hashCode * 59) + this.RecurringFrequency.GetHashCode(); - } - hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); - if (this.RedirectFromIssuerMethod != null) - { - hashCode = (hashCode * 59) + this.RedirectFromIssuerMethod.GetHashCode(); - } - if (this.RedirectToIssuerMethod != null) - { - hashCode = (hashCode * 59) + this.RedirectToIssuerMethod.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - if (this.ReturnUrl != null) - { - hashCode = (hashCode * 59) + this.ReturnUrl.GetHashCode(); - } - if (this.RiskData != null) - { - hashCode = (hashCode * 59) + this.RiskData.GetHashCode(); - } - if (this.SessionValidity != null) - { - hashCode = (hashCode * 59) + this.SessionValidity.GetHashCode(); - } - if (this.ShopperConversionId != null) - { - hashCode = (hashCode * 59) + this.ShopperConversionId.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.ShopperIP != null) - { - hashCode = (hashCode * 59) + this.ShopperIP.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ShopperInteraction.GetHashCode(); - if (this.ShopperLocale != null) - { - hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); - } - if (this.ShopperName != null) - { - hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); - } - if (this.ShopperReference != null) - { - hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); - } - if (this.ShopperStatement != null) - { - hashCode = (hashCode * 59) + this.ShopperStatement.GetHashCode(); - } - if (this.SocialSecurityNumber != null) - { - hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); - } - if (this.Splits != null) - { - hashCode = (hashCode * 59) + this.Splits.GetHashCode(); - } - if (this.Store != null) - { - hashCode = (hashCode * 59) + this.Store.GetHashCode(); - } - hashCode = (hashCode * 59) + this.StorePaymentMethod.GetHashCode(); - if (this.SubMerchants != null) - { - hashCode = (hashCode * 59) + this.SubMerchants.GetHashCode(); - } - if (this.Surcharge != null) - { - hashCode = (hashCode * 59) + this.Surcharge.GetHashCode(); - } - if (this.TelephoneNumber != null) - { - hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); - } - if (this.ThreeDS2RequestData != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ThreeDSAuthenticationOnly.GetHashCode(); - hashCode = (hashCode * 59) + this.TrustedShopper.GetHashCode(); - return hashCode; - } - } - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // CheckoutAttemptId (string) maxLength - if (this.CheckoutAttemptId != null && this.CheckoutAttemptId.Length > 256) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for CheckoutAttemptId, length must be less than 256.", new [] { "CheckoutAttemptId" }); - } + // CheckoutAttemptId (string) maxLength + if (this.CheckoutAttemptId != null && this.CheckoutAttemptId.Length > 256) + { + yield return new ValidationResult("Invalid value for CheckoutAttemptId, length must be less than 256.", new [] { "CheckoutAttemptId" }); + } // CountryCode (string) maxLength if (this.CountryCode != null && this.CountryCode.Length > 100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); + yield return new ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); } // DeviceFingerprint (string) maxLength if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); + yield return new ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); } // MerchantOrderReference (string) maxLength if (this.MerchantOrderReference != null && this.MerchantOrderReference.Length > 1000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for MerchantOrderReference, length must be less than 1000.", new [] { "MerchantOrderReference" }); + yield return new ValidationResult("Invalid value for MerchantOrderReference, length must be less than 1000.", new [] { "MerchantOrderReference" }); } // Origin (string) maxLength if (this.Origin != null && this.Origin.Length > 80) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, length must be less than 80.", new [] { "Origin" }); + yield return new ValidationResult("Invalid value for Origin, length must be less than 80.", new [] { "Origin" }); } // ShopperConversionId (string) maxLength if (this.ShopperConversionId != null && this.ShopperConversionId.Length > 256) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperConversionId, length must be less than 256.", new [] { "ShopperConversionId" }); + yield return new ValidationResult("Invalid value for ShopperConversionId, length must be less than 256.", new [] { "ShopperConversionId" }); } // ShopperIP (string) maxLength if (this.ShopperIP != null && this.ShopperIP.Length > 1000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperIP, length must be less than 1000.", new [] { "ShopperIP" }); + yield return new ValidationResult("Invalid value for ShopperIP, length must be less than 1000.", new [] { "ShopperIP" }); } // ShopperReference (string) maxLength if (this.ShopperReference != null && this.ShopperReference.Length > 256) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); } // ShopperReference (string) minLength if (this.ShopperReference != null && this.ShopperReference.Length < 3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); } // ShopperStatement (string) maxLength if (this.ShopperStatement != null && this.ShopperStatement.Length > 10000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperStatement, length must be less than 10000.", new [] { "ShopperStatement" }); + yield return new ValidationResult("Invalid value for ShopperStatement, length must be less than 10000.", new [] { "ShopperStatement" }); } // Store (string) maxLength if (this.Store != null && this.Store.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be less than 64.", new [] { "Store" }); + yield return new ValidationResult("Invalid value for Store, length must be less than 64.", new [] { "Store" }); } // Store (string) minLength if (this.Store != null && this.Store.Length < 1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be greater than 1.", new [] { "Store" }); + yield return new ValidationResult("Invalid value for Store, length must be greater than 1.", new [] { "Store" }); } yield break; } } + /// + /// A Json converter for type + /// + public class PaymentRequestJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateOfBirth + /// + public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize DeliverAt + /// + public static string DeliverAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize DeliveryDate + /// + public static string DeliveryDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override PaymentRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option merchantAccount = default; + Option paymentMethod = default; + Option reference = default; + Option returnUrl = default; + Option accountInfo = default; + Option additionalAmount = default; + Option> additionalData = default; + Option applicationInfo = default; + Option authenticationData = default; + Option bankAccount = default; + Option billingAddress = default; + Option browserInfo = default; + Option captureDelayHours = default; + Option channel = default; + Option checkoutAttemptId = default; + Option company = default; + Option conversionId = default; + Option countryCode = default; + Option dateOfBirth = default; + Option dccQuote = default; + Option deliverAt = default; + Option deliveryAddress = default; + Option deliveryDate = default; + Option deviceFingerprint = default; + Option enableOneClick = default; + Option enablePayOut = default; + Option enableRecurring = default; + Option enhancedSchemeData = default; + Option entityType = default; + Option fraudOffset = default; + Option fundOrigin = default; + Option fundRecipient = default; + Option industryUsage = default; + Option installments = default; + Option> lineItems = default; + Option> localizedShopperStatement = default; + Option mandate = default; + Option mcc = default; + Option merchantOrderReference = default; + Option merchantRiskIndicator = default; + Option> metadata = default; + Option mpiData = default; + Option order = default; + Option orderReference = default; + Option origin = default; + Option platformChargebackLogic = default; + Option recurringExpiry = default; + Option recurringFrequency = default; + Option recurringProcessingModel = default; + Option redirectFromIssuerMethod = default; + Option redirectToIssuerMethod = default; + Option riskData = default; + Option sessionValidity = default; + Option shopperConversionId = default; + Option shopperEmail = default; + Option shopperIP = default; + Option shopperInteraction = default; + Option shopperLocale = default; + Option shopperName = default; + Option shopperReference = default; + Option shopperStatement = default; + Option socialSecurityNumber = default; + Option> splits = default; + Option store = default; + Option storePaymentMethod = default; + Option> subMerchants = default; + Option surcharge = default; + Option telephoneNumber = default; + Option threeDS2RequestData = default; + Option threeDSAuthenticationOnly = default; + Option trustedShopper = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethod": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "returnUrl": + returnUrl = new Option(utf8JsonReader.GetString()); + break; + case "accountInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + accountInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "additionalAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "additionalData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "applicationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "authenticationData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + authenticationData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "bankAccount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + bankAccount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "billingAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + billingAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "browserInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + browserInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "captureDelayHours": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + captureDelayHours = new Option(utf8JsonReader.GetInt32()); + break; + case "channel": + string channelRawValue = utf8JsonReader.GetString(); + if (channelRawValue != null) + channel = new Option(PaymentRequest.ChannelEnumFromStringOrDefault(channelRawValue)); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "company": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + company = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "conversionId": + conversionId = new Option(utf8JsonReader.GetString()); + break; + case "countryCode": + countryCode = new Option(utf8JsonReader.GetString()); + break; + case "dateOfBirth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "dccQuote": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dccQuote = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliverAt": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliverAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliveryAddress": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliveryAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliveryDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliveryDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deviceFingerprint": + deviceFingerprint = new Option(utf8JsonReader.GetString()); + break; + case "enableOneClick": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enableOneClick = new Option(utf8JsonReader.GetBoolean()); + break; + case "enablePayOut": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enablePayOut = new Option(utf8JsonReader.GetBoolean()); + break; + case "enableRecurring": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enableRecurring = new Option(utf8JsonReader.GetBoolean()); + break; + case "enhancedSchemeData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enhancedSchemeData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "entityType": + string entityTypeRawValue = utf8JsonReader.GetString(); + if (entityTypeRawValue != null) + entityType = new Option(PaymentRequest.EntityTypeEnumFromStringOrDefault(entityTypeRawValue)); + break; + case "fraudOffset": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fraudOffset = new Option(utf8JsonReader.GetInt32()); + break; + case "fundOrigin": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fundOrigin = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fundRecipient": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fundRecipient = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "industryUsage": + string industryUsageRawValue = utf8JsonReader.GetString(); + if (industryUsageRawValue != null) + industryUsage = new Option(PaymentRequest.IndustryUsageEnumFromStringOrDefault(industryUsageRawValue)); + break; + case "installments": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + installments = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "lineItems": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "localizedShopperStatement": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + localizedShopperStatement = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mandate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mandate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mcc": + mcc = new Option(utf8JsonReader.GetString()); + break; + case "merchantOrderReference": + merchantOrderReference = new Option(utf8JsonReader.GetString()); + break; + case "merchantRiskIndicator": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + merchantRiskIndicator = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "metadata": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mpiData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mpiData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "order": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + order = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "orderReference": + orderReference = new Option(utf8JsonReader.GetString()); + break; + case "origin": + origin = new Option(utf8JsonReader.GetString()); + break; + case "platformChargebackLogic": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "recurringExpiry": + recurringExpiry = new Option(utf8JsonReader.GetString()); + break; + case "recurringFrequency": + recurringFrequency = new Option(utf8JsonReader.GetString()); + break; + case "recurringProcessingModel": + string recurringProcessingModelRawValue = utf8JsonReader.GetString(); + if (recurringProcessingModelRawValue != null) + recurringProcessingModel = new Option(PaymentRequest.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); + break; + case "redirectFromIssuerMethod": + redirectFromIssuerMethod = new Option(utf8JsonReader.GetString()); + break; + case "redirectToIssuerMethod": + redirectToIssuerMethod = new Option(utf8JsonReader.GetString()); + break; + case "riskData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + riskData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "sessionValidity": + sessionValidity = new Option(utf8JsonReader.GetString()); + break; + case "shopperConversionId": + shopperConversionId = new Option(utf8JsonReader.GetString()); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "shopperIP": + shopperIP = new Option(utf8JsonReader.GetString()); + break; + case "shopperInteraction": + string shopperInteractionRawValue = utf8JsonReader.GetString(); + if (shopperInteractionRawValue != null) + shopperInteraction = new Option(PaymentRequest.ShopperInteractionEnumFromStringOrDefault(shopperInteractionRawValue)); + break; + case "shopperLocale": + shopperLocale = new Option(utf8JsonReader.GetString()); + break; + case "shopperName": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shopperReference": + shopperReference = new Option(utf8JsonReader.GetString()); + break; + case "shopperStatement": + shopperStatement = new Option(utf8JsonReader.GetString()); + break; + case "socialSecurityNumber": + socialSecurityNumber = new Option(utf8JsonReader.GetString()); + break; + case "splits": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "store": + store = new Option(utf8JsonReader.GetString()); + break; + case "storePaymentMethod": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + storePaymentMethod = new Option(utf8JsonReader.GetBoolean()); + break; + case "subMerchants": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + subMerchants = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "surcharge": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + surcharge = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "telephoneNumber": + telephoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "threeDS2RequestData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDSAuthenticationOnly": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDSAuthenticationOnly = new Option(utf8JsonReader.GetBoolean()); + break; + case "trustedShopper": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + trustedShopper = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!amount.IsSet) + throw new ArgumentException("Property is required for class PaymentRequest.", nameof(amount)); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentRequest.", nameof(merchantAccount)); + + if (!paymentMethod.IsSet) + throw new ArgumentException("Property is required for class PaymentRequest.", nameof(paymentMethod)); + + if (!reference.IsSet) + throw new ArgumentException("Property is required for class PaymentRequest.", nameof(reference)); + + if (!returnUrl.IsSet) + throw new ArgumentException("Property is required for class PaymentRequest.", nameof(returnUrl)); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentRequest."); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentRequest."); + + if (paymentMethod.IsSet && paymentMethod.Value == null) + throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class PaymentRequest."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentRequest."); + + if (returnUrl.IsSet && returnUrl.Value == null) + throw new ArgumentNullException(nameof(returnUrl), "Property is not nullable for class PaymentRequest."); + + if (accountInfo.IsSet && accountInfo.Value == null) + throw new ArgumentNullException(nameof(accountInfo), "Property is not nullable for class PaymentRequest."); + + if (additionalAmount.IsSet && additionalAmount.Value == null) + throw new ArgumentNullException(nameof(additionalAmount), "Property is not nullable for class PaymentRequest."); + + if (additionalData.IsSet && additionalData.Value == null) + throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class PaymentRequest."); + + if (applicationInfo.IsSet && applicationInfo.Value == null) + throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentRequest."); + + if (authenticationData.IsSet && authenticationData.Value == null) + throw new ArgumentNullException(nameof(authenticationData), "Property is not nullable for class PaymentRequest."); + + if (bankAccount.IsSet && bankAccount.Value == null) + throw new ArgumentNullException(nameof(bankAccount), "Property is not nullable for class PaymentRequest."); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class PaymentRequest."); + + if (browserInfo.IsSet && browserInfo.Value == null) + throw new ArgumentNullException(nameof(browserInfo), "Property is not nullable for class PaymentRequest."); + + if (captureDelayHours.IsSet && captureDelayHours.Value == null) + throw new ArgumentNullException(nameof(captureDelayHours), "Property is not nullable for class PaymentRequest."); + + if (channel.IsSet && channel.Value == null) + throw new ArgumentNullException(nameof(channel), "Property is not nullable for class PaymentRequest."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PaymentRequest."); + + if (company.IsSet && company.Value == null) + throw new ArgumentNullException(nameof(company), "Property is not nullable for class PaymentRequest."); + + if (conversionId.IsSet && conversionId.Value == null) + throw new ArgumentNullException(nameof(conversionId), "Property is not nullable for class PaymentRequest."); + + if (countryCode.IsSet && countryCode.Value == null) + throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class PaymentRequest."); + + if (dateOfBirth.IsSet && dateOfBirth.Value == null) + throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class PaymentRequest."); + + if (dccQuote.IsSet && dccQuote.Value == null) + throw new ArgumentNullException(nameof(dccQuote), "Property is not nullable for class PaymentRequest."); + + if (deliverAt.IsSet && deliverAt.Value == null) + throw new ArgumentNullException(nameof(deliverAt), "Property is not nullable for class PaymentRequest."); + + if (deliveryAddress.IsSet && deliveryAddress.Value == null) + throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class PaymentRequest."); + + if (deliveryDate.IsSet && deliveryDate.Value == null) + throw new ArgumentNullException(nameof(deliveryDate), "Property is not nullable for class PaymentRequest."); + + if (deviceFingerprint.IsSet && deviceFingerprint.Value == null) + throw new ArgumentNullException(nameof(deviceFingerprint), "Property is not nullable for class PaymentRequest."); + + if (enableOneClick.IsSet && enableOneClick.Value == null) + throw new ArgumentNullException(nameof(enableOneClick), "Property is not nullable for class PaymentRequest."); + + if (enablePayOut.IsSet && enablePayOut.Value == null) + throw new ArgumentNullException(nameof(enablePayOut), "Property is not nullable for class PaymentRequest."); + + if (enableRecurring.IsSet && enableRecurring.Value == null) + throw new ArgumentNullException(nameof(enableRecurring), "Property is not nullable for class PaymentRequest."); + + if (enhancedSchemeData.IsSet && enhancedSchemeData.Value == null) + throw new ArgumentNullException(nameof(enhancedSchemeData), "Property is not nullable for class PaymentRequest."); + + if (entityType.IsSet && entityType.Value == null) + throw new ArgumentNullException(nameof(entityType), "Property is not nullable for class PaymentRequest."); + + if (fraudOffset.IsSet && fraudOffset.Value == null) + throw new ArgumentNullException(nameof(fraudOffset), "Property is not nullable for class PaymentRequest."); + + if (fundOrigin.IsSet && fundOrigin.Value == null) + throw new ArgumentNullException(nameof(fundOrigin), "Property is not nullable for class PaymentRequest."); + + if (fundRecipient.IsSet && fundRecipient.Value == null) + throw new ArgumentNullException(nameof(fundRecipient), "Property is not nullable for class PaymentRequest."); + + if (industryUsage.IsSet && industryUsage.Value == null) + throw new ArgumentNullException(nameof(industryUsage), "Property is not nullable for class PaymentRequest."); + + if (installments.IsSet && installments.Value == null) + throw new ArgumentNullException(nameof(installments), "Property is not nullable for class PaymentRequest."); + + if (lineItems.IsSet && lineItems.Value == null) + throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentRequest."); + + if (localizedShopperStatement.IsSet && localizedShopperStatement.Value == null) + throw new ArgumentNullException(nameof(localizedShopperStatement), "Property is not nullable for class PaymentRequest."); + + if (mandate.IsSet && mandate.Value == null) + throw new ArgumentNullException(nameof(mandate), "Property is not nullable for class PaymentRequest."); + + if (mcc.IsSet && mcc.Value == null) + throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class PaymentRequest."); + + if (merchantOrderReference.IsSet && merchantOrderReference.Value == null) + throw new ArgumentNullException(nameof(merchantOrderReference), "Property is not nullable for class PaymentRequest."); + + if (merchantRiskIndicator.IsSet && merchantRiskIndicator.Value == null) + throw new ArgumentNullException(nameof(merchantRiskIndicator), "Property is not nullable for class PaymentRequest."); + + if (metadata.IsSet && metadata.Value == null) + throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class PaymentRequest."); + + if (mpiData.IsSet && mpiData.Value == null) + throw new ArgumentNullException(nameof(mpiData), "Property is not nullable for class PaymentRequest."); + + if (order.IsSet && order.Value == null) + throw new ArgumentNullException(nameof(order), "Property is not nullable for class PaymentRequest."); + + if (orderReference.IsSet && orderReference.Value == null) + throw new ArgumentNullException(nameof(orderReference), "Property is not nullable for class PaymentRequest."); + + if (origin.IsSet && origin.Value == null) + throw new ArgumentNullException(nameof(origin), "Property is not nullable for class PaymentRequest."); + + if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) + throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class PaymentRequest."); + + if (recurringExpiry.IsSet && recurringExpiry.Value == null) + throw new ArgumentNullException(nameof(recurringExpiry), "Property is not nullable for class PaymentRequest."); + + if (recurringFrequency.IsSet && recurringFrequency.Value == null) + throw new ArgumentNullException(nameof(recurringFrequency), "Property is not nullable for class PaymentRequest."); + + if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) + throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class PaymentRequest."); + + if (redirectFromIssuerMethod.IsSet && redirectFromIssuerMethod.Value == null) + throw new ArgumentNullException(nameof(redirectFromIssuerMethod), "Property is not nullable for class PaymentRequest."); + + if (redirectToIssuerMethod.IsSet && redirectToIssuerMethod.Value == null) + throw new ArgumentNullException(nameof(redirectToIssuerMethod), "Property is not nullable for class PaymentRequest."); + + if (riskData.IsSet && riskData.Value == null) + throw new ArgumentNullException(nameof(riskData), "Property is not nullable for class PaymentRequest."); + + if (sessionValidity.IsSet && sessionValidity.Value == null) + throw new ArgumentNullException(nameof(sessionValidity), "Property is not nullable for class PaymentRequest."); + + if (shopperConversionId.IsSet && shopperConversionId.Value == null) + throw new ArgumentNullException(nameof(shopperConversionId), "Property is not nullable for class PaymentRequest."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class PaymentRequest."); + + if (shopperIP.IsSet && shopperIP.Value == null) + throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class PaymentRequest."); + + if (shopperInteraction.IsSet && shopperInteraction.Value == null) + throw new ArgumentNullException(nameof(shopperInteraction), "Property is not nullable for class PaymentRequest."); + + if (shopperLocale.IsSet && shopperLocale.Value == null) + throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class PaymentRequest."); + + if (shopperName.IsSet && shopperName.Value == null) + throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class PaymentRequest."); + + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class PaymentRequest."); + + if (shopperStatement.IsSet && shopperStatement.Value == null) + throw new ArgumentNullException(nameof(shopperStatement), "Property is not nullable for class PaymentRequest."); + + if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) + throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class PaymentRequest."); + + if (splits.IsSet && splits.Value == null) + throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentRequest."); + + if (store.IsSet && store.Value == null) + throw new ArgumentNullException(nameof(store), "Property is not nullable for class PaymentRequest."); + + if (storePaymentMethod.IsSet && storePaymentMethod.Value == null) + throw new ArgumentNullException(nameof(storePaymentMethod), "Property is not nullable for class PaymentRequest."); + + if (subMerchants.IsSet && subMerchants.Value == null) + throw new ArgumentNullException(nameof(subMerchants), "Property is not nullable for class PaymentRequest."); + + if (surcharge.IsSet && surcharge.Value == null) + throw new ArgumentNullException(nameof(surcharge), "Property is not nullable for class PaymentRequest."); + + if (telephoneNumber.IsSet && telephoneNumber.Value == null) + throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class PaymentRequest."); + + if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) + throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class PaymentRequest."); + + if (threeDSAuthenticationOnly.IsSet && threeDSAuthenticationOnly.Value == null) + throw new ArgumentNullException(nameof(threeDSAuthenticationOnly), "Property is not nullable for class PaymentRequest."); + + if (trustedShopper.IsSet && trustedShopper.Value == null) + throw new ArgumentNullException(nameof(trustedShopper), "Property is not nullable for class PaymentRequest."); + + return new PaymentRequest(amount.Value, merchantAccount.Value, paymentMethod.Value, reference.Value, returnUrl.Value, accountInfo, additionalAmount, additionalData, applicationInfo, authenticationData, bankAccount, billingAddress, browserInfo, captureDelayHours, channel, checkoutAttemptId, company, conversionId, countryCode, dateOfBirth, dccQuote, deliverAt, deliveryAddress, deliveryDate, deviceFingerprint, enableOneClick, enablePayOut, enableRecurring, enhancedSchemeData, entityType, fraudOffset, fundOrigin, fundRecipient, industryUsage, installments, lineItems, localizedShopperStatement, mandate, mcc, merchantOrderReference, merchantRiskIndicator, metadata, mpiData, order, orderReference, origin, platformChargebackLogic, recurringExpiry, recurringFrequency, recurringProcessingModel, redirectFromIssuerMethod, redirectToIssuerMethod, riskData, sessionValidity, shopperConversionId, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, socialSecurityNumber, splits, store, storePaymentMethod, subMerchants, surcharge, telephoneNumber, threeDS2RequestData, threeDSAuthenticationOnly, trustedShopper); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentRequest paymentRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, paymentRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentRequest paymentRequest, JsonSerializerOptions jsonSerializerOptions) + { + if (paymentRequest.Amount == null) + throw new ArgumentNullException(nameof(paymentRequest.Amount), "Property is required for class PaymentRequest."); + + if (paymentRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentRequest.MerchantAccount), "Property is required for class PaymentRequest."); + + if (paymentRequest.PaymentMethod == null) + throw new ArgumentNullException(nameof(paymentRequest.PaymentMethod), "Property is required for class PaymentRequest."); + + if (paymentRequest.Reference == null) + throw new ArgumentNullException(nameof(paymentRequest.Reference), "Property is required for class PaymentRequest."); + + if (paymentRequest.ReturnUrl == null) + throw new ArgumentNullException(nameof(paymentRequest.ReturnUrl), "Property is required for class PaymentRequest."); + + if (paymentRequest.AccountInfoOption.IsSet && paymentRequest.AccountInfo == null) + throw new ArgumentNullException(nameof(paymentRequest.AccountInfo), "Property is required for class PaymentRequest."); + + if (paymentRequest.AdditionalAmountOption.IsSet && paymentRequest.AdditionalAmount == null) + throw new ArgumentNullException(nameof(paymentRequest.AdditionalAmount), "Property is required for class PaymentRequest."); + + if (paymentRequest.AdditionalDataOption.IsSet && paymentRequest.AdditionalData == null) + throw new ArgumentNullException(nameof(paymentRequest.AdditionalData), "Property is required for class PaymentRequest."); + + if (paymentRequest.ApplicationInfoOption.IsSet && paymentRequest.ApplicationInfo == null) + throw new ArgumentNullException(nameof(paymentRequest.ApplicationInfo), "Property is required for class PaymentRequest."); + + if (paymentRequest.AuthenticationDataOption.IsSet && paymentRequest.AuthenticationData == null) + throw new ArgumentNullException(nameof(paymentRequest.AuthenticationData), "Property is required for class PaymentRequest."); + + if (paymentRequest.BankAccountOption.IsSet && paymentRequest.BankAccount == null) + throw new ArgumentNullException(nameof(paymentRequest.BankAccount), "Property is required for class PaymentRequest."); + + if (paymentRequest.BillingAddressOption.IsSet && paymentRequest.BillingAddress == null) + throw new ArgumentNullException(nameof(paymentRequest.BillingAddress), "Property is required for class PaymentRequest."); + + if (paymentRequest.BrowserInfoOption.IsSet && paymentRequest.BrowserInfo == null) + throw new ArgumentNullException(nameof(paymentRequest.BrowserInfo), "Property is required for class PaymentRequest."); + + if (paymentRequest.CheckoutAttemptIdOption.IsSet && paymentRequest.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(paymentRequest.CheckoutAttemptId), "Property is required for class PaymentRequest."); + + if (paymentRequest.CompanyOption.IsSet && paymentRequest.Company == null) + throw new ArgumentNullException(nameof(paymentRequest.Company), "Property is required for class PaymentRequest."); + + if (paymentRequest.ConversionIdOption.IsSet && paymentRequest.ConversionId == null) + throw new ArgumentNullException(nameof(paymentRequest.ConversionId), "Property is required for class PaymentRequest."); + + if (paymentRequest.CountryCodeOption.IsSet && paymentRequest.CountryCode == null) + throw new ArgumentNullException(nameof(paymentRequest.CountryCode), "Property is required for class PaymentRequest."); + + if (paymentRequest.DccQuoteOption.IsSet && paymentRequest.DccQuote == null) + throw new ArgumentNullException(nameof(paymentRequest.DccQuote), "Property is required for class PaymentRequest."); + + if (paymentRequest.DeliveryAddressOption.IsSet && paymentRequest.DeliveryAddress == null) + throw new ArgumentNullException(nameof(paymentRequest.DeliveryAddress), "Property is required for class PaymentRequest."); + + if (paymentRequest.DeviceFingerprintOption.IsSet && paymentRequest.DeviceFingerprint == null) + throw new ArgumentNullException(nameof(paymentRequest.DeviceFingerprint), "Property is required for class PaymentRequest."); + + if (paymentRequest.EnhancedSchemeDataOption.IsSet && paymentRequest.EnhancedSchemeData == null) + throw new ArgumentNullException(nameof(paymentRequest.EnhancedSchemeData), "Property is required for class PaymentRequest."); + + if (paymentRequest.FundOriginOption.IsSet && paymentRequest.FundOrigin == null) + throw new ArgumentNullException(nameof(paymentRequest.FundOrigin), "Property is required for class PaymentRequest."); + + if (paymentRequest.FundRecipientOption.IsSet && paymentRequest.FundRecipient == null) + throw new ArgumentNullException(nameof(paymentRequest.FundRecipient), "Property is required for class PaymentRequest."); + + if (paymentRequest.InstallmentsOption.IsSet && paymentRequest.Installments == null) + throw new ArgumentNullException(nameof(paymentRequest.Installments), "Property is required for class PaymentRequest."); + + if (paymentRequest.LineItemsOption.IsSet && paymentRequest.LineItems == null) + throw new ArgumentNullException(nameof(paymentRequest.LineItems), "Property is required for class PaymentRequest."); + + if (paymentRequest.LocalizedShopperStatementOption.IsSet && paymentRequest.LocalizedShopperStatement == null) + throw new ArgumentNullException(nameof(paymentRequest.LocalizedShopperStatement), "Property is required for class PaymentRequest."); + + if (paymentRequest.MandateOption.IsSet && paymentRequest.Mandate == null) + throw new ArgumentNullException(nameof(paymentRequest.Mandate), "Property is required for class PaymentRequest."); + + if (paymentRequest.MccOption.IsSet && paymentRequest.Mcc == null) + throw new ArgumentNullException(nameof(paymentRequest.Mcc), "Property is required for class PaymentRequest."); + + if (paymentRequest.MerchantOrderReferenceOption.IsSet && paymentRequest.MerchantOrderReference == null) + throw new ArgumentNullException(nameof(paymentRequest.MerchantOrderReference), "Property is required for class PaymentRequest."); + + if (paymentRequest.MerchantRiskIndicatorOption.IsSet && paymentRequest.MerchantRiskIndicator == null) + throw new ArgumentNullException(nameof(paymentRequest.MerchantRiskIndicator), "Property is required for class PaymentRequest."); + + if (paymentRequest.MetadataOption.IsSet && paymentRequest.Metadata == null) + throw new ArgumentNullException(nameof(paymentRequest.Metadata), "Property is required for class PaymentRequest."); + + if (paymentRequest.MpiDataOption.IsSet && paymentRequest.MpiData == null) + throw new ArgumentNullException(nameof(paymentRequest.MpiData), "Property is required for class PaymentRequest."); + + if (paymentRequest.OrderOption.IsSet && paymentRequest.Order == null) + throw new ArgumentNullException(nameof(paymentRequest.Order), "Property is required for class PaymentRequest."); + + if (paymentRequest.OrderReferenceOption.IsSet && paymentRequest.OrderReference == null) + throw new ArgumentNullException(nameof(paymentRequest.OrderReference), "Property is required for class PaymentRequest."); + + if (paymentRequest.OriginOption.IsSet && paymentRequest.Origin == null) + throw new ArgumentNullException(nameof(paymentRequest.Origin), "Property is required for class PaymentRequest."); + + if (paymentRequest.PlatformChargebackLogicOption.IsSet && paymentRequest.PlatformChargebackLogic == null) + throw new ArgumentNullException(nameof(paymentRequest.PlatformChargebackLogic), "Property is required for class PaymentRequest."); + + if (paymentRequest.RecurringExpiryOption.IsSet && paymentRequest.RecurringExpiry == null) + throw new ArgumentNullException(nameof(paymentRequest.RecurringExpiry), "Property is required for class PaymentRequest."); + + if (paymentRequest.RecurringFrequencyOption.IsSet && paymentRequest.RecurringFrequency == null) + throw new ArgumentNullException(nameof(paymentRequest.RecurringFrequency), "Property is required for class PaymentRequest."); + + if (paymentRequest.RedirectFromIssuerMethodOption.IsSet && paymentRequest.RedirectFromIssuerMethod == null) + throw new ArgumentNullException(nameof(paymentRequest.RedirectFromIssuerMethod), "Property is required for class PaymentRequest."); + + if (paymentRequest.RedirectToIssuerMethodOption.IsSet && paymentRequest.RedirectToIssuerMethod == null) + throw new ArgumentNullException(nameof(paymentRequest.RedirectToIssuerMethod), "Property is required for class PaymentRequest."); + + if (paymentRequest.RiskDataOption.IsSet && paymentRequest.RiskData == null) + throw new ArgumentNullException(nameof(paymentRequest.RiskData), "Property is required for class PaymentRequest."); + + if (paymentRequest.SessionValidityOption.IsSet && paymentRequest.SessionValidity == null) + throw new ArgumentNullException(nameof(paymentRequest.SessionValidity), "Property is required for class PaymentRequest."); + + if (paymentRequest.ShopperConversionIdOption.IsSet && paymentRequest.ShopperConversionId == null) + throw new ArgumentNullException(nameof(paymentRequest.ShopperConversionId), "Property is required for class PaymentRequest."); + + if (paymentRequest.ShopperEmailOption.IsSet && paymentRequest.ShopperEmail == null) + throw new ArgumentNullException(nameof(paymentRequest.ShopperEmail), "Property is required for class PaymentRequest."); + + if (paymentRequest.ShopperIPOption.IsSet && paymentRequest.ShopperIP == null) + throw new ArgumentNullException(nameof(paymentRequest.ShopperIP), "Property is required for class PaymentRequest."); + + if (paymentRequest.ShopperLocaleOption.IsSet && paymentRequest.ShopperLocale == null) + throw new ArgumentNullException(nameof(paymentRequest.ShopperLocale), "Property is required for class PaymentRequest."); + + if (paymentRequest.ShopperNameOption.IsSet && paymentRequest.ShopperName == null) + throw new ArgumentNullException(nameof(paymentRequest.ShopperName), "Property is required for class PaymentRequest."); + + if (paymentRequest.ShopperReferenceOption.IsSet && paymentRequest.ShopperReference == null) + throw new ArgumentNullException(nameof(paymentRequest.ShopperReference), "Property is required for class PaymentRequest."); + + if (paymentRequest.ShopperStatementOption.IsSet && paymentRequest.ShopperStatement == null) + throw new ArgumentNullException(nameof(paymentRequest.ShopperStatement), "Property is required for class PaymentRequest."); + + if (paymentRequest.SocialSecurityNumberOption.IsSet && paymentRequest.SocialSecurityNumber == null) + throw new ArgumentNullException(nameof(paymentRequest.SocialSecurityNumber), "Property is required for class PaymentRequest."); + + if (paymentRequest.SplitsOption.IsSet && paymentRequest.Splits == null) + throw new ArgumentNullException(nameof(paymentRequest.Splits), "Property is required for class PaymentRequest."); + + if (paymentRequest.StoreOption.IsSet && paymentRequest.Store == null) + throw new ArgumentNullException(nameof(paymentRequest.Store), "Property is required for class PaymentRequest."); + + if (paymentRequest.SubMerchantsOption.IsSet && paymentRequest.SubMerchants == null) + throw new ArgumentNullException(nameof(paymentRequest.SubMerchants), "Property is required for class PaymentRequest."); + + if (paymentRequest.SurchargeOption.IsSet && paymentRequest.Surcharge == null) + throw new ArgumentNullException(nameof(paymentRequest.Surcharge), "Property is required for class PaymentRequest."); + + if (paymentRequest.TelephoneNumberOption.IsSet && paymentRequest.TelephoneNumber == null) + throw new ArgumentNullException(nameof(paymentRequest.TelephoneNumber), "Property is required for class PaymentRequest."); + + if (paymentRequest.ThreeDS2RequestDataOption.IsSet && paymentRequest.ThreeDS2RequestData == null) + throw new ArgumentNullException(nameof(paymentRequest.ThreeDS2RequestData), "Property is required for class PaymentRequest."); + + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, paymentRequest.Amount, jsonSerializerOptions); + writer.WriteString("merchantAccount", paymentRequest.MerchantAccount); + + writer.WritePropertyName("paymentMethod"); + JsonSerializer.Serialize(writer, paymentRequest.PaymentMethod, jsonSerializerOptions); + writer.WriteString("reference", paymentRequest.Reference); + + writer.WriteString("returnUrl", paymentRequest.ReturnUrl); + + if (paymentRequest.AccountInfoOption.IsSet) + { + writer.WritePropertyName("accountInfo"); + JsonSerializer.Serialize(writer, paymentRequest.AccountInfo, jsonSerializerOptions); + } + if (paymentRequest.AdditionalAmountOption.IsSet) + { + writer.WritePropertyName("additionalAmount"); + JsonSerializer.Serialize(writer, paymentRequest.AdditionalAmount, jsonSerializerOptions); + } + if (paymentRequest.AdditionalDataOption.IsSet) + { + writer.WritePropertyName("additionalData"); + JsonSerializer.Serialize(writer, paymentRequest.AdditionalData, jsonSerializerOptions); + } + if (paymentRequest.ApplicationInfoOption.IsSet) + { + writer.WritePropertyName("applicationInfo"); + JsonSerializer.Serialize(writer, paymentRequest.ApplicationInfo, jsonSerializerOptions); + } + if (paymentRequest.AuthenticationDataOption.IsSet) + { + writer.WritePropertyName("authenticationData"); + JsonSerializer.Serialize(writer, paymentRequest.AuthenticationData, jsonSerializerOptions); + } + if (paymentRequest.BankAccountOption.IsSet) + { + writer.WritePropertyName("bankAccount"); + JsonSerializer.Serialize(writer, paymentRequest.BankAccount, jsonSerializerOptions); + } + if (paymentRequest.BillingAddressOption.IsSet) + { + writer.WritePropertyName("billingAddress"); + JsonSerializer.Serialize(writer, paymentRequest.BillingAddress, jsonSerializerOptions); + } + if (paymentRequest.BrowserInfoOption.IsSet) + { + writer.WritePropertyName("browserInfo"); + JsonSerializer.Serialize(writer, paymentRequest.BrowserInfo, jsonSerializerOptions); + } + if (paymentRequest.CaptureDelayHoursOption.IsSet) + writer.WriteNumber("captureDelayHours", paymentRequest.CaptureDelayHoursOption.Value.Value); + + var channelRawValue = PaymentRequest.ChannelEnumToJsonValue(paymentRequest.ChannelOption.Value.Value); + writer.WriteString("channel", channelRawValue); + if (paymentRequest.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", paymentRequest.CheckoutAttemptId); + + if (paymentRequest.CompanyOption.IsSet) + { + writer.WritePropertyName("company"); + JsonSerializer.Serialize(writer, paymentRequest.Company, jsonSerializerOptions); + } + if (paymentRequest.ConversionIdOption.IsSet) + writer.WriteString("conversionId", paymentRequest.ConversionId); + + if (paymentRequest.CountryCodeOption.IsSet) + writer.WriteString("countryCode", paymentRequest.CountryCode); + + if (paymentRequest.DateOfBirthOption.IsSet) + writer.WriteString("dateOfBirth", paymentRequest.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); + + if (paymentRequest.DccQuoteOption.IsSet) + { + writer.WritePropertyName("dccQuote"); + JsonSerializer.Serialize(writer, paymentRequest.DccQuote, jsonSerializerOptions); + } + if (paymentRequest.DeliverAtOption.IsSet) + writer.WriteString("deliverAt", paymentRequest.DeliverAtOption.Value.Value.ToString(DeliverAtFormat)); + + if (paymentRequest.DeliveryAddressOption.IsSet) + { + writer.WritePropertyName("deliveryAddress"); + JsonSerializer.Serialize(writer, paymentRequest.DeliveryAddress, jsonSerializerOptions); + } + if (paymentRequest.DeliveryDateOption.IsSet) + writer.WriteString("deliveryDate", paymentRequest.DeliveryDateOption.Value.Value.ToString(DeliveryDateFormat)); + + if (paymentRequest.DeviceFingerprintOption.IsSet) + writer.WriteString("deviceFingerprint", paymentRequest.DeviceFingerprint); + + if (paymentRequest.EnableOneClickOption.IsSet) + writer.WriteBoolean("enableOneClick", paymentRequest.EnableOneClickOption.Value.Value); + + if (paymentRequest.EnablePayOutOption.IsSet) + writer.WriteBoolean("enablePayOut", paymentRequest.EnablePayOutOption.Value.Value); + + if (paymentRequest.EnableRecurringOption.IsSet) + writer.WriteBoolean("enableRecurring", paymentRequest.EnableRecurringOption.Value.Value); + + if (paymentRequest.EnhancedSchemeDataOption.IsSet) + { + writer.WritePropertyName("enhancedSchemeData"); + JsonSerializer.Serialize(writer, paymentRequest.EnhancedSchemeData, jsonSerializerOptions); + } + var entityTypeRawValue = PaymentRequest.EntityTypeEnumToJsonValue(paymentRequest.EntityTypeOption.Value.Value); + writer.WriteString("entityType", entityTypeRawValue); + if (paymentRequest.FraudOffsetOption.IsSet) + writer.WriteNumber("fraudOffset", paymentRequest.FraudOffsetOption.Value.Value); + + if (paymentRequest.FundOriginOption.IsSet) + { + writer.WritePropertyName("fundOrigin"); + JsonSerializer.Serialize(writer, paymentRequest.FundOrigin, jsonSerializerOptions); + } + if (paymentRequest.FundRecipientOption.IsSet) + { + writer.WritePropertyName("fundRecipient"); + JsonSerializer.Serialize(writer, paymentRequest.FundRecipient, jsonSerializerOptions); + } + var industryUsageRawValue = PaymentRequest.IndustryUsageEnumToJsonValue(paymentRequest.IndustryUsageOption.Value.Value); + writer.WriteString("industryUsage", industryUsageRawValue); + if (paymentRequest.InstallmentsOption.IsSet) + { + writer.WritePropertyName("installments"); + JsonSerializer.Serialize(writer, paymentRequest.Installments, jsonSerializerOptions); + } + if (paymentRequest.LineItemsOption.IsSet) + { + writer.WritePropertyName("lineItems"); + JsonSerializer.Serialize(writer, paymentRequest.LineItems, jsonSerializerOptions); + } + if (paymentRequest.LocalizedShopperStatementOption.IsSet) + { + writer.WritePropertyName("localizedShopperStatement"); + JsonSerializer.Serialize(writer, paymentRequest.LocalizedShopperStatement, jsonSerializerOptions); + } + if (paymentRequest.MandateOption.IsSet) + { + writer.WritePropertyName("mandate"); + JsonSerializer.Serialize(writer, paymentRequest.Mandate, jsonSerializerOptions); + } + if (paymentRequest.MccOption.IsSet) + writer.WriteString("mcc", paymentRequest.Mcc); + + if (paymentRequest.MerchantOrderReferenceOption.IsSet) + writer.WriteString("merchantOrderReference", paymentRequest.MerchantOrderReference); + + if (paymentRequest.MerchantRiskIndicatorOption.IsSet) + { + writer.WritePropertyName("merchantRiskIndicator"); + JsonSerializer.Serialize(writer, paymentRequest.MerchantRiskIndicator, jsonSerializerOptions); + } + if (paymentRequest.MetadataOption.IsSet) + { + writer.WritePropertyName("metadata"); + JsonSerializer.Serialize(writer, paymentRequest.Metadata, jsonSerializerOptions); + } + if (paymentRequest.MpiDataOption.IsSet) + { + writer.WritePropertyName("mpiData"); + JsonSerializer.Serialize(writer, paymentRequest.MpiData, jsonSerializerOptions); + } + if (paymentRequest.OrderOption.IsSet) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, paymentRequest.Order, jsonSerializerOptions); + } + if (paymentRequest.OrderReferenceOption.IsSet) + writer.WriteString("orderReference", paymentRequest.OrderReference); + + if (paymentRequest.OriginOption.IsSet) + writer.WriteString("origin", paymentRequest.Origin); + + if (paymentRequest.PlatformChargebackLogicOption.IsSet) + { + writer.WritePropertyName("platformChargebackLogic"); + JsonSerializer.Serialize(writer, paymentRequest.PlatformChargebackLogic, jsonSerializerOptions); + } + if (paymentRequest.RecurringExpiryOption.IsSet) + writer.WriteString("recurringExpiry", paymentRequest.RecurringExpiry); + + if (paymentRequest.RecurringFrequencyOption.IsSet) + writer.WriteString("recurringFrequency", paymentRequest.RecurringFrequency); + + var recurringProcessingModelRawValue = PaymentRequest.RecurringProcessingModelEnumToJsonValue(paymentRequest.RecurringProcessingModelOption.Value.Value); + writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); + if (paymentRequest.RedirectFromIssuerMethodOption.IsSet) + writer.WriteString("redirectFromIssuerMethod", paymentRequest.RedirectFromIssuerMethod); + + if (paymentRequest.RedirectToIssuerMethodOption.IsSet) + writer.WriteString("redirectToIssuerMethod", paymentRequest.RedirectToIssuerMethod); + + if (paymentRequest.RiskDataOption.IsSet) + { + writer.WritePropertyName("riskData"); + JsonSerializer.Serialize(writer, paymentRequest.RiskData, jsonSerializerOptions); + } + if (paymentRequest.SessionValidityOption.IsSet) + writer.WriteString("sessionValidity", paymentRequest.SessionValidity); + + if (paymentRequest.ShopperConversionIdOption.IsSet) + writer.WriteString("shopperConversionId", paymentRequest.ShopperConversionId); + + if (paymentRequest.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", paymentRequest.ShopperEmail); + + if (paymentRequest.ShopperIPOption.IsSet) + writer.WriteString("shopperIP", paymentRequest.ShopperIP); + + var shopperInteractionRawValue = PaymentRequest.ShopperInteractionEnumToJsonValue(paymentRequest.ShopperInteractionOption.Value.Value); + writer.WriteString("shopperInteraction", shopperInteractionRawValue); + if (paymentRequest.ShopperLocaleOption.IsSet) + writer.WriteString("shopperLocale", paymentRequest.ShopperLocale); + + if (paymentRequest.ShopperNameOption.IsSet) + { + writer.WritePropertyName("shopperName"); + JsonSerializer.Serialize(writer, paymentRequest.ShopperName, jsonSerializerOptions); + } + if (paymentRequest.ShopperReferenceOption.IsSet) + writer.WriteString("shopperReference", paymentRequest.ShopperReference); + + if (paymentRequest.ShopperStatementOption.IsSet) + writer.WriteString("shopperStatement", paymentRequest.ShopperStatement); + + if (paymentRequest.SocialSecurityNumberOption.IsSet) + writer.WriteString("socialSecurityNumber", paymentRequest.SocialSecurityNumber); + + if (paymentRequest.SplitsOption.IsSet) + { + writer.WritePropertyName("splits"); + JsonSerializer.Serialize(writer, paymentRequest.Splits, jsonSerializerOptions); + } + if (paymentRequest.StoreOption.IsSet) + writer.WriteString("store", paymentRequest.Store); + + if (paymentRequest.StorePaymentMethodOption.IsSet) + writer.WriteBoolean("storePaymentMethod", paymentRequest.StorePaymentMethodOption.Value.Value); + + if (paymentRequest.SubMerchantsOption.IsSet) + { + writer.WritePropertyName("subMerchants"); + JsonSerializer.Serialize(writer, paymentRequest.SubMerchants, jsonSerializerOptions); + } + if (paymentRequest.SurchargeOption.IsSet) + { + writer.WritePropertyName("surcharge"); + JsonSerializer.Serialize(writer, paymentRequest.Surcharge, jsonSerializerOptions); + } + if (paymentRequest.TelephoneNumberOption.IsSet) + writer.WriteString("telephoneNumber", paymentRequest.TelephoneNumber); + + if (paymentRequest.ThreeDS2RequestDataOption.IsSet) + { + writer.WritePropertyName("threeDS2RequestData"); + JsonSerializer.Serialize(writer, paymentRequest.ThreeDS2RequestData, jsonSerializerOptions); + } + if (paymentRequest.ThreeDSAuthenticationOnlyOption.IsSet) + writer.WriteBoolean("threeDSAuthenticationOnly", paymentRequest.ThreeDSAuthenticationOnlyOption.Value.Value); + + if (paymentRequest.TrustedShopperOption.IsSet) + writer.WriteBoolean("trustedShopper", paymentRequest.TrustedShopperOption.Value.Value); + } + } } diff --git a/Adyen/Model/Checkout/PaymentResponse.cs b/Adyen/Model/Checkout/PaymentResponse.cs index ed9e81655..42708b0b2 100644 --- a/Adyen/Model/Checkout/PaymentResponse.cs +++ b/Adyen/Model/Checkout/PaymentResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,250 +14,498 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentResponse /// - [DataContract(Name = "PaymentResponse")] - public partial class PaymentResponse : IEquatable, IValidatableObject + public partial class PaymentResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// action + /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + /// amount + /// Donation Token containing payment details for Adyen Giving. + /// fraudResult + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + /// order + /// paymentMethod + /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + /// threeDS2ResponseData + /// threeDS2Result + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. + [JsonConstructor] + public PaymentResponse(Option action = default, Option> additionalData = default, Option amount = default, Option donationToken = default, Option fraudResult = default, Option merchantReference = default, Option order = default, Option paymentMethod = default, Option pspReference = default, Option refusalReason = default, Option refusalReasonCode = default, Option resultCode = default, Option threeDS2ResponseData = default, Option threeDS2Result = default, Option threeDSPaymentData = default) + { + ActionOption = action; + AdditionalDataOption = additionalData; + AmountOption = amount; + DonationTokenOption = donationToken; + FraudResultOption = fraudResult; + MerchantReferenceOption = merchantReference; + OrderOption = order; + PaymentMethodOption = paymentMethod; + PspReferenceOption = pspReference; + RefusalReasonOption = refusalReason; + RefusalReasonCodeOption = refusalReasonCode; + ResultCodeOption = resultCode; + ThreeDS2ResponseDataOption = threeDS2ResponseData; + ThreeDS2ResultOption = threeDS2Result; + ThreeDSPaymentDataOption = threeDSPaymentData; + OnCreated(); + } + + partial void OnCreated(); + /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - [JsonConverter(typeof(StringEnumConverter))] public enum ResultCodeEnum { /// /// Enum AuthenticationFinished for value: AuthenticationFinished /// - [EnumMember(Value = "AuthenticationFinished")] AuthenticationFinished = 1, /// /// Enum AuthenticationNotRequired for value: AuthenticationNotRequired /// - [EnumMember(Value = "AuthenticationNotRequired")] AuthenticationNotRequired = 2, /// /// Enum Authorised for value: Authorised /// - [EnumMember(Value = "Authorised")] Authorised = 3, /// /// Enum Cancelled for value: Cancelled /// - [EnumMember(Value = "Cancelled")] Cancelled = 4, /// /// Enum ChallengeShopper for value: ChallengeShopper /// - [EnumMember(Value = "ChallengeShopper")] ChallengeShopper = 5, /// /// Enum Error for value: Error /// - [EnumMember(Value = "Error")] Error = 6, /// /// Enum IdentifyShopper for value: IdentifyShopper /// - [EnumMember(Value = "IdentifyShopper")] IdentifyShopper = 7, /// /// Enum PartiallyAuthorised for value: PartiallyAuthorised /// - [EnumMember(Value = "PartiallyAuthorised")] PartiallyAuthorised = 8, /// /// Enum Pending for value: Pending /// - [EnumMember(Value = "Pending")] Pending = 9, /// /// Enum PresentToShopper for value: PresentToShopper /// - [EnumMember(Value = "PresentToShopper")] PresentToShopper = 10, /// /// Enum Received for value: Received /// - [EnumMember(Value = "Received")] Received = 11, /// /// Enum RedirectShopper for value: RedirectShopper /// - [EnumMember(Value = "RedirectShopper")] RedirectShopper = 12, /// /// Enum Refused for value: Refused /// - [EnumMember(Value = "Refused")] Refused = 13, /// /// Enum Success for value: Success /// - [EnumMember(Value = "Success")] Success = 14 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ResultCodeEnum ResultCodeEnumFromString(string value) + { + if (value.Equals("AuthenticationFinished")) + return ResultCodeEnum.AuthenticationFinished; + + if (value.Equals("AuthenticationNotRequired")) + return ResultCodeEnum.AuthenticationNotRequired; + + if (value.Equals("Authorised")) + return ResultCodeEnum.Authorised; + + if (value.Equals("Cancelled")) + return ResultCodeEnum.Cancelled; + + if (value.Equals("ChallengeShopper")) + return ResultCodeEnum.ChallengeShopper; + + if (value.Equals("Error")) + return ResultCodeEnum.Error; + + if (value.Equals("IdentifyShopper")) + return ResultCodeEnum.IdentifyShopper; + + if (value.Equals("PartiallyAuthorised")) + return ResultCodeEnum.PartiallyAuthorised; + + if (value.Equals("Pending")) + return ResultCodeEnum.Pending; + + if (value.Equals("PresentToShopper")) + return ResultCodeEnum.PresentToShopper; + + if (value.Equals("Received")) + return ResultCodeEnum.Received; + + if (value.Equals("RedirectShopper")) + return ResultCodeEnum.RedirectShopper; + + if (value.Equals("Refused")) + return ResultCodeEnum.Refused; + + if (value.Equals("Success")) + return ResultCodeEnum.Success; + + throw new NotImplementedException($"Could not convert value to type ResultCodeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ResultCodeEnum? ResultCodeEnumFromStringOrDefault(string value) + { + if (value.Equals("AuthenticationFinished")) + return ResultCodeEnum.AuthenticationFinished; + + if (value.Equals("AuthenticationNotRequired")) + return ResultCodeEnum.AuthenticationNotRequired; + + if (value.Equals("Authorised")) + return ResultCodeEnum.Authorised; + + if (value.Equals("Cancelled")) + return ResultCodeEnum.Cancelled; + + if (value.Equals("ChallengeShopper")) + return ResultCodeEnum.ChallengeShopper; + + if (value.Equals("Error")) + return ResultCodeEnum.Error; + + if (value.Equals("IdentifyShopper")) + return ResultCodeEnum.IdentifyShopper; + + if (value.Equals("PartiallyAuthorised")) + return ResultCodeEnum.PartiallyAuthorised; + + if (value.Equals("Pending")) + return ResultCodeEnum.Pending; + + if (value.Equals("PresentToShopper")) + return ResultCodeEnum.PresentToShopper; + + if (value.Equals("Received")) + return ResultCodeEnum.Received; + + if (value.Equals("RedirectShopper")) + return ResultCodeEnum.RedirectShopper; + + if (value.Equals("Refused")) + return ResultCodeEnum.Refused; + + if (value.Equals("Success")) + return ResultCodeEnum.Success; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ResultCodeEnumToJsonValue(ResultCodeEnum? value) + { + if (value == ResultCodeEnum.AuthenticationFinished) + return "AuthenticationFinished"; + + if (value == ResultCodeEnum.AuthenticationNotRequired) + return "AuthenticationNotRequired"; + + if (value == ResultCodeEnum.Authorised) + return "Authorised"; + + if (value == ResultCodeEnum.Cancelled) + return "Cancelled"; + if (value == ResultCodeEnum.ChallengeShopper) + return "ChallengeShopper"; + + if (value == ResultCodeEnum.Error) + return "Error"; + + if (value == ResultCodeEnum.IdentifyShopper) + return "IdentifyShopper"; + + if (value == ResultCodeEnum.PartiallyAuthorised) + return "PartiallyAuthorised"; + + if (value == ResultCodeEnum.Pending) + return "Pending"; + + if (value == ResultCodeEnum.PresentToShopper) + return "PresentToShopper"; + + if (value == ResultCodeEnum.Received) + return "Received"; + + if (value == ResultCodeEnum.RedirectShopper) + return "RedirectShopper"; + + if (value == ResultCodeEnum.Refused) + return "Refused"; + + if (value == ResultCodeEnum.Success) + return "Success"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of ResultCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ResultCodeOption { get; private set; } /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - [DataMember(Name = "resultCode", EmitDefaultValue = false)] - public ResultCodeEnum? ResultCode { get; set; } + [JsonPropertyName("resultCode")] + public ResultCodeEnum? ResultCode { get { return this.ResultCodeOption; } set { this.ResultCodeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of Action /// - /// action. - /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**.. - /// amount. - /// Donation Token containing payment details for Adyen Giving.. - /// fraudResult. - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.. - /// order. - /// paymentMethod. - /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response.. - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. - /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. - /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state.. - /// threeDS2ResponseData. - /// threeDS2Result. - /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`.. - public PaymentResponse(PaymentResponseAction action = default(PaymentResponseAction), Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), string donationToken = default(string), FraudResult fraudResult = default(FraudResult), string merchantReference = default(string), CheckoutOrderResponse order = default(CheckoutOrderResponse), ResponsePaymentMethod paymentMethod = default(ResponsePaymentMethod), string pspReference = default(string), string refusalReason = default(string), string refusalReasonCode = default(string), ResultCodeEnum? resultCode = default(ResultCodeEnum?), ThreeDS2ResponseData threeDS2ResponseData = default(ThreeDS2ResponseData), ThreeDS2Result threeDS2Result = default(ThreeDS2Result), string threeDSPaymentData = default(string)) - { - this.Action = action; - this.AdditionalData = additionalData; - this.Amount = amount; - this.DonationToken = donationToken; - this.FraudResult = fraudResult; - this.MerchantReference = merchantReference; - this.Order = order; - this.PaymentMethod = paymentMethod; - this.PspReference = pspReference; - this.RefusalReason = refusalReason; - this.RefusalReasonCode = refusalReasonCode; - this.ResultCode = resultCode; - this.ThreeDS2ResponseData = threeDS2ResponseData; - this.ThreeDS2Result = threeDS2Result; - this.ThreeDSPaymentData = threeDSPaymentData; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ActionOption { get; private set; } /// /// Gets or Sets Action /// - [DataMember(Name = "action", EmitDefaultValue = false)] - public PaymentResponseAction Action { get; set; } + [JsonPropertyName("action")] + public PaymentResponseAction Action { get { return this.ActionOption; } set { this.ActionOption = new Option(value); } } + + /// + /// Used to track the state of AdditionalData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AdditionalDataOption { get; private set; } /// /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. /// /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - [DataMember(Name = "additionalData", EmitDefaultValue = false)] - public Dictionary AdditionalData { get; set; } + [JsonPropertyName("additionalData")] + public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } + + /// + /// Used to track the state of Amount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountOption { get; private set; } /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonPropertyName("amount")] + public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } + + /// + /// Used to track the state of DonationToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DonationTokenOption { get; private set; } /// /// Donation Token containing payment details for Adyen Giving. /// /// Donation Token containing payment details for Adyen Giving. - [DataMember(Name = "donationToken", EmitDefaultValue = false)] - public string DonationToken { get; set; } + [JsonPropertyName("donationToken")] + public string DonationToken { get { return this.DonationTokenOption; } set { this.DonationTokenOption = new Option(value); } } + + /// + /// Used to track the state of FraudResult + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FraudResultOption { get; private set; } /// /// Gets or Sets FraudResult /// - [DataMember(Name = "fraudResult", EmitDefaultValue = false)] - public FraudResult FraudResult { get; set; } + [JsonPropertyName("fraudResult")] + public FraudResult FraudResult { get { return this.FraudResultOption; } set { this.FraudResultOption = new Option(value); } } + + /// + /// Used to track the state of MerchantReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantReferenceOption { get; private set; } /// /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. /// /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - [DataMember(Name = "merchantReference", EmitDefaultValue = false)] - public string MerchantReference { get; set; } + [JsonPropertyName("merchantReference")] + public string MerchantReference { get { return this.MerchantReferenceOption; } set { this.MerchantReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Order + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OrderOption { get; private set; } /// /// Gets or Sets Order /// - [DataMember(Name = "order", EmitDefaultValue = false)] - public CheckoutOrderResponse Order { get; set; } + [JsonPropertyName("order")] + public CheckoutOrderResponse Order { get { return this.OrderOption; } set { this.OrderOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodOption { get; private set; } /// /// Gets or Sets PaymentMethod /// - [DataMember(Name = "paymentMethod", EmitDefaultValue = false)] - public ResponsePaymentMethod PaymentMethod { get; set; } + [JsonPropertyName("paymentMethod")] + public ResponsePaymentMethod PaymentMethod { get { return this.PaymentMethodOption; } set { this.PaymentMethodOption = new Option(value); } } + + /// + /// Used to track the state of PspReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PspReferenceOption { get; private set; } /// /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response. /// /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response. - [DataMember(Name = "pspReference", EmitDefaultValue = false)] - public string PspReference { get; set; } + [JsonPropertyName("pspReference")] + public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } + + /// + /// Used to track the state of RefusalReason + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RefusalReasonOption { get; private set; } /// /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). /// /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [DataMember(Name = "refusalReason", EmitDefaultValue = false)] - public string RefusalReason { get; set; } + [JsonPropertyName("refusalReason")] + public string RefusalReason { get { return this.RefusalReasonOption; } set { this.RefusalReasonOption = new Option(value); } } + + /// + /// Used to track the state of RefusalReasonCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RefusalReasonCodeOption { get; private set; } /// /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). /// /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [DataMember(Name = "refusalReasonCode", EmitDefaultValue = false)] - public string RefusalReasonCode { get; set; } + [JsonPropertyName("refusalReasonCode")] + public string RefusalReasonCode { get { return this.RefusalReasonCodeOption; } set { this.RefusalReasonCodeOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2ResponseData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2ResponseDataOption { get; private set; } /// /// Gets or Sets ThreeDS2ResponseData /// - [DataMember(Name = "threeDS2ResponseData", EmitDefaultValue = false)] - public ThreeDS2ResponseData ThreeDS2ResponseData { get; set; } + [JsonPropertyName("threeDS2ResponseData")] + public ThreeDS2ResponseData ThreeDS2ResponseData { get { return this.ThreeDS2ResponseDataOption; } set { this.ThreeDS2ResponseDataOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDS2Result + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDS2ResultOption { get; private set; } /// /// Gets or Sets ThreeDS2Result /// - [DataMember(Name = "threeDS2Result", EmitDefaultValue = false)] - public ThreeDS2Result ThreeDS2Result { get; set; } + [JsonPropertyName("threeDS2Result")] + public ThreeDS2Result ThreeDS2Result { get { return this.ThreeDS2ResultOption; } set { this.ThreeDS2ResultOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSPaymentData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSPaymentDataOption { get; private set; } /// /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. /// /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. - [DataMember(Name = "threeDSPaymentData", EmitDefaultValue = false)] - public string ThreeDSPaymentData { get; set; } + [JsonPropertyName("threeDSPaymentData")] + public string ThreeDSPaymentData { get { return this.ThreeDSPaymentDataOption; } set { this.ThreeDSPaymentDataOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -288,191 +535,303 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentResponse); + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option action = default; + Option> additionalData = default; + Option amount = default; + Option donationToken = default; + Option fraudResult = default; + Option merchantReference = default; + Option order = default; + Option paymentMethod = default; + Option pspReference = default; + Option refusalReason = default; + Option refusalReasonCode = default; + Option resultCode = default; + Option threeDS2ResponseData = default; + Option threeDS2Result = default; + Option threeDSPaymentData = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "action": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + action = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "additionalData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "donationToken": + donationToken = new Option(utf8JsonReader.GetString()); + break; + case "fraudResult": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fraudResult = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "merchantReference": + merchantReference = new Option(utf8JsonReader.GetString()); + break; + case "order": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + order = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "paymentMethod": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "refusalReason": + refusalReason = new Option(utf8JsonReader.GetString()); + break; + case "refusalReasonCode": + refusalReasonCode = new Option(utf8JsonReader.GetString()); + break; + case "resultCode": + string resultCodeRawValue = utf8JsonReader.GetString(); + if (resultCodeRawValue != null) + resultCode = new Option(PaymentResponse.ResultCodeEnumFromStringOrDefault(resultCodeRawValue)); + break; + case "threeDS2ResponseData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDS2ResponseData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDS2Result": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDS2Result = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDSPaymentData": + threeDSPaymentData = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (action.IsSet && action.Value == null) + throw new ArgumentNullException(nameof(action), "Property is not nullable for class PaymentResponse."); + + if (additionalData.IsSet && additionalData.Value == null) + throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class PaymentResponse."); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentResponse."); + + if (donationToken.IsSet && donationToken.Value == null) + throw new ArgumentNullException(nameof(donationToken), "Property is not nullable for class PaymentResponse."); + + if (fraudResult.IsSet && fraudResult.Value == null) + throw new ArgumentNullException(nameof(fraudResult), "Property is not nullable for class PaymentResponse."); + + if (merchantReference.IsSet && merchantReference.Value == null) + throw new ArgumentNullException(nameof(merchantReference), "Property is not nullable for class PaymentResponse."); + + if (order.IsSet && order.Value == null) + throw new ArgumentNullException(nameof(order), "Property is not nullable for class PaymentResponse."); + + if (paymentMethod.IsSet && paymentMethod.Value == null) + throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class PaymentResponse."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentResponse."); + + if (refusalReason.IsSet && refusalReason.Value == null) + throw new ArgumentNullException(nameof(refusalReason), "Property is not nullable for class PaymentResponse."); + + if (refusalReasonCode.IsSet && refusalReasonCode.Value == null) + throw new ArgumentNullException(nameof(refusalReasonCode), "Property is not nullable for class PaymentResponse."); + + if (resultCode.IsSet && resultCode.Value == null) + throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class PaymentResponse."); + + if (threeDS2ResponseData.IsSet && threeDS2ResponseData.Value == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData), "Property is not nullable for class PaymentResponse."); + + if (threeDS2Result.IsSet && threeDS2Result.Value == null) + throw new ArgumentNullException(nameof(threeDS2Result), "Property is not nullable for class PaymentResponse."); + + if (threeDSPaymentData.IsSet && threeDSPaymentData.Value == null) + throw new ArgumentNullException(nameof(threeDSPaymentData), "Property is not nullable for class PaymentResponse."); + + return new PaymentResponse(action, additionalData, amount, donationToken, fraudResult, merchantReference, order, paymentMethod, pspReference, refusalReason, refusalReasonCode, resultCode, threeDS2ResponseData, threeDS2Result, threeDSPaymentData); } /// - /// Returns true if PaymentResponse instances are equal + /// Serializes a /// - /// Instance of PaymentResponse to be compared - /// Boolean - public bool Equals(PaymentResponse input) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentResponse paymentResponse, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) - { - return false; - } - return - ( - this.Action == input.Action || - (this.Action != null && - this.Action.Equals(input.Action)) - ) && - ( - this.AdditionalData == input.AdditionalData || - this.AdditionalData != null && - input.AdditionalData != null && - this.AdditionalData.SequenceEqual(input.AdditionalData) - ) && - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.DonationToken == input.DonationToken || - (this.DonationToken != null && - this.DonationToken.Equals(input.DonationToken)) - ) && - ( - this.FraudResult == input.FraudResult || - (this.FraudResult != null && - this.FraudResult.Equals(input.FraudResult)) - ) && - ( - this.MerchantReference == input.MerchantReference || - (this.MerchantReference != null && - this.MerchantReference.Equals(input.MerchantReference)) - ) && - ( - this.Order == input.Order || - (this.Order != null && - this.Order.Equals(input.Order)) - ) && - ( - this.PaymentMethod == input.PaymentMethod || - (this.PaymentMethod != null && - this.PaymentMethod.Equals(input.PaymentMethod)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.RefusalReason == input.RefusalReason || - (this.RefusalReason != null && - this.RefusalReason.Equals(input.RefusalReason)) - ) && - ( - this.RefusalReasonCode == input.RefusalReasonCode || - (this.RefusalReasonCode != null && - this.RefusalReasonCode.Equals(input.RefusalReasonCode)) - ) && - ( - this.ResultCode == input.ResultCode || - this.ResultCode.Equals(input.ResultCode) - ) && - ( - this.ThreeDS2ResponseData == input.ThreeDS2ResponseData || - (this.ThreeDS2ResponseData != null && - this.ThreeDS2ResponseData.Equals(input.ThreeDS2ResponseData)) - ) && - ( - this.ThreeDS2Result == input.ThreeDS2Result || - (this.ThreeDS2Result != null && - this.ThreeDS2Result.Equals(input.ThreeDS2Result)) - ) && - ( - this.ThreeDSPaymentData == input.ThreeDSPaymentData || - (this.ThreeDSPaymentData != null && - this.ThreeDSPaymentData.Equals(input.ThreeDSPaymentData)) - ); + writer.WriteStartObject(); + + WriteProperties(writer, paymentResponse, jsonSerializerOptions); + writer.WriteEndObject(); } /// - /// Gets the hash code + /// Serializes the properties of /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentResponse paymentResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap + if (paymentResponse.ActionOption.IsSet && paymentResponse.Action == null) + throw new ArgumentNullException(nameof(paymentResponse.Action), "Property is required for class PaymentResponse."); + + if (paymentResponse.AdditionalDataOption.IsSet && paymentResponse.AdditionalData == null) + throw new ArgumentNullException(nameof(paymentResponse.AdditionalData), "Property is required for class PaymentResponse."); + + if (paymentResponse.AmountOption.IsSet && paymentResponse.Amount == null) + throw new ArgumentNullException(nameof(paymentResponse.Amount), "Property is required for class PaymentResponse."); + + if (paymentResponse.DonationTokenOption.IsSet && paymentResponse.DonationToken == null) + throw new ArgumentNullException(nameof(paymentResponse.DonationToken), "Property is required for class PaymentResponse."); + + if (paymentResponse.FraudResultOption.IsSet && paymentResponse.FraudResult == null) + throw new ArgumentNullException(nameof(paymentResponse.FraudResult), "Property is required for class PaymentResponse."); + + if (paymentResponse.MerchantReferenceOption.IsSet && paymentResponse.MerchantReference == null) + throw new ArgumentNullException(nameof(paymentResponse.MerchantReference), "Property is required for class PaymentResponse."); + + if (paymentResponse.OrderOption.IsSet && paymentResponse.Order == null) + throw new ArgumentNullException(nameof(paymentResponse.Order), "Property is required for class PaymentResponse."); + + if (paymentResponse.PaymentMethodOption.IsSet && paymentResponse.PaymentMethod == null) + throw new ArgumentNullException(nameof(paymentResponse.PaymentMethod), "Property is required for class PaymentResponse."); + + if (paymentResponse.PspReferenceOption.IsSet && paymentResponse.PspReference == null) + throw new ArgumentNullException(nameof(paymentResponse.PspReference), "Property is required for class PaymentResponse."); + + if (paymentResponse.RefusalReasonOption.IsSet && paymentResponse.RefusalReason == null) + throw new ArgumentNullException(nameof(paymentResponse.RefusalReason), "Property is required for class PaymentResponse."); + + if (paymentResponse.RefusalReasonCodeOption.IsSet && paymentResponse.RefusalReasonCode == null) + throw new ArgumentNullException(nameof(paymentResponse.RefusalReasonCode), "Property is required for class PaymentResponse."); + + if (paymentResponse.ThreeDS2ResponseDataOption.IsSet && paymentResponse.ThreeDS2ResponseData == null) + throw new ArgumentNullException(nameof(paymentResponse.ThreeDS2ResponseData), "Property is required for class PaymentResponse."); + + if (paymentResponse.ThreeDS2ResultOption.IsSet && paymentResponse.ThreeDS2Result == null) + throw new ArgumentNullException(nameof(paymentResponse.ThreeDS2Result), "Property is required for class PaymentResponse."); + + if (paymentResponse.ThreeDSPaymentDataOption.IsSet && paymentResponse.ThreeDSPaymentData == null) + throw new ArgumentNullException(nameof(paymentResponse.ThreeDSPaymentData), "Property is required for class PaymentResponse."); + + if (paymentResponse.ActionOption.IsSet) { - int hashCode = 41; - if (this.Action != null) - { - hashCode = (hashCode * 59) + this.Action.GetHashCode(); - } - if (this.AdditionalData != null) - { - hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); - } - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.DonationToken != null) - { - hashCode = (hashCode * 59) + this.DonationToken.GetHashCode(); - } - if (this.FraudResult != null) - { - hashCode = (hashCode * 59) + this.FraudResult.GetHashCode(); - } - if (this.MerchantReference != null) - { - hashCode = (hashCode * 59) + this.MerchantReference.GetHashCode(); - } - if (this.Order != null) - { - hashCode = (hashCode * 59) + this.Order.GetHashCode(); - } - if (this.PaymentMethod != null) - { - hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - if (this.RefusalReason != null) - { - hashCode = (hashCode * 59) + this.RefusalReason.GetHashCode(); - } - if (this.RefusalReasonCode != null) - { - hashCode = (hashCode * 59) + this.RefusalReasonCode.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ResultCode.GetHashCode(); - if (this.ThreeDS2ResponseData != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2ResponseData.GetHashCode(); - } - if (this.ThreeDS2Result != null) - { - hashCode = (hashCode * 59) + this.ThreeDS2Result.GetHashCode(); - } - if (this.ThreeDSPaymentData != null) - { - hashCode = (hashCode * 59) + this.ThreeDSPaymentData.GetHashCode(); - } - return hashCode; + writer.WritePropertyName("action"); + JsonSerializer.Serialize(writer, paymentResponse.Action, jsonSerializerOptions); } - } - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; + if (paymentResponse.AdditionalDataOption.IsSet) + { + writer.WritePropertyName("additionalData"); + JsonSerializer.Serialize(writer, paymentResponse.AdditionalData, jsonSerializerOptions); + } + if (paymentResponse.AmountOption.IsSet) + { + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, paymentResponse.Amount, jsonSerializerOptions); + } + if (paymentResponse.DonationTokenOption.IsSet) + writer.WriteString("donationToken", paymentResponse.DonationToken); + + if (paymentResponse.FraudResultOption.IsSet) + { + writer.WritePropertyName("fraudResult"); + JsonSerializer.Serialize(writer, paymentResponse.FraudResult, jsonSerializerOptions); + } + if (paymentResponse.MerchantReferenceOption.IsSet) + writer.WriteString("merchantReference", paymentResponse.MerchantReference); + + if (paymentResponse.OrderOption.IsSet) + { + writer.WritePropertyName("order"); + JsonSerializer.Serialize(writer, paymentResponse.Order, jsonSerializerOptions); + } + if (paymentResponse.PaymentMethodOption.IsSet) + { + writer.WritePropertyName("paymentMethod"); + JsonSerializer.Serialize(writer, paymentResponse.PaymentMethod, jsonSerializerOptions); + } + if (paymentResponse.PspReferenceOption.IsSet) + writer.WriteString("pspReference", paymentResponse.PspReference); + + if (paymentResponse.RefusalReasonOption.IsSet) + writer.WriteString("refusalReason", paymentResponse.RefusalReason); + + if (paymentResponse.RefusalReasonCodeOption.IsSet) + writer.WriteString("refusalReasonCode", paymentResponse.RefusalReasonCode); + + var resultCodeRawValue = PaymentResponse.ResultCodeEnumToJsonValue(paymentResponse.ResultCodeOption.Value.Value); + writer.WriteString("resultCode", resultCodeRawValue); + if (paymentResponse.ThreeDS2ResponseDataOption.IsSet) + { + writer.WritePropertyName("threeDS2ResponseData"); + JsonSerializer.Serialize(writer, paymentResponse.ThreeDS2ResponseData, jsonSerializerOptions); + } + if (paymentResponse.ThreeDS2ResultOption.IsSet) + { + writer.WritePropertyName("threeDS2Result"); + JsonSerializer.Serialize(writer, paymentResponse.ThreeDS2Result, jsonSerializerOptions); + } + if (paymentResponse.ThreeDSPaymentDataOption.IsSet) + writer.WriteString("threeDSPaymentData", paymentResponse.ThreeDSPaymentData); } } - } diff --git a/Adyen/Model/Checkout/PaymentResponseAction.cs b/Adyen/Model/Checkout/PaymentResponseAction.cs index 9069a7e40..0ca79dcf6 100644 --- a/Adyen/Model/Checkout/PaymentResponseAction.cs +++ b/Adyen/Model/Checkout/PaymentResponseAction.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,279 +14,156 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; -using System.Reflection; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Action to be taken for completing the payment. /// - [JsonConverter(typeof(PaymentResponseActionJsonConverter))] - [DataContract(Name = "PaymentResponse_action")] - public partial class PaymentResponseAction : AbstractOpenAPISchema, IEquatable, IValidatableObject + public partial class PaymentResponseAction : IValidatableObject { /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of CheckoutAwaitAction. - public PaymentResponseAction(CheckoutAwaitAction actualInstance) + /// + public PaymentResponseAction(CheckoutAwaitAction checkoutAwaitAction) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + CheckoutAwaitAction = checkoutAwaitAction; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of CheckoutBankTransferAction. - public PaymentResponseAction(CheckoutBankTransferAction actualInstance) + /// + public PaymentResponseAction(CheckoutBankTransferAction checkoutBankTransferAction) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + CheckoutBankTransferAction = checkoutBankTransferAction; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of CheckoutDelegatedAuthenticationAction. - public PaymentResponseAction(CheckoutDelegatedAuthenticationAction actualInstance) + /// + public PaymentResponseAction(CheckoutDelegatedAuthenticationAction checkoutDelegatedAuthenticationAction) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + CheckoutDelegatedAuthenticationAction = checkoutDelegatedAuthenticationAction; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of CheckoutNativeRedirectAction. - public PaymentResponseAction(CheckoutNativeRedirectAction actualInstance) + /// + public PaymentResponseAction(CheckoutNativeRedirectAction checkoutNativeRedirectAction) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + CheckoutNativeRedirectAction = checkoutNativeRedirectAction; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of CheckoutQrCodeAction. - public PaymentResponseAction(CheckoutQrCodeAction actualInstance) + /// + public PaymentResponseAction(CheckoutQrCodeAction checkoutQrCodeAction) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + CheckoutQrCodeAction = checkoutQrCodeAction; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of CheckoutRedirectAction. - public PaymentResponseAction(CheckoutRedirectAction actualInstance) + /// + public PaymentResponseAction(CheckoutRedirectAction checkoutRedirectAction) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + CheckoutRedirectAction = checkoutRedirectAction; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of CheckoutSDKAction. - public PaymentResponseAction(CheckoutSDKAction actualInstance) + /// + public PaymentResponseAction(CheckoutSDKAction checkoutSDKAction) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + CheckoutSDKAction = checkoutSDKAction; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of CheckoutThreeDS2Action. - public PaymentResponseAction(CheckoutThreeDS2Action actualInstance) + /// + public PaymentResponseAction(CheckoutThreeDS2Action checkoutThreeDS2Action) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + CheckoutThreeDS2Action = checkoutThreeDS2Action; + OnCreated(); } /// - /// Initializes a new instance of the class - /// with the class + /// Initializes a new instance of the class. /// - /// An instance of CheckoutVoucherAction. - public PaymentResponseAction(CheckoutVoucherAction actualInstance) + /// + public PaymentResponseAction(CheckoutVoucherAction checkoutVoucherAction) { - this.IsNullable = false; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + CheckoutVoucherAction = checkoutVoucherAction; + OnCreated(); } - - private Object _actualInstance; + partial void OnCreated(); /// - /// Gets or Sets ActualInstance + /// Gets or Sets CheckoutAwaitAction /// - public override Object ActualInstance - { - get - { - return _actualInstance; - } - set - { - if (value.GetType() == typeof(CheckoutAwaitAction)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(CheckoutBankTransferAction)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(CheckoutDelegatedAuthenticationAction)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(CheckoutNativeRedirectAction)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(CheckoutQrCodeAction)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(CheckoutRedirectAction)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(CheckoutSDKAction)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(CheckoutThreeDS2Action)) - { - this._actualInstance = value; - } - else if (value.GetType() == typeof(CheckoutVoucherAction)) - { - this._actualInstance = value; - } - else - { - throw new ArgumentException("Invalid instance found. Must be the following types: CheckoutAwaitAction, CheckoutBankTransferAction, CheckoutDelegatedAuthenticationAction, CheckoutNativeRedirectAction, CheckoutQrCodeAction, CheckoutRedirectAction, CheckoutSDKAction, CheckoutThreeDS2Action, CheckoutVoucherAction"); - } - } - } + public CheckoutAwaitAction CheckoutAwaitAction { get; set; } /// - /// Get the actual instance of `CheckoutAwaitAction`. If the actual instance is not `CheckoutAwaitAction`, - /// the InvalidClassException will be thrown + /// Gets or Sets CheckoutBankTransferAction /// - /// An instance of CheckoutAwaitAction - public CheckoutAwaitAction GetCheckoutAwaitAction() - { - return (CheckoutAwaitAction)this.ActualInstance; - } + public CheckoutBankTransferAction CheckoutBankTransferAction { get; set; } /// - /// Get the actual instance of `CheckoutBankTransferAction`. If the actual instance is not `CheckoutBankTransferAction`, - /// the InvalidClassException will be thrown + /// Gets or Sets CheckoutDelegatedAuthenticationAction /// - /// An instance of CheckoutBankTransferAction - public CheckoutBankTransferAction GetCheckoutBankTransferAction() - { - return (CheckoutBankTransferAction)this.ActualInstance; - } + public CheckoutDelegatedAuthenticationAction CheckoutDelegatedAuthenticationAction { get; set; } /// - /// Get the actual instance of `CheckoutDelegatedAuthenticationAction`. If the actual instance is not `CheckoutDelegatedAuthenticationAction`, - /// the InvalidClassException will be thrown + /// Gets or Sets CheckoutNativeRedirectAction /// - /// An instance of CheckoutDelegatedAuthenticationAction - public CheckoutDelegatedAuthenticationAction GetCheckoutDelegatedAuthenticationAction() - { - return (CheckoutDelegatedAuthenticationAction)this.ActualInstance; - } + public CheckoutNativeRedirectAction CheckoutNativeRedirectAction { get; set; } /// - /// Get the actual instance of `CheckoutNativeRedirectAction`. If the actual instance is not `CheckoutNativeRedirectAction`, - /// the InvalidClassException will be thrown + /// Gets or Sets CheckoutQrCodeAction /// - /// An instance of CheckoutNativeRedirectAction - public CheckoutNativeRedirectAction GetCheckoutNativeRedirectAction() - { - return (CheckoutNativeRedirectAction)this.ActualInstance; - } + public CheckoutQrCodeAction CheckoutQrCodeAction { get; set; } /// - /// Get the actual instance of `CheckoutQrCodeAction`. If the actual instance is not `CheckoutQrCodeAction`, - /// the InvalidClassException will be thrown + /// Gets or Sets CheckoutRedirectAction /// - /// An instance of CheckoutQrCodeAction - public CheckoutQrCodeAction GetCheckoutQrCodeAction() - { - return (CheckoutQrCodeAction)this.ActualInstance; - } + public CheckoutRedirectAction CheckoutRedirectAction { get; set; } /// - /// Get the actual instance of `CheckoutRedirectAction`. If the actual instance is not `CheckoutRedirectAction`, - /// the InvalidClassException will be thrown + /// Gets or Sets CheckoutSDKAction /// - /// An instance of CheckoutRedirectAction - public CheckoutRedirectAction GetCheckoutRedirectAction() - { - return (CheckoutRedirectAction)this.ActualInstance; - } + public CheckoutSDKAction CheckoutSDKAction { get; set; } /// - /// Get the actual instance of `CheckoutSDKAction`. If the actual instance is not `CheckoutSDKAction`, - /// the InvalidClassException will be thrown + /// Gets or Sets CheckoutThreeDS2Action /// - /// An instance of CheckoutSDKAction - public CheckoutSDKAction GetCheckoutSDKAction() - { - return (CheckoutSDKAction)this.ActualInstance; - } + public CheckoutThreeDS2Action CheckoutThreeDS2Action { get; set; } /// - /// Get the actual instance of `CheckoutThreeDS2Action`. If the actual instance is not `CheckoutThreeDS2Action`, - /// the InvalidClassException will be thrown + /// Gets or Sets CheckoutVoucherAction /// - /// An instance of CheckoutThreeDS2Action - public CheckoutThreeDS2Action GetCheckoutThreeDS2Action() - { - return (CheckoutThreeDS2Action)this.ActualInstance; - } - - /// - /// Get the actual instance of `CheckoutVoucherAction`. If the actual instance is not `CheckoutVoucherAction`, - /// the InvalidClassException will be thrown - /// - /// An instance of CheckoutVoucherAction - public CheckoutVoucherAction GetCheckoutVoucherAction() - { - return (CheckoutVoucherAction)this.ActualInstance; - } + public CheckoutVoucherAction CheckoutVoucherAction { get; set; } /// /// Returns the string presentation of the object @@ -295,218 +171,171 @@ public CheckoutVoucherAction GetCheckoutVoucherAction() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class PaymentResponseAction {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public override string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return JsonConvert.SerializeObject(this.ActualInstance, PaymentResponseAction.SerializerSettings); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentResponseActionJsonConverter : JsonConverter + { /// - /// Converts the JSON string into an instance of PaymentResponseAction + /// Deserializes json to /// - /// JSON string - /// An instance of PaymentResponseAction - public static PaymentResponseAction FromJson(string jsonString) + /// + /// + /// + /// + /// + public override PaymentResponseAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - PaymentResponseAction newPaymentResponseAction = null; + int currentDepth = utf8JsonReader.CurrentDepth; - if (string.IsNullOrEmpty(jsonString)) - { - return newPaymentResponseAction; - } - int match = 0; - List matchedTypes = new List(); - JToken typeToken = JObject.Parse(jsonString).GetValue("type"); - string type = typeToken?.Value(); - // Throw exception if jsonString does not contain type param - if (type == null) - { - throw new InvalidDataException("JsonString does not contain required enum type for deserialization."); - } - try + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + CheckoutAwaitAction checkoutAwaitAction = default; + CheckoutBankTransferAction checkoutBankTransferAction = default; + CheckoutDelegatedAuthenticationAction checkoutDelegatedAuthenticationAction = default; + CheckoutNativeRedirectAction checkoutNativeRedirectAction = default; + CheckoutQrCodeAction checkoutQrCodeAction = default; + CheckoutRedirectAction checkoutRedirectAction = default; + CheckoutSDKAction checkoutSDKAction = default; + CheckoutThreeDS2Action checkoutThreeDS2Action = default; + CheckoutVoucherAction checkoutVoucherAction = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) { - // Check if the jsonString type enum matches the CheckoutAwaitAction type enums - if (ContainsValue(type)) - { - newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); - matchedTypes.Add("CheckoutAwaitAction"); - match++; - } - // Check if the jsonString type enum matches the CheckoutBankTransferAction type enums - if (ContainsValue(type)) - { - newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); - matchedTypes.Add("CheckoutBankTransferAction"); - match++; - } - // Check if the jsonString type enum matches the CheckoutDelegatedAuthenticationAction type enums - if (ContainsValue(type)) - { - newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); - matchedTypes.Add("CheckoutDelegatedAuthenticationAction"); - match++; - } - // Check if the jsonString type enum matches the CheckoutNativeRedirectAction type enums - if (ContainsValue(type)) - { - newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); - matchedTypes.Add("CheckoutNativeRedirectAction"); - match++; - } - // Check if the jsonString type enum matches the CheckoutQrCodeAction type enums - if (ContainsValue(type)) - { - newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); - matchedTypes.Add("CheckoutQrCodeAction"); - match++; - } - // Check if the jsonString type enum matches the CheckoutRedirectAction type enums - if (ContainsValue(type)) - { - newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); - matchedTypes.Add("CheckoutRedirectAction"); - match++; - } - // Check if the jsonString type enum matches the CheckoutSDKAction type enums - if (ContainsValue(type)) - { - newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); - matchedTypes.Add("CheckoutSDKAction"); - match++; - } - // Check if the jsonString type enum matches the CheckoutThreeDS2Action type enums - if (ContainsValue(type)) - { - newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); - matchedTypes.Add("CheckoutThreeDS2Action"); - match++; - } - // Check if the jsonString type enum matches the CheckoutVoucherAction type enums - if (ContainsValue(type)) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) { - newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); - matchedTypes.Add("CheckoutVoucherAction"); - match++; + Utf8JsonReader utf8JsonReaderCheckoutAwaitAction = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutAwaitAction, jsonSerializerOptions, out checkoutAwaitAction); + + Utf8JsonReader utf8JsonReaderCheckoutBankTransferAction = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutBankTransferAction, jsonSerializerOptions, out checkoutBankTransferAction); + + Utf8JsonReader utf8JsonReaderCheckoutDelegatedAuthenticationAction = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutDelegatedAuthenticationAction, jsonSerializerOptions, out checkoutDelegatedAuthenticationAction); + + Utf8JsonReader utf8JsonReaderCheckoutNativeRedirectAction = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutNativeRedirectAction, jsonSerializerOptions, out checkoutNativeRedirectAction); + + Utf8JsonReader utf8JsonReaderCheckoutQrCodeAction = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutQrCodeAction, jsonSerializerOptions, out checkoutQrCodeAction); + + Utf8JsonReader utf8JsonReaderCheckoutRedirectAction = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutRedirectAction, jsonSerializerOptions, out checkoutRedirectAction); + + Utf8JsonReader utf8JsonReaderCheckoutSDKAction = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutSDKAction, jsonSerializerOptions, out checkoutSDKAction); + + Utf8JsonReader utf8JsonReaderCheckoutThreeDS2Action = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutThreeDS2Action, jsonSerializerOptions, out checkoutThreeDS2Action); + + Utf8JsonReader utf8JsonReaderCheckoutVoucherAction = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutVoucherAction, jsonSerializerOptions, out checkoutVoucherAction); } - } - catch (Exception ex) + } + + while (utf8JsonReader.Read()) { - if (!(ex is JsonSerializationException)) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - throw new InvalidDataException(string.Format("Failed to deserialize `{0}` into target: {1}", jsonString, ex.ToString())); + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + default: + break; + } } } - if (match != 1) - { - throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined. MatchedTypes are: " + matchedTypes); - } - - // deserialization is considered successful at this point if no exception has been thrown. - return newPaymentResponseAction; - } + if (checkoutAwaitAction != null) + return new PaymentResponseAction(checkoutAwaitAction); - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PaymentResponseAction); - } + if (checkoutBankTransferAction != null) + return new PaymentResponseAction(checkoutBankTransferAction); - /// - /// Returns true if PaymentResponseAction instances are equal - /// - /// Instance of PaymentResponseAction to be compared - /// Boolean - public bool Equals(PaymentResponseAction input) - { - if (input == null) - return false; + if (checkoutDelegatedAuthenticationAction != null) + return new PaymentResponseAction(checkoutDelegatedAuthenticationAction); - return this.ActualInstance.Equals(input.ActualInstance); - } + if (checkoutNativeRedirectAction != null) + return new PaymentResponseAction(checkoutNativeRedirectAction); - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); - return hashCode; - } - } + if (checkoutQrCodeAction != null) + return new PaymentResponseAction(checkoutQrCodeAction); - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } + if (checkoutRedirectAction != null) + return new PaymentResponseAction(checkoutRedirectAction); - /// - /// Custom JSON converter for PaymentResponseAction - /// - public class PaymentResponseActionJsonConverter : JsonConverter - { - /// - /// To write the JSON string - /// - /// JSON writer - /// Object to be converted into a JSON string - /// JSON Serializer - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - writer.WriteRawValue((string)(typeof(PaymentResponseAction).GetMethod("ToJson").Invoke(value, null))); + if (checkoutSDKAction != null) + return new PaymentResponseAction(checkoutSDKAction); + + if (checkoutThreeDS2Action != null) + return new PaymentResponseAction(checkoutThreeDS2Action); + + if (checkoutVoucherAction != null) + return new PaymentResponseAction(checkoutVoucherAction); + + throw new JsonException(); } /// - /// To convert a JSON string into an object + /// Serializes a /// - /// JSON reader - /// Object type - /// Existing value - /// JSON Serializer - /// The object converted from the JSON string - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentResponseAction paymentResponseAction, JsonSerializerOptions jsonSerializerOptions) { - if(reader.TokenType != JsonToken.Null) - { - return PaymentResponseAction.FromJson(JObject.Load(reader).ToString(Formatting.None)); - } - return null; + writer.WriteStartObject(); + + WriteProperties(writer, paymentResponseAction, jsonSerializerOptions); + writer.WriteEndObject(); } /// - /// Check if the object can be converted + /// Serializes the properties of /// - /// Object type - /// True if the object can be converted - public override bool CanConvert(Type objectType) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentResponseAction paymentResponseAction, JsonSerializerOptions jsonSerializerOptions) { - return false; + } } - } diff --git a/Adyen/Model/Checkout/PaymentReversalRequest.cs b/Adyen/Model/Checkout/PaymentReversalRequest.cs index d68e1eacd..d10b92064 100644 --- a/Adyen/Model/Checkout/PaymentReversalRequest.cs +++ b/Adyen/Model/Checkout/PaymentReversalRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,60 +14,70 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentReversalRequest /// - [DataContract(Name = "PaymentReversalRequest")] - public partial class PaymentReversalRequest : IEquatable, IValidatableObject + public partial class PaymentReversalRequest : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected PaymentReversalRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// applicationInfo. - /// The merchant account that is used to process the payment. (required). - /// Your reference for the reversal request. Maximum length: 80 characters.. - public PaymentReversalRequest(ApplicationInfo applicationInfo = default(ApplicationInfo), string merchantAccount = default(string), string reference = default(string)) + /// The merchant account that is used to process the payment. + /// applicationInfo + /// Your reference for the reversal request. Maximum length: 80 characters. + [JsonConstructor] + public PaymentReversalRequest(string merchantAccount, Option applicationInfo = default, Option reference = default) { - this.MerchantAccount = merchantAccount; - this.ApplicationInfo = applicationInfo; - this.Reference = reference; + MerchantAccount = merchantAccount; + ApplicationInfoOption = applicationInfo; + ReferenceOption = reference; + OnCreated(); } - /// - /// Gets or Sets ApplicationInfo - /// - [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; set; } + partial void OnCreated(); /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantAccount")] public string MerchantAccount { get; set; } + /// + /// Used to track the state of ApplicationInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ApplicationInfoOption { get; private set; } + + /// + /// Gets or Sets ApplicationInfo + /// + [JsonPropertyName("applicationInfo")] + public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } + /// /// Your reference for the reversal request. Maximum length: 80 characters. /// /// Your reference for the reversal request. Maximum length: 80 characters. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -78,94 +87,138 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentReversalRequest {\n"); - sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentReversalRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentReversalRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentReversalRequest); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentReversalRequest instances are equal - /// - /// Instance of PaymentReversalRequest to be compared - /// Boolean - public bool Equals(PaymentReversalRequest input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option merchantAccount = default; + Option applicationInfo = default; + Option reference = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "applicationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentReversalRequest.", nameof(merchantAccount)); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentReversalRequest."); + + if (applicationInfo.IsSet && applicationInfo.Value == null) + throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentReversalRequest."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentReversalRequest."); + + return new PaymentReversalRequest(merchantAccount.Value, applicationInfo, reference); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentReversalRequest paymentReversalRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ApplicationInfo != null) - { - hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentReversalRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentReversalRequest paymentReversalRequest, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentReversalRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentReversalRequest.MerchantAccount), "Property is required for class PaymentReversalRequest."); + + if (paymentReversalRequest.ApplicationInfoOption.IsSet && paymentReversalRequest.ApplicationInfo == null) + throw new ArgumentNullException(nameof(paymentReversalRequest.ApplicationInfo), "Property is required for class PaymentReversalRequest."); + + if (paymentReversalRequest.ReferenceOption.IsSet && paymentReversalRequest.Reference == null) + throw new ArgumentNullException(nameof(paymentReversalRequest.Reference), "Property is required for class PaymentReversalRequest."); + + writer.WriteString("merchantAccount", paymentReversalRequest.MerchantAccount); + + if (paymentReversalRequest.ApplicationInfoOption.IsSet) + { + writer.WritePropertyName("applicationInfo"); + JsonSerializer.Serialize(writer, paymentReversalRequest.ApplicationInfo, jsonSerializerOptions); + } + if (paymentReversalRequest.ReferenceOption.IsSet) + writer.WriteString("reference", paymentReversalRequest.Reference); } } - } diff --git a/Adyen/Model/Checkout/PaymentReversalResponse.cs b/Adyen/Model/Checkout/PaymentReversalResponse.cs index b3d5f5be3..b33d2c68d 100644 --- a/Adyen/Model/Checkout/PaymentReversalResponse.cs +++ b/Adyen/Model/Checkout/PaymentReversalResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,94 +14,135 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaymentReversalResponse /// - [DataContract(Name = "PaymentReversalResponse")] - public partial class PaymentReversalResponse : IEquatable, IValidatableObject + public partial class PaymentReversalResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The merchant account that is used to process the payment. + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. + /// Adyen's 16-character reference associated with the reversal request. + /// The status of your request. This will always have the value **received**. + /// Your reference for the reversal request. + [JsonConstructor] + public PaymentReversalResponse(string merchantAccount, string paymentPspReference, string pspReference, StatusEnum status, Option reference = default) + { + MerchantAccount = merchantAccount; + PaymentPspReference = paymentPspReference; + PspReference = pspReference; + Status = status; + ReferenceOption = reference; + OnCreated(); + } + + partial void OnCreated(); + /// /// The status of your request. This will always have the value **received**. /// /// The status of your request. This will always have the value **received**. - [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Received for value: received /// - [EnumMember(Value = "received")] Received = 1 - } - /// - /// The status of your request. This will always have the value **received**. + /// Returns a /// - /// The status of your request. This will always have the value **received**. - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public StatusEnum Status { get; set; } + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("received")) + return StatusEnum.Received; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected PaymentReversalResponse() { } + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("received")) + return StatusEnum.Received; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The merchant account that is used to process the payment. (required). - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. (required). - /// Adyen's 16-character reference associated with the reversal request. (required). - /// Your reference for the reversal request.. - /// The status of your request. This will always have the value **received**. (required). - public PaymentReversalResponse(string merchantAccount = default(string), string paymentPspReference = default(string), string pspReference = default(string), string reference = default(string), StatusEnum status = default(StatusEnum)) + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum value) { - this.MerchantAccount = merchantAccount; - this.PaymentPspReference = paymentPspReference; - this.PspReference = pspReference; - this.Status = status; - this.Reference = reference; + if (value == StatusEnum.Received) + return "received"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// The status of your request. This will always have the value **received**. + /// + /// The status of your request. This will always have the value **received**. + [JsonPropertyName("status")] + public StatusEnum Status { get; set; } + /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantAccount")] public string MerchantAccount { get; set; } /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. - [DataMember(Name = "paymentPspReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("paymentPspReference")] public string PaymentPspReference { get; set; } /// /// Adyen's 16-character reference associated with the reversal request. /// /// Adyen's 16-character reference associated with the reversal request. - [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("pspReference")] public string PspReference { get; set; } + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } + /// /// Your reference for the reversal request. /// /// Your reference for the reversal request. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -115,107 +155,165 @@ public override string ToString() sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentPspReference: ").Append(PaymentPspReference).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaymentReversalResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaymentReversalResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaymentReversalResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaymentReversalResponse instances are equal - /// - /// Instance of PaymentReversalResponse to be compared - /// Boolean - public bool Equals(PaymentReversalResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option merchantAccount = default; + Option paymentPspReference = default; + Option pspReference = default; + Option status = default; + Option reference = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "paymentPspReference": + paymentPspReference = new Option(utf8JsonReader.GetString()); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(PaymentReversalResponse.StatusEnumFromStringOrDefault(statusRawValue)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.PaymentPspReference == input.PaymentPspReference || - (this.PaymentPspReference != null && - this.PaymentPspReference.Equals(input.PaymentPspReference)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class PaymentReversalResponse.", nameof(merchantAccount)); + + if (!paymentPspReference.IsSet) + throw new ArgumentException("Property is required for class PaymentReversalResponse.", nameof(paymentPspReference)); + + if (!pspReference.IsSet) + throw new ArgumentException("Property is required for class PaymentReversalResponse.", nameof(pspReference)); + + if (!status.IsSet) + throw new ArgumentException("Property is required for class PaymentReversalResponse.", nameof(status)); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentReversalResponse."); + + if (paymentPspReference.IsSet && paymentPspReference.Value == null) + throw new ArgumentNullException(nameof(paymentPspReference), "Property is not nullable for class PaymentReversalResponse."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentReversalResponse."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaymentReversalResponse."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentReversalResponse."); + + return new PaymentReversalResponse(merchantAccount.Value, paymentPspReference.Value, pspReference.Value, status.Value.Value, reference); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaymentReversalResponse paymentReversalResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.PaymentPspReference != null) - { - hashCode = (hashCode * 59) + this.PaymentPspReference.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paymentReversalResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaymentReversalResponse paymentReversalResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paymentReversalResponse.MerchantAccount == null) + throw new ArgumentNullException(nameof(paymentReversalResponse.MerchantAccount), "Property is required for class PaymentReversalResponse."); + + if (paymentReversalResponse.PaymentPspReference == null) + throw new ArgumentNullException(nameof(paymentReversalResponse.PaymentPspReference), "Property is required for class PaymentReversalResponse."); + + if (paymentReversalResponse.PspReference == null) + throw new ArgumentNullException(nameof(paymentReversalResponse.PspReference), "Property is required for class PaymentReversalResponse."); + + if (paymentReversalResponse.ReferenceOption.IsSet && paymentReversalResponse.Reference == null) + throw new ArgumentNullException(nameof(paymentReversalResponse.Reference), "Property is required for class PaymentReversalResponse."); + + writer.WriteString("merchantAccount", paymentReversalResponse.MerchantAccount); + + writer.WriteString("paymentPspReference", paymentReversalResponse.PaymentPspReference); + + writer.WriteString("pspReference", paymentReversalResponse.PspReference); + + var statusRawValue = PaymentReversalResponse.StatusEnumToJsonValue(paymentReversalResponse.Status); + writer.WriteString("status", statusRawValue); + if (paymentReversalResponse.ReferenceOption.IsSet) + writer.WriteString("reference", paymentReversalResponse.Reference); } } - } diff --git a/Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs b/Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs index 3ef2ab0e2..56d51b68b 100644 --- a/Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs +++ b/Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,81 +14,124 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaypalUpdateOrderRequest /// - [DataContract(Name = "PaypalUpdateOrderRequest")] - public partial class PaypalUpdateOrderRequest : IEquatable, IValidatableObject + public partial class PaypalUpdateOrderRequest : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// amount. - /// The list of new delivery methods and the cost of each.. - /// The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request.. - /// The original `pspReference` from the `/payments` response.. - /// The original `sessionId` from the `/sessions` response.. - /// taxTotal. - public PaypalUpdateOrderRequest(Amount amount = default(Amount), List deliveryMethods = default(List), string paymentData = default(string), string pspReference = default(string), string sessionId = default(string), TaxTotal taxTotal = default(TaxTotal)) + /// amount + /// The list of new delivery methods and the cost of each. + /// The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request. + /// The original `pspReference` from the `/payments` response. + /// The original `sessionId` from the `/sessions` response. + /// taxTotal + [JsonConstructor] + public PaypalUpdateOrderRequest(Option amount = default, Option> deliveryMethods = default, Option paymentData = default, Option pspReference = default, Option sessionId = default, Option taxTotal = default) { - this.Amount = amount; - this.DeliveryMethods = deliveryMethods; - this.PaymentData = paymentData; - this.PspReference = pspReference; - this.SessionId = sessionId; - this.TaxTotal = taxTotal; + AmountOption = amount; + DeliveryMethodsOption = deliveryMethods; + PaymentDataOption = paymentData; + PspReferenceOption = pspReference; + SessionIdOption = sessionId; + TaxTotalOption = taxTotal; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Amount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountOption { get; private set; } + /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonPropertyName("amount")] + public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryMethods + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> DeliveryMethodsOption { get; private set; } /// /// The list of new delivery methods and the cost of each. /// /// The list of new delivery methods and the cost of each. - [DataMember(Name = "deliveryMethods", EmitDefaultValue = false)] - public List DeliveryMethods { get; set; } + [JsonPropertyName("deliveryMethods")] + public List DeliveryMethods { get { return this.DeliveryMethodsOption; } set { this.DeliveryMethodsOption = new Option>(value); } } + + /// + /// Used to track the state of PaymentData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentDataOption { get; private set; } /// /// The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request. /// /// The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request. - [DataMember(Name = "paymentData", EmitDefaultValue = false)] - public string PaymentData { get; set; } + [JsonPropertyName("paymentData")] + public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } + + /// + /// Used to track the state of PspReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PspReferenceOption { get; private set; } /// /// The original `pspReference` from the `/payments` response. /// /// The original `pspReference` from the `/payments` response. - [DataMember(Name = "pspReference", EmitDefaultValue = false)] - public string PspReference { get; set; } + [JsonPropertyName("pspReference")] + public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } + + /// + /// Used to track the state of SessionId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SessionIdOption { get; private set; } /// /// The original `sessionId` from the `/sessions` response. /// /// The original `sessionId` from the `/sessions` response. - [DataMember(Name = "sessionId", EmitDefaultValue = false)] - public string SessionId { get; set; } + [JsonPropertyName("sessionId")] + public string SessionId { get { return this.SessionIdOption; } set { this.SessionIdOption = new Option(value); } } + + /// + /// Used to track the state of TaxTotal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TaxTotalOption { get; private set; } /// /// Gets or Sets TaxTotal /// - [DataMember(Name = "taxTotal", EmitDefaultValue = false)] - public TaxTotal TaxTotal { get; set; } + [JsonPropertyName("taxTotal")] + public TaxTotal TaxTotal { get { return this.TaxTotalOption; } set { this.TaxTotalOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -110,114 +152,174 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaypalUpdateOrderRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaypalUpdateOrderRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaypalUpdateOrderRequest); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaypalUpdateOrderRequest instances are equal - /// - /// Instance of PaypalUpdateOrderRequest to be compared - /// Boolean - public bool Equals(PaypalUpdateOrderRequest input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + Option> deliveryMethods = default; + Option paymentData = default; + Option pspReference = default; + Option sessionId = default; + Option taxTotal = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deliveryMethods": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deliveryMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "paymentData": + paymentData = new Option(utf8JsonReader.GetString()); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "sessionId": + sessionId = new Option(utf8JsonReader.GetString()); + break; + case "taxTotal": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + taxTotal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.DeliveryMethods == input.DeliveryMethods || - this.DeliveryMethods != null && - input.DeliveryMethods != null && - this.DeliveryMethods.SequenceEqual(input.DeliveryMethods) - ) && - ( - this.PaymentData == input.PaymentData || - (this.PaymentData != null && - this.PaymentData.Equals(input.PaymentData)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.SessionId == input.SessionId || - (this.SessionId != null && - this.SessionId.Equals(input.SessionId)) - ) && - ( - this.TaxTotal == input.TaxTotal || - (this.TaxTotal != null && - this.TaxTotal.Equals(input.TaxTotal)) - ); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaypalUpdateOrderRequest."); + + if (deliveryMethods.IsSet && deliveryMethods.Value == null) + throw new ArgumentNullException(nameof(deliveryMethods), "Property is not nullable for class PaypalUpdateOrderRequest."); + + if (paymentData.IsSet && paymentData.Value == null) + throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class PaypalUpdateOrderRequest."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaypalUpdateOrderRequest."); + + if (sessionId.IsSet && sessionId.Value == null) + throw new ArgumentNullException(nameof(sessionId), "Property is not nullable for class PaypalUpdateOrderRequest."); + + if (taxTotal.IsSet && taxTotal.Value == null) + throw new ArgumentNullException(nameof(taxTotal), "Property is not nullable for class PaypalUpdateOrderRequest."); + + return new PaypalUpdateOrderRequest(amount, deliveryMethods, paymentData, pspReference, sessionId, taxTotal); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaypalUpdateOrderRequest paypalUpdateOrderRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.DeliveryMethods != null) - { - hashCode = (hashCode * 59) + this.DeliveryMethods.GetHashCode(); - } - if (this.PaymentData != null) - { - hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - if (this.SessionId != null) - { - hashCode = (hashCode * 59) + this.SessionId.GetHashCode(); - } - if (this.TaxTotal != null) - { - hashCode = (hashCode * 59) + this.TaxTotal.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paypalUpdateOrderRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaypalUpdateOrderRequest paypalUpdateOrderRequest, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paypalUpdateOrderRequest.AmountOption.IsSet && paypalUpdateOrderRequest.Amount == null) + throw new ArgumentNullException(nameof(paypalUpdateOrderRequest.Amount), "Property is required for class PaypalUpdateOrderRequest."); + + if (paypalUpdateOrderRequest.DeliveryMethodsOption.IsSet && paypalUpdateOrderRequest.DeliveryMethods == null) + throw new ArgumentNullException(nameof(paypalUpdateOrderRequest.DeliveryMethods), "Property is required for class PaypalUpdateOrderRequest."); + + if (paypalUpdateOrderRequest.PaymentDataOption.IsSet && paypalUpdateOrderRequest.PaymentData == null) + throw new ArgumentNullException(nameof(paypalUpdateOrderRequest.PaymentData), "Property is required for class PaypalUpdateOrderRequest."); + + if (paypalUpdateOrderRequest.PspReferenceOption.IsSet && paypalUpdateOrderRequest.PspReference == null) + throw new ArgumentNullException(nameof(paypalUpdateOrderRequest.PspReference), "Property is required for class PaypalUpdateOrderRequest."); + + if (paypalUpdateOrderRequest.SessionIdOption.IsSet && paypalUpdateOrderRequest.SessionId == null) + throw new ArgumentNullException(nameof(paypalUpdateOrderRequest.SessionId), "Property is required for class PaypalUpdateOrderRequest."); + + if (paypalUpdateOrderRequest.TaxTotalOption.IsSet && paypalUpdateOrderRequest.TaxTotal == null) + throw new ArgumentNullException(nameof(paypalUpdateOrderRequest.TaxTotal), "Property is required for class PaypalUpdateOrderRequest."); + + if (paypalUpdateOrderRequest.AmountOption.IsSet) + { + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, paypalUpdateOrderRequest.Amount, jsonSerializerOptions); + } + if (paypalUpdateOrderRequest.DeliveryMethodsOption.IsSet) + { + writer.WritePropertyName("deliveryMethods"); + JsonSerializer.Serialize(writer, paypalUpdateOrderRequest.DeliveryMethods, jsonSerializerOptions); + } + if (paypalUpdateOrderRequest.PaymentDataOption.IsSet) + writer.WriteString("paymentData", paypalUpdateOrderRequest.PaymentData); + + if (paypalUpdateOrderRequest.PspReferenceOption.IsSet) + writer.WriteString("pspReference", paypalUpdateOrderRequest.PspReference); + + if (paypalUpdateOrderRequest.SessionIdOption.IsSet) + writer.WriteString("sessionId", paypalUpdateOrderRequest.SessionId); + + if (paypalUpdateOrderRequest.TaxTotalOption.IsSet) + { + writer.WritePropertyName("taxTotal"); + JsonSerializer.Serialize(writer, paypalUpdateOrderRequest.TaxTotal, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs b/Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs index 40dfdec71..2aaec14fa 100644 --- a/Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs +++ b/Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,72 +14,114 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PaypalUpdateOrderResponse /// - [DataContract(Name = "PaypalUpdateOrderResponse")] - public partial class PaypalUpdateOrderResponse : IEquatable, IValidatableObject + public partial class PaypalUpdateOrderResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The updated paymentData. + /// The status of the request. This indicates whether the order was successfully updated with PayPal. + [JsonConstructor] + public PaypalUpdateOrderResponse(string paymentData, StatusEnum status) + { + PaymentData = paymentData; + Status = status; + OnCreated(); + } + + partial void OnCreated(); + /// /// The status of the request. This indicates whether the order was successfully updated with PayPal. /// /// The status of the request. This indicates whether the order was successfully updated with PayPal. - [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Error for value: error /// - [EnumMember(Value = "error")] Error = 1, /// /// Enum Success for value: success /// - [EnumMember(Value = "success")] Success = 2 - } - /// - /// The status of the request. This indicates whether the order was successfully updated with PayPal. + /// Returns a /// - /// The status of the request. This indicates whether the order was successfully updated with PayPal. - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public StatusEnum Status { get; set; } + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("error")) + return StatusEnum.Error; + + if (value.Equals("success")) + return StatusEnum.Success; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected PaypalUpdateOrderResponse() { } + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("error")) + return StatusEnum.Error; + + if (value.Equals("success")) + return StatusEnum.Success; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The updated paymentData. (required). - /// The status of the request. This indicates whether the order was successfully updated with PayPal. (required). - public PaypalUpdateOrderResponse(string paymentData = default(string), StatusEnum status = default(StatusEnum)) + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum value) { - this.PaymentData = paymentData; - this.Status = status; + if (value == StatusEnum.Error) + return "error"; + + if (value == StatusEnum.Success) + return "success"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// The status of the request. This indicates whether the order was successfully updated with PayPal. + /// + /// The status of the request. This indicates whether the order was successfully updated with PayPal. + [JsonPropertyName("status")] + public StatusEnum Status { get; set; } + /// /// The updated paymentData. /// /// The updated paymentData. - [DataMember(Name = "paymentData", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("paymentData")] public string PaymentData { get; set; } /// @@ -98,73 +139,116 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PaypalUpdateOrderResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PaypalUpdateOrderResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PaypalUpdateOrderResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PaypalUpdateOrderResponse instances are equal - /// - /// Instance of PaypalUpdateOrderResponse to be compared - /// Boolean - public bool Equals(PaypalUpdateOrderResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option paymentData = default; + Option status = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "paymentData": + paymentData = new Option(utf8JsonReader.GetString()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(PaypalUpdateOrderResponse.StatusEnumFromStringOrDefault(statusRawValue)); + break; + default: + break; + } + } } - return - ( - this.PaymentData == input.PaymentData || - (this.PaymentData != null && - this.PaymentData.Equals(input.PaymentData)) - ) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ); + + if (!paymentData.IsSet) + throw new ArgumentException("Property is required for class PaypalUpdateOrderResponse.", nameof(paymentData)); + + if (!status.IsSet) + throw new ArgumentException("Property is required for class PaypalUpdateOrderResponse.", nameof(status)); + + if (paymentData.IsSet && paymentData.Value == null) + throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class PaypalUpdateOrderResponse."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaypalUpdateOrderResponse."); + + return new PaypalUpdateOrderResponse(paymentData.Value, status.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PaypalUpdateOrderResponse paypalUpdateOrderResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.PaymentData != null) - { - hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, paypalUpdateOrderResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PaypalUpdateOrderResponse paypalUpdateOrderResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (paypalUpdateOrderResponse.PaymentData == null) + throw new ArgumentNullException(nameof(paypalUpdateOrderResponse.PaymentData), "Property is required for class PaypalUpdateOrderResponse."); + + writer.WriteString("paymentData", paypalUpdateOrderResponse.PaymentData); + + var statusRawValue = PaypalUpdateOrderResponse.StatusEnumToJsonValue(paypalUpdateOrderResponse.Status); + writer.WriteString("status", statusRawValue); } } - } diff --git a/Adyen/Model/Checkout/Phone.cs b/Adyen/Model/Checkout/Phone.cs index 64fcbc46e..610137056 100644 --- a/Adyen/Model/Checkout/Phone.cs +++ b/Adyen/Model/Checkout/Phone.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,47 +14,62 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Phone /// - [DataContract(Name = "Phone")] - public partial class Phone : IEquatable, IValidatableObject + public partial class Phone : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Country code. Length: 1–3 characters.. - /// Subscriber number. Maximum length: 15 characters.. - public Phone(string cc = default(string), string subscriber = default(string)) + /// Country code. Length: 1–3 characters. + /// Subscriber number. Maximum length: 15 characters. + [JsonConstructor] + public Phone(Option cc = default, Option subscriber = default) { - this.Cc = cc; - this.Subscriber = subscriber; + CcOption = cc; + SubscriberOption = subscriber; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Cc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CcOption { get; private set; } + /// /// Country code. Length: 1–3 characters. /// /// Country code. Length: 1–3 characters. - [DataMember(Name = "cc", EmitDefaultValue = false)] - public string Cc { get; set; } + [JsonPropertyName("cc")] + public string Cc { get { return this.CcOption; } set { this.CcOption = new Option(value); } } + + /// + /// Used to track the state of Subscriber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubscriberOption { get; private set; } /// /// Subscriber number. Maximum length: 15 characters. /// /// Subscriber number. Maximum length: 15 characters. - [DataMember(Name = "subscriber", EmitDefaultValue = false)] - public string Subscriber { get; set; } + [JsonPropertyName("subscriber")] + public string Subscriber { get { return this.SubscriberOption; } set { this.SubscriberOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -71,96 +85,131 @@ public override string ToString() return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Phone); - } - - /// - /// Returns true if Phone instances are equal - /// - /// Instance of Phone to be compared - /// Boolean - public bool Equals(Phone input) - { - if (input == null) - { - return false; - } - return - ( - this.Cc == input.Cc || - (this.Cc != null && - this.Cc.Equals(input.Cc)) - ) && - ( - this.Subscriber == input.Subscriber || - (this.Subscriber != null && - this.Subscriber.Equals(input.Subscriber)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Cc != null) - { - hashCode = (hashCode * 59) + this.Cc.GetHashCode(); - } - if (this.Subscriber != null) - { - hashCode = (hashCode * 59) + this.Subscriber.GetHashCode(); - } - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Cc (string) maxLength if (this.Cc != null && this.Cc.Length > 3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cc, length must be less than 3.", new [] { "Cc" }); + yield return new ValidationResult("Invalid value for Cc, length must be less than 3.", new [] { "Cc" }); } // Cc (string) minLength if (this.Cc != null && this.Cc.Length < 1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cc, length must be greater than 1.", new [] { "Cc" }); + yield return new ValidationResult("Invalid value for Cc, length must be greater than 1.", new [] { "Cc" }); } // Subscriber (string) maxLength if (this.Subscriber != null && this.Subscriber.Length > 15) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subscriber, length must be less than 15.", new [] { "Subscriber" }); + yield return new ValidationResult("Invalid value for Subscriber, length must be less than 15.", new [] { "Subscriber" }); } yield break; } } + /// + /// A Json converter for type + /// + public class PhoneJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Phone Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option cc = default; + Option subscriber = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "cc": + cc = new Option(utf8JsonReader.GetString()); + break; + case "subscriber": + subscriber = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (cc.IsSet && cc.Value == null) + throw new ArgumentNullException(nameof(cc), "Property is not nullable for class Phone."); + + if (subscriber.IsSet && subscriber.Value == null) + throw new ArgumentNullException(nameof(subscriber), "Property is not nullable for class Phone."); + + return new Phone(cc, subscriber); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Phone phone, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, phone, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Phone phone, JsonSerializerOptions jsonSerializerOptions) + { + if (phone.CcOption.IsSet && phone.Cc == null) + throw new ArgumentNullException(nameof(phone.Cc), "Property is required for class Phone."); + + if (phone.SubscriberOption.IsSet && phone.Subscriber == null) + throw new ArgumentNullException(nameof(phone.Subscriber), "Property is required for class Phone."); + + if (phone.CcOption.IsSet) + writer.WriteString("cc", phone.Cc); + + if (phone.SubscriberOption.IsSet) + writer.WriteString("subscriber", phone.Subscriber); + } + } } diff --git a/Adyen/Model/Checkout/PixDetails.cs b/Adyen/Model/Checkout/PixDetails.cs index f72f7e641..ce7470201 100644 --- a/Adyen/Model/Checkout/PixDetails.cs +++ b/Adyen/Model/Checkout/PixDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,89 +14,163 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PixDetails /// - [DataContract(Name = "PixDetails")] - public partial class PixDetails : IEquatable, IValidatableObject + public partial class PixDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// pixRecurring + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The payment method type. + [JsonConstructor] + public PixDetails(Option checkoutAttemptId = default, Option pixRecurring = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + PixRecurringOption = pixRecurring; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The payment method type. /// /// The payment method type. - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Pix for value: pix /// - [EnumMember(Value = "pix")] Pix = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("pix")) + return TypeEnum.Pix; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("pix")) + return TypeEnum.Pix; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Pix) + return "pix"; + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The payment method type. /// /// The payment method type. - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// pixRecurring. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The payment method type.. - public PixDetails(string checkoutAttemptId = default(string), PixRecurring pixRecurring = default(PixRecurring), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = default(TypeEnum?)) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.PixRecurring = pixRecurring; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of PixRecurring + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PixRecurringOption { get; private set; } /// /// Gets or Sets PixRecurring /// - [DataMember(Name = "pixRecurring", EmitDefaultValue = false)] - public PixRecurring PixRecurring { get; set; } + [JsonPropertyName("pixRecurring")] + public PixRecurring PixRecurring { get { return this.PixRecurringOption; } set { this.PixRecurringOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -117,106 +190,159 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PixDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class PixDetailsJsonConverter : JsonConverter + { /// - /// Returns true if PixDetails instances are equal + /// Deserializes json to /// - /// Instance of PixDetails to be compared - /// Boolean - public bool Equals(PixDetails input) + /// + /// + /// + /// + /// + public override PixDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option pixRecurring = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "pixRecurring": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + pixRecurring = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(PixDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.PixRecurring == input.PixRecurring || - (this.PixRecurring != null && - this.PixRecurring.Equals(input.PixRecurring)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PixDetails."); + + if (pixRecurring.IsSet && pixRecurring.Value == null) + throw new ArgumentNullException(nameof(pixRecurring), "Property is not nullable for class PixDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PixDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PixDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PixDetails."); + + return new PixDetails(checkoutAttemptId, pixRecurring, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PixDetails pixDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.PixRecurring != null) - { - hashCode = (hashCode * 59) + this.PixRecurring.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, pixDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PixDetails pixDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + if (pixDetails.CheckoutAttemptIdOption.IsSet && pixDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(pixDetails.CheckoutAttemptId), "Property is required for class PixDetails."); + + if (pixDetails.PixRecurringOption.IsSet && pixDetails.PixRecurring == null) + throw new ArgumentNullException(nameof(pixDetails.PixRecurring), "Property is required for class PixDetails."); + + if (pixDetails.RecurringDetailReferenceOption.IsSet && pixDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(pixDetails.RecurringDetailReference), "Property is required for class PixDetails."); + + if (pixDetails.StoredPaymentMethodIdOption.IsSet && pixDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(pixDetails.StoredPaymentMethodId), "Property is required for class PixDetails."); + + if (pixDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", pixDetails.CheckoutAttemptId); + + if (pixDetails.PixRecurringOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + writer.WritePropertyName("pixRecurring"); + JsonSerializer.Serialize(writer, pixDetails.PixRecurring, jsonSerializerOptions); } + if (pixDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", pixDetails.RecurringDetailReference); - yield break; + if (pixDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", pixDetails.StoredPaymentMethodId); + + var typeRawValue = PixDetails.TypeEnumToJsonValue(pixDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/PixRecurring.cs b/Adyen/Model/Checkout/PixRecurring.cs index 6eca2f8c8..95b5922ed 100644 --- a/Adyen/Model/Checkout/PixRecurring.cs +++ b/Adyen/Model/Checkout/PixRecurring.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,147 +14,281 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PixRecurring /// - [DataContract(Name = "PixRecurring")] - public partial class PixRecurring : IEquatable, IValidatableObject + public partial class PixRecurring : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The date on which the shopper's payment method will be charged, in YYYY-MM-DD format. + /// End date of the billing plan, in YYYY-MM-DD format. The end date must align with the frequency and the start date of the billing plan. If left blank, the subscription will continue indefinitely unless it is cancelled by the shopper. + /// The frequency at which the shopper will be charged. + /// minAmount + /// The pspReference for the failed recurring payment. Find this in AUTHORISATION webhook you received after the billing date. + /// recurringAmount + /// The text that that will be shown on the shopper's bank statement for the recurring payments. We recommend to add a descriptive text about the subscription to let your shoppers recognize your recurring payments. Maximum length: 35 characters. + /// When set to true, you can retry for failed recurring payments. The default value is true. + /// Start date of the billing plan, in YYYY-MM-DD format. The default value is the transaction date. + [JsonConstructor] + public PixRecurring(Option billingDate = default, Option endsAt = default, Option frequency = default, Option minAmount = default, Option originalPspReference = default, Option recurringAmount = default, Option recurringStatement = default, Option retryPolicy = default, Option startsAt = default) + { + BillingDateOption = billingDate; + EndsAtOption = endsAt; + FrequencyOption = frequency; + MinAmountOption = minAmount; + OriginalPspReferenceOption = originalPspReference; + RecurringAmountOption = recurringAmount; + RecurringStatementOption = recurringStatement; + RetryPolicyOption = retryPolicy; + StartsAtOption = startsAt; + OnCreated(); + } + + partial void OnCreated(); + /// /// The frequency at which the shopper will be charged. /// /// The frequency at which the shopper will be charged. - [JsonConverter(typeof(StringEnumConverter))] public enum FrequencyEnum { /// /// Enum Weekly for value: weekly /// - [EnumMember(Value = "weekly")] Weekly = 1, /// /// Enum Monthly for value: monthly /// - [EnumMember(Value = "monthly")] Monthly = 2, /// /// Enum Quarterly for value: quarterly /// - [EnumMember(Value = "quarterly")] Quarterly = 3, /// /// Enum HalfYearly for value: half-yearly /// - [EnumMember(Value = "half-yearly")] HalfYearly = 4, /// /// Enum Yearly for value: yearly /// - [EnumMember(Value = "yearly")] Yearly = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static FrequencyEnum FrequencyEnumFromString(string value) + { + if (value.Equals("weekly")) + return FrequencyEnum.Weekly; + + if (value.Equals("monthly")) + return FrequencyEnum.Monthly; + + if (value.Equals("quarterly")) + return FrequencyEnum.Quarterly; + + if (value.Equals("half-yearly")) + return FrequencyEnum.HalfYearly; + + if (value.Equals("yearly")) + return FrequencyEnum.Yearly; + + throw new NotImplementedException($"Could not convert value to type FrequencyEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static FrequencyEnum? FrequencyEnumFromStringOrDefault(string value) + { + if (value.Equals("weekly")) + return FrequencyEnum.Weekly; + + if (value.Equals("monthly")) + return FrequencyEnum.Monthly; + + if (value.Equals("quarterly")) + return FrequencyEnum.Quarterly; + + if (value.Equals("half-yearly")) + return FrequencyEnum.HalfYearly; + + if (value.Equals("yearly")) + return FrequencyEnum.Yearly; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FrequencyEnumToJsonValue(FrequencyEnum? value) + { + if (value == FrequencyEnum.Weekly) + return "weekly"; + + if (value == FrequencyEnum.Monthly) + return "monthly"; + if (value == FrequencyEnum.Quarterly) + return "quarterly"; + + if (value == FrequencyEnum.HalfYearly) + return "half-yearly"; + + if (value == FrequencyEnum.Yearly) + return "yearly"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Frequency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FrequencyOption { get; private set; } /// /// The frequency at which the shopper will be charged. /// /// The frequency at which the shopper will be charged. - [DataMember(Name = "frequency", EmitDefaultValue = false)] - public FrequencyEnum? Frequency { get; set; } + [JsonPropertyName("frequency")] + public FrequencyEnum? Frequency { get { return this.FrequencyOption; } set { this.FrequencyOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of BillingDate /// - /// The date on which the shopper's payment method will be charged, in YYYY-MM-DD format.. - /// End date of the billing plan, in YYYY-MM-DD format. The end date must align with the frequency and the start date of the billing plan. If left blank, the subscription will continue indefinitely unless it is cancelled by the shopper.. - /// The frequency at which the shopper will be charged.. - /// minAmount. - /// The pspReference for the failed recurring payment. Find this in AUTHORISATION webhook you received after the billing date.. - /// recurringAmount. - /// The text that that will be shown on the shopper's bank statement for the recurring payments. We recommend to add a descriptive text about the subscription to let your shoppers recognize your recurring payments. Maximum length: 35 characters.. - /// When set to true, you can retry for failed recurring payments. The default value is true.. - /// Start date of the billing plan, in YYYY-MM-DD format. The default value is the transaction date.. - public PixRecurring(string billingDate = default(string), string endsAt = default(string), FrequencyEnum? frequency = default(FrequencyEnum?), Amount minAmount = default(Amount), string originalPspReference = default(string), Amount recurringAmount = default(Amount), string recurringStatement = default(string), bool? retryPolicy = default(bool?), string startsAt = default(string)) - { - this.BillingDate = billingDate; - this.EndsAt = endsAt; - this.Frequency = frequency; - this.MinAmount = minAmount; - this.OriginalPspReference = originalPspReference; - this.RecurringAmount = recurringAmount; - this.RecurringStatement = recurringStatement; - this.RetryPolicy = retryPolicy; - this.StartsAt = startsAt; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingDateOption { get; private set; } /// /// The date on which the shopper's payment method will be charged, in YYYY-MM-DD format. /// /// The date on which the shopper's payment method will be charged, in YYYY-MM-DD format. - [DataMember(Name = "billingDate", EmitDefaultValue = false)] - public string BillingDate { get; set; } + [JsonPropertyName("billingDate")] + public string BillingDate { get { return this.BillingDateOption; } set { this.BillingDateOption = new Option(value); } } + + /// + /// Used to track the state of EndsAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EndsAtOption { get; private set; } /// /// End date of the billing plan, in YYYY-MM-DD format. The end date must align with the frequency and the start date of the billing plan. If left blank, the subscription will continue indefinitely unless it is cancelled by the shopper. /// /// End date of the billing plan, in YYYY-MM-DD format. The end date must align with the frequency and the start date of the billing plan. If left blank, the subscription will continue indefinitely unless it is cancelled by the shopper. - [DataMember(Name = "endsAt", EmitDefaultValue = false)] - public string EndsAt { get; set; } + [JsonPropertyName("endsAt")] + public string EndsAt { get { return this.EndsAtOption; } set { this.EndsAtOption = new Option(value); } } + + /// + /// Used to track the state of MinAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MinAmountOption { get; private set; } /// /// Gets or Sets MinAmount /// - [DataMember(Name = "minAmount", EmitDefaultValue = false)] - public Amount MinAmount { get; set; } + [JsonPropertyName("minAmount")] + public Amount MinAmount { get { return this.MinAmountOption; } set { this.MinAmountOption = new Option(value); } } + + /// + /// Used to track the state of OriginalPspReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OriginalPspReferenceOption { get; private set; } /// /// The pspReference for the failed recurring payment. Find this in AUTHORISATION webhook you received after the billing date. /// /// The pspReference for the failed recurring payment. Find this in AUTHORISATION webhook you received after the billing date. - [DataMember(Name = "originalPspReference", EmitDefaultValue = false)] - public string OriginalPspReference { get; set; } + [JsonPropertyName("originalPspReference")] + public string OriginalPspReference { get { return this.OriginalPspReferenceOption; } set { this.OriginalPspReferenceOption = new Option(value); } } + + /// + /// Used to track the state of RecurringAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringAmountOption { get; private set; } /// /// Gets or Sets RecurringAmount /// - [DataMember(Name = "recurringAmount", EmitDefaultValue = false)] - public Amount RecurringAmount { get; set; } + [JsonPropertyName("recurringAmount")] + public Amount RecurringAmount { get { return this.RecurringAmountOption; } set { this.RecurringAmountOption = new Option(value); } } + + /// + /// Used to track the state of RecurringStatement + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringStatementOption { get; private set; } /// /// The text that that will be shown on the shopper's bank statement for the recurring payments. We recommend to add a descriptive text about the subscription to let your shoppers recognize your recurring payments. Maximum length: 35 characters. /// /// The text that that will be shown on the shopper's bank statement for the recurring payments. We recommend to add a descriptive text about the subscription to let your shoppers recognize your recurring payments. Maximum length: 35 characters. - [DataMember(Name = "recurringStatement", EmitDefaultValue = false)] - public string RecurringStatement { get; set; } + [JsonPropertyName("recurringStatement")] + public string RecurringStatement { get { return this.RecurringStatementOption; } set { this.RecurringStatementOption = new Option(value); } } + + /// + /// Used to track the state of RetryPolicy + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RetryPolicyOption { get; private set; } /// /// When set to true, you can retry for failed recurring payments. The default value is true. /// /// When set to true, you can retry for failed recurring payments. The default value is true. - [DataMember(Name = "retryPolicy", EmitDefaultValue = false)] - public bool? RetryPolicy { get; set; } + [JsonPropertyName("retryPolicy")] + public bool? RetryPolicy { get { return this.RetryPolicyOption; } set { this.RetryPolicyOption = new Option(value); } } + + /// + /// Used to track the state of StartsAt + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StartsAtOption { get; private set; } /// /// Start date of the billing plan, in YYYY-MM-DD format. The default value is the transaction date. /// /// Start date of the billing plan, in YYYY-MM-DD format. The default value is the transaction date. - [DataMember(Name = "startsAt", EmitDefaultValue = false)] - public string StartsAt { get; set; } + [JsonPropertyName("startsAt")] + public string StartsAt { get { return this.StartsAtOption; } set { this.StartsAtOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -179,132 +312,205 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PixRecurringJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PixRecurring Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PixRecurring); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PixRecurring instances are equal - /// - /// Instance of PixRecurring to be compared - /// Boolean - public bool Equals(PixRecurring input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option billingDate = default; + Option endsAt = default; + Option frequency = default; + Option minAmount = default; + Option originalPspReference = default; + Option recurringAmount = default; + Option recurringStatement = default; + Option retryPolicy = default; + Option startsAt = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "billingDate": + billingDate = new Option(utf8JsonReader.GetString()); + break; + case "endsAt": + endsAt = new Option(utf8JsonReader.GetString()); + break; + case "frequency": + string frequencyRawValue = utf8JsonReader.GetString(); + if (frequencyRawValue != null) + frequency = new Option(PixRecurring.FrequencyEnumFromStringOrDefault(frequencyRawValue)); + break; + case "minAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + minAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "originalPspReference": + originalPspReference = new Option(utf8JsonReader.GetString()); + break; + case "recurringAmount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + recurringAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "recurringStatement": + recurringStatement = new Option(utf8JsonReader.GetString()); + break; + case "retryPolicy": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + retryPolicy = new Option(utf8JsonReader.GetBoolean()); + break; + case "startsAt": + startsAt = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.BillingDate == input.BillingDate || - (this.BillingDate != null && - this.BillingDate.Equals(input.BillingDate)) - ) && - ( - this.EndsAt == input.EndsAt || - (this.EndsAt != null && - this.EndsAt.Equals(input.EndsAt)) - ) && - ( - this.Frequency == input.Frequency || - this.Frequency.Equals(input.Frequency) - ) && - ( - this.MinAmount == input.MinAmount || - (this.MinAmount != null && - this.MinAmount.Equals(input.MinAmount)) - ) && - ( - this.OriginalPspReference == input.OriginalPspReference || - (this.OriginalPspReference != null && - this.OriginalPspReference.Equals(input.OriginalPspReference)) - ) && - ( - this.RecurringAmount == input.RecurringAmount || - (this.RecurringAmount != null && - this.RecurringAmount.Equals(input.RecurringAmount)) - ) && - ( - this.RecurringStatement == input.RecurringStatement || - (this.RecurringStatement != null && - this.RecurringStatement.Equals(input.RecurringStatement)) - ) && - ( - this.RetryPolicy == input.RetryPolicy || - this.RetryPolicy.Equals(input.RetryPolicy) - ) && - ( - this.StartsAt == input.StartsAt || - (this.StartsAt != null && - this.StartsAt.Equals(input.StartsAt)) - ); + + if (billingDate.IsSet && billingDate.Value == null) + throw new ArgumentNullException(nameof(billingDate), "Property is not nullable for class PixRecurring."); + + if (endsAt.IsSet && endsAt.Value == null) + throw new ArgumentNullException(nameof(endsAt), "Property is not nullable for class PixRecurring."); + + if (frequency.IsSet && frequency.Value == null) + throw new ArgumentNullException(nameof(frequency), "Property is not nullable for class PixRecurring."); + + if (minAmount.IsSet && minAmount.Value == null) + throw new ArgumentNullException(nameof(minAmount), "Property is not nullable for class PixRecurring."); + + if (originalPspReference.IsSet && originalPspReference.Value == null) + throw new ArgumentNullException(nameof(originalPspReference), "Property is not nullable for class PixRecurring."); + + if (recurringAmount.IsSet && recurringAmount.Value == null) + throw new ArgumentNullException(nameof(recurringAmount), "Property is not nullable for class PixRecurring."); + + if (recurringStatement.IsSet && recurringStatement.Value == null) + throw new ArgumentNullException(nameof(recurringStatement), "Property is not nullable for class PixRecurring."); + + if (retryPolicy.IsSet && retryPolicy.Value == null) + throw new ArgumentNullException(nameof(retryPolicy), "Property is not nullable for class PixRecurring."); + + if (startsAt.IsSet && startsAt.Value == null) + throw new ArgumentNullException(nameof(startsAt), "Property is not nullable for class PixRecurring."); + + return new PixRecurring(billingDate, endsAt, frequency, minAmount, originalPspReference, recurringAmount, recurringStatement, retryPolicy, startsAt); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PixRecurring pixRecurring, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BillingDate != null) - { - hashCode = (hashCode * 59) + this.BillingDate.GetHashCode(); - } - if (this.EndsAt != null) - { - hashCode = (hashCode * 59) + this.EndsAt.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Frequency.GetHashCode(); - if (this.MinAmount != null) - { - hashCode = (hashCode * 59) + this.MinAmount.GetHashCode(); - } - if (this.OriginalPspReference != null) - { - hashCode = (hashCode * 59) + this.OriginalPspReference.GetHashCode(); - } - if (this.RecurringAmount != null) - { - hashCode = (hashCode * 59) + this.RecurringAmount.GetHashCode(); - } - if (this.RecurringStatement != null) - { - hashCode = (hashCode * 59) + this.RecurringStatement.GetHashCode(); - } - hashCode = (hashCode * 59) + this.RetryPolicy.GetHashCode(); - if (this.StartsAt != null) - { - hashCode = (hashCode * 59) + this.StartsAt.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, pixRecurring, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PixRecurring pixRecurring, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (pixRecurring.BillingDateOption.IsSet && pixRecurring.BillingDate == null) + throw new ArgumentNullException(nameof(pixRecurring.BillingDate), "Property is required for class PixRecurring."); + + if (pixRecurring.EndsAtOption.IsSet && pixRecurring.EndsAt == null) + throw new ArgumentNullException(nameof(pixRecurring.EndsAt), "Property is required for class PixRecurring."); + + if (pixRecurring.MinAmountOption.IsSet && pixRecurring.MinAmount == null) + throw new ArgumentNullException(nameof(pixRecurring.MinAmount), "Property is required for class PixRecurring."); + + if (pixRecurring.OriginalPspReferenceOption.IsSet && pixRecurring.OriginalPspReference == null) + throw new ArgumentNullException(nameof(pixRecurring.OriginalPspReference), "Property is required for class PixRecurring."); + + if (pixRecurring.RecurringAmountOption.IsSet && pixRecurring.RecurringAmount == null) + throw new ArgumentNullException(nameof(pixRecurring.RecurringAmount), "Property is required for class PixRecurring."); + + if (pixRecurring.RecurringStatementOption.IsSet && pixRecurring.RecurringStatement == null) + throw new ArgumentNullException(nameof(pixRecurring.RecurringStatement), "Property is required for class PixRecurring."); + + if (pixRecurring.StartsAtOption.IsSet && pixRecurring.StartsAt == null) + throw new ArgumentNullException(nameof(pixRecurring.StartsAt), "Property is required for class PixRecurring."); + + if (pixRecurring.BillingDateOption.IsSet) + writer.WriteString("billingDate", pixRecurring.BillingDate); + + if (pixRecurring.EndsAtOption.IsSet) + writer.WriteString("endsAt", pixRecurring.EndsAt); + + var frequencyRawValue = PixRecurring.FrequencyEnumToJsonValue(pixRecurring.FrequencyOption.Value.Value); + writer.WriteString("frequency", frequencyRawValue); + if (pixRecurring.MinAmountOption.IsSet) + { + writer.WritePropertyName("minAmount"); + JsonSerializer.Serialize(writer, pixRecurring.MinAmount, jsonSerializerOptions); + } + if (pixRecurring.OriginalPspReferenceOption.IsSet) + writer.WriteString("originalPspReference", pixRecurring.OriginalPspReference); + + if (pixRecurring.RecurringAmountOption.IsSet) + { + writer.WritePropertyName("recurringAmount"); + JsonSerializer.Serialize(writer, pixRecurring.RecurringAmount, jsonSerializerOptions); + } + if (pixRecurring.RecurringStatementOption.IsSet) + writer.WriteString("recurringStatement", pixRecurring.RecurringStatement); + + if (pixRecurring.RetryPolicyOption.IsSet) + writer.WriteBoolean("retryPolicy", pixRecurring.RetryPolicyOption.Value.Value); + + if (pixRecurring.StartsAtOption.IsSet) + writer.WriteString("startsAt", pixRecurring.StartsAt); } } - } diff --git a/Adyen/Model/Checkout/PlatformChargebackLogic.cs b/Adyen/Model/Checkout/PlatformChargebackLogic.cs index c5ba7356d..75c5df90b 100644 --- a/Adyen/Model/Checkout/PlatformChargebackLogic.cs +++ b/Adyen/Model/Checkout/PlatformChargebackLogic.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,83 +14,159 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PlatformChargebackLogic /// - [DataContract(Name = "PlatformChargebackLogic")] - public partial class PlatformChargebackLogic : IEquatable, IValidatableObject + public partial class PlatformChargebackLogic : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. + /// The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. + /// The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. + [JsonConstructor] + public PlatformChargebackLogic(Option behavior = default, Option costAllocationAccount = default, Option targetAccount = default) + { + BehaviorOption = behavior; + CostAllocationAccountOption = costAllocationAccount; + TargetAccountOption = targetAccount; + OnCreated(); + } + + partial void OnCreated(); + /// /// The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. /// /// The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. - [JsonConverter(typeof(StringEnumConverter))] public enum BehaviorEnum { /// /// Enum DeductAccordingToSplitRatio for value: deductAccordingToSplitRatio /// - [EnumMember(Value = "deductAccordingToSplitRatio")] DeductAccordingToSplitRatio = 1, /// /// Enum DeductFromLiableAccount for value: deductFromLiableAccount /// - [EnumMember(Value = "deductFromLiableAccount")] DeductFromLiableAccount = 2, /// /// Enum DeductFromOneBalanceAccount for value: deductFromOneBalanceAccount /// - [EnumMember(Value = "deductFromOneBalanceAccount")] DeductFromOneBalanceAccount = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static BehaviorEnum BehaviorEnumFromString(string value) + { + if (value.Equals("deductAccordingToSplitRatio")) + return BehaviorEnum.DeductAccordingToSplitRatio; + + if (value.Equals("deductFromLiableAccount")) + return BehaviorEnum.DeductFromLiableAccount; + + if (value.Equals("deductFromOneBalanceAccount")) + return BehaviorEnum.DeductFromOneBalanceAccount; + + throw new NotImplementedException($"Could not convert value to type BehaviorEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static BehaviorEnum? BehaviorEnumFromStringOrDefault(string value) + { + if (value.Equals("deductAccordingToSplitRatio")) + return BehaviorEnum.DeductAccordingToSplitRatio; + if (value.Equals("deductFromLiableAccount")) + return BehaviorEnum.DeductFromLiableAccount; + + if (value.Equals("deductFromOneBalanceAccount")) + return BehaviorEnum.DeductFromOneBalanceAccount; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string BehaviorEnumToJsonValue(BehaviorEnum? value) + { + if (value == BehaviorEnum.DeductAccordingToSplitRatio) + return "deductAccordingToSplitRatio"; + + if (value == BehaviorEnum.DeductFromLiableAccount) + return "deductFromLiableAccount"; + + if (value == BehaviorEnum.DeductFromOneBalanceAccount) + return "deductFromOneBalanceAccount"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Behavior + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BehaviorOption { get; private set; } /// /// The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. /// /// The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. - [DataMember(Name = "behavior", EmitDefaultValue = false)] - public BehaviorEnum? Behavior { get; set; } + [JsonPropertyName("behavior")] + public BehaviorEnum? Behavior { get { return this.BehaviorOption; } set { this.BehaviorOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CostAllocationAccount /// - /// The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**.. - /// The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account.. - /// The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**.. - public PlatformChargebackLogic(BehaviorEnum? behavior = default(BehaviorEnum?), string costAllocationAccount = default(string), string targetAccount = default(string)) - { - this.Behavior = behavior; - this.CostAllocationAccount = costAllocationAccount; - this.TargetAccount = targetAccount; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CostAllocationAccountOption { get; private set; } /// /// The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. /// /// The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. - [DataMember(Name = "costAllocationAccount", EmitDefaultValue = false)] - public string CostAllocationAccount { get; set; } + [JsonPropertyName("costAllocationAccount")] + public string CostAllocationAccount { get { return this.CostAllocationAccountOption; } set { this.CostAllocationAccountOption = new Option(value); } } + + /// + /// Used to track the state of TargetAccount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TargetAccountOption { get; private set; } /// /// The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. /// /// The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. - [DataMember(Name = "targetAccount", EmitDefaultValue = false)] - public string TargetAccount { get; set; } + [JsonPropertyName("targetAccount")] + public string TargetAccount { get { return this.TargetAccountOption; } set { this.TargetAccountOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -109,82 +184,123 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PlatformChargebackLogicJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PlatformChargebackLogic Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PlatformChargebackLogic); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PlatformChargebackLogic instances are equal - /// - /// Instance of PlatformChargebackLogic to be compared - /// Boolean - public bool Equals(PlatformChargebackLogic input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option behavior = default; + Option costAllocationAccount = default; + Option targetAccount = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "behavior": + string behaviorRawValue = utf8JsonReader.GetString(); + if (behaviorRawValue != null) + behavior = new Option(PlatformChargebackLogic.BehaviorEnumFromStringOrDefault(behaviorRawValue)); + break; + case "costAllocationAccount": + costAllocationAccount = new Option(utf8JsonReader.GetString()); + break; + case "targetAccount": + targetAccount = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Behavior == input.Behavior || - this.Behavior.Equals(input.Behavior) - ) && - ( - this.CostAllocationAccount == input.CostAllocationAccount || - (this.CostAllocationAccount != null && - this.CostAllocationAccount.Equals(input.CostAllocationAccount)) - ) && - ( - this.TargetAccount == input.TargetAccount || - (this.TargetAccount != null && - this.TargetAccount.Equals(input.TargetAccount)) - ); + + if (behavior.IsSet && behavior.Value == null) + throw new ArgumentNullException(nameof(behavior), "Property is not nullable for class PlatformChargebackLogic."); + + if (costAllocationAccount.IsSet && costAllocationAccount.Value == null) + throw new ArgumentNullException(nameof(costAllocationAccount), "Property is not nullable for class PlatformChargebackLogic."); + + if (targetAccount.IsSet && targetAccount.Value == null) + throw new ArgumentNullException(nameof(targetAccount), "Property is not nullable for class PlatformChargebackLogic."); + + return new PlatformChargebackLogic(behavior, costAllocationAccount, targetAccount); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PlatformChargebackLogic platformChargebackLogic, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Behavior.GetHashCode(); - if (this.CostAllocationAccount != null) - { - hashCode = (hashCode * 59) + this.CostAllocationAccount.GetHashCode(); - } - if (this.TargetAccount != null) - { - hashCode = (hashCode * 59) + this.TargetAccount.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, platformChargebackLogic, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PlatformChargebackLogic platformChargebackLogic, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (platformChargebackLogic.CostAllocationAccountOption.IsSet && platformChargebackLogic.CostAllocationAccount == null) + throw new ArgumentNullException(nameof(platformChargebackLogic.CostAllocationAccount), "Property is required for class PlatformChargebackLogic."); + + if (platformChargebackLogic.TargetAccountOption.IsSet && platformChargebackLogic.TargetAccount == null) + throw new ArgumentNullException(nameof(platformChargebackLogic.TargetAccount), "Property is required for class PlatformChargebackLogic."); + + var behaviorRawValue = PlatformChargebackLogic.BehaviorEnumToJsonValue(platformChargebackLogic.BehaviorOption.Value.Value); + writer.WriteString("behavior", behaviorRawValue); + if (platformChargebackLogic.CostAllocationAccountOption.IsSet) + writer.WriteString("costAllocationAccount", platformChargebackLogic.CostAllocationAccount); + + if (platformChargebackLogic.TargetAccountOption.IsSet) + writer.WriteString("targetAccount", platformChargebackLogic.TargetAccount); } } - } diff --git a/Adyen/Model/Checkout/PseDetails.cs b/Adyen/Model/Checkout/PseDetails.cs index 1d09e8d45..31f953d05 100644 --- a/Adyen/Model/Checkout/PseDetails.cs +++ b/Adyen/Model/Checkout/PseDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,104 +14,152 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// PseDetails /// - [DataContract(Name = "PseDetails")] - public partial class PseDetails : IEquatable, IValidatableObject + public partial class PseDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The shopper's bank. + /// The client type. + /// The identification code. + /// The identification type. + /// The checkout attempt identifier. + /// The payment method type. + [JsonConstructor] + public PseDetails(string bank, string clientType, string identification, string identificationType, Option checkoutAttemptId = default, Option type = default) + { + Bank = bank; + ClientType = clientType; + Identification = identification; + IdentificationType = identificationType; + CheckoutAttemptIdOption = checkoutAttemptId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The payment method type. /// /// The payment method type. - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum PsePayulatam for value: pse_payulatam /// - [EnumMember(Value = "pse_payulatam")] PsePayulatam = 1 - } - /// - /// The payment method type. + /// Returns a /// - /// The payment method type. - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("pse_payulatam")) + return TypeEnum.PsePayulatam; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected PseDetails() { } + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("pse_payulatam")) + return TypeEnum.PsePayulatam; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The shopper's bank. (required). - /// The checkout attempt identifier.. - /// The client type. (required). - /// The identification code. (required). - /// The identification type. (required). - /// The payment method type.. - public PseDetails(string bank = default(string), string checkoutAttemptId = default(string), string clientType = default(string), string identification = default(string), string identificationType = default(string), TypeEnum? type = default(TypeEnum?)) + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) { - this.Bank = bank; - this.ClientType = clientType; - this.Identification = identification; - this.IdentificationType = identificationType; - this.CheckoutAttemptId = checkoutAttemptId; - this.Type = type; + if (value == TypeEnum.PsePayulatam) + return "pse_payulatam"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// The shopper's bank. + /// Used to track the state of Type /// - /// The shopper's bank. - [DataMember(Name = "bank", IsRequired = false, EmitDefaultValue = false)] - public string Bank { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// - /// The checkout attempt identifier. + /// The payment method type. /// - /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + /// The payment method type. + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + + /// + /// The shopper's bank. + /// + /// The shopper's bank. + [JsonPropertyName("bank")] + public string Bank { get; set; } /// /// The client type. /// /// The client type. - [DataMember(Name = "clientType", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("clientType")] public string ClientType { get; set; } /// /// The identification code. /// /// The identification code. - [DataMember(Name = "identification", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("identification")] public string Identification { get; set; } /// /// The identification type. /// /// The identification type. - [DataMember(Name = "identificationType", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("identificationType")] public string IdentificationType { get; set; } + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } + + /// + /// The checkout attempt identifier. + /// + /// The checkout attempt identifier. + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -122,119 +169,181 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PseDetails {\n"); sb.Append(" Bank: ").Append(Bank).Append("\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" ClientType: ").Append(ClientType).Append("\n"); sb.Append(" Identification: ").Append(Identification).Append("\n"); sb.Append(" IdentificationType: ").Append(IdentificationType).Append("\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class PseDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override PseDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as PseDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if PseDetails instances are equal - /// - /// Instance of PseDetails to be compared - /// Boolean - public bool Equals(PseDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option bank = default; + Option clientType = default; + Option identification = default; + Option identificationType = default; + Option checkoutAttemptId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "bank": + bank = new Option(utf8JsonReader.GetString()); + break; + case "clientType": + clientType = new Option(utf8JsonReader.GetString()); + break; + case "identification": + identification = new Option(utf8JsonReader.GetString()); + break; + case "identificationType": + identificationType = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(PseDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.Bank == input.Bank || - (this.Bank != null && - this.Bank.Equals(input.Bank)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.ClientType == input.ClientType || - (this.ClientType != null && - this.ClientType.Equals(input.ClientType)) - ) && - ( - this.Identification == input.Identification || - (this.Identification != null && - this.Identification.Equals(input.Identification)) - ) && - ( - this.IdentificationType == input.IdentificationType || - (this.IdentificationType != null && - this.IdentificationType.Equals(input.IdentificationType)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!bank.IsSet) + throw new ArgumentException("Property is required for class PseDetails.", nameof(bank)); + + if (!clientType.IsSet) + throw new ArgumentException("Property is required for class PseDetails.", nameof(clientType)); + + if (!identification.IsSet) + throw new ArgumentException("Property is required for class PseDetails.", nameof(identification)); + + if (!identificationType.IsSet) + throw new ArgumentException("Property is required for class PseDetails.", nameof(identificationType)); + + if (bank.IsSet && bank.Value == null) + throw new ArgumentNullException(nameof(bank), "Property is not nullable for class PseDetails."); + + if (clientType.IsSet && clientType.Value == null) + throw new ArgumentNullException(nameof(clientType), "Property is not nullable for class PseDetails."); + + if (identification.IsSet && identification.Value == null) + throw new ArgumentNullException(nameof(identification), "Property is not nullable for class PseDetails."); + + if (identificationType.IsSet && identificationType.Value == null) + throw new ArgumentNullException(nameof(identificationType), "Property is not nullable for class PseDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PseDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class PseDetails."); + + return new PseDetails(bank.Value, clientType.Value, identification.Value, identificationType.Value, checkoutAttemptId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PseDetails pseDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Bank != null) - { - hashCode = (hashCode * 59) + this.Bank.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.ClientType != null) - { - hashCode = (hashCode * 59) + this.ClientType.GetHashCode(); - } - if (this.Identification != null) - { - hashCode = (hashCode * 59) + this.Identification.GetHashCode(); - } - if (this.IdentificationType != null) - { - hashCode = (hashCode * 59) + this.IdentificationType.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, pseDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PseDetails pseDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (pseDetails.Bank == null) + throw new ArgumentNullException(nameof(pseDetails.Bank), "Property is required for class PseDetails."); + + if (pseDetails.ClientType == null) + throw new ArgumentNullException(nameof(pseDetails.ClientType), "Property is required for class PseDetails."); + + if (pseDetails.Identification == null) + throw new ArgumentNullException(nameof(pseDetails.Identification), "Property is required for class PseDetails."); + + if (pseDetails.IdentificationType == null) + throw new ArgumentNullException(nameof(pseDetails.IdentificationType), "Property is required for class PseDetails."); + + if (pseDetails.CheckoutAttemptIdOption.IsSet && pseDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(pseDetails.CheckoutAttemptId), "Property is required for class PseDetails."); + + writer.WriteString("bank", pseDetails.Bank); + + writer.WriteString("clientType", pseDetails.ClientType); + + writer.WriteString("identification", pseDetails.Identification); + + writer.WriteString("identificationType", pseDetails.IdentificationType); + + if (pseDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", pseDetails.CheckoutAttemptId); + + var typeRawValue = PseDetails.TypeEnumToJsonValue(pseDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/RakutenPayDetails.cs b/Adyen/Model/Checkout/RakutenPayDetails.cs index ee4929ddb..0099d978d 100644 --- a/Adyen/Model/Checkout/RakutenPayDetails.cs +++ b/Adyen/Model/Checkout/RakutenPayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,81 +14,148 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// RakutenPayDetails /// - [DataContract(Name = "RakutenPayDetails")] - public partial class RakutenPayDetails : IEquatable, IValidatableObject + public partial class RakutenPayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **rakutenpay** (default to TypeEnum.Rakutenpay) + [JsonConstructor] + public RakutenPayDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **rakutenpay** /// /// **rakutenpay** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Rakutenpay for value: rakutenpay /// - [EnumMember(Value = "rakutenpay")] Rakutenpay = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("rakutenpay")) + return TypeEnum.Rakutenpay; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("rakutenpay")) + return TypeEnum.Rakutenpay; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Rakutenpay) + return "rakutenpay"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **rakutenpay** /// /// **rakutenpay** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **rakutenpay** (default to TypeEnum.Rakutenpay). - public RakutenPayDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Rakutenpay) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -108,97 +174,143 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as RakutenPayDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class RakutenPayDetailsJsonConverter : JsonConverter + { /// - /// Returns true if RakutenPayDetails instances are equal + /// Deserializes json to /// - /// Instance of RakutenPayDetails to be compared - /// Boolean - public bool Equals(RakutenPayDetails input) + /// + /// + /// + /// + /// + public override RakutenPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(RakutenPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class RakutenPayDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class RakutenPayDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class RakutenPayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class RakutenPayDetails."); + + return new RakutenPayDetails(checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RakutenPayDetails rakutenPayDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, rakutenPayDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, RakutenPayDetails rakutenPayDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (rakutenPayDetails.CheckoutAttemptIdOption.IsSet && rakutenPayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(rakutenPayDetails.CheckoutAttemptId), "Property is required for class RakutenPayDetails."); - yield break; + if (rakutenPayDetails.RecurringDetailReferenceOption.IsSet && rakutenPayDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(rakutenPayDetails.RecurringDetailReference), "Property is required for class RakutenPayDetails."); + + if (rakutenPayDetails.StoredPaymentMethodIdOption.IsSet && rakutenPayDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(rakutenPayDetails.StoredPaymentMethodId), "Property is required for class RakutenPayDetails."); + + if (rakutenPayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", rakutenPayDetails.CheckoutAttemptId); + + if (rakutenPayDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", rakutenPayDetails.RecurringDetailReference); + + if (rakutenPayDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", rakutenPayDetails.StoredPaymentMethodId); + + var typeRawValue = RakutenPayDetails.TypeEnumToJsonValue(rakutenPayDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/RatepayDetails.cs b/Adyen/Model/Checkout/RatepayDetails.cs index a91182132..f10f2d292 100644 --- a/Adyen/Model/Checkout/RatepayDetails.cs +++ b/Adyen/Model/Checkout/RatepayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,119 +14,203 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// RatepayDetails /// - [DataContract(Name = "RatepayDetails")] - public partial class RatepayDetails : IEquatable, IValidatableObject + public partial class RatepayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The address where to send the invoice. + /// The checkout attempt identifier. + /// The address where the goods should be delivered. + /// Shopper name, date of birth, phone number, and email address. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **ratepay** (default to TypeEnum.Ratepay) + [JsonConstructor] + public RatepayDetails(Option billingAddress = default, Option checkoutAttemptId = default, Option deliveryAddress = default, Option personalDetails = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.Ratepay) + { + BillingAddressOption = billingAddress; + CheckoutAttemptIdOption = checkoutAttemptId; + DeliveryAddressOption = deliveryAddress; + PersonalDetailsOption = personalDetails; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + Type = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **ratepay** /// /// **ratepay** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Ratepay for value: ratepay /// - [EnumMember(Value = "ratepay")] Ratepay = 1, /// /// Enum RatepayDirectdebit for value: ratepay_directdebit /// - [EnumMember(Value = "ratepay_directdebit")] RatepayDirectdebit = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("ratepay")) + return TypeEnum.Ratepay; + + if (value.Equals("ratepay_directdebit")) + return TypeEnum.RatepayDirectdebit; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("ratepay")) + return TypeEnum.Ratepay; + + if (value.Equals("ratepay_directdebit")) + return TypeEnum.RatepayDirectdebit; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.Ratepay) + return "ratepay"; + + if (value == TypeEnum.RatepayDirectdebit) + return "ratepay_directdebit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **ratepay** /// /// **ratepay** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of BillingAddress /// - [JsonConstructorAttribute] - protected RatepayDetails() { } - /// - /// Initializes a new instance of the class. - /// - /// The address where to send the invoice.. - /// The checkout attempt identifier.. - /// The address where the goods should be delivered.. - /// Shopper name, date of birth, phone number, and email address.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **ratepay** (required) (default to TypeEnum.Ratepay). - public RatepayDetails(string billingAddress = default(string), string checkoutAttemptId = default(string), string deliveryAddress = default(string), string personalDetails = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.Ratepay) - { - this.Type = type; - this.BillingAddress = billingAddress; - this.CheckoutAttemptId = checkoutAttemptId; - this.DeliveryAddress = deliveryAddress; - this.PersonalDetails = personalDetails; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressOption { get; private set; } /// /// The address where to send the invoice. /// /// The address where to send the invoice. - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public string BillingAddress { get; set; } + [JsonPropertyName("billingAddress")] + public string BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryAddressOption { get; private set; } /// /// The address where the goods should be delivered. /// /// The address where the goods should be delivered. - [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] - public string DeliveryAddress { get; set; } + [JsonPropertyName("deliveryAddress")] + public string DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } + + /// + /// Used to track the state of PersonalDetails + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PersonalDetailsOption { get; private set; } /// /// Shopper name, date of birth, phone number, and email address. /// /// Shopper name, date of birth, phone number, and email address. - [DataMember(Name = "personalDetails", EmitDefaultValue = false)] - public string PersonalDetails { get; set; } + [JsonPropertyName("personalDetails")] + public string PersonalDetails { get { return this.PersonalDetailsOption; } set { this.PersonalDetailsOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -149,124 +232,185 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as RatepayDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class RatepayDetailsJsonConverter : JsonConverter + { /// - /// Returns true if RatepayDetails instances are equal + /// Deserializes json to /// - /// Instance of RatepayDetails to be compared - /// Boolean - public bool Equals(RatepayDetails input) + /// + /// + /// + /// + /// + public override RatepayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option billingAddress = default; + Option checkoutAttemptId = default; + Option deliveryAddress = default; + Option personalDetails = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "billingAddress": + billingAddress = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "deliveryAddress": + deliveryAddress = new Option(utf8JsonReader.GetString()); + break; + case "personalDetails": + personalDetails = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(RatepayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) - ) && - ( - this.PersonalDetails == input.PersonalDetails || - (this.PersonalDetails != null && - this.PersonalDetails.Equals(input.PersonalDetails)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class RatepayDetails.", nameof(type)); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class RatepayDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class RatepayDetails."); + + if (deliveryAddress.IsSet && deliveryAddress.Value == null) + throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class RatepayDetails."); + + if (personalDetails.IsSet && personalDetails.Value == null) + throw new ArgumentNullException(nameof(personalDetails), "Property is not nullable for class RatepayDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class RatepayDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class RatepayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class RatepayDetails."); + + return new RatepayDetails(billingAddress, checkoutAttemptId, deliveryAddress, personalDetails, recurringDetailReference, storedPaymentMethodId, type.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RatepayDetails ratepayDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.DeliveryAddress != null) - { - hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); - } - if (this.PersonalDetails != null) - { - hashCode = (hashCode * 59) + this.PersonalDetails.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, ratepayDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, RatepayDetails ratepayDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (ratepayDetails.BillingAddressOption.IsSet && ratepayDetails.BillingAddress == null) + throw new ArgumentNullException(nameof(ratepayDetails.BillingAddress), "Property is required for class RatepayDetails."); - yield break; + if (ratepayDetails.CheckoutAttemptIdOption.IsSet && ratepayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(ratepayDetails.CheckoutAttemptId), "Property is required for class RatepayDetails."); + + if (ratepayDetails.DeliveryAddressOption.IsSet && ratepayDetails.DeliveryAddress == null) + throw new ArgumentNullException(nameof(ratepayDetails.DeliveryAddress), "Property is required for class RatepayDetails."); + + if (ratepayDetails.PersonalDetailsOption.IsSet && ratepayDetails.PersonalDetails == null) + throw new ArgumentNullException(nameof(ratepayDetails.PersonalDetails), "Property is required for class RatepayDetails."); + + if (ratepayDetails.RecurringDetailReferenceOption.IsSet && ratepayDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(ratepayDetails.RecurringDetailReference), "Property is required for class RatepayDetails."); + + if (ratepayDetails.StoredPaymentMethodIdOption.IsSet && ratepayDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(ratepayDetails.StoredPaymentMethodId), "Property is required for class RatepayDetails."); + + if (ratepayDetails.BillingAddressOption.IsSet) + writer.WriteString("billingAddress", ratepayDetails.BillingAddress); + + if (ratepayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", ratepayDetails.CheckoutAttemptId); + + if (ratepayDetails.DeliveryAddressOption.IsSet) + writer.WriteString("deliveryAddress", ratepayDetails.DeliveryAddress); + + if (ratepayDetails.PersonalDetailsOption.IsSet) + writer.WriteString("personalDetails", ratepayDetails.PersonalDetails); + + if (ratepayDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", ratepayDetails.RecurringDetailReference); + + if (ratepayDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", ratepayDetails.StoredPaymentMethodId); + + var typeRawValue = RatepayDetails.TypeEnumToJsonValue(ratepayDetails.Type); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/Recurring.cs b/Adyen/Model/Checkout/Recurring.cs index 27e435f8c..eeffb3836 100644 --- a/Adyen/Model/Checkout/Recurring.cs +++ b/Adyen/Model/Checkout/Recurring.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,134 +14,286 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Recurring /// - [DataContract(Name = "Recurring")] - public partial class Recurring : IEquatable, IValidatableObject + public partial class Recurring : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts). + /// A descriptive name for this detail. + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + /// Minimum number of days between authorisations. Only for 3D Secure 2. + /// The name of the token service. + [JsonConstructor] + public Recurring(Option contract = default, Option recurringDetailName = default, Option recurringExpiry = default, Option recurringFrequency = default, Option tokenService = default) + { + ContractOption = contract; + RecurringDetailNameOption = recurringDetailName; + RecurringExpiryOption = recurringExpiry; + RecurringFrequencyOption = recurringFrequency; + TokenServiceOption = tokenService; + OnCreated(); + } + + partial void OnCreated(); + /// /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts). /// /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts). - [JsonConverter(typeof(StringEnumConverter))] public enum ContractEnum { /// /// Enum ONECLICK for value: ONECLICK /// - [EnumMember(Value = "ONECLICK")] ONECLICK = 1, /// /// Enum RECURRING for value: RECURRING /// - [EnumMember(Value = "RECURRING")] RECURRING = 2, /// /// Enum PAYOUT for value: PAYOUT /// - [EnumMember(Value = "PAYOUT")] PAYOUT = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ContractEnum ContractEnumFromString(string value) + { + if (value.Equals("ONECLICK")) + return ContractEnum.ONECLICK; + + if (value.Equals("RECURRING")) + return ContractEnum.RECURRING; + + if (value.Equals("PAYOUT")) + return ContractEnum.PAYOUT; + + throw new NotImplementedException($"Could not convert value to type ContractEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ContractEnum? ContractEnumFromStringOrDefault(string value) + { + if (value.Equals("ONECLICK")) + return ContractEnum.ONECLICK; + + if (value.Equals("RECURRING")) + return ContractEnum.RECURRING; + + if (value.Equals("PAYOUT")) + return ContractEnum.PAYOUT; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ContractEnumToJsonValue(ContractEnum? value) + { + if (value == ContractEnum.ONECLICK) + return "ONECLICK"; + + if (value == ContractEnum.RECURRING) + return "RECURRING"; + if (value == ContractEnum.PAYOUT) + return "PAYOUT"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Contract + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ContractOption { get; private set; } /// /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts). /// /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts). - [DataMember(Name = "contract", EmitDefaultValue = false)] - public ContractEnum? Contract { get; set; } + [JsonPropertyName("contract")] + public ContractEnum? Contract { get { return this.ContractOption; } set { this.ContractOption = new Option(value); } } + /// /// The name of the token service. /// /// The name of the token service. - [JsonConverter(typeof(StringEnumConverter))] public enum TokenServiceEnum { /// /// Enum VISATOKENSERVICE for value: VISATOKENSERVICE /// - [EnumMember(Value = "VISATOKENSERVICE")] VISATOKENSERVICE = 1, /// /// Enum MCTOKENSERVICE for value: MCTOKENSERVICE /// - [EnumMember(Value = "MCTOKENSERVICE")] MCTOKENSERVICE = 2, /// /// Enum AMEXTOKENSERVICE for value: AMEXTOKENSERVICE /// - [EnumMember(Value = "AMEXTOKENSERVICE")] AMEXTOKENSERVICE = 3, /// /// Enum TOKENSHARING for value: TOKEN_SHARING /// - [EnumMember(Value = "TOKEN_SHARING")] TOKENSHARING = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TokenServiceEnum TokenServiceEnumFromString(string value) + { + if (value.Equals("VISATOKENSERVICE")) + return TokenServiceEnum.VISATOKENSERVICE; + + if (value.Equals("MCTOKENSERVICE")) + return TokenServiceEnum.MCTOKENSERVICE; + + if (value.Equals("AMEXTOKENSERVICE")) + return TokenServiceEnum.AMEXTOKENSERVICE; + + if (value.Equals("TOKEN_SHARING")) + return TokenServiceEnum.TOKENSHARING; + + throw new NotImplementedException($"Could not convert value to type TokenServiceEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TokenServiceEnum? TokenServiceEnumFromStringOrDefault(string value) + { + if (value.Equals("VISATOKENSERVICE")) + return TokenServiceEnum.VISATOKENSERVICE; + + if (value.Equals("MCTOKENSERVICE")) + return TokenServiceEnum.MCTOKENSERVICE; + + if (value.Equals("AMEXTOKENSERVICE")) + return TokenServiceEnum.AMEXTOKENSERVICE; + + if (value.Equals("TOKEN_SHARING")) + return TokenServiceEnum.TOKENSHARING; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TokenServiceEnumToJsonValue(TokenServiceEnum? value) + { + if (value == TokenServiceEnum.VISATOKENSERVICE) + return "VISATOKENSERVICE"; + + if (value == TokenServiceEnum.MCTOKENSERVICE) + return "MCTOKENSERVICE"; + + if (value == TokenServiceEnum.AMEXTOKENSERVICE) + return "AMEXTOKENSERVICE"; + if (value == TokenServiceEnum.TOKENSHARING) + return "TOKEN_SHARING"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of TokenService + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TokenServiceOption { get; private set; } /// /// The name of the token service. /// /// The name of the token service. - [DataMember(Name = "tokenService", EmitDefaultValue = false)] - public TokenServiceEnum? TokenService { get; set; } + [JsonPropertyName("tokenService")] + public TokenServiceEnum? TokenService { get { return this.TokenServiceOption; } set { this.TokenServiceOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of RecurringDetailName /// - /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts).. - /// A descriptive name for this detail.. - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2.. - /// Minimum number of days between authorisations. Only for 3D Secure 2.. - /// The name of the token service.. - public Recurring(ContractEnum? contract = default(ContractEnum?), string recurringDetailName = default(string), DateTime recurringExpiry = default(DateTime), string recurringFrequency = default(string), TokenServiceEnum? tokenService = default(TokenServiceEnum?)) - { - this.Contract = contract; - this.RecurringDetailName = recurringDetailName; - this.RecurringExpiry = recurringExpiry; - this.RecurringFrequency = recurringFrequency; - this.TokenService = tokenService; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailNameOption { get; private set; } /// /// A descriptive name for this detail. /// /// A descriptive name for this detail. - [DataMember(Name = "recurringDetailName", EmitDefaultValue = false)] - public string RecurringDetailName { get; set; } + [JsonPropertyName("recurringDetailName")] + public string RecurringDetailName { get { return this.RecurringDetailNameOption; } set { this.RecurringDetailNameOption = new Option(value); } } + + /// + /// Used to track the state of RecurringExpiry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringExpiryOption { get; private set; } /// /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. /// /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. - [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] - public DateTime RecurringExpiry { get; set; } + [JsonPropertyName("recurringExpiry")] + public DateTime? RecurringExpiry { get { return this.RecurringExpiryOption; } set { this.RecurringExpiryOption = new Option(value); } } + + /// + /// Used to track the state of RecurringFrequency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringFrequencyOption { get; private set; } /// /// Minimum number of days between authorisations. Only for 3D Secure 2. /// /// Minimum number of days between authorisations. Only for 3D Secure 2. - [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] - public string RecurringFrequency { get; set; } + [JsonPropertyName("recurringFrequency")] + public string RecurringFrequency { get { return this.RecurringFrequencyOption; } set { this.RecurringFrequencyOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -162,96 +313,151 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class RecurringJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// The format to use to serialize RecurringExpiry /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Recurring); - } + public static string RecurringExpiryFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// Returns true if Recurring instances are equal + /// Deserializes json to /// - /// Instance of Recurring to be compared - /// Boolean - public bool Equals(Recurring input) + /// + /// + /// + /// + /// + public override Recurring Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option contract = default; + Option recurringDetailName = default; + Option recurringExpiry = default; + Option recurringFrequency = default; + Option tokenService = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "contract": + string contractRawValue = utf8JsonReader.GetString(); + if (contractRawValue != null) + contract = new Option(Recurring.ContractEnumFromStringOrDefault(contractRawValue)); + break; + case "recurringDetailName": + recurringDetailName = new Option(utf8JsonReader.GetString()); + break; + case "recurringExpiry": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + recurringExpiry = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "recurringFrequency": + recurringFrequency = new Option(utf8JsonReader.GetString()); + break; + case "tokenService": + string tokenServiceRawValue = utf8JsonReader.GetString(); + if (tokenServiceRawValue != null) + tokenService = new Option(Recurring.TokenServiceEnumFromStringOrDefault(tokenServiceRawValue)); + break; + default: + break; + } + } } - return - ( - this.Contract == input.Contract || - this.Contract.Equals(input.Contract) - ) && - ( - this.RecurringDetailName == input.RecurringDetailName || - (this.RecurringDetailName != null && - this.RecurringDetailName.Equals(input.RecurringDetailName)) - ) && - ( - this.RecurringExpiry == input.RecurringExpiry || - (this.RecurringExpiry != null && - this.RecurringExpiry.Equals(input.RecurringExpiry)) - ) && - ( - this.RecurringFrequency == input.RecurringFrequency || - (this.RecurringFrequency != null && - this.RecurringFrequency.Equals(input.RecurringFrequency)) - ) && - ( - this.TokenService == input.TokenService || - this.TokenService.Equals(input.TokenService) - ); + + if (contract.IsSet && contract.Value == null) + throw new ArgumentNullException(nameof(contract), "Property is not nullable for class Recurring."); + + if (recurringDetailName.IsSet && recurringDetailName.Value == null) + throw new ArgumentNullException(nameof(recurringDetailName), "Property is not nullable for class Recurring."); + + if (recurringExpiry.IsSet && recurringExpiry.Value == null) + throw new ArgumentNullException(nameof(recurringExpiry), "Property is not nullable for class Recurring."); + + if (recurringFrequency.IsSet && recurringFrequency.Value == null) + throw new ArgumentNullException(nameof(recurringFrequency), "Property is not nullable for class Recurring."); + + if (tokenService.IsSet && tokenService.Value == null) + throw new ArgumentNullException(nameof(tokenService), "Property is not nullable for class Recurring."); + + return new Recurring(contract, recurringDetailName, recurringExpiry, recurringFrequency, tokenService); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Recurring recurring, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Contract.GetHashCode(); - if (this.RecurringDetailName != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailName.GetHashCode(); - } - if (this.RecurringExpiry != null) - { - hashCode = (hashCode * 59) + this.RecurringExpiry.GetHashCode(); - } - if (this.RecurringFrequency != null) - { - hashCode = (hashCode * 59) + this.RecurringFrequency.GetHashCode(); - } - hashCode = (hashCode * 59) + this.TokenService.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, recurring, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Recurring recurring, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (recurring.RecurringDetailNameOption.IsSet && recurring.RecurringDetailName == null) + throw new ArgumentNullException(nameof(recurring.RecurringDetailName), "Property is required for class Recurring."); + + if (recurring.RecurringFrequencyOption.IsSet && recurring.RecurringFrequency == null) + throw new ArgumentNullException(nameof(recurring.RecurringFrequency), "Property is required for class Recurring."); + + var contractRawValue = Recurring.ContractEnumToJsonValue(recurring.ContractOption.Value.Value); + writer.WriteString("contract", contractRawValue); + if (recurring.RecurringDetailNameOption.IsSet) + writer.WriteString("recurringDetailName", recurring.RecurringDetailName); + + if (recurring.RecurringExpiryOption.IsSet) + writer.WriteString("recurringExpiry", recurring.RecurringExpiryOption.Value.Value.ToString(RecurringExpiryFormat)); + + if (recurring.RecurringFrequencyOption.IsSet) + writer.WriteString("recurringFrequency", recurring.RecurringFrequency); + + var tokenServiceRawValue = Recurring.TokenServiceEnumToJsonValue(recurring.TokenServiceOption.Value.Value); + writer.WriteString("tokenService", tokenServiceRawValue); } } - } diff --git a/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs b/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs index 2daefcefe..50481d749 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,74 +14,110 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalData3DSecure /// - [DataContract(Name = "ResponseAdditionalData3DSecure")] - public partial class ResponseAdditionalData3DSecure : IEquatable, IValidatableObject + public partial class ResponseAdditionalData3DSecure : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. . - /// The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array.. - /// The CAVV algorithm used.. - /// Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** . - /// Indicates whether a card is enrolled for 3D Secure 2.. - public ResponseAdditionalData3DSecure(string cardHolderInfo = default(string), string cavv = default(string), string cavvAlgorithm = default(string), string scaExemptionRequested = default(string), bool? threeds2CardEnrolled = default(bool?)) + /// Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. + /// The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. + /// The CAVV algorithm used. + /// Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** + /// Indicates whether a card is enrolled for 3D Secure 2. + [JsonConstructor] + public ResponseAdditionalData3DSecure(Option cardHolderInfo = default, Option cavv = default, Option cavvAlgorithm = default, Option scaExemptionRequested = default, Option threeds2CardEnrolled = default) { - this.CardHolderInfo = cardHolderInfo; - this.Cavv = cavv; - this.CavvAlgorithm = cavvAlgorithm; - this.ScaExemptionRequested = scaExemptionRequested; - this.Threeds2CardEnrolled = threeds2CardEnrolled; + CardHolderInfoOption = cardHolderInfo; + CavvOption = cavv; + CavvAlgorithmOption = cavvAlgorithm; + ScaExemptionRequestedOption = scaExemptionRequested; + Threeds2CardEnrolledOption = threeds2CardEnrolled; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of CardHolderInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CardHolderInfoOption { get; private set; } + /// /// Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. /// /// Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. - [DataMember(Name = "cardHolderInfo", EmitDefaultValue = false)] - public string CardHolderInfo { get; set; } + [JsonPropertyName("cardHolderInfo")] + public string CardHolderInfo { get { return this.CardHolderInfoOption; } set { this.CardHolderInfoOption = new Option(value); } } + + /// + /// Used to track the state of Cavv + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CavvOption { get; private set; } /// /// The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. /// /// The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. - [DataMember(Name = "cavv", EmitDefaultValue = false)] - public string Cavv { get; set; } + [JsonPropertyName("cavv")] + public string Cavv { get { return this.CavvOption; } set { this.CavvOption = new Option(value); } } + + /// + /// Used to track the state of CavvAlgorithm + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CavvAlgorithmOption { get; private set; } /// /// The CAVV algorithm used. /// /// The CAVV algorithm used. - [DataMember(Name = "cavvAlgorithm", EmitDefaultValue = false)] - public string CavvAlgorithm { get; set; } + [JsonPropertyName("cavvAlgorithm")] + public string CavvAlgorithm { get { return this.CavvAlgorithmOption; } set { this.CavvAlgorithmOption = new Option(value); } } + + /// + /// Used to track the state of ScaExemptionRequested + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ScaExemptionRequestedOption { get; private set; } /// /// Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** /// /// Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** - [DataMember(Name = "scaExemptionRequested", EmitDefaultValue = false)] - public string ScaExemptionRequested { get; set; } + [JsonPropertyName("scaExemptionRequested")] + public string ScaExemptionRequested { get { return this.ScaExemptionRequestedOption; } set { this.ScaExemptionRequestedOption = new Option(value); } } + + /// + /// Used to track the state of Threeds2CardEnrolled + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option Threeds2CardEnrolledOption { get; private set; } /// /// Indicates whether a card is enrolled for 3D Secure 2. /// /// Indicates whether a card is enrolled for 3D Secure 2. - [DataMember(Name = "threeds2.cardEnrolled", EmitDefaultValue = false)] - public bool? Threeds2CardEnrolled { get; set; } + [JsonPropertyName("threeds2.cardEnrolled")] + public bool? Threeds2CardEnrolled { get { return this.Threeds2CardEnrolledOption; } set { this.Threeds2CardEnrolledOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -102,100 +137,149 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ResponseAdditionalData3DSecureJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ResponseAdditionalData3DSecure Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ResponseAdditionalData3DSecure); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ResponseAdditionalData3DSecure instances are equal - /// - /// Instance of ResponseAdditionalData3DSecure to be compared - /// Boolean - public bool Equals(ResponseAdditionalData3DSecure input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option cardHolderInfo = default; + Option cavv = default; + Option cavvAlgorithm = default; + Option scaExemptionRequested = default; + Option threeds2CardEnrolled = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "cardHolderInfo": + cardHolderInfo = new Option(utf8JsonReader.GetString()); + break; + case "cavv": + cavv = new Option(utf8JsonReader.GetString()); + break; + case "cavvAlgorithm": + cavvAlgorithm = new Option(utf8JsonReader.GetString()); + break; + case "scaExemptionRequested": + scaExemptionRequested = new Option(utf8JsonReader.GetString()); + break; + case "threeds2.cardEnrolled": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeds2CardEnrolled = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } } - return - ( - this.CardHolderInfo == input.CardHolderInfo || - (this.CardHolderInfo != null && - this.CardHolderInfo.Equals(input.CardHolderInfo)) - ) && - ( - this.Cavv == input.Cavv || - (this.Cavv != null && - this.Cavv.Equals(input.Cavv)) - ) && - ( - this.CavvAlgorithm == input.CavvAlgorithm || - (this.CavvAlgorithm != null && - this.CavvAlgorithm.Equals(input.CavvAlgorithm)) - ) && - ( - this.ScaExemptionRequested == input.ScaExemptionRequested || - (this.ScaExemptionRequested != null && - this.ScaExemptionRequested.Equals(input.ScaExemptionRequested)) - ) && - ( - this.Threeds2CardEnrolled == input.Threeds2CardEnrolled || - this.Threeds2CardEnrolled.Equals(input.Threeds2CardEnrolled) - ); + + if (cardHolderInfo.IsSet && cardHolderInfo.Value == null) + throw new ArgumentNullException(nameof(cardHolderInfo), "Property is not nullable for class ResponseAdditionalData3DSecure."); + + if (cavv.IsSet && cavv.Value == null) + throw new ArgumentNullException(nameof(cavv), "Property is not nullable for class ResponseAdditionalData3DSecure."); + + if (cavvAlgorithm.IsSet && cavvAlgorithm.Value == null) + throw new ArgumentNullException(nameof(cavvAlgorithm), "Property is not nullable for class ResponseAdditionalData3DSecure."); + + if (scaExemptionRequested.IsSet && scaExemptionRequested.Value == null) + throw new ArgumentNullException(nameof(scaExemptionRequested), "Property is not nullable for class ResponseAdditionalData3DSecure."); + + if (threeds2CardEnrolled.IsSet && threeds2CardEnrolled.Value == null) + throw new ArgumentNullException(nameof(threeds2CardEnrolled), "Property is not nullable for class ResponseAdditionalData3DSecure."); + + return new ResponseAdditionalData3DSecure(cardHolderInfo, cavv, cavvAlgorithm, scaExemptionRequested, threeds2CardEnrolled); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ResponseAdditionalData3DSecure responseAdditionalData3DSecure, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CardHolderInfo != null) - { - hashCode = (hashCode * 59) + this.CardHolderInfo.GetHashCode(); - } - if (this.Cavv != null) - { - hashCode = (hashCode * 59) + this.Cavv.GetHashCode(); - } - if (this.CavvAlgorithm != null) - { - hashCode = (hashCode * 59) + this.CavvAlgorithm.GetHashCode(); - } - if (this.ScaExemptionRequested != null) - { - hashCode = (hashCode * 59) + this.ScaExemptionRequested.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Threeds2CardEnrolled.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, responseAdditionalData3DSecure, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalData3DSecure responseAdditionalData3DSecure, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (responseAdditionalData3DSecure.CardHolderInfoOption.IsSet && responseAdditionalData3DSecure.CardHolderInfo == null) + throw new ArgumentNullException(nameof(responseAdditionalData3DSecure.CardHolderInfo), "Property is required for class ResponseAdditionalData3DSecure."); + + if (responseAdditionalData3DSecure.CavvOption.IsSet && responseAdditionalData3DSecure.Cavv == null) + throw new ArgumentNullException(nameof(responseAdditionalData3DSecure.Cavv), "Property is required for class ResponseAdditionalData3DSecure."); + + if (responseAdditionalData3DSecure.CavvAlgorithmOption.IsSet && responseAdditionalData3DSecure.CavvAlgorithm == null) + throw new ArgumentNullException(nameof(responseAdditionalData3DSecure.CavvAlgorithm), "Property is required for class ResponseAdditionalData3DSecure."); + + if (responseAdditionalData3DSecure.ScaExemptionRequestedOption.IsSet && responseAdditionalData3DSecure.ScaExemptionRequested == null) + throw new ArgumentNullException(nameof(responseAdditionalData3DSecure.ScaExemptionRequested), "Property is required for class ResponseAdditionalData3DSecure."); + + if (responseAdditionalData3DSecure.CardHolderInfoOption.IsSet) + writer.WriteString("cardHolderInfo", responseAdditionalData3DSecure.CardHolderInfo); + + if (responseAdditionalData3DSecure.CavvOption.IsSet) + writer.WriteString("cavv", responseAdditionalData3DSecure.Cavv); + + if (responseAdditionalData3DSecure.CavvAlgorithmOption.IsSet) + writer.WriteString("cavvAlgorithm", responseAdditionalData3DSecure.CavvAlgorithm); + + if (responseAdditionalData3DSecure.ScaExemptionRequestedOption.IsSet) + writer.WriteString("scaExemptionRequested", responseAdditionalData3DSecure.ScaExemptionRequested); + + if (responseAdditionalData3DSecure.Threeds2CardEnrolledOption.IsSet) + writer.WriteBoolean("threeds2.cardEnrolled", responseAdditionalData3DSecure.Threeds2CardEnrolledOption.Value.Value); } } - } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs b/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs index 360cc1be5..e9b1843e4 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,83 +14,126 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataBillingAddress /// - [DataContract(Name = "ResponseAdditionalDataBillingAddress")] - public partial class ResponseAdditionalDataBillingAddress : IEquatable, IValidatableObject + public partial class ResponseAdditionalDataBillingAddress : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The billing address city passed in the payment request.. - /// The billing address country passed in the payment request. Example: NL. - /// The billing address house number or name passed in the payment request.. - /// The billing address postal code passed in the payment request. Example: 1011 DJ. - /// The billing address state or province passed in the payment request. Example: NH. - /// The billing address street passed in the payment request.. - public ResponseAdditionalDataBillingAddress(string billingAddressCity = default(string), string billingAddressCountry = default(string), string billingAddressHouseNumberOrName = default(string), string billingAddressPostalCode = default(string), string billingAddressStateOrProvince = default(string), string billingAddressStreet = default(string)) + /// The billing address city passed in the payment request. + /// The billing address country passed in the payment request. Example: NL + /// The billing address house number or name passed in the payment request. + /// The billing address postal code passed in the payment request. Example: 1011 DJ + /// The billing address state or province passed in the payment request. Example: NH + /// The billing address street passed in the payment request. + [JsonConstructor] + public ResponseAdditionalDataBillingAddress(Option billingAddressCity = default, Option billingAddressCountry = default, Option billingAddressHouseNumberOrName = default, Option billingAddressPostalCode = default, Option billingAddressStateOrProvince = default, Option billingAddressStreet = default) { - this.BillingAddressCity = billingAddressCity; - this.BillingAddressCountry = billingAddressCountry; - this.BillingAddressHouseNumberOrName = billingAddressHouseNumberOrName; - this.BillingAddressPostalCode = billingAddressPostalCode; - this.BillingAddressStateOrProvince = billingAddressStateOrProvince; - this.BillingAddressStreet = billingAddressStreet; + BillingAddressCityOption = billingAddressCity; + BillingAddressCountryOption = billingAddressCountry; + BillingAddressHouseNumberOrNameOption = billingAddressHouseNumberOrName; + BillingAddressPostalCodeOption = billingAddressPostalCode; + BillingAddressStateOrProvinceOption = billingAddressStateOrProvince; + BillingAddressStreetOption = billingAddressStreet; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of BillingAddressCity + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressCityOption { get; private set; } + /// /// The billing address city passed in the payment request. /// /// The billing address city passed in the payment request. - [DataMember(Name = "billingAddress.city", EmitDefaultValue = false)] - public string BillingAddressCity { get; set; } + [JsonPropertyName("billingAddress.city")] + public string BillingAddressCity { get { return this.BillingAddressCityOption; } set { this.BillingAddressCityOption = new Option(value); } } + + /// + /// Used to track the state of BillingAddressCountry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressCountryOption { get; private set; } /// /// The billing address country passed in the payment request. Example: NL /// /// The billing address country passed in the payment request. Example: NL - [DataMember(Name = "billingAddress.country", EmitDefaultValue = false)] - public string BillingAddressCountry { get; set; } + [JsonPropertyName("billingAddress.country")] + public string BillingAddressCountry { get { return this.BillingAddressCountryOption; } set { this.BillingAddressCountryOption = new Option(value); } } + + /// + /// Used to track the state of BillingAddressHouseNumberOrName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressHouseNumberOrNameOption { get; private set; } /// /// The billing address house number or name passed in the payment request. /// /// The billing address house number or name passed in the payment request. - [DataMember(Name = "billingAddress.houseNumberOrName", EmitDefaultValue = false)] - public string BillingAddressHouseNumberOrName { get; set; } + [JsonPropertyName("billingAddress.houseNumberOrName")] + public string BillingAddressHouseNumberOrName { get { return this.BillingAddressHouseNumberOrNameOption; } set { this.BillingAddressHouseNumberOrNameOption = new Option(value); } } + + /// + /// Used to track the state of BillingAddressPostalCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressPostalCodeOption { get; private set; } /// /// The billing address postal code passed in the payment request. Example: 1011 DJ /// /// The billing address postal code passed in the payment request. Example: 1011 DJ - [DataMember(Name = "billingAddress.postalCode", EmitDefaultValue = false)] - public string BillingAddressPostalCode { get; set; } + [JsonPropertyName("billingAddress.postalCode")] + public string BillingAddressPostalCode { get { return this.BillingAddressPostalCodeOption; } set { this.BillingAddressPostalCodeOption = new Option(value); } } + + /// + /// Used to track the state of BillingAddressStateOrProvince + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressStateOrProvinceOption { get; private set; } /// /// The billing address state or province passed in the payment request. Example: NH /// /// The billing address state or province passed in the payment request. Example: NH - [DataMember(Name = "billingAddress.stateOrProvince", EmitDefaultValue = false)] - public string BillingAddressStateOrProvince { get; set; } + [JsonPropertyName("billingAddress.stateOrProvince")] + public string BillingAddressStateOrProvince { get { return this.BillingAddressStateOrProvinceOption; } set { this.BillingAddressStateOrProvinceOption = new Option(value); } } + + /// + /// Used to track the state of BillingAddressStreet + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressStreetOption { get; private set; } /// /// The billing address street passed in the payment request. /// /// The billing address street passed in the payment request. - [DataMember(Name = "billingAddress.street", EmitDefaultValue = false)] - public string BillingAddressStreet { get; set; } + [JsonPropertyName("billingAddress.street")] + public string BillingAddressStreet { get { return this.BillingAddressStreetOption; } set { this.BillingAddressStreetOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -112,113 +154,164 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ResponseAdditionalDataBillingAddressJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ResponseAdditionalDataBillingAddress Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ResponseAdditionalDataBillingAddress); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ResponseAdditionalDataBillingAddress instances are equal - /// - /// Instance of ResponseAdditionalDataBillingAddress to be compared - /// Boolean - public bool Equals(ResponseAdditionalDataBillingAddress input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option billingAddressCity = default; + Option billingAddressCountry = default; + Option billingAddressHouseNumberOrName = default; + Option billingAddressPostalCode = default; + Option billingAddressStateOrProvince = default; + Option billingAddressStreet = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "billingAddress.city": + billingAddressCity = new Option(utf8JsonReader.GetString()); + break; + case "billingAddress.country": + billingAddressCountry = new Option(utf8JsonReader.GetString()); + break; + case "billingAddress.houseNumberOrName": + billingAddressHouseNumberOrName = new Option(utf8JsonReader.GetString()); + break; + case "billingAddress.postalCode": + billingAddressPostalCode = new Option(utf8JsonReader.GetString()); + break; + case "billingAddress.stateOrProvince": + billingAddressStateOrProvince = new Option(utf8JsonReader.GetString()); + break; + case "billingAddress.street": + billingAddressStreet = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.BillingAddressCity == input.BillingAddressCity || - (this.BillingAddressCity != null && - this.BillingAddressCity.Equals(input.BillingAddressCity)) - ) && - ( - this.BillingAddressCountry == input.BillingAddressCountry || - (this.BillingAddressCountry != null && - this.BillingAddressCountry.Equals(input.BillingAddressCountry)) - ) && - ( - this.BillingAddressHouseNumberOrName == input.BillingAddressHouseNumberOrName || - (this.BillingAddressHouseNumberOrName != null && - this.BillingAddressHouseNumberOrName.Equals(input.BillingAddressHouseNumberOrName)) - ) && - ( - this.BillingAddressPostalCode == input.BillingAddressPostalCode || - (this.BillingAddressPostalCode != null && - this.BillingAddressPostalCode.Equals(input.BillingAddressPostalCode)) - ) && - ( - this.BillingAddressStateOrProvince == input.BillingAddressStateOrProvince || - (this.BillingAddressStateOrProvince != null && - this.BillingAddressStateOrProvince.Equals(input.BillingAddressStateOrProvince)) - ) && - ( - this.BillingAddressStreet == input.BillingAddressStreet || - (this.BillingAddressStreet != null && - this.BillingAddressStreet.Equals(input.BillingAddressStreet)) - ); + + if (billingAddressCity.IsSet && billingAddressCity.Value == null) + throw new ArgumentNullException(nameof(billingAddressCity), "Property is not nullable for class ResponseAdditionalDataBillingAddress."); + + if (billingAddressCountry.IsSet && billingAddressCountry.Value == null) + throw new ArgumentNullException(nameof(billingAddressCountry), "Property is not nullable for class ResponseAdditionalDataBillingAddress."); + + if (billingAddressHouseNumberOrName.IsSet && billingAddressHouseNumberOrName.Value == null) + throw new ArgumentNullException(nameof(billingAddressHouseNumberOrName), "Property is not nullable for class ResponseAdditionalDataBillingAddress."); + + if (billingAddressPostalCode.IsSet && billingAddressPostalCode.Value == null) + throw new ArgumentNullException(nameof(billingAddressPostalCode), "Property is not nullable for class ResponseAdditionalDataBillingAddress."); + + if (billingAddressStateOrProvince.IsSet && billingAddressStateOrProvince.Value == null) + throw new ArgumentNullException(nameof(billingAddressStateOrProvince), "Property is not nullable for class ResponseAdditionalDataBillingAddress."); + + if (billingAddressStreet.IsSet && billingAddressStreet.Value == null) + throw new ArgumentNullException(nameof(billingAddressStreet), "Property is not nullable for class ResponseAdditionalDataBillingAddress."); + + return new ResponseAdditionalDataBillingAddress(billingAddressCity, billingAddressCountry, billingAddressHouseNumberOrName, billingAddressPostalCode, billingAddressStateOrProvince, billingAddressStreet); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataBillingAddress responseAdditionalDataBillingAddress, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BillingAddressCity != null) - { - hashCode = (hashCode * 59) + this.BillingAddressCity.GetHashCode(); - } - if (this.BillingAddressCountry != null) - { - hashCode = (hashCode * 59) + this.BillingAddressCountry.GetHashCode(); - } - if (this.BillingAddressHouseNumberOrName != null) - { - hashCode = (hashCode * 59) + this.BillingAddressHouseNumberOrName.GetHashCode(); - } - if (this.BillingAddressPostalCode != null) - { - hashCode = (hashCode * 59) + this.BillingAddressPostalCode.GetHashCode(); - } - if (this.BillingAddressStateOrProvince != null) - { - hashCode = (hashCode * 59) + this.BillingAddressStateOrProvince.GetHashCode(); - } - if (this.BillingAddressStreet != null) - { - hashCode = (hashCode * 59) + this.BillingAddressStreet.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, responseAdditionalDataBillingAddress, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataBillingAddress responseAdditionalDataBillingAddress, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (responseAdditionalDataBillingAddress.BillingAddressCityOption.IsSet && responseAdditionalDataBillingAddress.BillingAddressCity == null) + throw new ArgumentNullException(nameof(responseAdditionalDataBillingAddress.BillingAddressCity), "Property is required for class ResponseAdditionalDataBillingAddress."); + + if (responseAdditionalDataBillingAddress.BillingAddressCountryOption.IsSet && responseAdditionalDataBillingAddress.BillingAddressCountry == null) + throw new ArgumentNullException(nameof(responseAdditionalDataBillingAddress.BillingAddressCountry), "Property is required for class ResponseAdditionalDataBillingAddress."); + + if (responseAdditionalDataBillingAddress.BillingAddressHouseNumberOrNameOption.IsSet && responseAdditionalDataBillingAddress.BillingAddressHouseNumberOrName == null) + throw new ArgumentNullException(nameof(responseAdditionalDataBillingAddress.BillingAddressHouseNumberOrName), "Property is required for class ResponseAdditionalDataBillingAddress."); + + if (responseAdditionalDataBillingAddress.BillingAddressPostalCodeOption.IsSet && responseAdditionalDataBillingAddress.BillingAddressPostalCode == null) + throw new ArgumentNullException(nameof(responseAdditionalDataBillingAddress.BillingAddressPostalCode), "Property is required for class ResponseAdditionalDataBillingAddress."); + + if (responseAdditionalDataBillingAddress.BillingAddressStateOrProvinceOption.IsSet && responseAdditionalDataBillingAddress.BillingAddressStateOrProvince == null) + throw new ArgumentNullException(nameof(responseAdditionalDataBillingAddress.BillingAddressStateOrProvince), "Property is required for class ResponseAdditionalDataBillingAddress."); + + if (responseAdditionalDataBillingAddress.BillingAddressStreetOption.IsSet && responseAdditionalDataBillingAddress.BillingAddressStreet == null) + throw new ArgumentNullException(nameof(responseAdditionalDataBillingAddress.BillingAddressStreet), "Property is required for class ResponseAdditionalDataBillingAddress."); + + if (responseAdditionalDataBillingAddress.BillingAddressCityOption.IsSet) + writer.WriteString("billingAddress.city", responseAdditionalDataBillingAddress.BillingAddressCity); + + if (responseAdditionalDataBillingAddress.BillingAddressCountryOption.IsSet) + writer.WriteString("billingAddress.country", responseAdditionalDataBillingAddress.BillingAddressCountry); + + if (responseAdditionalDataBillingAddress.BillingAddressHouseNumberOrNameOption.IsSet) + writer.WriteString("billingAddress.houseNumberOrName", responseAdditionalDataBillingAddress.BillingAddressHouseNumberOrName); + + if (responseAdditionalDataBillingAddress.BillingAddressPostalCodeOption.IsSet) + writer.WriteString("billingAddress.postalCode", responseAdditionalDataBillingAddress.BillingAddressPostalCode); + + if (responseAdditionalDataBillingAddress.BillingAddressStateOrProvinceOption.IsSet) + writer.WriteString("billingAddress.stateOrProvince", responseAdditionalDataBillingAddress.BillingAddressStateOrProvince); + + if (responseAdditionalDataBillingAddress.BillingAddressStreetOption.IsSet) + writer.WriteString("billingAddress.street", responseAdditionalDataBillingAddress.BillingAddressStreet); } } - } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataCard.cs b/Adyen/Model/Checkout/ResponseAdditionalDataCard.cs index 98107c5d3..c90424d89 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataCard.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataCard.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,185 +14,367 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataCard /// - [DataContract(Name = "ResponseAdditionalDataCard")] - public partial class ResponseAdditionalDataCard : IEquatable, IValidatableObject + public partial class ResponseAdditionalDataCard : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The first six digits of the card number. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with a six-digit BIN. Example: 521234 + /// The cardholder name passed in the payment request. + /// The bank or the financial institution granting lines of credit through card association branded payment cards. This information can be included when available. + /// The country where the card was issued. Example: US + /// The currency in which the card is issued, if this information is available. Provided as the currency code or currency number from the ISO-4217 standard. Example: USD + /// The card payment method used for the transaction. Example: amex + /// The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit + /// The last four digits of a card number. > Returned only in case of a card payment. + /// The first eight digits of the card number. Only returned if the card number is 16 digits or more. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with an eight-digit BIN. Example: 52123423 + [JsonConstructor] + public ResponseAdditionalDataCard(Option cardBin = default, Option cardHolderName = default, Option cardIssuingBank = default, Option cardIssuingCountry = default, Option cardIssuingCurrency = default, Option cardPaymentMethod = default, Option cardProductId = default, Option cardSummary = default, Option issuerBin = default) + { + CardBinOption = cardBin; + CardHolderNameOption = cardHolderName; + CardIssuingBankOption = cardIssuingBank; + CardIssuingCountryOption = cardIssuingCountry; + CardIssuingCurrencyOption = cardIssuingCurrency; + CardPaymentMethodOption = cardPaymentMethod; + CardProductIdOption = cardProductId; + CardSummaryOption = cardSummary; + IssuerBinOption = issuerBin; + OnCreated(); + } + + partial void OnCreated(); + /// /// The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit /// /// The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit - [JsonConverter(typeof(StringEnumConverter))] public enum CardProductIdEnum { /// /// Enum A for value: A /// - [EnumMember(Value = "A")] A = 1, /// /// Enum B for value: B /// - [EnumMember(Value = "B")] B = 2, /// /// Enum C for value: C /// - [EnumMember(Value = "C")] C = 3, /// /// Enum D for value: D /// - [EnumMember(Value = "D")] D = 4, /// /// Enum F for value: F /// - [EnumMember(Value = "F")] F = 5, /// /// Enum MCC for value: MCC /// - [EnumMember(Value = "MCC")] MCC = 6, /// /// Enum MCE for value: MCE /// - [EnumMember(Value = "MCE")] MCE = 7, /// /// Enum MCF for value: MCF /// - [EnumMember(Value = "MCF")] MCF = 8, /// /// Enum MCG for value: MCG /// - [EnumMember(Value = "MCG")] MCG = 9, /// /// Enum MCH for value: MCH /// - [EnumMember(Value = "MCH")] MCH = 10, /// /// Enum MCI for value: MCI /// - [EnumMember(Value = "MCI")] MCI = 11 + } + + /// + /// Returns a + /// + /// + /// + /// + public static CardProductIdEnum CardProductIdEnumFromString(string value) + { + if (value.Equals("A")) + return CardProductIdEnum.A; + + if (value.Equals("B")) + return CardProductIdEnum.B; + + if (value.Equals("C")) + return CardProductIdEnum.C; + + if (value.Equals("D")) + return CardProductIdEnum.D; + + if (value.Equals("F")) + return CardProductIdEnum.F; + + if (value.Equals("MCC")) + return CardProductIdEnum.MCC; + + if (value.Equals("MCE")) + return CardProductIdEnum.MCE; + + if (value.Equals("MCF")) + return CardProductIdEnum.MCF; + + if (value.Equals("MCG")) + return CardProductIdEnum.MCG; + + if (value.Equals("MCH")) + return CardProductIdEnum.MCH; + + if (value.Equals("MCI")) + return CardProductIdEnum.MCI; + + throw new NotImplementedException($"Could not convert value to type CardProductIdEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static CardProductIdEnum? CardProductIdEnumFromStringOrDefault(string value) + { + if (value.Equals("A")) + return CardProductIdEnum.A; + + if (value.Equals("B")) + return CardProductIdEnum.B; + + if (value.Equals("C")) + return CardProductIdEnum.C; + + if (value.Equals("D")) + return CardProductIdEnum.D; + + if (value.Equals("F")) + return CardProductIdEnum.F; + + if (value.Equals("MCC")) + return CardProductIdEnum.MCC; + + if (value.Equals("MCE")) + return CardProductIdEnum.MCE; + + if (value.Equals("MCF")) + return CardProductIdEnum.MCF; + + if (value.Equals("MCG")) + return CardProductIdEnum.MCG; + + if (value.Equals("MCH")) + return CardProductIdEnum.MCH; + + if (value.Equals("MCI")) + return CardProductIdEnum.MCI; + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string CardProductIdEnumToJsonValue(CardProductIdEnum? value) + { + if (value == CardProductIdEnum.A) + return "A"; + + if (value == CardProductIdEnum.B) + return "B"; + + if (value == CardProductIdEnum.C) + return "C"; + + if (value == CardProductIdEnum.D) + return "D"; + + if (value == CardProductIdEnum.F) + return "F"; + + if (value == CardProductIdEnum.MCC) + return "MCC"; + + if (value == CardProductIdEnum.MCE) + return "MCE"; + + if (value == CardProductIdEnum.MCF) + return "MCF"; + + if (value == CardProductIdEnum.MCG) + return "MCG"; + + if (value == CardProductIdEnum.MCH) + return "MCH"; + + if (value == CardProductIdEnum.MCI) + return "MCI"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of CardProductId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CardProductIdOption { get; private set; } /// /// The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit /// /// The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit - [DataMember(Name = "cardProductId", EmitDefaultValue = false)] - public CardProductIdEnum? CardProductId { get; set; } + [JsonPropertyName("cardProductId")] + public CardProductIdEnum? CardProductId { get { return this.CardProductIdOption; } set { this.CardProductIdOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CardBin /// - /// The first six digits of the card number. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with a six-digit BIN. Example: 521234. - /// The cardholder name passed in the payment request.. - /// The bank or the financial institution granting lines of credit through card association branded payment cards. This information can be included when available.. - /// The country where the card was issued. Example: US. - /// The currency in which the card is issued, if this information is available. Provided as the currency code or currency number from the ISO-4217 standard. Example: USD. - /// The card payment method used for the transaction. Example: amex. - /// The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit . - /// The last four digits of a card number. > Returned only in case of a card payment.. - /// The first eight digits of the card number. Only returned if the card number is 16 digits or more. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with an eight-digit BIN. Example: 52123423. - public ResponseAdditionalDataCard(string cardBin = default(string), string cardHolderName = default(string), string cardIssuingBank = default(string), string cardIssuingCountry = default(string), string cardIssuingCurrency = default(string), string cardPaymentMethod = default(string), CardProductIdEnum? cardProductId = default(CardProductIdEnum?), string cardSummary = default(string), string issuerBin = default(string)) - { - this.CardBin = cardBin; - this.CardHolderName = cardHolderName; - this.CardIssuingBank = cardIssuingBank; - this.CardIssuingCountry = cardIssuingCountry; - this.CardIssuingCurrency = cardIssuingCurrency; - this.CardPaymentMethod = cardPaymentMethod; - this.CardProductId = cardProductId; - this.CardSummary = cardSummary; - this.IssuerBin = issuerBin; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CardBinOption { get; private set; } /// /// The first six digits of the card number. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with a six-digit BIN. Example: 521234 /// /// The first six digits of the card number. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with a six-digit BIN. Example: 521234 - [DataMember(Name = "cardBin", EmitDefaultValue = false)] - public string CardBin { get; set; } + [JsonPropertyName("cardBin")] + public string CardBin { get { return this.CardBinOption; } set { this.CardBinOption = new Option(value); } } + + /// + /// Used to track the state of CardHolderName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CardHolderNameOption { get; private set; } /// /// The cardholder name passed in the payment request. /// /// The cardholder name passed in the payment request. - [DataMember(Name = "cardHolderName", EmitDefaultValue = false)] - public string CardHolderName { get; set; } + [JsonPropertyName("cardHolderName")] + public string CardHolderName { get { return this.CardHolderNameOption; } set { this.CardHolderNameOption = new Option(value); } } + + /// + /// Used to track the state of CardIssuingBank + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CardIssuingBankOption { get; private set; } /// /// The bank or the financial institution granting lines of credit through card association branded payment cards. This information can be included when available. /// /// The bank or the financial institution granting lines of credit through card association branded payment cards. This information can be included when available. - [DataMember(Name = "cardIssuingBank", EmitDefaultValue = false)] - public string CardIssuingBank { get; set; } + [JsonPropertyName("cardIssuingBank")] + public string CardIssuingBank { get { return this.CardIssuingBankOption; } set { this.CardIssuingBankOption = new Option(value); } } + + /// + /// Used to track the state of CardIssuingCountry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CardIssuingCountryOption { get; private set; } /// /// The country where the card was issued. Example: US /// /// The country where the card was issued. Example: US - [DataMember(Name = "cardIssuingCountry", EmitDefaultValue = false)] - public string CardIssuingCountry { get; set; } + [JsonPropertyName("cardIssuingCountry")] + public string CardIssuingCountry { get { return this.CardIssuingCountryOption; } set { this.CardIssuingCountryOption = new Option(value); } } + + /// + /// Used to track the state of CardIssuingCurrency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CardIssuingCurrencyOption { get; private set; } /// /// The currency in which the card is issued, if this information is available. Provided as the currency code or currency number from the ISO-4217 standard. Example: USD /// /// The currency in which the card is issued, if this information is available. Provided as the currency code or currency number from the ISO-4217 standard. Example: USD - [DataMember(Name = "cardIssuingCurrency", EmitDefaultValue = false)] - public string CardIssuingCurrency { get; set; } + [JsonPropertyName("cardIssuingCurrency")] + public string CardIssuingCurrency { get { return this.CardIssuingCurrencyOption; } set { this.CardIssuingCurrencyOption = new Option(value); } } + + /// + /// Used to track the state of CardPaymentMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CardPaymentMethodOption { get; private set; } /// /// The card payment method used for the transaction. Example: amex /// /// The card payment method used for the transaction. Example: amex - [DataMember(Name = "cardPaymentMethod", EmitDefaultValue = false)] - public string CardPaymentMethod { get; set; } + [JsonPropertyName("cardPaymentMethod")] + public string CardPaymentMethod { get { return this.CardPaymentMethodOption; } set { this.CardPaymentMethodOption = new Option(value); } } + + /// + /// Used to track the state of CardSummary + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CardSummaryOption { get; private set; } /// /// The last four digits of a card number. > Returned only in case of a card payment. /// /// The last four digits of a card number. > Returned only in case of a card payment. - [DataMember(Name = "cardSummary", EmitDefaultValue = false)] - public string CardSummary { get; set; } + [JsonPropertyName("cardSummary")] + public string CardSummary { get { return this.CardSummaryOption; } set { this.CardSummaryOption = new Option(value); } } + + /// + /// Used to track the state of IssuerBin + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IssuerBinOption { get; private set; } /// /// The first eight digits of the card number. Only returned if the card number is 16 digits or more. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with an eight-digit BIN. Example: 52123423 /// /// The first eight digits of the card number. Only returned if the card number is 16 digits or more. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with an eight-digit BIN. Example: 52123423 - [DataMember(Name = "issuerBin", EmitDefaultValue = false)] - public string IssuerBin { get; set; } + [JsonPropertyName("issuerBin")] + public string IssuerBin { get { return this.IssuerBinOption; } set { this.IssuerBinOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -217,136 +398,201 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ResponseAdditionalDataCardJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ResponseAdditionalDataCard Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ResponseAdditionalDataCard); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ResponseAdditionalDataCard instances are equal - /// - /// Instance of ResponseAdditionalDataCard to be compared - /// Boolean - public bool Equals(ResponseAdditionalDataCard input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option cardBin = default; + Option cardHolderName = default; + Option cardIssuingBank = default; + Option cardIssuingCountry = default; + Option cardIssuingCurrency = default; + Option cardPaymentMethod = default; + Option cardProductId = default; + Option cardSummary = default; + Option issuerBin = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "cardBin": + cardBin = new Option(utf8JsonReader.GetString()); + break; + case "cardHolderName": + cardHolderName = new Option(utf8JsonReader.GetString()); + break; + case "cardIssuingBank": + cardIssuingBank = new Option(utf8JsonReader.GetString()); + break; + case "cardIssuingCountry": + cardIssuingCountry = new Option(utf8JsonReader.GetString()); + break; + case "cardIssuingCurrency": + cardIssuingCurrency = new Option(utf8JsonReader.GetString()); + break; + case "cardPaymentMethod": + cardPaymentMethod = new Option(utf8JsonReader.GetString()); + break; + case "cardProductId": + string cardProductIdRawValue = utf8JsonReader.GetString(); + if (cardProductIdRawValue != null) + cardProductId = new Option(ResponseAdditionalDataCard.CardProductIdEnumFromStringOrDefault(cardProductIdRawValue)); + break; + case "cardSummary": + cardSummary = new Option(utf8JsonReader.GetString()); + break; + case "issuerBin": + issuerBin = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.CardBin == input.CardBin || - (this.CardBin != null && - this.CardBin.Equals(input.CardBin)) - ) && - ( - this.CardHolderName == input.CardHolderName || - (this.CardHolderName != null && - this.CardHolderName.Equals(input.CardHolderName)) - ) && - ( - this.CardIssuingBank == input.CardIssuingBank || - (this.CardIssuingBank != null && - this.CardIssuingBank.Equals(input.CardIssuingBank)) - ) && - ( - this.CardIssuingCountry == input.CardIssuingCountry || - (this.CardIssuingCountry != null && - this.CardIssuingCountry.Equals(input.CardIssuingCountry)) - ) && - ( - this.CardIssuingCurrency == input.CardIssuingCurrency || - (this.CardIssuingCurrency != null && - this.CardIssuingCurrency.Equals(input.CardIssuingCurrency)) - ) && - ( - this.CardPaymentMethod == input.CardPaymentMethod || - (this.CardPaymentMethod != null && - this.CardPaymentMethod.Equals(input.CardPaymentMethod)) - ) && - ( - this.CardProductId == input.CardProductId || - this.CardProductId.Equals(input.CardProductId) - ) && - ( - this.CardSummary == input.CardSummary || - (this.CardSummary != null && - this.CardSummary.Equals(input.CardSummary)) - ) && - ( - this.IssuerBin == input.IssuerBin || - (this.IssuerBin != null && - this.IssuerBin.Equals(input.IssuerBin)) - ); + + if (cardBin.IsSet && cardBin.Value == null) + throw new ArgumentNullException(nameof(cardBin), "Property is not nullable for class ResponseAdditionalDataCard."); + + if (cardHolderName.IsSet && cardHolderName.Value == null) + throw new ArgumentNullException(nameof(cardHolderName), "Property is not nullable for class ResponseAdditionalDataCard."); + + if (cardIssuingBank.IsSet && cardIssuingBank.Value == null) + throw new ArgumentNullException(nameof(cardIssuingBank), "Property is not nullable for class ResponseAdditionalDataCard."); + + if (cardIssuingCountry.IsSet && cardIssuingCountry.Value == null) + throw new ArgumentNullException(nameof(cardIssuingCountry), "Property is not nullable for class ResponseAdditionalDataCard."); + + if (cardIssuingCurrency.IsSet && cardIssuingCurrency.Value == null) + throw new ArgumentNullException(nameof(cardIssuingCurrency), "Property is not nullable for class ResponseAdditionalDataCard."); + + if (cardPaymentMethod.IsSet && cardPaymentMethod.Value == null) + throw new ArgumentNullException(nameof(cardPaymentMethod), "Property is not nullable for class ResponseAdditionalDataCard."); + + if (cardProductId.IsSet && cardProductId.Value == null) + throw new ArgumentNullException(nameof(cardProductId), "Property is not nullable for class ResponseAdditionalDataCard."); + + if (cardSummary.IsSet && cardSummary.Value == null) + throw new ArgumentNullException(nameof(cardSummary), "Property is not nullable for class ResponseAdditionalDataCard."); + + if (issuerBin.IsSet && issuerBin.Value == null) + throw new ArgumentNullException(nameof(issuerBin), "Property is not nullable for class ResponseAdditionalDataCard."); + + return new ResponseAdditionalDataCard(cardBin, cardHolderName, cardIssuingBank, cardIssuingCountry, cardIssuingCurrency, cardPaymentMethod, cardProductId, cardSummary, issuerBin); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataCard responseAdditionalDataCard, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CardBin != null) - { - hashCode = (hashCode * 59) + this.CardBin.GetHashCode(); - } - if (this.CardHolderName != null) - { - hashCode = (hashCode * 59) + this.CardHolderName.GetHashCode(); - } - if (this.CardIssuingBank != null) - { - hashCode = (hashCode * 59) + this.CardIssuingBank.GetHashCode(); - } - if (this.CardIssuingCountry != null) - { - hashCode = (hashCode * 59) + this.CardIssuingCountry.GetHashCode(); - } - if (this.CardIssuingCurrency != null) - { - hashCode = (hashCode * 59) + this.CardIssuingCurrency.GetHashCode(); - } - if (this.CardPaymentMethod != null) - { - hashCode = (hashCode * 59) + this.CardPaymentMethod.GetHashCode(); - } - hashCode = (hashCode * 59) + this.CardProductId.GetHashCode(); - if (this.CardSummary != null) - { - hashCode = (hashCode * 59) + this.CardSummary.GetHashCode(); - } - if (this.IssuerBin != null) - { - hashCode = (hashCode * 59) + this.IssuerBin.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, responseAdditionalDataCard, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataCard responseAdditionalDataCard, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (responseAdditionalDataCard.CardBinOption.IsSet && responseAdditionalDataCard.CardBin == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardBin), "Property is required for class ResponseAdditionalDataCard."); + + if (responseAdditionalDataCard.CardHolderNameOption.IsSet && responseAdditionalDataCard.CardHolderName == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardHolderName), "Property is required for class ResponseAdditionalDataCard."); + + if (responseAdditionalDataCard.CardIssuingBankOption.IsSet && responseAdditionalDataCard.CardIssuingBank == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardIssuingBank), "Property is required for class ResponseAdditionalDataCard."); + + if (responseAdditionalDataCard.CardIssuingCountryOption.IsSet && responseAdditionalDataCard.CardIssuingCountry == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardIssuingCountry), "Property is required for class ResponseAdditionalDataCard."); + + if (responseAdditionalDataCard.CardIssuingCurrencyOption.IsSet && responseAdditionalDataCard.CardIssuingCurrency == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardIssuingCurrency), "Property is required for class ResponseAdditionalDataCard."); + + if (responseAdditionalDataCard.CardPaymentMethodOption.IsSet && responseAdditionalDataCard.CardPaymentMethod == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardPaymentMethod), "Property is required for class ResponseAdditionalDataCard."); + + if (responseAdditionalDataCard.CardSummaryOption.IsSet && responseAdditionalDataCard.CardSummary == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardSummary), "Property is required for class ResponseAdditionalDataCard."); + + if (responseAdditionalDataCard.IssuerBinOption.IsSet && responseAdditionalDataCard.IssuerBin == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCard.IssuerBin), "Property is required for class ResponseAdditionalDataCard."); + + if (responseAdditionalDataCard.CardBinOption.IsSet) + writer.WriteString("cardBin", responseAdditionalDataCard.CardBin); + + if (responseAdditionalDataCard.CardHolderNameOption.IsSet) + writer.WriteString("cardHolderName", responseAdditionalDataCard.CardHolderName); + + if (responseAdditionalDataCard.CardIssuingBankOption.IsSet) + writer.WriteString("cardIssuingBank", responseAdditionalDataCard.CardIssuingBank); + + if (responseAdditionalDataCard.CardIssuingCountryOption.IsSet) + writer.WriteString("cardIssuingCountry", responseAdditionalDataCard.CardIssuingCountry); + + if (responseAdditionalDataCard.CardIssuingCurrencyOption.IsSet) + writer.WriteString("cardIssuingCurrency", responseAdditionalDataCard.CardIssuingCurrency); + + if (responseAdditionalDataCard.CardPaymentMethodOption.IsSet) + writer.WriteString("cardPaymentMethod", responseAdditionalDataCard.CardPaymentMethod); + + var cardProductIdRawValue = ResponseAdditionalDataCard.CardProductIdEnumToJsonValue(responseAdditionalDataCard.CardProductIdOption.Value.Value); + writer.WriteString("cardProductId", cardProductIdRawValue); + if (responseAdditionalDataCard.CardSummaryOption.IsSet) + writer.WriteString("cardSummary", responseAdditionalDataCard.CardSummary); + + if (responseAdditionalDataCard.IssuerBinOption.IsSet) + writer.WriteString("issuerBin", responseAdditionalDataCard.IssuerBin); } } - } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs b/Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs index 952bfb504..737f24698 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,712 +14,1380 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataCommon /// - [DataContract(Name = "ResponseAdditionalDataCommon")] - public partial class ResponseAdditionalDataCommon : IEquatable, IValidatableObject + public partial class ResponseAdditionalDataCommon : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The name of the Adyen acquirer account. Example: PayPalSandbox_TestAcquirer > Only relevant for PayPal transactions. + /// The name of the acquirer processing the payment request. Example: TestPmmAcquirer + /// The reference number that can be used for reconciliation in case a non-Adyen acquirer is used for settlement. Example: 7C9N3FNBKT9 + /// The Adyen alias of the card. Example: H167852639363479 + /// The type of the card alias. Example: Default + /// Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. Example: 58747 + /// Merchant ID known by the acquirer. + /// The currency of the authorised amount, as a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + /// Value of the amount authorised. This amount is represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). + /// The AVS result code of the payment, which provides information about the outcome of the AVS check. For possible values, see [AVS](https://docs.adyen.com/risk-management/configure-standard-risk-rules/consistency-rules#billing-address-does-not-match-cardholder-address-avs). + /// Raw AVS result received from the acquirer, where available. Example: D + /// BIC of a bank account. Example: TESTNL01 > Only relevant for SEPA Direct Debit transactions. + /// Includes the co-branded card information. + /// The result of CVC verification. + /// The raw result of CVC verification. + /// Supported for 3D Secure 2. The unique transaction identifier assigned by the DS to identify a single transaction. + /// The Electronic Commerce Indicator returned from the schemes for the 3DS payment session. Example: 02 + /// The expiry date on the card. Example: 6/2016 > Returned only in case of a card payment. + /// The currency of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. Example: EUR + /// The value of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. The amount is in minor units. + /// The fraud score due to a particular fraud check. The fraud check name is found in the key of the key-value pair. + /// Indicates if the payment is sent to manual review. + /// The fraud result properties of the payment. + /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh > + /// Information regarding the funding type of the card. The possible return values are: * CHARGE * CREDIT * DEBIT * PREPAID * PREPAID_RELOADABLE * PREPAID_NONRELOADABLE * DEFFERED_DEBIT > This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. For receiving this field in the notification, enable **Include Funding Source** in **Notifications** > **Additional settings**. + /// Indicates availability of funds. Visa: * \"I\" (fast funds are supported) * \"N\" (otherwise) Mastercard: * \"I\" (product type is Prepaid or Debit, or issuing country is in CEE/HGEM list) * \"N\" (otherwise) > Returned when you verify a card BIN or estimate costs, and only if payoutEligible is \"Y\" or \"D\". + /// Provides the more granular indication of why a transaction was refused. When a transaction fails with either \"Refused\", \"Restricted Card\", \"Transaction Not Permitted\", \"Not supported\" or \"DeclinedNon Generic\" refusalReason from the issuer, Adyen cross references its PSP-wide data for extra insight into the refusal reason. If an inferred refusal reason is available, the `inferredRefusalReason`, field is populated and the `refusalReason`, is set to \"Not Supported\". Possible values: * 3D Secure Mandated * Closed Account * ContAuth Not Supported * CVC Mandated * Ecommerce Not Allowed * Crossborder Not Supported * Card Updated * Low Authrate Bin * Non-reloadable prepaid card + /// Indicates if the card is used for business purposes only. + /// The issuing country of the card based on the BIN list that Adyen maintains. Example: JP + /// A Boolean value indicating whether a liability shift was offered for this payment. + /// The `mcBankNetReferenceNumber`, is a minimum of six characters and a maximum of nine characters long. > Contact Support Team to enable this field. + /// The Merchant Advice Code (MAC) can be returned by Mastercard issuers for refused payments. If present, the MAC contains information about why the payment failed, and whether it can be retried. For more information see [Mastercard Merchant Advice Codes](https://docs.adyen.com/development-resources/raw-acquirer-responses#mastercard-merchant-advice-codes). + /// The reference provided for the transaction. + /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. + /// The owner name of a bank account. Only relevant for SEPA Direct Debit transactions. + /// The Payment Account Reference (PAR) value links a network token with the underlying primary account number (PAN). The PAR value consists of 29 uppercase alphanumeric characters. + /// The payment method used in the transaction. + /// The Adyen sub-variant of the payment method used for the payment request. For more information, refer to [PaymentMethodVariant](https://docs.adyen.com/development-resources/paymentmethodvariant). Example: mcpro + /// Indicates whether a payout is eligible or not for this card. Visa: * \"Y\" * \"N\" Mastercard: * \"Y\" (domestic and cross-border) * \"D\" (only domestic) * \"N\" (no MoneySend) * \"U\" (unknown) + /// The response code from the Real Time Account Updater service. Possible return values are: * CardChanged * CardExpiryChanged * CloseAccount * ContactCardAccountHolder + /// Message to be displayed on the terminal. + /// The recurring contract types applicable to the transaction. + /// The `pspReference`, of the first recurring payment that created the recurring detail. This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. + /// The reference that uniquely identifies the recurring transaction. + /// The provided reference of the shopper for a recurring transaction. + /// The processing model used for the recurring transaction. + /// If the payment is referred, this field is set to true. This field is unavailable if the payment is referred and is usually not returned with ecommerce transactions. Example: true + /// Raw refusal reason received from the acquirer, where available. Example: AUTHORISED + /// The amount of the payment request. + /// The currency of the payment request. + /// The shopper interaction type of the payment request. Example: Ecommerce + /// The shopperReference passed in the payment request. Example: AdyenTestShopperXX + /// The terminal ID used in a point-of-sale payment. Example: 06022622 + /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true + /// The raw 3DS authentication result from the card issuer. Example: N + /// A Boolean value indicating whether 3DS was offered for this payment. Example: true + /// The raw enrollment result from the 3DS directory services of the card schemes. Example: Y + /// The 3D Secure 2 version. + /// The reference for the shopper that you sent when tokenizing the payment details. + /// The operation performed on the token. Possible values: * **created**: the token has been created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details have already been stored. + /// The reference that uniquely identifies tokenized payment details. + /// The `visaTransactionId`, has a fixed length of 15 numeric characters. > Contact Support Team to enable this field. + /// The 3DS transaction ID of the 3DS session sent in notifications. The value is Base64-encoded and is returned for transactions with directoryResponse 'N' or 'Y'. Example: ODgxNDc2MDg2MDExODk5MAAAAAA= + [JsonConstructor] + public ResponseAdditionalDataCommon(Option acquirerAccountCode = default, Option acquirerCode = default, Option acquirerReference = default, Option alias = default, Option aliasType = default, Option authCode = default, Option authorisationMid = default, Option authorisedAmountCurrency = default, Option authorisedAmountValue = default, Option avsResult = default, Option avsResultRaw = default, Option bic = default, Option coBrandedWith = default, Option cvcResult = default, Option cvcResultRaw = default, Option dsTransID = default, Option eci = default, Option expiryDate = default, Option extraCostsCurrency = default, Option extraCostsValue = default, Option fraudCheckItemNrFraudCheckname = default, Option fraudManualReview = default, Option fraudResultType = default, Option fraudRiskLevel = default, Option fundingSource = default, Option fundsAvailability = default, Option inferredRefusalReason = default, Option isCardCommercial = default, Option issuerCountry = default, Option liabilityShift = default, Option mcBankNetReferenceNumber = default, Option merchantAdviceCode = default, Option merchantReference = default, Option networkTxReference = default, Option ownerName = default, Option paymentAccountReference = default, Option paymentMethod = default, Option paymentMethodVariant = default, Option payoutEligible = default, Option realtimeAccountUpdaterStatus = default, Option receiptFreeText = default, Option recurringContractTypes = default, Option recurringFirstPspReference = default, Option recurringRecurringDetailReference = default, Option recurringShopperReference = default, Option recurringProcessingModel = default, Option referred = default, Option refusalReasonRaw = default, Option requestAmount = default, Option requestCurrencyCode = default, Option shopperInteraction = default, Option shopperReference = default, Option terminalId = default, Option threeDAuthenticated = default, Option threeDAuthenticatedResponse = default, Option threeDOffered = default, Option threeDOfferedResponse = default, Option threeDSVersion = default, Option tokenizationShopperReference = default, Option tokenizationStoreOperationType = default, Option tokenizationStoredPaymentMethodId = default, Option visaTransactionId = default, Option xid = default) + { + AcquirerAccountCodeOption = acquirerAccountCode; + AcquirerCodeOption = acquirerCode; + AcquirerReferenceOption = acquirerReference; + AliasOption = alias; + AliasTypeOption = aliasType; + AuthCodeOption = authCode; + AuthorisationMidOption = authorisationMid; + AuthorisedAmountCurrencyOption = authorisedAmountCurrency; + AuthorisedAmountValueOption = authorisedAmountValue; + AvsResultOption = avsResult; + AvsResultRawOption = avsResultRaw; + BicOption = bic; + CoBrandedWithOption = coBrandedWith; + CvcResultOption = cvcResult; + CvcResultRawOption = cvcResultRaw; + DsTransIDOption = dsTransID; + EciOption = eci; + ExpiryDateOption = expiryDate; + ExtraCostsCurrencyOption = extraCostsCurrency; + ExtraCostsValueOption = extraCostsValue; + FraudCheckItemNrFraudChecknameOption = fraudCheckItemNrFraudCheckname; + FraudManualReviewOption = fraudManualReview; + FraudResultTypeOption = fraudResultType; + FraudRiskLevelOption = fraudRiskLevel; + FundingSourceOption = fundingSource; + FundsAvailabilityOption = fundsAvailability; + InferredRefusalReasonOption = inferredRefusalReason; + IsCardCommercialOption = isCardCommercial; + IssuerCountryOption = issuerCountry; + LiabilityShiftOption = liabilityShift; + McBankNetReferenceNumberOption = mcBankNetReferenceNumber; + MerchantAdviceCodeOption = merchantAdviceCode; + MerchantReferenceOption = merchantReference; + NetworkTxReferenceOption = networkTxReference; + OwnerNameOption = ownerName; + PaymentAccountReferenceOption = paymentAccountReference; + PaymentMethodOption = paymentMethod; + PaymentMethodVariantOption = paymentMethodVariant; + PayoutEligibleOption = payoutEligible; + RealtimeAccountUpdaterStatusOption = realtimeAccountUpdaterStatus; + ReceiptFreeTextOption = receiptFreeText; + RecurringContractTypesOption = recurringContractTypes; + RecurringFirstPspReferenceOption = recurringFirstPspReference; + RecurringRecurringDetailReferenceOption = recurringRecurringDetailReference; + RecurringShopperReferenceOption = recurringShopperReference; + RecurringProcessingModelOption = recurringProcessingModel; + ReferredOption = referred; + RefusalReasonRawOption = refusalReasonRaw; + RequestAmountOption = requestAmount; + RequestCurrencyCodeOption = requestCurrencyCode; + ShopperInteractionOption = shopperInteraction; + ShopperReferenceOption = shopperReference; + TerminalIdOption = terminalId; + ThreeDAuthenticatedOption = threeDAuthenticated; + ThreeDAuthenticatedResponseOption = threeDAuthenticatedResponse; + ThreeDOfferedOption = threeDOffered; + ThreeDOfferedResponseOption = threeDOfferedResponse; + ThreeDSVersionOption = threeDSVersion; + TokenizationShopperReferenceOption = tokenizationShopperReference; + TokenizationStoreOperationTypeOption = tokenizationStoreOperationType; + TokenizationStoredPaymentMethodIdOption = tokenizationStoredPaymentMethodId; + VisaTransactionIdOption = visaTransactionId; + XidOption = xid; + OnCreated(); + } + + partial void OnCreated(); + /// /// The fraud result properties of the payment. /// /// The fraud result properties of the payment. - [JsonConverter(typeof(StringEnumConverter))] public enum FraudResultTypeEnum { /// /// Enum GREEN for value: GREEN /// - [EnumMember(Value = "GREEN")] GREEN = 1, /// /// Enum FRAUD for value: FRAUD /// - [EnumMember(Value = "FRAUD")] FRAUD = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static FraudResultTypeEnum FraudResultTypeEnumFromString(string value) + { + if (value.Equals("GREEN")) + return FraudResultTypeEnum.GREEN; + + if (value.Equals("FRAUD")) + return FraudResultTypeEnum.FRAUD; + + throw new NotImplementedException($"Could not convert value to type FraudResultTypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static FraudResultTypeEnum? FraudResultTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("GREEN")) + return FraudResultTypeEnum.GREEN; + + if (value.Equals("FRAUD")) + return FraudResultTypeEnum.FRAUD; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FraudResultTypeEnumToJsonValue(FraudResultTypeEnum? value) + { + if (value == FraudResultTypeEnum.GREEN) + return "GREEN"; + if (value == FraudResultTypeEnum.FRAUD) + return "FRAUD"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of FraudResultType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FraudResultTypeOption { get; private set; } /// /// The fraud result properties of the payment. /// /// The fraud result properties of the payment. - [DataMember(Name = "fraudResultType", EmitDefaultValue = false)] - public FraudResultTypeEnum? FraudResultType { get; set; } + [JsonPropertyName("fraudResultType")] + public FraudResultTypeEnum? FraudResultType { get { return this.FraudResultTypeOption; } set { this.FraudResultTypeOption = new Option(value); } } + /// - /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are:\\n* veryLow\\n* low\\n* medium\\n* high\\n* veryHigh\\n\\n> + /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh > /// - /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are:\\n* veryLow\\n* low\\n* medium\\n* high\\n* veryHigh\\n\\n> - [JsonConverter(typeof(StringEnumConverter))] + /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh > public enum FraudRiskLevelEnum { /// /// Enum VeryLow for value: veryLow /// - [EnumMember(Value = "veryLow")] VeryLow = 1, /// /// Enum Low for value: low /// - [EnumMember(Value = "low")] Low = 2, /// /// Enum Medium for value: medium /// - [EnumMember(Value = "medium")] Medium = 3, /// /// Enum High for value: high /// - [EnumMember(Value = "high")] High = 4, /// /// Enum VeryHigh for value: veryHigh /// - [EnumMember(Value = "veryHigh")] VeryHigh = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static FraudRiskLevelEnum FraudRiskLevelEnumFromString(string value) + { + if (value.Equals("veryLow")) + return FraudRiskLevelEnum.VeryLow; + + if (value.Equals("low")) + return FraudRiskLevelEnum.Low; + + if (value.Equals("medium")) + return FraudRiskLevelEnum.Medium; + + if (value.Equals("high")) + return FraudRiskLevelEnum.High; + + if (value.Equals("veryHigh")) + return FraudRiskLevelEnum.VeryHigh; + + throw new NotImplementedException($"Could not convert value to type FraudRiskLevelEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static FraudRiskLevelEnum? FraudRiskLevelEnumFromStringOrDefault(string value) + { + if (value.Equals("veryLow")) + return FraudRiskLevelEnum.VeryLow; + + if (value.Equals("low")) + return FraudRiskLevelEnum.Low; + + if (value.Equals("medium")) + return FraudRiskLevelEnum.Medium; + + if (value.Equals("high")) + return FraudRiskLevelEnum.High; + if (value.Equals("veryHigh")) + return FraudRiskLevelEnum.VeryHigh; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FraudRiskLevelEnumToJsonValue(FraudRiskLevelEnum? value) + { + if (value == FraudRiskLevelEnum.VeryLow) + return "veryLow"; + + if (value == FraudRiskLevelEnum.Low) + return "low"; + + if (value == FraudRiskLevelEnum.Medium) + return "medium"; + + if (value == FraudRiskLevelEnum.High) + return "high"; + + if (value == FraudRiskLevelEnum.VeryHigh) + return "veryHigh"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of FraudRiskLevel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FraudRiskLevelOption { get; private set; } /// - /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are:\\n* veryLow\\n* low\\n* medium\\n* high\\n* veryHigh\\n\\n> + /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh > /// - /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are:\\n* veryLow\\n* low\\n* medium\\n* high\\n* veryHigh\\n\\n> - [DataMember(Name = "fraudRiskLevel", EmitDefaultValue = false)] - public FraudRiskLevelEnum? FraudRiskLevel { get; set; } + /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh > + [JsonPropertyName("fraudRiskLevel")] + public FraudRiskLevelEnum? FraudRiskLevel { get { return this.FraudRiskLevelOption; } set { this.FraudRiskLevelOption = new Option(value); } } + /// /// The processing model used for the recurring transaction. /// /// The processing model used for the recurring transaction. - [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// - [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// - [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// - [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) + { + if (value == RecurringProcessingModelEnum.CardOnFile) + return "CardOnFile"; + + if (value == RecurringProcessingModelEnum.Subscription) + return "Subscription"; + if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) + return "UnscheduledCardOnFile"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of RecurringProcessingModel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringProcessingModelOption { get; private set; } /// /// The processing model used for the recurring transaction. /// /// The processing model used for the recurring transaction. - [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] - public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } + [JsonPropertyName("recurringProcessingModel")] + public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } + /// /// The operation performed on the token. Possible values: * **created**: the token has been created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details have already been stored. /// /// The operation performed on the token. Possible values: * **created**: the token has been created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details have already been stored. - [JsonConverter(typeof(StringEnumConverter))] public enum TokenizationStoreOperationTypeEnum { /// /// Enum Created for value: created /// - [EnumMember(Value = "created")] Created = 1, /// /// Enum Updated for value: updated /// - [EnumMember(Value = "updated")] Updated = 2, /// /// Enum AlreadyExisting for value: alreadyExisting /// - [EnumMember(Value = "alreadyExisting")] AlreadyExisting = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TokenizationStoreOperationTypeEnum TokenizationStoreOperationTypeEnumFromString(string value) + { + if (value.Equals("created")) + return TokenizationStoreOperationTypeEnum.Created; + + if (value.Equals("updated")) + return TokenizationStoreOperationTypeEnum.Updated; + + if (value.Equals("alreadyExisting")) + return TokenizationStoreOperationTypeEnum.AlreadyExisting; + + throw new NotImplementedException($"Could not convert value to type TokenizationStoreOperationTypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TokenizationStoreOperationTypeEnum? TokenizationStoreOperationTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("created")) + return TokenizationStoreOperationTypeEnum.Created; + + if (value.Equals("updated")) + return TokenizationStoreOperationTypeEnum.Updated; + + if (value.Equals("alreadyExisting")) + return TokenizationStoreOperationTypeEnum.AlreadyExisting; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TokenizationStoreOperationTypeEnumToJsonValue(TokenizationStoreOperationTypeEnum? value) + { + if (value == TokenizationStoreOperationTypeEnum.Created) + return "created"; + + if (value == TokenizationStoreOperationTypeEnum.Updated) + return "updated"; + if (value == TokenizationStoreOperationTypeEnum.AlreadyExisting) + return "alreadyExisting"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of TokenizationStoreOperationType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TokenizationStoreOperationTypeOption { get; private set; } /// /// The operation performed on the token. Possible values: * **created**: the token has been created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details have already been stored. /// /// The operation performed on the token. Possible values: * **created**: the token has been created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details have already been stored. - [DataMember(Name = "tokenization.store.operationType", EmitDefaultValue = false)] - public TokenizationStoreOperationTypeEnum? TokenizationStoreOperationType { get; set; } + [JsonPropertyName("tokenization.store.operationType")] + public TokenizationStoreOperationTypeEnum? TokenizationStoreOperationType { get { return this.TokenizationStoreOperationTypeOption; } set { this.TokenizationStoreOperationTypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of AcquirerAccountCode /// - /// The name of the Adyen acquirer account. Example: PayPalSandbox_TestAcquirer > Only relevant for PayPal transactions.. - /// The name of the acquirer processing the payment request. Example: TestPmmAcquirer. - /// The reference number that can be used for reconciliation in case a non-Adyen acquirer is used for settlement. Example: 7C9N3FNBKT9. - /// The Adyen alias of the card. Example: H167852639363479. - /// The type of the card alias. Example: Default. - /// Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. Example: 58747. - /// Merchant ID known by the acquirer.. - /// The currency of the authorised amount, as a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).. - /// Value of the amount authorised. This amount is represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes).. - /// The AVS result code of the payment, which provides information about the outcome of the AVS check. For possible values, see [AVS](https://docs.adyen.com/risk-management/configure-standard-risk-rules/consistency-rules#billing-address-does-not-match-cardholder-address-avs).. - /// Raw AVS result received from the acquirer, where available. Example: D. - /// BIC of a bank account. Example: TESTNL01 > Only relevant for SEPA Direct Debit transactions.. - /// Includes the co-branded card information.. - /// The result of CVC verification.. - /// The raw result of CVC verification.. - /// Supported for 3D Secure 2. The unique transaction identifier assigned by the DS to identify a single transaction.. - /// The Electronic Commerce Indicator returned from the schemes for the 3DS payment session. Example: 02. - /// The expiry date on the card. Example: 6/2016 > Returned only in case of a card payment.. - /// The currency of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. Example: EUR. - /// The value of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. The amount is in minor units.. - /// The fraud score due to a particular fraud check. The fraud check name is found in the key of the key-value pair.. - /// Indicates if the payment is sent to manual review.. - /// The fraud result properties of the payment.. - /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are:\\n* veryLow\\n* low\\n* medium\\n* high\\n* veryHigh\\n\\n>. - /// Information regarding the funding type of the card. The possible return values are: * CHARGE * CREDIT * DEBIT * PREPAID * PREPAID_RELOADABLE * PREPAID_NONRELOADABLE * DEFFERED_DEBIT > This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. For receiving this field in the notification, enable **Include Funding Source** in **Notifications** > **Additional settings**.. - /// Indicates availability of funds. Visa: * \"I\" (fast funds are supported) * \"N\" (otherwise) Mastercard: * \"I\" (product type is Prepaid or Debit, or issuing country is in CEE/HGEM list) * \"N\" (otherwise) > Returned when you verify a card BIN or estimate costs, and only if payoutEligible is \"Y\" or \"D\".. - /// Provides the more granular indication of why a transaction was refused. When a transaction fails with either \"Refused\", \"Restricted Card\", \"Transaction Not Permitted\", \"Not supported\" or \"DeclinedNon Generic\" refusalReason from the issuer, Adyen cross references its PSP-wide data for extra insight into the refusal reason. If an inferred refusal reason is available, the `inferredRefusalReason`, field is populated and the `refusalReason`, is set to \"Not Supported\". Possible values: * 3D Secure Mandated * Closed Account * ContAuth Not Supported * CVC Mandated * Ecommerce Not Allowed * Crossborder Not Supported * Card Updated * Low Authrate Bin * Non-reloadable prepaid card. - /// Indicates if the card is used for business purposes only.. - /// The issuing country of the card based on the BIN list that Adyen maintains. Example: JP. - /// A Boolean value indicating whether a liability shift was offered for this payment.. - /// The `mcBankNetReferenceNumber`, is a minimum of six characters and a maximum of nine characters long. > Contact Support Team to enable this field.. - /// The Merchant Advice Code (MAC) can be returned by Mastercard issuers for refused payments. If present, the MAC contains information about why the payment failed, and whether it can be retried. For more information see [Mastercard Merchant Advice Codes](https://docs.adyen.com/development-resources/raw-acquirer-responses#mastercard-merchant-advice-codes).. - /// The reference provided for the transaction.. - /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID.. - /// The owner name of a bank account. Only relevant for SEPA Direct Debit transactions.. - /// The Payment Account Reference (PAR) value links a network token with the underlying primary account number (PAN). The PAR value consists of 29 uppercase alphanumeric characters.. - /// The payment method used in the transaction.. - /// The Adyen sub-variant of the payment method used for the payment request. For more information, refer to [PaymentMethodVariant](https://docs.adyen.com/development-resources/paymentmethodvariant). Example: mcpro. - /// Indicates whether a payout is eligible or not for this card. Visa: * \"Y\" * \"N\" Mastercard: * \"Y\" (domestic and cross-border) * \"D\" (only domestic) * \"N\" (no MoneySend) * \"U\" (unknown). - /// The response code from the Real Time Account Updater service. Possible return values are: * CardChanged * CardExpiryChanged * CloseAccount * ContactCardAccountHolder. - /// Message to be displayed on the terminal.. - /// The recurring contract types applicable to the transaction.. - /// The `pspReference`, of the first recurring payment that created the recurring detail. This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team.. - /// The reference that uniquely identifies the recurring transaction.. - /// The provided reference of the shopper for a recurring transaction.. - /// The processing model used for the recurring transaction.. - /// If the payment is referred, this field is set to true. This field is unavailable if the payment is referred and is usually not returned with ecommerce transactions. Example: true. - /// Raw refusal reason received from the acquirer, where available. Example: AUTHORISED. - /// The amount of the payment request.. - /// The currency of the payment request.. - /// The shopper interaction type of the payment request. Example: Ecommerce. - /// The shopperReference passed in the payment request. Example: AdyenTestShopperXX. - /// The terminal ID used in a point-of-sale payment. Example: 06022622. - /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true. - /// The raw 3DS authentication result from the card issuer. Example: N. - /// A Boolean value indicating whether 3DS was offered for this payment. Example: true. - /// The raw enrollment result from the 3DS directory services of the card schemes. Example: Y. - /// The 3D Secure 2 version.. - /// The reference for the shopper that you sent when tokenizing the payment details.. - /// The operation performed on the token. Possible values: * **created**: the token has been created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details have already been stored. . - /// The reference that uniquely identifies tokenized payment details.. - /// The `visaTransactionId`, has a fixed length of 15 numeric characters. > Contact Support Team to enable this field.. - /// The 3DS transaction ID of the 3DS session sent in notifications. The value is Base64-encoded and is returned for transactions with directoryResponse 'N' or 'Y'. Example: ODgxNDc2MDg2MDExODk5MAAAAAA=. - public ResponseAdditionalDataCommon(string acquirerAccountCode = default(string), string acquirerCode = default(string), string acquirerReference = default(string), string alias = default(string), string aliasType = default(string), string authCode = default(string), string authorisationMid = default(string), string authorisedAmountCurrency = default(string), string authorisedAmountValue = default(string), string avsResult = default(string), string avsResultRaw = default(string), string bic = default(string), string coBrandedWith = default(string), string cvcResult = default(string), string cvcResultRaw = default(string), string dsTransID = default(string), string eci = default(string), string expiryDate = default(string), string extraCostsCurrency = default(string), string extraCostsValue = default(string), string fraudCheckItemNrFraudCheckname = default(string), string fraudManualReview = default(string), FraudResultTypeEnum? fraudResultType = default(FraudResultTypeEnum?), FraudRiskLevelEnum? fraudRiskLevel = default(FraudRiskLevelEnum?), string fundingSource = default(string), string fundsAvailability = default(string), string inferredRefusalReason = default(string), string isCardCommercial = default(string), string issuerCountry = default(string), string liabilityShift = default(string), string mcBankNetReferenceNumber = default(string), string merchantAdviceCode = default(string), string merchantReference = default(string), string networkTxReference = default(string), string ownerName = default(string), string paymentAccountReference = default(string), string paymentMethod = default(string), string paymentMethodVariant = default(string), string payoutEligible = default(string), string realtimeAccountUpdaterStatus = default(string), string receiptFreeText = default(string), string recurringContractTypes = default(string), string recurringFirstPspReference = default(string), string recurringRecurringDetailReference = default(string), string recurringShopperReference = default(string), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string referred = default(string), string refusalReasonRaw = default(string), string requestAmount = default(string), string requestCurrencyCode = default(string), string shopperInteraction = default(string), string shopperReference = default(string), string terminalId = default(string), string threeDAuthenticated = default(string), string threeDAuthenticatedResponse = default(string), string threeDOffered = default(string), string threeDOfferedResponse = default(string), string threeDSVersion = default(string), string tokenizationShopperReference = default(string), TokenizationStoreOperationTypeEnum? tokenizationStoreOperationType = default(TokenizationStoreOperationTypeEnum?), string tokenizationStoredPaymentMethodId = default(string), string visaTransactionId = default(string), string xid = default(string)) - { - this.AcquirerAccountCode = acquirerAccountCode; - this.AcquirerCode = acquirerCode; - this.AcquirerReference = acquirerReference; - this.Alias = alias; - this.AliasType = aliasType; - this.AuthCode = authCode; - this.AuthorisationMid = authorisationMid; - this.AuthorisedAmountCurrency = authorisedAmountCurrency; - this.AuthorisedAmountValue = authorisedAmountValue; - this.AvsResult = avsResult; - this.AvsResultRaw = avsResultRaw; - this.Bic = bic; - this.CoBrandedWith = coBrandedWith; - this.CvcResult = cvcResult; - this.CvcResultRaw = cvcResultRaw; - this.DsTransID = dsTransID; - this.Eci = eci; - this.ExpiryDate = expiryDate; - this.ExtraCostsCurrency = extraCostsCurrency; - this.ExtraCostsValue = extraCostsValue; - this.FraudCheckItemNrFraudCheckname = fraudCheckItemNrFraudCheckname; - this.FraudManualReview = fraudManualReview; - this.FraudResultType = fraudResultType; - this.FraudRiskLevel = fraudRiskLevel; - this.FundingSource = fundingSource; - this.FundsAvailability = fundsAvailability; - this.InferredRefusalReason = inferredRefusalReason; - this.IsCardCommercial = isCardCommercial; - this.IssuerCountry = issuerCountry; - this.LiabilityShift = liabilityShift; - this.McBankNetReferenceNumber = mcBankNetReferenceNumber; - this.MerchantAdviceCode = merchantAdviceCode; - this.MerchantReference = merchantReference; - this.NetworkTxReference = networkTxReference; - this.OwnerName = ownerName; - this.PaymentAccountReference = paymentAccountReference; - this.PaymentMethod = paymentMethod; - this.PaymentMethodVariant = paymentMethodVariant; - this.PayoutEligible = payoutEligible; - this.RealtimeAccountUpdaterStatus = realtimeAccountUpdaterStatus; - this.ReceiptFreeText = receiptFreeText; - this.RecurringContractTypes = recurringContractTypes; - this.RecurringFirstPspReference = recurringFirstPspReference; - this.RecurringRecurringDetailReference = recurringRecurringDetailReference; - this.RecurringShopperReference = recurringShopperReference; - this.RecurringProcessingModel = recurringProcessingModel; - this.Referred = referred; - this.RefusalReasonRaw = refusalReasonRaw; - this.RequestAmount = requestAmount; - this.RequestCurrencyCode = requestCurrencyCode; - this.ShopperInteraction = shopperInteraction; - this.ShopperReference = shopperReference; - this.TerminalId = terminalId; - this.ThreeDAuthenticated = threeDAuthenticated; - this.ThreeDAuthenticatedResponse = threeDAuthenticatedResponse; - this.ThreeDOffered = threeDOffered; - this.ThreeDOfferedResponse = threeDOfferedResponse; - this.ThreeDSVersion = threeDSVersion; - this.TokenizationShopperReference = tokenizationShopperReference; - this.TokenizationStoreOperationType = tokenizationStoreOperationType; - this.TokenizationStoredPaymentMethodId = tokenizationStoredPaymentMethodId; - this.VisaTransactionId = visaTransactionId; - this.Xid = xid; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcquirerAccountCodeOption { get; private set; } /// /// The name of the Adyen acquirer account. Example: PayPalSandbox_TestAcquirer > Only relevant for PayPal transactions. /// /// The name of the Adyen acquirer account. Example: PayPalSandbox_TestAcquirer > Only relevant for PayPal transactions. - [DataMember(Name = "acquirerAccountCode", EmitDefaultValue = false)] - public string AcquirerAccountCode { get; set; } + [JsonPropertyName("acquirerAccountCode")] + public string AcquirerAccountCode { get { return this.AcquirerAccountCodeOption; } set { this.AcquirerAccountCodeOption = new Option(value); } } + + /// + /// Used to track the state of AcquirerCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcquirerCodeOption { get; private set; } /// /// The name of the acquirer processing the payment request. Example: TestPmmAcquirer /// /// The name of the acquirer processing the payment request. Example: TestPmmAcquirer - [DataMember(Name = "acquirerCode", EmitDefaultValue = false)] - public string AcquirerCode { get; set; } + [JsonPropertyName("acquirerCode")] + public string AcquirerCode { get { return this.AcquirerCodeOption; } set { this.AcquirerCodeOption = new Option(value); } } + + /// + /// Used to track the state of AcquirerReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcquirerReferenceOption { get; private set; } /// /// The reference number that can be used for reconciliation in case a non-Adyen acquirer is used for settlement. Example: 7C9N3FNBKT9 /// /// The reference number that can be used for reconciliation in case a non-Adyen acquirer is used for settlement. Example: 7C9N3FNBKT9 - [DataMember(Name = "acquirerReference", EmitDefaultValue = false)] - public string AcquirerReference { get; set; } + [JsonPropertyName("acquirerReference")] + public string AcquirerReference { get { return this.AcquirerReferenceOption; } set { this.AcquirerReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Alias + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AliasOption { get; private set; } /// /// The Adyen alias of the card. Example: H167852639363479 /// /// The Adyen alias of the card. Example: H167852639363479 - [DataMember(Name = "alias", EmitDefaultValue = false)] - public string Alias { get; set; } + [JsonPropertyName("alias")] + public string Alias { get { return this.AliasOption; } set { this.AliasOption = new Option(value); } } + + /// + /// Used to track the state of AliasType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AliasTypeOption { get; private set; } /// /// The type of the card alias. Example: Default /// /// The type of the card alias. Example: Default - [DataMember(Name = "aliasType", EmitDefaultValue = false)] - public string AliasType { get; set; } + [JsonPropertyName("aliasType")] + public string AliasType { get { return this.AliasTypeOption; } set { this.AliasTypeOption = new Option(value); } } + + /// + /// Used to track the state of AuthCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthCodeOption { get; private set; } /// /// Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. Example: 58747 /// /// Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. Example: 58747 - [DataMember(Name = "authCode", EmitDefaultValue = false)] - public string AuthCode { get; set; } + [JsonPropertyName("authCode")] + public string AuthCode { get { return this.AuthCodeOption; } set { this.AuthCodeOption = new Option(value); } } + + /// + /// Used to track the state of AuthorisationMid + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthorisationMidOption { get; private set; } /// /// Merchant ID known by the acquirer. /// /// Merchant ID known by the acquirer. - [DataMember(Name = "authorisationMid", EmitDefaultValue = false)] - public string AuthorisationMid { get; set; } + [JsonPropertyName("authorisationMid")] + public string AuthorisationMid { get { return this.AuthorisationMidOption; } set { this.AuthorisationMidOption = new Option(value); } } + + /// + /// Used to track the state of AuthorisedAmountCurrency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthorisedAmountCurrencyOption { get; private set; } /// /// The currency of the authorised amount, as a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). /// /// The currency of the authorised amount, as a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). - [DataMember(Name = "authorisedAmountCurrency", EmitDefaultValue = false)] - public string AuthorisedAmountCurrency { get; set; } + [JsonPropertyName("authorisedAmountCurrency")] + public string AuthorisedAmountCurrency { get { return this.AuthorisedAmountCurrencyOption; } set { this.AuthorisedAmountCurrencyOption = new Option(value); } } + + /// + /// Used to track the state of AuthorisedAmountValue + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthorisedAmountValueOption { get; private set; } /// /// Value of the amount authorised. This amount is represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). /// /// Value of the amount authorised. This amount is represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). - [DataMember(Name = "authorisedAmountValue", EmitDefaultValue = false)] - public string AuthorisedAmountValue { get; set; } + [JsonPropertyName("authorisedAmountValue")] + public string AuthorisedAmountValue { get { return this.AuthorisedAmountValueOption; } set { this.AuthorisedAmountValueOption = new Option(value); } } + + /// + /// Used to track the state of AvsResult + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AvsResultOption { get; private set; } /// /// The AVS result code of the payment, which provides information about the outcome of the AVS check. For possible values, see [AVS](https://docs.adyen.com/risk-management/configure-standard-risk-rules/consistency-rules#billing-address-does-not-match-cardholder-address-avs). /// /// The AVS result code of the payment, which provides information about the outcome of the AVS check. For possible values, see [AVS](https://docs.adyen.com/risk-management/configure-standard-risk-rules/consistency-rules#billing-address-does-not-match-cardholder-address-avs). - [DataMember(Name = "avsResult", EmitDefaultValue = false)] - public string AvsResult { get; set; } + [JsonPropertyName("avsResult")] + public string AvsResult { get { return this.AvsResultOption; } set { this.AvsResultOption = new Option(value); } } + + /// + /// Used to track the state of AvsResultRaw + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AvsResultRawOption { get; private set; } /// /// Raw AVS result received from the acquirer, where available. Example: D /// /// Raw AVS result received from the acquirer, where available. Example: D - [DataMember(Name = "avsResultRaw", EmitDefaultValue = false)] - public string AvsResultRaw { get; set; } + [JsonPropertyName("avsResultRaw")] + public string AvsResultRaw { get { return this.AvsResultRawOption; } set { this.AvsResultRawOption = new Option(value); } } + + /// + /// Used to track the state of Bic + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BicOption { get; private set; } /// /// BIC of a bank account. Example: TESTNL01 > Only relevant for SEPA Direct Debit transactions. /// /// BIC of a bank account. Example: TESTNL01 > Only relevant for SEPA Direct Debit transactions. - [DataMember(Name = "bic", EmitDefaultValue = false)] - public string Bic { get; set; } + [JsonPropertyName("bic")] + public string Bic { get { return this.BicOption; } set { this.BicOption = new Option(value); } } + + /// + /// Used to track the state of CoBrandedWith + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CoBrandedWithOption { get; private set; } /// /// Includes the co-branded card information. /// /// Includes the co-branded card information. - [DataMember(Name = "coBrandedWith", EmitDefaultValue = false)] - public string CoBrandedWith { get; set; } + [JsonPropertyName("coBrandedWith")] + public string CoBrandedWith { get { return this.CoBrandedWithOption; } set { this.CoBrandedWithOption = new Option(value); } } + + /// + /// Used to track the state of CvcResult + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CvcResultOption { get; private set; } /// /// The result of CVC verification. /// /// The result of CVC verification. - [DataMember(Name = "cvcResult", EmitDefaultValue = false)] - public string CvcResult { get; set; } + /* 1 Matches */ + [JsonPropertyName("cvcResult")] + public string CvcResult { get { return this.CvcResultOption; } set { this.CvcResultOption = new Option(value); } } + + /// + /// Used to track the state of CvcResultRaw + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CvcResultRawOption { get; private set; } /// /// The raw result of CVC verification. /// /// The raw result of CVC verification. - [DataMember(Name = "cvcResultRaw", EmitDefaultValue = false)] - public string CvcResultRaw { get; set; } + /* M */ + [JsonPropertyName("cvcResultRaw")] + public string CvcResultRaw { get { return this.CvcResultRawOption; } set { this.CvcResultRawOption = new Option(value); } } + + /// + /// Used to track the state of DsTransID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DsTransIDOption { get; private set; } /// /// Supported for 3D Secure 2. The unique transaction identifier assigned by the DS to identify a single transaction. /// /// Supported for 3D Secure 2. The unique transaction identifier assigned by the DS to identify a single transaction. - [DataMember(Name = "dsTransID", EmitDefaultValue = false)] - public string DsTransID { get; set; } + [JsonPropertyName("dsTransID")] + public string DsTransID { get { return this.DsTransIDOption; } set { this.DsTransIDOption = new Option(value); } } + + /// + /// Used to track the state of Eci + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EciOption { get; private set; } /// /// The Electronic Commerce Indicator returned from the schemes for the 3DS payment session. Example: 02 /// /// The Electronic Commerce Indicator returned from the schemes for the 3DS payment session. Example: 02 - [DataMember(Name = "eci", EmitDefaultValue = false)] - public string Eci { get; set; } + [JsonPropertyName("eci")] + public string Eci { get { return this.EciOption; } set { this.EciOption = new Option(value); } } + + /// + /// Used to track the state of ExpiryDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiryDateOption { get; private set; } /// /// The expiry date on the card. Example: 6/2016 > Returned only in case of a card payment. /// /// The expiry date on the card. Example: 6/2016 > Returned only in case of a card payment. - [DataMember(Name = "expiryDate", EmitDefaultValue = false)] - public string ExpiryDate { get; set; } + [JsonPropertyName("expiryDate")] + public string ExpiryDate { get { return this.ExpiryDateOption; } set { this.ExpiryDateOption = new Option(value); } } + + /// + /// Used to track the state of ExtraCostsCurrency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExtraCostsCurrencyOption { get; private set; } /// /// The currency of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. Example: EUR /// /// The currency of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. Example: EUR - [DataMember(Name = "extraCostsCurrency", EmitDefaultValue = false)] - public string ExtraCostsCurrency { get; set; } + [JsonPropertyName("extraCostsCurrency")] + public string ExtraCostsCurrency { get { return this.ExtraCostsCurrencyOption; } set { this.ExtraCostsCurrencyOption = new Option(value); } } + + /// + /// Used to track the state of ExtraCostsValue + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExtraCostsValueOption { get; private set; } /// /// The value of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. The amount is in minor units. /// /// The value of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. The amount is in minor units. - [DataMember(Name = "extraCostsValue", EmitDefaultValue = false)] - public string ExtraCostsValue { get; set; } + [JsonPropertyName("extraCostsValue")] + public string ExtraCostsValue { get { return this.ExtraCostsValueOption; } set { this.ExtraCostsValueOption = new Option(value); } } + + /// + /// Used to track the state of FraudCheckItemNrFraudCheckname + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FraudCheckItemNrFraudChecknameOption { get; private set; } /// /// The fraud score due to a particular fraud check. The fraud check name is found in the key of the key-value pair. /// /// The fraud score due to a particular fraud check. The fraud check name is found in the key of the key-value pair. - [DataMember(Name = "fraudCheck-[itemNr]-[FraudCheckname]", EmitDefaultValue = false)] - public string FraudCheckItemNrFraudCheckname { get; set; } + [JsonPropertyName("fraudCheck-[itemNr]-[FraudCheckname]")] + public string FraudCheckItemNrFraudCheckname { get { return this.FraudCheckItemNrFraudChecknameOption; } set { this.FraudCheckItemNrFraudChecknameOption = new Option(value); } } + + /// + /// Used to track the state of FraudManualReview + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FraudManualReviewOption { get; private set; } /// /// Indicates if the payment is sent to manual review. /// /// Indicates if the payment is sent to manual review. - [DataMember(Name = "fraudManualReview", EmitDefaultValue = false)] - public string FraudManualReview { get; set; } + [JsonPropertyName("fraudManualReview")] + public string FraudManualReview { get { return this.FraudManualReviewOption; } set { this.FraudManualReviewOption = new Option(value); } } + + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// Information regarding the funding type of the card. The possible return values are: * CHARGE * CREDIT * DEBIT * PREPAID * PREPAID_RELOADABLE * PREPAID_NONRELOADABLE * DEFFERED_DEBIT > This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. For receiving this field in the notification, enable **Include Funding Source** in **Notifications** > **Additional settings**. /// /// Information regarding the funding type of the card. The possible return values are: * CHARGE * CREDIT * DEBIT * PREPAID * PREPAID_RELOADABLE * PREPAID_NONRELOADABLE * DEFFERED_DEBIT > This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. For receiving this field in the notification, enable **Include Funding Source** in **Notifications** > **Additional settings**. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public string FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public string FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + + /// + /// Used to track the state of FundsAvailability + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundsAvailabilityOption { get; private set; } /// /// Indicates availability of funds. Visa: * \"I\" (fast funds are supported) * \"N\" (otherwise) Mastercard: * \"I\" (product type is Prepaid or Debit, or issuing country is in CEE/HGEM list) * \"N\" (otherwise) > Returned when you verify a card BIN or estimate costs, and only if payoutEligible is \"Y\" or \"D\". /// /// Indicates availability of funds. Visa: * \"I\" (fast funds are supported) * \"N\" (otherwise) Mastercard: * \"I\" (product type is Prepaid or Debit, or issuing country is in CEE/HGEM list) * \"N\" (otherwise) > Returned when you verify a card BIN or estimate costs, and only if payoutEligible is \"Y\" or \"D\". - [DataMember(Name = "fundsAvailability", EmitDefaultValue = false)] - public string FundsAvailability { get; set; } + [JsonPropertyName("fundsAvailability")] + public string FundsAvailability { get { return this.FundsAvailabilityOption; } set { this.FundsAvailabilityOption = new Option(value); } } + + /// + /// Used to track the state of InferredRefusalReason + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InferredRefusalReasonOption { get; private set; } /// /// Provides the more granular indication of why a transaction was refused. When a transaction fails with either \"Refused\", \"Restricted Card\", \"Transaction Not Permitted\", \"Not supported\" or \"DeclinedNon Generic\" refusalReason from the issuer, Adyen cross references its PSP-wide data for extra insight into the refusal reason. If an inferred refusal reason is available, the `inferredRefusalReason`, field is populated and the `refusalReason`, is set to \"Not Supported\". Possible values: * 3D Secure Mandated * Closed Account * ContAuth Not Supported * CVC Mandated * Ecommerce Not Allowed * Crossborder Not Supported * Card Updated * Low Authrate Bin * Non-reloadable prepaid card /// /// Provides the more granular indication of why a transaction was refused. When a transaction fails with either \"Refused\", \"Restricted Card\", \"Transaction Not Permitted\", \"Not supported\" or \"DeclinedNon Generic\" refusalReason from the issuer, Adyen cross references its PSP-wide data for extra insight into the refusal reason. If an inferred refusal reason is available, the `inferredRefusalReason`, field is populated and the `refusalReason`, is set to \"Not Supported\". Possible values: * 3D Secure Mandated * Closed Account * ContAuth Not Supported * CVC Mandated * Ecommerce Not Allowed * Crossborder Not Supported * Card Updated * Low Authrate Bin * Non-reloadable prepaid card - [DataMember(Name = "inferredRefusalReason", EmitDefaultValue = false)] - public string InferredRefusalReason { get; set; } + [JsonPropertyName("inferredRefusalReason")] + public string InferredRefusalReason { get { return this.InferredRefusalReasonOption; } set { this.InferredRefusalReasonOption = new Option(value); } } + + /// + /// Used to track the state of IsCardCommercial + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IsCardCommercialOption { get; private set; } /// /// Indicates if the card is used for business purposes only. /// /// Indicates if the card is used for business purposes only. - [DataMember(Name = "isCardCommercial", EmitDefaultValue = false)] - public string IsCardCommercial { get; set; } + [JsonPropertyName("isCardCommercial")] + public string IsCardCommercial { get { return this.IsCardCommercialOption; } set { this.IsCardCommercialOption = new Option(value); } } + + /// + /// Used to track the state of IssuerCountry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IssuerCountryOption { get; private set; } /// /// The issuing country of the card based on the BIN list that Adyen maintains. Example: JP /// /// The issuing country of the card based on the BIN list that Adyen maintains. Example: JP - [DataMember(Name = "issuerCountry", EmitDefaultValue = false)] - public string IssuerCountry { get; set; } + [JsonPropertyName("issuerCountry")] + public string IssuerCountry { get { return this.IssuerCountryOption; } set { this.IssuerCountryOption = new Option(value); } } + + /// + /// Used to track the state of LiabilityShift + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LiabilityShiftOption { get; private set; } /// /// A Boolean value indicating whether a liability shift was offered for this payment. /// /// A Boolean value indicating whether a liability shift was offered for this payment. - [DataMember(Name = "liabilityShift", EmitDefaultValue = false)] - public string LiabilityShift { get; set; } + [JsonPropertyName("liabilityShift")] + public string LiabilityShift { get { return this.LiabilityShiftOption; } set { this.LiabilityShiftOption = new Option(value); } } + + /// + /// Used to track the state of McBankNetReferenceNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option McBankNetReferenceNumberOption { get; private set; } /// /// The `mcBankNetReferenceNumber`, is a minimum of six characters and a maximum of nine characters long. > Contact Support Team to enable this field. /// /// The `mcBankNetReferenceNumber`, is a minimum of six characters and a maximum of nine characters long. > Contact Support Team to enable this field. - [DataMember(Name = "mcBankNetReferenceNumber", EmitDefaultValue = false)] - public string McBankNetReferenceNumber { get; set; } + [JsonPropertyName("mcBankNetReferenceNumber")] + public string McBankNetReferenceNumber { get { return this.McBankNetReferenceNumberOption; } set { this.McBankNetReferenceNumberOption = new Option(value); } } + + /// + /// Used to track the state of MerchantAdviceCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantAdviceCodeOption { get; private set; } /// /// The Merchant Advice Code (MAC) can be returned by Mastercard issuers for refused payments. If present, the MAC contains information about why the payment failed, and whether it can be retried. For more information see [Mastercard Merchant Advice Codes](https://docs.adyen.com/development-resources/raw-acquirer-responses#mastercard-merchant-advice-codes). /// /// The Merchant Advice Code (MAC) can be returned by Mastercard issuers for refused payments. If present, the MAC contains information about why the payment failed, and whether it can be retried. For more information see [Mastercard Merchant Advice Codes](https://docs.adyen.com/development-resources/raw-acquirer-responses#mastercard-merchant-advice-codes). - [DataMember(Name = "merchantAdviceCode", EmitDefaultValue = false)] - public string MerchantAdviceCode { get; set; } + [JsonPropertyName("merchantAdviceCode")] + public string MerchantAdviceCode { get { return this.MerchantAdviceCodeOption; } set { this.MerchantAdviceCodeOption = new Option(value); } } + + /// + /// Used to track the state of MerchantReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantReferenceOption { get; private set; } /// /// The reference provided for the transaction. /// /// The reference provided for the transaction. - [DataMember(Name = "merchantReference", EmitDefaultValue = false)] - public string MerchantReference { get; set; } + [JsonPropertyName("merchantReference")] + public string MerchantReference { get { return this.MerchantReferenceOption; } set { this.MerchantReferenceOption = new Option(value); } } + + /// + /// Used to track the state of NetworkTxReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NetworkTxReferenceOption { get; private set; } /// /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. /// /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. - [DataMember(Name = "networkTxReference", EmitDefaultValue = false)] - public string NetworkTxReference { get; set; } + [JsonPropertyName("networkTxReference")] + public string NetworkTxReference { get { return this.NetworkTxReferenceOption; } set { this.NetworkTxReferenceOption = new Option(value); } } + + /// + /// Used to track the state of OwnerName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OwnerNameOption { get; private set; } /// /// The owner name of a bank account. Only relevant for SEPA Direct Debit transactions. /// /// The owner name of a bank account. Only relevant for SEPA Direct Debit transactions. - [DataMember(Name = "ownerName", EmitDefaultValue = false)] - public string OwnerName { get; set; } + [JsonPropertyName("ownerName")] + public string OwnerName { get { return this.OwnerNameOption; } set { this.OwnerNameOption = new Option(value); } } + + /// + /// Used to track the state of PaymentAccountReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentAccountReferenceOption { get; private set; } /// /// The Payment Account Reference (PAR) value links a network token with the underlying primary account number (PAN). The PAR value consists of 29 uppercase alphanumeric characters. /// /// The Payment Account Reference (PAR) value links a network token with the underlying primary account number (PAN). The PAR value consists of 29 uppercase alphanumeric characters. - [DataMember(Name = "paymentAccountReference", EmitDefaultValue = false)] - public string PaymentAccountReference { get; set; } + [JsonPropertyName("paymentAccountReference")] + public string PaymentAccountReference { get { return this.PaymentAccountReferenceOption; } set { this.PaymentAccountReferenceOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodOption { get; private set; } /// /// The payment method used in the transaction. /// /// The payment method used in the transaction. - [DataMember(Name = "paymentMethod", EmitDefaultValue = false)] - public string PaymentMethod { get; set; } + [JsonPropertyName("paymentMethod")] + public string PaymentMethod { get { return this.PaymentMethodOption; } set { this.PaymentMethodOption = new Option(value); } } + + /// + /// Used to track the state of PaymentMethodVariant + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentMethodVariantOption { get; private set; } /// /// The Adyen sub-variant of the payment method used for the payment request. For more information, refer to [PaymentMethodVariant](https://docs.adyen.com/development-resources/paymentmethodvariant). Example: mcpro /// /// The Adyen sub-variant of the payment method used for the payment request. For more information, refer to [PaymentMethodVariant](https://docs.adyen.com/development-resources/paymentmethodvariant). Example: mcpro - [DataMember(Name = "paymentMethodVariant", EmitDefaultValue = false)] - public string PaymentMethodVariant { get; set; } + [JsonPropertyName("paymentMethodVariant")] + public string PaymentMethodVariant { get { return this.PaymentMethodVariantOption; } set { this.PaymentMethodVariantOption = new Option(value); } } + + /// + /// Used to track the state of PayoutEligible + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayoutEligibleOption { get; private set; } /// /// Indicates whether a payout is eligible or not for this card. Visa: * \"Y\" * \"N\" Mastercard: * \"Y\" (domestic and cross-border) * \"D\" (only domestic) * \"N\" (no MoneySend) * \"U\" (unknown) /// /// Indicates whether a payout is eligible or not for this card. Visa: * \"Y\" * \"N\" Mastercard: * \"Y\" (domestic and cross-border) * \"D\" (only domestic) * \"N\" (no MoneySend) * \"U\" (unknown) - [DataMember(Name = "payoutEligible", EmitDefaultValue = false)] - public string PayoutEligible { get; set; } + [JsonPropertyName("payoutEligible")] + public string PayoutEligible { get { return this.PayoutEligibleOption; } set { this.PayoutEligibleOption = new Option(value); } } + + /// + /// Used to track the state of RealtimeAccountUpdaterStatus + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RealtimeAccountUpdaterStatusOption { get; private set; } /// /// The response code from the Real Time Account Updater service. Possible return values are: * CardChanged * CardExpiryChanged * CloseAccount * ContactCardAccountHolder /// /// The response code from the Real Time Account Updater service. Possible return values are: * CardChanged * CardExpiryChanged * CloseAccount * ContactCardAccountHolder - [DataMember(Name = "realtimeAccountUpdaterStatus", EmitDefaultValue = false)] - public string RealtimeAccountUpdaterStatus { get; set; } + [JsonPropertyName("realtimeAccountUpdaterStatus")] + public string RealtimeAccountUpdaterStatus { get { return this.RealtimeAccountUpdaterStatusOption; } set { this.RealtimeAccountUpdaterStatusOption = new Option(value); } } + + /// + /// Used to track the state of ReceiptFreeText + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReceiptFreeTextOption { get; private set; } /// /// Message to be displayed on the terminal. /// /// Message to be displayed on the terminal. - [DataMember(Name = "receiptFreeText", EmitDefaultValue = false)] - public string ReceiptFreeText { get; set; } + [JsonPropertyName("receiptFreeText")] + public string ReceiptFreeText { get { return this.ReceiptFreeTextOption; } set { this.ReceiptFreeTextOption = new Option(value); } } + + /// + /// Used to track the state of RecurringContractTypes + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringContractTypesOption { get; private set; } /// /// The recurring contract types applicable to the transaction. /// /// The recurring contract types applicable to the transaction. - [DataMember(Name = "recurring.contractTypes", EmitDefaultValue = false)] - public string RecurringContractTypes { get; set; } + [JsonPropertyName("recurring.contractTypes")] + public string RecurringContractTypes { get { return this.RecurringContractTypesOption; } set { this.RecurringContractTypesOption = new Option(value); } } + + /// + /// Used to track the state of RecurringFirstPspReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringFirstPspReferenceOption { get; private set; } /// /// The `pspReference`, of the first recurring payment that created the recurring detail. This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. /// /// The `pspReference`, of the first recurring payment that created the recurring detail. This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. - [DataMember(Name = "recurring.firstPspReference", EmitDefaultValue = false)] - public string RecurringFirstPspReference { get; set; } + [JsonPropertyName("recurring.firstPspReference")] + public string RecurringFirstPspReference { get { return this.RecurringFirstPspReferenceOption; } set { this.RecurringFirstPspReferenceOption = new Option(value); } } + + /// + /// Used to track the state of RecurringRecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringRecurringDetailReferenceOption { get; private set; } /// /// The reference that uniquely identifies the recurring transaction. /// /// The reference that uniquely identifies the recurring transaction. - [DataMember(Name = "recurring.recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v68. Use tokenization.storedPaymentMethodId instead.")] - public string RecurringRecurringDetailReference { get; set; } + [JsonPropertyName("recurring.recurringDetailReference")] + [Obsolete] + public string RecurringRecurringDetailReference { get { return this.RecurringRecurringDetailReferenceOption; } set { this.RecurringRecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of RecurringShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringShopperReferenceOption { get; private set; } /// /// The provided reference of the shopper for a recurring transaction. /// /// The provided reference of the shopper for a recurring transaction. - [DataMember(Name = "recurring.shopperReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v68. Use tokenization.shopperReference instead.")] - public string RecurringShopperReference { get; set; } + [JsonPropertyName("recurring.shopperReference")] + [Obsolete] + public string RecurringShopperReference { get { return this.RecurringShopperReferenceOption; } set { this.RecurringShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Referred + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferredOption { get; private set; } /// /// If the payment is referred, this field is set to true. This field is unavailable if the payment is referred and is usually not returned with ecommerce transactions. Example: true /// /// If the payment is referred, this field is set to true. This field is unavailable if the payment is referred and is usually not returned with ecommerce transactions. Example: true - [DataMember(Name = "referred", EmitDefaultValue = false)] - public string Referred { get; set; } + [JsonPropertyName("referred")] + public string Referred { get { return this.ReferredOption; } set { this.ReferredOption = new Option(value); } } + + /// + /// Used to track the state of RefusalReasonRaw + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RefusalReasonRawOption { get; private set; } /// /// Raw refusal reason received from the acquirer, where available. Example: AUTHORISED /// /// Raw refusal reason received from the acquirer, where available. Example: AUTHORISED - [DataMember(Name = "refusalReasonRaw", EmitDefaultValue = false)] - public string RefusalReasonRaw { get; set; } + [JsonPropertyName("refusalReasonRaw")] + public string RefusalReasonRaw { get { return this.RefusalReasonRawOption; } set { this.RefusalReasonRawOption = new Option(value); } } + + /// + /// Used to track the state of RequestAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RequestAmountOption { get; private set; } /// /// The amount of the payment request. /// /// The amount of the payment request. - [DataMember(Name = "requestAmount", EmitDefaultValue = false)] - public string RequestAmount { get; set; } + [JsonPropertyName("requestAmount")] + public string RequestAmount { get { return this.RequestAmountOption; } set { this.RequestAmountOption = new Option(value); } } + + /// + /// Used to track the state of RequestCurrencyCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RequestCurrencyCodeOption { get; private set; } /// /// The currency of the payment request. /// /// The currency of the payment request. - [DataMember(Name = "requestCurrencyCode", EmitDefaultValue = false)] - public string RequestCurrencyCode { get; set; } + [JsonPropertyName("requestCurrencyCode")] + public string RequestCurrencyCode { get { return this.RequestCurrencyCodeOption; } set { this.RequestCurrencyCodeOption = new Option(value); } } /// - /// The shopper interaction type of the payment request. Example: Ecommerce + /// Used to track the state of ShopperInteraction + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperInteractionOption { get; private set; } + + /// + /// The shopper interaction type of the payment request. Example: Ecommerce /// /// The shopper interaction type of the payment request. Example: Ecommerce - [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] - public string ShopperInteraction { get; set; } + [JsonPropertyName("shopperInteraction")] + public string ShopperInteraction { get { return this.ShopperInteractionOption; } set { this.ShopperInteractionOption = new Option(value); } } + + /// + /// Used to track the state of ShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperReferenceOption { get; private set; } /// /// The shopperReference passed in the payment request. Example: AdyenTestShopperXX /// /// The shopperReference passed in the payment request. Example: AdyenTestShopperXX - [DataMember(Name = "shopperReference", EmitDefaultValue = false)] - public string ShopperReference { get; set; } + [JsonPropertyName("shopperReference")] + public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of TerminalId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TerminalIdOption { get; private set; } /// /// The terminal ID used in a point-of-sale payment. Example: 06022622 /// /// The terminal ID used in a point-of-sale payment. Example: 06022622 - [DataMember(Name = "terminalId", EmitDefaultValue = false)] - public string TerminalId { get; set; } + [JsonPropertyName("terminalId")] + public string TerminalId { get { return this.TerminalIdOption; } set { this.TerminalIdOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDAuthenticated + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDAuthenticatedOption { get; private set; } /// /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true /// /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true - [DataMember(Name = "threeDAuthenticated", EmitDefaultValue = false)] - public string ThreeDAuthenticated { get; set; } + [JsonPropertyName("threeDAuthenticated")] + public string ThreeDAuthenticated { get { return this.ThreeDAuthenticatedOption; } set { this.ThreeDAuthenticatedOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDAuthenticatedResponse + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDAuthenticatedResponseOption { get; private set; } /// /// The raw 3DS authentication result from the card issuer. Example: N /// /// The raw 3DS authentication result from the card issuer. Example: N - [DataMember(Name = "threeDAuthenticatedResponse", EmitDefaultValue = false)] - public string ThreeDAuthenticatedResponse { get; set; } + [JsonPropertyName("threeDAuthenticatedResponse")] + public string ThreeDAuthenticatedResponse { get { return this.ThreeDAuthenticatedResponseOption; } set { this.ThreeDAuthenticatedResponseOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDOffered + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDOfferedOption { get; private set; } /// /// A Boolean value indicating whether 3DS was offered for this payment. Example: true /// /// A Boolean value indicating whether 3DS was offered for this payment. Example: true - [DataMember(Name = "threeDOffered", EmitDefaultValue = false)] - public string ThreeDOffered { get; set; } + [JsonPropertyName("threeDOffered")] + public string ThreeDOffered { get { return this.ThreeDOfferedOption; } set { this.ThreeDOfferedOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDOfferedResponse + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDOfferedResponseOption { get; private set; } /// /// The raw enrollment result from the 3DS directory services of the card schemes. Example: Y /// /// The raw enrollment result from the 3DS directory services of the card schemes. Example: Y - [DataMember(Name = "threeDOfferedResponse", EmitDefaultValue = false)] - public string ThreeDOfferedResponse { get; set; } + [JsonPropertyName("threeDOfferedResponse")] + public string ThreeDOfferedResponse { get { return this.ThreeDOfferedResponseOption; } set { this.ThreeDOfferedResponseOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSVersionOption { get; private set; } /// /// The 3D Secure 2 version. /// /// The 3D Secure 2 version. - [DataMember(Name = "threeDSVersion", EmitDefaultValue = false)] - public string ThreeDSVersion { get; set; } + [JsonPropertyName("threeDSVersion")] + public string ThreeDSVersion { get { return this.ThreeDSVersionOption; } set { this.ThreeDSVersionOption = new Option(value); } } + + /// + /// Used to track the state of TokenizationShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TokenizationShopperReferenceOption { get; private set; } /// /// The reference for the shopper that you sent when tokenizing the payment details. /// /// The reference for the shopper that you sent when tokenizing the payment details. - [DataMember(Name = "tokenization.shopperReference", EmitDefaultValue = false)] - public string TokenizationShopperReference { get; set; } + [JsonPropertyName("tokenization.shopperReference")] + public string TokenizationShopperReference { get { return this.TokenizationShopperReferenceOption; } set { this.TokenizationShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of TokenizationStoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TokenizationStoredPaymentMethodIdOption { get; private set; } /// /// The reference that uniquely identifies tokenized payment details. /// /// The reference that uniquely identifies tokenized payment details. - [DataMember(Name = "tokenization.storedPaymentMethodId", EmitDefaultValue = false)] - public string TokenizationStoredPaymentMethodId { get; set; } + [JsonPropertyName("tokenization.storedPaymentMethodId")] + public string TokenizationStoredPaymentMethodId { get { return this.TokenizationStoredPaymentMethodIdOption; } set { this.TokenizationStoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of VisaTransactionId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VisaTransactionIdOption { get; private set; } /// /// The `visaTransactionId`, has a fixed length of 15 numeric characters. > Contact Support Team to enable this field. /// /// The `visaTransactionId`, has a fixed length of 15 numeric characters. > Contact Support Team to enable this field. - [DataMember(Name = "visaTransactionId", EmitDefaultValue = false)] - public string VisaTransactionId { get; set; } + [JsonPropertyName("visaTransactionId")] + public string VisaTransactionId { get { return this.VisaTransactionIdOption; } set { this.VisaTransactionIdOption = new Option(value); } } + + /// + /// Used to track the state of Xid + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option XidOption { get; private set; } /// /// The 3DS transaction ID of the 3DS session sent in notifications. The value is Base64-encoded and is returned for transactions with directoryResponse 'N' or 'Y'. Example: ODgxNDc2MDg2MDExODk5MAAAAAA= /// /// The 3DS transaction ID of the 3DS session sent in notifications. The value is Base64-encoded and is returned for transactions with directoryResponse 'N' or 'Y'. Example: ODgxNDc2MDg2MDExODk5MAAAAAA= - [DataMember(Name = "xid", EmitDefaultValue = false)] - public string Xid { get; set; } + [JsonPropertyName("xid")] + public string Xid { get { return this.XidOption; } set { this.XidOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -798,610 +1465,897 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal + /// To validate all properties of the instance /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return this.Equals(input as ResponseAdditionalDataCommon); + yield break; } + } + /// + /// A Json converter for type + /// + public class ResponseAdditionalDataCommonJsonConverter : JsonConverter + { /// - /// Returns true if ResponseAdditionalDataCommon instances are equal + /// Deserializes json to /// - /// Instance of ResponseAdditionalDataCommon to be compared - /// Boolean - public bool Equals(ResponseAdditionalDataCommon input) + /// + /// + /// + /// + /// + public override ResponseAdditionalDataCommon Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option acquirerAccountCode = default; + Option acquirerCode = default; + Option acquirerReference = default; + Option alias = default; + Option aliasType = default; + Option authCode = default; + Option authorisationMid = default; + Option authorisedAmountCurrency = default; + Option authorisedAmountValue = default; + Option avsResult = default; + Option avsResultRaw = default; + Option bic = default; + Option coBrandedWith = default; + Option cvcResult = default; + Option cvcResultRaw = default; + Option dsTransID = default; + Option eci = default; + Option expiryDate = default; + Option extraCostsCurrency = default; + Option extraCostsValue = default; + Option fraudCheckItemNrFraudCheckname = default; + Option fraudManualReview = default; + Option fraudResultType = default; + Option fraudRiskLevel = default; + Option fundingSource = default; + Option fundsAvailability = default; + Option inferredRefusalReason = default; + Option isCardCommercial = default; + Option issuerCountry = default; + Option liabilityShift = default; + Option mcBankNetReferenceNumber = default; + Option merchantAdviceCode = default; + Option merchantReference = default; + Option networkTxReference = default; + Option ownerName = default; + Option paymentAccountReference = default; + Option paymentMethod = default; + Option paymentMethodVariant = default; + Option payoutEligible = default; + Option realtimeAccountUpdaterStatus = default; + Option receiptFreeText = default; + Option recurringContractTypes = default; + Option recurringFirstPspReference = default; + Option recurringRecurringDetailReference = default; + Option recurringShopperReference = default; + Option recurringProcessingModel = default; + Option referred = default; + Option refusalReasonRaw = default; + Option requestAmount = default; + Option requestCurrencyCode = default; + Option shopperInteraction = default; + Option shopperReference = default; + Option terminalId = default; + Option threeDAuthenticated = default; + Option threeDAuthenticatedResponse = default; + Option threeDOffered = default; + Option threeDOfferedResponse = default; + Option threeDSVersion = default; + Option tokenizationShopperReference = default; + Option tokenizationStoreOperationType = default; + Option tokenizationStoredPaymentMethodId = default; + Option visaTransactionId = default; + Option xid = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "acquirerAccountCode": + acquirerAccountCode = new Option(utf8JsonReader.GetString()); + break; + case "acquirerCode": + acquirerCode = new Option(utf8JsonReader.GetString()); + break; + case "acquirerReference": + acquirerReference = new Option(utf8JsonReader.GetString()); + break; + case "alias": + alias = new Option(utf8JsonReader.GetString()); + break; + case "aliasType": + aliasType = new Option(utf8JsonReader.GetString()); + break; + case "authCode": + authCode = new Option(utf8JsonReader.GetString()); + break; + case "authorisationMid": + authorisationMid = new Option(utf8JsonReader.GetString()); + break; + case "authorisedAmountCurrency": + authorisedAmountCurrency = new Option(utf8JsonReader.GetString()); + break; + case "authorisedAmountValue": + authorisedAmountValue = new Option(utf8JsonReader.GetString()); + break; + case "avsResult": + avsResult = new Option(utf8JsonReader.GetString()); + break; + case "avsResultRaw": + avsResultRaw = new Option(utf8JsonReader.GetString()); + break; + case "bic": + bic = new Option(utf8JsonReader.GetString()); + break; + case "coBrandedWith": + coBrandedWith = new Option(utf8JsonReader.GetString()); + break; + case "cvcResult": + cvcResult = new Option(utf8JsonReader.GetString()); + break; + case "cvcResultRaw": + cvcResultRaw = new Option(utf8JsonReader.GetString()); + break; + case "dsTransID": + dsTransID = new Option(utf8JsonReader.GetString()); + break; + case "eci": + eci = new Option(utf8JsonReader.GetString()); + break; + case "expiryDate": + expiryDate = new Option(utf8JsonReader.GetString()); + break; + case "extraCostsCurrency": + extraCostsCurrency = new Option(utf8JsonReader.GetString()); + break; + case "extraCostsValue": + extraCostsValue = new Option(utf8JsonReader.GetString()); + break; + case "fraudCheck-[itemNr]-[FraudCheckname]": + fraudCheckItemNrFraudCheckname = new Option(utf8JsonReader.GetString()); + break; + case "fraudManualReview": + fraudManualReview = new Option(utf8JsonReader.GetString()); + break; + case "fraudResultType": + string fraudResultTypeRawValue = utf8JsonReader.GetString(); + if (fraudResultTypeRawValue != null) + fraudResultType = new Option(ResponseAdditionalDataCommon.FraudResultTypeEnumFromStringOrDefault(fraudResultTypeRawValue)); + break; + case "fraudRiskLevel": + string fraudRiskLevelRawValue = utf8JsonReader.GetString(); + if (fraudRiskLevelRawValue != null) + fraudRiskLevel = new Option(ResponseAdditionalDataCommon.FraudRiskLevelEnumFromStringOrDefault(fraudRiskLevelRawValue)); + break; + case "fundingSource": + fundingSource = new Option(utf8JsonReader.GetString()); + break; + case "fundsAvailability": + fundsAvailability = new Option(utf8JsonReader.GetString()); + break; + case "inferredRefusalReason": + inferredRefusalReason = new Option(utf8JsonReader.GetString()); + break; + case "isCardCommercial": + isCardCommercial = new Option(utf8JsonReader.GetString()); + break; + case "issuerCountry": + issuerCountry = new Option(utf8JsonReader.GetString()); + break; + case "liabilityShift": + liabilityShift = new Option(utf8JsonReader.GetString()); + break; + case "mcBankNetReferenceNumber": + mcBankNetReferenceNumber = new Option(utf8JsonReader.GetString()); + break; + case "merchantAdviceCode": + merchantAdviceCode = new Option(utf8JsonReader.GetString()); + break; + case "merchantReference": + merchantReference = new Option(utf8JsonReader.GetString()); + break; + case "networkTxReference": + networkTxReference = new Option(utf8JsonReader.GetString()); + break; + case "ownerName": + ownerName = new Option(utf8JsonReader.GetString()); + break; + case "paymentAccountReference": + paymentAccountReference = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethod": + paymentMethod = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethodVariant": + paymentMethodVariant = new Option(utf8JsonReader.GetString()); + break; + case "payoutEligible": + payoutEligible = new Option(utf8JsonReader.GetString()); + break; + case "realtimeAccountUpdaterStatus": + realtimeAccountUpdaterStatus = new Option(utf8JsonReader.GetString()); + break; + case "receiptFreeText": + receiptFreeText = new Option(utf8JsonReader.GetString()); + break; + case "recurring.contractTypes": + recurringContractTypes = new Option(utf8JsonReader.GetString()); + break; + case "recurring.firstPspReference": + recurringFirstPspReference = new Option(utf8JsonReader.GetString()); + break; + case "recurring.recurringDetailReference": + recurringRecurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "recurring.shopperReference": + recurringShopperReference = new Option(utf8JsonReader.GetString()); + break; + case "recurringProcessingModel": + string recurringProcessingModelRawValue = utf8JsonReader.GetString(); + if (recurringProcessingModelRawValue != null) + recurringProcessingModel = new Option(ResponseAdditionalDataCommon.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); + break; + case "referred": + referred = new Option(utf8JsonReader.GetString()); + break; + case "refusalReasonRaw": + refusalReasonRaw = new Option(utf8JsonReader.GetString()); + break; + case "requestAmount": + requestAmount = new Option(utf8JsonReader.GetString()); + break; + case "requestCurrencyCode": + requestCurrencyCode = new Option(utf8JsonReader.GetString()); + break; + case "shopperInteraction": + shopperInteraction = new Option(utf8JsonReader.GetString()); + break; + case "shopperReference": + shopperReference = new Option(utf8JsonReader.GetString()); + break; + case "terminalId": + terminalId = new Option(utf8JsonReader.GetString()); + break; + case "threeDAuthenticated": + threeDAuthenticated = new Option(utf8JsonReader.GetString()); + break; + case "threeDAuthenticatedResponse": + threeDAuthenticatedResponse = new Option(utf8JsonReader.GetString()); + break; + case "threeDOffered": + threeDOffered = new Option(utf8JsonReader.GetString()); + break; + case "threeDOfferedResponse": + threeDOfferedResponse = new Option(utf8JsonReader.GetString()); + break; + case "threeDSVersion": + threeDSVersion = new Option(utf8JsonReader.GetString()); + break; + case "tokenization.shopperReference": + tokenizationShopperReference = new Option(utf8JsonReader.GetString()); + break; + case "tokenization.store.operationType": + string tokenizationStoreOperationTypeRawValue = utf8JsonReader.GetString(); + if (tokenizationStoreOperationTypeRawValue != null) + tokenizationStoreOperationType = new Option(ResponseAdditionalDataCommon.TokenizationStoreOperationTypeEnumFromStringOrDefault(tokenizationStoreOperationTypeRawValue)); + break; + case "tokenization.storedPaymentMethodId": + tokenizationStoredPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "visaTransactionId": + visaTransactionId = new Option(utf8JsonReader.GetString()); + break; + case "xid": + xid = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AcquirerAccountCode == input.AcquirerAccountCode || - (this.AcquirerAccountCode != null && - this.AcquirerAccountCode.Equals(input.AcquirerAccountCode)) - ) && - ( - this.AcquirerCode == input.AcquirerCode || - (this.AcquirerCode != null && - this.AcquirerCode.Equals(input.AcquirerCode)) - ) && - ( - this.AcquirerReference == input.AcquirerReference || - (this.AcquirerReference != null && - this.AcquirerReference.Equals(input.AcquirerReference)) - ) && - ( - this.Alias == input.Alias || - (this.Alias != null && - this.Alias.Equals(input.Alias)) - ) && - ( - this.AliasType == input.AliasType || - (this.AliasType != null && - this.AliasType.Equals(input.AliasType)) - ) && - ( - this.AuthCode == input.AuthCode || - (this.AuthCode != null && - this.AuthCode.Equals(input.AuthCode)) - ) && - ( - this.AuthorisationMid == input.AuthorisationMid || - (this.AuthorisationMid != null && - this.AuthorisationMid.Equals(input.AuthorisationMid)) - ) && - ( - this.AuthorisedAmountCurrency == input.AuthorisedAmountCurrency || - (this.AuthorisedAmountCurrency != null && - this.AuthorisedAmountCurrency.Equals(input.AuthorisedAmountCurrency)) - ) && - ( - this.AuthorisedAmountValue == input.AuthorisedAmountValue || - (this.AuthorisedAmountValue != null && - this.AuthorisedAmountValue.Equals(input.AuthorisedAmountValue)) - ) && - ( - this.AvsResult == input.AvsResult || - (this.AvsResult != null && - this.AvsResult.Equals(input.AvsResult)) - ) && - ( - this.AvsResultRaw == input.AvsResultRaw || - (this.AvsResultRaw != null && - this.AvsResultRaw.Equals(input.AvsResultRaw)) - ) && - ( - this.Bic == input.Bic || - (this.Bic != null && - this.Bic.Equals(input.Bic)) - ) && - ( - this.CoBrandedWith == input.CoBrandedWith || - (this.CoBrandedWith != null && - this.CoBrandedWith.Equals(input.CoBrandedWith)) - ) && - ( - this.CvcResult == input.CvcResult || - (this.CvcResult != null && - this.CvcResult.Equals(input.CvcResult)) - ) && - ( - this.CvcResultRaw == input.CvcResultRaw || - (this.CvcResultRaw != null && - this.CvcResultRaw.Equals(input.CvcResultRaw)) - ) && - ( - this.DsTransID == input.DsTransID || - (this.DsTransID != null && - this.DsTransID.Equals(input.DsTransID)) - ) && - ( - this.Eci == input.Eci || - (this.Eci != null && - this.Eci.Equals(input.Eci)) - ) && - ( - this.ExpiryDate == input.ExpiryDate || - (this.ExpiryDate != null && - this.ExpiryDate.Equals(input.ExpiryDate)) - ) && - ( - this.ExtraCostsCurrency == input.ExtraCostsCurrency || - (this.ExtraCostsCurrency != null && - this.ExtraCostsCurrency.Equals(input.ExtraCostsCurrency)) - ) && - ( - this.ExtraCostsValue == input.ExtraCostsValue || - (this.ExtraCostsValue != null && - this.ExtraCostsValue.Equals(input.ExtraCostsValue)) - ) && - ( - this.FraudCheckItemNrFraudCheckname == input.FraudCheckItemNrFraudCheckname || - (this.FraudCheckItemNrFraudCheckname != null && - this.FraudCheckItemNrFraudCheckname.Equals(input.FraudCheckItemNrFraudCheckname)) - ) && - ( - this.FraudManualReview == input.FraudManualReview || - (this.FraudManualReview != null && - this.FraudManualReview.Equals(input.FraudManualReview)) - ) && - ( - this.FraudResultType == input.FraudResultType || - this.FraudResultType.Equals(input.FraudResultType) - ) && - ( - this.FraudRiskLevel == input.FraudRiskLevel || - this.FraudRiskLevel.Equals(input.FraudRiskLevel) - ) && - ( - this.FundingSource == input.FundingSource || - (this.FundingSource != null && - this.FundingSource.Equals(input.FundingSource)) - ) && - ( - this.FundsAvailability == input.FundsAvailability || - (this.FundsAvailability != null && - this.FundsAvailability.Equals(input.FundsAvailability)) - ) && - ( - this.InferredRefusalReason == input.InferredRefusalReason || - (this.InferredRefusalReason != null && - this.InferredRefusalReason.Equals(input.InferredRefusalReason)) - ) && - ( - this.IsCardCommercial == input.IsCardCommercial || - (this.IsCardCommercial != null && - this.IsCardCommercial.Equals(input.IsCardCommercial)) - ) && - ( - this.IssuerCountry == input.IssuerCountry || - (this.IssuerCountry != null && - this.IssuerCountry.Equals(input.IssuerCountry)) - ) && - ( - this.LiabilityShift == input.LiabilityShift || - (this.LiabilityShift != null && - this.LiabilityShift.Equals(input.LiabilityShift)) - ) && - ( - this.McBankNetReferenceNumber == input.McBankNetReferenceNumber || - (this.McBankNetReferenceNumber != null && - this.McBankNetReferenceNumber.Equals(input.McBankNetReferenceNumber)) - ) && - ( - this.MerchantAdviceCode == input.MerchantAdviceCode || - (this.MerchantAdviceCode != null && - this.MerchantAdviceCode.Equals(input.MerchantAdviceCode)) - ) && - ( - this.MerchantReference == input.MerchantReference || - (this.MerchantReference != null && - this.MerchantReference.Equals(input.MerchantReference)) - ) && - ( - this.NetworkTxReference == input.NetworkTxReference || - (this.NetworkTxReference != null && - this.NetworkTxReference.Equals(input.NetworkTxReference)) - ) && - ( - this.OwnerName == input.OwnerName || - (this.OwnerName != null && - this.OwnerName.Equals(input.OwnerName)) - ) && - ( - this.PaymentAccountReference == input.PaymentAccountReference || - (this.PaymentAccountReference != null && - this.PaymentAccountReference.Equals(input.PaymentAccountReference)) - ) && - ( - this.PaymentMethod == input.PaymentMethod || - (this.PaymentMethod != null && - this.PaymentMethod.Equals(input.PaymentMethod)) - ) && - ( - this.PaymentMethodVariant == input.PaymentMethodVariant || - (this.PaymentMethodVariant != null && - this.PaymentMethodVariant.Equals(input.PaymentMethodVariant)) - ) && - ( - this.PayoutEligible == input.PayoutEligible || - (this.PayoutEligible != null && - this.PayoutEligible.Equals(input.PayoutEligible)) - ) && - ( - this.RealtimeAccountUpdaterStatus == input.RealtimeAccountUpdaterStatus || - (this.RealtimeAccountUpdaterStatus != null && - this.RealtimeAccountUpdaterStatus.Equals(input.RealtimeAccountUpdaterStatus)) - ) && - ( - this.ReceiptFreeText == input.ReceiptFreeText || - (this.ReceiptFreeText != null && - this.ReceiptFreeText.Equals(input.ReceiptFreeText)) - ) && - ( - this.RecurringContractTypes == input.RecurringContractTypes || - (this.RecurringContractTypes != null && - this.RecurringContractTypes.Equals(input.RecurringContractTypes)) - ) && - ( - this.RecurringFirstPspReference == input.RecurringFirstPspReference || - (this.RecurringFirstPspReference != null && - this.RecurringFirstPspReference.Equals(input.RecurringFirstPspReference)) - ) && - ( - this.RecurringRecurringDetailReference == input.RecurringRecurringDetailReference || - (this.RecurringRecurringDetailReference != null && - this.RecurringRecurringDetailReference.Equals(input.RecurringRecurringDetailReference)) - ) && - ( - this.RecurringShopperReference == input.RecurringShopperReference || - (this.RecurringShopperReference != null && - this.RecurringShopperReference.Equals(input.RecurringShopperReference)) - ) && - ( - this.RecurringProcessingModel == input.RecurringProcessingModel || - this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) - ) && - ( - this.Referred == input.Referred || - (this.Referred != null && - this.Referred.Equals(input.Referred)) - ) && - ( - this.RefusalReasonRaw == input.RefusalReasonRaw || - (this.RefusalReasonRaw != null && - this.RefusalReasonRaw.Equals(input.RefusalReasonRaw)) - ) && - ( - this.RequestAmount == input.RequestAmount || - (this.RequestAmount != null && - this.RequestAmount.Equals(input.RequestAmount)) - ) && - ( - this.RequestCurrencyCode == input.RequestCurrencyCode || - (this.RequestCurrencyCode != null && - this.RequestCurrencyCode.Equals(input.RequestCurrencyCode)) - ) && - ( - this.ShopperInteraction == input.ShopperInteraction || - (this.ShopperInteraction != null && - this.ShopperInteraction.Equals(input.ShopperInteraction)) - ) && - ( - this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) - ) && - ( - this.TerminalId == input.TerminalId || - (this.TerminalId != null && - this.TerminalId.Equals(input.TerminalId)) - ) && - ( - this.ThreeDAuthenticated == input.ThreeDAuthenticated || - (this.ThreeDAuthenticated != null && - this.ThreeDAuthenticated.Equals(input.ThreeDAuthenticated)) - ) && - ( - this.ThreeDAuthenticatedResponse == input.ThreeDAuthenticatedResponse || - (this.ThreeDAuthenticatedResponse != null && - this.ThreeDAuthenticatedResponse.Equals(input.ThreeDAuthenticatedResponse)) - ) && - ( - this.ThreeDOffered == input.ThreeDOffered || - (this.ThreeDOffered != null && - this.ThreeDOffered.Equals(input.ThreeDOffered)) - ) && - ( - this.ThreeDOfferedResponse == input.ThreeDOfferedResponse || - (this.ThreeDOfferedResponse != null && - this.ThreeDOfferedResponse.Equals(input.ThreeDOfferedResponse)) - ) && - ( - this.ThreeDSVersion == input.ThreeDSVersion || - (this.ThreeDSVersion != null && - this.ThreeDSVersion.Equals(input.ThreeDSVersion)) - ) && - ( - this.TokenizationShopperReference == input.TokenizationShopperReference || - (this.TokenizationShopperReference != null && - this.TokenizationShopperReference.Equals(input.TokenizationShopperReference)) - ) && - ( - this.TokenizationStoreOperationType == input.TokenizationStoreOperationType || - this.TokenizationStoreOperationType.Equals(input.TokenizationStoreOperationType) - ) && - ( - this.TokenizationStoredPaymentMethodId == input.TokenizationStoredPaymentMethodId || - (this.TokenizationStoredPaymentMethodId != null && - this.TokenizationStoredPaymentMethodId.Equals(input.TokenizationStoredPaymentMethodId)) - ) && - ( - this.VisaTransactionId == input.VisaTransactionId || - (this.VisaTransactionId != null && - this.VisaTransactionId.Equals(input.VisaTransactionId)) - ) && - ( - this.Xid == input.Xid || - (this.Xid != null && - this.Xid.Equals(input.Xid)) - ); + + if (acquirerAccountCode.IsSet && acquirerAccountCode.Value == null) + throw new ArgumentNullException(nameof(acquirerAccountCode), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (acquirerCode.IsSet && acquirerCode.Value == null) + throw new ArgumentNullException(nameof(acquirerCode), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (acquirerReference.IsSet && acquirerReference.Value == null) + throw new ArgumentNullException(nameof(acquirerReference), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (alias.IsSet && alias.Value == null) + throw new ArgumentNullException(nameof(alias), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (aliasType.IsSet && aliasType.Value == null) + throw new ArgumentNullException(nameof(aliasType), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (authCode.IsSet && authCode.Value == null) + throw new ArgumentNullException(nameof(authCode), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (authorisationMid.IsSet && authorisationMid.Value == null) + throw new ArgumentNullException(nameof(authorisationMid), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (authorisedAmountCurrency.IsSet && authorisedAmountCurrency.Value == null) + throw new ArgumentNullException(nameof(authorisedAmountCurrency), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (authorisedAmountValue.IsSet && authorisedAmountValue.Value == null) + throw new ArgumentNullException(nameof(authorisedAmountValue), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (avsResult.IsSet && avsResult.Value == null) + throw new ArgumentNullException(nameof(avsResult), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (avsResultRaw.IsSet && avsResultRaw.Value == null) + throw new ArgumentNullException(nameof(avsResultRaw), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (bic.IsSet && bic.Value == null) + throw new ArgumentNullException(nameof(bic), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (coBrandedWith.IsSet && coBrandedWith.Value == null) + throw new ArgumentNullException(nameof(coBrandedWith), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (cvcResult.IsSet && cvcResult.Value == null) + throw new ArgumentNullException(nameof(cvcResult), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (cvcResultRaw.IsSet && cvcResultRaw.Value == null) + throw new ArgumentNullException(nameof(cvcResultRaw), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (dsTransID.IsSet && dsTransID.Value == null) + throw new ArgumentNullException(nameof(dsTransID), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (eci.IsSet && eci.Value == null) + throw new ArgumentNullException(nameof(eci), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (expiryDate.IsSet && expiryDate.Value == null) + throw new ArgumentNullException(nameof(expiryDate), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (extraCostsCurrency.IsSet && extraCostsCurrency.Value == null) + throw new ArgumentNullException(nameof(extraCostsCurrency), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (extraCostsValue.IsSet && extraCostsValue.Value == null) + throw new ArgumentNullException(nameof(extraCostsValue), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (fraudCheckItemNrFraudCheckname.IsSet && fraudCheckItemNrFraudCheckname.Value == null) + throw new ArgumentNullException(nameof(fraudCheckItemNrFraudCheckname), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (fraudManualReview.IsSet && fraudManualReview.Value == null) + throw new ArgumentNullException(nameof(fraudManualReview), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (fraudResultType.IsSet && fraudResultType.Value == null) + throw new ArgumentNullException(nameof(fraudResultType), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (fraudRiskLevel.IsSet && fraudRiskLevel.Value == null) + throw new ArgumentNullException(nameof(fraudRiskLevel), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (fundsAvailability.IsSet && fundsAvailability.Value == null) + throw new ArgumentNullException(nameof(fundsAvailability), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (inferredRefusalReason.IsSet && inferredRefusalReason.Value == null) + throw new ArgumentNullException(nameof(inferredRefusalReason), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (isCardCommercial.IsSet && isCardCommercial.Value == null) + throw new ArgumentNullException(nameof(isCardCommercial), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (issuerCountry.IsSet && issuerCountry.Value == null) + throw new ArgumentNullException(nameof(issuerCountry), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (liabilityShift.IsSet && liabilityShift.Value == null) + throw new ArgumentNullException(nameof(liabilityShift), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (mcBankNetReferenceNumber.IsSet && mcBankNetReferenceNumber.Value == null) + throw new ArgumentNullException(nameof(mcBankNetReferenceNumber), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (merchantAdviceCode.IsSet && merchantAdviceCode.Value == null) + throw new ArgumentNullException(nameof(merchantAdviceCode), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (merchantReference.IsSet && merchantReference.Value == null) + throw new ArgumentNullException(nameof(merchantReference), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (networkTxReference.IsSet && networkTxReference.Value == null) + throw new ArgumentNullException(nameof(networkTxReference), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (ownerName.IsSet && ownerName.Value == null) + throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (paymentAccountReference.IsSet && paymentAccountReference.Value == null) + throw new ArgumentNullException(nameof(paymentAccountReference), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (paymentMethod.IsSet && paymentMethod.Value == null) + throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (paymentMethodVariant.IsSet && paymentMethodVariant.Value == null) + throw new ArgumentNullException(nameof(paymentMethodVariant), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (payoutEligible.IsSet && payoutEligible.Value == null) + throw new ArgumentNullException(nameof(payoutEligible), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (realtimeAccountUpdaterStatus.IsSet && realtimeAccountUpdaterStatus.Value == null) + throw new ArgumentNullException(nameof(realtimeAccountUpdaterStatus), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (receiptFreeText.IsSet && receiptFreeText.Value == null) + throw new ArgumentNullException(nameof(receiptFreeText), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (recurringContractTypes.IsSet && recurringContractTypes.Value == null) + throw new ArgumentNullException(nameof(recurringContractTypes), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (recurringFirstPspReference.IsSet && recurringFirstPspReference.Value == null) + throw new ArgumentNullException(nameof(recurringFirstPspReference), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (recurringRecurringDetailReference.IsSet && recurringRecurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringRecurringDetailReference), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (recurringShopperReference.IsSet && recurringShopperReference.Value == null) + throw new ArgumentNullException(nameof(recurringShopperReference), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) + throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (referred.IsSet && referred.Value == null) + throw new ArgumentNullException(nameof(referred), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (refusalReasonRaw.IsSet && refusalReasonRaw.Value == null) + throw new ArgumentNullException(nameof(refusalReasonRaw), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (requestAmount.IsSet && requestAmount.Value == null) + throw new ArgumentNullException(nameof(requestAmount), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (requestCurrencyCode.IsSet && requestCurrencyCode.Value == null) + throw new ArgumentNullException(nameof(requestCurrencyCode), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (shopperInteraction.IsSet && shopperInteraction.Value == null) + throw new ArgumentNullException(nameof(shopperInteraction), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (terminalId.IsSet && terminalId.Value == null) + throw new ArgumentNullException(nameof(terminalId), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (threeDAuthenticated.IsSet && threeDAuthenticated.Value == null) + throw new ArgumentNullException(nameof(threeDAuthenticated), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (threeDAuthenticatedResponse.IsSet && threeDAuthenticatedResponse.Value == null) + throw new ArgumentNullException(nameof(threeDAuthenticatedResponse), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (threeDOffered.IsSet && threeDOffered.Value == null) + throw new ArgumentNullException(nameof(threeDOffered), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (threeDOfferedResponse.IsSet && threeDOfferedResponse.Value == null) + throw new ArgumentNullException(nameof(threeDOfferedResponse), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (threeDSVersion.IsSet && threeDSVersion.Value == null) + throw new ArgumentNullException(nameof(threeDSVersion), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (tokenizationShopperReference.IsSet && tokenizationShopperReference.Value == null) + throw new ArgumentNullException(nameof(tokenizationShopperReference), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (tokenizationStoreOperationType.IsSet && tokenizationStoreOperationType.Value == null) + throw new ArgumentNullException(nameof(tokenizationStoreOperationType), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (tokenizationStoredPaymentMethodId.IsSet && tokenizationStoredPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(tokenizationStoredPaymentMethodId), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (visaTransactionId.IsSet && visaTransactionId.Value == null) + throw new ArgumentNullException(nameof(visaTransactionId), "Property is not nullable for class ResponseAdditionalDataCommon."); + + if (xid.IsSet && xid.Value == null) + throw new ArgumentNullException(nameof(xid), "Property is not nullable for class ResponseAdditionalDataCommon."); + + return new ResponseAdditionalDataCommon(acquirerAccountCode, acquirerCode, acquirerReference, alias, aliasType, authCode, authorisationMid, authorisedAmountCurrency, authorisedAmountValue, avsResult, avsResultRaw, bic, coBrandedWith, cvcResult, cvcResultRaw, dsTransID, eci, expiryDate, extraCostsCurrency, extraCostsValue, fraudCheckItemNrFraudCheckname, fraudManualReview, fraudResultType, fraudRiskLevel, fundingSource, fundsAvailability, inferredRefusalReason, isCardCommercial, issuerCountry, liabilityShift, mcBankNetReferenceNumber, merchantAdviceCode, merchantReference, networkTxReference, ownerName, paymentAccountReference, paymentMethod, paymentMethodVariant, payoutEligible, realtimeAccountUpdaterStatus, receiptFreeText, recurringContractTypes, recurringFirstPspReference, recurringRecurringDetailReference, recurringShopperReference, recurringProcessingModel, referred, refusalReasonRaw, requestAmount, requestCurrencyCode, shopperInteraction, shopperReference, terminalId, threeDAuthenticated, threeDAuthenticatedResponse, threeDOffered, threeDOfferedResponse, threeDSVersion, tokenizationShopperReference, tokenizationStoreOperationType, tokenizationStoredPaymentMethodId, visaTransactionId, xid); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataCommon responseAdditionalDataCommon, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AcquirerAccountCode != null) - { - hashCode = (hashCode * 59) + this.AcquirerAccountCode.GetHashCode(); - } - if (this.AcquirerCode != null) - { - hashCode = (hashCode * 59) + this.AcquirerCode.GetHashCode(); - } - if (this.AcquirerReference != null) - { - hashCode = (hashCode * 59) + this.AcquirerReference.GetHashCode(); - } - if (this.Alias != null) - { - hashCode = (hashCode * 59) + this.Alias.GetHashCode(); - } - if (this.AliasType != null) - { - hashCode = (hashCode * 59) + this.AliasType.GetHashCode(); - } - if (this.AuthCode != null) - { - hashCode = (hashCode * 59) + this.AuthCode.GetHashCode(); - } - if (this.AuthorisationMid != null) - { - hashCode = (hashCode * 59) + this.AuthorisationMid.GetHashCode(); - } - if (this.AuthorisedAmountCurrency != null) - { - hashCode = (hashCode * 59) + this.AuthorisedAmountCurrency.GetHashCode(); - } - if (this.AuthorisedAmountValue != null) - { - hashCode = (hashCode * 59) + this.AuthorisedAmountValue.GetHashCode(); - } - if (this.AvsResult != null) - { - hashCode = (hashCode * 59) + this.AvsResult.GetHashCode(); - } - if (this.AvsResultRaw != null) - { - hashCode = (hashCode * 59) + this.AvsResultRaw.GetHashCode(); - } - if (this.Bic != null) - { - hashCode = (hashCode * 59) + this.Bic.GetHashCode(); - } - if (this.CoBrandedWith != null) - { - hashCode = (hashCode * 59) + this.CoBrandedWith.GetHashCode(); - } - if (this.CvcResult != null) - { - hashCode = (hashCode * 59) + this.CvcResult.GetHashCode(); - } - if (this.CvcResultRaw != null) - { - hashCode = (hashCode * 59) + this.CvcResultRaw.GetHashCode(); - } - if (this.DsTransID != null) - { - hashCode = (hashCode * 59) + this.DsTransID.GetHashCode(); - } - if (this.Eci != null) - { - hashCode = (hashCode * 59) + this.Eci.GetHashCode(); - } - if (this.ExpiryDate != null) - { - hashCode = (hashCode * 59) + this.ExpiryDate.GetHashCode(); - } - if (this.ExtraCostsCurrency != null) - { - hashCode = (hashCode * 59) + this.ExtraCostsCurrency.GetHashCode(); - } - if (this.ExtraCostsValue != null) - { - hashCode = (hashCode * 59) + this.ExtraCostsValue.GetHashCode(); - } - if (this.FraudCheckItemNrFraudCheckname != null) - { - hashCode = (hashCode * 59) + this.FraudCheckItemNrFraudCheckname.GetHashCode(); - } - if (this.FraudManualReview != null) - { - hashCode = (hashCode * 59) + this.FraudManualReview.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FraudResultType.GetHashCode(); - hashCode = (hashCode * 59) + this.FraudRiskLevel.GetHashCode(); - if (this.FundingSource != null) - { - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - } - if (this.FundsAvailability != null) - { - hashCode = (hashCode * 59) + this.FundsAvailability.GetHashCode(); - } - if (this.InferredRefusalReason != null) - { - hashCode = (hashCode * 59) + this.InferredRefusalReason.GetHashCode(); - } - if (this.IsCardCommercial != null) - { - hashCode = (hashCode * 59) + this.IsCardCommercial.GetHashCode(); - } - if (this.IssuerCountry != null) - { - hashCode = (hashCode * 59) + this.IssuerCountry.GetHashCode(); - } - if (this.LiabilityShift != null) - { - hashCode = (hashCode * 59) + this.LiabilityShift.GetHashCode(); - } - if (this.McBankNetReferenceNumber != null) - { - hashCode = (hashCode * 59) + this.McBankNetReferenceNumber.GetHashCode(); - } - if (this.MerchantAdviceCode != null) - { - hashCode = (hashCode * 59) + this.MerchantAdviceCode.GetHashCode(); - } - if (this.MerchantReference != null) - { - hashCode = (hashCode * 59) + this.MerchantReference.GetHashCode(); - } - if (this.NetworkTxReference != null) - { - hashCode = (hashCode * 59) + this.NetworkTxReference.GetHashCode(); - } - if (this.OwnerName != null) - { - hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); - } - if (this.PaymentAccountReference != null) - { - hashCode = (hashCode * 59) + this.PaymentAccountReference.GetHashCode(); - } - if (this.PaymentMethod != null) - { - hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); - } - if (this.PaymentMethodVariant != null) - { - hashCode = (hashCode * 59) + this.PaymentMethodVariant.GetHashCode(); - } - if (this.PayoutEligible != null) - { - hashCode = (hashCode * 59) + this.PayoutEligible.GetHashCode(); - } - if (this.RealtimeAccountUpdaterStatus != null) - { - hashCode = (hashCode * 59) + this.RealtimeAccountUpdaterStatus.GetHashCode(); - } - if (this.ReceiptFreeText != null) - { - hashCode = (hashCode * 59) + this.ReceiptFreeText.GetHashCode(); - } - if (this.RecurringContractTypes != null) - { - hashCode = (hashCode * 59) + this.RecurringContractTypes.GetHashCode(); - } - if (this.RecurringFirstPspReference != null) - { - hashCode = (hashCode * 59) + this.RecurringFirstPspReference.GetHashCode(); - } - if (this.RecurringRecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringRecurringDetailReference.GetHashCode(); - } - if (this.RecurringShopperReference != null) - { - hashCode = (hashCode * 59) + this.RecurringShopperReference.GetHashCode(); - } - hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); - if (this.Referred != null) - { - hashCode = (hashCode * 59) + this.Referred.GetHashCode(); - } - if (this.RefusalReasonRaw != null) - { - hashCode = (hashCode * 59) + this.RefusalReasonRaw.GetHashCode(); - } - if (this.RequestAmount != null) - { - hashCode = (hashCode * 59) + this.RequestAmount.GetHashCode(); - } - if (this.RequestCurrencyCode != null) - { - hashCode = (hashCode * 59) + this.RequestCurrencyCode.GetHashCode(); - } - if (this.ShopperInteraction != null) - { - hashCode = (hashCode * 59) + this.ShopperInteraction.GetHashCode(); - } - if (this.ShopperReference != null) - { - hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); - } - if (this.TerminalId != null) - { - hashCode = (hashCode * 59) + this.TerminalId.GetHashCode(); - } - if (this.ThreeDAuthenticated != null) - { - hashCode = (hashCode * 59) + this.ThreeDAuthenticated.GetHashCode(); - } - if (this.ThreeDAuthenticatedResponse != null) - { - hashCode = (hashCode * 59) + this.ThreeDAuthenticatedResponse.GetHashCode(); - } - if (this.ThreeDOffered != null) - { - hashCode = (hashCode * 59) + this.ThreeDOffered.GetHashCode(); - } - if (this.ThreeDOfferedResponse != null) - { - hashCode = (hashCode * 59) + this.ThreeDOfferedResponse.GetHashCode(); - } - if (this.ThreeDSVersion != null) - { - hashCode = (hashCode * 59) + this.ThreeDSVersion.GetHashCode(); - } - if (this.TokenizationShopperReference != null) - { - hashCode = (hashCode * 59) + this.TokenizationShopperReference.GetHashCode(); - } - hashCode = (hashCode * 59) + this.TokenizationStoreOperationType.GetHashCode(); - if (this.TokenizationStoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.TokenizationStoredPaymentMethodId.GetHashCode(); - } - if (this.VisaTransactionId != null) - { - hashCode = (hashCode * 59) + this.VisaTransactionId.GetHashCode(); - } - if (this.Xid != null) - { - hashCode = (hashCode * 59) + this.Xid.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, responseAdditionalDataCommon, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataCommon responseAdditionalDataCommon, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (responseAdditionalDataCommon.AcquirerAccountCodeOption.IsSet && responseAdditionalDataCommon.AcquirerAccountCode == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AcquirerAccountCode), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.AcquirerCodeOption.IsSet && responseAdditionalDataCommon.AcquirerCode == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AcquirerCode), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.AcquirerReferenceOption.IsSet && responseAdditionalDataCommon.AcquirerReference == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AcquirerReference), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.AliasOption.IsSet && responseAdditionalDataCommon.Alias == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.Alias), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.AliasTypeOption.IsSet && responseAdditionalDataCommon.AliasType == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AliasType), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.AuthCodeOption.IsSet && responseAdditionalDataCommon.AuthCode == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AuthCode), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.AuthorisationMidOption.IsSet && responseAdditionalDataCommon.AuthorisationMid == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AuthorisationMid), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.AuthorisedAmountCurrencyOption.IsSet && responseAdditionalDataCommon.AuthorisedAmountCurrency == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AuthorisedAmountCurrency), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.AuthorisedAmountValueOption.IsSet && responseAdditionalDataCommon.AuthorisedAmountValue == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AuthorisedAmountValue), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.AvsResultOption.IsSet && responseAdditionalDataCommon.AvsResult == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AvsResult), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.AvsResultRawOption.IsSet && responseAdditionalDataCommon.AvsResultRaw == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AvsResultRaw), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.BicOption.IsSet && responseAdditionalDataCommon.Bic == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.Bic), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.CoBrandedWithOption.IsSet && responseAdditionalDataCommon.CoBrandedWith == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.CoBrandedWith), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.CvcResultOption.IsSet && responseAdditionalDataCommon.CvcResult == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.CvcResult), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.CvcResultRawOption.IsSet && responseAdditionalDataCommon.CvcResultRaw == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.CvcResultRaw), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.DsTransIDOption.IsSet && responseAdditionalDataCommon.DsTransID == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.DsTransID), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.EciOption.IsSet && responseAdditionalDataCommon.Eci == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.Eci), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.ExpiryDateOption.IsSet && responseAdditionalDataCommon.ExpiryDate == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ExpiryDate), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.ExtraCostsCurrencyOption.IsSet && responseAdditionalDataCommon.ExtraCostsCurrency == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ExtraCostsCurrency), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.ExtraCostsValueOption.IsSet && responseAdditionalDataCommon.ExtraCostsValue == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ExtraCostsValue), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.FraudCheckItemNrFraudChecknameOption.IsSet && responseAdditionalDataCommon.FraudCheckItemNrFraudCheckname == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.FraudCheckItemNrFraudCheckname), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.FraudManualReviewOption.IsSet && responseAdditionalDataCommon.FraudManualReview == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.FraudManualReview), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.FundingSourceOption.IsSet && responseAdditionalDataCommon.FundingSource == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.FundingSource), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.FundsAvailabilityOption.IsSet && responseAdditionalDataCommon.FundsAvailability == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.FundsAvailability), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.InferredRefusalReasonOption.IsSet && responseAdditionalDataCommon.InferredRefusalReason == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.InferredRefusalReason), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.IsCardCommercialOption.IsSet && responseAdditionalDataCommon.IsCardCommercial == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.IsCardCommercial), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.IssuerCountryOption.IsSet && responseAdditionalDataCommon.IssuerCountry == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.IssuerCountry), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.LiabilityShiftOption.IsSet && responseAdditionalDataCommon.LiabilityShift == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.LiabilityShift), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.McBankNetReferenceNumberOption.IsSet && responseAdditionalDataCommon.McBankNetReferenceNumber == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.McBankNetReferenceNumber), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.MerchantAdviceCodeOption.IsSet && responseAdditionalDataCommon.MerchantAdviceCode == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.MerchantAdviceCode), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.MerchantReferenceOption.IsSet && responseAdditionalDataCommon.MerchantReference == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.MerchantReference), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.NetworkTxReferenceOption.IsSet && responseAdditionalDataCommon.NetworkTxReference == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.NetworkTxReference), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.OwnerNameOption.IsSet && responseAdditionalDataCommon.OwnerName == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.OwnerName), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.PaymentAccountReferenceOption.IsSet && responseAdditionalDataCommon.PaymentAccountReference == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.PaymentAccountReference), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.PaymentMethodOption.IsSet && responseAdditionalDataCommon.PaymentMethod == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.PaymentMethod), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.PaymentMethodVariantOption.IsSet && responseAdditionalDataCommon.PaymentMethodVariant == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.PaymentMethodVariant), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.PayoutEligibleOption.IsSet && responseAdditionalDataCommon.PayoutEligible == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.PayoutEligible), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.RealtimeAccountUpdaterStatusOption.IsSet && responseAdditionalDataCommon.RealtimeAccountUpdaterStatus == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RealtimeAccountUpdaterStatus), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.ReceiptFreeTextOption.IsSet && responseAdditionalDataCommon.ReceiptFreeText == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ReceiptFreeText), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.RecurringContractTypesOption.IsSet && responseAdditionalDataCommon.RecurringContractTypes == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RecurringContractTypes), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.RecurringFirstPspReferenceOption.IsSet && responseAdditionalDataCommon.RecurringFirstPspReference == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RecurringFirstPspReference), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.RecurringRecurringDetailReferenceOption.IsSet && responseAdditionalDataCommon.RecurringRecurringDetailReference == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RecurringRecurringDetailReference), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.RecurringShopperReferenceOption.IsSet && responseAdditionalDataCommon.RecurringShopperReference == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RecurringShopperReference), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.ReferredOption.IsSet && responseAdditionalDataCommon.Referred == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.Referred), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.RefusalReasonRawOption.IsSet && responseAdditionalDataCommon.RefusalReasonRaw == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RefusalReasonRaw), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.RequestAmountOption.IsSet && responseAdditionalDataCommon.RequestAmount == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RequestAmount), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.RequestCurrencyCodeOption.IsSet && responseAdditionalDataCommon.RequestCurrencyCode == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RequestCurrencyCode), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.ShopperInteractionOption.IsSet && responseAdditionalDataCommon.ShopperInteraction == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ShopperInteraction), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.ShopperReferenceOption.IsSet && responseAdditionalDataCommon.ShopperReference == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ShopperReference), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.TerminalIdOption.IsSet && responseAdditionalDataCommon.TerminalId == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.TerminalId), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.ThreeDAuthenticatedOption.IsSet && responseAdditionalDataCommon.ThreeDAuthenticated == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ThreeDAuthenticated), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.ThreeDAuthenticatedResponseOption.IsSet && responseAdditionalDataCommon.ThreeDAuthenticatedResponse == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ThreeDAuthenticatedResponse), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.ThreeDOfferedOption.IsSet && responseAdditionalDataCommon.ThreeDOffered == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ThreeDOffered), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.ThreeDOfferedResponseOption.IsSet && responseAdditionalDataCommon.ThreeDOfferedResponse == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ThreeDOfferedResponse), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.ThreeDSVersionOption.IsSet && responseAdditionalDataCommon.ThreeDSVersion == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ThreeDSVersion), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.TokenizationShopperReferenceOption.IsSet && responseAdditionalDataCommon.TokenizationShopperReference == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.TokenizationShopperReference), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.TokenizationStoredPaymentMethodIdOption.IsSet && responseAdditionalDataCommon.TokenizationStoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.TokenizationStoredPaymentMethodId), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.VisaTransactionIdOption.IsSet && responseAdditionalDataCommon.VisaTransactionId == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.VisaTransactionId), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.XidOption.IsSet && responseAdditionalDataCommon.Xid == null) + throw new ArgumentNullException(nameof(responseAdditionalDataCommon.Xid), "Property is required for class ResponseAdditionalDataCommon."); + + if (responseAdditionalDataCommon.AcquirerAccountCodeOption.IsSet) + writer.WriteString("acquirerAccountCode", responseAdditionalDataCommon.AcquirerAccountCode); + + if (responseAdditionalDataCommon.AcquirerCodeOption.IsSet) + writer.WriteString("acquirerCode", responseAdditionalDataCommon.AcquirerCode); + + if (responseAdditionalDataCommon.AcquirerReferenceOption.IsSet) + writer.WriteString("acquirerReference", responseAdditionalDataCommon.AcquirerReference); + + if (responseAdditionalDataCommon.AliasOption.IsSet) + writer.WriteString("alias", responseAdditionalDataCommon.Alias); + + if (responseAdditionalDataCommon.AliasTypeOption.IsSet) + writer.WriteString("aliasType", responseAdditionalDataCommon.AliasType); + + if (responseAdditionalDataCommon.AuthCodeOption.IsSet) + writer.WriteString("authCode", responseAdditionalDataCommon.AuthCode); + + if (responseAdditionalDataCommon.AuthorisationMidOption.IsSet) + writer.WriteString("authorisationMid", responseAdditionalDataCommon.AuthorisationMid); + + if (responseAdditionalDataCommon.AuthorisedAmountCurrencyOption.IsSet) + writer.WriteString("authorisedAmountCurrency", responseAdditionalDataCommon.AuthorisedAmountCurrency); + + if (responseAdditionalDataCommon.AuthorisedAmountValueOption.IsSet) + writer.WriteString("authorisedAmountValue", responseAdditionalDataCommon.AuthorisedAmountValue); + + if (responseAdditionalDataCommon.AvsResultOption.IsSet) + writer.WriteString("avsResult", responseAdditionalDataCommon.AvsResult); + + if (responseAdditionalDataCommon.AvsResultRawOption.IsSet) + writer.WriteString("avsResultRaw", responseAdditionalDataCommon.AvsResultRaw); + + if (responseAdditionalDataCommon.BicOption.IsSet) + writer.WriteString("bic", responseAdditionalDataCommon.Bic); + + if (responseAdditionalDataCommon.CoBrandedWithOption.IsSet) + writer.WriteString("coBrandedWith", responseAdditionalDataCommon.CoBrandedWith); + + if (responseAdditionalDataCommon.CvcResultOption.IsSet) + writer.WriteString("cvcResult", responseAdditionalDataCommon.CvcResult); + + if (responseAdditionalDataCommon.CvcResultRawOption.IsSet) + writer.WriteString("cvcResultRaw", responseAdditionalDataCommon.CvcResultRaw); + + if (responseAdditionalDataCommon.DsTransIDOption.IsSet) + writer.WriteString("dsTransID", responseAdditionalDataCommon.DsTransID); + + if (responseAdditionalDataCommon.EciOption.IsSet) + writer.WriteString("eci", responseAdditionalDataCommon.Eci); + + if (responseAdditionalDataCommon.ExpiryDateOption.IsSet) + writer.WriteString("expiryDate", responseAdditionalDataCommon.ExpiryDate); + + if (responseAdditionalDataCommon.ExtraCostsCurrencyOption.IsSet) + writer.WriteString("extraCostsCurrency", responseAdditionalDataCommon.ExtraCostsCurrency); + + if (responseAdditionalDataCommon.ExtraCostsValueOption.IsSet) + writer.WriteString("extraCostsValue", responseAdditionalDataCommon.ExtraCostsValue); + + if (responseAdditionalDataCommon.FraudCheckItemNrFraudChecknameOption.IsSet) + writer.WriteString("fraudCheck-[itemNr]-[FraudCheckname]", responseAdditionalDataCommon.FraudCheckItemNrFraudCheckname); + + if (responseAdditionalDataCommon.FraudManualReviewOption.IsSet) + writer.WriteString("fraudManualReview", responseAdditionalDataCommon.FraudManualReview); + + var fraudResultTypeRawValue = ResponseAdditionalDataCommon.FraudResultTypeEnumToJsonValue(responseAdditionalDataCommon.FraudResultTypeOption.Value.Value); + writer.WriteString("fraudResultType", fraudResultTypeRawValue); + var fraudRiskLevelRawValue = ResponseAdditionalDataCommon.FraudRiskLevelEnumToJsonValue(responseAdditionalDataCommon.FraudRiskLevelOption.Value.Value); + writer.WriteString("fraudRiskLevel", fraudRiskLevelRawValue); + if (responseAdditionalDataCommon.FundingSourceOption.IsSet) + writer.WriteString("fundingSource", responseAdditionalDataCommon.FundingSource); + + if (responseAdditionalDataCommon.FundsAvailabilityOption.IsSet) + writer.WriteString("fundsAvailability", responseAdditionalDataCommon.FundsAvailability); + + if (responseAdditionalDataCommon.InferredRefusalReasonOption.IsSet) + writer.WriteString("inferredRefusalReason", responseAdditionalDataCommon.InferredRefusalReason); + + if (responseAdditionalDataCommon.IsCardCommercialOption.IsSet) + writer.WriteString("isCardCommercial", responseAdditionalDataCommon.IsCardCommercial); + + if (responseAdditionalDataCommon.IssuerCountryOption.IsSet) + writer.WriteString("issuerCountry", responseAdditionalDataCommon.IssuerCountry); + + if (responseAdditionalDataCommon.LiabilityShiftOption.IsSet) + writer.WriteString("liabilityShift", responseAdditionalDataCommon.LiabilityShift); + + if (responseAdditionalDataCommon.McBankNetReferenceNumberOption.IsSet) + writer.WriteString("mcBankNetReferenceNumber", responseAdditionalDataCommon.McBankNetReferenceNumber); + + if (responseAdditionalDataCommon.MerchantAdviceCodeOption.IsSet) + writer.WriteString("merchantAdviceCode", responseAdditionalDataCommon.MerchantAdviceCode); + + if (responseAdditionalDataCommon.MerchantReferenceOption.IsSet) + writer.WriteString("merchantReference", responseAdditionalDataCommon.MerchantReference); + + if (responseAdditionalDataCommon.NetworkTxReferenceOption.IsSet) + writer.WriteString("networkTxReference", responseAdditionalDataCommon.NetworkTxReference); + + if (responseAdditionalDataCommon.OwnerNameOption.IsSet) + writer.WriteString("ownerName", responseAdditionalDataCommon.OwnerName); + + if (responseAdditionalDataCommon.PaymentAccountReferenceOption.IsSet) + writer.WriteString("paymentAccountReference", responseAdditionalDataCommon.PaymentAccountReference); + + if (responseAdditionalDataCommon.PaymentMethodOption.IsSet) + writer.WriteString("paymentMethod", responseAdditionalDataCommon.PaymentMethod); + + if (responseAdditionalDataCommon.PaymentMethodVariantOption.IsSet) + writer.WriteString("paymentMethodVariant", responseAdditionalDataCommon.PaymentMethodVariant); + + if (responseAdditionalDataCommon.PayoutEligibleOption.IsSet) + writer.WriteString("payoutEligible", responseAdditionalDataCommon.PayoutEligible); + + if (responseAdditionalDataCommon.RealtimeAccountUpdaterStatusOption.IsSet) + writer.WriteString("realtimeAccountUpdaterStatus", responseAdditionalDataCommon.RealtimeAccountUpdaterStatus); + + if (responseAdditionalDataCommon.ReceiptFreeTextOption.IsSet) + writer.WriteString("receiptFreeText", responseAdditionalDataCommon.ReceiptFreeText); + + if (responseAdditionalDataCommon.RecurringContractTypesOption.IsSet) + writer.WriteString("recurring.contractTypes", responseAdditionalDataCommon.RecurringContractTypes); + + if (responseAdditionalDataCommon.RecurringFirstPspReferenceOption.IsSet) + writer.WriteString("recurring.firstPspReference", responseAdditionalDataCommon.RecurringFirstPspReference); + + if (responseAdditionalDataCommon.RecurringRecurringDetailReferenceOption.IsSet) + writer.WriteString("recurring.recurringDetailReference", responseAdditionalDataCommon.RecurringRecurringDetailReference); + + if (responseAdditionalDataCommon.RecurringShopperReferenceOption.IsSet) + writer.WriteString("recurring.shopperReference", responseAdditionalDataCommon.RecurringShopperReference); + + var recurringProcessingModelRawValue = ResponseAdditionalDataCommon.RecurringProcessingModelEnumToJsonValue(responseAdditionalDataCommon.RecurringProcessingModelOption.Value.Value); + writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); + if (responseAdditionalDataCommon.ReferredOption.IsSet) + writer.WriteString("referred", responseAdditionalDataCommon.Referred); + + if (responseAdditionalDataCommon.RefusalReasonRawOption.IsSet) + writer.WriteString("refusalReasonRaw", responseAdditionalDataCommon.RefusalReasonRaw); + + if (responseAdditionalDataCommon.RequestAmountOption.IsSet) + writer.WriteString("requestAmount", responseAdditionalDataCommon.RequestAmount); + + if (responseAdditionalDataCommon.RequestCurrencyCodeOption.IsSet) + writer.WriteString("requestCurrencyCode", responseAdditionalDataCommon.RequestCurrencyCode); + + if (responseAdditionalDataCommon.ShopperInteractionOption.IsSet) + writer.WriteString("shopperInteraction", responseAdditionalDataCommon.ShopperInteraction); + + if (responseAdditionalDataCommon.ShopperReferenceOption.IsSet) + writer.WriteString("shopperReference", responseAdditionalDataCommon.ShopperReference); + + if (responseAdditionalDataCommon.TerminalIdOption.IsSet) + writer.WriteString("terminalId", responseAdditionalDataCommon.TerminalId); + + if (responseAdditionalDataCommon.ThreeDAuthenticatedOption.IsSet) + writer.WriteString("threeDAuthenticated", responseAdditionalDataCommon.ThreeDAuthenticated); + + if (responseAdditionalDataCommon.ThreeDAuthenticatedResponseOption.IsSet) + writer.WriteString("threeDAuthenticatedResponse", responseAdditionalDataCommon.ThreeDAuthenticatedResponse); + + if (responseAdditionalDataCommon.ThreeDOfferedOption.IsSet) + writer.WriteString("threeDOffered", responseAdditionalDataCommon.ThreeDOffered); + + if (responseAdditionalDataCommon.ThreeDOfferedResponseOption.IsSet) + writer.WriteString("threeDOfferedResponse", responseAdditionalDataCommon.ThreeDOfferedResponse); + + if (responseAdditionalDataCommon.ThreeDSVersionOption.IsSet) + writer.WriteString("threeDSVersion", responseAdditionalDataCommon.ThreeDSVersion); + + if (responseAdditionalDataCommon.TokenizationShopperReferenceOption.IsSet) + writer.WriteString("tokenization.shopperReference", responseAdditionalDataCommon.TokenizationShopperReference); + + var tokenizationStoreOperationTypeRawValue = ResponseAdditionalDataCommon.TokenizationStoreOperationTypeEnumToJsonValue(responseAdditionalDataCommon.TokenizationStoreOperationTypeOption.Value.Value); + writer.WriteString("tokenization.store.operationType", tokenizationStoreOperationTypeRawValue); + if (responseAdditionalDataCommon.TokenizationStoredPaymentMethodIdOption.IsSet) + writer.WriteString("tokenization.storedPaymentMethodId", responseAdditionalDataCommon.TokenizationStoredPaymentMethodId); + + if (responseAdditionalDataCommon.VisaTransactionIdOption.IsSet) + writer.WriteString("visaTransactionId", responseAdditionalDataCommon.VisaTransactionId); + + if (responseAdditionalDataCommon.XidOption.IsSet) + writer.WriteString("xid", responseAdditionalDataCommon.Xid); } } - } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs b/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs index 10fb4a993..58b75bfab 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,47 +14,62 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataDomesticError /// - [DataContract(Name = "ResponseAdditionalDataDomesticError")] - public partial class ResponseAdditionalDataDomesticError : IEquatable, IValidatableObject + public partial class ResponseAdditionalDataDomesticError : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The reason the transaction was declined, given by the local issuer. Currently available for merchants in Japan.. - /// The action the shopper should take, in a local language. Currently available in Japanese, for merchants in Japan.. - public ResponseAdditionalDataDomesticError(string domesticRefusalReasonRaw = default(string), string domesticShopperAdvice = default(string)) + /// The reason the transaction was declined, given by the local issuer. Currently available for merchants in Japan. + /// The action the shopper should take, in a local language. Currently available in Japanese, for merchants in Japan. + [JsonConstructor] + public ResponseAdditionalDataDomesticError(Option domesticRefusalReasonRaw = default, Option domesticShopperAdvice = default) { - this.DomesticRefusalReasonRaw = domesticRefusalReasonRaw; - this.DomesticShopperAdvice = domesticShopperAdvice; + DomesticRefusalReasonRawOption = domesticRefusalReasonRaw; + DomesticShopperAdviceOption = domesticShopperAdvice; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of DomesticRefusalReasonRaw + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DomesticRefusalReasonRawOption { get; private set; } + /// /// The reason the transaction was declined, given by the local issuer. Currently available for merchants in Japan. /// /// The reason the transaction was declined, given by the local issuer. Currently available for merchants in Japan. - [DataMember(Name = "domesticRefusalReasonRaw", EmitDefaultValue = false)] - public string DomesticRefusalReasonRaw { get; set; } + [JsonPropertyName("domesticRefusalReasonRaw")] + public string DomesticRefusalReasonRaw { get { return this.DomesticRefusalReasonRawOption; } set { this.DomesticRefusalReasonRawOption = new Option(value); } } + + /// + /// Used to track the state of DomesticShopperAdvice + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DomesticShopperAdviceOption { get; private set; } /// /// The action the shopper should take, in a local language. Currently available in Japanese, for merchants in Japan. /// /// The action the shopper should take, in a local language. Currently available in Japanese, for merchants in Japan. - [DataMember(Name = "domesticShopperAdvice", EmitDefaultValue = false)] - public string DomesticShopperAdvice { get; set; } + [JsonPropertyName("domesticShopperAdvice")] + public string DomesticShopperAdvice { get { return this.DomesticShopperAdviceOption; } set { this.DomesticShopperAdviceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -72,77 +86,112 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ResponseAdditionalDataDomesticErrorJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ResponseAdditionalDataDomesticError Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ResponseAdditionalDataDomesticError); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ResponseAdditionalDataDomesticError instances are equal - /// - /// Instance of ResponseAdditionalDataDomesticError to be compared - /// Boolean - public bool Equals(ResponseAdditionalDataDomesticError input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option domesticRefusalReasonRaw = default; + Option domesticShopperAdvice = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "domesticRefusalReasonRaw": + domesticRefusalReasonRaw = new Option(utf8JsonReader.GetString()); + break; + case "domesticShopperAdvice": + domesticShopperAdvice = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.DomesticRefusalReasonRaw == input.DomesticRefusalReasonRaw || - (this.DomesticRefusalReasonRaw != null && - this.DomesticRefusalReasonRaw.Equals(input.DomesticRefusalReasonRaw)) - ) && - ( - this.DomesticShopperAdvice == input.DomesticShopperAdvice || - (this.DomesticShopperAdvice != null && - this.DomesticShopperAdvice.Equals(input.DomesticShopperAdvice)) - ); + + if (domesticRefusalReasonRaw.IsSet && domesticRefusalReasonRaw.Value == null) + throw new ArgumentNullException(nameof(domesticRefusalReasonRaw), "Property is not nullable for class ResponseAdditionalDataDomesticError."); + + if (domesticShopperAdvice.IsSet && domesticShopperAdvice.Value == null) + throw new ArgumentNullException(nameof(domesticShopperAdvice), "Property is not nullable for class ResponseAdditionalDataDomesticError."); + + return new ResponseAdditionalDataDomesticError(domesticRefusalReasonRaw, domesticShopperAdvice); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataDomesticError responseAdditionalDataDomesticError, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.DomesticRefusalReasonRaw != null) - { - hashCode = (hashCode * 59) + this.DomesticRefusalReasonRaw.GetHashCode(); - } - if (this.DomesticShopperAdvice != null) - { - hashCode = (hashCode * 59) + this.DomesticShopperAdvice.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, responseAdditionalDataDomesticError, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataDomesticError responseAdditionalDataDomesticError, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (responseAdditionalDataDomesticError.DomesticRefusalReasonRawOption.IsSet && responseAdditionalDataDomesticError.DomesticRefusalReasonRaw == null) + throw new ArgumentNullException(nameof(responseAdditionalDataDomesticError.DomesticRefusalReasonRaw), "Property is required for class ResponseAdditionalDataDomesticError."); + + if (responseAdditionalDataDomesticError.DomesticShopperAdviceOption.IsSet && responseAdditionalDataDomesticError.DomesticShopperAdvice == null) + throw new ArgumentNullException(nameof(responseAdditionalDataDomesticError.DomesticShopperAdvice), "Property is required for class ResponseAdditionalDataDomesticError."); + + if (responseAdditionalDataDomesticError.DomesticRefusalReasonRawOption.IsSet) + writer.WriteString("domesticRefusalReasonRaw", responseAdditionalDataDomesticError.DomesticRefusalReasonRaw); + + if (responseAdditionalDataDomesticError.DomesticShopperAdviceOption.IsSet) + writer.WriteString("domesticShopperAdvice", responseAdditionalDataDomesticError.DomesticShopperAdvice); } } - } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs b/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs index b2ce6fc11..d4dc61a7f 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,137 +14,222 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataInstallments /// - [DataContract(Name = "ResponseAdditionalDataInstallments")] - public partial class ResponseAdditionalDataInstallments : IEquatable, IValidatableObject + public partial class ResponseAdditionalDataInstallments : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Type of installment. The value of `installmentType` should be **IssuerFinanced**.. - /// Annual interest rate.. - /// First Installment Amount in minor units.. - /// Installment fee amount in minor units.. - /// Interest rate for the installment period.. - /// Maximum number of installments possible for this payment.. - /// Minimum number of installments possible for this payment.. - /// Total number of installments possible for this payment.. - /// Subsequent Installment Amount in minor units.. - /// Total amount in minor units.. - /// Possible values: * PayInInstallmentsOnly * PayInFullOnly * PayInFullOrInstallments. - /// The number of installments that the payment amount should be charged with. Example: 5 > Only relevant for card payments in countries that support installments.. - public ResponseAdditionalDataInstallments(string installmentPaymentDataInstallmentType = default(string), string installmentPaymentDataOptionItemNrAnnualPercentageRate = default(string), string installmentPaymentDataOptionItemNrFirstInstallmentAmount = default(string), string installmentPaymentDataOptionItemNrInstallmentFee = default(string), string installmentPaymentDataOptionItemNrInterestRate = default(string), string installmentPaymentDataOptionItemNrMaximumNumberOfInstallments = default(string), string installmentPaymentDataOptionItemNrMinimumNumberOfInstallments = default(string), string installmentPaymentDataOptionItemNrNumberOfInstallments = default(string), string installmentPaymentDataOptionItemNrSubsequentInstallmentAmount = default(string), string installmentPaymentDataOptionItemNrTotalAmountDue = default(string), string installmentPaymentDataPaymentOptions = default(string), string installmentsValue = default(string)) + /// Type of installment. The value of `installmentType` should be **IssuerFinanced**. + /// Annual interest rate. + /// First Installment Amount in minor units. + /// Installment fee amount in minor units. + /// Interest rate for the installment period. + /// Maximum number of installments possible for this payment. + /// Minimum number of installments possible for this payment. + /// Total number of installments possible for this payment. + /// Subsequent Installment Amount in minor units. + /// Total amount in minor units. + /// Possible values: * PayInInstallmentsOnly * PayInFullOnly * PayInFullOrInstallments + /// The number of installments that the payment amount should be charged with. Example: 5 > Only relevant for card payments in countries that support installments. + [JsonConstructor] + public ResponseAdditionalDataInstallments(Option installmentPaymentDataInstallmentType = default, Option installmentPaymentDataOptionItemNrAnnualPercentageRate = default, Option installmentPaymentDataOptionItemNrFirstInstallmentAmount = default, Option installmentPaymentDataOptionItemNrInstallmentFee = default, Option installmentPaymentDataOptionItemNrInterestRate = default, Option installmentPaymentDataOptionItemNrMaximumNumberOfInstallments = default, Option installmentPaymentDataOptionItemNrMinimumNumberOfInstallments = default, Option installmentPaymentDataOptionItemNrNumberOfInstallments = default, Option installmentPaymentDataOptionItemNrSubsequentInstallmentAmount = default, Option installmentPaymentDataOptionItemNrTotalAmountDue = default, Option installmentPaymentDataPaymentOptions = default, Option installmentsValue = default) { - this.InstallmentPaymentDataInstallmentType = installmentPaymentDataInstallmentType; - this.InstallmentPaymentDataOptionItemNrAnnualPercentageRate = installmentPaymentDataOptionItemNrAnnualPercentageRate; - this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount = installmentPaymentDataOptionItemNrFirstInstallmentAmount; - this.InstallmentPaymentDataOptionItemNrInstallmentFee = installmentPaymentDataOptionItemNrInstallmentFee; - this.InstallmentPaymentDataOptionItemNrInterestRate = installmentPaymentDataOptionItemNrInterestRate; - this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments = installmentPaymentDataOptionItemNrMaximumNumberOfInstallments; - this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments = installmentPaymentDataOptionItemNrMinimumNumberOfInstallments; - this.InstallmentPaymentDataOptionItemNrNumberOfInstallments = installmentPaymentDataOptionItemNrNumberOfInstallments; - this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount = installmentPaymentDataOptionItemNrSubsequentInstallmentAmount; - this.InstallmentPaymentDataOptionItemNrTotalAmountDue = installmentPaymentDataOptionItemNrTotalAmountDue; - this.InstallmentPaymentDataPaymentOptions = installmentPaymentDataPaymentOptions; - this.InstallmentsValue = installmentsValue; + InstallmentPaymentDataInstallmentTypeOption = installmentPaymentDataInstallmentType; + InstallmentPaymentDataOptionItemNrAnnualPercentageRateOption = installmentPaymentDataOptionItemNrAnnualPercentageRate; + InstallmentPaymentDataOptionItemNrFirstInstallmentAmountOption = installmentPaymentDataOptionItemNrFirstInstallmentAmount; + InstallmentPaymentDataOptionItemNrInstallmentFeeOption = installmentPaymentDataOptionItemNrInstallmentFee; + InstallmentPaymentDataOptionItemNrInterestRateOption = installmentPaymentDataOptionItemNrInterestRate; + InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallmentsOption = installmentPaymentDataOptionItemNrMaximumNumberOfInstallments; + InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallmentsOption = installmentPaymentDataOptionItemNrMinimumNumberOfInstallments; + InstallmentPaymentDataOptionItemNrNumberOfInstallmentsOption = installmentPaymentDataOptionItemNrNumberOfInstallments; + InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmountOption = installmentPaymentDataOptionItemNrSubsequentInstallmentAmount; + InstallmentPaymentDataOptionItemNrTotalAmountDueOption = installmentPaymentDataOptionItemNrTotalAmountDue; + InstallmentPaymentDataPaymentOptionsOption = installmentPaymentDataPaymentOptions; + InstallmentsValueOption = installmentsValue; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of InstallmentPaymentDataInstallmentType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentPaymentDataInstallmentTypeOption { get; private set; } + /// /// Type of installment. The value of `installmentType` should be **IssuerFinanced**. /// /// Type of installment. The value of `installmentType` should be **IssuerFinanced**. - [DataMember(Name = "installmentPaymentData.installmentType", EmitDefaultValue = false)] - public string InstallmentPaymentDataInstallmentType { get; set; } + [JsonPropertyName("installmentPaymentData.installmentType")] + public string InstallmentPaymentDataInstallmentType { get { return this.InstallmentPaymentDataInstallmentTypeOption; } set { this.InstallmentPaymentDataInstallmentTypeOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentPaymentDataOptionItemNrAnnualPercentageRate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentPaymentDataOptionItemNrAnnualPercentageRateOption { get; private set; } /// /// Annual interest rate. /// /// Annual interest rate. - [DataMember(Name = "installmentPaymentData.option[itemNr].annualPercentageRate", EmitDefaultValue = false)] - public string InstallmentPaymentDataOptionItemNrAnnualPercentageRate { get; set; } + [JsonPropertyName("installmentPaymentData.option[itemNr].annualPercentageRate")] + public string InstallmentPaymentDataOptionItemNrAnnualPercentageRate { get { return this.InstallmentPaymentDataOptionItemNrAnnualPercentageRateOption; } set { this.InstallmentPaymentDataOptionItemNrAnnualPercentageRateOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentPaymentDataOptionItemNrFirstInstallmentAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentPaymentDataOptionItemNrFirstInstallmentAmountOption { get; private set; } /// /// First Installment Amount in minor units. /// /// First Installment Amount in minor units. - [DataMember(Name = "installmentPaymentData.option[itemNr].firstInstallmentAmount", EmitDefaultValue = false)] - public string InstallmentPaymentDataOptionItemNrFirstInstallmentAmount { get; set; } + [JsonPropertyName("installmentPaymentData.option[itemNr].firstInstallmentAmount")] + public string InstallmentPaymentDataOptionItemNrFirstInstallmentAmount { get { return this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmountOption; } set { this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmountOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentPaymentDataOptionItemNrInstallmentFee + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentPaymentDataOptionItemNrInstallmentFeeOption { get; private set; } /// /// Installment fee amount in minor units. /// /// Installment fee amount in minor units. - [DataMember(Name = "installmentPaymentData.option[itemNr].installmentFee", EmitDefaultValue = false)] - public string InstallmentPaymentDataOptionItemNrInstallmentFee { get; set; } + [JsonPropertyName("installmentPaymentData.option[itemNr].installmentFee")] + public string InstallmentPaymentDataOptionItemNrInstallmentFee { get { return this.InstallmentPaymentDataOptionItemNrInstallmentFeeOption; } set { this.InstallmentPaymentDataOptionItemNrInstallmentFeeOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentPaymentDataOptionItemNrInterestRate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentPaymentDataOptionItemNrInterestRateOption { get; private set; } /// /// Interest rate for the installment period. /// /// Interest rate for the installment period. - [DataMember(Name = "installmentPaymentData.option[itemNr].interestRate", EmitDefaultValue = false)] - public string InstallmentPaymentDataOptionItemNrInterestRate { get; set; } + [JsonPropertyName("installmentPaymentData.option[itemNr].interestRate")] + public string InstallmentPaymentDataOptionItemNrInterestRate { get { return this.InstallmentPaymentDataOptionItemNrInterestRateOption; } set { this.InstallmentPaymentDataOptionItemNrInterestRateOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallmentsOption { get; private set; } /// /// Maximum number of installments possible for this payment. /// /// Maximum number of installments possible for this payment. - [DataMember(Name = "installmentPaymentData.option[itemNr].maximumNumberOfInstallments", EmitDefaultValue = false)] - public string InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments { get; set; } + [JsonPropertyName("installmentPaymentData.option[itemNr].maximumNumberOfInstallments")] + public string InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments { get { return this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallmentsOption; } set { this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallmentsOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallmentsOption { get; private set; } /// /// Minimum number of installments possible for this payment. /// /// Minimum number of installments possible for this payment. - [DataMember(Name = "installmentPaymentData.option[itemNr].minimumNumberOfInstallments", EmitDefaultValue = false)] - public string InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments { get; set; } + [JsonPropertyName("installmentPaymentData.option[itemNr].minimumNumberOfInstallments")] + public string InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments { get { return this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallmentsOption; } set { this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallmentsOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentPaymentDataOptionItemNrNumberOfInstallments + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentPaymentDataOptionItemNrNumberOfInstallmentsOption { get; private set; } /// /// Total number of installments possible for this payment. /// /// Total number of installments possible for this payment. - [DataMember(Name = "installmentPaymentData.option[itemNr].numberOfInstallments", EmitDefaultValue = false)] - public string InstallmentPaymentDataOptionItemNrNumberOfInstallments { get; set; } + [JsonPropertyName("installmentPaymentData.option[itemNr].numberOfInstallments")] + public string InstallmentPaymentDataOptionItemNrNumberOfInstallments { get { return this.InstallmentPaymentDataOptionItemNrNumberOfInstallmentsOption; } set { this.InstallmentPaymentDataOptionItemNrNumberOfInstallmentsOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmountOption { get; private set; } /// /// Subsequent Installment Amount in minor units. /// /// Subsequent Installment Amount in minor units. - [DataMember(Name = "installmentPaymentData.option[itemNr].subsequentInstallmentAmount", EmitDefaultValue = false)] - public string InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount { get; set; } + [JsonPropertyName("installmentPaymentData.option[itemNr].subsequentInstallmentAmount")] + public string InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount { get { return this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmountOption; } set { this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmountOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentPaymentDataOptionItemNrTotalAmountDue + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentPaymentDataOptionItemNrTotalAmountDueOption { get; private set; } /// /// Total amount in minor units. /// /// Total amount in minor units. - [DataMember(Name = "installmentPaymentData.option[itemNr].totalAmountDue", EmitDefaultValue = false)] - public string InstallmentPaymentDataOptionItemNrTotalAmountDue { get; set; } + [JsonPropertyName("installmentPaymentData.option[itemNr].totalAmountDue")] + public string InstallmentPaymentDataOptionItemNrTotalAmountDue { get { return this.InstallmentPaymentDataOptionItemNrTotalAmountDueOption; } set { this.InstallmentPaymentDataOptionItemNrTotalAmountDueOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentPaymentDataPaymentOptions + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentPaymentDataPaymentOptionsOption { get; private set; } /// /// Possible values: * PayInInstallmentsOnly * PayInFullOnly * PayInFullOrInstallments /// /// Possible values: * PayInInstallmentsOnly * PayInFullOnly * PayInFullOrInstallments - [DataMember(Name = "installmentPaymentData.paymentOptions", EmitDefaultValue = false)] - public string InstallmentPaymentDataPaymentOptions { get; set; } + [JsonPropertyName("installmentPaymentData.paymentOptions")] + public string InstallmentPaymentDataPaymentOptions { get { return this.InstallmentPaymentDataPaymentOptionsOption; } set { this.InstallmentPaymentDataPaymentOptionsOption = new Option(value); } } + + /// + /// Used to track the state of InstallmentsValue + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option InstallmentsValueOption { get; private set; } /// /// The number of installments that the payment amount should be charged with. Example: 5 > Only relevant for card payments in countries that support installments. /// /// The number of installments that the payment amount should be charged with. Example: 5 > Only relevant for card payments in countries that support installments. - [DataMember(Name = "installments.value", EmitDefaultValue = false)] - public string InstallmentsValue { get; set; } + [JsonPropertyName("installments.value")] + public string InstallmentsValue { get { return this.InstallmentsValueOption; } set { this.InstallmentsValueOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -172,167 +256,242 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ResponseAdditionalDataInstallmentsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ResponseAdditionalDataInstallments Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ResponseAdditionalDataInstallments); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ResponseAdditionalDataInstallments instances are equal - /// - /// Instance of ResponseAdditionalDataInstallments to be compared - /// Boolean - public bool Equals(ResponseAdditionalDataInstallments input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option installmentPaymentDataInstallmentType = default; + Option installmentPaymentDataOptionItemNrAnnualPercentageRate = default; + Option installmentPaymentDataOptionItemNrFirstInstallmentAmount = default; + Option installmentPaymentDataOptionItemNrInstallmentFee = default; + Option installmentPaymentDataOptionItemNrInterestRate = default; + Option installmentPaymentDataOptionItemNrMaximumNumberOfInstallments = default; + Option installmentPaymentDataOptionItemNrMinimumNumberOfInstallments = default; + Option installmentPaymentDataOptionItemNrNumberOfInstallments = default; + Option installmentPaymentDataOptionItemNrSubsequentInstallmentAmount = default; + Option installmentPaymentDataOptionItemNrTotalAmountDue = default; + Option installmentPaymentDataPaymentOptions = default; + Option installmentsValue = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "installmentPaymentData.installmentType": + installmentPaymentDataInstallmentType = new Option(utf8JsonReader.GetString()); + break; + case "installmentPaymentData.option[itemNr].annualPercentageRate": + installmentPaymentDataOptionItemNrAnnualPercentageRate = new Option(utf8JsonReader.GetString()); + break; + case "installmentPaymentData.option[itemNr].firstInstallmentAmount": + installmentPaymentDataOptionItemNrFirstInstallmentAmount = new Option(utf8JsonReader.GetString()); + break; + case "installmentPaymentData.option[itemNr].installmentFee": + installmentPaymentDataOptionItemNrInstallmentFee = new Option(utf8JsonReader.GetString()); + break; + case "installmentPaymentData.option[itemNr].interestRate": + installmentPaymentDataOptionItemNrInterestRate = new Option(utf8JsonReader.GetString()); + break; + case "installmentPaymentData.option[itemNr].maximumNumberOfInstallments": + installmentPaymentDataOptionItemNrMaximumNumberOfInstallments = new Option(utf8JsonReader.GetString()); + break; + case "installmentPaymentData.option[itemNr].minimumNumberOfInstallments": + installmentPaymentDataOptionItemNrMinimumNumberOfInstallments = new Option(utf8JsonReader.GetString()); + break; + case "installmentPaymentData.option[itemNr].numberOfInstallments": + installmentPaymentDataOptionItemNrNumberOfInstallments = new Option(utf8JsonReader.GetString()); + break; + case "installmentPaymentData.option[itemNr].subsequentInstallmentAmount": + installmentPaymentDataOptionItemNrSubsequentInstallmentAmount = new Option(utf8JsonReader.GetString()); + break; + case "installmentPaymentData.option[itemNr].totalAmountDue": + installmentPaymentDataOptionItemNrTotalAmountDue = new Option(utf8JsonReader.GetString()); + break; + case "installmentPaymentData.paymentOptions": + installmentPaymentDataPaymentOptions = new Option(utf8JsonReader.GetString()); + break; + case "installments.value": + installmentsValue = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.InstallmentPaymentDataInstallmentType == input.InstallmentPaymentDataInstallmentType || - (this.InstallmentPaymentDataInstallmentType != null && - this.InstallmentPaymentDataInstallmentType.Equals(input.InstallmentPaymentDataInstallmentType)) - ) && - ( - this.InstallmentPaymentDataOptionItemNrAnnualPercentageRate == input.InstallmentPaymentDataOptionItemNrAnnualPercentageRate || - (this.InstallmentPaymentDataOptionItemNrAnnualPercentageRate != null && - this.InstallmentPaymentDataOptionItemNrAnnualPercentageRate.Equals(input.InstallmentPaymentDataOptionItemNrAnnualPercentageRate)) - ) && - ( - this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount == input.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount || - (this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount != null && - this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount.Equals(input.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount)) - ) && - ( - this.InstallmentPaymentDataOptionItemNrInstallmentFee == input.InstallmentPaymentDataOptionItemNrInstallmentFee || - (this.InstallmentPaymentDataOptionItemNrInstallmentFee != null && - this.InstallmentPaymentDataOptionItemNrInstallmentFee.Equals(input.InstallmentPaymentDataOptionItemNrInstallmentFee)) - ) && - ( - this.InstallmentPaymentDataOptionItemNrInterestRate == input.InstallmentPaymentDataOptionItemNrInterestRate || - (this.InstallmentPaymentDataOptionItemNrInterestRate != null && - this.InstallmentPaymentDataOptionItemNrInterestRate.Equals(input.InstallmentPaymentDataOptionItemNrInterestRate)) - ) && - ( - this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments == input.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments || - (this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments != null && - this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments.Equals(input.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments)) - ) && - ( - this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments == input.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments || - (this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments != null && - this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments.Equals(input.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments)) - ) && - ( - this.InstallmentPaymentDataOptionItemNrNumberOfInstallments == input.InstallmentPaymentDataOptionItemNrNumberOfInstallments || - (this.InstallmentPaymentDataOptionItemNrNumberOfInstallments != null && - this.InstallmentPaymentDataOptionItemNrNumberOfInstallments.Equals(input.InstallmentPaymentDataOptionItemNrNumberOfInstallments)) - ) && - ( - this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount == input.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount || - (this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount != null && - this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount.Equals(input.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount)) - ) && - ( - this.InstallmentPaymentDataOptionItemNrTotalAmountDue == input.InstallmentPaymentDataOptionItemNrTotalAmountDue || - (this.InstallmentPaymentDataOptionItemNrTotalAmountDue != null && - this.InstallmentPaymentDataOptionItemNrTotalAmountDue.Equals(input.InstallmentPaymentDataOptionItemNrTotalAmountDue)) - ) && - ( - this.InstallmentPaymentDataPaymentOptions == input.InstallmentPaymentDataPaymentOptions || - (this.InstallmentPaymentDataPaymentOptions != null && - this.InstallmentPaymentDataPaymentOptions.Equals(input.InstallmentPaymentDataPaymentOptions)) - ) && - ( - this.InstallmentsValue == input.InstallmentsValue || - (this.InstallmentsValue != null && - this.InstallmentsValue.Equals(input.InstallmentsValue)) - ); + + if (installmentPaymentDataInstallmentType.IsSet && installmentPaymentDataInstallmentType.Value == null) + throw new ArgumentNullException(nameof(installmentPaymentDataInstallmentType), "Property is not nullable for class ResponseAdditionalDataInstallments."); + + if (installmentPaymentDataOptionItemNrAnnualPercentageRate.IsSet && installmentPaymentDataOptionItemNrAnnualPercentageRate.Value == null) + throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrAnnualPercentageRate), "Property is not nullable for class ResponseAdditionalDataInstallments."); + + if (installmentPaymentDataOptionItemNrFirstInstallmentAmount.IsSet && installmentPaymentDataOptionItemNrFirstInstallmentAmount.Value == null) + throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrFirstInstallmentAmount), "Property is not nullable for class ResponseAdditionalDataInstallments."); + + if (installmentPaymentDataOptionItemNrInstallmentFee.IsSet && installmentPaymentDataOptionItemNrInstallmentFee.Value == null) + throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrInstallmentFee), "Property is not nullable for class ResponseAdditionalDataInstallments."); + + if (installmentPaymentDataOptionItemNrInterestRate.IsSet && installmentPaymentDataOptionItemNrInterestRate.Value == null) + throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrInterestRate), "Property is not nullable for class ResponseAdditionalDataInstallments."); + + if (installmentPaymentDataOptionItemNrMaximumNumberOfInstallments.IsSet && installmentPaymentDataOptionItemNrMaximumNumberOfInstallments.Value == null) + throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrMaximumNumberOfInstallments), "Property is not nullable for class ResponseAdditionalDataInstallments."); + + if (installmentPaymentDataOptionItemNrMinimumNumberOfInstallments.IsSet && installmentPaymentDataOptionItemNrMinimumNumberOfInstallments.Value == null) + throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrMinimumNumberOfInstallments), "Property is not nullable for class ResponseAdditionalDataInstallments."); + + if (installmentPaymentDataOptionItemNrNumberOfInstallments.IsSet && installmentPaymentDataOptionItemNrNumberOfInstallments.Value == null) + throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrNumberOfInstallments), "Property is not nullable for class ResponseAdditionalDataInstallments."); + + if (installmentPaymentDataOptionItemNrSubsequentInstallmentAmount.IsSet && installmentPaymentDataOptionItemNrSubsequentInstallmentAmount.Value == null) + throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrSubsequentInstallmentAmount), "Property is not nullable for class ResponseAdditionalDataInstallments."); + + if (installmentPaymentDataOptionItemNrTotalAmountDue.IsSet && installmentPaymentDataOptionItemNrTotalAmountDue.Value == null) + throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrTotalAmountDue), "Property is not nullable for class ResponseAdditionalDataInstallments."); + + if (installmentPaymentDataPaymentOptions.IsSet && installmentPaymentDataPaymentOptions.Value == null) + throw new ArgumentNullException(nameof(installmentPaymentDataPaymentOptions), "Property is not nullable for class ResponseAdditionalDataInstallments."); + + if (installmentsValue.IsSet && installmentsValue.Value == null) + throw new ArgumentNullException(nameof(installmentsValue), "Property is not nullable for class ResponseAdditionalDataInstallments."); + + return new ResponseAdditionalDataInstallments(installmentPaymentDataInstallmentType, installmentPaymentDataOptionItemNrAnnualPercentageRate, installmentPaymentDataOptionItemNrFirstInstallmentAmount, installmentPaymentDataOptionItemNrInstallmentFee, installmentPaymentDataOptionItemNrInterestRate, installmentPaymentDataOptionItemNrMaximumNumberOfInstallments, installmentPaymentDataOptionItemNrMinimumNumberOfInstallments, installmentPaymentDataOptionItemNrNumberOfInstallments, installmentPaymentDataOptionItemNrSubsequentInstallmentAmount, installmentPaymentDataOptionItemNrTotalAmountDue, installmentPaymentDataPaymentOptions, installmentsValue); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataInstallments responseAdditionalDataInstallments, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.InstallmentPaymentDataInstallmentType != null) - { - hashCode = (hashCode * 59) + this.InstallmentPaymentDataInstallmentType.GetHashCode(); - } - if (this.InstallmentPaymentDataOptionItemNrAnnualPercentageRate != null) - { - hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrAnnualPercentageRate.GetHashCode(); - } - if (this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount != null) - { - hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount.GetHashCode(); - } - if (this.InstallmentPaymentDataOptionItemNrInstallmentFee != null) - { - hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrInstallmentFee.GetHashCode(); - } - if (this.InstallmentPaymentDataOptionItemNrInterestRate != null) - { - hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrInterestRate.GetHashCode(); - } - if (this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments != null) - { - hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments.GetHashCode(); - } - if (this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments != null) - { - hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments.GetHashCode(); - } - if (this.InstallmentPaymentDataOptionItemNrNumberOfInstallments != null) - { - hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrNumberOfInstallments.GetHashCode(); - } - if (this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount != null) - { - hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount.GetHashCode(); - } - if (this.InstallmentPaymentDataOptionItemNrTotalAmountDue != null) - { - hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrTotalAmountDue.GetHashCode(); - } - if (this.InstallmentPaymentDataPaymentOptions != null) - { - hashCode = (hashCode * 59) + this.InstallmentPaymentDataPaymentOptions.GetHashCode(); - } - if (this.InstallmentsValue != null) - { - hashCode = (hashCode * 59) + this.InstallmentsValue.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, responseAdditionalDataInstallments, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataInstallments responseAdditionalDataInstallments, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (responseAdditionalDataInstallments.InstallmentPaymentDataInstallmentTypeOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataInstallmentType == null) + throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataInstallmentType), "Property is required for class ResponseAdditionalDataInstallments."); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrAnnualPercentageRateOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrAnnualPercentageRate == null) + throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrAnnualPercentageRate), "Property is required for class ResponseAdditionalDataInstallments."); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrFirstInstallmentAmountOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount == null) + throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount), "Property is required for class ResponseAdditionalDataInstallments."); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInstallmentFeeOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInstallmentFee == null) + throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInstallmentFee), "Property is required for class ResponseAdditionalDataInstallments."); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInterestRateOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInterestRate == null) + throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInterestRate), "Property is required for class ResponseAdditionalDataInstallments."); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallmentsOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments == null) + throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments), "Property is required for class ResponseAdditionalDataInstallments."); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallmentsOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments == null) + throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments), "Property is required for class ResponseAdditionalDataInstallments."); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrNumberOfInstallmentsOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrNumberOfInstallments == null) + throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrNumberOfInstallments), "Property is required for class ResponseAdditionalDataInstallments."); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmountOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount == null) + throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount), "Property is required for class ResponseAdditionalDataInstallments."); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrTotalAmountDueOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrTotalAmountDue == null) + throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrTotalAmountDue), "Property is required for class ResponseAdditionalDataInstallments."); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataPaymentOptionsOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataPaymentOptions == null) + throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataPaymentOptions), "Property is required for class ResponseAdditionalDataInstallments."); + + if (responseAdditionalDataInstallments.InstallmentsValueOption.IsSet && responseAdditionalDataInstallments.InstallmentsValue == null) + throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentsValue), "Property is required for class ResponseAdditionalDataInstallments."); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataInstallmentTypeOption.IsSet) + writer.WriteString("installmentPaymentData.installmentType", responseAdditionalDataInstallments.InstallmentPaymentDataInstallmentType); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrAnnualPercentageRateOption.IsSet) + writer.WriteString("installmentPaymentData.option[itemNr].annualPercentageRate", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrAnnualPercentageRate); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrFirstInstallmentAmountOption.IsSet) + writer.WriteString("installmentPaymentData.option[itemNr].firstInstallmentAmount", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInstallmentFeeOption.IsSet) + writer.WriteString("installmentPaymentData.option[itemNr].installmentFee", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInstallmentFee); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInterestRateOption.IsSet) + writer.WriteString("installmentPaymentData.option[itemNr].interestRate", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInterestRate); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallmentsOption.IsSet) + writer.WriteString("installmentPaymentData.option[itemNr].maximumNumberOfInstallments", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallmentsOption.IsSet) + writer.WriteString("installmentPaymentData.option[itemNr].minimumNumberOfInstallments", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrNumberOfInstallmentsOption.IsSet) + writer.WriteString("installmentPaymentData.option[itemNr].numberOfInstallments", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrNumberOfInstallments); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmountOption.IsSet) + writer.WriteString("installmentPaymentData.option[itemNr].subsequentInstallmentAmount", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrTotalAmountDueOption.IsSet) + writer.WriteString("installmentPaymentData.option[itemNr].totalAmountDue", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrTotalAmountDue); + + if (responseAdditionalDataInstallments.InstallmentPaymentDataPaymentOptionsOption.IsSet) + writer.WriteString("installmentPaymentData.paymentOptions", responseAdditionalDataInstallments.InstallmentPaymentDataPaymentOptions); + + if (responseAdditionalDataInstallments.InstallmentsValueOption.IsSet) + writer.WriteString("installments.value", responseAdditionalDataInstallments.InstallmentsValue); } } - } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs b/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs index e97413b9f..6ec70e728 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,56 +14,78 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataNetworkTokens /// - [DataContract(Name = "ResponseAdditionalDataNetworkTokens")] - public partial class ResponseAdditionalDataNetworkTokens : IEquatable, IValidatableObject + public partial class ResponseAdditionalDataNetworkTokens : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Indicates whether a network token is available for the specified card.. - /// The Bank Identification Number of a tokenized card, which is the first six digits of a card number.. - /// The last four digits of a network token.. - public ResponseAdditionalDataNetworkTokens(string networkTokenAvailable = default(string), string networkTokenBin = default(string), string networkTokenTokenSummary = default(string)) + /// Indicates whether a network token is available for the specified card. + /// The Bank Identification Number of a tokenized card, which is the first six digits of a card number. + /// The last four digits of a network token. + [JsonConstructor] + public ResponseAdditionalDataNetworkTokens(Option networkTokenAvailable = default, Option networkTokenBin = default, Option networkTokenTokenSummary = default) { - this.NetworkTokenAvailable = networkTokenAvailable; - this.NetworkTokenBin = networkTokenBin; - this.NetworkTokenTokenSummary = networkTokenTokenSummary; + NetworkTokenAvailableOption = networkTokenAvailable; + NetworkTokenBinOption = networkTokenBin; + NetworkTokenTokenSummaryOption = networkTokenTokenSummary; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of NetworkTokenAvailable + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NetworkTokenAvailableOption { get; private set; } + /// /// Indicates whether a network token is available for the specified card. /// /// Indicates whether a network token is available for the specified card. - [DataMember(Name = "networkToken.available", EmitDefaultValue = false)] - public string NetworkTokenAvailable { get; set; } + [JsonPropertyName("networkToken.available")] + public string NetworkTokenAvailable { get { return this.NetworkTokenAvailableOption; } set { this.NetworkTokenAvailableOption = new Option(value); } } + + /// + /// Used to track the state of NetworkTokenBin + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NetworkTokenBinOption { get; private set; } /// /// The Bank Identification Number of a tokenized card, which is the first six digits of a card number. /// /// The Bank Identification Number of a tokenized card, which is the first six digits of a card number. - [DataMember(Name = "networkToken.bin", EmitDefaultValue = false)] - public string NetworkTokenBin { get; set; } + [JsonPropertyName("networkToken.bin")] + public string NetworkTokenBin { get { return this.NetworkTokenBinOption; } set { this.NetworkTokenBinOption = new Option(value); } } + + /// + /// Used to track the state of NetworkTokenTokenSummary + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NetworkTokenTokenSummaryOption { get; private set; } /// /// The last four digits of a network token. /// /// The last four digits of a network token. - [DataMember(Name = "networkToken.tokenSummary", EmitDefaultValue = false)] - public string NetworkTokenTokenSummary { get; set; } + [JsonPropertyName("networkToken.tokenSummary")] + public string NetworkTokenTokenSummary { get { return this.NetworkTokenTokenSummaryOption; } set { this.NetworkTokenTokenSummaryOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -82,86 +103,125 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ResponseAdditionalDataNetworkTokensJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ResponseAdditionalDataNetworkTokens Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ResponseAdditionalDataNetworkTokens); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ResponseAdditionalDataNetworkTokens instances are equal - /// - /// Instance of ResponseAdditionalDataNetworkTokens to be compared - /// Boolean - public bool Equals(ResponseAdditionalDataNetworkTokens input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option networkTokenAvailable = default; + Option networkTokenBin = default; + Option networkTokenTokenSummary = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "networkToken.available": + networkTokenAvailable = new Option(utf8JsonReader.GetString()); + break; + case "networkToken.bin": + networkTokenBin = new Option(utf8JsonReader.GetString()); + break; + case "networkToken.tokenSummary": + networkTokenTokenSummary = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.NetworkTokenAvailable == input.NetworkTokenAvailable || - (this.NetworkTokenAvailable != null && - this.NetworkTokenAvailable.Equals(input.NetworkTokenAvailable)) - ) && - ( - this.NetworkTokenBin == input.NetworkTokenBin || - (this.NetworkTokenBin != null && - this.NetworkTokenBin.Equals(input.NetworkTokenBin)) - ) && - ( - this.NetworkTokenTokenSummary == input.NetworkTokenTokenSummary || - (this.NetworkTokenTokenSummary != null && - this.NetworkTokenTokenSummary.Equals(input.NetworkTokenTokenSummary)) - ); + + if (networkTokenAvailable.IsSet && networkTokenAvailable.Value == null) + throw new ArgumentNullException(nameof(networkTokenAvailable), "Property is not nullable for class ResponseAdditionalDataNetworkTokens."); + + if (networkTokenBin.IsSet && networkTokenBin.Value == null) + throw new ArgumentNullException(nameof(networkTokenBin), "Property is not nullable for class ResponseAdditionalDataNetworkTokens."); + + if (networkTokenTokenSummary.IsSet && networkTokenTokenSummary.Value == null) + throw new ArgumentNullException(nameof(networkTokenTokenSummary), "Property is not nullable for class ResponseAdditionalDataNetworkTokens."); + + return new ResponseAdditionalDataNetworkTokens(networkTokenAvailable, networkTokenBin, networkTokenTokenSummary); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataNetworkTokens responseAdditionalDataNetworkTokens, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.NetworkTokenAvailable != null) - { - hashCode = (hashCode * 59) + this.NetworkTokenAvailable.GetHashCode(); - } - if (this.NetworkTokenBin != null) - { - hashCode = (hashCode * 59) + this.NetworkTokenBin.GetHashCode(); - } - if (this.NetworkTokenTokenSummary != null) - { - hashCode = (hashCode * 59) + this.NetworkTokenTokenSummary.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, responseAdditionalDataNetworkTokens, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataNetworkTokens responseAdditionalDataNetworkTokens, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (responseAdditionalDataNetworkTokens.NetworkTokenAvailableOption.IsSet && responseAdditionalDataNetworkTokens.NetworkTokenAvailable == null) + throw new ArgumentNullException(nameof(responseAdditionalDataNetworkTokens.NetworkTokenAvailable), "Property is required for class ResponseAdditionalDataNetworkTokens."); + + if (responseAdditionalDataNetworkTokens.NetworkTokenBinOption.IsSet && responseAdditionalDataNetworkTokens.NetworkTokenBin == null) + throw new ArgumentNullException(nameof(responseAdditionalDataNetworkTokens.NetworkTokenBin), "Property is required for class ResponseAdditionalDataNetworkTokens."); + + if (responseAdditionalDataNetworkTokens.NetworkTokenTokenSummaryOption.IsSet && responseAdditionalDataNetworkTokens.NetworkTokenTokenSummary == null) + throw new ArgumentNullException(nameof(responseAdditionalDataNetworkTokens.NetworkTokenTokenSummary), "Property is required for class ResponseAdditionalDataNetworkTokens."); + + if (responseAdditionalDataNetworkTokens.NetworkTokenAvailableOption.IsSet) + writer.WriteString("networkToken.available", responseAdditionalDataNetworkTokens.NetworkTokenAvailable); + + if (responseAdditionalDataNetworkTokens.NetworkTokenBinOption.IsSet) + writer.WriteString("networkToken.bin", responseAdditionalDataNetworkTokens.NetworkTokenBin); + + if (responseAdditionalDataNetworkTokens.NetworkTokenTokenSummaryOption.IsSet) + writer.WriteString("networkToken.tokenSummary", responseAdditionalDataNetworkTokens.NetworkTokenTokenSummary); } } - } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs b/Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs index 9fd739dcf..88d130844 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,38 +14,46 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataOpi /// - [DataContract(Name = "ResponseAdditionalDataOpi")] - public partial class ResponseAdditionalDataOpi : IEquatable, IValidatableObject + public partial class ResponseAdditionalDataOpi : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Returned in the response if you included `opi.includeTransToken: true` in an ecommerce payment request. This contains an Oracle Payment Interface token that you can store in your Oracle Opera database to identify tokenized ecommerce transactions. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce).. - public ResponseAdditionalDataOpi(string opiTransToken = default(string)) + /// Returned in the response if you included `opi.includeTransToken: true` in an ecommerce payment request. This contains an Oracle Payment Interface token that you can store in your Oracle Opera database to identify tokenized ecommerce transactions. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). + [JsonConstructor] + public ResponseAdditionalDataOpi(Option opiTransToken = default) { - this.OpiTransToken = opiTransToken; + OpiTransTokenOption = opiTransToken; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of OpiTransToken + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpiTransTokenOption { get; private set; } + /// /// Returned in the response if you included `opi.includeTransToken: true` in an ecommerce payment request. This contains an Oracle Payment Interface token that you can store in your Oracle Opera database to identify tokenized ecommerce transactions. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). /// /// Returned in the response if you included `opi.includeTransToken: true` in an ecommerce payment request. This contains an Oracle Payment Interface token that you can store in your Oracle Opera database to identify tokenized ecommerce transactions. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). - [DataMember(Name = "opi.transToken", EmitDefaultValue = false)] - public string OpiTransToken { get; set; } + [JsonPropertyName("opi.transToken")] + public string OpiTransToken { get { return this.OpiTransTokenOption; } set { this.OpiTransTokenOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -62,68 +69,99 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ResponseAdditionalDataOpiJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ResponseAdditionalDataOpi Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ResponseAdditionalDataOpi); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ResponseAdditionalDataOpi instances are equal - /// - /// Instance of ResponseAdditionalDataOpi to be compared - /// Boolean - public bool Equals(ResponseAdditionalDataOpi input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option opiTransToken = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "opi.transToken": + opiTransToken = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.OpiTransToken == input.OpiTransToken || - (this.OpiTransToken != null && - this.OpiTransToken.Equals(input.OpiTransToken)) - ); + + if (opiTransToken.IsSet && opiTransToken.Value == null) + throw new ArgumentNullException(nameof(opiTransToken), "Property is not nullable for class ResponseAdditionalDataOpi."); + + return new ResponseAdditionalDataOpi(opiTransToken); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataOpi responseAdditionalDataOpi, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.OpiTransToken != null) - { - hashCode = (hashCode * 59) + this.OpiTransToken.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, responseAdditionalDataOpi, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataOpi responseAdditionalDataOpi, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (responseAdditionalDataOpi.OpiTransTokenOption.IsSet && responseAdditionalDataOpi.OpiTransToken == null) + throw new ArgumentNullException(nameof(responseAdditionalDataOpi.OpiTransToken), "Property is required for class ResponseAdditionalDataOpi."); + + if (responseAdditionalDataOpi.OpiTransTokenOption.IsSet) + writer.WriteString("opi.transToken", responseAdditionalDataOpi.OpiTransToken); } } - } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs b/Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs index 5144c6cef..9f0f49c21 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,56 +14,78 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataSepa /// - [DataContract(Name = "ResponseAdditionalDataSepa")] - public partial class ResponseAdditionalDataSepa : IEquatable, IValidatableObject + public partial class ResponseAdditionalDataSepa : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The transaction signature date. Format: yyyy-MM-dd. - /// Its value corresponds to the pspReference value of the transaction.. - /// This field can take one of the following values: * OneOff: (OOFF) Direct debit instruction to initiate exactly one direct debit transaction. * First: (FRST) Initial/first collection in a series of direct debit instructions. * Recurring: (RCUR) Direct debit instruction to carry out regular direct debit transactions initiated by the creditor. * Final: (FNAL) Last/final collection in a series of direct debit instructions. Example: OOFF. - public ResponseAdditionalDataSepa(string sepadirectdebitDateOfSignature = default(string), string sepadirectdebitMandateId = default(string), string sepadirectdebitSequenceType = default(string)) + /// The transaction signature date. Format: yyyy-MM-dd + /// Its value corresponds to the pspReference value of the transaction. + /// This field can take one of the following values: * OneOff: (OOFF) Direct debit instruction to initiate exactly one direct debit transaction. * First: (FRST) Initial/first collection in a series of direct debit instructions. * Recurring: (RCUR) Direct debit instruction to carry out regular direct debit transactions initiated by the creditor. * Final: (FNAL) Last/final collection in a series of direct debit instructions. Example: OOFF + [JsonConstructor] + public ResponseAdditionalDataSepa(Option sepadirectdebitDateOfSignature = default, Option sepadirectdebitMandateId = default, Option sepadirectdebitSequenceType = default) { - this.SepadirectdebitDateOfSignature = sepadirectdebitDateOfSignature; - this.SepadirectdebitMandateId = sepadirectdebitMandateId; - this.SepadirectdebitSequenceType = sepadirectdebitSequenceType; + SepadirectdebitDateOfSignatureOption = sepadirectdebitDateOfSignature; + SepadirectdebitMandateIdOption = sepadirectdebitMandateId; + SepadirectdebitSequenceTypeOption = sepadirectdebitSequenceType; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of SepadirectdebitDateOfSignature + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SepadirectdebitDateOfSignatureOption { get; private set; } + /// /// The transaction signature date. Format: yyyy-MM-dd /// /// The transaction signature date. Format: yyyy-MM-dd - [DataMember(Name = "sepadirectdebit.dateOfSignature", EmitDefaultValue = false)] - public string SepadirectdebitDateOfSignature { get; set; } + [JsonPropertyName("sepadirectdebit.dateOfSignature")] + public string SepadirectdebitDateOfSignature { get { return this.SepadirectdebitDateOfSignatureOption; } set { this.SepadirectdebitDateOfSignatureOption = new Option(value); } } + + /// + /// Used to track the state of SepadirectdebitMandateId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SepadirectdebitMandateIdOption { get; private set; } /// /// Its value corresponds to the pspReference value of the transaction. /// /// Its value corresponds to the pspReference value of the transaction. - [DataMember(Name = "sepadirectdebit.mandateId", EmitDefaultValue = false)] - public string SepadirectdebitMandateId { get; set; } + [JsonPropertyName("sepadirectdebit.mandateId")] + public string SepadirectdebitMandateId { get { return this.SepadirectdebitMandateIdOption; } set { this.SepadirectdebitMandateIdOption = new Option(value); } } + + /// + /// Used to track the state of SepadirectdebitSequenceType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SepadirectdebitSequenceTypeOption { get; private set; } /// /// This field can take one of the following values: * OneOff: (OOFF) Direct debit instruction to initiate exactly one direct debit transaction. * First: (FRST) Initial/first collection in a series of direct debit instructions. * Recurring: (RCUR) Direct debit instruction to carry out regular direct debit transactions initiated by the creditor. * Final: (FNAL) Last/final collection in a series of direct debit instructions. Example: OOFF /// /// This field can take one of the following values: * OneOff: (OOFF) Direct debit instruction to initiate exactly one direct debit transaction. * First: (FRST) Initial/first collection in a series of direct debit instructions. * Recurring: (RCUR) Direct debit instruction to carry out regular direct debit transactions initiated by the creditor. * Final: (FNAL) Last/final collection in a series of direct debit instructions. Example: OOFF - [DataMember(Name = "sepadirectdebit.sequenceType", EmitDefaultValue = false)] - public string SepadirectdebitSequenceType { get; set; } + [JsonPropertyName("sepadirectdebit.sequenceType")] + public string SepadirectdebitSequenceType { get { return this.SepadirectdebitSequenceTypeOption; } set { this.SepadirectdebitSequenceTypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -82,86 +103,125 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ResponseAdditionalDataSepaJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ResponseAdditionalDataSepa Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ResponseAdditionalDataSepa); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ResponseAdditionalDataSepa instances are equal - /// - /// Instance of ResponseAdditionalDataSepa to be compared - /// Boolean - public bool Equals(ResponseAdditionalDataSepa input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option sepadirectdebitDateOfSignature = default; + Option sepadirectdebitMandateId = default; + Option sepadirectdebitSequenceType = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "sepadirectdebit.dateOfSignature": + sepadirectdebitDateOfSignature = new Option(utf8JsonReader.GetString()); + break; + case "sepadirectdebit.mandateId": + sepadirectdebitMandateId = new Option(utf8JsonReader.GetString()); + break; + case "sepadirectdebit.sequenceType": + sepadirectdebitSequenceType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.SepadirectdebitDateOfSignature == input.SepadirectdebitDateOfSignature || - (this.SepadirectdebitDateOfSignature != null && - this.SepadirectdebitDateOfSignature.Equals(input.SepadirectdebitDateOfSignature)) - ) && - ( - this.SepadirectdebitMandateId == input.SepadirectdebitMandateId || - (this.SepadirectdebitMandateId != null && - this.SepadirectdebitMandateId.Equals(input.SepadirectdebitMandateId)) - ) && - ( - this.SepadirectdebitSequenceType == input.SepadirectdebitSequenceType || - (this.SepadirectdebitSequenceType != null && - this.SepadirectdebitSequenceType.Equals(input.SepadirectdebitSequenceType)) - ); + + if (sepadirectdebitDateOfSignature.IsSet && sepadirectdebitDateOfSignature.Value == null) + throw new ArgumentNullException(nameof(sepadirectdebitDateOfSignature), "Property is not nullable for class ResponseAdditionalDataSepa."); + + if (sepadirectdebitMandateId.IsSet && sepadirectdebitMandateId.Value == null) + throw new ArgumentNullException(nameof(sepadirectdebitMandateId), "Property is not nullable for class ResponseAdditionalDataSepa."); + + if (sepadirectdebitSequenceType.IsSet && sepadirectdebitSequenceType.Value == null) + throw new ArgumentNullException(nameof(sepadirectdebitSequenceType), "Property is not nullable for class ResponseAdditionalDataSepa."); + + return new ResponseAdditionalDataSepa(sepadirectdebitDateOfSignature, sepadirectdebitMandateId, sepadirectdebitSequenceType); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataSepa responseAdditionalDataSepa, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.SepadirectdebitDateOfSignature != null) - { - hashCode = (hashCode * 59) + this.SepadirectdebitDateOfSignature.GetHashCode(); - } - if (this.SepadirectdebitMandateId != null) - { - hashCode = (hashCode * 59) + this.SepadirectdebitMandateId.GetHashCode(); - } - if (this.SepadirectdebitSequenceType != null) - { - hashCode = (hashCode * 59) + this.SepadirectdebitSequenceType.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, responseAdditionalDataSepa, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataSepa responseAdditionalDataSepa, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (responseAdditionalDataSepa.SepadirectdebitDateOfSignatureOption.IsSet && responseAdditionalDataSepa.SepadirectdebitDateOfSignature == null) + throw new ArgumentNullException(nameof(responseAdditionalDataSepa.SepadirectdebitDateOfSignature), "Property is required for class ResponseAdditionalDataSepa."); + + if (responseAdditionalDataSepa.SepadirectdebitMandateIdOption.IsSet && responseAdditionalDataSepa.SepadirectdebitMandateId == null) + throw new ArgumentNullException(nameof(responseAdditionalDataSepa.SepadirectdebitMandateId), "Property is required for class ResponseAdditionalDataSepa."); + + if (responseAdditionalDataSepa.SepadirectdebitSequenceTypeOption.IsSet && responseAdditionalDataSepa.SepadirectdebitSequenceType == null) + throw new ArgumentNullException(nameof(responseAdditionalDataSepa.SepadirectdebitSequenceType), "Property is required for class ResponseAdditionalDataSepa."); + + if (responseAdditionalDataSepa.SepadirectdebitDateOfSignatureOption.IsSet) + writer.WriteString("sepadirectdebit.dateOfSignature", responseAdditionalDataSepa.SepadirectdebitDateOfSignature); + + if (responseAdditionalDataSepa.SepadirectdebitMandateIdOption.IsSet) + writer.WriteString("sepadirectdebit.mandateId", responseAdditionalDataSepa.SepadirectdebitMandateId); + + if (responseAdditionalDataSepa.SepadirectdebitSequenceTypeOption.IsSet) + writer.WriteString("sepadirectdebit.sequenceType", responseAdditionalDataSepa.SepadirectdebitSequenceType); } } - } diff --git a/Adyen/Model/Checkout/ResponsePaymentMethod.cs b/Adyen/Model/Checkout/ResponsePaymentMethod.cs index 075e3ae29..448533127 100644 --- a/Adyen/Model/Checkout/ResponsePaymentMethod.cs +++ b/Adyen/Model/Checkout/ResponsePaymentMethod.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,47 +14,62 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ResponsePaymentMethod /// - [DataContract(Name = "ResponsePaymentMethod")] - public partial class ResponsePaymentMethod : IEquatable, IValidatableObject + public partial class ResponsePaymentMethod : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The card brand that the shopper used to pay. Only returned if `paymentMethod.type` is **scheme**.. - /// The `paymentMethod.type` value used in the request.. - public ResponsePaymentMethod(string brand = default(string), string type = default(string)) + /// The card brand that the shopper used to pay. Only returned if `paymentMethod.type` is **scheme**. + /// The `paymentMethod.type` value used in the request. + [JsonConstructor] + public ResponsePaymentMethod(Option brand = default, Option type = default) { - this.Brand = brand; - this.Type = type; + BrandOption = brand; + TypeOption = type; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Brand + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandOption { get; private set; } + /// /// The card brand that the shopper used to pay. Only returned if `paymentMethod.type` is **scheme**. /// /// The card brand that the shopper used to pay. Only returned if `paymentMethod.type` is **scheme**. - [DataMember(Name = "brand", EmitDefaultValue = false)] - public string Brand { get; set; } + [JsonPropertyName("brand")] + public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The `paymentMethod.type` value used in the request. /// /// The `paymentMethod.type` value used in the request. - [DataMember(Name = "type", EmitDefaultValue = false)] - public string Type { get; set; } + [JsonPropertyName("type")] + public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -72,77 +86,112 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ResponsePaymentMethodJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ResponsePaymentMethod Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ResponsePaymentMethod); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ResponsePaymentMethod instances are equal - /// - /// Instance of ResponsePaymentMethod to be compared - /// Boolean - public bool Equals(ResponsePaymentMethod input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option brand = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "brand": + brand = new Option(utf8JsonReader.GetString()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Brand == input.Brand || - (this.Brand != null && - this.Brand.Equals(input.Brand)) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ); + + if (brand.IsSet && brand.Value == null) + throw new ArgumentNullException(nameof(brand), "Property is not nullable for class ResponsePaymentMethod."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class ResponsePaymentMethod."); + + return new ResponsePaymentMethod(brand, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ResponsePaymentMethod responsePaymentMethod, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Brand != null) - { - hashCode = (hashCode * 59) + this.Brand.GetHashCode(); - } - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, responsePaymentMethod, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ResponsePaymentMethod responsePaymentMethod, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (responsePaymentMethod.BrandOption.IsSet && responsePaymentMethod.Brand == null) + throw new ArgumentNullException(nameof(responsePaymentMethod.Brand), "Property is required for class ResponsePaymentMethod."); + + if (responsePaymentMethod.TypeOption.IsSet && responsePaymentMethod.Type == null) + throw new ArgumentNullException(nameof(responsePaymentMethod.Type), "Property is required for class ResponsePaymentMethod."); + + if (responsePaymentMethod.BrandOption.IsSet) + writer.WriteString("brand", responsePaymentMethod.Brand); + + if (responsePaymentMethod.TypeOption.IsSet) + writer.WriteString("type", responsePaymentMethod.Type); } } - } diff --git a/Adyen/Model/Checkout/RiskData.cs b/Adyen/Model/Checkout/RiskData.cs index d24cacd18..451b492b5 100644 --- a/Adyen/Model/Checkout/RiskData.cs +++ b/Adyen/Model/Checkout/RiskData.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,65 +14,94 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// RiskData /// - [DataContract(Name = "RiskData")] - public partial class RiskData : IEquatable, IValidatableObject + public partial class RiskData : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Contains client-side data, like the device fingerprint, cookies, and specific browser settings.. - /// Any custom fields used as part of the input to configured risk rules.. - /// An integer value that is added to the normal fraud score. The value can be either positive or negative.. - /// The risk profile to assign to this payment. When left empty, the merchant-level account's default risk profile will be applied.. - public RiskData(string clientData = default(string), Dictionary customFields = default(Dictionary), int? fraudOffset = default(int?), string profileReference = default(string)) + /// Contains client-side data, like the device fingerprint, cookies, and specific browser settings. + /// Any custom fields used as part of the input to configured risk rules. + /// An integer value that is added to the normal fraud score. The value can be either positive or negative. + /// The risk profile to assign to this payment. When left empty, the merchant-level account's default risk profile will be applied. + [JsonConstructor] + public RiskData(Option clientData = default, Option> customFields = default, Option fraudOffset = default, Option profileReference = default) { - this.ClientData = clientData; - this.CustomFields = customFields; - this.FraudOffset = fraudOffset; - this.ProfileReference = profileReference; + ClientDataOption = clientData; + CustomFieldsOption = customFields; + FraudOffsetOption = fraudOffset; + ProfileReferenceOption = profileReference; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of ClientData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ClientDataOption { get; private set; } + /// /// Contains client-side data, like the device fingerprint, cookies, and specific browser settings. /// /// Contains client-side data, like the device fingerprint, cookies, and specific browser settings. - [DataMember(Name = "clientData", EmitDefaultValue = false)] - public string ClientData { get; set; } + [JsonPropertyName("clientData")] + public string ClientData { get { return this.ClientDataOption; } set { this.ClientDataOption = new Option(value); } } + + /// + /// Used to track the state of CustomFields + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> CustomFieldsOption { get; private set; } /// /// Any custom fields used as part of the input to configured risk rules. /// /// Any custom fields used as part of the input to configured risk rules. - [DataMember(Name = "customFields", EmitDefaultValue = false)] - public Dictionary CustomFields { get; set; } + [JsonPropertyName("customFields")] + public Dictionary CustomFields { get { return this.CustomFieldsOption; } set { this.CustomFieldsOption = new Option>(value); } } + + /// + /// Used to track the state of FraudOffset + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FraudOffsetOption { get; private set; } /// /// An integer value that is added to the normal fraud score. The value can be either positive or negative. /// /// An integer value that is added to the normal fraud score. The value can be either positive or negative. - [DataMember(Name = "fraudOffset", EmitDefaultValue = false)] - public int? FraudOffset { get; set; } + [JsonPropertyName("fraudOffset")] + public int? FraudOffset { get { return this.FraudOffsetOption; } set { this.FraudOffsetOption = new Option(value); } } + + /// + /// Used to track the state of ProfileReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ProfileReferenceOption { get; private set; } /// /// The risk profile to assign to this payment. When left empty, the merchant-level account's default risk profile will be applied. /// /// The risk profile to assign to this payment. When left empty, the merchant-level account's default risk profile will be applied. - [DataMember(Name = "profileReference", EmitDefaultValue = false)] - public string ProfileReference { get; set; } + [JsonPropertyName("profileReference")] + public string ProfileReference { get { return this.ProfileReferenceOption; } set { this.ProfileReferenceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -92,98 +120,145 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // ClientData (string) maxLength + if (this.ClientData != null && this.ClientData.Length > 5000) + { + yield return new ValidationResult("Invalid value for ClientData, length must be less than 5000.", new [] { "ClientData" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as RiskData); + yield break; } + } + /// + /// A Json converter for type + /// + public class RiskDataJsonConverter : JsonConverter + { /// - /// Returns true if RiskData instances are equal + /// Deserializes json to /// - /// Instance of RiskData to be compared - /// Boolean - public bool Equals(RiskData input) + /// + /// + /// + /// + /// + public override RiskData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option clientData = default; + Option> customFields = default; + Option fraudOffset = default; + Option profileReference = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "clientData": + clientData = new Option(utf8JsonReader.GetString()); + break; + case "customFields": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + customFields = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "fraudOffset": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + fraudOffset = new Option(utf8JsonReader.GetInt32()); + break; + case "profileReference": + profileReference = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.ClientData == input.ClientData || - (this.ClientData != null && - this.ClientData.Equals(input.ClientData)) - ) && - ( - this.CustomFields == input.CustomFields || - this.CustomFields != null && - input.CustomFields != null && - this.CustomFields.SequenceEqual(input.CustomFields) - ) && - ( - this.FraudOffset == input.FraudOffset || - this.FraudOffset.Equals(input.FraudOffset) - ) && - ( - this.ProfileReference == input.ProfileReference || - (this.ProfileReference != null && - this.ProfileReference.Equals(input.ProfileReference)) - ); + + if (clientData.IsSet && clientData.Value == null) + throw new ArgumentNullException(nameof(clientData), "Property is not nullable for class RiskData."); + + if (customFields.IsSet && customFields.Value == null) + throw new ArgumentNullException(nameof(customFields), "Property is not nullable for class RiskData."); + + if (fraudOffset.IsSet && fraudOffset.Value == null) + throw new ArgumentNullException(nameof(fraudOffset), "Property is not nullable for class RiskData."); + + if (profileReference.IsSet && profileReference.Value == null) + throw new ArgumentNullException(nameof(profileReference), "Property is not nullable for class RiskData."); + + return new RiskData(clientData, customFields, fraudOffset, profileReference); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RiskData riskData, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ClientData != null) - { - hashCode = (hashCode * 59) + this.ClientData.GetHashCode(); - } - if (this.CustomFields != null) - { - hashCode = (hashCode * 59) + this.CustomFields.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FraudOffset.GetHashCode(); - if (this.ProfileReference != null) - { - hashCode = (hashCode * 59) + this.ProfileReference.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, riskData, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, RiskData riskData, JsonSerializerOptions jsonSerializerOptions) { - // ClientData (string) maxLength - if (this.ClientData != null && this.ClientData.Length > 5000) + if (riskData.ClientDataOption.IsSet && riskData.ClientData == null) + throw new ArgumentNullException(nameof(riskData.ClientData), "Property is required for class RiskData."); + + if (riskData.CustomFieldsOption.IsSet && riskData.CustomFields == null) + throw new ArgumentNullException(nameof(riskData.CustomFields), "Property is required for class RiskData."); + + if (riskData.ProfileReferenceOption.IsSet && riskData.ProfileReference == null) + throw new ArgumentNullException(nameof(riskData.ProfileReference), "Property is required for class RiskData."); + + if (riskData.ClientDataOption.IsSet) + writer.WriteString("clientData", riskData.ClientData); + + if (riskData.CustomFieldsOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ClientData, length must be less than 5000.", new [] { "ClientData" }); + writer.WritePropertyName("customFields"); + JsonSerializer.Serialize(writer, riskData.CustomFields, jsonSerializerOptions); } + if (riskData.FraudOffsetOption.IsSet) + writer.WriteNumber("fraudOffset", riskData.FraudOffsetOption.Value.Value); - yield break; + if (riskData.ProfileReferenceOption.IsSet) + writer.WriteString("profileReference", riskData.ProfileReference); } } - } diff --git a/Adyen/Model/Checkout/RivertyDetails.cs b/Adyen/Model/Checkout/RivertyDetails.cs index dc6f32dfe..7f196cb59 100644 --- a/Adyen/Model/Checkout/RivertyDetails.cs +++ b/Adyen/Model/Checkout/RivertyDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,143 +14,249 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// RivertyDetails /// - [DataContract(Name = "RivertyDetails")] - public partial class RivertyDetails : IEquatable, IValidatableObject + public partial class RivertyDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The address where to send the invoice. + /// The checkout attempt identifier. + /// The address where the goods should be delivered. + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + /// The iban number of the customer + /// Shopper name, date of birth, phone number, and email address. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **riverty** (default to TypeEnum.Riverty) + [JsonConstructor] + public RivertyDetails(Option billingAddress = default, Option checkoutAttemptId = default, Option deliveryAddress = default, Option deviceFingerprint = default, Option iban = default, Option personalDetails = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.Riverty) + { + BillingAddressOption = billingAddress; + CheckoutAttemptIdOption = checkoutAttemptId; + DeliveryAddressOption = deliveryAddress; + DeviceFingerprintOption = deviceFingerprint; + IbanOption = iban; + PersonalDetailsOption = personalDetails; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + Type = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **riverty** /// /// **riverty** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Riverty for value: riverty /// - [EnumMember(Value = "riverty")] Riverty = 1, /// /// Enum RivertyAccount for value: riverty_account /// - [EnumMember(Value = "riverty_account")] RivertyAccount = 2, /// /// Enum SepadirectdebitRiverty for value: sepadirectdebit_riverty /// - [EnumMember(Value = "sepadirectdebit_riverty")] SepadirectdebitRiverty = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("riverty")) + return TypeEnum.Riverty; + + if (value.Equals("riverty_account")) + return TypeEnum.RivertyAccount; + if (value.Equals("sepadirectdebit_riverty")) + return TypeEnum.SepadirectdebitRiverty; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("riverty")) + return TypeEnum.Riverty; + + if (value.Equals("riverty_account")) + return TypeEnum.RivertyAccount; + + if (value.Equals("sepadirectdebit_riverty")) + return TypeEnum.SepadirectdebitRiverty; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.Riverty) + return "riverty"; + + if (value == TypeEnum.RivertyAccount) + return "riverty_account"; + + if (value == TypeEnum.SepadirectdebitRiverty) + return "sepadirectdebit_riverty"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **riverty** /// /// **riverty** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected RivertyDetails() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of BillingAddress /// - /// The address where to send the invoice.. - /// The checkout attempt identifier.. - /// The address where the goods should be delivered.. - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting).. - /// The iban number of the customer . - /// Shopper name, date of birth, phone number, and email address.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **riverty** (required) (default to TypeEnum.Riverty). - public RivertyDetails(string billingAddress = default(string), string checkoutAttemptId = default(string), string deliveryAddress = default(string), string deviceFingerprint = default(string), string iban = default(string), string personalDetails = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.Riverty) - { - this.Type = type; - this.BillingAddress = billingAddress; - this.CheckoutAttemptId = checkoutAttemptId; - this.DeliveryAddress = deliveryAddress; - this.DeviceFingerprint = deviceFingerprint; - this.Iban = iban; - this.PersonalDetails = personalDetails; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BillingAddressOption { get; private set; } /// /// The address where to send the invoice. /// /// The address where to send the invoice. - [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - public string BillingAddress { get; set; } + [JsonPropertyName("billingAddress")] + public string BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of DeliveryAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeliveryAddressOption { get; private set; } /// /// The address where the goods should be delivered. /// /// The address where the goods should be delivered. - [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] - public string DeliveryAddress { get; set; } + [JsonPropertyName("deliveryAddress")] + public string DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } + + /// + /// Used to track the state of DeviceFingerprint + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeviceFingerprintOption { get; private set; } /// /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). /// /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - [DataMember(Name = "deviceFingerprint", EmitDefaultValue = false)] - public string DeviceFingerprint { get; set; } + [JsonPropertyName("deviceFingerprint")] + public string DeviceFingerprint { get { return this.DeviceFingerprintOption; } set { this.DeviceFingerprintOption = new Option(value); } } + + /// + /// Used to track the state of Iban + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IbanOption { get; private set; } /// /// The iban number of the customer /// /// The iban number of the customer - [DataMember(Name = "iban", EmitDefaultValue = false)] - public string Iban { get; set; } + [JsonPropertyName("iban")] + public string Iban { get { return this.IbanOption; } set { this.IbanOption = new Option(value); } } + + /// + /// Used to track the state of PersonalDetails + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PersonalDetailsOption { get; private set; } /// /// Shopper name, date of birth, phone number, and email address. /// /// Shopper name, date of birth, phone number, and email address. - [DataMember(Name = "personalDetails", EmitDefaultValue = false)] - public string PersonalDetails { get; set; } + [JsonPropertyName("personalDetails")] + public string PersonalDetails { get { return this.PersonalDetailsOption; } set { this.PersonalDetailsOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -174,155 +279,224 @@ public override string ToString() return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as RivertyDetails); - } - - /// - /// Returns true if RivertyDetails instances are equal - /// - /// Instance of RivertyDetails to be compared - /// Boolean - public bool Equals(RivertyDetails input) - { - if (input == null) - { - return false; - } - return - ( - this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) - ) && - ( - this.DeviceFingerprint == input.DeviceFingerprint || - (this.DeviceFingerprint != null && - this.DeviceFingerprint.Equals(input.DeviceFingerprint)) - ) && - ( - this.Iban == input.Iban || - (this.Iban != null && - this.Iban.Equals(input.Iban)) - ) && - ( - this.PersonalDetails == input.PersonalDetails || - (this.PersonalDetails != null && - this.PersonalDetails.Equals(input.PersonalDetails)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BillingAddress != null) - { - hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.DeliveryAddress != null) - { - hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); - } - if (this.DeviceFingerprint != null) - { - hashCode = (hashCode * 59) + this.DeviceFingerprint.GetHashCode(); - } - if (this.Iban != null) - { - hashCode = (hashCode * 59) + this.Iban.GetHashCode(); - } - if (this.PersonalDetails != null) - { - hashCode = (hashCode * 59) + this.PersonalDetails.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // DeviceFingerprint (string) maxLength if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); + yield return new ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); } // Iban (string) maxLength if (this.Iban != null && this.Iban.Length > 34) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Iban, length must be less than 34.", new [] { "Iban" }); + yield return new ValidationResult("Invalid value for Iban, length must be less than 34.", new [] { "Iban" }); } // StoredPaymentMethodId (string) maxLength if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); } yield break; } } + /// + /// A Json converter for type + /// + public class RivertyDetailsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RivertyDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option billingAddress = default; + Option checkoutAttemptId = default; + Option deliveryAddress = default; + Option deviceFingerprint = default; + Option iban = default; + Option personalDetails = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "billingAddress": + billingAddress = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "deliveryAddress": + deliveryAddress = new Option(utf8JsonReader.GetString()); + break; + case "deviceFingerprint": + deviceFingerprint = new Option(utf8JsonReader.GetString()); + break; + case "iban": + iban = new Option(utf8JsonReader.GetString()); + break; + case "personalDetails": + personalDetails = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(RivertyDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } + } + + if (!type.IsSet) + throw new ArgumentException("Property is required for class RivertyDetails.", nameof(type)); + + if (billingAddress.IsSet && billingAddress.Value == null) + throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class RivertyDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class RivertyDetails."); + + if (deliveryAddress.IsSet && deliveryAddress.Value == null) + throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class RivertyDetails."); + + if (deviceFingerprint.IsSet && deviceFingerprint.Value == null) + throw new ArgumentNullException(nameof(deviceFingerprint), "Property is not nullable for class RivertyDetails."); + + if (iban.IsSet && iban.Value == null) + throw new ArgumentNullException(nameof(iban), "Property is not nullable for class RivertyDetails."); + + if (personalDetails.IsSet && personalDetails.Value == null) + throw new ArgumentNullException(nameof(personalDetails), "Property is not nullable for class RivertyDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class RivertyDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class RivertyDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class RivertyDetails."); + + return new RivertyDetails(billingAddress, checkoutAttemptId, deliveryAddress, deviceFingerprint, iban, personalDetails, recurringDetailReference, storedPaymentMethodId, type.Value.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RivertyDetails rivertyDetails, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, rivertyDetails, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, RivertyDetails rivertyDetails, JsonSerializerOptions jsonSerializerOptions) + { + if (rivertyDetails.BillingAddressOption.IsSet && rivertyDetails.BillingAddress == null) + throw new ArgumentNullException(nameof(rivertyDetails.BillingAddress), "Property is required for class RivertyDetails."); + + if (rivertyDetails.CheckoutAttemptIdOption.IsSet && rivertyDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(rivertyDetails.CheckoutAttemptId), "Property is required for class RivertyDetails."); + + if (rivertyDetails.DeliveryAddressOption.IsSet && rivertyDetails.DeliveryAddress == null) + throw new ArgumentNullException(nameof(rivertyDetails.DeliveryAddress), "Property is required for class RivertyDetails."); + + if (rivertyDetails.DeviceFingerprintOption.IsSet && rivertyDetails.DeviceFingerprint == null) + throw new ArgumentNullException(nameof(rivertyDetails.DeviceFingerprint), "Property is required for class RivertyDetails."); + + if (rivertyDetails.IbanOption.IsSet && rivertyDetails.Iban == null) + throw new ArgumentNullException(nameof(rivertyDetails.Iban), "Property is required for class RivertyDetails."); + + if (rivertyDetails.PersonalDetailsOption.IsSet && rivertyDetails.PersonalDetails == null) + throw new ArgumentNullException(nameof(rivertyDetails.PersonalDetails), "Property is required for class RivertyDetails."); + + if (rivertyDetails.RecurringDetailReferenceOption.IsSet && rivertyDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(rivertyDetails.RecurringDetailReference), "Property is required for class RivertyDetails."); + + if (rivertyDetails.StoredPaymentMethodIdOption.IsSet && rivertyDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(rivertyDetails.StoredPaymentMethodId), "Property is required for class RivertyDetails."); + + if (rivertyDetails.BillingAddressOption.IsSet) + writer.WriteString("billingAddress", rivertyDetails.BillingAddress); + + if (rivertyDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", rivertyDetails.CheckoutAttemptId); + + if (rivertyDetails.DeliveryAddressOption.IsSet) + writer.WriteString("deliveryAddress", rivertyDetails.DeliveryAddress); + + if (rivertyDetails.DeviceFingerprintOption.IsSet) + writer.WriteString("deviceFingerprint", rivertyDetails.DeviceFingerprint); + + if (rivertyDetails.IbanOption.IsSet) + writer.WriteString("iban", rivertyDetails.Iban); + + if (rivertyDetails.PersonalDetailsOption.IsSet) + writer.WriteString("personalDetails", rivertyDetails.PersonalDetails); + + if (rivertyDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", rivertyDetails.RecurringDetailReference); + + if (rivertyDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", rivertyDetails.StoredPaymentMethodId); + + var typeRawValue = RivertyDetails.TypeEnumToJsonValue(rivertyDetails.Type); + writer.WriteString("type", typeRawValue); + } + } } diff --git a/Adyen/Model/Checkout/SDKEphemPubKey.cs b/Adyen/Model/Checkout/SDKEphemPubKey.cs index b8e7c7c98..97357ee21 100644 --- a/Adyen/Model/Checkout/SDKEphemPubKey.cs +++ b/Adyen/Model/Checkout/SDKEphemPubKey.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,65 +14,94 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// SDKEphemPubKey /// - [DataContract(Name = "SDKEphemPubKey")] - public partial class SDKEphemPubKey : IEquatable, IValidatableObject + public partial class SDKEphemPubKey : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The `crv` value as received from the 3D Secure 2 SDK.. - /// The `kty` value as received from the 3D Secure 2 SDK.. - /// The `x` value as received from the 3D Secure 2 SDK.. - /// The `y` value as received from the 3D Secure 2 SDK.. - public SDKEphemPubKey(string crv = default(string), string kty = default(string), string x = default(string), string y = default(string)) + /// The `crv` value as received from the 3D Secure 2 SDK. + /// The `kty` value as received from the 3D Secure 2 SDK. + /// The `x` value as received from the 3D Secure 2 SDK. + /// The `y` value as received from the 3D Secure 2 SDK. + [JsonConstructor] + public SDKEphemPubKey(Option crv = default, Option kty = default, Option x = default, Option y = default) { - this.Crv = crv; - this.Kty = kty; - this.X = x; - this.Y = y; + CrvOption = crv; + KtyOption = kty; + XOption = x; + YOption = y; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Crv + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CrvOption { get; private set; } + /// /// The `crv` value as received from the 3D Secure 2 SDK. /// /// The `crv` value as received from the 3D Secure 2 SDK. - [DataMember(Name = "crv", EmitDefaultValue = false)] - public string Crv { get; set; } + [JsonPropertyName("crv")] + public string Crv { get { return this.CrvOption; } set { this.CrvOption = new Option(value); } } + + /// + /// Used to track the state of Kty + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option KtyOption { get; private set; } /// /// The `kty` value as received from the 3D Secure 2 SDK. /// /// The `kty` value as received from the 3D Secure 2 SDK. - [DataMember(Name = "kty", EmitDefaultValue = false)] - public string Kty { get; set; } + [JsonPropertyName("kty")] + public string Kty { get { return this.KtyOption; } set { this.KtyOption = new Option(value); } } + + /// + /// Used to track the state of X + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option XOption { get; private set; } /// /// The `x` value as received from the 3D Secure 2 SDK. /// /// The `x` value as received from the 3D Secure 2 SDK. - [DataMember(Name = "x", EmitDefaultValue = false)] - public string X { get; set; } + [JsonPropertyName("x")] + public string X { get { return this.XOption; } set { this.XOption = new Option(value); } } + + /// + /// Used to track the state of Y + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option YOption { get; private set; } /// /// The `y` value as received from the 3D Secure 2 SDK. /// /// The `y` value as received from the 3D Secure 2 SDK. - [DataMember(Name = "y", EmitDefaultValue = false)] - public string Y { get; set; } + [JsonPropertyName("y")] + public string Y { get { return this.YOption; } set { this.YOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -92,95 +120,138 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class SDKEphemPubKeyJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override SDKEphemPubKey Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as SDKEphemPubKey); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if SDKEphemPubKey instances are equal - /// - /// Instance of SDKEphemPubKey to be compared - /// Boolean - public bool Equals(SDKEphemPubKey input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option crv = default; + Option kty = default; + Option x = default; + Option y = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "crv": + crv = new Option(utf8JsonReader.GetString()); + break; + case "kty": + kty = new Option(utf8JsonReader.GetString()); + break; + case "x": + x = new Option(utf8JsonReader.GetString()); + break; + case "y": + y = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Crv == input.Crv || - (this.Crv != null && - this.Crv.Equals(input.Crv)) - ) && - ( - this.Kty == input.Kty || - (this.Kty != null && - this.Kty.Equals(input.Kty)) - ) && - ( - this.X == input.X || - (this.X != null && - this.X.Equals(input.X)) - ) && - ( - this.Y == input.Y || - (this.Y != null && - this.Y.Equals(input.Y)) - ); + + if (crv.IsSet && crv.Value == null) + throw new ArgumentNullException(nameof(crv), "Property is not nullable for class SDKEphemPubKey."); + + if (kty.IsSet && kty.Value == null) + throw new ArgumentNullException(nameof(kty), "Property is not nullable for class SDKEphemPubKey."); + + if (x.IsSet && x.Value == null) + throw new ArgumentNullException(nameof(x), "Property is not nullable for class SDKEphemPubKey."); + + if (y.IsSet && y.Value == null) + throw new ArgumentNullException(nameof(y), "Property is not nullable for class SDKEphemPubKey."); + + return new SDKEphemPubKey(crv, kty, x, y); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SDKEphemPubKey sDKEphemPubKey, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Crv != null) - { - hashCode = (hashCode * 59) + this.Crv.GetHashCode(); - } - if (this.Kty != null) - { - hashCode = (hashCode * 59) + this.Kty.GetHashCode(); - } - if (this.X != null) - { - hashCode = (hashCode * 59) + this.X.GetHashCode(); - } - if (this.Y != null) - { - hashCode = (hashCode * 59) + this.Y.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, sDKEphemPubKey, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, SDKEphemPubKey sDKEphemPubKey, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (sDKEphemPubKey.CrvOption.IsSet && sDKEphemPubKey.Crv == null) + throw new ArgumentNullException(nameof(sDKEphemPubKey.Crv), "Property is required for class SDKEphemPubKey."); + + if (sDKEphemPubKey.KtyOption.IsSet && sDKEphemPubKey.Kty == null) + throw new ArgumentNullException(nameof(sDKEphemPubKey.Kty), "Property is required for class SDKEphemPubKey."); + + if (sDKEphemPubKey.XOption.IsSet && sDKEphemPubKey.X == null) + throw new ArgumentNullException(nameof(sDKEphemPubKey.X), "Property is required for class SDKEphemPubKey."); + + if (sDKEphemPubKey.YOption.IsSet && sDKEphemPubKey.Y == null) + throw new ArgumentNullException(nameof(sDKEphemPubKey.Y), "Property is required for class SDKEphemPubKey."); + + if (sDKEphemPubKey.CrvOption.IsSet) + writer.WriteString("crv", sDKEphemPubKey.Crv); + + if (sDKEphemPubKey.KtyOption.IsSet) + writer.WriteString("kty", sDKEphemPubKey.Kty); + + if (sDKEphemPubKey.XOption.IsSet) + writer.WriteString("x", sDKEphemPubKey.X); + + if (sDKEphemPubKey.YOption.IsSet) + writer.WriteString("y", sDKEphemPubKey.Y); } } - } diff --git a/Adyen/Model/Checkout/SamsungPayDetails.cs b/Adyen/Model/Checkout/SamsungPayDetails.cs index 06b92a3df..132363f43 100644 --- a/Adyen/Model/Checkout/SamsungPayDetails.cs +++ b/Adyen/Model/Checkout/SamsungPayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,125 +14,240 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// SamsungPayDetails /// - [DataContract(Name = "SamsungPayDetails")] - public partial class SamsungPayDetails : IEquatable, IValidatableObject + public partial class SamsungPayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The payload you received from the Samsung Pay SDK response. + /// The checkout attempt identifier. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **samsungpay** (default to TypeEnum.Samsungpay) + [JsonConstructor] + public SamsungPayDetails(string samsungPayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + SamsungPayToken = samsungPayToken; + CheckoutAttemptIdOption = checkoutAttemptId; + FundingSourceOption = fundingSource; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// - [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// - [EnumMember(Value = "debit")] Debit = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static FundingSourceEnum FundingSourceEnumFromString(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) + { + if (value == FundingSourceEnum.Credit) + return "credit"; + + if (value == FundingSourceEnum.Debit) + return "debit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public FundingSourceEnum? FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + /// /// **samsungpay** /// /// **samsungpay** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Samsungpay for value: samsungpay /// - [EnumMember(Value = "samsungpay")] Samsungpay = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("samsungpay")) + return TypeEnum.Samsungpay; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("samsungpay")) + return TypeEnum.Samsungpay; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Samsungpay) + return "samsungpay"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **samsungpay** /// /// **samsungpay** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// The payload you received from the Samsung Pay SDK response. /// - [JsonConstructorAttribute] - protected SamsungPayDetails() { } + /// The payload you received from the Samsung Pay SDK response. + [JsonPropertyName("samsungPayToken")] + public string SamsungPayToken { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The payload you received from the Samsung Pay SDK response. (required). - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **samsungpay** (default to TypeEnum.Samsungpay). - public SamsungPayDetails(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string recurringDetailReference = default(string), string samsungPayToken = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Samsungpay) - { - this.SamsungPayToken = samsungPayToken; - this.CheckoutAttemptId = checkoutAttemptId; - this.FundingSource = fundingSource; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } /// - /// The payload you received from the Samsung Pay SDK response. + /// Used to track the state of StoredPaymentMethodId /// - /// The payload you received from the Samsung Pay SDK response. - [DataMember(Name = "samsungPayToken", IsRequired = false, EmitDefaultValue = false)] - public string SamsungPayToken { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -143,10 +257,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class SamsungPayDetails {\n"); + sb.Append(" SamsungPayToken: ").Append(SamsungPayToken).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); - sb.Append(" SamsungPayToken: ").Append(SamsungPayToken).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); @@ -154,117 +268,175 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // SamsungPayToken (string) maxLength + if (this.SamsungPayToken != null && this.SamsungPayToken.Length > 10000) + { + yield return new ValidationResult("Invalid value for SamsungPayToken, length must be less than 10000.", new [] { "SamsungPayToken" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as SamsungPayDetails); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } + + yield break; } + } + /// + /// A Json converter for type + /// + public class SamsungPayDetailsJsonConverter : JsonConverter + { /// - /// Returns true if SamsungPayDetails instances are equal + /// Deserializes json to /// - /// Instance of SamsungPayDetails to be compared - /// Boolean - public bool Equals(SamsungPayDetails input) + /// + /// + /// + /// + /// + public override SamsungPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option samsungPayToken = default; + Option checkoutAttemptId = default; + Option fundingSource = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "samsungPayToken": + samsungPayToken = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "fundingSource": + string fundingSourceRawValue = utf8JsonReader.GetString(); + if (fundingSourceRawValue != null) + fundingSource = new Option(SamsungPayDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(SamsungPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.FundingSource == input.FundingSource || - this.FundingSource.Equals(input.FundingSource) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.SamsungPayToken == input.SamsungPayToken || - (this.SamsungPayToken != null && - this.SamsungPayToken.Equals(input.SamsungPayToken)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!samsungPayToken.IsSet) + throw new ArgumentException("Property is required for class SamsungPayDetails.", nameof(samsungPayToken)); + + if (samsungPayToken.IsSet && samsungPayToken.Value == null) + throw new ArgumentNullException(nameof(samsungPayToken), "Property is not nullable for class SamsungPayDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class SamsungPayDetails."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class SamsungPayDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class SamsungPayDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class SamsungPayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class SamsungPayDetails."); + + return new SamsungPayDetails(samsungPayToken.Value, checkoutAttemptId, fundingSource, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SamsungPayDetails samsungPayDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.SamsungPayToken != null) - { - hashCode = (hashCode * 59) + this.SamsungPayToken.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, samsungPayDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, SamsungPayDetails samsungPayDetails, JsonSerializerOptions jsonSerializerOptions) { - // SamsungPayToken (string) maxLength - if (this.SamsungPayToken != null && this.SamsungPayToken.Length > 10000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for SamsungPayToken, length must be less than 10000.", new [] { "SamsungPayToken" }); - } + if (samsungPayDetails.SamsungPayToken == null) + throw new ArgumentNullException(nameof(samsungPayDetails.SamsungPayToken), "Property is required for class SamsungPayDetails."); - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (samsungPayDetails.CheckoutAttemptIdOption.IsSet && samsungPayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(samsungPayDetails.CheckoutAttemptId), "Property is required for class SamsungPayDetails."); - yield break; + if (samsungPayDetails.RecurringDetailReferenceOption.IsSet && samsungPayDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(samsungPayDetails.RecurringDetailReference), "Property is required for class SamsungPayDetails."); + + if (samsungPayDetails.StoredPaymentMethodIdOption.IsSet && samsungPayDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(samsungPayDetails.StoredPaymentMethodId), "Property is required for class SamsungPayDetails."); + + writer.WriteString("samsungPayToken", samsungPayDetails.SamsungPayToken); + + if (samsungPayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", samsungPayDetails.CheckoutAttemptId); + + var fundingSourceRawValue = SamsungPayDetails.FundingSourceEnumToJsonValue(samsungPayDetails.FundingSourceOption.Value.Value); + writer.WriteString("fundingSource", fundingSourceRawValue); + if (samsungPayDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", samsungPayDetails.RecurringDetailReference); + + if (samsungPayDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", samsungPayDetails.StoredPaymentMethodId); + + var typeRawValue = SamsungPayDetails.TypeEnumToJsonValue(samsungPayDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/SepaDirectDebitDetails.cs b/Adyen/Model/Checkout/SepaDirectDebitDetails.cs index ccb9c3096..e8e50850e 100644 --- a/Adyen/Model/Checkout/SepaDirectDebitDetails.cs +++ b/Adyen/Model/Checkout/SepaDirectDebitDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,119 +14,196 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// SepaDirectDebitDetails /// - [DataContract(Name = "SepaDirectDebitDetails")] - public partial class SepaDirectDebitDetails : IEquatable, IValidatableObject + public partial class SepaDirectDebitDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The International Bank Account Number (IBAN). + /// The name of the bank account holder. + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. + /// **sepadirectdebit** (default to TypeEnum.Sepadirectdebit) + [JsonConstructor] + public SepaDirectDebitDetails(string iban, string ownerName, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option transferInstrumentId = default, Option type = default) + { + Iban = iban; + OwnerName = ownerName; + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TransferInstrumentIdOption = transferInstrumentId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **sepadirectdebit** /// /// **sepadirectdebit** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Sepadirectdebit for value: sepadirectdebit /// - [EnumMember(Value = "sepadirectdebit")] Sepadirectdebit = 1, /// /// Enum SepadirectdebitAmazonpay for value: sepadirectdebit_amazonpay /// - [EnumMember(Value = "sepadirectdebit_amazonpay")] SepadirectdebitAmazonpay = 2 - } - /// - /// **sepadirectdebit** + /// Returns a /// - /// **sepadirectdebit** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("sepadirectdebit")) + return TypeEnum.Sepadirectdebit; + + if (value.Equals("sepadirectdebit_amazonpay")) + return TypeEnum.SepadirectdebitAmazonpay; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected SepaDirectDebitDetails() { } + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("sepadirectdebit")) + return TypeEnum.Sepadirectdebit; + + if (value.Equals("sepadirectdebit_amazonpay")) + return TypeEnum.SepadirectdebitAmazonpay; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The checkout attempt identifier.. - /// The International Bank Account Number (IBAN). (required). - /// The name of the bank account holder. (required). - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts.. - /// **sepadirectdebit** (default to TypeEnum.Sepadirectdebit). - public SepaDirectDebitDetails(string checkoutAttemptId = default(string), string iban = default(string), string ownerName = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string transferInstrumentId = default(string), TypeEnum? type = TypeEnum.Sepadirectdebit) + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) { - this.Iban = iban; - this.OwnerName = ownerName; - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.TransferInstrumentId = transferInstrumentId; - this.Type = type; + if (value == TypeEnum.Sepadirectdebit) + return "sepadirectdebit"; + + if (value == TypeEnum.SepadirectdebitAmazonpay) + return "sepadirectdebit_amazonpay"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// The checkout attempt identifier. + /// Used to track the state of Type /// - /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } + + /// + /// **sepadirectdebit** + /// + /// **sepadirectdebit** + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } /// /// The International Bank Account Number (IBAN). /// /// The International Bank Account Number (IBAN). - [DataMember(Name = "iban", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("iban")] public string Iban { get; set; } /// /// The name of the bank account holder. /// /// The name of the bank account holder. - [DataMember(Name = "ownerName", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("ownerName")] public string OwnerName { get; set; } + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } + + /// + /// The checkout attempt identifier. + /// + /// The checkout attempt identifier. + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } + /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of TransferInstrumentId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TransferInstrumentIdOption { get; private set; } /// /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. /// /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. - [DataMember(Name = "transferInstrumentId", EmitDefaultValue = false)] - public string TransferInstrumentId { get; set; } + [JsonPropertyName("transferInstrumentId")] + public string TransferInstrumentId { get { return this.TransferInstrumentIdOption; } set { this.TransferInstrumentIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -137,9 +213,9 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class SepaDirectDebitDetails {\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" Iban: ").Append(Iban).Append("\n"); sb.Append(" OwnerName: ").Append(OwnerName).Append("\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" TransferInstrumentId: ").Append(TransferInstrumentId).Append("\n"); @@ -149,124 +225,186 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as SepaDirectDebitDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class SepaDirectDebitDetailsJsonConverter : JsonConverter + { /// - /// Returns true if SepaDirectDebitDetails instances are equal + /// Deserializes json to /// - /// Instance of SepaDirectDebitDetails to be compared - /// Boolean - public bool Equals(SepaDirectDebitDetails input) + /// + /// + /// + /// + /// + public override SepaDirectDebitDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option iban = default; + Option ownerName = default; + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option transferInstrumentId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "iban": + iban = new Option(utf8JsonReader.GetString()); + break; + case "ownerName": + ownerName = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "transferInstrumentId": + transferInstrumentId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(SepaDirectDebitDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Iban == input.Iban || - (this.Iban != null && - this.Iban.Equals(input.Iban)) - ) && - ( - this.OwnerName == input.OwnerName || - (this.OwnerName != null && - this.OwnerName.Equals(input.OwnerName)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.TransferInstrumentId == input.TransferInstrumentId || - (this.TransferInstrumentId != null && - this.TransferInstrumentId.Equals(input.TransferInstrumentId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!iban.IsSet) + throw new ArgumentException("Property is required for class SepaDirectDebitDetails.", nameof(iban)); + + if (!ownerName.IsSet) + throw new ArgumentException("Property is required for class SepaDirectDebitDetails.", nameof(ownerName)); + + if (iban.IsSet && iban.Value == null) + throw new ArgumentNullException(nameof(iban), "Property is not nullable for class SepaDirectDebitDetails."); + + if (ownerName.IsSet && ownerName.Value == null) + throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class SepaDirectDebitDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class SepaDirectDebitDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class SepaDirectDebitDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class SepaDirectDebitDetails."); + + if (transferInstrumentId.IsSet && transferInstrumentId.Value == null) + throw new ArgumentNullException(nameof(transferInstrumentId), "Property is not nullable for class SepaDirectDebitDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class SepaDirectDebitDetails."); + + return new SepaDirectDebitDetails(iban.Value, ownerName.Value, checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, transferInstrumentId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SepaDirectDebitDetails sepaDirectDebitDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.Iban != null) - { - hashCode = (hashCode * 59) + this.Iban.GetHashCode(); - } - if (this.OwnerName != null) - { - hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.TransferInstrumentId != null) - { - hashCode = (hashCode * 59) + this.TransferInstrumentId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, sepaDirectDebitDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, SepaDirectDebitDetails sepaDirectDebitDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (sepaDirectDebitDetails.Iban == null) + throw new ArgumentNullException(nameof(sepaDirectDebitDetails.Iban), "Property is required for class SepaDirectDebitDetails."); - yield break; + if (sepaDirectDebitDetails.OwnerName == null) + throw new ArgumentNullException(nameof(sepaDirectDebitDetails.OwnerName), "Property is required for class SepaDirectDebitDetails."); + + if (sepaDirectDebitDetails.CheckoutAttemptIdOption.IsSet && sepaDirectDebitDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(sepaDirectDebitDetails.CheckoutAttemptId), "Property is required for class SepaDirectDebitDetails."); + + if (sepaDirectDebitDetails.RecurringDetailReferenceOption.IsSet && sepaDirectDebitDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(sepaDirectDebitDetails.RecurringDetailReference), "Property is required for class SepaDirectDebitDetails."); + + if (sepaDirectDebitDetails.StoredPaymentMethodIdOption.IsSet && sepaDirectDebitDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(sepaDirectDebitDetails.StoredPaymentMethodId), "Property is required for class SepaDirectDebitDetails."); + + if (sepaDirectDebitDetails.TransferInstrumentIdOption.IsSet && sepaDirectDebitDetails.TransferInstrumentId == null) + throw new ArgumentNullException(nameof(sepaDirectDebitDetails.TransferInstrumentId), "Property is required for class SepaDirectDebitDetails."); + + writer.WriteString("iban", sepaDirectDebitDetails.Iban); + + writer.WriteString("ownerName", sepaDirectDebitDetails.OwnerName); + + if (sepaDirectDebitDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", sepaDirectDebitDetails.CheckoutAttemptId); + + if (sepaDirectDebitDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", sepaDirectDebitDetails.RecurringDetailReference); + + if (sepaDirectDebitDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", sepaDirectDebitDetails.StoredPaymentMethodId); + + if (sepaDirectDebitDetails.TransferInstrumentIdOption.IsSet) + writer.WriteString("transferInstrumentId", sepaDirectDebitDetails.TransferInstrumentId); + + var typeRawValue = SepaDirectDebitDetails.TypeEnumToJsonValue(sepaDirectDebitDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/ServiceError.cs b/Adyen/Model/Checkout/ServiceError.cs index 5878afc9f..812902778 100644 --- a/Adyen/Model/Checkout/ServiceError.cs +++ b/Adyen/Model/Checkout/ServiceError.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,83 +14,126 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ServiceError /// - [DataContract(Name = "ServiceError")] - public partial class ServiceError : IEquatable, IValidatableObject + public partial class ServiceError : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**.. - /// The error code mapped to the error message.. - /// The category of the error.. - /// A short explanation of the issue.. - /// The PSP reference of the payment.. - /// The HTTP response status.. - public ServiceError(Dictionary additionalData = default(Dictionary), string errorCode = default(string), string errorType = default(string), string message = default(string), string pspReference = default(string), int? status = default(int?)) + /// Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**. + /// The error code mapped to the error message. + /// The category of the error. + /// A short explanation of the issue. + /// The PSP reference of the payment. + /// The HTTP response status. + [JsonConstructor] + public ServiceError(Option> additionalData = default, Option errorCode = default, Option errorType = default, Option message = default, Option pspReference = default, Option status = default) { - this.AdditionalData = additionalData; - this.ErrorCode = errorCode; - this.ErrorType = errorType; - this.Message = message; - this.PspReference = pspReference; - this.Status = status; + AdditionalDataOption = additionalData; + ErrorCodeOption = errorCode; + ErrorTypeOption = errorType; + MessageOption = message; + PspReferenceOption = pspReference; + StatusOption = status; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of AdditionalData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AdditionalDataOption { get; private set; } + /// /// Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**. /// /// Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**. - [DataMember(Name = "additionalData", EmitDefaultValue = false)] - public Dictionary AdditionalData { get; set; } + [JsonPropertyName("additionalData")] + public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } + + /// + /// Used to track the state of ErrorCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ErrorCodeOption { get; private set; } /// /// The error code mapped to the error message. /// /// The error code mapped to the error message. - [DataMember(Name = "errorCode", EmitDefaultValue = false)] - public string ErrorCode { get; set; } + [JsonPropertyName("errorCode")] + public string ErrorCode { get { return this.ErrorCodeOption; } set { this.ErrorCodeOption = new Option(value); } } + + /// + /// Used to track the state of ErrorType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ErrorTypeOption { get; private set; } /// /// The category of the error. /// /// The category of the error. - [DataMember(Name = "errorType", EmitDefaultValue = false)] - public string ErrorType { get; set; } + [JsonPropertyName("errorType")] + public string ErrorType { get { return this.ErrorTypeOption; } set { this.ErrorTypeOption = new Option(value); } } + + /// + /// Used to track the state of Message + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MessageOption { get; private set; } /// /// A short explanation of the issue. /// /// A short explanation of the issue. - [DataMember(Name = "message", EmitDefaultValue = false)] - public string Message { get; set; } + [JsonPropertyName("message")] + public string Message { get { return this.MessageOption; } set { this.MessageOption = new Option(value); } } + + /// + /// Used to track the state of PspReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PspReferenceOption { get; private set; } /// /// The PSP reference of the payment. /// /// The PSP reference of the payment. - [DataMember(Name = "pspReference", EmitDefaultValue = false)] - public string PspReference { get; set; } + [JsonPropertyName("pspReference")] + public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } + + /// + /// Used to track the state of Status + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StatusOption { get; private set; } /// /// The HTTP response status. /// /// The HTTP response status. - [DataMember(Name = "status", EmitDefaultValue = false)] - public int? Status { get; set; } + [JsonPropertyName("status")] + public int? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -112,110 +154,165 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ServiceErrorJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ServiceError Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ServiceError); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ServiceError instances are equal - /// - /// Instance of ServiceError to be compared - /// Boolean - public bool Equals(ServiceError input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option> additionalData = default; + Option errorCode = default; + Option errorType = default; + Option message = default; + Option pspReference = default; + Option status = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "additionalData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "errorCode": + errorCode = new Option(utf8JsonReader.GetString()); + break; + case "errorType": + errorType = new Option(utf8JsonReader.GetString()); + break; + case "message": + message = new Option(utf8JsonReader.GetString()); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "status": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + status = new Option(utf8JsonReader.GetInt32()); + break; + default: + break; + } + } } - return - ( - this.AdditionalData == input.AdditionalData || - this.AdditionalData != null && - input.AdditionalData != null && - this.AdditionalData.SequenceEqual(input.AdditionalData) - ) && - ( - this.ErrorCode == input.ErrorCode || - (this.ErrorCode != null && - this.ErrorCode.Equals(input.ErrorCode)) - ) && - ( - this.ErrorType == input.ErrorType || - (this.ErrorType != null && - this.ErrorType.Equals(input.ErrorType)) - ) && - ( - this.Message == input.Message || - (this.Message != null && - this.Message.Equals(input.Message)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ); + + if (additionalData.IsSet && additionalData.Value == null) + throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class ServiceError."); + + if (errorCode.IsSet && errorCode.Value == null) + throw new ArgumentNullException(nameof(errorCode), "Property is not nullable for class ServiceError."); + + if (errorType.IsSet && errorType.Value == null) + throw new ArgumentNullException(nameof(errorType), "Property is not nullable for class ServiceError."); + + if (message.IsSet && message.Value == null) + throw new ArgumentNullException(nameof(message), "Property is not nullable for class ServiceError."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class ServiceError."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class ServiceError."); + + return new ServiceError(additionalData, errorCode, errorType, message, pspReference, status); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ServiceError serviceError, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AdditionalData != null) - { - hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); - } - if (this.ErrorCode != null) - { - hashCode = (hashCode * 59) + this.ErrorCode.GetHashCode(); - } - if (this.ErrorType != null) - { - hashCode = (hashCode * 59) + this.ErrorType.GetHashCode(); - } - if (this.Message != null) - { - hashCode = (hashCode * 59) + this.Message.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, serviceError, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ServiceError serviceError, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (serviceError.AdditionalDataOption.IsSet && serviceError.AdditionalData == null) + throw new ArgumentNullException(nameof(serviceError.AdditionalData), "Property is required for class ServiceError."); + + if (serviceError.ErrorCodeOption.IsSet && serviceError.ErrorCode == null) + throw new ArgumentNullException(nameof(serviceError.ErrorCode), "Property is required for class ServiceError."); + + if (serviceError.ErrorTypeOption.IsSet && serviceError.ErrorType == null) + throw new ArgumentNullException(nameof(serviceError.ErrorType), "Property is required for class ServiceError."); + + if (serviceError.MessageOption.IsSet && serviceError.Message == null) + throw new ArgumentNullException(nameof(serviceError.Message), "Property is required for class ServiceError."); + + if (serviceError.PspReferenceOption.IsSet && serviceError.PspReference == null) + throw new ArgumentNullException(nameof(serviceError.PspReference), "Property is required for class ServiceError."); + + if (serviceError.AdditionalDataOption.IsSet) + { + writer.WritePropertyName("additionalData"); + JsonSerializer.Serialize(writer, serviceError.AdditionalData, jsonSerializerOptions); + } + if (serviceError.ErrorCodeOption.IsSet) + writer.WriteString("errorCode", serviceError.ErrorCode); + + if (serviceError.ErrorTypeOption.IsSet) + writer.WriteString("errorType", serviceError.ErrorType); + + if (serviceError.MessageOption.IsSet) + writer.WriteString("message", serviceError.Message); + + if (serviceError.PspReferenceOption.IsSet) + writer.WriteString("pspReference", serviceError.PspReference); + + if (serviceError.StatusOption.IsSet) + writer.WriteNumber("status", serviceError.StatusOption.Value.Value); } } - } diff --git a/Adyen/Model/Checkout/SessionResultResponse.cs b/Adyen/Model/Checkout/SessionResultResponse.cs index d93c1199b..fcbfee6a0 100644 --- a/Adyen/Model/Checkout/SessionResultResponse.cs +++ b/Adyen/Model/Checkout/SessionResultResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,92 +14,233 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// SessionResultResponse /// - [DataContract(Name = "SessionResultResponse")] - public partial class SessionResultResponse : IEquatable, IValidatableObject + public partial class SessionResultResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Contains additional information about the payment. Some fields are included only if you enable them. To enable these fields in your Customer Area, go to **Developers** > **Additional data**. + /// A unique identifier of the session. + /// A list of all authorised payments done for this session. + /// The unique reference that you provided in the original `/sessions` request. This identifies the payment and is used in all communication with you about the payment status. + /// The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed**: the shopper completed the payment, and the payment was authorized. * **paymentPending**: the shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow, like voucher payments where the shopper completes the payment in a physical shop. * **refused**: the session has been refused, because of too many refused payment attempts. The shopper can no longer complete the payment with this session. * **canceled**: the shopper canceled the payment. * **expired**: the session expired. The shopper can no longer complete the payment with this session. By default, the session expires one hour after it is created. + [JsonConstructor] + public SessionResultResponse(Option> additionalData = default, Option id = default, Option> payments = default, Option reference = default, Option status = default) + { + AdditionalDataOption = additionalData; + IdOption = id; + PaymentsOption = payments; + ReferenceOption = reference; + StatusOption = status; + OnCreated(); + } + + partial void OnCreated(); + /// /// The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed**: the shopper completed the payment, and the payment was authorized. * **paymentPending**: the shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow, like voucher payments where the shopper completes the payment in a physical shop. * **refused**: the session has been refused, because of too many refused payment attempts. The shopper can no longer complete the payment with this session. * **canceled**: the shopper canceled the payment. * **expired**: the session expired. The shopper can no longer complete the payment with this session. By default, the session expires one hour after it is created. /// /// The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed**: the shopper completed the payment, and the payment was authorized. * **paymentPending**: the shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow, like voucher payments where the shopper completes the payment in a physical shop. * **refused**: the session has been refused, because of too many refused payment attempts. The shopper can no longer complete the payment with this session. * **canceled**: the shopper canceled the payment. * **expired**: the session expired. The shopper can no longer complete the payment with this session. By default, the session expires one hour after it is created. - [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Active for value: active /// - [EnumMember(Value = "active")] Active = 1, /// /// Enum Canceled for value: canceled /// - [EnumMember(Value = "canceled")] Canceled = 2, /// /// Enum Completed for value: completed /// - [EnumMember(Value = "completed")] Completed = 3, /// /// Enum Expired for value: expired /// - [EnumMember(Value = "expired")] Expired = 4, /// /// Enum PaymentPending for value: paymentPending /// - [EnumMember(Value = "paymentPending")] PaymentPending = 5, /// /// Enum Refused for value: refused /// - [EnumMember(Value = "refused")] Refused = 6 + } + + /// + /// Returns a + /// + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("active")) + return StatusEnum.Active; + + if (value.Equals("canceled")) + return StatusEnum.Canceled; + + if (value.Equals("completed")) + return StatusEnum.Completed; + if (value.Equals("expired")) + return StatusEnum.Expired; + + if (value.Equals("paymentPending")) + return StatusEnum.PaymentPending; + + if (value.Equals("refused")) + return StatusEnum.Refused; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("active")) + return StatusEnum.Active; + + if (value.Equals("canceled")) + return StatusEnum.Canceled; + + if (value.Equals("completed")) + return StatusEnum.Completed; + + if (value.Equals("expired")) + return StatusEnum.Expired; + + if (value.Equals("paymentPending")) + return StatusEnum.PaymentPending; + + if (value.Equals("refused")) + return StatusEnum.Refused; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum? value) + { + if (value == StatusEnum.Active) + return "active"; + + if (value == StatusEnum.Canceled) + return "canceled"; + + if (value == StatusEnum.Completed) + return "completed"; + + if (value == StatusEnum.Expired) + return "expired"; + + if (value == StatusEnum.PaymentPending) + return "paymentPending"; + + if (value == StatusEnum.Refused) + return "refused"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Status + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StatusOption { get; private set; } /// /// The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed**: the shopper completed the payment, and the payment was authorized. * **paymentPending**: the shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow, like voucher payments where the shopper completes the payment in a physical shop. * **refused**: the session has been refused, because of too many refused payment attempts. The shopper can no longer complete the payment with this session. * **canceled**: the shopper canceled the payment. * **expired**: the session expired. The shopper can no longer complete the payment with this session. By default, the session expires one hour after it is created. /// /// The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed**: the shopper completed the payment, and the payment was authorized. * **paymentPending**: the shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow, like voucher payments where the shopper completes the payment in a physical shop. * **refused**: the session has been refused, because of too many refused payment attempts. The shopper can no longer complete the payment with this session. * **canceled**: the shopper canceled the payment. * **expired**: the session expired. The shopper can no longer complete the payment with this session. By default, the session expires one hour after it is created. - [DataMember(Name = "status", EmitDefaultValue = false)] - public StatusEnum? Status { get; set; } + [JsonPropertyName("status")] + public StatusEnum? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of AdditionalData /// - /// A unique identifier of the session.. - /// The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed**: the shopper completed the payment, and the payment was authorized. * **paymentPending**: the shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow, like voucher payments where the shopper completes the payment in a physical shop. * **refused**: the session has been refused, because of too many refused payment attempts. The shopper can no longer complete the payment with this session. * **canceled**: the shopper canceled the payment. * **expired**: the session expired. The shopper can no longer complete the payment with this session. By default, the session expires one hour after it is created.. - public SessionResultResponse(string id = default(string), StatusEnum? status = default(StatusEnum?)) - { - this.Id = id; - this.Status = status; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> AdditionalDataOption { get; private set; } + + /// + /// Contains additional information about the payment. Some fields are included only if you enable them. To enable these fields in your Customer Area, go to **Developers** > **Additional data**. + /// + /// Contains additional information about the payment. Some fields are included only if you enable them. To enable these fields in your Customer Area, go to **Developers** > **Additional data**. + [JsonPropertyName("additionalData")] + public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } /// /// A unique identifier of the session. /// /// A unique identifier of the session. - [DataMember(Name = "id", EmitDefaultValue = false)] - public string Id { get; set; } + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Payments + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> PaymentsOption { get; private set; } + + /// + /// A list of all authorised payments done for this session. + /// + /// A list of all authorised payments done for this session. + [JsonPropertyName("payments")] + public List Payments { get { return this.PaymentsOption; } set { this.PaymentsOption = new Option>(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } + + /// + /// The unique reference that you provided in the original `/sessions` request. This identifies the payment and is used in all communication with you about the payment status. + /// + /// The unique reference that you provided in the original `/sessions` request. This identifies the payment and is used in all communication with you about the payment status. + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -110,80 +250,166 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class SessionResultResponse {\n"); + sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Payments: ").Append(Payments).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class SessionResultResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override SessionResultResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as SessionResultResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if SessionResultResponse instances are equal - /// - /// Instance of SessionResultResponse to be compared - /// Boolean - public bool Equals(SessionResultResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option> additionalData = default; + Option id = default; + Option> payments = default; + Option reference = default; + Option status = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "additionalData": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "payments": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + payments = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(SessionResultResponse.StatusEnumFromStringOrDefault(statusRawValue)); + break; + default: + break; + } + } } - return - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ); + + if (additionalData.IsSet && additionalData.Value == null) + throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class SessionResultResponse."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class SessionResultResponse."); + + if (payments.IsSet && payments.Value == null) + throw new ArgumentNullException(nameof(payments), "Property is not nullable for class SessionResultResponse."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class SessionResultResponse."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class SessionResultResponse."); + + return new SessionResultResponse(additionalData, id, payments, reference, status); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SessionResultResponse sessionResultResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, sessionResultResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, SessionResultResponse sessionResultResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (sessionResultResponse.AdditionalDataOption.IsSet && sessionResultResponse.AdditionalData == null) + throw new ArgumentNullException(nameof(sessionResultResponse.AdditionalData), "Property is required for class SessionResultResponse."); + + if (sessionResultResponse.IdOption.IsSet && sessionResultResponse.Id == null) + throw new ArgumentNullException(nameof(sessionResultResponse.Id), "Property is required for class SessionResultResponse."); + + if (sessionResultResponse.PaymentsOption.IsSet && sessionResultResponse.Payments == null) + throw new ArgumentNullException(nameof(sessionResultResponse.Payments), "Property is required for class SessionResultResponse."); + + if (sessionResultResponse.ReferenceOption.IsSet && sessionResultResponse.Reference == null) + throw new ArgumentNullException(nameof(sessionResultResponse.Reference), "Property is required for class SessionResultResponse."); + + if (sessionResultResponse.AdditionalDataOption.IsSet) + { + writer.WritePropertyName("additionalData"); + JsonSerializer.Serialize(writer, sessionResultResponse.AdditionalData, jsonSerializerOptions); + } + if (sessionResultResponse.IdOption.IsSet) + writer.WriteString("id", sessionResultResponse.Id); + + if (sessionResultResponse.PaymentsOption.IsSet) + { + writer.WritePropertyName("payments"); + JsonSerializer.Serialize(writer, sessionResultResponse.Payments, jsonSerializerOptions); + } + if (sessionResultResponse.ReferenceOption.IsSet) + writer.WriteString("reference", sessionResultResponse.Reference); + + var statusRawValue = SessionResultResponse.StatusEnumToJsonValue(sessionResultResponse.StatusOption.Value.Value); + writer.WriteString("status", statusRawValue); } } - } diff --git a/Adyen/Model/Checkout/ShopperInteractionDevice.cs b/Adyen/Model/Checkout/ShopperInteractionDevice.cs index 7a43e370e..41dcf3e94 100644 --- a/Adyen/Model/Checkout/ShopperInteractionDevice.cs +++ b/Adyen/Model/Checkout/ShopperInteractionDevice.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,56 +14,78 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ShopperInteractionDevice /// - [DataContract(Name = "ShopperInteractionDevice")] - public partial class ShopperInteractionDevice : IEquatable, IValidatableObject + public partial class ShopperInteractionDevice : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Locale on the shopper interaction device.. - /// Operating system running on the shopper interaction device.. - /// Version of the operating system on the shopper interaction device.. - public ShopperInteractionDevice(string locale = default(string), string os = default(string), string osVersion = default(string)) + /// Locale on the shopper interaction device. + /// Operating system running on the shopper interaction device. + /// Version of the operating system on the shopper interaction device. + [JsonConstructor] + public ShopperInteractionDevice(Option locale = default, Option os = default, Option osVersion = default) { - this.Locale = locale; - this.Os = os; - this.OsVersion = osVersion; + LocaleOption = locale; + OsOption = os; + OsVersionOption = osVersion; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Locale + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LocaleOption { get; private set; } + /// /// Locale on the shopper interaction device. /// /// Locale on the shopper interaction device. - [DataMember(Name = "locale", EmitDefaultValue = false)] - public string Locale { get; set; } + [JsonPropertyName("locale")] + public string Locale { get { return this.LocaleOption; } set { this.LocaleOption = new Option(value); } } + + /// + /// Used to track the state of Os + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OsOption { get; private set; } /// /// Operating system running on the shopper interaction device. /// /// Operating system running on the shopper interaction device. - [DataMember(Name = "os", EmitDefaultValue = false)] - public string Os { get; set; } + [JsonPropertyName("os")] + public string Os { get { return this.OsOption; } set { this.OsOption = new Option(value); } } + + /// + /// Used to track the state of OsVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OsVersionOption { get; private set; } /// /// Version of the operating system on the shopper interaction device. /// /// Version of the operating system on the shopper interaction device. - [DataMember(Name = "osVersion", EmitDefaultValue = false)] - public string OsVersion { get; set; } + [JsonPropertyName("osVersion")] + public string OsVersion { get { return this.OsVersionOption; } set { this.OsVersionOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -82,86 +103,125 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ShopperInteractionDeviceJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ShopperInteractionDevice Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ShopperInteractionDevice); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ShopperInteractionDevice instances are equal - /// - /// Instance of ShopperInteractionDevice to be compared - /// Boolean - public bool Equals(ShopperInteractionDevice input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option locale = default; + Option os = default; + Option osVersion = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "locale": + locale = new Option(utf8JsonReader.GetString()); + break; + case "os": + os = new Option(utf8JsonReader.GetString()); + break; + case "osVersion": + osVersion = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Locale == input.Locale || - (this.Locale != null && - this.Locale.Equals(input.Locale)) - ) && - ( - this.Os == input.Os || - (this.Os != null && - this.Os.Equals(input.Os)) - ) && - ( - this.OsVersion == input.OsVersion || - (this.OsVersion != null && - this.OsVersion.Equals(input.OsVersion)) - ); + + if (locale.IsSet && locale.Value == null) + throw new ArgumentNullException(nameof(locale), "Property is not nullable for class ShopperInteractionDevice."); + + if (os.IsSet && os.Value == null) + throw new ArgumentNullException(nameof(os), "Property is not nullable for class ShopperInteractionDevice."); + + if (osVersion.IsSet && osVersion.Value == null) + throw new ArgumentNullException(nameof(osVersion), "Property is not nullable for class ShopperInteractionDevice."); + + return new ShopperInteractionDevice(locale, os, osVersion); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ShopperInteractionDevice shopperInteractionDevice, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Locale != null) - { - hashCode = (hashCode * 59) + this.Locale.GetHashCode(); - } - if (this.Os != null) - { - hashCode = (hashCode * 59) + this.Os.GetHashCode(); - } - if (this.OsVersion != null) - { - hashCode = (hashCode * 59) + this.OsVersion.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, shopperInteractionDevice, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ShopperInteractionDevice shopperInteractionDevice, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (shopperInteractionDevice.LocaleOption.IsSet && shopperInteractionDevice.Locale == null) + throw new ArgumentNullException(nameof(shopperInteractionDevice.Locale), "Property is required for class ShopperInteractionDevice."); + + if (shopperInteractionDevice.OsOption.IsSet && shopperInteractionDevice.Os == null) + throw new ArgumentNullException(nameof(shopperInteractionDevice.Os), "Property is required for class ShopperInteractionDevice."); + + if (shopperInteractionDevice.OsVersionOption.IsSet && shopperInteractionDevice.OsVersion == null) + throw new ArgumentNullException(nameof(shopperInteractionDevice.OsVersion), "Property is required for class ShopperInteractionDevice."); + + if (shopperInteractionDevice.LocaleOption.IsSet) + writer.WriteString("locale", shopperInteractionDevice.Locale); + + if (shopperInteractionDevice.OsOption.IsSet) + writer.WriteString("os", shopperInteractionDevice.Os); + + if (shopperInteractionDevice.OsVersionOption.IsSet) + writer.WriteString("osVersion", shopperInteractionDevice.OsVersion); } } - } diff --git a/Adyen/Model/Checkout/Split.cs b/Adyen/Model/Checkout/Split.cs index 77a2a02b3..f039c5a6e 100644 --- a/Adyen/Model/Checkout/Split.cs +++ b/Adyen/Model/Checkout/Split.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,183 +14,365 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Split /// - [DataContract(Name = "Split")] - public partial class Split : IEquatable, IValidatableObject + public partial class Split : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. + /// The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/classic-platforms): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. + /// amount + /// Your description for the split item. + /// Your unique reference for the part of the payment booked to the specified `account`. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/classic-platforms)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/adyen-for-platforms-model)). For the other types, we also recommend providing a **unique** reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. + [JsonConstructor] + public Split(TypeEnum type, Option account = default, Option amount = default, Option description = default, Option reference = default) + { + Type = type; + AccountOption = account; + AmountOption = amount; + DescriptionOption = description; + ReferenceOption = reference; + OnCreated(); + } + + partial void OnCreated(); + /// /// The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. /// /// The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum AcquiringFees for value: AcquiringFees /// - [EnumMember(Value = "AcquiringFees")] AcquiringFees = 1, /// /// Enum AdyenCommission for value: AdyenCommission /// - [EnumMember(Value = "AdyenCommission")] AdyenCommission = 2, /// /// Enum AdyenFees for value: AdyenFees /// - [EnumMember(Value = "AdyenFees")] AdyenFees = 3, /// /// Enum AdyenMarkup for value: AdyenMarkup /// - [EnumMember(Value = "AdyenMarkup")] AdyenMarkup = 4, /// /// Enum BalanceAccount for value: BalanceAccount /// - [EnumMember(Value = "BalanceAccount")] BalanceAccount = 5, /// /// Enum Commission for value: Commission /// - [EnumMember(Value = "Commission")] Commission = 6, /// /// Enum Default for value: Default /// - [EnumMember(Value = "Default")] Default = 7, /// /// Enum Interchange for value: Interchange /// - [EnumMember(Value = "Interchange")] Interchange = 8, /// /// Enum MarketPlace for value: MarketPlace /// - [EnumMember(Value = "MarketPlace")] MarketPlace = 9, /// /// Enum PaymentFee for value: PaymentFee /// - [EnumMember(Value = "PaymentFee")] PaymentFee = 10, /// /// Enum Remainder for value: Remainder /// - [EnumMember(Value = "Remainder")] Remainder = 11, /// /// Enum SchemeFee for value: SchemeFee /// - [EnumMember(Value = "SchemeFee")] SchemeFee = 12, /// /// Enum Surcharge for value: Surcharge /// - [EnumMember(Value = "Surcharge")] Surcharge = 13, /// /// Enum Tip for value: Tip /// - [EnumMember(Value = "Tip")] Tip = 14, /// /// Enum TopUp for value: TopUp /// - [EnumMember(Value = "TopUp")] TopUp = 15, /// /// Enum VAT for value: VAT /// - [EnumMember(Value = "VAT")] VAT = 16 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("AcquiringFees")) + return TypeEnum.AcquiringFees; + + if (value.Equals("AdyenCommission")) + return TypeEnum.AdyenCommission; + + if (value.Equals("AdyenFees")) + return TypeEnum.AdyenFees; + + if (value.Equals("AdyenMarkup")) + return TypeEnum.AdyenMarkup; + + if (value.Equals("BalanceAccount")) + return TypeEnum.BalanceAccount; + + if (value.Equals("Commission")) + return TypeEnum.Commission; + + if (value.Equals("Default")) + return TypeEnum.Default; + if (value.Equals("Interchange")) + return TypeEnum.Interchange; + + if (value.Equals("MarketPlace")) + return TypeEnum.MarketPlace; + + if (value.Equals("PaymentFee")) + return TypeEnum.PaymentFee; + + if (value.Equals("Remainder")) + return TypeEnum.Remainder; + + if (value.Equals("SchemeFee")) + return TypeEnum.SchemeFee; + + if (value.Equals("Surcharge")) + return TypeEnum.Surcharge; + + if (value.Equals("Tip")) + return TypeEnum.Tip; + + if (value.Equals("TopUp")) + return TypeEnum.TopUp; + + if (value.Equals("VAT")) + return TypeEnum.VAT; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("AcquiringFees")) + return TypeEnum.AcquiringFees; + + if (value.Equals("AdyenCommission")) + return TypeEnum.AdyenCommission; + + if (value.Equals("AdyenFees")) + return TypeEnum.AdyenFees; + + if (value.Equals("AdyenMarkup")) + return TypeEnum.AdyenMarkup; + + if (value.Equals("BalanceAccount")) + return TypeEnum.BalanceAccount; + + if (value.Equals("Commission")) + return TypeEnum.Commission; + + if (value.Equals("Default")) + return TypeEnum.Default; + + if (value.Equals("Interchange")) + return TypeEnum.Interchange; + + if (value.Equals("MarketPlace")) + return TypeEnum.MarketPlace; + + if (value.Equals("PaymentFee")) + return TypeEnum.PaymentFee; + + if (value.Equals("Remainder")) + return TypeEnum.Remainder; + + if (value.Equals("SchemeFee")) + return TypeEnum.SchemeFee; + + if (value.Equals("Surcharge")) + return TypeEnum.Surcharge; + + if (value.Equals("Tip")) + return TypeEnum.Tip; + + if (value.Equals("TopUp")) + return TypeEnum.TopUp; + + if (value.Equals("VAT")) + return TypeEnum.VAT; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.AcquiringFees) + return "AcquiringFees"; + + if (value == TypeEnum.AdyenCommission) + return "AdyenCommission"; + + if (value == TypeEnum.AdyenFees) + return "AdyenFees"; + + if (value == TypeEnum.AdyenMarkup) + return "AdyenMarkup"; + + if (value == TypeEnum.BalanceAccount) + return "BalanceAccount"; + + if (value == TypeEnum.Commission) + return "Commission"; + + if (value == TypeEnum.Default) + return "Default"; + + if (value == TypeEnum.Interchange) + return "Interchange"; + + if (value == TypeEnum.MarketPlace) + return "MarketPlace"; + + if (value == TypeEnum.PaymentFee) + return "PaymentFee"; + + if (value == TypeEnum.Remainder) + return "Remainder"; + + if (value == TypeEnum.SchemeFee) + return "SchemeFee"; + + if (value == TypeEnum.Surcharge) + return "Surcharge"; + + if (value == TypeEnum.Tip) + return "Tip"; + + if (value == TypeEnum.TopUp) + return "TopUp"; + + if (value == TypeEnum.VAT) + return "VAT"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. /// /// The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected Split() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of Account /// - /// The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/classic-platforms): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked.. - /// amount. - /// Your description for the split item.. - /// Your unique reference for the part of the payment booked to the specified `account`. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/classic-platforms)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/adyen-for-platforms-model)). For the other types, we also recommend providing a **unique** reference so you can reconcile the split and the associated payment in the transaction overview and in the reports.. - /// The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. (required). - public Split(string account = default(string), SplitAmount amount = default(SplitAmount), string description = default(string), string reference = default(string), TypeEnum type = default(TypeEnum)) - { - this.Type = type; - this.Account = account; - this.Amount = amount; - this.Description = description; - this.Reference = reference; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AccountOption { get; private set; } /// /// The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/classic-platforms): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. /// /// The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/classic-platforms): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. - [DataMember(Name = "account", EmitDefaultValue = false)] - public string Account { get; set; } + [JsonPropertyName("account")] + public string Account { get { return this.AccountOption; } set { this.AccountOption = new Option(value); } } + + /// + /// Used to track the state of Amount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountOption { get; private set; } /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", EmitDefaultValue = false)] - public SplitAmount Amount { get; set; } + [JsonPropertyName("amount")] + public SplitAmount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } + + /// + /// Used to track the state of Description + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DescriptionOption { get; private set; } /// /// Your description for the split item. /// /// Your description for the split item. - [DataMember(Name = "description", EmitDefaultValue = false)] - public string Description { get; set; } + [JsonPropertyName("description")] + public string Description { get { return this.DescriptionOption; } set { this.DescriptionOption = new Option(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } /// /// Your unique reference for the part of the payment booked to the specified `account`. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/classic-platforms)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/adyen-for-platforms-model)). For the other types, we also recommend providing a **unique** reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. /// /// Your unique reference for the part of the payment booked to the specified `account`. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/classic-platforms)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/adyen-for-platforms-model)). For the other types, we also recommend providing a **unique** reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -201,110 +382,165 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Split {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Account: ").Append(Account).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" Description: ").Append(Description).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class SplitJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override Split Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as Split); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if Split instances are equal - /// - /// Instance of Split to be compared - /// Boolean - public bool Equals(Split input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option type = default; + Option account = default; + Option amount = default; + Option description = default; + Option reference = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(Split.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "account": + account = new Option(utf8JsonReader.GetString()); + break; + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "description": + description = new Option(utf8JsonReader.GetString()); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Account == input.Account || - (this.Account != null && - this.Account.Equals(input.Account)) - ) && - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.Description == input.Description || - (this.Description != null && - this.Description.Equals(input.Description)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class Split.", nameof(type)); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class Split."); + + if (account.IsSet && account.Value == null) + throw new ArgumentNullException(nameof(account), "Property is not nullable for class Split."); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class Split."); + + if (description.IsSet && description.Value == null) + throw new ArgumentNullException(nameof(description), "Property is not nullable for class Split."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class Split."); + + return new Split(type.Value.Value, account, amount, description, reference); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Split split, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Account != null) - { - hashCode = (hashCode * 59) + this.Account.GetHashCode(); - } - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.Description != null) - { - hashCode = (hashCode * 59) + this.Description.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, split, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Split split, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (split.AccountOption.IsSet && split.Account == null) + throw new ArgumentNullException(nameof(split.Account), "Property is required for class Split."); + + if (split.AmountOption.IsSet && split.Amount == null) + throw new ArgumentNullException(nameof(split.Amount), "Property is required for class Split."); + + if (split.DescriptionOption.IsSet && split.Description == null) + throw new ArgumentNullException(nameof(split.Description), "Property is required for class Split."); + + if (split.ReferenceOption.IsSet && split.Reference == null) + throw new ArgumentNullException(nameof(split.Reference), "Property is required for class Split."); + + var typeRawValue = Split.TypeEnumToJsonValue(split.Type); + writer.WriteString("type", typeRawValue); + if (split.AccountOption.IsSet) + writer.WriteString("account", split.Account); + + if (split.AmountOption.IsSet) + { + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, split.Amount, jsonSerializerOptions); + } + if (split.DescriptionOption.IsSet) + writer.WriteString("description", split.Description); + + if (split.ReferenceOption.IsSet) + writer.WriteString("reference", split.Reference); } } - } diff --git a/Adyen/Model/Checkout/SplitAmount.cs b/Adyen/Model/Checkout/SplitAmount.cs index 667576485..cc47d74f7 100644 --- a/Adyen/Model/Checkout/SplitAmount.cs +++ b/Adyen/Model/Checkout/SplitAmount.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,52 +14,55 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// SplitAmount /// - [DataContract(Name = "SplitAmount")] - public partial class SplitAmount : IEquatable, IValidatableObject + public partial class SplitAmount : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected SplitAmount() { } - /// - /// Initializes a new instance of the class. - /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency.. - /// The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). (required). - public SplitAmount(string currency = default(string), long? value = default(long?)) + /// The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. + [JsonConstructor] + public SplitAmount(long value, Option currency = default) { - this.Value = value; - this.Currency = currency; + Value = value; + CurrencyOption = currency; + OnCreated(); } - /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. - /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. - [DataMember(Name = "currency", EmitDefaultValue = false)] - public string Currency { get; set; } + partial void OnCreated(); /// /// The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). /// /// The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). - [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] - public long? Value { get; set; } + [JsonPropertyName("value")] + public long Value { get; set; } + + /// + /// Used to track the state of Currency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CurrencyOption { get; private set; } + + /// + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. + /// + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. + [JsonPropertyName("currency")] + public string Currency { get { return this.CurrencyOption; } set { this.CurrencyOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -70,92 +72,131 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class SplitAmount {\n"); - sb.Append(" Currency: ").Append(Currency).Append("\n"); sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" Currency: ").Append(Currency).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // Currency (string) maxLength + if (this.Currency != null && this.Currency.Length > 3) + { + yield return new ValidationResult("Invalid value for Currency, length must be less than 3.", new [] { "Currency" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as SplitAmount); + // Currency (string) minLength + if (this.Currency != null && this.Currency.Length < 3) + { + yield return new ValidationResult("Invalid value for Currency, length must be greater than 3.", new [] { "Currency" }); + } + + yield break; } + } + /// + /// A Json converter for type + /// + public class SplitAmountJsonConverter : JsonConverter + { /// - /// Returns true if SplitAmount instances are equal + /// Deserializes json to /// - /// Instance of SplitAmount to be compared - /// Boolean - public bool Equals(SplitAmount input) + /// + /// + /// + /// + /// + public override SplitAmount Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option value = default; + Option currency = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "value": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + value = new Option(utf8JsonReader.GetInt64()); + break; + case "currency": + currency = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Currency == input.Currency || - (this.Currency != null && - this.Currency.Equals(input.Currency)) - ) && - ( - this.Value == input.Value || - this.Value.Equals(input.Value) - ); + + if (!value.IsSet) + throw new ArgumentException("Property is required for class SplitAmount.", nameof(value)); + + if (value.IsSet && value.Value == null) + throw new ArgumentNullException(nameof(value), "Property is not nullable for class SplitAmount."); + + if (currency.IsSet && currency.Value == null) + throw new ArgumentNullException(nameof(currency), "Property is not nullable for class SplitAmount."); + + return new SplitAmount(value.Value.Value, currency); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SplitAmount splitAmount, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Currency != null) - { - hashCode = (hashCode * 59) + this.Currency.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Value.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, splitAmount, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, SplitAmount splitAmount, JsonSerializerOptions jsonSerializerOptions) { - // Currency (string) maxLength - if (this.Currency != null && this.Currency.Length > 3) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Currency, length must be less than 3.", new [] { "Currency" }); - } + if (splitAmount.CurrencyOption.IsSet && splitAmount.Currency == null) + throw new ArgumentNullException(nameof(splitAmount.Currency), "Property is required for class SplitAmount."); - // Currency (string) minLength - if (this.Currency != null && this.Currency.Length < 3) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Currency, length must be greater than 3.", new [] { "Currency" }); - } + writer.WriteNumber("value", splitAmount.Value); - yield break; + if (splitAmount.CurrencyOption.IsSet) + writer.WriteString("currency", splitAmount.Currency); } } - } diff --git a/Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs b/Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs index 941dadf40..fed296283 100644 --- a/Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs +++ b/Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,69 +14,79 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// StandalonePaymentCancelRequest /// - [DataContract(Name = "StandalonePaymentCancelRequest")] - public partial class StandalonePaymentCancelRequest : IEquatable, IValidatableObject + public partial class StandalonePaymentCancelRequest : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected StandalonePaymentCancelRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// applicationInfo. - /// The merchant account that is used to process the payment. (required). - /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment that you want to cancel. (required). - /// Your reference for the cancel request. Maximum length: 80 characters.. - public StandalonePaymentCancelRequest(ApplicationInfo applicationInfo = default(ApplicationInfo), string merchantAccount = default(string), string paymentReference = default(string), string reference = default(string)) + /// The merchant account that is used to process the payment. + /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment that you want to cancel. + /// applicationInfo + /// Your reference for the cancel request. Maximum length: 80 characters. + [JsonConstructor] + public StandalonePaymentCancelRequest(string merchantAccount, string paymentReference, Option applicationInfo = default, Option reference = default) { - this.MerchantAccount = merchantAccount; - this.PaymentReference = paymentReference; - this.ApplicationInfo = applicationInfo; - this.Reference = reference; + MerchantAccount = merchantAccount; + PaymentReference = paymentReference; + ApplicationInfoOption = applicationInfo; + ReferenceOption = reference; + OnCreated(); } - /// - /// Gets or Sets ApplicationInfo - /// - [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; set; } + partial void OnCreated(); /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantAccount")] public string MerchantAccount { get; set; } /// /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment that you want to cancel. /// /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment that you want to cancel. - [DataMember(Name = "paymentReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("paymentReference")] public string PaymentReference { get; set; } + /// + /// Used to track the state of ApplicationInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ApplicationInfoOption { get; private set; } + + /// + /// Gets or Sets ApplicationInfo + /// + [JsonPropertyName("applicationInfo")] + public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } + /// /// Your reference for the cancel request. Maximum length: 80 characters. /// /// Your reference for the cancel request. Maximum length: 80 characters. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -87,104 +96,154 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class StandalonePaymentCancelRequest {\n"); - sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentReference: ").Append(PaymentReference).Append("\n"); + sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class StandalonePaymentCancelRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override StandalonePaymentCancelRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as StandalonePaymentCancelRequest); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if StandalonePaymentCancelRequest instances are equal - /// - /// Instance of StandalonePaymentCancelRequest to be compared - /// Boolean - public bool Equals(StandalonePaymentCancelRequest input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option merchantAccount = default; + Option paymentReference = default; + Option applicationInfo = default; + Option reference = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "paymentReference": + paymentReference = new Option(utf8JsonReader.GetString()); + break; + case "applicationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.PaymentReference == input.PaymentReference || - (this.PaymentReference != null && - this.PaymentReference.Equals(input.PaymentReference)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class StandalonePaymentCancelRequest.", nameof(merchantAccount)); + + if (!paymentReference.IsSet) + throw new ArgumentException("Property is required for class StandalonePaymentCancelRequest.", nameof(paymentReference)); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class StandalonePaymentCancelRequest."); + + if (paymentReference.IsSet && paymentReference.Value == null) + throw new ArgumentNullException(nameof(paymentReference), "Property is not nullable for class StandalonePaymentCancelRequest."); + + if (applicationInfo.IsSet && applicationInfo.Value == null) + throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class StandalonePaymentCancelRequest."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class StandalonePaymentCancelRequest."); + + return new StandalonePaymentCancelRequest(merchantAccount.Value, paymentReference.Value, applicationInfo, reference); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, StandalonePaymentCancelRequest standalonePaymentCancelRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ApplicationInfo != null) - { - hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); - } - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.PaymentReference != null) - { - hashCode = (hashCode * 59) + this.PaymentReference.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, standalonePaymentCancelRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, StandalonePaymentCancelRequest standalonePaymentCancelRequest, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (standalonePaymentCancelRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(standalonePaymentCancelRequest.MerchantAccount), "Property is required for class StandalonePaymentCancelRequest."); + + if (standalonePaymentCancelRequest.PaymentReference == null) + throw new ArgumentNullException(nameof(standalonePaymentCancelRequest.PaymentReference), "Property is required for class StandalonePaymentCancelRequest."); + + if (standalonePaymentCancelRequest.ApplicationInfoOption.IsSet && standalonePaymentCancelRequest.ApplicationInfo == null) + throw new ArgumentNullException(nameof(standalonePaymentCancelRequest.ApplicationInfo), "Property is required for class StandalonePaymentCancelRequest."); + + if (standalonePaymentCancelRequest.ReferenceOption.IsSet && standalonePaymentCancelRequest.Reference == null) + throw new ArgumentNullException(nameof(standalonePaymentCancelRequest.Reference), "Property is required for class StandalonePaymentCancelRequest."); + + writer.WriteString("merchantAccount", standalonePaymentCancelRequest.MerchantAccount); + + writer.WriteString("paymentReference", standalonePaymentCancelRequest.PaymentReference); + + if (standalonePaymentCancelRequest.ApplicationInfoOption.IsSet) + { + writer.WritePropertyName("applicationInfo"); + JsonSerializer.Serialize(writer, standalonePaymentCancelRequest.ApplicationInfo, jsonSerializerOptions); + } + if (standalonePaymentCancelRequest.ReferenceOption.IsSet) + writer.WriteString("reference", standalonePaymentCancelRequest.Reference); } } - } diff --git a/Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs b/Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs index bc43a844c..4be9e0cd2 100644 --- a/Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs +++ b/Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,94 +14,135 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// StandalonePaymentCancelResponse /// - [DataContract(Name = "StandalonePaymentCancelResponse")] - public partial class StandalonePaymentCancelResponse : IEquatable, IValidatableObject + public partial class StandalonePaymentCancelResponse : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The merchant account that is used to process the payment. + /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment to cancel. + /// Adyen's 16-character reference associated with the cancel request. + /// The status of your request. This will always have the value **received**. + /// Your reference for the cancel request. + [JsonConstructor] + public StandalonePaymentCancelResponse(string merchantAccount, string paymentReference, string pspReference, StatusEnum status, Option reference = default) + { + MerchantAccount = merchantAccount; + PaymentReference = paymentReference; + PspReference = pspReference; + Status = status; + ReferenceOption = reference; + OnCreated(); + } + + partial void OnCreated(); + /// /// The status of your request. This will always have the value **received**. /// /// The status of your request. This will always have the value **received**. - [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Received for value: received /// - [EnumMember(Value = "received")] Received = 1 - } - /// - /// The status of your request. This will always have the value **received**. + /// Returns a /// - /// The status of your request. This will always have the value **received**. - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public StatusEnum Status { get; set; } + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("received")) + return StatusEnum.Received; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected StandalonePaymentCancelResponse() { } + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("received")) + return StatusEnum.Received; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The merchant account that is used to process the payment. (required). - /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment to cancel. (required). - /// Adyen's 16-character reference associated with the cancel request. (required). - /// Your reference for the cancel request.. - /// The status of your request. This will always have the value **received**. (required). - public StandalonePaymentCancelResponse(string merchantAccount = default(string), string paymentReference = default(string), string pspReference = default(string), string reference = default(string), StatusEnum status = default(StatusEnum)) + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum value) { - this.MerchantAccount = merchantAccount; - this.PaymentReference = paymentReference; - this.PspReference = pspReference; - this.Status = status; - this.Reference = reference; + if (value == StatusEnum.Received) + return "received"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// The status of your request. This will always have the value **received**. + /// + /// The status of your request. This will always have the value **received**. + [JsonPropertyName("status")] + public StatusEnum Status { get; set; } + /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantAccount")] public string MerchantAccount { get; set; } /// /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment to cancel. /// /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment to cancel. - [DataMember(Name = "paymentReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("paymentReference")] public string PaymentReference { get; set; } /// /// Adyen's 16-character reference associated with the cancel request. /// /// Adyen's 16-character reference associated with the cancel request. - [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("pspReference")] public string PspReference { get; set; } + /// + /// Used to track the state of Reference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ReferenceOption { get; private set; } + /// /// Your reference for the cancel request. /// /// Your reference for the cancel request. - [DataMember(Name = "reference", EmitDefaultValue = false)] - public string Reference { get; set; } + [JsonPropertyName("reference")] + public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -115,107 +155,165 @@ public override string ToString() sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentReference: ").Append(PaymentReference).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class StandalonePaymentCancelResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override StandalonePaymentCancelResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as StandalonePaymentCancelResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if StandalonePaymentCancelResponse instances are equal - /// - /// Instance of StandalonePaymentCancelResponse to be compared - /// Boolean - public bool Equals(StandalonePaymentCancelResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option merchantAccount = default; + Option paymentReference = default; + Option pspReference = default; + Option status = default; + Option reference = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "paymentReference": + paymentReference = new Option(utf8JsonReader.GetString()); + break; + case "pspReference": + pspReference = new Option(utf8JsonReader.GetString()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(StandalonePaymentCancelResponse.StatusEnumFromStringOrDefault(statusRawValue)); + break; + case "reference": + reference = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.PaymentReference == input.PaymentReference || - (this.PaymentReference != null && - this.PaymentReference.Equals(input.PaymentReference)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class StandalonePaymentCancelResponse.", nameof(merchantAccount)); + + if (!paymentReference.IsSet) + throw new ArgumentException("Property is required for class StandalonePaymentCancelResponse.", nameof(paymentReference)); + + if (!pspReference.IsSet) + throw new ArgumentException("Property is required for class StandalonePaymentCancelResponse.", nameof(pspReference)); + + if (!status.IsSet) + throw new ArgumentException("Property is required for class StandalonePaymentCancelResponse.", nameof(status)); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class StandalonePaymentCancelResponse."); + + if (paymentReference.IsSet && paymentReference.Value == null) + throw new ArgumentNullException(nameof(paymentReference), "Property is not nullable for class StandalonePaymentCancelResponse."); + + if (pspReference.IsSet && pspReference.Value == null) + throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class StandalonePaymentCancelResponse."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class StandalonePaymentCancelResponse."); + + if (reference.IsSet && reference.Value == null) + throw new ArgumentNullException(nameof(reference), "Property is not nullable for class StandalonePaymentCancelResponse."); + + return new StandalonePaymentCancelResponse(merchantAccount.Value, paymentReference.Value, pspReference.Value, status.Value.Value, reference); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, StandalonePaymentCancelResponse standalonePaymentCancelResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.PaymentReference != null) - { - hashCode = (hashCode * 59) + this.PaymentReference.GetHashCode(); - } - if (this.PspReference != null) - { - hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); - } - if (this.Reference != null) - { - hashCode = (hashCode * 59) + this.Reference.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, standalonePaymentCancelResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, StandalonePaymentCancelResponse standalonePaymentCancelResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (standalonePaymentCancelResponse.MerchantAccount == null) + throw new ArgumentNullException(nameof(standalonePaymentCancelResponse.MerchantAccount), "Property is required for class StandalonePaymentCancelResponse."); + + if (standalonePaymentCancelResponse.PaymentReference == null) + throw new ArgumentNullException(nameof(standalonePaymentCancelResponse.PaymentReference), "Property is required for class StandalonePaymentCancelResponse."); + + if (standalonePaymentCancelResponse.PspReference == null) + throw new ArgumentNullException(nameof(standalonePaymentCancelResponse.PspReference), "Property is required for class StandalonePaymentCancelResponse."); + + if (standalonePaymentCancelResponse.ReferenceOption.IsSet && standalonePaymentCancelResponse.Reference == null) + throw new ArgumentNullException(nameof(standalonePaymentCancelResponse.Reference), "Property is required for class StandalonePaymentCancelResponse."); + + writer.WriteString("merchantAccount", standalonePaymentCancelResponse.MerchantAccount); + + writer.WriteString("paymentReference", standalonePaymentCancelResponse.PaymentReference); + + writer.WriteString("pspReference", standalonePaymentCancelResponse.PspReference); + + var statusRawValue = StandalonePaymentCancelResponse.StatusEnumToJsonValue(standalonePaymentCancelResponse.Status); + writer.WriteString("status", statusRawValue); + if (standalonePaymentCancelResponse.ReferenceOption.IsSet) + writer.WriteString("reference", standalonePaymentCancelResponse.Reference); } } - } diff --git a/Adyen/Model/Checkout/StoredPaymentMethod.cs b/Adyen/Model/Checkout/StoredPaymentMethod.cs index eee217536..9206d84d9 100644 --- a/Adyen/Model/Checkout/StoredPaymentMethod.cs +++ b/Adyen/Model/Checkout/StoredPaymentMethod.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,182 +14,302 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// StoredPaymentMethod /// - [DataContract(Name = "StoredPaymentMethod")] - public partial class StoredPaymentMethod : IEquatable, IValidatableObject + public partial class StoredPaymentMethod : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The bank account number (without separators).. - /// The location id of the bank. The field value is `nil` in most cases.. - /// The brand of the card.. - /// The two-digit month when the card expires. - /// The last two digits of the year the card expires. For example, **22** for the year 2022.. - /// The unique payment method code.. - /// The IBAN of the bank account.. - /// A unique identifier of this stored payment method.. - /// The shopper’s issuer account label. - /// The last four digits of the PAN.. - /// The display name of the stored payment method.. - /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID.. - /// The name of the bank account holder.. - /// The shopper’s email address.. - /// The supported recurring processing models for this stored payment method.. - /// The supported shopper interactions for this stored payment method.. - /// The type of payment method.. - public StoredPaymentMethod(string bankAccountNumber = default(string), string bankLocationId = default(string), string brand = default(string), string expiryMonth = default(string), string expiryYear = default(string), string holderName = default(string), string iban = default(string), string id = default(string), string label = default(string), string lastFour = default(string), string name = default(string), string networkTxReference = default(string), string ownerName = default(string), string shopperEmail = default(string), List supportedRecurringProcessingModels = default(List), List supportedShopperInteractions = default(List), string type = default(string)) + /// The bank account number (without separators). + /// The location id of the bank. The field value is `nil` in most cases. + /// The brand of the card. + /// The two-digit month when the card expires + /// The last two digits of the year the card expires. For example, **22** for the year 2022. + /// The unique payment method code. + /// The IBAN of the bank account. + /// A unique identifier of this stored payment method. + /// The shopper’s issuer account label + /// The last four digits of the PAN. + /// The display name of the stored payment method. + /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. + /// The name of the bank account holder. + /// The shopper’s email address. + /// The supported recurring processing models for this stored payment method. + /// The supported shopper interactions for this stored payment method. + /// The type of payment method. + [JsonConstructor] + public StoredPaymentMethod(Option bankAccountNumber = default, Option bankLocationId = default, Option brand = default, Option expiryMonth = default, Option expiryYear = default, Option holderName = default, Option iban = default, Option id = default, Option label = default, Option lastFour = default, Option name = default, Option networkTxReference = default, Option ownerName = default, Option shopperEmail = default, Option> supportedRecurringProcessingModels = default, Option> supportedShopperInteractions = default, Option type = default) { - this.BankAccountNumber = bankAccountNumber; - this.BankLocationId = bankLocationId; - this.Brand = brand; - this.ExpiryMonth = expiryMonth; - this.ExpiryYear = expiryYear; - this.HolderName = holderName; - this.Iban = iban; - this.Id = id; - this.Label = label; - this.LastFour = lastFour; - this.Name = name; - this.NetworkTxReference = networkTxReference; - this.OwnerName = ownerName; - this.ShopperEmail = shopperEmail; - this.SupportedRecurringProcessingModels = supportedRecurringProcessingModels; - this.SupportedShopperInteractions = supportedShopperInteractions; - this.Type = type; + BankAccountNumberOption = bankAccountNumber; + BankLocationIdOption = bankLocationId; + BrandOption = brand; + ExpiryMonthOption = expiryMonth; + ExpiryYearOption = expiryYear; + HolderNameOption = holderName; + IbanOption = iban; + IdOption = id; + LabelOption = label; + LastFourOption = lastFour; + NameOption = name; + NetworkTxReferenceOption = networkTxReference; + OwnerNameOption = ownerName; + ShopperEmailOption = shopperEmail; + SupportedRecurringProcessingModelsOption = supportedRecurringProcessingModels; + SupportedShopperInteractionsOption = supportedShopperInteractions; + TypeOption = type; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of BankAccountNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankAccountNumberOption { get; private set; } + /// /// The bank account number (without separators). /// /// The bank account number (without separators). - [DataMember(Name = "bankAccountNumber", EmitDefaultValue = false)] - public string BankAccountNumber { get; set; } + [JsonPropertyName("bankAccountNumber")] + public string BankAccountNumber { get { return this.BankAccountNumberOption; } set { this.BankAccountNumberOption = new Option(value); } } + + /// + /// Used to track the state of BankLocationId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BankLocationIdOption { get; private set; } /// /// The location id of the bank. The field value is `nil` in most cases. /// /// The location id of the bank. The field value is `nil` in most cases. - [DataMember(Name = "bankLocationId", EmitDefaultValue = false)] - public string BankLocationId { get; set; } + [JsonPropertyName("bankLocationId")] + public string BankLocationId { get { return this.BankLocationIdOption; } set { this.BankLocationIdOption = new Option(value); } } + + /// + /// Used to track the state of Brand + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandOption { get; private set; } /// /// The brand of the card. /// /// The brand of the card. - [DataMember(Name = "brand", EmitDefaultValue = false)] - public string Brand { get; set; } + [JsonPropertyName("brand")] + public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } + + /// + /// Used to track the state of ExpiryMonth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiryMonthOption { get; private set; } /// /// The two-digit month when the card expires /// /// The two-digit month when the card expires - [DataMember(Name = "expiryMonth", EmitDefaultValue = false)] - public string ExpiryMonth { get; set; } + [JsonPropertyName("expiryMonth")] + public string ExpiryMonth { get { return this.ExpiryMonthOption; } set { this.ExpiryMonthOption = new Option(value); } } + + /// + /// Used to track the state of ExpiryYear + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiryYearOption { get; private set; } /// /// The last two digits of the year the card expires. For example, **22** for the year 2022. /// /// The last two digits of the year the card expires. For example, **22** for the year 2022. - [DataMember(Name = "expiryYear", EmitDefaultValue = false)] - public string ExpiryYear { get; set; } + [JsonPropertyName("expiryYear")] + public string ExpiryYear { get { return this.ExpiryYearOption; } set { this.ExpiryYearOption = new Option(value); } } + + /// + /// Used to track the state of HolderName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option HolderNameOption { get; private set; } /// /// The unique payment method code. /// /// The unique payment method code. - [DataMember(Name = "holderName", EmitDefaultValue = false)] - public string HolderName { get; set; } + [JsonPropertyName("holderName")] + public string HolderName { get { return this.HolderNameOption; } set { this.HolderNameOption = new Option(value); } } + + /// + /// Used to track the state of Iban + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IbanOption { get; private set; } /// /// The IBAN of the bank account. /// /// The IBAN of the bank account. - [DataMember(Name = "iban", EmitDefaultValue = false)] - public string Iban { get; set; } + [JsonPropertyName("iban")] + public string Iban { get { return this.IbanOption; } set { this.IbanOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } /// /// A unique identifier of this stored payment method. /// /// A unique identifier of this stored payment method. - [DataMember(Name = "id", EmitDefaultValue = false)] - public string Id { get; set; } + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Label + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LabelOption { get; private set; } /// /// The shopper’s issuer account label /// /// The shopper’s issuer account label - [DataMember(Name = "label", EmitDefaultValue = false)] - public string Label { get; set; } + [JsonPropertyName("label")] + public string Label { get { return this.LabelOption; } set { this.LabelOption = new Option(value); } } + + /// + /// Used to track the state of LastFour + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LastFourOption { get; private set; } /// /// The last four digits of the PAN. /// /// The last four digits of the PAN. - [DataMember(Name = "lastFour", EmitDefaultValue = false)] - public string LastFour { get; set; } + [JsonPropertyName("lastFour")] + public string LastFour { get { return this.LastFourOption; } set { this.LastFourOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } /// /// The display name of the stored payment method. /// /// The display name of the stored payment method. - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + + /// + /// Used to track the state of NetworkTxReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NetworkTxReferenceOption { get; private set; } /// /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. /// /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. - [DataMember(Name = "networkTxReference", EmitDefaultValue = false)] - public string NetworkTxReference { get; set; } + [JsonPropertyName("networkTxReference")] + public string NetworkTxReference { get { return this.NetworkTxReferenceOption; } set { this.NetworkTxReferenceOption = new Option(value); } } + + /// + /// Used to track the state of OwnerName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OwnerNameOption { get; private set; } /// /// The name of the bank account holder. /// /// The name of the bank account holder. - [DataMember(Name = "ownerName", EmitDefaultValue = false)] - public string OwnerName { get; set; } + [JsonPropertyName("ownerName")] + public string OwnerName { get { return this.OwnerNameOption; } set { this.OwnerNameOption = new Option(value); } } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The shopper’s email address. /// /// The shopper’s email address. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of SupportedRecurringProcessingModels + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SupportedRecurringProcessingModelsOption { get; private set; } /// /// The supported recurring processing models for this stored payment method. /// /// The supported recurring processing models for this stored payment method. - [DataMember(Name = "supportedRecurringProcessingModels", EmitDefaultValue = false)] - public List SupportedRecurringProcessingModels { get; set; } + [JsonPropertyName("supportedRecurringProcessingModels")] + public List SupportedRecurringProcessingModels { get { return this.SupportedRecurringProcessingModelsOption; } set { this.SupportedRecurringProcessingModelsOption = new Option>(value); } } + + /// + /// Used to track the state of SupportedShopperInteractions + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SupportedShopperInteractionsOption { get; private set; } /// /// The supported shopper interactions for this stored payment method. /// /// The supported shopper interactions for this stored payment method. - [DataMember(Name = "supportedShopperInteractions", EmitDefaultValue = false)] - public List SupportedShopperInteractions { get; set; } + [JsonPropertyName("supportedShopperInteractions")] + public List SupportedShopperInteractions { get { return this.SupportedShopperInteractionsOption; } set { this.SupportedShopperInteractionsOption = new Option>(value); } } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The type of payment method. /// /// The type of payment method. - [DataMember(Name = "type", EmitDefaultValue = false)] - public string Type { get; set; } + [JsonPropertyName("type")] + public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -222,214 +341,313 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class StoredPaymentMethodJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override StoredPaymentMethod Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as StoredPaymentMethod); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if StoredPaymentMethod instances are equal - /// - /// Instance of StoredPaymentMethod to be compared - /// Boolean - public bool Equals(StoredPaymentMethod input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option bankAccountNumber = default; + Option bankLocationId = default; + Option brand = default; + Option expiryMonth = default; + Option expiryYear = default; + Option holderName = default; + Option iban = default; + Option id = default; + Option label = default; + Option lastFour = default; + Option name = default; + Option networkTxReference = default; + Option ownerName = default; + Option shopperEmail = default; + Option> supportedRecurringProcessingModels = default; + Option> supportedShopperInteractions = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "bankAccountNumber": + bankAccountNumber = new Option(utf8JsonReader.GetString()); + break; + case "bankLocationId": + bankLocationId = new Option(utf8JsonReader.GetString()); + break; + case "brand": + brand = new Option(utf8JsonReader.GetString()); + break; + case "expiryMonth": + expiryMonth = new Option(utf8JsonReader.GetString()); + break; + case "expiryYear": + expiryYear = new Option(utf8JsonReader.GetString()); + break; + case "holderName": + holderName = new Option(utf8JsonReader.GetString()); + break; + case "iban": + iban = new Option(utf8JsonReader.GetString()); + break; + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "label": + label = new Option(utf8JsonReader.GetString()); + break; + case "lastFour": + lastFour = new Option(utf8JsonReader.GetString()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "networkTxReference": + networkTxReference = new Option(utf8JsonReader.GetString()); + break; + case "ownerName": + ownerName = new Option(utf8JsonReader.GetString()); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "supportedRecurringProcessingModels": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + supportedRecurringProcessingModels = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "supportedShopperInteractions": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + supportedShopperInteractions = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.BankAccountNumber == input.BankAccountNumber || - (this.BankAccountNumber != null && - this.BankAccountNumber.Equals(input.BankAccountNumber)) - ) && - ( - this.BankLocationId == input.BankLocationId || - (this.BankLocationId != null && - this.BankLocationId.Equals(input.BankLocationId)) - ) && - ( - this.Brand == input.Brand || - (this.Brand != null && - this.Brand.Equals(input.Brand)) - ) && - ( - this.ExpiryMonth == input.ExpiryMonth || - (this.ExpiryMonth != null && - this.ExpiryMonth.Equals(input.ExpiryMonth)) - ) && - ( - this.ExpiryYear == input.ExpiryYear || - (this.ExpiryYear != null && - this.ExpiryYear.Equals(input.ExpiryYear)) - ) && - ( - this.HolderName == input.HolderName || - (this.HolderName != null && - this.HolderName.Equals(input.HolderName)) - ) && - ( - this.Iban == input.Iban || - (this.Iban != null && - this.Iban.Equals(input.Iban)) - ) && - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.Label == input.Label || - (this.Label != null && - this.Label.Equals(input.Label)) - ) && - ( - this.LastFour == input.LastFour || - (this.LastFour != null && - this.LastFour.Equals(input.LastFour)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.NetworkTxReference == input.NetworkTxReference || - (this.NetworkTxReference != null && - this.NetworkTxReference.Equals(input.NetworkTxReference)) - ) && - ( - this.OwnerName == input.OwnerName || - (this.OwnerName != null && - this.OwnerName.Equals(input.OwnerName)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.SupportedRecurringProcessingModels == input.SupportedRecurringProcessingModels || - this.SupportedRecurringProcessingModels != null && - input.SupportedRecurringProcessingModels != null && - this.SupportedRecurringProcessingModels.SequenceEqual(input.SupportedRecurringProcessingModels) - ) && - ( - this.SupportedShopperInteractions == input.SupportedShopperInteractions || - this.SupportedShopperInteractions != null && - input.SupportedShopperInteractions != null && - this.SupportedShopperInteractions.SequenceEqual(input.SupportedShopperInteractions) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ); + + if (bankAccountNumber.IsSet && bankAccountNumber.Value == null) + throw new ArgumentNullException(nameof(bankAccountNumber), "Property is not nullable for class StoredPaymentMethod."); + + if (bankLocationId.IsSet && bankLocationId.Value == null) + throw new ArgumentNullException(nameof(bankLocationId), "Property is not nullable for class StoredPaymentMethod."); + + if (brand.IsSet && brand.Value == null) + throw new ArgumentNullException(nameof(brand), "Property is not nullable for class StoredPaymentMethod."); + + if (expiryMonth.IsSet && expiryMonth.Value == null) + throw new ArgumentNullException(nameof(expiryMonth), "Property is not nullable for class StoredPaymentMethod."); + + if (expiryYear.IsSet && expiryYear.Value == null) + throw new ArgumentNullException(nameof(expiryYear), "Property is not nullable for class StoredPaymentMethod."); + + if (holderName.IsSet && holderName.Value == null) + throw new ArgumentNullException(nameof(holderName), "Property is not nullable for class StoredPaymentMethod."); + + if (iban.IsSet && iban.Value == null) + throw new ArgumentNullException(nameof(iban), "Property is not nullable for class StoredPaymentMethod."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class StoredPaymentMethod."); + + if (label.IsSet && label.Value == null) + throw new ArgumentNullException(nameof(label), "Property is not nullable for class StoredPaymentMethod."); + + if (lastFour.IsSet && lastFour.Value == null) + throw new ArgumentNullException(nameof(lastFour), "Property is not nullable for class StoredPaymentMethod."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class StoredPaymentMethod."); + + if (networkTxReference.IsSet && networkTxReference.Value == null) + throw new ArgumentNullException(nameof(networkTxReference), "Property is not nullable for class StoredPaymentMethod."); + + if (ownerName.IsSet && ownerName.Value == null) + throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class StoredPaymentMethod."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class StoredPaymentMethod."); + + if (supportedRecurringProcessingModels.IsSet && supportedRecurringProcessingModels.Value == null) + throw new ArgumentNullException(nameof(supportedRecurringProcessingModels), "Property is not nullable for class StoredPaymentMethod."); + + if (supportedShopperInteractions.IsSet && supportedShopperInteractions.Value == null) + throw new ArgumentNullException(nameof(supportedShopperInteractions), "Property is not nullable for class StoredPaymentMethod."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class StoredPaymentMethod."); + + return new StoredPaymentMethod(bankAccountNumber, bankLocationId, brand, expiryMonth, expiryYear, holderName, iban, id, label, lastFour, name, networkTxReference, ownerName, shopperEmail, supportedRecurringProcessingModels, supportedShopperInteractions, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, StoredPaymentMethod storedPaymentMethod, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BankAccountNumber != null) - { - hashCode = (hashCode * 59) + this.BankAccountNumber.GetHashCode(); - } - if (this.BankLocationId != null) - { - hashCode = (hashCode * 59) + this.BankLocationId.GetHashCode(); - } - if (this.Brand != null) - { - hashCode = (hashCode * 59) + this.Brand.GetHashCode(); - } - if (this.ExpiryMonth != null) - { - hashCode = (hashCode * 59) + this.ExpiryMonth.GetHashCode(); - } - if (this.ExpiryYear != null) - { - hashCode = (hashCode * 59) + this.ExpiryYear.GetHashCode(); - } - if (this.HolderName != null) - { - hashCode = (hashCode * 59) + this.HolderName.GetHashCode(); - } - if (this.Iban != null) - { - hashCode = (hashCode * 59) + this.Iban.GetHashCode(); - } - if (this.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - if (this.Label != null) - { - hashCode = (hashCode * 59) + this.Label.GetHashCode(); - } - if (this.LastFour != null) - { - hashCode = (hashCode * 59) + this.LastFour.GetHashCode(); - } - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.NetworkTxReference != null) - { - hashCode = (hashCode * 59) + this.NetworkTxReference.GetHashCode(); - } - if (this.OwnerName != null) - { - hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.SupportedRecurringProcessingModels != null) - { - hashCode = (hashCode * 59) + this.SupportedRecurringProcessingModels.GetHashCode(); - } - if (this.SupportedShopperInteractions != null) - { - hashCode = (hashCode * 59) + this.SupportedShopperInteractions.GetHashCode(); - } - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, storedPaymentMethod, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, StoredPaymentMethod storedPaymentMethod, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (storedPaymentMethod.BankAccountNumberOption.IsSet && storedPaymentMethod.BankAccountNumber == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.BankAccountNumber), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.BankLocationIdOption.IsSet && storedPaymentMethod.BankLocationId == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.BankLocationId), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.BrandOption.IsSet && storedPaymentMethod.Brand == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.Brand), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.ExpiryMonthOption.IsSet && storedPaymentMethod.ExpiryMonth == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.ExpiryMonth), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.ExpiryYearOption.IsSet && storedPaymentMethod.ExpiryYear == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.ExpiryYear), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.HolderNameOption.IsSet && storedPaymentMethod.HolderName == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.HolderName), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.IbanOption.IsSet && storedPaymentMethod.Iban == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.Iban), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.IdOption.IsSet && storedPaymentMethod.Id == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.Id), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.LabelOption.IsSet && storedPaymentMethod.Label == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.Label), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.LastFourOption.IsSet && storedPaymentMethod.LastFour == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.LastFour), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.NameOption.IsSet && storedPaymentMethod.Name == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.Name), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.NetworkTxReferenceOption.IsSet && storedPaymentMethod.NetworkTxReference == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.NetworkTxReference), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.OwnerNameOption.IsSet && storedPaymentMethod.OwnerName == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.OwnerName), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.ShopperEmailOption.IsSet && storedPaymentMethod.ShopperEmail == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.ShopperEmail), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.SupportedRecurringProcessingModelsOption.IsSet && storedPaymentMethod.SupportedRecurringProcessingModels == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.SupportedRecurringProcessingModels), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.SupportedShopperInteractionsOption.IsSet && storedPaymentMethod.SupportedShopperInteractions == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.SupportedShopperInteractions), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.TypeOption.IsSet && storedPaymentMethod.Type == null) + throw new ArgumentNullException(nameof(storedPaymentMethod.Type), "Property is required for class StoredPaymentMethod."); + + if (storedPaymentMethod.BankAccountNumberOption.IsSet) + writer.WriteString("bankAccountNumber", storedPaymentMethod.BankAccountNumber); + + if (storedPaymentMethod.BankLocationIdOption.IsSet) + writer.WriteString("bankLocationId", storedPaymentMethod.BankLocationId); + + if (storedPaymentMethod.BrandOption.IsSet) + writer.WriteString("brand", storedPaymentMethod.Brand); + + if (storedPaymentMethod.ExpiryMonthOption.IsSet) + writer.WriteString("expiryMonth", storedPaymentMethod.ExpiryMonth); + + if (storedPaymentMethod.ExpiryYearOption.IsSet) + writer.WriteString("expiryYear", storedPaymentMethod.ExpiryYear); + + if (storedPaymentMethod.HolderNameOption.IsSet) + writer.WriteString("holderName", storedPaymentMethod.HolderName); + + if (storedPaymentMethod.IbanOption.IsSet) + writer.WriteString("iban", storedPaymentMethod.Iban); + + if (storedPaymentMethod.IdOption.IsSet) + writer.WriteString("id", storedPaymentMethod.Id); + + if (storedPaymentMethod.LabelOption.IsSet) + writer.WriteString("label", storedPaymentMethod.Label); + + if (storedPaymentMethod.LastFourOption.IsSet) + writer.WriteString("lastFour", storedPaymentMethod.LastFour); + + if (storedPaymentMethod.NameOption.IsSet) + writer.WriteString("name", storedPaymentMethod.Name); + + if (storedPaymentMethod.NetworkTxReferenceOption.IsSet) + writer.WriteString("networkTxReference", storedPaymentMethod.NetworkTxReference); + + if (storedPaymentMethod.OwnerNameOption.IsSet) + writer.WriteString("ownerName", storedPaymentMethod.OwnerName); + + if (storedPaymentMethod.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", storedPaymentMethod.ShopperEmail); + + if (storedPaymentMethod.SupportedRecurringProcessingModelsOption.IsSet) + { + writer.WritePropertyName("supportedRecurringProcessingModels"); + JsonSerializer.Serialize(writer, storedPaymentMethod.SupportedRecurringProcessingModels, jsonSerializerOptions); + } + if (storedPaymentMethod.SupportedShopperInteractionsOption.IsSet) + { + writer.WritePropertyName("supportedShopperInteractions"); + JsonSerializer.Serialize(writer, storedPaymentMethod.SupportedShopperInteractions, jsonSerializerOptions); + } + if (storedPaymentMethod.TypeOption.IsSet) + writer.WriteString("type", storedPaymentMethod.Type); } } - } diff --git a/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs b/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs index fb8f4885f..f43c4717e 100644 --- a/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs +++ b/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,183 +14,386 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// StoredPaymentMethodDetails /// - [DataContract(Name = "StoredPaymentMethodDetails")] - public partial class StoredPaymentMethodDetails : IEquatable, IValidatableObject + public partial class StoredPaymentMethodDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The payment method type. + [JsonConstructor] + public StoredPaymentMethodDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The payment method type. /// /// The payment method type. - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum BcmcMobile for value: bcmc_mobile /// - [EnumMember(Value = "bcmc_mobile")] BcmcMobile = 1, /// /// Enum BcmcMobileQR for value: bcmc_mobile_QR /// - [EnumMember(Value = "bcmc_mobile_QR")] BcmcMobileQR = 2, /// /// Enum BcmcMobileApp for value: bcmc_mobile_app /// - [EnumMember(Value = "bcmc_mobile_app")] BcmcMobileApp = 3, /// /// Enum MomoWallet for value: momo_wallet /// - [EnumMember(Value = "momo_wallet")] MomoWallet = 4, /// /// Enum MomoWalletApp for value: momo_wallet_app /// - [EnumMember(Value = "momo_wallet_app")] MomoWalletApp = 5, /// /// Enum PaymayaWallet for value: paymaya_wallet /// - [EnumMember(Value = "paymaya_wallet")] PaymayaWallet = 6, /// /// Enum GrabpaySG for value: grabpay_SG /// - [EnumMember(Value = "grabpay_SG")] GrabpaySG = 7, /// /// Enum GrabpayMY for value: grabpay_MY /// - [EnumMember(Value = "grabpay_MY")] GrabpayMY = 8, /// /// Enum GrabpayTH for value: grabpay_TH /// - [EnumMember(Value = "grabpay_TH")] GrabpayTH = 9, /// /// Enum GrabpayID for value: grabpay_ID /// - [EnumMember(Value = "grabpay_ID")] GrabpayID = 10, /// /// Enum GrabpayVN for value: grabpay_VN /// - [EnumMember(Value = "grabpay_VN")] GrabpayVN = 11, /// /// Enum GrabpayPH for value: grabpay_PH /// - [EnumMember(Value = "grabpay_PH")] GrabpayPH = 12, /// /// Enum Oxxo for value: oxxo /// - [EnumMember(Value = "oxxo")] Oxxo = 13, /// /// Enum Gcash for value: gcash /// - [EnumMember(Value = "gcash")] Gcash = 14, /// /// Enum Dana for value: dana /// - [EnumMember(Value = "dana")] Dana = 15, /// /// Enum Kakaopay for value: kakaopay /// - [EnumMember(Value = "kakaopay")] Kakaopay = 16, /// /// Enum Truemoney for value: truemoney /// - [EnumMember(Value = "truemoney")] Truemoney = 17, /// /// Enum Paysafecard for value: paysafecard /// - [EnumMember(Value = "paysafecard")] Paysafecard = 18 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("bcmc_mobile")) + return TypeEnum.BcmcMobile; + + if (value.Equals("bcmc_mobile_QR")) + return TypeEnum.BcmcMobileQR; + + if (value.Equals("bcmc_mobile_app")) + return TypeEnum.BcmcMobileApp; + + if (value.Equals("momo_wallet")) + return TypeEnum.MomoWallet; + + if (value.Equals("momo_wallet_app")) + return TypeEnum.MomoWalletApp; + + if (value.Equals("paymaya_wallet")) + return TypeEnum.PaymayaWallet; + + if (value.Equals("grabpay_SG")) + return TypeEnum.GrabpaySG; + + if (value.Equals("grabpay_MY")) + return TypeEnum.GrabpayMY; + + if (value.Equals("grabpay_TH")) + return TypeEnum.GrabpayTH; + + if (value.Equals("grabpay_ID")) + return TypeEnum.GrabpayID; + + if (value.Equals("grabpay_VN")) + return TypeEnum.GrabpayVN; + + if (value.Equals("grabpay_PH")) + return TypeEnum.GrabpayPH; + + if (value.Equals("oxxo")) + return TypeEnum.Oxxo; + + if (value.Equals("gcash")) + return TypeEnum.Gcash; + + if (value.Equals("dana")) + return TypeEnum.Dana; + + if (value.Equals("kakaopay")) + return TypeEnum.Kakaopay; + + if (value.Equals("truemoney")) + return TypeEnum.Truemoney; + + if (value.Equals("paysafecard")) + return TypeEnum.Paysafecard; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("bcmc_mobile")) + return TypeEnum.BcmcMobile; + + if (value.Equals("bcmc_mobile_QR")) + return TypeEnum.BcmcMobileQR; + + if (value.Equals("bcmc_mobile_app")) + return TypeEnum.BcmcMobileApp; + + if (value.Equals("momo_wallet")) + return TypeEnum.MomoWallet; + + if (value.Equals("momo_wallet_app")) + return TypeEnum.MomoWalletApp; + + if (value.Equals("paymaya_wallet")) + return TypeEnum.PaymayaWallet; + + if (value.Equals("grabpay_SG")) + return TypeEnum.GrabpaySG; + + if (value.Equals("grabpay_MY")) + return TypeEnum.GrabpayMY; + + if (value.Equals("grabpay_TH")) + return TypeEnum.GrabpayTH; + + if (value.Equals("grabpay_ID")) + return TypeEnum.GrabpayID; + + if (value.Equals("grabpay_VN")) + return TypeEnum.GrabpayVN; + + if (value.Equals("grabpay_PH")) + return TypeEnum.GrabpayPH; + + if (value.Equals("oxxo")) + return TypeEnum.Oxxo; + + if (value.Equals("gcash")) + return TypeEnum.Gcash; + + if (value.Equals("dana")) + return TypeEnum.Dana; + + if (value.Equals("kakaopay")) + return TypeEnum.Kakaopay; + + if (value.Equals("truemoney")) + return TypeEnum.Truemoney; + + if (value.Equals("paysafecard")) + return TypeEnum.Paysafecard; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.BcmcMobile) + return "bcmc_mobile"; + + if (value == TypeEnum.BcmcMobileQR) + return "bcmc_mobile_QR"; + + if (value == TypeEnum.BcmcMobileApp) + return "bcmc_mobile_app"; + + if (value == TypeEnum.MomoWallet) + return "momo_wallet"; + + if (value == TypeEnum.MomoWalletApp) + return "momo_wallet_app"; + + if (value == TypeEnum.PaymayaWallet) + return "paymaya_wallet"; + + if (value == TypeEnum.GrabpaySG) + return "grabpay_SG"; + + if (value == TypeEnum.GrabpayMY) + return "grabpay_MY"; + + if (value == TypeEnum.GrabpayTH) + return "grabpay_TH"; + + if (value == TypeEnum.GrabpayID) + return "grabpay_ID"; + + if (value == TypeEnum.GrabpayVN) + return "grabpay_VN"; + + if (value == TypeEnum.GrabpayPH) + return "grabpay_PH"; + + if (value == TypeEnum.Oxxo) + return "oxxo"; + if (value == TypeEnum.Gcash) + return "gcash"; + + if (value == TypeEnum.Dana) + return "dana"; + + if (value == TypeEnum.Kakaopay) + return "kakaopay"; + + if (value == TypeEnum.Truemoney) + return "truemoney"; + + if (value == TypeEnum.Paysafecard) + return "paysafecard"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The payment method type. /// /// The payment method type. - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The payment method type.. - public StoredPaymentMethodDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = default(TypeEnum?)) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -210,97 +412,143 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as StoredPaymentMethodDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class StoredPaymentMethodDetailsJsonConverter : JsonConverter + { /// - /// Returns true if StoredPaymentMethodDetails instances are equal + /// Deserializes json to /// - /// Instance of StoredPaymentMethodDetails to be compared - /// Boolean - public bool Equals(StoredPaymentMethodDetails input) + /// + /// + /// + /// + /// + public override StoredPaymentMethodDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(StoredPaymentMethodDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class StoredPaymentMethodDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class StoredPaymentMethodDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class StoredPaymentMethodDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class StoredPaymentMethodDetails."); + + return new StoredPaymentMethodDetails(checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, StoredPaymentMethodDetails storedPaymentMethodDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, storedPaymentMethodDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, StoredPaymentMethodDetails storedPaymentMethodDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (storedPaymentMethodDetails.CheckoutAttemptIdOption.IsSet && storedPaymentMethodDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(storedPaymentMethodDetails.CheckoutAttemptId), "Property is required for class StoredPaymentMethodDetails."); - yield break; + if (storedPaymentMethodDetails.RecurringDetailReferenceOption.IsSet && storedPaymentMethodDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(storedPaymentMethodDetails.RecurringDetailReference), "Property is required for class StoredPaymentMethodDetails."); + + if (storedPaymentMethodDetails.StoredPaymentMethodIdOption.IsSet && storedPaymentMethodDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(storedPaymentMethodDetails.StoredPaymentMethodId), "Property is required for class StoredPaymentMethodDetails."); + + if (storedPaymentMethodDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", storedPaymentMethodDetails.CheckoutAttemptId); + + if (storedPaymentMethodDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", storedPaymentMethodDetails.RecurringDetailReference); + + if (storedPaymentMethodDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", storedPaymentMethodDetails.StoredPaymentMethodId); + + var typeRawValue = StoredPaymentMethodDetails.TypeEnumToJsonValue(storedPaymentMethodDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/StoredPaymentMethodRequest.cs b/Adyen/Model/Checkout/StoredPaymentMethodRequest.cs index 5d0410d79..09acfa919 100644 --- a/Adyen/Model/Checkout/StoredPaymentMethodRequest.cs +++ b/Adyen/Model/Checkout/StoredPaymentMethodRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,114 +14,178 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// StoredPaymentMethodRequest /// - [DataContract(Name = "StoredPaymentMethodRequest")] - public partial class StoredPaymentMethodRequest : IEquatable, IValidatableObject + public partial class StoredPaymentMethodRequest : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The merchant account identifier, with which you want to process the transaction. + /// paymentMethod + /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// A unique identifier for the shopper (for example, user ID or account ID). + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. + /// The IP address of a shopper. + [JsonConstructor] + public StoredPaymentMethodRequest(string merchantAccount, PaymentMethodToStore paymentMethod, RecurringProcessingModelEnum recurringProcessingModel, string shopperReference, Option shopperEmail = default, Option shopperIP = default) + { + MerchantAccount = merchantAccount; + PaymentMethod = paymentMethod; + RecurringProcessingModel = recurringProcessingModel; + ShopperReference = shopperReference; + ShopperEmailOption = shopperEmail; + ShopperIPOption = shopperIP; + OnCreated(); + } + + partial void OnCreated(); + /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// - [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// - [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// - [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 - } - /// - /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// Returns a /// - /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [DataMember(Name = "recurringProcessingModel", IsRequired = false, EmitDefaultValue = false)] - public RecurringProcessingModelEnum RecurringProcessingModel { get; set; } + /// + /// + /// + public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected StoredPaymentMethodRequest() { } + /// + /// + public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) + { + if (value.Equals("CardOnFile")) + return RecurringProcessingModelEnum.CardOnFile; + + if (value.Equals("Subscription")) + return RecurringProcessingModelEnum.Subscription; + + if (value.Equals("UnscheduledCardOnFile")) + return RecurringProcessingModelEnum.UnscheduledCardOnFile; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The merchant account identifier, with which you want to process the transaction. (required). - /// paymentMethod (required). - /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. (required). - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks.. - /// The IP address of a shopper.. - /// A unique identifier for the shopper (for example, user ID or account ID). (required). - public StoredPaymentMethodRequest(string merchantAccount = default(string), PaymentMethodToStore paymentMethod = default(PaymentMethodToStore), RecurringProcessingModelEnum recurringProcessingModel = default(RecurringProcessingModelEnum), string shopperEmail = default(string), string shopperIP = default(string), string shopperReference = default(string)) + /// + /// + /// + public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum value) { - this.MerchantAccount = merchantAccount; - this.PaymentMethod = paymentMethod; - this.RecurringProcessingModel = recurringProcessingModel; - this.ShopperReference = shopperReference; - this.ShopperEmail = shopperEmail; - this.ShopperIP = shopperIP; + if (value == RecurringProcessingModelEnum.CardOnFile) + return "CardOnFile"; + + if (value == RecurringProcessingModelEnum.Subscription) + return "Subscription"; + + if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) + return "UnscheduledCardOnFile"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// + /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [JsonPropertyName("recurringProcessingModel")] + public RecurringProcessingModelEnum RecurringProcessingModel { get; set; } + /// /// The merchant account identifier, with which you want to process the transaction. /// /// The merchant account identifier, with which you want to process the transaction. - [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("merchantAccount")] public string MerchantAccount { get; set; } /// /// Gets or Sets PaymentMethod /// - [DataMember(Name = "paymentMethod", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("paymentMethod")] public PaymentMethodToStore PaymentMethod { get; set; } + /// + /// A unique identifier for the shopper (for example, user ID or account ID). + /// + /// A unique identifier for the shopper (for example, user ID or account ID). + [JsonPropertyName("shopperReference")] + public string ShopperReference { get; set; } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } + /// /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. /// /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } /// - /// The IP address of a shopper. + /// Used to track the state of ShopperIP /// - /// The IP address of a shopper. - [DataMember(Name = "shopperIP", EmitDefaultValue = false)] - public string ShopperIP { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperIPOption { get; private set; } /// - /// A unique identifier for the shopper (for example, user ID or account ID). + /// The IP address of a shopper. /// - /// A unique identifier for the shopper (for example, user ID or account ID). - [DataMember(Name = "shopperReference", IsRequired = false, EmitDefaultValue = false)] - public string ShopperReference { get; set; } + /// The IP address of a shopper. + [JsonPropertyName("shopperIP")] + public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -135,117 +198,180 @@ public override string ToString() sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); + sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" ShopperIP: ").Append(ShopperIP).Append("\n"); - sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class StoredPaymentMethodRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override StoredPaymentMethodRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as StoredPaymentMethodRequest); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if StoredPaymentMethodRequest instances are equal - /// - /// Instance of StoredPaymentMethodRequest to be compared - /// Boolean - public bool Equals(StoredPaymentMethodRequest input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option merchantAccount = default; + Option paymentMethod = default; + Option recurringProcessingModel = default; + Option shopperReference = default; + Option shopperEmail = default; + Option shopperIP = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "merchantAccount": + merchantAccount = new Option(utf8JsonReader.GetString()); + break; + case "paymentMethod": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "recurringProcessingModel": + string recurringProcessingModelRawValue = utf8JsonReader.GetString(); + if (recurringProcessingModelRawValue != null) + recurringProcessingModel = new Option(StoredPaymentMethodRequest.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); + break; + case "shopperReference": + shopperReference = new Option(utf8JsonReader.GetString()); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "shopperIP": + shopperIP = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) - ) && - ( - this.PaymentMethod == input.PaymentMethod || - (this.PaymentMethod != null && - this.PaymentMethod.Equals(input.PaymentMethod)) - ) && - ( - this.RecurringProcessingModel == input.RecurringProcessingModel || - this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.ShopperIP == input.ShopperIP || - (this.ShopperIP != null && - this.ShopperIP.Equals(input.ShopperIP)) - ) && - ( - this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) - ); + + if (!merchantAccount.IsSet) + throw new ArgumentException("Property is required for class StoredPaymentMethodRequest.", nameof(merchantAccount)); + + if (!paymentMethod.IsSet) + throw new ArgumentException("Property is required for class StoredPaymentMethodRequest.", nameof(paymentMethod)); + + if (!recurringProcessingModel.IsSet) + throw new ArgumentException("Property is required for class StoredPaymentMethodRequest.", nameof(recurringProcessingModel)); + + if (!shopperReference.IsSet) + throw new ArgumentException("Property is required for class StoredPaymentMethodRequest.", nameof(shopperReference)); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class StoredPaymentMethodRequest."); + + if (paymentMethod.IsSet && paymentMethod.Value == null) + throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class StoredPaymentMethodRequest."); + + if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) + throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class StoredPaymentMethodRequest."); + + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class StoredPaymentMethodRequest."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class StoredPaymentMethodRequest."); + + if (shopperIP.IsSet && shopperIP.Value == null) + throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class StoredPaymentMethodRequest."); + + return new StoredPaymentMethodRequest(merchantAccount.Value, paymentMethod.Value, recurringProcessingModel.Value.Value, shopperReference.Value, shopperEmail, shopperIP); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, StoredPaymentMethodRequest storedPaymentMethodRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.MerchantAccount != null) - { - hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); - } - if (this.PaymentMethod != null) - { - hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); - } - hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.ShopperIP != null) - { - hashCode = (hashCode * 59) + this.ShopperIP.GetHashCode(); - } - if (this.ShopperReference != null) - { - hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, storedPaymentMethodRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, StoredPaymentMethodRequest storedPaymentMethodRequest, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (storedPaymentMethodRequest.MerchantAccount == null) + throw new ArgumentNullException(nameof(storedPaymentMethodRequest.MerchantAccount), "Property is required for class StoredPaymentMethodRequest."); + + if (storedPaymentMethodRequest.PaymentMethod == null) + throw new ArgumentNullException(nameof(storedPaymentMethodRequest.PaymentMethod), "Property is required for class StoredPaymentMethodRequest."); + + if (storedPaymentMethodRequest.ShopperReference == null) + throw new ArgumentNullException(nameof(storedPaymentMethodRequest.ShopperReference), "Property is required for class StoredPaymentMethodRequest."); + + if (storedPaymentMethodRequest.ShopperEmailOption.IsSet && storedPaymentMethodRequest.ShopperEmail == null) + throw new ArgumentNullException(nameof(storedPaymentMethodRequest.ShopperEmail), "Property is required for class StoredPaymentMethodRequest."); + + if (storedPaymentMethodRequest.ShopperIPOption.IsSet && storedPaymentMethodRequest.ShopperIP == null) + throw new ArgumentNullException(nameof(storedPaymentMethodRequest.ShopperIP), "Property is required for class StoredPaymentMethodRequest."); + + writer.WriteString("merchantAccount", storedPaymentMethodRequest.MerchantAccount); + + writer.WritePropertyName("paymentMethod"); + JsonSerializer.Serialize(writer, storedPaymentMethodRequest.PaymentMethod, jsonSerializerOptions); + var recurringProcessingModelRawValue = StoredPaymentMethodRequest.RecurringProcessingModelEnumToJsonValue(storedPaymentMethodRequest.RecurringProcessingModel); + writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); + writer.WriteString("shopperReference", storedPaymentMethodRequest.ShopperReference); + + if (storedPaymentMethodRequest.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", storedPaymentMethodRequest.ShopperEmail); + + if (storedPaymentMethodRequest.ShopperIPOption.IsSet) + writer.WriteString("shopperIP", storedPaymentMethodRequest.ShopperIP); } } - } diff --git a/Adyen/Model/Checkout/StoredPaymentMethodResource.cs b/Adyen/Model/Checkout/StoredPaymentMethodResource.cs index 8ec3b3ef6..df9d63580 100644 --- a/Adyen/Model/Checkout/StoredPaymentMethodResource.cs +++ b/Adyen/Model/Checkout/StoredPaymentMethodResource.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,182 +14,302 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// StoredPaymentMethodResource /// - [DataContract(Name = "StoredPaymentMethodResource")] - public partial class StoredPaymentMethodResource : IEquatable, IValidatableObject + public partial class StoredPaymentMethodResource : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The brand of the card.. - /// The month the card expires.. - /// The last two digits of the year the card expires. For example, **22** for the year 2022.. - /// The response code returned by an external system (for example after a provisioning operation).. - /// The token reference of a linked token in an external system (for example a network token reference).. - /// The unique payment method code.. - /// The IBAN of the bank account.. - /// A unique identifier of this stored payment method.. - /// The name of the issuer of token or card.. - /// The last four digits of the PAN.. - /// The display name of the stored payment method.. - /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID.. - /// The name of the bank account holder.. - /// The shopper’s email address.. - /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. - /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount.. - /// The type of payment method.. - public StoredPaymentMethodResource(string brand = default(string), string expiryMonth = default(string), string expiryYear = default(string), string externalResponseCode = default(string), string externalTokenReference = default(string), string holderName = default(string), string iban = default(string), string id = default(string), string issuerName = default(string), string lastFour = default(string), string name = default(string), string networkTxReference = default(string), string ownerName = default(string), string shopperEmail = default(string), string shopperReference = default(string), List supportedRecurringProcessingModels = default(List), string type = default(string)) + /// The brand of the card. + /// The month the card expires. + /// The last two digits of the year the card expires. For example, **22** for the year 2022. + /// The response code returned by an external system (for example after a provisioning operation). + /// The token reference of a linked token in an external system (for example a network token reference). + /// The unique payment method code. + /// The IBAN of the bank account. + /// A unique identifier of this stored payment method. + /// The name of the issuer of token or card. + /// The last four digits of the PAN. + /// The display name of the stored payment method. + /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. + /// The name of the bank account holder. + /// The shopper’s email address. + /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// The type of payment method. + [JsonConstructor] + public StoredPaymentMethodResource(Option brand = default, Option expiryMonth = default, Option expiryYear = default, Option externalResponseCode = default, Option externalTokenReference = default, Option holderName = default, Option iban = default, Option id = default, Option issuerName = default, Option lastFour = default, Option name = default, Option networkTxReference = default, Option ownerName = default, Option shopperEmail = default, Option shopperReference = default, Option> supportedRecurringProcessingModels = default, Option type = default) { - this.Brand = brand; - this.ExpiryMonth = expiryMonth; - this.ExpiryYear = expiryYear; - this.ExternalResponseCode = externalResponseCode; - this.ExternalTokenReference = externalTokenReference; - this.HolderName = holderName; - this.Iban = iban; - this.Id = id; - this.IssuerName = issuerName; - this.LastFour = lastFour; - this.Name = name; - this.NetworkTxReference = networkTxReference; - this.OwnerName = ownerName; - this.ShopperEmail = shopperEmail; - this.ShopperReference = shopperReference; - this.SupportedRecurringProcessingModels = supportedRecurringProcessingModels; - this.Type = type; + BrandOption = brand; + ExpiryMonthOption = expiryMonth; + ExpiryYearOption = expiryYear; + ExternalResponseCodeOption = externalResponseCode; + ExternalTokenReferenceOption = externalTokenReference; + HolderNameOption = holderName; + IbanOption = iban; + IdOption = id; + IssuerNameOption = issuerName; + LastFourOption = lastFour; + NameOption = name; + NetworkTxReferenceOption = networkTxReference; + OwnerNameOption = ownerName; + ShopperEmailOption = shopperEmail; + ShopperReferenceOption = shopperReference; + SupportedRecurringProcessingModelsOption = supportedRecurringProcessingModels; + TypeOption = type; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Brand + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandOption { get; private set; } + /// /// The brand of the card. /// /// The brand of the card. - [DataMember(Name = "brand", EmitDefaultValue = false)] - public string Brand { get; set; } + [JsonPropertyName("brand")] + public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } + + /// + /// Used to track the state of ExpiryMonth + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiryMonthOption { get; private set; } /// /// The month the card expires. /// /// The month the card expires. - [DataMember(Name = "expiryMonth", EmitDefaultValue = false)] - public string ExpiryMonth { get; set; } + [JsonPropertyName("expiryMonth")] + public string ExpiryMonth { get { return this.ExpiryMonthOption; } set { this.ExpiryMonthOption = new Option(value); } } + + /// + /// Used to track the state of ExpiryYear + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExpiryYearOption { get; private set; } /// /// The last two digits of the year the card expires. For example, **22** for the year 2022. /// /// The last two digits of the year the card expires. For example, **22** for the year 2022. - [DataMember(Name = "expiryYear", EmitDefaultValue = false)] - public string ExpiryYear { get; set; } + [JsonPropertyName("expiryYear")] + public string ExpiryYear { get { return this.ExpiryYearOption; } set { this.ExpiryYearOption = new Option(value); } } + + /// + /// Used to track the state of ExternalResponseCode + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExternalResponseCodeOption { get; private set; } /// /// The response code returned by an external system (for example after a provisioning operation). /// /// The response code returned by an external system (for example after a provisioning operation). - [DataMember(Name = "externalResponseCode", EmitDefaultValue = false)] - public string ExternalResponseCode { get; set; } + [JsonPropertyName("externalResponseCode")] + public string ExternalResponseCode { get { return this.ExternalResponseCodeOption; } set { this.ExternalResponseCodeOption = new Option(value); } } + + /// + /// Used to track the state of ExternalTokenReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExternalTokenReferenceOption { get; private set; } /// /// The token reference of a linked token in an external system (for example a network token reference). /// /// The token reference of a linked token in an external system (for example a network token reference). - [DataMember(Name = "externalTokenReference", EmitDefaultValue = false)] - public string ExternalTokenReference { get; set; } + [JsonPropertyName("externalTokenReference")] + public string ExternalTokenReference { get { return this.ExternalTokenReferenceOption; } set { this.ExternalTokenReferenceOption = new Option(value); } } + + /// + /// Used to track the state of HolderName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option HolderNameOption { get; private set; } /// /// The unique payment method code. /// /// The unique payment method code. - [DataMember(Name = "holderName", EmitDefaultValue = false)] - public string HolderName { get; set; } + [JsonPropertyName("holderName")] + public string HolderName { get { return this.HolderNameOption; } set { this.HolderNameOption = new Option(value); } } + + /// + /// Used to track the state of Iban + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IbanOption { get; private set; } /// /// The IBAN of the bank account. /// /// The IBAN of the bank account. - [DataMember(Name = "iban", EmitDefaultValue = false)] - public string Iban { get; set; } + [JsonPropertyName("iban")] + public string Iban { get { return this.IbanOption; } set { this.IbanOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } /// /// A unique identifier of this stored payment method. /// /// A unique identifier of this stored payment method. - [DataMember(Name = "id", EmitDefaultValue = false)] - public string Id { get; set; } + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of IssuerName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IssuerNameOption { get; private set; } /// /// The name of the issuer of token or card. /// /// The name of the issuer of token or card. - [DataMember(Name = "issuerName", EmitDefaultValue = false)] - public string IssuerName { get; set; } + [JsonPropertyName("issuerName")] + public string IssuerName { get { return this.IssuerNameOption; } set { this.IssuerNameOption = new Option(value); } } + + /// + /// Used to track the state of LastFour + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option LastFourOption { get; private set; } /// /// The last four digits of the PAN. /// /// The last four digits of the PAN. - [DataMember(Name = "lastFour", EmitDefaultValue = false)] - public string LastFour { get; set; } + [JsonPropertyName("lastFour")] + public string LastFour { get { return this.LastFourOption; } set { this.LastFourOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } /// /// The display name of the stored payment method. /// /// The display name of the stored payment method. - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + + /// + /// Used to track the state of NetworkTxReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NetworkTxReferenceOption { get; private set; } /// /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. /// /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. - [DataMember(Name = "networkTxReference", EmitDefaultValue = false)] - public string NetworkTxReference { get; set; } + [JsonPropertyName("networkTxReference")] + public string NetworkTxReference { get { return this.NetworkTxReferenceOption; } set { this.NetworkTxReferenceOption = new Option(value); } } + + /// + /// Used to track the state of OwnerName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OwnerNameOption { get; private set; } /// /// The name of the bank account holder. /// /// The name of the bank account holder. - [DataMember(Name = "ownerName", EmitDefaultValue = false)] - public string OwnerName { get; set; } + [JsonPropertyName("ownerName")] + public string OwnerName { get { return this.OwnerNameOption; } set { this.OwnerNameOption = new Option(value); } } + + /// + /// Used to track the state of ShopperEmail + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperEmailOption { get; private set; } /// /// The shopper’s email address. /// /// The shopper’s email address. - [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - public string ShopperEmail { get; set; } + [JsonPropertyName("shopperEmail")] + public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + + /// + /// Used to track the state of ShopperReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperReferenceOption { get; private set; } /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [DataMember(Name = "shopperReference", EmitDefaultValue = false)] - public string ShopperReference { get; set; } + [JsonPropertyName("shopperReference")] + public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } + + /// + /// Used to track the state of SupportedRecurringProcessingModels + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> SupportedRecurringProcessingModelsOption { get; private set; } /// /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [DataMember(Name = "supportedRecurringProcessingModels", EmitDefaultValue = false)] - public List SupportedRecurringProcessingModels { get; set; } + [JsonPropertyName("supportedRecurringProcessingModels")] + public List SupportedRecurringProcessingModels { get { return this.SupportedRecurringProcessingModelsOption; } set { this.SupportedRecurringProcessingModelsOption = new Option>(value); } } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The type of payment method. /// /// The type of payment method. - [DataMember(Name = "type", EmitDefaultValue = false)] - public string Type { get; set; } + [JsonPropertyName("type")] + public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -222,225 +341,322 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // ShopperReference (string) maxLength + if (this.ShopperReference != null && this.ShopperReference.Length > 256) + { + yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as StoredPaymentMethodResource); + // ShopperReference (string) minLength + if (this.ShopperReference != null && this.ShopperReference.Length < 3) + { + yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + } + + yield break; } + } + /// + /// A Json converter for type + /// + public class StoredPaymentMethodResourceJsonConverter : JsonConverter + { /// - /// Returns true if StoredPaymentMethodResource instances are equal + /// Deserializes json to /// - /// Instance of StoredPaymentMethodResource to be compared - /// Boolean - public bool Equals(StoredPaymentMethodResource input) + /// + /// + /// + /// + /// + public override StoredPaymentMethodResource Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option brand = default; + Option expiryMonth = default; + Option expiryYear = default; + Option externalResponseCode = default; + Option externalTokenReference = default; + Option holderName = default; + Option iban = default; + Option id = default; + Option issuerName = default; + Option lastFour = default; + Option name = default; + Option networkTxReference = default; + Option ownerName = default; + Option shopperEmail = default; + Option shopperReference = default; + Option> supportedRecurringProcessingModels = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "brand": + brand = new Option(utf8JsonReader.GetString()); + break; + case "expiryMonth": + expiryMonth = new Option(utf8JsonReader.GetString()); + break; + case "expiryYear": + expiryYear = new Option(utf8JsonReader.GetString()); + break; + case "externalResponseCode": + externalResponseCode = new Option(utf8JsonReader.GetString()); + break; + case "externalTokenReference": + externalTokenReference = new Option(utf8JsonReader.GetString()); + break; + case "holderName": + holderName = new Option(utf8JsonReader.GetString()); + break; + case "iban": + iban = new Option(utf8JsonReader.GetString()); + break; + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "issuerName": + issuerName = new Option(utf8JsonReader.GetString()); + break; + case "lastFour": + lastFour = new Option(utf8JsonReader.GetString()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "networkTxReference": + networkTxReference = new Option(utf8JsonReader.GetString()); + break; + case "ownerName": + ownerName = new Option(utf8JsonReader.GetString()); + break; + case "shopperEmail": + shopperEmail = new Option(utf8JsonReader.GetString()); + break; + case "shopperReference": + shopperReference = new Option(utf8JsonReader.GetString()); + break; + case "supportedRecurringProcessingModels": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + supportedRecurringProcessingModels = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Brand == input.Brand || - (this.Brand != null && - this.Brand.Equals(input.Brand)) - ) && - ( - this.ExpiryMonth == input.ExpiryMonth || - (this.ExpiryMonth != null && - this.ExpiryMonth.Equals(input.ExpiryMonth)) - ) && - ( - this.ExpiryYear == input.ExpiryYear || - (this.ExpiryYear != null && - this.ExpiryYear.Equals(input.ExpiryYear)) - ) && - ( - this.ExternalResponseCode == input.ExternalResponseCode || - (this.ExternalResponseCode != null && - this.ExternalResponseCode.Equals(input.ExternalResponseCode)) - ) && - ( - this.ExternalTokenReference == input.ExternalTokenReference || - (this.ExternalTokenReference != null && - this.ExternalTokenReference.Equals(input.ExternalTokenReference)) - ) && - ( - this.HolderName == input.HolderName || - (this.HolderName != null && - this.HolderName.Equals(input.HolderName)) - ) && - ( - this.Iban == input.Iban || - (this.Iban != null && - this.Iban.Equals(input.Iban)) - ) && - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.IssuerName == input.IssuerName || - (this.IssuerName != null && - this.IssuerName.Equals(input.IssuerName)) - ) && - ( - this.LastFour == input.LastFour || - (this.LastFour != null && - this.LastFour.Equals(input.LastFour)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.NetworkTxReference == input.NetworkTxReference || - (this.NetworkTxReference != null && - this.NetworkTxReference.Equals(input.NetworkTxReference)) - ) && - ( - this.OwnerName == input.OwnerName || - (this.OwnerName != null && - this.OwnerName.Equals(input.OwnerName)) - ) && - ( - this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) - ) && - ( - this.SupportedRecurringProcessingModels == input.SupportedRecurringProcessingModels || - this.SupportedRecurringProcessingModels != null && - input.SupportedRecurringProcessingModels != null && - this.SupportedRecurringProcessingModels.SequenceEqual(input.SupportedRecurringProcessingModels) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ); + + if (brand.IsSet && brand.Value == null) + throw new ArgumentNullException(nameof(brand), "Property is not nullable for class StoredPaymentMethodResource."); + + if (expiryMonth.IsSet && expiryMonth.Value == null) + throw new ArgumentNullException(nameof(expiryMonth), "Property is not nullable for class StoredPaymentMethodResource."); + + if (expiryYear.IsSet && expiryYear.Value == null) + throw new ArgumentNullException(nameof(expiryYear), "Property is not nullable for class StoredPaymentMethodResource."); + + if (externalResponseCode.IsSet && externalResponseCode.Value == null) + throw new ArgumentNullException(nameof(externalResponseCode), "Property is not nullable for class StoredPaymentMethodResource."); + + if (externalTokenReference.IsSet && externalTokenReference.Value == null) + throw new ArgumentNullException(nameof(externalTokenReference), "Property is not nullable for class StoredPaymentMethodResource."); + + if (holderName.IsSet && holderName.Value == null) + throw new ArgumentNullException(nameof(holderName), "Property is not nullable for class StoredPaymentMethodResource."); + + if (iban.IsSet && iban.Value == null) + throw new ArgumentNullException(nameof(iban), "Property is not nullable for class StoredPaymentMethodResource."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class StoredPaymentMethodResource."); + + if (issuerName.IsSet && issuerName.Value == null) + throw new ArgumentNullException(nameof(issuerName), "Property is not nullable for class StoredPaymentMethodResource."); + + if (lastFour.IsSet && lastFour.Value == null) + throw new ArgumentNullException(nameof(lastFour), "Property is not nullable for class StoredPaymentMethodResource."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class StoredPaymentMethodResource."); + + if (networkTxReference.IsSet && networkTxReference.Value == null) + throw new ArgumentNullException(nameof(networkTxReference), "Property is not nullable for class StoredPaymentMethodResource."); + + if (ownerName.IsSet && ownerName.Value == null) + throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class StoredPaymentMethodResource."); + + if (shopperEmail.IsSet && shopperEmail.Value == null) + throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class StoredPaymentMethodResource."); + + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class StoredPaymentMethodResource."); + + if (supportedRecurringProcessingModels.IsSet && supportedRecurringProcessingModels.Value == null) + throw new ArgumentNullException(nameof(supportedRecurringProcessingModels), "Property is not nullable for class StoredPaymentMethodResource."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class StoredPaymentMethodResource."); + + return new StoredPaymentMethodResource(brand, expiryMonth, expiryYear, externalResponseCode, externalTokenReference, holderName, iban, id, issuerName, lastFour, name, networkTxReference, ownerName, shopperEmail, shopperReference, supportedRecurringProcessingModels, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, StoredPaymentMethodResource storedPaymentMethodResource, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Brand != null) - { - hashCode = (hashCode * 59) + this.Brand.GetHashCode(); - } - if (this.ExpiryMonth != null) - { - hashCode = (hashCode * 59) + this.ExpiryMonth.GetHashCode(); - } - if (this.ExpiryYear != null) - { - hashCode = (hashCode * 59) + this.ExpiryYear.GetHashCode(); - } - if (this.ExternalResponseCode != null) - { - hashCode = (hashCode * 59) + this.ExternalResponseCode.GetHashCode(); - } - if (this.ExternalTokenReference != null) - { - hashCode = (hashCode * 59) + this.ExternalTokenReference.GetHashCode(); - } - if (this.HolderName != null) - { - hashCode = (hashCode * 59) + this.HolderName.GetHashCode(); - } - if (this.Iban != null) - { - hashCode = (hashCode * 59) + this.Iban.GetHashCode(); - } - if (this.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - if (this.IssuerName != null) - { - hashCode = (hashCode * 59) + this.IssuerName.GetHashCode(); - } - if (this.LastFour != null) - { - hashCode = (hashCode * 59) + this.LastFour.GetHashCode(); - } - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.NetworkTxReference != null) - { - hashCode = (hashCode * 59) + this.NetworkTxReference.GetHashCode(); - } - if (this.OwnerName != null) - { - hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); - } - if (this.ShopperEmail != null) - { - hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); - } - if (this.ShopperReference != null) - { - hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); - } - if (this.SupportedRecurringProcessingModels != null) - { - hashCode = (hashCode * 59) + this.SupportedRecurringProcessingModels.GetHashCode(); - } - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, storedPaymentMethodResource, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, StoredPaymentMethodResource storedPaymentMethodResource, JsonSerializerOptions jsonSerializerOptions) { - // ShopperReference (string) maxLength - if (this.ShopperReference != null && this.ShopperReference.Length > 256) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); - } + if (storedPaymentMethodResource.BrandOption.IsSet && storedPaymentMethodResource.Brand == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.Brand), "Property is required for class StoredPaymentMethodResource."); - // ShopperReference (string) minLength - if (this.ShopperReference != null && this.ShopperReference.Length < 3) + if (storedPaymentMethodResource.ExpiryMonthOption.IsSet && storedPaymentMethodResource.ExpiryMonth == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.ExpiryMonth), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.ExpiryYearOption.IsSet && storedPaymentMethodResource.ExpiryYear == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.ExpiryYear), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.ExternalResponseCodeOption.IsSet && storedPaymentMethodResource.ExternalResponseCode == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.ExternalResponseCode), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.ExternalTokenReferenceOption.IsSet && storedPaymentMethodResource.ExternalTokenReference == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.ExternalTokenReference), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.HolderNameOption.IsSet && storedPaymentMethodResource.HolderName == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.HolderName), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.IbanOption.IsSet && storedPaymentMethodResource.Iban == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.Iban), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.IdOption.IsSet && storedPaymentMethodResource.Id == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.Id), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.IssuerNameOption.IsSet && storedPaymentMethodResource.IssuerName == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.IssuerName), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.LastFourOption.IsSet && storedPaymentMethodResource.LastFour == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.LastFour), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.NameOption.IsSet && storedPaymentMethodResource.Name == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.Name), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.NetworkTxReferenceOption.IsSet && storedPaymentMethodResource.NetworkTxReference == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.NetworkTxReference), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.OwnerNameOption.IsSet && storedPaymentMethodResource.OwnerName == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.OwnerName), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.ShopperEmailOption.IsSet && storedPaymentMethodResource.ShopperEmail == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.ShopperEmail), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.ShopperReferenceOption.IsSet && storedPaymentMethodResource.ShopperReference == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.ShopperReference), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.SupportedRecurringProcessingModelsOption.IsSet && storedPaymentMethodResource.SupportedRecurringProcessingModels == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.SupportedRecurringProcessingModels), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.TypeOption.IsSet && storedPaymentMethodResource.Type == null) + throw new ArgumentNullException(nameof(storedPaymentMethodResource.Type), "Property is required for class StoredPaymentMethodResource."); + + if (storedPaymentMethodResource.BrandOption.IsSet) + writer.WriteString("brand", storedPaymentMethodResource.Brand); + + if (storedPaymentMethodResource.ExpiryMonthOption.IsSet) + writer.WriteString("expiryMonth", storedPaymentMethodResource.ExpiryMonth); + + if (storedPaymentMethodResource.ExpiryYearOption.IsSet) + writer.WriteString("expiryYear", storedPaymentMethodResource.ExpiryYear); + + if (storedPaymentMethodResource.ExternalResponseCodeOption.IsSet) + writer.WriteString("externalResponseCode", storedPaymentMethodResource.ExternalResponseCode); + + if (storedPaymentMethodResource.ExternalTokenReferenceOption.IsSet) + writer.WriteString("externalTokenReference", storedPaymentMethodResource.ExternalTokenReference); + + if (storedPaymentMethodResource.HolderNameOption.IsSet) + writer.WriteString("holderName", storedPaymentMethodResource.HolderName); + + if (storedPaymentMethodResource.IbanOption.IsSet) + writer.WriteString("iban", storedPaymentMethodResource.Iban); + + if (storedPaymentMethodResource.IdOption.IsSet) + writer.WriteString("id", storedPaymentMethodResource.Id); + + if (storedPaymentMethodResource.IssuerNameOption.IsSet) + writer.WriteString("issuerName", storedPaymentMethodResource.IssuerName); + + if (storedPaymentMethodResource.LastFourOption.IsSet) + writer.WriteString("lastFour", storedPaymentMethodResource.LastFour); + + if (storedPaymentMethodResource.NameOption.IsSet) + writer.WriteString("name", storedPaymentMethodResource.Name); + + if (storedPaymentMethodResource.NetworkTxReferenceOption.IsSet) + writer.WriteString("networkTxReference", storedPaymentMethodResource.NetworkTxReference); + + if (storedPaymentMethodResource.OwnerNameOption.IsSet) + writer.WriteString("ownerName", storedPaymentMethodResource.OwnerName); + + if (storedPaymentMethodResource.ShopperEmailOption.IsSet) + writer.WriteString("shopperEmail", storedPaymentMethodResource.ShopperEmail); + + if (storedPaymentMethodResource.ShopperReferenceOption.IsSet) + writer.WriteString("shopperReference", storedPaymentMethodResource.ShopperReference); + + if (storedPaymentMethodResource.SupportedRecurringProcessingModelsOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + writer.WritePropertyName("supportedRecurringProcessingModels"); + JsonSerializer.Serialize(writer, storedPaymentMethodResource.SupportedRecurringProcessingModels, jsonSerializerOptions); } - - yield break; + if (storedPaymentMethodResource.TypeOption.IsSet) + writer.WriteString("type", storedPaymentMethodResource.Type); } } - } diff --git a/Adyen/Model/Checkout/SubInputDetail.cs b/Adyen/Model/Checkout/SubInputDetail.cs index 2784e2215..073684cda 100644 --- a/Adyen/Model/Checkout/SubInputDetail.cs +++ b/Adyen/Model/Checkout/SubInputDetail.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,83 +14,126 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// SubInputDetail /// - [DataContract(Name = "SubInputDetail")] - public partial class SubInputDetail : IEquatable, IValidatableObject + public partial class SubInputDetail : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Configuration parameters for the required input.. - /// In case of a select, the items to choose from.. - /// The value to provide in the result.. - /// True if this input is optional to provide.. - /// The type of the required input.. - /// The value can be pre-filled, if available.. - public SubInputDetail(Dictionary configuration = default(Dictionary), List items = default(List), string key = default(string), bool? optional = default(bool?), string type = default(string), string value = default(string)) + /// Configuration parameters for the required input. + /// In case of a select, the items to choose from. + /// The value to provide in the result. + /// True if this input is optional to provide. + /// The type of the required input. + /// The value can be pre-filled, if available. + [JsonConstructor] + public SubInputDetail(Option> varConfiguration = default, Option> items = default, Option key = default, Option optional = default, Option type = default, Option value = default) { - this._Configuration = configuration; - this.Items = items; - this.Key = key; - this.Optional = optional; - this.Type = type; - this.Value = value; + VarConfigurationOption = varConfiguration; + ItemsOption = items; + KeyOption = key; + OptionalOption = optional; + TypeOption = type; + ValueOption = value; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of VarConfiguration + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> VarConfigurationOption { get; private set; } + /// /// Configuration parameters for the required input. /// /// Configuration parameters for the required input. - [DataMember(Name = "configuration", EmitDefaultValue = false)] - public Dictionary _Configuration { get; set; } + [JsonPropertyName("configuration")] + public Dictionary VarConfiguration { get { return this.VarConfigurationOption; } set { this.VarConfigurationOption = new Option>(value); } } + + /// + /// Used to track the state of Items + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> ItemsOption { get; private set; } /// /// In case of a select, the items to choose from. /// /// In case of a select, the items to choose from. - [DataMember(Name = "items", EmitDefaultValue = false)] - public List Items { get; set; } + [JsonPropertyName("items")] + public List Items { get { return this.ItemsOption; } set { this.ItemsOption = new Option>(value); } } + + /// + /// Used to track the state of Key + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option KeyOption { get; private set; } /// /// The value to provide in the result. /// /// The value to provide in the result. - [DataMember(Name = "key", EmitDefaultValue = false)] - public string Key { get; set; } + [JsonPropertyName("key")] + public string Key { get { return this.KeyOption; } set { this.KeyOption = new Option(value); } } + + /// + /// Used to track the state of Optional + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OptionalOption { get; private set; } /// /// True if this input is optional to provide. /// /// True if this input is optional to provide. - [DataMember(Name = "optional", EmitDefaultValue = false)] - public bool? Optional { get; set; } + [JsonPropertyName("optional")] + public bool? Optional { get { return this.OptionalOption; } set { this.OptionalOption = new Option(value); } } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The type of the required input. /// /// The type of the required input. - [DataMember(Name = "type", EmitDefaultValue = false)] - public string Type { get; set; } + [JsonPropertyName("type")] + public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + + /// + /// Used to track the state of Value + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ValueOption { get; private set; } /// /// The value can be pre-filled, if available. /// /// The value can be pre-filled, if available. - [DataMember(Name = "value", EmitDefaultValue = false)] - public string Value { get; set; } + [JsonPropertyName("value")] + public string Value { get { return this.ValueOption; } set { this.ValueOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -101,7 +143,7 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class SubInputDetail {\n"); - sb.Append(" _Configuration: ").Append(_Configuration).Append("\n"); + sb.Append(" VarConfiguration: ").Append(VarConfiguration).Append("\n"); sb.Append(" Items: ").Append(Items).Append("\n"); sb.Append(" Key: ").Append(Key).Append("\n"); sb.Append(" Optional: ").Append(Optional).Append("\n"); @@ -112,111 +154,168 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class SubInputDetailJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override SubInputDetail Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as SubInputDetail); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if SubInputDetail instances are equal - /// - /// Instance of SubInputDetail to be compared - /// Boolean - public bool Equals(SubInputDetail input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option> varConfiguration = default; + Option> items = default; + Option key = default; + Option optional = default; + Option type = default; + Option value = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "configuration": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varConfiguration = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "items": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + items = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "key": + key = new Option(utf8JsonReader.GetString()); + break; + case "optional": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + optional = new Option(utf8JsonReader.GetBoolean()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + case "value": + value = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this._Configuration == input._Configuration || - this._Configuration != null && - input._Configuration != null && - this._Configuration.SequenceEqual(input._Configuration) - ) && - ( - this.Items == input.Items || - this.Items != null && - input.Items != null && - this.Items.SequenceEqual(input.Items) - ) && - ( - this.Key == input.Key || - (this.Key != null && - this.Key.Equals(input.Key)) - ) && - ( - this.Optional == input.Optional || - this.Optional.Equals(input.Optional) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ) && - ( - this.Value == input.Value || - (this.Value != null && - this.Value.Equals(input.Value)) - ); + + if (varConfiguration.IsSet && varConfiguration.Value == null) + throw new ArgumentNullException(nameof(varConfiguration), "Property is not nullable for class SubInputDetail."); + + if (items.IsSet && items.Value == null) + throw new ArgumentNullException(nameof(items), "Property is not nullable for class SubInputDetail."); + + if (key.IsSet && key.Value == null) + throw new ArgumentNullException(nameof(key), "Property is not nullable for class SubInputDetail."); + + if (optional.IsSet && optional.Value == null) + throw new ArgumentNullException(nameof(optional), "Property is not nullable for class SubInputDetail."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class SubInputDetail."); + + if (value.IsSet && value.Value == null) + throw new ArgumentNullException(nameof(value), "Property is not nullable for class SubInputDetail."); + + return new SubInputDetail(varConfiguration, items, key, optional, type, value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SubInputDetail subInputDetail, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this._Configuration != null) - { - hashCode = (hashCode * 59) + this._Configuration.GetHashCode(); - } - if (this.Items != null) - { - hashCode = (hashCode * 59) + this.Items.GetHashCode(); - } - if (this.Key != null) - { - hashCode = (hashCode * 59) + this.Key.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Optional.GetHashCode(); - if (this.Type != null) - { - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - } - if (this.Value != null) - { - hashCode = (hashCode * 59) + this.Value.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, subInputDetail, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, SubInputDetail subInputDetail, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (subInputDetail.VarConfigurationOption.IsSet && subInputDetail.VarConfiguration == null) + throw new ArgumentNullException(nameof(subInputDetail.VarConfiguration), "Property is required for class SubInputDetail."); + + if (subInputDetail.ItemsOption.IsSet && subInputDetail.Items == null) + throw new ArgumentNullException(nameof(subInputDetail.Items), "Property is required for class SubInputDetail."); + + if (subInputDetail.KeyOption.IsSet && subInputDetail.Key == null) + throw new ArgumentNullException(nameof(subInputDetail.Key), "Property is required for class SubInputDetail."); + + if (subInputDetail.TypeOption.IsSet && subInputDetail.Type == null) + throw new ArgumentNullException(nameof(subInputDetail.Type), "Property is required for class SubInputDetail."); + + if (subInputDetail.ValueOption.IsSet && subInputDetail.Value == null) + throw new ArgumentNullException(nameof(subInputDetail.Value), "Property is required for class SubInputDetail."); + + if (subInputDetail.VarConfigurationOption.IsSet) + { + writer.WritePropertyName("configuration"); + JsonSerializer.Serialize(writer, subInputDetail.VarConfiguration, jsonSerializerOptions); + } + if (subInputDetail.ItemsOption.IsSet) + { + writer.WritePropertyName("items"); + JsonSerializer.Serialize(writer, subInputDetail.Items, jsonSerializerOptions); + } + if (subInputDetail.KeyOption.IsSet) + writer.WriteString("key", subInputDetail.Key); + + if (subInputDetail.OptionalOption.IsSet) + writer.WriteBoolean("optional", subInputDetail.OptionalOption.Value.Value); + + if (subInputDetail.TypeOption.IsSet) + writer.WriteString("type", subInputDetail.Type); + + if (subInputDetail.ValueOption.IsSet) + writer.WriteString("value", subInputDetail.Value); } } - } diff --git a/Adyen/Model/Checkout/SubMerchant.cs b/Adyen/Model/Checkout/SubMerchant.cs index 54d64c8a9..c0e9cd9b0 100644 --- a/Adyen/Model/Checkout/SubMerchant.cs +++ b/Adyen/Model/Checkout/SubMerchant.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,74 +14,110 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// SubMerchant /// - [DataContract(Name = "SubMerchant")] - public partial class SubMerchant : IEquatable, IValidatableObject + public partial class SubMerchant : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters. - /// The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters. - /// The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits. - /// The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters. - /// The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ. - public SubMerchant(string city = default(string), string country = default(string), string mcc = default(string), string name = default(string), string taxId = default(string)) + /// The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters + /// The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters + /// The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits + /// The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters + /// The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ + [JsonConstructor] + public SubMerchant(Option city = default, Option country = default, Option mcc = default, Option name = default, Option taxId = default) { - this.City = city; - this.Country = country; - this.Mcc = mcc; - this.Name = name; - this.TaxId = taxId; + CityOption = city; + CountryOption = country; + MccOption = mcc; + NameOption = name; + TaxIdOption = taxId; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of City + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CityOption { get; private set; } + /// /// The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters /// /// The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters - [DataMember(Name = "city", EmitDefaultValue = false)] - public string City { get; set; } + [JsonPropertyName("city")] + public string City { get { return this.CityOption; } set { this.CityOption = new Option(value); } } + + /// + /// Used to track the state of Country + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryOption { get; private set; } /// /// The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters /// /// The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters - [DataMember(Name = "country", EmitDefaultValue = false)] - public string Country { get; set; } + [JsonPropertyName("country")] + public string Country { get { return this.CountryOption; } set { this.CountryOption = new Option(value); } } + + /// + /// Used to track the state of Mcc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MccOption { get; private set; } /// /// The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits /// /// The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits - [DataMember(Name = "mcc", EmitDefaultValue = false)] - public string Mcc { get; set; } + [JsonPropertyName("mcc")] + public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } /// /// The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters /// /// The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + + /// + /// Used to track the state of TaxId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TaxIdOption { get; private set; } /// /// The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ /// /// The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ - [DataMember(Name = "taxId", EmitDefaultValue = false)] - public string TaxId { get; set; } + [JsonPropertyName("taxId")] + public string TaxId { get { return this.TaxIdOption; } set { this.TaxIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -102,104 +137,151 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class SubMerchantJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override SubMerchant Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as SubMerchant); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if SubMerchant instances are equal - /// - /// Instance of SubMerchant to be compared - /// Boolean - public bool Equals(SubMerchant input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option city = default; + Option country = default; + Option mcc = default; + Option name = default; + Option taxId = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "city": + city = new Option(utf8JsonReader.GetString()); + break; + case "country": + country = new Option(utf8JsonReader.GetString()); + break; + case "mcc": + mcc = new Option(utf8JsonReader.GetString()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "taxId": + taxId = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.City == input.City || - (this.City != null && - this.City.Equals(input.City)) - ) && - ( - this.Country == input.Country || - (this.Country != null && - this.Country.Equals(input.Country)) - ) && - ( - this.Mcc == input.Mcc || - (this.Mcc != null && - this.Mcc.Equals(input.Mcc)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.TaxId == input.TaxId || - (this.TaxId != null && - this.TaxId.Equals(input.TaxId)) - ); + + if (city.IsSet && city.Value == null) + throw new ArgumentNullException(nameof(city), "Property is not nullable for class SubMerchant."); + + if (country.IsSet && country.Value == null) + throw new ArgumentNullException(nameof(country), "Property is not nullable for class SubMerchant."); + + if (mcc.IsSet && mcc.Value == null) + throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class SubMerchant."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class SubMerchant."); + + if (taxId.IsSet && taxId.Value == null) + throw new ArgumentNullException(nameof(taxId), "Property is not nullable for class SubMerchant."); + + return new SubMerchant(city, country, mcc, name, taxId); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SubMerchant subMerchant, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.City != null) - { - hashCode = (hashCode * 59) + this.City.GetHashCode(); - } - if (this.Country != null) - { - hashCode = (hashCode * 59) + this.Country.GetHashCode(); - } - if (this.Mcc != null) - { - hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); - } - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.TaxId != null) - { - hashCode = (hashCode * 59) + this.TaxId.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, subMerchant, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, SubMerchant subMerchant, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (subMerchant.CityOption.IsSet && subMerchant.City == null) + throw new ArgumentNullException(nameof(subMerchant.City), "Property is required for class SubMerchant."); + + if (subMerchant.CountryOption.IsSet && subMerchant.Country == null) + throw new ArgumentNullException(nameof(subMerchant.Country), "Property is required for class SubMerchant."); + + if (subMerchant.MccOption.IsSet && subMerchant.Mcc == null) + throw new ArgumentNullException(nameof(subMerchant.Mcc), "Property is required for class SubMerchant."); + + if (subMerchant.NameOption.IsSet && subMerchant.Name == null) + throw new ArgumentNullException(nameof(subMerchant.Name), "Property is required for class SubMerchant."); + + if (subMerchant.TaxIdOption.IsSet && subMerchant.TaxId == null) + throw new ArgumentNullException(nameof(subMerchant.TaxId), "Property is required for class SubMerchant."); + + if (subMerchant.CityOption.IsSet) + writer.WriteString("city", subMerchant.City); + + if (subMerchant.CountryOption.IsSet) + writer.WriteString("country", subMerchant.Country); + + if (subMerchant.MccOption.IsSet) + writer.WriteString("mcc", subMerchant.Mcc); + + if (subMerchant.NameOption.IsSet) + writer.WriteString("name", subMerchant.Name); + + if (subMerchant.TaxIdOption.IsSet) + writer.WriteString("taxId", subMerchant.TaxId); } } - } diff --git a/Adyen/Model/Checkout/SubMerchantInfo.cs b/Adyen/Model/Checkout/SubMerchantInfo.cs index 0aadcc313..e44344711 100644 --- a/Adyen/Model/Checkout/SubMerchantInfo.cs +++ b/Adyen/Model/Checkout/SubMerchantInfo.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,116 +14,187 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// SubMerchantInfo /// - [DataContract(Name = "SubMerchantInfo")] - public partial class SubMerchantInfo : IEquatable, IValidatableObject + public partial class SubMerchantInfo : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// address. - /// amount. - /// Required for transactions performed by registered payment facilitators. The email associated with the sub-merchant's account.. - /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters. - /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits. - /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters. - /// Required for transactions performed by registered payment facilitators. The phone number associated with the sub-merchant's account.. - /// registeredSince. - /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ. - /// Required for transactions performed by registered payment facilitators. The sub-merchant's URL on the platform, i.e. the sub-merchant's shop.. - public SubMerchantInfo(BillingAddress address = default(BillingAddress), Amount amount = default(Amount), string email = default(string), string id = default(string), string mcc = default(string), string name = default(string), string phoneNumber = default(string), string registeredSince = default(string), string taxId = default(string), string url = default(string)) + /// address + /// amount + /// Required for transactions performed by registered payment facilitators. The email associated with the sub-merchant's account. + /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters + /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits + /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters + /// Required for transactions performed by registered payment facilitators. The phone number associated with the sub-merchant's account. + /// registeredSince + /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ + /// Required for transactions performed by registered payment facilitators. The sub-merchant's URL on the platform, i.e. the sub-merchant's shop. + [JsonConstructor] + public SubMerchantInfo(Option address = default, Option amount = default, Option email = default, Option id = default, Option mcc = default, Option name = default, Option phoneNumber = default, Option registeredSince = default, Option taxId = default, Option url = default) { - this.Address = address; - this.Amount = amount; - this.Email = email; - this.Id = id; - this.Mcc = mcc; - this.Name = name; - this.PhoneNumber = phoneNumber; - this.RegisteredSince = registeredSince; - this.TaxId = taxId; - this.Url = url; + AddressOption = address; + AmountOption = amount; + EmailOption = email; + IdOption = id; + MccOption = mcc; + NameOption = name; + PhoneNumberOption = phoneNumber; + RegisteredSinceOption = registeredSince; + TaxIdOption = taxId; + UrlOption = url; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Address + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AddressOption { get; private set; } + /// /// Gets or Sets Address /// - [DataMember(Name = "address", EmitDefaultValue = false)] - public BillingAddress Address { get; set; } + [JsonPropertyName("address")] + public BillingAddress Address { get { return this.AddressOption; } set { this.AddressOption = new Option(value); } } + + /// + /// Used to track the state of Amount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountOption { get; private set; } /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonPropertyName("amount")] + public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } + + /// + /// Used to track the state of Email + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EmailOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The email associated with the sub-merchant's account. /// /// Required for transactions performed by registered payment facilitators. The email associated with the sub-merchant's account. - [DataMember(Name = "email", EmitDefaultValue = false)] - public string Email { get; set; } + [JsonPropertyName("email")] + public string Email { get { return this.EmailOption; } set { this.EmailOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters /// /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters - [DataMember(Name = "id", EmitDefaultValue = false)] - public string Id { get; set; } + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Mcc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MccOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits /// /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits - [DataMember(Name = "mcc", EmitDefaultValue = false)] - public string Mcc { get; set; } + [JsonPropertyName("mcc")] + public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters /// /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + + /// + /// Used to track the state of PhoneNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PhoneNumberOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The phone number associated with the sub-merchant's account. /// /// Required for transactions performed by registered payment facilitators. The phone number associated with the sub-merchant's account. - [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] - public string PhoneNumber { get; set; } + [JsonPropertyName("phoneNumber")] + public string PhoneNumber { get { return this.PhoneNumberOption; } set { this.PhoneNumberOption = new Option(value); } } + + /// + /// Used to track the state of RegisteredSince + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RegisteredSinceOption { get; private set; } /// /// Gets or Sets RegisteredSince /// - [DataMember(Name = "registeredSince", EmitDefaultValue = false)] - public string RegisteredSince { get; set; } + [JsonPropertyName("registeredSince")] + public string RegisteredSince { get { return this.RegisteredSinceOption; } set { this.RegisteredSinceOption = new Option(value); } } + + /// + /// Used to track the state of TaxId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TaxIdOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ /// /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ - [DataMember(Name = "taxId", EmitDefaultValue = false)] - public string TaxId { get; set; } + [JsonPropertyName("taxId")] + public string TaxId { get { return this.TaxIdOption; } set { this.TaxIdOption = new Option(value); } } + + /// + /// Used to track the state of Url + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option UrlOption { get; private set; } /// /// Required for transactions performed by registered payment facilitators. The sub-merchant's URL on the platform, i.e. the sub-merchant's shop. /// /// Required for transactions performed by registered payment facilitators. The sub-merchant's URL on the platform, i.e. the sub-merchant's shop. - [DataMember(Name = "url", EmitDefaultValue = false)] - public string Url { get; set; } + [JsonPropertyName("url")] + public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -149,167 +219,240 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // Email (string) maxLength + if (this.Email != null && this.Email.Length > 320) + { + yield return new ValidationResult("Invalid value for Email, length must be less than 320.", new [] { "Email" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as SubMerchantInfo); - } + // PhoneNumber (string) maxLength + if (this.PhoneNumber != null && this.PhoneNumber.Length > 20) + { + yield return new ValidationResult("Invalid value for PhoneNumber, length must be less than 20.", new [] { "PhoneNumber" }); + } - /// - /// Returns true if SubMerchantInfo instances are equal - /// - /// Instance of SubMerchantInfo to be compared - /// Boolean - public bool Equals(SubMerchantInfo input) - { - if (input == null) + // Url (string) maxLength + if (this.Url != null && this.Url.Length > 320) { - return false; + yield return new ValidationResult("Invalid value for Url, length must be less than 320.", new [] { "Url" }); } - return - ( - this.Address == input.Address || - (this.Address != null && - this.Address.Equals(input.Address)) - ) && - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ) && - ( - this.Email == input.Email || - (this.Email != null && - this.Email.Equals(input.Email)) - ) && - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.Mcc == input.Mcc || - (this.Mcc != null && - this.Mcc.Equals(input.Mcc)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.PhoneNumber == input.PhoneNumber || - (this.PhoneNumber != null && - this.PhoneNumber.Equals(input.PhoneNumber)) - ) && - ( - this.RegisteredSince == input.RegisteredSince || - (this.RegisteredSince != null && - this.RegisteredSince.Equals(input.RegisteredSince)) - ) && - ( - this.TaxId == input.TaxId || - (this.TaxId != null && - this.TaxId.Equals(input.TaxId)) - ) && - ( - this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) - ); + + yield break; } + } + /// + /// A Json converter for type + /// + public class SubMerchantInfoJsonConverter : JsonConverter + { /// - /// Gets the hash code + /// Deserializes json to /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + /// + public override SubMerchantInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option address = default; + Option amount = default; + Option email = default; + Option id = default; + Option mcc = default; + Option name = default; + Option phoneNumber = default; + Option registeredSince = default; + Option taxId = default; + Option url = default; + + while (utf8JsonReader.Read()) { - int hashCode = 41; - if (this.Address != null) - { - hashCode = (hashCode * 59) + this.Address.GetHashCode(); - } - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - if (this.Email != null) - { - hashCode = (hashCode * 59) + this.Email.GetHashCode(); - } - if (this.Id != null) - { - hashCode = (hashCode * 59) + this.Id.GetHashCode(); - } - if (this.Mcc != null) - { - hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); - } - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - if (this.PhoneNumber != null) - { - hashCode = (hashCode * 59) + this.PhoneNumber.GetHashCode(); - } - if (this.RegisteredSince != null) - { - hashCode = (hashCode * 59) + this.RegisteredSince.GetHashCode(); - } - if (this.TaxId != null) - { - hashCode = (hashCode * 59) + this.TaxId.GetHashCode(); - } - if (this.Url != null) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - hashCode = (hashCode * 59) + this.Url.GetHashCode(); + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "address": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + address = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "email": + email = new Option(utf8JsonReader.GetString()); + break; + case "id": + id = new Option(utf8JsonReader.GetString()); + break; + case "mcc": + mcc = new Option(utf8JsonReader.GetString()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "phoneNumber": + phoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "registeredSince": + registeredSince = new Option(utf8JsonReader.GetString()); + break; + case "taxId": + taxId = new Option(utf8JsonReader.GetString()); + break; + case "url": + url = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } } - return hashCode; } + + if (address.IsSet && address.Value == null) + throw new ArgumentNullException(nameof(address), "Property is not nullable for class SubMerchantInfo."); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class SubMerchantInfo."); + + if (email.IsSet && email.Value == null) + throw new ArgumentNullException(nameof(email), "Property is not nullable for class SubMerchantInfo."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class SubMerchantInfo."); + + if (mcc.IsSet && mcc.Value == null) + throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class SubMerchantInfo."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class SubMerchantInfo."); + + if (phoneNumber.IsSet && phoneNumber.Value == null) + throw new ArgumentNullException(nameof(phoneNumber), "Property is not nullable for class SubMerchantInfo."); + + if (registeredSince.IsSet && registeredSince.Value == null) + throw new ArgumentNullException(nameof(registeredSince), "Property is not nullable for class SubMerchantInfo."); + + if (taxId.IsSet && taxId.Value == null) + throw new ArgumentNullException(nameof(taxId), "Property is not nullable for class SubMerchantInfo."); + + if (url.IsSet && url.Value == null) + throw new ArgumentNullException(nameof(url), "Property is not nullable for class SubMerchantInfo."); + + return new SubMerchantInfo(address, amount, email, id, mcc, name, phoneNumber, registeredSince, taxId, url); } + /// - /// To validate all properties of the instance + /// Serializes a /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SubMerchantInfo subMerchantInfo, JsonSerializerOptions jsonSerializerOptions) { - // Email (string) maxLength - if (this.Email != null && this.Email.Length > 320) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Email, length must be less than 320.", new [] { "Email" }); - } + writer.WriteStartObject(); - // PhoneNumber (string) maxLength - if (this.PhoneNumber != null && this.PhoneNumber.Length > 20) + WriteProperties(writer, subMerchantInfo, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, SubMerchantInfo subMerchantInfo, JsonSerializerOptions jsonSerializerOptions) + { + if (subMerchantInfo.AddressOption.IsSet && subMerchantInfo.Address == null) + throw new ArgumentNullException(nameof(subMerchantInfo.Address), "Property is required for class SubMerchantInfo."); + + if (subMerchantInfo.AmountOption.IsSet && subMerchantInfo.Amount == null) + throw new ArgumentNullException(nameof(subMerchantInfo.Amount), "Property is required for class SubMerchantInfo."); + + if (subMerchantInfo.EmailOption.IsSet && subMerchantInfo.Email == null) + throw new ArgumentNullException(nameof(subMerchantInfo.Email), "Property is required for class SubMerchantInfo."); + + if (subMerchantInfo.IdOption.IsSet && subMerchantInfo.Id == null) + throw new ArgumentNullException(nameof(subMerchantInfo.Id), "Property is required for class SubMerchantInfo."); + + if (subMerchantInfo.MccOption.IsSet && subMerchantInfo.Mcc == null) + throw new ArgumentNullException(nameof(subMerchantInfo.Mcc), "Property is required for class SubMerchantInfo."); + + if (subMerchantInfo.NameOption.IsSet && subMerchantInfo.Name == null) + throw new ArgumentNullException(nameof(subMerchantInfo.Name), "Property is required for class SubMerchantInfo."); + + if (subMerchantInfo.PhoneNumberOption.IsSet && subMerchantInfo.PhoneNumber == null) + throw new ArgumentNullException(nameof(subMerchantInfo.PhoneNumber), "Property is required for class SubMerchantInfo."); + + if (subMerchantInfo.RegisteredSinceOption.IsSet && subMerchantInfo.RegisteredSince == null) + throw new ArgumentNullException(nameof(subMerchantInfo.RegisteredSince), "Property is required for class SubMerchantInfo."); + + if (subMerchantInfo.TaxIdOption.IsSet && subMerchantInfo.TaxId == null) + throw new ArgumentNullException(nameof(subMerchantInfo.TaxId), "Property is required for class SubMerchantInfo."); + + if (subMerchantInfo.UrlOption.IsSet && subMerchantInfo.Url == null) + throw new ArgumentNullException(nameof(subMerchantInfo.Url), "Property is required for class SubMerchantInfo."); + + if (subMerchantInfo.AddressOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PhoneNumber, length must be less than 20.", new [] { "PhoneNumber" }); + writer.WritePropertyName("address"); + JsonSerializer.Serialize(writer, subMerchantInfo.Address, jsonSerializerOptions); } - - // Url (string) maxLength - if (this.Url != null && this.Url.Length > 320) + if (subMerchantInfo.AmountOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Url, length must be less than 320.", new [] { "Url" }); + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, subMerchantInfo.Amount, jsonSerializerOptions); } + if (subMerchantInfo.EmailOption.IsSet) + writer.WriteString("email", subMerchantInfo.Email); - yield break; + if (subMerchantInfo.IdOption.IsSet) + writer.WriteString("id", subMerchantInfo.Id); + + if (subMerchantInfo.MccOption.IsSet) + writer.WriteString("mcc", subMerchantInfo.Mcc); + + if (subMerchantInfo.NameOption.IsSet) + writer.WriteString("name", subMerchantInfo.Name); + + if (subMerchantInfo.PhoneNumberOption.IsSet) + writer.WriteString("phoneNumber", subMerchantInfo.PhoneNumber); + + if (subMerchantInfo.RegisteredSinceOption.IsSet) + writer.WriteString("registeredSince", subMerchantInfo.RegisteredSince); + + if (subMerchantInfo.TaxIdOption.IsSet) + writer.WriteString("taxId", subMerchantInfo.TaxId); + + if (subMerchantInfo.UrlOption.IsSet) + writer.WriteString("url", subMerchantInfo.Url); } } - } diff --git a/Adyen/Model/Checkout/Surcharge.cs b/Adyen/Model/Checkout/Surcharge.cs index 83eaed16b..809d965c6 100644 --- a/Adyen/Model/Checkout/Surcharge.cs +++ b/Adyen/Model/Checkout/Surcharge.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,43 +14,39 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Surcharge /// - [DataContract(Name = "Surcharge")] - public partial class Surcharge : IEquatable, IValidatableObject + public partial class Surcharge : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected Surcharge() { } - /// - /// Initializes a new instance of the class. - /// - /// The [surcharge](https://docs.adyen.com/online-payments/surcharge/) amount to apply to the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). When you apply surcharge, include the surcharge in the `amount.value` field. Review our [Surcharge compliance guide](https://docs.adyen.com/development-resources/surcharge-compliance/) to learn about how to comply with regulatory requirements when applying surcharge. (required). - public Surcharge(long? value = default(long?)) + /// The [surcharge](https://docs.adyen.com/online-payments/surcharge/) amount to apply to the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). When you apply surcharge, include the surcharge in the `amount.value` field. Review our [Surcharge compliance guide](https://docs.adyen.com/development-resources/surcharge-compliance/) to learn about how to comply with regulatory requirements when applying surcharge. + [JsonConstructor] + public Surcharge(long value) { - this.Value = value; + Value = value; + OnCreated(); } + partial void OnCreated(); + /// /// The [surcharge](https://docs.adyen.com/online-payments/surcharge/) amount to apply to the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). When you apply surcharge, include the surcharge in the `amount.value` field. Review our [Surcharge compliance guide](https://docs.adyen.com/development-resources/surcharge-compliance/) to learn about how to comply with regulatory requirements when applying surcharge. /// /// The [surcharge](https://docs.adyen.com/online-payments/surcharge/) amount to apply to the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). When you apply surcharge, include the surcharge in the `amount.value` field. Review our [Surcharge compliance guide](https://docs.adyen.com/development-resources/surcharge-compliance/) to learn about how to comply with regulatory requirements when applying surcharge. - [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] - public long? Value { get; set; } + [JsonPropertyName("value")] + public long Value { get; set; } /// /// Returns the string presentation of the object @@ -67,64 +62,99 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class SurchargeJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override Surcharge Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as Surcharge); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if Surcharge instances are equal - /// - /// Instance of Surcharge to be compared - /// Boolean - public bool Equals(Surcharge input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option value = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "value": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + value = new Option(utf8JsonReader.GetInt64()); + break; + default: + break; + } + } } - return - ( - this.Value == input.Value || - this.Value.Equals(input.Value) - ); + + if (!value.IsSet) + throw new ArgumentException("Property is required for class Surcharge.", nameof(value)); + + if (value.IsSet && value.Value == null) + throw new ArgumentNullException(nameof(value), "Property is not nullable for class Surcharge."); + + return new Surcharge(value.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Surcharge surcharge, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Value.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, surcharge, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Surcharge surcharge, JsonSerializerOptions jsonSerializerOptions) { - yield break; + writer.WriteNumber("value", surcharge.Value); } } - } diff --git a/Adyen/Model/Checkout/TaxTotal.cs b/Adyen/Model/Checkout/TaxTotal.cs index 793064969..daa6f447b 100644 --- a/Adyen/Model/Checkout/TaxTotal.cs +++ b/Adyen/Model/Checkout/TaxTotal.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,37 +14,45 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// TaxTotal /// - [DataContract(Name = "TaxTotal")] - public partial class TaxTotal : IEquatable, IValidatableObject + public partial class TaxTotal : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// amount. - public TaxTotal(Amount amount = default(Amount)) + /// amount + [JsonConstructor] + public TaxTotal(Option amount = default) { - this.Amount = amount; + AmountOption = amount; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Amount + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AmountOption { get; private set; } + /// /// Gets or Sets Amount /// - [DataMember(Name = "amount", EmitDefaultValue = false)] - public Amount Amount { get; set; } + [JsonPropertyName("amount")] + public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -61,68 +68,103 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class TaxTotalJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override TaxTotal Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as TaxTotal); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if TaxTotal instances are equal - /// - /// Instance of TaxTotal to be compared - /// Boolean - public bool Equals(TaxTotal input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option amount = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "amount": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) - ); + + if (amount.IsSet && amount.Value == null) + throw new ArgumentNullException(nameof(amount), "Property is not nullable for class TaxTotal."); + + return new TaxTotal(amount); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TaxTotal taxTotal, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Amount != null) - { - hashCode = (hashCode * 59) + this.Amount.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, taxTotal, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, TaxTotal taxTotal, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (taxTotal.AmountOption.IsSet && taxTotal.Amount == null) + throw new ArgumentNullException(nameof(taxTotal.Amount), "Property is required for class TaxTotal."); + + if (taxTotal.AmountOption.IsSet) + { + writer.WritePropertyName("amount"); + JsonSerializer.Serialize(writer, taxTotal.Amount, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/ThreeDS2RequestData.cs b/Adyen/Model/Checkout/ThreeDS2RequestData.cs index e277b3180..edf175891 100644 --- a/Adyen/Model/Checkout/ThreeDS2RequestData.cs +++ b/Adyen/Model/Checkout/ThreeDS2RequestData.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,583 +14,1225 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ThreeDS2RequestData /// - [DataContract(Name = "ThreeDS2RequestData")] - public partial class ThreeDS2RequestData : IEquatable, IValidatableObject + public partial class ThreeDS2RequestData : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The environment of the shopper. Allowed values: * `app` * `browser` + /// acctInfo + /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) + /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + /// deviceRenderOptions + /// homePhone + /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. + /// The `messageVersion` value indicating the 3D Secure 2 protocol version. + /// mobilePhone + /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. + /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. + /// Indicates the type of payment for which an authentication is requested (message extension) + /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. + /// Date after which no further authorisations shall be performed. Format: YYYYMMDD + /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters. + /// The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. + /// The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. + /// sdkEphemPubKey + /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. (default to 60) + /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. + /// The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. + /// Version of the 3D Secure 2 mobile SDK. Only for `deviceChannel` set to **app**. + /// Completion indicator for the device fingerprinting. + /// Indicates the type of Authentication request. + /// threeDSRequestorAuthenticationInfo + /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. + /// threeDSRequestorPriorAuthenticationInfo + /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. + /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load + /// Identify the type of the transaction being authenticated. + /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. + /// workPhone + [JsonConstructor] + public ThreeDS2RequestData(string deviceChannel, Option acctInfo = default, Option acctType = default, Option acquirerBIN = default, Option acquirerMerchantID = default, Option addrMatch = default, Option authenticationOnly = default, Option challengeIndicator = default, Option deviceRenderOptions = default, Option homePhone = default, Option mcc = default, Option merchantName = default, Option messageVersion = default, Option mobilePhone = default, Option notificationURL = default, Option payTokenInd = default, Option paymentAuthenticationUseCase = default, Option purchaseInstalData = default, Option recurringExpiry = default, Option recurringFrequency = default, Option sdkAppID = default, Option sdkEncData = default, Option sdkEphemPubKey = default, Option sdkMaxTimeout = default, Option sdkReferenceNumber = default, Option sdkTransID = default, Option sdkVersion = default, Option threeDSCompInd = default, Option threeDSRequestorAuthenticationInd = default, Option threeDSRequestorAuthenticationInfo = default, Option threeDSRequestorChallengeInd = default, Option threeDSRequestorID = default, Option threeDSRequestorName = default, Option threeDSRequestorPriorAuthenticationInfo = default, Option threeDSRequestorURL = default, Option transType = default, Option transactionType = default, Option whiteListStatus = default, Option workPhone = default) + { + DeviceChannel = deviceChannel; + AcctInfoOption = acctInfo; + AcctTypeOption = acctType; + AcquirerBINOption = acquirerBIN; + AcquirerMerchantIDOption = acquirerMerchantID; + AddrMatchOption = addrMatch; + AuthenticationOnlyOption = authenticationOnly; + ChallengeIndicatorOption = challengeIndicator; + DeviceRenderOptionsOption = deviceRenderOptions; + HomePhoneOption = homePhone; + MccOption = mcc; + MerchantNameOption = merchantName; + MessageVersionOption = messageVersion; + MobilePhoneOption = mobilePhone; + NotificationURLOption = notificationURL; + PayTokenIndOption = payTokenInd; + PaymentAuthenticationUseCaseOption = paymentAuthenticationUseCase; + PurchaseInstalDataOption = purchaseInstalData; + RecurringExpiryOption = recurringExpiry; + RecurringFrequencyOption = recurringFrequency; + SdkAppIDOption = sdkAppID; + SdkEncDataOption = sdkEncData; + SdkEphemPubKeyOption = sdkEphemPubKey; + SdkMaxTimeoutOption = sdkMaxTimeout; + SdkReferenceNumberOption = sdkReferenceNumber; + SdkTransIDOption = sdkTransID; + SdkVersionOption = sdkVersion; + ThreeDSCompIndOption = threeDSCompInd; + ThreeDSRequestorAuthenticationIndOption = threeDSRequestorAuthenticationInd; + ThreeDSRequestorAuthenticationInfoOption = threeDSRequestorAuthenticationInfo; + ThreeDSRequestorChallengeIndOption = threeDSRequestorChallengeInd; + ThreeDSRequestorIDOption = threeDSRequestorID; + ThreeDSRequestorNameOption = threeDSRequestorName; + ThreeDSRequestorPriorAuthenticationInfoOption = threeDSRequestorPriorAuthenticationInfo; + ThreeDSRequestorURLOption = threeDSRequestorURL; + TransTypeOption = transType; + TransactionTypeOption = transactionType; + WhiteListStatusOption = whiteListStatus; + WorkPhoneOption = workPhone; + OnCreated(); + } + + partial void OnCreated(); + /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit - [JsonConverter(typeof(StringEnumConverter))] public enum AcctTypeEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3 + } + /// + /// Returns a + /// + /// + /// + /// + public static AcctTypeEnum AcctTypeEnumFromString(string value) + { + if (value.Equals("01")) + return AcctTypeEnum._01; + + if (value.Equals("02")) + return AcctTypeEnum._02; + + if (value.Equals("03")) + return AcctTypeEnum._03; + + throw new NotImplementedException($"Could not convert value to type AcctTypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static AcctTypeEnum? AcctTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return AcctTypeEnum._01; + + if (value.Equals("02")) + return AcctTypeEnum._02; + + if (value.Equals("03")) + return AcctTypeEnum._03; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string AcctTypeEnumToJsonValue(AcctTypeEnum? value) + { + if (value == AcctTypeEnum._01) + return "01"; + + if (value == AcctTypeEnum._02) + return "02"; + + if (value == AcctTypeEnum._03) + return "03"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of AcctType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcctTypeOption { get; private set; } /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit - [DataMember(Name = "acctType", EmitDefaultValue = false)] - public AcctTypeEnum? AcctType { get; set; } + [JsonPropertyName("acctType")] + public AcctTypeEnum? AcctType { get { return this.AcctTypeOption; } set { this.AcctTypeOption = new Option(value); } } + /// /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. /// /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. - [JsonConverter(typeof(StringEnumConverter))] public enum AddrMatchEnum { /// /// Enum Y for value: Y /// - [EnumMember(Value = "Y")] Y = 1, /// /// Enum N for value: N /// - [EnumMember(Value = "N")] N = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static AddrMatchEnum AddrMatchEnumFromString(string value) + { + if (value.Equals("Y")) + return AddrMatchEnum.Y; + + if (value.Equals("N")) + return AddrMatchEnum.N; + throw new NotImplementedException($"Could not convert value to type AddrMatchEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static AddrMatchEnum? AddrMatchEnumFromStringOrDefault(string value) + { + if (value.Equals("Y")) + return AddrMatchEnum.Y; + + if (value.Equals("N")) + return AddrMatchEnum.N; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string AddrMatchEnumToJsonValue(AddrMatchEnum? value) + { + if (value == AddrMatchEnum.Y) + return "Y"; + + if (value == AddrMatchEnum.N) + return "N"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of AddrMatch + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AddrMatchOption { get; private set; } /// /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. /// /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. - [DataMember(Name = "addrMatch", EmitDefaultValue = false)] - public AddrMatchEnum? AddrMatch { get; set; } + [JsonPropertyName("addrMatch")] + public AddrMatchEnum? AddrMatch { get { return this.AddrMatchOption; } set { this.AddrMatchOption = new Option(value); } } + /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` - [JsonConverter(typeof(StringEnumConverter))] public enum ChallengeIndicatorEnum { /// /// Enum NoPreference for value: noPreference /// - [EnumMember(Value = "noPreference")] NoPreference = 1, /// /// Enum RequestNoChallenge for value: requestNoChallenge /// - [EnumMember(Value = "requestNoChallenge")] RequestNoChallenge = 2, /// /// Enum RequestChallenge for value: requestChallenge /// - [EnumMember(Value = "requestChallenge")] RequestChallenge = 3, /// /// Enum RequestChallengeAsMandate for value: requestChallengeAsMandate /// - [EnumMember(Value = "requestChallengeAsMandate")] RequestChallengeAsMandate = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ChallengeIndicatorEnum ChallengeIndicatorEnumFromString(string value) + { + if (value.Equals("noPreference")) + return ChallengeIndicatorEnum.NoPreference; + + if (value.Equals("requestNoChallenge")) + return ChallengeIndicatorEnum.RequestNoChallenge; + if (value.Equals("requestChallenge")) + return ChallengeIndicatorEnum.RequestChallenge; + + if (value.Equals("requestChallengeAsMandate")) + return ChallengeIndicatorEnum.RequestChallengeAsMandate; + + throw new NotImplementedException($"Could not convert value to type ChallengeIndicatorEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static ChallengeIndicatorEnum? ChallengeIndicatorEnumFromStringOrDefault(string value) + { + if (value.Equals("noPreference")) + return ChallengeIndicatorEnum.NoPreference; + + if (value.Equals("requestNoChallenge")) + return ChallengeIndicatorEnum.RequestNoChallenge; + + if (value.Equals("requestChallenge")) + return ChallengeIndicatorEnum.RequestChallenge; + + if (value.Equals("requestChallengeAsMandate")) + return ChallengeIndicatorEnum.RequestChallengeAsMandate; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChallengeIndicatorEnumToJsonValue(ChallengeIndicatorEnum? value) + { + if (value == ChallengeIndicatorEnum.NoPreference) + return "noPreference"; + + if (value == ChallengeIndicatorEnum.RequestNoChallenge) + return "requestNoChallenge"; + + if (value == ChallengeIndicatorEnum.RequestChallenge) + return "requestChallenge"; + + if (value == ChallengeIndicatorEnum.RequestChallengeAsMandate) + return "requestChallengeAsMandate"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ChallengeIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChallengeIndicatorOption { get; private set; } /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` - [DataMember(Name = "challengeIndicator", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v68. Use `threeDSRequestorChallengeInd` instead.")] - public ChallengeIndicatorEnum? ChallengeIndicator { get; set; } + [JsonPropertyName("challengeIndicator")] + [Obsolete] + public ChallengeIndicatorEnum? ChallengeIndicator { get { return this.ChallengeIndicatorOption; } set { this.ChallengeIndicatorOption = new Option(value); } } + /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSRequestorChallengeIndEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// - [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// - [EnumMember(Value = "06")] _06 = 6 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ThreeDSRequestorChallengeIndEnum ThreeDSRequestorChallengeIndEnumFromString(string value) + { + if (value.Equals("01")) + return ThreeDSRequestorChallengeIndEnum._01; + + if (value.Equals("02")) + return ThreeDSRequestorChallengeIndEnum._02; + + if (value.Equals("03")) + return ThreeDSRequestorChallengeIndEnum._03; + + if (value.Equals("04")) + return ThreeDSRequestorChallengeIndEnum._04; + if (value.Equals("05")) + return ThreeDSRequestorChallengeIndEnum._05; + + if (value.Equals("06")) + return ThreeDSRequestorChallengeIndEnum._06; + + throw new NotImplementedException($"Could not convert value to type ThreeDSRequestorChallengeIndEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeIndEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ThreeDSRequestorChallengeIndEnum._01; + + if (value.Equals("02")) + return ThreeDSRequestorChallengeIndEnum._02; + + if (value.Equals("03")) + return ThreeDSRequestorChallengeIndEnum._03; + + if (value.Equals("04")) + return ThreeDSRequestorChallengeIndEnum._04; + + if (value.Equals("05")) + return ThreeDSRequestorChallengeIndEnum._05; + + if (value.Equals("06")) + return ThreeDSRequestorChallengeIndEnum._06; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ThreeDSRequestorChallengeIndEnumToJsonValue(ThreeDSRequestorChallengeIndEnum? value) + { + if (value == ThreeDSRequestorChallengeIndEnum._01) + return "01"; + + if (value == ThreeDSRequestorChallengeIndEnum._02) + return "02"; + + if (value == ThreeDSRequestorChallengeIndEnum._03) + return "03"; + + if (value == ThreeDSRequestorChallengeIndEnum._04) + return "04"; + + if (value == ThreeDSRequestorChallengeIndEnum._05) + return "05"; + + if (value == ThreeDSRequestorChallengeIndEnum._06) + return "06"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of ThreeDSRequestorChallengeInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorChallengeIndOption { get; private set; } /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - [DataMember(Name = "threeDSRequestorChallengeInd", EmitDefaultValue = false)] - public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get; set; } + [JsonPropertyName("threeDSRequestorChallengeInd")] + public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get { return this.ThreeDSRequestorChallengeIndOption; } set { this.ThreeDSRequestorChallengeIndOption = new Option(value); } } + /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load - [JsonConverter(typeof(StringEnumConverter))] public enum TransTypeEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 2, /// /// Enum _10 for value: 10 /// - [EnumMember(Value = "10")] _10 = 3, /// /// Enum _11 for value: 11 /// - [EnumMember(Value = "11")] _11 = 4, /// /// Enum _28 for value: 28 /// - [EnumMember(Value = "28")] _28 = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TransTypeEnum TransTypeEnumFromString(string value) + { + if (value.Equals("01")) + return TransTypeEnum._01; + + if (value.Equals("03")) + return TransTypeEnum._03; + + if (value.Equals("10")) + return TransTypeEnum._10; + if (value.Equals("11")) + return TransTypeEnum._11; + + if (value.Equals("28")) + return TransTypeEnum._28; + + throw new NotImplementedException($"Could not convert value to type TransTypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TransTypeEnum? TransTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return TransTypeEnum._01; + + if (value.Equals("03")) + return TransTypeEnum._03; + + if (value.Equals("10")) + return TransTypeEnum._10; + + if (value.Equals("11")) + return TransTypeEnum._11; + + if (value.Equals("28")) + return TransTypeEnum._28; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TransTypeEnumToJsonValue(TransTypeEnum? value) + { + if (value == TransTypeEnum._01) + return "01"; + + if (value == TransTypeEnum._03) + return "03"; + + if (value == TransTypeEnum._10) + return "10"; + + if (value == TransTypeEnum._11) + return "11"; + + if (value == TransTypeEnum._28) + return "28"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of TransType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TransTypeOption { get; private set; } /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load - [DataMember(Name = "transType", EmitDefaultValue = false)] - public TransTypeEnum? TransType { get; set; } + [JsonPropertyName("transType")] + public TransTypeEnum? TransType { get { return this.TransTypeOption; } set { this.TransTypeOption = new Option(value); } } + /// /// Identify the type of the transaction being authenticated. /// /// Identify the type of the transaction being authenticated. - [JsonConverter(typeof(StringEnumConverter))] public enum TransactionTypeEnum { /// /// Enum GoodsOrServicePurchase for value: goodsOrServicePurchase /// - [EnumMember(Value = "goodsOrServicePurchase")] GoodsOrServicePurchase = 1, /// /// Enum CheckAcceptance for value: checkAcceptance /// - [EnumMember(Value = "checkAcceptance")] CheckAcceptance = 2, /// /// Enum AccountFunding for value: accountFunding /// - [EnumMember(Value = "accountFunding")] AccountFunding = 3, /// /// Enum QuasiCashTransaction for value: quasiCashTransaction /// - [EnumMember(Value = "quasiCashTransaction")] QuasiCashTransaction = 4, /// /// Enum PrepaidActivationAndLoad for value: prepaidActivationAndLoad /// - [EnumMember(Value = "prepaidActivationAndLoad")] PrepaidActivationAndLoad = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TransactionTypeEnum TransactionTypeEnumFromString(string value) + { + if (value.Equals("goodsOrServicePurchase")) + return TransactionTypeEnum.GoodsOrServicePurchase; + + if (value.Equals("checkAcceptance")) + return TransactionTypeEnum.CheckAcceptance; + if (value.Equals("accountFunding")) + return TransactionTypeEnum.AccountFunding; + + if (value.Equals("quasiCashTransaction")) + return TransactionTypeEnum.QuasiCashTransaction; + + if (value.Equals("prepaidActivationAndLoad")) + return TransactionTypeEnum.PrepaidActivationAndLoad; + + throw new NotImplementedException($"Could not convert value to type TransactionTypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TransactionTypeEnum? TransactionTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("goodsOrServicePurchase")) + return TransactionTypeEnum.GoodsOrServicePurchase; + + if (value.Equals("checkAcceptance")) + return TransactionTypeEnum.CheckAcceptance; + + if (value.Equals("accountFunding")) + return TransactionTypeEnum.AccountFunding; + + if (value.Equals("quasiCashTransaction")) + return TransactionTypeEnum.QuasiCashTransaction; + + if (value.Equals("prepaidActivationAndLoad")) + return TransactionTypeEnum.PrepaidActivationAndLoad; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TransactionTypeEnumToJsonValue(TransactionTypeEnum? value) + { + if (value == TransactionTypeEnum.GoodsOrServicePurchase) + return "goodsOrServicePurchase"; + + if (value == TransactionTypeEnum.CheckAcceptance) + return "checkAcceptance"; + + if (value == TransactionTypeEnum.AccountFunding) + return "accountFunding"; + + if (value == TransactionTypeEnum.QuasiCashTransaction) + return "quasiCashTransaction"; + + if (value == TransactionTypeEnum.PrepaidActivationAndLoad) + return "prepaidActivationAndLoad"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of TransactionType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TransactionTypeOption { get; private set; } /// /// Identify the type of the transaction being authenticated. /// /// Identify the type of the transaction being authenticated. - [DataMember(Name = "transactionType", EmitDefaultValue = false)] - public TransactionTypeEnum? TransactionType { get; set; } + [JsonPropertyName("transactionType")] + public TransactionTypeEnum? TransactionType { get { return this.TransactionTypeOption; } set { this.TransactionTypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// The environment of the shopper. Allowed values: * `app` * `browser` /// - [JsonConstructorAttribute] - protected ThreeDS2RequestData() { } + /// The environment of the shopper. Allowed values: * `app` * `browser` + [JsonPropertyName("deviceChannel")] + public string DeviceChannel { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of AcctInfo /// - /// acctInfo. - /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform.. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform.. - /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address.. - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false). - /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` . - /// The environment of the shopper. Allowed values: * `app` * `browser` (required). - /// deviceRenderOptions. - /// homePhone. - /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme.. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account.. - /// The `messageVersion` value indicating the 3D Secure 2 protocol version.. - /// mobilePhone. - /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**.. - /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS.. - /// Indicates the type of payment for which an authentication is requested (message extension). - /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters.. - /// Date after which no further authorisations shall be performed. Format: YYYYMMDD. - /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters.. - /// The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**.. - /// The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**.. - /// sdkEphemPubKey. - /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. (default to 60). - /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**.. - /// The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**.. - /// Version of the 3D Secure 2 mobile SDK. Only for `deviceChannel` set to **app**.. - /// Completion indicator for the device fingerprinting.. - /// Indicates the type of Authentication request.. - /// threeDSRequestorAuthenticationInfo. - /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2.. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2.. - /// threeDSRequestorPriorAuthenticationInfo. - /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process.. - /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load. - /// Identify the type of the transaction being authenticated.. - /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0.. - /// workPhone. - public ThreeDS2RequestData(AcctInfo acctInfo = default(AcctInfo), AcctTypeEnum? acctType = default(AcctTypeEnum?), string acquirerBIN = default(string), string acquirerMerchantID = default(string), AddrMatchEnum? addrMatch = default(AddrMatchEnum?), bool? authenticationOnly = false, ChallengeIndicatorEnum? challengeIndicator = default(ChallengeIndicatorEnum?), string deviceChannel = default(string), DeviceRenderOptions deviceRenderOptions = default(DeviceRenderOptions), Phone homePhone = default(Phone), string mcc = default(string), string merchantName = default(string), string messageVersion = default(string), Phone mobilePhone = default(Phone), string notificationURL = default(string), bool? payTokenInd = default(bool?), string paymentAuthenticationUseCase = default(string), string purchaseInstalData = default(string), string recurringExpiry = default(string), string recurringFrequency = default(string), string sdkAppID = default(string), string sdkEncData = default(string), SDKEphemPubKey sdkEphemPubKey = default(SDKEphemPubKey), int? sdkMaxTimeout = 60, string sdkReferenceNumber = default(string), string sdkTransID = default(string), string sdkVersion = default(string), string threeDSCompInd = default(string), string threeDSRequestorAuthenticationInd = default(string), ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo = default(ThreeDSRequestorAuthenticationInfo), ThreeDSRequestorChallengeIndEnum? threeDSRequestorChallengeInd = default(ThreeDSRequestorChallengeIndEnum?), string threeDSRequestorID = default(string), string threeDSRequestorName = default(string), ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo = default(ThreeDSRequestorPriorAuthenticationInfo), string threeDSRequestorURL = default(string), TransTypeEnum? transType = default(TransTypeEnum?), TransactionTypeEnum? transactionType = default(TransactionTypeEnum?), string whiteListStatus = default(string), Phone workPhone = default(Phone)) - { - this.DeviceChannel = deviceChannel; - this.AcctInfo = acctInfo; - this.AcctType = acctType; - this.AcquirerBIN = acquirerBIN; - this.AcquirerMerchantID = acquirerMerchantID; - this.AddrMatch = addrMatch; - this.AuthenticationOnly = authenticationOnly; - this.ChallengeIndicator = challengeIndicator; - this.DeviceRenderOptions = deviceRenderOptions; - this.HomePhone = homePhone; - this.Mcc = mcc; - this.MerchantName = merchantName; - this.MessageVersion = messageVersion; - this.MobilePhone = mobilePhone; - this.NotificationURL = notificationURL; - this.PayTokenInd = payTokenInd; - this.PaymentAuthenticationUseCase = paymentAuthenticationUseCase; - this.PurchaseInstalData = purchaseInstalData; - this.RecurringExpiry = recurringExpiry; - this.RecurringFrequency = recurringFrequency; - this.SdkAppID = sdkAppID; - this.SdkEncData = sdkEncData; - this.SdkEphemPubKey = sdkEphemPubKey; - this.SdkMaxTimeout = sdkMaxTimeout; - this.SdkReferenceNumber = sdkReferenceNumber; - this.SdkTransID = sdkTransID; - this.SdkVersion = sdkVersion; - this.ThreeDSCompInd = threeDSCompInd; - this.ThreeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; - this.ThreeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; - this.ThreeDSRequestorChallengeInd = threeDSRequestorChallengeInd; - this.ThreeDSRequestorID = threeDSRequestorID; - this.ThreeDSRequestorName = threeDSRequestorName; - this.ThreeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; - this.ThreeDSRequestorURL = threeDSRequestorURL; - this.TransType = transType; - this.TransactionType = transactionType; - this.WhiteListStatus = whiteListStatus; - this.WorkPhone = workPhone; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcctInfoOption { get; private set; } /// /// Gets or Sets AcctInfo /// - [DataMember(Name = "acctInfo", EmitDefaultValue = false)] - public AcctInfo AcctInfo { get; set; } + [JsonPropertyName("acctInfo")] + public AcctInfo AcctInfo { get { return this.AcctInfoOption; } set { this.AcctInfoOption = new Option(value); } } + + /// + /// Used to track the state of AcquirerBIN + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcquirerBINOption { get; private set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. - [DataMember(Name = "acquirerBIN", EmitDefaultValue = false)] - public string AcquirerBIN { get; set; } + [JsonPropertyName("acquirerBIN")] + public string AcquirerBIN { get { return this.AcquirerBINOption; } set { this.AcquirerBINOption = new Option(value); } } + + /// + /// Used to track the state of AcquirerMerchantID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcquirerMerchantIDOption { get; private set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. - [DataMember(Name = "acquirerMerchantID", EmitDefaultValue = false)] - public string AcquirerMerchantID { get; set; } + [JsonPropertyName("acquirerMerchantID")] + public string AcquirerMerchantID { get { return this.AcquirerMerchantIDOption; } set { this.AcquirerMerchantIDOption = new Option(value); } } + + /// + /// Used to track the state of AuthenticationOnly + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthenticationOnlyOption { get; private set; } /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [DataMember(Name = "authenticationOnly", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v50. Use `threeDSAuthenticationOnly` instead.")] - public bool? AuthenticationOnly { get; set; } + [JsonPropertyName("authenticationOnly")] + [Obsolete] + public bool? AuthenticationOnly { get { return this.AuthenticationOnlyOption; } set { this.AuthenticationOnlyOption = new Option(value); } } /// - /// The environment of the shopper. Allowed values: * `app` * `browser` + /// Used to track the state of DeviceRenderOptions /// - /// The environment of the shopper. Allowed values: * `app` * `browser` - [DataMember(Name = "deviceChannel", IsRequired = false, EmitDefaultValue = false)] - public string DeviceChannel { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeviceRenderOptionsOption { get; private set; } /// /// Gets or Sets DeviceRenderOptions /// - [DataMember(Name = "deviceRenderOptions", EmitDefaultValue = false)] - public DeviceRenderOptions DeviceRenderOptions { get; set; } + [JsonPropertyName("deviceRenderOptions")] + public DeviceRenderOptions DeviceRenderOptions { get { return this.DeviceRenderOptionsOption; } set { this.DeviceRenderOptionsOption = new Option(value); } } + + /// + /// Used to track the state of HomePhone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option HomePhoneOption { get; private set; } /// /// Gets or Sets HomePhone /// - [DataMember(Name = "homePhone", EmitDefaultValue = false)] - public Phone HomePhone { get; set; } + [JsonPropertyName("homePhone")] + public Phone HomePhone { get { return this.HomePhoneOption; } set { this.HomePhoneOption = new Option(value); } } + + /// + /// Used to track the state of Mcc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MccOption { get; private set; } /// /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. /// /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. - [DataMember(Name = "mcc", EmitDefaultValue = false)] - public string Mcc { get; set; } + [JsonPropertyName("mcc")] + public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } + + /// + /// Used to track the state of MerchantName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantNameOption { get; private set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. - [DataMember(Name = "merchantName", EmitDefaultValue = false)] - public string MerchantName { get; set; } + [JsonPropertyName("merchantName")] + public string MerchantName { get { return this.MerchantNameOption; } set { this.MerchantNameOption = new Option(value); } } + + /// + /// Used to track the state of MessageVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MessageVersionOption { get; private set; } /// /// The `messageVersion` value indicating the 3D Secure 2 protocol version. /// /// The `messageVersion` value indicating the 3D Secure 2 protocol version. - [DataMember(Name = "messageVersion", EmitDefaultValue = false)] - public string MessageVersion { get; set; } + [JsonPropertyName("messageVersion")] + public string MessageVersion { get { return this.MessageVersionOption; } set { this.MessageVersionOption = new Option(value); } } + + /// + /// Used to track the state of MobilePhone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MobilePhoneOption { get; private set; } /// /// Gets or Sets MobilePhone /// - [DataMember(Name = "mobilePhone", EmitDefaultValue = false)] - public Phone MobilePhone { get; set; } + [JsonPropertyName("mobilePhone")] + public Phone MobilePhone { get { return this.MobilePhoneOption; } set { this.MobilePhoneOption = new Option(value); } } + + /// + /// Used to track the state of NotificationURL + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NotificationURLOption { get; private set; } /// /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. /// /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. - [DataMember(Name = "notificationURL", EmitDefaultValue = false)] - public string NotificationURL { get; set; } + [JsonPropertyName("notificationURL")] + public string NotificationURL { get { return this.NotificationURLOption; } set { this.NotificationURLOption = new Option(value); } } + + /// + /// Used to track the state of PayTokenInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayTokenIndOption { get; private set; } /// /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. /// /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. - [DataMember(Name = "payTokenInd", EmitDefaultValue = false)] - public bool? PayTokenInd { get; set; } + [JsonPropertyName("payTokenInd")] + public bool? PayTokenInd { get { return this.PayTokenIndOption; } set { this.PayTokenIndOption = new Option(value); } } + + /// + /// Used to track the state of PaymentAuthenticationUseCase + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentAuthenticationUseCaseOption { get; private set; } /// /// Indicates the type of payment for which an authentication is requested (message extension) /// /// Indicates the type of payment for which an authentication is requested (message extension) - [DataMember(Name = "paymentAuthenticationUseCase", EmitDefaultValue = false)] - public string PaymentAuthenticationUseCase { get; set; } + [JsonPropertyName("paymentAuthenticationUseCase")] + public string PaymentAuthenticationUseCase { get { return this.PaymentAuthenticationUseCaseOption; } set { this.PaymentAuthenticationUseCaseOption = new Option(value); } } + + /// + /// Used to track the state of PurchaseInstalData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PurchaseInstalDataOption { get; private set; } /// /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. /// /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. - [DataMember(Name = "purchaseInstalData", EmitDefaultValue = false)] - public string PurchaseInstalData { get; set; } + [JsonPropertyName("purchaseInstalData")] + public string PurchaseInstalData { get { return this.PurchaseInstalDataOption; } set { this.PurchaseInstalDataOption = new Option(value); } } + + /// + /// Used to track the state of RecurringExpiry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringExpiryOption { get; private set; } /// /// Date after which no further authorisations shall be performed. Format: YYYYMMDD /// /// Date after which no further authorisations shall be performed. Format: YYYYMMDD - [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] - public string RecurringExpiry { get; set; } + [JsonPropertyName("recurringExpiry")] + public string RecurringExpiry { get { return this.RecurringExpiryOption; } set { this.RecurringExpiryOption = new Option(value); } } + + /// + /// Used to track the state of RecurringFrequency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringFrequencyOption { get; private set; } /// /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters. /// /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters. - [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] - public string RecurringFrequency { get; set; } + [JsonPropertyName("recurringFrequency")] + public string RecurringFrequency { get { return this.RecurringFrequencyOption; } set { this.RecurringFrequencyOption = new Option(value); } } + + /// + /// Used to track the state of SdkAppID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkAppIDOption { get; private set; } /// /// The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. /// /// The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. - [DataMember(Name = "sdkAppID", EmitDefaultValue = false)] - public string SdkAppID { get; set; } + [JsonPropertyName("sdkAppID")] + public string SdkAppID { get { return this.SdkAppIDOption; } set { this.SdkAppIDOption = new Option(value); } } + + /// + /// Used to track the state of SdkEncData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkEncDataOption { get; private set; } /// /// The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. /// /// The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. - [DataMember(Name = "sdkEncData", EmitDefaultValue = false)] - public string SdkEncData { get; set; } + [JsonPropertyName("sdkEncData")] + public string SdkEncData { get { return this.SdkEncDataOption; } set { this.SdkEncDataOption = new Option(value); } } + + /// + /// Used to track the state of SdkEphemPubKey + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkEphemPubKeyOption { get; private set; } /// /// Gets or Sets SdkEphemPubKey /// - [DataMember(Name = "sdkEphemPubKey", EmitDefaultValue = false)] - public SDKEphemPubKey SdkEphemPubKey { get; set; } + [JsonPropertyName("sdkEphemPubKey")] + public SDKEphemPubKey SdkEphemPubKey { get { return this.SdkEphemPubKeyOption; } set { this.SdkEphemPubKeyOption = new Option(value); } } + + /// + /// Used to track the state of SdkMaxTimeout + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkMaxTimeoutOption { get; private set; } /// /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. /// /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. - [DataMember(Name = "sdkMaxTimeout", EmitDefaultValue = false)] - public int? SdkMaxTimeout { get; set; } + [JsonPropertyName("sdkMaxTimeout")] + public int? SdkMaxTimeout { get { return this.SdkMaxTimeoutOption; } set { this.SdkMaxTimeoutOption = new Option(value); } } + + /// + /// Used to track the state of SdkReferenceNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkReferenceNumberOption { get; private set; } /// /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. /// /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. - [DataMember(Name = "sdkReferenceNumber", EmitDefaultValue = false)] - public string SdkReferenceNumber { get; set; } + [JsonPropertyName("sdkReferenceNumber")] + public string SdkReferenceNumber { get { return this.SdkReferenceNumberOption; } set { this.SdkReferenceNumberOption = new Option(value); } } + + /// + /// Used to track the state of SdkTransID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkTransIDOption { get; private set; } /// /// The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. /// /// The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. - [DataMember(Name = "sdkTransID", EmitDefaultValue = false)] - public string SdkTransID { get; set; } + [JsonPropertyName("sdkTransID")] + public string SdkTransID { get { return this.SdkTransIDOption; } set { this.SdkTransIDOption = new Option(value); } } + + /// + /// Used to track the state of SdkVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkVersionOption { get; private set; } /// /// Version of the 3D Secure 2 mobile SDK. Only for `deviceChannel` set to **app**. /// /// Version of the 3D Secure 2 mobile SDK. Only for `deviceChannel` set to **app**. - [DataMember(Name = "sdkVersion", EmitDefaultValue = false)] - public string SdkVersion { get; set; } + [JsonPropertyName("sdkVersion")] + public string SdkVersion { get { return this.SdkVersionOption; } set { this.SdkVersionOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSCompInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSCompIndOption { get; private set; } /// /// Completion indicator for the device fingerprinting. /// /// Completion indicator for the device fingerprinting. - [DataMember(Name = "threeDSCompInd", EmitDefaultValue = false)] - public string ThreeDSCompInd { get; set; } + [JsonPropertyName("threeDSCompInd")] + public string ThreeDSCompInd { get { return this.ThreeDSCompIndOption; } set { this.ThreeDSCompIndOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSRequestorAuthenticationInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorAuthenticationIndOption { get; private set; } /// /// Indicates the type of Authentication request. /// /// Indicates the type of Authentication request. - [DataMember(Name = "threeDSRequestorAuthenticationInd", EmitDefaultValue = false)] - public string ThreeDSRequestorAuthenticationInd { get; set; } + [JsonPropertyName("threeDSRequestorAuthenticationInd")] + public string ThreeDSRequestorAuthenticationInd { get { return this.ThreeDSRequestorAuthenticationIndOption; } set { this.ThreeDSRequestorAuthenticationIndOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSRequestorAuthenticationInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorAuthenticationInfoOption { get; private set; } /// /// Gets or Sets ThreeDSRequestorAuthenticationInfo /// - [DataMember(Name = "threeDSRequestorAuthenticationInfo", EmitDefaultValue = false)] - public ThreeDSRequestorAuthenticationInfo ThreeDSRequestorAuthenticationInfo { get; set; } + [JsonPropertyName("threeDSRequestorAuthenticationInfo")] + public ThreeDSRequestorAuthenticationInfo ThreeDSRequestorAuthenticationInfo { get { return this.ThreeDSRequestorAuthenticationInfoOption; } set { this.ThreeDSRequestorAuthenticationInfoOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSRequestorID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorIDOption { get; private set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. - [DataMember(Name = "threeDSRequestorID", EmitDefaultValue = false)] - public string ThreeDSRequestorID { get; set; } + [JsonPropertyName("threeDSRequestorID")] + public string ThreeDSRequestorID { get { return this.ThreeDSRequestorIDOption; } set { this.ThreeDSRequestorIDOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSRequestorName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorNameOption { get; private set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. - [DataMember(Name = "threeDSRequestorName", EmitDefaultValue = false)] - public string ThreeDSRequestorName { get; set; } + [JsonPropertyName("threeDSRequestorName")] + public string ThreeDSRequestorName { get { return this.ThreeDSRequestorNameOption; } set { this.ThreeDSRequestorNameOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSRequestorPriorAuthenticationInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorPriorAuthenticationInfoOption { get; private set; } /// /// Gets or Sets ThreeDSRequestorPriorAuthenticationInfo /// - [DataMember(Name = "threeDSRequestorPriorAuthenticationInfo", EmitDefaultValue = false)] - public ThreeDSRequestorPriorAuthenticationInfo ThreeDSRequestorPriorAuthenticationInfo { get; set; } + [JsonPropertyName("threeDSRequestorPriorAuthenticationInfo")] + public ThreeDSRequestorPriorAuthenticationInfo ThreeDSRequestorPriorAuthenticationInfo { get { return this.ThreeDSRequestorPriorAuthenticationInfoOption; } set { this.ThreeDSRequestorPriorAuthenticationInfoOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSRequestorURL + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorURLOption { get; private set; } /// /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. /// /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. - [DataMember(Name = "threeDSRequestorURL", EmitDefaultValue = false)] - public string ThreeDSRequestorURL { get; set; } + [JsonPropertyName("threeDSRequestorURL")] + public string ThreeDSRequestorURL { get { return this.ThreeDSRequestorURLOption; } set { this.ThreeDSRequestorURLOption = new Option(value); } } + + /// + /// Used to track the state of WhiteListStatus + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option WhiteListStatusOption { get; private set; } /// /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. /// /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. - [DataMember(Name = "whiteListStatus", EmitDefaultValue = false)] - public string WhiteListStatus { get; set; } + [JsonPropertyName("whiteListStatus")] + public string WhiteListStatus { get { return this.WhiteListStatusOption; } set { this.WhiteListStatusOption = new Option(value); } } + + /// + /// Used to track the state of WorkPhone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option WorkPhoneOption { get; private set; } /// /// Gets or Sets WorkPhone /// - [DataMember(Name = "workPhone", EmitDefaultValue = false)] - public Phone WorkPhone { get; set; } + [JsonPropertyName("workPhone")] + public Phone WorkPhone { get { return this.WorkPhoneOption; } set { this.WorkPhoneOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -601,6 +1242,7 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class ThreeDS2RequestData {\n"); + sb.Append(" DeviceChannel: ").Append(DeviceChannel).Append("\n"); sb.Append(" AcctInfo: ").Append(AcctInfo).Append("\n"); sb.Append(" AcctType: ").Append(AcctType).Append("\n"); sb.Append(" AcquirerBIN: ").Append(AcquirerBIN).Append("\n"); @@ -608,7 +1250,6 @@ public override string ToString() sb.Append(" AddrMatch: ").Append(AddrMatch).Append("\n"); sb.Append(" AuthenticationOnly: ").Append(AuthenticationOnly).Append("\n"); sb.Append(" ChallengeIndicator: ").Append(ChallengeIndicator).Append("\n"); - sb.Append(" DeviceChannel: ").Append(DeviceChannel).Append("\n"); sb.Append(" DeviceRenderOptions: ").Append(DeviceRenderOptions).Append("\n"); sb.Append(" HomePhone: ").Append(HomePhone).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); @@ -645,392 +1286,620 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // PurchaseInstalData (string) maxLength + if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length > 3) + { + yield return new ValidationResult("Invalid value for PurchaseInstalData, length must be less than 3.", new [] { "PurchaseInstalData" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ThreeDS2RequestData); - } + // PurchaseInstalData (string) minLength + if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length < 1) + { + yield return new ValidationResult("Invalid value for PurchaseInstalData, length must be greater than 1.", new [] { "PurchaseInstalData" }); + } - /// - /// Returns true if ThreeDS2RequestData instances are equal - /// - /// Instance of ThreeDS2RequestData to be compared - /// Boolean - public bool Equals(ThreeDS2RequestData input) - { - if (input == null) + // RecurringFrequency (string) maxLength + if (this.RecurringFrequency != null && this.RecurringFrequency.Length > 4) { - return false; + yield return new ValidationResult("Invalid value for RecurringFrequency, length must be less than 4.", new [] { "RecurringFrequency" }); } - return - ( - this.AcctInfo == input.AcctInfo || - (this.AcctInfo != null && - this.AcctInfo.Equals(input.AcctInfo)) - ) && - ( - this.AcctType == input.AcctType || - this.AcctType.Equals(input.AcctType) - ) && - ( - this.AcquirerBIN == input.AcquirerBIN || - (this.AcquirerBIN != null && - this.AcquirerBIN.Equals(input.AcquirerBIN)) - ) && - ( - this.AcquirerMerchantID == input.AcquirerMerchantID || - (this.AcquirerMerchantID != null && - this.AcquirerMerchantID.Equals(input.AcquirerMerchantID)) - ) && - ( - this.AddrMatch == input.AddrMatch || - this.AddrMatch.Equals(input.AddrMatch) - ) && - ( - this.AuthenticationOnly == input.AuthenticationOnly || - this.AuthenticationOnly.Equals(input.AuthenticationOnly) - ) && - ( - this.ChallengeIndicator == input.ChallengeIndicator || - this.ChallengeIndicator.Equals(input.ChallengeIndicator) - ) && - ( - this.DeviceChannel == input.DeviceChannel || - (this.DeviceChannel != null && - this.DeviceChannel.Equals(input.DeviceChannel)) - ) && - ( - this.DeviceRenderOptions == input.DeviceRenderOptions || - (this.DeviceRenderOptions != null && - this.DeviceRenderOptions.Equals(input.DeviceRenderOptions)) - ) && - ( - this.HomePhone == input.HomePhone || - (this.HomePhone != null && - this.HomePhone.Equals(input.HomePhone)) - ) && - ( - this.Mcc == input.Mcc || - (this.Mcc != null && - this.Mcc.Equals(input.Mcc)) - ) && - ( - this.MerchantName == input.MerchantName || - (this.MerchantName != null && - this.MerchantName.Equals(input.MerchantName)) - ) && - ( - this.MessageVersion == input.MessageVersion || - (this.MessageVersion != null && - this.MessageVersion.Equals(input.MessageVersion)) - ) && - ( - this.MobilePhone == input.MobilePhone || - (this.MobilePhone != null && - this.MobilePhone.Equals(input.MobilePhone)) - ) && - ( - this.NotificationURL == input.NotificationURL || - (this.NotificationURL != null && - this.NotificationURL.Equals(input.NotificationURL)) - ) && - ( - this.PayTokenInd == input.PayTokenInd || - this.PayTokenInd.Equals(input.PayTokenInd) - ) && - ( - this.PaymentAuthenticationUseCase == input.PaymentAuthenticationUseCase || - (this.PaymentAuthenticationUseCase != null && - this.PaymentAuthenticationUseCase.Equals(input.PaymentAuthenticationUseCase)) - ) && - ( - this.PurchaseInstalData == input.PurchaseInstalData || - (this.PurchaseInstalData != null && - this.PurchaseInstalData.Equals(input.PurchaseInstalData)) - ) && - ( - this.RecurringExpiry == input.RecurringExpiry || - (this.RecurringExpiry != null && - this.RecurringExpiry.Equals(input.RecurringExpiry)) - ) && - ( - this.RecurringFrequency == input.RecurringFrequency || - (this.RecurringFrequency != null && - this.RecurringFrequency.Equals(input.RecurringFrequency)) - ) && - ( - this.SdkAppID == input.SdkAppID || - (this.SdkAppID != null && - this.SdkAppID.Equals(input.SdkAppID)) - ) && - ( - this.SdkEncData == input.SdkEncData || - (this.SdkEncData != null && - this.SdkEncData.Equals(input.SdkEncData)) - ) && - ( - this.SdkEphemPubKey == input.SdkEphemPubKey || - (this.SdkEphemPubKey != null && - this.SdkEphemPubKey.Equals(input.SdkEphemPubKey)) - ) && - ( - this.SdkMaxTimeout == input.SdkMaxTimeout || - this.SdkMaxTimeout.Equals(input.SdkMaxTimeout) - ) && - ( - this.SdkReferenceNumber == input.SdkReferenceNumber || - (this.SdkReferenceNumber != null && - this.SdkReferenceNumber.Equals(input.SdkReferenceNumber)) - ) && - ( - this.SdkTransID == input.SdkTransID || - (this.SdkTransID != null && - this.SdkTransID.Equals(input.SdkTransID)) - ) && - ( - this.SdkVersion == input.SdkVersion || - (this.SdkVersion != null && - this.SdkVersion.Equals(input.SdkVersion)) - ) && - ( - this.ThreeDSCompInd == input.ThreeDSCompInd || - (this.ThreeDSCompInd != null && - this.ThreeDSCompInd.Equals(input.ThreeDSCompInd)) - ) && - ( - this.ThreeDSRequestorAuthenticationInd == input.ThreeDSRequestorAuthenticationInd || - (this.ThreeDSRequestorAuthenticationInd != null && - this.ThreeDSRequestorAuthenticationInd.Equals(input.ThreeDSRequestorAuthenticationInd)) - ) && - ( - this.ThreeDSRequestorAuthenticationInfo == input.ThreeDSRequestorAuthenticationInfo || - (this.ThreeDSRequestorAuthenticationInfo != null && - this.ThreeDSRequestorAuthenticationInfo.Equals(input.ThreeDSRequestorAuthenticationInfo)) - ) && - ( - this.ThreeDSRequestorChallengeInd == input.ThreeDSRequestorChallengeInd || - this.ThreeDSRequestorChallengeInd.Equals(input.ThreeDSRequestorChallengeInd) - ) && - ( - this.ThreeDSRequestorID == input.ThreeDSRequestorID || - (this.ThreeDSRequestorID != null && - this.ThreeDSRequestorID.Equals(input.ThreeDSRequestorID)) - ) && - ( - this.ThreeDSRequestorName == input.ThreeDSRequestorName || - (this.ThreeDSRequestorName != null && - this.ThreeDSRequestorName.Equals(input.ThreeDSRequestorName)) - ) && - ( - this.ThreeDSRequestorPriorAuthenticationInfo == input.ThreeDSRequestorPriorAuthenticationInfo || - (this.ThreeDSRequestorPriorAuthenticationInfo != null && - this.ThreeDSRequestorPriorAuthenticationInfo.Equals(input.ThreeDSRequestorPriorAuthenticationInfo)) - ) && - ( - this.ThreeDSRequestorURL == input.ThreeDSRequestorURL || - (this.ThreeDSRequestorURL != null && - this.ThreeDSRequestorURL.Equals(input.ThreeDSRequestorURL)) - ) && - ( - this.TransType == input.TransType || - this.TransType.Equals(input.TransType) - ) && - ( - this.TransactionType == input.TransactionType || - this.TransactionType.Equals(input.TransactionType) - ) && - ( - this.WhiteListStatus == input.WhiteListStatus || - (this.WhiteListStatus != null && - this.WhiteListStatus.Equals(input.WhiteListStatus)) - ) && - ( - this.WorkPhone == input.WorkPhone || - (this.WorkPhone != null && - this.WorkPhone.Equals(input.WorkPhone)) - ); + + yield break; } + } + /// + /// A Json converter for type + /// + public class ThreeDS2RequestDataJsonConverter : JsonConverter + { /// - /// Gets the hash code + /// Deserializes json to /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + /// + public override ThreeDS2RequestData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option deviceChannel = default; + Option acctInfo = default; + Option acctType = default; + Option acquirerBIN = default; + Option acquirerMerchantID = default; + Option addrMatch = default; + Option authenticationOnly = default; + Option challengeIndicator = default; + Option deviceRenderOptions = default; + Option homePhone = default; + Option mcc = default; + Option merchantName = default; + Option messageVersion = default; + Option mobilePhone = default; + Option notificationURL = default; + Option payTokenInd = default; + Option paymentAuthenticationUseCase = default; + Option purchaseInstalData = default; + Option recurringExpiry = default; + Option recurringFrequency = default; + Option sdkAppID = default; + Option sdkEncData = default; + Option sdkEphemPubKey = default; + Option sdkMaxTimeout = default; + Option sdkReferenceNumber = default; + Option sdkTransID = default; + Option sdkVersion = default; + Option threeDSCompInd = default; + Option threeDSRequestorAuthenticationInd = default; + Option threeDSRequestorAuthenticationInfo = default; + Option threeDSRequestorChallengeInd = default; + Option threeDSRequestorID = default; + Option threeDSRequestorName = default; + Option threeDSRequestorPriorAuthenticationInfo = default; + Option threeDSRequestorURL = default; + Option transType = default; + Option transactionType = default; + Option whiteListStatus = default; + Option workPhone = default; + + while (utf8JsonReader.Read()) { - int hashCode = 41; - if (this.AcctInfo != null) - { - hashCode = (hashCode * 59) + this.AcctInfo.GetHashCode(); - } - hashCode = (hashCode * 59) + this.AcctType.GetHashCode(); - if (this.AcquirerBIN != null) - { - hashCode = (hashCode * 59) + this.AcquirerBIN.GetHashCode(); - } - if (this.AcquirerMerchantID != null) - { - hashCode = (hashCode * 59) + this.AcquirerMerchantID.GetHashCode(); - } - hashCode = (hashCode * 59) + this.AddrMatch.GetHashCode(); - hashCode = (hashCode * 59) + this.AuthenticationOnly.GetHashCode(); - hashCode = (hashCode * 59) + this.ChallengeIndicator.GetHashCode(); - if (this.DeviceChannel != null) - { - hashCode = (hashCode * 59) + this.DeviceChannel.GetHashCode(); - } - if (this.DeviceRenderOptions != null) - { - hashCode = (hashCode * 59) + this.DeviceRenderOptions.GetHashCode(); - } - if (this.HomePhone != null) - { - hashCode = (hashCode * 59) + this.HomePhone.GetHashCode(); - } - if (this.Mcc != null) - { - hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); - } - if (this.MerchantName != null) - { - hashCode = (hashCode * 59) + this.MerchantName.GetHashCode(); - } - if (this.MessageVersion != null) - { - hashCode = (hashCode * 59) + this.MessageVersion.GetHashCode(); - } - if (this.MobilePhone != null) - { - hashCode = (hashCode * 59) + this.MobilePhone.GetHashCode(); - } - if (this.NotificationURL != null) - { - hashCode = (hashCode * 59) + this.NotificationURL.GetHashCode(); - } - hashCode = (hashCode * 59) + this.PayTokenInd.GetHashCode(); - if (this.PaymentAuthenticationUseCase != null) - { - hashCode = (hashCode * 59) + this.PaymentAuthenticationUseCase.GetHashCode(); - } - if (this.PurchaseInstalData != null) - { - hashCode = (hashCode * 59) + this.PurchaseInstalData.GetHashCode(); - } - if (this.RecurringExpiry != null) - { - hashCode = (hashCode * 59) + this.RecurringExpiry.GetHashCode(); - } - if (this.RecurringFrequency != null) - { - hashCode = (hashCode * 59) + this.RecurringFrequency.GetHashCode(); - } - if (this.SdkAppID != null) - { - hashCode = (hashCode * 59) + this.SdkAppID.GetHashCode(); - } - if (this.SdkEncData != null) - { - hashCode = (hashCode * 59) + this.SdkEncData.GetHashCode(); - } - if (this.SdkEphemPubKey != null) - { - hashCode = (hashCode * 59) + this.SdkEphemPubKey.GetHashCode(); - } - hashCode = (hashCode * 59) + this.SdkMaxTimeout.GetHashCode(); - if (this.SdkReferenceNumber != null) - { - hashCode = (hashCode * 59) + this.SdkReferenceNumber.GetHashCode(); - } - if (this.SdkTransID != null) - { - hashCode = (hashCode * 59) + this.SdkTransID.GetHashCode(); - } - if (this.SdkVersion != null) - { - hashCode = (hashCode * 59) + this.SdkVersion.GetHashCode(); - } - if (this.ThreeDSCompInd != null) - { - hashCode = (hashCode * 59) + this.ThreeDSCompInd.GetHashCode(); - } - if (this.ThreeDSRequestorAuthenticationInd != null) - { - hashCode = (hashCode * 59) + this.ThreeDSRequestorAuthenticationInd.GetHashCode(); - } - if (this.ThreeDSRequestorAuthenticationInfo != null) - { - hashCode = (hashCode * 59) + this.ThreeDSRequestorAuthenticationInfo.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ThreeDSRequestorChallengeInd.GetHashCode(); - if (this.ThreeDSRequestorID != null) - { - hashCode = (hashCode * 59) + this.ThreeDSRequestorID.GetHashCode(); - } - if (this.ThreeDSRequestorName != null) - { - hashCode = (hashCode * 59) + this.ThreeDSRequestorName.GetHashCode(); - } - if (this.ThreeDSRequestorPriorAuthenticationInfo != null) - { - hashCode = (hashCode * 59) + this.ThreeDSRequestorPriorAuthenticationInfo.GetHashCode(); - } - if (this.ThreeDSRequestorURL != null) - { - hashCode = (hashCode * 59) + this.ThreeDSRequestorURL.GetHashCode(); - } - hashCode = (hashCode * 59) + this.TransType.GetHashCode(); - hashCode = (hashCode * 59) + this.TransactionType.GetHashCode(); - if (this.WhiteListStatus != null) - { - hashCode = (hashCode * 59) + this.WhiteListStatus.GetHashCode(); - } - if (this.WorkPhone != null) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - hashCode = (hashCode * 59) + this.WorkPhone.GetHashCode(); + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "deviceChannel": + deviceChannel = new Option(utf8JsonReader.GetString()); + break; + case "acctInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + acctInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "acctType": + string acctTypeRawValue = utf8JsonReader.GetString(); + if (acctTypeRawValue != null) + acctType = new Option(ThreeDS2RequestData.AcctTypeEnumFromStringOrDefault(acctTypeRawValue)); + break; + case "acquirerBIN": + acquirerBIN = new Option(utf8JsonReader.GetString()); + break; + case "acquirerMerchantID": + acquirerMerchantID = new Option(utf8JsonReader.GetString()); + break; + case "addrMatch": + string addrMatchRawValue = utf8JsonReader.GetString(); + if (addrMatchRawValue != null) + addrMatch = new Option(ThreeDS2RequestData.AddrMatchEnumFromStringOrDefault(addrMatchRawValue)); + break; + case "authenticationOnly": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + authenticationOnly = new Option(utf8JsonReader.GetBoolean()); + break; + case "challengeIndicator": + string challengeIndicatorRawValue = utf8JsonReader.GetString(); + if (challengeIndicatorRawValue != null) + challengeIndicator = new Option(ThreeDS2RequestData.ChallengeIndicatorEnumFromStringOrDefault(challengeIndicatorRawValue)); + break; + case "deviceRenderOptions": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deviceRenderOptions = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "homePhone": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + homePhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mcc": + mcc = new Option(utf8JsonReader.GetString()); + break; + case "merchantName": + merchantName = new Option(utf8JsonReader.GetString()); + break; + case "messageVersion": + messageVersion = new Option(utf8JsonReader.GetString()); + break; + case "mobilePhone": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mobilePhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notificationURL": + notificationURL = new Option(utf8JsonReader.GetString()); + break; + case "payTokenInd": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + payTokenInd = new Option(utf8JsonReader.GetBoolean()); + break; + case "paymentAuthenticationUseCase": + paymentAuthenticationUseCase = new Option(utf8JsonReader.GetString()); + break; + case "purchaseInstalData": + purchaseInstalData = new Option(utf8JsonReader.GetString()); + break; + case "recurringExpiry": + recurringExpiry = new Option(utf8JsonReader.GetString()); + break; + case "recurringFrequency": + recurringFrequency = new Option(utf8JsonReader.GetString()); + break; + case "sdkAppID": + sdkAppID = new Option(utf8JsonReader.GetString()); + break; + case "sdkEncData": + sdkEncData = new Option(utf8JsonReader.GetString()); + break; + case "sdkEphemPubKey": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sdkEphemPubKey = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "sdkMaxTimeout": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sdkMaxTimeout = new Option(utf8JsonReader.GetInt32()); + break; + case "sdkReferenceNumber": + sdkReferenceNumber = new Option(utf8JsonReader.GetString()); + break; + case "sdkTransID": + sdkTransID = new Option(utf8JsonReader.GetString()); + break; + case "sdkVersion": + sdkVersion = new Option(utf8JsonReader.GetString()); + break; + case "threeDSCompInd": + threeDSCompInd = new Option(utf8JsonReader.GetString()); + break; + case "threeDSRequestorAuthenticationInd": + threeDSRequestorAuthenticationInd = new Option(utf8JsonReader.GetString()); + break; + case "threeDSRequestorAuthenticationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDSRequestorAuthenticationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDSRequestorChallengeInd": + string threeDSRequestorChallengeIndRawValue = utf8JsonReader.GetString(); + if (threeDSRequestorChallengeIndRawValue != null) + threeDSRequestorChallengeInd = new Option(ThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumFromStringOrDefault(threeDSRequestorChallengeIndRawValue)); + break; + case "threeDSRequestorID": + threeDSRequestorID = new Option(utf8JsonReader.GetString()); + break; + case "threeDSRequestorName": + threeDSRequestorName = new Option(utf8JsonReader.GetString()); + break; + case "threeDSRequestorPriorAuthenticationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDSRequestorPriorAuthenticationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDSRequestorURL": + threeDSRequestorURL = new Option(utf8JsonReader.GetString()); + break; + case "transType": + string transTypeRawValue = utf8JsonReader.GetString(); + if (transTypeRawValue != null) + transType = new Option(ThreeDS2RequestData.TransTypeEnumFromStringOrDefault(transTypeRawValue)); + break; + case "transactionType": + string transactionTypeRawValue = utf8JsonReader.GetString(); + if (transactionTypeRawValue != null) + transactionType = new Option(ThreeDS2RequestData.TransactionTypeEnumFromStringOrDefault(transactionTypeRawValue)); + break; + case "whiteListStatus": + whiteListStatus = new Option(utf8JsonReader.GetString()); + break; + case "workPhone": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + workPhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } } - return hashCode; } + + if (!deviceChannel.IsSet) + throw new ArgumentException("Property is required for class ThreeDS2RequestData.", nameof(deviceChannel)); + + if (deviceChannel.IsSet && deviceChannel.Value == null) + throw new ArgumentNullException(nameof(deviceChannel), "Property is not nullable for class ThreeDS2RequestData."); + + if (acctInfo.IsSet && acctInfo.Value == null) + throw new ArgumentNullException(nameof(acctInfo), "Property is not nullable for class ThreeDS2RequestData."); + + if (acctType.IsSet && acctType.Value == null) + throw new ArgumentNullException(nameof(acctType), "Property is not nullable for class ThreeDS2RequestData."); + + if (acquirerBIN.IsSet && acquirerBIN.Value == null) + throw new ArgumentNullException(nameof(acquirerBIN), "Property is not nullable for class ThreeDS2RequestData."); + + if (acquirerMerchantID.IsSet && acquirerMerchantID.Value == null) + throw new ArgumentNullException(nameof(acquirerMerchantID), "Property is not nullable for class ThreeDS2RequestData."); + + if (addrMatch.IsSet && addrMatch.Value == null) + throw new ArgumentNullException(nameof(addrMatch), "Property is not nullable for class ThreeDS2RequestData."); + + if (authenticationOnly.IsSet && authenticationOnly.Value == null) + throw new ArgumentNullException(nameof(authenticationOnly), "Property is not nullable for class ThreeDS2RequestData."); + + if (challengeIndicator.IsSet && challengeIndicator.Value == null) + throw new ArgumentNullException(nameof(challengeIndicator), "Property is not nullable for class ThreeDS2RequestData."); + + if (deviceRenderOptions.IsSet && deviceRenderOptions.Value == null) + throw new ArgumentNullException(nameof(deviceRenderOptions), "Property is not nullable for class ThreeDS2RequestData."); + + if (homePhone.IsSet && homePhone.Value == null) + throw new ArgumentNullException(nameof(homePhone), "Property is not nullable for class ThreeDS2RequestData."); + + if (mcc.IsSet && mcc.Value == null) + throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class ThreeDS2RequestData."); + + if (merchantName.IsSet && merchantName.Value == null) + throw new ArgumentNullException(nameof(merchantName), "Property is not nullable for class ThreeDS2RequestData."); + + if (messageVersion.IsSet && messageVersion.Value == null) + throw new ArgumentNullException(nameof(messageVersion), "Property is not nullable for class ThreeDS2RequestData."); + + if (mobilePhone.IsSet && mobilePhone.Value == null) + throw new ArgumentNullException(nameof(mobilePhone), "Property is not nullable for class ThreeDS2RequestData."); + + if (notificationURL.IsSet && notificationURL.Value == null) + throw new ArgumentNullException(nameof(notificationURL), "Property is not nullable for class ThreeDS2RequestData."); + + if (payTokenInd.IsSet && payTokenInd.Value == null) + throw new ArgumentNullException(nameof(payTokenInd), "Property is not nullable for class ThreeDS2RequestData."); + + if (paymentAuthenticationUseCase.IsSet && paymentAuthenticationUseCase.Value == null) + throw new ArgumentNullException(nameof(paymentAuthenticationUseCase), "Property is not nullable for class ThreeDS2RequestData."); + + if (purchaseInstalData.IsSet && purchaseInstalData.Value == null) + throw new ArgumentNullException(nameof(purchaseInstalData), "Property is not nullable for class ThreeDS2RequestData."); + + if (recurringExpiry.IsSet && recurringExpiry.Value == null) + throw new ArgumentNullException(nameof(recurringExpiry), "Property is not nullable for class ThreeDS2RequestData."); + + if (recurringFrequency.IsSet && recurringFrequency.Value == null) + throw new ArgumentNullException(nameof(recurringFrequency), "Property is not nullable for class ThreeDS2RequestData."); + + if (sdkAppID.IsSet && sdkAppID.Value == null) + throw new ArgumentNullException(nameof(sdkAppID), "Property is not nullable for class ThreeDS2RequestData."); + + if (sdkEncData.IsSet && sdkEncData.Value == null) + throw new ArgumentNullException(nameof(sdkEncData), "Property is not nullable for class ThreeDS2RequestData."); + + if (sdkEphemPubKey.IsSet && sdkEphemPubKey.Value == null) + throw new ArgumentNullException(nameof(sdkEphemPubKey), "Property is not nullable for class ThreeDS2RequestData."); + + if (sdkMaxTimeout.IsSet && sdkMaxTimeout.Value == null) + throw new ArgumentNullException(nameof(sdkMaxTimeout), "Property is not nullable for class ThreeDS2RequestData."); + + if (sdkReferenceNumber.IsSet && sdkReferenceNumber.Value == null) + throw new ArgumentNullException(nameof(sdkReferenceNumber), "Property is not nullable for class ThreeDS2RequestData."); + + if (sdkTransID.IsSet && sdkTransID.Value == null) + throw new ArgumentNullException(nameof(sdkTransID), "Property is not nullable for class ThreeDS2RequestData."); + + if (sdkVersion.IsSet && sdkVersion.Value == null) + throw new ArgumentNullException(nameof(sdkVersion), "Property is not nullable for class ThreeDS2RequestData."); + + if (threeDSCompInd.IsSet && threeDSCompInd.Value == null) + throw new ArgumentNullException(nameof(threeDSCompInd), "Property is not nullable for class ThreeDS2RequestData."); + + if (threeDSRequestorAuthenticationInd.IsSet && threeDSRequestorAuthenticationInd.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorAuthenticationInd), "Property is not nullable for class ThreeDS2RequestData."); + + if (threeDSRequestorAuthenticationInfo.IsSet && threeDSRequestorAuthenticationInfo.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorAuthenticationInfo), "Property is not nullable for class ThreeDS2RequestData."); + + if (threeDSRequestorChallengeInd.IsSet && threeDSRequestorChallengeInd.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorChallengeInd), "Property is not nullable for class ThreeDS2RequestData."); + + if (threeDSRequestorID.IsSet && threeDSRequestorID.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorID), "Property is not nullable for class ThreeDS2RequestData."); + + if (threeDSRequestorName.IsSet && threeDSRequestorName.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorName), "Property is not nullable for class ThreeDS2RequestData."); + + if (threeDSRequestorPriorAuthenticationInfo.IsSet && threeDSRequestorPriorAuthenticationInfo.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorPriorAuthenticationInfo), "Property is not nullable for class ThreeDS2RequestData."); + + if (threeDSRequestorURL.IsSet && threeDSRequestorURL.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorURL), "Property is not nullable for class ThreeDS2RequestData."); + + if (transType.IsSet && transType.Value == null) + throw new ArgumentNullException(nameof(transType), "Property is not nullable for class ThreeDS2RequestData."); + + if (transactionType.IsSet && transactionType.Value == null) + throw new ArgumentNullException(nameof(transactionType), "Property is not nullable for class ThreeDS2RequestData."); + + if (whiteListStatus.IsSet && whiteListStatus.Value == null) + throw new ArgumentNullException(nameof(whiteListStatus), "Property is not nullable for class ThreeDS2RequestData."); + + if (workPhone.IsSet && workPhone.Value == null) + throw new ArgumentNullException(nameof(workPhone), "Property is not nullable for class ThreeDS2RequestData."); + + return new ThreeDS2RequestData(deviceChannel.Value, acctInfo, acctType, acquirerBIN, acquirerMerchantID, addrMatch, authenticationOnly, challengeIndicator, deviceRenderOptions, homePhone, mcc, merchantName, messageVersion, mobilePhone, notificationURL, payTokenInd, paymentAuthenticationUseCase, purchaseInstalData, recurringExpiry, recurringFrequency, sdkAppID, sdkEncData, sdkEphemPubKey, sdkMaxTimeout, sdkReferenceNumber, sdkTransID, sdkVersion, threeDSCompInd, threeDSRequestorAuthenticationInd, threeDSRequestorAuthenticationInfo, threeDSRequestorChallengeInd, threeDSRequestorID, threeDSRequestorName, threeDSRequestorPriorAuthenticationInfo, threeDSRequestorURL, transType, transactionType, whiteListStatus, workPhone); } + /// - /// To validate all properties of the instance + /// Serializes a /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ThreeDS2RequestData threeDS2RequestData, JsonSerializerOptions jsonSerializerOptions) { - // PurchaseInstalData (string) maxLength - if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length > 3) + writer.WriteStartObject(); + + WriteProperties(writer, threeDS2RequestData, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ThreeDS2RequestData threeDS2RequestData, JsonSerializerOptions jsonSerializerOptions) + { + if (threeDS2RequestData.DeviceChannel == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.DeviceChannel), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.AcctInfoOption.IsSet && threeDS2RequestData.AcctInfo == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.AcctInfo), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.AcquirerBINOption.IsSet && threeDS2RequestData.AcquirerBIN == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.AcquirerBIN), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.AcquirerMerchantIDOption.IsSet && threeDS2RequestData.AcquirerMerchantID == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.AcquirerMerchantID), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.DeviceRenderOptionsOption.IsSet && threeDS2RequestData.DeviceRenderOptions == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.DeviceRenderOptions), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.HomePhoneOption.IsSet && threeDS2RequestData.HomePhone == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.HomePhone), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.MccOption.IsSet && threeDS2RequestData.Mcc == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.Mcc), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.MerchantNameOption.IsSet && threeDS2RequestData.MerchantName == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.MerchantName), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.MessageVersionOption.IsSet && threeDS2RequestData.MessageVersion == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.MessageVersion), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.MobilePhoneOption.IsSet && threeDS2RequestData.MobilePhone == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.MobilePhone), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.NotificationURLOption.IsSet && threeDS2RequestData.NotificationURL == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.NotificationURL), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.PaymentAuthenticationUseCaseOption.IsSet && threeDS2RequestData.PaymentAuthenticationUseCase == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.PaymentAuthenticationUseCase), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.PurchaseInstalDataOption.IsSet && threeDS2RequestData.PurchaseInstalData == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.PurchaseInstalData), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.RecurringExpiryOption.IsSet && threeDS2RequestData.RecurringExpiry == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.RecurringExpiry), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.RecurringFrequencyOption.IsSet && threeDS2RequestData.RecurringFrequency == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.RecurringFrequency), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.SdkAppIDOption.IsSet && threeDS2RequestData.SdkAppID == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.SdkAppID), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.SdkEncDataOption.IsSet && threeDS2RequestData.SdkEncData == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.SdkEncData), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.SdkEphemPubKeyOption.IsSet && threeDS2RequestData.SdkEphemPubKey == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.SdkEphemPubKey), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.SdkReferenceNumberOption.IsSet && threeDS2RequestData.SdkReferenceNumber == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.SdkReferenceNumber), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.SdkTransIDOption.IsSet && threeDS2RequestData.SdkTransID == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.SdkTransID), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.SdkVersionOption.IsSet && threeDS2RequestData.SdkVersion == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.SdkVersion), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.ThreeDSCompIndOption.IsSet && threeDS2RequestData.ThreeDSCompInd == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSCompInd), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.ThreeDSRequestorAuthenticationIndOption.IsSet && threeDS2RequestData.ThreeDSRequestorAuthenticationInd == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSRequestorAuthenticationInd), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.ThreeDSRequestorAuthenticationInfoOption.IsSet && threeDS2RequestData.ThreeDSRequestorAuthenticationInfo == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSRequestorAuthenticationInfo), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.ThreeDSRequestorIDOption.IsSet && threeDS2RequestData.ThreeDSRequestorID == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSRequestorID), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.ThreeDSRequestorNameOption.IsSet && threeDS2RequestData.ThreeDSRequestorName == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSRequestorName), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.ThreeDSRequestorPriorAuthenticationInfoOption.IsSet && threeDS2RequestData.ThreeDSRequestorPriorAuthenticationInfo == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSRequestorPriorAuthenticationInfo), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.ThreeDSRequestorURLOption.IsSet && threeDS2RequestData.ThreeDSRequestorURL == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSRequestorURL), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.WhiteListStatusOption.IsSet && threeDS2RequestData.WhiteListStatus == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.WhiteListStatus), "Property is required for class ThreeDS2RequestData."); + + if (threeDS2RequestData.WorkPhoneOption.IsSet && threeDS2RequestData.WorkPhone == null) + throw new ArgumentNullException(nameof(threeDS2RequestData.WorkPhone), "Property is required for class ThreeDS2RequestData."); + + writer.WriteString("deviceChannel", threeDS2RequestData.DeviceChannel); + + if (threeDS2RequestData.AcctInfoOption.IsSet) + { + writer.WritePropertyName("acctInfo"); + JsonSerializer.Serialize(writer, threeDS2RequestData.AcctInfo, jsonSerializerOptions); + } + var acctTypeRawValue = ThreeDS2RequestData.AcctTypeEnumToJsonValue(threeDS2RequestData.AcctTypeOption.Value.Value); + writer.WriteString("acctType", acctTypeRawValue); + if (threeDS2RequestData.AcquirerBINOption.IsSet) + writer.WriteString("acquirerBIN", threeDS2RequestData.AcquirerBIN); + + if (threeDS2RequestData.AcquirerMerchantIDOption.IsSet) + writer.WriteString("acquirerMerchantID", threeDS2RequestData.AcquirerMerchantID); + + var addrMatchRawValue = ThreeDS2RequestData.AddrMatchEnumToJsonValue(threeDS2RequestData.AddrMatchOption.Value.Value); + writer.WriteString("addrMatch", addrMatchRawValue); + if (threeDS2RequestData.AuthenticationOnlyOption.IsSet) + writer.WriteBoolean("authenticationOnly", threeDS2RequestData.AuthenticationOnlyOption.Value.Value); + + var challengeIndicatorRawValue = ThreeDS2RequestData.ChallengeIndicatorEnumToJsonValue(threeDS2RequestData.ChallengeIndicatorOption.Value.Value); + writer.WriteString("challengeIndicator", challengeIndicatorRawValue); + if (threeDS2RequestData.DeviceRenderOptionsOption.IsSet) + { + writer.WritePropertyName("deviceRenderOptions"); + JsonSerializer.Serialize(writer, threeDS2RequestData.DeviceRenderOptions, jsonSerializerOptions); + } + if (threeDS2RequestData.HomePhoneOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PurchaseInstalData, length must be less than 3.", new [] { "PurchaseInstalData" }); + writer.WritePropertyName("homePhone"); + JsonSerializer.Serialize(writer, threeDS2RequestData.HomePhone, jsonSerializerOptions); } + if (threeDS2RequestData.MccOption.IsSet) + writer.WriteString("mcc", threeDS2RequestData.Mcc); - // PurchaseInstalData (string) minLength - if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length < 1) + if (threeDS2RequestData.MerchantNameOption.IsSet) + writer.WriteString("merchantName", threeDS2RequestData.MerchantName); + + if (threeDS2RequestData.MessageVersionOption.IsSet) + writer.WriteString("messageVersion", threeDS2RequestData.MessageVersion); + + if (threeDS2RequestData.MobilePhoneOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PurchaseInstalData, length must be greater than 1.", new [] { "PurchaseInstalData" }); + writer.WritePropertyName("mobilePhone"); + JsonSerializer.Serialize(writer, threeDS2RequestData.MobilePhone, jsonSerializerOptions); } + if (threeDS2RequestData.NotificationURLOption.IsSet) + writer.WriteString("notificationURL", threeDS2RequestData.NotificationURL); - // RecurringFrequency (string) maxLength - if (this.RecurringFrequency != null && this.RecurringFrequency.Length > 4) + if (threeDS2RequestData.PayTokenIndOption.IsSet) + writer.WriteBoolean("payTokenInd", threeDS2RequestData.PayTokenIndOption.Value.Value); + + if (threeDS2RequestData.PaymentAuthenticationUseCaseOption.IsSet) + writer.WriteString("paymentAuthenticationUseCase", threeDS2RequestData.PaymentAuthenticationUseCase); + + if (threeDS2RequestData.PurchaseInstalDataOption.IsSet) + writer.WriteString("purchaseInstalData", threeDS2RequestData.PurchaseInstalData); + + if (threeDS2RequestData.RecurringExpiryOption.IsSet) + writer.WriteString("recurringExpiry", threeDS2RequestData.RecurringExpiry); + + if (threeDS2RequestData.RecurringFrequencyOption.IsSet) + writer.WriteString("recurringFrequency", threeDS2RequestData.RecurringFrequency); + + if (threeDS2RequestData.SdkAppIDOption.IsSet) + writer.WriteString("sdkAppID", threeDS2RequestData.SdkAppID); + + if (threeDS2RequestData.SdkEncDataOption.IsSet) + writer.WriteString("sdkEncData", threeDS2RequestData.SdkEncData); + + if (threeDS2RequestData.SdkEphemPubKeyOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for RecurringFrequency, length must be less than 4.", new [] { "RecurringFrequency" }); + writer.WritePropertyName("sdkEphemPubKey"); + JsonSerializer.Serialize(writer, threeDS2RequestData.SdkEphemPubKey, jsonSerializerOptions); } + if (threeDS2RequestData.SdkMaxTimeoutOption.IsSet) + writer.WriteNumber("sdkMaxTimeout", threeDS2RequestData.SdkMaxTimeoutOption.Value.Value); - yield break; + if (threeDS2RequestData.SdkReferenceNumberOption.IsSet) + writer.WriteString("sdkReferenceNumber", threeDS2RequestData.SdkReferenceNumber); + + if (threeDS2RequestData.SdkTransIDOption.IsSet) + writer.WriteString("sdkTransID", threeDS2RequestData.SdkTransID); + + if (threeDS2RequestData.SdkVersionOption.IsSet) + writer.WriteString("sdkVersion", threeDS2RequestData.SdkVersion); + + if (threeDS2RequestData.ThreeDSCompIndOption.IsSet) + writer.WriteString("threeDSCompInd", threeDS2RequestData.ThreeDSCompInd); + + if (threeDS2RequestData.ThreeDSRequestorAuthenticationIndOption.IsSet) + writer.WriteString("threeDSRequestorAuthenticationInd", threeDS2RequestData.ThreeDSRequestorAuthenticationInd); + + if (threeDS2RequestData.ThreeDSRequestorAuthenticationInfoOption.IsSet) + { + writer.WritePropertyName("threeDSRequestorAuthenticationInfo"); + JsonSerializer.Serialize(writer, threeDS2RequestData.ThreeDSRequestorAuthenticationInfo, jsonSerializerOptions); + } + var threeDSRequestorChallengeIndRawValue = ThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2RequestData.ThreeDSRequestorChallengeIndOption.Value.Value); + writer.WriteString("threeDSRequestorChallengeInd", threeDSRequestorChallengeIndRawValue); + if (threeDS2RequestData.ThreeDSRequestorIDOption.IsSet) + writer.WriteString("threeDSRequestorID", threeDS2RequestData.ThreeDSRequestorID); + + if (threeDS2RequestData.ThreeDSRequestorNameOption.IsSet) + writer.WriteString("threeDSRequestorName", threeDS2RequestData.ThreeDSRequestorName); + + if (threeDS2RequestData.ThreeDSRequestorPriorAuthenticationInfoOption.IsSet) + { + writer.WritePropertyName("threeDSRequestorPriorAuthenticationInfo"); + JsonSerializer.Serialize(writer, threeDS2RequestData.ThreeDSRequestorPriorAuthenticationInfo, jsonSerializerOptions); + } + if (threeDS2RequestData.ThreeDSRequestorURLOption.IsSet) + writer.WriteString("threeDSRequestorURL", threeDS2RequestData.ThreeDSRequestorURL); + + var transTypeRawValue = ThreeDS2RequestData.TransTypeEnumToJsonValue(threeDS2RequestData.TransTypeOption.Value.Value); + writer.WriteString("transType", transTypeRawValue); + var transactionTypeRawValue = ThreeDS2RequestData.TransactionTypeEnumToJsonValue(threeDS2RequestData.TransactionTypeOption.Value.Value); + writer.WriteString("transactionType", transactionTypeRawValue); + if (threeDS2RequestData.WhiteListStatusOption.IsSet) + writer.WriteString("whiteListStatus", threeDS2RequestData.WhiteListStatus); + + if (threeDS2RequestData.WorkPhoneOption.IsSet) + { + writer.WritePropertyName("workPhone"); + JsonSerializer.Serialize(writer, threeDS2RequestData.WorkPhone, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/ThreeDS2RequestFields.cs b/Adyen/Model/Checkout/ThreeDS2RequestFields.cs index c2fce35b6..df36f3b84 100644 --- a/Adyen/Model/Checkout/ThreeDS2RequestFields.cs +++ b/Adyen/Model/Checkout/ThreeDS2RequestFields.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,551 +14,1184 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ThreeDS2RequestFields /// - [DataContract(Name = "ThreeDS2RequestFields")] - public partial class ThreeDS2RequestFields : IEquatable, IValidatableObject + public partial class ThreeDS2RequestFields : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// acctInfo + /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. + /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) + /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + /// deviceRenderOptions + /// homePhone + /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. + /// The `messageVersion` value indicating the 3D Secure 2 protocol version. + /// mobilePhone + /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. + /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. + /// Indicates the type of payment for which an authentication is requested (message extension) + /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. + /// Date after which no further authorisations shall be performed. Format: YYYYMMDD + /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters. + /// The `sdkAppID` value as received from the 3D Secure 2 SDK. + /// sdkEphemPubKey + /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. (default to 60) + /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. + /// The `sdkTransID` value as received from the 3D Secure 2 SDK. + /// Completion indicator for the device fingerprinting. + /// Indicates the type of Authentication request. + /// threeDSRequestorAuthenticationInfo + /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. + /// threeDSRequestorPriorAuthenticationInfo + /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. + /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load + /// Identify the type of the transaction being authenticated. + /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. + /// workPhone + [JsonConstructor] + public ThreeDS2RequestFields(Option acctInfo = default, Option acctType = default, Option acquirerBIN = default, Option acquirerMerchantID = default, Option addrMatch = default, Option authenticationOnly = default, Option challengeIndicator = default, Option deviceRenderOptions = default, Option homePhone = default, Option mcc = default, Option merchantName = default, Option messageVersion = default, Option mobilePhone = default, Option notificationURL = default, Option payTokenInd = default, Option paymentAuthenticationUseCase = default, Option purchaseInstalData = default, Option recurringExpiry = default, Option recurringFrequency = default, Option sdkAppID = default, Option sdkEphemPubKey = default, Option sdkMaxTimeout = default, Option sdkReferenceNumber = default, Option sdkTransID = default, Option threeDSCompInd = default, Option threeDSRequestorAuthenticationInd = default, Option threeDSRequestorAuthenticationInfo = default, Option threeDSRequestorChallengeInd = default, Option threeDSRequestorID = default, Option threeDSRequestorName = default, Option threeDSRequestorPriorAuthenticationInfo = default, Option threeDSRequestorURL = default, Option transType = default, Option transactionType = default, Option whiteListStatus = default, Option workPhone = default) + { + AcctInfoOption = acctInfo; + AcctTypeOption = acctType; + AcquirerBINOption = acquirerBIN; + AcquirerMerchantIDOption = acquirerMerchantID; + AddrMatchOption = addrMatch; + AuthenticationOnlyOption = authenticationOnly; + ChallengeIndicatorOption = challengeIndicator; + DeviceRenderOptionsOption = deviceRenderOptions; + HomePhoneOption = homePhone; + MccOption = mcc; + MerchantNameOption = merchantName; + MessageVersionOption = messageVersion; + MobilePhoneOption = mobilePhone; + NotificationURLOption = notificationURL; + PayTokenIndOption = payTokenInd; + PaymentAuthenticationUseCaseOption = paymentAuthenticationUseCase; + PurchaseInstalDataOption = purchaseInstalData; + RecurringExpiryOption = recurringExpiry; + RecurringFrequencyOption = recurringFrequency; + SdkAppIDOption = sdkAppID; + SdkEphemPubKeyOption = sdkEphemPubKey; + SdkMaxTimeoutOption = sdkMaxTimeout; + SdkReferenceNumberOption = sdkReferenceNumber; + SdkTransIDOption = sdkTransID; + ThreeDSCompIndOption = threeDSCompInd; + ThreeDSRequestorAuthenticationIndOption = threeDSRequestorAuthenticationInd; + ThreeDSRequestorAuthenticationInfoOption = threeDSRequestorAuthenticationInfo; + ThreeDSRequestorChallengeIndOption = threeDSRequestorChallengeInd; + ThreeDSRequestorIDOption = threeDSRequestorID; + ThreeDSRequestorNameOption = threeDSRequestorName; + ThreeDSRequestorPriorAuthenticationInfoOption = threeDSRequestorPriorAuthenticationInfo; + ThreeDSRequestorURLOption = threeDSRequestorURL; + TransTypeOption = transType; + TransactionTypeOption = transactionType; + WhiteListStatusOption = whiteListStatus; + WorkPhoneOption = workPhone; + OnCreated(); + } + + partial void OnCreated(); + /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit - [JsonConverter(typeof(StringEnumConverter))] public enum AcctTypeEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static AcctTypeEnum AcctTypeEnumFromString(string value) + { + if (value.Equals("01")) + return AcctTypeEnum._01; + + if (value.Equals("02")) + return AcctTypeEnum._02; + + if (value.Equals("03")) + return AcctTypeEnum._03; + + throw new NotImplementedException($"Could not convert value to type AcctTypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static AcctTypeEnum? AcctTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return AcctTypeEnum._01; + + if (value.Equals("02")) + return AcctTypeEnum._02; + + if (value.Equals("03")) + return AcctTypeEnum._03; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string AcctTypeEnumToJsonValue(AcctTypeEnum? value) + { + if (value == AcctTypeEnum._01) + return "01"; + + if (value == AcctTypeEnum._02) + return "02"; + if (value == AcctTypeEnum._03) + return "03"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of AcctType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcctTypeOption { get; private set; } /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit - [DataMember(Name = "acctType", EmitDefaultValue = false)] - public AcctTypeEnum? AcctType { get; set; } + [JsonPropertyName("acctType")] + public AcctTypeEnum? AcctType { get { return this.AcctTypeOption; } set { this.AcctTypeOption = new Option(value); } } + /// /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. /// /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. - [JsonConverter(typeof(StringEnumConverter))] public enum AddrMatchEnum { /// /// Enum Y for value: Y /// - [EnumMember(Value = "Y")] Y = 1, /// /// Enum N for value: N /// - [EnumMember(Value = "N")] N = 2 + } + /// + /// Returns a + /// + /// + /// + /// + public static AddrMatchEnum AddrMatchEnumFromString(string value) + { + if (value.Equals("Y")) + return AddrMatchEnum.Y; + + if (value.Equals("N")) + return AddrMatchEnum.N; + + throw new NotImplementedException($"Could not convert value to type AddrMatchEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static AddrMatchEnum? AddrMatchEnumFromStringOrDefault(string value) + { + if (value.Equals("Y")) + return AddrMatchEnum.Y; + + if (value.Equals("N")) + return AddrMatchEnum.N; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string AddrMatchEnumToJsonValue(AddrMatchEnum? value) + { + if (value == AddrMatchEnum.Y) + return "Y"; + + if (value == AddrMatchEnum.N) + return "N"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of AddrMatch + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AddrMatchOption { get; private set; } /// /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. /// /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. - [DataMember(Name = "addrMatch", EmitDefaultValue = false)] - public AddrMatchEnum? AddrMatch { get; set; } + [JsonPropertyName("addrMatch")] + public AddrMatchEnum? AddrMatch { get { return this.AddrMatchOption; } set { this.AddrMatchOption = new Option(value); } } + /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` - [JsonConverter(typeof(StringEnumConverter))] public enum ChallengeIndicatorEnum { /// /// Enum NoPreference for value: noPreference /// - [EnumMember(Value = "noPreference")] NoPreference = 1, /// /// Enum RequestNoChallenge for value: requestNoChallenge /// - [EnumMember(Value = "requestNoChallenge")] RequestNoChallenge = 2, /// /// Enum RequestChallenge for value: requestChallenge /// - [EnumMember(Value = "requestChallenge")] RequestChallenge = 3, /// /// Enum RequestChallengeAsMandate for value: requestChallengeAsMandate /// - [EnumMember(Value = "requestChallengeAsMandate")] RequestChallengeAsMandate = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ChallengeIndicatorEnum ChallengeIndicatorEnumFromString(string value) + { + if (value.Equals("noPreference")) + return ChallengeIndicatorEnum.NoPreference; + + if (value.Equals("requestNoChallenge")) + return ChallengeIndicatorEnum.RequestNoChallenge; + if (value.Equals("requestChallenge")) + return ChallengeIndicatorEnum.RequestChallenge; + + if (value.Equals("requestChallengeAsMandate")) + return ChallengeIndicatorEnum.RequestChallengeAsMandate; + + throw new NotImplementedException($"Could not convert value to type ChallengeIndicatorEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static ChallengeIndicatorEnum? ChallengeIndicatorEnumFromStringOrDefault(string value) + { + if (value.Equals("noPreference")) + return ChallengeIndicatorEnum.NoPreference; + + if (value.Equals("requestNoChallenge")) + return ChallengeIndicatorEnum.RequestNoChallenge; + + if (value.Equals("requestChallenge")) + return ChallengeIndicatorEnum.RequestChallenge; + + if (value.Equals("requestChallengeAsMandate")) + return ChallengeIndicatorEnum.RequestChallengeAsMandate; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChallengeIndicatorEnumToJsonValue(ChallengeIndicatorEnum? value) + { + if (value == ChallengeIndicatorEnum.NoPreference) + return "noPreference"; + + if (value == ChallengeIndicatorEnum.RequestNoChallenge) + return "requestNoChallenge"; + + if (value == ChallengeIndicatorEnum.RequestChallenge) + return "requestChallenge"; + + if (value == ChallengeIndicatorEnum.RequestChallengeAsMandate) + return "requestChallengeAsMandate"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ChallengeIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChallengeIndicatorOption { get; private set; } /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` - [DataMember(Name = "challengeIndicator", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v68. Use `threeDSRequestorChallengeInd` instead.")] - public ChallengeIndicatorEnum? ChallengeIndicator { get; set; } + [JsonPropertyName("challengeIndicator")] + [Obsolete] + public ChallengeIndicatorEnum? ChallengeIndicator { get { return this.ChallengeIndicatorOption; } set { this.ChallengeIndicatorOption = new Option(value); } } + /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSRequestorChallengeIndEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// - [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// - [EnumMember(Value = "06")] _06 = 6 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ThreeDSRequestorChallengeIndEnum ThreeDSRequestorChallengeIndEnumFromString(string value) + { + if (value.Equals("01")) + return ThreeDSRequestorChallengeIndEnum._01; + + if (value.Equals("02")) + return ThreeDSRequestorChallengeIndEnum._02; + + if (value.Equals("03")) + return ThreeDSRequestorChallengeIndEnum._03; + + if (value.Equals("04")) + return ThreeDSRequestorChallengeIndEnum._04; + + if (value.Equals("05")) + return ThreeDSRequestorChallengeIndEnum._05; + + if (value.Equals("06")) + return ThreeDSRequestorChallengeIndEnum._06; + + throw new NotImplementedException($"Could not convert value to type ThreeDSRequestorChallengeIndEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeIndEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ThreeDSRequestorChallengeIndEnum._01; + + if (value.Equals("02")) + return ThreeDSRequestorChallengeIndEnum._02; + + if (value.Equals("03")) + return ThreeDSRequestorChallengeIndEnum._03; + + if (value.Equals("04")) + return ThreeDSRequestorChallengeIndEnum._04; + + if (value.Equals("05")) + return ThreeDSRequestorChallengeIndEnum._05; + + if (value.Equals("06")) + return ThreeDSRequestorChallengeIndEnum._06; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ThreeDSRequestorChallengeIndEnumToJsonValue(ThreeDSRequestorChallengeIndEnum? value) + { + if (value == ThreeDSRequestorChallengeIndEnum._01) + return "01"; + + if (value == ThreeDSRequestorChallengeIndEnum._02) + return "02"; + + if (value == ThreeDSRequestorChallengeIndEnum._03) + return "03"; + + if (value == ThreeDSRequestorChallengeIndEnum._04) + return "04"; + + if (value == ThreeDSRequestorChallengeIndEnum._05) + return "05"; + if (value == ThreeDSRequestorChallengeIndEnum._06) + return "06"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of ThreeDSRequestorChallengeInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorChallengeIndOption { get; private set; } /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - [DataMember(Name = "threeDSRequestorChallengeInd", EmitDefaultValue = false)] - public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get; set; } + [JsonPropertyName("threeDSRequestorChallengeInd")] + public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get { return this.ThreeDSRequestorChallengeIndOption; } set { this.ThreeDSRequestorChallengeIndOption = new Option(value); } } + /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load - [JsonConverter(typeof(StringEnumConverter))] public enum TransTypeEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 2, /// /// Enum _10 for value: 10 /// - [EnumMember(Value = "10")] _10 = 3, /// /// Enum _11 for value: 11 /// - [EnumMember(Value = "11")] _11 = 4, /// /// Enum _28 for value: 28 /// - [EnumMember(Value = "28")] _28 = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TransTypeEnum TransTypeEnumFromString(string value) + { + if (value.Equals("01")) + return TransTypeEnum._01; + + if (value.Equals("03")) + return TransTypeEnum._03; + + if (value.Equals("10")) + return TransTypeEnum._10; + + if (value.Equals("11")) + return TransTypeEnum._11; + + if (value.Equals("28")) + return TransTypeEnum._28; + + throw new NotImplementedException($"Could not convert value to type TransTypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TransTypeEnum? TransTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return TransTypeEnum._01; + + if (value.Equals("03")) + return TransTypeEnum._03; + + if (value.Equals("10")) + return TransTypeEnum._10; + + if (value.Equals("11")) + return TransTypeEnum._11; + + if (value.Equals("28")) + return TransTypeEnum._28; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TransTypeEnumToJsonValue(TransTypeEnum? value) + { + if (value == TransTypeEnum._01) + return "01"; + if (value == TransTypeEnum._03) + return "03"; + + if (value == TransTypeEnum._10) + return "10"; + + if (value == TransTypeEnum._11) + return "11"; + + if (value == TransTypeEnum._28) + return "28"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of TransType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TransTypeOption { get; private set; } /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load - [DataMember(Name = "transType", EmitDefaultValue = false)] - public TransTypeEnum? TransType { get; set; } + [JsonPropertyName("transType")] + public TransTypeEnum? TransType { get { return this.TransTypeOption; } set { this.TransTypeOption = new Option(value); } } + /// /// Identify the type of the transaction being authenticated. /// /// Identify the type of the transaction being authenticated. - [JsonConverter(typeof(StringEnumConverter))] public enum TransactionTypeEnum { /// /// Enum GoodsOrServicePurchase for value: goodsOrServicePurchase /// - [EnumMember(Value = "goodsOrServicePurchase")] GoodsOrServicePurchase = 1, /// /// Enum CheckAcceptance for value: checkAcceptance /// - [EnumMember(Value = "checkAcceptance")] CheckAcceptance = 2, /// /// Enum AccountFunding for value: accountFunding /// - [EnumMember(Value = "accountFunding")] AccountFunding = 3, /// /// Enum QuasiCashTransaction for value: quasiCashTransaction /// - [EnumMember(Value = "quasiCashTransaction")] QuasiCashTransaction = 4, /// /// Enum PrepaidActivationAndLoad for value: prepaidActivationAndLoad /// - [EnumMember(Value = "prepaidActivationAndLoad")] PrepaidActivationAndLoad = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TransactionTypeEnum TransactionTypeEnumFromString(string value) + { + if (value.Equals("goodsOrServicePurchase")) + return TransactionTypeEnum.GoodsOrServicePurchase; + + if (value.Equals("checkAcceptance")) + return TransactionTypeEnum.CheckAcceptance; + + if (value.Equals("accountFunding")) + return TransactionTypeEnum.AccountFunding; + + if (value.Equals("quasiCashTransaction")) + return TransactionTypeEnum.QuasiCashTransaction; + + if (value.Equals("prepaidActivationAndLoad")) + return TransactionTypeEnum.PrepaidActivationAndLoad; + + throw new NotImplementedException($"Could not convert value to type TransactionTypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TransactionTypeEnum? TransactionTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("goodsOrServicePurchase")) + return TransactionTypeEnum.GoodsOrServicePurchase; + + if (value.Equals("checkAcceptance")) + return TransactionTypeEnum.CheckAcceptance; + + if (value.Equals("accountFunding")) + return TransactionTypeEnum.AccountFunding; + + if (value.Equals("quasiCashTransaction")) + return TransactionTypeEnum.QuasiCashTransaction; + + if (value.Equals("prepaidActivationAndLoad")) + return TransactionTypeEnum.PrepaidActivationAndLoad; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TransactionTypeEnumToJsonValue(TransactionTypeEnum? value) + { + if (value == TransactionTypeEnum.GoodsOrServicePurchase) + return "goodsOrServicePurchase"; + + if (value == TransactionTypeEnum.CheckAcceptance) + return "checkAcceptance"; + if (value == TransactionTypeEnum.AccountFunding) + return "accountFunding"; + + if (value == TransactionTypeEnum.QuasiCashTransaction) + return "quasiCashTransaction"; + + if (value == TransactionTypeEnum.PrepaidActivationAndLoad) + return "prepaidActivationAndLoad"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of TransactionType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TransactionTypeOption { get; private set; } /// /// Identify the type of the transaction being authenticated. /// /// Identify the type of the transaction being authenticated. - [DataMember(Name = "transactionType", EmitDefaultValue = false)] - public TransactionTypeEnum? TransactionType { get; set; } + [JsonPropertyName("transactionType")] + public TransactionTypeEnum? TransactionType { get { return this.TransactionTypeOption; } set { this.TransactionTypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of AcctInfo /// - /// acctInfo. - /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform.. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform.. - /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address.. - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false). - /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` . - /// deviceRenderOptions. - /// homePhone. - /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme.. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account.. - /// The `messageVersion` value indicating the 3D Secure 2 protocol version.. - /// mobilePhone. - /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**.. - /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS.. - /// Indicates the type of payment for which an authentication is requested (message extension). - /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters.. - /// Date after which no further authorisations shall be performed. Format: YYYYMMDD. - /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters.. - /// The `sdkAppID` value as received from the 3D Secure 2 SDK.. - /// sdkEphemPubKey. - /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. (default to 60). - /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK.. - /// The `sdkTransID` value as received from the 3D Secure 2 SDK.. - /// Completion indicator for the device fingerprinting.. - /// Indicates the type of Authentication request.. - /// threeDSRequestorAuthenticationInfo. - /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2.. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2.. - /// threeDSRequestorPriorAuthenticationInfo. - /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process.. - /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load. - /// Identify the type of the transaction being authenticated.. - /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0.. - /// workPhone. - public ThreeDS2RequestFields(AcctInfo acctInfo = default(AcctInfo), AcctTypeEnum? acctType = default(AcctTypeEnum?), string acquirerBIN = default(string), string acquirerMerchantID = default(string), AddrMatchEnum? addrMatch = default(AddrMatchEnum?), bool? authenticationOnly = false, ChallengeIndicatorEnum? challengeIndicator = default(ChallengeIndicatorEnum?), DeviceRenderOptions deviceRenderOptions = default(DeviceRenderOptions), Phone homePhone = default(Phone), string mcc = default(string), string merchantName = default(string), string messageVersion = default(string), Phone mobilePhone = default(Phone), string notificationURL = default(string), bool? payTokenInd = default(bool?), string paymentAuthenticationUseCase = default(string), string purchaseInstalData = default(string), string recurringExpiry = default(string), string recurringFrequency = default(string), string sdkAppID = default(string), SDKEphemPubKey sdkEphemPubKey = default(SDKEphemPubKey), int? sdkMaxTimeout = 60, string sdkReferenceNumber = default(string), string sdkTransID = default(string), string threeDSCompInd = default(string), string threeDSRequestorAuthenticationInd = default(string), ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo = default(ThreeDSRequestorAuthenticationInfo), ThreeDSRequestorChallengeIndEnum? threeDSRequestorChallengeInd = default(ThreeDSRequestorChallengeIndEnum?), string threeDSRequestorID = default(string), string threeDSRequestorName = default(string), ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo = default(ThreeDSRequestorPriorAuthenticationInfo), string threeDSRequestorURL = default(string), TransTypeEnum? transType = default(TransTypeEnum?), TransactionTypeEnum? transactionType = default(TransactionTypeEnum?), string whiteListStatus = default(string), Phone workPhone = default(Phone)) - { - this.AcctInfo = acctInfo; - this.AcctType = acctType; - this.AcquirerBIN = acquirerBIN; - this.AcquirerMerchantID = acquirerMerchantID; - this.AddrMatch = addrMatch; - this.AuthenticationOnly = authenticationOnly; - this.ChallengeIndicator = challengeIndicator; - this.DeviceRenderOptions = deviceRenderOptions; - this.HomePhone = homePhone; - this.Mcc = mcc; - this.MerchantName = merchantName; - this.MessageVersion = messageVersion; - this.MobilePhone = mobilePhone; - this.NotificationURL = notificationURL; - this.PayTokenInd = payTokenInd; - this.PaymentAuthenticationUseCase = paymentAuthenticationUseCase; - this.PurchaseInstalData = purchaseInstalData; - this.RecurringExpiry = recurringExpiry; - this.RecurringFrequency = recurringFrequency; - this.SdkAppID = sdkAppID; - this.SdkEphemPubKey = sdkEphemPubKey; - this.SdkMaxTimeout = sdkMaxTimeout; - this.SdkReferenceNumber = sdkReferenceNumber; - this.SdkTransID = sdkTransID; - this.ThreeDSCompInd = threeDSCompInd; - this.ThreeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; - this.ThreeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; - this.ThreeDSRequestorChallengeInd = threeDSRequestorChallengeInd; - this.ThreeDSRequestorID = threeDSRequestorID; - this.ThreeDSRequestorName = threeDSRequestorName; - this.ThreeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; - this.ThreeDSRequestorURL = threeDSRequestorURL; - this.TransType = transType; - this.TransactionType = transactionType; - this.WhiteListStatus = whiteListStatus; - this.WorkPhone = workPhone; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcctInfoOption { get; private set; } /// /// Gets or Sets AcctInfo /// - [DataMember(Name = "acctInfo", EmitDefaultValue = false)] - public AcctInfo AcctInfo { get; set; } + [JsonPropertyName("acctInfo")] + public AcctInfo AcctInfo { get { return this.AcctInfoOption; } set { this.AcctInfoOption = new Option(value); } } + + /// + /// Used to track the state of AcquirerBIN + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcquirerBINOption { get; private set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. - [DataMember(Name = "acquirerBIN", EmitDefaultValue = false)] - public string AcquirerBIN { get; set; } + [JsonPropertyName("acquirerBIN")] + public string AcquirerBIN { get { return this.AcquirerBINOption; } set { this.AcquirerBINOption = new Option(value); } } + + /// + /// Used to track the state of AcquirerMerchantID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcquirerMerchantIDOption { get; private set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. - [DataMember(Name = "acquirerMerchantID", EmitDefaultValue = false)] - public string AcquirerMerchantID { get; set; } + [JsonPropertyName("acquirerMerchantID")] + public string AcquirerMerchantID { get { return this.AcquirerMerchantIDOption; } set { this.AcquirerMerchantIDOption = new Option(value); } } + + /// + /// Used to track the state of AuthenticationOnly + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthenticationOnlyOption { get; private set; } /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [DataMember(Name = "authenticationOnly", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v50. Use `threeDSAuthenticationOnly` instead.")] - public bool? AuthenticationOnly { get; set; } + [JsonPropertyName("authenticationOnly")] + [Obsolete] + public bool? AuthenticationOnly { get { return this.AuthenticationOnlyOption; } set { this.AuthenticationOnlyOption = new Option(value); } } + + /// + /// Used to track the state of DeviceRenderOptions + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DeviceRenderOptionsOption { get; private set; } /// /// Gets or Sets DeviceRenderOptions /// - [DataMember(Name = "deviceRenderOptions", EmitDefaultValue = false)] - public DeviceRenderOptions DeviceRenderOptions { get; set; } + [JsonPropertyName("deviceRenderOptions")] + public DeviceRenderOptions DeviceRenderOptions { get { return this.DeviceRenderOptionsOption; } set { this.DeviceRenderOptionsOption = new Option(value); } } + + /// + /// Used to track the state of HomePhone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option HomePhoneOption { get; private set; } /// /// Gets or Sets HomePhone /// - [DataMember(Name = "homePhone", EmitDefaultValue = false)] - public Phone HomePhone { get; set; } + [JsonPropertyName("homePhone")] + public Phone HomePhone { get { return this.HomePhoneOption; } set { this.HomePhoneOption = new Option(value); } } + + /// + /// Used to track the state of Mcc + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MccOption { get; private set; } /// /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. /// /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. - [DataMember(Name = "mcc", EmitDefaultValue = false)] - public string Mcc { get; set; } + [JsonPropertyName("mcc")] + public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } + + /// + /// Used to track the state of MerchantName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MerchantNameOption { get; private set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. - [DataMember(Name = "merchantName", EmitDefaultValue = false)] - public string MerchantName { get; set; } + [JsonPropertyName("merchantName")] + public string MerchantName { get { return this.MerchantNameOption; } set { this.MerchantNameOption = new Option(value); } } + + /// + /// Used to track the state of MessageVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MessageVersionOption { get; private set; } /// /// The `messageVersion` value indicating the 3D Secure 2 protocol version. /// /// The `messageVersion` value indicating the 3D Secure 2 protocol version. - [DataMember(Name = "messageVersion", EmitDefaultValue = false)] - public string MessageVersion { get; set; } + [JsonPropertyName("messageVersion")] + public string MessageVersion { get { return this.MessageVersionOption; } set { this.MessageVersionOption = new Option(value); } } + + /// + /// Used to track the state of MobilePhone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MobilePhoneOption { get; private set; } /// /// Gets or Sets MobilePhone /// - [DataMember(Name = "mobilePhone", EmitDefaultValue = false)] - public Phone MobilePhone { get; set; } + [JsonPropertyName("mobilePhone")] + public Phone MobilePhone { get { return this.MobilePhoneOption; } set { this.MobilePhoneOption = new Option(value); } } + + /// + /// Used to track the state of NotificationURL + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NotificationURLOption { get; private set; } /// /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. /// /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. - [DataMember(Name = "notificationURL", EmitDefaultValue = false)] - public string NotificationURL { get; set; } + [JsonPropertyName("notificationURL")] + public string NotificationURL { get { return this.NotificationURLOption; } set { this.NotificationURLOption = new Option(value); } } + + /// + /// Used to track the state of PayTokenInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PayTokenIndOption { get; private set; } /// /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. /// /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. - [DataMember(Name = "payTokenInd", EmitDefaultValue = false)] - public bool? PayTokenInd { get; set; } + [JsonPropertyName("payTokenInd")] + public bool? PayTokenInd { get { return this.PayTokenIndOption; } set { this.PayTokenIndOption = new Option(value); } } + + /// + /// Used to track the state of PaymentAuthenticationUseCase + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PaymentAuthenticationUseCaseOption { get; private set; } /// /// Indicates the type of payment for which an authentication is requested (message extension) /// /// Indicates the type of payment for which an authentication is requested (message extension) - [DataMember(Name = "paymentAuthenticationUseCase", EmitDefaultValue = false)] - public string PaymentAuthenticationUseCase { get; set; } + [JsonPropertyName("paymentAuthenticationUseCase")] + public string PaymentAuthenticationUseCase { get { return this.PaymentAuthenticationUseCaseOption; } set { this.PaymentAuthenticationUseCaseOption = new Option(value); } } + + /// + /// Used to track the state of PurchaseInstalData + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option PurchaseInstalDataOption { get; private set; } /// /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. /// /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. - [DataMember(Name = "purchaseInstalData", EmitDefaultValue = false)] - public string PurchaseInstalData { get; set; } + [JsonPropertyName("purchaseInstalData")] + public string PurchaseInstalData { get { return this.PurchaseInstalDataOption; } set { this.PurchaseInstalDataOption = new Option(value); } } + + /// + /// Used to track the state of RecurringExpiry + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringExpiryOption { get; private set; } /// /// Date after which no further authorisations shall be performed. Format: YYYYMMDD /// /// Date after which no further authorisations shall be performed. Format: YYYYMMDD - [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] - public string RecurringExpiry { get; set; } + [JsonPropertyName("recurringExpiry")] + public string RecurringExpiry { get { return this.RecurringExpiryOption; } set { this.RecurringExpiryOption = new Option(value); } } + + /// + /// Used to track the state of RecurringFrequency + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringFrequencyOption { get; private set; } /// /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters. /// /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters. - [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] - public string RecurringFrequency { get; set; } + [JsonPropertyName("recurringFrequency")] + public string RecurringFrequency { get { return this.RecurringFrequencyOption; } set { this.RecurringFrequencyOption = new Option(value); } } + + /// + /// Used to track the state of SdkAppID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkAppIDOption { get; private set; } /// /// The `sdkAppID` value as received from the 3D Secure 2 SDK. /// /// The `sdkAppID` value as received from the 3D Secure 2 SDK. - [DataMember(Name = "sdkAppID", EmitDefaultValue = false)] - public string SdkAppID { get; set; } + [JsonPropertyName("sdkAppID")] + public string SdkAppID { get { return this.SdkAppIDOption; } set { this.SdkAppIDOption = new Option(value); } } + + /// + /// Used to track the state of SdkEphemPubKey + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkEphemPubKeyOption { get; private set; } /// /// Gets or Sets SdkEphemPubKey /// - [DataMember(Name = "sdkEphemPubKey", EmitDefaultValue = false)] - public SDKEphemPubKey SdkEphemPubKey { get; set; } + [JsonPropertyName("sdkEphemPubKey")] + public SDKEphemPubKey SdkEphemPubKey { get { return this.SdkEphemPubKeyOption; } set { this.SdkEphemPubKeyOption = new Option(value); } } + + /// + /// Used to track the state of SdkMaxTimeout + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkMaxTimeoutOption { get; private set; } /// /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. /// /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. - [DataMember(Name = "sdkMaxTimeout", EmitDefaultValue = false)] - public int? SdkMaxTimeout { get; set; } + [JsonPropertyName("sdkMaxTimeout")] + public int? SdkMaxTimeout { get { return this.SdkMaxTimeoutOption; } set { this.SdkMaxTimeoutOption = new Option(value); } } + + /// + /// Used to track the state of SdkReferenceNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkReferenceNumberOption { get; private set; } /// /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. /// /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. - [DataMember(Name = "sdkReferenceNumber", EmitDefaultValue = false)] - public string SdkReferenceNumber { get; set; } + [JsonPropertyName("sdkReferenceNumber")] + public string SdkReferenceNumber { get { return this.SdkReferenceNumberOption; } set { this.SdkReferenceNumberOption = new Option(value); } } + + /// + /// Used to track the state of SdkTransID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkTransIDOption { get; private set; } /// /// The `sdkTransID` value as received from the 3D Secure 2 SDK. /// /// The `sdkTransID` value as received from the 3D Secure 2 SDK. - [DataMember(Name = "sdkTransID", EmitDefaultValue = false)] - public string SdkTransID { get; set; } + [JsonPropertyName("sdkTransID")] + public string SdkTransID { get { return this.SdkTransIDOption; } set { this.SdkTransIDOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSCompInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSCompIndOption { get; private set; } /// /// Completion indicator for the device fingerprinting. /// /// Completion indicator for the device fingerprinting. - [DataMember(Name = "threeDSCompInd", EmitDefaultValue = false)] - public string ThreeDSCompInd { get; set; } + [JsonPropertyName("threeDSCompInd")] + public string ThreeDSCompInd { get { return this.ThreeDSCompIndOption; } set { this.ThreeDSCompIndOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSRequestorAuthenticationInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorAuthenticationIndOption { get; private set; } /// /// Indicates the type of Authentication request. /// /// Indicates the type of Authentication request. - [DataMember(Name = "threeDSRequestorAuthenticationInd", EmitDefaultValue = false)] - public string ThreeDSRequestorAuthenticationInd { get; set; } + [JsonPropertyName("threeDSRequestorAuthenticationInd")] + public string ThreeDSRequestorAuthenticationInd { get { return this.ThreeDSRequestorAuthenticationIndOption; } set { this.ThreeDSRequestorAuthenticationIndOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSRequestorAuthenticationInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorAuthenticationInfoOption { get; private set; } /// /// Gets or Sets ThreeDSRequestorAuthenticationInfo /// - [DataMember(Name = "threeDSRequestorAuthenticationInfo", EmitDefaultValue = false)] - public ThreeDSRequestorAuthenticationInfo ThreeDSRequestorAuthenticationInfo { get; set; } + [JsonPropertyName("threeDSRequestorAuthenticationInfo")] + public ThreeDSRequestorAuthenticationInfo ThreeDSRequestorAuthenticationInfo { get { return this.ThreeDSRequestorAuthenticationInfoOption; } set { this.ThreeDSRequestorAuthenticationInfoOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSRequestorID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorIDOption { get; private set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. - [DataMember(Name = "threeDSRequestorID", EmitDefaultValue = false)] - public string ThreeDSRequestorID { get; set; } + [JsonPropertyName("threeDSRequestorID")] + public string ThreeDSRequestorID { get { return this.ThreeDSRequestorIDOption; } set { this.ThreeDSRequestorIDOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSRequestorName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorNameOption { get; private set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. - [DataMember(Name = "threeDSRequestorName", EmitDefaultValue = false)] - public string ThreeDSRequestorName { get; set; } + [JsonPropertyName("threeDSRequestorName")] + public string ThreeDSRequestorName { get { return this.ThreeDSRequestorNameOption; } set { this.ThreeDSRequestorNameOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSRequestorPriorAuthenticationInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorPriorAuthenticationInfoOption { get; private set; } /// /// Gets or Sets ThreeDSRequestorPriorAuthenticationInfo /// - [DataMember(Name = "threeDSRequestorPriorAuthenticationInfo", EmitDefaultValue = false)] - public ThreeDSRequestorPriorAuthenticationInfo ThreeDSRequestorPriorAuthenticationInfo { get; set; } + [JsonPropertyName("threeDSRequestorPriorAuthenticationInfo")] + public ThreeDSRequestorPriorAuthenticationInfo ThreeDSRequestorPriorAuthenticationInfo { get { return this.ThreeDSRequestorPriorAuthenticationInfoOption; } set { this.ThreeDSRequestorPriorAuthenticationInfoOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSRequestorURL + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorURLOption { get; private set; } /// /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. /// /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. - [DataMember(Name = "threeDSRequestorURL", EmitDefaultValue = false)] - public string ThreeDSRequestorURL { get; set; } + [JsonPropertyName("threeDSRequestorURL")] + public string ThreeDSRequestorURL { get { return this.ThreeDSRequestorURLOption; } set { this.ThreeDSRequestorURLOption = new Option(value); } } + + /// + /// Used to track the state of WhiteListStatus + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option WhiteListStatusOption { get; private set; } /// /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. /// /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. - [DataMember(Name = "whiteListStatus", EmitDefaultValue = false)] - public string WhiteListStatus { get; set; } + [JsonPropertyName("whiteListStatus")] + public string WhiteListStatus { get { return this.WhiteListStatusOption; } set { this.WhiteListStatusOption = new Option(value); } } + + /// + /// Used to track the state of WorkPhone + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option WorkPhoneOption { get; private set; } /// /// Gets or Sets WorkPhone /// - [DataMember(Name = "workPhone", EmitDefaultValue = false)] - public Phone WorkPhone { get; set; } + [JsonPropertyName("workPhone")] + public Phone WorkPhone { get { return this.WorkPhoneOption; } set { this.WorkPhoneOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -610,365 +1242,579 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // PurchaseInstalData (string) maxLength + if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length > 3) + { + yield return new ValidationResult("Invalid value for PurchaseInstalData, length must be less than 3.", new [] { "PurchaseInstalData" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ThreeDS2RequestFields); - } + // PurchaseInstalData (string) minLength + if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length < 1) + { + yield return new ValidationResult("Invalid value for PurchaseInstalData, length must be greater than 1.", new [] { "PurchaseInstalData" }); + } - /// - /// Returns true if ThreeDS2RequestFields instances are equal - /// - /// Instance of ThreeDS2RequestFields to be compared - /// Boolean - public bool Equals(ThreeDS2RequestFields input) - { - if (input == null) + // RecurringFrequency (string) maxLength + if (this.RecurringFrequency != null && this.RecurringFrequency.Length > 4) { - return false; + yield return new ValidationResult("Invalid value for RecurringFrequency, length must be less than 4.", new [] { "RecurringFrequency" }); } - return - ( - this.AcctInfo == input.AcctInfo || - (this.AcctInfo != null && - this.AcctInfo.Equals(input.AcctInfo)) - ) && - ( - this.AcctType == input.AcctType || - this.AcctType.Equals(input.AcctType) - ) && - ( - this.AcquirerBIN == input.AcquirerBIN || - (this.AcquirerBIN != null && - this.AcquirerBIN.Equals(input.AcquirerBIN)) - ) && - ( - this.AcquirerMerchantID == input.AcquirerMerchantID || - (this.AcquirerMerchantID != null && - this.AcquirerMerchantID.Equals(input.AcquirerMerchantID)) - ) && - ( - this.AddrMatch == input.AddrMatch || - this.AddrMatch.Equals(input.AddrMatch) - ) && - ( - this.AuthenticationOnly == input.AuthenticationOnly || - this.AuthenticationOnly.Equals(input.AuthenticationOnly) - ) && - ( - this.ChallengeIndicator == input.ChallengeIndicator || - this.ChallengeIndicator.Equals(input.ChallengeIndicator) - ) && - ( - this.DeviceRenderOptions == input.DeviceRenderOptions || - (this.DeviceRenderOptions != null && - this.DeviceRenderOptions.Equals(input.DeviceRenderOptions)) - ) && - ( - this.HomePhone == input.HomePhone || - (this.HomePhone != null && - this.HomePhone.Equals(input.HomePhone)) - ) && - ( - this.Mcc == input.Mcc || - (this.Mcc != null && - this.Mcc.Equals(input.Mcc)) - ) && - ( - this.MerchantName == input.MerchantName || - (this.MerchantName != null && - this.MerchantName.Equals(input.MerchantName)) - ) && - ( - this.MessageVersion == input.MessageVersion || - (this.MessageVersion != null && - this.MessageVersion.Equals(input.MessageVersion)) - ) && - ( - this.MobilePhone == input.MobilePhone || - (this.MobilePhone != null && - this.MobilePhone.Equals(input.MobilePhone)) - ) && - ( - this.NotificationURL == input.NotificationURL || - (this.NotificationURL != null && - this.NotificationURL.Equals(input.NotificationURL)) - ) && - ( - this.PayTokenInd == input.PayTokenInd || - this.PayTokenInd.Equals(input.PayTokenInd) - ) && - ( - this.PaymentAuthenticationUseCase == input.PaymentAuthenticationUseCase || - (this.PaymentAuthenticationUseCase != null && - this.PaymentAuthenticationUseCase.Equals(input.PaymentAuthenticationUseCase)) - ) && - ( - this.PurchaseInstalData == input.PurchaseInstalData || - (this.PurchaseInstalData != null && - this.PurchaseInstalData.Equals(input.PurchaseInstalData)) - ) && - ( - this.RecurringExpiry == input.RecurringExpiry || - (this.RecurringExpiry != null && - this.RecurringExpiry.Equals(input.RecurringExpiry)) - ) && - ( - this.RecurringFrequency == input.RecurringFrequency || - (this.RecurringFrequency != null && - this.RecurringFrequency.Equals(input.RecurringFrequency)) - ) && - ( - this.SdkAppID == input.SdkAppID || - (this.SdkAppID != null && - this.SdkAppID.Equals(input.SdkAppID)) - ) && - ( - this.SdkEphemPubKey == input.SdkEphemPubKey || - (this.SdkEphemPubKey != null && - this.SdkEphemPubKey.Equals(input.SdkEphemPubKey)) - ) && - ( - this.SdkMaxTimeout == input.SdkMaxTimeout || - this.SdkMaxTimeout.Equals(input.SdkMaxTimeout) - ) && - ( - this.SdkReferenceNumber == input.SdkReferenceNumber || - (this.SdkReferenceNumber != null && - this.SdkReferenceNumber.Equals(input.SdkReferenceNumber)) - ) && - ( - this.SdkTransID == input.SdkTransID || - (this.SdkTransID != null && - this.SdkTransID.Equals(input.SdkTransID)) - ) && - ( - this.ThreeDSCompInd == input.ThreeDSCompInd || - (this.ThreeDSCompInd != null && - this.ThreeDSCompInd.Equals(input.ThreeDSCompInd)) - ) && - ( - this.ThreeDSRequestorAuthenticationInd == input.ThreeDSRequestorAuthenticationInd || - (this.ThreeDSRequestorAuthenticationInd != null && - this.ThreeDSRequestorAuthenticationInd.Equals(input.ThreeDSRequestorAuthenticationInd)) - ) && - ( - this.ThreeDSRequestorAuthenticationInfo == input.ThreeDSRequestorAuthenticationInfo || - (this.ThreeDSRequestorAuthenticationInfo != null && - this.ThreeDSRequestorAuthenticationInfo.Equals(input.ThreeDSRequestorAuthenticationInfo)) - ) && - ( - this.ThreeDSRequestorChallengeInd == input.ThreeDSRequestorChallengeInd || - this.ThreeDSRequestorChallengeInd.Equals(input.ThreeDSRequestorChallengeInd) - ) && - ( - this.ThreeDSRequestorID == input.ThreeDSRequestorID || - (this.ThreeDSRequestorID != null && - this.ThreeDSRequestorID.Equals(input.ThreeDSRequestorID)) - ) && - ( - this.ThreeDSRequestorName == input.ThreeDSRequestorName || - (this.ThreeDSRequestorName != null && - this.ThreeDSRequestorName.Equals(input.ThreeDSRequestorName)) - ) && - ( - this.ThreeDSRequestorPriorAuthenticationInfo == input.ThreeDSRequestorPriorAuthenticationInfo || - (this.ThreeDSRequestorPriorAuthenticationInfo != null && - this.ThreeDSRequestorPriorAuthenticationInfo.Equals(input.ThreeDSRequestorPriorAuthenticationInfo)) - ) && - ( - this.ThreeDSRequestorURL == input.ThreeDSRequestorURL || - (this.ThreeDSRequestorURL != null && - this.ThreeDSRequestorURL.Equals(input.ThreeDSRequestorURL)) - ) && - ( - this.TransType == input.TransType || - this.TransType.Equals(input.TransType) - ) && - ( - this.TransactionType == input.TransactionType || - this.TransactionType.Equals(input.TransactionType) - ) && - ( - this.WhiteListStatus == input.WhiteListStatus || - (this.WhiteListStatus != null && - this.WhiteListStatus.Equals(input.WhiteListStatus)) - ) && - ( - this.WorkPhone == input.WorkPhone || - (this.WorkPhone != null && - this.WorkPhone.Equals(input.WorkPhone)) - ); + + yield break; } + } + /// + /// A Json converter for type + /// + public class ThreeDS2RequestFieldsJsonConverter : JsonConverter + { /// - /// Gets the hash code + /// Deserializes json to /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + /// + public override ThreeDS2RequestFields Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option acctInfo = default; + Option acctType = default; + Option acquirerBIN = default; + Option acquirerMerchantID = default; + Option addrMatch = default; + Option authenticationOnly = default; + Option challengeIndicator = default; + Option deviceRenderOptions = default; + Option homePhone = default; + Option mcc = default; + Option merchantName = default; + Option messageVersion = default; + Option mobilePhone = default; + Option notificationURL = default; + Option payTokenInd = default; + Option paymentAuthenticationUseCase = default; + Option purchaseInstalData = default; + Option recurringExpiry = default; + Option recurringFrequency = default; + Option sdkAppID = default; + Option sdkEphemPubKey = default; + Option sdkMaxTimeout = default; + Option sdkReferenceNumber = default; + Option sdkTransID = default; + Option threeDSCompInd = default; + Option threeDSRequestorAuthenticationInd = default; + Option threeDSRequestorAuthenticationInfo = default; + Option threeDSRequestorChallengeInd = default; + Option threeDSRequestorID = default; + Option threeDSRequestorName = default; + Option threeDSRequestorPriorAuthenticationInfo = default; + Option threeDSRequestorURL = default; + Option transType = default; + Option transactionType = default; + Option whiteListStatus = default; + Option workPhone = default; + + while (utf8JsonReader.Read()) { - int hashCode = 41; - if (this.AcctInfo != null) - { - hashCode = (hashCode * 59) + this.AcctInfo.GetHashCode(); - } - hashCode = (hashCode * 59) + this.AcctType.GetHashCode(); - if (this.AcquirerBIN != null) - { - hashCode = (hashCode * 59) + this.AcquirerBIN.GetHashCode(); - } - if (this.AcquirerMerchantID != null) - { - hashCode = (hashCode * 59) + this.AcquirerMerchantID.GetHashCode(); - } - hashCode = (hashCode * 59) + this.AddrMatch.GetHashCode(); - hashCode = (hashCode * 59) + this.AuthenticationOnly.GetHashCode(); - hashCode = (hashCode * 59) + this.ChallengeIndicator.GetHashCode(); - if (this.DeviceRenderOptions != null) - { - hashCode = (hashCode * 59) + this.DeviceRenderOptions.GetHashCode(); - } - if (this.HomePhone != null) - { - hashCode = (hashCode * 59) + this.HomePhone.GetHashCode(); - } - if (this.Mcc != null) - { - hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); - } - if (this.MerchantName != null) - { - hashCode = (hashCode * 59) + this.MerchantName.GetHashCode(); - } - if (this.MessageVersion != null) - { - hashCode = (hashCode * 59) + this.MessageVersion.GetHashCode(); - } - if (this.MobilePhone != null) - { - hashCode = (hashCode * 59) + this.MobilePhone.GetHashCode(); - } - if (this.NotificationURL != null) - { - hashCode = (hashCode * 59) + this.NotificationURL.GetHashCode(); - } - hashCode = (hashCode * 59) + this.PayTokenInd.GetHashCode(); - if (this.PaymentAuthenticationUseCase != null) - { - hashCode = (hashCode * 59) + this.PaymentAuthenticationUseCase.GetHashCode(); - } - if (this.PurchaseInstalData != null) - { - hashCode = (hashCode * 59) + this.PurchaseInstalData.GetHashCode(); - } - if (this.RecurringExpiry != null) - { - hashCode = (hashCode * 59) + this.RecurringExpiry.GetHashCode(); - } - if (this.RecurringFrequency != null) - { - hashCode = (hashCode * 59) + this.RecurringFrequency.GetHashCode(); - } - if (this.SdkAppID != null) - { - hashCode = (hashCode * 59) + this.SdkAppID.GetHashCode(); - } - if (this.SdkEphemPubKey != null) - { - hashCode = (hashCode * 59) + this.SdkEphemPubKey.GetHashCode(); - } - hashCode = (hashCode * 59) + this.SdkMaxTimeout.GetHashCode(); - if (this.SdkReferenceNumber != null) - { - hashCode = (hashCode * 59) + this.SdkReferenceNumber.GetHashCode(); - } - if (this.SdkTransID != null) - { - hashCode = (hashCode * 59) + this.SdkTransID.GetHashCode(); - } - if (this.ThreeDSCompInd != null) - { - hashCode = (hashCode * 59) + this.ThreeDSCompInd.GetHashCode(); - } - if (this.ThreeDSRequestorAuthenticationInd != null) - { - hashCode = (hashCode * 59) + this.ThreeDSRequestorAuthenticationInd.GetHashCode(); - } - if (this.ThreeDSRequestorAuthenticationInfo != null) - { - hashCode = (hashCode * 59) + this.ThreeDSRequestorAuthenticationInfo.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ThreeDSRequestorChallengeInd.GetHashCode(); - if (this.ThreeDSRequestorID != null) - { - hashCode = (hashCode * 59) + this.ThreeDSRequestorID.GetHashCode(); - } - if (this.ThreeDSRequestorName != null) - { - hashCode = (hashCode * 59) + this.ThreeDSRequestorName.GetHashCode(); - } - if (this.ThreeDSRequestorPriorAuthenticationInfo != null) - { - hashCode = (hashCode * 59) + this.ThreeDSRequestorPriorAuthenticationInfo.GetHashCode(); - } - if (this.ThreeDSRequestorURL != null) - { - hashCode = (hashCode * 59) + this.ThreeDSRequestorURL.GetHashCode(); - } - hashCode = (hashCode * 59) + this.TransType.GetHashCode(); - hashCode = (hashCode * 59) + this.TransactionType.GetHashCode(); - if (this.WhiteListStatus != null) - { - hashCode = (hashCode * 59) + this.WhiteListStatus.GetHashCode(); - } - if (this.WorkPhone != null) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - hashCode = (hashCode * 59) + this.WorkPhone.GetHashCode(); + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "acctInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + acctInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "acctType": + string acctTypeRawValue = utf8JsonReader.GetString(); + if (acctTypeRawValue != null) + acctType = new Option(ThreeDS2RequestFields.AcctTypeEnumFromStringOrDefault(acctTypeRawValue)); + break; + case "acquirerBIN": + acquirerBIN = new Option(utf8JsonReader.GetString()); + break; + case "acquirerMerchantID": + acquirerMerchantID = new Option(utf8JsonReader.GetString()); + break; + case "addrMatch": + string addrMatchRawValue = utf8JsonReader.GetString(); + if (addrMatchRawValue != null) + addrMatch = new Option(ThreeDS2RequestFields.AddrMatchEnumFromStringOrDefault(addrMatchRawValue)); + break; + case "authenticationOnly": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + authenticationOnly = new Option(utf8JsonReader.GetBoolean()); + break; + case "challengeIndicator": + string challengeIndicatorRawValue = utf8JsonReader.GetString(); + if (challengeIndicatorRawValue != null) + challengeIndicator = new Option(ThreeDS2RequestFields.ChallengeIndicatorEnumFromStringOrDefault(challengeIndicatorRawValue)); + break; + case "deviceRenderOptions": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deviceRenderOptions = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "homePhone": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + homePhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "mcc": + mcc = new Option(utf8JsonReader.GetString()); + break; + case "merchantName": + merchantName = new Option(utf8JsonReader.GetString()); + break; + case "messageVersion": + messageVersion = new Option(utf8JsonReader.GetString()); + break; + case "mobilePhone": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mobilePhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notificationURL": + notificationURL = new Option(utf8JsonReader.GetString()); + break; + case "payTokenInd": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + payTokenInd = new Option(utf8JsonReader.GetBoolean()); + break; + case "paymentAuthenticationUseCase": + paymentAuthenticationUseCase = new Option(utf8JsonReader.GetString()); + break; + case "purchaseInstalData": + purchaseInstalData = new Option(utf8JsonReader.GetString()); + break; + case "recurringExpiry": + recurringExpiry = new Option(utf8JsonReader.GetString()); + break; + case "recurringFrequency": + recurringFrequency = new Option(utf8JsonReader.GetString()); + break; + case "sdkAppID": + sdkAppID = new Option(utf8JsonReader.GetString()); + break; + case "sdkEphemPubKey": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sdkEphemPubKey = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "sdkMaxTimeout": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sdkMaxTimeout = new Option(utf8JsonReader.GetInt32()); + break; + case "sdkReferenceNumber": + sdkReferenceNumber = new Option(utf8JsonReader.GetString()); + break; + case "sdkTransID": + sdkTransID = new Option(utf8JsonReader.GetString()); + break; + case "threeDSCompInd": + threeDSCompInd = new Option(utf8JsonReader.GetString()); + break; + case "threeDSRequestorAuthenticationInd": + threeDSRequestorAuthenticationInd = new Option(utf8JsonReader.GetString()); + break; + case "threeDSRequestorAuthenticationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDSRequestorAuthenticationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDSRequestorChallengeInd": + string threeDSRequestorChallengeIndRawValue = utf8JsonReader.GetString(); + if (threeDSRequestorChallengeIndRawValue != null) + threeDSRequestorChallengeInd = new Option(ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnumFromStringOrDefault(threeDSRequestorChallengeIndRawValue)); + break; + case "threeDSRequestorID": + threeDSRequestorID = new Option(utf8JsonReader.GetString()); + break; + case "threeDSRequestorName": + threeDSRequestorName = new Option(utf8JsonReader.GetString()); + break; + case "threeDSRequestorPriorAuthenticationInfo": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + threeDSRequestorPriorAuthenticationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "threeDSRequestorURL": + threeDSRequestorURL = new Option(utf8JsonReader.GetString()); + break; + case "transType": + string transTypeRawValue = utf8JsonReader.GetString(); + if (transTypeRawValue != null) + transType = new Option(ThreeDS2RequestFields.TransTypeEnumFromStringOrDefault(transTypeRawValue)); + break; + case "transactionType": + string transactionTypeRawValue = utf8JsonReader.GetString(); + if (transactionTypeRawValue != null) + transactionType = new Option(ThreeDS2RequestFields.TransactionTypeEnumFromStringOrDefault(transactionTypeRawValue)); + break; + case "whiteListStatus": + whiteListStatus = new Option(utf8JsonReader.GetString()); + break; + case "workPhone": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + workPhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } } - return hashCode; } + + if (acctInfo.IsSet && acctInfo.Value == null) + throw new ArgumentNullException(nameof(acctInfo), "Property is not nullable for class ThreeDS2RequestFields."); + + if (acctType.IsSet && acctType.Value == null) + throw new ArgumentNullException(nameof(acctType), "Property is not nullable for class ThreeDS2RequestFields."); + + if (acquirerBIN.IsSet && acquirerBIN.Value == null) + throw new ArgumentNullException(nameof(acquirerBIN), "Property is not nullable for class ThreeDS2RequestFields."); + + if (acquirerMerchantID.IsSet && acquirerMerchantID.Value == null) + throw new ArgumentNullException(nameof(acquirerMerchantID), "Property is not nullable for class ThreeDS2RequestFields."); + + if (addrMatch.IsSet && addrMatch.Value == null) + throw new ArgumentNullException(nameof(addrMatch), "Property is not nullable for class ThreeDS2RequestFields."); + + if (authenticationOnly.IsSet && authenticationOnly.Value == null) + throw new ArgumentNullException(nameof(authenticationOnly), "Property is not nullable for class ThreeDS2RequestFields."); + + if (challengeIndicator.IsSet && challengeIndicator.Value == null) + throw new ArgumentNullException(nameof(challengeIndicator), "Property is not nullable for class ThreeDS2RequestFields."); + + if (deviceRenderOptions.IsSet && deviceRenderOptions.Value == null) + throw new ArgumentNullException(nameof(deviceRenderOptions), "Property is not nullable for class ThreeDS2RequestFields."); + + if (homePhone.IsSet && homePhone.Value == null) + throw new ArgumentNullException(nameof(homePhone), "Property is not nullable for class ThreeDS2RequestFields."); + + if (mcc.IsSet && mcc.Value == null) + throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class ThreeDS2RequestFields."); + + if (merchantName.IsSet && merchantName.Value == null) + throw new ArgumentNullException(nameof(merchantName), "Property is not nullable for class ThreeDS2RequestFields."); + + if (messageVersion.IsSet && messageVersion.Value == null) + throw new ArgumentNullException(nameof(messageVersion), "Property is not nullable for class ThreeDS2RequestFields."); + + if (mobilePhone.IsSet && mobilePhone.Value == null) + throw new ArgumentNullException(nameof(mobilePhone), "Property is not nullable for class ThreeDS2RequestFields."); + + if (notificationURL.IsSet && notificationURL.Value == null) + throw new ArgumentNullException(nameof(notificationURL), "Property is not nullable for class ThreeDS2RequestFields."); + + if (payTokenInd.IsSet && payTokenInd.Value == null) + throw new ArgumentNullException(nameof(payTokenInd), "Property is not nullable for class ThreeDS2RequestFields."); + + if (paymentAuthenticationUseCase.IsSet && paymentAuthenticationUseCase.Value == null) + throw new ArgumentNullException(nameof(paymentAuthenticationUseCase), "Property is not nullable for class ThreeDS2RequestFields."); + + if (purchaseInstalData.IsSet && purchaseInstalData.Value == null) + throw new ArgumentNullException(nameof(purchaseInstalData), "Property is not nullable for class ThreeDS2RequestFields."); + + if (recurringExpiry.IsSet && recurringExpiry.Value == null) + throw new ArgumentNullException(nameof(recurringExpiry), "Property is not nullable for class ThreeDS2RequestFields."); + + if (recurringFrequency.IsSet && recurringFrequency.Value == null) + throw new ArgumentNullException(nameof(recurringFrequency), "Property is not nullable for class ThreeDS2RequestFields."); + + if (sdkAppID.IsSet && sdkAppID.Value == null) + throw new ArgumentNullException(nameof(sdkAppID), "Property is not nullable for class ThreeDS2RequestFields."); + + if (sdkEphemPubKey.IsSet && sdkEphemPubKey.Value == null) + throw new ArgumentNullException(nameof(sdkEphemPubKey), "Property is not nullable for class ThreeDS2RequestFields."); + + if (sdkMaxTimeout.IsSet && sdkMaxTimeout.Value == null) + throw new ArgumentNullException(nameof(sdkMaxTimeout), "Property is not nullable for class ThreeDS2RequestFields."); + + if (sdkReferenceNumber.IsSet && sdkReferenceNumber.Value == null) + throw new ArgumentNullException(nameof(sdkReferenceNumber), "Property is not nullable for class ThreeDS2RequestFields."); + + if (sdkTransID.IsSet && sdkTransID.Value == null) + throw new ArgumentNullException(nameof(sdkTransID), "Property is not nullable for class ThreeDS2RequestFields."); + + if (threeDSCompInd.IsSet && threeDSCompInd.Value == null) + throw new ArgumentNullException(nameof(threeDSCompInd), "Property is not nullable for class ThreeDS2RequestFields."); + + if (threeDSRequestorAuthenticationInd.IsSet && threeDSRequestorAuthenticationInd.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorAuthenticationInd), "Property is not nullable for class ThreeDS2RequestFields."); + + if (threeDSRequestorAuthenticationInfo.IsSet && threeDSRequestorAuthenticationInfo.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorAuthenticationInfo), "Property is not nullable for class ThreeDS2RequestFields."); + + if (threeDSRequestorChallengeInd.IsSet && threeDSRequestorChallengeInd.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorChallengeInd), "Property is not nullable for class ThreeDS2RequestFields."); + + if (threeDSRequestorID.IsSet && threeDSRequestorID.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorID), "Property is not nullable for class ThreeDS2RequestFields."); + + if (threeDSRequestorName.IsSet && threeDSRequestorName.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorName), "Property is not nullable for class ThreeDS2RequestFields."); + + if (threeDSRequestorPriorAuthenticationInfo.IsSet && threeDSRequestorPriorAuthenticationInfo.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorPriorAuthenticationInfo), "Property is not nullable for class ThreeDS2RequestFields."); + + if (threeDSRequestorURL.IsSet && threeDSRequestorURL.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorURL), "Property is not nullable for class ThreeDS2RequestFields."); + + if (transType.IsSet && transType.Value == null) + throw new ArgumentNullException(nameof(transType), "Property is not nullable for class ThreeDS2RequestFields."); + + if (transactionType.IsSet && transactionType.Value == null) + throw new ArgumentNullException(nameof(transactionType), "Property is not nullable for class ThreeDS2RequestFields."); + + if (whiteListStatus.IsSet && whiteListStatus.Value == null) + throw new ArgumentNullException(nameof(whiteListStatus), "Property is not nullable for class ThreeDS2RequestFields."); + + if (workPhone.IsSet && workPhone.Value == null) + throw new ArgumentNullException(nameof(workPhone), "Property is not nullable for class ThreeDS2RequestFields."); + + return new ThreeDS2RequestFields(acctInfo, acctType, acquirerBIN, acquirerMerchantID, addrMatch, authenticationOnly, challengeIndicator, deviceRenderOptions, homePhone, mcc, merchantName, messageVersion, mobilePhone, notificationURL, payTokenInd, paymentAuthenticationUseCase, purchaseInstalData, recurringExpiry, recurringFrequency, sdkAppID, sdkEphemPubKey, sdkMaxTimeout, sdkReferenceNumber, sdkTransID, threeDSCompInd, threeDSRequestorAuthenticationInd, threeDSRequestorAuthenticationInfo, threeDSRequestorChallengeInd, threeDSRequestorID, threeDSRequestorName, threeDSRequestorPriorAuthenticationInfo, threeDSRequestorURL, transType, transactionType, whiteListStatus, workPhone); } + /// - /// To validate all properties of the instance + /// Serializes a /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ThreeDS2RequestFields threeDS2RequestFields, JsonSerializerOptions jsonSerializerOptions) { - // PurchaseInstalData (string) maxLength - if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length > 3) + writer.WriteStartObject(); + + WriteProperties(writer, threeDS2RequestFields, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ThreeDS2RequestFields threeDS2RequestFields, JsonSerializerOptions jsonSerializerOptions) + { + if (threeDS2RequestFields.AcctInfoOption.IsSet && threeDS2RequestFields.AcctInfo == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.AcctInfo), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.AcquirerBINOption.IsSet && threeDS2RequestFields.AcquirerBIN == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.AcquirerBIN), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.AcquirerMerchantIDOption.IsSet && threeDS2RequestFields.AcquirerMerchantID == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.AcquirerMerchantID), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.DeviceRenderOptionsOption.IsSet && threeDS2RequestFields.DeviceRenderOptions == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.DeviceRenderOptions), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.HomePhoneOption.IsSet && threeDS2RequestFields.HomePhone == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.HomePhone), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.MccOption.IsSet && threeDS2RequestFields.Mcc == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.Mcc), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.MerchantNameOption.IsSet && threeDS2RequestFields.MerchantName == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.MerchantName), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.MessageVersionOption.IsSet && threeDS2RequestFields.MessageVersion == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.MessageVersion), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.MobilePhoneOption.IsSet && threeDS2RequestFields.MobilePhone == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.MobilePhone), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.NotificationURLOption.IsSet && threeDS2RequestFields.NotificationURL == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.NotificationURL), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.PaymentAuthenticationUseCaseOption.IsSet && threeDS2RequestFields.PaymentAuthenticationUseCase == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.PaymentAuthenticationUseCase), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.PurchaseInstalDataOption.IsSet && threeDS2RequestFields.PurchaseInstalData == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.PurchaseInstalData), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.RecurringExpiryOption.IsSet && threeDS2RequestFields.RecurringExpiry == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.RecurringExpiry), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.RecurringFrequencyOption.IsSet && threeDS2RequestFields.RecurringFrequency == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.RecurringFrequency), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.SdkAppIDOption.IsSet && threeDS2RequestFields.SdkAppID == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.SdkAppID), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.SdkEphemPubKeyOption.IsSet && threeDS2RequestFields.SdkEphemPubKey == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.SdkEphemPubKey), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.SdkReferenceNumberOption.IsSet && threeDS2RequestFields.SdkReferenceNumber == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.SdkReferenceNumber), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.SdkTransIDOption.IsSet && threeDS2RequestFields.SdkTransID == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.SdkTransID), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.ThreeDSCompIndOption.IsSet && threeDS2RequestFields.ThreeDSCompInd == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSCompInd), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.ThreeDSRequestorAuthenticationIndOption.IsSet && threeDS2RequestFields.ThreeDSRequestorAuthenticationInd == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSRequestorAuthenticationInd), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.ThreeDSRequestorAuthenticationInfoOption.IsSet && threeDS2RequestFields.ThreeDSRequestorAuthenticationInfo == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSRequestorAuthenticationInfo), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.ThreeDSRequestorIDOption.IsSet && threeDS2RequestFields.ThreeDSRequestorID == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSRequestorID), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.ThreeDSRequestorNameOption.IsSet && threeDS2RequestFields.ThreeDSRequestorName == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSRequestorName), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.ThreeDSRequestorPriorAuthenticationInfoOption.IsSet && threeDS2RequestFields.ThreeDSRequestorPriorAuthenticationInfo == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSRequestorPriorAuthenticationInfo), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.ThreeDSRequestorURLOption.IsSet && threeDS2RequestFields.ThreeDSRequestorURL == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSRequestorURL), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.WhiteListStatusOption.IsSet && threeDS2RequestFields.WhiteListStatus == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.WhiteListStatus), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.WorkPhoneOption.IsSet && threeDS2RequestFields.WorkPhone == null) + throw new ArgumentNullException(nameof(threeDS2RequestFields.WorkPhone), "Property is required for class ThreeDS2RequestFields."); + + if (threeDS2RequestFields.AcctInfoOption.IsSet) + { + writer.WritePropertyName("acctInfo"); + JsonSerializer.Serialize(writer, threeDS2RequestFields.AcctInfo, jsonSerializerOptions); + } + var acctTypeRawValue = ThreeDS2RequestFields.AcctTypeEnumToJsonValue(threeDS2RequestFields.AcctTypeOption.Value.Value); + writer.WriteString("acctType", acctTypeRawValue); + if (threeDS2RequestFields.AcquirerBINOption.IsSet) + writer.WriteString("acquirerBIN", threeDS2RequestFields.AcquirerBIN); + + if (threeDS2RequestFields.AcquirerMerchantIDOption.IsSet) + writer.WriteString("acquirerMerchantID", threeDS2RequestFields.AcquirerMerchantID); + + var addrMatchRawValue = ThreeDS2RequestFields.AddrMatchEnumToJsonValue(threeDS2RequestFields.AddrMatchOption.Value.Value); + writer.WriteString("addrMatch", addrMatchRawValue); + if (threeDS2RequestFields.AuthenticationOnlyOption.IsSet) + writer.WriteBoolean("authenticationOnly", threeDS2RequestFields.AuthenticationOnlyOption.Value.Value); + + var challengeIndicatorRawValue = ThreeDS2RequestFields.ChallengeIndicatorEnumToJsonValue(threeDS2RequestFields.ChallengeIndicatorOption.Value.Value); + writer.WriteString("challengeIndicator", challengeIndicatorRawValue); + if (threeDS2RequestFields.DeviceRenderOptionsOption.IsSet) + { + writer.WritePropertyName("deviceRenderOptions"); + JsonSerializer.Serialize(writer, threeDS2RequestFields.DeviceRenderOptions, jsonSerializerOptions); + } + if (threeDS2RequestFields.HomePhoneOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PurchaseInstalData, length must be less than 3.", new [] { "PurchaseInstalData" }); + writer.WritePropertyName("homePhone"); + JsonSerializer.Serialize(writer, threeDS2RequestFields.HomePhone, jsonSerializerOptions); } + if (threeDS2RequestFields.MccOption.IsSet) + writer.WriteString("mcc", threeDS2RequestFields.Mcc); - // PurchaseInstalData (string) minLength - if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length < 1) + if (threeDS2RequestFields.MerchantNameOption.IsSet) + writer.WriteString("merchantName", threeDS2RequestFields.MerchantName); + + if (threeDS2RequestFields.MessageVersionOption.IsSet) + writer.WriteString("messageVersion", threeDS2RequestFields.MessageVersion); + + if (threeDS2RequestFields.MobilePhoneOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PurchaseInstalData, length must be greater than 1.", new [] { "PurchaseInstalData" }); + writer.WritePropertyName("mobilePhone"); + JsonSerializer.Serialize(writer, threeDS2RequestFields.MobilePhone, jsonSerializerOptions); } + if (threeDS2RequestFields.NotificationURLOption.IsSet) + writer.WriteString("notificationURL", threeDS2RequestFields.NotificationURL); - // RecurringFrequency (string) maxLength - if (this.RecurringFrequency != null && this.RecurringFrequency.Length > 4) + if (threeDS2RequestFields.PayTokenIndOption.IsSet) + writer.WriteBoolean("payTokenInd", threeDS2RequestFields.PayTokenIndOption.Value.Value); + + if (threeDS2RequestFields.PaymentAuthenticationUseCaseOption.IsSet) + writer.WriteString("paymentAuthenticationUseCase", threeDS2RequestFields.PaymentAuthenticationUseCase); + + if (threeDS2RequestFields.PurchaseInstalDataOption.IsSet) + writer.WriteString("purchaseInstalData", threeDS2RequestFields.PurchaseInstalData); + + if (threeDS2RequestFields.RecurringExpiryOption.IsSet) + writer.WriteString("recurringExpiry", threeDS2RequestFields.RecurringExpiry); + + if (threeDS2RequestFields.RecurringFrequencyOption.IsSet) + writer.WriteString("recurringFrequency", threeDS2RequestFields.RecurringFrequency); + + if (threeDS2RequestFields.SdkAppIDOption.IsSet) + writer.WriteString("sdkAppID", threeDS2RequestFields.SdkAppID); + + if (threeDS2RequestFields.SdkEphemPubKeyOption.IsSet) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for RecurringFrequency, length must be less than 4.", new [] { "RecurringFrequency" }); + writer.WritePropertyName("sdkEphemPubKey"); + JsonSerializer.Serialize(writer, threeDS2RequestFields.SdkEphemPubKey, jsonSerializerOptions); } + if (threeDS2RequestFields.SdkMaxTimeoutOption.IsSet) + writer.WriteNumber("sdkMaxTimeout", threeDS2RequestFields.SdkMaxTimeoutOption.Value.Value); - yield break; + if (threeDS2RequestFields.SdkReferenceNumberOption.IsSet) + writer.WriteString("sdkReferenceNumber", threeDS2RequestFields.SdkReferenceNumber); + + if (threeDS2RequestFields.SdkTransIDOption.IsSet) + writer.WriteString("sdkTransID", threeDS2RequestFields.SdkTransID); + + if (threeDS2RequestFields.ThreeDSCompIndOption.IsSet) + writer.WriteString("threeDSCompInd", threeDS2RequestFields.ThreeDSCompInd); + + if (threeDS2RequestFields.ThreeDSRequestorAuthenticationIndOption.IsSet) + writer.WriteString("threeDSRequestorAuthenticationInd", threeDS2RequestFields.ThreeDSRequestorAuthenticationInd); + + if (threeDS2RequestFields.ThreeDSRequestorAuthenticationInfoOption.IsSet) + { + writer.WritePropertyName("threeDSRequestorAuthenticationInfo"); + JsonSerializer.Serialize(writer, threeDS2RequestFields.ThreeDSRequestorAuthenticationInfo, jsonSerializerOptions); + } + var threeDSRequestorChallengeIndRawValue = ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2RequestFields.ThreeDSRequestorChallengeIndOption.Value.Value); + writer.WriteString("threeDSRequestorChallengeInd", threeDSRequestorChallengeIndRawValue); + if (threeDS2RequestFields.ThreeDSRequestorIDOption.IsSet) + writer.WriteString("threeDSRequestorID", threeDS2RequestFields.ThreeDSRequestorID); + + if (threeDS2RequestFields.ThreeDSRequestorNameOption.IsSet) + writer.WriteString("threeDSRequestorName", threeDS2RequestFields.ThreeDSRequestorName); + + if (threeDS2RequestFields.ThreeDSRequestorPriorAuthenticationInfoOption.IsSet) + { + writer.WritePropertyName("threeDSRequestorPriorAuthenticationInfo"); + JsonSerializer.Serialize(writer, threeDS2RequestFields.ThreeDSRequestorPriorAuthenticationInfo, jsonSerializerOptions); + } + if (threeDS2RequestFields.ThreeDSRequestorURLOption.IsSet) + writer.WriteString("threeDSRequestorURL", threeDS2RequestFields.ThreeDSRequestorURL); + + var transTypeRawValue = ThreeDS2RequestFields.TransTypeEnumToJsonValue(threeDS2RequestFields.TransTypeOption.Value.Value); + writer.WriteString("transType", transTypeRawValue); + var transactionTypeRawValue = ThreeDS2RequestFields.TransactionTypeEnumToJsonValue(threeDS2RequestFields.TransactionTypeOption.Value.Value); + writer.WriteString("transactionType", transactionTypeRawValue); + if (threeDS2RequestFields.WhiteListStatusOption.IsSet) + writer.WriteString("whiteListStatus", threeDS2RequestFields.WhiteListStatus); + + if (threeDS2RequestFields.WorkPhoneOption.IsSet) + { + writer.WritePropertyName("workPhone"); + JsonSerializer.Serialize(writer, threeDS2RequestFields.WorkPhone, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/ThreeDS2ResponseData.cs b/Adyen/Model/Checkout/ThreeDS2ResponseData.cs index b2e7a8fee..1b6e9ac94 100644 --- a/Adyen/Model/Checkout/ThreeDS2ResponseData.cs +++ b/Adyen/Model/Checkout/ThreeDS2ResponseData.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,181 +14,315 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ThreeDS2ResponseData /// - [DataContract(Name = "ThreeDS2ResponseData")] - public partial class ThreeDS2ResponseData : IEquatable, IValidatableObject + public partial class ThreeDS2ResponseData : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// acsChallengeMandated. - /// acsOperatorID. - /// acsReferenceNumber. - /// acsSignedContent. - /// acsTransID. - /// acsURL. - /// authenticationType. - /// cardHolderInfo. - /// cavvAlgorithm. - /// challengeIndicator. - /// dsReferenceNumber. - /// dsTransID. - /// exemptionIndicator. - /// messageVersion. - /// riskScore. - /// sdkEphemPubKey. - /// threeDSServerTransID. - /// transStatus. - /// transStatusReason. - public ThreeDS2ResponseData(string acsChallengeMandated = default(string), string acsOperatorID = default(string), string acsReferenceNumber = default(string), string acsSignedContent = default(string), string acsTransID = default(string), string acsURL = default(string), string authenticationType = default(string), string cardHolderInfo = default(string), string cavvAlgorithm = default(string), string challengeIndicator = default(string), string dsReferenceNumber = default(string), string dsTransID = default(string), string exemptionIndicator = default(string), string messageVersion = default(string), string riskScore = default(string), string sdkEphemPubKey = default(string), string threeDSServerTransID = default(string), string transStatus = default(string), string transStatusReason = default(string)) + /// acsChallengeMandated + /// acsOperatorID + /// acsReferenceNumber + /// acsSignedContent + /// acsTransID + /// acsURL + /// authenticationType + /// cardHolderInfo + /// cavvAlgorithm + /// challengeIndicator + /// dsReferenceNumber + /// dsTransID + /// exemptionIndicator + /// messageVersion + /// riskScore + /// sdkEphemPubKey + /// threeDSServerTransID + /// transStatus + /// transStatusReason + [JsonConstructor] + public ThreeDS2ResponseData(Option acsChallengeMandated = default, Option acsOperatorID = default, Option acsReferenceNumber = default, Option acsSignedContent = default, Option acsTransID = default, Option acsURL = default, Option authenticationType = default, Option cardHolderInfo = default, Option cavvAlgorithm = default, Option challengeIndicator = default, Option dsReferenceNumber = default, Option dsTransID = default, Option exemptionIndicator = default, Option messageVersion = default, Option riskScore = default, Option sdkEphemPubKey = default, Option threeDSServerTransID = default, Option transStatus = default, Option transStatusReason = default) { - this.AcsChallengeMandated = acsChallengeMandated; - this.AcsOperatorID = acsOperatorID; - this.AcsReferenceNumber = acsReferenceNumber; - this.AcsSignedContent = acsSignedContent; - this.AcsTransID = acsTransID; - this.AcsURL = acsURL; - this.AuthenticationType = authenticationType; - this.CardHolderInfo = cardHolderInfo; - this.CavvAlgorithm = cavvAlgorithm; - this.ChallengeIndicator = challengeIndicator; - this.DsReferenceNumber = dsReferenceNumber; - this.DsTransID = dsTransID; - this.ExemptionIndicator = exemptionIndicator; - this.MessageVersion = messageVersion; - this.RiskScore = riskScore; - this.SdkEphemPubKey = sdkEphemPubKey; - this.ThreeDSServerTransID = threeDSServerTransID; - this.TransStatus = transStatus; - this.TransStatusReason = transStatusReason; + AcsChallengeMandatedOption = acsChallengeMandated; + AcsOperatorIDOption = acsOperatorID; + AcsReferenceNumberOption = acsReferenceNumber; + AcsSignedContentOption = acsSignedContent; + AcsTransIDOption = acsTransID; + AcsURLOption = acsURL; + AuthenticationTypeOption = authenticationType; + CardHolderInfoOption = cardHolderInfo; + CavvAlgorithmOption = cavvAlgorithm; + ChallengeIndicatorOption = challengeIndicator; + DsReferenceNumberOption = dsReferenceNumber; + DsTransIDOption = dsTransID; + ExemptionIndicatorOption = exemptionIndicator; + MessageVersionOption = messageVersion; + RiskScoreOption = riskScore; + SdkEphemPubKeyOption = sdkEphemPubKey; + ThreeDSServerTransIDOption = threeDSServerTransID; + TransStatusOption = transStatus; + TransStatusReasonOption = transStatusReason; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of AcsChallengeMandated + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcsChallengeMandatedOption { get; private set; } + /// /// Gets or Sets AcsChallengeMandated /// - [DataMember(Name = "acsChallengeMandated", EmitDefaultValue = false)] - public string AcsChallengeMandated { get; set; } + [JsonPropertyName("acsChallengeMandated")] + public string AcsChallengeMandated { get { return this.AcsChallengeMandatedOption; } set { this.AcsChallengeMandatedOption = new Option(value); } } + + /// + /// Used to track the state of AcsOperatorID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcsOperatorIDOption { get; private set; } /// /// Gets or Sets AcsOperatorID /// - [DataMember(Name = "acsOperatorID", EmitDefaultValue = false)] - public string AcsOperatorID { get; set; } + [JsonPropertyName("acsOperatorID")] + public string AcsOperatorID { get { return this.AcsOperatorIDOption; } set { this.AcsOperatorIDOption = new Option(value); } } + + /// + /// Used to track the state of AcsReferenceNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcsReferenceNumberOption { get; private set; } /// /// Gets or Sets AcsReferenceNumber /// - [DataMember(Name = "acsReferenceNumber", EmitDefaultValue = false)] - public string AcsReferenceNumber { get; set; } + [JsonPropertyName("acsReferenceNumber")] + public string AcsReferenceNumber { get { return this.AcsReferenceNumberOption; } set { this.AcsReferenceNumberOption = new Option(value); } } + + /// + /// Used to track the state of AcsSignedContent + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcsSignedContentOption { get; private set; } /// /// Gets or Sets AcsSignedContent /// - [DataMember(Name = "acsSignedContent", EmitDefaultValue = false)] - public string AcsSignedContent { get; set; } + [JsonPropertyName("acsSignedContent")] + public string AcsSignedContent { get { return this.AcsSignedContentOption; } set { this.AcsSignedContentOption = new Option(value); } } + + /// + /// Used to track the state of AcsTransID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcsTransIDOption { get; private set; } /// /// Gets or Sets AcsTransID /// - [DataMember(Name = "acsTransID", EmitDefaultValue = false)] - public string AcsTransID { get; set; } + [JsonPropertyName("acsTransID")] + public string AcsTransID { get { return this.AcsTransIDOption; } set { this.AcsTransIDOption = new Option(value); } } + + /// + /// Used to track the state of AcsURL + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AcsURLOption { get; private set; } /// /// Gets or Sets AcsURL /// - [DataMember(Name = "acsURL", EmitDefaultValue = false)] - public string AcsURL { get; set; } + [JsonPropertyName("acsURL")] + public string AcsURL { get { return this.AcsURLOption; } set { this.AcsURLOption = new Option(value); } } + + /// + /// Used to track the state of AuthenticationType + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthenticationTypeOption { get; private set; } /// /// Gets or Sets AuthenticationType /// - [DataMember(Name = "authenticationType", EmitDefaultValue = false)] - public string AuthenticationType { get; set; } + [JsonPropertyName("authenticationType")] + public string AuthenticationType { get { return this.AuthenticationTypeOption; } set { this.AuthenticationTypeOption = new Option(value); } } + + /// + /// Used to track the state of CardHolderInfo + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CardHolderInfoOption { get; private set; } /// /// Gets or Sets CardHolderInfo /// - [DataMember(Name = "cardHolderInfo", EmitDefaultValue = false)] - public string CardHolderInfo { get; set; } + [JsonPropertyName("cardHolderInfo")] + public string CardHolderInfo { get { return this.CardHolderInfoOption; } set { this.CardHolderInfoOption = new Option(value); } } + + /// + /// Used to track the state of CavvAlgorithm + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CavvAlgorithmOption { get; private set; } /// /// Gets or Sets CavvAlgorithm /// - [DataMember(Name = "cavvAlgorithm", EmitDefaultValue = false)] - public string CavvAlgorithm { get; set; } + [JsonPropertyName("cavvAlgorithm")] + public string CavvAlgorithm { get { return this.CavvAlgorithmOption; } set { this.CavvAlgorithmOption = new Option(value); } } + + /// + /// Used to track the state of ChallengeIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChallengeIndicatorOption { get; private set; } /// /// Gets or Sets ChallengeIndicator /// - [DataMember(Name = "challengeIndicator", EmitDefaultValue = false)] - public string ChallengeIndicator { get; set; } + [JsonPropertyName("challengeIndicator")] + public string ChallengeIndicator { get { return this.ChallengeIndicatorOption; } set { this.ChallengeIndicatorOption = new Option(value); } } + + /// + /// Used to track the state of DsReferenceNumber + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DsReferenceNumberOption { get; private set; } /// /// Gets or Sets DsReferenceNumber /// - [DataMember(Name = "dsReferenceNumber", EmitDefaultValue = false)] - public string DsReferenceNumber { get; set; } + [JsonPropertyName("dsReferenceNumber")] + public string DsReferenceNumber { get { return this.DsReferenceNumberOption; } set { this.DsReferenceNumberOption = new Option(value); } } + + /// + /// Used to track the state of DsTransID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DsTransIDOption { get; private set; } /// /// Gets or Sets DsTransID /// - [DataMember(Name = "dsTransID", EmitDefaultValue = false)] - public string DsTransID { get; set; } + [JsonPropertyName("dsTransID")] + public string DsTransID { get { return this.DsTransIDOption; } set { this.DsTransIDOption = new Option(value); } } + + /// + /// Used to track the state of ExemptionIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExemptionIndicatorOption { get; private set; } /// /// Gets or Sets ExemptionIndicator /// - [DataMember(Name = "exemptionIndicator", EmitDefaultValue = false)] - public string ExemptionIndicator { get; set; } + [JsonPropertyName("exemptionIndicator")] + public string ExemptionIndicator { get { return this.ExemptionIndicatorOption; } set { this.ExemptionIndicatorOption = new Option(value); } } + + /// + /// Used to track the state of MessageVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MessageVersionOption { get; private set; } /// /// Gets or Sets MessageVersion /// - [DataMember(Name = "messageVersion", EmitDefaultValue = false)] - public string MessageVersion { get; set; } + [JsonPropertyName("messageVersion")] + public string MessageVersion { get { return this.MessageVersionOption; } set { this.MessageVersionOption = new Option(value); } } + + /// + /// Used to track the state of RiskScore + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskScoreOption { get; private set; } /// /// Gets or Sets RiskScore /// - [DataMember(Name = "riskScore", EmitDefaultValue = false)] - public string RiskScore { get; set; } + [JsonPropertyName("riskScore")] + public string RiskScore { get { return this.RiskScoreOption; } set { this.RiskScoreOption = new Option(value); } } + + /// + /// Used to track the state of SdkEphemPubKey + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SdkEphemPubKeyOption { get; private set; } /// /// Gets or Sets SdkEphemPubKey /// - [DataMember(Name = "sdkEphemPubKey", EmitDefaultValue = false)] - public string SdkEphemPubKey { get; set; } + [JsonPropertyName("sdkEphemPubKey")] + public string SdkEphemPubKey { get { return this.SdkEphemPubKeyOption; } set { this.SdkEphemPubKeyOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSServerTransID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSServerTransIDOption { get; private set; } /// /// Gets or Sets ThreeDSServerTransID /// - [DataMember(Name = "threeDSServerTransID", EmitDefaultValue = false)] - public string ThreeDSServerTransID { get; set; } + [JsonPropertyName("threeDSServerTransID")] + public string ThreeDSServerTransID { get { return this.ThreeDSServerTransIDOption; } set { this.ThreeDSServerTransIDOption = new Option(value); } } + + /// + /// Used to track the state of TransStatus + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TransStatusOption { get; private set; } /// /// Gets or Sets TransStatus /// - [DataMember(Name = "transStatus", EmitDefaultValue = false)] - public string TransStatus { get; set; } + [JsonPropertyName("transStatus")] + public string TransStatus { get { return this.TransStatusOption; } set { this.TransStatusOption = new Option(value); } } + + /// + /// Used to track the state of TransStatusReason + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TransStatusReasonOption { get; private set; } /// /// Gets or Sets TransStatusReason /// - [DataMember(Name = "transStatusReason", EmitDefaultValue = false)] - public string TransStatusReason { get; set; } + [JsonPropertyName("transStatusReason")] + public string TransStatusReason { get { return this.TransStatusReasonOption; } set { this.TransStatusReasonOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -223,230 +356,333 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ThreeDS2ResponseDataJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ThreeDS2ResponseData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ThreeDS2ResponseData); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ThreeDS2ResponseData instances are equal - /// - /// Instance of ThreeDS2ResponseData to be compared - /// Boolean - public bool Equals(ThreeDS2ResponseData input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option acsChallengeMandated = default; + Option acsOperatorID = default; + Option acsReferenceNumber = default; + Option acsSignedContent = default; + Option acsTransID = default; + Option acsURL = default; + Option authenticationType = default; + Option cardHolderInfo = default; + Option cavvAlgorithm = default; + Option challengeIndicator = default; + Option dsReferenceNumber = default; + Option dsTransID = default; + Option exemptionIndicator = default; + Option messageVersion = default; + Option riskScore = default; + Option sdkEphemPubKey = default; + Option threeDSServerTransID = default; + Option transStatus = default; + Option transStatusReason = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "acsChallengeMandated": + acsChallengeMandated = new Option(utf8JsonReader.GetString()); + break; + case "acsOperatorID": + acsOperatorID = new Option(utf8JsonReader.GetString()); + break; + case "acsReferenceNumber": + acsReferenceNumber = new Option(utf8JsonReader.GetString()); + break; + case "acsSignedContent": + acsSignedContent = new Option(utf8JsonReader.GetString()); + break; + case "acsTransID": + acsTransID = new Option(utf8JsonReader.GetString()); + break; + case "acsURL": + acsURL = new Option(utf8JsonReader.GetString()); + break; + case "authenticationType": + authenticationType = new Option(utf8JsonReader.GetString()); + break; + case "cardHolderInfo": + cardHolderInfo = new Option(utf8JsonReader.GetString()); + break; + case "cavvAlgorithm": + cavvAlgorithm = new Option(utf8JsonReader.GetString()); + break; + case "challengeIndicator": + challengeIndicator = new Option(utf8JsonReader.GetString()); + break; + case "dsReferenceNumber": + dsReferenceNumber = new Option(utf8JsonReader.GetString()); + break; + case "dsTransID": + dsTransID = new Option(utf8JsonReader.GetString()); + break; + case "exemptionIndicator": + exemptionIndicator = new Option(utf8JsonReader.GetString()); + break; + case "messageVersion": + messageVersion = new Option(utf8JsonReader.GetString()); + break; + case "riskScore": + riskScore = new Option(utf8JsonReader.GetString()); + break; + case "sdkEphemPubKey": + sdkEphemPubKey = new Option(utf8JsonReader.GetString()); + break; + case "threeDSServerTransID": + threeDSServerTransID = new Option(utf8JsonReader.GetString()); + break; + case "transStatus": + transStatus = new Option(utf8JsonReader.GetString()); + break; + case "transStatusReason": + transStatusReason = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AcsChallengeMandated == input.AcsChallengeMandated || - (this.AcsChallengeMandated != null && - this.AcsChallengeMandated.Equals(input.AcsChallengeMandated)) - ) && - ( - this.AcsOperatorID == input.AcsOperatorID || - (this.AcsOperatorID != null && - this.AcsOperatorID.Equals(input.AcsOperatorID)) - ) && - ( - this.AcsReferenceNumber == input.AcsReferenceNumber || - (this.AcsReferenceNumber != null && - this.AcsReferenceNumber.Equals(input.AcsReferenceNumber)) - ) && - ( - this.AcsSignedContent == input.AcsSignedContent || - (this.AcsSignedContent != null && - this.AcsSignedContent.Equals(input.AcsSignedContent)) - ) && - ( - this.AcsTransID == input.AcsTransID || - (this.AcsTransID != null && - this.AcsTransID.Equals(input.AcsTransID)) - ) && - ( - this.AcsURL == input.AcsURL || - (this.AcsURL != null && - this.AcsURL.Equals(input.AcsURL)) - ) && - ( - this.AuthenticationType == input.AuthenticationType || - (this.AuthenticationType != null && - this.AuthenticationType.Equals(input.AuthenticationType)) - ) && - ( - this.CardHolderInfo == input.CardHolderInfo || - (this.CardHolderInfo != null && - this.CardHolderInfo.Equals(input.CardHolderInfo)) - ) && - ( - this.CavvAlgorithm == input.CavvAlgorithm || - (this.CavvAlgorithm != null && - this.CavvAlgorithm.Equals(input.CavvAlgorithm)) - ) && - ( - this.ChallengeIndicator == input.ChallengeIndicator || - (this.ChallengeIndicator != null && - this.ChallengeIndicator.Equals(input.ChallengeIndicator)) - ) && - ( - this.DsReferenceNumber == input.DsReferenceNumber || - (this.DsReferenceNumber != null && - this.DsReferenceNumber.Equals(input.DsReferenceNumber)) - ) && - ( - this.DsTransID == input.DsTransID || - (this.DsTransID != null && - this.DsTransID.Equals(input.DsTransID)) - ) && - ( - this.ExemptionIndicator == input.ExemptionIndicator || - (this.ExemptionIndicator != null && - this.ExemptionIndicator.Equals(input.ExemptionIndicator)) - ) && - ( - this.MessageVersion == input.MessageVersion || - (this.MessageVersion != null && - this.MessageVersion.Equals(input.MessageVersion)) - ) && - ( - this.RiskScore == input.RiskScore || - (this.RiskScore != null && - this.RiskScore.Equals(input.RiskScore)) - ) && - ( - this.SdkEphemPubKey == input.SdkEphemPubKey || - (this.SdkEphemPubKey != null && - this.SdkEphemPubKey.Equals(input.SdkEphemPubKey)) - ) && - ( - this.ThreeDSServerTransID == input.ThreeDSServerTransID || - (this.ThreeDSServerTransID != null && - this.ThreeDSServerTransID.Equals(input.ThreeDSServerTransID)) - ) && - ( - this.TransStatus == input.TransStatus || - (this.TransStatus != null && - this.TransStatus.Equals(input.TransStatus)) - ) && - ( - this.TransStatusReason == input.TransStatusReason || - (this.TransStatusReason != null && - this.TransStatusReason.Equals(input.TransStatusReason)) - ); + + if (acsChallengeMandated.IsSet && acsChallengeMandated.Value == null) + throw new ArgumentNullException(nameof(acsChallengeMandated), "Property is not nullable for class ThreeDS2ResponseData."); + + if (acsOperatorID.IsSet && acsOperatorID.Value == null) + throw new ArgumentNullException(nameof(acsOperatorID), "Property is not nullable for class ThreeDS2ResponseData."); + + if (acsReferenceNumber.IsSet && acsReferenceNumber.Value == null) + throw new ArgumentNullException(nameof(acsReferenceNumber), "Property is not nullable for class ThreeDS2ResponseData."); + + if (acsSignedContent.IsSet && acsSignedContent.Value == null) + throw new ArgumentNullException(nameof(acsSignedContent), "Property is not nullable for class ThreeDS2ResponseData."); + + if (acsTransID.IsSet && acsTransID.Value == null) + throw new ArgumentNullException(nameof(acsTransID), "Property is not nullable for class ThreeDS2ResponseData."); + + if (acsURL.IsSet && acsURL.Value == null) + throw new ArgumentNullException(nameof(acsURL), "Property is not nullable for class ThreeDS2ResponseData."); + + if (authenticationType.IsSet && authenticationType.Value == null) + throw new ArgumentNullException(nameof(authenticationType), "Property is not nullable for class ThreeDS2ResponseData."); + + if (cardHolderInfo.IsSet && cardHolderInfo.Value == null) + throw new ArgumentNullException(nameof(cardHolderInfo), "Property is not nullable for class ThreeDS2ResponseData."); + + if (cavvAlgorithm.IsSet && cavvAlgorithm.Value == null) + throw new ArgumentNullException(nameof(cavvAlgorithm), "Property is not nullable for class ThreeDS2ResponseData."); + + if (challengeIndicator.IsSet && challengeIndicator.Value == null) + throw new ArgumentNullException(nameof(challengeIndicator), "Property is not nullable for class ThreeDS2ResponseData."); + + if (dsReferenceNumber.IsSet && dsReferenceNumber.Value == null) + throw new ArgumentNullException(nameof(dsReferenceNumber), "Property is not nullable for class ThreeDS2ResponseData."); + + if (dsTransID.IsSet && dsTransID.Value == null) + throw new ArgumentNullException(nameof(dsTransID), "Property is not nullable for class ThreeDS2ResponseData."); + + if (exemptionIndicator.IsSet && exemptionIndicator.Value == null) + throw new ArgumentNullException(nameof(exemptionIndicator), "Property is not nullable for class ThreeDS2ResponseData."); + + if (messageVersion.IsSet && messageVersion.Value == null) + throw new ArgumentNullException(nameof(messageVersion), "Property is not nullable for class ThreeDS2ResponseData."); + + if (riskScore.IsSet && riskScore.Value == null) + throw new ArgumentNullException(nameof(riskScore), "Property is not nullable for class ThreeDS2ResponseData."); + + if (sdkEphemPubKey.IsSet && sdkEphemPubKey.Value == null) + throw new ArgumentNullException(nameof(sdkEphemPubKey), "Property is not nullable for class ThreeDS2ResponseData."); + + if (threeDSServerTransID.IsSet && threeDSServerTransID.Value == null) + throw new ArgumentNullException(nameof(threeDSServerTransID), "Property is not nullable for class ThreeDS2ResponseData."); + + if (transStatus.IsSet && transStatus.Value == null) + throw new ArgumentNullException(nameof(transStatus), "Property is not nullable for class ThreeDS2ResponseData."); + + if (transStatusReason.IsSet && transStatusReason.Value == null) + throw new ArgumentNullException(nameof(transStatusReason), "Property is not nullable for class ThreeDS2ResponseData."); + + return new ThreeDS2ResponseData(acsChallengeMandated, acsOperatorID, acsReferenceNumber, acsSignedContent, acsTransID, acsURL, authenticationType, cardHolderInfo, cavvAlgorithm, challengeIndicator, dsReferenceNumber, dsTransID, exemptionIndicator, messageVersion, riskScore, sdkEphemPubKey, threeDSServerTransID, transStatus, transStatusReason); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ThreeDS2ResponseData threeDS2ResponseData, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AcsChallengeMandated != null) - { - hashCode = (hashCode * 59) + this.AcsChallengeMandated.GetHashCode(); - } - if (this.AcsOperatorID != null) - { - hashCode = (hashCode * 59) + this.AcsOperatorID.GetHashCode(); - } - if (this.AcsReferenceNumber != null) - { - hashCode = (hashCode * 59) + this.AcsReferenceNumber.GetHashCode(); - } - if (this.AcsSignedContent != null) - { - hashCode = (hashCode * 59) + this.AcsSignedContent.GetHashCode(); - } - if (this.AcsTransID != null) - { - hashCode = (hashCode * 59) + this.AcsTransID.GetHashCode(); - } - if (this.AcsURL != null) - { - hashCode = (hashCode * 59) + this.AcsURL.GetHashCode(); - } - if (this.AuthenticationType != null) - { - hashCode = (hashCode * 59) + this.AuthenticationType.GetHashCode(); - } - if (this.CardHolderInfo != null) - { - hashCode = (hashCode * 59) + this.CardHolderInfo.GetHashCode(); - } - if (this.CavvAlgorithm != null) - { - hashCode = (hashCode * 59) + this.CavvAlgorithm.GetHashCode(); - } - if (this.ChallengeIndicator != null) - { - hashCode = (hashCode * 59) + this.ChallengeIndicator.GetHashCode(); - } - if (this.DsReferenceNumber != null) - { - hashCode = (hashCode * 59) + this.DsReferenceNumber.GetHashCode(); - } - if (this.DsTransID != null) - { - hashCode = (hashCode * 59) + this.DsTransID.GetHashCode(); - } - if (this.ExemptionIndicator != null) - { - hashCode = (hashCode * 59) + this.ExemptionIndicator.GetHashCode(); - } - if (this.MessageVersion != null) - { - hashCode = (hashCode * 59) + this.MessageVersion.GetHashCode(); - } - if (this.RiskScore != null) - { - hashCode = (hashCode * 59) + this.RiskScore.GetHashCode(); - } - if (this.SdkEphemPubKey != null) - { - hashCode = (hashCode * 59) + this.SdkEphemPubKey.GetHashCode(); - } - if (this.ThreeDSServerTransID != null) - { - hashCode = (hashCode * 59) + this.ThreeDSServerTransID.GetHashCode(); - } - if (this.TransStatus != null) - { - hashCode = (hashCode * 59) + this.TransStatus.GetHashCode(); - } - if (this.TransStatusReason != null) - { - hashCode = (hashCode * 59) + this.TransStatusReason.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, threeDS2ResponseData, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ThreeDS2ResponseData threeDS2ResponseData, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (threeDS2ResponseData.AcsChallengeMandatedOption.IsSet && threeDS2ResponseData.AcsChallengeMandated == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.AcsChallengeMandated), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.AcsOperatorIDOption.IsSet && threeDS2ResponseData.AcsOperatorID == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.AcsOperatorID), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.AcsReferenceNumberOption.IsSet && threeDS2ResponseData.AcsReferenceNumber == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.AcsReferenceNumber), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.AcsSignedContentOption.IsSet && threeDS2ResponseData.AcsSignedContent == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.AcsSignedContent), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.AcsTransIDOption.IsSet && threeDS2ResponseData.AcsTransID == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.AcsTransID), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.AcsURLOption.IsSet && threeDS2ResponseData.AcsURL == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.AcsURL), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.AuthenticationTypeOption.IsSet && threeDS2ResponseData.AuthenticationType == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.AuthenticationType), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.CardHolderInfoOption.IsSet && threeDS2ResponseData.CardHolderInfo == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.CardHolderInfo), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.CavvAlgorithmOption.IsSet && threeDS2ResponseData.CavvAlgorithm == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.CavvAlgorithm), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.ChallengeIndicatorOption.IsSet && threeDS2ResponseData.ChallengeIndicator == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.ChallengeIndicator), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.DsReferenceNumberOption.IsSet && threeDS2ResponseData.DsReferenceNumber == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.DsReferenceNumber), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.DsTransIDOption.IsSet && threeDS2ResponseData.DsTransID == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.DsTransID), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.ExemptionIndicatorOption.IsSet && threeDS2ResponseData.ExemptionIndicator == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.ExemptionIndicator), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.MessageVersionOption.IsSet && threeDS2ResponseData.MessageVersion == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.MessageVersion), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.RiskScoreOption.IsSet && threeDS2ResponseData.RiskScore == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.RiskScore), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.SdkEphemPubKeyOption.IsSet && threeDS2ResponseData.SdkEphemPubKey == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.SdkEphemPubKey), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.ThreeDSServerTransIDOption.IsSet && threeDS2ResponseData.ThreeDSServerTransID == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.ThreeDSServerTransID), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.TransStatusOption.IsSet && threeDS2ResponseData.TransStatus == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.TransStatus), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.TransStatusReasonOption.IsSet && threeDS2ResponseData.TransStatusReason == null) + throw new ArgumentNullException(nameof(threeDS2ResponseData.TransStatusReason), "Property is required for class ThreeDS2ResponseData."); + + if (threeDS2ResponseData.AcsChallengeMandatedOption.IsSet) + writer.WriteString("acsChallengeMandated", threeDS2ResponseData.AcsChallengeMandated); + + if (threeDS2ResponseData.AcsOperatorIDOption.IsSet) + writer.WriteString("acsOperatorID", threeDS2ResponseData.AcsOperatorID); + + if (threeDS2ResponseData.AcsReferenceNumberOption.IsSet) + writer.WriteString("acsReferenceNumber", threeDS2ResponseData.AcsReferenceNumber); + + if (threeDS2ResponseData.AcsSignedContentOption.IsSet) + writer.WriteString("acsSignedContent", threeDS2ResponseData.AcsSignedContent); + + if (threeDS2ResponseData.AcsTransIDOption.IsSet) + writer.WriteString("acsTransID", threeDS2ResponseData.AcsTransID); + + if (threeDS2ResponseData.AcsURLOption.IsSet) + writer.WriteString("acsURL", threeDS2ResponseData.AcsURL); + + if (threeDS2ResponseData.AuthenticationTypeOption.IsSet) + writer.WriteString("authenticationType", threeDS2ResponseData.AuthenticationType); + + if (threeDS2ResponseData.CardHolderInfoOption.IsSet) + writer.WriteString("cardHolderInfo", threeDS2ResponseData.CardHolderInfo); + + if (threeDS2ResponseData.CavvAlgorithmOption.IsSet) + writer.WriteString("cavvAlgorithm", threeDS2ResponseData.CavvAlgorithm); + + if (threeDS2ResponseData.ChallengeIndicatorOption.IsSet) + writer.WriteString("challengeIndicator", threeDS2ResponseData.ChallengeIndicator); + + if (threeDS2ResponseData.DsReferenceNumberOption.IsSet) + writer.WriteString("dsReferenceNumber", threeDS2ResponseData.DsReferenceNumber); + + if (threeDS2ResponseData.DsTransIDOption.IsSet) + writer.WriteString("dsTransID", threeDS2ResponseData.DsTransID); + + if (threeDS2ResponseData.ExemptionIndicatorOption.IsSet) + writer.WriteString("exemptionIndicator", threeDS2ResponseData.ExemptionIndicator); + + if (threeDS2ResponseData.MessageVersionOption.IsSet) + writer.WriteString("messageVersion", threeDS2ResponseData.MessageVersion); + + if (threeDS2ResponseData.RiskScoreOption.IsSet) + writer.WriteString("riskScore", threeDS2ResponseData.RiskScore); + + if (threeDS2ResponseData.SdkEphemPubKeyOption.IsSet) + writer.WriteString("sdkEphemPubKey", threeDS2ResponseData.SdkEphemPubKey); + + if (threeDS2ResponseData.ThreeDSServerTransIDOption.IsSet) + writer.WriteString("threeDSServerTransID", threeDS2ResponseData.ThreeDSServerTransID); + + if (threeDS2ResponseData.TransStatusOption.IsSet) + writer.WriteString("transStatus", threeDS2ResponseData.TransStatus); + + if (threeDS2ResponseData.TransStatusReasonOption.IsSet) + writer.WriteString("transStatusReason", threeDS2ResponseData.TransStatusReason); } } - } diff --git a/Adyen/Model/Checkout/ThreeDS2Result.cs b/Adyen/Model/Checkout/ThreeDS2Result.cs index 1589c9f2e..fd11b9518 100644 --- a/Adyen/Model/Checkout/ThreeDS2Result.cs +++ b/Adyen/Model/Checkout/ThreeDS2Result.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,284 +14,609 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ThreeDS2Result /// - [DataContract(Name = "ThreeDS2Result")] - public partial class ThreeDS2Result : IEquatable, IValidatableObject + public partial class ThreeDS2Result : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The `authenticationValue` value as defined in the 3D Secure 2 specification. + /// The algorithm used by the ACS to calculate the authentication value, only for Cartes Bancaires integrations. + /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). + /// The `dsTransID` value as defined in the 3D Secure 2 specification. + /// The `eci` value as defined in the 3D Secure 2 specification. + /// Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` + /// The `messageVersion` value as defined in the 3D Secure 2 specification. + /// Risk score calculated by Cartes Bancaires Directory Server (DS). + /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + /// The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. + /// The `timestamp` value of the 3D Secure 2 authentication. + /// The `transStatus` value as defined in the 3D Secure 2 specification. + /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). + /// The `whiteListStatus` value as defined in the 3D Secure 2 specification. + [JsonConstructor] + public ThreeDS2Result(Option authenticationValue = default, Option cavvAlgorithm = default, Option challengeCancel = default, Option dsTransID = default, Option eci = default, Option exemptionIndicator = default, Option messageVersion = default, Option riskScore = default, Option threeDSRequestorChallengeInd = default, Option threeDSServerTransID = default, Option timestamp = default, Option transStatus = default, Option transStatusReason = default, Option whiteListStatus = default) + { + AuthenticationValueOption = authenticationValue; + CavvAlgorithmOption = cavvAlgorithm; + ChallengeCancelOption = challengeCancel; + DsTransIDOption = dsTransID; + EciOption = eci; + ExemptionIndicatorOption = exemptionIndicator; + MessageVersionOption = messageVersion; + RiskScoreOption = riskScore; + ThreeDSRequestorChallengeIndOption = threeDSRequestorChallengeInd; + ThreeDSServerTransIDOption = threeDSServerTransID; + TimestampOption = timestamp; + TransStatusOption = transStatus; + TransStatusReasonOption = transStatusReason; + WhiteListStatusOption = whiteListStatus; + OnCreated(); + } + + partial void OnCreated(); + /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). - [JsonConverter(typeof(StringEnumConverter))] public enum ChallengeCancelEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// - [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// - [EnumMember(Value = "06")] _06 = 6, /// /// Enum _07 for value: 07 /// - [EnumMember(Value = "07")] _07 = 7 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ChallengeCancelEnum ChallengeCancelEnumFromString(string value) + { + if (value.Equals("01")) + return ChallengeCancelEnum._01; + + if (value.Equals("02")) + return ChallengeCancelEnum._02; + + if (value.Equals("03")) + return ChallengeCancelEnum._03; + + if (value.Equals("04")) + return ChallengeCancelEnum._04; + if (value.Equals("05")) + return ChallengeCancelEnum._05; + + if (value.Equals("06")) + return ChallengeCancelEnum._06; + + if (value.Equals("07")) + return ChallengeCancelEnum._07; + + throw new NotImplementedException($"Could not convert value to type ChallengeCancelEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static ChallengeCancelEnum? ChallengeCancelEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ChallengeCancelEnum._01; + + if (value.Equals("02")) + return ChallengeCancelEnum._02; + + if (value.Equals("03")) + return ChallengeCancelEnum._03; + + if (value.Equals("04")) + return ChallengeCancelEnum._04; + + if (value.Equals("05")) + return ChallengeCancelEnum._05; + + if (value.Equals("06")) + return ChallengeCancelEnum._06; + + if (value.Equals("07")) + return ChallengeCancelEnum._07; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChallengeCancelEnumToJsonValue(ChallengeCancelEnum? value) + { + if (value == ChallengeCancelEnum._01) + return "01"; + + if (value == ChallengeCancelEnum._02) + return "02"; + + if (value == ChallengeCancelEnum._03) + return "03"; + + if (value == ChallengeCancelEnum._04) + return "04"; + + if (value == ChallengeCancelEnum._05) + return "05"; + + if (value == ChallengeCancelEnum._06) + return "06"; + + if (value == ChallengeCancelEnum._07) + return "07"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ChallengeCancel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChallengeCancelOption { get; private set; } /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). - [DataMember(Name = "challengeCancel", EmitDefaultValue = false)] - public ChallengeCancelEnum? ChallengeCancel { get; set; } + [JsonPropertyName("challengeCancel")] + public ChallengeCancelEnum? ChallengeCancel { get { return this.ChallengeCancelOption; } set { this.ChallengeCancelOption = new Option(value); } } + /// /// Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` /// /// Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` - [JsonConverter(typeof(StringEnumConverter))] public enum ExemptionIndicatorEnum { /// /// Enum LowValue for value: lowValue /// - [EnumMember(Value = "lowValue")] LowValue = 1, /// /// Enum SecureCorporate for value: secureCorporate /// - [EnumMember(Value = "secureCorporate")] SecureCorporate = 2, /// /// Enum TrustedBeneficiary for value: trustedBeneficiary /// - [EnumMember(Value = "trustedBeneficiary")] TrustedBeneficiary = 3, /// /// Enum TransactionRiskAnalysis for value: transactionRiskAnalysis /// - [EnumMember(Value = "transactionRiskAnalysis")] TransactionRiskAnalysis = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ExemptionIndicatorEnum ExemptionIndicatorEnumFromString(string value) + { + if (value.Equals("lowValue")) + return ExemptionIndicatorEnum.LowValue; + if (value.Equals("secureCorporate")) + return ExemptionIndicatorEnum.SecureCorporate; + + if (value.Equals("trustedBeneficiary")) + return ExemptionIndicatorEnum.TrustedBeneficiary; + + if (value.Equals("transactionRiskAnalysis")) + return ExemptionIndicatorEnum.TransactionRiskAnalysis; + + throw new NotImplementedException($"Could not convert value to type ExemptionIndicatorEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static ExemptionIndicatorEnum? ExemptionIndicatorEnumFromStringOrDefault(string value) + { + if (value.Equals("lowValue")) + return ExemptionIndicatorEnum.LowValue; + + if (value.Equals("secureCorporate")) + return ExemptionIndicatorEnum.SecureCorporate; + + if (value.Equals("trustedBeneficiary")) + return ExemptionIndicatorEnum.TrustedBeneficiary; + + if (value.Equals("transactionRiskAnalysis")) + return ExemptionIndicatorEnum.TransactionRiskAnalysis; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ExemptionIndicatorEnumToJsonValue(ExemptionIndicatorEnum? value) + { + if (value == ExemptionIndicatorEnum.LowValue) + return "lowValue"; + + if (value == ExemptionIndicatorEnum.SecureCorporate) + return "secureCorporate"; + + if (value == ExemptionIndicatorEnum.TrustedBeneficiary) + return "trustedBeneficiary"; + + if (value == ExemptionIndicatorEnum.TransactionRiskAnalysis) + return "transactionRiskAnalysis"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ExemptionIndicator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ExemptionIndicatorOption { get; private set; } /// /// Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` /// /// Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` - [DataMember(Name = "exemptionIndicator", EmitDefaultValue = false)] - public ExemptionIndicatorEnum? ExemptionIndicator { get; set; } + [JsonPropertyName("exemptionIndicator")] + public ExemptionIndicatorEnum? ExemptionIndicator { get { return this.ExemptionIndicatorOption; } set { this.ExemptionIndicatorOption = new Option(value); } } + /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSRequestorChallengeIndEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// - [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// - [EnumMember(Value = "06")] _06 = 6 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ThreeDSRequestorChallengeIndEnum ThreeDSRequestorChallengeIndEnumFromString(string value) + { + if (value.Equals("01")) + return ThreeDSRequestorChallengeIndEnum._01; + + if (value.Equals("02")) + return ThreeDSRequestorChallengeIndEnum._02; + + if (value.Equals("03")) + return ThreeDSRequestorChallengeIndEnum._03; + + if (value.Equals("04")) + return ThreeDSRequestorChallengeIndEnum._04; + + if (value.Equals("05")) + return ThreeDSRequestorChallengeIndEnum._05; + + if (value.Equals("06")) + return ThreeDSRequestorChallengeIndEnum._06; + + throw new NotImplementedException($"Could not convert value to type ThreeDSRequestorChallengeIndEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeIndEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ThreeDSRequestorChallengeIndEnum._01; + + if (value.Equals("02")) + return ThreeDSRequestorChallengeIndEnum._02; + + if (value.Equals("03")) + return ThreeDSRequestorChallengeIndEnum._03; + + if (value.Equals("04")) + return ThreeDSRequestorChallengeIndEnum._04; + + if (value.Equals("05")) + return ThreeDSRequestorChallengeIndEnum._05; + + if (value.Equals("06")) + return ThreeDSRequestorChallengeIndEnum._06; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ThreeDSRequestorChallengeIndEnumToJsonValue(ThreeDSRequestorChallengeIndEnum? value) + { + if (value == ThreeDSRequestorChallengeIndEnum._01) + return "01"; + + if (value == ThreeDSRequestorChallengeIndEnum._02) + return "02"; + + if (value == ThreeDSRequestorChallengeIndEnum._03) + return "03"; + + if (value == ThreeDSRequestorChallengeIndEnum._04) + return "04"; + + if (value == ThreeDSRequestorChallengeIndEnum._05) + return "05"; + + if (value == ThreeDSRequestorChallengeIndEnum._06) + return "06"; + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of ThreeDSRequestorChallengeInd + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSRequestorChallengeIndOption { get; private set; } /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - [DataMember(Name = "threeDSRequestorChallengeInd", EmitDefaultValue = false)] - public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get; set; } + [JsonPropertyName("threeDSRequestorChallengeInd")] + public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get { return this.ThreeDSRequestorChallengeIndOption; } set { this.ThreeDSRequestorChallengeIndOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of AuthenticationValue /// - /// The `authenticationValue` value as defined in the 3D Secure 2 specification.. - /// The algorithm used by the ACS to calculate the authentication value, only for Cartes Bancaires integrations.. - /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata).. - /// The `dsTransID` value as defined in the 3D Secure 2 specification.. - /// The `eci` value as defined in the 3D Secure 2 specification.. - /// Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` . - /// The `messageVersion` value as defined in the 3D Secure 2 specification.. - /// Risk score calculated by Cartes Bancaires Directory Server (DS).. - /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only. - /// The `threeDSServerTransID` value as defined in the 3D Secure 2 specification.. - /// The `timestamp` value of the 3D Secure 2 authentication.. - /// The `transStatus` value as defined in the 3D Secure 2 specification.. - /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values).. - /// The `whiteListStatus` value as defined in the 3D Secure 2 specification.. - public ThreeDS2Result(string authenticationValue = default(string), string cavvAlgorithm = default(string), ChallengeCancelEnum? challengeCancel = default(ChallengeCancelEnum?), string dsTransID = default(string), string eci = default(string), ExemptionIndicatorEnum? exemptionIndicator = default(ExemptionIndicatorEnum?), string messageVersion = default(string), string riskScore = default(string), ThreeDSRequestorChallengeIndEnum? threeDSRequestorChallengeInd = default(ThreeDSRequestorChallengeIndEnum?), string threeDSServerTransID = default(string), string timestamp = default(string), string transStatus = default(string), string transStatusReason = default(string), string whiteListStatus = default(string)) - { - this.AuthenticationValue = authenticationValue; - this.CavvAlgorithm = cavvAlgorithm; - this.ChallengeCancel = challengeCancel; - this.DsTransID = dsTransID; - this.Eci = eci; - this.ExemptionIndicator = exemptionIndicator; - this.MessageVersion = messageVersion; - this.RiskScore = riskScore; - this.ThreeDSRequestorChallengeInd = threeDSRequestorChallengeInd; - this.ThreeDSServerTransID = threeDSServerTransID; - this.Timestamp = timestamp; - this.TransStatus = transStatus; - this.TransStatusReason = transStatusReason; - this.WhiteListStatus = whiteListStatus; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthenticationValueOption { get; private set; } /// /// The `authenticationValue` value as defined in the 3D Secure 2 specification. /// /// The `authenticationValue` value as defined in the 3D Secure 2 specification. - [DataMember(Name = "authenticationValue", EmitDefaultValue = false)] - public string AuthenticationValue { get; set; } + [JsonPropertyName("authenticationValue")] + public string AuthenticationValue { get { return this.AuthenticationValueOption; } set { this.AuthenticationValueOption = new Option(value); } } + + /// + /// Used to track the state of CavvAlgorithm + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CavvAlgorithmOption { get; private set; } /// /// The algorithm used by the ACS to calculate the authentication value, only for Cartes Bancaires integrations. /// /// The algorithm used by the ACS to calculate the authentication value, only for Cartes Bancaires integrations. - [DataMember(Name = "cavvAlgorithm", EmitDefaultValue = false)] - public string CavvAlgorithm { get; set; } + [JsonPropertyName("cavvAlgorithm")] + public string CavvAlgorithm { get { return this.CavvAlgorithmOption; } set { this.CavvAlgorithmOption = new Option(value); } } + + /// + /// Used to track the state of DsTransID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DsTransIDOption { get; private set; } /// /// The `dsTransID` value as defined in the 3D Secure 2 specification. /// /// The `dsTransID` value as defined in the 3D Secure 2 specification. - [DataMember(Name = "dsTransID", EmitDefaultValue = false)] - public string DsTransID { get; set; } + [JsonPropertyName("dsTransID")] + public string DsTransID { get { return this.DsTransIDOption; } set { this.DsTransIDOption = new Option(value); } } + + /// + /// Used to track the state of Eci + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EciOption { get; private set; } /// /// The `eci` value as defined in the 3D Secure 2 specification. /// /// The `eci` value as defined in the 3D Secure 2 specification. - [DataMember(Name = "eci", EmitDefaultValue = false)] - public string Eci { get; set; } + [JsonPropertyName("eci")] + public string Eci { get { return this.EciOption; } set { this.EciOption = new Option(value); } } + + /// + /// Used to track the state of MessageVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option MessageVersionOption { get; private set; } /// /// The `messageVersion` value as defined in the 3D Secure 2 specification. /// /// The `messageVersion` value as defined in the 3D Secure 2 specification. - [DataMember(Name = "messageVersion", EmitDefaultValue = false)] - public string MessageVersion { get; set; } + [JsonPropertyName("messageVersion")] + public string MessageVersion { get { return this.MessageVersionOption; } set { this.MessageVersionOption = new Option(value); } } + + /// + /// Used to track the state of RiskScore + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskScoreOption { get; private set; } /// /// Risk score calculated by Cartes Bancaires Directory Server (DS). /// /// Risk score calculated by Cartes Bancaires Directory Server (DS). - [DataMember(Name = "riskScore", EmitDefaultValue = false)] - public string RiskScore { get; set; } + [JsonPropertyName("riskScore")] + public string RiskScore { get { return this.RiskScoreOption; } set { this.RiskScoreOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSServerTransID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSServerTransIDOption { get; private set; } /// /// The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. /// /// The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. - [DataMember(Name = "threeDSServerTransID", EmitDefaultValue = false)] - public string ThreeDSServerTransID { get; set; } + [JsonPropertyName("threeDSServerTransID")] + public string ThreeDSServerTransID { get { return this.ThreeDSServerTransIDOption; } set { this.ThreeDSServerTransIDOption = new Option(value); } } + + /// + /// Used to track the state of Timestamp + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TimestampOption { get; private set; } /// /// The `timestamp` value of the 3D Secure 2 authentication. /// /// The `timestamp` value of the 3D Secure 2 authentication. - [DataMember(Name = "timestamp", EmitDefaultValue = false)] - public string Timestamp { get; set; } + [JsonPropertyName("timestamp")] + public string Timestamp { get { return this.TimestampOption; } set { this.TimestampOption = new Option(value); } } + + /// + /// Used to track the state of TransStatus + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TransStatusOption { get; private set; } /// /// The `transStatus` value as defined in the 3D Secure 2 specification. /// /// The `transStatus` value as defined in the 3D Secure 2 specification. - [DataMember(Name = "transStatus", EmitDefaultValue = false)] - public string TransStatus { get; set; } + [JsonPropertyName("transStatus")] + public string TransStatus { get { return this.TransStatusOption; } set { this.TransStatusOption = new Option(value); } } + + /// + /// Used to track the state of TransStatusReason + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TransStatusReasonOption { get; private set; } /// /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). /// /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). - [DataMember(Name = "transStatusReason", EmitDefaultValue = false)] - public string TransStatusReason { get; set; } + [JsonPropertyName("transStatusReason")] + public string TransStatusReason { get { return this.TransStatusReasonOption; } set { this.TransStatusReasonOption = new Option(value); } } + + /// + /// Used to track the state of WhiteListStatus + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option WhiteListStatusOption { get; private set; } /// /// The `whiteListStatus` value as defined in the 3D Secure 2 specification. /// /// The `whiteListStatus` value as defined in the 3D Secure 2 specification. - [DataMember(Name = "whiteListStatus", EmitDefaultValue = false)] - public string WhiteListStatus { get; set; } + [JsonPropertyName("whiteListStatus")] + public string WhiteListStatus { get { return this.WhiteListStatusOption; } set { this.WhiteListStatusOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -321,173 +645,262 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal + /// To validate all properties of the instance /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return this.Equals(input as ThreeDS2Result); + yield break; } + } + /// + /// A Json converter for type + /// + public class ThreeDS2ResultJsonConverter : JsonConverter + { /// - /// Returns true if ThreeDS2Result instances are equal + /// Deserializes json to /// - /// Instance of ThreeDS2Result to be compared - /// Boolean - public bool Equals(ThreeDS2Result input) + /// + /// + /// + /// + /// + public override ThreeDS2Result Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option authenticationValue = default; + Option cavvAlgorithm = default; + Option challengeCancel = default; + Option dsTransID = default; + Option eci = default; + Option exemptionIndicator = default; + Option messageVersion = default; + Option riskScore = default; + Option threeDSRequestorChallengeInd = default; + Option threeDSServerTransID = default; + Option timestamp = default; + Option transStatus = default; + Option transStatusReason = default; + Option whiteListStatus = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "authenticationValue": + authenticationValue = new Option(utf8JsonReader.GetString()); + break; + case "cavvAlgorithm": + cavvAlgorithm = new Option(utf8JsonReader.GetString()); + break; + case "challengeCancel": + string challengeCancelRawValue = utf8JsonReader.GetString(); + if (challengeCancelRawValue != null) + challengeCancel = new Option(ThreeDS2Result.ChallengeCancelEnumFromStringOrDefault(challengeCancelRawValue)); + break; + case "dsTransID": + dsTransID = new Option(utf8JsonReader.GetString()); + break; + case "eci": + eci = new Option(utf8JsonReader.GetString()); + break; + case "exemptionIndicator": + string exemptionIndicatorRawValue = utf8JsonReader.GetString(); + if (exemptionIndicatorRawValue != null) + exemptionIndicator = new Option(ThreeDS2Result.ExemptionIndicatorEnumFromStringOrDefault(exemptionIndicatorRawValue)); + break; + case "messageVersion": + messageVersion = new Option(utf8JsonReader.GetString()); + break; + case "riskScore": + riskScore = new Option(utf8JsonReader.GetString()); + break; + case "threeDSRequestorChallengeInd": + string threeDSRequestorChallengeIndRawValue = utf8JsonReader.GetString(); + if (threeDSRequestorChallengeIndRawValue != null) + threeDSRequestorChallengeInd = new Option(ThreeDS2Result.ThreeDSRequestorChallengeIndEnumFromStringOrDefault(threeDSRequestorChallengeIndRawValue)); + break; + case "threeDSServerTransID": + threeDSServerTransID = new Option(utf8JsonReader.GetString()); + break; + case "timestamp": + timestamp = new Option(utf8JsonReader.GetString()); + break; + case "transStatus": + transStatus = new Option(utf8JsonReader.GetString()); + break; + case "transStatusReason": + transStatusReason = new Option(utf8JsonReader.GetString()); + break; + case "whiteListStatus": + whiteListStatus = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.AuthenticationValue == input.AuthenticationValue || - (this.AuthenticationValue != null && - this.AuthenticationValue.Equals(input.AuthenticationValue)) - ) && - ( - this.CavvAlgorithm == input.CavvAlgorithm || - (this.CavvAlgorithm != null && - this.CavvAlgorithm.Equals(input.CavvAlgorithm)) - ) && - ( - this.ChallengeCancel == input.ChallengeCancel || - this.ChallengeCancel.Equals(input.ChallengeCancel) - ) && - ( - this.DsTransID == input.DsTransID || - (this.DsTransID != null && - this.DsTransID.Equals(input.DsTransID)) - ) && - ( - this.Eci == input.Eci || - (this.Eci != null && - this.Eci.Equals(input.Eci)) - ) && - ( - this.ExemptionIndicator == input.ExemptionIndicator || - this.ExemptionIndicator.Equals(input.ExemptionIndicator) - ) && - ( - this.MessageVersion == input.MessageVersion || - (this.MessageVersion != null && - this.MessageVersion.Equals(input.MessageVersion)) - ) && - ( - this.RiskScore == input.RiskScore || - (this.RiskScore != null && - this.RiskScore.Equals(input.RiskScore)) - ) && - ( - this.ThreeDSRequestorChallengeInd == input.ThreeDSRequestorChallengeInd || - this.ThreeDSRequestorChallengeInd.Equals(input.ThreeDSRequestorChallengeInd) - ) && - ( - this.ThreeDSServerTransID == input.ThreeDSServerTransID || - (this.ThreeDSServerTransID != null && - this.ThreeDSServerTransID.Equals(input.ThreeDSServerTransID)) - ) && - ( - this.Timestamp == input.Timestamp || - (this.Timestamp != null && - this.Timestamp.Equals(input.Timestamp)) - ) && - ( - this.TransStatus == input.TransStatus || - (this.TransStatus != null && - this.TransStatus.Equals(input.TransStatus)) - ) && - ( - this.TransStatusReason == input.TransStatusReason || - (this.TransStatusReason != null && - this.TransStatusReason.Equals(input.TransStatusReason)) - ) && - ( - this.WhiteListStatus == input.WhiteListStatus || - (this.WhiteListStatus != null && - this.WhiteListStatus.Equals(input.WhiteListStatus)) - ); + + if (authenticationValue.IsSet && authenticationValue.Value == null) + throw new ArgumentNullException(nameof(authenticationValue), "Property is not nullable for class ThreeDS2Result."); + + if (cavvAlgorithm.IsSet && cavvAlgorithm.Value == null) + throw new ArgumentNullException(nameof(cavvAlgorithm), "Property is not nullable for class ThreeDS2Result."); + + if (challengeCancel.IsSet && challengeCancel.Value == null) + throw new ArgumentNullException(nameof(challengeCancel), "Property is not nullable for class ThreeDS2Result."); + + if (dsTransID.IsSet && dsTransID.Value == null) + throw new ArgumentNullException(nameof(dsTransID), "Property is not nullable for class ThreeDS2Result."); + + if (eci.IsSet && eci.Value == null) + throw new ArgumentNullException(nameof(eci), "Property is not nullable for class ThreeDS2Result."); + + if (exemptionIndicator.IsSet && exemptionIndicator.Value == null) + throw new ArgumentNullException(nameof(exemptionIndicator), "Property is not nullable for class ThreeDS2Result."); + + if (messageVersion.IsSet && messageVersion.Value == null) + throw new ArgumentNullException(nameof(messageVersion), "Property is not nullable for class ThreeDS2Result."); + + if (riskScore.IsSet && riskScore.Value == null) + throw new ArgumentNullException(nameof(riskScore), "Property is not nullable for class ThreeDS2Result."); + + if (threeDSRequestorChallengeInd.IsSet && threeDSRequestorChallengeInd.Value == null) + throw new ArgumentNullException(nameof(threeDSRequestorChallengeInd), "Property is not nullable for class ThreeDS2Result."); + + if (threeDSServerTransID.IsSet && threeDSServerTransID.Value == null) + throw new ArgumentNullException(nameof(threeDSServerTransID), "Property is not nullable for class ThreeDS2Result."); + + if (timestamp.IsSet && timestamp.Value == null) + throw new ArgumentNullException(nameof(timestamp), "Property is not nullable for class ThreeDS2Result."); + + if (transStatus.IsSet && transStatus.Value == null) + throw new ArgumentNullException(nameof(transStatus), "Property is not nullable for class ThreeDS2Result."); + + if (transStatusReason.IsSet && transStatusReason.Value == null) + throw new ArgumentNullException(nameof(transStatusReason), "Property is not nullable for class ThreeDS2Result."); + + if (whiteListStatus.IsSet && whiteListStatus.Value == null) + throw new ArgumentNullException(nameof(whiteListStatus), "Property is not nullable for class ThreeDS2Result."); + + return new ThreeDS2Result(authenticationValue, cavvAlgorithm, challengeCancel, dsTransID, eci, exemptionIndicator, messageVersion, riskScore, threeDSRequestorChallengeInd, threeDSServerTransID, timestamp, transStatus, transStatusReason, whiteListStatus); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ThreeDS2Result threeDS2Result, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AuthenticationValue != null) - { - hashCode = (hashCode * 59) + this.AuthenticationValue.GetHashCode(); - } - if (this.CavvAlgorithm != null) - { - hashCode = (hashCode * 59) + this.CavvAlgorithm.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ChallengeCancel.GetHashCode(); - if (this.DsTransID != null) - { - hashCode = (hashCode * 59) + this.DsTransID.GetHashCode(); - } - if (this.Eci != null) - { - hashCode = (hashCode * 59) + this.Eci.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ExemptionIndicator.GetHashCode(); - if (this.MessageVersion != null) - { - hashCode = (hashCode * 59) + this.MessageVersion.GetHashCode(); - } - if (this.RiskScore != null) - { - hashCode = (hashCode * 59) + this.RiskScore.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ThreeDSRequestorChallengeInd.GetHashCode(); - if (this.ThreeDSServerTransID != null) - { - hashCode = (hashCode * 59) + this.ThreeDSServerTransID.GetHashCode(); - } - if (this.Timestamp != null) - { - hashCode = (hashCode * 59) + this.Timestamp.GetHashCode(); - } - if (this.TransStatus != null) - { - hashCode = (hashCode * 59) + this.TransStatus.GetHashCode(); - } - if (this.TransStatusReason != null) - { - hashCode = (hashCode * 59) + this.TransStatusReason.GetHashCode(); - } - if (this.WhiteListStatus != null) - { - hashCode = (hashCode * 59) + this.WhiteListStatus.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, threeDS2Result, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ThreeDS2Result threeDS2Result, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (threeDS2Result.AuthenticationValueOption.IsSet && threeDS2Result.AuthenticationValue == null) + throw new ArgumentNullException(nameof(threeDS2Result.AuthenticationValue), "Property is required for class ThreeDS2Result."); + + if (threeDS2Result.CavvAlgorithmOption.IsSet && threeDS2Result.CavvAlgorithm == null) + throw new ArgumentNullException(nameof(threeDS2Result.CavvAlgorithm), "Property is required for class ThreeDS2Result."); + + if (threeDS2Result.DsTransIDOption.IsSet && threeDS2Result.DsTransID == null) + throw new ArgumentNullException(nameof(threeDS2Result.DsTransID), "Property is required for class ThreeDS2Result."); + + if (threeDS2Result.EciOption.IsSet && threeDS2Result.Eci == null) + throw new ArgumentNullException(nameof(threeDS2Result.Eci), "Property is required for class ThreeDS2Result."); + + if (threeDS2Result.MessageVersionOption.IsSet && threeDS2Result.MessageVersion == null) + throw new ArgumentNullException(nameof(threeDS2Result.MessageVersion), "Property is required for class ThreeDS2Result."); + + if (threeDS2Result.RiskScoreOption.IsSet && threeDS2Result.RiskScore == null) + throw new ArgumentNullException(nameof(threeDS2Result.RiskScore), "Property is required for class ThreeDS2Result."); + + if (threeDS2Result.ThreeDSServerTransIDOption.IsSet && threeDS2Result.ThreeDSServerTransID == null) + throw new ArgumentNullException(nameof(threeDS2Result.ThreeDSServerTransID), "Property is required for class ThreeDS2Result."); + + if (threeDS2Result.TimestampOption.IsSet && threeDS2Result.Timestamp == null) + throw new ArgumentNullException(nameof(threeDS2Result.Timestamp), "Property is required for class ThreeDS2Result."); + + if (threeDS2Result.TransStatusOption.IsSet && threeDS2Result.TransStatus == null) + throw new ArgumentNullException(nameof(threeDS2Result.TransStatus), "Property is required for class ThreeDS2Result."); + + if (threeDS2Result.TransStatusReasonOption.IsSet && threeDS2Result.TransStatusReason == null) + throw new ArgumentNullException(nameof(threeDS2Result.TransStatusReason), "Property is required for class ThreeDS2Result."); + + if (threeDS2Result.WhiteListStatusOption.IsSet && threeDS2Result.WhiteListStatus == null) + throw new ArgumentNullException(nameof(threeDS2Result.WhiteListStatus), "Property is required for class ThreeDS2Result."); + + if (threeDS2Result.AuthenticationValueOption.IsSet) + writer.WriteString("authenticationValue", threeDS2Result.AuthenticationValue); + + if (threeDS2Result.CavvAlgorithmOption.IsSet) + writer.WriteString("cavvAlgorithm", threeDS2Result.CavvAlgorithm); + + var challengeCancelRawValue = ThreeDS2Result.ChallengeCancelEnumToJsonValue(threeDS2Result.ChallengeCancelOption.Value.Value); + writer.WriteString("challengeCancel", challengeCancelRawValue); + if (threeDS2Result.DsTransIDOption.IsSet) + writer.WriteString("dsTransID", threeDS2Result.DsTransID); + + if (threeDS2Result.EciOption.IsSet) + writer.WriteString("eci", threeDS2Result.Eci); + + var exemptionIndicatorRawValue = ThreeDS2Result.ExemptionIndicatorEnumToJsonValue(threeDS2Result.ExemptionIndicatorOption.Value.Value); + writer.WriteString("exemptionIndicator", exemptionIndicatorRawValue); + if (threeDS2Result.MessageVersionOption.IsSet) + writer.WriteString("messageVersion", threeDS2Result.MessageVersion); + + if (threeDS2Result.RiskScoreOption.IsSet) + writer.WriteString("riskScore", threeDS2Result.RiskScore); + + var threeDSRequestorChallengeIndRawValue = ThreeDS2Result.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2Result.ThreeDSRequestorChallengeIndOption.Value.Value); + writer.WriteString("threeDSRequestorChallengeInd", threeDSRequestorChallengeIndRawValue); + if (threeDS2Result.ThreeDSServerTransIDOption.IsSet) + writer.WriteString("threeDSServerTransID", threeDS2Result.ThreeDSServerTransID); + + if (threeDS2Result.TimestampOption.IsSet) + writer.WriteString("timestamp", threeDS2Result.Timestamp); + + if (threeDS2Result.TransStatusOption.IsSet) + writer.WriteString("transStatus", threeDS2Result.TransStatus); + + if (threeDS2Result.TransStatusReasonOption.IsSet) + writer.WriteString("transStatusReason", threeDS2Result.TransStatusReason); + + if (threeDS2Result.WhiteListStatusOption.IsSet) + writer.WriteString("whiteListStatus", threeDS2Result.WhiteListStatus); } } - } diff --git a/Adyen/Model/Checkout/ThreeDSRequestData.cs b/Adyen/Model/Checkout/ThreeDSRequestData.cs index da6917c30..13fc160c9 100644 --- a/Adyen/Model/Checkout/ThreeDSRequestData.cs +++ b/Adyen/Model/Checkout/ThreeDSRequestData.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,168 +14,405 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ThreeDSRequestData /// - [DataContract(Name = "ThreeDSRequestData")] - public partial class ThreeDSRequestData : IEquatable, IValidatableObject + public partial class ThreeDSRequestData : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen + /// Flag for data only flow. + /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Only use the redirect 3D Secure authentication flow. + /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** + [JsonConstructor] + public ThreeDSRequestData(Option challengeWindowSize = default, Option dataOnly = default, Option nativeThreeDS = default, Option threeDSVersion = default) + { + ChallengeWindowSizeOption = challengeWindowSize; + DataOnlyOption = dataOnly; + NativeThreeDSOption = nativeThreeDS; + ThreeDSVersionOption = threeDSVersion; + OnCreated(); + } + + partial void OnCreated(); + /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen - [JsonConverter(typeof(StringEnumConverter))] public enum ChallengeWindowSizeEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// - [EnumMember(Value = "05")] _05 = 5 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ChallengeWindowSizeEnum ChallengeWindowSizeEnumFromString(string value) + { + if (value.Equals("01")) + return ChallengeWindowSizeEnum._01; + + if (value.Equals("02")) + return ChallengeWindowSizeEnum._02; + + if (value.Equals("03")) + return ChallengeWindowSizeEnum._03; + + if (value.Equals("04")) + return ChallengeWindowSizeEnum._04; + + if (value.Equals("05")) + return ChallengeWindowSizeEnum._05; + + throw new NotImplementedException($"Could not convert value to type ChallengeWindowSizeEnum: '{value}'"); + } + /// + /// Returns a + /// + /// + /// + public static ChallengeWindowSizeEnum? ChallengeWindowSizeEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ChallengeWindowSizeEnum._01; + + if (value.Equals("02")) + return ChallengeWindowSizeEnum._02; + + if (value.Equals("03")) + return ChallengeWindowSizeEnum._03; + + if (value.Equals("04")) + return ChallengeWindowSizeEnum._04; + + if (value.Equals("05")) + return ChallengeWindowSizeEnum._05; + + return null; } + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChallengeWindowSizeEnumToJsonValue(ChallengeWindowSizeEnum? value) + { + if (value == ChallengeWindowSizeEnum._01) + return "01"; + + if (value == ChallengeWindowSizeEnum._02) + return "02"; + + if (value == ChallengeWindowSizeEnum._03) + return "03"; + + if (value == ChallengeWindowSizeEnum._04) + return "04"; + + if (value == ChallengeWindowSizeEnum._05) + return "05"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ChallengeWindowSize + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChallengeWindowSizeOption { get; private set; } /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen - [DataMember(Name = "challengeWindowSize", EmitDefaultValue = false)] - public ChallengeWindowSizeEnum? ChallengeWindowSize { get; set; } + [JsonPropertyName("challengeWindowSize")] + public ChallengeWindowSizeEnum? ChallengeWindowSize { get { return this.ChallengeWindowSizeOption; } set { this.ChallengeWindowSizeOption = new Option(value); } } + /// /// Flag for data only flow. /// /// Flag for data only flow. - [JsonConverter(typeof(StringEnumConverter))] public enum DataOnlyEnum { /// /// Enum False for value: false /// - [EnumMember(Value = "false")] False = 1, /// /// Enum True for value: true /// - [EnumMember(Value = "true")] True = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static DataOnlyEnum DataOnlyEnumFromString(string value) + { + if (value.Equals("false")) + return DataOnlyEnum.False; + + if (value.Equals("true")) + return DataOnlyEnum.True; + throw new NotImplementedException($"Could not convert value to type DataOnlyEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static DataOnlyEnum? DataOnlyEnumFromStringOrDefault(string value) + { + if (value.Equals("false")) + return DataOnlyEnum.False; + + if (value.Equals("true")) + return DataOnlyEnum.True; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string DataOnlyEnumToJsonValue(DataOnlyEnum? value) + { + if (value == DataOnlyEnum.False) + return "false"; + + if (value == DataOnlyEnum.True) + return "true"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of DataOnly + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DataOnlyOption { get; private set; } /// /// Flag for data only flow. /// /// Flag for data only flow. - [DataMember(Name = "dataOnly", EmitDefaultValue = false)] - public DataOnlyEnum? DataOnly { get; set; } + [JsonPropertyName("dataOnly")] + public DataOnlyEnum? DataOnly { get { return this.DataOnlyOption; } set { this.DataOnlyOption = new Option(value); } } + /// /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Only use the redirect 3D Secure authentication flow. /// /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Only use the redirect 3D Secure authentication flow. - [JsonConverter(typeof(StringEnumConverter))] public enum NativeThreeDSEnum { /// /// Enum Preferred for value: preferred /// - [EnumMember(Value = "preferred")] Preferred = 1, /// /// Enum Disabled for value: disabled /// - [EnumMember(Value = "disabled")] Disabled = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static NativeThreeDSEnum NativeThreeDSEnumFromString(string value) + { + if (value.Equals("preferred")) + return NativeThreeDSEnum.Preferred; + + if (value.Equals("disabled")) + return NativeThreeDSEnum.Disabled; + + throw new NotImplementedException($"Could not convert value to type NativeThreeDSEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static NativeThreeDSEnum? NativeThreeDSEnumFromStringOrDefault(string value) + { + if (value.Equals("preferred")) + return NativeThreeDSEnum.Preferred; + + if (value.Equals("disabled")) + return NativeThreeDSEnum.Disabled; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string NativeThreeDSEnumToJsonValue(NativeThreeDSEnum? value) + { + if (value == NativeThreeDSEnum.Preferred) + return "preferred"; + + if (value == NativeThreeDSEnum.Disabled) + return "disabled"; + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of NativeThreeDS + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NativeThreeDSOption { get; private set; } /// /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Only use the redirect 3D Secure authentication flow. /// /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Only use the redirect 3D Secure authentication flow. - [DataMember(Name = "nativeThreeDS", EmitDefaultValue = false)] - public NativeThreeDSEnum? NativeThreeDS { get; set; } + [JsonPropertyName("nativeThreeDS")] + public NativeThreeDSEnum? NativeThreeDS { get { return this.NativeThreeDSOption; } set { this.NativeThreeDSOption = new Option(value); } } + /// /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** /// /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** - [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSVersionEnum { /// - /// Enum _10 for value: 2.1.0 + /// Enum _210 for value: 2.1.0 /// - [EnumMember(Value = "2.1.0")] - _10 = 1, + _210 = 1, /// - /// Enum _20 for value: 2.2.0 + /// Enum _220 for value: 2.2.0 /// - [EnumMember(Value = "2.2.0")] - _20 = 2 - + _220 = 2 } + /// + /// Returns a + /// + /// + /// + /// + public static ThreeDSVersionEnum ThreeDSVersionEnumFromString(string value) + { + if (value.Equals("2.1.0")) + return ThreeDSVersionEnum._210; + + if (value.Equals("2.2.0")) + return ThreeDSVersionEnum._220; + + throw new NotImplementedException($"Could not convert value to type ThreeDSVersionEnum: '{value}'"); + } /// - /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** + /// Returns a /// - /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** - [DataMember(Name = "threeDSVersion", EmitDefaultValue = false)] - public ThreeDSVersionEnum? ThreeDSVersion { get; set; } + /// + /// + public static ThreeDSVersionEnum? ThreeDSVersionEnumFromStringOrDefault(string value) + { + if (value.Equals("2.1.0")) + return ThreeDSVersionEnum._210; + + if (value.Equals("2.2.0")) + return ThreeDSVersionEnum._220; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen. - /// Flag for data only flow.. - /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Only use the redirect 3D Secure authentication flow.. - /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0**. - public ThreeDSRequestData(ChallengeWindowSizeEnum? challengeWindowSize = default(ChallengeWindowSizeEnum?), DataOnlyEnum? dataOnly = default(DataOnlyEnum?), NativeThreeDSEnum? nativeThreeDS = default(NativeThreeDSEnum?), ThreeDSVersionEnum? threeDSVersion = default(ThreeDSVersionEnum?)) + /// + /// + /// + public static string ThreeDSVersionEnumToJsonValue(ThreeDSVersionEnum? value) { - this.ChallengeWindowSize = challengeWindowSize; - this.DataOnly = dataOnly; - this.NativeThreeDS = nativeThreeDS; - this.ThreeDSVersion = threeDSVersion; + if (value == ThreeDSVersionEnum._210) + return "2.1.0"; + + if (value == ThreeDSVersionEnum._220) + return "2.2.0"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of ThreeDSVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSVersionOption { get; private set; } + + /// + /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** + /// + /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** + [JsonPropertyName("threeDSVersion")] + public ThreeDSVersionEnum? ThreeDSVersion { get { return this.ThreeDSVersionOption; } set { this.ThreeDSVersionOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -194,79 +430,131 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ThreeDSRequestDataJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ThreeDSRequestData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ThreeDSRequestData); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if ThreeDSRequestData instances are equal - /// - /// Instance of ThreeDSRequestData to be compared - /// Boolean - public bool Equals(ThreeDSRequestData input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option challengeWindowSize = default; + Option dataOnly = default; + Option nativeThreeDS = default; + Option threeDSVersion = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "challengeWindowSize": + string challengeWindowSizeRawValue = utf8JsonReader.GetString(); + if (challengeWindowSizeRawValue != null) + challengeWindowSize = new Option(ThreeDSRequestData.ChallengeWindowSizeEnumFromStringOrDefault(challengeWindowSizeRawValue)); + break; + case "dataOnly": + string dataOnlyRawValue = utf8JsonReader.GetString(); + if (dataOnlyRawValue != null) + dataOnly = new Option(ThreeDSRequestData.DataOnlyEnumFromStringOrDefault(dataOnlyRawValue)); + break; + case "nativeThreeDS": + string nativeThreeDSRawValue = utf8JsonReader.GetString(); + if (nativeThreeDSRawValue != null) + nativeThreeDS = new Option(ThreeDSRequestData.NativeThreeDSEnumFromStringOrDefault(nativeThreeDSRawValue)); + break; + case "threeDSVersion": + string threeDSVersionRawValue = utf8JsonReader.GetString(); + if (threeDSVersionRawValue != null) + threeDSVersion = new Option(ThreeDSRequestData.ThreeDSVersionEnumFromStringOrDefault(threeDSVersionRawValue)); + break; + default: + break; + } + } } - return - ( - this.ChallengeWindowSize == input.ChallengeWindowSize || - this.ChallengeWindowSize.Equals(input.ChallengeWindowSize) - ) && - ( - this.DataOnly == input.DataOnly || - this.DataOnly.Equals(input.DataOnly) - ) && - ( - this.NativeThreeDS == input.NativeThreeDS || - this.NativeThreeDS.Equals(input.NativeThreeDS) - ) && - ( - this.ThreeDSVersion == input.ThreeDSVersion || - this.ThreeDSVersion.Equals(input.ThreeDSVersion) - ); + + if (challengeWindowSize.IsSet && challengeWindowSize.Value == null) + throw new ArgumentNullException(nameof(challengeWindowSize), "Property is not nullable for class ThreeDSRequestData."); + + if (dataOnly.IsSet && dataOnly.Value == null) + throw new ArgumentNullException(nameof(dataOnly), "Property is not nullable for class ThreeDSRequestData."); + + if (nativeThreeDS.IsSet && nativeThreeDS.Value == null) + throw new ArgumentNullException(nameof(nativeThreeDS), "Property is not nullable for class ThreeDSRequestData."); + + if (threeDSVersion.IsSet && threeDSVersion.Value == null) + throw new ArgumentNullException(nameof(threeDSVersion), "Property is not nullable for class ThreeDSRequestData."); + + return new ThreeDSRequestData(challengeWindowSize, dataOnly, nativeThreeDS, threeDSVersion); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ThreeDSRequestData threeDSRequestData, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.ChallengeWindowSize.GetHashCode(); - hashCode = (hashCode * 59) + this.DataOnly.GetHashCode(); - hashCode = (hashCode * 59) + this.NativeThreeDS.GetHashCode(); - hashCode = (hashCode * 59) + this.ThreeDSVersion.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, threeDSRequestData, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ThreeDSRequestData threeDSRequestData, JsonSerializerOptions jsonSerializerOptions) { - yield break; + var challengeWindowSizeRawValue = ThreeDSRequestData.ChallengeWindowSizeEnumToJsonValue(threeDSRequestData.ChallengeWindowSizeOption.Value.Value); + writer.WriteString("challengeWindowSize", challengeWindowSizeRawValue); + var dataOnlyRawValue = ThreeDSRequestData.DataOnlyEnumToJsonValue(threeDSRequestData.DataOnlyOption.Value.Value); + writer.WriteString("dataOnly", dataOnlyRawValue); + var nativeThreeDSRawValue = ThreeDSRequestData.NativeThreeDSEnumToJsonValue(threeDSRequestData.NativeThreeDSOption.Value.Value); + writer.WriteString("nativeThreeDS", nativeThreeDSRawValue); + var threeDSVersionRawValue = ThreeDSRequestData.ThreeDSVersionEnumToJsonValue(threeDSRequestData.ThreeDSVersionOption.Value.Value); + writer.WriteString("threeDSVersion", threeDSVersionRawValue); } } - } diff --git a/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs b/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs index a4574f947..000286420 100644 --- a/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs +++ b/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,101 +14,201 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ThreeDSRequestorAuthenticationInfo /// - [DataContract(Name = "ThreeDSRequestorAuthenticationInfo")] - public partial class ThreeDSRequestorAuthenticationInfo : IEquatable, IValidatableObject + public partial class ThreeDSRequestorAuthenticationInfo : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. + /// Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator. + /// Date and time in UTC of the cardholder authentication. Format: YYYYMMDDHHMM + [JsonConstructor] + public ThreeDSRequestorAuthenticationInfo(Option threeDSReqAuthData = default, Option threeDSReqAuthMethod = default, Option threeDSReqAuthTimestamp = default) + { + ThreeDSReqAuthDataOption = threeDSReqAuthData; + ThreeDSReqAuthMethodOption = threeDSReqAuthMethod; + ThreeDSReqAuthTimestampOption = threeDSReqAuthTimestamp; + OnCreated(); + } + + partial void OnCreated(); + /// /// Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator. /// /// Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator. - [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSReqAuthMethodEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// - [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// - [EnumMember(Value = "06")] _06 = 6 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ThreeDSReqAuthMethodEnum ThreeDSReqAuthMethodEnumFromString(string value) + { + if (value.Equals("01")) + return ThreeDSReqAuthMethodEnum._01; + + if (value.Equals("02")) + return ThreeDSReqAuthMethodEnum._02; + + if (value.Equals("03")) + return ThreeDSReqAuthMethodEnum._03; + + if (value.Equals("04")) + return ThreeDSReqAuthMethodEnum._04; + + if (value.Equals("05")) + return ThreeDSReqAuthMethodEnum._05; + + if (value.Equals("06")) + return ThreeDSReqAuthMethodEnum._06; + + throw new NotImplementedException($"Could not convert value to type ThreeDSReqAuthMethodEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ThreeDSReqAuthMethodEnum? ThreeDSReqAuthMethodEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ThreeDSReqAuthMethodEnum._01; + + if (value.Equals("02")) + return ThreeDSReqAuthMethodEnum._02; + + if (value.Equals("03")) + return ThreeDSReqAuthMethodEnum._03; + + if (value.Equals("04")) + return ThreeDSReqAuthMethodEnum._04; + if (value.Equals("05")) + return ThreeDSReqAuthMethodEnum._05; + + if (value.Equals("06")) + return ThreeDSReqAuthMethodEnum._06; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ThreeDSReqAuthMethodEnumToJsonValue(ThreeDSReqAuthMethodEnum? value) + { + if (value == ThreeDSReqAuthMethodEnum._01) + return "01"; + + if (value == ThreeDSReqAuthMethodEnum._02) + return "02"; + + if (value == ThreeDSReqAuthMethodEnum._03) + return "03"; + + if (value == ThreeDSReqAuthMethodEnum._04) + return "04"; + + if (value == ThreeDSReqAuthMethodEnum._05) + return "05"; + + if (value == ThreeDSReqAuthMethodEnum._06) + return "06"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of ThreeDSReqAuthMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSReqAuthMethodOption { get; private set; } /// /// Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator. /// /// Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator. - [DataMember(Name = "threeDSReqAuthMethod", EmitDefaultValue = false)] - public ThreeDSReqAuthMethodEnum? ThreeDSReqAuthMethod { get; set; } + [JsonPropertyName("threeDSReqAuthMethod")] + public ThreeDSReqAuthMethodEnum? ThreeDSReqAuthMethod { get { return this.ThreeDSReqAuthMethodOption; } set { this.ThreeDSReqAuthMethodOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of ThreeDSReqAuthData /// - /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes.. - /// Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator.. - /// Date and time in UTC of the cardholder authentication. Format: YYYYMMDDHHMM. - public ThreeDSRequestorAuthenticationInfo(string threeDSReqAuthData = default(string), ThreeDSReqAuthMethodEnum? threeDSReqAuthMethod = default(ThreeDSReqAuthMethodEnum?), string threeDSReqAuthTimestamp = default(string)) - { - this.ThreeDSReqAuthData = threeDSReqAuthData; - this.ThreeDSReqAuthMethod = threeDSReqAuthMethod; - this.ThreeDSReqAuthTimestamp = threeDSReqAuthTimestamp; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSReqAuthDataOption { get; private set; } /// /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. /// /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. - [DataMember(Name = "threeDSReqAuthData", EmitDefaultValue = false)] - public string ThreeDSReqAuthData { get; set; } + [JsonPropertyName("threeDSReqAuthData")] + public string ThreeDSReqAuthData { get { return this.ThreeDSReqAuthDataOption; } set { this.ThreeDSReqAuthDataOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSReqAuthTimestamp + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSReqAuthTimestampOption { get; private set; } /// /// Date and time in UTC of the cardholder authentication. Format: YYYYMMDDHHMM /// /// Date and time in UTC of the cardholder authentication. Format: YYYYMMDDHHMM - [DataMember(Name = "threeDSReqAuthTimestamp", EmitDefaultValue = false)] - public string ThreeDSReqAuthTimestamp { get; set; } + [JsonPropertyName("threeDSReqAuthTimestamp")] + public string ThreeDSReqAuthTimestamp { get { return this.ThreeDSReqAuthTimestampOption; } set { this.ThreeDSReqAuthTimestampOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -127,94 +226,135 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // ThreeDSReqAuthTimestamp (string) maxLength + if (this.ThreeDSReqAuthTimestamp != null && this.ThreeDSReqAuthTimestamp.Length > 12) + { + yield return new ValidationResult("Invalid value for ThreeDSReqAuthTimestamp, length must be less than 12.", new [] { "ThreeDSReqAuthTimestamp" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ThreeDSRequestorAuthenticationInfo); + // ThreeDSReqAuthTimestamp (string) minLength + if (this.ThreeDSReqAuthTimestamp != null && this.ThreeDSReqAuthTimestamp.Length < 12) + { + yield return new ValidationResult("Invalid value for ThreeDSReqAuthTimestamp, length must be greater than 12.", new [] { "ThreeDSReqAuthTimestamp" }); + } + + yield break; } + } + /// + /// A Json converter for type + /// + public class ThreeDSRequestorAuthenticationInfoJsonConverter : JsonConverter + { /// - /// Returns true if ThreeDSRequestorAuthenticationInfo instances are equal + /// Deserializes json to /// - /// Instance of ThreeDSRequestorAuthenticationInfo to be compared - /// Boolean - public bool Equals(ThreeDSRequestorAuthenticationInfo input) + /// + /// + /// + /// + /// + public override ThreeDSRequestorAuthenticationInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option threeDSReqAuthData = default; + Option threeDSReqAuthMethod = default; + Option threeDSReqAuthTimestamp = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "threeDSReqAuthData": + threeDSReqAuthData = new Option(utf8JsonReader.GetString()); + break; + case "threeDSReqAuthMethod": + string threeDSReqAuthMethodRawValue = utf8JsonReader.GetString(); + if (threeDSReqAuthMethodRawValue != null) + threeDSReqAuthMethod = new Option(ThreeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodEnumFromStringOrDefault(threeDSReqAuthMethodRawValue)); + break; + case "threeDSReqAuthTimestamp": + threeDSReqAuthTimestamp = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.ThreeDSReqAuthData == input.ThreeDSReqAuthData || - (this.ThreeDSReqAuthData != null && - this.ThreeDSReqAuthData.Equals(input.ThreeDSReqAuthData)) - ) && - ( - this.ThreeDSReqAuthMethod == input.ThreeDSReqAuthMethod || - this.ThreeDSReqAuthMethod.Equals(input.ThreeDSReqAuthMethod) - ) && - ( - this.ThreeDSReqAuthTimestamp == input.ThreeDSReqAuthTimestamp || - (this.ThreeDSReqAuthTimestamp != null && - this.ThreeDSReqAuthTimestamp.Equals(input.ThreeDSReqAuthTimestamp)) - ); + + if (threeDSReqAuthData.IsSet && threeDSReqAuthData.Value == null) + throw new ArgumentNullException(nameof(threeDSReqAuthData), "Property is not nullable for class ThreeDSRequestorAuthenticationInfo."); + + if (threeDSReqAuthMethod.IsSet && threeDSReqAuthMethod.Value == null) + throw new ArgumentNullException(nameof(threeDSReqAuthMethod), "Property is not nullable for class ThreeDSRequestorAuthenticationInfo."); + + if (threeDSReqAuthTimestamp.IsSet && threeDSReqAuthTimestamp.Value == null) + throw new ArgumentNullException(nameof(threeDSReqAuthTimestamp), "Property is not nullable for class ThreeDSRequestorAuthenticationInfo."); + + return new ThreeDSRequestorAuthenticationInfo(threeDSReqAuthData, threeDSReqAuthMethod, threeDSReqAuthTimestamp); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ThreeDSReqAuthData != null) - { - hashCode = (hashCode * 59) + this.ThreeDSReqAuthData.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ThreeDSReqAuthMethod.GetHashCode(); - if (this.ThreeDSReqAuthTimestamp != null) - { - hashCode = (hashCode * 59) + this.ThreeDSReqAuthTimestamp.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, threeDSRequestorAuthenticationInfo, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo, JsonSerializerOptions jsonSerializerOptions) { - // ThreeDSReqAuthTimestamp (string) maxLength - if (this.ThreeDSReqAuthTimestamp != null && this.ThreeDSReqAuthTimestamp.Length > 12) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSReqAuthTimestamp, length must be less than 12.", new [] { "ThreeDSReqAuthTimestamp" }); - } + if (threeDSRequestorAuthenticationInfo.ThreeDSReqAuthDataOption.IsSet && threeDSRequestorAuthenticationInfo.ThreeDSReqAuthData == null) + throw new ArgumentNullException(nameof(threeDSRequestorAuthenticationInfo.ThreeDSReqAuthData), "Property is required for class ThreeDSRequestorAuthenticationInfo."); - // ThreeDSReqAuthTimestamp (string) minLength - if (this.ThreeDSReqAuthTimestamp != null && this.ThreeDSReqAuthTimestamp.Length < 12) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSReqAuthTimestamp, length must be greater than 12.", new [] { "ThreeDSReqAuthTimestamp" }); - } + if (threeDSRequestorAuthenticationInfo.ThreeDSReqAuthTimestampOption.IsSet && threeDSRequestorAuthenticationInfo.ThreeDSReqAuthTimestamp == null) + throw new ArgumentNullException(nameof(threeDSRequestorAuthenticationInfo.ThreeDSReqAuthTimestamp), "Property is required for class ThreeDSRequestorAuthenticationInfo."); - yield break; + if (threeDSRequestorAuthenticationInfo.ThreeDSReqAuthDataOption.IsSet) + writer.WriteString("threeDSReqAuthData", threeDSRequestorAuthenticationInfo.ThreeDSReqAuthData); + + var threeDSReqAuthMethodRawValue = ThreeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodEnumToJsonValue(threeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodOption.Value.Value); + writer.WriteString("threeDSReqAuthMethod", threeDSReqAuthMethodRawValue); + if (threeDSRequestorAuthenticationInfo.ThreeDSReqAuthTimestampOption.IsSet) + writer.WriteString("threeDSReqAuthTimestamp", threeDSRequestorAuthenticationInfo.ThreeDSReqAuthTimestamp); } } - } diff --git a/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs b/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs index 25f873932..abb3d6035 100644 --- a/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs +++ b/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,98 +14,189 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ThreeDSRequestorPriorAuthenticationInfo /// - [DataContract(Name = "ThreeDSRequestorPriorAuthenticationInfo")] - public partial class ThreeDSRequestorPriorAuthenticationInfo : IEquatable, IValidatableObject + public partial class ThreeDSRequestorPriorAuthenticationInfo : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. + /// Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods. + /// Date and time in UTC of the prior cardholder authentication. Format: YYYYMMDDHHMM + /// This data element provides additional information to the ACS to determine the best approach for handing a request. This data element contains an ACS Transaction ID for a prior authenticated transaction. For example, the first recurring transaction that was authenticated with the cardholder. Length: 30 characters. + [JsonConstructor] + public ThreeDSRequestorPriorAuthenticationInfo(Option threeDSReqPriorAuthData = default, Option threeDSReqPriorAuthMethod = default, Option threeDSReqPriorAuthTimestamp = default, Option threeDSReqPriorRef = default) + { + ThreeDSReqPriorAuthDataOption = threeDSReqPriorAuthData; + ThreeDSReqPriorAuthMethodOption = threeDSReqPriorAuthMethod; + ThreeDSReqPriorAuthTimestampOption = threeDSReqPriorAuthTimestamp; + ThreeDSReqPriorRefOption = threeDSReqPriorRef; + OnCreated(); + } + + partial void OnCreated(); + /// /// Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods. /// /// Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods. - [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSReqPriorAuthMethodEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ThreeDSReqPriorAuthMethodEnum ThreeDSReqPriorAuthMethodEnumFromString(string value) + { + if (value.Equals("01")) + return ThreeDSReqPriorAuthMethodEnum._01; + + if (value.Equals("02")) + return ThreeDSReqPriorAuthMethodEnum._02; + + if (value.Equals("03")) + return ThreeDSReqPriorAuthMethodEnum._03; + + if (value.Equals("04")) + return ThreeDSReqPriorAuthMethodEnum._04; + throw new NotImplementedException($"Could not convert value to type ThreeDSReqPriorAuthMethodEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static ThreeDSReqPriorAuthMethodEnum? ThreeDSReqPriorAuthMethodEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ThreeDSReqPriorAuthMethodEnum._01; + + if (value.Equals("02")) + return ThreeDSReqPriorAuthMethodEnum._02; + + if (value.Equals("03")) + return ThreeDSReqPriorAuthMethodEnum._03; + + if (value.Equals("04")) + return ThreeDSReqPriorAuthMethodEnum._04; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ThreeDSReqPriorAuthMethodEnumToJsonValue(ThreeDSReqPriorAuthMethodEnum? value) + { + if (value == ThreeDSReqPriorAuthMethodEnum._01) + return "01"; + + if (value == ThreeDSReqPriorAuthMethodEnum._02) + return "02"; + + if (value == ThreeDSReqPriorAuthMethodEnum._03) + return "03"; + + if (value == ThreeDSReqPriorAuthMethodEnum._04) + return "04"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ThreeDSReqPriorAuthMethod + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSReqPriorAuthMethodOption { get; private set; } /// /// Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods. /// /// Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods. - [DataMember(Name = "threeDSReqPriorAuthMethod", EmitDefaultValue = false)] - public ThreeDSReqPriorAuthMethodEnum? ThreeDSReqPriorAuthMethod { get; set; } + [JsonPropertyName("threeDSReqPriorAuthMethod")] + public ThreeDSReqPriorAuthMethodEnum? ThreeDSReqPriorAuthMethod { get { return this.ThreeDSReqPriorAuthMethodOption; } set { this.ThreeDSReqPriorAuthMethodOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of ThreeDSReqPriorAuthData /// - /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes.. - /// Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods.. - /// Date and time in UTC of the prior cardholder authentication. Format: YYYYMMDDHHMM. - /// This data element provides additional information to the ACS to determine the best approach for handing a request. This data element contains an ACS Transaction ID for a prior authenticated transaction. For example, the first recurring transaction that was authenticated with the cardholder. Length: 30 characters.. - public ThreeDSRequestorPriorAuthenticationInfo(string threeDSReqPriorAuthData = default(string), ThreeDSReqPriorAuthMethodEnum? threeDSReqPriorAuthMethod = default(ThreeDSReqPriorAuthMethodEnum?), string threeDSReqPriorAuthTimestamp = default(string), string threeDSReqPriorRef = default(string)) - { - this.ThreeDSReqPriorAuthData = threeDSReqPriorAuthData; - this.ThreeDSReqPriorAuthMethod = threeDSReqPriorAuthMethod; - this.ThreeDSReqPriorAuthTimestamp = threeDSReqPriorAuthTimestamp; - this.ThreeDSReqPriorRef = threeDSReqPriorRef; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSReqPriorAuthDataOption { get; private set; } /// /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. /// /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. - [DataMember(Name = "threeDSReqPriorAuthData", EmitDefaultValue = false)] - public string ThreeDSReqPriorAuthData { get; set; } + [JsonPropertyName("threeDSReqPriorAuthData")] + public string ThreeDSReqPriorAuthData { get { return this.ThreeDSReqPriorAuthDataOption; } set { this.ThreeDSReqPriorAuthDataOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSReqPriorAuthTimestamp + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSReqPriorAuthTimestampOption { get; private set; } /// /// Date and time in UTC of the prior cardholder authentication. Format: YYYYMMDDHHMM /// /// Date and time in UTC of the prior cardholder authentication. Format: YYYYMMDDHHMM - [DataMember(Name = "threeDSReqPriorAuthTimestamp", EmitDefaultValue = false)] - public string ThreeDSReqPriorAuthTimestamp { get; set; } + [JsonPropertyName("threeDSReqPriorAuthTimestamp")] + public string ThreeDSReqPriorAuthTimestamp { get { return this.ThreeDSReqPriorAuthTimestampOption; } set { this.ThreeDSReqPriorAuthTimestampOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSReqPriorRef + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSReqPriorRefOption { get; private set; } /// /// This data element provides additional information to the ACS to determine the best approach for handing a request. This data element contains an ACS Transaction ID for a prior authenticated transaction. For example, the first recurring transaction that was authenticated with the cardholder. Length: 30 characters. /// /// This data element provides additional information to the ACS to determine the best approach for handing a request. This data element contains an ACS Transaction ID for a prior authenticated transaction. For example, the first recurring transaction that was authenticated with the cardholder. Length: 30 characters. - [DataMember(Name = "threeDSReqPriorRef", EmitDefaultValue = false)] - public string ThreeDSReqPriorRef { get; set; } + [JsonPropertyName("threeDSReqPriorRef")] + public string ThreeDSReqPriorRef { get { return this.ThreeDSReqPriorRefOption; } set { this.ThreeDSReqPriorRefOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -124,116 +214,161 @@ public override string ToString() return sb.ToString(); } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ThreeDSRequestorPriorAuthenticationInfo); - } - - /// - /// Returns true if ThreeDSRequestorPriorAuthenticationInfo instances are equal - /// - /// Instance of ThreeDSRequestorPriorAuthenticationInfo to be compared - /// Boolean - public bool Equals(ThreeDSRequestorPriorAuthenticationInfo input) - { - if (input == null) - { - return false; - } - return - ( - this.ThreeDSReqPriorAuthData == input.ThreeDSReqPriorAuthData || - (this.ThreeDSReqPriorAuthData != null && - this.ThreeDSReqPriorAuthData.Equals(input.ThreeDSReqPriorAuthData)) - ) && - ( - this.ThreeDSReqPriorAuthMethod == input.ThreeDSReqPriorAuthMethod || - this.ThreeDSReqPriorAuthMethod.Equals(input.ThreeDSReqPriorAuthMethod) - ) && - ( - this.ThreeDSReqPriorAuthTimestamp == input.ThreeDSReqPriorAuthTimestamp || - (this.ThreeDSReqPriorAuthTimestamp != null && - this.ThreeDSReqPriorAuthTimestamp.Equals(input.ThreeDSReqPriorAuthTimestamp)) - ) && - ( - this.ThreeDSReqPriorRef == input.ThreeDSReqPriorRef || - (this.ThreeDSReqPriorRef != null && - this.ThreeDSReqPriorRef.Equals(input.ThreeDSReqPriorRef)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ThreeDSReqPriorAuthData != null) - { - hashCode = (hashCode * 59) + this.ThreeDSReqPriorAuthData.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ThreeDSReqPriorAuthMethod.GetHashCode(); - if (this.ThreeDSReqPriorAuthTimestamp != null) - { - hashCode = (hashCode * 59) + this.ThreeDSReqPriorAuthTimestamp.GetHashCode(); - } - if (this.ThreeDSReqPriorRef != null) - { - hashCode = (hashCode * 59) + this.ThreeDSReqPriorRef.GetHashCode(); - } - return hashCode; - } - } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // ThreeDSReqPriorAuthTimestamp (string) maxLength if (this.ThreeDSReqPriorAuthTimestamp != null && this.ThreeDSReqPriorAuthTimestamp.Length > 12) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSReqPriorAuthTimestamp, length must be less than 12.", new [] { "ThreeDSReqPriorAuthTimestamp" }); + yield return new ValidationResult("Invalid value for ThreeDSReqPriorAuthTimestamp, length must be less than 12.", new [] { "ThreeDSReqPriorAuthTimestamp" }); } // ThreeDSReqPriorAuthTimestamp (string) minLength if (this.ThreeDSReqPriorAuthTimestamp != null && this.ThreeDSReqPriorAuthTimestamp.Length < 12) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSReqPriorAuthTimestamp, length must be greater than 12.", new [] { "ThreeDSReqPriorAuthTimestamp" }); + yield return new ValidationResult("Invalid value for ThreeDSReqPriorAuthTimestamp, length must be greater than 12.", new [] { "ThreeDSReqPriorAuthTimestamp" }); } // ThreeDSReqPriorRef (string) maxLength if (this.ThreeDSReqPriorRef != null && this.ThreeDSReqPriorRef.Length > 36) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSReqPriorRef, length must be less than 36.", new [] { "ThreeDSReqPriorRef" }); + yield return new ValidationResult("Invalid value for ThreeDSReqPriorRef, length must be less than 36.", new [] { "ThreeDSReqPriorRef" }); } // ThreeDSReqPriorRef (string) minLength if (this.ThreeDSReqPriorRef != null && this.ThreeDSReqPriorRef.Length < 36) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSReqPriorRef, length must be greater than 36.", new [] { "ThreeDSReqPriorRef" }); + yield return new ValidationResult("Invalid value for ThreeDSReqPriorRef, length must be greater than 36.", new [] { "ThreeDSReqPriorRef" }); } yield break; } } + /// + /// A Json converter for type + /// + public class ThreeDSRequestorPriorAuthenticationInfoJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ThreeDSRequestorPriorAuthenticationInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option threeDSReqPriorAuthData = default; + Option threeDSReqPriorAuthMethod = default; + Option threeDSReqPriorAuthTimestamp = default; + Option threeDSReqPriorRef = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "threeDSReqPriorAuthData": + threeDSReqPriorAuthData = new Option(utf8JsonReader.GetString()); + break; + case "threeDSReqPriorAuthMethod": + string threeDSReqPriorAuthMethodRawValue = utf8JsonReader.GetString(); + if (threeDSReqPriorAuthMethodRawValue != null) + threeDSReqPriorAuthMethod = new Option(ThreeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodEnumFromStringOrDefault(threeDSReqPriorAuthMethodRawValue)); + break; + case "threeDSReqPriorAuthTimestamp": + threeDSReqPriorAuthTimestamp = new Option(utf8JsonReader.GetString()); + break; + case "threeDSReqPriorRef": + threeDSReqPriorRef = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (threeDSReqPriorAuthData.IsSet && threeDSReqPriorAuthData.Value == null) + throw new ArgumentNullException(nameof(threeDSReqPriorAuthData), "Property is not nullable for class ThreeDSRequestorPriorAuthenticationInfo."); + + if (threeDSReqPriorAuthMethod.IsSet && threeDSReqPriorAuthMethod.Value == null) + throw new ArgumentNullException(nameof(threeDSReqPriorAuthMethod), "Property is not nullable for class ThreeDSRequestorPriorAuthenticationInfo."); + + if (threeDSReqPriorAuthTimestamp.IsSet && threeDSReqPriorAuthTimestamp.Value == null) + throw new ArgumentNullException(nameof(threeDSReqPriorAuthTimestamp), "Property is not nullable for class ThreeDSRequestorPriorAuthenticationInfo."); + + if (threeDSReqPriorRef.IsSet && threeDSReqPriorRef.Value == null) + throw new ArgumentNullException(nameof(threeDSReqPriorRef), "Property is not nullable for class ThreeDSRequestorPriorAuthenticationInfo."); + + return new ThreeDSRequestorPriorAuthenticationInfo(threeDSReqPriorAuthData, threeDSReqPriorAuthMethod, threeDSReqPriorAuthTimestamp, threeDSReqPriorRef); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, threeDSRequestorPriorAuthenticationInfo, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo, JsonSerializerOptions jsonSerializerOptions) + { + if (threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthDataOption.IsSet && threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthData == null) + throw new ArgumentNullException(nameof(threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthData), "Property is required for class ThreeDSRequestorPriorAuthenticationInfo."); + + if (threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthTimestampOption.IsSet && threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthTimestamp == null) + throw new ArgumentNullException(nameof(threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthTimestamp), "Property is required for class ThreeDSRequestorPriorAuthenticationInfo."); + + if (threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorRefOption.IsSet && threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorRef == null) + throw new ArgumentNullException(nameof(threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorRef), "Property is required for class ThreeDSRequestorPriorAuthenticationInfo."); + + if (threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthDataOption.IsSet) + writer.WriteString("threeDSReqPriorAuthData", threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthData); + + var threeDSReqPriorAuthMethodRawValue = ThreeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodEnumToJsonValue(threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodOption.Value.Value); + writer.WriteString("threeDSReqPriorAuthMethod", threeDSReqPriorAuthMethodRawValue); + if (threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthTimestampOption.IsSet) + writer.WriteString("threeDSReqPriorAuthTimestamp", threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthTimestamp); + + if (threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorRefOption.IsSet) + writer.WriteString("threeDSReqPriorRef", threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorRef); + } + } } diff --git a/Adyen/Model/Checkout/ThreeDSecureData.cs b/Adyen/Model/Checkout/ThreeDSecureData.cs index 9688f6845..443df7aee 100644 --- a/Adyen/Model/Checkout/ThreeDSecureData.cs +++ b/Adyen/Model/Checkout/ThreeDSecureData.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,278 +14,605 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ThreeDSecureData /// - [DataContract(Name = "ThreeDSecureData")] - public partial class ThreeDSecureData : IEquatable, IValidatableObject + public partial class ThreeDSecureData : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. + /// The cardholder authentication value (base64 encoded, 20 bytes in a decoded form). + /// The CAVV algorithm used. Include this only for 3D Secure 1. + /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). + /// In 3D Secure 2, this is the `transStatus` from the `ARes`. + /// Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction. + /// The electronic commerce indicator. + /// Risk score calculated by Directory Server (DS). Required for Cartes Bancaires integrations. + /// The version of the 3D Secure protocol. + /// Network token authentication verification value (TAVV). The network token cryptogram. + /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). + /// Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form). + [JsonConstructor] + public ThreeDSecureData(Option authenticationResponse = default, Option cavv = default, Option cavvAlgorithm = default, Option challengeCancel = default, Option directoryResponse = default, Option dsTransID = default, Option eci = default, Option riskScore = default, Option threeDSVersion = default, Option tokenAuthenticationVerificationValue = default, Option transStatusReason = default, Option xid = default) + { + AuthenticationResponseOption = authenticationResponse; + CavvOption = cavv; + CavvAlgorithmOption = cavvAlgorithm; + ChallengeCancelOption = challengeCancel; + DirectoryResponseOption = directoryResponse; + DsTransIDOption = dsTransID; + EciOption = eci; + RiskScoreOption = riskScore; + ThreeDSVersionOption = threeDSVersion; + TokenAuthenticationVerificationValueOption = tokenAuthenticationVerificationValue; + TransStatusReasonOption = transStatusReason; + XidOption = xid; + OnCreated(); + } + + partial void OnCreated(); + /// /// In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. /// /// In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. - [JsonConverter(typeof(StringEnumConverter))] public enum AuthenticationResponseEnum { /// /// Enum Y for value: Y /// - [EnumMember(Value = "Y")] Y = 1, /// /// Enum N for value: N /// - [EnumMember(Value = "N")] N = 2, /// /// Enum U for value: U /// - [EnumMember(Value = "U")] U = 3, /// /// Enum A for value: A /// - [EnumMember(Value = "A")] A = 4 + } + + /// + /// Returns a + /// + /// + /// + /// + public static AuthenticationResponseEnum AuthenticationResponseEnumFromString(string value) + { + if (value.Equals("Y")) + return AuthenticationResponseEnum.Y; + + if (value.Equals("N")) + return AuthenticationResponseEnum.N; + + if (value.Equals("U")) + return AuthenticationResponseEnum.U; + if (value.Equals("A")) + return AuthenticationResponseEnum.A; + + throw new NotImplementedException($"Could not convert value to type AuthenticationResponseEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static AuthenticationResponseEnum? AuthenticationResponseEnumFromStringOrDefault(string value) + { + if (value.Equals("Y")) + return AuthenticationResponseEnum.Y; + + if (value.Equals("N")) + return AuthenticationResponseEnum.N; + + if (value.Equals("U")) + return AuthenticationResponseEnum.U; + + if (value.Equals("A")) + return AuthenticationResponseEnum.A; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string AuthenticationResponseEnumToJsonValue(AuthenticationResponseEnum? value) + { + if (value == AuthenticationResponseEnum.Y) + return "Y"; + + if (value == AuthenticationResponseEnum.N) + return "N"; + + if (value == AuthenticationResponseEnum.U) + return "U"; + + if (value == AuthenticationResponseEnum.A) + return "A"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of AuthenticationResponse + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AuthenticationResponseOption { get; private set; } /// /// In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. /// /// In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. - [DataMember(Name = "authenticationResponse", EmitDefaultValue = false)] - public AuthenticationResponseEnum? AuthenticationResponse { get; set; } + [JsonPropertyName("authenticationResponse")] + public AuthenticationResponseEnum? AuthenticationResponse { get { return this.AuthenticationResponseOption; } set { this.AuthenticationResponseOption = new Option(value); } } + /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). - [JsonConverter(typeof(StringEnumConverter))] public enum ChallengeCancelEnum { /// /// Enum _01 for value: 01 /// - [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// - [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// - [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// - [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// - [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// - [EnumMember(Value = "06")] _06 = 6, /// /// Enum _07 for value: 07 /// - [EnumMember(Value = "07")] _07 = 7 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ChallengeCancelEnum ChallengeCancelEnumFromString(string value) + { + if (value.Equals("01")) + return ChallengeCancelEnum._01; + + if (value.Equals("02")) + return ChallengeCancelEnum._02; + if (value.Equals("03")) + return ChallengeCancelEnum._03; + + if (value.Equals("04")) + return ChallengeCancelEnum._04; + + if (value.Equals("05")) + return ChallengeCancelEnum._05; + + if (value.Equals("06")) + return ChallengeCancelEnum._06; + + if (value.Equals("07")) + return ChallengeCancelEnum._07; + + throw new NotImplementedException($"Could not convert value to type ChallengeCancelEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static ChallengeCancelEnum? ChallengeCancelEnumFromStringOrDefault(string value) + { + if (value.Equals("01")) + return ChallengeCancelEnum._01; + + if (value.Equals("02")) + return ChallengeCancelEnum._02; + + if (value.Equals("03")) + return ChallengeCancelEnum._03; + + if (value.Equals("04")) + return ChallengeCancelEnum._04; + + if (value.Equals("05")) + return ChallengeCancelEnum._05; + + if (value.Equals("06")) + return ChallengeCancelEnum._06; + + if (value.Equals("07")) + return ChallengeCancelEnum._07; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ChallengeCancelEnumToJsonValue(ChallengeCancelEnum? value) + { + if (value == ChallengeCancelEnum._01) + return "01"; + + if (value == ChallengeCancelEnum._02) + return "02"; + + if (value == ChallengeCancelEnum._03) + return "03"; + + if (value == ChallengeCancelEnum._04) + return "04"; + + if (value == ChallengeCancelEnum._05) + return "05"; + + if (value == ChallengeCancelEnum._06) + return "06"; + + if (value == ChallengeCancelEnum._07) + return "07"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ChallengeCancel + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ChallengeCancelOption { get; private set; } /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). - [DataMember(Name = "challengeCancel", EmitDefaultValue = false)] - public ChallengeCancelEnum? ChallengeCancel { get; set; } + [JsonPropertyName("challengeCancel")] + public ChallengeCancelEnum? ChallengeCancel { get { return this.ChallengeCancelOption; } set { this.ChallengeCancelOption = new Option(value); } } + /// /// In 3D Secure 2, this is the `transStatus` from the `ARes`. /// /// In 3D Secure 2, this is the `transStatus` from the `ARes`. - [JsonConverter(typeof(StringEnumConverter))] public enum DirectoryResponseEnum { /// /// Enum A for value: A /// - [EnumMember(Value = "A")] A = 1, /// /// Enum C for value: C /// - [EnumMember(Value = "C")] C = 2, /// /// Enum D for value: D /// - [EnumMember(Value = "D")] D = 3, /// /// Enum I for value: I /// - [EnumMember(Value = "I")] I = 4, /// /// Enum N for value: N /// - [EnumMember(Value = "N")] N = 5, /// /// Enum R for value: R /// - [EnumMember(Value = "R")] R = 6, /// /// Enum U for value: U /// - [EnumMember(Value = "U")] U = 7, /// /// Enum Y for value: Y /// - [EnumMember(Value = "Y")] Y = 8 + } + + /// + /// Returns a + /// + /// + /// + /// + public static DirectoryResponseEnum DirectoryResponseEnumFromString(string value) + { + if (value.Equals("A")) + return DirectoryResponseEnum.A; + + if (value.Equals("C")) + return DirectoryResponseEnum.C; + + if (value.Equals("D")) + return DirectoryResponseEnum.D; + + if (value.Equals("I")) + return DirectoryResponseEnum.I; + + if (value.Equals("N")) + return DirectoryResponseEnum.N; + + if (value.Equals("R")) + return DirectoryResponseEnum.R; + + if (value.Equals("U")) + return DirectoryResponseEnum.U; + + if (value.Equals("Y")) + return DirectoryResponseEnum.Y; + + throw new NotImplementedException($"Could not convert value to type DirectoryResponseEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static DirectoryResponseEnum? DirectoryResponseEnumFromStringOrDefault(string value) + { + if (value.Equals("A")) + return DirectoryResponseEnum.A; + + if (value.Equals("C")) + return DirectoryResponseEnum.C; + + if (value.Equals("D")) + return DirectoryResponseEnum.D; + + if (value.Equals("I")) + return DirectoryResponseEnum.I; + + if (value.Equals("N")) + return DirectoryResponseEnum.N; + + if (value.Equals("R")) + return DirectoryResponseEnum.R; + + if (value.Equals("U")) + return DirectoryResponseEnum.U; + + if (value.Equals("Y")) + return DirectoryResponseEnum.Y; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string DirectoryResponseEnumToJsonValue(DirectoryResponseEnum? value) + { + if (value == DirectoryResponseEnum.A) + return "A"; + + if (value == DirectoryResponseEnum.C) + return "C"; + + if (value == DirectoryResponseEnum.D) + return "D"; + + if (value == DirectoryResponseEnum.I) + return "I"; + + if (value == DirectoryResponseEnum.N) + return "N"; + if (value == DirectoryResponseEnum.R) + return "R"; + + if (value == DirectoryResponseEnum.U) + return "U"; + + if (value == DirectoryResponseEnum.Y) + return "Y"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Used to track the state of DirectoryResponse + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DirectoryResponseOption { get; private set; } /// /// In 3D Secure 2, this is the `transStatus` from the `ARes`. /// /// In 3D Secure 2, this is the `transStatus` from the `ARes`. - [DataMember(Name = "directoryResponse", EmitDefaultValue = false)] - public DirectoryResponseEnum? DirectoryResponse { get; set; } + [JsonPropertyName("directoryResponse")] + public DirectoryResponseEnum? DirectoryResponse { get { return this.DirectoryResponseOption; } set { this.DirectoryResponseOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of Cavv /// - /// In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. . - /// The cardholder authentication value (base64 encoded, 20 bytes in a decoded form).. - /// The CAVV algorithm used. Include this only for 3D Secure 1.. - /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata).. - /// In 3D Secure 2, this is the `transStatus` from the `ARes`. . - /// Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction.. - /// The electronic commerce indicator.. - /// Risk score calculated by Directory Server (DS). Required for Cartes Bancaires integrations.. - /// The version of the 3D Secure protocol.. - /// Network token authentication verification value (TAVV). The network token cryptogram.. - /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values).. - /// Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form).. - public ThreeDSecureData(AuthenticationResponseEnum? authenticationResponse = default(AuthenticationResponseEnum?), byte[] cavv = default(byte[]), string cavvAlgorithm = default(string), ChallengeCancelEnum? challengeCancel = default(ChallengeCancelEnum?), DirectoryResponseEnum? directoryResponse = default(DirectoryResponseEnum?), string dsTransID = default(string), string eci = default(string), string riskScore = default(string), string threeDSVersion = default(string), byte[] tokenAuthenticationVerificationValue = default(byte[]), string transStatusReason = default(string), byte[] xid = default(byte[])) - { - this.AuthenticationResponse = authenticationResponse; - this.Cavv = cavv; - this.CavvAlgorithm = cavvAlgorithm; - this.ChallengeCancel = challengeCancel; - this.DirectoryResponse = directoryResponse; - this.DsTransID = dsTransID; - this.Eci = eci; - this.RiskScore = riskScore; - this.ThreeDSVersion = threeDSVersion; - this.TokenAuthenticationVerificationValue = tokenAuthenticationVerificationValue; - this.TransStatusReason = transStatusReason; - this.Xid = xid; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CavvOption { get; private set; } /// /// The cardholder authentication value (base64 encoded, 20 bytes in a decoded form). /// /// The cardholder authentication value (base64 encoded, 20 bytes in a decoded form). - [DataMember(Name = "cavv", EmitDefaultValue = false)] - public byte[] Cavv { get; set; } + [JsonPropertyName("cavv")] + public byte[] Cavv { get { return this.CavvOption; } set { this.CavvOption = new Option(value); } } + + /// + /// Used to track the state of CavvAlgorithm + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CavvAlgorithmOption { get; private set; } /// /// The CAVV algorithm used. Include this only for 3D Secure 1. /// /// The CAVV algorithm used. Include this only for 3D Secure 1. - [DataMember(Name = "cavvAlgorithm", EmitDefaultValue = false)] - public string CavvAlgorithm { get; set; } + [JsonPropertyName("cavvAlgorithm")] + public string CavvAlgorithm { get { return this.CavvAlgorithmOption; } set { this.CavvAlgorithmOption = new Option(value); } } + + /// + /// Used to track the state of DsTransID + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DsTransIDOption { get; private set; } /// /// Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction. /// /// Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction. - [DataMember(Name = "dsTransID", EmitDefaultValue = false)] - public string DsTransID { get; set; } + [JsonPropertyName("dsTransID")] + public string DsTransID { get { return this.DsTransIDOption; } set { this.DsTransIDOption = new Option(value); } } + + /// + /// Used to track the state of Eci + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option EciOption { get; private set; } /// /// The electronic commerce indicator. /// /// The electronic commerce indicator. - [DataMember(Name = "eci", EmitDefaultValue = false)] - public string Eci { get; set; } + [JsonPropertyName("eci")] + public string Eci { get { return this.EciOption; } set { this.EciOption = new Option(value); } } + + /// + /// Used to track the state of RiskScore + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RiskScoreOption { get; private set; } /// /// Risk score calculated by Directory Server (DS). Required for Cartes Bancaires integrations. /// /// Risk score calculated by Directory Server (DS). Required for Cartes Bancaires integrations. - [DataMember(Name = "riskScore", EmitDefaultValue = false)] - public string RiskScore { get; set; } + [JsonPropertyName("riskScore")] + public string RiskScore { get { return this.RiskScoreOption; } set { this.RiskScoreOption = new Option(value); } } + + /// + /// Used to track the state of ThreeDSVersion + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ThreeDSVersionOption { get; private set; } /// /// The version of the 3D Secure protocol. /// /// The version of the 3D Secure protocol. - [DataMember(Name = "threeDSVersion", EmitDefaultValue = false)] - public string ThreeDSVersion { get; set; } + [JsonPropertyName("threeDSVersion")] + public string ThreeDSVersion { get { return this.ThreeDSVersionOption; } set { this.ThreeDSVersionOption = new Option(value); } } + + /// + /// Used to track the state of TokenAuthenticationVerificationValue + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TokenAuthenticationVerificationValueOption { get; private set; } /// /// Network token authentication verification value (TAVV). The network token cryptogram. /// /// Network token authentication verification value (TAVV). The network token cryptogram. - [DataMember(Name = "tokenAuthenticationVerificationValue", EmitDefaultValue = false)] - public byte[] TokenAuthenticationVerificationValue { get; set; } + [JsonPropertyName("tokenAuthenticationVerificationValue")] + public byte[] TokenAuthenticationVerificationValue { get { return this.TokenAuthenticationVerificationValueOption; } set { this.TokenAuthenticationVerificationValueOption = new Option(value); } } + + /// + /// Used to track the state of TransStatusReason + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TransStatusReasonOption { get; private set; } /// /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). /// /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). - [DataMember(Name = "transStatusReason", EmitDefaultValue = false)] - public string TransStatusReason { get; set; } + [JsonPropertyName("transStatusReason")] + public string TransStatusReason { get { return this.TransStatusReasonOption; } set { this.TransStatusReasonOption = new Option(value); } } + + /// + /// Used to track the state of Xid + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option XidOption { get; private set; } /// /// Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form). /// /// Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form). - [DataMember(Name = "xid", EmitDefaultValue = false)] - public byte[] Xid { get; set; } + [JsonPropertyName("xid")] + public byte[] Xid { get { return this.XidOption; } set { this.XidOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -313,155 +639,246 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class ThreeDSecureDataJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override ThreeDSecureData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as ThreeDSecureData); + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option authenticationResponse = default; + Option cavv = default; + Option cavvAlgorithm = default; + Option challengeCancel = default; + Option directoryResponse = default; + Option dsTransID = default; + Option eci = default; + Option riskScore = default; + Option threeDSVersion = default; + Option tokenAuthenticationVerificationValue = default; + Option transStatusReason = default; + Option xid = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "authenticationResponse": + string authenticationResponseRawValue = utf8JsonReader.GetString(); + if (authenticationResponseRawValue != null) + authenticationResponse = new Option(ThreeDSecureData.AuthenticationResponseEnumFromStringOrDefault(authenticationResponseRawValue)); + break; + case "cavv": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + cavv = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "cavvAlgorithm": + cavvAlgorithm = new Option(utf8JsonReader.GetString()); + break; + case "challengeCancel": + string challengeCancelRawValue = utf8JsonReader.GetString(); + if (challengeCancelRawValue != null) + challengeCancel = new Option(ThreeDSecureData.ChallengeCancelEnumFromStringOrDefault(challengeCancelRawValue)); + break; + case "directoryResponse": + string directoryResponseRawValue = utf8JsonReader.GetString(); + if (directoryResponseRawValue != null) + directoryResponse = new Option(ThreeDSecureData.DirectoryResponseEnumFromStringOrDefault(directoryResponseRawValue)); + break; + case "dsTransID": + dsTransID = new Option(utf8JsonReader.GetString()); + break; + case "eci": + eci = new Option(utf8JsonReader.GetString()); + break; + case "riskScore": + riskScore = new Option(utf8JsonReader.GetString()); + break; + case "threeDSVersion": + threeDSVersion = new Option(utf8JsonReader.GetString()); + break; + case "tokenAuthenticationVerificationValue": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + tokenAuthenticationVerificationValue = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "transStatusReason": + transStatusReason = new Option(utf8JsonReader.GetString()); + break; + case "xid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + xid = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (authenticationResponse.IsSet && authenticationResponse.Value == null) + throw new ArgumentNullException(nameof(authenticationResponse), "Property is not nullable for class ThreeDSecureData."); + + if (cavv.IsSet && cavv.Value == null) + throw new ArgumentNullException(nameof(cavv), "Property is not nullable for class ThreeDSecureData."); + + if (cavvAlgorithm.IsSet && cavvAlgorithm.Value == null) + throw new ArgumentNullException(nameof(cavvAlgorithm), "Property is not nullable for class ThreeDSecureData."); + + if (challengeCancel.IsSet && challengeCancel.Value == null) + throw new ArgumentNullException(nameof(challengeCancel), "Property is not nullable for class ThreeDSecureData."); + + if (directoryResponse.IsSet && directoryResponse.Value == null) + throw new ArgumentNullException(nameof(directoryResponse), "Property is not nullable for class ThreeDSecureData."); + + if (dsTransID.IsSet && dsTransID.Value == null) + throw new ArgumentNullException(nameof(dsTransID), "Property is not nullable for class ThreeDSecureData."); + + if (eci.IsSet && eci.Value == null) + throw new ArgumentNullException(nameof(eci), "Property is not nullable for class ThreeDSecureData."); + + if (riskScore.IsSet && riskScore.Value == null) + throw new ArgumentNullException(nameof(riskScore), "Property is not nullable for class ThreeDSecureData."); + + if (threeDSVersion.IsSet && threeDSVersion.Value == null) + throw new ArgumentNullException(nameof(threeDSVersion), "Property is not nullable for class ThreeDSecureData."); + + if (tokenAuthenticationVerificationValue.IsSet && tokenAuthenticationVerificationValue.Value == null) + throw new ArgumentNullException(nameof(tokenAuthenticationVerificationValue), "Property is not nullable for class ThreeDSecureData."); + + if (transStatusReason.IsSet && transStatusReason.Value == null) + throw new ArgumentNullException(nameof(transStatusReason), "Property is not nullable for class ThreeDSecureData."); + + if (xid.IsSet && xid.Value == null) + throw new ArgumentNullException(nameof(xid), "Property is not nullable for class ThreeDSecureData."); + + return new ThreeDSecureData(authenticationResponse, cavv, cavvAlgorithm, challengeCancel, directoryResponse, dsTransID, eci, riskScore, threeDSVersion, tokenAuthenticationVerificationValue, transStatusReason, xid); } /// - /// Returns true if ThreeDSecureData instances are equal + /// Serializes a /// - /// Instance of ThreeDSecureData to be compared - /// Boolean - public bool Equals(ThreeDSecureData input) + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ThreeDSecureData threeDSecureData, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) - { - return false; - } - return - ( - this.AuthenticationResponse == input.AuthenticationResponse || - this.AuthenticationResponse.Equals(input.AuthenticationResponse) - ) && - ( - this.Cavv == input.Cavv || - (this.Cavv != null && - this.Cavv.Equals(input.Cavv)) - ) && - ( - this.CavvAlgorithm == input.CavvAlgorithm || - (this.CavvAlgorithm != null && - this.CavvAlgorithm.Equals(input.CavvAlgorithm)) - ) && - ( - this.ChallengeCancel == input.ChallengeCancel || - this.ChallengeCancel.Equals(input.ChallengeCancel) - ) && - ( - this.DirectoryResponse == input.DirectoryResponse || - this.DirectoryResponse.Equals(input.DirectoryResponse) - ) && - ( - this.DsTransID == input.DsTransID || - (this.DsTransID != null && - this.DsTransID.Equals(input.DsTransID)) - ) && - ( - this.Eci == input.Eci || - (this.Eci != null && - this.Eci.Equals(input.Eci)) - ) && - ( - this.RiskScore == input.RiskScore || - (this.RiskScore != null && - this.RiskScore.Equals(input.RiskScore)) - ) && - ( - this.ThreeDSVersion == input.ThreeDSVersion || - (this.ThreeDSVersion != null && - this.ThreeDSVersion.Equals(input.ThreeDSVersion)) - ) && - ( - this.TokenAuthenticationVerificationValue == input.TokenAuthenticationVerificationValue || - (this.TokenAuthenticationVerificationValue != null && - this.TokenAuthenticationVerificationValue.Equals(input.TokenAuthenticationVerificationValue)) - ) && - ( - this.TransStatusReason == input.TransStatusReason || - (this.TransStatusReason != null && - this.TransStatusReason.Equals(input.TransStatusReason)) - ) && - ( - this.Xid == input.Xid || - (this.Xid != null && - this.Xid.Equals(input.Xid)) - ); + writer.WriteStartObject(); + + WriteProperties(writer, threeDSecureData, jsonSerializerOptions); + writer.WriteEndObject(); } /// - /// Gets the hash code + /// Serializes the properties of /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ThreeDSecureData threeDSecureData, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap + if (threeDSecureData.CavvOption.IsSet && threeDSecureData.Cavv == null) + throw new ArgumentNullException(nameof(threeDSecureData.Cavv), "Property is required for class ThreeDSecureData."); + + if (threeDSecureData.CavvAlgorithmOption.IsSet && threeDSecureData.CavvAlgorithm == null) + throw new ArgumentNullException(nameof(threeDSecureData.CavvAlgorithm), "Property is required for class ThreeDSecureData."); + + if (threeDSecureData.DsTransIDOption.IsSet && threeDSecureData.DsTransID == null) + throw new ArgumentNullException(nameof(threeDSecureData.DsTransID), "Property is required for class ThreeDSecureData."); + + if (threeDSecureData.EciOption.IsSet && threeDSecureData.Eci == null) + throw new ArgumentNullException(nameof(threeDSecureData.Eci), "Property is required for class ThreeDSecureData."); + + if (threeDSecureData.RiskScoreOption.IsSet && threeDSecureData.RiskScore == null) + throw new ArgumentNullException(nameof(threeDSecureData.RiskScore), "Property is required for class ThreeDSecureData."); + + if (threeDSecureData.ThreeDSVersionOption.IsSet && threeDSecureData.ThreeDSVersion == null) + throw new ArgumentNullException(nameof(threeDSecureData.ThreeDSVersion), "Property is required for class ThreeDSecureData."); + + if (threeDSecureData.TokenAuthenticationVerificationValueOption.IsSet && threeDSecureData.TokenAuthenticationVerificationValue == null) + throw new ArgumentNullException(nameof(threeDSecureData.TokenAuthenticationVerificationValue), "Property is required for class ThreeDSecureData."); + + if (threeDSecureData.TransStatusReasonOption.IsSet && threeDSecureData.TransStatusReason == null) + throw new ArgumentNullException(nameof(threeDSecureData.TransStatusReason), "Property is required for class ThreeDSecureData."); + + if (threeDSecureData.XidOption.IsSet && threeDSecureData.Xid == null) + throw new ArgumentNullException(nameof(threeDSecureData.Xid), "Property is required for class ThreeDSecureData."); + + var authenticationResponseRawValue = ThreeDSecureData.AuthenticationResponseEnumToJsonValue(threeDSecureData.AuthenticationResponseOption.Value.Value); + writer.WriteString("authenticationResponse", authenticationResponseRawValue); + if (threeDSecureData.CavvOption.IsSet) { - int hashCode = 41; - hashCode = (hashCode * 59) + this.AuthenticationResponse.GetHashCode(); - if (this.Cavv != null) - { - hashCode = (hashCode * 59) + this.Cavv.GetHashCode(); - } - if (this.CavvAlgorithm != null) - { - hashCode = (hashCode * 59) + this.CavvAlgorithm.GetHashCode(); - } - hashCode = (hashCode * 59) + this.ChallengeCancel.GetHashCode(); - hashCode = (hashCode * 59) + this.DirectoryResponse.GetHashCode(); - if (this.DsTransID != null) - { - hashCode = (hashCode * 59) + this.DsTransID.GetHashCode(); - } - if (this.Eci != null) - { - hashCode = (hashCode * 59) + this.Eci.GetHashCode(); - } - if (this.RiskScore != null) - { - hashCode = (hashCode * 59) + this.RiskScore.GetHashCode(); - } - if (this.ThreeDSVersion != null) - { - hashCode = (hashCode * 59) + this.ThreeDSVersion.GetHashCode(); - } - if (this.TokenAuthenticationVerificationValue != null) - { - hashCode = (hashCode * 59) + this.TokenAuthenticationVerificationValue.GetHashCode(); - } - if (this.TransStatusReason != null) - { - hashCode = (hashCode * 59) + this.TransStatusReason.GetHashCode(); - } - if (this.Xid != null) - { - hashCode = (hashCode * 59) + this.Xid.GetHashCode(); - } - return hashCode; + writer.WritePropertyName("cavv"); + JsonSerializer.Serialize(writer, threeDSecureData.Cavv, jsonSerializerOptions); + } + if (threeDSecureData.CavvAlgorithmOption.IsSet) + writer.WriteString("cavvAlgorithm", threeDSecureData.CavvAlgorithm); + + var challengeCancelRawValue = ThreeDSecureData.ChallengeCancelEnumToJsonValue(threeDSecureData.ChallengeCancelOption.Value.Value); + writer.WriteString("challengeCancel", challengeCancelRawValue); + var directoryResponseRawValue = ThreeDSecureData.DirectoryResponseEnumToJsonValue(threeDSecureData.DirectoryResponseOption.Value.Value); + writer.WriteString("directoryResponse", directoryResponseRawValue); + if (threeDSecureData.DsTransIDOption.IsSet) + writer.WriteString("dsTransID", threeDSecureData.DsTransID); + + if (threeDSecureData.EciOption.IsSet) + writer.WriteString("eci", threeDSecureData.Eci); + + if (threeDSecureData.RiskScoreOption.IsSet) + writer.WriteString("riskScore", threeDSecureData.RiskScore); + + if (threeDSecureData.ThreeDSVersionOption.IsSet) + writer.WriteString("threeDSVersion", threeDSecureData.ThreeDSVersion); + + if (threeDSecureData.TokenAuthenticationVerificationValueOption.IsSet) + { + writer.WritePropertyName("tokenAuthenticationVerificationValue"); + JsonSerializer.Serialize(writer, threeDSecureData.TokenAuthenticationVerificationValue, jsonSerializerOptions); + } + if (threeDSecureData.TransStatusReasonOption.IsSet) + writer.WriteString("transStatusReason", threeDSecureData.TransStatusReason); + + if (threeDSecureData.XidOption.IsSet) + { + writer.WritePropertyName("xid"); + JsonSerializer.Serialize(writer, threeDSecureData.Xid, jsonSerializerOptions); } - } - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; } } - } diff --git a/Adyen/Model/Checkout/Ticket.cs b/Adyen/Model/Checkout/Ticket.cs index 9caee123c..0fb334720 100644 --- a/Adyen/Model/Checkout/Ticket.cs +++ b/Adyen/Model/Checkout/Ticket.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,57 +14,78 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// Ticket /// - [DataContract(Name = "Ticket")] - public partial class Ticket : IEquatable, IValidatableObject + public partial class Ticket : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters. - /// The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd. - /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - public Ticket(string issueAddress = default(string), DateTime issueDate = default(DateTime), string number = default(string)) + /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters + /// The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd + /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros. + [JsonConstructor] + public Ticket(Option issueAddress = default, Option issueDate = default, Option number = default) { - this.IssueAddress = issueAddress; - this.IssueDate = issueDate; - this.Number = number; + IssueAddressOption = issueAddress; + IssueDateOption = issueDate; + NumberOption = number; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of IssueAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IssueAddressOption { get; private set; } + /// /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters /// /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters - [DataMember(Name = "issueAddress", EmitDefaultValue = false)] - public string IssueAddress { get; set; } + [JsonPropertyName("issueAddress")] + public string IssueAddress { get { return this.IssueAddressOption; } set { this.IssueAddressOption = new Option(value); } } + + /// + /// Used to track the state of IssueDate + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option IssueDateOption { get; private set; } /// /// The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd /// /// The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd - [DataMember(Name = "issueDate", EmitDefaultValue = false)] - [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime IssueDate { get; set; } + [JsonPropertyName("issueDate")] + public DateTime? IssueDate { get { return this.IssueDateOption; } set { this.IssueDateOption = new Option(value); } } + + /// + /// Used to track the state of Number + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NumberOption { get; private set; } /// /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "number", EmitDefaultValue = false)] - public string Number { get; set; } + [JsonPropertyName("number")] + public string Number { get { return this.NumberOption; } set { this.NumberOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -83,86 +103,128 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class TicketJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// The format to use to serialize IssueDate /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as Ticket); - } + public static string IssueDateFormat { get; set; } = "yyyy'-'MM'-'dd"; /// - /// Returns true if Ticket instances are equal + /// Deserializes json to /// - /// Instance of Ticket to be compared - /// Boolean - public bool Equals(Ticket input) + /// + /// + /// + /// + /// + public override Ticket Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option issueAddress = default; + Option issueDate = default; + Option number = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "issueAddress": + issueAddress = new Option(utf8JsonReader.GetString()); + break; + case "issueDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + issueDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "number": + number = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.IssueAddress == input.IssueAddress || - (this.IssueAddress != null && - this.IssueAddress.Equals(input.IssueAddress)) - ) && - ( - this.IssueDate == input.IssueDate || - (this.IssueDate != null && - this.IssueDate.Equals(input.IssueDate)) - ) && - ( - this.Number == input.Number || - (this.Number != null && - this.Number.Equals(input.Number)) - ); + + if (issueAddress.IsSet && issueAddress.Value == null) + throw new ArgumentNullException(nameof(issueAddress), "Property is not nullable for class Ticket."); + + if (issueDate.IsSet && issueDate.Value == null) + throw new ArgumentNullException(nameof(issueDate), "Property is not nullable for class Ticket."); + + if (number.IsSet && number.Value == null) + throw new ArgumentNullException(nameof(number), "Property is not nullable for class Ticket."); + + return new Ticket(issueAddress, issueDate, number); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Ticket ticket, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.IssueAddress != null) - { - hashCode = (hashCode * 59) + this.IssueAddress.GetHashCode(); - } - if (this.IssueDate != null) - { - hashCode = (hashCode * 59) + this.IssueDate.GetHashCode(); - } - if (this.Number != null) - { - hashCode = (hashCode * 59) + this.Number.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, ticket, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Ticket ticket, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (ticket.IssueAddressOption.IsSet && ticket.IssueAddress == null) + throw new ArgumentNullException(nameof(ticket.IssueAddress), "Property is required for class Ticket."); + + if (ticket.NumberOption.IsSet && ticket.Number == null) + throw new ArgumentNullException(nameof(ticket.Number), "Property is required for class Ticket."); + + if (ticket.IssueAddressOption.IsSet) + writer.WriteString("issueAddress", ticket.IssueAddress); + + if (ticket.IssueDateOption.IsSet) + writer.WriteString("issueDate", ticket.IssueDateOption.Value.Value.ToString(IssueDateFormat)); + + if (ticket.NumberOption.IsSet) + writer.WriteString("number", ticket.Number); } } - } diff --git a/Adyen/Model/Checkout/TravelAgency.cs b/Adyen/Model/Checkout/TravelAgency.cs index f217308e9..8841bc411 100644 --- a/Adyen/Model/Checkout/TravelAgency.cs +++ b/Adyen/Model/Checkout/TravelAgency.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,47 +14,62 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// TravelAgency /// - [DataContract(Name = "TravelAgency")] - public partial class TravelAgency : IEquatable, IValidatableObject + public partial class TravelAgency : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros.. - public TravelAgency(string code = default(string), string name = default(string)) + /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not start with a space or be all spaces. * Must not be all zeros. + /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros. + [JsonConstructor] + public TravelAgency(Option code = default, Option name = default) { - this.Code = code; - this.Name = name; + CodeOption = code; + NameOption = name; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of Code + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CodeOption { get; private set; } + /// /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "code", EmitDefaultValue = false)] - public string Code { get; set; } + [JsonPropertyName("code")] + public string Code { get { return this.CodeOption; } set { this.CodeOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } /// /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -72,77 +86,112 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class TravelAgencyJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override TravelAgency Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as TravelAgency); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if TravelAgency instances are equal - /// - /// Instance of TravelAgency to be compared - /// Boolean - public bool Equals(TravelAgency input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option code = default; + Option name = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "code": + code = new Option(utf8JsonReader.GetString()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.Code == input.Code || - (this.Code != null && - this.Code.Equals(input.Code)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ); + + if (code.IsSet && code.Value == null) + throw new ArgumentNullException(nameof(code), "Property is not nullable for class TravelAgency."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class TravelAgency."); + + return new TravelAgency(code, name); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TravelAgency travelAgency, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Code != null) - { - hashCode = (hashCode * 59) + this.Code.GetHashCode(); - } - if (this.Name != null) - { - hashCode = (hashCode * 59) + this.Name.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, travelAgency, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, TravelAgency travelAgency, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (travelAgency.CodeOption.IsSet && travelAgency.Code == null) + throw new ArgumentNullException(nameof(travelAgency.Code), "Property is required for class TravelAgency."); + + if (travelAgency.NameOption.IsSet && travelAgency.Name == null) + throw new ArgumentNullException(nameof(travelAgency.Name), "Property is required for class TravelAgency."); + + if (travelAgency.CodeOption.IsSet) + writer.WriteString("code", travelAgency.Code); + + if (travelAgency.NameOption.IsSet) + writer.WriteString("name", travelAgency.Name); } } - } diff --git a/Adyen/Model/Checkout/TwintDetails.cs b/Adyen/Model/Checkout/TwintDetails.cs index 52c4b3e03..a3af0b06d 100644 --- a/Adyen/Model/Checkout/TwintDetails.cs +++ b/Adyen/Model/Checkout/TwintDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,90 +14,164 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// TwintDetails /// - [DataContract(Name = "TwintDetails")] - public partial class TwintDetails : IEquatable, IValidatableObject + public partial class TwintDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The type of flow to initiate. + /// The payment method type. + [JsonConstructor] + public TwintDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option subtype = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + SubtypeOption = subtype; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The payment method type. /// /// The payment method type. - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Twint for value: twint /// - [EnumMember(Value = "twint")] Twint = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("twint")) + return TypeEnum.Twint; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("twint")) + return TypeEnum.Twint; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Twint) + return "twint"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// The payment method type. /// /// The payment method type. - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The type of flow to initiate.. - /// The payment method type.. - public TwintDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string subtype = default(string), TypeEnum? type = default(TypeEnum?)) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Subtype = subtype; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of Subtype + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option SubtypeOption { get; private set; } /// /// The type of flow to initiate. /// /// The type of flow to initiate. - [DataMember(Name = "subtype", EmitDefaultValue = false)] - public string Subtype { get; set; } + [JsonPropertyName("subtype")] + public string Subtype { get { return this.SubtypeOption; } set { this.SubtypeOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -118,106 +191,156 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as TwintDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class TwintDetailsJsonConverter : JsonConverter + { /// - /// Returns true if TwintDetails instances are equal + /// Deserializes json to /// - /// Instance of TwintDetails to be compared - /// Boolean - public bool Equals(TwintDetails input) + /// + /// + /// + /// + /// + public override TwintDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option subtype = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "subtype": + subtype = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(TwintDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Subtype == input.Subtype || - (this.Subtype != null && - this.Subtype.Equals(input.Subtype)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class TwintDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class TwintDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class TwintDetails."); + + if (subtype.IsSet && subtype.Value == null) + throw new ArgumentNullException(nameof(subtype), "Property is not nullable for class TwintDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class TwintDetails."); + + return new TwintDetails(checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, subtype, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TwintDetails twintDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.Subtype != null) - { - hashCode = (hashCode * 59) + this.Subtype.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, twintDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, TwintDetails twintDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (twintDetails.CheckoutAttemptIdOption.IsSet && twintDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(twintDetails.CheckoutAttemptId), "Property is required for class TwintDetails."); - yield break; + if (twintDetails.RecurringDetailReferenceOption.IsSet && twintDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(twintDetails.RecurringDetailReference), "Property is required for class TwintDetails."); + + if (twintDetails.StoredPaymentMethodIdOption.IsSet && twintDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(twintDetails.StoredPaymentMethodId), "Property is required for class TwintDetails."); + + if (twintDetails.SubtypeOption.IsSet && twintDetails.Subtype == null) + throw new ArgumentNullException(nameof(twintDetails.Subtype), "Property is required for class TwintDetails."); + + if (twintDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", twintDetails.CheckoutAttemptId); + + if (twintDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", twintDetails.RecurringDetailReference); + + if (twintDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", twintDetails.StoredPaymentMethodId); + + if (twintDetails.SubtypeOption.IsSet) + writer.WriteString("subtype", twintDetails.Subtype); + + var typeRawValue = TwintDetails.TypeEnumToJsonValue(twintDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs b/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs index 260214207..9a2612ab0 100644 --- a/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs +++ b/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,59 +14,93 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// UpdatePaymentLinkRequest /// - [DataContract(Name = "UpdatePaymentLinkRequest")] - public partial class UpdatePaymentLinkRequest : IEquatable, IValidatableObject + public partial class UpdatePaymentLinkRequest : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Status of the payment link. Possible values: * **expired** + [JsonConstructor] + public UpdatePaymentLinkRequest(StatusEnum status) + { + Status = status; + OnCreated(); + } + + partial void OnCreated(); + /// /// Status of the payment link. Possible values: * **expired** /// /// Status of the payment link. Possible values: * **expired** - [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Expired for value: expired /// - [EnumMember(Value = "expired")] Expired = 1 - } - /// - /// Status of the payment link. Possible values: * **expired** + /// Returns a /// - /// Status of the payment link. Possible values: * **expired** - [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] - public StatusEnum Status { get; set; } + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("expired")) + return StatusEnum.Expired; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected UpdatePaymentLinkRequest() { } + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("expired")) + return StatusEnum.Expired; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// Status of the payment link. Possible values: * **expired** (required). - public UpdatePaymentLinkRequest(StatusEnum status = default(StatusEnum)) + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum value) { - this.Status = status; + if (value == StatusEnum.Expired) + return "expired"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// Status of the payment link. Possible values: * **expired** + /// + /// Status of the payment link. Possible values: * **expired** + [JsonPropertyName("status")] + public StatusEnum Status { get; set; } + /// /// Returns the string presentation of the object /// @@ -82,64 +115,101 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class UpdatePaymentLinkRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override UpdatePaymentLinkRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as UpdatePaymentLinkRequest); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if UpdatePaymentLinkRequest instances are equal - /// - /// Instance of UpdatePaymentLinkRequest to be compared - /// Boolean - public bool Equals(UpdatePaymentLinkRequest input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option status = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(UpdatePaymentLinkRequest.StatusEnumFromStringOrDefault(statusRawValue)); + break; + default: + break; + } + } } - return - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ); + + if (!status.IsSet) + throw new ArgumentException("Property is required for class UpdatePaymentLinkRequest.", nameof(status)); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class UpdatePaymentLinkRequest."); + + return new UpdatePaymentLinkRequest(status.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, UpdatePaymentLinkRequest updatePaymentLinkRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - hashCode = (hashCode * 59) + this.Status.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, updatePaymentLinkRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, UpdatePaymentLinkRequest updatePaymentLinkRequest, JsonSerializerOptions jsonSerializerOptions) { - yield break; + var statusRawValue = UpdatePaymentLinkRequest.StatusEnumToJsonValue(updatePaymentLinkRequest.Status); + writer.WriteString("status", statusRawValue); } } - } diff --git a/Adyen/Model/Checkout/UpiCollectDetails.cs b/Adyen/Model/Checkout/UpiCollectDetails.cs index e8839f31a..48c635043 100644 --- a/Adyen/Model/Checkout/UpiCollectDetails.cs +++ b/Adyen/Model/Checkout/UpiCollectDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,113 +14,182 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// UpiCollectDetails /// - [DataContract(Name = "UpiCollectDetails")] - public partial class UpiCollectDetails : IEquatable, IValidatableObject + public partial class UpiCollectDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The sequence number for the debit. For example, send **2** if this is the second debit for the subscription. The sequence number is included in the notification sent to the shopper. + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **upi_collect** (default to TypeEnum.UpiCollect) + /// The virtual payment address for UPI. + [JsonConstructor] + public UpiCollectDetails(string billingSequenceNumber, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option shopperNotificationReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.UpiCollect, Option virtualPaymentAddress = default) + { + BillingSequenceNumber = billingSequenceNumber; + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + ShopperNotificationReferenceOption = shopperNotificationReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + Type = type; + VirtualPaymentAddressOption = virtualPaymentAddress; + OnCreated(); + } + + partial void OnCreated(); + /// /// **upi_collect** /// /// **upi_collect** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum UpiCollect for value: upi_collect /// - [EnumMember(Value = "upi_collect")] UpiCollect = 1 - } - /// - /// **upi_collect** + /// Returns a /// - /// **upi_collect** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] - public TypeEnum Type { get; set; } + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("upi_collect")) + return TypeEnum.UpiCollect; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected UpiCollectDetails() { } + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("upi_collect")) + return TypeEnum.UpiCollect; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The sequence number for the debit. For example, send **2** if this is the second debit for the subscription. The sequence number is included in the notification sent to the shopper. (required). - /// The checkout attempt identifier.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **upi_collect** (required) (default to TypeEnum.UpiCollect). - /// The virtual payment address for UPI.. - public UpiCollectDetails(string billingSequenceNumber = default(string), string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string shopperNotificationReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.UpiCollect, string virtualPaymentAddress = default(string)) + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) { - this.BillingSequenceNumber = billingSequenceNumber; - this.Type = type; - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.ShopperNotificationReference = shopperNotificationReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.VirtualPaymentAddress = virtualPaymentAddress; + if (value == TypeEnum.UpiCollect) + return "upi_collect"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } + /// + /// **upi_collect** + /// + /// **upi_collect** + [JsonPropertyName("type")] + public TypeEnum Type { get; set; } + /// /// The sequence number for the debit. For example, send **2** if this is the second debit for the subscription. The sequence number is included in the notification sent to the shopper. /// /// The sequence number for the debit. For example, send **2** if this is the second debit for the subscription. The sequence number is included in the notification sent to the shopper. - [DataMember(Name = "billingSequenceNumber", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("billingSequenceNumber")] public string BillingSequenceNumber { get; set; } + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } + /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperNotificationReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNotificationReferenceOption { get; private set; } /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. - [DataMember(Name = "shopperNotificationReference", EmitDefaultValue = false)] - public string ShopperNotificationReference { get; set; } + [JsonPropertyName("shopperNotificationReference")] + public string ShopperNotificationReference { get { return this.ShopperNotificationReferenceOption; } set { this.ShopperNotificationReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + + /// + /// Used to track the state of VirtualPaymentAddress + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option VirtualPaymentAddressOption { get; private set; } /// /// The virtual payment address for UPI. /// /// The virtual payment address for UPI. - [DataMember(Name = "virtualPaymentAddress", EmitDefaultValue = false)] - public string VirtualPaymentAddress { get; set; } + [JsonPropertyName("virtualPaymentAddress")] + public string VirtualPaymentAddress { get { return this.VirtualPaymentAddressOption; } set { this.VirtualPaymentAddressOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -143,124 +211,186 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as UpiCollectDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class UpiCollectDetailsJsonConverter : JsonConverter + { /// - /// Returns true if UpiCollectDetails instances are equal + /// Deserializes json to /// - /// Instance of UpiCollectDetails to be compared - /// Boolean - public bool Equals(UpiCollectDetails input) + /// + /// + /// + /// + /// + public override UpiCollectDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option billingSequenceNumber = default; + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option shopperNotificationReference = default; + Option storedPaymentMethodId = default; + Option type = default; + Option virtualPaymentAddress = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "billingSequenceNumber": + billingSequenceNumber = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "shopperNotificationReference": + shopperNotificationReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(UpiCollectDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + case "virtualPaymentAddress": + virtualPaymentAddress = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } } - return - ( - this.BillingSequenceNumber == input.BillingSequenceNumber || - (this.BillingSequenceNumber != null && - this.BillingSequenceNumber.Equals(input.BillingSequenceNumber)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.ShopperNotificationReference == input.ShopperNotificationReference || - (this.ShopperNotificationReference != null && - this.ShopperNotificationReference.Equals(input.ShopperNotificationReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.VirtualPaymentAddress == input.VirtualPaymentAddress || - (this.VirtualPaymentAddress != null && - this.VirtualPaymentAddress.Equals(input.VirtualPaymentAddress)) - ); + + if (!billingSequenceNumber.IsSet) + throw new ArgumentException("Property is required for class UpiCollectDetails.", nameof(billingSequenceNumber)); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class UpiCollectDetails.", nameof(type)); + + if (billingSequenceNumber.IsSet && billingSequenceNumber.Value == null) + throw new ArgumentNullException(nameof(billingSequenceNumber), "Property is not nullable for class UpiCollectDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class UpiCollectDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class UpiCollectDetails."); + + if (shopperNotificationReference.IsSet && shopperNotificationReference.Value == null) + throw new ArgumentNullException(nameof(shopperNotificationReference), "Property is not nullable for class UpiCollectDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class UpiCollectDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class UpiCollectDetails."); + + if (virtualPaymentAddress.IsSet && virtualPaymentAddress.Value == null) + throw new ArgumentNullException(nameof(virtualPaymentAddress), "Property is not nullable for class UpiCollectDetails."); + + return new UpiCollectDetails(billingSequenceNumber.Value, checkoutAttemptId, recurringDetailReference, shopperNotificationReference, storedPaymentMethodId, type.Value.Value, virtualPaymentAddress); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, UpiCollectDetails upiCollectDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.BillingSequenceNumber != null) - { - hashCode = (hashCode * 59) + this.BillingSequenceNumber.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.ShopperNotificationReference != null) - { - hashCode = (hashCode * 59) + this.ShopperNotificationReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.VirtualPaymentAddress != null) - { - hashCode = (hashCode * 59) + this.VirtualPaymentAddress.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, upiCollectDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, UpiCollectDetails upiCollectDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (upiCollectDetails.BillingSequenceNumber == null) + throw new ArgumentNullException(nameof(upiCollectDetails.BillingSequenceNumber), "Property is required for class UpiCollectDetails."); - yield break; + if (upiCollectDetails.CheckoutAttemptIdOption.IsSet && upiCollectDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(upiCollectDetails.CheckoutAttemptId), "Property is required for class UpiCollectDetails."); + + if (upiCollectDetails.RecurringDetailReferenceOption.IsSet && upiCollectDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(upiCollectDetails.RecurringDetailReference), "Property is required for class UpiCollectDetails."); + + if (upiCollectDetails.ShopperNotificationReferenceOption.IsSet && upiCollectDetails.ShopperNotificationReference == null) + throw new ArgumentNullException(nameof(upiCollectDetails.ShopperNotificationReference), "Property is required for class UpiCollectDetails."); + + if (upiCollectDetails.StoredPaymentMethodIdOption.IsSet && upiCollectDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(upiCollectDetails.StoredPaymentMethodId), "Property is required for class UpiCollectDetails."); + + if (upiCollectDetails.VirtualPaymentAddressOption.IsSet && upiCollectDetails.VirtualPaymentAddress == null) + throw new ArgumentNullException(nameof(upiCollectDetails.VirtualPaymentAddress), "Property is required for class UpiCollectDetails."); + + writer.WriteString("billingSequenceNumber", upiCollectDetails.BillingSequenceNumber); + + if (upiCollectDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", upiCollectDetails.CheckoutAttemptId); + + if (upiCollectDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", upiCollectDetails.RecurringDetailReference); + + if (upiCollectDetails.ShopperNotificationReferenceOption.IsSet) + writer.WriteString("shopperNotificationReference", upiCollectDetails.ShopperNotificationReference); + + if (upiCollectDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", upiCollectDetails.StoredPaymentMethodId); + + var typeRawValue = UpiCollectDetails.TypeEnumToJsonValue(upiCollectDetails.Type); + writer.WriteString("type", typeRawValue); + if (upiCollectDetails.VirtualPaymentAddressOption.IsSet) + writer.WriteString("virtualPaymentAddress", upiCollectDetails.VirtualPaymentAddress); } } - } diff --git a/Adyen/Model/Checkout/UpiIntentDetails.cs b/Adyen/Model/Checkout/UpiIntentDetails.cs index d8c015a59..ff9622873 100644 --- a/Adyen/Model/Checkout/UpiIntentDetails.cs +++ b/Adyen/Model/Checkout/UpiIntentDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,104 +14,173 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// UpiIntentDetails /// - [DataContract(Name = "UpiIntentDetails")] - public partial class UpiIntentDetails : IEquatable, IValidatableObject + public partial class UpiIntentDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// TPAP (Third Party Application) Id that is being used to make the UPI payment + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **upi_intent** (default to TypeEnum.UpiIntent) + [JsonConstructor] + public UpiIntentDetails(Option appId = default, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option shopperNotificationReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.UpiIntent) + { + AppIdOption = appId; + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + ShopperNotificationReferenceOption = shopperNotificationReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + Type = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **upi_intent** /// /// **upi_intent** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum UpiIntent for value: upi_intent /// - [EnumMember(Value = "upi_intent")] UpiIntent = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("upi_intent")) + return TypeEnum.UpiIntent; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("upi_intent")) + return TypeEnum.UpiIntent; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum value) + { + if (value == TypeEnum.UpiIntent) + return "upi_intent"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } /// /// **upi_intent** /// /// **upi_intent** - [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("type")] public TypeEnum Type { get; set; } + /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected UpiIntentDetails() { } - /// - /// Initializes a new instance of the class. + /// Used to track the state of AppId /// - /// TPAP (Third Party Application) Id that is being used to make the UPI payment. - /// The checkout attempt identifier.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **upi_intent** (required) (default to TypeEnum.UpiIntent). - public UpiIntentDetails(string appId = default(string), string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string shopperNotificationReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.UpiIntent) - { - this.Type = type; - this.AppId = appId; - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.ShopperNotificationReference = shopperNotificationReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AppIdOption { get; private set; } /// /// TPAP (Third Party Application) Id that is being used to make the UPI payment /// /// TPAP (Third Party Application) Id that is being used to make the UPI payment - [DataMember(Name = "appId", EmitDefaultValue = false)] - public string AppId { get; set; } + [JsonPropertyName("appId")] + public string AppId { get { return this.AppIdOption; } set { this.AppIdOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of ShopperNotificationReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopperNotificationReferenceOption { get; private set; } /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. - [DataMember(Name = "shopperNotificationReference", EmitDefaultValue = false)] - public string ShopperNotificationReference { get; set; } + [JsonPropertyName("shopperNotificationReference")] + public string ShopperNotificationReference { get { return this.ShopperNotificationReferenceOption; } set { this.ShopperNotificationReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -133,115 +201,172 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as UpiIntentDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class UpiIntentDetailsJsonConverter : JsonConverter + { /// - /// Returns true if UpiIntentDetails instances are equal + /// Deserializes json to /// - /// Instance of UpiIntentDetails to be compared - /// Boolean - public bool Equals(UpiIntentDetails input) + /// + /// + /// + /// + /// + public override UpiIntentDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option appId = default; + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option shopperNotificationReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "appId": + appId = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "shopperNotificationReference": + shopperNotificationReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(UpiIntentDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.AppId == input.AppId || - (this.AppId != null && - this.AppId.Equals(input.AppId)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.ShopperNotificationReference == input.ShopperNotificationReference || - (this.ShopperNotificationReference != null && - this.ShopperNotificationReference.Equals(input.ShopperNotificationReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!type.IsSet) + throw new ArgumentException("Property is required for class UpiIntentDetails.", nameof(type)); + + if (appId.IsSet && appId.Value == null) + throw new ArgumentNullException(nameof(appId), "Property is not nullable for class UpiIntentDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class UpiIntentDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class UpiIntentDetails."); + + if (shopperNotificationReference.IsSet && shopperNotificationReference.Value == null) + throw new ArgumentNullException(nameof(shopperNotificationReference), "Property is not nullable for class UpiIntentDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class UpiIntentDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class UpiIntentDetails."); + + return new UpiIntentDetails(appId, checkoutAttemptId, recurringDetailReference, shopperNotificationReference, storedPaymentMethodId, type.Value.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, UpiIntentDetails upiIntentDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AppId != null) - { - hashCode = (hashCode * 59) + this.AppId.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.ShopperNotificationReference != null) - { - hashCode = (hashCode * 59) + this.ShopperNotificationReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, upiIntentDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, UpiIntentDetails upiIntentDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (upiIntentDetails.AppIdOption.IsSet && upiIntentDetails.AppId == null) + throw new ArgumentNullException(nameof(upiIntentDetails.AppId), "Property is required for class UpiIntentDetails."); - yield break; + if (upiIntentDetails.CheckoutAttemptIdOption.IsSet && upiIntentDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(upiIntentDetails.CheckoutAttemptId), "Property is required for class UpiIntentDetails."); + + if (upiIntentDetails.RecurringDetailReferenceOption.IsSet && upiIntentDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(upiIntentDetails.RecurringDetailReference), "Property is required for class UpiIntentDetails."); + + if (upiIntentDetails.ShopperNotificationReferenceOption.IsSet && upiIntentDetails.ShopperNotificationReference == null) + throw new ArgumentNullException(nameof(upiIntentDetails.ShopperNotificationReference), "Property is required for class UpiIntentDetails."); + + if (upiIntentDetails.StoredPaymentMethodIdOption.IsSet && upiIntentDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(upiIntentDetails.StoredPaymentMethodId), "Property is required for class UpiIntentDetails."); + + if (upiIntentDetails.AppIdOption.IsSet) + writer.WriteString("appId", upiIntentDetails.AppId); + + if (upiIntentDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", upiIntentDetails.CheckoutAttemptId); + + if (upiIntentDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", upiIntentDetails.RecurringDetailReference); + + if (upiIntentDetails.ShopperNotificationReferenceOption.IsSet) + writer.WriteString("shopperNotificationReference", upiIntentDetails.ShopperNotificationReference); + + if (upiIntentDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", upiIntentDetails.StoredPaymentMethodId); + + var typeRawValue = UpiIntentDetails.TypeEnumToJsonValue(upiIntentDetails.Type); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/UtilityRequest.cs b/Adyen/Model/Checkout/UtilityRequest.cs index 8c95957c0..be210b84f 100644 --- a/Adyen/Model/Checkout/UtilityRequest.cs +++ b/Adyen/Model/Checkout/UtilityRequest.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,42 +14,38 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// UtilityRequest /// - [DataContract(Name = "UtilityRequest")] - public partial class UtilityRequest : IEquatable, IValidatableObject + public partial class UtilityRequest : IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructorAttribute] - protected UtilityRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// The list of origin domains, for which origin keys are requested. (required). - public UtilityRequest(List originDomains = default(List)) + /// The list of origin domains, for which origin keys are requested. + [JsonConstructor] + public UtilityRequest(List originDomains) { - this.OriginDomains = originDomains; + OriginDomains = originDomains; + OnCreated(); } + partial void OnCreated(); + /// /// The list of origin domains, for which origin keys are requested. /// /// The list of origin domains, for which origin keys are requested. - [DataMember(Name = "originDomains", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("originDomains")] public List OriginDomains { get; set; } /// @@ -67,69 +62,103 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class UtilityRequestJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override UtilityRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as UtilityRequest); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if UtilityRequest instances are equal - /// - /// Instance of UtilityRequest to be compared - /// Boolean - public bool Equals(UtilityRequest input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option> originDomains = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "originDomains": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + originDomains = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.OriginDomains == input.OriginDomains || - this.OriginDomains != null && - input.OriginDomains != null && - this.OriginDomains.SequenceEqual(input.OriginDomains) - ); + + if (!originDomains.IsSet) + throw new ArgumentException("Property is required for class UtilityRequest.", nameof(originDomains)); + + if (originDomains.IsSet && originDomains.Value == null) + throw new ArgumentNullException(nameof(originDomains), "Property is not nullable for class UtilityRequest."); + + return new UtilityRequest(originDomains.Value); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, UtilityRequest utilityRequest, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.OriginDomains != null) - { - hashCode = (hashCode * 59) + this.OriginDomains.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, utilityRequest, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, UtilityRequest utilityRequest, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (utilityRequest.OriginDomains == null) + throw new ArgumentNullException(nameof(utilityRequest.OriginDomains), "Property is required for class UtilityRequest."); + + writer.WritePropertyName("originDomains"); + JsonSerializer.Serialize(writer, utilityRequest.OriginDomains, jsonSerializerOptions); } } - } diff --git a/Adyen/Model/Checkout/UtilityResponse.cs b/Adyen/Model/Checkout/UtilityResponse.cs index 4006a5c86..c3a3439ea 100644 --- a/Adyen/Model/Checkout/UtilityResponse.cs +++ b/Adyen/Model/Checkout/UtilityResponse.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,38 +14,46 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// UtilityResponse /// - [DataContract(Name = "UtilityResponse")] - public partial class UtilityResponse : IEquatable, IValidatableObject + public partial class UtilityResponse : IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key.. - public UtilityResponse(Dictionary originKeys = default(Dictionary)) + /// The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key. + [JsonConstructor] + public UtilityResponse(Option> originKeys = default) { - this.OriginKeys = originKeys; + OriginKeysOption = originKeys; + OnCreated(); } + partial void OnCreated(); + + /// + /// Used to track the state of OriginKeys + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option> OriginKeysOption { get; private set; } + /// /// The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key. /// /// The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key. - [DataMember(Name = "originKeys", EmitDefaultValue = false)] - public Dictionary OriginKeys { get; set; } + [JsonPropertyName("originKeys")] + public Dictionary OriginKeys { get { return this.OriginKeysOption; } set { this.OriginKeysOption = new Option>(value); } } /// /// Returns the string presentation of the object @@ -62,69 +69,103 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class UtilityResponseJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override UtilityResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as UtilityResponse); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if UtilityResponse instances are equal - /// - /// Instance of UtilityResponse to be compared - /// Boolean - public bool Equals(UtilityResponse input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option> originKeys = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "originKeys": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + originKeys = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } } - return - ( - this.OriginKeys == input.OriginKeys || - this.OriginKeys != null && - input.OriginKeys != null && - this.OriginKeys.SequenceEqual(input.OriginKeys) - ); + + if (originKeys.IsSet && originKeys.Value == null) + throw new ArgumentNullException(nameof(originKeys), "Property is not nullable for class UtilityResponse."); + + return new UtilityResponse(originKeys); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, UtilityResponse utilityResponse, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.OriginKeys != null) - { - hashCode = (hashCode * 59) + this.OriginKeys.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, utilityResponse, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, UtilityResponse utilityResponse, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (utilityResponse.OriginKeysOption.IsSet && utilityResponse.OriginKeys == null) + throw new ArgumentNullException(nameof(utilityResponse.OriginKeys), "Property is required for class UtilityResponse."); + + if (utilityResponse.OriginKeysOption.IsSet) + { + writer.WritePropertyName("originKeys"); + JsonSerializer.Serialize(writer, utilityResponse.OriginKeys, jsonSerializerOptions); + } } } - } diff --git a/Adyen/Model/Checkout/VippsDetails.cs b/Adyen/Model/Checkout/VippsDetails.cs index f3d88f6ba..ac844bd0c 100644 --- a/Adyen/Model/Checkout/VippsDetails.cs +++ b/Adyen/Model/Checkout/VippsDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,94 +14,156 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// VippsDetails /// - [DataContract(Name = "VippsDetails")] - public partial class VippsDetails : IEquatable, IValidatableObject + public partial class VippsDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// telephoneNumber + /// The checkout attempt identifier. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **vipps** (default to TypeEnum.Vipps) + [JsonConstructor] + public VippsDetails(string telephoneNumber, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + TelephoneNumber = telephoneNumber; + CheckoutAttemptIdOption = checkoutAttemptId; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **vipps** /// /// **vipps** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Vipps for value: vipps /// - [EnumMember(Value = "vipps")] Vipps = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("vipps")) + return TypeEnum.Vipps; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("vipps")) + return TypeEnum.Vipps; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Vipps) + return "vipps"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **vipps** /// /// **vipps** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Gets or Sets TelephoneNumber /// - [JsonConstructorAttribute] - protected VippsDetails() { } + [JsonPropertyName("telephoneNumber")] + public string TelephoneNumber { get; set; } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// telephoneNumber (required). - /// **vipps** (default to TypeEnum.Vipps). - public VippsDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string telephoneNumber = default(string), TypeEnum? type = TypeEnum.Vipps) - { - this.TelephoneNumber = telephoneNumber; - this.CheckoutAttemptId = checkoutAttemptId; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } /// - /// This is the `recurringDetailReference` returned in the response when you created the token. + /// Used to track the state of RecurringDetailReference /// - /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } /// - /// Gets or Sets TelephoneNumber + /// Used to track the state of StoredPaymentMethodId /// - [DataMember(Name = "telephoneNumber", IsRequired = false, EmitDefaultValue = false)] - public string TelephoneNumber { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } + + /// + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// + /// This is the `recurringDetailReference` returned in the response when you created the token. + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -112,116 +173,168 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class VippsDetails {\n"); + sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); - sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as VippsDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class VippsDetailsJsonConverter : JsonConverter + { /// - /// Returns true if VippsDetails instances are equal + /// Deserializes json to /// - /// Instance of VippsDetails to be compared - /// Boolean - public bool Equals(VippsDetails input) + /// + /// + /// + /// + /// + public override VippsDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option telephoneNumber = default; + Option checkoutAttemptId = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "telephoneNumber": + telephoneNumber = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(VippsDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (!telephoneNumber.IsSet) + throw new ArgumentException("Property is required for class VippsDetails.", nameof(telephoneNumber)); + + if (telephoneNumber.IsSet && telephoneNumber.Value == null) + throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class VippsDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class VippsDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class VippsDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class VippsDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class VippsDetails."); + + return new VippsDetails(telephoneNumber.Value, checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, VippsDetails vippsDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - if (this.TelephoneNumber != null) - { - hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, vippsDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, VippsDetails vippsDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (vippsDetails.TelephoneNumber == null) + throw new ArgumentNullException(nameof(vippsDetails.TelephoneNumber), "Property is required for class VippsDetails."); - yield break; + if (vippsDetails.CheckoutAttemptIdOption.IsSet && vippsDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(vippsDetails.CheckoutAttemptId), "Property is required for class VippsDetails."); + + if (vippsDetails.RecurringDetailReferenceOption.IsSet && vippsDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(vippsDetails.RecurringDetailReference), "Property is required for class VippsDetails."); + + if (vippsDetails.StoredPaymentMethodIdOption.IsSet && vippsDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(vippsDetails.StoredPaymentMethodId), "Property is required for class VippsDetails."); + + writer.WriteString("telephoneNumber", vippsDetails.TelephoneNumber); + + if (vippsDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", vippsDetails.CheckoutAttemptId); + + if (vippsDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", vippsDetails.RecurringDetailReference); + + if (vippsDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", vippsDetails.StoredPaymentMethodId); + + var typeRawValue = VippsDetails.TypeEnumToJsonValue(vippsDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/VisaCheckoutDetails.cs b/Adyen/Model/Checkout/VisaCheckoutDetails.cs index e51dd8658..d3ed8913a 100644 --- a/Adyen/Model/Checkout/VisaCheckoutDetails.cs +++ b/Adyen/Model/Checkout/VisaCheckoutDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,107 +14,208 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// VisaCheckoutDetails /// - [DataContract(Name = "VisaCheckoutDetails")] - public partial class VisaCheckoutDetails : IEquatable, IValidatableObject + public partial class VisaCheckoutDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The Visa Click to Pay Call ID value. When your shopper selects a payment and/or a shipping address from Visa Click to Pay, you will receive a Visa Click to Pay Call ID. + /// The checkout attempt identifier. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + /// **visacheckout** (default to TypeEnum.Visacheckout) + [JsonConstructor] + public VisaCheckoutDetails(string visaCheckoutCallId, Option checkoutAttemptId = default, Option fundingSource = default, Option type = default) + { + VisaCheckoutCallId = visaCheckoutCallId; + CheckoutAttemptIdOption = checkoutAttemptId; + FundingSourceOption = fundingSource; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// - [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// - [EnumMember(Value = "debit")] Debit = 2 + } + /// + /// Returns a + /// + /// + /// + /// + public static FundingSourceEnum FundingSourceEnumFromString(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) + { + if (value.Equals("credit")) + return FundingSourceEnum.Credit; + + if (value.Equals("debit")) + return FundingSourceEnum.Debit; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) + { + if (value == FundingSourceEnum.Credit) + return "credit"; + + if (value == FundingSourceEnum.Debit) + return "debit"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of FundingSource + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [DataMember(Name = "fundingSource", EmitDefaultValue = false)] - public FundingSourceEnum? FundingSource { get; set; } + [JsonPropertyName("fundingSource")] + public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } + /// /// **visacheckout** /// /// **visacheckout** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Visacheckout for value: visacheckout /// - [EnumMember(Value = "visacheckout")] Visacheckout = 1 - } - /// - /// **visacheckout** + /// Returns a /// - /// **visacheckout** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("visacheckout")) + return TypeEnum.Visacheckout; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + /// - /// Initializes a new instance of the class. + /// Returns a /// - [JsonConstructorAttribute] - protected VisaCheckoutDetails() { } + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("visacheckout")) + return TypeEnum.Visacheckout; + + return null; + } + /// - /// Initializes a new instance of the class. + /// Converts the to the json value /// - /// The checkout attempt identifier.. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. - /// **visacheckout** (default to TypeEnum.Visacheckout). - /// The Visa Click to Pay Call ID value. When your shopper selects a payment and/or a shipping address from Visa Click to Pay, you will receive a Visa Click to Pay Call ID. (required). - public VisaCheckoutDetails(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), TypeEnum? type = TypeEnum.Visacheckout, string visaCheckoutCallId = default(string)) + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) { - this.VisaCheckoutCallId = visaCheckoutCallId; - this.CheckoutAttemptId = checkoutAttemptId; - this.FundingSource = fundingSource; - this.Type = type; + if (value == TypeEnum.Visacheckout) + return "visacheckout"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); } /// - /// The checkout attempt identifier. + /// Used to track the state of Type /// - /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } + + /// + /// **visacheckout** + /// + /// **visacheckout** + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } /// /// The Visa Click to Pay Call ID value. When your shopper selects a payment and/or a shipping address from Visa Click to Pay, you will receive a Visa Click to Pay Call ID. /// /// The Visa Click to Pay Call ID value. When your shopper selects a payment and/or a shipping address from Visa Click to Pay, you will receive a Visa Click to Pay Call ID. - [DataMember(Name = "visaCheckoutCallId", IsRequired = false, EmitDefaultValue = false)] + [JsonPropertyName("visaCheckoutCallId")] public string VisaCheckoutCallId { get; set; } + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } + + /// + /// The checkout attempt identifier. + /// + /// The checkout attempt identifier. + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + /// /// Returns the string presentation of the object /// @@ -124,96 +224,146 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class VisaCheckoutDetails {\n"); + sb.Append(" VisaCheckoutCallId: ").Append(VisaCheckoutCallId).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" VisaCheckoutCallId: ").Append(VisaCheckoutCallId).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class VisaCheckoutDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override VisaCheckoutDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as VisaCheckoutDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if VisaCheckoutDetails instances are equal - /// - /// Instance of VisaCheckoutDetails to be compared - /// Boolean - public bool Equals(VisaCheckoutDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option visaCheckoutCallId = default; + Option checkoutAttemptId = default; + Option fundingSource = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "visaCheckoutCallId": + visaCheckoutCallId = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "fundingSource": + string fundingSourceRawValue = utf8JsonReader.GetString(); + if (fundingSourceRawValue != null) + fundingSource = new Option(VisaCheckoutDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(VisaCheckoutDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.FundingSource == input.FundingSource || - this.FundingSource.Equals(input.FundingSource) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.VisaCheckoutCallId == input.VisaCheckoutCallId || - (this.VisaCheckoutCallId != null && - this.VisaCheckoutCallId.Equals(input.VisaCheckoutCallId)) - ); + + if (!visaCheckoutCallId.IsSet) + throw new ArgumentException("Property is required for class VisaCheckoutDetails.", nameof(visaCheckoutCallId)); + + if (visaCheckoutCallId.IsSet && visaCheckoutCallId.Value == null) + throw new ArgumentNullException(nameof(visaCheckoutCallId), "Property is not nullable for class VisaCheckoutDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class VisaCheckoutDetails."); + + if (fundingSource.IsSet && fundingSource.Value == null) + throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class VisaCheckoutDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class VisaCheckoutDetails."); + + return new VisaCheckoutDetails(visaCheckoutCallId.Value, checkoutAttemptId, fundingSource, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, VisaCheckoutDetails visaCheckoutDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - if (this.VisaCheckoutCallId != null) - { - hashCode = (hashCode * 59) + this.VisaCheckoutCallId.GetHashCode(); - } - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, visaCheckoutDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, VisaCheckoutDetails visaCheckoutDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (visaCheckoutDetails.VisaCheckoutCallId == null) + throw new ArgumentNullException(nameof(visaCheckoutDetails.VisaCheckoutCallId), "Property is required for class VisaCheckoutDetails."); + + if (visaCheckoutDetails.CheckoutAttemptIdOption.IsSet && visaCheckoutDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(visaCheckoutDetails.CheckoutAttemptId), "Property is required for class VisaCheckoutDetails."); + + writer.WriteString("visaCheckoutCallId", visaCheckoutDetails.VisaCheckoutCallId); + + if (visaCheckoutDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", visaCheckoutDetails.CheckoutAttemptId); + + var fundingSourceRawValue = VisaCheckoutDetails.FundingSourceEnumToJsonValue(visaCheckoutDetails.FundingSourceOption.Value.Value); + writer.WriteString("fundingSource", fundingSourceRawValue); + var typeRawValue = VisaCheckoutDetails.TypeEnumToJsonValue(visaCheckoutDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/WeChatPayDetails.cs b/Adyen/Model/Checkout/WeChatPayDetails.cs index ef5b1aafb..dd382d819 100644 --- a/Adyen/Model/Checkout/WeChatPayDetails.cs +++ b/Adyen/Model/Checkout/WeChatPayDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,68 +14,129 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// WeChatPayDetails /// - [DataContract(Name = "WeChatPayDetails")] - public partial class WeChatPayDetails : IEquatable, IValidatableObject + public partial class WeChatPayDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// **wechatpay** (default to TypeEnum.Wechatpay) + [JsonConstructor] + public WeChatPayDetails(Option checkoutAttemptId = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **wechatpay** /// /// **wechatpay** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Wechatpay for value: wechatpay /// - [EnumMember(Value = "wechatpay")] Wechatpay = 1, /// /// Enum WechatpayPos for value: wechatpay_pos /// - [EnumMember(Value = "wechatpay_pos")] WechatpayPos = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("wechatpay")) + return TypeEnum.Wechatpay; + if (value.Equals("wechatpay_pos")) + return TypeEnum.WechatpayPos; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("wechatpay")) + return TypeEnum.Wechatpay; + + if (value.Equals("wechatpay_pos")) + return TypeEnum.WechatpayPos; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Wechatpay) + return "wechatpay"; + + if (value == TypeEnum.WechatpayPos) + return "wechatpay_pos"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **wechatpay** /// /// **wechatpay** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// **wechatpay** (default to TypeEnum.Wechatpay). - public WeChatPayDetails(string checkoutAttemptId = default(string), TypeEnum? type = TypeEnum.Wechatpay) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -93,73 +153,111 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class WeChatPayDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override WeChatPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as WeChatPayDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if WeChatPayDetails instances are equal - /// - /// Instance of WeChatPayDetails to be compared - /// Boolean - public bool Equals(WeChatPayDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(WeChatPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class WeChatPayDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class WeChatPayDetails."); + + return new WeChatPayDetails(checkoutAttemptId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, WeChatPayDetails weChatPayDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, weChatPayDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, WeChatPayDetails weChatPayDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (weChatPayDetails.CheckoutAttemptIdOption.IsSet && weChatPayDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(weChatPayDetails.CheckoutAttemptId), "Property is required for class WeChatPayDetails."); + + if (weChatPayDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", weChatPayDetails.CheckoutAttemptId); + + var typeRawValue = WeChatPayDetails.TypeEnumToJsonValue(weChatPayDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs b/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs index f7ed49490..eaa676b6f 100644 --- a/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs +++ b/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,78 +14,145 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// WeChatPayMiniProgramDetails /// - [DataContract(Name = "WeChatPayMiniProgramDetails")] - public partial class WeChatPayMiniProgramDetails : IEquatable, IValidatableObject + public partial class WeChatPayMiniProgramDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// appId + /// The checkout attempt identifier. + /// openid + /// **wechatpayMiniProgram** (default to TypeEnum.WechatpayMiniProgram) + [JsonConstructor] + public WeChatPayMiniProgramDetails(Option appId = default, Option checkoutAttemptId = default, Option openid = default, Option type = default) + { + AppIdOption = appId; + CheckoutAttemptIdOption = checkoutAttemptId; + OpenidOption = openid; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **wechatpayMiniProgram** /// /// **wechatpayMiniProgram** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum WechatpayMiniProgram for value: wechatpayMiniProgram /// - [EnumMember(Value = "wechatpayMiniProgram")] WechatpayMiniProgram = 1 + } + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("wechatpayMiniProgram")) + return TypeEnum.WechatpayMiniProgram; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("wechatpayMiniProgram")) + return TypeEnum.WechatpayMiniProgram; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.WechatpayMiniProgram) + return "wechatpayMiniProgram"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **wechatpayMiniProgram** /// /// **wechatpayMiniProgram** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of AppId /// - /// appId. - /// The checkout attempt identifier.. - /// openid. - /// **wechatpayMiniProgram** (default to TypeEnum.WechatpayMiniProgram). - public WeChatPayMiniProgramDetails(string appId = default(string), string checkoutAttemptId = default(string), string openid = default(string), TypeEnum? type = TypeEnum.WechatpayMiniProgram) - { - this.AppId = appId; - this.CheckoutAttemptId = checkoutAttemptId; - this.Openid = openid; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option AppIdOption { get; private set; } /// /// Gets or Sets AppId /// - [DataMember(Name = "appId", EmitDefaultValue = false)] - public string AppId { get; set; } + [JsonPropertyName("appId")] + public string AppId { get { return this.AppIdOption; } set { this.AppIdOption = new Option(value); } } + + /// + /// Used to track the state of CheckoutAttemptId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of Openid + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option OpenidOption { get; private set; } /// /// Gets or Sets Openid /// - [DataMember(Name = "openid", EmitDefaultValue = false)] - public string Openid { get; set; } + [JsonPropertyName("openid")] + public string Openid { get { return this.OpenidOption; } set { this.OpenidOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -105,91 +171,137 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + yield break; } + } + /// + /// A Json converter for type + /// + public class WeChatPayMiniProgramDetailsJsonConverter : JsonConverter + { /// - /// Returns true if objects are equal + /// Deserializes json to /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) + /// + /// + /// + /// + /// + public override WeChatPayMiniProgramDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - return this.Equals(input as WeChatPayMiniProgramDetails); - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Returns true if WeChatPayMiniProgramDetails instances are equal - /// - /// Instance of WeChatPayMiniProgramDetails to be compared - /// Boolean - public bool Equals(WeChatPayMiniProgramDetails input) - { - if (input == null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option appId = default; + Option checkoutAttemptId = default; + Option openid = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "appId": + appId = new Option(utf8JsonReader.GetString()); + break; + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "openid": + openid = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(WeChatPayMiniProgramDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.AppId == input.AppId || - (this.AppId != null && - this.AppId.Equals(input.AppId)) - ) && - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.Openid == input.Openid || - (this.Openid != null && - this.Openid.Equals(input.Openid)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (appId.IsSet && appId.Value == null) + throw new ArgumentNullException(nameof(appId), "Property is not nullable for class WeChatPayMiniProgramDetails."); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class WeChatPayMiniProgramDetails."); + + if (openid.IsSet && openid.Value == null) + throw new ArgumentNullException(nameof(openid), "Property is not nullable for class WeChatPayMiniProgramDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class WeChatPayMiniProgramDetails."); + + return new WeChatPayMiniProgramDetails(appId, checkoutAttemptId, openid, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, WeChatPayMiniProgramDetails weChatPayMiniProgramDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AppId != null) - { - hashCode = (hashCode * 59) + this.AppId.GetHashCode(); - } - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.Openid != null) - { - hashCode = (hashCode * 59) + this.Openid.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, weChatPayMiniProgramDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, WeChatPayMiniProgramDetails weChatPayMiniProgramDetails, JsonSerializerOptions jsonSerializerOptions) { - yield break; + if (weChatPayMiniProgramDetails.AppIdOption.IsSet && weChatPayMiniProgramDetails.AppId == null) + throw new ArgumentNullException(nameof(weChatPayMiniProgramDetails.AppId), "Property is required for class WeChatPayMiniProgramDetails."); + + if (weChatPayMiniProgramDetails.CheckoutAttemptIdOption.IsSet && weChatPayMiniProgramDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(weChatPayMiniProgramDetails.CheckoutAttemptId), "Property is required for class WeChatPayMiniProgramDetails."); + + if (weChatPayMiniProgramDetails.OpenidOption.IsSet && weChatPayMiniProgramDetails.Openid == null) + throw new ArgumentNullException(nameof(weChatPayMiniProgramDetails.Openid), "Property is required for class WeChatPayMiniProgramDetails."); + + if (weChatPayMiniProgramDetails.AppIdOption.IsSet) + writer.WriteString("appId", weChatPayMiniProgramDetails.AppId); + + if (weChatPayMiniProgramDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", weChatPayMiniProgramDetails.CheckoutAttemptId); + + if (weChatPayMiniProgramDetails.OpenidOption.IsSet) + writer.WriteString("openid", weChatPayMiniProgramDetails.Openid); + + var typeRawValue = WeChatPayMiniProgramDetails.TypeEnumToJsonValue(weChatPayMiniProgramDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Model/Checkout/ZipDetails.cs b/Adyen/Model/Checkout/ZipDetails.cs index d4c340e79..2ee55899c 100644 --- a/Adyen/Model/Checkout/ZipDetails.cs +++ b/Adyen/Model/Checkout/ZipDetails.cs @@ -1,13 +1,12 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections; @@ -15,96 +14,178 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; -using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using Adyen.Client; namespace Adyen.Model.Checkout { /// /// ZipDetails /// - [DataContract(Name = "ZipDetails")] - public partial class ZipDetails : IEquatable, IValidatableObject + public partial class ZipDetails : IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// The checkout attempt identifier. + /// Set this to **true** if the shopper would like to pick up and collect their order, instead of having the goods delivered to them. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// This is the `recurringDetailReference` returned in the response when you created the token. + /// **zip** (default to TypeEnum.Zip) + [JsonConstructor] + public ZipDetails(Option checkoutAttemptId = default, Option clickAndCollect = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) + { + CheckoutAttemptIdOption = checkoutAttemptId; + ClickAndCollectOption = clickAndCollect; + RecurringDetailReferenceOption = recurringDetailReference; + StoredPaymentMethodIdOption = storedPaymentMethodId; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + /// /// **zip** /// /// **zip** - [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Zip for value: zip /// - [EnumMember(Value = "zip")] Zip = 1, /// /// Enum ZipPos for value: zip_pos /// - [EnumMember(Value = "zip_pos")] ZipPos = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("zip")) + return TypeEnum.Zip; + + if (value.Equals("zip_pos")) + return TypeEnum.ZipPos; + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("zip")) + return TypeEnum.Zip; + + if (value.Equals("zip_pos")) + return TypeEnum.ZipPos; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Zip) + return "zip"; + + if (value == TypeEnum.ZipPos) + return "zip_pos"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } /// /// **zip** /// /// **zip** - [DataMember(Name = "type", EmitDefaultValue = false)] - public TypeEnum? Type { get; set; } + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// - /// Initializes a new instance of the class. + /// Used to track the state of CheckoutAttemptId /// - /// The checkout attempt identifier.. - /// Set this to **true** if the shopper would like to pick up and collect their order, instead of having the goods delivered to them.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// This is the `recurringDetailReference` returned in the response when you created the token.. - /// **zip** (default to TypeEnum.Zip). - public ZipDetails(string checkoutAttemptId = default(string), string clickAndCollect = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Zip) - { - this.CheckoutAttemptId = checkoutAttemptId; - this.ClickAndCollect = clickAndCollect; - this.RecurringDetailReference = recurringDetailReference; - this.StoredPaymentMethodId = storedPaymentMethodId; - this.Type = type; - } + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option CheckoutAttemptIdOption { get; private set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] - public string CheckoutAttemptId { get; set; } + [JsonPropertyName("checkoutAttemptId")] + public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + + /// + /// Used to track the state of ClickAndCollect + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option ClickAndCollectOption { get; private set; } /// /// Set this to **true** if the shopper would like to pick up and collect their order, instead of having the goods delivered to them. /// /// Set this to **true** if the shopper would like to pick up and collect their order, instead of having the goods delivered to them. - [DataMember(Name = "clickAndCollect", EmitDefaultValue = false)] - public string ClickAndCollect { get; set; } + [JsonPropertyName("clickAndCollect")] + public string ClickAndCollect { get { return this.ClickAndCollectOption; } set { this.ClickAndCollectOption = new Option(value); } } + + /// + /// Used to track the state of RecurringDetailReference + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option RecurringDetailReferenceOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] - [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] - public string RecurringDetailReference { get; set; } + [JsonPropertyName("recurringDetailReference")] + [Obsolete] + public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + + /// + /// Used to track the state of StoredPaymentMethodId + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StoredPaymentMethodIdOption { get; private set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] - public string StoredPaymentMethodId { get; set; } + [JsonPropertyName("storedPaymentMethodId")] + public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } /// /// Returns the string presentation of the object @@ -124,106 +205,156 @@ public override string ToString() } /// - /// Returns the JSON string presentation of the object + /// To validate all properties of the instance /// - /// JSON string presentation of the object - public virtual string ToJson() + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ZipDetails); + yield break; } + } + /// + /// A Json converter for type + /// + public class ZipDetailsJsonConverter : JsonConverter + { /// - /// Returns true if ZipDetails instances are equal + /// Deserializes json to /// - /// Instance of ZipDetails to be compared - /// Boolean - public bool Equals(ZipDetails input) + /// + /// + /// + /// + /// + public override ZipDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - if (input == null) + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option checkoutAttemptId = default; + Option clickAndCollect = default; + Option recurringDetailReference = default; + Option storedPaymentMethodId = default; + Option type = default; + + while (utf8JsonReader.Read()) { - return false; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "checkoutAttemptId": + checkoutAttemptId = new Option(utf8JsonReader.GetString()); + break; + case "clickAndCollect": + clickAndCollect = new Option(utf8JsonReader.GetString()); + break; + case "recurringDetailReference": + recurringDetailReference = new Option(utf8JsonReader.GetString()); + break; + case "storedPaymentMethodId": + storedPaymentMethodId = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(ZipDetails.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } } - return - ( - this.CheckoutAttemptId == input.CheckoutAttemptId || - (this.CheckoutAttemptId != null && - this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) - ) && - ( - this.ClickAndCollect == input.ClickAndCollect || - (this.ClickAndCollect != null && - this.ClickAndCollect.Equals(input.ClickAndCollect)) - ) && - ( - this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && - ( - this.StoredPaymentMethodId == input.StoredPaymentMethodId || - (this.StoredPaymentMethodId != null && - this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) - ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ); + + if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) + throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class ZipDetails."); + + if (clickAndCollect.IsSet && clickAndCollect.Value == null) + throw new ArgumentNullException(nameof(clickAndCollect), "Property is not nullable for class ZipDetails."); + + if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) + throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class ZipDetails."); + + if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class ZipDetails."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class ZipDetails."); + + return new ZipDetails(checkoutAttemptId, clickAndCollect, recurringDetailReference, storedPaymentMethodId, type); } /// - /// Gets the hash code + /// Serializes a /// - /// Hash code - public override int GetHashCode() + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZipDetails zipDetails, JsonSerializerOptions jsonSerializerOptions) { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CheckoutAttemptId != null) - { - hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); - } - if (this.ClickAndCollect != null) - { - hashCode = (hashCode * 59) + this.ClickAndCollect.GetHashCode(); - } - if (this.RecurringDetailReference != null) - { - hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); - } - if (this.StoredPaymentMethodId != null) - { - hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); - } - hashCode = (hashCode * 59) + this.Type.GetHashCode(); - return hashCode; - } + writer.WriteStartObject(); + + WriteProperties(writer, zipDetails, jsonSerializerOptions); + writer.WriteEndObject(); } + /// - /// To validate all properties of the instance + /// Serializes the properties of /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ZipDetails zipDetails, JsonSerializerOptions jsonSerializerOptions) { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + if (zipDetails.CheckoutAttemptIdOption.IsSet && zipDetails.CheckoutAttemptId == null) + throw new ArgumentNullException(nameof(zipDetails.CheckoutAttemptId), "Property is required for class ZipDetails."); - yield break; + if (zipDetails.ClickAndCollectOption.IsSet && zipDetails.ClickAndCollect == null) + throw new ArgumentNullException(nameof(zipDetails.ClickAndCollect), "Property is required for class ZipDetails."); + + if (zipDetails.RecurringDetailReferenceOption.IsSet && zipDetails.RecurringDetailReference == null) + throw new ArgumentNullException(nameof(zipDetails.RecurringDetailReference), "Property is required for class ZipDetails."); + + if (zipDetails.StoredPaymentMethodIdOption.IsSet && zipDetails.StoredPaymentMethodId == null) + throw new ArgumentNullException(nameof(zipDetails.StoredPaymentMethodId), "Property is required for class ZipDetails."); + + if (zipDetails.CheckoutAttemptIdOption.IsSet) + writer.WriteString("checkoutAttemptId", zipDetails.CheckoutAttemptId); + + if (zipDetails.ClickAndCollectOption.IsSet) + writer.WriteString("clickAndCollect", zipDetails.ClickAndCollect); + + if (zipDetails.RecurringDetailReferenceOption.IsSet) + writer.WriteString("recurringDetailReference", zipDetails.RecurringDetailReference); + + if (zipDetails.StoredPaymentMethodIdOption.IsSet) + writer.WriteString("storedPaymentMethodId", zipDetails.StoredPaymentMethodId); + + var typeRawValue = ZipDetails.TypeEnumToJsonValue(zipDetails.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); } } - } diff --git a/Adyen/Service/Checkout/DonationsService.cs b/Adyen/Service/Checkout/DonationsService.cs index d34883f9c..1ec1878f2 100644 --- a/Adyen/Service/Checkout/DonationsService.cs +++ b/Adyen/Service/Checkout/DonationsService.cs @@ -1,99 +1,1166 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections.Generic; -using System.Net.Http; -using System.Threading; +using System.Net; using System.Threading.Tasks; -using Adyen.Model; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Adyen.Client; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// DonationsService Interface + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. /// - public interface IDonationsService + public interface IDonationsService : IApi { + /// + /// The class containing the events + /// + DonationsServiceEvents Events { get; } + /// /// Get a list of donation campaigns. /// - /// - - /// - Additional request options. - /// . - Model.Checkout.DonationCampaignsResponse DonationCampaigns(DonationCampaignsRequest donationCampaignsRequest = default, RequestOptions requestOptions = default); - + /// + /// Queries the available donation campaigns for a donation based on the donation context (like merchant account, currency, and locale). The response contains active donation campaigns. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task DonationCampaignsAsync(Option idempotencyKey = default, Option donationCampaignsRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Get a list of donation campaigns. /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task DonationCampaignsAsync(DonationCampaignsRequest donationCampaignsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Queries the available donation campaigns for a donation based on the donation context (like merchant account, currency, and locale). The response contains active donation campaigns. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task DonationCampaignsOrDefaultAsync(Option idempotencyKey = default, Option donationCampaignsRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Start a transaction for donations /// - /// - - /// - Additional request options. - /// . - Model.Checkout.DonationPaymentResponse Donations(DonationPaymentRequest donationPaymentRequest = default, RequestOptions requestOptions = default); - + /// + /// Takes in the donation token generated by the `/payments` request and uses it to make the donation for the donation account specified in the request. For more information, see [Donations](https://docs.adyen.com/online-payments/donations). + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task DonationsAsync(Option idempotencyKey = default, Option donationPaymentRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Start a transaction for donations /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task DonationsAsync(DonationPaymentRequest donationPaymentRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Takes in the donation token generated by the `/payments` request and uses it to make the donation for the donation account specified in the request. For more information, see [Donations](https://docs.adyen.com/online-payments/donations). + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task DonationsOrDefaultAsync(Option idempotencyKey = default, Option donationPaymentRequest = default, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IDonationCampaignsApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface IDonationsApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DonationsServiceEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnDonationCampaigns; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDonationCampaigns; + + internal void ExecuteOnDonationCampaigns(DonationsService.DonationCampaignsApiResponse apiResponse) + { + OnDonationCampaigns?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDonationCampaigns(Exception exception) + { + OnErrorDonationCampaigns?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnDonations; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDonations; + + internal void ExecuteOnDonations(DonationsService.DonationsApiResponse apiResponse) + { + OnDonations?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDonations(Exception exception) + { + OnErrorDonations?.Invoke(this, new ExceptionEventArgs(exception)); + } } - + /// - /// Represents a collection of functions to interact with the DonationsService API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public class DonationsService : AbstractService, IDonationsService + public sealed partial class DonationsService : IDonationsService { - private readonly string _baseUrl; - - public DonationsService(AdyenClient adyenClient) : base(adyenClient) + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DonationsServiceEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DonationsService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DonationsServiceEvents donationsServiceEvents, + TokenProvider apiKeyProvider, + TokenProvider basicTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = donationsServiceEvents; + ApiKeyProvider = apiKeyProvider; + BasicTokenProvider = basicTokenProvider; + } + + partial void FormatDonationCampaigns(ref string idempotencyKey, DonationCampaignsRequest donationCampaignsRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateDonationCampaigns(string idempotencyKey, DonationCampaignsRequest donationCampaignsRequest) + { + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (donationCampaignsRequest.IsSet && donationCampaignsRequest.Value == null) + throw new ArgumentNullException(nameof(donationCampaignsRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterDonationCampaignsDefaultImplementation(IDonationCampaignsApiResponse apiResponseLocalVar, string idempotencyKey, DonationCampaignsRequest donationCampaignsRequest) + { + bool suppressDefaultLog = false; + AfterDonationCampaigns(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, donationCampaignsRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterDonationCampaigns(ref bool suppressDefaultLog, IDonationCampaignsApiResponse apiResponseLocalVar, string idempotencyKey, DonationCampaignsRequest donationCampaignsRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorDonationCampaignsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, DonationCampaignsRequest donationCampaignsRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorDonationCampaigns(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, donationCampaignsRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorDonationCampaigns(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, DonationCampaignsRequest donationCampaignsRequest); + + /// + /// Get a list of donation campaigns. Queries the available donation campaigns for a donation based on the donation context (like merchant account, currency, and locale). The response contains active donation campaigns. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DonationCampaignsOrDefaultAsync(Option idempotencyKey = default, Option donationCampaignsRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DonationCampaignsAsync(idempotencyKey, donationCampaignsRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Get a list of donation campaigns. Queries the available donation campaigns for a donation based on the donation context (like merchant account, currency, and locale). The response contains active donation campaigns. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DonationCampaignsAsync(Option idempotencyKey = default, Option donationCampaignsRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDonationCampaigns(idempotencyKey, donationCampaignsRequest); + + FormatDonationCampaigns(ref idempotencyKey, donationCampaignsRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/donationCampaigns"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (donationCampaignsRequest.IsSet) + httpRequestMessageLocalVar.Content = (donationCampaignsRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(donationCampaignsRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DonationCampaignsApiResponse apiResponseLocalVar = new DonationCampaignsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/donationCampaigns", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDonationCampaignsDefaultImplementation(apiResponseLocalVar, idempotencyKey, donationCampaignsRequest); + + Events.ExecuteOnDonationCampaigns(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDonationCampaignsDefaultImplementation(e, "/donationCampaigns", uriBuilderLocalVar.Path, idempotencyKey, donationCampaignsRequest); + Events.ExecuteOnErrorDonationCampaigns(e); + throw; + } + } + + /// + /// The + /// + public partial class DonationCampaignsApiResponse : Adyen.Client.ApiResponse, IDonationCampaignsApiResponse { - _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DonationCampaignsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.DonationCampaignsResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.DonationCampaignsResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatDonations(ref string idempotencyKey, DonationPaymentRequest donationPaymentRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateDonations(string idempotencyKey, DonationPaymentRequest donationPaymentRequest) + { + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (donationPaymentRequest.IsSet && donationPaymentRequest.Value == null) + throw new ArgumentNullException(nameof(donationPaymentRequest)); } - - public Model.Checkout.DonationCampaignsResponse DonationCampaigns(DonationCampaignsRequest donationCampaignsRequest = default, RequestOptions requestOptions = default) + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterDonationsDefaultImplementation(IDonationsApiResponse apiResponseLocalVar, string idempotencyKey, DonationPaymentRequest donationPaymentRequest) + { + bool suppressDefaultLog = false; + AfterDonations(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, donationPaymentRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterDonations(ref bool suppressDefaultLog, IDonationsApiResponse apiResponseLocalVar, string idempotencyKey, DonationPaymentRequest donationPaymentRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorDonationsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, DonationPaymentRequest donationPaymentRequest) { - return DonationCampaignsAsync(donationCampaignsRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + bool suppressDefaultLogLocalVar = false; + OnErrorDonations(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, donationPaymentRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); } - public async Task DonationCampaignsAsync(DonationCampaignsRequest donationCampaignsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorDonations(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, DonationPaymentRequest donationPaymentRequest); + + /// + /// Start a transaction for donations Takes in the donation token generated by the `/payments` request and uses it to make the donation for the donation account specified in the request. For more information, see [Donations](https://docs.adyen.com/online-payments/donations). + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DonationsOrDefaultAsync(Option idempotencyKey = default, Option donationPaymentRequest = default, System.Threading.CancellationToken cancellationToken = default) { - var endpoint = _baseUrl + "/donationCampaigns"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(donationCampaignsRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + try + { + return await DonationsAsync(idempotencyKey, donationPaymentRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } } - - public Model.Checkout.DonationPaymentResponse Donations(DonationPaymentRequest donationPaymentRequest = default, RequestOptions requestOptions = default) + + /// + /// Start a transaction for donations Takes in the donation token generated by the `/payments` request and uses it to make the donation for the donation account specified in the request. For more information, see [Donations](https://docs.adyen.com/online-payments/donations). + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DonationsAsync(Option idempotencyKey = default, Option donationPaymentRequest = default, System.Threading.CancellationToken cancellationToken = default) { - return DonationsAsync(donationPaymentRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDonations(idempotencyKey, donationPaymentRequest); + + FormatDonations(ref idempotencyKey, donationPaymentRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/donations"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (donationPaymentRequest.IsSet) + httpRequestMessageLocalVar.Content = (donationPaymentRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(donationPaymentRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DonationsApiResponse apiResponseLocalVar = new DonationsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/donations", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDonationsDefaultImplementation(apiResponseLocalVar, idempotencyKey, donationPaymentRequest); + + Events.ExecuteOnDonations(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDonationsDefaultImplementation(e, "/donations", uriBuilderLocalVar.Path, idempotencyKey, donationPaymentRequest); + Events.ExecuteOnErrorDonations(e); + throw; + } } - public async Task DonationsAsync(DonationPaymentRequest donationPaymentRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// The + /// + public partial class DonationsApiResponse : Adyen.Client.ApiResponse, IDonationsApiResponse { - var endpoint = _baseUrl + "/donations"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(donationPaymentRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DonationsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.DonationPaymentResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.DonationPaymentResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } } -} \ No newline at end of file +} diff --git a/Adyen/Service/Checkout/IApi.cs b/Adyen/Service/Checkout/IApi.cs new file mode 100644 index 000000000..929f1eeab --- /dev/null +++ b/Adyen/Service/Checkout/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Adyen.Service.Checkout +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + System.Net.Http.HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/Adyen/Service/Checkout/ModificationsService.cs b/Adyen/Service/Checkout/ModificationsService.cs index 8a7e485a7..9c2304907 100644 --- a/Adyen/Service/Checkout/ModificationsService.cs +++ b/Adyen/Service/Checkout/ModificationsService.cs @@ -1,225 +1,3371 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections.Generic; -using System.Net.Http; -using System.Threading; +using System.Net; using System.Threading.Tasks; -using Adyen.Model; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Adyen.Client; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// ModificationsService Interface + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. /// - public interface IModificationsService + public interface IModificationsService : IApi { + /// + /// The class containing the events + /// + ModificationsServiceEvents Events { get; } + /// /// Cancel an authorised payment /// - /// - - /// - Additional request options. - /// . - Model.Checkout.StandalonePaymentCancelResponse CancelAuthorisedPayment(StandalonePaymentCancelRequest standalonePaymentCancelRequest = default, RequestOptions requestOptions = default); - + /// + /// Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**TECHNICAL_CANCEL** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment using the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/payments/{paymentPspReference}/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task CancelAuthorisedPaymentAsync(Option idempotencyKey = default, Option standalonePaymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Cancel an authorised payment /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task CancelAuthorisedPaymentAsync(StandalonePaymentCancelRequest standalonePaymentCancelRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**TECHNICAL_CANCEL** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment using the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/payments/{paymentPspReference}/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task CancelAuthorisedPaymentOrDefaultAsync(Option idempotencyKey = default, Option standalonePaymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Cancel an authorised payment /// - /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. - /// - - /// - Additional request options. - /// . - Model.Checkout.PaymentCancelResponse CancelAuthorisedPaymentByPspReference(string paymentPspReference, PaymentCancelRequest paymentCancelRequest = default, RequestOptions requestOptions = default); - + /// + /// Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCELLATION** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment but don't have the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). + /// + /// Thrown when fails to make API call + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task CancelAuthorisedPaymentByPspReferenceAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Cancel an authorised payment /// - /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task CancelAuthorisedPaymentByPspReferenceAsync(string paymentPspReference, PaymentCancelRequest paymentCancelRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCELLATION** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment but don't have the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). + /// + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task CancelAuthorisedPaymentByPspReferenceOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Capture an authorised payment /// - /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. - /// - - /// - Additional request options. - /// . - Model.Checkout.PaymentCaptureResponse CaptureAuthorisedPayment(string paymentPspReference, PaymentCaptureRequest paymentCaptureRequest = default, RequestOptions requestOptions = default); - + /// + /// Captures an authorised payment and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CAPTURE** webhook](https://docs.adyen.com/online-payments/capture#capture-notification). You can capture either the full authorised amount or a part of the authorised amount. By default, any unclaimed amount after a partial capture gets cancelled. This does not apply if you enabled multiple partial captures on your account and the payment method supports multiple partial captures. [Automatic capture](https://docs.adyen.com/online-payments/capture#automatic-capture) is the default setting for most payment methods. In these cases, you don't need to make capture requests. However, making capture requests for payments that are captured automatically does not result in double charges. For more information, refer to [Capture](https://docs.adyen.com/online-payments/capture). + /// + /// Thrown when fails to make API call + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task CaptureAuthorisedPaymentAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCaptureRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Capture an authorised payment /// - /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task CaptureAuthorisedPaymentAsync(string paymentPspReference, PaymentCaptureRequest paymentCaptureRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Captures an authorised payment and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CAPTURE** webhook](https://docs.adyen.com/online-payments/capture#capture-notification). You can capture either the full authorised amount or a part of the authorised amount. By default, any unclaimed amount after a partial capture gets cancelled. This does not apply if you enabled multiple partial captures on your account and the payment method supports multiple partial captures. [Automatic capture](https://docs.adyen.com/online-payments/capture#automatic-capture) is the default setting for most payment methods. In these cases, you don't need to make capture requests. However, making capture requests for payments that are captured automatically does not result in double charges. For more information, refer to [Capture](https://docs.adyen.com/online-payments/capture). + /// + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task CaptureAuthorisedPaymentOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCaptureRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Refund a captured payment /// - /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. - /// - - /// - Additional request options. - /// . - Model.Checkout.PaymentRefundResponse RefundCapturedPayment(string paymentPspReference, PaymentRefundRequest paymentRefundRequest = default, RequestOptions requestOptions = default); - + /// + /// Refunds a payment that has been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**REFUND** webhook](https://docs.adyen.com/online-payments/refund#refund-webhook). You can refund either the full captured amount or a part of the captured amount. You can also perform multiple partial refunds, as long as their sum doesn't exceed the captured amount. > Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as [cards](https://docs.adyen.com/payment-methods/cards#supported-cards), [iDEAL](https://docs.adyen.com/payment-methods/ideal), or [Klarna](https://docs.adyen.com/payment-methods/klarna). If you want to refund a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Refund](https://docs.adyen.com/online-payments/refund). + /// + /// Thrown when fails to make API call + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task RefundCapturedPaymentAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentRefundRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Refund a captured payment /// - /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task RefundCapturedPaymentAsync(string paymentPspReference, PaymentRefundRequest paymentRefundRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Refunds a payment that has been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**REFUND** webhook](https://docs.adyen.com/online-payments/refund#refund-webhook). You can refund either the full captured amount or a part of the captured amount. You can also perform multiple partial refunds, as long as their sum doesn't exceed the captured amount. > Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as [cards](https://docs.adyen.com/payment-methods/cards#supported-cards), [iDEAL](https://docs.adyen.com/payment-methods/ideal), or [Klarna](https://docs.adyen.com/payment-methods/klarna). If you want to refund a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Refund](https://docs.adyen.com/online-payments/refund). + /// + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task RefundCapturedPaymentOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentRefundRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Refund or cancel a payment /// - /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. - /// - - /// - Additional request options. - /// . - Model.Checkout.PaymentReversalResponse RefundOrCancelPayment(string paymentPspReference, PaymentReversalRequest paymentReversalRequest = default, RequestOptions requestOptions = default); - + /// + /// [Refunds](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/refunds) a payment if it has already been captured, and [cancels](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) a payment if it has not yet been captured. Returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCEL_OR_REFUND** webhook](https://docs.adyen.com/online-payments/reverse#cancel-or-refund-webhook). The reversed amount is always the full payment amount. > Do not use this request for payments that involve multiple partial captures. For more information, refer to [Reversal](https://docs.adyen.com/online-payments/reversal). + /// + /// Thrown when fails to make API call + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task RefundOrCancelPaymentAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentReversalRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Refund or cancel a payment /// - /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task RefundOrCancelPaymentAsync(string paymentPspReference, PaymentReversalRequest paymentReversalRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// [Refunds](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/refunds) a payment if it has already been captured, and [cancels](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) a payment if it has not yet been captured. Returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCEL_OR_REFUND** webhook](https://docs.adyen.com/online-payments/reverse#cancel-or-refund-webhook). The reversed amount is always the full payment amount. > Do not use this request for payments that involve multiple partial captures. For more information, refer to [Reversal](https://docs.adyen.com/online-payments/reversal). + /// + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task RefundOrCancelPaymentOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentReversalRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Update an authorised amount /// - /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. - /// - - /// - Additional request options. - /// . - Model.Checkout.PaymentAmountUpdateResponse UpdateAuthorisedAmount(string paymentPspReference, PaymentAmountUpdateRequest paymentAmountUpdateRequest = default, RequestOptions requestOptions = default); - + /// + /// Increases or decreases the authorised payment amount and returns a unique reference for this request. You get the outcome of the request asynchronously, in an [**AUTHORISATION_ADJUSTMENT** webhook](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes). You can only update authorised amounts that have not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures). The amount you specify in the request is the updated amount, which is larger or smaller than the initial authorised amount. For more information, refer to [Authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#use-cases). + /// + /// Thrown when fails to make API call + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdateAuthorisedAmountAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentAmountUpdateRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Update an authorised amount /// - /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task UpdateAuthorisedAmountAsync(string paymentPspReference, PaymentAmountUpdateRequest paymentAmountUpdateRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Increases or decreases the authorised payment amount and returns a unique reference for this request. You get the outcome of the request asynchronously, in an [**AUTHORISATION_ADJUSTMENT** webhook](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes). You can only update authorised amounts that have not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures). The amount you specify in the request is the updated amount, which is larger or smaller than the initial authorised amount. For more information, refer to [Authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#use-cases). + /// + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdateAuthorisedAmountOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentAmountUpdateRequest = default, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ICancelAuthorisedPaymentApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 201 Created + /// + /// + bool IsCreated { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface ICancelAuthorisedPaymentByPspReferenceApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 201 Created + /// + /// + bool IsCreated { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface ICaptureAuthorisedPaymentApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 201 Created + /// + /// + bool IsCreated { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface IRefundCapturedPaymentApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 201 Created + /// + /// + bool IsCreated { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface IRefundOrCancelPaymentApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 201 Created + /// + /// + bool IsCreated { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface IUpdateAuthorisedAmountApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 201 Created + /// + /// + bool IsCreated { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } } - + /// - /// Represents a collection of functions to interact with the ModificationsService API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public class ModificationsService : AbstractService, IModificationsService + public class ModificationsServiceEvents { - private readonly string _baseUrl; - - public ModificationsService(AdyenClient adyenClient) : base(adyenClient) + /// + /// The event raised after the server response + /// + public event EventHandler OnCancelAuthorisedPayment; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCancelAuthorisedPayment; + + internal void ExecuteOnCancelAuthorisedPayment(ModificationsService.CancelAuthorisedPaymentApiResponse apiResponse) + { + OnCancelAuthorisedPayment?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCancelAuthorisedPayment(Exception exception) + { + OnErrorCancelAuthorisedPayment?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnCancelAuthorisedPaymentByPspReference; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCancelAuthorisedPaymentByPspReference; + + internal void ExecuteOnCancelAuthorisedPaymentByPspReference(ModificationsService.CancelAuthorisedPaymentByPspReferenceApiResponse apiResponse) + { + OnCancelAuthorisedPaymentByPspReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCancelAuthorisedPaymentByPspReference(Exception exception) + { + OnErrorCancelAuthorisedPaymentByPspReference?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnCaptureAuthorisedPayment; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCaptureAuthorisedPayment; + + internal void ExecuteOnCaptureAuthorisedPayment(ModificationsService.CaptureAuthorisedPaymentApiResponse apiResponse) + { + OnCaptureAuthorisedPayment?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCaptureAuthorisedPayment(Exception exception) { - _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); + OnErrorCaptureAuthorisedPayment?.Invoke(this, new ExceptionEventArgs(exception)); } - - public Model.Checkout.StandalonePaymentCancelResponse CancelAuthorisedPayment(StandalonePaymentCancelRequest standalonePaymentCancelRequest = default, RequestOptions requestOptions = default) + + /// + /// The event raised after the server response + /// + public event EventHandler OnRefundCapturedPayment; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRefundCapturedPayment; + + internal void ExecuteOnRefundCapturedPayment(ModificationsService.RefundCapturedPaymentApiResponse apiResponse) { - return CancelAuthorisedPaymentAsync(standalonePaymentCancelRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + OnRefundCapturedPayment?.Invoke(this, new ApiResponseEventArgs(apiResponse)); } - public async Task CancelAuthorisedPaymentAsync(StandalonePaymentCancelRequest standalonePaymentCancelRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + internal void ExecuteOnErrorRefundCapturedPayment(Exception exception) { - var endpoint = _baseUrl + "/cancels"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(standalonePaymentCancelRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + OnErrorRefundCapturedPayment?.Invoke(this, new ExceptionEventArgs(exception)); } - - public Model.Checkout.PaymentCancelResponse CancelAuthorisedPaymentByPspReference(string paymentPspReference, PaymentCancelRequest paymentCancelRequest = default, RequestOptions requestOptions = default) + + /// + /// The event raised after the server response + /// + public event EventHandler OnRefundOrCancelPayment; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRefundOrCancelPayment; + + internal void ExecuteOnRefundOrCancelPayment(ModificationsService.RefundOrCancelPaymentApiResponse apiResponse) { - return CancelAuthorisedPaymentByPspReferenceAsync(paymentPspReference, paymentCancelRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + OnRefundOrCancelPayment?.Invoke(this, new ApiResponseEventArgs(apiResponse)); } - public async Task CancelAuthorisedPaymentByPspReferenceAsync(string paymentPspReference, PaymentCancelRequest paymentCancelRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + internal void ExecuteOnErrorRefundOrCancelPayment(Exception exception) { - var endpoint = _baseUrl + $"/payments/{paymentPspReference}/cancels"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(paymentCancelRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + OnErrorRefundOrCancelPayment?.Invoke(this, new ExceptionEventArgs(exception)); } - - public Model.Checkout.PaymentCaptureResponse CaptureAuthorisedPayment(string paymentPspReference, PaymentCaptureRequest paymentCaptureRequest = default, RequestOptions requestOptions = default) + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdateAuthorisedAmount; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdateAuthorisedAmount; + + internal void ExecuteOnUpdateAuthorisedAmount(ModificationsService.UpdateAuthorisedAmountApiResponse apiResponse) { - return CaptureAuthorisedPaymentAsync(paymentPspReference, paymentCaptureRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + OnUpdateAuthorisedAmount?.Invoke(this, new ApiResponseEventArgs(apiResponse)); } - public async Task CaptureAuthorisedPaymentAsync(string paymentPspReference, PaymentCaptureRequest paymentCaptureRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + internal void ExecuteOnErrorUpdateAuthorisedAmount(Exception exception) { - var endpoint = _baseUrl + $"/payments/{paymentPspReference}/captures"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(paymentCaptureRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + OnErrorUpdateAuthorisedAmount?.Invoke(this, new ExceptionEventArgs(exception)); } - - public Model.Checkout.PaymentRefundResponse RefundCapturedPayment(string paymentPspReference, PaymentRefundRequest paymentRefundRequest = default, RequestOptions requestOptions = default) + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class ModificationsService : IModificationsService + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public ModificationsServiceEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ModificationsService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, ModificationsServiceEvents modificationsServiceEvents, + TokenProvider apiKeyProvider, + TokenProvider basicTokenProvider) { - return RefundCapturedPaymentAsync(paymentPspReference, paymentRefundRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = modificationsServiceEvents; + ApiKeyProvider = apiKeyProvider; + BasicTokenProvider = basicTokenProvider; } - public async Task RefundCapturedPaymentAsync(string paymentPspReference, PaymentRefundRequest paymentRefundRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + partial void FormatCancelAuthorisedPayment(ref string idempotencyKey, StandalonePaymentCancelRequest standalonePaymentCancelRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateCancelAuthorisedPayment(string idempotencyKey, StandalonePaymentCancelRequest standalonePaymentCancelRequest) { - var endpoint = _baseUrl + $"/payments/{paymentPspReference}/refunds"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(paymentRefundRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (standalonePaymentCancelRequest.IsSet && standalonePaymentCancelRequest.Value == null) + throw new ArgumentNullException(nameof(standalonePaymentCancelRequest)); } - - public Model.Checkout.PaymentReversalResponse RefundOrCancelPayment(string paymentPspReference, PaymentReversalRequest paymentReversalRequest = default, RequestOptions requestOptions = default) + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterCancelAuthorisedPaymentDefaultImplementation(ICancelAuthorisedPaymentApiResponse apiResponseLocalVar, string idempotencyKey, StandalonePaymentCancelRequest standalonePaymentCancelRequest) { - return RefundOrCancelPaymentAsync(paymentPspReference, paymentReversalRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + bool suppressDefaultLog = false; + AfterCancelAuthorisedPayment(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, standalonePaymentCancelRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); } - public async Task RefundOrCancelPaymentAsync(string paymentPspReference, PaymentReversalRequest paymentReversalRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterCancelAuthorisedPayment(ref bool suppressDefaultLog, ICancelAuthorisedPaymentApiResponse apiResponseLocalVar, string idempotencyKey, StandalonePaymentCancelRequest standalonePaymentCancelRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorCancelAuthorisedPaymentDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, StandalonePaymentCancelRequest standalonePaymentCancelRequest) { - var endpoint = _baseUrl + $"/payments/{paymentPspReference}/reversals"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(paymentReversalRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + bool suppressDefaultLogLocalVar = false; + OnErrorCancelAuthorisedPayment(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, standalonePaymentCancelRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); } - - public Model.Checkout.PaymentAmountUpdateResponse UpdateAuthorisedAmount(string paymentPspReference, PaymentAmountUpdateRequest paymentAmountUpdateRequest = default, RequestOptions requestOptions = default) + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorCancelAuthorisedPayment(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, StandalonePaymentCancelRequest standalonePaymentCancelRequest); + + /// + /// Cancel an authorised payment Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**TECHNICAL_CANCEL** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment using the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/payments/{paymentPspReference}/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task CancelAuthorisedPaymentOrDefaultAsync(Option idempotencyKey = default, Option standalonePaymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default) { - return UpdateAuthorisedAmountAsync(paymentPspReference, paymentAmountUpdateRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + try + { + return await CancelAuthorisedPaymentAsync(idempotencyKey, standalonePaymentCancelRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } } - public async Task UpdateAuthorisedAmountAsync(string paymentPspReference, PaymentAmountUpdateRequest paymentAmountUpdateRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// Cancel an authorised payment Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**TECHNICAL_CANCEL** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment using the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/payments/{paymentPspReference}/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task CancelAuthorisedPaymentAsync(Option idempotencyKey = default, Option standalonePaymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default) { - var endpoint = _baseUrl + $"/payments/{paymentPspReference}/amountUpdates"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(paymentAmountUpdateRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCancelAuthorisedPayment(idempotencyKey, standalonePaymentCancelRequest); + + FormatCancelAuthorisedPayment(ref idempotencyKey, standalonePaymentCancelRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/cancels"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (standalonePaymentCancelRequest.IsSet) + httpRequestMessageLocalVar.Content = (standalonePaymentCancelRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(standalonePaymentCancelRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CancelAuthorisedPaymentApiResponse apiResponseLocalVar = new CancelAuthorisedPaymentApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/cancels", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCancelAuthorisedPaymentDefaultImplementation(apiResponseLocalVar, idempotencyKey, standalonePaymentCancelRequest); + + Events.ExecuteOnCancelAuthorisedPayment(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCancelAuthorisedPaymentDefaultImplementation(e, "/cancels", uriBuilderLocalVar.Path, idempotencyKey, standalonePaymentCancelRequest); + Events.ExecuteOnErrorCancelAuthorisedPayment(e); + throw; + } + } + + /// + /// The + /// + public partial class CancelAuthorisedPaymentApiResponse : Adyen.Client.ApiResponse, ICancelAuthorisedPaymentApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CancelAuthorisedPaymentApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 201 Created + /// + /// + public bool IsCreated => 201 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 201 Created + /// + /// + public Adyen.Model.Checkout.StandalonePaymentCancelResponse Created() + { + // This logic may be modified with the AsModel.mustache template + return IsCreated + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 201 Created and the deserialized response is not null + /// + /// + /// + public bool TryCreated(out Adyen.Model.Checkout.StandalonePaymentCancelResponse result) + { + result = null; + + try + { + result = Created(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatCancelAuthorisedPaymentByPspReference(ref string paymentPspReference, ref string idempotencyKey, PaymentCancelRequest paymentCancelRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + private void ValidateCancelAuthorisedPaymentByPspReference(string paymentPspReference, string idempotencyKey, PaymentCancelRequest paymentCancelRequest) + { + if (paymentPspReference == null) + throw new ArgumentNullException(nameof(paymentPspReference)); + + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (paymentCancelRequest.IsSet && paymentCancelRequest.Value == null) + throw new ArgumentNullException(nameof(paymentCancelRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterCancelAuthorisedPaymentByPspReferenceDefaultImplementation(ICancelAuthorisedPaymentByPspReferenceApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentCancelRequest paymentCancelRequest) + { + bool suppressDefaultLog = false; + AfterCancelAuthorisedPaymentByPspReference(ref suppressDefaultLog, apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentCancelRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterCancelAuthorisedPaymentByPspReference(ref bool suppressDefaultLog, ICancelAuthorisedPaymentByPspReferenceApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentCancelRequest paymentCancelRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorCancelAuthorisedPaymentByPspReferenceDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentCancelRequest paymentCancelRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorCancelAuthorisedPaymentByPspReference(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, paymentPspReference, idempotencyKey, paymentCancelRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorCancelAuthorisedPaymentByPspReference(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentCancelRequest paymentCancelRequest); + + /// + /// Cancel an authorised payment Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCELLATION** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment but don't have the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). + /// + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task CancelAuthorisedPaymentByPspReferenceOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CancelAuthorisedPaymentByPspReferenceAsync(paymentPspReference, idempotencyKey, paymentCancelRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Cancel an authorised payment Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCELLATION** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment but don't have the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). + /// + /// Thrown when fails to make API call + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task CancelAuthorisedPaymentByPspReferenceAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCancelAuthorisedPaymentByPspReference(paymentPspReference, idempotencyKey, paymentCancelRequest); + + FormatCancelAuthorisedPaymentByPspReference(ref paymentPspReference, ref idempotencyKey, paymentCancelRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments/{paymentPspReference}/cancels"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpaymentPspReference%7D", Uri.EscapeDataString(paymentPspReference.ToString())); + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (paymentCancelRequest.IsSet) + httpRequestMessageLocalVar.Content = (paymentCancelRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentCancelRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CancelAuthorisedPaymentByPspReferenceApiResponse apiResponseLocalVar = new CancelAuthorisedPaymentByPspReferenceApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments/{paymentPspReference}/cancels", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCancelAuthorisedPaymentByPspReferenceDefaultImplementation(apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentCancelRequest); + + Events.ExecuteOnCancelAuthorisedPaymentByPspReference(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCancelAuthorisedPaymentByPspReferenceDefaultImplementation(e, "/payments/{paymentPspReference}/cancels", uriBuilderLocalVar.Path, paymentPspReference, idempotencyKey, paymentCancelRequest); + Events.ExecuteOnErrorCancelAuthorisedPaymentByPspReference(e); + throw; + } + } + + /// + /// The + /// + public partial class CancelAuthorisedPaymentByPspReferenceApiResponse : Adyen.Client.ApiResponse, ICancelAuthorisedPaymentByPspReferenceApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CancelAuthorisedPaymentByPspReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 201 Created + /// + /// + public bool IsCreated => 201 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 201 Created + /// + /// + public Adyen.Model.Checkout.PaymentCancelResponse Created() + { + // This logic may be modified with the AsModel.mustache template + return IsCreated + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 201 Created and the deserialized response is not null + /// + /// + /// + public bool TryCreated(out Adyen.Model.Checkout.PaymentCancelResponse result) + { + result = null; + + try + { + result = Created(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatCaptureAuthorisedPayment(ref string paymentPspReference, ref string idempotencyKey, PaymentCaptureRequest paymentCaptureRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + private void ValidateCaptureAuthorisedPayment(string paymentPspReference, string idempotencyKey, PaymentCaptureRequest paymentCaptureRequest) + { + if (paymentPspReference == null) + throw new ArgumentNullException(nameof(paymentPspReference)); + + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (paymentCaptureRequest.IsSet && paymentCaptureRequest.Value == null) + throw new ArgumentNullException(nameof(paymentCaptureRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterCaptureAuthorisedPaymentDefaultImplementation(ICaptureAuthorisedPaymentApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentCaptureRequest paymentCaptureRequest) + { + bool suppressDefaultLog = false; + AfterCaptureAuthorisedPayment(ref suppressDefaultLog, apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentCaptureRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterCaptureAuthorisedPayment(ref bool suppressDefaultLog, ICaptureAuthorisedPaymentApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentCaptureRequest paymentCaptureRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorCaptureAuthorisedPaymentDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentCaptureRequest paymentCaptureRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorCaptureAuthorisedPayment(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, paymentPspReference, idempotencyKey, paymentCaptureRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorCaptureAuthorisedPayment(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentCaptureRequest paymentCaptureRequest); + + /// + /// Capture an authorised payment Captures an authorised payment and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CAPTURE** webhook](https://docs.adyen.com/online-payments/capture#capture-notification). You can capture either the full authorised amount or a part of the authorised amount. By default, any unclaimed amount after a partial capture gets cancelled. This does not apply if you enabled multiple partial captures on your account and the payment method supports multiple partial captures. [Automatic capture](https://docs.adyen.com/online-payments/capture#automatic-capture) is the default setting for most payment methods. In these cases, you don't need to make capture requests. However, making capture requests for payments that are captured automatically does not result in double charges. For more information, refer to [Capture](https://docs.adyen.com/online-payments/capture). + /// + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task CaptureAuthorisedPaymentOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCaptureRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CaptureAuthorisedPaymentAsync(paymentPspReference, idempotencyKey, paymentCaptureRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Capture an authorised payment Captures an authorised payment and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CAPTURE** webhook](https://docs.adyen.com/online-payments/capture#capture-notification). You can capture either the full authorised amount or a part of the authorised amount. By default, any unclaimed amount after a partial capture gets cancelled. This does not apply if you enabled multiple partial captures on your account and the payment method supports multiple partial captures. [Automatic capture](https://docs.adyen.com/online-payments/capture#automatic-capture) is the default setting for most payment methods. In these cases, you don't need to make capture requests. However, making capture requests for payments that are captured automatically does not result in double charges. For more information, refer to [Capture](https://docs.adyen.com/online-payments/capture). + /// + /// Thrown when fails to make API call + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task CaptureAuthorisedPaymentAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCaptureRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCaptureAuthorisedPayment(paymentPspReference, idempotencyKey, paymentCaptureRequest); + + FormatCaptureAuthorisedPayment(ref paymentPspReference, ref idempotencyKey, paymentCaptureRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments/{paymentPspReference}/captures"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpaymentPspReference%7D", Uri.EscapeDataString(paymentPspReference.ToString())); + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (paymentCaptureRequest.IsSet) + httpRequestMessageLocalVar.Content = (paymentCaptureRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentCaptureRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CaptureAuthorisedPaymentApiResponse apiResponseLocalVar = new CaptureAuthorisedPaymentApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments/{paymentPspReference}/captures", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCaptureAuthorisedPaymentDefaultImplementation(apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentCaptureRequest); + + Events.ExecuteOnCaptureAuthorisedPayment(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCaptureAuthorisedPaymentDefaultImplementation(e, "/payments/{paymentPspReference}/captures", uriBuilderLocalVar.Path, paymentPspReference, idempotencyKey, paymentCaptureRequest); + Events.ExecuteOnErrorCaptureAuthorisedPayment(e); + throw; + } + } + + /// + /// The + /// + public partial class CaptureAuthorisedPaymentApiResponse : Adyen.Client.ApiResponse, ICaptureAuthorisedPaymentApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CaptureAuthorisedPaymentApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 201 Created + /// + /// + public bool IsCreated => 201 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 201 Created + /// + /// + public Adyen.Model.Checkout.PaymentCaptureResponse Created() + { + // This logic may be modified with the AsModel.mustache template + return IsCreated + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 201 Created and the deserialized response is not null + /// + /// + /// + public bool TryCreated(out Adyen.Model.Checkout.PaymentCaptureResponse result) + { + result = null; + + try + { + result = Created(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatRefundCapturedPayment(ref string paymentPspReference, ref string idempotencyKey, PaymentRefundRequest paymentRefundRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + private void ValidateRefundCapturedPayment(string paymentPspReference, string idempotencyKey, PaymentRefundRequest paymentRefundRequest) + { + if (paymentPspReference == null) + throw new ArgumentNullException(nameof(paymentPspReference)); + + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (paymentRefundRequest.IsSet && paymentRefundRequest.Value == null) + throw new ArgumentNullException(nameof(paymentRefundRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterRefundCapturedPaymentDefaultImplementation(IRefundCapturedPaymentApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentRefundRequest paymentRefundRequest) + { + bool suppressDefaultLog = false; + AfterRefundCapturedPayment(ref suppressDefaultLog, apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentRefundRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterRefundCapturedPayment(ref bool suppressDefaultLog, IRefundCapturedPaymentApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentRefundRequest paymentRefundRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorRefundCapturedPaymentDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentRefundRequest paymentRefundRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorRefundCapturedPayment(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, paymentPspReference, idempotencyKey, paymentRefundRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorRefundCapturedPayment(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentRefundRequest paymentRefundRequest); + + /// + /// Refund a captured payment Refunds a payment that has been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**REFUND** webhook](https://docs.adyen.com/online-payments/refund#refund-webhook). You can refund either the full captured amount or a part of the captured amount. You can also perform multiple partial refunds, as long as their sum doesn't exceed the captured amount. > Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as [cards](https://docs.adyen.com/payment-methods/cards#supported-cards), [iDEAL](https://docs.adyen.com/payment-methods/ideal), or [Klarna](https://docs.adyen.com/payment-methods/klarna). If you want to refund a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Refund](https://docs.adyen.com/online-payments/refund). + /// + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task RefundCapturedPaymentOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentRefundRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RefundCapturedPaymentAsync(paymentPspReference, idempotencyKey, paymentRefundRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Refund a captured payment Refunds a payment that has been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**REFUND** webhook](https://docs.adyen.com/online-payments/refund#refund-webhook). You can refund either the full captured amount or a part of the captured amount. You can also perform multiple partial refunds, as long as their sum doesn't exceed the captured amount. > Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as [cards](https://docs.adyen.com/payment-methods/cards#supported-cards), [iDEAL](https://docs.adyen.com/payment-methods/ideal), or [Klarna](https://docs.adyen.com/payment-methods/klarna). If you want to refund a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Refund](https://docs.adyen.com/online-payments/refund). + /// + /// Thrown when fails to make API call + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task RefundCapturedPaymentAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentRefundRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateRefundCapturedPayment(paymentPspReference, idempotencyKey, paymentRefundRequest); + + FormatRefundCapturedPayment(ref paymentPspReference, ref idempotencyKey, paymentRefundRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments/{paymentPspReference}/refunds"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpaymentPspReference%7D", Uri.EscapeDataString(paymentPspReference.ToString())); + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (paymentRefundRequest.IsSet) + httpRequestMessageLocalVar.Content = (paymentRefundRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentRefundRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + RefundCapturedPaymentApiResponse apiResponseLocalVar = new RefundCapturedPaymentApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments/{paymentPspReference}/refunds", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRefundCapturedPaymentDefaultImplementation(apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentRefundRequest); + + Events.ExecuteOnRefundCapturedPayment(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRefundCapturedPaymentDefaultImplementation(e, "/payments/{paymentPspReference}/refunds", uriBuilderLocalVar.Path, paymentPspReference, idempotencyKey, paymentRefundRequest); + Events.ExecuteOnErrorRefundCapturedPayment(e); + throw; + } + } + + /// + /// The + /// + public partial class RefundCapturedPaymentApiResponse : Adyen.Client.ApiResponse, IRefundCapturedPaymentApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public RefundCapturedPaymentApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 201 Created + /// + /// + public bool IsCreated => 201 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 201 Created + /// + /// + public Adyen.Model.Checkout.PaymentRefundResponse Created() + { + // This logic may be modified with the AsModel.mustache template + return IsCreated + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 201 Created and the deserialized response is not null + /// + /// + /// + public bool TryCreated(out Adyen.Model.Checkout.PaymentRefundResponse result) + { + result = null; + + try + { + result = Created(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatRefundOrCancelPayment(ref string paymentPspReference, ref string idempotencyKey, PaymentReversalRequest paymentReversalRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + private void ValidateRefundOrCancelPayment(string paymentPspReference, string idempotencyKey, PaymentReversalRequest paymentReversalRequest) + { + if (paymentPspReference == null) + throw new ArgumentNullException(nameof(paymentPspReference)); + + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (paymentReversalRequest.IsSet && paymentReversalRequest.Value == null) + throw new ArgumentNullException(nameof(paymentReversalRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterRefundOrCancelPaymentDefaultImplementation(IRefundOrCancelPaymentApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentReversalRequest paymentReversalRequest) + { + bool suppressDefaultLog = false; + AfterRefundOrCancelPayment(ref suppressDefaultLog, apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentReversalRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterRefundOrCancelPayment(ref bool suppressDefaultLog, IRefundOrCancelPaymentApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentReversalRequest paymentReversalRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorRefundOrCancelPaymentDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentReversalRequest paymentReversalRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorRefundOrCancelPayment(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, paymentPspReference, idempotencyKey, paymentReversalRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorRefundOrCancelPayment(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentReversalRequest paymentReversalRequest); + + /// + /// Refund or cancel a payment [Refunds](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/refunds) a payment if it has already been captured, and [cancels](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) a payment if it has not yet been captured. Returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCEL_OR_REFUND** webhook](https://docs.adyen.com/online-payments/reverse#cancel-or-refund-webhook). The reversed amount is always the full payment amount. > Do not use this request for payments that involve multiple partial captures. For more information, refer to [Reversal](https://docs.adyen.com/online-payments/reversal). + /// + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task RefundOrCancelPaymentOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentReversalRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RefundOrCancelPaymentAsync(paymentPspReference, idempotencyKey, paymentReversalRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Refund or cancel a payment [Refunds](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/refunds) a payment if it has already been captured, and [cancels](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) a payment if it has not yet been captured. Returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCEL_OR_REFUND** webhook](https://docs.adyen.com/online-payments/reverse#cancel-or-refund-webhook). The reversed amount is always the full payment amount. > Do not use this request for payments that involve multiple partial captures. For more information, refer to [Reversal](https://docs.adyen.com/online-payments/reversal). + /// + /// Thrown when fails to make API call + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task RefundOrCancelPaymentAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentReversalRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateRefundOrCancelPayment(paymentPspReference, idempotencyKey, paymentReversalRequest); + + FormatRefundOrCancelPayment(ref paymentPspReference, ref idempotencyKey, paymentReversalRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments/{paymentPspReference}/reversals"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpaymentPspReference%7D", Uri.EscapeDataString(paymentPspReference.ToString())); + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (paymentReversalRequest.IsSet) + httpRequestMessageLocalVar.Content = (paymentReversalRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentReversalRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + RefundOrCancelPaymentApiResponse apiResponseLocalVar = new RefundOrCancelPaymentApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments/{paymentPspReference}/reversals", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRefundOrCancelPaymentDefaultImplementation(apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentReversalRequest); + + Events.ExecuteOnRefundOrCancelPayment(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRefundOrCancelPaymentDefaultImplementation(e, "/payments/{paymentPspReference}/reversals", uriBuilderLocalVar.Path, paymentPspReference, idempotencyKey, paymentReversalRequest); + Events.ExecuteOnErrorRefundOrCancelPayment(e); + throw; + } + } + + /// + /// The + /// + public partial class RefundOrCancelPaymentApiResponse : Adyen.Client.ApiResponse, IRefundOrCancelPaymentApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public RefundOrCancelPaymentApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 201 Created + /// + /// + public bool IsCreated => 201 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 201 Created + /// + /// + public Adyen.Model.Checkout.PaymentReversalResponse Created() + { + // This logic may be modified with the AsModel.mustache template + return IsCreated + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 201 Created and the deserialized response is not null + /// + /// + /// + public bool TryCreated(out Adyen.Model.Checkout.PaymentReversalResponse result) + { + result = null; + + try + { + result = Created(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdateAuthorisedAmount(ref string paymentPspReference, ref string idempotencyKey, PaymentAmountUpdateRequest paymentAmountUpdateRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + private void ValidateUpdateAuthorisedAmount(string paymentPspReference, string idempotencyKey, PaymentAmountUpdateRequest paymentAmountUpdateRequest) + { + if (paymentPspReference == null) + throw new ArgumentNullException(nameof(paymentPspReference)); + + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (paymentAmountUpdateRequest.IsSet && paymentAmountUpdateRequest.Value == null) + throw new ArgumentNullException(nameof(paymentAmountUpdateRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterUpdateAuthorisedAmountDefaultImplementation(IUpdateAuthorisedAmountApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentAmountUpdateRequest paymentAmountUpdateRequest) + { + bool suppressDefaultLog = false; + AfterUpdateAuthorisedAmount(ref suppressDefaultLog, apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentAmountUpdateRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterUpdateAuthorisedAmount(ref bool suppressDefaultLog, IUpdateAuthorisedAmountApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentAmountUpdateRequest paymentAmountUpdateRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorUpdateAuthorisedAmountDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentAmountUpdateRequest paymentAmountUpdateRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorUpdateAuthorisedAmount(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, paymentPspReference, idempotencyKey, paymentAmountUpdateRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdateAuthorisedAmount(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentAmountUpdateRequest paymentAmountUpdateRequest); + + /// + /// Update an authorised amount Increases or decreases the authorised payment amount and returns a unique reference for this request. You get the outcome of the request asynchronously, in an [**AUTHORISATION_ADJUSTMENT** webhook](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes). You can only update authorised amounts that have not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures). The amount you specify in the request is the updated amount, which is larger or smaller than the initial authorised amount. For more information, refer to [Authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#use-cases). + /// + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateAuthorisedAmountOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentAmountUpdateRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdateAuthorisedAmountAsync(paymentPspReference, idempotencyKey, paymentAmountUpdateRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Update an authorised amount Increases or decreases the authorised payment amount and returns a unique reference for this request. You get the outcome of the request asynchronously, in an [**AUTHORISATION_ADJUSTMENT** webhook](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes). You can only update authorised amounts that have not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures). The amount you specify in the request is the updated amount, which is larger or smaller than the initial authorised amount. For more information, refer to [Authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#use-cases). + /// + /// Thrown when fails to make API call + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateAuthorisedAmountAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentAmountUpdateRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdateAuthorisedAmount(paymentPspReference, idempotencyKey, paymentAmountUpdateRequest); + + FormatUpdateAuthorisedAmount(ref paymentPspReference, ref idempotencyKey, paymentAmountUpdateRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments/{paymentPspReference}/amountUpdates"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpaymentPspReference%7D", Uri.EscapeDataString(paymentPspReference.ToString())); + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (paymentAmountUpdateRequest.IsSet) + httpRequestMessageLocalVar.Content = (paymentAmountUpdateRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentAmountUpdateRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdateAuthorisedAmountApiResponse apiResponseLocalVar = new UpdateAuthorisedAmountApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments/{paymentPspReference}/amountUpdates", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdateAuthorisedAmountDefaultImplementation(apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentAmountUpdateRequest); + + Events.ExecuteOnUpdateAuthorisedAmount(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdateAuthorisedAmountDefaultImplementation(e, "/payments/{paymentPspReference}/amountUpdates", uriBuilderLocalVar.Path, paymentPspReference, idempotencyKey, paymentAmountUpdateRequest); + Events.ExecuteOnErrorUpdateAuthorisedAmount(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdateAuthorisedAmountApiResponse : Adyen.Client.ApiResponse, IUpdateAuthorisedAmountApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdateAuthorisedAmountApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 201 Created + /// + /// + public bool IsCreated => 201 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 201 Created + /// + /// + public Adyen.Model.Checkout.PaymentAmountUpdateResponse Created() + { + // This logic may be modified with the AsModel.mustache template + return IsCreated + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 201 Created and the deserialized response is not null + /// + /// + /// + public bool TryCreated(out Adyen.Model.Checkout.PaymentAmountUpdateResponse result) + { + result = null; + + try + { + result = Created(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } } -} \ No newline at end of file +} diff --git a/Adyen/Service/Checkout/OrdersService.cs b/Adyen/Service/Checkout/OrdersService.cs index d2a8d4115..3e21cbed0 100644 --- a/Adyen/Service/Checkout/OrdersService.cs +++ b/Adyen/Service/Checkout/OrdersService.cs @@ -1,128 +1,1701 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections.Generic; -using System.Net.Http; -using System.Threading; +using System.Net; using System.Threading.Tasks; -using Adyen.Model; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Adyen.Client; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// OrdersService Interface + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. /// - public interface IOrdersService + public interface IOrdersService : IApi { + /// + /// The class containing the events + /// + OrdersServiceEvents Events { get; } + /// /// Cancel an order /// - /// - - /// - Additional request options. - /// . - Model.Checkout.CancelOrderResponse CancelOrder(CancelOrderRequest cancelOrderRequest = default, RequestOptions requestOptions = default); - + /// + /// Cancels an order. Cancellation of an order results in an automatic rollback of all payments made in the order, either by canceling or refunding the payment, depending on the type of payment method. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task CancelOrderAsync(Option idempotencyKey = default, Option cancelOrderRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Cancel an order /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task CancelOrderAsync(CancelOrderRequest cancelOrderRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Cancels an order. Cancellation of an order results in an automatic rollback of all payments made in the order, either by canceling or refunding the payment, depending on the type of payment method. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task CancelOrderOrDefaultAsync(Option idempotencyKey = default, Option cancelOrderRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Get the balance of a gift card /// - /// - - /// - Additional request options. - /// . - Model.Checkout.BalanceCheckResponse GetBalanceOfGiftCard(BalanceCheckRequest balanceCheckRequest = default, RequestOptions requestOptions = default); - + /// + /// Retrieves the balance remaining on a shopper's gift card. To check a gift card's balance, make a POST `/paymentMethods/balance` call and include the gift card's details inside a `paymentMethod` object. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task GetBalanceOfGiftCardAsync(Option idempotencyKey = default, Option balanceCheckRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Get the balance of a gift card /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task GetBalanceOfGiftCardAsync(BalanceCheckRequest balanceCheckRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Retrieves the balance remaining on a shopper's gift card. To check a gift card's balance, make a POST `/paymentMethods/balance` call and include the gift card's details inside a `paymentMethod` object. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task GetBalanceOfGiftCardOrDefaultAsync(Option idempotencyKey = default, Option balanceCheckRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Create an order /// - /// - - /// - Additional request options. - /// . - Model.Checkout.CreateOrderResponse Orders(CreateOrderRequest createOrderRequest = default, RequestOptions requestOptions = default); - + /// + /// Creates an order to be used for partial payments. Make a POST `/orders` call before making a `/payments` call when processing payments with different payment methods. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task OrdersAsync(Option idempotencyKey = default, Option createOrderRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Create an order /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task OrdersAsync(CreateOrderRequest createOrderRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Creates an order to be used for partial payments. Make a POST `/orders` call before making a `/payments` call when processing payments with different payment methods. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task OrdersOrDefaultAsync(Option idempotencyKey = default, Option createOrderRequest = default, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ICancelOrderApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface IGetBalanceOfGiftCardApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface IOrdersApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class OrdersServiceEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnCancelOrder; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCancelOrder; + + internal void ExecuteOnCancelOrder(OrdersService.CancelOrderApiResponse apiResponse) + { + OnCancelOrder?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCancelOrder(Exception exception) + { + OnErrorCancelOrder?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetBalanceOfGiftCard; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetBalanceOfGiftCard; + + internal void ExecuteOnGetBalanceOfGiftCard(OrdersService.GetBalanceOfGiftCardApiResponse apiResponse) + { + OnGetBalanceOfGiftCard?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetBalanceOfGiftCard(Exception exception) + { + OnErrorGetBalanceOfGiftCard?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnOrders; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorOrders; + + internal void ExecuteOnOrders(OrdersService.OrdersApiResponse apiResponse) + { + OnOrders?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorOrders(Exception exception) + { + OnErrorOrders?.Invoke(this, new ExceptionEventArgs(exception)); + } } - + /// - /// Represents a collection of functions to interact with the OrdersService API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public class OrdersService : AbstractService, IOrdersService + public sealed partial class OrdersService : IOrdersService { - private readonly string _baseUrl; - - public OrdersService(AdyenClient adyenClient) : base(adyenClient) + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public OrdersServiceEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public OrdersService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, OrdersServiceEvents ordersServiceEvents, + TokenProvider apiKeyProvider, + TokenProvider basicTokenProvider) { - _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = ordersServiceEvents; + ApiKeyProvider = apiKeyProvider; + BasicTokenProvider = basicTokenProvider; } - - public Model.Checkout.CancelOrderResponse CancelOrder(CancelOrderRequest cancelOrderRequest = default, RequestOptions requestOptions = default) + + partial void FormatCancelOrder(ref string idempotencyKey, CancelOrderRequest cancelOrderRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateCancelOrder(string idempotencyKey, CancelOrderRequest cancelOrderRequest) { - return CancelOrderAsync(cancelOrderRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (cancelOrderRequest.IsSet && cancelOrderRequest.Value == null) + throw new ArgumentNullException(nameof(cancelOrderRequest)); } - public async Task CancelOrderAsync(CancelOrderRequest cancelOrderRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterCancelOrderDefaultImplementation(ICancelOrderApiResponse apiResponseLocalVar, string idempotencyKey, CancelOrderRequest cancelOrderRequest) { - var endpoint = _baseUrl + "/orders/cancel"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(cancelOrderRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + bool suppressDefaultLog = false; + AfterCancelOrder(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, cancelOrderRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); } - - public Model.Checkout.BalanceCheckResponse GetBalanceOfGiftCard(BalanceCheckRequest balanceCheckRequest = default, RequestOptions requestOptions = default) + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterCancelOrder(ref bool suppressDefaultLog, ICancelOrderApiResponse apiResponseLocalVar, string idempotencyKey, CancelOrderRequest cancelOrderRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorCancelOrderDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CancelOrderRequest cancelOrderRequest) { - return GetBalanceOfGiftCardAsync(balanceCheckRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + bool suppressDefaultLogLocalVar = false; + OnErrorCancelOrder(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, cancelOrderRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); } - public async Task GetBalanceOfGiftCardAsync(BalanceCheckRequest balanceCheckRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorCancelOrder(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CancelOrderRequest cancelOrderRequest); + + /// + /// Cancel an order Cancels an order. Cancellation of an order results in an automatic rollback of all payments made in the order, either by canceling or refunding the payment, depending on the type of payment method. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task CancelOrderOrDefaultAsync(Option idempotencyKey = default, Option cancelOrderRequest = default, System.Threading.CancellationToken cancellationToken = default) { - var endpoint = _baseUrl + "/paymentMethods/balance"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(balanceCheckRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + try + { + return await CancelOrderAsync(idempotencyKey, cancelOrderRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } } - - public Model.Checkout.CreateOrderResponse Orders(CreateOrderRequest createOrderRequest = default, RequestOptions requestOptions = default) + + /// + /// Cancel an order Cancels an order. Cancellation of an order results in an automatic rollback of all payments made in the order, either by canceling or refunding the payment, depending on the type of payment method. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task CancelOrderAsync(Option idempotencyKey = default, Option cancelOrderRequest = default, System.Threading.CancellationToken cancellationToken = default) { - return OrdersAsync(createOrderRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCancelOrder(idempotencyKey, cancelOrderRequest); + + FormatCancelOrder(ref idempotencyKey, cancelOrderRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/orders/cancel"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (cancelOrderRequest.IsSet) + httpRequestMessageLocalVar.Content = (cancelOrderRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(cancelOrderRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CancelOrderApiResponse apiResponseLocalVar = new CancelOrderApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/orders/cancel", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCancelOrderDefaultImplementation(apiResponseLocalVar, idempotencyKey, cancelOrderRequest); + + Events.ExecuteOnCancelOrder(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCancelOrderDefaultImplementation(e, "/orders/cancel", uriBuilderLocalVar.Path, idempotencyKey, cancelOrderRequest); + Events.ExecuteOnErrorCancelOrder(e); + throw; + } } - public async Task OrdersAsync(CreateOrderRequest createOrderRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// The + /// + public partial class CancelOrderApiResponse : Adyen.Client.ApiResponse, ICancelOrderApiResponse { - var endpoint = _baseUrl + "/orders"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(createOrderRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CancelOrderApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.CancelOrderResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.CancelOrderResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetBalanceOfGiftCard(ref string idempotencyKey, BalanceCheckRequest balanceCheckRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateGetBalanceOfGiftCard(string idempotencyKey, BalanceCheckRequest balanceCheckRequest) + { + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (balanceCheckRequest.IsSet && balanceCheckRequest.Value == null) + throw new ArgumentNullException(nameof(balanceCheckRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterGetBalanceOfGiftCardDefaultImplementation(IGetBalanceOfGiftCardApiResponse apiResponseLocalVar, string idempotencyKey, BalanceCheckRequest balanceCheckRequest) + { + bool suppressDefaultLog = false; + AfterGetBalanceOfGiftCard(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, balanceCheckRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterGetBalanceOfGiftCard(ref bool suppressDefaultLog, IGetBalanceOfGiftCardApiResponse apiResponseLocalVar, string idempotencyKey, BalanceCheckRequest balanceCheckRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorGetBalanceOfGiftCardDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, BalanceCheckRequest balanceCheckRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorGetBalanceOfGiftCard(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, balanceCheckRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorGetBalanceOfGiftCard(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, BalanceCheckRequest balanceCheckRequest); + + /// + /// Get the balance of a gift card Retrieves the balance remaining on a shopper's gift card. To check a gift card's balance, make a POST `/paymentMethods/balance` call and include the gift card's details inside a `paymentMethod` object. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task GetBalanceOfGiftCardOrDefaultAsync(Option idempotencyKey = default, Option balanceCheckRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetBalanceOfGiftCardAsync(idempotencyKey, balanceCheckRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Get the balance of a gift card Retrieves the balance remaining on a shopper's gift card. To check a gift card's balance, make a POST `/paymentMethods/balance` call and include the gift card's details inside a `paymentMethod` object. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task GetBalanceOfGiftCardAsync(Option idempotencyKey = default, Option balanceCheckRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetBalanceOfGiftCard(idempotencyKey, balanceCheckRequest); + + FormatGetBalanceOfGiftCard(ref idempotencyKey, balanceCheckRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/paymentMethods/balance"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (balanceCheckRequest.IsSet) + httpRequestMessageLocalVar.Content = (balanceCheckRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(balanceCheckRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetBalanceOfGiftCardApiResponse apiResponseLocalVar = new GetBalanceOfGiftCardApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/paymentMethods/balance", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetBalanceOfGiftCardDefaultImplementation(apiResponseLocalVar, idempotencyKey, balanceCheckRequest); + + Events.ExecuteOnGetBalanceOfGiftCard(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetBalanceOfGiftCardDefaultImplementation(e, "/paymentMethods/balance", uriBuilderLocalVar.Path, idempotencyKey, balanceCheckRequest); + Events.ExecuteOnErrorGetBalanceOfGiftCard(e); + throw; + } + } + + /// + /// The + /// + public partial class GetBalanceOfGiftCardApiResponse : Adyen.Client.ApiResponse, IGetBalanceOfGiftCardApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetBalanceOfGiftCardApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.BalanceCheckResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.BalanceCheckResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatOrders(ref string idempotencyKey, CreateOrderRequest createOrderRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateOrders(string idempotencyKey, CreateOrderRequest createOrderRequest) + { + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (createOrderRequest.IsSet && createOrderRequest.Value == null) + throw new ArgumentNullException(nameof(createOrderRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterOrdersDefaultImplementation(IOrdersApiResponse apiResponseLocalVar, string idempotencyKey, CreateOrderRequest createOrderRequest) + { + bool suppressDefaultLog = false; + AfterOrders(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, createOrderRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterOrders(ref bool suppressDefaultLog, IOrdersApiResponse apiResponseLocalVar, string idempotencyKey, CreateOrderRequest createOrderRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorOrdersDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CreateOrderRequest createOrderRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorOrders(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, createOrderRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorOrders(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CreateOrderRequest createOrderRequest); + + /// + /// Create an order Creates an order to be used for partial payments. Make a POST `/orders` call before making a `/payments` call when processing payments with different payment methods. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task OrdersOrDefaultAsync(Option idempotencyKey = default, Option createOrderRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await OrdersAsync(idempotencyKey, createOrderRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Create an order Creates an order to be used for partial payments. Make a POST `/orders` call before making a `/payments` call when processing payments with different payment methods. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task OrdersAsync(Option idempotencyKey = default, Option createOrderRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateOrders(idempotencyKey, createOrderRequest); + + FormatOrders(ref idempotencyKey, createOrderRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/orders"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (createOrderRequest.IsSet) + httpRequestMessageLocalVar.Content = (createOrderRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(createOrderRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + OrdersApiResponse apiResponseLocalVar = new OrdersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/orders", requestedAtLocalVar, _jsonSerializerOptions); + + AfterOrdersDefaultImplementation(apiResponseLocalVar, idempotencyKey, createOrderRequest); + + Events.ExecuteOnOrders(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorOrdersDefaultImplementation(e, "/orders", uriBuilderLocalVar.Path, idempotencyKey, createOrderRequest); + Events.ExecuteOnErrorOrders(e); + throw; + } + } + + /// + /// The + /// + public partial class OrdersApiResponse : Adyen.Client.ApiResponse, IOrdersApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public OrdersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.CreateOrderResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.CreateOrderResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } } -} \ No newline at end of file +} diff --git a/Adyen/Service/Checkout/PaymentLinksService.cs b/Adyen/Service/Checkout/PaymentLinksService.cs index a25aea28b..f607b4f97 100644 --- a/Adyen/Service/Checkout/PaymentLinksService.cs +++ b/Adyen/Service/Checkout/PaymentLinksService.cs @@ -1,130 +1,1671 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections.Generic; -using System.Net.Http; -using System.Threading; +using System.Net; using System.Threading.Tasks; -using Adyen.Model; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Adyen.Client; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// PaymentLinksService Interface + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. /// - public interface IPaymentLinksService + public interface IPaymentLinksService : IApi { + /// + /// The class containing the events + /// + PaymentLinksServiceEvents Events { get; } + /// /// Get a payment link /// - /// - Unique identifier of the payment link. - /// - Additional request options. - /// . - Model.Checkout.PaymentLinkResponse GetPaymentLink(string linkId, RequestOptions requestOptions = default); - + /// + /// Retrieves the payment link details using the payment link `id`. + /// + /// Thrown when fails to make API call + /// Unique identifier of the payment link. + /// Cancellation Token to cancel the request. + /// <> + Task GetPaymentLinkAsync(string linkId, System.Threading.CancellationToken cancellationToken = default); + /// /// Get a payment link /// - /// - Unique identifier of the payment link. - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task GetPaymentLinkAsync(string linkId, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Retrieves the payment link details using the payment link `id`. + /// + /// Unique identifier of the payment link. + /// Cancellation Token to cancel the request. + /// <> + Task GetPaymentLinkOrDefaultAsync(string linkId, System.Threading.CancellationToken cancellationToken = default); + /// /// Create a payment link /// - /// - - /// - Additional request options. - /// . - Model.Checkout.PaymentLinkResponse PaymentLinks(PaymentLinkRequest paymentLinkRequest = default, RequestOptions requestOptions = default); - + /// + /// Creates a payment link to a [Pay by Link](https://docs.adyen.com/unified-commerce/pay-by-link/) page where the shopper can pay. The list of payment methods presented to the shopper depends on the `currency` and `country` parameters sent in the request. For more information, refer to [Pay by Link documentation](https://docs.adyen.com/online-payments/pay-by-link#create-payment-links-through-api). + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task PaymentLinksAsync(Option idempotencyKey = default, Option paymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Create a payment link /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task PaymentLinksAsync(PaymentLinkRequest paymentLinkRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Creates a payment link to a [Pay by Link](https://docs.adyen.com/unified-commerce/pay-by-link/) page where the shopper can pay. The list of payment methods presented to the shopper depends on the `currency` and `country` parameters sent in the request. For more information, refer to [Pay by Link documentation](https://docs.adyen.com/online-payments/pay-by-link#create-payment-links-through-api). + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task PaymentLinksOrDefaultAsync(Option idempotencyKey = default, Option paymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Update the status of a payment link /// - /// - Unique identifier of the payment link. - /// - - /// - Additional request options. - /// . - Model.Checkout.PaymentLinkResponse UpdatePaymentLink(string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest = default, RequestOptions requestOptions = default); - + /// + /// Updates the status of a payment link. Use this endpoint to [force the expiry of a payment link](https://docs.adyen.com/online-payments/pay-by-link#update-payment-link-status). + /// + /// Thrown when fails to make API call + /// Unique identifier of the payment link. + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePaymentLinkAsync(string linkId, Option updatePaymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Update the status of a payment link /// - /// - Unique identifier of the payment link. - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task UpdatePaymentLinkAsync(string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Updates the status of a payment link. Use this endpoint to [force the expiry of a payment link](https://docs.adyen.com/online-payments/pay-by-link#update-payment-link-status). + /// + /// Unique identifier of the payment link. + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePaymentLinkOrDefaultAsync(string linkId, Option updatePaymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IGetPaymentLinkApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface IPaymentLinksApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 201 Created + /// + /// + bool IsCreated { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface IUpdatePaymentLinkApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class PaymentLinksServiceEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnGetPaymentLink; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetPaymentLink; + + internal void ExecuteOnGetPaymentLink(PaymentLinksService.GetPaymentLinkApiResponse apiResponse) + { + OnGetPaymentLink?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetPaymentLink(Exception exception) + { + OnErrorGetPaymentLink?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnPaymentLinks; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorPaymentLinks; + + internal void ExecuteOnPaymentLinks(PaymentLinksService.PaymentLinksApiResponse apiResponse) + { + OnPaymentLinks?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorPaymentLinks(Exception exception) + { + OnErrorPaymentLinks?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdatePaymentLink; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdatePaymentLink; + + internal void ExecuteOnUpdatePaymentLink(PaymentLinksService.UpdatePaymentLinkApiResponse apiResponse) + { + OnUpdatePaymentLink?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdatePaymentLink(Exception exception) + { + OnErrorUpdatePaymentLink?.Invoke(this, new ExceptionEventArgs(exception)); + } } - + /// - /// Represents a collection of functions to interact with the PaymentLinksService API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public class PaymentLinksService : AbstractService, IPaymentLinksService + public sealed partial class PaymentLinksService : IPaymentLinksService { - private readonly string _baseUrl; - - public PaymentLinksService(AdyenClient adyenClient) : base(adyenClient) + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public PaymentLinksServiceEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public PaymentLinksService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, PaymentLinksServiceEvents paymentLinksServiceEvents, + TokenProvider apiKeyProvider, + TokenProvider basicTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = paymentLinksServiceEvents; + ApiKeyProvider = apiKeyProvider; + BasicTokenProvider = basicTokenProvider; + } + + partial void FormatGetPaymentLink(ref string linkId); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateGetPaymentLink(string linkId) + { + if (linkId == null) + throw new ArgumentNullException(nameof(linkId)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetPaymentLinkDefaultImplementation(IGetPaymentLinkApiResponse apiResponseLocalVar, string linkId) + { + bool suppressDefaultLog = false; + AfterGetPaymentLink(ref suppressDefaultLog, apiResponseLocalVar, linkId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetPaymentLink(ref bool suppressDefaultLog, IGetPaymentLinkApiResponse apiResponseLocalVar, string linkId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetPaymentLinkDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string linkId) + { + bool suppressDefaultLogLocalVar = false; + OnErrorGetPaymentLink(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, linkId); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetPaymentLink(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string linkId); + + /// + /// Get a payment link Retrieves the payment link details using the payment link `id`. + /// + /// Unique identifier of the payment link. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPaymentLinkOrDefaultAsync(string linkId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetPaymentLinkAsync(linkId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Get a payment link Retrieves the payment link details using the payment link `id`. + /// + /// Thrown when fails to make API call + /// Unique identifier of the payment link. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPaymentLinkAsync(string linkId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetPaymentLink(linkId); + + FormatGetPaymentLink(ref linkId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/paymentLinks/{linkId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BlinkId%7D", Uri.EscapeDataString(linkId.ToString())); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetPaymentLinkApiResponse apiResponseLocalVar = new GetPaymentLinkApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/paymentLinks/{linkId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetPaymentLinkDefaultImplementation(apiResponseLocalVar, linkId); + + Events.ExecuteOnGetPaymentLink(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetPaymentLinkDefaultImplementation(e, "/paymentLinks/{linkId}", uriBuilderLocalVar.Path, linkId); + Events.ExecuteOnErrorGetPaymentLink(e); + throw; + } + } + + /// + /// The + /// + public partial class GetPaymentLinkApiResponse : Adyen.Client.ApiResponse, IGetPaymentLinkApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetPaymentLinkApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.PaymentLinkResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.PaymentLinkResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatPaymentLinks(ref string idempotencyKey, PaymentLinkRequest paymentLinkRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidatePaymentLinks(string idempotencyKey, PaymentLinkRequest paymentLinkRequest) { - _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (paymentLinkRequest.IsSet && paymentLinkRequest.Value == null) + throw new ArgumentNullException(nameof(paymentLinkRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterPaymentLinksDefaultImplementation(IPaymentLinksApiResponse apiResponseLocalVar, string idempotencyKey, PaymentLinkRequest paymentLinkRequest) + { + bool suppressDefaultLog = false; + AfterPaymentLinks(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, paymentLinkRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterPaymentLinks(ref bool suppressDefaultLog, IPaymentLinksApiResponse apiResponseLocalVar, string idempotencyKey, PaymentLinkRequest paymentLinkRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorPaymentLinksDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentLinkRequest paymentLinkRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorPaymentLinks(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, paymentLinkRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorPaymentLinks(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentLinkRequest paymentLinkRequest); + + /// + /// Create a payment link Creates a payment link to a [Pay by Link](https://docs.adyen.com/unified-commerce/pay-by-link/) page where the shopper can pay. The list of payment methods presented to the shopper depends on the `currency` and `country` parameters sent in the request. For more information, refer to [Pay by Link documentation](https://docs.adyen.com/online-payments/pay-by-link#create-payment-links-through-api). + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task PaymentLinksOrDefaultAsync(Option idempotencyKey = default, Option paymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await PaymentLinksAsync(idempotencyKey, paymentLinkRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Create a payment link Creates a payment link to a [Pay by Link](https://docs.adyen.com/unified-commerce/pay-by-link/) page where the shopper can pay. The list of payment methods presented to the shopper depends on the `currency` and `country` parameters sent in the request. For more information, refer to [Pay by Link documentation](https://docs.adyen.com/online-payments/pay-by-link#create-payment-links-through-api). + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task PaymentLinksAsync(Option idempotencyKey = default, Option paymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidatePaymentLinks(idempotencyKey, paymentLinkRequest); + + FormatPaymentLinks(ref idempotencyKey, paymentLinkRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/paymentLinks"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (paymentLinkRequest.IsSet) + httpRequestMessageLocalVar.Content = (paymentLinkRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentLinkRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + PaymentLinksApiResponse apiResponseLocalVar = new PaymentLinksApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/paymentLinks", requestedAtLocalVar, _jsonSerializerOptions); + + AfterPaymentLinksDefaultImplementation(apiResponseLocalVar, idempotencyKey, paymentLinkRequest); + + Events.ExecuteOnPaymentLinks(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorPaymentLinksDefaultImplementation(e, "/paymentLinks", uriBuilderLocalVar.Path, idempotencyKey, paymentLinkRequest); + Events.ExecuteOnErrorPaymentLinks(e); + throw; + } + } + + /// + /// The + /// + public partial class PaymentLinksApiResponse : Adyen.Client.ApiResponse, IPaymentLinksApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public PaymentLinksApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 201 Created + /// + /// + public bool IsCreated => 201 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 201 Created + /// + /// + public Adyen.Model.Checkout.PaymentLinkResponse Created() + { + // This logic may be modified with the AsModel.mustache template + return IsCreated + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 201 Created and the deserialized response is not null + /// + /// + /// + public bool TryCreated(out Adyen.Model.Checkout.PaymentLinkResponse result) + { + result = null; + + try + { + result = Created(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } - - public Model.Checkout.PaymentLinkResponse GetPaymentLink(string linkId, RequestOptions requestOptions = default) + + partial void FormatUpdatePaymentLink(ref string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUpdatePaymentLink(string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest) { - return GetPaymentLinkAsync(linkId, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + if (linkId == null) + throw new ArgumentNullException(nameof(linkId)); + + if (updatePaymentLinkRequest.IsSet && updatePaymentLinkRequest.Value == null) + throw new ArgumentNullException(nameof(updatePaymentLinkRequest)); } - public async Task GetPaymentLinkAsync(string linkId, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterUpdatePaymentLinkDefaultImplementation(IUpdatePaymentLinkApiResponse apiResponseLocalVar, string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest) { - var endpoint = _baseUrl + $"/paymentLinks/{linkId}"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(null, requestOptions, new HttpMethod("GET"), cancellationToken).ConfigureAwait(false); + bool suppressDefaultLog = false; + AfterUpdatePaymentLink(ref suppressDefaultLog, apiResponseLocalVar, linkId, updatePaymentLinkRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); } - - public Model.Checkout.PaymentLinkResponse PaymentLinks(PaymentLinkRequest paymentLinkRequest = default, RequestOptions requestOptions = default) + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterUpdatePaymentLink(ref bool suppressDefaultLog, IUpdatePaymentLinkApiResponse apiResponseLocalVar, string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorUpdatePaymentLinkDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest) { - return PaymentLinksAsync(paymentLinkRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + bool suppressDefaultLogLocalVar = false; + OnErrorUpdatePaymentLink(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, linkId, updatePaymentLinkRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); } - public async Task PaymentLinksAsync(PaymentLinkRequest paymentLinkRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdatePaymentLink(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest); + + /// + /// Update the status of a payment link Updates the status of a payment link. Use this endpoint to [force the expiry of a payment link](https://docs.adyen.com/online-payments/pay-by-link#update-payment-link-status). + /// + /// Unique identifier of the payment link. + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePaymentLinkOrDefaultAsync(string linkId, Option updatePaymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default) { - var endpoint = _baseUrl + "/paymentLinks"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(paymentLinkRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + try + { + return await UpdatePaymentLinkAsync(linkId, updatePaymentLinkRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } } - - public Model.Checkout.PaymentLinkResponse UpdatePaymentLink(string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest = default, RequestOptions requestOptions = default) + + /// + /// Update the status of a payment link Updates the status of a payment link. Use this endpoint to [force the expiry of a payment link](https://docs.adyen.com/online-payments/pay-by-link#update-payment-link-status). + /// + /// Thrown when fails to make API call + /// Unique identifier of the payment link. + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePaymentLinkAsync(string linkId, Option updatePaymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default) { - return UpdatePaymentLinkAsync(linkId, updatePaymentLinkRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdatePaymentLink(linkId, updatePaymentLinkRequest); + + FormatUpdatePaymentLink(ref linkId, updatePaymentLinkRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/paymentLinks/{linkId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BlinkId%7D", Uri.EscapeDataString(linkId.ToString())); + + if (updatePaymentLinkRequest.IsSet) + httpRequestMessageLocalVar.Content = (updatePaymentLinkRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(updatePaymentLinkRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdatePaymentLinkApiResponse apiResponseLocalVar = new UpdatePaymentLinkApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/paymentLinks/{linkId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdatePaymentLinkDefaultImplementation(apiResponseLocalVar, linkId, updatePaymentLinkRequest); + + Events.ExecuteOnUpdatePaymentLink(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdatePaymentLinkDefaultImplementation(e, "/paymentLinks/{linkId}", uriBuilderLocalVar.Path, linkId, updatePaymentLinkRequest); + Events.ExecuteOnErrorUpdatePaymentLink(e); + throw; + } } - public async Task UpdatePaymentLinkAsync(string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// The + /// + public partial class UpdatePaymentLinkApiResponse : Adyen.Client.ApiResponse, IUpdatePaymentLinkApiResponse { - var endpoint = _baseUrl + $"/paymentLinks/{linkId}"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(updatePaymentLinkRequest.ToJson(), requestOptions, new HttpMethod("PATCH"), cancellationToken).ConfigureAwait(false); + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdatePaymentLinkApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.PaymentLinkResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.PaymentLinkResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } } -} \ No newline at end of file +} diff --git a/Adyen/Service/Checkout/PaymentsService.cs b/Adyen/Service/Checkout/PaymentsService.cs index 8e5ff0a00..8a43622ca 100644 --- a/Adyen/Service/Checkout/PaymentsService.cs +++ b/Adyen/Service/Checkout/PaymentsService.cs @@ -1,220 +1,2636 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections.Generic; -using System.Net.Http; -using System.Threading; +using System.Net; using System.Threading.Tasks; -using Adyen.Model; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Adyen.Client; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// PaymentsService Interface + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. /// - public interface IPaymentsService + public interface IPaymentsService : IApi { + /// + /// The class containing the events + /// + PaymentsServiceEvents Events { get; } + /// /// Get the brands and other details of a card /// - /// - - /// - Additional request options. - /// . - Model.Checkout.CardDetailsResponse CardDetails(CardDetailsRequest cardDetailsRequest = default, RequestOptions requestOptions = default); - + /// + /// Use this endpoint to get information about the card or network token that enables you to decideon the routing of the transaction and the eligibility of the card for the type of transaction. If you include [your supported brands](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__reqParam_supportedBrands) in the request, the response also tells you if you support each [brand that was identified on the card](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__resParam_details). If you have an API-only integration and collect card data, use this endpoint to find out if the shopper's card is co-branded. For co-branded cards, you must let the shopper choose the brand to pay with if you support both brands. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task CardDetailsAsync(Option idempotencyKey = default, Option cardDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Get the brands and other details of a card /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task CardDetailsAsync(CardDetailsRequest cardDetailsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Use this endpoint to get information about the card or network token that enables you to decideon the routing of the transaction and the eligibility of the card for the type of transaction. If you include [your supported brands](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__reqParam_supportedBrands) in the request, the response also tells you if you support each [brand that was identified on the card](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__resParam_details). If you have an API-only integration and collect card data, use this endpoint to find out if the shopper's card is co-branded. For co-branded cards, you must let the shopper choose the brand to pay with if you support both brands. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task CardDetailsOrDefaultAsync(Option idempotencyKey = default, Option cardDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Get the result of a payment session /// - /// - A unique identifier of the session. - /// - The `sessionResult` value from the Drop-in or Component. - /// - Additional request options. - /// . - Model.Checkout.SessionResultResponse GetResultOfPaymentSession(string sessionId, string sessionResult, RequestOptions requestOptions = default); - + /// + /// Returns the status of the payment session with the `sessionId` and `sessionResult` specified in the path. + /// + /// Thrown when fails to make API call + /// A unique identifier of the session. + /// The `sessionResult` value from the Drop-in or Component. + /// Cancellation Token to cancel the request. + /// <> + Task GetResultOfPaymentSessionAsync(string sessionId, string sessionResult, System.Threading.CancellationToken cancellationToken = default); + /// /// Get the result of a payment session /// - /// - A unique identifier of the session. - /// - The `sessionResult` value from the Drop-in or Component. - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task GetResultOfPaymentSessionAsync(string sessionId, string sessionResult, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Returns the status of the payment session with the `sessionId` and `sessionResult` specified in the path. + /// + /// A unique identifier of the session. + /// The `sessionResult` value from the Drop-in or Component. + /// Cancellation Token to cancel the request. + /// <> + Task GetResultOfPaymentSessionOrDefaultAsync(string sessionId, string sessionResult, System.Threading.CancellationToken cancellationToken = default); + /// /// Get a list of available payment methods /// - /// - - /// - Additional request options. - /// . - Model.Checkout.PaymentMethodsResponse PaymentMethods(PaymentMethodsRequest paymentMethodsRequest = default, RequestOptions requestOptions = default); - + /// + /// Retrieves the list of available payment methods for the transaction, based on the transaction information like amount, country, and currency. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task PaymentMethodsAsync(Option idempotencyKey = default, Option paymentMethodsRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Get a list of available payment methods /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task PaymentMethodsAsync(PaymentMethodsRequest paymentMethodsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Retrieves the list of available payment methods for the transaction, based on the transaction information like amount, country, and currency. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task PaymentMethodsOrDefaultAsync(Option idempotencyKey = default, Option paymentMethodsRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Start a transaction /// - /// - - /// - Additional request options. - /// . - Model.Checkout.PaymentResponse Payments(PaymentRequest paymentRequest = default, RequestOptions requestOptions = default); - + /// + /// Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). The response depends on the [payment flow](https://docs.adyen.com/payment-methods#payment-flow): * For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. * For a redirect or additional action, the response contains an `action` object. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task PaymentsAsync(Option idempotencyKey = default, Option paymentRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Start a transaction /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task PaymentsAsync(PaymentRequest paymentRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). The response depends on the [payment flow](https://docs.adyen.com/payment-methods#payment-flow): * For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. * For a redirect or additional action, the response contains an `action` object. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task PaymentsOrDefaultAsync(Option idempotencyKey = default, Option paymentRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Submit details for a payment /// - /// - - /// - Additional request options. - /// . - Model.Checkout.PaymentDetailsResponse PaymentsDetails(PaymentDetailsRequest paymentDetailsRequest = default, RequestOptions requestOptions = default); - + /// + /// Submits details for a payment created using `/payments`. This step is only needed when no final state has been reached on the `/payments` request, for example when the shopper was redirected to another page to complete the payment. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task PaymentsDetailsAsync(Option idempotencyKey = default, Option paymentDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Submit details for a payment /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task PaymentsDetailsAsync(PaymentDetailsRequest paymentDetailsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Submits details for a payment created using `/payments`. This step is only needed when no final state has been reached on the `/payments` request, for example when the shopper was redirected to another page to complete the payment. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task PaymentsDetailsOrDefaultAsync(Option idempotencyKey = default, Option paymentDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Create a payment session /// - /// - - /// - Additional request options. - /// . - Model.Checkout.CreateCheckoutSessionResponse Sessions(CreateCheckoutSessionRequest createCheckoutSessionRequest = default, RequestOptions requestOptions = default); - + /// + /// Creates a payment session for [Drop-in](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Drop-in), [Components](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Components), and [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Hosted+Checkout) integrations. The response contains encrypted payment session data. The front end then uses the session data to make any required server-side calls for the payment flow. You get the payment outcome asynchronously, in an [AUTHORISATION](https://docs.adyen.com/api-explorer/#/Webhooks/latest/post/AUTHORISATION) webhook. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task SessionsAsync(Option idempotencyKey = default, Option createCheckoutSessionRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Create a payment session /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task SessionsAsync(CreateCheckoutSessionRequest createCheckoutSessionRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Creates a payment session for [Drop-in](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Drop-in), [Components](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Components), and [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Hosted+Checkout) integrations. The response contains encrypted payment session data. The front end then uses the session data to make any required server-side calls for the payment flow. You get the payment outcome asynchronously, in an [AUTHORISATION](https://docs.adyen.com/api-explorer/#/Webhooks/latest/post/AUTHORISATION) webhook. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task SessionsOrDefaultAsync(Option idempotencyKey = default, Option createCheckoutSessionRequest = default, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ICardDetailsApiResponse : Adyen.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetResultOfPaymentSessionApiResponse : Adyen.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IPaymentMethodsApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface IPaymentsApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface IPaymentsDetailsApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } } - + + /// + /// The + /// + public interface ISessionsApiResponse : Adyen.Client.IApiResponse, ICreated + { + /// + /// Returns true if the response is 201 Created + /// + /// + bool IsCreated { get; } + } + /// - /// Represents a collection of functions to interact with the PaymentsService API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public class PaymentsService : AbstractService, IPaymentsService + public class PaymentsServiceEvents { - private readonly string _baseUrl; - - public PaymentsService(AdyenClient adyenClient) : base(adyenClient) + /// + /// The event raised after the server response + /// + public event EventHandler OnCardDetails; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCardDetails; + + internal void ExecuteOnCardDetails(PaymentsService.CardDetailsApiResponse apiResponse) + { + OnCardDetails?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCardDetails(Exception exception) + { + OnErrorCardDetails?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetResultOfPaymentSession; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetResultOfPaymentSession; + + internal void ExecuteOnGetResultOfPaymentSession(PaymentsService.GetResultOfPaymentSessionApiResponse apiResponse) + { + OnGetResultOfPaymentSession?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetResultOfPaymentSession(Exception exception) + { + OnErrorGetResultOfPaymentSession?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnPaymentMethods; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorPaymentMethods; + + internal void ExecuteOnPaymentMethods(PaymentsService.PaymentMethodsApiResponse apiResponse) + { + OnPaymentMethods?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorPaymentMethods(Exception exception) + { + OnErrorPaymentMethods?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnPayments; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorPayments; + + internal void ExecuteOnPayments(PaymentsService.PaymentsApiResponse apiResponse) + { + OnPayments?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorPayments(Exception exception) + { + OnErrorPayments?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnPaymentsDetails; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorPaymentsDetails; + + internal void ExecuteOnPaymentsDetails(PaymentsService.PaymentsDetailsApiResponse apiResponse) { - _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); + OnPaymentsDetails?.Invoke(this, new ApiResponseEventArgs(apiResponse)); } - - public Model.Checkout.CardDetailsResponse CardDetails(CardDetailsRequest cardDetailsRequest = default, RequestOptions requestOptions = default) + + internal void ExecuteOnErrorPaymentsDetails(Exception exception) { - return CardDetailsAsync(cardDetailsRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + OnErrorPaymentsDetails?.Invoke(this, new ExceptionEventArgs(exception)); } - public async Task CardDetailsAsync(CardDetailsRequest cardDetailsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// The event raised after the server response + /// + public event EventHandler OnSessions; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorSessions; + + internal void ExecuteOnSessions(PaymentsService.SessionsApiResponse apiResponse) { - var endpoint = _baseUrl + "/cardDetails"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(cardDetailsRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + OnSessions?.Invoke(this, new ApiResponseEventArgs(apiResponse)); } - - public Model.Checkout.SessionResultResponse GetResultOfPaymentSession(string sessionId, string sessionResult, RequestOptions requestOptions = default) + + internal void ExecuteOnErrorSessions(Exception exception) { - return GetResultOfPaymentSessionAsync(sessionId, sessionResult, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + OnErrorSessions?.Invoke(this, new ExceptionEventArgs(exception)); } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class PaymentsService : IPaymentsService + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public PaymentsServiceEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } - public async Task GetResultOfPaymentSessionAsync(string sessionId, string sessionResult, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// Initializes a new instance of the class. + /// + /// + public PaymentsService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, PaymentsServiceEvents paymentsServiceEvents, + TokenProvider apiKeyProvider, + TokenProvider basicTokenProvider) { - // Build the query string - var queryParams = new Dictionary(); - queryParams.Add("sessionResult", sessionResult); - var endpoint = _baseUrl + $"/sessions/{sessionId}" + ToQueryString(queryParams); - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(null, requestOptions, new HttpMethod("GET"), cancellationToken).ConfigureAwait(false); + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = paymentsServiceEvents; + ApiKeyProvider = apiKeyProvider; + BasicTokenProvider = basicTokenProvider; } - - public Model.Checkout.PaymentMethodsResponse PaymentMethods(PaymentMethodsRequest paymentMethodsRequest = default, RequestOptions requestOptions = default) + + partial void FormatCardDetails(ref string idempotencyKey, CardDetailsRequest cardDetailsRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateCardDetails(string idempotencyKey, CardDetailsRequest cardDetailsRequest) { - return PaymentMethodsAsync(paymentMethodsRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (cardDetailsRequest.IsSet && cardDetailsRequest.Value == null) + throw new ArgumentNullException(nameof(cardDetailsRequest)); } - public async Task PaymentMethodsAsync(PaymentMethodsRequest paymentMethodsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterCardDetailsDefaultImplementation(ICardDetailsApiResponse apiResponseLocalVar, string idempotencyKey, CardDetailsRequest cardDetailsRequest) { - var endpoint = _baseUrl + "/paymentMethods"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(paymentMethodsRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + bool suppressDefaultLog = false; + AfterCardDetails(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, cardDetailsRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); } - - public Model.Checkout.PaymentResponse Payments(PaymentRequest paymentRequest = default, RequestOptions requestOptions = default) + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterCardDetails(ref bool suppressDefaultLog, ICardDetailsApiResponse apiResponseLocalVar, string idempotencyKey, CardDetailsRequest cardDetailsRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorCardDetailsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CardDetailsRequest cardDetailsRequest) { - return PaymentsAsync(paymentRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + bool suppressDefaultLogLocalVar = false; + OnErrorCardDetails(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, cardDetailsRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); } - public async Task PaymentsAsync(PaymentRequest paymentRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorCardDetails(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CardDetailsRequest cardDetailsRequest); + + /// + /// Get the brands and other details of a card Use this endpoint to get information about the card or network token that enables you to decideon the routing of the transaction and the eligibility of the card for the type of transaction. If you include [your supported brands](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__reqParam_supportedBrands) in the request, the response also tells you if you support each [brand that was identified on the card](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__resParam_details). If you have an API-only integration and collect card data, use this endpoint to find out if the shopper's card is co-branded. For co-branded cards, you must let the shopper choose the brand to pay with if you support both brands. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task CardDetailsOrDefaultAsync(Option idempotencyKey = default, Option cardDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default) { - var endpoint = _baseUrl + "/payments"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(paymentRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + try + { + return await CardDetailsAsync(idempotencyKey, cardDetailsRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } } - - public Model.Checkout.PaymentDetailsResponse PaymentsDetails(PaymentDetailsRequest paymentDetailsRequest = default, RequestOptions requestOptions = default) + + /// + /// Get the brands and other details of a card Use this endpoint to get information about the card or network token that enables you to decideon the routing of the transaction and the eligibility of the card for the type of transaction. If you include [your supported brands](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__reqParam_supportedBrands) in the request, the response also tells you if you support each [brand that was identified on the card](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__resParam_details). If you have an API-only integration and collect card data, use this endpoint to find out if the shopper's card is co-branded. For co-branded cards, you must let the shopper choose the brand to pay with if you support both brands. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task CardDetailsAsync(Option idempotencyKey = default, Option cardDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default) { - return PaymentsDetailsAsync(paymentDetailsRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCardDetails(idempotencyKey, cardDetailsRequest); + + FormatCardDetails(ref idempotencyKey, cardDetailsRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/cardDetails"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (cardDetailsRequest.IsSet) + httpRequestMessageLocalVar.Content = (cardDetailsRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(cardDetailsRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CardDetailsApiResponse apiResponseLocalVar = new CardDetailsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/cardDetails", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCardDetailsDefaultImplementation(apiResponseLocalVar, idempotencyKey, cardDetailsRequest); + + Events.ExecuteOnCardDetails(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCardDetailsDefaultImplementation(e, "/cardDetails", uriBuilderLocalVar.Path, idempotencyKey, cardDetailsRequest); + Events.ExecuteOnErrorCardDetails(e); + throw; + } } - public async Task PaymentsDetailsAsync(PaymentDetailsRequest paymentDetailsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// The + /// + public partial class CardDetailsApiResponse : Adyen.Client.ApiResponse, ICardDetailsApiResponse { - var endpoint = _baseUrl + "/payments/details"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(paymentDetailsRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CardDetailsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.CardDetailsResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.CardDetailsResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } - - public Model.Checkout.CreateCheckoutSessionResponse Sessions(CreateCheckoutSessionRequest createCheckoutSessionRequest = default, RequestOptions requestOptions = default) + + partial void FormatGetResultOfPaymentSession(ref string sessionId, ref string sessionResult); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateGetResultOfPaymentSession(string sessionId, string sessionResult) { - return SessionsAsync(createCheckoutSessionRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + if (sessionId == null) + throw new ArgumentNullException(nameof(sessionId)); + + if (sessionResult == null) + throw new ArgumentNullException(nameof(sessionResult)); } - public async Task SessionsAsync(CreateCheckoutSessionRequest createCheckoutSessionRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterGetResultOfPaymentSessionDefaultImplementation(IGetResultOfPaymentSessionApiResponse apiResponseLocalVar, string sessionId, string sessionResult) { - var endpoint = _baseUrl + "/sessions"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(createCheckoutSessionRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + bool suppressDefaultLog = false; + AfterGetResultOfPaymentSession(ref suppressDefaultLog, apiResponseLocalVar, sessionId, sessionResult); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterGetResultOfPaymentSession(ref bool suppressDefaultLog, IGetResultOfPaymentSessionApiResponse apiResponseLocalVar, string sessionId, string sessionResult); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorGetResultOfPaymentSessionDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string sessionId, string sessionResult) + { + bool suppressDefaultLogLocalVar = false; + OnErrorGetResultOfPaymentSession(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, sessionId, sessionResult); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorGetResultOfPaymentSession(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string sessionId, string sessionResult); + + /// + /// Get the result of a payment session Returns the status of the payment session with the `sessionId` and `sessionResult` specified in the path. + /// + /// A unique identifier of the session. + /// The `sessionResult` value from the Drop-in or Component. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetResultOfPaymentSessionOrDefaultAsync(string sessionId, string sessionResult, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetResultOfPaymentSessionAsync(sessionId, sessionResult, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Get the result of a payment session Returns the status of the payment session with the `sessionId` and `sessionResult` specified in the path. + /// + /// Thrown when fails to make API call + /// A unique identifier of the session. + /// The `sessionResult` value from the Drop-in or Component. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetResultOfPaymentSessionAsync(string sessionId, string sessionResult, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetResultOfPaymentSession(sessionId, sessionResult); + + FormatGetResultOfPaymentSession(ref sessionId, ref sessionResult); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/sessions/{sessionId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BsessionId%7D", Uri.EscapeDataString(sessionId.ToString())); + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["sessionResult"] = ClientUtils.ParameterToString(sessionResult); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetResultOfPaymentSessionApiResponse apiResponseLocalVar = new GetResultOfPaymentSessionApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/sessions/{sessionId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetResultOfPaymentSessionDefaultImplementation(apiResponseLocalVar, sessionId, sessionResult); + + Events.ExecuteOnGetResultOfPaymentSession(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetResultOfPaymentSessionDefaultImplementation(e, "/sessions/{sessionId}", uriBuilderLocalVar.Path, sessionId, sessionResult); + Events.ExecuteOnErrorGetResultOfPaymentSession(e); + throw; + } + } + + /// + /// The + /// + public partial class GetResultOfPaymentSessionApiResponse : Adyen.Client.ApiResponse, IGetResultOfPaymentSessionApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetResultOfPaymentSessionApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.SessionResultResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.SessionResultResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatPaymentMethods(ref string idempotencyKey, PaymentMethodsRequest paymentMethodsRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidatePaymentMethods(string idempotencyKey, PaymentMethodsRequest paymentMethodsRequest) + { + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (paymentMethodsRequest.IsSet && paymentMethodsRequest.Value == null) + throw new ArgumentNullException(nameof(paymentMethodsRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterPaymentMethodsDefaultImplementation(IPaymentMethodsApiResponse apiResponseLocalVar, string idempotencyKey, PaymentMethodsRequest paymentMethodsRequest) + { + bool suppressDefaultLog = false; + AfterPaymentMethods(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, paymentMethodsRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterPaymentMethods(ref bool suppressDefaultLog, IPaymentMethodsApiResponse apiResponseLocalVar, string idempotencyKey, PaymentMethodsRequest paymentMethodsRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorPaymentMethodsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentMethodsRequest paymentMethodsRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorPaymentMethods(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, paymentMethodsRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorPaymentMethods(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentMethodsRequest paymentMethodsRequest); + + /// + /// Get a list of available payment methods Retrieves the list of available payment methods for the transaction, based on the transaction information like amount, country, and currency. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task PaymentMethodsOrDefaultAsync(Option idempotencyKey = default, Option paymentMethodsRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await PaymentMethodsAsync(idempotencyKey, paymentMethodsRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Get a list of available payment methods Retrieves the list of available payment methods for the transaction, based on the transaction information like amount, country, and currency. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task PaymentMethodsAsync(Option idempotencyKey = default, Option paymentMethodsRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidatePaymentMethods(idempotencyKey, paymentMethodsRequest); + + FormatPaymentMethods(ref idempotencyKey, paymentMethodsRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/paymentMethods"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (paymentMethodsRequest.IsSet) + httpRequestMessageLocalVar.Content = (paymentMethodsRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentMethodsRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + PaymentMethodsApiResponse apiResponseLocalVar = new PaymentMethodsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/paymentMethods", requestedAtLocalVar, _jsonSerializerOptions); + + AfterPaymentMethodsDefaultImplementation(apiResponseLocalVar, idempotencyKey, paymentMethodsRequest); + + Events.ExecuteOnPaymentMethods(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorPaymentMethodsDefaultImplementation(e, "/paymentMethods", uriBuilderLocalVar.Path, idempotencyKey, paymentMethodsRequest); + Events.ExecuteOnErrorPaymentMethods(e); + throw; + } + } + + /// + /// The + /// + public partial class PaymentMethodsApiResponse : Adyen.Client.ApiResponse, IPaymentMethodsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public PaymentMethodsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.PaymentMethodsResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.PaymentMethodsResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatPayments(ref string idempotencyKey, PaymentRequest paymentRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidatePayments(string idempotencyKey, PaymentRequest paymentRequest) + { + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (paymentRequest.IsSet && paymentRequest.Value == null) + throw new ArgumentNullException(nameof(paymentRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterPaymentsDefaultImplementation(IPaymentsApiResponse apiResponseLocalVar, string idempotencyKey, PaymentRequest paymentRequest) + { + bool suppressDefaultLog = false; + AfterPayments(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, paymentRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterPayments(ref bool suppressDefaultLog, IPaymentsApiResponse apiResponseLocalVar, string idempotencyKey, PaymentRequest paymentRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorPaymentsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentRequest paymentRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorPayments(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, paymentRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorPayments(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentRequest paymentRequest); + + /// + /// Start a transaction Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). The response depends on the [payment flow](https://docs.adyen.com/payment-methods#payment-flow): * For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. * For a redirect or additional action, the response contains an `action` object. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task PaymentsOrDefaultAsync(Option idempotencyKey = default, Option paymentRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await PaymentsAsync(idempotencyKey, paymentRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Start a transaction Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). The response depends on the [payment flow](https://docs.adyen.com/payment-methods#payment-flow): * For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. * For a redirect or additional action, the response contains an `action` object. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task PaymentsAsync(Option idempotencyKey = default, Option paymentRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidatePayments(idempotencyKey, paymentRequest); + + FormatPayments(ref idempotencyKey, paymentRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (paymentRequest.IsSet) + httpRequestMessageLocalVar.Content = (paymentRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + PaymentsApiResponse apiResponseLocalVar = new PaymentsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments", requestedAtLocalVar, _jsonSerializerOptions); + + AfterPaymentsDefaultImplementation(apiResponseLocalVar, idempotencyKey, paymentRequest); + + Events.ExecuteOnPayments(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorPaymentsDefaultImplementation(e, "/payments", uriBuilderLocalVar.Path, idempotencyKey, paymentRequest); + Events.ExecuteOnErrorPayments(e); + throw; + } + } + + /// + /// The + /// + public partial class PaymentsApiResponse : Adyen.Client.ApiResponse, IPaymentsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public PaymentsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.PaymentResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.PaymentResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatPaymentsDetails(ref string idempotencyKey, PaymentDetailsRequest paymentDetailsRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidatePaymentsDetails(string idempotencyKey, PaymentDetailsRequest paymentDetailsRequest) + { + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (paymentDetailsRequest.IsSet && paymentDetailsRequest.Value == null) + throw new ArgumentNullException(nameof(paymentDetailsRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterPaymentsDetailsDefaultImplementation(IPaymentsDetailsApiResponse apiResponseLocalVar, string idempotencyKey, PaymentDetailsRequest paymentDetailsRequest) + { + bool suppressDefaultLog = false; + AfterPaymentsDetails(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, paymentDetailsRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterPaymentsDetails(ref bool suppressDefaultLog, IPaymentsDetailsApiResponse apiResponseLocalVar, string idempotencyKey, PaymentDetailsRequest paymentDetailsRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorPaymentsDetailsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentDetailsRequest paymentDetailsRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorPaymentsDetails(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, paymentDetailsRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorPaymentsDetails(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentDetailsRequest paymentDetailsRequest); + + /// + /// Submit details for a payment Submits details for a payment created using `/payments`. This step is only needed when no final state has been reached on the `/payments` request, for example when the shopper was redirected to another page to complete the payment. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task PaymentsDetailsOrDefaultAsync(Option idempotencyKey = default, Option paymentDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await PaymentsDetailsAsync(idempotencyKey, paymentDetailsRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Submit details for a payment Submits details for a payment created using `/payments`. This step is only needed when no final state has been reached on the `/payments` request, for example when the shopper was redirected to another page to complete the payment. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task PaymentsDetailsAsync(Option idempotencyKey = default, Option paymentDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidatePaymentsDetails(idempotencyKey, paymentDetailsRequest); + + FormatPaymentsDetails(ref idempotencyKey, paymentDetailsRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments/details"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (paymentDetailsRequest.IsSet) + httpRequestMessageLocalVar.Content = (paymentDetailsRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentDetailsRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + PaymentsDetailsApiResponse apiResponseLocalVar = new PaymentsDetailsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments/details", requestedAtLocalVar, _jsonSerializerOptions); + + AfterPaymentsDetailsDefaultImplementation(apiResponseLocalVar, idempotencyKey, paymentDetailsRequest); + + Events.ExecuteOnPaymentsDetails(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorPaymentsDetailsDefaultImplementation(e, "/payments/details", uriBuilderLocalVar.Path, idempotencyKey, paymentDetailsRequest); + Events.ExecuteOnErrorPaymentsDetails(e); + throw; + } + } + + /// + /// The + /// + public partial class PaymentsDetailsApiResponse : Adyen.Client.ApiResponse, IPaymentsDetailsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public PaymentsDetailsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.PaymentDetailsResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.PaymentDetailsResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatSessions(ref string idempotencyKey, CreateCheckoutSessionRequest createCheckoutSessionRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateSessions(string idempotencyKey, CreateCheckoutSessionRequest createCheckoutSessionRequest) + { + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (createCheckoutSessionRequest.IsSet && createCheckoutSessionRequest.Value == null) + throw new ArgumentNullException(nameof(createCheckoutSessionRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterSessionsDefaultImplementation(ISessionsApiResponse apiResponseLocalVar, string idempotencyKey, CreateCheckoutSessionRequest createCheckoutSessionRequest) + { + bool suppressDefaultLog = false; + AfterSessions(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, createCheckoutSessionRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterSessions(ref bool suppressDefaultLog, ISessionsApiResponse apiResponseLocalVar, string idempotencyKey, CreateCheckoutSessionRequest createCheckoutSessionRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorSessionsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CreateCheckoutSessionRequest createCheckoutSessionRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorSessions(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, createCheckoutSessionRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorSessions(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CreateCheckoutSessionRequest createCheckoutSessionRequest); + + /// + /// Create a payment session Creates a payment session for [Drop-in](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Drop-in), [Components](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Components), and [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Hosted+Checkout) integrations. The response contains encrypted payment session data. The front end then uses the session data to make any required server-side calls for the payment flow. You get the payment outcome asynchronously, in an [AUTHORISATION](https://docs.adyen.com/api-explorer/#/Webhooks/latest/post/AUTHORISATION) webhook. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task SessionsOrDefaultAsync(Option idempotencyKey = default, Option createCheckoutSessionRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await SessionsAsync(idempotencyKey, createCheckoutSessionRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Create a payment session Creates a payment session for [Drop-in](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Drop-in), [Components](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Components), and [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Hosted+Checkout) integrations. The response contains encrypted payment session data. The front end then uses the session data to make any required server-side calls for the payment flow. You get the payment outcome asynchronously, in an [AUTHORISATION](https://docs.adyen.com/api-explorer/#/Webhooks/latest/post/AUTHORISATION) webhook. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task SessionsAsync(Option idempotencyKey = default, Option createCheckoutSessionRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateSessions(idempotencyKey, createCheckoutSessionRequest); + + FormatSessions(ref idempotencyKey, createCheckoutSessionRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/sessions"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (createCheckoutSessionRequest.IsSet) + httpRequestMessageLocalVar.Content = (createCheckoutSessionRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(createCheckoutSessionRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + SessionsApiResponse apiResponseLocalVar = new SessionsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/sessions", requestedAtLocalVar, _jsonSerializerOptions); + + AfterSessionsDefaultImplementation(apiResponseLocalVar, idempotencyKey, createCheckoutSessionRequest); + + Events.ExecuteOnSessions(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorSessionsDefaultImplementation(e, "/sessions", uriBuilderLocalVar.Path, idempotencyKey, createCheckoutSessionRequest); + Events.ExecuteOnErrorSessions(e); + throw; + } + } + + /// + /// The + /// + public partial class SessionsApiResponse : Adyen.Client.ApiResponse, ISessionsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public SessionsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 201 Created + /// + /// + public bool IsCreated => 201 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 201 Created + /// + /// + public Adyen.Model.Checkout.CreateCheckoutSessionResponse Created() + { + // This logic may be modified with the AsModel.mustache template + return IsCreated + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 201 Created and the deserialized response is not null + /// + /// + /// + public bool TryCreated(out Adyen.Model.Checkout.CreateCheckoutSessionResponse result) + { + result = null; + + try + { + result = Created(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } } -} \ No newline at end of file +} diff --git a/Adyen/Service/Checkout/RecurringService.cs b/Adyen/Service/Checkout/RecurringService.cs index 002195611..c03fa5f8a 100644 --- a/Adyen/Service/Checkout/RecurringService.cs +++ b/Adyen/Service/Checkout/RecurringService.cs @@ -1,140 +1,996 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections.Generic; -using System.Net.Http; -using System.Threading; +using System.Net; using System.Threading.Tasks; -using Adyen.Model; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Adyen.Client; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// RecurringService Interface + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. /// - public interface IRecurringService + public interface IRecurringService : IApi { + /// + /// The class containing the events + /// + RecurringServiceEvents Events { get; } + /// /// Delete a token for stored payment details /// - /// - The unique identifier of the token. - /// - Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - /// - Your merchant account. - /// - Additional request options. - void DeleteTokenForStoredPaymentDetails(string storedPaymentMethodId, string shopperReference, string merchantAccount, RequestOptions requestOptions = default); - + /// + /// Deletes the token identified in the path. The token can no longer be used with payment requests. + /// + /// Thrown when fails to make API call + /// The unique identifier of the token. + /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + /// Your merchant account. + /// Cancellation Token to cancel the request. + /// <> + Task DeleteTokenForStoredPaymentDetailsAsync(string storedPaymentMethodId, string shopperReference, string merchantAccount, System.Threading.CancellationToken cancellationToken = default); + /// /// Delete a token for stored payment details /// - /// - The unique identifier of the token. - /// - Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - /// - Your merchant account. - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - Task DeleteTokenForStoredPaymentDetailsAsync(string storedPaymentMethodId, string shopperReference, string merchantAccount, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Deletes the token identified in the path. The token can no longer be used with payment requests. + /// + /// The unique identifier of the token. + /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + /// Your merchant account. + /// Cancellation Token to cancel the request. + /// <> + Task DeleteTokenForStoredPaymentDetailsOrDefaultAsync(string storedPaymentMethodId, string shopperReference, string merchantAccount, System.Threading.CancellationToken cancellationToken = default); + /// /// Get tokens for stored payment details /// - /// - Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - /// - Your merchant account. - /// - Additional request options. - /// . - Model.Checkout.ListStoredPaymentMethodsResponse GetTokensForStoredPaymentDetails(string shopperReference = default, string merchantAccount = default, RequestOptions requestOptions = default); - + /// + /// Lists the tokens for stored payment details for the shopper identified in the path, if there are any available. The token ID can be used with payment requests for the shopper's payment. A summary of the stored details is included. + /// + /// Thrown when fails to make API call + /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. (optional) + /// Your merchant account. (optional) + /// Cancellation Token to cancel the request. + /// <> + Task GetTokensForStoredPaymentDetailsAsync(Option shopperReference = default, Option merchantAccount = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Get tokens for stored payment details /// - /// - Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - /// - Your merchant account. - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task GetTokensForStoredPaymentDetailsAsync(string shopperReference = default, string merchantAccount = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Lists the tokens for stored payment details for the shopper identified in the path, if there are any available. The token ID can be used with payment requests for the shopper's payment. A summary of the stored details is included. + /// + /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. (optional) + /// Your merchant account. (optional) + /// Cancellation Token to cancel the request. + /// <> + Task GetTokensForStoredPaymentDetailsOrDefaultAsync(Option shopperReference = default, Option merchantAccount = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Create a token to store payment details /// - /// - - /// - Additional request options. - /// . - Model.Checkout.StoredPaymentMethodResource StoredPaymentMethods(StoredPaymentMethodRequest storedPaymentMethodRequest = default, RequestOptions requestOptions = default); - + /// + /// Creates a token to store the shopper's payment details. This token can be used for the shopper's future payments. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task StoredPaymentMethodsAsync(Option idempotencyKey = default, Option storedPaymentMethodRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Create a token to store payment details /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task StoredPaymentMethodsAsync(StoredPaymentMethodRequest storedPaymentMethodRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Creates a token to store the shopper's payment details. This token can be used for the shopper's future payments. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task StoredPaymentMethodsOrDefaultAsync(Option idempotencyKey = default, Option storedPaymentMethodRequest = default, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IDeleteTokenForStoredPaymentDetailsApiResponse : Adyen.Client.IApiResponse + { + /// + /// Returns true if the response is 204 NoContent + /// + /// + bool IsNoContent { get; } + } + + /// + /// The + /// + public interface IGetTokensForStoredPaymentDetailsApiResponse : Adyen.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IStoredPaymentMethodsApiResponse : Adyen.Client.IApiResponse, ICreated + { + /// + /// Returns true if the response is 201 Created + /// + /// + bool IsCreated { get; } } - + /// - /// Represents a collection of functions to interact with the RecurringService API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public class RecurringService : AbstractService, IRecurringService + public class RecurringServiceEvents { - private readonly string _baseUrl; - - public RecurringService(AdyenClient adyenClient) : base(adyenClient) + /// + /// The event raised after the server response + /// + public event EventHandler OnDeleteTokenForStoredPaymentDetails; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeleteTokenForStoredPaymentDetails; + + internal void ExecuteOnDeleteTokenForStoredPaymentDetails(RecurringService.DeleteTokenForStoredPaymentDetailsApiResponse apiResponse) + { + OnDeleteTokenForStoredPaymentDetails?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeleteTokenForStoredPaymentDetails(Exception exception) + { + OnErrorDeleteTokenForStoredPaymentDetails?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetTokensForStoredPaymentDetails; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetTokensForStoredPaymentDetails; + + internal void ExecuteOnGetTokensForStoredPaymentDetails(RecurringService.GetTokensForStoredPaymentDetailsApiResponse apiResponse) + { + OnGetTokensForStoredPaymentDetails?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetTokensForStoredPaymentDetails(Exception exception) + { + OnErrorGetTokensForStoredPaymentDetails?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnStoredPaymentMethods; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorStoredPaymentMethods; + + internal void ExecuteOnStoredPaymentMethods(RecurringService.StoredPaymentMethodsApiResponse apiResponse) + { + OnStoredPaymentMethods?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorStoredPaymentMethods(Exception exception) + { + OnErrorStoredPaymentMethods?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class RecurringService : IRecurringService + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public RecurringServiceEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public RecurringService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, RecurringServiceEvents recurringServiceEvents, + TokenProvider apiKeyProvider, + TokenProvider basicTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = recurringServiceEvents; + ApiKeyProvider = apiKeyProvider; + BasicTokenProvider = basicTokenProvider; + } + + partial void FormatDeleteTokenForStoredPaymentDetails(ref string storedPaymentMethodId, ref string shopperReference, ref string merchantAccount); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + private void ValidateDeleteTokenForStoredPaymentDetails(string storedPaymentMethodId, string shopperReference, string merchantAccount) + { + if (storedPaymentMethodId == null) + throw new ArgumentNullException(nameof(storedPaymentMethodId)); + + if (shopperReference == null) + throw new ArgumentNullException(nameof(shopperReference)); + + if (merchantAccount == null) + throw new ArgumentNullException(nameof(merchantAccount)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterDeleteTokenForStoredPaymentDetailsDefaultImplementation(IDeleteTokenForStoredPaymentDetailsApiResponse apiResponseLocalVar, string storedPaymentMethodId, string shopperReference, string merchantAccount) + { + bool suppressDefaultLog = false; + AfterDeleteTokenForStoredPaymentDetails(ref suppressDefaultLog, apiResponseLocalVar, storedPaymentMethodId, shopperReference, merchantAccount); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterDeleteTokenForStoredPaymentDetails(ref bool suppressDefaultLog, IDeleteTokenForStoredPaymentDetailsApiResponse apiResponseLocalVar, string storedPaymentMethodId, string shopperReference, string merchantAccount); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorDeleteTokenForStoredPaymentDetailsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string storedPaymentMethodId, string shopperReference, string merchantAccount) + { + bool suppressDefaultLogLocalVar = false; + OnErrorDeleteTokenForStoredPaymentDetails(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, storedPaymentMethodId, shopperReference, merchantAccount); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorDeleteTokenForStoredPaymentDetails(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string storedPaymentMethodId, string shopperReference, string merchantAccount); + + /// + /// Delete a token for stored payment details Deletes the token identified in the path. The token can no longer be used with payment requests. + /// + /// The unique identifier of the token. + /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + /// Your merchant account. + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteTokenForStoredPaymentDetailsOrDefaultAsync(string storedPaymentMethodId, string shopperReference, string merchantAccount, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeleteTokenForStoredPaymentDetailsAsync(storedPaymentMethodId, shopperReference, merchantAccount, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Delete a token for stored payment details Deletes the token identified in the path. The token can no longer be used with payment requests. + /// + /// Thrown when fails to make API call + /// The unique identifier of the token. + /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + /// Your merchant account. + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteTokenForStoredPaymentDetailsAsync(string storedPaymentMethodId, string shopperReference, string merchantAccount, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeleteTokenForStoredPaymentDetails(storedPaymentMethodId, shopperReference, merchantAccount); + + FormatDeleteTokenForStoredPaymentDetails(ref storedPaymentMethodId, ref shopperReference, ref merchantAccount); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/storedPaymentMethods/{storedPaymentMethodId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BstoredPaymentMethodId%7D", Uri.EscapeDataString(storedPaymentMethodId.ToString())); + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["shopperReference"] = ClientUtils.ParameterToString(shopperReference); + parseQueryStringLocalVar["merchantAccount"] = ClientUtils.ParameterToString(merchantAccount); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DeleteTokenForStoredPaymentDetailsApiResponse apiResponseLocalVar = new DeleteTokenForStoredPaymentDetailsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/storedPaymentMethods/{storedPaymentMethodId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDeleteTokenForStoredPaymentDetailsDefaultImplementation(apiResponseLocalVar, storedPaymentMethodId, shopperReference, merchantAccount); + + Events.ExecuteOnDeleteTokenForStoredPaymentDetails(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDeleteTokenForStoredPaymentDetailsDefaultImplementation(e, "/storedPaymentMethods/{storedPaymentMethodId}", uriBuilderLocalVar.Path, storedPaymentMethodId, shopperReference, merchantAccount); + Events.ExecuteOnErrorDeleteTokenForStoredPaymentDetails(e); + throw; + } + } + + /// + /// The + /// + public partial class DeleteTokenForStoredPaymentDetailsApiResponse : Adyen.Client.ApiResponse, IDeleteTokenForStoredPaymentDetailsApiResponse { - _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeleteTokenForStoredPaymentDetailsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 204 NoContent + /// + /// + public bool IsNoContent => 204 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } - - public void DeleteTokenForStoredPaymentDetails(string storedPaymentMethodId, string shopperReference, string merchantAccount, RequestOptions requestOptions = default) + + partial void FormatGetTokensForStoredPaymentDetails(ref string shopperReference, ref string merchantAccount); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateGetTokensForStoredPaymentDetails(string shopperReference, string merchantAccount) { - DeleteTokenForStoredPaymentDetailsAsync(storedPaymentMethodId, shopperReference, merchantAccount, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + if (shopperReference.IsSet && shopperReference.Value == null) + throw new ArgumentNullException(nameof(shopperReference)); + + if (merchantAccount.IsSet && merchantAccount.Value == null) + throw new ArgumentNullException(nameof(merchantAccount)); } - public async Task DeleteTokenForStoredPaymentDetailsAsync(string storedPaymentMethodId, string shopperReference, string merchantAccount, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterGetTokensForStoredPaymentDetailsDefaultImplementation(IGetTokensForStoredPaymentDetailsApiResponse apiResponseLocalVar, string shopperReference, string merchantAccount) { - // Build the query string - var queryParams = new Dictionary(); - queryParams.Add("shopperReference", shopperReference); - queryParams.Add("merchantAccount", merchantAccount); - var endpoint = _baseUrl + $"/storedPaymentMethods/{storedPaymentMethodId}" + ToQueryString(queryParams); - var resource = new ServiceResource(this, endpoint); - await resource.RequestAsync(null, requestOptions, new HttpMethod("DELETE"), cancellationToken).ConfigureAwait(false); + bool suppressDefaultLog = false; + AfterGetTokensForStoredPaymentDetails(ref suppressDefaultLog, apiResponseLocalVar, shopperReference, merchantAccount); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); } - - public Model.Checkout.ListStoredPaymentMethodsResponse GetTokensForStoredPaymentDetails(string shopperReference = default, string merchantAccount = default, RequestOptions requestOptions = default) + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterGetTokensForStoredPaymentDetails(ref bool suppressDefaultLog, IGetTokensForStoredPaymentDetailsApiResponse apiResponseLocalVar, string shopperReference, string merchantAccount); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorGetTokensForStoredPaymentDetailsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string shopperReference, string merchantAccount) { - return GetTokensForStoredPaymentDetailsAsync(shopperReference, merchantAccount, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + bool suppressDefaultLogLocalVar = false; + OnErrorGetTokensForStoredPaymentDetails(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, shopperReference, merchantAccount); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); } - public async Task GetTokensForStoredPaymentDetailsAsync(string shopperReference = default, string merchantAccount = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorGetTokensForStoredPaymentDetails(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string shopperReference, string merchantAccount); + + /// + /// Get tokens for stored payment details Lists the tokens for stored payment details for the shopper identified in the path, if there are any available. The token ID can be used with payment requests for the shopper's payment. A summary of the stored details is included. + /// + /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. (optional) + /// Your merchant account. (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task GetTokensForStoredPaymentDetailsOrDefaultAsync(Option shopperReference = default, Option merchantAccount = default, System.Threading.CancellationToken cancellationToken = default) { - // Build the query string - var queryParams = new Dictionary(); - if (shopperReference != null) queryParams.Add("shopperReference", shopperReference); - if (merchantAccount != null) queryParams.Add("merchantAccount", merchantAccount); - var endpoint = _baseUrl + "/storedPaymentMethods" + ToQueryString(queryParams); - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(null, requestOptions, new HttpMethod("GET"), cancellationToken).ConfigureAwait(false); + try + { + return await GetTokensForStoredPaymentDetailsAsync(shopperReference, merchantAccount, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } } - - public Model.Checkout.StoredPaymentMethodResource StoredPaymentMethods(StoredPaymentMethodRequest storedPaymentMethodRequest = default, RequestOptions requestOptions = default) + + /// + /// Get tokens for stored payment details Lists the tokens for stored payment details for the shopper identified in the path, if there are any available. The token ID can be used with payment requests for the shopper's payment. A summary of the stored details is included. + /// + /// Thrown when fails to make API call + /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. (optional) + /// Your merchant account. (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task GetTokensForStoredPaymentDetailsAsync(Option shopperReference = default, Option merchantAccount = default, System.Threading.CancellationToken cancellationToken = default) { - return StoredPaymentMethodsAsync(storedPaymentMethodRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetTokensForStoredPaymentDetails(shopperReference, merchantAccount); + + FormatGetTokensForStoredPaymentDetails(ref shopperReference, ref merchantAccount); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/storedPaymentMethods"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + if (shopperReference.IsSet) + parseQueryStringLocalVar["shopperReference"] = ClientUtils.ParameterToString(shopperReference.Value); + + if (merchantAccount.IsSet) + parseQueryStringLocalVar["merchantAccount"] = ClientUtils.ParameterToString(merchantAccount.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetTokensForStoredPaymentDetailsApiResponse apiResponseLocalVar = new GetTokensForStoredPaymentDetailsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/storedPaymentMethods", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetTokensForStoredPaymentDetailsDefaultImplementation(apiResponseLocalVar, shopperReference, merchantAccount); + + Events.ExecuteOnGetTokensForStoredPaymentDetails(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetTokensForStoredPaymentDetailsDefaultImplementation(e, "/storedPaymentMethods", uriBuilderLocalVar.Path, shopperReference, merchantAccount); + Events.ExecuteOnErrorGetTokensForStoredPaymentDetails(e); + throw; + } } - public async Task StoredPaymentMethodsAsync(StoredPaymentMethodRequest storedPaymentMethodRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// The + /// + public partial class GetTokensForStoredPaymentDetailsApiResponse : Adyen.Client.ApiResponse, IGetTokensForStoredPaymentDetailsApiResponse { - var endpoint = _baseUrl + "/storedPaymentMethods"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(storedPaymentMethodRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetTokensForStoredPaymentDetailsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.ListStoredPaymentMethodsResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.ListStoredPaymentMethodsResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatStoredPaymentMethods(ref string idempotencyKey, StoredPaymentMethodRequest storedPaymentMethodRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateStoredPaymentMethods(string idempotencyKey, StoredPaymentMethodRequest storedPaymentMethodRequest) + { + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (storedPaymentMethodRequest.IsSet && storedPaymentMethodRequest.Value == null) + throw new ArgumentNullException(nameof(storedPaymentMethodRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterStoredPaymentMethodsDefaultImplementation(IStoredPaymentMethodsApiResponse apiResponseLocalVar, string idempotencyKey, StoredPaymentMethodRequest storedPaymentMethodRequest) + { + bool suppressDefaultLog = false; + AfterStoredPaymentMethods(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, storedPaymentMethodRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterStoredPaymentMethods(ref bool suppressDefaultLog, IStoredPaymentMethodsApiResponse apiResponseLocalVar, string idempotencyKey, StoredPaymentMethodRequest storedPaymentMethodRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorStoredPaymentMethodsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, StoredPaymentMethodRequest storedPaymentMethodRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorStoredPaymentMethods(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, storedPaymentMethodRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorStoredPaymentMethods(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, StoredPaymentMethodRequest storedPaymentMethodRequest); + + /// + /// Create a token to store payment details Creates a token to store the shopper's payment details. This token can be used for the shopper's future payments. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task StoredPaymentMethodsOrDefaultAsync(Option idempotencyKey = default, Option storedPaymentMethodRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await StoredPaymentMethodsAsync(idempotencyKey, storedPaymentMethodRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Create a token to store payment details Creates a token to store the shopper's payment details. This token can be used for the shopper's future payments. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task StoredPaymentMethodsAsync(Option idempotencyKey = default, Option storedPaymentMethodRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateStoredPaymentMethods(idempotencyKey, storedPaymentMethodRequest); + + FormatStoredPaymentMethods(ref idempotencyKey, storedPaymentMethodRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/storedPaymentMethods"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (storedPaymentMethodRequest.IsSet) + httpRequestMessageLocalVar.Content = (storedPaymentMethodRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(storedPaymentMethodRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + StoredPaymentMethodsApiResponse apiResponseLocalVar = new StoredPaymentMethodsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/storedPaymentMethods", requestedAtLocalVar, _jsonSerializerOptions); + + AfterStoredPaymentMethodsDefaultImplementation(apiResponseLocalVar, idempotencyKey, storedPaymentMethodRequest); + + Events.ExecuteOnStoredPaymentMethods(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorStoredPaymentMethodsDefaultImplementation(e, "/storedPaymentMethods", uriBuilderLocalVar.Path, idempotencyKey, storedPaymentMethodRequest); + Events.ExecuteOnErrorStoredPaymentMethods(e); + throw; + } + } + + /// + /// The + /// + public partial class StoredPaymentMethodsApiResponse : Adyen.Client.ApiResponse, IStoredPaymentMethodsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public StoredPaymentMethodsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 201 Created + /// + /// + public bool IsCreated => 201 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 201 Created + /// + /// + public Adyen.Model.Checkout.StoredPaymentMethodResource Created() + { + // This logic may be modified with the AsModel.mustache template + return IsCreated + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 201 Created and the deserialized response is not null + /// + /// + /// + public bool TryCreated(out Adyen.Model.Checkout.StoredPaymentMethodResource result) + { + result = null; + + try + { + result = Created(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } } -} \ No newline at end of file +} diff --git a/Adyen/Service/Checkout/UtilityService.cs b/Adyen/Service/Checkout/UtilityService.cs index 4b2dfec3c..3aa463f78 100644 --- a/Adyen/Service/Checkout/UtilityService.cs +++ b/Adyen/Service/Checkout/UtilityService.cs @@ -1,132 +1,1483 @@ +// /* -* Adyen Checkout API -* -* -* The version of the OpenAPI document: 71 -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections.Generic; -using System.Net.Http; -using System.Threading; +using System.Net; using System.Threading.Tasks; -using Adyen.Model; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Adyen.Client; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// UtilityService Interface + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. /// - public interface IUtilityService + public interface IUtilityService : IApi { + /// + /// The class containing the events + /// + UtilityServiceEvents Events { get; } + /// /// Get an Apple Pay session /// - /// - - /// - Additional request options. - /// . - Model.Checkout.ApplePaySessionResponse GetApplePaySession(ApplePaySessionRequest applePaySessionRequest = default, RequestOptions requestOptions = default); - + /// + /// You need to use this endpoint if you have an API-only integration with Apple Pay which uses Adyen's Apple Pay certificate. The endpoint returns the Apple Pay session data which you need to complete the [Apple Pay session validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task GetApplePaySessionAsync(Option idempotencyKey = default, Option applePaySessionRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Get an Apple Pay session /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task GetApplePaySessionAsync(ApplePaySessionRequest applePaySessionRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// You need to use this endpoint if you have an API-only integration with Apple Pay which uses Adyen's Apple Pay certificate. The endpoint returns the Apple Pay session data which you need to complete the [Apple Pay session validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task GetApplePaySessionOrDefaultAsync(Option idempotencyKey = default, Option applePaySessionRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Create originKey values for domains /// - /// - - /// - Additional request options. - /// . - [Obsolete("Deprecated since Adyen Checkout API v67.")] - Model.Checkout.UtilityResponse OriginKeys(UtilityRequest utilityRequest = default, RequestOptions requestOptions = default); - + /// + /// This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. > If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + [Obsolete] + Task OriginKeysAsync(Option idempotencyKey = default, Option utilityRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Create originKey values for domains /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - [Obsolete("Deprecated since Adyen Checkout API v67.")] - Task OriginKeysAsync(UtilityRequest utilityRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. > If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + [Obsolete] + Task OriginKeysOrDefaultAsync(Option idempotencyKey = default, Option utilityRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Updates the order for PayPal Express Checkout /// - /// - - /// - Additional request options. - /// . - Model.Checkout.PaypalUpdateOrderResponse UpdatesOrderForPaypalExpressCheckout(PaypalUpdateOrderRequest paypalUpdateOrderRequest = default, RequestOptions requestOptions = default); - + /// + /// Updates the order for PayPal Express Checkout. This can be used to update the PayPal lightbox with an updated amount and delivery methods based on the delivery address. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdatesOrderForPaypalExpressCheckoutAsync(Option idempotencyKey = default, Option paypalUpdateOrderRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// /// Updates the order for PayPal Express Checkout /// - /// - - /// - Additional request options. - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. - /// Task of . - Task UpdatesOrderForPaypalExpressCheckoutAsync(PaypalUpdateOrderRequest paypalUpdateOrderRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); - + /// + /// Updates the order for PayPal Express Checkout. This can be used to update the PayPal lightbox with an updated amount and delivery methods based on the delivery address. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdatesOrderForPaypalExpressCheckoutOrDefaultAsync(Option idempotencyKey = default, Option paypalUpdateOrderRequest = default, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IGetApplePaySessionApiResponse : Adyen.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IOriginKeysApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// The + /// + public interface IUpdatesOrderForPaypalExpressCheckoutApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + bool IsUnauthorized { get; } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + bool IsForbidden { get; } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + bool IsUnprocessableContent { get; } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + bool IsInternalServerError { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class UtilityServiceEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnGetApplePaySession; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetApplePaySession; + + internal void ExecuteOnGetApplePaySession(UtilityService.GetApplePaySessionApiResponse apiResponse) + { + OnGetApplePaySession?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetApplePaySession(Exception exception) + { + OnErrorGetApplePaySession?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnOriginKeys; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorOriginKeys; + + internal void ExecuteOnOriginKeys(UtilityService.OriginKeysApiResponse apiResponse) + { + OnOriginKeys?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorOriginKeys(Exception exception) + { + OnErrorOriginKeys?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdatesOrderForPaypalExpressCheckout; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdatesOrderForPaypalExpressCheckout; + + internal void ExecuteOnUpdatesOrderForPaypalExpressCheckout(UtilityService.UpdatesOrderForPaypalExpressCheckoutApiResponse apiResponse) + { + OnUpdatesOrderForPaypalExpressCheckout?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdatesOrderForPaypalExpressCheckout(Exception exception) + { + OnErrorUpdatesOrderForPaypalExpressCheckout?.Invoke(this, new ExceptionEventArgs(exception)); + } } - + /// - /// Represents a collection of functions to interact with the UtilityService API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - public class UtilityService : AbstractService, IUtilityService + public sealed partial class UtilityService : IUtilityService { - private readonly string _baseUrl; - - public UtilityService(AdyenClient adyenClient) : base(adyenClient) + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public UtilityServiceEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public UtilityService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, UtilityServiceEvents utilityServiceEvents, + TokenProvider apiKeyProvider, + TokenProvider basicTokenProvider) { - _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = utilityServiceEvents; + ApiKeyProvider = apiKeyProvider; + BasicTokenProvider = basicTokenProvider; } - - public Model.Checkout.ApplePaySessionResponse GetApplePaySession(ApplePaySessionRequest applePaySessionRequest = default, RequestOptions requestOptions = default) + + partial void FormatGetApplePaySession(ref string idempotencyKey, ApplePaySessionRequest applePaySessionRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateGetApplePaySession(string idempotencyKey, ApplePaySessionRequest applePaySessionRequest) { - return GetApplePaySessionAsync(applePaySessionRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (applePaySessionRequest.IsSet && applePaySessionRequest.Value == null) + throw new ArgumentNullException(nameof(applePaySessionRequest)); } - public async Task GetApplePaySessionAsync(ApplePaySessionRequest applePaySessionRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterGetApplePaySessionDefaultImplementation(IGetApplePaySessionApiResponse apiResponseLocalVar, string idempotencyKey, ApplePaySessionRequest applePaySessionRequest) { - var endpoint = _baseUrl + "/applePay/sessions"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(applePaySessionRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + bool suppressDefaultLog = false; + AfterGetApplePaySession(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, applePaySessionRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); } - - [Obsolete("Deprecated since Adyen Checkout API v67.")] - public Model.Checkout.UtilityResponse OriginKeys(UtilityRequest utilityRequest = default, RequestOptions requestOptions = default) + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterGetApplePaySession(ref bool suppressDefaultLog, IGetApplePaySessionApiResponse apiResponseLocalVar, string idempotencyKey, ApplePaySessionRequest applePaySessionRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorGetApplePaySessionDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, ApplePaySessionRequest applePaySessionRequest) { - return OriginKeysAsync(utilityRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + bool suppressDefaultLogLocalVar = false; + OnErrorGetApplePaySession(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, applePaySessionRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); } - [Obsolete("Deprecated since Adyen Checkout API v67.")] - public async Task OriginKeysAsync(UtilityRequest utilityRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorGetApplePaySession(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, ApplePaySessionRequest applePaySessionRequest); + + /// + /// Get an Apple Pay session You need to use this endpoint if you have an API-only integration with Apple Pay which uses Adyen's Apple Pay certificate. The endpoint returns the Apple Pay session data which you need to complete the [Apple Pay session validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task GetApplePaySessionOrDefaultAsync(Option idempotencyKey = default, Option applePaySessionRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetApplePaySessionAsync(idempotencyKey, applePaySessionRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Get an Apple Pay session You need to use this endpoint if you have an API-only integration with Apple Pay which uses Adyen's Apple Pay certificate. The endpoint returns the Apple Pay session data which you need to complete the [Apple Pay session validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task GetApplePaySessionAsync(Option idempotencyKey = default, Option applePaySessionRequest = default, System.Threading.CancellationToken cancellationToken = default) { - var endpoint = _baseUrl + "/originKeys"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(utilityRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetApplePaySession(idempotencyKey, applePaySessionRequest); + + FormatGetApplePaySession(ref idempotencyKey, applePaySessionRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/applePay/sessions"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (applePaySessionRequest.IsSet) + httpRequestMessageLocalVar.Content = (applePaySessionRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(applePaySessionRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetApplePaySessionApiResponse apiResponseLocalVar = new GetApplePaySessionApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/applePay/sessions", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetApplePaySessionDefaultImplementation(apiResponseLocalVar, idempotencyKey, applePaySessionRequest); + + Events.ExecuteOnGetApplePaySession(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetApplePaySessionDefaultImplementation(e, "/applePay/sessions", uriBuilderLocalVar.Path, idempotencyKey, applePaySessionRequest); + Events.ExecuteOnErrorGetApplePaySession(e); + throw; + } } - - public Model.Checkout.PaypalUpdateOrderResponse UpdatesOrderForPaypalExpressCheckout(PaypalUpdateOrderRequest paypalUpdateOrderRequest = default, RequestOptions requestOptions = default) + + /// + /// The + /// + public partial class GetApplePaySessionApiResponse : Adyen.Client.ApiResponse, IGetApplePaySessionApiResponse { - return UpdatesOrderForPaypalExpressCheckoutAsync(paypalUpdateOrderRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetApplePaySessionApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.ApplePaySessionResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.ApplePaySessionResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } - public async Task UpdatesOrderForPaypalExpressCheckoutAsync(PaypalUpdateOrderRequest paypalUpdateOrderRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) + partial void FormatOriginKeys(ref string idempotencyKey, UtilityRequest utilityRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateOriginKeys(string idempotencyKey, UtilityRequest utilityRequest) { - var endpoint = _baseUrl + "/paypal/updateOrder"; - var resource = new ServiceResource(this, endpoint); - return await resource.RequestAsync(paypalUpdateOrderRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (utilityRequest.IsSet && utilityRequest.Value == null) + throw new ArgumentNullException(nameof(utilityRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterOriginKeysDefaultImplementation(IOriginKeysApiResponse apiResponseLocalVar, string idempotencyKey, UtilityRequest utilityRequest) + { + bool suppressDefaultLog = false; + AfterOriginKeys(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, utilityRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterOriginKeys(ref bool suppressDefaultLog, IOriginKeysApiResponse apiResponseLocalVar, string idempotencyKey, UtilityRequest utilityRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorOriginKeysDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, UtilityRequest utilityRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorOriginKeys(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, utilityRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorOriginKeys(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, UtilityRequest utilityRequest); + + /// + /// Create originKey values for domains This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. > If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task OriginKeysOrDefaultAsync(Option idempotencyKey = default, Option utilityRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await OriginKeysAsync(idempotencyKey, utilityRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Create originKey values for domains This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. > If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task OriginKeysAsync(Option idempotencyKey = default, Option utilityRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateOriginKeys(idempotencyKey, utilityRequest); + + FormatOriginKeys(ref idempotencyKey, utilityRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/originKeys"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (utilityRequest.IsSet) + httpRequestMessageLocalVar.Content = (utilityRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(utilityRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + OriginKeysApiResponse apiResponseLocalVar = new OriginKeysApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/originKeys", requestedAtLocalVar, _jsonSerializerOptions); + + AfterOriginKeysDefaultImplementation(apiResponseLocalVar, idempotencyKey, utilityRequest); + + Events.ExecuteOnOriginKeys(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorOriginKeysDefaultImplementation(e, "/originKeys", uriBuilderLocalVar.Path, idempotencyKey, utilityRequest); + Events.ExecuteOnErrorOriginKeys(e); + throw; + } + } + + /// + /// The + /// + public partial class OriginKeysApiResponse : Adyen.Client.ApiResponse, IOriginKeysApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public OriginKeysApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.UtilityResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.UtilityResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdatesOrderForPaypalExpressCheckout(ref string idempotencyKey, PaypalUpdateOrderRequest paypalUpdateOrderRequest); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUpdatesOrderForPaypalExpressCheckout(string idempotencyKey, PaypalUpdateOrderRequest paypalUpdateOrderRequest) + { + if (idempotencyKey.IsSet && idempotencyKey.Value == null) + throw new ArgumentNullException(nameof(idempotencyKey)); + + if (paypalUpdateOrderRequest.IsSet && paypalUpdateOrderRequest.Value == null) + throw new ArgumentNullException(nameof(paypalUpdateOrderRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterUpdatesOrderForPaypalExpressCheckoutDefaultImplementation(IUpdatesOrderForPaypalExpressCheckoutApiResponse apiResponseLocalVar, string idempotencyKey, PaypalUpdateOrderRequest paypalUpdateOrderRequest) + { + bool suppressDefaultLog = false; + AfterUpdatesOrderForPaypalExpressCheckout(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, paypalUpdateOrderRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterUpdatesOrderForPaypalExpressCheckout(ref bool suppressDefaultLog, IUpdatesOrderForPaypalExpressCheckoutApiResponse apiResponseLocalVar, string idempotencyKey, PaypalUpdateOrderRequest paypalUpdateOrderRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorUpdatesOrderForPaypalExpressCheckoutDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaypalUpdateOrderRequest paypalUpdateOrderRequest) + { + bool suppressDefaultLogLocalVar = false; + OnErrorUpdatesOrderForPaypalExpressCheckout(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, paypalUpdateOrderRequest); + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdatesOrderForPaypalExpressCheckout(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaypalUpdateOrderRequest paypalUpdateOrderRequest); + + /// + /// Updates the order for PayPal Express Checkout Updates the order for PayPal Express Checkout. This can be used to update the PayPal lightbox with an updated amount and delivery methods based on the delivery address. + /// + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatesOrderForPaypalExpressCheckoutOrDefaultAsync(Option idempotencyKey = default, Option paypalUpdateOrderRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdatesOrderForPaypalExpressCheckoutAsync(idempotencyKey, paypalUpdateOrderRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Updates the order for PayPal Express Checkout Updates the order for PayPal Express Checkout. This can be used to update the PayPal lightbox with an updated amount and delivery methods based on the delivery address. + /// + /// Thrown when fails to make API call + /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatesOrderForPaypalExpressCheckoutAsync(Option idempotencyKey = default, Option paypalUpdateOrderRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdatesOrderForPaypalExpressCheckout(idempotencyKey, paypalUpdateOrderRequest); + + FormatUpdatesOrderForPaypalExpressCheckout(ref idempotencyKey, paypalUpdateOrderRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/paypal/updateOrder"; + + if (idempotencyKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); + + if (paypalUpdateOrderRequest.IsSet) + httpRequestMessageLocalVar.Content = (paypalUpdateOrderRequest.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paypalUpdateOrderRequest.Value, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdatesOrderForPaypalExpressCheckoutApiResponse apiResponseLocalVar = new UpdatesOrderForPaypalExpressCheckoutApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/paypal/updateOrder", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdatesOrderForPaypalExpressCheckoutDefaultImplementation(apiResponseLocalVar, idempotencyKey, paypalUpdateOrderRequest); + + Events.ExecuteOnUpdatesOrderForPaypalExpressCheckout(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdatesOrderForPaypalExpressCheckoutDefaultImplementation(e, "/paypal/updateOrder", uriBuilderLocalVar.Path, idempotencyKey, paypalUpdateOrderRequest); + Events.ExecuteOnErrorUpdatesOrderForPaypalExpressCheckout(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdatesOrderForPaypalExpressCheckoutApiResponse : Adyen.Client.ApiResponse, IUpdatesOrderForPaypalExpressCheckoutApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdatesOrderForPaypalExpressCheckoutApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Adyen.Model.Checkout.PaypalUpdateOrderResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Adyen.Model.Checkout.PaypalUpdateOrderResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 400 BadRequest + /// + /// + public Adyen.Model.Checkout.ServiceError BadRequest() + { + // This logic may be modified with the AsModel.mustache template + return IsBadRequest + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 400 BadRequest and the deserialized response is not null + /// + /// + /// + public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = BadRequest(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); + } + + return result != null; + } + + /// + /// Returns true if the response is 401 Unauthorized + /// + /// + public bool IsUnauthorized => 401 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 401 Unauthorized + /// + /// + public Adyen.Model.Checkout.ServiceError Unauthorized() + { + // This logic may be modified with the AsModel.mustache template + return IsUnauthorized + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 401 Unauthorized and the deserialized response is not null + /// + /// + /// + public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Unauthorized(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); + } + + return result != null; + } + + /// + /// Returns true if the response is 403 Forbidden + /// + /// + public bool IsForbidden => 403 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 403 Forbidden + /// + /// + public Adyen.Model.Checkout.ServiceError Forbidden() + { + // This logic may be modified with the AsModel.mustache template + return IsForbidden + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 403 Forbidden and the deserialized response is not null + /// + /// + /// + public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = Forbidden(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); + } + + return result != null; + } + + /// + /// Returns true if the response is 422 UnprocessableContent + /// + /// + public bool IsUnprocessableContent => 422 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 422 UnprocessableContent + /// + /// + public Adyen.Model.Checkout.ServiceError UnprocessableContent() + { + // This logic may be modified with the AsModel.mustache template + return IsUnprocessableContent + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null + /// + /// + /// + public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = UnprocessableContent(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); + } + + return result != null; + } + + /// + /// Returns true if the response is 500 InternalServerError + /// + /// + public bool IsInternalServerError => 500 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 500 InternalServerError + /// + /// + public Adyen.Model.Checkout.ServiceError InternalServerError() + { + // This logic may be modified with the AsModel.mustache template + return IsInternalServerError + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 500 InternalServerError and the deserialized response is not null + /// + /// + /// + public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) + { + result = null; + + try + { + result = InternalServerError(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } } -} \ No newline at end of file +} diff --git a/templates-v7/csharp/ApiClient.v790.mustache b/templates-v7/csharp/ApiClient.v790.mustache deleted file mode 100644 index a63d1c2be..000000000 --- a/templates-v7/csharp/ApiClient.v790.mustache +++ /dev/null @@ -1,838 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Text; -using System.Threading; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -{{^net60OrLater}} -using System.Web; -{{/net60OrLater}} -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using RestSharp; -using RestSharp.Serializers; -using RestSharpMethod = RestSharp.Method; -using FileIO = System.IO.File; -{{#supportsRetry}} -using Polly; -{{/supportsRetry}} -{{#hasOAuthMethods}} -using {{packageName}}.Client.Auth; -{{/hasOAuthMethods}} -using {{packageName}}.{{modelPackage}}; - -namespace {{packageName}}.Client -{ - /// - /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. - /// - internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer - { - private readonly IReadableConfiguration _configuration; - private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - public CustomJsonCodec(IReadableConfiguration configuration) - { - _configuration = configuration; - } - - public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) - { - _serializerSettings = serializerSettings; - _configuration = configuration; - } - - /// - /// Serialize the object into a JSON string. - /// - /// Object to be serialized. - /// A JSON string. - public string Serialize(object obj) - { - if (obj != null && obj is AbstractOpenAPISchema) - { - // the object to be serialized is an oneOf/anyOf schema - return ((AbstractOpenAPISchema)obj).ToJson(); - } - else - { - return JsonConvert.SerializeObject(obj, _serializerSettings); - } - } - - public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); - - public T Deserialize(RestResponse response) - { - var result = (T)Deserialize(response, typeof(T)); - return result; - } - - /// - /// Deserialize the JSON string into a proper object. - /// - /// The HTTP response. - /// Object type. - /// Object representation of the JSON string. - internal object Deserialize(RestResponse response, Type type) - { - if (type == typeof(byte[])) // return byte array - { - return response.RawBytes; - } - - // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) - if (type == typeof(Stream)) - { - var bytes = response.RawBytes; - if (response.Headers != null) - { - var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? global::System.IO.Path.GetTempPath() - : _configuration.TempFolderPath; - var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); - foreach (var header in response.Headers) - { - var match = regex.Match(header.ToString()); - if (match.Success) - { - string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - FileIO.WriteAllBytes(fileName, bytes); - return new FileStream(fileName, FileMode.Open); - } - } - } - var stream = new MemoryStream(bytes); - return stream; - } - - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object - { - return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); - } - - if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type - { - return Convert.ChangeType(response.Content, type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); - } - catch (Exception e) - { - throw new ApiException(500, e.Message); - } - } - - public ISerializer Serializer => this; - public IDeserializer Deserializer => this; - - public string[] AcceptedContentTypes => ContentType.JsonAccept; - - public SupportsContentType SupportsContentType => contentType => - contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || - contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - - public ContentType ContentType { get; set; } = ContentType.Json; - - public DataFormat DataFormat => DataFormat.Json; - } - {{! NOTE: Any changes related to RestSharp should be done in this class. All other client classes are for extensibility by consumers.}} - /// - /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), - /// encapsulating general REST accessor use cases. - /// - {{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} - { - private readonly string _baseUrl; - - /// - /// Specifies the settings on a object. - /// These settings can be adjusted to accommodate custom serialization rules. - /// - public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Allows for extending request processing for generated code. - /// - /// The RestSharp request object - partial void InterceptRequest(RestRequest request); - - /// - /// Allows for extending response processing for generated code. - /// - /// The RestSharp request object - /// The RestSharp response object - partial void InterceptResponse(RestRequest request, RestResponse response); - - /// - /// Initializes a new instance of the , defaulting to the global configurations' base url. - /// - public ApiClient() - { - _baseUrl = GlobalConfiguration.Instance.BasePath; - } - - /// - /// Initializes a new instance of the - /// - /// The target service's base path in URL format. - /// - public ApiClient(string basePath) - { - if (string.IsNullOrEmpty(basePath)) - throw new ArgumentException("basePath cannot be empty"); - - _baseUrl = basePath; - } - - /// - /// Constructs the RestSharp version of an http method - /// - /// Swagger Client Custom HttpMethod - /// RestSharp's HttpMethod instance. - /// - private RestSharpMethod Method(HttpMethod method) - { - RestSharpMethod other; - switch (method) - { - case HttpMethod.Get: - other = RestSharpMethod.Get; - break; - case HttpMethod.Post: - other = RestSharpMethod.Post; - break; - case HttpMethod.Put: - other = RestSharpMethod.Put; - break; - case HttpMethod.Delete: - other = RestSharpMethod.Delete; - break; - case HttpMethod.Head: - other = RestSharpMethod.Head; - break; - case HttpMethod.Options: - other = RestSharpMethod.Options; - break; - case HttpMethod.Patch: - other = RestSharpMethod.Patch; - break; - default: - throw new ArgumentOutOfRangeException("method", method, null); - } - - return other; - } - - /// - /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. - /// Here, it is simply mapped into the RestSharp request. - /// - /// The http verb. - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. - /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. - /// [private] A new RestRequest instance. - /// - private RestRequest NewRequest( - HttpMethod method, - string path, - RequestOptions options, - IReadableConfiguration configuration) - { - if (path == null) throw new ArgumentNullException("path"); - if (options == null) throw new ArgumentNullException("options"); - if (configuration == null) throw new ArgumentNullException("configuration"); - - RestRequest request = new RestRequest(path, Method(method)); - - if (options.PathParameters != null) - { - foreach (var pathParam in options.PathParameters) - { - request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); - } - } - - if (options.QueryParameters != null) - { - foreach (var queryParam in options.QueryParameters) - { - foreach (var value in queryParam.Value) - { - request.AddQueryParameter(queryParam.Key, value); - } - } - } - - if (configuration.DefaultHeaders != null) - { - foreach (var headerParam in configuration.DefaultHeaders) - { - request.AddHeader(headerParam.Key, headerParam.Value); - } - } - - if (options.HeaderParameters != null) - { - foreach (var headerParam in options.HeaderParameters) - { - foreach (var value in headerParam.Value) - { - request.AddHeader(headerParam.Key, value); - } - } - } - - if (options.FormParameters != null) - { - foreach (var formParam in options.FormParameters) - { - request.AddParameter(formParam.Key, formParam.Value); - } - } - - if (options.Data != null) - { - if (options.Data is Stream stream) - { - var contentType = "application/octet-stream"; - if (options.HeaderParameters != null) - { - var contentTypes = options.HeaderParameters["Content-Type"]; - contentType = contentTypes[0]; - } - - var bytes = ClientUtils.ReadAsBytes(stream); - request.AddParameter(contentType, bytes, ParameterType.RequestBody); - } - else - { - if (options.HeaderParameters != null) - { - var contentTypes = options.HeaderParameters["Content-Type"]; - if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) - { - request.RequestFormat = DataFormat.Json; - } - else - { - // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. - } - } - else - { - // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. - request.RequestFormat = DataFormat.Json; - } - - request.AddJsonBody(options.Data); - } - } - - if (options.FileParameters != null) - { - foreach (var fileParam in options.FileParameters) - { - foreach (var file in fileParam.Value) - { - var bytes = ClientUtils.ReadAsBytes(file); - var fileStream = file as FileStream; - if (fileStream != null) - request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); - else - request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); - } - } - } - - return request; - } - - /// - /// Transforms a RestResponse instance into a new ApiResponse instance. - /// At this point, we have a concrete http response from the service. - /// Here, it is simply mapped into the [public] ApiResponse object. - /// - /// The RestSharp response object - /// A new ApiResponse instance. - private ApiResponse ToApiResponse(RestResponse response) - { - T result = response.Data; - string rawContent = response.Content; - - var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) - { - ErrorText = response.ErrorMessage, - Cookies = new List() - }; - - if (response.Headers != null) - { - foreach (var responseHeader in response.Headers) - { - transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - if (response.ContentHeaders != null) - { - foreach (var responseHeader in response.ContentHeaders) - { - transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - if (response.Cookies != null) - { - foreach (var responseCookies in response.Cookies.Cast()) - { - transformed.Cookies.Add( - new Cookie( - responseCookies.Name, - responseCookies.Value, - responseCookies.Path, - responseCookies.Domain) - ); - } - } - - return transformed; - } - - /// - /// Executes the HTTP request for the current service. - /// Based on functions received it can be async or sync. - /// - /// Local function that executes http request and returns http response. - /// Local function to specify options for the service. - /// The RestSharp request object - /// The RestSharp options object - /// A per-request configuration object. - /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. - /// A new ApiResponse instance. - private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) - { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var clientOptions = new RestClientOptions(baseUrl) - { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback - }; - setOptions(clientOptions); - - {{#hasOAuthMethods}} - if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(configuration.OAuthClientId) && - !string.IsNullOrEmpty(configuration.OAuthClientSecret) && - configuration.OAuthFlow != null) - { - clientOptions.Authenticator = new OAuthAuthenticator( - configuration.OAuthTokenUrl, - configuration.OAuthClientId, - configuration.OAuthClientSecret, - configuration.OAuthScope, - configuration.OAuthFlow, - SerializerSettings, - configuration); - } - - {{/hasOAuthMethods}} - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) - { - InterceptRequest(request); - - RestResponse response = await getResponse(client); - - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - try - { - response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - catch (Exception ex) - { - throw ex.InnerException != null ? ex.InnerException : ex; - } - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } - else if (typeof(T).Name == "String") // for string response - { - response.Data = (T)(object)response.Content; - } - - InterceptResponse(request, response); - - var result = ToApiResponse(response); - if (response.ErrorMessage != null) - { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) - { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); - } - } - return result; - } - } - - private async Task> DeserializeRestResponseFromPolicyAsync(RestClient client, RestRequest request, PolicyResult policyResult, CancellationToken cancellationToken = default) - { - if (policyResult.Outcome == OutcomeType.Successful) - { - return await client.Deserialize(policyResult.Result, cancellationToken); - } - else - { - return new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - } - - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) - { - Action setOptions = (clientOptions) => - { - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - clientOptions.CookieContainer = cookies; - }; - - Func>> getResponse = (client) => - { - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - return DeserializeRestResponseFromPolicyAsync(client, request, policyResult); - } - else - { - return Task.FromResult(client.Execute(request)); - } - }; - - return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); - } - - {{#supportsAsync}} - private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) - { - Action setOptions = (clientOptions) => - { - //no extra options - }; - - Func>> getResponse = async (client) => - { - {{#supportsRetry}} - if (RetryConfiguration.AsyncRetryPolicy != null) - { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken); - } - else - { - {{/supportsRetry}} - return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); - {{#supportsRetry}} - } - {{/supportsRetry}} - }; - - return ExecClientAsync(getResponse, setOptions, request, options, configuration); - } - - #region IAsynchronousClient - /// - /// Make a HTTP GET request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP POST request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP PUT request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP DELETE request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP HEAD request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP OPTION request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP PATCH request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); - } - #endregion IAsynchronousClient - {{/supportsAsync}} - - #region ISynchronousClient - /// - /// Make a HTTP GET request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config); - } - - /// - /// Make a HTTP POST request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config); - } - - /// - /// Make a HTTP PUT request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config); - } - - /// - /// Make a HTTP DELETE request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config); - } - - /// - /// Make a HTTP HEAD request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config); - } - - /// - /// Make a HTTP OPTION request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config); - } - - /// - /// Make a HTTP PATCH request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config); - } - #endregion ISynchronousClient - } -} diff --git a/templates-v7/csharp/Configuration.v790.mustache b/templates-v7/csharp/Configuration.v790.mustache deleted file mode 100644 index 2753aafb3..000000000 --- a/templates-v7/csharp/Configuration.v790.mustache +++ /dev/null @@ -1,737 +0,0 @@ -{{>partial_header}} - -using System; -{{^net35}} -using System.Collections.Concurrent; -{{/net35}} -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Net.Http; -using System.Net.Security; -{{#useRestSharp}} -{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; -{{/hasOAuthMethods}} -{{/useRestSharp}} - -namespace {{packageName}}.Client -{ - /// - /// Represents a set of configuration settings - /// - {{>visibility}} class Configuration : IReadableConfiguration - { - #region Constants - - /// - /// Version of the package. - /// - /// Version of the package. - public const string Version = "{{packageVersion}}"; - - /// - /// Identifier for ISO 8601 DateTime Format - /// - /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. - // ReSharper disable once InconsistentNaming - public const string ISO8601_DATETIME_FORMAT = "o"; - - #endregion Constants - - #region Static Members - - /// - /// Default creation of exceptions for a given method name and response object - /// - public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => - { - var status = (int)response.StatusCode; - if (status >= 400) - { - return new ApiException(status, - string.Format("Error calling {0}: {1}", methodName, response.RawContent), - response.RawContent, response.Headers); - } - {{^netStandard}} - if (status == 0) - { - return new ApiException(status, - string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); - } - {{/netStandard}} - return null; - }; - - #endregion Static Members - - #region Private Members - - /// - /// Defines the base path of the target API server. - /// Example: http://localhost:3000/v1/ - /// - private string _basePath; - - private bool _useDefaultCredentials = false; - - /// - /// Gets or sets the API key based on the authentication name. - /// This is the key and value comprising the "secret" for accessing an API. - /// - /// The API key. - private IDictionary _apiKey; - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// The prefix of the API key. - private IDictionary _apiKeyPrefix; - - private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; - private string _tempFolderPath = Path.GetTempPath(); - {{#servers.0}} - - /// - /// Gets or sets the servers defined in the OpenAPI spec. - /// - /// The servers - private IList> _servers; - {{/servers.0}} - - /// - /// Gets or sets the operation servers defined in the OpenAPI spec. - /// - /// The operation servers - private IReadOnlyDictionary>> _operationServers; - - {{#hasHttpSignatureMethods}} - - /// - /// HttpSigning configuration - /// - private HttpSigningConfiguration _HttpSigningConfiguration = null; - {{/hasHttpSignatureMethods}} - #endregion Private Members - - #region Constructors - - /// - /// Initializes a new instance of the class - /// - [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] - public Configuration() - { - Proxy = null; - UserAgent = WebUtility.UrlEncode("{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"); - BasePath = "{{{basePath}}}"; - DefaultHeaders = new {{^net35}}Concurrent{{/net35}}Dictionary(); - ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); - ApiKeyPrefix = new {{^net35}}Concurrent{{/net35}}Dictionary(); - {{#servers}} - {{#-first}} - Servers = new List>() - { - {{/-first}} - { - new Dictionary { - {"url", "{{{url}}}"}, - {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, - {{#variables}} - {{#-first}} - { - "variables", new Dictionary { - {{/-first}} - { - "{{{name}}}", new Dictionary { - {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, - {"default_value", {{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}"{{{defaultValue}}}"}, - {{#enumValues}} - {{#-first}} - { - "enum_values", new List() { - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - } - } - {{/-last}} - {{/enumValues}} - } - }{{^-last}},{{/-last}} - {{#-last}} - } - } - {{/-last}} - {{/variables}} - } - }{{^-last}},{{/-last}} - {{#-last}} - }; - {{/-last}} - {{/servers}} - OperationServers = new Dictionary>>() - { - {{#apiInfo}} - {{#apis}} - {{#operations}} - {{#operation}} - {{#servers.0}} - { - "{{{classname}}}.{{{nickname}}}", new List> - { - {{#servers}} - { - new Dictionary - { - {"url", "{{{url}}}"}, - {"description", "{{{description}}}{{^description}}No description provided{{/description}}"} - } - }, - {{/servers}} - } - }, - {{/servers.0}} - {{/operation}} - {{/operations}} - {{/apis}} - {{/apiInfo}} - }; - - // Setting Timeout has side effects (forces ApiClient creation). - Timeout = 100000; - } - - /// - /// Initializes a new instance of the class - /// - [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] - public Configuration( - IDictionary defaultHeaders, - IDictionary apiKey, - IDictionary apiKeyPrefix, - string basePath = "{{{basePath}}}") : this() - { - if (string.{{^net35}}IsNullOrWhiteSpace{{/net35}}{{#net35}}IsNullOrEmpty{{/net35}}(basePath)) - throw new ArgumentException("The provided basePath is invalid.", "basePath"); - if (defaultHeaders == null) - throw new ArgumentNullException("defaultHeaders"); - if (apiKey == null) - throw new ArgumentNullException("apiKey"); - if (apiKeyPrefix == null) - throw new ArgumentNullException("apiKeyPrefix"); - - BasePath = basePath; - - foreach (var keyValuePair in defaultHeaders) - { - DefaultHeaders.Add(keyValuePair); - } - - foreach (var keyValuePair in apiKey) - { - ApiKey.Add(keyValuePair); - } - - foreach (var keyValuePair in apiKeyPrefix) - { - ApiKeyPrefix.Add(keyValuePair); - } - } - - #endregion Constructors - - #region Properties - - /// - /// Gets or sets the base path for API access. - /// - public virtual string BasePath - { - get { return _basePath; } - set { _basePath = value; } - } - - /// - /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. - /// - public virtual bool UseDefaultCredentials - { - get { return _useDefaultCredentials; } - set { _useDefaultCredentials = value; } - } - - /// - /// Gets or sets the default header. - /// - [Obsolete("Use DefaultHeaders instead.")] - public virtual IDictionary DefaultHeader - { - get - { - return DefaultHeaders; - } - set - { - DefaultHeaders = value; - } - } - - /// - /// Gets or sets the default headers. - /// - public virtual IDictionary DefaultHeaders { get; set; } - - /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. - /// - public virtual int Timeout { get; set; } - - /// - /// Gets or sets the proxy - /// - /// Proxy. - public virtual WebProxy Proxy { get; set; } - - /// - /// Gets or sets the HTTP user agent. - /// - /// Http user agent. - public virtual string UserAgent { get; set; } - - /// - /// Gets or sets the username (HTTP basic authentication). - /// - /// The username. - public virtual string Username { get; set; } - - /// - /// Gets or sets the password (HTTP basic authentication). - /// - /// The password. - public virtual string Password { get; set; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - public string GetApiKeyWithPrefix(string apiKeyIdentifier) - { - string apiKeyValue; - ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); - string apiKeyPrefix; - if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) - { - return apiKeyPrefix + " " + apiKeyValue; - } - - return apiKeyValue; - } - - /// - /// Gets or sets certificate collection to be sent with requests. - /// - /// X509 Certificate collection. - public X509CertificateCollection ClientCertificates { get; set; } - - /// - /// Gets or sets the access token for OAuth2 authentication. - /// - /// This helper property simplifies code generation. - /// - /// The access token. - public virtual string AccessToken { get; set; } - - {{#useRestSharp}} - {{#hasOAuthMethods}} - /// - /// Gets or sets the token URL for OAuth2 authentication. - /// - /// The OAuth Token URL. - public virtual string OAuthTokenUrl { get; set; } - - /// - /// Gets or sets the client ID for OAuth2 authentication. - /// - /// The OAuth Client ID. - public virtual string OAuthClientId { get; set; } - - /// - /// Gets or sets the client secret for OAuth2 authentication. - /// - /// The OAuth Client Secret. - public virtual string OAuthClientSecret { get; set; } - - /// - /// Gets or sets the client scope for OAuth2 authentication. - /// - /// The OAuth Client Scope. - public virtual string{{nrt?}} OAuthScope { get; set; } - - /// - /// Gets or sets the flow for OAuth2 authentication. - /// - /// The OAuth Flow. - public virtual OAuthFlow? OAuthFlow { get; set; } - - {{/hasOAuthMethods}} - {{/useRestSharp}} - /// - /// Gets or sets the temporary folder path to store the files downloaded from the server. - /// - /// Folder path. - public virtual string TempFolderPath - { - get { return _tempFolderPath; } - - set - { - if (string.IsNullOrEmpty(value)) - { - _tempFolderPath = Path.GetTempPath(); - return; - } - - // create the directory if it does not exist - if (!Directory.Exists(value)) - { - Directory.CreateDirectory(value); - } - - // check if the path contains directory separator at the end - if (value[value.Length - 1] == Path.DirectorySeparatorChar) - { - _tempFolderPath = value; - } - else - { - _tempFolderPath = value + Path.DirectorySeparatorChar; - } - } - } - - /// - /// Gets or sets the date time format used when serializing in the ApiClient - /// By default, it's set to ISO 8601 - "o", for others see: - /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx - /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx - /// No validation is done to ensure that the string you're providing is valid - /// - /// The DateTimeFormat string - public virtual string DateTimeFormat - { - get { return _dateTimeFormat; } - set - { - if (string.IsNullOrEmpty(value)) - { - // Never allow a blank or null string, go back to the default - _dateTimeFormat = ISO8601_DATETIME_FORMAT; - return; - } - - // Caution, no validation when you choose date time format other than ISO 8601 - // Take a look at the above links - _dateTimeFormat = value; - } - } - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// Whatever you set here will be prepended to the value defined in AddApiKey. - /// - /// An example invocation here might be: - /// - /// ApiKeyPrefix["Authorization"] = "Bearer"; - /// - /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. - /// - /// - /// OAuth2 workflows should set tokens via AccessToken. - /// - /// - /// The prefix of the API key. - public virtual IDictionary ApiKeyPrefix - { - get { return _apiKeyPrefix; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); - } - _apiKeyPrefix = value; - } - } - - /// - /// Gets or sets the API key based on the authentication name. - /// - /// The API key. - public virtual IDictionary ApiKey - { - get { return _apiKey; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKey collection may not be null."); - } - _apiKey = value; - } - } - {{#servers.0}} - - /// - /// Gets or sets the servers. - /// - /// The servers. - public virtual IList> Servers - { - get { return _servers; } - set - { - if (value == null) - { - throw new InvalidOperationException("Servers may not be null."); - } - _servers = value; - } - } - - /// - /// Gets or sets the operation servers. - /// - /// The operation servers. - public virtual IReadOnlyDictionary>> OperationServers - { - get { return _operationServers; } - set - { - if (value == null) - { - throw new InvalidOperationException("Operation servers may not be null."); - } - _operationServers = value; - } - } - - /// - /// Returns URL based on server settings without providing values - /// for the variables - /// - /// Array index of the server settings. - /// The server URL. - public string GetServerUrl(int index) - { - return GetServerUrl(Servers, index, null); - } - - /// - /// Returns URL based on server settings. - /// - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The server URL. - public string GetServerUrl(int index, Dictionary inputVariables) - { - return GetServerUrl(Servers, index, inputVariables); - } - - /// - /// Returns URL based on operation server settings. - /// - /// Operation associated with the request path. - /// Array index of the server settings. - /// The operation server URL. - public string GetOperationServerUrl(string operation, int index) - { - return GetOperationServerUrl(operation, index, null); - } - - /// - /// Returns URL based on operation server settings. - /// - /// Operation associated with the request path. - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The operation server URL. - public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) - { - if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) - { - return GetServerUrl(operationServer, index, inputVariables); - } - - return null; - } - - /// - /// Returns URL based on server settings. - /// - /// Dictionary of server settings. - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The server URL. - private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) - { - if (index < 0 || index >= servers.Count) - { - throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); - } - - if (inputVariables == null) - { - inputVariables = new Dictionary(); - } - - IReadOnlyDictionary server = servers[index]; - string url = (string)server["url"]; - - if (server.ContainsKey("variables")) - { - // go through each variable and assign a value - foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) - { - - IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); - - if (inputVariables.ContainsKey(variable.Key)) - { - if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) - { - url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); - } - else - { - throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); - } - } - else - { - // use default value - url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); - } - } - } - - return url; - } - {{/servers.0}} - {{#hasHttpSignatureMethods}} - - /// - /// Gets and Sets the HttpSigningConfiguration - /// - public HttpSigningConfiguration HttpSigningConfiguration - { - get { return _HttpSigningConfiguration; } - set { _HttpSigningConfiguration = value; } - } - {{/hasHttpSignatureMethods}} - - /// - /// Gets and Sets the RemoteCertificateValidationCallback - /// - public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } - - #endregion Properties - - #region Methods - - /// - /// Returns a string with essential information for debugging. - /// - public static string ToDebugReport() - { - string report = "C# SDK ({{{packageName}}}) Debug Report:\n"; - report += " OS: " + System.Environment.OSVersion + "\n"; - report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: {{{version}}}\n"; - report += " SDK Package Version: {{{packageVersion}}}\n"; - - return report; - } - - /// - /// Add Api Key Header. - /// - /// Api Key name. - /// Api Key value. - /// - public void AddApiKey(string key, string value) - { - ApiKey[key] = value; - } - - /// - /// Sets the API key prefix. - /// - /// Api Key name. - /// Api Key value. - public void AddApiKeyPrefix(string key, string value) - { - ApiKeyPrefix[key] = value; - } - - #endregion Methods - - #region Static Members - /// - /// Merge configurations. - /// - /// First configuration. - /// Second configuration. - /// Merged configuration. - public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) - { - if (second == null) return first ?? GlobalConfiguration.Instance; - - Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - - foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; - foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; - foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; - - var config = new Configuration - { - ApiKey = apiKey, - ApiKeyPrefix = apiKeyPrefix, - DefaultHeaders = defaultHeaders, - BasePath = second.BasePath ?? first.BasePath, - Timeout = second.Timeout, - Proxy = second.Proxy ?? first.Proxy, - UserAgent = second.UserAgent ?? first.UserAgent, - Username = second.Username ?? first.Username, - Password = second.Password ?? first.Password, - AccessToken = second.AccessToken ?? first.AccessToken, - {{#useRestSharp}} - {{#hasOAuthMethods}} - OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, - OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, - OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, - OAuthScope = second.OAuthScope ?? first.OAuthScope, - OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, - {{/hasOAuthMethods}} - {{/useRestSharp}} - {{#hasHttpSignatureMethods}} - HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, - {{/hasHttpSignatureMethods}} - TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, - DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, - ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, - UseDefaultCredentials = second.UseDefaultCredentials, - RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, - }; - return config; - } - #endregion Static Members - } -} diff --git a/templates-v7/csharp/IReadableConfiguration.v790.mustache b/templates-v7/csharp/IReadableConfiguration.v790.mustache deleted file mode 100644 index 5981728b4..000000000 --- a/templates-v7/csharp/IReadableConfiguration.v790.mustache +++ /dev/null @@ -1,178 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Security; -using System.Security.Cryptography.X509Certificates; -{{#useRestSharp}} -{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; -{{/hasOAuthMethods}} -{{/useRestSharp}} - -namespace {{packageName}}.Client -{ - /// - /// Represents a readable-only configuration contract. - /// - public interface IReadableConfiguration - { - /// - /// Gets the access token. - /// - /// Access token. - string AccessToken { get; } - - {{#useRestSharp}} - {{#hasOAuthMethods}} - /// - /// Gets the OAuth token URL. - /// - /// OAuth Token URL. - string OAuthTokenUrl { get; } - - /// - /// Gets the OAuth client ID. - /// - /// OAuth Client ID. - string OAuthClientId { get; } - - /// - /// Gets the OAuth client secret. - /// - /// OAuth Client Secret. - string OAuthClientSecret { get; } - - /// - /// Gets the OAuth token scope. - /// - /// OAuth Token scope. - string{{nrt?}} OAuthScope { get; } - - /// - /// Gets the OAuth flow. - /// - /// OAuth Flow. - OAuthFlow? OAuthFlow { get; } - - {{/hasOAuthMethods}} - {{/useRestSharp}} - /// - /// Gets the API key. - /// - /// API key. - IDictionary ApiKey { get; } - - /// - /// Gets the API key prefix. - /// - /// API key prefix. - IDictionary ApiKeyPrefix { get; } - - /// - /// Gets the base path. - /// - /// Base path. - string BasePath { get; } - - /// - /// Gets the date time format. - /// - /// Date time format. - string DateTimeFormat { get; } - - /// - /// Gets the default header. - /// - /// Default header. - [Obsolete("Use DefaultHeaders instead.")] - IDictionary DefaultHeader { get; } - - /// - /// Gets the default headers. - /// - /// Default headers. - IDictionary DefaultHeaders { get; } - - /// - /// Gets the temp folder path. - /// - /// Temp folder path. - string TempFolderPath { get; } - - /// - /// Gets the HTTP connection timeout (in milliseconds) - /// - /// HTTP connection timeout. - int Timeout { get; } - - /// - /// Gets the proxy. - /// - /// Proxy. - WebProxy Proxy { get; } - - /// - /// Gets the user agent. - /// - /// User agent. - string UserAgent { get; } - - /// - /// Gets the username. - /// - /// Username. - string Username { get; } - - /// - /// Gets the password. - /// - /// Password. - string Password { get; } - - /// - /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. - /// - bool UseDefaultCredentials { get; } - - /// - /// Get the servers associated with the operation. - /// - /// Operation servers. - IReadOnlyDictionary>> OperationServers { get; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - string GetApiKeyWithPrefix(string apiKeyIdentifier); - - /// - /// Gets the Operation server url at the provided index. - /// - /// Operation server name. - /// Index of the operation server settings. - /// - string GetOperationServerUrl(string operation, int index); - - /// - /// Gets certificate collection to be sent with requests. - /// - /// X509 Certificate collection. - X509CertificateCollection ClientCertificates { get; } - {{#hasHttpSignatureMethods}} - - /// - /// Gets the HttpSigning configuration - /// - HttpSigningConfiguration HttpSigningConfiguration { get; } - {{/hasHttpSignatureMethods}} - - /// - /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and - /// overriding certificate errors in the scope of a request. - /// - RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } - } -} diff --git a/templates-v7/csharp/git_push.sh.mustache b/templates-v7/csharp/git_push.sh.mustache deleted file mode 100644 index 0e3776ae6..000000000 --- a/templates-v7/csharp/git_push.sh.mustache +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="{{{gitHost}}}" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="{{{releaseNote}}}" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache b/templates-v7/csharp/libraries/generichost/ApiResponse.mustache similarity index 100% rename from templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache rename to templates-v7/csharp/libraries/generichost/ApiResponse.mustache diff --git a/templates-v7/csharp/libraries/generichost/ApiResponseEventArgs`1.mustache b/templates-v7/csharp/libraries/generichost/ApiResponseEventArgs.mustache similarity index 100% rename from templates-v7/csharp/libraries/generichost/ApiResponseEventArgs`1.mustache rename to templates-v7/csharp/libraries/generichost/ApiResponseEventArgs.mustache diff --git a/templates-v7/csharp/libraries/generichost/IApi.mustache b/templates-v7/csharp/libraries/generichost/IApi.mustache index af31cffe9..3f3f3013b 100644 --- a/templates-v7/csharp/libraries/generichost/IApi.mustache +++ b/templates-v7/csharp/libraries/generichost/IApi.mustache @@ -10,6 +10,6 @@ namespace {{packageName}}.{{apiPackage}} /// /// The HttpClient /// - HttpClient HttpClient { get; } + System.Net.Http.HttpClient HttpClient { get; } } } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ModelSignature.mustache b/templates-v7/csharp/libraries/generichost/ModelSignature.mustache index 39aa11f82..398e62b0a 100644 --- a/templates-v7/csharp/libraries/generichost/ModelSignature.mustache +++ b/templates-v7/csharp/libraries/generichost/ModelSignature.mustache @@ -1 +1 @@ -{{#model.allVars}}{{^isDiscriminator}}{{^required}}Option<{{/required}}{{{datatypeWithEnum}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}{{#defaultValue}} = {{^required}}default{{/required}}{{#required}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{.}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/required}}{{/defaultValue}}{{^defaultValue}}{{#lambda.first}}{{#isNullable}} = default {{/isNullable}}{{^required}} = default {{/required}}{{/lambda.first}}{{/defaultValue}} {{/isDiscriminator}}{{/model.allVars}} +{{#model.allVars}}{{^isDiscriminator}}{{{datatypeWithEnum}}}{{>NullConditionalProperty}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}{{#defaultValue}} = {{^required}}default{{/required}}{{#required}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{.}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/required}}{{/defaultValue}}{{^defaultValue}}{{#lambda.first}}{{#isNullable}} = default {{/isNullable}}{{^required}} = default {{/required}}{{/lambda.first}}{{/defaultValue}} {{/isDiscriminator}}{{/model.allVars}} diff --git a/templates-v7/csharp/libraries/generichost/RateLimitProvider`1.mustache b/templates-v7/csharp/libraries/generichost/RateLimitProvider.mustache similarity index 100% rename from templates-v7/csharp/libraries/generichost/RateLimitProvider`1.mustache rename to templates-v7/csharp/libraries/generichost/RateLimitProvider.mustache diff --git a/templates-v7/csharp/libraries/generichost/TokenContainer`1.mustache b/templates-v7/csharp/libraries/generichost/TokenContainer.mustache similarity index 100% rename from templates-v7/csharp/libraries/generichost/TokenContainer`1.mustache rename to templates-v7/csharp/libraries/generichost/TokenContainer.mustache diff --git a/templates-v7/csharp/libraries/generichost/TokenProvider`1.mustache b/templates-v7/csharp/libraries/generichost/TokenProvider.mustache similarity index 100% rename from templates-v7/csharp/libraries/generichost/TokenProvider`1.mustache rename to templates-v7/csharp/libraries/generichost/TokenProvider.mustache diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index b33115f0a..d2dee1b48 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -170,7 +170,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// The HttpClient /// - public HttpClient HttpClient { get; } + public System.Net.Http.HttpClient HttpClient { get; } /// /// The class containing the events @@ -219,7 +219,7 @@ namespace {{packageName}}.{{apiPackage}} /// Initializes a new instance of the class. /// /// - public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, + public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}, TokenProvider basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}, @@ -243,7 +243,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} {{#-first}} - partial void Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + partial void Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{{dataType}}}{{>NullConditionalParameter}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{/-first}} {{/allParams}} @@ -255,7 +255,7 @@ namespace {{packageName}}.{{apiPackage}} /// {{/vendorExtensions.x-not-nullable-reference-types}} /// - private void Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}) + private void Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{{dataType}}}{{>NullConditionalParameter}} {{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}) { {{#lambda.trimTrailingWithNewLine}} {{#vendorExtensions.x-not-nullable-reference-types}} @@ -285,7 +285,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - private void After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + private void After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{{dataType}}}{{>NullConditionalParameter}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) { bool suppressDefaultLog = false; After{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); @@ -300,7 +300,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{{dataType}}}{{>NullConditionalParameter}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); /// /// Logs exceptions that occur while retrieving the server response @@ -311,7 +311,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{{dataType}}}{{>NullConditionalParameter}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) { bool suppressDefaultLogLocalVar = false; OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLogLocalVar exceptionLocalVar pathFormatLocalVar pathLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); @@ -328,7 +328,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLogLocalVar Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLogLocalVar Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{{dataType}}}{{>NullConditionalParameter}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); /// /// {{summary}} {{notes}} diff --git a/templates-v7/csharp/libraries/generichost/git_push.ps1.mustache b/templates-v7/csharp/libraries/generichost/git_push.ps1.mustache deleted file mode 100644 index f263c2bc5..000000000 --- a/templates-v7/csharp/libraries/generichost/git_push.ps1.mustache +++ /dev/null @@ -1,75 +0,0 @@ -param( - [Parameter()][Alias("g")][String]$GitHost = "{{{gitHost}}}", - [Parameter()][Alias("u")][String]$GitUserId = "{{{gitUserId}}}", - [Parameter()][Alias("r")][String]$GitRepoId = "{{{gitRepoId}}}", - [Parameter()][Alias("m")][string]$Message = "{{{releaseNote}}}", - [Parameter()][Alias("h")][switch]$Help -) - -function Publish-ToGitHost{ - if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ - # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user - $Message = Read-Host -Prompt "Please provide a commit message or press enter" - $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } - } - - git init - git add . - git commit -am "${Message}" - $branchName=$(git rev-parse --abbrev-ref HEAD) - $gitRemote=$(git remote) - - if([string]::IsNullOrWhiteSpace($gitRemote)){ - git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git - } - - Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" - git pull origin $branchName --ff-only - - if ($LastExitCode -ne 0){ - if (${GitHost} -eq "github.com"){ - Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." - gh auth login --hostname github.com --web - gh repo create $GitRepoId --private - # sleep 2 seconds to ensure git finishes creation of the repo - Start-Sleep -Seconds 2 - } - else{ - throw "There was an issue pulling the origin branch. The remote repository may not exist yet." - } - } - - Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" - git push origin $branchName -} - -$ErrorActionPreference = "Stop" -Set-StrictMode -Version 3.0 - -if ($Help){ - Write-Output " - This script will initialize a git repository, then add and commit all files. - The local repository will then be pushed to your preferred git provider. - If the remote repository does not exist yet and you are using GitHub, - the repository will be created for you provided you have the GitHub CLI installed. - - Parameters: - -g | -GitHost -> ex: github.com - -m | -Message -> the git commit message - -r | -GitRepoId -> the name of the repository - -u | -GitUserId -> your user id - " - - return -} - -$rootPath=Resolve-Path -Path $PSScriptRoot/../.. - -Push-Location $rootPath - -try { - Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message -} -finally{ - Pop-Location -} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/git_push.sh.mustache b/templates-v7/csharp/libraries/generichost/git_push.sh.mustache deleted file mode 100644 index 3d4b710dc..000000000 --- a/templates-v7/csharp/libraries/generichost/git_push.sh.mustache +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=${1:-{{{gitUserId}}}} -git_repo_id=${2:-{{{gitRepoId}}}} -release_note=${3:-{{{releaseNote}}}} -git_host=${4:-{{{gitHost}}}} - -starting_directory=$(pwd) -script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" -cd $script_root -cd ../.. - -if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then - # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user - echo "Please provide a commit message or press enter" - read user_input - release_note=$user_input - if [ "$release_note" = "" ]; then - release_note="no message provided" - fi -fi - -git init -git add . -git commit -am "$release_note" -branch_name=$(git rev-parse --abbrev-ref HEAD) -git_remote=$(git remote) - -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" -git pull origin $branch_name --ff-only - -echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin $branch_name - -cd $starting_directory diff --git a/templates-v7/csharp/libraries/httpclient/ApiClient.mustache b/templates-v7/csharp/libraries/httpclient/ApiClient.mustache deleted file mode 100644 index d193fddd6..000000000 --- a/templates-v7/csharp/libraries/httpclient/ApiClient.mustache +++ /dev/null @@ -1,792 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Text; -using System.Threading; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -{{^netStandard}} -using System.Web; -{{/netStandard}} -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; -using System.Net.Http; -using System.Net.Http.Headers; -{{#supportsRetry}} -using Polly; -{{/supportsRetry}} - -namespace {{packageName}}.Client -{ - /// - /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. - /// - internal class CustomJsonCodec - { - private readonly IReadableConfiguration _configuration; - private static readonly string _contentType = "application/json"; - private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - public CustomJsonCodec(IReadableConfiguration configuration) - { - _configuration = configuration; - } - - public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) - { - _serializerSettings = serializerSettings; - _configuration = configuration; - } - - /// - /// Serialize the object into a JSON string. - /// - /// Object to be serialized. - /// A JSON string. - public string Serialize(object obj) - { - if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) - { - // the object to be serialized is an oneOf/anyOf schema - return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); - } - else - { - return JsonConvert.SerializeObject(obj, _serializerSettings); - } - } - - public async Task Deserialize(HttpResponseMessage response) - { - var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); - return result; - } - - /// - /// Deserialize the JSON string into a proper object. - /// - /// The HTTP response. - /// Object type. - /// Object representation of the JSON string. - internal async Task Deserialize(HttpResponseMessage response, Type type) - { - IList headers = new List(); - // process response headers, e.g. Access-Control-Allow-Methods - foreach (var responseHeader in response.Headers) - { - headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); - } - - // process response content headers, e.g. Content-Type - foreach (var responseHeader in response.Content.Headers) - { - headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); - } - - // RFC 2183 & RFC 2616 - var fileNameRegex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$", RegexOptions.IgnoreCase); - if (type == typeof(byte[])) // return byte array - { - return await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); - } - else if (type == typeof(FileParameter)) - { - if (headers != null) { - foreach (var header in headers) - { - var match = fileNameRegex.Match(header.ToString()); - if (match.Success) - { - string fileName = ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - return new FileParameter(fileName, await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); - } - } - } - return new FileParameter(await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); - } - - // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) - if (type == typeof(Stream)) - { - var bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); - if (headers != null) - { - var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() - : _configuration.TempFolderPath; - - foreach (var header in headers) - { - var match = fileNameRegex.Match(header.ToString()); - if (match.Success) - { - string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); - return new FileStream(fileName, FileMode.Open); - } - } - } - var stream = new MemoryStream(bytes); - return stream; - } - - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object - { - return DateTime.Parse(await response.Content.ReadAsStringAsync().ConfigureAwait(false), null, System.Globalization.DateTimeStyles.RoundtripKind); - } - - if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type - { - return Convert.ChangeType(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type, _serializerSettings); - } - catch (Exception e) - { - throw new ApiException(500, e.Message); - } - } - - public string RootElement { get; set; } - public string Namespace { get; set; } - public string DateFormat { get; set; } - - public string ContentType - { - get { return _contentType; } - set { throw new InvalidOperationException("Not allowed to set content type."); } - } - } - /// - /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), - /// encapsulating general REST accessor use cases. - /// - /// - /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. - /// - {{>visibility}} partial class ApiClient : IDisposable, ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} - { - private readonly string _baseUrl; - - private readonly HttpClientHandler _httpClientHandler; - private readonly HttpClient _httpClient; - private readonly bool _disposeClient; - - /// - /// Specifies the settings on a object. - /// These settings can be adjusted to accommodate custom serialization rules. - /// - public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Initializes a new instance of the , defaulting to the global configurations' base url. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - public ApiClient() : - this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) - { - } - - /// - /// Initializes a new instance of the . - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// The target service's base path in URL format. - /// - public ApiClient(string basePath) - { - if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); - - _httpClientHandler = new HttpClientHandler(); - _httpClient = new HttpClient(_httpClientHandler, true); - _disposeClient = true; - _baseUrl = basePath; - } - - /// - /// Initializes a new instance of the , defaulting to the global configurations' base url. - /// - /// An instance of HttpClient. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public ApiClient(HttpClient client, HttpClientHandler handler = null) : - this(client, {{packageName}}.Client.GlobalConfiguration.Instance.BasePath, handler) - { - } - - /// - /// Initializes a new instance of the . - /// - /// An instance of HttpClient. - /// The target service's base path in URL format. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public ApiClient(HttpClient client, string basePath, HttpClientHandler handler = null) - { - if (client == null) throw new ArgumentNullException("client cannot be null"); - if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); - - _httpClientHandler = handler; - _httpClient = client; - _baseUrl = basePath; - } - - /// - /// Disposes resources if they were created by us - /// - public void Dispose() - { - if(_disposeClient) { - _httpClient.Dispose(); - } - } - - /// Prepares multipart/form-data content - {{! TODO: Add handling of improper usage }} - HttpContent PrepareMultipartFormDataContent(RequestOptions options) - { - string boundary = "---------" + Guid.NewGuid().ToString().ToUpperInvariant(); - var multipartContent = new MultipartFormDataContent(boundary); - foreach (var formParameter in options.FormParameters) - { - multipartContent.Add(new StringContent(formParameter.Value), formParameter.Key); - } - - if (options.FileParameters != null && options.FileParameters.Count > 0) - { - foreach (var fileParam in options.FileParameters) - { - foreach (var file in fileParam.Value) - { - var content = new StreamContent(file.Content); - content.Headers.ContentType = new MediaTypeHeaderValue(file.ContentType); - multipartContent.Add(content, fileParam.Key, file.Name); - } - } - } - return multipartContent; - } - - /// - /// Provides all logic for constructing a new HttpRequestMessage. - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the a HttpRequestMessage. - /// - /// The http verb. - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// [private] A new HttpRequestMessage instance. - /// - private HttpRequestMessage NewRequest( - HttpMethod method, - string path, - RequestOptions options, - IReadableConfiguration configuration) - { - if (path == null) throw new ArgumentNullException("path"); - if (options == null) throw new ArgumentNullException("options"); - if (configuration == null) throw new ArgumentNullException("configuration"); - - WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); - - builder.AddPathParameters(options.PathParameters); - - builder.AddQueryParameters(options.QueryParameters); - - HttpRequestMessage request = new HttpRequestMessage(method, builder.GetFullUri()); - - if (configuration.UserAgent != null) - { - request.Headers.TryAddWithoutValidation("User-Agent", configuration.UserAgent); - } - - if (configuration.DefaultHeaders != null) - { - foreach (var headerParam in configuration.DefaultHeaders) - { - request.Headers.Add(headerParam.Key, headerParam.Value); - } - } - - if (options.HeaderParameters != null) - { - foreach (var headerParam in options.HeaderParameters) - { - foreach (var value in headerParam.Value) - { - // Todo make content headers actually content headers - request.Headers.TryAddWithoutValidation(headerParam.Key, value); - } - } - } - - List> contentList = new List>(); - - string contentType = null; - if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) - { - var contentTypes = options.HeaderParameters["Content-Type"]; - contentType = contentTypes.FirstOrDefault(); - } - - {{!// TODO Add error handling in case of improper usage}} - if (contentType == "multipart/form-data") - { - request.Content = PrepareMultipartFormDataContent(options); - } - else if (contentType == "application/x-www-form-urlencoded") - { - request.Content = new FormUrlEncodedContent(options.FormParameters); - } - else - { - if (options.Data != null) - { - if (options.Data is FileParameter fp) - { - contentType = contentType ?? "application/octet-stream"; - - var streamContent = new StreamContent(fp.Content); - streamContent.Headers.ContentType = new MediaTypeHeaderValue(contentType); - request.Content = streamContent; - } - else - { - var serializer = new CustomJsonCodec(SerializerSettings, configuration); - request.Content = new StringContent(serializer.Serialize(options.Data), new UTF8Encoding(), - "application/json"); - } - } - } - - - - // TODO provide an alternative that allows cookies per request instead of per API client - if (options.Cookies != null && options.Cookies.Count > 0) - { - request.Properties["CookieContainer"] = options.Cookies; - } - - return request; - } - - {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptRequest(HttpRequestMessage req){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} - {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} - - private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) - { - T result = (T) responseData; - string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - - var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) - { - ErrorText = response.ReasonPhrase, - Cookies = new List() - }; - - // process response headers, e.g. Access-Control-Allow-Methods - if (response.Headers != null) - { - foreach (var responseHeader in response.Headers) - { - transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - // process response content headers, e.g. Content-Type - if (response.Content.Headers != null) - { - foreach (var responseHeader in response.Content.Headers) - { - transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - if (_httpClientHandler != null && response != null) - { - try { - foreach (Cookie cookie in _httpClientHandler.CookieContainer.GetCookies(uri)) - { - transformed.Cookies.Add(cookie); - } - } - catch (PlatformNotSupportedException) {} - } - - return transformed; - } - - private ApiResponse Exec(HttpRequestMessage req, IReadableConfiguration configuration) - { - return ExecAsync(req, configuration).GetAwaiter().GetResult(); - } - - private async Task> ExecAsync(HttpRequestMessage req, - IReadableConfiguration configuration, - System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - CancellationTokenSource timeoutTokenSource = null; - CancellationTokenSource finalTokenSource = null; - var deserializer = new CustomJsonCodec(SerializerSettings, configuration); - var finalToken = cancellationToken; - - try - { - if (configuration.Timeout > TimeSpan.Zero) - { - timeoutTokenSource = new CancellationTokenSource(configuration.Timeout); - finalTokenSource = CancellationTokenSource.CreateLinkedTokenSource(finalToken, timeoutTokenSource.Token); - finalToken = finalTokenSource.Token; - } - - if (configuration.Proxy != null) - { - if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `Proxy` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); - _httpClientHandler.Proxy = configuration.Proxy; - } - - if (configuration.ClientCertificates != null) - { - if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); - _httpClientHandler.ClientCertificates.AddRange(configuration.ClientCertificates); - } - - var cookieContainer = req.Properties.ContainsKey("CookieContainer") ? req.Properties["CookieContainer"] as List : null; - - if (cookieContainer != null) - { - if(_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); - foreach (var cookie in cookieContainer) - { - _httpClientHandler.CookieContainer.Add(cookie); - } - } - - InterceptRequest(req); - - HttpResponseMessage response; - {{#supportsRetry}} - if (RetryConfiguration.AsyncRetryPolicy != null) - { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy - .ExecuteAndCaptureAsync(() => _httpClient.SendAsync(req, finalToken)) - .ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? - policyResult.Result : new HttpResponseMessage() - { - ReasonPhrase = policyResult.FinalException.ToString(), - RequestMessage = req - }; - } - else - { - {{/supportsRetry}} - response = await _httpClient.SendAsync(req, finalToken).ConfigureAwait(false); - {{#supportsRetry}} - } - {{/supportsRetry}} - - if (!response.IsSuccessStatusCode) - { - return await ToApiResponse(response, default(T), req.RequestUri).ConfigureAwait(false); - } - - object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); - - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); - } - - InterceptResponse(req, response); - - return await ToApiResponse(response, responseData, req.RequestUri).ConfigureAwait(false); - } - catch (OperationCanceledException original) - { - if (timeoutTokenSource != null && timeoutTokenSource.IsCancellationRequested) - { - throw new TaskCanceledException($"[{req.Method}] {req.RequestUri} was timeout.", - new TimeoutException(original.Message, original)); - } - throw; - } - finally - { - if (timeoutTokenSource != null) - { - timeoutTokenSource.Dispose(); - } - - if (finalTokenSource != null) - { - finalTokenSource.Dispose(); - } - } - } - - {{#supportsAsync}} - #region IAsynchronousClient - /// - /// Make a HTTP GET request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP POST request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP PUT request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP DELETE request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP HEAD request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP OPTION request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP PATCH request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); - } - #endregion IAsynchronousClient - {{/supportsAsync}} - - #region ISynchronousClient - /// - /// Make a HTTP GET request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Get, path, options, config), config); - } - - /// - /// Make a HTTP POST request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Post, path, options, config), config); - } - - /// - /// Make a HTTP PUT request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Put, path, options, config), config); - } - - /// - /// Make a HTTP DELETE request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); - } - - /// - /// Make a HTTP HEAD request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Head, path, options, config), config); - } - - /// - /// Make a HTTP OPTION request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Options, path, options, config), config); - } - - /// - /// Make a HTTP PATCH request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(new HttpMethod("PATCH"), path, options, config), config); - } - #endregion ISynchronousClient - } -} diff --git a/templates-v7/csharp/libraries/httpclient/FileParameter.mustache b/templates-v7/csharp/libraries/httpclient/FileParameter.mustache deleted file mode 100644 index 87e5fcdc9..000000000 --- a/templates-v7/csharp/libraries/httpclient/FileParameter.mustache +++ /dev/null @@ -1,72 +0,0 @@ -{{>partial_header}} - -using System.IO; - -namespace {{packageName}}.Client -{ - - /// - /// Represents a File passed to the API as a Parameter, allows using different backends for files - /// - public class FileParameter - { - /// - /// The filename - /// - public string Name { get; set; } = "no_name_provided"; - - /// - /// The content type of the file - /// - public string ContentType { get; set; } = "application/octet-stream"; - - /// - /// The content of the file - /// - public Stream Content { get; set; } - - /// - /// Construct a FileParameter just from the contents, will extract the filename from a filestream - /// - /// The file content - public FileParameter(Stream content) - { - if (content is FileStream fs) - { - Name = fs.Name; - } - Content = content; - } - - /// - /// Construct a FileParameter from name and content - /// - /// The filename - /// The file content - public FileParameter(string filename, Stream content) - { - Name = filename; - Content = content; - } - - /// - /// Construct a FileParameter from name and content - /// - /// The filename - /// The content type of the file - /// The file content - public FileParameter(string filename, string contentType, Stream content) - { - Name = filename; - ContentType = contentType; - Content = content; - } - - /// - /// Implicit conversion of stream to file parameter. Useful for backwards compatibility. - /// - /// Stream to convert - /// FileParameter - public static implicit operator FileParameter(Stream s) => new FileParameter(s); - } -} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache b/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache deleted file mode 100644 index 25e76d03d..000000000 --- a/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache +++ /dev/null @@ -1,66 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.IO; -using System.Net; - -namespace {{packageName}}.Client -{ - /// - /// A container for generalized request inputs. This type allows consumers to extend the request functionality - /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). - /// - public class RequestOptions - { - /// - /// Parameters to be bound to path parts of the Request's URL - /// - public Dictionary PathParameters { get; set; } - - /// - /// Query parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap QueryParameters { get; set; } - - /// - /// Header parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap HeaderParameters { get; set; } - - /// - /// Form parameters to be sent along with the request. - /// - public Dictionary FormParameters { get; set; } - - /// - /// File parameters to be sent along with the request. - /// - public Multimap FileParameters { get; set; } - - /// - /// Cookies to be sent along with the request. - /// - public List Cookies { get; set; } - - /// - /// Any data associated with a request body. - /// - public Object Data { get; set; } - - /// - /// Constructs a new instance of - /// - public RequestOptions() - { - PathParameters = new Dictionary(); - QueryParameters = new Multimap(); - HeaderParameters = new Multimap(); - FormParameters = new Dictionary(); - FileParameters = new Multimap(); - Cookies = new List(); - } - } -} diff --git a/templates-v7/csharp/libraries/httpclient/api.mustache b/templates-v7/csharp/libraries/httpclient/api.mustache deleted file mode 100644 index 4a11de0e0..000000000 --- a/templates-v7/csharp/libraries/httpclient/api.mustache +++ /dev/null @@ -1,766 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Net.Mime; -using {{packageName}}.Client; -{{#hasImport}}using {{packageName}}.{{modelPackage}}; -{{/hasImport}} - -namespace {{packageName}}.{{apiPackage}} -{ - {{#operations}} - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor - { - #region Synchronous Operations - {{#operation}} - /// - /// {{summary}} - /// - {{#notes}} - /// - /// {{.}} - /// - {{/notes}} - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); - - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); - {{/operation}} - #endregion Synchronous Operations - } - - {{#supportsAsync}} - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor - { - #region Asynchronous Operations - {{#operation}} - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of {{returnType}}{{^returnType}}void{{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); - - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); - {{/operation}} - #endregion Asynchronous Operations - } - {{/supportsAsync}} - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} - { - - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} partial class {{classname}} : IDisposable, {{interfacePrefix}}{{classname}} - { - private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// - public {{classname}}() : this((string)null) - { - } - - /// - /// Initializes a new instance of the class. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// The target service's base path in URL format. - /// - /// - public {{classname}}(string basePath) - { - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - new {{packageName}}.Client.Configuration { BasePath = basePath } - ); - this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - this.Client = this.ApiClient; - {{#supportsAsync}} - this.AsynchronousClient = this.ApiClient; - {{/supportsAsync}} - this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class using Configuration object. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// An instance of Configuration. - /// - /// - public {{classname}}({{packageName}}.Client.Configuration configuration) - { - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - configuration - ); - this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - this.Client = this.ApiClient; - {{#supportsAsync}} - this.AsynchronousClient = this.ApiClient; - {{/supportsAsync}} - ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class. - /// - /// An instance of HttpClient. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public {{classname}}(HttpClient client, HttpClientHandler handler = null) : this(client, (string)null, handler) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// An instance of HttpClient. - /// The target service's base path in URL format. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public {{classname}}(HttpClient client, string basePath, HttpClientHandler handler = null) - { - if (client == null) throw new ArgumentNullException("client"); - - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - new {{packageName}}.Client.Configuration { BasePath = basePath } - ); - this.ApiClient = new {{packageName}}.Client.ApiClient(client, this.Configuration.BasePath, handler); - this.Client = this.ApiClient; - {{#supportsAsync}} - this.AsynchronousClient = this.ApiClient; - {{/supportsAsync}} - this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class using Configuration object. - /// - /// An instance of HttpClient. - /// An instance of Configuration. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public {{classname}}(HttpClient client, {{packageName}}.Client.Configuration configuration, HttpClientHandler handler = null) - { - if (configuration == null) throw new ArgumentNullException("configuration"); - if (client == null) throw new ArgumentNullException("client"); - - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - configuration - ); - this.ApiClient = new {{packageName}}.Client.ApiClient(client, this.Configuration.BasePath, handler); - this.Client = this.ApiClient; - {{#supportsAsync}} - this.AsynchronousClient = this.ApiClient; - {{/supportsAsync}} - ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using a Configuration object and client instance. - /// - /// The client interface for synchronous API access.{{#supportsAsync}} - /// The client interface for asynchronous API access.{{/supportsAsync}} - /// The configuration object. - /// - public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) - { - if (client == null) throw new ArgumentNullException("client"); - {{#supportsAsync}} - if (asyncClient == null) throw new ArgumentNullException("asyncClient"); - {{/supportsAsync}} - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Client = client; - {{#supportsAsync}} - this.AsynchronousClient = asyncClient; - {{/supportsAsync}} - this.Configuration = configuration; - this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Disposes resources if they were created by us - /// - public void Dispose() - { - this.ApiClient?.Dispose(); - } - - /// - /// Holds the ApiClient if created - /// - public {{packageName}}.Client.ApiClient ApiClient { get; set; } = null; - - {{#supportsAsync}} - /// - /// The client for accessing this underlying API asynchronously. - /// - public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } - {{/supportsAsync}} - - /// - /// The client for accessing this underlying API synchronously. - /// - public {{packageName}}.Client.ISynchronousClient Client { get; set; } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public string GetBasePath() - { - return this.Configuration.BasePath; - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public {{packageName}}.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - {{#operation}} - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) - { - {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} - } - - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) - { - {{#allParams}} - {{#required}} - {{^vendorExtensions.x-csharp-value-type}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) - throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); - - {{/vendorExtensions.x-csharp-value-type}} - {{/required}} - {{/allParams}} - {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - {{#consumes}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/consumes}} - }; - - // to determine the Accept header - string[] _accepts = new string[] { - {{#produces}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/produces}} - }; - - var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - {{#pathParams}} - {{#required}} - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - } - {{/required}} - {{/pathParams}} - {{#queryParams}} - {{#required}} - {{#isDeepObject}} - {{#items.vars}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isDeepObject}} - {{#items.vars}} - if ({{paramName}}.{{name}} != null) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); - } - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - } - {{/required}} - {{/queryParams}} - {{#headerParams}} - {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - } - {{/required}} - {{/headerParams}} - {{#formParams}} - {{#required}} - {{#isFile}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter - {{/isFile}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isFile}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter - {{/isFile}} - } - {{/required}} - {{/formParams}} - {{#bodyParam}} - localVarRequestOptions.Data = {{paramName}}; - {{/bodyParam}} - - {{#authMethods}} - // authentication ({{name}}) required - {{#isApiKey}} - {{#isKeyInCookie}} - // cookie parameter support - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInCookie}} - {{#isKeyInHeader}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); - } - {{/isKeyInHeader}} - {{#isKeyInQuery}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInQuery}} - {{/isApiKey}} - {{#isBasicBasic}} - // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); - } - {{/isBasicBasic}} - {{#isBasicBearer}} - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isBasicBearer}} - {{#isOAuth}} - // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isOAuth}} - {{#isHttpSignature}} - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } - {{/isHttpSignature}} - {{/authMethods}} - - // make the HTTP request - var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - {{#supportsAsync}} - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of {{returnType}}{{^returnType}}void{{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); - return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false);{{/returnType}} - } - - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - {{#allParams}} - {{#required}} - {{^vendorExtensions.x-csharp-value-type}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) - throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); - - {{/vendorExtensions.x-csharp-value-type}} - {{/required}} - {{/allParams}} - - {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - {{#consumes}} - "{{{mediaType}}}"{{^-last}}, {{/-last}} - {{/consumes}} - }; - - // to determine the Accept header - string[] _accepts = new string[] { - {{#produces}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/produces}} - }; - - - var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - {{#constantParams}} - {{#isPathParam}} - // Set client side default value of Path Param "{{baseName}}". - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant path parameter - {{/isPathParam}} - {{/constantParams}} - {{#pathParams}} - {{#required}} - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - } - {{/required}} - {{/pathParams}} - {{#constantParams}} - {{#isQueryParam}} - // Set client side default value of Query Param "{{baseName}}". - localVarRequestOptions.QueryParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant query parameter - {{/isQueryParam}} - {{/constantParams}} - {{#queryParams}} - {{#required}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - } - {{/required}} - {{/queryParams}} - {{#constantParams}} - {{#isHeaderParam}} - // Set client side default value of Header Param "{{baseName}}". - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter - {{/isHeaderParam}} - {{/constantParams}} - {{#headerParams}} - {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - } - {{/required}} - {{/headerParams}} - {{#formParams}} - {{#required}} - {{#isFile}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter - {{/isFile}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isFile}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter - {{/isFile}} - } - {{/required}} - {{/formParams}} - {{#bodyParam}} - localVarRequestOptions.Data = {{paramName}}; - {{/bodyParam}} - - {{#authMethods}} - // authentication ({{name}}) required - {{#isApiKey}} - {{#isKeyInCookie}} - // cookie parameter support - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInCookie}} - {{#isKeyInHeader}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); - } - {{/isKeyInHeader}} - {{#isKeyInQuery}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInQuery}} - {{/isApiKey}} - {{#isBasic}} - {{#isBasicBasic}} - // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); - } - {{/isBasicBasic}} - {{#isBasicBearer}} - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isBasicBearer}} - {{/isBasic}} - {{#isOAuth}} - // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isOAuth}} - {{#isHttpSignature}} - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } - {{/isHttpSignature}} - {{/authMethods}} - - // make the HTTP request - - var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - {{/supportsAsync}} - {{/operation}} - } - {{/operations}} -} diff --git a/templates-v7/csharp/libraries/httpclient/model.mustache b/templates-v7/csharp/libraries/httpclient/model.mustache deleted file mode 100644 index f84de7f64..000000000 --- a/templates-v7/csharp/libraries/httpclient/model.mustache +++ /dev/null @@ -1,51 +0,0 @@ -{{>partial_header}} - -{{#models}} -{{#model}} -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.IO; -{{#vendorExtensions.x-com-visible}} -using System.Runtime.InteropServices; -{{/vendorExtensions.x-com-visible}} -using System.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -{{#discriminator}} -using JsonSubTypes; -{{/discriminator}} -{{/model}} -{{/models}} -{{#validatable}} -using System.ComponentModel.DataAnnotations; -{{/validatable}} -using FileParameter = {{packageName}}.Client.FileParameter; -using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; -{{#useCompareNetObjects}} -using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; -{{/useCompareNetObjects}} -{{#models}} -{{#model}} -{{#oneOf}} -{{#-first}} -using System.Reflection; -{{/-first}} -{{/oneOf}} -{{#anyOf}} -{{#-first}} -using System.Reflection; -{{/-first}} -{{/anyOf}} - -namespace {{packageName}}.{{modelPackage}} -{ -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} -{{/model}} -{{/models}} -} From 6cee7ab927a607084a68634fc6ef11667f246a23 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 11 Sep 2025 12:49:03 +0200 Subject: [PATCH 004/126] Add NullCondition mustache templates --- Adyen/Adyen.csproj | 61 ------------------- .../NullConditionalParameter.mustache | 1 + .../NullConditionalProperty.mustache | 1 + 3 files changed, 2 insertions(+), 61 deletions(-) delete mode 100644 Adyen/Adyen.csproj create mode 100644 templates-v7/csharp/libraries/generichost/NullConditionalParameter.mustache create mode 100644 templates-v7/csharp/libraries/generichost/NullConditionalProperty.mustache diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj deleted file mode 100644 index 78b397dfd..000000000 --- a/Adyen/Adyen.csproj +++ /dev/null @@ -1,61 +0,0 @@ - - - - net8.0;net6.0 - 12 - enable - disable - false - Adyen - 32.0.0 - 32.0.0 - 32.0.0 - true - true - true - The Adyen API Library for .NET Core allows developers to interact with the Adyen APIs, including Hosted Payment Pages and the Terminal API. - https://github.com/Adyen/adyen-dotnet-api-library - https://github.com/Adyen/adyen-dotnet-api-library - git - 32.0.0 - MIT - Adyen - Adyen - adyen-dotnet-api-library - Adyen library - en - true - true - adyen-dotnet-api-library-key.snk - adyen-logo.png - README.md - 32.0.0 - true - bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/templates-v7/csharp/libraries/generichost/NullConditionalParameter.mustache b/templates-v7/csharp/libraries/generichost/NullConditionalParameter.mustache new file mode 100644 index 000000000..d8ad92666 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/NullConditionalParameter.mustache @@ -0,0 +1 @@ +{{#isNullable}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/NullConditionalProperty.mustache b/templates-v7/csharp/libraries/generichost/NullConditionalProperty.mustache new file mode 100644 index 000000000..7dcafa803 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/NullConditionalProperty.mustache @@ -0,0 +1 @@ +{{#lambda.first}}{{#isNullable}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} \ No newline at end of file From 88595908dd13115a9a4d0f1776ad5d7d0300e518 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 11 Sep 2025 14:36:30 +0200 Subject: [PATCH 005/126] Fix csproj --- Adyen/Adyen.csproj | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Adyen/Adyen.csproj diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj new file mode 100644 index 000000000..9bf6a6051 --- /dev/null +++ b/Adyen/Adyen.csproj @@ -0,0 +1,61 @@ + + + + net8.0;net6.0 + 12 + enable + disable + false + Adyen + 32.0.0 + 32.0.0 + 32.0.0 + true + true + true + The Adyen API Library for .NET Core allows developers to interact with the Adyen APIs, including Hosted Payment Pages and the Terminal API. + https://github.com/Adyen/adyen-dotnet-api-library + https://github.com/Adyen/adyen-dotnet-api-library + git + 32.0.0 + MIT + Adyen + Adyen + adyen-dotnet-api-library + Adyen library + en + true + true + adyen-dotnet-api-library-key.snk + adyen-logo.png + README.md + 32.0.0 + true + bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + + + + + + + + + + + + + + + + + + + + + + + + + + + From 5a98a113630af9d99c467acd54250af63a5d99a3 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 11 Sep 2025 14:40:35 +0200 Subject: [PATCH 006/126] No template/v7 --- Adyen/Adyen.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index 9bf6a6051..217a59e54 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -54,8 +54,4 @@ - - - - From 2bc4da14eb1a8ebdc3bfddfea96a8ed631420c0d Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 11 Sep 2025 14:42:55 +0200 Subject: [PATCH 007/126] add custom templates for backwards compatibility test --- Adyen/Adyen.csproj | 5 + .../csharp/AbstractOpenAPISchema.mustache | 71 ++++ templates-mod/csharp/api-single.mustache | 87 ++++ templates-mod/csharp/api.mustache | 86 ++++ templates-mod/csharp/api_invoke.mustache | 1 + .../csharp/api_parameter_ordering.mustache | 1 + .../api_parameter_ordering_required.mustache | 1 + templates-mod/csharp/api_parameters.mustache | 2 + .../csharp/api_parameters_async.mustache | 2 + templates-mod/csharp/config.yaml | 6 + .../csharp/method_documentation.mustache | 13 + templates-mod/csharp/model.mustache | 49 +++ templates-mod/csharp/modelGeneric.mustache | 384 ++++++++++++++++++ templates-mod/csharp/modelOneOf.mustache | 286 +++++++++++++ templates-mod/csharp/partial_header.mustache | 12 + 15 files changed, 1006 insertions(+) create mode 100644 templates-mod/csharp/AbstractOpenAPISchema.mustache create mode 100644 templates-mod/csharp/api-single.mustache create mode 100644 templates-mod/csharp/api.mustache create mode 100644 templates-mod/csharp/api_invoke.mustache create mode 100644 templates-mod/csharp/api_parameter_ordering.mustache create mode 100644 templates-mod/csharp/api_parameter_ordering_required.mustache create mode 100644 templates-mod/csharp/api_parameters.mustache create mode 100644 templates-mod/csharp/api_parameters_async.mustache create mode 100644 templates-mod/csharp/config.yaml create mode 100644 templates-mod/csharp/method_documentation.mustache create mode 100644 templates-mod/csharp/model.mustache create mode 100644 templates-mod/csharp/modelGeneric.mustache create mode 100644 templates-mod/csharp/modelOneOf.mustache create mode 100644 templates-mod/csharp/partial_header.mustache diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index 217a59e54..b8b25e4c0 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -54,4 +54,9 @@ + + + + + diff --git a/templates-mod/csharp/AbstractOpenAPISchema.mustache b/templates-mod/csharp/AbstractOpenAPISchema.mustache new file mode 100644 index 000000000..ab90f174c --- /dev/null +++ b/templates-mod/csharp/AbstractOpenAPISchema.mustache @@ -0,0 +1,71 @@ +{{>partial_header}} +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace {{packageName}}.{{modelPackage}} +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + {{>visibility}} abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + + // Check if the contains TypeEnum value + protected static bool ContainsValue(string type) where T : struct, IConvertible + { + // Search for type in .TypeEnum + List list = new List(); + var members = typeof(T).GetTypeInfo().DeclaredMembers; + foreach (var member in members) + { + var val = member?.GetCustomAttribute(false)?.Value; + if (!string.IsNullOrEmpty(val)) + { + list.Add(val); + } + } + + return list.Contains(type); + } + } +} diff --git a/templates-mod/csharp/api-single.mustache b/templates-mod/csharp/api-single.mustache new file mode 100644 index 000000000..da60553d0 --- /dev/null +++ b/templates-mod/csharp/api-single.mustache @@ -0,0 +1,87 @@ +{{>partial_header}} +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Adyen.Constants; +using Adyen.Model; +{{#hasImport}}using Adyen.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.Service +{ +{{#operations}} + /// + /// {{classname}} Interface + /// + public interface I{{customApi}}Service + { + {{#operation}} +{{>method_documentation}} + {{#returnType}} + /// . + {{/returnType}} + {{#isDeprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/isDeprecated}} + {{#returnType}}{{modelPackage}}.{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}({{>api_parameters}}); + + {{#supportsAsync}} +{{>method_documentation}} + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects.{{#returnType}} + /// Task of .{{/returnType}} + {{#isDeprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/isDeprecated}} + {{#returnType}}Task<{{modelPackage}}.{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_parameters_async}}); + + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} + + {{#operations}} + /// + /// Represents a collection of functions to interact with the {{customApi}}Service API endpoints + /// + {{>visibility}} class {{customApi}}Service : AbstractService, I{{customApi}}Service + { + private readonly string _baseUrl; + + public {{customApi}}Service(Client client) : base(client) + { + _baseUrl = CreateBaseUrl("{{{basePath}}}"); + } + {{#operation}} + + {{#isDeprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/isDeprecated}} + public {{#returnType}}{{modelPackage}}.{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}({{>api_parameters}}) + { + {{#returnType}}return {{/returnType}}{{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_invoke}}).ConfigureAwait(false).GetAwaiter().GetResult(); + } + + {{#supportsAsync}} + {{#isDeprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/isDeprecated}} + {{#returnType}}public async Task<{{modelPackage}}.{{{.}}}>{{/returnType}}{{^returnType}}public async Task{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_parameters_async}}) + { + {{#hasQueryParams}} + // Build the query string + var queryParams = new Dictionary(); + {{#queryParams}} + {{^required}}if ({{paramName}} != null) {{/required}}queryParams.Add("{{baseName}}", {{paramName}}{{^isString}}{{^isDateTime}}.Value.ToString(){{/isDateTime}}{{#isDateTime}}.ToString("yyyy-MM-ddTHH:mm:ssZ"){{/isDateTime}}{{/isString}}); + {{/queryParams}} + {{/hasQueryParams}} + var endpoint = _baseUrl + {{#hasPathParams}}${{/hasPathParams}}"{{{path}}}"{{#hasQueryParams}} + ToQueryString(queryParams){{/hasQueryParams}}; + var resource = new ServiceResource(this, endpoint); + {{#returnType}}return {{/returnType}}await resource.RequestAsync{{#returnType}}<{{modelPackage}}.{{returnType}}>{{/returnType}}({{#bodyParam}}{{paramName}}.ToJson(){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, requestOptions, new HttpMethod("{{httpMethod}}"), cancellationToken).ConfigureAwait(false); + } + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} +} \ No newline at end of file diff --git a/templates-mod/csharp/api.mustache b/templates-mod/csharp/api.mustache new file mode 100644 index 000000000..27ff0eb4d --- /dev/null +++ b/templates-mod/csharp/api.mustache @@ -0,0 +1,86 @@ +{{>partial_header}} +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Adyen.Model; +{{#hasImport}}using Adyen.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.{{apiPackage}} +{ +{{#operations}} + /// + /// {{classname}} Interface + /// + public interface I{{classname}} + { + {{#operation}} +{{>method_documentation}} + {{#returnType}} + /// . + {{/returnType}} + {{#isDeprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/isDeprecated}} + {{#returnType}}{{modelPackage}}.{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}({{>api_parameters}}); + + {{#supportsAsync}} +{{>method_documentation}} + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects.{{#returnType}} + /// Task of .{{/returnType}} + {{#isDeprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/isDeprecated}} + {{#returnType}}Task<{{modelPackage}}.{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_parameters_async}}); + + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} + + {{#operations}} + /// + /// Represents a collection of functions to interact with the {{classname}} API endpoints + /// + {{>visibility}} class {{classname}} : AbstractService, I{{classname}} + { + private readonly string _baseUrl; + + public {{classname}}(Client client) : base(client) + { + _baseUrl = CreateBaseUrl("{{{basePath}}}"); + } + {{#operation}} + + {{#isDeprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/isDeprecated}} + public {{#returnType}}{{modelPackage}}.{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}({{>api_parameters}}) + { + {{#returnType}}return {{/returnType}}{{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_invoke}}).ConfigureAwait(false).GetAwaiter().GetResult(); + } + + {{#supportsAsync}} + {{#isDeprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/isDeprecated}} + {{#returnType}}public async Task<{{modelPackage}}.{{{.}}}>{{/returnType}}{{^returnType}}public async Task{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_parameters_async}}) + { + {{#hasQueryParams}} + // Build the query string + var queryParams = new Dictionary(); + {{#queryParams}} + {{^required}}if ({{paramName}} != null) {{/required}}queryParams.Add("{{baseName}}", {{paramName}}{{^isString}}{{^isDateTime}}.ToString(){{/isDateTime}}{{#isDateTime}}{{^required}}.Value{{/required}}.ToString("yyyy-MM-ddTHH:mm:ssZ"){{/isDateTime}}{{/isString}}); + {{/queryParams}} + {{/hasQueryParams}} + var endpoint = _baseUrl + {{#hasPathParams}}${{/hasPathParams}}"{{{path}}}"{{#hasQueryParams}} + ToQueryString(queryParams){{/hasQueryParams}}; + var resource = new ServiceResource(this, endpoint); + {{#returnType}}return {{/returnType}}await resource.RequestAsync{{#returnType}}<{{modelPackage}}.{{returnType}}>{{/returnType}}({{#bodyParam}}{{paramName}}.ToJson(){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, requestOptions, new HttpMethod("{{httpMethod}}"), cancellationToken).ConfigureAwait(false); + } + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} +} \ No newline at end of file diff --git a/templates-mod/csharp/api_invoke.mustache b/templates-mod/csharp/api_invoke.mustache new file mode 100644 index 000000000..45815fc53 --- /dev/null +++ b/templates-mod/csharp/api_invoke.mustache @@ -0,0 +1 @@ +{{#requiredParams}}{{#isPathParam}}{{paramName}}, {{/isPathParam}}{{#isBodyParam}}{{paramName}}, {{/isBodyParam}}{{#isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/requiredParams}}{{#optionalParams}}{{#isPathParam}}{{paramName}}, {{/isPathParam}}{{#isBodyParam}}{{paramName}}, {{/isBodyParam}}{{#isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/optionalParams}}requestOptions \ No newline at end of file diff --git a/templates-mod/csharp/api_parameter_ordering.mustache b/templates-mod/csharp/api_parameter_ordering.mustache new file mode 100644 index 000000000..593846f25 --- /dev/null +++ b/templates-mod/csharp/api_parameter_ordering.mustache @@ -0,0 +1 @@ +{{#isPathParam}}{{{dataType}}} {{paramName}} = default, {{/isPathParam}}{{#isBodyParam}}{{{dataType}}} {{paramName}} = default, {{/isBodyParam}}{{#isQueryParam}}{{{dataType}}} {{paramName}} = default, {{/isQueryParam}} \ No newline at end of file diff --git a/templates-mod/csharp/api_parameter_ordering_required.mustache b/templates-mod/csharp/api_parameter_ordering_required.mustache new file mode 100644 index 000000000..0c1ecfea1 --- /dev/null +++ b/templates-mod/csharp/api_parameter_ordering_required.mustache @@ -0,0 +1 @@ +{{#isPathParam}}{{{dataType}}} {{paramName}}, {{/isPathParam}}{{#isBodyParam}}{{{dataType}}} {{paramName}}, {{/isBodyParam}}{{#isQueryParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}} \ No newline at end of file diff --git a/templates-mod/csharp/api_parameters.mustache b/templates-mod/csharp/api_parameters.mustache new file mode 100644 index 000000000..3ca742884 --- /dev/null +++ b/templates-mod/csharp/api_parameters.mustache @@ -0,0 +1,2 @@ +{{! Path and body are required, followed by optional query string and request options }} +{{#requiredParams}}{{>api_parameter_ordering_required}}{{/requiredParams}}{{#optionalParams}}{{>api_parameter_ordering}}{{/optionalParams}}RequestOptions requestOptions = default \ No newline at end of file diff --git a/templates-mod/csharp/api_parameters_async.mustache b/templates-mod/csharp/api_parameters_async.mustache new file mode 100644 index 000000000..4287dc8b4 --- /dev/null +++ b/templates-mod/csharp/api_parameters_async.mustache @@ -0,0 +1,2 @@ +{{! Path and body are required, followed by optional query string and request options }} +{{#requiredParams}}{{>api_parameter_ordering_required}}{{/requiredParams}}{{#optionalParams}}{{>api_parameter_ordering}}{{/optionalParams}}RequestOptions requestOptions = default, CancellationToken cancellationToken = default \ No newline at end of file diff --git a/templates-mod/csharp/config.yaml b/templates-mod/csharp/config.yaml new file mode 100644 index 000000000..829b2714b --- /dev/null +++ b/templates-mod/csharp/config.yaml @@ -0,0 +1,6 @@ +templateDir: ./templates/csharp +files: + api-single.mustache: + folder: api + templateType: API + destinationFilename: Single.cs \ No newline at end of file diff --git a/templates-mod/csharp/method_documentation.mustache b/templates-mod/csharp/method_documentation.mustache new file mode 100644 index 000000000..537b3924e --- /dev/null +++ b/templates-mod/csharp/method_documentation.mustache @@ -0,0 +1,13 @@ + /// + /// {{{summary}}} + /// + {{#pathParams}} + /// - {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/pathParams}} + {{#bodyParams}} + /// - {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/bodyParams}} + {{#queryParams}} + /// - {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/queryParams}} + /// - Additional request options. \ No newline at end of file diff --git a/templates-mod/csharp/model.mustache b/templates-mod/csharp/model.mustache new file mode 100644 index 000000000..51a2ad036 --- /dev/null +++ b/templates-mod/csharp/model.mustache @@ -0,0 +1,49 @@ +{{>partial_header}} +{{#models}} +{{#model}} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +{{#vendorExtensions.x-com-visible}} +using System.Runtime.InteropServices; +{{/vendorExtensions.x-com-visible}} +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +{{#discriminator}} +using JsonSubTypes; +{{/discriminator}} +{{/model}} +{{/models}} +{{#validatable}} +using System.ComponentModel.DataAnnotations; +{{/validatable}} +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +{{#useCompareNetObjects}} +using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; +{{/useCompareNetObjects}} +{{#models}} +{{#model}} +{{#oneOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/oneOf}} +{{#anyOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/anyOf}} + +namespace {{packageName}}.{{modelPackage}} +{ +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} +} diff --git a/templates-mod/csharp/modelGeneric.mustache b/templates-mod/csharp/modelGeneric.mustache new file mode 100644 index 000000000..ffeedcb6e --- /dev/null +++ b/templates-mod/csharp/modelGeneric.mustache @@ -0,0 +1,384 @@ + /// + /// {{description}}{{^description}}{{classname}}{{/description}} + /// + {{#vendorExtensions.x-cls-compliant}} + [CLSCompliant({{{vendorExtensions.x-cls-compliant}}})] + {{/vendorExtensions.x-cls-compliant}} + {{#vendorExtensions.x-com-visible}} + [ComVisible({{{vendorExtensions.x-com-visible}}})] + {{/vendorExtensions.x-com-visible}} + [DataContract(Name = "{{{name}}}")] + {{#discriminator}} + [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")] + {{#mappedModels}} + [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] + {{/mappedModels}} + {{/discriminator}} + {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + { + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} +{{>modelInnerEnum}} + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} +{{>modelInnerEnum}} + {{/complexType}} + {{/isEnum}} + {{#isEnum}} + + /// + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + /// + {{#description}} + /// {{.}} + {{/description}} + {{^conditionalSerialization}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}false{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}false{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + {{#deprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/deprecated}} + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } + {{#isReadOnly}} + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{#conditionalSerialization}} + {{#isReadOnly}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}false{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}false{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + {{#deprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/deprecated}} + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + + {{^isReadOnly}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + {{#deprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/deprecated}} + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} + { + get{ return _{{name}};} + set + { + _{{name}} = value; + _flag{{name}} = true; + } + } + private {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} _{{name}}; + private bool _flag{{name}}; + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return _flag{{name}}; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{/isEnum}} + {{/vars}} + {{#hasRequired}} + {{^hasOnlyReadOnly}} + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + {{^isAdditionalPropertiesTrue}} + protected {{classname}}() { } + {{/isAdditionalPropertiesTrue}} + {{#isAdditionalPropertiesTrue}} + protected {{classname}}() + { + this.AdditionalProperties = new Dictionary(); + } + {{/isAdditionalPropertiesTrue}} + {{/hasOnlyReadOnly}} + {{/hasRequired}} + /// + /// Initializes a new instance of the class. + /// + {{#readWriteVars}} + /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. + {{/readWriteVars}} + {{#hasOnlyReadOnly}} + [JsonConstructorAttribute] + {{/hasOnlyReadOnly}} + public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isNumeric}}?{{/isNumeric}}{{#isBoolean}}{{^isNullable}}?{{/isNullable}}{{/isBoolean}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{#defaultValue}}{{^isDateTime}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isNumeric}}?{{/isNumeric}}{{#isBoolean}}{{^isNullable}}?{{/isNullable}}{{/isBoolean}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} + { + {{#vars}} + {{^isInherited}} + {{^isReadOnly}} + {{#required}} + {{^conditionalSerialization}} + {{^vendorExtensions.x-csharp-value-type}} + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{/conditionalSerialization}} + {{#conditionalSerialization}} + {{^vendorExtensions.x-csharp-value-type}} + this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{/conditionalSerialization}} + {{/required}} + {{/isReadOnly}} + {{/isInherited}} + {{/vars}} + {{#vars}} + {{^isInherited}} + {{^isReadOnly}} + {{^required}} + {{#defaultValue}} + {{^conditionalSerialization}} + {{^vendorExtensions.x-csharp-value-type}} + // use default value if no "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" provided + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? {{{defaultValue}}}; + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{/conditionalSerialization}} + {{/defaultValue}} + {{^defaultValue}} + {{^conditionalSerialization}} + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/conditionalSerialization}} + {{#conditionalSerialization}} + this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + if (this.{{name}} != null) + { + this._flag{{name}} = true; + } + {{/conditionalSerialization}} + {{/defaultValue}} + {{/required}} + {{/isReadOnly}} + {{/isInherited}} + {{/vars}} + {{#isAdditionalPropertiesTrue}} + this.AdditionalProperties = new Dictionary(); + {{/isAdditionalPropertiesTrue}} + } + + {{#vars}} + {{^isInherited}} + {{^isEnum}} + /// + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + /// {{#description}} + /// {{.}}{{/description}} + {{^conditionalSerialization}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}false{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}false{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + {{#isDate}} + [JsonConverter(typeof(OpenAPIDateConverter))] + {{/isDate}} + {{#deprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/deprecated}} + public {{{dataType}}}{{#isNumeric}}?{{/isNumeric}}{{#isBoolean}}{{^isNullable}}?{{/isNullable}}{{/isBoolean}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + + {{/conditionalSerialization}} + {{#conditionalSerialization}} + {{#isReadOnly}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + {{#isDate}} + [JsonConverter(typeof(OpenAPIDateConverter))] + {{/isDate}} + {{#deprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/deprecated}} + public {{{dataType}}} {{name}} { get; private set; } + + {{/isReadOnly}} + {{^isReadOnly}} + {{#isDate}} + [JsonConverter(typeof(OpenAPIDateConverter))] + {{/isDate}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}false{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + {{#deprecated}} + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + {{/deprecated}} + public {{{dataType}}} {{name}} + { + get{ return _{{name}};} + set + { + _{{name}} = value; + _flag{{name}} = true; + } + } + private {{{dataType}}} _{{name}}; + private bool _flag{{name}}; + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return _flag{{name}}; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{/isEnum}} + {{/isInherited}} + {{/vars}} + {{#isAdditionalPropertiesTrue}} + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + {{/isAdditionalPropertiesTrue}} + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class {{classname}} {\n"); + {{#parent}} + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + {{/parent}} + {{#vars}} + sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); + {{/vars}} + {{#isAdditionalPropertiesTrue}} + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + {{/isAdditionalPropertiesTrue}} + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public {{#parent}}{{^isArray}}{{^isMap}}override {{/isMap}}{{/isArray}}{{/parent}}{{^parent}}virtual {{/parent}}string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + return this.Equals(input as {{classname}}); + {{/useCompareNetObjects}} + } + + /// + /// Returns true if {{classname}} instances are equal + /// + /// Instance of {{classname}} to be compared + /// Boolean + public bool Equals({{classname}} input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + if (input == null) + { + return false; + } + return {{#vars}}{{#parent}}base.Equals(input) && {{/parent}}{{^isContainer}} + ( + this.{{name}} == input.{{name}} || + {{^vendorExtensions.x-is-value-type}} + (this.{{name}} != null && + this.{{name}}.Equals(input.{{name}})) + {{/vendorExtensions.x-is-value-type}} + {{#vendorExtensions.x-is-value-type}} + this.{{name}}.Equals(input.{{name}}) + {{/vendorExtensions.x-is-value-type}} + ){{^-last}} && {{/-last}}{{/isContainer}}{{#isContainer}} + ( + this.{{name}} == input.{{name}} || + {{^vendorExtensions.x-is-value-type}}this.{{name}} != null && + input.{{name}} != null && + {{/vendorExtensions.x-is-value-type}}this.{{name}}.SequenceEqual(input.{{name}}) + ){{^-last}} && {{/-last}}{{/isContainer}}{{/vars}}{{^vars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/vars}}{{^isAdditionalPropertiesTrue}};{{/isAdditionalPropertiesTrue}} + {{#isAdditionalPropertiesTrue}} + && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); + {{/isAdditionalPropertiesTrue}} + {{/useCompareNetObjects}} + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + {{#parent}} + int hashCode = base.GetHashCode(); + {{/parent}} + {{^parent}} + int hashCode = 41; + {{/parent}} + {{#vars}} + {{^vendorExtensions.x-is-value-type}} + if (this.{{name}} != null) + { + hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); + } + {{/vendorExtensions.x-is-value-type}} + {{#vendorExtensions.x-is-value-type}} + hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); + {{/vendorExtensions.x-is-value-type}} + {{/vars}} + {{#isAdditionalPropertiesTrue}} + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + {{/isAdditionalPropertiesTrue}} + return hashCode; + } + } +{{#validatable}} +{{>validatable}} +{{/validatable}} + } diff --git a/templates-mod/csharp/modelOneOf.mustache b/templates-mod/csharp/modelOneOf.mustache new file mode 100644 index 000000000..66721caf6 --- /dev/null +++ b/templates-mod/csharp/modelOneOf.mustache @@ -0,0 +1,286 @@ +{{#model}} + /// + /// {{description}}{{^description}}{{classname}}{{/description}} + /// + {{#vendorExtensions.x-cls-compliant}} + [CLSCompliant({{{.}}})] + {{/vendorExtensions.x-cls-compliant}} + {{#vendorExtensions.x-com-visible}} + [ComVisible({{{.}}})] + {{/vendorExtensions.x-com-visible}} + [JsonConverter(typeof({{classname}}JsonConverter))] + [DataContract(Name = "{{{name}}}")] + {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + { + {{#isNullable}} + /// + /// Initializes a new instance of the class. + /// + public {{classname}}() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + {{/isNullable}} + {{#composedSchemas.oneOf}} + {{^isNull}} + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of {{dataType}}. + public {{classname}}({{{dataType}}} actualInstance) + { + this.IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; + } + + {{/isNull}} + {{/composedSchemas.oneOf}} + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + {{#oneOf}} + {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) + { + this._actualInstance = value; + } + {{/oneOf}} + else + { + throw new ArgumentException("Invalid instance found. Must be the following types:{{#oneOf}} {{{.}}}{{^-last}},{{/-last}}{{/oneOf}}"); + } + } + } + {{#composedSchemas.oneOf}} + {{^isNull}} + + /// + /// Get the actual instance of `{{dataType}}`. If the actual instance is not `{{dataType}}`, + /// the InvalidClassException will be thrown + /// + /// An instance of {{dataType}} + public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}() + { + return ({{{dataType}}})this.ActualInstance; + } + {{/isNull}} + {{/composedSchemas.oneOf}} + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class {{classname}} {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, {{classname}}.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of {{classname}} + /// + /// JSON string + /// An instance of {{classname}} + public static {{classname}} FromJson(string jsonString) + { + {{classname}} new{{classname}} = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return new{{classname}}; + } + {{#useOneOfDiscriminatorLookup}} + {{#discriminator}} + + try + { + var discriminatorObj = JObject.Parse(jsonString)["{{{propertyBaseName}}}"]; + string discriminatorValue = discriminatorObj == null ?string.Empty :discriminatorObj.ToString(); + switch (discriminatorValue) + { + {{#mappedModels}} + case "{{{mappingName}}}": + new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{modelName}}}>(jsonString, {{classname}}.AdditionalPropertiesSerializerSettings)); + return new{{classname}}; + {{/mappedModels}} + default: + System.Diagnostics.Debug.WriteLine(string.Format("Failed to lookup discriminator value `{0}` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); + break; + } + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(string.Format("Failed to parse the json data : `{0}` {1}", jsonString, ex.ToString())); + } + + {{/discriminator}} + {{/useOneOfDiscriminatorLookup}} + int match = 0; + List matchedTypes = new List(); + JToken typeToken = JObject.Parse(jsonString).GetValue("type"); + string type = typeToken?.Value(); + // Throw exception if jsonString does not contain type param + if (type == null) + { + throw new InvalidDataException("JsonString does not contain required enum type for deserialization."); + } + try + { + {{#oneOf}} + // Check if the jsonString type enum matches the {{{.}}} type enums + if (ContainsValue<{{{.}}}.TypeEnum>(type)) + { + new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.SerializerSettings)); + matchedTypes.Add("{{{.}}}"); + match++; + } + {{/oneOf}} + } + catch (Exception ex) + { + if (!(ex is JsonSerializationException)) + { + throw new InvalidDataException(string.Format("Failed to deserialize `{0}` into target: {1}", jsonString, ex.ToString())); + } + } + + if (match != 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined. MatchedTypes are: " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return new{{classname}}; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + return this.Equals(input as {{classname}}); + {{/useCompareNetObjects}} + } + + /// + /// Returns true if {{classname}} instances are equal + /// + /// Instance of {{classname}} to be compared + /// Boolean + public bool Equals({{classname}} input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + {{/useCompareNetObjects}} + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + {{#validatable}} + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + {{/validatable}} + } + + /// + /// Custom JSON converter for {{classname}} + /// + public class {{classname}}JsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } +{{/model}} diff --git a/templates-mod/csharp/partial_header.mustache b/templates-mod/csharp/partial_header.mustache new file mode 100644 index 000000000..a4c7dd929 --- /dev/null +++ b/templates-mod/csharp/partial_header.mustache @@ -0,0 +1,12 @@ +/* +{{#appName}} +* {{{.}}} +* +{{/appName}} +* +* {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ From 0aba8efb2e1206a45820b556dc63bce24592cdfc Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 11 Sep 2025 14:55:03 +0200 Subject: [PATCH 008/126] Fix templates, no longer throw if required --- templates-mod/csharp/model.mustache | 3 +- templates-mod/csharp/modelAnyOf.mustache | 275 +++++++++++++++++++ templates-mod/csharp/modelEnum.mustache | 185 +++++++++++++ templates-mod/csharp/modelGeneric.mustache | 86 ++++-- templates-mod/csharp/modelInnerEnum.mustache | 99 +++++++ templates-mod/csharp/modelOneOf.mustache | 88 ++++-- templates/csharp/model.mustache | 6 - 7 files changed, 683 insertions(+), 59 deletions(-) create mode 100644 templates-mod/csharp/modelAnyOf.mustache create mode 100644 templates-mod/csharp/modelEnum.mustache create mode 100644 templates-mod/csharp/modelInnerEnum.mustache diff --git a/templates-mod/csharp/model.mustache b/templates-mod/csharp/model.mustache index 51a2ad036..0d0c0b683 100644 --- a/templates-mod/csharp/model.mustache +++ b/templates-mod/csharp/model.mustache @@ -1,4 +1,5 @@ {{>partial_header}} + {{#models}} {{#model}} using System; @@ -24,7 +25,7 @@ using JsonSubTypes; {{#validatable}} using System.ComponentModel.DataAnnotations; {{/validatable}} -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; {{#useCompareNetObjects}} using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; {{/useCompareNetObjects}} diff --git a/templates-mod/csharp/modelAnyOf.mustache b/templates-mod/csharp/modelAnyOf.mustache new file mode 100644 index 000000000..f3eac973d --- /dev/null +++ b/templates-mod/csharp/modelAnyOf.mustache @@ -0,0 +1,275 @@ +{{#model}} + /// + /// {{description}}{{^description}}{{classname}}{{/description}} + /// + {{#vendorExtensions.x-cls-compliant}} + [CLSCompliant({{{.}}})] + {{/vendorExtensions.x-cls-compliant}} + {{#vendorExtensions.x-com-visible}} + [ComVisible({{{.}}})] + {{/vendorExtensions.x-com-visible}} + [JsonConverter(typeof({{classname}}JsonConverter))] + [DataContract(Name = "{{{name}}}")] + {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} + { + {{#isNullable}} + /// + /// Initializes a new instance of the class. + /// + public {{classname}}() + { + IsNullable = true; + SchemaType= "anyOf"; + } + + {{/isNullable}} + {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^isNull}} + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of {{dataType}}. + public {{classname}}({{{dataType}}} actualInstance) + { + IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; + SchemaType= "anyOf"; + ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; + } + + {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.anyOf}} + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + {{#anyOf}} + {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) + { + _actualInstance = value; + } + {{/anyOf}} + else + { + throw new ArgumentException("Invalid instance found. Must be the following types:{{#anyOf}} {{{.}}}{{^-last}},{{/-last}}{{/anyOf}}"); + } + } + } + {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^isNull}} + + /// + /// Get the actual instance of `{{dataType}}`. If the actual instance is not `{{dataType}}`, + /// the InvalidClassException will be thrown + /// + /// An instance of {{dataType}} + public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}() + { + return ({{{dataType}}})ActualInstance; + } + {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.anyOf}} + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class {{classname}} {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, {{classname}}.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of {{classname}} + /// + /// JSON string + /// An instance of {{classname}} + public static {{classname}} FromJson(string jsonString) + { + {{classname}} new{{classname}} = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return new{{classname}}; + } + {{#anyOf}} + + try + { + new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return new{{classname}}; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into {{{.}}}: {1}", jsonString, exception.ToString())); + } + {{/anyOf}} + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + {{#equatable}} + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + return Equals(input as {{classname}}); + {{/useCompareNetObjects}} + } + + /// + /// Returns true if {{classname}} instances are equal + /// + /// Instance of {{classname}} to be compared + /// Boolean + public bool Equals({{classname}} input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + if (input == null) + return false; + + return ActualInstance.Equals(input.ActualInstance); + {{/useCompareNetObjects}} + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); + return hashCode; + } + } + {{/equatable}} + + {{#validatable}} + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + {{/validatable}} + } + + /// + /// Custom JSON converter for {{classname}} + /// + public class {{classname}}JsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{#isInteger}} + case JsonToken.Integer: + return new {{classname}}(Convert.ToInt32(reader.Value)); + {{/isInteger}} + {{#isNumber}} + case JsonToken.Float: + return new {{classname}}(Convert.ToDecimal(reader.Value)); + {{/isNumber}} + {{#isString}} + case JsonToken.String: + return new {{classname}}(Convert.ToString(reader.Value)); + {{/isString}} + {{#isBoolean}} + case JsonToken.Boolean: + return new {{classname}}(Convert.ToBoolean(reader.Value)); + {{/isBoolean}} + {{#isDate}} + case JsonToken.Date: + return new {{classname}}(Convert.ToDateTime(reader.Value)); + {{/isDate}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.anyOf}} + case JsonToken.StartObject: + return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return {{classname}}.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } +{{/model}} \ No newline at end of file diff --git a/templates-mod/csharp/modelEnum.mustache b/templates-mod/csharp/modelEnum.mustache new file mode 100644 index 000000000..029055d35 --- /dev/null +++ b/templates-mod/csharp/modelEnum.mustache @@ -0,0 +1,185 @@ + /// + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} + /// + {{#description}} + /// {{.}} + {{/description}} + {{#vendorExtensions.x-cls-compliant}} + [CLSCompliant({{{.}}})] + {{/vendorExtensions.x-cls-compliant}} + {{#vendorExtensions.x-com-visible}} + [ComVisible({{{.}}})] + {{/vendorExtensions.x-com-visible}} + {{#allowableValues}} + {{#enumVars}} + {{#-first}} + {{#isString}} + {{^useGenericHost}} + [JsonConverter(typeof(StringEnumConverter))] + {{/useGenericHost}} + {{/isString}} + {{/-first}} + {{/enumVars}} + {{/allowableValues}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + { + {{#allowableValues}} + {{#enumVars}} + /// + /// Enum {{name}} for value: {{value}} + /// + {{#isString}} + {{^useGenericHost}} + {{! EnumMember not currently supported in System.Text.Json, use a converter instead }} + [EnumMember(Value = "{{{value}}}")] + {{/useGenericHost}} + {{/isString}} + {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}}{{^vendorExtensions.x-zero-based-enum}} = {{-index}}{{/vendorExtensions.x-zero-based-enum}}{{/isString}}{{^-last}},{{/-last}} + {{^-last}} + + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + } + {{#useGenericHost}} + + /// + /// Converts to and from the JSON value + /// + public static class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} FromString(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Could not convert value to type {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}: '{value}'"); // TODO + } + + /// + /// Parses a given value to + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? FromStringOrDefault(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static {{>EnumValueDataType}} ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} value) + { + {{^isString}} + return ({{>EnumValueDataType}}) value; + {{/isString}} + {{#isString}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isString}} + } + } + + /// + /// A Json converter for type + /// + /// + public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> + { + /// + /// Returns a {{datatypeWithEnum}} from the Json object + /// + /// + /// + /// + /// + public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string{{nrt?}} rawValue = reader.GetString(); + + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null + ? null + : {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) + { + writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}?> + { + /// + /// Returns a {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} from the Json object + /// + /// + /// + /// + /// + public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string{{nrt?}} rawValue = reader.GetString(); + + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null + ? null + : {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) + { + writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}?.ToString() ?? "null"); + } + } + {{/useGenericHost}} diff --git a/templates-mod/csharp/modelGeneric.mustache b/templates-mod/csharp/modelGeneric.mustache index ffeedcb6e..8aeb55522 100644 --- a/templates-mod/csharp/modelGeneric.mustache +++ b/templates-mod/csharp/modelGeneric.mustache @@ -9,12 +9,14 @@ {{/vendorExtensions.x-com-visible}} [DataContract(Name = "{{{name}}}")] {{#discriminator}} + {{#mappedModels.size}} [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")] + {{/mappedModels.size}} {{#mappedModels}} [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] {{/mappedModels}} {{/discriminator}} - {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}}{{#lambda.firstDot}}{{#parent}} : .{{/parent}}{{#validatable}} : .{{/validatable}}{{#equatable}} : .{{/equatable}}{{/lambda.firstDot}}{{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} { {{#vars}} {{#items.isEnum}} @@ -37,10 +39,15 @@ {{#description}} /// {{.}} {{/description}} + {{#example}} + /* + {{.}} + */ + {{/example}} {{^conditionalSerialization}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}false{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}false{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#deprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + [Obsolete] {{/deprecated}} public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } {{#isReadOnly}} @@ -57,12 +64,13 @@ {{/conditionalSerialization}} {{#conditionalSerialization}} {{#isReadOnly}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}false{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}false{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#deprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + [Obsolete] {{/deprecated}} public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } + /// /// Returns false as {{name}} should not be serialized given that it's read-only. /// @@ -74,9 +82,9 @@ {{/isReadOnly}} {{^isReadOnly}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#deprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + [Obsolete] {{/deprecated}} public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { @@ -123,12 +131,12 @@ /// Initializes a new instance of the class. /// {{#readWriteVars}} - /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. + /// {{description}}{{^description}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. {{/readWriteVars}} {{#hasOnlyReadOnly}} [JsonConstructorAttribute] {{/hasOnlyReadOnly}} - public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isNumeric}}?{{/isNumeric}}{{#isBoolean}}{{^isNullable}}?{{/isNullable}}{{/isBoolean}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{#defaultValue}}{{^isDateTime}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isNumeric}}?{{/isNumeric}}{{#isBoolean}}{{^isNullable}}?{{/isNullable}}{{/isBoolean}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} + public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} { {{#vars}} {{^isInherited}} @@ -136,18 +144,18 @@ {{#required}} {{^conditionalSerialization}} {{^vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; {{/vendorExtensions.x-csharp-value-type}} {{/conditionalSerialization}} {{#conditionalSerialization}} {{^vendorExtensions.x-csharp-value-type}} - this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} - this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; {{/vendorExtensions.x-csharp-value-type}} {{/conditionalSerialization}} {{/required}} @@ -161,20 +169,20 @@ {{#defaultValue}} {{^conditionalSerialization}} {{^vendorExtensions.x-csharp-value-type}} - // use default value if no "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" provided - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? {{{defaultValue}}}; + // use default value if no "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" provided + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} ?? {{#isString}}@{{/isString}}{{{defaultValue}}}; {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; {{/vendorExtensions.x-csharp-value-type}} {{/conditionalSerialization}} {{/defaultValue}} {{^defaultValue}} {{^conditionalSerialization}} - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; {{/conditionalSerialization}} {{#conditionalSerialization}} - this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; if (this.{{name}} != null) { this._flag{{name}} = true; @@ -197,36 +205,61 @@ /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /* + {{.}} + */ + {{/example}} {{^conditionalSerialization}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}false{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}false{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#isDate}} + {{^supportsDateOnly}} [JsonConverter(typeof(OpenAPIDateConverter))] + {{/supportsDateOnly}} {{/isDate}} {{#deprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + [Obsolete] {{/deprecated}} - public {{{dataType}}}{{#isNumeric}}?{{/isNumeric}}{{#isBoolean}}{{^isNullable}}?{{/isNullable}}{{/isBoolean}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + {{#isReadOnly}} + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} {{/conditionalSerialization}} {{#conditionalSerialization}} {{#isReadOnly}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#isDate}} [JsonConverter(typeof(OpenAPIDateConverter))] {{/isDate}} {{#deprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + [Obsolete] {{/deprecated}} public {{{dataType}}} {{name}} { get; private set; } + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } {{/isReadOnly}} {{^isReadOnly}} {{#isDate}} [JsonConverter(typeof(OpenAPIDateConverter))] {{/isDate}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}false{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#deprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + [Obsolete] {{/deprecated}} public {{{dataType}}} {{name}} { @@ -290,6 +323,7 @@ { return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } + {{#equatable}} /// /// Returns true if objects are equal @@ -378,6 +412,8 @@ return hashCode; } } + {{/equatable}} + {{#validatable}} {{>validatable}} {{/validatable}} diff --git a/templates-mod/csharp/modelInnerEnum.mustache b/templates-mod/csharp/modelInnerEnum.mustache new file mode 100644 index 000000000..62b8a003f --- /dev/null +++ b/templates-mod/csharp/modelInnerEnum.mustache @@ -0,0 +1,99 @@ + {{^isContainer}} + /// + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} + /// + {{#description}} + /// {{.}} + {{/description}} + {{#isString}} + {{^useGenericHost}} + [JsonConverter(typeof(StringEnumConverter))] + {{/useGenericHost}} + {{/isString}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + { + {{#allowableValues}} + {{#enumVars}} + /// + /// Enum {{name}} for value: {{value}} + /// + {{^useGenericHost}} + {{#isString}} + [EnumMember(Value = "{{{value}}}")] + {{/isString}} + {{/useGenericHost}} + {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}}{{^vendorExtensions.x-zero-based-enum}} = {{-index}}{{/vendorExtensions.x-zero-based-enum}}{{/isString}}{{^-last}},{{/-last}} + {{^-last}} + + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + } + {{#useGenericHost}} + + /// + /// Returns a + /// + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}FromString(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Could not convert value to type {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}: '{value}'"); // TODO + } + + /// + /// Returns a + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}FromStringOrDefault(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + {{#isString}} + /// + {{/isString}} + public static {{>EnumValueDataType}}{{#lambda.first}}{{#nrt}}{{#isString}}{{#isNullable}}{{nrt?}} {{^nrt}}{{#vendorExtensions.x-is-value-type}}? {{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}}{{/isString}}{{/nrt}}{{/lambda.first}} {{datatypeWithEnum}}ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#isString}}{{>NullConditionalProperty}}{{/isString}} value) + { + {{^isString}} + return ({{>EnumValueDataType}}) value; + {{/isString}} + {{#isString}} + {{#isNullable}} + if (value == null) + return null; + + {{/isNullable}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isString}} + } + {{/useGenericHost}} + {{/isContainer}} \ No newline at end of file diff --git a/templates-mod/csharp/modelOneOf.mustache b/templates-mod/csharp/modelOneOf.mustache index 66721caf6..ab42e4eef 100644 --- a/templates-mod/csharp/modelOneOf.mustache +++ b/templates-mod/csharp/modelOneOf.mustache @@ -10,7 +10,7 @@ {{/vendorExtensions.x-com-visible}} [JsonConverter(typeof({{classname}}JsonConverter))] [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}} : {{#lambda.joinWithComma}}AbstractOpenAPISchema {{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} { {{#isNullable}} /// @@ -24,6 +24,7 @@ {{/isNullable}} {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{^isNull}} /// /// Initializes a new instance of the class @@ -38,6 +39,7 @@ } {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} private Object _actualInstance; @@ -54,7 +56,7 @@ set { {{#oneOf}} - {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) + {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}}) || value is {{{.}}}) { this._actualInstance = value; } @@ -66,6 +68,7 @@ } } {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{^isNull}} /// @@ -78,6 +81,7 @@ return ({{{dataType}}})this.ActualInstance; } {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} /// @@ -143,42 +147,43 @@ {{/useOneOfDiscriminatorLookup}} int match = 0; List matchedTypes = new List(); - JToken typeToken = JObject.Parse(jsonString).GetValue("type"); - string type = typeToken?.Value(); - // Throw exception if jsonString does not contain type param - if (type == null) - { - throw new InvalidDataException("JsonString does not contain required enum type for deserialization."); - } + {{#oneOf}} + try { - {{#oneOf}} - // Check if the jsonString type enum matches the {{{.}}} type enums - if (ContainsValue<{{{.}}}.TypeEnum>(type)) + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof({{{.}}}).GetProperty("AdditionalProperties") == null) { new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.SerializerSettings)); - matchedTypes.Add("{{{.}}}"); - match++; } - {{/oneOf}} - } - catch (Exception ex) - { - if (!(ex is JsonSerializationException)) + else { - throw new InvalidDataException(string.Format("Failed to deserialize `{0}` into target: {1}", jsonString, ex.ToString())); + new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.AdditionalPropertiesSerializerSettings)); } + matchedTypes.Add("{{{.}}}"); + match++; } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into {{{.}}}: {1}", jsonString, exception.ToString())); + } + {{/oneOf}} - if (match != 1) + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) { - throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined. MatchedTypes are: " + matchedTypes); + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + String.Join(",", matchedTypes)); } - + // deserialization is considered successful at this point if no exception has been thrown. return new{{classname}}; } + {{#equatable}} /// /// Returns true if objects are equal /// @@ -226,8 +231,9 @@ return hashCode; } } - + {{/equatable}} {{#validatable}} + /// /// To validate all properties of the instance /// @@ -266,11 +272,39 @@ /// The object converted from the JSON string public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { - if(reader.TokenType != JsonToken.Null) + switch(reader.TokenType) { - return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{#isInteger}} + case JsonToken.Integer: + return new {{classname}}(Convert.ToInt32(reader.Value)); + {{/isInteger}} + {{#isNumber}} + case JsonToken.Float: + return new {{classname}}(Convert.ToDecimal(reader.Value)); + {{/isNumber}} + {{#isString}} + case JsonToken.String: + return new {{classname}}(Convert.ToString(reader.Value)); + {{/isString}} + {{#isBoolean}} + case JsonToken.Boolean: + return new {{classname}}(Convert.ToBoolean(reader.Value)); + {{/isBoolean}} + {{#isDate}} + case JsonToken.Date: + return new {{classname}}(Convert.ToDateTime(reader.Value)); + {{/isDate}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + case JsonToken.StartObject: + return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return {{classname}}.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; } - return null; } /// diff --git a/templates/csharp/model.mustache b/templates/csharp/model.mustache index 51a2ad036..069785679 100644 --- a/templates/csharp/model.mustache +++ b/templates/csharp/model.mustache @@ -21,13 +21,7 @@ using JsonSubTypes; {{/discriminator}} {{/model}} {{/models}} -{{#validatable}} -using System.ComponentModel.DataAnnotations; -{{/validatable}} using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; -{{#useCompareNetObjects}} -using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; -{{/useCompareNetObjects}} {{#models}} {{#model}} {{#oneOf}} From 69305f6c317036cb61532d9954e430cb601bc60c Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 11 Sep 2025 15:23:32 +0200 Subject: [PATCH 009/126] Add JsonSubtypes --- Adyen/Adyen.csproj | 1 + templates-mod/csharp/api.mustache | 807 ++++++++++++++++++++++++++++-- 2 files changed, 761 insertions(+), 47 deletions(-) diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index b8b25e4c0..d2bf923bf 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -35,6 +35,7 @@ + diff --git a/templates-mod/csharp/api.mustache b/templates-mod/csharp/api.mustache index 27ff0eb4d..527434ba1 100644 --- a/templates-mod/csharp/api.mustache +++ b/templates-mod/csharp/api.mustache @@ -1,86 +1,799 @@ {{>partial_header}} + using System; using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using Adyen.Model; -{{#hasImport}}using Adyen.{{modelPackage}}; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using {{packageName}}.Client; +{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +{{#hasImport}}using {{packageName}}.{{modelPackage}}; {{/hasImport}} namespace {{packageName}}.{{apiPackage}} { -{{#operations}} + {{#operations}} + /// - /// {{classname}} Interface + /// Represents a collection of functions to interact with the API endpoints /// - public interface I{{classname}} + {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor { + #region Synchronous Operations {{#operation}} -{{>method_documentation}} - {{#returnType}} - /// . - {{/returnType}} + /// + /// {{summary}} + /// + {{#notes}} + /// + /// {{.}} + /// + {{/notes}} + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// Index associated with the operation. + /// {{returnType}} {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + [Obsolete] {{/isDeprecated}} - {{#returnType}}{{modelPackage}}.{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}({{>api_parameters}}); - - {{#supportsAsync}} -{{>method_documentation}} - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects.{{#returnType}} - /// Task of .{{/returnType}} + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// Index associated with the operation. + /// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + [Obsolete] {{/isDeprecated}} - {{#returnType}}Task<{{modelPackage}}.{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_parameters_async}}); - - {{/supportsAsync}} + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); {{/operation}} + #endregion Synchronous Operations } - {{/operations}} - - {{#operations}} + + {{#supportsAsync}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor + { + #region Asynchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + {{/operation}} + #endregion Asynchronous Operations + } + {{/supportsAsync}} + /// - /// Represents a collection of functions to interact with the {{classname}} API endpoints + /// Represents a collection of functions to interact with the API endpoints /// - {{>visibility}} class {{classname}} : AbstractService, I{{classname}} + {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} { - private readonly string _baseUrl; - - public {{classname}}(Client client) : base(client) + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} partial class {{classname}} : {{interfacePrefix}}{{classname}} + { + private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public {{classname}}() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public {{classname}}(string basePath) + { + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + new {{packageName}}.Client.Configuration { BasePath = basePath } + ); + this.Client = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + {{#supportsAsync}} + this.AsynchronousClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + {{/supportsAsync}} + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public {{classname}}({{packageName}}.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + {{#supportsAsync}} + this.AsynchronousClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + {{/supportsAsync}} + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access.{{#supportsAsync}} + /// The client interface for asynchronous API access.{{/supportsAsync}} + /// The configuration object. + public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + {{#supportsAsync}} + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + {{/supportsAsync}} + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + {{#supportsAsync}} + this.AsynchronousClient = asyncClient; + {{/supportsAsync}} + this.Configuration = configuration; + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + {{#supportsAsync}} + /// + /// The client for accessing this underlying API asynchronously. + /// + public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } + {{/supportsAsync}} + + /// + /// The client for accessing this underlying API synchronously. + /// + public {{packageName}}.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() { - _baseUrl = CreateBaseUrl("{{{basePath}}}"); + return this.Configuration.BasePath; } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public {{packageName}}.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + {{#operation}} - + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// Index associated with the operation. + /// {{returnType}} {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + [Obsolete] {{/isDeprecated}} - public {{#returnType}}{{modelPackage}}.{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}({{>api_parameters}}) + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) { - {{#returnType}}return {{/returnType}}{{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_invoke}}).ConfigureAwait(false).GetAwaiter().GetResult(); + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// Index associated with the operation. + /// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + { + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + } + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{paramName}}[{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}]", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + {{#isArray}} + {{#supportsFileParameters}} + foreach (var file in {{paramName}}) + { + localVarRequestOptions.FileParameters.Add("{{baseName}}", file); + } + {{/supportsFileParameters}} + {{/isArray}} + {{^isArray}} + {{#supportsFileParameters}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} + {{/isArray}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{#isPrimitiveType}}{{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}){{/isPrimitiveType}}{{^isPrimitiveType}}localVarMultipartFormData ? {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}) : {{packageName}}.Client.ClientUtils.Serialize({{paramName}}){{/isPrimitiveType}}); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + {{#isArray}} + {{#supportsFileParameters}} + foreach (var file in {{paramName}}) + { + localVarRequestOptions.FileParameters.Add("{{baseName}}", file); + } + {{/supportsFileParameters}} + {{/isArray}} + {{^isArray}} + {{#supportsFileParameters}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} + {{/isArray}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{#isPrimitiveType}}{{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}){{/isPrimitiveType}}{{^isPrimitiveType}}localVarMultipartFormData ? {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}) : {{packageName}}.Client.ClientUtils.Serialize({{paramName}}){{/isPrimitiveType}}); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + localVarRequestOptions.Operation = "{{classname}}.{{operationId}}"; + localVarRequestOptions.OperationIndex = operationIndex; + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{#isOAuth}} + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{#hasOAuthMethods}} + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + {{/hasOAuthMethods}} + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; } {{#supportsAsync}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] + [Obsolete] {{/isDeprecated}} - {{#returnType}}public async Task<{{modelPackage}}.{{{.}}}>{{/returnType}}{{^returnType}}public async Task{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_parameters_async}}) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { - {{#hasQueryParams}} - // Build the query string - var queryParams = new Dictionary(); + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false);{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + { + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + } + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}}, {{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + {{#constantParams}} + {{#isPathParam}} + // Set client side default value of Path Param "{{baseName}}". + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant path parameter + {{/isPathParam}} + {{/constantParams}} + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + localVarRequestOptions.QueryParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant query parameter + {{/isQueryParam}} + {{/constantParams}} {{#queryParams}} - {{^required}}if ({{paramName}} != null) {{/required}}queryParams.Add("{{baseName}}", {{paramName}}{{^isString}}{{^isDateTime}}.ToString(){{/isDateTime}}{{#isDateTime}}{{^required}}.Value{{/required}}.ToString("yyyy-MM-ddTHH:mm:ssZ"){{/isDateTime}}{{/isString}}); + {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{paramName}}[{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}]", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + } + {{/required}} {{/queryParams}} - {{/hasQueryParams}} - var endpoint = _baseUrl + {{#hasPathParams}}${{/hasPathParams}}"{{{path}}}"{{#hasQueryParams}} + ToQueryString(queryParams){{/hasQueryParams}}; - var resource = new ServiceResource(this, endpoint); - {{#returnType}}return {{/returnType}}await resource.RequestAsync{{#returnType}}<{{modelPackage}}.{{returnType}}>{{/returnType}}({{#bodyParam}}{{paramName}}.ToJson(){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, requestOptions, new HttpMethod("{{httpMethod}}"), cancellationToken).ConfigureAwait(false); + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + {{/isHeaderParam}} + {{/constantParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + {{#isArray}} + {{#supportsFileParameters}} + foreach (var file in {{paramName}}) + { + localVarRequestOptions.FileParameters.Add("{{baseName}}", file); + } + {{/supportsFileParameters}} + {{/isArray}} + {{^isArray}} + {{#supportsFileParameters}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} + {{/isArray}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + {{#isArray}} + {{#supportsFileParameters}} + foreach (var file in {{paramName}}) + { + localVarRequestOptions.FileParameters.Add("{{baseName}}", file); + } + {{/supportsFileParameters}} + {{/isArray}} + {{^isArray}} + {{#supportsFileParameters}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} + {{/isArray}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + localVarRequestOptions.Operation = "{{classname}}.{{operationId}}"; + localVarRequestOptions.OperationIndex = operationIndex; + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{#hasOAuthMethods}} + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + {{/hasOAuthMethods}} + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; } + {{/supportsAsync}} {{/operation}} } {{/operations}} -} \ No newline at end of file +} From 30c22e1d93680b95fd1fefccd463da157100d9a7 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 11 Sep 2025 15:27:34 +0200 Subject: [PATCH 010/126] OAuth & DOCS --- Adyen/Client/OpenAPIDateConverter.cs | 30 ++++ .../csharp/auth/OAuthAuthenticator.mustache | 136 ++++++++++++++++++ templates-mod/csharp/auth/OAuthFlow.mustache | 19 +++ .../csharp/auth/TokenResponse.mustache | 24 ++++ templates-mod/csharp/model_doc.mustache | 22 +++ 5 files changed, 231 insertions(+) create mode 100644 Adyen/Client/OpenAPIDateConverter.cs create mode 100644 templates-mod/csharp/auth/OAuthAuthenticator.mustache create mode 100644 templates-mod/csharp/auth/OAuthFlow.mustache create mode 100644 templates-mod/csharp/auth/TokenResponse.mustache create mode 100644 templates-mod/csharp/model_doc.mustache diff --git a/Adyen/Client/OpenAPIDateConverter.cs b/Adyen/Client/OpenAPIDateConverter.cs new file mode 100644 index 000000000..f7b37c55b --- /dev/null +++ b/Adyen/Client/OpenAPIDateConverter.cs @@ -0,0 +1,30 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using Newtonsoft.Json.Converters; + +namespace Adyen.Client +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/templates-mod/csharp/auth/OAuthAuthenticator.mustache b/templates-mod/csharp/auth/OAuthAuthenticator.mustache new file mode 100644 index 000000000..c336c8ad5 --- /dev/null +++ b/templates-mod/csharp/auth/OAuthAuthenticator.mustache @@ -0,0 +1,136 @@ +{{>partial_header}} + +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; +using RestSharp; +using RestSharp.Authenticators; + +namespace {{packageName}}.Client.Auth +{ + /// + /// An authenticator for OAuth2 authentication flows + /// + public class OAuthAuthenticator : IAuthenticator + { + private TokenResponse{{nrt?}} _token; + + /// + /// Returns the current authentication token. Can return null if there is no authentication token, or it has expired. + /// + public string{{nrt?}} Token + { + get + { + if (_token == null) return null; + if (_token.ExpiresIn == null) return _token.AccessToken; + if (_token.ExpiresAt < DateTime.Now) return null; + + return _token.AccessToken; + } + } + + readonly string _tokenUrl; + readonly string _clientId; + readonly string _clientSecret; + readonly string{{nrt?}} _scope; + readonly string _grantType; + readonly JsonSerializerSettings _serializerSettings; + readonly IReadableConfiguration _configuration; + + /// + /// Initialize the OAuth2 Authenticator + /// + public OAuthAuthenticator( + string tokenUrl, + string clientId, + string clientSecret, + string{{nrt?}} scope, + OAuthFlow? flow, + JsonSerializerSettings serializerSettings, + IReadableConfiguration configuration) + { + _tokenUrl = tokenUrl; + _clientId = clientId; + _clientSecret = clientSecret; + _scope = scope; + _serializerSettings = serializerSettings; + _configuration = configuration; + + switch (flow) + { + /*case OAuthFlow.ACCESS_CODE: + _grantType = "authorization_code"; + break; + case OAuthFlow.IMPLICIT: + _grantType = "implicit"; + break; + case OAuthFlow.PASSWORD: + _grantType = "password"; + break;*/ + case OAuthFlow.APPLICATION: + _grantType = "client_credentials"; + break; + default: + break; + } + } + + /// + /// Creates an authentication parameter from an access token. + /// + /// An authentication parameter. + protected async ValueTask GetAuthenticationParameter() + { + var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; + return new HeaderParameter(KnownHeaders.Authorization, token); + } + + /// + /// Gets the token from the OAuth2 server. + /// + /// An authentication token. + async Task GetToken() + { + var client = new RestClient(_tokenUrl, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(_serializerSettings, _configuration))); + + var request = new RestRequest(); + if (!string.IsNullOrWhiteSpace(_token?.RefreshToken)) + { + request.AddParameter("grant_type", "refresh_token") + .AddParameter("refresh_token", _token.RefreshToken); + } + else + { + request + .AddParameter("grant_type", _grantType) + .AddParameter("client_id", _clientId) + .AddParameter("client_secret", _clientSecret); + } + if (!string.IsNullOrEmpty(_scope)) + { + request.AddParameter("scope", _scope); + } + _token = await client.PostAsync(request).ConfigureAwait(false); + // RFC6749 - token_type is case insensitive. + // RFC6750 - In Authorization header Bearer should be capitalized. + // Fix the capitalization irrespective of token_type casing. + switch (_token?.TokenType?.ToLower()) + { + case "bearer": + return $"Bearer {_token.AccessToken}"; + default: + return $"{_token?.TokenType} {_token?.AccessToken}"; + } + } + + /// + /// Retrieves the authentication token (creating a new one if necessary) and adds it to the current request + /// + /// + /// + /// + public async ValueTask Authenticate(IRestClient client, RestRequest request) + => request.AddOrUpdateParameter(await GetAuthenticationParameter().ConfigureAwait(false)); + } +} diff --git a/templates-mod/csharp/auth/OAuthFlow.mustache b/templates-mod/csharp/auth/OAuthFlow.mustache new file mode 100644 index 000000000..768ddd0aa --- /dev/null +++ b/templates-mod/csharp/auth/OAuthFlow.mustache @@ -0,0 +1,19 @@ +{{>partial_header}} + +namespace {{packageName}}.Client.Auth +{ + /// + /// Available flows for OAuth2 authentication + /// + public enum OAuthFlow + { + /// Authorization code flow + ACCESS_CODE, + /// Implicit flow + IMPLICIT, + /// Password flow + PASSWORD, + /// Client credentials flow + APPLICATION + } +} \ No newline at end of file diff --git a/templates-mod/csharp/auth/TokenResponse.mustache b/templates-mod/csharp/auth/TokenResponse.mustache new file mode 100644 index 000000000..7a72e04c1 --- /dev/null +++ b/templates-mod/csharp/auth/TokenResponse.mustache @@ -0,0 +1,24 @@ +{{>partial_header}} + +using System; +using Newtonsoft.Json; + +namespace {{packageName}}.Client.Auth +{ + class TokenResponse + { + [JsonProperty("token_type")] + public string TokenType { get; set; } + [JsonProperty("access_token")] + public string AccessToken { get; set; } + [JsonProperty("expires_in")] + public int? ExpiresIn { get; set; } + [JsonProperty("created")] + public DateTime? Created { get; set; } + + [JsonProperty("refresh_token")] + public string{{nrt?}} RefreshToken { get; set; } + + public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value); + } +} \ No newline at end of file diff --git a/templates-mod/csharp/model_doc.mustache b/templates-mod/csharp/model_doc.mustache new file mode 100644 index 000000000..3c7f8b2db --- /dev/null +++ b/templates-mod/csharp/model_doc.mustache @@ -0,0 +1,22 @@ +{{#models}} +{{#model}} +# {{{packageName}}}.{{modelPackage}}.{{{classname}}} +{{#description}}{{&description}} +{{/description}} + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#parent}} +{{#parentVars}} +**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/parentVars}} +{{/parent}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/vars}} + +[[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) + +{{/model}} +{{/models}} From 221647d5c56b6305f53411dd4bb0b8946f3b717d Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 24 Sep 2025 16:13:55 +0200 Subject: [PATCH 011/126] templates move --- templates-v7/csharp/ApiClient.mustache | 8 +- templates-v7/csharp/ApiClient.v790.mustache | 838 ++++++++++++++++++ templates-v7/csharp/Configuration.mustache | 2 +- .../csharp/Configuration.v790.mustache | 737 +++++++++++++++ .../csharp/HttpSigningConfiguration.mustache | 2 +- .../csharp/IAsynchronousClient.mustache | 14 +- .../IReadableConfiguration.v790.mustache | 178 ++++ templates-v7/csharp/api.mustache | 16 +- templates-v7/csharp/api_doc.mustache | 2 + templates-v7/csharp/git_push.sh.mustache | 57 ++ ...terOperationDefaultImplementation.mustache | 2 +- .../generichost/ApiException.mustache | 1 + ...stache => ApiResponseEventArgs`1.mustache} | 0 ...sponse.mustache => ApiResponse`1.mustache} | 35 + .../generichost/ApiTestsBase.mustache | 1 + .../libraries/generichost/AsModel.mustache | 2 +- .../DateOnlyJsonConverter.mustache | 1 + .../DateOnlyNullableJsonConverter.mustache | 1 + .../DateTimeJsonConverter.mustache | 1 + .../DateTimeNullableJsonConverter.mustache | 1 + .../generichost/HostConfiguration.mustache | 3 +- .../HttpSigningConfiguration.mustache | 1 + .../libraries/generichost/IApi.mustache | 2 +- .../generichost/JsonConverter.mustache | 73 +- .../generichost/ModelSignature.mustache | 2 +- .../NullConditionalParameter.mustache | 1 - .../NullConditionalProperty.mustache | 1 - .../libraries/generichost/Option.mustache | 1 + .../generichost/README.client.mustache | 237 ++--- .../generichost/README.solution.mustache | 1 + ....mustache => RateLimitProvider`1.mustache} | 23 +- ...ner.mustache => TokenContainer`1.mustache} | 0 ...ider.mustache => TokenProvider`1.mustache} | 1 + .../generichost/WriteProperty.mustache | 3 +- .../csharp/libraries/generichost/api.mustache | 72 +- .../libraries/generichost/api_test.mustache | 15 +- .../generichost/git_push.ps1.mustache | 75 ++ .../generichost/git_push.sh.mustache | 49 + .../libraries/generichost/model.mustache | 5 + .../generichost/modelGeneric.mustache | 5 +- .../libraries/httpclient/ApiClient.mustache | 792 +++++++++++++++++ .../httpclient/FileParameter.mustache | 72 ++ .../httpclient/RequestOptions.mustache | 66 ++ .../csharp/libraries/httpclient/api.mustache | 766 ++++++++++++++++ .../libraries/httpclient/model.mustache | 51 ++ .../unityWebRequest/ApiClient.mustache | 677 ++++++++++++++ .../ConnectionException.mustache | 57 ++ .../libraries/unityWebRequest/README.mustache | 175 ++++ .../unityWebRequest/RequestOptions.mustache | 60 ++ .../UnexpectedResponseException.mustache | 26 + .../UnityWebRequestAwaiterExtension.mustache | 23 + .../libraries/unityWebRequest/api.mustache | 690 ++++++++++++++ .../unityWebRequest/api_test.mustache | 74 ++ .../libraries/unityWebRequest/asmdef.mustache | 7 + .../unityWebRequest/asmdef_test.mustache | 15 + .../libraries/unityWebRequest/model.mustache | 47 + .../unityWebRequest/model_test.mustache | 64 ++ templates-v7/csharp/modelEnum.mustache | 18 +- templates-v7/csharp/modelGeneric.mustache | 5 +- templates-v7/csharp/netcore_project.mustache | 8 +- .../csharp/netcore_testproject.mustache | 6 +- templates-v7/csharp/validatable.mustache | 12 +- 62 files changed, 5903 insertions(+), 277 deletions(-) create mode 100644 templates-v7/csharp/ApiClient.v790.mustache create mode 100644 templates-v7/csharp/Configuration.v790.mustache create mode 100644 templates-v7/csharp/IReadableConfiguration.v790.mustache create mode 100644 templates-v7/csharp/git_push.sh.mustache rename templates-v7/csharp/libraries/generichost/{ApiResponseEventArgs.mustache => ApiResponseEventArgs`1.mustache} (100%) rename templates-v7/csharp/libraries/generichost/{ApiResponse.mustache => ApiResponse`1.mustache} (77%) delete mode 100644 templates-v7/csharp/libraries/generichost/NullConditionalParameter.mustache delete mode 100644 templates-v7/csharp/libraries/generichost/NullConditionalProperty.mustache rename templates-v7/csharp/libraries/generichost/{RateLimitProvider.mustache => RateLimitProvider`1.mustache} (77%) rename templates-v7/csharp/libraries/generichost/{TokenContainer.mustache => TokenContainer`1.mustache} (100%) rename templates-v7/csharp/libraries/generichost/{TokenProvider.mustache => TokenProvider`1.mustache} (99%) create mode 100644 templates-v7/csharp/libraries/generichost/git_push.ps1.mustache create mode 100644 templates-v7/csharp/libraries/generichost/git_push.sh.mustache create mode 100644 templates-v7/csharp/libraries/httpclient/ApiClient.mustache create mode 100644 templates-v7/csharp/libraries/httpclient/FileParameter.mustache create mode 100644 templates-v7/csharp/libraries/httpclient/RequestOptions.mustache create mode 100644 templates-v7/csharp/libraries/httpclient/api.mustache create mode 100644 templates-v7/csharp/libraries/httpclient/model.mustache create mode 100644 templates-v7/csharp/libraries/unityWebRequest/ApiClient.mustache create mode 100644 templates-v7/csharp/libraries/unityWebRequest/ConnectionException.mustache create mode 100644 templates-v7/csharp/libraries/unityWebRequest/README.mustache create mode 100644 templates-v7/csharp/libraries/unityWebRequest/RequestOptions.mustache create mode 100644 templates-v7/csharp/libraries/unityWebRequest/UnexpectedResponseException.mustache create mode 100644 templates-v7/csharp/libraries/unityWebRequest/UnityWebRequestAwaiterExtension.mustache create mode 100644 templates-v7/csharp/libraries/unityWebRequest/api.mustache create mode 100644 templates-v7/csharp/libraries/unityWebRequest/api_test.mustache create mode 100644 templates-v7/csharp/libraries/unityWebRequest/asmdef.mustache create mode 100644 templates-v7/csharp/libraries/unityWebRequest/asmdef_test.mustache create mode 100644 templates-v7/csharp/libraries/unityWebRequest/model.mustache create mode 100644 templates-v7/csharp/libraries/unityWebRequest/model_test.mustache diff --git a/templates-v7/csharp/ApiClient.mustache b/templates-v7/csharp/ApiClient.mustache index a96011d70..3e7746753 100644 --- a/templates-v7/csharp/ApiClient.mustache +++ b/templates-v7/csharp/ApiClient.mustache @@ -493,7 +493,7 @@ namespace {{packageName}}.Client { InterceptRequest(request); - RestResponse response = await getResponse(client); + RestResponse response = await getResponse(client).ConfigureAwait(false); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) @@ -562,7 +562,7 @@ namespace {{packageName}}.Client { if (policyResult.Outcome == OutcomeType.Successful) { - return await client.Deserialize(policyResult.Result, cancellationToken); + return await client.Deserialize(policyResult.Result, cancellationToken).ConfigureAwait(false); } else { @@ -607,7 +607,7 @@ namespace {{packageName}}.Client } {{#supportsAsync}} - private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default) { Action setOptions = (clientOptions) => { @@ -621,7 +621,7 @@ namespace {{packageName}}.Client { var policy = RetryConfiguration.AsyncRetryPolicy; var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken); + return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken).ConfigureAwait(false); } else { diff --git a/templates-v7/csharp/ApiClient.v790.mustache b/templates-v7/csharp/ApiClient.v790.mustache new file mode 100644 index 000000000..682b76251 --- /dev/null +++ b/templates-v7/csharp/ApiClient.v790.mustache @@ -0,0 +1,838 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +{{^net60OrLater}} +using System.Web; +{{/net60OrLater}} +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using RestSharp; +using RestSharp.Serializers; +using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; +{{#supportsRetry}} +using Polly; +{{/supportsRetry}} +{{#hasOAuthMethods}} +using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +using {{packageName}}.{{modelPackage}}; + +namespace {{packageName}}.Client +{ + /// + /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer + { + private readonly IReadableConfiguration _configuration; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); + + public T Deserialize(RestResponse response) + { + var result = (T)Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(RestResponse response, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return response.RawBytes; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = response.RawBytes; + if (response.Headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? global::System.IO.Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in response.Headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + FileIO.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public ISerializer Serializer => this; + public IDeserializer Deserializer => this; + + public string[] AcceptedContentTypes => ContentType.JsonAccept; + + public SupportsContentType SupportsContentType => contentType => + contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || + contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); + + public ContentType ContentType { get; set; } = ContentType.Json; + + public DataFormat DataFormat => DataFormat.Json; + } + {{! NOTE: Any changes related to RestSharp should be done in this class. All other client classes are for extensibility by consumers.}} + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + {{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(RestRequest request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(RestRequest request, RestResponse response); + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() + { + _baseUrl = GlobalConfiguration.Instance.BasePath; + } + + /// + /// Initializes a new instance of the + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Constructs the RestSharp version of an http method + /// + /// Swagger Client Custom HttpMethod + /// RestSharp's HttpMethod instance. + /// + private RestSharpMethod Method(HttpMethod method) + { + RestSharpMethod other; + switch (method) + { + case HttpMethod.Get: + other = RestSharpMethod.Get; + break; + case HttpMethod.Post: + other = RestSharpMethod.Post; + break; + case HttpMethod.Put: + other = RestSharpMethod.Put; + break; + case HttpMethod.Delete: + other = RestSharpMethod.Delete; + break; + case HttpMethod.Head: + other = RestSharpMethod.Head; + break; + case HttpMethod.Options: + other = RestSharpMethod.Options; + break; + case HttpMethod.Patch: + other = RestSharpMethod.Patch; + break; + default: + throw new ArgumentOutOfRangeException("method", method, null); + } + + return other; + } + + /// + /// Provides all logic for constructing a new RestSharp . + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// [private] A new RestRequest instance. + /// + private RestRequest NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + RestRequest request = new RestRequest(path, Method(method)); + + if (options.PathParameters != null) + { + foreach (var pathParam in options.PathParameters) + { + request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); + } + } + + if (options.QueryParameters != null) + { + foreach (var queryParam in options.QueryParameters) + { + foreach (var value in queryParam.Value) + { + request.AddQueryParameter(queryParam.Key, value); + } + } + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.AddHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + request.AddHeader(headerParam.Key, value); + } + } + } + + if (options.FormParameters != null) + { + foreach (var formParam in options.FormParameters) + { + request.AddParameter(formParam.Key, formParam.Value); + } + } + + if (options.Data != null) + { + if (options.Data is Stream stream) + { + var contentType = "application/octet-stream"; + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes[0]; + } + + var bytes = ClientUtils.ReadAsBytes(stream); + request.AddParameter(contentType, bytes, ParameterType.RequestBody); + } + else + { + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) + { + request.RequestFormat = DataFormat.Json; + } + else + { + // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. + } + } + else + { + // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. + request.RequestFormat = DataFormat.Json; + } + + request.AddJsonBody(options.Data); + } + } + + if (options.FileParameters != null) + { + foreach (var fileParam in options.FileParameters) + { + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); + else + request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); + } + } + } + + return request; + } + + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. + private ApiResponse ToApiResponse(RestResponse response) + { + T result = response.Data; + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) + { + ErrorText = response.ErrorMessage, + Cookies = new List() + }; + + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.ContentHeaders != null) + { + foreach (var responseHeader in response.ContentHeaders) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.Cookies != null) + { + foreach (var responseCookies in response.Cookies.Cast()) + { + transformed.Cookies.Add( + new Cookie( + responseCookies.Name, + responseCookies.Value, + responseCookies.Path, + responseCookies.Domain) + ); + } + } + + return transformed; + } + + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; + var clientOptions = new RestClientOptions(baseUrl) + { + ClientCertificates = configuration.ClientCertificates, + MaxTimeout = configuration.Timeout, + Proxy = configuration.Proxy, + UserAgent = configuration.UserAgent, + UseDefaultCredentials = configuration.UseDefaultCredentials, + RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + }; + setOptions(clientOptions); + + {{#hasOAuthMethods}} + if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(configuration.OAuthClientId) && + !string.IsNullOrEmpty(configuration.OAuthClientSecret) && + configuration.OAuthFlow != null) + { + clientOptions.Authenticator = new OAuthAuthenticator( + configuration.OAuthTokenUrl, + configuration.OAuthClientId, + configuration.OAuthClientSecret, + configuration.OAuthScope, + configuration.OAuthFlow, + SerializerSettings, + configuration); + } + + {{/hasOAuthMethods}} + using (RestClient client = new RestClient(clientOptions, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) + { + InterceptRequest(request); + + RestResponse response = await getResponse(client); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + try + { + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + catch (Exception ex) + { + throw ex.InnerException != null ? ex.InnerException : ex; + } + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + else if (typeof(T).Name == "Byte[]") // for byte response + { + response.Data = (T)(object)response.RawBytes; + } + else if (typeof(T).Name == "String") // for string response + { + response.Data = (T)(object)response.Content; + } + + InterceptResponse(request, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies.Cast()) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + } + + private async Task> DeserializeRestResponseFromPolicyAsync(RestClient client, RestRequest request, PolicyResult policyResult, CancellationToken cancellationToken = default) + { + if (policyResult.Outcome == OutcomeType.Successful) + { + return await client.Deserialize(policyResult.Result, cancellationToken); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; + }; + + Func>> getResponse = (client) => + { + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicyAsync(client, request, policyResult); + } + else + { + return Task.FromResult(client.Execute(request)); + } + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); + } + + {{#supportsAsync}} + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; + + Func>> getResponse = async (client) => + { + {{#supportsRetry}} + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken); + } + else + { + {{/supportsRetry}} + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + {{#supportsRetry}} + } + {{/supportsRetry}} + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration); + } + + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); + } + #endregion IAsynchronousClient + {{/supportsAsync}} + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config); + } + #endregion ISynchronousClient + } +} diff --git a/templates-v7/csharp/Configuration.mustache b/templates-v7/csharp/Configuration.mustache index 069758033..39dbd9c03 100644 --- a/templates-v7/csharp/Configuration.mustache +++ b/templates-v7/csharp/Configuration.mustache @@ -603,7 +603,7 @@ namespace {{packageName}}.Client if (inputVariables.ContainsKey(variable.Key)) { - if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + if (!serverVariables.ContainsKey("enum_values") || ((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) { url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); } diff --git a/templates-v7/csharp/Configuration.v790.mustache b/templates-v7/csharp/Configuration.v790.mustache new file mode 100644 index 000000000..2753aafb3 --- /dev/null +++ b/templates-v7/csharp/Configuration.v790.mustache @@ -0,0 +1,737 @@ +{{>partial_header}} + +using System; +{{^net35}} +using System.Collections.Concurrent; +{{/net35}} +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Net.Http; +using System.Net.Security; +{{#useRestSharp}} +{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +{{/useRestSharp}} + +namespace {{packageName}}.Client +{ + /// + /// Represents a set of configuration settings + /// + {{>visibility}} class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "{{packageVersion}}"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent, response.Headers); + } + {{^netStandard}} + if (status == 0) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); + } + {{/netStandard}} + return null; + }; + + #endregion Static Members + + #region Private Members + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + private bool _useDefaultCredentials = false; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for accessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + {{#servers.0}} + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + {{/servers.0}} + + /// + /// Gets or sets the operation servers defined in the OpenAPI spec. + /// + /// The operation servers + private IReadOnlyDictionary>> _operationServers; + + {{#hasHttpSignatureMethods}} + + /// + /// HttpSigning configuration + /// + private HttpSigningConfiguration _HttpSigningConfiguration = null; + {{/hasHttpSignatureMethods}} + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration() + { + Proxy = null; + UserAgent = WebUtility.UrlEncode("{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"); + BasePath = "{{{basePath}}}"; + DefaultHeaders = new {{^net35}}Concurrent{{/net35}}Dictionary(); + ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); + ApiKeyPrefix = new {{^net35}}Concurrent{{/net35}}Dictionary(); + {{#servers}} + {{#-first}} + Servers = new List>() + { + {{/-first}} + { + new Dictionary { + {"url", "{{{url}}}"}, + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, + {{#variables}} + {{#-first}} + { + "variables", new Dictionary { + {{/-first}} + { + "{{{name}}}", new Dictionary { + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, + {"default_value", {{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}"{{{defaultValue}}}"}, + {{#enumValues}} + {{#-first}} + { + "enum_values", new List() { + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + } + } + {{/-last}} + {{/enumValues}} + } + }{{^-last}},{{/-last}} + {{#-last}} + } + } + {{/-last}} + {{/variables}} + } + }{{^-last}},{{/-last}} + {{#-last}} + }; + {{/-last}} + {{/servers}} + OperationServers = new Dictionary>>() + { + {{#apiInfo}} + {{#apis}} + {{#operations}} + {{#operation}} + {{#servers.0}} + { + "{{{classname}}}.{{{nickname}}}", new List> + { + {{#servers}} + { + new Dictionary + { + {"url", "{{{url}}}"}, + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"} + } + }, + {{/servers}} + } + }, + {{/servers.0}} + {{/operation}} + {{/operations}} + {{/apis}} + {{/apiInfo}} + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "{{{basePath}}}") : this() + { + if (string.{{^net35}}IsNullOrWhiteSpace{{/net35}}{{#net35}}IsNullOrEmpty{{/net35}}(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeaders) + { + DefaultHeaders.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + #endregion Constructors + + #region Properties + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath + { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// + public virtual int Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + string apiKeyValue; + ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); + string apiKeyPrefix; + if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) + { + return apiKeyPrefix + " " + apiKeyValue; + } + + return apiKeyValue; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + {{#useRestSharp}} + {{#hasOAuthMethods}} + /// + /// Gets or sets the token URL for OAuth2 authentication. + /// + /// The OAuth Token URL. + public virtual string OAuthTokenUrl { get; set; } + + /// + /// Gets or sets the client ID for OAuth2 authentication. + /// + /// The OAuth Client ID. + public virtual string OAuthClientId { get; set; } + + /// + /// Gets or sets the client secret for OAuth2 authentication. + /// + /// The OAuth Client Secret. + public virtual string OAuthClientSecret { get; set; } + + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string{{nrt?}} OAuthScope { get; set; } + + /// + /// Gets or sets the flow for OAuth2 authentication. + /// + /// The OAuth Flow. + public virtual OAuthFlow? OAuthFlow { get; set; } + + {{/hasOAuthMethods}} + {{/useRestSharp}} + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// Whatever you set here will be prepended to the value defined in AddApiKey. + /// + /// An example invocation here might be: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + {{#servers.0}} + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Gets or sets the operation servers. + /// + /// The operation servers. + public virtual IReadOnlyDictionary>> OperationServers + { + get { return _operationServers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Operation servers may not be null."); + } + _operationServers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(Servers, index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + return GetServerUrl(Servers, index, inputVariables); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index) + { + return GetOperationServerUrl(operation, index, null); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) + { + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) + { + return GetServerUrl(operationServer, index, inputVariables); + } + + return null; + } + + /// + /// Returns URL based on server settings. + /// + /// Dictionary of server settings. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) + { + if (index < 0 || index >= servers.Count) + { + throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); + } + + if (inputVariables == null) + { + inputVariables = new Dictionary(); + } + + IReadOnlyDictionary server = servers[index]; + string url = (string)server["url"]; + + if (server.ContainsKey("variables")) + { + // go through each variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + { + url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); + } + else + { + throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); + } + } + else + { + // use default value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + } + + return url; + } + {{/servers.0}} + {{#hasHttpSignatureMethods}} + + /// + /// Gets and Sets the HttpSigningConfiguration + /// + public HttpSigningConfiguration HttpSigningConfiguration + { + get { return _HttpSigningConfiguration; } + set { _HttpSigningConfiguration = value; } + } + {{/hasHttpSignatureMethods}} + + /// + /// Gets and Sets the RemoteCertificateValidationCallback + /// + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + public static string ToDebugReport() + { + string report = "C# SDK ({{{packageName}}}) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: {{{version}}}\n"; + report += " SDK Package Version: {{{packageVersion}}}\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; + foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; + + var config = new Configuration + { + ApiKey = apiKey, + ApiKeyPrefix = apiKeyPrefix, + DefaultHeaders = defaultHeaders, + BasePath = second.BasePath ?? first.BasePath, + Timeout = second.Timeout, + Proxy = second.Proxy ?? first.Proxy, + UserAgent = second.UserAgent ?? first.UserAgent, + Username = second.Username ?? first.Username, + Password = second.Password ?? first.Password, + AccessToken = second.AccessToken ?? first.AccessToken, + {{#useRestSharp}} + {{#hasOAuthMethods}} + OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, + OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, + OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, + OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, + {{/hasOAuthMethods}} + {{/useRestSharp}} + {{#hasHttpSignatureMethods}} + HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, + {{/hasHttpSignatureMethods}} + TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, + DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, + ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, + UseDefaultCredentials = second.UseDefaultCredentials, + RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, + }; + return config; + } + #endregion Static Members + } +} diff --git a/templates-v7/csharp/HttpSigningConfiguration.mustache b/templates-v7/csharp/HttpSigningConfiguration.mustache index 97b855dc5..2d56fde4a 100644 --- a/templates-v7/csharp/HttpSigningConfiguration.mustache +++ b/templates-v7/csharp/HttpSigningConfiguration.mustache @@ -134,7 +134,7 @@ namespace {{packageName}}.Client { #if (NETCOREAPP) string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = framework.StartsWith(".NET 9") ? parameter.Key : {{#net90OrLater}}HttpUtility.UrlEncode({{/net90OrLater}}parameter.Key{{#net90OrLater}}){{/net90OrLater}}; if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) diff --git a/templates-v7/csharp/IAsynchronousClient.mustache b/templates-v7/csharp/IAsynchronousClient.mustache index 76ddd4adb..d68e87bb9 100644 --- a/templates-v7/csharp/IAsynchronousClient.mustache +++ b/templates-v7/csharp/IAsynchronousClient.mustache @@ -21,7 +21,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the POST http verb. @@ -32,7 +32,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -43,7 +43,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -54,7 +54,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -65,7 +65,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -76,7 +76,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -87,6 +87,6 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); } } diff --git a/templates-v7/csharp/IReadableConfiguration.v790.mustache b/templates-v7/csharp/IReadableConfiguration.v790.mustache new file mode 100644 index 000000000..5981728b4 --- /dev/null +++ b/templates-v7/csharp/IReadableConfiguration.v790.mustache @@ -0,0 +1,178 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; +{{#useRestSharp}} +{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +{{/useRestSharp}} + +namespace {{packageName}}.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + {{#useRestSharp}} + {{#hasOAuthMethods}} + /// + /// Gets the OAuth token URL. + /// + /// OAuth Token URL. + string OAuthTokenUrl { get; } + + /// + /// Gets the OAuth client ID. + /// + /// OAuth Client ID. + string OAuthClientId { get; } + + /// + /// Gets the OAuth client secret. + /// + /// OAuth Client Secret. + string OAuthClientSecret { get; } + + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string{{nrt?}} OAuthScope { get; } + + /// + /// Gets the OAuth flow. + /// + /// OAuth Flow. + OAuthFlow? OAuthFlow { get; } + + {{/hasOAuthMethods}} + {{/useRestSharp}} + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time format. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + [Obsolete("Use DefaultHeaders instead.")] + IDictionary DefaultHeader { get; } + + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout (in milliseconds) + /// + /// HTTP connection timeout. + int Timeout { get; } + + /// + /// Gets the proxy. + /// + /// Proxy. + WebProxy Proxy { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + bool UseDefaultCredentials { get; } + + /// + /// Get the servers associated with the operation. + /// + /// Operation servers. + IReadOnlyDictionary>> OperationServers { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// + /// Gets the Operation server url at the provided index. + /// + /// Operation server name. + /// Index of the operation server settings. + /// + string GetOperationServerUrl(string operation, int index); + + /// + /// Gets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + X509CertificateCollection ClientCertificates { get; } + {{#hasHttpSignatureMethods}} + + /// + /// Gets the HttpSigning configuration + /// + HttpSigningConfiguration HttpSigningConfiguration { get; } + {{/hasHttpSignatureMethods}} + + /// + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } + } +} diff --git a/templates-v7/csharp/api.mustache b/templates-v7/csharp/api.mustache index 527434ba1..7093752ea 100644 --- a/templates-v7/csharp/api.mustache +++ b/templates-v7/csharp/api.mustache @@ -38,7 +38,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); /// /// {{summary}} @@ -53,7 +53,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); {{/operation}} #endregion Synchronous Operations } @@ -82,7 +82,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// {{summary}} @@ -100,7 +100,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); {{/operation}} #endregion Asynchronous Operations } @@ -244,7 +244,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} @@ -260,7 +260,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) { {{#allParams}} {{#required}} @@ -513,7 +513,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false);{{/returnType}} @@ -532,7 +532,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { {{#allParams}} {{#required}} diff --git a/templates-v7/csharp/api_doc.mustache b/templates-v7/csharp/api_doc.mustache index da1654635..ca85bfa7f 100644 --- a/templates-v7/csharp/api_doc.mustache +++ b/templates-v7/csharp/api_doc.mustache @@ -21,6 +21,7 @@ All URIs are relative to *{{{basePath}}}* {{{.}}}{{/notes}} +{{^useGenericHost}} ### Example ```csharp using System.Collections.Generic; @@ -122,6 +123,7 @@ catch (ApiException e) Debug.Print(e.StackTrace); } ``` +{{/useGenericHost}} ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} diff --git a/templates-v7/csharp/git_push.sh.mustache b/templates-v7/csharp/git_push.sh.mustache new file mode 100644 index 000000000..0e3776ae6 --- /dev/null +++ b/templates-v7/csharp/git_push.sh.mustache @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache b/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache index 394c65720..71f4e9380 100644 --- a/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache +++ b/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache @@ -1,2 +1,2 @@ if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); \ No newline at end of file + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); diff --git a/templates-v7/csharp/libraries/generichost/ApiException.mustache b/templates-v7/csharp/libraries/generichost/ApiException.mustache index c14c1010f..ffc90cf11 100644 --- a/templates-v7/csharp/libraries/generichost/ApiException.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiException.mustache @@ -1,5 +1,6 @@ // {{>partial_header}} + {{#nrt}} #nullable enable diff --git a/templates-v7/csharp/libraries/generichost/ApiResponseEventArgs.mustache b/templates-v7/csharp/libraries/generichost/ApiResponseEventArgs`1.mustache similarity index 100% rename from templates-v7/csharp/libraries/generichost/ApiResponseEventArgs.mustache rename to templates-v7/csharp/libraries/generichost/ApiResponseEventArgs`1.mustache diff --git a/templates-v7/csharp/libraries/generichost/ApiResponse.mustache b/templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache similarity index 77% rename from templates-v7/csharp/libraries/generichost/ApiResponse.mustache rename to templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache index 1b12e4173..3ac107fa7 100644 --- a/templates-v7/csharp/libraries/generichost/ApiResponse.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache @@ -1,5 +1,6 @@ // {{>partial_header}} + {{#nrt}} #nullable enable @@ -32,6 +33,11 @@ namespace {{packageName}}.{{clientPackage}} /// The raw content of this response. /// string RawContent { get; } + + /// + /// The raw binary stream (only set for binary responses) + /// + System.IO.Stream{{nrt?}} ContentStream { get; } /// /// The DateTime when the request was retrieved. @@ -80,6 +86,11 @@ namespace {{packageName}}.{{clientPackage}} /// public string RawContent { get; protected set; } + /// + /// The raw binary stream (only set for binary responses) + /// + public System.IO.Stream{{nrt?}} ContentStream { get; protected set; } + /// /// The IsSuccessStatusCode from the api response /// @@ -143,6 +154,30 @@ namespace {{packageName}}.{{clientPackage}} OnCreated(httpRequestMessage, httpResponseMessage); } + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + ContentStream = contentStream; + RawContent = string.Empty; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); } {{#x-http-statuses-with-return}} diff --git a/templates-v7/csharp/libraries/generichost/ApiTestsBase.mustache b/templates-v7/csharp/libraries/generichost/ApiTestsBase.mustache index c71bc79b9..789de490e 100644 --- a/templates-v7/csharp/libraries/generichost/ApiTestsBase.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiTestsBase.mustache @@ -11,6 +11,7 @@ using {{packageName}}.Extensions; {{>testInstructions}} + namespace {{packageName}}.Test.{{apiPackage}} { /// diff --git a/templates-v7/csharp/libraries/generichost/AsModel.mustache b/templates-v7/csharp/libraries/generichost/AsModel.mustache index 96bedfa46..3c3d96a3f 100644 --- a/templates-v7/csharp/libraries/generichost/AsModel.mustache +++ b/templates-v7/csharp/libraries/generichost/AsModel.mustache @@ -1,4 +1,4 @@ // This logic may be modified with the AsModel.mustache template return Is{{vendorExtensions.x-http-status}} - ? System.Text.Json.JsonSerializer.Deserialize<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}>(RawContent, _jsonSerializerOptions) + ? {{#isBinary}}ContentStream{{/isBinary}}{{^isBinary}}System.Text.Json.JsonSerializer.Deserialize<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}>(RawContent, _jsonSerializerOptions){{/isBinary}} : {{#net60OrLater}}null{{/net60OrLater}}{{^net60OrLater}}default{{/net60OrLater}}; diff --git a/templates-v7/csharp/libraries/generichost/DateOnlyJsonConverter.mustache b/templates-v7/csharp/libraries/generichost/DateOnlyJsonConverter.mustache index 209979c8d..1441421aa 100644 --- a/templates-v7/csharp/libraries/generichost/DateOnlyJsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/DateOnlyJsonConverter.mustache @@ -17,6 +17,7 @@ namespace {{packageName}}.{{clientPackage}} /// public static string[] Formats { get; } = { {{>DateFormats}} + }; /// diff --git a/templates-v7/csharp/libraries/generichost/DateOnlyNullableJsonConverter.mustache b/templates-v7/csharp/libraries/generichost/DateOnlyNullableJsonConverter.mustache index 17c847365..53fdfbee7 100644 --- a/templates-v7/csharp/libraries/generichost/DateOnlyNullableJsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/DateOnlyNullableJsonConverter.mustache @@ -17,6 +17,7 @@ namespace {{packageName}}.{{clientPackage}} /// public static string[] Formats { get; } = { {{>DateFormats}} + }; /// diff --git a/templates-v7/csharp/libraries/generichost/DateTimeJsonConverter.mustache b/templates-v7/csharp/libraries/generichost/DateTimeJsonConverter.mustache index c5187f508..bf5059fca 100644 --- a/templates-v7/csharp/libraries/generichost/DateTimeJsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/DateTimeJsonConverter.mustache @@ -17,6 +17,7 @@ namespace {{packageName}}.{{clientPackage}} /// public static string[] Formats { get; } = { {{>DateTimeFormats}} + }; /// diff --git a/templates-v7/csharp/libraries/generichost/DateTimeNullableJsonConverter.mustache b/templates-v7/csharp/libraries/generichost/DateTimeNullableJsonConverter.mustache index 646c72947..bbc036490 100644 --- a/templates-v7/csharp/libraries/generichost/DateTimeNullableJsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/DateTimeNullableJsonConverter.mustache @@ -17,6 +17,7 @@ namespace {{packageName}}.{{clientPackage}} /// public static string[] Formats { get; } = { {{>DateTimeFormats}} + }; /// diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 1333f0e67..03dd95e59 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -80,8 +80,7 @@ namespace {{packageName}}.{{clientPackage}} {{/useSourceGeneration}} _services.AddSingleton();{{#apiInfo}}{{#apis}} - _services.AddSingleton<{{classname}}Events>(); - _services.AddTransient<{{interfacePrefix}}{{classname}}, {{classname}}>();{{/apis}}{{/apiInfo}} + _services.AddSingleton<{{classname}}Events>();{{/apis}}{{/apiInfo}} } /// diff --git a/templates-v7/csharp/libraries/generichost/HttpSigningConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HttpSigningConfiguration.mustache index 357626fcc..8b69a8c0b 100644 --- a/templates-v7/csharp/libraries/generichost/HttpSigningConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HttpSigningConfiguration.mustache @@ -1,5 +1,6 @@ // {{>partial_header}} + {{#nrt}} #nullable enable diff --git a/templates-v7/csharp/libraries/generichost/IApi.mustache b/templates-v7/csharp/libraries/generichost/IApi.mustache index 3f3f3013b..af31cffe9 100644 --- a/templates-v7/csharp/libraries/generichost/IApi.mustache +++ b/templates-v7/csharp/libraries/generichost/IApi.mustache @@ -10,6 +10,6 @@ namespace {{packageName}}.{{apiPackage}} /// /// The HttpClient /// - System.Net.Http.HttpClient HttpClient { get; } + HttpClient HttpClient { get; } } } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index 0ff2753e3..24810c9ce 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -179,39 +179,38 @@ {{^isMap}} {{^isEnum}} {{^isUuid}} + {{#isDecimal}} + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDecimal()); + {{/isDecimal}} + {{^isDecimal}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetString(){{^isNullable}}{{nrt!}}{{/isNullable}}); + {{/isDecimal}} {{/isUuid}} {{/isEnum}} {{/isMap}} {{/isString}} {{#isBoolean}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetBoolean()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); {{/isBoolean}} {{#isNumeric}} {{^isEnum}} {{#isDouble}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDouble()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); {{/isDouble}} {{#isDecimal}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDecimal()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); {{/isDecimal}} {{#isFloat}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}(float)utf8JsonReader.GetDouble()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); {{/isFloat}} {{#isLong}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? ({{#vendorExtensions.x-unsigned}}u{{/vendorExtensions.x-unsigned}}long?)null : utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64()); {{/isLong}} {{^isLong}} {{^isFloat}} {{^isDecimal}} {{^isDouble}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? ({{#vendorExtensions.x-unsigned}}u{{/vendorExtensions.x-unsigned}}int?)null : utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); {{/isDouble}} {{/isDecimal}} {{/isFloat}} @@ -219,18 +218,15 @@ {{/isEnum}} {{/isNumeric}} {{#isDate}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{#supportsDateOnly}}DateOnly{{/supportsDateOnly}}{{^supportsDateOnly}}DateTime{{/supportsDateOnly}}{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions)); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{#supportsDateOnly}}DateOnly{{/supportsDateOnly}}{{^supportsDateOnly}}DateTime{{/supportsDateOnly}}{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions)); {{/isDate}} {{#isDateTime}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); {{/isDateTime}} {{#isEnum}} {{^isMap}} {{#isNumeric}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}})utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? ({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}?)null : ({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}})utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); {{/isNumeric}} {{^isNumeric}} string{{nrt?}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = utf8JsonReader.GetString(); @@ -246,8 +242,7 @@ {{/isMap}} {{/isEnum}} {{#isUuid}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetGuid()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); {{/isUuid}} {{^isUuid}} {{^isEnum}} @@ -256,8 +251,7 @@ {{^isNumeric}} {{^isDate}} {{^isDateTime}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions){{^isNullable}}{{nrt!}}{{/isNullable}}); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions){{^isNullable}}{{nrt!}}{{/isNullable}}); {{/isDateTime}} {{/isDate}} {{/isNumeric}} @@ -290,6 +284,7 @@ {{^vendorExtensions.x-duplicated-data-type}} {{#model.discriminator}} {{#model.hasDiscriminatorWithNonEmptyMapping}} + {{^model.composedSchemas.anyOf}} {{#mappedModels}} if ({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}} != null) return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); @@ -298,14 +293,15 @@ throw new JsonException(); {{/-last}} {{/mappedModels}} + {{/model.composedSchemas.anyOf}} {{/model.hasDiscriminatorWithNonEmptyMapping}} {{/model.discriminator}} {{^composedSchemas.oneOf}} {{^required}} {{#model.composedSchemas.anyOf}} - Option<{{baseType}}{{>NullConditionalProperty}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null + Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null ? default - : new Option<{{baseType}}{{>NullConditionalProperty}}>({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); + : new Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); {{/model.composedSchemas.anyOf}} {{#-last}} @@ -397,11 +393,17 @@ {{#isNumeric}} writer.WriteNumber("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); {{/isNumeric}} + {{#isEnum}} + { + {{datatypeWithEnum}}JsonConverter {{#lambda.camelcase}}{{datatypeWithEnum}}{{/lambda.camelcase}}JsonConverter = ({{datatypeWithEnum}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}.GetType())); + {{#lambda.camelcase}}{{datatypeWithEnum}}{{/lambda.camelcase}}JsonConverter.Write{{^isEnumRef}}Properties{{/isEnumRef}}(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}, jsonSerializerOptions); + } + {{/isEnum}} {{/isPrimitiveType}} {{^isPrimitiveType}} { - {{datatypeWithEnum}}JsonConverter {{datatypeWithEnum}}JsonConverter = ({{datatypeWithEnum}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}.GetType())); - {{datatypeWithEnum}}JsonConverter.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}, jsonSerializerOptions); + {{datatypeWithEnum}}JsonConverter {{#lambda.camelcase}}{{datatypeWithEnum}}{{/lambda.camelcase}}JsonConverter = ({{datatypeWithEnum}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}.GetType())); + {{#lambda.camelcase}}{{datatypeWithEnum}}{{/lambda.camelcase}}JsonConverter.Write{{^isEnumRef}}Properties{{/isEnumRef}}(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}, jsonSerializerOptions); } {{/isPrimitiveType}} @@ -450,10 +452,15 @@ {{^isEnum}} {{^isUuid}} {{#lambda.copyText}} + {{#isDecimal}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}.ToString()); + {{/isDecimal}} + {{^isDecimal}} writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}); + {{/isDecimal}} {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isUuid}} {{/isEnum}} @@ -464,7 +471,7 @@ writer.WriteBoolean("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isBoolean}} {{^isEnum}} @@ -473,7 +480,7 @@ writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isNumeric}} {{/isEnum}} @@ -482,7 +489,7 @@ writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isDate}} {{#isDateTime}} @@ -490,7 +497,7 @@ writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isDateTime}} {{#isEnum}} @@ -499,7 +506,7 @@ writer.WriteNumber("{{baseName}}", {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}})); {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isNumeric}} {{^isMap}} @@ -590,7 +597,7 @@ writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isUuid}} {{^isUuid}} diff --git a/templates-v7/csharp/libraries/generichost/ModelSignature.mustache b/templates-v7/csharp/libraries/generichost/ModelSignature.mustache index 398e62b0a..39aa11f82 100644 --- a/templates-v7/csharp/libraries/generichost/ModelSignature.mustache +++ b/templates-v7/csharp/libraries/generichost/ModelSignature.mustache @@ -1 +1 @@ -{{#model.allVars}}{{^isDiscriminator}}{{{datatypeWithEnum}}}{{>NullConditionalProperty}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}{{#defaultValue}} = {{^required}}default{{/required}}{{#required}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{.}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/required}}{{/defaultValue}}{{^defaultValue}}{{#lambda.first}}{{#isNullable}} = default {{/isNullable}}{{^required}} = default {{/required}}{{/lambda.first}}{{/defaultValue}} {{/isDiscriminator}}{{/model.allVars}} +{{#model.allVars}}{{^isDiscriminator}}{{^required}}Option<{{/required}}{{{datatypeWithEnum}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}{{#defaultValue}} = {{^required}}default{{/required}}{{#required}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{.}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/required}}{{/defaultValue}}{{^defaultValue}}{{#lambda.first}}{{#isNullable}} = default {{/isNullable}}{{^required}} = default {{/required}}{{/lambda.first}}{{/defaultValue}} {{/isDiscriminator}}{{/model.allVars}} diff --git a/templates-v7/csharp/libraries/generichost/NullConditionalParameter.mustache b/templates-v7/csharp/libraries/generichost/NullConditionalParameter.mustache deleted file mode 100644 index d8ad92666..000000000 --- a/templates-v7/csharp/libraries/generichost/NullConditionalParameter.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isNullable}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/NullConditionalProperty.mustache b/templates-v7/csharp/libraries/generichost/NullConditionalProperty.mustache deleted file mode 100644 index 7dcafa803..000000000 --- a/templates-v7/csharp/libraries/generichost/NullConditionalProperty.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#lambda.first}}{{#isNullable}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/Option.mustache b/templates-v7/csharp/libraries/generichost/Option.mustache index eed49143e..8b33bdb51 100644 --- a/templates-v7/csharp/libraries/generichost/Option.mustache +++ b/templates-v7/csharp/libraries/generichost/Option.mustache @@ -1,5 +1,6 @@ // {{>partial_header}} + {{#nrt}} #nullable enable diff --git a/templates-v7/csharp/libraries/generichost/README.client.mustache b/templates-v7/csharp/libraries/generichost/README.client.mustache index 371b9daa9..6ea118b08 100644 --- a/templates-v7/csharp/libraries/generichost/README.client.mustache +++ b/templates-v7/csharp/libraries/generichost/README.client.mustache @@ -1,58 +1,51 @@ # Created with Openapi Generator -## Run the following powershell command to generate the library - -```ps1 -$properties = @( - 'apiName={{apiName}}', - 'targetFramework={{targetFramework}}', - 'validatable={{validatable}}', - 'nullableReferenceTypes={{nullableReferenceTypes}}', - 'hideGenerationTimestamp={{hideGenerationTimestamp}}', - 'packageVersion={{packageVersion}}', - 'packageAuthors={{packageAuthors}}', - 'packageCompany={{packageCompany}}', - 'packageCopyright={{packageCopyright}}', - 'packageDescription={{packageDescription}}',{{#licenseId}} - 'licenseId={{.}}',{{/licenseId}} - 'packageName={{packageName}}', - 'packageTags={{packageTags}}', - 'packageTitle={{packageTitle}}' -) -join "," - -$global = @( - 'apiDocs={{generateApiDocs}}', - 'modelDocs={{generateModelDocs}}', - 'apiTests={{generateApiTests}}', - 'modelTests={{generateModelTests}}' -) -join "," - -java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` - -g csharp-netcore ` - -i .yaml ` - -o ` - --library generichost ` - --additional-properties $properties ` - --global-property $global ` - --git-host "{{gitHost}}" ` - --git-repo-id "{{gitRepoId}}" ` - --git-user-id "{{gitUserId}}" ` - --release-note "{{releaseNote}}" - # -t templates +## Creating the library +Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml` + +```yaml +generatorName: csharp +inputSpec: {{inputSpec}} +outputDir: out + +# https://openapi-generator.tech/docs/generators/csharp +additionalProperties: + packageGuid: '{{packageGuid}}' + +# https://openapi-generator.tech/docs/integrations/#github-integration +# gitHost: +# gitUserId: +# gitRepoId: + +# https://openapi-generator.tech/docs/globals +# globalProperties: + +# https://openapi-generator.tech/docs/customization/#inline-schema-naming +# inlineSchemaOptions: + +# https://openapi-generator.tech/docs/customization/#name-mapping +# modelNameMappings: +# nameMappings: + +# https://openapi-generator.tech/docs/customization/#openapi-normalizer +# openapiNormalizer: + +# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates + +# releaseNote: ``` ## Using the library in your project ```cs -using System; -using System.Threading.Tasks; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.DependencyInjection; using {{packageName}}.Api; using {{packageName}}.Client; using {{packageName}}.Model; +using Org.OpenAPITools.Extensions; namespace YourProject { @@ -60,14 +53,17 @@ namespace YourProject { public static async Task Main(string[] args) { - var host = CreateHostBuilder(args).Build();{{#apiInfo}}{{#apis}}{{#-first}} + var host = CreateHostBuilder(args).Build(); + {{#apiInfo}} + {{#apis}} + {{#-first}} var api = host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); {{#operations}} {{#-first}} {{#operation}} {{#-first}} - {{operationId}}ApiResponse apiResponse = await api.{{operationId}}Async("todo"); - {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}} model = apiResponse.Ok(); + {{interfacePrefix}}{{operationId}}ApiResponse apiResponse = await api.{{operationId}}Async("todo"); + {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}} model = apiResponse.Ok(); {{/-first}} {{/operation}} {{/-first}} @@ -78,16 +74,17 @@ namespace YourProject } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) - .Configure{{apiName}}((context, options) => + .Configure{{apiName}}((context, services, options) => { {{#authMethods}} {{#-first}} - // the type of token here depends on the api security specifications - ApiKeyToken token = new("", ClientUtils.ApiKeyHeader.Authorization); + // The type of token here depends on the api security specifications + // Available token types are ApiKeyToken, BasicToken, BearerToken, HttpSigningToken, and OAuthToken. + BearerToken token = new(""); options.AddTokens(token); // optionally choose the method the tokens will be provided with, default is RateLimitProvider - options.UseProvider, ApiKeyToken>(); + options.UseProvider, BearerToken>(); {{/-first}} {{/authMethods}} @@ -96,11 +93,17 @@ namespace YourProject // your custom converters if any }); - options.Add{{apiName}}HttpClients(builder: builder => builder - .AddRetryPolicy(2) - .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) - .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) - // add whatever middleware you prefer + options.Add{{apiName}}HttpClients(client => + { + // client configuration + }, builder => + { + builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)); + // add whatever middleware you prefer + } ); }); } @@ -110,136 +113,28 @@ namespace YourProject ## Questions - What about HttpRequest failures and retries? - If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. + Configure Polly in the IHttpClientBuilder - How are tokens used? Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. Other providers can be used with the UseProvider method. - Does an HttpRequest throw an error when the server response is not Ok? - It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. StatusCode and ReasonPhrase will contain information about the error. If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. - How do I validate requests and process responses? - Use the provided On and After methods in the Api class from the namespace {{packageName}}.Rest.DefaultApi. - Or provide your own class by using the generic Configure{{apiName}} method. - - -## Dependencies - -- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later -- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later{{#supportsRetry}} -- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later{{/supportsRetry}}{{#useCompareNetObjects}} -- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later{{/useCompareNetObjects}}{{#validatable}} -- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later{{/validatable}}{{#apiDocs}} - - -## Documentation for API Endpoints - -All URIs are relative to *{{{basePath}}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | -------------{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} -*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}{{/apiDocs}}{{#modelDocs}} - - -## Documentation for Models - -{{#modelPackage}}{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md){{/model}}{{/models}}{{/modelPackage}} -{{^modelPackage}}No model defined in this package{{/modelPackage}}{{/modelDocs}} - - -## Documentation for Authorization - -{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} -{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} -{{#authMethods}} - -### {{name}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{keyParamName}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasicBasic}} -- **Type**: HTTP basic authentication -{{/isBasicBasic}} -{{#isBasicBearer}} -- **Type**: Bearer Authentication -{{/isBasicBearer}} -{{#isHttpSignature}} -- **Type**: HTTP signature authentication -{{/isHttpSignature}} -{{#isOAuth}} -- **Type**: OAuth -- **Flow**: {{flow}} -- **Authorization URL**: {{authorizationUrl}} -- **Scopes**: {{^scopes}}N/A{{/scopes}}{{#scopes}} -- {{scope}}: {{description}}{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} + Use the provided On and After partial methods in the api classes. + +## Api Information +- appName: {{appName}} +- appVersion: {{appVersion}} +- appDescription: {{appDescription}} ## Build +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. + - SDK version: {{packageVersion}} {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} - Generator version: {{generatorVersion}} - Build package: {{generatorClass}} - -## Api Information -- appName: {{appName}} -- appVersion: {{appVersion}} -- appDescription: {{appDescription}} - -## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) -- generateAliasAsModel: {{generateAliasAsModel}} -- supportingFiles: {{supportingFiles}} -- models: omitted for brevity -- apis: omitted for brevity -- apiDocs: {{generateApiDocs}} -- modelDocs: {{generateModelDocs}} -- apiTests: {{generateApiTests}} -- modelTests: {{generateModelTests}} - -## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) -- allowUnicodeIdentifiers: {{allowUnicodeIdentifiers}} -- apiName: {{apiName}} -- caseInsensitiveResponseHeaders: {{caseInsensitiveResponseHeaders}} -- conditionalSerialization: {{conditionalSerialization}} -- disallowAdditionalPropertiesIfNotPresent: {{disallowAdditionalPropertiesIfNotPresent}} -- gitHost: {{gitHost}} -- gitRepoId: {{gitRepoId}} -- gitUserId: {{gitUserId}} -- hideGenerationTimestamp: {{hideGenerationTimestamp}} -- interfacePrefix: {{interfacePrefix}} -- library: {{library}} -- licenseId: {{licenseId}} -- modelPropertyNaming: {{modelPropertyNaming}} -- netCoreProjectFile: {{netCoreProjectFile}} -- nonPublicApi: {{nonPublicApi}} -- nullableReferenceTypes: {{nullableReferenceTypes}} -- optionalAssemblyInfo: {{optionalAssemblyInfo}} -- optionalEmitDefaultValues: {{optionalEmitDefaultValues}} -- optionalMethodArgument: {{optionalMethodArgument}} -- optionalProjectFile: {{optionalProjectFile}} -- packageAuthors: {{packageAuthors}} -- packageCompany: {{packageCompany}} -- packageCopyright: {{packageCopyright}} -- packageDescription: {{packageDescription}} -- packageGuid: {{packageGuid}} -- packageName: {{packageName}} -- packageTags: {{packageTags}} -- packageTitle: {{packageTitle}} -- packageVersion: {{packageVersion}} -- releaseNote: {{releaseNote}} -- returnICollection: {{returnICollection}} -- sortParamsByRequiredFlag: {{sortParamsByRequiredFlag}} -- sourceFolder: {{sourceFolder}} -- targetFramework: {{targetFramework}} -- useCollection: {{useCollection}} -- useDateTimeOffset: {{useDateTimeOffset}} -- useOneOfDiscriminatorLookup: {{useOneOfDiscriminatorLookup}} -- validatable: {{validatable}}{{#infoUrl}} -For more information, please visit [{{{.}}}]({{{.}}}){{/infoUrl}} - -This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/templates-v7/csharp/libraries/generichost/README.solution.mustache b/templates-v7/csharp/libraries/generichost/README.solution.mustache index f9c1c7f74..cfe8a2c98 100644 --- a/templates-v7/csharp/libraries/generichost/README.solution.mustache +++ b/templates-v7/csharp/libraries/generichost/README.solution.mustache @@ -1 +1,2 @@ # Created with Openapi Generator +See the project's [REAMDE](src/{{packageName}}/README.md) \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/RateLimitProvider.mustache b/templates-v7/csharp/libraries/generichost/RateLimitProvider`1.mustache similarity index 77% rename from templates-v7/csharp/libraries/generichost/RateLimitProvider.mustache rename to templates-v7/csharp/libraries/generichost/RateLimitProvider`1.mustache index bafe525c0..7458dbd80 100644 --- a/templates-v7/csharp/libraries/generichost/RateLimitProvider.mustache +++ b/templates-v7/csharp/libraries/generichost/RateLimitProvider`1.mustache @@ -1,5 +1,6 @@ // {{>partial_header}} + {{#nrt}} #nullable enable @@ -63,9 +64,25 @@ namespace {{packageName}}.{{clientPackage}} {{/lambda.paste}} {{/hasApiKeyMethods}} - foreach(global::System.Threading.Channels.Channel tokens in AvailableTokens.Values) - for (int i = 0; i < _tokens.Length; i++) - _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + foreach (var availableToken in AvailableTokens) + foreach(TTokenBase token in _tokens) + { + {{#hasApiKeyMethods}} + if (token is ApiKeyToken apiKeyToken) + { + if (ClientUtils.ApiKeyHeaderToString(apiKeyToken.Header) == availableToken.Key) + { + token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); + } + } else + { + token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); + } + {{/hasApiKeyMethods}} + {{^hasApiKeyMethods}} + token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); + {{/hasApiKeyMethods}} + } } internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) diff --git a/templates-v7/csharp/libraries/generichost/TokenContainer.mustache b/templates-v7/csharp/libraries/generichost/TokenContainer`1.mustache similarity index 100% rename from templates-v7/csharp/libraries/generichost/TokenContainer.mustache rename to templates-v7/csharp/libraries/generichost/TokenContainer`1.mustache diff --git a/templates-v7/csharp/libraries/generichost/TokenProvider.mustache b/templates-v7/csharp/libraries/generichost/TokenProvider`1.mustache similarity index 99% rename from templates-v7/csharp/libraries/generichost/TokenProvider.mustache rename to templates-v7/csharp/libraries/generichost/TokenProvider`1.mustache index 7226551b7..9fc5f3ea0 100644 --- a/templates-v7/csharp/libraries/generichost/TokenProvider.mustache +++ b/templates-v7/csharp/libraries/generichost/TokenProvider`1.mustache @@ -1,5 +1,6 @@ // {{>partial_header}} + {{#nrt}} #nullable enable diff --git a/templates-v7/csharp/libraries/generichost/WriteProperty.mustache b/templates-v7/csharp/libraries/generichost/WriteProperty.mustache index 99659ac26..03b036f9a 100644 --- a/templates-v7/csharp/libraries/generichost/WriteProperty.mustache +++ b/templates-v7/csharp/libraries/generichost/WriteProperty.mustache @@ -1,9 +1,10 @@ {{#required}} {{>WritePropertyHelper}} + {{/required}} {{^required}} if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) {{#lambda.indent1}} - {{>WritePropertyHelper}} + {{>WritePropertyHelper}}{{! prevent indent}} {{/lambda.indent1}} {{/required}} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index d2dee1b48..2ebe38a29 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -1,6 +1,7 @@ {{#lambda.trimLineBreaks}} // {{>partial_header}} + {{#nrt}} #nullable enable @@ -170,7 +171,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// The HttpClient /// - public System.Net.Http.HttpClient HttpClient { get; } + public HttpClient HttpClient { get; } /// /// The class containing the events @@ -219,7 +220,7 @@ namespace {{packageName}}.{{apiPackage}} /// Initializes a new instance of the class. /// /// - public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, + public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}, TokenProvider basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}, @@ -243,7 +244,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} {{#-first}} - partial void Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{{dataType}}}{{>NullConditionalParameter}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + partial void Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{/-first}} {{/allParams}} @@ -255,7 +256,7 @@ namespace {{packageName}}.{{apiPackage}} /// {{/vendorExtensions.x-not-nullable-reference-types}} /// - private void Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{{dataType}}}{{>NullConditionalParameter}} {{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}) + private void Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}) { {{#lambda.trimTrailingWithNewLine}} {{#vendorExtensions.x-not-nullable-reference-types}} @@ -285,7 +286,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - private void After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{{dataType}}}{{>NullConditionalParameter}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + private void After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) { bool suppressDefaultLog = false; After{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); @@ -300,7 +301,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{{dataType}}}{{>NullConditionalParameter}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); /// /// Logs exceptions that occur while retrieving the server response @@ -311,11 +312,12 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{{dataType}}}{{>NullConditionalParameter}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) { bool suppressDefaultLogLocalVar = false; OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLogLocalVar exceptionLocalVar pathFormatLocalVar pathLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); {{>OnErrorDefaultImplementation}} + } /// @@ -328,7 +330,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLogLocalVar Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{{dataType}}}{{>NullConditionalParameter}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLogLocalVar Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); /// /// {{summary}} {{notes}} @@ -382,7 +384,9 @@ namespace {{packageName}}.{{apiPackage}} uriBuilderLocalVar.Host = HttpClient.BaseAddress{{nrt!}}.Host; uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{{path}}}"; + uriBuilderLocalVar.Path = HttpClient.BaseAddress.AbsolutePath == "/" + ? "{{{path}}}" + : string.Concat(HttpClient.BaseAddress.AbsolutePath, "{{{path}}}"); {{/servers}} {{#servers}} {{#-first}} @@ -619,11 +623,35 @@ namespace {{packageName}}.{{apiPackage}} using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); - ILogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse> apiResponseLoggerLocalVar = LoggerFactory.CreateLogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse>(); + {{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse apiResponseLocalVar; + + switch ((int)httpResponseMessageLocalVar.StatusCode) { + {{#responses}} + {{#isBinary}} + case ({{code}}): + {{/isBinary}} + {{/responses}} + {{#responses}} + {{#isBinary}} + {{#-first}} + { + byte[] responseBytesArrayLocalVar = await httpResponseMessageLocalVar.Content.ReadAsByteArrayAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); + System.IO.Stream responseContentStreamLocalVar = new System.IO.MemoryStream(responseBytesArrayLocalVar); + apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentStreamLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions); - {{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions); + break; + } + {{/-first}} + {{/isBinary}} + {{/responses}} + default: { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); + apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions); + + break; + } + } After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); @@ -712,6 +740,22 @@ namespace {{packageName}}.{{apiPackage}} OnCreated(httpRequestMessage, httpResponseMessage); } + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public {{operationId}}ApiResponse(ILogger<{{operationId}}ApiResponse> logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, contentStream, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); {{#responses}} @@ -751,7 +795,7 @@ namespace {{packageName}}.{{apiPackage}} { {{#lambda.trimTrailingWithNewLine}} {{#lambda.indent4}} - {{>AsModel}} + {{>AsModel}}{{! prevent indent}} {{/lambda.indent4}} {{/lambda.trimTrailingWithNewLine}} } @@ -784,7 +828,7 @@ namespace {{packageName}}.{{apiPackage}} OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); {{#lambda.trimTrailingWithNewLine}} {{#lambda.indent4}} - {{>OnDeserializationError}} + {{>OnDeserializationError}}{{! prevent indent}} {{/lambda.indent4}} {{/lambda.trimTrailingWithNewLine}} } diff --git a/templates-v7/csharp/libraries/generichost/api_test.mustache b/templates-v7/csharp/libraries/generichost/api_test.mustache index 02ce22168..32eb2b769 100644 --- a/templates-v7/csharp/libraries/generichost/api_test.mustache +++ b/templates-v7/csharp/libraries/generichost/api_test.mustache @@ -11,6 +11,7 @@ using {{packageName}}.{{modelPackage}};{{/hasImport}} {{>testInstructions}} + namespace {{packageName}}.Test.{{apiPackage}} { /// @@ -36,14 +37,18 @@ namespace {{packageName}}.Test.{{apiPackage}} {{#allParams}} {{^required}}Client.Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} = default{{nrt!}}; {{/allParams}} - {{#returnType}} + {{#responses}} + {{#-first}} + {{#dataType}} var response = await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - var model = response.{{#lambda.first}}{{#responses}}{{vendorExtensions.x-http-status}} {{/responses}}{{/lambda.first}}(); + var model = response.{{vendorExtensions.x-http-status}}(); Assert.IsType<{{{.}}}>(model); - {{/returnType}} - {{^returnType}} + {{/dataType}} + {{^dataType}} await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - {{/returnType}} + {{/dataType}} + {{/-first}} + {{/responses}} } {{/operation}} {{/operations}} diff --git a/templates-v7/csharp/libraries/generichost/git_push.ps1.mustache b/templates-v7/csharp/libraries/generichost/git_push.ps1.mustache new file mode 100644 index 000000000..f263c2bc5 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/git_push.ps1.mustache @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "{{{gitHost}}}", + [Parameter()][Alias("u")][String]$GitUserId = "{{{gitUserId}}}", + [Parameter()][Alias("r")][String]$GitRepoId = "{{{gitRepoId}}}", + [Parameter()][Alias("m")][string]$Message = "{{{releaseNote}}}", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/git_push.sh.mustache b/templates-v7/csharp/libraries/generichost/git_push.sh.mustache new file mode 100644 index 000000000..3d4b710dc --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/git_push.sh.mustache @@ -0,0 +1,49 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=${1:-{{{gitUserId}}}} +git_repo_id=${2:-{{{gitRepoId}}}} +release_note=${3:-{{{releaseNote}}}} +git_host=${4:-{{{gitHost}}}} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +git_remote=$(git remote) + +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/templates-v7/csharp/libraries/generichost/model.mustache b/templates-v7/csharp/libraries/generichost/model.mustache index f9931574d..a9f6c2e4c 100644 --- a/templates-v7/csharp/libraries/generichost/model.mustache +++ b/templates-v7/csharp/libraries/generichost/model.mustache @@ -1,5 +1,6 @@ // {{>partial_header}} + {{#nrt}} #nullable enable @@ -37,13 +38,17 @@ namespace {{packageName}}.{{modelPackage}} { {{#isEnum}} {{>modelEnum}} + {{/isEnum}} {{^isEnum}} {{>modelGeneric}} + {{>JsonConverter}} + {{/isEnum}} {{>SourceGenerationContext}} + {{/model}} {{/lambda.trimTrailingWithNewLine}} {{/models}} diff --git a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache index 04fb37138..93ca620dd 100644 --- a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache +++ b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache @@ -62,7 +62,7 @@ {{^composedSchemas.anyOf}} [JsonConstructor] {{/composedSchemas.anyOf}} - {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{baseType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{datatypeWithEnum}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { {{#composedSchemas.anyOf}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; @@ -97,12 +97,14 @@ {{#items}} {{^complexType}} {{>modelInnerEnum}} + {{/complexType}} {{/items}} {{/items.isEnum}} {{#isEnum}} {{^complexType}} {{>modelInnerEnum}} + {{/complexType}} {{/isEnum}} {{^isDiscriminator}} @@ -388,6 +390,7 @@ {{^parentModel}} {{>validatable}} + {{/parentModel}} {{/validatable}} } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/httpclient/ApiClient.mustache b/templates-v7/csharp/libraries/httpclient/ApiClient.mustache new file mode 100644 index 000000000..608378253 --- /dev/null +++ b/templates-v7/csharp/libraries/httpclient/ApiClient.mustache @@ -0,0 +1,792 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +{{^netStandard}} +using System.Web; +{{/netStandard}} +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using System.Net.Http; +using System.Net.Http.Headers; +{{#supportsRetry}} +using Polly; +{{/supportsRetry}} + +namespace {{packageName}}.Client +{ + /// + /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public async Task Deserialize(HttpResponseMessage response) + { + var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal async Task Deserialize(HttpResponseMessage response, Type type) + { + IList headers = new List(); + // process response headers, e.g. Access-Control-Allow-Methods + foreach (var responseHeader in response.Headers) + { + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + } + + // process response content headers, e.g. Content-Type + foreach (var responseHeader in response.Content.Headers) + { + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + } + + // RFC 2183 & RFC 2616 + var fileNameRegex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$", RegexOptions.IgnoreCase); + if (type == typeof(byte[])) // return byte array + { + return await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + } + else if (type == typeof(FileParameter)) + { + if (headers != null) { + foreach (var header in headers) + { + var match = fileNameRegex.Match(header.ToString()); + if (match.Success) + { + string fileName = ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + return new FileParameter(fileName, await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); + } + } + } + return new FileParameter(await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + if (headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? Path.GetTempPath() + : _configuration.TempFolderPath; + + foreach (var header in headers) + { + var match = fileNameRegex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(await response.Content.ReadAsStringAsync().ConfigureAwait(false), null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + /// + /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. + /// + {{>visibility}} partial class ApiClient : IDisposable, ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + { + private readonly string _baseUrl; + + private readonly HttpClientHandler _httpClientHandler; + private readonly HttpClient _httpClient; + private readonly bool _disposeClient; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + public ApiClient() : + this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) + { + } + + /// + /// Initializes a new instance of the . + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _httpClientHandler = new HttpClientHandler(); + _httpClient = new HttpClient(_httpClientHandler, true); + _disposeClient = true; + _baseUrl = basePath; + } + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + /// An instance of HttpClient. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public ApiClient(HttpClient client, HttpClientHandler handler = null) : + this(client, {{packageName}}.Client.GlobalConfiguration.Instance.BasePath, handler) + { + } + + /// + /// Initializes a new instance of the . + /// + /// An instance of HttpClient. + /// The target service's base path in URL format. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public ApiClient(HttpClient client, string basePath, HttpClientHandler handler = null) + { + if (client == null) throw new ArgumentNullException("client cannot be null"); + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _httpClientHandler = handler; + _httpClient = client; + _baseUrl = basePath; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + if(_disposeClient) { + _httpClient.Dispose(); + } + } + + /// Prepares multipart/form-data content + {{! TODO: Add handling of improper usage }} + HttpContent PrepareMultipartFormDataContent(RequestOptions options) + { + string boundary = "---------" + Guid.NewGuid().ToString().ToUpperInvariant(); + var multipartContent = new MultipartFormDataContent(boundary); + foreach (var formParameter in options.FormParameters) + { + multipartContent.Add(new StringContent(formParameter.Value), formParameter.Key); + } + + if (options.FileParameters != null && options.FileParameters.Count > 0) + { + foreach (var fileParam in options.FileParameters) + { + foreach (var file in fileParam.Value) + { + var content = new StreamContent(file.Content); + content.Headers.ContentType = new MediaTypeHeaderValue(file.ContentType); + multipartContent.Add(content, fileParam.Key, file.Name); + } + } + } + return multipartContent; + } + + /// + /// Provides all logic for constructing a new HttpRequestMessage. + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the a HttpRequestMessage. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new HttpRequestMessage instance. + /// + private HttpRequestMessage NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); + + builder.AddPathParameters(options.PathParameters); + + builder.AddQueryParameters(options.QueryParameters); + + HttpRequestMessage request = new HttpRequestMessage(method, builder.GetFullUri()); + + if (configuration.UserAgent != null) + { + request.Headers.TryAddWithoutValidation("User-Agent", configuration.UserAgent); + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.Headers.Add(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + // Todo make content headers actually content headers + request.Headers.TryAddWithoutValidation(headerParam.Key, value); + } + } + } + + List> contentList = new List>(); + + string contentType = null; + if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes.FirstOrDefault(); + } + + {{!// TODO Add error handling in case of improper usage}} + if (contentType == "multipart/form-data") + { + request.Content = PrepareMultipartFormDataContent(options); + } + else if (contentType == "application/x-www-form-urlencoded") + { + request.Content = new FormUrlEncodedContent(options.FormParameters); + } + else + { + if (options.Data != null) + { + if (options.Data is FileParameter fp) + { + contentType = contentType ?? "application/octet-stream"; + + var streamContent = new StreamContent(fp.Content); + streamContent.Headers.ContentType = new MediaTypeHeaderValue(contentType); + request.Content = streamContent; + } + else + { + var serializer = new CustomJsonCodec(SerializerSettings, configuration); + request.Content = new StringContent(serializer.Serialize(options.Data), new UTF8Encoding(), + "application/json"); + } + } + } + + + + // TODO provide an alternative that allows cookies per request instead of per API client + if (options.Cookies != null && options.Cookies.Count > 0) + { + request.Properties["CookieContainer"] = options.Cookies; + } + + return request; + } + + {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptRequest(HttpRequestMessage req){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} + {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} + + private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) + { + T result = (T) responseData; + string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + + var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) + { + ErrorText = response.ReasonPhrase, + Cookies = new List() + }; + + // process response headers, e.g. Access-Control-Allow-Methods + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + // process response content headers, e.g. Content-Type + if (response.Content.Headers != null) + { + foreach (var responseHeader in response.Content.Headers) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (_httpClientHandler != null && response != null) + { + try { + foreach (Cookie cookie in _httpClientHandler.CookieContainer.GetCookies(uri)) + { + transformed.Cookies.Add(cookie); + } + } + catch (PlatformNotSupportedException) {} + } + + return transformed; + } + + private ApiResponse Exec(HttpRequestMessage req, IReadableConfiguration configuration) + { + return ExecAsync(req, configuration).GetAwaiter().GetResult(); + } + + private async Task> ExecAsync(HttpRequestMessage req, + IReadableConfiguration configuration, + System.Threading.CancellationToken cancellationToken = default) + { + CancellationTokenSource timeoutTokenSource = null; + CancellationTokenSource finalTokenSource = null; + var deserializer = new CustomJsonCodec(SerializerSettings, configuration); + var finalToken = cancellationToken; + + try + { + if (configuration.Timeout > TimeSpan.Zero) + { + timeoutTokenSource = new CancellationTokenSource(configuration.Timeout); + finalTokenSource = CancellationTokenSource.CreateLinkedTokenSource(finalToken, timeoutTokenSource.Token); + finalToken = finalTokenSource.Token; + } + + if (configuration.Proxy != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `Proxy` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + _httpClientHandler.Proxy = configuration.Proxy; + } + + if (configuration.ClientCertificates != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + _httpClientHandler.ClientCertificates.AddRange(configuration.ClientCertificates); + } + + var cookieContainer = req.Properties.ContainsKey("CookieContainer") ? req.Properties["CookieContainer"] as List : null; + + if (cookieContainer != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + foreach (var cookie in cookieContainer) + { + _httpClientHandler.CookieContainer.Add(cookie); + } + } + + InterceptRequest(req); + + HttpResponseMessage response; + {{#supportsRetry}} + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy + .ExecuteAndCaptureAsync(() => _httpClient.SendAsync(req, finalToken)) + .ConfigureAwait(false); + response = (policyResult.Outcome == OutcomeType.Successful) ? + policyResult.Result : new HttpResponseMessage() + { + ReasonPhrase = policyResult.FinalException.ToString(), + RequestMessage = req + }; + } + else + { + {{/supportsRetry}} + response = await _httpClient.SendAsync(req, finalToken).ConfigureAwait(false); + {{#supportsRetry}} + } + {{/supportsRetry}} + + if (!response.IsSuccessStatusCode) + { + return await ToApiResponse(response, default, req.RequestUri).ConfigureAwait(false); + } + + object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + } + + InterceptResponse(req, response); + + return await ToApiResponse(response, responseData, req.RequestUri).ConfigureAwait(false); + } + catch (OperationCanceledException original) + { + if (timeoutTokenSource != null && timeoutTokenSource.IsCancellationRequested) + { + throw new TaskCanceledException($"[{req.Method}] {req.RequestUri} was timeout.", + new TimeoutException(original.Message, original)); + } + throw; + } + finally + { + if (timeoutTokenSource != null) + { + timeoutTokenSource.Dispose(); + } + + if (finalTokenSource != null) + { + finalTokenSource.Dispose(); + } + } + } + + {{#supportsAsync}} + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); + } + #endregion IAsynchronousClient + {{/supportsAsync}} + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(new HttpMethod("PATCH"), path, options, config), config); + } + #endregion ISynchronousClient + } +} diff --git a/templates-v7/csharp/libraries/httpclient/FileParameter.mustache b/templates-v7/csharp/libraries/httpclient/FileParameter.mustache new file mode 100644 index 000000000..87e5fcdc9 --- /dev/null +++ b/templates-v7/csharp/libraries/httpclient/FileParameter.mustache @@ -0,0 +1,72 @@ +{{>partial_header}} + +using System.IO; + +namespace {{packageName}}.Client +{ + + /// + /// Represents a File passed to the API as a Parameter, allows using different backends for files + /// + public class FileParameter + { + /// + /// The filename + /// + public string Name { get; set; } = "no_name_provided"; + + /// + /// The content type of the file + /// + public string ContentType { get; set; } = "application/octet-stream"; + + /// + /// The content of the file + /// + public Stream Content { get; set; } + + /// + /// Construct a FileParameter just from the contents, will extract the filename from a filestream + /// + /// The file content + public FileParameter(Stream content) + { + if (content is FileStream fs) + { + Name = fs.Name; + } + Content = content; + } + + /// + /// Construct a FileParameter from name and content + /// + /// The filename + /// The file content + public FileParameter(string filename, Stream content) + { + Name = filename; + Content = content; + } + + /// + /// Construct a FileParameter from name and content + /// + /// The filename + /// The content type of the file + /// The file content + public FileParameter(string filename, string contentType, Stream content) + { + Name = filename; + ContentType = contentType; + Content = content; + } + + /// + /// Implicit conversion of stream to file parameter. Useful for backwards compatibility. + /// + /// Stream to convert + /// FileParameter + public static implicit operator FileParameter(Stream s) => new FileParameter(s); + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache b/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache new file mode 100644 index 000000000..25e76d03d --- /dev/null +++ b/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache @@ -0,0 +1,66 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace {{packageName}}.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// File parameters to be sent along with the request. + /// + public Multimap FileParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + FileParameters = new Multimap(); + Cookies = new List(); + } + } +} diff --git a/templates-v7/csharp/libraries/httpclient/api.mustache b/templates-v7/csharp/libraries/httpclient/api.mustache new file mode 100644 index 000000000..f7330c2cc --- /dev/null +++ b/templates-v7/csharp/libraries/httpclient/api.mustache @@ -0,0 +1,766 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Mime; +using {{packageName}}.Client; +{{#hasImport}}using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.{{apiPackage}} +{ + {{#operations}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor + { + #region Synchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + {{#notes}} + /// + /// {{.}} + /// + {{/notes}} + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/operation}} + #endregion Synchronous Operations + } + + {{#supportsAsync}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor + { + #region Asynchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default); + {{/operation}} + #endregion Asynchronous Operations + } + {{/supportsAsync}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} partial class {{classname}} : IDisposable, {{interfacePrefix}}{{classname}} + { + private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public {{classname}}() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public {{classname}}(string basePath) + { + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + new {{packageName}}.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public {{classname}}({{packageName}}.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class. + /// + /// An instance of HttpClient. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public {{classname}}(HttpClient client, HttpClientHandler handler = null) : this(client, (string)null, handler) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// An instance of HttpClient. + /// The target service's base path in URL format. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public {{classname}}(HttpClient client, string basePath, HttpClientHandler handler = null) + { + if (client == null) throw new ArgumentNullException("client"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + new {{packageName}}.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(client, this.Configuration.BasePath, handler); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// + /// An instance of HttpClient. + /// An instance of Configuration. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public {{classname}}(HttpClient client, {{packageName}}.Client.Configuration configuration, HttpClientHandler handler = null) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + if (client == null) throw new ArgumentNullException("client"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(client, this.Configuration.BasePath, handler); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access.{{#supportsAsync}} + /// The client interface for asynchronous API access.{{/supportsAsync}} + /// The configuration object. + /// + public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + {{#supportsAsync}} + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + {{/supportsAsync}} + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + {{#supportsAsync}} + this.AsynchronousClient = asyncClient; + {{/supportsAsync}} + this.Configuration = configuration; + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public {{packageName}}.Client.ApiClient ApiClient { get; set; } = null; + + {{#supportsAsync}} + /// + /// The client for accessing this underlying API asynchronously. + /// + public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } + {{/supportsAsync}} + + /// + /// The client for accessing this underlying API synchronously. + /// + public {{packageName}}.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public {{packageName}}.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + {{#operation}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{#supportsAsync}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false);{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}}, {{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#constantParams}} + {{#isPathParam}} + // Set client side default value of Path Param "{{baseName}}". + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant path parameter + {{/isPathParam}} + {{/constantParams}} + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + localVarRequestOptions.QueryParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant query parameter + {{/isQueryParam}} + {{/constantParams}} + {{#queryParams}} + {{#required}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + } + {{/required}} + {{/queryParams}} + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + {{/isHeaderParam}} + {{/constantParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} +} diff --git a/templates-v7/csharp/libraries/httpclient/model.mustache b/templates-v7/csharp/libraries/httpclient/model.mustache new file mode 100644 index 000000000..f84de7f64 --- /dev/null +++ b/templates-v7/csharp/libraries/httpclient/model.mustache @@ -0,0 +1,51 @@ +{{>partial_header}} + +{{#models}} +{{#model}} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +{{#vendorExtensions.x-com-visible}} +using System.Runtime.InteropServices; +{{/vendorExtensions.x-com-visible}} +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +{{#discriminator}} +using JsonSubTypes; +{{/discriminator}} +{{/model}} +{{/models}} +{{#validatable}} +using System.ComponentModel.DataAnnotations; +{{/validatable}} +using FileParameter = {{packageName}}.Client.FileParameter; +using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; +{{#useCompareNetObjects}} +using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; +{{/useCompareNetObjects}} +{{#models}} +{{#model}} +{{#oneOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/oneOf}} +{{#anyOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/anyOf}} + +namespace {{packageName}}.{{modelPackage}} +{ +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} +} diff --git a/templates-v7/csharp/libraries/unityWebRequest/ApiClient.mustache b/templates-v7/csharp/libraries/unityWebRequest/ApiClient.mustache new file mode 100644 index 000000000..71d621c88 --- /dev/null +++ b/templates-v7/csharp/libraries/unityWebRequest/ApiClient.mustache @@ -0,0 +1,677 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using System.Net.Http; +using System.Net.Http.Headers; +using UnityEngine.Networking; +using UnityEngine; + +namespace {{packageName}}.Client +{ + /// + /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public T Deserialize(UnityWebRequest request) + { + var result = (T) Deserialize(request, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The UnityWebRequest after it has a response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(UnityWebRequest request, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return request.downloadHandler.data; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + // NOTE: Ignoring Content-Disposition filename support, since not all platforms + // have a location on disk to write arbitrary data (tvOS, consoles). + return new MemoryStream(request.downloadHandler.data); + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(request.downloadHandler.text, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(request.downloadHandler.text, type); + } + + var contentType = request.GetResponseHeader("Content-Type"); + + if (!string.IsNullOrEmpty(contentType) && contentType.Contains("application/json")) + { + var text = request.downloadHandler?.text; + + // Generated APIs that don't expect a return value provide System.Object as the type + if (type == typeof(global::System.Object) && (string.IsNullOrEmpty(text) || text.Trim() == "null")) + { + return null; + } + + if (request.responseCode >= 200 && request.responseCode < 300) + { + try + { + // Deserialize as a model + return JsonConvert.DeserializeObject(text, type, _serializerSettings); + } + catch (Exception e) + { + throw new UnexpectedResponseException(request, type, e.ToString()); + } + } + else + { + throw new ApiException((int)request.responseCode, request.error, text); + } + } + + if (type != typeof(global::System.Object) && request.responseCode >= 200 && request.responseCode < 300) + { + throw new UnexpectedResponseException(request, type); + } + + return null; + + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + /// + /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. + /// + {{>visibility}} partial class ApiClient : IDisposable, ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() : + this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) + { + } + + /// + /// Initializes a new instance of the . + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + } + + /// + /// Provides all logic for constructing a new UnityWebRequest. + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the UnityWebRequest. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new UnityWebRequest instance. + /// + private UnityWebRequest NewRequest( + string method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); + + builder.AddPathParameters(options.PathParameters); + + builder.AddQueryParameters(options.QueryParameters); + + string contentType = null; + if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes.FirstOrDefault(); + } + + var uri = builder.GetFullUri(); + UnityWebRequest request = null; + + if (contentType == "multipart/form-data") + { + var formData = new List(); + foreach (var formParameter in options.FormParameters) + { + formData.Add(new MultipartFormDataSection(formParameter.Key, formParameter.Value)); + } + + request = UnityWebRequest.Post(uri, formData); + request.method = method; + } + else if (contentType == "application/x-www-form-urlencoded") + { + var form = new WWWForm(); + foreach (var kvp in options.FormParameters) + { + form.AddField(kvp.Key, kvp.Value); + } + + request = UnityWebRequest.Post(uri, form); + request.method = method; + } + else if (contentType == "application/octet-stream") + { + if(options.Data is Stream stream) + { + using (var binaryReader = new BinaryReader(stream)) + { + var bytes = binaryReader.ReadBytes((int)stream.Length); + request = UnityWebRequest.Put(uri, bytes); + request.method = method; + request.SetRequestHeader("Content-Type", "application/octet-stream"); + } + } + else + { + throw new InvalidDataException($"{nameof(options.Data)} is not of {nameof(Stream)} type"); + } + } + else if (options.Data != null) + { + var serializer = new CustomJsonCodec(SerializerSettings, configuration); + var jsonData = serializer.Serialize(options.Data); + + // Making a post body application/json encoded is whack with UnityWebRequest. + // See: https://stackoverflow.com/questions/68156230/unitywebrequest-post-not-sending-body + request = UnityWebRequest.Put(uri, jsonData); + request.method = method; + request.SetRequestHeader("Content-Type", "application/json"); + } + else + { + request = new UnityWebRequest(builder.GetFullUri(), method); + } + + if (request.downloadHandler == null && typeof(T) != typeof(global::System.Object)) + { + request.downloadHandler = new DownloadHandlerBuffer(); + } + +#if UNITY_EDITOR || !UNITY_WEBGL + if (configuration.UserAgent != null) + { + request.SetRequestHeader("User-Agent", configuration.UserAgent); + } +#endif + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.SetRequestHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + // Todo make content headers actually content headers + request.SetRequestHeader(headerParam.Key, value); + } + } + } + + if (options.Cookies != null && options.Cookies.Count > 0) + { + #if UNITY_WEBGL + throw new System.InvalidOperationException("UnityWebRequest does not support setting cookies in WebGL"); + #else + if (options.Cookies.Count != 1) + { + UnityEngine.Debug.LogError("Only one cookie supported, ignoring others"); + } + + request.SetRequestHeader("Cookie", options.Cookies[0].ToString()); + #endif + } + + return request; + + } + + partial void InterceptRequest(UnityWebRequest req, string path, RequestOptions options, IReadableConfiguration configuration); + partial void InterceptResponse(UnityWebRequest req, string path, RequestOptions options, IReadableConfiguration configuration, ref object responseData); + + private ApiResponse ToApiResponse(UnityWebRequest request, object responseData) + { + T result = (T) responseData; + + var transformed = new ApiResponse((HttpStatusCode)request.responseCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, request.downloadHandler?.text ?? "") + { + ErrorText = request.error, + Cookies = new List() + }; + + // process response headers, e.g. Access-Control-Allow-Methods + var responseHeaders = request.GetResponseHeaders(); + if (responseHeaders != null) + { + foreach (var responseHeader in request.GetResponseHeaders()) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + return transformed; + } + + private async Task> ExecAsync( + UnityWebRequest request, + string path, + RequestOptions options, + IReadableConfiguration configuration, + System.Threading.CancellationToken cancellationToken = default) + { + var deserializer = new CustomJsonCodec(SerializerSettings, configuration); + + using (request) + { + {{#useIntForTimeout}} + if (configuration.Timeout > 0) + { + request.timeout = configuration.Timeout; + } + {{/useIntForTimeout}} + {{^useIntForTimeout}} + if (configuration.Timeout > TimeSpan.Zero) + { + request.timeout = (int)Math.Ceiling(configuration.Timeout.TotalSeconds); + } + {{/useIntForTimeout}} + + if (configuration.Proxy != null) + { + throw new InvalidOperationException("Configuration `Proxy` not supported by UnityWebRequest"); + } + + if (configuration.ClientCertificates != null) + { + // Only Android/iOS/tvOS/Standalone players can support certificates, and this + // implementation is intended to work on all platforms. + // + // TODO: Could optionally allow support for this on these platforms. + // + // See: https://docs.unity3d.com/ScriptReference/Networking.CertificateHandler.html + throw new InvalidOperationException("Configuration `ClientCertificates` not supported by UnityWebRequest on all platforms"); + } + + InterceptRequest(request, path, options, configuration); + + #if UNITY_2020_2_OR_NEWER + // For Unity 2020.2 and newer, use UnityWebRequest.Result. + var asyncOp = request.SendWebRequest(); + TaskCompletionSource tcs = new TaskCompletionSource(); + asyncOp.completed += (_) => tcs.TrySetResult(request.result); + using (var tokenRegistration = cancellationToken.Register(request.Abort, true)) + { + await tcs.Task; + } + + if (request.result == UnityWebRequest.Result.ConnectionError || + request.result == UnityWebRequest.Result.DataProcessingError) + { + throw new ConnectionException(request); + } + #else + // For Unity 2019 and earlier, await the operation directly. + var asyncOp = request.SendWebRequest(); + using (var tokenRegistration = cancellationToken.Register(request.Abort, true)) + { + await asyncOp; + } + + if (request.isNetworkError || request.isHttpError) + { + throw new ConnectionException(request); + } + #endif + + object responseData = deserializer.Deserialize(request); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { new ByteArrayContent(request.downloadHandler.data) }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + responseData = (T) (object) new MemoryStream(request.downloadHandler.data); + } + + InterceptResponse(request, path, options, configuration, ref responseData); + + return ToApiResponse(request, responseData); + } + } + + {{#supportsAsync}} + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("GET", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("POST", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("PUT", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("DELETE", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("HEAD", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("OPTIONS", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("PATCH", path, options, config), path, options, config, cancellationToken); + } + #endregion IAsynchronousClient + {{/supportsAsync}} + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + #endregion ISynchronousClient + } +} diff --git a/templates-v7/csharp/libraries/unityWebRequest/ConnectionException.mustache b/templates-v7/csharp/libraries/unityWebRequest/ConnectionException.mustache new file mode 100644 index 000000000..c4c9ae32e --- /dev/null +++ b/templates-v7/csharp/libraries/unityWebRequest/ConnectionException.mustache @@ -0,0 +1,57 @@ +{{>partial_header}} + +using System; +using UnityEngine.Networking; + +namespace {{packageName}}.Client +{ +#if UNITY_2020_1_OR_NEWER + public class ConnectionException : Exception + { + public UnityWebRequest.Result Result { get; private set; } + public string Error { get; private set; } + + // NOTE: Cannot keep reference to the request since it will be disposed. + public ConnectionException(UnityWebRequest request) + : base($"result={request.result} error={request.error}") + { + Result = request.result; + Error = request.error ?? ""; + } + } +#else + // For Unity 2019, define a custom enum that roughly simulates UnityWebRequest.Result. + public enum UnityWebRequestResultLegacy + { + Success, + ConnectionError, + ProtocolError, + DataProcessingError + } + + public class ConnectionException : Exception + { + public UnityWebRequestResultLegacy Result { get; private set; } + public string Error { get; private set; } + + public ConnectionException(UnityWebRequest request) + : base($"Error: {request.error}") + { + if (request.isNetworkError) + { + Result = UnityWebRequestResultLegacy.ConnectionError; + } + else if (request.isHttpError) + { + Result = UnityWebRequestResultLegacy.ProtocolError; + } + else + { + Result = UnityWebRequestResultLegacy.Success; + } + + Error = request.error ?? ""; + } + } +#endif +} diff --git a/templates-v7/csharp/libraries/unityWebRequest/README.mustache b/templates-v7/csharp/libraries/unityWebRequest/README.mustache new file mode 100644 index 000000000..e94bc78c6 --- /dev/null +++ b/templates-v7/csharp/libraries/unityWebRequest/README.mustache @@ -0,0 +1,175 @@ +# {{packageName}} - the C# library for the {{appName}} + +{{#appDescriptionWithNewLines}} +{{{.}}} +{{/appDescriptionWithNewLines}} + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- SDK version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} +- Build package: {{generatorClass}} +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + + +## Version support +This generator should support all current LTS versions of Unity +- Unity 2019.4 (LTS) and up +- .NET Standard 2.1 / .NET Framework + + +## Dependencies + +- [Newtonsoft.Json](https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.0/manual/index.html) - 3.0.2 or later +- [Unity Test Framework](https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/manual/index.html) - 1.1.33 or later + + +## Installation +Add the dependencies to `Packages/manifest.json` +``` +{ + "dependencies": { + ... + "com.unity.nuget.newtonsoft-json": "3.0.2", + "com.unity.test-framework": "1.1.33", + } +} +``` + +Then use the namespaces: +```csharp +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; +``` + + +## Getting Started + +```csharp +using System; +using System.Collections.Generic; +using UnityEngine; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace {{packageName}}Example +{ +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} + public class {{operationId}}Example : MonoBehaviour + { + async void Start() + { + Configuration config = new Configuration(); + config.BasePath = "{{{basePath}}}"; + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + config.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + config.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + var apiInstance = new {{classname}}(config); + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{{.}}} result = {{/returnType}}await apiInstance.{{{operationId}}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.Log(result);{{/returnType}} + Debug.Log("Done!"); + } + catch (ApiException e) + { + Debug.LogError("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); + Debug.LogError("Status Code: "+ e.ErrorCode); + Debug.LogError(e.StackTrace); + } +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + + +## Documentation for Models + +{{#modelPackage}} +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} +{{/modelPackage}} +{{^modelPackage}} +No model defined in this package +{{/modelPackage}} + + +## Documentation for Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: Bearer Authentication +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} diff --git a/templates-v7/csharp/libraries/unityWebRequest/RequestOptions.mustache b/templates-v7/csharp/libraries/unityWebRequest/RequestOptions.mustache new file mode 100644 index 000000000..0dd18c4ed --- /dev/null +++ b/templates-v7/csharp/libraries/unityWebRequest/RequestOptions.mustache @@ -0,0 +1,60 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace {{packageName}}.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + Cookies = new List(); + } + } +} diff --git a/templates-v7/csharp/libraries/unityWebRequest/UnexpectedResponseException.mustache b/templates-v7/csharp/libraries/unityWebRequest/UnexpectedResponseException.mustache new file mode 100644 index 000000000..a976b2a76 --- /dev/null +++ b/templates-v7/csharp/libraries/unityWebRequest/UnexpectedResponseException.mustache @@ -0,0 +1,26 @@ +{{>partial_header}} + +using System; +using UnityEngine.Networking; + +namespace {{packageName}}.Client +{ + // Thrown when a backend doesn't return an expected response based on the expected type + // of the response data. + public class UnexpectedResponseException : Exception + { + public int ErrorCode { get; private set; } + + // NOTE: Cannot keep reference to the request since it will be disposed. + public UnexpectedResponseException(UnityWebRequest request, System.Type type, string extra = "") + : base(CreateMessage(request, type, extra)) + { + ErrorCode = (int)request.responseCode; + } + + private static string CreateMessage(UnityWebRequest request, System.Type type, string extra) + { + return $"httpcode={request.responseCode}, expected {type.Name} but got data: {extra}"; + } + } +} diff --git a/templates-v7/csharp/libraries/unityWebRequest/UnityWebRequestAwaiterExtension.mustache b/templates-v7/csharp/libraries/unityWebRequest/UnityWebRequestAwaiterExtension.mustache new file mode 100644 index 000000000..1f9ff95c4 --- /dev/null +++ b/templates-v7/csharp/libraries/unityWebRequest/UnityWebRequestAwaiterExtension.mustache @@ -0,0 +1,23 @@ +{{>partial_header}} + +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using UnityEngine.Networking; + +namespace {{packageName}}.Client +{ + /// + /// Provides an awaiter for UnityWebRequestAsyncOperation to allow `await request.SendWebRequest()` + /// in Unity async methods. Unity's AsyncOperation types are not awaitable by default, so this + /// extension bridges that gap by converting the operation into a Task. + /// + public static class UnityWebRequestAwaiterExtensions + { + public static TaskAwaiter GetAwaiter(this UnityWebRequestAsyncOperation asyncOp) + { + var tcs = new TaskCompletionSource(); + asyncOp.completed += _ => tcs.SetResult(asyncOp); + return tcs.Task.GetAwaiter(); + } + } +} diff --git a/templates-v7/csharp/libraries/unityWebRequest/api.mustache b/templates-v7/csharp/libraries/unityWebRequest/api.mustache new file mode 100644 index 000000000..c94df9125 --- /dev/null +++ b/templates-v7/csharp/libraries/unityWebRequest/api.mustache @@ -0,0 +1,690 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using {{packageName}}.Client; +{{#hasImport}}using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.{{apiPackage}} +{ + {{#operations}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor + { + #region Synchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + {{#notes}} + /// + /// {{.}} + /// + {{/notes}} + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/operation}} + #endregion Synchronous Operations + } + + {{#supportsAsync}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor + { + #region Asynchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default); + {{/operation}} + #endregion Asynchronous Operations + } + {{/supportsAsync}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} partial class {{classname}} : IDisposable, {{interfacePrefix}}{{classname}} + { + private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public {{classname}}() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public {{classname}}(string basePath) + { + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + new {{packageName}}.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public {{classname}}({{packageName}}.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access.{{#supportsAsync}} + /// The client interface for asynchronous API access.{{/supportsAsync}} + /// The configuration object. + /// + public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + {{#supportsAsync}} + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + {{/supportsAsync}} + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + {{#supportsAsync}} + this.AsynchronousClient = asyncClient; + {{/supportsAsync}} + this.Configuration = configuration; + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public {{packageName}}.Client.ApiClient ApiClient { get; set; } = null; + + {{#supportsAsync}} + /// + /// The client for accessing this underlying API asynchronously. + /// + public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } + {{/supportsAsync}} + + /// + /// The client for accessing this underlying API synchronously. + /// + public {{packageName}}.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public {{packageName}}.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + {{#operation}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{#supportsAsync}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default) + { + var task = {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken); + {{#returnType}} +#if UNITY_EDITOR || !UNITY_WEBGL + {{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await task.ConfigureAwait(false); +#else + {{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await task; +#endif + return localVarResponse.Data; + {{/returnType}} + {{^returnType}} +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + {{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}}, {{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + + var task = this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} +} diff --git a/templates-v7/csharp/libraries/unityWebRequest/api_test.mustache b/templates-v7/csharp/libraries/unityWebRequest/api_test.mustache new file mode 100644 index 000000000..0f7f49f7f --- /dev/null +++ b/templates-v7/csharp/libraries/unityWebRequest/api_test.mustache @@ -0,0 +1,74 @@ +{{>partial_header}} +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using {{packageName}}.Client; +using {{packageName}}.{{apiPackage}}; +{{#hasImport}} +// uncomment below to import models +//using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.Test.Api +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class {{classname}}Tests : IDisposable + { + {{^nonPublicApi}} + private {{classname}} instance; + + {{/nonPublicApi}} + public {{classname}}Tests() + { + {{^nonPublicApi}} + instance = new {{classname}}(); + {{/nonPublicApi}} + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of {{classname}} + /// + [Test] + public void {{operationId}}InstanceTest() + { + // TODO uncomment below to test 'IsType' {{classname}} + //Assert.IsType<{{classname}}>(instance); + } + {{#operations}} + {{#operation}} + + /// + /// Test {{operationId}} + /// + [Test] + public void {{operationId}}Test() + { + // TODO uncomment below to test the method and replace null with proper value + {{#allParams}} + //{{{dataType}}} {{paramName}} = null; + {{/allParams}} + //{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}} + //Assert.IsType<{{{.}}}>(response); + {{/returnType}} + } + {{/operation}} + {{/operations}} + } +} diff --git a/templates-v7/csharp/libraries/unityWebRequest/asmdef.mustache b/templates-v7/csharp/libraries/unityWebRequest/asmdef.mustache new file mode 100644 index 000000000..a30cba8cc --- /dev/null +++ b/templates-v7/csharp/libraries/unityWebRequest/asmdef.mustache @@ -0,0 +1,7 @@ +{ + "name": "{{packageName}}", + "overrideReferences": true, + "precompiledReferences": [ + "Newtonsoft.Json.dll" + ] +} diff --git a/templates-v7/csharp/libraries/unityWebRequest/asmdef_test.mustache b/templates-v7/csharp/libraries/unityWebRequest/asmdef_test.mustache new file mode 100644 index 000000000..c5e2d5852 --- /dev/null +++ b/templates-v7/csharp/libraries/unityWebRequest/asmdef_test.mustache @@ -0,0 +1,15 @@ +{ + "name": "{{testPackageName}}", + "references": [ + "{{packageName}}", + "UnityEngine.TestRunner" + ], + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll", + "Newtonsoft.Json.dll" + ], + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ] +} diff --git a/templates-v7/csharp/libraries/unityWebRequest/model.mustache b/templates-v7/csharp/libraries/unityWebRequest/model.mustache new file mode 100644 index 000000000..3c1c6c0e2 --- /dev/null +++ b/templates-v7/csharp/libraries/unityWebRequest/model.mustache @@ -0,0 +1,47 @@ +{{>partial_header}} + +{{#models}} +{{#model}} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +{{#vendorExtensions.x-com-visible}} +using System.Runtime.InteropServices; +{{/vendorExtensions.x-com-visible}} +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +{{/model}} +{{/models}} +{{#validatable}} +using System.ComponentModel.DataAnnotations; +{{/validatable}} +using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; +{{#useCompareNetObjects}} +using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; +{{/useCompareNetObjects}} +{{#models}} +{{#model}} +{{#oneOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/oneOf}} +{{#anyOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/anyOf}} + +namespace {{packageName}}.{{modelPackage}} +{ +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} +} diff --git a/templates-v7/csharp/libraries/unityWebRequest/model_test.mustache b/templates-v7/csharp/libraries/unityWebRequest/model_test.mustache new file mode 100644 index 000000000..404623281 --- /dev/null +++ b/templates-v7/csharp/libraries/unityWebRequest/model_test.mustache @@ -0,0 +1,64 @@ +{{>partial_header}} + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.{{modelPackage}}; +using {{packageName}}.{{clientPackage}}; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +{{#models}} +{{#model}} +namespace {{packageName}}.Test.Model +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class {{classname}}Tests : IDisposable + { + // TODO uncomment below to declare an instance variable for {{classname}} + //private {{classname}} instance; + + public {{classname}}Tests() + { + // TODO uncomment below to create an instance of {{classname}} + //instance = new {{classname}}(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of {{classname}} + /// + [Test] + public void {{classname}}InstanceTest() + { + // TODO uncomment below to test "IsType" {{classname}} + //Assert.IsType<{{classname}}>(instance); + } + + {{#vars}} + /// + /// Test the property '{{name}}' + /// + [Test] + public void {{name}}Test() + { + // TODO unit test for the property '{{name}}' + } + {{/vars}} + } +} +{{/model}} +{{/models}} diff --git a/templates-v7/csharp/modelEnum.mustache b/templates-v7/csharp/modelEnum.mustache index 37fb53f5f..7b779b3fa 100644 --- a/templates-v7/csharp/modelEnum.mustache +++ b/templates-v7/csharp/modelEnum.mustache @@ -46,14 +46,14 @@ /// /// Converts to and from the JSON value /// - public static class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter + {{>visibility}} static class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter { /// /// Parses a given value to /// /// /// - public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} FromString(string value) + {{>visibility}} static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} FromString(string value) { {{#allowableValues}} {{#enumVars}} @@ -70,7 +70,7 @@ /// /// /// - public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? FromStringOrDefault(string value) + {{>visibility}} static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? FromStringOrDefault(string value) { {{#allowableValues}} {{#enumVars}} @@ -88,7 +88,7 @@ /// /// /// - public static {{>EnumValueDataType}} ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} value) + {{>visibility}} static {{>EnumValueDataType}} ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} value) { {{^isString}} return ({{>EnumValueDataType}}) value; @@ -110,7 +110,7 @@ /// A Json converter for type /// /// - public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> + {{>visibility}} class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { /// /// Returns a {{datatypeWithEnum}} from the Json object @@ -141,14 +141,14 @@ /// public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) { - writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.ToString()); + writer.WriteStringValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}).ToString()); } } /// /// A Json converter for type /// - public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}?> + {{>visibility}} class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}?> { /// /// Returns a {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} from the Json object @@ -172,14 +172,14 @@ } /// - /// Writes the DateTime to the json writer + /// Writes the {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} to the json writer /// /// /// /// public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) { - writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}?.ToString() ?? "null"); + writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.HasValue ? {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.Value).ToString() : "null"); } } {{/useGenericHost}} diff --git a/templates-v7/csharp/modelGeneric.mustache b/templates-v7/csharp/modelGeneric.mustache index eed641273..5a95adaa1 100644 --- a/templates-v7/csharp/modelGeneric.mustache +++ b/templates-v7/csharp/modelGeneric.mustache @@ -25,12 +25,14 @@ {{#items}} {{^complexType}} {{>modelInnerEnum}} + {{/complexType}} {{/items}} {{/items.isEnum}} {{#isEnum}} {{^complexType}} {{>modelInnerEnum}} + {{/complexType}} {{/isEnum}} {{#isEnum}} @@ -138,7 +140,7 @@ {{#hasOnlyReadOnly}} [JsonConstructorAttribute] {{/hasOnlyReadOnly}} - public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} + public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default{{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} { {{#vars}} {{^isInherited}} @@ -428,5 +430,6 @@ {{#validatable}} {{>validatable}} + {{/validatable}} } diff --git a/templates-v7/csharp/netcore_project.mustache b/templates-v7/csharp/netcore_project.mustache index ade2832cd..0754f7382 100644 --- a/templates-v7/csharp/netcore_project.mustache +++ b/templates-v7/csharp/netcore_project.mustache @@ -36,13 +36,13 @@ {{/useRestSharp}} {{#useGenericHost}} - - + + {{#supportsRetry}} - + {{/supportsRetry}} {{#net80OrLater}} - + {{/net80OrLater}} {{^net60OrLater}} diff --git a/templates-v7/csharp/netcore_testproject.mustache b/templates-v7/csharp/netcore_testproject.mustache index 90434b77e..4834e3923 100644 --- a/templates-v7/csharp/netcore_testproject.mustache +++ b/templates-v7/csharp/netcore_testproject.mustache @@ -9,9 +9,9 @@ - - - + + + diff --git a/templates-v7/csharp/validatable.mustache b/templates-v7/csharp/validatable.mustache index 429eed118..547821a4f 100644 --- a/templates-v7/csharp/validatable.mustache +++ b/templates-v7/csharp/validatable.mustache @@ -60,6 +60,9 @@ {{#vars}} {{#hasValidation}} {{^isEnum}} + {{^isDateTime}} + {{^isDate}} + {{^isTime}} {{#maxLength}} // {{{name}}} ({{{dataType}}}) maxLength if (this.{{{name}}} != null && this.{{{name}}}.Length > {{maxLength}}) @@ -76,6 +79,9 @@ } {{/minLength}} + {{/isTime}} + {{/isDate}} + {{/isDateTime}} {{#maximum}} // {{{name}}} ({{{dataType}}}) maximum if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} {{#exclusiveMaximum}}<={{/exclusiveMaximum}}{{^exclusiveMaximum}}>{{/exclusiveMaximum}} ({{{dataType}}}){{maximum}}) @@ -99,7 +105,7 @@ if (this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null){ {{#lambda.trimTrailingWithNewLine}} {{#lambda.indent4}} - {{>ValidateRegex}} + {{>ValidateRegex}}{{! prevent indent}} {{/lambda.indent4}} {{/lambda.trimTrailingWithNewLine}} @@ -109,7 +115,7 @@ {{^isNullable}} {{#lambda.trimTrailingWithNewLine}} {{#lambda.indent3}} - {{>ValidateRegex}} + {{>ValidateRegex}}{{! prevent indent}} {{/lambda.indent3}} {{/lambda.trimTrailingWithNewLine}} @@ -119,7 +125,7 @@ if (this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null) { {{#lambda.trimTrailingWithNewLine}} {{#lambda.indent4}} - {{>ValidateRegex}} + {{>ValidateRegex}}{{! prevent indent}} {{/lambda.indent4}} {{/lambda.trimTrailingWithNewLine}} From 09c1d19919d2d4e01b33b6d7e79e5ebdfad1ce0e Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 24 Sep 2025 16:41:16 +0200 Subject: [PATCH 012/126] Copied Client classes from other branch --- Adyen/Adyen.csproj | 1 + .../Client/ApiClient.cs | 45 +- Adyen/Client/ApiException.cs | 54 +- Adyen/Client/ApiFactory.cs | 49 -- Adyen/Client/ApiKeyToken.cs | 52 -- Adyen/Client/ApiResponse.cs | 279 +++----- Adyen/Client/ApiResponseEventArgs.cs | 24 - Adyen/Client/BasicToken.cs | 42 -- Adyen/Client/ClientUtils.cs | 646 +++--------------- Adyen/Client/Configuration.cs | 607 ++++++++++++++++ Adyen/Client/CookieContainer.cs | 18 - Adyen/Client/DateTimeJsonConverter.cs | 77 --- Adyen/Client/DateTimeNullableJsonConverter.cs | 82 --- Adyen/Client/ExceptionEventArgs.cs | 24 - Adyen/Client/ExceptionFactory.cs | 22 + Adyen/Client/FileParameter.cs | 80 +++ Adyen/Client/GlobalConfiguration.cs | 67 ++ Adyen/Client/HostConfiguration.cs | 361 ---------- Adyen/Client/IApiAccessor.cs | 37 + Adyen/Client/IAsynchronousClient.cs | 100 +++ Adyen/Client/IReadableConfiguration.cs | 141 ++++ Adyen/Client/ISynchronousClient.cs | 93 +++ Adyen/Client/JsonSerializerOptionsProvider.cs | 25 - Adyen/Client/Multimap.cs | 295 ++++++++ Adyen/Client/OpenAPIDateConverter.cs | 1 - Adyen/Client/Option.cs | 51 -- Adyen/Client/RateLimitProvider.cs | 71 -- Adyen/Client/RequestOptions.cs | 74 ++ Adyen/Client/RetryConfiguration.cs | 31 + Adyen/Client/TokenBase.cs | 69 -- Adyen/Client/TokenContainer.cs | 35 - Adyen/Client/TokenProvider.cs | 42 -- Adyen/Client/WebRequestPathBuilder.cs | 53 ++ 33 files changed, 1820 insertions(+), 1828 deletions(-) rename templates-v7/csharp/libraries/httpclient/ApiClient.mustache => Adyen/Client/ApiClient.cs (89%) delete mode 100644 Adyen/Client/ApiFactory.cs delete mode 100644 Adyen/Client/ApiKeyToken.cs delete mode 100644 Adyen/Client/ApiResponseEventArgs.cs delete mode 100644 Adyen/Client/BasicToken.cs create mode 100644 Adyen/Client/Configuration.cs delete mode 100644 Adyen/Client/CookieContainer.cs delete mode 100644 Adyen/Client/DateTimeJsonConverter.cs delete mode 100644 Adyen/Client/DateTimeNullableJsonConverter.cs delete mode 100644 Adyen/Client/ExceptionEventArgs.cs create mode 100644 Adyen/Client/ExceptionFactory.cs create mode 100644 Adyen/Client/FileParameter.cs create mode 100644 Adyen/Client/GlobalConfiguration.cs delete mode 100644 Adyen/Client/HostConfiguration.cs create mode 100644 Adyen/Client/IApiAccessor.cs create mode 100644 Adyen/Client/IAsynchronousClient.cs create mode 100644 Adyen/Client/IReadableConfiguration.cs create mode 100644 Adyen/Client/ISynchronousClient.cs delete mode 100644 Adyen/Client/JsonSerializerOptionsProvider.cs create mode 100644 Adyen/Client/Multimap.cs delete mode 100644 Adyen/Client/Option.cs delete mode 100644 Adyen/Client/RateLimitProvider.cs create mode 100644 Adyen/Client/RequestOptions.cs create mode 100644 Adyen/Client/RetryConfiguration.cs delete mode 100644 Adyen/Client/TokenBase.cs delete mode 100644 Adyen/Client/TokenContainer.cs delete mode 100644 Adyen/Client/TokenProvider.cs create mode 100644 Adyen/Client/WebRequestPathBuilder.cs diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index d2bf923bf..a3e96c41a 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -39,6 +39,7 @@ + diff --git a/templates-v7/csharp/libraries/httpclient/ApiClient.mustache b/Adyen/Client/ApiClient.cs similarity index 89% rename from templates-v7/csharp/libraries/httpclient/ApiClient.mustache rename to Adyen/Client/ApiClient.cs index 608378253..0fbd519c8 100644 --- a/templates-v7/csharp/libraries/httpclient/ApiClient.mustache +++ b/Adyen/Client/ApiClient.cs @@ -1,4 +1,12 @@ -{{>partial_header}} +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + using System; using System.Collections; @@ -14,19 +22,14 @@ using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; -{{^netStandard}} -using System.Web; -{{/netStandard}} using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; using System.Net.Http; using System.Net.Http.Headers; -{{#supportsRetry}} using Polly; -{{/supportsRetry}} -namespace {{packageName}}.Client +namespace Adyen.Client { /// /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. @@ -66,10 +69,10 @@ public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfi /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) + if (obj != null && obj is Adyen.Model.Checkout.AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); + return ((Adyen.Model.Checkout.AbstractOpenAPISchema)obj).ToJson(); } else { @@ -189,12 +192,12 @@ public string ContentType /// /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. /// - {{>visibility}} partial class ApiClient : IDisposable, ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + public partial class ApiClient : IDisposable, ISynchronousClient, IAsynchronousClient { private readonly string _baseUrl; private readonly HttpClientHandler _httpClientHandler; - private readonly HttpClient _httpClient; + private readonly System.Net.Http.HttpClient _httpClient; private readonly bool _disposeClient; /// @@ -220,7 +223,7 @@ public string ContentType /// It's better to reuse the HttpClient and HttpClientHandler. /// public ApiClient() : - this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) + this(Adyen.Client.GlobalConfiguration.Instance.BasePath) { } @@ -252,7 +255,7 @@ public ApiClient(string basePath) /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. /// public ApiClient(HttpClient client, HttpClientHandler handler = null) : - this(client, {{packageName}}.Client.GlobalConfiguration.Instance.BasePath, handler) + this(client, Adyen.Client.GlobalConfiguration.Instance.BasePath, handler) { } @@ -289,7 +292,6 @@ public void Dispose() } /// Prepares multipart/form-data content - {{! TODO: Add handling of improper usage }} HttpContent PrepareMultipartFormDataContent(RequestOptions options) { string boundary = "---------" + Guid.NewGuid().ToString().ToUpperInvariant(); @@ -378,7 +380,6 @@ private HttpRequestMessage NewRequest( contentType = contentTypes.FirstOrDefault(); } - {{!// TODO Add error handling in case of improper usage}} if (contentType == "multipart/form-data") { request.Content = PrepareMultipartFormDataContent(options); @@ -419,15 +420,15 @@ private HttpRequestMessage NewRequest( return request; } - {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptRequest(HttpRequestMessage req){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} - {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} + partial void InterceptRequest(HttpRequestMessage req); + partial void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response); private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) { T result = (T) responseData; string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) + var transformed = new ApiResponse(response.StatusCode, new Multimap(StringComparer.OrdinalIgnoreCase), result, rawContent) { ErrorText = response.ReasonPhrase, Cookies = new List() @@ -514,7 +515,6 @@ private async Task> ExecAsync(HttpRequestMessage req, InterceptRequest(req); HttpResponseMessage response; - {{#supportsRetry}} if (RetryConfiguration.AsyncRetryPolicy != null) { var policy = RetryConfiguration.AsyncRetryPolicy; @@ -530,11 +530,8 @@ private async Task> ExecAsync(HttpRequestMessage req, } else { - {{/supportsRetry}} response = await _httpClient.SendAsync(req, finalToken).ConfigureAwait(false); - {{#supportsRetry}} } - {{/supportsRetry}} if (!response.IsSuccessStatusCode) { @@ -544,7 +541,7 @@ private async Task> ExecAsync(HttpRequestMessage req, object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(Adyen.Model.Checkout.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } @@ -580,7 +577,6 @@ private async Task> ExecAsync(HttpRequestMessage req, } } - {{#supportsAsync}} #region IAsynchronousClient /// /// Make a HTTP GET request (async). @@ -687,7 +683,6 @@ public Task> PatchAsync(string path, RequestOptions options, I return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); } #endregion IAsynchronousClient - {{/supportsAsync}} #region ISynchronousClient /// diff --git a/Adyen/Client/ApiException.cs b/Adyen/Client/ApiException.cs index de579aba4..385a6f1be 100644 --- a/Adyen/Client/ApiException.cs +++ b/Adyen/Client/ApiException.cs @@ -1,13 +1,13 @@ -// /* * Adyen Checkout API * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! * * The version of the OpenAPI document: 71 * Generated by: https://github.com/openapitools/openapi-generator.git */ + using System; namespace Adyen.Client @@ -18,33 +18,51 @@ namespace Adyen.Client public class ApiException : Exception { /// - /// The reason the api request failed + /// Gets or sets the error code (HTTP status code) /// - public string ReasonPhrase { get; } + /// The error code (HTTP status code). + public int ErrorCode { get; set; } /// - /// The HttpStatusCode + /// Gets or sets the error content (body json object) /// - public System.Net.HttpStatusCode StatusCode { get; } + /// The error content (Http response body). + public object ErrorContent { get; private set; } /// - /// The raw data returned by the api + /// Gets or sets the HTTP headers /// - public string RawContent { get; } - + /// HTTP headers + public Multimap Headers { get; private set; } + /// - /// Construct the ApiException from parts of the response + /// Initializes a new instance of the class. /// - /// - /// - /// - public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) - { - ReasonPhrase = reasonPhrase; + public ApiException() { } - StatusCode = statusCode; + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } - RawContent = rawContent; + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + /// HTTP Headers. + public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + this.Headers = headers; } } + } diff --git a/Adyen/Client/ApiFactory.cs b/Adyen/Client/ApiFactory.cs deleted file mode 100644 index 24e5a92d9..000000000 --- a/Adyen/Client/ApiFactory.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using Microsoft.Extensions.DependencyInjection; -using Adyen.Service.Checkout; - -namespace Adyen.Client -{ - /// - /// An IApiFactory interface - /// - public interface IApiFactory - { - /// - /// A method to create an IApi of type IResult - /// - /// - /// - IResult Create() where IResult : IApi; - } - - /// - /// An ApiFactory - /// - public class ApiFactory : IApiFactory - { - /// - /// The service provider - /// - public IServiceProvider Services { get; } - - /// - /// Initializes a new instance of the class. - /// - /// - public ApiFactory(IServiceProvider services) - { - Services = services; - } - - /// - /// A method to create an IApi of type IResult - /// - /// - /// - public IResult Create() where IResult : IApi - { - return Services.GetRequiredService(); - } - } -} diff --git a/Adyen/Client/ApiKeyToken.cs b/Adyen/Client/ApiKeyToken.cs deleted file mode 100644 index 22707f0f5..000000000 --- a/Adyen/Client/ApiKeyToken.cs +++ /dev/null @@ -1,52 +0,0 @@ -// - -using System; - -namespace Adyen.Client -{ - /// - /// A token constructed from an apiKey. - /// - public class ApiKeyToken : TokenBase - { - private string _raw; - - /// - /// The header that this token will be used with. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs an ApiKeyToken object. - /// - /// - /// - /// - /// - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) - { - Header = header; - _raw = $"{ prefix }{ value }"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); - } - - /// - /// Places the token in the query. - /// - /// - /// - /// - public virtual void UseInQuery(global::System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) - { - parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(); - } - } -} \ No newline at end of file diff --git a/Adyen/Client/ApiResponse.cs b/Adyen/Client/ApiResponse.cs index e15791bac..3c0668fbc 100644 --- a/Adyen/Client/ApiResponse.cs +++ b/Adyen/Client/ApiResponse.cs @@ -1,14 +1,15 @@ -// /* * Adyen Checkout API * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! * * The version of the OpenAPI document: 71 * Generated by: https://github.com/openapitools/openapi-generator.git */ + using System; +using System.Collections.Generic; using System.Net; namespace Adyen.Client @@ -16,274 +17,150 @@ namespace Adyen.Client /// /// Provides a non-generic contract for the ApiResponse wrapper. /// - public partial interface IApiResponse + public interface IApiResponse { /// - /// The IsSuccessStatusCode from the api response - /// - bool IsSuccessStatusCode { get; } - - /// - /// Gets the status code (HTTP status code) - /// - /// The status code. - HttpStatusCode StatusCode { get; } - - /// - /// The raw content of this response. + /// The data type of /// - string RawContent { get; } + Type ResponseType { get; } /// - /// The DateTime when the request was retrieved. + /// The content of this response /// - DateTime DownloadedAt { get; } + Object Content { get; } /// - /// The headers contained in the api response + /// Gets or sets the status code (HTTP status code) /// - System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + /// The status code. + HttpStatusCode StatusCode { get; } /// - /// The path used when making the request. + /// Gets or sets the HTTP headers /// - string Path { get; } + /// HTTP headers + Multimap Headers { get; } /// - /// The reason phrase contained in the api response + /// Gets or sets any error text defined by the calling client. /// - string ReasonPhrase { get; } + string ErrorText { get; set; } /// - /// The DateTime when the request was sent. + /// Gets or sets any cookies passed along on the response. /// - DateTime RequestedAt { get; } + List Cookies { get; set; } /// - /// The Uri used when making the request. + /// The raw content of this response /// - Uri RequestUri { get; } + string RawContent { get; } } /// /// API Response /// - public partial class ApiResponse : IApiResponse + public class ApiResponse : IApiResponse { + #region Properties + /// - /// Gets the status code (HTTP status code) + /// Gets or sets the status code (HTTP status code) /// /// The status code. public HttpStatusCode StatusCode { get; } /// - /// The raw data + /// Gets or sets the HTTP headers /// - public string RawContent { get; protected set; } + /// HTTP headers + public Multimap Headers { get; } /// - /// The IsSuccessStatusCode from the api response + /// Gets or sets the data (parsed HTTP body) /// - public bool IsSuccessStatusCode { get; } + /// The data. + public T Data { get; } /// - /// The reason phrase contained in the api response + /// Gets or sets any error text defined by the calling client. /// - public string ReasonPhrase { get; } + public string ErrorText { get; set; } /// - /// The headers contained in the api response + /// Gets or sets any cookies passed along on the response. /// - public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + public List Cookies { get; set; } /// - /// The DateTime when the request was retrieved. + /// The content of this response /// - public DateTime DownloadedAt { get; } = DateTime.UtcNow; + public Type ResponseType + { + get { return typeof(T); } + } /// - /// The DateTime when the request was sent. + /// The data type of /// - public DateTime RequestedAt { get; } + public object Content + { + get { return Data; } + } /// - /// The path used when making the request. + /// The raw content /// - public string Path { get; } + public string RawContent { get; } - /// - /// The Uri used when making the request. - /// - public Uri RequestUri { get; } + #endregion Properties - /// - /// The - /// - protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + #region Constructors /// - /// Construct the response using an HttpResponseMessage + /// Initializes a new instance of the class. /// - /// - /// - /// - /// - /// - /// - public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) { - StatusCode = httpResponseMessage.StatusCode; - Headers = httpResponseMessage.Headers; - IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; - ReasonPhrase = httpResponseMessage.ReasonPhrase; + StatusCode = statusCode; + Headers = headers; + Data = data; RawContent = rawContent; - Path = path; - RequestUri = httpRequestMessage.RequestUri; - RequestedAt = requestedAt; - _jsonSerializerOptions = jsonSerializerOptions; - OnCreated(httpRequestMessage, httpResponseMessage); } - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - } - - /// - /// An interface for responses of type - /// - /// - public interface IBadRequest : IApiResponse - { - /// - /// Deserializes the response if the response is BadRequest - /// - /// - TType BadRequest(); - - /// - /// Returns true if the response is BadRequest and the deserialized response is not null - /// - /// - /// - bool TryBadRequest(out TType result); - } - - /// - /// An interface for responses of type - /// - /// - public interface IUnauthorized : IApiResponse - { - /// - /// Deserializes the response if the response is Unauthorized - /// - /// - TType Unauthorized(); - /// - /// Returns true if the response is Unauthorized and the deserialized response is not null + /// Initializes a new instance of the class. /// - /// - /// - bool TryUnauthorized(out TType result); - } - - /// - /// An interface for responses of type - /// - /// - public interface IForbidden : IApiResponse - { - /// - /// Deserializes the response if the response is Forbidden - /// - /// - TType Forbidden(); - - /// - /// Returns true if the response is Forbidden and the deserialized response is not null - /// - /// - /// - bool TryForbidden(out TType result); - } - - /// - /// An interface for responses of type - /// - /// - public interface IOk : IApiResponse - { - /// - /// Deserializes the response if the response is Ok - /// - /// - TType Ok(); - - /// - /// Returns true if the response is Ok and the deserialized response is not null - /// - /// - /// - bool TryOk(out TType result); - } - - /// - /// An interface for responses of type - /// - /// - public interface IUnprocessableContent : IApiResponse - { - /// - /// Deserializes the response if the response is UnprocessableContent - /// - /// - TType UnprocessableContent(); - - /// - /// Returns true if the response is UnprocessableContent and the deserialized response is not null - /// - /// - /// - bool TryUnprocessableContent(out TType result); - } - - /// - /// An interface for responses of type - /// - /// - public interface IInternalServerError : IApiResponse - { - /// - /// Deserializes the response if the response is InternalServerError - /// - /// - TType InternalServerError(); + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { + } /// - /// Returns true if the response is InternalServerError and the deserialized response is not null + /// Initializes a new instance of the class. /// - /// - /// - bool TryInternalServerError(out TType result); - } + /// HTTP status code. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } - /// - /// An interface for responses of type - /// - /// - public interface ICreated : IApiResponse - { /// - /// Deserializes the response if the response is Created + /// Initializes a new instance of the class. /// - /// - TType Created(); + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) + { + } - /// - /// Returns true if the response is Created and the deserialized response is not null - /// - /// - /// - bool TryCreated(out TType result); + #endregion Constructors } } diff --git a/Adyen/Client/ApiResponseEventArgs.cs b/Adyen/Client/ApiResponseEventArgs.cs deleted file mode 100644 index 0bcd267ab..000000000 --- a/Adyen/Client/ApiResponseEventArgs.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Adyen.Client -{ - /// - /// Useful for tracking server health - /// - public class ApiResponseEventArgs : EventArgs - { - /// - /// The ApiResponse - /// - public ApiResponse ApiResponse { get; } - - /// - /// The ApiResponseEventArgs - /// - /// - public ApiResponseEventArgs(ApiResponse apiResponse) - { - ApiResponse = apiResponse; - } - } -} diff --git a/Adyen/Client/BasicToken.cs b/Adyen/Client/BasicToken.cs deleted file mode 100644 index 0fe32b3a9..000000000 --- a/Adyen/Client/BasicToken.cs +++ /dev/null @@ -1,42 +0,0 @@ -// - -using System; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -namespace Adyen.Client -{ - /// - /// A token constructed from a username and password. - /// - public class BasicToken : TokenBase - { - private string _username; - - private string _password; - - /// - /// Constructs a BasicToken object. - /// - /// - /// - /// - public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) - { - _username = username; - - _password = password; - } - - /// - /// Places the token in the header. - /// - /// - /// - public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) - { - request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Adyen.Client.ClientUtils.Base64Encode(_username + ":" + _password)); - } - } -} \ No newline at end of file diff --git a/Adyen/Client/ClientUtils.cs b/Adyen/Client/ClientUtils.cs index 1cc1cdf12..f8fb5b36b 100644 --- a/Adyen/Client/ClientUtils.cs +++ b/Adyen/Client/ClientUtils.cs @@ -1,22 +1,22 @@ /* * Adyen Checkout API * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! * * The version of the OpenAPI document: 71 * Generated by: https://github.com/openapitools/openapi-generator.git */ + using System; -using System.IO; -using System.Linq; using System.Collections; using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Runtime.Serialization; using System.Text; -using System.Text.Json; using System.Text.RegularExpressions; -using Adyen.Model.Checkout; -using System.Runtime.CompilerServices; namespace Adyen.Client { @@ -25,86 +25,57 @@ namespace Adyen.Client /// public static class ClientUtils { - - /// - /// A delegate for events. - /// - /// - /// - /// - /// - public delegate void EventHandler(object sender, T e) where T : EventArgs; - /// - /// An enum of headers + /// Sanitize filename by removing the path /// - public enum ApiKeyHeader + /// Filename + /// Filename + public static string SanitizeFilename(string filename) { - /// - /// The X-API-Key header - /// - X_API_Key + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; } /// - /// Converte an ApiKeyHeader to a string + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. /// - /// - /// - /// - public static string ApiKeyHeaderToString(ApiKeyHeader value) + /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi + /// Key name. + /// Value object. + /// A multimap of keys with 1..n associated values. + public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) { - switch(value) - { - case ApiKeyHeader.X_API_Key: - return "X-API-Key"; - default: - throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); - } - } + var parameters = new Multimap(); - /// - /// Returns true when deserialization succeeds. - /// - /// - /// - /// - /// - /// - public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) - { - try - { - result = JsonSerializer.Deserialize(json, options); - return result != null; - } - catch (Exception) + if (value is ICollection collection && collectionFormat == "multi") { - result = default; - return false; + foreach (var item in collection) + { + parameters.Add(name, ParameterToString(item)); + } } - } - - /// - /// Returns true when deserialization succeeds. - /// - /// - /// - /// - /// - /// - public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) - { - try + else if (value is IDictionary dictionary) { - result = JsonSerializer.Deserialize(ref reader, options); - return result != null; + if(collectionFormat == "deepObject") { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); + } + } + else { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); + } + } } - catch (Exception) + else { - result = default; - return false; + parameters.Add(name, ParameterToString(value)); } + + return parameters; } /// @@ -113,464 +84,44 @@ public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOp /// Otherwise just return the string. /// /// The parameter (header, path, query, form). - /// The DateTime serialization format. + /// An optional configuration instance, providing formatting options used in processing. /// Formatted string. - public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + public static string ParameterToString(object obj, IReadableConfiguration configuration = null) { if (obj is DateTime dateTime) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 - return dateTime.ToString(format); + return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is DateTimeOffset dateTimeOffset) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 - return dateTimeOffset.ToString(format); + return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) - return boolean - ? "true" - : "false"; - if (obj is AccountInfo.AccountAgeIndicatorEnum accountInfoAccountAgeIndicatorEnum) - return AccountInfo.AccountAgeIndicatorEnumToJsonValue(accountInfoAccountAgeIndicatorEnum); - if (obj is AccountInfo.AccountChangeIndicatorEnum accountInfoAccountChangeIndicatorEnum) - return AccountInfo.AccountChangeIndicatorEnumToJsonValue(accountInfoAccountChangeIndicatorEnum); - if (obj is AccountInfo.AccountTypeEnum accountInfoAccountTypeEnum) - return AccountInfo.AccountTypeEnumToJsonValue(accountInfoAccountTypeEnum); - if (obj is AccountInfo.DeliveryAddressUsageIndicatorEnum accountInfoDeliveryAddressUsageIndicatorEnum) - return AccountInfo.DeliveryAddressUsageIndicatorEnumToJsonValue(accountInfoDeliveryAddressUsageIndicatorEnum); - if (obj is AccountInfo.PasswordChangeIndicatorEnum accountInfoPasswordChangeIndicatorEnum) - return AccountInfo.PasswordChangeIndicatorEnumToJsonValue(accountInfoPasswordChangeIndicatorEnum); - if (obj is AccountInfo.PaymentAccountIndicatorEnum accountInfoPaymentAccountIndicatorEnum) - return AccountInfo.PaymentAccountIndicatorEnumToJsonValue(accountInfoPaymentAccountIndicatorEnum); - if (obj is AcctInfo.ChAccAgeIndEnum acctInfoChAccAgeIndEnum) - return AcctInfo.ChAccAgeIndEnumToJsonValue(acctInfoChAccAgeIndEnum); - if (obj is AcctInfo.ChAccChangeIndEnum acctInfoChAccChangeIndEnum) - return AcctInfo.ChAccChangeIndEnumToJsonValue(acctInfoChAccChangeIndEnum); - if (obj is AcctInfo.ChAccPwChangeIndEnum acctInfoChAccPwChangeIndEnum) - return AcctInfo.ChAccPwChangeIndEnumToJsonValue(acctInfoChAccPwChangeIndEnum); - if (obj is AcctInfo.PaymentAccIndEnum acctInfoPaymentAccIndEnum) - return AcctInfo.PaymentAccIndEnumToJsonValue(acctInfoPaymentAccIndEnum); - if (obj is AcctInfo.ShipAddressUsageIndEnum acctInfoShipAddressUsageIndEnum) - return AcctInfo.ShipAddressUsageIndEnumToJsonValue(acctInfoShipAddressUsageIndEnum); - if (obj is AcctInfo.ShipNameIndicatorEnum acctInfoShipNameIndicatorEnum) - return AcctInfo.ShipNameIndicatorEnumToJsonValue(acctInfoShipNameIndicatorEnum); - if (obj is AcctInfo.SuspiciousAccActivityEnum acctInfoSuspiciousAccActivityEnum) - return AcctInfo.SuspiciousAccActivityEnumToJsonValue(acctInfoSuspiciousAccActivityEnum); - if (obj is AchDetails.AccountHolderTypeEnum achDetailsAccountHolderTypeEnum) - return AchDetails.AccountHolderTypeEnumToJsonValue(achDetailsAccountHolderTypeEnum); - if (obj is AchDetails.BankAccountTypeEnum achDetailsBankAccountTypeEnum) - return AchDetails.BankAccountTypeEnumToJsonValue(achDetailsBankAccountTypeEnum); - if (obj is AchDetails.TypeEnum achDetailsTypeEnum) - return AchDetails.TypeEnumToJsonValue(achDetailsTypeEnum); - if (obj is AdditionalData3DSecure.ChallengeWindowSizeEnum additionalData3DSecureChallengeWindowSizeEnum) - return AdditionalData3DSecure.ChallengeWindowSizeEnumToJsonValue(additionalData3DSecureChallengeWindowSizeEnum); - if (obj is AdditionalDataCommon.IndustryUsageEnum additionalDataCommonIndustryUsageEnum) - return AdditionalDataCommon.IndustryUsageEnumToJsonValue(additionalDataCommonIndustryUsageEnum); - if (obj is AffirmDetails.TypeEnum affirmDetailsTypeEnum) - return AffirmDetails.TypeEnumToJsonValue(affirmDetailsTypeEnum); - if (obj is AfterpayDetails.TypeEnum afterpayDetailsTypeEnum) - return AfterpayDetails.TypeEnumToJsonValue(afterpayDetailsTypeEnum); - if (obj is AmazonPayDetails.TypeEnum amazonPayDetailsTypeEnum) - return AmazonPayDetails.TypeEnumToJsonValue(amazonPayDetailsTypeEnum); - if (obj is AncvDetails.TypeEnum ancvDetailsTypeEnum) - return AncvDetails.TypeEnumToJsonValue(ancvDetailsTypeEnum); - if (obj is AndroidPayDetails.TypeEnum androidPayDetailsTypeEnum) - return AndroidPayDetails.TypeEnumToJsonValue(androidPayDetailsTypeEnum); - if (obj is ApplePayDetails.FundingSourceEnum applePayDetailsFundingSourceEnum) - return ApplePayDetails.FundingSourceEnumToJsonValue(applePayDetailsFundingSourceEnum); - if (obj is ApplePayDetails.TypeEnum applePayDetailsTypeEnum) - return ApplePayDetails.TypeEnumToJsonValue(applePayDetailsTypeEnum); - if (obj is ApplePayDonations.FundingSourceEnum applePayDonationsFundingSourceEnum) - return ApplePayDonations.FundingSourceEnumToJsonValue(applePayDonationsFundingSourceEnum); - if (obj is ApplePayDonations.TypeEnum applePayDonationsTypeEnum) - return ApplePayDonations.TypeEnumToJsonValue(applePayDonationsTypeEnum); - if (obj is AuthenticationData.AttemptAuthenticationEnum authenticationDataAttemptAuthenticationEnum) - return AuthenticationData.AttemptAuthenticationEnumToJsonValue(authenticationDataAttemptAuthenticationEnum); - if (obj is BacsDirectDebitDetails.TypeEnum bacsDirectDebitDetailsTypeEnum) - return BacsDirectDebitDetails.TypeEnumToJsonValue(bacsDirectDebitDetailsTypeEnum); - if (obj is BalanceCheckRequest.RecurringProcessingModelEnum balanceCheckRequestRecurringProcessingModelEnum) - return BalanceCheckRequest.RecurringProcessingModelEnumToJsonValue(balanceCheckRequestRecurringProcessingModelEnum); - if (obj is BalanceCheckRequest.ShopperInteractionEnum balanceCheckRequestShopperInteractionEnum) - return BalanceCheckRequest.ShopperInteractionEnumToJsonValue(balanceCheckRequestShopperInteractionEnum); - if (obj is BalanceCheckResponse.ResultCodeEnum balanceCheckResponseResultCodeEnum) - return BalanceCheckResponse.ResultCodeEnumToJsonValue(balanceCheckResponseResultCodeEnum); - if (obj is BillDeskDetails.TypeEnum billDeskDetailsTypeEnum) - return BillDeskDetails.TypeEnumToJsonValue(billDeskDetailsTypeEnum); - if (obj is BlikDetails.TypeEnum blikDetailsTypeEnum) - return BlikDetails.TypeEnumToJsonValue(blikDetailsTypeEnum); - if (obj is CancelOrderResponse.ResultCodeEnum cancelOrderResponseResultCodeEnum) - return CancelOrderResponse.ResultCodeEnumToJsonValue(cancelOrderResponseResultCodeEnum); - if (obj is CardDetails.FundingSourceEnum cardDetailsFundingSourceEnum) - return CardDetails.FundingSourceEnumToJsonValue(cardDetailsFundingSourceEnum); - if (obj is CardDetails.TypeEnum cardDetailsTypeEnum) - return CardDetails.TypeEnumToJsonValue(cardDetailsTypeEnum); - if (obj is CardDonations.FundingSourceEnum cardDonationsFundingSourceEnum) - return CardDonations.FundingSourceEnumToJsonValue(cardDonationsFundingSourceEnum); - if (obj is CardDonations.TypeEnum cardDonationsTypeEnum) - return CardDonations.TypeEnumToJsonValue(cardDonationsTypeEnum); - if (obj is CashAppDetails.TypeEnum cashAppDetailsTypeEnum) - return CashAppDetails.TypeEnumToJsonValue(cashAppDetailsTypeEnum); - if (obj is CellulantDetails.TypeEnum cellulantDetailsTypeEnum) - return CellulantDetails.TypeEnumToJsonValue(cellulantDetailsTypeEnum); - if (obj is CheckoutAwaitAction.TypeEnum checkoutAwaitActionTypeEnum) - return CheckoutAwaitAction.TypeEnumToJsonValue(checkoutAwaitActionTypeEnum); - if (obj is CheckoutBankAccount.AccountTypeEnum checkoutBankAccountAccountTypeEnum) - return CheckoutBankAccount.AccountTypeEnumToJsonValue(checkoutBankAccountAccountTypeEnum); - if (obj is CheckoutBankTransferAction.TypeEnum checkoutBankTransferActionTypeEnum) - return CheckoutBankTransferAction.TypeEnumToJsonValue(checkoutBankTransferActionTypeEnum); - if (obj is CheckoutDelegatedAuthenticationAction.TypeEnum checkoutDelegatedAuthenticationActionTypeEnum) - return CheckoutDelegatedAuthenticationAction.TypeEnumToJsonValue(checkoutDelegatedAuthenticationActionTypeEnum); - if (obj is CheckoutNativeRedirectAction.TypeEnum checkoutNativeRedirectActionTypeEnum) - return CheckoutNativeRedirectAction.TypeEnumToJsonValue(checkoutNativeRedirectActionTypeEnum); - if (obj is CheckoutQrCodeAction.TypeEnum checkoutQrCodeActionTypeEnum) - return CheckoutQrCodeAction.TypeEnumToJsonValue(checkoutQrCodeActionTypeEnum); - if (obj is CheckoutRedirectAction.TypeEnum checkoutRedirectActionTypeEnum) - return CheckoutRedirectAction.TypeEnumToJsonValue(checkoutRedirectActionTypeEnum); - if (obj is CheckoutSDKAction.TypeEnum checkoutSDKActionTypeEnum) - return CheckoutSDKAction.TypeEnumToJsonValue(checkoutSDKActionTypeEnum); - if (obj is CheckoutSessionInstallmentOption.PlansEnum checkoutSessionInstallmentOptionPlansEnum) - return CheckoutSessionInstallmentOption.PlansEnumToJsonValue(checkoutSessionInstallmentOptionPlansEnum); - if (obj is CheckoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndEnum checkoutSessionThreeDS2RequestDataThreeDSRequestorChallengeIndEnum) - return CheckoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumToJsonValue(checkoutSessionThreeDS2RequestDataThreeDSRequestorChallengeIndEnum); - if (obj is CheckoutThreeDS2Action.TypeEnum checkoutThreeDS2ActionTypeEnum) - return CheckoutThreeDS2Action.TypeEnumToJsonValue(checkoutThreeDS2ActionTypeEnum); - if (obj is CheckoutVoucherAction.TypeEnum checkoutVoucherActionTypeEnum) - return CheckoutVoucherAction.TypeEnumToJsonValue(checkoutVoucherActionTypeEnum); - if (obj is CreateCheckoutSessionRequest.ChannelEnum createCheckoutSessionRequestChannelEnum) - return CreateCheckoutSessionRequest.ChannelEnumToJsonValue(createCheckoutSessionRequestChannelEnum); - if (obj is CreateCheckoutSessionRequest.ModeEnum createCheckoutSessionRequestModeEnum) - return CreateCheckoutSessionRequest.ModeEnumToJsonValue(createCheckoutSessionRequestModeEnum); - if (obj is CreateCheckoutSessionRequest.RecurringProcessingModelEnum createCheckoutSessionRequestRecurringProcessingModelEnum) - return CreateCheckoutSessionRequest.RecurringProcessingModelEnumToJsonValue(createCheckoutSessionRequestRecurringProcessingModelEnum); - if (obj is CreateCheckoutSessionRequest.ShopperInteractionEnum createCheckoutSessionRequestShopperInteractionEnum) - return CreateCheckoutSessionRequest.ShopperInteractionEnumToJsonValue(createCheckoutSessionRequestShopperInteractionEnum); - if (obj is CreateCheckoutSessionRequest.StoreFiltrationModeEnum createCheckoutSessionRequestStoreFiltrationModeEnum) - return CreateCheckoutSessionRequest.StoreFiltrationModeEnumToJsonValue(createCheckoutSessionRequestStoreFiltrationModeEnum); - if (obj is CreateCheckoutSessionRequest.StorePaymentMethodModeEnum createCheckoutSessionRequestStorePaymentMethodModeEnum) - return CreateCheckoutSessionRequest.StorePaymentMethodModeEnumToJsonValue(createCheckoutSessionRequestStorePaymentMethodModeEnum); - if (obj is CreateCheckoutSessionResponse.ChannelEnum createCheckoutSessionResponseChannelEnum) - return CreateCheckoutSessionResponse.ChannelEnumToJsonValue(createCheckoutSessionResponseChannelEnum); - if (obj is CreateCheckoutSessionResponse.ModeEnum createCheckoutSessionResponseModeEnum) - return CreateCheckoutSessionResponse.ModeEnumToJsonValue(createCheckoutSessionResponseModeEnum); - if (obj is CreateCheckoutSessionResponse.RecurringProcessingModelEnum createCheckoutSessionResponseRecurringProcessingModelEnum) - return CreateCheckoutSessionResponse.RecurringProcessingModelEnumToJsonValue(createCheckoutSessionResponseRecurringProcessingModelEnum); - if (obj is CreateCheckoutSessionResponse.ShopperInteractionEnum createCheckoutSessionResponseShopperInteractionEnum) - return CreateCheckoutSessionResponse.ShopperInteractionEnumToJsonValue(createCheckoutSessionResponseShopperInteractionEnum); - if (obj is CreateCheckoutSessionResponse.StoreFiltrationModeEnum createCheckoutSessionResponseStoreFiltrationModeEnum) - return CreateCheckoutSessionResponse.StoreFiltrationModeEnumToJsonValue(createCheckoutSessionResponseStoreFiltrationModeEnum); - if (obj is CreateCheckoutSessionResponse.StorePaymentMethodModeEnum createCheckoutSessionResponseStorePaymentMethodModeEnum) - return CreateCheckoutSessionResponse.StorePaymentMethodModeEnumToJsonValue(createCheckoutSessionResponseStorePaymentMethodModeEnum); - if (obj is CreateOrderResponse.ResultCodeEnum createOrderResponseResultCodeEnum) - return CreateOrderResponse.ResultCodeEnumToJsonValue(createOrderResponseResultCodeEnum); - if (obj is DeliveryMethod.TypeEnum deliveryMethodTypeEnum) - return DeliveryMethod.TypeEnumToJsonValue(deliveryMethodTypeEnum); - if (obj is DeviceRenderOptions.SdkInterfaceEnum deviceRenderOptionsSdkInterfaceEnum) - return DeviceRenderOptions.SdkInterfaceEnumToJsonValue(deviceRenderOptionsSdkInterfaceEnum); - if (obj is DeviceRenderOptions.SdkUiTypeEnum deviceRenderOptionsSdkUiTypeEnum) - return DeviceRenderOptions.SdkUiTypeEnumToJsonValue(deviceRenderOptionsSdkUiTypeEnum); - if (obj is DokuDetails.TypeEnum dokuDetailsTypeEnum) - return DokuDetails.TypeEnumToJsonValue(dokuDetailsTypeEnum); - if (obj is DonationPaymentRequest.ChannelEnum donationPaymentRequestChannelEnum) - return DonationPaymentRequest.ChannelEnumToJsonValue(donationPaymentRequestChannelEnum); - if (obj is DonationPaymentRequest.RecurringProcessingModelEnum donationPaymentRequestRecurringProcessingModelEnum) - return DonationPaymentRequest.RecurringProcessingModelEnumToJsonValue(donationPaymentRequestRecurringProcessingModelEnum); - if (obj is DonationPaymentRequest.ShopperInteractionEnum donationPaymentRequestShopperInteractionEnum) - return DonationPaymentRequest.ShopperInteractionEnumToJsonValue(donationPaymentRequestShopperInteractionEnum); - if (obj is DonationPaymentResponse.StatusEnum donationPaymentResponseStatusEnum) - return DonationPaymentResponse.StatusEnumToJsonValue(donationPaymentResponseStatusEnum); - if (obj is DragonpayDetails.TypeEnum dragonpayDetailsTypeEnum) - return DragonpayDetails.TypeEnumToJsonValue(dragonpayDetailsTypeEnum); - if (obj is EBankingFinlandDetails.TypeEnum eBankingFinlandDetailsTypeEnum) - return EBankingFinlandDetails.TypeEnumToJsonValue(eBankingFinlandDetailsTypeEnum); - if (obj is EcontextVoucherDetails.TypeEnum econtextVoucherDetailsTypeEnum) - return EcontextVoucherDetails.TypeEnumToJsonValue(econtextVoucherDetailsTypeEnum); - if (obj is EftDetails.TypeEnum eftDetailsTypeEnum) - return EftDetails.TypeEnumToJsonValue(eftDetailsTypeEnum); - if (obj is FastlaneDetails.TypeEnum fastlaneDetailsTypeEnum) - return FastlaneDetails.TypeEnumToJsonValue(fastlaneDetailsTypeEnum); - if (obj is FundRecipient.WalletPurposeEnum fundRecipientWalletPurposeEnum) - return FundRecipient.WalletPurposeEnumToJsonValue(fundRecipientWalletPurposeEnum); - if (obj is GenericIssuerPaymentMethodDetails.TypeEnum genericIssuerPaymentMethodDetailsTypeEnum) - return GenericIssuerPaymentMethodDetails.TypeEnumToJsonValue(genericIssuerPaymentMethodDetailsTypeEnum); - if (obj is GooglePayDetails.FundingSourceEnum googlePayDetailsFundingSourceEnum) - return GooglePayDetails.FundingSourceEnumToJsonValue(googlePayDetailsFundingSourceEnum); - if (obj is GooglePayDetails.TypeEnum googlePayDetailsTypeEnum) - return GooglePayDetails.TypeEnumToJsonValue(googlePayDetailsTypeEnum); - if (obj is GooglePayDonations.FundingSourceEnum googlePayDonationsFundingSourceEnum) - return GooglePayDonations.FundingSourceEnumToJsonValue(googlePayDonationsFundingSourceEnum); - if (obj is GooglePayDonations.TypeEnum googlePayDonationsTypeEnum) - return GooglePayDonations.TypeEnumToJsonValue(googlePayDonationsTypeEnum); - if (obj is IdealDetails.TypeEnum idealDetailsTypeEnum) - return IdealDetails.TypeEnumToJsonValue(idealDetailsTypeEnum); - if (obj is IdealDonations.TypeEnum idealDonationsTypeEnum) - return IdealDonations.TypeEnumToJsonValue(idealDonationsTypeEnum); - if (obj is InstallmentOption.PlansEnum installmentOptionPlansEnum) - return InstallmentOption.PlansEnumToJsonValue(installmentOptionPlansEnum); - if (obj is Installments.PlanEnum installmentsPlanEnum) - return Installments.PlanEnumToJsonValue(installmentsPlanEnum); - if (obj is KlarnaDetails.TypeEnum klarnaDetailsTypeEnum) - return KlarnaDetails.TypeEnumToJsonValue(klarnaDetailsTypeEnum); - if (obj is Mandate.FrequencyEnum mandateFrequencyEnum) - return Mandate.FrequencyEnumToJsonValue(mandateFrequencyEnum); - if (obj is Mandate.AmountRuleEnum mandateAmountRuleEnum) - return Mandate.AmountRuleEnumToJsonValue(mandateAmountRuleEnum); - if (obj is Mandate.BillingAttemptsRuleEnum mandateBillingAttemptsRuleEnum) - return Mandate.BillingAttemptsRuleEnumToJsonValue(mandateBillingAttemptsRuleEnum); - if (obj is MasterpassDetails.FundingSourceEnum masterpassDetailsFundingSourceEnum) - return MasterpassDetails.FundingSourceEnumToJsonValue(masterpassDetailsFundingSourceEnum); - if (obj is MasterpassDetails.TypeEnum masterpassDetailsTypeEnum) - return MasterpassDetails.TypeEnumToJsonValue(masterpassDetailsTypeEnum); - if (obj is MbwayDetails.TypeEnum mbwayDetailsTypeEnum) - return MbwayDetails.TypeEnumToJsonValue(mbwayDetailsTypeEnum); - if (obj is MerchantRiskIndicator.DeliveryAddressIndicatorEnum merchantRiskIndicatorDeliveryAddressIndicatorEnum) - return MerchantRiskIndicator.DeliveryAddressIndicatorEnumToJsonValue(merchantRiskIndicatorDeliveryAddressIndicatorEnum); - if (obj is MerchantRiskIndicator.DeliveryTimeframeEnum merchantRiskIndicatorDeliveryTimeframeEnum) - return MerchantRiskIndicator.DeliveryTimeframeEnumToJsonValue(merchantRiskIndicatorDeliveryTimeframeEnum); - if (obj is MobilePayDetails.TypeEnum mobilePayDetailsTypeEnum) - return MobilePayDetails.TypeEnumToJsonValue(mobilePayDetailsTypeEnum); - if (obj is MolPayDetails.TypeEnum molPayDetailsTypeEnum) - return MolPayDetails.TypeEnumToJsonValue(molPayDetailsTypeEnum); - if (obj is OpenInvoiceDetails.TypeEnum openInvoiceDetailsTypeEnum) - return OpenInvoiceDetails.TypeEnumToJsonValue(openInvoiceDetailsTypeEnum); - if (obj is PayByBankAISDirectDebitDetails.TypeEnum payByBankAISDirectDebitDetailsTypeEnum) - return PayByBankAISDirectDebitDetails.TypeEnumToJsonValue(payByBankAISDirectDebitDetailsTypeEnum); - if (obj is PayByBankDetails.TypeEnum payByBankDetailsTypeEnum) - return PayByBankDetails.TypeEnumToJsonValue(payByBankDetailsTypeEnum); - if (obj is PayPalDetails.SubtypeEnum payPalDetailsSubtypeEnum) - return PayPalDetails.SubtypeEnumToJsonValue(payPalDetailsSubtypeEnum); - if (obj is PayPalDetails.TypeEnum payPalDetailsTypeEnum) - return PayPalDetails.TypeEnumToJsonValue(payPalDetailsTypeEnum); - if (obj is PayPayDetails.TypeEnum payPayDetailsTypeEnum) - return PayPayDetails.TypeEnumToJsonValue(payPayDetailsTypeEnum); - if (obj is PayToDetails.TypeEnum payToDetailsTypeEnum) - return PayToDetails.TypeEnumToJsonValue(payToDetailsTypeEnum); - if (obj is PayUUpiDetails.TypeEnum payUUpiDetailsTypeEnum) - return PayUUpiDetails.TypeEnumToJsonValue(payUUpiDetailsTypeEnum); - if (obj is PayWithGoogleDetails.FundingSourceEnum payWithGoogleDetailsFundingSourceEnum) - return PayWithGoogleDetails.FundingSourceEnumToJsonValue(payWithGoogleDetailsFundingSourceEnum); - if (obj is PayWithGoogleDetails.TypeEnum payWithGoogleDetailsTypeEnum) - return PayWithGoogleDetails.TypeEnumToJsonValue(payWithGoogleDetailsTypeEnum); - if (obj is PayWithGoogleDonations.FundingSourceEnum payWithGoogleDonationsFundingSourceEnum) - return PayWithGoogleDonations.FundingSourceEnumToJsonValue(payWithGoogleDonationsFundingSourceEnum); - if (obj is PayWithGoogleDonations.TypeEnum payWithGoogleDonationsTypeEnum) - return PayWithGoogleDonations.TypeEnumToJsonValue(payWithGoogleDonationsTypeEnum); - if (obj is Payment.ResultCodeEnum paymentResultCodeEnum) - return Payment.ResultCodeEnumToJsonValue(paymentResultCodeEnum); - if (obj is PaymentAmountUpdateRequest.IndustryUsageEnum paymentAmountUpdateRequestIndustryUsageEnum) - return PaymentAmountUpdateRequest.IndustryUsageEnumToJsonValue(paymentAmountUpdateRequestIndustryUsageEnum); - if (obj is PaymentAmountUpdateResponse.StatusEnum paymentAmountUpdateResponseStatusEnum) - return PaymentAmountUpdateResponse.StatusEnumToJsonValue(paymentAmountUpdateResponseStatusEnum); - if (obj is PaymentAmountUpdateResponse.IndustryUsageEnum paymentAmountUpdateResponseIndustryUsageEnum) - return PaymentAmountUpdateResponse.IndustryUsageEnumToJsonValue(paymentAmountUpdateResponseIndustryUsageEnum); - if (obj is PaymentCancelResponse.StatusEnum paymentCancelResponseStatusEnum) - return PaymentCancelResponse.StatusEnumToJsonValue(paymentCancelResponseStatusEnum); - if (obj is PaymentCaptureResponse.StatusEnum paymentCaptureResponseStatusEnum) - return PaymentCaptureResponse.StatusEnumToJsonValue(paymentCaptureResponseStatusEnum); - if (obj is PaymentDetails.TypeEnum paymentDetailsTypeEnum) - return PaymentDetails.TypeEnumToJsonValue(paymentDetailsTypeEnum); - if (obj is PaymentDetailsResponse.ResultCodeEnum paymentDetailsResponseResultCodeEnum) - return PaymentDetailsResponse.ResultCodeEnumToJsonValue(paymentDetailsResponseResultCodeEnum); - if (obj is PaymentLinkRequest.RecurringProcessingModelEnum paymentLinkRequestRecurringProcessingModelEnum) - return PaymentLinkRequest.RecurringProcessingModelEnumToJsonValue(paymentLinkRequestRecurringProcessingModelEnum); - if (obj is PaymentLinkRequest.RequiredShopperFieldsEnum paymentLinkRequestRequiredShopperFieldsEnum) - return PaymentLinkRequest.RequiredShopperFieldsEnumToJsonValue(paymentLinkRequestRequiredShopperFieldsEnum); - if (obj is PaymentLinkRequest.StorePaymentMethodModeEnum paymentLinkRequestStorePaymentMethodModeEnum) - return PaymentLinkRequest.StorePaymentMethodModeEnumToJsonValue(paymentLinkRequestStorePaymentMethodModeEnum); - if (obj is PaymentLinkResponse.StatusEnum paymentLinkResponseStatusEnum) - return PaymentLinkResponse.StatusEnumToJsonValue(paymentLinkResponseStatusEnum); - if (obj is PaymentLinkResponse.RecurringProcessingModelEnum paymentLinkResponseRecurringProcessingModelEnum) - return PaymentLinkResponse.RecurringProcessingModelEnumToJsonValue(paymentLinkResponseRecurringProcessingModelEnum); - if (obj is PaymentLinkResponse.RequiredShopperFieldsEnum paymentLinkResponseRequiredShopperFieldsEnum) - return PaymentLinkResponse.RequiredShopperFieldsEnumToJsonValue(paymentLinkResponseRequiredShopperFieldsEnum); - if (obj is PaymentLinkResponse.StorePaymentMethodModeEnum paymentLinkResponseStorePaymentMethodModeEnum) - return PaymentLinkResponse.StorePaymentMethodModeEnumToJsonValue(paymentLinkResponseStorePaymentMethodModeEnum); - if (obj is PaymentMethod.FundingSourceEnum paymentMethodFundingSourceEnum) - return PaymentMethod.FundingSourceEnumToJsonValue(paymentMethodFundingSourceEnum); - if (obj is PaymentMethodsRequest.ChannelEnum paymentMethodsRequestChannelEnum) - return PaymentMethodsRequest.ChannelEnumToJsonValue(paymentMethodsRequestChannelEnum); - if (obj is PaymentMethodsRequest.StoreFiltrationModeEnum paymentMethodsRequestStoreFiltrationModeEnum) - return PaymentMethodsRequest.StoreFiltrationModeEnumToJsonValue(paymentMethodsRequestStoreFiltrationModeEnum); - if (obj is PaymentRefundRequest.MerchantRefundReasonEnum paymentRefundRequestMerchantRefundReasonEnum) - return PaymentRefundRequest.MerchantRefundReasonEnumToJsonValue(paymentRefundRequestMerchantRefundReasonEnum); - if (obj is PaymentRefundResponse.StatusEnum paymentRefundResponseStatusEnum) - return PaymentRefundResponse.StatusEnumToJsonValue(paymentRefundResponseStatusEnum); - if (obj is PaymentRefundResponse.MerchantRefundReasonEnum paymentRefundResponseMerchantRefundReasonEnum) - return PaymentRefundResponse.MerchantRefundReasonEnumToJsonValue(paymentRefundResponseMerchantRefundReasonEnum); - if (obj is PaymentRequest.ChannelEnum paymentRequestChannelEnum) - return PaymentRequest.ChannelEnumToJsonValue(paymentRequestChannelEnum); - if (obj is PaymentRequest.EntityTypeEnum paymentRequestEntityTypeEnum) - return PaymentRequest.EntityTypeEnumToJsonValue(paymentRequestEntityTypeEnum); - if (obj is PaymentRequest.IndustryUsageEnum paymentRequestIndustryUsageEnum) - return PaymentRequest.IndustryUsageEnumToJsonValue(paymentRequestIndustryUsageEnum); - if (obj is PaymentRequest.RecurringProcessingModelEnum paymentRequestRecurringProcessingModelEnum) - return PaymentRequest.RecurringProcessingModelEnumToJsonValue(paymentRequestRecurringProcessingModelEnum); - if (obj is PaymentRequest.ShopperInteractionEnum paymentRequestShopperInteractionEnum) - return PaymentRequest.ShopperInteractionEnumToJsonValue(paymentRequestShopperInteractionEnum); - if (obj is PaymentResponse.ResultCodeEnum paymentResponseResultCodeEnum) - return PaymentResponse.ResultCodeEnumToJsonValue(paymentResponseResultCodeEnum); - if (obj is PaymentReversalResponse.StatusEnum paymentReversalResponseStatusEnum) - return PaymentReversalResponse.StatusEnumToJsonValue(paymentReversalResponseStatusEnum); - if (obj is PaypalUpdateOrderResponse.StatusEnum paypalUpdateOrderResponseStatusEnum) - return PaypalUpdateOrderResponse.StatusEnumToJsonValue(paypalUpdateOrderResponseStatusEnum); - if (obj is PixDetails.TypeEnum pixDetailsTypeEnum) - return PixDetails.TypeEnumToJsonValue(pixDetailsTypeEnum); - if (obj is PixRecurring.FrequencyEnum pixRecurringFrequencyEnum) - return PixRecurring.FrequencyEnumToJsonValue(pixRecurringFrequencyEnum); - if (obj is PlatformChargebackLogic.BehaviorEnum platformChargebackLogicBehaviorEnum) - return PlatformChargebackLogic.BehaviorEnumToJsonValue(platformChargebackLogicBehaviorEnum); - if (obj is PseDetails.TypeEnum pseDetailsTypeEnum) - return PseDetails.TypeEnumToJsonValue(pseDetailsTypeEnum); - if (obj is RakutenPayDetails.TypeEnum rakutenPayDetailsTypeEnum) - return RakutenPayDetails.TypeEnumToJsonValue(rakutenPayDetailsTypeEnum); - if (obj is RatepayDetails.TypeEnum ratepayDetailsTypeEnum) - return RatepayDetails.TypeEnumToJsonValue(ratepayDetailsTypeEnum); - if (obj is Recurring.ContractEnum recurringContractEnum) - return Recurring.ContractEnumToJsonValue(recurringContractEnum); - if (obj is Recurring.TokenServiceEnum recurringTokenServiceEnum) - return Recurring.TokenServiceEnumToJsonValue(recurringTokenServiceEnum); - if (obj is ResponseAdditionalDataCard.CardProductIdEnum responseAdditionalDataCardCardProductIdEnum) - return ResponseAdditionalDataCard.CardProductIdEnumToJsonValue(responseAdditionalDataCardCardProductIdEnum); - if (obj is ResponseAdditionalDataCommon.FraudResultTypeEnum responseAdditionalDataCommonFraudResultTypeEnum) - return ResponseAdditionalDataCommon.FraudResultTypeEnumToJsonValue(responseAdditionalDataCommonFraudResultTypeEnum); - if (obj is ResponseAdditionalDataCommon.FraudRiskLevelEnum responseAdditionalDataCommonFraudRiskLevelEnum) - return ResponseAdditionalDataCommon.FraudRiskLevelEnumToJsonValue(responseAdditionalDataCommonFraudRiskLevelEnum); - if (obj is ResponseAdditionalDataCommon.RecurringProcessingModelEnum responseAdditionalDataCommonRecurringProcessingModelEnum) - return ResponseAdditionalDataCommon.RecurringProcessingModelEnumToJsonValue(responseAdditionalDataCommonRecurringProcessingModelEnum); - if (obj is ResponseAdditionalDataCommon.TokenizationStoreOperationTypeEnum responseAdditionalDataCommonTokenizationStoreOperationTypeEnum) - return ResponseAdditionalDataCommon.TokenizationStoreOperationTypeEnumToJsonValue(responseAdditionalDataCommonTokenizationStoreOperationTypeEnum); - if (obj is RivertyDetails.TypeEnum rivertyDetailsTypeEnum) - return RivertyDetails.TypeEnumToJsonValue(rivertyDetailsTypeEnum); - if (obj is SamsungPayDetails.FundingSourceEnum samsungPayDetailsFundingSourceEnum) - return SamsungPayDetails.FundingSourceEnumToJsonValue(samsungPayDetailsFundingSourceEnum); - if (obj is SamsungPayDetails.TypeEnum samsungPayDetailsTypeEnum) - return SamsungPayDetails.TypeEnumToJsonValue(samsungPayDetailsTypeEnum); - if (obj is SepaDirectDebitDetails.TypeEnum sepaDirectDebitDetailsTypeEnum) - return SepaDirectDebitDetails.TypeEnumToJsonValue(sepaDirectDebitDetailsTypeEnum); - if (obj is SessionResultResponse.StatusEnum sessionResultResponseStatusEnum) - return SessionResultResponse.StatusEnumToJsonValue(sessionResultResponseStatusEnum); - if (obj is Split.TypeEnum splitTypeEnum) - return Split.TypeEnumToJsonValue(splitTypeEnum); - if (obj is StandalonePaymentCancelResponse.StatusEnum standalonePaymentCancelResponseStatusEnum) - return StandalonePaymentCancelResponse.StatusEnumToJsonValue(standalonePaymentCancelResponseStatusEnum); - if (obj is StoredPaymentMethodDetails.TypeEnum storedPaymentMethodDetailsTypeEnum) - return StoredPaymentMethodDetails.TypeEnumToJsonValue(storedPaymentMethodDetailsTypeEnum); - if (obj is StoredPaymentMethodRequest.RecurringProcessingModelEnum storedPaymentMethodRequestRecurringProcessingModelEnum) - return StoredPaymentMethodRequest.RecurringProcessingModelEnumToJsonValue(storedPaymentMethodRequestRecurringProcessingModelEnum); - if (obj is ThreeDS2RequestData.AcctTypeEnum threeDS2RequestDataAcctTypeEnum) - return ThreeDS2RequestData.AcctTypeEnumToJsonValue(threeDS2RequestDataAcctTypeEnum); - if (obj is ThreeDS2RequestData.AddrMatchEnum threeDS2RequestDataAddrMatchEnum) - return ThreeDS2RequestData.AddrMatchEnumToJsonValue(threeDS2RequestDataAddrMatchEnum); - if (obj is ThreeDS2RequestData.ChallengeIndicatorEnum threeDS2RequestDataChallengeIndicatorEnum) - return ThreeDS2RequestData.ChallengeIndicatorEnumToJsonValue(threeDS2RequestDataChallengeIndicatorEnum); - if (obj is ThreeDS2RequestData.ThreeDSRequestorChallengeIndEnum threeDS2RequestDataThreeDSRequestorChallengeIndEnum) - return ThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2RequestDataThreeDSRequestorChallengeIndEnum); - if (obj is ThreeDS2RequestData.TransTypeEnum threeDS2RequestDataTransTypeEnum) - return ThreeDS2RequestData.TransTypeEnumToJsonValue(threeDS2RequestDataTransTypeEnum); - if (obj is ThreeDS2RequestData.TransactionTypeEnum threeDS2RequestDataTransactionTypeEnum) - return ThreeDS2RequestData.TransactionTypeEnumToJsonValue(threeDS2RequestDataTransactionTypeEnum); - if (obj is ThreeDS2RequestFields.AcctTypeEnum threeDS2RequestFieldsAcctTypeEnum) - return ThreeDS2RequestFields.AcctTypeEnumToJsonValue(threeDS2RequestFieldsAcctTypeEnum); - if (obj is ThreeDS2RequestFields.AddrMatchEnum threeDS2RequestFieldsAddrMatchEnum) - return ThreeDS2RequestFields.AddrMatchEnumToJsonValue(threeDS2RequestFieldsAddrMatchEnum); - if (obj is ThreeDS2RequestFields.ChallengeIndicatorEnum threeDS2RequestFieldsChallengeIndicatorEnum) - return ThreeDS2RequestFields.ChallengeIndicatorEnumToJsonValue(threeDS2RequestFieldsChallengeIndicatorEnum); - if (obj is ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnum threeDS2RequestFieldsThreeDSRequestorChallengeIndEnum) - return ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2RequestFieldsThreeDSRequestorChallengeIndEnum); - if (obj is ThreeDS2RequestFields.TransTypeEnum threeDS2RequestFieldsTransTypeEnum) - return ThreeDS2RequestFields.TransTypeEnumToJsonValue(threeDS2RequestFieldsTransTypeEnum); - if (obj is ThreeDS2RequestFields.TransactionTypeEnum threeDS2RequestFieldsTransactionTypeEnum) - return ThreeDS2RequestFields.TransactionTypeEnumToJsonValue(threeDS2RequestFieldsTransactionTypeEnum); - if (obj is ThreeDS2Result.ChallengeCancelEnum threeDS2ResultChallengeCancelEnum) - return ThreeDS2Result.ChallengeCancelEnumToJsonValue(threeDS2ResultChallengeCancelEnum); - if (obj is ThreeDS2Result.ExemptionIndicatorEnum threeDS2ResultExemptionIndicatorEnum) - return ThreeDS2Result.ExemptionIndicatorEnumToJsonValue(threeDS2ResultExemptionIndicatorEnum); - if (obj is ThreeDS2Result.ThreeDSRequestorChallengeIndEnum threeDS2ResultThreeDSRequestorChallengeIndEnum) - return ThreeDS2Result.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2ResultThreeDSRequestorChallengeIndEnum); - if (obj is ThreeDSRequestData.ChallengeWindowSizeEnum threeDSRequestDataChallengeWindowSizeEnum) - return ThreeDSRequestData.ChallengeWindowSizeEnumToJsonValue(threeDSRequestDataChallengeWindowSizeEnum); - if (obj is ThreeDSRequestData.DataOnlyEnum threeDSRequestDataDataOnlyEnum) - return ThreeDSRequestData.DataOnlyEnumToJsonValue(threeDSRequestDataDataOnlyEnum); - if (obj is ThreeDSRequestData.NativeThreeDSEnum threeDSRequestDataNativeThreeDSEnum) - return ThreeDSRequestData.NativeThreeDSEnumToJsonValue(threeDSRequestDataNativeThreeDSEnum); - if (obj is ThreeDSRequestData.ThreeDSVersionEnum threeDSRequestDataThreeDSVersionEnum) - return ThreeDSRequestData.ThreeDSVersionEnumToJsonValue(threeDSRequestDataThreeDSVersionEnum); - if (obj is ThreeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodEnum threeDSRequestorAuthenticationInfoThreeDSReqAuthMethodEnum) - return ThreeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodEnumToJsonValue(threeDSRequestorAuthenticationInfoThreeDSReqAuthMethodEnum); - if (obj is ThreeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodEnum threeDSRequestorPriorAuthenticationInfoThreeDSReqPriorAuthMethodEnum) - return ThreeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodEnumToJsonValue(threeDSRequestorPriorAuthenticationInfoThreeDSReqPriorAuthMethodEnum); - if (obj is ThreeDSecureData.AuthenticationResponseEnum threeDSecureDataAuthenticationResponseEnum) - return ThreeDSecureData.AuthenticationResponseEnumToJsonValue(threeDSecureDataAuthenticationResponseEnum); - if (obj is ThreeDSecureData.ChallengeCancelEnum threeDSecureDataChallengeCancelEnum) - return ThreeDSecureData.ChallengeCancelEnumToJsonValue(threeDSecureDataChallengeCancelEnum); - if (obj is ThreeDSecureData.DirectoryResponseEnum threeDSecureDataDirectoryResponseEnum) - return ThreeDSecureData.DirectoryResponseEnumToJsonValue(threeDSecureDataDirectoryResponseEnum); - if (obj is TwintDetails.TypeEnum twintDetailsTypeEnum) - return TwintDetails.TypeEnumToJsonValue(twintDetailsTypeEnum); - if (obj is UpdatePaymentLinkRequest.StatusEnum updatePaymentLinkRequestStatusEnum) - return UpdatePaymentLinkRequest.StatusEnumToJsonValue(updatePaymentLinkRequestStatusEnum); - if (obj is UpiCollectDetails.TypeEnum upiCollectDetailsTypeEnum) - return UpiCollectDetails.TypeEnumToJsonValue(upiCollectDetailsTypeEnum); - if (obj is UpiIntentDetails.TypeEnum upiIntentDetailsTypeEnum) - return UpiIntentDetails.TypeEnumToJsonValue(upiIntentDetailsTypeEnum); - if (obj is VippsDetails.TypeEnum vippsDetailsTypeEnum) - return VippsDetails.TypeEnumToJsonValue(vippsDetailsTypeEnum); - if (obj is VisaCheckoutDetails.FundingSourceEnum visaCheckoutDetailsFundingSourceEnum) - return VisaCheckoutDetails.FundingSourceEnumToJsonValue(visaCheckoutDetailsFundingSourceEnum); - if (obj is VisaCheckoutDetails.TypeEnum visaCheckoutDetailsTypeEnum) - return VisaCheckoutDetails.TypeEnumToJsonValue(visaCheckoutDetailsTypeEnum); - if (obj is WeChatPayDetails.TypeEnum weChatPayDetailsTypeEnum) - return WeChatPayDetails.TypeEnumToJsonValue(weChatPayDetailsTypeEnum); - if (obj is WeChatPayMiniProgramDetails.TypeEnum weChatPayMiniProgramDetailsTypeEnum) - return WeChatPayMiniProgramDetails.TypeEnumToJsonValue(weChatPayMiniProgramDetailsTypeEnum); - if (obj is ZipDetails.TypeEnum zipDetailsTypeEnum) - return ZipDetails.TypeEnumToJsonValue(zipDetailsTypeEnum); - if (obj is ICollection collection) - { + return boolean ? "true" : "false"; + if (obj is ICollection collection) { List entries = new List(); foreach (var entry in collection) - entries.Add(ParameterToString(entry)); + entries.Add(ParameterToString(entry, configuration)); return string.Join(",", entries); } + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); - return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + return Convert.ToString(obj, CultureInfo.InvariantCulture); } /// - /// URL encode a string - /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// Serializes the given object when not null. Otherwise return null. /// - /// string to be URL encoded - /// Byte array - public static string UrlEncode(string input) + /// The object to serialize. + /// Serialized string. + public static string Serialize(object obj) { - const int maxLength = 32766; - - if (input == null) - { - throw new ArgumentNullException("input"); - } - - if (input.Length <= maxLength) - { - return Uri.EscapeDataString(input); - } - - StringBuilder sb = new StringBuilder(input.Length * 2); - int index = 0; - - while (index < input.Length) - { - int length = Math.Min(input.Length - index, maxLength); - string subString = input.Substring(index, length); - - sb.Append(Uri.EscapeDataString(subString)); - index += subString.Length; - } - - return sb.ToString(); + return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; } /// @@ -639,7 +190,7 @@ public static string SelectHeaderAccept(string[] accepts) /// /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. /// - private static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); /// /// Check if the given MIME is a JSON MIME. @@ -659,65 +210,38 @@ public static bool IsJsonMime(string mime) } /// - /// Get the discriminator + /// Is the Enum decorated with EnumMember Attribute /// - /// - /// - /// - /// - public static string GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + /// + /// true if found + private static bool HasEnumMemberAttrValue(object enumVal) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) - return utf8JsonReader.GetString(); - } - } - - throw new JsonException("The specified discriminator was not found."); + if (enumVal == null) + throw new ArgumentNullException(nameof(enumVal)); + var enumType = enumVal.GetType(); + var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); + var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); + if (attr != null) return true; + return false; } /// - /// The base path of the API + /// Get the EnumMember value /// - public const string BASE_ADDRESS = "https://checkout-test.adyen.com/v71"; - - /// - /// The scheme of the API - /// - public const string SCHEME = "https"; - - /// - /// The context path of the API - /// - public const string CONTEXT_PATH = "/v71"; - - /// - /// The host of the API - /// - public const string HOST = "checkout-test.adyen.com"; - - /// - /// The format to use for DateTime serialization - /// - public const string ISO8601_DATETIME_FORMAT = "o"; + /// + /// EnumMember value as string otherwise null + private static string GetEnumMemberAttrValue(object enumVal) + { + if (enumVal == null) + throw new ArgumentNullException(nameof(enumVal)); + var enumType = enumVal.GetType(); + var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); + var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); + if (attr != null) + { + return attr.Value; + } + return null; + } } } diff --git a/Adyen/Client/Configuration.cs b/Adyen/Client/Configuration.cs new file mode 100644 index 000000000..c9a04b3d2 --- /dev/null +++ b/Adyen/Client/Configuration.cs @@ -0,0 +1,607 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Net.Http; +using System.Net.Security; + +namespace Adyen.Client +{ + /// + /// Represents a set of configuration settings + /// + public class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "1.0.0"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent, response.Headers); + } + return null; + }; + + #endregion Static Members + + #region Private Members + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + private bool _useDefaultCredentials = false; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for accessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + + /// + /// Gets or sets the operation servers defined in the OpenAPI spec. + /// + /// The operation servers + private IReadOnlyDictionary>> _operationServers; + + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration() + { + Proxy = null; + UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp"); + BasePath = "https://checkout-test.adyen.com/v71"; + DefaultHeaders = new ConcurrentDictionary(); + ApiKey = new ConcurrentDictionary(); + ApiKeyPrefix = new ConcurrentDictionary(); + Servers = new List>() + { + { + new Dictionary { + {"url", "https://checkout-test.adyen.com/v71"}, + {"description", "No description provided"}, + } + } + }; + OperationServers = new Dictionary>>() + { + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = TimeSpan.FromSeconds(100); + } + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "https://checkout-test.adyen.com/v71") : this() + { + if (string.IsNullOrWhiteSpace(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeaders) + { + DefaultHeaders.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + #endregion Constructors + + #region Properties + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath + { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. + /// + public virtual TimeSpan Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + string apiKeyValue; + ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); + string apiKeyPrefix; + if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) + { + return apiKeyPrefix + " " + apiKeyValue; + } + + return apiKeyValue; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// Whatever you set here will be prepended to the value defined in AddApiKey. + /// + /// An example invocation here might be: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Gets or sets the operation servers. + /// + /// The operation servers. + public virtual IReadOnlyDictionary>> OperationServers + { + get { return _operationServers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Operation servers may not be null."); + } + _operationServers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(Servers, index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + return GetServerUrl(Servers, index, inputVariables); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index) + { + return GetOperationServerUrl(operation, index, null); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) + { + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) + { + return GetServerUrl(operationServer, index, inputVariables); + } + + return null; + } + + /// + /// Returns URL based on server settings. + /// + /// Dictionary of server settings. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) + { + if (index < 0 || index >= servers.Count) + { + throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); + } + + if (inputVariables == null) + { + inputVariables = new Dictionary(); + } + + IReadOnlyDictionary server = servers[index]; + string url = (string)server["url"]; + + if (server.ContainsKey("variables")) + { + // go through each variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (!serverVariables.ContainsKey("enum_values") || ((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + { + url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); + } + else + { + throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); + } + } + else + { + // use default value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + } + + return url; + } + + /// + /// Gets and Sets the RemoteCertificateValidationCallback + /// + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + public static string ToDebugReport() + { + string report = "C# SDK (Adyen) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: 71\n"; + report += " SDK Package Version: 1.0.0\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; + foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; + + var config = new Configuration + { + ApiKey = apiKey, + ApiKeyPrefix = apiKeyPrefix, + DefaultHeaders = defaultHeaders, + BasePath = second.BasePath ?? first.BasePath, + Timeout = second.Timeout, + Proxy = second.Proxy ?? first.Proxy, + UserAgent = second.UserAgent ?? first.UserAgent, + Username = second.Username ?? first.Username, + Password = second.Password ?? first.Password, + AccessToken = second.AccessToken ?? first.AccessToken, + TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, + DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, + ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, + UseDefaultCredentials = second.UseDefaultCredentials, + RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, + }; + return config; + } + #endregion Static Members + } +} diff --git a/Adyen/Client/CookieContainer.cs b/Adyen/Client/CookieContainer.cs deleted file mode 100644 index b129934b7..000000000 --- a/Adyen/Client/CookieContainer.cs +++ /dev/null @@ -1,18 +0,0 @@ -// - -using System.Linq; -using System.Collections.Generic; - -namespace Adyen.Client -{ - /// - /// A class containing a CookieContainer - /// - public sealed class CookieContainer - { - /// - /// The collection of tokens - /// - public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); - } -} \ No newline at end of file diff --git a/Adyen/Client/DateTimeJsonConverter.cs b/Adyen/Client/DateTimeJsonConverter.cs deleted file mode 100644 index c76102996..000000000 --- a/Adyen/Client/DateTimeJsonConverter.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Globalization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Adyen.Client -{ - /// - /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 - /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types - /// - public class DateTimeJsonConverter : JsonConverter - { - /// - /// The formats used to deserialize the date - /// - public static string[] Formats { get; } = { - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", - "yyyy'-'MM'-'dd", - "yyyyMMddTHHmmss.fffffffK", - "yyyyMMddTHHmmss.ffffffK", - "yyyyMMddTHHmmss.fffffK", - "yyyyMMddTHHmmss.ffffK", - "yyyyMMddTHHmmss.fffK", - "yyyyMMddTHHmmss.ffK", - "yyyyMMddTHHmmss.fK", - "yyyyMMddTHHmmssK", - "yyyyMMdd" - - }; - - /// - /// Returns a DateTime from the Json object - /// - /// - /// - /// - /// - public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - if (reader.TokenType == JsonTokenType.Null) - throw new NotSupportedException(); - - string value = reader.GetString(); - - foreach(string format in Formats) - if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) - return result; - - throw new NotSupportedException(); - } - - /// - /// Writes the DateTime to the json writer - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => - writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); - } -} diff --git a/Adyen/Client/DateTimeNullableJsonConverter.cs b/Adyen/Client/DateTimeNullableJsonConverter.cs deleted file mode 100644 index 1d0a14d25..000000000 --- a/Adyen/Client/DateTimeNullableJsonConverter.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Globalization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Adyen.Client -{ - /// - /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 - /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types - /// - public class DateTimeNullableJsonConverter : JsonConverter - { - /// - /// The formats used to deserialize the date - /// - public static string[] Formats { get; } = { - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", - "yyyy'-'MM'-'dd", - "yyyyMMddTHHmmss.fffffffK", - "yyyyMMddTHHmmss.ffffffK", - "yyyyMMddTHHmmss.fffffK", - "yyyyMMddTHHmmss.ffffK", - "yyyyMMddTHHmmss.fffK", - "yyyyMMddTHHmmss.ffK", - "yyyyMMddTHHmmss.fK", - "yyyyMMddTHHmmssK", - "yyyyMMdd" - - }; - - /// - /// Returns a DateTime from the Json object - /// - /// - /// - /// - /// - public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - if (reader.TokenType == JsonTokenType.Null) - return null; - - string value = reader.GetString(); - - foreach(string format in Formats) - if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) - return result; - - return null; - } - - /// - /// Writes the DateTime to the json writer - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) - { - if (dateTimeValue == null) - writer.WriteNullValue(); - else - writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); - } - } -} diff --git a/Adyen/Client/ExceptionEventArgs.cs b/Adyen/Client/ExceptionEventArgs.cs deleted file mode 100644 index 0e11b030b..000000000 --- a/Adyen/Client/ExceptionEventArgs.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Adyen.Client -{ - /// - /// Useful for tracking server health - /// - public class ExceptionEventArgs : EventArgs - { - /// - /// The ApiResponse - /// - public Exception Exception { get; } - - /// - /// The ExceptionEventArgs - /// - /// - public ExceptionEventArgs(Exception exception) - { - Exception = exception; - } - } -} diff --git a/Adyen/Client/ExceptionFactory.cs b/Adyen/Client/ExceptionFactory.cs new file mode 100644 index 000000000..1972886f3 --- /dev/null +++ b/Adyen/Client/ExceptionFactory.cs @@ -0,0 +1,22 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Adyen.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + public delegate Exception ExceptionFactory(string methodName, IApiResponse response); +} diff --git a/Adyen/Client/FileParameter.cs b/Adyen/Client/FileParameter.cs new file mode 100644 index 000000000..ce0a041b5 --- /dev/null +++ b/Adyen/Client/FileParameter.cs @@ -0,0 +1,80 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System.IO; + +namespace Adyen.Client +{ + + /// + /// Represents a File passed to the API as a Parameter, allows using different backends for files + /// + public class FileParameter + { + /// + /// The filename + /// + public string Name { get; set; } = "no_name_provided"; + + /// + /// The content type of the file + /// + public string ContentType { get; set; } = "application/octet-stream"; + + /// + /// The content of the file + /// + public Stream Content { get; set; } + + /// + /// Construct a FileParameter just from the contents, will extract the filename from a filestream + /// + /// The file content + public FileParameter(Stream content) + { + if (content is FileStream fs) + { + Name = fs.Name; + } + Content = content; + } + + /// + /// Construct a FileParameter from name and content + /// + /// The filename + /// The file content + public FileParameter(string filename, Stream content) + { + Name = filename; + Content = content; + } + + /// + /// Construct a FileParameter from name and content + /// + /// The filename + /// The content type of the file + /// The file content + public FileParameter(string filename, string contentType, Stream content) + { + Name = filename; + ContentType = contentType; + Content = content; + } + + /// + /// Implicit conversion of stream to file parameter. Useful for backwards compatibility. + /// + /// Stream to convert + /// FileParameter + public static implicit operator FileParameter(Stream s) => new FileParameter(s); + } +} \ No newline at end of file diff --git a/Adyen/Client/GlobalConfiguration.cs b/Adyen/Client/GlobalConfiguration.cs new file mode 100644 index 000000000..750b307a0 --- /dev/null +++ b/Adyen/Client/GlobalConfiguration.cs @@ -0,0 +1,67 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System.Collections.Generic; + +namespace Adyen.Client +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .openapi-generator-ignore file. + /// + public partial class GlobalConfiguration : Configuration + { + #region Private Members + + private static readonly object GlobalConfigSync = new { }; + private static IReadableConfiguration _globalConfiguration; + + #endregion Private Members + + #region Constructors + + /// + private GlobalConfiguration() + { + } + + /// + public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) + { + } + + static GlobalConfiguration() + { + Instance = new GlobalConfiguration(); + } + + #endregion Constructors + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static IReadableConfiguration Instance + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + } +} diff --git a/Adyen/Client/HostConfiguration.cs b/Adyen/Client/HostConfiguration.cs deleted file mode 100644 index e07f3ec36..000000000 --- a/Adyen/Client/HostConfiguration.cs +++ /dev/null @@ -1,361 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json; -using System.Text.Json.Serialization; -using System.Net.Http; -using Microsoft.Extensions.DependencyInjection; -using Adyen.Service.Checkout; -using Adyen.Model.Checkout; - -namespace Adyen.Client -{ - /// - /// Provides hosting configuration for Adyen - /// - public class HostConfiguration - { - private readonly IServiceCollection _services; - private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); - - internal bool HttpClientsAdded { get; private set; } - - /// - /// Instantiates the class - /// - /// - public HostConfiguration(IServiceCollection services) - { - _services = services; - _jsonOptions.Converters.Add(new JsonStringEnumConverter()); - _jsonOptions.Converters.Add(new DateTimeJsonConverter()); - _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); - _jsonOptions.Converters.Add(new AccountInfoJsonConverter()); - _jsonOptions.Converters.Add(new AcctInfoJsonConverter()); - _jsonOptions.Converters.Add(new AchDetailsJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalData3DSecureJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataAirlineJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataCarRentalJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataCommonJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataLevel23JsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataLodgingJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataOpenInvoiceJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataOpiJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataRatepayJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataRetryJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataRiskJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataRiskStandaloneJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataSubMerchantJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataTemporaryServicesJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataWalletsJsonConverter()); - _jsonOptions.Converters.Add(new AddressJsonConverter()); - _jsonOptions.Converters.Add(new AffirmDetailsJsonConverter()); - _jsonOptions.Converters.Add(new AfterpayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new AgencyJsonConverter()); - _jsonOptions.Converters.Add(new AirlineJsonConverter()); - _jsonOptions.Converters.Add(new AmazonPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new AmountJsonConverter()); - _jsonOptions.Converters.Add(new AmountsJsonConverter()); - _jsonOptions.Converters.Add(new AncvDetailsJsonConverter()); - _jsonOptions.Converters.Add(new AndroidPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new ApplePayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new ApplePayDonationsJsonConverter()); - _jsonOptions.Converters.Add(new ApplePaySessionRequestJsonConverter()); - _jsonOptions.Converters.Add(new ApplePaySessionResponseJsonConverter()); - _jsonOptions.Converters.Add(new ApplicationInfoJsonConverter()); - _jsonOptions.Converters.Add(new AuthenticationDataJsonConverter()); - _jsonOptions.Converters.Add(new BacsDirectDebitDetailsJsonConverter()); - _jsonOptions.Converters.Add(new BalanceCheckRequestJsonConverter()); - _jsonOptions.Converters.Add(new BalanceCheckResponseJsonConverter()); - _jsonOptions.Converters.Add(new BillDeskDetailsJsonConverter()); - _jsonOptions.Converters.Add(new BillingAddressJsonConverter()); - _jsonOptions.Converters.Add(new BlikDetailsJsonConverter()); - _jsonOptions.Converters.Add(new BrowserInfoJsonConverter()); - _jsonOptions.Converters.Add(new CancelOrderRequestJsonConverter()); - _jsonOptions.Converters.Add(new CancelOrderResponseJsonConverter()); - _jsonOptions.Converters.Add(new CardBrandDetailsJsonConverter()); - _jsonOptions.Converters.Add(new CardDetailsJsonConverter()); - _jsonOptions.Converters.Add(new CardDetailsRequestJsonConverter()); - _jsonOptions.Converters.Add(new CardDetailsResponseJsonConverter()); - _jsonOptions.Converters.Add(new CardDonationsJsonConverter()); - _jsonOptions.Converters.Add(new CashAppDetailsJsonConverter()); - _jsonOptions.Converters.Add(new CellulantDetailsJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutAwaitActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutBankAccountJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutBankTransferActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutDelegatedAuthenticationActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutNativeRedirectActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutOrderResponseJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutPaymentMethodJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutQrCodeActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutRedirectActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutSDKActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutSessionInstallmentOptionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutSessionThreeDS2RequestDataJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutThreeDS2ActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutVoucherActionJsonConverter()); - _jsonOptions.Converters.Add(new CommonFieldJsonConverter()); - _jsonOptions.Converters.Add(new CompanyJsonConverter()); - _jsonOptions.Converters.Add(new CreateCheckoutSessionRequestJsonConverter()); - _jsonOptions.Converters.Add(new CreateCheckoutSessionResponseJsonConverter()); - _jsonOptions.Converters.Add(new CreateOrderRequestJsonConverter()); - _jsonOptions.Converters.Add(new CreateOrderResponseJsonConverter()); - _jsonOptions.Converters.Add(new DeliveryAddressJsonConverter()); - _jsonOptions.Converters.Add(new DeliveryMethodJsonConverter()); - _jsonOptions.Converters.Add(new DetailsRequestAuthenticationDataJsonConverter()); - _jsonOptions.Converters.Add(new DeviceRenderOptionsJsonConverter()); - _jsonOptions.Converters.Add(new DokuDetailsJsonConverter()); - _jsonOptions.Converters.Add(new DonationJsonConverter()); - _jsonOptions.Converters.Add(new DonationCampaignJsonConverter()); - _jsonOptions.Converters.Add(new DonationCampaignsRequestJsonConverter()); - _jsonOptions.Converters.Add(new DonationCampaignsResponseJsonConverter()); - _jsonOptions.Converters.Add(new DonationPaymentMethodJsonConverter()); - _jsonOptions.Converters.Add(new DonationPaymentRequestJsonConverter()); - _jsonOptions.Converters.Add(new DonationPaymentResponseJsonConverter()); - _jsonOptions.Converters.Add(new DragonpayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new EBankingFinlandDetailsJsonConverter()); - _jsonOptions.Converters.Add(new EcontextVoucherDetailsJsonConverter()); - _jsonOptions.Converters.Add(new EftDetailsJsonConverter()); - _jsonOptions.Converters.Add(new EncryptedOrderDataJsonConverter()); - _jsonOptions.Converters.Add(new EnhancedSchemeDataJsonConverter()); - _jsonOptions.Converters.Add(new ExternalPlatformJsonConverter()); - _jsonOptions.Converters.Add(new FastlaneDetailsJsonConverter()); - _jsonOptions.Converters.Add(new ForexQuoteJsonConverter()); - _jsonOptions.Converters.Add(new FraudCheckResultJsonConverter()); - _jsonOptions.Converters.Add(new FraudResultJsonConverter()); - _jsonOptions.Converters.Add(new FundOriginJsonConverter()); - _jsonOptions.Converters.Add(new FundRecipientJsonConverter()); - _jsonOptions.Converters.Add(new GenericIssuerPaymentMethodDetailsJsonConverter()); - _jsonOptions.Converters.Add(new GooglePayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new GooglePayDonationsJsonConverter()); - _jsonOptions.Converters.Add(new IdealDetailsJsonConverter()); - _jsonOptions.Converters.Add(new IdealDonationsJsonConverter()); - _jsonOptions.Converters.Add(new InputDetailJsonConverter()); - _jsonOptions.Converters.Add(new InstallmentOptionJsonConverter()); - _jsonOptions.Converters.Add(new InstallmentsJsonConverter()); - _jsonOptions.Converters.Add(new ItemJsonConverter()); - _jsonOptions.Converters.Add(new KlarnaDetailsJsonConverter()); - _jsonOptions.Converters.Add(new LegJsonConverter()); - _jsonOptions.Converters.Add(new LineItemJsonConverter()); - _jsonOptions.Converters.Add(new ListStoredPaymentMethodsResponseJsonConverter()); - _jsonOptions.Converters.Add(new MandateJsonConverter()); - _jsonOptions.Converters.Add(new MasterpassDetailsJsonConverter()); - _jsonOptions.Converters.Add(new MbwayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new MerchantDeviceJsonConverter()); - _jsonOptions.Converters.Add(new MerchantRiskIndicatorJsonConverter()); - _jsonOptions.Converters.Add(new MobilePayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new MolPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new NameJsonConverter()); - _jsonOptions.Converters.Add(new OpenInvoiceDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PassengerJsonConverter()); - _jsonOptions.Converters.Add(new PayByBankAISDirectDebitDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayByBankDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayPalDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayToDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayUUpiDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayWithGoogleDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayWithGoogleDonationsJsonConverter()); - _jsonOptions.Converters.Add(new PaymentJsonConverter()); - _jsonOptions.Converters.Add(new PaymentAmountUpdateRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentAmountUpdateResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentCancelRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentCancelResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentCaptureRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentCaptureResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentCompletionDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PaymentDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PaymentDetailsRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentDetailsResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentLinkRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentLinkResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodGroupJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodIssuerJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodToStoreJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodUPIAppsJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodsRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodsResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentRefundRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentRefundResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentResponseActionJsonConverter()); - _jsonOptions.Converters.Add(new PaymentReversalRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentReversalResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaypalUpdateOrderRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaypalUpdateOrderResponseJsonConverter()); - _jsonOptions.Converters.Add(new PhoneJsonConverter()); - _jsonOptions.Converters.Add(new PixDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PixRecurringJsonConverter()); - _jsonOptions.Converters.Add(new PlatformChargebackLogicJsonConverter()); - _jsonOptions.Converters.Add(new PseDetailsJsonConverter()); - _jsonOptions.Converters.Add(new RakutenPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new RatepayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new RecurringJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalData3DSecureJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataBillingAddressJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataCardJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataCommonJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataDomesticErrorJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataInstallmentsJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataNetworkTokensJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataOpiJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataSepaJsonConverter()); - _jsonOptions.Converters.Add(new ResponsePaymentMethodJsonConverter()); - _jsonOptions.Converters.Add(new RiskDataJsonConverter()); - _jsonOptions.Converters.Add(new RivertyDetailsJsonConverter()); - _jsonOptions.Converters.Add(new SDKEphemPubKeyJsonConverter()); - _jsonOptions.Converters.Add(new SamsungPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new SepaDirectDebitDetailsJsonConverter()); - _jsonOptions.Converters.Add(new ServiceErrorJsonConverter()); - _jsonOptions.Converters.Add(new SessionResultResponseJsonConverter()); - _jsonOptions.Converters.Add(new ShopperInteractionDeviceJsonConverter()); - _jsonOptions.Converters.Add(new SplitJsonConverter()); - _jsonOptions.Converters.Add(new SplitAmountJsonConverter()); - _jsonOptions.Converters.Add(new StandalonePaymentCancelRequestJsonConverter()); - _jsonOptions.Converters.Add(new StandalonePaymentCancelResponseJsonConverter()); - _jsonOptions.Converters.Add(new StoredPaymentMethodJsonConverter()); - _jsonOptions.Converters.Add(new StoredPaymentMethodDetailsJsonConverter()); - _jsonOptions.Converters.Add(new StoredPaymentMethodRequestJsonConverter()); - _jsonOptions.Converters.Add(new StoredPaymentMethodResourceJsonConverter()); - _jsonOptions.Converters.Add(new SubInputDetailJsonConverter()); - _jsonOptions.Converters.Add(new SubMerchantJsonConverter()); - _jsonOptions.Converters.Add(new SubMerchantInfoJsonConverter()); - _jsonOptions.Converters.Add(new SurchargeJsonConverter()); - _jsonOptions.Converters.Add(new TaxTotalJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDS2RequestDataJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDS2RequestFieldsJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDS2ResponseDataJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDS2ResultJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDSRequestDataJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDSRequestorAuthenticationInfoJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDSRequestorPriorAuthenticationInfoJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDSecureDataJsonConverter()); - _jsonOptions.Converters.Add(new TicketJsonConverter()); - _jsonOptions.Converters.Add(new TravelAgencyJsonConverter()); - _jsonOptions.Converters.Add(new TwintDetailsJsonConverter()); - _jsonOptions.Converters.Add(new UpdatePaymentLinkRequestJsonConverter()); - _jsonOptions.Converters.Add(new UpiCollectDetailsJsonConverter()); - _jsonOptions.Converters.Add(new UpiIntentDetailsJsonConverter()); - _jsonOptions.Converters.Add(new UtilityRequestJsonConverter()); - _jsonOptions.Converters.Add(new UtilityResponseJsonConverter()); - _jsonOptions.Converters.Add(new VippsDetailsJsonConverter()); - _jsonOptions.Converters.Add(new VisaCheckoutDetailsJsonConverter()); - _jsonOptions.Converters.Add(new WeChatPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new WeChatPayMiniProgramDetailsJsonConverter()); - _jsonOptions.Converters.Add(new ZipDetailsJsonConverter()); - JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); - _services.AddSingleton(jsonSerializerOptionsProvider); - _services.AddSingleton(); - _services.AddSingleton(); - _services.AddTransient(); - _services.AddSingleton(); - _services.AddTransient(); - _services.AddSingleton(); - _services.AddTransient(); - _services.AddSingleton(); - _services.AddTransient(); - _services.AddSingleton(); - _services.AddTransient(); - _services.AddSingleton(); - _services.AddTransient(); - _services.AddSingleton(); - _services.AddTransient(); - } - - /// - /// Configures the HttpClients. - /// - /// - /// - /// - public HostConfiguration AddApiHttpClients - ( - Action client = null, Action builder = null) - { - if (client == null) - client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); - - List builders = new List(); - - builders.Add(_services.AddHttpClient(client)); - builders.Add(_services.AddHttpClient(client)); - builders.Add(_services.AddHttpClient(client)); - builders.Add(_services.AddHttpClient(client)); - builders.Add(_services.AddHttpClient(client)); - builders.Add(_services.AddHttpClient(client)); - builders.Add(_services.AddHttpClient(client)); - - if (builder != null) - foreach (IHttpClientBuilder instance in builders) - builder(instance); - - HttpClientsAdded = true; - - return this; - } - - /// - /// Configures the JsonSerializerSettings - /// - /// - /// - public HostConfiguration ConfigureJsonOptions(Action options) - { - options(_jsonOptions); - - return this; - } - - /// - /// Adds tokens to your IServiceCollection - /// - /// - /// - /// - public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase - { - return AddTokens(new TTokenBase[]{ token }); - } - - /// - /// Adds tokens to your IServiceCollection - /// - /// - /// - /// - public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase - { - TokenContainer container = new TokenContainer(tokens); - _services.AddSingleton(services => container); - - return this; - } - - /// - /// Adds a token provider to your IServiceCollection - /// - /// - /// - /// - public HostConfiguration UseProvider() - where TTokenProvider : TokenProvider - where TTokenBase : TokenBase - { - _services.AddSingleton(); - _services.AddSingleton>(services => services.GetRequiredService()); - - return this; - } - } -} diff --git a/Adyen/Client/IApiAccessor.cs b/Adyen/Client/IApiAccessor.cs new file mode 100644 index 000000000..d56027af2 --- /dev/null +++ b/Adyen/Client/IApiAccessor.cs @@ -0,0 +1,37 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Adyen.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + public interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + IReadableConfiguration Configuration { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + string GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/Adyen/Client/IAsynchronousClient.cs b/Adyen/Client/IAsynchronousClient.cs new file mode 100644 index 000000000..132c981cf --- /dev/null +++ b/Adyen/Client/IAsynchronousClient.cs @@ -0,0 +1,100 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Threading.Tasks; + +namespace Adyen.Client +{ + /// + /// Contract for Asynchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface IAsynchronousClient + { + /// + /// Executes a non-blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + } +} diff --git a/Adyen/Client/IReadableConfiguration.cs b/Adyen/Client/IReadableConfiguration.cs new file mode 100644 index 000000000..68b0b98de --- /dev/null +++ b/Adyen/Client/IReadableConfiguration.cs @@ -0,0 +1,141 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; + +namespace Adyen.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time format. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + [Obsolete("Use DefaultHeaders instead.")] + IDictionary DefaultHeader { get; } + + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout. + /// + /// HTTP connection timeout. + TimeSpan Timeout { get; } + + /// + /// Gets the proxy. + /// + /// Proxy. + WebProxy Proxy { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + bool UseDefaultCredentials { get; } + + /// + /// Get the servers associated with the operation. + /// + /// Operation servers. + IReadOnlyDictionary>> OperationServers { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// + /// Gets the Operation server url at the provided index. + /// + /// Operation server name. + /// Index of the operation server settings. + /// + string GetOperationServerUrl(string operation, int index); + + /// + /// Gets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + X509CertificateCollection ClientCertificates { get; } + + /// + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } + } +} diff --git a/Adyen/Client/ISynchronousClient.cs b/Adyen/Client/ISynchronousClient.cs new file mode 100644 index 000000000..3618816a4 --- /dev/null +++ b/Adyen/Client/ISynchronousClient.cs @@ -0,0 +1,93 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.IO; + +namespace Adyen.Client +{ + /// + /// Contract for Synchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface ISynchronousClient + { + /// + /// Executes a blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); + } +} diff --git a/Adyen/Client/JsonSerializerOptionsProvider.cs b/Adyen/Client/JsonSerializerOptionsProvider.cs deleted file mode 100644 index fd7fbd8fc..000000000 --- a/Adyen/Client/JsonSerializerOptionsProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -// - -using System.Text.Json; - -namespace Adyen.Client -{ - /// - /// Provides the JsonSerializerOptions - /// - public class JsonSerializerOptionsProvider - { - /// - /// the JsonSerializerOptions - /// - public JsonSerializerOptions Options { get; } - - /// - /// Instantiates a JsonSerializerOptionsProvider - /// - public JsonSerializerOptionsProvider(JsonSerializerOptions options) - { - Options = options; - } - } -} \ No newline at end of file diff --git a/Adyen/Client/Multimap.cs b/Adyen/Client/Multimap.cs new file mode 100644 index 000000000..40365e9f0 --- /dev/null +++ b/Adyen/Client/Multimap.cs @@ -0,0 +1,295 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Adyen.Client +{ + /// + /// A dictionary in which one key has many associated values. + /// + /// The type of the key + /// The type of the value associated with the key. + public class Multimap : IDictionary> + { + #region Private Fields + + private readonly Dictionary> _dictionary; + + #endregion Private Fields + + #region Constructors + + /// + /// Empty Constructor. + /// + public Multimap() + { + _dictionary = new Dictionary>(); + } + + /// + /// Constructor with comparer. + /// + /// + public Multimap(IEqualityComparer comparer) + { + _dictionary = new Dictionary>(comparer); + } + + #endregion Constructors + + #region Enumerators + + /// + /// To get the enumerator. + /// + /// Enumerator + public IEnumerator>> GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + /// + /// To get the enumerator. + /// + /// Enumerator + IEnumerator IEnumerable.GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + #endregion Enumerators + + #region Public Members + /// + /// Add values to Multimap + /// + /// Key value pair + public void Add(KeyValuePair> item) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + + /// + /// Add Multimap to Multimap + /// + /// Multimap + public void Add(Multimap multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + + /// + /// Clear Multimap + /// + public void Clear() + { + _dictionary.Clear(); + } + + /// + /// Determines whether Multimap contains the specified item. + /// + /// Key value pair + /// Method needs to be implemented + /// true if the Multimap contains the item; otherwise, false. + public bool Contains(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Copy items of the Multimap to an array, + /// starting at a particular array index. + /// + /// The array that is the destination of the items copied + /// from Multimap. The array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + /// Method needs to be implemented + public void CopyTo(KeyValuePair>[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + /// + /// Removes the specified item from the Multimap. + /// + /// Key value pair + /// true if the item is successfully removed; otherwise, false. + /// Method needs to be implemented + public bool Remove(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Gets the number of items contained in the Multimap. + /// + public int Count => _dictionary.Count; + + /// + /// Gets a value indicating whether the Multimap is read-only. + /// + public bool IsReadOnly => false; + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add the value to Multimap. + public void Add(TKey key, IList value) + { + if (value != null && value.Count > 0) + { + if (_dictionary.TryGetValue(key, out var list)) + { + foreach (var k in value) list.Add(k); + } + else + { + list = new List(value); + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + } + + /// + /// Determines whether the Multimap contains an item with the specified key. + /// + /// The key to locate in the Multimap. + /// true if the Multimap contains an item with + /// the key; otherwise, false. + public bool ContainsKey(TKey key) + { + return _dictionary.ContainsKey(key); + } + + /// + /// Removes item with the specified key from the Multimap. + /// + /// The key to locate in the Multimap. + /// true if the item is successfully removed; otherwise, false. + public bool Remove(TKey key) + { + return TryRemove(key, out var _); + } + + /// + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// When this method returns, the value associated with the specified key, if the + /// key is found; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// true if the object that implements Multimap contains + /// an item with the specified key; otherwise, false. + public bool TryGetValue(TKey key, out IList value) + { + return _dictionary.TryGetValue(key, out value); + } + + /// + /// Gets or sets the item with the specified key. + /// + /// The key of the item to get or set. + /// The value of the specified key. + public IList this[TKey key] + { + get => _dictionary[key]; + set => _dictionary[key] = value; + } + + /// + /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. + /// + public ICollection Keys => _dictionary.Keys; + + /// + /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. + /// + public ICollection> Values => _dictionary.Values; + + /// + /// Copy the items of the Multimap to an System.Array, + /// starting at a particular System.Array index. + /// + /// The one-dimensional System.Array that is the destination of the items copied + /// from Multimap. The System.Array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + public void CopyTo(Array array, int index) + { + ((ICollection)_dictionary).CopyTo(array, index); + } + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add value to Multimap. + public void Add(TKey key, TValue value) + { + if (value != null) + { + if (_dictionary.TryGetValue(key, out var list)) + { + list.Add(value); + } + else + { + list = new List { value }; + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add value to Multimap."); + } + } + } + + #endregion Public Members + + #region Private Members + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryRemove(TKey key, out IList value) + { + _dictionary.TryGetValue(key, out value); + return _dictionary.Remove(key); + } + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryAdd(TKey key, IList value) + { + try + { + _dictionary.Add(key, value); + } + catch (ArgumentException) + { + return false; + } + + return true; + } + #endregion Private Members + } +} diff --git a/Adyen/Client/OpenAPIDateConverter.cs b/Adyen/Client/OpenAPIDateConverter.cs index f7b37c55b..58b12396d 100644 --- a/Adyen/Client/OpenAPIDateConverter.cs +++ b/Adyen/Client/OpenAPIDateConverter.cs @@ -4,7 +4,6 @@ * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! * * The version of the OpenAPI document: 71 - * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/Adyen/Client/Option.cs b/Adyen/Client/Option.cs deleted file mode 100644 index 78b0c63fa..000000000 --- a/Adyen/Client/Option.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -namespace Adyen.Client -{ - /// - /// A wrapper for operation parameters which are not required - /// - public struct Option - { - /// - /// The value to send to the server - /// - public TType Value { get; } - - /// - /// When true the value will be sent to the server - /// - internal bool IsSet { get; } - - /// - /// A wrapper for operation parameters which are not required - /// - /// - public Option(TType value) - { - IsSet = true; - Value = value; - } - - /// - /// Implicitly converts this option to the contained type - /// - /// - public static implicit operator TType(Option option) => option.Value; - - /// - /// Implicitly converts the provided value to an Option - /// - /// - public static implicit operator Option(TType value) => new Option(value); - } -} \ No newline at end of file diff --git a/Adyen/Client/RateLimitProvider.cs b/Adyen/Client/RateLimitProvider.cs deleted file mode 100644 index 92b18587d..000000000 --- a/Adyen/Client/RateLimitProvider.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Adyen.Client -{ - /// - /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. - /// - /// - public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase - { - internal Dictionary> AvailableTokens { get; } = new Dictionary>(); - - /// - /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. - /// - /// - public RateLimitProvider(TokenContainer container) : base(container.Tokens) - { - foreach(TTokenBase token in _tokens) - token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); - - if (container is TokenContainer apiKeyTokenContainer) - { - string[] headers = apiKeyTokenContainer.Tokens.Select(t => ClientUtils.ApiKeyHeaderToString(t.Header)).Distinct().ToArray(); - - foreach (string header in headers) - { - global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) - { - FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite - }; - - AvailableTokens.Add(header, global::System.Threading.Channels.Channel.CreateBounded(options)); - } - } - else - { - global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length) - { - FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite - }; - - AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded(options)); - } - - foreach(global::System.Threading.Channels.Channel tokens in AvailableTokens.Values) - for (int i = 0; i < _tokens.Length; i++) - _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); - } - - internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) - { - if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) - throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); - - return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); - } - } -} diff --git a/Adyen/Client/RequestOptions.cs b/Adyen/Client/RequestOptions.cs new file mode 100644 index 000000000..7115a3e54 --- /dev/null +++ b/Adyen/Client/RequestOptions.cs @@ -0,0 +1,74 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace Adyen.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// File parameters to be sent along with the request. + /// + public Multimap FileParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + FileParameters = new Multimap(); + Cookies = new List(); + } + } +} diff --git a/Adyen/Client/RetryConfiguration.cs b/Adyen/Client/RetryConfiguration.cs new file mode 100644 index 000000000..ee57693e4 --- /dev/null +++ b/Adyen/Client/RetryConfiguration.cs @@ -0,0 +1,31 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Polly; +using System.Net.Http; + +namespace Adyen.Client +{ + /// + /// Configuration class to set the polly retry policies to be applied to the requests. + /// + public static class RetryConfiguration + { + /// + /// Retry policy + /// + public static ISyncPolicy RetryPolicy { get; set; } + + /// + /// Async retry policy + /// + public static IAsyncPolicy AsyncRetryPolicy { get; set; } + } +} diff --git a/Adyen/Client/TokenBase.cs b/Adyen/Client/TokenBase.cs deleted file mode 100644 index 79ed6dfda..000000000 --- a/Adyen/Client/TokenBase.cs +++ /dev/null @@ -1,69 +0,0 @@ -// - -using System; - -namespace Adyen.Client -{ - /// - /// The base for all tokens. - /// - public abstract class TokenBase - { - private DateTime _nextAvailable = DateTime.UtcNow; - private object _nextAvailableLock = new object(); - private readonly System.Timers.Timer _timer = new System.Timers.Timer(); - - - internal TimeSpan? Timeout { get; set; } - internal delegate void TokenBecameAvailableEventHandler(object sender); - internal event TokenBecameAvailableEventHandler TokenBecameAvailable; - - - /// - /// Initialize a TokenBase object. - /// - /// - internal TokenBase(TimeSpan? timeout = null) - { - Timeout = timeout; - - if (Timeout != null) - StartTimer(Timeout.Value); - } - - - /// - /// Starts the token's timer - /// - /// - internal void StartTimer(TimeSpan timeout) - { - Timeout = timeout; - _timer.Interval = Timeout.Value.TotalMilliseconds; - _timer.Elapsed += OnTimer; - _timer.AutoReset = true; - _timer.Start(); - } - - /// - /// Returns true while the token is rate limited. - /// - public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; - - /// - /// Triggered when the server returns status code TooManyRequests - /// Once triggered the local timeout will be extended an arbitrary length of time. - /// - public void BeginRateLimit() - { - lock(_nextAvailableLock) - _nextAvailable = DateTime.UtcNow.AddSeconds(5); - } - - private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) - { - if (TokenBecameAvailable != null && !IsRateLimited) - TokenBecameAvailable.Invoke(this); - } - } -} \ No newline at end of file diff --git a/Adyen/Client/TokenContainer.cs b/Adyen/Client/TokenContainer.cs deleted file mode 100644 index a9f3d167f..000000000 --- a/Adyen/Client/TokenContainer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -using System.Linq; -using System.Collections.Generic; - -namespace Adyen.Client -{ - /// - /// A container for a collection of tokens. - /// - /// - public sealed class TokenContainer where TTokenBase : TokenBase - { - /// - /// The collection of tokens - /// - public List Tokens { get; } = new List(); - - /// - /// Instantiates a TokenContainer - /// - public TokenContainer() - { - } - - /// - /// Instantiates a TokenContainer - /// - /// - public TokenContainer(global::System.Collections.Generic.IEnumerable tokens) - { - Tokens = tokens.ToList(); - } - } -} \ No newline at end of file diff --git a/Adyen/Client/TokenProvider.cs b/Adyen/Client/TokenProvider.cs deleted file mode 100644 index e0f3257b8..000000000 --- a/Adyen/Client/TokenProvider.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Linq; -using System.Collections.Generic; -using Adyen.Client; - -namespace Adyen -{ - /// - /// A class which will provide tokens. - /// - public abstract class TokenProvider where TTokenBase : TokenBase - { - /// - /// The array of tokens. - /// - protected TTokenBase[] _tokens; - - internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); - - /// - /// Instantiates a TokenProvider. - /// - /// - public TokenProvider(IEnumerable tokens) - { - _tokens = tokens.ToArray(); - - if (_tokens.Length == 0) - throw new ArgumentException("You did not provide any tokens."); - } - } -} \ No newline at end of file diff --git a/Adyen/Client/WebRequestPathBuilder.cs b/Adyen/Client/WebRequestPathBuilder.cs new file mode 100644 index 000000000..e9868cd1c --- /dev/null +++ b/Adyen/Client/WebRequestPathBuilder.cs @@ -0,0 +1,53 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; + +namespace Adyen.Client +{ + /// + /// A URI builder + /// + class WebRequestPathBuilder + { + private string _baseUrl; + private string _path; + private string _query = "?"; + public WebRequestPathBuilder(string baseUrl, string path) + { + _baseUrl = baseUrl; + _path = path; + } + + public void AddPathParameters(Dictionary parameters) + { + foreach (var parameter in parameters) + { + _path = _path.Replace("{" + parameter.Key + "}", Uri.EscapeDataString(parameter.Value)); + } + } + + public void AddQueryParameters(Multimap parameters) + { + foreach (var parameter in parameters) + { + foreach (var value in parameter.Value) + { + _query = _query + parameter.Key + "=" + Uri.EscapeDataString(value) + "&"; + } + } + } + + public string GetFullUri() + { + return _baseUrl + _path + _query.Substring(0, _query.Length - 1); + } + } +} From 10e8d5c7a2c5b0100d17826312b4daf279ad2b4b Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 24 Sep 2025 16:41:58 +0200 Subject: [PATCH 013/126] Removed unused templates --- templates-v7/csharp/Solution.mustache | 27 - templates-v7/csharp/TestProject.mustache | 35 - templates-v7/csharp/git_push.sh.mustache | 57 -- templates-v7/csharp/gitignore.mustache | 362 --------- .../httpclient/FileParameter.mustache | 72 -- .../httpclient/RequestOptions.mustache | 66 -- .../csharp/libraries/httpclient/api.mustache | 766 ------------------ .../libraries/httpclient/model.mustache | 51 -- .../unityWebRequest/ApiClient.mustache | 677 ---------------- .../ConnectionException.mustache | 57 -- .../libraries/unityWebRequest/README.mustache | 175 ---- .../unityWebRequest/RequestOptions.mustache | 60 -- .../UnexpectedResponseException.mustache | 26 - .../UnityWebRequestAwaiterExtension.mustache | 23 - .../libraries/unityWebRequest/api.mustache | 690 ---------------- .../unityWebRequest/api_test.mustache | 74 -- .../libraries/unityWebRequest/asmdef.mustache | 7 - .../unityWebRequest/asmdef_test.mustache | 15 - .../libraries/unityWebRequest/model.mustache | 47 -- .../unityWebRequest/model_test.mustache | 64 -- .../csharp/netcore_project.additions.mustache | 1 - templates-v7/csharp/netcore_project.mustache | 84 -- .../netcore_testproject.additions.mustache | 1 - .../csharp/netcore_testproject.mustache | 20 - templates-v7/csharp/nuspec.mustache | 57 -- 25 files changed, 3514 deletions(-) delete mode 100644 templates-v7/csharp/Solution.mustache delete mode 100644 templates-v7/csharp/TestProject.mustache delete mode 100644 templates-v7/csharp/git_push.sh.mustache delete mode 100644 templates-v7/csharp/gitignore.mustache delete mode 100644 templates-v7/csharp/libraries/httpclient/FileParameter.mustache delete mode 100644 templates-v7/csharp/libraries/httpclient/RequestOptions.mustache delete mode 100644 templates-v7/csharp/libraries/httpclient/api.mustache delete mode 100644 templates-v7/csharp/libraries/httpclient/model.mustache delete mode 100644 templates-v7/csharp/libraries/unityWebRequest/ApiClient.mustache delete mode 100644 templates-v7/csharp/libraries/unityWebRequest/ConnectionException.mustache delete mode 100644 templates-v7/csharp/libraries/unityWebRequest/README.mustache delete mode 100644 templates-v7/csharp/libraries/unityWebRequest/RequestOptions.mustache delete mode 100644 templates-v7/csharp/libraries/unityWebRequest/UnexpectedResponseException.mustache delete mode 100644 templates-v7/csharp/libraries/unityWebRequest/UnityWebRequestAwaiterExtension.mustache delete mode 100644 templates-v7/csharp/libraries/unityWebRequest/api.mustache delete mode 100644 templates-v7/csharp/libraries/unityWebRequest/api_test.mustache delete mode 100644 templates-v7/csharp/libraries/unityWebRequest/asmdef.mustache delete mode 100644 templates-v7/csharp/libraries/unityWebRequest/asmdef_test.mustache delete mode 100644 templates-v7/csharp/libraries/unityWebRequest/model.mustache delete mode 100644 templates-v7/csharp/libraries/unityWebRequest/model_test.mustache delete mode 100644 templates-v7/csharp/netcore_project.additions.mustache delete mode 100644 templates-v7/csharp/netcore_project.mustache delete mode 100644 templates-v7/csharp/netcore_testproject.additions.mustache delete mode 100644 templates-v7/csharp/netcore_testproject.mustache delete mode 100644 templates-v7/csharp/nuspec.mustache diff --git a/templates-v7/csharp/Solution.mustache b/templates-v7/csharp/Solution.mustache deleted file mode 100644 index b17929b96..000000000 --- a/templates-v7/csharp/Solution.mustache +++ /dev/null @@ -1,27 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio {{^netStandard}}2012{{/netStandard}}{{#netStandard}}14{{/netStandard}} -VisualStudioVersion = {{^netStandard}}12.0.0.0{{/netStandard}}{{#netStandard}}14.0.25420.1{{/netStandard}} -MinimumVisualStudioVersion = {{^netStandard}}10.0.0.1{{/netStandard}}{{#netStandard}}10.0.40219.1{{/netStandard}} -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "{{sourceFolder}}\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}" -EndProject -{{^excludeTests}}Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{testPackageName}}", "{{sourceFolder}}\{{testPackageName}}\{{testPackageName}}.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" -EndProject -{{/excludeTests}}Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {{packageGuid}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {{packageGuid}}.Debug|Any CPU.Build.0 = Debug|Any CPU - {{packageGuid}}.Release|Any CPU.ActiveCfg = Release|Any CPU - {{packageGuid}}.Release|Any CPU.Build.0 = Release|Any CPU - {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU - {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU - {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal \ No newline at end of file diff --git a/templates-v7/csharp/TestProject.mustache b/templates-v7/csharp/TestProject.mustache deleted file mode 100644 index 2a27f6a9f..000000000 --- a/templates-v7/csharp/TestProject.mustache +++ /dev/null @@ -1,35 +0,0 @@ - - - - - false - Properties - {{testPackageName}} - {{testPackageName}} - {{testTargetFramework}} - false - 512 - - - - - - - - - {{packageGuid}} - {{packageName}} - - - diff --git a/templates-v7/csharp/git_push.sh.mustache b/templates-v7/csharp/git_push.sh.mustache deleted file mode 100644 index 0e3776ae6..000000000 --- a/templates-v7/csharp/git_push.sh.mustache +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="{{{gitHost}}}" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="{{{releaseNote}}}" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/templates-v7/csharp/gitignore.mustache b/templates-v7/csharp/gitignore.mustache deleted file mode 100644 index 1ee53850b..000000000 --- a/templates-v7/csharp/gitignore.mustache +++ /dev/null @@ -1,362 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd diff --git a/templates-v7/csharp/libraries/httpclient/FileParameter.mustache b/templates-v7/csharp/libraries/httpclient/FileParameter.mustache deleted file mode 100644 index 87e5fcdc9..000000000 --- a/templates-v7/csharp/libraries/httpclient/FileParameter.mustache +++ /dev/null @@ -1,72 +0,0 @@ -{{>partial_header}} - -using System.IO; - -namespace {{packageName}}.Client -{ - - /// - /// Represents a File passed to the API as a Parameter, allows using different backends for files - /// - public class FileParameter - { - /// - /// The filename - /// - public string Name { get; set; } = "no_name_provided"; - - /// - /// The content type of the file - /// - public string ContentType { get; set; } = "application/octet-stream"; - - /// - /// The content of the file - /// - public Stream Content { get; set; } - - /// - /// Construct a FileParameter just from the contents, will extract the filename from a filestream - /// - /// The file content - public FileParameter(Stream content) - { - if (content is FileStream fs) - { - Name = fs.Name; - } - Content = content; - } - - /// - /// Construct a FileParameter from name and content - /// - /// The filename - /// The file content - public FileParameter(string filename, Stream content) - { - Name = filename; - Content = content; - } - - /// - /// Construct a FileParameter from name and content - /// - /// The filename - /// The content type of the file - /// The file content - public FileParameter(string filename, string contentType, Stream content) - { - Name = filename; - ContentType = contentType; - Content = content; - } - - /// - /// Implicit conversion of stream to file parameter. Useful for backwards compatibility. - /// - /// Stream to convert - /// FileParameter - public static implicit operator FileParameter(Stream s) => new FileParameter(s); - } -} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache b/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache deleted file mode 100644 index 25e76d03d..000000000 --- a/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache +++ /dev/null @@ -1,66 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.IO; -using System.Net; - -namespace {{packageName}}.Client -{ - /// - /// A container for generalized request inputs. This type allows consumers to extend the request functionality - /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). - /// - public class RequestOptions - { - /// - /// Parameters to be bound to path parts of the Request's URL - /// - public Dictionary PathParameters { get; set; } - - /// - /// Query parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap QueryParameters { get; set; } - - /// - /// Header parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap HeaderParameters { get; set; } - - /// - /// Form parameters to be sent along with the request. - /// - public Dictionary FormParameters { get; set; } - - /// - /// File parameters to be sent along with the request. - /// - public Multimap FileParameters { get; set; } - - /// - /// Cookies to be sent along with the request. - /// - public List Cookies { get; set; } - - /// - /// Any data associated with a request body. - /// - public Object Data { get; set; } - - /// - /// Constructs a new instance of - /// - public RequestOptions() - { - PathParameters = new Dictionary(); - QueryParameters = new Multimap(); - HeaderParameters = new Multimap(); - FormParameters = new Dictionary(); - FileParameters = new Multimap(); - Cookies = new List(); - } - } -} diff --git a/templates-v7/csharp/libraries/httpclient/api.mustache b/templates-v7/csharp/libraries/httpclient/api.mustache deleted file mode 100644 index f7330c2cc..000000000 --- a/templates-v7/csharp/libraries/httpclient/api.mustache +++ /dev/null @@ -1,766 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Net.Mime; -using {{packageName}}.Client; -{{#hasImport}}using {{packageName}}.{{modelPackage}}; -{{/hasImport}} - -namespace {{packageName}}.{{apiPackage}} -{ - {{#operations}} - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor - { - #region Synchronous Operations - {{#operation}} - /// - /// {{summary}} - /// - {{#notes}} - /// - /// {{.}} - /// - {{/notes}} - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); - - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); - {{/operation}} - #endregion Synchronous Operations - } - - {{#supportsAsync}} - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor - { - #region Asynchronous Operations - {{#operation}} - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of {{returnType}}{{^returnType}}void{{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default); - - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default); - {{/operation}} - #endregion Asynchronous Operations - } - {{/supportsAsync}} - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} - { - - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} partial class {{classname}} : IDisposable, {{interfacePrefix}}{{classname}} - { - private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// - public {{classname}}() : this((string)null) - { - } - - /// - /// Initializes a new instance of the class. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// The target service's base path in URL format. - /// - /// - public {{classname}}(string basePath) - { - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - new {{packageName}}.Client.Configuration { BasePath = basePath } - ); - this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - this.Client = this.ApiClient; - {{#supportsAsync}} - this.AsynchronousClient = this.ApiClient; - {{/supportsAsync}} - this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class using Configuration object. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// An instance of Configuration. - /// - /// - public {{classname}}({{packageName}}.Client.Configuration configuration) - { - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - configuration - ); - this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - this.Client = this.ApiClient; - {{#supportsAsync}} - this.AsynchronousClient = this.ApiClient; - {{/supportsAsync}} - ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class. - /// - /// An instance of HttpClient. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public {{classname}}(HttpClient client, HttpClientHandler handler = null) : this(client, (string)null, handler) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// An instance of HttpClient. - /// The target service's base path in URL format. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public {{classname}}(HttpClient client, string basePath, HttpClientHandler handler = null) - { - if (client == null) throw new ArgumentNullException("client"); - - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - new {{packageName}}.Client.Configuration { BasePath = basePath } - ); - this.ApiClient = new {{packageName}}.Client.ApiClient(client, this.Configuration.BasePath, handler); - this.Client = this.ApiClient; - {{#supportsAsync}} - this.AsynchronousClient = this.ApiClient; - {{/supportsAsync}} - this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class using Configuration object. - /// - /// An instance of HttpClient. - /// An instance of Configuration. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public {{classname}}(HttpClient client, {{packageName}}.Client.Configuration configuration, HttpClientHandler handler = null) - { - if (configuration == null) throw new ArgumentNullException("configuration"); - if (client == null) throw new ArgumentNullException("client"); - - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - configuration - ); - this.ApiClient = new {{packageName}}.Client.ApiClient(client, this.Configuration.BasePath, handler); - this.Client = this.ApiClient; - {{#supportsAsync}} - this.AsynchronousClient = this.ApiClient; - {{/supportsAsync}} - ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using a Configuration object and client instance. - /// - /// The client interface for synchronous API access.{{#supportsAsync}} - /// The client interface for asynchronous API access.{{/supportsAsync}} - /// The configuration object. - /// - public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) - { - if (client == null) throw new ArgumentNullException("client"); - {{#supportsAsync}} - if (asyncClient == null) throw new ArgumentNullException("asyncClient"); - {{/supportsAsync}} - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Client = client; - {{#supportsAsync}} - this.AsynchronousClient = asyncClient; - {{/supportsAsync}} - this.Configuration = configuration; - this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Disposes resources if they were created by us - /// - public void Dispose() - { - this.ApiClient?.Dispose(); - } - - /// - /// Holds the ApiClient if created - /// - public {{packageName}}.Client.ApiClient ApiClient { get; set; } = null; - - {{#supportsAsync}} - /// - /// The client for accessing this underlying API asynchronously. - /// - public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } - {{/supportsAsync}} - - /// - /// The client for accessing this underlying API synchronously. - /// - public {{packageName}}.Client.ISynchronousClient Client { get; set; } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public string GetBasePath() - { - return this.Configuration.BasePath; - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public {{packageName}}.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - {{#operation}} - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) - { - {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} - } - - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) - { - {{#allParams}} - {{#required}} - {{^vendorExtensions.x-csharp-value-type}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) - throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); - - {{/vendorExtensions.x-csharp-value-type}} - {{/required}} - {{/allParams}} - {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - {{#consumes}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/consumes}} - }; - - // to determine the Accept header - string[] _accepts = new string[] { - {{#produces}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/produces}} - }; - - var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - {{#pathParams}} - {{#required}} - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - } - {{/required}} - {{/pathParams}} - {{#queryParams}} - {{#required}} - {{#isDeepObject}} - {{#items.vars}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isDeepObject}} - {{#items.vars}} - if ({{paramName}}.{{name}} != null) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); - } - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - } - {{/required}} - {{/queryParams}} - {{#headerParams}} - {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - } - {{/required}} - {{/headerParams}} - {{#formParams}} - {{#required}} - {{#isFile}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter - {{/isFile}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isFile}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter - {{/isFile}} - } - {{/required}} - {{/formParams}} - {{#bodyParam}} - localVarRequestOptions.Data = {{paramName}}; - {{/bodyParam}} - - {{#authMethods}} - // authentication ({{name}}) required - {{#isApiKey}} - {{#isKeyInCookie}} - // cookie parameter support - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInCookie}} - {{#isKeyInHeader}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); - } - {{/isKeyInHeader}} - {{#isKeyInQuery}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInQuery}} - {{/isApiKey}} - {{#isBasicBasic}} - // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); - } - {{/isBasicBasic}} - {{#isBasicBearer}} - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isBasicBearer}} - {{#isOAuth}} - // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isOAuth}} - {{#isHttpSignature}} - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } - {{/isHttpSignature}} - {{/authMethods}} - - // make the HTTP request - var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - {{#supportsAsync}} - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of {{returnType}}{{^returnType}}void{{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default) - { - {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); - return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false);{{/returnType}} - } - - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default) - { - {{#allParams}} - {{#required}} - {{^vendorExtensions.x-csharp-value-type}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) - throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); - - {{/vendorExtensions.x-csharp-value-type}} - {{/required}} - {{/allParams}} - - {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - {{#consumes}} - "{{{mediaType}}}"{{^-last}}, {{/-last}} - {{/consumes}} - }; - - // to determine the Accept header - string[] _accepts = new string[] { - {{#produces}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/produces}} - }; - - - var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - {{#constantParams}} - {{#isPathParam}} - // Set client side default value of Path Param "{{baseName}}". - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant path parameter - {{/isPathParam}} - {{/constantParams}} - {{#pathParams}} - {{#required}} - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - } - {{/required}} - {{/pathParams}} - {{#constantParams}} - {{#isQueryParam}} - // Set client side default value of Query Param "{{baseName}}". - localVarRequestOptions.QueryParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant query parameter - {{/isQueryParam}} - {{/constantParams}} - {{#queryParams}} - {{#required}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - } - {{/required}} - {{/queryParams}} - {{#constantParams}} - {{#isHeaderParam}} - // Set client side default value of Header Param "{{baseName}}". - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter - {{/isHeaderParam}} - {{/constantParams}} - {{#headerParams}} - {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - } - {{/required}} - {{/headerParams}} - {{#formParams}} - {{#required}} - {{#isFile}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter - {{/isFile}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isFile}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter - {{/isFile}} - } - {{/required}} - {{/formParams}} - {{#bodyParam}} - localVarRequestOptions.Data = {{paramName}}; - {{/bodyParam}} - - {{#authMethods}} - // authentication ({{name}}) required - {{#isApiKey}} - {{#isKeyInCookie}} - // cookie parameter support - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInCookie}} - {{#isKeyInHeader}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); - } - {{/isKeyInHeader}} - {{#isKeyInQuery}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInQuery}} - {{/isApiKey}} - {{#isBasic}} - {{#isBasicBasic}} - // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); - } - {{/isBasicBasic}} - {{#isBasicBearer}} - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isBasicBearer}} - {{/isBasic}} - {{#isOAuth}} - // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isOAuth}} - {{#isHttpSignature}} - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } - {{/isHttpSignature}} - {{/authMethods}} - - // make the HTTP request - - var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - {{/supportsAsync}} - {{/operation}} - } - {{/operations}} -} diff --git a/templates-v7/csharp/libraries/httpclient/model.mustache b/templates-v7/csharp/libraries/httpclient/model.mustache deleted file mode 100644 index f84de7f64..000000000 --- a/templates-v7/csharp/libraries/httpclient/model.mustache +++ /dev/null @@ -1,51 +0,0 @@ -{{>partial_header}} - -{{#models}} -{{#model}} -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.IO; -{{#vendorExtensions.x-com-visible}} -using System.Runtime.InteropServices; -{{/vendorExtensions.x-com-visible}} -using System.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -{{#discriminator}} -using JsonSubTypes; -{{/discriminator}} -{{/model}} -{{/models}} -{{#validatable}} -using System.ComponentModel.DataAnnotations; -{{/validatable}} -using FileParameter = {{packageName}}.Client.FileParameter; -using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; -{{#useCompareNetObjects}} -using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; -{{/useCompareNetObjects}} -{{#models}} -{{#model}} -{{#oneOf}} -{{#-first}} -using System.Reflection; -{{/-first}} -{{/oneOf}} -{{#anyOf}} -{{#-first}} -using System.Reflection; -{{/-first}} -{{/anyOf}} - -namespace {{packageName}}.{{modelPackage}} -{ -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} -{{/model}} -{{/models}} -} diff --git a/templates-v7/csharp/libraries/unityWebRequest/ApiClient.mustache b/templates-v7/csharp/libraries/unityWebRequest/ApiClient.mustache deleted file mode 100644 index 71d621c88..000000000 --- a/templates-v7/csharp/libraries/unityWebRequest/ApiClient.mustache +++ /dev/null @@ -1,677 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Text; -using System.Threading; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; -using System.Net.Http; -using System.Net.Http.Headers; -using UnityEngine.Networking; -using UnityEngine; - -namespace {{packageName}}.Client -{ - /// - /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. - /// - internal class CustomJsonCodec - { - private readonly IReadableConfiguration _configuration; - private static readonly string _contentType = "application/json"; - private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - public CustomJsonCodec(IReadableConfiguration configuration) - { - _configuration = configuration; - } - - public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) - { - _serializerSettings = serializerSettings; - _configuration = configuration; - } - - /// - /// Serialize the object into a JSON string. - /// - /// Object to be serialized. - /// A JSON string. - public string Serialize(object obj) - { - if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) - { - // the object to be serialized is an oneOf/anyOf schema - return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); - } - else - { - return JsonConvert.SerializeObject(obj, _serializerSettings); - } - } - - public T Deserialize(UnityWebRequest request) - { - var result = (T) Deserialize(request, typeof(T)); - return result; - } - - /// - /// Deserialize the JSON string into a proper object. - /// - /// The UnityWebRequest after it has a response. - /// Object type. - /// Object representation of the JSON string. - internal object Deserialize(UnityWebRequest request, Type type) - { - if (type == typeof(byte[])) // return byte array - { - return request.downloadHandler.data; - } - - // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) - if (type == typeof(Stream)) - { - // NOTE: Ignoring Content-Disposition filename support, since not all platforms - // have a location on disk to write arbitrary data (tvOS, consoles). - return new MemoryStream(request.downloadHandler.data); - } - - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object - { - return DateTime.Parse(request.downloadHandler.text, null, System.Globalization.DateTimeStyles.RoundtripKind); - } - - if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type - { - return Convert.ChangeType(request.downloadHandler.text, type); - } - - var contentType = request.GetResponseHeader("Content-Type"); - - if (!string.IsNullOrEmpty(contentType) && contentType.Contains("application/json")) - { - var text = request.downloadHandler?.text; - - // Generated APIs that don't expect a return value provide System.Object as the type - if (type == typeof(global::System.Object) && (string.IsNullOrEmpty(text) || text.Trim() == "null")) - { - return null; - } - - if (request.responseCode >= 200 && request.responseCode < 300) - { - try - { - // Deserialize as a model - return JsonConvert.DeserializeObject(text, type, _serializerSettings); - } - catch (Exception e) - { - throw new UnexpectedResponseException(request, type, e.ToString()); - } - } - else - { - throw new ApiException((int)request.responseCode, request.error, text); - } - } - - if (type != typeof(global::System.Object) && request.responseCode >= 200 && request.responseCode < 300) - { - throw new UnexpectedResponseException(request, type); - } - - return null; - - } - - public string RootElement { get; set; } - public string Namespace { get; set; } - public string DateFormat { get; set; } - - public string ContentType - { - get { return _contentType; } - set { throw new InvalidOperationException("Not allowed to set content type."); } - } - } - /// - /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), - /// encapsulating general REST accessor use cases. - /// - /// - /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. - /// - {{>visibility}} partial class ApiClient : IDisposable, ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} - { - private readonly string _baseUrl; - - /// - /// Specifies the settings on a object. - /// These settings can be adjusted to accommodate custom serialization rules. - /// - public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Initializes a new instance of the , defaulting to the global configurations' base url. - /// - public ApiClient() : - this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) - { - } - - /// - /// Initializes a new instance of the . - /// - /// The target service's base path in URL format. - /// - public ApiClient(string basePath) - { - if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); - - _baseUrl = basePath; - } - - /// - /// Disposes resources if they were created by us - /// - public void Dispose() - { - } - - /// - /// Provides all logic for constructing a new UnityWebRequest. - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the UnityWebRequest. - /// - /// The http verb. - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// [private] A new UnityWebRequest instance. - /// - private UnityWebRequest NewRequest( - string method, - string path, - RequestOptions options, - IReadableConfiguration configuration) - { - if (path == null) throw new ArgumentNullException("path"); - if (options == null) throw new ArgumentNullException("options"); - if (configuration == null) throw new ArgumentNullException("configuration"); - - WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); - - builder.AddPathParameters(options.PathParameters); - - builder.AddQueryParameters(options.QueryParameters); - - string contentType = null; - if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) - { - var contentTypes = options.HeaderParameters["Content-Type"]; - contentType = contentTypes.FirstOrDefault(); - } - - var uri = builder.GetFullUri(); - UnityWebRequest request = null; - - if (contentType == "multipart/form-data") - { - var formData = new List(); - foreach (var formParameter in options.FormParameters) - { - formData.Add(new MultipartFormDataSection(formParameter.Key, formParameter.Value)); - } - - request = UnityWebRequest.Post(uri, formData); - request.method = method; - } - else if (contentType == "application/x-www-form-urlencoded") - { - var form = new WWWForm(); - foreach (var kvp in options.FormParameters) - { - form.AddField(kvp.Key, kvp.Value); - } - - request = UnityWebRequest.Post(uri, form); - request.method = method; - } - else if (contentType == "application/octet-stream") - { - if(options.Data is Stream stream) - { - using (var binaryReader = new BinaryReader(stream)) - { - var bytes = binaryReader.ReadBytes((int)stream.Length); - request = UnityWebRequest.Put(uri, bytes); - request.method = method; - request.SetRequestHeader("Content-Type", "application/octet-stream"); - } - } - else - { - throw new InvalidDataException($"{nameof(options.Data)} is not of {nameof(Stream)} type"); - } - } - else if (options.Data != null) - { - var serializer = new CustomJsonCodec(SerializerSettings, configuration); - var jsonData = serializer.Serialize(options.Data); - - // Making a post body application/json encoded is whack with UnityWebRequest. - // See: https://stackoverflow.com/questions/68156230/unitywebrequest-post-not-sending-body - request = UnityWebRequest.Put(uri, jsonData); - request.method = method; - request.SetRequestHeader("Content-Type", "application/json"); - } - else - { - request = new UnityWebRequest(builder.GetFullUri(), method); - } - - if (request.downloadHandler == null && typeof(T) != typeof(global::System.Object)) - { - request.downloadHandler = new DownloadHandlerBuffer(); - } - -#if UNITY_EDITOR || !UNITY_WEBGL - if (configuration.UserAgent != null) - { - request.SetRequestHeader("User-Agent", configuration.UserAgent); - } -#endif - - if (configuration.DefaultHeaders != null) - { - foreach (var headerParam in configuration.DefaultHeaders) - { - request.SetRequestHeader(headerParam.Key, headerParam.Value); - } - } - - if (options.HeaderParameters != null) - { - foreach (var headerParam in options.HeaderParameters) - { - foreach (var value in headerParam.Value) - { - // Todo make content headers actually content headers - request.SetRequestHeader(headerParam.Key, value); - } - } - } - - if (options.Cookies != null && options.Cookies.Count > 0) - { - #if UNITY_WEBGL - throw new System.InvalidOperationException("UnityWebRequest does not support setting cookies in WebGL"); - #else - if (options.Cookies.Count != 1) - { - UnityEngine.Debug.LogError("Only one cookie supported, ignoring others"); - } - - request.SetRequestHeader("Cookie", options.Cookies[0].ToString()); - #endif - } - - return request; - - } - - partial void InterceptRequest(UnityWebRequest req, string path, RequestOptions options, IReadableConfiguration configuration); - partial void InterceptResponse(UnityWebRequest req, string path, RequestOptions options, IReadableConfiguration configuration, ref object responseData); - - private ApiResponse ToApiResponse(UnityWebRequest request, object responseData) - { - T result = (T) responseData; - - var transformed = new ApiResponse((HttpStatusCode)request.responseCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, request.downloadHandler?.text ?? "") - { - ErrorText = request.error, - Cookies = new List() - }; - - // process response headers, e.g. Access-Control-Allow-Methods - var responseHeaders = request.GetResponseHeaders(); - if (responseHeaders != null) - { - foreach (var responseHeader in request.GetResponseHeaders()) - { - transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - return transformed; - } - - private async Task> ExecAsync( - UnityWebRequest request, - string path, - RequestOptions options, - IReadableConfiguration configuration, - System.Threading.CancellationToken cancellationToken = default) - { - var deserializer = new CustomJsonCodec(SerializerSettings, configuration); - - using (request) - { - {{#useIntForTimeout}} - if (configuration.Timeout > 0) - { - request.timeout = configuration.Timeout; - } - {{/useIntForTimeout}} - {{^useIntForTimeout}} - if (configuration.Timeout > TimeSpan.Zero) - { - request.timeout = (int)Math.Ceiling(configuration.Timeout.TotalSeconds); - } - {{/useIntForTimeout}} - - if (configuration.Proxy != null) - { - throw new InvalidOperationException("Configuration `Proxy` not supported by UnityWebRequest"); - } - - if (configuration.ClientCertificates != null) - { - // Only Android/iOS/tvOS/Standalone players can support certificates, and this - // implementation is intended to work on all platforms. - // - // TODO: Could optionally allow support for this on these platforms. - // - // See: https://docs.unity3d.com/ScriptReference/Networking.CertificateHandler.html - throw new InvalidOperationException("Configuration `ClientCertificates` not supported by UnityWebRequest on all platforms"); - } - - InterceptRequest(request, path, options, configuration); - - #if UNITY_2020_2_OR_NEWER - // For Unity 2020.2 and newer, use UnityWebRequest.Result. - var asyncOp = request.SendWebRequest(); - TaskCompletionSource tcs = new TaskCompletionSource(); - asyncOp.completed += (_) => tcs.TrySetResult(request.result); - using (var tokenRegistration = cancellationToken.Register(request.Abort, true)) - { - await tcs.Task; - } - - if (request.result == UnityWebRequest.Result.ConnectionError || - request.result == UnityWebRequest.Result.DataProcessingError) - { - throw new ConnectionException(request); - } - #else - // For Unity 2019 and earlier, await the operation directly. - var asyncOp = request.SendWebRequest(); - using (var tokenRegistration = cancellationToken.Register(request.Abort, true)) - { - await asyncOp; - } - - if (request.isNetworkError || request.isHttpError) - { - throw new ConnectionException(request); - } - #endif - - object responseData = deserializer.Deserialize(request); - - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { new ByteArrayContent(request.downloadHandler.data) }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - responseData = (T) (object) new MemoryStream(request.downloadHandler.data); - } - - InterceptResponse(request, path, options, configuration, ref responseData); - - return ToApiResponse(request, responseData); - } - } - - {{#supportsAsync}} - #region IAsynchronousClient - /// - /// Make a HTTP GET request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest("GET", path, options, config), path, options, config, cancellationToken); - } - - /// - /// Make a HTTP POST request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest("POST", path, options, config), path, options, config, cancellationToken); - } - - /// - /// Make a HTTP PUT request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest("PUT", path, options, config), path, options, config, cancellationToken); - } - - /// - /// Make a HTTP DELETE request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest("DELETE", path, options, config), path, options, config, cancellationToken); - } - - /// - /// Make a HTTP HEAD request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest("HEAD", path, options, config), path, options, config, cancellationToken); - } - - /// - /// Make a HTTP OPTION request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest("OPTIONS", path, options, config), path, options, config, cancellationToken); - } - - /// - /// Make a HTTP PATCH request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest("PATCH", path, options, config), path, options, config, cancellationToken); - } - #endregion IAsynchronousClient - {{/supportsAsync}} - - #region ISynchronousClient - /// - /// Make a HTTP GET request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); - } - - /// - /// Make a HTTP POST request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); - } - - /// - /// Make a HTTP PUT request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); - } - - /// - /// Make a HTTP DELETE request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); - } - - /// - /// Make a HTTP HEAD request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); - } - - /// - /// Make a HTTP OPTION request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); - } - - /// - /// Make a HTTP PATCH request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); - } - #endregion ISynchronousClient - } -} diff --git a/templates-v7/csharp/libraries/unityWebRequest/ConnectionException.mustache b/templates-v7/csharp/libraries/unityWebRequest/ConnectionException.mustache deleted file mode 100644 index c4c9ae32e..000000000 --- a/templates-v7/csharp/libraries/unityWebRequest/ConnectionException.mustache +++ /dev/null @@ -1,57 +0,0 @@ -{{>partial_header}} - -using System; -using UnityEngine.Networking; - -namespace {{packageName}}.Client -{ -#if UNITY_2020_1_OR_NEWER - public class ConnectionException : Exception - { - public UnityWebRequest.Result Result { get; private set; } - public string Error { get; private set; } - - // NOTE: Cannot keep reference to the request since it will be disposed. - public ConnectionException(UnityWebRequest request) - : base($"result={request.result} error={request.error}") - { - Result = request.result; - Error = request.error ?? ""; - } - } -#else - // For Unity 2019, define a custom enum that roughly simulates UnityWebRequest.Result. - public enum UnityWebRequestResultLegacy - { - Success, - ConnectionError, - ProtocolError, - DataProcessingError - } - - public class ConnectionException : Exception - { - public UnityWebRequestResultLegacy Result { get; private set; } - public string Error { get; private set; } - - public ConnectionException(UnityWebRequest request) - : base($"Error: {request.error}") - { - if (request.isNetworkError) - { - Result = UnityWebRequestResultLegacy.ConnectionError; - } - else if (request.isHttpError) - { - Result = UnityWebRequestResultLegacy.ProtocolError; - } - else - { - Result = UnityWebRequestResultLegacy.Success; - } - - Error = request.error ?? ""; - } - } -#endif -} diff --git a/templates-v7/csharp/libraries/unityWebRequest/README.mustache b/templates-v7/csharp/libraries/unityWebRequest/README.mustache deleted file mode 100644 index e94bc78c6..000000000 --- a/templates-v7/csharp/libraries/unityWebRequest/README.mustache +++ /dev/null @@ -1,175 +0,0 @@ -# {{packageName}} - the C# library for the {{appName}} - -{{#appDescriptionWithNewLines}} -{{{.}}} -{{/appDescriptionWithNewLines}} - -This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: {{appVersion}} -- SDK version: {{packageVersion}} -{{^hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Generator version: {{generatorVersion}} -- Build package: {{generatorClass}} -{{#infoUrl}} - For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - - -## Version support -This generator should support all current LTS versions of Unity -- Unity 2019.4 (LTS) and up -- .NET Standard 2.1 / .NET Framework - - -## Dependencies - -- [Newtonsoft.Json](https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.0/manual/index.html) - 3.0.2 or later -- [Unity Test Framework](https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/manual/index.html) - 1.1.33 or later - - -## Installation -Add the dependencies to `Packages/manifest.json` -``` -{ - "dependencies": { - ... - "com.unity.nuget.newtonsoft-json": "3.0.2", - "com.unity.test-framework": "1.1.33", - } -} -``` - -Then use the namespaces: -```csharp -using {{packageName}}.{{apiPackage}}; -using {{packageName}}.Client; -using {{packageName}}.{{modelPackage}}; -``` - - -## Getting Started - -```csharp -using System; -using System.Collections.Generic; -using UnityEngine; -using {{packageName}}.{{apiPackage}}; -using {{packageName}}.Client; -using {{packageName}}.{{modelPackage}}; - -namespace {{packageName}}Example -{ -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} - public class {{operationId}}Example : MonoBehaviour - { - async void Start() - { - Configuration config = new Configuration(); - config.BasePath = "{{{basePath}}}"; - {{#hasAuthMethods}} - {{#authMethods}} - {{#isBasicBasic}} - // Configure HTTP basic authorization: {{{name}}} - config.Username = "YOUR_USERNAME"; - config.Password = "YOUR_PASSWORD"; - {{/isBasicBasic}} - {{#isBasicBearer}} - // Configure Bearer token for authorization: {{{name}}} - config.AccessToken = "YOUR_BEARER_TOKEN"; - {{/isBasicBearer}} - {{#isApiKey}} - // Configure API key authorization: {{{name}}} - config.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); - // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed - // config.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer"); - {{/isApiKey}} - {{#isOAuth}} - // Configure OAuth2 access token for authorization: {{{name}}} - config.AccessToken = "YOUR_ACCESS_TOKEN"; - {{/isOAuth}} - {{/authMethods}} - - {{/hasAuthMethods}} - var apiInstance = new {{classname}}(config); - {{#allParams}} - {{#isPrimitiveType}} - var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} - {{/isPrimitiveType}} - {{^isPrimitiveType}} - var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} - {{/isPrimitiveType}} - {{/allParams}} - - try - { - {{#summary}} - // {{{.}}} - {{/summary}} - {{#returnType}}{{{.}}} result = {{/returnType}}await apiInstance.{{{operationId}}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - Debug.Log(result);{{/returnType}} - Debug.Log("Done!"); - } - catch (ApiException e) - { - Debug.LogError("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); - Debug.LogError("Status Code: "+ e.ErrorCode); - Debug.LogError(e.StackTrace); - } -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} - } - } -} -``` - - -## Documentation for API Endpoints - -All URIs are relative to *{{{basePath}}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - - -## Documentation for Models - -{{#modelPackage}} -{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) -{{/model}}{{/models}} -{{/modelPackage}} -{{^modelPackage}} -No model defined in this package -{{/modelPackage}} - - -## Documentation for Authorization - -{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} -{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} -{{#authMethods}} - -### {{name}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{keyParamName}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasicBasic}}- **Type**: HTTP basic authentication -{{/isBasicBasic}} -{{#isBasicBearer}}- **Type**: Bearer Authentication -{{/isBasicBearer}} -{{#isHttpSignature}}- **Type**: HTTP signature authentication -{{/isHttpSignature}} -{{#isOAuth}}- **Type**: OAuth -- **Flow**: {{flow}} -- **Authorization URL**: {{authorizationUrl}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - {{scope}}: {{description}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} diff --git a/templates-v7/csharp/libraries/unityWebRequest/RequestOptions.mustache b/templates-v7/csharp/libraries/unityWebRequest/RequestOptions.mustache deleted file mode 100644 index 0dd18c4ed..000000000 --- a/templates-v7/csharp/libraries/unityWebRequest/RequestOptions.mustache +++ /dev/null @@ -1,60 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.IO; -using System.Net; - -namespace {{packageName}}.Client -{ - /// - /// A container for generalized request inputs. This type allows consumers to extend the request functionality - /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). - /// - public class RequestOptions - { - /// - /// Parameters to be bound to path parts of the Request's URL - /// - public Dictionary PathParameters { get; set; } - - /// - /// Query parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap QueryParameters { get; set; } - - /// - /// Header parameters to be applied to to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap HeaderParameters { get; set; } - - /// - /// Form parameters to be sent along with the request. - /// - public Dictionary FormParameters { get; set; } - - /// - /// Cookies to be sent along with the request. - /// - public List Cookies { get; set; } - - /// - /// Any data associated with a request body. - /// - public Object Data { get; set; } - - /// - /// Constructs a new instance of - /// - public RequestOptions() - { - PathParameters = new Dictionary(); - QueryParameters = new Multimap(); - HeaderParameters = new Multimap(); - FormParameters = new Dictionary(); - Cookies = new List(); - } - } -} diff --git a/templates-v7/csharp/libraries/unityWebRequest/UnexpectedResponseException.mustache b/templates-v7/csharp/libraries/unityWebRequest/UnexpectedResponseException.mustache deleted file mode 100644 index a976b2a76..000000000 --- a/templates-v7/csharp/libraries/unityWebRequest/UnexpectedResponseException.mustache +++ /dev/null @@ -1,26 +0,0 @@ -{{>partial_header}} - -using System; -using UnityEngine.Networking; - -namespace {{packageName}}.Client -{ - // Thrown when a backend doesn't return an expected response based on the expected type - // of the response data. - public class UnexpectedResponseException : Exception - { - public int ErrorCode { get; private set; } - - // NOTE: Cannot keep reference to the request since it will be disposed. - public UnexpectedResponseException(UnityWebRequest request, System.Type type, string extra = "") - : base(CreateMessage(request, type, extra)) - { - ErrorCode = (int)request.responseCode; - } - - private static string CreateMessage(UnityWebRequest request, System.Type type, string extra) - { - return $"httpcode={request.responseCode}, expected {type.Name} but got data: {extra}"; - } - } -} diff --git a/templates-v7/csharp/libraries/unityWebRequest/UnityWebRequestAwaiterExtension.mustache b/templates-v7/csharp/libraries/unityWebRequest/UnityWebRequestAwaiterExtension.mustache deleted file mode 100644 index 1f9ff95c4..000000000 --- a/templates-v7/csharp/libraries/unityWebRequest/UnityWebRequestAwaiterExtension.mustache +++ /dev/null @@ -1,23 +0,0 @@ -{{>partial_header}} - -using System.Runtime.CompilerServices; -using System.Threading.Tasks; -using UnityEngine.Networking; - -namespace {{packageName}}.Client -{ - /// - /// Provides an awaiter for UnityWebRequestAsyncOperation to allow `await request.SendWebRequest()` - /// in Unity async methods. Unity's AsyncOperation types are not awaitable by default, so this - /// extension bridges that gap by converting the operation into a Task. - /// - public static class UnityWebRequestAwaiterExtensions - { - public static TaskAwaiter GetAwaiter(this UnityWebRequestAsyncOperation asyncOp) - { - var tcs = new TaskCompletionSource(); - asyncOp.completed += _ => tcs.SetResult(asyncOp); - return tcs.Task.GetAwaiter(); - } - } -} diff --git a/templates-v7/csharp/libraries/unityWebRequest/api.mustache b/templates-v7/csharp/libraries/unityWebRequest/api.mustache deleted file mode 100644 index c94df9125..000000000 --- a/templates-v7/csharp/libraries/unityWebRequest/api.mustache +++ /dev/null @@ -1,690 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Net; -using System.Net.Mime; -using {{packageName}}.Client; -{{#hasImport}}using {{packageName}}.{{modelPackage}}; -{{/hasImport}} - -namespace {{packageName}}.{{apiPackage}} -{ - {{#operations}} - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor - { - #region Synchronous Operations - {{#operation}} - /// - /// {{summary}} - /// - {{#notes}} - /// - /// {{.}} - /// - {{/notes}} - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); - - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); - {{/operation}} - #endregion Synchronous Operations - } - - {{#supportsAsync}} - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor - { - #region Asynchronous Operations - {{#operation}} - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of {{returnType}}{{^returnType}}void{{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default); - - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default); - {{/operation}} - #endregion Asynchronous Operations - } - {{/supportsAsync}} - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} - { - - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} partial class {{classname}} : IDisposable, {{interfacePrefix}}{{classname}} - { - private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// - public {{classname}}() : this((string)null) - { - } - - /// - /// Initializes a new instance of the class. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// The target service's base path in URL format. - /// - /// - public {{classname}}(string basePath) - { - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - new {{packageName}}.Client.Configuration { BasePath = basePath } - ); - this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - this.Client = this.ApiClient; - {{#supportsAsync}} - this.AsynchronousClient = this.ApiClient; - {{/supportsAsync}} - this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class using Configuration object. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// An instance of Configuration. - /// - /// - public {{classname}}({{packageName}}.Client.Configuration configuration) - { - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - configuration - ); - this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - this.Client = this.ApiClient; - {{#supportsAsync}} - this.AsynchronousClient = this.ApiClient; - {{/supportsAsync}} - ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using a Configuration object and client instance. - /// - /// The client interface for synchronous API access.{{#supportsAsync}} - /// The client interface for asynchronous API access.{{/supportsAsync}} - /// The configuration object. - /// - public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) - { - if (client == null) throw new ArgumentNullException("client"); - {{#supportsAsync}} - if (asyncClient == null) throw new ArgumentNullException("asyncClient"); - {{/supportsAsync}} - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Client = client; - {{#supportsAsync}} - this.AsynchronousClient = asyncClient; - {{/supportsAsync}} - this.Configuration = configuration; - this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Disposes resources if they were created by us - /// - public void Dispose() - { - this.ApiClient?.Dispose(); - } - - /// - /// Holds the ApiClient if created - /// - public {{packageName}}.Client.ApiClient ApiClient { get; set; } = null; - - {{#supportsAsync}} - /// - /// The client for accessing this underlying API asynchronously. - /// - public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } - {{/supportsAsync}} - - /// - /// The client for accessing this underlying API synchronously. - /// - public {{packageName}}.Client.ISynchronousClient Client { get; set; } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public string GetBasePath() - { - return this.Configuration.BasePath; - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public {{packageName}}.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - {{#operation}} - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) - { - {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} - } - - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) - { - {{#allParams}} - {{#required}} - {{^vendorExtensions.x-csharp-value-type}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) - throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); - - {{/vendorExtensions.x-csharp-value-type}} - {{/required}} - {{/allParams}} - {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - {{#consumes}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/consumes}} - }; - - // to determine the Accept header - string[] _accepts = new string[] { - {{#produces}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/produces}} - }; - - var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - {{#pathParams}} - {{#required}} - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - } - {{/required}} - {{/pathParams}} - {{#queryParams}} - {{#required}} - {{#isDeepObject}} - {{#items.vars}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isDeepObject}} - {{#items.vars}} - if ({{paramName}}.{{name}} != null) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); - } - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - } - {{/required}} - {{/queryParams}} - {{#headerParams}} - {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - } - {{/required}} - {{/headerParams}} - {{#formParams}} - {{#required}} - {{#isFile}} - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter - {{/isFile}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isFile}} - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter - {{/isFile}} - } - {{/required}} - {{/formParams}} - {{#bodyParam}} - localVarRequestOptions.Data = {{paramName}}; - {{/bodyParam}} - - {{#authMethods}} - // authentication ({{name}}) required - {{#isApiKey}} - {{#isKeyInCookie}} - // cookie parameter support - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInCookie}} - {{#isKeyInHeader}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); - } - {{/isKeyInHeader}} - {{#isKeyInQuery}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInQuery}} - {{/isApiKey}} - {{#isBasicBasic}} - // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); - } - {{/isBasicBasic}} - {{#isBasicBearer}} - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isBasicBearer}} - {{#isOAuth}} - // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isOAuth}} - {{#isHttpSignature}} - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } - {{/isHttpSignature}} - {{/authMethods}} - - // make the HTTP request - var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - {{#supportsAsync}} - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of {{returnType}}{{^returnType}}void{{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default) - { - var task = {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken); - {{#returnType}} -#if UNITY_EDITOR || !UNITY_WEBGL - {{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await task.ConfigureAwait(false); -#else - {{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await task; -#endif - return localVarResponse.Data; - {{/returnType}} - {{^returnType}} -#if UNITY_EDITOR || !UNITY_WEBGL - await task.ConfigureAwait(false); -#else - await task; -#endif - {{/returnType}} - } - - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default) - { - {{#allParams}} - {{#required}} - {{^vendorExtensions.x-csharp-value-type}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) - throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); - - {{/vendorExtensions.x-csharp-value-type}} - {{/required}} - {{/allParams}} - - {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - {{#consumes}} - "{{{mediaType}}}"{{^-last}}, {{/-last}} - {{/consumes}} - }; - - // to determine the Accept header - string[] _accepts = new string[] { - {{#produces}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/produces}} - }; - - - var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - - var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - - {{#pathParams}} - {{#required}} - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - } - {{/required}} - {{/pathParams}} - {{#queryParams}} - {{#required}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - } - {{/required}} - {{/queryParams}} - {{#headerParams}} - {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - } - {{/required}} - {{/headerParams}} - {{#formParams}} - {{#required}} - {{#isFile}} - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter - {{/isFile}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isFile}} - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter - {{/isFile}} - } - {{/required}} - {{/formParams}} - {{#bodyParam}} - localVarRequestOptions.Data = {{paramName}}; - {{/bodyParam}} - - {{#authMethods}} - // authentication ({{name}}) required - {{#isApiKey}} - {{#isKeyInCookie}} - // cookie parameter support - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInCookie}} - {{#isKeyInHeader}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); - } - {{/isKeyInHeader}} - {{#isKeyInQuery}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInQuery}} - {{/isApiKey}} - {{#isBasic}} - {{#isBasicBasic}} - // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); - } - {{/isBasicBasic}} - {{#isBasicBearer}} - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isBasicBearer}} - {{/isBasic}} - {{#isOAuth}} - // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isOAuth}} - {{#isHttpSignature}} - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } - {{/isHttpSignature}} - {{/authMethods}} - - // make the HTTP request - - var task = this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken); - -#if UNITY_EDITOR || !UNITY_WEBGL - var localVarResponse = await task.ConfigureAwait(false); -#else - var localVarResponse = await task; -#endif - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); - if (_exception != null) throw _exception; - } - - return localVarResponse; - } - - {{/supportsAsync}} - {{/operation}} - } - {{/operations}} -} diff --git a/templates-v7/csharp/libraries/unityWebRequest/api_test.mustache b/templates-v7/csharp/libraries/unityWebRequest/api_test.mustache deleted file mode 100644 index 0f7f49f7f..000000000 --- a/templates-v7/csharp/libraries/unityWebRequest/api_test.mustache +++ /dev/null @@ -1,74 +0,0 @@ -{{>partial_header}} -using System; -using System.IO; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reflection; -using NUnit.Framework; - -using {{packageName}}.Client; -using {{packageName}}.{{apiPackage}}; -{{#hasImport}} -// uncomment below to import models -//using {{packageName}}.{{modelPackage}}; -{{/hasImport}} - -namespace {{packageName}}.Test.Api -{ - /// - /// Class for testing {{classname}} - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the API endpoint. - /// - public class {{classname}}Tests : IDisposable - { - {{^nonPublicApi}} - private {{classname}} instance; - - {{/nonPublicApi}} - public {{classname}}Tests() - { - {{^nonPublicApi}} - instance = new {{classname}}(); - {{/nonPublicApi}} - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of {{classname}} - /// - [Test] - public void {{operationId}}InstanceTest() - { - // TODO uncomment below to test 'IsType' {{classname}} - //Assert.IsType<{{classname}}>(instance); - } - {{#operations}} - {{#operation}} - - /// - /// Test {{operationId}} - /// - [Test] - public void {{operationId}}Test() - { - // TODO uncomment below to test the method and replace null with proper value - {{#allParams}} - //{{{dataType}}} {{paramName}} = null; - {{/allParams}} - //{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - {{#returnType}} - //Assert.IsType<{{{.}}}>(response); - {{/returnType}} - } - {{/operation}} - {{/operations}} - } -} diff --git a/templates-v7/csharp/libraries/unityWebRequest/asmdef.mustache b/templates-v7/csharp/libraries/unityWebRequest/asmdef.mustache deleted file mode 100644 index a30cba8cc..000000000 --- a/templates-v7/csharp/libraries/unityWebRequest/asmdef.mustache +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "{{packageName}}", - "overrideReferences": true, - "precompiledReferences": [ - "Newtonsoft.Json.dll" - ] -} diff --git a/templates-v7/csharp/libraries/unityWebRequest/asmdef_test.mustache b/templates-v7/csharp/libraries/unityWebRequest/asmdef_test.mustache deleted file mode 100644 index c5e2d5852..000000000 --- a/templates-v7/csharp/libraries/unityWebRequest/asmdef_test.mustache +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "{{testPackageName}}", - "references": [ - "{{packageName}}", - "UnityEngine.TestRunner" - ], - "overrideReferences": true, - "precompiledReferences": [ - "nunit.framework.dll", - "Newtonsoft.Json.dll" - ], - "defineConstraints": [ - "UNITY_INCLUDE_TESTS" - ] -} diff --git a/templates-v7/csharp/libraries/unityWebRequest/model.mustache b/templates-v7/csharp/libraries/unityWebRequest/model.mustache deleted file mode 100644 index 3c1c6c0e2..000000000 --- a/templates-v7/csharp/libraries/unityWebRequest/model.mustache +++ /dev/null @@ -1,47 +0,0 @@ -{{>partial_header}} - -{{#models}} -{{#model}} -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.IO; -{{#vendorExtensions.x-com-visible}} -using System.Runtime.InteropServices; -{{/vendorExtensions.x-com-visible}} -using System.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -{{/model}} -{{/models}} -{{#validatable}} -using System.ComponentModel.DataAnnotations; -{{/validatable}} -using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; -{{#useCompareNetObjects}} -using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; -{{/useCompareNetObjects}} -{{#models}} -{{#model}} -{{#oneOf}} -{{#-first}} -using System.Reflection; -{{/-first}} -{{/oneOf}} -{{#anyOf}} -{{#-first}} -using System.Reflection; -{{/-first}} -{{/anyOf}} - -namespace {{packageName}}.{{modelPackage}} -{ -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} -{{/model}} -{{/models}} -} diff --git a/templates-v7/csharp/libraries/unityWebRequest/model_test.mustache b/templates-v7/csharp/libraries/unityWebRequest/model_test.mustache deleted file mode 100644 index 404623281..000000000 --- a/templates-v7/csharp/libraries/unityWebRequest/model_test.mustache +++ /dev/null @@ -1,64 +0,0 @@ -{{>partial_header}} - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using {{packageName}}.{{apiPackage}}; -using {{packageName}}.{{modelPackage}}; -using {{packageName}}.{{clientPackage}}; -using System.Reflection; -using Newtonsoft.Json; -using NUnit.Framework; - -{{#models}} -{{#model}} -namespace {{packageName}}.Test.Model -{ - /// - /// Class for testing {{classname}} - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class {{classname}}Tests : IDisposable - { - // TODO uncomment below to declare an instance variable for {{classname}} - //private {{classname}} instance; - - public {{classname}}Tests() - { - // TODO uncomment below to create an instance of {{classname}} - //instance = new {{classname}}(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of {{classname}} - /// - [Test] - public void {{classname}}InstanceTest() - { - // TODO uncomment below to test "IsType" {{classname}} - //Assert.IsType<{{classname}}>(instance); - } - - {{#vars}} - /// - /// Test the property '{{name}}' - /// - [Test] - public void {{name}}Test() - { - // TODO unit test for the property '{{name}}' - } - {{/vars}} - } -} -{{/model}} -{{/models}} diff --git a/templates-v7/csharp/netcore_project.additions.mustache b/templates-v7/csharp/netcore_project.additions.mustache deleted file mode 100644 index 8c6f3ad52..000000000 --- a/templates-v7/csharp/netcore_project.additions.mustache +++ /dev/null @@ -1 +0,0 @@ -{{! if needed users can add this file to their templates folder to append to the csproj }} \ No newline at end of file diff --git a/templates-v7/csharp/netcore_project.mustache b/templates-v7/csharp/netcore_project.mustache deleted file mode 100644 index 0754f7382..000000000 --- a/templates-v7/csharp/netcore_project.mustache +++ /dev/null @@ -1,84 +0,0 @@ - - - {{#useGenericHost}} - true {{/useGenericHost}}{{^useGenericHost}} - false{{/useGenericHost}} - {{targetFramework}} - {{packageName}} - {{packageName}} - Library - {{packageAuthors}} - {{packageCompany}} - {{packageTitle}} - {{packageDescription}} - {{packageCopyright}} - {{packageName}} - {{packageVersion}} - bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml{{#licenseId}} - {{.}}{{/licenseId}} - https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git - git{{#releaseNote}} - {{.}}{{/releaseNote}}{{#packageTags}} - {{{.}}}{{/packageTags}}{{#nrt}} - {{#useGenericHost}}enable{{/useGenericHost}}{{^useGenericHost}}annotations{{/useGenericHost}}{{/nrt}} - false - - - - {{#useCompareNetObjects}} - - {{/useCompareNetObjects}} - {{^useGenericHost}} - - - {{/useGenericHost}} - {{#useRestSharp}} - - {{/useRestSharp}} - {{#useGenericHost}} - - - {{#supportsRetry}} - - {{/supportsRetry}} - {{#net80OrLater}} - - {{/net80OrLater}} - {{^net60OrLater}} - - {{#net47OrLater}} - - {{/net47OrLater}} - {{/net60OrLater}} - {{/useGenericHost}} - {{^useGenericHost}} - {{#supportsRetry}} - - {{/supportsRetry}} - {{/useGenericHost}} - {{#validatable}} - {{^net60OrLater}} - - {{/net60OrLater}} - {{/validatable}} - - -{{^useGenericHost}} - - {{^net60OrLater}} - - {{/net60OrLater}} - {{#net48}} - - {{/net48}} - - - {{^net60OrLater}} - - {{/net60OrLater}} - {{#net48}} - - {{/net48}} - -{{/useGenericHost}} -{{>netcore_project.additions}} diff --git a/templates-v7/csharp/netcore_testproject.additions.mustache b/templates-v7/csharp/netcore_testproject.additions.mustache deleted file mode 100644 index 8c6f3ad52..000000000 --- a/templates-v7/csharp/netcore_testproject.additions.mustache +++ /dev/null @@ -1 +0,0 @@ -{{! if needed users can add this file to their templates folder to append to the csproj }} \ No newline at end of file diff --git a/templates-v7/csharp/netcore_testproject.mustache b/templates-v7/csharp/netcore_testproject.mustache deleted file mode 100644 index 4834e3923..000000000 --- a/templates-v7/csharp/netcore_testproject.mustache +++ /dev/null @@ -1,20 +0,0 @@ - - - - {{testPackageName}} - {{testPackageName}} - {{testTargetFramework}} - false{{#nrt}} - {{#useGenericHost}}enable{{/useGenericHost}}{{^useGenericHost}}annotations{{/useGenericHost}}{{/nrt}} - - - - - - - - - - - -{{>netcore_testproject.additions}} diff --git a/templates-v7/csharp/nuspec.mustache b/templates-v7/csharp/nuspec.mustache deleted file mode 100644 index 680ee2fe4..000000000 --- a/templates-v7/csharp/nuspec.mustache +++ /dev/null @@ -1,57 +0,0 @@ - - - - - $id$ - {{packageTitle}} - - - $version$ - - - $author$ - - - $author$ - false - false - - - {{packageDescription}} - {{#termsOfService}} - {{.}} - {{/termsOfService}} - {{#licenseUrl}} - {{.}} - {{/licenseUrl}} - - - - - - {{#useRestSharp}} - - {{/useRestSharp}} - {{#useCompareNetObjects}} - - {{/useCompareNetObjects}} - - {{#validatable}} - - {{/validatable}} - {{#supportsRetry}} - - {{/supportsRetry}} - - - - - - - - - - - From c3c319dbbeab54701d360d5ad69aebd7b94d6391 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 24 Sep 2025 16:42:33 +0200 Subject: [PATCH 014/126] remove template --- templates-v7/csharp/api_test.mustache | 77 --------------------------- 1 file changed, 77 deletions(-) delete mode 100644 templates-v7/csharp/api_test.mustache diff --git a/templates-v7/csharp/api_test.mustache b/templates-v7/csharp/api_test.mustache deleted file mode 100644 index 78319978a..000000000 --- a/templates-v7/csharp/api_test.mustache +++ /dev/null @@ -1,77 +0,0 @@ -{{>partial_header}} -using System; -using System.IO; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reflection; -{{#useRestSharp}} -using RestSharp; -{{/useRestSharp}} -using Xunit; - -using {{packageName}}.Client; -using {{packageName}}.{{apiPackage}}; -{{#hasImport}} -// uncomment below to import models -//using {{packageName}}.{{modelPackage}}; -{{/hasImport}} - -namespace {{packageName}}.Test.Api -{ - /// - /// Class for testing {{classname}} - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the API endpoint. - /// - public class {{classname}}Tests : IDisposable - { - {{^nonPublicApi}} - private {{classname}} instance; - - {{/nonPublicApi}} - public {{classname}}Tests() - { - {{^nonPublicApi}} - instance = new {{classname}}(); - {{/nonPublicApi}} - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of {{classname}} - /// - [Fact] - public void {{operationId}}InstanceTest() - { - // TODO uncomment below to test 'IsType' {{classname}} - //Assert.IsType<{{classname}}>(instance); - } - {{#operations}} - {{#operation}} - - /// - /// Test {{operationId}} - /// - [Fact] - public void {{operationId}}Test() - { - // TODO uncomment below to test the method and replace null with proper value - {{#allParams}} - //{{{dataType}}} {{paramName}} = null; - {{/allParams}} - //{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - {{#returnType}} - //Assert.IsType<{{{.}}}>(response); - {{/returnType}} - } - {{/operation}} - {{/operations}} - } -} From 6b017a1e58470ded7586f9cf45dcdd5bb3663857 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 25 Sep 2025 16:39:11 +0200 Subject: [PATCH 015/126] Alter templates from other branch --- ...sponse`1.mustache => ApiResponse.mustache} | 0 ...mustache => ApiResponseEventArgs.mustache} | 0 .../generichost/README.test.mustache | 0 ...`1.mustache => RateLimitProvider.mustache} | 0 ...ner`1.mustache => TokenContainer.mustache} | 0 ...ider`1.mustache => TokenProvider.mustache} | 0 .../generichost/git_push.ps1.mustache | 75 ------------------- .../generichost/git_push.sh.mustache | 49 ------------ .../generichost/testInstructions.mustache | 18 ----- .../csharp/AbstractOpenAPISchema.mustache | 0 .../csharp/api-single.mustache | 0 .../csharp/api.mustache | 0 .../csharp/api_invoke.mustache | 0 .../csharp/api_parameter_ordering.mustache | 0 .../api_parameter_ordering_required.mustache | 0 .../csharp/api_parameters.mustache | 0 .../csharp/api_parameters_async.mustache | 0 .../csharp/auth/OAuthAuthenticator.mustache | 0 .../csharp/auth/OAuthFlow.mustache | 0 .../csharp/auth/TokenResponse.mustache | 0 .../csharp/config.yaml | 0 .../csharp/method_documentation.mustache | 0 .../csharp/model.mustache | 0 .../csharp/modelAnyOf.mustache | 0 .../csharp/modelEnum.mustache | 0 .../csharp/modelGeneric.mustache | 0 .../csharp/modelInnerEnum.mustache | 0 .../csharp/modelOneOf.mustache | 0 .../csharp/model_doc.mustache | 0 .../csharp/partial_header.mustache | 0 .../csharp/AbstractOpenAPISchema.mustache | 0 .../csharp/api-single.mustache | 0 .../csharp/api.mustache | 0 .../csharp/api_invoke.mustache | 0 .../csharp/api_parameter_ordering.mustache | 0 .../api_parameter_ordering_required.mustache | 0 .../csharp/api_parameters.mustache | 0 .../csharp/api_parameters_async.mustache | 0 {templates => z_templates}/csharp/config.yaml | 0 .../csharp/method_documentation.mustache | 0 .../csharp/model.mustache | 0 .../csharp/modelGeneric.mustache | 0 .../csharp/modelOneOf.mustache | 0 .../csharp/partial_header.mustache | 0 44 files changed, 142 deletions(-) rename templates-v7/csharp/libraries/generichost/{ApiResponse`1.mustache => ApiResponse.mustache} (100%) rename templates-v7/csharp/libraries/generichost/{ApiResponseEventArgs`1.mustache => ApiResponseEventArgs.mustache} (100%) delete mode 100644 templates-v7/csharp/libraries/generichost/README.test.mustache rename templates-v7/csharp/libraries/generichost/{RateLimitProvider`1.mustache => RateLimitProvider.mustache} (100%) rename templates-v7/csharp/libraries/generichost/{TokenContainer`1.mustache => TokenContainer.mustache} (100%) rename templates-v7/csharp/libraries/generichost/{TokenProvider`1.mustache => TokenProvider.mustache} (100%) delete mode 100644 templates-v7/csharp/libraries/generichost/git_push.ps1.mustache delete mode 100644 templates-v7/csharp/libraries/generichost/git_push.sh.mustache delete mode 100644 templates-v7/csharp/libraries/generichost/testInstructions.mustache rename {templates-mod => z_templates-mod}/csharp/AbstractOpenAPISchema.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/api-single.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/api.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/api_invoke.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/api_parameter_ordering.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/api_parameter_ordering_required.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/api_parameters.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/api_parameters_async.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/auth/OAuthAuthenticator.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/auth/OAuthFlow.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/auth/TokenResponse.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/config.yaml (100%) rename {templates-mod => z_templates-mod}/csharp/method_documentation.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/model.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/modelAnyOf.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/modelEnum.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/modelGeneric.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/modelInnerEnum.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/modelOneOf.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/model_doc.mustache (100%) rename {templates-mod => z_templates-mod}/csharp/partial_header.mustache (100%) rename {templates => z_templates}/csharp/AbstractOpenAPISchema.mustache (100%) rename {templates => z_templates}/csharp/api-single.mustache (100%) rename {templates => z_templates}/csharp/api.mustache (100%) rename {templates => z_templates}/csharp/api_invoke.mustache (100%) rename {templates => z_templates}/csharp/api_parameter_ordering.mustache (100%) rename {templates => z_templates}/csharp/api_parameter_ordering_required.mustache (100%) rename {templates => z_templates}/csharp/api_parameters.mustache (100%) rename {templates => z_templates}/csharp/api_parameters_async.mustache (100%) rename {templates => z_templates}/csharp/config.yaml (100%) rename {templates => z_templates}/csharp/method_documentation.mustache (100%) rename {templates => z_templates}/csharp/model.mustache (100%) rename {templates => z_templates}/csharp/modelGeneric.mustache (100%) rename {templates => z_templates}/csharp/modelOneOf.mustache (100%) rename {templates => z_templates}/csharp/partial_header.mustache (100%) diff --git a/templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache b/templates-v7/csharp/libraries/generichost/ApiResponse.mustache similarity index 100% rename from templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache rename to templates-v7/csharp/libraries/generichost/ApiResponse.mustache diff --git a/templates-v7/csharp/libraries/generichost/ApiResponseEventArgs`1.mustache b/templates-v7/csharp/libraries/generichost/ApiResponseEventArgs.mustache similarity index 100% rename from templates-v7/csharp/libraries/generichost/ApiResponseEventArgs`1.mustache rename to templates-v7/csharp/libraries/generichost/ApiResponseEventArgs.mustache diff --git a/templates-v7/csharp/libraries/generichost/README.test.mustache b/templates-v7/csharp/libraries/generichost/README.test.mustache deleted file mode 100644 index e69de29bb..000000000 diff --git a/templates-v7/csharp/libraries/generichost/RateLimitProvider`1.mustache b/templates-v7/csharp/libraries/generichost/RateLimitProvider.mustache similarity index 100% rename from templates-v7/csharp/libraries/generichost/RateLimitProvider`1.mustache rename to templates-v7/csharp/libraries/generichost/RateLimitProvider.mustache diff --git a/templates-v7/csharp/libraries/generichost/TokenContainer`1.mustache b/templates-v7/csharp/libraries/generichost/TokenContainer.mustache similarity index 100% rename from templates-v7/csharp/libraries/generichost/TokenContainer`1.mustache rename to templates-v7/csharp/libraries/generichost/TokenContainer.mustache diff --git a/templates-v7/csharp/libraries/generichost/TokenProvider`1.mustache b/templates-v7/csharp/libraries/generichost/TokenProvider.mustache similarity index 100% rename from templates-v7/csharp/libraries/generichost/TokenProvider`1.mustache rename to templates-v7/csharp/libraries/generichost/TokenProvider.mustache diff --git a/templates-v7/csharp/libraries/generichost/git_push.ps1.mustache b/templates-v7/csharp/libraries/generichost/git_push.ps1.mustache deleted file mode 100644 index f263c2bc5..000000000 --- a/templates-v7/csharp/libraries/generichost/git_push.ps1.mustache +++ /dev/null @@ -1,75 +0,0 @@ -param( - [Parameter()][Alias("g")][String]$GitHost = "{{{gitHost}}}", - [Parameter()][Alias("u")][String]$GitUserId = "{{{gitUserId}}}", - [Parameter()][Alias("r")][String]$GitRepoId = "{{{gitRepoId}}}", - [Parameter()][Alias("m")][string]$Message = "{{{releaseNote}}}", - [Parameter()][Alias("h")][switch]$Help -) - -function Publish-ToGitHost{ - if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ - # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user - $Message = Read-Host -Prompt "Please provide a commit message or press enter" - $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } - } - - git init - git add . - git commit -am "${Message}" - $branchName=$(git rev-parse --abbrev-ref HEAD) - $gitRemote=$(git remote) - - if([string]::IsNullOrWhiteSpace($gitRemote)){ - git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git - } - - Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" - git pull origin $branchName --ff-only - - if ($LastExitCode -ne 0){ - if (${GitHost} -eq "github.com"){ - Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." - gh auth login --hostname github.com --web - gh repo create $GitRepoId --private - # sleep 2 seconds to ensure git finishes creation of the repo - Start-Sleep -Seconds 2 - } - else{ - throw "There was an issue pulling the origin branch. The remote repository may not exist yet." - } - } - - Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" - git push origin $branchName -} - -$ErrorActionPreference = "Stop" -Set-StrictMode -Version 3.0 - -if ($Help){ - Write-Output " - This script will initialize a git repository, then add and commit all files. - The local repository will then be pushed to your preferred git provider. - If the remote repository does not exist yet and you are using GitHub, - the repository will be created for you provided you have the GitHub CLI installed. - - Parameters: - -g | -GitHost -> ex: github.com - -m | -Message -> the git commit message - -r | -GitRepoId -> the name of the repository - -u | -GitUserId -> your user id - " - - return -} - -$rootPath=Resolve-Path -Path $PSScriptRoot/../.. - -Push-Location $rootPath - -try { - Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message -} -finally{ - Pop-Location -} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/git_push.sh.mustache b/templates-v7/csharp/libraries/generichost/git_push.sh.mustache deleted file mode 100644 index 3d4b710dc..000000000 --- a/templates-v7/csharp/libraries/generichost/git_push.sh.mustache +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=${1:-{{{gitUserId}}}} -git_repo_id=${2:-{{{gitRepoId}}}} -release_note=${3:-{{{releaseNote}}}} -git_host=${4:-{{{gitHost}}}} - -starting_directory=$(pwd) -script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" -cd $script_root -cd ../.. - -if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then - # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user - echo "Please provide a commit message or press enter" - read user_input - release_note=$user_input - if [ "$release_note" = "" ]; then - release_note="no message provided" - fi -fi - -git init -git add . -git commit -am "$release_note" -branch_name=$(git rev-parse --abbrev-ref HEAD) -git_remote=$(git remote) - -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" -git pull origin $branch_name --ff-only - -echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin $branch_name - -cd $starting_directory diff --git a/templates-v7/csharp/libraries/generichost/testInstructions.mustache b/templates-v7/csharp/libraries/generichost/testInstructions.mustache deleted file mode 100644 index 7bf738e20..000000000 --- a/templates-v7/csharp/libraries/generichost/testInstructions.mustache +++ /dev/null @@ -1,18 +0,0 @@ -/* ********************************************************************************* -* Follow these manual steps to construct tests. -* This file will not be overwritten. -* ********************************************************************************* -* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. -* Take care not to commit credentials to any repository. -* -* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. -* To mock the client, use the generic AddApiHttpClients. -* To mock the server, change the client's BaseAddress. -* -* 3. Locate the test you want below -* - remove the skip property from the Fact attribute -* - set the value of any variables if necessary -* -* 4. Run the tests and ensure they work. -* -*/ \ No newline at end of file diff --git a/templates-mod/csharp/AbstractOpenAPISchema.mustache b/z_templates-mod/csharp/AbstractOpenAPISchema.mustache similarity index 100% rename from templates-mod/csharp/AbstractOpenAPISchema.mustache rename to z_templates-mod/csharp/AbstractOpenAPISchema.mustache diff --git a/templates-mod/csharp/api-single.mustache b/z_templates-mod/csharp/api-single.mustache similarity index 100% rename from templates-mod/csharp/api-single.mustache rename to z_templates-mod/csharp/api-single.mustache diff --git a/templates-mod/csharp/api.mustache b/z_templates-mod/csharp/api.mustache similarity index 100% rename from templates-mod/csharp/api.mustache rename to z_templates-mod/csharp/api.mustache diff --git a/templates-mod/csharp/api_invoke.mustache b/z_templates-mod/csharp/api_invoke.mustache similarity index 100% rename from templates-mod/csharp/api_invoke.mustache rename to z_templates-mod/csharp/api_invoke.mustache diff --git a/templates-mod/csharp/api_parameter_ordering.mustache b/z_templates-mod/csharp/api_parameter_ordering.mustache similarity index 100% rename from templates-mod/csharp/api_parameter_ordering.mustache rename to z_templates-mod/csharp/api_parameter_ordering.mustache diff --git a/templates-mod/csharp/api_parameter_ordering_required.mustache b/z_templates-mod/csharp/api_parameter_ordering_required.mustache similarity index 100% rename from templates-mod/csharp/api_parameter_ordering_required.mustache rename to z_templates-mod/csharp/api_parameter_ordering_required.mustache diff --git a/templates-mod/csharp/api_parameters.mustache b/z_templates-mod/csharp/api_parameters.mustache similarity index 100% rename from templates-mod/csharp/api_parameters.mustache rename to z_templates-mod/csharp/api_parameters.mustache diff --git a/templates-mod/csharp/api_parameters_async.mustache b/z_templates-mod/csharp/api_parameters_async.mustache similarity index 100% rename from templates-mod/csharp/api_parameters_async.mustache rename to z_templates-mod/csharp/api_parameters_async.mustache diff --git a/templates-mod/csharp/auth/OAuthAuthenticator.mustache b/z_templates-mod/csharp/auth/OAuthAuthenticator.mustache similarity index 100% rename from templates-mod/csharp/auth/OAuthAuthenticator.mustache rename to z_templates-mod/csharp/auth/OAuthAuthenticator.mustache diff --git a/templates-mod/csharp/auth/OAuthFlow.mustache b/z_templates-mod/csharp/auth/OAuthFlow.mustache similarity index 100% rename from templates-mod/csharp/auth/OAuthFlow.mustache rename to z_templates-mod/csharp/auth/OAuthFlow.mustache diff --git a/templates-mod/csharp/auth/TokenResponse.mustache b/z_templates-mod/csharp/auth/TokenResponse.mustache similarity index 100% rename from templates-mod/csharp/auth/TokenResponse.mustache rename to z_templates-mod/csharp/auth/TokenResponse.mustache diff --git a/templates-mod/csharp/config.yaml b/z_templates-mod/csharp/config.yaml similarity index 100% rename from templates-mod/csharp/config.yaml rename to z_templates-mod/csharp/config.yaml diff --git a/templates-mod/csharp/method_documentation.mustache b/z_templates-mod/csharp/method_documentation.mustache similarity index 100% rename from templates-mod/csharp/method_documentation.mustache rename to z_templates-mod/csharp/method_documentation.mustache diff --git a/templates-mod/csharp/model.mustache b/z_templates-mod/csharp/model.mustache similarity index 100% rename from templates-mod/csharp/model.mustache rename to z_templates-mod/csharp/model.mustache diff --git a/templates-mod/csharp/modelAnyOf.mustache b/z_templates-mod/csharp/modelAnyOf.mustache similarity index 100% rename from templates-mod/csharp/modelAnyOf.mustache rename to z_templates-mod/csharp/modelAnyOf.mustache diff --git a/templates-mod/csharp/modelEnum.mustache b/z_templates-mod/csharp/modelEnum.mustache similarity index 100% rename from templates-mod/csharp/modelEnum.mustache rename to z_templates-mod/csharp/modelEnum.mustache diff --git a/templates-mod/csharp/modelGeneric.mustache b/z_templates-mod/csharp/modelGeneric.mustache similarity index 100% rename from templates-mod/csharp/modelGeneric.mustache rename to z_templates-mod/csharp/modelGeneric.mustache diff --git a/templates-mod/csharp/modelInnerEnum.mustache b/z_templates-mod/csharp/modelInnerEnum.mustache similarity index 100% rename from templates-mod/csharp/modelInnerEnum.mustache rename to z_templates-mod/csharp/modelInnerEnum.mustache diff --git a/templates-mod/csharp/modelOneOf.mustache b/z_templates-mod/csharp/modelOneOf.mustache similarity index 100% rename from templates-mod/csharp/modelOneOf.mustache rename to z_templates-mod/csharp/modelOneOf.mustache diff --git a/templates-mod/csharp/model_doc.mustache b/z_templates-mod/csharp/model_doc.mustache similarity index 100% rename from templates-mod/csharp/model_doc.mustache rename to z_templates-mod/csharp/model_doc.mustache diff --git a/templates-mod/csharp/partial_header.mustache b/z_templates-mod/csharp/partial_header.mustache similarity index 100% rename from templates-mod/csharp/partial_header.mustache rename to z_templates-mod/csharp/partial_header.mustache diff --git a/templates/csharp/AbstractOpenAPISchema.mustache b/z_templates/csharp/AbstractOpenAPISchema.mustache similarity index 100% rename from templates/csharp/AbstractOpenAPISchema.mustache rename to z_templates/csharp/AbstractOpenAPISchema.mustache diff --git a/templates/csharp/api-single.mustache b/z_templates/csharp/api-single.mustache similarity index 100% rename from templates/csharp/api-single.mustache rename to z_templates/csharp/api-single.mustache diff --git a/templates/csharp/api.mustache b/z_templates/csharp/api.mustache similarity index 100% rename from templates/csharp/api.mustache rename to z_templates/csharp/api.mustache diff --git a/templates/csharp/api_invoke.mustache b/z_templates/csharp/api_invoke.mustache similarity index 100% rename from templates/csharp/api_invoke.mustache rename to z_templates/csharp/api_invoke.mustache diff --git a/templates/csharp/api_parameter_ordering.mustache b/z_templates/csharp/api_parameter_ordering.mustache similarity index 100% rename from templates/csharp/api_parameter_ordering.mustache rename to z_templates/csharp/api_parameter_ordering.mustache diff --git a/templates/csharp/api_parameter_ordering_required.mustache b/z_templates/csharp/api_parameter_ordering_required.mustache similarity index 100% rename from templates/csharp/api_parameter_ordering_required.mustache rename to z_templates/csharp/api_parameter_ordering_required.mustache diff --git a/templates/csharp/api_parameters.mustache b/z_templates/csharp/api_parameters.mustache similarity index 100% rename from templates/csharp/api_parameters.mustache rename to z_templates/csharp/api_parameters.mustache diff --git a/templates/csharp/api_parameters_async.mustache b/z_templates/csharp/api_parameters_async.mustache similarity index 100% rename from templates/csharp/api_parameters_async.mustache rename to z_templates/csharp/api_parameters_async.mustache diff --git a/templates/csharp/config.yaml b/z_templates/csharp/config.yaml similarity index 100% rename from templates/csharp/config.yaml rename to z_templates/csharp/config.yaml diff --git a/templates/csharp/method_documentation.mustache b/z_templates/csharp/method_documentation.mustache similarity index 100% rename from templates/csharp/method_documentation.mustache rename to z_templates/csharp/method_documentation.mustache diff --git a/templates/csharp/model.mustache b/z_templates/csharp/model.mustache similarity index 100% rename from templates/csharp/model.mustache rename to z_templates/csharp/model.mustache diff --git a/templates/csharp/modelGeneric.mustache b/z_templates/csharp/modelGeneric.mustache similarity index 100% rename from templates/csharp/modelGeneric.mustache rename to z_templates/csharp/modelGeneric.mustache diff --git a/templates/csharp/modelOneOf.mustache b/z_templates/csharp/modelOneOf.mustache similarity index 100% rename from templates/csharp/modelOneOf.mustache rename to z_templates/csharp/modelOneOf.mustache diff --git a/templates/csharp/partial_header.mustache b/z_templates/csharp/partial_header.mustache similarity index 100% rename from templates/csharp/partial_header.mustache rename to z_templates/csharp/partial_header.mustache From 01cc9cd4118a6bb16e93bcda51ddaa9aeb025a81 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 25 Sep 2025 16:57:24 +0200 Subject: [PATCH 016/126] Added client files --- .../Adyen.IntegrationTest.csproj | 2 +- Adyen.Test/Adyen.Test.csproj | 2 +- Adyen/Adyen.csproj | 2 +- Adyen/Client/ApiClient.cs | 787 ------------------ Adyen/Client/ApiException.cs | 52 +- Adyen/Client/ApiFactory.cs | 49 ++ Adyen/Client/ApiKeyToken.cs | 52 ++ Adyen/Client/ApiResponse.cs | 308 +++++-- Adyen/Client/ApiResponseEventArgs.cs | 24 + Adyen/Client/BasicToken.cs | 42 + Adyen/Client/ClientUtils.cs | 655 +++++++++++++-- Adyen/Client/Configuration.cs | 607 -------------- Adyen/Client/CookieContainer.cs | 18 + ...eConverter.cs => DateOnlyJsonConverter.cs} | 46 +- ...on.cs => DateOnlyNullableJsonConverter.cs} | 77 +- ...estOptions.cs => DateTimeJsonConverter.cs} | 89 +- ...er.cs => DateTimeNullableJsonConverter.cs} | 100 +-- Adyen/Client/ExceptionEventArgs.cs | 24 + Adyen/Client/ExceptionFactory.cs | 22 - Adyen/Client/HostConfiguration.cs | 368 ++++++++ Adyen/Client/IApi.cs | 13 + Adyen/Client/IAsynchronousClient.cs | 100 --- Adyen/Client/IReadableConfiguration.cs | 141 ---- Adyen/Client/ISynchronousClient.cs | 93 --- Adyen/Client/JsonSerializerOptionsProvider.cs | 25 + Adyen/Client/Multimap.cs | 295 ------- .../{RetryConfiguration.cs => Option.cs} | 40 +- ...estPathBuilder.cs => RateLimitProvider.cs} | 75 +- Adyen/Client/TokenBase.cs | 69 ++ Adyen/Client/TokenContainer.cs | 35 + .../{IApiAccessor.cs => TokenProvider.cs} | 35 +- .../libraries/generichost/IApi.mustache | 2 +- .../csharp/libraries/generichost/api.mustache | 4 +- 33 files changed, 1817 insertions(+), 2436 deletions(-) delete mode 100644 Adyen/Client/ApiClient.cs create mode 100644 Adyen/Client/ApiFactory.cs create mode 100644 Adyen/Client/ApiKeyToken.cs create mode 100644 Adyen/Client/ApiResponseEventArgs.cs create mode 100644 Adyen/Client/BasicToken.cs delete mode 100644 Adyen/Client/Configuration.cs create mode 100644 Adyen/Client/CookieContainer.cs rename Adyen/Client/{OpenAPIDateConverter.cs => DateOnlyJsonConverter.cs} (69%) rename Adyen/Client/{GlobalConfiguration.cs => DateOnlyNullableJsonConverter.cs} (64%) rename Adyen/Client/{RequestOptions.cs => DateTimeJsonConverter.cs} (60%) rename Adyen/Client/{FileParameter.cs => DateTimeNullableJsonConverter.cs} (59%) create mode 100644 Adyen/Client/ExceptionEventArgs.cs delete mode 100644 Adyen/Client/ExceptionFactory.cs create mode 100644 Adyen/Client/HostConfiguration.cs create mode 100644 Adyen/Client/IApi.cs delete mode 100644 Adyen/Client/IAsynchronousClient.cs delete mode 100644 Adyen/Client/IReadableConfiguration.cs delete mode 100644 Adyen/Client/ISynchronousClient.cs create mode 100644 Adyen/Client/JsonSerializerOptionsProvider.cs delete mode 100644 Adyen/Client/Multimap.cs rename Adyen/Client/{RetryConfiguration.cs => Option.cs} (77%) rename Adyen/Client/{WebRequestPathBuilder.cs => RateLimitProvider.cs} (53%) create mode 100644 Adyen/Client/TokenBase.cs create mode 100644 Adyen/Client/TokenContainer.cs rename Adyen/Client/{IApiAccessor.cs => TokenProvider.cs} (81%) diff --git a/Adyen.IntegrationTest/Adyen.IntegrationTest.csproj b/Adyen.IntegrationTest/Adyen.IntegrationTest.csproj index 7662e15c7..bc52439c6 100644 --- a/Adyen.IntegrationTest/Adyen.IntegrationTest.csproj +++ b/Adyen.IntegrationTest/Adyen.IntegrationTest.csproj @@ -1,7 +1,7 @@ - net8.0;net6.0 + net8.0 12 enable disable diff --git a/Adyen.Test/Adyen.Test.csproj b/Adyen.Test/Adyen.Test.csproj index ac0cc226d..0f160fee1 100644 --- a/Adyen.Test/Adyen.Test.csproj +++ b/Adyen.Test/Adyen.Test.csproj @@ -1,7 +1,7 @@  - net8.0;net6.0 + net8.0 12 enable disable diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index a3e96c41a..8a5204a4f 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -1,7 +1,7 @@ - net8.0;net6.0 + net8.0 12 enable disable diff --git a/Adyen/Client/ApiClient.cs b/Adyen/Client/ApiClient.cs deleted file mode 100644 index 0fbd519c8..000000000 --- a/Adyen/Client/ApiClient.cs +++ /dev/null @@ -1,787 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Text; -using System.Threading; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; -using System.Net.Http; -using System.Net.Http.Headers; -using Polly; - -namespace Adyen.Client -{ - /// - /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. - /// - internal class CustomJsonCodec - { - private readonly IReadableConfiguration _configuration; - private static readonly string _contentType = "application/json"; - private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - public CustomJsonCodec(IReadableConfiguration configuration) - { - _configuration = configuration; - } - - public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) - { - _serializerSettings = serializerSettings; - _configuration = configuration; - } - - /// - /// Serialize the object into a JSON string. - /// - /// Object to be serialized. - /// A JSON string. - public string Serialize(object obj) - { - if (obj != null && obj is Adyen.Model.Checkout.AbstractOpenAPISchema) - { - // the object to be serialized is an oneOf/anyOf schema - return ((Adyen.Model.Checkout.AbstractOpenAPISchema)obj).ToJson(); - } - else - { - return JsonConvert.SerializeObject(obj, _serializerSettings); - } - } - - public async Task Deserialize(HttpResponseMessage response) - { - var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); - return result; - } - - /// - /// Deserialize the JSON string into a proper object. - /// - /// The HTTP response. - /// Object type. - /// Object representation of the JSON string. - internal async Task Deserialize(HttpResponseMessage response, Type type) - { - IList headers = new List(); - // process response headers, e.g. Access-Control-Allow-Methods - foreach (var responseHeader in response.Headers) - { - headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); - } - - // process response content headers, e.g. Content-Type - foreach (var responseHeader in response.Content.Headers) - { - headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); - } - - // RFC 2183 & RFC 2616 - var fileNameRegex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$", RegexOptions.IgnoreCase); - if (type == typeof(byte[])) // return byte array - { - return await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); - } - else if (type == typeof(FileParameter)) - { - if (headers != null) { - foreach (var header in headers) - { - var match = fileNameRegex.Match(header.ToString()); - if (match.Success) - { - string fileName = ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - return new FileParameter(fileName, await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); - } - } - } - return new FileParameter(await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); - } - - // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) - if (type == typeof(Stream)) - { - var bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); - if (headers != null) - { - var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() - : _configuration.TempFolderPath; - - foreach (var header in headers) - { - var match = fileNameRegex.Match(header.ToString()); - if (match.Success) - { - string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); - return new FileStream(fileName, FileMode.Open); - } - } - } - var stream = new MemoryStream(bytes); - return stream; - } - - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object - { - return DateTime.Parse(await response.Content.ReadAsStringAsync().ConfigureAwait(false), null, System.Globalization.DateTimeStyles.RoundtripKind); - } - - if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type - { - return Convert.ChangeType(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type, _serializerSettings); - } - catch (Exception e) - { - throw new ApiException(500, e.Message); - } - } - - public string RootElement { get; set; } - public string Namespace { get; set; } - public string DateFormat { get; set; } - - public string ContentType - { - get { return _contentType; } - set { throw new InvalidOperationException("Not allowed to set content type."); } - } - } - /// - /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), - /// encapsulating general REST accessor use cases. - /// - /// - /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. - /// - public partial class ApiClient : IDisposable, ISynchronousClient, IAsynchronousClient - { - private readonly string _baseUrl; - - private readonly HttpClientHandler _httpClientHandler; - private readonly System.Net.Http.HttpClient _httpClient; - private readonly bool _disposeClient; - - /// - /// Specifies the settings on a object. - /// These settings can be adjusted to accommodate custom serialization rules. - /// - public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Initializes a new instance of the , defaulting to the global configurations' base url. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - public ApiClient() : - this(Adyen.Client.GlobalConfiguration.Instance.BasePath) - { - } - - /// - /// Initializes a new instance of the . - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// The target service's base path in URL format. - /// - public ApiClient(string basePath) - { - if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); - - _httpClientHandler = new HttpClientHandler(); - _httpClient = new HttpClient(_httpClientHandler, true); - _disposeClient = true; - _baseUrl = basePath; - } - - /// - /// Initializes a new instance of the , defaulting to the global configurations' base url. - /// - /// An instance of HttpClient. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public ApiClient(HttpClient client, HttpClientHandler handler = null) : - this(client, Adyen.Client.GlobalConfiguration.Instance.BasePath, handler) - { - } - - /// - /// Initializes a new instance of the . - /// - /// An instance of HttpClient. - /// The target service's base path in URL format. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public ApiClient(HttpClient client, string basePath, HttpClientHandler handler = null) - { - if (client == null) throw new ArgumentNullException("client cannot be null"); - if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); - - _httpClientHandler = handler; - _httpClient = client; - _baseUrl = basePath; - } - - /// - /// Disposes resources if they were created by us - /// - public void Dispose() - { - if(_disposeClient) { - _httpClient.Dispose(); - } - } - - /// Prepares multipart/form-data content - HttpContent PrepareMultipartFormDataContent(RequestOptions options) - { - string boundary = "---------" + Guid.NewGuid().ToString().ToUpperInvariant(); - var multipartContent = new MultipartFormDataContent(boundary); - foreach (var formParameter in options.FormParameters) - { - multipartContent.Add(new StringContent(formParameter.Value), formParameter.Key); - } - - if (options.FileParameters != null && options.FileParameters.Count > 0) - { - foreach (var fileParam in options.FileParameters) - { - foreach (var file in fileParam.Value) - { - var content = new StreamContent(file.Content); - content.Headers.ContentType = new MediaTypeHeaderValue(file.ContentType); - multipartContent.Add(content, fileParam.Key, file.Name); - } - } - } - return multipartContent; - } - - /// - /// Provides all logic for constructing a new HttpRequestMessage. - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the a HttpRequestMessage. - /// - /// The http verb. - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// [private] A new HttpRequestMessage instance. - /// - private HttpRequestMessage NewRequest( - HttpMethod method, - string path, - RequestOptions options, - IReadableConfiguration configuration) - { - if (path == null) throw new ArgumentNullException("path"); - if (options == null) throw new ArgumentNullException("options"); - if (configuration == null) throw new ArgumentNullException("configuration"); - - WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); - - builder.AddPathParameters(options.PathParameters); - - builder.AddQueryParameters(options.QueryParameters); - - HttpRequestMessage request = new HttpRequestMessage(method, builder.GetFullUri()); - - if (configuration.UserAgent != null) - { - request.Headers.TryAddWithoutValidation("User-Agent", configuration.UserAgent); - } - - if (configuration.DefaultHeaders != null) - { - foreach (var headerParam in configuration.DefaultHeaders) - { - request.Headers.Add(headerParam.Key, headerParam.Value); - } - } - - if (options.HeaderParameters != null) - { - foreach (var headerParam in options.HeaderParameters) - { - foreach (var value in headerParam.Value) - { - // Todo make content headers actually content headers - request.Headers.TryAddWithoutValidation(headerParam.Key, value); - } - } - } - - List> contentList = new List>(); - - string contentType = null; - if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) - { - var contentTypes = options.HeaderParameters["Content-Type"]; - contentType = contentTypes.FirstOrDefault(); - } - - if (contentType == "multipart/form-data") - { - request.Content = PrepareMultipartFormDataContent(options); - } - else if (contentType == "application/x-www-form-urlencoded") - { - request.Content = new FormUrlEncodedContent(options.FormParameters); - } - else - { - if (options.Data != null) - { - if (options.Data is FileParameter fp) - { - contentType = contentType ?? "application/octet-stream"; - - var streamContent = new StreamContent(fp.Content); - streamContent.Headers.ContentType = new MediaTypeHeaderValue(contentType); - request.Content = streamContent; - } - else - { - var serializer = new CustomJsonCodec(SerializerSettings, configuration); - request.Content = new StringContent(serializer.Serialize(options.Data), new UTF8Encoding(), - "application/json"); - } - } - } - - - - // TODO provide an alternative that allows cookies per request instead of per API client - if (options.Cookies != null && options.Cookies.Count > 0) - { - request.Properties["CookieContainer"] = options.Cookies; - } - - return request; - } - - partial void InterceptRequest(HttpRequestMessage req); - partial void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response); - - private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) - { - T result = (T) responseData; - string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - - var transformed = new ApiResponse(response.StatusCode, new Multimap(StringComparer.OrdinalIgnoreCase), result, rawContent) - { - ErrorText = response.ReasonPhrase, - Cookies = new List() - }; - - // process response headers, e.g. Access-Control-Allow-Methods - if (response.Headers != null) - { - foreach (var responseHeader in response.Headers) - { - transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - // process response content headers, e.g. Content-Type - if (response.Content.Headers != null) - { - foreach (var responseHeader in response.Content.Headers) - { - transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - if (_httpClientHandler != null && response != null) - { - try { - foreach (Cookie cookie in _httpClientHandler.CookieContainer.GetCookies(uri)) - { - transformed.Cookies.Add(cookie); - } - } - catch (PlatformNotSupportedException) {} - } - - return transformed; - } - - private ApiResponse Exec(HttpRequestMessage req, IReadableConfiguration configuration) - { - return ExecAsync(req, configuration).GetAwaiter().GetResult(); - } - - private async Task> ExecAsync(HttpRequestMessage req, - IReadableConfiguration configuration, - System.Threading.CancellationToken cancellationToken = default) - { - CancellationTokenSource timeoutTokenSource = null; - CancellationTokenSource finalTokenSource = null; - var deserializer = new CustomJsonCodec(SerializerSettings, configuration); - var finalToken = cancellationToken; - - try - { - if (configuration.Timeout > TimeSpan.Zero) - { - timeoutTokenSource = new CancellationTokenSource(configuration.Timeout); - finalTokenSource = CancellationTokenSource.CreateLinkedTokenSource(finalToken, timeoutTokenSource.Token); - finalToken = finalTokenSource.Token; - } - - if (configuration.Proxy != null) - { - if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `Proxy` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); - _httpClientHandler.Proxy = configuration.Proxy; - } - - if (configuration.ClientCertificates != null) - { - if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); - _httpClientHandler.ClientCertificates.AddRange(configuration.ClientCertificates); - } - - var cookieContainer = req.Properties.ContainsKey("CookieContainer") ? req.Properties["CookieContainer"] as List : null; - - if (cookieContainer != null) - { - if(_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); - foreach (var cookie in cookieContainer) - { - _httpClientHandler.CookieContainer.Add(cookie); - } - } - - InterceptRequest(req); - - HttpResponseMessage response; - if (RetryConfiguration.AsyncRetryPolicy != null) - { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy - .ExecuteAndCaptureAsync(() => _httpClient.SendAsync(req, finalToken)) - .ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? - policyResult.Result : new HttpResponseMessage() - { - ReasonPhrase = policyResult.FinalException.ToString(), - RequestMessage = req - }; - } - else - { - response = await _httpClient.SendAsync(req, finalToken).ConfigureAwait(false); - } - - if (!response.IsSuccessStatusCode) - { - return await ToApiResponse(response, default, req.RequestUri).ConfigureAwait(false); - } - - object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); - - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Adyen.Model.Checkout.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); - } - - InterceptResponse(req, response); - - return await ToApiResponse(response, responseData, req.RequestUri).ConfigureAwait(false); - } - catch (OperationCanceledException original) - { - if (timeoutTokenSource != null && timeoutTokenSource.IsCancellationRequested) - { - throw new TaskCanceledException($"[{req.Method}] {req.RequestUri} was timeout.", - new TimeoutException(original.Message, original)); - } - throw; - } - finally - { - if (timeoutTokenSource != null) - { - timeoutTokenSource.Dispose(); - } - - if (finalTokenSource != null) - { - finalTokenSource.Dispose(); - } - } - } - - #region IAsynchronousClient - /// - /// Make a HTTP GET request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP POST request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP PUT request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP DELETE request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP HEAD request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP OPTION request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP PATCH request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); - } - #endregion IAsynchronousClient - - #region ISynchronousClient - /// - /// Make a HTTP GET request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Get, path, options, config), config); - } - - /// - /// Make a HTTP POST request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Post, path, options, config), config); - } - - /// - /// Make a HTTP PUT request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Put, path, options, config), config); - } - - /// - /// Make a HTTP DELETE request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); - } - - /// - /// Make a HTTP HEAD request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Head, path, options, config), config); - } - - /// - /// Make a HTTP OPTION request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Options, path, options, config), config); - } - - /// - /// Make a HTTP PATCH request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(new HttpMethod("PATCH"), path, options, config), config); - } - #endregion ISynchronousClient - } -} diff --git a/Adyen/Client/ApiException.cs b/Adyen/Client/ApiException.cs index 385a6f1be..39517978e 100644 --- a/Adyen/Client/ApiException.cs +++ b/Adyen/Client/ApiException.cs @@ -1,3 +1,4 @@ +// /* * Adyen Checkout API * @@ -7,7 +8,6 @@ * Generated by: https://github.com/openapitools/openapi-generator.git */ - using System; namespace Adyen.Client @@ -18,51 +18,33 @@ namespace Adyen.Client public class ApiException : Exception { /// - /// Gets or sets the error code (HTTP status code) - /// - /// The error code (HTTP status code). - public int ErrorCode { get; set; } - - /// - /// Gets or sets the error content (body json object) + /// The reason the api request failed /// - /// The error content (Http response body). - public object ErrorContent { get; private set; } + public string ReasonPhrase { get; } /// - /// Gets or sets the HTTP headers + /// The HttpStatusCode /// - /// HTTP headers - public Multimap Headers { get; private set; } + public System.Net.HttpStatusCode StatusCode { get; } /// - /// Initializes a new instance of the class. + /// The raw data returned by the api /// - public ApiException() { } - + public string RawContent { get; } + /// - /// Initializes a new instance of the class. + /// Construct the ApiException from parts of the response /// - /// HTTP status code. - /// Error message. - public ApiException(int errorCode, string message) : base(message) + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) { - this.ErrorCode = errorCode; - } + ReasonPhrase = reasonPhrase; - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error message. - /// Error content. - /// HTTP Headers. - public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) - { - this.ErrorCode = errorCode; - this.ErrorContent = errorContent; - this.Headers = headers; + StatusCode = statusCode; + + RawContent = rawContent; } } - } diff --git a/Adyen/Client/ApiFactory.cs b/Adyen/Client/ApiFactory.cs new file mode 100644 index 000000000..24e5a92d9 --- /dev/null +++ b/Adyen/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Adyen.Service.Checkout; + +namespace Adyen.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/Adyen/Client/ApiKeyToken.cs b/Adyen/Client/ApiKeyToken.cs new file mode 100644 index 000000000..22707f0f5 --- /dev/null +++ b/Adyen/Client/ApiKeyToken.cs @@ -0,0 +1,52 @@ +// + +using System; + +namespace Adyen.Client +{ + /// + /// A token constructed from an apiKey. + /// + public class ApiKeyToken : TokenBase + { + private string _raw; + + /// + /// The header that this token will be used with. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs an ApiKeyToken object. + /// + /// + /// + /// + /// + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + { + Header = header; + _raw = $"{ prefix }{ value }"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); + } + + /// + /// Places the token in the query. + /// + /// + /// + /// + public virtual void UseInQuery(global::System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) + { + parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(); + } + } +} \ No newline at end of file diff --git a/Adyen/Client/ApiResponse.cs b/Adyen/Client/ApiResponse.cs index 3c0668fbc..9823ea21d 100644 --- a/Adyen/Client/ApiResponse.cs +++ b/Adyen/Client/ApiResponse.cs @@ -1,3 +1,4 @@ +// /* * Adyen Checkout API * @@ -7,9 +8,8 @@ * Generated by: https://github.com/openapitools/openapi-generator.git */ - using System; -using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Net; namespace Adyen.Client @@ -17,150 +17,308 @@ namespace Adyen.Client /// /// Provides a non-generic contract for the ApiResponse wrapper. /// - public interface IApiResponse + public partial interface IApiResponse { /// - /// The data type of + /// The IsSuccessStatusCode from the api response /// - Type ResponseType { get; } + bool IsSuccessStatusCode { get; } /// - /// The content of this response + /// Gets the status code (HTTP status code) /// - Object Content { get; } + /// The status code. + HttpStatusCode StatusCode { get; } /// - /// Gets or sets the status code (HTTP status code) + /// The raw content of this response. /// - /// The status code. - HttpStatusCode StatusCode { get; } + string RawContent { get; } + + /// + /// The raw binary stream (only set for binary responses) + /// + System.IO.Stream ContentStream { get; } /// - /// Gets or sets the HTTP headers + /// The DateTime when the request was retrieved. /// - /// HTTP headers - Multimap Headers { get; } + DateTime DownloadedAt { get; } /// - /// Gets or sets any error text defined by the calling client. + /// The headers contained in the api response /// - string ErrorText { get; set; } + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } /// - /// Gets or sets any cookies passed along on the response. + /// The path used when making the request. /// - List Cookies { get; set; } + string Path { get; } /// - /// The raw content of this response + /// The reason phrase contained in the api response /// - string RawContent { get; } + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } } /// /// API Response /// - public class ApiResponse : IApiResponse + public partial class ApiResponse : IApiResponse { - #region Properties - /// - /// Gets or sets the status code (HTTP status code) + /// Gets the status code (HTTP status code) /// /// The status code. public HttpStatusCode StatusCode { get; } /// - /// Gets or sets the HTTP headers + /// The raw data /// - /// HTTP headers - public Multimap Headers { get; } + public string RawContent { get; protected set; } /// - /// Gets or sets the data (parsed HTTP body) + /// The raw binary stream (only set for binary responses) /// - /// The data. - public T Data { get; } + public System.IO.Stream ContentStream { get; protected set; } /// - /// Gets or sets any error text defined by the calling client. + /// The IsSuccessStatusCode from the api response /// - public string ErrorText { get; set; } + public bool IsSuccessStatusCode { get; } /// - /// Gets or sets any cookies passed along on the response. + /// The reason phrase contained in the api response /// - public List Cookies { get; set; } + public string ReasonPhrase { get; } /// - /// The content of this response + /// The headers contained in the api response /// - public Type ResponseType - { - get { return typeof(T); } - } + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } /// - /// The data type of + /// The DateTime when the request was retrieved. /// - public object Content - { - get { return Data; } - } + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } /// - /// The raw content + /// The path used when making the request. /// - public string RawContent { get; } + public string Path { get; } - #endregion Properties + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } - #region Constructors + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; /// - /// Initializes a new instance of the class. + /// Construct the response using an HttpResponseMessage /// - /// HTTP status code. - /// HTTP headers. - /// Data (parsed HTTP body) - /// Raw content. - public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) + /// + /// + /// + /// + /// + /// + public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) { - StatusCode = statusCode; - Headers = headers; - Data = data; + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); } /// - /// Initializes a new instance of the class. + /// Construct the response using an HttpResponseMessage /// - /// HTTP status code. - /// HTTP headers. - /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + /// + /// + /// + /// + /// + /// + public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + ContentStream = contentStream; + RawContent = string.Empty; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); } + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IBadRequest : IApiResponse + { /// - /// Initializes a new instance of the class. + /// Deserializes the response if the response is BadRequest /// - /// HTTP status code. - /// Data (parsed HTTP body) - /// Raw content. - public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) - { - } + /// + TType BadRequest(); /// - /// Initializes a new instance of the class. + /// Returns true if the response is BadRequest and the deserialized response is not null /// - /// HTTP status code. - /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) - { - } + /// + /// + bool TryBadRequest([NotNullWhen(true)]out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IUnauthorized : IApiResponse + { + /// + /// Deserializes the response if the response is Unauthorized + /// + /// + TType Unauthorized(); + + /// + /// Returns true if the response is Unauthorized and the deserialized response is not null + /// + /// + /// + bool TryUnauthorized([NotNullWhen(true)]out TType result); + } - #endregion Constructors + /// + /// An interface for responses of type + /// + /// + public interface IForbidden : IApiResponse + { + /// + /// Deserializes the response if the response is Forbidden + /// + /// + TType Forbidden(); + + /// + /// Returns true if the response is Forbidden and the deserialized response is not null + /// + /// + /// + bool TryForbidden([NotNullWhen(true)]out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk([NotNullWhen(true)]out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IUnprocessableContent : IApiResponse + { + /// + /// Deserializes the response if the response is UnprocessableContent + /// + /// + TType UnprocessableContent(); + + /// + /// Returns true if the response is UnprocessableContent and the deserialized response is not null + /// + /// + /// + bool TryUnprocessableContent([NotNullWhen(true)]out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IInternalServerError : IApiResponse + { + /// + /// Deserializes the response if the response is InternalServerError + /// + /// + TType InternalServerError(); + + /// + /// Returns true if the response is InternalServerError and the deserialized response is not null + /// + /// + /// + bool TryInternalServerError([NotNullWhen(true)]out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface ICreated : IApiResponse + { + /// + /// Deserializes the response if the response is Created + /// + /// + TType Created(); + + /// + /// Returns true if the response is Created and the deserialized response is not null + /// + /// + /// + bool TryCreated([NotNullWhen(true)]out TType result); } } diff --git a/Adyen/Client/ApiResponseEventArgs.cs b/Adyen/Client/ApiResponseEventArgs.cs new file mode 100644 index 000000000..0bcd267ab --- /dev/null +++ b/Adyen/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Adyen.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/Adyen/Client/BasicToken.cs b/Adyen/Client/BasicToken.cs new file mode 100644 index 000000000..0fe32b3a9 --- /dev/null +++ b/Adyen/Client/BasicToken.cs @@ -0,0 +1,42 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Adyen.Client +{ + /// + /// A token constructed from a username and password. + /// + public class BasicToken : TokenBase + { + private string _username; + + private string _password; + + /// + /// Constructs a BasicToken object. + /// + /// + /// + /// + public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) + { + _username = username; + + _password = password; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Adyen.Client.ClientUtils.Base64Encode(_username + ":" + _password)); + } + } +} \ No newline at end of file diff --git a/Adyen/Client/ClientUtils.cs b/Adyen/Client/ClientUtils.cs index f8fb5b36b..f5c20171e 100644 --- a/Adyen/Client/ClientUtils.cs +++ b/Adyen/Client/ClientUtils.cs @@ -7,75 +7,102 @@ * Generated by: https://github.com/openapitools/openapi-generator.git */ - using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Linq; -using System.Runtime.Serialization; +using System.Collections; +using System.Collections.Generic; using System.Text; +using System.Text.Json; using System.Text.RegularExpressions; +using Adyen.Model.Checkout; +using System.Runtime.CompilerServices; namespace Adyen.Client { /// /// Utility functions providing some benefit to API client consumers. /// - public static class ClientUtils + public static partial class ClientUtils { + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + /// - /// Sanitize filename by removing the path + /// An enum of headers /// - /// Filename - /// Filename - public static string SanitizeFilename(string filename) + public enum ApiKeyHeader { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); - return match.Success ? match.Groups[1].Value : filename; + /// + /// The X-API-Key header + /// + X_API_Key } /// - /// Convert params to key/value pairs. - /// Use collectionFormat to properly format lists and collections. + /// Converte an ApiKeyHeader to a string /// - /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi - /// Key name. - /// Value object. - /// A multimap of keys with 1..n associated values. - public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) + /// + /// + /// + public static string ApiKeyHeaderToString(ApiKeyHeader value) { - var parameters = new Multimap(); + return value switch + { + ApiKeyHeader.X_API_Key => "X-API-Key", + _ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)), + }; + } - if (value is ICollection collection && collectionFormat == "multi") + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out T result) + { + try { - foreach (var item in collection) - { - parameters.Add(name, ParameterToString(item)); - } + result = JsonSerializer.Deserialize(json, options); + return result != null; } - else if (value is IDictionary dictionary) + catch (Exception) { - if(collectionFormat == "deepObject") { - foreach (DictionaryEntry entry in dictionary) - { - parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); - } - } - else { - foreach (DictionaryEntry entry in dictionary) - { - parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); - } - } + result = default; + return false; } - else + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out T result) + { + try { - parameters.Add(name, ParameterToString(value)); + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; } - - return parameters; } /// @@ -84,44 +111,470 @@ public static Multimap ParameterToMultiMap(string collectionForm /// Otherwise just return the string. /// /// The parameter (header, path, query, form). - /// An optional configuration instance, providing formatting options used in processing. + /// The DateTime serialization format. /// Formatted string. - public static string ParameterToString(object obj, IReadableConfiguration configuration = null) + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) { if (obj is DateTime dateTime) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 - return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + return dateTime.ToString(format); if (obj is DateTimeOffset dateTimeOffset) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 - return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + return dateTimeOffset.ToString(format); + if (obj is DateOnly dateOnly) + return dateOnly.ToString(format); if (obj is bool boolean) - return boolean ? "true" : "false"; - if (obj is ICollection collection) { - List entries = new List(); + return boolean + ? "true" + : "false"; + if (obj is AccountInfo.AccountAgeIndicatorEnum accountInfoAccountAgeIndicatorEnum) + return AccountInfo.AccountAgeIndicatorEnumToJsonValue(accountInfoAccountAgeIndicatorEnum); + if (obj is AccountInfo.AccountChangeIndicatorEnum accountInfoAccountChangeIndicatorEnum) + return AccountInfo.AccountChangeIndicatorEnumToJsonValue(accountInfoAccountChangeIndicatorEnum); + if (obj is AccountInfo.AccountTypeEnum accountInfoAccountTypeEnum) + return AccountInfo.AccountTypeEnumToJsonValue(accountInfoAccountTypeEnum); + if (obj is AccountInfo.DeliveryAddressUsageIndicatorEnum accountInfoDeliveryAddressUsageIndicatorEnum) + return AccountInfo.DeliveryAddressUsageIndicatorEnumToJsonValue(accountInfoDeliveryAddressUsageIndicatorEnum); + if (obj is AccountInfo.PasswordChangeIndicatorEnum accountInfoPasswordChangeIndicatorEnum) + return AccountInfo.PasswordChangeIndicatorEnumToJsonValue(accountInfoPasswordChangeIndicatorEnum); + if (obj is AccountInfo.PaymentAccountIndicatorEnum accountInfoPaymentAccountIndicatorEnum) + return AccountInfo.PaymentAccountIndicatorEnumToJsonValue(accountInfoPaymentAccountIndicatorEnum); + if (obj is AcctInfo.ChAccAgeIndEnum acctInfoChAccAgeIndEnum) + return AcctInfo.ChAccAgeIndEnumToJsonValue(acctInfoChAccAgeIndEnum); + if (obj is AcctInfo.ChAccChangeIndEnum acctInfoChAccChangeIndEnum) + return AcctInfo.ChAccChangeIndEnumToJsonValue(acctInfoChAccChangeIndEnum); + if (obj is AcctInfo.ChAccPwChangeIndEnum acctInfoChAccPwChangeIndEnum) + return AcctInfo.ChAccPwChangeIndEnumToJsonValue(acctInfoChAccPwChangeIndEnum); + if (obj is AcctInfo.PaymentAccIndEnum acctInfoPaymentAccIndEnum) + return AcctInfo.PaymentAccIndEnumToJsonValue(acctInfoPaymentAccIndEnum); + if (obj is AcctInfo.ShipAddressUsageIndEnum acctInfoShipAddressUsageIndEnum) + return AcctInfo.ShipAddressUsageIndEnumToJsonValue(acctInfoShipAddressUsageIndEnum); + if (obj is AcctInfo.ShipNameIndicatorEnum acctInfoShipNameIndicatorEnum) + return AcctInfo.ShipNameIndicatorEnumToJsonValue(acctInfoShipNameIndicatorEnum); + if (obj is AcctInfo.SuspiciousAccActivityEnum acctInfoSuspiciousAccActivityEnum) + return AcctInfo.SuspiciousAccActivityEnumToJsonValue(acctInfoSuspiciousAccActivityEnum); + if (obj is AchDetails.AccountHolderTypeEnum achDetailsAccountHolderTypeEnum) + return AchDetails.AccountHolderTypeEnumToJsonValue(achDetailsAccountHolderTypeEnum); + if (obj is AchDetails.BankAccountTypeEnum achDetailsBankAccountTypeEnum) + return AchDetails.BankAccountTypeEnumToJsonValue(achDetailsBankAccountTypeEnum); + if (obj is AchDetails.TypeEnum achDetailsTypeEnum) + return AchDetails.TypeEnumToJsonValue(achDetailsTypeEnum); + if (obj is AdditionalData3DSecure.ChallengeWindowSizeEnum additionalData3DSecureChallengeWindowSizeEnum) + return AdditionalData3DSecure.ChallengeWindowSizeEnumToJsonValue(additionalData3DSecureChallengeWindowSizeEnum); + if (obj is AdditionalDataCommon.IndustryUsageEnum additionalDataCommonIndustryUsageEnum) + return AdditionalDataCommon.IndustryUsageEnumToJsonValue(additionalDataCommonIndustryUsageEnum); + if (obj is AffirmDetails.TypeEnum affirmDetailsTypeEnum) + return AffirmDetails.TypeEnumToJsonValue(affirmDetailsTypeEnum); + if (obj is AfterpayDetails.TypeEnum afterpayDetailsTypeEnum) + return AfterpayDetails.TypeEnumToJsonValue(afterpayDetailsTypeEnum); + if (obj is AmazonPayDetails.TypeEnum amazonPayDetailsTypeEnum) + return AmazonPayDetails.TypeEnumToJsonValue(amazonPayDetailsTypeEnum); + if (obj is AncvDetails.TypeEnum ancvDetailsTypeEnum) + return AncvDetails.TypeEnumToJsonValue(ancvDetailsTypeEnum); + if (obj is AndroidPayDetails.TypeEnum androidPayDetailsTypeEnum) + return AndroidPayDetails.TypeEnumToJsonValue(androidPayDetailsTypeEnum); + if (obj is ApplePayDetails.FundingSourceEnum applePayDetailsFundingSourceEnum) + return ApplePayDetails.FundingSourceEnumToJsonValue(applePayDetailsFundingSourceEnum); + if (obj is ApplePayDetails.TypeEnum applePayDetailsTypeEnum) + return ApplePayDetails.TypeEnumToJsonValue(applePayDetailsTypeEnum); + if (obj is ApplePayDonations.FundingSourceEnum applePayDonationsFundingSourceEnum) + return ApplePayDonations.FundingSourceEnumToJsonValue(applePayDonationsFundingSourceEnum); + if (obj is ApplePayDonations.TypeEnum applePayDonationsTypeEnum) + return ApplePayDonations.TypeEnumToJsonValue(applePayDonationsTypeEnum); + if (obj is AuthenticationData.AttemptAuthenticationEnum authenticationDataAttemptAuthenticationEnum) + return AuthenticationData.AttemptAuthenticationEnumToJsonValue(authenticationDataAttemptAuthenticationEnum); + if (obj is BacsDirectDebitDetails.TypeEnum bacsDirectDebitDetailsTypeEnum) + return BacsDirectDebitDetails.TypeEnumToJsonValue(bacsDirectDebitDetailsTypeEnum); + if (obj is BalanceCheckRequest.RecurringProcessingModelEnum balanceCheckRequestRecurringProcessingModelEnum) + return BalanceCheckRequest.RecurringProcessingModelEnumToJsonValue(balanceCheckRequestRecurringProcessingModelEnum); + if (obj is BalanceCheckRequest.ShopperInteractionEnum balanceCheckRequestShopperInteractionEnum) + return BalanceCheckRequest.ShopperInteractionEnumToJsonValue(balanceCheckRequestShopperInteractionEnum); + if (obj is BalanceCheckResponse.ResultCodeEnum balanceCheckResponseResultCodeEnum) + return BalanceCheckResponse.ResultCodeEnumToJsonValue(balanceCheckResponseResultCodeEnum); + if (obj is BillDeskDetails.TypeEnum billDeskDetailsTypeEnum) + return BillDeskDetails.TypeEnumToJsonValue(billDeskDetailsTypeEnum); + if (obj is BlikDetails.TypeEnum blikDetailsTypeEnum) + return BlikDetails.TypeEnumToJsonValue(blikDetailsTypeEnum); + if (obj is CancelOrderResponse.ResultCodeEnum cancelOrderResponseResultCodeEnum) + return CancelOrderResponse.ResultCodeEnumToJsonValue(cancelOrderResponseResultCodeEnum); + if (obj is CardDetails.FundingSourceEnum cardDetailsFundingSourceEnum) + return CardDetails.FundingSourceEnumToJsonValue(cardDetailsFundingSourceEnum); + if (obj is CardDetails.TypeEnum cardDetailsTypeEnum) + return CardDetails.TypeEnumToJsonValue(cardDetailsTypeEnum); + if (obj is CardDonations.FundingSourceEnum cardDonationsFundingSourceEnum) + return CardDonations.FundingSourceEnumToJsonValue(cardDonationsFundingSourceEnum); + if (obj is CardDonations.TypeEnum cardDonationsTypeEnum) + return CardDonations.TypeEnumToJsonValue(cardDonationsTypeEnum); + if (obj is CashAppDetails.TypeEnum cashAppDetailsTypeEnum) + return CashAppDetails.TypeEnumToJsonValue(cashAppDetailsTypeEnum); + if (obj is CellulantDetails.TypeEnum cellulantDetailsTypeEnum) + return CellulantDetails.TypeEnumToJsonValue(cellulantDetailsTypeEnum); + if (obj is CheckoutAwaitAction.TypeEnum checkoutAwaitActionTypeEnum) + return CheckoutAwaitAction.TypeEnumToJsonValue(checkoutAwaitActionTypeEnum); + if (obj is CheckoutBankAccount.AccountTypeEnum checkoutBankAccountAccountTypeEnum) + return CheckoutBankAccount.AccountTypeEnumToJsonValue(checkoutBankAccountAccountTypeEnum); + if (obj is CheckoutBankTransferAction.TypeEnum checkoutBankTransferActionTypeEnum) + return CheckoutBankTransferAction.TypeEnumToJsonValue(checkoutBankTransferActionTypeEnum); + if (obj is CheckoutDelegatedAuthenticationAction.TypeEnum checkoutDelegatedAuthenticationActionTypeEnum) + return CheckoutDelegatedAuthenticationAction.TypeEnumToJsonValue(checkoutDelegatedAuthenticationActionTypeEnum); + if (obj is CheckoutNativeRedirectAction.TypeEnum checkoutNativeRedirectActionTypeEnum) + return CheckoutNativeRedirectAction.TypeEnumToJsonValue(checkoutNativeRedirectActionTypeEnum); + if (obj is CheckoutQrCodeAction.TypeEnum checkoutQrCodeActionTypeEnum) + return CheckoutQrCodeAction.TypeEnumToJsonValue(checkoutQrCodeActionTypeEnum); + if (obj is CheckoutRedirectAction.TypeEnum checkoutRedirectActionTypeEnum) + return CheckoutRedirectAction.TypeEnumToJsonValue(checkoutRedirectActionTypeEnum); + if (obj is CheckoutSDKAction.TypeEnum checkoutSDKActionTypeEnum) + return CheckoutSDKAction.TypeEnumToJsonValue(checkoutSDKActionTypeEnum); + if (obj is CheckoutSessionInstallmentOption.PlansEnum checkoutSessionInstallmentOptionPlansEnum) + return CheckoutSessionInstallmentOption.PlansEnumToJsonValue(checkoutSessionInstallmentOptionPlansEnum); + if (obj is CheckoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndEnum checkoutSessionThreeDS2RequestDataThreeDSRequestorChallengeIndEnum) + return CheckoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumToJsonValue(checkoutSessionThreeDS2RequestDataThreeDSRequestorChallengeIndEnum); + if (obj is CheckoutThreeDS2Action.TypeEnum checkoutThreeDS2ActionTypeEnum) + return CheckoutThreeDS2Action.TypeEnumToJsonValue(checkoutThreeDS2ActionTypeEnum); + if (obj is CheckoutVoucherAction.TypeEnum checkoutVoucherActionTypeEnum) + return CheckoutVoucherAction.TypeEnumToJsonValue(checkoutVoucherActionTypeEnum); + if (obj is CreateCheckoutSessionRequest.ChannelEnum createCheckoutSessionRequestChannelEnum) + return CreateCheckoutSessionRequest.ChannelEnumToJsonValue(createCheckoutSessionRequestChannelEnum); + if (obj is CreateCheckoutSessionRequest.ModeEnum createCheckoutSessionRequestModeEnum) + return CreateCheckoutSessionRequest.ModeEnumToJsonValue(createCheckoutSessionRequestModeEnum); + if (obj is CreateCheckoutSessionRequest.RecurringProcessingModelEnum createCheckoutSessionRequestRecurringProcessingModelEnum) + return CreateCheckoutSessionRequest.RecurringProcessingModelEnumToJsonValue(createCheckoutSessionRequestRecurringProcessingModelEnum); + if (obj is CreateCheckoutSessionRequest.ShopperInteractionEnum createCheckoutSessionRequestShopperInteractionEnum) + return CreateCheckoutSessionRequest.ShopperInteractionEnumToJsonValue(createCheckoutSessionRequestShopperInteractionEnum); + if (obj is CreateCheckoutSessionRequest.StoreFiltrationModeEnum createCheckoutSessionRequestStoreFiltrationModeEnum) + return CreateCheckoutSessionRequest.StoreFiltrationModeEnumToJsonValue(createCheckoutSessionRequestStoreFiltrationModeEnum); + if (obj is CreateCheckoutSessionRequest.StorePaymentMethodModeEnum createCheckoutSessionRequestStorePaymentMethodModeEnum) + return CreateCheckoutSessionRequest.StorePaymentMethodModeEnumToJsonValue(createCheckoutSessionRequestStorePaymentMethodModeEnum); + if (obj is CreateCheckoutSessionResponse.ChannelEnum createCheckoutSessionResponseChannelEnum) + return CreateCheckoutSessionResponse.ChannelEnumToJsonValue(createCheckoutSessionResponseChannelEnum); + if (obj is CreateCheckoutSessionResponse.ModeEnum createCheckoutSessionResponseModeEnum) + return CreateCheckoutSessionResponse.ModeEnumToJsonValue(createCheckoutSessionResponseModeEnum); + if (obj is CreateCheckoutSessionResponse.RecurringProcessingModelEnum createCheckoutSessionResponseRecurringProcessingModelEnum) + return CreateCheckoutSessionResponse.RecurringProcessingModelEnumToJsonValue(createCheckoutSessionResponseRecurringProcessingModelEnum); + if (obj is CreateCheckoutSessionResponse.ShopperInteractionEnum createCheckoutSessionResponseShopperInteractionEnum) + return CreateCheckoutSessionResponse.ShopperInteractionEnumToJsonValue(createCheckoutSessionResponseShopperInteractionEnum); + if (obj is CreateCheckoutSessionResponse.StoreFiltrationModeEnum createCheckoutSessionResponseStoreFiltrationModeEnum) + return CreateCheckoutSessionResponse.StoreFiltrationModeEnumToJsonValue(createCheckoutSessionResponseStoreFiltrationModeEnum); + if (obj is CreateCheckoutSessionResponse.StorePaymentMethodModeEnum createCheckoutSessionResponseStorePaymentMethodModeEnum) + return CreateCheckoutSessionResponse.StorePaymentMethodModeEnumToJsonValue(createCheckoutSessionResponseStorePaymentMethodModeEnum); + if (obj is CreateOrderResponse.ResultCodeEnum createOrderResponseResultCodeEnum) + return CreateOrderResponse.ResultCodeEnumToJsonValue(createOrderResponseResultCodeEnum); + if (obj is DeliveryMethod.TypeEnum deliveryMethodTypeEnum) + return DeliveryMethod.TypeEnumToJsonValue(deliveryMethodTypeEnum); + if (obj is DeviceRenderOptions.SdkInterfaceEnum deviceRenderOptionsSdkInterfaceEnum) + return DeviceRenderOptions.SdkInterfaceEnumToJsonValue(deviceRenderOptionsSdkInterfaceEnum); + if (obj is DeviceRenderOptions.SdkUiTypeEnum deviceRenderOptionsSdkUiTypeEnum) + return DeviceRenderOptions.SdkUiTypeEnumToJsonValue(deviceRenderOptionsSdkUiTypeEnum); + if (obj is DokuDetails.TypeEnum dokuDetailsTypeEnum) + return DokuDetails.TypeEnumToJsonValue(dokuDetailsTypeEnum); + if (obj is DonationPaymentRequest.ChannelEnum donationPaymentRequestChannelEnum) + return DonationPaymentRequest.ChannelEnumToJsonValue(donationPaymentRequestChannelEnum); + if (obj is DonationPaymentRequest.RecurringProcessingModelEnum donationPaymentRequestRecurringProcessingModelEnum) + return DonationPaymentRequest.RecurringProcessingModelEnumToJsonValue(donationPaymentRequestRecurringProcessingModelEnum); + if (obj is DonationPaymentRequest.ShopperInteractionEnum donationPaymentRequestShopperInteractionEnum) + return DonationPaymentRequest.ShopperInteractionEnumToJsonValue(donationPaymentRequestShopperInteractionEnum); + if (obj is DonationPaymentResponse.StatusEnum donationPaymentResponseStatusEnum) + return DonationPaymentResponse.StatusEnumToJsonValue(donationPaymentResponseStatusEnum); + if (obj is DragonpayDetails.TypeEnum dragonpayDetailsTypeEnum) + return DragonpayDetails.TypeEnumToJsonValue(dragonpayDetailsTypeEnum); + if (obj is EBankingFinlandDetails.TypeEnum eBankingFinlandDetailsTypeEnum) + return EBankingFinlandDetails.TypeEnumToJsonValue(eBankingFinlandDetailsTypeEnum); + if (obj is EcontextVoucherDetails.TypeEnum econtextVoucherDetailsTypeEnum) + return EcontextVoucherDetails.TypeEnumToJsonValue(econtextVoucherDetailsTypeEnum); + if (obj is EftDetails.TypeEnum eftDetailsTypeEnum) + return EftDetails.TypeEnumToJsonValue(eftDetailsTypeEnum); + if (obj is FastlaneDetails.TypeEnum fastlaneDetailsTypeEnum) + return FastlaneDetails.TypeEnumToJsonValue(fastlaneDetailsTypeEnum); + if (obj is FundRecipient.WalletPurposeEnum fundRecipientWalletPurposeEnum) + return FundRecipient.WalletPurposeEnumToJsonValue(fundRecipientWalletPurposeEnum); + if (obj is GenericIssuerPaymentMethodDetails.TypeEnum genericIssuerPaymentMethodDetailsTypeEnum) + return GenericIssuerPaymentMethodDetails.TypeEnumToJsonValue(genericIssuerPaymentMethodDetailsTypeEnum); + if (obj is GooglePayDetails.FundingSourceEnum googlePayDetailsFundingSourceEnum) + return GooglePayDetails.FundingSourceEnumToJsonValue(googlePayDetailsFundingSourceEnum); + if (obj is GooglePayDetails.TypeEnum googlePayDetailsTypeEnum) + return GooglePayDetails.TypeEnumToJsonValue(googlePayDetailsTypeEnum); + if (obj is GooglePayDonations.FundingSourceEnum googlePayDonationsFundingSourceEnum) + return GooglePayDonations.FundingSourceEnumToJsonValue(googlePayDonationsFundingSourceEnum); + if (obj is GooglePayDonations.TypeEnum googlePayDonationsTypeEnum) + return GooglePayDonations.TypeEnumToJsonValue(googlePayDonationsTypeEnum); + if (obj is IdealDetails.TypeEnum idealDetailsTypeEnum) + return IdealDetails.TypeEnumToJsonValue(idealDetailsTypeEnum); + if (obj is IdealDonations.TypeEnum idealDonationsTypeEnum) + return IdealDonations.TypeEnumToJsonValue(idealDonationsTypeEnum); + if (obj is InstallmentOption.PlansEnum installmentOptionPlansEnum) + return InstallmentOption.PlansEnumToJsonValue(installmentOptionPlansEnum); + if (obj is Installments.PlanEnum installmentsPlanEnum) + return Installments.PlanEnumToJsonValue(installmentsPlanEnum); + if (obj is KlarnaDetails.TypeEnum klarnaDetailsTypeEnum) + return KlarnaDetails.TypeEnumToJsonValue(klarnaDetailsTypeEnum); + if (obj is Mandate.FrequencyEnum mandateFrequencyEnum) + return Mandate.FrequencyEnumToJsonValue(mandateFrequencyEnum); + if (obj is Mandate.AmountRuleEnum mandateAmountRuleEnum) + return Mandate.AmountRuleEnumToJsonValue(mandateAmountRuleEnum); + if (obj is Mandate.BillingAttemptsRuleEnum mandateBillingAttemptsRuleEnum) + return Mandate.BillingAttemptsRuleEnumToJsonValue(mandateBillingAttemptsRuleEnum); + if (obj is MasterpassDetails.FundingSourceEnum masterpassDetailsFundingSourceEnum) + return MasterpassDetails.FundingSourceEnumToJsonValue(masterpassDetailsFundingSourceEnum); + if (obj is MasterpassDetails.TypeEnum masterpassDetailsTypeEnum) + return MasterpassDetails.TypeEnumToJsonValue(masterpassDetailsTypeEnum); + if (obj is MbwayDetails.TypeEnum mbwayDetailsTypeEnum) + return MbwayDetails.TypeEnumToJsonValue(mbwayDetailsTypeEnum); + if (obj is MerchantRiskIndicator.DeliveryAddressIndicatorEnum merchantRiskIndicatorDeliveryAddressIndicatorEnum) + return MerchantRiskIndicator.DeliveryAddressIndicatorEnumToJsonValue(merchantRiskIndicatorDeliveryAddressIndicatorEnum); + if (obj is MerchantRiskIndicator.DeliveryTimeframeEnum merchantRiskIndicatorDeliveryTimeframeEnum) + return MerchantRiskIndicator.DeliveryTimeframeEnumToJsonValue(merchantRiskIndicatorDeliveryTimeframeEnum); + if (obj is MobilePayDetails.TypeEnum mobilePayDetailsTypeEnum) + return MobilePayDetails.TypeEnumToJsonValue(mobilePayDetailsTypeEnum); + if (obj is MolPayDetails.TypeEnum molPayDetailsTypeEnum) + return MolPayDetails.TypeEnumToJsonValue(molPayDetailsTypeEnum); + if (obj is OpenInvoiceDetails.TypeEnum openInvoiceDetailsTypeEnum) + return OpenInvoiceDetails.TypeEnumToJsonValue(openInvoiceDetailsTypeEnum); + if (obj is PayByBankAISDirectDebitDetails.TypeEnum payByBankAISDirectDebitDetailsTypeEnum) + return PayByBankAISDirectDebitDetails.TypeEnumToJsonValue(payByBankAISDirectDebitDetailsTypeEnum); + if (obj is PayByBankDetails.TypeEnum payByBankDetailsTypeEnum) + return PayByBankDetails.TypeEnumToJsonValue(payByBankDetailsTypeEnum); + if (obj is PayPalDetails.SubtypeEnum payPalDetailsSubtypeEnum) + return PayPalDetails.SubtypeEnumToJsonValue(payPalDetailsSubtypeEnum); + if (obj is PayPalDetails.TypeEnum payPalDetailsTypeEnum) + return PayPalDetails.TypeEnumToJsonValue(payPalDetailsTypeEnum); + if (obj is PayPayDetails.TypeEnum payPayDetailsTypeEnum) + return PayPayDetails.TypeEnumToJsonValue(payPayDetailsTypeEnum); + if (obj is PayToDetails.TypeEnum payToDetailsTypeEnum) + return PayToDetails.TypeEnumToJsonValue(payToDetailsTypeEnum); + if (obj is PayUUpiDetails.TypeEnum payUUpiDetailsTypeEnum) + return PayUUpiDetails.TypeEnumToJsonValue(payUUpiDetailsTypeEnum); + if (obj is PayWithGoogleDetails.FundingSourceEnum payWithGoogleDetailsFundingSourceEnum) + return PayWithGoogleDetails.FundingSourceEnumToJsonValue(payWithGoogleDetailsFundingSourceEnum); + if (obj is PayWithGoogleDetails.TypeEnum payWithGoogleDetailsTypeEnum) + return PayWithGoogleDetails.TypeEnumToJsonValue(payWithGoogleDetailsTypeEnum); + if (obj is PayWithGoogleDonations.FundingSourceEnum payWithGoogleDonationsFundingSourceEnum) + return PayWithGoogleDonations.FundingSourceEnumToJsonValue(payWithGoogleDonationsFundingSourceEnum); + if (obj is PayWithGoogleDonations.TypeEnum payWithGoogleDonationsTypeEnum) + return PayWithGoogleDonations.TypeEnumToJsonValue(payWithGoogleDonationsTypeEnum); + if (obj is Payment.ResultCodeEnum paymentResultCodeEnum) + return Payment.ResultCodeEnumToJsonValue(paymentResultCodeEnum); + if (obj is PaymentAmountUpdateRequest.IndustryUsageEnum paymentAmountUpdateRequestIndustryUsageEnum) + return PaymentAmountUpdateRequest.IndustryUsageEnumToJsonValue(paymentAmountUpdateRequestIndustryUsageEnum); + if (obj is PaymentAmountUpdateResponse.StatusEnum paymentAmountUpdateResponseStatusEnum) + return PaymentAmountUpdateResponse.StatusEnumToJsonValue(paymentAmountUpdateResponseStatusEnum); + if (obj is PaymentAmountUpdateResponse.IndustryUsageEnum paymentAmountUpdateResponseIndustryUsageEnum) + return PaymentAmountUpdateResponse.IndustryUsageEnumToJsonValue(paymentAmountUpdateResponseIndustryUsageEnum); + if (obj is PaymentCancelResponse.StatusEnum paymentCancelResponseStatusEnum) + return PaymentCancelResponse.StatusEnumToJsonValue(paymentCancelResponseStatusEnum); + if (obj is PaymentCaptureResponse.StatusEnum paymentCaptureResponseStatusEnum) + return PaymentCaptureResponse.StatusEnumToJsonValue(paymentCaptureResponseStatusEnum); + if (obj is PaymentDetails.TypeEnum paymentDetailsTypeEnum) + return PaymentDetails.TypeEnumToJsonValue(paymentDetailsTypeEnum); + if (obj is PaymentDetailsResponse.ResultCodeEnum paymentDetailsResponseResultCodeEnum) + return PaymentDetailsResponse.ResultCodeEnumToJsonValue(paymentDetailsResponseResultCodeEnum); + if (obj is PaymentLinkRequest.RecurringProcessingModelEnum paymentLinkRequestRecurringProcessingModelEnum) + return PaymentLinkRequest.RecurringProcessingModelEnumToJsonValue(paymentLinkRequestRecurringProcessingModelEnum); + if (obj is PaymentLinkRequest.RequiredShopperFieldsEnum paymentLinkRequestRequiredShopperFieldsEnum) + return PaymentLinkRequest.RequiredShopperFieldsEnumToJsonValue(paymentLinkRequestRequiredShopperFieldsEnum); + if (obj is PaymentLinkRequest.StorePaymentMethodModeEnum paymentLinkRequestStorePaymentMethodModeEnum) + return PaymentLinkRequest.StorePaymentMethodModeEnumToJsonValue(paymentLinkRequestStorePaymentMethodModeEnum); + if (obj is PaymentLinkResponse.StatusEnum paymentLinkResponseStatusEnum) + return PaymentLinkResponse.StatusEnumToJsonValue(paymentLinkResponseStatusEnum); + if (obj is PaymentLinkResponse.RecurringProcessingModelEnum paymentLinkResponseRecurringProcessingModelEnum) + return PaymentLinkResponse.RecurringProcessingModelEnumToJsonValue(paymentLinkResponseRecurringProcessingModelEnum); + if (obj is PaymentLinkResponse.RequiredShopperFieldsEnum paymentLinkResponseRequiredShopperFieldsEnum) + return PaymentLinkResponse.RequiredShopperFieldsEnumToJsonValue(paymentLinkResponseRequiredShopperFieldsEnum); + if (obj is PaymentLinkResponse.StorePaymentMethodModeEnum paymentLinkResponseStorePaymentMethodModeEnum) + return PaymentLinkResponse.StorePaymentMethodModeEnumToJsonValue(paymentLinkResponseStorePaymentMethodModeEnum); + if (obj is PaymentMethod.FundingSourceEnum paymentMethodFundingSourceEnum) + return PaymentMethod.FundingSourceEnumToJsonValue(paymentMethodFundingSourceEnum); + if (obj is PaymentMethodsRequest.ChannelEnum paymentMethodsRequestChannelEnum) + return PaymentMethodsRequest.ChannelEnumToJsonValue(paymentMethodsRequestChannelEnum); + if (obj is PaymentMethodsRequest.StoreFiltrationModeEnum paymentMethodsRequestStoreFiltrationModeEnum) + return PaymentMethodsRequest.StoreFiltrationModeEnumToJsonValue(paymentMethodsRequestStoreFiltrationModeEnum); + if (obj is PaymentRefundRequest.MerchantRefundReasonEnum paymentRefundRequestMerchantRefundReasonEnum) + return PaymentRefundRequest.MerchantRefundReasonEnumToJsonValue(paymentRefundRequestMerchantRefundReasonEnum); + if (obj is PaymentRefundResponse.StatusEnum paymentRefundResponseStatusEnum) + return PaymentRefundResponse.StatusEnumToJsonValue(paymentRefundResponseStatusEnum); + if (obj is PaymentRefundResponse.MerchantRefundReasonEnum paymentRefundResponseMerchantRefundReasonEnum) + return PaymentRefundResponse.MerchantRefundReasonEnumToJsonValue(paymentRefundResponseMerchantRefundReasonEnum); + if (obj is PaymentRequest.ChannelEnum paymentRequestChannelEnum) + return PaymentRequest.ChannelEnumToJsonValue(paymentRequestChannelEnum); + if (obj is PaymentRequest.EntityTypeEnum paymentRequestEntityTypeEnum) + return PaymentRequest.EntityTypeEnumToJsonValue(paymentRequestEntityTypeEnum); + if (obj is PaymentRequest.IndustryUsageEnum paymentRequestIndustryUsageEnum) + return PaymentRequest.IndustryUsageEnumToJsonValue(paymentRequestIndustryUsageEnum); + if (obj is PaymentRequest.RecurringProcessingModelEnum paymentRequestRecurringProcessingModelEnum) + return PaymentRequest.RecurringProcessingModelEnumToJsonValue(paymentRequestRecurringProcessingModelEnum); + if (obj is PaymentRequest.ShopperInteractionEnum paymentRequestShopperInteractionEnum) + return PaymentRequest.ShopperInteractionEnumToJsonValue(paymentRequestShopperInteractionEnum); + if (obj is PaymentResponse.ResultCodeEnum paymentResponseResultCodeEnum) + return PaymentResponse.ResultCodeEnumToJsonValue(paymentResponseResultCodeEnum); + if (obj is PaymentReversalResponse.StatusEnum paymentReversalResponseStatusEnum) + return PaymentReversalResponse.StatusEnumToJsonValue(paymentReversalResponseStatusEnum); + if (obj is PaypalUpdateOrderResponse.StatusEnum paypalUpdateOrderResponseStatusEnum) + return PaypalUpdateOrderResponse.StatusEnumToJsonValue(paypalUpdateOrderResponseStatusEnum); + if (obj is PixDetails.TypeEnum pixDetailsTypeEnum) + return PixDetails.TypeEnumToJsonValue(pixDetailsTypeEnum); + if (obj is PixRecurring.FrequencyEnum pixRecurringFrequencyEnum) + return PixRecurring.FrequencyEnumToJsonValue(pixRecurringFrequencyEnum); + if (obj is PlatformChargebackLogic.BehaviorEnum platformChargebackLogicBehaviorEnum) + return PlatformChargebackLogic.BehaviorEnumToJsonValue(platformChargebackLogicBehaviorEnum); + if (obj is PseDetails.TypeEnum pseDetailsTypeEnum) + return PseDetails.TypeEnumToJsonValue(pseDetailsTypeEnum); + if (obj is RakutenPayDetails.TypeEnum rakutenPayDetailsTypeEnum) + return RakutenPayDetails.TypeEnumToJsonValue(rakutenPayDetailsTypeEnum); + if (obj is RatepayDetails.TypeEnum ratepayDetailsTypeEnum) + return RatepayDetails.TypeEnumToJsonValue(ratepayDetailsTypeEnum); + if (obj is Recurring.ContractEnum recurringContractEnum) + return Recurring.ContractEnumToJsonValue(recurringContractEnum); + if (obj is Recurring.TokenServiceEnum recurringTokenServiceEnum) + return Recurring.TokenServiceEnumToJsonValue(recurringTokenServiceEnum); + if (obj is ResponseAdditionalDataCard.CardProductIdEnum responseAdditionalDataCardCardProductIdEnum) + return ResponseAdditionalDataCard.CardProductIdEnumToJsonValue(responseAdditionalDataCardCardProductIdEnum); + if (obj is ResponseAdditionalDataCommon.FraudResultTypeEnum responseAdditionalDataCommonFraudResultTypeEnum) + return ResponseAdditionalDataCommon.FraudResultTypeEnumToJsonValue(responseAdditionalDataCommonFraudResultTypeEnum); + if (obj is ResponseAdditionalDataCommon.FraudRiskLevelEnum responseAdditionalDataCommonFraudRiskLevelEnum) + return ResponseAdditionalDataCommon.FraudRiskLevelEnumToJsonValue(responseAdditionalDataCommonFraudRiskLevelEnum); + if (obj is ResponseAdditionalDataCommon.RecurringProcessingModelEnum responseAdditionalDataCommonRecurringProcessingModelEnum) + return ResponseAdditionalDataCommon.RecurringProcessingModelEnumToJsonValue(responseAdditionalDataCommonRecurringProcessingModelEnum); + if (obj is ResponseAdditionalDataCommon.TokenizationStoreOperationTypeEnum responseAdditionalDataCommonTokenizationStoreOperationTypeEnum) + return ResponseAdditionalDataCommon.TokenizationStoreOperationTypeEnumToJsonValue(responseAdditionalDataCommonTokenizationStoreOperationTypeEnum); + if (obj is Result result) + return ResultValueConverter.ToJsonValue(result); + if (obj is RivertyDetails.TypeEnum rivertyDetailsTypeEnum) + return RivertyDetails.TypeEnumToJsonValue(rivertyDetailsTypeEnum); + if (obj is SamsungPayDetails.FundingSourceEnum samsungPayDetailsFundingSourceEnum) + return SamsungPayDetails.FundingSourceEnumToJsonValue(samsungPayDetailsFundingSourceEnum); + if (obj is SamsungPayDetails.TypeEnum samsungPayDetailsTypeEnum) + return SamsungPayDetails.TypeEnumToJsonValue(samsungPayDetailsTypeEnum); + if (obj is SepaDirectDebitDetails.TypeEnum sepaDirectDebitDetailsTypeEnum) + return SepaDirectDebitDetails.TypeEnumToJsonValue(sepaDirectDebitDetailsTypeEnum); + if (obj is SessionResultResponse.StatusEnum sessionResultResponseStatusEnum) + return SessionResultResponse.StatusEnumToJsonValue(sessionResultResponseStatusEnum); + if (obj is Split.TypeEnum splitTypeEnum) + return Split.TypeEnumToJsonValue(splitTypeEnum); + if (obj is StandalonePaymentCancelResponse.StatusEnum standalonePaymentCancelResponseStatusEnum) + return StandalonePaymentCancelResponse.StatusEnumToJsonValue(standalonePaymentCancelResponseStatusEnum); + if (obj is StoredPaymentMethodDetails.TypeEnum storedPaymentMethodDetailsTypeEnum) + return StoredPaymentMethodDetails.TypeEnumToJsonValue(storedPaymentMethodDetailsTypeEnum); + if (obj is StoredPaymentMethodRequest.RecurringProcessingModelEnum storedPaymentMethodRequestRecurringProcessingModelEnum) + return StoredPaymentMethodRequest.RecurringProcessingModelEnumToJsonValue(storedPaymentMethodRequestRecurringProcessingModelEnum); + if (obj is ThreeDS2RequestData.AcctTypeEnum threeDS2RequestDataAcctTypeEnum) + return ThreeDS2RequestData.AcctTypeEnumToJsonValue(threeDS2RequestDataAcctTypeEnum); + if (obj is ThreeDS2RequestData.AddrMatchEnum threeDS2RequestDataAddrMatchEnum) + return ThreeDS2RequestData.AddrMatchEnumToJsonValue(threeDS2RequestDataAddrMatchEnum); + if (obj is ThreeDS2RequestData.ChallengeIndicatorEnum threeDS2RequestDataChallengeIndicatorEnum) + return ThreeDS2RequestData.ChallengeIndicatorEnumToJsonValue(threeDS2RequestDataChallengeIndicatorEnum); + if (obj is ThreeDS2RequestData.ThreeDSRequestorChallengeIndEnum threeDS2RequestDataThreeDSRequestorChallengeIndEnum) + return ThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2RequestDataThreeDSRequestorChallengeIndEnum); + if (obj is ThreeDS2RequestData.TransTypeEnum threeDS2RequestDataTransTypeEnum) + return ThreeDS2RequestData.TransTypeEnumToJsonValue(threeDS2RequestDataTransTypeEnum); + if (obj is ThreeDS2RequestData.TransactionTypeEnum threeDS2RequestDataTransactionTypeEnum) + return ThreeDS2RequestData.TransactionTypeEnumToJsonValue(threeDS2RequestDataTransactionTypeEnum); + if (obj is ThreeDS2RequestFields.AcctTypeEnum threeDS2RequestFieldsAcctTypeEnum) + return ThreeDS2RequestFields.AcctTypeEnumToJsonValue(threeDS2RequestFieldsAcctTypeEnum); + if (obj is ThreeDS2RequestFields.AddrMatchEnum threeDS2RequestFieldsAddrMatchEnum) + return ThreeDS2RequestFields.AddrMatchEnumToJsonValue(threeDS2RequestFieldsAddrMatchEnum); + if (obj is ThreeDS2RequestFields.ChallengeIndicatorEnum threeDS2RequestFieldsChallengeIndicatorEnum) + return ThreeDS2RequestFields.ChallengeIndicatorEnumToJsonValue(threeDS2RequestFieldsChallengeIndicatorEnum); + if (obj is ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnum threeDS2RequestFieldsThreeDSRequestorChallengeIndEnum) + return ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2RequestFieldsThreeDSRequestorChallengeIndEnum); + if (obj is ThreeDS2RequestFields.TransTypeEnum threeDS2RequestFieldsTransTypeEnum) + return ThreeDS2RequestFields.TransTypeEnumToJsonValue(threeDS2RequestFieldsTransTypeEnum); + if (obj is ThreeDS2RequestFields.TransactionTypeEnum threeDS2RequestFieldsTransactionTypeEnum) + return ThreeDS2RequestFields.TransactionTypeEnumToJsonValue(threeDS2RequestFieldsTransactionTypeEnum); + if (obj is ThreeDS2Result.ChallengeCancelEnum threeDS2ResultChallengeCancelEnum) + return ThreeDS2Result.ChallengeCancelEnumToJsonValue(threeDS2ResultChallengeCancelEnum); + if (obj is ThreeDS2Result.ExemptionIndicatorEnum threeDS2ResultExemptionIndicatorEnum) + return ThreeDS2Result.ExemptionIndicatorEnumToJsonValue(threeDS2ResultExemptionIndicatorEnum); + if (obj is ThreeDS2Result.ThreeDSRequestorChallengeIndEnum threeDS2ResultThreeDSRequestorChallengeIndEnum) + return ThreeDS2Result.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2ResultThreeDSRequestorChallengeIndEnum); + if (obj is ThreeDSRequestData.ChallengeWindowSizeEnum threeDSRequestDataChallengeWindowSizeEnum) + return ThreeDSRequestData.ChallengeWindowSizeEnumToJsonValue(threeDSRequestDataChallengeWindowSizeEnum); + if (obj is ThreeDSRequestData.DataOnlyEnum threeDSRequestDataDataOnlyEnum) + return ThreeDSRequestData.DataOnlyEnumToJsonValue(threeDSRequestDataDataOnlyEnum); + if (obj is ThreeDSRequestData.NativeThreeDSEnum threeDSRequestDataNativeThreeDSEnum) + return ThreeDSRequestData.NativeThreeDSEnumToJsonValue(threeDSRequestDataNativeThreeDSEnum); + if (obj is ThreeDSRequestData.ThreeDSVersionEnum threeDSRequestDataThreeDSVersionEnum) + return ThreeDSRequestData.ThreeDSVersionEnumToJsonValue(threeDSRequestDataThreeDSVersionEnum); + if (obj is ThreeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodEnum threeDSRequestorAuthenticationInfoThreeDSReqAuthMethodEnum) + return ThreeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodEnumToJsonValue(threeDSRequestorAuthenticationInfoThreeDSReqAuthMethodEnum); + if (obj is ThreeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodEnum threeDSRequestorPriorAuthenticationInfoThreeDSReqPriorAuthMethodEnum) + return ThreeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodEnumToJsonValue(threeDSRequestorPriorAuthenticationInfoThreeDSReqPriorAuthMethodEnum); + if (obj is ThreeDSecureData.AuthenticationResponseEnum threeDSecureDataAuthenticationResponseEnum) + return ThreeDSecureData.AuthenticationResponseEnumToJsonValue(threeDSecureDataAuthenticationResponseEnum); + if (obj is ThreeDSecureData.ChallengeCancelEnum threeDSecureDataChallengeCancelEnum) + return ThreeDSecureData.ChallengeCancelEnumToJsonValue(threeDSecureDataChallengeCancelEnum); + if (obj is ThreeDSecureData.DirectoryResponseEnum threeDSecureDataDirectoryResponseEnum) + return ThreeDSecureData.DirectoryResponseEnumToJsonValue(threeDSecureDataDirectoryResponseEnum); + if (obj is TwintDetails.TypeEnum twintDetailsTypeEnum) + return TwintDetails.TypeEnumToJsonValue(twintDetailsTypeEnum); + if (obj is UpdatePaymentLinkRequest.StatusEnum updatePaymentLinkRequestStatusEnum) + return UpdatePaymentLinkRequest.StatusEnumToJsonValue(updatePaymentLinkRequestStatusEnum); + if (obj is UpiCollectDetails.TypeEnum upiCollectDetailsTypeEnum) + return UpiCollectDetails.TypeEnumToJsonValue(upiCollectDetailsTypeEnum); + if (obj is UpiIntentDetails.TypeEnum upiIntentDetailsTypeEnum) + return UpiIntentDetails.TypeEnumToJsonValue(upiIntentDetailsTypeEnum); + if (obj is UpiQrDetails.TypeEnum upiQrDetailsTypeEnum) + return UpiQrDetails.TypeEnumToJsonValue(upiQrDetailsTypeEnum); + if (obj is VippsDetails.TypeEnum vippsDetailsTypeEnum) + return VippsDetails.TypeEnumToJsonValue(vippsDetailsTypeEnum); + if (obj is VisaCheckoutDetails.FundingSourceEnum visaCheckoutDetailsFundingSourceEnum) + return VisaCheckoutDetails.FundingSourceEnumToJsonValue(visaCheckoutDetailsFundingSourceEnum); + if (obj is VisaCheckoutDetails.TypeEnum visaCheckoutDetailsTypeEnum) + return VisaCheckoutDetails.TypeEnumToJsonValue(visaCheckoutDetailsTypeEnum); + if (obj is WeChatPayDetails.TypeEnum weChatPayDetailsTypeEnum) + return WeChatPayDetails.TypeEnumToJsonValue(weChatPayDetailsTypeEnum); + if (obj is WeChatPayMiniProgramDetails.TypeEnum weChatPayMiniProgramDetailsTypeEnum) + return WeChatPayMiniProgramDetails.TypeEnumToJsonValue(weChatPayMiniProgramDetailsTypeEnum); + if (obj is ZipDetails.TypeEnum zipDetailsTypeEnum) + return ZipDetails.TypeEnumToJsonValue(zipDetailsTypeEnum); + if (obj is ICollection collection) + { + List entries = new(); foreach (var entry in collection) - entries.Add(ParameterToString(entry, configuration)); + entries.Add(ParameterToString(entry)); return string.Join(",", entries); } - if (obj is Enum && HasEnumMemberAttrValue(obj)) - return GetEnumMemberAttrValue(obj); - return Convert.ToString(obj, CultureInfo.InvariantCulture); + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); } /// - /// Serializes the given object when not null. Otherwise return null. + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 /// - /// The object to serialize. - /// Serialized string. - public static string Serialize(object obj) + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) { - return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); } /// @@ -190,7 +643,8 @@ public static string SelectHeaderAccept(string[] accepts) /// /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. /// - public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + [GeneratedRegex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$")] + private static partial Regex JsonRegex(); /// /// Check if the given MIME is a JSON MIME. @@ -206,42 +660,69 @@ public static bool IsJsonMime(string mime) { if (string.IsNullOrWhiteSpace(mime)) return false; - return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + return JsonRegex().IsMatch(mime) || mime.Equals("application/json-patch+json"); } /// - /// Is the Enum decorated with EnumMember Attribute + /// Get the discriminator /// - /// - /// true if found - private static bool HasEnumMemberAttrValue(object enumVal) + /// + /// + /// + /// + public static string GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) { - if (enumVal == null) - throw new ArgumentNullException(nameof(enumVal)); - var enumType = enumVal.GetType(); - var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); - var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); - if (attr != null) return true; - return false; - } + int currentDepth = utf8JsonReader.CurrentDepth; - /// - /// Get the EnumMember value - /// - /// - /// EnumMember value as string otherwise null - private static string GetEnumMemberAttrValue(object enumVal) - { - if (enumVal == null) - throw new ArgumentNullException(nameof(enumVal)); - var enumType = enumVal.GetType(); - var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); - var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); - if (attr != null) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) { - return attr.Value; + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } } - return null; + + throw new JsonException("The specified discriminator was not found."); } + + /// + /// The base path of the API + /// + public const string BASE_ADDRESS = "https://checkout-test.adyen.com/v71"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "https"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = "/v71"; + + /// + /// The host of the API + /// + public const string HOST = "checkout-test.adyen.com"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; } } diff --git a/Adyen/Client/Configuration.cs b/Adyen/Client/Configuration.cs deleted file mode 100644 index c9a04b3d2..000000000 --- a/Adyen/Client/Configuration.cs +++ /dev/null @@ -1,607 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Net.Http; -using System.Net.Security; - -namespace Adyen.Client -{ - /// - /// Represents a set of configuration settings - /// - public class Configuration : IReadableConfiguration - { - #region Constants - - /// - /// Version of the package. - /// - /// Version of the package. - public const string Version = "1.0.0"; - - /// - /// Identifier for ISO 8601 DateTime Format - /// - /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. - // ReSharper disable once InconsistentNaming - public const string ISO8601_DATETIME_FORMAT = "o"; - - #endregion Constants - - #region Static Members - - /// - /// Default creation of exceptions for a given method name and response object - /// - public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => - { - var status = (int)response.StatusCode; - if (status >= 400) - { - return new ApiException(status, - string.Format("Error calling {0}: {1}", methodName, response.RawContent), - response.RawContent, response.Headers); - } - return null; - }; - - #endregion Static Members - - #region Private Members - - /// - /// Defines the base path of the target API server. - /// Example: http://localhost:3000/v1/ - /// - private string _basePath; - - private bool _useDefaultCredentials = false; - - /// - /// Gets or sets the API key based on the authentication name. - /// This is the key and value comprising the "secret" for accessing an API. - /// - /// The API key. - private IDictionary _apiKey; - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// The prefix of the API key. - private IDictionary _apiKeyPrefix; - - private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; - private string _tempFolderPath = Path.GetTempPath(); - - /// - /// Gets or sets the servers defined in the OpenAPI spec. - /// - /// The servers - private IList> _servers; - - /// - /// Gets or sets the operation servers defined in the OpenAPI spec. - /// - /// The operation servers - private IReadOnlyDictionary>> _operationServers; - - #endregion Private Members - - #region Constructors - - /// - /// Initializes a new instance of the class - /// - [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] - public Configuration() - { - Proxy = null; - UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp"); - BasePath = "https://checkout-test.adyen.com/v71"; - DefaultHeaders = new ConcurrentDictionary(); - ApiKey = new ConcurrentDictionary(); - ApiKeyPrefix = new ConcurrentDictionary(); - Servers = new List>() - { - { - new Dictionary { - {"url", "https://checkout-test.adyen.com/v71"}, - {"description", "No description provided"}, - } - } - }; - OperationServers = new Dictionary>>() - { - }; - - // Setting Timeout has side effects (forces ApiClient creation). - Timeout = TimeSpan.FromSeconds(100); - } - - /// - /// Initializes a new instance of the class - /// - [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] - public Configuration( - IDictionary defaultHeaders, - IDictionary apiKey, - IDictionary apiKeyPrefix, - string basePath = "https://checkout-test.adyen.com/v71") : this() - { - if (string.IsNullOrWhiteSpace(basePath)) - throw new ArgumentException("The provided basePath is invalid.", "basePath"); - if (defaultHeaders == null) - throw new ArgumentNullException("defaultHeaders"); - if (apiKey == null) - throw new ArgumentNullException("apiKey"); - if (apiKeyPrefix == null) - throw new ArgumentNullException("apiKeyPrefix"); - - BasePath = basePath; - - foreach (var keyValuePair in defaultHeaders) - { - DefaultHeaders.Add(keyValuePair); - } - - foreach (var keyValuePair in apiKey) - { - ApiKey.Add(keyValuePair); - } - - foreach (var keyValuePair in apiKeyPrefix) - { - ApiKeyPrefix.Add(keyValuePair); - } - } - - #endregion Constructors - - #region Properties - - /// - /// Gets or sets the base path for API access. - /// - public virtual string BasePath - { - get { return _basePath; } - set { _basePath = value; } - } - - /// - /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. - /// - public virtual bool UseDefaultCredentials - { - get { return _useDefaultCredentials; } - set { _useDefaultCredentials = value; } - } - - /// - /// Gets or sets the default header. - /// - [Obsolete("Use DefaultHeaders instead.")] - public virtual IDictionary DefaultHeader - { - get - { - return DefaultHeaders; - } - set - { - DefaultHeaders = value; - } - } - - /// - /// Gets or sets the default headers. - /// - public virtual IDictionary DefaultHeaders { get; set; } - - /// - /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. - /// - public virtual TimeSpan Timeout { get; set; } - - /// - /// Gets or sets the proxy - /// - /// Proxy. - public virtual WebProxy Proxy { get; set; } - - /// - /// Gets or sets the HTTP user agent. - /// - /// Http user agent. - public virtual string UserAgent { get; set; } - - /// - /// Gets or sets the username (HTTP basic authentication). - /// - /// The username. - public virtual string Username { get; set; } - - /// - /// Gets or sets the password (HTTP basic authentication). - /// - /// The password. - public virtual string Password { get; set; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - public string GetApiKeyWithPrefix(string apiKeyIdentifier) - { - string apiKeyValue; - ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); - string apiKeyPrefix; - if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) - { - return apiKeyPrefix + " " + apiKeyValue; - } - - return apiKeyValue; - } - - /// - /// Gets or sets certificate collection to be sent with requests. - /// - /// X509 Certificate collection. - public X509CertificateCollection ClientCertificates { get; set; } - - /// - /// Gets or sets the access token for OAuth2 authentication. - /// - /// This helper property simplifies code generation. - /// - /// The access token. - public virtual string AccessToken { get; set; } - - /// - /// Gets or sets the temporary folder path to store the files downloaded from the server. - /// - /// Folder path. - public virtual string TempFolderPath - { - get { return _tempFolderPath; } - - set - { - if (string.IsNullOrEmpty(value)) - { - _tempFolderPath = Path.GetTempPath(); - return; - } - - // create the directory if it does not exist - if (!Directory.Exists(value)) - { - Directory.CreateDirectory(value); - } - - // check if the path contains directory separator at the end - if (value[value.Length - 1] == Path.DirectorySeparatorChar) - { - _tempFolderPath = value; - } - else - { - _tempFolderPath = value + Path.DirectorySeparatorChar; - } - } - } - - /// - /// Gets or sets the date time format used when serializing in the ApiClient - /// By default, it's set to ISO 8601 - "o", for others see: - /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx - /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx - /// No validation is done to ensure that the string you're providing is valid - /// - /// The DateTimeFormat string - public virtual string DateTimeFormat - { - get { return _dateTimeFormat; } - set - { - if (string.IsNullOrEmpty(value)) - { - // Never allow a blank or null string, go back to the default - _dateTimeFormat = ISO8601_DATETIME_FORMAT; - return; - } - - // Caution, no validation when you choose date time format other than ISO 8601 - // Take a look at the above links - _dateTimeFormat = value; - } - } - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// Whatever you set here will be prepended to the value defined in AddApiKey. - /// - /// An example invocation here might be: - /// - /// ApiKeyPrefix["Authorization"] = "Bearer"; - /// - /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. - /// - /// - /// OAuth2 workflows should set tokens via AccessToken. - /// - /// - /// The prefix of the API key. - public virtual IDictionary ApiKeyPrefix - { - get { return _apiKeyPrefix; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); - } - _apiKeyPrefix = value; - } - } - - /// - /// Gets or sets the API key based on the authentication name. - /// - /// The API key. - public virtual IDictionary ApiKey - { - get { return _apiKey; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKey collection may not be null."); - } - _apiKey = value; - } - } - - /// - /// Gets or sets the servers. - /// - /// The servers. - public virtual IList> Servers - { - get { return _servers; } - set - { - if (value == null) - { - throw new InvalidOperationException("Servers may not be null."); - } - _servers = value; - } - } - - /// - /// Gets or sets the operation servers. - /// - /// The operation servers. - public virtual IReadOnlyDictionary>> OperationServers - { - get { return _operationServers; } - set - { - if (value == null) - { - throw new InvalidOperationException("Operation servers may not be null."); - } - _operationServers = value; - } - } - - /// - /// Returns URL based on server settings without providing values - /// for the variables - /// - /// Array index of the server settings. - /// The server URL. - public string GetServerUrl(int index) - { - return GetServerUrl(Servers, index, null); - } - - /// - /// Returns URL based on server settings. - /// - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The server URL. - public string GetServerUrl(int index, Dictionary inputVariables) - { - return GetServerUrl(Servers, index, inputVariables); - } - - /// - /// Returns URL based on operation server settings. - /// - /// Operation associated with the request path. - /// Array index of the server settings. - /// The operation server URL. - public string GetOperationServerUrl(string operation, int index) - { - return GetOperationServerUrl(operation, index, null); - } - - /// - /// Returns URL based on operation server settings. - /// - /// Operation associated with the request path. - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The operation server URL. - public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) - { - if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) - { - return GetServerUrl(operationServer, index, inputVariables); - } - - return null; - } - - /// - /// Returns URL based on server settings. - /// - /// Dictionary of server settings. - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The server URL. - private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) - { - if (index < 0 || index >= servers.Count) - { - throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); - } - - if (inputVariables == null) - { - inputVariables = new Dictionary(); - } - - IReadOnlyDictionary server = servers[index]; - string url = (string)server["url"]; - - if (server.ContainsKey("variables")) - { - // go through each variable and assign a value - foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) - { - - IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); - - if (inputVariables.ContainsKey(variable.Key)) - { - if (!serverVariables.ContainsKey("enum_values") || ((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) - { - url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); - } - else - { - throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); - } - } - else - { - // use default value - url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); - } - } - } - - return url; - } - - /// - /// Gets and Sets the RemoteCertificateValidationCallback - /// - public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } - - #endregion Properties - - #region Methods - - /// - /// Returns a string with essential information for debugging. - /// - public static string ToDebugReport() - { - string report = "C# SDK (Adyen) Debug Report:\n"; - report += " OS: " + System.Environment.OSVersion + "\n"; - report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: 71\n"; - report += " SDK Package Version: 1.0.0\n"; - - return report; - } - - /// - /// Add Api Key Header. - /// - /// Api Key name. - /// Api Key value. - /// - public void AddApiKey(string key, string value) - { - ApiKey[key] = value; - } - - /// - /// Sets the API key prefix. - /// - /// Api Key name. - /// Api Key value. - public void AddApiKeyPrefix(string key, string value) - { - ApiKeyPrefix[key] = value; - } - - #endregion Methods - - #region Static Members - /// - /// Merge configurations. - /// - /// First configuration. - /// Second configuration. - /// Merged configuration. - public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) - { - if (second == null) return first ?? GlobalConfiguration.Instance; - - Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - - foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; - foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; - foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; - - var config = new Configuration - { - ApiKey = apiKey, - ApiKeyPrefix = apiKeyPrefix, - DefaultHeaders = defaultHeaders, - BasePath = second.BasePath ?? first.BasePath, - Timeout = second.Timeout, - Proxy = second.Proxy ?? first.Proxy, - UserAgent = second.UserAgent ?? first.UserAgent, - Username = second.Username ?? first.Username, - Password = second.Password ?? first.Password, - AccessToken = second.AccessToken ?? first.AccessToken, - TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, - DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, - ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, - UseDefaultCredentials = second.UseDefaultCredentials, - RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, - }; - return config; - } - #endregion Static Members - } -} diff --git a/Adyen/Client/CookieContainer.cs b/Adyen/Client/CookieContainer.cs new file mode 100644 index 000000000..b129934b7 --- /dev/null +++ b/Adyen/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Adyen.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/Adyen/Client/OpenAPIDateConverter.cs b/Adyen/Client/DateOnlyJsonConverter.cs similarity index 69% rename from Adyen/Client/OpenAPIDateConverter.cs rename to Adyen/Client/DateOnlyJsonConverter.cs index 58b12396d..0b29c811a 100644 --- a/Adyen/Client/OpenAPIDateConverter.cs +++ b/Adyen/Client/DateOnlyJsonConverter.cs @@ -7,7 +7,10 @@ * Generated by: https://github.com/openapitools/openapi-generator.git */ -using Newtonsoft.Json.Converters; +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; namespace Adyen.Client { @@ -15,15 +18,44 @@ namespace Adyen.Client /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types /// - public class OpenAPIDateConverter : IsoDateTimeConverter + public class DateOnlyJsonConverter : JsonConverter { /// - /// Initializes a new instance of the class. + /// The formats used to deserialize the date /// - public OpenAPIDateConverter() - { - // full-date = date-fullyear "-" date-month "-" date-mday - DateTimeFormat = "yyyy-MM-dd"; + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd", + "yyyyMMdd" + + }; + + /// + /// Returns a DateOnly from the Json object + /// + /// + /// + /// + /// + public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + return result; + + throw new NotSupportedException(); } + + /// + /// Writes the DateOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnly dateOnlyValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateOnlyValue.ToString("yyyy'-'MM'-'dd", CultureInfo.InvariantCulture)); } } diff --git a/Adyen/Client/GlobalConfiguration.cs b/Adyen/Client/DateOnlyNullableJsonConverter.cs similarity index 64% rename from Adyen/Client/GlobalConfiguration.cs rename to Adyen/Client/DateOnlyNullableJsonConverter.cs index 750b307a0..d961cf1a4 100644 --- a/Adyen/Client/GlobalConfiguration.cs +++ b/Adyen/Client/DateOnlyNullableJsonConverter.cs @@ -7,61 +7,60 @@ * Generated by: https://github.com/openapitools/openapi-generator.git */ - -using System.Collections.Generic; +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; namespace Adyen.Client { /// - /// provides a compile-time extension point for globally configuring - /// API Clients. + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types /// - /// - /// A customized implementation via partial class may reside in another file and may - /// be excluded from automatic generation via a .openapi-generator-ignore file. - /// - public partial class GlobalConfiguration : Configuration + public class DateOnlyNullableJsonConverter : JsonConverter { - #region Private Members - - private static readonly object GlobalConfigSync = new { }; - private static IReadableConfiguration _globalConfiguration; + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd", + "yyyyMMdd" - #endregion Private Members + }; - #region Constructors + /// + /// Returns a DateOnly from the Json object + /// + /// + /// + /// + /// + public override DateOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; - /// - private GlobalConfiguration() - { - } + string value = reader.GetString(); - /// - public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) - { - } + foreach(string format in Formats) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + return result; - static GlobalConfiguration() - { - Instance = new GlobalConfiguration(); + throw new NotSupportedException(); } - #endregion Constructors - /// - /// Gets or sets the default Configuration. + /// Writes the DateOnly to the json writer /// - /// Configuration. - public static IReadableConfiguration Instance + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnly? dateOnlyValue, JsonSerializerOptions options) { - get { return _globalConfiguration; } - set - { - lock (GlobalConfigSync) - { - _globalConfiguration = value; - } - } + if (dateOnlyValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateOnlyValue.Value.ToString("yyyy'-'MM'-'dd", CultureInfo.InvariantCulture)); } } } diff --git a/Adyen/Client/RequestOptions.cs b/Adyen/Client/DateTimeJsonConverter.cs similarity index 60% rename from Adyen/Client/RequestOptions.cs rename to Adyen/Client/DateTimeJsonConverter.cs index 7115a3e54..fc9fb7cba 100644 --- a/Adyen/Client/RequestOptions.cs +++ b/Adyen/Client/DateTimeJsonConverter.cs @@ -7,68 +7,69 @@ * Generated by: https://github.com/openapitools/openapi-generator.git */ - using System; -using System.Collections.Generic; -using System.IO; -using System.Net; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; namespace Adyen.Client { /// - /// A container for generalized request inputs. This type allows consumers to extend the request functionality - /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// Formatter for 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types /// - public class RequestOptions + public class DateTimeJsonConverter : JsonConverter { /// - /// Parameters to be bound to path parts of the Request's URL + /// The formats used to deserialize the date /// - public Dictionary PathParameters { get; set; } + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", - /// - /// Query parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap QueryParameters { get; set; } + }; /// - /// Header parameters to be applied to the request. - /// Keys may have 1 or more values associated. + /// Returns a DateTime from the Json object /// - public Multimap HeaderParameters { get; set; } + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); - /// - /// Form parameters to be sent along with the request. - /// - public Dictionary FormParameters { get; set; } - - /// - /// File parameters to be sent along with the request. - /// - public Multimap FileParameters { get; set; } + string value = reader.GetString(); - /// - /// Cookies to be sent along with the request. - /// - public List Cookies { get; set; } + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; - /// - /// Any data associated with a request body. - /// - public Object Data { get; set; } + throw new NotSupportedException(); + } /// - /// Constructs a new instance of + /// Writes the DateTime to the json writer /// - public RequestOptions() - { - PathParameters = new Dictionary(); - QueryParameters = new Multimap(); - HeaderParameters = new Multimap(); - FormParameters = new Dictionary(); - FileParameters = new Multimap(); - Cookies = new List(); - } + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } } diff --git a/Adyen/Client/FileParameter.cs b/Adyen/Client/DateTimeNullableJsonConverter.cs similarity index 59% rename from Adyen/Client/FileParameter.cs rename to Adyen/Client/DateTimeNullableJsonConverter.cs index ce0a041b5..760763765 100644 --- a/Adyen/Client/FileParameter.cs +++ b/Adyen/Client/DateTimeNullableJsonConverter.cs @@ -7,74 +7,74 @@ * Generated by: https://github.com/openapitools/openapi-generator.git */ - -using System.IO; +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; namespace Adyen.Client { - /// - /// Represents a File passed to the API as a Parameter, allows using different backends for files + /// Formatter for 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types /// - public class FileParameter + public class DateTimeNullableJsonConverter : JsonConverter { /// - /// The filename + /// The formats used to deserialize the date /// - public string Name { get; set; } = "no_name_provided"; + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", - /// - /// The content type of the file - /// - public string ContentType { get; set; } = "application/octet-stream"; + }; /// - /// The content of the file + /// Returns a DateTime from the Json object /// - public Stream Content { get; set; } + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; - /// - /// Construct a FileParameter just from the contents, will extract the filename from a filestream - /// - /// The file content - public FileParameter(Stream content) - { - if (content is FileStream fs) - { - Name = fs.Name; - } - Content = content; - } + string value = reader.GetString(); - /// - /// Construct a FileParameter from name and content - /// - /// The filename - /// The file content - public FileParameter(string filename, Stream content) - { - Name = filename; - Content = content; + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; } /// - /// Construct a FileParameter from name and content + /// Writes the DateTime to the json writer /// - /// The filename - /// The content type of the file - /// The file content - public FileParameter(string filename, string contentType, Stream content) + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) { - Name = filename; - ContentType = contentType; - Content = content; + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } - - /// - /// Implicit conversion of stream to file parameter. Useful for backwards compatibility. - /// - /// Stream to convert - /// FileParameter - public static implicit operator FileParameter(Stream s) => new FileParameter(s); } -} \ No newline at end of file +} diff --git a/Adyen/Client/ExceptionEventArgs.cs b/Adyen/Client/ExceptionEventArgs.cs new file mode 100644 index 000000000..0e11b030b --- /dev/null +++ b/Adyen/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Adyen.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExceptionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/Adyen/Client/ExceptionFactory.cs b/Adyen/Client/ExceptionFactory.cs deleted file mode 100644 index 1972886f3..000000000 --- a/Adyen/Client/ExceptionFactory.cs +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; - -namespace Adyen.Client -{ - /// - /// A delegate to ExceptionFactory method - /// - /// Method name - /// Response - /// Exceptions - public delegate Exception ExceptionFactory(string methodName, IApiResponse response); -} diff --git a/Adyen/Client/HostConfiguration.cs b/Adyen/Client/HostConfiguration.cs new file mode 100644 index 000000000..9b2dd7022 --- /dev/null +++ b/Adyen/Client/HostConfiguration.cs @@ -0,0 +1,368 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Adyen.Service.Checkout; +using Adyen.Model.Checkout; + +namespace Adyen.Client +{ + /// + /// Provides hosting configuration for Adyen + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new DateOnlyJsonConverter()); + _jsonOptions.Converters.Add(new DateOnlyNullableJsonConverter()); + _jsonOptions.Converters.Add(new AccountInfoJsonConverter()); + _jsonOptions.Converters.Add(new AcctInfoJsonConverter()); + _jsonOptions.Converters.Add(new AchDetailsJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalData3DSecureJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataAirlineJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataCarRentalJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataCommonJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataLevel23JsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataLodgingJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataOpenInvoiceJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataOpiJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataRatepayJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataRetryJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataRiskJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataRiskStandaloneJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataSubMerchantJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataTemporaryServicesJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalDataWalletsJsonConverter()); + _jsonOptions.Converters.Add(new AddressJsonConverter()); + _jsonOptions.Converters.Add(new AffirmDetailsJsonConverter()); + _jsonOptions.Converters.Add(new AfterpayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new AgencyJsonConverter()); + _jsonOptions.Converters.Add(new AirlineJsonConverter()); + _jsonOptions.Converters.Add(new AmazonPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new AmountJsonConverter()); + _jsonOptions.Converters.Add(new AmountsJsonConverter()); + _jsonOptions.Converters.Add(new AncvDetailsJsonConverter()); + _jsonOptions.Converters.Add(new AndroidPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new ApplePayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new ApplePayDonationsJsonConverter()); + _jsonOptions.Converters.Add(new ApplePaySessionRequestJsonConverter()); + _jsonOptions.Converters.Add(new ApplePaySessionResponseJsonConverter()); + _jsonOptions.Converters.Add(new ApplicationInfoJsonConverter()); + _jsonOptions.Converters.Add(new AuthenticationDataJsonConverter()); + _jsonOptions.Converters.Add(new BacsDirectDebitDetailsJsonConverter()); + _jsonOptions.Converters.Add(new BalanceCheckRequestJsonConverter()); + _jsonOptions.Converters.Add(new BalanceCheckResponseJsonConverter()); + _jsonOptions.Converters.Add(new BillDeskDetailsJsonConverter()); + _jsonOptions.Converters.Add(new BillingAddressJsonConverter()); + _jsonOptions.Converters.Add(new BlikDetailsJsonConverter()); + _jsonOptions.Converters.Add(new BrowserInfoJsonConverter()); + _jsonOptions.Converters.Add(new CancelOrderRequestJsonConverter()); + _jsonOptions.Converters.Add(new CancelOrderResponseJsonConverter()); + _jsonOptions.Converters.Add(new CardBrandDetailsJsonConverter()); + _jsonOptions.Converters.Add(new CardDetailsJsonConverter()); + _jsonOptions.Converters.Add(new CardDetailsRequestJsonConverter()); + _jsonOptions.Converters.Add(new CardDetailsResponseJsonConverter()); + _jsonOptions.Converters.Add(new CardDonationsJsonConverter()); + _jsonOptions.Converters.Add(new CashAppDetailsJsonConverter()); + _jsonOptions.Converters.Add(new CellulantDetailsJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutAwaitActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutBankAccountJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutBankTransferActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutDelegatedAuthenticationActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutNativeRedirectActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutOrderResponseJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutPaymentMethodJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutQrCodeActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutRedirectActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutSDKActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutSessionInstallmentOptionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutSessionThreeDS2RequestDataJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutThreeDS2ActionJsonConverter()); + _jsonOptions.Converters.Add(new CheckoutVoucherActionJsonConverter()); + _jsonOptions.Converters.Add(new CommonFieldJsonConverter()); + _jsonOptions.Converters.Add(new CompanyJsonConverter()); + _jsonOptions.Converters.Add(new CreateCheckoutSessionRequestJsonConverter()); + _jsonOptions.Converters.Add(new CreateCheckoutSessionResponseJsonConverter()); + _jsonOptions.Converters.Add(new CreateOrderRequestJsonConverter()); + _jsonOptions.Converters.Add(new CreateOrderResponseJsonConverter()); + _jsonOptions.Converters.Add(new DefaultErrorResponseEntityJsonConverter()); + _jsonOptions.Converters.Add(new DeliveryAddressJsonConverter()); + _jsonOptions.Converters.Add(new DeliveryMethodJsonConverter()); + _jsonOptions.Converters.Add(new DetailsRequestAuthenticationDataJsonConverter()); + _jsonOptions.Converters.Add(new DeviceRenderOptionsJsonConverter()); + _jsonOptions.Converters.Add(new DokuDetailsJsonConverter()); + _jsonOptions.Converters.Add(new DonationJsonConverter()); + _jsonOptions.Converters.Add(new DonationCampaignJsonConverter()); + _jsonOptions.Converters.Add(new DonationCampaignsRequestJsonConverter()); + _jsonOptions.Converters.Add(new DonationCampaignsResponseJsonConverter()); + _jsonOptions.Converters.Add(new DonationPaymentMethodJsonConverter()); + _jsonOptions.Converters.Add(new DonationPaymentRequestJsonConverter()); + _jsonOptions.Converters.Add(new DonationPaymentResponseJsonConverter()); + _jsonOptions.Converters.Add(new DragonpayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new EBankingFinlandDetailsJsonConverter()); + _jsonOptions.Converters.Add(new EcontextVoucherDetailsJsonConverter()); + _jsonOptions.Converters.Add(new EftDetailsJsonConverter()); + _jsonOptions.Converters.Add(new EncryptedOrderDataJsonConverter()); + _jsonOptions.Converters.Add(new EnhancedSchemeDataJsonConverter()); + _jsonOptions.Converters.Add(new ExternalPlatformJsonConverter()); + _jsonOptions.Converters.Add(new FastlaneDetailsJsonConverter()); + _jsonOptions.Converters.Add(new ForexQuoteJsonConverter()); + _jsonOptions.Converters.Add(new FraudCheckResultJsonConverter()); + _jsonOptions.Converters.Add(new FraudResultJsonConverter()); + _jsonOptions.Converters.Add(new FundOriginJsonConverter()); + _jsonOptions.Converters.Add(new FundRecipientJsonConverter()); + _jsonOptions.Converters.Add(new GenericIssuerPaymentMethodDetailsJsonConverter()); + _jsonOptions.Converters.Add(new GooglePayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new GooglePayDonationsJsonConverter()); + _jsonOptions.Converters.Add(new IdealDetailsJsonConverter()); + _jsonOptions.Converters.Add(new IdealDonationsJsonConverter()); + _jsonOptions.Converters.Add(new InputDetailJsonConverter()); + _jsonOptions.Converters.Add(new InstallmentOptionJsonConverter()); + _jsonOptions.Converters.Add(new InstallmentsJsonConverter()); + _jsonOptions.Converters.Add(new InvalidFieldJsonConverter()); + _jsonOptions.Converters.Add(new ItemJsonConverter()); + _jsonOptions.Converters.Add(new KlarnaDetailsJsonConverter()); + _jsonOptions.Converters.Add(new LegJsonConverter()); + _jsonOptions.Converters.Add(new LineItemJsonConverter()); + _jsonOptions.Converters.Add(new ListStoredPaymentMethodsResponseJsonConverter()); + _jsonOptions.Converters.Add(new MandateJsonConverter()); + _jsonOptions.Converters.Add(new MasterpassDetailsJsonConverter()); + _jsonOptions.Converters.Add(new MbwayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new MerchantDeviceJsonConverter()); + _jsonOptions.Converters.Add(new MerchantRiskIndicatorJsonConverter()); + _jsonOptions.Converters.Add(new MobilePayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new MolPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new NameJsonConverter()); + _jsonOptions.Converters.Add(new OpenInvoiceDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PassengerJsonConverter()); + _jsonOptions.Converters.Add(new PayByBankAISDirectDebitDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayByBankDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayPalDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayToDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayToPaymentMethodJsonConverter()); + _jsonOptions.Converters.Add(new PayUUpiDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayWithGoogleDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PayWithGoogleDonationsJsonConverter()); + _jsonOptions.Converters.Add(new PaymentJsonConverter()); + _jsonOptions.Converters.Add(new PaymentAmountUpdateRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentAmountUpdateResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentCancelRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentCancelResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentCaptureRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentCaptureResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentCompletionDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PaymentDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PaymentDetailsRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentDetailsResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentLinkRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentLinkResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodGroupJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodIssuerJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodToStoreJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodUPIAppsJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodsRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentMethodsResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentRefundRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentRefundResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaymentResponseActionJsonConverter()); + _jsonOptions.Converters.Add(new PaymentReversalRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaymentReversalResponseJsonConverter()); + _jsonOptions.Converters.Add(new PaypalUpdateOrderRequestJsonConverter()); + _jsonOptions.Converters.Add(new PaypalUpdateOrderResponseJsonConverter()); + _jsonOptions.Converters.Add(new PhoneJsonConverter()); + _jsonOptions.Converters.Add(new PixDetailsJsonConverter()); + _jsonOptions.Converters.Add(new PixRecurringJsonConverter()); + _jsonOptions.Converters.Add(new PlatformChargebackLogicJsonConverter()); + _jsonOptions.Converters.Add(new PseDetailsJsonConverter()); + _jsonOptions.Converters.Add(new RakutenPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new RatepayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new RecurringJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalData3DSecureJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataBillingAddressJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataCardJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataCommonJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataDomesticErrorJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataInstallmentsJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataNetworkTokensJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataOpiJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataSepaJsonConverter()); + _jsonOptions.Converters.Add(new ResponseAdditionalDataSwishJsonConverter()); + _jsonOptions.Converters.Add(new ResponsePaymentMethodJsonConverter()); + _jsonOptions.Converters.Add(new ResultJsonConverter()); + _jsonOptions.Converters.Add(new ResultNullableJsonConverter()); + _jsonOptions.Converters.Add(new RiskDataJsonConverter()); + _jsonOptions.Converters.Add(new RivertyDetailsJsonConverter()); + _jsonOptions.Converters.Add(new SDKEphemPubKeyJsonConverter()); + _jsonOptions.Converters.Add(new SamsungPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new SepaDirectDebitDetailsJsonConverter()); + _jsonOptions.Converters.Add(new ServiceErrorJsonConverter()); + _jsonOptions.Converters.Add(new SessionResultResponseJsonConverter()); + _jsonOptions.Converters.Add(new ShopperIdPaymentMethodJsonConverter()); + _jsonOptions.Converters.Add(new ShopperInteractionDeviceJsonConverter()); + _jsonOptions.Converters.Add(new ShopperNameJsonConverter()); + _jsonOptions.Converters.Add(new SplitJsonConverter()); + _jsonOptions.Converters.Add(new SplitAmountJsonConverter()); + _jsonOptions.Converters.Add(new StandalonePaymentCancelRequestJsonConverter()); + _jsonOptions.Converters.Add(new StandalonePaymentCancelResponseJsonConverter()); + _jsonOptions.Converters.Add(new StoredPaymentMethodJsonConverter()); + _jsonOptions.Converters.Add(new StoredPaymentMethodDetailsJsonConverter()); + _jsonOptions.Converters.Add(new StoredPaymentMethodRequestJsonConverter()); + _jsonOptions.Converters.Add(new StoredPaymentMethodResourceJsonConverter()); + _jsonOptions.Converters.Add(new SubInputDetailJsonConverter()); + _jsonOptions.Converters.Add(new SubMerchantJsonConverter()); + _jsonOptions.Converters.Add(new SubMerchantInfoJsonConverter()); + _jsonOptions.Converters.Add(new SurchargeJsonConverter()); + _jsonOptions.Converters.Add(new TaxTotalJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDS2RequestDataJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDS2RequestFieldsJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDS2ResponseDataJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDS2ResultJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDSRequestDataJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDSRequestorAuthenticationInfoJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDSRequestorPriorAuthenticationInfoJsonConverter()); + _jsonOptions.Converters.Add(new ThreeDSecureDataJsonConverter()); + _jsonOptions.Converters.Add(new TicketJsonConverter()); + _jsonOptions.Converters.Add(new TravelAgencyJsonConverter()); + _jsonOptions.Converters.Add(new TwintDetailsJsonConverter()); + _jsonOptions.Converters.Add(new UPIPaymentMethodJsonConverter()); + _jsonOptions.Converters.Add(new UpdatePaymentLinkRequestJsonConverter()); + _jsonOptions.Converters.Add(new UpiCollectDetailsJsonConverter()); + _jsonOptions.Converters.Add(new UpiIntentDetailsJsonConverter()); + _jsonOptions.Converters.Add(new UpiQrDetailsJsonConverter()); + _jsonOptions.Converters.Add(new UtilityRequestJsonConverter()); + _jsonOptions.Converters.Add(new UtilityResponseJsonConverter()); + _jsonOptions.Converters.Add(new ValidateShopperIdRequestJsonConverter()); + _jsonOptions.Converters.Add(new ValidateShopperIdResponseJsonConverter()); + _jsonOptions.Converters.Add(new VippsDetailsJsonConverter()); + _jsonOptions.Converters.Add(new VisaCheckoutDetailsJsonConverter()); + _jsonOptions.Converters.Add(new WeChatPayDetailsJsonConverter()); + _jsonOptions.Converters.Add(new WeChatPayMiniProgramDetailsJsonConverter()); + _jsonOptions.Converters.Add(new ZipDetailsJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddSingleton(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/Adyen/Client/IApi.cs b/Adyen/Client/IApi.cs new file mode 100644 index 000000000..d2a7ed09f --- /dev/null +++ b/Adyen/Client/IApi.cs @@ -0,0 +1,13 @@ +namespace Adyen.Client +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + System.Net.Http.HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/Adyen/Client/IAsynchronousClient.cs b/Adyen/Client/IAsynchronousClient.cs deleted file mode 100644 index 132c981cf..000000000 --- a/Adyen/Client/IAsynchronousClient.cs +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Threading.Tasks; - -namespace Adyen.Client -{ - /// - /// Contract for Asynchronous RESTful API interactions. - /// - /// This interface allows consumers to provide a custom API accessor client. - /// - public interface IAsynchronousClient - { - /// - /// Executes a non-blocking call to some using the GET http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Executes a non-blocking call to some using the POST http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Executes a non-blocking call to some using the PUT http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Executes a non-blocking call to some using the DELETE http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Executes a non-blocking call to some using the HEAD http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Executes a non-blocking call to some using the OPTIONS http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Executes a non-blocking call to some using the PATCH http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - } -} diff --git a/Adyen/Client/IReadableConfiguration.cs b/Adyen/Client/IReadableConfiguration.cs deleted file mode 100644 index 68b0b98de..000000000 --- a/Adyen/Client/IReadableConfiguration.cs +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Security; -using System.Security.Cryptography.X509Certificates; - -namespace Adyen.Client -{ - /// - /// Represents a readable-only configuration contract. - /// - public interface IReadableConfiguration - { - /// - /// Gets the access token. - /// - /// Access token. - string AccessToken { get; } - - /// - /// Gets the API key. - /// - /// API key. - IDictionary ApiKey { get; } - - /// - /// Gets the API key prefix. - /// - /// API key prefix. - IDictionary ApiKeyPrefix { get; } - - /// - /// Gets the base path. - /// - /// Base path. - string BasePath { get; } - - /// - /// Gets the date time format. - /// - /// Date time format. - string DateTimeFormat { get; } - - /// - /// Gets the default header. - /// - /// Default header. - [Obsolete("Use DefaultHeaders instead.")] - IDictionary DefaultHeader { get; } - - /// - /// Gets the default headers. - /// - /// Default headers. - IDictionary DefaultHeaders { get; } - - /// - /// Gets the temp folder path. - /// - /// Temp folder path. - string TempFolderPath { get; } - - /// - /// Gets the HTTP connection timeout. - /// - /// HTTP connection timeout. - TimeSpan Timeout { get; } - - /// - /// Gets the proxy. - /// - /// Proxy. - WebProxy Proxy { get; } - - /// - /// Gets the user agent. - /// - /// User agent. - string UserAgent { get; } - - /// - /// Gets the username. - /// - /// Username. - string Username { get; } - - /// - /// Gets the password. - /// - /// Password. - string Password { get; } - - /// - /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. - /// - bool UseDefaultCredentials { get; } - - /// - /// Get the servers associated with the operation. - /// - /// Operation servers. - IReadOnlyDictionary>> OperationServers { get; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - string GetApiKeyWithPrefix(string apiKeyIdentifier); - - /// - /// Gets the Operation server url at the provided index. - /// - /// Operation server name. - /// Index of the operation server settings. - /// - string GetOperationServerUrl(string operation, int index); - - /// - /// Gets certificate collection to be sent with requests. - /// - /// X509 Certificate collection. - X509CertificateCollection ClientCertificates { get; } - - /// - /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and - /// overriding certificate errors in the scope of a request. - /// - RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } - } -} diff --git a/Adyen/Client/ISynchronousClient.cs b/Adyen/Client/ISynchronousClient.cs deleted file mode 100644 index 3618816a4..000000000 --- a/Adyen/Client/ISynchronousClient.cs +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.IO; - -namespace Adyen.Client -{ - /// - /// Contract for Synchronous RESTful API interactions. - /// - /// This interface allows consumers to provide a custom API accessor client. - /// - public interface ISynchronousClient - { - /// - /// Executes a blocking call to some using the GET http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the POST http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the PUT http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the DELETE http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the HEAD http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the OPTIONS http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the PATCH http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); - } -} diff --git a/Adyen/Client/JsonSerializerOptionsProvider.cs b/Adyen/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 000000000..fd7fbd8fc --- /dev/null +++ b/Adyen/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Adyen.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/Adyen/Client/Multimap.cs b/Adyen/Client/Multimap.cs deleted file mode 100644 index 40365e9f0..000000000 --- a/Adyen/Client/Multimap.cs +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections; -using System.Collections.Generic; - -namespace Adyen.Client -{ - /// - /// A dictionary in which one key has many associated values. - /// - /// The type of the key - /// The type of the value associated with the key. - public class Multimap : IDictionary> - { - #region Private Fields - - private readonly Dictionary> _dictionary; - - #endregion Private Fields - - #region Constructors - - /// - /// Empty Constructor. - /// - public Multimap() - { - _dictionary = new Dictionary>(); - } - - /// - /// Constructor with comparer. - /// - /// - public Multimap(IEqualityComparer comparer) - { - _dictionary = new Dictionary>(comparer); - } - - #endregion Constructors - - #region Enumerators - - /// - /// To get the enumerator. - /// - /// Enumerator - public IEnumerator>> GetEnumerator() - { - return _dictionary.GetEnumerator(); - } - - /// - /// To get the enumerator. - /// - /// Enumerator - IEnumerator IEnumerable.GetEnumerator() - { - return _dictionary.GetEnumerator(); - } - - #endregion Enumerators - - #region Public Members - /// - /// Add values to Multimap - /// - /// Key value pair - public void Add(KeyValuePair> item) - { - if (!TryAdd(item.Key, item.Value)) - throw new InvalidOperationException("Could not add values to Multimap."); - } - - /// - /// Add Multimap to Multimap - /// - /// Multimap - public void Add(Multimap multimap) - { - foreach (var item in multimap) - { - if (!TryAdd(item.Key, item.Value)) - throw new InvalidOperationException("Could not add values to Multimap."); - } - } - - /// - /// Clear Multimap - /// - public void Clear() - { - _dictionary.Clear(); - } - - /// - /// Determines whether Multimap contains the specified item. - /// - /// Key value pair - /// Method needs to be implemented - /// true if the Multimap contains the item; otherwise, false. - public bool Contains(KeyValuePair> item) - { - throw new NotImplementedException(); - } - - /// - /// Copy items of the Multimap to an array, - /// starting at a particular array index. - /// - /// The array that is the destination of the items copied - /// from Multimap. The array must have zero-based indexing. - /// The zero-based index in array at which copying begins. - /// Method needs to be implemented - public void CopyTo(KeyValuePair>[] array, int arrayIndex) - { - throw new NotImplementedException(); - } - - /// - /// Removes the specified item from the Multimap. - /// - /// Key value pair - /// true if the item is successfully removed; otherwise, false. - /// Method needs to be implemented - public bool Remove(KeyValuePair> item) - { - throw new NotImplementedException(); - } - - /// - /// Gets the number of items contained in the Multimap. - /// - public int Count => _dictionary.Count; - - /// - /// Gets a value indicating whether the Multimap is read-only. - /// - public bool IsReadOnly => false; - - /// - /// Adds an item with the provided key and value to the Multimap. - /// - /// The object to use as the key of the item to add. - /// The object to use as the value of the item to add. - /// Thrown when couldn't add the value to Multimap. - public void Add(TKey key, IList value) - { - if (value != null && value.Count > 0) - { - if (_dictionary.TryGetValue(key, out var list)) - { - foreach (var k in value) list.Add(k); - } - else - { - list = new List(value); - if (!TryAdd(key, list)) - throw new InvalidOperationException("Could not add values to Multimap."); - } - } - } - - /// - /// Determines whether the Multimap contains an item with the specified key. - /// - /// The key to locate in the Multimap. - /// true if the Multimap contains an item with - /// the key; otherwise, false. - public bool ContainsKey(TKey key) - { - return _dictionary.ContainsKey(key); - } - - /// - /// Removes item with the specified key from the Multimap. - /// - /// The key to locate in the Multimap. - /// true if the item is successfully removed; otherwise, false. - public bool Remove(TKey key) - { - return TryRemove(key, out var _); - } - - /// - /// Gets the value associated with the specified key. - /// - /// The key whose value to get. - /// When this method returns, the value associated with the specified key, if the - /// key is found; otherwise, the default value for the type of the value parameter. - /// This parameter is passed uninitialized. - /// true if the object that implements Multimap contains - /// an item with the specified key; otherwise, false. - public bool TryGetValue(TKey key, out IList value) - { - return _dictionary.TryGetValue(key, out value); - } - - /// - /// Gets or sets the item with the specified key. - /// - /// The key of the item to get or set. - /// The value of the specified key. - public IList this[TKey key] - { - get => _dictionary[key]; - set => _dictionary[key] = value; - } - - /// - /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. - /// - public ICollection Keys => _dictionary.Keys; - - /// - /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. - /// - public ICollection> Values => _dictionary.Values; - - /// - /// Copy the items of the Multimap to an System.Array, - /// starting at a particular System.Array index. - /// - /// The one-dimensional System.Array that is the destination of the items copied - /// from Multimap. The System.Array must have zero-based indexing. - /// The zero-based index in array at which copying begins. - public void CopyTo(Array array, int index) - { - ((ICollection)_dictionary).CopyTo(array, index); - } - - /// - /// Adds an item with the provided key and value to the Multimap. - /// - /// The object to use as the key of the item to add. - /// The object to use as the value of the item to add. - /// Thrown when couldn't add value to Multimap. - public void Add(TKey key, TValue value) - { - if (value != null) - { - if (_dictionary.TryGetValue(key, out var list)) - { - list.Add(value); - } - else - { - list = new List { value }; - if (!TryAdd(key, list)) - throw new InvalidOperationException("Could not add value to Multimap."); - } - } - } - - #endregion Public Members - - #region Private Members - - /** - * Helper method to encapsulate generator differences between dictionary types. - */ - private bool TryRemove(TKey key, out IList value) - { - _dictionary.TryGetValue(key, out value); - return _dictionary.Remove(key); - } - - /** - * Helper method to encapsulate generator differences between dictionary types. - */ - private bool TryAdd(TKey key, IList value) - { - try - { - _dictionary.Add(key, value); - } - catch (ArgumentException) - { - return false; - } - - return true; - } - #endregion Private Members - } -} diff --git a/Adyen/Client/RetryConfiguration.cs b/Adyen/Client/Option.cs similarity index 77% rename from Adyen/Client/RetryConfiguration.cs rename to Adyen/Client/Option.cs index ee57693e4..50ca397e8 100644 --- a/Adyen/Client/RetryConfiguration.cs +++ b/Adyen/Client/Option.cs @@ -1,3 +1,4 @@ +// /* * Adyen Checkout API * @@ -8,24 +9,43 @@ */ -using Polly; -using System.Net.Http; - namespace Adyen.Client { /// - /// Configuration class to set the polly retry policies to be applied to the requests. + /// A wrapper for operation parameters which are not required /// - public static class RetryConfiguration + public struct Option { /// - /// Retry policy + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type /// - public static ISyncPolicy RetryPolicy { get; set; } + /// + public static implicit operator TType(Option option) => option.Value; /// - /// Async retry policy + /// Implicitly converts the provided value to an Option /// - public static IAsyncPolicy AsyncRetryPolicy { get; set; } + /// + public static implicit operator Option(TType value) => new Option(value); } -} +} \ No newline at end of file diff --git a/Adyen/Client/WebRequestPathBuilder.cs b/Adyen/Client/RateLimitProvider.cs similarity index 53% rename from Adyen/Client/WebRequestPathBuilder.cs rename to Adyen/Client/RateLimitProvider.cs index e9868cd1c..9733b9684 100644 --- a/Adyen/Client/WebRequestPathBuilder.cs +++ b/Adyen/Client/RateLimitProvider.cs @@ -1,3 +1,4 @@ +// /* * Adyen Checkout API * @@ -9,45 +10,73 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Adyen.Client { /// - /// A URI builder + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. /// - class WebRequestPathBuilder + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - private string _baseUrl; - private string _path; - private string _query = "?"; - public WebRequestPathBuilder(string baseUrl, string path) - { - _baseUrl = baseUrl; - _path = path; - } + internal Dictionary> AvailableTokens { get; } = new(); - public void AddPathParameters(Dictionary parameters) + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + if (container is TokenContainer apiKeyTokenContainer) { - foreach (var parameter in parameters) + string[] headers = apiKeyTokenContainer.Tokens.Select(t => ClientUtils.ApiKeyHeaderToString(t.Header)).Distinct().ToArray(); + + foreach (string header in headers) { - _path = _path.Replace("{" + parameter.Key + "}", Uri.EscapeDataString(parameter.Value)); + global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) + { + FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(header, global::System.Threading.Channels.Channel.CreateBounded(options)); } } - - public void AddQueryParameters(Multimap parameters) + else { - foreach (var parameter in parameters) + global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length) + { + FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded(options)); + } + + foreach (var availableToken in AvailableTokens) + foreach(TTokenBase token in _tokens) { - foreach (var value in parameter.Value) + if (token is ApiKeyToken apiKeyToken) + { + if (ClientUtils.ApiKeyHeaderToString(apiKeyToken.Header) == availableToken.Key) + { + token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); + } + } else { - _query = _query + parameter.Key + "=" + Uri.EscapeDataString(value) + "&"; + token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); } } - } + } - public string GetFullUri() - { - return _baseUrl + _path + _query.Substring(0, _query.Length - 1); - } + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } } } diff --git a/Adyen/Client/TokenBase.cs b/Adyen/Client/TokenBase.cs new file mode 100644 index 000000000..79ed6dfda --- /dev/null +++ b/Adyen/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Adyen.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/Adyen/Client/TokenContainer.cs b/Adyen/Client/TokenContainer.cs new file mode 100644 index 000000000..a9f3d167f --- /dev/null +++ b/Adyen/Client/TokenContainer.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Adyen.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(global::System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/Adyen/Client/IApiAccessor.cs b/Adyen/Client/TokenProvider.cs similarity index 81% rename from Adyen/Client/IApiAccessor.cs rename to Adyen/Client/TokenProvider.cs index d56027af2..f9374378f 100644 --- a/Adyen/Client/IApiAccessor.cs +++ b/Adyen/Client/TokenProvider.cs @@ -1,3 +1,4 @@ +// /* * Adyen Checkout API * @@ -7,31 +8,35 @@ * Generated by: https://github.com/openapitools/openapi-generator.git */ - using System; +using System.Linq; +using System.Collections.Generic; +using Adyen.Client; -namespace Adyen.Client +namespace Adyen { /// - /// Represents configuration aspects required to interact with the API endpoints. + /// A class which will provide tokens. /// - public interface IApiAccessor + public abstract class TokenProvider where TTokenBase : TokenBase { /// - /// Gets or sets the configuration object + /// The array of tokens. /// - /// An instance of the Configuration - IReadableConfiguration Configuration { get; set; } + protected TTokenBase[] _tokens; - /// - /// Gets the base path of the API client. - /// - /// The base path - string GetBasePath(); + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); /// - /// Provides a factory method hook for the creation of exceptions. + /// Instantiates a TokenProvider. /// - ExceptionFactory ExceptionFactory { get; set; } + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } } -} +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/IApi.mustache b/templates-v7/csharp/libraries/generichost/IApi.mustache index af31cffe9..3f3f3013b 100644 --- a/templates-v7/csharp/libraries/generichost/IApi.mustache +++ b/templates-v7/csharp/libraries/generichost/IApi.mustache @@ -10,6 +10,6 @@ namespace {{packageName}}.{{apiPackage}} /// /// The HttpClient /// - HttpClient HttpClient { get; } + System.Net.Http.HttpClient HttpClient { get; } } } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 2ebe38a29..ab786c068 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -171,7 +171,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// The HttpClient /// - public HttpClient HttpClient { get; } + public System.Net.Http.HttpClient HttpClient { get; } /// /// The class containing the events @@ -220,7 +220,7 @@ namespace {{packageName}}.{{apiPackage}} /// Initializes a new instance of the class. /// /// - public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, + public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}, TokenProvider basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}, From 03173274f3b701ca1ceedb6116ede02d1527d965 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 26 Sep 2025 14:25:33 +0200 Subject: [PATCH 017/126] Add dependencies: Microsoft.Extension.Hosting & Polly.Extensions.Http Add extensions Fix templates (wrong copy) --- Adyen/Adyen.csproj | 7 ++++--- Adyen/Client/ApiFactory.cs | 4 ++-- Adyen/Client/IAdyenApiService.cs | 13 +++++++++++++ Adyen/Client/IApi.cs | 13 ------------- .../libraries/generichost/ApiFactory.mustache | 4 ++-- .../generichost/IAdyenApiService.mustache | 13 +++++++++++++ .../csharp/libraries/generichost/IApi.mustache | 15 --------------- .../IServiceCollectionExtensions.mustache | 12 ++++++------ .../csharp/libraries/generichost/api.mustache | 2 +- 9 files changed, 41 insertions(+), 42 deletions(-) create mode 100644 Adyen/Client/IAdyenApiService.cs delete mode 100644 Adyen/Client/IApi.cs create mode 100644 templates-v7/csharp/libraries/generichost/IAdyenApiService.mustache delete mode 100644 templates-v7/csharp/libraries/generichost/IApi.mustache diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index 8a5204a4f..b6d4ba385 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -35,12 +35,13 @@ - - + + + - + diff --git a/Adyen/Client/ApiFactory.cs b/Adyen/Client/ApiFactory.cs index 24e5a92d9..f36fb244f 100644 --- a/Adyen/Client/ApiFactory.cs +++ b/Adyen/Client/ApiFactory.cs @@ -14,7 +14,7 @@ public interface IApiFactory /// /// /// - IResult Create() where IResult : IApi; + IResult Create() where IResult : IAdyenApiService; } /// @@ -41,7 +41,7 @@ public ApiFactory(IServiceProvider services) /// /// /// - public IResult Create() where IResult : IApi + public IResult Create() where IResult : IAdyenApiService { return Services.GetRequiredService(); } diff --git a/Adyen/Client/IAdyenApiService.cs b/Adyen/Client/IAdyenApiService.cs new file mode 100644 index 000000000..4a73f31b1 --- /dev/null +++ b/Adyen/Client/IAdyenApiService.cs @@ -0,0 +1,13 @@ +namespace Adyen.Client +{ + /// + /// Interface for interacting with any Adyen API using . + /// + public interface IAdyenApiService + { + /// + /// The object, preferably instantiated and managed using the . + /// + System.Net.Http.HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/Adyen/Client/IApi.cs b/Adyen/Client/IApi.cs deleted file mode 100644 index d2a7ed09f..000000000 --- a/Adyen/Client/IApi.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Adyen.Client -{ - /// - /// Any Api client - /// - public interface IApi - { - /// - /// The HttpClient - /// - System.Net.Http.HttpClient HttpClient { get; } - } -} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ApiFactory.mustache b/templates-v7/csharp/libraries/generichost/ApiFactory.mustache index a445d2169..def73ec18 100644 --- a/templates-v7/csharp/libraries/generichost/ApiFactory.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiFactory.mustache @@ -14,7 +14,7 @@ namespace {{packageName}}.{{clientPackage}} /// /// /// - IResult Create() where IResult : IApi; + IResult Create() where IResult : I{{packageName}}Service; } /// @@ -41,7 +41,7 @@ namespace {{packageName}}.{{clientPackage}} /// /// /// - public IResult Create() where IResult : IApi + public IResult Create() where IResult : I{{packageName}}Service { return Services.GetRequiredService(); } diff --git a/templates-v7/csharp/libraries/generichost/IAdyenApiService.mustache b/templates-v7/csharp/libraries/generichost/IAdyenApiService.mustache new file mode 100644 index 000000000..500c3b870 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/IAdyenApiService.mustache @@ -0,0 +1,13 @@ +namespace {{packageName}}.{{apiPackage}} +{ + /// + /// Interface for interacting with any {{packageName}} API using . + /// + {{>visibility}} interface {{interfacePrefix}}{{apiName}}Service + { + /// + /// The object, preferably instantiated and managed using the . + /// + System.Net.Http.HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/IApi.mustache b/templates-v7/csharp/libraries/generichost/IApi.mustache deleted file mode 100644 index 3f3f3013b..000000000 --- a/templates-v7/csharp/libraries/generichost/IApi.mustache +++ /dev/null @@ -1,15 +0,0 @@ -using System.Net.Http; - -namespace {{packageName}}.{{apiPackage}} -{ - /// - /// Any Api client - /// - {{>visibility}} interface {{interfacePrefix}}Api - { - /// - /// The HttpClient - /// - System.Net.Http.HttpClient HttpClient { get; } - } -} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index 14184ac4a..d2c7d2f54 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -17,29 +17,29 @@ namespace {{packageName}}.Extensions { {{^hasAuthMethods}} /// - /// Add the api to your host builder. + /// Add the {{packageName}} {{apiName}} API services to your host builder. /// /// - public static void Add{{apiName}}(this IServiceCollection services) + public static void Add{{apiName}}Services(this IServiceCollection services) { HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); - Add{{apiName}}(services, config); + Add{{apiName}}Services(services, config); } {{/hasAuthMethods}} /// - /// Add the api to your host builder. + /// Add the {{packageName}} {{apiName}} API services to your host builder. /// /// /// - public static void Add{{apiName}}(this IServiceCollection services, Action options) + public static void Add{{apiName}}Services(this IServiceCollection services, Action options) { HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); options(config); Add{{apiName}}(services, config); } - internal static void Add{{apiName}}(IServiceCollection services, HostConfiguration host) + internal static void Add{{apiName}}Services(IServiceCollection services, HostConfiguration host) { if (!host.HttpClientsAdded) host.Add{{apiName}}HttpClients(); diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index ab786c068..60e243f15 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -40,7 +40,7 @@ namespace {{packageName}}.{{apiPackage}} /// Represents a collection of functions to interact with the API endpoints /// This class is registered as transient. /// - {{>visibility}} interface {{interfacePrefix}}{{classname}} : IApi + {{>visibility}} interface {{interfacePrefix}}{{classname}} : I{{packageName}}ApiService { /// /// The class containing the events From f75e894c5c79278c5e256e364ed5ae1fd8898688 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 26 Sep 2025 14:49:07 +0200 Subject: [PATCH 018/126] fix templates --- .../csharp/libraries/generichost/HostConfiguration.mustache | 4 +--- .../libraries/generichost/IHostBuilderExtensions.mustache | 4 ++-- .../generichost/IServiceCollectionExtensions.mustache | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 03dd95e59..837de1dc5 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -89,9 +89,7 @@ namespace {{packageName}}.{{clientPackage}} /// /// /// - public HostConfiguration Add{{apiName}}HttpClients - ( - Action{{nrt?}} client = null, Action{{nrt?}} builder = null) + public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} client = null, Action{{nrt?}} builder = null) { if (client == null) client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); diff --git a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache index 948f06648..5361f06f5 100644 --- a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache @@ -26,7 +26,7 @@ namespace {{packageName}}.Extensions { HostConfiguration config = new HostConfiguration(services); - IServiceCollectionExtensions.Add{{apiName}}(services, config); + IServiceCollectionExtensions.Add{{apiName}}Services(services, config); }); return builder; @@ -46,7 +46,7 @@ namespace {{packageName}}.Extensions options(context, services, config); - IServiceCollectionExtensions.Add{{apiName}}(services, config); + IServiceCollectionExtensions.Add{{apiName}}Services(services, config); }); return builder; diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index d2c7d2f54..d00d3ddff 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -36,7 +36,7 @@ namespace {{packageName}}.Extensions { HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); options(config); - Add{{apiName}}(services, config); + Add{{apiName}}Services(services, config); } internal static void Add{{apiName}}Services(IServiceCollection services, HostConfiguration host) From 0c09953ddc816df9098aa263fcbbb40445d817ef Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 26 Sep 2025 14:49:28 +0200 Subject: [PATCH 019/126] Remove IAPI --- Adyen/Extensions/IHostBuilderExtensions.cs | 43 ++++++++++ .../IHttpClientBuilderExtensions.cs | 79 +++++++++++++++++++ .../IServiceCollectionExtensions.cs | 63 +++++++++++++++ Adyen/Service/Checkout/IApi.cs | 15 ---- 4 files changed, 185 insertions(+), 15 deletions(-) create mode 100644 Adyen/Extensions/IHostBuilderExtensions.cs create mode 100644 Adyen/Extensions/IHttpClientBuilderExtensions.cs create mode 100644 Adyen/Extensions/IServiceCollectionExtensions.cs delete mode 100644 Adyen/Service/Checkout/IApi.cs diff --git a/Adyen/Extensions/IHostBuilderExtensions.cs b/Adyen/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 000000000..1d8f957a1 --- /dev/null +++ b/Adyen/Extensions/IHostBuilderExtensions.cs @@ -0,0 +1,43 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Adyen.Client; + +namespace Adyen.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureCheckoutApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddCheckoutApiServices(services, config); + }); + + return builder; + } + } +} diff --git a/Adyen/Extensions/IHttpClientBuilderExtensions.cs b/Adyen/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 000000000..c26c5fd90 --- /dev/null +++ b/Adyen/Extensions/IHttpClientBuilderExtensions.cs @@ -0,0 +1,79 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Adyen.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/Adyen/Extensions/IServiceCollectionExtensions.cs b/Adyen/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 000000000..0592bb733 --- /dev/null +++ b/Adyen/Extensions/IServiceCollectionExtensions.cs @@ -0,0 +1,63 @@ +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Adyen.Client; + +namespace Adyen.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the Adyen CheckoutApi API services to your host builder. + /// + /// + /// + public static void AddCheckoutApiServices(this IServiceCollection services, Action options) + { + HostConfiguration config = new(services); + options(config); + AddCheckoutApiServices(services, config); + } + + internal static void AddCheckoutApiServices(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddCheckoutApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/Adyen/Service/Checkout/IApi.cs b/Adyen/Service/Checkout/IApi.cs deleted file mode 100644 index 929f1eeab..000000000 --- a/Adyen/Service/Checkout/IApi.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Net.Http; - -namespace Adyen.Service.Checkout -{ - /// - /// Any Api client - /// - public interface IApi - { - /// - /// The HttpClient - /// - System.Net.Http.HttpClient HttpClient { get; } - } -} \ No newline at end of file From 40e6cb6ec571a89fc362ef46ed045f1e64a3c439 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 26 Sep 2025 14:57:10 +0200 Subject: [PATCH 020/126] Revert models --- Adyen/Client/ApiException.cs | 50 - Adyen/Client/ApiFactory.cs | 49 - Adyen/Client/ApiKeyToken.cs | 52 - Adyen/Client/ApiResponse.cs | 324 -- Adyen/Client/ApiResponseEventArgs.cs | 24 - Adyen/Client/BasicToken.cs | 42 - Adyen/Client/ClientUtils.cs | 728 ---- Adyen/Client/CookieContainer.cs | 18 - Adyen/Client/DateOnlyJsonConverter.cs | 61 - Adyen/Client/DateOnlyNullableJsonConverter.cs | 66 - Adyen/Client/DateTimeJsonConverter.cs | 75 - Adyen/Client/DateTimeNullableJsonConverter.cs | 80 - Adyen/Client/ExceptionEventArgs.cs | 24 - Adyen/Client/HostConfiguration.cs | 368 -- Adyen/Client/IAdyenApiService.cs | 13 - Adyen/Client/JsonSerializerOptionsProvider.cs | 25 - Adyen/Client/Option.cs | 51 - Adyen/Client/RateLimitProvider.cs | 82 - Adyen/Client/TokenBase.cs | 69 - Adyen/Client/TokenContainer.cs | 35 - Adyen/Client/TokenProvider.cs | 42 - Adyen/Extensions/IHostBuilderExtensions.cs | 43 - .../IHttpClientBuilderExtensions.cs | 79 - .../IServiceCollectionExtensions.cs | 63 - .../AuthenticationNotificationData.cs | 12 +- .../BalancePlatformNotificationResponse.cs | 6 +- Adyen/Model/AcsWebhooks/PurchaseInfo.cs | 12 +- .../RelayedAuthenticationRequest.cs | 89 +- Adyen/Model/AcsWebhooks/Resource.cs | 6 +- .../BalancePlatform/VerificationError.cs | 15 +- .../VerificationErrorRecursive.cs | 16 +- Adyen/Model/Checkout/AbstractOpenAPISchema.cs | 81 + Adyen/Model/Checkout/AccountInfo.cs | 1241 ++---- Adyen/Model/Checkout/AcctInfo.cs | 1205 ++---- Adyen/Model/Checkout/AchDetails.cs | 780 ++-- .../Model/Checkout/AdditionalData3DSecure.cs | 437 +-- Adyen/Model/Checkout/AdditionalDataAirline.cs | 1210 +++--- .../Model/Checkout/AdditionalDataCarRental.cs | 980 ++--- Adyen/Model/Checkout/AdditionalDataCommon.cs | 960 ++--- Adyen/Model/Checkout/AdditionalDataLevel23.cs | 758 ++-- Adyen/Model/Checkout/AdditionalDataLodging.cs | 758 ++-- .../Checkout/AdditionalDataOpenInvoice.cs | 795 ++-- Adyen/Model/Checkout/AdditionalDataOpi.cs | 166 +- Adyen/Model/Checkout/AdditionalDataRatepay.cs | 425 +- Adyen/Model/Checkout/AdditionalDataRetry.cs | 240 +- Adyen/Model/Checkout/AdditionalDataRisk.cs | 906 ++--- .../Checkout/AdditionalDataRiskStandalone.cs | 684 ++-- .../Checkout/AdditionalDataSubMerchant.cs | 577 +-- .../AdditionalDataTemporaryServices.cs | 462 +-- Adyen/Model/Checkout/AdditionalDataWallets.cs | 351 +- Adyen/Model/Checkout/Address.cs | 363 +- Adyen/Model/Checkout/AffirmDetails.cs | 246 +- Adyen/Model/Checkout/AfterpayDetails.cs | 472 +-- Adyen/Model/Checkout/Agency.cs | 203 +- Adyen/Model/Checkout/Airline.cs | 627 ++- Adyen/Model/Checkout/AmazonPayDetails.cs | 320 +- Adyen/Model/Checkout/Amount.cs | 210 +- Adyen/Model/Checkout/Amounts.cs | 197 +- Adyen/Model/Checkout/AncvDetails.cs | 369 +- Adyen/Model/Checkout/AndroidPayDetails.cs | 246 +- Adyen/Model/Checkout/ApplePayDetails.cs | 460 +-- Adyen/Model/Checkout/ApplePayDonations.cs | 460 +-- .../Model/Checkout/ApplePaySessionRequest.cs | 234 +- .../Model/Checkout/ApplePaySessionResponse.cs | 164 +- Adyen/Model/Checkout/ApplicationInfo.cs | 370 +- Adyen/Model/Checkout/AuthenticationData.cs | 294 +- .../Model/Checkout/BacsDirectDebitDetails.cs | 480 +-- Adyen/Model/Checkout/BalanceCheckRequest.cs | 1969 ++++------ Adyen/Model/Checkout/BalanceCheckResponse.cs | 458 +-- Adyen/Model/Checkout/BillDeskDetails.cs | 300 +- Adyen/Model/Checkout/BillingAddress.cs | 373 +- Adyen/Model/Checkout/BlikDetails.cs | 369 +- Adyen/Model/Checkout/BrowserInfo.cs | 397 +- Adyen/Model/Checkout/CancelOrderRequest.cs | 196 +- Adyen/Model/Checkout/CancelOrderResponse.cs | 240 +- Adyen/Model/Checkout/CardBrandDetails.cs | 197 +- Adyen/Model/Checkout/CardDetails.cs | 1254 ++---- Adyen/Model/Checkout/CardDetailsRequest.cs | 326 +- Adyen/Model/Checkout/CardDetailsResponse.cs | 275 +- Adyen/Model/Checkout/CardDonations.cs | 1254 ++---- Adyen/Model/Checkout/CashAppDetails.cs | 554 +-- Adyen/Model/Checkout/CellulantDetails.cs | 283 +- Adyen/Model/Checkout/CheckoutAwaitAction.cs | 320 +- Adyen/Model/Checkout/CheckoutBankAccount.cs | 601 +-- .../Checkout/CheckoutBankTransferAction.cs | 656 ++-- .../CheckoutDelegatedAuthenticationAction.cs | 394 +- .../Checkout/CheckoutNativeRedirectAction.cs | 398 +- Adyen/Model/Checkout/CheckoutOrderResponse.cs | 364 +- Adyen/Model/Checkout/CheckoutPaymentMethod.cs | 2260 +++++++---- Adyen/Model/Checkout/CheckoutQrCodeAction.cs | 394 +- .../Model/Checkout/CheckoutRedirectAction.cs | 361 +- Adyen/Model/Checkout/CheckoutSDKAction.cs | 371 +- .../CheckoutSessionInstallmentOption.cs | 375 +- .../CheckoutSessionThreeDS2RequestData.cs | 379 +- .../Model/Checkout/CheckoutThreeDS2Action.cs | 431 +-- Adyen/Model/Checkout/CheckoutVoucherAction.cs | 958 ++--- Adyen/Model/Checkout/CommonField.cs | 205 +- Adyen/Model/Checkout/Company.cs | 351 +- .../Checkout/CreateCheckoutSessionRequest.cs | 2787 ++++---------- .../Checkout/CreateCheckoutSessionResponse.cs | 2882 +++++--------- Adyen/Model/Checkout/CreateOrderRequest.cs | 274 +- Adyen/Model/Checkout/CreateOrderResponse.cs | 549 +-- Adyen/Model/Checkout/DeliveryAddress.cs | 465 +-- Adyen/Model/Checkout/DeliveryMethod.cs | 354 +- .../DetailsRequestAuthenticationData.cs | 164 +- Adyen/Model/Checkout/DeviceRenderOptions.cs | 348 +- Adyen/Model/Checkout/DokuDetails.cs | 486 +-- Adyen/Model/Checkout/Donation.cs | 305 +- Adyen/Model/Checkout/DonationCampaign.cs | 542 +-- .../Checkout/DonationCampaignsRequest.cs | 243 +- .../Checkout/DonationCampaignsResponse.cs | 171 +- Adyen/Model/Checkout/DonationPaymentMethod.cs | 421 +- .../Model/Checkout/DonationPaymentRequest.cs | 1993 ++++------ .../Model/Checkout/DonationPaymentResponse.cs | 457 +-- Adyen/Model/Checkout/DragonpayDetails.cs | 363 +- .../Model/Checkout/EBankingFinlandDetails.cs | 282 +- .../Model/Checkout/EcontextVoucherDetails.cs | 412 +- Adyen/Model/Checkout/EftDetails.cs | 480 +-- Adyen/Model/Checkout/EncryptedOrderData.cs | 204 +- Adyen/Model/Checkout/EnhancedSchemeData.cs | 170 +- Adyen/Model/Checkout/ExternalPlatform.cs | 242 +- Adyen/Model/Checkout/FastlaneDetails.cs | 365 +- Adyen/Model/Checkout/ForexQuote.cs | 589 +-- Adyen/Model/Checkout/FraudCheckResult.cs | 216 +- Adyen/Model/Checkout/FraudResult.cs | 202 +- Adyen/Model/Checkout/FundOrigin.cs | 320 +- Adyen/Model/Checkout/FundRecipient.cs | 686 ++-- .../GenericIssuerPaymentMethodDetails.cs | 396 +- Adyen/Model/Checkout/GooglePayDetails.cs | 548 +-- Adyen/Model/Checkout/GooglePayDonations.cs | 548 +-- Adyen/Model/Checkout/IdealDetails.cs | 369 +- Adyen/Model/Checkout/IdealDonations.cs | 369 +- Adyen/Model/Checkout/InputDetail.cs | 476 +-- Adyen/Model/Checkout/InstallmentOption.cs | 408 +- Adyen/Model/Checkout/Installments.cs | 367 +- Adyen/Model/Checkout/Item.cs | 203 +- Adyen/Model/Checkout/KlarnaDetails.cs | 539 +-- Adyen/Model/Checkout/Leg.cs | 455 +-- Adyen/Model/Checkout/LineItem.cs | 775 ++-- .../ListStoredPaymentMethodsResponse.cs | 245 +- Adyen/Model/Checkout/Mandate.cs | 753 ++-- Adyen/Model/Checkout/MasterpassDetails.cs | 370 +- Adyen/Model/Checkout/MbwayDetails.cs | 317 +- Adyen/Model/Checkout/MerchantDevice.cs | 240 +- Adyen/Model/Checkout/MerchantRiskIndicator.cs | 801 ++-- Adyen/Model/Checkout/MobilePayDetails.cs | 246 +- Adyen/Model/Checkout/MolPayDetails.cs | 300 +- Adyen/Model/Checkout/Name.cs | 214 +- Adyen/Model/Checkout/OpenInvoiceDetails.cs | 463 +-- Adyen/Model/Checkout/Passenger.cs | 314 +- .../PayByBankAISDirectDebitDetails.cs | 331 +- Adyen/Model/Checkout/PayByBankDetails.cs | 282 +- Adyen/Model/Checkout/PayPalDetails.cs | 572 +-- Adyen/Model/Checkout/PayPayDetails.cs | 332 +- Adyen/Model/Checkout/PayToDetails.cs | 369 +- Adyen/Model/Checkout/PayUUpiDetails.cs | 404 +- Adyen/Model/Checkout/PayWithGoogleDetails.cs | 511 +-- .../Model/Checkout/PayWithGoogleDonations.cs | 511 +-- Adyen/Model/Checkout/Payment.cs | 326 +- .../Checkout/PaymentAmountUpdateRequest.cs | 474 +-- .../Checkout/PaymentAmountUpdateResponse.cs | 576 +-- Adyen/Model/Checkout/PaymentCancelRequest.cs | 263 +- Adyen/Model/Checkout/PaymentCancelResponse.cs | 338 +- Adyen/Model/Checkout/PaymentCaptureRequest.cs | 484 +-- .../Model/Checkout/PaymentCaptureResponse.cs | 551 +-- .../Checkout/PaymentCompletionDetails.cs | 911 ++--- Adyen/Model/Checkout/PaymentDetails.cs | 1210 ++---- Adyen/Model/Checkout/PaymentDetailsRequest.cs | 287 +- .../Model/Checkout/PaymentDetailsResponse.cs | 878 ++--- Adyen/Model/Checkout/PaymentLinkRequest.cs | 1970 +++------- Adyen/Model/Checkout/PaymentLinkResponse.cs | 2225 ++++------- Adyen/Model/Checkout/PaymentMethod.cs | 587 +-- Adyen/Model/Checkout/PaymentMethodGroup.cs | 240 +- Adyen/Model/Checkout/PaymentMethodIssuer.cs | 235 +- Adyen/Model/Checkout/PaymentMethodToStore.cs | 607 ++- Adyen/Model/Checkout/PaymentMethodUPIApps.cs | 194 +- Adyen/Model/Checkout/PaymentMethodsRequest.cs | 962 ++--- .../Model/Checkout/PaymentMethodsResponse.cs | 212 +- Adyen/Model/Checkout/PaymentRefundRequest.cs | 549 +-- Adyen/Model/Checkout/PaymentRefundResponse.cs | 688 ++-- Adyen/Model/Checkout/PaymentRequest.cs | 3377 ++++++---------- Adyen/Model/Checkout/PaymentResponse.cs | 881 ++--- Adyen/Model/Checkout/PaymentResponseAction.cs | 577 ++- .../Model/Checkout/PaymentReversalRequest.cs | 263 +- .../Model/Checkout/PaymentReversalResponse.cs | 338 +- .../Checkout/PaypalUpdateOrderRequest.cs | 362 +- .../Checkout/PaypalUpdateOrderResponse.cs | 250 +- Adyen/Model/Checkout/Phone.cs | 233 +- Adyen/Model/Checkout/PixDetails.cs | 368 +- Adyen/Model/Checkout/PixRecurring.cs | 553 +-- .../Model/Checkout/PlatformChargebackLogic.cs | 302 +- Adyen/Model/Checkout/PseDetails.cs | 383 +- Adyen/Model/Checkout/RakutenPayDetails.cs | 332 +- Adyen/Model/Checkout/RatepayDetails.cs | 452 +-- Adyen/Model/Checkout/Recurring.cs | 442 +-- .../ResponseAdditionalData3DSecure.cs | 308 +- .../ResponseAdditionalDataBillingAddress.cs | 351 +- .../Checkout/ResponseAdditionalDataCard.cs | 604 +-- .../Checkout/ResponseAdditionalDataCommon.cs | 2718 +++++-------- .../ResponseAdditionalDataDomesticError.cs | 203 +- .../ResponseAdditionalDataInstallments.cs | 573 +-- .../ResponseAdditionalDataNetworkTokens.cs | 240 +- .../Checkout/ResponseAdditionalDataOpi.cs | 166 +- .../Checkout/ResponseAdditionalDataSepa.cs | 240 +- Adyen/Model/Checkout/ResponsePaymentMethod.cs | 203 +- Adyen/Model/Checkout/RiskData.cs | 281 +- Adyen/Model/Checkout/RivertyDetails.cs | 573 +-- Adyen/Model/Checkout/SDKEphemPubKey.cs | 277 +- Adyen/Model/Checkout/SamsungPayDetails.cs | 464 +-- .../Model/Checkout/SepaDirectDebitDetails.cs | 450 +-- Adyen/Model/Checkout/ServiceError.cs | 349 +- Adyen/Model/Checkout/SessionResultResponse.cs | 415 +- .../Checkout/ShopperInteractionDevice.cs | 240 +- Adyen/Model/Checkout/Split.cs | 510 +-- Adyen/Model/Checkout/SplitAmount.cs | 227 +- .../StandalonePaymentCancelRequest.cs | 297 +- .../StandalonePaymentCancelResponse.cs | 338 +- Adyen/Model/Checkout/StoredPaymentMethod.cs | 766 ++-- .../Checkout/StoredPaymentMethodDetails.cs | 502 +-- .../Checkout/StoredPaymentMethodRequest.cs | 406 +- .../Checkout/StoredPaymentMethodResource.cs | 780 ++-- Adyen/Model/Checkout/SubInputDetail.cs | 355 +- Adyen/Model/Checkout/SubMerchant.cs | 314 +- Adyen/Model/Checkout/SubMerchantInfo.cs | 533 +-- Adyen/Model/Checkout/Surcharge.cs | 160 +- Adyen/Model/Checkout/TaxTotal.cs | 170 +- Adyen/Model/Checkout/ThreeDS2RequestData.cs | 2023 +++------- Adyen/Model/Checkout/ThreeDS2RequestFields.cs | 1910 +++------ Adyen/Model/Checkout/ThreeDS2ResponseData.cs | 832 ++-- Adyen/Model/Checkout/ThreeDS2Result.cs | 903 ++--- Adyen/Model/Checkout/ThreeDSRequestData.cs | 524 +-- .../ThreeDSRequestorAuthenticationInfo.cs | 352 +- ...ThreeDSRequestorPriorAuthenticationInfo.cs | 381 +- Adyen/Model/Checkout/ThreeDSecureData.cs | 857 ++--- Adyen/Model/Checkout/Ticket.cs | 240 +- Adyen/Model/Checkout/TravelAgency.cs | 203 +- Adyen/Model/Checkout/TwintDetails.cs | 369 +- .../Checkout/UpdatePaymentLinkRequest.cs | 210 +- Adyen/Model/Checkout/UpiCollectDetails.cs | 436 +-- Adyen/Model/Checkout/UpiIntentDetails.cs | 405 +- Adyen/Model/Checkout/UtilityRequest.cs | 167 +- Adyen/Model/Checkout/UtilityResponse.cs | 171 +- Adyen/Model/Checkout/VippsDetails.cs | 373 +- Adyen/Model/Checkout/VisaCheckoutDetails.cs | 370 +- Adyen/Model/Checkout/WeChatPayDetails.cs | 256 +- .../Checkout/WeChatPayMiniProgramDetails.cs | 320 +- Adyen/Model/Checkout/ZipDetails.cs | 379 +- Adyen/Model/ConfigurationWebhooks/Card.cs | 6 +- Adyen/Model/ConfigurationWebhooks/Device.cs | 148 + .../NetworkTokenNotificationDataV2.cs | 332 ++ .../NetworkTokenNotificationRequest.cs | 207 + .../NetworkTokenRequestor.cs | 148 + .../PlatformPaymentConfiguration.cs | 12 +- .../SweepConfigurationV2.cs | 6 +- .../TokenAuthentication.cs | 148 + .../ConfigurationWebhooks/ValidationFacts.cs | 197 + .../VerificationError.cs | 19 +- .../VerificationErrorRecursive.cs | 18 +- Adyen/Model/ConfigurationWebhooks/Wallet.cs | 475 +++ .../AcceptTermsOfServiceResponse.cs | 18 +- .../AdditionalBankIdentification.cs | 25 +- Adyen/Model/LegalEntityManagement/Address.cs | 6 +- .../CalculateTermsOfServiceStatusResponse.cs | 8 +- .../LegalEntityManagement/FinancialReport.cs | 2 +- .../GetTermsOfServiceDocumentRequest.cs | 18 +- .../GetTermsOfServiceDocumentResponse.cs | 18 +- .../TermsOfServiceAcceptanceInfo.cs | 18 +- .../Management/SplitConfigurationRule.cs | 19 +- Adyen/Model/TerminalApi/EventToNotifyType.cs | 12 +- .../BalancePlatformNotificationResponse.cs | 6 +- .../TransactionWebhooks/BankCategoryData.cs | 10 +- Adyen/Model/TransactionWebhooks/IssuedCard.cs | 20 +- Adyen/Model/TransactionWebhooks/Resource.cs | 6 +- .../Model/TransactionWebhooks/ThreeDSecure.cs | 129 + .../Model/TransactionWebhooks/Transaction.cs | 6 +- .../AdditionalBankIdentification.cs | 14 +- .../Transfers/AdditionalBankIdentification.cs | 14 +- Adyen/Service/Checkout/DonationsService.cs | 1183 +----- .../Service/Checkout/ModificationsService.cs | 3426 +---------------- Adyen/Service/Checkout/OrdersService.cs | 1725 +-------- Adyen/Service/Checkout/PaymentLinksService.cs | 1697 +------- Adyen/Service/Checkout/PaymentsService.cs | 2686 +------------ Adyen/Service/Checkout/RecurringService.cs | 1032 +---- Adyen/Service/Checkout/UtilityService.cs | 1511 +------- 284 files changed, 42077 insertions(+), 91435 deletions(-) delete mode 100644 Adyen/Client/ApiException.cs delete mode 100644 Adyen/Client/ApiFactory.cs delete mode 100644 Adyen/Client/ApiKeyToken.cs delete mode 100644 Adyen/Client/ApiResponse.cs delete mode 100644 Adyen/Client/ApiResponseEventArgs.cs delete mode 100644 Adyen/Client/BasicToken.cs delete mode 100644 Adyen/Client/ClientUtils.cs delete mode 100644 Adyen/Client/CookieContainer.cs delete mode 100644 Adyen/Client/DateOnlyJsonConverter.cs delete mode 100644 Adyen/Client/DateOnlyNullableJsonConverter.cs delete mode 100644 Adyen/Client/DateTimeJsonConverter.cs delete mode 100644 Adyen/Client/DateTimeNullableJsonConverter.cs delete mode 100644 Adyen/Client/ExceptionEventArgs.cs delete mode 100644 Adyen/Client/HostConfiguration.cs delete mode 100644 Adyen/Client/IAdyenApiService.cs delete mode 100644 Adyen/Client/JsonSerializerOptionsProvider.cs delete mode 100644 Adyen/Client/Option.cs delete mode 100644 Adyen/Client/RateLimitProvider.cs delete mode 100644 Adyen/Client/TokenBase.cs delete mode 100644 Adyen/Client/TokenContainer.cs delete mode 100644 Adyen/Client/TokenProvider.cs delete mode 100644 Adyen/Extensions/IHostBuilderExtensions.cs delete mode 100644 Adyen/Extensions/IHttpClientBuilderExtensions.cs delete mode 100644 Adyen/Extensions/IServiceCollectionExtensions.cs create mode 100644 Adyen/Model/Checkout/AbstractOpenAPISchema.cs create mode 100644 Adyen/Model/ConfigurationWebhooks/Device.cs create mode 100644 Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs create mode 100644 Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs create mode 100644 Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs create mode 100644 Adyen/Model/ConfigurationWebhooks/TokenAuthentication.cs create mode 100644 Adyen/Model/ConfigurationWebhooks/ValidationFacts.cs create mode 100644 Adyen/Model/ConfigurationWebhooks/Wallet.cs create mode 100644 Adyen/Model/TransactionWebhooks/ThreeDSecure.cs diff --git a/Adyen/Client/ApiException.cs b/Adyen/Client/ApiException.cs deleted file mode 100644 index 39517978e..000000000 --- a/Adyen/Client/ApiException.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; - -namespace Adyen.Client -{ - /// - /// API Exception - /// - public class ApiException : Exception - { - /// - /// The reason the api request failed - /// - public string ReasonPhrase { get; } - - /// - /// The HttpStatusCode - /// - public System.Net.HttpStatusCode StatusCode { get; } - - /// - /// The raw data returned by the api - /// - public string RawContent { get; } - - /// - /// Construct the ApiException from parts of the response - /// - /// - /// - /// - public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) - { - ReasonPhrase = reasonPhrase; - - StatusCode = statusCode; - - RawContent = rawContent; - } - } -} diff --git a/Adyen/Client/ApiFactory.cs b/Adyen/Client/ApiFactory.cs deleted file mode 100644 index f36fb244f..000000000 --- a/Adyen/Client/ApiFactory.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using Microsoft.Extensions.DependencyInjection; -using Adyen.Service.Checkout; - -namespace Adyen.Client -{ - /// - /// An IApiFactory interface - /// - public interface IApiFactory - { - /// - /// A method to create an IApi of type IResult - /// - /// - /// - IResult Create() where IResult : IAdyenApiService; - } - - /// - /// An ApiFactory - /// - public class ApiFactory : IApiFactory - { - /// - /// The service provider - /// - public IServiceProvider Services { get; } - - /// - /// Initializes a new instance of the class. - /// - /// - public ApiFactory(IServiceProvider services) - { - Services = services; - } - - /// - /// A method to create an IApi of type IResult - /// - /// - /// - public IResult Create() where IResult : IAdyenApiService - { - return Services.GetRequiredService(); - } - } -} diff --git a/Adyen/Client/ApiKeyToken.cs b/Adyen/Client/ApiKeyToken.cs deleted file mode 100644 index 22707f0f5..000000000 --- a/Adyen/Client/ApiKeyToken.cs +++ /dev/null @@ -1,52 +0,0 @@ -// - -using System; - -namespace Adyen.Client -{ - /// - /// A token constructed from an apiKey. - /// - public class ApiKeyToken : TokenBase - { - private string _raw; - - /// - /// The header that this token will be used with. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs an ApiKeyToken object. - /// - /// - /// - /// - /// - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) - { - Header = header; - _raw = $"{ prefix }{ value }"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); - } - - /// - /// Places the token in the query. - /// - /// - /// - /// - public virtual void UseInQuery(global::System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) - { - parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(); - } - } -} \ No newline at end of file diff --git a/Adyen/Client/ApiResponse.cs b/Adyen/Client/ApiResponse.cs deleted file mode 100644 index 9823ea21d..000000000 --- a/Adyen/Client/ApiResponse.cs +++ /dev/null @@ -1,324 +0,0 @@ -// -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Diagnostics.CodeAnalysis; -using System.Net; - -namespace Adyen.Client -{ - /// - /// Provides a non-generic contract for the ApiResponse wrapper. - /// - public partial interface IApiResponse - { - /// - /// The IsSuccessStatusCode from the api response - /// - bool IsSuccessStatusCode { get; } - - /// - /// Gets the status code (HTTP status code) - /// - /// The status code. - HttpStatusCode StatusCode { get; } - - /// - /// The raw content of this response. - /// - string RawContent { get; } - - /// - /// The raw binary stream (only set for binary responses) - /// - System.IO.Stream ContentStream { get; } - - /// - /// The DateTime when the request was retrieved. - /// - DateTime DownloadedAt { get; } - - /// - /// The headers contained in the api response - /// - System.Net.Http.Headers.HttpResponseHeaders Headers { get; } - - /// - /// The path used when making the request. - /// - string Path { get; } - - /// - /// The reason phrase contained in the api response - /// - string ReasonPhrase { get; } - - /// - /// The DateTime when the request was sent. - /// - DateTime RequestedAt { get; } - - /// - /// The Uri used when making the request. - /// - Uri RequestUri { get; } - } - - /// - /// API Response - /// - public partial class ApiResponse : IApiResponse - { - /// - /// Gets the status code (HTTP status code) - /// - /// The status code. - public HttpStatusCode StatusCode { get; } - - /// - /// The raw data - /// - public string RawContent { get; protected set; } - - /// - /// The raw binary stream (only set for binary responses) - /// - public System.IO.Stream ContentStream { get; protected set; } - - /// - /// The IsSuccessStatusCode from the api response - /// - public bool IsSuccessStatusCode { get; } - - /// - /// The reason phrase contained in the api response - /// - public string ReasonPhrase { get; } - - /// - /// The headers contained in the api response - /// - public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } - - /// - /// The DateTime when the request was retrieved. - /// - public DateTime DownloadedAt { get; } = DateTime.UtcNow; - - /// - /// The DateTime when the request was sent. - /// - public DateTime RequestedAt { get; } - - /// - /// The path used when making the request. - /// - public string Path { get; } - - /// - /// The Uri used when making the request. - /// - public Uri RequestUri { get; } - - /// - /// The - /// - protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; - - /// - /// Construct the response using an HttpResponseMessage - /// - /// - /// - /// - /// - /// - /// - public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) - { - StatusCode = httpResponseMessage.StatusCode; - Headers = httpResponseMessage.Headers; - IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; - ReasonPhrase = httpResponseMessage.ReasonPhrase; - RawContent = rawContent; - Path = path; - RequestUri = httpRequestMessage.RequestUri; - RequestedAt = requestedAt; - _jsonSerializerOptions = jsonSerializerOptions; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - /// - /// Construct the response using an HttpResponseMessage - /// - /// - /// - /// - /// - /// - /// - public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) - { - StatusCode = httpResponseMessage.StatusCode; - Headers = httpResponseMessage.Headers; - IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; - ReasonPhrase = httpResponseMessage.ReasonPhrase; - ContentStream = contentStream; - RawContent = string.Empty; - Path = path; - RequestUri = httpRequestMessage.RequestUri; - RequestedAt = requestedAt; - _jsonSerializerOptions = jsonSerializerOptions; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - } - - /// - /// An interface for responses of type - /// - /// - public interface IBadRequest : IApiResponse - { - /// - /// Deserializes the response if the response is BadRequest - /// - /// - TType BadRequest(); - - /// - /// Returns true if the response is BadRequest and the deserialized response is not null - /// - /// - /// - bool TryBadRequest([NotNullWhen(true)]out TType result); - } - - /// - /// An interface for responses of type - /// - /// - public interface IUnauthorized : IApiResponse - { - /// - /// Deserializes the response if the response is Unauthorized - /// - /// - TType Unauthorized(); - - /// - /// Returns true if the response is Unauthorized and the deserialized response is not null - /// - /// - /// - bool TryUnauthorized([NotNullWhen(true)]out TType result); - } - - /// - /// An interface for responses of type - /// - /// - public interface IForbidden : IApiResponse - { - /// - /// Deserializes the response if the response is Forbidden - /// - /// - TType Forbidden(); - - /// - /// Returns true if the response is Forbidden and the deserialized response is not null - /// - /// - /// - bool TryForbidden([NotNullWhen(true)]out TType result); - } - - /// - /// An interface for responses of type - /// - /// - public interface IOk : IApiResponse - { - /// - /// Deserializes the response if the response is Ok - /// - /// - TType Ok(); - - /// - /// Returns true if the response is Ok and the deserialized response is not null - /// - /// - /// - bool TryOk([NotNullWhen(true)]out TType result); - } - - /// - /// An interface for responses of type - /// - /// - public interface IUnprocessableContent : IApiResponse - { - /// - /// Deserializes the response if the response is UnprocessableContent - /// - /// - TType UnprocessableContent(); - - /// - /// Returns true if the response is UnprocessableContent and the deserialized response is not null - /// - /// - /// - bool TryUnprocessableContent([NotNullWhen(true)]out TType result); - } - - /// - /// An interface for responses of type - /// - /// - public interface IInternalServerError : IApiResponse - { - /// - /// Deserializes the response if the response is InternalServerError - /// - /// - TType InternalServerError(); - - /// - /// Returns true if the response is InternalServerError and the deserialized response is not null - /// - /// - /// - bool TryInternalServerError([NotNullWhen(true)]out TType result); - } - - /// - /// An interface for responses of type - /// - /// - public interface ICreated : IApiResponse - { - /// - /// Deserializes the response if the response is Created - /// - /// - TType Created(); - - /// - /// Returns true if the response is Created and the deserialized response is not null - /// - /// - /// - bool TryCreated([NotNullWhen(true)]out TType result); - } -} diff --git a/Adyen/Client/ApiResponseEventArgs.cs b/Adyen/Client/ApiResponseEventArgs.cs deleted file mode 100644 index 0bcd267ab..000000000 --- a/Adyen/Client/ApiResponseEventArgs.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Adyen.Client -{ - /// - /// Useful for tracking server health - /// - public class ApiResponseEventArgs : EventArgs - { - /// - /// The ApiResponse - /// - public ApiResponse ApiResponse { get; } - - /// - /// The ApiResponseEventArgs - /// - /// - public ApiResponseEventArgs(ApiResponse apiResponse) - { - ApiResponse = apiResponse; - } - } -} diff --git a/Adyen/Client/BasicToken.cs b/Adyen/Client/BasicToken.cs deleted file mode 100644 index 0fe32b3a9..000000000 --- a/Adyen/Client/BasicToken.cs +++ /dev/null @@ -1,42 +0,0 @@ -// - -using System; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -namespace Adyen.Client -{ - /// - /// A token constructed from a username and password. - /// - public class BasicToken : TokenBase - { - private string _username; - - private string _password; - - /// - /// Constructs a BasicToken object. - /// - /// - /// - /// - public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) - { - _username = username; - - _password = password; - } - - /// - /// Places the token in the header. - /// - /// - /// - public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) - { - request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Adyen.Client.ClientUtils.Base64Encode(_username + ":" + _password)); - } - } -} \ No newline at end of file diff --git a/Adyen/Client/ClientUtils.cs b/Adyen/Client/ClientUtils.cs deleted file mode 100644 index f5c20171e..000000000 --- a/Adyen/Client/ClientUtils.cs +++ /dev/null @@ -1,728 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.IO; -using System.Linq; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using System.Text.RegularExpressions; -using Adyen.Model.Checkout; -using System.Runtime.CompilerServices; - -namespace Adyen.Client -{ - /// - /// Utility functions providing some benefit to API client consumers. - /// - public static partial class ClientUtils - { - - /// - /// A delegate for events. - /// - /// - /// - /// - /// - public delegate void EventHandler(object sender, T e) where T : EventArgs; - - /// - /// An enum of headers - /// - public enum ApiKeyHeader - { - /// - /// The X-API-Key header - /// - X_API_Key - } - - /// - /// Converte an ApiKeyHeader to a string - /// - /// - /// - /// - public static string ApiKeyHeaderToString(ApiKeyHeader value) - { - return value switch - { - ApiKeyHeader.X_API_Key => "X-API-Key", - _ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)), - }; - } - - /// - /// Returns true when deserialization succeeds. - /// - /// - /// - /// - /// - /// - public static bool TryDeserialize(string json, JsonSerializerOptions options, [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out T result) - { - try - { - result = JsonSerializer.Deserialize(json, options); - return result != null; - } - catch (Exception) - { - result = default; - return false; - } - } - - /// - /// Returns true when deserialization succeeds. - /// - /// - /// - /// - /// - /// - public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out T result) - { - try - { - result = JsonSerializer.Deserialize(ref reader, options); - return result != null; - } - catch (Exception) - { - result = default; - return false; - } - } - - /// - /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. - /// If parameter is a list, join the list with ",". - /// Otherwise just return the string. - /// - /// The parameter (header, path, query, form). - /// The DateTime serialization format. - /// Formatted string. - public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) - { - if (obj is DateTime dateTime) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15T13:45:30.0000000 - return dateTime.ToString(format); - if (obj is DateTimeOffset dateTimeOffset) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15T13:45:30.0000000 - return dateTimeOffset.ToString(format); - if (obj is DateOnly dateOnly) - return dateOnly.ToString(format); - if (obj is bool boolean) - return boolean - ? "true" - : "false"; - if (obj is AccountInfo.AccountAgeIndicatorEnum accountInfoAccountAgeIndicatorEnum) - return AccountInfo.AccountAgeIndicatorEnumToJsonValue(accountInfoAccountAgeIndicatorEnum); - if (obj is AccountInfo.AccountChangeIndicatorEnum accountInfoAccountChangeIndicatorEnum) - return AccountInfo.AccountChangeIndicatorEnumToJsonValue(accountInfoAccountChangeIndicatorEnum); - if (obj is AccountInfo.AccountTypeEnum accountInfoAccountTypeEnum) - return AccountInfo.AccountTypeEnumToJsonValue(accountInfoAccountTypeEnum); - if (obj is AccountInfo.DeliveryAddressUsageIndicatorEnum accountInfoDeliveryAddressUsageIndicatorEnum) - return AccountInfo.DeliveryAddressUsageIndicatorEnumToJsonValue(accountInfoDeliveryAddressUsageIndicatorEnum); - if (obj is AccountInfo.PasswordChangeIndicatorEnum accountInfoPasswordChangeIndicatorEnum) - return AccountInfo.PasswordChangeIndicatorEnumToJsonValue(accountInfoPasswordChangeIndicatorEnum); - if (obj is AccountInfo.PaymentAccountIndicatorEnum accountInfoPaymentAccountIndicatorEnum) - return AccountInfo.PaymentAccountIndicatorEnumToJsonValue(accountInfoPaymentAccountIndicatorEnum); - if (obj is AcctInfo.ChAccAgeIndEnum acctInfoChAccAgeIndEnum) - return AcctInfo.ChAccAgeIndEnumToJsonValue(acctInfoChAccAgeIndEnum); - if (obj is AcctInfo.ChAccChangeIndEnum acctInfoChAccChangeIndEnum) - return AcctInfo.ChAccChangeIndEnumToJsonValue(acctInfoChAccChangeIndEnum); - if (obj is AcctInfo.ChAccPwChangeIndEnum acctInfoChAccPwChangeIndEnum) - return AcctInfo.ChAccPwChangeIndEnumToJsonValue(acctInfoChAccPwChangeIndEnum); - if (obj is AcctInfo.PaymentAccIndEnum acctInfoPaymentAccIndEnum) - return AcctInfo.PaymentAccIndEnumToJsonValue(acctInfoPaymentAccIndEnum); - if (obj is AcctInfo.ShipAddressUsageIndEnum acctInfoShipAddressUsageIndEnum) - return AcctInfo.ShipAddressUsageIndEnumToJsonValue(acctInfoShipAddressUsageIndEnum); - if (obj is AcctInfo.ShipNameIndicatorEnum acctInfoShipNameIndicatorEnum) - return AcctInfo.ShipNameIndicatorEnumToJsonValue(acctInfoShipNameIndicatorEnum); - if (obj is AcctInfo.SuspiciousAccActivityEnum acctInfoSuspiciousAccActivityEnum) - return AcctInfo.SuspiciousAccActivityEnumToJsonValue(acctInfoSuspiciousAccActivityEnum); - if (obj is AchDetails.AccountHolderTypeEnum achDetailsAccountHolderTypeEnum) - return AchDetails.AccountHolderTypeEnumToJsonValue(achDetailsAccountHolderTypeEnum); - if (obj is AchDetails.BankAccountTypeEnum achDetailsBankAccountTypeEnum) - return AchDetails.BankAccountTypeEnumToJsonValue(achDetailsBankAccountTypeEnum); - if (obj is AchDetails.TypeEnum achDetailsTypeEnum) - return AchDetails.TypeEnumToJsonValue(achDetailsTypeEnum); - if (obj is AdditionalData3DSecure.ChallengeWindowSizeEnum additionalData3DSecureChallengeWindowSizeEnum) - return AdditionalData3DSecure.ChallengeWindowSizeEnumToJsonValue(additionalData3DSecureChallengeWindowSizeEnum); - if (obj is AdditionalDataCommon.IndustryUsageEnum additionalDataCommonIndustryUsageEnum) - return AdditionalDataCommon.IndustryUsageEnumToJsonValue(additionalDataCommonIndustryUsageEnum); - if (obj is AffirmDetails.TypeEnum affirmDetailsTypeEnum) - return AffirmDetails.TypeEnumToJsonValue(affirmDetailsTypeEnum); - if (obj is AfterpayDetails.TypeEnum afterpayDetailsTypeEnum) - return AfterpayDetails.TypeEnumToJsonValue(afterpayDetailsTypeEnum); - if (obj is AmazonPayDetails.TypeEnum amazonPayDetailsTypeEnum) - return AmazonPayDetails.TypeEnumToJsonValue(amazonPayDetailsTypeEnum); - if (obj is AncvDetails.TypeEnum ancvDetailsTypeEnum) - return AncvDetails.TypeEnumToJsonValue(ancvDetailsTypeEnum); - if (obj is AndroidPayDetails.TypeEnum androidPayDetailsTypeEnum) - return AndroidPayDetails.TypeEnumToJsonValue(androidPayDetailsTypeEnum); - if (obj is ApplePayDetails.FundingSourceEnum applePayDetailsFundingSourceEnum) - return ApplePayDetails.FundingSourceEnumToJsonValue(applePayDetailsFundingSourceEnum); - if (obj is ApplePayDetails.TypeEnum applePayDetailsTypeEnum) - return ApplePayDetails.TypeEnumToJsonValue(applePayDetailsTypeEnum); - if (obj is ApplePayDonations.FundingSourceEnum applePayDonationsFundingSourceEnum) - return ApplePayDonations.FundingSourceEnumToJsonValue(applePayDonationsFundingSourceEnum); - if (obj is ApplePayDonations.TypeEnum applePayDonationsTypeEnum) - return ApplePayDonations.TypeEnumToJsonValue(applePayDonationsTypeEnum); - if (obj is AuthenticationData.AttemptAuthenticationEnum authenticationDataAttemptAuthenticationEnum) - return AuthenticationData.AttemptAuthenticationEnumToJsonValue(authenticationDataAttemptAuthenticationEnum); - if (obj is BacsDirectDebitDetails.TypeEnum bacsDirectDebitDetailsTypeEnum) - return BacsDirectDebitDetails.TypeEnumToJsonValue(bacsDirectDebitDetailsTypeEnum); - if (obj is BalanceCheckRequest.RecurringProcessingModelEnum balanceCheckRequestRecurringProcessingModelEnum) - return BalanceCheckRequest.RecurringProcessingModelEnumToJsonValue(balanceCheckRequestRecurringProcessingModelEnum); - if (obj is BalanceCheckRequest.ShopperInteractionEnum balanceCheckRequestShopperInteractionEnum) - return BalanceCheckRequest.ShopperInteractionEnumToJsonValue(balanceCheckRequestShopperInteractionEnum); - if (obj is BalanceCheckResponse.ResultCodeEnum balanceCheckResponseResultCodeEnum) - return BalanceCheckResponse.ResultCodeEnumToJsonValue(balanceCheckResponseResultCodeEnum); - if (obj is BillDeskDetails.TypeEnum billDeskDetailsTypeEnum) - return BillDeskDetails.TypeEnumToJsonValue(billDeskDetailsTypeEnum); - if (obj is BlikDetails.TypeEnum blikDetailsTypeEnum) - return BlikDetails.TypeEnumToJsonValue(blikDetailsTypeEnum); - if (obj is CancelOrderResponse.ResultCodeEnum cancelOrderResponseResultCodeEnum) - return CancelOrderResponse.ResultCodeEnumToJsonValue(cancelOrderResponseResultCodeEnum); - if (obj is CardDetails.FundingSourceEnum cardDetailsFundingSourceEnum) - return CardDetails.FundingSourceEnumToJsonValue(cardDetailsFundingSourceEnum); - if (obj is CardDetails.TypeEnum cardDetailsTypeEnum) - return CardDetails.TypeEnumToJsonValue(cardDetailsTypeEnum); - if (obj is CardDonations.FundingSourceEnum cardDonationsFundingSourceEnum) - return CardDonations.FundingSourceEnumToJsonValue(cardDonationsFundingSourceEnum); - if (obj is CardDonations.TypeEnum cardDonationsTypeEnum) - return CardDonations.TypeEnumToJsonValue(cardDonationsTypeEnum); - if (obj is CashAppDetails.TypeEnum cashAppDetailsTypeEnum) - return CashAppDetails.TypeEnumToJsonValue(cashAppDetailsTypeEnum); - if (obj is CellulantDetails.TypeEnum cellulantDetailsTypeEnum) - return CellulantDetails.TypeEnumToJsonValue(cellulantDetailsTypeEnum); - if (obj is CheckoutAwaitAction.TypeEnum checkoutAwaitActionTypeEnum) - return CheckoutAwaitAction.TypeEnumToJsonValue(checkoutAwaitActionTypeEnum); - if (obj is CheckoutBankAccount.AccountTypeEnum checkoutBankAccountAccountTypeEnum) - return CheckoutBankAccount.AccountTypeEnumToJsonValue(checkoutBankAccountAccountTypeEnum); - if (obj is CheckoutBankTransferAction.TypeEnum checkoutBankTransferActionTypeEnum) - return CheckoutBankTransferAction.TypeEnumToJsonValue(checkoutBankTransferActionTypeEnum); - if (obj is CheckoutDelegatedAuthenticationAction.TypeEnum checkoutDelegatedAuthenticationActionTypeEnum) - return CheckoutDelegatedAuthenticationAction.TypeEnumToJsonValue(checkoutDelegatedAuthenticationActionTypeEnum); - if (obj is CheckoutNativeRedirectAction.TypeEnum checkoutNativeRedirectActionTypeEnum) - return CheckoutNativeRedirectAction.TypeEnumToJsonValue(checkoutNativeRedirectActionTypeEnum); - if (obj is CheckoutQrCodeAction.TypeEnum checkoutQrCodeActionTypeEnum) - return CheckoutQrCodeAction.TypeEnumToJsonValue(checkoutQrCodeActionTypeEnum); - if (obj is CheckoutRedirectAction.TypeEnum checkoutRedirectActionTypeEnum) - return CheckoutRedirectAction.TypeEnumToJsonValue(checkoutRedirectActionTypeEnum); - if (obj is CheckoutSDKAction.TypeEnum checkoutSDKActionTypeEnum) - return CheckoutSDKAction.TypeEnumToJsonValue(checkoutSDKActionTypeEnum); - if (obj is CheckoutSessionInstallmentOption.PlansEnum checkoutSessionInstallmentOptionPlansEnum) - return CheckoutSessionInstallmentOption.PlansEnumToJsonValue(checkoutSessionInstallmentOptionPlansEnum); - if (obj is CheckoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndEnum checkoutSessionThreeDS2RequestDataThreeDSRequestorChallengeIndEnum) - return CheckoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumToJsonValue(checkoutSessionThreeDS2RequestDataThreeDSRequestorChallengeIndEnum); - if (obj is CheckoutThreeDS2Action.TypeEnum checkoutThreeDS2ActionTypeEnum) - return CheckoutThreeDS2Action.TypeEnumToJsonValue(checkoutThreeDS2ActionTypeEnum); - if (obj is CheckoutVoucherAction.TypeEnum checkoutVoucherActionTypeEnum) - return CheckoutVoucherAction.TypeEnumToJsonValue(checkoutVoucherActionTypeEnum); - if (obj is CreateCheckoutSessionRequest.ChannelEnum createCheckoutSessionRequestChannelEnum) - return CreateCheckoutSessionRequest.ChannelEnumToJsonValue(createCheckoutSessionRequestChannelEnum); - if (obj is CreateCheckoutSessionRequest.ModeEnum createCheckoutSessionRequestModeEnum) - return CreateCheckoutSessionRequest.ModeEnumToJsonValue(createCheckoutSessionRequestModeEnum); - if (obj is CreateCheckoutSessionRequest.RecurringProcessingModelEnum createCheckoutSessionRequestRecurringProcessingModelEnum) - return CreateCheckoutSessionRequest.RecurringProcessingModelEnumToJsonValue(createCheckoutSessionRequestRecurringProcessingModelEnum); - if (obj is CreateCheckoutSessionRequest.ShopperInteractionEnum createCheckoutSessionRequestShopperInteractionEnum) - return CreateCheckoutSessionRequest.ShopperInteractionEnumToJsonValue(createCheckoutSessionRequestShopperInteractionEnum); - if (obj is CreateCheckoutSessionRequest.StoreFiltrationModeEnum createCheckoutSessionRequestStoreFiltrationModeEnum) - return CreateCheckoutSessionRequest.StoreFiltrationModeEnumToJsonValue(createCheckoutSessionRequestStoreFiltrationModeEnum); - if (obj is CreateCheckoutSessionRequest.StorePaymentMethodModeEnum createCheckoutSessionRequestStorePaymentMethodModeEnum) - return CreateCheckoutSessionRequest.StorePaymentMethodModeEnumToJsonValue(createCheckoutSessionRequestStorePaymentMethodModeEnum); - if (obj is CreateCheckoutSessionResponse.ChannelEnum createCheckoutSessionResponseChannelEnum) - return CreateCheckoutSessionResponse.ChannelEnumToJsonValue(createCheckoutSessionResponseChannelEnum); - if (obj is CreateCheckoutSessionResponse.ModeEnum createCheckoutSessionResponseModeEnum) - return CreateCheckoutSessionResponse.ModeEnumToJsonValue(createCheckoutSessionResponseModeEnum); - if (obj is CreateCheckoutSessionResponse.RecurringProcessingModelEnum createCheckoutSessionResponseRecurringProcessingModelEnum) - return CreateCheckoutSessionResponse.RecurringProcessingModelEnumToJsonValue(createCheckoutSessionResponseRecurringProcessingModelEnum); - if (obj is CreateCheckoutSessionResponse.ShopperInteractionEnum createCheckoutSessionResponseShopperInteractionEnum) - return CreateCheckoutSessionResponse.ShopperInteractionEnumToJsonValue(createCheckoutSessionResponseShopperInteractionEnum); - if (obj is CreateCheckoutSessionResponse.StoreFiltrationModeEnum createCheckoutSessionResponseStoreFiltrationModeEnum) - return CreateCheckoutSessionResponse.StoreFiltrationModeEnumToJsonValue(createCheckoutSessionResponseStoreFiltrationModeEnum); - if (obj is CreateCheckoutSessionResponse.StorePaymentMethodModeEnum createCheckoutSessionResponseStorePaymentMethodModeEnum) - return CreateCheckoutSessionResponse.StorePaymentMethodModeEnumToJsonValue(createCheckoutSessionResponseStorePaymentMethodModeEnum); - if (obj is CreateOrderResponse.ResultCodeEnum createOrderResponseResultCodeEnum) - return CreateOrderResponse.ResultCodeEnumToJsonValue(createOrderResponseResultCodeEnum); - if (obj is DeliveryMethod.TypeEnum deliveryMethodTypeEnum) - return DeliveryMethod.TypeEnumToJsonValue(deliveryMethodTypeEnum); - if (obj is DeviceRenderOptions.SdkInterfaceEnum deviceRenderOptionsSdkInterfaceEnum) - return DeviceRenderOptions.SdkInterfaceEnumToJsonValue(deviceRenderOptionsSdkInterfaceEnum); - if (obj is DeviceRenderOptions.SdkUiTypeEnum deviceRenderOptionsSdkUiTypeEnum) - return DeviceRenderOptions.SdkUiTypeEnumToJsonValue(deviceRenderOptionsSdkUiTypeEnum); - if (obj is DokuDetails.TypeEnum dokuDetailsTypeEnum) - return DokuDetails.TypeEnumToJsonValue(dokuDetailsTypeEnum); - if (obj is DonationPaymentRequest.ChannelEnum donationPaymentRequestChannelEnum) - return DonationPaymentRequest.ChannelEnumToJsonValue(donationPaymentRequestChannelEnum); - if (obj is DonationPaymentRequest.RecurringProcessingModelEnum donationPaymentRequestRecurringProcessingModelEnum) - return DonationPaymentRequest.RecurringProcessingModelEnumToJsonValue(donationPaymentRequestRecurringProcessingModelEnum); - if (obj is DonationPaymentRequest.ShopperInteractionEnum donationPaymentRequestShopperInteractionEnum) - return DonationPaymentRequest.ShopperInteractionEnumToJsonValue(donationPaymentRequestShopperInteractionEnum); - if (obj is DonationPaymentResponse.StatusEnum donationPaymentResponseStatusEnum) - return DonationPaymentResponse.StatusEnumToJsonValue(donationPaymentResponseStatusEnum); - if (obj is DragonpayDetails.TypeEnum dragonpayDetailsTypeEnum) - return DragonpayDetails.TypeEnumToJsonValue(dragonpayDetailsTypeEnum); - if (obj is EBankingFinlandDetails.TypeEnum eBankingFinlandDetailsTypeEnum) - return EBankingFinlandDetails.TypeEnumToJsonValue(eBankingFinlandDetailsTypeEnum); - if (obj is EcontextVoucherDetails.TypeEnum econtextVoucherDetailsTypeEnum) - return EcontextVoucherDetails.TypeEnumToJsonValue(econtextVoucherDetailsTypeEnum); - if (obj is EftDetails.TypeEnum eftDetailsTypeEnum) - return EftDetails.TypeEnumToJsonValue(eftDetailsTypeEnum); - if (obj is FastlaneDetails.TypeEnum fastlaneDetailsTypeEnum) - return FastlaneDetails.TypeEnumToJsonValue(fastlaneDetailsTypeEnum); - if (obj is FundRecipient.WalletPurposeEnum fundRecipientWalletPurposeEnum) - return FundRecipient.WalletPurposeEnumToJsonValue(fundRecipientWalletPurposeEnum); - if (obj is GenericIssuerPaymentMethodDetails.TypeEnum genericIssuerPaymentMethodDetailsTypeEnum) - return GenericIssuerPaymentMethodDetails.TypeEnumToJsonValue(genericIssuerPaymentMethodDetailsTypeEnum); - if (obj is GooglePayDetails.FundingSourceEnum googlePayDetailsFundingSourceEnum) - return GooglePayDetails.FundingSourceEnumToJsonValue(googlePayDetailsFundingSourceEnum); - if (obj is GooglePayDetails.TypeEnum googlePayDetailsTypeEnum) - return GooglePayDetails.TypeEnumToJsonValue(googlePayDetailsTypeEnum); - if (obj is GooglePayDonations.FundingSourceEnum googlePayDonationsFundingSourceEnum) - return GooglePayDonations.FundingSourceEnumToJsonValue(googlePayDonationsFundingSourceEnum); - if (obj is GooglePayDonations.TypeEnum googlePayDonationsTypeEnum) - return GooglePayDonations.TypeEnumToJsonValue(googlePayDonationsTypeEnum); - if (obj is IdealDetails.TypeEnum idealDetailsTypeEnum) - return IdealDetails.TypeEnumToJsonValue(idealDetailsTypeEnum); - if (obj is IdealDonations.TypeEnum idealDonationsTypeEnum) - return IdealDonations.TypeEnumToJsonValue(idealDonationsTypeEnum); - if (obj is InstallmentOption.PlansEnum installmentOptionPlansEnum) - return InstallmentOption.PlansEnumToJsonValue(installmentOptionPlansEnum); - if (obj is Installments.PlanEnum installmentsPlanEnum) - return Installments.PlanEnumToJsonValue(installmentsPlanEnum); - if (obj is KlarnaDetails.TypeEnum klarnaDetailsTypeEnum) - return KlarnaDetails.TypeEnumToJsonValue(klarnaDetailsTypeEnum); - if (obj is Mandate.FrequencyEnum mandateFrequencyEnum) - return Mandate.FrequencyEnumToJsonValue(mandateFrequencyEnum); - if (obj is Mandate.AmountRuleEnum mandateAmountRuleEnum) - return Mandate.AmountRuleEnumToJsonValue(mandateAmountRuleEnum); - if (obj is Mandate.BillingAttemptsRuleEnum mandateBillingAttemptsRuleEnum) - return Mandate.BillingAttemptsRuleEnumToJsonValue(mandateBillingAttemptsRuleEnum); - if (obj is MasterpassDetails.FundingSourceEnum masterpassDetailsFundingSourceEnum) - return MasterpassDetails.FundingSourceEnumToJsonValue(masterpassDetailsFundingSourceEnum); - if (obj is MasterpassDetails.TypeEnum masterpassDetailsTypeEnum) - return MasterpassDetails.TypeEnumToJsonValue(masterpassDetailsTypeEnum); - if (obj is MbwayDetails.TypeEnum mbwayDetailsTypeEnum) - return MbwayDetails.TypeEnumToJsonValue(mbwayDetailsTypeEnum); - if (obj is MerchantRiskIndicator.DeliveryAddressIndicatorEnum merchantRiskIndicatorDeliveryAddressIndicatorEnum) - return MerchantRiskIndicator.DeliveryAddressIndicatorEnumToJsonValue(merchantRiskIndicatorDeliveryAddressIndicatorEnum); - if (obj is MerchantRiskIndicator.DeliveryTimeframeEnum merchantRiskIndicatorDeliveryTimeframeEnum) - return MerchantRiskIndicator.DeliveryTimeframeEnumToJsonValue(merchantRiskIndicatorDeliveryTimeframeEnum); - if (obj is MobilePayDetails.TypeEnum mobilePayDetailsTypeEnum) - return MobilePayDetails.TypeEnumToJsonValue(mobilePayDetailsTypeEnum); - if (obj is MolPayDetails.TypeEnum molPayDetailsTypeEnum) - return MolPayDetails.TypeEnumToJsonValue(molPayDetailsTypeEnum); - if (obj is OpenInvoiceDetails.TypeEnum openInvoiceDetailsTypeEnum) - return OpenInvoiceDetails.TypeEnumToJsonValue(openInvoiceDetailsTypeEnum); - if (obj is PayByBankAISDirectDebitDetails.TypeEnum payByBankAISDirectDebitDetailsTypeEnum) - return PayByBankAISDirectDebitDetails.TypeEnumToJsonValue(payByBankAISDirectDebitDetailsTypeEnum); - if (obj is PayByBankDetails.TypeEnum payByBankDetailsTypeEnum) - return PayByBankDetails.TypeEnumToJsonValue(payByBankDetailsTypeEnum); - if (obj is PayPalDetails.SubtypeEnum payPalDetailsSubtypeEnum) - return PayPalDetails.SubtypeEnumToJsonValue(payPalDetailsSubtypeEnum); - if (obj is PayPalDetails.TypeEnum payPalDetailsTypeEnum) - return PayPalDetails.TypeEnumToJsonValue(payPalDetailsTypeEnum); - if (obj is PayPayDetails.TypeEnum payPayDetailsTypeEnum) - return PayPayDetails.TypeEnumToJsonValue(payPayDetailsTypeEnum); - if (obj is PayToDetails.TypeEnum payToDetailsTypeEnum) - return PayToDetails.TypeEnumToJsonValue(payToDetailsTypeEnum); - if (obj is PayUUpiDetails.TypeEnum payUUpiDetailsTypeEnum) - return PayUUpiDetails.TypeEnumToJsonValue(payUUpiDetailsTypeEnum); - if (obj is PayWithGoogleDetails.FundingSourceEnum payWithGoogleDetailsFundingSourceEnum) - return PayWithGoogleDetails.FundingSourceEnumToJsonValue(payWithGoogleDetailsFundingSourceEnum); - if (obj is PayWithGoogleDetails.TypeEnum payWithGoogleDetailsTypeEnum) - return PayWithGoogleDetails.TypeEnumToJsonValue(payWithGoogleDetailsTypeEnum); - if (obj is PayWithGoogleDonations.FundingSourceEnum payWithGoogleDonationsFundingSourceEnum) - return PayWithGoogleDonations.FundingSourceEnumToJsonValue(payWithGoogleDonationsFundingSourceEnum); - if (obj is PayWithGoogleDonations.TypeEnum payWithGoogleDonationsTypeEnum) - return PayWithGoogleDonations.TypeEnumToJsonValue(payWithGoogleDonationsTypeEnum); - if (obj is Payment.ResultCodeEnum paymentResultCodeEnum) - return Payment.ResultCodeEnumToJsonValue(paymentResultCodeEnum); - if (obj is PaymentAmountUpdateRequest.IndustryUsageEnum paymentAmountUpdateRequestIndustryUsageEnum) - return PaymentAmountUpdateRequest.IndustryUsageEnumToJsonValue(paymentAmountUpdateRequestIndustryUsageEnum); - if (obj is PaymentAmountUpdateResponse.StatusEnum paymentAmountUpdateResponseStatusEnum) - return PaymentAmountUpdateResponse.StatusEnumToJsonValue(paymentAmountUpdateResponseStatusEnum); - if (obj is PaymentAmountUpdateResponse.IndustryUsageEnum paymentAmountUpdateResponseIndustryUsageEnum) - return PaymentAmountUpdateResponse.IndustryUsageEnumToJsonValue(paymentAmountUpdateResponseIndustryUsageEnum); - if (obj is PaymentCancelResponse.StatusEnum paymentCancelResponseStatusEnum) - return PaymentCancelResponse.StatusEnumToJsonValue(paymentCancelResponseStatusEnum); - if (obj is PaymentCaptureResponse.StatusEnum paymentCaptureResponseStatusEnum) - return PaymentCaptureResponse.StatusEnumToJsonValue(paymentCaptureResponseStatusEnum); - if (obj is PaymentDetails.TypeEnum paymentDetailsTypeEnum) - return PaymentDetails.TypeEnumToJsonValue(paymentDetailsTypeEnum); - if (obj is PaymentDetailsResponse.ResultCodeEnum paymentDetailsResponseResultCodeEnum) - return PaymentDetailsResponse.ResultCodeEnumToJsonValue(paymentDetailsResponseResultCodeEnum); - if (obj is PaymentLinkRequest.RecurringProcessingModelEnum paymentLinkRequestRecurringProcessingModelEnum) - return PaymentLinkRequest.RecurringProcessingModelEnumToJsonValue(paymentLinkRequestRecurringProcessingModelEnum); - if (obj is PaymentLinkRequest.RequiredShopperFieldsEnum paymentLinkRequestRequiredShopperFieldsEnum) - return PaymentLinkRequest.RequiredShopperFieldsEnumToJsonValue(paymentLinkRequestRequiredShopperFieldsEnum); - if (obj is PaymentLinkRequest.StorePaymentMethodModeEnum paymentLinkRequestStorePaymentMethodModeEnum) - return PaymentLinkRequest.StorePaymentMethodModeEnumToJsonValue(paymentLinkRequestStorePaymentMethodModeEnum); - if (obj is PaymentLinkResponse.StatusEnum paymentLinkResponseStatusEnum) - return PaymentLinkResponse.StatusEnumToJsonValue(paymentLinkResponseStatusEnum); - if (obj is PaymentLinkResponse.RecurringProcessingModelEnum paymentLinkResponseRecurringProcessingModelEnum) - return PaymentLinkResponse.RecurringProcessingModelEnumToJsonValue(paymentLinkResponseRecurringProcessingModelEnum); - if (obj is PaymentLinkResponse.RequiredShopperFieldsEnum paymentLinkResponseRequiredShopperFieldsEnum) - return PaymentLinkResponse.RequiredShopperFieldsEnumToJsonValue(paymentLinkResponseRequiredShopperFieldsEnum); - if (obj is PaymentLinkResponse.StorePaymentMethodModeEnum paymentLinkResponseStorePaymentMethodModeEnum) - return PaymentLinkResponse.StorePaymentMethodModeEnumToJsonValue(paymentLinkResponseStorePaymentMethodModeEnum); - if (obj is PaymentMethod.FundingSourceEnum paymentMethodFundingSourceEnum) - return PaymentMethod.FundingSourceEnumToJsonValue(paymentMethodFundingSourceEnum); - if (obj is PaymentMethodsRequest.ChannelEnum paymentMethodsRequestChannelEnum) - return PaymentMethodsRequest.ChannelEnumToJsonValue(paymentMethodsRequestChannelEnum); - if (obj is PaymentMethodsRequest.StoreFiltrationModeEnum paymentMethodsRequestStoreFiltrationModeEnum) - return PaymentMethodsRequest.StoreFiltrationModeEnumToJsonValue(paymentMethodsRequestStoreFiltrationModeEnum); - if (obj is PaymentRefundRequest.MerchantRefundReasonEnum paymentRefundRequestMerchantRefundReasonEnum) - return PaymentRefundRequest.MerchantRefundReasonEnumToJsonValue(paymentRefundRequestMerchantRefundReasonEnum); - if (obj is PaymentRefundResponse.StatusEnum paymentRefundResponseStatusEnum) - return PaymentRefundResponse.StatusEnumToJsonValue(paymentRefundResponseStatusEnum); - if (obj is PaymentRefundResponse.MerchantRefundReasonEnum paymentRefundResponseMerchantRefundReasonEnum) - return PaymentRefundResponse.MerchantRefundReasonEnumToJsonValue(paymentRefundResponseMerchantRefundReasonEnum); - if (obj is PaymentRequest.ChannelEnum paymentRequestChannelEnum) - return PaymentRequest.ChannelEnumToJsonValue(paymentRequestChannelEnum); - if (obj is PaymentRequest.EntityTypeEnum paymentRequestEntityTypeEnum) - return PaymentRequest.EntityTypeEnumToJsonValue(paymentRequestEntityTypeEnum); - if (obj is PaymentRequest.IndustryUsageEnum paymentRequestIndustryUsageEnum) - return PaymentRequest.IndustryUsageEnumToJsonValue(paymentRequestIndustryUsageEnum); - if (obj is PaymentRequest.RecurringProcessingModelEnum paymentRequestRecurringProcessingModelEnum) - return PaymentRequest.RecurringProcessingModelEnumToJsonValue(paymentRequestRecurringProcessingModelEnum); - if (obj is PaymentRequest.ShopperInteractionEnum paymentRequestShopperInteractionEnum) - return PaymentRequest.ShopperInteractionEnumToJsonValue(paymentRequestShopperInteractionEnum); - if (obj is PaymentResponse.ResultCodeEnum paymentResponseResultCodeEnum) - return PaymentResponse.ResultCodeEnumToJsonValue(paymentResponseResultCodeEnum); - if (obj is PaymentReversalResponse.StatusEnum paymentReversalResponseStatusEnum) - return PaymentReversalResponse.StatusEnumToJsonValue(paymentReversalResponseStatusEnum); - if (obj is PaypalUpdateOrderResponse.StatusEnum paypalUpdateOrderResponseStatusEnum) - return PaypalUpdateOrderResponse.StatusEnumToJsonValue(paypalUpdateOrderResponseStatusEnum); - if (obj is PixDetails.TypeEnum pixDetailsTypeEnum) - return PixDetails.TypeEnumToJsonValue(pixDetailsTypeEnum); - if (obj is PixRecurring.FrequencyEnum pixRecurringFrequencyEnum) - return PixRecurring.FrequencyEnumToJsonValue(pixRecurringFrequencyEnum); - if (obj is PlatformChargebackLogic.BehaviorEnum platformChargebackLogicBehaviorEnum) - return PlatformChargebackLogic.BehaviorEnumToJsonValue(platformChargebackLogicBehaviorEnum); - if (obj is PseDetails.TypeEnum pseDetailsTypeEnum) - return PseDetails.TypeEnumToJsonValue(pseDetailsTypeEnum); - if (obj is RakutenPayDetails.TypeEnum rakutenPayDetailsTypeEnum) - return RakutenPayDetails.TypeEnumToJsonValue(rakutenPayDetailsTypeEnum); - if (obj is RatepayDetails.TypeEnum ratepayDetailsTypeEnum) - return RatepayDetails.TypeEnumToJsonValue(ratepayDetailsTypeEnum); - if (obj is Recurring.ContractEnum recurringContractEnum) - return Recurring.ContractEnumToJsonValue(recurringContractEnum); - if (obj is Recurring.TokenServiceEnum recurringTokenServiceEnum) - return Recurring.TokenServiceEnumToJsonValue(recurringTokenServiceEnum); - if (obj is ResponseAdditionalDataCard.CardProductIdEnum responseAdditionalDataCardCardProductIdEnum) - return ResponseAdditionalDataCard.CardProductIdEnumToJsonValue(responseAdditionalDataCardCardProductIdEnum); - if (obj is ResponseAdditionalDataCommon.FraudResultTypeEnum responseAdditionalDataCommonFraudResultTypeEnum) - return ResponseAdditionalDataCommon.FraudResultTypeEnumToJsonValue(responseAdditionalDataCommonFraudResultTypeEnum); - if (obj is ResponseAdditionalDataCommon.FraudRiskLevelEnum responseAdditionalDataCommonFraudRiskLevelEnum) - return ResponseAdditionalDataCommon.FraudRiskLevelEnumToJsonValue(responseAdditionalDataCommonFraudRiskLevelEnum); - if (obj is ResponseAdditionalDataCommon.RecurringProcessingModelEnum responseAdditionalDataCommonRecurringProcessingModelEnum) - return ResponseAdditionalDataCommon.RecurringProcessingModelEnumToJsonValue(responseAdditionalDataCommonRecurringProcessingModelEnum); - if (obj is ResponseAdditionalDataCommon.TokenizationStoreOperationTypeEnum responseAdditionalDataCommonTokenizationStoreOperationTypeEnum) - return ResponseAdditionalDataCommon.TokenizationStoreOperationTypeEnumToJsonValue(responseAdditionalDataCommonTokenizationStoreOperationTypeEnum); - if (obj is Result result) - return ResultValueConverter.ToJsonValue(result); - if (obj is RivertyDetails.TypeEnum rivertyDetailsTypeEnum) - return RivertyDetails.TypeEnumToJsonValue(rivertyDetailsTypeEnum); - if (obj is SamsungPayDetails.FundingSourceEnum samsungPayDetailsFundingSourceEnum) - return SamsungPayDetails.FundingSourceEnumToJsonValue(samsungPayDetailsFundingSourceEnum); - if (obj is SamsungPayDetails.TypeEnum samsungPayDetailsTypeEnum) - return SamsungPayDetails.TypeEnumToJsonValue(samsungPayDetailsTypeEnum); - if (obj is SepaDirectDebitDetails.TypeEnum sepaDirectDebitDetailsTypeEnum) - return SepaDirectDebitDetails.TypeEnumToJsonValue(sepaDirectDebitDetailsTypeEnum); - if (obj is SessionResultResponse.StatusEnum sessionResultResponseStatusEnum) - return SessionResultResponse.StatusEnumToJsonValue(sessionResultResponseStatusEnum); - if (obj is Split.TypeEnum splitTypeEnum) - return Split.TypeEnumToJsonValue(splitTypeEnum); - if (obj is StandalonePaymentCancelResponse.StatusEnum standalonePaymentCancelResponseStatusEnum) - return StandalonePaymentCancelResponse.StatusEnumToJsonValue(standalonePaymentCancelResponseStatusEnum); - if (obj is StoredPaymentMethodDetails.TypeEnum storedPaymentMethodDetailsTypeEnum) - return StoredPaymentMethodDetails.TypeEnumToJsonValue(storedPaymentMethodDetailsTypeEnum); - if (obj is StoredPaymentMethodRequest.RecurringProcessingModelEnum storedPaymentMethodRequestRecurringProcessingModelEnum) - return StoredPaymentMethodRequest.RecurringProcessingModelEnumToJsonValue(storedPaymentMethodRequestRecurringProcessingModelEnum); - if (obj is ThreeDS2RequestData.AcctTypeEnum threeDS2RequestDataAcctTypeEnum) - return ThreeDS2RequestData.AcctTypeEnumToJsonValue(threeDS2RequestDataAcctTypeEnum); - if (obj is ThreeDS2RequestData.AddrMatchEnum threeDS2RequestDataAddrMatchEnum) - return ThreeDS2RequestData.AddrMatchEnumToJsonValue(threeDS2RequestDataAddrMatchEnum); - if (obj is ThreeDS2RequestData.ChallengeIndicatorEnum threeDS2RequestDataChallengeIndicatorEnum) - return ThreeDS2RequestData.ChallengeIndicatorEnumToJsonValue(threeDS2RequestDataChallengeIndicatorEnum); - if (obj is ThreeDS2RequestData.ThreeDSRequestorChallengeIndEnum threeDS2RequestDataThreeDSRequestorChallengeIndEnum) - return ThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2RequestDataThreeDSRequestorChallengeIndEnum); - if (obj is ThreeDS2RequestData.TransTypeEnum threeDS2RequestDataTransTypeEnum) - return ThreeDS2RequestData.TransTypeEnumToJsonValue(threeDS2RequestDataTransTypeEnum); - if (obj is ThreeDS2RequestData.TransactionTypeEnum threeDS2RequestDataTransactionTypeEnum) - return ThreeDS2RequestData.TransactionTypeEnumToJsonValue(threeDS2RequestDataTransactionTypeEnum); - if (obj is ThreeDS2RequestFields.AcctTypeEnum threeDS2RequestFieldsAcctTypeEnum) - return ThreeDS2RequestFields.AcctTypeEnumToJsonValue(threeDS2RequestFieldsAcctTypeEnum); - if (obj is ThreeDS2RequestFields.AddrMatchEnum threeDS2RequestFieldsAddrMatchEnum) - return ThreeDS2RequestFields.AddrMatchEnumToJsonValue(threeDS2RequestFieldsAddrMatchEnum); - if (obj is ThreeDS2RequestFields.ChallengeIndicatorEnum threeDS2RequestFieldsChallengeIndicatorEnum) - return ThreeDS2RequestFields.ChallengeIndicatorEnumToJsonValue(threeDS2RequestFieldsChallengeIndicatorEnum); - if (obj is ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnum threeDS2RequestFieldsThreeDSRequestorChallengeIndEnum) - return ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2RequestFieldsThreeDSRequestorChallengeIndEnum); - if (obj is ThreeDS2RequestFields.TransTypeEnum threeDS2RequestFieldsTransTypeEnum) - return ThreeDS2RequestFields.TransTypeEnumToJsonValue(threeDS2RequestFieldsTransTypeEnum); - if (obj is ThreeDS2RequestFields.TransactionTypeEnum threeDS2RequestFieldsTransactionTypeEnum) - return ThreeDS2RequestFields.TransactionTypeEnumToJsonValue(threeDS2RequestFieldsTransactionTypeEnum); - if (obj is ThreeDS2Result.ChallengeCancelEnum threeDS2ResultChallengeCancelEnum) - return ThreeDS2Result.ChallengeCancelEnumToJsonValue(threeDS2ResultChallengeCancelEnum); - if (obj is ThreeDS2Result.ExemptionIndicatorEnum threeDS2ResultExemptionIndicatorEnum) - return ThreeDS2Result.ExemptionIndicatorEnumToJsonValue(threeDS2ResultExemptionIndicatorEnum); - if (obj is ThreeDS2Result.ThreeDSRequestorChallengeIndEnum threeDS2ResultThreeDSRequestorChallengeIndEnum) - return ThreeDS2Result.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2ResultThreeDSRequestorChallengeIndEnum); - if (obj is ThreeDSRequestData.ChallengeWindowSizeEnum threeDSRequestDataChallengeWindowSizeEnum) - return ThreeDSRequestData.ChallengeWindowSizeEnumToJsonValue(threeDSRequestDataChallengeWindowSizeEnum); - if (obj is ThreeDSRequestData.DataOnlyEnum threeDSRequestDataDataOnlyEnum) - return ThreeDSRequestData.DataOnlyEnumToJsonValue(threeDSRequestDataDataOnlyEnum); - if (obj is ThreeDSRequestData.NativeThreeDSEnum threeDSRequestDataNativeThreeDSEnum) - return ThreeDSRequestData.NativeThreeDSEnumToJsonValue(threeDSRequestDataNativeThreeDSEnum); - if (obj is ThreeDSRequestData.ThreeDSVersionEnum threeDSRequestDataThreeDSVersionEnum) - return ThreeDSRequestData.ThreeDSVersionEnumToJsonValue(threeDSRequestDataThreeDSVersionEnum); - if (obj is ThreeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodEnum threeDSRequestorAuthenticationInfoThreeDSReqAuthMethodEnum) - return ThreeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodEnumToJsonValue(threeDSRequestorAuthenticationInfoThreeDSReqAuthMethodEnum); - if (obj is ThreeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodEnum threeDSRequestorPriorAuthenticationInfoThreeDSReqPriorAuthMethodEnum) - return ThreeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodEnumToJsonValue(threeDSRequestorPriorAuthenticationInfoThreeDSReqPriorAuthMethodEnum); - if (obj is ThreeDSecureData.AuthenticationResponseEnum threeDSecureDataAuthenticationResponseEnum) - return ThreeDSecureData.AuthenticationResponseEnumToJsonValue(threeDSecureDataAuthenticationResponseEnum); - if (obj is ThreeDSecureData.ChallengeCancelEnum threeDSecureDataChallengeCancelEnum) - return ThreeDSecureData.ChallengeCancelEnumToJsonValue(threeDSecureDataChallengeCancelEnum); - if (obj is ThreeDSecureData.DirectoryResponseEnum threeDSecureDataDirectoryResponseEnum) - return ThreeDSecureData.DirectoryResponseEnumToJsonValue(threeDSecureDataDirectoryResponseEnum); - if (obj is TwintDetails.TypeEnum twintDetailsTypeEnum) - return TwintDetails.TypeEnumToJsonValue(twintDetailsTypeEnum); - if (obj is UpdatePaymentLinkRequest.StatusEnum updatePaymentLinkRequestStatusEnum) - return UpdatePaymentLinkRequest.StatusEnumToJsonValue(updatePaymentLinkRequestStatusEnum); - if (obj is UpiCollectDetails.TypeEnum upiCollectDetailsTypeEnum) - return UpiCollectDetails.TypeEnumToJsonValue(upiCollectDetailsTypeEnum); - if (obj is UpiIntentDetails.TypeEnum upiIntentDetailsTypeEnum) - return UpiIntentDetails.TypeEnumToJsonValue(upiIntentDetailsTypeEnum); - if (obj is UpiQrDetails.TypeEnum upiQrDetailsTypeEnum) - return UpiQrDetails.TypeEnumToJsonValue(upiQrDetailsTypeEnum); - if (obj is VippsDetails.TypeEnum vippsDetailsTypeEnum) - return VippsDetails.TypeEnumToJsonValue(vippsDetailsTypeEnum); - if (obj is VisaCheckoutDetails.FundingSourceEnum visaCheckoutDetailsFundingSourceEnum) - return VisaCheckoutDetails.FundingSourceEnumToJsonValue(visaCheckoutDetailsFundingSourceEnum); - if (obj is VisaCheckoutDetails.TypeEnum visaCheckoutDetailsTypeEnum) - return VisaCheckoutDetails.TypeEnumToJsonValue(visaCheckoutDetailsTypeEnum); - if (obj is WeChatPayDetails.TypeEnum weChatPayDetailsTypeEnum) - return WeChatPayDetails.TypeEnumToJsonValue(weChatPayDetailsTypeEnum); - if (obj is WeChatPayMiniProgramDetails.TypeEnum weChatPayMiniProgramDetailsTypeEnum) - return WeChatPayMiniProgramDetails.TypeEnumToJsonValue(weChatPayMiniProgramDetailsTypeEnum); - if (obj is ZipDetails.TypeEnum zipDetailsTypeEnum) - return ZipDetails.TypeEnumToJsonValue(zipDetailsTypeEnum); - if (obj is ICollection collection) - { - List entries = new(); - foreach (var entry in collection) - entries.Add(ParameterToString(entry)); - return string.Join(",", entries); - } - - return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); - } - - /// - /// URL encode a string - /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 - /// - /// string to be URL encoded - /// Byte array - public static string UrlEncode(string input) - { - const int maxLength = 32766; - - if (input == null) - { - throw new ArgumentNullException("input"); - } - - if (input.Length <= maxLength) - { - return Uri.EscapeDataString(input); - } - - StringBuilder sb = new StringBuilder(input.Length * 2); - int index = 0; - - while (index < input.Length) - { - int length = Math.Min(input.Length - index, maxLength); - string subString = input.Substring(index, length); - - sb.Append(Uri.EscapeDataString(subString)); - index += subString.Length; - } - - return sb.ToString(); - } - - /// - /// Encode string in base64 format. - /// - /// string to be encoded. - /// Encoded string. - public static string Base64Encode(string text) - { - return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); - } - - /// - /// Convert stream to byte array - /// - /// Input stream to be converted - /// Byte array - public static byte[] ReadAsBytes(Stream inputStream) - { - using (var ms = new MemoryStream()) - { - inputStream.CopyTo(ms); - return ms.ToArray(); - } - } - - /// - /// Select the Content-Type header's value from the given content-type array: - /// if JSON type exists in the given array, use it; - /// otherwise use the first one defined in 'consumes' - /// - /// The Content-Type array to select from. - /// The Content-Type header to use. - public static string SelectHeaderContentType(string[] contentTypes) - { - if (contentTypes.Length == 0) - return null; - - foreach (var contentType in contentTypes) - { - if (IsJsonMime(contentType)) - return contentType; - } - - return contentTypes[0]; // use the first content type specified in 'consumes' - } - - /// - /// Select the Accept header's value from the given accepts array: - /// if JSON exists in the given array, use it; - /// otherwise use all of them (joining into a string) - /// - /// The accepts array to select from. - /// The Accept header to use. - public static string SelectHeaderAccept(string[] accepts) - { - if (accepts.Length == 0) - return null; - - if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) - return "application/json"; - - return string.Join(",", accepts); - } - - /// - /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. - /// - [GeneratedRegex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$")] - private static partial Regex JsonRegex(); - - /// - /// Check if the given MIME is a JSON MIME. - /// JSON MIME examples: - /// application/json - /// application/json; charset=UTF8 - /// APPLICATION/JSON - /// application/vnd.company+json - /// - /// MIME - /// Returns True if MIME type is json. - public static bool IsJsonMime(string mime) - { - if (string.IsNullOrWhiteSpace(mime)) return false; - - return JsonRegex().IsMatch(mime) || mime.Equals("application/json-patch+json"); - } - - /// - /// Get the discriminator - /// - /// - /// - /// - /// - public static string GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) - { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) - return utf8JsonReader.GetString(); - } - } - - throw new JsonException("The specified discriminator was not found."); - } - - /// - /// The base path of the API - /// - public const string BASE_ADDRESS = "https://checkout-test.adyen.com/v71"; - - /// - /// The scheme of the API - /// - public const string SCHEME = "https"; - - /// - /// The context path of the API - /// - public const string CONTEXT_PATH = "/v71"; - - /// - /// The host of the API - /// - public const string HOST = "checkout-test.adyen.com"; - - /// - /// The format to use for DateTime serialization - /// - public const string ISO8601_DATETIME_FORMAT = "o"; - } -} diff --git a/Adyen/Client/CookieContainer.cs b/Adyen/Client/CookieContainer.cs deleted file mode 100644 index b129934b7..000000000 --- a/Adyen/Client/CookieContainer.cs +++ /dev/null @@ -1,18 +0,0 @@ -// - -using System.Linq; -using System.Collections.Generic; - -namespace Adyen.Client -{ - /// - /// A class containing a CookieContainer - /// - public sealed class CookieContainer - { - /// - /// The collection of tokens - /// - public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); - } -} \ No newline at end of file diff --git a/Adyen/Client/DateOnlyJsonConverter.cs b/Adyen/Client/DateOnlyJsonConverter.cs deleted file mode 100644 index 0b29c811a..000000000 --- a/Adyen/Client/DateOnlyJsonConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Globalization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Adyen.Client -{ - /// - /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 - /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types - /// - public class DateOnlyJsonConverter : JsonConverter - { - /// - /// The formats used to deserialize the date - /// - public static string[] Formats { get; } = { - "yyyy'-'MM'-'dd", - "yyyyMMdd" - - }; - - /// - /// Returns a DateOnly from the Json object - /// - /// - /// - /// - /// - public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - if (reader.TokenType == JsonTokenType.Null) - throw new NotSupportedException(); - - string value = reader.GetString(); - - foreach(string format in Formats) - if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) - return result; - - throw new NotSupportedException(); - } - - /// - /// Writes the DateOnly to the json writer - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DateOnly dateOnlyValue, JsonSerializerOptions options) => - writer.WriteStringValue(dateOnlyValue.ToString("yyyy'-'MM'-'dd", CultureInfo.InvariantCulture)); - } -} diff --git a/Adyen/Client/DateOnlyNullableJsonConverter.cs b/Adyen/Client/DateOnlyNullableJsonConverter.cs deleted file mode 100644 index d961cf1a4..000000000 --- a/Adyen/Client/DateOnlyNullableJsonConverter.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Globalization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Adyen.Client -{ - /// - /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 - /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types - /// - public class DateOnlyNullableJsonConverter : JsonConverter - { - /// - /// The formats used to deserialize the date - /// - public static string[] Formats { get; } = { - "yyyy'-'MM'-'dd", - "yyyyMMdd" - - }; - - /// - /// Returns a DateOnly from the Json object - /// - /// - /// - /// - /// - public override DateOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - if (reader.TokenType == JsonTokenType.Null) - return null; - - string value = reader.GetString(); - - foreach(string format in Formats) - if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) - return result; - - throw new NotSupportedException(); - } - - /// - /// Writes the DateOnly to the json writer - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DateOnly? dateOnlyValue, JsonSerializerOptions options) - { - if (dateOnlyValue == null) - writer.WriteNullValue(); - else - writer.WriteStringValue(dateOnlyValue.Value.ToString("yyyy'-'MM'-'dd", CultureInfo.InvariantCulture)); - } - } -} diff --git a/Adyen/Client/DateTimeJsonConverter.cs b/Adyen/Client/DateTimeJsonConverter.cs deleted file mode 100644 index fc9fb7cba..000000000 --- a/Adyen/Client/DateTimeJsonConverter.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Globalization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Adyen.Client -{ - /// - /// Formatter for 'date-time' openapi formats ss defined by full-date - RFC3339 - /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types - /// - public class DateTimeJsonConverter : JsonConverter - { - /// - /// The formats used to deserialize the date - /// - public static string[] Formats { get; } = { - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", - "yyyyMMddTHHmmss.fffffffK", - "yyyyMMddTHHmmss.ffffffK", - "yyyyMMddTHHmmss.fffffK", - "yyyyMMddTHHmmss.ffffK", - "yyyyMMddTHHmmss.fffK", - "yyyyMMddTHHmmss.ffK", - "yyyyMMddTHHmmss.fK", - "yyyyMMddTHHmmssK", - - }; - - /// - /// Returns a DateTime from the Json object - /// - /// - /// - /// - /// - public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - if (reader.TokenType == JsonTokenType.Null) - throw new NotSupportedException(); - - string value = reader.GetString(); - - foreach(string format in Formats) - if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) - return result; - - throw new NotSupportedException(); - } - - /// - /// Writes the DateTime to the json writer - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => - writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); - } -} diff --git a/Adyen/Client/DateTimeNullableJsonConverter.cs b/Adyen/Client/DateTimeNullableJsonConverter.cs deleted file mode 100644 index 760763765..000000000 --- a/Adyen/Client/DateTimeNullableJsonConverter.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Globalization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Adyen.Client -{ - /// - /// Formatter for 'date-time' openapi formats ss defined by full-date - RFC3339 - /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types - /// - public class DateTimeNullableJsonConverter : JsonConverter - { - /// - /// The formats used to deserialize the date - /// - public static string[] Formats { get; } = { - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", - "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", - "yyyyMMddTHHmmss.fffffffK", - "yyyyMMddTHHmmss.ffffffK", - "yyyyMMddTHHmmss.fffffK", - "yyyyMMddTHHmmss.ffffK", - "yyyyMMddTHHmmss.fffK", - "yyyyMMddTHHmmss.ffK", - "yyyyMMddTHHmmss.fK", - "yyyyMMddTHHmmssK", - - }; - - /// - /// Returns a DateTime from the Json object - /// - /// - /// - /// - /// - public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - if (reader.TokenType == JsonTokenType.Null) - return null; - - string value = reader.GetString(); - - foreach(string format in Formats) - if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) - return result; - - return null; - } - - /// - /// Writes the DateTime to the json writer - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) - { - if (dateTimeValue == null) - writer.WriteNullValue(); - else - writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); - } - } -} diff --git a/Adyen/Client/ExceptionEventArgs.cs b/Adyen/Client/ExceptionEventArgs.cs deleted file mode 100644 index 0e11b030b..000000000 --- a/Adyen/Client/ExceptionEventArgs.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Adyen.Client -{ - /// - /// Useful for tracking server health - /// - public class ExceptionEventArgs : EventArgs - { - /// - /// The ApiResponse - /// - public Exception Exception { get; } - - /// - /// The ExceptionEventArgs - /// - /// - public ExceptionEventArgs(Exception exception) - { - Exception = exception; - } - } -} diff --git a/Adyen/Client/HostConfiguration.cs b/Adyen/Client/HostConfiguration.cs deleted file mode 100644 index 9b2dd7022..000000000 --- a/Adyen/Client/HostConfiguration.cs +++ /dev/null @@ -1,368 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json; -using System.Text.Json.Serialization; -using System.Net.Http; -using Microsoft.Extensions.DependencyInjection; -using Adyen.Service.Checkout; -using Adyen.Model.Checkout; - -namespace Adyen.Client -{ - /// - /// Provides hosting configuration for Adyen - /// - public class HostConfiguration - { - private readonly IServiceCollection _services; - private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); - - internal bool HttpClientsAdded { get; private set; } - - /// - /// Instantiates the class - /// - /// - public HostConfiguration(IServiceCollection services) - { - _services = services; - _jsonOptions.Converters.Add(new JsonStringEnumConverter()); - _jsonOptions.Converters.Add(new DateTimeJsonConverter()); - _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); - _jsonOptions.Converters.Add(new DateOnlyJsonConverter()); - _jsonOptions.Converters.Add(new DateOnlyNullableJsonConverter()); - _jsonOptions.Converters.Add(new AccountInfoJsonConverter()); - _jsonOptions.Converters.Add(new AcctInfoJsonConverter()); - _jsonOptions.Converters.Add(new AchDetailsJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalData3DSecureJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataAirlineJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataCarRentalJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataCommonJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataLevel23JsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataLodgingJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataOpenInvoiceJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataOpiJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataRatepayJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataRetryJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataRiskJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataRiskStandaloneJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataSubMerchantJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataTemporaryServicesJsonConverter()); - _jsonOptions.Converters.Add(new AdditionalDataWalletsJsonConverter()); - _jsonOptions.Converters.Add(new AddressJsonConverter()); - _jsonOptions.Converters.Add(new AffirmDetailsJsonConverter()); - _jsonOptions.Converters.Add(new AfterpayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new AgencyJsonConverter()); - _jsonOptions.Converters.Add(new AirlineJsonConverter()); - _jsonOptions.Converters.Add(new AmazonPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new AmountJsonConverter()); - _jsonOptions.Converters.Add(new AmountsJsonConverter()); - _jsonOptions.Converters.Add(new AncvDetailsJsonConverter()); - _jsonOptions.Converters.Add(new AndroidPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new ApplePayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new ApplePayDonationsJsonConverter()); - _jsonOptions.Converters.Add(new ApplePaySessionRequestJsonConverter()); - _jsonOptions.Converters.Add(new ApplePaySessionResponseJsonConverter()); - _jsonOptions.Converters.Add(new ApplicationInfoJsonConverter()); - _jsonOptions.Converters.Add(new AuthenticationDataJsonConverter()); - _jsonOptions.Converters.Add(new BacsDirectDebitDetailsJsonConverter()); - _jsonOptions.Converters.Add(new BalanceCheckRequestJsonConverter()); - _jsonOptions.Converters.Add(new BalanceCheckResponseJsonConverter()); - _jsonOptions.Converters.Add(new BillDeskDetailsJsonConverter()); - _jsonOptions.Converters.Add(new BillingAddressJsonConverter()); - _jsonOptions.Converters.Add(new BlikDetailsJsonConverter()); - _jsonOptions.Converters.Add(new BrowserInfoJsonConverter()); - _jsonOptions.Converters.Add(new CancelOrderRequestJsonConverter()); - _jsonOptions.Converters.Add(new CancelOrderResponseJsonConverter()); - _jsonOptions.Converters.Add(new CardBrandDetailsJsonConverter()); - _jsonOptions.Converters.Add(new CardDetailsJsonConverter()); - _jsonOptions.Converters.Add(new CardDetailsRequestJsonConverter()); - _jsonOptions.Converters.Add(new CardDetailsResponseJsonConverter()); - _jsonOptions.Converters.Add(new CardDonationsJsonConverter()); - _jsonOptions.Converters.Add(new CashAppDetailsJsonConverter()); - _jsonOptions.Converters.Add(new CellulantDetailsJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutAwaitActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutBankAccountJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutBankTransferActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutDelegatedAuthenticationActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutNativeRedirectActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutOrderResponseJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutPaymentMethodJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutQrCodeActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutRedirectActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutSDKActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutSessionInstallmentOptionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutSessionThreeDS2RequestDataJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutThreeDS2ActionJsonConverter()); - _jsonOptions.Converters.Add(new CheckoutVoucherActionJsonConverter()); - _jsonOptions.Converters.Add(new CommonFieldJsonConverter()); - _jsonOptions.Converters.Add(new CompanyJsonConverter()); - _jsonOptions.Converters.Add(new CreateCheckoutSessionRequestJsonConverter()); - _jsonOptions.Converters.Add(new CreateCheckoutSessionResponseJsonConverter()); - _jsonOptions.Converters.Add(new CreateOrderRequestJsonConverter()); - _jsonOptions.Converters.Add(new CreateOrderResponseJsonConverter()); - _jsonOptions.Converters.Add(new DefaultErrorResponseEntityJsonConverter()); - _jsonOptions.Converters.Add(new DeliveryAddressJsonConverter()); - _jsonOptions.Converters.Add(new DeliveryMethodJsonConverter()); - _jsonOptions.Converters.Add(new DetailsRequestAuthenticationDataJsonConverter()); - _jsonOptions.Converters.Add(new DeviceRenderOptionsJsonConverter()); - _jsonOptions.Converters.Add(new DokuDetailsJsonConverter()); - _jsonOptions.Converters.Add(new DonationJsonConverter()); - _jsonOptions.Converters.Add(new DonationCampaignJsonConverter()); - _jsonOptions.Converters.Add(new DonationCampaignsRequestJsonConverter()); - _jsonOptions.Converters.Add(new DonationCampaignsResponseJsonConverter()); - _jsonOptions.Converters.Add(new DonationPaymentMethodJsonConverter()); - _jsonOptions.Converters.Add(new DonationPaymentRequestJsonConverter()); - _jsonOptions.Converters.Add(new DonationPaymentResponseJsonConverter()); - _jsonOptions.Converters.Add(new DragonpayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new EBankingFinlandDetailsJsonConverter()); - _jsonOptions.Converters.Add(new EcontextVoucherDetailsJsonConverter()); - _jsonOptions.Converters.Add(new EftDetailsJsonConverter()); - _jsonOptions.Converters.Add(new EncryptedOrderDataJsonConverter()); - _jsonOptions.Converters.Add(new EnhancedSchemeDataJsonConverter()); - _jsonOptions.Converters.Add(new ExternalPlatformJsonConverter()); - _jsonOptions.Converters.Add(new FastlaneDetailsJsonConverter()); - _jsonOptions.Converters.Add(new ForexQuoteJsonConverter()); - _jsonOptions.Converters.Add(new FraudCheckResultJsonConverter()); - _jsonOptions.Converters.Add(new FraudResultJsonConverter()); - _jsonOptions.Converters.Add(new FundOriginJsonConverter()); - _jsonOptions.Converters.Add(new FundRecipientJsonConverter()); - _jsonOptions.Converters.Add(new GenericIssuerPaymentMethodDetailsJsonConverter()); - _jsonOptions.Converters.Add(new GooglePayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new GooglePayDonationsJsonConverter()); - _jsonOptions.Converters.Add(new IdealDetailsJsonConverter()); - _jsonOptions.Converters.Add(new IdealDonationsJsonConverter()); - _jsonOptions.Converters.Add(new InputDetailJsonConverter()); - _jsonOptions.Converters.Add(new InstallmentOptionJsonConverter()); - _jsonOptions.Converters.Add(new InstallmentsJsonConverter()); - _jsonOptions.Converters.Add(new InvalidFieldJsonConverter()); - _jsonOptions.Converters.Add(new ItemJsonConverter()); - _jsonOptions.Converters.Add(new KlarnaDetailsJsonConverter()); - _jsonOptions.Converters.Add(new LegJsonConverter()); - _jsonOptions.Converters.Add(new LineItemJsonConverter()); - _jsonOptions.Converters.Add(new ListStoredPaymentMethodsResponseJsonConverter()); - _jsonOptions.Converters.Add(new MandateJsonConverter()); - _jsonOptions.Converters.Add(new MasterpassDetailsJsonConverter()); - _jsonOptions.Converters.Add(new MbwayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new MerchantDeviceJsonConverter()); - _jsonOptions.Converters.Add(new MerchantRiskIndicatorJsonConverter()); - _jsonOptions.Converters.Add(new MobilePayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new MolPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new NameJsonConverter()); - _jsonOptions.Converters.Add(new OpenInvoiceDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PassengerJsonConverter()); - _jsonOptions.Converters.Add(new PayByBankAISDirectDebitDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayByBankDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayPalDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayToDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayToPaymentMethodJsonConverter()); - _jsonOptions.Converters.Add(new PayUUpiDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayWithGoogleDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PayWithGoogleDonationsJsonConverter()); - _jsonOptions.Converters.Add(new PaymentJsonConverter()); - _jsonOptions.Converters.Add(new PaymentAmountUpdateRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentAmountUpdateResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentCancelRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentCancelResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentCaptureRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentCaptureResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentCompletionDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PaymentDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PaymentDetailsRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentDetailsResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentLinkRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentLinkResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodGroupJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodIssuerJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodToStoreJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodUPIAppsJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodsRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentMethodsResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentRefundRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentRefundResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaymentResponseActionJsonConverter()); - _jsonOptions.Converters.Add(new PaymentReversalRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaymentReversalResponseJsonConverter()); - _jsonOptions.Converters.Add(new PaypalUpdateOrderRequestJsonConverter()); - _jsonOptions.Converters.Add(new PaypalUpdateOrderResponseJsonConverter()); - _jsonOptions.Converters.Add(new PhoneJsonConverter()); - _jsonOptions.Converters.Add(new PixDetailsJsonConverter()); - _jsonOptions.Converters.Add(new PixRecurringJsonConverter()); - _jsonOptions.Converters.Add(new PlatformChargebackLogicJsonConverter()); - _jsonOptions.Converters.Add(new PseDetailsJsonConverter()); - _jsonOptions.Converters.Add(new RakutenPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new RatepayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new RecurringJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalData3DSecureJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataBillingAddressJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataCardJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataCommonJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataDomesticErrorJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataInstallmentsJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataNetworkTokensJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataOpiJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataSepaJsonConverter()); - _jsonOptions.Converters.Add(new ResponseAdditionalDataSwishJsonConverter()); - _jsonOptions.Converters.Add(new ResponsePaymentMethodJsonConverter()); - _jsonOptions.Converters.Add(new ResultJsonConverter()); - _jsonOptions.Converters.Add(new ResultNullableJsonConverter()); - _jsonOptions.Converters.Add(new RiskDataJsonConverter()); - _jsonOptions.Converters.Add(new RivertyDetailsJsonConverter()); - _jsonOptions.Converters.Add(new SDKEphemPubKeyJsonConverter()); - _jsonOptions.Converters.Add(new SamsungPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new SepaDirectDebitDetailsJsonConverter()); - _jsonOptions.Converters.Add(new ServiceErrorJsonConverter()); - _jsonOptions.Converters.Add(new SessionResultResponseJsonConverter()); - _jsonOptions.Converters.Add(new ShopperIdPaymentMethodJsonConverter()); - _jsonOptions.Converters.Add(new ShopperInteractionDeviceJsonConverter()); - _jsonOptions.Converters.Add(new ShopperNameJsonConverter()); - _jsonOptions.Converters.Add(new SplitJsonConverter()); - _jsonOptions.Converters.Add(new SplitAmountJsonConverter()); - _jsonOptions.Converters.Add(new StandalonePaymentCancelRequestJsonConverter()); - _jsonOptions.Converters.Add(new StandalonePaymentCancelResponseJsonConverter()); - _jsonOptions.Converters.Add(new StoredPaymentMethodJsonConverter()); - _jsonOptions.Converters.Add(new StoredPaymentMethodDetailsJsonConverter()); - _jsonOptions.Converters.Add(new StoredPaymentMethodRequestJsonConverter()); - _jsonOptions.Converters.Add(new StoredPaymentMethodResourceJsonConverter()); - _jsonOptions.Converters.Add(new SubInputDetailJsonConverter()); - _jsonOptions.Converters.Add(new SubMerchantJsonConverter()); - _jsonOptions.Converters.Add(new SubMerchantInfoJsonConverter()); - _jsonOptions.Converters.Add(new SurchargeJsonConverter()); - _jsonOptions.Converters.Add(new TaxTotalJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDS2RequestDataJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDS2RequestFieldsJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDS2ResponseDataJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDS2ResultJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDSRequestDataJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDSRequestorAuthenticationInfoJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDSRequestorPriorAuthenticationInfoJsonConverter()); - _jsonOptions.Converters.Add(new ThreeDSecureDataJsonConverter()); - _jsonOptions.Converters.Add(new TicketJsonConverter()); - _jsonOptions.Converters.Add(new TravelAgencyJsonConverter()); - _jsonOptions.Converters.Add(new TwintDetailsJsonConverter()); - _jsonOptions.Converters.Add(new UPIPaymentMethodJsonConverter()); - _jsonOptions.Converters.Add(new UpdatePaymentLinkRequestJsonConverter()); - _jsonOptions.Converters.Add(new UpiCollectDetailsJsonConverter()); - _jsonOptions.Converters.Add(new UpiIntentDetailsJsonConverter()); - _jsonOptions.Converters.Add(new UpiQrDetailsJsonConverter()); - _jsonOptions.Converters.Add(new UtilityRequestJsonConverter()); - _jsonOptions.Converters.Add(new UtilityResponseJsonConverter()); - _jsonOptions.Converters.Add(new ValidateShopperIdRequestJsonConverter()); - _jsonOptions.Converters.Add(new ValidateShopperIdResponseJsonConverter()); - _jsonOptions.Converters.Add(new VippsDetailsJsonConverter()); - _jsonOptions.Converters.Add(new VisaCheckoutDetailsJsonConverter()); - _jsonOptions.Converters.Add(new WeChatPayDetailsJsonConverter()); - _jsonOptions.Converters.Add(new WeChatPayMiniProgramDetailsJsonConverter()); - _jsonOptions.Converters.Add(new ZipDetailsJsonConverter()); - JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new(_jsonOptions); - _services.AddSingleton(jsonSerializerOptionsProvider); - _services.AddSingleton(); - _services.AddSingleton(); - _services.AddSingleton(); - _services.AddSingleton(); - _services.AddSingleton(); - _services.AddSingleton(); - _services.AddSingleton(); - _services.AddSingleton(); - } - - /// - /// Configures the HttpClients. - /// - /// - /// - /// - public HostConfiguration AddApiHttpClients - ( - Action client = null, Action builder = null) - { - if (client == null) - client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); - - List builders = new List(); - - builders.Add(_services.AddHttpClient(client)); - builders.Add(_services.AddHttpClient(client)); - builders.Add(_services.AddHttpClient(client)); - builders.Add(_services.AddHttpClient(client)); - builders.Add(_services.AddHttpClient(client)); - builders.Add(_services.AddHttpClient(client)); - builders.Add(_services.AddHttpClient(client)); - - if (builder != null) - foreach (IHttpClientBuilder instance in builders) - builder(instance); - - HttpClientsAdded = true; - - return this; - } - - /// - /// Configures the JsonSerializerSettings - /// - /// - /// - public HostConfiguration ConfigureJsonOptions(Action options) - { - options(_jsonOptions); - - return this; - } - - /// - /// Adds tokens to your IServiceCollection - /// - /// - /// - /// - public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase - { - return AddTokens(new TTokenBase[]{ token }); - } - - /// - /// Adds tokens to your IServiceCollection - /// - /// - /// - /// - public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase - { - TokenContainer container = new TokenContainer(tokens); - _services.AddSingleton(services => container); - - return this; - } - - /// - /// Adds a token provider to your IServiceCollection - /// - /// - /// - /// - public HostConfiguration UseProvider() - where TTokenProvider : TokenProvider - where TTokenBase : TokenBase - { - _services.AddSingleton(); - _services.AddSingleton>(services => services.GetRequiredService()); - - return this; - } - } -} diff --git a/Adyen/Client/IAdyenApiService.cs b/Adyen/Client/IAdyenApiService.cs deleted file mode 100644 index 4a73f31b1..000000000 --- a/Adyen/Client/IAdyenApiService.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Adyen.Client -{ - /// - /// Interface for interacting with any Adyen API using . - /// - public interface IAdyenApiService - { - /// - /// The object, preferably instantiated and managed using the . - /// - System.Net.Http.HttpClient HttpClient { get; } - } -} \ No newline at end of file diff --git a/Adyen/Client/JsonSerializerOptionsProvider.cs b/Adyen/Client/JsonSerializerOptionsProvider.cs deleted file mode 100644 index fd7fbd8fc..000000000 --- a/Adyen/Client/JsonSerializerOptionsProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -// - -using System.Text.Json; - -namespace Adyen.Client -{ - /// - /// Provides the JsonSerializerOptions - /// - public class JsonSerializerOptionsProvider - { - /// - /// the JsonSerializerOptions - /// - public JsonSerializerOptions Options { get; } - - /// - /// Instantiates a JsonSerializerOptionsProvider - /// - public JsonSerializerOptionsProvider(JsonSerializerOptions options) - { - Options = options; - } - } -} \ No newline at end of file diff --git a/Adyen/Client/Option.cs b/Adyen/Client/Option.cs deleted file mode 100644 index 50ca397e8..000000000 --- a/Adyen/Client/Option.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -namespace Adyen.Client -{ - /// - /// A wrapper for operation parameters which are not required - /// - public struct Option - { - /// - /// The value to send to the server - /// - public TType Value { get; } - - /// - /// When true the value will be sent to the server - /// - internal bool IsSet { get; } - - /// - /// A wrapper for operation parameters which are not required - /// - /// - public Option(TType value) - { - IsSet = true; - Value = value; - } - - /// - /// Implicitly converts this option to the contained type - /// - /// - public static implicit operator TType(Option option) => option.Value; - - /// - /// Implicitly converts the provided value to an Option - /// - /// - public static implicit operator Option(TType value) => new Option(value); - } -} \ No newline at end of file diff --git a/Adyen/Client/RateLimitProvider.cs b/Adyen/Client/RateLimitProvider.cs deleted file mode 100644 index 9733b9684..000000000 --- a/Adyen/Client/RateLimitProvider.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Adyen.Client -{ - /// - /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. - /// - /// - public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase - { - internal Dictionary> AvailableTokens { get; } = new(); - - /// - /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. - /// - /// - public RateLimitProvider(TokenContainer container) : base(container.Tokens) - { - foreach(TTokenBase token in _tokens) - token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); - - if (container is TokenContainer apiKeyTokenContainer) - { - string[] headers = apiKeyTokenContainer.Tokens.Select(t => ClientUtils.ApiKeyHeaderToString(t.Header)).Distinct().ToArray(); - - foreach (string header in headers) - { - global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) - { - FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite - }; - - AvailableTokens.Add(header, global::System.Threading.Channels.Channel.CreateBounded(options)); - } - } - else - { - global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length) - { - FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite - }; - - AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded(options)); - } - - foreach (var availableToken in AvailableTokens) - foreach(TTokenBase token in _tokens) - { - if (token is ApiKeyToken apiKeyToken) - { - if (ClientUtils.ApiKeyHeaderToString(apiKeyToken.Header) == availableToken.Key) - { - token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); - } - } else - { - token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); - } - } - } - - internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) - { - if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) - throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); - - return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); - } - } -} diff --git a/Adyen/Client/TokenBase.cs b/Adyen/Client/TokenBase.cs deleted file mode 100644 index 79ed6dfda..000000000 --- a/Adyen/Client/TokenBase.cs +++ /dev/null @@ -1,69 +0,0 @@ -// - -using System; - -namespace Adyen.Client -{ - /// - /// The base for all tokens. - /// - public abstract class TokenBase - { - private DateTime _nextAvailable = DateTime.UtcNow; - private object _nextAvailableLock = new object(); - private readonly System.Timers.Timer _timer = new System.Timers.Timer(); - - - internal TimeSpan? Timeout { get; set; } - internal delegate void TokenBecameAvailableEventHandler(object sender); - internal event TokenBecameAvailableEventHandler TokenBecameAvailable; - - - /// - /// Initialize a TokenBase object. - /// - /// - internal TokenBase(TimeSpan? timeout = null) - { - Timeout = timeout; - - if (Timeout != null) - StartTimer(Timeout.Value); - } - - - /// - /// Starts the token's timer - /// - /// - internal void StartTimer(TimeSpan timeout) - { - Timeout = timeout; - _timer.Interval = Timeout.Value.TotalMilliseconds; - _timer.Elapsed += OnTimer; - _timer.AutoReset = true; - _timer.Start(); - } - - /// - /// Returns true while the token is rate limited. - /// - public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; - - /// - /// Triggered when the server returns status code TooManyRequests - /// Once triggered the local timeout will be extended an arbitrary length of time. - /// - public void BeginRateLimit() - { - lock(_nextAvailableLock) - _nextAvailable = DateTime.UtcNow.AddSeconds(5); - } - - private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) - { - if (TokenBecameAvailable != null && !IsRateLimited) - TokenBecameAvailable.Invoke(this); - } - } -} \ No newline at end of file diff --git a/Adyen/Client/TokenContainer.cs b/Adyen/Client/TokenContainer.cs deleted file mode 100644 index a9f3d167f..000000000 --- a/Adyen/Client/TokenContainer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -using System.Linq; -using System.Collections.Generic; - -namespace Adyen.Client -{ - /// - /// A container for a collection of tokens. - /// - /// - public sealed class TokenContainer where TTokenBase : TokenBase - { - /// - /// The collection of tokens - /// - public List Tokens { get; } = new List(); - - /// - /// Instantiates a TokenContainer - /// - public TokenContainer() - { - } - - /// - /// Instantiates a TokenContainer - /// - /// - public TokenContainer(global::System.Collections.Generic.IEnumerable tokens) - { - Tokens = tokens.ToList(); - } - } -} \ No newline at end of file diff --git a/Adyen/Client/TokenProvider.cs b/Adyen/Client/TokenProvider.cs deleted file mode 100644 index f9374378f..000000000 --- a/Adyen/Client/TokenProvider.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Linq; -using System.Collections.Generic; -using Adyen.Client; - -namespace Adyen -{ - /// - /// A class which will provide tokens. - /// - public abstract class TokenProvider where TTokenBase : TokenBase - { - /// - /// The array of tokens. - /// - protected TTokenBase[] _tokens; - - internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); - - /// - /// Instantiates a TokenProvider. - /// - /// - public TokenProvider(IEnumerable tokens) - { - _tokens = tokens.ToArray(); - - if (_tokens.Length == 0) - throw new ArgumentException("You did not provide any tokens."); - } - } -} \ No newline at end of file diff --git a/Adyen/Extensions/IHostBuilderExtensions.cs b/Adyen/Extensions/IHostBuilderExtensions.cs deleted file mode 100644 index 1d8f957a1..000000000 --- a/Adyen/Extensions/IHostBuilderExtensions.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -#nullable enable - -using System; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Adyen.Client; - -namespace Adyen.Extensions -{ - /// - /// Extension methods for IHostBuilder - /// - public static class IHostBuilderExtensions - { - /// - /// Add the api to your host builder. - /// - /// - /// - public static IHostBuilder ConfigureCheckoutApi(this IHostBuilder builder, Action options) - { - builder.ConfigureServices((context, services) => - { - HostConfiguration config = new HostConfiguration(services); - - options(context, services, config); - - IServiceCollectionExtensions.AddCheckoutApiServices(services, config); - }); - - return builder; - } - } -} diff --git a/Adyen/Extensions/IHttpClientBuilderExtensions.cs b/Adyen/Extensions/IHttpClientBuilderExtensions.cs deleted file mode 100644 index c26c5fd90..000000000 --- a/Adyen/Extensions/IHttpClientBuilderExtensions.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -#nullable enable - -using System; -using System.Net.Http; -using Microsoft.Extensions.DependencyInjection; -using Polly.Timeout; -using Polly.Extensions.Http; -using Polly; - -namespace Adyen.Extensions -{ - /// - /// Extension methods for IHttpClientBuilder - /// - public static class IHttpClientBuilderExtensions - { - /// - /// Adds a Polly retry policy to your clients. - /// - /// - /// - /// - public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) - { - client.AddPolicyHandler(RetryPolicy(retries)); - - return client; - } - - /// - /// Adds a Polly timeout policy to your clients. - /// - /// - /// - /// - public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) - { - client.AddPolicyHandler(TimeoutPolicy(timeout)); - - return client; - } - - /// - /// Adds a Polly circuit breaker to your clients. - /// - /// - /// - /// - /// - public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) - { - client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); - - return client; - } - - private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) - => HttpPolicyExtensions - .HandleTransientHttpError() - .Or() - .RetryAsync(retries); - - private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) - => Policy.TimeoutAsync(timeout); - - private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( - PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) - => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); - } -} diff --git a/Adyen/Extensions/IServiceCollectionExtensions.cs b/Adyen/Extensions/IServiceCollectionExtensions.cs deleted file mode 100644 index 0592bb733..000000000 --- a/Adyen/Extensions/IServiceCollectionExtensions.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -#nullable enable - -using System; -using System.Linq; -using Microsoft.Extensions.DependencyInjection; -using Adyen.Client; - -namespace Adyen.Extensions -{ - /// - /// Extension methods for IServiceCollection - /// - public static class IServiceCollectionExtensions - { - /// - /// Add the Adyen CheckoutApi API services to your host builder. - /// - /// - /// - public static void AddCheckoutApiServices(this IServiceCollection services, Action options) - { - HostConfiguration config = new(services); - options(config); - AddCheckoutApiServices(services, config); - } - - internal static void AddCheckoutApiServices(IServiceCollection services, HostConfiguration host) - { - if (!host.HttpClientsAdded) - host.AddCheckoutApiHttpClients(); - - services.AddSingleton(); - - // ensure that a token provider was provided for this token type - // if not, default to RateLimitProvider - var containerServices = services.Where(s => s.ServiceType.IsGenericType && - s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); - - foreach(var containerService in containerServices) - { - var tokenType = containerService.ServiceType.GenericTypeArguments[0]; - - var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); - - if (provider == null) - { - services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); - services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), - s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); - } - } - } - } -} diff --git a/Adyen/Model/AcsWebhooks/AuthenticationNotificationData.cs b/Adyen/Model/AcsWebhooks/AuthenticationNotificationData.cs index 82418b422..dbb25c08a 100644 --- a/Adyen/Model/AcsWebhooks/AuthenticationNotificationData.cs +++ b/Adyen/Model/AcsWebhooks/AuthenticationNotificationData.cs @@ -76,8 +76,8 @@ protected AuthenticationNotificationData() { } /// /// authentication (required). /// The unique identifier of the balance platform.. - /// Unique identifier of the authentication. (required). - /// Unique identifier of the payment instrument that was used for the authentication. (required). + /// The unique identifier of the authentication. (required). + /// The unique identifier of the payment instrument that was used for the authentication. (required). /// purchase (required). /// Outcome of the authentication. Allowed values: * authenticated * rejected * error (required). public AuthenticationNotificationData(AuthenticationInfo authentication = default(AuthenticationInfo), string balancePlatform = default(string), string id = default(string), string paymentInstrumentId = default(string), PurchaseInfo purchase = default(PurchaseInfo), StatusEnum status = default(StatusEnum)) @@ -104,16 +104,16 @@ protected AuthenticationNotificationData() { } public string BalancePlatform { get; set; } /// - /// Unique identifier of the authentication. + /// The unique identifier of the authentication. /// - /// Unique identifier of the authentication. + /// The unique identifier of the authentication. [DataMember(Name = "id", IsRequired = false, EmitDefaultValue = false)] public string Id { get; set; } /// - /// Unique identifier of the payment instrument that was used for the authentication. + /// The unique identifier of the payment instrument that was used for the authentication. /// - /// Unique identifier of the payment instrument that was used for the authentication. + /// The unique identifier of the payment instrument that was used for the authentication. [DataMember(Name = "paymentInstrumentId", IsRequired = false, EmitDefaultValue = false)] public string PaymentInstrumentId { get; set; } diff --git a/Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs index ecbae9104..1d24000b9 100644 --- a/Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs +++ b/Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs @@ -35,16 +35,16 @@ public partial class BalancePlatformNotificationResponse : IEquatable /// Initializes a new instance of the class. /// - /// Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications).. + /// Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks).. public BalancePlatformNotificationResponse(string notificationResponse = default(string)) { this.NotificationResponse = notificationResponse; } /// - /// Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + /// Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks). /// - /// Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + /// Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks). [DataMember(Name = "notificationResponse", EmitDefaultValue = false)] public string NotificationResponse { get; set; } diff --git a/Adyen/Model/AcsWebhooks/PurchaseInfo.cs b/Adyen/Model/AcsWebhooks/PurchaseInfo.cs index 511b1a6ab..29200bd8f 100644 --- a/Adyen/Model/AcsWebhooks/PurchaseInfo.cs +++ b/Adyen/Model/AcsWebhooks/PurchaseInfo.cs @@ -40,8 +40,8 @@ protected PurchaseInfo() { } /// /// Initializes a new instance of the class. /// - /// Date of the purchase. (required). - /// Name of the merchant. (required). + /// The date of the purchase. (required). + /// The name of the business that the cardholder purchased from. (required). /// originalAmount (required). public PurchaseInfo(string date = default(string), string merchantName = default(string), Amount originalAmount = default(Amount)) { @@ -51,16 +51,16 @@ protected PurchaseInfo() { } } /// - /// Date of the purchase. + /// The date of the purchase. /// - /// Date of the purchase. + /// The date of the purchase. [DataMember(Name = "date", IsRequired = false, EmitDefaultValue = false)] public string Date { get; set; } /// - /// Name of the merchant. + /// The name of the business that the cardholder purchased from. /// - /// Name of the merchant. + /// The name of the business that the cardholder purchased from. [DataMember(Name = "merchantName", IsRequired = false, EmitDefaultValue = false)] public string MerchantName { get; set; } diff --git a/Adyen/Model/AcsWebhooks/RelayedAuthenticationRequest.cs b/Adyen/Model/AcsWebhooks/RelayedAuthenticationRequest.cs index 0dd6d2895..8c190ddc1 100644 --- a/Adyen/Model/AcsWebhooks/RelayedAuthenticationRequest.cs +++ b/Adyen/Model/AcsWebhooks/RelayedAuthenticationRequest.cs @@ -32,6 +32,28 @@ namespace Adyen.Model.AcsWebhooks [DataContract(Name = "RelayedAuthenticationRequest")] public partial class RelayedAuthenticationRequest : IEquatable, IValidatableObject { + /// + /// Type of notification. + /// + /// Type of notification. + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum BalancePlatformAuthenticationRelayed for value: balancePlatform.authentication.relayed + /// + [EnumMember(Value = "balancePlatform.authentication.relayed")] + BalancePlatformAuthenticationRelayed = 1 + + } + + + /// + /// Type of notification. + /// + /// Type of notification. + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + public TypeEnum Type { get; set; } /// /// Initializes a new instance of the class. /// @@ -40,16 +62,31 @@ protected RelayedAuthenticationRequest() { } /// /// Initializes a new instance of the class. /// + /// The environment from which the webhook originated. Possible values: **test**, **live**. (required). /// The unique identifier of the challenge. (required). /// The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/paymentInstruments/_id_) used for the purchase. (required). /// purchase (required). - public RelayedAuthenticationRequest(string id = default(string), string paymentInstrumentId = default(string), Purchase purchase = default(Purchase)) + /// URL for auto-switching to the threeDS Requestor App. If not present, the threeDS Requestor App doesn't support auto-switching.. + /// When the event was queued.. + /// Type of notification. (required). + public RelayedAuthenticationRequest(string environment = default(string), string id = default(string), string paymentInstrumentId = default(string), Purchase purchase = default(Purchase), string threeDSRequestorAppURL = default(string), DateTime timestamp = default(DateTime), TypeEnum type = default(TypeEnum)) { + this.Environment = environment; this.Id = id; this.PaymentInstrumentId = paymentInstrumentId; this.Purchase = purchase; + this.Type = type; + this.ThreeDSRequestorAppURL = threeDSRequestorAppURL; + this.Timestamp = timestamp; } + /// + /// The environment from which the webhook originated. Possible values: **test**, **live**. + /// + /// The environment from which the webhook originated. Possible values: **test**, **live**. + [DataMember(Name = "environment", IsRequired = false, EmitDefaultValue = false)] + public string Environment { get; set; } + /// /// The unique identifier of the challenge. /// @@ -70,6 +107,20 @@ protected RelayedAuthenticationRequest() { } [DataMember(Name = "purchase", IsRequired = false, EmitDefaultValue = false)] public Purchase Purchase { get; set; } + /// + /// URL for auto-switching to the threeDS Requestor App. If not present, the threeDS Requestor App doesn't support auto-switching. + /// + /// URL for auto-switching to the threeDS Requestor App. If not present, the threeDS Requestor App doesn't support auto-switching. + [DataMember(Name = "threeDSRequestorAppURL", EmitDefaultValue = false)] + public string ThreeDSRequestorAppURL { get; set; } + + /// + /// When the event was queued. + /// + /// When the event was queued. + [DataMember(Name = "timestamp", EmitDefaultValue = false)] + public DateTime Timestamp { get; set; } + /// /// Returns the string presentation of the object /// @@ -78,9 +129,13 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class RelayedAuthenticationRequest {\n"); + sb.Append(" Environment: ").Append(Environment).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" PaymentInstrumentId: ").Append(PaymentInstrumentId).Append("\n"); sb.Append(" Purchase: ").Append(Purchase).Append("\n"); + sb.Append(" ThreeDSRequestorAppURL: ").Append(ThreeDSRequestorAppURL).Append("\n"); + sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -116,6 +171,11 @@ public bool Equals(RelayedAuthenticationRequest input) return false; } return + ( + this.Environment == input.Environment || + (this.Environment != null && + this.Environment.Equals(input.Environment)) + ) && ( this.Id == input.Id || (this.Id != null && @@ -130,6 +190,20 @@ public bool Equals(RelayedAuthenticationRequest input) this.Purchase == input.Purchase || (this.Purchase != null && this.Purchase.Equals(input.Purchase)) + ) && + ( + this.ThreeDSRequestorAppURL == input.ThreeDSRequestorAppURL || + (this.ThreeDSRequestorAppURL != null && + this.ThreeDSRequestorAppURL.Equals(input.ThreeDSRequestorAppURL)) + ) && + ( + this.Timestamp == input.Timestamp || + (this.Timestamp != null && + this.Timestamp.Equals(input.Timestamp)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) ); } @@ -142,6 +216,10 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.Environment != null) + { + hashCode = (hashCode * 59) + this.Environment.GetHashCode(); + } if (this.Id != null) { hashCode = (hashCode * 59) + this.Id.GetHashCode(); @@ -154,6 +232,15 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.Purchase.GetHashCode(); } + if (this.ThreeDSRequestorAppURL != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestorAppURL.GetHashCode(); + } + if (this.Timestamp != null) + { + hashCode = (hashCode * 59) + this.Timestamp.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); return hashCode; } } diff --git a/Adyen/Model/AcsWebhooks/Resource.cs b/Adyen/Model/AcsWebhooks/Resource.cs index 9dcd4a3d0..b77e9d028 100644 --- a/Adyen/Model/AcsWebhooks/Resource.cs +++ b/Adyen/Model/AcsWebhooks/Resource.cs @@ -36,7 +36,7 @@ public partial class Resource : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// The unique identifier of the balance platform.. - /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.. + /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**.. /// The ID of the resource.. public Resource(string balancePlatform = default(string), DateTime creationDate = default(DateTime), string id = default(string)) { @@ -53,9 +53,9 @@ public partial class Resource : IEquatable, IValidatableObject public string BalancePlatform { get; set; } /// - /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**. /// - /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**. [DataMember(Name = "creationDate", EmitDefaultValue = false)] public DateTime CreationDate { get; set; } diff --git a/Adyen/Model/BalancePlatform/VerificationError.cs b/Adyen/Model/BalancePlatform/VerificationError.cs index 64777db77..ab623fc06 100644 --- a/Adyen/Model/BalancePlatform/VerificationError.cs +++ b/Adyen/Model/BalancePlatform/VerificationError.cs @@ -401,15 +401,20 @@ public enum TypeEnum /// Enum PendingStatus for value: pendingStatus /// [EnumMember(Value = "pendingStatus")] - PendingStatus = 3 - + PendingStatus = 3, + + /// + /// Enum DataReview for value: dataReview + /// + [EnumMember(Value = "dataReview")] + DataReview = 4 } /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** [DataMember(Name = "type", EmitDefaultValue = false)] public TypeEnum? Type { get; set; } /// @@ -420,7 +425,7 @@ public enum TypeEnum /// A description of the error.. /// Contains the actions that you can take to resolve the verification error.. /// Contains more granular information about the verification error.. - /// The type of error. Possible values: **invalidInput**, **dataMissing**.. + /// The type of error. Possible values: **invalidInput**, **dataMissing**, **pendingStatus**, **dataReview** . public VerificationError(List capabilities = default(List), string code = default(string), string message = default(string), List remediatingActions = default(List), List subErrors = default(List), TypeEnum? type = default(TypeEnum?)) { this.Capabilities = capabilities; diff --git a/Adyen/Model/BalancePlatform/VerificationErrorRecursive.cs b/Adyen/Model/BalancePlatform/VerificationErrorRecursive.cs index eb3720572..9bf8551f9 100644 --- a/Adyen/Model/BalancePlatform/VerificationErrorRecursive.cs +++ b/Adyen/Model/BalancePlatform/VerificationErrorRecursive.cs @@ -379,9 +379,9 @@ public enum CapabilitiesEnum [DataMember(Name = "capabilities", EmitDefaultValue = false)] public List Capabilities { get; set; } /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { @@ -401,15 +401,21 @@ public enum TypeEnum /// Enum PendingStatus for value: pendingStatus /// [EnumMember(Value = "pendingStatus")] - PendingStatus = 3 + PendingStatus = 3, + + /// + /// Enum DataReview for value: dataReview + /// + [EnumMember(Value = "dataReview")] + DataReview = 4 } /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** [DataMember(Name = "type", EmitDefaultValue = false)] public TypeEnum? Type { get; set; } /// diff --git a/Adyen/Model/Checkout/AbstractOpenAPISchema.cs b/Adyen/Model/Checkout/AbstractOpenAPISchema.cs new file mode 100644 index 000000000..69c1440c8 --- /dev/null +++ b/Adyen/Model/Checkout/AbstractOpenAPISchema.cs @@ -0,0 +1,81 @@ +/* +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace Adyen.Model.Checkout +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + public abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + + // Check if the contains TypeEnum value + protected static bool ContainsValue(string type) where T : struct, IConvertible + { + // Search for type in .TypeEnum + List list = new List(); + var members = typeof(T).GetTypeInfo().DeclaredMembers; + foreach (var member in members) + { + var val = member?.GetCustomAttribute(false)?.Value; + if (!string.IsNullOrEmpty(val)) + { + list.Add(val); + } + } + + return list.Contains(type); + } + } +} diff --git a/Adyen/Model/Checkout/AccountInfo.cs b/Adyen/Model/Checkout/AccountInfo.cs index ae13ff856..0b3dbec79 100644 --- a/Adyen/Model/Checkout/AccountInfo.cs +++ b/Adyen/Model/Checkout/AccountInfo.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,935 +15,413 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AccountInfo /// - public partial class AccountInfo : IValidatableObject + [DataContract(Name = "AccountInfo")] + public partial class AccountInfo : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - /// Date when the shopper's account was last changed. - /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - /// Date when the shopper's account was created. - /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit - /// Number of attempts the shopper tried to add a card to their account in the last day. - /// Date the selected delivery address was first used. - /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - /// Shopper's home phone number (including the country code). - /// Shopper's mobile phone number (including the country code). - /// Date when the shopper last changed their password. - /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - /// Number of all transactions (successful and abandoned) from this shopper in the past 24 hours. - /// Number of all transactions (successful and abandoned) from this shopper in the past year. - /// Date this payment method was added to the shopper's account. - /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - /// Number of successful purchases in the last six months. - /// Whether suspicious activity was recorded on this account. - /// Shopper's work phone number (including the country code). - [JsonConstructor] - public AccountInfo(Option accountAgeIndicator = default, Option accountChangeDate = default, Option accountChangeIndicator = default, Option accountCreationDate = default, Option accountType = default, Option addCardAttemptsDay = default, Option deliveryAddressUsageDate = default, Option deliveryAddressUsageIndicator = default, Option homePhone = default, Option mobilePhone = default, Option passwordChangeDate = default, Option passwordChangeIndicator = default, Option pastTransactionsDay = default, Option pastTransactionsYear = default, Option paymentAccountAge = default, Option paymentAccountIndicator = default, Option purchasesLast6Months = default, Option suspiciousActivity = default, Option workPhone = default) - { - AccountAgeIndicatorOption = accountAgeIndicator; - AccountChangeDateOption = accountChangeDate; - AccountChangeIndicatorOption = accountChangeIndicator; - AccountCreationDateOption = accountCreationDate; - AccountTypeOption = accountType; - AddCardAttemptsDayOption = addCardAttemptsDay; - DeliveryAddressUsageDateOption = deliveryAddressUsageDate; - DeliveryAddressUsageIndicatorOption = deliveryAddressUsageIndicator; - HomePhoneOption = homePhone; - MobilePhoneOption = mobilePhone; - PasswordChangeDateOption = passwordChangeDate; - PasswordChangeIndicatorOption = passwordChangeIndicator; - PastTransactionsDayOption = pastTransactionsDay; - PastTransactionsYearOption = pastTransactionsYear; - PaymentAccountAgeOption = paymentAccountAge; - PaymentAccountIndicatorOption = paymentAccountIndicator; - PurchasesLast6MonthsOption = purchasesLast6Months; - SuspiciousActivityOption = suspiciousActivity; - WorkPhoneOption = workPhone; - OnCreated(); - } - - partial void OnCreated(); - /// /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + [JsonConverter(typeof(StringEnumConverter))] public enum AccountAgeIndicatorEnum { /// /// Enum NotApplicable for value: notApplicable /// + [EnumMember(Value = "notApplicable")] NotApplicable = 1, /// /// Enum ThisTransaction for value: thisTransaction /// + [EnumMember(Value = "thisTransaction")] ThisTransaction = 2, /// /// Enum LessThan30Days for value: lessThan30Days /// + [EnumMember(Value = "lessThan30Days")] LessThan30Days = 3, /// /// Enum From30To60Days for value: from30To60Days /// + [EnumMember(Value = "from30To60Days")] From30To60Days = 4, /// /// Enum MoreThan60Days for value: moreThan60Days /// + [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static AccountAgeIndicatorEnum AccountAgeIndicatorEnumFromString(string value) - { - if (value.Equals("notApplicable")) - return AccountAgeIndicatorEnum.NotApplicable; - - if (value.Equals("thisTransaction")) - return AccountAgeIndicatorEnum.ThisTransaction; - - if (value.Equals("lessThan30Days")) - return AccountAgeIndicatorEnum.LessThan30Days; - - if (value.Equals("from30To60Days")) - return AccountAgeIndicatorEnum.From30To60Days; - - if (value.Equals("moreThan60Days")) - return AccountAgeIndicatorEnum.MoreThan60Days; - - throw new NotImplementedException($"Could not convert value to type AccountAgeIndicatorEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static AccountAgeIndicatorEnum? AccountAgeIndicatorEnumFromStringOrDefault(string value) - { - if (value.Equals("notApplicable")) - return AccountAgeIndicatorEnum.NotApplicable; - - if (value.Equals("thisTransaction")) - return AccountAgeIndicatorEnum.ThisTransaction; - - if (value.Equals("lessThan30Days")) - return AccountAgeIndicatorEnum.LessThan30Days; - - if (value.Equals("from30To60Days")) - return AccountAgeIndicatorEnum.From30To60Days; - - if (value.Equals("moreThan60Days")) - return AccountAgeIndicatorEnum.MoreThan60Days; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string AccountAgeIndicatorEnumToJsonValue(AccountAgeIndicatorEnum? value) - { - if (value == AccountAgeIndicatorEnum.NotApplicable) - return "notApplicable"; - - if (value == AccountAgeIndicatorEnum.ThisTransaction) - return "thisTransaction"; - - if (value == AccountAgeIndicatorEnum.LessThan30Days) - return "lessThan30Days"; - - if (value == AccountAgeIndicatorEnum.From30To60Days) - return "from30To60Days"; - if (value == AccountAgeIndicatorEnum.MoreThan60Days) - return "moreThan60Days"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of AccountAgeIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountAgeIndicatorOption { get; private set; } /// /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [JsonPropertyName("accountAgeIndicator")] - public AccountAgeIndicatorEnum? AccountAgeIndicator { get { return this.AccountAgeIndicatorOption; } set { this.AccountAgeIndicatorOption = new Option(value); } } - + [DataMember(Name = "accountAgeIndicator", EmitDefaultValue = false)] + public AccountAgeIndicatorEnum? AccountAgeIndicator { get; set; } /// /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + [JsonConverter(typeof(StringEnumConverter))] public enum AccountChangeIndicatorEnum { /// /// Enum ThisTransaction for value: thisTransaction /// + [EnumMember(Value = "thisTransaction")] ThisTransaction = 1, /// /// Enum LessThan30Days for value: lessThan30Days /// + [EnumMember(Value = "lessThan30Days")] LessThan30Days = 2, /// /// Enum From30To60Days for value: from30To60Days /// + [EnumMember(Value = "from30To60Days")] From30To60Days = 3, /// /// Enum MoreThan60Days for value: moreThan60Days /// + [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 4 - } - /// - /// Returns a - /// - /// - /// - /// - public static AccountChangeIndicatorEnum AccountChangeIndicatorEnumFromString(string value) - { - if (value.Equals("thisTransaction")) - return AccountChangeIndicatorEnum.ThisTransaction; - - if (value.Equals("lessThan30Days")) - return AccountChangeIndicatorEnum.LessThan30Days; - - if (value.Equals("from30To60Days")) - return AccountChangeIndicatorEnum.From30To60Days; - - if (value.Equals("moreThan60Days")) - return AccountChangeIndicatorEnum.MoreThan60Days; - - throw new NotImplementedException($"Could not convert value to type AccountChangeIndicatorEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static AccountChangeIndicatorEnum? AccountChangeIndicatorEnumFromStringOrDefault(string value) - { - if (value.Equals("thisTransaction")) - return AccountChangeIndicatorEnum.ThisTransaction; - - if (value.Equals("lessThan30Days")) - return AccountChangeIndicatorEnum.LessThan30Days; - - if (value.Equals("from30To60Days")) - return AccountChangeIndicatorEnum.From30To60Days; - - if (value.Equals("moreThan60Days")) - return AccountChangeIndicatorEnum.MoreThan60Days; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string AccountChangeIndicatorEnumToJsonValue(AccountChangeIndicatorEnum? value) - { - if (value == AccountChangeIndicatorEnum.ThisTransaction) - return "thisTransaction"; - - if (value == AccountChangeIndicatorEnum.LessThan30Days) - return "lessThan30Days"; - - if (value == AccountChangeIndicatorEnum.From30To60Days) - return "from30To60Days"; - - if (value == AccountChangeIndicatorEnum.MoreThan60Days) - return "moreThan60Days"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of AccountChangeIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountChangeIndicatorOption { get; private set; } /// /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [JsonPropertyName("accountChangeIndicator")] - public AccountChangeIndicatorEnum? AccountChangeIndicator { get { return this.AccountChangeIndicatorOption; } set { this.AccountChangeIndicatorOption = new Option(value); } } - + [DataMember(Name = "accountChangeIndicator", EmitDefaultValue = false)] + public AccountChangeIndicatorEnum? AccountChangeIndicator { get; set; } /// /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit /// /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit + [JsonConverter(typeof(StringEnumConverter))] public enum AccountTypeEnum { /// /// Enum NotApplicable for value: notApplicable /// + [EnumMember(Value = "notApplicable")] NotApplicable = 1, /// /// Enum Credit for value: credit /// + [EnumMember(Value = "credit")] Credit = 2, /// /// Enum Debit for value: debit /// + [EnumMember(Value = "debit")] Debit = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static AccountTypeEnum AccountTypeEnumFromString(string value) - { - if (value.Equals("notApplicable")) - return AccountTypeEnum.NotApplicable; - - if (value.Equals("credit")) - return AccountTypeEnum.Credit; - - if (value.Equals("debit")) - return AccountTypeEnum.Debit; - throw new NotImplementedException($"Could not convert value to type AccountTypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static AccountTypeEnum? AccountTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("notApplicable")) - return AccountTypeEnum.NotApplicable; - - if (value.Equals("credit")) - return AccountTypeEnum.Credit; - - if (value.Equals("debit")) - return AccountTypeEnum.Debit; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string AccountTypeEnumToJsonValue(AccountTypeEnum? value) - { - if (value == AccountTypeEnum.NotApplicable) - return "notApplicable"; - - if (value == AccountTypeEnum.Credit) - return "credit"; - - if (value == AccountTypeEnum.Debit) - return "debit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of AccountType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountTypeOption { get; private set; } /// /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit /// /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit - [JsonPropertyName("accountType")] - public AccountTypeEnum? AccountType { get { return this.AccountTypeOption; } set { this.AccountTypeOption = new Option(value); } } - + [DataMember(Name = "accountType", EmitDefaultValue = false)] + public AccountTypeEnum? AccountType { get; set; } /// /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + [JsonConverter(typeof(StringEnumConverter))] public enum DeliveryAddressUsageIndicatorEnum { /// /// Enum ThisTransaction for value: thisTransaction /// + [EnumMember(Value = "thisTransaction")] ThisTransaction = 1, /// /// Enum LessThan30Days for value: lessThan30Days /// + [EnumMember(Value = "lessThan30Days")] LessThan30Days = 2, /// /// Enum From30To60Days for value: from30To60Days /// + [EnumMember(Value = "from30To60Days")] From30To60Days = 3, /// /// Enum MoreThan60Days for value: moreThan60Days /// + [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static DeliveryAddressUsageIndicatorEnum DeliveryAddressUsageIndicatorEnumFromString(string value) - { - if (value.Equals("thisTransaction")) - return DeliveryAddressUsageIndicatorEnum.ThisTransaction; - - if (value.Equals("lessThan30Days")) - return DeliveryAddressUsageIndicatorEnum.LessThan30Days; - if (value.Equals("from30To60Days")) - return DeliveryAddressUsageIndicatorEnum.From30To60Days; - - if (value.Equals("moreThan60Days")) - return DeliveryAddressUsageIndicatorEnum.MoreThan60Days; - - throw new NotImplementedException($"Could not convert value to type DeliveryAddressUsageIndicatorEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static DeliveryAddressUsageIndicatorEnum? DeliveryAddressUsageIndicatorEnumFromStringOrDefault(string value) - { - if (value.Equals("thisTransaction")) - return DeliveryAddressUsageIndicatorEnum.ThisTransaction; - - if (value.Equals("lessThan30Days")) - return DeliveryAddressUsageIndicatorEnum.LessThan30Days; - - if (value.Equals("from30To60Days")) - return DeliveryAddressUsageIndicatorEnum.From30To60Days; - - if (value.Equals("moreThan60Days")) - return DeliveryAddressUsageIndicatorEnum.MoreThan60Days; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string DeliveryAddressUsageIndicatorEnumToJsonValue(DeliveryAddressUsageIndicatorEnum? value) - { - if (value == DeliveryAddressUsageIndicatorEnum.ThisTransaction) - return "thisTransaction"; - - if (value == DeliveryAddressUsageIndicatorEnum.LessThan30Days) - return "lessThan30Days"; - - if (value == DeliveryAddressUsageIndicatorEnum.From30To60Days) - return "from30To60Days"; - - if (value == DeliveryAddressUsageIndicatorEnum.MoreThan60Days) - return "moreThan60Days"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of DeliveryAddressUsageIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryAddressUsageIndicatorOption { get; private set; } /// /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [JsonPropertyName("deliveryAddressUsageIndicator")] - public DeliveryAddressUsageIndicatorEnum? DeliveryAddressUsageIndicator { get { return this.DeliveryAddressUsageIndicatorOption; } set { this.DeliveryAddressUsageIndicatorOption = new Option(value); } } - + [DataMember(Name = "deliveryAddressUsageIndicator", EmitDefaultValue = false)] + public DeliveryAddressUsageIndicatorEnum? DeliveryAddressUsageIndicator { get; set; } /// /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + [JsonConverter(typeof(StringEnumConverter))] public enum PasswordChangeIndicatorEnum { /// /// Enum NotApplicable for value: notApplicable /// + [EnumMember(Value = "notApplicable")] NotApplicable = 1, /// /// Enum ThisTransaction for value: thisTransaction /// + [EnumMember(Value = "thisTransaction")] ThisTransaction = 2, /// /// Enum LessThan30Days for value: lessThan30Days /// + [EnumMember(Value = "lessThan30Days")] LessThan30Days = 3, /// /// Enum From30To60Days for value: from30To60Days /// + [EnumMember(Value = "from30To60Days")] From30To60Days = 4, /// /// Enum MoreThan60Days for value: moreThan60Days /// + [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static PasswordChangeIndicatorEnum PasswordChangeIndicatorEnumFromString(string value) - { - if (value.Equals("notApplicable")) - return PasswordChangeIndicatorEnum.NotApplicable; - - if (value.Equals("thisTransaction")) - return PasswordChangeIndicatorEnum.ThisTransaction; - - if (value.Equals("lessThan30Days")) - return PasswordChangeIndicatorEnum.LessThan30Days; - if (value.Equals("from30To60Days")) - return PasswordChangeIndicatorEnum.From30To60Days; - - if (value.Equals("moreThan60Days")) - return PasswordChangeIndicatorEnum.MoreThan60Days; - - throw new NotImplementedException($"Could not convert value to type PasswordChangeIndicatorEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static PasswordChangeIndicatorEnum? PasswordChangeIndicatorEnumFromStringOrDefault(string value) - { - if (value.Equals("notApplicable")) - return PasswordChangeIndicatorEnum.NotApplicable; - - if (value.Equals("thisTransaction")) - return PasswordChangeIndicatorEnum.ThisTransaction; - - if (value.Equals("lessThan30Days")) - return PasswordChangeIndicatorEnum.LessThan30Days; - - if (value.Equals("from30To60Days")) - return PasswordChangeIndicatorEnum.From30To60Days; - - if (value.Equals("moreThan60Days")) - return PasswordChangeIndicatorEnum.MoreThan60Days; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string PasswordChangeIndicatorEnumToJsonValue(PasswordChangeIndicatorEnum? value) - { - if (value == PasswordChangeIndicatorEnum.NotApplicable) - return "notApplicable"; - - if (value == PasswordChangeIndicatorEnum.ThisTransaction) - return "thisTransaction"; - - if (value == PasswordChangeIndicatorEnum.LessThan30Days) - return "lessThan30Days"; - - if (value == PasswordChangeIndicatorEnum.From30To60Days) - return "from30To60Days"; - - if (value == PasswordChangeIndicatorEnum.MoreThan60Days) - return "moreThan60Days"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of PasswordChangeIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PasswordChangeIndicatorOption { get; private set; } /// /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [JsonPropertyName("passwordChangeIndicator")] - public PasswordChangeIndicatorEnum? PasswordChangeIndicator { get { return this.PasswordChangeIndicatorOption; } set { this.PasswordChangeIndicatorOption = new Option(value); } } - + [DataMember(Name = "passwordChangeIndicator", EmitDefaultValue = false)] + public PasswordChangeIndicatorEnum? PasswordChangeIndicator { get; set; } /// /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + [JsonConverter(typeof(StringEnumConverter))] public enum PaymentAccountIndicatorEnum { /// /// Enum NotApplicable for value: notApplicable /// + [EnumMember(Value = "notApplicable")] NotApplicable = 1, /// /// Enum ThisTransaction for value: thisTransaction /// + [EnumMember(Value = "thisTransaction")] ThisTransaction = 2, /// /// Enum LessThan30Days for value: lessThan30Days /// + [EnumMember(Value = "lessThan30Days")] LessThan30Days = 3, /// /// Enum From30To60Days for value: from30To60Days /// + [EnumMember(Value = "from30To60Days")] From30To60Days = 4, /// /// Enum MoreThan60Days for value: moreThan60Days /// + [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 5 - } - /// - /// Returns a - /// - /// - /// - /// - public static PaymentAccountIndicatorEnum PaymentAccountIndicatorEnumFromString(string value) - { - if (value.Equals("notApplicable")) - return PaymentAccountIndicatorEnum.NotApplicable; - - if (value.Equals("thisTransaction")) - return PaymentAccountIndicatorEnum.ThisTransaction; - - if (value.Equals("lessThan30Days")) - return PaymentAccountIndicatorEnum.LessThan30Days; - - if (value.Equals("from30To60Days")) - return PaymentAccountIndicatorEnum.From30To60Days; - - if (value.Equals("moreThan60Days")) - return PaymentAccountIndicatorEnum.MoreThan60Days; - - throw new NotImplementedException($"Could not convert value to type PaymentAccountIndicatorEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static PaymentAccountIndicatorEnum? PaymentAccountIndicatorEnumFromStringOrDefault(string value) - { - if (value.Equals("notApplicable")) - return PaymentAccountIndicatorEnum.NotApplicable; - - if (value.Equals("thisTransaction")) - return PaymentAccountIndicatorEnum.ThisTransaction; - - if (value.Equals("lessThan30Days")) - return PaymentAccountIndicatorEnum.LessThan30Days; - - if (value.Equals("from30To60Days")) - return PaymentAccountIndicatorEnum.From30To60Days; - - if (value.Equals("moreThan60Days")) - return PaymentAccountIndicatorEnum.MoreThan60Days; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string PaymentAccountIndicatorEnumToJsonValue(PaymentAccountIndicatorEnum? value) - { - if (value == PaymentAccountIndicatorEnum.NotApplicable) - return "notApplicable"; - - if (value == PaymentAccountIndicatorEnum.ThisTransaction) - return "thisTransaction"; - - if (value == PaymentAccountIndicatorEnum.LessThan30Days) - return "lessThan30Days"; - - if (value == PaymentAccountIndicatorEnum.From30To60Days) - return "from30To60Days"; - - if (value == PaymentAccountIndicatorEnum.MoreThan60Days) - return "moreThan60Days"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of PaymentAccountIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentAccountIndicatorOption { get; private set; } /// /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days - [JsonPropertyName("paymentAccountIndicator")] - public PaymentAccountIndicatorEnum? PaymentAccountIndicator { get { return this.PaymentAccountIndicatorOption; } set { this.PaymentAccountIndicatorOption = new Option(value); } } - + [DataMember(Name = "paymentAccountIndicator", EmitDefaultValue = false)] + public PaymentAccountIndicatorEnum? PaymentAccountIndicator { get; set; } /// - /// Used to track the state of AccountChangeDate + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountChangeDateOption { get; private set; } + /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. + /// Date when the shopper's account was last changed.. + /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. + /// Date when the shopper's account was created.. + /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit. + /// Number of attempts the shopper tried to add a card to their account in the last day.. + /// Date the selected delivery address was first used.. + /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. + /// Shopper's home phone number (including the country code).. + /// Shopper's mobile phone number (including the country code).. + /// Date when the shopper last changed their password.. + /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. + /// Number of all transactions (successful and abandoned) from this shopper in the past 24 hours.. + /// Number of all transactions (successful and abandoned) from this shopper in the past year.. + /// Date this payment method was added to the shopper's account.. + /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. + /// Number of successful purchases in the last six months.. + /// Whether suspicious activity was recorded on this account.. + /// Shopper's work phone number (including the country code).. + public AccountInfo(AccountAgeIndicatorEnum? accountAgeIndicator = default(AccountAgeIndicatorEnum?), DateTime accountChangeDate = default(DateTime), AccountChangeIndicatorEnum? accountChangeIndicator = default(AccountChangeIndicatorEnum?), DateTime accountCreationDate = default(DateTime), AccountTypeEnum? accountType = default(AccountTypeEnum?), int? addCardAttemptsDay = default(int?), DateTime deliveryAddressUsageDate = default(DateTime), DeliveryAddressUsageIndicatorEnum? deliveryAddressUsageIndicator = default(DeliveryAddressUsageIndicatorEnum?), string homePhone = default(string), string mobilePhone = default(string), DateTime passwordChangeDate = default(DateTime), PasswordChangeIndicatorEnum? passwordChangeIndicator = default(PasswordChangeIndicatorEnum?), int? pastTransactionsDay = default(int?), int? pastTransactionsYear = default(int?), DateTime paymentAccountAge = default(DateTime), PaymentAccountIndicatorEnum? paymentAccountIndicator = default(PaymentAccountIndicatorEnum?), int? purchasesLast6Months = default(int?), bool? suspiciousActivity = default(bool?), string workPhone = default(string)) + { + this.AccountAgeIndicator = accountAgeIndicator; + this.AccountChangeDate = accountChangeDate; + this.AccountChangeIndicator = accountChangeIndicator; + this.AccountCreationDate = accountCreationDate; + this.AccountType = accountType; + this.AddCardAttemptsDay = addCardAttemptsDay; + this.DeliveryAddressUsageDate = deliveryAddressUsageDate; + this.DeliveryAddressUsageIndicator = deliveryAddressUsageIndicator; + this.HomePhone = homePhone; + this.MobilePhone = mobilePhone; + this.PasswordChangeDate = passwordChangeDate; + this.PasswordChangeIndicator = passwordChangeIndicator; + this.PastTransactionsDay = pastTransactionsDay; + this.PastTransactionsYear = pastTransactionsYear; + this.PaymentAccountAge = paymentAccountAge; + this.PaymentAccountIndicator = paymentAccountIndicator; + this.PurchasesLast6Months = purchasesLast6Months; + this.SuspiciousActivity = suspiciousActivity; + this.WorkPhone = workPhone; + } /// /// Date when the shopper's account was last changed. /// /// Date when the shopper's account was last changed. - [JsonPropertyName("accountChangeDate")] - public DateTime? AccountChangeDate { get { return this.AccountChangeDateOption; } set { this.AccountChangeDateOption = new Option(value); } } - - /// - /// Used to track the state of AccountCreationDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountCreationDateOption { get; private set; } + [DataMember(Name = "accountChangeDate", EmitDefaultValue = false)] + public DateTime AccountChangeDate { get; set; } /// /// Date when the shopper's account was created. /// /// Date when the shopper's account was created. - [JsonPropertyName("accountCreationDate")] - public DateTime? AccountCreationDate { get { return this.AccountCreationDateOption; } set { this.AccountCreationDateOption = new Option(value); } } - - /// - /// Used to track the state of AddCardAttemptsDay - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AddCardAttemptsDayOption { get; private set; } + [DataMember(Name = "accountCreationDate", EmitDefaultValue = false)] + public DateTime AccountCreationDate { get; set; } /// /// Number of attempts the shopper tried to add a card to their account in the last day. /// /// Number of attempts the shopper tried to add a card to their account in the last day. - [JsonPropertyName("addCardAttemptsDay")] - public int? AddCardAttemptsDay { get { return this.AddCardAttemptsDayOption; } set { this.AddCardAttemptsDayOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryAddressUsageDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryAddressUsageDateOption { get; private set; } + [DataMember(Name = "addCardAttemptsDay", EmitDefaultValue = false)] + public int? AddCardAttemptsDay { get; set; } /// /// Date the selected delivery address was first used. /// /// Date the selected delivery address was first used. - [JsonPropertyName("deliveryAddressUsageDate")] - public DateTime? DeliveryAddressUsageDate { get { return this.DeliveryAddressUsageDateOption; } set { this.DeliveryAddressUsageDateOption = new Option(value); } } - - /// - /// Used to track the state of HomePhone - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option HomePhoneOption { get; private set; } + [DataMember(Name = "deliveryAddressUsageDate", EmitDefaultValue = false)] + public DateTime DeliveryAddressUsageDate { get; set; } /// /// Shopper's home phone number (including the country code). /// /// Shopper's home phone number (including the country code). - [JsonPropertyName("homePhone")] - [Obsolete] - public string HomePhone { get { return this.HomePhoneOption; } set { this.HomePhoneOption = new Option(value); } } - - /// - /// Used to track the state of MobilePhone - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MobilePhoneOption { get; private set; } + [DataMember(Name = "homePhone", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v68. Use `ThreeDS2RequestData.homePhone` instead.")] + public string HomePhone { get; set; } /// /// Shopper's mobile phone number (including the country code). /// /// Shopper's mobile phone number (including the country code). - [JsonPropertyName("mobilePhone")] - [Obsolete] - public string MobilePhone { get { return this.MobilePhoneOption; } set { this.MobilePhoneOption = new Option(value); } } - - /// - /// Used to track the state of PasswordChangeDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PasswordChangeDateOption { get; private set; } + [DataMember(Name = "mobilePhone", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v68. Use `ThreeDS2RequestData.mobilePhone` instead.")] + public string MobilePhone { get; set; } /// /// Date when the shopper last changed their password. /// /// Date when the shopper last changed their password. - [JsonPropertyName("passwordChangeDate")] - public DateTime? PasswordChangeDate { get { return this.PasswordChangeDateOption; } set { this.PasswordChangeDateOption = new Option(value); } } - - /// - /// Used to track the state of PastTransactionsDay - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PastTransactionsDayOption { get; private set; } + [DataMember(Name = "passwordChangeDate", EmitDefaultValue = false)] + public DateTime PasswordChangeDate { get; set; } /// /// Number of all transactions (successful and abandoned) from this shopper in the past 24 hours. /// /// Number of all transactions (successful and abandoned) from this shopper in the past 24 hours. - [JsonPropertyName("pastTransactionsDay")] - public int? PastTransactionsDay { get { return this.PastTransactionsDayOption; } set { this.PastTransactionsDayOption = new Option(value); } } - - /// - /// Used to track the state of PastTransactionsYear - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PastTransactionsYearOption { get; private set; } + [DataMember(Name = "pastTransactionsDay", EmitDefaultValue = false)] + public int? PastTransactionsDay { get; set; } /// /// Number of all transactions (successful and abandoned) from this shopper in the past year. /// /// Number of all transactions (successful and abandoned) from this shopper in the past year. - [JsonPropertyName("pastTransactionsYear")] - public int? PastTransactionsYear { get { return this.PastTransactionsYearOption; } set { this.PastTransactionsYearOption = new Option(value); } } - - /// - /// Used to track the state of PaymentAccountAge - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentAccountAgeOption { get; private set; } + [DataMember(Name = "pastTransactionsYear", EmitDefaultValue = false)] + public int? PastTransactionsYear { get; set; } /// /// Date this payment method was added to the shopper's account. /// /// Date this payment method was added to the shopper's account. - [JsonPropertyName("paymentAccountAge")] - public DateTime? PaymentAccountAge { get { return this.PaymentAccountAgeOption; } set { this.PaymentAccountAgeOption = new Option(value); } } - - /// - /// Used to track the state of PurchasesLast6Months - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PurchasesLast6MonthsOption { get; private set; } + [DataMember(Name = "paymentAccountAge", EmitDefaultValue = false)] + public DateTime PaymentAccountAge { get; set; } /// /// Number of successful purchases in the last six months. /// /// Number of successful purchases in the last six months. - [JsonPropertyName("purchasesLast6Months")] - public int? PurchasesLast6Months { get { return this.PurchasesLast6MonthsOption; } set { this.PurchasesLast6MonthsOption = new Option(value); } } - - /// - /// Used to track the state of SuspiciousActivity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SuspiciousActivityOption { get; private set; } + [DataMember(Name = "purchasesLast6Months", EmitDefaultValue = false)] + public int? PurchasesLast6Months { get; set; } /// /// Whether suspicious activity was recorded on this account. /// /// Whether suspicious activity was recorded on this account. - [JsonPropertyName("suspiciousActivity")] - public bool? SuspiciousActivity { get { return this.SuspiciousActivityOption; } set { this.SuspiciousActivityOption = new Option(value); } } - - /// - /// Used to track the state of WorkPhone - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option WorkPhoneOption { get; private set; } + [DataMember(Name = "suspiciousActivity", EmitDefaultValue = false)] + public bool? SuspiciousActivity { get; set; } /// /// Shopper's work phone number (including the country code). /// /// Shopper's work phone number (including the country code). - [JsonPropertyName("workPhone")] - [Obsolete] - public string WorkPhone { get { return this.WorkPhoneOption; } set { this.WorkPhoneOption = new Option(value); } } + [DataMember(Name = "workPhone", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v68. Use `ThreeDS2RequestData.workPhone` instead.")] + public string WorkPhone { get; set; } /// /// Returns the string presentation of the object @@ -976,326 +455,186 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - - /// - /// A Json converter for type - /// - public class AccountInfoJsonConverter : JsonConverter - { - /// - /// The format to use to serialize AccountChangeDate - /// - public static string AccountChangeDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - - /// - /// The format to use to serialize AccountCreationDate - /// - public static string AccountCreationDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - - /// - /// The format to use to serialize DeliveryAddressUsageDate - /// - public static string DeliveryAddressUsageDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// The format to use to serialize PasswordChangeDate + /// Returns true if objects are equal /// - public static string PasswordChangeDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - - /// - /// The format to use to serialize PaymentAccountAge - /// - public static string PaymentAccountAgeFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AccountInfo); + } /// - /// Deserializes json to + /// Returns true if AccountInfo instances are equal /// - /// - /// - /// - /// - /// - public override AccountInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Instance of AccountInfo to be compared + /// Boolean + public bool Equals(AccountInfo input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option accountAgeIndicator = default; - Option accountChangeDate = default; - Option accountChangeIndicator = default; - Option accountCreationDate = default; - Option accountType = default; - Option addCardAttemptsDay = default; - Option deliveryAddressUsageDate = default; - Option deliveryAddressUsageIndicator = default; - Option homePhone = default; - Option mobilePhone = default; - Option passwordChangeDate = default; - Option passwordChangeIndicator = default; - Option pastTransactionsDay = default; - Option pastTransactionsYear = default; - Option paymentAccountAge = default; - Option paymentAccountIndicator = default; - Option purchasesLast6Months = default; - Option suspiciousActivity = default; - Option workPhone = default; - - while (utf8JsonReader.Read()) + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "accountAgeIndicator": - string accountAgeIndicatorRawValue = utf8JsonReader.GetString(); - if (accountAgeIndicatorRawValue != null) - accountAgeIndicator = new Option(AccountInfo.AccountAgeIndicatorEnumFromStringOrDefault(accountAgeIndicatorRawValue)); - break; - case "accountChangeDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - accountChangeDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "accountChangeIndicator": - string accountChangeIndicatorRawValue = utf8JsonReader.GetString(); - if (accountChangeIndicatorRawValue != null) - accountChangeIndicator = new Option(AccountInfo.AccountChangeIndicatorEnumFromStringOrDefault(accountChangeIndicatorRawValue)); - break; - case "accountCreationDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - accountCreationDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "accountType": - string accountTypeRawValue = utf8JsonReader.GetString(); - if (accountTypeRawValue != null) - accountType = new Option(AccountInfo.AccountTypeEnumFromStringOrDefault(accountTypeRawValue)); - break; - case "addCardAttemptsDay": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - addCardAttemptsDay = new Option(utf8JsonReader.GetInt32()); - break; - case "deliveryAddressUsageDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliveryAddressUsageDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliveryAddressUsageIndicator": - string deliveryAddressUsageIndicatorRawValue = utf8JsonReader.GetString(); - if (deliveryAddressUsageIndicatorRawValue != null) - deliveryAddressUsageIndicator = new Option(AccountInfo.DeliveryAddressUsageIndicatorEnumFromStringOrDefault(deliveryAddressUsageIndicatorRawValue)); - break; - case "homePhone": - homePhone = new Option(utf8JsonReader.GetString()); - break; - case "mobilePhone": - mobilePhone = new Option(utf8JsonReader.GetString()); - break; - case "passwordChangeDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - passwordChangeDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "passwordChangeIndicator": - string passwordChangeIndicatorRawValue = utf8JsonReader.GetString(); - if (passwordChangeIndicatorRawValue != null) - passwordChangeIndicator = new Option(AccountInfo.PasswordChangeIndicatorEnumFromStringOrDefault(passwordChangeIndicatorRawValue)); - break; - case "pastTransactionsDay": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pastTransactionsDay = new Option(utf8JsonReader.GetInt32()); - break; - case "pastTransactionsYear": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pastTransactionsYear = new Option(utf8JsonReader.GetInt32()); - break; - case "paymentAccountAge": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - paymentAccountAge = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "paymentAccountIndicator": - string paymentAccountIndicatorRawValue = utf8JsonReader.GetString(); - if (paymentAccountIndicatorRawValue != null) - paymentAccountIndicator = new Option(AccountInfo.PaymentAccountIndicatorEnumFromStringOrDefault(paymentAccountIndicatorRawValue)); - break; - case "purchasesLast6Months": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - purchasesLast6Months = new Option(utf8JsonReader.GetInt32()); - break; - case "suspiciousActivity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - suspiciousActivity = new Option(utf8JsonReader.GetBoolean()); - break; - case "workPhone": - workPhone = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (accountAgeIndicator.IsSet && accountAgeIndicator.Value == null) - throw new ArgumentNullException(nameof(accountAgeIndicator), "Property is not nullable for class AccountInfo."); - - if (accountChangeDate.IsSet && accountChangeDate.Value == null) - throw new ArgumentNullException(nameof(accountChangeDate), "Property is not nullable for class AccountInfo."); - - if (accountChangeIndicator.IsSet && accountChangeIndicator.Value == null) - throw new ArgumentNullException(nameof(accountChangeIndicator), "Property is not nullable for class AccountInfo."); - - if (accountCreationDate.IsSet && accountCreationDate.Value == null) - throw new ArgumentNullException(nameof(accountCreationDate), "Property is not nullable for class AccountInfo."); - - if (accountType.IsSet && accountType.Value == null) - throw new ArgumentNullException(nameof(accountType), "Property is not nullable for class AccountInfo."); - - if (addCardAttemptsDay.IsSet && addCardAttemptsDay.Value == null) - throw new ArgumentNullException(nameof(addCardAttemptsDay), "Property is not nullable for class AccountInfo."); - - if (deliveryAddressUsageDate.IsSet && deliveryAddressUsageDate.Value == null) - throw new ArgumentNullException(nameof(deliveryAddressUsageDate), "Property is not nullable for class AccountInfo."); - - if (deliveryAddressUsageIndicator.IsSet && deliveryAddressUsageIndicator.Value == null) - throw new ArgumentNullException(nameof(deliveryAddressUsageIndicator), "Property is not nullable for class AccountInfo."); - - if (homePhone.IsSet && homePhone.Value == null) - throw new ArgumentNullException(nameof(homePhone), "Property is not nullable for class AccountInfo."); - - if (mobilePhone.IsSet && mobilePhone.Value == null) - throw new ArgumentNullException(nameof(mobilePhone), "Property is not nullable for class AccountInfo."); - - if (passwordChangeDate.IsSet && passwordChangeDate.Value == null) - throw new ArgumentNullException(nameof(passwordChangeDate), "Property is not nullable for class AccountInfo."); - - if (passwordChangeIndicator.IsSet && passwordChangeIndicator.Value == null) - throw new ArgumentNullException(nameof(passwordChangeIndicator), "Property is not nullable for class AccountInfo."); - - if (pastTransactionsDay.IsSet && pastTransactionsDay.Value == null) - throw new ArgumentNullException(nameof(pastTransactionsDay), "Property is not nullable for class AccountInfo."); - - if (pastTransactionsYear.IsSet && pastTransactionsYear.Value == null) - throw new ArgumentNullException(nameof(pastTransactionsYear), "Property is not nullable for class AccountInfo."); - - if (paymentAccountAge.IsSet && paymentAccountAge.Value == null) - throw new ArgumentNullException(nameof(paymentAccountAge), "Property is not nullable for class AccountInfo."); - - if (paymentAccountIndicator.IsSet && paymentAccountIndicator.Value == null) - throw new ArgumentNullException(nameof(paymentAccountIndicator), "Property is not nullable for class AccountInfo."); - - if (purchasesLast6Months.IsSet && purchasesLast6Months.Value == null) - throw new ArgumentNullException(nameof(purchasesLast6Months), "Property is not nullable for class AccountInfo."); - - if (suspiciousActivity.IsSet && suspiciousActivity.Value == null) - throw new ArgumentNullException(nameof(suspiciousActivity), "Property is not nullable for class AccountInfo."); - - if (workPhone.IsSet && workPhone.Value == null) - throw new ArgumentNullException(nameof(workPhone), "Property is not nullable for class AccountInfo."); - - return new AccountInfo(accountAgeIndicator, accountChangeDate, accountChangeIndicator, accountCreationDate, accountType, addCardAttemptsDay, deliveryAddressUsageDate, deliveryAddressUsageIndicator, homePhone, mobilePhone, passwordChangeDate, passwordChangeIndicator, pastTransactionsDay, pastTransactionsYear, paymentAccountAge, paymentAccountIndicator, purchasesLast6Months, suspiciousActivity, workPhone); + return + ( + this.AccountAgeIndicator == input.AccountAgeIndicator || + this.AccountAgeIndicator.Equals(input.AccountAgeIndicator) + ) && + ( + this.AccountChangeDate == input.AccountChangeDate || + (this.AccountChangeDate != null && + this.AccountChangeDate.Equals(input.AccountChangeDate)) + ) && + ( + this.AccountChangeIndicator == input.AccountChangeIndicator || + this.AccountChangeIndicator.Equals(input.AccountChangeIndicator) + ) && + ( + this.AccountCreationDate == input.AccountCreationDate || + (this.AccountCreationDate != null && + this.AccountCreationDate.Equals(input.AccountCreationDate)) + ) && + ( + this.AccountType == input.AccountType || + this.AccountType.Equals(input.AccountType) + ) && + ( + this.AddCardAttemptsDay == input.AddCardAttemptsDay || + this.AddCardAttemptsDay.Equals(input.AddCardAttemptsDay) + ) && + ( + this.DeliveryAddressUsageDate == input.DeliveryAddressUsageDate || + (this.DeliveryAddressUsageDate != null && + this.DeliveryAddressUsageDate.Equals(input.DeliveryAddressUsageDate)) + ) && + ( + this.DeliveryAddressUsageIndicator == input.DeliveryAddressUsageIndicator || + this.DeliveryAddressUsageIndicator.Equals(input.DeliveryAddressUsageIndicator) + ) && + ( + this.HomePhone == input.HomePhone || + (this.HomePhone != null && + this.HomePhone.Equals(input.HomePhone)) + ) && + ( + this.MobilePhone == input.MobilePhone || + (this.MobilePhone != null && + this.MobilePhone.Equals(input.MobilePhone)) + ) && + ( + this.PasswordChangeDate == input.PasswordChangeDate || + (this.PasswordChangeDate != null && + this.PasswordChangeDate.Equals(input.PasswordChangeDate)) + ) && + ( + this.PasswordChangeIndicator == input.PasswordChangeIndicator || + this.PasswordChangeIndicator.Equals(input.PasswordChangeIndicator) + ) && + ( + this.PastTransactionsDay == input.PastTransactionsDay || + this.PastTransactionsDay.Equals(input.PastTransactionsDay) + ) && + ( + this.PastTransactionsYear == input.PastTransactionsYear || + this.PastTransactionsYear.Equals(input.PastTransactionsYear) + ) && + ( + this.PaymentAccountAge == input.PaymentAccountAge || + (this.PaymentAccountAge != null && + this.PaymentAccountAge.Equals(input.PaymentAccountAge)) + ) && + ( + this.PaymentAccountIndicator == input.PaymentAccountIndicator || + this.PaymentAccountIndicator.Equals(input.PaymentAccountIndicator) + ) && + ( + this.PurchasesLast6Months == input.PurchasesLast6Months || + this.PurchasesLast6Months.Equals(input.PurchasesLast6Months) + ) && + ( + this.SuspiciousActivity == input.SuspiciousActivity || + this.SuspiciousActivity.Equals(input.SuspiciousActivity) + ) && + ( + this.WorkPhone == input.WorkPhone || + (this.WorkPhone != null && + this.WorkPhone.Equals(input.WorkPhone)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AccountInfo accountInfo, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, accountInfo, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.AccountAgeIndicator.GetHashCode(); + if (this.AccountChangeDate != null) + { + hashCode = (hashCode * 59) + this.AccountChangeDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AccountChangeIndicator.GetHashCode(); + if (this.AccountCreationDate != null) + { + hashCode = (hashCode * 59) + this.AccountCreationDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AccountType.GetHashCode(); + hashCode = (hashCode * 59) + this.AddCardAttemptsDay.GetHashCode(); + if (this.DeliveryAddressUsageDate != null) + { + hashCode = (hashCode * 59) + this.DeliveryAddressUsageDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.DeliveryAddressUsageIndicator.GetHashCode(); + if (this.HomePhone != null) + { + hashCode = (hashCode * 59) + this.HomePhone.GetHashCode(); + } + if (this.MobilePhone != null) + { + hashCode = (hashCode * 59) + this.MobilePhone.GetHashCode(); + } + if (this.PasswordChangeDate != null) + { + hashCode = (hashCode * 59) + this.PasswordChangeDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PasswordChangeIndicator.GetHashCode(); + hashCode = (hashCode * 59) + this.PastTransactionsDay.GetHashCode(); + hashCode = (hashCode * 59) + this.PastTransactionsYear.GetHashCode(); + if (this.PaymentAccountAge != null) + { + hashCode = (hashCode * 59) + this.PaymentAccountAge.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PaymentAccountIndicator.GetHashCode(); + hashCode = (hashCode * 59) + this.PurchasesLast6Months.GetHashCode(); + hashCode = (hashCode * 59) + this.SuspiciousActivity.GetHashCode(); + if (this.WorkPhone != null) + { + hashCode = (hashCode * 59) + this.WorkPhone.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AccountInfo accountInfo, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (accountInfo.HomePhoneOption.IsSet && accountInfo.HomePhone == null) - throw new ArgumentNullException(nameof(accountInfo.HomePhone), "Property is required for class AccountInfo."); - - if (accountInfo.MobilePhoneOption.IsSet && accountInfo.MobilePhone == null) - throw new ArgumentNullException(nameof(accountInfo.MobilePhone), "Property is required for class AccountInfo."); - - if (accountInfo.WorkPhoneOption.IsSet && accountInfo.WorkPhone == null) - throw new ArgumentNullException(nameof(accountInfo.WorkPhone), "Property is required for class AccountInfo."); - - var accountAgeIndicatorRawValue = AccountInfo.AccountAgeIndicatorEnumToJsonValue(accountInfo.AccountAgeIndicatorOption.Value.Value); - writer.WriteString("accountAgeIndicator", accountAgeIndicatorRawValue); - if (accountInfo.AccountChangeDateOption.IsSet) - writer.WriteString("accountChangeDate", accountInfo.AccountChangeDateOption.Value.Value.ToString(AccountChangeDateFormat)); - - var accountChangeIndicatorRawValue = AccountInfo.AccountChangeIndicatorEnumToJsonValue(accountInfo.AccountChangeIndicatorOption.Value.Value); - writer.WriteString("accountChangeIndicator", accountChangeIndicatorRawValue); - if (accountInfo.AccountCreationDateOption.IsSet) - writer.WriteString("accountCreationDate", accountInfo.AccountCreationDateOption.Value.Value.ToString(AccountCreationDateFormat)); - - var accountTypeRawValue = AccountInfo.AccountTypeEnumToJsonValue(accountInfo.AccountTypeOption.Value.Value); - writer.WriteString("accountType", accountTypeRawValue); - if (accountInfo.AddCardAttemptsDayOption.IsSet) - writer.WriteNumber("addCardAttemptsDay", accountInfo.AddCardAttemptsDayOption.Value.Value); - - if (accountInfo.DeliveryAddressUsageDateOption.IsSet) - writer.WriteString("deliveryAddressUsageDate", accountInfo.DeliveryAddressUsageDateOption.Value.Value.ToString(DeliveryAddressUsageDateFormat)); - - var deliveryAddressUsageIndicatorRawValue = AccountInfo.DeliveryAddressUsageIndicatorEnumToJsonValue(accountInfo.DeliveryAddressUsageIndicatorOption.Value.Value); - writer.WriteString("deliveryAddressUsageIndicator", deliveryAddressUsageIndicatorRawValue); - if (accountInfo.HomePhoneOption.IsSet) - writer.WriteString("homePhone", accountInfo.HomePhone); - - if (accountInfo.MobilePhoneOption.IsSet) - writer.WriteString("mobilePhone", accountInfo.MobilePhone); - - if (accountInfo.PasswordChangeDateOption.IsSet) - writer.WriteString("passwordChangeDate", accountInfo.PasswordChangeDateOption.Value.Value.ToString(PasswordChangeDateFormat)); - - var passwordChangeIndicatorRawValue = AccountInfo.PasswordChangeIndicatorEnumToJsonValue(accountInfo.PasswordChangeIndicatorOption.Value.Value); - writer.WriteString("passwordChangeIndicator", passwordChangeIndicatorRawValue); - if (accountInfo.PastTransactionsDayOption.IsSet) - writer.WriteNumber("pastTransactionsDay", accountInfo.PastTransactionsDayOption.Value.Value); - - if (accountInfo.PastTransactionsYearOption.IsSet) - writer.WriteNumber("pastTransactionsYear", accountInfo.PastTransactionsYearOption.Value.Value); - - if (accountInfo.PaymentAccountAgeOption.IsSet) - writer.WriteString("paymentAccountAge", accountInfo.PaymentAccountAgeOption.Value.Value.ToString(PaymentAccountAgeFormat)); - - var paymentAccountIndicatorRawValue = AccountInfo.PaymentAccountIndicatorEnumToJsonValue(accountInfo.PaymentAccountIndicatorOption.Value.Value); - writer.WriteString("paymentAccountIndicator", paymentAccountIndicatorRawValue); - if (accountInfo.PurchasesLast6MonthsOption.IsSet) - writer.WriteNumber("purchasesLast6Months", accountInfo.PurchasesLast6MonthsOption.Value.Value); - - if (accountInfo.SuspiciousActivityOption.IsSet) - writer.WriteBoolean("suspiciousActivity", accountInfo.SuspiciousActivityOption.Value.Value); - - if (accountInfo.WorkPhoneOption.IsSet) - writer.WriteString("workPhone", accountInfo.WorkPhone); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AcctInfo.cs b/Adyen/Model/Checkout/AcctInfo.cs index 4bd7b91c2..38ea62d99 100644 --- a/Adyen/Model/Checkout/AcctInfo.cs +++ b/Adyen/Model/Checkout/AcctInfo.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,937 +15,398 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AcctInfo /// - public partial class AcctInfo : IValidatableObject + [DataContract(Name = "AcctInfo")] + public partial class AcctInfo : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days - /// Date that the cardholder’s account with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Format: **YYYYMMDD** - /// Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days - /// Date that cardholder’s account with the 3DS Requestor had a password change or account reset. Format: **YYYYMMDD** - /// Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days - /// Date that the cardholder opened the account with the 3DS Requestor. Format: **YYYYMMDD** - /// Number of purchases with this cardholder account during the previous six months. Max length: 4 characters. - /// String that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Format: **YYYYMMDD** - /// Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days - /// Number of Add Card attempts in the last 24 hours. Max length: 3 characters. - /// String when the shipping address used for this transaction was first used with the 3DS Requestor. Format: **YYYYMMDD** - /// Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days - /// Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name - /// Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed - /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous 24 hours. Max length: 3 characters. - /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous year. Max length: 3 characters. - [JsonConstructor] - public AcctInfo(Option chAccAgeInd = default, Option chAccChange = default, Option chAccChangeInd = default, Option chAccPwChange = default, Option chAccPwChangeInd = default, Option chAccString = default, Option nbPurchaseAccount = default, Option paymentAccAge = default, Option paymentAccInd = default, Option provisionAttemptsDay = default, Option shipAddressUsage = default, Option shipAddressUsageInd = default, Option shipNameIndicator = default, Option suspiciousAccActivity = default, Option txnActivityDay = default, Option txnActivityYear = default) - { - ChAccAgeIndOption = chAccAgeInd; - ChAccChangeOption = chAccChange; - ChAccChangeIndOption = chAccChangeInd; - ChAccPwChangeOption = chAccPwChange; - ChAccPwChangeIndOption = chAccPwChangeInd; - ChAccStringOption = chAccString; - NbPurchaseAccountOption = nbPurchaseAccount; - PaymentAccAgeOption = paymentAccAge; - PaymentAccIndOption = paymentAccInd; - ProvisionAttemptsDayOption = provisionAttemptsDay; - ShipAddressUsageOption = shipAddressUsage; - ShipAddressUsageIndOption = shipAddressUsageInd; - ShipNameIndicatorOption = shipNameIndicator; - SuspiciousAccActivityOption = suspiciousAccActivity; - TxnActivityDayOption = txnActivityDay; - TxnActivityYearOption = txnActivityYear; - OnCreated(); - } - - partial void OnCreated(); - /// /// Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days /// /// Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + [JsonConverter(typeof(StringEnumConverter))] public enum ChAccAgeIndEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// + [EnumMember(Value = "05")] _05 = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ChAccAgeIndEnum ChAccAgeIndEnumFromString(string value) - { - if (value.Equals("01")) - return ChAccAgeIndEnum._01; - - if (value.Equals("02")) - return ChAccAgeIndEnum._02; - - if (value.Equals("03")) - return ChAccAgeIndEnum._03; - - if (value.Equals("04")) - return ChAccAgeIndEnum._04; - - if (value.Equals("05")) - return ChAccAgeIndEnum._05; - - throw new NotImplementedException($"Could not convert value to type ChAccAgeIndEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ChAccAgeIndEnum? ChAccAgeIndEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ChAccAgeIndEnum._01; - - if (value.Equals("02")) - return ChAccAgeIndEnum._02; - - if (value.Equals("03")) - return ChAccAgeIndEnum._03; - if (value.Equals("04")) - return ChAccAgeIndEnum._04; - - if (value.Equals("05")) - return ChAccAgeIndEnum._05; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChAccAgeIndEnumToJsonValue(ChAccAgeIndEnum? value) - { - if (value == ChAccAgeIndEnum._01) - return "01"; - - if (value == ChAccAgeIndEnum._02) - return "02"; - - if (value == ChAccAgeIndEnum._03) - return "03"; - - if (value == ChAccAgeIndEnum._04) - return "04"; - - if (value == ChAccAgeIndEnum._05) - return "05"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ChAccAgeInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChAccAgeIndOption { get; private set; } /// /// Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days /// /// Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days - [JsonPropertyName("chAccAgeInd")] - public ChAccAgeIndEnum? ChAccAgeInd { get { return this.ChAccAgeIndOption; } set { this.ChAccAgeIndOption = new Option(value); } } - + [DataMember(Name = "chAccAgeInd", EmitDefaultValue = false)] + public ChAccAgeIndEnum? ChAccAgeInd { get; set; } /// /// Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days /// /// Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days + [JsonConverter(typeof(StringEnumConverter))] public enum ChAccChangeIndEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4 - } - /// - /// Returns a - /// - /// - /// - /// - public static ChAccChangeIndEnum ChAccChangeIndEnumFromString(string value) - { - if (value.Equals("01")) - return ChAccChangeIndEnum._01; - - if (value.Equals("02")) - return ChAccChangeIndEnum._02; - - if (value.Equals("03")) - return ChAccChangeIndEnum._03; - - if (value.Equals("04")) - return ChAccChangeIndEnum._04; - - throw new NotImplementedException($"Could not convert value to type ChAccChangeIndEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static ChAccChangeIndEnum? ChAccChangeIndEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ChAccChangeIndEnum._01; - - if (value.Equals("02")) - return ChAccChangeIndEnum._02; - - if (value.Equals("03")) - return ChAccChangeIndEnum._03; - - if (value.Equals("04")) - return ChAccChangeIndEnum._04; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChAccChangeIndEnumToJsonValue(ChAccChangeIndEnum? value) - { - if (value == ChAccChangeIndEnum._01) - return "01"; - - if (value == ChAccChangeIndEnum._02) - return "02"; - - if (value == ChAccChangeIndEnum._03) - return "03"; - - if (value == ChAccChangeIndEnum._04) - return "04"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ChAccChangeInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChAccChangeIndOption { get; private set; } /// /// Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days /// /// Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days - [JsonPropertyName("chAccChangeInd")] - public ChAccChangeIndEnum? ChAccChangeInd { get { return this.ChAccChangeIndOption; } set { this.ChAccChangeIndOption = new Option(value); } } - + [DataMember(Name = "chAccChangeInd", EmitDefaultValue = false)] + public ChAccChangeIndEnum? ChAccChangeInd { get; set; } /// /// Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days /// /// Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + [JsonConverter(typeof(StringEnumConverter))] public enum ChAccPwChangeIndEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// + [EnumMember(Value = "05")] _05 = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ChAccPwChangeIndEnum ChAccPwChangeIndEnumFromString(string value) - { - if (value.Equals("01")) - return ChAccPwChangeIndEnum._01; - - if (value.Equals("02")) - return ChAccPwChangeIndEnum._02; - - if (value.Equals("03")) - return ChAccPwChangeIndEnum._03; - - if (value.Equals("04")) - return ChAccPwChangeIndEnum._04; - - if (value.Equals("05")) - return ChAccPwChangeIndEnum._05; - - throw new NotImplementedException($"Could not convert value to type ChAccPwChangeIndEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ChAccPwChangeIndEnum? ChAccPwChangeIndEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ChAccPwChangeIndEnum._01; - if (value.Equals("02")) - return ChAccPwChangeIndEnum._02; - - if (value.Equals("03")) - return ChAccPwChangeIndEnum._03; - - if (value.Equals("04")) - return ChAccPwChangeIndEnum._04; - - if (value.Equals("05")) - return ChAccPwChangeIndEnum._05; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChAccPwChangeIndEnumToJsonValue(ChAccPwChangeIndEnum? value) - { - if (value == ChAccPwChangeIndEnum._01) - return "01"; - - if (value == ChAccPwChangeIndEnum._02) - return "02"; - - if (value == ChAccPwChangeIndEnum._03) - return "03"; - - if (value == ChAccPwChangeIndEnum._04) - return "04"; - - if (value == ChAccPwChangeIndEnum._05) - return "05"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ChAccPwChangeInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChAccPwChangeIndOption { get; private set; } /// /// Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days /// /// Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days - [JsonPropertyName("chAccPwChangeInd")] - public ChAccPwChangeIndEnum? ChAccPwChangeInd { get { return this.ChAccPwChangeIndOption; } set { this.ChAccPwChangeIndOption = new Option(value); } } - + [DataMember(Name = "chAccPwChangeInd", EmitDefaultValue = false)] + public ChAccPwChangeIndEnum? ChAccPwChangeInd { get; set; } /// /// Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days /// /// Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days + [JsonConverter(typeof(StringEnumConverter))] public enum PaymentAccIndEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// + [EnumMember(Value = "05")] _05 = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static PaymentAccIndEnum PaymentAccIndEnumFromString(string value) - { - if (value.Equals("01")) - return PaymentAccIndEnum._01; - - if (value.Equals("02")) - return PaymentAccIndEnum._02; - - if (value.Equals("03")) - return PaymentAccIndEnum._03; - if (value.Equals("04")) - return PaymentAccIndEnum._04; - - if (value.Equals("05")) - return PaymentAccIndEnum._05; - - throw new NotImplementedException($"Could not convert value to type PaymentAccIndEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static PaymentAccIndEnum? PaymentAccIndEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return PaymentAccIndEnum._01; - - if (value.Equals("02")) - return PaymentAccIndEnum._02; - - if (value.Equals("03")) - return PaymentAccIndEnum._03; - - if (value.Equals("04")) - return PaymentAccIndEnum._04; - - if (value.Equals("05")) - return PaymentAccIndEnum._05; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string PaymentAccIndEnumToJsonValue(PaymentAccIndEnum? value) - { - if (value == PaymentAccIndEnum._01) - return "01"; - - if (value == PaymentAccIndEnum._02) - return "02"; - - if (value == PaymentAccIndEnum._03) - return "03"; - - if (value == PaymentAccIndEnum._04) - return "04"; - - if (value == PaymentAccIndEnum._05) - return "05"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of PaymentAccInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentAccIndOption { get; private set; } /// /// Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days /// /// Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days - [JsonPropertyName("paymentAccInd")] - public PaymentAccIndEnum? PaymentAccInd { get { return this.PaymentAccIndOption; } set { this.PaymentAccIndOption = new Option(value); } } - + [DataMember(Name = "paymentAccInd", EmitDefaultValue = false)] + public PaymentAccIndEnum? PaymentAccInd { get; set; } /// /// Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days /// /// Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days + [JsonConverter(typeof(StringEnumConverter))] public enum ShipAddressUsageIndEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4 - } - /// - /// Returns a - /// - /// - /// - /// - public static ShipAddressUsageIndEnum ShipAddressUsageIndEnumFromString(string value) - { - if (value.Equals("01")) - return ShipAddressUsageIndEnum._01; - - if (value.Equals("02")) - return ShipAddressUsageIndEnum._02; - - if (value.Equals("03")) - return ShipAddressUsageIndEnum._03; - - if (value.Equals("04")) - return ShipAddressUsageIndEnum._04; - - throw new NotImplementedException($"Could not convert value to type ShipAddressUsageIndEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static ShipAddressUsageIndEnum? ShipAddressUsageIndEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ShipAddressUsageIndEnum._01; - - if (value.Equals("02")) - return ShipAddressUsageIndEnum._02; - - if (value.Equals("03")) - return ShipAddressUsageIndEnum._03; - - if (value.Equals("04")) - return ShipAddressUsageIndEnum._04; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ShipAddressUsageIndEnumToJsonValue(ShipAddressUsageIndEnum? value) - { - if (value == ShipAddressUsageIndEnum._01) - return "01"; - - if (value == ShipAddressUsageIndEnum._02) - return "02"; - - if (value == ShipAddressUsageIndEnum._03) - return "03"; - - if (value == ShipAddressUsageIndEnum._04) - return "04"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ShipAddressUsageInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShipAddressUsageIndOption { get; private set; } /// /// Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days /// /// Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days - [JsonPropertyName("shipAddressUsageInd")] - public ShipAddressUsageIndEnum? ShipAddressUsageInd { get { return this.ShipAddressUsageIndOption; } set { this.ShipAddressUsageIndOption = new Option(value); } } - + [DataMember(Name = "shipAddressUsageInd", EmitDefaultValue = false)] + public ShipAddressUsageIndEnum? ShipAddressUsageInd { get; set; } /// /// Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name /// /// Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name + [JsonConverter(typeof(StringEnumConverter))] public enum ShipNameIndicatorEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ShipNameIndicatorEnum ShipNameIndicatorEnumFromString(string value) - { - if (value.Equals("01")) - return ShipNameIndicatorEnum._01; - if (value.Equals("02")) - return ShipNameIndicatorEnum._02; - - throw new NotImplementedException($"Could not convert value to type ShipNameIndicatorEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static ShipNameIndicatorEnum? ShipNameIndicatorEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ShipNameIndicatorEnum._01; - - if (value.Equals("02")) - return ShipNameIndicatorEnum._02; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ShipNameIndicatorEnumToJsonValue(ShipNameIndicatorEnum? value) - { - if (value == ShipNameIndicatorEnum._01) - return "01"; - - if (value == ShipNameIndicatorEnum._02) - return "02"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ShipNameIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShipNameIndicatorOption { get; private set; } /// /// Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name /// /// Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name - [JsonPropertyName("shipNameIndicator")] - public ShipNameIndicatorEnum? ShipNameIndicator { get { return this.ShipNameIndicatorOption; } set { this.ShipNameIndicatorOption = new Option(value); } } - + [DataMember(Name = "shipNameIndicator", EmitDefaultValue = false)] + public ShipNameIndicatorEnum? ShipNameIndicator { get; set; } /// /// Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed /// /// Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed + [JsonConverter(typeof(StringEnumConverter))] public enum SuspiciousAccActivityEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static SuspiciousAccActivityEnum SuspiciousAccActivityEnumFromString(string value) - { - if (value.Equals("01")) - return SuspiciousAccActivityEnum._01; - - if (value.Equals("02")) - return SuspiciousAccActivityEnum._02; - throw new NotImplementedException($"Could not convert value to type SuspiciousAccActivityEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static SuspiciousAccActivityEnum? SuspiciousAccActivityEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return SuspiciousAccActivityEnum._01; - - if (value.Equals("02")) - return SuspiciousAccActivityEnum._02; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string SuspiciousAccActivityEnumToJsonValue(SuspiciousAccActivityEnum? value) - { - if (value == SuspiciousAccActivityEnum._01) - return "01"; - - if (value == SuspiciousAccActivityEnum._02) - return "02"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of SuspiciousAccActivity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SuspiciousAccActivityOption { get; private set; } /// /// Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed /// /// Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed - [JsonPropertyName("suspiciousAccActivity")] - public SuspiciousAccActivityEnum? SuspiciousAccActivity { get { return this.SuspiciousAccActivityOption; } set { this.SuspiciousAccActivityOption = new Option(value); } } - + [DataMember(Name = "suspiciousAccActivity", EmitDefaultValue = false)] + public SuspiciousAccActivityEnum? SuspiciousAccActivity { get; set; } /// - /// Used to track the state of ChAccChange + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChAccChangeOption { get; private set; } + /// Length of time that the cardholder has had the account with the 3DS Requestor. Allowed values: * **01** — No account * **02** — Created during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days. + /// Date that the cardholder’s account with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Format: **YYYYMMDD**. + /// Length of time since the cardholder’s account information with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Allowed values: * **01** — Changed during this transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days. + /// Date that cardholder’s account with the 3DS Requestor had a password change or account reset. Format: **YYYYMMDD**. + /// Indicates the length of time since the cardholder’s account with the 3DS Requestor had a password change or account reset. Allowed values: * **01** — No change * **02** — Changed during this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days. + /// Date that the cardholder opened the account with the 3DS Requestor. Format: **YYYYMMDD**. + /// Number of purchases with this cardholder account during the previous six months. Max length: 4 characters.. + /// String that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Format: **YYYYMMDD**. + /// Indicates the length of time that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — During this transaction * **03** — Less than 30 days * **04** — 30–60 days * **05** — More than 60 days. + /// Number of Add Card attempts in the last 24 hours. Max length: 3 characters.. + /// String when the shipping address used for this transaction was first used with the 3DS Requestor. Format: **YYYYMMDD**. + /// Indicates when the shipping address used for this transaction was first used with the 3DS Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — 30–60 days * **04** — More than 60 days. + /// Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — Account Name different to shipping Name. + /// Indicates whether the 3DS Requestor has experienced suspicious activity (including previous fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been observed * **02** — Suspicious activity has been observed. + /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous 24 hours. Max length: 3 characters.. + /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous year. Max length: 3 characters.. + public AcctInfo(ChAccAgeIndEnum? chAccAgeInd = default(ChAccAgeIndEnum?), string chAccChange = default(string), ChAccChangeIndEnum? chAccChangeInd = default(ChAccChangeIndEnum?), string chAccPwChange = default(string), ChAccPwChangeIndEnum? chAccPwChangeInd = default(ChAccPwChangeIndEnum?), string chAccString = default(string), string nbPurchaseAccount = default(string), string paymentAccAge = default(string), PaymentAccIndEnum? paymentAccInd = default(PaymentAccIndEnum?), string provisionAttemptsDay = default(string), string shipAddressUsage = default(string), ShipAddressUsageIndEnum? shipAddressUsageInd = default(ShipAddressUsageIndEnum?), ShipNameIndicatorEnum? shipNameIndicator = default(ShipNameIndicatorEnum?), SuspiciousAccActivityEnum? suspiciousAccActivity = default(SuspiciousAccActivityEnum?), string txnActivityDay = default(string), string txnActivityYear = default(string)) + { + this.ChAccAgeInd = chAccAgeInd; + this.ChAccChange = chAccChange; + this.ChAccChangeInd = chAccChangeInd; + this.ChAccPwChange = chAccPwChange; + this.ChAccPwChangeInd = chAccPwChangeInd; + this.ChAccString = chAccString; + this.NbPurchaseAccount = nbPurchaseAccount; + this.PaymentAccAge = paymentAccAge; + this.PaymentAccInd = paymentAccInd; + this.ProvisionAttemptsDay = provisionAttemptsDay; + this.ShipAddressUsage = shipAddressUsage; + this.ShipAddressUsageInd = shipAddressUsageInd; + this.ShipNameIndicator = shipNameIndicator; + this.SuspiciousAccActivity = suspiciousAccActivity; + this.TxnActivityDay = txnActivityDay; + this.TxnActivityYear = txnActivityYear; + } /// /// Date that the cardholder’s account with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Format: **YYYYMMDD** /// /// Date that the cardholder’s account with the 3DS Requestor was last changed, including Billing or Shipping address, new payment account, or new user(s) added. Format: **YYYYMMDD** - [JsonPropertyName("chAccChange")] - public string ChAccChange { get { return this.ChAccChangeOption; } set { this.ChAccChangeOption = new Option(value); } } - - /// - /// Used to track the state of ChAccPwChange - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChAccPwChangeOption { get; private set; } + [DataMember(Name = "chAccChange", EmitDefaultValue = false)] + public string ChAccChange { get; set; } /// /// Date that cardholder’s account with the 3DS Requestor had a password change or account reset. Format: **YYYYMMDD** /// /// Date that cardholder’s account with the 3DS Requestor had a password change or account reset. Format: **YYYYMMDD** - [JsonPropertyName("chAccPwChange")] - public string ChAccPwChange { get { return this.ChAccPwChangeOption; } set { this.ChAccPwChangeOption = new Option(value); } } - - /// - /// Used to track the state of ChAccString - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChAccStringOption { get; private set; } + [DataMember(Name = "chAccPwChange", EmitDefaultValue = false)] + public string ChAccPwChange { get; set; } /// /// Date that the cardholder opened the account with the 3DS Requestor. Format: **YYYYMMDD** /// /// Date that the cardholder opened the account with the 3DS Requestor. Format: **YYYYMMDD** - [JsonPropertyName("chAccString")] - public string ChAccString { get { return this.ChAccStringOption; } set { this.ChAccStringOption = new Option(value); } } - - /// - /// Used to track the state of NbPurchaseAccount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NbPurchaseAccountOption { get; private set; } + [DataMember(Name = "chAccString", EmitDefaultValue = false)] + public string ChAccString { get; set; } /// /// Number of purchases with this cardholder account during the previous six months. Max length: 4 characters. /// /// Number of purchases with this cardholder account during the previous six months. Max length: 4 characters. - [JsonPropertyName("nbPurchaseAccount")] - public string NbPurchaseAccount { get { return this.NbPurchaseAccountOption; } set { this.NbPurchaseAccountOption = new Option(value); } } - - /// - /// Used to track the state of PaymentAccAge - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentAccAgeOption { get; private set; } + [DataMember(Name = "nbPurchaseAccount", EmitDefaultValue = false)] + public string NbPurchaseAccount { get; set; } /// /// String that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Format: **YYYYMMDD** /// /// String that the payment account was enrolled in the cardholder’s account with the 3DS Requestor. Format: **YYYYMMDD** - [JsonPropertyName("paymentAccAge")] - public string PaymentAccAge { get { return this.PaymentAccAgeOption; } set { this.PaymentAccAgeOption = new Option(value); } } - - /// - /// Used to track the state of ProvisionAttemptsDay - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ProvisionAttemptsDayOption { get; private set; } + [DataMember(Name = "paymentAccAge", EmitDefaultValue = false)] + public string PaymentAccAge { get; set; } /// /// Number of Add Card attempts in the last 24 hours. Max length: 3 characters. /// /// Number of Add Card attempts in the last 24 hours. Max length: 3 characters. - [JsonPropertyName("provisionAttemptsDay")] - public string ProvisionAttemptsDay { get { return this.ProvisionAttemptsDayOption; } set { this.ProvisionAttemptsDayOption = new Option(value); } } - - /// - /// Used to track the state of ShipAddressUsage - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShipAddressUsageOption { get; private set; } + [DataMember(Name = "provisionAttemptsDay", EmitDefaultValue = false)] + public string ProvisionAttemptsDay { get; set; } /// /// String when the shipping address used for this transaction was first used with the 3DS Requestor. Format: **YYYYMMDD** /// /// String when the shipping address used for this transaction was first used with the 3DS Requestor. Format: **YYYYMMDD** - [JsonPropertyName("shipAddressUsage")] - public string ShipAddressUsage { get { return this.ShipAddressUsageOption; } set { this.ShipAddressUsageOption = new Option(value); } } - - /// - /// Used to track the state of TxnActivityDay - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TxnActivityDayOption { get; private set; } + [DataMember(Name = "shipAddressUsage", EmitDefaultValue = false)] + public string ShipAddressUsage { get; set; } /// /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous 24 hours. Max length: 3 characters. /// /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous 24 hours. Max length: 3 characters. - [JsonPropertyName("txnActivityDay")] - public string TxnActivityDay { get { return this.TxnActivityDayOption; } set { this.TxnActivityDayOption = new Option(value); } } - - /// - /// Used to track the state of TxnActivityYear - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TxnActivityYearOption { get; private set; } + [DataMember(Name = "txnActivityDay", EmitDefaultValue = false)] + public string TxnActivityDay { get; set; } /// /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous year. Max length: 3 characters. /// /// Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous year. Max length: 3 characters. - [JsonPropertyName("txnActivityYear")] - public string TxnActivityYear { get { return this.TxnActivityYearOption; } set { this.TxnActivityYearOption = new Option(value); } } + [DataMember(Name = "txnActivityYear", EmitDefaultValue = false)] + public string TxnActivityYear { get; set; } /// /// Returns the string presentation of the object @@ -975,292 +437,187 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // TxnActivityDay (string) maxLength - if (this.TxnActivityDay != null && this.TxnActivityDay.Length > 3) - { - yield return new ValidationResult("Invalid value for TxnActivityDay, length must be less than 3.", new [] { "TxnActivityDay" }); - } - - // TxnActivityYear (string) maxLength - if (this.TxnActivityYear != null && this.TxnActivityYear.Length > 3) - { - yield return new ValidationResult("Invalid value for TxnActivityYear, length must be less than 3.", new [] { "TxnActivityYear" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AcctInfoJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AcctInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option chAccAgeInd = default; - Option chAccChange = default; - Option chAccChangeInd = default; - Option chAccPwChange = default; - Option chAccPwChangeInd = default; - Option chAccString = default; - Option nbPurchaseAccount = default; - Option paymentAccAge = default; - Option paymentAccInd = default; - Option provisionAttemptsDay = default; - Option shipAddressUsage = default; - Option shipAddressUsageInd = default; - Option shipNameIndicator = default; - Option suspiciousAccActivity = default; - Option txnActivityDay = default; - Option txnActivityYear = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "chAccAgeInd": - string chAccAgeIndRawValue = utf8JsonReader.GetString(); - if (chAccAgeIndRawValue != null) - chAccAgeInd = new Option(AcctInfo.ChAccAgeIndEnumFromStringOrDefault(chAccAgeIndRawValue)); - break; - case "chAccChange": - chAccChange = new Option(utf8JsonReader.GetString()); - break; - case "chAccChangeInd": - string chAccChangeIndRawValue = utf8JsonReader.GetString(); - if (chAccChangeIndRawValue != null) - chAccChangeInd = new Option(AcctInfo.ChAccChangeIndEnumFromStringOrDefault(chAccChangeIndRawValue)); - break; - case "chAccPwChange": - chAccPwChange = new Option(utf8JsonReader.GetString()); - break; - case "chAccPwChangeInd": - string chAccPwChangeIndRawValue = utf8JsonReader.GetString(); - if (chAccPwChangeIndRawValue != null) - chAccPwChangeInd = new Option(AcctInfo.ChAccPwChangeIndEnumFromStringOrDefault(chAccPwChangeIndRawValue)); - break; - case "chAccString": - chAccString = new Option(utf8JsonReader.GetString()); - break; - case "nbPurchaseAccount": - nbPurchaseAccount = new Option(utf8JsonReader.GetString()); - break; - case "paymentAccAge": - paymentAccAge = new Option(utf8JsonReader.GetString()); - break; - case "paymentAccInd": - string paymentAccIndRawValue = utf8JsonReader.GetString(); - if (paymentAccIndRawValue != null) - paymentAccInd = new Option(AcctInfo.PaymentAccIndEnumFromStringOrDefault(paymentAccIndRawValue)); - break; - case "provisionAttemptsDay": - provisionAttemptsDay = new Option(utf8JsonReader.GetString()); - break; - case "shipAddressUsage": - shipAddressUsage = new Option(utf8JsonReader.GetString()); - break; - case "shipAddressUsageInd": - string shipAddressUsageIndRawValue = utf8JsonReader.GetString(); - if (shipAddressUsageIndRawValue != null) - shipAddressUsageInd = new Option(AcctInfo.ShipAddressUsageIndEnumFromStringOrDefault(shipAddressUsageIndRawValue)); - break; - case "shipNameIndicator": - string shipNameIndicatorRawValue = utf8JsonReader.GetString(); - if (shipNameIndicatorRawValue != null) - shipNameIndicator = new Option(AcctInfo.ShipNameIndicatorEnumFromStringOrDefault(shipNameIndicatorRawValue)); - break; - case "suspiciousAccActivity": - string suspiciousAccActivityRawValue = utf8JsonReader.GetString(); - if (suspiciousAccActivityRawValue != null) - suspiciousAccActivity = new Option(AcctInfo.SuspiciousAccActivityEnumFromStringOrDefault(suspiciousAccActivityRawValue)); - break; - case "txnActivityDay": - txnActivityDay = new Option(utf8JsonReader.GetString()); - break; - case "txnActivityYear": - txnActivityYear = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (chAccAgeInd.IsSet && chAccAgeInd.Value == null) - throw new ArgumentNullException(nameof(chAccAgeInd), "Property is not nullable for class AcctInfo."); - - if (chAccChange.IsSet && chAccChange.Value == null) - throw new ArgumentNullException(nameof(chAccChange), "Property is not nullable for class AcctInfo."); - - if (chAccChangeInd.IsSet && chAccChangeInd.Value == null) - throw new ArgumentNullException(nameof(chAccChangeInd), "Property is not nullable for class AcctInfo."); - - if (chAccPwChange.IsSet && chAccPwChange.Value == null) - throw new ArgumentNullException(nameof(chAccPwChange), "Property is not nullable for class AcctInfo."); - - if (chAccPwChangeInd.IsSet && chAccPwChangeInd.Value == null) - throw new ArgumentNullException(nameof(chAccPwChangeInd), "Property is not nullable for class AcctInfo."); - - if (chAccString.IsSet && chAccString.Value == null) - throw new ArgumentNullException(nameof(chAccString), "Property is not nullable for class AcctInfo."); - - if (nbPurchaseAccount.IsSet && nbPurchaseAccount.Value == null) - throw new ArgumentNullException(nameof(nbPurchaseAccount), "Property is not nullable for class AcctInfo."); - - if (paymentAccAge.IsSet && paymentAccAge.Value == null) - throw new ArgumentNullException(nameof(paymentAccAge), "Property is not nullable for class AcctInfo."); - - if (paymentAccInd.IsSet && paymentAccInd.Value == null) - throw new ArgumentNullException(nameof(paymentAccInd), "Property is not nullable for class AcctInfo."); - - if (provisionAttemptsDay.IsSet && provisionAttemptsDay.Value == null) - throw new ArgumentNullException(nameof(provisionAttemptsDay), "Property is not nullable for class AcctInfo."); - - if (shipAddressUsage.IsSet && shipAddressUsage.Value == null) - throw new ArgumentNullException(nameof(shipAddressUsage), "Property is not nullable for class AcctInfo."); - - if (shipAddressUsageInd.IsSet && shipAddressUsageInd.Value == null) - throw new ArgumentNullException(nameof(shipAddressUsageInd), "Property is not nullable for class AcctInfo."); - - if (shipNameIndicator.IsSet && shipNameIndicator.Value == null) - throw new ArgumentNullException(nameof(shipNameIndicator), "Property is not nullable for class AcctInfo."); - - if (suspiciousAccActivity.IsSet && suspiciousAccActivity.Value == null) - throw new ArgumentNullException(nameof(suspiciousAccActivity), "Property is not nullable for class AcctInfo."); - - if (txnActivityDay.IsSet && txnActivityDay.Value == null) - throw new ArgumentNullException(nameof(txnActivityDay), "Property is not nullable for class AcctInfo."); - - if (txnActivityYear.IsSet && txnActivityYear.Value == null) - throw new ArgumentNullException(nameof(txnActivityYear), "Property is not nullable for class AcctInfo."); - - return new AcctInfo(chAccAgeInd, chAccChange, chAccChangeInd, chAccPwChange, chAccPwChangeInd, chAccString, nbPurchaseAccount, paymentAccAge, paymentAccInd, provisionAttemptsDay, shipAddressUsage, shipAddressUsageInd, shipNameIndicator, suspiciousAccActivity, txnActivityDay, txnActivityYear); + return this.Equals(input as AcctInfo); } /// - /// Serializes a + /// Returns true if AcctInfo instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AcctInfo acctInfo, JsonSerializerOptions jsonSerializerOptions) + /// Instance of AcctInfo to be compared + /// Boolean + public bool Equals(AcctInfo input) { - writer.WriteStartObject(); - - WriteProperties(writer, acctInfo, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.ChAccAgeInd == input.ChAccAgeInd || + this.ChAccAgeInd.Equals(input.ChAccAgeInd) + ) && + ( + this.ChAccChange == input.ChAccChange || + (this.ChAccChange != null && + this.ChAccChange.Equals(input.ChAccChange)) + ) && + ( + this.ChAccChangeInd == input.ChAccChangeInd || + this.ChAccChangeInd.Equals(input.ChAccChangeInd) + ) && + ( + this.ChAccPwChange == input.ChAccPwChange || + (this.ChAccPwChange != null && + this.ChAccPwChange.Equals(input.ChAccPwChange)) + ) && + ( + this.ChAccPwChangeInd == input.ChAccPwChangeInd || + this.ChAccPwChangeInd.Equals(input.ChAccPwChangeInd) + ) && + ( + this.ChAccString == input.ChAccString || + (this.ChAccString != null && + this.ChAccString.Equals(input.ChAccString)) + ) && + ( + this.NbPurchaseAccount == input.NbPurchaseAccount || + (this.NbPurchaseAccount != null && + this.NbPurchaseAccount.Equals(input.NbPurchaseAccount)) + ) && + ( + this.PaymentAccAge == input.PaymentAccAge || + (this.PaymentAccAge != null && + this.PaymentAccAge.Equals(input.PaymentAccAge)) + ) && + ( + this.PaymentAccInd == input.PaymentAccInd || + this.PaymentAccInd.Equals(input.PaymentAccInd) + ) && + ( + this.ProvisionAttemptsDay == input.ProvisionAttemptsDay || + (this.ProvisionAttemptsDay != null && + this.ProvisionAttemptsDay.Equals(input.ProvisionAttemptsDay)) + ) && + ( + this.ShipAddressUsage == input.ShipAddressUsage || + (this.ShipAddressUsage != null && + this.ShipAddressUsage.Equals(input.ShipAddressUsage)) + ) && + ( + this.ShipAddressUsageInd == input.ShipAddressUsageInd || + this.ShipAddressUsageInd.Equals(input.ShipAddressUsageInd) + ) && + ( + this.ShipNameIndicator == input.ShipNameIndicator || + this.ShipNameIndicator.Equals(input.ShipNameIndicator) + ) && + ( + this.SuspiciousAccActivity == input.SuspiciousAccActivity || + this.SuspiciousAccActivity.Equals(input.SuspiciousAccActivity) + ) && + ( + this.TxnActivityDay == input.TxnActivityDay || + (this.TxnActivityDay != null && + this.TxnActivityDay.Equals(input.TxnActivityDay)) + ) && + ( + this.TxnActivityYear == input.TxnActivityYear || + (this.TxnActivityYear != null && + this.TxnActivityYear.Equals(input.TxnActivityYear)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.ChAccAgeInd.GetHashCode(); + if (this.ChAccChange != null) + { + hashCode = (hashCode * 59) + this.ChAccChange.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ChAccChangeInd.GetHashCode(); + if (this.ChAccPwChange != null) + { + hashCode = (hashCode * 59) + this.ChAccPwChange.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ChAccPwChangeInd.GetHashCode(); + if (this.ChAccString != null) + { + hashCode = (hashCode * 59) + this.ChAccString.GetHashCode(); + } + if (this.NbPurchaseAccount != null) + { + hashCode = (hashCode * 59) + this.NbPurchaseAccount.GetHashCode(); + } + if (this.PaymentAccAge != null) + { + hashCode = (hashCode * 59) + this.PaymentAccAge.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PaymentAccInd.GetHashCode(); + if (this.ProvisionAttemptsDay != null) + { + hashCode = (hashCode * 59) + this.ProvisionAttemptsDay.GetHashCode(); + } + if (this.ShipAddressUsage != null) + { + hashCode = (hashCode * 59) + this.ShipAddressUsage.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ShipAddressUsageInd.GetHashCode(); + hashCode = (hashCode * 59) + this.ShipNameIndicator.GetHashCode(); + hashCode = (hashCode * 59) + this.SuspiciousAccActivity.GetHashCode(); + if (this.TxnActivityDay != null) + { + hashCode = (hashCode * 59) + this.TxnActivityDay.GetHashCode(); + } + if (this.TxnActivityYear != null) + { + hashCode = (hashCode * 59) + this.TxnActivityYear.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AcctInfo acctInfo, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (acctInfo.ChAccChangeOption.IsSet && acctInfo.ChAccChange == null) - throw new ArgumentNullException(nameof(acctInfo.ChAccChange), "Property is required for class AcctInfo."); - - if (acctInfo.ChAccPwChangeOption.IsSet && acctInfo.ChAccPwChange == null) - throw new ArgumentNullException(nameof(acctInfo.ChAccPwChange), "Property is required for class AcctInfo."); - - if (acctInfo.ChAccStringOption.IsSet && acctInfo.ChAccString == null) - throw new ArgumentNullException(nameof(acctInfo.ChAccString), "Property is required for class AcctInfo."); - - if (acctInfo.NbPurchaseAccountOption.IsSet && acctInfo.NbPurchaseAccount == null) - throw new ArgumentNullException(nameof(acctInfo.NbPurchaseAccount), "Property is required for class AcctInfo."); - - if (acctInfo.PaymentAccAgeOption.IsSet && acctInfo.PaymentAccAge == null) - throw new ArgumentNullException(nameof(acctInfo.PaymentAccAge), "Property is required for class AcctInfo."); - - if (acctInfo.ProvisionAttemptsDayOption.IsSet && acctInfo.ProvisionAttemptsDay == null) - throw new ArgumentNullException(nameof(acctInfo.ProvisionAttemptsDay), "Property is required for class AcctInfo."); - - if (acctInfo.ShipAddressUsageOption.IsSet && acctInfo.ShipAddressUsage == null) - throw new ArgumentNullException(nameof(acctInfo.ShipAddressUsage), "Property is required for class AcctInfo."); - - if (acctInfo.TxnActivityDayOption.IsSet && acctInfo.TxnActivityDay == null) - throw new ArgumentNullException(nameof(acctInfo.TxnActivityDay), "Property is required for class AcctInfo."); - - if (acctInfo.TxnActivityYearOption.IsSet && acctInfo.TxnActivityYear == null) - throw new ArgumentNullException(nameof(acctInfo.TxnActivityYear), "Property is required for class AcctInfo."); - - var chAccAgeIndRawValue = AcctInfo.ChAccAgeIndEnumToJsonValue(acctInfo.ChAccAgeIndOption.Value.Value); - writer.WriteString("chAccAgeInd", chAccAgeIndRawValue); - if (acctInfo.ChAccChangeOption.IsSet) - writer.WriteString("chAccChange", acctInfo.ChAccChange); - - var chAccChangeIndRawValue = AcctInfo.ChAccChangeIndEnumToJsonValue(acctInfo.ChAccChangeIndOption.Value.Value); - writer.WriteString("chAccChangeInd", chAccChangeIndRawValue); - if (acctInfo.ChAccPwChangeOption.IsSet) - writer.WriteString("chAccPwChange", acctInfo.ChAccPwChange); - - var chAccPwChangeIndRawValue = AcctInfo.ChAccPwChangeIndEnumToJsonValue(acctInfo.ChAccPwChangeIndOption.Value.Value); - writer.WriteString("chAccPwChangeInd", chAccPwChangeIndRawValue); - if (acctInfo.ChAccStringOption.IsSet) - writer.WriteString("chAccString", acctInfo.ChAccString); - - if (acctInfo.NbPurchaseAccountOption.IsSet) - writer.WriteString("nbPurchaseAccount", acctInfo.NbPurchaseAccount); - - if (acctInfo.PaymentAccAgeOption.IsSet) - writer.WriteString("paymentAccAge", acctInfo.PaymentAccAge); - - var paymentAccIndRawValue = AcctInfo.PaymentAccIndEnumToJsonValue(acctInfo.PaymentAccIndOption.Value.Value); - writer.WriteString("paymentAccInd", paymentAccIndRawValue); - if (acctInfo.ProvisionAttemptsDayOption.IsSet) - writer.WriteString("provisionAttemptsDay", acctInfo.ProvisionAttemptsDay); - - if (acctInfo.ShipAddressUsageOption.IsSet) - writer.WriteString("shipAddressUsage", acctInfo.ShipAddressUsage); + // TxnActivityDay (string) maxLength + if (this.TxnActivityDay != null && this.TxnActivityDay.Length > 3) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TxnActivityDay, length must be less than 3.", new [] { "TxnActivityDay" }); + } - var shipAddressUsageIndRawValue = AcctInfo.ShipAddressUsageIndEnumToJsonValue(acctInfo.ShipAddressUsageIndOption.Value.Value); - writer.WriteString("shipAddressUsageInd", shipAddressUsageIndRawValue); - var shipNameIndicatorRawValue = AcctInfo.ShipNameIndicatorEnumToJsonValue(acctInfo.ShipNameIndicatorOption.Value.Value); - writer.WriteString("shipNameIndicator", shipNameIndicatorRawValue); - var suspiciousAccActivityRawValue = AcctInfo.SuspiciousAccActivityEnumToJsonValue(acctInfo.SuspiciousAccActivityOption.Value.Value); - writer.WriteString("suspiciousAccActivity", suspiciousAccActivityRawValue); - if (acctInfo.TxnActivityDayOption.IsSet) - writer.WriteString("txnActivityDay", acctInfo.TxnActivityDay); + // TxnActivityYear (string) maxLength + if (this.TxnActivityYear != null && this.TxnActivityYear.Length > 3) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TxnActivityYear, length must be less than 3.", new [] { "TxnActivityYear" }); + } - if (acctInfo.TxnActivityYearOption.IsSet) - writer.WriteString("txnActivityYear", acctInfo.TxnActivityYear); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AchDetails.cs b/Adyen/Model/Checkout/AchDetails.cs index 41fbd1755..17a32245d 100644 --- a/Adyen/Model/Checkout/AchDetails.cs +++ b/Adyen/Model/Checkout/AchDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,494 +15,231 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AchDetails /// - public partial class AchDetails : IValidatableObject + [DataContract(Name = "AchDetails")] + public partial class AchDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The account holder type (personal or business). - /// The bank account number (without separators). - /// The bank account type (checking, savings...). - /// The bank routing number of the account. The field value is `nil` in most cases. - /// The checkout attempt identifier. - /// Encrypted bank account number. The bank account number (without separators). - /// Encrypted location id. The bank routing number of the account. The field value is `nil` in most cases. - /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. - /// **ach** (default to TypeEnum.Ach) - [JsonConstructor] - public AchDetails(Option accountHolderType = default, Option bankAccountNumber = default, Option bankAccountType = default, Option bankLocationId = default, Option checkoutAttemptId = default, Option encryptedBankAccountNumber = default, Option encryptedBankLocationId = default, Option ownerName = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option transferInstrumentId = default, Option type = default) - { - AccountHolderTypeOption = accountHolderType; - BankAccountNumberOption = bankAccountNumber; - BankAccountTypeOption = bankAccountType; - BankLocationIdOption = bankLocationId; - CheckoutAttemptIdOption = checkoutAttemptId; - EncryptedBankAccountNumberOption = encryptedBankAccountNumber; - EncryptedBankLocationIdOption = encryptedBankLocationId; - OwnerNameOption = ownerName; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TransferInstrumentIdOption = transferInstrumentId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The account holder type (personal or business). /// /// The account holder type (personal or business). + [JsonConverter(typeof(StringEnumConverter))] public enum AccountHolderTypeEnum { /// /// Enum Business for value: business /// + [EnumMember(Value = "business")] Business = 1, /// /// Enum Personal for value: personal /// + [EnumMember(Value = "personal")] Personal = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static AccountHolderTypeEnum AccountHolderTypeEnumFromString(string value) - { - if (value.Equals("business")) - return AccountHolderTypeEnum.Business; - - if (value.Equals("personal")) - return AccountHolderTypeEnum.Personal; - - throw new NotImplementedException($"Could not convert value to type AccountHolderTypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static AccountHolderTypeEnum? AccountHolderTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("business")) - return AccountHolderTypeEnum.Business; - - if (value.Equals("personal")) - return AccountHolderTypeEnum.Personal; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string AccountHolderTypeEnumToJsonValue(AccountHolderTypeEnum? value) - { - if (value == AccountHolderTypeEnum.Business) - return "business"; - - if (value == AccountHolderTypeEnum.Personal) - return "personal"; - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of AccountHolderType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountHolderTypeOption { get; private set; } /// /// The account holder type (personal or business). /// /// The account holder type (personal or business). - [JsonPropertyName("accountHolderType")] - public AccountHolderTypeEnum? AccountHolderType { get { return this.AccountHolderTypeOption; } set { this.AccountHolderTypeOption = new Option(value); } } - + [DataMember(Name = "accountHolderType", EmitDefaultValue = false)] + public AccountHolderTypeEnum? AccountHolderType { get; set; } /// /// The bank account type (checking, savings...). /// /// The bank account type (checking, savings...). + [JsonConverter(typeof(StringEnumConverter))] public enum BankAccountTypeEnum { /// /// Enum Balance for value: balance /// + [EnumMember(Value = "balance")] Balance = 1, /// /// Enum Checking for value: checking /// + [EnumMember(Value = "checking")] Checking = 2, /// /// Enum Deposit for value: deposit /// + [EnumMember(Value = "deposit")] Deposit = 3, /// /// Enum General for value: general /// + [EnumMember(Value = "general")] General = 4, /// /// Enum Other for value: other /// + [EnumMember(Value = "other")] Other = 5, /// /// Enum Payment for value: payment /// + [EnumMember(Value = "payment")] Payment = 6, /// /// Enum Savings for value: savings /// + [EnumMember(Value = "savings")] Savings = 7 - } - - /// - /// Returns a - /// - /// - /// - /// - public static BankAccountTypeEnum BankAccountTypeEnumFromString(string value) - { - if (value.Equals("balance")) - return BankAccountTypeEnum.Balance; - - if (value.Equals("checking")) - return BankAccountTypeEnum.Checking; - - if (value.Equals("deposit")) - return BankAccountTypeEnum.Deposit; - - if (value.Equals("general")) - return BankAccountTypeEnum.General; - - if (value.Equals("other")) - return BankAccountTypeEnum.Other; - - if (value.Equals("payment")) - return BankAccountTypeEnum.Payment; - - if (value.Equals("savings")) - return BankAccountTypeEnum.Savings; - - throw new NotImplementedException($"Could not convert value to type BankAccountTypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static BankAccountTypeEnum? BankAccountTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("balance")) - return BankAccountTypeEnum.Balance; - - if (value.Equals("checking")) - return BankAccountTypeEnum.Checking; - - if (value.Equals("deposit")) - return BankAccountTypeEnum.Deposit; - - if (value.Equals("general")) - return BankAccountTypeEnum.General; - if (value.Equals("other")) - return BankAccountTypeEnum.Other; - - if (value.Equals("payment")) - return BankAccountTypeEnum.Payment; - - if (value.Equals("savings")) - return BankAccountTypeEnum.Savings; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string BankAccountTypeEnumToJsonValue(BankAccountTypeEnum? value) - { - if (value == BankAccountTypeEnum.Balance) - return "balance"; - - if (value == BankAccountTypeEnum.Checking) - return "checking"; - - if (value == BankAccountTypeEnum.Deposit) - return "deposit"; - - if (value == BankAccountTypeEnum.General) - return "general"; - - if (value == BankAccountTypeEnum.Other) - return "other"; - - if (value == BankAccountTypeEnum.Payment) - return "payment"; - - if (value == BankAccountTypeEnum.Savings) - return "savings"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of BankAccountType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankAccountTypeOption { get; private set; } /// /// The bank account type (checking, savings...). /// /// The bank account type (checking, savings...). - [JsonPropertyName("bankAccountType")] - public BankAccountTypeEnum? BankAccountType { get { return this.BankAccountTypeOption; } set { this.BankAccountTypeOption = new Option(value); } } - + [DataMember(Name = "bankAccountType", EmitDefaultValue = false)] + public BankAccountTypeEnum? BankAccountType { get; set; } /// /// **ach** /// /// **ach** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Ach for value: ach /// + [EnumMember(Value = "ach")] Ach = 1, /// /// Enum AchPlaid for value: ach_plaid /// + [EnumMember(Value = "ach_plaid")] AchPlaid = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("ach")) - return TypeEnum.Ach; - - if (value.Equals("ach_plaid")) - return TypeEnum.AchPlaid; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("ach")) - return TypeEnum.Ach; - - if (value.Equals("ach_plaid")) - return TypeEnum.AchPlaid; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Ach) - return "ach"; - - if (value == TypeEnum.AchPlaid) - return "ach_plaid"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **ach** /// /// **ach** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of BankAccountNumber + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankAccountNumberOption { get; private set; } + /// The account holder type (personal or business).. + /// The bank account number (without separators).. + /// The bank account type (checking, savings...).. + /// The bank routing number of the account. The field value is `nil` in most cases.. + /// The checkout attempt identifier.. + /// Encrypted bank account number. The bank account number (without separators).. + /// Encrypted location id. The bank routing number of the account. The field value is `nil` in most cases.. + /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts.. + /// **ach** (default to TypeEnum.Ach). + public AchDetails(AccountHolderTypeEnum? accountHolderType = default(AccountHolderTypeEnum?), string bankAccountNumber = default(string), BankAccountTypeEnum? bankAccountType = default(BankAccountTypeEnum?), string bankLocationId = default(string), string checkoutAttemptId = default(string), string encryptedBankAccountNumber = default(string), string encryptedBankLocationId = default(string), string ownerName = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string transferInstrumentId = default(string), TypeEnum? type = TypeEnum.Ach) + { + this.AccountHolderType = accountHolderType; + this.BankAccountNumber = bankAccountNumber; + this.BankAccountType = bankAccountType; + this.BankLocationId = bankLocationId; + this.CheckoutAttemptId = checkoutAttemptId; + this.EncryptedBankAccountNumber = encryptedBankAccountNumber; + this.EncryptedBankLocationId = encryptedBankLocationId; + this.OwnerName = ownerName; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.TransferInstrumentId = transferInstrumentId; + this.Type = type; + } /// /// The bank account number (without separators). /// /// The bank account number (without separators). - [JsonPropertyName("bankAccountNumber")] - public string BankAccountNumber { get { return this.BankAccountNumberOption; } set { this.BankAccountNumberOption = new Option(value); } } - - /// - /// Used to track the state of BankLocationId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankLocationIdOption { get; private set; } + [DataMember(Name = "bankAccountNumber", EmitDefaultValue = false)] + public string BankAccountNumber { get; set; } /// /// The bank routing number of the account. The field value is `nil` in most cases. /// /// The bank routing number of the account. The field value is `nil` in most cases. - [JsonPropertyName("bankLocationId")] - public string BankLocationId { get { return this.BankLocationIdOption; } set { this.BankLocationIdOption = new Option(value); } } - - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + [DataMember(Name = "bankLocationId", EmitDefaultValue = false)] + public string BankLocationId { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedBankAccountNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedBankAccountNumberOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Encrypted bank account number. The bank account number (without separators). /// /// Encrypted bank account number. The bank account number (without separators). - [JsonPropertyName("encryptedBankAccountNumber")] - public string EncryptedBankAccountNumber { get { return this.EncryptedBankAccountNumberOption; } set { this.EncryptedBankAccountNumberOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedBankLocationId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedBankLocationIdOption { get; private set; } + [DataMember(Name = "encryptedBankAccountNumber", EmitDefaultValue = false)] + public string EncryptedBankAccountNumber { get; set; } /// /// Encrypted location id. The bank routing number of the account. The field value is `nil` in most cases. /// /// Encrypted location id. The bank routing number of the account. The field value is `nil` in most cases. - [JsonPropertyName("encryptedBankLocationId")] - public string EncryptedBankLocationId { get { return this.EncryptedBankLocationIdOption; } set { this.EncryptedBankLocationIdOption = new Option(value); } } - - /// - /// Used to track the state of OwnerName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OwnerNameOption { get; private set; } + [DataMember(Name = "encryptedBankLocationId", EmitDefaultValue = false)] + public string EncryptedBankLocationId { get; set; } /// /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. /// /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. - [JsonPropertyName("ownerName")] - public string OwnerName { get { return this.OwnerNameOption; } set { this.OwnerNameOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "ownerName", EmitDefaultValue = false)] + public string OwnerName { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of TransferInstrumentId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TransferInstrumentIdOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. /// /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. - [JsonPropertyName("transferInstrumentId")] - public string TransferInstrumentId { get { return this.TransferInstrumentIdOption; } set { this.TransferInstrumentIdOption = new Option(value); } } + [DataMember(Name = "transferInstrumentId", EmitDefaultValue = false)] + public string TransferInstrumentId { get; set; } /// /// Returns the string presentation of the object @@ -528,243 +266,161 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } - yield break; + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AchDetails); } - } - /// - /// A Json converter for type - /// - public class AchDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if AchDetails instances are equal /// - /// - /// - /// - /// - /// - public override AchDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Instance of AchDetails to be compared + /// Boolean + public bool Equals(AchDetails input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option accountHolderType = default; - Option bankAccountNumber = default; - Option bankAccountType = default; - Option bankLocationId = default; - Option checkoutAttemptId = default; - Option encryptedBankAccountNumber = default; - Option encryptedBankLocationId = default; - Option ownerName = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option transferInstrumentId = default; - Option type = default; - - while (utf8JsonReader.Read()) + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "accountHolderType": - string accountHolderTypeRawValue = utf8JsonReader.GetString(); - if (accountHolderTypeRawValue != null) - accountHolderType = new Option(AchDetails.AccountHolderTypeEnumFromStringOrDefault(accountHolderTypeRawValue)); - break; - case "bankAccountNumber": - bankAccountNumber = new Option(utf8JsonReader.GetString()); - break; - case "bankAccountType": - string bankAccountTypeRawValue = utf8JsonReader.GetString(); - if (bankAccountTypeRawValue != null) - bankAccountType = new Option(AchDetails.BankAccountTypeEnumFromStringOrDefault(bankAccountTypeRawValue)); - break; - case "bankLocationId": - bankLocationId = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "encryptedBankAccountNumber": - encryptedBankAccountNumber = new Option(utf8JsonReader.GetString()); - break; - case "encryptedBankLocationId": - encryptedBankLocationId = new Option(utf8JsonReader.GetString()); - break; - case "ownerName": - ownerName = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "transferInstrumentId": - transferInstrumentId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(AchDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (accountHolderType.IsSet && accountHolderType.Value == null) - throw new ArgumentNullException(nameof(accountHolderType), "Property is not nullable for class AchDetails."); - - if (bankAccountNumber.IsSet && bankAccountNumber.Value == null) - throw new ArgumentNullException(nameof(bankAccountNumber), "Property is not nullable for class AchDetails."); - - if (bankAccountType.IsSet && bankAccountType.Value == null) - throw new ArgumentNullException(nameof(bankAccountType), "Property is not nullable for class AchDetails."); - - if (bankLocationId.IsSet && bankLocationId.Value == null) - throw new ArgumentNullException(nameof(bankLocationId), "Property is not nullable for class AchDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class AchDetails."); - - if (encryptedBankAccountNumber.IsSet && encryptedBankAccountNumber.Value == null) - throw new ArgumentNullException(nameof(encryptedBankAccountNumber), "Property is not nullable for class AchDetails."); - - if (encryptedBankLocationId.IsSet && encryptedBankLocationId.Value == null) - throw new ArgumentNullException(nameof(encryptedBankLocationId), "Property is not nullable for class AchDetails."); - - if (ownerName.IsSet && ownerName.Value == null) - throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class AchDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class AchDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class AchDetails."); - - if (transferInstrumentId.IsSet && transferInstrumentId.Value == null) - throw new ArgumentNullException(nameof(transferInstrumentId), "Property is not nullable for class AchDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class AchDetails."); - - return new AchDetails(accountHolderType, bankAccountNumber, bankAccountType, bankLocationId, checkoutAttemptId, encryptedBankAccountNumber, encryptedBankLocationId, ownerName, recurringDetailReference, storedPaymentMethodId, transferInstrumentId, type); + return + ( + this.AccountHolderType == input.AccountHolderType || + this.AccountHolderType.Equals(input.AccountHolderType) + ) && + ( + this.BankAccountNumber == input.BankAccountNumber || + (this.BankAccountNumber != null && + this.BankAccountNumber.Equals(input.BankAccountNumber)) + ) && + ( + this.BankAccountType == input.BankAccountType || + this.BankAccountType.Equals(input.BankAccountType) + ) && + ( + this.BankLocationId == input.BankLocationId || + (this.BankLocationId != null && + this.BankLocationId.Equals(input.BankLocationId)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.EncryptedBankAccountNumber == input.EncryptedBankAccountNumber || + (this.EncryptedBankAccountNumber != null && + this.EncryptedBankAccountNumber.Equals(input.EncryptedBankAccountNumber)) + ) && + ( + this.EncryptedBankLocationId == input.EncryptedBankLocationId || + (this.EncryptedBankLocationId != null && + this.EncryptedBankLocationId.Equals(input.EncryptedBankLocationId)) + ) && + ( + this.OwnerName == input.OwnerName || + (this.OwnerName != null && + this.OwnerName.Equals(input.OwnerName)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.TransferInstrumentId == input.TransferInstrumentId || + (this.TransferInstrumentId != null && + this.TransferInstrumentId.Equals(input.TransferInstrumentId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AchDetails achDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, achDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.AccountHolderType.GetHashCode(); + if (this.BankAccountNumber != null) + { + hashCode = (hashCode * 59) + this.BankAccountNumber.GetHashCode(); + } + hashCode = (hashCode * 59) + this.BankAccountType.GetHashCode(); + if (this.BankLocationId != null) + { + hashCode = (hashCode * 59) + this.BankLocationId.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.EncryptedBankAccountNumber != null) + { + hashCode = (hashCode * 59) + this.EncryptedBankAccountNumber.GetHashCode(); + } + if (this.EncryptedBankLocationId != null) + { + hashCode = (hashCode * 59) + this.EncryptedBankLocationId.GetHashCode(); + } + if (this.OwnerName != null) + { + hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.TransferInstrumentId != null) + { + hashCode = (hashCode * 59) + this.TransferInstrumentId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AchDetails achDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (achDetails.BankAccountNumberOption.IsSet && achDetails.BankAccountNumber == null) - throw new ArgumentNullException(nameof(achDetails.BankAccountNumber), "Property is required for class AchDetails."); - - if (achDetails.BankLocationIdOption.IsSet && achDetails.BankLocationId == null) - throw new ArgumentNullException(nameof(achDetails.BankLocationId), "Property is required for class AchDetails."); - - if (achDetails.CheckoutAttemptIdOption.IsSet && achDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(achDetails.CheckoutAttemptId), "Property is required for class AchDetails."); - - if (achDetails.EncryptedBankAccountNumberOption.IsSet && achDetails.EncryptedBankAccountNumber == null) - throw new ArgumentNullException(nameof(achDetails.EncryptedBankAccountNumber), "Property is required for class AchDetails."); - - if (achDetails.EncryptedBankLocationIdOption.IsSet && achDetails.EncryptedBankLocationId == null) - throw new ArgumentNullException(nameof(achDetails.EncryptedBankLocationId), "Property is required for class AchDetails."); - - if (achDetails.OwnerNameOption.IsSet && achDetails.OwnerName == null) - throw new ArgumentNullException(nameof(achDetails.OwnerName), "Property is required for class AchDetails."); - - if (achDetails.RecurringDetailReferenceOption.IsSet && achDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(achDetails.RecurringDetailReference), "Property is required for class AchDetails."); - - if (achDetails.StoredPaymentMethodIdOption.IsSet && achDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(achDetails.StoredPaymentMethodId), "Property is required for class AchDetails."); - - if (achDetails.TransferInstrumentIdOption.IsSet && achDetails.TransferInstrumentId == null) - throw new ArgumentNullException(nameof(achDetails.TransferInstrumentId), "Property is required for class AchDetails."); - - var accountHolderTypeRawValue = AchDetails.AccountHolderTypeEnumToJsonValue(achDetails.AccountHolderTypeOption.Value.Value); - writer.WriteString("accountHolderType", accountHolderTypeRawValue); - if (achDetails.BankAccountNumberOption.IsSet) - writer.WriteString("bankAccountNumber", achDetails.BankAccountNumber); - - var bankAccountTypeRawValue = AchDetails.BankAccountTypeEnumToJsonValue(achDetails.BankAccountTypeOption.Value.Value); - writer.WriteString("bankAccountType", bankAccountTypeRawValue); - if (achDetails.BankLocationIdOption.IsSet) - writer.WriteString("bankLocationId", achDetails.BankLocationId); - - if (achDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", achDetails.CheckoutAttemptId); - - if (achDetails.EncryptedBankAccountNumberOption.IsSet) - writer.WriteString("encryptedBankAccountNumber", achDetails.EncryptedBankAccountNumber); - - if (achDetails.EncryptedBankLocationIdOption.IsSet) - writer.WriteString("encryptedBankLocationId", achDetails.EncryptedBankLocationId); - - if (achDetails.OwnerNameOption.IsSet) - writer.WriteString("ownerName", achDetails.OwnerName); - - if (achDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", achDetails.RecurringDetailReference); - - if (achDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", achDetails.StoredPaymentMethodId); - - if (achDetails.TransferInstrumentIdOption.IsSet) - writer.WriteString("transferInstrumentId", achDetails.TransferInstrumentId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = AchDetails.TypeEnumToJsonValue(achDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalData3DSecure.cs b/Adyen/Model/Checkout/AdditionalData3DSecure.cs index 7a8effda5..3afeb1d89 100644 --- a/Adyen/Model/Checkout/AdditionalData3DSecure.cs +++ b/Adyen/Model/Checkout/AdditionalData3DSecure.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,237 +15,124 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalData3DSecure /// - public partial class AdditionalData3DSecure : IValidatableObject + [DataContract(Name = "AdditionalData3DSecure")] + public partial class AdditionalData3DSecure : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen selects redirect or native authentication based on your configuration to optimize authorization rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen offers redirect 3D Secure 2 authentication instead, based on your configuration. - /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen - /// Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. - /// In case of Secure+, this field must be set to **CUPSecurePlus**. - /// Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** - /// Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. * If you the BIN is not enrolled, you will receive an error. - [JsonConstructor] - public AdditionalData3DSecure(Option allow3DS2 = default, Option challengeWindowSize = default, Option executeThreeD = default, Option mpiImplementationType = default, Option scaExemption = default, Option threeDSVersion = default) - { - Allow3DS2Option = allow3DS2; - ChallengeWindowSizeOption = challengeWindowSize; - ExecuteThreeDOption = executeThreeD; - MpiImplementationTypeOption = mpiImplementationType; - ScaExemptionOption = scaExemption; - ThreeDSVersionOption = threeDSVersion; - OnCreated(); - } - - partial void OnCreated(); - /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen + [JsonConverter(typeof(StringEnumConverter))] public enum ChallengeWindowSizeEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// + [EnumMember(Value = "05")] _05 = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ChallengeWindowSizeEnum ChallengeWindowSizeEnumFromString(string value) - { - if (value.Equals("01")) - return ChallengeWindowSizeEnum._01; - - if (value.Equals("02")) - return ChallengeWindowSizeEnum._02; - - if (value.Equals("03")) - return ChallengeWindowSizeEnum._03; - if (value.Equals("04")) - return ChallengeWindowSizeEnum._04; - - if (value.Equals("05")) - return ChallengeWindowSizeEnum._05; - - throw new NotImplementedException($"Could not convert value to type ChallengeWindowSizeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static ChallengeWindowSizeEnum? ChallengeWindowSizeEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ChallengeWindowSizeEnum._01; - - if (value.Equals("02")) - return ChallengeWindowSizeEnum._02; - - if (value.Equals("03")) - return ChallengeWindowSizeEnum._03; - - if (value.Equals("04")) - return ChallengeWindowSizeEnum._04; - - if (value.Equals("05")) - return ChallengeWindowSizeEnum._05; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChallengeWindowSizeEnumToJsonValue(ChallengeWindowSizeEnum? value) - { - if (value == ChallengeWindowSizeEnum._01) - return "01"; - - if (value == ChallengeWindowSizeEnum._02) - return "02"; - - if (value == ChallengeWindowSizeEnum._03) - return "03"; - - if (value == ChallengeWindowSizeEnum._04) - return "04"; - - if (value == ChallengeWindowSizeEnum._05) - return "05"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ChallengeWindowSize - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChallengeWindowSizeOption { get; private set; } /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen - [JsonPropertyName("challengeWindowSize")] - public ChallengeWindowSizeEnum? ChallengeWindowSize { get { return this.ChallengeWindowSizeOption; } set { this.ChallengeWindowSizeOption = new Option(value); } } - + [DataMember(Name = "challengeWindowSize", EmitDefaultValue = false)] + public ChallengeWindowSizeEnum? ChallengeWindowSize { get; set; } /// - /// Used to track the state of Allow3DS2 + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option Allow3DS2Option { get; private set; } + /// Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen selects redirect or native authentication based on your configuration to optimize authorization rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen offers redirect 3D Secure 2 authentication instead, based on your configuration. . + /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen. + /// Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. . + /// In case of Secure+, this field must be set to **CUPSecurePlus**.. + /// Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** . + /// Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. * If you the BIN is not enrolled, you will receive an error. . + public AdditionalData3DSecure(string allow3DS2 = default(string), ChallengeWindowSizeEnum? challengeWindowSize = default(ChallengeWindowSizeEnum?), string executeThreeD = default(string), string mpiImplementationType = default(string), string scaExemption = default(string), string threeDSVersion = default(string)) + { + this.Allow3DS2 = allow3DS2; + this.ChallengeWindowSize = challengeWindowSize; + this.ExecuteThreeD = executeThreeD; + this.MpiImplementationType = mpiImplementationType; + this.ScaExemption = scaExemption; + this.ThreeDSVersion = threeDSVersion; + } /// /// Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen selects redirect or native authentication based on your configuration to optimize authorization rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen offers redirect 3D Secure 2 authentication instead, based on your configuration. /// /// Indicates if you are able to process 3D Secure 2 transactions natively on your payment page. Send this parameter when you are using `/payments` endpoint with any of our [native 3D Secure 2 solutions](https://docs.adyen.com/online-payments/3d-secure/native-3ds2). > This parameter only indicates readiness to support native 3D Secure 2 authentication. To specify if you _want_ to perform 3D Secure, use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) or send the `executeThreeD` parameter. Possible values: * **true** - Ready to support native 3D Secure 2 authentication. Setting this to true does not mean always applying 3D Secure 2. Adyen selects redirect or native authentication based on your configuration to optimize authorization rates and improve the shopper's experience. * **false** – Not ready to support native 3D Secure 2 authentication. Adyen offers redirect 3D Secure 2 authentication instead, based on your configuration. - [JsonPropertyName("allow3DS2")] - [Obsolete] - public string Allow3DS2 { get { return this.Allow3DS2Option; } set { this.Allow3DS2Option = new Option(value); } } - - /// - /// Used to track the state of ExecuteThreeD - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExecuteThreeDOption { get; private set; } + [DataMember(Name = "allow3DS2", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.threeDSRequestData.nativeThreeDS` instead.")] + public string Allow3DS2 { get; set; } /// /// Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. /// /// Indicates if you want to perform 3D Secure authentication on a transaction. > Alternatively, you can use [Dynamic 3D Secure](/risk-management/dynamic-3d-secure) to configure rules for applying 3D Secure. Possible values: * **true** – Perform 3D Secure authentication. * **false** – Don't perform 3D Secure authentication. Note that this setting results in refusals if the issuer mandates 3D Secure because of the PSD2 directive or other, national regulations. - [JsonPropertyName("executeThreeD")] - [Obsolete] - public string ExecuteThreeD { get { return this.ExecuteThreeDOption; } set { this.ExecuteThreeDOption = new Option(value); } } - - /// - /// Used to track the state of MpiImplementationType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MpiImplementationTypeOption { get; private set; } + [DataMember(Name = "executeThreeD", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v69. Use [`authenticationData.attemptAuthentication`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments?target=_blank#request-authenticationData-attemptAuthentication) instead")] + public string ExecuteThreeD { get; set; } /// /// In case of Secure+, this field must be set to **CUPSecurePlus**. /// /// In case of Secure+, this field must be set to **CUPSecurePlus**. - [JsonPropertyName("mpiImplementationType")] - public string MpiImplementationType { get { return this.MpiImplementationTypeOption; } set { this.MpiImplementationTypeOption = new Option(value); } } - - /// - /// Used to track the state of ScaExemption - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ScaExemptionOption { get; private set; } + [DataMember(Name = "mpiImplementationType", EmitDefaultValue = false)] + public string MpiImplementationType { get; set; } /// /// Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** /// /// Indicates the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that you want to request for the transaction. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** - [JsonPropertyName("scaExemption")] - public string ScaExemption { get { return this.ScaExemptionOption; } set { this.ScaExemptionOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSVersionOption { get; private set; } + [DataMember(Name = "scaExemption", EmitDefaultValue = false)] + public string ScaExemption { get; set; } /// /// Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. * If you the BIN is not enrolled, you will receive an error. /// /// Indicates your preference for the 3D Secure version. > If you use this parameter, you override the checks from Adyen's Authentication Engine. We recommend to use this field only if you have an extensive knowledge of 3D Secure. Possible values: * **2.1.0**: Apply 3D Secure version 2.1.0. * **2.2.0**: Apply 3D Secure version 2.2.0. If the issuer does not support version 2.2.0, we will fall back to 2.1.0. The following rules apply: * If you prefer 2.1.0 or 2.2.0 but we receive a negative `transStatus` in the `ARes`, we will apply the fallback policy configured in your account. * If you the BIN is not enrolled, you will receive an error. - [JsonPropertyName("threeDSVersion")] - public string ThreeDSVersion { get { return this.ThreeDSVersionOption; } set { this.ThreeDSVersionOption = new Option(value); } } + [DataMember(Name = "threeDSVersion", EmitDefaultValue = false)] + public string ThreeDSVersion { get; set; } /// /// Returns the string presentation of the object @@ -265,162 +153,109 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalData3DSecureJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalData3DSecure Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option allow3DS2 = default; - Option challengeWindowSize = default; - Option executeThreeD = default; - Option mpiImplementationType = default; - Option scaExemption = default; - Option threeDSVersion = default; + return this.Equals(input as AdditionalData3DSecure); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AdditionalData3DSecure instances are equal + /// + /// Instance of AdditionalData3DSecure to be compared + /// Boolean + public bool Equals(AdditionalData3DSecure input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "allow3DS2": - allow3DS2 = new Option(utf8JsonReader.GetString()); - break; - case "challengeWindowSize": - string challengeWindowSizeRawValue = utf8JsonReader.GetString(); - if (challengeWindowSizeRawValue != null) - challengeWindowSize = new Option(AdditionalData3DSecure.ChallengeWindowSizeEnumFromStringOrDefault(challengeWindowSizeRawValue)); - break; - case "executeThreeD": - executeThreeD = new Option(utf8JsonReader.GetString()); - break; - case "mpiImplementationType": - mpiImplementationType = new Option(utf8JsonReader.GetString()); - break; - case "scaExemption": - scaExemption = new Option(utf8JsonReader.GetString()); - break; - case "threeDSVersion": - threeDSVersion = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (allow3DS2.IsSet && allow3DS2.Value == null) - throw new ArgumentNullException(nameof(allow3DS2), "Property is not nullable for class AdditionalData3DSecure."); - - if (challengeWindowSize.IsSet && challengeWindowSize.Value == null) - throw new ArgumentNullException(nameof(challengeWindowSize), "Property is not nullable for class AdditionalData3DSecure."); - - if (executeThreeD.IsSet && executeThreeD.Value == null) - throw new ArgumentNullException(nameof(executeThreeD), "Property is not nullable for class AdditionalData3DSecure."); - - if (mpiImplementationType.IsSet && mpiImplementationType.Value == null) - throw new ArgumentNullException(nameof(mpiImplementationType), "Property is not nullable for class AdditionalData3DSecure."); - - if (scaExemption.IsSet && scaExemption.Value == null) - throw new ArgumentNullException(nameof(scaExemption), "Property is not nullable for class AdditionalData3DSecure."); - - if (threeDSVersion.IsSet && threeDSVersion.Value == null) - throw new ArgumentNullException(nameof(threeDSVersion), "Property is not nullable for class AdditionalData3DSecure."); - - return new AdditionalData3DSecure(allow3DS2, challengeWindowSize, executeThreeD, mpiImplementationType, scaExemption, threeDSVersion); + return + ( + this.Allow3DS2 == input.Allow3DS2 || + (this.Allow3DS2 != null && + this.Allow3DS2.Equals(input.Allow3DS2)) + ) && + ( + this.ChallengeWindowSize == input.ChallengeWindowSize || + this.ChallengeWindowSize.Equals(input.ChallengeWindowSize) + ) && + ( + this.ExecuteThreeD == input.ExecuteThreeD || + (this.ExecuteThreeD != null && + this.ExecuteThreeD.Equals(input.ExecuteThreeD)) + ) && + ( + this.MpiImplementationType == input.MpiImplementationType || + (this.MpiImplementationType != null && + this.MpiImplementationType.Equals(input.MpiImplementationType)) + ) && + ( + this.ScaExemption == input.ScaExemption || + (this.ScaExemption != null && + this.ScaExemption.Equals(input.ScaExemption)) + ) && + ( + this.ThreeDSVersion == input.ThreeDSVersion || + (this.ThreeDSVersion != null && + this.ThreeDSVersion.Equals(input.ThreeDSVersion)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalData3DSecure additionalData3DSecure, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalData3DSecure, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Allow3DS2 != null) + { + hashCode = (hashCode * 59) + this.Allow3DS2.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ChallengeWindowSize.GetHashCode(); + if (this.ExecuteThreeD != null) + { + hashCode = (hashCode * 59) + this.ExecuteThreeD.GetHashCode(); + } + if (this.MpiImplementationType != null) + { + hashCode = (hashCode * 59) + this.MpiImplementationType.GetHashCode(); + } + if (this.ScaExemption != null) + { + hashCode = (hashCode * 59) + this.ScaExemption.GetHashCode(); + } + if (this.ThreeDSVersion != null) + { + hashCode = (hashCode * 59) + this.ThreeDSVersion.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalData3DSecure additionalData3DSecure, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalData3DSecure.Allow3DS2Option.IsSet && additionalData3DSecure.Allow3DS2 == null) - throw new ArgumentNullException(nameof(additionalData3DSecure.Allow3DS2), "Property is required for class AdditionalData3DSecure."); - - if (additionalData3DSecure.ExecuteThreeDOption.IsSet && additionalData3DSecure.ExecuteThreeD == null) - throw new ArgumentNullException(nameof(additionalData3DSecure.ExecuteThreeD), "Property is required for class AdditionalData3DSecure."); - - if (additionalData3DSecure.MpiImplementationTypeOption.IsSet && additionalData3DSecure.MpiImplementationType == null) - throw new ArgumentNullException(nameof(additionalData3DSecure.MpiImplementationType), "Property is required for class AdditionalData3DSecure."); - - if (additionalData3DSecure.ScaExemptionOption.IsSet && additionalData3DSecure.ScaExemption == null) - throw new ArgumentNullException(nameof(additionalData3DSecure.ScaExemption), "Property is required for class AdditionalData3DSecure."); - - if (additionalData3DSecure.ThreeDSVersionOption.IsSet && additionalData3DSecure.ThreeDSVersion == null) - throw new ArgumentNullException(nameof(additionalData3DSecure.ThreeDSVersion), "Property is required for class AdditionalData3DSecure."); - - if (additionalData3DSecure.Allow3DS2Option.IsSet) - writer.WriteString("allow3DS2", additionalData3DSecure.Allow3DS2); - - var challengeWindowSizeRawValue = AdditionalData3DSecure.ChallengeWindowSizeEnumToJsonValue(additionalData3DSecure.ChallengeWindowSizeOption.Value.Value); - writer.WriteString("challengeWindowSize", challengeWindowSizeRawValue); - if (additionalData3DSecure.ExecuteThreeDOption.IsSet) - writer.WriteString("executeThreeD", additionalData3DSecure.ExecuteThreeD); - - if (additionalData3DSecure.MpiImplementationTypeOption.IsSet) - writer.WriteString("mpiImplementationType", additionalData3DSecure.MpiImplementationType); - - if (additionalData3DSecure.ScaExemptionOption.IsSet) - writer.WriteString("scaExemption", additionalData3DSecure.ScaExemption); - - if (additionalData3DSecure.ThreeDSVersionOption.IsSet) - writer.WriteString("threeDSVersion", additionalData3DSecure.ThreeDSVersion); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataAirline.cs b/Adyen/Model/Checkout/AdditionalDataAirline.cs index fa5b95c07..76180793a 100644 --- a/Adyen/Model/Checkout/AdditionalDataAirline.cs +++ b/Adyen/Model/Checkout/AdditionalDataAirline.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,487 +15,295 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataAirline /// - public partial class AdditionalDataAirline : IValidatableObject + [DataContract(Name = "AdditionalDataAirline")] + public partial class AdditionalDataAirline : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros. - /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters - /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros. - /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters - /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters - /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces - /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters - /// The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters - /// The date that the ticket was issued to the passenger. * minLength: 6 characters * maxLength: 6 characters * Date format: YYMMDD - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros. - /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros. - /// Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. - /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros. - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. - /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros. - /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros. - /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character - /// The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 - /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII - /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII - /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters - /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters - /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters - /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros. - /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros. - /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros. - [JsonConstructor] - public AdditionalDataAirline(string airlinePassengerName, Option airlineAgencyInvoiceNumber = default, Option airlineAgencyPlanName = default, Option airlineAirlineCode = default, Option airlineAirlineDesignatorCode = default, Option airlineBoardingFee = default, Option airlineComputerizedReservationSystem = default, Option airlineCustomerReferenceNumber = default, Option airlineDocumentType = default, Option airlineFlightDate = default, Option airlineIssueDate = default, Option airlineLegCarrierCode = default, Option airlineLegClassOfTravel = default, Option airlineLegDateOfTravel = default, Option airlineLegDepartAirport = default, Option airlineLegDepartTax = default, Option airlineLegDestinationCode = default, Option airlineLegFareBaseCode = default, Option airlineLegFlightNumber = default, Option airlineLegStopOverCode = default, Option airlinePassengerDateOfBirth = default, Option airlinePassengerFirstName = default, Option airlinePassengerLastName = default, Option airlinePassengerPhoneNumber = default, Option airlinePassengerTravellerType = default, Option airlineTicketIssueAddress = default, Option airlineTicketNumber = default, Option airlineTravelAgencyCode = default, Option airlineTravelAgencyName = default) - { - AirlinePassengerName = airlinePassengerName; - AirlineAgencyInvoiceNumberOption = airlineAgencyInvoiceNumber; - AirlineAgencyPlanNameOption = airlineAgencyPlanName; - AirlineAirlineCodeOption = airlineAirlineCode; - AirlineAirlineDesignatorCodeOption = airlineAirlineDesignatorCode; - AirlineBoardingFeeOption = airlineBoardingFee; - AirlineComputerizedReservationSystemOption = airlineComputerizedReservationSystem; - AirlineCustomerReferenceNumberOption = airlineCustomerReferenceNumber; - AirlineDocumentTypeOption = airlineDocumentType; - AirlineFlightDateOption = airlineFlightDate; - AirlineIssueDateOption = airlineIssueDate; - AirlineLegCarrierCodeOption = airlineLegCarrierCode; - AirlineLegClassOfTravelOption = airlineLegClassOfTravel; - AirlineLegDateOfTravelOption = airlineLegDateOfTravel; - AirlineLegDepartAirportOption = airlineLegDepartAirport; - AirlineLegDepartTaxOption = airlineLegDepartTax; - AirlineLegDestinationCodeOption = airlineLegDestinationCode; - AirlineLegFareBaseCodeOption = airlineLegFareBaseCode; - AirlineLegFlightNumberOption = airlineLegFlightNumber; - AirlineLegStopOverCodeOption = airlineLegStopOverCode; - AirlinePassengerDateOfBirthOption = airlinePassengerDateOfBirth; - AirlinePassengerFirstNameOption = airlinePassengerFirstName; - AirlinePassengerLastNameOption = airlinePassengerLastName; - AirlinePassengerPhoneNumberOption = airlinePassengerPhoneNumber; - AirlinePassengerTravellerTypeOption = airlinePassengerTravellerType; - AirlineTicketIssueAddressOption = airlineTicketIssueAddress; - AirlineTicketNumberOption = airlineTicketNumber; - AirlineTravelAgencyCodeOption = airlineTravelAgencyCode; - AirlineTravelAgencyNameOption = airlineTravelAgencyName; - OnCreated(); - } - - partial void OnCreated(); - + [JsonConstructorAttribute] + protected AdditionalDataAirline() { } /// - /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros. - /// - /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros. - [JsonPropertyName("airline.passenger_name")] - public string AirlinePassengerName { get; set; } - - /// - /// Used to track the state of AirlineAgencyInvoiceNumber + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineAgencyInvoiceNumberOption { get; private set; } + /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters. + /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters. + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros.. + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros.. + /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters. + /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters. + /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces. + /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters. + /// The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters. + /// The date that the ticket was issued to the passenger. * minLength: 6 characters * maxLength: 6 characters * Date format: YYMMDD. + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros.. + /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros.. + /// Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters. + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros.. + /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros.. + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros.. + /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros.. + /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros.. + /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character. + /// The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10. + /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII. + /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII. + /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters. + /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters. + /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros. (required). + /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters. + /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros.. + /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros.. + /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros.. + public AdditionalDataAirline(string airlineAgencyInvoiceNumber = default(string), string airlineAgencyPlanName = default(string), string airlineAirlineCode = default(string), string airlineAirlineDesignatorCode = default(string), string airlineBoardingFee = default(string), string airlineComputerizedReservationSystem = default(string), string airlineCustomerReferenceNumber = default(string), string airlineDocumentType = default(string), string airlineFlightDate = default(string), string airlineIssueDate = default(string), string airlineLegCarrierCode = default(string), string airlineLegClassOfTravel = default(string), string airlineLegDateOfTravel = default(string), string airlineLegDepartAirport = default(string), string airlineLegDepartTax = default(string), string airlineLegDestinationCode = default(string), string airlineLegFareBaseCode = default(string), string airlineLegFlightNumber = default(string), string airlineLegStopOverCode = default(string), string airlinePassengerDateOfBirth = default(string), string airlinePassengerFirstName = default(string), string airlinePassengerLastName = default(string), string airlinePassengerPhoneNumber = default(string), string airlinePassengerTravellerType = default(string), string airlinePassengerName = default(string), string airlineTicketIssueAddress = default(string), string airlineTicketNumber = default(string), string airlineTravelAgencyCode = default(string), string airlineTravelAgencyName = default(string)) + { + this.AirlinePassengerName = airlinePassengerName; + this.AirlineAgencyInvoiceNumber = airlineAgencyInvoiceNumber; + this.AirlineAgencyPlanName = airlineAgencyPlanName; + this.AirlineAirlineCode = airlineAirlineCode; + this.AirlineAirlineDesignatorCode = airlineAirlineDesignatorCode; + this.AirlineBoardingFee = airlineBoardingFee; + this.AirlineComputerizedReservationSystem = airlineComputerizedReservationSystem; + this.AirlineCustomerReferenceNumber = airlineCustomerReferenceNumber; + this.AirlineDocumentType = airlineDocumentType; + this.AirlineFlightDate = airlineFlightDate; + this.AirlineIssueDate = airlineIssueDate; + this.AirlineLegCarrierCode = airlineLegCarrierCode; + this.AirlineLegClassOfTravel = airlineLegClassOfTravel; + this.AirlineLegDateOfTravel = airlineLegDateOfTravel; + this.AirlineLegDepartAirport = airlineLegDepartAirport; + this.AirlineLegDepartTax = airlineLegDepartTax; + this.AirlineLegDestinationCode = airlineLegDestinationCode; + this.AirlineLegFareBaseCode = airlineLegFareBaseCode; + this.AirlineLegFlightNumber = airlineLegFlightNumber; + this.AirlineLegStopOverCode = airlineLegStopOverCode; + this.AirlinePassengerDateOfBirth = airlinePassengerDateOfBirth; + this.AirlinePassengerFirstName = airlinePassengerFirstName; + this.AirlinePassengerLastName = airlinePassengerLastName; + this.AirlinePassengerPhoneNumber = airlinePassengerPhoneNumber; + this.AirlinePassengerTravellerType = airlinePassengerTravellerType; + this.AirlineTicketIssueAddress = airlineTicketIssueAddress; + this.AirlineTicketNumber = airlineTicketNumber; + this.AirlineTravelAgencyCode = airlineTravelAgencyCode; + this.AirlineTravelAgencyName = airlineTravelAgencyName; + } /// /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters /// /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters - [JsonPropertyName("airline.agency_invoice_number")] - public string AirlineAgencyInvoiceNumber { get { return this.AirlineAgencyInvoiceNumberOption; } set { this.AirlineAgencyInvoiceNumberOption = new Option(value); } } - - /// - /// Used to track the state of AirlineAgencyPlanName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineAgencyPlanNameOption { get; private set; } + [DataMember(Name = "airline.agency_invoice_number", EmitDefaultValue = false)] + public string AirlineAgencyInvoiceNumber { get; set; } /// /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters /// /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters - [JsonPropertyName("airline.agency_plan_name")] - public string AirlineAgencyPlanName { get { return this.AirlineAgencyPlanNameOption; } set { this.AirlineAgencyPlanNameOption = new Option(value); } } - - /// - /// Used to track the state of AirlineAirlineCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineAirlineCodeOption { get; private set; } + [DataMember(Name = "airline.agency_plan_name", EmitDefaultValue = false)] + public string AirlineAgencyPlanName { get; set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. - [JsonPropertyName("airline.airline_code")] - public string AirlineAirlineCode { get { return this.AirlineAirlineCodeOption; } set { this.AirlineAirlineCodeOption = new Option(value); } } - - /// - /// Used to track the state of AirlineAirlineDesignatorCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineAirlineDesignatorCodeOption { get; private set; } + [DataMember(Name = "airline.airline_code", EmitDefaultValue = false)] + public string AirlineAirlineCode { get; set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros. - [JsonPropertyName("airline.airline_designator_code")] - public string AirlineAirlineDesignatorCode { get { return this.AirlineAirlineDesignatorCodeOption; } set { this.AirlineAirlineDesignatorCodeOption = new Option(value); } } - - /// - /// Used to track the state of AirlineBoardingFee - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineBoardingFeeOption { get; private set; } + [DataMember(Name = "airline.airline_designator_code", EmitDefaultValue = false)] + public string AirlineAirlineDesignatorCode { get; set; } /// /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters /// /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters - [JsonPropertyName("airline.boarding_fee")] - public string AirlineBoardingFee { get { return this.AirlineBoardingFeeOption; } set { this.AirlineBoardingFeeOption = new Option(value); } } - - /// - /// Used to track the state of AirlineComputerizedReservationSystem - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineComputerizedReservationSystemOption { get; private set; } + [DataMember(Name = "airline.boarding_fee", EmitDefaultValue = false)] + public string AirlineBoardingFee { get; set; } /// /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters /// /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters - [JsonPropertyName("airline.computerized_reservation_system")] - public string AirlineComputerizedReservationSystem { get { return this.AirlineComputerizedReservationSystemOption; } set { this.AirlineComputerizedReservationSystemOption = new Option(value); } } - - /// - /// Used to track the state of AirlineCustomerReferenceNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineCustomerReferenceNumberOption { get; private set; } + [DataMember(Name = "airline.computerized_reservation_system", EmitDefaultValue = false)] + public string AirlineComputerizedReservationSystem { get; set; } /// /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces /// /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces - [JsonPropertyName("airline.customer_reference_number")] - public string AirlineCustomerReferenceNumber { get { return this.AirlineCustomerReferenceNumberOption; } set { this.AirlineCustomerReferenceNumberOption = new Option(value); } } - - /// - /// Used to track the state of AirlineDocumentType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineDocumentTypeOption { get; private set; } + [DataMember(Name = "airline.customer_reference_number", EmitDefaultValue = false)] + public string AirlineCustomerReferenceNumber { get; set; } /// /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters /// /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters - [JsonPropertyName("airline.document_type")] - public string AirlineDocumentType { get { return this.AirlineDocumentTypeOption; } set { this.AirlineDocumentTypeOption = new Option(value); } } - - /// - /// Used to track the state of AirlineFlightDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineFlightDateOption { get; private set; } + [DataMember(Name = "airline.document_type", EmitDefaultValue = false)] + public string AirlineDocumentType { get; set; } /// /// The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters /// /// The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters - [JsonPropertyName("airline.flight_date")] - public string AirlineFlightDate { get { return this.AirlineFlightDateOption; } set { this.AirlineFlightDateOption = new Option(value); } } - - /// - /// Used to track the state of AirlineIssueDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineIssueDateOption { get; private set; } + [DataMember(Name = "airline.flight_date", EmitDefaultValue = false)] + public string AirlineFlightDate { get; set; } /// /// The date that the ticket was issued to the passenger. * minLength: 6 characters * maxLength: 6 characters * Date format: YYMMDD /// /// The date that the ticket was issued to the passenger. * minLength: 6 characters * maxLength: 6 characters * Date format: YYMMDD - [JsonPropertyName("airline.issue_date")] - public string AirlineIssueDate { get { return this.AirlineIssueDateOption; } set { this.AirlineIssueDateOption = new Option(value); } } - - /// - /// Used to track the state of AirlineLegCarrierCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineLegCarrierCodeOption { get; private set; } + [DataMember(Name = "airline.issue_date", EmitDefaultValue = false)] + public string AirlineIssueDate { get; set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros. - [JsonPropertyName("airline.leg.carrier_code")] - public string AirlineLegCarrierCode { get { return this.AirlineLegCarrierCodeOption; } set { this.AirlineLegCarrierCodeOption = new Option(value); } } - - /// - /// Used to track the state of AirlineLegClassOfTravel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineLegClassOfTravelOption { get; private set; } + [DataMember(Name = "airline.leg.carrier_code", EmitDefaultValue = false)] + public string AirlineLegCarrierCode { get; set; } /// /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros. /// /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros. - [JsonPropertyName("airline.leg.class_of_travel")] - public string AirlineLegClassOfTravel { get { return this.AirlineLegClassOfTravelOption; } set { this.AirlineLegClassOfTravelOption = new Option(value); } } - - /// - /// Used to track the state of AirlineLegDateOfTravel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineLegDateOfTravelOption { get; private set; } + [DataMember(Name = "airline.leg.class_of_travel", EmitDefaultValue = false)] + public string AirlineLegClassOfTravel { get; set; } /// /// Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters /// /// Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters - [JsonPropertyName("airline.leg.date_of_travel")] - public string AirlineLegDateOfTravel { get { return this.AirlineLegDateOfTravelOption; } set { this.AirlineLegDateOfTravelOption = new Option(value); } } - - /// - /// Used to track the state of AirlineLegDepartAirport - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineLegDepartAirportOption { get; private set; } + [DataMember(Name = "airline.leg.date_of_travel", EmitDefaultValue = false)] + public string AirlineLegDateOfTravel { get; set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. - [JsonPropertyName("airline.leg.depart_airport")] - public string AirlineLegDepartAirport { get { return this.AirlineLegDepartAirportOption; } set { this.AirlineLegDepartAirportOption = new Option(value); } } - - /// - /// Used to track the state of AirlineLegDepartTax - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineLegDepartTaxOption { get; private set; } + [DataMember(Name = "airline.leg.depart_airport", EmitDefaultValue = false)] + public string AirlineLegDepartAirport { get; set; } /// /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros. /// /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros. - [JsonPropertyName("airline.leg.depart_tax")] - public string AirlineLegDepartTax { get { return this.AirlineLegDepartTaxOption; } set { this.AirlineLegDepartTaxOption = new Option(value); } } - - /// - /// Used to track the state of AirlineLegDestinationCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineLegDestinationCodeOption { get; private set; } + [DataMember(Name = "airline.leg.depart_tax", EmitDefaultValue = false)] + public string AirlineLegDepartTax { get; set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros. - [JsonPropertyName("airline.leg.destination_code")] - public string AirlineLegDestinationCode { get { return this.AirlineLegDestinationCodeOption; } set { this.AirlineLegDestinationCodeOption = new Option(value); } } - - /// - /// Used to track the state of AirlineLegFareBaseCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineLegFareBaseCodeOption { get; private set; } + [DataMember(Name = "airline.leg.destination_code", EmitDefaultValue = false)] + public string AirlineLegDestinationCode { get; set; } /// /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros. /// /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros. - [JsonPropertyName("airline.leg.fare_base_code")] - public string AirlineLegFareBaseCode { get { return this.AirlineLegFareBaseCodeOption; } set { this.AirlineLegFareBaseCodeOption = new Option(value); } } - - /// - /// Used to track the state of AirlineLegFlightNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineLegFlightNumberOption { get; private set; } + [DataMember(Name = "airline.leg.fare_base_code", EmitDefaultValue = false)] + public string AirlineLegFareBaseCode { get; set; } /// /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros. /// /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros. - [JsonPropertyName("airline.leg.flight_number")] - public string AirlineLegFlightNumber { get { return this.AirlineLegFlightNumberOption; } set { this.AirlineLegFlightNumberOption = new Option(value); } } - - /// - /// Used to track the state of AirlineLegStopOverCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineLegStopOverCodeOption { get; private set; } + [DataMember(Name = "airline.leg.flight_number", EmitDefaultValue = false)] + public string AirlineLegFlightNumber { get; set; } /// /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character /// /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character - [JsonPropertyName("airline.leg.stop_over_code")] - public string AirlineLegStopOverCode { get { return this.AirlineLegStopOverCodeOption; } set { this.AirlineLegStopOverCodeOption = new Option(value); } } - - /// - /// Used to track the state of AirlinePassengerDateOfBirth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlinePassengerDateOfBirthOption { get; private set; } + [DataMember(Name = "airline.leg.stop_over_code", EmitDefaultValue = false)] + public string AirlineLegStopOverCode { get; set; } /// /// The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 /// /// The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 - [JsonPropertyName("airline.passenger.date_of_birth")] - public string AirlinePassengerDateOfBirth { get { return this.AirlinePassengerDateOfBirthOption; } set { this.AirlinePassengerDateOfBirthOption = new Option(value); } } - - /// - /// Used to track the state of AirlinePassengerFirstName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlinePassengerFirstNameOption { get; private set; } + [DataMember(Name = "airline.passenger.date_of_birth", EmitDefaultValue = false)] + public string AirlinePassengerDateOfBirth { get; set; } /// /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII /// /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII - [JsonPropertyName("airline.passenger.first_name")] - public string AirlinePassengerFirstName { get { return this.AirlinePassengerFirstNameOption; } set { this.AirlinePassengerFirstNameOption = new Option(value); } } - - /// - /// Used to track the state of AirlinePassengerLastName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlinePassengerLastNameOption { get; private set; } + [DataMember(Name = "airline.passenger.first_name", EmitDefaultValue = false)] + public string AirlinePassengerFirstName { get; set; } /// /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII /// /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII - [JsonPropertyName("airline.passenger.last_name")] - public string AirlinePassengerLastName { get { return this.AirlinePassengerLastNameOption; } set { this.AirlinePassengerLastNameOption = new Option(value); } } - - /// - /// Used to track the state of AirlinePassengerPhoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlinePassengerPhoneNumberOption { get; private set; } + [DataMember(Name = "airline.passenger.last_name", EmitDefaultValue = false)] + public string AirlinePassengerLastName { get; set; } /// /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters /// /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters - [JsonPropertyName("airline.passenger.phone_number")] - public string AirlinePassengerPhoneNumber { get { return this.AirlinePassengerPhoneNumberOption; } set { this.AirlinePassengerPhoneNumberOption = new Option(value); } } - - /// - /// Used to track the state of AirlinePassengerTravellerType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlinePassengerTravellerTypeOption { get; private set; } + [DataMember(Name = "airline.passenger.phone_number", EmitDefaultValue = false)] + public string AirlinePassengerPhoneNumber { get; set; } /// /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters /// /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters - [JsonPropertyName("airline.passenger.traveller_type")] - public string AirlinePassengerTravellerType { get { return this.AirlinePassengerTravellerTypeOption; } set { this.AirlinePassengerTravellerTypeOption = new Option(value); } } + [DataMember(Name = "airline.passenger.traveller_type", EmitDefaultValue = false)] + public string AirlinePassengerTravellerType { get; set; } /// - /// Used to track the state of AirlineTicketIssueAddress + /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineTicketIssueAddressOption { get; private set; } + /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros. + [DataMember(Name = "airline.passenger_name", IsRequired = false, EmitDefaultValue = false)] + public string AirlinePassengerName { get; set; } /// /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters /// /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters - [JsonPropertyName("airline.ticket_issue_address")] - public string AirlineTicketIssueAddress { get { return this.AirlineTicketIssueAddressOption; } set { this.AirlineTicketIssueAddressOption = new Option(value); } } - - /// - /// Used to track the state of AirlineTicketNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineTicketNumberOption { get; private set; } + [DataMember(Name = "airline.ticket_issue_address", EmitDefaultValue = false)] + public string AirlineTicketIssueAddress { get; set; } /// /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros. /// /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros. - [JsonPropertyName("airline.ticket_number")] - public string AirlineTicketNumber { get { return this.AirlineTicketNumberOption; } set { this.AirlineTicketNumberOption = new Option(value); } } - - /// - /// Used to track the state of AirlineTravelAgencyCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineTravelAgencyCodeOption { get; private set; } + [DataMember(Name = "airline.ticket_number", EmitDefaultValue = false)] + public string AirlineTicketNumber { get; set; } /// /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros. /// /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros. - [JsonPropertyName("airline.travel_agency_code")] - public string AirlineTravelAgencyCode { get { return this.AirlineTravelAgencyCodeOption; } set { this.AirlineTravelAgencyCodeOption = new Option(value); } } - - /// - /// Used to track the state of AirlineTravelAgencyName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineTravelAgencyNameOption { get; private set; } + [DataMember(Name = "airline.travel_agency_code", EmitDefaultValue = false)] + public string AirlineTravelAgencyCode { get; set; } /// /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros. /// /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros. - [JsonPropertyName("airline.travel_agency_name")] - public string AirlineTravelAgencyName { get { return this.AirlineTravelAgencyNameOption; } set { this.AirlineTravelAgencyNameOption = new Option(value); } } + [DataMember(Name = "airline.travel_agency_name", EmitDefaultValue = false)] + public string AirlineTravelAgencyName { get; set; } /// /// Returns the string presentation of the object @@ -504,7 +313,6 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class AdditionalDataAirline {\n"); - sb.Append(" AirlinePassengerName: ").Append(AirlinePassengerName).Append("\n"); sb.Append(" AirlineAgencyInvoiceNumber: ").Append(AirlineAgencyInvoiceNumber).Append("\n"); sb.Append(" AirlineAgencyPlanName: ").Append(AirlineAgencyPlanName).Append("\n"); sb.Append(" AirlineAirlineCode: ").Append(AirlineAirlineCode).Append("\n"); @@ -529,6 +337,7 @@ public override string ToString() sb.Append(" AirlinePassengerLastName: ").Append(AirlinePassengerLastName).Append("\n"); sb.Append(" AirlinePassengerPhoneNumber: ").Append(AirlinePassengerPhoneNumber).Append("\n"); sb.Append(" AirlinePassengerTravellerType: ").Append(AirlinePassengerTravellerType).Append("\n"); + sb.Append(" AirlinePassengerName: ").Append(AirlinePassengerName).Append("\n"); sb.Append(" AirlineTicketIssueAddress: ").Append(AirlineTicketIssueAddress).Append("\n"); sb.Append(" AirlineTicketNumber: ").Append(AirlineTicketNumber).Append("\n"); sb.Append(" AirlineTravelAgencyCode: ").Append(AirlineTravelAgencyCode).Append("\n"); @@ -538,465 +347,320 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataAirlineJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataAirline Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option airlinePassengerName = default; - Option airlineAgencyInvoiceNumber = default; - Option airlineAgencyPlanName = default; - Option airlineAirlineCode = default; - Option airlineAirlineDesignatorCode = default; - Option airlineBoardingFee = default; - Option airlineComputerizedReservationSystem = default; - Option airlineCustomerReferenceNumber = default; - Option airlineDocumentType = default; - Option airlineFlightDate = default; - Option airlineIssueDate = default; - Option airlineLegCarrierCode = default; - Option airlineLegClassOfTravel = default; - Option airlineLegDateOfTravel = default; - Option airlineLegDepartAirport = default; - Option airlineLegDepartTax = default; - Option airlineLegDestinationCode = default; - Option airlineLegFareBaseCode = default; - Option airlineLegFlightNumber = default; - Option airlineLegStopOverCode = default; - Option airlinePassengerDateOfBirth = default; - Option airlinePassengerFirstName = default; - Option airlinePassengerLastName = default; - Option airlinePassengerPhoneNumber = default; - Option airlinePassengerTravellerType = default; - Option airlineTicketIssueAddress = default; - Option airlineTicketNumber = default; - Option airlineTravelAgencyCode = default; - Option airlineTravelAgencyName = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; + return this.Equals(input as AdditionalDataAirline); + } - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "airline.passenger_name": - airlinePassengerName = new Option(utf8JsonReader.GetString()); - break; - case "airline.agency_invoice_number": - airlineAgencyInvoiceNumber = new Option(utf8JsonReader.GetString()); - break; - case "airline.agency_plan_name": - airlineAgencyPlanName = new Option(utf8JsonReader.GetString()); - break; - case "airline.airline_code": - airlineAirlineCode = new Option(utf8JsonReader.GetString()); - break; - case "airline.airline_designator_code": - airlineAirlineDesignatorCode = new Option(utf8JsonReader.GetString()); - break; - case "airline.boarding_fee": - airlineBoardingFee = new Option(utf8JsonReader.GetString()); - break; - case "airline.computerized_reservation_system": - airlineComputerizedReservationSystem = new Option(utf8JsonReader.GetString()); - break; - case "airline.customer_reference_number": - airlineCustomerReferenceNumber = new Option(utf8JsonReader.GetString()); - break; - case "airline.document_type": - airlineDocumentType = new Option(utf8JsonReader.GetString()); - break; - case "airline.flight_date": - airlineFlightDate = new Option(utf8JsonReader.GetString()); - break; - case "airline.issue_date": - airlineIssueDate = new Option(utf8JsonReader.GetString()); - break; - case "airline.leg.carrier_code": - airlineLegCarrierCode = new Option(utf8JsonReader.GetString()); - break; - case "airline.leg.class_of_travel": - airlineLegClassOfTravel = new Option(utf8JsonReader.GetString()); - break; - case "airline.leg.date_of_travel": - airlineLegDateOfTravel = new Option(utf8JsonReader.GetString()); - break; - case "airline.leg.depart_airport": - airlineLegDepartAirport = new Option(utf8JsonReader.GetString()); - break; - case "airline.leg.depart_tax": - airlineLegDepartTax = new Option(utf8JsonReader.GetString()); - break; - case "airline.leg.destination_code": - airlineLegDestinationCode = new Option(utf8JsonReader.GetString()); - break; - case "airline.leg.fare_base_code": - airlineLegFareBaseCode = new Option(utf8JsonReader.GetString()); - break; - case "airline.leg.flight_number": - airlineLegFlightNumber = new Option(utf8JsonReader.GetString()); - break; - case "airline.leg.stop_over_code": - airlineLegStopOverCode = new Option(utf8JsonReader.GetString()); - break; - case "airline.passenger.date_of_birth": - airlinePassengerDateOfBirth = new Option(utf8JsonReader.GetString()); - break; - case "airline.passenger.first_name": - airlinePassengerFirstName = new Option(utf8JsonReader.GetString()); - break; - case "airline.passenger.last_name": - airlinePassengerLastName = new Option(utf8JsonReader.GetString()); - break; - case "airline.passenger.phone_number": - airlinePassengerPhoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "airline.passenger.traveller_type": - airlinePassengerTravellerType = new Option(utf8JsonReader.GetString()); - break; - case "airline.ticket_issue_address": - airlineTicketIssueAddress = new Option(utf8JsonReader.GetString()); - break; - case "airline.ticket_number": - airlineTicketNumber = new Option(utf8JsonReader.GetString()); - break; - case "airline.travel_agency_code": - airlineTravelAgencyCode = new Option(utf8JsonReader.GetString()); - break; - case "airline.travel_agency_name": - airlineTravelAgencyName = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + /// + /// Returns true if AdditionalDataAirline instances are equal + /// + /// Instance of AdditionalDataAirline to be compared + /// Boolean + public bool Equals(AdditionalDataAirline input) + { + if (input == null) + { + return false; } - - if (!airlinePassengerName.IsSet) - throw new ArgumentException("Property is required for class AdditionalDataAirline.", nameof(airlinePassengerName)); - - if (airlinePassengerName.IsSet && airlinePassengerName.Value == null) - throw new ArgumentNullException(nameof(airlinePassengerName), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineAgencyInvoiceNumber.IsSet && airlineAgencyInvoiceNumber.Value == null) - throw new ArgumentNullException(nameof(airlineAgencyInvoiceNumber), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineAgencyPlanName.IsSet && airlineAgencyPlanName.Value == null) - throw new ArgumentNullException(nameof(airlineAgencyPlanName), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineAirlineCode.IsSet && airlineAirlineCode.Value == null) - throw new ArgumentNullException(nameof(airlineAirlineCode), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineAirlineDesignatorCode.IsSet && airlineAirlineDesignatorCode.Value == null) - throw new ArgumentNullException(nameof(airlineAirlineDesignatorCode), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineBoardingFee.IsSet && airlineBoardingFee.Value == null) - throw new ArgumentNullException(nameof(airlineBoardingFee), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineComputerizedReservationSystem.IsSet && airlineComputerizedReservationSystem.Value == null) - throw new ArgumentNullException(nameof(airlineComputerizedReservationSystem), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineCustomerReferenceNumber.IsSet && airlineCustomerReferenceNumber.Value == null) - throw new ArgumentNullException(nameof(airlineCustomerReferenceNumber), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineDocumentType.IsSet && airlineDocumentType.Value == null) - throw new ArgumentNullException(nameof(airlineDocumentType), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineFlightDate.IsSet && airlineFlightDate.Value == null) - throw new ArgumentNullException(nameof(airlineFlightDate), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineIssueDate.IsSet && airlineIssueDate.Value == null) - throw new ArgumentNullException(nameof(airlineIssueDate), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineLegCarrierCode.IsSet && airlineLegCarrierCode.Value == null) - throw new ArgumentNullException(nameof(airlineLegCarrierCode), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineLegClassOfTravel.IsSet && airlineLegClassOfTravel.Value == null) - throw new ArgumentNullException(nameof(airlineLegClassOfTravel), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineLegDateOfTravel.IsSet && airlineLegDateOfTravel.Value == null) - throw new ArgumentNullException(nameof(airlineLegDateOfTravel), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineLegDepartAirport.IsSet && airlineLegDepartAirport.Value == null) - throw new ArgumentNullException(nameof(airlineLegDepartAirport), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineLegDepartTax.IsSet && airlineLegDepartTax.Value == null) - throw new ArgumentNullException(nameof(airlineLegDepartTax), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineLegDestinationCode.IsSet && airlineLegDestinationCode.Value == null) - throw new ArgumentNullException(nameof(airlineLegDestinationCode), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineLegFareBaseCode.IsSet && airlineLegFareBaseCode.Value == null) - throw new ArgumentNullException(nameof(airlineLegFareBaseCode), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineLegFlightNumber.IsSet && airlineLegFlightNumber.Value == null) - throw new ArgumentNullException(nameof(airlineLegFlightNumber), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineLegStopOverCode.IsSet && airlineLegStopOverCode.Value == null) - throw new ArgumentNullException(nameof(airlineLegStopOverCode), "Property is not nullable for class AdditionalDataAirline."); - - if (airlinePassengerDateOfBirth.IsSet && airlinePassengerDateOfBirth.Value == null) - throw new ArgumentNullException(nameof(airlinePassengerDateOfBirth), "Property is not nullable for class AdditionalDataAirline."); - - if (airlinePassengerFirstName.IsSet && airlinePassengerFirstName.Value == null) - throw new ArgumentNullException(nameof(airlinePassengerFirstName), "Property is not nullable for class AdditionalDataAirline."); - - if (airlinePassengerLastName.IsSet && airlinePassengerLastName.Value == null) - throw new ArgumentNullException(nameof(airlinePassengerLastName), "Property is not nullable for class AdditionalDataAirline."); - - if (airlinePassengerPhoneNumber.IsSet && airlinePassengerPhoneNumber.Value == null) - throw new ArgumentNullException(nameof(airlinePassengerPhoneNumber), "Property is not nullable for class AdditionalDataAirline."); - - if (airlinePassengerTravellerType.IsSet && airlinePassengerTravellerType.Value == null) - throw new ArgumentNullException(nameof(airlinePassengerTravellerType), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineTicketIssueAddress.IsSet && airlineTicketIssueAddress.Value == null) - throw new ArgumentNullException(nameof(airlineTicketIssueAddress), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineTicketNumber.IsSet && airlineTicketNumber.Value == null) - throw new ArgumentNullException(nameof(airlineTicketNumber), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineTravelAgencyCode.IsSet && airlineTravelAgencyCode.Value == null) - throw new ArgumentNullException(nameof(airlineTravelAgencyCode), "Property is not nullable for class AdditionalDataAirline."); - - if (airlineTravelAgencyName.IsSet && airlineTravelAgencyName.Value == null) - throw new ArgumentNullException(nameof(airlineTravelAgencyName), "Property is not nullable for class AdditionalDataAirline."); - - return new AdditionalDataAirline(airlinePassengerName.Value, airlineAgencyInvoiceNumber, airlineAgencyPlanName, airlineAirlineCode, airlineAirlineDesignatorCode, airlineBoardingFee, airlineComputerizedReservationSystem, airlineCustomerReferenceNumber, airlineDocumentType, airlineFlightDate, airlineIssueDate, airlineLegCarrierCode, airlineLegClassOfTravel, airlineLegDateOfTravel, airlineLegDepartAirport, airlineLegDepartTax, airlineLegDestinationCode, airlineLegFareBaseCode, airlineLegFlightNumber, airlineLegStopOverCode, airlinePassengerDateOfBirth, airlinePassengerFirstName, airlinePassengerLastName, airlinePassengerPhoneNumber, airlinePassengerTravellerType, airlineTicketIssueAddress, airlineTicketNumber, airlineTravelAgencyCode, airlineTravelAgencyName); + return + ( + this.AirlineAgencyInvoiceNumber == input.AirlineAgencyInvoiceNumber || + (this.AirlineAgencyInvoiceNumber != null && + this.AirlineAgencyInvoiceNumber.Equals(input.AirlineAgencyInvoiceNumber)) + ) && + ( + this.AirlineAgencyPlanName == input.AirlineAgencyPlanName || + (this.AirlineAgencyPlanName != null && + this.AirlineAgencyPlanName.Equals(input.AirlineAgencyPlanName)) + ) && + ( + this.AirlineAirlineCode == input.AirlineAirlineCode || + (this.AirlineAirlineCode != null && + this.AirlineAirlineCode.Equals(input.AirlineAirlineCode)) + ) && + ( + this.AirlineAirlineDesignatorCode == input.AirlineAirlineDesignatorCode || + (this.AirlineAirlineDesignatorCode != null && + this.AirlineAirlineDesignatorCode.Equals(input.AirlineAirlineDesignatorCode)) + ) && + ( + this.AirlineBoardingFee == input.AirlineBoardingFee || + (this.AirlineBoardingFee != null && + this.AirlineBoardingFee.Equals(input.AirlineBoardingFee)) + ) && + ( + this.AirlineComputerizedReservationSystem == input.AirlineComputerizedReservationSystem || + (this.AirlineComputerizedReservationSystem != null && + this.AirlineComputerizedReservationSystem.Equals(input.AirlineComputerizedReservationSystem)) + ) && + ( + this.AirlineCustomerReferenceNumber == input.AirlineCustomerReferenceNumber || + (this.AirlineCustomerReferenceNumber != null && + this.AirlineCustomerReferenceNumber.Equals(input.AirlineCustomerReferenceNumber)) + ) && + ( + this.AirlineDocumentType == input.AirlineDocumentType || + (this.AirlineDocumentType != null && + this.AirlineDocumentType.Equals(input.AirlineDocumentType)) + ) && + ( + this.AirlineFlightDate == input.AirlineFlightDate || + (this.AirlineFlightDate != null && + this.AirlineFlightDate.Equals(input.AirlineFlightDate)) + ) && + ( + this.AirlineIssueDate == input.AirlineIssueDate || + (this.AirlineIssueDate != null && + this.AirlineIssueDate.Equals(input.AirlineIssueDate)) + ) && + ( + this.AirlineLegCarrierCode == input.AirlineLegCarrierCode || + (this.AirlineLegCarrierCode != null && + this.AirlineLegCarrierCode.Equals(input.AirlineLegCarrierCode)) + ) && + ( + this.AirlineLegClassOfTravel == input.AirlineLegClassOfTravel || + (this.AirlineLegClassOfTravel != null && + this.AirlineLegClassOfTravel.Equals(input.AirlineLegClassOfTravel)) + ) && + ( + this.AirlineLegDateOfTravel == input.AirlineLegDateOfTravel || + (this.AirlineLegDateOfTravel != null && + this.AirlineLegDateOfTravel.Equals(input.AirlineLegDateOfTravel)) + ) && + ( + this.AirlineLegDepartAirport == input.AirlineLegDepartAirport || + (this.AirlineLegDepartAirport != null && + this.AirlineLegDepartAirport.Equals(input.AirlineLegDepartAirport)) + ) && + ( + this.AirlineLegDepartTax == input.AirlineLegDepartTax || + (this.AirlineLegDepartTax != null && + this.AirlineLegDepartTax.Equals(input.AirlineLegDepartTax)) + ) && + ( + this.AirlineLegDestinationCode == input.AirlineLegDestinationCode || + (this.AirlineLegDestinationCode != null && + this.AirlineLegDestinationCode.Equals(input.AirlineLegDestinationCode)) + ) && + ( + this.AirlineLegFareBaseCode == input.AirlineLegFareBaseCode || + (this.AirlineLegFareBaseCode != null && + this.AirlineLegFareBaseCode.Equals(input.AirlineLegFareBaseCode)) + ) && + ( + this.AirlineLegFlightNumber == input.AirlineLegFlightNumber || + (this.AirlineLegFlightNumber != null && + this.AirlineLegFlightNumber.Equals(input.AirlineLegFlightNumber)) + ) && + ( + this.AirlineLegStopOverCode == input.AirlineLegStopOverCode || + (this.AirlineLegStopOverCode != null && + this.AirlineLegStopOverCode.Equals(input.AirlineLegStopOverCode)) + ) && + ( + this.AirlinePassengerDateOfBirth == input.AirlinePassengerDateOfBirth || + (this.AirlinePassengerDateOfBirth != null && + this.AirlinePassengerDateOfBirth.Equals(input.AirlinePassengerDateOfBirth)) + ) && + ( + this.AirlinePassengerFirstName == input.AirlinePassengerFirstName || + (this.AirlinePassengerFirstName != null && + this.AirlinePassengerFirstName.Equals(input.AirlinePassengerFirstName)) + ) && + ( + this.AirlinePassengerLastName == input.AirlinePassengerLastName || + (this.AirlinePassengerLastName != null && + this.AirlinePassengerLastName.Equals(input.AirlinePassengerLastName)) + ) && + ( + this.AirlinePassengerPhoneNumber == input.AirlinePassengerPhoneNumber || + (this.AirlinePassengerPhoneNumber != null && + this.AirlinePassengerPhoneNumber.Equals(input.AirlinePassengerPhoneNumber)) + ) && + ( + this.AirlinePassengerTravellerType == input.AirlinePassengerTravellerType || + (this.AirlinePassengerTravellerType != null && + this.AirlinePassengerTravellerType.Equals(input.AirlinePassengerTravellerType)) + ) && + ( + this.AirlinePassengerName == input.AirlinePassengerName || + (this.AirlinePassengerName != null && + this.AirlinePassengerName.Equals(input.AirlinePassengerName)) + ) && + ( + this.AirlineTicketIssueAddress == input.AirlineTicketIssueAddress || + (this.AirlineTicketIssueAddress != null && + this.AirlineTicketIssueAddress.Equals(input.AirlineTicketIssueAddress)) + ) && + ( + this.AirlineTicketNumber == input.AirlineTicketNumber || + (this.AirlineTicketNumber != null && + this.AirlineTicketNumber.Equals(input.AirlineTicketNumber)) + ) && + ( + this.AirlineTravelAgencyCode == input.AirlineTravelAgencyCode || + (this.AirlineTravelAgencyCode != null && + this.AirlineTravelAgencyCode.Equals(input.AirlineTravelAgencyCode)) + ) && + ( + this.AirlineTravelAgencyName == input.AirlineTravelAgencyName || + (this.AirlineTravelAgencyName != null && + this.AirlineTravelAgencyName.Equals(input.AirlineTravelAgencyName)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataAirline additionalDataAirline, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataAirline, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AirlineAgencyInvoiceNumber != null) + { + hashCode = (hashCode * 59) + this.AirlineAgencyInvoiceNumber.GetHashCode(); + } + if (this.AirlineAgencyPlanName != null) + { + hashCode = (hashCode * 59) + this.AirlineAgencyPlanName.GetHashCode(); + } + if (this.AirlineAirlineCode != null) + { + hashCode = (hashCode * 59) + this.AirlineAirlineCode.GetHashCode(); + } + if (this.AirlineAirlineDesignatorCode != null) + { + hashCode = (hashCode * 59) + this.AirlineAirlineDesignatorCode.GetHashCode(); + } + if (this.AirlineBoardingFee != null) + { + hashCode = (hashCode * 59) + this.AirlineBoardingFee.GetHashCode(); + } + if (this.AirlineComputerizedReservationSystem != null) + { + hashCode = (hashCode * 59) + this.AirlineComputerizedReservationSystem.GetHashCode(); + } + if (this.AirlineCustomerReferenceNumber != null) + { + hashCode = (hashCode * 59) + this.AirlineCustomerReferenceNumber.GetHashCode(); + } + if (this.AirlineDocumentType != null) + { + hashCode = (hashCode * 59) + this.AirlineDocumentType.GetHashCode(); + } + if (this.AirlineFlightDate != null) + { + hashCode = (hashCode * 59) + this.AirlineFlightDate.GetHashCode(); + } + if (this.AirlineIssueDate != null) + { + hashCode = (hashCode * 59) + this.AirlineIssueDate.GetHashCode(); + } + if (this.AirlineLegCarrierCode != null) + { + hashCode = (hashCode * 59) + this.AirlineLegCarrierCode.GetHashCode(); + } + if (this.AirlineLegClassOfTravel != null) + { + hashCode = (hashCode * 59) + this.AirlineLegClassOfTravel.GetHashCode(); + } + if (this.AirlineLegDateOfTravel != null) + { + hashCode = (hashCode * 59) + this.AirlineLegDateOfTravel.GetHashCode(); + } + if (this.AirlineLegDepartAirport != null) + { + hashCode = (hashCode * 59) + this.AirlineLegDepartAirport.GetHashCode(); + } + if (this.AirlineLegDepartTax != null) + { + hashCode = (hashCode * 59) + this.AirlineLegDepartTax.GetHashCode(); + } + if (this.AirlineLegDestinationCode != null) + { + hashCode = (hashCode * 59) + this.AirlineLegDestinationCode.GetHashCode(); + } + if (this.AirlineLegFareBaseCode != null) + { + hashCode = (hashCode * 59) + this.AirlineLegFareBaseCode.GetHashCode(); + } + if (this.AirlineLegFlightNumber != null) + { + hashCode = (hashCode * 59) + this.AirlineLegFlightNumber.GetHashCode(); + } + if (this.AirlineLegStopOverCode != null) + { + hashCode = (hashCode * 59) + this.AirlineLegStopOverCode.GetHashCode(); + } + if (this.AirlinePassengerDateOfBirth != null) + { + hashCode = (hashCode * 59) + this.AirlinePassengerDateOfBirth.GetHashCode(); + } + if (this.AirlinePassengerFirstName != null) + { + hashCode = (hashCode * 59) + this.AirlinePassengerFirstName.GetHashCode(); + } + if (this.AirlinePassengerLastName != null) + { + hashCode = (hashCode * 59) + this.AirlinePassengerLastName.GetHashCode(); + } + if (this.AirlinePassengerPhoneNumber != null) + { + hashCode = (hashCode * 59) + this.AirlinePassengerPhoneNumber.GetHashCode(); + } + if (this.AirlinePassengerTravellerType != null) + { + hashCode = (hashCode * 59) + this.AirlinePassengerTravellerType.GetHashCode(); + } + if (this.AirlinePassengerName != null) + { + hashCode = (hashCode * 59) + this.AirlinePassengerName.GetHashCode(); + } + if (this.AirlineTicketIssueAddress != null) + { + hashCode = (hashCode * 59) + this.AirlineTicketIssueAddress.GetHashCode(); + } + if (this.AirlineTicketNumber != null) + { + hashCode = (hashCode * 59) + this.AirlineTicketNumber.GetHashCode(); + } + if (this.AirlineTravelAgencyCode != null) + { + hashCode = (hashCode * 59) + this.AirlineTravelAgencyCode.GetHashCode(); + } + if (this.AirlineTravelAgencyName != null) + { + hashCode = (hashCode * 59) + this.AirlineTravelAgencyName.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataAirline additionalDataAirline, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataAirline.AirlinePassengerName == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlinePassengerName), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineAgencyInvoiceNumberOption.IsSet && additionalDataAirline.AirlineAgencyInvoiceNumber == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineAgencyInvoiceNumber), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineAgencyPlanNameOption.IsSet && additionalDataAirline.AirlineAgencyPlanName == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineAgencyPlanName), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineAirlineCodeOption.IsSet && additionalDataAirline.AirlineAirlineCode == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineAirlineCode), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineAirlineDesignatorCodeOption.IsSet && additionalDataAirline.AirlineAirlineDesignatorCode == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineAirlineDesignatorCode), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineBoardingFeeOption.IsSet && additionalDataAirline.AirlineBoardingFee == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineBoardingFee), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineComputerizedReservationSystemOption.IsSet && additionalDataAirline.AirlineComputerizedReservationSystem == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineComputerizedReservationSystem), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineCustomerReferenceNumberOption.IsSet && additionalDataAirline.AirlineCustomerReferenceNumber == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineCustomerReferenceNumber), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineDocumentTypeOption.IsSet && additionalDataAirline.AirlineDocumentType == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineDocumentType), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineFlightDateOption.IsSet && additionalDataAirline.AirlineFlightDate == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineFlightDate), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineIssueDateOption.IsSet && additionalDataAirline.AirlineIssueDate == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineIssueDate), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineLegCarrierCodeOption.IsSet && additionalDataAirline.AirlineLegCarrierCode == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegCarrierCode), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineLegClassOfTravelOption.IsSet && additionalDataAirline.AirlineLegClassOfTravel == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegClassOfTravel), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineLegDateOfTravelOption.IsSet && additionalDataAirline.AirlineLegDateOfTravel == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegDateOfTravel), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineLegDepartAirportOption.IsSet && additionalDataAirline.AirlineLegDepartAirport == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegDepartAirport), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineLegDepartTaxOption.IsSet && additionalDataAirline.AirlineLegDepartTax == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegDepartTax), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineLegDestinationCodeOption.IsSet && additionalDataAirline.AirlineLegDestinationCode == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegDestinationCode), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineLegFareBaseCodeOption.IsSet && additionalDataAirline.AirlineLegFareBaseCode == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegFareBaseCode), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineLegFlightNumberOption.IsSet && additionalDataAirline.AirlineLegFlightNumber == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegFlightNumber), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineLegStopOverCodeOption.IsSet && additionalDataAirline.AirlineLegStopOverCode == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineLegStopOverCode), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlinePassengerDateOfBirthOption.IsSet && additionalDataAirline.AirlinePassengerDateOfBirth == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlinePassengerDateOfBirth), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlinePassengerFirstNameOption.IsSet && additionalDataAirline.AirlinePassengerFirstName == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlinePassengerFirstName), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlinePassengerLastNameOption.IsSet && additionalDataAirline.AirlinePassengerLastName == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlinePassengerLastName), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlinePassengerPhoneNumberOption.IsSet && additionalDataAirline.AirlinePassengerPhoneNumber == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlinePassengerPhoneNumber), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlinePassengerTravellerTypeOption.IsSet && additionalDataAirline.AirlinePassengerTravellerType == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlinePassengerTravellerType), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineTicketIssueAddressOption.IsSet && additionalDataAirline.AirlineTicketIssueAddress == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineTicketIssueAddress), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineTicketNumberOption.IsSet && additionalDataAirline.AirlineTicketNumber == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineTicketNumber), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineTravelAgencyCodeOption.IsSet && additionalDataAirline.AirlineTravelAgencyCode == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineTravelAgencyCode), "Property is required for class AdditionalDataAirline."); - - if (additionalDataAirline.AirlineTravelAgencyNameOption.IsSet && additionalDataAirline.AirlineTravelAgencyName == null) - throw new ArgumentNullException(nameof(additionalDataAirline.AirlineTravelAgencyName), "Property is required for class AdditionalDataAirline."); - - writer.WriteString("airline.passenger_name", additionalDataAirline.AirlinePassengerName); - - if (additionalDataAirline.AirlineAgencyInvoiceNumberOption.IsSet) - writer.WriteString("airline.agency_invoice_number", additionalDataAirline.AirlineAgencyInvoiceNumber); - - if (additionalDataAirline.AirlineAgencyPlanNameOption.IsSet) - writer.WriteString("airline.agency_plan_name", additionalDataAirline.AirlineAgencyPlanName); - - if (additionalDataAirline.AirlineAirlineCodeOption.IsSet) - writer.WriteString("airline.airline_code", additionalDataAirline.AirlineAirlineCode); - - if (additionalDataAirline.AirlineAirlineDesignatorCodeOption.IsSet) - writer.WriteString("airline.airline_designator_code", additionalDataAirline.AirlineAirlineDesignatorCode); - - if (additionalDataAirline.AirlineBoardingFeeOption.IsSet) - writer.WriteString("airline.boarding_fee", additionalDataAirline.AirlineBoardingFee); - - if (additionalDataAirline.AirlineComputerizedReservationSystemOption.IsSet) - writer.WriteString("airline.computerized_reservation_system", additionalDataAirline.AirlineComputerizedReservationSystem); - - if (additionalDataAirline.AirlineCustomerReferenceNumberOption.IsSet) - writer.WriteString("airline.customer_reference_number", additionalDataAirline.AirlineCustomerReferenceNumber); - - if (additionalDataAirline.AirlineDocumentTypeOption.IsSet) - writer.WriteString("airline.document_type", additionalDataAirline.AirlineDocumentType); - - if (additionalDataAirline.AirlineFlightDateOption.IsSet) - writer.WriteString("airline.flight_date", additionalDataAirline.AirlineFlightDate); - - if (additionalDataAirline.AirlineIssueDateOption.IsSet) - writer.WriteString("airline.issue_date", additionalDataAirline.AirlineIssueDate); - - if (additionalDataAirline.AirlineLegCarrierCodeOption.IsSet) - writer.WriteString("airline.leg.carrier_code", additionalDataAirline.AirlineLegCarrierCode); - - if (additionalDataAirline.AirlineLegClassOfTravelOption.IsSet) - writer.WriteString("airline.leg.class_of_travel", additionalDataAirline.AirlineLegClassOfTravel); - - if (additionalDataAirline.AirlineLegDateOfTravelOption.IsSet) - writer.WriteString("airline.leg.date_of_travel", additionalDataAirline.AirlineLegDateOfTravel); - - if (additionalDataAirline.AirlineLegDepartAirportOption.IsSet) - writer.WriteString("airline.leg.depart_airport", additionalDataAirline.AirlineLegDepartAirport); - - if (additionalDataAirline.AirlineLegDepartTaxOption.IsSet) - writer.WriteString("airline.leg.depart_tax", additionalDataAirline.AirlineLegDepartTax); - - if (additionalDataAirline.AirlineLegDestinationCodeOption.IsSet) - writer.WriteString("airline.leg.destination_code", additionalDataAirline.AirlineLegDestinationCode); - - if (additionalDataAirline.AirlineLegFareBaseCodeOption.IsSet) - writer.WriteString("airline.leg.fare_base_code", additionalDataAirline.AirlineLegFareBaseCode); - - if (additionalDataAirline.AirlineLegFlightNumberOption.IsSet) - writer.WriteString("airline.leg.flight_number", additionalDataAirline.AirlineLegFlightNumber); - - if (additionalDataAirline.AirlineLegStopOverCodeOption.IsSet) - writer.WriteString("airline.leg.stop_over_code", additionalDataAirline.AirlineLegStopOverCode); - - if (additionalDataAirline.AirlinePassengerDateOfBirthOption.IsSet) - writer.WriteString("airline.passenger.date_of_birth", additionalDataAirline.AirlinePassengerDateOfBirth); - - if (additionalDataAirline.AirlinePassengerFirstNameOption.IsSet) - writer.WriteString("airline.passenger.first_name", additionalDataAirline.AirlinePassengerFirstName); - - if (additionalDataAirline.AirlinePassengerLastNameOption.IsSet) - writer.WriteString("airline.passenger.last_name", additionalDataAirline.AirlinePassengerLastName); - - if (additionalDataAirline.AirlinePassengerPhoneNumberOption.IsSet) - writer.WriteString("airline.passenger.phone_number", additionalDataAirline.AirlinePassengerPhoneNumber); - - if (additionalDataAirline.AirlinePassengerTravellerTypeOption.IsSet) - writer.WriteString("airline.passenger.traveller_type", additionalDataAirline.AirlinePassengerTravellerType); - - if (additionalDataAirline.AirlineTicketIssueAddressOption.IsSet) - writer.WriteString("airline.ticket_issue_address", additionalDataAirline.AirlineTicketIssueAddress); - - if (additionalDataAirline.AirlineTicketNumberOption.IsSet) - writer.WriteString("airline.ticket_number", additionalDataAirline.AirlineTicketNumber); - - if (additionalDataAirline.AirlineTravelAgencyCodeOption.IsSet) - writer.WriteString("airline.travel_agency_code", additionalDataAirline.AirlineTravelAgencyCode); - - if (additionalDataAirline.AirlineTravelAgencyNameOption.IsSet) - writer.WriteString("airline.travel_agency_name", additionalDataAirline.AirlineTravelAgencyName); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataCarRental.cs b/Adyen/Model/Checkout/AdditionalDataCarRental.cs index d7c29b6ed..2b7a8b7e7 100644 --- a/Adyen/Model/Checkout/AdditionalDataCarRental.cs +++ b/Adyen/Model/Checkout/AdditionalDataCarRental.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,398 +15,236 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataCarRental /// - public partial class AdditionalDataCarRental : IValidatableObject + [DataContract(Name = "AdditionalDataCarRental")] + public partial class AdditionalDataCarRental : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The pick-up date. * Date format: `yyyyMMdd` - /// The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. - /// Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces - /// Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 - /// Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces *Must not be all zeros. - /// The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. - /// The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 - /// The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces *Must not be all zeros. - /// Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable - /// The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12 - /// The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12 - /// Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate - /// The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces *Must not be all zeros. - /// The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces *Must not be all zeros. - /// The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces *Must not be all zeros. - /// The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. - /// The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 - /// The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 - /// The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces *Must not be all zeros. - /// The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces *Must not be all zeros. - /// Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected - /// Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 4 - /// Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 - [JsonConstructor] - public AdditionalDataCarRental(Option carRentalCheckOutDate = default, Option carRentalCustomerServiceTollFreeNumber = default, Option carRentalDaysRented = default, Option carRentalFuelCharges = default, Option carRentalInsuranceCharges = default, Option carRentalLocationCity = default, Option carRentalLocationCountry = default, Option carRentalLocationStateProvince = default, Option carRentalNoShowIndicator = default, Option carRentalOneWayDropOffCharges = default, Option carRentalRate = default, Option carRentalRateIndicator = default, Option carRentalRentalAgreementNumber = default, Option carRentalRentalClassId = default, Option carRentalRenterName = default, Option carRentalReturnCity = default, Option carRentalReturnCountry = default, Option carRentalReturnDate = default, Option carRentalReturnLocationId = default, Option carRentalReturnStateProvince = default, Option carRentalTaxExemptIndicator = default, Option travelEntertainmentAuthDataDuration = default, Option travelEntertainmentAuthDataMarket = default) + /// The pick-up date. * Date format: `yyyyMMdd`. + /// The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros.. + /// Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces. + /// Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12. + /// Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces *Must not be all zeros.. + /// The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros.. + /// The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2. + /// The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces *Must not be all zeros.. + /// Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable. + /// The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12. + /// The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12. + /// Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate. + /// The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces *Must not be all zeros.. + /// The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces *Must not be all zeros.. + /// The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces *Must not be all zeros.. + /// The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros.. + /// The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2. + /// The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8. + /// The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces *Must not be all zeros.. + /// The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces *Must not be all zeros.. + /// Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected. + /// Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 4. + /// Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1. + public AdditionalDataCarRental(string carRentalCheckOutDate = default(string), string carRentalCustomerServiceTollFreeNumber = default(string), string carRentalDaysRented = default(string), string carRentalFuelCharges = default(string), string carRentalInsuranceCharges = default(string), string carRentalLocationCity = default(string), string carRentalLocationCountry = default(string), string carRentalLocationStateProvince = default(string), string carRentalNoShowIndicator = default(string), string carRentalOneWayDropOffCharges = default(string), string carRentalRate = default(string), string carRentalRateIndicator = default(string), string carRentalRentalAgreementNumber = default(string), string carRentalRentalClassId = default(string), string carRentalRenterName = default(string), string carRentalReturnCity = default(string), string carRentalReturnCountry = default(string), string carRentalReturnDate = default(string), string carRentalReturnLocationId = default(string), string carRentalReturnStateProvince = default(string), string carRentalTaxExemptIndicator = default(string), string travelEntertainmentAuthDataDuration = default(string), string travelEntertainmentAuthDataMarket = default(string)) { - CarRentalCheckOutDateOption = carRentalCheckOutDate; - CarRentalCustomerServiceTollFreeNumberOption = carRentalCustomerServiceTollFreeNumber; - CarRentalDaysRentedOption = carRentalDaysRented; - CarRentalFuelChargesOption = carRentalFuelCharges; - CarRentalInsuranceChargesOption = carRentalInsuranceCharges; - CarRentalLocationCityOption = carRentalLocationCity; - CarRentalLocationCountryOption = carRentalLocationCountry; - CarRentalLocationStateProvinceOption = carRentalLocationStateProvince; - CarRentalNoShowIndicatorOption = carRentalNoShowIndicator; - CarRentalOneWayDropOffChargesOption = carRentalOneWayDropOffCharges; - CarRentalRateOption = carRentalRate; - CarRentalRateIndicatorOption = carRentalRateIndicator; - CarRentalRentalAgreementNumberOption = carRentalRentalAgreementNumber; - CarRentalRentalClassIdOption = carRentalRentalClassId; - CarRentalRenterNameOption = carRentalRenterName; - CarRentalReturnCityOption = carRentalReturnCity; - CarRentalReturnCountryOption = carRentalReturnCountry; - CarRentalReturnDateOption = carRentalReturnDate; - CarRentalReturnLocationIdOption = carRentalReturnLocationId; - CarRentalReturnStateProvinceOption = carRentalReturnStateProvince; - CarRentalTaxExemptIndicatorOption = carRentalTaxExemptIndicator; - TravelEntertainmentAuthDataDurationOption = travelEntertainmentAuthDataDuration; - TravelEntertainmentAuthDataMarketOption = travelEntertainmentAuthDataMarket; - OnCreated(); + this.CarRentalCheckOutDate = carRentalCheckOutDate; + this.CarRentalCustomerServiceTollFreeNumber = carRentalCustomerServiceTollFreeNumber; + this.CarRentalDaysRented = carRentalDaysRented; + this.CarRentalFuelCharges = carRentalFuelCharges; + this.CarRentalInsuranceCharges = carRentalInsuranceCharges; + this.CarRentalLocationCity = carRentalLocationCity; + this.CarRentalLocationCountry = carRentalLocationCountry; + this.CarRentalLocationStateProvince = carRentalLocationStateProvince; + this.CarRentalNoShowIndicator = carRentalNoShowIndicator; + this.CarRentalOneWayDropOffCharges = carRentalOneWayDropOffCharges; + this.CarRentalRate = carRentalRate; + this.CarRentalRateIndicator = carRentalRateIndicator; + this.CarRentalRentalAgreementNumber = carRentalRentalAgreementNumber; + this.CarRentalRentalClassId = carRentalRentalClassId; + this.CarRentalRenterName = carRentalRenterName; + this.CarRentalReturnCity = carRentalReturnCity; + this.CarRentalReturnCountry = carRentalReturnCountry; + this.CarRentalReturnDate = carRentalReturnDate; + this.CarRentalReturnLocationId = carRentalReturnLocationId; + this.CarRentalReturnStateProvince = carRentalReturnStateProvince; + this.CarRentalTaxExemptIndicator = carRentalTaxExemptIndicator; + this.TravelEntertainmentAuthDataDuration = travelEntertainmentAuthDataDuration; + this.TravelEntertainmentAuthDataMarket = travelEntertainmentAuthDataMarket; } - partial void OnCreated(); - - /// - /// Used to track the state of CarRentalCheckOutDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalCheckOutDateOption { get; private set; } - /// /// The pick-up date. * Date format: `yyyyMMdd` /// /// The pick-up date. * Date format: `yyyyMMdd` - [JsonPropertyName("carRental.checkOutDate")] - public string CarRentalCheckOutDate { get { return this.CarRentalCheckOutDateOption; } set { this.CarRentalCheckOutDateOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalCustomerServiceTollFreeNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalCustomerServiceTollFreeNumberOption { get; private set; } + [DataMember(Name = "carRental.checkOutDate", EmitDefaultValue = false)] + public string CarRentalCheckOutDate { get; set; } /// /// The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. /// /// The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - *Must not be all zeros. - [JsonPropertyName("carRental.customerServiceTollFreeNumber")] - public string CarRentalCustomerServiceTollFreeNumber { get { return this.CarRentalCustomerServiceTollFreeNumberOption; } set { this.CarRentalCustomerServiceTollFreeNumberOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalDaysRented - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalDaysRentedOption { get; private set; } + [DataMember(Name = "carRental.customerServiceTollFreeNumber", EmitDefaultValue = false)] + public string CarRentalCustomerServiceTollFreeNumber { get; set; } /// /// Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces /// /// Number of days for which the car is being rented. * Format: Numeric * maxLength: 4 * Must not be all spaces - [JsonPropertyName("carRental.daysRented")] - public string CarRentalDaysRented { get { return this.CarRentalDaysRentedOption; } set { this.CarRentalDaysRentedOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalFuelCharges - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalFuelChargesOption { get; private set; } + [DataMember(Name = "carRental.daysRented", EmitDefaultValue = false)] + public string CarRentalDaysRented { get; set; } /// /// Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 /// /// Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 - [JsonPropertyName("carRental.fuelCharges")] - public string CarRentalFuelCharges { get { return this.CarRentalFuelChargesOption; } set { this.CarRentalFuelChargesOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalInsuranceCharges - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalInsuranceChargesOption { get; private set; } + [DataMember(Name = "carRental.fuelCharges", EmitDefaultValue = false)] + public string CarRentalFuelCharges { get; set; } /// /// Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces *Must not be all zeros. /// /// Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces *Must not be all zeros. - [JsonPropertyName("carRental.insuranceCharges")] - public string CarRentalInsuranceCharges { get { return this.CarRentalInsuranceChargesOption; } set { this.CarRentalInsuranceChargesOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalLocationCity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalLocationCityOption { get; private set; } + [DataMember(Name = "carRental.insuranceCharges", EmitDefaultValue = false)] + public string CarRentalInsuranceCharges { get; set; } /// /// The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. - [JsonPropertyName("carRental.locationCity")] - public string CarRentalLocationCity { get { return this.CarRentalLocationCityOption; } set { this.CarRentalLocationCityOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalLocationCountry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalLocationCountryOption { get; private set; } + [DataMember(Name = "carRental.locationCity", EmitDefaultValue = false)] + public string CarRentalLocationCity { get; set; } /// /// The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 /// /// The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 - [JsonPropertyName("carRental.locationCountry")] - public string CarRentalLocationCountry { get { return this.CarRentalLocationCountryOption; } set { this.CarRentalLocationCountryOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalLocationStateProvince - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalLocationStateProvinceOption { get; private set; } + [DataMember(Name = "carRental.locationCountry", EmitDefaultValue = false)] + public string CarRentalLocationCountry { get; set; } /// /// The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces *Must not be all zeros. - [JsonPropertyName("carRental.locationStateProvince")] - public string CarRentalLocationStateProvince { get { return this.CarRentalLocationStateProvinceOption; } set { this.CarRentalLocationStateProvinceOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalNoShowIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalNoShowIndicatorOption { get; private set; } + [DataMember(Name = "carRental.locationStateProvince", EmitDefaultValue = false)] + public string CarRentalLocationStateProvince { get; set; } /// /// Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable /// /// Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable - [JsonPropertyName("carRental.noShowIndicator")] - public string CarRentalNoShowIndicator { get { return this.CarRentalNoShowIndicatorOption; } set { this.CarRentalNoShowIndicatorOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalOneWayDropOffCharges - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalOneWayDropOffChargesOption { get; private set; } + [DataMember(Name = "carRental.noShowIndicator", EmitDefaultValue = false)] + public string CarRentalNoShowIndicator { get; set; } /// /// The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12 /// /// The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12 - [JsonPropertyName("carRental.oneWayDropOffCharges")] - public string CarRentalOneWayDropOffCharges { get { return this.CarRentalOneWayDropOffChargesOption; } set { this.CarRentalOneWayDropOffChargesOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalRate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalRateOption { get; private set; } + [DataMember(Name = "carRental.oneWayDropOffCharges", EmitDefaultValue = false)] + public string CarRentalOneWayDropOffCharges { get; set; } /// /// The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12 /// /// The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12 - [JsonPropertyName("carRental.rate")] - public string CarRentalRate { get { return this.CarRentalRateOption; } set { this.CarRentalRateOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalRateIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalRateIndicatorOption { get; private set; } + [DataMember(Name = "carRental.rate", EmitDefaultValue = false)] + public string CarRentalRate { get; set; } /// /// Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate /// /// Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate - [JsonPropertyName("carRental.rateIndicator")] - public string CarRentalRateIndicator { get { return this.CarRentalRateIndicatorOption; } set { this.CarRentalRateIndicatorOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalRentalAgreementNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalRentalAgreementNumberOption { get; private set; } + [DataMember(Name = "carRental.rateIndicator", EmitDefaultValue = false)] + public string CarRentalRateIndicator { get; set; } /// /// The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces *Must not be all zeros. - [JsonPropertyName("carRental.rentalAgreementNumber")] - public string CarRentalRentalAgreementNumber { get { return this.CarRentalRentalAgreementNumberOption; } set { this.CarRentalRentalAgreementNumberOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalRentalClassId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalRentalClassIdOption { get; private set; } + [DataMember(Name = "carRental.rentalAgreementNumber", EmitDefaultValue = false)] + public string CarRentalRentalAgreementNumber { get; set; } /// /// The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces *Must not be all zeros. - [JsonPropertyName("carRental.rentalClassId")] - public string CarRentalRentalClassId { get { return this.CarRentalRentalClassIdOption; } set { this.CarRentalRentalClassIdOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalRenterName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalRenterNameOption { get; private set; } + [DataMember(Name = "carRental.rentalClassId", EmitDefaultValue = false)] + public string CarRentalRentalClassId { get; set; } /// /// The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces *Must not be all zeros. /// /// The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces *Must not be all zeros. - [JsonPropertyName("carRental.renterName")] - public string CarRentalRenterName { get { return this.CarRentalRenterNameOption; } set { this.CarRentalRenterNameOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalReturnCity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalReturnCityOption { get; private set; } + [DataMember(Name = "carRental.renterName", EmitDefaultValue = false)] + public string CarRentalRenterName { get; set; } /// /// The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces *Must not be all zeros. - [JsonPropertyName("carRental.returnCity")] - public string CarRentalReturnCity { get { return this.CarRentalReturnCityOption; } set { this.CarRentalReturnCityOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalReturnCountry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalReturnCountryOption { get; private set; } + [DataMember(Name = "carRental.returnCity", EmitDefaultValue = false)] + public string CarRentalReturnCity { get; set; } /// /// The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 /// /// The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 - [JsonPropertyName("carRental.returnCountry")] - public string CarRentalReturnCountry { get { return this.CarRentalReturnCountryOption; } set { this.CarRentalReturnCountryOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalReturnDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalReturnDateOption { get; private set; } + [DataMember(Name = "carRental.returnCountry", EmitDefaultValue = false)] + public string CarRentalReturnCountry { get; set; } /// /// The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 /// /// The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 - [JsonPropertyName("carRental.returnDate")] - public string CarRentalReturnDate { get { return this.CarRentalReturnDateOption; } set { this.CarRentalReturnDateOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalReturnLocationId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalReturnLocationIdOption { get; private set; } + [DataMember(Name = "carRental.returnDate", EmitDefaultValue = false)] + public string CarRentalReturnDate { get; set; } /// /// The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces *Must not be all zeros. - [JsonPropertyName("carRental.returnLocationId")] - public string CarRentalReturnLocationId { get { return this.CarRentalReturnLocationIdOption; } set { this.CarRentalReturnLocationIdOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalReturnStateProvince - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalReturnStateProvinceOption { get; private set; } + [DataMember(Name = "carRental.returnLocationId", EmitDefaultValue = false)] + public string CarRentalReturnLocationId { get; set; } /// /// The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces *Must not be all zeros. /// /// The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces *Must not be all zeros. - [JsonPropertyName("carRental.returnStateProvince")] - public string CarRentalReturnStateProvince { get { return this.CarRentalReturnStateProvinceOption; } set { this.CarRentalReturnStateProvinceOption = new Option(value); } } - - /// - /// Used to track the state of CarRentalTaxExemptIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarRentalTaxExemptIndicatorOption { get; private set; } + [DataMember(Name = "carRental.returnStateProvince", EmitDefaultValue = false)] + public string CarRentalReturnStateProvince { get; set; } /// /// Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected /// /// Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected - [JsonPropertyName("carRental.taxExemptIndicator")] - public string CarRentalTaxExemptIndicator { get { return this.CarRentalTaxExemptIndicatorOption; } set { this.CarRentalTaxExemptIndicatorOption = new Option(value); } } - - /// - /// Used to track the state of TravelEntertainmentAuthDataDuration - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TravelEntertainmentAuthDataDurationOption { get; private set; } + [DataMember(Name = "carRental.taxExemptIndicator", EmitDefaultValue = false)] + public string CarRentalTaxExemptIndicator { get; set; } /// /// Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 4 /// /// Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 4 - [JsonPropertyName("travelEntertainmentAuthData.duration")] - public string TravelEntertainmentAuthDataDuration { get { return this.TravelEntertainmentAuthDataDurationOption; } set { this.TravelEntertainmentAuthDataDurationOption = new Option(value); } } - - /// - /// Used to track the state of TravelEntertainmentAuthDataMarket - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TravelEntertainmentAuthDataMarketOption { get; private set; } + [DataMember(Name = "travelEntertainmentAuthData.duration", EmitDefaultValue = false)] + public string TravelEntertainmentAuthDataDuration { get; set; } /// /// Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 /// /// Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 - [JsonPropertyName("travelEntertainmentAuthData.market")] - public string TravelEntertainmentAuthDataMarket { get { return this.TravelEntertainmentAuthDataMarketOption; } set { this.TravelEntertainmentAuthDataMarketOption = new Option(value); } } + [DataMember(Name = "travelEntertainmentAuthData.market", EmitDefaultValue = false)] + public string TravelEntertainmentAuthDataMarket { get; set; } /// /// Returns the string presentation of the object @@ -443,385 +282,266 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataCarRentalJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataCarRental Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option carRentalCheckOutDate = default; - Option carRentalCustomerServiceTollFreeNumber = default; - Option carRentalDaysRented = default; - Option carRentalFuelCharges = default; - Option carRentalInsuranceCharges = default; - Option carRentalLocationCity = default; - Option carRentalLocationCountry = default; - Option carRentalLocationStateProvince = default; - Option carRentalNoShowIndicator = default; - Option carRentalOneWayDropOffCharges = default; - Option carRentalRate = default; - Option carRentalRateIndicator = default; - Option carRentalRentalAgreementNumber = default; - Option carRentalRentalClassId = default; - Option carRentalRenterName = default; - Option carRentalReturnCity = default; - Option carRentalReturnCountry = default; - Option carRentalReturnDate = default; - Option carRentalReturnLocationId = default; - Option carRentalReturnStateProvince = default; - Option carRentalTaxExemptIndicator = default; - Option travelEntertainmentAuthDataDuration = default; - Option travelEntertainmentAuthDataMarket = default; + return this.Equals(input as AdditionalDataCarRental); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AdditionalDataCarRental instances are equal + /// + /// Instance of AdditionalDataCarRental to be compared + /// Boolean + public bool Equals(AdditionalDataCarRental input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "carRental.checkOutDate": - carRentalCheckOutDate = new Option(utf8JsonReader.GetString()); - break; - case "carRental.customerServiceTollFreeNumber": - carRentalCustomerServiceTollFreeNumber = new Option(utf8JsonReader.GetString()); - break; - case "carRental.daysRented": - carRentalDaysRented = new Option(utf8JsonReader.GetString()); - break; - case "carRental.fuelCharges": - carRentalFuelCharges = new Option(utf8JsonReader.GetString()); - break; - case "carRental.insuranceCharges": - carRentalInsuranceCharges = new Option(utf8JsonReader.GetString()); - break; - case "carRental.locationCity": - carRentalLocationCity = new Option(utf8JsonReader.GetString()); - break; - case "carRental.locationCountry": - carRentalLocationCountry = new Option(utf8JsonReader.GetString()); - break; - case "carRental.locationStateProvince": - carRentalLocationStateProvince = new Option(utf8JsonReader.GetString()); - break; - case "carRental.noShowIndicator": - carRentalNoShowIndicator = new Option(utf8JsonReader.GetString()); - break; - case "carRental.oneWayDropOffCharges": - carRentalOneWayDropOffCharges = new Option(utf8JsonReader.GetString()); - break; - case "carRental.rate": - carRentalRate = new Option(utf8JsonReader.GetString()); - break; - case "carRental.rateIndicator": - carRentalRateIndicator = new Option(utf8JsonReader.GetString()); - break; - case "carRental.rentalAgreementNumber": - carRentalRentalAgreementNumber = new Option(utf8JsonReader.GetString()); - break; - case "carRental.rentalClassId": - carRentalRentalClassId = new Option(utf8JsonReader.GetString()); - break; - case "carRental.renterName": - carRentalRenterName = new Option(utf8JsonReader.GetString()); - break; - case "carRental.returnCity": - carRentalReturnCity = new Option(utf8JsonReader.GetString()); - break; - case "carRental.returnCountry": - carRentalReturnCountry = new Option(utf8JsonReader.GetString()); - break; - case "carRental.returnDate": - carRentalReturnDate = new Option(utf8JsonReader.GetString()); - break; - case "carRental.returnLocationId": - carRentalReturnLocationId = new Option(utf8JsonReader.GetString()); - break; - case "carRental.returnStateProvince": - carRentalReturnStateProvince = new Option(utf8JsonReader.GetString()); - break; - case "carRental.taxExemptIndicator": - carRentalTaxExemptIndicator = new Option(utf8JsonReader.GetString()); - break; - case "travelEntertainmentAuthData.duration": - travelEntertainmentAuthDataDuration = new Option(utf8JsonReader.GetString()); - break; - case "travelEntertainmentAuthData.market": - travelEntertainmentAuthDataMarket = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (carRentalCheckOutDate.IsSet && carRentalCheckOutDate.Value == null) - throw new ArgumentNullException(nameof(carRentalCheckOutDate), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalCustomerServiceTollFreeNumber.IsSet && carRentalCustomerServiceTollFreeNumber.Value == null) - throw new ArgumentNullException(nameof(carRentalCustomerServiceTollFreeNumber), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalDaysRented.IsSet && carRentalDaysRented.Value == null) - throw new ArgumentNullException(nameof(carRentalDaysRented), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalFuelCharges.IsSet && carRentalFuelCharges.Value == null) - throw new ArgumentNullException(nameof(carRentalFuelCharges), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalInsuranceCharges.IsSet && carRentalInsuranceCharges.Value == null) - throw new ArgumentNullException(nameof(carRentalInsuranceCharges), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalLocationCity.IsSet && carRentalLocationCity.Value == null) - throw new ArgumentNullException(nameof(carRentalLocationCity), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalLocationCountry.IsSet && carRentalLocationCountry.Value == null) - throw new ArgumentNullException(nameof(carRentalLocationCountry), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalLocationStateProvince.IsSet && carRentalLocationStateProvince.Value == null) - throw new ArgumentNullException(nameof(carRentalLocationStateProvince), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalNoShowIndicator.IsSet && carRentalNoShowIndicator.Value == null) - throw new ArgumentNullException(nameof(carRentalNoShowIndicator), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalOneWayDropOffCharges.IsSet && carRentalOneWayDropOffCharges.Value == null) - throw new ArgumentNullException(nameof(carRentalOneWayDropOffCharges), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalRate.IsSet && carRentalRate.Value == null) - throw new ArgumentNullException(nameof(carRentalRate), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalRateIndicator.IsSet && carRentalRateIndicator.Value == null) - throw new ArgumentNullException(nameof(carRentalRateIndicator), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalRentalAgreementNumber.IsSet && carRentalRentalAgreementNumber.Value == null) - throw new ArgumentNullException(nameof(carRentalRentalAgreementNumber), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalRentalClassId.IsSet && carRentalRentalClassId.Value == null) - throw new ArgumentNullException(nameof(carRentalRentalClassId), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalRenterName.IsSet && carRentalRenterName.Value == null) - throw new ArgumentNullException(nameof(carRentalRenterName), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalReturnCity.IsSet && carRentalReturnCity.Value == null) - throw new ArgumentNullException(nameof(carRentalReturnCity), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalReturnCountry.IsSet && carRentalReturnCountry.Value == null) - throw new ArgumentNullException(nameof(carRentalReturnCountry), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalReturnDate.IsSet && carRentalReturnDate.Value == null) - throw new ArgumentNullException(nameof(carRentalReturnDate), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalReturnLocationId.IsSet && carRentalReturnLocationId.Value == null) - throw new ArgumentNullException(nameof(carRentalReturnLocationId), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalReturnStateProvince.IsSet && carRentalReturnStateProvince.Value == null) - throw new ArgumentNullException(nameof(carRentalReturnStateProvince), "Property is not nullable for class AdditionalDataCarRental."); - - if (carRentalTaxExemptIndicator.IsSet && carRentalTaxExemptIndicator.Value == null) - throw new ArgumentNullException(nameof(carRentalTaxExemptIndicator), "Property is not nullable for class AdditionalDataCarRental."); - - if (travelEntertainmentAuthDataDuration.IsSet && travelEntertainmentAuthDataDuration.Value == null) - throw new ArgumentNullException(nameof(travelEntertainmentAuthDataDuration), "Property is not nullable for class AdditionalDataCarRental."); - - if (travelEntertainmentAuthDataMarket.IsSet && travelEntertainmentAuthDataMarket.Value == null) - throw new ArgumentNullException(nameof(travelEntertainmentAuthDataMarket), "Property is not nullable for class AdditionalDataCarRental."); - - return new AdditionalDataCarRental(carRentalCheckOutDate, carRentalCustomerServiceTollFreeNumber, carRentalDaysRented, carRentalFuelCharges, carRentalInsuranceCharges, carRentalLocationCity, carRentalLocationCountry, carRentalLocationStateProvince, carRentalNoShowIndicator, carRentalOneWayDropOffCharges, carRentalRate, carRentalRateIndicator, carRentalRentalAgreementNumber, carRentalRentalClassId, carRentalRenterName, carRentalReturnCity, carRentalReturnCountry, carRentalReturnDate, carRentalReturnLocationId, carRentalReturnStateProvince, carRentalTaxExemptIndicator, travelEntertainmentAuthDataDuration, travelEntertainmentAuthDataMarket); + return + ( + this.CarRentalCheckOutDate == input.CarRentalCheckOutDate || + (this.CarRentalCheckOutDate != null && + this.CarRentalCheckOutDate.Equals(input.CarRentalCheckOutDate)) + ) && + ( + this.CarRentalCustomerServiceTollFreeNumber == input.CarRentalCustomerServiceTollFreeNumber || + (this.CarRentalCustomerServiceTollFreeNumber != null && + this.CarRentalCustomerServiceTollFreeNumber.Equals(input.CarRentalCustomerServiceTollFreeNumber)) + ) && + ( + this.CarRentalDaysRented == input.CarRentalDaysRented || + (this.CarRentalDaysRented != null && + this.CarRentalDaysRented.Equals(input.CarRentalDaysRented)) + ) && + ( + this.CarRentalFuelCharges == input.CarRentalFuelCharges || + (this.CarRentalFuelCharges != null && + this.CarRentalFuelCharges.Equals(input.CarRentalFuelCharges)) + ) && + ( + this.CarRentalInsuranceCharges == input.CarRentalInsuranceCharges || + (this.CarRentalInsuranceCharges != null && + this.CarRentalInsuranceCharges.Equals(input.CarRentalInsuranceCharges)) + ) && + ( + this.CarRentalLocationCity == input.CarRentalLocationCity || + (this.CarRentalLocationCity != null && + this.CarRentalLocationCity.Equals(input.CarRentalLocationCity)) + ) && + ( + this.CarRentalLocationCountry == input.CarRentalLocationCountry || + (this.CarRentalLocationCountry != null && + this.CarRentalLocationCountry.Equals(input.CarRentalLocationCountry)) + ) && + ( + this.CarRentalLocationStateProvince == input.CarRentalLocationStateProvince || + (this.CarRentalLocationStateProvince != null && + this.CarRentalLocationStateProvince.Equals(input.CarRentalLocationStateProvince)) + ) && + ( + this.CarRentalNoShowIndicator == input.CarRentalNoShowIndicator || + (this.CarRentalNoShowIndicator != null && + this.CarRentalNoShowIndicator.Equals(input.CarRentalNoShowIndicator)) + ) && + ( + this.CarRentalOneWayDropOffCharges == input.CarRentalOneWayDropOffCharges || + (this.CarRentalOneWayDropOffCharges != null && + this.CarRentalOneWayDropOffCharges.Equals(input.CarRentalOneWayDropOffCharges)) + ) && + ( + this.CarRentalRate == input.CarRentalRate || + (this.CarRentalRate != null && + this.CarRentalRate.Equals(input.CarRentalRate)) + ) && + ( + this.CarRentalRateIndicator == input.CarRentalRateIndicator || + (this.CarRentalRateIndicator != null && + this.CarRentalRateIndicator.Equals(input.CarRentalRateIndicator)) + ) && + ( + this.CarRentalRentalAgreementNumber == input.CarRentalRentalAgreementNumber || + (this.CarRentalRentalAgreementNumber != null && + this.CarRentalRentalAgreementNumber.Equals(input.CarRentalRentalAgreementNumber)) + ) && + ( + this.CarRentalRentalClassId == input.CarRentalRentalClassId || + (this.CarRentalRentalClassId != null && + this.CarRentalRentalClassId.Equals(input.CarRentalRentalClassId)) + ) && + ( + this.CarRentalRenterName == input.CarRentalRenterName || + (this.CarRentalRenterName != null && + this.CarRentalRenterName.Equals(input.CarRentalRenterName)) + ) && + ( + this.CarRentalReturnCity == input.CarRentalReturnCity || + (this.CarRentalReturnCity != null && + this.CarRentalReturnCity.Equals(input.CarRentalReturnCity)) + ) && + ( + this.CarRentalReturnCountry == input.CarRentalReturnCountry || + (this.CarRentalReturnCountry != null && + this.CarRentalReturnCountry.Equals(input.CarRentalReturnCountry)) + ) && + ( + this.CarRentalReturnDate == input.CarRentalReturnDate || + (this.CarRentalReturnDate != null && + this.CarRentalReturnDate.Equals(input.CarRentalReturnDate)) + ) && + ( + this.CarRentalReturnLocationId == input.CarRentalReturnLocationId || + (this.CarRentalReturnLocationId != null && + this.CarRentalReturnLocationId.Equals(input.CarRentalReturnLocationId)) + ) && + ( + this.CarRentalReturnStateProvince == input.CarRentalReturnStateProvince || + (this.CarRentalReturnStateProvince != null && + this.CarRentalReturnStateProvince.Equals(input.CarRentalReturnStateProvince)) + ) && + ( + this.CarRentalTaxExemptIndicator == input.CarRentalTaxExemptIndicator || + (this.CarRentalTaxExemptIndicator != null && + this.CarRentalTaxExemptIndicator.Equals(input.CarRentalTaxExemptIndicator)) + ) && + ( + this.TravelEntertainmentAuthDataDuration == input.TravelEntertainmentAuthDataDuration || + (this.TravelEntertainmentAuthDataDuration != null && + this.TravelEntertainmentAuthDataDuration.Equals(input.TravelEntertainmentAuthDataDuration)) + ) && + ( + this.TravelEntertainmentAuthDataMarket == input.TravelEntertainmentAuthDataMarket || + (this.TravelEntertainmentAuthDataMarket != null && + this.TravelEntertainmentAuthDataMarket.Equals(input.TravelEntertainmentAuthDataMarket)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataCarRental additionalDataCarRental, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataCarRental, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CarRentalCheckOutDate != null) + { + hashCode = (hashCode * 59) + this.CarRentalCheckOutDate.GetHashCode(); + } + if (this.CarRentalCustomerServiceTollFreeNumber != null) + { + hashCode = (hashCode * 59) + this.CarRentalCustomerServiceTollFreeNumber.GetHashCode(); + } + if (this.CarRentalDaysRented != null) + { + hashCode = (hashCode * 59) + this.CarRentalDaysRented.GetHashCode(); + } + if (this.CarRentalFuelCharges != null) + { + hashCode = (hashCode * 59) + this.CarRentalFuelCharges.GetHashCode(); + } + if (this.CarRentalInsuranceCharges != null) + { + hashCode = (hashCode * 59) + this.CarRentalInsuranceCharges.GetHashCode(); + } + if (this.CarRentalLocationCity != null) + { + hashCode = (hashCode * 59) + this.CarRentalLocationCity.GetHashCode(); + } + if (this.CarRentalLocationCountry != null) + { + hashCode = (hashCode * 59) + this.CarRentalLocationCountry.GetHashCode(); + } + if (this.CarRentalLocationStateProvince != null) + { + hashCode = (hashCode * 59) + this.CarRentalLocationStateProvince.GetHashCode(); + } + if (this.CarRentalNoShowIndicator != null) + { + hashCode = (hashCode * 59) + this.CarRentalNoShowIndicator.GetHashCode(); + } + if (this.CarRentalOneWayDropOffCharges != null) + { + hashCode = (hashCode * 59) + this.CarRentalOneWayDropOffCharges.GetHashCode(); + } + if (this.CarRentalRate != null) + { + hashCode = (hashCode * 59) + this.CarRentalRate.GetHashCode(); + } + if (this.CarRentalRateIndicator != null) + { + hashCode = (hashCode * 59) + this.CarRentalRateIndicator.GetHashCode(); + } + if (this.CarRentalRentalAgreementNumber != null) + { + hashCode = (hashCode * 59) + this.CarRentalRentalAgreementNumber.GetHashCode(); + } + if (this.CarRentalRentalClassId != null) + { + hashCode = (hashCode * 59) + this.CarRentalRentalClassId.GetHashCode(); + } + if (this.CarRentalRenterName != null) + { + hashCode = (hashCode * 59) + this.CarRentalRenterName.GetHashCode(); + } + if (this.CarRentalReturnCity != null) + { + hashCode = (hashCode * 59) + this.CarRentalReturnCity.GetHashCode(); + } + if (this.CarRentalReturnCountry != null) + { + hashCode = (hashCode * 59) + this.CarRentalReturnCountry.GetHashCode(); + } + if (this.CarRentalReturnDate != null) + { + hashCode = (hashCode * 59) + this.CarRentalReturnDate.GetHashCode(); + } + if (this.CarRentalReturnLocationId != null) + { + hashCode = (hashCode * 59) + this.CarRentalReturnLocationId.GetHashCode(); + } + if (this.CarRentalReturnStateProvince != null) + { + hashCode = (hashCode * 59) + this.CarRentalReturnStateProvince.GetHashCode(); + } + if (this.CarRentalTaxExemptIndicator != null) + { + hashCode = (hashCode * 59) + this.CarRentalTaxExemptIndicator.GetHashCode(); + } + if (this.TravelEntertainmentAuthDataDuration != null) + { + hashCode = (hashCode * 59) + this.TravelEntertainmentAuthDataDuration.GetHashCode(); + } + if (this.TravelEntertainmentAuthDataMarket != null) + { + hashCode = (hashCode * 59) + this.TravelEntertainmentAuthDataMarket.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataCarRental additionalDataCarRental, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataCarRental.CarRentalCheckOutDateOption.IsSet && additionalDataCarRental.CarRentalCheckOutDate == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalCheckOutDate), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalCustomerServiceTollFreeNumberOption.IsSet && additionalDataCarRental.CarRentalCustomerServiceTollFreeNumber == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalCustomerServiceTollFreeNumber), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalDaysRentedOption.IsSet && additionalDataCarRental.CarRentalDaysRented == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalDaysRented), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalFuelChargesOption.IsSet && additionalDataCarRental.CarRentalFuelCharges == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalFuelCharges), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalInsuranceChargesOption.IsSet && additionalDataCarRental.CarRentalInsuranceCharges == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalInsuranceCharges), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalLocationCityOption.IsSet && additionalDataCarRental.CarRentalLocationCity == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalLocationCity), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalLocationCountryOption.IsSet && additionalDataCarRental.CarRentalLocationCountry == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalLocationCountry), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalLocationStateProvinceOption.IsSet && additionalDataCarRental.CarRentalLocationStateProvince == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalLocationStateProvince), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalNoShowIndicatorOption.IsSet && additionalDataCarRental.CarRentalNoShowIndicator == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalNoShowIndicator), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalOneWayDropOffChargesOption.IsSet && additionalDataCarRental.CarRentalOneWayDropOffCharges == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalOneWayDropOffCharges), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalRateOption.IsSet && additionalDataCarRental.CarRentalRate == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalRate), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalRateIndicatorOption.IsSet && additionalDataCarRental.CarRentalRateIndicator == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalRateIndicator), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalRentalAgreementNumberOption.IsSet && additionalDataCarRental.CarRentalRentalAgreementNumber == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalRentalAgreementNumber), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalRentalClassIdOption.IsSet && additionalDataCarRental.CarRentalRentalClassId == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalRentalClassId), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalRenterNameOption.IsSet && additionalDataCarRental.CarRentalRenterName == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalRenterName), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalReturnCityOption.IsSet && additionalDataCarRental.CarRentalReturnCity == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalReturnCity), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalReturnCountryOption.IsSet && additionalDataCarRental.CarRentalReturnCountry == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalReturnCountry), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalReturnDateOption.IsSet && additionalDataCarRental.CarRentalReturnDate == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalReturnDate), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalReturnLocationIdOption.IsSet && additionalDataCarRental.CarRentalReturnLocationId == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalReturnLocationId), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalReturnStateProvinceOption.IsSet && additionalDataCarRental.CarRentalReturnStateProvince == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalReturnStateProvince), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalTaxExemptIndicatorOption.IsSet && additionalDataCarRental.CarRentalTaxExemptIndicator == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.CarRentalTaxExemptIndicator), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.TravelEntertainmentAuthDataDurationOption.IsSet && additionalDataCarRental.TravelEntertainmentAuthDataDuration == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.TravelEntertainmentAuthDataDuration), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.TravelEntertainmentAuthDataMarketOption.IsSet && additionalDataCarRental.TravelEntertainmentAuthDataMarket == null) - throw new ArgumentNullException(nameof(additionalDataCarRental.TravelEntertainmentAuthDataMarket), "Property is required for class AdditionalDataCarRental."); - - if (additionalDataCarRental.CarRentalCheckOutDateOption.IsSet) - writer.WriteString("carRental.checkOutDate", additionalDataCarRental.CarRentalCheckOutDate); - - if (additionalDataCarRental.CarRentalCustomerServiceTollFreeNumberOption.IsSet) - writer.WriteString("carRental.customerServiceTollFreeNumber", additionalDataCarRental.CarRentalCustomerServiceTollFreeNumber); - - if (additionalDataCarRental.CarRentalDaysRentedOption.IsSet) - writer.WriteString("carRental.daysRented", additionalDataCarRental.CarRentalDaysRented); - - if (additionalDataCarRental.CarRentalFuelChargesOption.IsSet) - writer.WriteString("carRental.fuelCharges", additionalDataCarRental.CarRentalFuelCharges); - - if (additionalDataCarRental.CarRentalInsuranceChargesOption.IsSet) - writer.WriteString("carRental.insuranceCharges", additionalDataCarRental.CarRentalInsuranceCharges); - - if (additionalDataCarRental.CarRentalLocationCityOption.IsSet) - writer.WriteString("carRental.locationCity", additionalDataCarRental.CarRentalLocationCity); - - if (additionalDataCarRental.CarRentalLocationCountryOption.IsSet) - writer.WriteString("carRental.locationCountry", additionalDataCarRental.CarRentalLocationCountry); - - if (additionalDataCarRental.CarRentalLocationStateProvinceOption.IsSet) - writer.WriteString("carRental.locationStateProvince", additionalDataCarRental.CarRentalLocationStateProvince); - - if (additionalDataCarRental.CarRentalNoShowIndicatorOption.IsSet) - writer.WriteString("carRental.noShowIndicator", additionalDataCarRental.CarRentalNoShowIndicator); - - if (additionalDataCarRental.CarRentalOneWayDropOffChargesOption.IsSet) - writer.WriteString("carRental.oneWayDropOffCharges", additionalDataCarRental.CarRentalOneWayDropOffCharges); - - if (additionalDataCarRental.CarRentalRateOption.IsSet) - writer.WriteString("carRental.rate", additionalDataCarRental.CarRentalRate); - - if (additionalDataCarRental.CarRentalRateIndicatorOption.IsSet) - writer.WriteString("carRental.rateIndicator", additionalDataCarRental.CarRentalRateIndicator); - - if (additionalDataCarRental.CarRentalRentalAgreementNumberOption.IsSet) - writer.WriteString("carRental.rentalAgreementNumber", additionalDataCarRental.CarRentalRentalAgreementNumber); - - if (additionalDataCarRental.CarRentalRentalClassIdOption.IsSet) - writer.WriteString("carRental.rentalClassId", additionalDataCarRental.CarRentalRentalClassId); - - if (additionalDataCarRental.CarRentalRenterNameOption.IsSet) - writer.WriteString("carRental.renterName", additionalDataCarRental.CarRentalRenterName); - - if (additionalDataCarRental.CarRentalReturnCityOption.IsSet) - writer.WriteString("carRental.returnCity", additionalDataCarRental.CarRentalReturnCity); - - if (additionalDataCarRental.CarRentalReturnCountryOption.IsSet) - writer.WriteString("carRental.returnCountry", additionalDataCarRental.CarRentalReturnCountry); - - if (additionalDataCarRental.CarRentalReturnDateOption.IsSet) - writer.WriteString("carRental.returnDate", additionalDataCarRental.CarRentalReturnDate); - - if (additionalDataCarRental.CarRentalReturnLocationIdOption.IsSet) - writer.WriteString("carRental.returnLocationId", additionalDataCarRental.CarRentalReturnLocationId); - - if (additionalDataCarRental.CarRentalReturnStateProvinceOption.IsSet) - writer.WriteString("carRental.returnStateProvince", additionalDataCarRental.CarRentalReturnStateProvince); - - if (additionalDataCarRental.CarRentalTaxExemptIndicatorOption.IsSet) - writer.WriteString("carRental.taxExemptIndicator", additionalDataCarRental.CarRentalTaxExemptIndicator); - - if (additionalDataCarRental.TravelEntertainmentAuthDataDurationOption.IsSet) - writer.WriteString("travelEntertainmentAuthData.duration", additionalDataCarRental.TravelEntertainmentAuthDataDuration); - - if (additionalDataCarRental.TravelEntertainmentAuthDataMarketOption.IsSet) - writer.WriteString("travelEntertainmentAuthData.market", additionalDataCarRental.TravelEntertainmentAuthDataMarket); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataCommon.cs b/Adyen/Model/Checkout/AdditionalDataCommon.cs index b4ecca19c..3d17a1c2c 100644 --- a/Adyen/Model/Checkout/AdditionalDataCommon.cs +++ b/Adyen/Model/Checkout/AdditionalDataCommon.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,433 +15,239 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataCommon /// - public partial class AdditionalDataCommon : IValidatableObject + [DataContract(Name = "AdditionalDataCommon")] + public partial class AdditionalDataCommon : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Triggers test scenarios that allow to replicate certain acquirer response codes. See [Testing result codes and refusal reasons](https://docs.adyen.com/development-resources/testing/result-codes/) to learn about the possible values, and the `refusalReason` values you can trigger. - /// Triggers test scenarios that allow to replicate certain communication errors. Allowed values: * **NO_CONNECTION_AVAILABLE** – There wasn't a connection available to service the outgoing communication. This is a transient, retriable error since no messaging could be initiated to an issuing system (or third-party acquiring system). Therefore, the header Transient-Error: true is returned in the response. A subsequent request using the same idempotency key will be processed as if it was the first request. * **IOEXCEPTION_RECEIVED** – Something went wrong during transmission of the message or receiving the response. This is a classified as non-transient because the message could have been received by the issuing party and been acted upon. No transient error header is returned. If using idempotency, the (error) response is stored as the final result for the idempotency key. Subsequent messages with the same idempotency key not be processed beyond returning the stored response. - /// Set to true to authorise a part of the requested amount in case the cardholder does not have enough funds on their account. If a payment was partially authorised, the response includes resultCode: PartiallyAuthorised and the authorised amount in additionalData.authorisedAmountValue. To enable this functionality, contact our Support Team. - /// Flags a card payment request for either pre-authorisation or final authorisation. For more information, refer to [Authorisation types](https://docs.adyen.com/online-payments/adjust-authorisation#authorisation-types). Allowed values: * **PreAuth** – flags the payment request to be handled as a pre-authorisation. * **FinalAuth** – flags the payment request to be handled as a final authorisation. - /// Set to **true** to enable [Auto Rescue](https://docs.adyen.com/online-payments/auto-rescue/) for a transaction. Use the `maxDaysToRescue` to specify a rescue window. - /// Allows you to determine or override the acquirer account that should be used for the transaction. If you need to process a payment with an acquirer different from a default one, you can set up a corresponding configuration on the Adyen payments platform. Then you can pass a custom routing flag in a payment request's additional data to target a specific acquirer. To enable this functionality, contact [Support](https://www.adyen.help/hc/en-us/requests/new). - /// In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed. - /// Set to **true** to require [manual capture](https://docs.adyen.com/online-payments/capture) for the transaction. - /// The rescue window for a transaction, in days, when `autoRescue` is set to **true**. You can specify a value between 1 and 48. * For [cards](https://docs.adyen.com/online-payments/auto-rescue/cards/), the default is one calendar month. * For [SEPA](https://docs.adyen.com/online-payments/auto-rescue/sepa/), the default is 42 days. - /// Allows you to link the transaction to the original or previous one in a subscription/card-on-file chain. This field is required for token-based transactions where Adyen does not tokenize the card. Transaction identifier from card schemes, for example, Mastercard Trace ID or the Visa Transaction ID. Submit the original transaction ID of the contract in your payment request if you are not tokenizing card details with Adyen and are making a merchant-initiated transaction (MIT) for subsequent charges. Make sure you are sending `shopperInteraction` **ContAuth** and `recurringProcessingModel` **Subscription** or **UnscheduledCardOnFile** to ensure that the transaction is classified as MIT. - /// Boolean indicator that can be optionally used for performing debit transactions on combo cards (for example, combo cards in Brazil). This is not mandatory but we recommend that you set this to true if you want to use the `selectedBrand` value to specify how to process the transaction. - /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the city of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 13 characters. - /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the three-letter country code of the actual merchant's address. * Format: alpha-numeric. * Fixed length: 3 characters. - /// This field is required for transactions performed by registered payment facilitators. This field contains the email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters - /// This field contains an identifier of the actual merchant when a transaction is submitted via a payment facilitator. The payment facilitator must send in this unique ID. A unique identifier per submerchant that is required if the transaction is performed by a registered payment facilitator. * Format: alpha-numeric. * Fixed length: 15 characters. - /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the name of the actual merchant. * Format: alpha-numeric. * Maximum length: 22 characters. - /// This field is required for transactions performed by registered payment facilitators. This field contains the phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters - /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the postal code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 10 characters. - /// This field is required if the transaction is performed by a registered payment facilitator, and if applicable to the country. This field must contain the state code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 3 characters. - /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the street of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 60 characters. - /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the tax ID of the actual merchant. * Format: alpha-numeric. * Fixed length: 11 or 14 characters. - [JsonConstructor] - public AdditionalDataCommon(Option requestedTestAcquirerResponseCode = default, Option requestedTestErrorResponseCode = default, Option allowPartialAuth = default, Option authorisationType = default, Option autoRescue = default, Option customRoutingFlag = default, Option industryUsage = default, Option manualCapture = default, Option maxDaysToRescue = default, Option networkTxReference = default, Option overwriteBrand = default, Option subMerchantCity = default, Option subMerchantCountry = default, Option subMerchantEmail = default, Option subMerchantID = default, Option subMerchantName = default, Option subMerchantPhoneNumber = default, Option subMerchantPostalCode = default, Option subMerchantState = default, Option subMerchantStreet = default, Option subMerchantTaxId = default) - { - RequestedTestAcquirerResponseCodeOption = requestedTestAcquirerResponseCode; - RequestedTestErrorResponseCodeOption = requestedTestErrorResponseCode; - AllowPartialAuthOption = allowPartialAuth; - AuthorisationTypeOption = authorisationType; - AutoRescueOption = autoRescue; - CustomRoutingFlagOption = customRoutingFlag; - IndustryUsageOption = industryUsage; - ManualCaptureOption = manualCapture; - MaxDaysToRescueOption = maxDaysToRescue; - NetworkTxReferenceOption = networkTxReference; - OverwriteBrandOption = overwriteBrand; - SubMerchantCityOption = subMerchantCity; - SubMerchantCountryOption = subMerchantCountry; - SubMerchantEmailOption = subMerchantEmail; - SubMerchantIDOption = subMerchantID; - SubMerchantNameOption = subMerchantName; - SubMerchantPhoneNumberOption = subMerchantPhoneNumber; - SubMerchantPostalCodeOption = subMerchantPostalCode; - SubMerchantStateOption = subMerchantState; - SubMerchantStreetOption = subMerchantStreet; - SubMerchantTaxIdOption = subMerchantTaxId; - OnCreated(); - } - - partial void OnCreated(); - /// /// In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed. /// /// In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed. + [JsonConverter(typeof(StringEnumConverter))] public enum IndustryUsageEnum { /// /// Enum NoShow for value: NoShow /// + [EnumMember(Value = "NoShow")] NoShow = 1, /// /// Enum DelayedCharge for value: DelayedCharge /// + [EnumMember(Value = "DelayedCharge")] DelayedCharge = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static IndustryUsageEnum IndustryUsageEnumFromString(string value) - { - if (value.Equals("NoShow")) - return IndustryUsageEnum.NoShow; - - if (value.Equals("DelayedCharge")) - return IndustryUsageEnum.DelayedCharge; - - throw new NotImplementedException($"Could not convert value to type IndustryUsageEnum: '{value}'"); - } - /// - /// Returns a - /// - /// - /// - public static IndustryUsageEnum? IndustryUsageEnumFromStringOrDefault(string value) - { - if (value.Equals("NoShow")) - return IndustryUsageEnum.NoShow; - - if (value.Equals("DelayedCharge")) - return IndustryUsageEnum.DelayedCharge; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string IndustryUsageEnumToJsonValue(IndustryUsageEnum? value) - { - if (value == IndustryUsageEnum.NoShow) - return "NoShow"; - - if (value == IndustryUsageEnum.DelayedCharge) - return "DelayedCharge"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of IndustryUsage - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IndustryUsageOption { get; private set; } /// /// In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed. /// /// In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed. - [JsonPropertyName("industryUsage")] - public IndustryUsageEnum? IndustryUsage { get { return this.IndustryUsageOption; } set { this.IndustryUsageOption = new Option(value); } } - + [DataMember(Name = "industryUsage", EmitDefaultValue = false)] + public IndustryUsageEnum? IndustryUsage { get; set; } /// - /// Used to track the state of RequestedTestAcquirerResponseCode + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RequestedTestAcquirerResponseCodeOption { get; private set; } + /// Triggers test scenarios that allow to replicate certain acquirer response codes. See [Testing result codes and refusal reasons](https://docs.adyen.com/development-resources/testing/result-codes/) to learn about the possible values, and the `refusalReason` values you can trigger. . + /// Triggers test scenarios that allow to replicate certain communication errors. Allowed values: * **NO_CONNECTION_AVAILABLE** – There wasn't a connection available to service the outgoing communication. This is a transient, retriable error since no messaging could be initiated to an issuing system (or third-party acquiring system). Therefore, the header Transient-Error: true is returned in the response. A subsequent request using the same idempotency key will be processed as if it was the first request. * **IOEXCEPTION_RECEIVED** – Something went wrong during transmission of the message or receiving the response. This is a classified as non-transient because the message could have been received by the issuing party and been acted upon. No transient error header is returned. If using idempotency, the (error) response is stored as the final result for the idempotency key. Subsequent messages with the same idempotency key not be processed beyond returning the stored response.. + /// Set to true to authorise a part of the requested amount in case the cardholder does not have enough funds on their account. If a payment was partially authorised, the response includes resultCode: PartiallyAuthorised and the authorised amount in additionalData.authorisedAmountValue. To enable this functionality, contact our Support Team.. + /// Flags a card payment request for either pre-authorisation or final authorisation. For more information, refer to [Authorisation types](https://docs.adyen.com/online-payments/adjust-authorisation#authorisation-types). Allowed values: * **PreAuth** – flags the payment request to be handled as a pre-authorisation. * **FinalAuth** – flags the payment request to be handled as a final authorisation.. + /// Set to **true** to enable [Auto Rescue](https://docs.adyen.com/online-payments/auto-rescue/) for a transaction. Use the `maxDaysToRescue` to specify a rescue window.. + /// Allows you to determine or override the acquirer account that should be used for the transaction. If you need to process a payment with an acquirer different from a default one, you can set up a corresponding configuration on the Adyen payments platform. Then you can pass a custom routing flag in a payment request's additional data to target a specific acquirer. To enable this functionality, contact [Support](https://www.adyen.help/hc/en-us/requests/new).. + /// In case of [asynchronous authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), this field denotes why the additional payment is made. Possible values: * **NoShow**: An incremental charge is carried out because of a no-show for a guaranteed reservation. * **DelayedCharge**: An incremental charge is carried out to process an additional payment after the original services have been rendered and the respective payment has been processed.. + /// Set to **true** to require [manual capture](https://docs.adyen.com/online-payments/capture) for the transaction.. + /// The rescue window for a transaction, in days, when `autoRescue` is set to **true**. You can specify a value between 1 and 48. * For [cards](https://docs.adyen.com/online-payments/auto-rescue/cards/), the default is one calendar month. * For [SEPA](https://docs.adyen.com/online-payments/auto-rescue/sepa/), the default is 42 days.. + /// Allows you to link the transaction to the original or previous one in a subscription/card-on-file chain. This field is required for token-based transactions where Adyen does not tokenize the card. Transaction identifier from card schemes, for example, Mastercard Trace ID or the Visa Transaction ID. Submit the original transaction ID of the contract in your payment request if you are not tokenizing card details with Adyen and are making a merchant-initiated transaction (MIT) for subsequent charges. Make sure you are sending `shopperInteraction` **ContAuth** and `recurringProcessingModel` **Subscription** or **UnscheduledCardOnFile** to ensure that the transaction is classified as MIT.. + /// Boolean indicator that can be optionally used for performing debit transactions on combo cards (for example, combo cards in Brazil). This is not mandatory but we recommend that you set this to true if you want to use the `selectedBrand` value to specify how to process the transaction.. + /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the city of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 13 characters.. + /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the three-letter country code of the actual merchant's address. * Format: alpha-numeric. * Fixed length: 3 characters.. + /// This field is required for transactions performed by registered payment facilitators. This field contains the email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters. + /// This field contains an identifier of the actual merchant when a transaction is submitted via a payment facilitator. The payment facilitator must send in this unique ID. A unique identifier per submerchant that is required if the transaction is performed by a registered payment facilitator. * Format: alpha-numeric. * Fixed length: 15 characters.. + /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the name of the actual merchant. * Format: alpha-numeric. * Maximum length: 22 characters.. + /// This field is required for transactions performed by registered payment facilitators. This field contains the phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters. + /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the postal code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 10 characters.. + /// This field is required if the transaction is performed by a registered payment facilitator, and if applicable to the country. This field must contain the state code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 3 characters.. + /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the street of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 60 characters.. + /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the tax ID of the actual merchant. * Format: alpha-numeric. * Fixed length: 11 or 14 characters.. + public AdditionalDataCommon(string requestedTestAcquirerResponseCode = default(string), string requestedTestErrorResponseCode = default(string), string allowPartialAuth = default(string), string authorisationType = default(string), string autoRescue = default(string), string customRoutingFlag = default(string), IndustryUsageEnum? industryUsage = default(IndustryUsageEnum?), string manualCapture = default(string), string maxDaysToRescue = default(string), string networkTxReference = default(string), string overwriteBrand = default(string), string subMerchantCity = default(string), string subMerchantCountry = default(string), string subMerchantEmail = default(string), string subMerchantID = default(string), string subMerchantName = default(string), string subMerchantPhoneNumber = default(string), string subMerchantPostalCode = default(string), string subMerchantState = default(string), string subMerchantStreet = default(string), string subMerchantTaxId = default(string)) + { + this.RequestedTestAcquirerResponseCode = requestedTestAcquirerResponseCode; + this.RequestedTestErrorResponseCode = requestedTestErrorResponseCode; + this.AllowPartialAuth = allowPartialAuth; + this.AuthorisationType = authorisationType; + this.AutoRescue = autoRescue; + this.CustomRoutingFlag = customRoutingFlag; + this.IndustryUsage = industryUsage; + this.ManualCapture = manualCapture; + this.MaxDaysToRescue = maxDaysToRescue; + this.NetworkTxReference = networkTxReference; + this.OverwriteBrand = overwriteBrand; + this.SubMerchantCity = subMerchantCity; + this.SubMerchantCountry = subMerchantCountry; + this.SubMerchantEmail = subMerchantEmail; + this.SubMerchantID = subMerchantID; + this.SubMerchantName = subMerchantName; + this.SubMerchantPhoneNumber = subMerchantPhoneNumber; + this.SubMerchantPostalCode = subMerchantPostalCode; + this.SubMerchantState = subMerchantState; + this.SubMerchantStreet = subMerchantStreet; + this.SubMerchantTaxId = subMerchantTaxId; + } /// /// Triggers test scenarios that allow to replicate certain acquirer response codes. See [Testing result codes and refusal reasons](https://docs.adyen.com/development-resources/testing/result-codes/) to learn about the possible values, and the `refusalReason` values you can trigger. /// /// Triggers test scenarios that allow to replicate certain acquirer response codes. See [Testing result codes and refusal reasons](https://docs.adyen.com/development-resources/testing/result-codes/) to learn about the possible values, and the `refusalReason` values you can trigger. - [JsonPropertyName("RequestedTestAcquirerResponseCode")] - public string RequestedTestAcquirerResponseCode { get { return this.RequestedTestAcquirerResponseCodeOption; } set { this.RequestedTestAcquirerResponseCodeOption = new Option(value); } } - - /// - /// Used to track the state of RequestedTestErrorResponseCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RequestedTestErrorResponseCodeOption { get; private set; } + [DataMember(Name = "RequestedTestAcquirerResponseCode", EmitDefaultValue = false)] + public string RequestedTestAcquirerResponseCode { get; set; } /// /// Triggers test scenarios that allow to replicate certain communication errors. Allowed values: * **NO_CONNECTION_AVAILABLE** – There wasn't a connection available to service the outgoing communication. This is a transient, retriable error since no messaging could be initiated to an issuing system (or third-party acquiring system). Therefore, the header Transient-Error: true is returned in the response. A subsequent request using the same idempotency key will be processed as if it was the first request. * **IOEXCEPTION_RECEIVED** – Something went wrong during transmission of the message or receiving the response. This is a classified as non-transient because the message could have been received by the issuing party and been acted upon. No transient error header is returned. If using idempotency, the (error) response is stored as the final result for the idempotency key. Subsequent messages with the same idempotency key not be processed beyond returning the stored response. /// /// Triggers test scenarios that allow to replicate certain communication errors. Allowed values: * **NO_CONNECTION_AVAILABLE** – There wasn't a connection available to service the outgoing communication. This is a transient, retriable error since no messaging could be initiated to an issuing system (or third-party acquiring system). Therefore, the header Transient-Error: true is returned in the response. A subsequent request using the same idempotency key will be processed as if it was the first request. * **IOEXCEPTION_RECEIVED** – Something went wrong during transmission of the message or receiving the response. This is a classified as non-transient because the message could have been received by the issuing party and been acted upon. No transient error header is returned. If using idempotency, the (error) response is stored as the final result for the idempotency key. Subsequent messages with the same idempotency key not be processed beyond returning the stored response. - [JsonPropertyName("RequestedTestErrorResponseCode")] - public string RequestedTestErrorResponseCode { get { return this.RequestedTestErrorResponseCodeOption; } set { this.RequestedTestErrorResponseCodeOption = new Option(value); } } - - /// - /// Used to track the state of AllowPartialAuth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AllowPartialAuthOption { get; private set; } + [DataMember(Name = "RequestedTestErrorResponseCode", EmitDefaultValue = false)] + public string RequestedTestErrorResponseCode { get; set; } /// /// Set to true to authorise a part of the requested amount in case the cardholder does not have enough funds on their account. If a payment was partially authorised, the response includes resultCode: PartiallyAuthorised and the authorised amount in additionalData.authorisedAmountValue. To enable this functionality, contact our Support Team. /// /// Set to true to authorise a part of the requested amount in case the cardholder does not have enough funds on their account. If a payment was partially authorised, the response includes resultCode: PartiallyAuthorised and the authorised amount in additionalData.authorisedAmountValue. To enable this functionality, contact our Support Team. - [JsonPropertyName("allowPartialAuth")] - public string AllowPartialAuth { get { return this.AllowPartialAuthOption; } set { this.AllowPartialAuthOption = new Option(value); } } - - /// - /// Used to track the state of AuthorisationType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthorisationTypeOption { get; private set; } + [DataMember(Name = "allowPartialAuth", EmitDefaultValue = false)] + public string AllowPartialAuth { get; set; } /// /// Flags a card payment request for either pre-authorisation or final authorisation. For more information, refer to [Authorisation types](https://docs.adyen.com/online-payments/adjust-authorisation#authorisation-types). Allowed values: * **PreAuth** – flags the payment request to be handled as a pre-authorisation. * **FinalAuth** – flags the payment request to be handled as a final authorisation. /// /// Flags a card payment request for either pre-authorisation or final authorisation. For more information, refer to [Authorisation types](https://docs.adyen.com/online-payments/adjust-authorisation#authorisation-types). Allowed values: * **PreAuth** – flags the payment request to be handled as a pre-authorisation. * **FinalAuth** – flags the payment request to be handled as a final authorisation. - [JsonPropertyName("authorisationType")] - public string AuthorisationType { get { return this.AuthorisationTypeOption; } set { this.AuthorisationTypeOption = new Option(value); } } - - /// - /// Used to track the state of AutoRescue - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AutoRescueOption { get; private set; } + [DataMember(Name = "authorisationType", EmitDefaultValue = false)] + public string AuthorisationType { get; set; } /// /// Set to **true** to enable [Auto Rescue](https://docs.adyen.com/online-payments/auto-rescue/) for a transaction. Use the `maxDaysToRescue` to specify a rescue window. /// /// Set to **true** to enable [Auto Rescue](https://docs.adyen.com/online-payments/auto-rescue/) for a transaction. Use the `maxDaysToRescue` to specify a rescue window. - [JsonPropertyName("autoRescue")] - public string AutoRescue { get { return this.AutoRescueOption; } set { this.AutoRescueOption = new Option(value); } } - - /// - /// Used to track the state of CustomRoutingFlag - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CustomRoutingFlagOption { get; private set; } + [DataMember(Name = "autoRescue", EmitDefaultValue = false)] + public string AutoRescue { get; set; } /// /// Allows you to determine or override the acquirer account that should be used for the transaction. If you need to process a payment with an acquirer different from a default one, you can set up a corresponding configuration on the Adyen payments platform. Then you can pass a custom routing flag in a payment request's additional data to target a specific acquirer. To enable this functionality, contact [Support](https://www.adyen.help/hc/en-us/requests/new). /// /// Allows you to determine or override the acquirer account that should be used for the transaction. If you need to process a payment with an acquirer different from a default one, you can set up a corresponding configuration on the Adyen payments platform. Then you can pass a custom routing flag in a payment request's additional data to target a specific acquirer. To enable this functionality, contact [Support](https://www.adyen.help/hc/en-us/requests/new). - [JsonPropertyName("customRoutingFlag")] - public string CustomRoutingFlag { get { return this.CustomRoutingFlagOption; } set { this.CustomRoutingFlagOption = new Option(value); } } - - /// - /// Used to track the state of ManualCapture - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ManualCaptureOption { get; private set; } + [DataMember(Name = "customRoutingFlag", EmitDefaultValue = false)] + public string CustomRoutingFlag { get; set; } /// /// Set to **true** to require [manual capture](https://docs.adyen.com/online-payments/capture) for the transaction. /// /// Set to **true** to require [manual capture](https://docs.adyen.com/online-payments/capture) for the transaction. - [JsonPropertyName("manualCapture")] - public string ManualCapture { get { return this.ManualCaptureOption; } set { this.ManualCaptureOption = new Option(value); } } - - /// - /// Used to track the state of MaxDaysToRescue - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MaxDaysToRescueOption { get; private set; } + [DataMember(Name = "manualCapture", EmitDefaultValue = false)] + public string ManualCapture { get; set; } /// /// The rescue window for a transaction, in days, when `autoRescue` is set to **true**. You can specify a value between 1 and 48. * For [cards](https://docs.adyen.com/online-payments/auto-rescue/cards/), the default is one calendar month. * For [SEPA](https://docs.adyen.com/online-payments/auto-rescue/sepa/), the default is 42 days. /// /// The rescue window for a transaction, in days, when `autoRescue` is set to **true**. You can specify a value between 1 and 48. * For [cards](https://docs.adyen.com/online-payments/auto-rescue/cards/), the default is one calendar month. * For [SEPA](https://docs.adyen.com/online-payments/auto-rescue/sepa/), the default is 42 days. - [JsonPropertyName("maxDaysToRescue")] - public string MaxDaysToRescue { get { return this.MaxDaysToRescueOption; } set { this.MaxDaysToRescueOption = new Option(value); } } - - /// - /// Used to track the state of NetworkTxReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NetworkTxReferenceOption { get; private set; } + [DataMember(Name = "maxDaysToRescue", EmitDefaultValue = false)] + public string MaxDaysToRescue { get; set; } /// /// Allows you to link the transaction to the original or previous one in a subscription/card-on-file chain. This field is required for token-based transactions where Adyen does not tokenize the card. Transaction identifier from card schemes, for example, Mastercard Trace ID or the Visa Transaction ID. Submit the original transaction ID of the contract in your payment request if you are not tokenizing card details with Adyen and are making a merchant-initiated transaction (MIT) for subsequent charges. Make sure you are sending `shopperInteraction` **ContAuth** and `recurringProcessingModel` **Subscription** or **UnscheduledCardOnFile** to ensure that the transaction is classified as MIT. /// /// Allows you to link the transaction to the original or previous one in a subscription/card-on-file chain. This field is required for token-based transactions where Adyen does not tokenize the card. Transaction identifier from card schemes, for example, Mastercard Trace ID or the Visa Transaction ID. Submit the original transaction ID of the contract in your payment request if you are not tokenizing card details with Adyen and are making a merchant-initiated transaction (MIT) for subsequent charges. Make sure you are sending `shopperInteraction` **ContAuth** and `recurringProcessingModel` **Subscription** or **UnscheduledCardOnFile** to ensure that the transaction is classified as MIT. - [JsonPropertyName("networkTxReference")] - public string NetworkTxReference { get { return this.NetworkTxReferenceOption; } set { this.NetworkTxReferenceOption = new Option(value); } } - - /// - /// Used to track the state of OverwriteBrand - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OverwriteBrandOption { get; private set; } + [DataMember(Name = "networkTxReference", EmitDefaultValue = false)] + public string NetworkTxReference { get; set; } /// /// Boolean indicator that can be optionally used for performing debit transactions on combo cards (for example, combo cards in Brazil). This is not mandatory but we recommend that you set this to true if you want to use the `selectedBrand` value to specify how to process the transaction. /// /// Boolean indicator that can be optionally used for performing debit transactions on combo cards (for example, combo cards in Brazil). This is not mandatory but we recommend that you set this to true if you want to use the `selectedBrand` value to specify how to process the transaction. - [JsonPropertyName("overwriteBrand")] - public string OverwriteBrand { get { return this.OverwriteBrandOption; } set { this.OverwriteBrandOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantCity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantCityOption { get; private set; } + [DataMember(Name = "overwriteBrand", EmitDefaultValue = false)] + public string OverwriteBrand { get; set; } /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the city of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 13 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the city of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 13 characters. - [JsonPropertyName("subMerchantCity")] - public string SubMerchantCity { get { return this.SubMerchantCityOption; } set { this.SubMerchantCityOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantCountry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantCountryOption { get; private set; } + [DataMember(Name = "subMerchantCity", EmitDefaultValue = false)] + public string SubMerchantCity { get; set; } /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the three-letter country code of the actual merchant's address. * Format: alpha-numeric. * Fixed length: 3 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the three-letter country code of the actual merchant's address. * Format: alpha-numeric. * Fixed length: 3 characters. - [JsonPropertyName("subMerchantCountry")] - public string SubMerchantCountry { get { return this.SubMerchantCountryOption; } set { this.SubMerchantCountryOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantEmailOption { get; private set; } + [DataMember(Name = "subMerchantCountry", EmitDefaultValue = false)] + public string SubMerchantCountry { get; set; } /// /// This field is required for transactions performed by registered payment facilitators. This field contains the email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters /// /// This field is required for transactions performed by registered payment facilitators. This field contains the email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters - [JsonPropertyName("subMerchantEmail")] - public string SubMerchantEmail { get { return this.SubMerchantEmailOption; } set { this.SubMerchantEmailOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantIDOption { get; private set; } + [DataMember(Name = "subMerchantEmail", EmitDefaultValue = false)] + public string SubMerchantEmail { get; set; } /// /// This field contains an identifier of the actual merchant when a transaction is submitted via a payment facilitator. The payment facilitator must send in this unique ID. A unique identifier per submerchant that is required if the transaction is performed by a registered payment facilitator. * Format: alpha-numeric. * Fixed length: 15 characters. /// /// This field contains an identifier of the actual merchant when a transaction is submitted via a payment facilitator. The payment facilitator must send in this unique ID. A unique identifier per submerchant that is required if the transaction is performed by a registered payment facilitator. * Format: alpha-numeric. * Fixed length: 15 characters. - [JsonPropertyName("subMerchantID")] - public string SubMerchantID { get { return this.SubMerchantIDOption; } set { this.SubMerchantIDOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantNameOption { get; private set; } + [DataMember(Name = "subMerchantID", EmitDefaultValue = false)] + public string SubMerchantID { get; set; } /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the name of the actual merchant. * Format: alpha-numeric. * Maximum length: 22 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the name of the actual merchant. * Format: alpha-numeric. * Maximum length: 22 characters. - [JsonPropertyName("subMerchantName")] - public string SubMerchantName { get { return this.SubMerchantNameOption; } set { this.SubMerchantNameOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantPhoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantPhoneNumberOption { get; private set; } + [DataMember(Name = "subMerchantName", EmitDefaultValue = false)] + public string SubMerchantName { get; set; } /// /// This field is required for transactions performed by registered payment facilitators. This field contains the phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters /// /// This field is required for transactions performed by registered payment facilitators. This field contains the phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters - [JsonPropertyName("subMerchantPhoneNumber")] - public string SubMerchantPhoneNumber { get { return this.SubMerchantPhoneNumberOption; } set { this.SubMerchantPhoneNumberOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantPostalCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantPostalCodeOption { get; private set; } + [DataMember(Name = "subMerchantPhoneNumber", EmitDefaultValue = false)] + public string SubMerchantPhoneNumber { get; set; } /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the postal code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 10 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the postal code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 10 characters. - [JsonPropertyName("subMerchantPostalCode")] - public string SubMerchantPostalCode { get { return this.SubMerchantPostalCodeOption; } set { this.SubMerchantPostalCodeOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantState - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantStateOption { get; private set; } + [DataMember(Name = "subMerchantPostalCode", EmitDefaultValue = false)] + public string SubMerchantPostalCode { get; set; } /// /// This field is required if the transaction is performed by a registered payment facilitator, and if applicable to the country. This field must contain the state code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 3 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator, and if applicable to the country. This field must contain the state code of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 3 characters. - [JsonPropertyName("subMerchantState")] - public string SubMerchantState { get { return this.SubMerchantStateOption; } set { this.SubMerchantStateOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantStreet - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantStreetOption { get; private set; } + [DataMember(Name = "subMerchantState", EmitDefaultValue = false)] + public string SubMerchantState { get; set; } /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the street of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 60 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the street of the actual merchant's address. * Format: alpha-numeric. * Maximum length: 60 characters. - [JsonPropertyName("subMerchantStreet")] - public string SubMerchantStreet { get { return this.SubMerchantStreetOption; } set { this.SubMerchantStreetOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantTaxId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantTaxIdOption { get; private set; } + [DataMember(Name = "subMerchantStreet", EmitDefaultValue = false)] + public string SubMerchantStreet { get; set; } /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the tax ID of the actual merchant. * Format: alpha-numeric. * Fixed length: 11 or 14 characters. /// /// This field is required if the transaction is performed by a registered payment facilitator. This field must contain the tax ID of the actual merchant. * Format: alpha-numeric. * Fixed length: 11 or 14 characters. - [JsonPropertyName("subMerchantTaxId")] - public string SubMerchantTaxId { get { return this.SubMerchantTaxIdOption; } set { this.SubMerchantTaxIdOption = new Option(value); } } + [DataMember(Name = "subMerchantTaxId", EmitDefaultValue = false)] + public string SubMerchantTaxId { get; set; } /// /// Returns the string presentation of the object @@ -476,357 +283,244 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataCommonJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataCommon Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option requestedTestAcquirerResponseCode = default; - Option requestedTestErrorResponseCode = default; - Option allowPartialAuth = default; - Option authorisationType = default; - Option autoRescue = default; - Option customRoutingFlag = default; - Option industryUsage = default; - Option manualCapture = default; - Option maxDaysToRescue = default; - Option networkTxReference = default; - Option overwriteBrand = default; - Option subMerchantCity = default; - Option subMerchantCountry = default; - Option subMerchantEmail = default; - Option subMerchantID = default; - Option subMerchantName = default; - Option subMerchantPhoneNumber = default; - Option subMerchantPostalCode = default; - Option subMerchantState = default; - Option subMerchantStreet = default; - Option subMerchantTaxId = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; + return this.Equals(input as AdditionalDataCommon); + } - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "RequestedTestAcquirerResponseCode": - requestedTestAcquirerResponseCode = new Option(utf8JsonReader.GetString()); - break; - case "RequestedTestErrorResponseCode": - requestedTestErrorResponseCode = new Option(utf8JsonReader.GetString()); - break; - case "allowPartialAuth": - allowPartialAuth = new Option(utf8JsonReader.GetString()); - break; - case "authorisationType": - authorisationType = new Option(utf8JsonReader.GetString()); - break; - case "autoRescue": - autoRescue = new Option(utf8JsonReader.GetString()); - break; - case "customRoutingFlag": - customRoutingFlag = new Option(utf8JsonReader.GetString()); - break; - case "industryUsage": - string industryUsageRawValue = utf8JsonReader.GetString(); - if (industryUsageRawValue != null) - industryUsage = new Option(AdditionalDataCommon.IndustryUsageEnumFromStringOrDefault(industryUsageRawValue)); - break; - case "manualCapture": - manualCapture = new Option(utf8JsonReader.GetString()); - break; - case "maxDaysToRescue": - maxDaysToRescue = new Option(utf8JsonReader.GetString()); - break; - case "networkTxReference": - networkTxReference = new Option(utf8JsonReader.GetString()); - break; - case "overwriteBrand": - overwriteBrand = new Option(utf8JsonReader.GetString()); - break; - case "subMerchantCity": - subMerchantCity = new Option(utf8JsonReader.GetString()); - break; - case "subMerchantCountry": - subMerchantCountry = new Option(utf8JsonReader.GetString()); - break; - case "subMerchantEmail": - subMerchantEmail = new Option(utf8JsonReader.GetString()); - break; - case "subMerchantID": - subMerchantID = new Option(utf8JsonReader.GetString()); - break; - case "subMerchantName": - subMerchantName = new Option(utf8JsonReader.GetString()); - break; - case "subMerchantPhoneNumber": - subMerchantPhoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "subMerchantPostalCode": - subMerchantPostalCode = new Option(utf8JsonReader.GetString()); - break; - case "subMerchantState": - subMerchantState = new Option(utf8JsonReader.GetString()); - break; - case "subMerchantStreet": - subMerchantStreet = new Option(utf8JsonReader.GetString()); - break; - case "subMerchantTaxId": - subMerchantTaxId = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + /// + /// Returns true if AdditionalDataCommon instances are equal + /// + /// Instance of AdditionalDataCommon to be compared + /// Boolean + public bool Equals(AdditionalDataCommon input) + { + if (input == null) + { + return false; } - - if (requestedTestAcquirerResponseCode.IsSet && requestedTestAcquirerResponseCode.Value == null) - throw new ArgumentNullException(nameof(requestedTestAcquirerResponseCode), "Property is not nullable for class AdditionalDataCommon."); - - if (requestedTestErrorResponseCode.IsSet && requestedTestErrorResponseCode.Value == null) - throw new ArgumentNullException(nameof(requestedTestErrorResponseCode), "Property is not nullable for class AdditionalDataCommon."); - - if (allowPartialAuth.IsSet && allowPartialAuth.Value == null) - throw new ArgumentNullException(nameof(allowPartialAuth), "Property is not nullable for class AdditionalDataCommon."); - - if (authorisationType.IsSet && authorisationType.Value == null) - throw new ArgumentNullException(nameof(authorisationType), "Property is not nullable for class AdditionalDataCommon."); - - if (autoRescue.IsSet && autoRescue.Value == null) - throw new ArgumentNullException(nameof(autoRescue), "Property is not nullable for class AdditionalDataCommon."); - - if (customRoutingFlag.IsSet && customRoutingFlag.Value == null) - throw new ArgumentNullException(nameof(customRoutingFlag), "Property is not nullable for class AdditionalDataCommon."); - - if (industryUsage.IsSet && industryUsage.Value == null) - throw new ArgumentNullException(nameof(industryUsage), "Property is not nullable for class AdditionalDataCommon."); - - if (manualCapture.IsSet && manualCapture.Value == null) - throw new ArgumentNullException(nameof(manualCapture), "Property is not nullable for class AdditionalDataCommon."); - - if (maxDaysToRescue.IsSet && maxDaysToRescue.Value == null) - throw new ArgumentNullException(nameof(maxDaysToRescue), "Property is not nullable for class AdditionalDataCommon."); - - if (networkTxReference.IsSet && networkTxReference.Value == null) - throw new ArgumentNullException(nameof(networkTxReference), "Property is not nullable for class AdditionalDataCommon."); - - if (overwriteBrand.IsSet && overwriteBrand.Value == null) - throw new ArgumentNullException(nameof(overwriteBrand), "Property is not nullable for class AdditionalDataCommon."); - - if (subMerchantCity.IsSet && subMerchantCity.Value == null) - throw new ArgumentNullException(nameof(subMerchantCity), "Property is not nullable for class AdditionalDataCommon."); - - if (subMerchantCountry.IsSet && subMerchantCountry.Value == null) - throw new ArgumentNullException(nameof(subMerchantCountry), "Property is not nullable for class AdditionalDataCommon."); - - if (subMerchantEmail.IsSet && subMerchantEmail.Value == null) - throw new ArgumentNullException(nameof(subMerchantEmail), "Property is not nullable for class AdditionalDataCommon."); - - if (subMerchantID.IsSet && subMerchantID.Value == null) - throw new ArgumentNullException(nameof(subMerchantID), "Property is not nullable for class AdditionalDataCommon."); - - if (subMerchantName.IsSet && subMerchantName.Value == null) - throw new ArgumentNullException(nameof(subMerchantName), "Property is not nullable for class AdditionalDataCommon."); - - if (subMerchantPhoneNumber.IsSet && subMerchantPhoneNumber.Value == null) - throw new ArgumentNullException(nameof(subMerchantPhoneNumber), "Property is not nullable for class AdditionalDataCommon."); - - if (subMerchantPostalCode.IsSet && subMerchantPostalCode.Value == null) - throw new ArgumentNullException(nameof(subMerchantPostalCode), "Property is not nullable for class AdditionalDataCommon."); - - if (subMerchantState.IsSet && subMerchantState.Value == null) - throw new ArgumentNullException(nameof(subMerchantState), "Property is not nullable for class AdditionalDataCommon."); - - if (subMerchantStreet.IsSet && subMerchantStreet.Value == null) - throw new ArgumentNullException(nameof(subMerchantStreet), "Property is not nullable for class AdditionalDataCommon."); - - if (subMerchantTaxId.IsSet && subMerchantTaxId.Value == null) - throw new ArgumentNullException(nameof(subMerchantTaxId), "Property is not nullable for class AdditionalDataCommon."); - - return new AdditionalDataCommon(requestedTestAcquirerResponseCode, requestedTestErrorResponseCode, allowPartialAuth, authorisationType, autoRescue, customRoutingFlag, industryUsage, manualCapture, maxDaysToRescue, networkTxReference, overwriteBrand, subMerchantCity, subMerchantCountry, subMerchantEmail, subMerchantID, subMerchantName, subMerchantPhoneNumber, subMerchantPostalCode, subMerchantState, subMerchantStreet, subMerchantTaxId); + return + ( + this.RequestedTestAcquirerResponseCode == input.RequestedTestAcquirerResponseCode || + (this.RequestedTestAcquirerResponseCode != null && + this.RequestedTestAcquirerResponseCode.Equals(input.RequestedTestAcquirerResponseCode)) + ) && + ( + this.RequestedTestErrorResponseCode == input.RequestedTestErrorResponseCode || + (this.RequestedTestErrorResponseCode != null && + this.RequestedTestErrorResponseCode.Equals(input.RequestedTestErrorResponseCode)) + ) && + ( + this.AllowPartialAuth == input.AllowPartialAuth || + (this.AllowPartialAuth != null && + this.AllowPartialAuth.Equals(input.AllowPartialAuth)) + ) && + ( + this.AuthorisationType == input.AuthorisationType || + (this.AuthorisationType != null && + this.AuthorisationType.Equals(input.AuthorisationType)) + ) && + ( + this.AutoRescue == input.AutoRescue || + (this.AutoRescue != null && + this.AutoRescue.Equals(input.AutoRescue)) + ) && + ( + this.CustomRoutingFlag == input.CustomRoutingFlag || + (this.CustomRoutingFlag != null && + this.CustomRoutingFlag.Equals(input.CustomRoutingFlag)) + ) && + ( + this.IndustryUsage == input.IndustryUsage || + this.IndustryUsage.Equals(input.IndustryUsage) + ) && + ( + this.ManualCapture == input.ManualCapture || + (this.ManualCapture != null && + this.ManualCapture.Equals(input.ManualCapture)) + ) && + ( + this.MaxDaysToRescue == input.MaxDaysToRescue || + (this.MaxDaysToRescue != null && + this.MaxDaysToRescue.Equals(input.MaxDaysToRescue)) + ) && + ( + this.NetworkTxReference == input.NetworkTxReference || + (this.NetworkTxReference != null && + this.NetworkTxReference.Equals(input.NetworkTxReference)) + ) && + ( + this.OverwriteBrand == input.OverwriteBrand || + (this.OverwriteBrand != null && + this.OverwriteBrand.Equals(input.OverwriteBrand)) + ) && + ( + this.SubMerchantCity == input.SubMerchantCity || + (this.SubMerchantCity != null && + this.SubMerchantCity.Equals(input.SubMerchantCity)) + ) && + ( + this.SubMerchantCountry == input.SubMerchantCountry || + (this.SubMerchantCountry != null && + this.SubMerchantCountry.Equals(input.SubMerchantCountry)) + ) && + ( + this.SubMerchantEmail == input.SubMerchantEmail || + (this.SubMerchantEmail != null && + this.SubMerchantEmail.Equals(input.SubMerchantEmail)) + ) && + ( + this.SubMerchantID == input.SubMerchantID || + (this.SubMerchantID != null && + this.SubMerchantID.Equals(input.SubMerchantID)) + ) && + ( + this.SubMerchantName == input.SubMerchantName || + (this.SubMerchantName != null && + this.SubMerchantName.Equals(input.SubMerchantName)) + ) && + ( + this.SubMerchantPhoneNumber == input.SubMerchantPhoneNumber || + (this.SubMerchantPhoneNumber != null && + this.SubMerchantPhoneNumber.Equals(input.SubMerchantPhoneNumber)) + ) && + ( + this.SubMerchantPostalCode == input.SubMerchantPostalCode || + (this.SubMerchantPostalCode != null && + this.SubMerchantPostalCode.Equals(input.SubMerchantPostalCode)) + ) && + ( + this.SubMerchantState == input.SubMerchantState || + (this.SubMerchantState != null && + this.SubMerchantState.Equals(input.SubMerchantState)) + ) && + ( + this.SubMerchantStreet == input.SubMerchantStreet || + (this.SubMerchantStreet != null && + this.SubMerchantStreet.Equals(input.SubMerchantStreet)) + ) && + ( + this.SubMerchantTaxId == input.SubMerchantTaxId || + (this.SubMerchantTaxId != null && + this.SubMerchantTaxId.Equals(input.SubMerchantTaxId)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataCommon additionalDataCommon, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataCommon, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.RequestedTestAcquirerResponseCode != null) + { + hashCode = (hashCode * 59) + this.RequestedTestAcquirerResponseCode.GetHashCode(); + } + if (this.RequestedTestErrorResponseCode != null) + { + hashCode = (hashCode * 59) + this.RequestedTestErrorResponseCode.GetHashCode(); + } + if (this.AllowPartialAuth != null) + { + hashCode = (hashCode * 59) + this.AllowPartialAuth.GetHashCode(); + } + if (this.AuthorisationType != null) + { + hashCode = (hashCode * 59) + this.AuthorisationType.GetHashCode(); + } + if (this.AutoRescue != null) + { + hashCode = (hashCode * 59) + this.AutoRescue.GetHashCode(); + } + if (this.CustomRoutingFlag != null) + { + hashCode = (hashCode * 59) + this.CustomRoutingFlag.GetHashCode(); + } + hashCode = (hashCode * 59) + this.IndustryUsage.GetHashCode(); + if (this.ManualCapture != null) + { + hashCode = (hashCode * 59) + this.ManualCapture.GetHashCode(); + } + if (this.MaxDaysToRescue != null) + { + hashCode = (hashCode * 59) + this.MaxDaysToRescue.GetHashCode(); + } + if (this.NetworkTxReference != null) + { + hashCode = (hashCode * 59) + this.NetworkTxReference.GetHashCode(); + } + if (this.OverwriteBrand != null) + { + hashCode = (hashCode * 59) + this.OverwriteBrand.GetHashCode(); + } + if (this.SubMerchantCity != null) + { + hashCode = (hashCode * 59) + this.SubMerchantCity.GetHashCode(); + } + if (this.SubMerchantCountry != null) + { + hashCode = (hashCode * 59) + this.SubMerchantCountry.GetHashCode(); + } + if (this.SubMerchantEmail != null) + { + hashCode = (hashCode * 59) + this.SubMerchantEmail.GetHashCode(); + } + if (this.SubMerchantID != null) + { + hashCode = (hashCode * 59) + this.SubMerchantID.GetHashCode(); + } + if (this.SubMerchantName != null) + { + hashCode = (hashCode * 59) + this.SubMerchantName.GetHashCode(); + } + if (this.SubMerchantPhoneNumber != null) + { + hashCode = (hashCode * 59) + this.SubMerchantPhoneNumber.GetHashCode(); + } + if (this.SubMerchantPostalCode != null) + { + hashCode = (hashCode * 59) + this.SubMerchantPostalCode.GetHashCode(); + } + if (this.SubMerchantState != null) + { + hashCode = (hashCode * 59) + this.SubMerchantState.GetHashCode(); + } + if (this.SubMerchantStreet != null) + { + hashCode = (hashCode * 59) + this.SubMerchantStreet.GetHashCode(); + } + if (this.SubMerchantTaxId != null) + { + hashCode = (hashCode * 59) + this.SubMerchantTaxId.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataCommon additionalDataCommon, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataCommon.RequestedTestAcquirerResponseCodeOption.IsSet && additionalDataCommon.RequestedTestAcquirerResponseCode == null) - throw new ArgumentNullException(nameof(additionalDataCommon.RequestedTestAcquirerResponseCode), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.RequestedTestErrorResponseCodeOption.IsSet && additionalDataCommon.RequestedTestErrorResponseCode == null) - throw new ArgumentNullException(nameof(additionalDataCommon.RequestedTestErrorResponseCode), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.AllowPartialAuthOption.IsSet && additionalDataCommon.AllowPartialAuth == null) - throw new ArgumentNullException(nameof(additionalDataCommon.AllowPartialAuth), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.AuthorisationTypeOption.IsSet && additionalDataCommon.AuthorisationType == null) - throw new ArgumentNullException(nameof(additionalDataCommon.AuthorisationType), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.AutoRescueOption.IsSet && additionalDataCommon.AutoRescue == null) - throw new ArgumentNullException(nameof(additionalDataCommon.AutoRescue), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.CustomRoutingFlagOption.IsSet && additionalDataCommon.CustomRoutingFlag == null) - throw new ArgumentNullException(nameof(additionalDataCommon.CustomRoutingFlag), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.ManualCaptureOption.IsSet && additionalDataCommon.ManualCapture == null) - throw new ArgumentNullException(nameof(additionalDataCommon.ManualCapture), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.MaxDaysToRescueOption.IsSet && additionalDataCommon.MaxDaysToRescue == null) - throw new ArgumentNullException(nameof(additionalDataCommon.MaxDaysToRescue), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.NetworkTxReferenceOption.IsSet && additionalDataCommon.NetworkTxReference == null) - throw new ArgumentNullException(nameof(additionalDataCommon.NetworkTxReference), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.OverwriteBrandOption.IsSet && additionalDataCommon.OverwriteBrand == null) - throw new ArgumentNullException(nameof(additionalDataCommon.OverwriteBrand), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.SubMerchantCityOption.IsSet && additionalDataCommon.SubMerchantCity == null) - throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantCity), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.SubMerchantCountryOption.IsSet && additionalDataCommon.SubMerchantCountry == null) - throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantCountry), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.SubMerchantEmailOption.IsSet && additionalDataCommon.SubMerchantEmail == null) - throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantEmail), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.SubMerchantIDOption.IsSet && additionalDataCommon.SubMerchantID == null) - throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantID), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.SubMerchantNameOption.IsSet && additionalDataCommon.SubMerchantName == null) - throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantName), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.SubMerchantPhoneNumberOption.IsSet && additionalDataCommon.SubMerchantPhoneNumber == null) - throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantPhoneNumber), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.SubMerchantPostalCodeOption.IsSet && additionalDataCommon.SubMerchantPostalCode == null) - throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantPostalCode), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.SubMerchantStateOption.IsSet && additionalDataCommon.SubMerchantState == null) - throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantState), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.SubMerchantStreetOption.IsSet && additionalDataCommon.SubMerchantStreet == null) - throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantStreet), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.SubMerchantTaxIdOption.IsSet && additionalDataCommon.SubMerchantTaxId == null) - throw new ArgumentNullException(nameof(additionalDataCommon.SubMerchantTaxId), "Property is required for class AdditionalDataCommon."); - - if (additionalDataCommon.RequestedTestAcquirerResponseCodeOption.IsSet) - writer.WriteString("RequestedTestAcquirerResponseCode", additionalDataCommon.RequestedTestAcquirerResponseCode); - - if (additionalDataCommon.RequestedTestErrorResponseCodeOption.IsSet) - writer.WriteString("RequestedTestErrorResponseCode", additionalDataCommon.RequestedTestErrorResponseCode); - - if (additionalDataCommon.AllowPartialAuthOption.IsSet) - writer.WriteString("allowPartialAuth", additionalDataCommon.AllowPartialAuth); - - if (additionalDataCommon.AuthorisationTypeOption.IsSet) - writer.WriteString("authorisationType", additionalDataCommon.AuthorisationType); - - if (additionalDataCommon.AutoRescueOption.IsSet) - writer.WriteString("autoRescue", additionalDataCommon.AutoRescue); - - if (additionalDataCommon.CustomRoutingFlagOption.IsSet) - writer.WriteString("customRoutingFlag", additionalDataCommon.CustomRoutingFlag); - - var industryUsageRawValue = AdditionalDataCommon.IndustryUsageEnumToJsonValue(additionalDataCommon.IndustryUsageOption.Value.Value); - writer.WriteString("industryUsage", industryUsageRawValue); - if (additionalDataCommon.ManualCaptureOption.IsSet) - writer.WriteString("manualCapture", additionalDataCommon.ManualCapture); - - if (additionalDataCommon.MaxDaysToRescueOption.IsSet) - writer.WriteString("maxDaysToRescue", additionalDataCommon.MaxDaysToRescue); - - if (additionalDataCommon.NetworkTxReferenceOption.IsSet) - writer.WriteString("networkTxReference", additionalDataCommon.NetworkTxReference); - - if (additionalDataCommon.OverwriteBrandOption.IsSet) - writer.WriteString("overwriteBrand", additionalDataCommon.OverwriteBrand); - - if (additionalDataCommon.SubMerchantCityOption.IsSet) - writer.WriteString("subMerchantCity", additionalDataCommon.SubMerchantCity); - - if (additionalDataCommon.SubMerchantCountryOption.IsSet) - writer.WriteString("subMerchantCountry", additionalDataCommon.SubMerchantCountry); - - if (additionalDataCommon.SubMerchantEmailOption.IsSet) - writer.WriteString("subMerchantEmail", additionalDataCommon.SubMerchantEmail); - - if (additionalDataCommon.SubMerchantIDOption.IsSet) - writer.WriteString("subMerchantID", additionalDataCommon.SubMerchantID); - - if (additionalDataCommon.SubMerchantNameOption.IsSet) - writer.WriteString("subMerchantName", additionalDataCommon.SubMerchantName); - - if (additionalDataCommon.SubMerchantPhoneNumberOption.IsSet) - writer.WriteString("subMerchantPhoneNumber", additionalDataCommon.SubMerchantPhoneNumber); - - if (additionalDataCommon.SubMerchantPostalCodeOption.IsSet) - writer.WriteString("subMerchantPostalCode", additionalDataCommon.SubMerchantPostalCode); - - if (additionalDataCommon.SubMerchantStateOption.IsSet) - writer.WriteString("subMerchantState", additionalDataCommon.SubMerchantState); - - if (additionalDataCommon.SubMerchantStreetOption.IsSet) - writer.WriteString("subMerchantStreet", additionalDataCommon.SubMerchantStreet); - - if (additionalDataCommon.SubMerchantTaxIdOption.IsSet) - writer.WriteString("subMerchantTaxId", additionalDataCommon.SubMerchantTaxId); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataLevel23.cs b/Adyen/Model/Checkout/AdditionalDataLevel23.cs index a91a85835..687ceb857 100644 --- a/Adyen/Model/Checkout/AdditionalDataLevel23.cs +++ b/Adyen/Model/Checkout/AdditionalDataLevel23.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,302 +15,182 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataLevel23 /// - public partial class AdditionalDataLevel23 : IValidatableObject + [DataContract(Name = "AdditionalDataLevel23")] + public partial class AdditionalDataLevel23 : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The reference number to identify the customer and their order. * Encoding: ASCII * Max length: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros. - /// The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. * Encoding: ASCII * Fixed length: 3 characters - /// The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * Must not start with a space. * For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. - /// The state or province code of the destination address. * Encoding: ASCII * Max length: 3 characters * Must not start with a space. - /// The duty tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters - /// The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters - /// The code that identifies the item in a standardized commodity coding scheme. There are different commodity coding schemes: * [UNSPSC commodity codes](https://www.unspsc.org/) * [HS commodity codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity codes](https://www.census.gov/naics/) * [NAPCS commodity codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. - /// A description of the item. * Encoding: ASCII * Max length: 26 characters * Must not be a single character. * Must not be blank. * Must not start with a space or be all spaces. * Must not be all zeros. - /// The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters - /// The product code. Must be a unique product code associated with the item or service. This can be your unique code for the item, or the manufacturer's product code. * Encoding: ASCII. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. - /// The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces. - /// The total amount for the line item, in [minor units](https://docs.adyen.com/development-resources/currency-codes). See [Amount requirements for level 2/3 ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) to learn more about how to calculate the line item total. * For example, 2000 means USD 20.00. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. - /// The unit of measurement for an item. * Encoding: ASCII * Max length: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. - /// The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. - /// The order date. * Format: `ddMMyy` * Encoding: ASCII * Max length: 6 characters - /// The postal code of the address where the item is shipped from. * Encoding: ASCII * Max length: 10 characters * Must not start with a space or be all spaces. * Must not be all zeros.For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. - /// The amount of state or provincial [tax included in the total transaction amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. - [JsonConstructor] - public AdditionalDataLevel23(Option enhancedSchemeDataCustomerReference = default, Option enhancedSchemeDataDestinationCountryCode = default, Option enhancedSchemeDataDestinationPostalCode = default, Option enhancedSchemeDataDestinationStateProvinceCode = default, Option enhancedSchemeDataDutyAmount = default, Option enhancedSchemeDataFreightAmount = default, Option enhancedSchemeDataItemDetailLineItemNrCommodityCode = default, Option enhancedSchemeDataItemDetailLineItemNrDescription = default, Option enhancedSchemeDataItemDetailLineItemNrDiscountAmount = default, Option enhancedSchemeDataItemDetailLineItemNrProductCode = default, Option enhancedSchemeDataItemDetailLineItemNrQuantity = default, Option enhancedSchemeDataItemDetailLineItemNrTotalAmount = default, Option enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = default, Option enhancedSchemeDataItemDetailLineItemNrUnitPrice = default, Option enhancedSchemeDataOrderDate = default, Option enhancedSchemeDataShipFromPostalCode = default, Option enhancedSchemeDataTotalTaxAmount = default) + /// The reference number to identify the customer and their order. * Encoding: ASCII * Max length: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + /// The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. * Encoding: ASCII * Fixed length: 3 characters. + /// The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * Must not start with a space. * For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5.. + /// The state or province code of the destination address. * Encoding: ASCII * Max length: 3 characters * Must not start with a space.. + /// The duty tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters. + /// The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters. + /// The code that identifies the item in a standardized commodity coding scheme. There are different commodity coding schemes: * [UNSPSC commodity codes](https://www.unspsc.org/) * [HS commodity codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity codes](https://www.census.gov/naics/) * [NAPCS commodity codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + /// A description of the item. * Encoding: ASCII * Max length: 26 characters * Must not be a single character. * Must not be blank. * Must not start with a space or be all spaces. * Must not be all zeros.. + /// The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters. + /// The product code. Must be a unique product code associated with the item or service. This can be your unique code for the item, or the manufacturer's product code. * Encoding: ASCII. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + /// The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces.. + /// The total amount for the line item, in [minor units](https://docs.adyen.com/development-resources/currency-codes). See [Amount requirements for level 2/3 ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) to learn more about how to calculate the line item total. * For example, 2000 means USD 20.00. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + /// The unit of measurement for an item. * Encoding: ASCII * Max length: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + /// The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros.. + /// The order date. * Format: `ddMMyy` * Encoding: ASCII * Max length: 6 characters. + /// The postal code of the address where the item is shipped from. * Encoding: ASCII * Max length: 10 characters * Must not start with a space or be all spaces. * Must not be all zeros.For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5.. + /// The amount of state or provincial [tax included in the total transaction amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros.. + public AdditionalDataLevel23(string enhancedSchemeDataCustomerReference = default(string), string enhancedSchemeDataDestinationCountryCode = default(string), string enhancedSchemeDataDestinationPostalCode = default(string), string enhancedSchemeDataDestinationStateProvinceCode = default(string), string enhancedSchemeDataDutyAmount = default(string), string enhancedSchemeDataFreightAmount = default(string), string enhancedSchemeDataItemDetailLineItemNrCommodityCode = default(string), string enhancedSchemeDataItemDetailLineItemNrDescription = default(string), string enhancedSchemeDataItemDetailLineItemNrDiscountAmount = default(string), string enhancedSchemeDataItemDetailLineItemNrProductCode = default(string), string enhancedSchemeDataItemDetailLineItemNrQuantity = default(string), string enhancedSchemeDataItemDetailLineItemNrTotalAmount = default(string), string enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = default(string), string enhancedSchemeDataItemDetailLineItemNrUnitPrice = default(string), string enhancedSchemeDataOrderDate = default(string), string enhancedSchemeDataShipFromPostalCode = default(string), string enhancedSchemeDataTotalTaxAmount = default(string)) { - EnhancedSchemeDataCustomerReferenceOption = enhancedSchemeDataCustomerReference; - EnhancedSchemeDataDestinationCountryCodeOption = enhancedSchemeDataDestinationCountryCode; - EnhancedSchemeDataDestinationPostalCodeOption = enhancedSchemeDataDestinationPostalCode; - EnhancedSchemeDataDestinationStateProvinceCodeOption = enhancedSchemeDataDestinationStateProvinceCode; - EnhancedSchemeDataDutyAmountOption = enhancedSchemeDataDutyAmount; - EnhancedSchemeDataFreightAmountOption = enhancedSchemeDataFreightAmount; - EnhancedSchemeDataItemDetailLineItemNrCommodityCodeOption = enhancedSchemeDataItemDetailLineItemNrCommodityCode; - EnhancedSchemeDataItemDetailLineItemNrDescriptionOption = enhancedSchemeDataItemDetailLineItemNrDescription; - EnhancedSchemeDataItemDetailLineItemNrDiscountAmountOption = enhancedSchemeDataItemDetailLineItemNrDiscountAmount; - EnhancedSchemeDataItemDetailLineItemNrProductCodeOption = enhancedSchemeDataItemDetailLineItemNrProductCode; - EnhancedSchemeDataItemDetailLineItemNrQuantityOption = enhancedSchemeDataItemDetailLineItemNrQuantity; - EnhancedSchemeDataItemDetailLineItemNrTotalAmountOption = enhancedSchemeDataItemDetailLineItemNrTotalAmount; - EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasureOption = enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure; - EnhancedSchemeDataItemDetailLineItemNrUnitPriceOption = enhancedSchemeDataItemDetailLineItemNrUnitPrice; - EnhancedSchemeDataOrderDateOption = enhancedSchemeDataOrderDate; - EnhancedSchemeDataShipFromPostalCodeOption = enhancedSchemeDataShipFromPostalCode; - EnhancedSchemeDataTotalTaxAmountOption = enhancedSchemeDataTotalTaxAmount; - OnCreated(); + this.EnhancedSchemeDataCustomerReference = enhancedSchemeDataCustomerReference; + this.EnhancedSchemeDataDestinationCountryCode = enhancedSchemeDataDestinationCountryCode; + this.EnhancedSchemeDataDestinationPostalCode = enhancedSchemeDataDestinationPostalCode; + this.EnhancedSchemeDataDestinationStateProvinceCode = enhancedSchemeDataDestinationStateProvinceCode; + this.EnhancedSchemeDataDutyAmount = enhancedSchemeDataDutyAmount; + this.EnhancedSchemeDataFreightAmount = enhancedSchemeDataFreightAmount; + this.EnhancedSchemeDataItemDetailLineItemNrCommodityCode = enhancedSchemeDataItemDetailLineItemNrCommodityCode; + this.EnhancedSchemeDataItemDetailLineItemNrDescription = enhancedSchemeDataItemDetailLineItemNrDescription; + this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount = enhancedSchemeDataItemDetailLineItemNrDiscountAmount; + this.EnhancedSchemeDataItemDetailLineItemNrProductCode = enhancedSchemeDataItemDetailLineItemNrProductCode; + this.EnhancedSchemeDataItemDetailLineItemNrQuantity = enhancedSchemeDataItemDetailLineItemNrQuantity; + this.EnhancedSchemeDataItemDetailLineItemNrTotalAmount = enhancedSchemeDataItemDetailLineItemNrTotalAmount; + this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure; + this.EnhancedSchemeDataItemDetailLineItemNrUnitPrice = enhancedSchemeDataItemDetailLineItemNrUnitPrice; + this.EnhancedSchemeDataOrderDate = enhancedSchemeDataOrderDate; + this.EnhancedSchemeDataShipFromPostalCode = enhancedSchemeDataShipFromPostalCode; + this.EnhancedSchemeDataTotalTaxAmount = enhancedSchemeDataTotalTaxAmount; } - partial void OnCreated(); - - /// - /// Used to track the state of EnhancedSchemeDataCustomerReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataCustomerReferenceOption { get; private set; } - /// /// The reference number to identify the customer and their order. * Encoding: ASCII * Max length: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The reference number to identify the customer and their order. * Encoding: ASCII * Max length: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("enhancedSchemeData.customerReference")] - public string EnhancedSchemeDataCustomerReference { get { return this.EnhancedSchemeDataCustomerReferenceOption; } set { this.EnhancedSchemeDataCustomerReferenceOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataDestinationCountryCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataDestinationCountryCodeOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.customerReference", EmitDefaultValue = false)] + public string EnhancedSchemeDataCustomerReference { get; set; } /// /// The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. * Encoding: ASCII * Fixed length: 3 characters /// /// The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. * Encoding: ASCII * Fixed length: 3 characters - [JsonPropertyName("enhancedSchemeData.destinationCountryCode")] - public string EnhancedSchemeDataDestinationCountryCode { get { return this.EnhancedSchemeDataDestinationCountryCodeOption; } set { this.EnhancedSchemeDataDestinationCountryCodeOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataDestinationPostalCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataDestinationPostalCodeOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.destinationCountryCode", EmitDefaultValue = false)] + public string EnhancedSchemeDataDestinationCountryCode { get; set; } /// /// The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * Must not start with a space. * For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. /// /// The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * Must not start with a space. * For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. - [JsonPropertyName("enhancedSchemeData.destinationPostalCode")] - public string EnhancedSchemeDataDestinationPostalCode { get { return this.EnhancedSchemeDataDestinationPostalCodeOption; } set { this.EnhancedSchemeDataDestinationPostalCodeOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataDestinationStateProvinceCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataDestinationStateProvinceCodeOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.destinationPostalCode", EmitDefaultValue = false)] + public string EnhancedSchemeDataDestinationPostalCode { get; set; } /// /// The state or province code of the destination address. * Encoding: ASCII * Max length: 3 characters * Must not start with a space. /// /// The state or province code of the destination address. * Encoding: ASCII * Max length: 3 characters * Must not start with a space. - [JsonPropertyName("enhancedSchemeData.destinationStateProvinceCode")] - public string EnhancedSchemeDataDestinationStateProvinceCode { get { return this.EnhancedSchemeDataDestinationStateProvinceCodeOption; } set { this.EnhancedSchemeDataDestinationStateProvinceCodeOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataDutyAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataDutyAmountOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.destinationStateProvinceCode", EmitDefaultValue = false)] + public string EnhancedSchemeDataDestinationStateProvinceCode { get; set; } /// /// The duty tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters /// /// The duty tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters - [JsonPropertyName("enhancedSchemeData.dutyAmount")] - public string EnhancedSchemeDataDutyAmount { get { return this.EnhancedSchemeDataDutyAmountOption; } set { this.EnhancedSchemeDataDutyAmountOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataFreightAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataFreightAmountOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.dutyAmount", EmitDefaultValue = false)] + public string EnhancedSchemeDataDutyAmount { get; set; } /// /// The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters /// /// The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters - [JsonPropertyName("enhancedSchemeData.freightAmount")] - public string EnhancedSchemeDataFreightAmount { get { return this.EnhancedSchemeDataFreightAmountOption; } set { this.EnhancedSchemeDataFreightAmountOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrCommodityCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataItemDetailLineItemNrCommodityCodeOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.freightAmount", EmitDefaultValue = false)] + public string EnhancedSchemeDataFreightAmount { get; set; } /// /// The code that identifies the item in a standardized commodity coding scheme. There are different commodity coding schemes: * [UNSPSC commodity codes](https://www.unspsc.org/) * [HS commodity codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity codes](https://www.census.gov/naics/) * [NAPCS commodity codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The code that identifies the item in a standardized commodity coding scheme. There are different commodity coding schemes: * [UNSPSC commodity codes](https://www.unspsc.org/) * [HS commodity codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity codes](https://www.census.gov/naics/) * [NAPCS commodity codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].commodityCode")] - public string EnhancedSchemeDataItemDetailLineItemNrCommodityCode { get { return this.EnhancedSchemeDataItemDetailLineItemNrCommodityCodeOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrCommodityCodeOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrDescription - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataItemDetailLineItemNrDescriptionOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].commodityCode", EmitDefaultValue = false)] + public string EnhancedSchemeDataItemDetailLineItemNrCommodityCode { get; set; } /// /// A description of the item. * Encoding: ASCII * Max length: 26 characters * Must not be a single character. * Must not be blank. * Must not start with a space or be all spaces. * Must not be all zeros. /// /// A description of the item. * Encoding: ASCII * Max length: 26 characters * Must not be a single character. * Must not be blank. * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].description")] - public string EnhancedSchemeDataItemDetailLineItemNrDescription { get { return this.EnhancedSchemeDataItemDetailLineItemNrDescriptionOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrDescriptionOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrDiscountAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataItemDetailLineItemNrDiscountAmountOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].description", EmitDefaultValue = false)] + public string EnhancedSchemeDataItemDetailLineItemNrDescription { get; set; } /// /// The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters /// /// The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters - [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].discountAmount")] - public string EnhancedSchemeDataItemDetailLineItemNrDiscountAmount { get { return this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmountOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmountOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrProductCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataItemDetailLineItemNrProductCodeOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].discountAmount", EmitDefaultValue = false)] + public string EnhancedSchemeDataItemDetailLineItemNrDiscountAmount { get; set; } /// /// The product code. Must be a unique product code associated with the item or service. This can be your unique code for the item, or the manufacturer's product code. * Encoding: ASCII. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The product code. Must be a unique product code associated with the item or service. This can be your unique code for the item, or the manufacturer's product code. * Encoding: ASCII. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].productCode")] - public string EnhancedSchemeDataItemDetailLineItemNrProductCode { get { return this.EnhancedSchemeDataItemDetailLineItemNrProductCodeOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrProductCodeOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrQuantity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataItemDetailLineItemNrQuantityOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].productCode", EmitDefaultValue = false)] + public string EnhancedSchemeDataItemDetailLineItemNrProductCode { get; set; } /// /// The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces. /// /// The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max length: 12 characters * Must not start with a space or be all spaces. - [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].quantity")] - public string EnhancedSchemeDataItemDetailLineItemNrQuantity { get { return this.EnhancedSchemeDataItemDetailLineItemNrQuantityOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrQuantityOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrTotalAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataItemDetailLineItemNrTotalAmountOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].quantity", EmitDefaultValue = false)] + public string EnhancedSchemeDataItemDetailLineItemNrQuantity { get; set; } /// /// The total amount for the line item, in [minor units](https://docs.adyen.com/development-resources/currency-codes). See [Amount requirements for level 2/3 ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) to learn more about how to calculate the line item total. * For example, 2000 means USD 20.00. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The total amount for the line item, in [minor units](https://docs.adyen.com/development-resources/currency-codes). See [Amount requirements for level 2/3 ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) to learn more about how to calculate the line item total. * For example, 2000 means USD 20.00. * Max length: 12 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].totalAmount")] - public string EnhancedSchemeDataItemDetailLineItemNrTotalAmount { get { return this.EnhancedSchemeDataItemDetailLineItemNrTotalAmountOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrTotalAmountOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasureOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].totalAmount", EmitDefaultValue = false)] + public string EnhancedSchemeDataItemDetailLineItemNrTotalAmount { get; set; } /// /// The unit of measurement for an item. * Encoding: ASCII * Max length: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The unit of measurement for an item. * Encoding: ASCII * Max length: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure")] - public string EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure { get { return this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasureOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasureOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataItemDetailLineItemNrUnitPrice - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataItemDetailLineItemNrUnitPriceOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure", EmitDefaultValue = false)] + public string EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure { get; set; } /// /// The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. /// /// The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. - [JsonPropertyName("enhancedSchemeData.itemDetailLine[itemNr].unitPrice")] - public string EnhancedSchemeDataItemDetailLineItemNrUnitPrice { get { return this.EnhancedSchemeDataItemDetailLineItemNrUnitPriceOption; } set { this.EnhancedSchemeDataItemDetailLineItemNrUnitPriceOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataOrderDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataOrderDateOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.itemDetailLine[itemNr].unitPrice", EmitDefaultValue = false)] + public string EnhancedSchemeDataItemDetailLineItemNrUnitPrice { get; set; } /// /// The order date. * Format: `ddMMyy` * Encoding: ASCII * Max length: 6 characters /// /// The order date. * Format: `ddMMyy` * Encoding: ASCII * Max length: 6 characters - [JsonPropertyName("enhancedSchemeData.orderDate")] - public string EnhancedSchemeDataOrderDate { get { return this.EnhancedSchemeDataOrderDateOption; } set { this.EnhancedSchemeDataOrderDateOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataShipFromPostalCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataShipFromPostalCodeOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.orderDate", EmitDefaultValue = false)] + public string EnhancedSchemeDataOrderDate { get; set; } /// /// The postal code of the address where the item is shipped from. * Encoding: ASCII * Max length: 10 characters * Must not start with a space or be all spaces. * Must not be all zeros.For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. /// /// The postal code of the address where the item is shipped from. * Encoding: ASCII * Max length: 10 characters * Must not start with a space or be all spaces. * Must not be all zeros.For the US, it must be in five or nine digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. - [JsonPropertyName("enhancedSchemeData.shipFromPostalCode")] - public string EnhancedSchemeDataShipFromPostalCode { get { return this.EnhancedSchemeDataShipFromPostalCodeOption; } set { this.EnhancedSchemeDataShipFromPostalCodeOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataTotalTaxAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataTotalTaxAmountOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.shipFromPostalCode", EmitDefaultValue = false)] + public string EnhancedSchemeDataShipFromPostalCode { get; set; } /// /// The amount of state or provincial [tax included in the total transaction amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. /// /// The amount of state or provincial [tax included in the total transaction amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means USD 20.00. * Encoding: Numeric * Max length: 12 characters * Must not be all zeros. - [JsonPropertyName("enhancedSchemeData.totalTaxAmount")] - public string EnhancedSchemeDataTotalTaxAmount { get { return this.EnhancedSchemeDataTotalTaxAmountOption; } set { this.EnhancedSchemeDataTotalTaxAmountOption = new Option(value); } } + [DataMember(Name = "enhancedSchemeData.totalTaxAmount", EmitDefaultValue = false)] + public string EnhancedSchemeDataTotalTaxAmount { get; set; } /// /// Returns the string presentation of the object @@ -341,307 +222,212 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataLevel23JsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataLevel23 Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option enhancedSchemeDataCustomerReference = default; - Option enhancedSchemeDataDestinationCountryCode = default; - Option enhancedSchemeDataDestinationPostalCode = default; - Option enhancedSchemeDataDestinationStateProvinceCode = default; - Option enhancedSchemeDataDutyAmount = default; - Option enhancedSchemeDataFreightAmount = default; - Option enhancedSchemeDataItemDetailLineItemNrCommodityCode = default; - Option enhancedSchemeDataItemDetailLineItemNrDescription = default; - Option enhancedSchemeDataItemDetailLineItemNrDiscountAmount = default; - Option enhancedSchemeDataItemDetailLineItemNrProductCode = default; - Option enhancedSchemeDataItemDetailLineItemNrQuantity = default; - Option enhancedSchemeDataItemDetailLineItemNrTotalAmount = default; - Option enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = default; - Option enhancedSchemeDataItemDetailLineItemNrUnitPrice = default; - Option enhancedSchemeDataOrderDate = default; - Option enhancedSchemeDataShipFromPostalCode = default; - Option enhancedSchemeDataTotalTaxAmount = default; + return this.Equals(input as AdditionalDataLevel23); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AdditionalDataLevel23 instances are equal + /// + /// Instance of AdditionalDataLevel23 to be compared + /// Boolean + public bool Equals(AdditionalDataLevel23 input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "enhancedSchemeData.customerReference": - enhancedSchemeDataCustomerReference = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.destinationCountryCode": - enhancedSchemeDataDestinationCountryCode = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.destinationPostalCode": - enhancedSchemeDataDestinationPostalCode = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.destinationStateProvinceCode": - enhancedSchemeDataDestinationStateProvinceCode = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.dutyAmount": - enhancedSchemeDataDutyAmount = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.freightAmount": - enhancedSchemeDataFreightAmount = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.itemDetailLine[itemNr].commodityCode": - enhancedSchemeDataItemDetailLineItemNrCommodityCode = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.itemDetailLine[itemNr].description": - enhancedSchemeDataItemDetailLineItemNrDescription = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.itemDetailLine[itemNr].discountAmount": - enhancedSchemeDataItemDetailLineItemNrDiscountAmount = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.itemDetailLine[itemNr].productCode": - enhancedSchemeDataItemDetailLineItemNrProductCode = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.itemDetailLine[itemNr].quantity": - enhancedSchemeDataItemDetailLineItemNrQuantity = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.itemDetailLine[itemNr].totalAmount": - enhancedSchemeDataItemDetailLineItemNrTotalAmount = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure": - enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.itemDetailLine[itemNr].unitPrice": - enhancedSchemeDataItemDetailLineItemNrUnitPrice = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.orderDate": - enhancedSchemeDataOrderDate = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.shipFromPostalCode": - enhancedSchemeDataShipFromPostalCode = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.totalTaxAmount": - enhancedSchemeDataTotalTaxAmount = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (enhancedSchemeDataCustomerReference.IsSet && enhancedSchemeDataCustomerReference.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataCustomerReference), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataDestinationCountryCode.IsSet && enhancedSchemeDataDestinationCountryCode.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataDestinationCountryCode), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataDestinationPostalCode.IsSet && enhancedSchemeDataDestinationPostalCode.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataDestinationPostalCode), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataDestinationStateProvinceCode.IsSet && enhancedSchemeDataDestinationStateProvinceCode.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataDestinationStateProvinceCode), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataDutyAmount.IsSet && enhancedSchemeDataDutyAmount.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataDutyAmount), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataFreightAmount.IsSet && enhancedSchemeDataFreightAmount.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataFreightAmount), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataItemDetailLineItemNrCommodityCode.IsSet && enhancedSchemeDataItemDetailLineItemNrCommodityCode.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrCommodityCode), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataItemDetailLineItemNrDescription.IsSet && enhancedSchemeDataItemDetailLineItemNrDescription.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrDescription), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataItemDetailLineItemNrDiscountAmount.IsSet && enhancedSchemeDataItemDetailLineItemNrDiscountAmount.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrDiscountAmount), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataItemDetailLineItemNrProductCode.IsSet && enhancedSchemeDataItemDetailLineItemNrProductCode.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrProductCode), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataItemDetailLineItemNrQuantity.IsSet && enhancedSchemeDataItemDetailLineItemNrQuantity.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrQuantity), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataItemDetailLineItemNrTotalAmount.IsSet && enhancedSchemeDataItemDetailLineItemNrTotalAmount.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrTotalAmount), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure.IsSet && enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataItemDetailLineItemNrUnitPrice.IsSet && enhancedSchemeDataItemDetailLineItemNrUnitPrice.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataItemDetailLineItemNrUnitPrice), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataOrderDate.IsSet && enhancedSchemeDataOrderDate.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataOrderDate), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataShipFromPostalCode.IsSet && enhancedSchemeDataShipFromPostalCode.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataShipFromPostalCode), "Property is not nullable for class AdditionalDataLevel23."); - - if (enhancedSchemeDataTotalTaxAmount.IsSet && enhancedSchemeDataTotalTaxAmount.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataTotalTaxAmount), "Property is not nullable for class AdditionalDataLevel23."); - - return new AdditionalDataLevel23(enhancedSchemeDataCustomerReference, enhancedSchemeDataDestinationCountryCode, enhancedSchemeDataDestinationPostalCode, enhancedSchemeDataDestinationStateProvinceCode, enhancedSchemeDataDutyAmount, enhancedSchemeDataFreightAmount, enhancedSchemeDataItemDetailLineItemNrCommodityCode, enhancedSchemeDataItemDetailLineItemNrDescription, enhancedSchemeDataItemDetailLineItemNrDiscountAmount, enhancedSchemeDataItemDetailLineItemNrProductCode, enhancedSchemeDataItemDetailLineItemNrQuantity, enhancedSchemeDataItemDetailLineItemNrTotalAmount, enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure, enhancedSchemeDataItemDetailLineItemNrUnitPrice, enhancedSchemeDataOrderDate, enhancedSchemeDataShipFromPostalCode, enhancedSchemeDataTotalTaxAmount); + return + ( + this.EnhancedSchemeDataCustomerReference == input.EnhancedSchemeDataCustomerReference || + (this.EnhancedSchemeDataCustomerReference != null && + this.EnhancedSchemeDataCustomerReference.Equals(input.EnhancedSchemeDataCustomerReference)) + ) && + ( + this.EnhancedSchemeDataDestinationCountryCode == input.EnhancedSchemeDataDestinationCountryCode || + (this.EnhancedSchemeDataDestinationCountryCode != null && + this.EnhancedSchemeDataDestinationCountryCode.Equals(input.EnhancedSchemeDataDestinationCountryCode)) + ) && + ( + this.EnhancedSchemeDataDestinationPostalCode == input.EnhancedSchemeDataDestinationPostalCode || + (this.EnhancedSchemeDataDestinationPostalCode != null && + this.EnhancedSchemeDataDestinationPostalCode.Equals(input.EnhancedSchemeDataDestinationPostalCode)) + ) && + ( + this.EnhancedSchemeDataDestinationStateProvinceCode == input.EnhancedSchemeDataDestinationStateProvinceCode || + (this.EnhancedSchemeDataDestinationStateProvinceCode != null && + this.EnhancedSchemeDataDestinationStateProvinceCode.Equals(input.EnhancedSchemeDataDestinationStateProvinceCode)) + ) && + ( + this.EnhancedSchemeDataDutyAmount == input.EnhancedSchemeDataDutyAmount || + (this.EnhancedSchemeDataDutyAmount != null && + this.EnhancedSchemeDataDutyAmount.Equals(input.EnhancedSchemeDataDutyAmount)) + ) && + ( + this.EnhancedSchemeDataFreightAmount == input.EnhancedSchemeDataFreightAmount || + (this.EnhancedSchemeDataFreightAmount != null && + this.EnhancedSchemeDataFreightAmount.Equals(input.EnhancedSchemeDataFreightAmount)) + ) && + ( + this.EnhancedSchemeDataItemDetailLineItemNrCommodityCode == input.EnhancedSchemeDataItemDetailLineItemNrCommodityCode || + (this.EnhancedSchemeDataItemDetailLineItemNrCommodityCode != null && + this.EnhancedSchemeDataItemDetailLineItemNrCommodityCode.Equals(input.EnhancedSchemeDataItemDetailLineItemNrCommodityCode)) + ) && + ( + this.EnhancedSchemeDataItemDetailLineItemNrDescription == input.EnhancedSchemeDataItemDetailLineItemNrDescription || + (this.EnhancedSchemeDataItemDetailLineItemNrDescription != null && + this.EnhancedSchemeDataItemDetailLineItemNrDescription.Equals(input.EnhancedSchemeDataItemDetailLineItemNrDescription)) + ) && + ( + this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount == input.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount || + (this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount != null && + this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount.Equals(input.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount)) + ) && + ( + this.EnhancedSchemeDataItemDetailLineItemNrProductCode == input.EnhancedSchemeDataItemDetailLineItemNrProductCode || + (this.EnhancedSchemeDataItemDetailLineItemNrProductCode != null && + this.EnhancedSchemeDataItemDetailLineItemNrProductCode.Equals(input.EnhancedSchemeDataItemDetailLineItemNrProductCode)) + ) && + ( + this.EnhancedSchemeDataItemDetailLineItemNrQuantity == input.EnhancedSchemeDataItemDetailLineItemNrQuantity || + (this.EnhancedSchemeDataItemDetailLineItemNrQuantity != null && + this.EnhancedSchemeDataItemDetailLineItemNrQuantity.Equals(input.EnhancedSchemeDataItemDetailLineItemNrQuantity)) + ) && + ( + this.EnhancedSchemeDataItemDetailLineItemNrTotalAmount == input.EnhancedSchemeDataItemDetailLineItemNrTotalAmount || + (this.EnhancedSchemeDataItemDetailLineItemNrTotalAmount != null && + this.EnhancedSchemeDataItemDetailLineItemNrTotalAmount.Equals(input.EnhancedSchemeDataItemDetailLineItemNrTotalAmount)) + ) && + ( + this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure == input.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure || + (this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure != null && + this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure.Equals(input.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure)) + ) && + ( + this.EnhancedSchemeDataItemDetailLineItemNrUnitPrice == input.EnhancedSchemeDataItemDetailLineItemNrUnitPrice || + (this.EnhancedSchemeDataItemDetailLineItemNrUnitPrice != null && + this.EnhancedSchemeDataItemDetailLineItemNrUnitPrice.Equals(input.EnhancedSchemeDataItemDetailLineItemNrUnitPrice)) + ) && + ( + this.EnhancedSchemeDataOrderDate == input.EnhancedSchemeDataOrderDate || + (this.EnhancedSchemeDataOrderDate != null && + this.EnhancedSchemeDataOrderDate.Equals(input.EnhancedSchemeDataOrderDate)) + ) && + ( + this.EnhancedSchemeDataShipFromPostalCode == input.EnhancedSchemeDataShipFromPostalCode || + (this.EnhancedSchemeDataShipFromPostalCode != null && + this.EnhancedSchemeDataShipFromPostalCode.Equals(input.EnhancedSchemeDataShipFromPostalCode)) + ) && + ( + this.EnhancedSchemeDataTotalTaxAmount == input.EnhancedSchemeDataTotalTaxAmount || + (this.EnhancedSchemeDataTotalTaxAmount != null && + this.EnhancedSchemeDataTotalTaxAmount.Equals(input.EnhancedSchemeDataTotalTaxAmount)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataLevel23 additionalDataLevel23, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataLevel23, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EnhancedSchemeDataCustomerReference != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataCustomerReference.GetHashCode(); + } + if (this.EnhancedSchemeDataDestinationCountryCode != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataDestinationCountryCode.GetHashCode(); + } + if (this.EnhancedSchemeDataDestinationPostalCode != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataDestinationPostalCode.GetHashCode(); + } + if (this.EnhancedSchemeDataDestinationStateProvinceCode != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataDestinationStateProvinceCode.GetHashCode(); + } + if (this.EnhancedSchemeDataDutyAmount != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataDutyAmount.GetHashCode(); + } + if (this.EnhancedSchemeDataFreightAmount != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataFreightAmount.GetHashCode(); + } + if (this.EnhancedSchemeDataItemDetailLineItemNrCommodityCode != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrCommodityCode.GetHashCode(); + } + if (this.EnhancedSchemeDataItemDetailLineItemNrDescription != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrDescription.GetHashCode(); + } + if (this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount.GetHashCode(); + } + if (this.EnhancedSchemeDataItemDetailLineItemNrProductCode != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrProductCode.GetHashCode(); + } + if (this.EnhancedSchemeDataItemDetailLineItemNrQuantity != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrQuantity.GetHashCode(); + } + if (this.EnhancedSchemeDataItemDetailLineItemNrTotalAmount != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrTotalAmount.GetHashCode(); + } + if (this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure.GetHashCode(); + } + if (this.EnhancedSchemeDataItemDetailLineItemNrUnitPrice != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataItemDetailLineItemNrUnitPrice.GetHashCode(); + } + if (this.EnhancedSchemeDataOrderDate != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataOrderDate.GetHashCode(); + } + if (this.EnhancedSchemeDataShipFromPostalCode != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataShipFromPostalCode.GetHashCode(); + } + if (this.EnhancedSchemeDataTotalTaxAmount != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataTotalTaxAmount.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataLevel23 additionalDataLevel23, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataLevel23.EnhancedSchemeDataCustomerReferenceOption.IsSet && additionalDataLevel23.EnhancedSchemeDataCustomerReference == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataCustomerReference), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataDestinationCountryCodeOption.IsSet && additionalDataLevel23.EnhancedSchemeDataDestinationCountryCode == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataDestinationCountryCode), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataDestinationPostalCodeOption.IsSet && additionalDataLevel23.EnhancedSchemeDataDestinationPostalCode == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataDestinationPostalCode), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataDestinationStateProvinceCodeOption.IsSet && additionalDataLevel23.EnhancedSchemeDataDestinationStateProvinceCode == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataDestinationStateProvinceCode), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataDutyAmountOption.IsSet && additionalDataLevel23.EnhancedSchemeDataDutyAmount == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataDutyAmount), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataFreightAmountOption.IsSet && additionalDataLevel23.EnhancedSchemeDataFreightAmount == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataFreightAmount), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrCommodityCodeOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrCommodityCode == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrCommodityCode), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDescriptionOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDescription == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDescription), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDiscountAmountOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrProductCodeOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrProductCode == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrProductCode), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrQuantityOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrQuantity == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrQuantity), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrTotalAmountOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrTotalAmount == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrTotalAmount), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasureOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitPriceOption.IsSet && additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitPrice == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitPrice), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataOrderDateOption.IsSet && additionalDataLevel23.EnhancedSchemeDataOrderDate == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataOrderDate), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataShipFromPostalCodeOption.IsSet && additionalDataLevel23.EnhancedSchemeDataShipFromPostalCode == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataShipFromPostalCode), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataTotalTaxAmountOption.IsSet && additionalDataLevel23.EnhancedSchemeDataTotalTaxAmount == null) - throw new ArgumentNullException(nameof(additionalDataLevel23.EnhancedSchemeDataTotalTaxAmount), "Property is required for class AdditionalDataLevel23."); - - if (additionalDataLevel23.EnhancedSchemeDataCustomerReferenceOption.IsSet) - writer.WriteString("enhancedSchemeData.customerReference", additionalDataLevel23.EnhancedSchemeDataCustomerReference); - - if (additionalDataLevel23.EnhancedSchemeDataDestinationCountryCodeOption.IsSet) - writer.WriteString("enhancedSchemeData.destinationCountryCode", additionalDataLevel23.EnhancedSchemeDataDestinationCountryCode); - - if (additionalDataLevel23.EnhancedSchemeDataDestinationPostalCodeOption.IsSet) - writer.WriteString("enhancedSchemeData.destinationPostalCode", additionalDataLevel23.EnhancedSchemeDataDestinationPostalCode); - - if (additionalDataLevel23.EnhancedSchemeDataDestinationStateProvinceCodeOption.IsSet) - writer.WriteString("enhancedSchemeData.destinationStateProvinceCode", additionalDataLevel23.EnhancedSchemeDataDestinationStateProvinceCode); - - if (additionalDataLevel23.EnhancedSchemeDataDutyAmountOption.IsSet) - writer.WriteString("enhancedSchemeData.dutyAmount", additionalDataLevel23.EnhancedSchemeDataDutyAmount); - - if (additionalDataLevel23.EnhancedSchemeDataFreightAmountOption.IsSet) - writer.WriteString("enhancedSchemeData.freightAmount", additionalDataLevel23.EnhancedSchemeDataFreightAmount); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrCommodityCodeOption.IsSet) - writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].commodityCode", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrCommodityCode); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDescriptionOption.IsSet) - writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].description", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDescription); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDiscountAmountOption.IsSet) - writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].discountAmount", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrDiscountAmount); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrProductCodeOption.IsSet) - writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].productCode", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrProductCode); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrQuantityOption.IsSet) - writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].quantity", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrQuantity); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrTotalAmountOption.IsSet) - writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].totalAmount", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrTotalAmount); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasureOption.IsSet) - writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure); - - if (additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitPriceOption.IsSet) - writer.WriteString("enhancedSchemeData.itemDetailLine[itemNr].unitPrice", additionalDataLevel23.EnhancedSchemeDataItemDetailLineItemNrUnitPrice); - - if (additionalDataLevel23.EnhancedSchemeDataOrderDateOption.IsSet) - writer.WriteString("enhancedSchemeData.orderDate", additionalDataLevel23.EnhancedSchemeDataOrderDate); - - if (additionalDataLevel23.EnhancedSchemeDataShipFromPostalCodeOption.IsSet) - writer.WriteString("enhancedSchemeData.shipFromPostalCode", additionalDataLevel23.EnhancedSchemeDataShipFromPostalCode); - - if (additionalDataLevel23.EnhancedSchemeDataTotalTaxAmountOption.IsSet) - writer.WriteString("enhancedSchemeData.totalTaxAmount", additionalDataLevel23.EnhancedSchemeDataTotalTaxAmount); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataLodging.cs b/Adyen/Model/Checkout/AdditionalDataLodging.cs index 696e07b98..3382ee07a 100644 --- a/Adyen/Model/Checkout/AdditionalDataLodging.cs +++ b/Adyen/Model/Checkout/AdditionalDataLodging.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,302 +15,182 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataLodging /// - public partial class AdditionalDataLodging : IValidatableObject + [DataContract(Name = "AdditionalDataLodging")] + public partial class AdditionalDataLodging : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// A code that corresponds to the category of lodging charges for the payment. Possible values: * 1: Lodging * 2: No show reservation * 3: Advanced deposit - /// The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. - /// The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. - /// The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros. - /// Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character - /// The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters - /// The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters * Must not start with a space * Must not contain any special characters * Must not be all zeros. - /// Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters - /// Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in - /// The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters - /// The lodging property location's phone number. * Format: numeric * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros. - /// The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters - /// The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number - /// The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number - /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number - /// The number of nights. This should be included in the auth message. * Format: numeric * Max length: 4 characters - /// Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character - [JsonConstructor] - public AdditionalDataLodging(Option lodgingSpecialProgramCode = default, Option lodgingCheckInDate = default, Option lodgingCheckOutDate = default, Option lodgingCustomerServiceTollFreeNumber = default, Option lodgingFireSafetyActIndicator = default, Option lodgingFolioCashAdvances = default, Option lodgingFolioNumber = default, Option lodgingFoodBeverageCharges = default, Option lodgingNoShowIndicator = default, Option lodgingPrepaidExpenses = default, Option lodgingPropertyPhoneNumber = default, Option lodgingRoom1NumberOfNights = default, Option lodgingRoom1Rate = default, Option lodgingTotalRoomTax = default, Option lodgingTotalTax = default, Option travelEntertainmentAuthDataDuration = default, Option travelEntertainmentAuthDataMarket = default) + /// A code that corresponds to the category of lodging charges for the payment. Possible values: * 1: Lodging * 2: No show reservation * 3: Advanced deposit. + /// The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**.. + /// The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**.. + /// The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros.. + /// Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character. + /// The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters. + /// The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters * Must not start with a space * Must not contain any special characters * Must not be all zeros.. + /// Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters. + /// Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in. + /// The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters. + /// The lodging property location's phone number. * Format: numeric * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros.. + /// The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters. + /// The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number. + /// The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number. + /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number. + /// The number of nights. This should be included in the auth message. * Format: numeric * Max length: 4 characters. + /// Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character. + public AdditionalDataLodging(string lodgingSpecialProgramCode = default(string), string lodgingCheckInDate = default(string), string lodgingCheckOutDate = default(string), string lodgingCustomerServiceTollFreeNumber = default(string), string lodgingFireSafetyActIndicator = default(string), string lodgingFolioCashAdvances = default(string), string lodgingFolioNumber = default(string), string lodgingFoodBeverageCharges = default(string), string lodgingNoShowIndicator = default(string), string lodgingPrepaidExpenses = default(string), string lodgingPropertyPhoneNumber = default(string), string lodgingRoom1NumberOfNights = default(string), string lodgingRoom1Rate = default(string), string lodgingTotalRoomTax = default(string), string lodgingTotalTax = default(string), string travelEntertainmentAuthDataDuration = default(string), string travelEntertainmentAuthDataMarket = default(string)) { - LodgingSpecialProgramCodeOption = lodgingSpecialProgramCode; - LodgingCheckInDateOption = lodgingCheckInDate; - LodgingCheckOutDateOption = lodgingCheckOutDate; - LodgingCustomerServiceTollFreeNumberOption = lodgingCustomerServiceTollFreeNumber; - LodgingFireSafetyActIndicatorOption = lodgingFireSafetyActIndicator; - LodgingFolioCashAdvancesOption = lodgingFolioCashAdvances; - LodgingFolioNumberOption = lodgingFolioNumber; - LodgingFoodBeverageChargesOption = lodgingFoodBeverageCharges; - LodgingNoShowIndicatorOption = lodgingNoShowIndicator; - LodgingPrepaidExpensesOption = lodgingPrepaidExpenses; - LodgingPropertyPhoneNumberOption = lodgingPropertyPhoneNumber; - LodgingRoom1NumberOfNightsOption = lodgingRoom1NumberOfNights; - LodgingRoom1RateOption = lodgingRoom1Rate; - LodgingTotalRoomTaxOption = lodgingTotalRoomTax; - LodgingTotalTaxOption = lodgingTotalTax; - TravelEntertainmentAuthDataDurationOption = travelEntertainmentAuthDataDuration; - TravelEntertainmentAuthDataMarketOption = travelEntertainmentAuthDataMarket; - OnCreated(); + this.LodgingSpecialProgramCode = lodgingSpecialProgramCode; + this.LodgingCheckInDate = lodgingCheckInDate; + this.LodgingCheckOutDate = lodgingCheckOutDate; + this.LodgingCustomerServiceTollFreeNumber = lodgingCustomerServiceTollFreeNumber; + this.LodgingFireSafetyActIndicator = lodgingFireSafetyActIndicator; + this.LodgingFolioCashAdvances = lodgingFolioCashAdvances; + this.LodgingFolioNumber = lodgingFolioNumber; + this.LodgingFoodBeverageCharges = lodgingFoodBeverageCharges; + this.LodgingNoShowIndicator = lodgingNoShowIndicator; + this.LodgingPrepaidExpenses = lodgingPrepaidExpenses; + this.LodgingPropertyPhoneNumber = lodgingPropertyPhoneNumber; + this.LodgingRoom1NumberOfNights = lodgingRoom1NumberOfNights; + this.LodgingRoom1Rate = lodgingRoom1Rate; + this.LodgingTotalRoomTax = lodgingTotalRoomTax; + this.LodgingTotalTax = lodgingTotalTax; + this.TravelEntertainmentAuthDataDuration = travelEntertainmentAuthDataDuration; + this.TravelEntertainmentAuthDataMarket = travelEntertainmentAuthDataMarket; } - partial void OnCreated(); - - /// - /// Used to track the state of LodgingSpecialProgramCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingSpecialProgramCodeOption { get; private set; } - /// /// A code that corresponds to the category of lodging charges for the payment. Possible values: * 1: Lodging * 2: No show reservation * 3: Advanced deposit /// /// A code that corresponds to the category of lodging charges for the payment. Possible values: * 1: Lodging * 2: No show reservation * 3: Advanced deposit - [JsonPropertyName("lodging.SpecialProgramCode")] - public string LodgingSpecialProgramCode { get { return this.LodgingSpecialProgramCodeOption; } set { this.LodgingSpecialProgramCodeOption = new Option(value); } } - - /// - /// Used to track the state of LodgingCheckInDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingCheckInDateOption { get; private set; } + [DataMember(Name = "lodging.SpecialProgramCode", EmitDefaultValue = false)] + public string LodgingSpecialProgramCode { get; set; } /// /// The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. /// /// The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. - [JsonPropertyName("lodging.checkInDate")] - public string LodgingCheckInDate { get { return this.LodgingCheckInDateOption; } set { this.LodgingCheckInDateOption = new Option(value); } } - - /// - /// Used to track the state of LodgingCheckOutDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingCheckOutDateOption { get; private set; } + [DataMember(Name = "lodging.checkInDate", EmitDefaultValue = false)] + public string LodgingCheckInDate { get; set; } /// /// The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. /// /// The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. - [JsonPropertyName("lodging.checkOutDate")] - public string LodgingCheckOutDate { get { return this.LodgingCheckOutDateOption; } set { this.LodgingCheckOutDateOption = new Option(value); } } - - /// - /// Used to track the state of LodgingCustomerServiceTollFreeNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingCustomerServiceTollFreeNumberOption { get; private set; } + [DataMember(Name = "lodging.checkOutDate", EmitDefaultValue = false)] + public string LodgingCheckOutDate { get; set; } /// /// The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros. /// /// The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros. - [JsonPropertyName("lodging.customerServiceTollFreeNumber")] - public string LodgingCustomerServiceTollFreeNumber { get { return this.LodgingCustomerServiceTollFreeNumberOption; } set { this.LodgingCustomerServiceTollFreeNumberOption = new Option(value); } } - - /// - /// Used to track the state of LodgingFireSafetyActIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingFireSafetyActIndicatorOption { get; private set; } + [DataMember(Name = "lodging.customerServiceTollFreeNumber", EmitDefaultValue = false)] + public string LodgingCustomerServiceTollFreeNumber { get; set; } /// /// Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character /// /// Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character - [JsonPropertyName("lodging.fireSafetyActIndicator")] - public string LodgingFireSafetyActIndicator { get { return this.LodgingFireSafetyActIndicatorOption; } set { this.LodgingFireSafetyActIndicatorOption = new Option(value); } } - - /// - /// Used to track the state of LodgingFolioCashAdvances - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingFolioCashAdvancesOption { get; private set; } + [DataMember(Name = "lodging.fireSafetyActIndicator", EmitDefaultValue = false)] + public string LodgingFireSafetyActIndicator { get; set; } /// /// The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters /// /// The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters - [JsonPropertyName("lodging.folioCashAdvances")] - public string LodgingFolioCashAdvances { get { return this.LodgingFolioCashAdvancesOption; } set { this.LodgingFolioCashAdvancesOption = new Option(value); } } - - /// - /// Used to track the state of LodgingFolioNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingFolioNumberOption { get; private set; } + [DataMember(Name = "lodging.folioCashAdvances", EmitDefaultValue = false)] + public string LodgingFolioCashAdvances { get; set; } /// /// The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters * Must not start with a space * Must not contain any special characters * Must not be all zeros. /// /// The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters * Must not start with a space * Must not contain any special characters * Must not be all zeros. - [JsonPropertyName("lodging.folioNumber")] - public string LodgingFolioNumber { get { return this.LodgingFolioNumberOption; } set { this.LodgingFolioNumberOption = new Option(value); } } - - /// - /// Used to track the state of LodgingFoodBeverageCharges - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingFoodBeverageChargesOption { get; private set; } + [DataMember(Name = "lodging.folioNumber", EmitDefaultValue = false)] + public string LodgingFolioNumber { get; set; } /// /// Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters /// /// Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters - [JsonPropertyName("lodging.foodBeverageCharges")] - public string LodgingFoodBeverageCharges { get { return this.LodgingFoodBeverageChargesOption; } set { this.LodgingFoodBeverageChargesOption = new Option(value); } } - - /// - /// Used to track the state of LodgingNoShowIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingNoShowIndicatorOption { get; private set; } + [DataMember(Name = "lodging.foodBeverageCharges", EmitDefaultValue = false)] + public string LodgingFoodBeverageCharges { get; set; } /// /// Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in /// /// Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in - [JsonPropertyName("lodging.noShowIndicator")] - public string LodgingNoShowIndicator { get { return this.LodgingNoShowIndicatorOption; } set { this.LodgingNoShowIndicatorOption = new Option(value); } } - - /// - /// Used to track the state of LodgingPrepaidExpenses - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingPrepaidExpensesOption { get; private set; } + [DataMember(Name = "lodging.noShowIndicator", EmitDefaultValue = false)] + public string LodgingNoShowIndicator { get; set; } /// /// The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters /// /// The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters - [JsonPropertyName("lodging.prepaidExpenses")] - public string LodgingPrepaidExpenses { get { return this.LodgingPrepaidExpensesOption; } set { this.LodgingPrepaidExpensesOption = new Option(value); } } - - /// - /// Used to track the state of LodgingPropertyPhoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingPropertyPhoneNumberOption { get; private set; } + [DataMember(Name = "lodging.prepaidExpenses", EmitDefaultValue = false)] + public string LodgingPrepaidExpenses { get; set; } /// /// The lodging property location's phone number. * Format: numeric * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros. /// /// The lodging property location's phone number. * Format: numeric * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not contain any special characters such as + or - * Must not be all zeros. - [JsonPropertyName("lodging.propertyPhoneNumber")] - public string LodgingPropertyPhoneNumber { get { return this.LodgingPropertyPhoneNumberOption; } set { this.LodgingPropertyPhoneNumberOption = new Option(value); } } - - /// - /// Used to track the state of LodgingRoom1NumberOfNights - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingRoom1NumberOfNightsOption { get; private set; } + [DataMember(Name = "lodging.propertyPhoneNumber", EmitDefaultValue = false)] + public string LodgingPropertyPhoneNumber { get; set; } /// /// The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters /// /// The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 4 characters - [JsonPropertyName("lodging.room1.numberOfNights")] - public string LodgingRoom1NumberOfNights { get { return this.LodgingRoom1NumberOfNightsOption; } set { this.LodgingRoom1NumberOfNightsOption = new Option(value); } } - - /// - /// Used to track the state of LodgingRoom1Rate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingRoom1RateOption { get; private set; } + [DataMember(Name = "lodging.room1.numberOfNights", EmitDefaultValue = false)] + public string LodgingRoom1NumberOfNights { get; set; } /// /// The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number /// /// The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number - [JsonPropertyName("lodging.room1.rate")] - public string LodgingRoom1Rate { get { return this.LodgingRoom1RateOption; } set { this.LodgingRoom1RateOption = new Option(value); } } - - /// - /// Used to track the state of LodgingTotalRoomTax - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingTotalRoomTaxOption { get; private set; } + [DataMember(Name = "lodging.room1.rate", EmitDefaultValue = false)] + public string LodgingRoom1Rate { get; set; } /// /// The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number /// /// The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number - [JsonPropertyName("lodging.totalRoomTax")] - public string LodgingTotalRoomTax { get { return this.LodgingTotalRoomTaxOption; } set { this.LodgingTotalRoomTaxOption = new Option(value); } } - - /// - /// Used to track the state of LodgingTotalTax - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LodgingTotalTaxOption { get; private set; } + [DataMember(Name = "lodging.totalRoomTax", EmitDefaultValue = false)] + public string LodgingTotalRoomTax { get; set; } /// /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number /// /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number - [JsonPropertyName("lodging.totalTax")] - public string LodgingTotalTax { get { return this.LodgingTotalTaxOption; } set { this.LodgingTotalTaxOption = new Option(value); } } - - /// - /// Used to track the state of TravelEntertainmentAuthDataDuration - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TravelEntertainmentAuthDataDurationOption { get; private set; } + [DataMember(Name = "lodging.totalTax", EmitDefaultValue = false)] + public string LodgingTotalTax { get; set; } /// /// The number of nights. This should be included in the auth message. * Format: numeric * Max length: 4 characters /// /// The number of nights. This should be included in the auth message. * Format: numeric * Max length: 4 characters - [JsonPropertyName("travelEntertainmentAuthData.duration")] - public string TravelEntertainmentAuthDataDuration { get { return this.TravelEntertainmentAuthDataDurationOption; } set { this.TravelEntertainmentAuthDataDurationOption = new Option(value); } } - - /// - /// Used to track the state of TravelEntertainmentAuthDataMarket - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TravelEntertainmentAuthDataMarketOption { get; private set; } + [DataMember(Name = "travelEntertainmentAuthData.duration", EmitDefaultValue = false)] + public string TravelEntertainmentAuthDataDuration { get; set; } /// /// Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character /// /// Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character - [JsonPropertyName("travelEntertainmentAuthData.market")] - public string TravelEntertainmentAuthDataMarket { get { return this.TravelEntertainmentAuthDataMarketOption; } set { this.TravelEntertainmentAuthDataMarketOption = new Option(value); } } + [DataMember(Name = "travelEntertainmentAuthData.market", EmitDefaultValue = false)] + public string TravelEntertainmentAuthDataMarket { get; set; } /// /// Returns the string presentation of the object @@ -341,307 +222,212 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataLodgingJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataLodging Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option lodgingSpecialProgramCode = default; - Option lodgingCheckInDate = default; - Option lodgingCheckOutDate = default; - Option lodgingCustomerServiceTollFreeNumber = default; - Option lodgingFireSafetyActIndicator = default; - Option lodgingFolioCashAdvances = default; - Option lodgingFolioNumber = default; - Option lodgingFoodBeverageCharges = default; - Option lodgingNoShowIndicator = default; - Option lodgingPrepaidExpenses = default; - Option lodgingPropertyPhoneNumber = default; - Option lodgingRoom1NumberOfNights = default; - Option lodgingRoom1Rate = default; - Option lodgingTotalRoomTax = default; - Option lodgingTotalTax = default; - Option travelEntertainmentAuthDataDuration = default; - Option travelEntertainmentAuthDataMarket = default; + return this.Equals(input as AdditionalDataLodging); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AdditionalDataLodging instances are equal + /// + /// Instance of AdditionalDataLodging to be compared + /// Boolean + public bool Equals(AdditionalDataLodging input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "lodging.SpecialProgramCode": - lodgingSpecialProgramCode = new Option(utf8JsonReader.GetString()); - break; - case "lodging.checkInDate": - lodgingCheckInDate = new Option(utf8JsonReader.GetString()); - break; - case "lodging.checkOutDate": - lodgingCheckOutDate = new Option(utf8JsonReader.GetString()); - break; - case "lodging.customerServiceTollFreeNumber": - lodgingCustomerServiceTollFreeNumber = new Option(utf8JsonReader.GetString()); - break; - case "lodging.fireSafetyActIndicator": - lodgingFireSafetyActIndicator = new Option(utf8JsonReader.GetString()); - break; - case "lodging.folioCashAdvances": - lodgingFolioCashAdvances = new Option(utf8JsonReader.GetString()); - break; - case "lodging.folioNumber": - lodgingFolioNumber = new Option(utf8JsonReader.GetString()); - break; - case "lodging.foodBeverageCharges": - lodgingFoodBeverageCharges = new Option(utf8JsonReader.GetString()); - break; - case "lodging.noShowIndicator": - lodgingNoShowIndicator = new Option(utf8JsonReader.GetString()); - break; - case "lodging.prepaidExpenses": - lodgingPrepaidExpenses = new Option(utf8JsonReader.GetString()); - break; - case "lodging.propertyPhoneNumber": - lodgingPropertyPhoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "lodging.room1.numberOfNights": - lodgingRoom1NumberOfNights = new Option(utf8JsonReader.GetString()); - break; - case "lodging.room1.rate": - lodgingRoom1Rate = new Option(utf8JsonReader.GetString()); - break; - case "lodging.totalRoomTax": - lodgingTotalRoomTax = new Option(utf8JsonReader.GetString()); - break; - case "lodging.totalTax": - lodgingTotalTax = new Option(utf8JsonReader.GetString()); - break; - case "travelEntertainmentAuthData.duration": - travelEntertainmentAuthDataDuration = new Option(utf8JsonReader.GetString()); - break; - case "travelEntertainmentAuthData.market": - travelEntertainmentAuthDataMarket = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (lodgingSpecialProgramCode.IsSet && lodgingSpecialProgramCode.Value == null) - throw new ArgumentNullException(nameof(lodgingSpecialProgramCode), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingCheckInDate.IsSet && lodgingCheckInDate.Value == null) - throw new ArgumentNullException(nameof(lodgingCheckInDate), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingCheckOutDate.IsSet && lodgingCheckOutDate.Value == null) - throw new ArgumentNullException(nameof(lodgingCheckOutDate), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingCustomerServiceTollFreeNumber.IsSet && lodgingCustomerServiceTollFreeNumber.Value == null) - throw new ArgumentNullException(nameof(lodgingCustomerServiceTollFreeNumber), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingFireSafetyActIndicator.IsSet && lodgingFireSafetyActIndicator.Value == null) - throw new ArgumentNullException(nameof(lodgingFireSafetyActIndicator), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingFolioCashAdvances.IsSet && lodgingFolioCashAdvances.Value == null) - throw new ArgumentNullException(nameof(lodgingFolioCashAdvances), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingFolioNumber.IsSet && lodgingFolioNumber.Value == null) - throw new ArgumentNullException(nameof(lodgingFolioNumber), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingFoodBeverageCharges.IsSet && lodgingFoodBeverageCharges.Value == null) - throw new ArgumentNullException(nameof(lodgingFoodBeverageCharges), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingNoShowIndicator.IsSet && lodgingNoShowIndicator.Value == null) - throw new ArgumentNullException(nameof(lodgingNoShowIndicator), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingPrepaidExpenses.IsSet && lodgingPrepaidExpenses.Value == null) - throw new ArgumentNullException(nameof(lodgingPrepaidExpenses), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingPropertyPhoneNumber.IsSet && lodgingPropertyPhoneNumber.Value == null) - throw new ArgumentNullException(nameof(lodgingPropertyPhoneNumber), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingRoom1NumberOfNights.IsSet && lodgingRoom1NumberOfNights.Value == null) - throw new ArgumentNullException(nameof(lodgingRoom1NumberOfNights), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingRoom1Rate.IsSet && lodgingRoom1Rate.Value == null) - throw new ArgumentNullException(nameof(lodgingRoom1Rate), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingTotalRoomTax.IsSet && lodgingTotalRoomTax.Value == null) - throw new ArgumentNullException(nameof(lodgingTotalRoomTax), "Property is not nullable for class AdditionalDataLodging."); - - if (lodgingTotalTax.IsSet && lodgingTotalTax.Value == null) - throw new ArgumentNullException(nameof(lodgingTotalTax), "Property is not nullable for class AdditionalDataLodging."); - - if (travelEntertainmentAuthDataDuration.IsSet && travelEntertainmentAuthDataDuration.Value == null) - throw new ArgumentNullException(nameof(travelEntertainmentAuthDataDuration), "Property is not nullable for class AdditionalDataLodging."); - - if (travelEntertainmentAuthDataMarket.IsSet && travelEntertainmentAuthDataMarket.Value == null) - throw new ArgumentNullException(nameof(travelEntertainmentAuthDataMarket), "Property is not nullable for class AdditionalDataLodging."); - - return new AdditionalDataLodging(lodgingSpecialProgramCode, lodgingCheckInDate, lodgingCheckOutDate, lodgingCustomerServiceTollFreeNumber, lodgingFireSafetyActIndicator, lodgingFolioCashAdvances, lodgingFolioNumber, lodgingFoodBeverageCharges, lodgingNoShowIndicator, lodgingPrepaidExpenses, lodgingPropertyPhoneNumber, lodgingRoom1NumberOfNights, lodgingRoom1Rate, lodgingTotalRoomTax, lodgingTotalTax, travelEntertainmentAuthDataDuration, travelEntertainmentAuthDataMarket); + return + ( + this.LodgingSpecialProgramCode == input.LodgingSpecialProgramCode || + (this.LodgingSpecialProgramCode != null && + this.LodgingSpecialProgramCode.Equals(input.LodgingSpecialProgramCode)) + ) && + ( + this.LodgingCheckInDate == input.LodgingCheckInDate || + (this.LodgingCheckInDate != null && + this.LodgingCheckInDate.Equals(input.LodgingCheckInDate)) + ) && + ( + this.LodgingCheckOutDate == input.LodgingCheckOutDate || + (this.LodgingCheckOutDate != null && + this.LodgingCheckOutDate.Equals(input.LodgingCheckOutDate)) + ) && + ( + this.LodgingCustomerServiceTollFreeNumber == input.LodgingCustomerServiceTollFreeNumber || + (this.LodgingCustomerServiceTollFreeNumber != null && + this.LodgingCustomerServiceTollFreeNumber.Equals(input.LodgingCustomerServiceTollFreeNumber)) + ) && + ( + this.LodgingFireSafetyActIndicator == input.LodgingFireSafetyActIndicator || + (this.LodgingFireSafetyActIndicator != null && + this.LodgingFireSafetyActIndicator.Equals(input.LodgingFireSafetyActIndicator)) + ) && + ( + this.LodgingFolioCashAdvances == input.LodgingFolioCashAdvances || + (this.LodgingFolioCashAdvances != null && + this.LodgingFolioCashAdvances.Equals(input.LodgingFolioCashAdvances)) + ) && + ( + this.LodgingFolioNumber == input.LodgingFolioNumber || + (this.LodgingFolioNumber != null && + this.LodgingFolioNumber.Equals(input.LodgingFolioNumber)) + ) && + ( + this.LodgingFoodBeverageCharges == input.LodgingFoodBeverageCharges || + (this.LodgingFoodBeverageCharges != null && + this.LodgingFoodBeverageCharges.Equals(input.LodgingFoodBeverageCharges)) + ) && + ( + this.LodgingNoShowIndicator == input.LodgingNoShowIndicator || + (this.LodgingNoShowIndicator != null && + this.LodgingNoShowIndicator.Equals(input.LodgingNoShowIndicator)) + ) && + ( + this.LodgingPrepaidExpenses == input.LodgingPrepaidExpenses || + (this.LodgingPrepaidExpenses != null && + this.LodgingPrepaidExpenses.Equals(input.LodgingPrepaidExpenses)) + ) && + ( + this.LodgingPropertyPhoneNumber == input.LodgingPropertyPhoneNumber || + (this.LodgingPropertyPhoneNumber != null && + this.LodgingPropertyPhoneNumber.Equals(input.LodgingPropertyPhoneNumber)) + ) && + ( + this.LodgingRoom1NumberOfNights == input.LodgingRoom1NumberOfNights || + (this.LodgingRoom1NumberOfNights != null && + this.LodgingRoom1NumberOfNights.Equals(input.LodgingRoom1NumberOfNights)) + ) && + ( + this.LodgingRoom1Rate == input.LodgingRoom1Rate || + (this.LodgingRoom1Rate != null && + this.LodgingRoom1Rate.Equals(input.LodgingRoom1Rate)) + ) && + ( + this.LodgingTotalRoomTax == input.LodgingTotalRoomTax || + (this.LodgingTotalRoomTax != null && + this.LodgingTotalRoomTax.Equals(input.LodgingTotalRoomTax)) + ) && + ( + this.LodgingTotalTax == input.LodgingTotalTax || + (this.LodgingTotalTax != null && + this.LodgingTotalTax.Equals(input.LodgingTotalTax)) + ) && + ( + this.TravelEntertainmentAuthDataDuration == input.TravelEntertainmentAuthDataDuration || + (this.TravelEntertainmentAuthDataDuration != null && + this.TravelEntertainmentAuthDataDuration.Equals(input.TravelEntertainmentAuthDataDuration)) + ) && + ( + this.TravelEntertainmentAuthDataMarket == input.TravelEntertainmentAuthDataMarket || + (this.TravelEntertainmentAuthDataMarket != null && + this.TravelEntertainmentAuthDataMarket.Equals(input.TravelEntertainmentAuthDataMarket)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataLodging additionalDataLodging, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataLodging, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.LodgingSpecialProgramCode != null) + { + hashCode = (hashCode * 59) + this.LodgingSpecialProgramCode.GetHashCode(); + } + if (this.LodgingCheckInDate != null) + { + hashCode = (hashCode * 59) + this.LodgingCheckInDate.GetHashCode(); + } + if (this.LodgingCheckOutDate != null) + { + hashCode = (hashCode * 59) + this.LodgingCheckOutDate.GetHashCode(); + } + if (this.LodgingCustomerServiceTollFreeNumber != null) + { + hashCode = (hashCode * 59) + this.LodgingCustomerServiceTollFreeNumber.GetHashCode(); + } + if (this.LodgingFireSafetyActIndicator != null) + { + hashCode = (hashCode * 59) + this.LodgingFireSafetyActIndicator.GetHashCode(); + } + if (this.LodgingFolioCashAdvances != null) + { + hashCode = (hashCode * 59) + this.LodgingFolioCashAdvances.GetHashCode(); + } + if (this.LodgingFolioNumber != null) + { + hashCode = (hashCode * 59) + this.LodgingFolioNumber.GetHashCode(); + } + if (this.LodgingFoodBeverageCharges != null) + { + hashCode = (hashCode * 59) + this.LodgingFoodBeverageCharges.GetHashCode(); + } + if (this.LodgingNoShowIndicator != null) + { + hashCode = (hashCode * 59) + this.LodgingNoShowIndicator.GetHashCode(); + } + if (this.LodgingPrepaidExpenses != null) + { + hashCode = (hashCode * 59) + this.LodgingPrepaidExpenses.GetHashCode(); + } + if (this.LodgingPropertyPhoneNumber != null) + { + hashCode = (hashCode * 59) + this.LodgingPropertyPhoneNumber.GetHashCode(); + } + if (this.LodgingRoom1NumberOfNights != null) + { + hashCode = (hashCode * 59) + this.LodgingRoom1NumberOfNights.GetHashCode(); + } + if (this.LodgingRoom1Rate != null) + { + hashCode = (hashCode * 59) + this.LodgingRoom1Rate.GetHashCode(); + } + if (this.LodgingTotalRoomTax != null) + { + hashCode = (hashCode * 59) + this.LodgingTotalRoomTax.GetHashCode(); + } + if (this.LodgingTotalTax != null) + { + hashCode = (hashCode * 59) + this.LodgingTotalTax.GetHashCode(); + } + if (this.TravelEntertainmentAuthDataDuration != null) + { + hashCode = (hashCode * 59) + this.TravelEntertainmentAuthDataDuration.GetHashCode(); + } + if (this.TravelEntertainmentAuthDataMarket != null) + { + hashCode = (hashCode * 59) + this.TravelEntertainmentAuthDataMarket.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataLodging additionalDataLodging, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataLodging.LodgingSpecialProgramCodeOption.IsSet && additionalDataLodging.LodgingSpecialProgramCode == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingSpecialProgramCode), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingCheckInDateOption.IsSet && additionalDataLodging.LodgingCheckInDate == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingCheckInDate), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingCheckOutDateOption.IsSet && additionalDataLodging.LodgingCheckOutDate == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingCheckOutDate), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingCustomerServiceTollFreeNumberOption.IsSet && additionalDataLodging.LodgingCustomerServiceTollFreeNumber == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingCustomerServiceTollFreeNumber), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingFireSafetyActIndicatorOption.IsSet && additionalDataLodging.LodgingFireSafetyActIndicator == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingFireSafetyActIndicator), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingFolioCashAdvancesOption.IsSet && additionalDataLodging.LodgingFolioCashAdvances == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingFolioCashAdvances), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingFolioNumberOption.IsSet && additionalDataLodging.LodgingFolioNumber == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingFolioNumber), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingFoodBeverageChargesOption.IsSet && additionalDataLodging.LodgingFoodBeverageCharges == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingFoodBeverageCharges), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingNoShowIndicatorOption.IsSet && additionalDataLodging.LodgingNoShowIndicator == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingNoShowIndicator), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingPrepaidExpensesOption.IsSet && additionalDataLodging.LodgingPrepaidExpenses == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingPrepaidExpenses), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingPropertyPhoneNumberOption.IsSet && additionalDataLodging.LodgingPropertyPhoneNumber == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingPropertyPhoneNumber), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingRoom1NumberOfNightsOption.IsSet && additionalDataLodging.LodgingRoom1NumberOfNights == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingRoom1NumberOfNights), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingRoom1RateOption.IsSet && additionalDataLodging.LodgingRoom1Rate == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingRoom1Rate), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingTotalRoomTaxOption.IsSet && additionalDataLodging.LodgingTotalRoomTax == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingTotalRoomTax), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingTotalTaxOption.IsSet && additionalDataLodging.LodgingTotalTax == null) - throw new ArgumentNullException(nameof(additionalDataLodging.LodgingTotalTax), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.TravelEntertainmentAuthDataDurationOption.IsSet && additionalDataLodging.TravelEntertainmentAuthDataDuration == null) - throw new ArgumentNullException(nameof(additionalDataLodging.TravelEntertainmentAuthDataDuration), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.TravelEntertainmentAuthDataMarketOption.IsSet && additionalDataLodging.TravelEntertainmentAuthDataMarket == null) - throw new ArgumentNullException(nameof(additionalDataLodging.TravelEntertainmentAuthDataMarket), "Property is required for class AdditionalDataLodging."); - - if (additionalDataLodging.LodgingSpecialProgramCodeOption.IsSet) - writer.WriteString("lodging.SpecialProgramCode", additionalDataLodging.LodgingSpecialProgramCode); - - if (additionalDataLodging.LodgingCheckInDateOption.IsSet) - writer.WriteString("lodging.checkInDate", additionalDataLodging.LodgingCheckInDate); - - if (additionalDataLodging.LodgingCheckOutDateOption.IsSet) - writer.WriteString("lodging.checkOutDate", additionalDataLodging.LodgingCheckOutDate); - - if (additionalDataLodging.LodgingCustomerServiceTollFreeNumberOption.IsSet) - writer.WriteString("lodging.customerServiceTollFreeNumber", additionalDataLodging.LodgingCustomerServiceTollFreeNumber); - - if (additionalDataLodging.LodgingFireSafetyActIndicatorOption.IsSet) - writer.WriteString("lodging.fireSafetyActIndicator", additionalDataLodging.LodgingFireSafetyActIndicator); - - if (additionalDataLodging.LodgingFolioCashAdvancesOption.IsSet) - writer.WriteString("lodging.folioCashAdvances", additionalDataLodging.LodgingFolioCashAdvances); - - if (additionalDataLodging.LodgingFolioNumberOption.IsSet) - writer.WriteString("lodging.folioNumber", additionalDataLodging.LodgingFolioNumber); - - if (additionalDataLodging.LodgingFoodBeverageChargesOption.IsSet) - writer.WriteString("lodging.foodBeverageCharges", additionalDataLodging.LodgingFoodBeverageCharges); - - if (additionalDataLodging.LodgingNoShowIndicatorOption.IsSet) - writer.WriteString("lodging.noShowIndicator", additionalDataLodging.LodgingNoShowIndicator); - - if (additionalDataLodging.LodgingPrepaidExpensesOption.IsSet) - writer.WriteString("lodging.prepaidExpenses", additionalDataLodging.LodgingPrepaidExpenses); - - if (additionalDataLodging.LodgingPropertyPhoneNumberOption.IsSet) - writer.WriteString("lodging.propertyPhoneNumber", additionalDataLodging.LodgingPropertyPhoneNumber); - - if (additionalDataLodging.LodgingRoom1NumberOfNightsOption.IsSet) - writer.WriteString("lodging.room1.numberOfNights", additionalDataLodging.LodgingRoom1NumberOfNights); - - if (additionalDataLodging.LodgingRoom1RateOption.IsSet) - writer.WriteString("lodging.room1.rate", additionalDataLodging.LodgingRoom1Rate); - - if (additionalDataLodging.LodgingTotalRoomTaxOption.IsSet) - writer.WriteString("lodging.totalRoomTax", additionalDataLodging.LodgingTotalRoomTax); - - if (additionalDataLodging.LodgingTotalTaxOption.IsSet) - writer.WriteString("lodging.totalTax", additionalDataLodging.LodgingTotalTax); - - if (additionalDataLodging.TravelEntertainmentAuthDataDurationOption.IsSet) - writer.WriteString("travelEntertainmentAuthData.duration", additionalDataLodging.TravelEntertainmentAuthDataDuration); - - if (additionalDataLodging.TravelEntertainmentAuthDataMarketOption.IsSet) - writer.WriteString("travelEntertainmentAuthData.market", additionalDataLodging.TravelEntertainmentAuthDataMarket); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs b/Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs index 4f4db3350..8b3216c85 100644 --- a/Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs +++ b/Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,318 +15,191 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataOpenInvoice /// - public partial class AdditionalDataOpenInvoice : IValidatableObject + [DataContract(Name = "AdditionalDataOpenInvoice")] + public partial class AdditionalDataOpenInvoice : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Holds different merchant data points like product, purchase, customer, and so on. It takes data in a Base64 encoded string. The `merchantData` parameter needs to be added to the `openinvoicedata` signature at the end. Since the field is optional, if it's not included it does not impact computing the merchant signature. Applies only to Klarna. You can contact Klarna for the format and structure of the string. - /// The number of invoice lines included in `openinvoicedata`. There needs to be at least one line, so `numberOfLines` needs to be at least 1. - /// First name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. - /// Last name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. - /// The three-character ISO currency code. - /// A text description of the product the invoice line refers to. - /// The price for one item in the invoice line, represented in minor units. The due amount for the item, VAT excluded. - /// A unique id for this item. Required for RatePay if the description of each item is not unique. - /// The VAT due for one item in the invoice line, represented in minor units. - /// The VAT percentage for one item in the invoice line, represented in minor units. For example, 19% VAT is specified as 1900. - /// The number of units purchased of a specific product. - /// Name of the shipping company handling the the return shipment. - /// The tracking number for the return of the shipment. - /// URI where the customer can track the return of their shipment. - /// Name of the shipping company handling the delivery. - /// Shipping method. - /// The tracking number for the shipment. - /// URI where the customer can track their shipment. - [JsonConstructor] - public AdditionalDataOpenInvoice(Option openinvoicedataMerchantData = default, Option openinvoicedataNumberOfLines = default, Option openinvoicedataRecipientFirstName = default, Option openinvoicedataRecipientLastName = default, Option openinvoicedataLineItemNrCurrencyCode = default, Option openinvoicedataLineItemNrDescription = default, Option openinvoicedataLineItemNrItemAmount = default, Option openinvoicedataLineItemNrItemId = default, Option openinvoicedataLineItemNrItemVatAmount = default, Option openinvoicedataLineItemNrItemVatPercentage = default, Option openinvoicedataLineItemNrNumberOfItems = default, Option openinvoicedataLineItemNrReturnShippingCompany = default, Option openinvoicedataLineItemNrReturnTrackingNumber = default, Option openinvoicedataLineItemNrReturnTrackingUri = default, Option openinvoicedataLineItemNrShippingCompany = default, Option openinvoicedataLineItemNrShippingMethod = default, Option openinvoicedataLineItemNrTrackingNumber = default, Option openinvoicedataLineItemNrTrackingUri = default) + /// Holds different merchant data points like product, purchase, customer, and so on. It takes data in a Base64 encoded string. The `merchantData` parameter needs to be added to the `openinvoicedata` signature at the end. Since the field is optional, if it's not included it does not impact computing the merchant signature. Applies only to Klarna. You can contact Klarna for the format and structure of the string.. + /// The number of invoice lines included in `openinvoicedata`. There needs to be at least one line, so `numberOfLines` needs to be at least 1.. + /// First name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna.. + /// Last name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna.. + /// The three-character ISO currency code.. + /// A text description of the product the invoice line refers to.. + /// The price for one item in the invoice line, represented in minor units. The due amount for the item, VAT excluded.. + /// A unique id for this item. Required for RatePay if the description of each item is not unique.. + /// The VAT due for one item in the invoice line, represented in minor units.. + /// The VAT percentage for one item in the invoice line, represented in minor units. For example, 19% VAT is specified as 1900.. + /// The number of units purchased of a specific product.. + /// Name of the shipping company handling the the return shipment.. + /// The tracking number for the return of the shipment.. + /// URI where the customer can track the return of their shipment.. + /// Name of the shipping company handling the delivery.. + /// Shipping method.. + /// The tracking number for the shipment.. + /// URI where the customer can track their shipment.. + public AdditionalDataOpenInvoice(string openinvoicedataMerchantData = default(string), string openinvoicedataNumberOfLines = default(string), string openinvoicedataRecipientFirstName = default(string), string openinvoicedataRecipientLastName = default(string), string openinvoicedataLineItemNrCurrencyCode = default(string), string openinvoicedataLineItemNrDescription = default(string), string openinvoicedataLineItemNrItemAmount = default(string), string openinvoicedataLineItemNrItemId = default(string), string openinvoicedataLineItemNrItemVatAmount = default(string), string openinvoicedataLineItemNrItemVatPercentage = default(string), string openinvoicedataLineItemNrNumberOfItems = default(string), string openinvoicedataLineItemNrReturnShippingCompany = default(string), string openinvoicedataLineItemNrReturnTrackingNumber = default(string), string openinvoicedataLineItemNrReturnTrackingUri = default(string), string openinvoicedataLineItemNrShippingCompany = default(string), string openinvoicedataLineItemNrShippingMethod = default(string), string openinvoicedataLineItemNrTrackingNumber = default(string), string openinvoicedataLineItemNrTrackingUri = default(string)) { - OpeninvoicedataMerchantDataOption = openinvoicedataMerchantData; - OpeninvoicedataNumberOfLinesOption = openinvoicedataNumberOfLines; - OpeninvoicedataRecipientFirstNameOption = openinvoicedataRecipientFirstName; - OpeninvoicedataRecipientLastNameOption = openinvoicedataRecipientLastName; - OpeninvoicedataLineItemNrCurrencyCodeOption = openinvoicedataLineItemNrCurrencyCode; - OpeninvoicedataLineItemNrDescriptionOption = openinvoicedataLineItemNrDescription; - OpeninvoicedataLineItemNrItemAmountOption = openinvoicedataLineItemNrItemAmount; - OpeninvoicedataLineItemNrItemIdOption = openinvoicedataLineItemNrItemId; - OpeninvoicedataLineItemNrItemVatAmountOption = openinvoicedataLineItemNrItemVatAmount; - OpeninvoicedataLineItemNrItemVatPercentageOption = openinvoicedataLineItemNrItemVatPercentage; - OpeninvoicedataLineItemNrNumberOfItemsOption = openinvoicedataLineItemNrNumberOfItems; - OpeninvoicedataLineItemNrReturnShippingCompanyOption = openinvoicedataLineItemNrReturnShippingCompany; - OpeninvoicedataLineItemNrReturnTrackingNumberOption = openinvoicedataLineItemNrReturnTrackingNumber; - OpeninvoicedataLineItemNrReturnTrackingUriOption = openinvoicedataLineItemNrReturnTrackingUri; - OpeninvoicedataLineItemNrShippingCompanyOption = openinvoicedataLineItemNrShippingCompany; - OpeninvoicedataLineItemNrShippingMethodOption = openinvoicedataLineItemNrShippingMethod; - OpeninvoicedataLineItemNrTrackingNumberOption = openinvoicedataLineItemNrTrackingNumber; - OpeninvoicedataLineItemNrTrackingUriOption = openinvoicedataLineItemNrTrackingUri; - OnCreated(); + this.OpeninvoicedataMerchantData = openinvoicedataMerchantData; + this.OpeninvoicedataNumberOfLines = openinvoicedataNumberOfLines; + this.OpeninvoicedataRecipientFirstName = openinvoicedataRecipientFirstName; + this.OpeninvoicedataRecipientLastName = openinvoicedataRecipientLastName; + this.OpeninvoicedataLineItemNrCurrencyCode = openinvoicedataLineItemNrCurrencyCode; + this.OpeninvoicedataLineItemNrDescription = openinvoicedataLineItemNrDescription; + this.OpeninvoicedataLineItemNrItemAmount = openinvoicedataLineItemNrItemAmount; + this.OpeninvoicedataLineItemNrItemId = openinvoicedataLineItemNrItemId; + this.OpeninvoicedataLineItemNrItemVatAmount = openinvoicedataLineItemNrItemVatAmount; + this.OpeninvoicedataLineItemNrItemVatPercentage = openinvoicedataLineItemNrItemVatPercentage; + this.OpeninvoicedataLineItemNrNumberOfItems = openinvoicedataLineItemNrNumberOfItems; + this.OpeninvoicedataLineItemNrReturnShippingCompany = openinvoicedataLineItemNrReturnShippingCompany; + this.OpeninvoicedataLineItemNrReturnTrackingNumber = openinvoicedataLineItemNrReturnTrackingNumber; + this.OpeninvoicedataLineItemNrReturnTrackingUri = openinvoicedataLineItemNrReturnTrackingUri; + this.OpeninvoicedataLineItemNrShippingCompany = openinvoicedataLineItemNrShippingCompany; + this.OpeninvoicedataLineItemNrShippingMethod = openinvoicedataLineItemNrShippingMethod; + this.OpeninvoicedataLineItemNrTrackingNumber = openinvoicedataLineItemNrTrackingNumber; + this.OpeninvoicedataLineItemNrTrackingUri = openinvoicedataLineItemNrTrackingUri; } - partial void OnCreated(); - - /// - /// Used to track the state of OpeninvoicedataMerchantData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataMerchantDataOption { get; private set; } - /// /// Holds different merchant data points like product, purchase, customer, and so on. It takes data in a Base64 encoded string. The `merchantData` parameter needs to be added to the `openinvoicedata` signature at the end. Since the field is optional, if it's not included it does not impact computing the merchant signature. Applies only to Klarna. You can contact Klarna for the format and structure of the string. /// /// Holds different merchant data points like product, purchase, customer, and so on. It takes data in a Base64 encoded string. The `merchantData` parameter needs to be added to the `openinvoicedata` signature at the end. Since the field is optional, if it's not included it does not impact computing the merchant signature. Applies only to Klarna. You can contact Klarna for the format and structure of the string. - [JsonPropertyName("openinvoicedata.merchantData")] - public string OpeninvoicedataMerchantData { get { return this.OpeninvoicedataMerchantDataOption; } set { this.OpeninvoicedataMerchantDataOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataNumberOfLines - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataNumberOfLinesOption { get; private set; } + [DataMember(Name = "openinvoicedata.merchantData", EmitDefaultValue = false)] + public string OpeninvoicedataMerchantData { get; set; } /// /// The number of invoice lines included in `openinvoicedata`. There needs to be at least one line, so `numberOfLines` needs to be at least 1. /// /// The number of invoice lines included in `openinvoicedata`. There needs to be at least one line, so `numberOfLines` needs to be at least 1. - [JsonPropertyName("openinvoicedata.numberOfLines")] - public string OpeninvoicedataNumberOfLines { get { return this.OpeninvoicedataNumberOfLinesOption; } set { this.OpeninvoicedataNumberOfLinesOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataRecipientFirstName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataRecipientFirstNameOption { get; private set; } + [DataMember(Name = "openinvoicedata.numberOfLines", EmitDefaultValue = false)] + public string OpeninvoicedataNumberOfLines { get; set; } /// /// First name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. /// /// First name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. - [JsonPropertyName("openinvoicedata.recipientFirstName")] - public string OpeninvoicedataRecipientFirstName { get { return this.OpeninvoicedataRecipientFirstNameOption; } set { this.OpeninvoicedataRecipientFirstNameOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataRecipientLastName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataRecipientLastNameOption { get; private set; } + [DataMember(Name = "openinvoicedata.recipientFirstName", EmitDefaultValue = false)] + public string OpeninvoicedataRecipientFirstName { get; set; } /// /// Last name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. /// /// Last name of the recipient. If the delivery address and the billing address are different, specify the `recipientFirstName` and `recipientLastName` to share the delivery address with Klarna. Otherwise, only the billing address is shared with Klarna. - [JsonPropertyName("openinvoicedata.recipientLastName")] - public string OpeninvoicedataRecipientLastName { get { return this.OpeninvoicedataRecipientLastNameOption; } set { this.OpeninvoicedataRecipientLastNameOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrCurrencyCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrCurrencyCodeOption { get; private set; } + [DataMember(Name = "openinvoicedata.recipientLastName", EmitDefaultValue = false)] + public string OpeninvoicedataRecipientLastName { get; set; } /// /// The three-character ISO currency code. /// /// The three-character ISO currency code. - [JsonPropertyName("openinvoicedataLine[itemNr].currencyCode")] - public string OpeninvoicedataLineItemNrCurrencyCode { get { return this.OpeninvoicedataLineItemNrCurrencyCodeOption; } set { this.OpeninvoicedataLineItemNrCurrencyCodeOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrDescription - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrDescriptionOption { get; private set; } + [DataMember(Name = "openinvoicedataLine[itemNr].currencyCode", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrCurrencyCode { get; set; } /// /// A text description of the product the invoice line refers to. /// /// A text description of the product the invoice line refers to. - [JsonPropertyName("openinvoicedataLine[itemNr].description")] - public string OpeninvoicedataLineItemNrDescription { get { return this.OpeninvoicedataLineItemNrDescriptionOption; } set { this.OpeninvoicedataLineItemNrDescriptionOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrItemAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrItemAmountOption { get; private set; } + [DataMember(Name = "openinvoicedataLine[itemNr].description", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrDescription { get; set; } /// /// The price for one item in the invoice line, represented in minor units. The due amount for the item, VAT excluded. /// /// The price for one item in the invoice line, represented in minor units. The due amount for the item, VAT excluded. - [JsonPropertyName("openinvoicedataLine[itemNr].itemAmount")] - public string OpeninvoicedataLineItemNrItemAmount { get { return this.OpeninvoicedataLineItemNrItemAmountOption; } set { this.OpeninvoicedataLineItemNrItemAmountOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrItemId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrItemIdOption { get; private set; } + [DataMember(Name = "openinvoicedataLine[itemNr].itemAmount", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrItemAmount { get; set; } /// /// A unique id for this item. Required for RatePay if the description of each item is not unique. /// /// A unique id for this item. Required for RatePay if the description of each item is not unique. - [JsonPropertyName("openinvoicedataLine[itemNr].itemId")] - public string OpeninvoicedataLineItemNrItemId { get { return this.OpeninvoicedataLineItemNrItemIdOption; } set { this.OpeninvoicedataLineItemNrItemIdOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrItemVatAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrItemVatAmountOption { get; private set; } + [DataMember(Name = "openinvoicedataLine[itemNr].itemId", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrItemId { get; set; } /// /// The VAT due for one item in the invoice line, represented in minor units. /// /// The VAT due for one item in the invoice line, represented in minor units. - [JsonPropertyName("openinvoicedataLine[itemNr].itemVatAmount")] - public string OpeninvoicedataLineItemNrItemVatAmount { get { return this.OpeninvoicedataLineItemNrItemVatAmountOption; } set { this.OpeninvoicedataLineItemNrItemVatAmountOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrItemVatPercentage - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrItemVatPercentageOption { get; private set; } + [DataMember(Name = "openinvoicedataLine[itemNr].itemVatAmount", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrItemVatAmount { get; set; } /// /// The VAT percentage for one item in the invoice line, represented in minor units. For example, 19% VAT is specified as 1900. /// /// The VAT percentage for one item in the invoice line, represented in minor units. For example, 19% VAT is specified as 1900. - [JsonPropertyName("openinvoicedataLine[itemNr].itemVatPercentage")] - public string OpeninvoicedataLineItemNrItemVatPercentage { get { return this.OpeninvoicedataLineItemNrItemVatPercentageOption; } set { this.OpeninvoicedataLineItemNrItemVatPercentageOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrNumberOfItems - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrNumberOfItemsOption { get; private set; } + [DataMember(Name = "openinvoicedataLine[itemNr].itemVatPercentage", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrItemVatPercentage { get; set; } /// /// The number of units purchased of a specific product. /// /// The number of units purchased of a specific product. - [JsonPropertyName("openinvoicedataLine[itemNr].numberOfItems")] - public string OpeninvoicedataLineItemNrNumberOfItems { get { return this.OpeninvoicedataLineItemNrNumberOfItemsOption; } set { this.OpeninvoicedataLineItemNrNumberOfItemsOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrReturnShippingCompany - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrReturnShippingCompanyOption { get; private set; } + [DataMember(Name = "openinvoicedataLine[itemNr].numberOfItems", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrNumberOfItems { get; set; } /// /// Name of the shipping company handling the the return shipment. /// /// Name of the shipping company handling the the return shipment. - [JsonPropertyName("openinvoicedataLine[itemNr].returnShippingCompany")] - public string OpeninvoicedataLineItemNrReturnShippingCompany { get { return this.OpeninvoicedataLineItemNrReturnShippingCompanyOption; } set { this.OpeninvoicedataLineItemNrReturnShippingCompanyOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrReturnTrackingNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrReturnTrackingNumberOption { get; private set; } + [DataMember(Name = "openinvoicedataLine[itemNr].returnShippingCompany", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrReturnShippingCompany { get; set; } /// /// The tracking number for the return of the shipment. /// /// The tracking number for the return of the shipment. - [JsonPropertyName("openinvoicedataLine[itemNr].returnTrackingNumber")] - public string OpeninvoicedataLineItemNrReturnTrackingNumber { get { return this.OpeninvoicedataLineItemNrReturnTrackingNumberOption; } set { this.OpeninvoicedataLineItemNrReturnTrackingNumberOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrReturnTrackingUri - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrReturnTrackingUriOption { get; private set; } + [DataMember(Name = "openinvoicedataLine[itemNr].returnTrackingNumber", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrReturnTrackingNumber { get; set; } /// /// URI where the customer can track the return of their shipment. /// /// URI where the customer can track the return of their shipment. - [JsonPropertyName("openinvoicedataLine[itemNr].returnTrackingUri")] - public string OpeninvoicedataLineItemNrReturnTrackingUri { get { return this.OpeninvoicedataLineItemNrReturnTrackingUriOption; } set { this.OpeninvoicedataLineItemNrReturnTrackingUriOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrShippingCompany - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrShippingCompanyOption { get; private set; } + [DataMember(Name = "openinvoicedataLine[itemNr].returnTrackingUri", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrReturnTrackingUri { get; set; } /// /// Name of the shipping company handling the delivery. /// /// Name of the shipping company handling the delivery. - [JsonPropertyName("openinvoicedataLine[itemNr].shippingCompany")] - public string OpeninvoicedataLineItemNrShippingCompany { get { return this.OpeninvoicedataLineItemNrShippingCompanyOption; } set { this.OpeninvoicedataLineItemNrShippingCompanyOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrShippingMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrShippingMethodOption { get; private set; } + [DataMember(Name = "openinvoicedataLine[itemNr].shippingCompany", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrShippingCompany { get; set; } /// /// Shipping method. /// /// Shipping method. - [JsonPropertyName("openinvoicedataLine[itemNr].shippingMethod")] - public string OpeninvoicedataLineItemNrShippingMethod { get { return this.OpeninvoicedataLineItemNrShippingMethodOption; } set { this.OpeninvoicedataLineItemNrShippingMethodOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrTrackingNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrTrackingNumberOption { get; private set; } + [DataMember(Name = "openinvoicedataLine[itemNr].shippingMethod", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrShippingMethod { get; set; } /// /// The tracking number for the shipment. /// /// The tracking number for the shipment. - [JsonPropertyName("openinvoicedataLine[itemNr].trackingNumber")] - public string OpeninvoicedataLineItemNrTrackingNumber { get { return this.OpeninvoicedataLineItemNrTrackingNumberOption; } set { this.OpeninvoicedataLineItemNrTrackingNumberOption = new Option(value); } } - - /// - /// Used to track the state of OpeninvoicedataLineItemNrTrackingUri - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpeninvoicedataLineItemNrTrackingUriOption { get; private set; } + [DataMember(Name = "openinvoicedataLine[itemNr].trackingNumber", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrTrackingNumber { get; set; } /// /// URI where the customer can track their shipment. /// /// URI where the customer can track their shipment. - [JsonPropertyName("openinvoicedataLine[itemNr].trackingUri")] - public string OpeninvoicedataLineItemNrTrackingUri { get { return this.OpeninvoicedataLineItemNrTrackingUriOption; } set { this.OpeninvoicedataLineItemNrTrackingUriOption = new Option(value); } } + [DataMember(Name = "openinvoicedataLine[itemNr].trackingUri", EmitDefaultValue = false)] + public string OpeninvoicedataLineItemNrTrackingUri { get; set; } /// /// Returns the string presentation of the object @@ -358,320 +232,221 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataOpenInvoiceJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataOpenInvoice Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option openinvoicedataMerchantData = default; - Option openinvoicedataNumberOfLines = default; - Option openinvoicedataRecipientFirstName = default; - Option openinvoicedataRecipientLastName = default; - Option openinvoicedataLineItemNrCurrencyCode = default; - Option openinvoicedataLineItemNrDescription = default; - Option openinvoicedataLineItemNrItemAmount = default; - Option openinvoicedataLineItemNrItemId = default; - Option openinvoicedataLineItemNrItemVatAmount = default; - Option openinvoicedataLineItemNrItemVatPercentage = default; - Option openinvoicedataLineItemNrNumberOfItems = default; - Option openinvoicedataLineItemNrReturnShippingCompany = default; - Option openinvoicedataLineItemNrReturnTrackingNumber = default; - Option openinvoicedataLineItemNrReturnTrackingUri = default; - Option openinvoicedataLineItemNrShippingCompany = default; - Option openinvoicedataLineItemNrShippingMethod = default; - Option openinvoicedataLineItemNrTrackingNumber = default; - Option openinvoicedataLineItemNrTrackingUri = default; + return this.Equals(input as AdditionalDataOpenInvoice); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AdditionalDataOpenInvoice instances are equal + /// + /// Instance of AdditionalDataOpenInvoice to be compared + /// Boolean + public bool Equals(AdditionalDataOpenInvoice input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "openinvoicedata.merchantData": - openinvoicedataMerchantData = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedata.numberOfLines": - openinvoicedataNumberOfLines = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedata.recipientFirstName": - openinvoicedataRecipientFirstName = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedata.recipientLastName": - openinvoicedataRecipientLastName = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].currencyCode": - openinvoicedataLineItemNrCurrencyCode = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].description": - openinvoicedataLineItemNrDescription = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].itemAmount": - openinvoicedataLineItemNrItemAmount = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].itemId": - openinvoicedataLineItemNrItemId = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].itemVatAmount": - openinvoicedataLineItemNrItemVatAmount = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].itemVatPercentage": - openinvoicedataLineItemNrItemVatPercentage = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].numberOfItems": - openinvoicedataLineItemNrNumberOfItems = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].returnShippingCompany": - openinvoicedataLineItemNrReturnShippingCompany = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].returnTrackingNumber": - openinvoicedataLineItemNrReturnTrackingNumber = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].returnTrackingUri": - openinvoicedataLineItemNrReturnTrackingUri = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].shippingCompany": - openinvoicedataLineItemNrShippingCompany = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].shippingMethod": - openinvoicedataLineItemNrShippingMethod = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].trackingNumber": - openinvoicedataLineItemNrTrackingNumber = new Option(utf8JsonReader.GetString()); - break; - case "openinvoicedataLine[itemNr].trackingUri": - openinvoicedataLineItemNrTrackingUri = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (openinvoicedataMerchantData.IsSet && openinvoicedataMerchantData.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataMerchantData), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataNumberOfLines.IsSet && openinvoicedataNumberOfLines.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataNumberOfLines), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataRecipientFirstName.IsSet && openinvoicedataRecipientFirstName.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataRecipientFirstName), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataRecipientLastName.IsSet && openinvoicedataRecipientLastName.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataRecipientLastName), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrCurrencyCode.IsSet && openinvoicedataLineItemNrCurrencyCode.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrCurrencyCode), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrDescription.IsSet && openinvoicedataLineItemNrDescription.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrDescription), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrItemAmount.IsSet && openinvoicedataLineItemNrItemAmount.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrItemAmount), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrItemId.IsSet && openinvoicedataLineItemNrItemId.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrItemId), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrItemVatAmount.IsSet && openinvoicedataLineItemNrItemVatAmount.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrItemVatAmount), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrItemVatPercentage.IsSet && openinvoicedataLineItemNrItemVatPercentage.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrItemVatPercentage), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrNumberOfItems.IsSet && openinvoicedataLineItemNrNumberOfItems.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrNumberOfItems), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrReturnShippingCompany.IsSet && openinvoicedataLineItemNrReturnShippingCompany.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrReturnShippingCompany), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrReturnTrackingNumber.IsSet && openinvoicedataLineItemNrReturnTrackingNumber.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrReturnTrackingNumber), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrReturnTrackingUri.IsSet && openinvoicedataLineItemNrReturnTrackingUri.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrReturnTrackingUri), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrShippingCompany.IsSet && openinvoicedataLineItemNrShippingCompany.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrShippingCompany), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrShippingMethod.IsSet && openinvoicedataLineItemNrShippingMethod.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrShippingMethod), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrTrackingNumber.IsSet && openinvoicedataLineItemNrTrackingNumber.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrTrackingNumber), "Property is not nullable for class AdditionalDataOpenInvoice."); - - if (openinvoicedataLineItemNrTrackingUri.IsSet && openinvoicedataLineItemNrTrackingUri.Value == null) - throw new ArgumentNullException(nameof(openinvoicedataLineItemNrTrackingUri), "Property is not nullable for class AdditionalDataOpenInvoice."); - - return new AdditionalDataOpenInvoice(openinvoicedataMerchantData, openinvoicedataNumberOfLines, openinvoicedataRecipientFirstName, openinvoicedataRecipientLastName, openinvoicedataLineItemNrCurrencyCode, openinvoicedataLineItemNrDescription, openinvoicedataLineItemNrItemAmount, openinvoicedataLineItemNrItemId, openinvoicedataLineItemNrItemVatAmount, openinvoicedataLineItemNrItemVatPercentage, openinvoicedataLineItemNrNumberOfItems, openinvoicedataLineItemNrReturnShippingCompany, openinvoicedataLineItemNrReturnTrackingNumber, openinvoicedataLineItemNrReturnTrackingUri, openinvoicedataLineItemNrShippingCompany, openinvoicedataLineItemNrShippingMethod, openinvoicedataLineItemNrTrackingNumber, openinvoicedataLineItemNrTrackingUri); + return + ( + this.OpeninvoicedataMerchantData == input.OpeninvoicedataMerchantData || + (this.OpeninvoicedataMerchantData != null && + this.OpeninvoicedataMerchantData.Equals(input.OpeninvoicedataMerchantData)) + ) && + ( + this.OpeninvoicedataNumberOfLines == input.OpeninvoicedataNumberOfLines || + (this.OpeninvoicedataNumberOfLines != null && + this.OpeninvoicedataNumberOfLines.Equals(input.OpeninvoicedataNumberOfLines)) + ) && + ( + this.OpeninvoicedataRecipientFirstName == input.OpeninvoicedataRecipientFirstName || + (this.OpeninvoicedataRecipientFirstName != null && + this.OpeninvoicedataRecipientFirstName.Equals(input.OpeninvoicedataRecipientFirstName)) + ) && + ( + this.OpeninvoicedataRecipientLastName == input.OpeninvoicedataRecipientLastName || + (this.OpeninvoicedataRecipientLastName != null && + this.OpeninvoicedataRecipientLastName.Equals(input.OpeninvoicedataRecipientLastName)) + ) && + ( + this.OpeninvoicedataLineItemNrCurrencyCode == input.OpeninvoicedataLineItemNrCurrencyCode || + (this.OpeninvoicedataLineItemNrCurrencyCode != null && + this.OpeninvoicedataLineItemNrCurrencyCode.Equals(input.OpeninvoicedataLineItemNrCurrencyCode)) + ) && + ( + this.OpeninvoicedataLineItemNrDescription == input.OpeninvoicedataLineItemNrDescription || + (this.OpeninvoicedataLineItemNrDescription != null && + this.OpeninvoicedataLineItemNrDescription.Equals(input.OpeninvoicedataLineItemNrDescription)) + ) && + ( + this.OpeninvoicedataLineItemNrItemAmount == input.OpeninvoicedataLineItemNrItemAmount || + (this.OpeninvoicedataLineItemNrItemAmount != null && + this.OpeninvoicedataLineItemNrItemAmount.Equals(input.OpeninvoicedataLineItemNrItemAmount)) + ) && + ( + this.OpeninvoicedataLineItemNrItemId == input.OpeninvoicedataLineItemNrItemId || + (this.OpeninvoicedataLineItemNrItemId != null && + this.OpeninvoicedataLineItemNrItemId.Equals(input.OpeninvoicedataLineItemNrItemId)) + ) && + ( + this.OpeninvoicedataLineItemNrItemVatAmount == input.OpeninvoicedataLineItemNrItemVatAmount || + (this.OpeninvoicedataLineItemNrItemVatAmount != null && + this.OpeninvoicedataLineItemNrItemVatAmount.Equals(input.OpeninvoicedataLineItemNrItemVatAmount)) + ) && + ( + this.OpeninvoicedataLineItemNrItemVatPercentage == input.OpeninvoicedataLineItemNrItemVatPercentage || + (this.OpeninvoicedataLineItemNrItemVatPercentage != null && + this.OpeninvoicedataLineItemNrItemVatPercentage.Equals(input.OpeninvoicedataLineItemNrItemVatPercentage)) + ) && + ( + this.OpeninvoicedataLineItemNrNumberOfItems == input.OpeninvoicedataLineItemNrNumberOfItems || + (this.OpeninvoicedataLineItemNrNumberOfItems != null && + this.OpeninvoicedataLineItemNrNumberOfItems.Equals(input.OpeninvoicedataLineItemNrNumberOfItems)) + ) && + ( + this.OpeninvoicedataLineItemNrReturnShippingCompany == input.OpeninvoicedataLineItemNrReturnShippingCompany || + (this.OpeninvoicedataLineItemNrReturnShippingCompany != null && + this.OpeninvoicedataLineItemNrReturnShippingCompany.Equals(input.OpeninvoicedataLineItemNrReturnShippingCompany)) + ) && + ( + this.OpeninvoicedataLineItemNrReturnTrackingNumber == input.OpeninvoicedataLineItemNrReturnTrackingNumber || + (this.OpeninvoicedataLineItemNrReturnTrackingNumber != null && + this.OpeninvoicedataLineItemNrReturnTrackingNumber.Equals(input.OpeninvoicedataLineItemNrReturnTrackingNumber)) + ) && + ( + this.OpeninvoicedataLineItemNrReturnTrackingUri == input.OpeninvoicedataLineItemNrReturnTrackingUri || + (this.OpeninvoicedataLineItemNrReturnTrackingUri != null && + this.OpeninvoicedataLineItemNrReturnTrackingUri.Equals(input.OpeninvoicedataLineItemNrReturnTrackingUri)) + ) && + ( + this.OpeninvoicedataLineItemNrShippingCompany == input.OpeninvoicedataLineItemNrShippingCompany || + (this.OpeninvoicedataLineItemNrShippingCompany != null && + this.OpeninvoicedataLineItemNrShippingCompany.Equals(input.OpeninvoicedataLineItemNrShippingCompany)) + ) && + ( + this.OpeninvoicedataLineItemNrShippingMethod == input.OpeninvoicedataLineItemNrShippingMethod || + (this.OpeninvoicedataLineItemNrShippingMethod != null && + this.OpeninvoicedataLineItemNrShippingMethod.Equals(input.OpeninvoicedataLineItemNrShippingMethod)) + ) && + ( + this.OpeninvoicedataLineItemNrTrackingNumber == input.OpeninvoicedataLineItemNrTrackingNumber || + (this.OpeninvoicedataLineItemNrTrackingNumber != null && + this.OpeninvoicedataLineItemNrTrackingNumber.Equals(input.OpeninvoicedataLineItemNrTrackingNumber)) + ) && + ( + this.OpeninvoicedataLineItemNrTrackingUri == input.OpeninvoicedataLineItemNrTrackingUri || + (this.OpeninvoicedataLineItemNrTrackingUri != null && + this.OpeninvoicedataLineItemNrTrackingUri.Equals(input.OpeninvoicedataLineItemNrTrackingUri)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataOpenInvoice additionalDataOpenInvoice, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataOpenInvoice, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.OpeninvoicedataMerchantData != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataMerchantData.GetHashCode(); + } + if (this.OpeninvoicedataNumberOfLines != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataNumberOfLines.GetHashCode(); + } + if (this.OpeninvoicedataRecipientFirstName != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataRecipientFirstName.GetHashCode(); + } + if (this.OpeninvoicedataRecipientLastName != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataRecipientLastName.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrCurrencyCode != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrCurrencyCode.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrDescription != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrDescription.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrItemAmount != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrItemAmount.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrItemId != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrItemId.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrItemVatAmount != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrItemVatAmount.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrItemVatPercentage != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrItemVatPercentage.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrNumberOfItems != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrNumberOfItems.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrReturnShippingCompany != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrReturnShippingCompany.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrReturnTrackingNumber != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrReturnTrackingNumber.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrReturnTrackingUri != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrReturnTrackingUri.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrShippingCompany != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrShippingCompany.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrShippingMethod != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrShippingMethod.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrTrackingNumber != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrTrackingNumber.GetHashCode(); + } + if (this.OpeninvoicedataLineItemNrTrackingUri != null) + { + hashCode = (hashCode * 59) + this.OpeninvoicedataLineItemNrTrackingUri.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataOpenInvoice additionalDataOpenInvoice, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataOpenInvoice.OpeninvoicedataMerchantDataOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataMerchantData == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataMerchantData), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataNumberOfLinesOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataNumberOfLines == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataNumberOfLines), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataRecipientFirstNameOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataRecipientFirstName == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataRecipientFirstName), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataRecipientLastNameOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataRecipientLastName == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataRecipientLastName), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrCurrencyCodeOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrCurrencyCode == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrCurrencyCode), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrDescriptionOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrDescription == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrDescription), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemAmountOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemAmount == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemAmount), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemIdOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemId == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemId), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatAmountOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatAmount == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatAmount), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatPercentageOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatPercentage == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatPercentage), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrNumberOfItemsOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrNumberOfItems == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrNumberOfItems), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnShippingCompanyOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnShippingCompany == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnShippingCompany), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingNumberOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingNumber == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingNumber), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingUriOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingUri == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingUri), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingCompanyOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingCompany == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingCompany), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingMethodOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingMethod == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingMethod), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingNumberOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingNumber == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingNumber), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingUriOption.IsSet && additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingUri == null) - throw new ArgumentNullException(nameof(additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingUri), "Property is required for class AdditionalDataOpenInvoice."); - - if (additionalDataOpenInvoice.OpeninvoicedataMerchantDataOption.IsSet) - writer.WriteString("openinvoicedata.merchantData", additionalDataOpenInvoice.OpeninvoicedataMerchantData); - - if (additionalDataOpenInvoice.OpeninvoicedataNumberOfLinesOption.IsSet) - writer.WriteString("openinvoicedata.numberOfLines", additionalDataOpenInvoice.OpeninvoicedataNumberOfLines); - - if (additionalDataOpenInvoice.OpeninvoicedataRecipientFirstNameOption.IsSet) - writer.WriteString("openinvoicedata.recipientFirstName", additionalDataOpenInvoice.OpeninvoicedataRecipientFirstName); - - if (additionalDataOpenInvoice.OpeninvoicedataRecipientLastNameOption.IsSet) - writer.WriteString("openinvoicedata.recipientLastName", additionalDataOpenInvoice.OpeninvoicedataRecipientLastName); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrCurrencyCodeOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].currencyCode", additionalDataOpenInvoice.OpeninvoicedataLineItemNrCurrencyCode); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrDescriptionOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].description", additionalDataOpenInvoice.OpeninvoicedataLineItemNrDescription); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemAmountOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].itemAmount", additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemAmount); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemIdOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].itemId", additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemId); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatAmountOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].itemVatAmount", additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatAmount); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatPercentageOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].itemVatPercentage", additionalDataOpenInvoice.OpeninvoicedataLineItemNrItemVatPercentage); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrNumberOfItemsOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].numberOfItems", additionalDataOpenInvoice.OpeninvoicedataLineItemNrNumberOfItems); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnShippingCompanyOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].returnShippingCompany", additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnShippingCompany); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingNumberOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].returnTrackingNumber", additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingNumber); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingUriOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].returnTrackingUri", additionalDataOpenInvoice.OpeninvoicedataLineItemNrReturnTrackingUri); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingCompanyOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].shippingCompany", additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingCompany); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingMethodOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].shippingMethod", additionalDataOpenInvoice.OpeninvoicedataLineItemNrShippingMethod); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingNumberOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].trackingNumber", additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingNumber); - - if (additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingUriOption.IsSet) - writer.WriteString("openinvoicedataLine[itemNr].trackingUri", additionalDataOpenInvoice.OpeninvoicedataLineItemNrTrackingUri); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataOpi.cs b/Adyen/Model/Checkout/AdditionalDataOpi.cs index 48f33b856..19f3a472f 100644 --- a/Adyen/Model/Checkout/AdditionalDataOpi.cs +++ b/Adyen/Model/Checkout/AdditionalDataOpi.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,46 +15,38 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataOpi /// - public partial class AdditionalDataOpi : IValidatableObject + [DataContract(Name = "AdditionalDataOpi")] + public partial class AdditionalDataOpi : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Optional boolean indicator. Set to **true** if you want an ecommerce transaction to return an `opi.transToken` as additional data in the response. You can store this Oracle Payment Interface token in your Oracle Opera database. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). - [JsonConstructor] - public AdditionalDataOpi(Option opiIncludeTransToken = default) + /// Optional boolean indicator. Set to **true** if you want an ecommerce transaction to return an `opi.transToken` as additional data in the response. You can store this Oracle Payment Interface token in your Oracle Opera database. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce).. + public AdditionalDataOpi(string opiIncludeTransToken = default(string)) { - OpiIncludeTransTokenOption = opiIncludeTransToken; - OnCreated(); + this.OpiIncludeTransToken = opiIncludeTransToken; } - partial void OnCreated(); - - /// - /// Used to track the state of OpiIncludeTransToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpiIncludeTransTokenOption { get; private set; } - /// /// Optional boolean indicator. Set to **true** if you want an ecommerce transaction to return an `opi.transToken` as additional data in the response. You can store this Oracle Payment Interface token in your Oracle Opera database. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). /// /// Optional boolean indicator. Set to **true** if you want an ecommerce transaction to return an `opi.transToken` as additional data in the response. You can store this Oracle Payment Interface token in your Oracle Opera database. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). - [JsonPropertyName("opi.includeTransToken")] - public string OpiIncludeTransToken { get { return this.OpiIncludeTransTokenOption; } set { this.OpiIncludeTransTokenOption = new Option(value); } } + [DataMember(Name = "opi.includeTransToken", EmitDefaultValue = false)] + public string OpiIncludeTransToken { get; set; } /// /// Returns the string presentation of the object @@ -69,99 +62,68 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataOpiJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataOpi Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option opiIncludeTransToken = default; + return this.Equals(input as AdditionalDataOpi); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AdditionalDataOpi instances are equal + /// + /// Instance of AdditionalDataOpi to be compared + /// Boolean + public bool Equals(AdditionalDataOpi input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "opi.includeTransToken": - opiIncludeTransToken = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (opiIncludeTransToken.IsSet && opiIncludeTransToken.Value == null) - throw new ArgumentNullException(nameof(opiIncludeTransToken), "Property is not nullable for class AdditionalDataOpi."); - - return new AdditionalDataOpi(opiIncludeTransToken); + return + ( + this.OpiIncludeTransToken == input.OpiIncludeTransToken || + (this.OpiIncludeTransToken != null && + this.OpiIncludeTransToken.Equals(input.OpiIncludeTransToken)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataOpi additionalDataOpi, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataOpi, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.OpiIncludeTransToken != null) + { + hashCode = (hashCode * 59) + this.OpiIncludeTransToken.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataOpi additionalDataOpi, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataOpi.OpiIncludeTransTokenOption.IsSet && additionalDataOpi.OpiIncludeTransToken == null) - throw new ArgumentNullException(nameof(additionalDataOpi.OpiIncludeTransToken), "Property is required for class AdditionalDataOpi."); - - if (additionalDataOpi.OpiIncludeTransTokenOption.IsSet) - writer.WriteString("opi.includeTransToken", additionalDataOpi.OpiIncludeTransToken); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataRatepay.cs b/Adyen/Model/Checkout/AdditionalDataRatepay.cs index 0d622ad47..9e8a5a351 100644 --- a/Adyen/Model/Checkout/AdditionalDataRatepay.cs +++ b/Adyen/Model/Checkout/AdditionalDataRatepay.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,158 +15,101 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataRatepay /// - public partial class AdditionalDataRatepay : IValidatableObject + [DataContract(Name = "AdditionalDataRatepay")] + public partial class AdditionalDataRatepay : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Amount the customer has to pay each month. - /// Interest rate of this installment. - /// Amount of the last installment. - /// Calendar day of the first payment. - /// Date the merchant delivered the goods to the customer. - /// Date by which the customer must settle the payment. - /// Invoice date, defined by the merchant. If not included, the invoice date is set to the delivery date. - /// Identification name or number for the invoice, defined by the merchant. - [JsonConstructor] - public AdditionalDataRatepay(Option ratepayInstallmentAmount = default, Option ratepayInterestRate = default, Option ratepayLastInstallmentAmount = default, Option ratepayPaymentFirstday = default, Option ratepaydataDeliveryDate = default, Option ratepaydataDueDate = default, Option ratepaydataInvoiceDate = default, Option ratepaydataInvoiceId = default) + /// Amount the customer has to pay each month.. + /// Interest rate of this installment.. + /// Amount of the last installment.. + /// Calendar day of the first payment.. + /// Date the merchant delivered the goods to the customer.. + /// Date by which the customer must settle the payment.. + /// Invoice date, defined by the merchant. If not included, the invoice date is set to the delivery date.. + /// Identification name or number for the invoice, defined by the merchant.. + public AdditionalDataRatepay(string ratepayInstallmentAmount = default(string), string ratepayInterestRate = default(string), string ratepayLastInstallmentAmount = default(string), string ratepayPaymentFirstday = default(string), string ratepaydataDeliveryDate = default(string), string ratepaydataDueDate = default(string), string ratepaydataInvoiceDate = default(string), string ratepaydataInvoiceId = default(string)) { - RatepayInstallmentAmountOption = ratepayInstallmentAmount; - RatepayInterestRateOption = ratepayInterestRate; - RatepayLastInstallmentAmountOption = ratepayLastInstallmentAmount; - RatepayPaymentFirstdayOption = ratepayPaymentFirstday; - RatepaydataDeliveryDateOption = ratepaydataDeliveryDate; - RatepaydataDueDateOption = ratepaydataDueDate; - RatepaydataInvoiceDateOption = ratepaydataInvoiceDate; - RatepaydataInvoiceIdOption = ratepaydataInvoiceId; - OnCreated(); + this.RatepayInstallmentAmount = ratepayInstallmentAmount; + this.RatepayInterestRate = ratepayInterestRate; + this.RatepayLastInstallmentAmount = ratepayLastInstallmentAmount; + this.RatepayPaymentFirstday = ratepayPaymentFirstday; + this.RatepaydataDeliveryDate = ratepaydataDeliveryDate; + this.RatepaydataDueDate = ratepaydataDueDate; + this.RatepaydataInvoiceDate = ratepaydataInvoiceDate; + this.RatepaydataInvoiceId = ratepaydataInvoiceId; } - partial void OnCreated(); - - /// - /// Used to track the state of RatepayInstallmentAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RatepayInstallmentAmountOption { get; private set; } - /// /// Amount the customer has to pay each month. /// /// Amount the customer has to pay each month. - [JsonPropertyName("ratepay.installmentAmount")] - public string RatepayInstallmentAmount { get { return this.RatepayInstallmentAmountOption; } set { this.RatepayInstallmentAmountOption = new Option(value); } } - - /// - /// Used to track the state of RatepayInterestRate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RatepayInterestRateOption { get; private set; } + [DataMember(Name = "ratepay.installmentAmount", EmitDefaultValue = false)] + public string RatepayInstallmentAmount { get; set; } /// /// Interest rate of this installment. /// /// Interest rate of this installment. - [JsonPropertyName("ratepay.interestRate")] - public string RatepayInterestRate { get { return this.RatepayInterestRateOption; } set { this.RatepayInterestRateOption = new Option(value); } } - - /// - /// Used to track the state of RatepayLastInstallmentAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RatepayLastInstallmentAmountOption { get; private set; } + [DataMember(Name = "ratepay.interestRate", EmitDefaultValue = false)] + public string RatepayInterestRate { get; set; } /// /// Amount of the last installment. /// /// Amount of the last installment. - [JsonPropertyName("ratepay.lastInstallmentAmount")] - public string RatepayLastInstallmentAmount { get { return this.RatepayLastInstallmentAmountOption; } set { this.RatepayLastInstallmentAmountOption = new Option(value); } } - - /// - /// Used to track the state of RatepayPaymentFirstday - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RatepayPaymentFirstdayOption { get; private set; } + [DataMember(Name = "ratepay.lastInstallmentAmount", EmitDefaultValue = false)] + public string RatepayLastInstallmentAmount { get; set; } /// /// Calendar day of the first payment. /// /// Calendar day of the first payment. - [JsonPropertyName("ratepay.paymentFirstday")] - public string RatepayPaymentFirstday { get { return this.RatepayPaymentFirstdayOption; } set { this.RatepayPaymentFirstdayOption = new Option(value); } } - - /// - /// Used to track the state of RatepaydataDeliveryDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RatepaydataDeliveryDateOption { get; private set; } + [DataMember(Name = "ratepay.paymentFirstday", EmitDefaultValue = false)] + public string RatepayPaymentFirstday { get; set; } /// /// Date the merchant delivered the goods to the customer. /// /// Date the merchant delivered the goods to the customer. - [JsonPropertyName("ratepaydata.deliveryDate")] - public string RatepaydataDeliveryDate { get { return this.RatepaydataDeliveryDateOption; } set { this.RatepaydataDeliveryDateOption = new Option(value); } } - - /// - /// Used to track the state of RatepaydataDueDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RatepaydataDueDateOption { get; private set; } + [DataMember(Name = "ratepaydata.deliveryDate", EmitDefaultValue = false)] + public string RatepaydataDeliveryDate { get; set; } /// /// Date by which the customer must settle the payment. /// /// Date by which the customer must settle the payment. - [JsonPropertyName("ratepaydata.dueDate")] - public string RatepaydataDueDate { get { return this.RatepaydataDueDateOption; } set { this.RatepaydataDueDateOption = new Option(value); } } - - /// - /// Used to track the state of RatepaydataInvoiceDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RatepaydataInvoiceDateOption { get; private set; } + [DataMember(Name = "ratepaydata.dueDate", EmitDefaultValue = false)] + public string RatepaydataDueDate { get; set; } /// /// Invoice date, defined by the merchant. If not included, the invoice date is set to the delivery date. /// /// Invoice date, defined by the merchant. If not included, the invoice date is set to the delivery date. - [JsonPropertyName("ratepaydata.invoiceDate")] - public string RatepaydataInvoiceDate { get { return this.RatepaydataInvoiceDateOption; } set { this.RatepaydataInvoiceDateOption = new Option(value); } } - - /// - /// Used to track the state of RatepaydataInvoiceId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RatepaydataInvoiceIdOption { get; private set; } + [DataMember(Name = "ratepaydata.invoiceDate", EmitDefaultValue = false)] + public string RatepaydataInvoiceDate { get; set; } /// /// Identification name or number for the invoice, defined by the merchant. /// /// Identification name or number for the invoice, defined by the merchant. - [JsonPropertyName("ratepaydata.invoiceId")] - public string RatepaydataInvoiceId { get { return this.RatepaydataInvoiceIdOption; } set { this.RatepaydataInvoiceIdOption = new Option(value); } } + [DataMember(Name = "ratepaydata.invoiceId", EmitDefaultValue = false)] + public string RatepaydataInvoiceId { get; set; } /// /// Returns the string presentation of the object @@ -188,190 +132,131 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataRatepayJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataRatepay Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option ratepayInstallmentAmount = default; - Option ratepayInterestRate = default; - Option ratepayLastInstallmentAmount = default; - Option ratepayPaymentFirstday = default; - Option ratepaydataDeliveryDate = default; - Option ratepaydataDueDate = default; - Option ratepaydataInvoiceDate = default; - Option ratepaydataInvoiceId = default; + return this.Equals(input as AdditionalDataRatepay); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AdditionalDataRatepay instances are equal + /// + /// Instance of AdditionalDataRatepay to be compared + /// Boolean + public bool Equals(AdditionalDataRatepay input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "ratepay.installmentAmount": - ratepayInstallmentAmount = new Option(utf8JsonReader.GetString()); - break; - case "ratepay.interestRate": - ratepayInterestRate = new Option(utf8JsonReader.GetString()); - break; - case "ratepay.lastInstallmentAmount": - ratepayLastInstallmentAmount = new Option(utf8JsonReader.GetString()); - break; - case "ratepay.paymentFirstday": - ratepayPaymentFirstday = new Option(utf8JsonReader.GetString()); - break; - case "ratepaydata.deliveryDate": - ratepaydataDeliveryDate = new Option(utf8JsonReader.GetString()); - break; - case "ratepaydata.dueDate": - ratepaydataDueDate = new Option(utf8JsonReader.GetString()); - break; - case "ratepaydata.invoiceDate": - ratepaydataInvoiceDate = new Option(utf8JsonReader.GetString()); - break; - case "ratepaydata.invoiceId": - ratepaydataInvoiceId = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (ratepayInstallmentAmount.IsSet && ratepayInstallmentAmount.Value == null) - throw new ArgumentNullException(nameof(ratepayInstallmentAmount), "Property is not nullable for class AdditionalDataRatepay."); - - if (ratepayInterestRate.IsSet && ratepayInterestRate.Value == null) - throw new ArgumentNullException(nameof(ratepayInterestRate), "Property is not nullable for class AdditionalDataRatepay."); - - if (ratepayLastInstallmentAmount.IsSet && ratepayLastInstallmentAmount.Value == null) - throw new ArgumentNullException(nameof(ratepayLastInstallmentAmount), "Property is not nullable for class AdditionalDataRatepay."); - - if (ratepayPaymentFirstday.IsSet && ratepayPaymentFirstday.Value == null) - throw new ArgumentNullException(nameof(ratepayPaymentFirstday), "Property is not nullable for class AdditionalDataRatepay."); - - if (ratepaydataDeliveryDate.IsSet && ratepaydataDeliveryDate.Value == null) - throw new ArgumentNullException(nameof(ratepaydataDeliveryDate), "Property is not nullable for class AdditionalDataRatepay."); - - if (ratepaydataDueDate.IsSet && ratepaydataDueDate.Value == null) - throw new ArgumentNullException(nameof(ratepaydataDueDate), "Property is not nullable for class AdditionalDataRatepay."); - - if (ratepaydataInvoiceDate.IsSet && ratepaydataInvoiceDate.Value == null) - throw new ArgumentNullException(nameof(ratepaydataInvoiceDate), "Property is not nullable for class AdditionalDataRatepay."); - - if (ratepaydataInvoiceId.IsSet && ratepaydataInvoiceId.Value == null) - throw new ArgumentNullException(nameof(ratepaydataInvoiceId), "Property is not nullable for class AdditionalDataRatepay."); - - return new AdditionalDataRatepay(ratepayInstallmentAmount, ratepayInterestRate, ratepayLastInstallmentAmount, ratepayPaymentFirstday, ratepaydataDeliveryDate, ratepaydataDueDate, ratepaydataInvoiceDate, ratepaydataInvoiceId); + return + ( + this.RatepayInstallmentAmount == input.RatepayInstallmentAmount || + (this.RatepayInstallmentAmount != null && + this.RatepayInstallmentAmount.Equals(input.RatepayInstallmentAmount)) + ) && + ( + this.RatepayInterestRate == input.RatepayInterestRate || + (this.RatepayInterestRate != null && + this.RatepayInterestRate.Equals(input.RatepayInterestRate)) + ) && + ( + this.RatepayLastInstallmentAmount == input.RatepayLastInstallmentAmount || + (this.RatepayLastInstallmentAmount != null && + this.RatepayLastInstallmentAmount.Equals(input.RatepayLastInstallmentAmount)) + ) && + ( + this.RatepayPaymentFirstday == input.RatepayPaymentFirstday || + (this.RatepayPaymentFirstday != null && + this.RatepayPaymentFirstday.Equals(input.RatepayPaymentFirstday)) + ) && + ( + this.RatepaydataDeliveryDate == input.RatepaydataDeliveryDate || + (this.RatepaydataDeliveryDate != null && + this.RatepaydataDeliveryDate.Equals(input.RatepaydataDeliveryDate)) + ) && + ( + this.RatepaydataDueDate == input.RatepaydataDueDate || + (this.RatepaydataDueDate != null && + this.RatepaydataDueDate.Equals(input.RatepaydataDueDate)) + ) && + ( + this.RatepaydataInvoiceDate == input.RatepaydataInvoiceDate || + (this.RatepaydataInvoiceDate != null && + this.RatepaydataInvoiceDate.Equals(input.RatepaydataInvoiceDate)) + ) && + ( + this.RatepaydataInvoiceId == input.RatepaydataInvoiceId || + (this.RatepaydataInvoiceId != null && + this.RatepaydataInvoiceId.Equals(input.RatepaydataInvoiceId)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataRatepay additionalDataRatepay, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataRatepay, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.RatepayInstallmentAmount != null) + { + hashCode = (hashCode * 59) + this.RatepayInstallmentAmount.GetHashCode(); + } + if (this.RatepayInterestRate != null) + { + hashCode = (hashCode * 59) + this.RatepayInterestRate.GetHashCode(); + } + if (this.RatepayLastInstallmentAmount != null) + { + hashCode = (hashCode * 59) + this.RatepayLastInstallmentAmount.GetHashCode(); + } + if (this.RatepayPaymentFirstday != null) + { + hashCode = (hashCode * 59) + this.RatepayPaymentFirstday.GetHashCode(); + } + if (this.RatepaydataDeliveryDate != null) + { + hashCode = (hashCode * 59) + this.RatepaydataDeliveryDate.GetHashCode(); + } + if (this.RatepaydataDueDate != null) + { + hashCode = (hashCode * 59) + this.RatepaydataDueDate.GetHashCode(); + } + if (this.RatepaydataInvoiceDate != null) + { + hashCode = (hashCode * 59) + this.RatepaydataInvoiceDate.GetHashCode(); + } + if (this.RatepaydataInvoiceId != null) + { + hashCode = (hashCode * 59) + this.RatepaydataInvoiceId.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataRatepay additionalDataRatepay, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataRatepay.RatepayInstallmentAmountOption.IsSet && additionalDataRatepay.RatepayInstallmentAmount == null) - throw new ArgumentNullException(nameof(additionalDataRatepay.RatepayInstallmentAmount), "Property is required for class AdditionalDataRatepay."); - - if (additionalDataRatepay.RatepayInterestRateOption.IsSet && additionalDataRatepay.RatepayInterestRate == null) - throw new ArgumentNullException(nameof(additionalDataRatepay.RatepayInterestRate), "Property is required for class AdditionalDataRatepay."); - - if (additionalDataRatepay.RatepayLastInstallmentAmountOption.IsSet && additionalDataRatepay.RatepayLastInstallmentAmount == null) - throw new ArgumentNullException(nameof(additionalDataRatepay.RatepayLastInstallmentAmount), "Property is required for class AdditionalDataRatepay."); - - if (additionalDataRatepay.RatepayPaymentFirstdayOption.IsSet && additionalDataRatepay.RatepayPaymentFirstday == null) - throw new ArgumentNullException(nameof(additionalDataRatepay.RatepayPaymentFirstday), "Property is required for class AdditionalDataRatepay."); - - if (additionalDataRatepay.RatepaydataDeliveryDateOption.IsSet && additionalDataRatepay.RatepaydataDeliveryDate == null) - throw new ArgumentNullException(nameof(additionalDataRatepay.RatepaydataDeliveryDate), "Property is required for class AdditionalDataRatepay."); - - if (additionalDataRatepay.RatepaydataDueDateOption.IsSet && additionalDataRatepay.RatepaydataDueDate == null) - throw new ArgumentNullException(nameof(additionalDataRatepay.RatepaydataDueDate), "Property is required for class AdditionalDataRatepay."); - - if (additionalDataRatepay.RatepaydataInvoiceDateOption.IsSet && additionalDataRatepay.RatepaydataInvoiceDate == null) - throw new ArgumentNullException(nameof(additionalDataRatepay.RatepaydataInvoiceDate), "Property is required for class AdditionalDataRatepay."); - - if (additionalDataRatepay.RatepaydataInvoiceIdOption.IsSet && additionalDataRatepay.RatepaydataInvoiceId == null) - throw new ArgumentNullException(nameof(additionalDataRatepay.RatepaydataInvoiceId), "Property is required for class AdditionalDataRatepay."); - - if (additionalDataRatepay.RatepayInstallmentAmountOption.IsSet) - writer.WriteString("ratepay.installmentAmount", additionalDataRatepay.RatepayInstallmentAmount); - - if (additionalDataRatepay.RatepayInterestRateOption.IsSet) - writer.WriteString("ratepay.interestRate", additionalDataRatepay.RatepayInterestRate); - - if (additionalDataRatepay.RatepayLastInstallmentAmountOption.IsSet) - writer.WriteString("ratepay.lastInstallmentAmount", additionalDataRatepay.RatepayLastInstallmentAmount); - - if (additionalDataRatepay.RatepayPaymentFirstdayOption.IsSet) - writer.WriteString("ratepay.paymentFirstday", additionalDataRatepay.RatepayPaymentFirstday); - - if (additionalDataRatepay.RatepaydataDeliveryDateOption.IsSet) - writer.WriteString("ratepaydata.deliveryDate", additionalDataRatepay.RatepaydataDeliveryDate); - - if (additionalDataRatepay.RatepaydataDueDateOption.IsSet) - writer.WriteString("ratepaydata.dueDate", additionalDataRatepay.RatepaydataDueDate); - - if (additionalDataRatepay.RatepaydataInvoiceDateOption.IsSet) - writer.WriteString("ratepaydata.invoiceDate", additionalDataRatepay.RatepaydataInvoiceDate); - - if (additionalDataRatepay.RatepaydataInvoiceIdOption.IsSet) - writer.WriteString("ratepaydata.invoiceId", additionalDataRatepay.RatepaydataInvoiceId); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataRetry.cs b/Adyen/Model/Checkout/AdditionalDataRetry.cs index e1bd917f8..80d25b5b4 100644 --- a/Adyen/Model/Checkout/AdditionalDataRetry.cs +++ b/Adyen/Model/Checkout/AdditionalDataRetry.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,78 +15,56 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataRetry /// - public partial class AdditionalDataRetry : IValidatableObject + [DataContract(Name = "AdditionalDataRetry")] + public partial class AdditionalDataRetry : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The number of times the transaction (not order) has been retried between different payment service providers. For instance, the `chainAttemptNumber` set to 2 means that this transaction has been recently tried on another provider before being sent to Adyen. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. - /// The index of the attempt to bill a particular order, which is identified by the `merchantOrderReference` field. For example, if a recurring transaction fails and is retried one day later, then the order number for these attempts would be 1 and 2, respectively. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. - /// The Boolean value indicating whether Adyen should skip or retry this transaction, if possible. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. - [JsonConstructor] - public AdditionalDataRetry(Option retryChainAttemptNumber = default, Option retryOrderAttemptNumber = default, Option retrySkipRetry = default) + /// The number of times the transaction (not order) has been retried between different payment service providers. For instance, the `chainAttemptNumber` set to 2 means that this transaction has been recently tried on another provider before being sent to Adyen. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together.. + /// The index of the attempt to bill a particular order, which is identified by the `merchantOrderReference` field. For example, if a recurring transaction fails and is retried one day later, then the order number for these attempts would be 1 and 2, respectively. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together.. + /// The Boolean value indicating whether Adyen should skip or retry this transaction, if possible. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together.. + public AdditionalDataRetry(string retryChainAttemptNumber = default(string), string retryOrderAttemptNumber = default(string), string retrySkipRetry = default(string)) { - RetryChainAttemptNumberOption = retryChainAttemptNumber; - RetryOrderAttemptNumberOption = retryOrderAttemptNumber; - RetrySkipRetryOption = retrySkipRetry; - OnCreated(); + this.RetryChainAttemptNumber = retryChainAttemptNumber; + this.RetryOrderAttemptNumber = retryOrderAttemptNumber; + this.RetrySkipRetry = retrySkipRetry; } - partial void OnCreated(); - - /// - /// Used to track the state of RetryChainAttemptNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RetryChainAttemptNumberOption { get; private set; } - /// /// The number of times the transaction (not order) has been retried between different payment service providers. For instance, the `chainAttemptNumber` set to 2 means that this transaction has been recently tried on another provider before being sent to Adyen. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. /// /// The number of times the transaction (not order) has been retried between different payment service providers. For instance, the `chainAttemptNumber` set to 2 means that this transaction has been recently tried on another provider before being sent to Adyen. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. - [JsonPropertyName("retry.chainAttemptNumber")] - public string RetryChainAttemptNumber { get { return this.RetryChainAttemptNumberOption; } set { this.RetryChainAttemptNumberOption = new Option(value); } } - - /// - /// Used to track the state of RetryOrderAttemptNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RetryOrderAttemptNumberOption { get; private set; } + [DataMember(Name = "retry.chainAttemptNumber", EmitDefaultValue = false)] + public string RetryChainAttemptNumber { get; set; } /// /// The index of the attempt to bill a particular order, which is identified by the `merchantOrderReference` field. For example, if a recurring transaction fails and is retried one day later, then the order number for these attempts would be 1 and 2, respectively. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. /// /// The index of the attempt to bill a particular order, which is identified by the `merchantOrderReference` field. For example, if a recurring transaction fails and is retried one day later, then the order number for these attempts would be 1 and 2, respectively. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. - [JsonPropertyName("retry.orderAttemptNumber")] - public string RetryOrderAttemptNumber { get { return this.RetryOrderAttemptNumberOption; } set { this.RetryOrderAttemptNumberOption = new Option(value); } } - - /// - /// Used to track the state of RetrySkipRetry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RetrySkipRetryOption { get; private set; } + [DataMember(Name = "retry.orderAttemptNumber", EmitDefaultValue = false)] + public string RetryOrderAttemptNumber { get; set; } /// /// The Boolean value indicating whether Adyen should skip or retry this transaction, if possible. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. /// /// The Boolean value indicating whether Adyen should skip or retry this transaction, if possible. > If you submit `retry.chainAttemptNumber`, `retry.orderAttemptNumber`, and `retry.skipRetry` values, we also recommend you provide the `merchantOrderReference` to facilitate linking payment attempts together. - [JsonPropertyName("retry.skipRetry")] - public string RetrySkipRetry { get { return this.RetrySkipRetryOption; } set { this.RetrySkipRetryOption = new Option(value); } } + [DataMember(Name = "retry.skipRetry", EmitDefaultValue = false)] + public string RetrySkipRetry { get; set; } /// /// Returns the string presentation of the object @@ -103,125 +82,86 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataRetryJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataRetry Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option retryChainAttemptNumber = default; - Option retryOrderAttemptNumber = default; - Option retrySkipRetry = default; + return this.Equals(input as AdditionalDataRetry); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AdditionalDataRetry instances are equal + /// + /// Instance of AdditionalDataRetry to be compared + /// Boolean + public bool Equals(AdditionalDataRetry input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "retry.chainAttemptNumber": - retryChainAttemptNumber = new Option(utf8JsonReader.GetString()); - break; - case "retry.orderAttemptNumber": - retryOrderAttemptNumber = new Option(utf8JsonReader.GetString()); - break; - case "retry.skipRetry": - retrySkipRetry = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (retryChainAttemptNumber.IsSet && retryChainAttemptNumber.Value == null) - throw new ArgumentNullException(nameof(retryChainAttemptNumber), "Property is not nullable for class AdditionalDataRetry."); - - if (retryOrderAttemptNumber.IsSet && retryOrderAttemptNumber.Value == null) - throw new ArgumentNullException(nameof(retryOrderAttemptNumber), "Property is not nullable for class AdditionalDataRetry."); - - if (retrySkipRetry.IsSet && retrySkipRetry.Value == null) - throw new ArgumentNullException(nameof(retrySkipRetry), "Property is not nullable for class AdditionalDataRetry."); - - return new AdditionalDataRetry(retryChainAttemptNumber, retryOrderAttemptNumber, retrySkipRetry); + return + ( + this.RetryChainAttemptNumber == input.RetryChainAttemptNumber || + (this.RetryChainAttemptNumber != null && + this.RetryChainAttemptNumber.Equals(input.RetryChainAttemptNumber)) + ) && + ( + this.RetryOrderAttemptNumber == input.RetryOrderAttemptNumber || + (this.RetryOrderAttemptNumber != null && + this.RetryOrderAttemptNumber.Equals(input.RetryOrderAttemptNumber)) + ) && + ( + this.RetrySkipRetry == input.RetrySkipRetry || + (this.RetrySkipRetry != null && + this.RetrySkipRetry.Equals(input.RetrySkipRetry)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataRetry additionalDataRetry, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataRetry, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.RetryChainAttemptNumber != null) + { + hashCode = (hashCode * 59) + this.RetryChainAttemptNumber.GetHashCode(); + } + if (this.RetryOrderAttemptNumber != null) + { + hashCode = (hashCode * 59) + this.RetryOrderAttemptNumber.GetHashCode(); + } + if (this.RetrySkipRetry != null) + { + hashCode = (hashCode * 59) + this.RetrySkipRetry.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataRetry additionalDataRetry, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataRetry.RetryChainAttemptNumberOption.IsSet && additionalDataRetry.RetryChainAttemptNumber == null) - throw new ArgumentNullException(nameof(additionalDataRetry.RetryChainAttemptNumber), "Property is required for class AdditionalDataRetry."); - - if (additionalDataRetry.RetryOrderAttemptNumberOption.IsSet && additionalDataRetry.RetryOrderAttemptNumber == null) - throw new ArgumentNullException(nameof(additionalDataRetry.RetryOrderAttemptNumber), "Property is required for class AdditionalDataRetry."); - - if (additionalDataRetry.RetrySkipRetryOption.IsSet && additionalDataRetry.RetrySkipRetry == null) - throw new ArgumentNullException(nameof(additionalDataRetry.RetrySkipRetry), "Property is required for class AdditionalDataRetry."); - - if (additionalDataRetry.RetryChainAttemptNumberOption.IsSet) - writer.WriteString("retry.chainAttemptNumber", additionalDataRetry.RetryChainAttemptNumber); - - if (additionalDataRetry.RetryOrderAttemptNumberOption.IsSet) - writer.WriteString("retry.orderAttemptNumber", additionalDataRetry.RetryOrderAttemptNumber); - - if (additionalDataRetry.RetrySkipRetryOption.IsSet) - writer.WriteString("retry.skipRetry", additionalDataRetry.RetrySkipRetry); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataRisk.cs b/Adyen/Model/Checkout/AdditionalDataRisk.cs index 7112d3982..734fff71c 100644 --- a/Adyen/Model/Checkout/AdditionalDataRisk.cs +++ b/Adyen/Model/Checkout/AdditionalDataRisk.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,366 +15,218 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataRisk /// - public partial class AdditionalDataRisk : IValidatableObject + [DataContract(Name = "AdditionalDataRisk")] + public partial class AdditionalDataRisk : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The data for your custom risk field. For more information, refer to [Create custom risk fields](https://docs.adyen.com/risk-management/configure-custom-risk-rules#step-1-create-custom-risk-fields). - /// The price of item in the basket, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). - /// Brand of the item. - /// Category of the item. - /// Color of the item. - /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). - /// ID of the item. - /// Manufacturer of the item. - /// A text description of the product the invoice line refers to. - /// Quantity of the item purchased. - /// Email associated with the given product in the basket (usually in electronic gift cards). - /// Size of the item. - /// [Stock keeping unit](https://en.wikipedia.org/wiki/Stock_keeping_unit). - /// [Universal Product Code](https://en.wikipedia.org/wiki/Universal_Product_Code). - /// Code of the promotion. - /// The discount amount of the promotion, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). - /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). - /// Promotion's percentage discount. It is represented in percentage value and there is no need to include the '%' sign. e.g. for a promotion discount of 30%, the value of the field should be 30. - /// Name of the promotion. - /// Reference number of the risk profile that you want to apply to the payment. If not provided or left blank, the merchant-level account's default risk profile will be applied to the payment. For more information, see [dynamically assign a risk profile to a payment](https://docs.adyen.com/risk-management/create-and-use-risk-profiles#dynamically-assign-a-risk-profile-to-a-payment). - /// If this parameter is provided with the value **true**, risk checks for the payment request are skipped and the transaction will not get a risk score. - [JsonConstructor] - public AdditionalDataRisk(Option riskdataCustomFieldName = default, Option riskdataBasketItemItemNrAmountPerItem = default, Option riskdataBasketItemItemNrBrand = default, Option riskdataBasketItemItemNrCategory = default, Option riskdataBasketItemItemNrColor = default, Option riskdataBasketItemItemNrCurrency = default, Option riskdataBasketItemItemNrItemID = default, Option riskdataBasketItemItemNrManufacturer = default, Option riskdataBasketItemItemNrProductTitle = default, Option riskdataBasketItemItemNrQuantity = default, Option riskdataBasketItemItemNrReceiverEmail = default, Option riskdataBasketItemItemNrSize = default, Option riskdataBasketItemItemNrSku = default, Option riskdataBasketItemItemNrUpc = default, Option riskdataPromotionsPromotionItemNrPromotionCode = default, Option riskdataPromotionsPromotionItemNrPromotionDiscountAmount = default, Option riskdataPromotionsPromotionItemNrPromotionDiscountCurrency = default, Option riskdataPromotionsPromotionItemNrPromotionDiscountPercentage = default, Option riskdataPromotionsPromotionItemNrPromotionName = default, Option riskdataRiskProfileReference = default, Option riskdataSkipRisk = default) + /// The data for your custom risk field. For more information, refer to [Create custom risk fields](https://docs.adyen.com/risk-management/configure-custom-risk-rules#step-1-create-custom-risk-fields).. + /// The price of item in the basket, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes).. + /// Brand of the item.. + /// Category of the item.. + /// Color of the item.. + /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217).. + /// ID of the item.. + /// Manufacturer of the item.. + /// A text description of the product the invoice line refers to.. + /// Quantity of the item purchased.. + /// Email associated with the given product in the basket (usually in electronic gift cards).. + /// Size of the item.. + /// [Stock keeping unit](https://en.wikipedia.org/wiki/Stock_keeping_unit).. + /// [Universal Product Code](https://en.wikipedia.org/wiki/Universal_Product_Code).. + /// Code of the promotion.. + /// The discount amount of the promotion, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes).. + /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217).. + /// Promotion's percentage discount. It is represented in percentage value and there is no need to include the '%' sign. e.g. for a promotion discount of 30%, the value of the field should be 30.. + /// Name of the promotion.. + /// Reference number of the risk profile that you want to apply to the payment. If not provided or left blank, the merchant-level account's default risk profile will be applied to the payment. For more information, see [dynamically assign a risk profile to a payment](https://docs.adyen.com/risk-management/create-and-use-risk-profiles#dynamically-assign-a-risk-profile-to-a-payment).. + /// If this parameter is provided with the value **true**, risk checks for the payment request are skipped and the transaction will not get a risk score.. + public AdditionalDataRisk(string riskdataCustomFieldName = default(string), string riskdataBasketItemItemNrAmountPerItem = default(string), string riskdataBasketItemItemNrBrand = default(string), string riskdataBasketItemItemNrCategory = default(string), string riskdataBasketItemItemNrColor = default(string), string riskdataBasketItemItemNrCurrency = default(string), string riskdataBasketItemItemNrItemID = default(string), string riskdataBasketItemItemNrManufacturer = default(string), string riskdataBasketItemItemNrProductTitle = default(string), string riskdataBasketItemItemNrQuantity = default(string), string riskdataBasketItemItemNrReceiverEmail = default(string), string riskdataBasketItemItemNrSize = default(string), string riskdataBasketItemItemNrSku = default(string), string riskdataBasketItemItemNrUpc = default(string), string riskdataPromotionsPromotionItemNrPromotionCode = default(string), string riskdataPromotionsPromotionItemNrPromotionDiscountAmount = default(string), string riskdataPromotionsPromotionItemNrPromotionDiscountCurrency = default(string), string riskdataPromotionsPromotionItemNrPromotionDiscountPercentage = default(string), string riskdataPromotionsPromotionItemNrPromotionName = default(string), string riskdataRiskProfileReference = default(string), string riskdataSkipRisk = default(string)) { - RiskdataCustomFieldNameOption = riskdataCustomFieldName; - RiskdataBasketItemItemNrAmountPerItemOption = riskdataBasketItemItemNrAmountPerItem; - RiskdataBasketItemItemNrBrandOption = riskdataBasketItemItemNrBrand; - RiskdataBasketItemItemNrCategoryOption = riskdataBasketItemItemNrCategory; - RiskdataBasketItemItemNrColorOption = riskdataBasketItemItemNrColor; - RiskdataBasketItemItemNrCurrencyOption = riskdataBasketItemItemNrCurrency; - RiskdataBasketItemItemNrItemIDOption = riskdataBasketItemItemNrItemID; - RiskdataBasketItemItemNrManufacturerOption = riskdataBasketItemItemNrManufacturer; - RiskdataBasketItemItemNrProductTitleOption = riskdataBasketItemItemNrProductTitle; - RiskdataBasketItemItemNrQuantityOption = riskdataBasketItemItemNrQuantity; - RiskdataBasketItemItemNrReceiverEmailOption = riskdataBasketItemItemNrReceiverEmail; - RiskdataBasketItemItemNrSizeOption = riskdataBasketItemItemNrSize; - RiskdataBasketItemItemNrSkuOption = riskdataBasketItemItemNrSku; - RiskdataBasketItemItemNrUpcOption = riskdataBasketItemItemNrUpc; - RiskdataPromotionsPromotionItemNrPromotionCodeOption = riskdataPromotionsPromotionItemNrPromotionCode; - RiskdataPromotionsPromotionItemNrPromotionDiscountAmountOption = riskdataPromotionsPromotionItemNrPromotionDiscountAmount; - RiskdataPromotionsPromotionItemNrPromotionDiscountCurrencyOption = riskdataPromotionsPromotionItemNrPromotionDiscountCurrency; - RiskdataPromotionsPromotionItemNrPromotionDiscountPercentageOption = riskdataPromotionsPromotionItemNrPromotionDiscountPercentage; - RiskdataPromotionsPromotionItemNrPromotionNameOption = riskdataPromotionsPromotionItemNrPromotionName; - RiskdataRiskProfileReferenceOption = riskdataRiskProfileReference; - RiskdataSkipRiskOption = riskdataSkipRisk; - OnCreated(); + this.RiskdataCustomFieldName = riskdataCustomFieldName; + this.RiskdataBasketItemItemNrAmountPerItem = riskdataBasketItemItemNrAmountPerItem; + this.RiskdataBasketItemItemNrBrand = riskdataBasketItemItemNrBrand; + this.RiskdataBasketItemItemNrCategory = riskdataBasketItemItemNrCategory; + this.RiskdataBasketItemItemNrColor = riskdataBasketItemItemNrColor; + this.RiskdataBasketItemItemNrCurrency = riskdataBasketItemItemNrCurrency; + this.RiskdataBasketItemItemNrItemID = riskdataBasketItemItemNrItemID; + this.RiskdataBasketItemItemNrManufacturer = riskdataBasketItemItemNrManufacturer; + this.RiskdataBasketItemItemNrProductTitle = riskdataBasketItemItemNrProductTitle; + this.RiskdataBasketItemItemNrQuantity = riskdataBasketItemItemNrQuantity; + this.RiskdataBasketItemItemNrReceiverEmail = riskdataBasketItemItemNrReceiverEmail; + this.RiskdataBasketItemItemNrSize = riskdataBasketItemItemNrSize; + this.RiskdataBasketItemItemNrSku = riskdataBasketItemItemNrSku; + this.RiskdataBasketItemItemNrUpc = riskdataBasketItemItemNrUpc; + this.RiskdataPromotionsPromotionItemNrPromotionCode = riskdataPromotionsPromotionItemNrPromotionCode; + this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount = riskdataPromotionsPromotionItemNrPromotionDiscountAmount; + this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency = riskdataPromotionsPromotionItemNrPromotionDiscountCurrency; + this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage = riskdataPromotionsPromotionItemNrPromotionDiscountPercentage; + this.RiskdataPromotionsPromotionItemNrPromotionName = riskdataPromotionsPromotionItemNrPromotionName; + this.RiskdataRiskProfileReference = riskdataRiskProfileReference; + this.RiskdataSkipRisk = riskdataSkipRisk; } - partial void OnCreated(); - - /// - /// Used to track the state of RiskdataCustomFieldName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataCustomFieldNameOption { get; private set; } - /// /// The data for your custom risk field. For more information, refer to [Create custom risk fields](https://docs.adyen.com/risk-management/configure-custom-risk-rules#step-1-create-custom-risk-fields). /// /// The data for your custom risk field. For more information, refer to [Create custom risk fields](https://docs.adyen.com/risk-management/configure-custom-risk-rules#step-1-create-custom-risk-fields). - [JsonPropertyName("riskdata.[customFieldName]")] - public string RiskdataCustomFieldName { get { return this.RiskdataCustomFieldNameOption; } set { this.RiskdataCustomFieldNameOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataBasketItemItemNrAmountPerItem - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataBasketItemItemNrAmountPerItemOption { get; private set; } + [DataMember(Name = "riskdata.[customFieldName]", EmitDefaultValue = false)] + public string RiskdataCustomFieldName { get; set; } /// /// The price of item in the basket, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). /// /// The price of item in the basket, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). - [JsonPropertyName("riskdata.basket.item[itemNr].amountPerItem")] - public string RiskdataBasketItemItemNrAmountPerItem { get { return this.RiskdataBasketItemItemNrAmountPerItemOption; } set { this.RiskdataBasketItemItemNrAmountPerItemOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataBasketItemItemNrBrand - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataBasketItemItemNrBrandOption { get; private set; } + [DataMember(Name = "riskdata.basket.item[itemNr].amountPerItem", EmitDefaultValue = false)] + public string RiskdataBasketItemItemNrAmountPerItem { get; set; } /// /// Brand of the item. /// /// Brand of the item. - [JsonPropertyName("riskdata.basket.item[itemNr].brand")] - public string RiskdataBasketItemItemNrBrand { get { return this.RiskdataBasketItemItemNrBrandOption; } set { this.RiskdataBasketItemItemNrBrandOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataBasketItemItemNrCategory - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataBasketItemItemNrCategoryOption { get; private set; } + [DataMember(Name = "riskdata.basket.item[itemNr].brand", EmitDefaultValue = false)] + public string RiskdataBasketItemItemNrBrand { get; set; } /// /// Category of the item. /// /// Category of the item. - [JsonPropertyName("riskdata.basket.item[itemNr].category")] - public string RiskdataBasketItemItemNrCategory { get { return this.RiskdataBasketItemItemNrCategoryOption; } set { this.RiskdataBasketItemItemNrCategoryOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataBasketItemItemNrColor - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataBasketItemItemNrColorOption { get; private set; } + [DataMember(Name = "riskdata.basket.item[itemNr].category", EmitDefaultValue = false)] + public string RiskdataBasketItemItemNrCategory { get; set; } /// /// Color of the item. /// /// Color of the item. - [JsonPropertyName("riskdata.basket.item[itemNr].color")] - public string RiskdataBasketItemItemNrColor { get { return this.RiskdataBasketItemItemNrColorOption; } set { this.RiskdataBasketItemItemNrColorOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataBasketItemItemNrCurrency - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataBasketItemItemNrCurrencyOption { get; private set; } + [DataMember(Name = "riskdata.basket.item[itemNr].color", EmitDefaultValue = false)] + public string RiskdataBasketItemItemNrColor { get; set; } /// /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). /// /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). - [JsonPropertyName("riskdata.basket.item[itemNr].currency")] - public string RiskdataBasketItemItemNrCurrency { get { return this.RiskdataBasketItemItemNrCurrencyOption; } set { this.RiskdataBasketItemItemNrCurrencyOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataBasketItemItemNrItemID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataBasketItemItemNrItemIDOption { get; private set; } + [DataMember(Name = "riskdata.basket.item[itemNr].currency", EmitDefaultValue = false)] + public string RiskdataBasketItemItemNrCurrency { get; set; } /// /// ID of the item. /// /// ID of the item. - [JsonPropertyName("riskdata.basket.item[itemNr].itemID")] - public string RiskdataBasketItemItemNrItemID { get { return this.RiskdataBasketItemItemNrItemIDOption; } set { this.RiskdataBasketItemItemNrItemIDOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataBasketItemItemNrManufacturer - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataBasketItemItemNrManufacturerOption { get; private set; } + [DataMember(Name = "riskdata.basket.item[itemNr].itemID", EmitDefaultValue = false)] + public string RiskdataBasketItemItemNrItemID { get; set; } /// /// Manufacturer of the item. /// /// Manufacturer of the item. - [JsonPropertyName("riskdata.basket.item[itemNr].manufacturer")] - public string RiskdataBasketItemItemNrManufacturer { get { return this.RiskdataBasketItemItemNrManufacturerOption; } set { this.RiskdataBasketItemItemNrManufacturerOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataBasketItemItemNrProductTitle - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataBasketItemItemNrProductTitleOption { get; private set; } + [DataMember(Name = "riskdata.basket.item[itemNr].manufacturer", EmitDefaultValue = false)] + public string RiskdataBasketItemItemNrManufacturer { get; set; } /// /// A text description of the product the invoice line refers to. /// /// A text description of the product the invoice line refers to. - [JsonPropertyName("riskdata.basket.item[itemNr].productTitle")] - public string RiskdataBasketItemItemNrProductTitle { get { return this.RiskdataBasketItemItemNrProductTitleOption; } set { this.RiskdataBasketItemItemNrProductTitleOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataBasketItemItemNrQuantity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataBasketItemItemNrQuantityOption { get; private set; } + [DataMember(Name = "riskdata.basket.item[itemNr].productTitle", EmitDefaultValue = false)] + public string RiskdataBasketItemItemNrProductTitle { get; set; } /// /// Quantity of the item purchased. /// /// Quantity of the item purchased. - [JsonPropertyName("riskdata.basket.item[itemNr].quantity")] - public string RiskdataBasketItemItemNrQuantity { get { return this.RiskdataBasketItemItemNrQuantityOption; } set { this.RiskdataBasketItemItemNrQuantityOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataBasketItemItemNrReceiverEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataBasketItemItemNrReceiverEmailOption { get; private set; } + [DataMember(Name = "riskdata.basket.item[itemNr].quantity", EmitDefaultValue = false)] + public string RiskdataBasketItemItemNrQuantity { get; set; } /// /// Email associated with the given product in the basket (usually in electronic gift cards). /// /// Email associated with the given product in the basket (usually in electronic gift cards). - [JsonPropertyName("riskdata.basket.item[itemNr].receiverEmail")] - public string RiskdataBasketItemItemNrReceiverEmail { get { return this.RiskdataBasketItemItemNrReceiverEmailOption; } set { this.RiskdataBasketItemItemNrReceiverEmailOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataBasketItemItemNrSize - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataBasketItemItemNrSizeOption { get; private set; } + [DataMember(Name = "riskdata.basket.item[itemNr].receiverEmail", EmitDefaultValue = false)] + public string RiskdataBasketItemItemNrReceiverEmail { get; set; } /// /// Size of the item. /// /// Size of the item. - [JsonPropertyName("riskdata.basket.item[itemNr].size")] - public string RiskdataBasketItemItemNrSize { get { return this.RiskdataBasketItemItemNrSizeOption; } set { this.RiskdataBasketItemItemNrSizeOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataBasketItemItemNrSku - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataBasketItemItemNrSkuOption { get; private set; } + [DataMember(Name = "riskdata.basket.item[itemNr].size", EmitDefaultValue = false)] + public string RiskdataBasketItemItemNrSize { get; set; } /// /// [Stock keeping unit](https://en.wikipedia.org/wiki/Stock_keeping_unit). /// /// [Stock keeping unit](https://en.wikipedia.org/wiki/Stock_keeping_unit). - [JsonPropertyName("riskdata.basket.item[itemNr].sku")] - public string RiskdataBasketItemItemNrSku { get { return this.RiskdataBasketItemItemNrSkuOption; } set { this.RiskdataBasketItemItemNrSkuOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataBasketItemItemNrUpc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataBasketItemItemNrUpcOption { get; private set; } + [DataMember(Name = "riskdata.basket.item[itemNr].sku", EmitDefaultValue = false)] + public string RiskdataBasketItemItemNrSku { get; set; } /// /// [Universal Product Code](https://en.wikipedia.org/wiki/Universal_Product_Code). /// /// [Universal Product Code](https://en.wikipedia.org/wiki/Universal_Product_Code). - [JsonPropertyName("riskdata.basket.item[itemNr].upc")] - public string RiskdataBasketItemItemNrUpc { get { return this.RiskdataBasketItemItemNrUpcOption; } set { this.RiskdataBasketItemItemNrUpcOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataPromotionsPromotionItemNrPromotionCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataPromotionsPromotionItemNrPromotionCodeOption { get; private set; } + [DataMember(Name = "riskdata.basket.item[itemNr].upc", EmitDefaultValue = false)] + public string RiskdataBasketItemItemNrUpc { get; set; } /// /// Code of the promotion. /// /// Code of the promotion. - [JsonPropertyName("riskdata.promotions.promotion[itemNr].promotionCode")] - public string RiskdataPromotionsPromotionItemNrPromotionCode { get { return this.RiskdataPromotionsPromotionItemNrPromotionCodeOption; } set { this.RiskdataPromotionsPromotionItemNrPromotionCodeOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataPromotionsPromotionItemNrPromotionDiscountAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataPromotionsPromotionItemNrPromotionDiscountAmountOption { get; private set; } + [DataMember(Name = "riskdata.promotions.promotion[itemNr].promotionCode", EmitDefaultValue = false)] + public string RiskdataPromotionsPromotionItemNrPromotionCode { get; set; } /// /// The discount amount of the promotion, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). /// /// The discount amount of the promotion, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes). - [JsonPropertyName("riskdata.promotions.promotion[itemNr].promotionDiscountAmount")] - public string RiskdataPromotionsPromotionItemNrPromotionDiscountAmount { get { return this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmountOption; } set { this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmountOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataPromotionsPromotionItemNrPromotionDiscountCurrencyOption { get; private set; } + [DataMember(Name = "riskdata.promotions.promotion[itemNr].promotionDiscountAmount", EmitDefaultValue = false)] + public string RiskdataPromotionsPromotionItemNrPromotionDiscountAmount { get; set; } /// /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). /// /// The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217). - [JsonPropertyName("riskdata.promotions.promotion[itemNr].promotionDiscountCurrency")] - public string RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency { get { return this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrencyOption; } set { this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrencyOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataPromotionsPromotionItemNrPromotionDiscountPercentageOption { get; private set; } + [DataMember(Name = "riskdata.promotions.promotion[itemNr].promotionDiscountCurrency", EmitDefaultValue = false)] + public string RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency { get; set; } /// /// Promotion's percentage discount. It is represented in percentage value and there is no need to include the '%' sign. e.g. for a promotion discount of 30%, the value of the field should be 30. /// /// Promotion's percentage discount. It is represented in percentage value and there is no need to include the '%' sign. e.g. for a promotion discount of 30%, the value of the field should be 30. - [JsonPropertyName("riskdata.promotions.promotion[itemNr].promotionDiscountPercentage")] - public string RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage { get { return this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentageOption; } set { this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentageOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataPromotionsPromotionItemNrPromotionName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataPromotionsPromotionItemNrPromotionNameOption { get; private set; } + [DataMember(Name = "riskdata.promotions.promotion[itemNr].promotionDiscountPercentage", EmitDefaultValue = false)] + public string RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage { get; set; } /// /// Name of the promotion. /// /// Name of the promotion. - [JsonPropertyName("riskdata.promotions.promotion[itemNr].promotionName")] - public string RiskdataPromotionsPromotionItemNrPromotionName { get { return this.RiskdataPromotionsPromotionItemNrPromotionNameOption; } set { this.RiskdataPromotionsPromotionItemNrPromotionNameOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataRiskProfileReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataRiskProfileReferenceOption { get; private set; } + [DataMember(Name = "riskdata.promotions.promotion[itemNr].promotionName", EmitDefaultValue = false)] + public string RiskdataPromotionsPromotionItemNrPromotionName { get; set; } /// /// Reference number of the risk profile that you want to apply to the payment. If not provided or left blank, the merchant-level account's default risk profile will be applied to the payment. For more information, see [dynamically assign a risk profile to a payment](https://docs.adyen.com/risk-management/create-and-use-risk-profiles#dynamically-assign-a-risk-profile-to-a-payment). /// /// Reference number of the risk profile that you want to apply to the payment. If not provided or left blank, the merchant-level account's default risk profile will be applied to the payment. For more information, see [dynamically assign a risk profile to a payment](https://docs.adyen.com/risk-management/create-and-use-risk-profiles#dynamically-assign-a-risk-profile-to-a-payment). - [JsonPropertyName("riskdata.riskProfileReference")] - public string RiskdataRiskProfileReference { get { return this.RiskdataRiskProfileReferenceOption; } set { this.RiskdataRiskProfileReferenceOption = new Option(value); } } - - /// - /// Used to track the state of RiskdataSkipRisk - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskdataSkipRiskOption { get; private set; } + [DataMember(Name = "riskdata.riskProfileReference", EmitDefaultValue = false)] + public string RiskdataRiskProfileReference { get; set; } /// /// If this parameter is provided with the value **true**, risk checks for the payment request are skipped and the transaction will not get a risk score. /// /// If this parameter is provided with the value **true**, risk checks for the payment request are skipped and the transaction will not get a risk score. - [JsonPropertyName("riskdata.skipRisk")] - public string RiskdataSkipRisk { get { return this.RiskdataSkipRiskOption; } set { this.RiskdataSkipRiskOption = new Option(value); } } + [DataMember(Name = "riskdata.skipRisk", EmitDefaultValue = false)] + public string RiskdataSkipRisk { get; set; } /// /// Returns the string presentation of the object @@ -409,359 +262,248 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataRiskJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataRisk Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option riskdataCustomFieldName = default; - Option riskdataBasketItemItemNrAmountPerItem = default; - Option riskdataBasketItemItemNrBrand = default; - Option riskdataBasketItemItemNrCategory = default; - Option riskdataBasketItemItemNrColor = default; - Option riskdataBasketItemItemNrCurrency = default; - Option riskdataBasketItemItemNrItemID = default; - Option riskdataBasketItemItemNrManufacturer = default; - Option riskdataBasketItemItemNrProductTitle = default; - Option riskdataBasketItemItemNrQuantity = default; - Option riskdataBasketItemItemNrReceiverEmail = default; - Option riskdataBasketItemItemNrSize = default; - Option riskdataBasketItemItemNrSku = default; - Option riskdataBasketItemItemNrUpc = default; - Option riskdataPromotionsPromotionItemNrPromotionCode = default; - Option riskdataPromotionsPromotionItemNrPromotionDiscountAmount = default; - Option riskdataPromotionsPromotionItemNrPromotionDiscountCurrency = default; - Option riskdataPromotionsPromotionItemNrPromotionDiscountPercentage = default; - Option riskdataPromotionsPromotionItemNrPromotionName = default; - Option riskdataRiskProfileReference = default; - Option riskdataSkipRisk = default; + return this.Equals(input as AdditionalDataRisk); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AdditionalDataRisk instances are equal + /// + /// Instance of AdditionalDataRisk to be compared + /// Boolean + public bool Equals(AdditionalDataRisk input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "riskdata.[customFieldName]": - riskdataCustomFieldName = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.basket.item[itemNr].amountPerItem": - riskdataBasketItemItemNrAmountPerItem = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.basket.item[itemNr].brand": - riskdataBasketItemItemNrBrand = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.basket.item[itemNr].category": - riskdataBasketItemItemNrCategory = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.basket.item[itemNr].color": - riskdataBasketItemItemNrColor = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.basket.item[itemNr].currency": - riskdataBasketItemItemNrCurrency = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.basket.item[itemNr].itemID": - riskdataBasketItemItemNrItemID = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.basket.item[itemNr].manufacturer": - riskdataBasketItemItemNrManufacturer = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.basket.item[itemNr].productTitle": - riskdataBasketItemItemNrProductTitle = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.basket.item[itemNr].quantity": - riskdataBasketItemItemNrQuantity = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.basket.item[itemNr].receiverEmail": - riskdataBasketItemItemNrReceiverEmail = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.basket.item[itemNr].size": - riskdataBasketItemItemNrSize = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.basket.item[itemNr].sku": - riskdataBasketItemItemNrSku = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.basket.item[itemNr].upc": - riskdataBasketItemItemNrUpc = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.promotions.promotion[itemNr].promotionCode": - riskdataPromotionsPromotionItemNrPromotionCode = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.promotions.promotion[itemNr].promotionDiscountAmount": - riskdataPromotionsPromotionItemNrPromotionDiscountAmount = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.promotions.promotion[itemNr].promotionDiscountCurrency": - riskdataPromotionsPromotionItemNrPromotionDiscountCurrency = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.promotions.promotion[itemNr].promotionDiscountPercentage": - riskdataPromotionsPromotionItemNrPromotionDiscountPercentage = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.promotions.promotion[itemNr].promotionName": - riskdataPromotionsPromotionItemNrPromotionName = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.riskProfileReference": - riskdataRiskProfileReference = new Option(utf8JsonReader.GetString()); - break; - case "riskdata.skipRisk": - riskdataSkipRisk = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (riskdataCustomFieldName.IsSet && riskdataCustomFieldName.Value == null) - throw new ArgumentNullException(nameof(riskdataCustomFieldName), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataBasketItemItemNrAmountPerItem.IsSet && riskdataBasketItemItemNrAmountPerItem.Value == null) - throw new ArgumentNullException(nameof(riskdataBasketItemItemNrAmountPerItem), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataBasketItemItemNrBrand.IsSet && riskdataBasketItemItemNrBrand.Value == null) - throw new ArgumentNullException(nameof(riskdataBasketItemItemNrBrand), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataBasketItemItemNrCategory.IsSet && riskdataBasketItemItemNrCategory.Value == null) - throw new ArgumentNullException(nameof(riskdataBasketItemItemNrCategory), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataBasketItemItemNrColor.IsSet && riskdataBasketItemItemNrColor.Value == null) - throw new ArgumentNullException(nameof(riskdataBasketItemItemNrColor), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataBasketItemItemNrCurrency.IsSet && riskdataBasketItemItemNrCurrency.Value == null) - throw new ArgumentNullException(nameof(riskdataBasketItemItemNrCurrency), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataBasketItemItemNrItemID.IsSet && riskdataBasketItemItemNrItemID.Value == null) - throw new ArgumentNullException(nameof(riskdataBasketItemItemNrItemID), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataBasketItemItemNrManufacturer.IsSet && riskdataBasketItemItemNrManufacturer.Value == null) - throw new ArgumentNullException(nameof(riskdataBasketItemItemNrManufacturer), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataBasketItemItemNrProductTitle.IsSet && riskdataBasketItemItemNrProductTitle.Value == null) - throw new ArgumentNullException(nameof(riskdataBasketItemItemNrProductTitle), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataBasketItemItemNrQuantity.IsSet && riskdataBasketItemItemNrQuantity.Value == null) - throw new ArgumentNullException(nameof(riskdataBasketItemItemNrQuantity), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataBasketItemItemNrReceiverEmail.IsSet && riskdataBasketItemItemNrReceiverEmail.Value == null) - throw new ArgumentNullException(nameof(riskdataBasketItemItemNrReceiverEmail), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataBasketItemItemNrSize.IsSet && riskdataBasketItemItemNrSize.Value == null) - throw new ArgumentNullException(nameof(riskdataBasketItemItemNrSize), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataBasketItemItemNrSku.IsSet && riskdataBasketItemItemNrSku.Value == null) - throw new ArgumentNullException(nameof(riskdataBasketItemItemNrSku), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataBasketItemItemNrUpc.IsSet && riskdataBasketItemItemNrUpc.Value == null) - throw new ArgumentNullException(nameof(riskdataBasketItemItemNrUpc), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataPromotionsPromotionItemNrPromotionCode.IsSet && riskdataPromotionsPromotionItemNrPromotionCode.Value == null) - throw new ArgumentNullException(nameof(riskdataPromotionsPromotionItemNrPromotionCode), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataPromotionsPromotionItemNrPromotionDiscountAmount.IsSet && riskdataPromotionsPromotionItemNrPromotionDiscountAmount.Value == null) - throw new ArgumentNullException(nameof(riskdataPromotionsPromotionItemNrPromotionDiscountAmount), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataPromotionsPromotionItemNrPromotionDiscountCurrency.IsSet && riskdataPromotionsPromotionItemNrPromotionDiscountCurrency.Value == null) - throw new ArgumentNullException(nameof(riskdataPromotionsPromotionItemNrPromotionDiscountCurrency), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataPromotionsPromotionItemNrPromotionDiscountPercentage.IsSet && riskdataPromotionsPromotionItemNrPromotionDiscountPercentage.Value == null) - throw new ArgumentNullException(nameof(riskdataPromotionsPromotionItemNrPromotionDiscountPercentage), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataPromotionsPromotionItemNrPromotionName.IsSet && riskdataPromotionsPromotionItemNrPromotionName.Value == null) - throw new ArgumentNullException(nameof(riskdataPromotionsPromotionItemNrPromotionName), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataRiskProfileReference.IsSet && riskdataRiskProfileReference.Value == null) - throw new ArgumentNullException(nameof(riskdataRiskProfileReference), "Property is not nullable for class AdditionalDataRisk."); - - if (riskdataSkipRisk.IsSet && riskdataSkipRisk.Value == null) - throw new ArgumentNullException(nameof(riskdataSkipRisk), "Property is not nullable for class AdditionalDataRisk."); - - return new AdditionalDataRisk(riskdataCustomFieldName, riskdataBasketItemItemNrAmountPerItem, riskdataBasketItemItemNrBrand, riskdataBasketItemItemNrCategory, riskdataBasketItemItemNrColor, riskdataBasketItemItemNrCurrency, riskdataBasketItemItemNrItemID, riskdataBasketItemItemNrManufacturer, riskdataBasketItemItemNrProductTitle, riskdataBasketItemItemNrQuantity, riskdataBasketItemItemNrReceiverEmail, riskdataBasketItemItemNrSize, riskdataBasketItemItemNrSku, riskdataBasketItemItemNrUpc, riskdataPromotionsPromotionItemNrPromotionCode, riskdataPromotionsPromotionItemNrPromotionDiscountAmount, riskdataPromotionsPromotionItemNrPromotionDiscountCurrency, riskdataPromotionsPromotionItemNrPromotionDiscountPercentage, riskdataPromotionsPromotionItemNrPromotionName, riskdataRiskProfileReference, riskdataSkipRisk); + return + ( + this.RiskdataCustomFieldName == input.RiskdataCustomFieldName || + (this.RiskdataCustomFieldName != null && + this.RiskdataCustomFieldName.Equals(input.RiskdataCustomFieldName)) + ) && + ( + this.RiskdataBasketItemItemNrAmountPerItem == input.RiskdataBasketItemItemNrAmountPerItem || + (this.RiskdataBasketItemItemNrAmountPerItem != null && + this.RiskdataBasketItemItemNrAmountPerItem.Equals(input.RiskdataBasketItemItemNrAmountPerItem)) + ) && + ( + this.RiskdataBasketItemItemNrBrand == input.RiskdataBasketItemItemNrBrand || + (this.RiskdataBasketItemItemNrBrand != null && + this.RiskdataBasketItemItemNrBrand.Equals(input.RiskdataBasketItemItemNrBrand)) + ) && + ( + this.RiskdataBasketItemItemNrCategory == input.RiskdataBasketItemItemNrCategory || + (this.RiskdataBasketItemItemNrCategory != null && + this.RiskdataBasketItemItemNrCategory.Equals(input.RiskdataBasketItemItemNrCategory)) + ) && + ( + this.RiskdataBasketItemItemNrColor == input.RiskdataBasketItemItemNrColor || + (this.RiskdataBasketItemItemNrColor != null && + this.RiskdataBasketItemItemNrColor.Equals(input.RiskdataBasketItemItemNrColor)) + ) && + ( + this.RiskdataBasketItemItemNrCurrency == input.RiskdataBasketItemItemNrCurrency || + (this.RiskdataBasketItemItemNrCurrency != null && + this.RiskdataBasketItemItemNrCurrency.Equals(input.RiskdataBasketItemItemNrCurrency)) + ) && + ( + this.RiskdataBasketItemItemNrItemID == input.RiskdataBasketItemItemNrItemID || + (this.RiskdataBasketItemItemNrItemID != null && + this.RiskdataBasketItemItemNrItemID.Equals(input.RiskdataBasketItemItemNrItemID)) + ) && + ( + this.RiskdataBasketItemItemNrManufacturer == input.RiskdataBasketItemItemNrManufacturer || + (this.RiskdataBasketItemItemNrManufacturer != null && + this.RiskdataBasketItemItemNrManufacturer.Equals(input.RiskdataBasketItemItemNrManufacturer)) + ) && + ( + this.RiskdataBasketItemItemNrProductTitle == input.RiskdataBasketItemItemNrProductTitle || + (this.RiskdataBasketItemItemNrProductTitle != null && + this.RiskdataBasketItemItemNrProductTitle.Equals(input.RiskdataBasketItemItemNrProductTitle)) + ) && + ( + this.RiskdataBasketItemItemNrQuantity == input.RiskdataBasketItemItemNrQuantity || + (this.RiskdataBasketItemItemNrQuantity != null && + this.RiskdataBasketItemItemNrQuantity.Equals(input.RiskdataBasketItemItemNrQuantity)) + ) && + ( + this.RiskdataBasketItemItemNrReceiverEmail == input.RiskdataBasketItemItemNrReceiverEmail || + (this.RiskdataBasketItemItemNrReceiverEmail != null && + this.RiskdataBasketItemItemNrReceiverEmail.Equals(input.RiskdataBasketItemItemNrReceiverEmail)) + ) && + ( + this.RiskdataBasketItemItemNrSize == input.RiskdataBasketItemItemNrSize || + (this.RiskdataBasketItemItemNrSize != null && + this.RiskdataBasketItemItemNrSize.Equals(input.RiskdataBasketItemItemNrSize)) + ) && + ( + this.RiskdataBasketItemItemNrSku == input.RiskdataBasketItemItemNrSku || + (this.RiskdataBasketItemItemNrSku != null && + this.RiskdataBasketItemItemNrSku.Equals(input.RiskdataBasketItemItemNrSku)) + ) && + ( + this.RiskdataBasketItemItemNrUpc == input.RiskdataBasketItemItemNrUpc || + (this.RiskdataBasketItemItemNrUpc != null && + this.RiskdataBasketItemItemNrUpc.Equals(input.RiskdataBasketItemItemNrUpc)) + ) && + ( + this.RiskdataPromotionsPromotionItemNrPromotionCode == input.RiskdataPromotionsPromotionItemNrPromotionCode || + (this.RiskdataPromotionsPromotionItemNrPromotionCode != null && + this.RiskdataPromotionsPromotionItemNrPromotionCode.Equals(input.RiskdataPromotionsPromotionItemNrPromotionCode)) + ) && + ( + this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount == input.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount || + (this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount != null && + this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount.Equals(input.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount)) + ) && + ( + this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency == input.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency || + (this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency != null && + this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency.Equals(input.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency)) + ) && + ( + this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage == input.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage || + (this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage != null && + this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage.Equals(input.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage)) + ) && + ( + this.RiskdataPromotionsPromotionItemNrPromotionName == input.RiskdataPromotionsPromotionItemNrPromotionName || + (this.RiskdataPromotionsPromotionItemNrPromotionName != null && + this.RiskdataPromotionsPromotionItemNrPromotionName.Equals(input.RiskdataPromotionsPromotionItemNrPromotionName)) + ) && + ( + this.RiskdataRiskProfileReference == input.RiskdataRiskProfileReference || + (this.RiskdataRiskProfileReference != null && + this.RiskdataRiskProfileReference.Equals(input.RiskdataRiskProfileReference)) + ) && + ( + this.RiskdataSkipRisk == input.RiskdataSkipRisk || + (this.RiskdataSkipRisk != null && + this.RiskdataSkipRisk.Equals(input.RiskdataSkipRisk)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataRisk additionalDataRisk, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataRisk, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.RiskdataCustomFieldName != null) + { + hashCode = (hashCode * 59) + this.RiskdataCustomFieldName.GetHashCode(); + } + if (this.RiskdataBasketItemItemNrAmountPerItem != null) + { + hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrAmountPerItem.GetHashCode(); + } + if (this.RiskdataBasketItemItemNrBrand != null) + { + hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrBrand.GetHashCode(); + } + if (this.RiskdataBasketItemItemNrCategory != null) + { + hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrCategory.GetHashCode(); + } + if (this.RiskdataBasketItemItemNrColor != null) + { + hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrColor.GetHashCode(); + } + if (this.RiskdataBasketItemItemNrCurrency != null) + { + hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrCurrency.GetHashCode(); + } + if (this.RiskdataBasketItemItemNrItemID != null) + { + hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrItemID.GetHashCode(); + } + if (this.RiskdataBasketItemItemNrManufacturer != null) + { + hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrManufacturer.GetHashCode(); + } + if (this.RiskdataBasketItemItemNrProductTitle != null) + { + hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrProductTitle.GetHashCode(); + } + if (this.RiskdataBasketItemItemNrQuantity != null) + { + hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrQuantity.GetHashCode(); + } + if (this.RiskdataBasketItemItemNrReceiverEmail != null) + { + hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrReceiverEmail.GetHashCode(); + } + if (this.RiskdataBasketItemItemNrSize != null) + { + hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrSize.GetHashCode(); + } + if (this.RiskdataBasketItemItemNrSku != null) + { + hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrSku.GetHashCode(); + } + if (this.RiskdataBasketItemItemNrUpc != null) + { + hashCode = (hashCode * 59) + this.RiskdataBasketItemItemNrUpc.GetHashCode(); + } + if (this.RiskdataPromotionsPromotionItemNrPromotionCode != null) + { + hashCode = (hashCode * 59) + this.RiskdataPromotionsPromotionItemNrPromotionCode.GetHashCode(); + } + if (this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount != null) + { + hashCode = (hashCode * 59) + this.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount.GetHashCode(); + } + if (this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency != null) + { + hashCode = (hashCode * 59) + this.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency.GetHashCode(); + } + if (this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage != null) + { + hashCode = (hashCode * 59) + this.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage.GetHashCode(); + } + if (this.RiskdataPromotionsPromotionItemNrPromotionName != null) + { + hashCode = (hashCode * 59) + this.RiskdataPromotionsPromotionItemNrPromotionName.GetHashCode(); + } + if (this.RiskdataRiskProfileReference != null) + { + hashCode = (hashCode * 59) + this.RiskdataRiskProfileReference.GetHashCode(); + } + if (this.RiskdataSkipRisk != null) + { + hashCode = (hashCode * 59) + this.RiskdataSkipRisk.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataRisk additionalDataRisk, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataRisk.RiskdataCustomFieldNameOption.IsSet && additionalDataRisk.RiskdataCustomFieldName == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataCustomFieldName), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataBasketItemItemNrAmountPerItemOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrAmountPerItem == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrAmountPerItem), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataBasketItemItemNrBrandOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrBrand == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrBrand), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataBasketItemItemNrCategoryOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrCategory == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrCategory), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataBasketItemItemNrColorOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrColor == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrColor), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataBasketItemItemNrCurrencyOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrCurrency == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrCurrency), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataBasketItemItemNrItemIDOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrItemID == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrItemID), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataBasketItemItemNrManufacturerOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrManufacturer == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrManufacturer), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataBasketItemItemNrProductTitleOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrProductTitle == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrProductTitle), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataBasketItemItemNrQuantityOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrQuantity == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrQuantity), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataBasketItemItemNrReceiverEmailOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrReceiverEmail == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrReceiverEmail), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataBasketItemItemNrSizeOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrSize == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrSize), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataBasketItemItemNrSkuOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrSku == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrSku), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataBasketItemItemNrUpcOption.IsSet && additionalDataRisk.RiskdataBasketItemItemNrUpc == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataBasketItemItemNrUpc), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionCodeOption.IsSet && additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionCode == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionCode), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountAmountOption.IsSet && additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrencyOption.IsSet && additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentageOption.IsSet && additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionNameOption.IsSet && additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionName == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionName), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataRiskProfileReferenceOption.IsSet && additionalDataRisk.RiskdataRiskProfileReference == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataRiskProfileReference), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataSkipRiskOption.IsSet && additionalDataRisk.RiskdataSkipRisk == null) - throw new ArgumentNullException(nameof(additionalDataRisk.RiskdataSkipRisk), "Property is required for class AdditionalDataRisk."); - - if (additionalDataRisk.RiskdataCustomFieldNameOption.IsSet) - writer.WriteString("riskdata.[customFieldName]", additionalDataRisk.RiskdataCustomFieldName); - - if (additionalDataRisk.RiskdataBasketItemItemNrAmountPerItemOption.IsSet) - writer.WriteString("riskdata.basket.item[itemNr].amountPerItem", additionalDataRisk.RiskdataBasketItemItemNrAmountPerItem); - - if (additionalDataRisk.RiskdataBasketItemItemNrBrandOption.IsSet) - writer.WriteString("riskdata.basket.item[itemNr].brand", additionalDataRisk.RiskdataBasketItemItemNrBrand); - - if (additionalDataRisk.RiskdataBasketItemItemNrCategoryOption.IsSet) - writer.WriteString("riskdata.basket.item[itemNr].category", additionalDataRisk.RiskdataBasketItemItemNrCategory); - - if (additionalDataRisk.RiskdataBasketItemItemNrColorOption.IsSet) - writer.WriteString("riskdata.basket.item[itemNr].color", additionalDataRisk.RiskdataBasketItemItemNrColor); - - if (additionalDataRisk.RiskdataBasketItemItemNrCurrencyOption.IsSet) - writer.WriteString("riskdata.basket.item[itemNr].currency", additionalDataRisk.RiskdataBasketItemItemNrCurrency); - - if (additionalDataRisk.RiskdataBasketItemItemNrItemIDOption.IsSet) - writer.WriteString("riskdata.basket.item[itemNr].itemID", additionalDataRisk.RiskdataBasketItemItemNrItemID); - - if (additionalDataRisk.RiskdataBasketItemItemNrManufacturerOption.IsSet) - writer.WriteString("riskdata.basket.item[itemNr].manufacturer", additionalDataRisk.RiskdataBasketItemItemNrManufacturer); - - if (additionalDataRisk.RiskdataBasketItemItemNrProductTitleOption.IsSet) - writer.WriteString("riskdata.basket.item[itemNr].productTitle", additionalDataRisk.RiskdataBasketItemItemNrProductTitle); - - if (additionalDataRisk.RiskdataBasketItemItemNrQuantityOption.IsSet) - writer.WriteString("riskdata.basket.item[itemNr].quantity", additionalDataRisk.RiskdataBasketItemItemNrQuantity); - - if (additionalDataRisk.RiskdataBasketItemItemNrReceiverEmailOption.IsSet) - writer.WriteString("riskdata.basket.item[itemNr].receiverEmail", additionalDataRisk.RiskdataBasketItemItemNrReceiverEmail); - - if (additionalDataRisk.RiskdataBasketItemItemNrSizeOption.IsSet) - writer.WriteString("riskdata.basket.item[itemNr].size", additionalDataRisk.RiskdataBasketItemItemNrSize); - - if (additionalDataRisk.RiskdataBasketItemItemNrSkuOption.IsSet) - writer.WriteString("riskdata.basket.item[itemNr].sku", additionalDataRisk.RiskdataBasketItemItemNrSku); - - if (additionalDataRisk.RiskdataBasketItemItemNrUpcOption.IsSet) - writer.WriteString("riskdata.basket.item[itemNr].upc", additionalDataRisk.RiskdataBasketItemItemNrUpc); - - if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionCodeOption.IsSet) - writer.WriteString("riskdata.promotions.promotion[itemNr].promotionCode", additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionCode); - - if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountAmountOption.IsSet) - writer.WriteString("riskdata.promotions.promotion[itemNr].promotionDiscountAmount", additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountAmount); - - if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrencyOption.IsSet) - writer.WriteString("riskdata.promotions.promotion[itemNr].promotionDiscountCurrency", additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountCurrency); - - if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentageOption.IsSet) - writer.WriteString("riskdata.promotions.promotion[itemNr].promotionDiscountPercentage", additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionDiscountPercentage); - - if (additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionNameOption.IsSet) - writer.WriteString("riskdata.promotions.promotion[itemNr].promotionName", additionalDataRisk.RiskdataPromotionsPromotionItemNrPromotionName); - - if (additionalDataRisk.RiskdataRiskProfileReferenceOption.IsSet) - writer.WriteString("riskdata.riskProfileReference", additionalDataRisk.RiskdataRiskProfileReference); - - if (additionalDataRisk.RiskdataSkipRiskOption.IsSet) - writer.WriteString("riskdata.skipRisk", additionalDataRisk.RiskdataSkipRisk); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs b/Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs index 232061ec8..80f9583a4 100644 --- a/Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs +++ b/Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,270 +15,164 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataRiskStandalone /// - public partial class AdditionalDataRiskStandalone : IValidatableObject + [DataContract(Name = "AdditionalDataRiskStandalone")] + public partial class AdditionalDataRiskStandalone : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Shopper's country of residence in the form of ISO standard 3166 2-character country codes. - /// Shopper's email. - /// Shopper's first name. - /// Shopper's last name. - /// Unique PayPal Customer Account identification number. Character length and limitations: 13 single-byte alphanumeric characters. - /// Shopper's phone number. - /// Allowed values: * **Eligible** — Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received. * **PartiallyEligible** — Merchant is protected by PayPal's Seller Protection Policy for Item Not Received. * **Ineligible** — Merchant is not protected under the Seller Protection Policy. - /// Unique transaction ID of the payment. - /// Raw AVS result received from the acquirer, where available. Example: D - /// The Bank Identification Number of a credit card, which is the first six digits of a card number. Required for [tokenized card request](https://docs.adyen.com/online-payments/tokenization). - /// Raw CVC result received from the acquirer, where available. Example: 1 - /// Unique identifier or token for the shopper's card details. - /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true - /// A Boolean value indicating whether 3DS was offered for this payment. Example: true - /// Required for PayPal payments only. The only supported value is: **paypal**. - [JsonConstructor] - public AdditionalDataRiskStandalone(Option payPalCountryCode = default, Option payPalEmailId = default, Option payPalFirstName = default, Option payPalLastName = default, Option payPalPayerId = default, Option payPalPhone = default, Option payPalProtectionEligibility = default, Option payPalTransactionId = default, Option avsResultRaw = default, Option bin = default, Option cvcResultRaw = default, Option riskToken = default, Option threeDAuthenticated = default, Option threeDOffered = default, Option tokenDataType = default) + /// Shopper's country of residence in the form of ISO standard 3166 2-character country codes.. + /// Shopper's email.. + /// Shopper's first name.. + /// Shopper's last name.. + /// Unique PayPal Customer Account identification number. Character length and limitations: 13 single-byte alphanumeric characters.. + /// Shopper's phone number.. + /// Allowed values: * **Eligible** — Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received. * **PartiallyEligible** — Merchant is protected by PayPal's Seller Protection Policy for Item Not Received. * **Ineligible** — Merchant is not protected under the Seller Protection Policy.. + /// Unique transaction ID of the payment.. + /// Raw AVS result received from the acquirer, where available. Example: D. + /// The Bank Identification Number of a credit card, which is the first six digits of a card number. Required for [tokenized card request](https://docs.adyen.com/online-payments/tokenization).. + /// Raw CVC result received from the acquirer, where available. Example: 1. + /// Unique identifier or token for the shopper's card details.. + /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true. + /// A Boolean value indicating whether 3DS was offered for this payment. Example: true. + /// Required for PayPal payments only. The only supported value is: **paypal**.. + public AdditionalDataRiskStandalone(string payPalCountryCode = default(string), string payPalEmailId = default(string), string payPalFirstName = default(string), string payPalLastName = default(string), string payPalPayerId = default(string), string payPalPhone = default(string), string payPalProtectionEligibility = default(string), string payPalTransactionId = default(string), string avsResultRaw = default(string), string bin = default(string), string cvcResultRaw = default(string), string riskToken = default(string), string threeDAuthenticated = default(string), string threeDOffered = default(string), string tokenDataType = default(string)) { - PayPalCountryCodeOption = payPalCountryCode; - PayPalEmailIdOption = payPalEmailId; - PayPalFirstNameOption = payPalFirstName; - PayPalLastNameOption = payPalLastName; - PayPalPayerIdOption = payPalPayerId; - PayPalPhoneOption = payPalPhone; - PayPalProtectionEligibilityOption = payPalProtectionEligibility; - PayPalTransactionIdOption = payPalTransactionId; - AvsResultRawOption = avsResultRaw; - BinOption = bin; - CvcResultRawOption = cvcResultRaw; - RiskTokenOption = riskToken; - ThreeDAuthenticatedOption = threeDAuthenticated; - ThreeDOfferedOption = threeDOffered; - TokenDataTypeOption = tokenDataType; - OnCreated(); + this.PayPalCountryCode = payPalCountryCode; + this.PayPalEmailId = payPalEmailId; + this.PayPalFirstName = payPalFirstName; + this.PayPalLastName = payPalLastName; + this.PayPalPayerId = payPalPayerId; + this.PayPalPhone = payPalPhone; + this.PayPalProtectionEligibility = payPalProtectionEligibility; + this.PayPalTransactionId = payPalTransactionId; + this.AvsResultRaw = avsResultRaw; + this.Bin = bin; + this.CvcResultRaw = cvcResultRaw; + this.RiskToken = riskToken; + this.ThreeDAuthenticated = threeDAuthenticated; + this.ThreeDOffered = threeDOffered; + this.TokenDataType = tokenDataType; } - partial void OnCreated(); - - /// - /// Used to track the state of PayPalCountryCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayPalCountryCodeOption { get; private set; } - /// /// Shopper's country of residence in the form of ISO standard 3166 2-character country codes. /// /// Shopper's country of residence in the form of ISO standard 3166 2-character country codes. - [JsonPropertyName("PayPal.CountryCode")] - public string PayPalCountryCode { get { return this.PayPalCountryCodeOption; } set { this.PayPalCountryCodeOption = new Option(value); } } - - /// - /// Used to track the state of PayPalEmailId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayPalEmailIdOption { get; private set; } + [DataMember(Name = "PayPal.CountryCode", EmitDefaultValue = false)] + public string PayPalCountryCode { get; set; } /// /// Shopper's email. /// /// Shopper's email. - [JsonPropertyName("PayPal.EmailId")] - public string PayPalEmailId { get { return this.PayPalEmailIdOption; } set { this.PayPalEmailIdOption = new Option(value); } } - - /// - /// Used to track the state of PayPalFirstName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayPalFirstNameOption { get; private set; } + [DataMember(Name = "PayPal.EmailId", EmitDefaultValue = false)] + public string PayPalEmailId { get; set; } /// /// Shopper's first name. /// /// Shopper's first name. - [JsonPropertyName("PayPal.FirstName")] - public string PayPalFirstName { get { return this.PayPalFirstNameOption; } set { this.PayPalFirstNameOption = new Option(value); } } - - /// - /// Used to track the state of PayPalLastName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayPalLastNameOption { get; private set; } + [DataMember(Name = "PayPal.FirstName", EmitDefaultValue = false)] + public string PayPalFirstName { get; set; } /// /// Shopper's last name. /// /// Shopper's last name. - [JsonPropertyName("PayPal.LastName")] - public string PayPalLastName { get { return this.PayPalLastNameOption; } set { this.PayPalLastNameOption = new Option(value); } } - - /// - /// Used to track the state of PayPalPayerId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayPalPayerIdOption { get; private set; } + [DataMember(Name = "PayPal.LastName", EmitDefaultValue = false)] + public string PayPalLastName { get; set; } /// /// Unique PayPal Customer Account identification number. Character length and limitations: 13 single-byte alphanumeric characters. /// /// Unique PayPal Customer Account identification number. Character length and limitations: 13 single-byte alphanumeric characters. - [JsonPropertyName("PayPal.PayerId")] - public string PayPalPayerId { get { return this.PayPalPayerIdOption; } set { this.PayPalPayerIdOption = new Option(value); } } - - /// - /// Used to track the state of PayPalPhone - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayPalPhoneOption { get; private set; } + [DataMember(Name = "PayPal.PayerId", EmitDefaultValue = false)] + public string PayPalPayerId { get; set; } /// /// Shopper's phone number. /// /// Shopper's phone number. - [JsonPropertyName("PayPal.Phone")] - public string PayPalPhone { get { return this.PayPalPhoneOption; } set { this.PayPalPhoneOption = new Option(value); } } - - /// - /// Used to track the state of PayPalProtectionEligibility - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayPalProtectionEligibilityOption { get; private set; } + [DataMember(Name = "PayPal.Phone", EmitDefaultValue = false)] + public string PayPalPhone { get; set; } /// /// Allowed values: * **Eligible** — Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received. * **PartiallyEligible** — Merchant is protected by PayPal's Seller Protection Policy for Item Not Received. * **Ineligible** — Merchant is not protected under the Seller Protection Policy. /// /// Allowed values: * **Eligible** — Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received. * **PartiallyEligible** — Merchant is protected by PayPal's Seller Protection Policy for Item Not Received. * **Ineligible** — Merchant is not protected under the Seller Protection Policy. - [JsonPropertyName("PayPal.ProtectionEligibility")] - public string PayPalProtectionEligibility { get { return this.PayPalProtectionEligibilityOption; } set { this.PayPalProtectionEligibilityOption = new Option(value); } } - - /// - /// Used to track the state of PayPalTransactionId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayPalTransactionIdOption { get; private set; } + [DataMember(Name = "PayPal.ProtectionEligibility", EmitDefaultValue = false)] + public string PayPalProtectionEligibility { get; set; } /// /// Unique transaction ID of the payment. /// /// Unique transaction ID of the payment. - [JsonPropertyName("PayPal.TransactionId")] - public string PayPalTransactionId { get { return this.PayPalTransactionIdOption; } set { this.PayPalTransactionIdOption = new Option(value); } } - - /// - /// Used to track the state of AvsResultRaw - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AvsResultRawOption { get; private set; } + [DataMember(Name = "PayPal.TransactionId", EmitDefaultValue = false)] + public string PayPalTransactionId { get; set; } /// /// Raw AVS result received from the acquirer, where available. Example: D /// /// Raw AVS result received from the acquirer, where available. Example: D - [JsonPropertyName("avsResultRaw")] - public string AvsResultRaw { get { return this.AvsResultRawOption; } set { this.AvsResultRawOption = new Option(value); } } - - /// - /// Used to track the state of Bin - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BinOption { get; private set; } + [DataMember(Name = "avsResultRaw", EmitDefaultValue = false)] + public string AvsResultRaw { get; set; } /// /// The Bank Identification Number of a credit card, which is the first six digits of a card number. Required for [tokenized card request](https://docs.adyen.com/online-payments/tokenization). /// /// The Bank Identification Number of a credit card, which is the first six digits of a card number. Required for [tokenized card request](https://docs.adyen.com/online-payments/tokenization). - [JsonPropertyName("bin")] - public string Bin { get { return this.BinOption; } set { this.BinOption = new Option(value); } } - - /// - /// Used to track the state of CvcResultRaw - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CvcResultRawOption { get; private set; } + [DataMember(Name = "bin", EmitDefaultValue = false)] + public string Bin { get; set; } /// /// Raw CVC result received from the acquirer, where available. Example: 1 /// /// Raw CVC result received from the acquirer, where available. Example: 1 - [JsonPropertyName("cvcResultRaw")] - public string CvcResultRaw { get { return this.CvcResultRawOption; } set { this.CvcResultRawOption = new Option(value); } } - - /// - /// Used to track the state of RiskToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskTokenOption { get; private set; } + [DataMember(Name = "cvcResultRaw", EmitDefaultValue = false)] + public string CvcResultRaw { get; set; } /// /// Unique identifier or token for the shopper's card details. /// /// Unique identifier or token for the shopper's card details. - [JsonPropertyName("riskToken")] - public string RiskToken { get { return this.RiskTokenOption; } set { this.RiskTokenOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDAuthenticated - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDAuthenticatedOption { get; private set; } + [DataMember(Name = "riskToken", EmitDefaultValue = false)] + public string RiskToken { get; set; } /// /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true /// /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true - [JsonPropertyName("threeDAuthenticated")] - public string ThreeDAuthenticated { get { return this.ThreeDAuthenticatedOption; } set { this.ThreeDAuthenticatedOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDOffered - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDOfferedOption { get; private set; } + [DataMember(Name = "threeDAuthenticated", EmitDefaultValue = false)] + public string ThreeDAuthenticated { get; set; } /// /// A Boolean value indicating whether 3DS was offered for this payment. Example: true /// /// A Boolean value indicating whether 3DS was offered for this payment. Example: true - [JsonPropertyName("threeDOffered")] - public string ThreeDOffered { get { return this.ThreeDOfferedOption; } set { this.ThreeDOfferedOption = new Option(value); } } - - /// - /// Used to track the state of TokenDataType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TokenDataTypeOption { get; private set; } + [DataMember(Name = "threeDOffered", EmitDefaultValue = false)] + public string ThreeDOffered { get; set; } /// /// Required for PayPal payments only. The only supported value is: **paypal**. /// /// Required for PayPal payments only. The only supported value is: **paypal**. - [JsonPropertyName("tokenDataType")] - public string TokenDataType { get { return this.TokenDataTypeOption; } set { this.TokenDataTypeOption = new Option(value); } } + [DataMember(Name = "tokenDataType", EmitDefaultValue = false)] + public string TokenDataType { get; set; } /// /// Returns the string presentation of the object @@ -307,281 +202,194 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataRiskStandaloneJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataRiskStandalone Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option payPalCountryCode = default; - Option payPalEmailId = default; - Option payPalFirstName = default; - Option payPalLastName = default; - Option payPalPayerId = default; - Option payPalPhone = default; - Option payPalProtectionEligibility = default; - Option payPalTransactionId = default; - Option avsResultRaw = default; - Option bin = default; - Option cvcResultRaw = default; - Option riskToken = default; - Option threeDAuthenticated = default; - Option threeDOffered = default; - Option tokenDataType = default; + return this.Equals(input as AdditionalDataRiskStandalone); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AdditionalDataRiskStandalone instances are equal + /// + /// Instance of AdditionalDataRiskStandalone to be compared + /// Boolean + public bool Equals(AdditionalDataRiskStandalone input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "PayPal.CountryCode": - payPalCountryCode = new Option(utf8JsonReader.GetString()); - break; - case "PayPal.EmailId": - payPalEmailId = new Option(utf8JsonReader.GetString()); - break; - case "PayPal.FirstName": - payPalFirstName = new Option(utf8JsonReader.GetString()); - break; - case "PayPal.LastName": - payPalLastName = new Option(utf8JsonReader.GetString()); - break; - case "PayPal.PayerId": - payPalPayerId = new Option(utf8JsonReader.GetString()); - break; - case "PayPal.Phone": - payPalPhone = new Option(utf8JsonReader.GetString()); - break; - case "PayPal.ProtectionEligibility": - payPalProtectionEligibility = new Option(utf8JsonReader.GetString()); - break; - case "PayPal.TransactionId": - payPalTransactionId = new Option(utf8JsonReader.GetString()); - break; - case "avsResultRaw": - avsResultRaw = new Option(utf8JsonReader.GetString()); - break; - case "bin": - bin = new Option(utf8JsonReader.GetString()); - break; - case "cvcResultRaw": - cvcResultRaw = new Option(utf8JsonReader.GetString()); - break; - case "riskToken": - riskToken = new Option(utf8JsonReader.GetString()); - break; - case "threeDAuthenticated": - threeDAuthenticated = new Option(utf8JsonReader.GetString()); - break; - case "threeDOffered": - threeDOffered = new Option(utf8JsonReader.GetString()); - break; - case "tokenDataType": - tokenDataType = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (payPalCountryCode.IsSet && payPalCountryCode.Value == null) - throw new ArgumentNullException(nameof(payPalCountryCode), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (payPalEmailId.IsSet && payPalEmailId.Value == null) - throw new ArgumentNullException(nameof(payPalEmailId), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (payPalFirstName.IsSet && payPalFirstName.Value == null) - throw new ArgumentNullException(nameof(payPalFirstName), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (payPalLastName.IsSet && payPalLastName.Value == null) - throw new ArgumentNullException(nameof(payPalLastName), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (payPalPayerId.IsSet && payPalPayerId.Value == null) - throw new ArgumentNullException(nameof(payPalPayerId), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (payPalPhone.IsSet && payPalPhone.Value == null) - throw new ArgumentNullException(nameof(payPalPhone), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (payPalProtectionEligibility.IsSet && payPalProtectionEligibility.Value == null) - throw new ArgumentNullException(nameof(payPalProtectionEligibility), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (payPalTransactionId.IsSet && payPalTransactionId.Value == null) - throw new ArgumentNullException(nameof(payPalTransactionId), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (avsResultRaw.IsSet && avsResultRaw.Value == null) - throw new ArgumentNullException(nameof(avsResultRaw), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (bin.IsSet && bin.Value == null) - throw new ArgumentNullException(nameof(bin), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (cvcResultRaw.IsSet && cvcResultRaw.Value == null) - throw new ArgumentNullException(nameof(cvcResultRaw), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (riskToken.IsSet && riskToken.Value == null) - throw new ArgumentNullException(nameof(riskToken), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (threeDAuthenticated.IsSet && threeDAuthenticated.Value == null) - throw new ArgumentNullException(nameof(threeDAuthenticated), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (threeDOffered.IsSet && threeDOffered.Value == null) - throw new ArgumentNullException(nameof(threeDOffered), "Property is not nullable for class AdditionalDataRiskStandalone."); - - if (tokenDataType.IsSet && tokenDataType.Value == null) - throw new ArgumentNullException(nameof(tokenDataType), "Property is not nullable for class AdditionalDataRiskStandalone."); - - return new AdditionalDataRiskStandalone(payPalCountryCode, payPalEmailId, payPalFirstName, payPalLastName, payPalPayerId, payPalPhone, payPalProtectionEligibility, payPalTransactionId, avsResultRaw, bin, cvcResultRaw, riskToken, threeDAuthenticated, threeDOffered, tokenDataType); + return + ( + this.PayPalCountryCode == input.PayPalCountryCode || + (this.PayPalCountryCode != null && + this.PayPalCountryCode.Equals(input.PayPalCountryCode)) + ) && + ( + this.PayPalEmailId == input.PayPalEmailId || + (this.PayPalEmailId != null && + this.PayPalEmailId.Equals(input.PayPalEmailId)) + ) && + ( + this.PayPalFirstName == input.PayPalFirstName || + (this.PayPalFirstName != null && + this.PayPalFirstName.Equals(input.PayPalFirstName)) + ) && + ( + this.PayPalLastName == input.PayPalLastName || + (this.PayPalLastName != null && + this.PayPalLastName.Equals(input.PayPalLastName)) + ) && + ( + this.PayPalPayerId == input.PayPalPayerId || + (this.PayPalPayerId != null && + this.PayPalPayerId.Equals(input.PayPalPayerId)) + ) && + ( + this.PayPalPhone == input.PayPalPhone || + (this.PayPalPhone != null && + this.PayPalPhone.Equals(input.PayPalPhone)) + ) && + ( + this.PayPalProtectionEligibility == input.PayPalProtectionEligibility || + (this.PayPalProtectionEligibility != null && + this.PayPalProtectionEligibility.Equals(input.PayPalProtectionEligibility)) + ) && + ( + this.PayPalTransactionId == input.PayPalTransactionId || + (this.PayPalTransactionId != null && + this.PayPalTransactionId.Equals(input.PayPalTransactionId)) + ) && + ( + this.AvsResultRaw == input.AvsResultRaw || + (this.AvsResultRaw != null && + this.AvsResultRaw.Equals(input.AvsResultRaw)) + ) && + ( + this.Bin == input.Bin || + (this.Bin != null && + this.Bin.Equals(input.Bin)) + ) && + ( + this.CvcResultRaw == input.CvcResultRaw || + (this.CvcResultRaw != null && + this.CvcResultRaw.Equals(input.CvcResultRaw)) + ) && + ( + this.RiskToken == input.RiskToken || + (this.RiskToken != null && + this.RiskToken.Equals(input.RiskToken)) + ) && + ( + this.ThreeDAuthenticated == input.ThreeDAuthenticated || + (this.ThreeDAuthenticated != null && + this.ThreeDAuthenticated.Equals(input.ThreeDAuthenticated)) + ) && + ( + this.ThreeDOffered == input.ThreeDOffered || + (this.ThreeDOffered != null && + this.ThreeDOffered.Equals(input.ThreeDOffered)) + ) && + ( + this.TokenDataType == input.TokenDataType || + (this.TokenDataType != null && + this.TokenDataType.Equals(input.TokenDataType)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataRiskStandalone additionalDataRiskStandalone, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataRiskStandalone, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PayPalCountryCode != null) + { + hashCode = (hashCode * 59) + this.PayPalCountryCode.GetHashCode(); + } + if (this.PayPalEmailId != null) + { + hashCode = (hashCode * 59) + this.PayPalEmailId.GetHashCode(); + } + if (this.PayPalFirstName != null) + { + hashCode = (hashCode * 59) + this.PayPalFirstName.GetHashCode(); + } + if (this.PayPalLastName != null) + { + hashCode = (hashCode * 59) + this.PayPalLastName.GetHashCode(); + } + if (this.PayPalPayerId != null) + { + hashCode = (hashCode * 59) + this.PayPalPayerId.GetHashCode(); + } + if (this.PayPalPhone != null) + { + hashCode = (hashCode * 59) + this.PayPalPhone.GetHashCode(); + } + if (this.PayPalProtectionEligibility != null) + { + hashCode = (hashCode * 59) + this.PayPalProtectionEligibility.GetHashCode(); + } + if (this.PayPalTransactionId != null) + { + hashCode = (hashCode * 59) + this.PayPalTransactionId.GetHashCode(); + } + if (this.AvsResultRaw != null) + { + hashCode = (hashCode * 59) + this.AvsResultRaw.GetHashCode(); + } + if (this.Bin != null) + { + hashCode = (hashCode * 59) + this.Bin.GetHashCode(); + } + if (this.CvcResultRaw != null) + { + hashCode = (hashCode * 59) + this.CvcResultRaw.GetHashCode(); + } + if (this.RiskToken != null) + { + hashCode = (hashCode * 59) + this.RiskToken.GetHashCode(); + } + if (this.ThreeDAuthenticated != null) + { + hashCode = (hashCode * 59) + this.ThreeDAuthenticated.GetHashCode(); + } + if (this.ThreeDOffered != null) + { + hashCode = (hashCode * 59) + this.ThreeDOffered.GetHashCode(); + } + if (this.TokenDataType != null) + { + hashCode = (hashCode * 59) + this.TokenDataType.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataRiskStandalone additionalDataRiskStandalone, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataRiskStandalone.PayPalCountryCodeOption.IsSet && additionalDataRiskStandalone.PayPalCountryCode == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalCountryCode), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.PayPalEmailIdOption.IsSet && additionalDataRiskStandalone.PayPalEmailId == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalEmailId), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.PayPalFirstNameOption.IsSet && additionalDataRiskStandalone.PayPalFirstName == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalFirstName), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.PayPalLastNameOption.IsSet && additionalDataRiskStandalone.PayPalLastName == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalLastName), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.PayPalPayerIdOption.IsSet && additionalDataRiskStandalone.PayPalPayerId == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalPayerId), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.PayPalPhoneOption.IsSet && additionalDataRiskStandalone.PayPalPhone == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalPhone), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.PayPalProtectionEligibilityOption.IsSet && additionalDataRiskStandalone.PayPalProtectionEligibility == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalProtectionEligibility), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.PayPalTransactionIdOption.IsSet && additionalDataRiskStandalone.PayPalTransactionId == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.PayPalTransactionId), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.AvsResultRawOption.IsSet && additionalDataRiskStandalone.AvsResultRaw == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.AvsResultRaw), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.BinOption.IsSet && additionalDataRiskStandalone.Bin == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.Bin), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.CvcResultRawOption.IsSet && additionalDataRiskStandalone.CvcResultRaw == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.CvcResultRaw), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.RiskTokenOption.IsSet && additionalDataRiskStandalone.RiskToken == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.RiskToken), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.ThreeDAuthenticatedOption.IsSet && additionalDataRiskStandalone.ThreeDAuthenticated == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.ThreeDAuthenticated), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.ThreeDOfferedOption.IsSet && additionalDataRiskStandalone.ThreeDOffered == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.ThreeDOffered), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.TokenDataTypeOption.IsSet && additionalDataRiskStandalone.TokenDataType == null) - throw new ArgumentNullException(nameof(additionalDataRiskStandalone.TokenDataType), "Property is required for class AdditionalDataRiskStandalone."); - - if (additionalDataRiskStandalone.PayPalCountryCodeOption.IsSet) - writer.WriteString("PayPal.CountryCode", additionalDataRiskStandalone.PayPalCountryCode); - - if (additionalDataRiskStandalone.PayPalEmailIdOption.IsSet) - writer.WriteString("PayPal.EmailId", additionalDataRiskStandalone.PayPalEmailId); - - if (additionalDataRiskStandalone.PayPalFirstNameOption.IsSet) - writer.WriteString("PayPal.FirstName", additionalDataRiskStandalone.PayPalFirstName); - - if (additionalDataRiskStandalone.PayPalLastNameOption.IsSet) - writer.WriteString("PayPal.LastName", additionalDataRiskStandalone.PayPalLastName); - - if (additionalDataRiskStandalone.PayPalPayerIdOption.IsSet) - writer.WriteString("PayPal.PayerId", additionalDataRiskStandalone.PayPalPayerId); - - if (additionalDataRiskStandalone.PayPalPhoneOption.IsSet) - writer.WriteString("PayPal.Phone", additionalDataRiskStandalone.PayPalPhone); - - if (additionalDataRiskStandalone.PayPalProtectionEligibilityOption.IsSet) - writer.WriteString("PayPal.ProtectionEligibility", additionalDataRiskStandalone.PayPalProtectionEligibility); - - if (additionalDataRiskStandalone.PayPalTransactionIdOption.IsSet) - writer.WriteString("PayPal.TransactionId", additionalDataRiskStandalone.PayPalTransactionId); - - if (additionalDataRiskStandalone.AvsResultRawOption.IsSet) - writer.WriteString("avsResultRaw", additionalDataRiskStandalone.AvsResultRaw); - - if (additionalDataRiskStandalone.BinOption.IsSet) - writer.WriteString("bin", additionalDataRiskStandalone.Bin); - - if (additionalDataRiskStandalone.CvcResultRawOption.IsSet) - writer.WriteString("cvcResultRaw", additionalDataRiskStandalone.CvcResultRaw); - - if (additionalDataRiskStandalone.RiskTokenOption.IsSet) - writer.WriteString("riskToken", additionalDataRiskStandalone.RiskToken); - - if (additionalDataRiskStandalone.ThreeDAuthenticatedOption.IsSet) - writer.WriteString("threeDAuthenticated", additionalDataRiskStandalone.ThreeDAuthenticated); - - if (additionalDataRiskStandalone.ThreeDOfferedOption.IsSet) - writer.WriteString("threeDOffered", additionalDataRiskStandalone.ThreeDOffered); - - if (additionalDataRiskStandalone.TokenDataTypeOption.IsSet) - writer.WriteString("tokenDataType", additionalDataRiskStandalone.TokenDataType); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataSubMerchant.cs b/Adyen/Model/Checkout/AdditionalDataSubMerchant.cs index 990622341..bfbcea0a1 100644 --- a/Adyen/Model/Checkout/AdditionalDataSubMerchant.cs +++ b/Adyen/Model/Checkout/AdditionalDataSubMerchant.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,222 +15,137 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataSubMerchant /// - public partial class AdditionalDataSubMerchant : IValidatableObject + [DataContract(Name = "AdditionalDataSubMerchant")] + public partial class AdditionalDataSubMerchant : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Required for transactions performed by registered payment facilitators. Indicates the number of sub-merchants contained in the request. For example, **3**. - /// Required for transactions performed by registered payment facilitators. The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters - /// Required for transactions performed by registered payment facilitators. The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters - /// Required for transactions performed by registered payment facilitators. The email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters - /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters - /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits - /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters - /// Required for transactions performed by registered payment facilitators. The phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters - /// Required for transactions performed by registered payment facilitators. The postal code of the sub-merchant's address, without dashes. * Format: Numeric * Fixed length: 8 digits - /// Required for transactions performed by registered payment facilitators. The state code of the sub-merchant's address, if applicable to the country. * Format: Alphanumeric * Maximum length: 2 characters - /// Required for transactions performed by registered payment facilitators. The street name and house number of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 60 characters - /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ - [JsonConstructor] - public AdditionalDataSubMerchant(Option subMerchantNumberOfSubSellers = default, Option subMerchantSubSellerSubSellerNrCity = default, Option subMerchantSubSellerSubSellerNrCountry = default, Option subMerchantSubSellerSubSellerNrEmail = default, Option subMerchantSubSellerSubSellerNrId = default, Option subMerchantSubSellerSubSellerNrMcc = default, Option subMerchantSubSellerSubSellerNrName = default, Option subMerchantSubSellerSubSellerNrPhoneNumber = default, Option subMerchantSubSellerSubSellerNrPostalCode = default, Option subMerchantSubSellerSubSellerNrState = default, Option subMerchantSubSellerSubSellerNrStreet = default, Option subMerchantSubSellerSubSellerNrTaxId = default) + /// Required for transactions performed by registered payment facilitators. Indicates the number of sub-merchants contained in the request. For example, **3**.. + /// Required for transactions performed by registered payment facilitators. The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters. + /// Required for transactions performed by registered payment facilitators. The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters. + /// Required for transactions performed by registered payment facilitators. The email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters. + /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters. + /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits. + /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. Exception: for acquirers in Brazil, this value does not overwrite the shopper statement. * Format: Alphanumeric * Maximum length: 22 characters. + /// Required for transactions performed by registered payment facilitators. The phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters. + /// Required for transactions performed by registered payment facilitators. The postal code of the sub-merchant's address, without dashes. * Format: Numeric * Fixed length: 8 digits. + /// Required for transactions performed by registered payment facilitators. The state code of the sub-merchant's address, if applicable to the country. * Format: Alphanumeric * Maximum length: 2 characters. + /// Required for transactions performed by registered payment facilitators. The street name and house number of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 60 characters. + /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ. + public AdditionalDataSubMerchant(string subMerchantNumberOfSubSellers = default(string), string subMerchantSubSellerSubSellerNrCity = default(string), string subMerchantSubSellerSubSellerNrCountry = default(string), string subMerchantSubSellerSubSellerNrEmail = default(string), string subMerchantSubSellerSubSellerNrId = default(string), string subMerchantSubSellerSubSellerNrMcc = default(string), string subMerchantSubSellerSubSellerNrName = default(string), string subMerchantSubSellerSubSellerNrPhoneNumber = default(string), string subMerchantSubSellerSubSellerNrPostalCode = default(string), string subMerchantSubSellerSubSellerNrState = default(string), string subMerchantSubSellerSubSellerNrStreet = default(string), string subMerchantSubSellerSubSellerNrTaxId = default(string)) { - SubMerchantNumberOfSubSellersOption = subMerchantNumberOfSubSellers; - SubMerchantSubSellerSubSellerNrCityOption = subMerchantSubSellerSubSellerNrCity; - SubMerchantSubSellerSubSellerNrCountryOption = subMerchantSubSellerSubSellerNrCountry; - SubMerchantSubSellerSubSellerNrEmailOption = subMerchantSubSellerSubSellerNrEmail; - SubMerchantSubSellerSubSellerNrIdOption = subMerchantSubSellerSubSellerNrId; - SubMerchantSubSellerSubSellerNrMccOption = subMerchantSubSellerSubSellerNrMcc; - SubMerchantSubSellerSubSellerNrNameOption = subMerchantSubSellerSubSellerNrName; - SubMerchantSubSellerSubSellerNrPhoneNumberOption = subMerchantSubSellerSubSellerNrPhoneNumber; - SubMerchantSubSellerSubSellerNrPostalCodeOption = subMerchantSubSellerSubSellerNrPostalCode; - SubMerchantSubSellerSubSellerNrStateOption = subMerchantSubSellerSubSellerNrState; - SubMerchantSubSellerSubSellerNrStreetOption = subMerchantSubSellerSubSellerNrStreet; - SubMerchantSubSellerSubSellerNrTaxIdOption = subMerchantSubSellerSubSellerNrTaxId; - OnCreated(); + this.SubMerchantNumberOfSubSellers = subMerchantNumberOfSubSellers; + this.SubMerchantSubSellerSubSellerNrCity = subMerchantSubSellerSubSellerNrCity; + this.SubMerchantSubSellerSubSellerNrCountry = subMerchantSubSellerSubSellerNrCountry; + this.SubMerchantSubSellerSubSellerNrEmail = subMerchantSubSellerSubSellerNrEmail; + this.SubMerchantSubSellerSubSellerNrId = subMerchantSubSellerSubSellerNrId; + this.SubMerchantSubSellerSubSellerNrMcc = subMerchantSubSellerSubSellerNrMcc; + this.SubMerchantSubSellerSubSellerNrName = subMerchantSubSellerSubSellerNrName; + this.SubMerchantSubSellerSubSellerNrPhoneNumber = subMerchantSubSellerSubSellerNrPhoneNumber; + this.SubMerchantSubSellerSubSellerNrPostalCode = subMerchantSubSellerSubSellerNrPostalCode; + this.SubMerchantSubSellerSubSellerNrState = subMerchantSubSellerSubSellerNrState; + this.SubMerchantSubSellerSubSellerNrStreet = subMerchantSubSellerSubSellerNrStreet; + this.SubMerchantSubSellerSubSellerNrTaxId = subMerchantSubSellerSubSellerNrTaxId; } - partial void OnCreated(); - - /// - /// Used to track the state of SubMerchantNumberOfSubSellers - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantNumberOfSubSellersOption { get; private set; } - /// /// Required for transactions performed by registered payment facilitators. Indicates the number of sub-merchants contained in the request. For example, **3**. /// /// Required for transactions performed by registered payment facilitators. Indicates the number of sub-merchants contained in the request. For example, **3**. - [JsonPropertyName("subMerchant.numberOfSubSellers")] - public string SubMerchantNumberOfSubSellers { get { return this.SubMerchantNumberOfSubSellersOption; } set { this.SubMerchantNumberOfSubSellersOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantSubSellerSubSellerNrCity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantSubSellerSubSellerNrCityOption { get; private set; } + [DataMember(Name = "subMerchant.numberOfSubSellers", EmitDefaultValue = false)] + public string SubMerchantNumberOfSubSellers { get; set; } /// /// Required for transactions performed by registered payment facilitators. The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters /// /// Required for transactions performed by registered payment facilitators. The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters - [JsonPropertyName("subMerchant.subSeller[subSellerNr].city")] - public string SubMerchantSubSellerSubSellerNrCity { get { return this.SubMerchantSubSellerSubSellerNrCityOption; } set { this.SubMerchantSubSellerSubSellerNrCityOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantSubSellerSubSellerNrCountry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantSubSellerSubSellerNrCountryOption { get; private set; } + [DataMember(Name = "subMerchant.subSeller[subSellerNr].city", EmitDefaultValue = false)] + public string SubMerchantSubSellerSubSellerNrCity { get; set; } /// /// Required for transactions performed by registered payment facilitators. The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters /// /// Required for transactions performed by registered payment facilitators. The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters - [JsonPropertyName("subMerchant.subSeller[subSellerNr].country")] - public string SubMerchantSubSellerSubSellerNrCountry { get { return this.SubMerchantSubSellerSubSellerNrCountryOption; } set { this.SubMerchantSubSellerSubSellerNrCountryOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantSubSellerSubSellerNrEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantSubSellerSubSellerNrEmailOption { get; private set; } + [DataMember(Name = "subMerchant.subSeller[subSellerNr].country", EmitDefaultValue = false)] + public string SubMerchantSubSellerSubSellerNrCountry { get; set; } /// /// Required for transactions performed by registered payment facilitators. The email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters /// /// Required for transactions performed by registered payment facilitators. The email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters - [JsonPropertyName("subMerchant.subSeller[subSellerNr].email")] - public string SubMerchantSubSellerSubSellerNrEmail { get { return this.SubMerchantSubSellerSubSellerNrEmailOption; } set { this.SubMerchantSubSellerSubSellerNrEmailOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantSubSellerSubSellerNrId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantSubSellerSubSellerNrIdOption { get; private set; } + [DataMember(Name = "subMerchant.subSeller[subSellerNr].email", EmitDefaultValue = false)] + public string SubMerchantSubSellerSubSellerNrEmail { get; set; } /// /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters /// /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters - [JsonPropertyName("subMerchant.subSeller[subSellerNr].id")] - public string SubMerchantSubSellerSubSellerNrId { get { return this.SubMerchantSubSellerSubSellerNrIdOption; } set { this.SubMerchantSubSellerSubSellerNrIdOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantSubSellerSubSellerNrMcc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantSubSellerSubSellerNrMccOption { get; private set; } + [DataMember(Name = "subMerchant.subSeller[subSellerNr].id", EmitDefaultValue = false)] + public string SubMerchantSubSellerSubSellerNrId { get; set; } /// /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits /// /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits - [JsonPropertyName("subMerchant.subSeller[subSellerNr].mcc")] - public string SubMerchantSubSellerSubSellerNrMcc { get { return this.SubMerchantSubSellerSubSellerNrMccOption; } set { this.SubMerchantSubSellerSubSellerNrMccOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantSubSellerSubSellerNrName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantSubSellerSubSellerNrNameOption { get; private set; } - - /// - /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters - /// - /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters - [JsonPropertyName("subMerchant.subSeller[subSellerNr].name")] - public string SubMerchantSubSellerSubSellerNrName { get { return this.SubMerchantSubSellerSubSellerNrNameOption; } set { this.SubMerchantSubSellerSubSellerNrNameOption = new Option(value); } } + [DataMember(Name = "subMerchant.subSeller[subSellerNr].mcc", EmitDefaultValue = false)] + public string SubMerchantSubSellerSubSellerNrMcc { get; set; } /// - /// Used to track the state of SubMerchantSubSellerSubSellerNrPhoneNumber + /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. Exception: for acquirers in Brazil, this value does not overwrite the shopper statement. * Format: Alphanumeric * Maximum length: 22 characters /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantSubSellerSubSellerNrPhoneNumberOption { get; private set; } + /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. Exception: for acquirers in Brazil, this value does not overwrite the shopper statement. * Format: Alphanumeric * Maximum length: 22 characters + [DataMember(Name = "subMerchant.subSeller[subSellerNr].name", EmitDefaultValue = false)] + public string SubMerchantSubSellerSubSellerNrName { get; set; } /// /// Required for transactions performed by registered payment facilitators. The phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters /// /// Required for transactions performed by registered payment facilitators. The phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters - [JsonPropertyName("subMerchant.subSeller[subSellerNr].phoneNumber")] - public string SubMerchantSubSellerSubSellerNrPhoneNumber { get { return this.SubMerchantSubSellerSubSellerNrPhoneNumberOption; } set { this.SubMerchantSubSellerSubSellerNrPhoneNumberOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantSubSellerSubSellerNrPostalCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantSubSellerSubSellerNrPostalCodeOption { get; private set; } + [DataMember(Name = "subMerchant.subSeller[subSellerNr].phoneNumber", EmitDefaultValue = false)] + public string SubMerchantSubSellerSubSellerNrPhoneNumber { get; set; } /// /// Required for transactions performed by registered payment facilitators. The postal code of the sub-merchant's address, without dashes. * Format: Numeric * Fixed length: 8 digits /// /// Required for transactions performed by registered payment facilitators. The postal code of the sub-merchant's address, without dashes. * Format: Numeric * Fixed length: 8 digits - [JsonPropertyName("subMerchant.subSeller[subSellerNr].postalCode")] - public string SubMerchantSubSellerSubSellerNrPostalCode { get { return this.SubMerchantSubSellerSubSellerNrPostalCodeOption; } set { this.SubMerchantSubSellerSubSellerNrPostalCodeOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantSubSellerSubSellerNrState - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantSubSellerSubSellerNrStateOption { get; private set; } + [DataMember(Name = "subMerchant.subSeller[subSellerNr].postalCode", EmitDefaultValue = false)] + public string SubMerchantSubSellerSubSellerNrPostalCode { get; set; } /// /// Required for transactions performed by registered payment facilitators. The state code of the sub-merchant's address, if applicable to the country. * Format: Alphanumeric * Maximum length: 2 characters /// /// Required for transactions performed by registered payment facilitators. The state code of the sub-merchant's address, if applicable to the country. * Format: Alphanumeric * Maximum length: 2 characters - [JsonPropertyName("subMerchant.subSeller[subSellerNr].state")] - public string SubMerchantSubSellerSubSellerNrState { get { return this.SubMerchantSubSellerSubSellerNrStateOption; } set { this.SubMerchantSubSellerSubSellerNrStateOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantSubSellerSubSellerNrStreet - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantSubSellerSubSellerNrStreetOption { get; private set; } + [DataMember(Name = "subMerchant.subSeller[subSellerNr].state", EmitDefaultValue = false)] + public string SubMerchantSubSellerSubSellerNrState { get; set; } /// /// Required for transactions performed by registered payment facilitators. The street name and house number of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 60 characters /// /// Required for transactions performed by registered payment facilitators. The street name and house number of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 60 characters - [JsonPropertyName("subMerchant.subSeller[subSellerNr].street")] - public string SubMerchantSubSellerSubSellerNrStreet { get { return this.SubMerchantSubSellerSubSellerNrStreetOption; } set { this.SubMerchantSubSellerSubSellerNrStreetOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchantSubSellerSubSellerNrTaxId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantSubSellerSubSellerNrTaxIdOption { get; private set; } + [DataMember(Name = "subMerchant.subSeller[subSellerNr].street", EmitDefaultValue = false)] + public string SubMerchantSubSellerSubSellerNrStreet { get; set; } /// /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ /// /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ - [JsonPropertyName("subMerchant.subSeller[subSellerNr].taxId")] - public string SubMerchantSubSellerSubSellerNrTaxId { get { return this.SubMerchantSubSellerSubSellerNrTaxIdOption; } set { this.SubMerchantSubSellerSubSellerNrTaxIdOption = new Option(value); } } + [DataMember(Name = "subMerchant.subSeller[subSellerNr].taxId", EmitDefaultValue = false)] + public string SubMerchantSubSellerSubSellerNrTaxId { get; set; } /// /// Returns the string presentation of the object @@ -256,242 +172,167 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataSubMerchantJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataSubMerchant Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option subMerchantNumberOfSubSellers = default; - Option subMerchantSubSellerSubSellerNrCity = default; - Option subMerchantSubSellerSubSellerNrCountry = default; - Option subMerchantSubSellerSubSellerNrEmail = default; - Option subMerchantSubSellerSubSellerNrId = default; - Option subMerchantSubSellerSubSellerNrMcc = default; - Option subMerchantSubSellerSubSellerNrName = default; - Option subMerchantSubSellerSubSellerNrPhoneNumber = default; - Option subMerchantSubSellerSubSellerNrPostalCode = default; - Option subMerchantSubSellerSubSellerNrState = default; - Option subMerchantSubSellerSubSellerNrStreet = default; - Option subMerchantSubSellerSubSellerNrTaxId = default; + return this.Equals(input as AdditionalDataSubMerchant); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AdditionalDataSubMerchant instances are equal + /// + /// Instance of AdditionalDataSubMerchant to be compared + /// Boolean + public bool Equals(AdditionalDataSubMerchant input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "subMerchant.numberOfSubSellers": - subMerchantNumberOfSubSellers = new Option(utf8JsonReader.GetString()); - break; - case "subMerchant.subSeller[subSellerNr].city": - subMerchantSubSellerSubSellerNrCity = new Option(utf8JsonReader.GetString()); - break; - case "subMerchant.subSeller[subSellerNr].country": - subMerchantSubSellerSubSellerNrCountry = new Option(utf8JsonReader.GetString()); - break; - case "subMerchant.subSeller[subSellerNr].email": - subMerchantSubSellerSubSellerNrEmail = new Option(utf8JsonReader.GetString()); - break; - case "subMerchant.subSeller[subSellerNr].id": - subMerchantSubSellerSubSellerNrId = new Option(utf8JsonReader.GetString()); - break; - case "subMerchant.subSeller[subSellerNr].mcc": - subMerchantSubSellerSubSellerNrMcc = new Option(utf8JsonReader.GetString()); - break; - case "subMerchant.subSeller[subSellerNr].name": - subMerchantSubSellerSubSellerNrName = new Option(utf8JsonReader.GetString()); - break; - case "subMerchant.subSeller[subSellerNr].phoneNumber": - subMerchantSubSellerSubSellerNrPhoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "subMerchant.subSeller[subSellerNr].postalCode": - subMerchantSubSellerSubSellerNrPostalCode = new Option(utf8JsonReader.GetString()); - break; - case "subMerchant.subSeller[subSellerNr].state": - subMerchantSubSellerSubSellerNrState = new Option(utf8JsonReader.GetString()); - break; - case "subMerchant.subSeller[subSellerNr].street": - subMerchantSubSellerSubSellerNrStreet = new Option(utf8JsonReader.GetString()); - break; - case "subMerchant.subSeller[subSellerNr].taxId": - subMerchantSubSellerSubSellerNrTaxId = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (subMerchantNumberOfSubSellers.IsSet && subMerchantNumberOfSubSellers.Value == null) - throw new ArgumentNullException(nameof(subMerchantNumberOfSubSellers), "Property is not nullable for class AdditionalDataSubMerchant."); - - if (subMerchantSubSellerSubSellerNrCity.IsSet && subMerchantSubSellerSubSellerNrCity.Value == null) - throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrCity), "Property is not nullable for class AdditionalDataSubMerchant."); - - if (subMerchantSubSellerSubSellerNrCountry.IsSet && subMerchantSubSellerSubSellerNrCountry.Value == null) - throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrCountry), "Property is not nullable for class AdditionalDataSubMerchant."); - - if (subMerchantSubSellerSubSellerNrEmail.IsSet && subMerchantSubSellerSubSellerNrEmail.Value == null) - throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrEmail), "Property is not nullable for class AdditionalDataSubMerchant."); - - if (subMerchantSubSellerSubSellerNrId.IsSet && subMerchantSubSellerSubSellerNrId.Value == null) - throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrId), "Property is not nullable for class AdditionalDataSubMerchant."); - - if (subMerchantSubSellerSubSellerNrMcc.IsSet && subMerchantSubSellerSubSellerNrMcc.Value == null) - throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrMcc), "Property is not nullable for class AdditionalDataSubMerchant."); - - if (subMerchantSubSellerSubSellerNrName.IsSet && subMerchantSubSellerSubSellerNrName.Value == null) - throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrName), "Property is not nullable for class AdditionalDataSubMerchant."); - - if (subMerchantSubSellerSubSellerNrPhoneNumber.IsSet && subMerchantSubSellerSubSellerNrPhoneNumber.Value == null) - throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrPhoneNumber), "Property is not nullable for class AdditionalDataSubMerchant."); - - if (subMerchantSubSellerSubSellerNrPostalCode.IsSet && subMerchantSubSellerSubSellerNrPostalCode.Value == null) - throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrPostalCode), "Property is not nullable for class AdditionalDataSubMerchant."); - - if (subMerchantSubSellerSubSellerNrState.IsSet && subMerchantSubSellerSubSellerNrState.Value == null) - throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrState), "Property is not nullable for class AdditionalDataSubMerchant."); - - if (subMerchantSubSellerSubSellerNrStreet.IsSet && subMerchantSubSellerSubSellerNrStreet.Value == null) - throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrStreet), "Property is not nullable for class AdditionalDataSubMerchant."); - - if (subMerchantSubSellerSubSellerNrTaxId.IsSet && subMerchantSubSellerSubSellerNrTaxId.Value == null) - throw new ArgumentNullException(nameof(subMerchantSubSellerSubSellerNrTaxId), "Property is not nullable for class AdditionalDataSubMerchant."); - - return new AdditionalDataSubMerchant(subMerchantNumberOfSubSellers, subMerchantSubSellerSubSellerNrCity, subMerchantSubSellerSubSellerNrCountry, subMerchantSubSellerSubSellerNrEmail, subMerchantSubSellerSubSellerNrId, subMerchantSubSellerSubSellerNrMcc, subMerchantSubSellerSubSellerNrName, subMerchantSubSellerSubSellerNrPhoneNumber, subMerchantSubSellerSubSellerNrPostalCode, subMerchantSubSellerSubSellerNrState, subMerchantSubSellerSubSellerNrStreet, subMerchantSubSellerSubSellerNrTaxId); + return + ( + this.SubMerchantNumberOfSubSellers == input.SubMerchantNumberOfSubSellers || + (this.SubMerchantNumberOfSubSellers != null && + this.SubMerchantNumberOfSubSellers.Equals(input.SubMerchantNumberOfSubSellers)) + ) && + ( + this.SubMerchantSubSellerSubSellerNrCity == input.SubMerchantSubSellerSubSellerNrCity || + (this.SubMerchantSubSellerSubSellerNrCity != null && + this.SubMerchantSubSellerSubSellerNrCity.Equals(input.SubMerchantSubSellerSubSellerNrCity)) + ) && + ( + this.SubMerchantSubSellerSubSellerNrCountry == input.SubMerchantSubSellerSubSellerNrCountry || + (this.SubMerchantSubSellerSubSellerNrCountry != null && + this.SubMerchantSubSellerSubSellerNrCountry.Equals(input.SubMerchantSubSellerSubSellerNrCountry)) + ) && + ( + this.SubMerchantSubSellerSubSellerNrEmail == input.SubMerchantSubSellerSubSellerNrEmail || + (this.SubMerchantSubSellerSubSellerNrEmail != null && + this.SubMerchantSubSellerSubSellerNrEmail.Equals(input.SubMerchantSubSellerSubSellerNrEmail)) + ) && + ( + this.SubMerchantSubSellerSubSellerNrId == input.SubMerchantSubSellerSubSellerNrId || + (this.SubMerchantSubSellerSubSellerNrId != null && + this.SubMerchantSubSellerSubSellerNrId.Equals(input.SubMerchantSubSellerSubSellerNrId)) + ) && + ( + this.SubMerchantSubSellerSubSellerNrMcc == input.SubMerchantSubSellerSubSellerNrMcc || + (this.SubMerchantSubSellerSubSellerNrMcc != null && + this.SubMerchantSubSellerSubSellerNrMcc.Equals(input.SubMerchantSubSellerSubSellerNrMcc)) + ) && + ( + this.SubMerchantSubSellerSubSellerNrName == input.SubMerchantSubSellerSubSellerNrName || + (this.SubMerchantSubSellerSubSellerNrName != null && + this.SubMerchantSubSellerSubSellerNrName.Equals(input.SubMerchantSubSellerSubSellerNrName)) + ) && + ( + this.SubMerchantSubSellerSubSellerNrPhoneNumber == input.SubMerchantSubSellerSubSellerNrPhoneNumber || + (this.SubMerchantSubSellerSubSellerNrPhoneNumber != null && + this.SubMerchantSubSellerSubSellerNrPhoneNumber.Equals(input.SubMerchantSubSellerSubSellerNrPhoneNumber)) + ) && + ( + this.SubMerchantSubSellerSubSellerNrPostalCode == input.SubMerchantSubSellerSubSellerNrPostalCode || + (this.SubMerchantSubSellerSubSellerNrPostalCode != null && + this.SubMerchantSubSellerSubSellerNrPostalCode.Equals(input.SubMerchantSubSellerSubSellerNrPostalCode)) + ) && + ( + this.SubMerchantSubSellerSubSellerNrState == input.SubMerchantSubSellerSubSellerNrState || + (this.SubMerchantSubSellerSubSellerNrState != null && + this.SubMerchantSubSellerSubSellerNrState.Equals(input.SubMerchantSubSellerSubSellerNrState)) + ) && + ( + this.SubMerchantSubSellerSubSellerNrStreet == input.SubMerchantSubSellerSubSellerNrStreet || + (this.SubMerchantSubSellerSubSellerNrStreet != null && + this.SubMerchantSubSellerSubSellerNrStreet.Equals(input.SubMerchantSubSellerSubSellerNrStreet)) + ) && + ( + this.SubMerchantSubSellerSubSellerNrTaxId == input.SubMerchantSubSellerSubSellerNrTaxId || + (this.SubMerchantSubSellerSubSellerNrTaxId != null && + this.SubMerchantSubSellerSubSellerNrTaxId.Equals(input.SubMerchantSubSellerSubSellerNrTaxId)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataSubMerchant additionalDataSubMerchant, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataSubMerchant, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SubMerchantNumberOfSubSellers != null) + { + hashCode = (hashCode * 59) + this.SubMerchantNumberOfSubSellers.GetHashCode(); + } + if (this.SubMerchantSubSellerSubSellerNrCity != null) + { + hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrCity.GetHashCode(); + } + if (this.SubMerchantSubSellerSubSellerNrCountry != null) + { + hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrCountry.GetHashCode(); + } + if (this.SubMerchantSubSellerSubSellerNrEmail != null) + { + hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrEmail.GetHashCode(); + } + if (this.SubMerchantSubSellerSubSellerNrId != null) + { + hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrId.GetHashCode(); + } + if (this.SubMerchantSubSellerSubSellerNrMcc != null) + { + hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrMcc.GetHashCode(); + } + if (this.SubMerchantSubSellerSubSellerNrName != null) + { + hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrName.GetHashCode(); + } + if (this.SubMerchantSubSellerSubSellerNrPhoneNumber != null) + { + hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrPhoneNumber.GetHashCode(); + } + if (this.SubMerchantSubSellerSubSellerNrPostalCode != null) + { + hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrPostalCode.GetHashCode(); + } + if (this.SubMerchantSubSellerSubSellerNrState != null) + { + hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrState.GetHashCode(); + } + if (this.SubMerchantSubSellerSubSellerNrStreet != null) + { + hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrStreet.GetHashCode(); + } + if (this.SubMerchantSubSellerSubSellerNrTaxId != null) + { + hashCode = (hashCode * 59) + this.SubMerchantSubSellerSubSellerNrTaxId.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataSubMerchant additionalDataSubMerchant, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataSubMerchant.SubMerchantNumberOfSubSellersOption.IsSet && additionalDataSubMerchant.SubMerchantNumberOfSubSellers == null) - throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantNumberOfSubSellers), "Property is required for class AdditionalDataSubMerchant."); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCityOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCity == null) - throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCity), "Property is required for class AdditionalDataSubMerchant."); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCountryOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCountry == null) - throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCountry), "Property is required for class AdditionalDataSubMerchant."); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrEmailOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrEmail == null) - throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrEmail), "Property is required for class AdditionalDataSubMerchant."); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrIdOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrId == null) - throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrId), "Property is required for class AdditionalDataSubMerchant."); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrMccOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrMcc == null) - throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrMcc), "Property is required for class AdditionalDataSubMerchant."); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrNameOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrName == null) - throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrName), "Property is required for class AdditionalDataSubMerchant."); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPhoneNumberOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPhoneNumber == null) - throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPhoneNumber), "Property is required for class AdditionalDataSubMerchant."); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPostalCodeOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPostalCode == null) - throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPostalCode), "Property is required for class AdditionalDataSubMerchant."); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStateOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrState == null) - throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrState), "Property is required for class AdditionalDataSubMerchant."); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStreetOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStreet == null) - throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStreet), "Property is required for class AdditionalDataSubMerchant."); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrTaxIdOption.IsSet && additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrTaxId == null) - throw new ArgumentNullException(nameof(additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrTaxId), "Property is required for class AdditionalDataSubMerchant."); - - if (additionalDataSubMerchant.SubMerchantNumberOfSubSellersOption.IsSet) - writer.WriteString("subMerchant.numberOfSubSellers", additionalDataSubMerchant.SubMerchantNumberOfSubSellers); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCityOption.IsSet) - writer.WriteString("subMerchant.subSeller[subSellerNr].city", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCity); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCountryOption.IsSet) - writer.WriteString("subMerchant.subSeller[subSellerNr].country", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrCountry); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrEmailOption.IsSet) - writer.WriteString("subMerchant.subSeller[subSellerNr].email", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrEmail); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrIdOption.IsSet) - writer.WriteString("subMerchant.subSeller[subSellerNr].id", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrId); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrMccOption.IsSet) - writer.WriteString("subMerchant.subSeller[subSellerNr].mcc", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrMcc); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrNameOption.IsSet) - writer.WriteString("subMerchant.subSeller[subSellerNr].name", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrName); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPhoneNumberOption.IsSet) - writer.WriteString("subMerchant.subSeller[subSellerNr].phoneNumber", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPhoneNumber); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPostalCodeOption.IsSet) - writer.WriteString("subMerchant.subSeller[subSellerNr].postalCode", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrPostalCode); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStateOption.IsSet) - writer.WriteString("subMerchant.subSeller[subSellerNr].state", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrState); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStreetOption.IsSet) - writer.WriteString("subMerchant.subSeller[subSellerNr].street", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrStreet); - - if (additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrTaxIdOption.IsSet) - writer.WriteString("subMerchant.subSeller[subSellerNr].taxId", additionalDataSubMerchant.SubMerchantSubSellerSubSellerNrTaxId); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs b/Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs index 57110975c..787a7cbfe 100644 --- a/Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs +++ b/Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,174 +15,110 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataTemporaryServices /// - public partial class AdditionalDataTemporaryServices : IValidatableObject + [DataContract(Name = "AdditionalDataTemporaryServices")] + public partial class AdditionalDataTemporaryServices : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 - /// The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros. - /// The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros. - /// The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros - /// The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros - /// The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces - /// The billing period start date. * Format: ddMMyy * maxLength: 6 - /// The billing period end date. * Format: ddMMyy * maxLength: 6 - /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12 - [JsonConstructor] - public AdditionalDataTemporaryServices(Option enhancedSchemeDataCustomerReference = default, Option enhancedSchemeDataEmployeeName = default, Option enhancedSchemeDataJobDescription = default, Option enhancedSchemeDataRegularHoursRate = default, Option enhancedSchemeDataRegularHoursWorked = default, Option enhancedSchemeDataRequestName = default, Option enhancedSchemeDataTempStartDate = default, Option enhancedSchemeDataTempWeekEnding = default, Option enhancedSchemeDataTotalTaxAmount = default) + /// The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25. + /// The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros.. + /// The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros.. + /// The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros. + /// The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros. + /// The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces. + /// The billing period start date. * Format: ddMMyy * maxLength: 6. + /// The billing period end date. * Format: ddMMyy * maxLength: 6. + /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12. + public AdditionalDataTemporaryServices(string enhancedSchemeDataCustomerReference = default(string), string enhancedSchemeDataEmployeeName = default(string), string enhancedSchemeDataJobDescription = default(string), string enhancedSchemeDataRegularHoursRate = default(string), string enhancedSchemeDataRegularHoursWorked = default(string), string enhancedSchemeDataRequestName = default(string), string enhancedSchemeDataTempStartDate = default(string), string enhancedSchemeDataTempWeekEnding = default(string), string enhancedSchemeDataTotalTaxAmount = default(string)) { - EnhancedSchemeDataCustomerReferenceOption = enhancedSchemeDataCustomerReference; - EnhancedSchemeDataEmployeeNameOption = enhancedSchemeDataEmployeeName; - EnhancedSchemeDataJobDescriptionOption = enhancedSchemeDataJobDescription; - EnhancedSchemeDataRegularHoursRateOption = enhancedSchemeDataRegularHoursRate; - EnhancedSchemeDataRegularHoursWorkedOption = enhancedSchemeDataRegularHoursWorked; - EnhancedSchemeDataRequestNameOption = enhancedSchemeDataRequestName; - EnhancedSchemeDataTempStartDateOption = enhancedSchemeDataTempStartDate; - EnhancedSchemeDataTempWeekEndingOption = enhancedSchemeDataTempWeekEnding; - EnhancedSchemeDataTotalTaxAmountOption = enhancedSchemeDataTotalTaxAmount; - OnCreated(); + this.EnhancedSchemeDataCustomerReference = enhancedSchemeDataCustomerReference; + this.EnhancedSchemeDataEmployeeName = enhancedSchemeDataEmployeeName; + this.EnhancedSchemeDataJobDescription = enhancedSchemeDataJobDescription; + this.EnhancedSchemeDataRegularHoursRate = enhancedSchemeDataRegularHoursRate; + this.EnhancedSchemeDataRegularHoursWorked = enhancedSchemeDataRegularHoursWorked; + this.EnhancedSchemeDataRequestName = enhancedSchemeDataRequestName; + this.EnhancedSchemeDataTempStartDate = enhancedSchemeDataTempStartDate; + this.EnhancedSchemeDataTempWeekEnding = enhancedSchemeDataTempWeekEnding; + this.EnhancedSchemeDataTotalTaxAmount = enhancedSchemeDataTotalTaxAmount; } - partial void OnCreated(); - - /// - /// Used to track the state of EnhancedSchemeDataCustomerReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataCustomerReferenceOption { get; private set; } - /// /// The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 /// /// The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 - [JsonPropertyName("enhancedSchemeData.customerReference")] - public string EnhancedSchemeDataCustomerReference { get { return this.EnhancedSchemeDataCustomerReferenceOption; } set { this.EnhancedSchemeDataCustomerReferenceOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataEmployeeName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataEmployeeNameOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.customerReference", EmitDefaultValue = false)] + public string EnhancedSchemeDataCustomerReference { get; set; } /// /// The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros. /// /// The name or ID of the person working in a temporary capacity. * maxLength: 40. * Must not be all spaces. *Must not be all zeros. - [JsonPropertyName("enhancedSchemeData.employeeName")] - public string EnhancedSchemeDataEmployeeName { get { return this.EnhancedSchemeDataEmployeeNameOption; } set { this.EnhancedSchemeDataEmployeeNameOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataJobDescription - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataJobDescriptionOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.employeeName", EmitDefaultValue = false)] + public string EnhancedSchemeDataEmployeeName { get; set; } /// /// The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros. /// /// The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all spaces. *Must not be all zeros. - [JsonPropertyName("enhancedSchemeData.jobDescription")] - public string EnhancedSchemeDataJobDescription { get { return this.EnhancedSchemeDataJobDescriptionOption; } set { this.EnhancedSchemeDataJobDescriptionOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataRegularHoursRate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataRegularHoursRateOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.jobDescription", EmitDefaultValue = false)] + public string EnhancedSchemeDataJobDescription { get; set; } /// /// The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros /// /// The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros - [JsonPropertyName("enhancedSchemeData.regularHoursRate")] - public string EnhancedSchemeDataRegularHoursRate { get { return this.EnhancedSchemeDataRegularHoursRateOption; } set { this.EnhancedSchemeDataRegularHoursRateOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataRegularHoursWorked - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataRegularHoursWorkedOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.regularHoursRate", EmitDefaultValue = false)] + public string EnhancedSchemeDataRegularHoursRate { get; set; } /// /// The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros /// /// The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros - [JsonPropertyName("enhancedSchemeData.regularHoursWorked")] - public string EnhancedSchemeDataRegularHoursWorked { get { return this.EnhancedSchemeDataRegularHoursWorkedOption; } set { this.EnhancedSchemeDataRegularHoursWorkedOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataRequestName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataRequestNameOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.regularHoursWorked", EmitDefaultValue = false)] + public string EnhancedSchemeDataRegularHoursWorked { get; set; } /// /// The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces /// /// The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces - [JsonPropertyName("enhancedSchemeData.requestName")] - public string EnhancedSchemeDataRequestName { get { return this.EnhancedSchemeDataRequestNameOption; } set { this.EnhancedSchemeDataRequestNameOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataTempStartDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataTempStartDateOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.requestName", EmitDefaultValue = false)] + public string EnhancedSchemeDataRequestName { get; set; } /// /// The billing period start date. * Format: ddMMyy * maxLength: 6 /// /// The billing period start date. * Format: ddMMyy * maxLength: 6 - [JsonPropertyName("enhancedSchemeData.tempStartDate")] - public string EnhancedSchemeDataTempStartDate { get { return this.EnhancedSchemeDataTempStartDateOption; } set { this.EnhancedSchemeDataTempStartDateOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataTempWeekEnding - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataTempWeekEndingOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.tempStartDate", EmitDefaultValue = false)] + public string EnhancedSchemeDataTempStartDate { get; set; } /// /// The billing period end date. * Format: ddMMyy * maxLength: 6 /// /// The billing period end date. * Format: ddMMyy * maxLength: 6 - [JsonPropertyName("enhancedSchemeData.tempWeekEnding")] - public string EnhancedSchemeDataTempWeekEnding { get { return this.EnhancedSchemeDataTempWeekEndingOption; } set { this.EnhancedSchemeDataTempWeekEndingOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeDataTotalTaxAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataTotalTaxAmountOption { get; private set; } + [DataMember(Name = "enhancedSchemeData.tempWeekEnding", EmitDefaultValue = false)] + public string EnhancedSchemeDataTempWeekEnding { get; set; } /// /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12 /// /// The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12 - [JsonPropertyName("enhancedSchemeData.totalTaxAmount")] - public string EnhancedSchemeDataTotalTaxAmount { get { return this.EnhancedSchemeDataTotalTaxAmountOption; } set { this.EnhancedSchemeDataTotalTaxAmountOption = new Option(value); } } + [DataMember(Name = "enhancedSchemeData.totalTaxAmount", EmitDefaultValue = false)] + public string EnhancedSchemeDataTotalTaxAmount { get; set; } /// /// Returns the string presentation of the object @@ -205,203 +142,140 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataTemporaryServicesJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataTemporaryServices Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option enhancedSchemeDataCustomerReference = default; - Option enhancedSchemeDataEmployeeName = default; - Option enhancedSchemeDataJobDescription = default; - Option enhancedSchemeDataRegularHoursRate = default; - Option enhancedSchemeDataRegularHoursWorked = default; - Option enhancedSchemeDataRequestName = default; - Option enhancedSchemeDataTempStartDate = default; - Option enhancedSchemeDataTempWeekEnding = default; - Option enhancedSchemeDataTotalTaxAmount = default; + return this.Equals(input as AdditionalDataTemporaryServices); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AdditionalDataTemporaryServices instances are equal + /// + /// Instance of AdditionalDataTemporaryServices to be compared + /// Boolean + public bool Equals(AdditionalDataTemporaryServices input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "enhancedSchemeData.customerReference": - enhancedSchemeDataCustomerReference = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.employeeName": - enhancedSchemeDataEmployeeName = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.jobDescription": - enhancedSchemeDataJobDescription = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.regularHoursRate": - enhancedSchemeDataRegularHoursRate = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.regularHoursWorked": - enhancedSchemeDataRegularHoursWorked = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.requestName": - enhancedSchemeDataRequestName = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.tempStartDate": - enhancedSchemeDataTempStartDate = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.tempWeekEnding": - enhancedSchemeDataTempWeekEnding = new Option(utf8JsonReader.GetString()); - break; - case "enhancedSchemeData.totalTaxAmount": - enhancedSchemeDataTotalTaxAmount = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (enhancedSchemeDataCustomerReference.IsSet && enhancedSchemeDataCustomerReference.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataCustomerReference), "Property is not nullable for class AdditionalDataTemporaryServices."); - - if (enhancedSchemeDataEmployeeName.IsSet && enhancedSchemeDataEmployeeName.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataEmployeeName), "Property is not nullable for class AdditionalDataTemporaryServices."); - - if (enhancedSchemeDataJobDescription.IsSet && enhancedSchemeDataJobDescription.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataJobDescription), "Property is not nullable for class AdditionalDataTemporaryServices."); - - if (enhancedSchemeDataRegularHoursRate.IsSet && enhancedSchemeDataRegularHoursRate.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataRegularHoursRate), "Property is not nullable for class AdditionalDataTemporaryServices."); - - if (enhancedSchemeDataRegularHoursWorked.IsSet && enhancedSchemeDataRegularHoursWorked.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataRegularHoursWorked), "Property is not nullable for class AdditionalDataTemporaryServices."); - - if (enhancedSchemeDataRequestName.IsSet && enhancedSchemeDataRequestName.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataRequestName), "Property is not nullable for class AdditionalDataTemporaryServices."); - - if (enhancedSchemeDataTempStartDate.IsSet && enhancedSchemeDataTempStartDate.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataTempStartDate), "Property is not nullable for class AdditionalDataTemporaryServices."); - - if (enhancedSchemeDataTempWeekEnding.IsSet && enhancedSchemeDataTempWeekEnding.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataTempWeekEnding), "Property is not nullable for class AdditionalDataTemporaryServices."); - - if (enhancedSchemeDataTotalTaxAmount.IsSet && enhancedSchemeDataTotalTaxAmount.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeDataTotalTaxAmount), "Property is not nullable for class AdditionalDataTemporaryServices."); - - return new AdditionalDataTemporaryServices(enhancedSchemeDataCustomerReference, enhancedSchemeDataEmployeeName, enhancedSchemeDataJobDescription, enhancedSchemeDataRegularHoursRate, enhancedSchemeDataRegularHoursWorked, enhancedSchemeDataRequestName, enhancedSchemeDataTempStartDate, enhancedSchemeDataTempWeekEnding, enhancedSchemeDataTotalTaxAmount); + return + ( + this.EnhancedSchemeDataCustomerReference == input.EnhancedSchemeDataCustomerReference || + (this.EnhancedSchemeDataCustomerReference != null && + this.EnhancedSchemeDataCustomerReference.Equals(input.EnhancedSchemeDataCustomerReference)) + ) && + ( + this.EnhancedSchemeDataEmployeeName == input.EnhancedSchemeDataEmployeeName || + (this.EnhancedSchemeDataEmployeeName != null && + this.EnhancedSchemeDataEmployeeName.Equals(input.EnhancedSchemeDataEmployeeName)) + ) && + ( + this.EnhancedSchemeDataJobDescription == input.EnhancedSchemeDataJobDescription || + (this.EnhancedSchemeDataJobDescription != null && + this.EnhancedSchemeDataJobDescription.Equals(input.EnhancedSchemeDataJobDescription)) + ) && + ( + this.EnhancedSchemeDataRegularHoursRate == input.EnhancedSchemeDataRegularHoursRate || + (this.EnhancedSchemeDataRegularHoursRate != null && + this.EnhancedSchemeDataRegularHoursRate.Equals(input.EnhancedSchemeDataRegularHoursRate)) + ) && + ( + this.EnhancedSchemeDataRegularHoursWorked == input.EnhancedSchemeDataRegularHoursWorked || + (this.EnhancedSchemeDataRegularHoursWorked != null && + this.EnhancedSchemeDataRegularHoursWorked.Equals(input.EnhancedSchemeDataRegularHoursWorked)) + ) && + ( + this.EnhancedSchemeDataRequestName == input.EnhancedSchemeDataRequestName || + (this.EnhancedSchemeDataRequestName != null && + this.EnhancedSchemeDataRequestName.Equals(input.EnhancedSchemeDataRequestName)) + ) && + ( + this.EnhancedSchemeDataTempStartDate == input.EnhancedSchemeDataTempStartDate || + (this.EnhancedSchemeDataTempStartDate != null && + this.EnhancedSchemeDataTempStartDate.Equals(input.EnhancedSchemeDataTempStartDate)) + ) && + ( + this.EnhancedSchemeDataTempWeekEnding == input.EnhancedSchemeDataTempWeekEnding || + (this.EnhancedSchemeDataTempWeekEnding != null && + this.EnhancedSchemeDataTempWeekEnding.Equals(input.EnhancedSchemeDataTempWeekEnding)) + ) && + ( + this.EnhancedSchemeDataTotalTaxAmount == input.EnhancedSchemeDataTotalTaxAmount || + (this.EnhancedSchemeDataTotalTaxAmount != null && + this.EnhancedSchemeDataTotalTaxAmount.Equals(input.EnhancedSchemeDataTotalTaxAmount)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataTemporaryServices additionalDataTemporaryServices, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataTemporaryServices, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EnhancedSchemeDataCustomerReference != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataCustomerReference.GetHashCode(); + } + if (this.EnhancedSchemeDataEmployeeName != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataEmployeeName.GetHashCode(); + } + if (this.EnhancedSchemeDataJobDescription != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataJobDescription.GetHashCode(); + } + if (this.EnhancedSchemeDataRegularHoursRate != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataRegularHoursRate.GetHashCode(); + } + if (this.EnhancedSchemeDataRegularHoursWorked != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataRegularHoursWorked.GetHashCode(); + } + if (this.EnhancedSchemeDataRequestName != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataRequestName.GetHashCode(); + } + if (this.EnhancedSchemeDataTempStartDate != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataTempStartDate.GetHashCode(); + } + if (this.EnhancedSchemeDataTempWeekEnding != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataTempWeekEnding.GetHashCode(); + } + if (this.EnhancedSchemeDataTotalTaxAmount != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeDataTotalTaxAmount.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataTemporaryServices additionalDataTemporaryServices, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataTemporaryServices.EnhancedSchemeDataCustomerReferenceOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataCustomerReference == null) - throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataCustomerReference), "Property is required for class AdditionalDataTemporaryServices."); - - if (additionalDataTemporaryServices.EnhancedSchemeDataEmployeeNameOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataEmployeeName == null) - throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataEmployeeName), "Property is required for class AdditionalDataTemporaryServices."); - - if (additionalDataTemporaryServices.EnhancedSchemeDataJobDescriptionOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataJobDescription == null) - throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataJobDescription), "Property is required for class AdditionalDataTemporaryServices."); - - if (additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursRateOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursRate == null) - throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursRate), "Property is required for class AdditionalDataTemporaryServices."); - - if (additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursWorkedOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursWorked == null) - throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursWorked), "Property is required for class AdditionalDataTemporaryServices."); - - if (additionalDataTemporaryServices.EnhancedSchemeDataRequestNameOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataRequestName == null) - throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataRequestName), "Property is required for class AdditionalDataTemporaryServices."); - - if (additionalDataTemporaryServices.EnhancedSchemeDataTempStartDateOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataTempStartDate == null) - throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataTempStartDate), "Property is required for class AdditionalDataTemporaryServices."); - - if (additionalDataTemporaryServices.EnhancedSchemeDataTempWeekEndingOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataTempWeekEnding == null) - throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataTempWeekEnding), "Property is required for class AdditionalDataTemporaryServices."); - - if (additionalDataTemporaryServices.EnhancedSchemeDataTotalTaxAmountOption.IsSet && additionalDataTemporaryServices.EnhancedSchemeDataTotalTaxAmount == null) - throw new ArgumentNullException(nameof(additionalDataTemporaryServices.EnhancedSchemeDataTotalTaxAmount), "Property is required for class AdditionalDataTemporaryServices."); - - if (additionalDataTemporaryServices.EnhancedSchemeDataCustomerReferenceOption.IsSet) - writer.WriteString("enhancedSchemeData.customerReference", additionalDataTemporaryServices.EnhancedSchemeDataCustomerReference); - - if (additionalDataTemporaryServices.EnhancedSchemeDataEmployeeNameOption.IsSet) - writer.WriteString("enhancedSchemeData.employeeName", additionalDataTemporaryServices.EnhancedSchemeDataEmployeeName); - - if (additionalDataTemporaryServices.EnhancedSchemeDataJobDescriptionOption.IsSet) - writer.WriteString("enhancedSchemeData.jobDescription", additionalDataTemporaryServices.EnhancedSchemeDataJobDescription); - - if (additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursRateOption.IsSet) - writer.WriteString("enhancedSchemeData.regularHoursRate", additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursRate); - - if (additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursWorkedOption.IsSet) - writer.WriteString("enhancedSchemeData.regularHoursWorked", additionalDataTemporaryServices.EnhancedSchemeDataRegularHoursWorked); - - if (additionalDataTemporaryServices.EnhancedSchemeDataRequestNameOption.IsSet) - writer.WriteString("enhancedSchemeData.requestName", additionalDataTemporaryServices.EnhancedSchemeDataRequestName); - - if (additionalDataTemporaryServices.EnhancedSchemeDataTempStartDateOption.IsSet) - writer.WriteString("enhancedSchemeData.tempStartDate", additionalDataTemporaryServices.EnhancedSchemeDataTempStartDate); - - if (additionalDataTemporaryServices.EnhancedSchemeDataTempWeekEndingOption.IsSet) - writer.WriteString("enhancedSchemeData.tempWeekEnding", additionalDataTemporaryServices.EnhancedSchemeDataTempWeekEnding); - - if (additionalDataTemporaryServices.EnhancedSchemeDataTotalTaxAmountOption.IsSet) - writer.WriteString("enhancedSchemeData.totalTaxAmount", additionalDataTemporaryServices.EnhancedSchemeDataTotalTaxAmount); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AdditionalDataWallets.cs b/Adyen/Model/Checkout/AdditionalDataWallets.cs index 51743e572..023dd11ca 100644 --- a/Adyen/Model/Checkout/AdditionalDataWallets.cs +++ b/Adyen/Model/Checkout/AdditionalDataWallets.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,126 +15,83 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AdditionalDataWallets /// - public partial class AdditionalDataWallets : IValidatableObject + [DataContract(Name = "AdditionalDataWallets")] + public partial class AdditionalDataWallets : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The Android Pay token retrieved from the SDK. - /// The Mastercard Masterpass Transaction ID retrieved from the SDK. - /// The Apple Pay token retrieved from the SDK. - /// The Google Pay token retrieved from the SDK. - /// The Samsung Pay token retrieved from the SDK. - /// The Visa Checkout Call ID retrieved from the SDK. - [JsonConstructor] - public AdditionalDataWallets(Option androidpayToken = default, Option masterpassTransactionId = default, Option paymentToken = default, Option paywithgoogleToken = default, Option samsungpayToken = default, Option visacheckoutCallId = default) + /// The Android Pay token retrieved from the SDK.. + /// The Mastercard Masterpass Transaction ID retrieved from the SDK.. + /// The Apple Pay token retrieved from the SDK.. + /// The Google Pay token retrieved from the SDK.. + /// The Samsung Pay token retrieved from the SDK.. + /// The Visa Checkout Call ID retrieved from the SDK.. + public AdditionalDataWallets(string androidpayToken = default(string), string masterpassTransactionId = default(string), string paymentToken = default(string), string paywithgoogleToken = default(string), string samsungpayToken = default(string), string visacheckoutCallId = default(string)) { - AndroidpayTokenOption = androidpayToken; - MasterpassTransactionIdOption = masterpassTransactionId; - PaymentTokenOption = paymentToken; - PaywithgoogleTokenOption = paywithgoogleToken; - SamsungpayTokenOption = samsungpayToken; - VisacheckoutCallIdOption = visacheckoutCallId; - OnCreated(); + this.AndroidpayToken = androidpayToken; + this.MasterpassTransactionId = masterpassTransactionId; + this.PaymentToken = paymentToken; + this.PaywithgoogleToken = paywithgoogleToken; + this.SamsungpayToken = samsungpayToken; + this.VisacheckoutCallId = visacheckoutCallId; } - partial void OnCreated(); - - /// - /// Used to track the state of AndroidpayToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AndroidpayTokenOption { get; private set; } - /// /// The Android Pay token retrieved from the SDK. /// /// The Android Pay token retrieved from the SDK. - [JsonPropertyName("androidpay.token")] - public string AndroidpayToken { get { return this.AndroidpayTokenOption; } set { this.AndroidpayTokenOption = new Option(value); } } - - /// - /// Used to track the state of MasterpassTransactionId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MasterpassTransactionIdOption { get; private set; } + [DataMember(Name = "androidpay.token", EmitDefaultValue = false)] + public string AndroidpayToken { get; set; } /// /// The Mastercard Masterpass Transaction ID retrieved from the SDK. /// /// The Mastercard Masterpass Transaction ID retrieved from the SDK. - [JsonPropertyName("masterpass.transactionId")] - public string MasterpassTransactionId { get { return this.MasterpassTransactionIdOption; } set { this.MasterpassTransactionIdOption = new Option(value); } } - - /// - /// Used to track the state of PaymentToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentTokenOption { get; private set; } + [DataMember(Name = "masterpass.transactionId", EmitDefaultValue = false)] + public string MasterpassTransactionId { get; set; } /// /// The Apple Pay token retrieved from the SDK. /// /// The Apple Pay token retrieved from the SDK. - [JsonPropertyName("payment.token")] - public string PaymentToken { get { return this.PaymentTokenOption; } set { this.PaymentTokenOption = new Option(value); } } - - /// - /// Used to track the state of PaywithgoogleToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaywithgoogleTokenOption { get; private set; } + [DataMember(Name = "payment.token", EmitDefaultValue = false)] + public string PaymentToken { get; set; } /// /// The Google Pay token retrieved from the SDK. /// /// The Google Pay token retrieved from the SDK. - [JsonPropertyName("paywithgoogle.token")] - public string PaywithgoogleToken { get { return this.PaywithgoogleTokenOption; } set { this.PaywithgoogleTokenOption = new Option(value); } } - - /// - /// Used to track the state of SamsungpayToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SamsungpayTokenOption { get; private set; } + [DataMember(Name = "paywithgoogle.token", EmitDefaultValue = false)] + public string PaywithgoogleToken { get; set; } /// /// The Samsung Pay token retrieved from the SDK. /// /// The Samsung Pay token retrieved from the SDK. - [JsonPropertyName("samsungpay.token")] - public string SamsungpayToken { get { return this.SamsungpayTokenOption; } set { this.SamsungpayTokenOption = new Option(value); } } - - /// - /// Used to track the state of VisacheckoutCallId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option VisacheckoutCallIdOption { get; private set; } + [DataMember(Name = "samsungpay.token", EmitDefaultValue = false)] + public string SamsungpayToken { get; set; } /// /// The Visa Checkout Call ID retrieved from the SDK. /// /// The Visa Checkout Call ID retrieved from the SDK. - [JsonPropertyName("visacheckout.callId")] - public string VisacheckoutCallId { get { return this.VisacheckoutCallIdOption; } set { this.VisacheckoutCallIdOption = new Option(value); } } + [DataMember(Name = "visacheckout.callId", EmitDefaultValue = false)] + public string VisacheckoutCallId { get; set; } /// /// Returns the string presentation of the object @@ -154,164 +112,113 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AdditionalDataWalletsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AdditionalDataWallets Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option androidpayToken = default; - Option masterpassTransactionId = default; - Option paymentToken = default; - Option paywithgoogleToken = default; - Option samsungpayToken = default; - Option visacheckoutCallId = default; + return this.Equals(input as AdditionalDataWallets); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AdditionalDataWallets instances are equal + /// + /// Instance of AdditionalDataWallets to be compared + /// Boolean + public bool Equals(AdditionalDataWallets input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "androidpay.token": - androidpayToken = new Option(utf8JsonReader.GetString()); - break; - case "masterpass.transactionId": - masterpassTransactionId = new Option(utf8JsonReader.GetString()); - break; - case "payment.token": - paymentToken = new Option(utf8JsonReader.GetString()); - break; - case "paywithgoogle.token": - paywithgoogleToken = new Option(utf8JsonReader.GetString()); - break; - case "samsungpay.token": - samsungpayToken = new Option(utf8JsonReader.GetString()); - break; - case "visacheckout.callId": - visacheckoutCallId = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (androidpayToken.IsSet && androidpayToken.Value == null) - throw new ArgumentNullException(nameof(androidpayToken), "Property is not nullable for class AdditionalDataWallets."); - - if (masterpassTransactionId.IsSet && masterpassTransactionId.Value == null) - throw new ArgumentNullException(nameof(masterpassTransactionId), "Property is not nullable for class AdditionalDataWallets."); - - if (paymentToken.IsSet && paymentToken.Value == null) - throw new ArgumentNullException(nameof(paymentToken), "Property is not nullable for class AdditionalDataWallets."); - - if (paywithgoogleToken.IsSet && paywithgoogleToken.Value == null) - throw new ArgumentNullException(nameof(paywithgoogleToken), "Property is not nullable for class AdditionalDataWallets."); - - if (samsungpayToken.IsSet && samsungpayToken.Value == null) - throw new ArgumentNullException(nameof(samsungpayToken), "Property is not nullable for class AdditionalDataWallets."); - - if (visacheckoutCallId.IsSet && visacheckoutCallId.Value == null) - throw new ArgumentNullException(nameof(visacheckoutCallId), "Property is not nullable for class AdditionalDataWallets."); - - return new AdditionalDataWallets(androidpayToken, masterpassTransactionId, paymentToken, paywithgoogleToken, samsungpayToken, visacheckoutCallId); + return + ( + this.AndroidpayToken == input.AndroidpayToken || + (this.AndroidpayToken != null && + this.AndroidpayToken.Equals(input.AndroidpayToken)) + ) && + ( + this.MasterpassTransactionId == input.MasterpassTransactionId || + (this.MasterpassTransactionId != null && + this.MasterpassTransactionId.Equals(input.MasterpassTransactionId)) + ) && + ( + this.PaymentToken == input.PaymentToken || + (this.PaymentToken != null && + this.PaymentToken.Equals(input.PaymentToken)) + ) && + ( + this.PaywithgoogleToken == input.PaywithgoogleToken || + (this.PaywithgoogleToken != null && + this.PaywithgoogleToken.Equals(input.PaywithgoogleToken)) + ) && + ( + this.SamsungpayToken == input.SamsungpayToken || + (this.SamsungpayToken != null && + this.SamsungpayToken.Equals(input.SamsungpayToken)) + ) && + ( + this.VisacheckoutCallId == input.VisacheckoutCallId || + (this.VisacheckoutCallId != null && + this.VisacheckoutCallId.Equals(input.VisacheckoutCallId)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AdditionalDataWallets additionalDataWallets, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, additionalDataWallets, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AndroidpayToken != null) + { + hashCode = (hashCode * 59) + this.AndroidpayToken.GetHashCode(); + } + if (this.MasterpassTransactionId != null) + { + hashCode = (hashCode * 59) + this.MasterpassTransactionId.GetHashCode(); + } + if (this.PaymentToken != null) + { + hashCode = (hashCode * 59) + this.PaymentToken.GetHashCode(); + } + if (this.PaywithgoogleToken != null) + { + hashCode = (hashCode * 59) + this.PaywithgoogleToken.GetHashCode(); + } + if (this.SamsungpayToken != null) + { + hashCode = (hashCode * 59) + this.SamsungpayToken.GetHashCode(); + } + if (this.VisacheckoutCallId != null) + { + hashCode = (hashCode * 59) + this.VisacheckoutCallId.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AdditionalDataWallets additionalDataWallets, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (additionalDataWallets.AndroidpayTokenOption.IsSet && additionalDataWallets.AndroidpayToken == null) - throw new ArgumentNullException(nameof(additionalDataWallets.AndroidpayToken), "Property is required for class AdditionalDataWallets."); - - if (additionalDataWallets.MasterpassTransactionIdOption.IsSet && additionalDataWallets.MasterpassTransactionId == null) - throw new ArgumentNullException(nameof(additionalDataWallets.MasterpassTransactionId), "Property is required for class AdditionalDataWallets."); - - if (additionalDataWallets.PaymentTokenOption.IsSet && additionalDataWallets.PaymentToken == null) - throw new ArgumentNullException(nameof(additionalDataWallets.PaymentToken), "Property is required for class AdditionalDataWallets."); - - if (additionalDataWallets.PaywithgoogleTokenOption.IsSet && additionalDataWallets.PaywithgoogleToken == null) - throw new ArgumentNullException(nameof(additionalDataWallets.PaywithgoogleToken), "Property is required for class AdditionalDataWallets."); - - if (additionalDataWallets.SamsungpayTokenOption.IsSet && additionalDataWallets.SamsungpayToken == null) - throw new ArgumentNullException(nameof(additionalDataWallets.SamsungpayToken), "Property is required for class AdditionalDataWallets."); - - if (additionalDataWallets.VisacheckoutCallIdOption.IsSet && additionalDataWallets.VisacheckoutCallId == null) - throw new ArgumentNullException(nameof(additionalDataWallets.VisacheckoutCallId), "Property is required for class AdditionalDataWallets."); - - if (additionalDataWallets.AndroidpayTokenOption.IsSet) - writer.WriteString("androidpay.token", additionalDataWallets.AndroidpayToken); - - if (additionalDataWallets.MasterpassTransactionIdOption.IsSet) - writer.WriteString("masterpass.transactionId", additionalDataWallets.MasterpassTransactionId); - - if (additionalDataWallets.PaymentTokenOption.IsSet) - writer.WriteString("payment.token", additionalDataWallets.PaymentToken); - - if (additionalDataWallets.PaywithgoogleTokenOption.IsSet) - writer.WriteString("paywithgoogle.token", additionalDataWallets.PaywithgoogleToken); - - if (additionalDataWallets.SamsungpayTokenOption.IsSet) - writer.WriteString("samsungpay.token", additionalDataWallets.SamsungpayToken); - - if (additionalDataWallets.VisacheckoutCallIdOption.IsSet) - writer.WriteString("visacheckout.callId", additionalDataWallets.VisacheckoutCallId); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Address.cs b/Adyen/Model/Checkout/Address.cs index d8df84966..089bbaee7 100644 --- a/Adyen/Model/Checkout/Address.cs +++ b/Adyen/Model/Checkout/Address.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,91 +15,88 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Address /// - public partial class Address : IValidatableObject + [DataContract(Name = "Address")] + public partial class Address : IEquatable
, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The name of the city. Maximum length: 3000 characters. - /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. - /// The number or name of the house. Maximum length: 3000 characters. - /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. - [JsonConstructor] - public Address(string city, string country, string houseNumberOrName, string postalCode, string street, Option stateOrProvince = default) + [JsonConstructorAttribute] + protected Address() { } + /// + /// Initializes a new instance of the class. + /// + /// The name of the city. Maximum length: 3000 characters. (required). + /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. (required). + /// The number or name of the house. Maximum length: 3000 characters. (required). + /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. (required). + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada.. + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. (required). + public Address(string city = default(string), string country = default(string), string houseNumberOrName = default(string), string postalCode = default(string), string stateOrProvince = default(string), string street = default(string)) { - City = city; - Country = country; - HouseNumberOrName = houseNumberOrName; - PostalCode = postalCode; - Street = street; - StateOrProvinceOption = stateOrProvince; - OnCreated(); + this.City = city; + this.Country = country; + this.HouseNumberOrName = houseNumberOrName; + this.PostalCode = postalCode; + this.Street = street; + this.StateOrProvince = stateOrProvince; } - partial void OnCreated(); - /// /// The name of the city. Maximum length: 3000 characters. /// /// The name of the city. Maximum length: 3000 characters. - [JsonPropertyName("city")] + [DataMember(Name = "city", IsRequired = false, EmitDefaultValue = false)] public string City { get; set; } /// /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. /// /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. - [JsonPropertyName("country")] + [DataMember(Name = "country", IsRequired = false, EmitDefaultValue = false)] public string Country { get; set; } /// /// The number or name of the house. Maximum length: 3000 characters. /// /// The number or name of the house. Maximum length: 3000 characters. - [JsonPropertyName("houseNumberOrName")] + [DataMember(Name = "houseNumberOrName", IsRequired = false, EmitDefaultValue = false)] public string HouseNumberOrName { get; set; } /// /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. /// /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. - [JsonPropertyName("postalCode")] + [DataMember(Name = "postalCode", IsRequired = false, EmitDefaultValue = false)] public string PostalCode { get; set; } /// - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. - /// - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. - [JsonPropertyName("street")] - public string Street { get; set; } - - /// - /// Used to track the state of StateOrProvince + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StateOrProvinceOption { get; private set; } + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + [DataMember(Name = "stateOrProvince", EmitDefaultValue = false)] + public string StateOrProvince { get; set; } /// - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. /// - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. - [JsonPropertyName("stateOrProvince")] - public string StateOrProvince { get { return this.StateOrProvinceOption; } set { this.StateOrProvinceOption = new Option(value); } } + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + [DataMember(Name = "street", IsRequired = false, EmitDefaultValue = false)] + public string Street { get; set; } /// /// Returns the string presentation of the object @@ -112,199 +110,138 @@ public override string ToString() sb.Append(" Country: ").Append(Country).Append("\n"); sb.Append(" HouseNumberOrName: ").Append(HouseNumberOrName).Append("\n"); sb.Append(" PostalCode: ").Append(PostalCode).Append("\n"); - sb.Append(" Street: ").Append(Street).Append("\n"); sb.Append(" StateOrProvince: ").Append(StateOrProvince).Append("\n"); + sb.Append(" Street: ").Append(Street).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // City (string) maxLength - if (this.City != null && this.City.Length > 3000) - { - yield return new ValidationResult("Invalid value for City, length must be less than 3000.", new [] { "City" }); - } - - // HouseNumberOrName (string) maxLength - if (this.HouseNumberOrName != null && this.HouseNumberOrName.Length > 3000) - { - yield return new ValidationResult("Invalid value for HouseNumberOrName, length must be less than 3000.", new [] { "HouseNumberOrName" }); - } - - // Street (string) maxLength - if (this.Street != null && this.Street.Length > 3000) - { - yield return new ValidationResult("Invalid value for Street, length must be less than 3000.", new [] { "Street" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AddressJsonConverter : JsonConverter
- { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Address Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option city = default; - Option country = default; - Option houseNumberOrName = default; - Option postalCode = default; - Option street = default; - Option stateOrProvince = default; + return this.Equals(input as Address); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if Address instances are equal + /// + /// Instance of Address to be compared + /// Boolean + public bool Equals(Address input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "city": - city = new Option(utf8JsonReader.GetString()); - break; - case "country": - country = new Option(utf8JsonReader.GetString()); - break; - case "houseNumberOrName": - houseNumberOrName = new Option(utf8JsonReader.GetString()); - break; - case "postalCode": - postalCode = new Option(utf8JsonReader.GetString()); - break; - case "street": - street = new Option(utf8JsonReader.GetString()); - break; - case "stateOrProvince": - stateOrProvince = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!city.IsSet) - throw new ArgumentException("Property is required for class Address.", nameof(city)); - - if (!country.IsSet) - throw new ArgumentException("Property is required for class Address.", nameof(country)); - - if (!houseNumberOrName.IsSet) - throw new ArgumentException("Property is required for class Address.", nameof(houseNumberOrName)); - - if (!postalCode.IsSet) - throw new ArgumentException("Property is required for class Address.", nameof(postalCode)); - - if (!street.IsSet) - throw new ArgumentException("Property is required for class Address.", nameof(street)); - - if (city.IsSet && city.Value == null) - throw new ArgumentNullException(nameof(city), "Property is not nullable for class Address."); - - if (country.IsSet && country.Value == null) - throw new ArgumentNullException(nameof(country), "Property is not nullable for class Address."); - - if (houseNumberOrName.IsSet && houseNumberOrName.Value == null) - throw new ArgumentNullException(nameof(houseNumberOrName), "Property is not nullable for class Address."); - - if (postalCode.IsSet && postalCode.Value == null) - throw new ArgumentNullException(nameof(postalCode), "Property is not nullable for class Address."); - - if (street.IsSet && street.Value == null) - throw new ArgumentNullException(nameof(street), "Property is not nullable for class Address."); - - if (stateOrProvince.IsSet && stateOrProvince.Value == null) - throw new ArgumentNullException(nameof(stateOrProvince), "Property is not nullable for class Address."); - - return new Address(city.Value, country.Value, houseNumberOrName.Value, postalCode.Value, street.Value, stateOrProvince); + return + ( + this.City == input.City || + (this.City != null && + this.City.Equals(input.City)) + ) && + ( + this.Country == input.Country || + (this.Country != null && + this.Country.Equals(input.Country)) + ) && + ( + this.HouseNumberOrName == input.HouseNumberOrName || + (this.HouseNumberOrName != null && + this.HouseNumberOrName.Equals(input.HouseNumberOrName)) + ) && + ( + this.PostalCode == input.PostalCode || + (this.PostalCode != null && + this.PostalCode.Equals(input.PostalCode)) + ) && + ( + this.StateOrProvince == input.StateOrProvince || + (this.StateOrProvince != null && + this.StateOrProvince.Equals(input.StateOrProvince)) + ) && + ( + this.Street == input.Street || + (this.Street != null && + this.Street.Equals(input.Street)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Address address, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, address, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.City != null) + { + hashCode = (hashCode * 59) + this.City.GetHashCode(); + } + if (this.Country != null) + { + hashCode = (hashCode * 59) + this.Country.GetHashCode(); + } + if (this.HouseNumberOrName != null) + { + hashCode = (hashCode * 59) + this.HouseNumberOrName.GetHashCode(); + } + if (this.PostalCode != null) + { + hashCode = (hashCode * 59) + this.PostalCode.GetHashCode(); + } + if (this.StateOrProvince != null) + { + hashCode = (hashCode * 59) + this.StateOrProvince.GetHashCode(); + } + if (this.Street != null) + { + hashCode = (hashCode * 59) + this.Street.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Address address, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (address.City == null) - throw new ArgumentNullException(nameof(address.City), "Property is required for class Address."); - - if (address.Country == null) - throw new ArgumentNullException(nameof(address.Country), "Property is required for class Address."); - - if (address.HouseNumberOrName == null) - throw new ArgumentNullException(nameof(address.HouseNumberOrName), "Property is required for class Address."); - - if (address.PostalCode == null) - throw new ArgumentNullException(nameof(address.PostalCode), "Property is required for class Address."); - - if (address.Street == null) - throw new ArgumentNullException(nameof(address.Street), "Property is required for class Address."); - - if (address.StateOrProvinceOption.IsSet && address.StateOrProvince == null) - throw new ArgumentNullException(nameof(address.StateOrProvince), "Property is required for class Address."); - - writer.WriteString("city", address.City); - - writer.WriteString("country", address.Country); - - writer.WriteString("houseNumberOrName", address.HouseNumberOrName); + // City (string) maxLength + if (this.City != null && this.City.Length > 3000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for City, length must be less than 3000.", new [] { "City" }); + } - writer.WriteString("postalCode", address.PostalCode); + // HouseNumberOrName (string) maxLength + if (this.HouseNumberOrName != null && this.HouseNumberOrName.Length > 3000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for HouseNumberOrName, length must be less than 3000.", new [] { "HouseNumberOrName" }); + } - writer.WriteString("street", address.Street); + // Street (string) maxLength + if (this.Street != null && this.Street.Length > 3000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Street, length must be less than 3000.", new [] { "Street" }); + } - if (address.StateOrProvinceOption.IsSet) - writer.WriteString("stateOrProvince", address.StateOrProvince); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AffirmDetails.cs b/Adyen/Model/Checkout/AffirmDetails.cs index 2037a6693..d3ff4747b 100644 --- a/Adyen/Model/Checkout/AffirmDetails.cs +++ b/Adyen/Model/Checkout/AffirmDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,115 +15,62 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AffirmDetails /// - public partial class AffirmDetails : IValidatableObject + [DataContract(Name = "AffirmDetails")] + public partial class AffirmDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// **affirm** (default to TypeEnum.Affirm) - [JsonConstructor] - public AffirmDetails(Option checkoutAttemptId = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **affirm** /// /// **affirm** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Affirm for value: affirm /// + [EnumMember(Value = "affirm")] Affirm = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("affirm")) - return TypeEnum.Affirm; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("affirm")) - return TypeEnum.Affirm; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Affirm) - return "affirm"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **affirm** /// /// **affirm** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// **affirm** (default to TypeEnum.Affirm). + public AffirmDetails(string checkoutAttemptId = default(string), TypeEnum? type = TypeEnum.Affirm) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Returns the string presentation of the object @@ -139,111 +87,73 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AffirmDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AffirmDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option type = default; + return this.Equals(input as AffirmDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AffirmDetails instances are equal + /// + /// Instance of AffirmDetails to be compared + /// Boolean + public bool Equals(AffirmDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(AffirmDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class AffirmDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class AffirmDetails."); - - return new AffirmDetails(checkoutAttemptId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AffirmDetails affirmDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, affirmDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AffirmDetails affirmDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (affirmDetails.CheckoutAttemptIdOption.IsSet && affirmDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(affirmDetails.CheckoutAttemptId), "Property is required for class AffirmDetails."); - - if (affirmDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", affirmDetails.CheckoutAttemptId); - - var typeRawValue = AffirmDetails.TypeEnumToJsonValue(affirmDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AfterpayDetails.cs b/Adyen/Model/Checkout/AfterpayDetails.cs index aa78d59dc..ba49680ac 100644 --- a/Adyen/Model/Checkout/AfterpayDetails.cs +++ b/Adyen/Model/Checkout/AfterpayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,231 +15,131 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AfterpayDetails /// - public partial class AfterpayDetails : IValidatableObject + [DataContract(Name = "AfterpayDetails")] + public partial class AfterpayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The address where to send the invoice. - /// The checkout attempt identifier. - /// The address where the goods should be delivered. - /// Shopper name, date of birth, phone number, and email address. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **afterpay_default** (default to TypeEnum.AfterpayDefault) - [JsonConstructor] - public AfterpayDetails(Option billingAddress = default, Option checkoutAttemptId = default, Option deliveryAddress = default, Option personalDetails = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.AfterpayDefault) - { - BillingAddressOption = billingAddress; - CheckoutAttemptIdOption = checkoutAttemptId; - DeliveryAddressOption = deliveryAddress; - PersonalDetailsOption = personalDetails; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - Type = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **afterpay_default** /// /// **afterpay_default** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum AfterpayDefault for value: afterpay_default /// + [EnumMember(Value = "afterpay_default")] AfterpayDefault = 1, /// /// Enum Afterpaytouch for value: afterpaytouch /// + [EnumMember(Value = "afterpaytouch")] Afterpaytouch = 2, /// /// Enum AfterpayB2b for value: afterpay_b2b /// + [EnumMember(Value = "afterpay_b2b")] AfterpayB2b = 3, /// /// Enum Clearpay for value: clearpay /// + [EnumMember(Value = "clearpay")] Clearpay = 4 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("afterpay_default")) - return TypeEnum.AfterpayDefault; - - if (value.Equals("afterpaytouch")) - return TypeEnum.Afterpaytouch; - - if (value.Equals("afterpay_b2b")) - return TypeEnum.AfterpayB2b; - - if (value.Equals("clearpay")) - return TypeEnum.Clearpay; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("afterpay_default")) - return TypeEnum.AfterpayDefault; - - if (value.Equals("afterpaytouch")) - return TypeEnum.Afterpaytouch; - - if (value.Equals("afterpay_b2b")) - return TypeEnum.AfterpayB2b; - - if (value.Equals("clearpay")) - return TypeEnum.Clearpay; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.AfterpayDefault) - return "afterpay_default"; - - if (value == TypeEnum.Afterpaytouch) - return "afterpaytouch"; - - if (value == TypeEnum.AfterpayB2b) - return "afterpay_b2b"; - - if (value == TypeEnum.Clearpay) - return "clearpay"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **afterpay_default** /// /// **afterpay_default** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of BillingAddress + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressOption { get; private set; } - + [JsonConstructorAttribute] + protected AfterpayDetails() { } /// - /// The address where to send the invoice. + /// Initializes a new instance of the class. /// - /// The address where to send the invoice. - [JsonPropertyName("billingAddress")] - public string BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } + /// The address where to send the invoice.. + /// The checkout attempt identifier.. + /// The address where the goods should be delivered.. + /// Shopper name, date of birth, phone number, and email address.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **afterpay_default** (required) (default to TypeEnum.AfterpayDefault). + public AfterpayDetails(string billingAddress = default(string), string checkoutAttemptId = default(string), string deliveryAddress = default(string), string personalDetails = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.AfterpayDefault) + { + this.Type = type; + this.BillingAddress = billingAddress; + this.CheckoutAttemptId = checkoutAttemptId; + this.DeliveryAddress = deliveryAddress; + this.PersonalDetails = personalDetails; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + } /// - /// Used to track the state of CheckoutAttemptId + /// The address where to send the invoice. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The address where to send the invoice. + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public string BillingAddress { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryAddressOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The address where the goods should be delivered. /// /// The address where the goods should be delivered. - [JsonPropertyName("deliveryAddress")] - public string DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } - - /// - /// Used to track the state of PersonalDetails - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PersonalDetailsOption { get; private set; } + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public string DeliveryAddress { get; set; } /// /// Shopper name, date of birth, phone number, and email address. /// /// Shopper name, date of birth, phone number, and email address. - [JsonPropertyName("personalDetails")] - public string PersonalDetails { get { return this.PersonalDetailsOption; } set { this.PersonalDetailsOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "personalDetails", EmitDefaultValue = false)] + public string PersonalDetails { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -260,185 +161,124 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AfterpayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AfterpayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option billingAddress = default; - Option checkoutAttemptId = default; - Option deliveryAddress = default; - Option personalDetails = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as AfterpayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AfterpayDetails instances are equal + /// + /// Instance of AfterpayDetails to be compared + /// Boolean + public bool Equals(AfterpayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "billingAddress": - billingAddress = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "deliveryAddress": - deliveryAddress = new Option(utf8JsonReader.GetString()); - break; - case "personalDetails": - personalDetails = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(AfterpayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class AfterpayDetails.", nameof(type)); - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class AfterpayDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class AfterpayDetails."); - - if (deliveryAddress.IsSet && deliveryAddress.Value == null) - throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class AfterpayDetails."); - - if (personalDetails.IsSet && personalDetails.Value == null) - throw new ArgumentNullException(nameof(personalDetails), "Property is not nullable for class AfterpayDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class AfterpayDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class AfterpayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class AfterpayDetails."); - - return new AfterpayDetails(billingAddress, checkoutAttemptId, deliveryAddress, personalDetails, recurringDetailReference, storedPaymentMethodId, type.Value.Value); + return + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + (this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress)) + ) && + ( + this.PersonalDetails == input.PersonalDetails || + (this.PersonalDetails != null && + this.PersonalDetails.Equals(input.PersonalDetails)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AfterpayDetails afterpayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, afterpayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.DeliveryAddress != null) + { + hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); + } + if (this.PersonalDetails != null) + { + hashCode = (hashCode * 59) + this.PersonalDetails.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AfterpayDetails afterpayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (afterpayDetails.BillingAddressOption.IsSet && afterpayDetails.BillingAddress == null) - throw new ArgumentNullException(nameof(afterpayDetails.BillingAddress), "Property is required for class AfterpayDetails."); - - if (afterpayDetails.CheckoutAttemptIdOption.IsSet && afterpayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(afterpayDetails.CheckoutAttemptId), "Property is required for class AfterpayDetails."); - - if (afterpayDetails.DeliveryAddressOption.IsSet && afterpayDetails.DeliveryAddress == null) - throw new ArgumentNullException(nameof(afterpayDetails.DeliveryAddress), "Property is required for class AfterpayDetails."); - - if (afterpayDetails.PersonalDetailsOption.IsSet && afterpayDetails.PersonalDetails == null) - throw new ArgumentNullException(nameof(afterpayDetails.PersonalDetails), "Property is required for class AfterpayDetails."); - - if (afterpayDetails.RecurringDetailReferenceOption.IsSet && afterpayDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(afterpayDetails.RecurringDetailReference), "Property is required for class AfterpayDetails."); - - if (afterpayDetails.StoredPaymentMethodIdOption.IsSet && afterpayDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(afterpayDetails.StoredPaymentMethodId), "Property is required for class AfterpayDetails."); - - if (afterpayDetails.BillingAddressOption.IsSet) - writer.WriteString("billingAddress", afterpayDetails.BillingAddress); - - if (afterpayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", afterpayDetails.CheckoutAttemptId); - - if (afterpayDetails.DeliveryAddressOption.IsSet) - writer.WriteString("deliveryAddress", afterpayDetails.DeliveryAddress); - - if (afterpayDetails.PersonalDetailsOption.IsSet) - writer.WriteString("personalDetails", afterpayDetails.PersonalDetails); - - if (afterpayDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", afterpayDetails.RecurringDetailReference); - - if (afterpayDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", afterpayDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = AfterpayDetails.TypeEnumToJsonValue(afterpayDetails.Type); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Agency.cs b/Adyen/Model/Checkout/Agency.cs index d49b4a3ab..f77419dd5 100644 --- a/Adyen/Model/Checkout/Agency.cs +++ b/Adyen/Model/Checkout/Agency.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,62 +15,47 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Agency /// - public partial class Agency : IValidatableObject + [DataContract(Name = "Agency")] + public partial class Agency : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters - /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters - [JsonConstructor] - public Agency(Option invoiceNumber = default, Option planName = default) + /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters. + /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters. + public Agency(string invoiceNumber = default(string), string planName = default(string)) { - InvoiceNumberOption = invoiceNumber; - PlanNameOption = planName; - OnCreated(); + this.InvoiceNumber = invoiceNumber; + this.PlanName = planName; } - partial void OnCreated(); - - /// - /// Used to track the state of InvoiceNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InvoiceNumberOption { get; private set; } - /// /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters /// /// The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters - [JsonPropertyName("invoiceNumber")] - public string InvoiceNumber { get { return this.InvoiceNumberOption; } set { this.InvoiceNumberOption = new Option(value); } } - - /// - /// Used to track the state of PlanName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PlanNameOption { get; private set; } + [DataMember(Name = "invoiceNumber", EmitDefaultValue = false)] + public string InvoiceNumber { get; set; } /// /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters /// /// The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters - [JsonPropertyName("planName")] - public string PlanName { get { return this.PlanNameOption; } set { this.PlanNameOption = new Option(value); } } + [DataMember(Name = "planName", EmitDefaultValue = false)] + public string PlanName { get; set; } /// /// Returns the string presentation of the object @@ -86,112 +72,77 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AgencyJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Agency Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option invoiceNumber = default; - Option planName = default; + return this.Equals(input as Agency); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if Agency instances are equal + /// + /// Instance of Agency to be compared + /// Boolean + public bool Equals(Agency input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "invoiceNumber": - invoiceNumber = new Option(utf8JsonReader.GetString()); - break; - case "planName": - planName = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (invoiceNumber.IsSet && invoiceNumber.Value == null) - throw new ArgumentNullException(nameof(invoiceNumber), "Property is not nullable for class Agency."); - - if (planName.IsSet && planName.Value == null) - throw new ArgumentNullException(nameof(planName), "Property is not nullable for class Agency."); - - return new Agency(invoiceNumber, planName); + return + ( + this.InvoiceNumber == input.InvoiceNumber || + (this.InvoiceNumber != null && + this.InvoiceNumber.Equals(input.InvoiceNumber)) + ) && + ( + this.PlanName == input.PlanName || + (this.PlanName != null && + this.PlanName.Equals(input.PlanName)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Agency agency, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, agency, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.InvoiceNumber != null) + { + hashCode = (hashCode * 59) + this.InvoiceNumber.GetHashCode(); + } + if (this.PlanName != null) + { + hashCode = (hashCode * 59) + this.PlanName.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Agency agency, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (agency.InvoiceNumberOption.IsSet && agency.InvoiceNumber == null) - throw new ArgumentNullException(nameof(agency.InvoiceNumber), "Property is required for class Agency."); - - if (agency.PlanNameOption.IsSet && agency.PlanName == null) - throw new ArgumentNullException(nameof(agency.PlanName), "Property is required for class Agency."); - - if (agency.InvoiceNumberOption.IsSet) - writer.WriteString("invoiceNumber", agency.InvoiceNumber); - - if (agency.PlanNameOption.IsSet) - writer.WriteString("planName", agency.PlanName); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Airline.cs b/Adyen/Model/Checkout/Airline.cs index 239cd551e..224947ca9 100644 --- a/Adyen/Model/Checkout/Airline.cs +++ b/Adyen/Model/Checkout/Airline.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,226 +15,146 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Airline /// - public partial class Airline : IValidatableObject + [DataContract(Name = "Airline")] + public partial class Airline : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not start with a space or be all spaces. * Must not be all zeros. - /// agency - /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 11 characters - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. - /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters - /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not start with a space or be all spaces. - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. - /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters - /// The flight departure date. Time is optional. * Format for date only: `yyyy-MM-dd` * Format for date and time: `yyyy-MM-ddTHH:mm` * Use local time of departure airport. * minLength: 10 characters * maxLength: 16 characters - /// legs - /// passengers - /// ticket - /// travelAgency - [JsonConstructor] - public Airline(string passengerName, Option agency = default, Option boardingFee = default, Option code = default, Option computerizedReservationSystem = default, Option customerReferenceNumber = default, Option designatorCode = default, Option documentType = default, Option flightDate = default, Option> legs = default, Option> passengers = default, Option ticket = default, Option travelAgency = default) - { - PassengerName = passengerName; - AgencyOption = agency; - BoardingFeeOption = boardingFee; - CodeOption = code; - ComputerizedReservationSystemOption = computerizedReservationSystem; - CustomerReferenceNumberOption = customerReferenceNumber; - DesignatorCodeOption = designatorCode; - DocumentTypeOption = documentType; - FlightDateOption = flightDate; - LegsOption = legs; - PassengersOption = passengers; - TicketOption = ticket; - TravelAgencyOption = travelAgency; - OnCreated(); - } - - partial void OnCreated(); - - /// - /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not start with a space or be all spaces. * Must not be all zeros. - /// - /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("passengerName")] - public string PassengerName { get; set; } - + [JsonConstructorAttribute] + protected Airline() { } /// - /// Used to track the state of Agency + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AgencyOption { get; private set; } + /// agency. + /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 11 characters. + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters. + /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not start with a space or be all spaces.. + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces.. + /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters. + /// The flight departure date. Time is optional. * Format for date only: `yyyy-MM-dd` * Format for date and time: `yyyy-MM-ddTHH:mm` * Use local time of departure airport. * minLength: 10 characters * maxLength: 16 characters. + /// legs. + /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not start with a space or be all spaces. * Must not be all zeros. (required). + /// passengers. + /// ticket. + /// travelAgency. + public Airline(Agency agency = default(Agency), long? boardingFee = default(long?), string code = default(string), string computerizedReservationSystem = default(string), string customerReferenceNumber = default(string), string designatorCode = default(string), string documentType = default(string), DateTime flightDate = default(DateTime), List legs = default(List), string passengerName = default(string), List passengers = default(List), Ticket ticket = default(Ticket), TravelAgency travelAgency = default(TravelAgency)) + { + this.PassengerName = passengerName; + this.Agency = agency; + this.BoardingFee = boardingFee; + this.Code = code; + this.ComputerizedReservationSystem = computerizedReservationSystem; + this.CustomerReferenceNumber = customerReferenceNumber; + this.DesignatorCode = designatorCode; + this.DocumentType = documentType; + this.FlightDate = flightDate; + this.Legs = legs; + this.Passengers = passengers; + this.Ticket = ticket; + this.TravelAgency = travelAgency; + } /// /// Gets or Sets Agency /// - [JsonPropertyName("agency")] - public Agency Agency { get { return this.AgencyOption; } set { this.AgencyOption = new Option(value); } } - - /// - /// Used to track the state of BoardingFee - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BoardingFeeOption { get; private set; } + [DataMember(Name = "agency", EmitDefaultValue = false)] + public Agency Agency { get; set; } /// /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 11 characters /// /// The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 11 characters - [JsonPropertyName("boardingFee")] - public long? BoardingFee { get { return this.BoardingFeeOption; } set { this.BoardingFeeOption = new Option(value); } } - - /// - /// Used to track the state of Code - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CodeOption { get; private set; } + [DataMember(Name = "boardingFee", EmitDefaultValue = false)] + public long? BoardingFee { get; set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("code")] - public string Code { get { return this.CodeOption; } set { this.CodeOption = new Option(value); } } - - /// - /// Used to track the state of ComputerizedReservationSystem - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ComputerizedReservationSystemOption { get; private set; } + [DataMember(Name = "code", EmitDefaultValue = false)] + public string Code { get; set; } /// /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters /// /// The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters - [JsonPropertyName("computerizedReservationSystem")] - public string ComputerizedReservationSystem { get { return this.ComputerizedReservationSystemOption; } set { this.ComputerizedReservationSystemOption = new Option(value); } } - - /// - /// Used to track the state of CustomerReferenceNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CustomerReferenceNumberOption { get; private set; } + [DataMember(Name = "computerizedReservationSystem", EmitDefaultValue = false)] + public string ComputerizedReservationSystem { get; set; } /// /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not start with a space or be all spaces. /// /// The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not start with a space or be all spaces. - [JsonPropertyName("customerReferenceNumber")] - public string CustomerReferenceNumber { get { return this.CustomerReferenceNumberOption; } set { this.CustomerReferenceNumberOption = new Option(value); } } - - /// - /// Used to track the state of DesignatorCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DesignatorCodeOption { get; private set; } + [DataMember(Name = "customerReferenceNumber", EmitDefaultValue = false)] + public string CustomerReferenceNumber { get; set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. - [JsonPropertyName("designatorCode")] - public string DesignatorCode { get { return this.DesignatorCodeOption; } set { this.DesignatorCodeOption = new Option(value); } } - - /// - /// Used to track the state of DocumentType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DocumentTypeOption { get; private set; } + [DataMember(Name = "designatorCode", EmitDefaultValue = false)] + public string DesignatorCode { get; set; } /// /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters /// /// A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters - [JsonPropertyName("documentType")] - public string DocumentType { get { return this.DocumentTypeOption; } set { this.DocumentTypeOption = new Option(value); } } - - /// - /// Used to track the state of FlightDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FlightDateOption { get; private set; } + [DataMember(Name = "documentType", EmitDefaultValue = false)] + public string DocumentType { get; set; } /// /// The flight departure date. Time is optional. * Format for date only: `yyyy-MM-dd` * Format for date and time: `yyyy-MM-ddTHH:mm` * Use local time of departure airport. * minLength: 10 characters * maxLength: 16 characters /// /// The flight departure date. Time is optional. * Format for date only: `yyyy-MM-dd` * Format for date and time: `yyyy-MM-ddTHH:mm` * Use local time of departure airport. * minLength: 10 characters * maxLength: 16 characters - [JsonPropertyName("flightDate")] - public DateTime? FlightDate { get { return this.FlightDateOption; } set { this.FlightDateOption = new Option(value); } } - - /// - /// Used to track the state of Legs - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LegsOption { get; private set; } + [DataMember(Name = "flightDate", EmitDefaultValue = false)] + public DateTime FlightDate { get; set; } /// /// Gets or Sets Legs /// - [JsonPropertyName("legs")] - public List Legs { get { return this.LegsOption; } set { this.LegsOption = new Option>(value); } } + [DataMember(Name = "legs", EmitDefaultValue = false)] + public List Legs { get; set; } /// - /// Used to track the state of Passengers + /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not start with a space or be all spaces. * Must not be all zeros. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> PassengersOption { get; private set; } + /// The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not start with a space or be all spaces. * Must not be all zeros. + [DataMember(Name = "passengerName", IsRequired = false, EmitDefaultValue = false)] + public string PassengerName { get; set; } /// /// Gets or Sets Passengers /// - [JsonPropertyName("passengers")] - public List Passengers { get { return this.PassengersOption; } set { this.PassengersOption = new Option>(value); } } - - /// - /// Used to track the state of Ticket - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TicketOption { get; private set; } + [DataMember(Name = "passengers", EmitDefaultValue = false)] + public List Passengers { get; set; } /// /// Gets or Sets Ticket /// - [JsonPropertyName("ticket")] - public Ticket Ticket { get { return this.TicketOption; } set { this.TicketOption = new Option(value); } } - - /// - /// Used to track the state of TravelAgency - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TravelAgencyOption { get; private set; } + [DataMember(Name = "ticket", EmitDefaultValue = false)] + public Ticket Ticket { get; set; } /// /// Gets or Sets TravelAgency /// - [JsonPropertyName("travelAgency")] - public TravelAgency TravelAgency { get { return this.TravelAgencyOption; } set { this.TravelAgencyOption = new Option(value); } } + [DataMember(Name = "travelAgency", EmitDefaultValue = false)] + public TravelAgency TravelAgency { get; set; } /// /// Returns the string presentation of the object @@ -243,7 +164,6 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Airline {\n"); - sb.Append(" PassengerName: ").Append(PassengerName).Append("\n"); sb.Append(" Agency: ").Append(Agency).Append("\n"); sb.Append(" BoardingFee: ").Append(BoardingFee).Append("\n"); sb.Append(" Code: ").Append(Code).Append("\n"); @@ -253,6 +173,7 @@ public override string ToString() sb.Append(" DocumentType: ").Append(DocumentType).Append("\n"); sb.Append(" FlightDate: ").Append(FlightDate).Append("\n"); sb.Append(" Legs: ").Append(Legs).Append("\n"); + sb.Append(" PassengerName: ").Append(PassengerName).Append("\n"); sb.Append(" Passengers: ").Append(Passengers).Append("\n"); sb.Append(" Ticket: ").Append(Ticket).Append("\n"); sb.Append(" TravelAgency: ").Append(TravelAgency).Append("\n"); @@ -261,274 +182,174 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AirlineJsonConverter : JsonConverter - { /// - /// The format to use to serialize FlightDate + /// Returns true if objects are equal /// - public static string FlightDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Airline); + } /// - /// Deserializes json to + /// Returns true if Airline instances are equal /// - /// - /// - /// - /// - /// - public override Airline Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Instance of Airline to be compared + /// Boolean + public bool Equals(Airline input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option passengerName = default; - Option agency = default; - Option boardingFee = default; - Option code = default; - Option computerizedReservationSystem = default; - Option customerReferenceNumber = default; - Option designatorCode = default; - Option documentType = default; - Option flightDate = default; - Option> legs = default; - Option> passengers = default; - Option ticket = default; - Option travelAgency = default; - - while (utf8JsonReader.Read()) + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "passengerName": - passengerName = new Option(utf8JsonReader.GetString()); - break; - case "agency": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - agency = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "boardingFee": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - boardingFee = new Option(utf8JsonReader.GetInt64()); - break; - case "code": - code = new Option(utf8JsonReader.GetString()); - break; - case "computerizedReservationSystem": - computerizedReservationSystem = new Option(utf8JsonReader.GetString()); - break; - case "customerReferenceNumber": - customerReferenceNumber = new Option(utf8JsonReader.GetString()); - break; - case "designatorCode": - designatorCode = new Option(utf8JsonReader.GetString()); - break; - case "documentType": - documentType = new Option(utf8JsonReader.GetString()); - break; - case "flightDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - flightDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "legs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - legs = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "passengers": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - passengers = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "ticket": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - ticket = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "travelAgency": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - travelAgency = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } + return false; } - - if (!passengerName.IsSet) - throw new ArgumentException("Property is required for class Airline.", nameof(passengerName)); - - if (passengerName.IsSet && passengerName.Value == null) - throw new ArgumentNullException(nameof(passengerName), "Property is not nullable for class Airline."); - - if (agency.IsSet && agency.Value == null) - throw new ArgumentNullException(nameof(agency), "Property is not nullable for class Airline."); - - if (boardingFee.IsSet && boardingFee.Value == null) - throw new ArgumentNullException(nameof(boardingFee), "Property is not nullable for class Airline."); - - if (code.IsSet && code.Value == null) - throw new ArgumentNullException(nameof(code), "Property is not nullable for class Airline."); - - if (computerizedReservationSystem.IsSet && computerizedReservationSystem.Value == null) - throw new ArgumentNullException(nameof(computerizedReservationSystem), "Property is not nullable for class Airline."); - - if (customerReferenceNumber.IsSet && customerReferenceNumber.Value == null) - throw new ArgumentNullException(nameof(customerReferenceNumber), "Property is not nullable for class Airline."); - - if (designatorCode.IsSet && designatorCode.Value == null) - throw new ArgumentNullException(nameof(designatorCode), "Property is not nullable for class Airline."); - - if (documentType.IsSet && documentType.Value == null) - throw new ArgumentNullException(nameof(documentType), "Property is not nullable for class Airline."); - - if (flightDate.IsSet && flightDate.Value == null) - throw new ArgumentNullException(nameof(flightDate), "Property is not nullable for class Airline."); - - if (legs.IsSet && legs.Value == null) - throw new ArgumentNullException(nameof(legs), "Property is not nullable for class Airline."); - - if (passengers.IsSet && passengers.Value == null) - throw new ArgumentNullException(nameof(passengers), "Property is not nullable for class Airline."); - - if (ticket.IsSet && ticket.Value == null) - throw new ArgumentNullException(nameof(ticket), "Property is not nullable for class Airline."); - - if (travelAgency.IsSet && travelAgency.Value == null) - throw new ArgumentNullException(nameof(travelAgency), "Property is not nullable for class Airline."); - - return new Airline(passengerName.Value, agency, boardingFee, code, computerizedReservationSystem, customerReferenceNumber, designatorCode, documentType, flightDate, legs, passengers, ticket, travelAgency); + return + ( + this.Agency == input.Agency || + (this.Agency != null && + this.Agency.Equals(input.Agency)) + ) && + ( + this.BoardingFee == input.BoardingFee || + this.BoardingFee.Equals(input.BoardingFee) + ) && + ( + this.Code == input.Code || + (this.Code != null && + this.Code.Equals(input.Code)) + ) && + ( + this.ComputerizedReservationSystem == input.ComputerizedReservationSystem || + (this.ComputerizedReservationSystem != null && + this.ComputerizedReservationSystem.Equals(input.ComputerizedReservationSystem)) + ) && + ( + this.CustomerReferenceNumber == input.CustomerReferenceNumber || + (this.CustomerReferenceNumber != null && + this.CustomerReferenceNumber.Equals(input.CustomerReferenceNumber)) + ) && + ( + this.DesignatorCode == input.DesignatorCode || + (this.DesignatorCode != null && + this.DesignatorCode.Equals(input.DesignatorCode)) + ) && + ( + this.DocumentType == input.DocumentType || + (this.DocumentType != null && + this.DocumentType.Equals(input.DocumentType)) + ) && + ( + this.FlightDate == input.FlightDate || + (this.FlightDate != null && + this.FlightDate.Equals(input.FlightDate)) + ) && + ( + this.Legs == input.Legs || + this.Legs != null && + input.Legs != null && + this.Legs.SequenceEqual(input.Legs) + ) && + ( + this.PassengerName == input.PassengerName || + (this.PassengerName != null && + this.PassengerName.Equals(input.PassengerName)) + ) && + ( + this.Passengers == input.Passengers || + this.Passengers != null && + input.Passengers != null && + this.Passengers.SequenceEqual(input.Passengers) + ) && + ( + this.Ticket == input.Ticket || + (this.Ticket != null && + this.Ticket.Equals(input.Ticket)) + ) && + ( + this.TravelAgency == input.TravelAgency || + (this.TravelAgency != null && + this.TravelAgency.Equals(input.TravelAgency)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Airline airline, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, airline, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Agency != null) + { + hashCode = (hashCode * 59) + this.Agency.GetHashCode(); + } + hashCode = (hashCode * 59) + this.BoardingFee.GetHashCode(); + if (this.Code != null) + { + hashCode = (hashCode * 59) + this.Code.GetHashCode(); + } + if (this.ComputerizedReservationSystem != null) + { + hashCode = (hashCode * 59) + this.ComputerizedReservationSystem.GetHashCode(); + } + if (this.CustomerReferenceNumber != null) + { + hashCode = (hashCode * 59) + this.CustomerReferenceNumber.GetHashCode(); + } + if (this.DesignatorCode != null) + { + hashCode = (hashCode * 59) + this.DesignatorCode.GetHashCode(); + } + if (this.DocumentType != null) + { + hashCode = (hashCode * 59) + this.DocumentType.GetHashCode(); + } + if (this.FlightDate != null) + { + hashCode = (hashCode * 59) + this.FlightDate.GetHashCode(); + } + if (this.Legs != null) + { + hashCode = (hashCode * 59) + this.Legs.GetHashCode(); + } + if (this.PassengerName != null) + { + hashCode = (hashCode * 59) + this.PassengerName.GetHashCode(); + } + if (this.Passengers != null) + { + hashCode = (hashCode * 59) + this.Passengers.GetHashCode(); + } + if (this.Ticket != null) + { + hashCode = (hashCode * 59) + this.Ticket.GetHashCode(); + } + if (this.TravelAgency != null) + { + hashCode = (hashCode * 59) + this.TravelAgency.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Airline airline, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (airline.PassengerName == null) - throw new ArgumentNullException(nameof(airline.PassengerName), "Property is required for class Airline."); - - if (airline.AgencyOption.IsSet && airline.Agency == null) - throw new ArgumentNullException(nameof(airline.Agency), "Property is required for class Airline."); - - if (airline.CodeOption.IsSet && airline.Code == null) - throw new ArgumentNullException(nameof(airline.Code), "Property is required for class Airline."); - - if (airline.ComputerizedReservationSystemOption.IsSet && airline.ComputerizedReservationSystem == null) - throw new ArgumentNullException(nameof(airline.ComputerizedReservationSystem), "Property is required for class Airline."); - - if (airline.CustomerReferenceNumberOption.IsSet && airline.CustomerReferenceNumber == null) - throw new ArgumentNullException(nameof(airline.CustomerReferenceNumber), "Property is required for class Airline."); - - if (airline.DesignatorCodeOption.IsSet && airline.DesignatorCode == null) - throw new ArgumentNullException(nameof(airline.DesignatorCode), "Property is required for class Airline."); - - if (airline.DocumentTypeOption.IsSet && airline.DocumentType == null) - throw new ArgumentNullException(nameof(airline.DocumentType), "Property is required for class Airline."); - - if (airline.LegsOption.IsSet && airline.Legs == null) - throw new ArgumentNullException(nameof(airline.Legs), "Property is required for class Airline."); - - if (airline.PassengersOption.IsSet && airline.Passengers == null) - throw new ArgumentNullException(nameof(airline.Passengers), "Property is required for class Airline."); - - if (airline.TicketOption.IsSet && airline.Ticket == null) - throw new ArgumentNullException(nameof(airline.Ticket), "Property is required for class Airline."); - - if (airline.TravelAgencyOption.IsSet && airline.TravelAgency == null) - throw new ArgumentNullException(nameof(airline.TravelAgency), "Property is required for class Airline."); - - writer.WriteString("passengerName", airline.PassengerName); - - if (airline.AgencyOption.IsSet) - { - writer.WritePropertyName("agency"); - JsonSerializer.Serialize(writer, airline.Agency, jsonSerializerOptions); - } - if (airline.BoardingFeeOption.IsSet) - writer.WriteNumber("boardingFee", airline.BoardingFeeOption.Value.Value); - - if (airline.CodeOption.IsSet) - writer.WriteString("code", airline.Code); - - if (airline.ComputerizedReservationSystemOption.IsSet) - writer.WriteString("computerizedReservationSystem", airline.ComputerizedReservationSystem); - - if (airline.CustomerReferenceNumberOption.IsSet) - writer.WriteString("customerReferenceNumber", airline.CustomerReferenceNumber); - - if (airline.DesignatorCodeOption.IsSet) - writer.WriteString("designatorCode", airline.DesignatorCode); - - if (airline.DocumentTypeOption.IsSet) - writer.WriteString("documentType", airline.DocumentType); - - if (airline.FlightDateOption.IsSet) - writer.WriteString("flightDate", airline.FlightDateOption.Value.Value.ToString(FlightDateFormat)); - - if (airline.LegsOption.IsSet) - { - writer.WritePropertyName("legs"); - JsonSerializer.Serialize(writer, airline.Legs, jsonSerializerOptions); - } - if (airline.PassengersOption.IsSet) - { - writer.WritePropertyName("passengers"); - JsonSerializer.Serialize(writer, airline.Passengers, jsonSerializerOptions); - } - if (airline.TicketOption.IsSet) - { - writer.WritePropertyName("ticket"); - JsonSerializer.Serialize(writer, airline.Ticket, jsonSerializerOptions); - } - if (airline.TravelAgencyOption.IsSet) - { - writer.WritePropertyName("travelAgency"); - JsonSerializer.Serialize(writer, airline.TravelAgency, jsonSerializerOptions); - } + yield break; } } + } diff --git a/Adyen/Model/Checkout/AmazonPayDetails.cs b/Adyen/Model/Checkout/AmazonPayDetails.cs index b47c7dc86..df075513d 100644 --- a/Adyen/Model/Checkout/AmazonPayDetails.cs +++ b/Adyen/Model/Checkout/AmazonPayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,147 +15,80 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AmazonPayDetails /// - public partial class AmazonPayDetails : IValidatableObject + [DataContract(Name = "AmazonPayDetails")] + public partial class AmazonPayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// This is the `amazonPayToken` that you obtained from the [Get Checkout Session](https://amazon-pay-acquirer-guide.s3-eu-west-1.amazonaws.com/v1/amazon-pay-api-v2/checkout-session.html#get-checkout-session) response. This token is used for API only integration specifically. - /// The checkout attempt identifier. - /// The `checkoutSessionId` is used to identify the checkout session at the Amazon Pay side. This field is required only for drop-in and components integration, where it replaces the amazonPayToken. - /// **amazonpay** (default to TypeEnum.Amazonpay) - [JsonConstructor] - public AmazonPayDetails(Option amazonPayToken = default, Option checkoutAttemptId = default, Option checkoutSessionId = default, Option type = default) - { - AmazonPayTokenOption = amazonPayToken; - CheckoutAttemptIdOption = checkoutAttemptId; - CheckoutSessionIdOption = checkoutSessionId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **amazonpay** /// /// **amazonpay** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Amazonpay for value: amazonpay /// + [EnumMember(Value = "amazonpay")] Amazonpay = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("amazonpay")) - return TypeEnum.Amazonpay; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("amazonpay")) - return TypeEnum.Amazonpay; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Amazonpay) - return "amazonpay"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **amazonpay** /// /// **amazonpay** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of AmazonPayToken + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmazonPayTokenOption { get; private set; } + /// This is the `amazonPayToken` that you obtained from the [Get Checkout Session](https://amazon-pay-acquirer-guide.s3-eu-west-1.amazonaws.com/v1/amazon-pay-api-v2/checkout-session.html#get-checkout-session) response. This token is used for API only integration specifically.. + /// The checkout attempt identifier.. + /// The `checkoutSessionId` is used to identify the checkout session at the Amazon Pay side. This field is required only for drop-in and components integration, where it replaces the amazonPayToken.. + /// **amazonpay** (default to TypeEnum.Amazonpay). + public AmazonPayDetails(string amazonPayToken = default(string), string checkoutAttemptId = default(string), string checkoutSessionId = default(string), TypeEnum? type = TypeEnum.Amazonpay) + { + this.AmazonPayToken = amazonPayToken; + this.CheckoutAttemptId = checkoutAttemptId; + this.CheckoutSessionId = checkoutSessionId; + this.Type = type; + } /// /// This is the `amazonPayToken` that you obtained from the [Get Checkout Session](https://amazon-pay-acquirer-guide.s3-eu-west-1.amazonaws.com/v1/amazon-pay-api-v2/checkout-session.html#get-checkout-session) response. This token is used for API only integration specifically. /// /// This is the `amazonPayToken` that you obtained from the [Get Checkout Session](https://amazon-pay-acquirer-guide.s3-eu-west-1.amazonaws.com/v1/amazon-pay-api-v2/checkout-session.html#get-checkout-session) response. This token is used for API only integration specifically. - [JsonPropertyName("amazonPayToken")] - public string AmazonPayToken { get { return this.AmazonPayTokenOption; } set { this.AmazonPayTokenOption = new Option(value); } } - - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + [DataMember(Name = "amazonPayToken", EmitDefaultValue = false)] + public string AmazonPayToken { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of CheckoutSessionId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutSessionIdOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The `checkoutSessionId` is used to identify the checkout session at the Amazon Pay side. This field is required only for drop-in and components integration, where it replaces the amazonPayToken. /// /// The `checkoutSessionId` is used to identify the checkout session at the Amazon Pay side. This field is required only for drop-in and components integration, where it replaces the amazonPayToken. - [JsonPropertyName("checkoutSessionId")] - public string CheckoutSessionId { get { return this.CheckoutSessionIdOption; } set { this.CheckoutSessionIdOption = new Option(value); } } + [DataMember(Name = "checkoutSessionId", EmitDefaultValue = false)] + public string CheckoutSessionId { get; set; } /// /// Returns the string presentation of the object @@ -173,137 +107,91 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AmazonPayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AmazonPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amazonPayToken = default; - Option checkoutAttemptId = default; - Option checkoutSessionId = default; - Option type = default; + return this.Equals(input as AmazonPayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AmazonPayDetails instances are equal + /// + /// Instance of AmazonPayDetails to be compared + /// Boolean + public bool Equals(AmazonPayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amazonPayToken": - amazonPayToken = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "checkoutSessionId": - checkoutSessionId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(AmazonPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (amazonPayToken.IsSet && amazonPayToken.Value == null) - throw new ArgumentNullException(nameof(amazonPayToken), "Property is not nullable for class AmazonPayDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class AmazonPayDetails."); - - if (checkoutSessionId.IsSet && checkoutSessionId.Value == null) - throw new ArgumentNullException(nameof(checkoutSessionId), "Property is not nullable for class AmazonPayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class AmazonPayDetails."); - - return new AmazonPayDetails(amazonPayToken, checkoutAttemptId, checkoutSessionId, type); + return + ( + this.AmazonPayToken == input.AmazonPayToken || + (this.AmazonPayToken != null && + this.AmazonPayToken.Equals(input.AmazonPayToken)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.CheckoutSessionId == input.CheckoutSessionId || + (this.CheckoutSessionId != null && + this.CheckoutSessionId.Equals(input.CheckoutSessionId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AmazonPayDetails amazonPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, amazonPayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AmazonPayToken != null) + { + hashCode = (hashCode * 59) + this.AmazonPayToken.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.CheckoutSessionId != null) + { + hashCode = (hashCode * 59) + this.CheckoutSessionId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AmazonPayDetails amazonPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (amazonPayDetails.AmazonPayTokenOption.IsSet && amazonPayDetails.AmazonPayToken == null) - throw new ArgumentNullException(nameof(amazonPayDetails.AmazonPayToken), "Property is required for class AmazonPayDetails."); - - if (amazonPayDetails.CheckoutAttemptIdOption.IsSet && amazonPayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(amazonPayDetails.CheckoutAttemptId), "Property is required for class AmazonPayDetails."); - - if (amazonPayDetails.CheckoutSessionIdOption.IsSet && amazonPayDetails.CheckoutSessionId == null) - throw new ArgumentNullException(nameof(amazonPayDetails.CheckoutSessionId), "Property is required for class AmazonPayDetails."); - - if (amazonPayDetails.AmazonPayTokenOption.IsSet) - writer.WriteString("amazonPayToken", amazonPayDetails.AmazonPayToken); - - if (amazonPayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", amazonPayDetails.CheckoutAttemptId); - - if (amazonPayDetails.CheckoutSessionIdOption.IsSet) - writer.WriteString("checkoutSessionId", amazonPayDetails.CheckoutSessionId); - - var typeRawValue = AmazonPayDetails.TypeEnumToJsonValue(amazonPayDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Amount.cs b/Adyen/Model/Checkout/Amount.cs index 4381cc577..86a10a75e 100644 --- a/Adyen/Model/Checkout/Amount.cs +++ b/Adyen/Model/Checkout/Amount.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,48 +15,52 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Amount /// - public partial class Amount : IValidatableObject + [DataContract(Name = "Amount")] + public partial class Amount : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). - /// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). - [JsonConstructor] - public Amount(string currency, long value) + [JsonConstructorAttribute] + protected Amount() { } + /// + /// Initializes a new instance of the class. + /// + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). (required). + /// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). (required). + public Amount(string currency = default(string), long? value = default(long?)) { - Currency = currency; - Value = value; - OnCreated(); + this.Currency = currency; + this.Value = value; } - partial void OnCreated(); - /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). - [JsonPropertyName("currency")] + [DataMember(Name = "currency", IsRequired = false, EmitDefaultValue = false)] public string Currency { get; set; } /// /// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). /// /// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). - [JsonPropertyName("value")] - public long Value { get; set; } + [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] + public long? Value { get; set; } /// /// Returns the string presentation of the object @@ -72,126 +77,85 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // Currency (string) maxLength - if (this.Currency != null && this.Currency.Length > 3) - { - yield return new ValidationResult("Invalid value for Currency, length must be less than 3.", new [] { "Currency" }); - } - - // Currency (string) minLength - if (this.Currency != null && this.Currency.Length < 3) - { - yield return new ValidationResult("Invalid value for Currency, length must be greater than 3.", new [] { "Currency" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AmountJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Amount Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option currency = default; - Option value = default; + return this.Equals(input as Amount); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if Amount instances are equal + /// + /// Instance of Amount to be compared + /// Boolean + public bool Equals(Amount input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "currency": - currency = new Option(utf8JsonReader.GetString()); - break; - case "value": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - value = new Option(utf8JsonReader.GetInt64()); - break; - default: - break; - } - } + return false; } - - if (!currency.IsSet) - throw new ArgumentException("Property is required for class Amount.", nameof(currency)); - - if (!value.IsSet) - throw new ArgumentException("Property is required for class Amount.", nameof(value)); - - if (currency.IsSet && currency.Value == null) - throw new ArgumentNullException(nameof(currency), "Property is not nullable for class Amount."); - - if (value.IsSet && value.Value == null) - throw new ArgumentNullException(nameof(value), "Property is not nullable for class Amount."); - - return new Amount(currency.Value, value.Value.Value); + return + ( + this.Currency == input.Currency || + (this.Currency != null && + this.Currency.Equals(input.Currency)) + ) && + ( + this.Value == input.Value || + this.Value.Equals(input.Value) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Amount amount, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, amount, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Currency != null) + { + hashCode = (hashCode * 59) + this.Currency.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Amount amount, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (amount.Currency == null) - throw new ArgumentNullException(nameof(amount.Currency), "Property is required for class Amount."); + // Currency (string) maxLength + if (this.Currency != null && this.Currency.Length > 3) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Currency, length must be less than 3.", new [] { "Currency" }); + } - writer.WriteString("currency", amount.Currency); + // Currency (string) minLength + if (this.Currency != null && this.Currency.Length < 3) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Currency, length must be greater than 3.", new [] { "Currency" }); + } - writer.WriteNumber("value", amount.Value); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Amounts.cs b/Adyen/Model/Checkout/Amounts.cs index 3512a6c0d..0383533bf 100644 --- a/Adyen/Model/Checkout/Amounts.cs +++ b/Adyen/Model/Checkout/Amounts.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,47 +15,51 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Amounts /// - public partial class Amounts : IValidatableObject + [DataContract(Name = "Amounts")] + public partial class Amounts : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). - /// The amounts of the donation (in [minor units](https://docs.adyen.com/development-resources/currency-codes/)). - [JsonConstructor] - public Amounts(string currency, List values) + [JsonConstructorAttribute] + protected Amounts() { } + /// + /// Initializes a new instance of the class. + /// + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). (required). + /// The amounts of the donation (in [minor units](https://docs.adyen.com/development-resources/currency-codes/)). (required). + public Amounts(string currency = default(string), List values = default(List)) { - Currency = currency; - Values = values; - OnCreated(); + this.Currency = currency; + this.Values = values; } - partial void OnCreated(); - /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). - [JsonPropertyName("currency")] + [DataMember(Name = "currency", IsRequired = false, EmitDefaultValue = false)] public string Currency { get; set; } /// /// The amounts of the donation (in [minor units](https://docs.adyen.com/development-resources/currency-codes/)). /// /// The amounts of the donation (in [minor units](https://docs.adyen.com/development-resources/currency-codes/)). - [JsonPropertyName("values")] + [DataMember(Name = "values", IsRequired = false, EmitDefaultValue = false)] public List Values { get; set; } /// @@ -72,118 +77,78 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AmountsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Amounts Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option currency = default; - Option> values = default; + return this.Equals(input as Amounts); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if Amounts instances are equal + /// + /// Instance of Amounts to be compared + /// Boolean + public bool Equals(Amounts input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "currency": - currency = new Option(utf8JsonReader.GetString()); - break; - case "values": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - values = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } + return false; } - - if (!currency.IsSet) - throw new ArgumentException("Property is required for class Amounts.", nameof(currency)); - - if (!values.IsSet) - throw new ArgumentException("Property is required for class Amounts.", nameof(values)); - - if (currency.IsSet && currency.Value == null) - throw new ArgumentNullException(nameof(currency), "Property is not nullable for class Amounts."); - - if (values.IsSet && values.Value == null) - throw new ArgumentNullException(nameof(values), "Property is not nullable for class Amounts."); - - return new Amounts(currency.Value, values.Value); + return + ( + this.Currency == input.Currency || + (this.Currency != null && + this.Currency.Equals(input.Currency)) + ) && + ( + this.Values == input.Values || + this.Values != null && + input.Values != null && + this.Values.SequenceEqual(input.Values) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Amounts amounts, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, amounts, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Currency != null) + { + hashCode = (hashCode * 59) + this.Currency.GetHashCode(); + } + if (this.Values != null) + { + hashCode = (hashCode * 59) + this.Values.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Amounts amounts, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (amounts.Currency == null) - throw new ArgumentNullException(nameof(amounts.Currency), "Property is required for class Amounts."); - - if (amounts.Values == null) - throw new ArgumentNullException(nameof(amounts.Values), "Property is required for class Amounts."); - - writer.WriteString("currency", amounts.Currency); - - writer.WritePropertyName("values"); - JsonSerializer.Serialize(writer, amounts.Values, jsonSerializerOptions); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AncvDetails.cs b/Adyen/Model/Checkout/AncvDetails.cs index ff61ee681..d2b7365a6 100644 --- a/Adyen/Model/Checkout/AncvDetails.cs +++ b/Adyen/Model/Checkout/AncvDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,164 +15,90 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AncvDetails /// - public partial class AncvDetails : IValidatableObject + [DataContract(Name = "AncvDetails")] + public partial class AncvDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// ANCV account identification (email or account number) - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **ancv** - [JsonConstructor] - public AncvDetails(Option beneficiaryId = default, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - BeneficiaryIdOption = beneficiaryId; - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **ancv** /// /// **ancv** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Ancv for value: ancv /// + [EnumMember(Value = "ancv")] Ancv = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("ancv")) - return TypeEnum.Ancv; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("ancv")) - return TypeEnum.Ancv; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Ancv) - return "ancv"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **ancv** /// /// **ancv** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of BeneficiaryId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BeneficiaryIdOption { get; private set; } + /// ANCV account identification (email or account number). + /// The checkout attempt identifier.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **ancv**. + public AncvDetails(string beneficiaryId = default(string), string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = default(TypeEnum?)) + { + this.BeneficiaryId = beneficiaryId; + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// ANCV account identification (email or account number) /// /// ANCV account identification (email or account number) - [JsonPropertyName("beneficiaryId")] - public string BeneficiaryId { get { return this.BeneficiaryIdOption; } set { this.BeneficiaryIdOption = new Option(value); } } - - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + [DataMember(Name = "beneficiaryId", EmitDefaultValue = false)] + public string BeneficiaryId { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -191,156 +118,106 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AncvDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AncvDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option beneficiaryId = default; - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as AncvDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AncvDetails instances are equal + /// + /// Instance of AncvDetails to be compared + /// Boolean + public bool Equals(AncvDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "beneficiaryId": - beneficiaryId = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(AncvDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (beneficiaryId.IsSet && beneficiaryId.Value == null) - throw new ArgumentNullException(nameof(beneficiaryId), "Property is not nullable for class AncvDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class AncvDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class AncvDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class AncvDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class AncvDetails."); - - return new AncvDetails(beneficiaryId, checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.BeneficiaryId == input.BeneficiaryId || + (this.BeneficiaryId != null && + this.BeneficiaryId.Equals(input.BeneficiaryId)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AncvDetails ancvDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, ancvDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.BeneficiaryId != null) + { + hashCode = (hashCode * 59) + this.BeneficiaryId.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AncvDetails ancvDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (ancvDetails.BeneficiaryIdOption.IsSet && ancvDetails.BeneficiaryId == null) - throw new ArgumentNullException(nameof(ancvDetails.BeneficiaryId), "Property is required for class AncvDetails."); - - if (ancvDetails.CheckoutAttemptIdOption.IsSet && ancvDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(ancvDetails.CheckoutAttemptId), "Property is required for class AncvDetails."); - - if (ancvDetails.RecurringDetailReferenceOption.IsSet && ancvDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(ancvDetails.RecurringDetailReference), "Property is required for class AncvDetails."); - - if (ancvDetails.StoredPaymentMethodIdOption.IsSet && ancvDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(ancvDetails.StoredPaymentMethodId), "Property is required for class AncvDetails."); - - if (ancvDetails.BeneficiaryIdOption.IsSet) - writer.WriteString("beneficiaryId", ancvDetails.BeneficiaryId); - - if (ancvDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", ancvDetails.CheckoutAttemptId); - - if (ancvDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", ancvDetails.RecurringDetailReference); - - if (ancvDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", ancvDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = AncvDetails.TypeEnumToJsonValue(ancvDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/AndroidPayDetails.cs b/Adyen/Model/Checkout/AndroidPayDetails.cs index 420fd8bf2..13933bbb6 100644 --- a/Adyen/Model/Checkout/AndroidPayDetails.cs +++ b/Adyen/Model/Checkout/AndroidPayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,115 +15,62 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AndroidPayDetails /// - public partial class AndroidPayDetails : IValidatableObject + [DataContract(Name = "AndroidPayDetails")] + public partial class AndroidPayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// **androidpay** (default to TypeEnum.Androidpay) - [JsonConstructor] - public AndroidPayDetails(Option checkoutAttemptId = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **androidpay** /// /// **androidpay** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Androidpay for value: androidpay /// + [EnumMember(Value = "androidpay")] Androidpay = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("androidpay")) - return TypeEnum.Androidpay; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("androidpay")) - return TypeEnum.Androidpay; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Androidpay) - return "androidpay"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **androidpay** /// /// **androidpay** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// **androidpay** (default to TypeEnum.Androidpay). + public AndroidPayDetails(string checkoutAttemptId = default(string), TypeEnum? type = TypeEnum.Androidpay) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Returns the string presentation of the object @@ -139,111 +87,73 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AndroidPayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AndroidPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option type = default; + return this.Equals(input as AndroidPayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if AndroidPayDetails instances are equal + /// + /// Instance of AndroidPayDetails to be compared + /// Boolean + public bool Equals(AndroidPayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(AndroidPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class AndroidPayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class AndroidPayDetails."); - - return new AndroidPayDetails(checkoutAttemptId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AndroidPayDetails androidPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, androidPayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AndroidPayDetails androidPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (androidPayDetails.CheckoutAttemptIdOption.IsSet && androidPayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(androidPayDetails.CheckoutAttemptId), "Property is required for class AndroidPayDetails."); - - if (androidPayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", androidPayDetails.CheckoutAttemptId); - - var typeRawValue = AndroidPayDetails.TypeEnumToJsonValue(androidPayDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ApplePayDetails.cs b/Adyen/Model/Checkout/ApplePayDetails.cs index f86d0db97..03f028850 100644 --- a/Adyen/Model/Checkout/ApplePayDetails.cs +++ b/Adyen/Model/Checkout/ApplePayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,240 +15,125 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ApplePayDetails /// - public partial class ApplePayDetails : IValidatableObject + [DataContract(Name = "ApplePayDetails")] + public partial class ApplePayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. - /// The checkout attempt identifier. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **applepay** (default to TypeEnum.Applepay) - [JsonConstructor] - public ApplePayDetails(string applePayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - ApplePayToken = applePayToken; - CheckoutAttemptIdOption = checkoutAttemptId; - FundingSourceOption = fundingSource; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// + [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// + [EnumMember(Value = "debit")] Debit = 2 - } - /// - /// Returns a - /// - /// - /// - /// - public static FundingSourceEnum FundingSourceEnumFromString(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) - { - if (value == FundingSourceEnum.Credit) - return "credit"; - - if (value == FundingSourceEnum.Debit) - return "debit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonPropertyName("fundingSource")] - public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } /// /// **applepay** /// /// **applepay** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Applepay for value: applepay /// + [EnumMember(Value = "applepay")] Applepay = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("applepay")) - return TypeEnum.Applepay; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("applepay")) - return TypeEnum.Applepay; - - return null; - } /// - /// Converts the to the json value + /// **applepay** /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Applepay) - return "applepay"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - + /// **applepay** + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of Type + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } - + [JsonConstructorAttribute] + protected ApplePayDetails() { } /// - /// **applepay** + /// Initializes a new instance of the class. /// - /// **applepay** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. (required). + /// The checkout attempt identifier.. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **applepay** (default to TypeEnum.Applepay). + public ApplePayDetails(string applePayToken = default(string), string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Applepay) + { + this.ApplePayToken = applePayToken; + this.CheckoutAttemptId = checkoutAttemptId; + this.FundingSource = fundingSource; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. /// /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. - [JsonPropertyName("applePayToken")] + [DataMember(Name = "applePayToken", IsRequired = false, EmitDefaultValue = false)] public string ApplePayToken { get; set; } - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -268,175 +154,117 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // ApplePayToken (string) maxLength - if (this.ApplePayToken != null && this.ApplePayToken.Length > 10000) - { - yield return new ValidationResult("Invalid value for ApplePayToken, length must be less than 10000.", new [] { "ApplePayToken" }); - } - - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ApplePayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ApplePayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option applePayToken = default; - Option checkoutAttemptId = default; - Option fundingSource = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as ApplePayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ApplePayDetails instances are equal + /// + /// Instance of ApplePayDetails to be compared + /// Boolean + public bool Equals(ApplePayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "applePayToken": - applePayToken = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "fundingSource": - string fundingSourceRawValue = utf8JsonReader.GetString(); - if (fundingSourceRawValue != null) - fundingSource = new Option(ApplePayDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(ApplePayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!applePayToken.IsSet) - throw new ArgumentException("Property is required for class ApplePayDetails.", nameof(applePayToken)); - - if (applePayToken.IsSet && applePayToken.Value == null) - throw new ArgumentNullException(nameof(applePayToken), "Property is not nullable for class ApplePayDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class ApplePayDetails."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class ApplePayDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class ApplePayDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class ApplePayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class ApplePayDetails."); - - return new ApplePayDetails(applePayToken.Value, checkoutAttemptId, fundingSource, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.ApplePayToken == input.ApplePayToken || + (this.ApplePayToken != null && + this.ApplePayToken.Equals(input.ApplePayToken)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource.Equals(input.FundingSource) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ApplePayDetails applePayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, applePayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ApplePayToken != null) + { + hashCode = (hashCode * 59) + this.ApplePayToken.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ApplePayDetails applePayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (applePayDetails.ApplePayToken == null) - throw new ArgumentNullException(nameof(applePayDetails.ApplePayToken), "Property is required for class ApplePayDetails."); - - if (applePayDetails.CheckoutAttemptIdOption.IsSet && applePayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(applePayDetails.CheckoutAttemptId), "Property is required for class ApplePayDetails."); - - if (applePayDetails.RecurringDetailReferenceOption.IsSet && applePayDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(applePayDetails.RecurringDetailReference), "Property is required for class ApplePayDetails."); - - if (applePayDetails.StoredPaymentMethodIdOption.IsSet && applePayDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(applePayDetails.StoredPaymentMethodId), "Property is required for class ApplePayDetails."); - - writer.WriteString("applePayToken", applePayDetails.ApplePayToken); - - if (applePayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", applePayDetails.CheckoutAttemptId); - - var fundingSourceRawValue = ApplePayDetails.FundingSourceEnumToJsonValue(applePayDetails.FundingSourceOption.Value.Value); - writer.WriteString("fundingSource", fundingSourceRawValue); - if (applePayDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", applePayDetails.RecurringDetailReference); + // ApplePayToken (string) maxLength + if (this.ApplePayToken != null && this.ApplePayToken.Length > 10000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ApplePayToken, length must be less than 10000.", new [] { "ApplePayToken" }); + } - if (applePayDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", applePayDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = ApplePayDetails.TypeEnumToJsonValue(applePayDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ApplePayDonations.cs b/Adyen/Model/Checkout/ApplePayDonations.cs index fb430459e..ca15916c5 100644 --- a/Adyen/Model/Checkout/ApplePayDonations.cs +++ b/Adyen/Model/Checkout/ApplePayDonations.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,240 +15,125 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ApplePayDonations /// - public partial class ApplePayDonations : IValidatableObject + [DataContract(Name = "ApplePayDonations")] + public partial class ApplePayDonations : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. - /// The checkout attempt identifier. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **applepay** (default to TypeEnum.Applepay) - [JsonConstructor] - public ApplePayDonations(string applePayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - ApplePayToken = applePayToken; - CheckoutAttemptIdOption = checkoutAttemptId; - FundingSourceOption = fundingSource; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// + [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// + [EnumMember(Value = "debit")] Debit = 2 - } - /// - /// Returns a - /// - /// - /// - /// - public static FundingSourceEnum FundingSourceEnumFromString(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) - { - if (value == FundingSourceEnum.Credit) - return "credit"; - - if (value == FundingSourceEnum.Debit) - return "debit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonPropertyName("fundingSource")] - public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } /// /// **applepay** /// /// **applepay** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Applepay for value: applepay /// + [EnumMember(Value = "applepay")] Applepay = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("applepay")) - return TypeEnum.Applepay; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("applepay")) - return TypeEnum.Applepay; - - return null; - } /// - /// Converts the to the json value + /// **applepay** /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Applepay) - return "applepay"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - + /// **applepay** + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of Type + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } - + [JsonConstructorAttribute] + protected ApplePayDonations() { } /// - /// **applepay** + /// Initializes a new instance of the class. /// - /// **applepay** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. (required). + /// The checkout attempt identifier.. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **applepay** (default to TypeEnum.Applepay). + public ApplePayDonations(string applePayToken = default(string), string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Applepay) + { + this.ApplePayToken = applePayToken; + this.CheckoutAttemptId = checkoutAttemptId; + this.FundingSource = fundingSource; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. /// /// The stringified and base64 encoded `paymentData` you retrieved from the Apple framework. - [JsonPropertyName("applePayToken")] + [DataMember(Name = "applePayToken", IsRequired = false, EmitDefaultValue = false)] public string ApplePayToken { get; set; } - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -268,175 +154,117 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // ApplePayToken (string) maxLength - if (this.ApplePayToken != null && this.ApplePayToken.Length > 10000) - { - yield return new ValidationResult("Invalid value for ApplePayToken, length must be less than 10000.", new [] { "ApplePayToken" }); - } - - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ApplePayDonationsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ApplePayDonations Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option applePayToken = default; - Option checkoutAttemptId = default; - Option fundingSource = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as ApplePayDonations); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ApplePayDonations instances are equal + /// + /// Instance of ApplePayDonations to be compared + /// Boolean + public bool Equals(ApplePayDonations input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "applePayToken": - applePayToken = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "fundingSource": - string fundingSourceRawValue = utf8JsonReader.GetString(); - if (fundingSourceRawValue != null) - fundingSource = new Option(ApplePayDonations.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(ApplePayDonations.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!applePayToken.IsSet) - throw new ArgumentException("Property is required for class ApplePayDonations.", nameof(applePayToken)); - - if (applePayToken.IsSet && applePayToken.Value == null) - throw new ArgumentNullException(nameof(applePayToken), "Property is not nullable for class ApplePayDonations."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class ApplePayDonations."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class ApplePayDonations."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class ApplePayDonations."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class ApplePayDonations."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class ApplePayDonations."); - - return new ApplePayDonations(applePayToken.Value, checkoutAttemptId, fundingSource, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.ApplePayToken == input.ApplePayToken || + (this.ApplePayToken != null && + this.ApplePayToken.Equals(input.ApplePayToken)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource.Equals(input.FundingSource) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ApplePayDonations applePayDonations, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, applePayDonations, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ApplePayToken != null) + { + hashCode = (hashCode * 59) + this.ApplePayToken.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ApplePayDonations applePayDonations, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (applePayDonations.ApplePayToken == null) - throw new ArgumentNullException(nameof(applePayDonations.ApplePayToken), "Property is required for class ApplePayDonations."); - - if (applePayDonations.CheckoutAttemptIdOption.IsSet && applePayDonations.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(applePayDonations.CheckoutAttemptId), "Property is required for class ApplePayDonations."); - - if (applePayDonations.RecurringDetailReferenceOption.IsSet && applePayDonations.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(applePayDonations.RecurringDetailReference), "Property is required for class ApplePayDonations."); - - if (applePayDonations.StoredPaymentMethodIdOption.IsSet && applePayDonations.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(applePayDonations.StoredPaymentMethodId), "Property is required for class ApplePayDonations."); - - writer.WriteString("applePayToken", applePayDonations.ApplePayToken); - - if (applePayDonations.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", applePayDonations.CheckoutAttemptId); - - var fundingSourceRawValue = ApplePayDonations.FundingSourceEnumToJsonValue(applePayDonations.FundingSourceOption.Value.Value); - writer.WriteString("fundingSource", fundingSourceRawValue); - if (applePayDonations.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", applePayDonations.RecurringDetailReference); + // ApplePayToken (string) maxLength + if (this.ApplePayToken != null && this.ApplePayToken.Length > 10000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ApplePayToken, length must be less than 10000.", new [] { "ApplePayToken" }); + } - if (applePayDonations.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", applePayDonations.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = ApplePayDonations.TypeEnumToJsonValue(applePayDonations.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ApplePaySessionRequest.cs b/Adyen/Model/Checkout/ApplePaySessionRequest.cs index 9507eb727..4f113ca85 100644 --- a/Adyen/Model/Checkout/ApplePaySessionRequest.cs +++ b/Adyen/Model/Checkout/ApplePaySessionRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,56 +15,60 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ApplePaySessionRequest /// - public partial class ApplePaySessionRequest : IValidatableObject + [DataContract(Name = "ApplePaySessionRequest")] + public partial class ApplePaySessionRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// This is the name that your shoppers will see in the Apple Pay interface. The value returned as `configuration.merchantName` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. - /// The domain name you provided when you added Apple Pay in your Customer Area. This must match the `window.location.hostname` of the web shop. - /// Your merchant identifier registered with Apple Pay. Use the value of the `configuration.merchantId` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. - [JsonConstructor] - public ApplePaySessionRequest(string displayName, string domainName, string merchantIdentifier) + [JsonConstructorAttribute] + protected ApplePaySessionRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// This is the name that your shoppers will see in the Apple Pay interface. The value returned as `configuration.merchantName` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. (required). + /// The domain name you provided when you added Apple Pay in your Customer Area. This must match the `window.location.hostname` of the web shop. (required). + /// Your merchant identifier registered with Apple Pay. Use the value of the `configuration.merchantId` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. (required). + public ApplePaySessionRequest(string displayName = default(string), string domainName = default(string), string merchantIdentifier = default(string)) { - DisplayName = displayName; - DomainName = domainName; - MerchantIdentifier = merchantIdentifier; - OnCreated(); + this.DisplayName = displayName; + this.DomainName = domainName; + this.MerchantIdentifier = merchantIdentifier; } - partial void OnCreated(); - /// /// This is the name that your shoppers will see in the Apple Pay interface. The value returned as `configuration.merchantName` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. /// /// This is the name that your shoppers will see in the Apple Pay interface. The value returned as `configuration.merchantName` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. - [JsonPropertyName("displayName")] + [DataMember(Name = "displayName", IsRequired = false, EmitDefaultValue = false)] public string DisplayName { get; set; } /// /// The domain name you provided when you added Apple Pay in your Customer Area. This must match the `window.location.hostname` of the web shop. /// /// The domain name you provided when you added Apple Pay in your Customer Area. This must match the `window.location.hostname` of the web shop. - [JsonPropertyName("domainName")] + [DataMember(Name = "domainName", IsRequired = false, EmitDefaultValue = false)] public string DomainName { get; set; } /// /// Your merchant identifier registered with Apple Pay. Use the value of the `configuration.merchantId` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. /// /// Your merchant identifier registered with Apple Pay. Use the value of the `configuration.merchantId` field from the [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. - [JsonPropertyName("merchantIdentifier")] + [DataMember(Name = "merchantIdentifier", IsRequired = false, EmitDefaultValue = false)] public string MerchantIdentifier { get; set; } /// @@ -82,137 +87,92 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // DisplayName (string) maxLength - if (this.DisplayName != null && this.DisplayName.Length > 64) - { - yield return new ValidationResult("Invalid value for DisplayName, length must be less than 64.", new [] { "DisplayName" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ApplePaySessionRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ApplePaySessionRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option displayName = default; - Option domainName = default; - Option merchantIdentifier = default; + return this.Equals(input as ApplePaySessionRequest); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ApplePaySessionRequest instances are equal + /// + /// Instance of ApplePaySessionRequest to be compared + /// Boolean + public bool Equals(ApplePaySessionRequest input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "displayName": - displayName = new Option(utf8JsonReader.GetString()); - break; - case "domainName": - domainName = new Option(utf8JsonReader.GetString()); - break; - case "merchantIdentifier": - merchantIdentifier = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!displayName.IsSet) - throw new ArgumentException("Property is required for class ApplePaySessionRequest.", nameof(displayName)); - - if (!domainName.IsSet) - throw new ArgumentException("Property is required for class ApplePaySessionRequest.", nameof(domainName)); - - if (!merchantIdentifier.IsSet) - throw new ArgumentException("Property is required for class ApplePaySessionRequest.", nameof(merchantIdentifier)); - - if (displayName.IsSet && displayName.Value == null) - throw new ArgumentNullException(nameof(displayName), "Property is not nullable for class ApplePaySessionRequest."); - - if (domainName.IsSet && domainName.Value == null) - throw new ArgumentNullException(nameof(domainName), "Property is not nullable for class ApplePaySessionRequest."); - - if (merchantIdentifier.IsSet && merchantIdentifier.Value == null) - throw new ArgumentNullException(nameof(merchantIdentifier), "Property is not nullable for class ApplePaySessionRequest."); - - return new ApplePaySessionRequest(displayName.Value, domainName.Value, merchantIdentifier.Value); + return + ( + this.DisplayName == input.DisplayName || + (this.DisplayName != null && + this.DisplayName.Equals(input.DisplayName)) + ) && + ( + this.DomainName == input.DomainName || + (this.DomainName != null && + this.DomainName.Equals(input.DomainName)) + ) && + ( + this.MerchantIdentifier == input.MerchantIdentifier || + (this.MerchantIdentifier != null && + this.MerchantIdentifier.Equals(input.MerchantIdentifier)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ApplePaySessionRequest applePaySessionRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, applePaySessionRequest, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.DisplayName != null) + { + hashCode = (hashCode * 59) + this.DisplayName.GetHashCode(); + } + if (this.DomainName != null) + { + hashCode = (hashCode * 59) + this.DomainName.GetHashCode(); + } + if (this.MerchantIdentifier != null) + { + hashCode = (hashCode * 59) + this.MerchantIdentifier.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ApplePaySessionRequest applePaySessionRequest, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (applePaySessionRequest.DisplayName == null) - throw new ArgumentNullException(nameof(applePaySessionRequest.DisplayName), "Property is required for class ApplePaySessionRequest."); - - if (applePaySessionRequest.DomainName == null) - throw new ArgumentNullException(nameof(applePaySessionRequest.DomainName), "Property is required for class ApplePaySessionRequest."); - - if (applePaySessionRequest.MerchantIdentifier == null) - throw new ArgumentNullException(nameof(applePaySessionRequest.MerchantIdentifier), "Property is required for class ApplePaySessionRequest."); - - writer.WriteString("displayName", applePaySessionRequest.DisplayName); - - writer.WriteString("domainName", applePaySessionRequest.DomainName); + // DisplayName (string) maxLength + if (this.DisplayName != null && this.DisplayName.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DisplayName, length must be less than 64.", new [] { "DisplayName" }); + } - writer.WriteString("merchantIdentifier", applePaySessionRequest.MerchantIdentifier); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ApplePaySessionResponse.cs b/Adyen/Model/Checkout/ApplePaySessionResponse.cs index ac8b772ef..5f314d423 100644 --- a/Adyen/Model/Checkout/ApplePaySessionResponse.cs +++ b/Adyen/Model/Checkout/ApplePaySessionResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,38 +15,42 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ApplePaySessionResponse /// - public partial class ApplePaySessionResponse : IValidatableObject + [DataContract(Name = "ApplePaySessionResponse")] + public partial class ApplePaySessionResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Base64 encoded data you need to [complete the Apple Pay merchant validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). - [JsonConstructor] - public ApplePaySessionResponse(string data) + [JsonConstructorAttribute] + protected ApplePaySessionResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// Base64 encoded data you need to [complete the Apple Pay merchant validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). (required). + public ApplePaySessionResponse(string data = default(string)) { - Data = data; - OnCreated(); + this.Data = data; } - partial void OnCreated(); - /// /// Base64 encoded data you need to [complete the Apple Pay merchant validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). /// /// Base64 encoded data you need to [complete the Apple Pay merchant validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). - [JsonPropertyName("data")] + [DataMember(Name = "data", IsRequired = false, EmitDefaultValue = false)] public string Data { get; set; } /// @@ -62,101 +67,68 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ApplePaySessionResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ApplePaySessionResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option data = default; + return this.Equals(input as ApplePaySessionResponse); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ApplePaySessionResponse instances are equal + /// + /// Instance of ApplePaySessionResponse to be compared + /// Boolean + public bool Equals(ApplePaySessionResponse input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "data": - data = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!data.IsSet) - throw new ArgumentException("Property is required for class ApplePaySessionResponse.", nameof(data)); - - if (data.IsSet && data.Value == null) - throw new ArgumentNullException(nameof(data), "Property is not nullable for class ApplePaySessionResponse."); - - return new ApplePaySessionResponse(data.Value); + return + ( + this.Data == input.Data || + (this.Data != null && + this.Data.Equals(input.Data)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ApplePaySessionResponse applePaySessionResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, applePaySessionResponse, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Data != null) + { + hashCode = (hashCode * 59) + this.Data.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ApplePaySessionResponse applePaySessionResponse, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (applePaySessionResponse.Data == null) - throw new ArgumentNullException(nameof(applePaySessionResponse.Data), "Property is required for class ApplePaySessionResponse."); - - writer.WriteString("data", applePaySessionResponse.Data); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ApplicationInfo.cs b/Adyen/Model/Checkout/ApplicationInfo.cs index 445f7495e..b560f848b 100644 --- a/Adyen/Model/Checkout/ApplicationInfo.cs +++ b/Adyen/Model/Checkout/ApplicationInfo.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,120 +15,77 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ApplicationInfo /// - public partial class ApplicationInfo : IValidatableObject + [DataContract(Name = "ApplicationInfo")] + public partial class ApplicationInfo : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// adyenLibrary - /// adyenPaymentSource - /// externalPlatform - /// merchantApplication - /// merchantDevice - /// shopperInteractionDevice - [JsonConstructor] - public ApplicationInfo(Option adyenLibrary = default, Option adyenPaymentSource = default, Option externalPlatform = default, Option merchantApplication = default, Option merchantDevice = default, Option shopperInteractionDevice = default) + /// adyenLibrary. + /// adyenPaymentSource. + /// externalPlatform. + /// merchantApplication. + /// merchantDevice. + /// shopperInteractionDevice. + public ApplicationInfo(CommonField adyenLibrary = default(CommonField), CommonField adyenPaymentSource = default(CommonField), ExternalPlatform externalPlatform = default(ExternalPlatform), CommonField merchantApplication = default(CommonField), MerchantDevice merchantDevice = default(MerchantDevice), ShopperInteractionDevice shopperInteractionDevice = default(ShopperInteractionDevice)) { - AdyenLibraryOption = adyenLibrary; - AdyenPaymentSourceOption = adyenPaymentSource; - ExternalPlatformOption = externalPlatform; - MerchantApplicationOption = merchantApplication; - MerchantDeviceOption = merchantDevice; - ShopperInteractionDeviceOption = shopperInteractionDevice; - OnCreated(); + this.AdyenLibrary = adyenLibrary; + this.AdyenPaymentSource = adyenPaymentSource; + this.ExternalPlatform = externalPlatform; + this.MerchantApplication = merchantApplication; + this.MerchantDevice = merchantDevice; + this.ShopperInteractionDevice = shopperInteractionDevice; } - partial void OnCreated(); - - /// - /// Used to track the state of AdyenLibrary - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AdyenLibraryOption { get; private set; } - /// /// Gets or Sets AdyenLibrary /// - [JsonPropertyName("adyenLibrary")] - public CommonField AdyenLibrary { get { return this.AdyenLibraryOption; } set { this.AdyenLibraryOption = new Option(value); } } - - /// - /// Used to track the state of AdyenPaymentSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AdyenPaymentSourceOption { get; private set; } + [DataMember(Name = "adyenLibrary", EmitDefaultValue = false)] + public CommonField AdyenLibrary { get; set; } /// /// Gets or Sets AdyenPaymentSource /// - [JsonPropertyName("adyenPaymentSource")] - public CommonField AdyenPaymentSource { get { return this.AdyenPaymentSourceOption; } set { this.AdyenPaymentSourceOption = new Option(value); } } - - /// - /// Used to track the state of ExternalPlatform - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExternalPlatformOption { get; private set; } + [DataMember(Name = "adyenPaymentSource", EmitDefaultValue = false)] + public CommonField AdyenPaymentSource { get; set; } /// /// Gets or Sets ExternalPlatform /// - [JsonPropertyName("externalPlatform")] - public ExternalPlatform ExternalPlatform { get { return this.ExternalPlatformOption; } set { this.ExternalPlatformOption = new Option(value); } } - - /// - /// Used to track the state of MerchantApplication - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantApplicationOption { get; private set; } + [DataMember(Name = "externalPlatform", EmitDefaultValue = false)] + public ExternalPlatform ExternalPlatform { get; set; } /// /// Gets or Sets MerchantApplication /// - [JsonPropertyName("merchantApplication")] - public CommonField MerchantApplication { get { return this.MerchantApplicationOption; } set { this.MerchantApplicationOption = new Option(value); } } - - /// - /// Used to track the state of MerchantDevice - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantDeviceOption { get; private set; } + [DataMember(Name = "merchantApplication", EmitDefaultValue = false)] + public CommonField MerchantApplication { get; set; } /// /// Gets or Sets MerchantDevice /// - [JsonPropertyName("merchantDevice")] - public MerchantDevice MerchantDevice { get { return this.MerchantDeviceOption; } set { this.MerchantDeviceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperInteractionDevice - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperInteractionDeviceOption { get; private set; } + [DataMember(Name = "merchantDevice", EmitDefaultValue = false)] + public MerchantDevice MerchantDevice { get; set; } /// /// Gets or Sets ShopperInteractionDevice /// - [JsonPropertyName("shopperInteractionDevice")] - public ShopperInteractionDevice ShopperInteractionDevice { get { return this.ShopperInteractionDeviceOption; } set { this.ShopperInteractionDeviceOption = new Option(value); } } + [DataMember(Name = "shopperInteractionDevice", EmitDefaultValue = false)] + public ShopperInteractionDevice ShopperInteractionDevice { get; set; } /// /// Returns the string presentation of the object @@ -148,183 +106,113 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ApplicationInfoJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ApplicationInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option adyenLibrary = default; - Option adyenPaymentSource = default; - Option externalPlatform = default; - Option merchantApplication = default; - Option merchantDevice = default; - Option shopperInteractionDevice = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "adyenLibrary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - adyenLibrary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "adyenPaymentSource": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - adyenPaymentSource = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "externalPlatform": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - externalPlatform = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantApplication": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - merchantApplication = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantDevice": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - merchantDevice = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperInteractionDevice": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shopperInteractionDevice = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (adyenLibrary.IsSet && adyenLibrary.Value == null) - throw new ArgumentNullException(nameof(adyenLibrary), "Property is not nullable for class ApplicationInfo."); - - if (adyenPaymentSource.IsSet && adyenPaymentSource.Value == null) - throw new ArgumentNullException(nameof(adyenPaymentSource), "Property is not nullable for class ApplicationInfo."); - - if (externalPlatform.IsSet && externalPlatform.Value == null) - throw new ArgumentNullException(nameof(externalPlatform), "Property is not nullable for class ApplicationInfo."); - - if (merchantApplication.IsSet && merchantApplication.Value == null) - throw new ArgumentNullException(nameof(merchantApplication), "Property is not nullable for class ApplicationInfo."); - - if (merchantDevice.IsSet && merchantDevice.Value == null) - throw new ArgumentNullException(nameof(merchantDevice), "Property is not nullable for class ApplicationInfo."); - - if (shopperInteractionDevice.IsSet && shopperInteractionDevice.Value == null) - throw new ArgumentNullException(nameof(shopperInteractionDevice), "Property is not nullable for class ApplicationInfo."); - - return new ApplicationInfo(adyenLibrary, adyenPaymentSource, externalPlatform, merchantApplication, merchantDevice, shopperInteractionDevice); + return this.Equals(input as ApplicationInfo); } /// - /// Serializes a + /// Returns true if ApplicationInfo instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ApplicationInfo applicationInfo, JsonSerializerOptions jsonSerializerOptions) + /// Instance of ApplicationInfo to be compared + /// Boolean + public bool Equals(ApplicationInfo input) { - writer.WriteStartObject(); - - WriteProperties(writer, applicationInfo, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AdyenLibrary == input.AdyenLibrary || + (this.AdyenLibrary != null && + this.AdyenLibrary.Equals(input.AdyenLibrary)) + ) && + ( + this.AdyenPaymentSource == input.AdyenPaymentSource || + (this.AdyenPaymentSource != null && + this.AdyenPaymentSource.Equals(input.AdyenPaymentSource)) + ) && + ( + this.ExternalPlatform == input.ExternalPlatform || + (this.ExternalPlatform != null && + this.ExternalPlatform.Equals(input.ExternalPlatform)) + ) && + ( + this.MerchantApplication == input.MerchantApplication || + (this.MerchantApplication != null && + this.MerchantApplication.Equals(input.MerchantApplication)) + ) && + ( + this.MerchantDevice == input.MerchantDevice || + (this.MerchantDevice != null && + this.MerchantDevice.Equals(input.MerchantDevice)) + ) && + ( + this.ShopperInteractionDevice == input.ShopperInteractionDevice || + (this.ShopperInteractionDevice != null && + this.ShopperInteractionDevice.Equals(input.ShopperInteractionDevice)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ApplicationInfo applicationInfo, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (applicationInfo.AdyenLibraryOption.IsSet && applicationInfo.AdyenLibrary == null) - throw new ArgumentNullException(nameof(applicationInfo.AdyenLibrary), "Property is required for class ApplicationInfo."); - - if (applicationInfo.AdyenPaymentSourceOption.IsSet && applicationInfo.AdyenPaymentSource == null) - throw new ArgumentNullException(nameof(applicationInfo.AdyenPaymentSource), "Property is required for class ApplicationInfo."); - - if (applicationInfo.ExternalPlatformOption.IsSet && applicationInfo.ExternalPlatform == null) - throw new ArgumentNullException(nameof(applicationInfo.ExternalPlatform), "Property is required for class ApplicationInfo."); - - if (applicationInfo.MerchantApplicationOption.IsSet && applicationInfo.MerchantApplication == null) - throw new ArgumentNullException(nameof(applicationInfo.MerchantApplication), "Property is required for class ApplicationInfo."); - - if (applicationInfo.MerchantDeviceOption.IsSet && applicationInfo.MerchantDevice == null) - throw new ArgumentNullException(nameof(applicationInfo.MerchantDevice), "Property is required for class ApplicationInfo."); - - if (applicationInfo.ShopperInteractionDeviceOption.IsSet && applicationInfo.ShopperInteractionDevice == null) - throw new ArgumentNullException(nameof(applicationInfo.ShopperInteractionDevice), "Property is required for class ApplicationInfo."); - - if (applicationInfo.AdyenLibraryOption.IsSet) - { - writer.WritePropertyName("adyenLibrary"); - JsonSerializer.Serialize(writer, applicationInfo.AdyenLibrary, jsonSerializerOptions); - } - if (applicationInfo.AdyenPaymentSourceOption.IsSet) - { - writer.WritePropertyName("adyenPaymentSource"); - JsonSerializer.Serialize(writer, applicationInfo.AdyenPaymentSource, jsonSerializerOptions); - } - if (applicationInfo.ExternalPlatformOption.IsSet) - { - writer.WritePropertyName("externalPlatform"); - JsonSerializer.Serialize(writer, applicationInfo.ExternalPlatform, jsonSerializerOptions); - } - if (applicationInfo.MerchantApplicationOption.IsSet) - { - writer.WritePropertyName("merchantApplication"); - JsonSerializer.Serialize(writer, applicationInfo.MerchantApplication, jsonSerializerOptions); - } - if (applicationInfo.MerchantDeviceOption.IsSet) - { - writer.WritePropertyName("merchantDevice"); - JsonSerializer.Serialize(writer, applicationInfo.MerchantDevice, jsonSerializerOptions); - } - if (applicationInfo.ShopperInteractionDeviceOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("shopperInteractionDevice"); - JsonSerializer.Serialize(writer, applicationInfo.ShopperInteractionDevice, jsonSerializerOptions); + int hashCode = 41; + if (this.AdyenLibrary != null) + { + hashCode = (hashCode * 59) + this.AdyenLibrary.GetHashCode(); + } + if (this.AdyenPaymentSource != null) + { + hashCode = (hashCode * 59) + this.AdyenPaymentSource.GetHashCode(); + } + if (this.ExternalPlatform != null) + { + hashCode = (hashCode * 59) + this.ExternalPlatform.GetHashCode(); + } + if (this.MerchantApplication != null) + { + hashCode = (hashCode * 59) + this.MerchantApplication.GetHashCode(); + } + if (this.MerchantDevice != null) + { + hashCode = (hashCode * 59) + this.MerchantDevice.GetHashCode(); + } + if (this.ShopperInteractionDevice != null) + { + hashCode = (hashCode * 59) + this.ShopperInteractionDevice.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/AuthenticationData.cs b/Adyen/Model/Checkout/AuthenticationData.cs index 28bcf8726..974b35995 100644 --- a/Adyen/Model/Checkout/AuthenticationData.cs +++ b/Adyen/Model/Checkout/AuthenticationData.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,144 +15,76 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// AuthenticationData /// - public partial class AuthenticationData : IValidatableObject + [DataContract(Name = "AuthenticationData")] + public partial class AuthenticationData : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: **false**. (default to false) - /// threeDSRequestData - [JsonConstructor] - public AuthenticationData(Option attemptAuthentication = default, Option authenticationOnly = default, Option threeDSRequestData = default) - { - AttemptAuthenticationOption = attemptAuthentication; - AuthenticationOnlyOption = authenticationOnly; - ThreeDSRequestDataOption = threeDSRequestData; - OnCreated(); - } - - partial void OnCreated(); - /// /// Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. /// /// Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. + [JsonConverter(typeof(StringEnumConverter))] public enum AttemptAuthenticationEnum { /// /// Enum Always for value: always /// + [EnumMember(Value = "always")] Always = 1, /// /// Enum Never for value: never /// + [EnumMember(Value = "never")] Never = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static AttemptAuthenticationEnum AttemptAuthenticationEnumFromString(string value) - { - if (value.Equals("always")) - return AttemptAuthenticationEnum.Always; - - if (value.Equals("never")) - return AttemptAuthenticationEnum.Never; - - throw new NotImplementedException($"Could not convert value to type AttemptAuthenticationEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static AttemptAuthenticationEnum? AttemptAuthenticationEnumFromStringOrDefault(string value) - { - if (value.Equals("always")) - return AttemptAuthenticationEnum.Always; - if (value.Equals("never")) - return AttemptAuthenticationEnum.Never; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string AttemptAuthenticationEnumToJsonValue(AttemptAuthenticationEnum? value) - { - if (value == AttemptAuthenticationEnum.Always) - return "always"; - - if (value == AttemptAuthenticationEnum.Never) - return "never"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of AttemptAuthentication - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AttemptAuthenticationOption { get; private set; } /// /// Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. /// /// Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. - [JsonPropertyName("attemptAuthentication")] - public AttemptAuthenticationEnum? AttemptAuthentication { get { return this.AttemptAuthenticationOption; } set { this.AttemptAuthenticationOption = new Option(value); } } - + [DataMember(Name = "attemptAuthentication", EmitDefaultValue = false)] + public AttemptAuthenticationEnum? AttemptAuthentication { get; set; } /// - /// Used to track the state of AuthenticationOnly - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthenticationOnlyOption { get; private set; } - - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: **false**. + /// Initializes a new instance of the class. /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: **false**. - [JsonPropertyName("authenticationOnly")] - public bool? AuthenticationOnly { get { return this.AuthenticationOnlyOption; } set { this.AuthenticationOnlyOption = new Option(value); } } + /// Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined.. + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization. Default: **false**. (default to false). + /// threeDSRequestData. + public AuthenticationData(AttemptAuthenticationEnum? attemptAuthentication = default(AttemptAuthenticationEnum?), bool? authenticationOnly = false, ThreeDSRequestData threeDSRequestData = default(ThreeDSRequestData)) + { + this.AttemptAuthentication = attemptAuthentication; + this.AuthenticationOnly = authenticationOnly; + this.ThreeDSRequestData = threeDSRequestData; + } /// - /// Used to track the state of ThreeDSRequestData + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization. Default: **false**. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestDataOption { get; private set; } + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization. Default: **false**. + [DataMember(Name = "authenticationOnly", EmitDefaultValue = false)] + public bool? AuthenticationOnly { get; set; } /// /// Gets or Sets ThreeDSRequestData /// - [JsonPropertyName("threeDSRequestData")] - public ThreeDSRequestData ThreeDSRequestData { get { return this.ThreeDSRequestDataOption; } set { this.ThreeDSRequestDataOption = new Option(value); } } + [DataMember(Name = "threeDSRequestData", EmitDefaultValue = false)] + public ThreeDSRequestData ThreeDSRequestData { get; set; } /// /// Returns the string presentation of the object @@ -169,125 +102,78 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class AuthenticationDataJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override AuthenticationData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option attemptAuthentication = default; - Option authenticationOnly = default; - Option threeDSRequestData = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "attemptAuthentication": - string attemptAuthenticationRawValue = utf8JsonReader.GetString(); - if (attemptAuthenticationRawValue != null) - attemptAuthentication = new Option(AuthenticationData.AttemptAuthenticationEnumFromStringOrDefault(attemptAuthenticationRawValue)); - break; - case "authenticationOnly": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - authenticationOnly = new Option(utf8JsonReader.GetBoolean()); - break; - case "threeDSRequestData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDSRequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (attemptAuthentication.IsSet && attemptAuthentication.Value == null) - throw new ArgumentNullException(nameof(attemptAuthentication), "Property is not nullable for class AuthenticationData."); - - if (authenticationOnly.IsSet && authenticationOnly.Value == null) - throw new ArgumentNullException(nameof(authenticationOnly), "Property is not nullable for class AuthenticationData."); - - if (threeDSRequestData.IsSet && threeDSRequestData.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestData), "Property is not nullable for class AuthenticationData."); - - return new AuthenticationData(attemptAuthentication, authenticationOnly, threeDSRequestData); + return this.Equals(input as AuthenticationData); } /// - /// Serializes a + /// Returns true if AuthenticationData instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, AuthenticationData authenticationData, JsonSerializerOptions jsonSerializerOptions) + /// Instance of AuthenticationData to be compared + /// Boolean + public bool Equals(AuthenticationData input) { - writer.WriteStartObject(); - - WriteProperties(writer, authenticationData, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AttemptAuthentication == input.AttemptAuthentication || + this.AttemptAuthentication.Equals(input.AttemptAuthentication) + ) && + ( + this.AuthenticationOnly == input.AuthenticationOnly || + this.AuthenticationOnly.Equals(input.AuthenticationOnly) + ) && + ( + this.ThreeDSRequestData == input.ThreeDSRequestData || + (this.ThreeDSRequestData != null && + this.ThreeDSRequestData.Equals(input.ThreeDSRequestData)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, AuthenticationData authenticationData, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (authenticationData.ThreeDSRequestDataOption.IsSet && authenticationData.ThreeDSRequestData == null) - throw new ArgumentNullException(nameof(authenticationData.ThreeDSRequestData), "Property is required for class AuthenticationData."); - - var attemptAuthenticationRawValue = AuthenticationData.AttemptAuthenticationEnumToJsonValue(authenticationData.AttemptAuthenticationOption.Value.Value); - writer.WriteString("attemptAuthentication", attemptAuthenticationRawValue); - if (authenticationData.AuthenticationOnlyOption.IsSet) - writer.WriteBoolean("authenticationOnly", authenticationData.AuthenticationOnlyOption.Value.Value); - - if (authenticationData.ThreeDSRequestDataOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("threeDSRequestData"); - JsonSerializer.Serialize(writer, authenticationData.ThreeDSRequestData, jsonSerializerOptions); + int hashCode = 41; + hashCode = (hashCode * 59) + this.AttemptAuthentication.GetHashCode(); + hashCode = (hashCode * 59) + this.AuthenticationOnly.GetHashCode(); + if (this.ThreeDSRequestData != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestData.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/BacsDirectDebitDetails.cs b/Adyen/Model/Checkout/BacsDirectDebitDetails.cs index 3ba351db1..e5db52c40 100644 --- a/Adyen/Model/Checkout/BacsDirectDebitDetails.cs +++ b/Adyen/Model/Checkout/BacsDirectDebitDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,212 +15,117 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// BacsDirectDebitDetails /// - public partial class BacsDirectDebitDetails : IValidatableObject + [DataContract(Name = "BacsDirectDebitDetails")] + public partial class BacsDirectDebitDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The bank account number (without separators). - /// The bank routing number of the account. - /// The checkout attempt identifier. - /// The name of the bank account holder. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. - /// **directdebit_GB** (default to TypeEnum.DirectdebitGB) - [JsonConstructor] - public BacsDirectDebitDetails(Option bankAccountNumber = default, Option bankLocationId = default, Option checkoutAttemptId = default, Option holderName = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option transferInstrumentId = default, Option type = default) - { - BankAccountNumberOption = bankAccountNumber; - BankLocationIdOption = bankLocationId; - CheckoutAttemptIdOption = checkoutAttemptId; - HolderNameOption = holderName; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TransferInstrumentIdOption = transferInstrumentId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **directdebit_GB** /// /// **directdebit_GB** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum DirectdebitGB for value: directdebit_GB /// + [EnumMember(Value = "directdebit_GB")] DirectdebitGB = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("directdebit_GB")) - return TypeEnum.DirectdebitGB; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("directdebit_GB")) - return TypeEnum.DirectdebitGB; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.DirectdebitGB) - return "directdebit_GB"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **directdebit_GB** /// /// **directdebit_GB** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of BankAccountNumber + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankAccountNumberOption { get; private set; } + /// The bank account number (without separators).. + /// The bank routing number of the account.. + /// The checkout attempt identifier.. + /// The name of the bank account holder.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts.. + /// **directdebit_GB** (default to TypeEnum.DirectdebitGB). + public BacsDirectDebitDetails(string bankAccountNumber = default(string), string bankLocationId = default(string), string checkoutAttemptId = default(string), string holderName = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string transferInstrumentId = default(string), TypeEnum? type = TypeEnum.DirectdebitGB) + { + this.BankAccountNumber = bankAccountNumber; + this.BankLocationId = bankLocationId; + this.CheckoutAttemptId = checkoutAttemptId; + this.HolderName = holderName; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.TransferInstrumentId = transferInstrumentId; + this.Type = type; + } /// /// The bank account number (without separators). /// /// The bank account number (without separators). - [JsonPropertyName("bankAccountNumber")] - public string BankAccountNumber { get { return this.BankAccountNumberOption; } set { this.BankAccountNumberOption = new Option(value); } } - - /// - /// Used to track the state of BankLocationId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankLocationIdOption { get; private set; } + [DataMember(Name = "bankAccountNumber", EmitDefaultValue = false)] + public string BankAccountNumber { get; set; } /// /// The bank routing number of the account. /// /// The bank routing number of the account. - [JsonPropertyName("bankLocationId")] - public string BankLocationId { get { return this.BankLocationIdOption; } set { this.BankLocationIdOption = new Option(value); } } - - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + [DataMember(Name = "bankLocationId", EmitDefaultValue = false)] + public string BankLocationId { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of HolderName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option HolderNameOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The name of the bank account holder. /// /// The name of the bank account holder. - [JsonPropertyName("holderName")] - public string HolderName { get { return this.HolderNameOption; } set { this.HolderNameOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "holderName", EmitDefaultValue = false)] + public string HolderName { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of TransferInstrumentId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TransferInstrumentIdOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. /// /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. - [JsonPropertyName("transferInstrumentId")] - public string TransferInstrumentId { get { return this.TransferInstrumentIdOption; } set { this.TransferInstrumentIdOption = new Option(value); } } + [DataMember(Name = "transferInstrumentId", EmitDefaultValue = false)] + public string TransferInstrumentId { get; set; } /// /// Returns the string presentation of the object @@ -242,195 +148,133 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class BacsDirectDebitDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override BacsDirectDebitDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option bankAccountNumber = default; - Option bankLocationId = default; - Option checkoutAttemptId = default; - Option holderName = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option transferInstrumentId = default; - Option type = default; + return this.Equals(input as BacsDirectDebitDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if BacsDirectDebitDetails instances are equal + /// + /// Instance of BacsDirectDebitDetails to be compared + /// Boolean + public bool Equals(BacsDirectDebitDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "bankAccountNumber": - bankAccountNumber = new Option(utf8JsonReader.GetString()); - break; - case "bankLocationId": - bankLocationId = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "holderName": - holderName = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "transferInstrumentId": - transferInstrumentId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(BacsDirectDebitDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (bankAccountNumber.IsSet && bankAccountNumber.Value == null) - throw new ArgumentNullException(nameof(bankAccountNumber), "Property is not nullable for class BacsDirectDebitDetails."); - - if (bankLocationId.IsSet && bankLocationId.Value == null) - throw new ArgumentNullException(nameof(bankLocationId), "Property is not nullable for class BacsDirectDebitDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class BacsDirectDebitDetails."); - - if (holderName.IsSet && holderName.Value == null) - throw new ArgumentNullException(nameof(holderName), "Property is not nullable for class BacsDirectDebitDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class BacsDirectDebitDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class BacsDirectDebitDetails."); - - if (transferInstrumentId.IsSet && transferInstrumentId.Value == null) - throw new ArgumentNullException(nameof(transferInstrumentId), "Property is not nullable for class BacsDirectDebitDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class BacsDirectDebitDetails."); - - return new BacsDirectDebitDetails(bankAccountNumber, bankLocationId, checkoutAttemptId, holderName, recurringDetailReference, storedPaymentMethodId, transferInstrumentId, type); + return + ( + this.BankAccountNumber == input.BankAccountNumber || + (this.BankAccountNumber != null && + this.BankAccountNumber.Equals(input.BankAccountNumber)) + ) && + ( + this.BankLocationId == input.BankLocationId || + (this.BankLocationId != null && + this.BankLocationId.Equals(input.BankLocationId)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.HolderName == input.HolderName || + (this.HolderName != null && + this.HolderName.Equals(input.HolderName)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.TransferInstrumentId == input.TransferInstrumentId || + (this.TransferInstrumentId != null && + this.TransferInstrumentId.Equals(input.TransferInstrumentId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, BacsDirectDebitDetails bacsDirectDebitDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, bacsDirectDebitDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.BankAccountNumber != null) + { + hashCode = (hashCode * 59) + this.BankAccountNumber.GetHashCode(); + } + if (this.BankLocationId != null) + { + hashCode = (hashCode * 59) + this.BankLocationId.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.HolderName != null) + { + hashCode = (hashCode * 59) + this.HolderName.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.TransferInstrumentId != null) + { + hashCode = (hashCode * 59) + this.TransferInstrumentId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, BacsDirectDebitDetails bacsDirectDebitDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (bacsDirectDebitDetails.BankAccountNumberOption.IsSet && bacsDirectDebitDetails.BankAccountNumber == null) - throw new ArgumentNullException(nameof(bacsDirectDebitDetails.BankAccountNumber), "Property is required for class BacsDirectDebitDetails."); - - if (bacsDirectDebitDetails.BankLocationIdOption.IsSet && bacsDirectDebitDetails.BankLocationId == null) - throw new ArgumentNullException(nameof(bacsDirectDebitDetails.BankLocationId), "Property is required for class BacsDirectDebitDetails."); - - if (bacsDirectDebitDetails.CheckoutAttemptIdOption.IsSet && bacsDirectDebitDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(bacsDirectDebitDetails.CheckoutAttemptId), "Property is required for class BacsDirectDebitDetails."); - - if (bacsDirectDebitDetails.HolderNameOption.IsSet && bacsDirectDebitDetails.HolderName == null) - throw new ArgumentNullException(nameof(bacsDirectDebitDetails.HolderName), "Property is required for class BacsDirectDebitDetails."); - - if (bacsDirectDebitDetails.RecurringDetailReferenceOption.IsSet && bacsDirectDebitDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(bacsDirectDebitDetails.RecurringDetailReference), "Property is required for class BacsDirectDebitDetails."); - - if (bacsDirectDebitDetails.StoredPaymentMethodIdOption.IsSet && bacsDirectDebitDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(bacsDirectDebitDetails.StoredPaymentMethodId), "Property is required for class BacsDirectDebitDetails."); - - if (bacsDirectDebitDetails.TransferInstrumentIdOption.IsSet && bacsDirectDebitDetails.TransferInstrumentId == null) - throw new ArgumentNullException(nameof(bacsDirectDebitDetails.TransferInstrumentId), "Property is required for class BacsDirectDebitDetails."); - - if (bacsDirectDebitDetails.BankAccountNumberOption.IsSet) - writer.WriteString("bankAccountNumber", bacsDirectDebitDetails.BankAccountNumber); - - if (bacsDirectDebitDetails.BankLocationIdOption.IsSet) - writer.WriteString("bankLocationId", bacsDirectDebitDetails.BankLocationId); - - if (bacsDirectDebitDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", bacsDirectDebitDetails.CheckoutAttemptId); - - if (bacsDirectDebitDetails.HolderNameOption.IsSet) - writer.WriteString("holderName", bacsDirectDebitDetails.HolderName); - - if (bacsDirectDebitDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", bacsDirectDebitDetails.RecurringDetailReference); - - if (bacsDirectDebitDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", bacsDirectDebitDetails.StoredPaymentMethodId); - - if (bacsDirectDebitDetails.TransferInstrumentIdOption.IsSet) - writer.WriteString("transferInstrumentId", bacsDirectDebitDetails.TransferInstrumentId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = BacsDirectDebitDetails.TypeEnumToJsonValue(bacsDirectDebitDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/BalanceCheckRequest.cs b/Adyen/Model/Checkout/BalanceCheckRequest.cs index d814b9622..50f294353 100644 --- a/Adyen/Model/Checkout/BalanceCheckRequest.cs +++ b/Adyen/Model/Checkout/BalanceCheckRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,877 +15,479 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// BalanceCheckRequest /// - public partial class BalanceCheckRequest : IValidatableObject + [DataContract(Name = "BalanceCheckRequest")] + public partial class BalanceCheckRequest : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The merchant account identifier, with which you want to process the transaction. - /// The collection that contains the type of the payment method and its specific information. - /// accountInfo - /// additionalAmount - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - /// applicationInfo - /// billingAddress - /// browserInfo - /// The delay between the authorisation and scheduled auto-capture, specified in hours. - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - /// dccQuote - /// deliveryAddress - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - /// An integer value that is added to the normal fraud score. The value can be either positive or negative. - /// installments - /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana and ja-Hani character set for Visa, Mastercard and JCB payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, Kanji, capital letters, numbers and special characters. * Half-width or full-width characters. - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - /// merchantRiskIndicator - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - /// recurring - /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. - /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. - /// A session ID used to identify a payment session. - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - /// The combination of a language code and a country code to specify the language to be used in the payment. - /// shopperName - /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - /// The shopper's social security number. - /// An array of objects specifying how the payment should be split when using either Adyen for Platforms for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/split-payments), or standalone [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). - /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - /// The shopper's telephone number. - /// threeDS2RequestData - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) - /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). - /// Set to true if the payment should be routed to a trusted MID. - [JsonConstructor] - public BalanceCheckRequest(Amount amount, string merchantAccount, Dictionary paymentMethod, Option accountInfo = default, Option additionalAmount = default, Option> additionalData = default, Option applicationInfo = default, Option
billingAddress = default, Option browserInfo = default, Option captureDelayHours = default, Option dateOfBirth = default, Option dccQuote = default, Option
deliveryAddress = default, Option deliveryDate = default, Option deviceFingerprint = default, Option fraudOffset = default, Option installments = default, Option> localizedShopperStatement = default, Option mcc = default, Option merchantOrderReference = default, Option merchantRiskIndicator = default, Option> metadata = default, Option orderReference = default, Option recurring = default, Option recurringProcessingModel = default, Option reference = default, Option selectedBrand = default, Option selectedRecurringDetailReference = default, Option sessionId = default, Option shopperEmail = default, Option shopperIP = default, Option shopperInteraction = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option shopperStatement = default, Option socialSecurityNumber = default, Option> splits = default, Option store = default, Option telephoneNumber = default, Option threeDS2RequestData = default, Option threeDSAuthenticationOnly = default, Option totalsGroup = default, Option trustedShopper = default) - { - Amount = amount; - MerchantAccount = merchantAccount; - PaymentMethod = paymentMethod; - AccountInfoOption = accountInfo; - AdditionalAmountOption = additionalAmount; - AdditionalDataOption = additionalData; - ApplicationInfoOption = applicationInfo; - BillingAddressOption = billingAddress; - BrowserInfoOption = browserInfo; - CaptureDelayHoursOption = captureDelayHours; - DateOfBirthOption = dateOfBirth; - DccQuoteOption = dccQuote; - DeliveryAddressOption = deliveryAddress; - DeliveryDateOption = deliveryDate; - DeviceFingerprintOption = deviceFingerprint; - FraudOffsetOption = fraudOffset; - InstallmentsOption = installments; - LocalizedShopperStatementOption = localizedShopperStatement; - MccOption = mcc; - MerchantOrderReferenceOption = merchantOrderReference; - MerchantRiskIndicatorOption = merchantRiskIndicator; - MetadataOption = metadata; - OrderReferenceOption = orderReference; - RecurringOption = recurring; - RecurringProcessingModelOption = recurringProcessingModel; - ReferenceOption = reference; - SelectedBrandOption = selectedBrand; - SelectedRecurringDetailReferenceOption = selectedRecurringDetailReference; - SessionIdOption = sessionId; - ShopperEmailOption = shopperEmail; - ShopperIPOption = shopperIP; - ShopperInteractionOption = shopperInteraction; - ShopperLocaleOption = shopperLocale; - ShopperNameOption = shopperName; - ShopperReferenceOption = shopperReference; - ShopperStatementOption = shopperStatement; - SocialSecurityNumberOption = socialSecurityNumber; - SplitsOption = splits; - StoreOption = store; - TelephoneNumberOption = telephoneNumber; - ThreeDS2RequestDataOption = threeDS2RequestData; - ThreeDSAuthenticationOnlyOption = threeDSAuthenticationOnly; - TotalsGroupOption = totalsGroup; - TrustedShopperOption = trustedShopper; - OnCreated(); - } - - partial void OnCreated(); - /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// + [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// + [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// + [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) - { - if (value == RecurringProcessingModelEnum.CardOnFile) - return "CardOnFile"; - - if (value == RecurringProcessingModelEnum.Subscription) - return "Subscription"; - if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) - return "UnscheduledCardOnFile"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of RecurringProcessingModel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonPropertyName("recurringProcessingModel")] - public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } - + [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] + public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + [JsonConverter(typeof(StringEnumConverter))] public enum ShopperInteractionEnum { /// /// Enum Ecommerce for value: Ecommerce /// + [EnumMember(Value = "Ecommerce")] Ecommerce = 1, /// /// Enum ContAuth for value: ContAuth /// + [EnumMember(Value = "ContAuth")] ContAuth = 2, /// /// Enum Moto for value: Moto /// + [EnumMember(Value = "Moto")] Moto = 3, /// /// Enum POS for value: POS /// + [EnumMember(Value = "POS")] POS = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ShopperInteractionEnum ShopperInteractionEnumFromString(string value) - { - if (value.Equals("Ecommerce")) - return ShopperInteractionEnum.Ecommerce; - - if (value.Equals("ContAuth")) - return ShopperInteractionEnum.ContAuth; - - if (value.Equals("Moto")) - return ShopperInteractionEnum.Moto; - - if (value.Equals("POS")) - return ShopperInteractionEnum.POS; - - throw new NotImplementedException($"Could not convert value to type ShopperInteractionEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ShopperInteractionEnum? ShopperInteractionEnumFromStringOrDefault(string value) - { - if (value.Equals("Ecommerce")) - return ShopperInteractionEnum.Ecommerce; - - if (value.Equals("ContAuth")) - return ShopperInteractionEnum.ContAuth; - - if (value.Equals("Moto")) - return ShopperInteractionEnum.Moto; - - if (value.Equals("POS")) - return ShopperInteractionEnum.POS; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ShopperInteractionEnumToJsonValue(ShopperInteractionEnum? value) - { - if (value == ShopperInteractionEnum.Ecommerce) - return "Ecommerce"; - - if (value == ShopperInteractionEnum.ContAuth) - return "ContAuth"; - - if (value == ShopperInteractionEnum.Moto) - return "Moto"; - if (value == ShopperInteractionEnum.POS) - return "POS"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of ShopperInteraction - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperInteractionOption { get; private set; } /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [JsonPropertyName("shopperInteraction")] - public ShopperInteractionEnum? ShopperInteraction { get { return this.ShopperInteractionOption; } set { this.ShopperInteractionOption = new Option(value); } } - - /// - /// Gets or Sets Amount - /// - [JsonPropertyName("amount")] - public Amount Amount { get; set; } - - /// - /// The merchant account identifier, with which you want to process the transaction. - /// - /// The merchant account identifier, with which you want to process the transaction. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } - + [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] + public ShopperInteractionEnum? ShopperInteraction { get; set; } /// - /// The collection that contains the type of the payment method and its specific information. + /// Initializes a new instance of the class. /// - /// The collection that contains the type of the payment method and its specific information. - [JsonPropertyName("paymentMethod")] - public Dictionary PaymentMethod { get; set; } - + [JsonConstructorAttribute] + protected BalanceCheckRequest() { } /// - /// Used to track the state of AccountInfo + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountInfoOption { get; private set; } + /// accountInfo. + /// additionalAmount. + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. + /// amount (required). + /// applicationInfo. + /// billingAddress. + /// browserInfo. + /// The delay between the authorisation and scheduled auto-capture, specified in hours.. + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. + /// dccQuote. + /// deliveryAddress. + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00. + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting).. + /// An integer value that is added to the normal fraud score. The value can be either positive or negative.. + /// installments. + /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana and ja-Hani character set for Visa, Mastercard and JCB payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, Kanji, capital letters, numbers and special characters. * Half-width or full-width characters.. + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. + /// The merchant account identifier, with which you want to process the transaction. (required). + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.. + /// merchantRiskIndicator. + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. . + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead.. + /// The collection that contains the type of the payment method and its specific information. (required). + /// recurring. + /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.. + /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card.. + /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail.. + /// A session ID used to identify a payment session.. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > Required for Visa and JCB transactions that require 3D Secure 2 authentication if you did not include the `telephoneNumber`.. + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new).. + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. + /// The combination of a language code and a country code to specify the language to be used in the payment.. + /// shopperName. + /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. + /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**.. + /// The shopper's social security number.. + /// An array of objects specifying how the payment should be split when using either Adyen for Platforms for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/split-payments), or standalone [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split).. + /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment.. + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication.. + /// threeDS2RequestData. + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. (default to false). + /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available).. + /// Set to true if the payment should be routed to a trusted MID.. + public BalanceCheckRequest(AccountInfo accountInfo = default(AccountInfo), Amount additionalAmount = default(Amount), Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), Address billingAddress = default(Address), BrowserInfo browserInfo = default(BrowserInfo), int? captureDelayHours = default(int?), DateTime dateOfBirth = default(DateTime), ForexQuote dccQuote = default(ForexQuote), Address deliveryAddress = default(Address), DateTime deliveryDate = default(DateTime), string deviceFingerprint = default(string), int? fraudOffset = default(int?), Installments installments = default(Installments), Dictionary localizedShopperStatement = default(Dictionary), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), MerchantRiskIndicator merchantRiskIndicator = default(MerchantRiskIndicator), Dictionary metadata = default(Dictionary), string orderReference = default(string), Dictionary paymentMethod = default(Dictionary), Recurring recurring = default(Recurring), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string reference = default(string), string selectedBrand = default(string), string selectedRecurringDetailReference = default(string), string sessionId = default(string), string shopperEmail = default(string), string shopperIP = default(string), ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), string socialSecurityNumber = default(string), List splits = default(List), string store = default(string), string telephoneNumber = default(string), ThreeDS2RequestData threeDS2RequestData = default(ThreeDS2RequestData), bool? threeDSAuthenticationOnly = false, string totalsGroup = default(string), bool? trustedShopper = default(bool?)) + { + this.Amount = amount; + this.MerchantAccount = merchantAccount; + this.PaymentMethod = paymentMethod; + this.AccountInfo = accountInfo; + this.AdditionalAmount = additionalAmount; + this.AdditionalData = additionalData; + this.ApplicationInfo = applicationInfo; + this.BillingAddress = billingAddress; + this.BrowserInfo = browserInfo; + this.CaptureDelayHours = captureDelayHours; + this.DateOfBirth = dateOfBirth; + this.DccQuote = dccQuote; + this.DeliveryAddress = deliveryAddress; + this.DeliveryDate = deliveryDate; + this.DeviceFingerprint = deviceFingerprint; + this.FraudOffset = fraudOffset; + this.Installments = installments; + this.LocalizedShopperStatement = localizedShopperStatement; + this.Mcc = mcc; + this.MerchantOrderReference = merchantOrderReference; + this.MerchantRiskIndicator = merchantRiskIndicator; + this.Metadata = metadata; + this.OrderReference = orderReference; + this.Recurring = recurring; + this.RecurringProcessingModel = recurringProcessingModel; + this.Reference = reference; + this.SelectedBrand = selectedBrand; + this.SelectedRecurringDetailReference = selectedRecurringDetailReference; + this.SessionId = sessionId; + this.ShopperEmail = shopperEmail; + this.ShopperIP = shopperIP; + this.ShopperInteraction = shopperInteraction; + this.ShopperLocale = shopperLocale; + this.ShopperName = shopperName; + this.ShopperReference = shopperReference; + this.ShopperStatement = shopperStatement; + this.SocialSecurityNumber = socialSecurityNumber; + this.Splits = splits; + this.Store = store; + this.TelephoneNumber = telephoneNumber; + this.ThreeDS2RequestData = threeDS2RequestData; + this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; + this.TotalsGroup = totalsGroup; + this.TrustedShopper = trustedShopper; + } /// /// Gets or Sets AccountInfo /// - [JsonPropertyName("accountInfo")] - public AccountInfo AccountInfo { get { return this.AccountInfoOption; } set { this.AccountInfoOption = new Option(value); } } - - /// - /// Used to track the state of AdditionalAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AdditionalAmountOption { get; private set; } + [DataMember(Name = "accountInfo", EmitDefaultValue = false)] + public AccountInfo AccountInfo { get; set; } /// /// Gets or Sets AdditionalAmount /// - [JsonPropertyName("additionalAmount")] - public Amount AdditionalAmount { get { return this.AdditionalAmountOption; } set { this.AdditionalAmountOption = new Option(value); } } - - /// - /// Used to track the state of AdditionalData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AdditionalDataOption { get; private set; } + [DataMember(Name = "additionalAmount", EmitDefaultValue = false)] + public Amount AdditionalAmount { get; set; } /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - [JsonPropertyName("additionalData")] - public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } /// - /// Used to track the state of ApplicationInfo + /// Gets or Sets Amount /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ApplicationInfoOption { get; private set; } + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// Gets or Sets ApplicationInfo /// - [JsonPropertyName("applicationInfo")] - public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } - - /// - /// Used to track the state of BillingAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option
BillingAddressOption { get; private set; } + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } /// /// Gets or Sets BillingAddress /// - [JsonPropertyName("billingAddress")] - public Address BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option
(value); } } - - /// - /// Used to track the state of BrowserInfo - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BrowserInfoOption { get; private set; } + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public Address BillingAddress { get; set; } /// /// Gets or Sets BrowserInfo /// - [JsonPropertyName("browserInfo")] - public BrowserInfo BrowserInfo { get { return this.BrowserInfoOption; } set { this.BrowserInfoOption = new Option(value); } } - - /// - /// Used to track the state of CaptureDelayHours - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CaptureDelayHoursOption { get; private set; } + [DataMember(Name = "browserInfo", EmitDefaultValue = false)] + public BrowserInfo BrowserInfo { get; set; } /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. - [JsonPropertyName("captureDelayHours")] - public int? CaptureDelayHours { get { return this.CaptureDelayHoursOption; } set { this.CaptureDelayHoursOption = new Option(value); } } - - /// - /// Used to track the state of DateOfBirth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DateOfBirthOption { get; private set; } + [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] + public int? CaptureDelayHours { get; set; } /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - [JsonPropertyName("dateOfBirth")] - public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } - - /// - /// Used to track the state of DccQuote - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DccQuoteOption { get; private set; } + [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime DateOfBirth { get; set; } /// /// Gets or Sets DccQuote /// - [JsonPropertyName("dccQuote")] - public ForexQuote DccQuote { get { return this.DccQuoteOption; } set { this.DccQuoteOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option
DeliveryAddressOption { get; private set; } + [DataMember(Name = "dccQuote", EmitDefaultValue = false)] + public ForexQuote DccQuote { get; set; } /// /// Gets or Sets DeliveryAddress /// - [JsonPropertyName("deliveryAddress")] - public Address DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option
(value); } } - - /// - /// Used to track the state of DeliveryDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryDateOption { get; private set; } + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public Address DeliveryAddress { get; set; } /// /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 /// /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - [JsonPropertyName("deliveryDate")] - public DateTime? DeliveryDate { get { return this.DeliveryDateOption; } set { this.DeliveryDateOption = new Option(value); } } - - /// - /// Used to track the state of DeviceFingerprint - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeviceFingerprintOption { get; private set; } + [DataMember(Name = "deliveryDate", EmitDefaultValue = false)] + public DateTime DeliveryDate { get; set; } /// /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). /// /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - [JsonPropertyName("deviceFingerprint")] - public string DeviceFingerprint { get { return this.DeviceFingerprintOption; } set { this.DeviceFingerprintOption = new Option(value); } } - - /// - /// Used to track the state of FraudOffset - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FraudOffsetOption { get; private set; } + [DataMember(Name = "deviceFingerprint", EmitDefaultValue = false)] + public string DeviceFingerprint { get; set; } /// /// An integer value that is added to the normal fraud score. The value can be either positive or negative. /// /// An integer value that is added to the normal fraud score. The value can be either positive or negative. - [JsonPropertyName("fraudOffset")] - public int? FraudOffset { get { return this.FraudOffsetOption; } set { this.FraudOffsetOption = new Option(value); } } - - /// - /// Used to track the state of Installments - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentsOption { get; private set; } + [DataMember(Name = "fraudOffset", EmitDefaultValue = false)] + public int? FraudOffset { get; set; } /// /// Gets or Sets Installments /// - [JsonPropertyName("installments")] - public Installments Installments { get { return this.InstallmentsOption; } set { this.InstallmentsOption = new Option(value); } } - - /// - /// Used to track the state of LocalizedShopperStatement - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LocalizedShopperStatementOption { get; private set; } + [DataMember(Name = "installments", EmitDefaultValue = false)] + public Installments Installments { get; set; } /// /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana and ja-Hani character set for Visa, Mastercard and JCB payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, Kanji, capital letters, numbers and special characters. * Half-width or full-width characters. /// /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana and ja-Hani character set for Visa, Mastercard and JCB payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, Kanji, capital letters, numbers and special characters. * Half-width or full-width characters. - [JsonPropertyName("localizedShopperStatement")] - public Dictionary LocalizedShopperStatement { get { return this.LocalizedShopperStatementOption; } set { this.LocalizedShopperStatementOption = new Option>(value); } } - - /// - /// Used to track the state of Mcc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MccOption { get; private set; } + [DataMember(Name = "localizedShopperStatement", EmitDefaultValue = false)] + public Dictionary LocalizedShopperStatement { get; set; } /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - [JsonPropertyName("mcc")] - public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string Mcc { get; set; } /// - /// Used to track the state of MerchantOrderReference + /// The merchant account identifier, with which you want to process the transaction. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantOrderReferenceOption { get; private set; } + /// The merchant account identifier, with which you want to process the transaction. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. /// /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - [JsonPropertyName("merchantOrderReference")] - public string MerchantOrderReference { get { return this.MerchantOrderReferenceOption; } set { this.MerchantOrderReferenceOption = new Option(value); } } - - /// - /// Used to track the state of MerchantRiskIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantRiskIndicatorOption { get; private set; } + [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] + public string MerchantOrderReference { get; set; } /// /// Gets or Sets MerchantRiskIndicator /// - [JsonPropertyName("merchantRiskIndicator")] - public MerchantRiskIndicator MerchantRiskIndicator { get { return this.MerchantRiskIndicatorOption; } set { this.MerchantRiskIndicatorOption = new Option(value); } } - - /// - /// Used to track the state of Metadata - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> MetadataOption { get; private set; } + [DataMember(Name = "merchantRiskIndicator", EmitDefaultValue = false)] + public MerchantRiskIndicator MerchantRiskIndicator { get; set; } /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - [JsonPropertyName("metadata")] - public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } - - /// - /// Used to track the state of OrderReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OrderReferenceOption { get; private set; } + [DataMember(Name = "metadata", EmitDefaultValue = false)] + public Dictionary Metadata { get; set; } /// /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. /// /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - [JsonPropertyName("orderReference")] - public string OrderReference { get { return this.OrderReferenceOption; } set { this.OrderReferenceOption = new Option(value); } } + [DataMember(Name = "orderReference", EmitDefaultValue = false)] + public string OrderReference { get; set; } /// - /// Used to track the state of Recurring + /// The collection that contains the type of the payment method and its specific information. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringOption { get; private set; } + /// The collection that contains the type of the payment method and its specific information. + [DataMember(Name = "paymentMethod", IsRequired = false, EmitDefaultValue = false)] + public Dictionary PaymentMethod { get; set; } /// /// Gets or Sets Recurring /// - [JsonPropertyName("recurring")] - public Recurring Recurring { get { return this.RecurringOption; } set { this.RecurringOption = new Option(value); } } - - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + [DataMember(Name = "recurring", EmitDefaultValue = false)] + public Recurring Recurring { get; set; } /// /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. /// /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } - - /// - /// Used to track the state of SelectedBrand - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SelectedBrandOption { get; private set; } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. /// /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. - [JsonPropertyName("selectedBrand")] - public string SelectedBrand { get { return this.SelectedBrandOption; } set { this.SelectedBrandOption = new Option(value); } } - - /// - /// Used to track the state of SelectedRecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SelectedRecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "selectedBrand", EmitDefaultValue = false)] + public string SelectedBrand { get; set; } /// /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. /// /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. - [JsonPropertyName("selectedRecurringDetailReference")] - public string SelectedRecurringDetailReference { get { return this.SelectedRecurringDetailReferenceOption; } set { this.SelectedRecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of SessionId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SessionIdOption { get; private set; } + [DataMember(Name = "selectedRecurringDetailReference", EmitDefaultValue = false)] + public string SelectedRecurringDetailReference { get; set; } /// /// A session ID used to identify a payment session. /// /// A session ID used to identify a payment session. - [JsonPropertyName("sessionId")] - public string SessionId { get { return this.SessionIdOption; } set { this.SessionIdOption = new Option(value); } } + [DataMember(Name = "sessionId", EmitDefaultValue = false)] + public string SessionId { get; set; } /// - /// Used to track the state of ShopperEmail + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > Required for Visa and JCB transactions that require 3D Secure 2 authentication if you did not include the `telephoneNumber`. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > Required for Visa and JCB transactions that require 3D Secure 2 authentication if you did not include the `telephoneNumber`. + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } - - /// - /// Used to track the state of ShopperIP - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperIPOption { get; private set; } - - /// - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - /// - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - [JsonPropertyName("shopperIP")] - public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } - - /// - /// Used to track the state of ShopperLocale - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperLocaleOption { get; private set; } + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + [DataMember(Name = "shopperIP", EmitDefaultValue = false)] + public string ShopperIP { get; set; } /// /// The combination of a language code and a country code to specify the language to be used in the payment. /// /// The combination of a language code and a country code to specify the language to be used in the payment. - [JsonPropertyName("shopperLocale")] - public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } - - /// - /// Used to track the state of ShopperName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNameOption { get; private set; } + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + public string ShopperLocale { get; set; } /// /// Gets or Sets ShopperName /// - [JsonPropertyName("shopperName")] - public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } - - /// - /// Used to track the state of ShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperReferenceOption { get; private set; } + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name ShopperName { get; set; } /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [JsonPropertyName("shopperReference")] - public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperStatement - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperStatementOption { get; private set; } + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - [JsonPropertyName("shopperStatement")] - public string ShopperStatement { get { return this.ShopperStatementOption; } set { this.ShopperStatementOption = new Option(value); } } - - /// - /// Used to track the state of SocialSecurityNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SocialSecurityNumberOption { get; private set; } + [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] + public string ShopperStatement { get; set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [JsonPropertyName("socialSecurityNumber")] - public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } - - /// - /// Used to track the state of Splits - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SplitsOption { get; private set; } + [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] + public string SocialSecurityNumber { get; set; } /// /// An array of objects specifying how the payment should be split when using either Adyen for Platforms for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/split-payments), or standalone [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). /// /// An array of objects specifying how the payment should be split when using either Adyen for Platforms for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/split-payments), or standalone [Issuing](https://docs.adyen.com/issuing/add-manage-funds#split). - [JsonPropertyName("splits")] - public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } - - /// - /// Used to track the state of Store - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoreOption { get; private set; } + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - [JsonPropertyName("store")] - public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } - - /// - /// Used to track the state of TelephoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TelephoneNumberOption { get; private set; } + [DataMember(Name = "store", EmitDefaultValue = false)] + public string Store { get; set; } /// - /// The shopper's telephone number. + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. /// - /// The shopper's telephone number. - [JsonPropertyName("telephoneNumber")] - public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2RequestData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2RequestDataOption { get; private set; } + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string TelephoneNumber { get; set; } /// /// Gets or Sets ThreeDS2RequestData /// - [JsonPropertyName("threeDS2RequestData")] - public ThreeDS2RequestData ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } + [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] + public ThreeDS2RequestData ThreeDS2RequestData { get; set; } /// - /// Used to track the state of ThreeDSAuthenticationOnly + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSAuthenticationOnlyOption { get; private set; } - - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [JsonPropertyName("threeDSAuthenticationOnly")] - [Obsolete] - public bool? ThreeDSAuthenticationOnly { get { return this.ThreeDSAuthenticationOnlyOption; } set { this.ThreeDSAuthenticationOnlyOption = new Option(value); } } - - /// - /// Used to track the state of TotalsGroup - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TotalsGroupOption { get; private set; } + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. + [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.authenticationOnly` instead.")] + public bool? ThreeDSAuthenticationOnly { get; set; } /// /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). /// /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). - [JsonPropertyName("totalsGroup")] - public string TotalsGroup { get { return this.TotalsGroupOption; } set { this.TotalsGroupOption = new Option(value); } } - - /// - /// Used to track the state of TrustedShopper - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TrustedShopperOption { get; private set; } + [DataMember(Name = "totalsGroup", EmitDefaultValue = false)] + public string TotalsGroup { get; set; } /// /// Set to true if the payment should be routed to a trusted MID. /// /// Set to true if the payment should be routed to a trusted MID. - [JsonPropertyName("trustedShopper")] - public bool? TrustedShopper { get { return this.TrustedShopperOption; } set { this.TrustedShopperOption = new Option(value); } } + [DataMember(Name = "trustedShopper", EmitDefaultValue = false)] + public bool? TrustedShopper { get; set; } /// /// Returns the string presentation of the object @@ -894,12 +497,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class BalanceCheckRequest {\n"); - sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); - sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); sb.Append(" AccountInfo: ").Append(AccountInfo).Append("\n"); sb.Append(" AdditionalAmount: ").Append(AdditionalAmount).Append("\n"); sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); sb.Append(" BrowserInfo: ").Append(BrowserInfo).Append("\n"); @@ -913,10 +514,12 @@ public override string ToString() sb.Append(" Installments: ").Append(Installments).Append("\n"); sb.Append(" LocalizedShopperStatement: ").Append(LocalizedShopperStatement).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); sb.Append(" MerchantRiskIndicator: ").Append(MerchantRiskIndicator).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append(" OrderReference: ").Append(OrderReference).Append("\n"); + sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); sb.Append(" Recurring: ").Append(Recurring).Append("\n"); sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); @@ -943,738 +546,466 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // DeviceFingerprint (string) maxLength - if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) - { - yield return new ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); - } - - // Store (string) maxLength - if (this.Store != null && this.Store.Length > 16) - { - yield return new ValidationResult("Invalid value for Store, length must be less than 16.", new [] { "Store" }); - } - - // Store (string) minLength - if (this.Store != null && this.Store.Length < 1) - { - yield return new ValidationResult("Invalid value for Store, length must be greater than 1.", new [] { "Store" }); - } - - // TotalsGroup (string) maxLength - if (this.TotalsGroup != null && this.TotalsGroup.Length > 16) - { - yield return new ValidationResult("Invalid value for TotalsGroup, length must be less than 16.", new [] { "TotalsGroup" }); - } - - // TotalsGroup (string) minLength - if (this.TotalsGroup != null && this.TotalsGroup.Length < 1) - { - yield return new ValidationResult("Invalid value for TotalsGroup, length must be greater than 1.", new [] { "TotalsGroup" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - - /// - /// A Json converter for type - /// - public class BalanceCheckRequestJsonConverter : JsonConverter - { - /// - /// The format to use to serialize DateOfBirth - /// - public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd"; /// - /// The format to use to serialize DeliveryDate + /// Returns true if objects are equal /// - public static string DeliveryDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BalanceCheckRequest); + } /// - /// Deserializes json to + /// Returns true if BalanceCheckRequest instances are equal /// - /// - /// - /// - /// - /// - public override BalanceCheckRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Instance of BalanceCheckRequest to be compared + /// Boolean + public bool Equals(BalanceCheckRequest input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option merchantAccount = default; - Option> paymentMethod = default; - Option accountInfo = default; - Option additionalAmount = default; - Option> additionalData = default; - Option applicationInfo = default; - Option
billingAddress = default; - Option browserInfo = default; - Option captureDelayHours = default; - Option dateOfBirth = default; - Option dccQuote = default; - Option
deliveryAddress = default; - Option deliveryDate = default; - Option deviceFingerprint = default; - Option fraudOffset = default; - Option installments = default; - Option> localizedShopperStatement = default; - Option mcc = default; - Option merchantOrderReference = default; - Option merchantRiskIndicator = default; - Option> metadata = default; - Option orderReference = default; - Option recurring = default; - Option recurringProcessingModel = default; - Option reference = default; - Option selectedBrand = default; - Option selectedRecurringDetailReference = default; - Option sessionId = default; - Option shopperEmail = default; - Option shopperIP = default; - Option shopperInteraction = default; - Option shopperLocale = default; - Option shopperName = default; - Option shopperReference = default; - Option shopperStatement = default; - Option socialSecurityNumber = default; - Option> splits = default; - Option store = default; - Option telephoneNumber = default; - Option threeDS2RequestData = default; - Option threeDSAuthenticationOnly = default; - Option totalsGroup = default; - Option trustedShopper = default; - - while (utf8JsonReader.Read()) + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethod": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - paymentMethod = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "accountInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - accountInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "additionalAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "additionalData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "applicationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "billingAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - billingAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "browserInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - browserInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "captureDelayHours": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - captureDelayHours = new Option(utf8JsonReader.GetInt32()); - break; - case "dateOfBirth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "dccQuote": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dccQuote = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliveryAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliveryAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliveryDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliveryDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deviceFingerprint": - deviceFingerprint = new Option(utf8JsonReader.GetString()); - break; - case "fraudOffset": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fraudOffset = new Option(utf8JsonReader.GetInt32()); - break; - case "installments": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - installments = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "localizedShopperStatement": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - localizedShopperStatement = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mcc": - mcc = new Option(utf8JsonReader.GetString()); - break; - case "merchantOrderReference": - merchantOrderReference = new Option(utf8JsonReader.GetString()); - break; - case "merchantRiskIndicator": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - merchantRiskIndicator = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "metadata": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "orderReference": - orderReference = new Option(utf8JsonReader.GetString()); - break; - case "recurring": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - recurring = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "recurringProcessingModel": - string recurringProcessingModelRawValue = utf8JsonReader.GetString(); - if (recurringProcessingModelRawValue != null) - recurringProcessingModel = new Option(BalanceCheckRequest.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "selectedBrand": - selectedBrand = new Option(utf8JsonReader.GetString()); - break; - case "selectedRecurringDetailReference": - selectedRecurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "sessionId": - sessionId = new Option(utf8JsonReader.GetString()); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "shopperIP": - shopperIP = new Option(utf8JsonReader.GetString()); - break; - case "shopperInteraction": - string shopperInteractionRawValue = utf8JsonReader.GetString(); - if (shopperInteractionRawValue != null) - shopperInteraction = new Option(BalanceCheckRequest.ShopperInteractionEnumFromStringOrDefault(shopperInteractionRawValue)); - break; - case "shopperLocale": - shopperLocale = new Option(utf8JsonReader.GetString()); - break; - case "shopperName": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperReference": - shopperReference = new Option(utf8JsonReader.GetString()); - break; - case "shopperStatement": - shopperStatement = new Option(utf8JsonReader.GetString()); - break; - case "socialSecurityNumber": - socialSecurityNumber = new Option(utf8JsonReader.GetString()); - break; - case "splits": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "store": - store = new Option(utf8JsonReader.GetString()); - break; - case "telephoneNumber": - telephoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2RequestData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDSAuthenticationOnly": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDSAuthenticationOnly = new Option(utf8JsonReader.GetBoolean()); - break; - case "totalsGroup": - totalsGroup = new Option(utf8JsonReader.GetString()); - break; - case "trustedShopper": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - trustedShopper = new Option(utf8JsonReader.GetBoolean()); - break; - default: - break; - } - } + return false; } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class BalanceCheckRequest.", nameof(amount)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class BalanceCheckRequest.", nameof(merchantAccount)); - - if (!paymentMethod.IsSet) - throw new ArgumentException("Property is required for class BalanceCheckRequest.", nameof(paymentMethod)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class BalanceCheckRequest."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class BalanceCheckRequest."); - - if (paymentMethod.IsSet && paymentMethod.Value == null) - throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class BalanceCheckRequest."); - - if (accountInfo.IsSet && accountInfo.Value == null) - throw new ArgumentNullException(nameof(accountInfo), "Property is not nullable for class BalanceCheckRequest."); - - if (additionalAmount.IsSet && additionalAmount.Value == null) - throw new ArgumentNullException(nameof(additionalAmount), "Property is not nullable for class BalanceCheckRequest."); - - if (additionalData.IsSet && additionalData.Value == null) - throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class BalanceCheckRequest."); - - if (applicationInfo.IsSet && applicationInfo.Value == null) - throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class BalanceCheckRequest."); - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class BalanceCheckRequest."); - - if (browserInfo.IsSet && browserInfo.Value == null) - throw new ArgumentNullException(nameof(browserInfo), "Property is not nullable for class BalanceCheckRequest."); - - if (captureDelayHours.IsSet && captureDelayHours.Value == null) - throw new ArgumentNullException(nameof(captureDelayHours), "Property is not nullable for class BalanceCheckRequest."); - - if (dateOfBirth.IsSet && dateOfBirth.Value == null) - throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class BalanceCheckRequest."); - - if (dccQuote.IsSet && dccQuote.Value == null) - throw new ArgumentNullException(nameof(dccQuote), "Property is not nullable for class BalanceCheckRequest."); - - if (deliveryAddress.IsSet && deliveryAddress.Value == null) - throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class BalanceCheckRequest."); - - if (deliveryDate.IsSet && deliveryDate.Value == null) - throw new ArgumentNullException(nameof(deliveryDate), "Property is not nullable for class BalanceCheckRequest."); - - if (deviceFingerprint.IsSet && deviceFingerprint.Value == null) - throw new ArgumentNullException(nameof(deviceFingerprint), "Property is not nullable for class BalanceCheckRequest."); - - if (fraudOffset.IsSet && fraudOffset.Value == null) - throw new ArgumentNullException(nameof(fraudOffset), "Property is not nullable for class BalanceCheckRequest."); - - if (installments.IsSet && installments.Value == null) - throw new ArgumentNullException(nameof(installments), "Property is not nullable for class BalanceCheckRequest."); - - if (localizedShopperStatement.IsSet && localizedShopperStatement.Value == null) - throw new ArgumentNullException(nameof(localizedShopperStatement), "Property is not nullable for class BalanceCheckRequest."); - - if (mcc.IsSet && mcc.Value == null) - throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class BalanceCheckRequest."); - - if (merchantOrderReference.IsSet && merchantOrderReference.Value == null) - throw new ArgumentNullException(nameof(merchantOrderReference), "Property is not nullable for class BalanceCheckRequest."); - - if (merchantRiskIndicator.IsSet && merchantRiskIndicator.Value == null) - throw new ArgumentNullException(nameof(merchantRiskIndicator), "Property is not nullable for class BalanceCheckRequest."); - - if (metadata.IsSet && metadata.Value == null) - throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class BalanceCheckRequest."); - - if (orderReference.IsSet && orderReference.Value == null) - throw new ArgumentNullException(nameof(orderReference), "Property is not nullable for class BalanceCheckRequest."); - - if (recurring.IsSet && recurring.Value == null) - throw new ArgumentNullException(nameof(recurring), "Property is not nullable for class BalanceCheckRequest."); - - if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) - throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class BalanceCheckRequest."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class BalanceCheckRequest."); - - if (selectedBrand.IsSet && selectedBrand.Value == null) - throw new ArgumentNullException(nameof(selectedBrand), "Property is not nullable for class BalanceCheckRequest."); - - if (selectedRecurringDetailReference.IsSet && selectedRecurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(selectedRecurringDetailReference), "Property is not nullable for class BalanceCheckRequest."); - - if (sessionId.IsSet && sessionId.Value == null) - throw new ArgumentNullException(nameof(sessionId), "Property is not nullable for class BalanceCheckRequest."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class BalanceCheckRequest."); - - if (shopperIP.IsSet && shopperIP.Value == null) - throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class BalanceCheckRequest."); - - if (shopperInteraction.IsSet && shopperInteraction.Value == null) - throw new ArgumentNullException(nameof(shopperInteraction), "Property is not nullable for class BalanceCheckRequest."); - - if (shopperLocale.IsSet && shopperLocale.Value == null) - throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class BalanceCheckRequest."); - - if (shopperName.IsSet && shopperName.Value == null) - throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class BalanceCheckRequest."); - - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class BalanceCheckRequest."); - - if (shopperStatement.IsSet && shopperStatement.Value == null) - throw new ArgumentNullException(nameof(shopperStatement), "Property is not nullable for class BalanceCheckRequest."); - - if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) - throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class BalanceCheckRequest."); - - if (splits.IsSet && splits.Value == null) - throw new ArgumentNullException(nameof(splits), "Property is not nullable for class BalanceCheckRequest."); - - if (store.IsSet && store.Value == null) - throw new ArgumentNullException(nameof(store), "Property is not nullable for class BalanceCheckRequest."); - - if (telephoneNumber.IsSet && telephoneNumber.Value == null) - throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class BalanceCheckRequest."); - - if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) - throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class BalanceCheckRequest."); - - if (threeDSAuthenticationOnly.IsSet && threeDSAuthenticationOnly.Value == null) - throw new ArgumentNullException(nameof(threeDSAuthenticationOnly), "Property is not nullable for class BalanceCheckRequest."); - - if (totalsGroup.IsSet && totalsGroup.Value == null) - throw new ArgumentNullException(nameof(totalsGroup), "Property is not nullable for class BalanceCheckRequest."); - - if (trustedShopper.IsSet && trustedShopper.Value == null) - throw new ArgumentNullException(nameof(trustedShopper), "Property is not nullable for class BalanceCheckRequest."); - - return new BalanceCheckRequest(amount.Value, merchantAccount.Value, paymentMethod.Value, accountInfo, additionalAmount, additionalData, applicationInfo, billingAddress, browserInfo, captureDelayHours, dateOfBirth, dccQuote, deliveryAddress, deliveryDate, deviceFingerprint, fraudOffset, installments, localizedShopperStatement, mcc, merchantOrderReference, merchantRiskIndicator, metadata, orderReference, recurring, recurringProcessingModel, reference, selectedBrand, selectedRecurringDetailReference, sessionId, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, socialSecurityNumber, splits, store, telephoneNumber, threeDS2RequestData, threeDSAuthenticationOnly, totalsGroup, trustedShopper); + return + ( + this.AccountInfo == input.AccountInfo || + (this.AccountInfo != null && + this.AccountInfo.Equals(input.AccountInfo)) + ) && + ( + this.AdditionalAmount == input.AdditionalAmount || + (this.AdditionalAmount != null && + this.AdditionalAmount.Equals(input.AdditionalAmount)) + ) && + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + input.AdditionalData != null && + this.AdditionalData.SequenceEqual(input.AdditionalData) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.ApplicationInfo == input.ApplicationInfo || + (this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo)) + ) && + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.BrowserInfo == input.BrowserInfo || + (this.BrowserInfo != null && + this.BrowserInfo.Equals(input.BrowserInfo)) + ) && + ( + this.CaptureDelayHours == input.CaptureDelayHours || + this.CaptureDelayHours.Equals(input.CaptureDelayHours) + ) && + ( + this.DateOfBirth == input.DateOfBirth || + (this.DateOfBirth != null && + this.DateOfBirth.Equals(input.DateOfBirth)) + ) && + ( + this.DccQuote == input.DccQuote || + (this.DccQuote != null && + this.DccQuote.Equals(input.DccQuote)) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + (this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress)) + ) && + ( + this.DeliveryDate == input.DeliveryDate || + (this.DeliveryDate != null && + this.DeliveryDate.Equals(input.DeliveryDate)) + ) && + ( + this.DeviceFingerprint == input.DeviceFingerprint || + (this.DeviceFingerprint != null && + this.DeviceFingerprint.Equals(input.DeviceFingerprint)) + ) && + ( + this.FraudOffset == input.FraudOffset || + this.FraudOffset.Equals(input.FraudOffset) + ) && + ( + this.Installments == input.Installments || + (this.Installments != null && + this.Installments.Equals(input.Installments)) + ) && + ( + this.LocalizedShopperStatement == input.LocalizedShopperStatement || + this.LocalizedShopperStatement != null && + input.LocalizedShopperStatement != null && + this.LocalizedShopperStatement.SequenceEqual(input.LocalizedShopperStatement) + ) && + ( + this.Mcc == input.Mcc || + (this.Mcc != null && + this.Mcc.Equals(input.Mcc)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.MerchantOrderReference == input.MerchantOrderReference || + (this.MerchantOrderReference != null && + this.MerchantOrderReference.Equals(input.MerchantOrderReference)) + ) && + ( + this.MerchantRiskIndicator == input.MerchantRiskIndicator || + (this.MerchantRiskIndicator != null && + this.MerchantRiskIndicator.Equals(input.MerchantRiskIndicator)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.OrderReference == input.OrderReference || + (this.OrderReference != null && + this.OrderReference.Equals(input.OrderReference)) + ) && + ( + this.PaymentMethod == input.PaymentMethod || + this.PaymentMethod != null && + input.PaymentMethod != null && + this.PaymentMethod.SequenceEqual(input.PaymentMethod) + ) && + ( + this.Recurring == input.Recurring || + (this.Recurring != null && + this.Recurring.Equals(input.Recurring)) + ) && + ( + this.RecurringProcessingModel == input.RecurringProcessingModel || + this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.SelectedBrand == input.SelectedBrand || + (this.SelectedBrand != null && + this.SelectedBrand.Equals(input.SelectedBrand)) + ) && + ( + this.SelectedRecurringDetailReference == input.SelectedRecurringDetailReference || + (this.SelectedRecurringDetailReference != null && + this.SelectedRecurringDetailReference.Equals(input.SelectedRecurringDetailReference)) + ) && + ( + this.SessionId == input.SessionId || + (this.SessionId != null && + this.SessionId.Equals(input.SessionId)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.ShopperIP == input.ShopperIP || + (this.ShopperIP != null && + this.ShopperIP.Equals(input.ShopperIP)) + ) && + ( + this.ShopperInteraction == input.ShopperInteraction || + this.ShopperInteraction.Equals(input.ShopperInteraction) + ) && + ( + this.ShopperLocale == input.ShopperLocale || + (this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale)) + ) && + ( + this.ShopperName == input.ShopperName || + (this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName)) + ) && + ( + this.ShopperReference == input.ShopperReference || + (this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference)) + ) && + ( + this.ShopperStatement == input.ShopperStatement || + (this.ShopperStatement != null && + this.ShopperStatement.Equals(input.ShopperStatement)) + ) && + ( + this.SocialSecurityNumber == input.SocialSecurityNumber || + (this.SocialSecurityNumber != null && + this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.Store == input.Store || + (this.Store != null && + this.Store.Equals(input.Store)) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + (this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber)) + ) && + ( + this.ThreeDS2RequestData == input.ThreeDS2RequestData || + (this.ThreeDS2RequestData != null && + this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) + ) && + ( + this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || + this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) + ) && + ( + this.TotalsGroup == input.TotalsGroup || + (this.TotalsGroup != null && + this.TotalsGroup.Equals(input.TotalsGroup)) + ) && + ( + this.TrustedShopper == input.TrustedShopper || + this.TrustedShopper.Equals(input.TrustedShopper) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, BalanceCheckRequest balanceCheckRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, balanceCheckRequest, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AccountInfo != null) + { + hashCode = (hashCode * 59) + this.AccountInfo.GetHashCode(); + } + if (this.AdditionalAmount != null) + { + hashCode = (hashCode * 59) + this.AdditionalAmount.GetHashCode(); + } + if (this.AdditionalData != null) + { + hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.ApplicationInfo != null) + { + hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); + } + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.BrowserInfo != null) + { + hashCode = (hashCode * 59) + this.BrowserInfo.GetHashCode(); + } + hashCode = (hashCode * 59) + this.CaptureDelayHours.GetHashCode(); + if (this.DateOfBirth != null) + { + hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); + } + if (this.DccQuote != null) + { + hashCode = (hashCode * 59) + this.DccQuote.GetHashCode(); + } + if (this.DeliveryAddress != null) + { + hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); + } + if (this.DeliveryDate != null) + { + hashCode = (hashCode * 59) + this.DeliveryDate.GetHashCode(); + } + if (this.DeviceFingerprint != null) + { + hashCode = (hashCode * 59) + this.DeviceFingerprint.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FraudOffset.GetHashCode(); + if (this.Installments != null) + { + hashCode = (hashCode * 59) + this.Installments.GetHashCode(); + } + if (this.LocalizedShopperStatement != null) + { + hashCode = (hashCode * 59) + this.LocalizedShopperStatement.GetHashCode(); + } + if (this.Mcc != null) + { + hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.MerchantOrderReference != null) + { + hashCode = (hashCode * 59) + this.MerchantOrderReference.GetHashCode(); + } + if (this.MerchantRiskIndicator != null) + { + hashCode = (hashCode * 59) + this.MerchantRiskIndicator.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + if (this.OrderReference != null) + { + hashCode = (hashCode * 59) + this.OrderReference.GetHashCode(); + } + if (this.PaymentMethod != null) + { + hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); + } + if (this.Recurring != null) + { + hashCode = (hashCode * 59) + this.Recurring.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.SelectedBrand != null) + { + hashCode = (hashCode * 59) + this.SelectedBrand.GetHashCode(); + } + if (this.SelectedRecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.SelectedRecurringDetailReference.GetHashCode(); + } + if (this.SessionId != null) + { + hashCode = (hashCode * 59) + this.SessionId.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.ShopperIP != null) + { + hashCode = (hashCode * 59) + this.ShopperIP.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ShopperInteraction.GetHashCode(); + if (this.ShopperLocale != null) + { + hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); + } + if (this.ShopperName != null) + { + hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); + } + if (this.ShopperReference != null) + { + hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); + } + if (this.ShopperStatement != null) + { + hashCode = (hashCode * 59) + this.ShopperStatement.GetHashCode(); + } + if (this.SocialSecurityNumber != null) + { + hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); + } + if (this.Splits != null) + { + hashCode = (hashCode * 59) + this.Splits.GetHashCode(); + } + if (this.Store != null) + { + hashCode = (hashCode * 59) + this.Store.GetHashCode(); + } + if (this.TelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); + } + if (this.ThreeDS2RequestData != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ThreeDSAuthenticationOnly.GetHashCode(); + if (this.TotalsGroup != null) + { + hashCode = (hashCode * 59) + this.TotalsGroup.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TrustedShopper.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, BalanceCheckRequest balanceCheckRequest, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (balanceCheckRequest.Amount == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.Amount), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.MerchantAccount), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.PaymentMethod == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.PaymentMethod), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.AccountInfoOption.IsSet && balanceCheckRequest.AccountInfo == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.AccountInfo), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.AdditionalAmountOption.IsSet && balanceCheckRequest.AdditionalAmount == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.AdditionalAmount), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.AdditionalDataOption.IsSet && balanceCheckRequest.AdditionalData == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.AdditionalData), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.ApplicationInfoOption.IsSet && balanceCheckRequest.ApplicationInfo == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.ApplicationInfo), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.BillingAddressOption.IsSet && balanceCheckRequest.BillingAddress == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.BillingAddress), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.BrowserInfoOption.IsSet && balanceCheckRequest.BrowserInfo == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.BrowserInfo), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.DccQuoteOption.IsSet && balanceCheckRequest.DccQuote == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.DccQuote), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.DeliveryAddressOption.IsSet && balanceCheckRequest.DeliveryAddress == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.DeliveryAddress), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.DeviceFingerprintOption.IsSet && balanceCheckRequest.DeviceFingerprint == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.DeviceFingerprint), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.InstallmentsOption.IsSet && balanceCheckRequest.Installments == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.Installments), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.LocalizedShopperStatementOption.IsSet && balanceCheckRequest.LocalizedShopperStatement == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.LocalizedShopperStatement), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.MccOption.IsSet && balanceCheckRequest.Mcc == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.Mcc), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.MerchantOrderReferenceOption.IsSet && balanceCheckRequest.MerchantOrderReference == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.MerchantOrderReference), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.MerchantRiskIndicatorOption.IsSet && balanceCheckRequest.MerchantRiskIndicator == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.MerchantRiskIndicator), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.MetadataOption.IsSet && balanceCheckRequest.Metadata == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.Metadata), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.OrderReferenceOption.IsSet && balanceCheckRequest.OrderReference == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.OrderReference), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.RecurringOption.IsSet && balanceCheckRequest.Recurring == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.Recurring), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.ReferenceOption.IsSet && balanceCheckRequest.Reference == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.Reference), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.SelectedBrandOption.IsSet && balanceCheckRequest.SelectedBrand == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.SelectedBrand), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.SelectedRecurringDetailReferenceOption.IsSet && balanceCheckRequest.SelectedRecurringDetailReference == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.SelectedRecurringDetailReference), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.SessionIdOption.IsSet && balanceCheckRequest.SessionId == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.SessionId), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.ShopperEmailOption.IsSet && balanceCheckRequest.ShopperEmail == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.ShopperEmail), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.ShopperIPOption.IsSet && balanceCheckRequest.ShopperIP == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.ShopperIP), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.ShopperLocaleOption.IsSet && balanceCheckRequest.ShopperLocale == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.ShopperLocale), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.ShopperNameOption.IsSet && balanceCheckRequest.ShopperName == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.ShopperName), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.ShopperReferenceOption.IsSet && balanceCheckRequest.ShopperReference == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.ShopperReference), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.ShopperStatementOption.IsSet && balanceCheckRequest.ShopperStatement == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.ShopperStatement), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.SocialSecurityNumberOption.IsSet && balanceCheckRequest.SocialSecurityNumber == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.SocialSecurityNumber), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.SplitsOption.IsSet && balanceCheckRequest.Splits == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.Splits), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.StoreOption.IsSet && balanceCheckRequest.Store == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.Store), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.TelephoneNumberOption.IsSet && balanceCheckRequest.TelephoneNumber == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.TelephoneNumber), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.ThreeDS2RequestDataOption.IsSet && balanceCheckRequest.ThreeDS2RequestData == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.ThreeDS2RequestData), "Property is required for class BalanceCheckRequest."); - - if (balanceCheckRequest.TotalsGroupOption.IsSet && balanceCheckRequest.TotalsGroup == null) - throw new ArgumentNullException(nameof(balanceCheckRequest.TotalsGroup), "Property is required for class BalanceCheckRequest."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, balanceCheckRequest.Amount, jsonSerializerOptions); - writer.WriteString("merchantAccount", balanceCheckRequest.MerchantAccount); - - writer.WritePropertyName("paymentMethod"); - JsonSerializer.Serialize(writer, balanceCheckRequest.PaymentMethod, jsonSerializerOptions); - if (balanceCheckRequest.AccountInfoOption.IsSet) - { - writer.WritePropertyName("accountInfo"); - JsonSerializer.Serialize(writer, balanceCheckRequest.AccountInfo, jsonSerializerOptions); - } - if (balanceCheckRequest.AdditionalAmountOption.IsSet) - { - writer.WritePropertyName("additionalAmount"); - JsonSerializer.Serialize(writer, balanceCheckRequest.AdditionalAmount, jsonSerializerOptions); - } - if (balanceCheckRequest.AdditionalDataOption.IsSet) - { - writer.WritePropertyName("additionalData"); - JsonSerializer.Serialize(writer, balanceCheckRequest.AdditionalData, jsonSerializerOptions); - } - if (balanceCheckRequest.ApplicationInfoOption.IsSet) - { - writer.WritePropertyName("applicationInfo"); - JsonSerializer.Serialize(writer, balanceCheckRequest.ApplicationInfo, jsonSerializerOptions); - } - if (balanceCheckRequest.BillingAddressOption.IsSet) - { - writer.WritePropertyName("billingAddress"); - JsonSerializer.Serialize(writer, balanceCheckRequest.BillingAddress, jsonSerializerOptions); - } - if (balanceCheckRequest.BrowserInfoOption.IsSet) - { - writer.WritePropertyName("browserInfo"); - JsonSerializer.Serialize(writer, balanceCheckRequest.BrowserInfo, jsonSerializerOptions); - } - if (balanceCheckRequest.CaptureDelayHoursOption.IsSet) - writer.WriteNumber("captureDelayHours", balanceCheckRequest.CaptureDelayHoursOption.Value.Value); - - if (balanceCheckRequest.DateOfBirthOption.IsSet) - writer.WriteString("dateOfBirth", balanceCheckRequest.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); - - if (balanceCheckRequest.DccQuoteOption.IsSet) - { - writer.WritePropertyName("dccQuote"); - JsonSerializer.Serialize(writer, balanceCheckRequest.DccQuote, jsonSerializerOptions); - } - if (balanceCheckRequest.DeliveryAddressOption.IsSet) - { - writer.WritePropertyName("deliveryAddress"); - JsonSerializer.Serialize(writer, balanceCheckRequest.DeliveryAddress, jsonSerializerOptions); - } - if (balanceCheckRequest.DeliveryDateOption.IsSet) - writer.WriteString("deliveryDate", balanceCheckRequest.DeliveryDateOption.Value.Value.ToString(DeliveryDateFormat)); - - if (balanceCheckRequest.DeviceFingerprintOption.IsSet) - writer.WriteString("deviceFingerprint", balanceCheckRequest.DeviceFingerprint); - - if (balanceCheckRequest.FraudOffsetOption.IsSet) - writer.WriteNumber("fraudOffset", balanceCheckRequest.FraudOffsetOption.Value.Value); - - if (balanceCheckRequest.InstallmentsOption.IsSet) - { - writer.WritePropertyName("installments"); - JsonSerializer.Serialize(writer, balanceCheckRequest.Installments, jsonSerializerOptions); - } - if (balanceCheckRequest.LocalizedShopperStatementOption.IsSet) - { - writer.WritePropertyName("localizedShopperStatement"); - JsonSerializer.Serialize(writer, balanceCheckRequest.LocalizedShopperStatement, jsonSerializerOptions); - } - if (balanceCheckRequest.MccOption.IsSet) - writer.WriteString("mcc", balanceCheckRequest.Mcc); - - if (balanceCheckRequest.MerchantOrderReferenceOption.IsSet) - writer.WriteString("merchantOrderReference", balanceCheckRequest.MerchantOrderReference); - - if (balanceCheckRequest.MerchantRiskIndicatorOption.IsSet) - { - writer.WritePropertyName("merchantRiskIndicator"); - JsonSerializer.Serialize(writer, balanceCheckRequest.MerchantRiskIndicator, jsonSerializerOptions); - } - if (balanceCheckRequest.MetadataOption.IsSet) + // DeviceFingerprint (string) maxLength + if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) { - writer.WritePropertyName("metadata"); - JsonSerializer.Serialize(writer, balanceCheckRequest.Metadata, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); } - if (balanceCheckRequest.OrderReferenceOption.IsSet) - writer.WriteString("orderReference", balanceCheckRequest.OrderReference); - if (balanceCheckRequest.RecurringOption.IsSet) + // Store (string) maxLength + if (this.Store != null && this.Store.Length > 16) { - writer.WritePropertyName("recurring"); - JsonSerializer.Serialize(writer, balanceCheckRequest.Recurring, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be less than 16.", new [] { "Store" }); } - var recurringProcessingModelRawValue = BalanceCheckRequest.RecurringProcessingModelEnumToJsonValue(balanceCheckRequest.RecurringProcessingModelOption.Value.Value); - writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); - if (balanceCheckRequest.ReferenceOption.IsSet) - writer.WriteString("reference", balanceCheckRequest.Reference); - - if (balanceCheckRequest.SelectedBrandOption.IsSet) - writer.WriteString("selectedBrand", balanceCheckRequest.SelectedBrand); - - if (balanceCheckRequest.SelectedRecurringDetailReferenceOption.IsSet) - writer.WriteString("selectedRecurringDetailReference", balanceCheckRequest.SelectedRecurringDetailReference); - - if (balanceCheckRequest.SessionIdOption.IsSet) - writer.WriteString("sessionId", balanceCheckRequest.SessionId); - - if (balanceCheckRequest.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", balanceCheckRequest.ShopperEmail); - if (balanceCheckRequest.ShopperIPOption.IsSet) - writer.WriteString("shopperIP", balanceCheckRequest.ShopperIP); - - var shopperInteractionRawValue = BalanceCheckRequest.ShopperInteractionEnumToJsonValue(balanceCheckRequest.ShopperInteractionOption.Value.Value); - writer.WriteString("shopperInteraction", shopperInteractionRawValue); - if (balanceCheckRequest.ShopperLocaleOption.IsSet) - writer.WriteString("shopperLocale", balanceCheckRequest.ShopperLocale); - - if (balanceCheckRequest.ShopperNameOption.IsSet) + // Store (string) minLength + if (this.Store != null && this.Store.Length < 1) { - writer.WritePropertyName("shopperName"); - JsonSerializer.Serialize(writer, balanceCheckRequest.ShopperName, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be greater than 1.", new [] { "Store" }); } - if (balanceCheckRequest.ShopperReferenceOption.IsSet) - writer.WriteString("shopperReference", balanceCheckRequest.ShopperReference); - if (balanceCheckRequest.ShopperStatementOption.IsSet) - writer.WriteString("shopperStatement", balanceCheckRequest.ShopperStatement); - - if (balanceCheckRequest.SocialSecurityNumberOption.IsSet) - writer.WriteString("socialSecurityNumber", balanceCheckRequest.SocialSecurityNumber); - - if (balanceCheckRequest.SplitsOption.IsSet) + // TotalsGroup (string) maxLength + if (this.TotalsGroup != null && this.TotalsGroup.Length > 16) { - writer.WritePropertyName("splits"); - JsonSerializer.Serialize(writer, balanceCheckRequest.Splits, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TotalsGroup, length must be less than 16.", new [] { "TotalsGroup" }); } - if (balanceCheckRequest.StoreOption.IsSet) - writer.WriteString("store", balanceCheckRequest.Store); - - if (balanceCheckRequest.TelephoneNumberOption.IsSet) - writer.WriteString("telephoneNumber", balanceCheckRequest.TelephoneNumber); - if (balanceCheckRequest.ThreeDS2RequestDataOption.IsSet) + // TotalsGroup (string) minLength + if (this.TotalsGroup != null && this.TotalsGroup.Length < 1) { - writer.WritePropertyName("threeDS2RequestData"); - JsonSerializer.Serialize(writer, balanceCheckRequest.ThreeDS2RequestData, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TotalsGroup, length must be greater than 1.", new [] { "TotalsGroup" }); } - if (balanceCheckRequest.ThreeDSAuthenticationOnlyOption.IsSet) - writer.WriteBoolean("threeDSAuthenticationOnly", balanceCheckRequest.ThreeDSAuthenticationOnlyOption.Value.Value); - if (balanceCheckRequest.TotalsGroupOption.IsSet) - writer.WriteString("totalsGroup", balanceCheckRequest.TotalsGroup); - - if (balanceCheckRequest.TrustedShopperOption.IsSet) - writer.WriteBoolean("trustedShopper", balanceCheckRequest.TrustedShopperOption.Value.Value); + yield break; } } + } diff --git a/Adyen/Model/Checkout/BalanceCheckResponse.cs b/Adyen/Model/Checkout/BalanceCheckResponse.cs index 8bf2091ca..e6f833b19 100644 --- a/Adyen/Model/Checkout/BalanceCheckResponse.cs +++ b/Adyen/Model/Checkout/BalanceCheckResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,206 +15,121 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// BalanceCheckResponse /// - public partial class BalanceCheckResponse : IValidatableObject + [DataContract(Name = "BalanceCheckResponse")] + public partial class BalanceCheckResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// balance - /// The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. - /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - /// fraudResult - /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - /// transactionLimit - [JsonConstructor] - public BalanceCheckResponse(Amount balance, ResultCodeEnum resultCode, Option> additionalData = default, Option fraudResult = default, Option pspReference = default, Option refusalReason = default, Option transactionLimit = default) - { - Balance = balance; - ResultCode = resultCode; - AdditionalDataOption = additionalData; - FraudResultOption = fraudResult; - PspReferenceOption = pspReference; - RefusalReasonOption = refusalReason; - TransactionLimitOption = transactionLimit; - OnCreated(); - } - - partial void OnCreated(); - /// /// The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. /// /// The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. + [JsonConverter(typeof(StringEnumConverter))] public enum ResultCodeEnum { /// /// Enum Success for value: Success /// + [EnumMember(Value = "Success")] Success = 1, /// /// Enum NotEnoughBalance for value: NotEnoughBalance /// + [EnumMember(Value = "NotEnoughBalance")] NotEnoughBalance = 2, /// /// Enum Failed for value: Failed /// + [EnumMember(Value = "Failed")] Failed = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ResultCodeEnum ResultCodeEnumFromString(string value) - { - if (value.Equals("Success")) - return ResultCodeEnum.Success; - - if (value.Equals("NotEnoughBalance")) - return ResultCodeEnum.NotEnoughBalance; - - if (value.Equals("Failed")) - return ResultCodeEnum.Failed; - - throw new NotImplementedException($"Could not convert value to type ResultCodeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ResultCodeEnum? ResultCodeEnumFromStringOrDefault(string value) - { - if (value.Equals("Success")) - return ResultCodeEnum.Success; - - if (value.Equals("NotEnoughBalance")) - return ResultCodeEnum.NotEnoughBalance; - if (value.Equals("Failed")) - return ResultCodeEnum.Failed; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ResultCodeEnumToJsonValue(ResultCodeEnum value) - { - if (value == ResultCodeEnum.Success) - return "Success"; - - if (value == ResultCodeEnum.NotEnoughBalance) - return "NotEnoughBalance"; - - if (value == ResultCodeEnum.Failed) - return "Failed"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. /// /// The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. - [JsonPropertyName("resultCode")] + [DataMember(Name = "resultCode", IsRequired = false, EmitDefaultValue = false)] public ResultCodeEnum ResultCode { get; set; } - /// - /// Gets or Sets Balance + /// Initializes a new instance of the class. /// - [JsonPropertyName("balance")] - public Amount Balance { get; set; } - + [JsonConstructorAttribute] + protected BalanceCheckResponse() { } /// - /// Used to track the state of AdditionalData + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AdditionalDataOption { get; private set; } + /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**.. + /// balance (required). + /// fraudResult. + /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request.. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. + /// The result of the cancellation request. Possible values: * **Success** – Indicates that the balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not have enough balance to pay the amount in the request, or that the currency of the balance on the card did not match the currency of the requested amount. * **Failed** – Indicates that the balance check failed. (required). + /// transactionLimit. + public BalanceCheckResponse(Dictionary additionalData = default(Dictionary), Amount balance = default(Amount), FraudResult fraudResult = default(FraudResult), string pspReference = default(string), string refusalReason = default(string), ResultCodeEnum resultCode = default(ResultCodeEnum), Amount transactionLimit = default(Amount)) + { + this.Balance = balance; + this.ResultCode = resultCode; + this.AdditionalData = additionalData; + this.FraudResult = fraudResult; + this.PspReference = pspReference; + this.RefusalReason = refusalReason; + this.TransactionLimit = transactionLimit; + } /// /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. /// /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - [JsonPropertyName("additionalData")] - public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } /// - /// Used to track the state of FraudResult + /// Gets or Sets Balance /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FraudResultOption { get; private set; } + [DataMember(Name = "balance", IsRequired = false, EmitDefaultValue = false)] + public Amount Balance { get; set; } /// /// Gets or Sets FraudResult /// - [JsonPropertyName("fraudResult")] - public FraudResult FraudResult { get { return this.FraudResultOption; } set { this.FraudResultOption = new Option(value); } } - - /// - /// Used to track the state of PspReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PspReferenceOption { get; private set; } + [DataMember(Name = "fraudResult", EmitDefaultValue = false)] + public FraudResult FraudResult { get; set; } /// /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. /// /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - [JsonPropertyName("pspReference")] - public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } - - /// - /// Used to track the state of RefusalReason - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RefusalReasonOption { get; private set; } + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + public string PspReference { get; set; } /// /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). /// /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [JsonPropertyName("refusalReason")] - public string RefusalReason { get { return this.RefusalReasonOption; } set { this.RefusalReasonOption = new Option(value); } } - - /// - /// Used to track the state of TransactionLimit - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TransactionLimitOption { get; private set; } + [DataMember(Name = "refusalReason", EmitDefaultValue = false)] + public string RefusalReason { get; set; } /// /// Gets or Sets TransactionLimit /// - [JsonPropertyName("transactionLimit")] - public Amount TransactionLimit { get { return this.TransactionLimitOption; } set { this.TransactionLimitOption = new Option(value); } } + [DataMember(Name = "transactionLimit", EmitDefaultValue = false)] + public Amount TransactionLimit { get; set; } /// /// Returns the string presentation of the object @@ -223,203 +139,131 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class BalanceCheckResponse {\n"); - sb.Append(" Balance: ").Append(Balance).Append("\n"); - sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); + sb.Append(" Balance: ").Append(Balance).Append("\n"); sb.Append(" FraudResult: ").Append(FraudResult).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); sb.Append(" RefusalReason: ").Append(RefusalReason).Append("\n"); + sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); sb.Append(" TransactionLimit: ").Append(TransactionLimit).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class BalanceCheckResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override BalanceCheckResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option balance = default; - Option resultCode = default; - Option> additionalData = default; - Option fraudResult = default; - Option pspReference = default; - Option refusalReason = default; - Option transactionLimit = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "balance": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - balance = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "resultCode": - string resultCodeRawValue = utf8JsonReader.GetString(); - if (resultCodeRawValue != null) - resultCode = new Option(BalanceCheckResponse.ResultCodeEnumFromStringOrDefault(resultCodeRawValue)); - break; - case "additionalData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "fraudResult": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fraudResult = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "refusalReason": - refusalReason = new Option(utf8JsonReader.GetString()); - break; - case "transactionLimit": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - transactionLimit = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (!balance.IsSet) - throw new ArgumentException("Property is required for class BalanceCheckResponse.", nameof(balance)); - - if (!resultCode.IsSet) - throw new ArgumentException("Property is required for class BalanceCheckResponse.", nameof(resultCode)); - - if (balance.IsSet && balance.Value == null) - throw new ArgumentNullException(nameof(balance), "Property is not nullable for class BalanceCheckResponse."); - - if (resultCode.IsSet && resultCode.Value == null) - throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class BalanceCheckResponse."); - - if (additionalData.IsSet && additionalData.Value == null) - throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class BalanceCheckResponse."); - - if (fraudResult.IsSet && fraudResult.Value == null) - throw new ArgumentNullException(nameof(fraudResult), "Property is not nullable for class BalanceCheckResponse."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class BalanceCheckResponse."); - - if (refusalReason.IsSet && refusalReason.Value == null) - throw new ArgumentNullException(nameof(refusalReason), "Property is not nullable for class BalanceCheckResponse."); - - if (transactionLimit.IsSet && transactionLimit.Value == null) - throw new ArgumentNullException(nameof(transactionLimit), "Property is not nullable for class BalanceCheckResponse."); - - return new BalanceCheckResponse(balance.Value, resultCode.Value.Value, additionalData, fraudResult, pspReference, refusalReason, transactionLimit); + return this.Equals(input as BalanceCheckResponse); } /// - /// Serializes a + /// Returns true if BalanceCheckResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, BalanceCheckResponse balanceCheckResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of BalanceCheckResponse to be compared + /// Boolean + public bool Equals(BalanceCheckResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, balanceCheckResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + input.AdditionalData != null && + this.AdditionalData.SequenceEqual(input.AdditionalData) + ) && + ( + this.Balance == input.Balance || + (this.Balance != null && + this.Balance.Equals(input.Balance)) + ) && + ( + this.FraudResult == input.FraudResult || + (this.FraudResult != null && + this.FraudResult.Equals(input.FraudResult)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.RefusalReason == input.RefusalReason || + (this.RefusalReason != null && + this.RefusalReason.Equals(input.RefusalReason)) + ) && + ( + this.ResultCode == input.ResultCode || + this.ResultCode.Equals(input.ResultCode) + ) && + ( + this.TransactionLimit == input.TransactionLimit || + (this.TransactionLimit != null && + this.TransactionLimit.Equals(input.TransactionLimit)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, BalanceCheckResponse balanceCheckResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (balanceCheckResponse.Balance == null) - throw new ArgumentNullException(nameof(balanceCheckResponse.Balance), "Property is required for class BalanceCheckResponse."); - - if (balanceCheckResponse.AdditionalDataOption.IsSet && balanceCheckResponse.AdditionalData == null) - throw new ArgumentNullException(nameof(balanceCheckResponse.AdditionalData), "Property is required for class BalanceCheckResponse."); - - if (balanceCheckResponse.FraudResultOption.IsSet && balanceCheckResponse.FraudResult == null) - throw new ArgumentNullException(nameof(balanceCheckResponse.FraudResult), "Property is required for class BalanceCheckResponse."); - - if (balanceCheckResponse.PspReferenceOption.IsSet && balanceCheckResponse.PspReference == null) - throw new ArgumentNullException(nameof(balanceCheckResponse.PspReference), "Property is required for class BalanceCheckResponse."); - - if (balanceCheckResponse.RefusalReasonOption.IsSet && balanceCheckResponse.RefusalReason == null) - throw new ArgumentNullException(nameof(balanceCheckResponse.RefusalReason), "Property is required for class BalanceCheckResponse."); - - if (balanceCheckResponse.TransactionLimitOption.IsSet && balanceCheckResponse.TransactionLimit == null) - throw new ArgumentNullException(nameof(balanceCheckResponse.TransactionLimit), "Property is required for class BalanceCheckResponse."); - - writer.WritePropertyName("balance"); - JsonSerializer.Serialize(writer, balanceCheckResponse.Balance, jsonSerializerOptions); - var resultCodeRawValue = BalanceCheckResponse.ResultCodeEnumToJsonValue(balanceCheckResponse.ResultCode); - writer.WriteString("resultCode", resultCodeRawValue); - if (balanceCheckResponse.AdditionalDataOption.IsSet) - { - writer.WritePropertyName("additionalData"); - JsonSerializer.Serialize(writer, balanceCheckResponse.AdditionalData, jsonSerializerOptions); - } - if (balanceCheckResponse.FraudResultOption.IsSet) - { - writer.WritePropertyName("fraudResult"); - JsonSerializer.Serialize(writer, balanceCheckResponse.FraudResult, jsonSerializerOptions); - } - if (balanceCheckResponse.PspReferenceOption.IsSet) - writer.WriteString("pspReference", balanceCheckResponse.PspReference); - - if (balanceCheckResponse.RefusalReasonOption.IsSet) - writer.WriteString("refusalReason", balanceCheckResponse.RefusalReason); - - if (balanceCheckResponse.TransactionLimitOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("transactionLimit"); - JsonSerializer.Serialize(writer, balanceCheckResponse.TransactionLimit, jsonSerializerOptions); + int hashCode = 41; + if (this.AdditionalData != null) + { + hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); + } + if (this.Balance != null) + { + hashCode = (hashCode * 59) + this.Balance.GetHashCode(); + } + if (this.FraudResult != null) + { + hashCode = (hashCode * 59) + this.FraudResult.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + if (this.RefusalReason != null) + { + hashCode = (hashCode * 59) + this.RefusalReason.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ResultCode.GetHashCode(); + if (this.TransactionLimit != null) + { + hashCode = (hashCode * 59) + this.TransactionLimit.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/BillDeskDetails.cs b/Adyen/Model/Checkout/BillDeskDetails.cs index 5b59613f8..ef006b764 100644 --- a/Adyen/Model/Checkout/BillDeskDetails.cs +++ b/Adyen/Model/Checkout/BillDeskDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,132 +15,83 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// BillDeskDetails /// - public partial class BillDeskDetails : IValidatableObject + [DataContract(Name = "BillDeskDetails")] + public partial class BillDeskDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The issuer id of the shopper's selected bank. - /// **billdesk** - /// The checkout attempt identifier. - [JsonConstructor] - public BillDeskDetails(string issuer, TypeEnum type, Option checkoutAttemptId = default) - { - Issuer = issuer; - Type = type; - CheckoutAttemptIdOption = checkoutAttemptId; - OnCreated(); - } - - partial void OnCreated(); - /// /// **billdesk** /// /// **billdesk** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// - /// Enum BilldeskOnline for value: billdesk_online + /// Enum Online for value: billdesk_online /// - BilldeskOnline = 1, + [EnumMember(Value = "billdesk_online")] + Online = 1, /// - /// Enum BilldeskWallet for value: billdesk_wallet + /// Enum Wallet for value: billdesk_wallet /// - BilldeskWallet = 2 + [EnumMember(Value = "billdesk_wallet")] + Wallet = 2 + } + /// - /// Returns a + /// **billdesk** /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("billdesk_online")) - return TypeEnum.BilldeskOnline; - - if (value.Equals("billdesk_wallet")) - return TypeEnum.BilldeskWallet; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - + /// **billdesk** + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + public TypeEnum Type { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("billdesk_online")) - return TypeEnum.BilldeskOnline; - - if (value.Equals("billdesk_wallet")) - return TypeEnum.BilldeskWallet; - - return null; - } - + [JsonConstructorAttribute] + protected BillDeskDetails() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) + /// The checkout attempt identifier.. + /// The issuer id of the shopper's selected bank. (required). + /// **billdesk** (required). + public BillDeskDetails(string checkoutAttemptId = default(string), string issuer = default(string), TypeEnum type = default(TypeEnum)) { - if (value == TypeEnum.BilldeskOnline) - return "billdesk_online"; - - if (value == TypeEnum.BilldeskWallet) - return "billdesk_wallet"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.Issuer = issuer; + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; } /// - /// **billdesk** + /// The checkout attempt identifier. /// - /// **billdesk** - [JsonPropertyName("type")] - public TypeEnum Type { get; set; } + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The issuer id of the shopper's selected bank. /// /// The issuer id of the shopper's selected bank. - [JsonPropertyName("issuer")] + [DataMember(Name = "issuer", IsRequired = false, EmitDefaultValue = false)] public string Issuer { get; set; } - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - - /// - /// The checkout attempt identifier. - /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - /// /// Returns the string presentation of the object /// @@ -148,136 +100,90 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class BillDeskDetails {\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" Issuer: ").Append(Issuer).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class BillDeskDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override BillDeskDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option issuer = default; - Option type = default; - Option checkoutAttemptId = default; + return this.Equals(input as BillDeskDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if BillDeskDetails instances are equal + /// + /// Instance of BillDeskDetails to be compared + /// Boolean + public bool Equals(BillDeskDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "issuer": - issuer = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(BillDeskDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!issuer.IsSet) - throw new ArgumentException("Property is required for class BillDeskDetails.", nameof(issuer)); - - if (!type.IsSet) - throw new ArgumentException("Property is required for class BillDeskDetails.", nameof(type)); - - if (issuer.IsSet && issuer.Value == null) - throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class BillDeskDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class BillDeskDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class BillDeskDetails."); - - return new BillDeskDetails(issuer.Value, type.Value.Value, checkoutAttemptId); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Issuer == input.Issuer || + (this.Issuer != null && + this.Issuer.Equals(input.Issuer)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, BillDeskDetails billDeskDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, billDeskDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.Issuer != null) + { + hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, BillDeskDetails billDeskDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (billDeskDetails.Issuer == null) - throw new ArgumentNullException(nameof(billDeskDetails.Issuer), "Property is required for class BillDeskDetails."); - - if (billDeskDetails.CheckoutAttemptIdOption.IsSet && billDeskDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(billDeskDetails.CheckoutAttemptId), "Property is required for class BillDeskDetails."); - - writer.WriteString("issuer", billDeskDetails.Issuer); - - var typeRawValue = BillDeskDetails.TypeEnumToJsonValue(billDeskDetails.Type); - writer.WriteString("type", typeRawValue); - if (billDeskDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", billDeskDetails.CheckoutAttemptId); + yield break; } } + } diff --git a/Adyen/Model/Checkout/BillingAddress.cs b/Adyen/Model/Checkout/BillingAddress.cs index dfd873f10..4b1e4119e 100644 --- a/Adyen/Model/Checkout/BillingAddress.cs +++ b/Adyen/Model/Checkout/BillingAddress.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,91 +15,88 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// BillingAddress /// - public partial class BillingAddress : IValidatableObject + [DataContract(Name = "BillingAddress")] + public partial class BillingAddress : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The name of the city. Maximum length: 3000 characters. - /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. - /// The number or name of the house. Maximum length: 3000 characters. - /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. - [JsonConstructor] - public BillingAddress(string city, string country, string houseNumberOrName, string postalCode, string street, Option stateOrProvince = default) + [JsonConstructorAttribute] + protected BillingAddress() { } + /// + /// Initializes a new instance of the class. + /// + /// The name of the city. Maximum length: 3000 characters. (required). + /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. (required). + /// The number or name of the house. Maximum length: 3000 characters. (required). + /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. (required). + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada.. + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. (required). + public BillingAddress(string city = default(string), string country = default(string), string houseNumberOrName = default(string), string postalCode = default(string), string stateOrProvince = default(string), string street = default(string)) { - City = city; - Country = country; - HouseNumberOrName = houseNumberOrName; - PostalCode = postalCode; - Street = street; - StateOrProvinceOption = stateOrProvince; - OnCreated(); + this.City = city; + this.Country = country; + this.HouseNumberOrName = houseNumberOrName; + this.PostalCode = postalCode; + this.Street = street; + this.StateOrProvince = stateOrProvince; } - partial void OnCreated(); - /// /// The name of the city. Maximum length: 3000 characters. /// /// The name of the city. Maximum length: 3000 characters. - [JsonPropertyName("city")] + [DataMember(Name = "city", IsRequired = false, EmitDefaultValue = false)] public string City { get; set; } /// /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. /// /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. - [JsonPropertyName("country")] + [DataMember(Name = "country", IsRequired = false, EmitDefaultValue = false)] public string Country { get; set; } /// /// The number or name of the house. Maximum length: 3000 characters. /// /// The number or name of the house. Maximum length: 3000 characters. - [JsonPropertyName("houseNumberOrName")] + [DataMember(Name = "houseNumberOrName", IsRequired = false, EmitDefaultValue = false)] public string HouseNumberOrName { get; set; } /// /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. /// /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. - [JsonPropertyName("postalCode")] + [DataMember(Name = "postalCode", IsRequired = false, EmitDefaultValue = false)] public string PostalCode { get; set; } /// - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. - /// - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. - [JsonPropertyName("street")] - public string Street { get; set; } - - /// - /// Used to track the state of StateOrProvince + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StateOrProvinceOption { get; private set; } + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + [DataMember(Name = "stateOrProvince", EmitDefaultValue = false)] + public string StateOrProvince { get; set; } /// - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. /// - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. - [JsonPropertyName("stateOrProvince")] - public string StateOrProvince { get { return this.StateOrProvinceOption; } set { this.StateOrProvinceOption = new Option(value); } } + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + [DataMember(Name = "street", IsRequired = false, EmitDefaultValue = false)] + public string Street { get; set; } /// /// Returns the string presentation of the object @@ -112,205 +110,144 @@ public override string ToString() sb.Append(" Country: ").Append(Country).Append("\n"); sb.Append(" HouseNumberOrName: ").Append(HouseNumberOrName).Append("\n"); sb.Append(" PostalCode: ").Append(PostalCode).Append("\n"); - sb.Append(" Street: ").Append(Street).Append("\n"); sb.Append(" StateOrProvince: ").Append(StateOrProvince).Append("\n"); + sb.Append(" Street: ").Append(Street).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // City (string) maxLength - if (this.City != null && this.City.Length > 3000) - { - yield return new ValidationResult("Invalid value for City, length must be less than 3000.", new [] { "City" }); - } - - // HouseNumberOrName (string) maxLength - if (this.HouseNumberOrName != null && this.HouseNumberOrName.Length > 3000) - { - yield return new ValidationResult("Invalid value for HouseNumberOrName, length must be less than 3000.", new [] { "HouseNumberOrName" }); - } - - // Street (string) maxLength - if (this.Street != null && this.Street.Length > 3000) - { - yield return new ValidationResult("Invalid value for Street, length must be less than 3000.", new [] { "Street" }); - } - - // StateOrProvince (string) maxLength - if (this.StateOrProvince != null && this.StateOrProvince.Length > 1000) - { - yield return new ValidationResult("Invalid value for StateOrProvince, length must be less than 1000.", new [] { "StateOrProvince" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class BillingAddressJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override BillingAddress Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option city = default; - Option country = default; - Option houseNumberOrName = default; - Option postalCode = default; - Option street = default; - Option stateOrProvince = default; + return this.Equals(input as BillingAddress); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if BillingAddress instances are equal + /// + /// Instance of BillingAddress to be compared + /// Boolean + public bool Equals(BillingAddress input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "city": - city = new Option(utf8JsonReader.GetString()); - break; - case "country": - country = new Option(utf8JsonReader.GetString()); - break; - case "houseNumberOrName": - houseNumberOrName = new Option(utf8JsonReader.GetString()); - break; - case "postalCode": - postalCode = new Option(utf8JsonReader.GetString()); - break; - case "street": - street = new Option(utf8JsonReader.GetString()); - break; - case "stateOrProvince": - stateOrProvince = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!city.IsSet) - throw new ArgumentException("Property is required for class BillingAddress.", nameof(city)); - - if (!country.IsSet) - throw new ArgumentException("Property is required for class BillingAddress.", nameof(country)); - - if (!houseNumberOrName.IsSet) - throw new ArgumentException("Property is required for class BillingAddress.", nameof(houseNumberOrName)); - - if (!postalCode.IsSet) - throw new ArgumentException("Property is required for class BillingAddress.", nameof(postalCode)); - - if (!street.IsSet) - throw new ArgumentException("Property is required for class BillingAddress.", nameof(street)); - - if (city.IsSet && city.Value == null) - throw new ArgumentNullException(nameof(city), "Property is not nullable for class BillingAddress."); - - if (country.IsSet && country.Value == null) - throw new ArgumentNullException(nameof(country), "Property is not nullable for class BillingAddress."); - - if (houseNumberOrName.IsSet && houseNumberOrName.Value == null) - throw new ArgumentNullException(nameof(houseNumberOrName), "Property is not nullable for class BillingAddress."); - - if (postalCode.IsSet && postalCode.Value == null) - throw new ArgumentNullException(nameof(postalCode), "Property is not nullable for class BillingAddress."); - - if (street.IsSet && street.Value == null) - throw new ArgumentNullException(nameof(street), "Property is not nullable for class BillingAddress."); - - if (stateOrProvince.IsSet && stateOrProvince.Value == null) - throw new ArgumentNullException(nameof(stateOrProvince), "Property is not nullable for class BillingAddress."); - - return new BillingAddress(city.Value, country.Value, houseNumberOrName.Value, postalCode.Value, street.Value, stateOrProvince); + return + ( + this.City == input.City || + (this.City != null && + this.City.Equals(input.City)) + ) && + ( + this.Country == input.Country || + (this.Country != null && + this.Country.Equals(input.Country)) + ) && + ( + this.HouseNumberOrName == input.HouseNumberOrName || + (this.HouseNumberOrName != null && + this.HouseNumberOrName.Equals(input.HouseNumberOrName)) + ) && + ( + this.PostalCode == input.PostalCode || + (this.PostalCode != null && + this.PostalCode.Equals(input.PostalCode)) + ) && + ( + this.StateOrProvince == input.StateOrProvince || + (this.StateOrProvince != null && + this.StateOrProvince.Equals(input.StateOrProvince)) + ) && + ( + this.Street == input.Street || + (this.Street != null && + this.Street.Equals(input.Street)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, BillingAddress billingAddress, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, billingAddress, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.City != null) + { + hashCode = (hashCode * 59) + this.City.GetHashCode(); + } + if (this.Country != null) + { + hashCode = (hashCode * 59) + this.Country.GetHashCode(); + } + if (this.HouseNumberOrName != null) + { + hashCode = (hashCode * 59) + this.HouseNumberOrName.GetHashCode(); + } + if (this.PostalCode != null) + { + hashCode = (hashCode * 59) + this.PostalCode.GetHashCode(); + } + if (this.StateOrProvince != null) + { + hashCode = (hashCode * 59) + this.StateOrProvince.GetHashCode(); + } + if (this.Street != null) + { + hashCode = (hashCode * 59) + this.Street.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, BillingAddress billingAddress, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (billingAddress.City == null) - throw new ArgumentNullException(nameof(billingAddress.City), "Property is required for class BillingAddress."); - - if (billingAddress.Country == null) - throw new ArgumentNullException(nameof(billingAddress.Country), "Property is required for class BillingAddress."); - - if (billingAddress.HouseNumberOrName == null) - throw new ArgumentNullException(nameof(billingAddress.HouseNumberOrName), "Property is required for class BillingAddress."); - - if (billingAddress.PostalCode == null) - throw new ArgumentNullException(nameof(billingAddress.PostalCode), "Property is required for class BillingAddress."); - - if (billingAddress.Street == null) - throw new ArgumentNullException(nameof(billingAddress.Street), "Property is required for class BillingAddress."); - - if (billingAddress.StateOrProvinceOption.IsSet && billingAddress.StateOrProvince == null) - throw new ArgumentNullException(nameof(billingAddress.StateOrProvince), "Property is required for class BillingAddress."); - - writer.WriteString("city", billingAddress.City); - - writer.WriteString("country", billingAddress.Country); + // City (string) maxLength + if (this.City != null && this.City.Length > 3000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for City, length must be less than 3000.", new [] { "City" }); + } - writer.WriteString("houseNumberOrName", billingAddress.HouseNumberOrName); + // HouseNumberOrName (string) maxLength + if (this.HouseNumberOrName != null && this.HouseNumberOrName.Length > 3000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for HouseNumberOrName, length must be less than 3000.", new [] { "HouseNumberOrName" }); + } - writer.WriteString("postalCode", billingAddress.PostalCode); + // StateOrProvince (string) maxLength + if (this.StateOrProvince != null && this.StateOrProvince.Length > 1000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StateOrProvince, length must be less than 1000.", new [] { "StateOrProvince" }); + } - writer.WriteString("street", billingAddress.Street); + // Street (string) maxLength + if (this.Street != null && this.Street.Length > 3000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Street, length must be less than 3000.", new [] { "Street" }); + } - if (billingAddress.StateOrProvinceOption.IsSet) - writer.WriteString("stateOrProvince", billingAddress.StateOrProvince); + yield break; } } + } diff --git a/Adyen/Model/Checkout/BlikDetails.cs b/Adyen/Model/Checkout/BlikDetails.cs index be80ed5ad..0a5cd33cf 100644 --- a/Adyen/Model/Checkout/BlikDetails.cs +++ b/Adyen/Model/Checkout/BlikDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,164 +15,90 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// BlikDetails /// - public partial class BlikDetails : IValidatableObject + [DataContract(Name = "BlikDetails")] + public partial class BlikDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// BLIK code consisting of 6 digits. - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **blik** - [JsonConstructor] - public BlikDetails(Option blikCode = default, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - BlikCodeOption = blikCode; - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **blik** /// /// **blik** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Blik for value: blik /// + [EnumMember(Value = "blik")] Blik = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("blik")) - return TypeEnum.Blik; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("blik")) - return TypeEnum.Blik; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Blik) - return "blik"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **blik** /// /// **blik** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of BlikCode + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BlikCodeOption { get; private set; } + /// BLIK code consisting of 6 digits.. + /// The checkout attempt identifier.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **blik**. + public BlikDetails(string blikCode = default(string), string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = default(TypeEnum?)) + { + this.BlikCode = blikCode; + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// BLIK code consisting of 6 digits. /// /// BLIK code consisting of 6 digits. - [JsonPropertyName("blikCode")] - public string BlikCode { get { return this.BlikCodeOption; } set { this.BlikCodeOption = new Option(value); } } - - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + [DataMember(Name = "blikCode", EmitDefaultValue = false)] + public string BlikCode { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -191,156 +118,106 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class BlikDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override BlikDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option blikCode = default; - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as BlikDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if BlikDetails instances are equal + /// + /// Instance of BlikDetails to be compared + /// Boolean + public bool Equals(BlikDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "blikCode": - blikCode = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(BlikDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (blikCode.IsSet && blikCode.Value == null) - throw new ArgumentNullException(nameof(blikCode), "Property is not nullable for class BlikDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class BlikDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class BlikDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class BlikDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class BlikDetails."); - - return new BlikDetails(blikCode, checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.BlikCode == input.BlikCode || + (this.BlikCode != null && + this.BlikCode.Equals(input.BlikCode)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, BlikDetails blikDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, blikDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.BlikCode != null) + { + hashCode = (hashCode * 59) + this.BlikCode.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, BlikDetails blikDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (blikDetails.BlikCodeOption.IsSet && blikDetails.BlikCode == null) - throw new ArgumentNullException(nameof(blikDetails.BlikCode), "Property is required for class BlikDetails."); - - if (blikDetails.CheckoutAttemptIdOption.IsSet && blikDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(blikDetails.CheckoutAttemptId), "Property is required for class BlikDetails."); - - if (blikDetails.RecurringDetailReferenceOption.IsSet && blikDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(blikDetails.RecurringDetailReference), "Property is required for class BlikDetails."); - - if (blikDetails.StoredPaymentMethodIdOption.IsSet && blikDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(blikDetails.StoredPaymentMethodId), "Property is required for class BlikDetails."); - - if (blikDetails.BlikCodeOption.IsSet) - writer.WriteString("blikCode", blikDetails.BlikCode); - - if (blikDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", blikDetails.CheckoutAttemptId); - - if (blikDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", blikDetails.RecurringDetailReference); - - if (blikDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", blikDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = BlikDetails.TypeEnumToJsonValue(blikDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/BrowserInfo.cs b/Adyen/Model/Checkout/BrowserInfo.cs index 5779e58be..7f6560ead 100644 --- a/Adyen/Model/Checkout/BrowserInfo.cs +++ b/Adyen/Model/Checkout/BrowserInfo.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,119 +15,116 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// BrowserInfo /// - public partial class BrowserInfo : IValidatableObject + [DataContract(Name = "BrowserInfo")] + public partial class BrowserInfo : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The accept header value of the shopper's browser. - /// The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. - /// Boolean value indicating if the shopper's browser is able to execute Java. - /// The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). - /// The total height of the shopper's device screen in pixels. - /// The total width of the shopper's device screen in pixels. - /// Time difference between UTC time and the shopper's browser local time, in minutes. - /// The user agent value of the shopper's browser. - /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. (default to true) - [JsonConstructor] - public BrowserInfo(string acceptHeader, int colorDepth, bool javaEnabled, string language, int screenHeight, int screenWidth, int timeZoneOffset, string userAgent, Option javaScriptEnabled = default) + [JsonConstructorAttribute] + protected BrowserInfo() { } + /// + /// Initializes a new instance of the class. + /// + /// The accept header value of the shopper's browser. (required). + /// The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. (required). + /// Boolean value indicating if the shopper's browser is able to execute Java. (required). + /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. (default to true). + /// The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). (required). + /// The total height of the shopper's device screen in pixels. (required). + /// The total width of the shopper's device screen in pixels. (required). + /// Time difference between UTC time and the shopper's browser local time, in minutes. (required). + /// The user agent value of the shopper's browser. (required). + public BrowserInfo(string acceptHeader = default(string), int? colorDepth = default(int?), bool? javaEnabled = default(bool?), bool? javaScriptEnabled = true, string language = default(string), int? screenHeight = default(int?), int? screenWidth = default(int?), int? timeZoneOffset = default(int?), string userAgent = default(string)) { - AcceptHeader = acceptHeader; - ColorDepth = colorDepth; - JavaEnabled = javaEnabled; - Language = language; - ScreenHeight = screenHeight; - ScreenWidth = screenWidth; - TimeZoneOffset = timeZoneOffset; - UserAgent = userAgent; - JavaScriptEnabledOption = javaScriptEnabled; - OnCreated(); + this.AcceptHeader = acceptHeader; + this.ColorDepth = colorDepth; + this.JavaEnabled = javaEnabled; + this.Language = language; + this.ScreenHeight = screenHeight; + this.ScreenWidth = screenWidth; + this.TimeZoneOffset = timeZoneOffset; + this.UserAgent = userAgent; + this.JavaScriptEnabled = javaScriptEnabled; } - partial void OnCreated(); - /// /// The accept header value of the shopper's browser. /// /// The accept header value of the shopper's browser. - [JsonPropertyName("acceptHeader")] + [DataMember(Name = "acceptHeader", IsRequired = false, EmitDefaultValue = false)] public string AcceptHeader { get; set; } /// /// The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. /// /// The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. - [JsonPropertyName("colorDepth")] - public int ColorDepth { get; set; } + [DataMember(Name = "colorDepth", IsRequired = false, EmitDefaultValue = false)] + public int? ColorDepth { get; set; } /// /// Boolean value indicating if the shopper's browser is able to execute Java. /// /// Boolean value indicating if the shopper's browser is able to execute Java. - [JsonPropertyName("javaEnabled")] - public bool JavaEnabled { get; set; } + [DataMember(Name = "javaEnabled", IsRequired = false, EmitDefaultValue = false)] + public bool? JavaEnabled { get; set; } + + /// + /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. + /// + /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. + [DataMember(Name = "javaScriptEnabled", EmitDefaultValue = false)] + public bool? JavaScriptEnabled { get; set; } /// /// The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). /// /// The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). - [JsonPropertyName("language")] + [DataMember(Name = "language", IsRequired = false, EmitDefaultValue = false)] public string Language { get; set; } /// /// The total height of the shopper's device screen in pixels. /// /// The total height of the shopper's device screen in pixels. - [JsonPropertyName("screenHeight")] - public int ScreenHeight { get; set; } + [DataMember(Name = "screenHeight", IsRequired = false, EmitDefaultValue = false)] + public int? ScreenHeight { get; set; } /// /// The total width of the shopper's device screen in pixels. /// /// The total width of the shopper's device screen in pixels. - [JsonPropertyName("screenWidth")] - public int ScreenWidth { get; set; } + [DataMember(Name = "screenWidth", IsRequired = false, EmitDefaultValue = false)] + public int? ScreenWidth { get; set; } /// /// Time difference between UTC time and the shopper's browser local time, in minutes. /// /// Time difference between UTC time and the shopper's browser local time, in minutes. - [JsonPropertyName("timeZoneOffset")] - public int TimeZoneOffset { get; set; } + [DataMember(Name = "timeZoneOffset", IsRequired = false, EmitDefaultValue = false)] + public int? TimeZoneOffset { get; set; } /// /// The user agent value of the shopper's browser. /// /// The user agent value of the shopper's browser. - [JsonPropertyName("userAgent")] + [DataMember(Name = "userAgent", IsRequired = false, EmitDefaultValue = false)] public string UserAgent { get; set; } - /// - /// Used to track the state of JavaScriptEnabled - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option JavaScriptEnabledOption { get; private set; } - - /// - /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. - /// - /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. - [JsonPropertyName("javaScriptEnabled")] - public bool? JavaScriptEnabled { get { return this.JavaScriptEnabledOption; } set { this.JavaScriptEnabledOption = new Option(value); } } - /// /// Returns the string presentation of the object /// @@ -138,218 +136,127 @@ public override string ToString() sb.Append(" AcceptHeader: ").Append(AcceptHeader).Append("\n"); sb.Append(" ColorDepth: ").Append(ColorDepth).Append("\n"); sb.Append(" JavaEnabled: ").Append(JavaEnabled).Append("\n"); + sb.Append(" JavaScriptEnabled: ").Append(JavaScriptEnabled).Append("\n"); sb.Append(" Language: ").Append(Language).Append("\n"); sb.Append(" ScreenHeight: ").Append(ScreenHeight).Append("\n"); sb.Append(" ScreenWidth: ").Append(ScreenWidth).Append("\n"); sb.Append(" TimeZoneOffset: ").Append(TimeZoneOffset).Append("\n"); sb.Append(" UserAgent: ").Append(UserAgent).Append("\n"); - sb.Append(" JavaScriptEnabled: ").Append(JavaScriptEnabled).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class BrowserInfoJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override BrowserInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option acceptHeader = default; - Option colorDepth = default; - Option javaEnabled = default; - Option language = default; - Option screenHeight = default; - Option screenWidth = default; - Option timeZoneOffset = default; - Option userAgent = default; - Option javaScriptEnabled = default; + return this.Equals(input as BrowserInfo); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if BrowserInfo instances are equal + /// + /// Instance of BrowserInfo to be compared + /// Boolean + public bool Equals(BrowserInfo input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "acceptHeader": - acceptHeader = new Option(utf8JsonReader.GetString()); - break; - case "colorDepth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - colorDepth = new Option(utf8JsonReader.GetInt32()); - break; - case "javaEnabled": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - javaEnabled = new Option(utf8JsonReader.GetBoolean()); - break; - case "language": - language = new Option(utf8JsonReader.GetString()); - break; - case "screenHeight": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - screenHeight = new Option(utf8JsonReader.GetInt32()); - break; - case "screenWidth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - screenWidth = new Option(utf8JsonReader.GetInt32()); - break; - case "timeZoneOffset": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - timeZoneOffset = new Option(utf8JsonReader.GetInt32()); - break; - case "userAgent": - userAgent = new Option(utf8JsonReader.GetString()); - break; - case "javaScriptEnabled": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - javaScriptEnabled = new Option(utf8JsonReader.GetBoolean()); - break; - default: - break; - } - } + return false; } - - if (!acceptHeader.IsSet) - throw new ArgumentException("Property is required for class BrowserInfo.", nameof(acceptHeader)); - - if (!colorDepth.IsSet) - throw new ArgumentException("Property is required for class BrowserInfo.", nameof(colorDepth)); - - if (!javaEnabled.IsSet) - throw new ArgumentException("Property is required for class BrowserInfo.", nameof(javaEnabled)); - - if (!language.IsSet) - throw new ArgumentException("Property is required for class BrowserInfo.", nameof(language)); - - if (!screenHeight.IsSet) - throw new ArgumentException("Property is required for class BrowserInfo.", nameof(screenHeight)); - - if (!screenWidth.IsSet) - throw new ArgumentException("Property is required for class BrowserInfo.", nameof(screenWidth)); - - if (!timeZoneOffset.IsSet) - throw new ArgumentException("Property is required for class BrowserInfo.", nameof(timeZoneOffset)); - - if (!userAgent.IsSet) - throw new ArgumentException("Property is required for class BrowserInfo.", nameof(userAgent)); - - if (acceptHeader.IsSet && acceptHeader.Value == null) - throw new ArgumentNullException(nameof(acceptHeader), "Property is not nullable for class BrowserInfo."); - - if (colorDepth.IsSet && colorDepth.Value == null) - throw new ArgumentNullException(nameof(colorDepth), "Property is not nullable for class BrowserInfo."); - - if (javaEnabled.IsSet && javaEnabled.Value == null) - throw new ArgumentNullException(nameof(javaEnabled), "Property is not nullable for class BrowserInfo."); - - if (language.IsSet && language.Value == null) - throw new ArgumentNullException(nameof(language), "Property is not nullable for class BrowserInfo."); - - if (screenHeight.IsSet && screenHeight.Value == null) - throw new ArgumentNullException(nameof(screenHeight), "Property is not nullable for class BrowserInfo."); - - if (screenWidth.IsSet && screenWidth.Value == null) - throw new ArgumentNullException(nameof(screenWidth), "Property is not nullable for class BrowserInfo."); - - if (timeZoneOffset.IsSet && timeZoneOffset.Value == null) - throw new ArgumentNullException(nameof(timeZoneOffset), "Property is not nullable for class BrowserInfo."); - - if (userAgent.IsSet && userAgent.Value == null) - throw new ArgumentNullException(nameof(userAgent), "Property is not nullable for class BrowserInfo."); - - if (javaScriptEnabled.IsSet && javaScriptEnabled.Value == null) - throw new ArgumentNullException(nameof(javaScriptEnabled), "Property is not nullable for class BrowserInfo."); - - return new BrowserInfo(acceptHeader.Value, colorDepth.Value.Value, javaEnabled.Value.Value, language.Value, screenHeight.Value.Value, screenWidth.Value.Value, timeZoneOffset.Value.Value, userAgent.Value, javaScriptEnabled); + return + ( + this.AcceptHeader == input.AcceptHeader || + (this.AcceptHeader != null && + this.AcceptHeader.Equals(input.AcceptHeader)) + ) && + ( + this.ColorDepth == input.ColorDepth || + this.ColorDepth.Equals(input.ColorDepth) + ) && + ( + this.JavaEnabled == input.JavaEnabled || + this.JavaEnabled.Equals(input.JavaEnabled) + ) && + ( + this.JavaScriptEnabled == input.JavaScriptEnabled || + this.JavaScriptEnabled.Equals(input.JavaScriptEnabled) + ) && + ( + this.Language == input.Language || + (this.Language != null && + this.Language.Equals(input.Language)) + ) && + ( + this.ScreenHeight == input.ScreenHeight || + this.ScreenHeight.Equals(input.ScreenHeight) + ) && + ( + this.ScreenWidth == input.ScreenWidth || + this.ScreenWidth.Equals(input.ScreenWidth) + ) && + ( + this.TimeZoneOffset == input.TimeZoneOffset || + this.TimeZoneOffset.Equals(input.TimeZoneOffset) + ) && + ( + this.UserAgent == input.UserAgent || + (this.UserAgent != null && + this.UserAgent.Equals(input.UserAgent)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, BrowserInfo browserInfo, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, browserInfo, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AcceptHeader != null) + { + hashCode = (hashCode * 59) + this.AcceptHeader.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ColorDepth.GetHashCode(); + hashCode = (hashCode * 59) + this.JavaEnabled.GetHashCode(); + hashCode = (hashCode * 59) + this.JavaScriptEnabled.GetHashCode(); + if (this.Language != null) + { + hashCode = (hashCode * 59) + this.Language.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ScreenHeight.GetHashCode(); + hashCode = (hashCode * 59) + this.ScreenWidth.GetHashCode(); + hashCode = (hashCode * 59) + this.TimeZoneOffset.GetHashCode(); + if (this.UserAgent != null) + { + hashCode = (hashCode * 59) + this.UserAgent.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, BrowserInfo browserInfo, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (browserInfo.AcceptHeader == null) - throw new ArgumentNullException(nameof(browserInfo.AcceptHeader), "Property is required for class BrowserInfo."); - - if (browserInfo.Language == null) - throw new ArgumentNullException(nameof(browserInfo.Language), "Property is required for class BrowserInfo."); - - if (browserInfo.UserAgent == null) - throw new ArgumentNullException(nameof(browserInfo.UserAgent), "Property is required for class BrowserInfo."); - - writer.WriteString("acceptHeader", browserInfo.AcceptHeader); - - writer.WriteNumber("colorDepth", browserInfo.ColorDepth); - - writer.WriteBoolean("javaEnabled", browserInfo.JavaEnabled); - - writer.WriteString("language", browserInfo.Language); - - writer.WriteNumber("screenHeight", browserInfo.ScreenHeight); - - writer.WriteNumber("screenWidth", browserInfo.ScreenWidth); - - writer.WriteNumber("timeZoneOffset", browserInfo.TimeZoneOffset); - - writer.WriteString("userAgent", browserInfo.UserAgent); - - if (browserInfo.JavaScriptEnabledOption.IsSet) - writer.WriteBoolean("javaScriptEnabled", browserInfo.JavaScriptEnabledOption.Value.Value); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CancelOrderRequest.cs b/Adyen/Model/Checkout/CancelOrderRequest.cs index a9fd159e9..d9f25067d 100644 --- a/Adyen/Model/Checkout/CancelOrderRequest.cs +++ b/Adyen/Model/Checkout/CancelOrderRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,46 +15,50 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CancelOrderRequest /// - public partial class CancelOrderRequest : IValidatableObject + [DataContract(Name = "CancelOrderRequest")] + public partial class CancelOrderRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The merchant account identifier that orderData belongs to. - /// order - [JsonConstructor] - public CancelOrderRequest(string merchantAccount, EncryptedOrderData order) + [JsonConstructorAttribute] + protected CancelOrderRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// The merchant account identifier that orderData belongs to. (required). + /// order (required). + public CancelOrderRequest(string merchantAccount = default(string), EncryptedOrderData order = default(EncryptedOrderData)) { - MerchantAccount = merchantAccount; - Order = order; - OnCreated(); + this.MerchantAccount = merchantAccount; + this.Order = order; } - partial void OnCreated(); - /// /// The merchant account identifier that orderData belongs to. /// /// The merchant account identifier that orderData belongs to. - [JsonPropertyName("merchantAccount")] + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] public string MerchantAccount { get; set; } /// /// Gets or Sets Order /// - [JsonPropertyName("order")] + [DataMember(Name = "order", IsRequired = false, EmitDefaultValue = false)] public EncryptedOrderData Order { get; set; } /// @@ -71,118 +76,77 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CancelOrderRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CancelOrderRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option merchantAccount = default; - Option order = default; + return this.Equals(input as CancelOrderRequest); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if CancelOrderRequest instances are equal + /// + /// Instance of CancelOrderRequest to be compared + /// Boolean + public bool Equals(CancelOrderRequest input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "order": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - order = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } + return false; } - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class CancelOrderRequest.", nameof(merchantAccount)); - - if (!order.IsSet) - throw new ArgumentException("Property is required for class CancelOrderRequest.", nameof(order)); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class CancelOrderRequest."); - - if (order.IsSet && order.Value == null) - throw new ArgumentNullException(nameof(order), "Property is not nullable for class CancelOrderRequest."); - - return new CancelOrderRequest(merchantAccount.Value, order.Value); + return + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.Order == input.Order || + (this.Order != null && + this.Order.Equals(input.Order)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CancelOrderRequest cancelOrderRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, cancelOrderRequest, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.Order != null) + { + hashCode = (hashCode * 59) + this.Order.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CancelOrderRequest cancelOrderRequest, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (cancelOrderRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(cancelOrderRequest.MerchantAccount), "Property is required for class CancelOrderRequest."); - - if (cancelOrderRequest.Order == null) - throw new ArgumentNullException(nameof(cancelOrderRequest.Order), "Property is required for class CancelOrderRequest."); - - writer.WriteString("merchantAccount", cancelOrderRequest.MerchantAccount); - - writer.WritePropertyName("order"); - JsonSerializer.Serialize(writer, cancelOrderRequest.Order, jsonSerializerOptions); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CancelOrderResponse.cs b/Adyen/Model/Checkout/CancelOrderResponse.cs index 3e34866cf..417804736 100644 --- a/Adyen/Model/Checkout/CancelOrderResponse.cs +++ b/Adyen/Model/Checkout/CancelOrderResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,100 +15,66 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CancelOrderResponse /// - public partial class CancelOrderResponse : IValidatableObject + [DataContract(Name = "CancelOrderResponse")] + public partial class CancelOrderResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// A unique reference of the cancellation request. - /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. - [JsonConstructor] - public CancelOrderResponse(string pspReference, ResultCodeEnum resultCode) - { - PspReference = pspReference; - ResultCode = resultCode; - OnCreated(); - } - - partial void OnCreated(); - /// /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. /// /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. + [JsonConverter(typeof(StringEnumConverter))] public enum ResultCodeEnum { /// /// Enum Received for value: Received /// + [EnumMember(Value = "Received")] Received = 1 + } + /// - /// Returns a + /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. /// - /// - /// - /// - public static ResultCodeEnum ResultCodeEnumFromString(string value) - { - if (value.Equals("Received")) - return ResultCodeEnum.Received; - - throw new NotImplementedException($"Could not convert value to type ResultCodeEnum: '{value}'"); - } - + /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. + [DataMember(Name = "resultCode", IsRequired = false, EmitDefaultValue = false)] + public ResultCodeEnum ResultCode { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static ResultCodeEnum? ResultCodeEnumFromStringOrDefault(string value) - { - if (value.Equals("Received")) - return ResultCodeEnum.Received; - - return null; - } - + [JsonConstructorAttribute] + protected CancelOrderResponse() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string ResultCodeEnumToJsonValue(ResultCodeEnum value) + /// A unique reference of the cancellation request. (required). + /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. (required). + public CancelOrderResponse(string pspReference = default(string), ResultCodeEnum resultCode = default(ResultCodeEnum)) { - if (value == ResultCodeEnum.Received) - return "Received"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.PspReference = pspReference; + this.ResultCode = resultCode; } - /// - /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. - /// - /// The result of the cancellation request. Possible values: * **Received** – Indicates the cancellation has successfully been received by Adyen, and will be processed. - [JsonPropertyName("resultCode")] - public ResultCodeEnum ResultCode { get; set; } - /// /// A unique reference of the cancellation request. /// /// A unique reference of the cancellation request. - [JsonPropertyName("pspReference")] + [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] public string PspReference { get; set; } /// @@ -125,116 +92,73 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CancelOrderResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CancelOrderResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option pspReference = default; - Option resultCode = default; + return this.Equals(input as CancelOrderResponse); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if CancelOrderResponse instances are equal + /// + /// Instance of CancelOrderResponse to be compared + /// Boolean + public bool Equals(CancelOrderResponse input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "resultCode": - string resultCodeRawValue = utf8JsonReader.GetString(); - if (resultCodeRawValue != null) - resultCode = new Option(CancelOrderResponse.ResultCodeEnumFromStringOrDefault(resultCodeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!pspReference.IsSet) - throw new ArgumentException("Property is required for class CancelOrderResponse.", nameof(pspReference)); - - if (!resultCode.IsSet) - throw new ArgumentException("Property is required for class CancelOrderResponse.", nameof(resultCode)); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class CancelOrderResponse."); - - if (resultCode.IsSet && resultCode.Value == null) - throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class CancelOrderResponse."); - - return new CancelOrderResponse(pspReference.Value, resultCode.Value.Value); + return + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.ResultCode == input.ResultCode || + this.ResultCode.Equals(input.ResultCode) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CancelOrderResponse cancelOrderResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, cancelOrderResponse, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ResultCode.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CancelOrderResponse cancelOrderResponse, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (cancelOrderResponse.PspReference == null) - throw new ArgumentNullException(nameof(cancelOrderResponse.PspReference), "Property is required for class CancelOrderResponse."); - - writer.WriteString("pspReference", cancelOrderResponse.PspReference); - - var resultCodeRawValue = CancelOrderResponse.ResultCodeEnumToJsonValue(cancelOrderResponse.ResultCode); - writer.WriteString("resultCode", resultCodeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CardBrandDetails.cs b/Adyen/Model/Checkout/CardBrandDetails.cs index a704e252b..68cc25910 100644 --- a/Adyen/Model/Checkout/CardBrandDetails.cs +++ b/Adyen/Model/Checkout/CardBrandDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,62 +15,47 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CardBrandDetails /// - public partial class CardBrandDetails : IValidatableObject + [DataContract(Name = "CardBrandDetails")] + public partial class CardBrandDetails : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Indicates if you support the card brand. - /// The name of the card brand. - [JsonConstructor] - public CardBrandDetails(Option supported = default, Option type = default) + /// Indicates if you support the card brand.. + /// The name of the card brand.. + public CardBrandDetails(bool? supported = default(bool?), string type = default(string)) { - SupportedOption = supported; - TypeOption = type; - OnCreated(); + this.Supported = supported; + this.Type = type; } - partial void OnCreated(); - - /// - /// Used to track the state of Supported - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SupportedOption { get; private set; } - /// /// Indicates if you support the card brand. /// /// Indicates if you support the card brand. - [JsonPropertyName("supported")] - public bool? Supported { get { return this.SupportedOption; } set { this.SupportedOption = new Option(value); } } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } + [DataMember(Name = "supported", EmitDefaultValue = false)] + public bool? Supported { get; set; } /// /// The name of the card brand. /// /// The name of the card brand. - [JsonPropertyName("type")] - public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } /// /// Returns the string presentation of the object @@ -86,110 +72,73 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CardBrandDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CardBrandDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option supported = default; - Option type = default; + return this.Equals(input as CardBrandDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if CardBrandDetails instances are equal + /// + /// Instance of CardBrandDetails to be compared + /// Boolean + public bool Equals(CardBrandDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "supported": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - supported = new Option(utf8JsonReader.GetBoolean()); - break; - case "type": - type = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (supported.IsSet && supported.Value == null) - throw new ArgumentNullException(nameof(supported), "Property is not nullable for class CardBrandDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CardBrandDetails."); - - return new CardBrandDetails(supported, type); + return + ( + this.Supported == input.Supported || + this.Supported.Equals(input.Supported) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CardBrandDetails cardBrandDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, cardBrandDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Supported.GetHashCode(); + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CardBrandDetails cardBrandDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (cardBrandDetails.TypeOption.IsSet && cardBrandDetails.Type == null) - throw new ArgumentNullException(nameof(cardBrandDetails.Type), "Property is required for class CardBrandDetails."); - - if (cardBrandDetails.SupportedOption.IsSet) - writer.WriteBoolean("supported", cardBrandDetails.SupportedOption.Value.Value); - - if (cardBrandDetails.TypeOption.IsSet) - writer.WriteString("type", cardBrandDetails.Type); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CardDetails.cs b/Adyen/Model/Checkout/CardDetails.cs index 611cad8af..70db52490 100644 --- a/Adyen/Model/Checkout/CardDetails.cs +++ b/Adyen/Model/Checkout/CardDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,621 +15,330 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CardDetails /// - public partial class CardDetails : IValidatableObject + [DataContract(Name = "CardDetails")] + public partial class CardDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Secondary brand of the card. For example: **plastix**, **hmclub**. - /// The checkout attempt identifier. - /// cupsecureplusSmscode - /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. - /// The encrypted card number. - /// The encrypted card expiry month. - /// The encrypted card expiry year. - /// The encrypted card verification code. - /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - /// The encoded fastlane data blob - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - /// The name of the card holder. - /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. - /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. - /// An identifier used for the Click to Pay transaction. - /// The SRC reference for the Click to Pay token. - /// The scheme that is being used for Click to Pay. - /// The reference for the Click to Pay token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - /// Default payment method details. Common for scheme payment methods, and for simple payment method details. (default to TypeEnum.Scheme) - [JsonConstructor] - public CardDetails(Option brand = default, Option checkoutAttemptId = default, Option cupsecureplusSmscode = default, Option cvc = default, Option encryptedCard = default, Option encryptedCardNumber = default, Option encryptedExpiryMonth = default, Option encryptedExpiryYear = default, Option encryptedSecurityCode = default, Option expiryMonth = default, Option expiryYear = default, Option fastlaneData = default, Option fundingSource = default, Option holderName = default, Option networkPaymentReference = default, Option number = default, Option recurringDetailReference = default, Option shopperNotificationReference = default, Option srcCorrelationId = default, Option srcDigitalCardId = default, Option srcScheme = default, Option srcTokenReference = default, Option storedPaymentMethodId = default, Option threeDS2SdkVersion = default, Option type = default) - { - BrandOption = brand; - CheckoutAttemptIdOption = checkoutAttemptId; - CupsecureplusSmscodeOption = cupsecureplusSmscode; - CvcOption = cvc; - EncryptedCardOption = encryptedCard; - EncryptedCardNumberOption = encryptedCardNumber; - EncryptedExpiryMonthOption = encryptedExpiryMonth; - EncryptedExpiryYearOption = encryptedExpiryYear; - EncryptedSecurityCodeOption = encryptedSecurityCode; - ExpiryMonthOption = expiryMonth; - ExpiryYearOption = expiryYear; - FastlaneDataOption = fastlaneData; - FundingSourceOption = fundingSource; - HolderNameOption = holderName; - NetworkPaymentReferenceOption = networkPaymentReference; - NumberOption = number; - RecurringDetailReferenceOption = recurringDetailReference; - ShopperNotificationReferenceOption = shopperNotificationReference; - SrcCorrelationIdOption = srcCorrelationId; - SrcDigitalCardIdOption = srcDigitalCardId; - SrcSchemeOption = srcScheme; - SrcTokenReferenceOption = srcTokenReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - ThreeDS2SdkVersionOption = threeDS2SdkVersion; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// + [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// + [EnumMember(Value = "debit")] Debit = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static FundingSourceEnum FundingSourceEnumFromString(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) - { - if (value == FundingSourceEnum.Credit) - return "credit"; - - if (value == FundingSourceEnum.Debit) - return "debit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonPropertyName("fundingSource")] - public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Bcmc for value: bcmc /// + [EnumMember(Value = "bcmc")] Bcmc = 1, /// /// Enum Scheme for value: scheme /// + [EnumMember(Value = "scheme")] Scheme = 2, /// /// Enum NetworkToken for value: networkToken /// + [EnumMember(Value = "networkToken")] NetworkToken = 3, /// /// Enum Giftcard for value: giftcard /// + [EnumMember(Value = "giftcard")] Giftcard = 4, /// /// Enum Card for value: card /// + [EnumMember(Value = "card")] Card = 5, /// /// Enum Clicktopay for value: clicktopay /// + [EnumMember(Value = "clicktopay")] Clicktopay = 6 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("bcmc")) - return TypeEnum.Bcmc; - - if (value.Equals("scheme")) - return TypeEnum.Scheme; - - if (value.Equals("networkToken")) - return TypeEnum.NetworkToken; - - if (value.Equals("giftcard")) - return TypeEnum.Giftcard; - if (value.Equals("card")) - return TypeEnum.Card; - - if (value.Equals("clicktopay")) - return TypeEnum.Clicktopay; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("bcmc")) - return TypeEnum.Bcmc; - - if (value.Equals("scheme")) - return TypeEnum.Scheme; - - if (value.Equals("networkToken")) - return TypeEnum.NetworkToken; - - if (value.Equals("giftcard")) - return TypeEnum.Giftcard; - - if (value.Equals("card")) - return TypeEnum.Card; - - if (value.Equals("clicktopay")) - return TypeEnum.Clicktopay; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Bcmc) - return "bcmc"; - - if (value == TypeEnum.Scheme) - return "scheme"; - - if (value == TypeEnum.NetworkToken) - return "networkToken"; - - if (value == TypeEnum.Giftcard) - return "giftcard"; - - if (value == TypeEnum.Card) - return "card"; - - if (value == TypeEnum.Clicktopay) - return "clicktopay"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of Brand + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BrandOption { get; private set; } + /// Secondary brand of the card. For example: **plastix**, **hmclub**.. + /// The checkout attempt identifier.. + /// cupsecureplusSmscode. + /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. + /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details.. + /// The encrypted card number.. + /// The encrypted card expiry month.. + /// The encrypted card expiry year.. + /// This field contains an encrypted, one-time password or an authentication code provided by the cardholder.. + /// The encrypted card verification code.. + /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. + /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. + /// The encoded fastlane data blob. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. + /// The name of the card holder.. + /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment.. + /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India.. + /// An identifier used for the Click to Pay transaction.. + /// The SRC reference for the Click to Pay token.. + /// The scheme that is being used for Click to Pay.. + /// The reference for the Click to Pay token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK.. + /// Default payment method details. Common for scheme payment methods, and for simple payment method details. (default to TypeEnum.Scheme). + public CardDetails(string brand = default(string), string checkoutAttemptId = default(string), string cupsecureplusSmscode = default(string), string cvc = default(string), string encryptedCard = default(string), string encryptedCardNumber = default(string), string encryptedExpiryMonth = default(string), string encryptedExpiryYear = default(string), string encryptedPassword = default(string), string encryptedSecurityCode = default(string), string expiryMonth = default(string), string expiryYear = default(string), string fastlaneData = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string holderName = default(string), string networkPaymentReference = default(string), string number = default(string), string recurringDetailReference = default(string), string shopperNotificationReference = default(string), string srcCorrelationId = default(string), string srcDigitalCardId = default(string), string srcScheme = default(string), string srcTokenReference = default(string), string storedPaymentMethodId = default(string), string threeDS2SdkVersion = default(string), TypeEnum? type = TypeEnum.Scheme) + { + this.Brand = brand; + this.CheckoutAttemptId = checkoutAttemptId; + this.CupsecureplusSmscode = cupsecureplusSmscode; + this.Cvc = cvc; + this.EncryptedCard = encryptedCard; + this.EncryptedCardNumber = encryptedCardNumber; + this.EncryptedExpiryMonth = encryptedExpiryMonth; + this.EncryptedExpiryYear = encryptedExpiryYear; + this.EncryptedPassword = encryptedPassword; + this.EncryptedSecurityCode = encryptedSecurityCode; + this.ExpiryMonth = expiryMonth; + this.ExpiryYear = expiryYear; + this.FastlaneData = fastlaneData; + this.FundingSource = fundingSource; + this.HolderName = holderName; + this.NetworkPaymentReference = networkPaymentReference; + this.Number = number; + this.RecurringDetailReference = recurringDetailReference; + this.ShopperNotificationReference = shopperNotificationReference; + this.SrcCorrelationId = srcCorrelationId; + this.SrcDigitalCardId = srcDigitalCardId; + this.SrcScheme = srcScheme; + this.SrcTokenReference = srcTokenReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.ThreeDS2SdkVersion = threeDS2SdkVersion; + this.Type = type; + } /// /// Secondary brand of the card. For example: **plastix**, **hmclub**. /// /// Secondary brand of the card. For example: **plastix**, **hmclub**. - [JsonPropertyName("brand")] - public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } - - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + [DataMember(Name = "brand", EmitDefaultValue = false)] + public string Brand { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of CupsecureplusSmscode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CupsecureplusSmscodeOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Gets or Sets CupsecureplusSmscode /// - [JsonPropertyName("cupsecureplus.smscode")] - [Obsolete] - public string CupsecureplusSmscode { get { return this.CupsecureplusSmscodeOption; } set { this.CupsecureplusSmscodeOption = new Option(value); } } - - /// - /// Used to track the state of Cvc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CvcOption { get; private set; } + [DataMember(Name = "cupsecureplus.smscode", EmitDefaultValue = false)] + [Obsolete("")] + public string CupsecureplusSmscode { get; set; } /// /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [JsonPropertyName("cvc")] - public string Cvc { get { return this.CvcOption; } set { this.CvcOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedCard - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedCardOption { get; private set; } + [DataMember(Name = "cvc", EmitDefaultValue = false)] + public string Cvc { get; set; } /// /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. /// /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. - [JsonPropertyName("encryptedCard")] - public string EncryptedCard { get { return this.EncryptedCardOption; } set { this.EncryptedCardOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedCardNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedCardNumberOption { get; private set; } + [DataMember(Name = "encryptedCard", EmitDefaultValue = false)] + public string EncryptedCard { get; set; } /// /// The encrypted card number. /// /// The encrypted card number. - [JsonPropertyName("encryptedCardNumber")] - public string EncryptedCardNumber { get { return this.EncryptedCardNumberOption; } set { this.EncryptedCardNumberOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedExpiryMonth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedExpiryMonthOption { get; private set; } + [DataMember(Name = "encryptedCardNumber", EmitDefaultValue = false)] + public string EncryptedCardNumber { get; set; } /// /// The encrypted card expiry month. /// /// The encrypted card expiry month. - [JsonPropertyName("encryptedExpiryMonth")] - public string EncryptedExpiryMonth { get { return this.EncryptedExpiryMonthOption; } set { this.EncryptedExpiryMonthOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedExpiryYear - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedExpiryYearOption { get; private set; } + [DataMember(Name = "encryptedExpiryMonth", EmitDefaultValue = false)] + public string EncryptedExpiryMonth { get; set; } /// /// The encrypted card expiry year. /// /// The encrypted card expiry year. - [JsonPropertyName("encryptedExpiryYear")] - public string EncryptedExpiryYear { get { return this.EncryptedExpiryYearOption; } set { this.EncryptedExpiryYearOption = new Option(value); } } + [DataMember(Name = "encryptedExpiryYear", EmitDefaultValue = false)] + public string EncryptedExpiryYear { get; set; } /// - /// Used to track the state of EncryptedSecurityCode + /// This field contains an encrypted, one-time password or an authentication code provided by the cardholder. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedSecurityCodeOption { get; private set; } + /// This field contains an encrypted, one-time password or an authentication code provided by the cardholder. + [DataMember(Name = "encryptedPassword", EmitDefaultValue = false)] + public string EncryptedPassword { get; set; } /// /// The encrypted card verification code. /// /// The encrypted card verification code. - [JsonPropertyName("encryptedSecurityCode")] - public string EncryptedSecurityCode { get { return this.EncryptedSecurityCodeOption; } set { this.EncryptedSecurityCodeOption = new Option(value); } } - - /// - /// Used to track the state of ExpiryMonth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiryMonthOption { get; private set; } + [DataMember(Name = "encryptedSecurityCode", EmitDefaultValue = false)] + public string EncryptedSecurityCode { get; set; } /// /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [JsonPropertyName("expiryMonth")] - public string ExpiryMonth { get { return this.ExpiryMonthOption; } set { this.ExpiryMonthOption = new Option(value); } } - - /// - /// Used to track the state of ExpiryYear - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiryYearOption { get; private set; } + [DataMember(Name = "expiryMonth", EmitDefaultValue = false)] + public string ExpiryMonth { get; set; } /// /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [JsonPropertyName("expiryYear")] - public string ExpiryYear { get { return this.ExpiryYearOption; } set { this.ExpiryYearOption = new Option(value); } } - - /// - /// Used to track the state of FastlaneData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FastlaneDataOption { get; private set; } + [DataMember(Name = "expiryYear", EmitDefaultValue = false)] + public string ExpiryYear { get; set; } /// /// The encoded fastlane data blob /// /// The encoded fastlane data blob - [JsonPropertyName("fastlaneData")] - public string FastlaneData { get { return this.FastlaneDataOption; } set { this.FastlaneDataOption = new Option(value); } } - - /// - /// Used to track the state of HolderName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option HolderNameOption { get; private set; } + [DataMember(Name = "fastlaneData", EmitDefaultValue = false)] + public string FastlaneData { get; set; } /// /// The name of the card holder. /// /// The name of the card holder. - [JsonPropertyName("holderName")] - public string HolderName { get { return this.HolderNameOption; } set { this.HolderNameOption = new Option(value); } } + [DataMember(Name = "holderName", EmitDefaultValue = false)] + public string HolderName { get; set; } /// - /// Used to track the state of NetworkPaymentReference + /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NetworkPaymentReferenceOption { get; private set; } - - /// - /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. - /// - /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. - [JsonPropertyName("networkPaymentReference")] - public string NetworkPaymentReference { get { return this.NetworkPaymentReferenceOption; } set { this.NetworkPaymentReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Number - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NumberOption { get; private set; } + /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. + [DataMember(Name = "networkPaymentReference", EmitDefaultValue = false)] + public string NetworkPaymentReference { get; set; } /// /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [JsonPropertyName("number")] - public string Number { get { return this.NumberOption; } set { this.NumberOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "number", EmitDefaultValue = false)] + public string Number { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperNotificationReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNotificationReferenceOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. - [JsonPropertyName("shopperNotificationReference")] - public string ShopperNotificationReference { get { return this.ShopperNotificationReferenceOption; } set { this.ShopperNotificationReferenceOption = new Option(value); } } - - /// - /// Used to track the state of SrcCorrelationId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SrcCorrelationIdOption { get; private set; } + [DataMember(Name = "shopperNotificationReference", EmitDefaultValue = false)] + public string ShopperNotificationReference { get; set; } /// /// An identifier used for the Click to Pay transaction. /// /// An identifier used for the Click to Pay transaction. - [JsonPropertyName("srcCorrelationId")] - public string SrcCorrelationId { get { return this.SrcCorrelationIdOption; } set { this.SrcCorrelationIdOption = new Option(value); } } - - /// - /// Used to track the state of SrcDigitalCardId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SrcDigitalCardIdOption { get; private set; } + [DataMember(Name = "srcCorrelationId", EmitDefaultValue = false)] + public string SrcCorrelationId { get; set; } /// /// The SRC reference for the Click to Pay token. /// /// The SRC reference for the Click to Pay token. - [JsonPropertyName("srcDigitalCardId")] - public string SrcDigitalCardId { get { return this.SrcDigitalCardIdOption; } set { this.SrcDigitalCardIdOption = new Option(value); } } - - /// - /// Used to track the state of SrcScheme - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SrcSchemeOption { get; private set; } + [DataMember(Name = "srcDigitalCardId", EmitDefaultValue = false)] + public string SrcDigitalCardId { get; set; } /// /// The scheme that is being used for Click to Pay. /// /// The scheme that is being used for Click to Pay. - [JsonPropertyName("srcScheme")] - public string SrcScheme { get { return this.SrcSchemeOption; } set { this.SrcSchemeOption = new Option(value); } } - - /// - /// Used to track the state of SrcTokenReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SrcTokenReferenceOption { get; private set; } + [DataMember(Name = "srcScheme", EmitDefaultValue = false)] + public string SrcScheme { get; set; } /// /// The reference for the Click to Pay token. /// /// The reference for the Click to Pay token. - [JsonPropertyName("srcTokenReference")] - public string SrcTokenReference { get { return this.SrcTokenReferenceOption; } set { this.SrcTokenReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "srcTokenReference", EmitDefaultValue = false)] + public string SrcTokenReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2SdkVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2SdkVersionOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - [JsonPropertyName("threeDS2SdkVersion")] - public string ThreeDS2SdkVersion { get { return this.ThreeDS2SdkVersionOption; } set { this.ThreeDS2SdkVersionOption = new Option(value); } } + [DataMember(Name = "threeDS2SdkVersion", EmitDefaultValue = false)] + public string ThreeDS2SdkVersion { get; set; } /// /// Returns the string presentation of the object @@ -646,6 +356,7 @@ public override string ToString() sb.Append(" EncryptedCardNumber: ").Append(EncryptedCardNumber).Append("\n"); sb.Append(" EncryptedExpiryMonth: ").Append(EncryptedExpiryMonth).Append("\n"); sb.Append(" EncryptedExpiryYear: ").Append(EncryptedExpiryYear).Append("\n"); + sb.Append(" EncryptedPassword: ").Append(EncryptedPassword).Append("\n"); sb.Append(" EncryptedSecurityCode: ").Append(EncryptedSecurityCode).Append("\n"); sb.Append(" ExpiryMonth: ").Append(ExpiryMonth).Append("\n"); sb.Append(" ExpiryYear: ").Append(ExpiryYear).Append("\n"); @@ -667,457 +378,334 @@ public override string ToString() return sb.ToString(); } + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CardDetails); + } + + /// + /// Returns true if CardDetails instances are equal + /// + /// Instance of CardDetails to be compared + /// Boolean + public bool Equals(CardDetails input) + { + if (input == null) + { + return false; + } + return + ( + this.Brand == input.Brand || + (this.Brand != null && + this.Brand.Equals(input.Brand)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.CupsecureplusSmscode == input.CupsecureplusSmscode || + (this.CupsecureplusSmscode != null && + this.CupsecureplusSmscode.Equals(input.CupsecureplusSmscode)) + ) && + ( + this.Cvc == input.Cvc || + (this.Cvc != null && + this.Cvc.Equals(input.Cvc)) + ) && + ( + this.EncryptedCard == input.EncryptedCard || + (this.EncryptedCard != null && + this.EncryptedCard.Equals(input.EncryptedCard)) + ) && + ( + this.EncryptedCardNumber == input.EncryptedCardNumber || + (this.EncryptedCardNumber != null && + this.EncryptedCardNumber.Equals(input.EncryptedCardNumber)) + ) && + ( + this.EncryptedExpiryMonth == input.EncryptedExpiryMonth || + (this.EncryptedExpiryMonth != null && + this.EncryptedExpiryMonth.Equals(input.EncryptedExpiryMonth)) + ) && + ( + this.EncryptedExpiryYear == input.EncryptedExpiryYear || + (this.EncryptedExpiryYear != null && + this.EncryptedExpiryYear.Equals(input.EncryptedExpiryYear)) + ) && + ( + this.EncryptedPassword == input.EncryptedPassword || + (this.EncryptedPassword != null && + this.EncryptedPassword.Equals(input.EncryptedPassword)) + ) && + ( + this.EncryptedSecurityCode == input.EncryptedSecurityCode || + (this.EncryptedSecurityCode != null && + this.EncryptedSecurityCode.Equals(input.EncryptedSecurityCode)) + ) && + ( + this.ExpiryMonth == input.ExpiryMonth || + (this.ExpiryMonth != null && + this.ExpiryMonth.Equals(input.ExpiryMonth)) + ) && + ( + this.ExpiryYear == input.ExpiryYear || + (this.ExpiryYear != null && + this.ExpiryYear.Equals(input.ExpiryYear)) + ) && + ( + this.FastlaneData == input.FastlaneData || + (this.FastlaneData != null && + this.FastlaneData.Equals(input.FastlaneData)) + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource.Equals(input.FundingSource) + ) && + ( + this.HolderName == input.HolderName || + (this.HolderName != null && + this.HolderName.Equals(input.HolderName)) + ) && + ( + this.NetworkPaymentReference == input.NetworkPaymentReference || + (this.NetworkPaymentReference != null && + this.NetworkPaymentReference.Equals(input.NetworkPaymentReference)) + ) && + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.ShopperNotificationReference == input.ShopperNotificationReference || + (this.ShopperNotificationReference != null && + this.ShopperNotificationReference.Equals(input.ShopperNotificationReference)) + ) && + ( + this.SrcCorrelationId == input.SrcCorrelationId || + (this.SrcCorrelationId != null && + this.SrcCorrelationId.Equals(input.SrcCorrelationId)) + ) && + ( + this.SrcDigitalCardId == input.SrcDigitalCardId || + (this.SrcDigitalCardId != null && + this.SrcDigitalCardId.Equals(input.SrcDigitalCardId)) + ) && + ( + this.SrcScheme == input.SrcScheme || + (this.SrcScheme != null && + this.SrcScheme.Equals(input.SrcScheme)) + ) && + ( + this.SrcTokenReference == input.SrcTokenReference || + (this.SrcTokenReference != null && + this.SrcTokenReference.Equals(input.SrcTokenReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.ThreeDS2SdkVersion == input.ThreeDS2SdkVersion || + (this.ThreeDS2SdkVersion != null && + this.ThreeDS2SdkVersion.Equals(input.ThreeDS2SdkVersion)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Brand != null) + { + hashCode = (hashCode * 59) + this.Brand.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.CupsecureplusSmscode != null) + { + hashCode = (hashCode * 59) + this.CupsecureplusSmscode.GetHashCode(); + } + if (this.Cvc != null) + { + hashCode = (hashCode * 59) + this.Cvc.GetHashCode(); + } + if (this.EncryptedCard != null) + { + hashCode = (hashCode * 59) + this.EncryptedCard.GetHashCode(); + } + if (this.EncryptedCardNumber != null) + { + hashCode = (hashCode * 59) + this.EncryptedCardNumber.GetHashCode(); + } + if (this.EncryptedExpiryMonth != null) + { + hashCode = (hashCode * 59) + this.EncryptedExpiryMonth.GetHashCode(); + } + if (this.EncryptedExpiryYear != null) + { + hashCode = (hashCode * 59) + this.EncryptedExpiryYear.GetHashCode(); + } + if (this.EncryptedPassword != null) + { + hashCode = (hashCode * 59) + this.EncryptedPassword.GetHashCode(); + } + if (this.EncryptedSecurityCode != null) + { + hashCode = (hashCode * 59) + this.EncryptedSecurityCode.GetHashCode(); + } + if (this.ExpiryMonth != null) + { + hashCode = (hashCode * 59) + this.ExpiryMonth.GetHashCode(); + } + if (this.ExpiryYear != null) + { + hashCode = (hashCode * 59) + this.ExpiryYear.GetHashCode(); + } + if (this.FastlaneData != null) + { + hashCode = (hashCode * 59) + this.FastlaneData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + if (this.HolderName != null) + { + hashCode = (hashCode * 59) + this.HolderName.GetHashCode(); + } + if (this.NetworkPaymentReference != null) + { + hashCode = (hashCode * 59) + this.NetworkPaymentReference.GetHashCode(); + } + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.ShopperNotificationReference != null) + { + hashCode = (hashCode * 59) + this.ShopperNotificationReference.GetHashCode(); + } + if (this.SrcCorrelationId != null) + { + hashCode = (hashCode * 59) + this.SrcCorrelationId.GetHashCode(); + } + if (this.SrcDigitalCardId != null) + { + hashCode = (hashCode * 59) + this.SrcDigitalCardId.GetHashCode(); + } + if (this.SrcScheme != null) + { + hashCode = (hashCode * 59) + this.SrcScheme.GetHashCode(); + } + if (this.SrcTokenReference != null) + { + hashCode = (hashCode * 59) + this.SrcTokenReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.ThreeDS2SdkVersion != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2SdkVersion.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } + } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { // EncryptedCard (string) maxLength if (this.EncryptedCard != null && this.EncryptedCard.Length > 40000) { - yield return new ValidationResult("Invalid value for EncryptedCard, length must be less than 40000.", new [] { "EncryptedCard" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCard, length must be less than 40000.", new [] { "EncryptedCard" }); } // EncryptedCardNumber (string) maxLength if (this.EncryptedCardNumber != null && this.EncryptedCardNumber.Length > 15000) { - yield return new ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); } // EncryptedExpiryMonth (string) maxLength if (this.EncryptedExpiryMonth != null && this.EncryptedExpiryMonth.Length > 15000) { - yield return new ValidationResult("Invalid value for EncryptedExpiryMonth, length must be less than 15000.", new [] { "EncryptedExpiryMonth" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedExpiryMonth, length must be less than 15000.", new [] { "EncryptedExpiryMonth" }); } // EncryptedExpiryYear (string) maxLength if (this.EncryptedExpiryYear != null && this.EncryptedExpiryYear.Length > 15000) { - yield return new ValidationResult("Invalid value for EncryptedExpiryYear, length must be less than 15000.", new [] { "EncryptedExpiryYear" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedExpiryYear, length must be less than 15000.", new [] { "EncryptedExpiryYear" }); } // EncryptedSecurityCode (string) maxLength if (this.EncryptedSecurityCode != null && this.EncryptedSecurityCode.Length > 15000) { - yield return new ValidationResult("Invalid value for EncryptedSecurityCode, length must be less than 15000.", new [] { "EncryptedSecurityCode" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedSecurityCode, length must be less than 15000.", new [] { "EncryptedSecurityCode" }); } // HolderName (string) maxLength if (this.HolderName != null && this.HolderName.Length > 15000) { - yield return new ValidationResult("Invalid value for HolderName, length must be less than 15000.", new [] { "HolderName" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for HolderName, length must be less than 15000.", new [] { "HolderName" }); } // StoredPaymentMethodId (string) maxLength if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); } // ThreeDS2SdkVersion (string) maxLength if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) { - yield return new ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); } yield break; } } - /// - /// A Json converter for type - /// - public class CardDetailsJsonConverter : JsonConverter - { - /// - /// Deserializes json to - /// - /// - /// - /// - /// - /// - public override CardDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) - { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option brand = default; - Option checkoutAttemptId = default; - Option cupsecureplusSmscode = default; - Option cvc = default; - Option encryptedCard = default; - Option encryptedCardNumber = default; - Option encryptedExpiryMonth = default; - Option encryptedExpiryYear = default; - Option encryptedSecurityCode = default; - Option expiryMonth = default; - Option expiryYear = default; - Option fastlaneData = default; - Option fundingSource = default; - Option holderName = default; - Option networkPaymentReference = default; - Option number = default; - Option recurringDetailReference = default; - Option shopperNotificationReference = default; - Option srcCorrelationId = default; - Option srcDigitalCardId = default; - Option srcScheme = default; - Option srcTokenReference = default; - Option storedPaymentMethodId = default; - Option threeDS2SdkVersion = default; - Option type = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "brand": - brand = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "cupsecureplus.smscode": - cupsecureplusSmscode = new Option(utf8JsonReader.GetString()); - break; - case "cvc": - cvc = new Option(utf8JsonReader.GetString()); - break; - case "encryptedCard": - encryptedCard = new Option(utf8JsonReader.GetString()); - break; - case "encryptedCardNumber": - encryptedCardNumber = new Option(utf8JsonReader.GetString()); - break; - case "encryptedExpiryMonth": - encryptedExpiryMonth = new Option(utf8JsonReader.GetString()); - break; - case "encryptedExpiryYear": - encryptedExpiryYear = new Option(utf8JsonReader.GetString()); - break; - case "encryptedSecurityCode": - encryptedSecurityCode = new Option(utf8JsonReader.GetString()); - break; - case "expiryMonth": - expiryMonth = new Option(utf8JsonReader.GetString()); - break; - case "expiryYear": - expiryYear = new Option(utf8JsonReader.GetString()); - break; - case "fastlaneData": - fastlaneData = new Option(utf8JsonReader.GetString()); - break; - case "fundingSource": - string fundingSourceRawValue = utf8JsonReader.GetString(); - if (fundingSourceRawValue != null) - fundingSource = new Option(CardDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); - break; - case "holderName": - holderName = new Option(utf8JsonReader.GetString()); - break; - case "networkPaymentReference": - networkPaymentReference = new Option(utf8JsonReader.GetString()); - break; - case "number": - number = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "shopperNotificationReference": - shopperNotificationReference = new Option(utf8JsonReader.GetString()); - break; - case "srcCorrelationId": - srcCorrelationId = new Option(utf8JsonReader.GetString()); - break; - case "srcDigitalCardId": - srcDigitalCardId = new Option(utf8JsonReader.GetString()); - break; - case "srcScheme": - srcScheme = new Option(utf8JsonReader.GetString()); - break; - case "srcTokenReference": - srcTokenReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2SdkVersion": - threeDS2SdkVersion = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(CardDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } - } - - if (brand.IsSet && brand.Value == null) - throw new ArgumentNullException(nameof(brand), "Property is not nullable for class CardDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class CardDetails."); - - if (cupsecureplusSmscode.IsSet && cupsecureplusSmscode.Value == null) - throw new ArgumentNullException(nameof(cupsecureplusSmscode), "Property is not nullable for class CardDetails."); - - if (cvc.IsSet && cvc.Value == null) - throw new ArgumentNullException(nameof(cvc), "Property is not nullable for class CardDetails."); - - if (encryptedCard.IsSet && encryptedCard.Value == null) - throw new ArgumentNullException(nameof(encryptedCard), "Property is not nullable for class CardDetails."); - - if (encryptedCardNumber.IsSet && encryptedCardNumber.Value == null) - throw new ArgumentNullException(nameof(encryptedCardNumber), "Property is not nullable for class CardDetails."); - - if (encryptedExpiryMonth.IsSet && encryptedExpiryMonth.Value == null) - throw new ArgumentNullException(nameof(encryptedExpiryMonth), "Property is not nullable for class CardDetails."); - - if (encryptedExpiryYear.IsSet && encryptedExpiryYear.Value == null) - throw new ArgumentNullException(nameof(encryptedExpiryYear), "Property is not nullable for class CardDetails."); - - if (encryptedSecurityCode.IsSet && encryptedSecurityCode.Value == null) - throw new ArgumentNullException(nameof(encryptedSecurityCode), "Property is not nullable for class CardDetails."); - - if (expiryMonth.IsSet && expiryMonth.Value == null) - throw new ArgumentNullException(nameof(expiryMonth), "Property is not nullable for class CardDetails."); - - if (expiryYear.IsSet && expiryYear.Value == null) - throw new ArgumentNullException(nameof(expiryYear), "Property is not nullable for class CardDetails."); - - if (fastlaneData.IsSet && fastlaneData.Value == null) - throw new ArgumentNullException(nameof(fastlaneData), "Property is not nullable for class CardDetails."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class CardDetails."); - - if (holderName.IsSet && holderName.Value == null) - throw new ArgumentNullException(nameof(holderName), "Property is not nullable for class CardDetails."); - - if (networkPaymentReference.IsSet && networkPaymentReference.Value == null) - throw new ArgumentNullException(nameof(networkPaymentReference), "Property is not nullable for class CardDetails."); - - if (number.IsSet && number.Value == null) - throw new ArgumentNullException(nameof(number), "Property is not nullable for class CardDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class CardDetails."); - - if (shopperNotificationReference.IsSet && shopperNotificationReference.Value == null) - throw new ArgumentNullException(nameof(shopperNotificationReference), "Property is not nullable for class CardDetails."); - - if (srcCorrelationId.IsSet && srcCorrelationId.Value == null) - throw new ArgumentNullException(nameof(srcCorrelationId), "Property is not nullable for class CardDetails."); - - if (srcDigitalCardId.IsSet && srcDigitalCardId.Value == null) - throw new ArgumentNullException(nameof(srcDigitalCardId), "Property is not nullable for class CardDetails."); - - if (srcScheme.IsSet && srcScheme.Value == null) - throw new ArgumentNullException(nameof(srcScheme), "Property is not nullable for class CardDetails."); - - if (srcTokenReference.IsSet && srcTokenReference.Value == null) - throw new ArgumentNullException(nameof(srcTokenReference), "Property is not nullable for class CardDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class CardDetails."); - - if (threeDS2SdkVersion.IsSet && threeDS2SdkVersion.Value == null) - throw new ArgumentNullException(nameof(threeDS2SdkVersion), "Property is not nullable for class CardDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CardDetails."); - - return new CardDetails(brand, checkoutAttemptId, cupsecureplusSmscode, cvc, encryptedCard, encryptedCardNumber, encryptedExpiryMonth, encryptedExpiryYear, encryptedSecurityCode, expiryMonth, expiryYear, fastlaneData, fundingSource, holderName, networkPaymentReference, number, recurringDetailReference, shopperNotificationReference, srcCorrelationId, srcDigitalCardId, srcScheme, srcTokenReference, storedPaymentMethodId, threeDS2SdkVersion, type); - } - - /// - /// Serializes a - /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CardDetails cardDetails, JsonSerializerOptions jsonSerializerOptions) - { - writer.WriteStartObject(); - - WriteProperties(writer, cardDetails, jsonSerializerOptions); - writer.WriteEndObject(); - } - - /// - /// Serializes the properties of - /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CardDetails cardDetails, JsonSerializerOptions jsonSerializerOptions) - { - if (cardDetails.BrandOption.IsSet && cardDetails.Brand == null) - throw new ArgumentNullException(nameof(cardDetails.Brand), "Property is required for class CardDetails."); - - if (cardDetails.CheckoutAttemptIdOption.IsSet && cardDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(cardDetails.CheckoutAttemptId), "Property is required for class CardDetails."); - - if (cardDetails.CupsecureplusSmscodeOption.IsSet && cardDetails.CupsecureplusSmscode == null) - throw new ArgumentNullException(nameof(cardDetails.CupsecureplusSmscode), "Property is required for class CardDetails."); - - if (cardDetails.CvcOption.IsSet && cardDetails.Cvc == null) - throw new ArgumentNullException(nameof(cardDetails.Cvc), "Property is required for class CardDetails."); - - if (cardDetails.EncryptedCardOption.IsSet && cardDetails.EncryptedCard == null) - throw new ArgumentNullException(nameof(cardDetails.EncryptedCard), "Property is required for class CardDetails."); - - if (cardDetails.EncryptedCardNumberOption.IsSet && cardDetails.EncryptedCardNumber == null) - throw new ArgumentNullException(nameof(cardDetails.EncryptedCardNumber), "Property is required for class CardDetails."); - - if (cardDetails.EncryptedExpiryMonthOption.IsSet && cardDetails.EncryptedExpiryMonth == null) - throw new ArgumentNullException(nameof(cardDetails.EncryptedExpiryMonth), "Property is required for class CardDetails."); - - if (cardDetails.EncryptedExpiryYearOption.IsSet && cardDetails.EncryptedExpiryYear == null) - throw new ArgumentNullException(nameof(cardDetails.EncryptedExpiryYear), "Property is required for class CardDetails."); - - if (cardDetails.EncryptedSecurityCodeOption.IsSet && cardDetails.EncryptedSecurityCode == null) - throw new ArgumentNullException(nameof(cardDetails.EncryptedSecurityCode), "Property is required for class CardDetails."); - - if (cardDetails.ExpiryMonthOption.IsSet && cardDetails.ExpiryMonth == null) - throw new ArgumentNullException(nameof(cardDetails.ExpiryMonth), "Property is required for class CardDetails."); - - if (cardDetails.ExpiryYearOption.IsSet && cardDetails.ExpiryYear == null) - throw new ArgumentNullException(nameof(cardDetails.ExpiryYear), "Property is required for class CardDetails."); - - if (cardDetails.FastlaneDataOption.IsSet && cardDetails.FastlaneData == null) - throw new ArgumentNullException(nameof(cardDetails.FastlaneData), "Property is required for class CardDetails."); - - if (cardDetails.HolderNameOption.IsSet && cardDetails.HolderName == null) - throw new ArgumentNullException(nameof(cardDetails.HolderName), "Property is required for class CardDetails."); - - if (cardDetails.NetworkPaymentReferenceOption.IsSet && cardDetails.NetworkPaymentReference == null) - throw new ArgumentNullException(nameof(cardDetails.NetworkPaymentReference), "Property is required for class CardDetails."); - - if (cardDetails.NumberOption.IsSet && cardDetails.Number == null) - throw new ArgumentNullException(nameof(cardDetails.Number), "Property is required for class CardDetails."); - - if (cardDetails.RecurringDetailReferenceOption.IsSet && cardDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(cardDetails.RecurringDetailReference), "Property is required for class CardDetails."); - - if (cardDetails.ShopperNotificationReferenceOption.IsSet && cardDetails.ShopperNotificationReference == null) - throw new ArgumentNullException(nameof(cardDetails.ShopperNotificationReference), "Property is required for class CardDetails."); - - if (cardDetails.SrcCorrelationIdOption.IsSet && cardDetails.SrcCorrelationId == null) - throw new ArgumentNullException(nameof(cardDetails.SrcCorrelationId), "Property is required for class CardDetails."); - - if (cardDetails.SrcDigitalCardIdOption.IsSet && cardDetails.SrcDigitalCardId == null) - throw new ArgumentNullException(nameof(cardDetails.SrcDigitalCardId), "Property is required for class CardDetails."); - - if (cardDetails.SrcSchemeOption.IsSet && cardDetails.SrcScheme == null) - throw new ArgumentNullException(nameof(cardDetails.SrcScheme), "Property is required for class CardDetails."); - - if (cardDetails.SrcTokenReferenceOption.IsSet && cardDetails.SrcTokenReference == null) - throw new ArgumentNullException(nameof(cardDetails.SrcTokenReference), "Property is required for class CardDetails."); - - if (cardDetails.StoredPaymentMethodIdOption.IsSet && cardDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(cardDetails.StoredPaymentMethodId), "Property is required for class CardDetails."); - - if (cardDetails.ThreeDS2SdkVersionOption.IsSet && cardDetails.ThreeDS2SdkVersion == null) - throw new ArgumentNullException(nameof(cardDetails.ThreeDS2SdkVersion), "Property is required for class CardDetails."); - - if (cardDetails.BrandOption.IsSet) - writer.WriteString("brand", cardDetails.Brand); - - if (cardDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", cardDetails.CheckoutAttemptId); - - if (cardDetails.CupsecureplusSmscodeOption.IsSet) - writer.WriteString("cupsecureplus.smscode", cardDetails.CupsecureplusSmscode); - - if (cardDetails.CvcOption.IsSet) - writer.WriteString("cvc", cardDetails.Cvc); - - if (cardDetails.EncryptedCardOption.IsSet) - writer.WriteString("encryptedCard", cardDetails.EncryptedCard); - - if (cardDetails.EncryptedCardNumberOption.IsSet) - writer.WriteString("encryptedCardNumber", cardDetails.EncryptedCardNumber); - - if (cardDetails.EncryptedExpiryMonthOption.IsSet) - writer.WriteString("encryptedExpiryMonth", cardDetails.EncryptedExpiryMonth); - - if (cardDetails.EncryptedExpiryYearOption.IsSet) - writer.WriteString("encryptedExpiryYear", cardDetails.EncryptedExpiryYear); - - if (cardDetails.EncryptedSecurityCodeOption.IsSet) - writer.WriteString("encryptedSecurityCode", cardDetails.EncryptedSecurityCode); - - if (cardDetails.ExpiryMonthOption.IsSet) - writer.WriteString("expiryMonth", cardDetails.ExpiryMonth); - - if (cardDetails.ExpiryYearOption.IsSet) - writer.WriteString("expiryYear", cardDetails.ExpiryYear); - - if (cardDetails.FastlaneDataOption.IsSet) - writer.WriteString("fastlaneData", cardDetails.FastlaneData); - - var fundingSourceRawValue = CardDetails.FundingSourceEnumToJsonValue(cardDetails.FundingSourceOption.Value.Value); - writer.WriteString("fundingSource", fundingSourceRawValue); - if (cardDetails.HolderNameOption.IsSet) - writer.WriteString("holderName", cardDetails.HolderName); - - if (cardDetails.NetworkPaymentReferenceOption.IsSet) - writer.WriteString("networkPaymentReference", cardDetails.NetworkPaymentReference); - - if (cardDetails.NumberOption.IsSet) - writer.WriteString("number", cardDetails.Number); - - if (cardDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", cardDetails.RecurringDetailReference); - - if (cardDetails.ShopperNotificationReferenceOption.IsSet) - writer.WriteString("shopperNotificationReference", cardDetails.ShopperNotificationReference); - - if (cardDetails.SrcCorrelationIdOption.IsSet) - writer.WriteString("srcCorrelationId", cardDetails.SrcCorrelationId); - - if (cardDetails.SrcDigitalCardIdOption.IsSet) - writer.WriteString("srcDigitalCardId", cardDetails.SrcDigitalCardId); - - if (cardDetails.SrcSchemeOption.IsSet) - writer.WriteString("srcScheme", cardDetails.SrcScheme); - - if (cardDetails.SrcTokenReferenceOption.IsSet) - writer.WriteString("srcTokenReference", cardDetails.SrcTokenReference); - - if (cardDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", cardDetails.StoredPaymentMethodId); - - if (cardDetails.ThreeDS2SdkVersionOption.IsSet) - writer.WriteString("threeDS2SdkVersion", cardDetails.ThreeDS2SdkVersion); - - var typeRawValue = CardDetails.TypeEnumToJsonValue(cardDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); - } - } } diff --git a/Adyen/Model/Checkout/CardDetailsRequest.cs b/Adyen/Model/Checkout/CardDetailsRequest.cs index b0907cfa7..f1a6b32f2 100644 --- a/Adyen/Model/Checkout/CardDetailsRequest.cs +++ b/Adyen/Model/Checkout/CardDetailsRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,96 +15,79 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CardDetailsRequest /// - public partial class CardDetailsRequest : IValidatableObject + [DataContract(Name = "CardDetailsRequest")] + public partial class CardDetailsRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// A minimum of the first eight digits of the card number. The full card number gives the best result. You must be [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide) to collect raw card data. Alternatively, you can use the `encryptedCardNumber` field. - /// The merchant account identifier, with which you want to process the transaction. - /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE - /// The encrypted card number. - /// The card brands you support. This is the [`brands`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods__resParam_paymentMethods-brands) array from your [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. If not included, our API uses the ones configured for your merchant account and, if provided, the country code. - [JsonConstructor] - public CardDetailsRequest(string cardNumber, string merchantAccount, Option countryCode = default, Option encryptedCardNumber = default, Option> supportedBrands = default) + [JsonConstructorAttribute] + protected CardDetailsRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// A minimum of the first eight digits of the card number. The full card number gives the best result. You must be [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide) to collect raw card data. Alternatively, you can use the `encryptedCardNumber` field. (required). + /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE. + /// The encrypted card number.. + /// The merchant account identifier, with which you want to process the transaction. (required). + /// The card brands you support. This is the [`brands`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods__resParam_paymentMethods-brands) array from your [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. If not included, our API uses the ones configured for your merchant account and, if provided, the country code.. + public CardDetailsRequest(string cardNumber = default(string), string countryCode = default(string), string encryptedCardNumber = default(string), string merchantAccount = default(string), List supportedBrands = default(List)) { - CardNumber = cardNumber; - MerchantAccount = merchantAccount; - CountryCodeOption = countryCode; - EncryptedCardNumberOption = encryptedCardNumber; - SupportedBrandsOption = supportedBrands; - OnCreated(); + this.CardNumber = cardNumber; + this.MerchantAccount = merchantAccount; + this.CountryCode = countryCode; + this.EncryptedCardNumber = encryptedCardNumber; + this.SupportedBrands = supportedBrands; } - partial void OnCreated(); - /// /// A minimum of the first eight digits of the card number. The full card number gives the best result. You must be [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide) to collect raw card data. Alternatively, you can use the `encryptedCardNumber` field. /// /// A minimum of the first eight digits of the card number. The full card number gives the best result. You must be [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide) to collect raw card data. Alternatively, you can use the `encryptedCardNumber` field. - [JsonPropertyName("cardNumber")] + [DataMember(Name = "cardNumber", IsRequired = false, EmitDefaultValue = false)] public string CardNumber { get; set; } - /// - /// The merchant account identifier, with which you want to process the transaction. - /// - /// The merchant account identifier, with which you want to process the transaction. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } - - /// - /// Used to track the state of CountryCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CountryCodeOption { get; private set; } - /// /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE /// /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE - [JsonPropertyName("countryCode")] - public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedCardNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedCardNumberOption { get; private set; } + [DataMember(Name = "countryCode", EmitDefaultValue = false)] + public string CountryCode { get; set; } /// /// The encrypted card number. /// /// The encrypted card number. - [JsonPropertyName("encryptedCardNumber")] - public string EncryptedCardNumber { get { return this.EncryptedCardNumberOption; } set { this.EncryptedCardNumberOption = new Option(value); } } + [DataMember(Name = "encryptedCardNumber", EmitDefaultValue = false)] + public string EncryptedCardNumber { get; set; } /// - /// Used to track the state of SupportedBrands + /// The merchant account identifier, with which you want to process the transaction. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SupportedBrandsOption { get; private set; } + /// The merchant account identifier, with which you want to process the transaction. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// The card brands you support. This is the [`brands`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods__resParam_paymentMethods-brands) array from your [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. If not included, our API uses the ones configured for your merchant account and, if provided, the country code. /// /// The card brands you support. This is the [`brands`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods__resParam_paymentMethods-brands) array from your [`/paymentMethods`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/paymentMethods) response. If not included, our API uses the ones configured for your merchant account and, if provided, the country code. - [JsonPropertyName("supportedBrands")] - public List SupportedBrands { get { return this.SupportedBrandsOption; } set { this.SupportedBrandsOption = new Option>(value); } } + [DataMember(Name = "supportedBrands", EmitDefaultValue = false)] + public List SupportedBrands { get; set; } /// /// Returns the string presentation of the object @@ -114,174 +98,120 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class CardDetailsRequest {\n"); sb.Append(" CardNumber: ").Append(CardNumber).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" CountryCode: ").Append(CountryCode).Append("\n"); sb.Append(" EncryptedCardNumber: ").Append(EncryptedCardNumber).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" SupportedBrands: ").Append(SupportedBrands).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // EncryptedCardNumber (string) maxLength - if (this.EncryptedCardNumber != null && this.EncryptedCardNumber.Length > 15000) - { - yield return new ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CardDetailsRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CardDetailsRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option cardNumber = default; - Option merchantAccount = default; - Option countryCode = default; - Option encryptedCardNumber = default; - Option> supportedBrands = default; + return this.Equals(input as CardDetailsRequest); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if CardDetailsRequest instances are equal + /// + /// Instance of CardDetailsRequest to be compared + /// Boolean + public bool Equals(CardDetailsRequest input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "cardNumber": - cardNumber = new Option(utf8JsonReader.GetString()); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "countryCode": - countryCode = new Option(utf8JsonReader.GetString()); - break; - case "encryptedCardNumber": - encryptedCardNumber = new Option(utf8JsonReader.GetString()); - break; - case "supportedBrands": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - supportedBrands = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } + return false; } - - if (!cardNumber.IsSet) - throw new ArgumentException("Property is required for class CardDetailsRequest.", nameof(cardNumber)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class CardDetailsRequest.", nameof(merchantAccount)); - - if (cardNumber.IsSet && cardNumber.Value == null) - throw new ArgumentNullException(nameof(cardNumber), "Property is not nullable for class CardDetailsRequest."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class CardDetailsRequest."); - - if (countryCode.IsSet && countryCode.Value == null) - throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class CardDetailsRequest."); - - if (encryptedCardNumber.IsSet && encryptedCardNumber.Value == null) - throw new ArgumentNullException(nameof(encryptedCardNumber), "Property is not nullable for class CardDetailsRequest."); - - if (supportedBrands.IsSet && supportedBrands.Value == null) - throw new ArgumentNullException(nameof(supportedBrands), "Property is not nullable for class CardDetailsRequest."); - - return new CardDetailsRequest(cardNumber.Value, merchantAccount.Value, countryCode, encryptedCardNumber, supportedBrands); + return + ( + this.CardNumber == input.CardNumber || + (this.CardNumber != null && + this.CardNumber.Equals(input.CardNumber)) + ) && + ( + this.CountryCode == input.CountryCode || + (this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode)) + ) && + ( + this.EncryptedCardNumber == input.EncryptedCardNumber || + (this.EncryptedCardNumber != null && + this.EncryptedCardNumber.Equals(input.EncryptedCardNumber)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.SupportedBrands == input.SupportedBrands || + this.SupportedBrands != null && + input.SupportedBrands != null && + this.SupportedBrands.SequenceEqual(input.SupportedBrands) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CardDetailsRequest cardDetailsRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, cardDetailsRequest, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CardNumber != null) + { + hashCode = (hashCode * 59) + this.CardNumber.GetHashCode(); + } + if (this.CountryCode != null) + { + hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); + } + if (this.EncryptedCardNumber != null) + { + hashCode = (hashCode * 59) + this.EncryptedCardNumber.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.SupportedBrands != null) + { + hashCode = (hashCode * 59) + this.SupportedBrands.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CardDetailsRequest cardDetailsRequest, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (cardDetailsRequest.CardNumber == null) - throw new ArgumentNullException(nameof(cardDetailsRequest.CardNumber), "Property is required for class CardDetailsRequest."); - - if (cardDetailsRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(cardDetailsRequest.MerchantAccount), "Property is required for class CardDetailsRequest."); - - if (cardDetailsRequest.CountryCodeOption.IsSet && cardDetailsRequest.CountryCode == null) - throw new ArgumentNullException(nameof(cardDetailsRequest.CountryCode), "Property is required for class CardDetailsRequest."); - - if (cardDetailsRequest.EncryptedCardNumberOption.IsSet && cardDetailsRequest.EncryptedCardNumber == null) - throw new ArgumentNullException(nameof(cardDetailsRequest.EncryptedCardNumber), "Property is required for class CardDetailsRequest."); - - if (cardDetailsRequest.SupportedBrandsOption.IsSet && cardDetailsRequest.SupportedBrands == null) - throw new ArgumentNullException(nameof(cardDetailsRequest.SupportedBrands), "Property is required for class CardDetailsRequest."); - - writer.WriteString("cardNumber", cardDetailsRequest.CardNumber); - - writer.WriteString("merchantAccount", cardDetailsRequest.MerchantAccount); - - if (cardDetailsRequest.CountryCodeOption.IsSet) - writer.WriteString("countryCode", cardDetailsRequest.CountryCode); - - if (cardDetailsRequest.EncryptedCardNumberOption.IsSet) - writer.WriteString("encryptedCardNumber", cardDetailsRequest.EncryptedCardNumber); - - if (cardDetailsRequest.SupportedBrandsOption.IsSet) + // EncryptedCardNumber (string) maxLength + if (this.EncryptedCardNumber != null && this.EncryptedCardNumber.Length > 15000) { - writer.WritePropertyName("supportedBrands"); - JsonSerializer.Serialize(writer, cardDetailsRequest.SupportedBrands, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); } + + yield break; } } + } diff --git a/Adyen/Model/Checkout/CardDetailsResponse.cs b/Adyen/Model/Checkout/CardDetailsResponse.cs index 17d77c682..02ef1affc 100644 --- a/Adyen/Model/Checkout/CardDetailsResponse.cs +++ b/Adyen/Model/Checkout/CardDetailsResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,94 +15,65 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CardDetailsResponse /// - public partial class CardDetailsResponse : IValidatableObject + [DataContract(Name = "CardDetailsResponse")] + public partial class CardDetailsResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The list of brands identified for the card. - /// The funding source of the card, for example **DEBIT**, **CREDIT**, or **PREPAID**. - /// Indicates if this is a commercial card or a consumer card. If **true**, it is a commercial card. If **false**, it is a consumer card. - /// The two-letter country code of the country where the card was issued. - [JsonConstructor] - public CardDetailsResponse(Option> brands = default, Option fundingSource = default, Option isCardCommercial = default, Option issuingCountryCode = default) + /// The list of brands identified for the card.. + /// The funding source of the card, for example **DEBIT**, **CREDIT**, or **PREPAID**.. + /// Indicates if this is a commercial card or a consumer card. If **true**, it is a commercial card. If **false**, it is a consumer card.. + /// The two-letter country code of the country where the card was issued.. + public CardDetailsResponse(List brands = default(List), string fundingSource = default(string), bool? isCardCommercial = default(bool?), string issuingCountryCode = default(string)) { - BrandsOption = brands; - FundingSourceOption = fundingSource; - IsCardCommercialOption = isCardCommercial; - IssuingCountryCodeOption = issuingCountryCode; - OnCreated(); + this.Brands = brands; + this.FundingSource = fundingSource; + this.IsCardCommercial = isCardCommercial; + this.IssuingCountryCode = issuingCountryCode; } - partial void OnCreated(); - - /// - /// Used to track the state of Brands - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> BrandsOption { get; private set; } - /// /// The list of brands identified for the card. /// /// The list of brands identified for the card. - [JsonPropertyName("brands")] - public List Brands { get { return this.BrandsOption; } set { this.BrandsOption = new Option>(value); } } - - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } + [DataMember(Name = "brands", EmitDefaultValue = false)] + public List Brands { get; set; } /// /// The funding source of the card, for example **DEBIT**, **CREDIT**, or **PREPAID**. /// /// The funding source of the card, for example **DEBIT**, **CREDIT**, or **PREPAID**. - [JsonPropertyName("fundingSource")] - public string FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - - /// - /// Used to track the state of IsCardCommercial - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IsCardCommercialOption { get; private set; } + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public string FundingSource { get; set; } /// /// Indicates if this is a commercial card or a consumer card. If **true**, it is a commercial card. If **false**, it is a consumer card. /// /// Indicates if this is a commercial card or a consumer card. If **true**, it is a commercial card. If **false**, it is a consumer card. - [JsonPropertyName("isCardCommercial")] - public bool? IsCardCommercial { get { return this.IsCardCommercialOption; } set { this.IsCardCommercialOption = new Option(value); } } - - /// - /// Used to track the state of IssuingCountryCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IssuingCountryCodeOption { get; private set; } + [DataMember(Name = "isCardCommercial", EmitDefaultValue = false)] + public bool? IsCardCommercial { get; set; } /// /// The two-letter country code of the country where the card was issued. /// /// The two-letter country code of the country where the card was issued. - [JsonPropertyName("issuingCountryCode")] - public string IssuingCountryCode { get { return this.IssuingCountryCodeOption; } set { this.IssuingCountryCodeOption = new Option(value); } } + [DataMember(Name = "issuingCountryCode", EmitDefaultValue = false)] + public string IssuingCountryCode { get; set; } /// /// Returns the string presentation of the object @@ -120,139 +92,92 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CardDetailsResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CardDetailsResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option> brands = default; - Option fundingSource = default; - Option isCardCommercial = default; - Option issuingCountryCode = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "brands": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - brands = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "fundingSource": - fundingSource = new Option(utf8JsonReader.GetString()); - break; - case "isCardCommercial": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - isCardCommercial = new Option(utf8JsonReader.GetBoolean()); - break; - case "issuingCountryCode": - issuingCountryCode = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (brands.IsSet && brands.Value == null) - throw new ArgumentNullException(nameof(brands), "Property is not nullable for class CardDetailsResponse."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class CardDetailsResponse."); - - if (isCardCommercial.IsSet && isCardCommercial.Value == null) - throw new ArgumentNullException(nameof(isCardCommercial), "Property is not nullable for class CardDetailsResponse."); - - if (issuingCountryCode.IsSet && issuingCountryCode.Value == null) - throw new ArgumentNullException(nameof(issuingCountryCode), "Property is not nullable for class CardDetailsResponse."); - - return new CardDetailsResponse(brands, fundingSource, isCardCommercial, issuingCountryCode); + return this.Equals(input as CardDetailsResponse); } /// - /// Serializes a + /// Returns true if CardDetailsResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CardDetailsResponse cardDetailsResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of CardDetailsResponse to be compared + /// Boolean + public bool Equals(CardDetailsResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, cardDetailsResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Brands == input.Brands || + this.Brands != null && + input.Brands != null && + this.Brands.SequenceEqual(input.Brands) + ) && + ( + this.FundingSource == input.FundingSource || + (this.FundingSource != null && + this.FundingSource.Equals(input.FundingSource)) + ) && + ( + this.IsCardCommercial == input.IsCardCommercial || + this.IsCardCommercial.Equals(input.IsCardCommercial) + ) && + ( + this.IssuingCountryCode == input.IssuingCountryCode || + (this.IssuingCountryCode != null && + this.IssuingCountryCode.Equals(input.IssuingCountryCode)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CardDetailsResponse cardDetailsResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (cardDetailsResponse.BrandsOption.IsSet && cardDetailsResponse.Brands == null) - throw new ArgumentNullException(nameof(cardDetailsResponse.Brands), "Property is required for class CardDetailsResponse."); - - if (cardDetailsResponse.FundingSourceOption.IsSet && cardDetailsResponse.FundingSource == null) - throw new ArgumentNullException(nameof(cardDetailsResponse.FundingSource), "Property is required for class CardDetailsResponse."); - - if (cardDetailsResponse.IssuingCountryCodeOption.IsSet && cardDetailsResponse.IssuingCountryCode == null) - throw new ArgumentNullException(nameof(cardDetailsResponse.IssuingCountryCode), "Property is required for class CardDetailsResponse."); - - if (cardDetailsResponse.BrandsOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("brands"); - JsonSerializer.Serialize(writer, cardDetailsResponse.Brands, jsonSerializerOptions); + int hashCode = 41; + if (this.Brands != null) + { + hashCode = (hashCode * 59) + this.Brands.GetHashCode(); + } + if (this.FundingSource != null) + { + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + } + hashCode = (hashCode * 59) + this.IsCardCommercial.GetHashCode(); + if (this.IssuingCountryCode != null) + { + hashCode = (hashCode * 59) + this.IssuingCountryCode.GetHashCode(); + } + return hashCode; } - if (cardDetailsResponse.FundingSourceOption.IsSet) - writer.WriteString("fundingSource", cardDetailsResponse.FundingSource); - - if (cardDetailsResponse.IsCardCommercialOption.IsSet) - writer.WriteBoolean("isCardCommercial", cardDetailsResponse.IsCardCommercialOption.Value.Value); - - if (cardDetailsResponse.IssuingCountryCodeOption.IsSet) - writer.WriteString("issuingCountryCode", cardDetailsResponse.IssuingCountryCode); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/CardDonations.cs b/Adyen/Model/Checkout/CardDonations.cs index 0b8b14ae5..08cb712f9 100644 --- a/Adyen/Model/Checkout/CardDonations.cs +++ b/Adyen/Model/Checkout/CardDonations.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,621 +15,330 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CardDonations /// - public partial class CardDonations : IValidatableObject + [DataContract(Name = "CardDonations")] + public partial class CardDonations : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Secondary brand of the card. For example: **plastix**, **hmclub**. - /// The checkout attempt identifier. - /// cupsecureplusSmscode - /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. - /// The encrypted card number. - /// The encrypted card expiry month. - /// The encrypted card expiry year. - /// The encrypted card verification code. - /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - /// The encoded fastlane data blob - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - /// The name of the card holder. - /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. - /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. - /// An identifier used for the Click to Pay transaction. - /// The SRC reference for the Click to Pay token. - /// The scheme that is being used for Click to Pay. - /// The reference for the Click to Pay token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - /// Default payment method details. Common for scheme payment methods, and for simple payment method details. (default to TypeEnum.Scheme) - [JsonConstructor] - public CardDonations(Option brand = default, Option checkoutAttemptId = default, Option cupsecureplusSmscode = default, Option cvc = default, Option encryptedCard = default, Option encryptedCardNumber = default, Option encryptedExpiryMonth = default, Option encryptedExpiryYear = default, Option encryptedSecurityCode = default, Option expiryMonth = default, Option expiryYear = default, Option fastlaneData = default, Option fundingSource = default, Option holderName = default, Option networkPaymentReference = default, Option number = default, Option recurringDetailReference = default, Option shopperNotificationReference = default, Option srcCorrelationId = default, Option srcDigitalCardId = default, Option srcScheme = default, Option srcTokenReference = default, Option storedPaymentMethodId = default, Option threeDS2SdkVersion = default, Option type = default) - { - BrandOption = brand; - CheckoutAttemptIdOption = checkoutAttemptId; - CupsecureplusSmscodeOption = cupsecureplusSmscode; - CvcOption = cvc; - EncryptedCardOption = encryptedCard; - EncryptedCardNumberOption = encryptedCardNumber; - EncryptedExpiryMonthOption = encryptedExpiryMonth; - EncryptedExpiryYearOption = encryptedExpiryYear; - EncryptedSecurityCodeOption = encryptedSecurityCode; - ExpiryMonthOption = expiryMonth; - ExpiryYearOption = expiryYear; - FastlaneDataOption = fastlaneData; - FundingSourceOption = fundingSource; - HolderNameOption = holderName; - NetworkPaymentReferenceOption = networkPaymentReference; - NumberOption = number; - RecurringDetailReferenceOption = recurringDetailReference; - ShopperNotificationReferenceOption = shopperNotificationReference; - SrcCorrelationIdOption = srcCorrelationId; - SrcDigitalCardIdOption = srcDigitalCardId; - SrcSchemeOption = srcScheme; - SrcTokenReferenceOption = srcTokenReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - ThreeDS2SdkVersionOption = threeDS2SdkVersion; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// + [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// + [EnumMember(Value = "debit")] Debit = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static FundingSourceEnum FundingSourceEnumFromString(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) - { - if (value == FundingSourceEnum.Credit) - return "credit"; - - if (value == FundingSourceEnum.Debit) - return "debit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonPropertyName("fundingSource")] - public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Bcmc for value: bcmc /// + [EnumMember(Value = "bcmc")] Bcmc = 1, /// /// Enum Scheme for value: scheme /// + [EnumMember(Value = "scheme")] Scheme = 2, /// /// Enum NetworkToken for value: networkToken /// + [EnumMember(Value = "networkToken")] NetworkToken = 3, /// /// Enum Giftcard for value: giftcard /// + [EnumMember(Value = "giftcard")] Giftcard = 4, /// /// Enum Card for value: card /// + [EnumMember(Value = "card")] Card = 5, /// /// Enum Clicktopay for value: clicktopay /// + [EnumMember(Value = "clicktopay")] Clicktopay = 6 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("bcmc")) - return TypeEnum.Bcmc; - - if (value.Equals("scheme")) - return TypeEnum.Scheme; - - if (value.Equals("networkToken")) - return TypeEnum.NetworkToken; - - if (value.Equals("giftcard")) - return TypeEnum.Giftcard; - if (value.Equals("card")) - return TypeEnum.Card; - - if (value.Equals("clicktopay")) - return TypeEnum.Clicktopay; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("bcmc")) - return TypeEnum.Bcmc; - - if (value.Equals("scheme")) - return TypeEnum.Scheme; - - if (value.Equals("networkToken")) - return TypeEnum.NetworkToken; - - if (value.Equals("giftcard")) - return TypeEnum.Giftcard; - - if (value.Equals("card")) - return TypeEnum.Card; - - if (value.Equals("clicktopay")) - return TypeEnum.Clicktopay; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Bcmc) - return "bcmc"; - - if (value == TypeEnum.Scheme) - return "scheme"; - - if (value == TypeEnum.NetworkToken) - return "networkToken"; - - if (value == TypeEnum.Giftcard) - return "giftcard"; - - if (value == TypeEnum.Card) - return "card"; - - if (value == TypeEnum.Clicktopay) - return "clicktopay"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. /// /// Default payment method details. Common for scheme payment methods, and for simple payment method details. - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of Brand + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BrandOption { get; private set; } + /// Secondary brand of the card. For example: **plastix**, **hmclub**.. + /// The checkout attempt identifier.. + /// cupsecureplusSmscode. + /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. + /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details.. + /// The encrypted card number.. + /// The encrypted card expiry month.. + /// The encrypted card expiry year.. + /// This field contains an encrypted, one-time password or an authentication code provided by the cardholder.. + /// The encrypted card verification code.. + /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. + /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. + /// The encoded fastlane data blob. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. + /// The name of the card holder.. + /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment.. + /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India.. + /// An identifier used for the Click to Pay transaction.. + /// The SRC reference for the Click to Pay token.. + /// The scheme that is being used for Click to Pay.. + /// The reference for the Click to Pay token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK.. + /// Default payment method details. Common for scheme payment methods, and for simple payment method details. (default to TypeEnum.Scheme). + public CardDonations(string brand = default(string), string checkoutAttemptId = default(string), string cupsecureplusSmscode = default(string), string cvc = default(string), string encryptedCard = default(string), string encryptedCardNumber = default(string), string encryptedExpiryMonth = default(string), string encryptedExpiryYear = default(string), string encryptedPassword = default(string), string encryptedSecurityCode = default(string), string expiryMonth = default(string), string expiryYear = default(string), string fastlaneData = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string holderName = default(string), string networkPaymentReference = default(string), string number = default(string), string recurringDetailReference = default(string), string shopperNotificationReference = default(string), string srcCorrelationId = default(string), string srcDigitalCardId = default(string), string srcScheme = default(string), string srcTokenReference = default(string), string storedPaymentMethodId = default(string), string threeDS2SdkVersion = default(string), TypeEnum? type = TypeEnum.Scheme) + { + this.Brand = brand; + this.CheckoutAttemptId = checkoutAttemptId; + this.CupsecureplusSmscode = cupsecureplusSmscode; + this.Cvc = cvc; + this.EncryptedCard = encryptedCard; + this.EncryptedCardNumber = encryptedCardNumber; + this.EncryptedExpiryMonth = encryptedExpiryMonth; + this.EncryptedExpiryYear = encryptedExpiryYear; + this.EncryptedPassword = encryptedPassword; + this.EncryptedSecurityCode = encryptedSecurityCode; + this.ExpiryMonth = expiryMonth; + this.ExpiryYear = expiryYear; + this.FastlaneData = fastlaneData; + this.FundingSource = fundingSource; + this.HolderName = holderName; + this.NetworkPaymentReference = networkPaymentReference; + this.Number = number; + this.RecurringDetailReference = recurringDetailReference; + this.ShopperNotificationReference = shopperNotificationReference; + this.SrcCorrelationId = srcCorrelationId; + this.SrcDigitalCardId = srcDigitalCardId; + this.SrcScheme = srcScheme; + this.SrcTokenReference = srcTokenReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.ThreeDS2SdkVersion = threeDS2SdkVersion; + this.Type = type; + } /// /// Secondary brand of the card. For example: **plastix**, **hmclub**. /// /// Secondary brand of the card. For example: **plastix**, **hmclub**. - [JsonPropertyName("brand")] - public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } - - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + [DataMember(Name = "brand", EmitDefaultValue = false)] + public string Brand { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of CupsecureplusSmscode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CupsecureplusSmscodeOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Gets or Sets CupsecureplusSmscode /// - [JsonPropertyName("cupsecureplus.smscode")] - [Obsolete] - public string CupsecureplusSmscode { get { return this.CupsecureplusSmscodeOption; } set { this.CupsecureplusSmscodeOption = new Option(value); } } - - /// - /// Used to track the state of Cvc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CvcOption { get; private set; } + [DataMember(Name = "cupsecureplus.smscode", EmitDefaultValue = false)] + [Obsolete("")] + public string CupsecureplusSmscode { get; set; } /// /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [JsonPropertyName("cvc")] - public string Cvc { get { return this.CvcOption; } set { this.CvcOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedCard - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedCardOption { get; private set; } + [DataMember(Name = "cvc", EmitDefaultValue = false)] + public string Cvc { get; set; } /// /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. /// /// Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. - [JsonPropertyName("encryptedCard")] - public string EncryptedCard { get { return this.EncryptedCardOption; } set { this.EncryptedCardOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedCardNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedCardNumberOption { get; private set; } + [DataMember(Name = "encryptedCard", EmitDefaultValue = false)] + public string EncryptedCard { get; set; } /// /// The encrypted card number. /// /// The encrypted card number. - [JsonPropertyName("encryptedCardNumber")] - public string EncryptedCardNumber { get { return this.EncryptedCardNumberOption; } set { this.EncryptedCardNumberOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedExpiryMonth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedExpiryMonthOption { get; private set; } + [DataMember(Name = "encryptedCardNumber", EmitDefaultValue = false)] + public string EncryptedCardNumber { get; set; } /// /// The encrypted card expiry month. /// /// The encrypted card expiry month. - [JsonPropertyName("encryptedExpiryMonth")] - public string EncryptedExpiryMonth { get { return this.EncryptedExpiryMonthOption; } set { this.EncryptedExpiryMonthOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedExpiryYear - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedExpiryYearOption { get; private set; } + [DataMember(Name = "encryptedExpiryMonth", EmitDefaultValue = false)] + public string EncryptedExpiryMonth { get; set; } /// /// The encrypted card expiry year. /// /// The encrypted card expiry year. - [JsonPropertyName("encryptedExpiryYear")] - public string EncryptedExpiryYear { get { return this.EncryptedExpiryYearOption; } set { this.EncryptedExpiryYearOption = new Option(value); } } + [DataMember(Name = "encryptedExpiryYear", EmitDefaultValue = false)] + public string EncryptedExpiryYear { get; set; } /// - /// Used to track the state of EncryptedSecurityCode + /// This field contains an encrypted, one-time password or an authentication code provided by the cardholder. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedSecurityCodeOption { get; private set; } + /// This field contains an encrypted, one-time password or an authentication code provided by the cardholder. + [DataMember(Name = "encryptedPassword", EmitDefaultValue = false)] + public string EncryptedPassword { get; set; } /// /// The encrypted card verification code. /// /// The encrypted card verification code. - [JsonPropertyName("encryptedSecurityCode")] - public string EncryptedSecurityCode { get { return this.EncryptedSecurityCodeOption; } set { this.EncryptedSecurityCodeOption = new Option(value); } } - - /// - /// Used to track the state of ExpiryMonth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiryMonthOption { get; private set; } + [DataMember(Name = "encryptedSecurityCode", EmitDefaultValue = false)] + public string EncryptedSecurityCode { get; set; } /// /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [JsonPropertyName("expiryMonth")] - public string ExpiryMonth { get { return this.ExpiryMonthOption; } set { this.ExpiryMonthOption = new Option(value); } } - - /// - /// Used to track the state of ExpiryYear - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiryYearOption { get; private set; } + [DataMember(Name = "expiryMonth", EmitDefaultValue = false)] + public string ExpiryMonth { get; set; } /// /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [JsonPropertyName("expiryYear")] - public string ExpiryYear { get { return this.ExpiryYearOption; } set { this.ExpiryYearOption = new Option(value); } } - - /// - /// Used to track the state of FastlaneData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FastlaneDataOption { get; private set; } + [DataMember(Name = "expiryYear", EmitDefaultValue = false)] + public string ExpiryYear { get; set; } /// /// The encoded fastlane data blob /// /// The encoded fastlane data blob - [JsonPropertyName("fastlaneData")] - public string FastlaneData { get { return this.FastlaneDataOption; } set { this.FastlaneDataOption = new Option(value); } } - - /// - /// Used to track the state of HolderName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option HolderNameOption { get; private set; } + [DataMember(Name = "fastlaneData", EmitDefaultValue = false)] + public string FastlaneData { get; set; } /// /// The name of the card holder. /// /// The name of the card holder. - [JsonPropertyName("holderName")] - public string HolderName { get { return this.HolderNameOption; } set { this.HolderNameOption = new Option(value); } } + [DataMember(Name = "holderName", EmitDefaultValue = false)] + public string HolderName { get; set; } /// - /// Used to track the state of NetworkPaymentReference + /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NetworkPaymentReferenceOption { get; private set; } - - /// - /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. - /// - /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. - [JsonPropertyName("networkPaymentReference")] - public string NetworkPaymentReference { get { return this.NetworkPaymentReferenceOption; } set { this.NetworkPaymentReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Number - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NumberOption { get; private set; } + /// The transaction identifier from card schemes. This is the [`networkTxReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-additionalData-ResponseAdditionalDataCommon-networkTxReference) from the response to the first payment. + [DataMember(Name = "networkPaymentReference", EmitDefaultValue = false)] + public string NetworkPaymentReference { get; set; } /// /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [JsonPropertyName("number")] - public string Number { get { return this.NumberOption; } set { this.NumberOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "number", EmitDefaultValue = false)] + public string Number { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperNotificationReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNotificationReferenceOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used only for recurring payments in India. - [JsonPropertyName("shopperNotificationReference")] - public string ShopperNotificationReference { get { return this.ShopperNotificationReferenceOption; } set { this.ShopperNotificationReferenceOption = new Option(value); } } - - /// - /// Used to track the state of SrcCorrelationId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SrcCorrelationIdOption { get; private set; } + [DataMember(Name = "shopperNotificationReference", EmitDefaultValue = false)] + public string ShopperNotificationReference { get; set; } /// /// An identifier used for the Click to Pay transaction. /// /// An identifier used for the Click to Pay transaction. - [JsonPropertyName("srcCorrelationId")] - public string SrcCorrelationId { get { return this.SrcCorrelationIdOption; } set { this.SrcCorrelationIdOption = new Option(value); } } - - /// - /// Used to track the state of SrcDigitalCardId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SrcDigitalCardIdOption { get; private set; } + [DataMember(Name = "srcCorrelationId", EmitDefaultValue = false)] + public string SrcCorrelationId { get; set; } /// /// The SRC reference for the Click to Pay token. /// /// The SRC reference for the Click to Pay token. - [JsonPropertyName("srcDigitalCardId")] - public string SrcDigitalCardId { get { return this.SrcDigitalCardIdOption; } set { this.SrcDigitalCardIdOption = new Option(value); } } - - /// - /// Used to track the state of SrcScheme - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SrcSchemeOption { get; private set; } + [DataMember(Name = "srcDigitalCardId", EmitDefaultValue = false)] + public string SrcDigitalCardId { get; set; } /// /// The scheme that is being used for Click to Pay. /// /// The scheme that is being used for Click to Pay. - [JsonPropertyName("srcScheme")] - public string SrcScheme { get { return this.SrcSchemeOption; } set { this.SrcSchemeOption = new Option(value); } } - - /// - /// Used to track the state of SrcTokenReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SrcTokenReferenceOption { get; private set; } + [DataMember(Name = "srcScheme", EmitDefaultValue = false)] + public string SrcScheme { get; set; } /// /// The reference for the Click to Pay token. /// /// The reference for the Click to Pay token. - [JsonPropertyName("srcTokenReference")] - public string SrcTokenReference { get { return this.SrcTokenReferenceOption; } set { this.SrcTokenReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "srcTokenReference", EmitDefaultValue = false)] + public string SrcTokenReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2SdkVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2SdkVersionOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - [JsonPropertyName("threeDS2SdkVersion")] - public string ThreeDS2SdkVersion { get { return this.ThreeDS2SdkVersionOption; } set { this.ThreeDS2SdkVersionOption = new Option(value); } } + [DataMember(Name = "threeDS2SdkVersion", EmitDefaultValue = false)] + public string ThreeDS2SdkVersion { get; set; } /// /// Returns the string presentation of the object @@ -646,6 +356,7 @@ public override string ToString() sb.Append(" EncryptedCardNumber: ").Append(EncryptedCardNumber).Append("\n"); sb.Append(" EncryptedExpiryMonth: ").Append(EncryptedExpiryMonth).Append("\n"); sb.Append(" EncryptedExpiryYear: ").Append(EncryptedExpiryYear).Append("\n"); + sb.Append(" EncryptedPassword: ").Append(EncryptedPassword).Append("\n"); sb.Append(" EncryptedSecurityCode: ").Append(EncryptedSecurityCode).Append("\n"); sb.Append(" ExpiryMonth: ").Append(ExpiryMonth).Append("\n"); sb.Append(" ExpiryYear: ").Append(ExpiryYear).Append("\n"); @@ -667,457 +378,334 @@ public override string ToString() return sb.ToString(); } + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CardDonations); + } + + /// + /// Returns true if CardDonations instances are equal + /// + /// Instance of CardDonations to be compared + /// Boolean + public bool Equals(CardDonations input) + { + if (input == null) + { + return false; + } + return + ( + this.Brand == input.Brand || + (this.Brand != null && + this.Brand.Equals(input.Brand)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.CupsecureplusSmscode == input.CupsecureplusSmscode || + (this.CupsecureplusSmscode != null && + this.CupsecureplusSmscode.Equals(input.CupsecureplusSmscode)) + ) && + ( + this.Cvc == input.Cvc || + (this.Cvc != null && + this.Cvc.Equals(input.Cvc)) + ) && + ( + this.EncryptedCard == input.EncryptedCard || + (this.EncryptedCard != null && + this.EncryptedCard.Equals(input.EncryptedCard)) + ) && + ( + this.EncryptedCardNumber == input.EncryptedCardNumber || + (this.EncryptedCardNumber != null && + this.EncryptedCardNumber.Equals(input.EncryptedCardNumber)) + ) && + ( + this.EncryptedExpiryMonth == input.EncryptedExpiryMonth || + (this.EncryptedExpiryMonth != null && + this.EncryptedExpiryMonth.Equals(input.EncryptedExpiryMonth)) + ) && + ( + this.EncryptedExpiryYear == input.EncryptedExpiryYear || + (this.EncryptedExpiryYear != null && + this.EncryptedExpiryYear.Equals(input.EncryptedExpiryYear)) + ) && + ( + this.EncryptedPassword == input.EncryptedPassword || + (this.EncryptedPassword != null && + this.EncryptedPassword.Equals(input.EncryptedPassword)) + ) && + ( + this.EncryptedSecurityCode == input.EncryptedSecurityCode || + (this.EncryptedSecurityCode != null && + this.EncryptedSecurityCode.Equals(input.EncryptedSecurityCode)) + ) && + ( + this.ExpiryMonth == input.ExpiryMonth || + (this.ExpiryMonth != null && + this.ExpiryMonth.Equals(input.ExpiryMonth)) + ) && + ( + this.ExpiryYear == input.ExpiryYear || + (this.ExpiryYear != null && + this.ExpiryYear.Equals(input.ExpiryYear)) + ) && + ( + this.FastlaneData == input.FastlaneData || + (this.FastlaneData != null && + this.FastlaneData.Equals(input.FastlaneData)) + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource.Equals(input.FundingSource) + ) && + ( + this.HolderName == input.HolderName || + (this.HolderName != null && + this.HolderName.Equals(input.HolderName)) + ) && + ( + this.NetworkPaymentReference == input.NetworkPaymentReference || + (this.NetworkPaymentReference != null && + this.NetworkPaymentReference.Equals(input.NetworkPaymentReference)) + ) && + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.ShopperNotificationReference == input.ShopperNotificationReference || + (this.ShopperNotificationReference != null && + this.ShopperNotificationReference.Equals(input.ShopperNotificationReference)) + ) && + ( + this.SrcCorrelationId == input.SrcCorrelationId || + (this.SrcCorrelationId != null && + this.SrcCorrelationId.Equals(input.SrcCorrelationId)) + ) && + ( + this.SrcDigitalCardId == input.SrcDigitalCardId || + (this.SrcDigitalCardId != null && + this.SrcDigitalCardId.Equals(input.SrcDigitalCardId)) + ) && + ( + this.SrcScheme == input.SrcScheme || + (this.SrcScheme != null && + this.SrcScheme.Equals(input.SrcScheme)) + ) && + ( + this.SrcTokenReference == input.SrcTokenReference || + (this.SrcTokenReference != null && + this.SrcTokenReference.Equals(input.SrcTokenReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.ThreeDS2SdkVersion == input.ThreeDS2SdkVersion || + (this.ThreeDS2SdkVersion != null && + this.ThreeDS2SdkVersion.Equals(input.ThreeDS2SdkVersion)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Brand != null) + { + hashCode = (hashCode * 59) + this.Brand.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.CupsecureplusSmscode != null) + { + hashCode = (hashCode * 59) + this.CupsecureplusSmscode.GetHashCode(); + } + if (this.Cvc != null) + { + hashCode = (hashCode * 59) + this.Cvc.GetHashCode(); + } + if (this.EncryptedCard != null) + { + hashCode = (hashCode * 59) + this.EncryptedCard.GetHashCode(); + } + if (this.EncryptedCardNumber != null) + { + hashCode = (hashCode * 59) + this.EncryptedCardNumber.GetHashCode(); + } + if (this.EncryptedExpiryMonth != null) + { + hashCode = (hashCode * 59) + this.EncryptedExpiryMonth.GetHashCode(); + } + if (this.EncryptedExpiryYear != null) + { + hashCode = (hashCode * 59) + this.EncryptedExpiryYear.GetHashCode(); + } + if (this.EncryptedPassword != null) + { + hashCode = (hashCode * 59) + this.EncryptedPassword.GetHashCode(); + } + if (this.EncryptedSecurityCode != null) + { + hashCode = (hashCode * 59) + this.EncryptedSecurityCode.GetHashCode(); + } + if (this.ExpiryMonth != null) + { + hashCode = (hashCode * 59) + this.ExpiryMonth.GetHashCode(); + } + if (this.ExpiryYear != null) + { + hashCode = (hashCode * 59) + this.ExpiryYear.GetHashCode(); + } + if (this.FastlaneData != null) + { + hashCode = (hashCode * 59) + this.FastlaneData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + if (this.HolderName != null) + { + hashCode = (hashCode * 59) + this.HolderName.GetHashCode(); + } + if (this.NetworkPaymentReference != null) + { + hashCode = (hashCode * 59) + this.NetworkPaymentReference.GetHashCode(); + } + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.ShopperNotificationReference != null) + { + hashCode = (hashCode * 59) + this.ShopperNotificationReference.GetHashCode(); + } + if (this.SrcCorrelationId != null) + { + hashCode = (hashCode * 59) + this.SrcCorrelationId.GetHashCode(); + } + if (this.SrcDigitalCardId != null) + { + hashCode = (hashCode * 59) + this.SrcDigitalCardId.GetHashCode(); + } + if (this.SrcScheme != null) + { + hashCode = (hashCode * 59) + this.SrcScheme.GetHashCode(); + } + if (this.SrcTokenReference != null) + { + hashCode = (hashCode * 59) + this.SrcTokenReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.ThreeDS2SdkVersion != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2SdkVersion.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } + } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { // EncryptedCard (string) maxLength if (this.EncryptedCard != null && this.EncryptedCard.Length > 40000) { - yield return new ValidationResult("Invalid value for EncryptedCard, length must be less than 40000.", new [] { "EncryptedCard" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCard, length must be less than 40000.", new [] { "EncryptedCard" }); } // EncryptedCardNumber (string) maxLength if (this.EncryptedCardNumber != null && this.EncryptedCardNumber.Length > 15000) { - yield return new ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); } // EncryptedExpiryMonth (string) maxLength if (this.EncryptedExpiryMonth != null && this.EncryptedExpiryMonth.Length > 15000) { - yield return new ValidationResult("Invalid value for EncryptedExpiryMonth, length must be less than 15000.", new [] { "EncryptedExpiryMonth" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedExpiryMonth, length must be less than 15000.", new [] { "EncryptedExpiryMonth" }); } // EncryptedExpiryYear (string) maxLength if (this.EncryptedExpiryYear != null && this.EncryptedExpiryYear.Length > 15000) { - yield return new ValidationResult("Invalid value for EncryptedExpiryYear, length must be less than 15000.", new [] { "EncryptedExpiryYear" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedExpiryYear, length must be less than 15000.", new [] { "EncryptedExpiryYear" }); } // EncryptedSecurityCode (string) maxLength if (this.EncryptedSecurityCode != null && this.EncryptedSecurityCode.Length > 15000) { - yield return new ValidationResult("Invalid value for EncryptedSecurityCode, length must be less than 15000.", new [] { "EncryptedSecurityCode" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedSecurityCode, length must be less than 15000.", new [] { "EncryptedSecurityCode" }); } // HolderName (string) maxLength if (this.HolderName != null && this.HolderName.Length > 15000) { - yield return new ValidationResult("Invalid value for HolderName, length must be less than 15000.", new [] { "HolderName" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for HolderName, length must be less than 15000.", new [] { "HolderName" }); } // StoredPaymentMethodId (string) maxLength if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); } // ThreeDS2SdkVersion (string) maxLength if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) { - yield return new ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); } yield break; } } - /// - /// A Json converter for type - /// - public class CardDonationsJsonConverter : JsonConverter - { - /// - /// Deserializes json to - /// - /// - /// - /// - /// - /// - public override CardDonations Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) - { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option brand = default; - Option checkoutAttemptId = default; - Option cupsecureplusSmscode = default; - Option cvc = default; - Option encryptedCard = default; - Option encryptedCardNumber = default; - Option encryptedExpiryMonth = default; - Option encryptedExpiryYear = default; - Option encryptedSecurityCode = default; - Option expiryMonth = default; - Option expiryYear = default; - Option fastlaneData = default; - Option fundingSource = default; - Option holderName = default; - Option networkPaymentReference = default; - Option number = default; - Option recurringDetailReference = default; - Option shopperNotificationReference = default; - Option srcCorrelationId = default; - Option srcDigitalCardId = default; - Option srcScheme = default; - Option srcTokenReference = default; - Option storedPaymentMethodId = default; - Option threeDS2SdkVersion = default; - Option type = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "brand": - brand = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "cupsecureplus.smscode": - cupsecureplusSmscode = new Option(utf8JsonReader.GetString()); - break; - case "cvc": - cvc = new Option(utf8JsonReader.GetString()); - break; - case "encryptedCard": - encryptedCard = new Option(utf8JsonReader.GetString()); - break; - case "encryptedCardNumber": - encryptedCardNumber = new Option(utf8JsonReader.GetString()); - break; - case "encryptedExpiryMonth": - encryptedExpiryMonth = new Option(utf8JsonReader.GetString()); - break; - case "encryptedExpiryYear": - encryptedExpiryYear = new Option(utf8JsonReader.GetString()); - break; - case "encryptedSecurityCode": - encryptedSecurityCode = new Option(utf8JsonReader.GetString()); - break; - case "expiryMonth": - expiryMonth = new Option(utf8JsonReader.GetString()); - break; - case "expiryYear": - expiryYear = new Option(utf8JsonReader.GetString()); - break; - case "fastlaneData": - fastlaneData = new Option(utf8JsonReader.GetString()); - break; - case "fundingSource": - string fundingSourceRawValue = utf8JsonReader.GetString(); - if (fundingSourceRawValue != null) - fundingSource = new Option(CardDonations.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); - break; - case "holderName": - holderName = new Option(utf8JsonReader.GetString()); - break; - case "networkPaymentReference": - networkPaymentReference = new Option(utf8JsonReader.GetString()); - break; - case "number": - number = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "shopperNotificationReference": - shopperNotificationReference = new Option(utf8JsonReader.GetString()); - break; - case "srcCorrelationId": - srcCorrelationId = new Option(utf8JsonReader.GetString()); - break; - case "srcDigitalCardId": - srcDigitalCardId = new Option(utf8JsonReader.GetString()); - break; - case "srcScheme": - srcScheme = new Option(utf8JsonReader.GetString()); - break; - case "srcTokenReference": - srcTokenReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2SdkVersion": - threeDS2SdkVersion = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(CardDonations.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } - } - - if (brand.IsSet && brand.Value == null) - throw new ArgumentNullException(nameof(brand), "Property is not nullable for class CardDonations."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class CardDonations."); - - if (cupsecureplusSmscode.IsSet && cupsecureplusSmscode.Value == null) - throw new ArgumentNullException(nameof(cupsecureplusSmscode), "Property is not nullable for class CardDonations."); - - if (cvc.IsSet && cvc.Value == null) - throw new ArgumentNullException(nameof(cvc), "Property is not nullable for class CardDonations."); - - if (encryptedCard.IsSet && encryptedCard.Value == null) - throw new ArgumentNullException(nameof(encryptedCard), "Property is not nullable for class CardDonations."); - - if (encryptedCardNumber.IsSet && encryptedCardNumber.Value == null) - throw new ArgumentNullException(nameof(encryptedCardNumber), "Property is not nullable for class CardDonations."); - - if (encryptedExpiryMonth.IsSet && encryptedExpiryMonth.Value == null) - throw new ArgumentNullException(nameof(encryptedExpiryMonth), "Property is not nullable for class CardDonations."); - - if (encryptedExpiryYear.IsSet && encryptedExpiryYear.Value == null) - throw new ArgumentNullException(nameof(encryptedExpiryYear), "Property is not nullable for class CardDonations."); - - if (encryptedSecurityCode.IsSet && encryptedSecurityCode.Value == null) - throw new ArgumentNullException(nameof(encryptedSecurityCode), "Property is not nullable for class CardDonations."); - - if (expiryMonth.IsSet && expiryMonth.Value == null) - throw new ArgumentNullException(nameof(expiryMonth), "Property is not nullable for class CardDonations."); - - if (expiryYear.IsSet && expiryYear.Value == null) - throw new ArgumentNullException(nameof(expiryYear), "Property is not nullable for class CardDonations."); - - if (fastlaneData.IsSet && fastlaneData.Value == null) - throw new ArgumentNullException(nameof(fastlaneData), "Property is not nullable for class CardDonations."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class CardDonations."); - - if (holderName.IsSet && holderName.Value == null) - throw new ArgumentNullException(nameof(holderName), "Property is not nullable for class CardDonations."); - - if (networkPaymentReference.IsSet && networkPaymentReference.Value == null) - throw new ArgumentNullException(nameof(networkPaymentReference), "Property is not nullable for class CardDonations."); - - if (number.IsSet && number.Value == null) - throw new ArgumentNullException(nameof(number), "Property is not nullable for class CardDonations."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class CardDonations."); - - if (shopperNotificationReference.IsSet && shopperNotificationReference.Value == null) - throw new ArgumentNullException(nameof(shopperNotificationReference), "Property is not nullable for class CardDonations."); - - if (srcCorrelationId.IsSet && srcCorrelationId.Value == null) - throw new ArgumentNullException(nameof(srcCorrelationId), "Property is not nullable for class CardDonations."); - - if (srcDigitalCardId.IsSet && srcDigitalCardId.Value == null) - throw new ArgumentNullException(nameof(srcDigitalCardId), "Property is not nullable for class CardDonations."); - - if (srcScheme.IsSet && srcScheme.Value == null) - throw new ArgumentNullException(nameof(srcScheme), "Property is not nullable for class CardDonations."); - - if (srcTokenReference.IsSet && srcTokenReference.Value == null) - throw new ArgumentNullException(nameof(srcTokenReference), "Property is not nullable for class CardDonations."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class CardDonations."); - - if (threeDS2SdkVersion.IsSet && threeDS2SdkVersion.Value == null) - throw new ArgumentNullException(nameof(threeDS2SdkVersion), "Property is not nullable for class CardDonations."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CardDonations."); - - return new CardDonations(brand, checkoutAttemptId, cupsecureplusSmscode, cvc, encryptedCard, encryptedCardNumber, encryptedExpiryMonth, encryptedExpiryYear, encryptedSecurityCode, expiryMonth, expiryYear, fastlaneData, fundingSource, holderName, networkPaymentReference, number, recurringDetailReference, shopperNotificationReference, srcCorrelationId, srcDigitalCardId, srcScheme, srcTokenReference, storedPaymentMethodId, threeDS2SdkVersion, type); - } - - /// - /// Serializes a - /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CardDonations cardDonations, JsonSerializerOptions jsonSerializerOptions) - { - writer.WriteStartObject(); - - WriteProperties(writer, cardDonations, jsonSerializerOptions); - writer.WriteEndObject(); - } - - /// - /// Serializes the properties of - /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CardDonations cardDonations, JsonSerializerOptions jsonSerializerOptions) - { - if (cardDonations.BrandOption.IsSet && cardDonations.Brand == null) - throw new ArgumentNullException(nameof(cardDonations.Brand), "Property is required for class CardDonations."); - - if (cardDonations.CheckoutAttemptIdOption.IsSet && cardDonations.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(cardDonations.CheckoutAttemptId), "Property is required for class CardDonations."); - - if (cardDonations.CupsecureplusSmscodeOption.IsSet && cardDonations.CupsecureplusSmscode == null) - throw new ArgumentNullException(nameof(cardDonations.CupsecureplusSmscode), "Property is required for class CardDonations."); - - if (cardDonations.CvcOption.IsSet && cardDonations.Cvc == null) - throw new ArgumentNullException(nameof(cardDonations.Cvc), "Property is required for class CardDonations."); - - if (cardDonations.EncryptedCardOption.IsSet && cardDonations.EncryptedCard == null) - throw new ArgumentNullException(nameof(cardDonations.EncryptedCard), "Property is required for class CardDonations."); - - if (cardDonations.EncryptedCardNumberOption.IsSet && cardDonations.EncryptedCardNumber == null) - throw new ArgumentNullException(nameof(cardDonations.EncryptedCardNumber), "Property is required for class CardDonations."); - - if (cardDonations.EncryptedExpiryMonthOption.IsSet && cardDonations.EncryptedExpiryMonth == null) - throw new ArgumentNullException(nameof(cardDonations.EncryptedExpiryMonth), "Property is required for class CardDonations."); - - if (cardDonations.EncryptedExpiryYearOption.IsSet && cardDonations.EncryptedExpiryYear == null) - throw new ArgumentNullException(nameof(cardDonations.EncryptedExpiryYear), "Property is required for class CardDonations."); - - if (cardDonations.EncryptedSecurityCodeOption.IsSet && cardDonations.EncryptedSecurityCode == null) - throw new ArgumentNullException(nameof(cardDonations.EncryptedSecurityCode), "Property is required for class CardDonations."); - - if (cardDonations.ExpiryMonthOption.IsSet && cardDonations.ExpiryMonth == null) - throw new ArgumentNullException(nameof(cardDonations.ExpiryMonth), "Property is required for class CardDonations."); - - if (cardDonations.ExpiryYearOption.IsSet && cardDonations.ExpiryYear == null) - throw new ArgumentNullException(nameof(cardDonations.ExpiryYear), "Property is required for class CardDonations."); - - if (cardDonations.FastlaneDataOption.IsSet && cardDonations.FastlaneData == null) - throw new ArgumentNullException(nameof(cardDonations.FastlaneData), "Property is required for class CardDonations."); - - if (cardDonations.HolderNameOption.IsSet && cardDonations.HolderName == null) - throw new ArgumentNullException(nameof(cardDonations.HolderName), "Property is required for class CardDonations."); - - if (cardDonations.NetworkPaymentReferenceOption.IsSet && cardDonations.NetworkPaymentReference == null) - throw new ArgumentNullException(nameof(cardDonations.NetworkPaymentReference), "Property is required for class CardDonations."); - - if (cardDonations.NumberOption.IsSet && cardDonations.Number == null) - throw new ArgumentNullException(nameof(cardDonations.Number), "Property is required for class CardDonations."); - - if (cardDonations.RecurringDetailReferenceOption.IsSet && cardDonations.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(cardDonations.RecurringDetailReference), "Property is required for class CardDonations."); - - if (cardDonations.ShopperNotificationReferenceOption.IsSet && cardDonations.ShopperNotificationReference == null) - throw new ArgumentNullException(nameof(cardDonations.ShopperNotificationReference), "Property is required for class CardDonations."); - - if (cardDonations.SrcCorrelationIdOption.IsSet && cardDonations.SrcCorrelationId == null) - throw new ArgumentNullException(nameof(cardDonations.SrcCorrelationId), "Property is required for class CardDonations."); - - if (cardDonations.SrcDigitalCardIdOption.IsSet && cardDonations.SrcDigitalCardId == null) - throw new ArgumentNullException(nameof(cardDonations.SrcDigitalCardId), "Property is required for class CardDonations."); - - if (cardDonations.SrcSchemeOption.IsSet && cardDonations.SrcScheme == null) - throw new ArgumentNullException(nameof(cardDonations.SrcScheme), "Property is required for class CardDonations."); - - if (cardDonations.SrcTokenReferenceOption.IsSet && cardDonations.SrcTokenReference == null) - throw new ArgumentNullException(nameof(cardDonations.SrcTokenReference), "Property is required for class CardDonations."); - - if (cardDonations.StoredPaymentMethodIdOption.IsSet && cardDonations.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(cardDonations.StoredPaymentMethodId), "Property is required for class CardDonations."); - - if (cardDonations.ThreeDS2SdkVersionOption.IsSet && cardDonations.ThreeDS2SdkVersion == null) - throw new ArgumentNullException(nameof(cardDonations.ThreeDS2SdkVersion), "Property is required for class CardDonations."); - - if (cardDonations.BrandOption.IsSet) - writer.WriteString("brand", cardDonations.Brand); - - if (cardDonations.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", cardDonations.CheckoutAttemptId); - - if (cardDonations.CupsecureplusSmscodeOption.IsSet) - writer.WriteString("cupsecureplus.smscode", cardDonations.CupsecureplusSmscode); - - if (cardDonations.CvcOption.IsSet) - writer.WriteString("cvc", cardDonations.Cvc); - - if (cardDonations.EncryptedCardOption.IsSet) - writer.WriteString("encryptedCard", cardDonations.EncryptedCard); - - if (cardDonations.EncryptedCardNumberOption.IsSet) - writer.WriteString("encryptedCardNumber", cardDonations.EncryptedCardNumber); - - if (cardDonations.EncryptedExpiryMonthOption.IsSet) - writer.WriteString("encryptedExpiryMonth", cardDonations.EncryptedExpiryMonth); - - if (cardDonations.EncryptedExpiryYearOption.IsSet) - writer.WriteString("encryptedExpiryYear", cardDonations.EncryptedExpiryYear); - - if (cardDonations.EncryptedSecurityCodeOption.IsSet) - writer.WriteString("encryptedSecurityCode", cardDonations.EncryptedSecurityCode); - - if (cardDonations.ExpiryMonthOption.IsSet) - writer.WriteString("expiryMonth", cardDonations.ExpiryMonth); - - if (cardDonations.ExpiryYearOption.IsSet) - writer.WriteString("expiryYear", cardDonations.ExpiryYear); - - if (cardDonations.FastlaneDataOption.IsSet) - writer.WriteString("fastlaneData", cardDonations.FastlaneData); - - var fundingSourceRawValue = CardDonations.FundingSourceEnumToJsonValue(cardDonations.FundingSourceOption.Value.Value); - writer.WriteString("fundingSource", fundingSourceRawValue); - if (cardDonations.HolderNameOption.IsSet) - writer.WriteString("holderName", cardDonations.HolderName); - - if (cardDonations.NetworkPaymentReferenceOption.IsSet) - writer.WriteString("networkPaymentReference", cardDonations.NetworkPaymentReference); - - if (cardDonations.NumberOption.IsSet) - writer.WriteString("number", cardDonations.Number); - - if (cardDonations.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", cardDonations.RecurringDetailReference); - - if (cardDonations.ShopperNotificationReferenceOption.IsSet) - writer.WriteString("shopperNotificationReference", cardDonations.ShopperNotificationReference); - - if (cardDonations.SrcCorrelationIdOption.IsSet) - writer.WriteString("srcCorrelationId", cardDonations.SrcCorrelationId); - - if (cardDonations.SrcDigitalCardIdOption.IsSet) - writer.WriteString("srcDigitalCardId", cardDonations.SrcDigitalCardId); - - if (cardDonations.SrcSchemeOption.IsSet) - writer.WriteString("srcScheme", cardDonations.SrcScheme); - - if (cardDonations.SrcTokenReferenceOption.IsSet) - writer.WriteString("srcTokenReference", cardDonations.SrcTokenReference); - - if (cardDonations.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", cardDonations.StoredPaymentMethodId); - - if (cardDonations.ThreeDS2SdkVersionOption.IsSet) - writer.WriteString("threeDS2SdkVersion", cardDonations.ThreeDS2SdkVersion); - - var typeRawValue = CardDonations.TypeEnumToJsonValue(cardDonations.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); - } - } } diff --git a/Adyen/Model/Checkout/CashAppDetails.cs b/Adyen/Model/Checkout/CashAppDetails.cs index 517d68070..b001e3386 100644 --- a/Adyen/Model/Checkout/CashAppDetails.cs +++ b/Adyen/Model/Checkout/CashAppDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,244 +15,135 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CashAppDetails /// - public partial class CashAppDetails : IValidatableObject + [DataContract(Name = "CashAppDetails")] + public partial class CashAppDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Cash App issued cashtag for recurring payment - /// The checkout attempt identifier. - /// Cash App issued customerId for recurring payment - /// Cash App issued grantId for one time payment - /// Cash App issued onFileGrantId for recurring payment - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// Cash App request id - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The payment method subtype. - /// cashapp (default to TypeEnum.Cashapp) - [JsonConstructor] - public CashAppDetails(Option cashtag = default, Option checkoutAttemptId = default, Option customerId = default, Option grantId = default, Option onFileGrantId = default, Option recurringDetailReference = default, Option requestId = default, Option storedPaymentMethodId = default, Option subtype = default, Option type = default) - { - CashtagOption = cashtag; - CheckoutAttemptIdOption = checkoutAttemptId; - CustomerIdOption = customerId; - GrantIdOption = grantId; - OnFileGrantIdOption = onFileGrantId; - RecurringDetailReferenceOption = recurringDetailReference; - RequestIdOption = requestId; - StoredPaymentMethodIdOption = storedPaymentMethodId; - SubtypeOption = subtype; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// cashapp /// /// cashapp + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Cashapp for value: cashapp /// + [EnumMember(Value = "cashapp")] Cashapp = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("cashapp")) - return TypeEnum.Cashapp; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("cashapp")) - return TypeEnum.Cashapp; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Cashapp) - return "cashapp"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// cashapp /// /// cashapp - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of Cashtag + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CashtagOption { get; private set; } + /// Cash App issued cashtag for recurring payment. + /// The checkout attempt identifier.. + /// Cash App issued customerId for recurring payment. + /// Cash App issued grantId for one time payment. + /// Cash App issued onFileGrantId for recurring payment. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// Cash App request id. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The payment method subtype.. + /// cashapp (default to TypeEnum.Cashapp). + public CashAppDetails(string cashtag = default(string), string checkoutAttemptId = default(string), string customerId = default(string), string grantId = default(string), string onFileGrantId = default(string), string recurringDetailReference = default(string), string requestId = default(string), string storedPaymentMethodId = default(string), string subtype = default(string), TypeEnum? type = TypeEnum.Cashapp) + { + this.Cashtag = cashtag; + this.CheckoutAttemptId = checkoutAttemptId; + this.CustomerId = customerId; + this.GrantId = grantId; + this.OnFileGrantId = onFileGrantId; + this.RecurringDetailReference = recurringDetailReference; + this.RequestId = requestId; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Subtype = subtype; + this.Type = type; + } /// /// Cash App issued cashtag for recurring payment /// /// Cash App issued cashtag for recurring payment - [JsonPropertyName("cashtag")] - public string Cashtag { get { return this.CashtagOption; } set { this.CashtagOption = new Option(value); } } - - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + [DataMember(Name = "cashtag", EmitDefaultValue = false)] + public string Cashtag { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of CustomerId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CustomerIdOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Cash App issued customerId for recurring payment /// /// Cash App issued customerId for recurring payment - [JsonPropertyName("customerId")] - public string CustomerId { get { return this.CustomerIdOption; } set { this.CustomerIdOption = new Option(value); } } - - /// - /// Used to track the state of GrantId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option GrantIdOption { get; private set; } + [DataMember(Name = "customerId", EmitDefaultValue = false)] + public string CustomerId { get; set; } /// /// Cash App issued grantId for one time payment /// /// Cash App issued grantId for one time payment - [JsonPropertyName("grantId")] - public string GrantId { get { return this.GrantIdOption; } set { this.GrantIdOption = new Option(value); } } - - /// - /// Used to track the state of OnFileGrantId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OnFileGrantIdOption { get; private set; } + [DataMember(Name = "grantId", EmitDefaultValue = false)] + public string GrantId { get; set; } /// /// Cash App issued onFileGrantId for recurring payment /// /// Cash App issued onFileGrantId for recurring payment - [JsonPropertyName("onFileGrantId")] - public string OnFileGrantId { get { return this.OnFileGrantIdOption; } set { this.OnFileGrantIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "onFileGrantId", EmitDefaultValue = false)] + public string OnFileGrantId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of RequestId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RequestIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// Cash App request id /// /// Cash App request id - [JsonPropertyName("requestId")] - public string RequestId { get { return this.RequestIdOption; } set { this.RequestIdOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "requestId", EmitDefaultValue = false)] + public string RequestId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of Subtype - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubtypeOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// The payment method subtype. /// /// The payment method subtype. - [JsonPropertyName("subtype")] - public string Subtype { get { return this.SubtypeOption; } set { this.SubtypeOption = new Option(value); } } + [DataMember(Name = "subtype", EmitDefaultValue = false)] + public string Subtype { get; set; } /// /// Returns the string presentation of the object @@ -276,221 +168,151 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CashAppDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CashAppDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option cashtag = default; - Option checkoutAttemptId = default; - Option customerId = default; - Option grantId = default; - Option onFileGrantId = default; - Option recurringDetailReference = default; - Option requestId = default; - Option storedPaymentMethodId = default; - Option subtype = default; - Option type = default; + return this.Equals(input as CashAppDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if CashAppDetails instances are equal + /// + /// Instance of CashAppDetails to be compared + /// Boolean + public bool Equals(CashAppDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "cashtag": - cashtag = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "customerId": - customerId = new Option(utf8JsonReader.GetString()); - break; - case "grantId": - grantId = new Option(utf8JsonReader.GetString()); - break; - case "onFileGrantId": - onFileGrantId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "requestId": - requestId = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "subtype": - subtype = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(CashAppDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (cashtag.IsSet && cashtag.Value == null) - throw new ArgumentNullException(nameof(cashtag), "Property is not nullable for class CashAppDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class CashAppDetails."); - - if (customerId.IsSet && customerId.Value == null) - throw new ArgumentNullException(nameof(customerId), "Property is not nullable for class CashAppDetails."); - - if (grantId.IsSet && grantId.Value == null) - throw new ArgumentNullException(nameof(grantId), "Property is not nullable for class CashAppDetails."); - - if (onFileGrantId.IsSet && onFileGrantId.Value == null) - throw new ArgumentNullException(nameof(onFileGrantId), "Property is not nullable for class CashAppDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class CashAppDetails."); - - if (requestId.IsSet && requestId.Value == null) - throw new ArgumentNullException(nameof(requestId), "Property is not nullable for class CashAppDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class CashAppDetails."); - - if (subtype.IsSet && subtype.Value == null) - throw new ArgumentNullException(nameof(subtype), "Property is not nullable for class CashAppDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CashAppDetails."); - - return new CashAppDetails(cashtag, checkoutAttemptId, customerId, grantId, onFileGrantId, recurringDetailReference, requestId, storedPaymentMethodId, subtype, type); + return + ( + this.Cashtag == input.Cashtag || + (this.Cashtag != null && + this.Cashtag.Equals(input.Cashtag)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.CustomerId == input.CustomerId || + (this.CustomerId != null && + this.CustomerId.Equals(input.CustomerId)) + ) && + ( + this.GrantId == input.GrantId || + (this.GrantId != null && + this.GrantId.Equals(input.GrantId)) + ) && + ( + this.OnFileGrantId == input.OnFileGrantId || + (this.OnFileGrantId != null && + this.OnFileGrantId.Equals(input.OnFileGrantId)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.RequestId == input.RequestId || + (this.RequestId != null && + this.RequestId.Equals(input.RequestId)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Subtype == input.Subtype || + (this.Subtype != null && + this.Subtype.Equals(input.Subtype)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CashAppDetails cashAppDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, cashAppDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Cashtag != null) + { + hashCode = (hashCode * 59) + this.Cashtag.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.CustomerId != null) + { + hashCode = (hashCode * 59) + this.CustomerId.GetHashCode(); + } + if (this.GrantId != null) + { + hashCode = (hashCode * 59) + this.GrantId.GetHashCode(); + } + if (this.OnFileGrantId != null) + { + hashCode = (hashCode * 59) + this.OnFileGrantId.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.RequestId != null) + { + hashCode = (hashCode * 59) + this.RequestId.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.Subtype != null) + { + hashCode = (hashCode * 59) + this.Subtype.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CashAppDetails cashAppDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (cashAppDetails.CashtagOption.IsSet && cashAppDetails.Cashtag == null) - throw new ArgumentNullException(nameof(cashAppDetails.Cashtag), "Property is required for class CashAppDetails."); - - if (cashAppDetails.CheckoutAttemptIdOption.IsSet && cashAppDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(cashAppDetails.CheckoutAttemptId), "Property is required for class CashAppDetails."); - - if (cashAppDetails.CustomerIdOption.IsSet && cashAppDetails.CustomerId == null) - throw new ArgumentNullException(nameof(cashAppDetails.CustomerId), "Property is required for class CashAppDetails."); - - if (cashAppDetails.GrantIdOption.IsSet && cashAppDetails.GrantId == null) - throw new ArgumentNullException(nameof(cashAppDetails.GrantId), "Property is required for class CashAppDetails."); - - if (cashAppDetails.OnFileGrantIdOption.IsSet && cashAppDetails.OnFileGrantId == null) - throw new ArgumentNullException(nameof(cashAppDetails.OnFileGrantId), "Property is required for class CashAppDetails."); - - if (cashAppDetails.RecurringDetailReferenceOption.IsSet && cashAppDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(cashAppDetails.RecurringDetailReference), "Property is required for class CashAppDetails."); - - if (cashAppDetails.RequestIdOption.IsSet && cashAppDetails.RequestId == null) - throw new ArgumentNullException(nameof(cashAppDetails.RequestId), "Property is required for class CashAppDetails."); - - if (cashAppDetails.StoredPaymentMethodIdOption.IsSet && cashAppDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(cashAppDetails.StoredPaymentMethodId), "Property is required for class CashAppDetails."); - - if (cashAppDetails.SubtypeOption.IsSet && cashAppDetails.Subtype == null) - throw new ArgumentNullException(nameof(cashAppDetails.Subtype), "Property is required for class CashAppDetails."); - - if (cashAppDetails.CashtagOption.IsSet) - writer.WriteString("cashtag", cashAppDetails.Cashtag); - - if (cashAppDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", cashAppDetails.CheckoutAttemptId); - - if (cashAppDetails.CustomerIdOption.IsSet) - writer.WriteString("customerId", cashAppDetails.CustomerId); - - if (cashAppDetails.GrantIdOption.IsSet) - writer.WriteString("grantId", cashAppDetails.GrantId); - - if (cashAppDetails.OnFileGrantIdOption.IsSet) - writer.WriteString("onFileGrantId", cashAppDetails.OnFileGrantId); - - if (cashAppDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", cashAppDetails.RecurringDetailReference); - - if (cashAppDetails.RequestIdOption.IsSet) - writer.WriteString("requestId", cashAppDetails.RequestId); - - if (cashAppDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", cashAppDetails.StoredPaymentMethodId); - - if (cashAppDetails.SubtypeOption.IsSet) - writer.WriteString("subtype", cashAppDetails.Subtype); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = CashAppDetails.TypeEnumToJsonValue(cashAppDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CellulantDetails.cs b/Adyen/Model/Checkout/CellulantDetails.cs index 4929077f7..44022dfc1 100644 --- a/Adyen/Model/Checkout/CellulantDetails.cs +++ b/Adyen/Model/Checkout/CellulantDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,131 +15,71 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CellulantDetails /// - public partial class CellulantDetails : IValidatableObject + [DataContract(Name = "CellulantDetails")] + public partial class CellulantDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// The Cellulant issuer. - /// **Cellulant** (default to TypeEnum.Cellulant) - [JsonConstructor] - public CellulantDetails(Option checkoutAttemptId = default, Option issuer = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - IssuerOption = issuer; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **Cellulant** /// /// **Cellulant** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Cellulant for value: cellulant /// + [EnumMember(Value = "cellulant")] Cellulant = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("cellulant")) - return TypeEnum.Cellulant; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("cellulant")) - return TypeEnum.Cellulant; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Cellulant) - return "cellulant"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **Cellulant** /// /// **Cellulant** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// The Cellulant issuer.. + /// **Cellulant** (default to TypeEnum.Cellulant). + public CellulantDetails(string checkoutAttemptId = default(string), string issuer = default(string), TypeEnum? type = TypeEnum.Cellulant) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.Issuer = issuer; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of Issuer - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IssuerOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The Cellulant issuer. /// /// The Cellulant issuer. - [JsonPropertyName("issuer")] - public string Issuer { get { return this.IssuerOption; } set { this.IssuerOption = new Option(value); } } + [DataMember(Name = "issuer", EmitDefaultValue = false)] + public string Issuer { get; set; } /// /// Returns the string presentation of the object @@ -156,124 +97,82 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CellulantDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CellulantDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option issuer = default; - Option type = default; + return this.Equals(input as CellulantDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if CellulantDetails instances are equal + /// + /// Instance of CellulantDetails to be compared + /// Boolean + public bool Equals(CellulantDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "issuer": - issuer = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(CellulantDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class CellulantDetails."); - - if (issuer.IsSet && issuer.Value == null) - throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class CellulantDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CellulantDetails."); - - return new CellulantDetails(checkoutAttemptId, issuer, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Issuer == input.Issuer || + (this.Issuer != null && + this.Issuer.Equals(input.Issuer)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CellulantDetails cellulantDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, cellulantDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.Issuer != null) + { + hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CellulantDetails cellulantDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (cellulantDetails.CheckoutAttemptIdOption.IsSet && cellulantDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(cellulantDetails.CheckoutAttemptId), "Property is required for class CellulantDetails."); - - if (cellulantDetails.IssuerOption.IsSet && cellulantDetails.Issuer == null) - throw new ArgumentNullException(nameof(cellulantDetails.Issuer), "Property is required for class CellulantDetails."); - - if (cellulantDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", cellulantDetails.CheckoutAttemptId); - - if (cellulantDetails.IssuerOption.IsSet) - writer.WriteString("issuer", cellulantDetails.Issuer); - - var typeRawValue = CellulantDetails.TypeEnumToJsonValue(cellulantDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CheckoutAwaitAction.cs b/Adyen/Model/Checkout/CheckoutAwaitAction.cs index 9b84d2bc9..bee9cfb58 100644 --- a/Adyen/Model/Checkout/CheckoutAwaitAction.cs +++ b/Adyen/Model/Checkout/CheckoutAwaitAction.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,140 +15,85 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CheckoutAwaitAction /// - public partial class CheckoutAwaitAction : IValidatableObject + [DataContract(Name = "CheckoutAwaitAction")] + public partial class CheckoutAwaitAction : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// **await** - /// Encoded payment data. - /// Specifies the payment method. - /// Specifies the URL to redirect to. - [JsonConstructor] - public CheckoutAwaitAction(TypeEnum type, Option paymentData = default, Option paymentMethodType = default, Option url = default) - { - Type = type; - PaymentDataOption = paymentData; - PaymentMethodTypeOption = paymentMethodType; - UrlOption = url; - OnCreated(); - } - - partial void OnCreated(); - /// /// **await** /// /// **await** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Await for value: await /// + [EnumMember(Value = "await")] Await = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("await")) - return TypeEnum.Await; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("await")) - return TypeEnum.Await; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.Await) - return "await"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **await** /// /// **await** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of PaymentData + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentDataOption { get; private set; } - + [JsonConstructorAttribute] + protected CheckoutAwaitAction() { } /// - /// Encoded payment data. + /// Initializes a new instance of the class. /// - /// Encoded payment data. - [JsonPropertyName("paymentData")] - public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } + /// Encoded payment data.. + /// Specifies the payment method.. + /// **await** (required). + /// Specifies the URL to redirect to.. + public CheckoutAwaitAction(string paymentData = default(string), string paymentMethodType = default(string), TypeEnum type = default(TypeEnum), string url = default(string)) + { + this.Type = type; + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.Url = url; + } /// - /// Used to track the state of PaymentMethodType + /// Encoded payment data. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodTypeOption { get; private set; } + /// Encoded payment data. + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [JsonPropertyName("paymentMethodType")] - public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } - - /// - /// Used to track the state of Url - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option UrlOption { get; private set; } + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [JsonPropertyName("url")] - public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; set; } /// /// Returns the string presentation of the object @@ -157,148 +103,100 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutAwaitAction {\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CheckoutAwaitActionJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CheckoutAwaitAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option type = default; - Option paymentData = default; - Option paymentMethodType = default; - Option url = default; + return this.Equals(input as CheckoutAwaitAction); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if CheckoutAwaitAction instances are equal + /// + /// Instance of CheckoutAwaitAction to be compared + /// Boolean + public bool Equals(CheckoutAwaitAction input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(CheckoutAwaitAction.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "paymentData": - paymentData = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethodType": - paymentMethodType = new Option(utf8JsonReader.GetString()); - break; - case "url": - url = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class CheckoutAwaitAction.", nameof(type)); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutAwaitAction."); - - if (paymentData.IsSet && paymentData.Value == null) - throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class CheckoutAwaitAction."); - - if (paymentMethodType.IsSet && paymentMethodType.Value == null) - throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutAwaitAction."); - - if (url.IsSet && url.Value == null) - throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutAwaitAction."); - - return new CheckoutAwaitAction(type.Value.Value, paymentData, paymentMethodType, url); + return + ( + this.PaymentData == input.PaymentData || + (this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData)) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + (this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutAwaitAction checkoutAwaitAction, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, checkoutAwaitAction, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PaymentData != null) + { + hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); + } + if (this.PaymentMethodType != null) + { + hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.Url != null) + { + hashCode = (hashCode * 59) + this.Url.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutAwaitAction checkoutAwaitAction, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (checkoutAwaitAction.PaymentDataOption.IsSet && checkoutAwaitAction.PaymentData == null) - throw new ArgumentNullException(nameof(checkoutAwaitAction.PaymentData), "Property is required for class CheckoutAwaitAction."); - - if (checkoutAwaitAction.PaymentMethodTypeOption.IsSet && checkoutAwaitAction.PaymentMethodType == null) - throw new ArgumentNullException(nameof(checkoutAwaitAction.PaymentMethodType), "Property is required for class CheckoutAwaitAction."); - - if (checkoutAwaitAction.UrlOption.IsSet && checkoutAwaitAction.Url == null) - throw new ArgumentNullException(nameof(checkoutAwaitAction.Url), "Property is required for class CheckoutAwaitAction."); - - var typeRawValue = CheckoutAwaitAction.TypeEnumToJsonValue(checkoutAwaitAction.Type); - writer.WriteString("type", typeRawValue); - if (checkoutAwaitAction.PaymentDataOption.IsSet) - writer.WriteString("paymentData", checkoutAwaitAction.PaymentData); - - if (checkoutAwaitAction.PaymentMethodTypeOption.IsSet) - writer.WriteString("paymentMethodType", checkoutAwaitAction.PaymentMethodType); - - if (checkoutAwaitAction.UrlOption.IsSet) - writer.WriteString("url", checkoutAwaitAction.Url); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CheckoutBankAccount.cs b/Adyen/Model/Checkout/CheckoutBankAccount.cs index e910b9c91..fb4c247c8 100644 --- a/Adyen/Model/Checkout/CheckoutBankAccount.cs +++ b/Adyen/Model/Checkout/CheckoutBankAccount.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,327 +15,170 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CheckoutBankAccount /// - public partial class CheckoutBankAccount : IValidatableObject + [DataContract(Name = "CheckoutBankAccount")] + public partial class CheckoutBankAccount : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The type of the bank account. - /// The bank account number (without separators). - /// The bank city. - /// The location id of the bank. The field value is `nil` in most cases. - /// The name of the bank. - /// The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases. - /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL'). - /// The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN). - /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. - /// The bank account holder's tax ID. - [JsonConstructor] - public CheckoutBankAccount(Option accountType = default, Option bankAccountNumber = default, Option bankCity = default, Option bankLocationId = default, Option bankName = default, Option bic = default, Option countryCode = default, Option iban = default, Option ownerName = default, Option taxId = default) - { - AccountTypeOption = accountType; - BankAccountNumberOption = bankAccountNumber; - BankCityOption = bankCity; - BankLocationIdOption = bankLocationId; - BankNameOption = bankName; - BicOption = bic; - CountryCodeOption = countryCode; - IbanOption = iban; - OwnerNameOption = ownerName; - TaxIdOption = taxId; - OnCreated(); - } - - partial void OnCreated(); - /// /// The type of the bank account. /// /// The type of the bank account. + [JsonConverter(typeof(StringEnumConverter))] public enum AccountTypeEnum { /// /// Enum Balance for value: balance /// + [EnumMember(Value = "balance")] Balance = 1, /// /// Enum Checking for value: checking /// + [EnumMember(Value = "checking")] Checking = 2, /// /// Enum Deposit for value: deposit /// + [EnumMember(Value = "deposit")] Deposit = 3, /// /// Enum General for value: general /// + [EnumMember(Value = "general")] General = 4, /// /// Enum Other for value: other /// + [EnumMember(Value = "other")] Other = 5, /// /// Enum Payment for value: payment /// + [EnumMember(Value = "payment")] Payment = 6, /// /// Enum Savings for value: savings /// + [EnumMember(Value = "savings")] Savings = 7 - } - - /// - /// Returns a - /// - /// - /// - /// - public static AccountTypeEnum AccountTypeEnumFromString(string value) - { - if (value.Equals("balance")) - return AccountTypeEnum.Balance; - - if (value.Equals("checking")) - return AccountTypeEnum.Checking; - - if (value.Equals("deposit")) - return AccountTypeEnum.Deposit; - - if (value.Equals("general")) - return AccountTypeEnum.General; - - if (value.Equals("other")) - return AccountTypeEnum.Other; - - if (value.Equals("payment")) - return AccountTypeEnum.Payment; - - if (value.Equals("savings")) - return AccountTypeEnum.Savings; - - throw new NotImplementedException($"Could not convert value to type AccountTypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static AccountTypeEnum? AccountTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("balance")) - return AccountTypeEnum.Balance; - - if (value.Equals("checking")) - return AccountTypeEnum.Checking; - - if (value.Equals("deposit")) - return AccountTypeEnum.Deposit; - - if (value.Equals("general")) - return AccountTypeEnum.General; - - if (value.Equals("other")) - return AccountTypeEnum.Other; - - if (value.Equals("payment")) - return AccountTypeEnum.Payment; - - if (value.Equals("savings")) - return AccountTypeEnum.Savings; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string AccountTypeEnumToJsonValue(AccountTypeEnum? value) - { - if (value == AccountTypeEnum.Balance) - return "balance"; - - if (value == AccountTypeEnum.Checking) - return "checking"; - if (value == AccountTypeEnum.Deposit) - return "deposit"; - - if (value == AccountTypeEnum.General) - return "general"; - - if (value == AccountTypeEnum.Other) - return "other"; - - if (value == AccountTypeEnum.Payment) - return "payment"; - - if (value == AccountTypeEnum.Savings) - return "savings"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of AccountType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountTypeOption { get; private set; } /// /// The type of the bank account. /// /// The type of the bank account. - [JsonPropertyName("accountType")] - public AccountTypeEnum? AccountType { get { return this.AccountTypeOption; } set { this.AccountTypeOption = new Option(value); } } - + [DataMember(Name = "accountType", EmitDefaultValue = false)] + public AccountTypeEnum? AccountType { get; set; } /// - /// Used to track the state of BankAccountNumber + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankAccountNumberOption { get; private set; } + /// The type of the bank account.. + /// The bank account number (without separators).. + /// The bank city.. + /// The location id of the bank. The field value is `nil` in most cases.. + /// The name of the bank.. + /// The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases.. + /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL').. + /// The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN).. + /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'.. + /// The bank account holder's tax ID.. + public CheckoutBankAccount(AccountTypeEnum? accountType = default(AccountTypeEnum?), string bankAccountNumber = default(string), string bankCity = default(string), string bankLocationId = default(string), string bankName = default(string), string bic = default(string), string countryCode = default(string), string iban = default(string), string ownerName = default(string), string taxId = default(string)) + { + this.AccountType = accountType; + this.BankAccountNumber = bankAccountNumber; + this.BankCity = bankCity; + this.BankLocationId = bankLocationId; + this.BankName = bankName; + this.Bic = bic; + this.CountryCode = countryCode; + this.Iban = iban; + this.OwnerName = ownerName; + this.TaxId = taxId; + } /// /// The bank account number (without separators). /// /// The bank account number (without separators). - [JsonPropertyName("bankAccountNumber")] - public string BankAccountNumber { get { return this.BankAccountNumberOption; } set { this.BankAccountNumberOption = new Option(value); } } - - /// - /// Used to track the state of BankCity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankCityOption { get; private set; } + [DataMember(Name = "bankAccountNumber", EmitDefaultValue = false)] + public string BankAccountNumber { get; set; } /// /// The bank city. /// /// The bank city. - [JsonPropertyName("bankCity")] - public string BankCity { get { return this.BankCityOption; } set { this.BankCityOption = new Option(value); } } - - /// - /// Used to track the state of BankLocationId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankLocationIdOption { get; private set; } + [DataMember(Name = "bankCity", EmitDefaultValue = false)] + public string BankCity { get; set; } /// /// The location id of the bank. The field value is `nil` in most cases. /// /// The location id of the bank. The field value is `nil` in most cases. - [JsonPropertyName("bankLocationId")] - public string BankLocationId { get { return this.BankLocationIdOption; } set { this.BankLocationIdOption = new Option(value); } } - - /// - /// Used to track the state of BankName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankNameOption { get; private set; } + [DataMember(Name = "bankLocationId", EmitDefaultValue = false)] + public string BankLocationId { get; set; } /// /// The name of the bank. /// /// The name of the bank. - [JsonPropertyName("bankName")] - public string BankName { get { return this.BankNameOption; } set { this.BankNameOption = new Option(value); } } - - /// - /// Used to track the state of Bic - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BicOption { get; private set; } + [DataMember(Name = "bankName", EmitDefaultValue = false)] + public string BankName { get; set; } /// /// The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases. /// /// The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases. - [JsonPropertyName("bic")] - public string Bic { get { return this.BicOption; } set { this.BicOption = new Option(value); } } - - /// - /// Used to track the state of CountryCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CountryCodeOption { get; private set; } + [DataMember(Name = "bic", EmitDefaultValue = false)] + public string Bic { get; set; } /// /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL'). /// /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL'). - [JsonPropertyName("countryCode")] - public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } - - /// - /// Used to track the state of Iban - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IbanOption { get; private set; } + [DataMember(Name = "countryCode", EmitDefaultValue = false)] + public string CountryCode { get; set; } /// /// The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN). /// /// The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN). - [JsonPropertyName("iban")] - public string Iban { get { return this.IbanOption; } set { this.IbanOption = new Option(value); } } - - /// - /// Used to track the state of OwnerName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OwnerNameOption { get; private set; } + [DataMember(Name = "iban", EmitDefaultValue = false)] + public string Iban { get; set; } /// /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. /// /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. - [JsonPropertyName("ownerName")] - public string OwnerName { get { return this.OwnerNameOption; } set { this.OwnerNameOption = new Option(value); } } - - /// - /// Used to track the state of TaxId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TaxIdOption { get; private set; } + [DataMember(Name = "ownerName", EmitDefaultValue = false)] + public string OwnerName { get; set; } /// /// The bank account holder's tax ID. /// /// The bank account holder's tax ID. - [JsonPropertyName("taxId")] - public string TaxId { get { return this.TaxIdOption; } set { this.TaxIdOption = new Option(value); } } + [DataMember(Name = "taxId", EmitDefaultValue = false)] + public string TaxId { get; set; } /// /// Returns the string presentation of the object @@ -359,214 +203,145 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CheckoutBankAccountJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CheckoutBankAccount Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option accountType = default; - Option bankAccountNumber = default; - Option bankCity = default; - Option bankLocationId = default; - Option bankName = default; - Option bic = default; - Option countryCode = default; - Option iban = default; - Option ownerName = default; - Option taxId = default; + return this.Equals(input as CheckoutBankAccount); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if CheckoutBankAccount instances are equal + /// + /// Instance of CheckoutBankAccount to be compared + /// Boolean + public bool Equals(CheckoutBankAccount input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "accountType": - string accountTypeRawValue = utf8JsonReader.GetString(); - if (accountTypeRawValue != null) - accountType = new Option(CheckoutBankAccount.AccountTypeEnumFromStringOrDefault(accountTypeRawValue)); - break; - case "bankAccountNumber": - bankAccountNumber = new Option(utf8JsonReader.GetString()); - break; - case "bankCity": - bankCity = new Option(utf8JsonReader.GetString()); - break; - case "bankLocationId": - bankLocationId = new Option(utf8JsonReader.GetString()); - break; - case "bankName": - bankName = new Option(utf8JsonReader.GetString()); - break; - case "bic": - bic = new Option(utf8JsonReader.GetString()); - break; - case "countryCode": - countryCode = new Option(utf8JsonReader.GetString()); - break; - case "iban": - iban = new Option(utf8JsonReader.GetString()); - break; - case "ownerName": - ownerName = new Option(utf8JsonReader.GetString()); - break; - case "taxId": - taxId = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (accountType.IsSet && accountType.Value == null) - throw new ArgumentNullException(nameof(accountType), "Property is not nullable for class CheckoutBankAccount."); - - if (bankAccountNumber.IsSet && bankAccountNumber.Value == null) - throw new ArgumentNullException(nameof(bankAccountNumber), "Property is not nullable for class CheckoutBankAccount."); - - if (bankCity.IsSet && bankCity.Value == null) - throw new ArgumentNullException(nameof(bankCity), "Property is not nullable for class CheckoutBankAccount."); - - if (bankLocationId.IsSet && bankLocationId.Value == null) - throw new ArgumentNullException(nameof(bankLocationId), "Property is not nullable for class CheckoutBankAccount."); - - if (bankName.IsSet && bankName.Value == null) - throw new ArgumentNullException(nameof(bankName), "Property is not nullable for class CheckoutBankAccount."); - - if (bic.IsSet && bic.Value == null) - throw new ArgumentNullException(nameof(bic), "Property is not nullable for class CheckoutBankAccount."); - - if (countryCode.IsSet && countryCode.Value == null) - throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class CheckoutBankAccount."); - - if (iban.IsSet && iban.Value == null) - throw new ArgumentNullException(nameof(iban), "Property is not nullable for class CheckoutBankAccount."); - - if (ownerName.IsSet && ownerName.Value == null) - throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class CheckoutBankAccount."); - - if (taxId.IsSet && taxId.Value == null) - throw new ArgumentNullException(nameof(taxId), "Property is not nullable for class CheckoutBankAccount."); - - return new CheckoutBankAccount(accountType, bankAccountNumber, bankCity, bankLocationId, bankName, bic, countryCode, iban, ownerName, taxId); + return + ( + this.AccountType == input.AccountType || + this.AccountType.Equals(input.AccountType) + ) && + ( + this.BankAccountNumber == input.BankAccountNumber || + (this.BankAccountNumber != null && + this.BankAccountNumber.Equals(input.BankAccountNumber)) + ) && + ( + this.BankCity == input.BankCity || + (this.BankCity != null && + this.BankCity.Equals(input.BankCity)) + ) && + ( + this.BankLocationId == input.BankLocationId || + (this.BankLocationId != null && + this.BankLocationId.Equals(input.BankLocationId)) + ) && + ( + this.BankName == input.BankName || + (this.BankName != null && + this.BankName.Equals(input.BankName)) + ) && + ( + this.Bic == input.Bic || + (this.Bic != null && + this.Bic.Equals(input.Bic)) + ) && + ( + this.CountryCode == input.CountryCode || + (this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode)) + ) && + ( + this.Iban == input.Iban || + (this.Iban != null && + this.Iban.Equals(input.Iban)) + ) && + ( + this.OwnerName == input.OwnerName || + (this.OwnerName != null && + this.OwnerName.Equals(input.OwnerName)) + ) && + ( + this.TaxId == input.TaxId || + (this.TaxId != null && + this.TaxId.Equals(input.TaxId)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutBankAccount checkoutBankAccount, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, checkoutBankAccount, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.AccountType.GetHashCode(); + if (this.BankAccountNumber != null) + { + hashCode = (hashCode * 59) + this.BankAccountNumber.GetHashCode(); + } + if (this.BankCity != null) + { + hashCode = (hashCode * 59) + this.BankCity.GetHashCode(); + } + if (this.BankLocationId != null) + { + hashCode = (hashCode * 59) + this.BankLocationId.GetHashCode(); + } + if (this.BankName != null) + { + hashCode = (hashCode * 59) + this.BankName.GetHashCode(); + } + if (this.Bic != null) + { + hashCode = (hashCode * 59) + this.Bic.GetHashCode(); + } + if (this.CountryCode != null) + { + hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); + } + if (this.Iban != null) + { + hashCode = (hashCode * 59) + this.Iban.GetHashCode(); + } + if (this.OwnerName != null) + { + hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); + } + if (this.TaxId != null) + { + hashCode = (hashCode * 59) + this.TaxId.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutBankAccount checkoutBankAccount, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (checkoutBankAccount.BankAccountNumberOption.IsSet && checkoutBankAccount.BankAccountNumber == null) - throw new ArgumentNullException(nameof(checkoutBankAccount.BankAccountNumber), "Property is required for class CheckoutBankAccount."); - - if (checkoutBankAccount.BankCityOption.IsSet && checkoutBankAccount.BankCity == null) - throw new ArgumentNullException(nameof(checkoutBankAccount.BankCity), "Property is required for class CheckoutBankAccount."); - - if (checkoutBankAccount.BankLocationIdOption.IsSet && checkoutBankAccount.BankLocationId == null) - throw new ArgumentNullException(nameof(checkoutBankAccount.BankLocationId), "Property is required for class CheckoutBankAccount."); - - if (checkoutBankAccount.BankNameOption.IsSet && checkoutBankAccount.BankName == null) - throw new ArgumentNullException(nameof(checkoutBankAccount.BankName), "Property is required for class CheckoutBankAccount."); - - if (checkoutBankAccount.BicOption.IsSet && checkoutBankAccount.Bic == null) - throw new ArgumentNullException(nameof(checkoutBankAccount.Bic), "Property is required for class CheckoutBankAccount."); - - if (checkoutBankAccount.CountryCodeOption.IsSet && checkoutBankAccount.CountryCode == null) - throw new ArgumentNullException(nameof(checkoutBankAccount.CountryCode), "Property is required for class CheckoutBankAccount."); - - if (checkoutBankAccount.IbanOption.IsSet && checkoutBankAccount.Iban == null) - throw new ArgumentNullException(nameof(checkoutBankAccount.Iban), "Property is required for class CheckoutBankAccount."); - - if (checkoutBankAccount.OwnerNameOption.IsSet && checkoutBankAccount.OwnerName == null) - throw new ArgumentNullException(nameof(checkoutBankAccount.OwnerName), "Property is required for class CheckoutBankAccount."); - - if (checkoutBankAccount.TaxIdOption.IsSet && checkoutBankAccount.TaxId == null) - throw new ArgumentNullException(nameof(checkoutBankAccount.TaxId), "Property is required for class CheckoutBankAccount."); - - var accountTypeRawValue = CheckoutBankAccount.AccountTypeEnumToJsonValue(checkoutBankAccount.AccountTypeOption.Value.Value); - writer.WriteString("accountType", accountTypeRawValue); - if (checkoutBankAccount.BankAccountNumberOption.IsSet) - writer.WriteString("bankAccountNumber", checkoutBankAccount.BankAccountNumber); - - if (checkoutBankAccount.BankCityOption.IsSet) - writer.WriteString("bankCity", checkoutBankAccount.BankCity); - - if (checkoutBankAccount.BankLocationIdOption.IsSet) - writer.WriteString("bankLocationId", checkoutBankAccount.BankLocationId); - - if (checkoutBankAccount.BankNameOption.IsSet) - writer.WriteString("bankName", checkoutBankAccount.BankName); - - if (checkoutBankAccount.BicOption.IsSet) - writer.WriteString("bic", checkoutBankAccount.Bic); - - if (checkoutBankAccount.CountryCodeOption.IsSet) - writer.WriteString("countryCode", checkoutBankAccount.CountryCode); - - if (checkoutBankAccount.IbanOption.IsSet) - writer.WriteString("iban", checkoutBankAccount.Iban); - - if (checkoutBankAccount.OwnerNameOption.IsSet) - writer.WriteString("ownerName", checkoutBankAccount.OwnerName); - - if (checkoutBankAccount.TaxIdOption.IsSet) - writer.WriteString("taxId", checkoutBankAccount.TaxId); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CheckoutBankTransferAction.cs b/Adyen/Model/Checkout/CheckoutBankTransferAction.cs index e47b8f8cf..c0e83599b 100644 --- a/Adyen/Model/Checkout/CheckoutBankTransferAction.cs +++ b/Adyen/Model/Checkout/CheckoutBankTransferAction.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,283 +15,165 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CheckoutBankTransferAction /// - public partial class CheckoutBankTransferAction : IValidatableObject + [DataContract(Name = "CheckoutBankTransferAction")] + public partial class CheckoutBankTransferAction : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The type of the action. - /// The account number of the bank transfer. - /// The name of the account holder. - /// The BIC of the IBAN. - /// The url to download payment details with. - /// The IBAN of the bank transfer. - /// Specifies the payment method. - /// The transfer reference. - /// The routing number of the bank transfer. - /// The e-mail of the shopper, included if an e-mail was sent to the shopper. - /// The sort code of the bank transfer. - /// totalAmount - /// Specifies the URL to redirect to. - [JsonConstructor] - public CheckoutBankTransferAction(TypeEnum type, Option accountNumber = default, Option beneficiary = default, Option bic = default, Option downloadUrl = default, Option iban = default, Option paymentMethodType = default, Option reference = default, Option routingNumber = default, Option shopperEmail = default, Option sortCode = default, Option totalAmount = default, Option url = default) - { - Type = type; - AccountNumberOption = accountNumber; - BeneficiaryOption = beneficiary; - BicOption = bic; - DownloadUrlOption = downloadUrl; - IbanOption = iban; - PaymentMethodTypeOption = paymentMethodType; - ReferenceOption = reference; - RoutingNumberOption = routingNumber; - ShopperEmailOption = shopperEmail; - SortCodeOption = sortCode; - TotalAmountOption = totalAmount; - UrlOption = url; - OnCreated(); - } - - partial void OnCreated(); - /// /// The type of the action. /// /// The type of the action. + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum BankTransfer for value: bankTransfer /// + [EnumMember(Value = "bankTransfer")] BankTransfer = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("bankTransfer")) - return TypeEnum.BankTransfer; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("bankTransfer")) - return TypeEnum.BankTransfer; - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.BankTransfer) - return "bankTransfer"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// The type of the action. /// /// The type of the action. - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of AccountNumber + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountNumberOption { get; private set; } - + [JsonConstructorAttribute] + protected CheckoutBankTransferAction() { } /// - /// The account number of the bank transfer. + /// Initializes a new instance of the class. /// - /// The account number of the bank transfer. - [JsonPropertyName("accountNumber")] - public string AccountNumber { get { return this.AccountNumberOption; } set { this.AccountNumberOption = new Option(value); } } + /// The account number of the bank transfer.. + /// The name of the account holder.. + /// The BIC of the IBAN.. + /// The url to download payment details with.. + /// The IBAN of the bank transfer.. + /// Specifies the payment method.. + /// The transfer reference.. + /// The routing number of the bank transfer.. + /// The e-mail of the shopper, included if an e-mail was sent to the shopper.. + /// The sort code of the bank transfer.. + /// totalAmount. + /// The type of the action. (required). + /// Specifies the URL to redirect to.. + public CheckoutBankTransferAction(string accountNumber = default(string), string beneficiary = default(string), string bic = default(string), string downloadUrl = default(string), string iban = default(string), string paymentMethodType = default(string), string reference = default(string), string routingNumber = default(string), string shopperEmail = default(string), string sortCode = default(string), Amount totalAmount = default(Amount), TypeEnum type = default(TypeEnum), string url = default(string)) + { + this.Type = type; + this.AccountNumber = accountNumber; + this.Beneficiary = beneficiary; + this.Bic = bic; + this.DownloadUrl = downloadUrl; + this.Iban = iban; + this.PaymentMethodType = paymentMethodType; + this.Reference = reference; + this.RoutingNumber = routingNumber; + this.ShopperEmail = shopperEmail; + this.SortCode = sortCode; + this.TotalAmount = totalAmount; + this.Url = url; + } /// - /// Used to track the state of Beneficiary + /// The account number of the bank transfer. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BeneficiaryOption { get; private set; } + /// The account number of the bank transfer. + [DataMember(Name = "accountNumber", EmitDefaultValue = false)] + public string AccountNumber { get; set; } /// /// The name of the account holder. /// /// The name of the account holder. - [JsonPropertyName("beneficiary")] - public string Beneficiary { get { return this.BeneficiaryOption; } set { this.BeneficiaryOption = new Option(value); } } - - /// - /// Used to track the state of Bic - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BicOption { get; private set; } + [DataMember(Name = "beneficiary", EmitDefaultValue = false)] + public string Beneficiary { get; set; } /// /// The BIC of the IBAN. /// /// The BIC of the IBAN. - [JsonPropertyName("bic")] - public string Bic { get { return this.BicOption; } set { this.BicOption = new Option(value); } } - - /// - /// Used to track the state of DownloadUrl - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DownloadUrlOption { get; private set; } + [DataMember(Name = "bic", EmitDefaultValue = false)] + public string Bic { get; set; } /// /// The url to download payment details with. /// /// The url to download payment details with. - [JsonPropertyName("downloadUrl")] - public string DownloadUrl { get { return this.DownloadUrlOption; } set { this.DownloadUrlOption = new Option(value); } } - - /// - /// Used to track the state of Iban - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IbanOption { get; private set; } + [DataMember(Name = "downloadUrl", EmitDefaultValue = false)] + public string DownloadUrl { get; set; } /// /// The IBAN of the bank transfer. /// /// The IBAN of the bank transfer. - [JsonPropertyName("iban")] - public string Iban { get { return this.IbanOption; } set { this.IbanOption = new Option(value); } } - - /// - /// Used to track the state of PaymentMethodType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodTypeOption { get; private set; } + [DataMember(Name = "iban", EmitDefaultValue = false)] + public string Iban { get; set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [JsonPropertyName("paymentMethodType")] - public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } - - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } /// /// The transfer reference. /// /// The transfer reference. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } - - /// - /// Used to track the state of RoutingNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RoutingNumberOption { get; private set; } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// The routing number of the bank transfer. /// /// The routing number of the bank transfer. - [JsonPropertyName("routingNumber")] - public string RoutingNumber { get { return this.RoutingNumberOption; } set { this.RoutingNumberOption = new Option(value); } } - - /// - /// Used to track the state of ShopperEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + [DataMember(Name = "routingNumber", EmitDefaultValue = false)] + public string RoutingNumber { get; set; } /// /// The e-mail of the shopper, included if an e-mail was sent to the shopper. /// /// The e-mail of the shopper, included if an e-mail was sent to the shopper. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } - - /// - /// Used to track the state of SortCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SortCodeOption { get; private set; } + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// /// The sort code of the bank transfer. /// /// The sort code of the bank transfer. - [JsonPropertyName("sortCode")] - public string SortCode { get { return this.SortCodeOption; } set { this.SortCodeOption = new Option(value); } } - - /// - /// Used to track the state of TotalAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TotalAmountOption { get; private set; } + [DataMember(Name = "sortCode", EmitDefaultValue = false)] + public string SortCode { get; set; } /// /// Gets or Sets TotalAmount /// - [JsonPropertyName("totalAmount")] - public Amount TotalAmount { get { return this.TotalAmountOption; } set { this.TotalAmountOption = new Option(value); } } - - /// - /// Used to track the state of Url - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option UrlOption { get; private set; } + [DataMember(Name = "totalAmount", EmitDefaultValue = false)] + public Amount TotalAmount { get; set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [JsonPropertyName("url")] - public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; set; } /// /// Returns the string presentation of the object @@ -300,7 +183,6 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutBankTransferAction {\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" AccountNumber: ").Append(AccountNumber).Append("\n"); sb.Append(" Beneficiary: ").Append(Beneficiary).Append("\n"); sb.Append(" Bic: ").Append(Bic).Append("\n"); @@ -312,265 +194,179 @@ public override string ToString() sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" SortCode: ").Append(SortCode).Append("\n"); sb.Append(" TotalAmount: ").Append(TotalAmount).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CheckoutBankTransferActionJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CheckoutBankTransferAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option type = default; - Option accountNumber = default; - Option beneficiary = default; - Option bic = default; - Option downloadUrl = default; - Option iban = default; - Option paymentMethodType = default; - Option reference = default; - Option routingNumber = default; - Option shopperEmail = default; - Option sortCode = default; - Option totalAmount = default; - Option url = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(CheckoutBankTransferAction.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "accountNumber": - accountNumber = new Option(utf8JsonReader.GetString()); - break; - case "beneficiary": - beneficiary = new Option(utf8JsonReader.GetString()); - break; - case "bic": - bic = new Option(utf8JsonReader.GetString()); - break; - case "downloadUrl": - downloadUrl = new Option(utf8JsonReader.GetString()); - break; - case "iban": - iban = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethodType": - paymentMethodType = new Option(utf8JsonReader.GetString()); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "routingNumber": - routingNumber = new Option(utf8JsonReader.GetString()); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "sortCode": - sortCode = new Option(utf8JsonReader.GetString()); - break; - case "totalAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - totalAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "url": - url = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class CheckoutBankTransferAction.", nameof(type)); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutBankTransferAction."); - - if (accountNumber.IsSet && accountNumber.Value == null) - throw new ArgumentNullException(nameof(accountNumber), "Property is not nullable for class CheckoutBankTransferAction."); - - if (beneficiary.IsSet && beneficiary.Value == null) - throw new ArgumentNullException(nameof(beneficiary), "Property is not nullable for class CheckoutBankTransferAction."); - - if (bic.IsSet && bic.Value == null) - throw new ArgumentNullException(nameof(bic), "Property is not nullable for class CheckoutBankTransferAction."); - - if (downloadUrl.IsSet && downloadUrl.Value == null) - throw new ArgumentNullException(nameof(downloadUrl), "Property is not nullable for class CheckoutBankTransferAction."); - - if (iban.IsSet && iban.Value == null) - throw new ArgumentNullException(nameof(iban), "Property is not nullable for class CheckoutBankTransferAction."); - - if (paymentMethodType.IsSet && paymentMethodType.Value == null) - throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutBankTransferAction."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CheckoutBankTransferAction."); - - if (routingNumber.IsSet && routingNumber.Value == null) - throw new ArgumentNullException(nameof(routingNumber), "Property is not nullable for class CheckoutBankTransferAction."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class CheckoutBankTransferAction."); - - if (sortCode.IsSet && sortCode.Value == null) - throw new ArgumentNullException(nameof(sortCode), "Property is not nullable for class CheckoutBankTransferAction."); - - if (totalAmount.IsSet && totalAmount.Value == null) - throw new ArgumentNullException(nameof(totalAmount), "Property is not nullable for class CheckoutBankTransferAction."); - - if (url.IsSet && url.Value == null) - throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutBankTransferAction."); - - return new CheckoutBankTransferAction(type.Value.Value, accountNumber, beneficiary, bic, downloadUrl, iban, paymentMethodType, reference, routingNumber, shopperEmail, sortCode, totalAmount, url); + return this.Equals(input as CheckoutBankTransferAction); } /// - /// Serializes a + /// Returns true if CheckoutBankTransferAction instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutBankTransferAction checkoutBankTransferAction, JsonSerializerOptions jsonSerializerOptions) + /// Instance of CheckoutBankTransferAction to be compared + /// Boolean + public bool Equals(CheckoutBankTransferAction input) { - writer.WriteStartObject(); - - WriteProperties(writer, checkoutBankTransferAction, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AccountNumber == input.AccountNumber || + (this.AccountNumber != null && + this.AccountNumber.Equals(input.AccountNumber)) + ) && + ( + this.Beneficiary == input.Beneficiary || + (this.Beneficiary != null && + this.Beneficiary.Equals(input.Beneficiary)) + ) && + ( + this.Bic == input.Bic || + (this.Bic != null && + this.Bic.Equals(input.Bic)) + ) && + ( + this.DownloadUrl == input.DownloadUrl || + (this.DownloadUrl != null && + this.DownloadUrl.Equals(input.DownloadUrl)) + ) && + ( + this.Iban == input.Iban || + (this.Iban != null && + this.Iban.Equals(input.Iban)) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + (this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.RoutingNumber == input.RoutingNumber || + (this.RoutingNumber != null && + this.RoutingNumber.Equals(input.RoutingNumber)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.SortCode == input.SortCode || + (this.SortCode != null && + this.SortCode.Equals(input.SortCode)) + ) && + ( + this.TotalAmount == input.TotalAmount || + (this.TotalAmount != null && + this.TotalAmount.Equals(input.TotalAmount)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutBankTransferAction checkoutBankTransferAction, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (checkoutBankTransferAction.AccountNumberOption.IsSet && checkoutBankTransferAction.AccountNumber == null) - throw new ArgumentNullException(nameof(checkoutBankTransferAction.AccountNumber), "Property is required for class CheckoutBankTransferAction."); - - if (checkoutBankTransferAction.BeneficiaryOption.IsSet && checkoutBankTransferAction.Beneficiary == null) - throw new ArgumentNullException(nameof(checkoutBankTransferAction.Beneficiary), "Property is required for class CheckoutBankTransferAction."); - - if (checkoutBankTransferAction.BicOption.IsSet && checkoutBankTransferAction.Bic == null) - throw new ArgumentNullException(nameof(checkoutBankTransferAction.Bic), "Property is required for class CheckoutBankTransferAction."); - - if (checkoutBankTransferAction.DownloadUrlOption.IsSet && checkoutBankTransferAction.DownloadUrl == null) - throw new ArgumentNullException(nameof(checkoutBankTransferAction.DownloadUrl), "Property is required for class CheckoutBankTransferAction."); - - if (checkoutBankTransferAction.IbanOption.IsSet && checkoutBankTransferAction.Iban == null) - throw new ArgumentNullException(nameof(checkoutBankTransferAction.Iban), "Property is required for class CheckoutBankTransferAction."); - - if (checkoutBankTransferAction.PaymentMethodTypeOption.IsSet && checkoutBankTransferAction.PaymentMethodType == null) - throw new ArgumentNullException(nameof(checkoutBankTransferAction.PaymentMethodType), "Property is required for class CheckoutBankTransferAction."); - - if (checkoutBankTransferAction.ReferenceOption.IsSet && checkoutBankTransferAction.Reference == null) - throw new ArgumentNullException(nameof(checkoutBankTransferAction.Reference), "Property is required for class CheckoutBankTransferAction."); - - if (checkoutBankTransferAction.RoutingNumberOption.IsSet && checkoutBankTransferAction.RoutingNumber == null) - throw new ArgumentNullException(nameof(checkoutBankTransferAction.RoutingNumber), "Property is required for class CheckoutBankTransferAction."); - - if (checkoutBankTransferAction.ShopperEmailOption.IsSet && checkoutBankTransferAction.ShopperEmail == null) - throw new ArgumentNullException(nameof(checkoutBankTransferAction.ShopperEmail), "Property is required for class CheckoutBankTransferAction."); - - if (checkoutBankTransferAction.SortCodeOption.IsSet && checkoutBankTransferAction.SortCode == null) - throw new ArgumentNullException(nameof(checkoutBankTransferAction.SortCode), "Property is required for class CheckoutBankTransferAction."); - - if (checkoutBankTransferAction.TotalAmountOption.IsSet && checkoutBankTransferAction.TotalAmount == null) - throw new ArgumentNullException(nameof(checkoutBankTransferAction.TotalAmount), "Property is required for class CheckoutBankTransferAction."); - - if (checkoutBankTransferAction.UrlOption.IsSet && checkoutBankTransferAction.Url == null) - throw new ArgumentNullException(nameof(checkoutBankTransferAction.Url), "Property is required for class CheckoutBankTransferAction."); - - var typeRawValue = CheckoutBankTransferAction.TypeEnumToJsonValue(checkoutBankTransferAction.Type); - writer.WriteString("type", typeRawValue); - if (checkoutBankTransferAction.AccountNumberOption.IsSet) - writer.WriteString("accountNumber", checkoutBankTransferAction.AccountNumber); - - if (checkoutBankTransferAction.BeneficiaryOption.IsSet) - writer.WriteString("beneficiary", checkoutBankTransferAction.Beneficiary); - - if (checkoutBankTransferAction.BicOption.IsSet) - writer.WriteString("bic", checkoutBankTransferAction.Bic); - - if (checkoutBankTransferAction.DownloadUrlOption.IsSet) - writer.WriteString("downloadUrl", checkoutBankTransferAction.DownloadUrl); - - if (checkoutBankTransferAction.IbanOption.IsSet) - writer.WriteString("iban", checkoutBankTransferAction.Iban); - - if (checkoutBankTransferAction.PaymentMethodTypeOption.IsSet) - writer.WriteString("paymentMethodType", checkoutBankTransferAction.PaymentMethodType); - - if (checkoutBankTransferAction.ReferenceOption.IsSet) - writer.WriteString("reference", checkoutBankTransferAction.Reference); - - if (checkoutBankTransferAction.RoutingNumberOption.IsSet) - writer.WriteString("routingNumber", checkoutBankTransferAction.RoutingNumber); - - if (checkoutBankTransferAction.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", checkoutBankTransferAction.ShopperEmail); - - if (checkoutBankTransferAction.SortCodeOption.IsSet) - writer.WriteString("sortCode", checkoutBankTransferAction.SortCode); - - if (checkoutBankTransferAction.TotalAmountOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("totalAmount"); - JsonSerializer.Serialize(writer, checkoutBankTransferAction.TotalAmount, jsonSerializerOptions); + int hashCode = 41; + if (this.AccountNumber != null) + { + hashCode = (hashCode * 59) + this.AccountNumber.GetHashCode(); + } + if (this.Beneficiary != null) + { + hashCode = (hashCode * 59) + this.Beneficiary.GetHashCode(); + } + if (this.Bic != null) + { + hashCode = (hashCode * 59) + this.Bic.GetHashCode(); + } + if (this.DownloadUrl != null) + { + hashCode = (hashCode * 59) + this.DownloadUrl.GetHashCode(); + } + if (this.Iban != null) + { + hashCode = (hashCode * 59) + this.Iban.GetHashCode(); + } + if (this.PaymentMethodType != null) + { + hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.RoutingNumber != null) + { + hashCode = (hashCode * 59) + this.RoutingNumber.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.SortCode != null) + { + hashCode = (hashCode * 59) + this.SortCode.GetHashCode(); + } + if (this.TotalAmount != null) + { + hashCode = (hashCode * 59) + this.TotalAmount.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.Url != null) + { + hashCode = (hashCode * 59) + this.Url.GetHashCode(); + } + return hashCode; } - if (checkoutBankTransferAction.UrlOption.IsSet) - writer.WriteString("url", checkoutBankTransferAction.Url); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs b/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs index 79a699557..87781b5f4 100644 --- a/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs +++ b/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,172 +15,103 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CheckoutDelegatedAuthenticationAction /// - public partial class CheckoutDelegatedAuthenticationAction : IValidatableObject + [DataContract(Name = "CheckoutDelegatedAuthenticationAction")] + public partial class CheckoutDelegatedAuthenticationAction : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// **delegatedAuthentication** - /// A token needed to authorise a payment. - /// Encoded payment data. - /// Specifies the payment method. - /// A token to pass to the delegatedAuthentication component. - /// Specifies the URL to redirect to. - [JsonConstructor] - public CheckoutDelegatedAuthenticationAction(TypeEnum type, Option authorisationToken = default, Option paymentData = default, Option paymentMethodType = default, Option token = default, Option url = default) - { - Type = type; - AuthorisationTokenOption = authorisationToken; - PaymentDataOption = paymentData; - PaymentMethodTypeOption = paymentMethodType; - TokenOption = token; - UrlOption = url; - OnCreated(); - } - - partial void OnCreated(); - /// /// **delegatedAuthentication** /// /// **delegatedAuthentication** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum DelegatedAuthentication for value: delegatedAuthentication /// + [EnumMember(Value = "delegatedAuthentication")] DelegatedAuthentication = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("delegatedAuthentication")) - return TypeEnum.DelegatedAuthentication; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("delegatedAuthentication")) - return TypeEnum.DelegatedAuthentication; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.DelegatedAuthentication) - return "delegatedAuthentication"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **delegatedAuthentication** /// /// **delegatedAuthentication** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of AuthorisationToken + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected CheckoutDelegatedAuthenticationAction() { } + /// + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthorisationTokenOption { get; private set; } + /// A token needed to authorise a payment.. + /// Encoded payment data.. + /// Specifies the payment method.. + /// A token to pass to the delegatedAuthentication component.. + /// **delegatedAuthentication** (required). + /// Specifies the URL to redirect to.. + public CheckoutDelegatedAuthenticationAction(string authorisationToken = default(string), string paymentData = default(string), string paymentMethodType = default(string), string token = default(string), TypeEnum type = default(TypeEnum), string url = default(string)) + { + this.Type = type; + this.AuthorisationToken = authorisationToken; + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.Token = token; + this.Url = url; + } /// /// A token needed to authorise a payment. /// /// A token needed to authorise a payment. - [JsonPropertyName("authorisationToken")] - public string AuthorisationToken { get { return this.AuthorisationTokenOption; } set { this.AuthorisationTokenOption = new Option(value); } } - - /// - /// Used to track the state of PaymentData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentDataOption { get; private set; } + [DataMember(Name = "authorisationToken", EmitDefaultValue = false)] + public string AuthorisationToken { get; set; } /// /// Encoded payment data. /// /// Encoded payment data. - [JsonPropertyName("paymentData")] - public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } - - /// - /// Used to track the state of PaymentMethodType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodTypeOption { get; private set; } + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [JsonPropertyName("paymentMethodType")] - public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } - - /// - /// Used to track the state of Token - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TokenOption { get; private set; } + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } /// /// A token to pass to the delegatedAuthentication component. /// /// A token to pass to the delegatedAuthentication component. - [JsonPropertyName("token")] - public string Token { get { return this.TokenOption; } set { this.TokenOption = new Option(value); } } - - /// - /// Used to track the state of Url - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option UrlOption { get; private set; } + [DataMember(Name = "token", EmitDefaultValue = false)] + public string Token { get; set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [JsonPropertyName("url")] - public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; set; } /// /// Returns the string presentation of the object @@ -189,176 +121,120 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutDelegatedAuthenticationAction {\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" AuthorisationToken: ").Append(AuthorisationToken).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); sb.Append(" Token: ").Append(Token).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CheckoutDelegatedAuthenticationActionJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CheckoutDelegatedAuthenticationAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option type = default; - Option authorisationToken = default; - Option paymentData = default; - Option paymentMethodType = default; - Option token = default; - Option url = default; + return this.Equals(input as CheckoutDelegatedAuthenticationAction); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if CheckoutDelegatedAuthenticationAction instances are equal + /// + /// Instance of CheckoutDelegatedAuthenticationAction to be compared + /// Boolean + public bool Equals(CheckoutDelegatedAuthenticationAction input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(CheckoutDelegatedAuthenticationAction.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "authorisationToken": - authorisationToken = new Option(utf8JsonReader.GetString()); - break; - case "paymentData": - paymentData = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethodType": - paymentMethodType = new Option(utf8JsonReader.GetString()); - break; - case "token": - token = new Option(utf8JsonReader.GetString()); - break; - case "url": - url = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class CheckoutDelegatedAuthenticationAction.", nameof(type)); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutDelegatedAuthenticationAction."); - - if (authorisationToken.IsSet && authorisationToken.Value == null) - throw new ArgumentNullException(nameof(authorisationToken), "Property is not nullable for class CheckoutDelegatedAuthenticationAction."); - - if (paymentData.IsSet && paymentData.Value == null) - throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class CheckoutDelegatedAuthenticationAction."); - - if (paymentMethodType.IsSet && paymentMethodType.Value == null) - throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutDelegatedAuthenticationAction."); - - if (token.IsSet && token.Value == null) - throw new ArgumentNullException(nameof(token), "Property is not nullable for class CheckoutDelegatedAuthenticationAction."); - - if (url.IsSet && url.Value == null) - throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutDelegatedAuthenticationAction."); - - return new CheckoutDelegatedAuthenticationAction(type.Value.Value, authorisationToken, paymentData, paymentMethodType, token, url); + return + ( + this.AuthorisationToken == input.AuthorisationToken || + (this.AuthorisationToken != null && + this.AuthorisationToken.Equals(input.AuthorisationToken)) + ) && + ( + this.PaymentData == input.PaymentData || + (this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData)) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + (this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType)) + ) && + ( + this.Token == input.Token || + (this.Token != null && + this.Token.Equals(input.Token)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutDelegatedAuthenticationAction checkoutDelegatedAuthenticationAction, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, checkoutDelegatedAuthenticationAction, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AuthorisationToken != null) + { + hashCode = (hashCode * 59) + this.AuthorisationToken.GetHashCode(); + } + if (this.PaymentData != null) + { + hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); + } + if (this.PaymentMethodType != null) + { + hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); + } + if (this.Token != null) + { + hashCode = (hashCode * 59) + this.Token.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.Url != null) + { + hashCode = (hashCode * 59) + this.Url.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutDelegatedAuthenticationAction checkoutDelegatedAuthenticationAction, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (checkoutDelegatedAuthenticationAction.AuthorisationTokenOption.IsSet && checkoutDelegatedAuthenticationAction.AuthorisationToken == null) - throw new ArgumentNullException(nameof(checkoutDelegatedAuthenticationAction.AuthorisationToken), "Property is required for class CheckoutDelegatedAuthenticationAction."); - - if (checkoutDelegatedAuthenticationAction.PaymentDataOption.IsSet && checkoutDelegatedAuthenticationAction.PaymentData == null) - throw new ArgumentNullException(nameof(checkoutDelegatedAuthenticationAction.PaymentData), "Property is required for class CheckoutDelegatedAuthenticationAction."); - - if (checkoutDelegatedAuthenticationAction.PaymentMethodTypeOption.IsSet && checkoutDelegatedAuthenticationAction.PaymentMethodType == null) - throw new ArgumentNullException(nameof(checkoutDelegatedAuthenticationAction.PaymentMethodType), "Property is required for class CheckoutDelegatedAuthenticationAction."); - - if (checkoutDelegatedAuthenticationAction.TokenOption.IsSet && checkoutDelegatedAuthenticationAction.Token == null) - throw new ArgumentNullException(nameof(checkoutDelegatedAuthenticationAction.Token), "Property is required for class CheckoutDelegatedAuthenticationAction."); - - if (checkoutDelegatedAuthenticationAction.UrlOption.IsSet && checkoutDelegatedAuthenticationAction.Url == null) - throw new ArgumentNullException(nameof(checkoutDelegatedAuthenticationAction.Url), "Property is required for class CheckoutDelegatedAuthenticationAction."); - - var typeRawValue = CheckoutDelegatedAuthenticationAction.TypeEnumToJsonValue(checkoutDelegatedAuthenticationAction.Type); - writer.WriteString("type", typeRawValue); - if (checkoutDelegatedAuthenticationAction.AuthorisationTokenOption.IsSet) - writer.WriteString("authorisationToken", checkoutDelegatedAuthenticationAction.AuthorisationToken); - - if (checkoutDelegatedAuthenticationAction.PaymentDataOption.IsSet) - writer.WriteString("paymentData", checkoutDelegatedAuthenticationAction.PaymentData); - - if (checkoutDelegatedAuthenticationAction.PaymentMethodTypeOption.IsSet) - writer.WriteString("paymentMethodType", checkoutDelegatedAuthenticationAction.PaymentMethodType); - - if (checkoutDelegatedAuthenticationAction.TokenOption.IsSet) - writer.WriteString("token", checkoutDelegatedAuthenticationAction.Token); - - if (checkoutDelegatedAuthenticationAction.UrlOption.IsSet) - writer.WriteString("url", checkoutDelegatedAuthenticationAction.Url); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs b/Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs index 569ae0451..c30bf7a47 100644 --- a/Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs +++ b/Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,172 +15,103 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CheckoutNativeRedirectAction /// - public partial class CheckoutNativeRedirectAction : IValidatableObject + [DataContract(Name = "CheckoutNativeRedirectAction")] + public partial class CheckoutNativeRedirectAction : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// **nativeRedirect** - /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. - /// Specifies the HTTP method, for example GET or POST. - /// Native SDK's redirect data containing the direct issuer link and state data that must be submitted to the /v1/nativeRedirect/redirectResult. - /// Specifies the payment method. - /// Specifies the URL to redirect to. - [JsonConstructor] - public CheckoutNativeRedirectAction(TypeEnum type, Option> data = default, Option method = default, Option nativeRedirectData = default, Option paymentMethodType = default, Option url = default) - { - Type = type; - DataOption = data; - MethodOption = method; - NativeRedirectDataOption = nativeRedirectData; - PaymentMethodTypeOption = paymentMethodType; - UrlOption = url; - OnCreated(); - } - - partial void OnCreated(); - /// /// **nativeRedirect** /// /// **nativeRedirect** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum NativeRedirect for value: nativeRedirect /// + [EnumMember(Value = "nativeRedirect")] NativeRedirect = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("nativeRedirect")) - return TypeEnum.NativeRedirect; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("nativeRedirect")) - return TypeEnum.NativeRedirect; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.NativeRedirect) - return "nativeRedirect"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **nativeRedirect** /// /// **nativeRedirect** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of Data + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> DataOption { get; private set; } - + [JsonConstructorAttribute] + protected CheckoutNativeRedirectAction() { } /// - /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. + /// Initializes a new instance of the class. /// - /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. - [JsonPropertyName("data")] - public Dictionary Data { get { return this.DataOption; } set { this.DataOption = new Option>(value); } } + /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL.. + /// Specifies the HTTP method, for example GET or POST.. + /// Native SDK's redirect data containing the direct issuer link and state data that must be submitted to the /v1/nativeRedirect/redirectResult.. + /// Specifies the payment method.. + /// **nativeRedirect** (required). + /// Specifies the URL to redirect to.. + public CheckoutNativeRedirectAction(Dictionary data = default(Dictionary), string method = default(string), string nativeRedirectData = default(string), string paymentMethodType = default(string), TypeEnum type = default(TypeEnum), string url = default(string)) + { + this.Type = type; + this.Data = data; + this.Method = method; + this.NativeRedirectData = nativeRedirectData; + this.PaymentMethodType = paymentMethodType; + this.Url = url; + } /// - /// Used to track the state of Method + /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MethodOption { get; private set; } + /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. + [DataMember(Name = "data", EmitDefaultValue = false)] + public Dictionary Data { get; set; } /// /// Specifies the HTTP method, for example GET or POST. /// /// Specifies the HTTP method, for example GET or POST. - [JsonPropertyName("method")] - public string Method { get { return this.MethodOption; } set { this.MethodOption = new Option(value); } } - - /// - /// Used to track the state of NativeRedirectData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NativeRedirectDataOption { get; private set; } + [DataMember(Name = "method", EmitDefaultValue = false)] + public string Method { get; set; } /// /// Native SDK's redirect data containing the direct issuer link and state data that must be submitted to the /v1/nativeRedirect/redirectResult. /// /// Native SDK's redirect data containing the direct issuer link and state data that must be submitted to the /v1/nativeRedirect/redirectResult. - [JsonPropertyName("nativeRedirectData")] - public string NativeRedirectData { get { return this.NativeRedirectDataOption; } set { this.NativeRedirectDataOption = new Option(value); } } - - /// - /// Used to track the state of PaymentMethodType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodTypeOption { get; private set; } + [DataMember(Name = "nativeRedirectData", EmitDefaultValue = false)] + public string NativeRedirectData { get; set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [JsonPropertyName("paymentMethodType")] - public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } - - /// - /// Used to track the state of Url - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option UrlOption { get; private set; } + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [JsonPropertyName("url")] - public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; set; } /// /// Returns the string presentation of the object @@ -189,179 +121,121 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutNativeRedirectAction {\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Data: ").Append(Data).Append("\n"); sb.Append(" Method: ").Append(Method).Append("\n"); sb.Append(" NativeRedirectData: ").Append(NativeRedirectData).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CheckoutNativeRedirectActionJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CheckoutNativeRedirectAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option type = default; - Option> data = default; - Option method = default; - Option nativeRedirectData = default; - Option paymentMethodType = default; - Option url = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(CheckoutNativeRedirectAction.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "data": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - data = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "method": - method = new Option(utf8JsonReader.GetString()); - break; - case "nativeRedirectData": - nativeRedirectData = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethodType": - paymentMethodType = new Option(utf8JsonReader.GetString()); - break; - case "url": - url = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class CheckoutNativeRedirectAction.", nameof(type)); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutNativeRedirectAction."); - - if (data.IsSet && data.Value == null) - throw new ArgumentNullException(nameof(data), "Property is not nullable for class CheckoutNativeRedirectAction."); - - if (method.IsSet && method.Value == null) - throw new ArgumentNullException(nameof(method), "Property is not nullable for class CheckoutNativeRedirectAction."); - - if (nativeRedirectData.IsSet && nativeRedirectData.Value == null) - throw new ArgumentNullException(nameof(nativeRedirectData), "Property is not nullable for class CheckoutNativeRedirectAction."); - - if (paymentMethodType.IsSet && paymentMethodType.Value == null) - throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutNativeRedirectAction."); - - if (url.IsSet && url.Value == null) - throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutNativeRedirectAction."); - - return new CheckoutNativeRedirectAction(type.Value.Value, data, method, nativeRedirectData, paymentMethodType, url); + return this.Equals(input as CheckoutNativeRedirectAction); } /// - /// Serializes a + /// Returns true if CheckoutNativeRedirectAction instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutNativeRedirectAction checkoutNativeRedirectAction, JsonSerializerOptions jsonSerializerOptions) + /// Instance of CheckoutNativeRedirectAction to be compared + /// Boolean + public bool Equals(CheckoutNativeRedirectAction input) { - writer.WriteStartObject(); - - WriteProperties(writer, checkoutNativeRedirectAction, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Data == input.Data || + this.Data != null && + input.Data != null && + this.Data.SequenceEqual(input.Data) + ) && + ( + this.Method == input.Method || + (this.Method != null && + this.Method.Equals(input.Method)) + ) && + ( + this.NativeRedirectData == input.NativeRedirectData || + (this.NativeRedirectData != null && + this.NativeRedirectData.Equals(input.NativeRedirectData)) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + (this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutNativeRedirectAction checkoutNativeRedirectAction, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (checkoutNativeRedirectAction.DataOption.IsSet && checkoutNativeRedirectAction.Data == null) - throw new ArgumentNullException(nameof(checkoutNativeRedirectAction.Data), "Property is required for class CheckoutNativeRedirectAction."); - - if (checkoutNativeRedirectAction.MethodOption.IsSet && checkoutNativeRedirectAction.Method == null) - throw new ArgumentNullException(nameof(checkoutNativeRedirectAction.Method), "Property is required for class CheckoutNativeRedirectAction."); - - if (checkoutNativeRedirectAction.NativeRedirectDataOption.IsSet && checkoutNativeRedirectAction.NativeRedirectData == null) - throw new ArgumentNullException(nameof(checkoutNativeRedirectAction.NativeRedirectData), "Property is required for class CheckoutNativeRedirectAction."); - - if (checkoutNativeRedirectAction.PaymentMethodTypeOption.IsSet && checkoutNativeRedirectAction.PaymentMethodType == null) - throw new ArgumentNullException(nameof(checkoutNativeRedirectAction.PaymentMethodType), "Property is required for class CheckoutNativeRedirectAction."); - - if (checkoutNativeRedirectAction.UrlOption.IsSet && checkoutNativeRedirectAction.Url == null) - throw new ArgumentNullException(nameof(checkoutNativeRedirectAction.Url), "Property is required for class CheckoutNativeRedirectAction."); - - var typeRawValue = CheckoutNativeRedirectAction.TypeEnumToJsonValue(checkoutNativeRedirectAction.Type); - writer.WriteString("type", typeRawValue); - if (checkoutNativeRedirectAction.DataOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("data"); - JsonSerializer.Serialize(writer, checkoutNativeRedirectAction.Data, jsonSerializerOptions); + int hashCode = 41; + if (this.Data != null) + { + hashCode = (hashCode * 59) + this.Data.GetHashCode(); + } + if (this.Method != null) + { + hashCode = (hashCode * 59) + this.Method.GetHashCode(); + } + if (this.NativeRedirectData != null) + { + hashCode = (hashCode * 59) + this.NativeRedirectData.GetHashCode(); + } + if (this.PaymentMethodType != null) + { + hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.Url != null) + { + hashCode = (hashCode * 59) + this.Url.GetHashCode(); + } + return hashCode; } - if (checkoutNativeRedirectAction.MethodOption.IsSet) - writer.WriteString("method", checkoutNativeRedirectAction.Method); - - if (checkoutNativeRedirectAction.NativeRedirectDataOption.IsSet) - writer.WriteString("nativeRedirectData", checkoutNativeRedirectAction.NativeRedirectData); - - if (checkoutNativeRedirectAction.PaymentMethodTypeOption.IsSet) - writer.WriteString("paymentMethodType", checkoutNativeRedirectAction.PaymentMethodType); - - if (checkoutNativeRedirectAction.UrlOption.IsSet) - writer.WriteString("url", checkoutNativeRedirectAction.Url); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/CheckoutOrderResponse.cs b/Adyen/Model/Checkout/CheckoutOrderResponse.cs index 3eb86bac3..c72484841 100644 --- a/Adyen/Model/Checkout/CheckoutOrderResponse.cs +++ b/Adyen/Model/Checkout/CheckoutOrderResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,117 +15,86 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CheckoutOrderResponse /// - public partial class CheckoutOrderResponse : IValidatableObject + [DataContract(Name = "CheckoutOrderResponse")] + public partial class CheckoutOrderResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The `pspReference` that belongs to the order. - /// amount - /// The expiry date for the order. - /// The encrypted order data. - /// The merchant reference for the order. - /// remainingAmount - [JsonConstructor] - public CheckoutOrderResponse(string pspReference, Option amount = default, Option expiresAt = default, Option orderData = default, Option reference = default, Option remainingAmount = default) - { - PspReference = pspReference; - AmountOption = amount; - ExpiresAtOption = expiresAt; - OrderDataOption = orderData; - ReferenceOption = reference; - RemainingAmountOption = remainingAmount; - OnCreated(); - } - - partial void OnCreated(); - - /// - /// The `pspReference` that belongs to the order. - /// - /// The `pspReference` that belongs to the order. - [JsonPropertyName("pspReference")] - public string PspReference { get; set; } - + [JsonConstructorAttribute] + protected CheckoutOrderResponse() { } /// - /// Used to track the state of Amount + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountOption { get; private set; } + /// amount. + /// The expiry date for the order.. + /// The encrypted order data.. + /// The `pspReference` that belongs to the order. (required). + /// The merchant reference for the order.. + /// remainingAmount. + public CheckoutOrderResponse(Amount amount = default(Amount), string expiresAt = default(string), string orderData = default(string), string pspReference = default(string), string reference = default(string), Amount remainingAmount = default(Amount)) + { + this.PspReference = pspReference; + this.Amount = amount; + this.ExpiresAt = expiresAt; + this.OrderData = orderData; + this.Reference = reference; + this.RemainingAmount = remainingAmount; + } /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] - public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } - - /// - /// Used to track the state of ExpiresAt - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiresAtOption { get; private set; } + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// The expiry date for the order. /// /// The expiry date for the order. - [JsonPropertyName("expiresAt")] - public string ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } - - /// - /// Used to track the state of OrderData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OrderDataOption { get; private set; } + [DataMember(Name = "expiresAt", EmitDefaultValue = false)] + public string ExpiresAt { get; set; } /// /// The encrypted order data. /// /// The encrypted order data. - [JsonPropertyName("orderData")] - public string OrderData { get { return this.OrderDataOption; } set { this.OrderDataOption = new Option(value); } } + [DataMember(Name = "orderData", EmitDefaultValue = false)] + public string OrderData { get; set; } /// - /// Used to track the state of Reference + /// The `pspReference` that belongs to the order. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + /// The `pspReference` that belongs to the order. + [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] + public string PspReference { get; set; } /// /// The merchant reference for the order. /// /// The merchant reference for the order. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } - - /// - /// Used to track the state of RemainingAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RemainingAmountOption { get; private set; } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Gets or Sets RemainingAmount /// - [JsonPropertyName("remainingAmount")] - public Amount RemainingAmount { get { return this.RemainingAmountOption; } set { this.RemainingAmountOption = new Option(value); } } + [DataMember(Name = "remainingAmount", EmitDefaultValue = false)] + public Amount RemainingAmount { get; set; } /// /// Returns the string presentation of the object @@ -134,10 +104,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutOrderResponse {\n"); - sb.Append(" PspReference: ").Append(PspReference).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append(" OrderData: ").Append(OrderData).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" RemainingAmount: ").Append(RemainingAmount).Append("\n"); sb.Append("}\n"); @@ -145,173 +115,113 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CheckoutOrderResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CheckoutOrderResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option pspReference = default; - Option amount = default; - Option expiresAt = default; - Option orderData = default; - Option reference = default; - Option remainingAmount = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "expiresAt": - expiresAt = new Option(utf8JsonReader.GetString()); - break; - case "orderData": - orderData = new Option(utf8JsonReader.GetString()); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "remainingAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - remainingAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (!pspReference.IsSet) - throw new ArgumentException("Property is required for class CheckoutOrderResponse.", nameof(pspReference)); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class CheckoutOrderResponse."); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class CheckoutOrderResponse."); - - if (expiresAt.IsSet && expiresAt.Value == null) - throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CheckoutOrderResponse."); - - if (orderData.IsSet && orderData.Value == null) - throw new ArgumentNullException(nameof(orderData), "Property is not nullable for class CheckoutOrderResponse."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CheckoutOrderResponse."); - - if (remainingAmount.IsSet && remainingAmount.Value == null) - throw new ArgumentNullException(nameof(remainingAmount), "Property is not nullable for class CheckoutOrderResponse."); - - return new CheckoutOrderResponse(pspReference.Value, amount, expiresAt, orderData, reference, remainingAmount); + return this.Equals(input as CheckoutOrderResponse); } /// - /// Serializes a + /// Returns true if CheckoutOrderResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutOrderResponse checkoutOrderResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of CheckoutOrderResponse to be compared + /// Boolean + public bool Equals(CheckoutOrderResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, checkoutOrderResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) + ) && + ( + this.OrderData == input.OrderData || + (this.OrderData != null && + this.OrderData.Equals(input.OrderData)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.RemainingAmount == input.RemainingAmount || + (this.RemainingAmount != null && + this.RemainingAmount.Equals(input.RemainingAmount)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutOrderResponse checkoutOrderResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (checkoutOrderResponse.PspReference == null) - throw new ArgumentNullException(nameof(checkoutOrderResponse.PspReference), "Property is required for class CheckoutOrderResponse."); - - if (checkoutOrderResponse.AmountOption.IsSet && checkoutOrderResponse.Amount == null) - throw new ArgumentNullException(nameof(checkoutOrderResponse.Amount), "Property is required for class CheckoutOrderResponse."); - - if (checkoutOrderResponse.ExpiresAtOption.IsSet && checkoutOrderResponse.ExpiresAt == null) - throw new ArgumentNullException(nameof(checkoutOrderResponse.ExpiresAt), "Property is required for class CheckoutOrderResponse."); - - if (checkoutOrderResponse.OrderDataOption.IsSet && checkoutOrderResponse.OrderData == null) - throw new ArgumentNullException(nameof(checkoutOrderResponse.OrderData), "Property is required for class CheckoutOrderResponse."); - - if (checkoutOrderResponse.ReferenceOption.IsSet && checkoutOrderResponse.Reference == null) - throw new ArgumentNullException(nameof(checkoutOrderResponse.Reference), "Property is required for class CheckoutOrderResponse."); - - if (checkoutOrderResponse.RemainingAmountOption.IsSet && checkoutOrderResponse.RemainingAmount == null) - throw new ArgumentNullException(nameof(checkoutOrderResponse.RemainingAmount), "Property is required for class CheckoutOrderResponse."); - - writer.WriteString("pspReference", checkoutOrderResponse.PspReference); - - if (checkoutOrderResponse.AmountOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, checkoutOrderResponse.Amount, jsonSerializerOptions); - } - if (checkoutOrderResponse.ExpiresAtOption.IsSet) - writer.WriteString("expiresAt", checkoutOrderResponse.ExpiresAt); - - if (checkoutOrderResponse.OrderDataOption.IsSet) - writer.WriteString("orderData", checkoutOrderResponse.OrderData); - - if (checkoutOrderResponse.ReferenceOption.IsSet) - writer.WriteString("reference", checkoutOrderResponse.Reference); - - if (checkoutOrderResponse.RemainingAmountOption.IsSet) - { - writer.WritePropertyName("remainingAmount"); - JsonSerializer.Serialize(writer, checkoutOrderResponse.RemainingAmount, jsonSerializerOptions); + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } + if (this.OrderData != null) + { + hashCode = (hashCode * 59) + this.OrderData.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.RemainingAmount != null) + { + hashCode = (hashCode * 59) + this.RemainingAmount.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/CheckoutPaymentMethod.cs b/Adyen/Model/Checkout/CheckoutPaymentMethod.cs index 5a142e324..36e4632ac 100644 --- a/Adyen/Model/Checkout/CheckoutPaymentMethod.cs +++ b/Adyen/Model/Checkout/CheckoutPaymentMethod.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,801 +15,1397 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using System.Reflection; namespace Adyen.Model.Checkout { /// /// The type and required details of a payment method to use. /// - public partial class CheckoutPaymentMethod : IValidatableObject + [JsonConverter(typeof(CheckoutPaymentMethodJsonConverter))] + [DataContract(Name = "CheckoutPaymentMethod")] + public partial class CheckoutPaymentMethod : AbstractOpenAPISchema, IEquatable, IValidatableObject { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(AchDetails achDetails) + /// An instance of AchDetails. + public CheckoutPaymentMethod(AchDetails actualInstance) { - AchDetails = achDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(AffirmDetails affirmDetails) + /// An instance of AffirmDetails. + public CheckoutPaymentMethod(AffirmDetails actualInstance) { - AffirmDetails = affirmDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(AfterpayDetails afterpayDetails) + /// An instance of AfterpayDetails. + public CheckoutPaymentMethod(AfterpayDetails actualInstance) { - AfterpayDetails = afterpayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(AmazonPayDetails amazonPayDetails) + /// An instance of AmazonPayDetails. + public CheckoutPaymentMethod(AmazonPayDetails actualInstance) { - AmazonPayDetails = amazonPayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(AncvDetails ancvDetails) + /// An instance of AncvDetails. + public CheckoutPaymentMethod(AncvDetails actualInstance) { - AncvDetails = ancvDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(AndroidPayDetails androidPayDetails) + /// An instance of AndroidPayDetails. + public CheckoutPaymentMethod(AndroidPayDetails actualInstance) { - AndroidPayDetails = androidPayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(ApplePayDetails applePayDetails) + /// An instance of ApplePayDetails. + public CheckoutPaymentMethod(ApplePayDetails actualInstance) { - ApplePayDetails = applePayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(BacsDirectDebitDetails bacsDirectDebitDetails) + /// An instance of BacsDirectDebitDetails. + public CheckoutPaymentMethod(BacsDirectDebitDetails actualInstance) { - BacsDirectDebitDetails = bacsDirectDebitDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(BillDeskDetails billDeskDetails) + /// An instance of BillDeskDetails. + public CheckoutPaymentMethod(BillDeskDetails actualInstance) { - BillDeskDetails = billDeskDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(BlikDetails blikDetails) + /// An instance of BlikDetails. + public CheckoutPaymentMethod(BlikDetails actualInstance) { - BlikDetails = blikDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(CardDetails cardDetails) + /// An instance of CardDetails. + public CheckoutPaymentMethod(CardDetails actualInstance) { - CardDetails = cardDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(CashAppDetails cashAppDetails) + /// An instance of CashAppDetails. + public CheckoutPaymentMethod(CashAppDetails actualInstance) { - CashAppDetails = cashAppDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(CellulantDetails cellulantDetails) + /// An instance of CellulantDetails. + public CheckoutPaymentMethod(CellulantDetails actualInstance) { - CellulantDetails = cellulantDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(DokuDetails dokuDetails) + /// An instance of DokuDetails. + public CheckoutPaymentMethod(DokuDetails actualInstance) { - DokuDetails = dokuDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(DragonpayDetails dragonpayDetails) + /// An instance of DragonpayDetails. + public CheckoutPaymentMethod(DragonpayDetails actualInstance) { - DragonpayDetails = dragonpayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(EBankingFinlandDetails eBankingFinlandDetails) + /// An instance of EBankingFinlandDetails. + public CheckoutPaymentMethod(EBankingFinlandDetails actualInstance) { - EBankingFinlandDetails = eBankingFinlandDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(EcontextVoucherDetails econtextVoucherDetails) + /// An instance of EcontextVoucherDetails. + public CheckoutPaymentMethod(EcontextVoucherDetails actualInstance) { - EcontextVoucherDetails = econtextVoucherDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(EftDetails eftDetails) + /// An instance of EftDetails. + public CheckoutPaymentMethod(EftDetails actualInstance) { - EftDetails = eftDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(FastlaneDetails fastlaneDetails) + /// An instance of FastlaneDetails. + public CheckoutPaymentMethod(FastlaneDetails actualInstance) { - FastlaneDetails = fastlaneDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(GenericIssuerPaymentMethodDetails genericIssuerPaymentMethodDetails) + /// An instance of GenericIssuerPaymentMethodDetails. + public CheckoutPaymentMethod(GenericIssuerPaymentMethodDetails actualInstance) { - GenericIssuerPaymentMethodDetails = genericIssuerPaymentMethodDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(GooglePayDetails googlePayDetails) + /// An instance of GooglePayDetails. + public CheckoutPaymentMethod(GooglePayDetails actualInstance) { - GooglePayDetails = googlePayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(IdealDetails idealDetails) + /// An instance of IdealDetails. + public CheckoutPaymentMethod(IdealDetails actualInstance) { - IdealDetails = idealDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(KlarnaDetails klarnaDetails) + /// An instance of KlarnaDetails. + public CheckoutPaymentMethod(KlarnaDetails actualInstance) { - KlarnaDetails = klarnaDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(MasterpassDetails masterpassDetails) + /// An instance of MasterpassDetails. + public CheckoutPaymentMethod(MasterpassDetails actualInstance) { - MasterpassDetails = masterpassDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(MbwayDetails mbwayDetails) + /// An instance of MbwayDetails. + public CheckoutPaymentMethod(MbwayDetails actualInstance) { - MbwayDetails = mbwayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(MobilePayDetails mobilePayDetails) + /// An instance of MobilePayDetails. + public CheckoutPaymentMethod(MobilePayDetails actualInstance) { - MobilePayDetails = mobilePayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(MolPayDetails molPayDetails) + /// An instance of MolPayDetails. + public CheckoutPaymentMethod(MolPayDetails actualInstance) { - MolPayDetails = molPayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(OpenInvoiceDetails openInvoiceDetails) + /// An instance of OpenInvoiceDetails. + public CheckoutPaymentMethod(OpenInvoiceDetails actualInstance) { - OpenInvoiceDetails = openInvoiceDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(PayByBankAISDirectDebitDetails payByBankAISDirectDebitDetails) + /// An instance of PayByBankAISDirectDebitDetails. + public CheckoutPaymentMethod(PayByBankAISDirectDebitDetails actualInstance) { - PayByBankAISDirectDebitDetails = payByBankAISDirectDebitDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(PayByBankDetails payByBankDetails) + /// An instance of PayByBankDetails. + public CheckoutPaymentMethod(PayByBankDetails actualInstance) { - PayByBankDetails = payByBankDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(PayPalDetails payPalDetails) + /// An instance of PayPalDetails. + public CheckoutPaymentMethod(PayPalDetails actualInstance) { - PayPalDetails = payPalDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(PayPayDetails payPayDetails) + /// An instance of PayPayDetails. + public CheckoutPaymentMethod(PayPayDetails actualInstance) { - PayPayDetails = payPayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(PayToDetails payToDetails) + /// An instance of PayToDetails. + public CheckoutPaymentMethod(PayToDetails actualInstance) { - PayToDetails = payToDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(PayUUpiDetails payUUpiDetails) + /// An instance of PayUUpiDetails. + public CheckoutPaymentMethod(PayUUpiDetails actualInstance) { - PayUUpiDetails = payUUpiDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(PayWithGoogleDetails payWithGoogleDetails) + /// An instance of PayWithGoogleDetails. + public CheckoutPaymentMethod(PayWithGoogleDetails actualInstance) { - PayWithGoogleDetails = payWithGoogleDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(PaymentDetails paymentDetails) + /// An instance of PaymentDetails. + public CheckoutPaymentMethod(PaymentDetails actualInstance) { - PaymentDetails = paymentDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(PixDetails pixDetails) + /// An instance of PixDetails. + public CheckoutPaymentMethod(PixDetails actualInstance) { - PixDetails = pixDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(PseDetails pseDetails) + /// An instance of PseDetails. + public CheckoutPaymentMethod(PseDetails actualInstance) { - PseDetails = pseDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(RakutenPayDetails rakutenPayDetails) + /// An instance of RakutenPayDetails. + public CheckoutPaymentMethod(RakutenPayDetails actualInstance) { - RakutenPayDetails = rakutenPayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(RatepayDetails ratepayDetails) + /// An instance of RatepayDetails. + public CheckoutPaymentMethod(RatepayDetails actualInstance) { - RatepayDetails = ratepayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(RivertyDetails rivertyDetails) + /// An instance of RivertyDetails. + public CheckoutPaymentMethod(RivertyDetails actualInstance) { - RivertyDetails = rivertyDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(SamsungPayDetails samsungPayDetails) + /// An instance of SamsungPayDetails. + public CheckoutPaymentMethod(SamsungPayDetails actualInstance) { - SamsungPayDetails = samsungPayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(SepaDirectDebitDetails sepaDirectDebitDetails) + /// An instance of SepaDirectDebitDetails. + public CheckoutPaymentMethod(SepaDirectDebitDetails actualInstance) { - SepaDirectDebitDetails = sepaDirectDebitDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(StoredPaymentMethodDetails storedPaymentMethodDetails) + /// An instance of StoredPaymentMethodDetails. + public CheckoutPaymentMethod(StoredPaymentMethodDetails actualInstance) { - StoredPaymentMethodDetails = storedPaymentMethodDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(TwintDetails twintDetails) + /// An instance of TwintDetails. + public CheckoutPaymentMethod(TwintDetails actualInstance) { - TwintDetails = twintDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(UpiCollectDetails upiCollectDetails) + /// An instance of UpiCollectDetails. + public CheckoutPaymentMethod(UpiCollectDetails actualInstance) { - UpiCollectDetails = upiCollectDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(UpiIntentDetails upiIntentDetails) + /// An instance of UpiIntentDetails. + public CheckoutPaymentMethod(UpiIntentDetails actualInstance) { - UpiIntentDetails = upiIntentDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(VippsDetails vippsDetails) + /// An instance of VippsDetails. + public CheckoutPaymentMethod(VippsDetails actualInstance) { - VippsDetails = vippsDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(VisaCheckoutDetails visaCheckoutDetails) + /// An instance of VisaCheckoutDetails. + public CheckoutPaymentMethod(VisaCheckoutDetails actualInstance) { - VisaCheckoutDetails = visaCheckoutDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(WeChatPayDetails weChatPayDetails) + /// An instance of WeChatPayDetails. + public CheckoutPaymentMethod(WeChatPayDetails actualInstance) { - WeChatPayDetails = weChatPayDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(WeChatPayMiniProgramDetails weChatPayMiniProgramDetails) + /// An instance of WeChatPayMiniProgramDetails. + public CheckoutPaymentMethod(WeChatPayMiniProgramDetails actualInstance) { - WeChatPayMiniProgramDetails = weChatPayMiniProgramDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public CheckoutPaymentMethod(ZipDetails zipDetails) + /// An instance of ZipDetails. + public CheckoutPaymentMethod(ZipDetails actualInstance) { - ZipDetails = zipDetails; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } - partial void OnCreated(); + + private Object _actualInstance; /// - /// Gets or Sets AchDetails + /// Gets or Sets ActualInstance /// - public AchDetails AchDetails { get; set; } + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(AchDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(AffirmDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(AfterpayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(AmazonPayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(AncvDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(AndroidPayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(ApplePayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(BacsDirectDebitDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(BillDeskDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(BlikDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(CardDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(CashAppDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(CellulantDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(DokuDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(DragonpayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(EBankingFinlandDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(EcontextVoucherDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(EftDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(FastlaneDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(GenericIssuerPaymentMethodDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(GooglePayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(IdealDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(KlarnaDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(MasterpassDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(MbwayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(MobilePayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(MolPayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(OpenInvoiceDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(PayByBankAISDirectDebitDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(PayByBankDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(PayPalDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(PayPayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(PayToDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(PayUUpiDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(PayWithGoogleDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(PaymentDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(PixDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(PseDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(RakutenPayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(RatepayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(RivertyDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(SamsungPayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(SepaDirectDebitDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(StoredPaymentMethodDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(TwintDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(UpiCollectDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(UpiIntentDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(VippsDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(VisaCheckoutDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(WeChatPayDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(WeChatPayMiniProgramDetails)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(ZipDetails)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: AchDetails, AffirmDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, FastlaneDetails, GenericIssuerPaymentMethodDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayPayDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PixDetails, PseDetails, RakutenPayDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails"); + } + } + } /// - /// Gets or Sets AffirmDetails + /// Get the actual instance of `AchDetails`. If the actual instance is not `AchDetails`, + /// the InvalidClassException will be thrown /// - public AffirmDetails AffirmDetails { get; set; } + /// An instance of AchDetails + public AchDetails GetAchDetails() + { + return (AchDetails)this.ActualInstance; + } /// - /// Gets or Sets AfterpayDetails + /// Get the actual instance of `AffirmDetails`. If the actual instance is not `AffirmDetails`, + /// the InvalidClassException will be thrown /// - public AfterpayDetails AfterpayDetails { get; set; } + /// An instance of AffirmDetails + public AffirmDetails GetAffirmDetails() + { + return (AffirmDetails)this.ActualInstance; + } /// - /// Gets or Sets AmazonPayDetails + /// Get the actual instance of `AfterpayDetails`. If the actual instance is not `AfterpayDetails`, + /// the InvalidClassException will be thrown /// - public AmazonPayDetails AmazonPayDetails { get; set; } + /// An instance of AfterpayDetails + public AfterpayDetails GetAfterpayDetails() + { + return (AfterpayDetails)this.ActualInstance; + } /// - /// Gets or Sets AncvDetails + /// Get the actual instance of `AmazonPayDetails`. If the actual instance is not `AmazonPayDetails`, + /// the InvalidClassException will be thrown /// - public AncvDetails AncvDetails { get; set; } + /// An instance of AmazonPayDetails + public AmazonPayDetails GetAmazonPayDetails() + { + return (AmazonPayDetails)this.ActualInstance; + } /// - /// Gets or Sets AndroidPayDetails + /// Get the actual instance of `AncvDetails`. If the actual instance is not `AncvDetails`, + /// the InvalidClassException will be thrown /// - public AndroidPayDetails AndroidPayDetails { get; set; } + /// An instance of AncvDetails + public AncvDetails GetAncvDetails() + { + return (AncvDetails)this.ActualInstance; + } /// - /// Gets or Sets ApplePayDetails + /// Get the actual instance of `AndroidPayDetails`. If the actual instance is not `AndroidPayDetails`, + /// the InvalidClassException will be thrown /// - public ApplePayDetails ApplePayDetails { get; set; } + /// An instance of AndroidPayDetails + public AndroidPayDetails GetAndroidPayDetails() + { + return (AndroidPayDetails)this.ActualInstance; + } /// - /// Gets or Sets BacsDirectDebitDetails + /// Get the actual instance of `ApplePayDetails`. If the actual instance is not `ApplePayDetails`, + /// the InvalidClassException will be thrown /// - public BacsDirectDebitDetails BacsDirectDebitDetails { get; set; } + /// An instance of ApplePayDetails + public ApplePayDetails GetApplePayDetails() + { + return (ApplePayDetails)this.ActualInstance; + } /// - /// Gets or Sets BillDeskDetails + /// Get the actual instance of `BacsDirectDebitDetails`. If the actual instance is not `BacsDirectDebitDetails`, + /// the InvalidClassException will be thrown /// - public BillDeskDetails BillDeskDetails { get; set; } + /// An instance of BacsDirectDebitDetails + public BacsDirectDebitDetails GetBacsDirectDebitDetails() + { + return (BacsDirectDebitDetails)this.ActualInstance; + } /// - /// Gets or Sets BlikDetails + /// Get the actual instance of `BillDeskDetails`. If the actual instance is not `BillDeskDetails`, + /// the InvalidClassException will be thrown /// - public BlikDetails BlikDetails { get; set; } + /// An instance of BillDeskDetails + public BillDeskDetails GetBillDeskDetails() + { + return (BillDeskDetails)this.ActualInstance; + } /// - /// Gets or Sets CardDetails + /// Get the actual instance of `BlikDetails`. If the actual instance is not `BlikDetails`, + /// the InvalidClassException will be thrown /// - public CardDetails CardDetails { get; set; } + /// An instance of BlikDetails + public BlikDetails GetBlikDetails() + { + return (BlikDetails)this.ActualInstance; + } /// - /// Gets or Sets CashAppDetails + /// Get the actual instance of `CardDetails`. If the actual instance is not `CardDetails`, + /// the InvalidClassException will be thrown /// - public CashAppDetails CashAppDetails { get; set; } + /// An instance of CardDetails + public CardDetails GetCardDetails() + { + return (CardDetails)this.ActualInstance; + } /// - /// Gets or Sets CellulantDetails + /// Get the actual instance of `CashAppDetails`. If the actual instance is not `CashAppDetails`, + /// the InvalidClassException will be thrown /// - public CellulantDetails CellulantDetails { get; set; } + /// An instance of CashAppDetails + public CashAppDetails GetCashAppDetails() + { + return (CashAppDetails)this.ActualInstance; + } /// - /// Gets or Sets DokuDetails + /// Get the actual instance of `CellulantDetails`. If the actual instance is not `CellulantDetails`, + /// the InvalidClassException will be thrown /// - public DokuDetails DokuDetails { get; set; } + /// An instance of CellulantDetails + public CellulantDetails GetCellulantDetails() + { + return (CellulantDetails)this.ActualInstance; + } /// - /// Gets or Sets DragonpayDetails + /// Get the actual instance of `DokuDetails`. If the actual instance is not `DokuDetails`, + /// the InvalidClassException will be thrown /// - public DragonpayDetails DragonpayDetails { get; set; } + /// An instance of DokuDetails + public DokuDetails GetDokuDetails() + { + return (DokuDetails)this.ActualInstance; + } /// - /// Gets or Sets EBankingFinlandDetails + /// Get the actual instance of `DragonpayDetails`. If the actual instance is not `DragonpayDetails`, + /// the InvalidClassException will be thrown /// - public EBankingFinlandDetails EBankingFinlandDetails { get; set; } + /// An instance of DragonpayDetails + public DragonpayDetails GetDragonpayDetails() + { + return (DragonpayDetails)this.ActualInstance; + } /// - /// Gets or Sets EcontextVoucherDetails + /// Get the actual instance of `EBankingFinlandDetails`. If the actual instance is not `EBankingFinlandDetails`, + /// the InvalidClassException will be thrown /// - public EcontextVoucherDetails EcontextVoucherDetails { get; set; } + /// An instance of EBankingFinlandDetails + public EBankingFinlandDetails GetEBankingFinlandDetails() + { + return (EBankingFinlandDetails)this.ActualInstance; + } /// - /// Gets or Sets EftDetails + /// Get the actual instance of `EcontextVoucherDetails`. If the actual instance is not `EcontextVoucherDetails`, + /// the InvalidClassException will be thrown /// - public EftDetails EftDetails { get; set; } + /// An instance of EcontextVoucherDetails + public EcontextVoucherDetails GetEcontextVoucherDetails() + { + return (EcontextVoucherDetails)this.ActualInstance; + } /// - /// Gets or Sets FastlaneDetails + /// Get the actual instance of `EftDetails`. If the actual instance is not `EftDetails`, + /// the InvalidClassException will be thrown /// - public FastlaneDetails FastlaneDetails { get; set; } + /// An instance of EftDetails + public EftDetails GetEftDetails() + { + return (EftDetails)this.ActualInstance; + } /// - /// Gets or Sets GenericIssuerPaymentMethodDetails + /// Get the actual instance of `FastlaneDetails`. If the actual instance is not `FastlaneDetails`, + /// the InvalidClassException will be thrown /// - public GenericIssuerPaymentMethodDetails GenericIssuerPaymentMethodDetails { get; set; } + /// An instance of FastlaneDetails + public FastlaneDetails GetFastlaneDetails() + { + return (FastlaneDetails)this.ActualInstance; + } /// - /// Gets or Sets GooglePayDetails + /// Get the actual instance of `GenericIssuerPaymentMethodDetails`. If the actual instance is not `GenericIssuerPaymentMethodDetails`, + /// the InvalidClassException will be thrown /// - public GooglePayDetails GooglePayDetails { get; set; } + /// An instance of GenericIssuerPaymentMethodDetails + public GenericIssuerPaymentMethodDetails GetGenericIssuerPaymentMethodDetails() + { + return (GenericIssuerPaymentMethodDetails)this.ActualInstance; + } /// - /// Gets or Sets IdealDetails + /// Get the actual instance of `GooglePayDetails`. If the actual instance is not `GooglePayDetails`, + /// the InvalidClassException will be thrown /// - public IdealDetails IdealDetails { get; set; } + /// An instance of GooglePayDetails + public GooglePayDetails GetGooglePayDetails() + { + return (GooglePayDetails)this.ActualInstance; + } /// - /// Gets or Sets KlarnaDetails + /// Get the actual instance of `IdealDetails`. If the actual instance is not `IdealDetails`, + /// the InvalidClassException will be thrown /// - public KlarnaDetails KlarnaDetails { get; set; } + /// An instance of IdealDetails + public IdealDetails GetIdealDetails() + { + return (IdealDetails)this.ActualInstance; + } /// - /// Gets or Sets MasterpassDetails + /// Get the actual instance of `KlarnaDetails`. If the actual instance is not `KlarnaDetails`, + /// the InvalidClassException will be thrown /// - public MasterpassDetails MasterpassDetails { get; set; } + /// An instance of KlarnaDetails + public KlarnaDetails GetKlarnaDetails() + { + return (KlarnaDetails)this.ActualInstance; + } /// - /// Gets or Sets MbwayDetails + /// Get the actual instance of `MasterpassDetails`. If the actual instance is not `MasterpassDetails`, + /// the InvalidClassException will be thrown /// - public MbwayDetails MbwayDetails { get; set; } + /// An instance of MasterpassDetails + public MasterpassDetails GetMasterpassDetails() + { + return (MasterpassDetails)this.ActualInstance; + } /// - /// Gets or Sets MobilePayDetails + /// Get the actual instance of `MbwayDetails`. If the actual instance is not `MbwayDetails`, + /// the InvalidClassException will be thrown /// - public MobilePayDetails MobilePayDetails { get; set; } + /// An instance of MbwayDetails + public MbwayDetails GetMbwayDetails() + { + return (MbwayDetails)this.ActualInstance; + } /// - /// Gets or Sets MolPayDetails + /// Get the actual instance of `MobilePayDetails`. If the actual instance is not `MobilePayDetails`, + /// the InvalidClassException will be thrown /// - public MolPayDetails MolPayDetails { get; set; } + /// An instance of MobilePayDetails + public MobilePayDetails GetMobilePayDetails() + { + return (MobilePayDetails)this.ActualInstance; + } /// - /// Gets or Sets OpenInvoiceDetails + /// Get the actual instance of `MolPayDetails`. If the actual instance is not `MolPayDetails`, + /// the InvalidClassException will be thrown /// - public OpenInvoiceDetails OpenInvoiceDetails { get; set; } + /// An instance of MolPayDetails + public MolPayDetails GetMolPayDetails() + { + return (MolPayDetails)this.ActualInstance; + } /// - /// Gets or Sets PayByBankAISDirectDebitDetails + /// Get the actual instance of `OpenInvoiceDetails`. If the actual instance is not `OpenInvoiceDetails`, + /// the InvalidClassException will be thrown /// - public PayByBankAISDirectDebitDetails PayByBankAISDirectDebitDetails { get; set; } + /// An instance of OpenInvoiceDetails + public OpenInvoiceDetails GetOpenInvoiceDetails() + { + return (OpenInvoiceDetails)this.ActualInstance; + } /// - /// Gets or Sets PayByBankDetails + /// Get the actual instance of `PayByBankAISDirectDebitDetails`. If the actual instance is not `PayByBankAISDirectDebitDetails`, + /// the InvalidClassException will be thrown /// - public PayByBankDetails PayByBankDetails { get; set; } + /// An instance of PayByBankAISDirectDebitDetails + public PayByBankAISDirectDebitDetails GetPayByBankAISDirectDebitDetails() + { + return (PayByBankAISDirectDebitDetails)this.ActualInstance; + } /// - /// Gets or Sets PayPalDetails + /// Get the actual instance of `PayByBankDetails`. If the actual instance is not `PayByBankDetails`, + /// the InvalidClassException will be thrown /// - public PayPalDetails PayPalDetails { get; set; } + /// An instance of PayByBankDetails + public PayByBankDetails GetPayByBankDetails() + { + return (PayByBankDetails)this.ActualInstance; + } /// - /// Gets or Sets PayPayDetails + /// Get the actual instance of `PayPalDetails`. If the actual instance is not `PayPalDetails`, + /// the InvalidClassException will be thrown /// - public PayPayDetails PayPayDetails { get; set; } + /// An instance of PayPalDetails + public PayPalDetails GetPayPalDetails() + { + return (PayPalDetails)this.ActualInstance; + } /// - /// Gets or Sets PayToDetails + /// Get the actual instance of `PayPayDetails`. If the actual instance is not `PayPayDetails`, + /// the InvalidClassException will be thrown /// - public PayToDetails PayToDetails { get; set; } + /// An instance of PayPayDetails + public PayPayDetails GetPayPayDetails() + { + return (PayPayDetails)this.ActualInstance; + } /// - /// Gets or Sets PayUUpiDetails + /// Get the actual instance of `PayToDetails`. If the actual instance is not `PayToDetails`, + /// the InvalidClassException will be thrown /// - public PayUUpiDetails PayUUpiDetails { get; set; } + /// An instance of PayToDetails + public PayToDetails GetPayToDetails() + { + return (PayToDetails)this.ActualInstance; + } /// - /// Gets or Sets PayWithGoogleDetails + /// Get the actual instance of `PayUUpiDetails`. If the actual instance is not `PayUUpiDetails`, + /// the InvalidClassException will be thrown /// - public PayWithGoogleDetails PayWithGoogleDetails { get; set; } + /// An instance of PayUUpiDetails + public PayUUpiDetails GetPayUUpiDetails() + { + return (PayUUpiDetails)this.ActualInstance; + } /// - /// Gets or Sets PaymentDetails + /// Get the actual instance of `PayWithGoogleDetails`. If the actual instance is not `PayWithGoogleDetails`, + /// the InvalidClassException will be thrown /// - public PaymentDetails PaymentDetails { get; set; } + /// An instance of PayWithGoogleDetails + public PayWithGoogleDetails GetPayWithGoogleDetails() + { + return (PayWithGoogleDetails)this.ActualInstance; + } /// - /// Gets or Sets PixDetails + /// Get the actual instance of `PaymentDetails`. If the actual instance is not `PaymentDetails`, + /// the InvalidClassException will be thrown /// - public PixDetails PixDetails { get; set; } + /// An instance of PaymentDetails + public PaymentDetails GetPaymentDetails() + { + return (PaymentDetails)this.ActualInstance; + } /// - /// Gets or Sets PseDetails + /// Get the actual instance of `PixDetails`. If the actual instance is not `PixDetails`, + /// the InvalidClassException will be thrown /// - public PseDetails PseDetails { get; set; } + /// An instance of PixDetails + public PixDetails GetPixDetails() + { + return (PixDetails)this.ActualInstance; + } /// - /// Gets or Sets RakutenPayDetails + /// Get the actual instance of `PseDetails`. If the actual instance is not `PseDetails`, + /// the InvalidClassException will be thrown /// - public RakutenPayDetails RakutenPayDetails { get; set; } + /// An instance of PseDetails + public PseDetails GetPseDetails() + { + return (PseDetails)this.ActualInstance; + } /// - /// Gets or Sets RatepayDetails + /// Get the actual instance of `RakutenPayDetails`. If the actual instance is not `RakutenPayDetails`, + /// the InvalidClassException will be thrown /// - public RatepayDetails RatepayDetails { get; set; } + /// An instance of RakutenPayDetails + public RakutenPayDetails GetRakutenPayDetails() + { + return (RakutenPayDetails)this.ActualInstance; + } /// - /// Gets or Sets RivertyDetails + /// Get the actual instance of `RatepayDetails`. If the actual instance is not `RatepayDetails`, + /// the InvalidClassException will be thrown /// - public RivertyDetails RivertyDetails { get; set; } + /// An instance of RatepayDetails + public RatepayDetails GetRatepayDetails() + { + return (RatepayDetails)this.ActualInstance; + } /// - /// Gets or Sets SamsungPayDetails + /// Get the actual instance of `RivertyDetails`. If the actual instance is not `RivertyDetails`, + /// the InvalidClassException will be thrown /// - public SamsungPayDetails SamsungPayDetails { get; set; } + /// An instance of RivertyDetails + public RivertyDetails GetRivertyDetails() + { + return (RivertyDetails)this.ActualInstance; + } /// - /// Gets or Sets SepaDirectDebitDetails + /// Get the actual instance of `SamsungPayDetails`. If the actual instance is not `SamsungPayDetails`, + /// the InvalidClassException will be thrown /// - public SepaDirectDebitDetails SepaDirectDebitDetails { get; set; } + /// An instance of SamsungPayDetails + public SamsungPayDetails GetSamsungPayDetails() + { + return (SamsungPayDetails)this.ActualInstance; + } /// - /// Gets or Sets StoredPaymentMethodDetails + /// Get the actual instance of `SepaDirectDebitDetails`. If the actual instance is not `SepaDirectDebitDetails`, + /// the InvalidClassException will be thrown /// - public StoredPaymentMethodDetails StoredPaymentMethodDetails { get; set; } + /// An instance of SepaDirectDebitDetails + public SepaDirectDebitDetails GetSepaDirectDebitDetails() + { + return (SepaDirectDebitDetails)this.ActualInstance; + } /// - /// Gets or Sets TwintDetails + /// Get the actual instance of `StoredPaymentMethodDetails`. If the actual instance is not `StoredPaymentMethodDetails`, + /// the InvalidClassException will be thrown /// - public TwintDetails TwintDetails { get; set; } + /// An instance of StoredPaymentMethodDetails + public StoredPaymentMethodDetails GetStoredPaymentMethodDetails() + { + return (StoredPaymentMethodDetails)this.ActualInstance; + } /// - /// Gets or Sets UpiCollectDetails + /// Get the actual instance of `TwintDetails`. If the actual instance is not `TwintDetails`, + /// the InvalidClassException will be thrown /// - public UpiCollectDetails UpiCollectDetails { get; set; } + /// An instance of TwintDetails + public TwintDetails GetTwintDetails() + { + return (TwintDetails)this.ActualInstance; + } /// - /// Gets or Sets UpiIntentDetails + /// Get the actual instance of `UpiCollectDetails`. If the actual instance is not `UpiCollectDetails`, + /// the InvalidClassException will be thrown /// - public UpiIntentDetails UpiIntentDetails { get; set; } + /// An instance of UpiCollectDetails + public UpiCollectDetails GetUpiCollectDetails() + { + return (UpiCollectDetails)this.ActualInstance; + } /// - /// Gets or Sets VippsDetails + /// Get the actual instance of `UpiIntentDetails`. If the actual instance is not `UpiIntentDetails`, + /// the InvalidClassException will be thrown /// - public VippsDetails VippsDetails { get; set; } + /// An instance of UpiIntentDetails + public UpiIntentDetails GetUpiIntentDetails() + { + return (UpiIntentDetails)this.ActualInstance; + } /// - /// Gets or Sets VisaCheckoutDetails + /// Get the actual instance of `VippsDetails`. If the actual instance is not `VippsDetails`, + /// the InvalidClassException will be thrown /// - public VisaCheckoutDetails VisaCheckoutDetails { get; set; } + /// An instance of VippsDetails + public VippsDetails GetVippsDetails() + { + return (VippsDetails)this.ActualInstance; + } /// - /// Gets or Sets WeChatPayDetails + /// Get the actual instance of `VisaCheckoutDetails`. If the actual instance is not `VisaCheckoutDetails`, + /// the InvalidClassException will be thrown /// - public WeChatPayDetails WeChatPayDetails { get; set; } + /// An instance of VisaCheckoutDetails + public VisaCheckoutDetails GetVisaCheckoutDetails() + { + return (VisaCheckoutDetails)this.ActualInstance; + } /// - /// Gets or Sets WeChatPayMiniProgramDetails + /// Get the actual instance of `WeChatPayDetails`. If the actual instance is not `WeChatPayDetails`, + /// the InvalidClassException will be thrown /// - public WeChatPayMiniProgramDetails WeChatPayMiniProgramDetails { get; set; } + /// An instance of WeChatPayDetails + public WeChatPayDetails GetWeChatPayDetails() + { + return (WeChatPayDetails)this.ActualInstance; + } /// - /// Gets or Sets ZipDetails + /// Get the actual instance of `WeChatPayMiniProgramDetails`. If the actual instance is not `WeChatPayMiniProgramDetails`, + /// the InvalidClassException will be thrown /// - public ZipDetails ZipDetails { get; set; } + /// An instance of WeChatPayMiniProgramDetails + public WeChatPayMiniProgramDetails GetWeChatPayMiniProgramDetails() + { + return (WeChatPayMiniProgramDetails)this.ActualInstance; + } + + /// + /// Get the actual instance of `ZipDetails`. If the actual instance is not `ZipDetails`, + /// the InvalidClassException will be thrown + /// + /// An instance of ZipDetails + public ZipDetails GetZipDetails() + { + return (ZipDetails)this.ActualInstance; + } /// /// Returns the string presentation of the object @@ -816,472 +1413,519 @@ public CheckoutPaymentMethod(ZipDetails zipDetails) /// String presentation of the object public override string ToString() { - StringBuilder sb = new StringBuilder(); + var sb = new StringBuilder(); sb.Append("class CheckoutPaymentMethod {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public override string ToJson() { - yield break; + return JsonConvert.SerializeObject(this.ActualInstance, CheckoutPaymentMethod.SerializerSettings); } - } - /// - /// A Json converter for type - /// - public class CheckoutPaymentMethodJsonConverter : JsonConverter - { /// - /// Deserializes json to - /// - /// - /// - /// - /// - /// - public override CheckoutPaymentMethod Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) - { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - AchDetails achDetails = default; - AffirmDetails affirmDetails = default; - AfterpayDetails afterpayDetails = default; - AmazonPayDetails amazonPayDetails = default; - AncvDetails ancvDetails = default; - AndroidPayDetails androidPayDetails = default; - ApplePayDetails applePayDetails = default; - BacsDirectDebitDetails bacsDirectDebitDetails = default; - BillDeskDetails billDeskDetails = default; - BlikDetails blikDetails = default; - CardDetails cardDetails = default; - CashAppDetails cashAppDetails = default; - CellulantDetails cellulantDetails = default; - DokuDetails dokuDetails = default; - DragonpayDetails dragonpayDetails = default; - EBankingFinlandDetails eBankingFinlandDetails = default; - EcontextVoucherDetails econtextVoucherDetails = default; - EftDetails eftDetails = default; - FastlaneDetails fastlaneDetails = default; - GenericIssuerPaymentMethodDetails genericIssuerPaymentMethodDetails = default; - GooglePayDetails googlePayDetails = default; - IdealDetails idealDetails = default; - KlarnaDetails klarnaDetails = default; - MasterpassDetails masterpassDetails = default; - MbwayDetails mbwayDetails = default; - MobilePayDetails mobilePayDetails = default; - MolPayDetails molPayDetails = default; - OpenInvoiceDetails openInvoiceDetails = default; - PayByBankAISDirectDebitDetails payByBankAISDirectDebitDetails = default; - PayByBankDetails payByBankDetails = default; - PayPalDetails payPalDetails = default; - PayPayDetails payPayDetails = default; - PayToDetails payToDetails = default; - PayUUpiDetails payUUpiDetails = default; - PayWithGoogleDetails payWithGoogleDetails = default; - PaymentDetails paymentDetails = default; - PixDetails pixDetails = default; - PseDetails pseDetails = default; - RakutenPayDetails rakutenPayDetails = default; - RatepayDetails ratepayDetails = default; - RivertyDetails rivertyDetails = default; - SamsungPayDetails samsungPayDetails = default; - SepaDirectDebitDetails sepaDirectDebitDetails = default; - StoredPaymentMethodDetails storedPaymentMethodDetails = default; - TwintDetails twintDetails = default; - UpiCollectDetails upiCollectDetails = default; - UpiIntentDetails upiIntentDetails = default; - VippsDetails vippsDetails = default; - VisaCheckoutDetails visaCheckoutDetails = default; - WeChatPayDetails weChatPayDetails = default; - WeChatPayMiniProgramDetails weChatPayMiniProgramDetails = default; - ZipDetails zipDetails = default; - - Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; - while (utf8JsonReaderOneOf.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) - break; + /// Converts the JSON string into an instance of CheckoutPaymentMethod + /// + /// JSON string + /// An instance of CheckoutPaymentMethod + public static CheckoutPaymentMethod FromJson(string jsonString) + { + CheckoutPaymentMethod newCheckoutPaymentMethod = null; - if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + if (string.IsNullOrEmpty(jsonString)) + { + return newCheckoutPaymentMethod; + } + int match = 0; + List matchedTypes = new List(); + JToken typeToken = JObject.Parse(jsonString).GetValue("type"); + string type = typeToken?.Value(); + // Throw exception if jsonString does not contain type param + if (type == null) + { + throw new InvalidDataException("JsonString does not contain required enum type for deserialization."); + } + try + { + // Check if the jsonString type enum matches the AchDetails type enums + if (ContainsValue(type)) { - Utf8JsonReader utf8JsonReaderAchDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderAchDetails, jsonSerializerOptions, out achDetails); - - Utf8JsonReader utf8JsonReaderAffirmDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderAffirmDetails, jsonSerializerOptions, out affirmDetails); - - Utf8JsonReader utf8JsonReaderAfterpayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderAfterpayDetails, jsonSerializerOptions, out afterpayDetails); - - Utf8JsonReader utf8JsonReaderAmazonPayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderAmazonPayDetails, jsonSerializerOptions, out amazonPayDetails); - - Utf8JsonReader utf8JsonReaderAncvDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderAncvDetails, jsonSerializerOptions, out ancvDetails); - - Utf8JsonReader utf8JsonReaderAndroidPayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderAndroidPayDetails, jsonSerializerOptions, out androidPayDetails); - - Utf8JsonReader utf8JsonReaderApplePayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderApplePayDetails, jsonSerializerOptions, out applePayDetails); - - Utf8JsonReader utf8JsonReaderBacsDirectDebitDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderBacsDirectDebitDetails, jsonSerializerOptions, out bacsDirectDebitDetails); - - Utf8JsonReader utf8JsonReaderBillDeskDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderBillDeskDetails, jsonSerializerOptions, out billDeskDetails); - - Utf8JsonReader utf8JsonReaderBlikDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderBlikDetails, jsonSerializerOptions, out blikDetails); - - Utf8JsonReader utf8JsonReaderCardDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderCardDetails, jsonSerializerOptions, out cardDetails); - - Utf8JsonReader utf8JsonReaderCashAppDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderCashAppDetails, jsonSerializerOptions, out cashAppDetails); - - Utf8JsonReader utf8JsonReaderCellulantDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderCellulantDetails, jsonSerializerOptions, out cellulantDetails); - - Utf8JsonReader utf8JsonReaderDokuDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderDokuDetails, jsonSerializerOptions, out dokuDetails); - - Utf8JsonReader utf8JsonReaderDragonpayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderDragonpayDetails, jsonSerializerOptions, out dragonpayDetails); - - Utf8JsonReader utf8JsonReaderEBankingFinlandDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderEBankingFinlandDetails, jsonSerializerOptions, out eBankingFinlandDetails); - - Utf8JsonReader utf8JsonReaderEcontextVoucherDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderEcontextVoucherDetails, jsonSerializerOptions, out econtextVoucherDetails); - - Utf8JsonReader utf8JsonReaderEftDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderEftDetails, jsonSerializerOptions, out eftDetails); - - Utf8JsonReader utf8JsonReaderFastlaneDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderFastlaneDetails, jsonSerializerOptions, out fastlaneDetails); - - Utf8JsonReader utf8JsonReaderGenericIssuerPaymentMethodDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderGenericIssuerPaymentMethodDetails, jsonSerializerOptions, out genericIssuerPaymentMethodDetails); - - Utf8JsonReader utf8JsonReaderGooglePayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderGooglePayDetails, jsonSerializerOptions, out googlePayDetails); - - Utf8JsonReader utf8JsonReaderIdealDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderIdealDetails, jsonSerializerOptions, out idealDetails); - - Utf8JsonReader utf8JsonReaderKlarnaDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderKlarnaDetails, jsonSerializerOptions, out klarnaDetails); - - Utf8JsonReader utf8JsonReaderMasterpassDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderMasterpassDetails, jsonSerializerOptions, out masterpassDetails); - - Utf8JsonReader utf8JsonReaderMbwayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderMbwayDetails, jsonSerializerOptions, out mbwayDetails); - - Utf8JsonReader utf8JsonReaderMobilePayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderMobilePayDetails, jsonSerializerOptions, out mobilePayDetails); - - Utf8JsonReader utf8JsonReaderMolPayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderMolPayDetails, jsonSerializerOptions, out molPayDetails); - - Utf8JsonReader utf8JsonReaderOpenInvoiceDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderOpenInvoiceDetails, jsonSerializerOptions, out openInvoiceDetails); - - Utf8JsonReader utf8JsonReaderPayByBankAISDirectDebitDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderPayByBankAISDirectDebitDetails, jsonSerializerOptions, out payByBankAISDirectDebitDetails); - - Utf8JsonReader utf8JsonReaderPayByBankDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderPayByBankDetails, jsonSerializerOptions, out payByBankDetails); - - Utf8JsonReader utf8JsonReaderPayPalDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderPayPalDetails, jsonSerializerOptions, out payPalDetails); - - Utf8JsonReader utf8JsonReaderPayPayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderPayPayDetails, jsonSerializerOptions, out payPayDetails); - - Utf8JsonReader utf8JsonReaderPayToDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderPayToDetails, jsonSerializerOptions, out payToDetails); - - Utf8JsonReader utf8JsonReaderPayUUpiDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderPayUUpiDetails, jsonSerializerOptions, out payUUpiDetails); - - Utf8JsonReader utf8JsonReaderPayWithGoogleDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderPayWithGoogleDetails, jsonSerializerOptions, out payWithGoogleDetails); - - Utf8JsonReader utf8JsonReaderPaymentDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderPaymentDetails, jsonSerializerOptions, out paymentDetails); - - Utf8JsonReader utf8JsonReaderPixDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderPixDetails, jsonSerializerOptions, out pixDetails); - - Utf8JsonReader utf8JsonReaderPseDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderPseDetails, jsonSerializerOptions, out pseDetails); - - Utf8JsonReader utf8JsonReaderRakutenPayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderRakutenPayDetails, jsonSerializerOptions, out rakutenPayDetails); - - Utf8JsonReader utf8JsonReaderRatepayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderRatepayDetails, jsonSerializerOptions, out ratepayDetails); - - Utf8JsonReader utf8JsonReaderRivertyDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderRivertyDetails, jsonSerializerOptions, out rivertyDetails); - - Utf8JsonReader utf8JsonReaderSamsungPayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderSamsungPayDetails, jsonSerializerOptions, out samsungPayDetails); - - Utf8JsonReader utf8JsonReaderSepaDirectDebitDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderSepaDirectDebitDetails, jsonSerializerOptions, out sepaDirectDebitDetails); - - Utf8JsonReader utf8JsonReaderStoredPaymentMethodDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderStoredPaymentMethodDetails, jsonSerializerOptions, out storedPaymentMethodDetails); - - Utf8JsonReader utf8JsonReaderTwintDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderTwintDetails, jsonSerializerOptions, out twintDetails); - - Utf8JsonReader utf8JsonReaderUpiCollectDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderUpiCollectDetails, jsonSerializerOptions, out upiCollectDetails); - - Utf8JsonReader utf8JsonReaderUpiIntentDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderUpiIntentDetails, jsonSerializerOptions, out upiIntentDetails); - - Utf8JsonReader utf8JsonReaderVippsDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderVippsDetails, jsonSerializerOptions, out vippsDetails); - - Utf8JsonReader utf8JsonReaderVisaCheckoutDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderVisaCheckoutDetails, jsonSerializerOptions, out visaCheckoutDetails); - - Utf8JsonReader utf8JsonReaderWeChatPayDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderWeChatPayDetails, jsonSerializerOptions, out weChatPayDetails); - - Utf8JsonReader utf8JsonReaderWeChatPayMiniProgramDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderWeChatPayMiniProgramDetails, jsonSerializerOptions, out weChatPayMiniProgramDetails); - - Utf8JsonReader utf8JsonReaderZipDetails = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderZipDetails, jsonSerializerOptions, out zipDetails); + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("AchDetails"); + match++; } - } - - while (utf8JsonReader.Read()) + // Check if the jsonString type enum matches the AffirmDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("AffirmDetails"); + match++; + } + // Check if the jsonString type enum matches the AfterpayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("AfterpayDetails"); + match++; + } + // Check if the jsonString type enum matches the AmazonPayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("AmazonPayDetails"); + match++; + } + // Check if the jsonString type enum matches the AncvDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("AncvDetails"); + match++; + } + // Check if the jsonString type enum matches the AndroidPayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("AndroidPayDetails"); + match++; + } + // Check if the jsonString type enum matches the ApplePayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("ApplePayDetails"); + match++; + } + // Check if the jsonString type enum matches the BacsDirectDebitDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("BacsDirectDebitDetails"); + match++; + } + // Check if the jsonString type enum matches the BillDeskDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("BillDeskDetails"); + match++; + } + // Check if the jsonString type enum matches the BlikDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("BlikDetails"); + match++; + } + // Check if the jsonString type enum matches the CardDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("CardDetails"); + match++; + } + // Check if the jsonString type enum matches the CashAppDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("CashAppDetails"); + match++; + } + // Check if the jsonString type enum matches the CellulantDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("CellulantDetails"); + match++; + } + // Check if the jsonString type enum matches the DokuDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("DokuDetails"); + match++; + } + // Check if the jsonString type enum matches the DragonpayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("DragonpayDetails"); + match++; + } + // Check if the jsonString type enum matches the EBankingFinlandDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("EBankingFinlandDetails"); + match++; + } + // Check if the jsonString type enum matches the EcontextVoucherDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("EcontextVoucherDetails"); + match++; + } + // Check if the jsonString type enum matches the EftDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("EftDetails"); + match++; + } + // Check if the jsonString type enum matches the FastlaneDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("FastlaneDetails"); + match++; + } + // Check if the jsonString type enum matches the GenericIssuerPaymentMethodDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("GenericIssuerPaymentMethodDetails"); + match++; + } + // Check if the jsonString type enum matches the GooglePayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("GooglePayDetails"); + match++; + } + // Check if the jsonString type enum matches the IdealDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("IdealDetails"); + match++; + } + // Check if the jsonString type enum matches the KlarnaDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("KlarnaDetails"); + match++; + } + // Check if the jsonString type enum matches the MasterpassDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("MasterpassDetails"); + match++; + } + // Check if the jsonString type enum matches the MbwayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("MbwayDetails"); + match++; + } + // Check if the jsonString type enum matches the MobilePayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("MobilePayDetails"); + match++; + } + // Check if the jsonString type enum matches the MolPayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("MolPayDetails"); + match++; + } + // Check if the jsonString type enum matches the OpenInvoiceDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("OpenInvoiceDetails"); + match++; + } + // Check if the jsonString type enum matches the PayByBankAISDirectDebitDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("PayByBankAISDirectDebitDetails"); + match++; + } + // Check if the jsonString type enum matches the PayByBankDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("PayByBankDetails"); + match++; + } + // Check if the jsonString type enum matches the PayPalDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("PayPalDetails"); + match++; + } + // Check if the jsonString type enum matches the PayPayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("PayPayDetails"); + match++; + } + // Check if the jsonString type enum matches the PayToDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("PayToDetails"); + match++; + } + // Check if the jsonString type enum matches the PayUUpiDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("PayUUpiDetails"); + match++; + } + // Check if the jsonString type enum matches the PayWithGoogleDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("PayWithGoogleDetails"); + match++; + } + // Check if the jsonString type enum matches the PaymentDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("PaymentDetails"); + match++; + } + // Check if the jsonString type enum matches the PixDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("PixDetails"); + match++; + } + // Check if the jsonString type enum matches the PseDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("PseDetails"); + match++; + } + // Check if the jsonString type enum matches the RakutenPayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("RakutenPayDetails"); + match++; + } + // Check if the jsonString type enum matches the RatepayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("RatepayDetails"); + match++; + } + // Check if the jsonString type enum matches the RivertyDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("RivertyDetails"); + match++; + } + // Check if the jsonString type enum matches the SamsungPayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("SamsungPayDetails"); + match++; + } + // Check if the jsonString type enum matches the SepaDirectDebitDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("SepaDirectDebitDetails"); + match++; + } + // Check if the jsonString type enum matches the StoredPaymentMethodDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("StoredPaymentMethodDetails"); + match++; + } + // Check if the jsonString type enum matches the TwintDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("TwintDetails"); + match++; + } + // Check if the jsonString type enum matches the UpiCollectDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("UpiCollectDetails"); + match++; + } + // Check if the jsonString type enum matches the UpiIntentDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("UpiIntentDetails"); + match++; + } + // Check if the jsonString type enum matches the VippsDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("VippsDetails"); + match++; + } + // Check if the jsonString type enum matches the VisaCheckoutDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("VisaCheckoutDetails"); + match++; + } + // Check if the jsonString type enum matches the WeChatPayDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("WeChatPayDetails"); + match++; + } + // Check if the jsonString type enum matches the WeChatPayMiniProgramDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("WeChatPayMiniProgramDetails"); + match++; + } + // Check if the jsonString type enum matches the ZipDetails type enums + if (ContainsValue(type)) + { + newCheckoutPaymentMethod = new CheckoutPaymentMethod(JsonConvert.DeserializeObject(jsonString, CheckoutPaymentMethod.SerializerSettings)); + matchedTypes.Add("ZipDetails"); + match++; + } + } + catch (Exception ex) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + if (!(ex is JsonSerializationException)) { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - default: - break; - } + throw new InvalidDataException(string.Format("Failed to deserialize `{0}` into target: {1}", jsonString, ex.ToString())); } } - if (achDetails != null) - return new CheckoutPaymentMethod(achDetails); - - if (affirmDetails != null) - return new CheckoutPaymentMethod(affirmDetails); - - if (afterpayDetails != null) - return new CheckoutPaymentMethod(afterpayDetails); - - if (amazonPayDetails != null) - return new CheckoutPaymentMethod(amazonPayDetails); - - if (ancvDetails != null) - return new CheckoutPaymentMethod(ancvDetails); - - if (androidPayDetails != null) - return new CheckoutPaymentMethod(androidPayDetails); - - if (applePayDetails != null) - return new CheckoutPaymentMethod(applePayDetails); - - if (bacsDirectDebitDetails != null) - return new CheckoutPaymentMethod(bacsDirectDebitDetails); - - if (billDeskDetails != null) - return new CheckoutPaymentMethod(billDeskDetails); - - if (blikDetails != null) - return new CheckoutPaymentMethod(blikDetails); - - if (cardDetails != null) - return new CheckoutPaymentMethod(cardDetails); - - if (cashAppDetails != null) - return new CheckoutPaymentMethod(cashAppDetails); - - if (cellulantDetails != null) - return new CheckoutPaymentMethod(cellulantDetails); - - if (dokuDetails != null) - return new CheckoutPaymentMethod(dokuDetails); - - if (dragonpayDetails != null) - return new CheckoutPaymentMethod(dragonpayDetails); - - if (eBankingFinlandDetails != null) - return new CheckoutPaymentMethod(eBankingFinlandDetails); - - if (econtextVoucherDetails != null) - return new CheckoutPaymentMethod(econtextVoucherDetails); - - if (eftDetails != null) - return new CheckoutPaymentMethod(eftDetails); - - if (fastlaneDetails != null) - return new CheckoutPaymentMethod(fastlaneDetails); - - if (genericIssuerPaymentMethodDetails != null) - return new CheckoutPaymentMethod(genericIssuerPaymentMethodDetails); - - if (googlePayDetails != null) - return new CheckoutPaymentMethod(googlePayDetails); - - if (idealDetails != null) - return new CheckoutPaymentMethod(idealDetails); - - if (klarnaDetails != null) - return new CheckoutPaymentMethod(klarnaDetails); - - if (masterpassDetails != null) - return new CheckoutPaymentMethod(masterpassDetails); - - if (mbwayDetails != null) - return new CheckoutPaymentMethod(mbwayDetails); - - if (mobilePayDetails != null) - return new CheckoutPaymentMethod(mobilePayDetails); - - if (molPayDetails != null) - return new CheckoutPaymentMethod(molPayDetails); - - if (openInvoiceDetails != null) - return new CheckoutPaymentMethod(openInvoiceDetails); - - if (payByBankAISDirectDebitDetails != null) - return new CheckoutPaymentMethod(payByBankAISDirectDebitDetails); - - if (payByBankDetails != null) - return new CheckoutPaymentMethod(payByBankDetails); - - if (payPalDetails != null) - return new CheckoutPaymentMethod(payPalDetails); - - if (payPayDetails != null) - return new CheckoutPaymentMethod(payPayDetails); - - if (payToDetails != null) - return new CheckoutPaymentMethod(payToDetails); - - if (payUUpiDetails != null) - return new CheckoutPaymentMethod(payUUpiDetails); - - if (payWithGoogleDetails != null) - return new CheckoutPaymentMethod(payWithGoogleDetails); - - if (paymentDetails != null) - return new CheckoutPaymentMethod(paymentDetails); - - if (pixDetails != null) - return new CheckoutPaymentMethod(pixDetails); - - if (pseDetails != null) - return new CheckoutPaymentMethod(pseDetails); - - if (rakutenPayDetails != null) - return new CheckoutPaymentMethod(rakutenPayDetails); - - if (ratepayDetails != null) - return new CheckoutPaymentMethod(ratepayDetails); - - if (rivertyDetails != null) - return new CheckoutPaymentMethod(rivertyDetails); - - if (samsungPayDetails != null) - return new CheckoutPaymentMethod(samsungPayDetails); - - if (sepaDirectDebitDetails != null) - return new CheckoutPaymentMethod(sepaDirectDebitDetails); - - if (storedPaymentMethodDetails != null) - return new CheckoutPaymentMethod(storedPaymentMethodDetails); - - if (twintDetails != null) - return new CheckoutPaymentMethod(twintDetails); - - if (upiCollectDetails != null) - return new CheckoutPaymentMethod(upiCollectDetails); - - if (upiIntentDetails != null) - return new CheckoutPaymentMethod(upiIntentDetails); - - if (vippsDetails != null) - return new CheckoutPaymentMethod(vippsDetails); - - if (visaCheckoutDetails != null) - return new CheckoutPaymentMethod(visaCheckoutDetails); + if (match != 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined. MatchedTypes are: " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newCheckoutPaymentMethod; + } - if (weChatPayDetails != null) - return new CheckoutPaymentMethod(weChatPayDetails); + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutPaymentMethod); + } - if (weChatPayMiniProgramDetails != null) - return new CheckoutPaymentMethod(weChatPayMiniProgramDetails); + /// + /// Returns true if CheckoutPaymentMethod instances are equal + /// + /// Instance of CheckoutPaymentMethod to be compared + /// Boolean + public bool Equals(CheckoutPaymentMethod input) + { + if (input == null) + return false; - if (zipDetails != null) - return new CheckoutPaymentMethod(zipDetails); + return this.ActualInstance.Equals(input.ActualInstance); + } - throw new JsonException(); + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } } /// - /// Serializes a + /// To validate all properties of the instance /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutPaymentMethod checkoutPaymentMethod, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - writer.WriteStartObject(); + yield break; + } + } - WriteProperties(writer, checkoutPaymentMethod, jsonSerializerOptions); - writer.WriteEndObject(); + /// + /// Custom JSON converter for CheckoutPaymentMethod + /// + public class CheckoutPaymentMethodJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(CheckoutPaymentMethod).GetMethod("ToJson").Invoke(value, null))); } /// - /// Serializes the properties of + /// To convert a JSON string into an object /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutPaymentMethod checkoutPaymentMethod, JsonSerializerOptions jsonSerializerOptions) + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { + if(reader.TokenType != JsonToken.Null) + { + return CheckoutPaymentMethod.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; } } + } diff --git a/Adyen/Model/Checkout/CheckoutQrCodeAction.cs b/Adyen/Model/Checkout/CheckoutQrCodeAction.cs index 14f87ee07..074401e07 100644 --- a/Adyen/Model/Checkout/CheckoutQrCodeAction.cs +++ b/Adyen/Model/Checkout/CheckoutQrCodeAction.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,172 +15,103 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CheckoutQrCodeAction /// - public partial class CheckoutQrCodeAction : IValidatableObject + [DataContract(Name = "CheckoutQrCodeAction")] + public partial class CheckoutQrCodeAction : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// **qrCode** - /// Expiry time of the QR code. - /// Encoded payment data. - /// Specifies the payment method. - /// The contents of the QR code as a UTF8 string. - /// Specifies the URL to redirect to. - [JsonConstructor] - public CheckoutQrCodeAction(TypeEnum type, Option expiresAt = default, Option paymentData = default, Option paymentMethodType = default, Option qrCodeData = default, Option url = default) - { - Type = type; - ExpiresAtOption = expiresAt; - PaymentDataOption = paymentData; - PaymentMethodTypeOption = paymentMethodType; - QrCodeDataOption = qrCodeData; - UrlOption = url; - OnCreated(); - } - - partial void OnCreated(); - /// /// **qrCode** /// /// **qrCode** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum QrCode for value: qrCode /// + [EnumMember(Value = "qrCode")] QrCode = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("qrCode")) - return TypeEnum.QrCode; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("qrCode")) - return TypeEnum.QrCode; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.QrCode) - return "qrCode"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **qrCode** /// /// **qrCode** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of ExpiresAt + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected CheckoutQrCodeAction() { } + /// + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiresAtOption { get; private set; } + /// Expiry time of the QR code.. + /// Encoded payment data.. + /// Specifies the payment method.. + /// The contents of the QR code as a UTF8 string.. + /// **qrCode** (required). + /// Specifies the URL to redirect to.. + public CheckoutQrCodeAction(string expiresAt = default(string), string paymentData = default(string), string paymentMethodType = default(string), string qrCodeData = default(string), TypeEnum type = default(TypeEnum), string url = default(string)) + { + this.Type = type; + this.ExpiresAt = expiresAt; + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.QrCodeData = qrCodeData; + this.Url = url; + } /// /// Expiry time of the QR code. /// /// Expiry time of the QR code. - [JsonPropertyName("expiresAt")] - public string ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } - - /// - /// Used to track the state of PaymentData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentDataOption { get; private set; } + [DataMember(Name = "expiresAt", EmitDefaultValue = false)] + public string ExpiresAt { get; set; } /// /// Encoded payment data. /// /// Encoded payment data. - [JsonPropertyName("paymentData")] - public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } - - /// - /// Used to track the state of PaymentMethodType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodTypeOption { get; private set; } + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [JsonPropertyName("paymentMethodType")] - public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } - - /// - /// Used to track the state of QrCodeData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option QrCodeDataOption { get; private set; } + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } /// /// The contents of the QR code as a UTF8 string. /// /// The contents of the QR code as a UTF8 string. - [JsonPropertyName("qrCodeData")] - public string QrCodeData { get { return this.QrCodeDataOption; } set { this.QrCodeDataOption = new Option(value); } } - - /// - /// Used to track the state of Url - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option UrlOption { get; private set; } + [DataMember(Name = "qrCodeData", EmitDefaultValue = false)] + public string QrCodeData { get; set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [JsonPropertyName("url")] - public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; set; } /// /// Returns the string presentation of the object @@ -189,176 +121,120 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutQrCodeAction {\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); sb.Append(" QrCodeData: ").Append(QrCodeData).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CheckoutQrCodeActionJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CheckoutQrCodeAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option type = default; - Option expiresAt = default; - Option paymentData = default; - Option paymentMethodType = default; - Option qrCodeData = default; - Option url = default; + return this.Equals(input as CheckoutQrCodeAction); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if CheckoutQrCodeAction instances are equal + /// + /// Instance of CheckoutQrCodeAction to be compared + /// Boolean + public bool Equals(CheckoutQrCodeAction input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(CheckoutQrCodeAction.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "expiresAt": - expiresAt = new Option(utf8JsonReader.GetString()); - break; - case "paymentData": - paymentData = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethodType": - paymentMethodType = new Option(utf8JsonReader.GetString()); - break; - case "qrCodeData": - qrCodeData = new Option(utf8JsonReader.GetString()); - break; - case "url": - url = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class CheckoutQrCodeAction.", nameof(type)); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutQrCodeAction."); - - if (expiresAt.IsSet && expiresAt.Value == null) - throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CheckoutQrCodeAction."); - - if (paymentData.IsSet && paymentData.Value == null) - throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class CheckoutQrCodeAction."); - - if (paymentMethodType.IsSet && paymentMethodType.Value == null) - throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutQrCodeAction."); - - if (qrCodeData.IsSet && qrCodeData.Value == null) - throw new ArgumentNullException(nameof(qrCodeData), "Property is not nullable for class CheckoutQrCodeAction."); - - if (url.IsSet && url.Value == null) - throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutQrCodeAction."); - - return new CheckoutQrCodeAction(type.Value.Value, expiresAt, paymentData, paymentMethodType, qrCodeData, url); + return + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) + ) && + ( + this.PaymentData == input.PaymentData || + (this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData)) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + (this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType)) + ) && + ( + this.QrCodeData == input.QrCodeData || + (this.QrCodeData != null && + this.QrCodeData.Equals(input.QrCodeData)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutQrCodeAction checkoutQrCodeAction, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, checkoutQrCodeAction, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } + if (this.PaymentData != null) + { + hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); + } + if (this.PaymentMethodType != null) + { + hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); + } + if (this.QrCodeData != null) + { + hashCode = (hashCode * 59) + this.QrCodeData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.Url != null) + { + hashCode = (hashCode * 59) + this.Url.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutQrCodeAction checkoutQrCodeAction, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (checkoutQrCodeAction.ExpiresAtOption.IsSet && checkoutQrCodeAction.ExpiresAt == null) - throw new ArgumentNullException(nameof(checkoutQrCodeAction.ExpiresAt), "Property is required for class CheckoutQrCodeAction."); - - if (checkoutQrCodeAction.PaymentDataOption.IsSet && checkoutQrCodeAction.PaymentData == null) - throw new ArgumentNullException(nameof(checkoutQrCodeAction.PaymentData), "Property is required for class CheckoutQrCodeAction."); - - if (checkoutQrCodeAction.PaymentMethodTypeOption.IsSet && checkoutQrCodeAction.PaymentMethodType == null) - throw new ArgumentNullException(nameof(checkoutQrCodeAction.PaymentMethodType), "Property is required for class CheckoutQrCodeAction."); - - if (checkoutQrCodeAction.QrCodeDataOption.IsSet && checkoutQrCodeAction.QrCodeData == null) - throw new ArgumentNullException(nameof(checkoutQrCodeAction.QrCodeData), "Property is required for class CheckoutQrCodeAction."); - - if (checkoutQrCodeAction.UrlOption.IsSet && checkoutQrCodeAction.Url == null) - throw new ArgumentNullException(nameof(checkoutQrCodeAction.Url), "Property is required for class CheckoutQrCodeAction."); - - var typeRawValue = CheckoutQrCodeAction.TypeEnumToJsonValue(checkoutQrCodeAction.Type); - writer.WriteString("type", typeRawValue); - if (checkoutQrCodeAction.ExpiresAtOption.IsSet) - writer.WriteString("expiresAt", checkoutQrCodeAction.ExpiresAt); - - if (checkoutQrCodeAction.PaymentDataOption.IsSet) - writer.WriteString("paymentData", checkoutQrCodeAction.PaymentData); - - if (checkoutQrCodeAction.PaymentMethodTypeOption.IsSet) - writer.WriteString("paymentMethodType", checkoutQrCodeAction.PaymentMethodType); - - if (checkoutQrCodeAction.QrCodeDataOption.IsSet) - writer.WriteString("qrCodeData", checkoutQrCodeAction.QrCodeData); - - if (checkoutQrCodeAction.UrlOption.IsSet) - writer.WriteString("url", checkoutQrCodeAction.Url); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CheckoutRedirectAction.cs b/Adyen/Model/Checkout/CheckoutRedirectAction.cs index 8d682d9e0..9819c80c3 100644 --- a/Adyen/Model/Checkout/CheckoutRedirectAction.cs +++ b/Adyen/Model/Checkout/CheckoutRedirectAction.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,156 +15,94 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CheckoutRedirectAction /// - public partial class CheckoutRedirectAction : IValidatableObject + [DataContract(Name = "CheckoutRedirectAction")] + public partial class CheckoutRedirectAction : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// **redirect** - /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. - /// Specifies the HTTP method, for example GET or POST. - /// Specifies the payment method. - /// Specifies the URL to redirect to. - [JsonConstructor] - public CheckoutRedirectAction(TypeEnum type, Option> data = default, Option method = default, Option paymentMethodType = default, Option url = default) - { - Type = type; - DataOption = data; - MethodOption = method; - PaymentMethodTypeOption = paymentMethodType; - UrlOption = url; - OnCreated(); - } - - partial void OnCreated(); - /// /// **redirect** /// /// **redirect** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Redirect for value: redirect /// + [EnumMember(Value = "redirect")] Redirect = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("redirect")) - return TypeEnum.Redirect; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("redirect")) - return TypeEnum.Redirect; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.Redirect) - return "redirect"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **redirect** /// /// **redirect** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of Data + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> DataOption { get; private set; } - + [JsonConstructorAttribute] + protected CheckoutRedirectAction() { } /// - /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. + /// Initializes a new instance of the class. /// - /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. - [JsonPropertyName("data")] - public Dictionary Data { get { return this.DataOption; } set { this.DataOption = new Option>(value); } } + /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL.. + /// Specifies the HTTP method, for example GET or POST.. + /// Specifies the payment method.. + /// **redirect** (required). + /// Specifies the URL to redirect to.. + public CheckoutRedirectAction(Dictionary data = default(Dictionary), string method = default(string), string paymentMethodType = default(string), TypeEnum type = default(TypeEnum), string url = default(string)) + { + this.Type = type; + this.Data = data; + this.Method = method; + this.PaymentMethodType = paymentMethodType; + this.Url = url; + } /// - /// Used to track the state of Method + /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MethodOption { get; private set; } + /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. + [DataMember(Name = "data", EmitDefaultValue = false)] + public Dictionary Data { get; set; } /// /// Specifies the HTTP method, for example GET or POST. /// /// Specifies the HTTP method, for example GET or POST. - [JsonPropertyName("method")] - public string Method { get { return this.MethodOption; } set { this.MethodOption = new Option(value); } } - - /// - /// Used to track the state of PaymentMethodType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodTypeOption { get; private set; } + [DataMember(Name = "method", EmitDefaultValue = false)] + public string Method { get; set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [JsonPropertyName("paymentMethodType")] - public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } - - /// - /// Used to track the state of Url - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option UrlOption { get; private set; } + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [JsonPropertyName("url")] - public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; set; } /// /// Returns the string presentation of the object @@ -173,165 +112,111 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutRedirectAction {\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Data: ").Append(Data).Append("\n"); sb.Append(" Method: ").Append(Method).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CheckoutRedirectActionJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CheckoutRedirectAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option type = default; - Option> data = default; - Option method = default; - Option paymentMethodType = default; - Option url = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(CheckoutRedirectAction.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "data": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - data = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "method": - method = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethodType": - paymentMethodType = new Option(utf8JsonReader.GetString()); - break; - case "url": - url = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class CheckoutRedirectAction.", nameof(type)); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutRedirectAction."); - - if (data.IsSet && data.Value == null) - throw new ArgumentNullException(nameof(data), "Property is not nullable for class CheckoutRedirectAction."); - - if (method.IsSet && method.Value == null) - throw new ArgumentNullException(nameof(method), "Property is not nullable for class CheckoutRedirectAction."); - - if (paymentMethodType.IsSet && paymentMethodType.Value == null) - throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutRedirectAction."); - - if (url.IsSet && url.Value == null) - throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutRedirectAction."); - - return new CheckoutRedirectAction(type.Value.Value, data, method, paymentMethodType, url); + return this.Equals(input as CheckoutRedirectAction); } /// - /// Serializes a + /// Returns true if CheckoutRedirectAction instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutRedirectAction checkoutRedirectAction, JsonSerializerOptions jsonSerializerOptions) + /// Instance of CheckoutRedirectAction to be compared + /// Boolean + public bool Equals(CheckoutRedirectAction input) { - writer.WriteStartObject(); - - WriteProperties(writer, checkoutRedirectAction, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Data == input.Data || + this.Data != null && + input.Data != null && + this.Data.SequenceEqual(input.Data) + ) && + ( + this.Method == input.Method || + (this.Method != null && + this.Method.Equals(input.Method)) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + (this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutRedirectAction checkoutRedirectAction, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (checkoutRedirectAction.DataOption.IsSet && checkoutRedirectAction.Data == null) - throw new ArgumentNullException(nameof(checkoutRedirectAction.Data), "Property is required for class CheckoutRedirectAction."); - - if (checkoutRedirectAction.MethodOption.IsSet && checkoutRedirectAction.Method == null) - throw new ArgumentNullException(nameof(checkoutRedirectAction.Method), "Property is required for class CheckoutRedirectAction."); - - if (checkoutRedirectAction.PaymentMethodTypeOption.IsSet && checkoutRedirectAction.PaymentMethodType == null) - throw new ArgumentNullException(nameof(checkoutRedirectAction.PaymentMethodType), "Property is required for class CheckoutRedirectAction."); - - if (checkoutRedirectAction.UrlOption.IsSet && checkoutRedirectAction.Url == null) - throw new ArgumentNullException(nameof(checkoutRedirectAction.Url), "Property is required for class CheckoutRedirectAction."); - - var typeRawValue = CheckoutRedirectAction.TypeEnumToJsonValue(checkoutRedirectAction.Type); - writer.WriteString("type", typeRawValue); - if (checkoutRedirectAction.DataOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("data"); - JsonSerializer.Serialize(writer, checkoutRedirectAction.Data, jsonSerializerOptions); + int hashCode = 41; + if (this.Data != null) + { + hashCode = (hashCode * 59) + this.Data.GetHashCode(); + } + if (this.Method != null) + { + hashCode = (hashCode * 59) + this.Method.GetHashCode(); + } + if (this.PaymentMethodType != null) + { + hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.Url != null) + { + hashCode = (hashCode * 59) + this.Url.GetHashCode(); + } + return hashCode; } - if (checkoutRedirectAction.MethodOption.IsSet) - writer.WriteString("method", checkoutRedirectAction.Method); - - if (checkoutRedirectAction.PaymentMethodTypeOption.IsSet) - writer.WriteString("paymentMethodType", checkoutRedirectAction.PaymentMethodType); - - if (checkoutRedirectAction.UrlOption.IsSet) - writer.WriteString("url", checkoutRedirectAction.Url); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/CheckoutSDKAction.cs b/Adyen/Model/Checkout/CheckoutSDKAction.cs index 34c532634..bdf8abdca 100644 --- a/Adyen/Model/Checkout/CheckoutSDKAction.cs +++ b/Adyen/Model/Checkout/CheckoutSDKAction.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,170 +15,100 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CheckoutSDKAction /// - public partial class CheckoutSDKAction : IValidatableObject + [DataContract(Name = "CheckoutSDKAction")] + public partial class CheckoutSDKAction : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The type of the action. - /// Encoded payment data. - /// Specifies the payment method. - /// The data to pass to the SDK. - /// Specifies the URL to redirect to. - [JsonConstructor] - public CheckoutSDKAction(TypeEnum type, Option paymentData = default, Option paymentMethodType = default, Option> sdkData = default, Option url = default) - { - Type = type; - PaymentDataOption = paymentData; - PaymentMethodTypeOption = paymentMethodType; - SdkDataOption = sdkData; - UrlOption = url; - OnCreated(); - } - - partial void OnCreated(); - /// /// The type of the action. /// /// The type of the action. + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Sdk for value: sdk /// + [EnumMember(Value = "sdk")] Sdk = 1, /// /// Enum WechatpaySDK for value: wechatpaySDK /// + [EnumMember(Value = "wechatpaySDK")] WechatpaySDK = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("sdk")) - return TypeEnum.Sdk; - if (value.Equals("wechatpaySDK")) - return TypeEnum.WechatpaySDK; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("sdk")) - return TypeEnum.Sdk; - - if (value.Equals("wechatpaySDK")) - return TypeEnum.WechatpaySDK; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.Sdk) - return "sdk"; - - if (value == TypeEnum.WechatpaySDK) - return "wechatpaySDK"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// The type of the action. /// /// The type of the action. - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of PaymentData + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentDataOption { get; private set; } - + [JsonConstructorAttribute] + protected CheckoutSDKAction() { } /// - /// Encoded payment data. + /// Initializes a new instance of the class. /// - /// Encoded payment data. - [JsonPropertyName("paymentData")] - public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } + /// Encoded payment data.. + /// Specifies the payment method.. + /// The data to pass to the SDK.. + /// The type of the action. (required). + /// Specifies the URL to redirect to.. + public CheckoutSDKAction(string paymentData = default(string), string paymentMethodType = default(string), Dictionary sdkData = default(Dictionary), TypeEnum type = default(TypeEnum), string url = default(string)) + { + this.Type = type; + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.SdkData = sdkData; + this.Url = url; + } /// - /// Used to track the state of PaymentMethodType + /// Encoded payment data. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodTypeOption { get; private set; } + /// Encoded payment data. + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [JsonPropertyName("paymentMethodType")] - public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } - - /// - /// Used to track the state of SdkData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SdkDataOption { get; private set; } + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } /// /// The data to pass to the SDK. /// /// The data to pass to the SDK. - [JsonPropertyName("sdkData")] - public Dictionary SdkData { get { return this.SdkDataOption; } set { this.SdkDataOption = new Option>(value); } } - - /// - /// Used to track the state of Url - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option UrlOption { get; private set; } + [DataMember(Name = "sdkData", EmitDefaultValue = false)] + public Dictionary SdkData { get; set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [JsonPropertyName("url")] - public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; set; } /// /// Returns the string presentation of the object @@ -187,165 +118,111 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutSDKAction {\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); sb.Append(" SdkData: ").Append(SdkData).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CheckoutSDKActionJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CheckoutSDKAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option type = default; - Option paymentData = default; - Option paymentMethodType = default; - Option> sdkData = default; - Option url = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(CheckoutSDKAction.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "paymentData": - paymentData = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethodType": - paymentMethodType = new Option(utf8JsonReader.GetString()); - break; - case "sdkData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sdkData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "url": - url = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class CheckoutSDKAction.", nameof(type)); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutSDKAction."); - - if (paymentData.IsSet && paymentData.Value == null) - throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class CheckoutSDKAction."); - - if (paymentMethodType.IsSet && paymentMethodType.Value == null) - throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutSDKAction."); - - if (sdkData.IsSet && sdkData.Value == null) - throw new ArgumentNullException(nameof(sdkData), "Property is not nullable for class CheckoutSDKAction."); - - if (url.IsSet && url.Value == null) - throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutSDKAction."); - - return new CheckoutSDKAction(type.Value.Value, paymentData, paymentMethodType, sdkData, url); + return this.Equals(input as CheckoutSDKAction); } /// - /// Serializes a + /// Returns true if CheckoutSDKAction instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutSDKAction checkoutSDKAction, JsonSerializerOptions jsonSerializerOptions) + /// Instance of CheckoutSDKAction to be compared + /// Boolean + public bool Equals(CheckoutSDKAction input) { - writer.WriteStartObject(); - - WriteProperties(writer, checkoutSDKAction, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.PaymentData == input.PaymentData || + (this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData)) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + (this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType)) + ) && + ( + this.SdkData == input.SdkData || + this.SdkData != null && + input.SdkData != null && + this.SdkData.SequenceEqual(input.SdkData) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutSDKAction checkoutSDKAction, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (checkoutSDKAction.PaymentDataOption.IsSet && checkoutSDKAction.PaymentData == null) - throw new ArgumentNullException(nameof(checkoutSDKAction.PaymentData), "Property is required for class CheckoutSDKAction."); - - if (checkoutSDKAction.PaymentMethodTypeOption.IsSet && checkoutSDKAction.PaymentMethodType == null) - throw new ArgumentNullException(nameof(checkoutSDKAction.PaymentMethodType), "Property is required for class CheckoutSDKAction."); - - if (checkoutSDKAction.SdkDataOption.IsSet && checkoutSDKAction.SdkData == null) - throw new ArgumentNullException(nameof(checkoutSDKAction.SdkData), "Property is required for class CheckoutSDKAction."); - - if (checkoutSDKAction.UrlOption.IsSet && checkoutSDKAction.Url == null) - throw new ArgumentNullException(nameof(checkoutSDKAction.Url), "Property is required for class CheckoutSDKAction."); - - var typeRawValue = CheckoutSDKAction.TypeEnumToJsonValue(checkoutSDKAction.Type); - writer.WriteString("type", typeRawValue); - if (checkoutSDKAction.PaymentDataOption.IsSet) - writer.WriteString("paymentData", checkoutSDKAction.PaymentData); - - if (checkoutSDKAction.PaymentMethodTypeOption.IsSet) - writer.WriteString("paymentMethodType", checkoutSDKAction.PaymentMethodType); - - if (checkoutSDKAction.SdkDataOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("sdkData"); - JsonSerializer.Serialize(writer, checkoutSDKAction.SdkData, jsonSerializerOptions); + int hashCode = 41; + if (this.PaymentData != null) + { + hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); + } + if (this.PaymentMethodType != null) + { + hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); + } + if (this.SdkData != null) + { + hashCode = (hashCode * 59) + this.SdkData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.Url != null) + { + hashCode = (hashCode * 59) + this.Url.GetHashCode(); + } + return hashCode; } - if (checkoutSDKAction.UrlOption.IsSet) - writer.WriteString("url", checkoutSDKAction.Url); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs b/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs index 63bc76d96..5a9459259 100644 --- a/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs +++ b/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,256 +15,125 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CheckoutSessionInstallmentOption /// - public partial class CheckoutSessionInstallmentOption : IValidatableObject + [DataContract(Name = "CheckoutSessionInstallmentOption")] + public partial class CheckoutSessionInstallmentOption : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving*** **bonus** * **with_interest** * **buynow_paylater** * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * **nointeres_refund_prctg** * **interes_refund_prctg** - /// Preselected number of installments offered for this payment method. - /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. - [JsonConstructor] - public CheckoutSessionInstallmentOption(Option> plans = default, Option preselectedValue = default, Option> values = default) - { - PlansOption = plans; - PreselectedValueOption = preselectedValue; - ValuesOption = values; - OnCreated(); - } - - partial void OnCreated(); - /// /// Defines Plans /// + [JsonConverter(typeof(StringEnumConverter))] public enum PlansEnum { /// /// Enum Bonus for value: bonus /// + [EnumMember(Value = "bonus")] Bonus = 1, /// /// Enum BuynowPaylater for value: buynow_paylater /// + [EnumMember(Value = "buynow_paylater")] BuynowPaylater = 2, /// /// Enum InteresRefundPrctg for value: interes_refund_prctg /// + [EnumMember(Value = "interes_refund_prctg")] InteresRefundPrctg = 3, /// /// Enum InterestBonus for value: interest_bonus /// + [EnumMember(Value = "interest_bonus")] InterestBonus = 4, /// /// Enum NointeresRefundPrctg for value: nointeres_refund_prctg /// + [EnumMember(Value = "nointeres_refund_prctg")] NointeresRefundPrctg = 5, /// /// Enum NointerestBonus for value: nointerest_bonus /// + [EnumMember(Value = "nointerest_bonus")] NointerestBonus = 6, /// /// Enum RefundPrctg for value: refund_prctg /// + [EnumMember(Value = "refund_prctg")] RefundPrctg = 7, /// /// Enum Regular for value: regular /// + [EnumMember(Value = "regular")] Regular = 8, /// /// Enum Revolving for value: revolving /// + [EnumMember(Value = "revolving")] Revolving = 9, /// /// Enum WithInterest for value: with_interest /// + [EnumMember(Value = "with_interest")] WithInterest = 10 - } - - /// - /// Returns a - /// - /// - /// - /// - public static PlansEnum PlansEnumFromString(string value) - { - if (value.Equals("bonus")) - return PlansEnum.Bonus; - - if (value.Equals("buynow_paylater")) - return PlansEnum.BuynowPaylater; - if (value.Equals("interes_refund_prctg")) - return PlansEnum.InteresRefundPrctg; - - if (value.Equals("interest_bonus")) - return PlansEnum.InterestBonus; - - if (value.Equals("nointeres_refund_prctg")) - return PlansEnum.NointeresRefundPrctg; - - if (value.Equals("nointerest_bonus")) - return PlansEnum.NointerestBonus; - - if (value.Equals("refund_prctg")) - return PlansEnum.RefundPrctg; - - if (value.Equals("regular")) - return PlansEnum.Regular; - - if (value.Equals("revolving")) - return PlansEnum.Revolving; - - if (value.Equals("with_interest")) - return PlansEnum.WithInterest; - - throw new NotImplementedException($"Could not convert value to type PlansEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static PlansEnum? PlansEnumFromStringOrDefault(string value) - { - if (value.Equals("bonus")) - return PlansEnum.Bonus; - - if (value.Equals("buynow_paylater")) - return PlansEnum.BuynowPaylater; - - if (value.Equals("interes_refund_prctg")) - return PlansEnum.InteresRefundPrctg; - if (value.Equals("interest_bonus")) - return PlansEnum.InterestBonus; - - if (value.Equals("nointeres_refund_prctg")) - return PlansEnum.NointeresRefundPrctg; - - if (value.Equals("nointerest_bonus")) - return PlansEnum.NointerestBonus; - - if (value.Equals("refund_prctg")) - return PlansEnum.RefundPrctg; - - if (value.Equals("regular")) - return PlansEnum.Regular; - - if (value.Equals("revolving")) - return PlansEnum.Revolving; - - if (value.Equals("with_interest")) - return PlansEnum.WithInterest; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string PlansEnumToJsonValue(PlansEnum value) - { - if (value == PlansEnum.Bonus) - return "bonus"; - - if (value == PlansEnum.BuynowPaylater) - return "buynow_paylater"; - - if (value == PlansEnum.InteresRefundPrctg) - return "interes_refund_prctg"; - - if (value == PlansEnum.InterestBonus) - return "interest_bonus"; - - if (value == PlansEnum.NointeresRefundPrctg) - return "nointeres_refund_prctg"; - - if (value == PlansEnum.NointerestBonus) - return "nointerest_bonus"; - - if (value == PlansEnum.RefundPrctg) - return "refund_prctg"; - - if (value == PlansEnum.Regular) - return "regular"; - - if (value == PlansEnum.Revolving) - return "revolving"; - - if (value == PlansEnum.WithInterest) - return "with_interest"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Plans - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> PlansOption { get; private set; } /// /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving*** **bonus** * **with_interest** * **buynow_paylater** * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * **nointeres_refund_prctg** * **interes_refund_prctg** /// /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving*** **bonus** * **with_interest** * **buynow_paylater** * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * **nointeres_refund_prctg** * **interes_refund_prctg** - [JsonPropertyName("plans")] - public List Plans { get { return this.PlansOption; } set { this.PlansOption = new Option>(value); } } - + [DataMember(Name = "plans", EmitDefaultValue = false)] + public List Plans { get; set; } /// - /// Used to track the state of PreselectedValue + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PreselectedValueOption { get; private set; } + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving*** **bonus** * **with_interest** * **buynow_paylater** * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * **nointeres_refund_prctg** * **interes_refund_prctg**. + /// Preselected number of installments offered for this payment method.. + /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`.. + public CheckoutSessionInstallmentOption(List plans = default(List), int? preselectedValue = default(int?), List values = default(List)) + { + this.Plans = plans; + this.PreselectedValue = preselectedValue; + this.Values = values; + } /// /// Preselected number of installments offered for this payment method. /// /// Preselected number of installments offered for this payment method. - [JsonPropertyName("preselectedValue")] - public int? PreselectedValue { get { return this.PreselectedValueOption; } set { this.PreselectedValueOption = new Option(value); } } - - /// - /// Used to track the state of Values - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> ValuesOption { get; private set; } + [DataMember(Name = "preselectedValue", EmitDefaultValue = false)] + public int? PreselectedValue { get; set; } /// /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. /// /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. - [JsonPropertyName("values")] - public List Values { get { return this.ValuesOption; } set { this.ValuesOption = new Option>(value); } } + [DataMember(Name = "values", EmitDefaultValue = false)] + public List Values { get; set; } /// /// Returns the string presentation of the object @@ -281,130 +151,79 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CheckoutSessionInstallmentOptionJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CheckoutSessionInstallmentOption Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option> plans = default; - Option preselectedValue = default; - Option> values = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "plans": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - plans = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "preselectedValue": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - preselectedValue = new Option(utf8JsonReader.GetInt32()); - break; - case "values": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - values = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (plans.IsSet && plans.Value == null) - throw new ArgumentNullException(nameof(plans), "Property is not nullable for class CheckoutSessionInstallmentOption."); - - if (preselectedValue.IsSet && preselectedValue.Value == null) - throw new ArgumentNullException(nameof(preselectedValue), "Property is not nullable for class CheckoutSessionInstallmentOption."); - - if (values.IsSet && values.Value == null) - throw new ArgumentNullException(nameof(values), "Property is not nullable for class CheckoutSessionInstallmentOption."); - - return new CheckoutSessionInstallmentOption(plans, preselectedValue, values); + return this.Equals(input as CheckoutSessionInstallmentOption); } /// - /// Serializes a + /// Returns true if CheckoutSessionInstallmentOption instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutSessionInstallmentOption checkoutSessionInstallmentOption, JsonSerializerOptions jsonSerializerOptions) + /// Instance of CheckoutSessionInstallmentOption to be compared + /// Boolean + public bool Equals(CheckoutSessionInstallmentOption input) { - writer.WriteStartObject(); - - WriteProperties(writer, checkoutSessionInstallmentOption, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Plans == input.Plans || + this.Plans.SequenceEqual(input.Plans) + ) && + ( + this.PreselectedValue == input.PreselectedValue || + this.PreselectedValue.Equals(input.PreselectedValue) + ) && + ( + this.Values == input.Values || + this.Values != null && + input.Values != null && + this.Values.SequenceEqual(input.Values) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutSessionInstallmentOption checkoutSessionInstallmentOption, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (checkoutSessionInstallmentOption.PlansOption.IsSet && checkoutSessionInstallmentOption.Plans == null) - throw new ArgumentNullException(nameof(checkoutSessionInstallmentOption.Plans), "Property is required for class CheckoutSessionInstallmentOption."); - - if (checkoutSessionInstallmentOption.ValuesOption.IsSet && checkoutSessionInstallmentOption.Values == null) - throw new ArgumentNullException(nameof(checkoutSessionInstallmentOption.Values), "Property is required for class CheckoutSessionInstallmentOption."); - - if (checkoutSessionInstallmentOption.PlansOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("plans"); - JsonSerializer.Serialize(writer, checkoutSessionInstallmentOption.Plans, jsonSerializerOptions); - } - if (checkoutSessionInstallmentOption.PreselectedValueOption.IsSet) - writer.WriteNumber("preselectedValue", checkoutSessionInstallmentOption.PreselectedValueOption.Value.Value); - - if (checkoutSessionInstallmentOption.ValuesOption.IsSet) - { - writer.WritePropertyName("values"); - JsonSerializer.Serialize(writer, checkoutSessionInstallmentOption.Values, jsonSerializerOptions); + int hashCode = 41; + hashCode = (hashCode * 59) + this.Plans.GetHashCode(); + hashCode = (hashCode * 59) + this.PreselectedValue.GetHashCode(); + if (this.Values != null) + { + hashCode = (hashCode * 59) + this.Values.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs b/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs index 0952b65dd..4c76f48c2 100644 --- a/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs +++ b/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,214 +15,107 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CheckoutSessionThreeDS2RequestData /// - public partial class CheckoutSessionThreeDS2RequestData : IValidatableObject + [DataContract(Name = "CheckoutSessionThreeDS2RequestData")] + public partial class CheckoutSessionThreeDS2RequestData : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// homePhone - /// mobilePhone - /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - /// workPhone - [JsonConstructor] - public CheckoutSessionThreeDS2RequestData(Option homePhone = default, Option mobilePhone = default, Option threeDSRequestorChallengeInd = default, Option workPhone = default) - { - HomePhoneOption = homePhone; - MobilePhoneOption = mobilePhone; - ThreeDSRequestorChallengeIndOption = threeDSRequestorChallengeInd; - WorkPhoneOption = workPhone; - OnCreated(); - } - - partial void OnCreated(); - /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSRequestorChallengeIndEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// + [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// + [EnumMember(Value = "06")] _06 = 6 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ThreeDSRequestorChallengeIndEnum ThreeDSRequestorChallengeIndEnumFromString(string value) - { - if (value.Equals("01")) - return ThreeDSRequestorChallengeIndEnum._01; - - if (value.Equals("02")) - return ThreeDSRequestorChallengeIndEnum._02; - - if (value.Equals("03")) - return ThreeDSRequestorChallengeIndEnum._03; - - if (value.Equals("04")) - return ThreeDSRequestorChallengeIndEnum._04; - - if (value.Equals("05")) - return ThreeDSRequestorChallengeIndEnum._05; - - if (value.Equals("06")) - return ThreeDSRequestorChallengeIndEnum._06; - - throw new NotImplementedException($"Could not convert value to type ThreeDSRequestorChallengeIndEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeIndEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ThreeDSRequestorChallengeIndEnum._01; - - if (value.Equals("02")) - return ThreeDSRequestorChallengeIndEnum._02; - - if (value.Equals("03")) - return ThreeDSRequestorChallengeIndEnum._03; - if (value.Equals("04")) - return ThreeDSRequestorChallengeIndEnum._04; - - if (value.Equals("05")) - return ThreeDSRequestorChallengeIndEnum._05; - - if (value.Equals("06")) - return ThreeDSRequestorChallengeIndEnum._06; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ThreeDSRequestorChallengeIndEnumToJsonValue(ThreeDSRequestorChallengeIndEnum? value) - { - if (value == ThreeDSRequestorChallengeIndEnum._01) - return "01"; - - if (value == ThreeDSRequestorChallengeIndEnum._02) - return "02"; - - if (value == ThreeDSRequestorChallengeIndEnum._03) - return "03"; - - if (value == ThreeDSRequestorChallengeIndEnum._04) - return "04"; - - if (value == ThreeDSRequestorChallengeIndEnum._05) - return "05"; - - if (value == ThreeDSRequestorChallengeIndEnum._06) - return "06"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ThreeDSRequestorChallengeInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorChallengeIndOption { get; private set; } /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - [JsonPropertyName("threeDSRequestorChallengeInd")] - public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get { return this.ThreeDSRequestorChallengeIndOption; } set { this.ThreeDSRequestorChallengeIndOption = new Option(value); } } - + [DataMember(Name = "threeDSRequestorChallengeInd", EmitDefaultValue = false)] + public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get; set; } /// - /// Used to track the state of HomePhone + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option HomePhoneOption { get; private set; } + /// homePhone. + /// mobilePhone. + /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only. + /// workPhone. + public CheckoutSessionThreeDS2RequestData(Phone homePhone = default(Phone), Phone mobilePhone = default(Phone), ThreeDSRequestorChallengeIndEnum? threeDSRequestorChallengeInd = default(ThreeDSRequestorChallengeIndEnum?), Phone workPhone = default(Phone)) + { + this.HomePhone = homePhone; + this.MobilePhone = mobilePhone; + this.ThreeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + this.WorkPhone = workPhone; + } /// /// Gets or Sets HomePhone /// - [JsonPropertyName("homePhone")] - public Phone HomePhone { get { return this.HomePhoneOption; } set { this.HomePhoneOption = new Option(value); } } - - /// - /// Used to track the state of MobilePhone - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MobilePhoneOption { get; private set; } + [DataMember(Name = "homePhone", EmitDefaultValue = false)] + public Phone HomePhone { get; set; } /// /// Gets or Sets MobilePhone /// - [JsonPropertyName("mobilePhone")] - public Phone MobilePhone { get { return this.MobilePhoneOption; } set { this.MobilePhoneOption = new Option(value); } } - - /// - /// Used to track the state of WorkPhone - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option WorkPhoneOption { get; private set; } + [DataMember(Name = "mobilePhone", EmitDefaultValue = false)] + public Phone MobilePhone { get; set; } /// /// Gets or Sets WorkPhone /// - [JsonPropertyName("workPhone")] - public Phone WorkPhone { get { return this.WorkPhoneOption; } set { this.WorkPhoneOption = new Option(value); } } + [DataMember(Name = "workPhone", EmitDefaultValue = false)] + public Phone WorkPhone { get; set; } /// /// Returns the string presentation of the object @@ -240,146 +134,91 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CheckoutSessionThreeDS2RequestDataJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CheckoutSessionThreeDS2RequestData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option homePhone = default; - Option mobilePhone = default; - Option threeDSRequestorChallengeInd = default; - Option workPhone = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "homePhone": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - homePhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mobilePhone": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mobilePhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDSRequestorChallengeInd": - string threeDSRequestorChallengeIndRawValue = utf8JsonReader.GetString(); - if (threeDSRequestorChallengeIndRawValue != null) - threeDSRequestorChallengeInd = new Option(CheckoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumFromStringOrDefault(threeDSRequestorChallengeIndRawValue)); - break; - case "workPhone": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - workPhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (homePhone.IsSet && homePhone.Value == null) - throw new ArgumentNullException(nameof(homePhone), "Property is not nullable for class CheckoutSessionThreeDS2RequestData."); - - if (mobilePhone.IsSet && mobilePhone.Value == null) - throw new ArgumentNullException(nameof(mobilePhone), "Property is not nullable for class CheckoutSessionThreeDS2RequestData."); - - if (threeDSRequestorChallengeInd.IsSet && threeDSRequestorChallengeInd.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorChallengeInd), "Property is not nullable for class CheckoutSessionThreeDS2RequestData."); - - if (workPhone.IsSet && workPhone.Value == null) - throw new ArgumentNullException(nameof(workPhone), "Property is not nullable for class CheckoutSessionThreeDS2RequestData."); - - return new CheckoutSessionThreeDS2RequestData(homePhone, mobilePhone, threeDSRequestorChallengeInd, workPhone); + return this.Equals(input as CheckoutSessionThreeDS2RequestData); } /// - /// Serializes a + /// Returns true if CheckoutSessionThreeDS2RequestData instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutSessionThreeDS2RequestData checkoutSessionThreeDS2RequestData, JsonSerializerOptions jsonSerializerOptions) + /// Instance of CheckoutSessionThreeDS2RequestData to be compared + /// Boolean + public bool Equals(CheckoutSessionThreeDS2RequestData input) { - writer.WriteStartObject(); - - WriteProperties(writer, checkoutSessionThreeDS2RequestData, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.HomePhone == input.HomePhone || + (this.HomePhone != null && + this.HomePhone.Equals(input.HomePhone)) + ) && + ( + this.MobilePhone == input.MobilePhone || + (this.MobilePhone != null && + this.MobilePhone.Equals(input.MobilePhone)) + ) && + ( + this.ThreeDSRequestorChallengeInd == input.ThreeDSRequestorChallengeInd || + this.ThreeDSRequestorChallengeInd.Equals(input.ThreeDSRequestorChallengeInd) + ) && + ( + this.WorkPhone == input.WorkPhone || + (this.WorkPhone != null && + this.WorkPhone.Equals(input.WorkPhone)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutSessionThreeDS2RequestData checkoutSessionThreeDS2RequestData, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (checkoutSessionThreeDS2RequestData.HomePhoneOption.IsSet && checkoutSessionThreeDS2RequestData.HomePhone == null) - throw new ArgumentNullException(nameof(checkoutSessionThreeDS2RequestData.HomePhone), "Property is required for class CheckoutSessionThreeDS2RequestData."); - - if (checkoutSessionThreeDS2RequestData.MobilePhoneOption.IsSet && checkoutSessionThreeDS2RequestData.MobilePhone == null) - throw new ArgumentNullException(nameof(checkoutSessionThreeDS2RequestData.MobilePhone), "Property is required for class CheckoutSessionThreeDS2RequestData."); - - if (checkoutSessionThreeDS2RequestData.WorkPhoneOption.IsSet && checkoutSessionThreeDS2RequestData.WorkPhone == null) - throw new ArgumentNullException(nameof(checkoutSessionThreeDS2RequestData.WorkPhone), "Property is required for class CheckoutSessionThreeDS2RequestData."); - - if (checkoutSessionThreeDS2RequestData.HomePhoneOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("homePhone"); - JsonSerializer.Serialize(writer, checkoutSessionThreeDS2RequestData.HomePhone, jsonSerializerOptions); - } - if (checkoutSessionThreeDS2RequestData.MobilePhoneOption.IsSet) - { - writer.WritePropertyName("mobilePhone"); - JsonSerializer.Serialize(writer, checkoutSessionThreeDS2RequestData.MobilePhone, jsonSerializerOptions); - } - var threeDSRequestorChallengeIndRawValue = CheckoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumToJsonValue(checkoutSessionThreeDS2RequestData.ThreeDSRequestorChallengeIndOption.Value.Value); - writer.WriteString("threeDSRequestorChallengeInd", threeDSRequestorChallengeIndRawValue); - if (checkoutSessionThreeDS2RequestData.WorkPhoneOption.IsSet) - { - writer.WritePropertyName("workPhone"); - JsonSerializer.Serialize(writer, checkoutSessionThreeDS2RequestData.WorkPhone, jsonSerializerOptions); + int hashCode = 41; + if (this.HomePhone != null) + { + hashCode = (hashCode * 59) + this.HomePhone.GetHashCode(); + } + if (this.MobilePhone != null) + { + hashCode = (hashCode * 59) + this.MobilePhone.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ThreeDSRequestorChallengeInd.GetHashCode(); + if (this.WorkPhone != null) + { + hashCode = (hashCode * 59) + this.WorkPhone.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/CheckoutThreeDS2Action.cs b/Adyen/Model/Checkout/CheckoutThreeDS2Action.cs index cb5df61a3..562036df8 100644 --- a/Adyen/Model/Checkout/CheckoutThreeDS2Action.cs +++ b/Adyen/Model/Checkout/CheckoutThreeDS2Action.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,188 +15,112 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CheckoutThreeDS2Action /// - public partial class CheckoutThreeDS2Action : IValidatableObject + [DataContract(Name = "CheckoutThreeDS2Action")] + public partial class CheckoutThreeDS2Action : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// **threeDS2** - /// A token needed to authorise a payment. - /// Encoded payment data. - /// Specifies the payment method. - /// A subtype of the token. - /// A token to pass to the 3DS2 Component to get the fingerprint. - /// Specifies the URL to redirect to. - [JsonConstructor] - public CheckoutThreeDS2Action(TypeEnum type, Option authorisationToken = default, Option paymentData = default, Option paymentMethodType = default, Option subtype = default, Option token = default, Option url = default) - { - Type = type; - AuthorisationTokenOption = authorisationToken; - PaymentDataOption = paymentData; - PaymentMethodTypeOption = paymentMethodType; - SubtypeOption = subtype; - TokenOption = token; - UrlOption = url; - OnCreated(); - } - - partial void OnCreated(); - /// /// **threeDS2** /// /// **threeDS2** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum ThreeDS2 for value: threeDS2 /// + [EnumMember(Value = "threeDS2")] ThreeDS2 = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("threeDS2")) - return TypeEnum.ThreeDS2; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("threeDS2")) - return TypeEnum.ThreeDS2; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.ThreeDS2) - return "threeDS2"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **threeDS2** /// /// **threeDS2** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of AuthorisationToken + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthorisationTokenOption { get; private set; } - + [JsonConstructorAttribute] + protected CheckoutThreeDS2Action() { } /// - /// A token needed to authorise a payment. + /// Initializes a new instance of the class. /// - /// A token needed to authorise a payment. - [JsonPropertyName("authorisationToken")] - public string AuthorisationToken { get { return this.AuthorisationTokenOption; } set { this.AuthorisationTokenOption = new Option(value); } } + /// A token needed to authorise a payment.. + /// Encoded payment data.. + /// Specifies the payment method.. + /// A subtype of the token.. + /// A token to pass to the 3DS2 Component to get the fingerprint.. + /// **threeDS2** (required). + /// Specifies the URL to redirect to.. + public CheckoutThreeDS2Action(string authorisationToken = default(string), string paymentData = default(string), string paymentMethodType = default(string), string subtype = default(string), string token = default(string), TypeEnum type = default(TypeEnum), string url = default(string)) + { + this.Type = type; + this.AuthorisationToken = authorisationToken; + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.Subtype = subtype; + this.Token = token; + this.Url = url; + } /// - /// Used to track the state of PaymentData + /// A token needed to authorise a payment. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentDataOption { get; private set; } + /// A token needed to authorise a payment. + [DataMember(Name = "authorisationToken", EmitDefaultValue = false)] + public string AuthorisationToken { get; set; } /// /// Encoded payment data. /// /// Encoded payment data. - [JsonPropertyName("paymentData")] - public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } - - /// - /// Used to track the state of PaymentMethodType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodTypeOption { get; private set; } + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [JsonPropertyName("paymentMethodType")] - public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } - - /// - /// Used to track the state of Subtype - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubtypeOption { get; private set; } + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } /// /// A subtype of the token. /// /// A subtype of the token. - [JsonPropertyName("subtype")] - public string Subtype { get { return this.SubtypeOption; } set { this.SubtypeOption = new Option(value); } } - - /// - /// Used to track the state of Token - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TokenOption { get; private set; } + [DataMember(Name = "subtype", EmitDefaultValue = false)] + public string Subtype { get; set; } /// /// A token to pass to the 3DS2 Component to get the fingerprint. /// /// A token to pass to the 3DS2 Component to get the fingerprint. - [JsonPropertyName("token")] - public string Token { get { return this.TokenOption; } set { this.TokenOption = new Option(value); } } - - /// - /// Used to track the state of Url - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option UrlOption { get; private set; } + [DataMember(Name = "token", EmitDefaultValue = false)] + public string Token { get; set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [JsonPropertyName("url")] - public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; set; } /// /// Returns the string presentation of the object @@ -205,190 +130,130 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutThreeDS2Action {\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" AuthorisationToken: ").Append(AuthorisationToken).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); sb.Append(" Subtype: ").Append(Subtype).Append("\n"); sb.Append(" Token: ").Append(Token).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CheckoutThreeDS2ActionJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CheckoutThreeDS2Action Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option type = default; - Option authorisationToken = default; - Option paymentData = default; - Option paymentMethodType = default; - Option subtype = default; - Option token = default; - Option url = default; + return this.Equals(input as CheckoutThreeDS2Action); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if CheckoutThreeDS2Action instances are equal + /// + /// Instance of CheckoutThreeDS2Action to be compared + /// Boolean + public bool Equals(CheckoutThreeDS2Action input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(CheckoutThreeDS2Action.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "authorisationToken": - authorisationToken = new Option(utf8JsonReader.GetString()); - break; - case "paymentData": - paymentData = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethodType": - paymentMethodType = new Option(utf8JsonReader.GetString()); - break; - case "subtype": - subtype = new Option(utf8JsonReader.GetString()); - break; - case "token": - token = new Option(utf8JsonReader.GetString()); - break; - case "url": - url = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class CheckoutThreeDS2Action.", nameof(type)); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutThreeDS2Action."); - - if (authorisationToken.IsSet && authorisationToken.Value == null) - throw new ArgumentNullException(nameof(authorisationToken), "Property is not nullable for class CheckoutThreeDS2Action."); - - if (paymentData.IsSet && paymentData.Value == null) - throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class CheckoutThreeDS2Action."); - - if (paymentMethodType.IsSet && paymentMethodType.Value == null) - throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutThreeDS2Action."); - - if (subtype.IsSet && subtype.Value == null) - throw new ArgumentNullException(nameof(subtype), "Property is not nullable for class CheckoutThreeDS2Action."); - - if (token.IsSet && token.Value == null) - throw new ArgumentNullException(nameof(token), "Property is not nullable for class CheckoutThreeDS2Action."); - - if (url.IsSet && url.Value == null) - throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutThreeDS2Action."); - - return new CheckoutThreeDS2Action(type.Value.Value, authorisationToken, paymentData, paymentMethodType, subtype, token, url); + return + ( + this.AuthorisationToken == input.AuthorisationToken || + (this.AuthorisationToken != null && + this.AuthorisationToken.Equals(input.AuthorisationToken)) + ) && + ( + this.PaymentData == input.PaymentData || + (this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData)) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + (this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType)) + ) && + ( + this.Subtype == input.Subtype || + (this.Subtype != null && + this.Subtype.Equals(input.Subtype)) + ) && + ( + this.Token == input.Token || + (this.Token != null && + this.Token.Equals(input.Token)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutThreeDS2Action checkoutThreeDS2Action, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, checkoutThreeDS2Action, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AuthorisationToken != null) + { + hashCode = (hashCode * 59) + this.AuthorisationToken.GetHashCode(); + } + if (this.PaymentData != null) + { + hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); + } + if (this.PaymentMethodType != null) + { + hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); + } + if (this.Subtype != null) + { + hashCode = (hashCode * 59) + this.Subtype.GetHashCode(); + } + if (this.Token != null) + { + hashCode = (hashCode * 59) + this.Token.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.Url != null) + { + hashCode = (hashCode * 59) + this.Url.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutThreeDS2Action checkoutThreeDS2Action, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (checkoutThreeDS2Action.AuthorisationTokenOption.IsSet && checkoutThreeDS2Action.AuthorisationToken == null) - throw new ArgumentNullException(nameof(checkoutThreeDS2Action.AuthorisationToken), "Property is required for class CheckoutThreeDS2Action."); - - if (checkoutThreeDS2Action.PaymentDataOption.IsSet && checkoutThreeDS2Action.PaymentData == null) - throw new ArgumentNullException(nameof(checkoutThreeDS2Action.PaymentData), "Property is required for class CheckoutThreeDS2Action."); - - if (checkoutThreeDS2Action.PaymentMethodTypeOption.IsSet && checkoutThreeDS2Action.PaymentMethodType == null) - throw new ArgumentNullException(nameof(checkoutThreeDS2Action.PaymentMethodType), "Property is required for class CheckoutThreeDS2Action."); - - if (checkoutThreeDS2Action.SubtypeOption.IsSet && checkoutThreeDS2Action.Subtype == null) - throw new ArgumentNullException(nameof(checkoutThreeDS2Action.Subtype), "Property is required for class CheckoutThreeDS2Action."); - - if (checkoutThreeDS2Action.TokenOption.IsSet && checkoutThreeDS2Action.Token == null) - throw new ArgumentNullException(nameof(checkoutThreeDS2Action.Token), "Property is required for class CheckoutThreeDS2Action."); - - if (checkoutThreeDS2Action.UrlOption.IsSet && checkoutThreeDS2Action.Url == null) - throw new ArgumentNullException(nameof(checkoutThreeDS2Action.Url), "Property is required for class CheckoutThreeDS2Action."); - - var typeRawValue = CheckoutThreeDS2Action.TypeEnumToJsonValue(checkoutThreeDS2Action.Type); - writer.WriteString("type", typeRawValue); - if (checkoutThreeDS2Action.AuthorisationTokenOption.IsSet) - writer.WriteString("authorisationToken", checkoutThreeDS2Action.AuthorisationToken); - - if (checkoutThreeDS2Action.PaymentDataOption.IsSet) - writer.WriteString("paymentData", checkoutThreeDS2Action.PaymentData); - - if (checkoutThreeDS2Action.PaymentMethodTypeOption.IsSet) - writer.WriteString("paymentMethodType", checkoutThreeDS2Action.PaymentMethodType); - - if (checkoutThreeDS2Action.SubtypeOption.IsSet) - writer.WriteString("subtype", checkoutThreeDS2Action.Subtype); - - if (checkoutThreeDS2Action.TokenOption.IsSet) - writer.WriteString("token", checkoutThreeDS2Action.Token); - - if (checkoutThreeDS2Action.UrlOption.IsSet) - writer.WriteString("url", checkoutThreeDS2Action.Url); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CheckoutVoucherAction.cs b/Adyen/Model/Checkout/CheckoutVoucherAction.cs index 8381003d1..891756064 100644 --- a/Adyen/Model/Checkout/CheckoutVoucherAction.cs +++ b/Adyen/Model/Checkout/CheckoutVoucherAction.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,409 +15,235 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CheckoutVoucherAction /// - public partial class CheckoutVoucherAction : IValidatableObject + [DataContract(Name = "CheckoutVoucherAction")] + public partial class CheckoutVoucherAction : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// **voucher** - /// The voucher alternative reference code. - /// A collection institution number (store number) for Econtext Pay-Easy ATM. - /// The URL to download the voucher. - /// An entity number of Multibanco. - /// The date time of the voucher expiry. - /// initialAmount - /// The URL to the detailed instructions to make payment using the voucher. - /// The issuer of the voucher. - /// The shopper telephone number (partially masked). - /// The merchant name. - /// The merchant reference. - /// A Base64-encoded token containing all properties of the voucher. For iOS, you can use this to pass a voucher to Apple Wallet. - /// Encoded payment data. - /// Specifies the payment method. - /// The voucher reference code. - /// The shopper email. - /// The shopper name. - /// surcharge - /// totalAmount - /// Specifies the URL to redirect to. - [JsonConstructor] - public CheckoutVoucherAction(TypeEnum type, Option alternativeReference = default, Option collectionInstitutionNumber = default, Option downloadUrl = default, Option entity = default, Option expiresAt = default, Option initialAmount = default, Option instructionsUrl = default, Option issuer = default, Option maskedTelephoneNumber = default, Option merchantName = default, Option merchantReference = default, Option passCreationToken = default, Option paymentData = default, Option paymentMethodType = default, Option reference = default, Option shopperEmail = default, Option shopperName = default, Option surcharge = default, Option totalAmount = default, Option url = default) - { - Type = type; - AlternativeReferenceOption = alternativeReference; - CollectionInstitutionNumberOption = collectionInstitutionNumber; - DownloadUrlOption = downloadUrl; - EntityOption = entity; - ExpiresAtOption = expiresAt; - InitialAmountOption = initialAmount; - InstructionsUrlOption = instructionsUrl; - IssuerOption = issuer; - MaskedTelephoneNumberOption = maskedTelephoneNumber; - MerchantNameOption = merchantName; - MerchantReferenceOption = merchantReference; - PassCreationTokenOption = passCreationToken; - PaymentDataOption = paymentData; - PaymentMethodTypeOption = paymentMethodType; - ReferenceOption = reference; - ShopperEmailOption = shopperEmail; - ShopperNameOption = shopperName; - SurchargeOption = surcharge; - TotalAmountOption = totalAmount; - UrlOption = url; - OnCreated(); - } - - partial void OnCreated(); - /// /// **voucher** /// /// **voucher** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Voucher for value: voucher /// + [EnumMember(Value = "voucher")] Voucher = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("voucher")) - return TypeEnum.Voucher; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("voucher")) - return TypeEnum.Voucher; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.Voucher) - return "voucher"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **voucher** /// /// **voucher** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of AlternativeReference + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AlternativeReferenceOption { get; private set; } - + [JsonConstructorAttribute] + protected CheckoutVoucherAction() { } /// - /// The voucher alternative reference code. + /// Initializes a new instance of the class. /// - /// The voucher alternative reference code. - [JsonPropertyName("alternativeReference")] - public string AlternativeReference { get { return this.AlternativeReferenceOption; } set { this.AlternativeReferenceOption = new Option(value); } } + /// The voucher alternative reference code.. + /// A collection institution number (store number) for Econtext Pay-Easy ATM.. + /// The URL to download the voucher.. + /// An entity number of Multibanco.. + /// The date time of the voucher expiry.. + /// initialAmount. + /// The URL to the detailed instructions to make payment using the voucher.. + /// The issuer of the voucher.. + /// The shopper telephone number (partially masked).. + /// The merchant name.. + /// The merchant reference.. + /// A Base64-encoded token containing all properties of the voucher. For iOS, you can use this to pass a voucher to Apple Wallet.. + /// Encoded payment data.. + /// Specifies the payment method.. + /// The voucher reference code.. + /// The shopper email.. + /// The shopper name.. + /// surcharge. + /// totalAmount. + /// **voucher** (required). + /// Specifies the URL to redirect to.. + public CheckoutVoucherAction(string alternativeReference = default(string), string collectionInstitutionNumber = default(string), string downloadUrl = default(string), string entity = default(string), string expiresAt = default(string), Amount initialAmount = default(Amount), string instructionsUrl = default(string), string issuer = default(string), string maskedTelephoneNumber = default(string), string merchantName = default(string), string merchantReference = default(string), string passCreationToken = default(string), string paymentData = default(string), string paymentMethodType = default(string), string reference = default(string), string shopperEmail = default(string), string shopperName = default(string), Amount surcharge = default(Amount), Amount totalAmount = default(Amount), TypeEnum type = default(TypeEnum), string url = default(string)) + { + this.Type = type; + this.AlternativeReference = alternativeReference; + this.CollectionInstitutionNumber = collectionInstitutionNumber; + this.DownloadUrl = downloadUrl; + this.Entity = entity; + this.ExpiresAt = expiresAt; + this.InitialAmount = initialAmount; + this.InstructionsUrl = instructionsUrl; + this.Issuer = issuer; + this.MaskedTelephoneNumber = maskedTelephoneNumber; + this.MerchantName = merchantName; + this.MerchantReference = merchantReference; + this.PassCreationToken = passCreationToken; + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.Reference = reference; + this.ShopperEmail = shopperEmail; + this.ShopperName = shopperName; + this.Surcharge = surcharge; + this.TotalAmount = totalAmount; + this.Url = url; + } /// - /// Used to track the state of CollectionInstitutionNumber + /// The voucher alternative reference code. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CollectionInstitutionNumberOption { get; private set; } + /// The voucher alternative reference code. + [DataMember(Name = "alternativeReference", EmitDefaultValue = false)] + public string AlternativeReference { get; set; } /// /// A collection institution number (store number) for Econtext Pay-Easy ATM. /// /// A collection institution number (store number) for Econtext Pay-Easy ATM. - [JsonPropertyName("collectionInstitutionNumber")] - public string CollectionInstitutionNumber { get { return this.CollectionInstitutionNumberOption; } set { this.CollectionInstitutionNumberOption = new Option(value); } } - - /// - /// Used to track the state of DownloadUrl - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DownloadUrlOption { get; private set; } + [DataMember(Name = "collectionInstitutionNumber", EmitDefaultValue = false)] + public string CollectionInstitutionNumber { get; set; } /// /// The URL to download the voucher. /// /// The URL to download the voucher. - [JsonPropertyName("downloadUrl")] - public string DownloadUrl { get { return this.DownloadUrlOption; } set { this.DownloadUrlOption = new Option(value); } } - - /// - /// Used to track the state of Entity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EntityOption { get; private set; } + [DataMember(Name = "downloadUrl", EmitDefaultValue = false)] + public string DownloadUrl { get; set; } /// /// An entity number of Multibanco. /// /// An entity number of Multibanco. - [JsonPropertyName("entity")] - public string Entity { get { return this.EntityOption; } set { this.EntityOption = new Option(value); } } - - /// - /// Used to track the state of ExpiresAt - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiresAtOption { get; private set; } + [DataMember(Name = "entity", EmitDefaultValue = false)] + public string Entity { get; set; } /// /// The date time of the voucher expiry. /// /// The date time of the voucher expiry. - [JsonPropertyName("expiresAt")] - public string ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } - - /// - /// Used to track the state of InitialAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InitialAmountOption { get; private set; } + [DataMember(Name = "expiresAt", EmitDefaultValue = false)] + public string ExpiresAt { get; set; } /// /// Gets or Sets InitialAmount /// - [JsonPropertyName("initialAmount")] - public Amount InitialAmount { get { return this.InitialAmountOption; } set { this.InitialAmountOption = new Option(value); } } - - /// - /// Used to track the state of InstructionsUrl - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstructionsUrlOption { get; private set; } + [DataMember(Name = "initialAmount", EmitDefaultValue = false)] + public Amount InitialAmount { get; set; } /// /// The URL to the detailed instructions to make payment using the voucher. /// /// The URL to the detailed instructions to make payment using the voucher. - [JsonPropertyName("instructionsUrl")] - public string InstructionsUrl { get { return this.InstructionsUrlOption; } set { this.InstructionsUrlOption = new Option(value); } } - - /// - /// Used to track the state of Issuer - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IssuerOption { get; private set; } + [DataMember(Name = "instructionsUrl", EmitDefaultValue = false)] + public string InstructionsUrl { get; set; } /// /// The issuer of the voucher. /// /// The issuer of the voucher. - [JsonPropertyName("issuer")] - public string Issuer { get { return this.IssuerOption; } set { this.IssuerOption = new Option(value); } } - - /// - /// Used to track the state of MaskedTelephoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MaskedTelephoneNumberOption { get; private set; } + [DataMember(Name = "issuer", EmitDefaultValue = false)] + public string Issuer { get; set; } /// /// The shopper telephone number (partially masked). /// /// The shopper telephone number (partially masked). - [JsonPropertyName("maskedTelephoneNumber")] - public string MaskedTelephoneNumber { get { return this.MaskedTelephoneNumberOption; } set { this.MaskedTelephoneNumberOption = new Option(value); } } - - /// - /// Used to track the state of MerchantName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantNameOption { get; private set; } + [DataMember(Name = "maskedTelephoneNumber", EmitDefaultValue = false)] + public string MaskedTelephoneNumber { get; set; } /// /// The merchant name. /// /// The merchant name. - [JsonPropertyName("merchantName")] - public string MerchantName { get { return this.MerchantNameOption; } set { this.MerchantNameOption = new Option(value); } } - - /// - /// Used to track the state of MerchantReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantReferenceOption { get; private set; } + [DataMember(Name = "merchantName", EmitDefaultValue = false)] + public string MerchantName { get; set; } /// /// The merchant reference. /// /// The merchant reference. - [JsonPropertyName("merchantReference")] - public string MerchantReference { get { return this.MerchantReferenceOption; } set { this.MerchantReferenceOption = new Option(value); } } - - /// - /// Used to track the state of PassCreationToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PassCreationTokenOption { get; private set; } + [DataMember(Name = "merchantReference", EmitDefaultValue = false)] + public string MerchantReference { get; set; } /// /// A Base64-encoded token containing all properties of the voucher. For iOS, you can use this to pass a voucher to Apple Wallet. /// /// A Base64-encoded token containing all properties of the voucher. For iOS, you can use this to pass a voucher to Apple Wallet. - [JsonPropertyName("passCreationToken")] - public string PassCreationToken { get { return this.PassCreationTokenOption; } set { this.PassCreationTokenOption = new Option(value); } } - - /// - /// Used to track the state of PaymentData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentDataOption { get; private set; } + [DataMember(Name = "passCreationToken", EmitDefaultValue = false)] + public string PassCreationToken { get; set; } /// /// Encoded payment data. /// /// Encoded payment data. - [JsonPropertyName("paymentData")] - public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } - - /// - /// Used to track the state of PaymentMethodType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodTypeOption { get; private set; } + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } /// /// Specifies the payment method. /// /// Specifies the payment method. - [JsonPropertyName("paymentMethodType")] - public string PaymentMethodType { get { return this.PaymentMethodTypeOption; } set { this.PaymentMethodTypeOption = new Option(value); } } - - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } /// /// The voucher reference code. /// /// The voucher reference code. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// The shopper email. /// /// The shopper email. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } - - /// - /// Used to track the state of ShopperName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNameOption { get; private set; } + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// /// The shopper name. /// /// The shopper name. - [JsonPropertyName("shopperName")] - public string ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } - - /// - /// Used to track the state of Surcharge - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SurchargeOption { get; private set; } + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public string ShopperName { get; set; } /// /// Gets or Sets Surcharge /// - [JsonPropertyName("surcharge")] - public Amount Surcharge { get { return this.SurchargeOption; } set { this.SurchargeOption = new Option(value); } } - - /// - /// Used to track the state of TotalAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TotalAmountOption { get; private set; } + [DataMember(Name = "surcharge", EmitDefaultValue = false)] + public Amount Surcharge { get; set; } /// /// Gets or Sets TotalAmount /// - [JsonPropertyName("totalAmount")] - public Amount TotalAmount { get { return this.TotalAmountOption; } set { this.TotalAmountOption = new Option(value); } } - - /// - /// Used to track the state of Url - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option UrlOption { get; private set; } + [DataMember(Name = "totalAmount", EmitDefaultValue = false)] + public Amount TotalAmount { get; set; } /// /// Specifies the URL to redirect to. /// /// Specifies the URL to redirect to. - [JsonPropertyName("url")] - public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; set; } /// /// Returns the string presentation of the object @@ -426,7 +253,6 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CheckoutVoucherAction {\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" AlternativeReference: ").Append(AlternativeReference).Append("\n"); sb.Append(" CollectionInstitutionNumber: ").Append(CollectionInstitutionNumber).Append("\n"); sb.Append(" DownloadUrl: ").Append(DownloadUrl).Append("\n"); @@ -446,375 +272,251 @@ public override string ToString() sb.Append(" ShopperName: ").Append(ShopperName).Append("\n"); sb.Append(" Surcharge: ").Append(Surcharge).Append("\n"); sb.Append(" TotalAmount: ").Append(TotalAmount).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CheckoutVoucherActionJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CheckoutVoucherAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option type = default; - Option alternativeReference = default; - Option collectionInstitutionNumber = default; - Option downloadUrl = default; - Option entity = default; - Option expiresAt = default; - Option initialAmount = default; - Option instructionsUrl = default; - Option issuer = default; - Option maskedTelephoneNumber = default; - Option merchantName = default; - Option merchantReference = default; - Option passCreationToken = default; - Option paymentData = default; - Option paymentMethodType = default; - Option reference = default; - Option shopperEmail = default; - Option shopperName = default; - Option surcharge = default; - Option totalAmount = default; - Option url = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(CheckoutVoucherAction.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "alternativeReference": - alternativeReference = new Option(utf8JsonReader.GetString()); - break; - case "collectionInstitutionNumber": - collectionInstitutionNumber = new Option(utf8JsonReader.GetString()); - break; - case "downloadUrl": - downloadUrl = new Option(utf8JsonReader.GetString()); - break; - case "entity": - entity = new Option(utf8JsonReader.GetString()); - break; - case "expiresAt": - expiresAt = new Option(utf8JsonReader.GetString()); - break; - case "initialAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - initialAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "instructionsUrl": - instructionsUrl = new Option(utf8JsonReader.GetString()); - break; - case "issuer": - issuer = new Option(utf8JsonReader.GetString()); - break; - case "maskedTelephoneNumber": - maskedTelephoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "merchantName": - merchantName = new Option(utf8JsonReader.GetString()); - break; - case "merchantReference": - merchantReference = new Option(utf8JsonReader.GetString()); - break; - case "passCreationToken": - passCreationToken = new Option(utf8JsonReader.GetString()); - break; - case "paymentData": - paymentData = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethodType": - paymentMethodType = new Option(utf8JsonReader.GetString()); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "shopperName": - shopperName = new Option(utf8JsonReader.GetString()); - break; - case "surcharge": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - surcharge = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "totalAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - totalAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "url": - url = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class CheckoutVoucherAction.", nameof(type)); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class CheckoutVoucherAction."); - - if (alternativeReference.IsSet && alternativeReference.Value == null) - throw new ArgumentNullException(nameof(alternativeReference), "Property is not nullable for class CheckoutVoucherAction."); - - if (collectionInstitutionNumber.IsSet && collectionInstitutionNumber.Value == null) - throw new ArgumentNullException(nameof(collectionInstitutionNumber), "Property is not nullable for class CheckoutVoucherAction."); - - if (downloadUrl.IsSet && downloadUrl.Value == null) - throw new ArgumentNullException(nameof(downloadUrl), "Property is not nullable for class CheckoutVoucherAction."); - - if (entity.IsSet && entity.Value == null) - throw new ArgumentNullException(nameof(entity), "Property is not nullable for class CheckoutVoucherAction."); - - if (expiresAt.IsSet && expiresAt.Value == null) - throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CheckoutVoucherAction."); - - if (initialAmount.IsSet && initialAmount.Value == null) - throw new ArgumentNullException(nameof(initialAmount), "Property is not nullable for class CheckoutVoucherAction."); - - if (instructionsUrl.IsSet && instructionsUrl.Value == null) - throw new ArgumentNullException(nameof(instructionsUrl), "Property is not nullable for class CheckoutVoucherAction."); - - if (issuer.IsSet && issuer.Value == null) - throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class CheckoutVoucherAction."); - - if (maskedTelephoneNumber.IsSet && maskedTelephoneNumber.Value == null) - throw new ArgumentNullException(nameof(maskedTelephoneNumber), "Property is not nullable for class CheckoutVoucherAction."); - - if (merchantName.IsSet && merchantName.Value == null) - throw new ArgumentNullException(nameof(merchantName), "Property is not nullable for class CheckoutVoucherAction."); - - if (merchantReference.IsSet && merchantReference.Value == null) - throw new ArgumentNullException(nameof(merchantReference), "Property is not nullable for class CheckoutVoucherAction."); - - if (passCreationToken.IsSet && passCreationToken.Value == null) - throw new ArgumentNullException(nameof(passCreationToken), "Property is not nullable for class CheckoutVoucherAction."); - - if (paymentData.IsSet && paymentData.Value == null) - throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class CheckoutVoucherAction."); - - if (paymentMethodType.IsSet && paymentMethodType.Value == null) - throw new ArgumentNullException(nameof(paymentMethodType), "Property is not nullable for class CheckoutVoucherAction."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CheckoutVoucherAction."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class CheckoutVoucherAction."); - - if (shopperName.IsSet && shopperName.Value == null) - throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class CheckoutVoucherAction."); - - if (surcharge.IsSet && surcharge.Value == null) - throw new ArgumentNullException(nameof(surcharge), "Property is not nullable for class CheckoutVoucherAction."); - - if (totalAmount.IsSet && totalAmount.Value == null) - throw new ArgumentNullException(nameof(totalAmount), "Property is not nullable for class CheckoutVoucherAction."); - - if (url.IsSet && url.Value == null) - throw new ArgumentNullException(nameof(url), "Property is not nullable for class CheckoutVoucherAction."); - - return new CheckoutVoucherAction(type.Value.Value, alternativeReference, collectionInstitutionNumber, downloadUrl, entity, expiresAt, initialAmount, instructionsUrl, issuer, maskedTelephoneNumber, merchantName, merchantReference, passCreationToken, paymentData, paymentMethodType, reference, shopperEmail, shopperName, surcharge, totalAmount, url); + return this.Equals(input as CheckoutVoucherAction); } /// - /// Serializes a + /// Returns true if CheckoutVoucherAction instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CheckoutVoucherAction checkoutVoucherAction, JsonSerializerOptions jsonSerializerOptions) + /// Instance of CheckoutVoucherAction to be compared + /// Boolean + public bool Equals(CheckoutVoucherAction input) { - writer.WriteStartObject(); - - WriteProperties(writer, checkoutVoucherAction, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AlternativeReference == input.AlternativeReference || + (this.AlternativeReference != null && + this.AlternativeReference.Equals(input.AlternativeReference)) + ) && + ( + this.CollectionInstitutionNumber == input.CollectionInstitutionNumber || + (this.CollectionInstitutionNumber != null && + this.CollectionInstitutionNumber.Equals(input.CollectionInstitutionNumber)) + ) && + ( + this.DownloadUrl == input.DownloadUrl || + (this.DownloadUrl != null && + this.DownloadUrl.Equals(input.DownloadUrl)) + ) && + ( + this.Entity == input.Entity || + (this.Entity != null && + this.Entity.Equals(input.Entity)) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) + ) && + ( + this.InitialAmount == input.InitialAmount || + (this.InitialAmount != null && + this.InitialAmount.Equals(input.InitialAmount)) + ) && + ( + this.InstructionsUrl == input.InstructionsUrl || + (this.InstructionsUrl != null && + this.InstructionsUrl.Equals(input.InstructionsUrl)) + ) && + ( + this.Issuer == input.Issuer || + (this.Issuer != null && + this.Issuer.Equals(input.Issuer)) + ) && + ( + this.MaskedTelephoneNumber == input.MaskedTelephoneNumber || + (this.MaskedTelephoneNumber != null && + this.MaskedTelephoneNumber.Equals(input.MaskedTelephoneNumber)) + ) && + ( + this.MerchantName == input.MerchantName || + (this.MerchantName != null && + this.MerchantName.Equals(input.MerchantName)) + ) && + ( + this.MerchantReference == input.MerchantReference || + (this.MerchantReference != null && + this.MerchantReference.Equals(input.MerchantReference)) + ) && + ( + this.PassCreationToken == input.PassCreationToken || + (this.PassCreationToken != null && + this.PassCreationToken.Equals(input.PassCreationToken)) + ) && + ( + this.PaymentData == input.PaymentData || + (this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData)) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + (this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.ShopperName == input.ShopperName || + (this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName)) + ) && + ( + this.Surcharge == input.Surcharge || + (this.Surcharge != null && + this.Surcharge.Equals(input.Surcharge)) + ) && + ( + this.TotalAmount == input.TotalAmount || + (this.TotalAmount != null && + this.TotalAmount.Equals(input.TotalAmount)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CheckoutVoucherAction checkoutVoucherAction, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (checkoutVoucherAction.AlternativeReferenceOption.IsSet && checkoutVoucherAction.AlternativeReference == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.AlternativeReference), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.CollectionInstitutionNumberOption.IsSet && checkoutVoucherAction.CollectionInstitutionNumber == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.CollectionInstitutionNumber), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.DownloadUrlOption.IsSet && checkoutVoucherAction.DownloadUrl == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.DownloadUrl), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.EntityOption.IsSet && checkoutVoucherAction.Entity == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.Entity), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.ExpiresAtOption.IsSet && checkoutVoucherAction.ExpiresAt == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.ExpiresAt), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.InitialAmountOption.IsSet && checkoutVoucherAction.InitialAmount == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.InitialAmount), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.InstructionsUrlOption.IsSet && checkoutVoucherAction.InstructionsUrl == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.InstructionsUrl), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.IssuerOption.IsSet && checkoutVoucherAction.Issuer == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.Issuer), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.MaskedTelephoneNumberOption.IsSet && checkoutVoucherAction.MaskedTelephoneNumber == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.MaskedTelephoneNumber), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.MerchantNameOption.IsSet && checkoutVoucherAction.MerchantName == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.MerchantName), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.MerchantReferenceOption.IsSet && checkoutVoucherAction.MerchantReference == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.MerchantReference), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.PassCreationTokenOption.IsSet && checkoutVoucherAction.PassCreationToken == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.PassCreationToken), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.PaymentDataOption.IsSet && checkoutVoucherAction.PaymentData == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.PaymentData), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.PaymentMethodTypeOption.IsSet && checkoutVoucherAction.PaymentMethodType == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.PaymentMethodType), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.ReferenceOption.IsSet && checkoutVoucherAction.Reference == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.Reference), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.ShopperEmailOption.IsSet && checkoutVoucherAction.ShopperEmail == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.ShopperEmail), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.ShopperNameOption.IsSet && checkoutVoucherAction.ShopperName == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.ShopperName), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.SurchargeOption.IsSet && checkoutVoucherAction.Surcharge == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.Surcharge), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.TotalAmountOption.IsSet && checkoutVoucherAction.TotalAmount == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.TotalAmount), "Property is required for class CheckoutVoucherAction."); - - if (checkoutVoucherAction.UrlOption.IsSet && checkoutVoucherAction.Url == null) - throw new ArgumentNullException(nameof(checkoutVoucherAction.Url), "Property is required for class CheckoutVoucherAction."); - - var typeRawValue = CheckoutVoucherAction.TypeEnumToJsonValue(checkoutVoucherAction.Type); - writer.WriteString("type", typeRawValue); - if (checkoutVoucherAction.AlternativeReferenceOption.IsSet) - writer.WriteString("alternativeReference", checkoutVoucherAction.AlternativeReference); - - if (checkoutVoucherAction.CollectionInstitutionNumberOption.IsSet) - writer.WriteString("collectionInstitutionNumber", checkoutVoucherAction.CollectionInstitutionNumber); - - if (checkoutVoucherAction.DownloadUrlOption.IsSet) - writer.WriteString("downloadUrl", checkoutVoucherAction.DownloadUrl); - - if (checkoutVoucherAction.EntityOption.IsSet) - writer.WriteString("entity", checkoutVoucherAction.Entity); - - if (checkoutVoucherAction.ExpiresAtOption.IsSet) - writer.WriteString("expiresAt", checkoutVoucherAction.ExpiresAt); - - if (checkoutVoucherAction.InitialAmountOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("initialAmount"); - JsonSerializer.Serialize(writer, checkoutVoucherAction.InitialAmount, jsonSerializerOptions); - } - if (checkoutVoucherAction.InstructionsUrlOption.IsSet) - writer.WriteString("instructionsUrl", checkoutVoucherAction.InstructionsUrl); - - if (checkoutVoucherAction.IssuerOption.IsSet) - writer.WriteString("issuer", checkoutVoucherAction.Issuer); - - if (checkoutVoucherAction.MaskedTelephoneNumberOption.IsSet) - writer.WriteString("maskedTelephoneNumber", checkoutVoucherAction.MaskedTelephoneNumber); - - if (checkoutVoucherAction.MerchantNameOption.IsSet) - writer.WriteString("merchantName", checkoutVoucherAction.MerchantName); - - if (checkoutVoucherAction.MerchantReferenceOption.IsSet) - writer.WriteString("merchantReference", checkoutVoucherAction.MerchantReference); - - if (checkoutVoucherAction.PassCreationTokenOption.IsSet) - writer.WriteString("passCreationToken", checkoutVoucherAction.PassCreationToken); - - if (checkoutVoucherAction.PaymentDataOption.IsSet) - writer.WriteString("paymentData", checkoutVoucherAction.PaymentData); - - if (checkoutVoucherAction.PaymentMethodTypeOption.IsSet) - writer.WriteString("paymentMethodType", checkoutVoucherAction.PaymentMethodType); - - if (checkoutVoucherAction.ReferenceOption.IsSet) - writer.WriteString("reference", checkoutVoucherAction.Reference); - - if (checkoutVoucherAction.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", checkoutVoucherAction.ShopperEmail); - - if (checkoutVoucherAction.ShopperNameOption.IsSet) - writer.WriteString("shopperName", checkoutVoucherAction.ShopperName); - - if (checkoutVoucherAction.SurchargeOption.IsSet) - { - writer.WritePropertyName("surcharge"); - JsonSerializer.Serialize(writer, checkoutVoucherAction.Surcharge, jsonSerializerOptions); - } - if (checkoutVoucherAction.TotalAmountOption.IsSet) - { - writer.WritePropertyName("totalAmount"); - JsonSerializer.Serialize(writer, checkoutVoucherAction.TotalAmount, jsonSerializerOptions); + int hashCode = 41; + if (this.AlternativeReference != null) + { + hashCode = (hashCode * 59) + this.AlternativeReference.GetHashCode(); + } + if (this.CollectionInstitutionNumber != null) + { + hashCode = (hashCode * 59) + this.CollectionInstitutionNumber.GetHashCode(); + } + if (this.DownloadUrl != null) + { + hashCode = (hashCode * 59) + this.DownloadUrl.GetHashCode(); + } + if (this.Entity != null) + { + hashCode = (hashCode * 59) + this.Entity.GetHashCode(); + } + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } + if (this.InitialAmount != null) + { + hashCode = (hashCode * 59) + this.InitialAmount.GetHashCode(); + } + if (this.InstructionsUrl != null) + { + hashCode = (hashCode * 59) + this.InstructionsUrl.GetHashCode(); + } + if (this.Issuer != null) + { + hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); + } + if (this.MaskedTelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.MaskedTelephoneNumber.GetHashCode(); + } + if (this.MerchantName != null) + { + hashCode = (hashCode * 59) + this.MerchantName.GetHashCode(); + } + if (this.MerchantReference != null) + { + hashCode = (hashCode * 59) + this.MerchantReference.GetHashCode(); + } + if (this.PassCreationToken != null) + { + hashCode = (hashCode * 59) + this.PassCreationToken.GetHashCode(); + } + if (this.PaymentData != null) + { + hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); + } + if (this.PaymentMethodType != null) + { + hashCode = (hashCode * 59) + this.PaymentMethodType.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.ShopperName != null) + { + hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); + } + if (this.Surcharge != null) + { + hashCode = (hashCode * 59) + this.Surcharge.GetHashCode(); + } + if (this.TotalAmount != null) + { + hashCode = (hashCode * 59) + this.TotalAmount.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.Url != null) + { + hashCode = (hashCode * 59) + this.Url.GetHashCode(); + } + return hashCode; } - if (checkoutVoucherAction.UrlOption.IsSet) - writer.WriteString("url", checkoutVoucherAction.Url); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/CommonField.cs b/Adyen/Model/Checkout/CommonField.cs index 194aafd83..3176cf6c8 100644 --- a/Adyen/Model/Checkout/CommonField.cs +++ b/Adyen/Model/Checkout/CommonField.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,62 +15,47 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CommonField /// - public partial class CommonField : IValidatableObject + [DataContract(Name = "CommonField")] + public partial class CommonField : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Name of the field. For example, Name of External Platform. - /// Version of the field. For example, Version of External Platform. - [JsonConstructor] - public CommonField(Option name = default, Option varVersion = default) + /// Name of the field. For example, Name of External Platform.. + /// Version of the field. For example, Version of External Platform.. + public CommonField(string name = default(string), string version = default(string)) { - NameOption = name; - VarVersionOption = varVersion; - OnCreated(); + this.Name = name; + this.Version = version; } - partial void OnCreated(); - - /// - /// Used to track the state of Name - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NameOption { get; private set; } - /// /// Name of the field. For example, Name of External Platform. /// /// Name of the field. For example, Name of External Platform. - [JsonPropertyName("name")] - public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } - - /// - /// Used to track the state of VarVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option VarVersionOption { get; private set; } + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } /// /// Version of the field. For example, Version of External Platform. /// /// Version of the field. For example, Version of External Platform. - [JsonPropertyName("version")] - public string VarVersion { get { return this.VarVersionOption; } set { this.VarVersionOption = new Option(value); } } + [DataMember(Name = "version", EmitDefaultValue = false)] + public string Version { get; set; } /// /// Returns the string presentation of the object @@ -80,118 +66,83 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class CommonField {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" VarVersion: ").Append(VarVersion).Append("\n"); + sb.Append(" Version: ").Append(Version).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CommonFieldJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CommonField Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option name = default; - Option varVersion = default; + return this.Equals(input as CommonField); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if CommonField instances are equal + /// + /// Instance of CommonField to be compared + /// Boolean + public bool Equals(CommonField input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - case "version": - varVersion = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class CommonField."); - - if (varVersion.IsSet && varVersion.Value == null) - throw new ArgumentNullException(nameof(varVersion), "Property is not nullable for class CommonField."); - - return new CommonField(name, varVersion); + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Version == input.Version || + (this.Version != null && + this.Version.Equals(input.Version)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CommonField commonField, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, commonField, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.Version != null) + { + hashCode = (hashCode * 59) + this.Version.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CommonField commonField, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (commonField.NameOption.IsSet && commonField.Name == null) - throw new ArgumentNullException(nameof(commonField.Name), "Property is required for class CommonField."); - - if (commonField.VarVersionOption.IsSet && commonField.VarVersion == null) - throw new ArgumentNullException(nameof(commonField.VarVersion), "Property is required for class CommonField."); - - if (commonField.NameOption.IsSet) - writer.WriteString("name", commonField.Name); - - if (commonField.VarVersionOption.IsSet) - writer.WriteString("version", commonField.VarVersion); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Company.cs b/Adyen/Model/Checkout/Company.cs index 1c4f1faba..2dd3fbb1c 100644 --- a/Adyen/Model/Checkout/Company.cs +++ b/Adyen/Model/Checkout/Company.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,126 +15,83 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Company /// - public partial class Company : IValidatableObject + [DataContract(Name = "Company")] + public partial class Company : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The company website's home page. - /// The company name. - /// Registration number of the company. - /// Registry location of the company. - /// Tax ID of the company. - /// The company type. - [JsonConstructor] - public Company(Option homepage = default, Option name = default, Option registrationNumber = default, Option registryLocation = default, Option taxId = default, Option type = default) + /// The company website's home page.. + /// The company name.. + /// Registration number of the company.. + /// Registry location of the company.. + /// Tax ID of the company.. + /// The company type.. + public Company(string homepage = default(string), string name = default(string), string registrationNumber = default(string), string registryLocation = default(string), string taxId = default(string), string type = default(string)) { - HomepageOption = homepage; - NameOption = name; - RegistrationNumberOption = registrationNumber; - RegistryLocationOption = registryLocation; - TaxIdOption = taxId; - TypeOption = type; - OnCreated(); + this.Homepage = homepage; + this.Name = name; + this.RegistrationNumber = registrationNumber; + this.RegistryLocation = registryLocation; + this.TaxId = taxId; + this.Type = type; } - partial void OnCreated(); - - /// - /// Used to track the state of Homepage - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option HomepageOption { get; private set; } - /// /// The company website's home page. /// /// The company website's home page. - [JsonPropertyName("homepage")] - public string Homepage { get { return this.HomepageOption; } set { this.HomepageOption = new Option(value); } } - - /// - /// Used to track the state of Name - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NameOption { get; private set; } + [DataMember(Name = "homepage", EmitDefaultValue = false)] + public string Homepage { get; set; } /// /// The company name. /// /// The company name. - [JsonPropertyName("name")] - public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } - - /// - /// Used to track the state of RegistrationNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RegistrationNumberOption { get; private set; } + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } /// /// Registration number of the company. /// /// Registration number of the company. - [JsonPropertyName("registrationNumber")] - public string RegistrationNumber { get { return this.RegistrationNumberOption; } set { this.RegistrationNumberOption = new Option(value); } } - - /// - /// Used to track the state of RegistryLocation - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RegistryLocationOption { get; private set; } + [DataMember(Name = "registrationNumber", EmitDefaultValue = false)] + public string RegistrationNumber { get; set; } /// /// Registry location of the company. /// /// Registry location of the company. - [JsonPropertyName("registryLocation")] - public string RegistryLocation { get { return this.RegistryLocationOption; } set { this.RegistryLocationOption = new Option(value); } } - - /// - /// Used to track the state of TaxId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TaxIdOption { get; private set; } + [DataMember(Name = "registryLocation", EmitDefaultValue = false)] + public string RegistryLocation { get; set; } /// /// Tax ID of the company. /// /// Tax ID of the company. - [JsonPropertyName("taxId")] - public string TaxId { get { return this.TaxIdOption; } set { this.TaxIdOption = new Option(value); } } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } + [DataMember(Name = "taxId", EmitDefaultValue = false)] + public string TaxId { get; set; } /// /// The company type. /// /// The company type. - [JsonPropertyName("type")] - public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } /// /// Returns the string presentation of the object @@ -154,164 +112,113 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CompanyJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Company Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option homepage = default; - Option name = default; - Option registrationNumber = default; - Option registryLocation = default; - Option taxId = default; - Option type = default; + return this.Equals(input as Company); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if Company instances are equal + /// + /// Instance of Company to be compared + /// Boolean + public bool Equals(Company input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "homepage": - homepage = new Option(utf8JsonReader.GetString()); - break; - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - case "registrationNumber": - registrationNumber = new Option(utf8JsonReader.GetString()); - break; - case "registryLocation": - registryLocation = new Option(utf8JsonReader.GetString()); - break; - case "taxId": - taxId = new Option(utf8JsonReader.GetString()); - break; - case "type": - type = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (homepage.IsSet && homepage.Value == null) - throw new ArgumentNullException(nameof(homepage), "Property is not nullable for class Company."); - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class Company."); - - if (registrationNumber.IsSet && registrationNumber.Value == null) - throw new ArgumentNullException(nameof(registrationNumber), "Property is not nullable for class Company."); - - if (registryLocation.IsSet && registryLocation.Value == null) - throw new ArgumentNullException(nameof(registryLocation), "Property is not nullable for class Company."); - - if (taxId.IsSet && taxId.Value == null) - throw new ArgumentNullException(nameof(taxId), "Property is not nullable for class Company."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class Company."); - - return new Company(homepage, name, registrationNumber, registryLocation, taxId, type); + return + ( + this.Homepage == input.Homepage || + (this.Homepage != null && + this.Homepage.Equals(input.Homepage)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.RegistrationNumber == input.RegistrationNumber || + (this.RegistrationNumber != null && + this.RegistrationNumber.Equals(input.RegistrationNumber)) + ) && + ( + this.RegistryLocation == input.RegistryLocation || + (this.RegistryLocation != null && + this.RegistryLocation.Equals(input.RegistryLocation)) + ) && + ( + this.TaxId == input.TaxId || + (this.TaxId != null && + this.TaxId.Equals(input.TaxId)) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Company company, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, company, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Homepage != null) + { + hashCode = (hashCode * 59) + this.Homepage.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.RegistrationNumber != null) + { + hashCode = (hashCode * 59) + this.RegistrationNumber.GetHashCode(); + } + if (this.RegistryLocation != null) + { + hashCode = (hashCode * 59) + this.RegistryLocation.GetHashCode(); + } + if (this.TaxId != null) + { + hashCode = (hashCode * 59) + this.TaxId.GetHashCode(); + } + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Company company, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (company.HomepageOption.IsSet && company.Homepage == null) - throw new ArgumentNullException(nameof(company.Homepage), "Property is required for class Company."); - - if (company.NameOption.IsSet && company.Name == null) - throw new ArgumentNullException(nameof(company.Name), "Property is required for class Company."); - - if (company.RegistrationNumberOption.IsSet && company.RegistrationNumber == null) - throw new ArgumentNullException(nameof(company.RegistrationNumber), "Property is required for class Company."); - - if (company.RegistryLocationOption.IsSet && company.RegistryLocation == null) - throw new ArgumentNullException(nameof(company.RegistryLocation), "Property is required for class Company."); - - if (company.TaxIdOption.IsSet && company.TaxId == null) - throw new ArgumentNullException(nameof(company.TaxId), "Property is required for class Company."); - - if (company.TypeOption.IsSet && company.Type == null) - throw new ArgumentNullException(nameof(company.Type), "Property is required for class Company."); - - if (company.HomepageOption.IsSet) - writer.WriteString("homepage", company.Homepage); - - if (company.NameOption.IsSet) - writer.WriteString("name", company.Name); - - if (company.RegistrationNumberOption.IsSet) - writer.WriteString("registrationNumber", company.RegistrationNumber); - - if (company.RegistryLocationOption.IsSet) - writer.WriteString("registryLocation", company.RegistryLocation); - - if (company.TaxIdOption.IsSet) - writer.WriteString("taxId", company.TaxId); - - if (company.TypeOption.IsSet) - writer.WriteString("type", company.Type); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs b/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs index 1b424a1d2..6cecc7153 100644 --- a/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs +++ b/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,1449 +15,731 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CreateCheckoutSessionRequest /// - public partial class CreateCheckoutSessionRequest : IValidatableObject + [DataContract(Name = "CreateCheckoutSessionRequest")] + public partial class CreateCheckoutSessionRequest : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The merchant account identifier, with which you want to process the transaction. - /// The reference to uniquely identify a payment. - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. - /// accountInfo - /// additionalAmount - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - /// applicationInfo - /// authenticationData - /// billingAddress - /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - /// The delay between the authorisation and scheduled auto-capture, specified in hours. - /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** - /// company - /// The shopper's two-letter country code. - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - /// deliveryAddress - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. - /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. - /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. - /// fundOrigin - /// fundRecipient - /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. - /// mandate - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. - /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration (default to ModeEnum.Embedded) - /// mpiData - /// platformChargebackLogic - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. - /// Minimum number of days between authorisations. Only for 3D Secure 2. - /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. - /// Specifies the redirect method (GET or POST) when redirecting to the issuer. - /// riskData - /// The shopper's email address. - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - /// The combination of a language code and a country code to specify the language to be used in the payment. - /// shopperName - /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - /// Set to true to show the payment amount per installment. - /// Set to **true** to show a button that lets the shopper remove a stored payment method. - /// The shopper's social security number. - /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false) - /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). - /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. - /// The shopper's telephone number. - /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. - /// threeDS2RequestData - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) - /// Set to true if the payment should be routed to a trusted MID. - [JsonConstructor] - public CreateCheckoutSessionRequest(Amount amount, string merchantAccount, string reference, string returnUrl, Option accountInfo = default, Option additionalAmount = default, Option> additionalData = default, Option> allowedPaymentMethods = default, Option applicationInfo = default, Option authenticationData = default, Option billingAddress = default, Option> blockedPaymentMethods = default, Option captureDelayHours = default, Option channel = default, Option company = default, Option countryCode = default, Option dateOfBirth = default, Option deliverAt = default, Option deliveryAddress = default, Option enableOneClick = default, Option enablePayOut = default, Option enableRecurring = default, Option expiresAt = default, Option fundOrigin = default, Option fundRecipient = default, Option> installmentOptions = default, Option> lineItems = default, Option mandate = default, Option mcc = default, Option merchantOrderReference = default, Option> metadata = default, Option mode = default, Option mpiData = default, Option platformChargebackLogic = default, Option recurringExpiry = default, Option recurringFrequency = default, Option recurringProcessingModel = default, Option redirectFromIssuerMethod = default, Option redirectToIssuerMethod = default, Option riskData = default, Option shopperEmail = default, Option shopperIP = default, Option shopperInteraction = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option shopperStatement = default, Option showInstallmentAmount = default, Option showRemovePaymentMethodButton = default, Option socialSecurityNumber = default, Option splitCardFundingSources = default, Option> splits = default, Option store = default, Option storeFiltrationMode = default, Option storePaymentMethod = default, Option storePaymentMethodMode = default, Option telephoneNumber = default, Option themeId = default, Option threeDS2RequestData = default, Option threeDSAuthenticationOnly = default, Option trustedShopper = default) - { - Amount = amount; - MerchantAccount = merchantAccount; - Reference = reference; - ReturnUrl = returnUrl; - AccountInfoOption = accountInfo; - AdditionalAmountOption = additionalAmount; - AdditionalDataOption = additionalData; - AllowedPaymentMethodsOption = allowedPaymentMethods; - ApplicationInfoOption = applicationInfo; - AuthenticationDataOption = authenticationData; - BillingAddressOption = billingAddress; - BlockedPaymentMethodsOption = blockedPaymentMethods; - CaptureDelayHoursOption = captureDelayHours; - ChannelOption = channel; - CompanyOption = company; - CountryCodeOption = countryCode; - DateOfBirthOption = dateOfBirth; - DeliverAtOption = deliverAt; - DeliveryAddressOption = deliveryAddress; - EnableOneClickOption = enableOneClick; - EnablePayOutOption = enablePayOut; - EnableRecurringOption = enableRecurring; - ExpiresAtOption = expiresAt; - FundOriginOption = fundOrigin; - FundRecipientOption = fundRecipient; - InstallmentOptionsOption = installmentOptions; - LineItemsOption = lineItems; - MandateOption = mandate; - MccOption = mcc; - MerchantOrderReferenceOption = merchantOrderReference; - MetadataOption = metadata; - ModeOption = mode; - MpiDataOption = mpiData; - PlatformChargebackLogicOption = platformChargebackLogic; - RecurringExpiryOption = recurringExpiry; - RecurringFrequencyOption = recurringFrequency; - RecurringProcessingModelOption = recurringProcessingModel; - RedirectFromIssuerMethodOption = redirectFromIssuerMethod; - RedirectToIssuerMethodOption = redirectToIssuerMethod; - RiskDataOption = riskData; - ShopperEmailOption = shopperEmail; - ShopperIPOption = shopperIP; - ShopperInteractionOption = shopperInteraction; - ShopperLocaleOption = shopperLocale; - ShopperNameOption = shopperName; - ShopperReferenceOption = shopperReference; - ShopperStatementOption = shopperStatement; - ShowInstallmentAmountOption = showInstallmentAmount; - ShowRemovePaymentMethodButtonOption = showRemovePaymentMethodButton; - SocialSecurityNumberOption = socialSecurityNumber; - SplitCardFundingSourcesOption = splitCardFundingSources; - SplitsOption = splits; - StoreOption = store; - StoreFiltrationModeOption = storeFiltrationMode; - StorePaymentMethodOption = storePaymentMethod; - StorePaymentMethodModeOption = storePaymentMethodMode; - TelephoneNumberOption = telephoneNumber; - ThemeIdOption = themeId; - ThreeDS2RequestDataOption = threeDS2RequestData; - ThreeDSAuthenticationOnlyOption = threeDSAuthenticationOnly; - TrustedShopperOption = trustedShopper; - OnCreated(); - } - - partial void OnCreated(); - /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** + [JsonConverter(typeof(StringEnumConverter))] public enum ChannelEnum { /// /// Enum IOS for value: iOS /// + [EnumMember(Value = "iOS")] IOS = 1, /// /// Enum Android for value: Android /// + [EnumMember(Value = "Android")] Android = 2, /// /// Enum Web for value: Web /// + [EnumMember(Value = "Web")] Web = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ChannelEnum ChannelEnumFromString(string value) - { - if (value.Equals("iOS")) - return ChannelEnum.IOS; - - if (value.Equals("Android")) - return ChannelEnum.Android; - - if (value.Equals("Web")) - return ChannelEnum.Web; - - throw new NotImplementedException($"Could not convert value to type ChannelEnum: '{value}'"); - } - /// - /// Returns a - /// - /// - /// - public static ChannelEnum? ChannelEnumFromStringOrDefault(string value) - { - if (value.Equals("iOS")) - return ChannelEnum.IOS; - - if (value.Equals("Android")) - return ChannelEnum.Android; - - if (value.Equals("Web")) - return ChannelEnum.Web; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChannelEnumToJsonValue(ChannelEnum? value) - { - if (value == ChannelEnum.IOS) - return "iOS"; - - if (value == ChannelEnum.Android) - return "Android"; - - if (value == ChannelEnum.Web) - return "Web"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Channel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChannelOption { get; private set; } /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** - [JsonPropertyName("channel")] - public ChannelEnum? Channel { get { return this.ChannelOption; } set { this.ChannelOption = new Option(value); } } - + [DataMember(Name = "channel", EmitDefaultValue = false)] + public ChannelEnum? Channel { get; set; } /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration + [JsonConverter(typeof(StringEnumConverter))] public enum ModeEnum { /// /// Enum Embedded for value: embedded /// + [EnumMember(Value = "embedded")] Embedded = 1, /// /// Enum Hosted for value: hosted /// + [EnumMember(Value = "hosted")] Hosted = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ModeEnum ModeEnumFromString(string value) - { - if (value.Equals("embedded")) - return ModeEnum.Embedded; - - if (value.Equals("hosted")) - return ModeEnum.Hosted; - - throw new NotImplementedException($"Could not convert value to type ModeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ModeEnum? ModeEnumFromStringOrDefault(string value) - { - if (value.Equals("embedded")) - return ModeEnum.Embedded; - - if (value.Equals("hosted")) - return ModeEnum.Hosted; - - return null; - } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ModeEnumToJsonValue(ModeEnum? value) - { - if (value == ModeEnum.Embedded) - return "embedded"; - - if (value == ModeEnum.Hosted) - return "hosted"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Mode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ModeOption { get; private set; } /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration - [JsonPropertyName("mode")] - public ModeEnum? Mode { get { return this.ModeOption; } set { this.ModeOption = new Option(value); } } - + [DataMember(Name = "mode", EmitDefaultValue = false)] + public ModeEnum? Mode { get; set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// + [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// + [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// + [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) - { - if (value == RecurringProcessingModelEnum.CardOnFile) - return "CardOnFile"; - - if (value == RecurringProcessingModelEnum.Subscription) - return "Subscription"; - if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) - return "UnscheduledCardOnFile"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of RecurringProcessingModel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonPropertyName("recurringProcessingModel")] - public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } - + [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] + public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + [JsonConverter(typeof(StringEnumConverter))] public enum ShopperInteractionEnum { /// /// Enum Ecommerce for value: Ecommerce /// + [EnumMember(Value = "Ecommerce")] Ecommerce = 1, /// /// Enum ContAuth for value: ContAuth /// + [EnumMember(Value = "ContAuth")] ContAuth = 2, /// /// Enum Moto for value: Moto /// + [EnumMember(Value = "Moto")] Moto = 3, /// /// Enum POS for value: POS /// + [EnumMember(Value = "POS")] POS = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ShopperInteractionEnum ShopperInteractionEnumFromString(string value) - { - if (value.Equals("Ecommerce")) - return ShopperInteractionEnum.Ecommerce; - - if (value.Equals("ContAuth")) - return ShopperInteractionEnum.ContAuth; - - if (value.Equals("Moto")) - return ShopperInteractionEnum.Moto; - - if (value.Equals("POS")) - return ShopperInteractionEnum.POS; - - throw new NotImplementedException($"Could not convert value to type ShopperInteractionEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ShopperInteractionEnum? ShopperInteractionEnumFromStringOrDefault(string value) - { - if (value.Equals("Ecommerce")) - return ShopperInteractionEnum.Ecommerce; - if (value.Equals("ContAuth")) - return ShopperInteractionEnum.ContAuth; - - if (value.Equals("Moto")) - return ShopperInteractionEnum.Moto; - - if (value.Equals("POS")) - return ShopperInteractionEnum.POS; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ShopperInteractionEnumToJsonValue(ShopperInteractionEnum? value) - { - if (value == ShopperInteractionEnum.Ecommerce) - return "Ecommerce"; - - if (value == ShopperInteractionEnum.ContAuth) - return "ContAuth"; - - if (value == ShopperInteractionEnum.Moto) - return "Moto"; - - if (value == ShopperInteractionEnum.POS) - return "POS"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of ShopperInteraction - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperInteractionOption { get; private set; } /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [JsonPropertyName("shopperInteraction")] - public ShopperInteractionEnum? ShopperInteraction { get { return this.ShopperInteractionOption; } set { this.ShopperInteractionOption = new Option(value); } } - + [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] + public ShopperInteractionEnum? ShopperInteraction { get; set; } /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. + [JsonConverter(typeof(StringEnumConverter))] public enum StoreFiltrationModeEnum { /// /// Enum Exclusive for value: exclusive /// + [EnumMember(Value = "exclusive")] Exclusive = 1, /// /// Enum Inclusive for value: inclusive /// + [EnumMember(Value = "inclusive")] Inclusive = 2, /// /// Enum SkipFilter for value: skipFilter /// + [EnumMember(Value = "skipFilter")] SkipFilter = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static StoreFiltrationModeEnum StoreFiltrationModeEnumFromString(string value) - { - if (value.Equals("exclusive")) - return StoreFiltrationModeEnum.Exclusive; - - if (value.Equals("inclusive")) - return StoreFiltrationModeEnum.Inclusive; - - if (value.Equals("skipFilter")) - return StoreFiltrationModeEnum.SkipFilter; - - throw new NotImplementedException($"Could not convert value to type StoreFiltrationModeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static StoreFiltrationModeEnum? StoreFiltrationModeEnumFromStringOrDefault(string value) - { - if (value.Equals("exclusive")) - return StoreFiltrationModeEnum.Exclusive; - - if (value.Equals("inclusive")) - return StoreFiltrationModeEnum.Inclusive; - - if (value.Equals("skipFilter")) - return StoreFiltrationModeEnum.SkipFilter; - - return null; - } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string StoreFiltrationModeEnumToJsonValue(StoreFiltrationModeEnum? value) - { - if (value == StoreFiltrationModeEnum.Exclusive) - return "exclusive"; - - if (value == StoreFiltrationModeEnum.Inclusive) - return "inclusive"; - - if (value == StoreFiltrationModeEnum.SkipFilter) - return "skipFilter"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of StoreFiltrationMode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoreFiltrationModeOption { get; private set; } /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - [JsonPropertyName("storeFiltrationMode")] - public StoreFiltrationModeEnum? StoreFiltrationMode { get { return this.StoreFiltrationModeOption; } set { this.StoreFiltrationModeOption = new Option(value); } } - + [DataMember(Name = "storeFiltrationMode", EmitDefaultValue = false)] + public StoreFiltrationModeEnum? StoreFiltrationMode { get; set; } /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + [JsonConverter(typeof(StringEnumConverter))] public enum StorePaymentMethodModeEnum { /// /// Enum AskForConsent for value: askForConsent /// + [EnumMember(Value = "askForConsent")] AskForConsent = 1, /// /// Enum Disabled for value: disabled /// + [EnumMember(Value = "disabled")] Disabled = 2, /// /// Enum Enabled for value: enabled /// + [EnumMember(Value = "enabled")] Enabled = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static StorePaymentMethodModeEnum StorePaymentMethodModeEnumFromString(string value) - { - if (value.Equals("askForConsent")) - return StorePaymentMethodModeEnum.AskForConsent; - - if (value.Equals("disabled")) - return StorePaymentMethodModeEnum.Disabled; - - if (value.Equals("enabled")) - return StorePaymentMethodModeEnum.Enabled; - - throw new NotImplementedException($"Could not convert value to type StorePaymentMethodModeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static StorePaymentMethodModeEnum? StorePaymentMethodModeEnumFromStringOrDefault(string value) - { - if (value.Equals("askForConsent")) - return StorePaymentMethodModeEnum.AskForConsent; - - if (value.Equals("disabled")) - return StorePaymentMethodModeEnum.Disabled; - - if (value.Equals("enabled")) - return StorePaymentMethodModeEnum.Enabled; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string StorePaymentMethodModeEnumToJsonValue(StorePaymentMethodModeEnum? value) - { - if (value == StorePaymentMethodModeEnum.AskForConsent) - return "askForConsent"; - - if (value == StorePaymentMethodModeEnum.Disabled) - return "disabled"; - - if (value == StorePaymentMethodModeEnum.Enabled) - return "enabled"; - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of StorePaymentMethodMode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StorePaymentMethodModeOption { get; private set; } /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. - [JsonPropertyName("storePaymentMethodMode")] - public StorePaymentMethodModeEnum? StorePaymentMethodMode { get { return this.StorePaymentMethodModeOption; } set { this.StorePaymentMethodModeOption = new Option(value); } } - - /// - /// Gets or Sets Amount - /// - [JsonPropertyName("amount")] - public Amount Amount { get; set; } - - /// - /// The merchant account identifier, with which you want to process the transaction. - /// - /// The merchant account identifier, with which you want to process the transaction. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } - - /// - /// The reference to uniquely identify a payment. - /// - /// The reference to uniquely identify a payment. - [JsonPropertyName("reference")] - public string Reference { get; set; } - + [DataMember(Name = "storePaymentMethodMode", EmitDefaultValue = false)] + public StorePaymentMethodModeEnum? StorePaymentMethodMode { get; set; } /// - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// Initializes a new instance of the class. /// - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. - [JsonPropertyName("returnUrl")] - public string ReturnUrl { get; set; } - + [JsonConstructorAttribute] + protected CreateCheckoutSessionRequest() { } /// - /// Used to track the state of AccountInfo + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountInfoOption { get; private set; } + /// accountInfo. + /// additionalAmount. + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]`. + /// amount (required). + /// applicationInfo. + /// authenticationData. + /// billingAddress. + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]`. + /// The delay between the authorisation and scheduled auto-capture, specified in hours.. + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web**. + /// company. + /// The shopper's two-letter country code.. + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. + /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.. + /// deliveryAddress. + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition).. + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts.. + /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments.. + /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation.. + /// fundOrigin. + /// fundRecipient. + /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options.. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip.. + /// mandate. + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. + /// The merchant account identifier, with which you want to process the transaction. (required). + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.. + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. . + /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration (default to ModeEnum.Embedded). + /// mpiData. + /// platformChargebackLogic. + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2.. + /// Minimum number of days between authorisations. Only for 3D Secure 2.. + /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer.. + /// Specifies the redirect method (GET or POST) when redirecting to the issuer.. + /// The reference to uniquely identify a payment. (required). + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. We strongly recommend that you use a maximum of 1024 characters. > The URL must not include personally identifiable information (PII), for example name or email address. (required). + /// riskData. + /// The shopper's email address.. + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new).. + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. + /// The combination of a language code and a country code to specify the language to be used in the payment.. + /// shopperName. + /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. + /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**.. + /// Set to true to show the payment amount per installment.. + /// Set to **true** to show a button that lets the shopper remove a stored payment method.. + /// The shopper's social security number.. + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false). + /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).. + /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment.. + /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned.. + /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types).. + /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent.. + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication.. + /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area.. + /// threeDS2RequestData. + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. (default to false). + /// Set to true if the payment should be routed to a trusted MID.. + public CreateCheckoutSessionRequest(AccountInfo accountInfo = default(AccountInfo), Amount additionalAmount = default(Amount), Dictionary additionalData = default(Dictionary), List allowedPaymentMethods = default(List), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), AuthenticationData authenticationData = default(AuthenticationData), BillingAddress billingAddress = default(BillingAddress), List blockedPaymentMethods = default(List), int? captureDelayHours = default(int?), ChannelEnum? channel = default(ChannelEnum?), Company company = default(Company), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), DateTime deliverAt = default(DateTime), DeliveryAddress deliveryAddress = default(DeliveryAddress), bool? enableOneClick = default(bool?), bool? enablePayOut = default(bool?), bool? enableRecurring = default(bool?), DateTime expiresAt = default(DateTime), FundOrigin fundOrigin = default(FundOrigin), FundRecipient fundRecipient = default(FundRecipient), Dictionary installmentOptions = default(Dictionary), List lineItems = default(List), Mandate mandate = default(Mandate), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), Dictionary metadata = default(Dictionary), ModeEnum? mode = ModeEnum.Embedded, ThreeDSecureData mpiData = default(ThreeDSecureData), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), string recurringExpiry = default(string), string recurringFrequency = default(string), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string redirectFromIssuerMethod = default(string), string redirectToIssuerMethod = default(string), string reference = default(string), string returnUrl = default(string), RiskData riskData = default(RiskData), string shopperEmail = default(string), string shopperIP = default(string), ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), bool? showInstallmentAmount = default(bool?), bool? showRemovePaymentMethodButton = default(bool?), string socialSecurityNumber = default(string), bool? splitCardFundingSources = false, List splits = default(List), string store = default(string), StoreFiltrationModeEnum? storeFiltrationMode = default(StoreFiltrationModeEnum?), bool? storePaymentMethod = default(bool?), StorePaymentMethodModeEnum? storePaymentMethodMode = default(StorePaymentMethodModeEnum?), string telephoneNumber = default(string), string themeId = default(string), CheckoutSessionThreeDS2RequestData threeDS2RequestData = default(CheckoutSessionThreeDS2RequestData), bool? threeDSAuthenticationOnly = false, bool? trustedShopper = default(bool?)) + { + this.Amount = amount; + this.MerchantAccount = merchantAccount; + this.Reference = reference; + this.ReturnUrl = returnUrl; + this.AccountInfo = accountInfo; + this.AdditionalAmount = additionalAmount; + this.AdditionalData = additionalData; + this.AllowedPaymentMethods = allowedPaymentMethods; + this.ApplicationInfo = applicationInfo; + this.AuthenticationData = authenticationData; + this.BillingAddress = billingAddress; + this.BlockedPaymentMethods = blockedPaymentMethods; + this.CaptureDelayHours = captureDelayHours; + this.Channel = channel; + this.Company = company; + this.CountryCode = countryCode; + this.DateOfBirth = dateOfBirth; + this.DeliverAt = deliverAt; + this.DeliveryAddress = deliveryAddress; + this.EnableOneClick = enableOneClick; + this.EnablePayOut = enablePayOut; + this.EnableRecurring = enableRecurring; + this.ExpiresAt = expiresAt; + this.FundOrigin = fundOrigin; + this.FundRecipient = fundRecipient; + this.InstallmentOptions = installmentOptions; + this.LineItems = lineItems; + this.Mandate = mandate; + this.Mcc = mcc; + this.MerchantOrderReference = merchantOrderReference; + this.Metadata = metadata; + this.Mode = mode; + this.MpiData = mpiData; + this.PlatformChargebackLogic = platformChargebackLogic; + this.RecurringExpiry = recurringExpiry; + this.RecurringFrequency = recurringFrequency; + this.RecurringProcessingModel = recurringProcessingModel; + this.RedirectFromIssuerMethod = redirectFromIssuerMethod; + this.RedirectToIssuerMethod = redirectToIssuerMethod; + this.RiskData = riskData; + this.ShopperEmail = shopperEmail; + this.ShopperIP = shopperIP; + this.ShopperInteraction = shopperInteraction; + this.ShopperLocale = shopperLocale; + this.ShopperName = shopperName; + this.ShopperReference = shopperReference; + this.ShopperStatement = shopperStatement; + this.ShowInstallmentAmount = showInstallmentAmount; + this.ShowRemovePaymentMethodButton = showRemovePaymentMethodButton; + this.SocialSecurityNumber = socialSecurityNumber; + this.SplitCardFundingSources = splitCardFundingSources; + this.Splits = splits; + this.Store = store; + this.StoreFiltrationMode = storeFiltrationMode; + this.StorePaymentMethod = storePaymentMethod; + this.StorePaymentMethodMode = storePaymentMethodMode; + this.TelephoneNumber = telephoneNumber; + this.ThemeId = themeId; + this.ThreeDS2RequestData = threeDS2RequestData; + this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; + this.TrustedShopper = trustedShopper; + } /// /// Gets or Sets AccountInfo /// - [JsonPropertyName("accountInfo")] - public AccountInfo AccountInfo { get { return this.AccountInfoOption; } set { this.AccountInfoOption = new Option(value); } } - - /// - /// Used to track the state of AdditionalAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AdditionalAmountOption { get; private set; } + [DataMember(Name = "accountInfo", EmitDefaultValue = false)] + public AccountInfo AccountInfo { get; set; } /// /// Gets or Sets AdditionalAmount /// - [JsonPropertyName("additionalAmount")] - public Amount AdditionalAmount { get { return this.AdditionalAmountOption; } set { this.AdditionalAmountOption = new Option(value); } } - - /// - /// Used to track the state of AdditionalData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AdditionalDataOption { get; private set; } + [DataMember(Name = "additionalAmount", EmitDefaultValue = false)] + public Amount AdditionalAmount { get; set; } /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - [JsonPropertyName("additionalData")] - public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } - - /// - /// Used to track the state of AllowedPaymentMethods - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AllowedPaymentMethodsOption { get; private set; } + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - [JsonPropertyName("allowedPaymentMethods")] - public List AllowedPaymentMethods { get { return this.AllowedPaymentMethodsOption; } set { this.AllowedPaymentMethodsOption = new Option>(value); } } + [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] + public List AllowedPaymentMethods { get; set; } /// - /// Used to track the state of ApplicationInfo + /// Gets or Sets Amount /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ApplicationInfoOption { get; private set; } + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// Gets or Sets ApplicationInfo /// - [JsonPropertyName("applicationInfo")] - public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } - - /// - /// Used to track the state of AuthenticationData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthenticationDataOption { get; private set; } + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } /// /// Gets or Sets AuthenticationData /// - [JsonPropertyName("authenticationData")] - public AuthenticationData AuthenticationData { get { return this.AuthenticationDataOption; } set { this.AuthenticationDataOption = new Option(value); } } - - /// - /// Used to track the state of BillingAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressOption { get; private set; } + [DataMember(Name = "authenticationData", EmitDefaultValue = false)] + public AuthenticationData AuthenticationData { get; set; } /// /// Gets or Sets BillingAddress /// - [JsonPropertyName("billingAddress")] - public BillingAddress BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } - - /// - /// Used to track the state of BlockedPaymentMethods - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> BlockedPaymentMethodsOption { get; private set; } + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public BillingAddress BillingAddress { get; set; } /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - [JsonPropertyName("blockedPaymentMethods")] - public List BlockedPaymentMethods { get { return this.BlockedPaymentMethodsOption; } set { this.BlockedPaymentMethodsOption = new Option>(value); } } - - /// - /// Used to track the state of CaptureDelayHours - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CaptureDelayHoursOption { get; private set; } + [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] + public List BlockedPaymentMethods { get; set; } /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. - [JsonPropertyName("captureDelayHours")] - public int? CaptureDelayHours { get { return this.CaptureDelayHoursOption; } set { this.CaptureDelayHoursOption = new Option(value); } } - - /// - /// Used to track the state of Company - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CompanyOption { get; private set; } + [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] + public int? CaptureDelayHours { get; set; } /// /// Gets or Sets Company /// - [JsonPropertyName("company")] - public Company Company { get { return this.CompanyOption; } set { this.CompanyOption = new Option(value); } } - - /// - /// Used to track the state of CountryCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CountryCodeOption { get; private set; } + [DataMember(Name = "company", EmitDefaultValue = false)] + public Company Company { get; set; } /// /// The shopper's two-letter country code. /// /// The shopper's two-letter country code. - [JsonPropertyName("countryCode")] - public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } - - /// - /// Used to track the state of DateOfBirth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DateOfBirthOption { get; private set; } + [DataMember(Name = "countryCode", EmitDefaultValue = false)] + public string CountryCode { get; set; } /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - [JsonPropertyName("dateOfBirth")] - public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } - - /// - /// Used to track the state of DeliverAt - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliverAtOption { get; private set; } + [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime DateOfBirth { get; set; } /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [JsonPropertyName("deliverAt")] - public DateTime? DeliverAt { get { return this.DeliverAtOption; } set { this.DeliverAtOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryAddressOption { get; private set; } + [DataMember(Name = "deliverAt", EmitDefaultValue = false)] + public DateTime DeliverAt { get; set; } /// /// Gets or Sets DeliveryAddress /// - [JsonPropertyName("deliveryAddress")] - public DeliveryAddress DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } - - /// - /// Used to track the state of EnableOneClick - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnableOneClickOption { get; private set; } + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public DeliveryAddress DeliveryAddress { get; set; } /// /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). /// /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). - [JsonPropertyName("enableOneClick")] - public bool? EnableOneClick { get { return this.EnableOneClickOption; } set { this.EnableOneClickOption = new Option(value); } } - - /// - /// Used to track the state of EnablePayOut - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnablePayOutOption { get; private set; } + [DataMember(Name = "enableOneClick", EmitDefaultValue = false)] + public bool? EnableOneClick { get; set; } /// /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. /// /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. - [JsonPropertyName("enablePayOut")] - public bool? EnablePayOut { get { return this.EnablePayOutOption; } set { this.EnablePayOutOption = new Option(value); } } - - /// - /// Used to track the state of EnableRecurring - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnableRecurringOption { get; private set; } + [DataMember(Name = "enablePayOut", EmitDefaultValue = false)] + public bool? EnablePayOut { get; set; } /// /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. /// /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. - [JsonPropertyName("enableRecurring")] - public bool? EnableRecurring { get { return this.EnableRecurringOption; } set { this.EnableRecurringOption = new Option(value); } } - - /// - /// Used to track the state of ExpiresAt - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiresAtOption { get; private set; } + [DataMember(Name = "enableRecurring", EmitDefaultValue = false)] + public bool? EnableRecurring { get; set; } /// /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. /// /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. - [JsonPropertyName("expiresAt")] - public DateTime? ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } - - /// - /// Used to track the state of FundOrigin - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundOriginOption { get; private set; } + [DataMember(Name = "expiresAt", EmitDefaultValue = false)] + public DateTime ExpiresAt { get; set; } /// /// Gets or Sets FundOrigin /// - [JsonPropertyName("fundOrigin")] - public FundOrigin FundOrigin { get { return this.FundOriginOption; } set { this.FundOriginOption = new Option(value); } } - - /// - /// Used to track the state of FundRecipient - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundRecipientOption { get; private set; } + [DataMember(Name = "fundOrigin", EmitDefaultValue = false)] + public FundOrigin FundOrigin { get; set; } /// /// Gets or Sets FundRecipient /// - [JsonPropertyName("fundRecipient")] - public FundRecipient FundRecipient { get { return this.FundRecipientOption; } set { this.FundRecipientOption = new Option(value); } } - - /// - /// Used to track the state of InstallmentOptions - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> InstallmentOptionsOption { get; private set; } + [DataMember(Name = "fundRecipient", EmitDefaultValue = false)] + public FundRecipient FundRecipient { get; set; } /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. - [JsonPropertyName("installmentOptions")] - public Dictionary InstallmentOptions { get { return this.InstallmentOptionsOption; } set { this.InstallmentOptionsOption = new Option>(value); } } - - /// - /// Used to track the state of LineItems - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LineItemsOption { get; private set; } + [DataMember(Name = "installmentOptions", EmitDefaultValue = false)] + public Dictionary InstallmentOptions { get; set; } /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. - [JsonPropertyName("lineItems")] - public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } - - /// - /// Used to track the state of Mandate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MandateOption { get; private set; } + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } /// /// Gets or Sets Mandate /// - [JsonPropertyName("mandate")] - public Mandate Mandate { get { return this.MandateOption; } set { this.MandateOption = new Option(value); } } - - /// - /// Used to track the state of Mcc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MccOption { get; private set; } + [DataMember(Name = "mandate", EmitDefaultValue = false)] + public Mandate Mandate { get; set; } /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - [JsonPropertyName("mcc")] - public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string Mcc { get; set; } /// - /// Used to track the state of MerchantOrderReference + /// The merchant account identifier, with which you want to process the transaction. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantOrderReferenceOption { get; private set; } - + /// The merchant account identifier, with which you want to process the transaction. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } + /// /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. /// /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - [JsonPropertyName("merchantOrderReference")] - public string MerchantOrderReference { get { return this.MerchantOrderReferenceOption; } set { this.MerchantOrderReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Metadata - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> MetadataOption { get; private set; } + [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] + public string MerchantOrderReference { get; set; } /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. - [JsonPropertyName("metadata")] - public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } - - /// - /// Used to track the state of MpiData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MpiDataOption { get; private set; } + [DataMember(Name = "metadata", EmitDefaultValue = false)] + public Dictionary Metadata { get; set; } /// /// Gets or Sets MpiData /// - [JsonPropertyName("mpiData")] - public ThreeDSecureData MpiData { get { return this.MpiDataOption; } set { this.MpiDataOption = new Option(value); } } - - /// - /// Used to track the state of PlatformChargebackLogic - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PlatformChargebackLogicOption { get; private set; } + [DataMember(Name = "mpiData", EmitDefaultValue = false)] + public ThreeDSecureData MpiData { get; set; } /// /// Gets or Sets PlatformChargebackLogic /// - [JsonPropertyName("platformChargebackLogic")] - public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } - - /// - /// Used to track the state of RecurringExpiry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringExpiryOption { get; private set; } + [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] + public PlatformChargebackLogic PlatformChargebackLogic { get; set; } /// /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. /// /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. - [JsonPropertyName("recurringExpiry")] - public string RecurringExpiry { get { return this.RecurringExpiryOption; } set { this.RecurringExpiryOption = new Option(value); } } - - /// - /// Used to track the state of RecurringFrequency - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringFrequencyOption { get; private set; } + [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] + public string RecurringExpiry { get; set; } /// /// Minimum number of days between authorisations. Only for 3D Secure 2. /// /// Minimum number of days between authorisations. Only for 3D Secure 2. - [JsonPropertyName("recurringFrequency")] - public string RecurringFrequency { get { return this.RecurringFrequencyOption; } set { this.RecurringFrequencyOption = new Option(value); } } - - /// - /// Used to track the state of RedirectFromIssuerMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RedirectFromIssuerMethodOption { get; private set; } + [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] + public string RecurringFrequency { get; set; } /// /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. /// /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. - [JsonPropertyName("redirectFromIssuerMethod")] - public string RedirectFromIssuerMethod { get { return this.RedirectFromIssuerMethodOption; } set { this.RedirectFromIssuerMethodOption = new Option(value); } } - - /// - /// Used to track the state of RedirectToIssuerMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RedirectToIssuerMethodOption { get; private set; } + [DataMember(Name = "redirectFromIssuerMethod", EmitDefaultValue = false)] + public string RedirectFromIssuerMethod { get; set; } /// /// Specifies the redirect method (GET or POST) when redirecting to the issuer. /// /// Specifies the redirect method (GET or POST) when redirecting to the issuer. - [JsonPropertyName("redirectToIssuerMethod")] - public string RedirectToIssuerMethod { get { return this.RedirectToIssuerMethodOption; } set { this.RedirectToIssuerMethodOption = new Option(value); } } + [DataMember(Name = "redirectToIssuerMethod", EmitDefaultValue = false)] + public string RedirectToIssuerMethod { get; set; } /// - /// Used to track the state of RiskData + /// The reference to uniquely identify a payment. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskDataOption { get; private set; } + /// The reference to uniquely identify a payment. + [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] + public string Reference { get; set; } /// - /// Gets or Sets RiskData + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. We strongly recommend that you use a maximum of 1024 characters. > The URL must not include personally identifiable information (PII), for example name or email address. /// - [JsonPropertyName("riskData")] - public RiskData RiskData { get { return this.RiskDataOption; } set { this.RiskDataOption = new Option(value); } } + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. We strongly recommend that you use a maximum of 1024 characters. > The URL must not include personally identifiable information (PII), for example name or email address. + [DataMember(Name = "returnUrl", IsRequired = false, EmitDefaultValue = false)] + public string ReturnUrl { get; set; } /// - /// Used to track the state of ShopperEmail + /// Gets or Sets RiskData /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + [DataMember(Name = "riskData", EmitDefaultValue = false)] + public RiskData RiskData { get; set; } /// /// The shopper's email address. /// /// The shopper's email address. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } - - /// - /// Used to track the state of ShopperIP - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperIPOption { get; private set; } + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). /// - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - [JsonPropertyName("shopperIP")] - public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } - - /// - /// Used to track the state of ShopperLocale - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperLocaleOption { get; private set; } + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + [DataMember(Name = "shopperIP", EmitDefaultValue = false)] + public string ShopperIP { get; set; } /// /// The combination of a language code and a country code to specify the language to be used in the payment. /// /// The combination of a language code and a country code to specify the language to be used in the payment. - [JsonPropertyName("shopperLocale")] - public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } - - /// - /// Used to track the state of ShopperName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNameOption { get; private set; } + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + public string ShopperLocale { get; set; } /// /// Gets or Sets ShopperName /// - [JsonPropertyName("shopperName")] - public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } - - /// - /// Used to track the state of ShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperReferenceOption { get; private set; } + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name ShopperName { get; set; } /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [JsonPropertyName("shopperReference")] - public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperStatement - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperStatementOption { get; private set; } + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - [JsonPropertyName("shopperStatement")] - public string ShopperStatement { get { return this.ShopperStatementOption; } set { this.ShopperStatementOption = new Option(value); } } - - /// - /// Used to track the state of ShowInstallmentAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShowInstallmentAmountOption { get; private set; } + [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] + public string ShopperStatement { get; set; } /// /// Set to true to show the payment amount per installment. /// /// Set to true to show the payment amount per installment. - [JsonPropertyName("showInstallmentAmount")] - public bool? ShowInstallmentAmount { get { return this.ShowInstallmentAmountOption; } set { this.ShowInstallmentAmountOption = new Option(value); } } - - /// - /// Used to track the state of ShowRemovePaymentMethodButton - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShowRemovePaymentMethodButtonOption { get; private set; } + [DataMember(Name = "showInstallmentAmount", EmitDefaultValue = false)] + public bool? ShowInstallmentAmount { get; set; } /// /// Set to **true** to show a button that lets the shopper remove a stored payment method. /// /// Set to **true** to show a button that lets the shopper remove a stored payment method. - [JsonPropertyName("showRemovePaymentMethodButton")] - public bool? ShowRemovePaymentMethodButton { get { return this.ShowRemovePaymentMethodButtonOption; } set { this.ShowRemovePaymentMethodButtonOption = new Option(value); } } - - /// - /// Used to track the state of SocialSecurityNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SocialSecurityNumberOption { get; private set; } + [DataMember(Name = "showRemovePaymentMethodButton", EmitDefaultValue = false)] + public bool? ShowRemovePaymentMethodButton { get; set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [JsonPropertyName("socialSecurityNumber")] - public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } - - /// - /// Used to track the state of SplitCardFundingSources - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SplitCardFundingSourcesOption { get; private set; } + [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] + public string SocialSecurityNumber { get; set; } /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. - [JsonPropertyName("splitCardFundingSources")] - public bool? SplitCardFundingSources { get { return this.SplitCardFundingSourcesOption; } set { this.SplitCardFundingSourcesOption = new Option(value); } } - - /// - /// Used to track the state of Splits - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SplitsOption { get; private set; } + [DataMember(Name = "splitCardFundingSources", EmitDefaultValue = false)] + public bool? SplitCardFundingSources { get; set; } /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - [JsonPropertyName("splits")] - public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } - - /// - /// Used to track the state of Store - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoreOption { get; private set; } + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - [JsonPropertyName("store")] - public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } - - /// - /// Used to track the state of StorePaymentMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StorePaymentMethodOption { get; private set; } + [DataMember(Name = "store", EmitDefaultValue = false)] + public string Store { get; set; } /// /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). /// /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). - [JsonPropertyName("storePaymentMethod")] - public bool? StorePaymentMethod { get { return this.StorePaymentMethodOption; } set { this.StorePaymentMethodOption = new Option(value); } } - - /// - /// Used to track the state of TelephoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TelephoneNumberOption { get; private set; } - - /// - /// The shopper's telephone number. - /// - /// The shopper's telephone number. - [JsonPropertyName("telephoneNumber")] - public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } + [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] + public bool? StorePaymentMethod { get; set; } /// - /// Used to track the state of ThemeId + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThemeIdOption { get; private set; } + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string TelephoneNumber { get; set; } /// /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. /// /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. - [JsonPropertyName("themeId")] - public string ThemeId { get { return this.ThemeIdOption; } set { this.ThemeIdOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2RequestData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2RequestDataOption { get; private set; } + [DataMember(Name = "themeId", EmitDefaultValue = false)] + public string ThemeId { get; set; } /// /// Gets or Sets ThreeDS2RequestData /// - [JsonPropertyName("threeDS2RequestData")] - public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSAuthenticationOnly - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSAuthenticationOnlyOption { get; private set; } + [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] + public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get; set; } /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [JsonPropertyName("threeDSAuthenticationOnly")] - [Obsolete] - public bool? ThreeDSAuthenticationOnly { get { return this.ThreeDSAuthenticationOnlyOption; } set { this.ThreeDSAuthenticationOnlyOption = new Option(value); } } - - /// - /// Used to track the state of TrustedShopper - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TrustedShopperOption { get; private set; } + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. + [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.authenticationOnly` instead.")] + public bool? ThreeDSAuthenticationOnly { get; set; } /// /// Set to true if the payment should be routed to a trusted MID. /// /// Set to true if the payment should be routed to a trusted MID. - [JsonPropertyName("trustedShopper")] - public bool? TrustedShopper { get { return this.TrustedShopperOption; } set { this.TrustedShopperOption = new Option(value); } } + [DataMember(Name = "trustedShopper", EmitDefaultValue = false)] + public bool? TrustedShopper { get; set; } /// /// Returns the string presentation of the object @@ -1466,14 +749,11 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CreateCheckoutSessionRequest {\n"); - sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" AccountInfo: ").Append(AccountInfo).Append("\n"); sb.Append(" AdditionalAmount: ").Append(AdditionalAmount).Append("\n"); sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" AuthenticationData: ").Append(AuthenticationData).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); @@ -1495,6 +775,7 @@ public override string ToString() sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" Mandate: ").Append(Mandate).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append(" Mode: ").Append(Mode).Append("\n"); @@ -1505,6 +786,8 @@ public override string ToString() sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); sb.Append(" RedirectFromIssuerMethod: ").Append(RedirectFromIssuerMethod).Append("\n"); sb.Append(" RedirectToIssuerMethod: ").Append(RedirectToIssuerMethod).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" RiskData: ").Append(RiskData).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" ShopperIP: ").Append(ShopperIP).Append("\n"); @@ -1532,949 +815,569 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // ReturnUrl (string) maxLength - if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) - { - yield return new ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); - } - - // ShopperReference (string) maxLength - if (this.ShopperReference != null && this.ShopperReference.Length > 256) - { - yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); - } - - // ShopperReference (string) minLength - if (this.ShopperReference != null && this.ShopperReference.Length < 3) - { - yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - - /// - /// A Json converter for type - /// - public class CreateCheckoutSessionRequestJsonConverter : JsonConverter - { - /// - /// The format to use to serialize DateOfBirth - /// - public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd"; - - /// - /// The format to use to serialize DeliverAt - /// - public static string DeliverAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// The format to use to serialize ExpiresAt + /// Returns true if objects are equal /// - public static string ExpiresAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CreateCheckoutSessionRequest); + } /// - /// Deserializes json to + /// Returns true if CreateCheckoutSessionRequest instances are equal /// - /// - /// - /// - /// - /// - public override CreateCheckoutSessionRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Instance of CreateCheckoutSessionRequest to be compared + /// Boolean + public bool Equals(CreateCheckoutSessionRequest input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option merchantAccount = default; - Option reference = default; - Option returnUrl = default; - Option accountInfo = default; - Option additionalAmount = default; - Option> additionalData = default; - Option> allowedPaymentMethods = default; - Option applicationInfo = default; - Option authenticationData = default; - Option billingAddress = default; - Option> blockedPaymentMethods = default; - Option captureDelayHours = default; - Option channel = default; - Option company = default; - Option countryCode = default; - Option dateOfBirth = default; - Option deliverAt = default; - Option deliveryAddress = default; - Option enableOneClick = default; - Option enablePayOut = default; - Option enableRecurring = default; - Option expiresAt = default; - Option fundOrigin = default; - Option fundRecipient = default; - Option> installmentOptions = default; - Option> lineItems = default; - Option mandate = default; - Option mcc = default; - Option merchantOrderReference = default; - Option> metadata = default; - Option mode = default; - Option mpiData = default; - Option platformChargebackLogic = default; - Option recurringExpiry = default; - Option recurringFrequency = default; - Option recurringProcessingModel = default; - Option redirectFromIssuerMethod = default; - Option redirectToIssuerMethod = default; - Option riskData = default; - Option shopperEmail = default; - Option shopperIP = default; - Option shopperInteraction = default; - Option shopperLocale = default; - Option shopperName = default; - Option shopperReference = default; - Option shopperStatement = default; - Option showInstallmentAmount = default; - Option showRemovePaymentMethodButton = default; - Option socialSecurityNumber = default; - Option splitCardFundingSources = default; - Option> splits = default; - Option store = default; - Option storeFiltrationMode = default; - Option storePaymentMethod = default; - Option storePaymentMethodMode = default; - Option telephoneNumber = default; - Option themeId = default; - Option threeDS2RequestData = default; - Option threeDSAuthenticationOnly = default; - Option trustedShopper = default; - - while (utf8JsonReader.Read()) + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "returnUrl": - returnUrl = new Option(utf8JsonReader.GetString()); - break; - case "accountInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - accountInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "additionalAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "additionalData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "allowedPaymentMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - allowedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "applicationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "authenticationData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - authenticationData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "billingAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - billingAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "blockedPaymentMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - blockedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "captureDelayHours": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - captureDelayHours = new Option(utf8JsonReader.GetInt32()); - break; - case "channel": - string channelRawValue = utf8JsonReader.GetString(); - if (channelRawValue != null) - channel = new Option(CreateCheckoutSessionRequest.ChannelEnumFromStringOrDefault(channelRawValue)); - break; - case "company": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - company = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "countryCode": - countryCode = new Option(utf8JsonReader.GetString()); - break; - case "dateOfBirth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliverAt": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliverAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliveryAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliveryAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "enableOneClick": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enableOneClick = new Option(utf8JsonReader.GetBoolean()); - break; - case "enablePayOut": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enablePayOut = new Option(utf8JsonReader.GetBoolean()); - break; - case "enableRecurring": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enableRecurring = new Option(utf8JsonReader.GetBoolean()); - break; - case "expiresAt": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - expiresAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "fundOrigin": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fundOrigin = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "fundRecipient": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fundRecipient = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "installmentOptions": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - installmentOptions = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "lineItems": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mandate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mandate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mcc": - mcc = new Option(utf8JsonReader.GetString()); - break; - case "merchantOrderReference": - merchantOrderReference = new Option(utf8JsonReader.GetString()); - break; - case "metadata": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mode": - string modeRawValue = utf8JsonReader.GetString(); - if (modeRawValue != null) - mode = new Option(CreateCheckoutSessionRequest.ModeEnumFromStringOrDefault(modeRawValue)); - break; - case "mpiData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mpiData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "platformChargebackLogic": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "recurringExpiry": - recurringExpiry = new Option(utf8JsonReader.GetString()); - break; - case "recurringFrequency": - recurringFrequency = new Option(utf8JsonReader.GetString()); - break; - case "recurringProcessingModel": - string recurringProcessingModelRawValue = utf8JsonReader.GetString(); - if (recurringProcessingModelRawValue != null) - recurringProcessingModel = new Option(CreateCheckoutSessionRequest.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); - break; - case "redirectFromIssuerMethod": - redirectFromIssuerMethod = new Option(utf8JsonReader.GetString()); - break; - case "redirectToIssuerMethod": - redirectToIssuerMethod = new Option(utf8JsonReader.GetString()); - break; - case "riskData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - riskData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "shopperIP": - shopperIP = new Option(utf8JsonReader.GetString()); - break; - case "shopperInteraction": - string shopperInteractionRawValue = utf8JsonReader.GetString(); - if (shopperInteractionRawValue != null) - shopperInteraction = new Option(CreateCheckoutSessionRequest.ShopperInteractionEnumFromStringOrDefault(shopperInteractionRawValue)); - break; - case "shopperLocale": - shopperLocale = new Option(utf8JsonReader.GetString()); - break; - case "shopperName": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperReference": - shopperReference = new Option(utf8JsonReader.GetString()); - break; - case "shopperStatement": - shopperStatement = new Option(utf8JsonReader.GetString()); - break; - case "showInstallmentAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - showInstallmentAmount = new Option(utf8JsonReader.GetBoolean()); - break; - case "showRemovePaymentMethodButton": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - showRemovePaymentMethodButton = new Option(utf8JsonReader.GetBoolean()); - break; - case "socialSecurityNumber": - socialSecurityNumber = new Option(utf8JsonReader.GetString()); - break; - case "splitCardFundingSources": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splitCardFundingSources = new Option(utf8JsonReader.GetBoolean()); - break; - case "splits": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "store": - store = new Option(utf8JsonReader.GetString()); - break; - case "storeFiltrationMode": - string storeFiltrationModeRawValue = utf8JsonReader.GetString(); - if (storeFiltrationModeRawValue != null) - storeFiltrationMode = new Option(CreateCheckoutSessionRequest.StoreFiltrationModeEnumFromStringOrDefault(storeFiltrationModeRawValue)); - break; - case "storePaymentMethod": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - storePaymentMethod = new Option(utf8JsonReader.GetBoolean()); - break; - case "storePaymentMethodMode": - string storePaymentMethodModeRawValue = utf8JsonReader.GetString(); - if (storePaymentMethodModeRawValue != null) - storePaymentMethodMode = new Option(CreateCheckoutSessionRequest.StorePaymentMethodModeEnumFromStringOrDefault(storePaymentMethodModeRawValue)); - break; - case "telephoneNumber": - telephoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "themeId": - themeId = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2RequestData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDSAuthenticationOnly": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDSAuthenticationOnly = new Option(utf8JsonReader.GetBoolean()); - break; - case "trustedShopper": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - trustedShopper = new Option(utf8JsonReader.GetBoolean()); - break; - default: - break; - } - } + return false; } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class CreateCheckoutSessionRequest.", nameof(amount)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class CreateCheckoutSessionRequest.", nameof(merchantAccount)); - - if (!reference.IsSet) - throw new ArgumentException("Property is required for class CreateCheckoutSessionRequest.", nameof(reference)); - - if (!returnUrl.IsSet) - throw new ArgumentException("Property is required for class CreateCheckoutSessionRequest.", nameof(returnUrl)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (returnUrl.IsSet && returnUrl.Value == null) - throw new ArgumentNullException(nameof(returnUrl), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (accountInfo.IsSet && accountInfo.Value == null) - throw new ArgumentNullException(nameof(accountInfo), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (additionalAmount.IsSet && additionalAmount.Value == null) - throw new ArgumentNullException(nameof(additionalAmount), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (additionalData.IsSet && additionalData.Value == null) - throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (allowedPaymentMethods.IsSet && allowedPaymentMethods.Value == null) - throw new ArgumentNullException(nameof(allowedPaymentMethods), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (applicationInfo.IsSet && applicationInfo.Value == null) - throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (authenticationData.IsSet && authenticationData.Value == null) - throw new ArgumentNullException(nameof(authenticationData), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (blockedPaymentMethods.IsSet && blockedPaymentMethods.Value == null) - throw new ArgumentNullException(nameof(blockedPaymentMethods), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (captureDelayHours.IsSet && captureDelayHours.Value == null) - throw new ArgumentNullException(nameof(captureDelayHours), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (channel.IsSet && channel.Value == null) - throw new ArgumentNullException(nameof(channel), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (company.IsSet && company.Value == null) - throw new ArgumentNullException(nameof(company), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (countryCode.IsSet && countryCode.Value == null) - throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (dateOfBirth.IsSet && dateOfBirth.Value == null) - throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (deliverAt.IsSet && deliverAt.Value == null) - throw new ArgumentNullException(nameof(deliverAt), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (deliveryAddress.IsSet && deliveryAddress.Value == null) - throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (enableOneClick.IsSet && enableOneClick.Value == null) - throw new ArgumentNullException(nameof(enableOneClick), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (enablePayOut.IsSet && enablePayOut.Value == null) - throw new ArgumentNullException(nameof(enablePayOut), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (enableRecurring.IsSet && enableRecurring.Value == null) - throw new ArgumentNullException(nameof(enableRecurring), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (expiresAt.IsSet && expiresAt.Value == null) - throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (fundOrigin.IsSet && fundOrigin.Value == null) - throw new ArgumentNullException(nameof(fundOrigin), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (fundRecipient.IsSet && fundRecipient.Value == null) - throw new ArgumentNullException(nameof(fundRecipient), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (installmentOptions.IsSet && installmentOptions.Value == null) - throw new ArgumentNullException(nameof(installmentOptions), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (lineItems.IsSet && lineItems.Value == null) - throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (mandate.IsSet && mandate.Value == null) - throw new ArgumentNullException(nameof(mandate), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (mcc.IsSet && mcc.Value == null) - throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (merchantOrderReference.IsSet && merchantOrderReference.Value == null) - throw new ArgumentNullException(nameof(merchantOrderReference), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (metadata.IsSet && metadata.Value == null) - throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (mode.IsSet && mode.Value == null) - throw new ArgumentNullException(nameof(mode), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (mpiData.IsSet && mpiData.Value == null) - throw new ArgumentNullException(nameof(mpiData), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) - throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (recurringExpiry.IsSet && recurringExpiry.Value == null) - throw new ArgumentNullException(nameof(recurringExpiry), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (recurringFrequency.IsSet && recurringFrequency.Value == null) - throw new ArgumentNullException(nameof(recurringFrequency), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) - throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (redirectFromIssuerMethod.IsSet && redirectFromIssuerMethod.Value == null) - throw new ArgumentNullException(nameof(redirectFromIssuerMethod), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (redirectToIssuerMethod.IsSet && redirectToIssuerMethod.Value == null) - throw new ArgumentNullException(nameof(redirectToIssuerMethod), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (riskData.IsSet && riskData.Value == null) - throw new ArgumentNullException(nameof(riskData), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (shopperIP.IsSet && shopperIP.Value == null) - throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (shopperInteraction.IsSet && shopperInteraction.Value == null) - throw new ArgumentNullException(nameof(shopperInteraction), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (shopperLocale.IsSet && shopperLocale.Value == null) - throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (shopperName.IsSet && shopperName.Value == null) - throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (shopperStatement.IsSet && shopperStatement.Value == null) - throw new ArgumentNullException(nameof(shopperStatement), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (showInstallmentAmount.IsSet && showInstallmentAmount.Value == null) - throw new ArgumentNullException(nameof(showInstallmentAmount), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (showRemovePaymentMethodButton.IsSet && showRemovePaymentMethodButton.Value == null) - throw new ArgumentNullException(nameof(showRemovePaymentMethodButton), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) - throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (splitCardFundingSources.IsSet && splitCardFundingSources.Value == null) - throw new ArgumentNullException(nameof(splitCardFundingSources), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (splits.IsSet && splits.Value == null) - throw new ArgumentNullException(nameof(splits), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (store.IsSet && store.Value == null) - throw new ArgumentNullException(nameof(store), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (storeFiltrationMode.IsSet && storeFiltrationMode.Value == null) - throw new ArgumentNullException(nameof(storeFiltrationMode), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (storePaymentMethod.IsSet && storePaymentMethod.Value == null) - throw new ArgumentNullException(nameof(storePaymentMethod), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (storePaymentMethodMode.IsSet && storePaymentMethodMode.Value == null) - throw new ArgumentNullException(nameof(storePaymentMethodMode), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (telephoneNumber.IsSet && telephoneNumber.Value == null) - throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (themeId.IsSet && themeId.Value == null) - throw new ArgumentNullException(nameof(themeId), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) - throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (threeDSAuthenticationOnly.IsSet && threeDSAuthenticationOnly.Value == null) - throw new ArgumentNullException(nameof(threeDSAuthenticationOnly), "Property is not nullable for class CreateCheckoutSessionRequest."); - - if (trustedShopper.IsSet && trustedShopper.Value == null) - throw new ArgumentNullException(nameof(trustedShopper), "Property is not nullable for class CreateCheckoutSessionRequest."); - - return new CreateCheckoutSessionRequest(amount.Value, merchantAccount.Value, reference.Value, returnUrl.Value, accountInfo, additionalAmount, additionalData, allowedPaymentMethods, applicationInfo, authenticationData, billingAddress, blockedPaymentMethods, captureDelayHours, channel, company, countryCode, dateOfBirth, deliverAt, deliveryAddress, enableOneClick, enablePayOut, enableRecurring, expiresAt, fundOrigin, fundRecipient, installmentOptions, lineItems, mandate, mcc, merchantOrderReference, metadata, mode, mpiData, platformChargebackLogic, recurringExpiry, recurringFrequency, recurringProcessingModel, redirectFromIssuerMethod, redirectToIssuerMethod, riskData, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, showInstallmentAmount, showRemovePaymentMethodButton, socialSecurityNumber, splitCardFundingSources, splits, store, storeFiltrationMode, storePaymentMethod, storePaymentMethodMode, telephoneNumber, themeId, threeDS2RequestData, threeDSAuthenticationOnly, trustedShopper); + return + ( + this.AccountInfo == input.AccountInfo || + (this.AccountInfo != null && + this.AccountInfo.Equals(input.AccountInfo)) + ) && + ( + this.AdditionalAmount == input.AdditionalAmount || + (this.AdditionalAmount != null && + this.AdditionalAmount.Equals(input.AdditionalAmount)) + ) && + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + input.AdditionalData != null && + this.AdditionalData.SequenceEqual(input.AdditionalData) + ) && + ( + this.AllowedPaymentMethods == input.AllowedPaymentMethods || + this.AllowedPaymentMethods != null && + input.AllowedPaymentMethods != null && + this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.ApplicationInfo == input.ApplicationInfo || + (this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo)) + ) && + ( + this.AuthenticationData == input.AuthenticationData || + (this.AuthenticationData != null && + this.AuthenticationData.Equals(input.AuthenticationData)) + ) && + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.BlockedPaymentMethods == input.BlockedPaymentMethods || + this.BlockedPaymentMethods != null && + input.BlockedPaymentMethods != null && + this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) + ) && + ( + this.CaptureDelayHours == input.CaptureDelayHours || + this.CaptureDelayHours.Equals(input.CaptureDelayHours) + ) && + ( + this.Channel == input.Channel || + this.Channel.Equals(input.Channel) + ) && + ( + this.Company == input.Company || + (this.Company != null && + this.Company.Equals(input.Company)) + ) && + ( + this.CountryCode == input.CountryCode || + (this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode)) + ) && + ( + this.DateOfBirth == input.DateOfBirth || + (this.DateOfBirth != null && + this.DateOfBirth.Equals(input.DateOfBirth)) + ) && + ( + this.DeliverAt == input.DeliverAt || + (this.DeliverAt != null && + this.DeliverAt.Equals(input.DeliverAt)) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + (this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress)) + ) && + ( + this.EnableOneClick == input.EnableOneClick || + this.EnableOneClick.Equals(input.EnableOneClick) + ) && + ( + this.EnablePayOut == input.EnablePayOut || + this.EnablePayOut.Equals(input.EnablePayOut) + ) && + ( + this.EnableRecurring == input.EnableRecurring || + this.EnableRecurring.Equals(input.EnableRecurring) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) + ) && + ( + this.FundOrigin == input.FundOrigin || + (this.FundOrigin != null && + this.FundOrigin.Equals(input.FundOrigin)) + ) && + ( + this.FundRecipient == input.FundRecipient || + (this.FundRecipient != null && + this.FundRecipient.Equals(input.FundRecipient)) + ) && + ( + this.InstallmentOptions == input.InstallmentOptions || + this.InstallmentOptions != null && + input.InstallmentOptions != null && + this.InstallmentOptions.SequenceEqual(input.InstallmentOptions) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.Mandate == input.Mandate || + (this.Mandate != null && + this.Mandate.Equals(input.Mandate)) + ) && + ( + this.Mcc == input.Mcc || + (this.Mcc != null && + this.Mcc.Equals(input.Mcc)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.MerchantOrderReference == input.MerchantOrderReference || + (this.MerchantOrderReference != null && + this.MerchantOrderReference.Equals(input.MerchantOrderReference)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.Mode == input.Mode || + this.Mode.Equals(input.Mode) + ) && + ( + this.MpiData == input.MpiData || + (this.MpiData != null && + this.MpiData.Equals(input.MpiData)) + ) && + ( + this.PlatformChargebackLogic == input.PlatformChargebackLogic || + (this.PlatformChargebackLogic != null && + this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) + ) && + ( + this.RecurringExpiry == input.RecurringExpiry || + (this.RecurringExpiry != null && + this.RecurringExpiry.Equals(input.RecurringExpiry)) + ) && + ( + this.RecurringFrequency == input.RecurringFrequency || + (this.RecurringFrequency != null && + this.RecurringFrequency.Equals(input.RecurringFrequency)) + ) && + ( + this.RecurringProcessingModel == input.RecurringProcessingModel || + this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) + ) && + ( + this.RedirectFromIssuerMethod == input.RedirectFromIssuerMethod || + (this.RedirectFromIssuerMethod != null && + this.RedirectFromIssuerMethod.Equals(input.RedirectFromIssuerMethod)) + ) && + ( + this.RedirectToIssuerMethod == input.RedirectToIssuerMethod || + (this.RedirectToIssuerMethod != null && + this.RedirectToIssuerMethod.Equals(input.RedirectToIssuerMethod)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.ReturnUrl == input.ReturnUrl || + (this.ReturnUrl != null && + this.ReturnUrl.Equals(input.ReturnUrl)) + ) && + ( + this.RiskData == input.RiskData || + (this.RiskData != null && + this.RiskData.Equals(input.RiskData)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.ShopperIP == input.ShopperIP || + (this.ShopperIP != null && + this.ShopperIP.Equals(input.ShopperIP)) + ) && + ( + this.ShopperInteraction == input.ShopperInteraction || + this.ShopperInteraction.Equals(input.ShopperInteraction) + ) && + ( + this.ShopperLocale == input.ShopperLocale || + (this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale)) + ) && + ( + this.ShopperName == input.ShopperName || + (this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName)) + ) && + ( + this.ShopperReference == input.ShopperReference || + (this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference)) + ) && + ( + this.ShopperStatement == input.ShopperStatement || + (this.ShopperStatement != null && + this.ShopperStatement.Equals(input.ShopperStatement)) + ) && + ( + this.ShowInstallmentAmount == input.ShowInstallmentAmount || + this.ShowInstallmentAmount.Equals(input.ShowInstallmentAmount) + ) && + ( + this.ShowRemovePaymentMethodButton == input.ShowRemovePaymentMethodButton || + this.ShowRemovePaymentMethodButton.Equals(input.ShowRemovePaymentMethodButton) + ) && + ( + this.SocialSecurityNumber == input.SocialSecurityNumber || + (this.SocialSecurityNumber != null && + this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) + ) && + ( + this.SplitCardFundingSources == input.SplitCardFundingSources || + this.SplitCardFundingSources.Equals(input.SplitCardFundingSources) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.Store == input.Store || + (this.Store != null && + this.Store.Equals(input.Store)) + ) && + ( + this.StoreFiltrationMode == input.StoreFiltrationMode || + this.StoreFiltrationMode.Equals(input.StoreFiltrationMode) + ) && + ( + this.StorePaymentMethod == input.StorePaymentMethod || + this.StorePaymentMethod.Equals(input.StorePaymentMethod) + ) && + ( + this.StorePaymentMethodMode == input.StorePaymentMethodMode || + this.StorePaymentMethodMode.Equals(input.StorePaymentMethodMode) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + (this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber)) + ) && + ( + this.ThemeId == input.ThemeId || + (this.ThemeId != null && + this.ThemeId.Equals(input.ThemeId)) + ) && + ( + this.ThreeDS2RequestData == input.ThreeDS2RequestData || + (this.ThreeDS2RequestData != null && + this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) + ) && + ( + this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || + this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) + ) && + ( + this.TrustedShopper == input.TrustedShopper || + this.TrustedShopper.Equals(input.TrustedShopper) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CreateCheckoutSessionRequest createCheckoutSessionRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, createCheckoutSessionRequest, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AccountInfo != null) + { + hashCode = (hashCode * 59) + this.AccountInfo.GetHashCode(); + } + if (this.AdditionalAmount != null) + { + hashCode = (hashCode * 59) + this.AdditionalAmount.GetHashCode(); + } + if (this.AdditionalData != null) + { + hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); + } + if (this.AllowedPaymentMethods != null) + { + hashCode = (hashCode * 59) + this.AllowedPaymentMethods.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.ApplicationInfo != null) + { + hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); + } + if (this.AuthenticationData != null) + { + hashCode = (hashCode * 59) + this.AuthenticationData.GetHashCode(); + } + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.BlockedPaymentMethods != null) + { + hashCode = (hashCode * 59) + this.BlockedPaymentMethods.GetHashCode(); + } + hashCode = (hashCode * 59) + this.CaptureDelayHours.GetHashCode(); + hashCode = (hashCode * 59) + this.Channel.GetHashCode(); + if (this.Company != null) + { + hashCode = (hashCode * 59) + this.Company.GetHashCode(); + } + if (this.CountryCode != null) + { + hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); + } + if (this.DateOfBirth != null) + { + hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); + } + if (this.DeliverAt != null) + { + hashCode = (hashCode * 59) + this.DeliverAt.GetHashCode(); + } + if (this.DeliveryAddress != null) + { + hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); + } + hashCode = (hashCode * 59) + this.EnableOneClick.GetHashCode(); + hashCode = (hashCode * 59) + this.EnablePayOut.GetHashCode(); + hashCode = (hashCode * 59) + this.EnableRecurring.GetHashCode(); + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } + if (this.FundOrigin != null) + { + hashCode = (hashCode * 59) + this.FundOrigin.GetHashCode(); + } + if (this.FundRecipient != null) + { + hashCode = (hashCode * 59) + this.FundRecipient.GetHashCode(); + } + if (this.InstallmentOptions != null) + { + hashCode = (hashCode * 59) + this.InstallmentOptions.GetHashCode(); + } + if (this.LineItems != null) + { + hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); + } + if (this.Mandate != null) + { + hashCode = (hashCode * 59) + this.Mandate.GetHashCode(); + } + if (this.Mcc != null) + { + hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.MerchantOrderReference != null) + { + hashCode = (hashCode * 59) + this.MerchantOrderReference.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Mode.GetHashCode(); + if (this.MpiData != null) + { + hashCode = (hashCode * 59) + this.MpiData.GetHashCode(); + } + if (this.PlatformChargebackLogic != null) + { + hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); + } + if (this.RecurringExpiry != null) + { + hashCode = (hashCode * 59) + this.RecurringExpiry.GetHashCode(); + } + if (this.RecurringFrequency != null) + { + hashCode = (hashCode * 59) + this.RecurringFrequency.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); + if (this.RedirectFromIssuerMethod != null) + { + hashCode = (hashCode * 59) + this.RedirectFromIssuerMethod.GetHashCode(); + } + if (this.RedirectToIssuerMethod != null) + { + hashCode = (hashCode * 59) + this.RedirectToIssuerMethod.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.ReturnUrl != null) + { + hashCode = (hashCode * 59) + this.ReturnUrl.GetHashCode(); + } + if (this.RiskData != null) + { + hashCode = (hashCode * 59) + this.RiskData.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.ShopperIP != null) + { + hashCode = (hashCode * 59) + this.ShopperIP.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ShopperInteraction.GetHashCode(); + if (this.ShopperLocale != null) + { + hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); + } + if (this.ShopperName != null) + { + hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); + } + if (this.ShopperReference != null) + { + hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); + } + if (this.ShopperStatement != null) + { + hashCode = (hashCode * 59) + this.ShopperStatement.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ShowInstallmentAmount.GetHashCode(); + hashCode = (hashCode * 59) + this.ShowRemovePaymentMethodButton.GetHashCode(); + if (this.SocialSecurityNumber != null) + { + hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); + } + hashCode = (hashCode * 59) + this.SplitCardFundingSources.GetHashCode(); + if (this.Splits != null) + { + hashCode = (hashCode * 59) + this.Splits.GetHashCode(); + } + if (this.Store != null) + { + hashCode = (hashCode * 59) + this.Store.GetHashCode(); + } + hashCode = (hashCode * 59) + this.StoreFiltrationMode.GetHashCode(); + hashCode = (hashCode * 59) + this.StorePaymentMethod.GetHashCode(); + hashCode = (hashCode * 59) + this.StorePaymentMethodMode.GetHashCode(); + if (this.TelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); + } + if (this.ThemeId != null) + { + hashCode = (hashCode * 59) + this.ThemeId.GetHashCode(); + } + if (this.ThreeDS2RequestData != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ThreeDSAuthenticationOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.TrustedShopper.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CreateCheckoutSessionRequest createCheckoutSessionRequest, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (createCheckoutSessionRequest.Amount == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Amount), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.MerchantAccount), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.Reference == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Reference), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.ReturnUrl == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ReturnUrl), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.AccountInfoOption.IsSet && createCheckoutSessionRequest.AccountInfo == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.AccountInfo), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.AdditionalAmountOption.IsSet && createCheckoutSessionRequest.AdditionalAmount == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.AdditionalAmount), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.AdditionalDataOption.IsSet && createCheckoutSessionRequest.AdditionalData == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.AdditionalData), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.AllowedPaymentMethodsOption.IsSet && createCheckoutSessionRequest.AllowedPaymentMethods == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.AllowedPaymentMethods), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.ApplicationInfoOption.IsSet && createCheckoutSessionRequest.ApplicationInfo == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ApplicationInfo), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.AuthenticationDataOption.IsSet && createCheckoutSessionRequest.AuthenticationData == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.AuthenticationData), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.BillingAddressOption.IsSet && createCheckoutSessionRequest.BillingAddress == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.BillingAddress), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.BlockedPaymentMethodsOption.IsSet && createCheckoutSessionRequest.BlockedPaymentMethods == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.BlockedPaymentMethods), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.CompanyOption.IsSet && createCheckoutSessionRequest.Company == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Company), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.CountryCodeOption.IsSet && createCheckoutSessionRequest.CountryCode == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.CountryCode), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.DeliveryAddressOption.IsSet && createCheckoutSessionRequest.DeliveryAddress == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.DeliveryAddress), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.FundOriginOption.IsSet && createCheckoutSessionRequest.FundOrigin == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.FundOrigin), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.FundRecipientOption.IsSet && createCheckoutSessionRequest.FundRecipient == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.FundRecipient), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.InstallmentOptionsOption.IsSet && createCheckoutSessionRequest.InstallmentOptions == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.InstallmentOptions), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.LineItemsOption.IsSet && createCheckoutSessionRequest.LineItems == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.LineItems), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.MandateOption.IsSet && createCheckoutSessionRequest.Mandate == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Mandate), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.MccOption.IsSet && createCheckoutSessionRequest.Mcc == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Mcc), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.MerchantOrderReferenceOption.IsSet && createCheckoutSessionRequest.MerchantOrderReference == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.MerchantOrderReference), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.MetadataOption.IsSet && createCheckoutSessionRequest.Metadata == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Metadata), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.MpiDataOption.IsSet && createCheckoutSessionRequest.MpiData == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.MpiData), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.PlatformChargebackLogicOption.IsSet && createCheckoutSessionRequest.PlatformChargebackLogic == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.PlatformChargebackLogic), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.RecurringExpiryOption.IsSet && createCheckoutSessionRequest.RecurringExpiry == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.RecurringExpiry), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.RecurringFrequencyOption.IsSet && createCheckoutSessionRequest.RecurringFrequency == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.RecurringFrequency), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.RedirectFromIssuerMethodOption.IsSet && createCheckoutSessionRequest.RedirectFromIssuerMethod == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.RedirectFromIssuerMethod), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.RedirectToIssuerMethodOption.IsSet && createCheckoutSessionRequest.RedirectToIssuerMethod == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.RedirectToIssuerMethod), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.RiskDataOption.IsSet && createCheckoutSessionRequest.RiskData == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.RiskData), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.ShopperEmailOption.IsSet && createCheckoutSessionRequest.ShopperEmail == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ShopperEmail), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.ShopperIPOption.IsSet && createCheckoutSessionRequest.ShopperIP == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ShopperIP), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.ShopperLocaleOption.IsSet && createCheckoutSessionRequest.ShopperLocale == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ShopperLocale), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.ShopperNameOption.IsSet && createCheckoutSessionRequest.ShopperName == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ShopperName), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.ShopperReferenceOption.IsSet && createCheckoutSessionRequest.ShopperReference == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ShopperReference), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.ShopperStatementOption.IsSet && createCheckoutSessionRequest.ShopperStatement == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ShopperStatement), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.SocialSecurityNumberOption.IsSet && createCheckoutSessionRequest.SocialSecurityNumber == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.SocialSecurityNumber), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.SplitsOption.IsSet && createCheckoutSessionRequest.Splits == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Splits), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.StoreOption.IsSet && createCheckoutSessionRequest.Store == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.Store), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.TelephoneNumberOption.IsSet && createCheckoutSessionRequest.TelephoneNumber == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.TelephoneNumber), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.ThemeIdOption.IsSet && createCheckoutSessionRequest.ThemeId == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ThemeId), "Property is required for class CreateCheckoutSessionRequest."); - - if (createCheckoutSessionRequest.ThreeDS2RequestDataOption.IsSet && createCheckoutSessionRequest.ThreeDS2RequestData == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest.ThreeDS2RequestData), "Property is required for class CreateCheckoutSessionRequest."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.Amount, jsonSerializerOptions); - writer.WriteString("merchantAccount", createCheckoutSessionRequest.MerchantAccount); - - writer.WriteString("reference", createCheckoutSessionRequest.Reference); - - writer.WriteString("returnUrl", createCheckoutSessionRequest.ReturnUrl); - - if (createCheckoutSessionRequest.AccountInfoOption.IsSet) - { - writer.WritePropertyName("accountInfo"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.AccountInfo, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.AdditionalAmountOption.IsSet) - { - writer.WritePropertyName("additionalAmount"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.AdditionalAmount, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.AdditionalDataOption.IsSet) - { - writer.WritePropertyName("additionalData"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.AdditionalData, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.AllowedPaymentMethodsOption.IsSet) - { - writer.WritePropertyName("allowedPaymentMethods"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.AllowedPaymentMethods, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.ApplicationInfoOption.IsSet) - { - writer.WritePropertyName("applicationInfo"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.ApplicationInfo, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.AuthenticationDataOption.IsSet) - { - writer.WritePropertyName("authenticationData"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.AuthenticationData, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.BillingAddressOption.IsSet) - { - writer.WritePropertyName("billingAddress"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.BillingAddress, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.BlockedPaymentMethodsOption.IsSet) - { - writer.WritePropertyName("blockedPaymentMethods"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.BlockedPaymentMethods, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.CaptureDelayHoursOption.IsSet) - writer.WriteNumber("captureDelayHours", createCheckoutSessionRequest.CaptureDelayHoursOption.Value.Value); - - var channelRawValue = CreateCheckoutSessionRequest.ChannelEnumToJsonValue(createCheckoutSessionRequest.ChannelOption.Value.Value); - writer.WriteString("channel", channelRawValue); - if (createCheckoutSessionRequest.CompanyOption.IsSet) - { - writer.WritePropertyName("company"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.Company, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.CountryCodeOption.IsSet) - writer.WriteString("countryCode", createCheckoutSessionRequest.CountryCode); - - if (createCheckoutSessionRequest.DateOfBirthOption.IsSet) - writer.WriteString("dateOfBirth", createCheckoutSessionRequest.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); - - if (createCheckoutSessionRequest.DeliverAtOption.IsSet) - writer.WriteString("deliverAt", createCheckoutSessionRequest.DeliverAtOption.Value.Value.ToString(DeliverAtFormat)); - - if (createCheckoutSessionRequest.DeliveryAddressOption.IsSet) - { - writer.WritePropertyName("deliveryAddress"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.DeliveryAddress, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.EnableOneClickOption.IsSet) - writer.WriteBoolean("enableOneClick", createCheckoutSessionRequest.EnableOneClickOption.Value.Value); - - if (createCheckoutSessionRequest.EnablePayOutOption.IsSet) - writer.WriteBoolean("enablePayOut", createCheckoutSessionRequest.EnablePayOutOption.Value.Value); - - if (createCheckoutSessionRequest.EnableRecurringOption.IsSet) - writer.WriteBoolean("enableRecurring", createCheckoutSessionRequest.EnableRecurringOption.Value.Value); - - if (createCheckoutSessionRequest.ExpiresAtOption.IsSet) - writer.WriteString("expiresAt", createCheckoutSessionRequest.ExpiresAtOption.Value.Value.ToString(ExpiresAtFormat)); - - if (createCheckoutSessionRequest.FundOriginOption.IsSet) - { - writer.WritePropertyName("fundOrigin"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.FundOrigin, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.FundRecipientOption.IsSet) - { - writer.WritePropertyName("fundRecipient"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.FundRecipient, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.InstallmentOptionsOption.IsSet) - { - writer.WritePropertyName("installmentOptions"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.InstallmentOptions, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.LineItemsOption.IsSet) - { - writer.WritePropertyName("lineItems"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.LineItems, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.MandateOption.IsSet) - { - writer.WritePropertyName("mandate"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.Mandate, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.MccOption.IsSet) - writer.WriteString("mcc", createCheckoutSessionRequest.Mcc); - - if (createCheckoutSessionRequest.MerchantOrderReferenceOption.IsSet) - writer.WriteString("merchantOrderReference", createCheckoutSessionRequest.MerchantOrderReference); - - if (createCheckoutSessionRequest.MetadataOption.IsSet) - { - writer.WritePropertyName("metadata"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.Metadata, jsonSerializerOptions); - } - var modeRawValue = CreateCheckoutSessionRequest.ModeEnumToJsonValue(createCheckoutSessionRequest.ModeOption.Value.Value); - writer.WriteString("mode", modeRawValue); - if (createCheckoutSessionRequest.MpiDataOption.IsSet) - { - writer.WritePropertyName("mpiData"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.MpiData, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.PlatformChargebackLogicOption.IsSet) - { - writer.WritePropertyName("platformChargebackLogic"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.PlatformChargebackLogic, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.RecurringExpiryOption.IsSet) - writer.WriteString("recurringExpiry", createCheckoutSessionRequest.RecurringExpiry); - - if (createCheckoutSessionRequest.RecurringFrequencyOption.IsSet) - writer.WriteString("recurringFrequency", createCheckoutSessionRequest.RecurringFrequency); - - var recurringProcessingModelRawValue = CreateCheckoutSessionRequest.RecurringProcessingModelEnumToJsonValue(createCheckoutSessionRequest.RecurringProcessingModelOption.Value.Value); - writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); - if (createCheckoutSessionRequest.RedirectFromIssuerMethodOption.IsSet) - writer.WriteString("redirectFromIssuerMethod", createCheckoutSessionRequest.RedirectFromIssuerMethod); - - if (createCheckoutSessionRequest.RedirectToIssuerMethodOption.IsSet) - writer.WriteString("redirectToIssuerMethod", createCheckoutSessionRequest.RedirectToIssuerMethod); - - if (createCheckoutSessionRequest.RiskDataOption.IsSet) - { - writer.WritePropertyName("riskData"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.RiskData, jsonSerializerOptions); - } - if (createCheckoutSessionRequest.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", createCheckoutSessionRequest.ShopperEmail); - - if (createCheckoutSessionRequest.ShopperIPOption.IsSet) - writer.WriteString("shopperIP", createCheckoutSessionRequest.ShopperIP); - - var shopperInteractionRawValue = CreateCheckoutSessionRequest.ShopperInteractionEnumToJsonValue(createCheckoutSessionRequest.ShopperInteractionOption.Value.Value); - writer.WriteString("shopperInteraction", shopperInteractionRawValue); - if (createCheckoutSessionRequest.ShopperLocaleOption.IsSet) - writer.WriteString("shopperLocale", createCheckoutSessionRequest.ShopperLocale); - - if (createCheckoutSessionRequest.ShopperNameOption.IsSet) + // ReturnUrl (string) maxLength + if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) { - writer.WritePropertyName("shopperName"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.ShopperName, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); } - if (createCheckoutSessionRequest.ShopperReferenceOption.IsSet) - writer.WriteString("shopperReference", createCheckoutSessionRequest.ShopperReference); - - if (createCheckoutSessionRequest.ShopperStatementOption.IsSet) - writer.WriteString("shopperStatement", createCheckoutSessionRequest.ShopperStatement); - - if (createCheckoutSessionRequest.ShowInstallmentAmountOption.IsSet) - writer.WriteBoolean("showInstallmentAmount", createCheckoutSessionRequest.ShowInstallmentAmountOption.Value.Value); - if (createCheckoutSessionRequest.ShowRemovePaymentMethodButtonOption.IsSet) - writer.WriteBoolean("showRemovePaymentMethodButton", createCheckoutSessionRequest.ShowRemovePaymentMethodButtonOption.Value.Value); - - if (createCheckoutSessionRequest.SocialSecurityNumberOption.IsSet) - writer.WriteString("socialSecurityNumber", createCheckoutSessionRequest.SocialSecurityNumber); - - if (createCheckoutSessionRequest.SplitCardFundingSourcesOption.IsSet) - writer.WriteBoolean("splitCardFundingSources", createCheckoutSessionRequest.SplitCardFundingSourcesOption.Value.Value); - - if (createCheckoutSessionRequest.SplitsOption.IsSet) + // ShopperReference (string) maxLength + if (this.ShopperReference != null && this.ShopperReference.Length > 256) { - writer.WritePropertyName("splits"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.Splits, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); } - if (createCheckoutSessionRequest.StoreOption.IsSet) - writer.WriteString("store", createCheckoutSessionRequest.Store); - - var storeFiltrationModeRawValue = CreateCheckoutSessionRequest.StoreFiltrationModeEnumToJsonValue(createCheckoutSessionRequest.StoreFiltrationModeOption.Value.Value); - writer.WriteString("storeFiltrationMode", storeFiltrationModeRawValue); - if (createCheckoutSessionRequest.StorePaymentMethodOption.IsSet) - writer.WriteBoolean("storePaymentMethod", createCheckoutSessionRequest.StorePaymentMethodOption.Value.Value); - var storePaymentMethodModeRawValue = CreateCheckoutSessionRequest.StorePaymentMethodModeEnumToJsonValue(createCheckoutSessionRequest.StorePaymentMethodModeOption.Value.Value); - writer.WriteString("storePaymentMethodMode", storePaymentMethodModeRawValue); - if (createCheckoutSessionRequest.TelephoneNumberOption.IsSet) - writer.WriteString("telephoneNumber", createCheckoutSessionRequest.TelephoneNumber); - - if (createCheckoutSessionRequest.ThemeIdOption.IsSet) - writer.WriteString("themeId", createCheckoutSessionRequest.ThemeId); - - if (createCheckoutSessionRequest.ThreeDS2RequestDataOption.IsSet) + // ShopperReference (string) minLength + if (this.ShopperReference != null && this.ShopperReference.Length < 3) { - writer.WritePropertyName("threeDS2RequestData"); - JsonSerializer.Serialize(writer, createCheckoutSessionRequest.ThreeDS2RequestData, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); } - if (createCheckoutSessionRequest.ThreeDSAuthenticationOnlyOption.IsSet) - writer.WriteBoolean("threeDSAuthenticationOnly", createCheckoutSessionRequest.ThreeDSAuthenticationOnlyOption.Value.Value); - if (createCheckoutSessionRequest.TrustedShopperOption.IsSet) - writer.WriteBoolean("trustedShopper", createCheckoutSessionRequest.TrustedShopperOption.Value.Value); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs b/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs index 9aeac9c4a..2e2d58a66 100644 --- a/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs +++ b/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,1483 +15,755 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CreateCheckoutSessionResponse /// + [DataContract(Name = "CreateCheckoutSessionResponse")] public partial class CreateCheckoutSessionResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. - /// A unique identifier of the session. - /// The merchant account identifier, with which you want to process the transaction. - /// The reference to uniquely identify a payment. - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. - /// accountInfo - /// additionalAmount - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - /// applicationInfo - /// authenticationData - /// billingAddress - /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - /// The delay between the authorisation and scheduled auto-capture, specified in hours. - /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** - /// company - /// The shopper's two-letter country code. - /// The shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - /// deliveryAddress - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. - /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. - /// fundOrigin - /// fundRecipient - /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. - /// mandate - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. - /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration (default to ModeEnum.Embedded) - /// mpiData - /// platformChargebackLogic - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. - /// Minimum number of days between authorisations. Only for 3D Secure 2. - /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. - /// Specifies the redirect method (GET or POST) when redirecting to the issuer. - /// riskData - /// The payment session data you need to pass to your front end. - /// The shopper's email address. - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - /// The combination of a language code and a country code to specify the language to be used in the payment. - /// shopperName - /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - /// Set to true to show the payment amount per installment. - /// Set to **true** to show a button that lets the shopper remove a stored payment method. - /// The shopper's social security number. - /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false) - /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). - /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. - /// The shopper's telephone number. - /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. - /// threeDS2RequestData - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) - /// Set to true if the payment should be routed to a trusted MID. - /// The URL for the Hosted Checkout page. Redirect the shopper to this URL so they can make the payment. - [JsonConstructor] - public CreateCheckoutSessionResponse(Amount amount, DateTime expiresAt, string id, string merchantAccount, string reference, string returnUrl, Option accountInfo = default, Option additionalAmount = default, Option> additionalData = default, Option> allowedPaymentMethods = default, Option applicationInfo = default, Option authenticationData = default, Option billingAddress = default, Option> blockedPaymentMethods = default, Option captureDelayHours = default, Option channel = default, Option company = default, Option countryCode = default, Option dateOfBirth = default, Option deliverAt = default, Option deliveryAddress = default, Option enableOneClick = default, Option enablePayOut = default, Option enableRecurring = default, Option fundOrigin = default, Option fundRecipient = default, Option> installmentOptions = default, Option> lineItems = default, Option mandate = default, Option mcc = default, Option merchantOrderReference = default, Option> metadata = default, Option mode = default, Option mpiData = default, Option platformChargebackLogic = default, Option recurringExpiry = default, Option recurringFrequency = default, Option recurringProcessingModel = default, Option redirectFromIssuerMethod = default, Option redirectToIssuerMethod = default, Option riskData = default, Option sessionData = default, Option shopperEmail = default, Option shopperIP = default, Option shopperInteraction = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option shopperStatement = default, Option showInstallmentAmount = default, Option showRemovePaymentMethodButton = default, Option socialSecurityNumber = default, Option splitCardFundingSources = default, Option> splits = default, Option store = default, Option storeFiltrationMode = default, Option storePaymentMethod = default, Option storePaymentMethodMode = default, Option telephoneNumber = default, Option themeId = default, Option threeDS2RequestData = default, Option threeDSAuthenticationOnly = default, Option trustedShopper = default, Option url = default) - { - Amount = amount; - ExpiresAt = expiresAt; - Id = id; - MerchantAccount = merchantAccount; - Reference = reference; - ReturnUrl = returnUrl; - AccountInfoOption = accountInfo; - AdditionalAmountOption = additionalAmount; - AdditionalDataOption = additionalData; - AllowedPaymentMethodsOption = allowedPaymentMethods; - ApplicationInfoOption = applicationInfo; - AuthenticationDataOption = authenticationData; - BillingAddressOption = billingAddress; - BlockedPaymentMethodsOption = blockedPaymentMethods; - CaptureDelayHoursOption = captureDelayHours; - ChannelOption = channel; - CompanyOption = company; - CountryCodeOption = countryCode; - DateOfBirthOption = dateOfBirth; - DeliverAtOption = deliverAt; - DeliveryAddressOption = deliveryAddress; - EnableOneClickOption = enableOneClick; - EnablePayOutOption = enablePayOut; - EnableRecurringOption = enableRecurring; - FundOriginOption = fundOrigin; - FundRecipientOption = fundRecipient; - InstallmentOptionsOption = installmentOptions; - LineItemsOption = lineItems; - MandateOption = mandate; - MccOption = mcc; - MerchantOrderReferenceOption = merchantOrderReference; - MetadataOption = metadata; - ModeOption = mode; - MpiDataOption = mpiData; - PlatformChargebackLogicOption = platformChargebackLogic; - RecurringExpiryOption = recurringExpiry; - RecurringFrequencyOption = recurringFrequency; - RecurringProcessingModelOption = recurringProcessingModel; - RedirectFromIssuerMethodOption = redirectFromIssuerMethod; - RedirectToIssuerMethodOption = redirectToIssuerMethod; - RiskDataOption = riskData; - SessionDataOption = sessionData; - ShopperEmailOption = shopperEmail; - ShopperIPOption = shopperIP; - ShopperInteractionOption = shopperInteraction; - ShopperLocaleOption = shopperLocale; - ShopperNameOption = shopperName; - ShopperReferenceOption = shopperReference; - ShopperStatementOption = shopperStatement; - ShowInstallmentAmountOption = showInstallmentAmount; - ShowRemovePaymentMethodButtonOption = showRemovePaymentMethodButton; - SocialSecurityNumberOption = socialSecurityNumber; - SplitCardFundingSourcesOption = splitCardFundingSources; - SplitsOption = splits; - StoreOption = store; - StoreFiltrationModeOption = storeFiltrationMode; - StorePaymentMethodOption = storePaymentMethod; - StorePaymentMethodModeOption = storePaymentMethodMode; - TelephoneNumberOption = telephoneNumber; - ThemeIdOption = themeId; - ThreeDS2RequestDataOption = threeDS2RequestData; - ThreeDSAuthenticationOnlyOption = threeDSAuthenticationOnly; - TrustedShopperOption = trustedShopper; - UrlOption = url; - OnCreated(); - } - - partial void OnCreated(); - /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** + [JsonConverter(typeof(StringEnumConverter))] public enum ChannelEnum { /// /// Enum IOS for value: iOS /// + [EnumMember(Value = "iOS")] IOS = 1, /// /// Enum Android for value: Android /// + [EnumMember(Value = "Android")] Android = 2, /// /// Enum Web for value: Web /// + [EnumMember(Value = "Web")] Web = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ChannelEnum ChannelEnumFromString(string value) - { - if (value.Equals("iOS")) - return ChannelEnum.IOS; - - if (value.Equals("Android")) - return ChannelEnum.Android; - - if (value.Equals("Web")) - return ChannelEnum.Web; - - throw new NotImplementedException($"Could not convert value to type ChannelEnum: '{value}'"); - } - /// - /// Returns a - /// - /// - /// - public static ChannelEnum? ChannelEnumFromStringOrDefault(string value) - { - if (value.Equals("iOS")) - return ChannelEnum.IOS; - - if (value.Equals("Android")) - return ChannelEnum.Android; - - if (value.Equals("Web")) - return ChannelEnum.Web; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChannelEnumToJsonValue(ChannelEnum? value) - { - if (value == ChannelEnum.IOS) - return "iOS"; - - if (value == ChannelEnum.Android) - return "Android"; - - if (value == ChannelEnum.Web) - return "Web"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Channel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChannelOption { get; private set; } /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web** - [JsonPropertyName("channel")] - public ChannelEnum? Channel { get { return this.ChannelOption; } set { this.ChannelOption = new Option(value); } } - + [DataMember(Name = "channel", EmitDefaultValue = false)] + public ChannelEnum? Channel { get; set; } /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration + [JsonConverter(typeof(StringEnumConverter))] public enum ModeEnum { /// /// Enum Embedded for value: embedded /// + [EnumMember(Value = "embedded")] Embedded = 1, /// /// Enum Hosted for value: hosted /// + [EnumMember(Value = "hosted")] Hosted = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ModeEnum ModeEnumFromString(string value) - { - if (value.Equals("embedded")) - return ModeEnum.Embedded; - - if (value.Equals("hosted")) - return ModeEnum.Hosted; - - throw new NotImplementedException($"Could not convert value to type ModeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ModeEnum? ModeEnumFromStringOrDefault(string value) - { - if (value.Equals("embedded")) - return ModeEnum.Embedded; - - if (value.Equals("hosted")) - return ModeEnum.Hosted; - - return null; - } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ModeEnumToJsonValue(ModeEnum? value) - { - if (value == ModeEnum.Embedded) - return "embedded"; - - if (value == ModeEnum.Hosted) - return "hosted"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Mode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ModeOption { get; private set; } /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration /// /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration - [JsonPropertyName("mode")] - public ModeEnum? Mode { get { return this.ModeOption; } set { this.ModeOption = new Option(value); } } - + [DataMember(Name = "mode", EmitDefaultValue = false)] + public ModeEnum? Mode { get; set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// + [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// + [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// + [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) - { - if (value == RecurringProcessingModelEnum.CardOnFile) - return "CardOnFile"; - - if (value == RecurringProcessingModelEnum.Subscription) - return "Subscription"; - if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) - return "UnscheduledCardOnFile"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of RecurringProcessingModel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonPropertyName("recurringProcessingModel")] - public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } - + [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] + public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + [JsonConverter(typeof(StringEnumConverter))] public enum ShopperInteractionEnum { /// /// Enum Ecommerce for value: Ecommerce /// + [EnumMember(Value = "Ecommerce")] Ecommerce = 1, /// /// Enum ContAuth for value: ContAuth /// + [EnumMember(Value = "ContAuth")] ContAuth = 2, /// /// Enum Moto for value: Moto /// + [EnumMember(Value = "Moto")] Moto = 3, /// /// Enum POS for value: POS /// + [EnumMember(Value = "POS")] POS = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ShopperInteractionEnum ShopperInteractionEnumFromString(string value) - { - if (value.Equals("Ecommerce")) - return ShopperInteractionEnum.Ecommerce; - - if (value.Equals("ContAuth")) - return ShopperInteractionEnum.ContAuth; - - if (value.Equals("Moto")) - return ShopperInteractionEnum.Moto; - - if (value.Equals("POS")) - return ShopperInteractionEnum.POS; - - throw new NotImplementedException($"Could not convert value to type ShopperInteractionEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ShopperInteractionEnum? ShopperInteractionEnumFromStringOrDefault(string value) - { - if (value.Equals("Ecommerce")) - return ShopperInteractionEnum.Ecommerce; - if (value.Equals("ContAuth")) - return ShopperInteractionEnum.ContAuth; - - if (value.Equals("Moto")) - return ShopperInteractionEnum.Moto; - - if (value.Equals("POS")) - return ShopperInteractionEnum.POS; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ShopperInteractionEnumToJsonValue(ShopperInteractionEnum? value) - { - if (value == ShopperInteractionEnum.Ecommerce) - return "Ecommerce"; - - if (value == ShopperInteractionEnum.ContAuth) - return "ContAuth"; - - if (value == ShopperInteractionEnum.Moto) - return "Moto"; - - if (value == ShopperInteractionEnum.POS) - return "POS"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of ShopperInteraction - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperInteractionOption { get; private set; } /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [JsonPropertyName("shopperInteraction")] - public ShopperInteractionEnum? ShopperInteraction { get { return this.ShopperInteractionOption; } set { this.ShopperInteractionOption = new Option(value); } } - + [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] + public ShopperInteractionEnum? ShopperInteraction { get; set; } /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. + [JsonConverter(typeof(StringEnumConverter))] public enum StoreFiltrationModeEnum { /// /// Enum Exclusive for value: exclusive /// + [EnumMember(Value = "exclusive")] Exclusive = 1, /// /// Enum Inclusive for value: inclusive /// + [EnumMember(Value = "inclusive")] Inclusive = 2, /// /// Enum SkipFilter for value: skipFilter /// + [EnumMember(Value = "skipFilter")] SkipFilter = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static StoreFiltrationModeEnum StoreFiltrationModeEnumFromString(string value) - { - if (value.Equals("exclusive")) - return StoreFiltrationModeEnum.Exclusive; - - if (value.Equals("inclusive")) - return StoreFiltrationModeEnum.Inclusive; - - if (value.Equals("skipFilter")) - return StoreFiltrationModeEnum.SkipFilter; - - throw new NotImplementedException($"Could not convert value to type StoreFiltrationModeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static StoreFiltrationModeEnum? StoreFiltrationModeEnumFromStringOrDefault(string value) - { - if (value.Equals("exclusive")) - return StoreFiltrationModeEnum.Exclusive; - - if (value.Equals("inclusive")) - return StoreFiltrationModeEnum.Inclusive; - - if (value.Equals("skipFilter")) - return StoreFiltrationModeEnum.SkipFilter; - - return null; - } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string StoreFiltrationModeEnumToJsonValue(StoreFiltrationModeEnum? value) - { - if (value == StoreFiltrationModeEnum.Exclusive) - return "exclusive"; - - if (value == StoreFiltrationModeEnum.Inclusive) - return "inclusive"; - - if (value == StoreFiltrationModeEnum.SkipFilter) - return "skipFilter"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of StoreFiltrationMode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoreFiltrationModeOption { get; private set; } /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - [JsonPropertyName("storeFiltrationMode")] - public StoreFiltrationModeEnum? StoreFiltrationMode { get { return this.StoreFiltrationModeOption; } set { this.StoreFiltrationModeOption = new Option(value); } } - + [DataMember(Name = "storeFiltrationMode", EmitDefaultValue = false)] + public StoreFiltrationModeEnum? StoreFiltrationMode { get; set; } /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. + [JsonConverter(typeof(StringEnumConverter))] public enum StorePaymentMethodModeEnum { /// /// Enum AskForConsent for value: askForConsent /// + [EnumMember(Value = "askForConsent")] AskForConsent = 1, /// /// Enum Disabled for value: disabled /// + [EnumMember(Value = "disabled")] Disabled = 2, /// /// Enum Enabled for value: enabled /// + [EnumMember(Value = "enabled")] Enabled = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static StorePaymentMethodModeEnum StorePaymentMethodModeEnumFromString(string value) - { - if (value.Equals("askForConsent")) - return StorePaymentMethodModeEnum.AskForConsent; - - if (value.Equals("disabled")) - return StorePaymentMethodModeEnum.Disabled; - - if (value.Equals("enabled")) - return StorePaymentMethodModeEnum.Enabled; - - throw new NotImplementedException($"Could not convert value to type StorePaymentMethodModeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static StorePaymentMethodModeEnum? StorePaymentMethodModeEnumFromStringOrDefault(string value) - { - if (value.Equals("askForConsent")) - return StorePaymentMethodModeEnum.AskForConsent; - - if (value.Equals("disabled")) - return StorePaymentMethodModeEnum.Disabled; - - if (value.Equals("enabled")) - return StorePaymentMethodModeEnum.Enabled; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string StorePaymentMethodModeEnumToJsonValue(StorePaymentMethodModeEnum? value) - { - if (value == StorePaymentMethodModeEnum.AskForConsent) - return "askForConsent"; - - if (value == StorePaymentMethodModeEnum.Disabled) - return "disabled"; - - if (value == StorePaymentMethodModeEnum.Enabled) - return "enabled"; - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of StorePaymentMethodMode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StorePaymentMethodModeOption { get; private set; } /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. - [JsonPropertyName("storePaymentMethodMode")] - public StorePaymentMethodModeEnum? StorePaymentMethodMode { get { return this.StorePaymentMethodModeOption; } set { this.StorePaymentMethodModeOption = new Option(value); } } - - /// - /// Gets or Sets Amount - /// - [JsonPropertyName("amount")] - public Amount Amount { get; set; } - - /// - /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. - /// - /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. - [JsonPropertyName("expiresAt")] - public DateTime ExpiresAt { get; set; } - - /// - /// A unique identifier of the session. - /// - /// A unique identifier of the session. - [JsonPropertyName("id")] - public string Id { get; } - - /// - /// The merchant account identifier, with which you want to process the transaction. - /// - /// The merchant account identifier, with which you want to process the transaction. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } - - /// - /// The reference to uniquely identify a payment. - /// - /// The reference to uniquely identify a payment. - [JsonPropertyName("reference")] - public string Reference { get; set; } - + [DataMember(Name = "storePaymentMethodMode", EmitDefaultValue = false)] + public StorePaymentMethodModeEnum? StorePaymentMethodMode { get; set; } /// - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// Initializes a new instance of the class. /// - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. - [JsonPropertyName("returnUrl")] - public string ReturnUrl { get; set; } - + [JsonConstructorAttribute] + protected CreateCheckoutSessionResponse() { } /// - /// Used to track the state of AccountInfo + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountInfoOption { get; private set; } + /// accountInfo. + /// additionalAmount. + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]`. + /// amount (required). + /// applicationInfo. + /// authenticationData. + /// billingAddress. + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]`. + /// The delay between the authorisation and scheduled auto-capture, specified in hours.. + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * **iOS** * **Android** * **Web**. + /// company. + /// The shopper's two-letter country code.. + /// The shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.. + /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.. + /// deliveryAddress. + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition).. + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts.. + /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments.. + /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. (required). + /// fundOrigin. + /// fundRecipient. + /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options.. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip.. + /// mandate. + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. + /// The merchant account identifier, with which you want to process the transaction. (required). + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.. + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. . + /// Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in or Components integration * **hosted**: Hosted Checkout integration (default to ModeEnum.Embedded). + /// mpiData. + /// platformChargebackLogic. + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2.. + /// Minimum number of days between authorisations. Only for 3D Secure 2.. + /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer.. + /// Specifies the redirect method (GET or POST) when redirecting to the issuer.. + /// The reference to uniquely identify a payment. (required). + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. We strongly recommend that you use a maximum of 1024 characters. > The URL must not include personally identifiable information (PII), for example name or email address. (required). + /// riskData. + /// The payment session data you need to pass to your front end.. + /// The shopper's email address.. + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new).. + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. + /// The combination of a language code and a country code to specify the language to be used in the payment.. + /// shopperName. + /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. + /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**.. + /// Set to true to show the payment amount per installment.. + /// Set to **true** to show a button that lets the shopper remove a stored payment method.. + /// The shopper's social security number.. + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false). + /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).. + /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment.. + /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned.. + /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types).. + /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent.. + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication.. + /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area.. + /// threeDS2RequestData. + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. (default to false). + /// Set to true if the payment should be routed to a trusted MID.. + /// The URL for the Hosted Checkout page. Redirect the shopper to this URL so they can make the payment.. + public CreateCheckoutSessionResponse(AccountInfo accountInfo = default(AccountInfo), Amount additionalAmount = default(Amount), Dictionary additionalData = default(Dictionary), List allowedPaymentMethods = default(List), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), AuthenticationData authenticationData = default(AuthenticationData), BillingAddress billingAddress = default(BillingAddress), List blockedPaymentMethods = default(List), int? captureDelayHours = default(int?), ChannelEnum? channel = default(ChannelEnum?), Company company = default(Company), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), DateTime deliverAt = default(DateTime), DeliveryAddress deliveryAddress = default(DeliveryAddress), bool? enableOneClick = default(bool?), bool? enablePayOut = default(bool?), bool? enableRecurring = default(bool?), DateTime expiresAt = default(DateTime), FundOrigin fundOrigin = default(FundOrigin), FundRecipient fundRecipient = default(FundRecipient), Dictionary installmentOptions = default(Dictionary), List lineItems = default(List), Mandate mandate = default(Mandate), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), Dictionary metadata = default(Dictionary), ModeEnum? mode = ModeEnum.Embedded, ThreeDSecureData mpiData = default(ThreeDSecureData), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), string recurringExpiry = default(string), string recurringFrequency = default(string), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string redirectFromIssuerMethod = default(string), string redirectToIssuerMethod = default(string), string reference = default(string), string returnUrl = default(string), RiskData riskData = default(RiskData), string sessionData = default(string), string shopperEmail = default(string), string shopperIP = default(string), ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), bool? showInstallmentAmount = default(bool?), bool? showRemovePaymentMethodButton = default(bool?), string socialSecurityNumber = default(string), bool? splitCardFundingSources = false, List splits = default(List), string store = default(string), StoreFiltrationModeEnum? storeFiltrationMode = default(StoreFiltrationModeEnum?), bool? storePaymentMethod = default(bool?), StorePaymentMethodModeEnum? storePaymentMethodMode = default(StorePaymentMethodModeEnum?), string telephoneNumber = default(string), string themeId = default(string), CheckoutSessionThreeDS2RequestData threeDS2RequestData = default(CheckoutSessionThreeDS2RequestData), bool? threeDSAuthenticationOnly = false, bool? trustedShopper = default(bool?), string url = default(string)) + { + this.Amount = amount; + this.ExpiresAt = expiresAt; + this.MerchantAccount = merchantAccount; + this.Reference = reference; + this.ReturnUrl = returnUrl; + this.AccountInfo = accountInfo; + this.AdditionalAmount = additionalAmount; + this.AdditionalData = additionalData; + this.AllowedPaymentMethods = allowedPaymentMethods; + this.ApplicationInfo = applicationInfo; + this.AuthenticationData = authenticationData; + this.BillingAddress = billingAddress; + this.BlockedPaymentMethods = blockedPaymentMethods; + this.CaptureDelayHours = captureDelayHours; + this.Channel = channel; + this.Company = company; + this.CountryCode = countryCode; + this.DateOfBirth = dateOfBirth; + this.DeliverAt = deliverAt; + this.DeliveryAddress = deliveryAddress; + this.EnableOneClick = enableOneClick; + this.EnablePayOut = enablePayOut; + this.EnableRecurring = enableRecurring; + this.FundOrigin = fundOrigin; + this.FundRecipient = fundRecipient; + this.InstallmentOptions = installmentOptions; + this.LineItems = lineItems; + this.Mandate = mandate; + this.Mcc = mcc; + this.MerchantOrderReference = merchantOrderReference; + this.Metadata = metadata; + this.Mode = mode; + this.MpiData = mpiData; + this.PlatformChargebackLogic = platformChargebackLogic; + this.RecurringExpiry = recurringExpiry; + this.RecurringFrequency = recurringFrequency; + this.RecurringProcessingModel = recurringProcessingModel; + this.RedirectFromIssuerMethod = redirectFromIssuerMethod; + this.RedirectToIssuerMethod = redirectToIssuerMethod; + this.RiskData = riskData; + this.SessionData = sessionData; + this.ShopperEmail = shopperEmail; + this.ShopperIP = shopperIP; + this.ShopperInteraction = shopperInteraction; + this.ShopperLocale = shopperLocale; + this.ShopperName = shopperName; + this.ShopperReference = shopperReference; + this.ShopperStatement = shopperStatement; + this.ShowInstallmentAmount = showInstallmentAmount; + this.ShowRemovePaymentMethodButton = showRemovePaymentMethodButton; + this.SocialSecurityNumber = socialSecurityNumber; + this.SplitCardFundingSources = splitCardFundingSources; + this.Splits = splits; + this.Store = store; + this.StoreFiltrationMode = storeFiltrationMode; + this.StorePaymentMethod = storePaymentMethod; + this.StorePaymentMethodMode = storePaymentMethodMode; + this.TelephoneNumber = telephoneNumber; + this.ThemeId = themeId; + this.ThreeDS2RequestData = threeDS2RequestData; + this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; + this.TrustedShopper = trustedShopper; + this.Url = url; + } /// /// Gets or Sets AccountInfo /// - [JsonPropertyName("accountInfo")] - public AccountInfo AccountInfo { get { return this.AccountInfoOption; } set { this.AccountInfoOption = new Option(value); } } - - /// - /// Used to track the state of AdditionalAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AdditionalAmountOption { get; private set; } + [DataMember(Name = "accountInfo", EmitDefaultValue = false)] + public AccountInfo AccountInfo { get; set; } /// /// Gets or Sets AdditionalAmount /// - [JsonPropertyName("additionalAmount")] - public Amount AdditionalAmount { get { return this.AdditionalAmountOption; } set { this.AdditionalAmountOption = new Option(value); } } - - /// - /// Used to track the state of AdditionalData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AdditionalDataOption { get; private set; } + [DataMember(Name = "additionalAmount", EmitDefaultValue = false)] + public Amount AdditionalAmount { get; set; } /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - [JsonPropertyName("additionalData")] - public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } - - /// - /// Used to track the state of AllowedPaymentMethods - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AllowedPaymentMethodsOption { get; private set; } + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - [JsonPropertyName("allowedPaymentMethods")] - public List AllowedPaymentMethods { get { return this.AllowedPaymentMethodsOption; } set { this.AllowedPaymentMethodsOption = new Option>(value); } } + [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] + public List AllowedPaymentMethods { get; set; } /// - /// Used to track the state of ApplicationInfo + /// Gets or Sets Amount /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ApplicationInfoOption { get; private set; } + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// Gets or Sets ApplicationInfo /// - [JsonPropertyName("applicationInfo")] - public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } - - /// - /// Used to track the state of AuthenticationData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthenticationDataOption { get; private set; } + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } /// /// Gets or Sets AuthenticationData /// - [JsonPropertyName("authenticationData")] - public AuthenticationData AuthenticationData { get { return this.AuthenticationDataOption; } set { this.AuthenticationDataOption = new Option(value); } } - - /// - /// Used to track the state of BillingAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressOption { get; private set; } + [DataMember(Name = "authenticationData", EmitDefaultValue = false)] + public AuthenticationData AuthenticationData { get; set; } /// /// Gets or Sets BillingAddress /// - [JsonPropertyName("billingAddress")] - public BillingAddress BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } - - /// - /// Used to track the state of BlockedPaymentMethods - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> BlockedPaymentMethodsOption { get; private set; } + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public BillingAddress BillingAddress { get; set; } /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - [JsonPropertyName("blockedPaymentMethods")] - public List BlockedPaymentMethods { get { return this.BlockedPaymentMethodsOption; } set { this.BlockedPaymentMethodsOption = new Option>(value); } } - - /// - /// Used to track the state of CaptureDelayHours - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CaptureDelayHoursOption { get; private set; } + [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] + public List BlockedPaymentMethods { get; set; } /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. - [JsonPropertyName("captureDelayHours")] - public int? CaptureDelayHours { get { return this.CaptureDelayHoursOption; } set { this.CaptureDelayHoursOption = new Option(value); } } - - /// - /// Used to track the state of Company - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CompanyOption { get; private set; } + [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] + public int? CaptureDelayHours { get; set; } /// /// Gets or Sets Company /// - [JsonPropertyName("company")] - public Company Company { get { return this.CompanyOption; } set { this.CompanyOption = new Option(value); } } - - /// - /// Used to track the state of CountryCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CountryCodeOption { get; private set; } + [DataMember(Name = "company", EmitDefaultValue = false)] + public Company Company { get; set; } /// /// The shopper's two-letter country code. /// /// The shopper's two-letter country code. - [JsonPropertyName("countryCode")] - public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } - - /// - /// Used to track the state of DateOfBirth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DateOfBirthOption { get; private set; } + [DataMember(Name = "countryCode", EmitDefaultValue = false)] + public string CountryCode { get; set; } /// /// The shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. /// /// The shopper's date of birth in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. - [JsonPropertyName("dateOfBirth")] - public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } - - /// - /// Used to track the state of DeliverAt - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliverAtOption { get; private set; } + [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] + public DateTime DateOfBirth { get; set; } /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [JsonPropertyName("deliverAt")] - public DateTime? DeliverAt { get { return this.DeliverAtOption; } set { this.DeliverAtOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryAddressOption { get; private set; } + [DataMember(Name = "deliverAt", EmitDefaultValue = false)] + public DateTime DeliverAt { get; set; } /// /// Gets or Sets DeliveryAddress /// - [JsonPropertyName("deliveryAddress")] - public DeliveryAddress DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } - - /// - /// Used to track the state of EnableOneClick - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnableOneClickOption { get; private set; } + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public DeliveryAddress DeliveryAddress { get; set; } /// /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). /// /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). - [JsonPropertyName("enableOneClick")] - public bool? EnableOneClick { get { return this.EnableOneClickOption; } set { this.EnableOneClickOption = new Option(value); } } - - /// - /// Used to track the state of EnablePayOut - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnablePayOutOption { get; private set; } + [DataMember(Name = "enableOneClick", EmitDefaultValue = false)] + public bool? EnableOneClick { get; set; } /// /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. /// /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. - [JsonPropertyName("enablePayOut")] - public bool? EnablePayOut { get { return this.EnablePayOutOption; } set { this.EnablePayOutOption = new Option(value); } } - - /// - /// Used to track the state of EnableRecurring - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnableRecurringOption { get; private set; } + [DataMember(Name = "enablePayOut", EmitDefaultValue = false)] + public bool? EnablePayOut { get; set; } /// /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. /// /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. - [JsonPropertyName("enableRecurring")] - public bool? EnableRecurring { get { return this.EnableRecurringOption; } set { this.EnableRecurringOption = new Option(value); } } + [DataMember(Name = "enableRecurring", EmitDefaultValue = false)] + public bool? EnableRecurring { get; set; } /// - /// Used to track the state of FundOrigin + /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundOriginOption { get; private set; } + /// The date the session expires in [ISO8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. When not specified, the expiry date is set to 1 hour after session creation. You cannot set the session expiry to more than 24 hours after session creation. + [DataMember(Name = "expiresAt", IsRequired = false, EmitDefaultValue = false)] + public DateTime ExpiresAt { get; set; } /// /// Gets or Sets FundOrigin /// - [JsonPropertyName("fundOrigin")] - public FundOrigin FundOrigin { get { return this.FundOriginOption; } set { this.FundOriginOption = new Option(value); } } - - /// - /// Used to track the state of FundRecipient - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundRecipientOption { get; private set; } + [DataMember(Name = "fundOrigin", EmitDefaultValue = false)] + public FundOrigin FundOrigin { get; set; } /// /// Gets or Sets FundRecipient /// - [JsonPropertyName("fundRecipient")] - public FundRecipient FundRecipient { get { return this.FundRecipientOption; } set { this.FundRecipientOption = new Option(value); } } + [DataMember(Name = "fundRecipient", EmitDefaultValue = false)] + public FundRecipient FundRecipient { get; set; } /// - /// Used to track the state of InstallmentOptions + /// A unique identifier of the session. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> InstallmentOptionsOption { get; private set; } + /// A unique identifier of the session. + [DataMember(Name = "id", IsRequired = false, EmitDefaultValue = false)] + public string Id { get; private set; } /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. - [JsonPropertyName("installmentOptions")] - public Dictionary InstallmentOptions { get { return this.InstallmentOptionsOption; } set { this.InstallmentOptionsOption = new Option>(value); } } - - /// - /// Used to track the state of LineItems - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LineItemsOption { get; private set; } + [DataMember(Name = "installmentOptions", EmitDefaultValue = false)] + public Dictionary InstallmentOptions { get; set; } /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. - [JsonPropertyName("lineItems")] - public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } /// - /// Used to track the state of Mandate + /// Gets or Sets Mandate /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MandateOption { get; private set; } - - /// - /// Gets or Sets Mandate - /// - [JsonPropertyName("mandate")] - public Mandate Mandate { get { return this.MandateOption; } set { this.MandateOption = new Option(value); } } - - /// - /// Used to track the state of Mcc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MccOption { get; private set; } + [DataMember(Name = "mandate", EmitDefaultValue = false)] + public Mandate Mandate { get; set; } /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - [JsonPropertyName("mcc")] - public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string Mcc { get; set; } /// - /// Used to track the state of MerchantOrderReference + /// The merchant account identifier, with which you want to process the transaction. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantOrderReferenceOption { get; private set; } + /// The merchant account identifier, with which you want to process the transaction. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. /// /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - [JsonPropertyName("merchantOrderReference")] - public string MerchantOrderReference { get { return this.MerchantOrderReferenceOption; } set { this.MerchantOrderReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Metadata - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> MetadataOption { get; private set; } + [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] + public string MerchantOrderReference { get; set; } /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value. - [JsonPropertyName("metadata")] - public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } - - /// - /// Used to track the state of MpiData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MpiDataOption { get; private set; } + [DataMember(Name = "metadata", EmitDefaultValue = false)] + public Dictionary Metadata { get; set; } /// /// Gets or Sets MpiData /// - [JsonPropertyName("mpiData")] - public ThreeDSecureData MpiData { get { return this.MpiDataOption; } set { this.MpiDataOption = new Option(value); } } - - /// - /// Used to track the state of PlatformChargebackLogic - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PlatformChargebackLogicOption { get; private set; } + [DataMember(Name = "mpiData", EmitDefaultValue = false)] + public ThreeDSecureData MpiData { get; set; } /// /// Gets or Sets PlatformChargebackLogic /// - [JsonPropertyName("platformChargebackLogic")] - public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } - - /// - /// Used to track the state of RecurringExpiry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringExpiryOption { get; private set; } + [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] + public PlatformChargebackLogic PlatformChargebackLogic { get; set; } /// /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. /// /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. - [JsonPropertyName("recurringExpiry")] - public string RecurringExpiry { get { return this.RecurringExpiryOption; } set { this.RecurringExpiryOption = new Option(value); } } - - /// - /// Used to track the state of RecurringFrequency - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringFrequencyOption { get; private set; } + [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] + public string RecurringExpiry { get; set; } /// /// Minimum number of days between authorisations. Only for 3D Secure 2. /// /// Minimum number of days between authorisations. Only for 3D Secure 2. - [JsonPropertyName("recurringFrequency")] - public string RecurringFrequency { get { return this.RecurringFrequencyOption; } set { this.RecurringFrequencyOption = new Option(value); } } - - /// - /// Used to track the state of RedirectFromIssuerMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RedirectFromIssuerMethodOption { get; private set; } + [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] + public string RecurringFrequency { get; set; } /// /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. /// /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. - [JsonPropertyName("redirectFromIssuerMethod")] - public string RedirectFromIssuerMethod { get { return this.RedirectFromIssuerMethodOption; } set { this.RedirectFromIssuerMethodOption = new Option(value); } } - - /// - /// Used to track the state of RedirectToIssuerMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RedirectToIssuerMethodOption { get; private set; } + [DataMember(Name = "redirectFromIssuerMethod", EmitDefaultValue = false)] + public string RedirectFromIssuerMethod { get; set; } /// /// Specifies the redirect method (GET or POST) when redirecting to the issuer. /// /// Specifies the redirect method (GET or POST) when redirecting to the issuer. - [JsonPropertyName("redirectToIssuerMethod")] - public string RedirectToIssuerMethod { get { return this.RedirectToIssuerMethodOption; } set { this.RedirectToIssuerMethodOption = new Option(value); } } + [DataMember(Name = "redirectToIssuerMethod", EmitDefaultValue = false)] + public string RedirectToIssuerMethod { get; set; } /// - /// Used to track the state of RiskData + /// The reference to uniquely identify a payment. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskDataOption { get; private set; } + /// The reference to uniquely identify a payment. + [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] + public string Reference { get; set; } /// - /// Gets or Sets RiskData + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. We strongly recommend that you use a maximum of 1024 characters. > The URL must not include personally identifiable information (PII), for example name or email address. /// - [JsonPropertyName("riskData")] - public RiskData RiskData { get { return this.RiskDataOption; } set { this.RiskDataOption = new Option(value); } } + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. We strongly recommend that you use a maximum of 1024 characters. > The URL must not include personally identifiable information (PII), for example name or email address. + [DataMember(Name = "returnUrl", IsRequired = false, EmitDefaultValue = false)] + public string ReturnUrl { get; set; } /// - /// Used to track the state of SessionData + /// Gets or Sets RiskData /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SessionDataOption { get; private set; } + [DataMember(Name = "riskData", EmitDefaultValue = false)] + public RiskData RiskData { get; set; } /// /// The payment session data you need to pass to your front end. /// /// The payment session data you need to pass to your front end. - [JsonPropertyName("sessionData")] - public string SessionData { get { return this.SessionDataOption; } set { this.SessionDataOption = new Option(value); } } - - /// - /// Used to track the state of ShopperEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + [DataMember(Name = "sessionData", EmitDefaultValue = false)] + public string SessionData { get; set; } /// /// The shopper's email address. /// /// The shopper's email address. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// - /// Used to track the state of ShopperIP + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperIPOption { get; private set; } - - /// - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - /// - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - [JsonPropertyName("shopperIP")] - public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } - - /// - /// Used to track the state of ShopperLocale - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperLocaleOption { get; private set; } + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + [DataMember(Name = "shopperIP", EmitDefaultValue = false)] + public string ShopperIP { get; set; } /// /// The combination of a language code and a country code to specify the language to be used in the payment. /// /// The combination of a language code and a country code to specify the language to be used in the payment. - [JsonPropertyName("shopperLocale")] - public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } - - /// - /// Used to track the state of ShopperName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNameOption { get; private set; } + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + public string ShopperLocale { get; set; } /// /// Gets or Sets ShopperName /// - [JsonPropertyName("shopperName")] - public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } - - /// - /// Used to track the state of ShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperReferenceOption { get; private set; } + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name ShopperName { get; set; } /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [JsonPropertyName("shopperReference")] - public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperStatement - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperStatementOption { get; private set; } + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - [JsonPropertyName("shopperStatement")] - public string ShopperStatement { get { return this.ShopperStatementOption; } set { this.ShopperStatementOption = new Option(value); } } - - /// - /// Used to track the state of ShowInstallmentAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShowInstallmentAmountOption { get; private set; } + [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] + public string ShopperStatement { get; set; } /// /// Set to true to show the payment amount per installment. /// /// Set to true to show the payment amount per installment. - [JsonPropertyName("showInstallmentAmount")] - public bool? ShowInstallmentAmount { get { return this.ShowInstallmentAmountOption; } set { this.ShowInstallmentAmountOption = new Option(value); } } - - /// - /// Used to track the state of ShowRemovePaymentMethodButton - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShowRemovePaymentMethodButtonOption { get; private set; } + [DataMember(Name = "showInstallmentAmount", EmitDefaultValue = false)] + public bool? ShowInstallmentAmount { get; set; } /// /// Set to **true** to show a button that lets the shopper remove a stored payment method. /// /// Set to **true** to show a button that lets the shopper remove a stored payment method. - [JsonPropertyName("showRemovePaymentMethodButton")] - public bool? ShowRemovePaymentMethodButton { get { return this.ShowRemovePaymentMethodButtonOption; } set { this.ShowRemovePaymentMethodButtonOption = new Option(value); } } - - /// - /// Used to track the state of SocialSecurityNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SocialSecurityNumberOption { get; private set; } + [DataMember(Name = "showRemovePaymentMethodButton", EmitDefaultValue = false)] + public bool? ShowRemovePaymentMethodButton { get; set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [JsonPropertyName("socialSecurityNumber")] - public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } - - /// - /// Used to track the state of SplitCardFundingSources - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SplitCardFundingSourcesOption { get; private set; } + [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] + public string SocialSecurityNumber { get; set; } /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. - [JsonPropertyName("splitCardFundingSources")] - public bool? SplitCardFundingSources { get { return this.SplitCardFundingSourcesOption; } set { this.SplitCardFundingSourcesOption = new Option(value); } } - - /// - /// Used to track the state of Splits - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SplitsOption { get; private set; } + [DataMember(Name = "splitCardFundingSources", EmitDefaultValue = false)] + public bool? SplitCardFundingSources { get; set; } /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - [JsonPropertyName("splits")] - public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } - - /// - /// Used to track the state of Store - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoreOption { get; private set; } + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - [JsonPropertyName("store")] - public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } - - /// - /// Used to track the state of StorePaymentMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StorePaymentMethodOption { get; private set; } + [DataMember(Name = "store", EmitDefaultValue = false)] + public string Store { get; set; } /// /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). /// /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). - [JsonPropertyName("storePaymentMethod")] - public bool? StorePaymentMethod { get { return this.StorePaymentMethodOption; } set { this.StorePaymentMethodOption = new Option(value); } } - - /// - /// Used to track the state of TelephoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TelephoneNumberOption { get; private set; } + [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] + public bool? StorePaymentMethod { get; set; } /// - /// The shopper's telephone number. + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. /// - /// The shopper's telephone number. - [JsonPropertyName("telephoneNumber")] - public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } - - /// - /// Used to track the state of ThemeId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThemeIdOption { get; private set; } + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string TelephoneNumber { get; set; } /// /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. /// /// Sets a custom theme for [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Hosted+Checkout). The value can be any of the **Theme ID** values from your Customer Area. - [JsonPropertyName("themeId")] - public string ThemeId { get { return this.ThemeIdOption; } set { this.ThemeIdOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2RequestData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2RequestDataOption { get; private set; } + [DataMember(Name = "themeId", EmitDefaultValue = false)] + public string ThemeId { get; set; } /// /// Gets or Sets ThreeDS2RequestData /// - [JsonPropertyName("threeDS2RequestData")] - public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSAuthenticationOnly - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSAuthenticationOnlyOption { get; private set; } - - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [JsonPropertyName("threeDSAuthenticationOnly")] - [Obsolete] - public bool? ThreeDSAuthenticationOnly { get { return this.ThreeDSAuthenticationOnlyOption; } set { this.ThreeDSAuthenticationOnlyOption = new Option(value); } } + [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] + public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get; set; } /// - /// Used to track the state of TrustedShopper + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TrustedShopperOption { get; private set; } + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. + [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.authenticationOnly` instead.")] + public bool? ThreeDSAuthenticationOnly { get; set; } /// /// Set to true if the payment should be routed to a trusted MID. /// /// Set to true if the payment should be routed to a trusted MID. - [JsonPropertyName("trustedShopper")] - public bool? TrustedShopper { get { return this.TrustedShopperOption; } set { this.TrustedShopperOption = new Option(value); } } - - /// - /// Used to track the state of Url - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option UrlOption { get; private set; } + [DataMember(Name = "trustedShopper", EmitDefaultValue = false)] + public bool? TrustedShopper { get; set; } /// /// The URL for the Hosted Checkout page. Redirect the shopper to this URL so they can make the payment. /// /// The URL for the Hosted Checkout page. Redirect the shopper to this URL so they can make the payment. - [JsonPropertyName("url")] - public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; set; } /// /// Returns the string presentation of the object @@ -1500,16 +773,11 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CreateCheckoutSessionResponse {\n"); - sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" AccountInfo: ").Append(AccountInfo).Append("\n"); sb.Append(" AdditionalAmount: ").Append(AdditionalAmount).Append("\n"); sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" AuthenticationData: ").Append(AuthenticationData).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); @@ -1524,12 +792,15 @@ public override string ToString() sb.Append(" EnableOneClick: ").Append(EnableOneClick).Append("\n"); sb.Append(" EnablePayOut: ").Append(EnablePayOut).Append("\n"); sb.Append(" EnableRecurring: ").Append(EnableRecurring).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append(" FundOrigin: ").Append(FundOrigin).Append("\n"); sb.Append(" FundRecipient: ").Append(FundRecipient).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" InstallmentOptions: ").Append(InstallmentOptions).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" Mandate: ").Append(Mandate).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append(" Mode: ").Append(Mode).Append("\n"); @@ -1540,6 +811,8 @@ public override string ToString() sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); sb.Append(" RedirectFromIssuerMethod: ").Append(RedirectFromIssuerMethod).Append("\n"); sb.Append(" RedirectToIssuerMethod: ").Append(RedirectToIssuerMethod).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" RiskData: ").Append(RiskData).Append("\n"); sb.Append(" SessionData: ").Append(SessionData).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); @@ -1568,6 +841,15 @@ public override string ToString() return sb.ToString(); } + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + /// /// Returns true if objects are equal /// @@ -1586,13 +868,320 @@ public override bool Equals(object input) public bool Equals(CreateCheckoutSessionResponse input) { if (input == null) + { return false; - + } return ( - Id == input.Id || - (Id != null && - Id.Equals(input.Id)) + this.AccountInfo == input.AccountInfo || + (this.AccountInfo != null && + this.AccountInfo.Equals(input.AccountInfo)) + ) && + ( + this.AdditionalAmount == input.AdditionalAmount || + (this.AdditionalAmount != null && + this.AdditionalAmount.Equals(input.AdditionalAmount)) + ) && + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + input.AdditionalData != null && + this.AdditionalData.SequenceEqual(input.AdditionalData) + ) && + ( + this.AllowedPaymentMethods == input.AllowedPaymentMethods || + this.AllowedPaymentMethods != null && + input.AllowedPaymentMethods != null && + this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.ApplicationInfo == input.ApplicationInfo || + (this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo)) + ) && + ( + this.AuthenticationData == input.AuthenticationData || + (this.AuthenticationData != null && + this.AuthenticationData.Equals(input.AuthenticationData)) + ) && + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.BlockedPaymentMethods == input.BlockedPaymentMethods || + this.BlockedPaymentMethods != null && + input.BlockedPaymentMethods != null && + this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) + ) && + ( + this.CaptureDelayHours == input.CaptureDelayHours || + this.CaptureDelayHours.Equals(input.CaptureDelayHours) + ) && + ( + this.Channel == input.Channel || + this.Channel.Equals(input.Channel) + ) && + ( + this.Company == input.Company || + (this.Company != null && + this.Company.Equals(input.Company)) + ) && + ( + this.CountryCode == input.CountryCode || + (this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode)) + ) && + ( + this.DateOfBirth == input.DateOfBirth || + (this.DateOfBirth != null && + this.DateOfBirth.Equals(input.DateOfBirth)) + ) && + ( + this.DeliverAt == input.DeliverAt || + (this.DeliverAt != null && + this.DeliverAt.Equals(input.DeliverAt)) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + (this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress)) + ) && + ( + this.EnableOneClick == input.EnableOneClick || + this.EnableOneClick.Equals(input.EnableOneClick) + ) && + ( + this.EnablePayOut == input.EnablePayOut || + this.EnablePayOut.Equals(input.EnablePayOut) + ) && + ( + this.EnableRecurring == input.EnableRecurring || + this.EnableRecurring.Equals(input.EnableRecurring) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) + ) && + ( + this.FundOrigin == input.FundOrigin || + (this.FundOrigin != null && + this.FundOrigin.Equals(input.FundOrigin)) + ) && + ( + this.FundRecipient == input.FundRecipient || + (this.FundRecipient != null && + this.FundRecipient.Equals(input.FundRecipient)) + ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.InstallmentOptions == input.InstallmentOptions || + this.InstallmentOptions != null && + input.InstallmentOptions != null && + this.InstallmentOptions.SequenceEqual(input.InstallmentOptions) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.Mandate == input.Mandate || + (this.Mandate != null && + this.Mandate.Equals(input.Mandate)) + ) && + ( + this.Mcc == input.Mcc || + (this.Mcc != null && + this.Mcc.Equals(input.Mcc)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.MerchantOrderReference == input.MerchantOrderReference || + (this.MerchantOrderReference != null && + this.MerchantOrderReference.Equals(input.MerchantOrderReference)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.Mode == input.Mode || + this.Mode.Equals(input.Mode) + ) && + ( + this.MpiData == input.MpiData || + (this.MpiData != null && + this.MpiData.Equals(input.MpiData)) + ) && + ( + this.PlatformChargebackLogic == input.PlatformChargebackLogic || + (this.PlatformChargebackLogic != null && + this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) + ) && + ( + this.RecurringExpiry == input.RecurringExpiry || + (this.RecurringExpiry != null && + this.RecurringExpiry.Equals(input.RecurringExpiry)) + ) && + ( + this.RecurringFrequency == input.RecurringFrequency || + (this.RecurringFrequency != null && + this.RecurringFrequency.Equals(input.RecurringFrequency)) + ) && + ( + this.RecurringProcessingModel == input.RecurringProcessingModel || + this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) + ) && + ( + this.RedirectFromIssuerMethod == input.RedirectFromIssuerMethod || + (this.RedirectFromIssuerMethod != null && + this.RedirectFromIssuerMethod.Equals(input.RedirectFromIssuerMethod)) + ) && + ( + this.RedirectToIssuerMethod == input.RedirectToIssuerMethod || + (this.RedirectToIssuerMethod != null && + this.RedirectToIssuerMethod.Equals(input.RedirectToIssuerMethod)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.ReturnUrl == input.ReturnUrl || + (this.ReturnUrl != null && + this.ReturnUrl.Equals(input.ReturnUrl)) + ) && + ( + this.RiskData == input.RiskData || + (this.RiskData != null && + this.RiskData.Equals(input.RiskData)) + ) && + ( + this.SessionData == input.SessionData || + (this.SessionData != null && + this.SessionData.Equals(input.SessionData)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.ShopperIP == input.ShopperIP || + (this.ShopperIP != null && + this.ShopperIP.Equals(input.ShopperIP)) + ) && + ( + this.ShopperInteraction == input.ShopperInteraction || + this.ShopperInteraction.Equals(input.ShopperInteraction) + ) && + ( + this.ShopperLocale == input.ShopperLocale || + (this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale)) + ) && + ( + this.ShopperName == input.ShopperName || + (this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName)) + ) && + ( + this.ShopperReference == input.ShopperReference || + (this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference)) + ) && + ( + this.ShopperStatement == input.ShopperStatement || + (this.ShopperStatement != null && + this.ShopperStatement.Equals(input.ShopperStatement)) + ) && + ( + this.ShowInstallmentAmount == input.ShowInstallmentAmount || + this.ShowInstallmentAmount.Equals(input.ShowInstallmentAmount) + ) && + ( + this.ShowRemovePaymentMethodButton == input.ShowRemovePaymentMethodButton || + this.ShowRemovePaymentMethodButton.Equals(input.ShowRemovePaymentMethodButton) + ) && + ( + this.SocialSecurityNumber == input.SocialSecurityNumber || + (this.SocialSecurityNumber != null && + this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) + ) && + ( + this.SplitCardFundingSources == input.SplitCardFundingSources || + this.SplitCardFundingSources.Equals(input.SplitCardFundingSources) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.Store == input.Store || + (this.Store != null && + this.Store.Equals(input.Store)) + ) && + ( + this.StoreFiltrationMode == input.StoreFiltrationMode || + this.StoreFiltrationMode.Equals(input.StoreFiltrationMode) + ) && + ( + this.StorePaymentMethod == input.StorePaymentMethod || + this.StorePaymentMethod.Equals(input.StorePaymentMethod) + ) && + ( + this.StorePaymentMethodMode == input.StorePaymentMethodMode || + this.StorePaymentMethodMode.Equals(input.StorePaymentMethodMode) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + (this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber)) + ) && + ( + this.ThemeId == input.ThemeId || + (this.ThemeId != null && + this.ThemeId.Equals(input.ThemeId)) + ) && + ( + this.ThreeDS2RequestData == input.ThreeDS2RequestData || + (this.ThreeDS2RequestData != null && + this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) + ) && + ( + this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || + this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) + ) && + ( + this.TrustedShopper == input.TrustedShopper || + this.TrustedShopper.Equals(input.TrustedShopper) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) ); } @@ -1605,999 +1194,244 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + Id.GetHashCode(); - + if (this.AccountInfo != null) + { + hashCode = (hashCode * 59) + this.AccountInfo.GetHashCode(); + } + if (this.AdditionalAmount != null) + { + hashCode = (hashCode * 59) + this.AdditionalAmount.GetHashCode(); + } + if (this.AdditionalData != null) + { + hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); + } + if (this.AllowedPaymentMethods != null) + { + hashCode = (hashCode * 59) + this.AllowedPaymentMethods.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.ApplicationInfo != null) + { + hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); + } + if (this.AuthenticationData != null) + { + hashCode = (hashCode * 59) + this.AuthenticationData.GetHashCode(); + } + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.BlockedPaymentMethods != null) + { + hashCode = (hashCode * 59) + this.BlockedPaymentMethods.GetHashCode(); + } + hashCode = (hashCode * 59) + this.CaptureDelayHours.GetHashCode(); + hashCode = (hashCode * 59) + this.Channel.GetHashCode(); + if (this.Company != null) + { + hashCode = (hashCode * 59) + this.Company.GetHashCode(); + } + if (this.CountryCode != null) + { + hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); + } + if (this.DateOfBirth != null) + { + hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); + } + if (this.DeliverAt != null) + { + hashCode = (hashCode * 59) + this.DeliverAt.GetHashCode(); + } + if (this.DeliveryAddress != null) + { + hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); + } + hashCode = (hashCode * 59) + this.EnableOneClick.GetHashCode(); + hashCode = (hashCode * 59) + this.EnablePayOut.GetHashCode(); + hashCode = (hashCode * 59) + this.EnableRecurring.GetHashCode(); + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } + if (this.FundOrigin != null) + { + hashCode = (hashCode * 59) + this.FundOrigin.GetHashCode(); + } + if (this.FundRecipient != null) + { + hashCode = (hashCode * 59) + this.FundRecipient.GetHashCode(); + } + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.InstallmentOptions != null) + { + hashCode = (hashCode * 59) + this.InstallmentOptions.GetHashCode(); + } + if (this.LineItems != null) + { + hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); + } + if (this.Mandate != null) + { + hashCode = (hashCode * 59) + this.Mandate.GetHashCode(); + } + if (this.Mcc != null) + { + hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.MerchantOrderReference != null) + { + hashCode = (hashCode * 59) + this.MerchantOrderReference.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Mode.GetHashCode(); + if (this.MpiData != null) + { + hashCode = (hashCode * 59) + this.MpiData.GetHashCode(); + } + if (this.PlatformChargebackLogic != null) + { + hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); + } + if (this.RecurringExpiry != null) + { + hashCode = (hashCode * 59) + this.RecurringExpiry.GetHashCode(); + } + if (this.RecurringFrequency != null) + { + hashCode = (hashCode * 59) + this.RecurringFrequency.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); + if (this.RedirectFromIssuerMethod != null) + { + hashCode = (hashCode * 59) + this.RedirectFromIssuerMethod.GetHashCode(); + } + if (this.RedirectToIssuerMethod != null) + { + hashCode = (hashCode * 59) + this.RedirectToIssuerMethod.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.ReturnUrl != null) + { + hashCode = (hashCode * 59) + this.ReturnUrl.GetHashCode(); + } + if (this.RiskData != null) + { + hashCode = (hashCode * 59) + this.RiskData.GetHashCode(); + } + if (this.SessionData != null) + { + hashCode = (hashCode * 59) + this.SessionData.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.ShopperIP != null) + { + hashCode = (hashCode * 59) + this.ShopperIP.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ShopperInteraction.GetHashCode(); + if (this.ShopperLocale != null) + { + hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); + } + if (this.ShopperName != null) + { + hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); + } + if (this.ShopperReference != null) + { + hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); + } + if (this.ShopperStatement != null) + { + hashCode = (hashCode * 59) + this.ShopperStatement.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ShowInstallmentAmount.GetHashCode(); + hashCode = (hashCode * 59) + this.ShowRemovePaymentMethodButton.GetHashCode(); + if (this.SocialSecurityNumber != null) + { + hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); + } + hashCode = (hashCode * 59) + this.SplitCardFundingSources.GetHashCode(); + if (this.Splits != null) + { + hashCode = (hashCode * 59) + this.Splits.GetHashCode(); + } + if (this.Store != null) + { + hashCode = (hashCode * 59) + this.Store.GetHashCode(); + } + hashCode = (hashCode * 59) + this.StoreFiltrationMode.GetHashCode(); + hashCode = (hashCode * 59) + this.StorePaymentMethod.GetHashCode(); + hashCode = (hashCode * 59) + this.StorePaymentMethodMode.GetHashCode(); + if (this.TelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); + } + if (this.ThemeId != null) + { + hashCode = (hashCode * 59) + this.ThemeId.GetHashCode(); + } + if (this.ThreeDS2RequestData != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ThreeDSAuthenticationOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.TrustedShopper.GetHashCode(); + if (this.Url != null) + { + hashCode = (hashCode * 59) + this.Url.GetHashCode(); + } return hashCode; } } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { // ReturnUrl (string) maxLength if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) { - yield return new ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); } // ShopperReference (string) maxLength if (this.ShopperReference != null && this.ShopperReference.Length > 256) { - yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); } // ShopperReference (string) minLength if (this.ShopperReference != null && this.ShopperReference.Length < 3) { - yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); } yield break; } } - /// - /// A Json converter for type - /// - public class CreateCheckoutSessionResponseJsonConverter : JsonConverter - { - /// - /// The format to use to serialize ExpiresAt - /// - public static string ExpiresAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - - /// - /// The format to use to serialize DateOfBirth - /// - public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - - /// - /// The format to use to serialize DeliverAt - /// - public static string DeliverAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - - /// - /// Deserializes json to - /// - /// - /// - /// - /// - /// - public override CreateCheckoutSessionResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) - { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option expiresAt = default; - Option id = default; - Option merchantAccount = default; - Option reference = default; - Option returnUrl = default; - Option accountInfo = default; - Option additionalAmount = default; - Option> additionalData = default; - Option> allowedPaymentMethods = default; - Option applicationInfo = default; - Option authenticationData = default; - Option billingAddress = default; - Option> blockedPaymentMethods = default; - Option captureDelayHours = default; - Option channel = default; - Option company = default; - Option countryCode = default; - Option dateOfBirth = default; - Option deliverAt = default; - Option deliveryAddress = default; - Option enableOneClick = default; - Option enablePayOut = default; - Option enableRecurring = default; - Option fundOrigin = default; - Option fundRecipient = default; - Option> installmentOptions = default; - Option> lineItems = default; - Option mandate = default; - Option mcc = default; - Option merchantOrderReference = default; - Option> metadata = default; - Option mode = default; - Option mpiData = default; - Option platformChargebackLogic = default; - Option recurringExpiry = default; - Option recurringFrequency = default; - Option recurringProcessingModel = default; - Option redirectFromIssuerMethod = default; - Option redirectToIssuerMethod = default; - Option riskData = default; - Option sessionData = default; - Option shopperEmail = default; - Option shopperIP = default; - Option shopperInteraction = default; - Option shopperLocale = default; - Option shopperName = default; - Option shopperReference = default; - Option shopperStatement = default; - Option showInstallmentAmount = default; - Option showRemovePaymentMethodButton = default; - Option socialSecurityNumber = default; - Option splitCardFundingSources = default; - Option> splits = default; - Option store = default; - Option storeFiltrationMode = default; - Option storePaymentMethod = default; - Option storePaymentMethodMode = default; - Option telephoneNumber = default; - Option themeId = default; - Option threeDS2RequestData = default; - Option threeDSAuthenticationOnly = default; - Option trustedShopper = default; - Option url = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "expiresAt": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - expiresAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "id": - id = new Option(utf8JsonReader.GetString()); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "returnUrl": - returnUrl = new Option(utf8JsonReader.GetString()); - break; - case "accountInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - accountInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "additionalAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "additionalData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "allowedPaymentMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - allowedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "applicationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "authenticationData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - authenticationData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "billingAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - billingAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "blockedPaymentMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - blockedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "captureDelayHours": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - captureDelayHours = new Option(utf8JsonReader.GetInt32()); - break; - case "channel": - string channelRawValue = utf8JsonReader.GetString(); - if (channelRawValue != null) - channel = new Option(CreateCheckoutSessionResponse.ChannelEnumFromStringOrDefault(channelRawValue)); - break; - case "company": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - company = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "countryCode": - countryCode = new Option(utf8JsonReader.GetString()); - break; - case "dateOfBirth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliverAt": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliverAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliveryAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliveryAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "enableOneClick": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enableOneClick = new Option(utf8JsonReader.GetBoolean()); - break; - case "enablePayOut": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enablePayOut = new Option(utf8JsonReader.GetBoolean()); - break; - case "enableRecurring": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enableRecurring = new Option(utf8JsonReader.GetBoolean()); - break; - case "fundOrigin": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fundOrigin = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "fundRecipient": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fundRecipient = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "installmentOptions": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - installmentOptions = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "lineItems": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mandate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mandate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mcc": - mcc = new Option(utf8JsonReader.GetString()); - break; - case "merchantOrderReference": - merchantOrderReference = new Option(utf8JsonReader.GetString()); - break; - case "metadata": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mode": - string modeRawValue = utf8JsonReader.GetString(); - if (modeRawValue != null) - mode = new Option(CreateCheckoutSessionResponse.ModeEnumFromStringOrDefault(modeRawValue)); - break; - case "mpiData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mpiData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "platformChargebackLogic": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "recurringExpiry": - recurringExpiry = new Option(utf8JsonReader.GetString()); - break; - case "recurringFrequency": - recurringFrequency = new Option(utf8JsonReader.GetString()); - break; - case "recurringProcessingModel": - string recurringProcessingModelRawValue = utf8JsonReader.GetString(); - if (recurringProcessingModelRawValue != null) - recurringProcessingModel = new Option(CreateCheckoutSessionResponse.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); - break; - case "redirectFromIssuerMethod": - redirectFromIssuerMethod = new Option(utf8JsonReader.GetString()); - break; - case "redirectToIssuerMethod": - redirectToIssuerMethod = new Option(utf8JsonReader.GetString()); - break; - case "riskData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - riskData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "sessionData": - sessionData = new Option(utf8JsonReader.GetString()); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "shopperIP": - shopperIP = new Option(utf8JsonReader.GetString()); - break; - case "shopperInteraction": - string shopperInteractionRawValue = utf8JsonReader.GetString(); - if (shopperInteractionRawValue != null) - shopperInteraction = new Option(CreateCheckoutSessionResponse.ShopperInteractionEnumFromStringOrDefault(shopperInteractionRawValue)); - break; - case "shopperLocale": - shopperLocale = new Option(utf8JsonReader.GetString()); - break; - case "shopperName": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperReference": - shopperReference = new Option(utf8JsonReader.GetString()); - break; - case "shopperStatement": - shopperStatement = new Option(utf8JsonReader.GetString()); - break; - case "showInstallmentAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - showInstallmentAmount = new Option(utf8JsonReader.GetBoolean()); - break; - case "showRemovePaymentMethodButton": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - showRemovePaymentMethodButton = new Option(utf8JsonReader.GetBoolean()); - break; - case "socialSecurityNumber": - socialSecurityNumber = new Option(utf8JsonReader.GetString()); - break; - case "splitCardFundingSources": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splitCardFundingSources = new Option(utf8JsonReader.GetBoolean()); - break; - case "splits": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "store": - store = new Option(utf8JsonReader.GetString()); - break; - case "storeFiltrationMode": - string storeFiltrationModeRawValue = utf8JsonReader.GetString(); - if (storeFiltrationModeRawValue != null) - storeFiltrationMode = new Option(CreateCheckoutSessionResponse.StoreFiltrationModeEnumFromStringOrDefault(storeFiltrationModeRawValue)); - break; - case "storePaymentMethod": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - storePaymentMethod = new Option(utf8JsonReader.GetBoolean()); - break; - case "storePaymentMethodMode": - string storePaymentMethodModeRawValue = utf8JsonReader.GetString(); - if (storePaymentMethodModeRawValue != null) - storePaymentMethodMode = new Option(CreateCheckoutSessionResponse.StorePaymentMethodModeEnumFromStringOrDefault(storePaymentMethodModeRawValue)); - break; - case "telephoneNumber": - telephoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "themeId": - themeId = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2RequestData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDSAuthenticationOnly": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDSAuthenticationOnly = new Option(utf8JsonReader.GetBoolean()); - break; - case "trustedShopper": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - trustedShopper = new Option(utf8JsonReader.GetBoolean()); - break; - case "url": - url = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class CreateCheckoutSessionResponse.", nameof(amount)); - - if (!expiresAt.IsSet) - throw new ArgumentException("Property is required for class CreateCheckoutSessionResponse.", nameof(expiresAt)); - - if (!id.IsSet) - throw new ArgumentException("Property is required for class CreateCheckoutSessionResponse.", nameof(id)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class CreateCheckoutSessionResponse.", nameof(merchantAccount)); - - if (!reference.IsSet) - throw new ArgumentException("Property is required for class CreateCheckoutSessionResponse.", nameof(reference)); - - if (!returnUrl.IsSet) - throw new ArgumentException("Property is required for class CreateCheckoutSessionResponse.", nameof(returnUrl)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (expiresAt.IsSet && expiresAt.Value == null) - throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (id.IsSet && id.Value == null) - throw new ArgumentNullException(nameof(id), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (returnUrl.IsSet && returnUrl.Value == null) - throw new ArgumentNullException(nameof(returnUrl), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (accountInfo.IsSet && accountInfo.Value == null) - throw new ArgumentNullException(nameof(accountInfo), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (additionalAmount.IsSet && additionalAmount.Value == null) - throw new ArgumentNullException(nameof(additionalAmount), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (additionalData.IsSet && additionalData.Value == null) - throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (allowedPaymentMethods.IsSet && allowedPaymentMethods.Value == null) - throw new ArgumentNullException(nameof(allowedPaymentMethods), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (applicationInfo.IsSet && applicationInfo.Value == null) - throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (authenticationData.IsSet && authenticationData.Value == null) - throw new ArgumentNullException(nameof(authenticationData), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (blockedPaymentMethods.IsSet && blockedPaymentMethods.Value == null) - throw new ArgumentNullException(nameof(blockedPaymentMethods), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (captureDelayHours.IsSet && captureDelayHours.Value == null) - throw new ArgumentNullException(nameof(captureDelayHours), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (channel.IsSet && channel.Value == null) - throw new ArgumentNullException(nameof(channel), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (company.IsSet && company.Value == null) - throw new ArgumentNullException(nameof(company), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (countryCode.IsSet && countryCode.Value == null) - throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (dateOfBirth.IsSet && dateOfBirth.Value == null) - throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (deliverAt.IsSet && deliverAt.Value == null) - throw new ArgumentNullException(nameof(deliverAt), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (deliveryAddress.IsSet && deliveryAddress.Value == null) - throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (enableOneClick.IsSet && enableOneClick.Value == null) - throw new ArgumentNullException(nameof(enableOneClick), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (enablePayOut.IsSet && enablePayOut.Value == null) - throw new ArgumentNullException(nameof(enablePayOut), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (enableRecurring.IsSet && enableRecurring.Value == null) - throw new ArgumentNullException(nameof(enableRecurring), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (fundOrigin.IsSet && fundOrigin.Value == null) - throw new ArgumentNullException(nameof(fundOrigin), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (fundRecipient.IsSet && fundRecipient.Value == null) - throw new ArgumentNullException(nameof(fundRecipient), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (installmentOptions.IsSet && installmentOptions.Value == null) - throw new ArgumentNullException(nameof(installmentOptions), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (lineItems.IsSet && lineItems.Value == null) - throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (mandate.IsSet && mandate.Value == null) - throw new ArgumentNullException(nameof(mandate), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (mcc.IsSet && mcc.Value == null) - throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (merchantOrderReference.IsSet && merchantOrderReference.Value == null) - throw new ArgumentNullException(nameof(merchantOrderReference), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (metadata.IsSet && metadata.Value == null) - throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (mode.IsSet && mode.Value == null) - throw new ArgumentNullException(nameof(mode), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (mpiData.IsSet && mpiData.Value == null) - throw new ArgumentNullException(nameof(mpiData), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) - throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (recurringExpiry.IsSet && recurringExpiry.Value == null) - throw new ArgumentNullException(nameof(recurringExpiry), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (recurringFrequency.IsSet && recurringFrequency.Value == null) - throw new ArgumentNullException(nameof(recurringFrequency), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) - throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (redirectFromIssuerMethod.IsSet && redirectFromIssuerMethod.Value == null) - throw new ArgumentNullException(nameof(redirectFromIssuerMethod), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (redirectToIssuerMethod.IsSet && redirectToIssuerMethod.Value == null) - throw new ArgumentNullException(nameof(redirectToIssuerMethod), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (riskData.IsSet && riskData.Value == null) - throw new ArgumentNullException(nameof(riskData), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (sessionData.IsSet && sessionData.Value == null) - throw new ArgumentNullException(nameof(sessionData), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (shopperIP.IsSet && shopperIP.Value == null) - throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (shopperInteraction.IsSet && shopperInteraction.Value == null) - throw new ArgumentNullException(nameof(shopperInteraction), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (shopperLocale.IsSet && shopperLocale.Value == null) - throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (shopperName.IsSet && shopperName.Value == null) - throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (shopperStatement.IsSet && shopperStatement.Value == null) - throw new ArgumentNullException(nameof(shopperStatement), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (showInstallmentAmount.IsSet && showInstallmentAmount.Value == null) - throw new ArgumentNullException(nameof(showInstallmentAmount), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (showRemovePaymentMethodButton.IsSet && showRemovePaymentMethodButton.Value == null) - throw new ArgumentNullException(nameof(showRemovePaymentMethodButton), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) - throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (splitCardFundingSources.IsSet && splitCardFundingSources.Value == null) - throw new ArgumentNullException(nameof(splitCardFundingSources), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (splits.IsSet && splits.Value == null) - throw new ArgumentNullException(nameof(splits), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (store.IsSet && store.Value == null) - throw new ArgumentNullException(nameof(store), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (storeFiltrationMode.IsSet && storeFiltrationMode.Value == null) - throw new ArgumentNullException(nameof(storeFiltrationMode), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (storePaymentMethod.IsSet && storePaymentMethod.Value == null) - throw new ArgumentNullException(nameof(storePaymentMethod), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (storePaymentMethodMode.IsSet && storePaymentMethodMode.Value == null) - throw new ArgumentNullException(nameof(storePaymentMethodMode), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (telephoneNumber.IsSet && telephoneNumber.Value == null) - throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (themeId.IsSet && themeId.Value == null) - throw new ArgumentNullException(nameof(themeId), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) - throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (threeDSAuthenticationOnly.IsSet && threeDSAuthenticationOnly.Value == null) - throw new ArgumentNullException(nameof(threeDSAuthenticationOnly), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (trustedShopper.IsSet && trustedShopper.Value == null) - throw new ArgumentNullException(nameof(trustedShopper), "Property is not nullable for class CreateCheckoutSessionResponse."); - - if (url.IsSet && url.Value == null) - throw new ArgumentNullException(nameof(url), "Property is not nullable for class CreateCheckoutSessionResponse."); - - return new CreateCheckoutSessionResponse(amount.Value, expiresAt.Value.Value, id.Value, merchantAccount.Value, reference.Value, returnUrl.Value, accountInfo, additionalAmount, additionalData, allowedPaymentMethods, applicationInfo, authenticationData, billingAddress, blockedPaymentMethods, captureDelayHours, channel, company, countryCode, dateOfBirth, deliverAt, deliveryAddress, enableOneClick, enablePayOut, enableRecurring, fundOrigin, fundRecipient, installmentOptions, lineItems, mandate, mcc, merchantOrderReference, metadata, mode, mpiData, platformChargebackLogic, recurringExpiry, recurringFrequency, recurringProcessingModel, redirectFromIssuerMethod, redirectToIssuerMethod, riskData, sessionData, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, showInstallmentAmount, showRemovePaymentMethodButton, socialSecurityNumber, splitCardFundingSources, splits, store, storeFiltrationMode, storePaymentMethod, storePaymentMethodMode, telephoneNumber, themeId, threeDS2RequestData, threeDSAuthenticationOnly, trustedShopper, url); - } - - /// - /// Serializes a - /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CreateCheckoutSessionResponse createCheckoutSessionResponse, JsonSerializerOptions jsonSerializerOptions) - { - writer.WriteStartObject(); - - WriteProperties(writer, createCheckoutSessionResponse, jsonSerializerOptions); - writer.WriteEndObject(); - } - - /// - /// Serializes the properties of - /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CreateCheckoutSessionResponse createCheckoutSessionResponse, JsonSerializerOptions jsonSerializerOptions) - { - if (createCheckoutSessionResponse.Amount == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Amount), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.Id == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Id), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.MerchantAccount == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.MerchantAccount), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.Reference == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Reference), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.ReturnUrl == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ReturnUrl), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.AccountInfoOption.IsSet && createCheckoutSessionResponse.AccountInfo == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.AccountInfo), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.AdditionalAmountOption.IsSet && createCheckoutSessionResponse.AdditionalAmount == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.AdditionalAmount), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.AdditionalDataOption.IsSet && createCheckoutSessionResponse.AdditionalData == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.AdditionalData), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.AllowedPaymentMethodsOption.IsSet && createCheckoutSessionResponse.AllowedPaymentMethods == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.AllowedPaymentMethods), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.ApplicationInfoOption.IsSet && createCheckoutSessionResponse.ApplicationInfo == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ApplicationInfo), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.AuthenticationDataOption.IsSet && createCheckoutSessionResponse.AuthenticationData == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.AuthenticationData), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.BillingAddressOption.IsSet && createCheckoutSessionResponse.BillingAddress == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.BillingAddress), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.BlockedPaymentMethodsOption.IsSet && createCheckoutSessionResponse.BlockedPaymentMethods == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.BlockedPaymentMethods), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.CompanyOption.IsSet && createCheckoutSessionResponse.Company == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Company), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.CountryCodeOption.IsSet && createCheckoutSessionResponse.CountryCode == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.CountryCode), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.DeliveryAddressOption.IsSet && createCheckoutSessionResponse.DeliveryAddress == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.DeliveryAddress), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.FundOriginOption.IsSet && createCheckoutSessionResponse.FundOrigin == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.FundOrigin), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.FundRecipientOption.IsSet && createCheckoutSessionResponse.FundRecipient == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.FundRecipient), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.InstallmentOptionsOption.IsSet && createCheckoutSessionResponse.InstallmentOptions == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.InstallmentOptions), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.LineItemsOption.IsSet && createCheckoutSessionResponse.LineItems == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.LineItems), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.MandateOption.IsSet && createCheckoutSessionResponse.Mandate == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Mandate), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.MccOption.IsSet && createCheckoutSessionResponse.Mcc == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Mcc), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.MerchantOrderReferenceOption.IsSet && createCheckoutSessionResponse.MerchantOrderReference == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.MerchantOrderReference), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.MetadataOption.IsSet && createCheckoutSessionResponse.Metadata == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Metadata), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.MpiDataOption.IsSet && createCheckoutSessionResponse.MpiData == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.MpiData), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.PlatformChargebackLogicOption.IsSet && createCheckoutSessionResponse.PlatformChargebackLogic == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.PlatformChargebackLogic), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.RecurringExpiryOption.IsSet && createCheckoutSessionResponse.RecurringExpiry == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.RecurringExpiry), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.RecurringFrequencyOption.IsSet && createCheckoutSessionResponse.RecurringFrequency == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.RecurringFrequency), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.RedirectFromIssuerMethodOption.IsSet && createCheckoutSessionResponse.RedirectFromIssuerMethod == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.RedirectFromIssuerMethod), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.RedirectToIssuerMethodOption.IsSet && createCheckoutSessionResponse.RedirectToIssuerMethod == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.RedirectToIssuerMethod), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.RiskDataOption.IsSet && createCheckoutSessionResponse.RiskData == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.RiskData), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.SessionDataOption.IsSet && createCheckoutSessionResponse.SessionData == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.SessionData), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.ShopperEmailOption.IsSet && createCheckoutSessionResponse.ShopperEmail == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ShopperEmail), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.ShopperIPOption.IsSet && createCheckoutSessionResponse.ShopperIP == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ShopperIP), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.ShopperLocaleOption.IsSet && createCheckoutSessionResponse.ShopperLocale == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ShopperLocale), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.ShopperNameOption.IsSet && createCheckoutSessionResponse.ShopperName == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ShopperName), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.ShopperReferenceOption.IsSet && createCheckoutSessionResponse.ShopperReference == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ShopperReference), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.ShopperStatementOption.IsSet && createCheckoutSessionResponse.ShopperStatement == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ShopperStatement), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.SocialSecurityNumberOption.IsSet && createCheckoutSessionResponse.SocialSecurityNumber == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.SocialSecurityNumber), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.SplitsOption.IsSet && createCheckoutSessionResponse.Splits == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Splits), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.StoreOption.IsSet && createCheckoutSessionResponse.Store == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Store), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.TelephoneNumberOption.IsSet && createCheckoutSessionResponse.TelephoneNumber == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.TelephoneNumber), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.ThemeIdOption.IsSet && createCheckoutSessionResponse.ThemeId == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ThemeId), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.ThreeDS2RequestDataOption.IsSet && createCheckoutSessionResponse.ThreeDS2RequestData == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.ThreeDS2RequestData), "Property is required for class CreateCheckoutSessionResponse."); - - if (createCheckoutSessionResponse.UrlOption.IsSet && createCheckoutSessionResponse.Url == null) - throw new ArgumentNullException(nameof(createCheckoutSessionResponse.Url), "Property is required for class CreateCheckoutSessionResponse."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.Amount, jsonSerializerOptions); - writer.WriteString("expiresAt", createCheckoutSessionResponse.ExpiresAt.ToString(ExpiresAtFormat)); - - writer.WriteString("id", createCheckoutSessionResponse.Id); - - writer.WriteString("merchantAccount", createCheckoutSessionResponse.MerchantAccount); - - writer.WriteString("reference", createCheckoutSessionResponse.Reference); - - writer.WriteString("returnUrl", createCheckoutSessionResponse.ReturnUrl); - - if (createCheckoutSessionResponse.AccountInfoOption.IsSet) - { - writer.WritePropertyName("accountInfo"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.AccountInfo, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.AdditionalAmountOption.IsSet) - { - writer.WritePropertyName("additionalAmount"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.AdditionalAmount, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.AdditionalDataOption.IsSet) - { - writer.WritePropertyName("additionalData"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.AdditionalData, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.AllowedPaymentMethodsOption.IsSet) - { - writer.WritePropertyName("allowedPaymentMethods"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.AllowedPaymentMethods, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.ApplicationInfoOption.IsSet) - { - writer.WritePropertyName("applicationInfo"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.ApplicationInfo, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.AuthenticationDataOption.IsSet) - { - writer.WritePropertyName("authenticationData"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.AuthenticationData, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.BillingAddressOption.IsSet) - { - writer.WritePropertyName("billingAddress"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.BillingAddress, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.BlockedPaymentMethodsOption.IsSet) - { - writer.WritePropertyName("blockedPaymentMethods"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.BlockedPaymentMethods, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.CaptureDelayHoursOption.IsSet) - writer.WriteNumber("captureDelayHours", createCheckoutSessionResponse.CaptureDelayHoursOption.Value.Value); - - var channelRawValue = CreateCheckoutSessionResponse.ChannelEnumToJsonValue(createCheckoutSessionResponse.ChannelOption.Value.Value); - writer.WriteString("channel", channelRawValue); - if (createCheckoutSessionResponse.CompanyOption.IsSet) - { - writer.WritePropertyName("company"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.Company, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.CountryCodeOption.IsSet) - writer.WriteString("countryCode", createCheckoutSessionResponse.CountryCode); - - if (createCheckoutSessionResponse.DateOfBirthOption.IsSet) - writer.WriteString("dateOfBirth", createCheckoutSessionResponse.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); - - if (createCheckoutSessionResponse.DeliverAtOption.IsSet) - writer.WriteString("deliverAt", createCheckoutSessionResponse.DeliverAtOption.Value.Value.ToString(DeliverAtFormat)); - - if (createCheckoutSessionResponse.DeliveryAddressOption.IsSet) - { - writer.WritePropertyName("deliveryAddress"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.DeliveryAddress, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.EnableOneClickOption.IsSet) - writer.WriteBoolean("enableOneClick", createCheckoutSessionResponse.EnableOneClickOption.Value.Value); - - if (createCheckoutSessionResponse.EnablePayOutOption.IsSet) - writer.WriteBoolean("enablePayOut", createCheckoutSessionResponse.EnablePayOutOption.Value.Value); - - if (createCheckoutSessionResponse.EnableRecurringOption.IsSet) - writer.WriteBoolean("enableRecurring", createCheckoutSessionResponse.EnableRecurringOption.Value.Value); - - if (createCheckoutSessionResponse.FundOriginOption.IsSet) - { - writer.WritePropertyName("fundOrigin"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.FundOrigin, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.FundRecipientOption.IsSet) - { - writer.WritePropertyName("fundRecipient"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.FundRecipient, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.InstallmentOptionsOption.IsSet) - { - writer.WritePropertyName("installmentOptions"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.InstallmentOptions, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.LineItemsOption.IsSet) - { - writer.WritePropertyName("lineItems"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.LineItems, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.MandateOption.IsSet) - { - writer.WritePropertyName("mandate"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.Mandate, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.MccOption.IsSet) - writer.WriteString("mcc", createCheckoutSessionResponse.Mcc); - - if (createCheckoutSessionResponse.MerchantOrderReferenceOption.IsSet) - writer.WriteString("merchantOrderReference", createCheckoutSessionResponse.MerchantOrderReference); - - if (createCheckoutSessionResponse.MetadataOption.IsSet) - { - writer.WritePropertyName("metadata"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.Metadata, jsonSerializerOptions); - } - var modeRawValue = CreateCheckoutSessionResponse.ModeEnumToJsonValue(createCheckoutSessionResponse.ModeOption.Value.Value); - writer.WriteString("mode", modeRawValue); - if (createCheckoutSessionResponse.MpiDataOption.IsSet) - { - writer.WritePropertyName("mpiData"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.MpiData, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.PlatformChargebackLogicOption.IsSet) - { - writer.WritePropertyName("platformChargebackLogic"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.PlatformChargebackLogic, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.RecurringExpiryOption.IsSet) - writer.WriteString("recurringExpiry", createCheckoutSessionResponse.RecurringExpiry); - - if (createCheckoutSessionResponse.RecurringFrequencyOption.IsSet) - writer.WriteString("recurringFrequency", createCheckoutSessionResponse.RecurringFrequency); - - var recurringProcessingModelRawValue = CreateCheckoutSessionResponse.RecurringProcessingModelEnumToJsonValue(createCheckoutSessionResponse.RecurringProcessingModelOption.Value.Value); - writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); - if (createCheckoutSessionResponse.RedirectFromIssuerMethodOption.IsSet) - writer.WriteString("redirectFromIssuerMethod", createCheckoutSessionResponse.RedirectFromIssuerMethod); - - if (createCheckoutSessionResponse.RedirectToIssuerMethodOption.IsSet) - writer.WriteString("redirectToIssuerMethod", createCheckoutSessionResponse.RedirectToIssuerMethod); - - if (createCheckoutSessionResponse.RiskDataOption.IsSet) - { - writer.WritePropertyName("riskData"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.RiskData, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.SessionDataOption.IsSet) - writer.WriteString("sessionData", createCheckoutSessionResponse.SessionData); - - if (createCheckoutSessionResponse.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", createCheckoutSessionResponse.ShopperEmail); - - if (createCheckoutSessionResponse.ShopperIPOption.IsSet) - writer.WriteString("shopperIP", createCheckoutSessionResponse.ShopperIP); - - var shopperInteractionRawValue = CreateCheckoutSessionResponse.ShopperInteractionEnumToJsonValue(createCheckoutSessionResponse.ShopperInteractionOption.Value.Value); - writer.WriteString("shopperInteraction", shopperInteractionRawValue); - if (createCheckoutSessionResponse.ShopperLocaleOption.IsSet) - writer.WriteString("shopperLocale", createCheckoutSessionResponse.ShopperLocale); - - if (createCheckoutSessionResponse.ShopperNameOption.IsSet) - { - writer.WritePropertyName("shopperName"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.ShopperName, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.ShopperReferenceOption.IsSet) - writer.WriteString("shopperReference", createCheckoutSessionResponse.ShopperReference); - - if (createCheckoutSessionResponse.ShopperStatementOption.IsSet) - writer.WriteString("shopperStatement", createCheckoutSessionResponse.ShopperStatement); - - if (createCheckoutSessionResponse.ShowInstallmentAmountOption.IsSet) - writer.WriteBoolean("showInstallmentAmount", createCheckoutSessionResponse.ShowInstallmentAmountOption.Value.Value); - - if (createCheckoutSessionResponse.ShowRemovePaymentMethodButtonOption.IsSet) - writer.WriteBoolean("showRemovePaymentMethodButton", createCheckoutSessionResponse.ShowRemovePaymentMethodButtonOption.Value.Value); - - if (createCheckoutSessionResponse.SocialSecurityNumberOption.IsSet) - writer.WriteString("socialSecurityNumber", createCheckoutSessionResponse.SocialSecurityNumber); - - if (createCheckoutSessionResponse.SplitCardFundingSourcesOption.IsSet) - writer.WriteBoolean("splitCardFundingSources", createCheckoutSessionResponse.SplitCardFundingSourcesOption.Value.Value); - - if (createCheckoutSessionResponse.SplitsOption.IsSet) - { - writer.WritePropertyName("splits"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.Splits, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.StoreOption.IsSet) - writer.WriteString("store", createCheckoutSessionResponse.Store); - - var storeFiltrationModeRawValue = CreateCheckoutSessionResponse.StoreFiltrationModeEnumToJsonValue(createCheckoutSessionResponse.StoreFiltrationModeOption.Value.Value); - writer.WriteString("storeFiltrationMode", storeFiltrationModeRawValue); - if (createCheckoutSessionResponse.StorePaymentMethodOption.IsSet) - writer.WriteBoolean("storePaymentMethod", createCheckoutSessionResponse.StorePaymentMethodOption.Value.Value); - - var storePaymentMethodModeRawValue = CreateCheckoutSessionResponse.StorePaymentMethodModeEnumToJsonValue(createCheckoutSessionResponse.StorePaymentMethodModeOption.Value.Value); - writer.WriteString("storePaymentMethodMode", storePaymentMethodModeRawValue); - if (createCheckoutSessionResponse.TelephoneNumberOption.IsSet) - writer.WriteString("telephoneNumber", createCheckoutSessionResponse.TelephoneNumber); - - if (createCheckoutSessionResponse.ThemeIdOption.IsSet) - writer.WriteString("themeId", createCheckoutSessionResponse.ThemeId); - - if (createCheckoutSessionResponse.ThreeDS2RequestDataOption.IsSet) - { - writer.WritePropertyName("threeDS2RequestData"); - JsonSerializer.Serialize(writer, createCheckoutSessionResponse.ThreeDS2RequestData, jsonSerializerOptions); - } - if (createCheckoutSessionResponse.ThreeDSAuthenticationOnlyOption.IsSet) - writer.WriteBoolean("threeDSAuthenticationOnly", createCheckoutSessionResponse.ThreeDSAuthenticationOnlyOption.Value.Value); - - if (createCheckoutSessionResponse.TrustedShopperOption.IsSet) - writer.WriteBoolean("trustedShopper", createCheckoutSessionResponse.TrustedShopperOption.Value.Value); - - if (createCheckoutSessionResponse.UrlOption.IsSet) - writer.WriteString("url", createCheckoutSessionResponse.Url); - } - } } diff --git a/Adyen/Model/Checkout/CreateOrderRequest.cs b/Adyen/Model/Checkout/CreateOrderRequest.cs index 0831f378a..383c79ee2 100644 --- a/Adyen/Model/Checkout/CreateOrderRequest.cs +++ b/Adyen/Model/Checkout/CreateOrderRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,73 +15,70 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CreateOrderRequest /// - public partial class CreateOrderRequest : IValidatableObject + [DataContract(Name = "CreateOrderRequest")] + public partial class CreateOrderRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// amount - /// The merchant account identifier, with which you want to process the order. - /// A custom reference identifying the order. - /// The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [JsonConstructor] - public CreateOrderRequest(Amount amount, string merchantAccount, string reference, Option expiresAt = default) + [JsonConstructorAttribute] + protected CreateOrderRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// amount (required). + /// The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.. + /// The merchant account identifier, with which you want to process the order. (required). + /// A custom reference identifying the order. (required). + public CreateOrderRequest(Amount amount = default(Amount), string expiresAt = default(string), string merchantAccount = default(string), string reference = default(string)) { - Amount = amount; - MerchantAccount = merchantAccount; - Reference = reference; - ExpiresAtOption = expiresAt; - OnCreated(); + this.Amount = amount; + this.MerchantAccount = merchantAccount; + this.Reference = reference; + this.ExpiresAt = expiresAt; } - partial void OnCreated(); - /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] public Amount Amount { get; set; } + /// + /// The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + /// + /// The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + [DataMember(Name = "expiresAt", EmitDefaultValue = false)] + public string ExpiresAt { get; set; } + /// /// The merchant account identifier, with which you want to process the order. /// /// The merchant account identifier, with which you want to process the order. - [JsonPropertyName("merchantAccount")] + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] public string MerchantAccount { get; set; } /// /// A custom reference identifying the order. /// /// A custom reference identifying the order. - [JsonPropertyName("reference")] + [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] public string Reference { get; set; } - /// - /// Used to track the state of ExpiresAt - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiresAtOption { get; private set; } - - /// - /// The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - /// - /// The date when the order should expire. If not provided, the default expiry duration is 1 day. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [JsonPropertyName("expiresAt")] - public string ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } - /// /// Returns the string presentation of the object /// @@ -90,153 +88,103 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class CreateOrderRequest {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CreateOrderRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CreateOrderRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option merchantAccount = default; - Option reference = default; - Option expiresAt = default; + return this.Equals(input as CreateOrderRequest); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if CreateOrderRequest instances are equal + /// + /// Instance of CreateOrderRequest to be compared + /// Boolean + public bool Equals(CreateOrderRequest input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "expiresAt": - expiresAt = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class CreateOrderRequest.", nameof(amount)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class CreateOrderRequest.", nameof(merchantAccount)); - - if (!reference.IsSet) - throw new ArgumentException("Property is required for class CreateOrderRequest.", nameof(reference)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class CreateOrderRequest."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class CreateOrderRequest."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CreateOrderRequest."); - - if (expiresAt.IsSet && expiresAt.Value == null) - throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CreateOrderRequest."); - - return new CreateOrderRequest(amount.Value, merchantAccount.Value, reference.Value, expiresAt); + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CreateOrderRequest createOrderRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, createOrderRequest, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CreateOrderRequest createOrderRequest, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (createOrderRequest.Amount == null) - throw new ArgumentNullException(nameof(createOrderRequest.Amount), "Property is required for class CreateOrderRequest."); - - if (createOrderRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(createOrderRequest.MerchantAccount), "Property is required for class CreateOrderRequest."); - - if (createOrderRequest.Reference == null) - throw new ArgumentNullException(nameof(createOrderRequest.Reference), "Property is required for class CreateOrderRequest."); - - if (createOrderRequest.ExpiresAtOption.IsSet && createOrderRequest.ExpiresAt == null) - throw new ArgumentNullException(nameof(createOrderRequest.ExpiresAt), "Property is required for class CreateOrderRequest."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, createOrderRequest.Amount, jsonSerializerOptions); - writer.WriteString("merchantAccount", createOrderRequest.MerchantAccount); - - writer.WriteString("reference", createOrderRequest.Reference); - - if (createOrderRequest.ExpiresAtOption.IsSet) - writer.WriteString("expiresAt", createOrderRequest.ExpiresAt); + yield break; } } + } diff --git a/Adyen/Model/Checkout/CreateOrderResponse.cs b/Adyen/Model/Checkout/CreateOrderResponse.cs index cd7457879..00e5cbc82 100644 --- a/Adyen/Model/Checkout/CreateOrderResponse.cs +++ b/Adyen/Model/Checkout/CreateOrderResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,205 +15,136 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// CreateOrderResponse /// - public partial class CreateOrderResponse : IValidatableObject + [DataContract(Name = "CreateOrderResponse")] + public partial class CreateOrderResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The date that the order will expire. - /// The encrypted data that will be used by merchant for adding payments to the order. - /// remainingAmount - /// The result of the order creation request. The value is always **Success**. - /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - /// fraudResult - /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - /// The reference provided by merchant for creating the order. - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [JsonConstructor] - public CreateOrderResponse(Amount amount, string expiresAt, string orderData, Amount remainingAmount, ResultCodeEnum resultCode, Option> additionalData = default, Option fraudResult = default, Option pspReference = default, Option reference = default, Option refusalReason = default) - { - Amount = amount; - ExpiresAt = expiresAt; - OrderData = orderData; - RemainingAmount = remainingAmount; - ResultCode = resultCode; - AdditionalDataOption = additionalData; - FraudResultOption = fraudResult; - PspReferenceOption = pspReference; - ReferenceOption = reference; - RefusalReasonOption = refusalReason; - OnCreated(); - } - - partial void OnCreated(); - /// /// The result of the order creation request. The value is always **Success**. /// /// The result of the order creation request. The value is always **Success**. + [JsonConverter(typeof(StringEnumConverter))] public enum ResultCodeEnum { /// /// Enum Success for value: Success /// + [EnumMember(Value = "Success")] Success = 1 + } + /// - /// Returns a + /// The result of the order creation request. The value is always **Success**. /// - /// - /// - /// - public static ResultCodeEnum ResultCodeEnumFromString(string value) - { - if (value.Equals("Success")) - return ResultCodeEnum.Success; - - throw new NotImplementedException($"Could not convert value to type ResultCodeEnum: '{value}'"); - } - + /// The result of the order creation request. The value is always **Success**. + [DataMember(Name = "resultCode", IsRequired = false, EmitDefaultValue = false)] + public ResultCodeEnum ResultCode { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static ResultCodeEnum? ResultCodeEnumFromStringOrDefault(string value) - { - if (value.Equals("Success")) - return ResultCodeEnum.Success; - - return null; - } - + [JsonConstructorAttribute] + protected CreateOrderResponse() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string ResultCodeEnumToJsonValue(ResultCodeEnum value) + /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**.. + /// amount (required). + /// The date that the order will expire. (required). + /// fraudResult. + /// The encrypted data that will be used by merchant for adding payments to the order. (required). + /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request.. + /// The reference provided by merchant for creating the order.. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. + /// remainingAmount (required). + /// The result of the order creation request. The value is always **Success**. (required). + public CreateOrderResponse(Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), string expiresAt = default(string), FraudResult fraudResult = default(FraudResult), string orderData = default(string), string pspReference = default(string), string reference = default(string), string refusalReason = default(string), Amount remainingAmount = default(Amount), ResultCodeEnum resultCode = default(ResultCodeEnum)) { - if (value == ResultCodeEnum.Success) - return "Success"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.Amount = amount; + this.ExpiresAt = expiresAt; + this.OrderData = orderData; + this.RemainingAmount = remainingAmount; + this.ResultCode = resultCode; + this.AdditionalData = additionalData; + this.FraudResult = fraudResult; + this.PspReference = pspReference; + this.Reference = reference; + this.RefusalReason = refusalReason; } /// - /// The result of the order creation request. The value is always **Success**. + /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. /// - /// The result of the order creation request. The value is always **Success**. - [JsonPropertyName("resultCode")] - public ResultCodeEnum ResultCode { get; set; } + /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] public Amount Amount { get; set; } /// /// The date that the order will expire. /// /// The date that the order will expire. - [JsonPropertyName("expiresAt")] + [DataMember(Name = "expiresAt", IsRequired = false, EmitDefaultValue = false)] public string ExpiresAt { get; set; } - /// - /// The encrypted data that will be used by merchant for adding payments to the order. - /// - /// The encrypted data that will be used by merchant for adding payments to the order. - [JsonPropertyName("orderData")] - public string OrderData { get; set; } - - /// - /// Gets or Sets RemainingAmount - /// - [JsonPropertyName("remainingAmount")] - public Amount RemainingAmount { get; set; } - - /// - /// Used to track the state of AdditionalData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AdditionalDataOption { get; private set; } - - /// - /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - /// - /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - [JsonPropertyName("additionalData")] - public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } - - /// - /// Used to track the state of FraudResult - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FraudResultOption { get; private set; } - /// /// Gets or Sets FraudResult /// - [JsonPropertyName("fraudResult")] - public FraudResult FraudResult { get { return this.FraudResultOption; } set { this.FraudResultOption = new Option(value); } } + [DataMember(Name = "fraudResult", EmitDefaultValue = false)] + public FraudResult FraudResult { get; set; } /// - /// Used to track the state of PspReference + /// The encrypted data that will be used by merchant for adding payments to the order. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PspReferenceOption { get; private set; } + /// The encrypted data that will be used by merchant for adding payments to the order. + [DataMember(Name = "orderData", IsRequired = false, EmitDefaultValue = false)] + public string OrderData { get; set; } /// /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. /// /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - [JsonPropertyName("pspReference")] - public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + public string PspReference { get; set; } /// /// The reference provided by merchant for creating the order. /// /// The reference provided by merchant for creating the order. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// - /// Used to track the state of RefusalReason + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RefusalReasonOption { get; private set; } + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + [DataMember(Name = "refusalReason", EmitDefaultValue = false)] + public string RefusalReason { get; set; } /// - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + /// Gets or Sets RemainingAmount /// - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [JsonPropertyName("refusalReason")] - public string RefusalReason { get { return this.RefusalReasonOption; } set { this.RefusalReasonOption = new Option(value); } } + [DataMember(Name = "remainingAmount", IsRequired = false, EmitDefaultValue = false)] + public Amount RemainingAmount { get; set; } /// /// Returns the string presentation of the object @@ -222,248 +154,161 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class CreateOrderResponse {\n"); + sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); - sb.Append(" OrderData: ").Append(OrderData).Append("\n"); - sb.Append(" RemainingAmount: ").Append(RemainingAmount).Append("\n"); - sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); - sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); sb.Append(" FraudResult: ").Append(FraudResult).Append("\n"); + sb.Append(" OrderData: ").Append(OrderData).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" RefusalReason: ").Append(RefusalReason).Append("\n"); + sb.Append(" RemainingAmount: ").Append(RemainingAmount).Append("\n"); + sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class CreateOrderResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override CreateOrderResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option expiresAt = default; - Option orderData = default; - Option remainingAmount = default; - Option resultCode = default; - Option> additionalData = default; - Option fraudResult = default; - Option pspReference = default; - Option reference = default; - Option refusalReason = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "expiresAt": - expiresAt = new Option(utf8JsonReader.GetString()); - break; - case "orderData": - orderData = new Option(utf8JsonReader.GetString()); - break; - case "remainingAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - remainingAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "resultCode": - string resultCodeRawValue = utf8JsonReader.GetString(); - if (resultCodeRawValue != null) - resultCode = new Option(CreateOrderResponse.ResultCodeEnumFromStringOrDefault(resultCodeRawValue)); - break; - case "additionalData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "fraudResult": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fraudResult = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "refusalReason": - refusalReason = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class CreateOrderResponse.", nameof(amount)); - - if (!expiresAt.IsSet) - throw new ArgumentException("Property is required for class CreateOrderResponse.", nameof(expiresAt)); - - if (!orderData.IsSet) - throw new ArgumentException("Property is required for class CreateOrderResponse.", nameof(orderData)); - - if (!remainingAmount.IsSet) - throw new ArgumentException("Property is required for class CreateOrderResponse.", nameof(remainingAmount)); - - if (!resultCode.IsSet) - throw new ArgumentException("Property is required for class CreateOrderResponse.", nameof(resultCode)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class CreateOrderResponse."); - - if (expiresAt.IsSet && expiresAt.Value == null) - throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class CreateOrderResponse."); - - if (orderData.IsSet && orderData.Value == null) - throw new ArgumentNullException(nameof(orderData), "Property is not nullable for class CreateOrderResponse."); - - if (remainingAmount.IsSet && remainingAmount.Value == null) - throw new ArgumentNullException(nameof(remainingAmount), "Property is not nullable for class CreateOrderResponse."); - - if (resultCode.IsSet && resultCode.Value == null) - throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class CreateOrderResponse."); - - if (additionalData.IsSet && additionalData.Value == null) - throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class CreateOrderResponse."); - - if (fraudResult.IsSet && fraudResult.Value == null) - throw new ArgumentNullException(nameof(fraudResult), "Property is not nullable for class CreateOrderResponse."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class CreateOrderResponse."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class CreateOrderResponse."); - - if (refusalReason.IsSet && refusalReason.Value == null) - throw new ArgumentNullException(nameof(refusalReason), "Property is not nullable for class CreateOrderResponse."); - - return new CreateOrderResponse(amount.Value, expiresAt.Value, orderData.Value, remainingAmount.Value, resultCode.Value.Value, additionalData, fraudResult, pspReference, reference, refusalReason); + return this.Equals(input as CreateOrderResponse); } /// - /// Serializes a + /// Returns true if CreateOrderResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, CreateOrderResponse createOrderResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of CreateOrderResponse to be compared + /// Boolean + public bool Equals(CreateOrderResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, createOrderResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + input.AdditionalData != null && + this.AdditionalData.SequenceEqual(input.AdditionalData) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) + ) && + ( + this.FraudResult == input.FraudResult || + (this.FraudResult != null && + this.FraudResult.Equals(input.FraudResult)) + ) && + ( + this.OrderData == input.OrderData || + (this.OrderData != null && + this.OrderData.Equals(input.OrderData)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.RefusalReason == input.RefusalReason || + (this.RefusalReason != null && + this.RefusalReason.Equals(input.RefusalReason)) + ) && + ( + this.RemainingAmount == input.RemainingAmount || + (this.RemainingAmount != null && + this.RemainingAmount.Equals(input.RemainingAmount)) + ) && + ( + this.ResultCode == input.ResultCode || + this.ResultCode.Equals(input.ResultCode) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, CreateOrderResponse createOrderResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (createOrderResponse.Amount == null) - throw new ArgumentNullException(nameof(createOrderResponse.Amount), "Property is required for class CreateOrderResponse."); - - if (createOrderResponse.ExpiresAt == null) - throw new ArgumentNullException(nameof(createOrderResponse.ExpiresAt), "Property is required for class CreateOrderResponse."); - - if (createOrderResponse.OrderData == null) - throw new ArgumentNullException(nameof(createOrderResponse.OrderData), "Property is required for class CreateOrderResponse."); - - if (createOrderResponse.RemainingAmount == null) - throw new ArgumentNullException(nameof(createOrderResponse.RemainingAmount), "Property is required for class CreateOrderResponse."); - - if (createOrderResponse.AdditionalDataOption.IsSet && createOrderResponse.AdditionalData == null) - throw new ArgumentNullException(nameof(createOrderResponse.AdditionalData), "Property is required for class CreateOrderResponse."); - - if (createOrderResponse.FraudResultOption.IsSet && createOrderResponse.FraudResult == null) - throw new ArgumentNullException(nameof(createOrderResponse.FraudResult), "Property is required for class CreateOrderResponse."); - - if (createOrderResponse.PspReferenceOption.IsSet && createOrderResponse.PspReference == null) - throw new ArgumentNullException(nameof(createOrderResponse.PspReference), "Property is required for class CreateOrderResponse."); - - if (createOrderResponse.ReferenceOption.IsSet && createOrderResponse.Reference == null) - throw new ArgumentNullException(nameof(createOrderResponse.Reference), "Property is required for class CreateOrderResponse."); - - if (createOrderResponse.RefusalReasonOption.IsSet && createOrderResponse.RefusalReason == null) - throw new ArgumentNullException(nameof(createOrderResponse.RefusalReason), "Property is required for class CreateOrderResponse."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, createOrderResponse.Amount, jsonSerializerOptions); - writer.WriteString("expiresAt", createOrderResponse.ExpiresAt); - - writer.WriteString("orderData", createOrderResponse.OrderData); - - writer.WritePropertyName("remainingAmount"); - JsonSerializer.Serialize(writer, createOrderResponse.RemainingAmount, jsonSerializerOptions); - var resultCodeRawValue = CreateOrderResponse.ResultCodeEnumToJsonValue(createOrderResponse.ResultCode); - writer.WriteString("resultCode", resultCodeRawValue); - if (createOrderResponse.AdditionalDataOption.IsSet) - { - writer.WritePropertyName("additionalData"); - JsonSerializer.Serialize(writer, createOrderResponse.AdditionalData, jsonSerializerOptions); - } - if (createOrderResponse.FraudResultOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("fraudResult"); - JsonSerializer.Serialize(writer, createOrderResponse.FraudResult, jsonSerializerOptions); + int hashCode = 41; + if (this.AdditionalData != null) + { + hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } + if (this.FraudResult != null) + { + hashCode = (hashCode * 59) + this.FraudResult.GetHashCode(); + } + if (this.OrderData != null) + { + hashCode = (hashCode * 59) + this.OrderData.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.RefusalReason != null) + { + hashCode = (hashCode * 59) + this.RefusalReason.GetHashCode(); + } + if (this.RemainingAmount != null) + { + hashCode = (hashCode * 59) + this.RemainingAmount.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ResultCode.GetHashCode(); + return hashCode; } - if (createOrderResponse.PspReferenceOption.IsSet) - writer.WriteString("pspReference", createOrderResponse.PspReference); - - if (createOrderResponse.ReferenceOption.IsSet) - writer.WriteString("reference", createOrderResponse.Reference); - - if (createOrderResponse.RefusalReasonOption.IsSet) - writer.WriteString("refusalReason", createOrderResponse.RefusalReason); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/DeliveryAddress.cs b/Adyen/Model/Checkout/DeliveryAddress.cs index 0b6fdbe66..06985b57d 100644 --- a/Adyen/Model/Checkout/DeliveryAddress.cs +++ b/Adyen/Model/Checkout/DeliveryAddress.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,121 +15,104 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// DeliveryAddress /// - public partial class DeliveryAddress : IValidatableObject + [DataContract(Name = "DeliveryAddress")] + public partial class DeliveryAddress : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The name of the city. Maximum length: 3000 characters. - /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. - /// The number or name of the house. Maximum length: 3000 characters. - /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. - /// firstName - /// lastName - /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. - [JsonConstructor] - public DeliveryAddress(string city, string country, string houseNumberOrName, string postalCode, string street, Option firstName = default, Option lastName = default, Option stateOrProvince = default) + [JsonConstructorAttribute] + protected DeliveryAddress() { } + /// + /// Initializes a new instance of the class. + /// + /// The name of the city. Maximum length: 3000 characters. (required). + /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. (required). + /// firstName. + /// The number or name of the house. Maximum length: 3000 characters. (required). + /// lastName. + /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. (required). + /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada.. + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. (required). + public DeliveryAddress(string city = default(string), string country = default(string), string firstName = default(string), string houseNumberOrName = default(string), string lastName = default(string), string postalCode = default(string), string stateOrProvince = default(string), string street = default(string)) { - City = city; - Country = country; - HouseNumberOrName = houseNumberOrName; - PostalCode = postalCode; - Street = street; - FirstNameOption = firstName; - LastNameOption = lastName; - StateOrProvinceOption = stateOrProvince; - OnCreated(); + this.City = city; + this.Country = country; + this.HouseNumberOrName = houseNumberOrName; + this.PostalCode = postalCode; + this.Street = street; + this.FirstName = firstName; + this.LastName = lastName; + this.StateOrProvince = stateOrProvince; } - partial void OnCreated(); - /// /// The name of the city. Maximum length: 3000 characters. /// /// The name of the city. Maximum length: 3000 characters. - [JsonPropertyName("city")] + [DataMember(Name = "city", IsRequired = false, EmitDefaultValue = false)] public string City { get; set; } /// /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. /// /// The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. - [JsonPropertyName("country")] + [DataMember(Name = "country", IsRequired = false, EmitDefaultValue = false)] public string Country { get; set; } - /// - /// The number or name of the house. Maximum length: 3000 characters. - /// - /// The number or name of the house. Maximum length: 3000 characters. - [JsonPropertyName("houseNumberOrName")] - public string HouseNumberOrName { get; set; } - - /// - /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. - /// - /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. - [JsonPropertyName("postalCode")] - public string PostalCode { get; set; } - - /// - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. - /// - /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. - [JsonPropertyName("street")] - public string Street { get; set; } - - /// - /// Used to track the state of FirstName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FirstNameOption { get; private set; } - /// /// Gets or Sets FirstName /// - [JsonPropertyName("firstName")] - public string FirstName { get { return this.FirstNameOption; } set { this.FirstNameOption = new Option(value); } } + [DataMember(Name = "firstName", EmitDefaultValue = false)] + public string FirstName { get; set; } /// - /// Used to track the state of LastName + /// The number or name of the house. Maximum length: 3000 characters. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LastNameOption { get; private set; } + /// The number or name of the house. Maximum length: 3000 characters. + [DataMember(Name = "houseNumberOrName", IsRequired = false, EmitDefaultValue = false)] + public string HouseNumberOrName { get; set; } /// /// Gets or Sets LastName /// - [JsonPropertyName("lastName")] - public string LastName { get { return this.LastNameOption; } set { this.LastNameOption = new Option(value); } } + [DataMember(Name = "lastName", EmitDefaultValue = false)] + public string LastName { get; set; } /// - /// Used to track the state of StateOrProvince + /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StateOrProvinceOption { get; private set; } + /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + [DataMember(Name = "postalCode", IsRequired = false, EmitDefaultValue = false)] + public string PostalCode { get; set; } /// /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. /// /// The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. - [JsonPropertyName("stateOrProvince")] - public string StateOrProvince { get { return this.StateOrProvinceOption; } set { this.StateOrProvinceOption = new Option(value); } } + [DataMember(Name = "stateOrProvince", EmitDefaultValue = false)] + public string StateOrProvince { get; set; } + + /// + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + /// + /// The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + [DataMember(Name = "street", IsRequired = false, EmitDefaultValue = false)] + public string Street { get; set; } /// /// Returns the string presentation of the object @@ -140,235 +124,166 @@ public override string ToString() sb.Append("class DeliveryAddress {\n"); sb.Append(" City: ").Append(City).Append("\n"); sb.Append(" Country: ").Append(Country).Append("\n"); - sb.Append(" HouseNumberOrName: ").Append(HouseNumberOrName).Append("\n"); - sb.Append(" PostalCode: ").Append(PostalCode).Append("\n"); - sb.Append(" Street: ").Append(Street).Append("\n"); sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" HouseNumberOrName: ").Append(HouseNumberOrName).Append("\n"); sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" PostalCode: ").Append(PostalCode).Append("\n"); sb.Append(" StateOrProvince: ").Append(StateOrProvince).Append("\n"); + sb.Append(" Street: ").Append(Street).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // City (string) maxLength - if (this.City != null && this.City.Length > 3000) - { - yield return new ValidationResult("Invalid value for City, length must be less than 3000.", new [] { "City" }); - } - - // HouseNumberOrName (string) maxLength - if (this.HouseNumberOrName != null && this.HouseNumberOrName.Length > 3000) - { - yield return new ValidationResult("Invalid value for HouseNumberOrName, length must be less than 3000.", new [] { "HouseNumberOrName" }); - } - - // Street (string) maxLength - if (this.Street != null && this.Street.Length > 3000) - { - yield return new ValidationResult("Invalid value for Street, length must be less than 3000.", new [] { "Street" }); - } - - // StateOrProvince (string) maxLength - if (this.StateOrProvince != null && this.StateOrProvince.Length > 1000) - { - yield return new ValidationResult("Invalid value for StateOrProvince, length must be less than 1000.", new [] { "StateOrProvince" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class DeliveryAddressJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override DeliveryAddress Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option city = default; - Option country = default; - Option houseNumberOrName = default; - Option postalCode = default; - Option street = default; - Option firstName = default; - Option lastName = default; - Option stateOrProvince = default; + return this.Equals(input as DeliveryAddress); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if DeliveryAddress instances are equal + /// + /// Instance of DeliveryAddress to be compared + /// Boolean + public bool Equals(DeliveryAddress input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "city": - city = new Option(utf8JsonReader.GetString()); - break; - case "country": - country = new Option(utf8JsonReader.GetString()); - break; - case "houseNumberOrName": - houseNumberOrName = new Option(utf8JsonReader.GetString()); - break; - case "postalCode": - postalCode = new Option(utf8JsonReader.GetString()); - break; - case "street": - street = new Option(utf8JsonReader.GetString()); - break; - case "firstName": - firstName = new Option(utf8JsonReader.GetString()); - break; - case "lastName": - lastName = new Option(utf8JsonReader.GetString()); - break; - case "stateOrProvince": - stateOrProvince = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!city.IsSet) - throw new ArgumentException("Property is required for class DeliveryAddress.", nameof(city)); - - if (!country.IsSet) - throw new ArgumentException("Property is required for class DeliveryAddress.", nameof(country)); - - if (!houseNumberOrName.IsSet) - throw new ArgumentException("Property is required for class DeliveryAddress.", nameof(houseNumberOrName)); - - if (!postalCode.IsSet) - throw new ArgumentException("Property is required for class DeliveryAddress.", nameof(postalCode)); - - if (!street.IsSet) - throw new ArgumentException("Property is required for class DeliveryAddress.", nameof(street)); - - if (city.IsSet && city.Value == null) - throw new ArgumentNullException(nameof(city), "Property is not nullable for class DeliveryAddress."); - - if (country.IsSet && country.Value == null) - throw new ArgumentNullException(nameof(country), "Property is not nullable for class DeliveryAddress."); - - if (houseNumberOrName.IsSet && houseNumberOrName.Value == null) - throw new ArgumentNullException(nameof(houseNumberOrName), "Property is not nullable for class DeliveryAddress."); - - if (postalCode.IsSet && postalCode.Value == null) - throw new ArgumentNullException(nameof(postalCode), "Property is not nullable for class DeliveryAddress."); - - if (street.IsSet && street.Value == null) - throw new ArgumentNullException(nameof(street), "Property is not nullable for class DeliveryAddress."); - - if (firstName.IsSet && firstName.Value == null) - throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class DeliveryAddress."); - - if (lastName.IsSet && lastName.Value == null) - throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class DeliveryAddress."); - - if (stateOrProvince.IsSet && stateOrProvince.Value == null) - throw new ArgumentNullException(nameof(stateOrProvince), "Property is not nullable for class DeliveryAddress."); - - return new DeliveryAddress(city.Value, country.Value, houseNumberOrName.Value, postalCode.Value, street.Value, firstName, lastName, stateOrProvince); + return + ( + this.City == input.City || + (this.City != null && + this.City.Equals(input.City)) + ) && + ( + this.Country == input.Country || + (this.Country != null && + this.Country.Equals(input.Country)) + ) && + ( + this.FirstName == input.FirstName || + (this.FirstName != null && + this.FirstName.Equals(input.FirstName)) + ) && + ( + this.HouseNumberOrName == input.HouseNumberOrName || + (this.HouseNumberOrName != null && + this.HouseNumberOrName.Equals(input.HouseNumberOrName)) + ) && + ( + this.LastName == input.LastName || + (this.LastName != null && + this.LastName.Equals(input.LastName)) + ) && + ( + this.PostalCode == input.PostalCode || + (this.PostalCode != null && + this.PostalCode.Equals(input.PostalCode)) + ) && + ( + this.StateOrProvince == input.StateOrProvince || + (this.StateOrProvince != null && + this.StateOrProvince.Equals(input.StateOrProvince)) + ) && + ( + this.Street == input.Street || + (this.Street != null && + this.Street.Equals(input.Street)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DeliveryAddress deliveryAddress, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, deliveryAddress, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.City != null) + { + hashCode = (hashCode * 59) + this.City.GetHashCode(); + } + if (this.Country != null) + { + hashCode = (hashCode * 59) + this.Country.GetHashCode(); + } + if (this.FirstName != null) + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } + if (this.HouseNumberOrName != null) + { + hashCode = (hashCode * 59) + this.HouseNumberOrName.GetHashCode(); + } + if (this.LastName != null) + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } + if (this.PostalCode != null) + { + hashCode = (hashCode * 59) + this.PostalCode.GetHashCode(); + } + if (this.StateOrProvince != null) + { + hashCode = (hashCode * 59) + this.StateOrProvince.GetHashCode(); + } + if (this.Street != null) + { + hashCode = (hashCode * 59) + this.Street.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, DeliveryAddress deliveryAddress, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (deliveryAddress.City == null) - throw new ArgumentNullException(nameof(deliveryAddress.City), "Property is required for class DeliveryAddress."); - - if (deliveryAddress.Country == null) - throw new ArgumentNullException(nameof(deliveryAddress.Country), "Property is required for class DeliveryAddress."); - - if (deliveryAddress.HouseNumberOrName == null) - throw new ArgumentNullException(nameof(deliveryAddress.HouseNumberOrName), "Property is required for class DeliveryAddress."); - - if (deliveryAddress.PostalCode == null) - throw new ArgumentNullException(nameof(deliveryAddress.PostalCode), "Property is required for class DeliveryAddress."); - - if (deliveryAddress.Street == null) - throw new ArgumentNullException(nameof(deliveryAddress.Street), "Property is required for class DeliveryAddress."); - - if (deliveryAddress.FirstNameOption.IsSet && deliveryAddress.FirstName == null) - throw new ArgumentNullException(nameof(deliveryAddress.FirstName), "Property is required for class DeliveryAddress."); - - if (deliveryAddress.LastNameOption.IsSet && deliveryAddress.LastName == null) - throw new ArgumentNullException(nameof(deliveryAddress.LastName), "Property is required for class DeliveryAddress."); - - if (deliveryAddress.StateOrProvinceOption.IsSet && deliveryAddress.StateOrProvince == null) - throw new ArgumentNullException(nameof(deliveryAddress.StateOrProvince), "Property is required for class DeliveryAddress."); - - writer.WriteString("city", deliveryAddress.City); - - writer.WriteString("country", deliveryAddress.Country); - - writer.WriteString("houseNumberOrName", deliveryAddress.HouseNumberOrName); - - writer.WriteString("postalCode", deliveryAddress.PostalCode); + // City (string) maxLength + if (this.City != null && this.City.Length > 3000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for City, length must be less than 3000.", new [] { "City" }); + } - writer.WriteString("street", deliveryAddress.Street); + // HouseNumberOrName (string) maxLength + if (this.HouseNumberOrName != null && this.HouseNumberOrName.Length > 3000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for HouseNumberOrName, length must be less than 3000.", new [] { "HouseNumberOrName" }); + } - if (deliveryAddress.FirstNameOption.IsSet) - writer.WriteString("firstName", deliveryAddress.FirstName); + // StateOrProvince (string) maxLength + if (this.StateOrProvince != null && this.StateOrProvince.Length > 1000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StateOrProvince, length must be less than 1000.", new [] { "StateOrProvince" }); + } - if (deliveryAddress.LastNameOption.IsSet) - writer.WriteString("lastName", deliveryAddress.LastName); + // Street (string) maxLength + if (this.Street != null && this.Street.Length > 3000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Street, length must be less than 3000.", new [] { "Street" }); + } - if (deliveryAddress.StateOrProvinceOption.IsSet) - writer.WriteString("stateOrProvince", deliveryAddress.StateOrProvince); + yield break; } } + } diff --git a/Adyen/Model/Checkout/DeliveryMethod.cs b/Adyen/Model/Checkout/DeliveryMethod.cs index 16e596d61..7b1b8867a 100644 --- a/Adyen/Model/Checkout/DeliveryMethod.cs +++ b/Adyen/Model/Checkout/DeliveryMethod.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,162 +15,88 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// DeliveryMethod /// - public partial class DeliveryMethod : IValidatableObject + [DataContract(Name = "DeliveryMethod")] + public partial class DeliveryMethod : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The name of the delivery method as shown to the shopper. - /// The reference of the delivery method. - /// If you display the PayPal lightbox with delivery methods, set to **true** for the delivery method that is selected. Only one delivery method can be selected at a time. - /// The type of the delivery method. - [JsonConstructor] - public DeliveryMethod(Option amount = default, Option description = default, Option reference = default, Option selected = default, Option type = default) - { - AmountOption = amount; - DescriptionOption = description; - ReferenceOption = reference; - SelectedOption = selected; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The type of the delivery method. /// /// The type of the delivery method. + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Shipping for value: Shipping /// + [EnumMember(Value = "Shipping")] Shipping = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("Shipping")) - return TypeEnum.Shipping; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("Shipping")) - return TypeEnum.Shipping; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Shipping) - return "Shipping"; - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// The type of the delivery method. /// /// The type of the delivery method. - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of Amount + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountOption { get; private set; } + /// amount. + /// The name of the delivery method as shown to the shopper.. + /// The reference of the delivery method.. + /// If you display the PayPal lightbox with delivery methods, set to **true** for the delivery method that is selected. Only one delivery method can be selected at a time.. + /// The type of the delivery method.. + public DeliveryMethod(Amount amount = default(Amount), string description = default(string), string reference = default(string), bool? selected = default(bool?), TypeEnum? type = default(TypeEnum?)) + { + this.Amount = amount; + this.Description = description; + this.Reference = reference; + this.Selected = selected; + this.Type = type; + } /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] - public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } - - /// - /// Used to track the state of Description - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DescriptionOption { get; private set; } + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// The name of the delivery method as shown to the shopper. /// /// The name of the delivery method as shown to the shopper. - [JsonPropertyName("description")] - public string Description { get { return this.DescriptionOption; } set { this.DescriptionOption = new Option(value); } } - - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } /// /// The reference of the delivery method. /// /// The reference of the delivery method. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Selected - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SelectedOption { get; private set; } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// If you display the PayPal lightbox with delivery methods, set to **true** for the delivery method that is selected. Only one delivery method can be selected at a time. /// /// If you display the PayPal lightbox with delivery methods, set to **true** for the delivery method that is selected. Only one delivery method can be selected at a time. - [JsonPropertyName("selected")] - public bool? Selected { get { return this.SelectedOption; } set { this.SelectedOption = new Option(value); } } + [DataMember(Name = "selected", EmitDefaultValue = false)] + public bool? Selected { get; set; } /// /// Returns the string presentation of the object @@ -189,151 +116,96 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class DeliveryMethodJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override DeliveryMethod Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option description = default; - Option reference = default; - Option selected = default; - Option type = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "description": - description = new Option(utf8JsonReader.GetString()); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "selected": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - selected = new Option(utf8JsonReader.GetBoolean()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(DeliveryMethod.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } - } - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class DeliveryMethod."); - - if (description.IsSet && description.Value == null) - throw new ArgumentNullException(nameof(description), "Property is not nullable for class DeliveryMethod."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class DeliveryMethod."); - - if (selected.IsSet && selected.Value == null) - throw new ArgumentNullException(nameof(selected), "Property is not nullable for class DeliveryMethod."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class DeliveryMethod."); - - return new DeliveryMethod(amount, description, reference, selected, type); + return this.Equals(input as DeliveryMethod); } /// - /// Serializes a + /// Returns true if DeliveryMethod instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DeliveryMethod deliveryMethod, JsonSerializerOptions jsonSerializerOptions) + /// Instance of DeliveryMethod to be compared + /// Boolean + public bool Equals(DeliveryMethod input) { - writer.WriteStartObject(); - - WriteProperties(writer, deliveryMethod, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.Description == input.Description || + (this.Description != null && + this.Description.Equals(input.Description)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Selected == input.Selected || + this.Selected.Equals(input.Selected) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, DeliveryMethod deliveryMethod, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (deliveryMethod.AmountOption.IsSet && deliveryMethod.Amount == null) - throw new ArgumentNullException(nameof(deliveryMethod.Amount), "Property is required for class DeliveryMethod."); - - if (deliveryMethod.DescriptionOption.IsSet && deliveryMethod.Description == null) - throw new ArgumentNullException(nameof(deliveryMethod.Description), "Property is required for class DeliveryMethod."); - - if (deliveryMethod.ReferenceOption.IsSet && deliveryMethod.Reference == null) - throw new ArgumentNullException(nameof(deliveryMethod.Reference), "Property is required for class DeliveryMethod."); - - if (deliveryMethod.AmountOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, deliveryMethod.Amount, jsonSerializerOptions); + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.Description != null) + { + hashCode = (hashCode * 59) + this.Description.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Selected.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; } - if (deliveryMethod.DescriptionOption.IsSet) - writer.WriteString("description", deliveryMethod.Description); - - if (deliveryMethod.ReferenceOption.IsSet) - writer.WriteString("reference", deliveryMethod.Reference); - - if (deliveryMethod.SelectedOption.IsSet) - writer.WriteBoolean("selected", deliveryMethod.SelectedOption.Value.Value); - - var typeRawValue = DeliveryMethod.TypeEnumToJsonValue(deliveryMethod.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs b/Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs index b36beaeb8..ee3580d0d 100644 --- a/Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs +++ b/Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,46 +15,38 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// DetailsRequestAuthenticationData /// - public partial class DetailsRequestAuthenticationData : IValidatableObject + [DataContract(Name = "DetailsRequestAuthenticationData")] + public partial class DetailsRequestAuthenticationData : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: *false**. (default to false) - [JsonConstructor] - public DetailsRequestAuthenticationData(Option authenticationOnly = default) + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. (default to false). + public DetailsRequestAuthenticationData(bool? authenticationOnly = false) { - AuthenticationOnlyOption = authenticationOnly; - OnCreated(); + this.AuthenticationOnly = authenticationOnly; } - partial void OnCreated(); - /// - /// Used to track the state of AuthenticationOnly + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthenticationOnlyOption { get; private set; } - - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: *false**. - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: *false**. - [JsonPropertyName("authenticationOnly")] - public bool? AuthenticationOnly { get { return this.AuthenticationOnlyOption; } set { this.AuthenticationOnlyOption = new Option(value); } } + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. + [DataMember(Name = "authenticationOnly", EmitDefaultValue = false)] + public bool? AuthenticationOnly { get; set; } /// /// Returns the string presentation of the object @@ -69,97 +62,64 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class DetailsRequestAuthenticationDataJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override DetailsRequestAuthenticationData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option authenticationOnly = default; + return this.Equals(input as DetailsRequestAuthenticationData); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if DetailsRequestAuthenticationData instances are equal + /// + /// Instance of DetailsRequestAuthenticationData to be compared + /// Boolean + public bool Equals(DetailsRequestAuthenticationData input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "authenticationOnly": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - authenticationOnly = new Option(utf8JsonReader.GetBoolean()); - break; - default: - break; - } - } + return false; } - - if (authenticationOnly.IsSet && authenticationOnly.Value == null) - throw new ArgumentNullException(nameof(authenticationOnly), "Property is not nullable for class DetailsRequestAuthenticationData."); - - return new DetailsRequestAuthenticationData(authenticationOnly); + return + ( + this.AuthenticationOnly == input.AuthenticationOnly || + this.AuthenticationOnly.Equals(input.AuthenticationOnly) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DetailsRequestAuthenticationData detailsRequestAuthenticationData, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, detailsRequestAuthenticationData, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.AuthenticationOnly.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, DetailsRequestAuthenticationData detailsRequestAuthenticationData, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (detailsRequestAuthenticationData.AuthenticationOnlyOption.IsSet) - writer.WriteBoolean("authenticationOnly", detailsRequestAuthenticationData.AuthenticationOnlyOption.Value.Value); + yield break; } } + } diff --git a/Adyen/Model/Checkout/DeviceRenderOptions.cs b/Adyen/Model/Checkout/DeviceRenderOptions.cs index c7de50d45..a74655b04 100644 --- a/Adyen/Model/Checkout/DeviceRenderOptions.cs +++ b/Adyen/Model/Checkout/DeviceRenderOptions.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,252 +15,114 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// DeviceRenderOptions /// - public partial class DeviceRenderOptions : IValidatableObject + [DataContract(Name = "DeviceRenderOptions")] + public partial class DeviceRenderOptions : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Supported SDK interface types. Allowed values: * native * html * both (default to SdkInterfaceEnum.Both) - /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect - [JsonConstructor] - public DeviceRenderOptions(Option sdkInterface = default, Option> sdkUiType = default) - { - SdkInterfaceOption = sdkInterface; - SdkUiTypeOption = sdkUiType; - OnCreated(); - } - - partial void OnCreated(); - /// /// Supported SDK interface types. Allowed values: * native * html * both /// /// Supported SDK interface types. Allowed values: * native * html * both + [JsonConverter(typeof(StringEnumConverter))] public enum SdkInterfaceEnum { /// /// Enum Native for value: native /// + [EnumMember(Value = "native")] Native = 1, /// /// Enum Html for value: html /// + [EnumMember(Value = "html")] Html = 2, /// /// Enum Both for value: both /// + [EnumMember(Value = "both")] Both = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static SdkInterfaceEnum SdkInterfaceEnumFromString(string value) - { - if (value.Equals("native")) - return SdkInterfaceEnum.Native; - - if (value.Equals("html")) - return SdkInterfaceEnum.Html; - - if (value.Equals("both")) - return SdkInterfaceEnum.Both; - - throw new NotImplementedException($"Could not convert value to type SdkInterfaceEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static SdkInterfaceEnum? SdkInterfaceEnumFromStringOrDefault(string value) - { - if (value.Equals("native")) - return SdkInterfaceEnum.Native; - - if (value.Equals("html")) - return SdkInterfaceEnum.Html; - - if (value.Equals("both")) - return SdkInterfaceEnum.Both; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string SdkInterfaceEnumToJsonValue(SdkInterfaceEnum? value) - { - if (value == SdkInterfaceEnum.Native) - return "native"; - - if (value == SdkInterfaceEnum.Html) - return "html"; - if (value == SdkInterfaceEnum.Both) - return "both"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of SdkInterface - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkInterfaceOption { get; private set; } /// /// Supported SDK interface types. Allowed values: * native * html * both /// /// Supported SDK interface types. Allowed values: * native * html * both - [JsonPropertyName("sdkInterface")] - public SdkInterfaceEnum? SdkInterface { get { return this.SdkInterfaceOption; } set { this.SdkInterfaceOption = new Option(value); } } - + [DataMember(Name = "sdkInterface", EmitDefaultValue = false)] + public SdkInterfaceEnum? SdkInterface { get; set; } /// /// Defines SdkUiType /// + [JsonConverter(typeof(StringEnumConverter))] public enum SdkUiTypeEnum { /// /// Enum MultiSelect for value: multiSelect /// + [EnumMember(Value = "multiSelect")] MultiSelect = 1, /// /// Enum OtherHtml for value: otherHtml /// + [EnumMember(Value = "otherHtml")] OtherHtml = 2, /// /// Enum OutOfBand for value: outOfBand /// + [EnumMember(Value = "outOfBand")] OutOfBand = 3, /// /// Enum SingleSelect for value: singleSelect /// + [EnumMember(Value = "singleSelect")] SingleSelect = 4, /// /// Enum Text for value: text /// + [EnumMember(Value = "text")] Text = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static SdkUiTypeEnum SdkUiTypeEnumFromString(string value) - { - if (value.Equals("multiSelect")) - return SdkUiTypeEnum.MultiSelect; - if (value.Equals("otherHtml")) - return SdkUiTypeEnum.OtherHtml; - - if (value.Equals("outOfBand")) - return SdkUiTypeEnum.OutOfBand; - - if (value.Equals("singleSelect")) - return SdkUiTypeEnum.SingleSelect; + } - if (value.Equals("text")) - return SdkUiTypeEnum.Text; - throw new NotImplementedException($"Could not convert value to type SdkUiTypeEnum: '{value}'"); - } /// - /// Returns a + /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect /// - /// - /// - public static SdkUiTypeEnum? SdkUiTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("multiSelect")) - return SdkUiTypeEnum.MultiSelect; - - if (value.Equals("otherHtml")) - return SdkUiTypeEnum.OtherHtml; - - if (value.Equals("outOfBand")) - return SdkUiTypeEnum.OutOfBand; - - if (value.Equals("singleSelect")) - return SdkUiTypeEnum.SingleSelect; - - if (value.Equals("text")) - return SdkUiTypeEnum.Text; - - return null; - } - + /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect + [DataMember(Name = "sdkUiType", EmitDefaultValue = false)] + public List SdkUiType { get; set; } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string SdkUiTypeEnumToJsonValue(SdkUiTypeEnum value) + /// Supported SDK interface types. Allowed values: * native * html * both (default to SdkInterfaceEnum.Both). + /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect. + public DeviceRenderOptions(SdkInterfaceEnum? sdkInterface = SdkInterfaceEnum.Both, List sdkUiType = default(List)) { - if (value == SdkUiTypeEnum.MultiSelect) - return "multiSelect"; - - if (value == SdkUiTypeEnum.OtherHtml) - return "otherHtml"; - - if (value == SdkUiTypeEnum.OutOfBand) - return "outOfBand"; - - if (value == SdkUiTypeEnum.SingleSelect) - return "singleSelect"; - - if (value == SdkUiTypeEnum.Text) - return "text"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.SdkInterface = sdkInterface; + this.SdkUiType = sdkUiType; } - /// - /// Used to track the state of SdkUiType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SdkUiTypeOption { get; private set; } - - /// - /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect - /// - /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect - [JsonPropertyName("sdkUiType")] - public List SdkUiType { get { return this.SdkUiTypeOption; } set { this.SdkUiTypeOption = new Option>(value); } } - /// /// Returns the string presentation of the object /// @@ -275,114 +138,69 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class DeviceRenderOptionsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override DeviceRenderOptions Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option sdkInterface = default; - Option> sdkUiType = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "sdkInterface": - string sdkInterfaceRawValue = utf8JsonReader.GetString(); - if (sdkInterfaceRawValue != null) - sdkInterface = new Option(DeviceRenderOptions.SdkInterfaceEnumFromStringOrDefault(sdkInterfaceRawValue)); - break; - case "sdkUiType": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sdkUiType = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (sdkInterface.IsSet && sdkInterface.Value == null) - throw new ArgumentNullException(nameof(sdkInterface), "Property is not nullable for class DeviceRenderOptions."); - - if (sdkUiType.IsSet && sdkUiType.Value == null) - throw new ArgumentNullException(nameof(sdkUiType), "Property is not nullable for class DeviceRenderOptions."); - - return new DeviceRenderOptions(sdkInterface, sdkUiType); + return this.Equals(input as DeviceRenderOptions); } /// - /// Serializes a + /// Returns true if DeviceRenderOptions instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DeviceRenderOptions deviceRenderOptions, JsonSerializerOptions jsonSerializerOptions) + /// Instance of DeviceRenderOptions to be compared + /// Boolean + public bool Equals(DeviceRenderOptions input) { - writer.WriteStartObject(); - - WriteProperties(writer, deviceRenderOptions, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.SdkInterface == input.SdkInterface || + this.SdkInterface.Equals(input.SdkInterface) + ) && + ( + this.SdkUiType == input.SdkUiType || + this.SdkUiType.SequenceEqual(input.SdkUiType) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, DeviceRenderOptions deviceRenderOptions, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (deviceRenderOptions.SdkUiTypeOption.IsSet && deviceRenderOptions.SdkUiType == null) - throw new ArgumentNullException(nameof(deviceRenderOptions.SdkUiType), "Property is required for class DeviceRenderOptions."); - - var sdkInterfaceRawValue = DeviceRenderOptions.SdkInterfaceEnumToJsonValue(deviceRenderOptions.SdkInterfaceOption.Value.Value); - writer.WriteString("sdkInterface", sdkInterfaceRawValue); - if (deviceRenderOptions.SdkUiTypeOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("sdkUiType"); - JsonSerializer.Serialize(writer, deviceRenderOptions.SdkUiType, jsonSerializerOptions); + int hashCode = 41; + hashCode = (hashCode * 59) + this.SdkInterface.GetHashCode(); + hashCode = (hashCode * 59) + this.SdkUiType.GetHashCode(); + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/DokuDetails.cs b/Adyen/Model/Checkout/DokuDetails.cs index 57b89db69..b35178f38 100644 --- a/Adyen/Model/Checkout/DokuDetails.cs +++ b/Adyen/Model/Checkout/DokuDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,276 +15,155 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// DokuDetails /// - public partial class DokuDetails : IValidatableObject + [DataContract(Name = "DokuDetails")] + public partial class DokuDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The shopper's first name. - /// The shopper's last name. - /// The shopper's email. - /// **doku** - /// The checkout attempt identifier. - [JsonConstructor] - public DokuDetails(string firstName, string lastName, string shopperEmail, TypeEnum type, Option checkoutAttemptId = default) - { - FirstName = firstName; - LastName = lastName; - ShopperEmail = shopperEmail; - Type = type; - CheckoutAttemptIdOption = checkoutAttemptId; - OnCreated(); - } - - partial void OnCreated(); - /// /// **doku** /// /// **doku** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// - /// Enum DokuMandiriVa for value: doku_mandiri_va + /// Enum MandiriVa for value: doku_mandiri_va /// - DokuMandiriVa = 1, + [EnumMember(Value = "doku_mandiri_va")] + MandiriVa = 1, /// - /// Enum DokuCimbVa for value: doku_cimb_va + /// Enum CimbVa for value: doku_cimb_va /// - DokuCimbVa = 2, + [EnumMember(Value = "doku_cimb_va")] + CimbVa = 2, /// - /// Enum DokuDanamonVa for value: doku_danamon_va + /// Enum DanamonVa for value: doku_danamon_va /// - DokuDanamonVa = 3, + [EnumMember(Value = "doku_danamon_va")] + DanamonVa = 3, /// - /// Enum DokuBniVa for value: doku_bni_va + /// Enum BniVa for value: doku_bni_va /// - DokuBniVa = 4, + [EnumMember(Value = "doku_bni_va")] + BniVa = 4, /// - /// Enum DokuPermataLiteAtm for value: doku_permata_lite_atm + /// Enum PermataLiteAtm for value: doku_permata_lite_atm /// - DokuPermataLiteAtm = 5, + [EnumMember(Value = "doku_permata_lite_atm")] + PermataLiteAtm = 5, /// - /// Enum DokuBriVa for value: doku_bri_va + /// Enum BriVa for value: doku_bri_va /// - DokuBriVa = 6, + [EnumMember(Value = "doku_bri_va")] + BriVa = 6, /// - /// Enum DokuBcaVa for value: doku_bca_va + /// Enum BcaVa for value: doku_bca_va /// - DokuBcaVa = 7, + [EnumMember(Value = "doku_bca_va")] + BcaVa = 7, /// - /// Enum DokuAlfamart for value: doku_alfamart + /// Enum Alfamart for value: doku_alfamart /// - DokuAlfamart = 8, + [EnumMember(Value = "doku_alfamart")] + Alfamart = 8, /// - /// Enum DokuIndomaret for value: doku_indomaret + /// Enum Indomaret for value: doku_indomaret /// - DokuIndomaret = 9, + [EnumMember(Value = "doku_indomaret")] + Indomaret = 9, /// - /// Enum DokuWallet for value: doku_wallet + /// Enum Wallet for value: doku_wallet /// - DokuWallet = 10, + [EnumMember(Value = "doku_wallet")] + Wallet = 10, /// - /// Enum DokuOvo for value: doku_ovo + /// Enum Ovo for value: doku_ovo /// - DokuOvo = 11 + [EnumMember(Value = "doku_ovo")] + Ovo = 11 + } + /// - /// Returns a + /// **doku** /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("doku_mandiri_va")) - return TypeEnum.DokuMandiriVa; - - if (value.Equals("doku_cimb_va")) - return TypeEnum.DokuCimbVa; - - if (value.Equals("doku_danamon_va")) - return TypeEnum.DokuDanamonVa; - - if (value.Equals("doku_bni_va")) - return TypeEnum.DokuBniVa; - - if (value.Equals("doku_permata_lite_atm")) - return TypeEnum.DokuPermataLiteAtm; - - if (value.Equals("doku_bri_va")) - return TypeEnum.DokuBriVa; - - if (value.Equals("doku_bca_va")) - return TypeEnum.DokuBcaVa; - - if (value.Equals("doku_alfamart")) - return TypeEnum.DokuAlfamart; - - if (value.Equals("doku_indomaret")) - return TypeEnum.DokuIndomaret; - - if (value.Equals("doku_wallet")) - return TypeEnum.DokuWallet; - - if (value.Equals("doku_ovo")) - return TypeEnum.DokuOvo; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - + /// **doku** + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + public TypeEnum Type { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("doku_mandiri_va")) - return TypeEnum.DokuMandiriVa; - - if (value.Equals("doku_cimb_va")) - return TypeEnum.DokuCimbVa; - - if (value.Equals("doku_danamon_va")) - return TypeEnum.DokuDanamonVa; - - if (value.Equals("doku_bni_va")) - return TypeEnum.DokuBniVa; - - if (value.Equals("doku_permata_lite_atm")) - return TypeEnum.DokuPermataLiteAtm; - - if (value.Equals("doku_bri_va")) - return TypeEnum.DokuBriVa; - - if (value.Equals("doku_bca_va")) - return TypeEnum.DokuBcaVa; - - if (value.Equals("doku_alfamart")) - return TypeEnum.DokuAlfamart; - - if (value.Equals("doku_indomaret")) - return TypeEnum.DokuIndomaret; - - if (value.Equals("doku_wallet")) - return TypeEnum.DokuWallet; - - if (value.Equals("doku_ovo")) - return TypeEnum.DokuOvo; - - return null; - } - + [JsonConstructorAttribute] + protected DokuDetails() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) + /// The checkout attempt identifier.. + /// The shopper's first name. (required). + /// The shopper's last name. (required). + /// The shopper's email. (required). + /// **doku** (required). + public DokuDetails(string checkoutAttemptId = default(string), string firstName = default(string), string lastName = default(string), string shopperEmail = default(string), TypeEnum type = default(TypeEnum)) { - if (value == TypeEnum.DokuMandiriVa) - return "doku_mandiri_va"; - - if (value == TypeEnum.DokuCimbVa) - return "doku_cimb_va"; - - if (value == TypeEnum.DokuDanamonVa) - return "doku_danamon_va"; - - if (value == TypeEnum.DokuBniVa) - return "doku_bni_va"; - - if (value == TypeEnum.DokuPermataLiteAtm) - return "doku_permata_lite_atm"; - - if (value == TypeEnum.DokuBriVa) - return "doku_bri_va"; - - if (value == TypeEnum.DokuBcaVa) - return "doku_bca_va"; - - if (value == TypeEnum.DokuAlfamart) - return "doku_alfamart"; - - if (value == TypeEnum.DokuIndomaret) - return "doku_indomaret"; - - if (value == TypeEnum.DokuWallet) - return "doku_wallet"; - - if (value == TypeEnum.DokuOvo) - return "doku_ovo"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.FirstName = firstName; + this.LastName = lastName; + this.ShopperEmail = shopperEmail; + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; } /// - /// **doku** + /// The checkout attempt identifier. /// - /// **doku** - [JsonPropertyName("type")] - public TypeEnum Type { get; set; } + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The shopper's first name. /// /// The shopper's first name. - [JsonPropertyName("firstName")] + [DataMember(Name = "firstName", IsRequired = false, EmitDefaultValue = false)] public string FirstName { get; set; } /// /// The shopper's last name. /// /// The shopper's last name. - [JsonPropertyName("lastName")] + [DataMember(Name = "lastName", IsRequired = false, EmitDefaultValue = false)] public string LastName { get; set; } /// /// The shopper's email. /// /// The shopper's email. - [JsonPropertyName("shopperEmail")] + [DataMember(Name = "shopperEmail", IsRequired = false, EmitDefaultValue = false)] public string ShopperEmail { get; set; } - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - - /// - /// The checkout attempt identifier. - /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - /// /// Returns the string presentation of the object /// @@ -292,168 +172,110 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class DokuDetails {\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FirstName: ").Append(FirstName).Append("\n"); sb.Append(" LastName: ").Append(LastName).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class DokuDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override DokuDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option firstName = default; - Option lastName = default; - Option shopperEmail = default; - Option type = default; - Option checkoutAttemptId = default; + return this.Equals(input as DokuDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if DokuDetails instances are equal + /// + /// Instance of DokuDetails to be compared + /// Boolean + public bool Equals(DokuDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "firstName": - firstName = new Option(utf8JsonReader.GetString()); - break; - case "lastName": - lastName = new Option(utf8JsonReader.GetString()); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(DokuDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!firstName.IsSet) - throw new ArgumentException("Property is required for class DokuDetails.", nameof(firstName)); - - if (!lastName.IsSet) - throw new ArgumentException("Property is required for class DokuDetails.", nameof(lastName)); - - if (!shopperEmail.IsSet) - throw new ArgumentException("Property is required for class DokuDetails.", nameof(shopperEmail)); - - if (!type.IsSet) - throw new ArgumentException("Property is required for class DokuDetails.", nameof(type)); - - if (firstName.IsSet && firstName.Value == null) - throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class DokuDetails."); - - if (lastName.IsSet && lastName.Value == null) - throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class DokuDetails."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class DokuDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class DokuDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class DokuDetails."); - - return new DokuDetails(firstName.Value, lastName.Value, shopperEmail.Value, type.Value.Value, checkoutAttemptId); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.FirstName == input.FirstName || + (this.FirstName != null && + this.FirstName.Equals(input.FirstName)) + ) && + ( + this.LastName == input.LastName || + (this.LastName != null && + this.LastName.Equals(input.LastName)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DokuDetails dokuDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, dokuDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.FirstName != null) + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } + if (this.LastName != null) + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, DokuDetails dokuDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (dokuDetails.FirstName == null) - throw new ArgumentNullException(nameof(dokuDetails.FirstName), "Property is required for class DokuDetails."); - - if (dokuDetails.LastName == null) - throw new ArgumentNullException(nameof(dokuDetails.LastName), "Property is required for class DokuDetails."); - - if (dokuDetails.ShopperEmail == null) - throw new ArgumentNullException(nameof(dokuDetails.ShopperEmail), "Property is required for class DokuDetails."); - - if (dokuDetails.CheckoutAttemptIdOption.IsSet && dokuDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(dokuDetails.CheckoutAttemptId), "Property is required for class DokuDetails."); - - writer.WriteString("firstName", dokuDetails.FirstName); - - writer.WriteString("lastName", dokuDetails.LastName); - - writer.WriteString("shopperEmail", dokuDetails.ShopperEmail); - - var typeRawValue = DokuDetails.TypeEnumToJsonValue(dokuDetails.Type); - writer.WriteString("type", typeRawValue); - if (dokuDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", dokuDetails.CheckoutAttemptId); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Donation.cs b/Adyen/Model/Checkout/Donation.cs index 0917993bb..5f360c5ed 100644 --- a/Adyen/Model/Checkout/Donation.cs +++ b/Adyen/Model/Checkout/Donation.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,89 +15,79 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Donation /// - public partial class Donation : IValidatableObject + [DataContract(Name = "Donation")] + public partial class Donation : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). - /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donations amounts that the shopper can select from. - /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donation amounts that the shopper can select from. - /// The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**. - /// The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units). This field is only present when `donationType` is **fixedAmounts**. - [JsonConstructor] - public Donation(string currency, string donationType, string type, Option maxRoundupAmount = default, Option> values = default) + [JsonConstructorAttribute] + protected Donation() { } + /// + /// Initializes a new instance of the class. + /// + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). (required). + /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donations amounts that the shopper can select from. (required). + /// The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**.. + /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donation amounts that the shopper can select from. (required). + /// The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units). This field is only present when `donationType` is **fixedAmounts**.. + public Donation(string currency = default(string), string donationType = default(string), long? maxRoundupAmount = default(long?), string type = default(string), List values = default(List)) { - Currency = currency; - DonationType = donationType; - Type = type; - MaxRoundupAmountOption = maxRoundupAmount; - ValuesOption = values; - OnCreated(); + this.Currency = currency; + this.DonationType = donationType; + this.Type = type; + this.MaxRoundupAmount = maxRoundupAmount; + this.Values = values; } - partial void OnCreated(); - /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). - [JsonPropertyName("currency")] + [DataMember(Name = "currency", IsRequired = false, EmitDefaultValue = false)] public string Currency { get; set; } /// /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donations amounts that the shopper can select from. /// /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donations amounts that the shopper can select from. - [JsonPropertyName("donationType")] + [DataMember(Name = "donationType", IsRequired = false, EmitDefaultValue = false)] public string DonationType { get; set; } - /// - /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donation amounts that the shopper can select from. - /// - /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donation amounts that the shopper can select from. - [JsonPropertyName("type")] - public string Type { get; set; } - - /// - /// Used to track the state of MaxRoundupAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MaxRoundupAmountOption { get; private set; } - /// /// The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**. /// /// The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**. - [JsonPropertyName("maxRoundupAmount")] - public long? MaxRoundupAmount { get { return this.MaxRoundupAmountOption; } set { this.MaxRoundupAmountOption = new Option(value); } } + [DataMember(Name = "maxRoundupAmount", EmitDefaultValue = false)] + public long? MaxRoundupAmount { get; set; } /// - /// Used to track the state of Values + /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donation amounts that the shopper can select from. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> ValuesOption { get; private set; } + /// The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donation amounts that the shopper can select from. + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + public string Type { get; set; } /// /// The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units). This field is only present when `donationType` is **fixedAmounts**. /// /// The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units). This field is only present when `donationType` is **fixedAmounts**. - [JsonPropertyName("values")] - public List Values { get { return this.ValuesOption; } set { this.ValuesOption = new Option>(value); } } + [DataMember(Name = "values", EmitDefaultValue = false)] + public List Values { get; set; } /// /// Returns the string presentation of the object @@ -108,167 +99,109 @@ public override string ToString() sb.Append("class Donation {\n"); sb.Append(" Currency: ").Append(Currency).Append("\n"); sb.Append(" DonationType: ").Append(DonationType).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" MaxRoundupAmount: ").Append(MaxRoundupAmount).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Values: ").Append(Values).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class DonationJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Donation Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option currency = default; - Option donationType = default; - Option type = default; - Option maxRoundupAmount = default; - Option> values = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "currency": - currency = new Option(utf8JsonReader.GetString()); - break; - case "donationType": - donationType = new Option(utf8JsonReader.GetString()); - break; - case "type": - type = new Option(utf8JsonReader.GetString()); - break; - case "maxRoundupAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - maxRoundupAmount = new Option(utf8JsonReader.GetInt64()); - break; - case "values": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - values = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (!currency.IsSet) - throw new ArgumentException("Property is required for class Donation.", nameof(currency)); - - if (!donationType.IsSet) - throw new ArgumentException("Property is required for class Donation.", nameof(donationType)); - - if (!type.IsSet) - throw new ArgumentException("Property is required for class Donation.", nameof(type)); - - if (currency.IsSet && currency.Value == null) - throw new ArgumentNullException(nameof(currency), "Property is not nullable for class Donation."); - - if (donationType.IsSet && donationType.Value == null) - throw new ArgumentNullException(nameof(donationType), "Property is not nullable for class Donation."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class Donation."); - - if (maxRoundupAmount.IsSet && maxRoundupAmount.Value == null) - throw new ArgumentNullException(nameof(maxRoundupAmount), "Property is not nullable for class Donation."); - - if (values.IsSet && values.Value == null) - throw new ArgumentNullException(nameof(values), "Property is not nullable for class Donation."); - - return new Donation(currency.Value, donationType.Value, type.Value, maxRoundupAmount, values); + return this.Equals(input as Donation); } /// - /// Serializes a + /// Returns true if Donation instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Donation donation, JsonSerializerOptions jsonSerializerOptions) + /// Instance of Donation to be compared + /// Boolean + public bool Equals(Donation input) { - writer.WriteStartObject(); - - WriteProperties(writer, donation, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Currency == input.Currency || + (this.Currency != null && + this.Currency.Equals(input.Currency)) + ) && + ( + this.DonationType == input.DonationType || + (this.DonationType != null && + this.DonationType.Equals(input.DonationType)) + ) && + ( + this.MaxRoundupAmount == input.MaxRoundupAmount || + this.MaxRoundupAmount.Equals(input.MaxRoundupAmount) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ) && + ( + this.Values == input.Values || + this.Values != null && + input.Values != null && + this.Values.SequenceEqual(input.Values) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Donation donation, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (donation.Currency == null) - throw new ArgumentNullException(nameof(donation.Currency), "Property is required for class Donation."); - - if (donation.DonationType == null) - throw new ArgumentNullException(nameof(donation.DonationType), "Property is required for class Donation."); - - if (donation.Type == null) - throw new ArgumentNullException(nameof(donation.Type), "Property is required for class Donation."); - - if (donation.ValuesOption.IsSet && donation.Values == null) - throw new ArgumentNullException(nameof(donation.Values), "Property is required for class Donation."); - - writer.WriteString("currency", donation.Currency); - - writer.WriteString("donationType", donation.DonationType); - - writer.WriteString("type", donation.Type); - - if (donation.MaxRoundupAmountOption.IsSet) - writer.WriteNumber("maxRoundupAmount", donation.MaxRoundupAmountOption.Value.Value); - - if (donation.ValuesOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("values"); - JsonSerializer.Serialize(writer, donation.Values, jsonSerializerOptions); + int hashCode = 41; + if (this.Currency != null) + { + hashCode = (hashCode * 59) + this.Currency.GetHashCode(); + } + if (this.DonationType != null) + { + hashCode = (hashCode * 59) + this.DonationType.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MaxRoundupAmount.GetHashCode(); + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + if (this.Values != null) + { + hashCode = (hashCode * 59) + this.Values.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/DonationCampaign.cs b/Adyen/Model/Checkout/DonationCampaign.cs index 6e4a0500f..86c7db288 100644 --- a/Adyen/Model/Checkout/DonationCampaign.cs +++ b/Adyen/Model/Checkout/DonationCampaign.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,204 +15,126 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// DonationCampaign /// - public partial class DonationCampaign : IValidatableObject + [DataContract(Name = "DonationCampaign")] + public partial class DonationCampaign : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// amounts - /// The URL for the banner of the nonprofit or campaign. - /// The name of the donation campaign.. - /// The cause of the nonprofit. - /// donation - /// The unique campaign ID of the donation campaign. - /// The URL for the logo of the nonprofit. - /// The description of the nonprofit. - /// The name of the nonprofit organization that receives the donation. - /// The website URL of the nonprofit. - /// The URL of the terms and conditions page of the nonprofit and the campaign. - [JsonConstructor] - public DonationCampaign(Option amounts = default, Option bannerUrl = default, Option campaignName = default, Option causeName = default, Option donation = default, Option id = default, Option logoUrl = default, Option nonprofitDescription = default, Option nonprofitName = default, Option nonprofitUrl = default, Option termsAndConditionsUrl = default) + /// amounts. + /// The URL for the banner of the nonprofit or campaign.. + /// The name of the donation campaign... + /// The cause of the nonprofit.. + /// donation. + /// The unique campaign ID of the donation campaign.. + /// The URL for the logo of the nonprofit.. + /// The description of the nonprofit.. + /// The name of the nonprofit organization that receives the donation.. + /// The website URL of the nonprofit.. + /// The URL of the terms and conditions page of the nonprofit and the campaign.. + public DonationCampaign(Amounts amounts = default(Amounts), string bannerUrl = default(string), string campaignName = default(string), string causeName = default(string), Donation donation = default(Donation), string id = default(string), string logoUrl = default(string), string nonprofitDescription = default(string), string nonprofitName = default(string), string nonprofitUrl = default(string), string termsAndConditionsUrl = default(string)) { - AmountsOption = amounts; - BannerUrlOption = bannerUrl; - CampaignNameOption = campaignName; - CauseNameOption = causeName; - DonationOption = donation; - IdOption = id; - LogoUrlOption = logoUrl; - NonprofitDescriptionOption = nonprofitDescription; - NonprofitNameOption = nonprofitName; - NonprofitUrlOption = nonprofitUrl; - TermsAndConditionsUrlOption = termsAndConditionsUrl; - OnCreated(); + this.Amounts = amounts; + this.BannerUrl = bannerUrl; + this.CampaignName = campaignName; + this.CauseName = causeName; + this.Donation = donation; + this.Id = id; + this.LogoUrl = logoUrl; + this.NonprofitDescription = nonprofitDescription; + this.NonprofitName = nonprofitName; + this.NonprofitUrl = nonprofitUrl; + this.TermsAndConditionsUrl = termsAndConditionsUrl; } - partial void OnCreated(); - - /// - /// Used to track the state of Amounts - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountsOption { get; private set; } - /// /// Gets or Sets Amounts /// - [JsonPropertyName("amounts")] - public Amounts Amounts { get { return this.AmountsOption; } set { this.AmountsOption = new Option(value); } } - - /// - /// Used to track the state of BannerUrl - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BannerUrlOption { get; private set; } + [DataMember(Name = "amounts", EmitDefaultValue = false)] + public Amounts Amounts { get; set; } /// /// The URL for the banner of the nonprofit or campaign. /// /// The URL for the banner of the nonprofit or campaign. - [JsonPropertyName("bannerUrl")] - public string BannerUrl { get { return this.BannerUrlOption; } set { this.BannerUrlOption = new Option(value); } } - - /// - /// Used to track the state of CampaignName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CampaignNameOption { get; private set; } + [DataMember(Name = "bannerUrl", EmitDefaultValue = false)] + public string BannerUrl { get; set; } /// /// The name of the donation campaign.. /// /// The name of the donation campaign.. - [JsonPropertyName("campaignName")] - public string CampaignName { get { return this.CampaignNameOption; } set { this.CampaignNameOption = new Option(value); } } - - /// - /// Used to track the state of CauseName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CauseNameOption { get; private set; } + [DataMember(Name = "campaignName", EmitDefaultValue = false)] + public string CampaignName { get; set; } /// /// The cause of the nonprofit. /// /// The cause of the nonprofit. - [JsonPropertyName("causeName")] - public string CauseName { get { return this.CauseNameOption; } set { this.CauseNameOption = new Option(value); } } - - /// - /// Used to track the state of Donation - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DonationOption { get; private set; } + [DataMember(Name = "causeName", EmitDefaultValue = false)] + public string CauseName { get; set; } /// /// Gets or Sets Donation /// - [JsonPropertyName("donation")] - public Donation Donation { get { return this.DonationOption; } set { this.DonationOption = new Option(value); } } - - /// - /// Used to track the state of Id - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IdOption { get; private set; } + [DataMember(Name = "donation", EmitDefaultValue = false)] + public Donation Donation { get; set; } /// /// The unique campaign ID of the donation campaign. /// /// The unique campaign ID of the donation campaign. - [JsonPropertyName("id")] - public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } - - /// - /// Used to track the state of LogoUrl - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LogoUrlOption { get; private set; } + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } /// /// The URL for the logo of the nonprofit. /// /// The URL for the logo of the nonprofit. - [JsonPropertyName("logoUrl")] - public string LogoUrl { get { return this.LogoUrlOption; } set { this.LogoUrlOption = new Option(value); } } - - /// - /// Used to track the state of NonprofitDescription - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NonprofitDescriptionOption { get; private set; } + [DataMember(Name = "logoUrl", EmitDefaultValue = false)] + public string LogoUrl { get; set; } /// /// The description of the nonprofit. /// /// The description of the nonprofit. - [JsonPropertyName("nonprofitDescription")] - public string NonprofitDescription { get { return this.NonprofitDescriptionOption; } set { this.NonprofitDescriptionOption = new Option(value); } } - - /// - /// Used to track the state of NonprofitName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NonprofitNameOption { get; private set; } + [DataMember(Name = "nonprofitDescription", EmitDefaultValue = false)] + public string NonprofitDescription { get; set; } /// /// The name of the nonprofit organization that receives the donation. /// /// The name of the nonprofit organization that receives the donation. - [JsonPropertyName("nonprofitName")] - public string NonprofitName { get { return this.NonprofitNameOption; } set { this.NonprofitNameOption = new Option(value); } } - - /// - /// Used to track the state of NonprofitUrl - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NonprofitUrlOption { get; private set; } + [DataMember(Name = "nonprofitName", EmitDefaultValue = false)] + public string NonprofitName { get; set; } /// /// The website URL of the nonprofit. /// /// The website URL of the nonprofit. - [JsonPropertyName("nonprofitUrl")] - public string NonprofitUrl { get { return this.NonprofitUrlOption; } set { this.NonprofitUrlOption = new Option(value); } } - - /// - /// Used to track the state of TermsAndConditionsUrl - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TermsAndConditionsUrlOption { get; private set; } + [DataMember(Name = "nonprofitUrl", EmitDefaultValue = false)] + public string NonprofitUrl { get; set; } /// /// The URL of the terms and conditions page of the nonprofit and the campaign. /// /// The URL of the terms and conditions page of the nonprofit and the campaign. - [JsonPropertyName("termsAndConditionsUrl")] - public string TermsAndConditionsUrl { get { return this.TermsAndConditionsUrlOption; } set { this.TermsAndConditionsUrlOption = new Option(value); } } + [DataMember(Name = "termsAndConditionsUrl", EmitDefaultValue = false)] + public string TermsAndConditionsUrl { get; set; } /// /// Returns the string presentation of the object @@ -237,235 +160,158 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class DonationCampaignJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override DonationCampaign Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amounts = default; - Option bannerUrl = default; - Option campaignName = default; - Option causeName = default; - Option donation = default; - Option id = default; - Option logoUrl = default; - Option nonprofitDescription = default; - Option nonprofitName = default; - Option nonprofitUrl = default; - Option termsAndConditionsUrl = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amounts": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amounts = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "bannerUrl": - bannerUrl = new Option(utf8JsonReader.GetString()); - break; - case "campaignName": - campaignName = new Option(utf8JsonReader.GetString()); - break; - case "causeName": - causeName = new Option(utf8JsonReader.GetString()); - break; - case "donation": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - donation = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "id": - id = new Option(utf8JsonReader.GetString()); - break; - case "logoUrl": - logoUrl = new Option(utf8JsonReader.GetString()); - break; - case "nonprofitDescription": - nonprofitDescription = new Option(utf8JsonReader.GetString()); - break; - case "nonprofitName": - nonprofitName = new Option(utf8JsonReader.GetString()); - break; - case "nonprofitUrl": - nonprofitUrl = new Option(utf8JsonReader.GetString()); - break; - case "termsAndConditionsUrl": - termsAndConditionsUrl = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (amounts.IsSet && amounts.Value == null) - throw new ArgumentNullException(nameof(amounts), "Property is not nullable for class DonationCampaign."); - - if (bannerUrl.IsSet && bannerUrl.Value == null) - throw new ArgumentNullException(nameof(bannerUrl), "Property is not nullable for class DonationCampaign."); - - if (campaignName.IsSet && campaignName.Value == null) - throw new ArgumentNullException(nameof(campaignName), "Property is not nullable for class DonationCampaign."); - - if (causeName.IsSet && causeName.Value == null) - throw new ArgumentNullException(nameof(causeName), "Property is not nullable for class DonationCampaign."); - - if (donation.IsSet && donation.Value == null) - throw new ArgumentNullException(nameof(donation), "Property is not nullable for class DonationCampaign."); - - if (id.IsSet && id.Value == null) - throw new ArgumentNullException(nameof(id), "Property is not nullable for class DonationCampaign."); - - if (logoUrl.IsSet && logoUrl.Value == null) - throw new ArgumentNullException(nameof(logoUrl), "Property is not nullable for class DonationCampaign."); - - if (nonprofitDescription.IsSet && nonprofitDescription.Value == null) - throw new ArgumentNullException(nameof(nonprofitDescription), "Property is not nullable for class DonationCampaign."); - - if (nonprofitName.IsSet && nonprofitName.Value == null) - throw new ArgumentNullException(nameof(nonprofitName), "Property is not nullable for class DonationCampaign."); - - if (nonprofitUrl.IsSet && nonprofitUrl.Value == null) - throw new ArgumentNullException(nameof(nonprofitUrl), "Property is not nullable for class DonationCampaign."); - - if (termsAndConditionsUrl.IsSet && termsAndConditionsUrl.Value == null) - throw new ArgumentNullException(nameof(termsAndConditionsUrl), "Property is not nullable for class DonationCampaign."); - - return new DonationCampaign(amounts, bannerUrl, campaignName, causeName, donation, id, logoUrl, nonprofitDescription, nonprofitName, nonprofitUrl, termsAndConditionsUrl); + return this.Equals(input as DonationCampaign); } /// - /// Serializes a + /// Returns true if DonationCampaign instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DonationCampaign donationCampaign, JsonSerializerOptions jsonSerializerOptions) + /// Instance of DonationCampaign to be compared + /// Boolean + public bool Equals(DonationCampaign input) { - writer.WriteStartObject(); - - WriteProperties(writer, donationCampaign, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Amounts == input.Amounts || + (this.Amounts != null && + this.Amounts.Equals(input.Amounts)) + ) && + ( + this.BannerUrl == input.BannerUrl || + (this.BannerUrl != null && + this.BannerUrl.Equals(input.BannerUrl)) + ) && + ( + this.CampaignName == input.CampaignName || + (this.CampaignName != null && + this.CampaignName.Equals(input.CampaignName)) + ) && + ( + this.CauseName == input.CauseName || + (this.CauseName != null && + this.CauseName.Equals(input.CauseName)) + ) && + ( + this.Donation == input.Donation || + (this.Donation != null && + this.Donation.Equals(input.Donation)) + ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.LogoUrl == input.LogoUrl || + (this.LogoUrl != null && + this.LogoUrl.Equals(input.LogoUrl)) + ) && + ( + this.NonprofitDescription == input.NonprofitDescription || + (this.NonprofitDescription != null && + this.NonprofitDescription.Equals(input.NonprofitDescription)) + ) && + ( + this.NonprofitName == input.NonprofitName || + (this.NonprofitName != null && + this.NonprofitName.Equals(input.NonprofitName)) + ) && + ( + this.NonprofitUrl == input.NonprofitUrl || + (this.NonprofitUrl != null && + this.NonprofitUrl.Equals(input.NonprofitUrl)) + ) && + ( + this.TermsAndConditionsUrl == input.TermsAndConditionsUrl || + (this.TermsAndConditionsUrl != null && + this.TermsAndConditionsUrl.Equals(input.TermsAndConditionsUrl)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, DonationCampaign donationCampaign, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (donationCampaign.AmountsOption.IsSet && donationCampaign.Amounts == null) - throw new ArgumentNullException(nameof(donationCampaign.Amounts), "Property is required for class DonationCampaign."); - - if (donationCampaign.BannerUrlOption.IsSet && donationCampaign.BannerUrl == null) - throw new ArgumentNullException(nameof(donationCampaign.BannerUrl), "Property is required for class DonationCampaign."); - - if (donationCampaign.CampaignNameOption.IsSet && donationCampaign.CampaignName == null) - throw new ArgumentNullException(nameof(donationCampaign.CampaignName), "Property is required for class DonationCampaign."); - - if (donationCampaign.CauseNameOption.IsSet && donationCampaign.CauseName == null) - throw new ArgumentNullException(nameof(donationCampaign.CauseName), "Property is required for class DonationCampaign."); - - if (donationCampaign.DonationOption.IsSet && donationCampaign.Donation == null) - throw new ArgumentNullException(nameof(donationCampaign.Donation), "Property is required for class DonationCampaign."); - - if (donationCampaign.IdOption.IsSet && donationCampaign.Id == null) - throw new ArgumentNullException(nameof(donationCampaign.Id), "Property is required for class DonationCampaign."); - - if (donationCampaign.LogoUrlOption.IsSet && donationCampaign.LogoUrl == null) - throw new ArgumentNullException(nameof(donationCampaign.LogoUrl), "Property is required for class DonationCampaign."); - - if (donationCampaign.NonprofitDescriptionOption.IsSet && donationCampaign.NonprofitDescription == null) - throw new ArgumentNullException(nameof(donationCampaign.NonprofitDescription), "Property is required for class DonationCampaign."); - - if (donationCampaign.NonprofitNameOption.IsSet && donationCampaign.NonprofitName == null) - throw new ArgumentNullException(nameof(donationCampaign.NonprofitName), "Property is required for class DonationCampaign."); - - if (donationCampaign.NonprofitUrlOption.IsSet && donationCampaign.NonprofitUrl == null) - throw new ArgumentNullException(nameof(donationCampaign.NonprofitUrl), "Property is required for class DonationCampaign."); - - if (donationCampaign.TermsAndConditionsUrlOption.IsSet && donationCampaign.TermsAndConditionsUrl == null) - throw new ArgumentNullException(nameof(donationCampaign.TermsAndConditionsUrl), "Property is required for class DonationCampaign."); - - if (donationCampaign.AmountsOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("amounts"); - JsonSerializer.Serialize(writer, donationCampaign.Amounts, jsonSerializerOptions); - } - if (donationCampaign.BannerUrlOption.IsSet) - writer.WriteString("bannerUrl", donationCampaign.BannerUrl); - - if (donationCampaign.CampaignNameOption.IsSet) - writer.WriteString("campaignName", donationCampaign.CampaignName); - - if (donationCampaign.CauseNameOption.IsSet) - writer.WriteString("causeName", donationCampaign.CauseName); - - if (donationCampaign.DonationOption.IsSet) - { - writer.WritePropertyName("donation"); - JsonSerializer.Serialize(writer, donationCampaign.Donation, jsonSerializerOptions); + int hashCode = 41; + if (this.Amounts != null) + { + hashCode = (hashCode * 59) + this.Amounts.GetHashCode(); + } + if (this.BannerUrl != null) + { + hashCode = (hashCode * 59) + this.BannerUrl.GetHashCode(); + } + if (this.CampaignName != null) + { + hashCode = (hashCode * 59) + this.CampaignName.GetHashCode(); + } + if (this.CauseName != null) + { + hashCode = (hashCode * 59) + this.CauseName.GetHashCode(); + } + if (this.Donation != null) + { + hashCode = (hashCode * 59) + this.Donation.GetHashCode(); + } + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.LogoUrl != null) + { + hashCode = (hashCode * 59) + this.LogoUrl.GetHashCode(); + } + if (this.NonprofitDescription != null) + { + hashCode = (hashCode * 59) + this.NonprofitDescription.GetHashCode(); + } + if (this.NonprofitName != null) + { + hashCode = (hashCode * 59) + this.NonprofitName.GetHashCode(); + } + if (this.NonprofitUrl != null) + { + hashCode = (hashCode * 59) + this.NonprofitUrl.GetHashCode(); + } + if (this.TermsAndConditionsUrl != null) + { + hashCode = (hashCode * 59) + this.TermsAndConditionsUrl.GetHashCode(); + } + return hashCode; } - if (donationCampaign.IdOption.IsSet) - writer.WriteString("id", donationCampaign.Id); - - if (donationCampaign.LogoUrlOption.IsSet) - writer.WriteString("logoUrl", donationCampaign.LogoUrl); - - if (donationCampaign.NonprofitDescriptionOption.IsSet) - writer.WriteString("nonprofitDescription", donationCampaign.NonprofitDescription); - - if (donationCampaign.NonprofitNameOption.IsSet) - writer.WriteString("nonprofitName", donationCampaign.NonprofitName); - - if (donationCampaign.NonprofitUrlOption.IsSet) - writer.WriteString("nonprofitUrl", donationCampaign.NonprofitUrl); - - if (donationCampaign.TermsAndConditionsUrlOption.IsSet) - writer.WriteString("termsAndConditionsUrl", donationCampaign.TermsAndConditionsUrl); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/DonationCampaignsRequest.cs b/Adyen/Model/Checkout/DonationCampaignsRequest.cs index ee068154a..3a223fac1 100644 --- a/Adyen/Model/Checkout/DonationCampaignsRequest.cs +++ b/Adyen/Model/Checkout/DonationCampaignsRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,64 +15,61 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// DonationCampaignsRequest /// - public partial class DonationCampaignsRequest : IValidatableObject + [DataContract(Name = "DonationCampaignsRequest")] + public partial class DonationCampaignsRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). - /// Your merchant account identifier. - /// Locale on the shopper interaction device. - [JsonConstructor] - public DonationCampaignsRequest(string currency, string merchantAccount, Option locale = default) + [JsonConstructorAttribute] + protected DonationCampaignsRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). (required). + /// Locale on the shopper interaction device.. + /// Your merchant account identifier. (required). + public DonationCampaignsRequest(string currency = default(string), string locale = default(string), string merchantAccount = default(string)) { - Currency = currency; - MerchantAccount = merchantAccount; - LocaleOption = locale; - OnCreated(); + this.Currency = currency; + this.MerchantAccount = merchantAccount; + this.Locale = locale; } - partial void OnCreated(); - /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). /// /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/). - [JsonPropertyName("currency")] + [DataMember(Name = "currency", IsRequired = false, EmitDefaultValue = false)] public string Currency { get; set; } /// - /// Your merchant account identifier. - /// - /// Your merchant account identifier. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } - - /// - /// Used to track the state of Locale + /// Locale on the shopper interaction device. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LocaleOption { get; private set; } + /// Locale on the shopper interaction device. + [DataMember(Name = "locale", EmitDefaultValue = false)] + public string Locale { get; set; } /// - /// Locale on the shopper interaction device. + /// Your merchant account identifier. /// - /// Locale on the shopper interaction device. - [JsonPropertyName("locale")] - public string Locale { get { return this.LocaleOption; } set { this.LocaleOption = new Option(value); } } + /// Your merchant account identifier. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// Returns the string presentation of the object @@ -82,136 +80,93 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class DonationCampaignsRequest {\n"); sb.Append(" Currency: ").Append(Currency).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" Locale: ").Append(Locale).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class DonationCampaignsRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override DonationCampaignsRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option currency = default; - Option merchantAccount = default; - Option locale = default; + return this.Equals(input as DonationCampaignsRequest); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if DonationCampaignsRequest instances are equal + /// + /// Instance of DonationCampaignsRequest to be compared + /// Boolean + public bool Equals(DonationCampaignsRequest input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "currency": - currency = new Option(utf8JsonReader.GetString()); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "locale": - locale = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!currency.IsSet) - throw new ArgumentException("Property is required for class DonationCampaignsRequest.", nameof(currency)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class DonationCampaignsRequest.", nameof(merchantAccount)); - - if (currency.IsSet && currency.Value == null) - throw new ArgumentNullException(nameof(currency), "Property is not nullable for class DonationCampaignsRequest."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class DonationCampaignsRequest."); - - if (locale.IsSet && locale.Value == null) - throw new ArgumentNullException(nameof(locale), "Property is not nullable for class DonationCampaignsRequest."); - - return new DonationCampaignsRequest(currency.Value, merchantAccount.Value, locale); + return + ( + this.Currency == input.Currency || + (this.Currency != null && + this.Currency.Equals(input.Currency)) + ) && + ( + this.Locale == input.Locale || + (this.Locale != null && + this.Locale.Equals(input.Locale)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DonationCampaignsRequest donationCampaignsRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, donationCampaignsRequest, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Currency != null) + { + hashCode = (hashCode * 59) + this.Currency.GetHashCode(); + } + if (this.Locale != null) + { + hashCode = (hashCode * 59) + this.Locale.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, DonationCampaignsRequest donationCampaignsRequest, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (donationCampaignsRequest.Currency == null) - throw new ArgumentNullException(nameof(donationCampaignsRequest.Currency), "Property is required for class DonationCampaignsRequest."); - - if (donationCampaignsRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(donationCampaignsRequest.MerchantAccount), "Property is required for class DonationCampaignsRequest."); - - if (donationCampaignsRequest.LocaleOption.IsSet && donationCampaignsRequest.Locale == null) - throw new ArgumentNullException(nameof(donationCampaignsRequest.Locale), "Property is required for class DonationCampaignsRequest."); - - writer.WriteString("currency", donationCampaignsRequest.Currency); - - writer.WriteString("merchantAccount", donationCampaignsRequest.MerchantAccount); - - if (donationCampaignsRequest.LocaleOption.IsSet) - writer.WriteString("locale", donationCampaignsRequest.Locale); + yield break; } } + } diff --git a/Adyen/Model/Checkout/DonationCampaignsResponse.cs b/Adyen/Model/Checkout/DonationCampaignsResponse.cs index d7cb7db44..3793ecbb6 100644 --- a/Adyen/Model/Checkout/DonationCampaignsResponse.cs +++ b/Adyen/Model/Checkout/DonationCampaignsResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,46 +15,38 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// DonationCampaignsResponse /// - public partial class DonationCampaignsResponse : IValidatableObject + [DataContract(Name = "DonationCampaignsResponse")] + public partial class DonationCampaignsResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// List of active donation campaigns for your merchant account. - [JsonConstructor] - public DonationCampaignsResponse(Option> donationCampaigns = default) + /// List of active donation campaigns for your merchant account.. + public DonationCampaignsResponse(List donationCampaigns = default(List)) { - DonationCampaignsOption = donationCampaigns; - OnCreated(); + this.DonationCampaigns = donationCampaigns; } - partial void OnCreated(); - - /// - /// Used to track the state of DonationCampaigns - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> DonationCampaignsOption { get; private set; } - /// /// List of active donation campaigns for your merchant account. /// /// List of active donation campaigns for your merchant account. - [JsonPropertyName("donationCampaigns")] - public List DonationCampaigns { get { return this.DonationCampaignsOption; } set { this.DonationCampaignsOption = new Option>(value); } } + [DataMember(Name = "donationCampaigns", EmitDefaultValue = false)] + public List DonationCampaigns { get; set; } /// /// Returns the string presentation of the object @@ -69,103 +62,69 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class DonationCampaignsResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override DonationCampaignsResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option> donationCampaigns = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "donationCampaigns": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - donationCampaigns = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (donationCampaigns.IsSet && donationCampaigns.Value == null) - throw new ArgumentNullException(nameof(donationCampaigns), "Property is not nullable for class DonationCampaignsResponse."); - - return new DonationCampaignsResponse(donationCampaigns); + return this.Equals(input as DonationCampaignsResponse); } /// - /// Serializes a + /// Returns true if DonationCampaignsResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DonationCampaignsResponse donationCampaignsResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of DonationCampaignsResponse to be compared + /// Boolean + public bool Equals(DonationCampaignsResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, donationCampaignsResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.DonationCampaigns == input.DonationCampaigns || + this.DonationCampaigns != null && + input.DonationCampaigns != null && + this.DonationCampaigns.SequenceEqual(input.DonationCampaigns) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, DonationCampaignsResponse donationCampaignsResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (donationCampaignsResponse.DonationCampaignsOption.IsSet && donationCampaignsResponse.DonationCampaigns == null) - throw new ArgumentNullException(nameof(donationCampaignsResponse.DonationCampaigns), "Property is required for class DonationCampaignsResponse."); - - if (donationCampaignsResponse.DonationCampaignsOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("donationCampaigns"); - JsonSerializer.Serialize(writer, donationCampaignsResponse.DonationCampaigns, jsonSerializerOptions); + int hashCode = 41; + if (this.DonationCampaigns != null) + { + hashCode = (hashCode * 59) + this.DonationCampaigns.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/DonationPaymentMethod.cs b/Adyen/Model/Checkout/DonationPaymentMethod.cs index 0daced182..4049c4ae2 100644 --- a/Adyen/Model/Checkout/DonationPaymentMethod.cs +++ b/Adyen/Model/Checkout/DonationPaymentMethod.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,96 +15,175 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using System.Reflection; namespace Adyen.Model.Checkout { /// /// The type and required details of a payment method to use. /// - public partial class DonationPaymentMethod : IValidatableObject + [JsonConverter(typeof(DonationPaymentMethodJsonConverter))] + [DataContract(Name = "DonationPaymentMethod")] + public partial class DonationPaymentMethod : AbstractOpenAPISchema, IEquatable, IValidatableObject { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public DonationPaymentMethod(ApplePayDonations applePayDonations) + /// An instance of ApplePayDonations. + public DonationPaymentMethod(ApplePayDonations actualInstance) { - ApplePayDonations = applePayDonations; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public DonationPaymentMethod(CardDonations cardDonations) + /// An instance of CardDonations. + public DonationPaymentMethod(CardDonations actualInstance) { - CardDonations = cardDonations; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public DonationPaymentMethod(GooglePayDonations googlePayDonations) + /// An instance of GooglePayDonations. + public DonationPaymentMethod(GooglePayDonations actualInstance) { - GooglePayDonations = googlePayDonations; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public DonationPaymentMethod(IdealDonations idealDonations) + /// An instance of IdealDonations. + public DonationPaymentMethod(IdealDonations actualInstance) { - IdealDonations = idealDonations; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public DonationPaymentMethod(PayWithGoogleDonations payWithGoogleDonations) + /// An instance of PayWithGoogleDonations. + public DonationPaymentMethod(PayWithGoogleDonations actualInstance) { - PayWithGoogleDonations = payWithGoogleDonations; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } - partial void OnCreated(); + + private Object _actualInstance; /// - /// Gets or Sets ApplePayDonations + /// Gets or Sets ActualInstance /// - public ApplePayDonations ApplePayDonations { get; set; } + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(ApplePayDonations)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(CardDonations)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(GooglePayDonations)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(IdealDonations)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(PayWithGoogleDonations)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: ApplePayDonations, CardDonations, GooglePayDonations, IdealDonations, PayWithGoogleDonations"); + } + } + } /// - /// Gets or Sets CardDonations + /// Get the actual instance of `ApplePayDonations`. If the actual instance is not `ApplePayDonations`, + /// the InvalidClassException will be thrown /// - public CardDonations CardDonations { get; set; } + /// An instance of ApplePayDonations + public ApplePayDonations GetApplePayDonations() + { + return (ApplePayDonations)this.ActualInstance; + } /// - /// Gets or Sets GooglePayDonations + /// Get the actual instance of `CardDonations`. If the actual instance is not `CardDonations`, + /// the InvalidClassException will be thrown /// - public GooglePayDonations GooglePayDonations { get; set; } + /// An instance of CardDonations + public CardDonations GetCardDonations() + { + return (CardDonations)this.ActualInstance; + } /// - /// Gets or Sets IdealDonations + /// Get the actual instance of `GooglePayDonations`. If the actual instance is not `GooglePayDonations`, + /// the InvalidClassException will be thrown /// - public IdealDonations IdealDonations { get; set; } + /// An instance of GooglePayDonations + public GooglePayDonations GetGooglePayDonations() + { + return (GooglePayDonations)this.ActualInstance; + } /// - /// Gets or Sets PayWithGoogleDonations + /// Get the actual instance of `IdealDonations`. If the actual instance is not `IdealDonations`, + /// the InvalidClassException will be thrown /// - public PayWithGoogleDonations PayWithGoogleDonations { get; set; } + /// An instance of IdealDonations + public IdealDonations GetIdealDonations() + { + return (IdealDonations)this.ActualInstance; + } + + /// + /// Get the actual instance of `PayWithGoogleDonations`. If the actual instance is not `PayWithGoogleDonations`, + /// the InvalidClassException will be thrown + /// + /// An instance of PayWithGoogleDonations + public PayWithGoogleDonations GetPayWithGoogleDonations() + { + return (PayWithGoogleDonations)this.ActualInstance; + } /// /// Returns the string presentation of the object @@ -111,143 +191,190 @@ public DonationPaymentMethod(PayWithGoogleDonations payWithGoogleDonations) /// String presentation of the object public override string ToString() { - StringBuilder sb = new StringBuilder(); + var sb = new StringBuilder(); sb.Append("class DonationPaymentMethod {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public override string ToJson() { - yield break; + return JsonConvert.SerializeObject(this.ActualInstance, DonationPaymentMethod.SerializerSettings); } - } - /// - /// A Json converter for type - /// - public class DonationPaymentMethodJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Converts the JSON string into an instance of DonationPaymentMethod /// - /// - /// - /// - /// - /// - public override DonationPaymentMethod Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// JSON string + /// An instance of DonationPaymentMethod + public static DonationPaymentMethod FromJson(string jsonString) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; + DonationPaymentMethod newDonationPaymentMethod = null; - ApplePayDonations applePayDonations = default; - CardDonations cardDonations = default; - GooglePayDonations googlePayDonations = default; - IdealDonations idealDonations = default; - PayWithGoogleDonations payWithGoogleDonations = default; - - Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; - while (utf8JsonReaderOneOf.Read()) + if (string.IsNullOrEmpty(jsonString)) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) - break; - - if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + return newDonationPaymentMethod; + } + int match = 0; + List matchedTypes = new List(); + JToken typeToken = JObject.Parse(jsonString).GetValue("type"); + string type = typeToken?.Value(); + // Throw exception if jsonString does not contain type param + if (type == null) + { + throw new InvalidDataException("JsonString does not contain required enum type for deserialization."); + } + try + { + // Check if the jsonString type enum matches the ApplePayDonations type enums + if (ContainsValue(type)) { - Utf8JsonReader utf8JsonReaderApplePayDonations = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderApplePayDonations, jsonSerializerOptions, out applePayDonations); - - Utf8JsonReader utf8JsonReaderCardDonations = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderCardDonations, jsonSerializerOptions, out cardDonations); - - Utf8JsonReader utf8JsonReaderGooglePayDonations = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderGooglePayDonations, jsonSerializerOptions, out googlePayDonations); - - Utf8JsonReader utf8JsonReaderIdealDonations = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderIdealDonations, jsonSerializerOptions, out idealDonations); - - Utf8JsonReader utf8JsonReaderPayWithGoogleDonations = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderPayWithGoogleDonations, jsonSerializerOptions, out payWithGoogleDonations); + newDonationPaymentMethod = new DonationPaymentMethod(JsonConvert.DeserializeObject(jsonString, DonationPaymentMethod.SerializerSettings)); + matchedTypes.Add("ApplePayDonations"); + match++; } - } - - while (utf8JsonReader.Read()) + // Check if the jsonString type enum matches the CardDonations type enums + if (ContainsValue(type)) + { + newDonationPaymentMethod = new DonationPaymentMethod(JsonConvert.DeserializeObject(jsonString, DonationPaymentMethod.SerializerSettings)); + matchedTypes.Add("CardDonations"); + match++; + } + // Check if the jsonString type enum matches the GooglePayDonations type enums + if (ContainsValue(type)) + { + newDonationPaymentMethod = new DonationPaymentMethod(JsonConvert.DeserializeObject(jsonString, DonationPaymentMethod.SerializerSettings)); + matchedTypes.Add("GooglePayDonations"); + match++; + } + // Check if the jsonString type enum matches the IdealDonations type enums + if (ContainsValue(type)) + { + newDonationPaymentMethod = new DonationPaymentMethod(JsonConvert.DeserializeObject(jsonString, DonationPaymentMethod.SerializerSettings)); + matchedTypes.Add("IdealDonations"); + match++; + } + // Check if the jsonString type enum matches the PayWithGoogleDonations type enums + if (ContainsValue(type)) + { + newDonationPaymentMethod = new DonationPaymentMethod(JsonConvert.DeserializeObject(jsonString, DonationPaymentMethod.SerializerSettings)); + matchedTypes.Add("PayWithGoogleDonations"); + match++; + } + } + catch (Exception ex) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + if (!(ex is JsonSerializationException)) { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - default: - break; - } + throw new InvalidDataException(string.Format("Failed to deserialize `{0}` into target: {1}", jsonString, ex.ToString())); } } - if (applePayDonations != null) - return new DonationPaymentMethod(applePayDonations); - - if (cardDonations != null) - return new DonationPaymentMethod(cardDonations); + if (match != 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined. MatchedTypes are: " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newDonationPaymentMethod; + } - if (googlePayDonations != null) - return new DonationPaymentMethod(googlePayDonations); + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as DonationPaymentMethod); + } - if (idealDonations != null) - return new DonationPaymentMethod(idealDonations); + /// + /// Returns true if DonationPaymentMethod instances are equal + /// + /// Instance of DonationPaymentMethod to be compared + /// Boolean + public bool Equals(DonationPaymentMethod input) + { + if (input == null) + return false; - if (payWithGoogleDonations != null) - return new DonationPaymentMethod(payWithGoogleDonations); + return this.ActualInstance.Equals(input.ActualInstance); + } - throw new JsonException(); + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } } /// - /// Serializes a + /// To validate all properties of the instance /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DonationPaymentMethod donationPaymentMethod, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - writer.WriteStartObject(); + yield break; + } + } - WriteProperties(writer, donationPaymentMethod, jsonSerializerOptions); - writer.WriteEndObject(); + /// + /// Custom JSON converter for DonationPaymentMethod + /// + public class DonationPaymentMethodJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(DonationPaymentMethod).GetMethod("ToJson").Invoke(value, null))); } /// - /// Serializes the properties of + /// To convert a JSON string into an object /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, DonationPaymentMethod donationPaymentMethod, JsonSerializerOptions jsonSerializerOptions) + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { + if(reader.TokenType != JsonToken.Null) + { + return DonationPaymentMethod.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; } } + } diff --git a/Adyen/Model/Checkout/DonationPaymentRequest.cs b/Adyen/Model/Checkout/DonationPaymentRequest.cs index 656d5d7f7..1fd2eef0b 100644 --- a/Adyen/Model/Checkout/DonationPaymentRequest.cs +++ b/Adyen/Model/Checkout/DonationPaymentRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,914 +15,489 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// DonationPaymentRequest /// - public partial class DonationPaymentRequest : IValidatableObject + [DataContract(Name = "DonationPaymentRequest")] + public partial class DonationPaymentRequest : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The merchant account identifier, with which you want to process the transaction. - /// paymentMethod - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. - /// accountInfo - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - /// applicationInfo - /// authenticationData - /// billingAddress - /// browserInfo - /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web - /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - /// deliveryAddress - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - /// Donation account to which the transaction is credited. - /// The donation campaign ID received in the `/donationCampaigns` call. - /// PSP reference of the transaction from which the donation token is generated. Required when `donationToken` is provided. - /// Donation token received in the `/payments` call. - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. - /// merchantRiskIndicator - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - /// mpiData - /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. - /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. - /// Specifies the redirect method (GET or POST) when redirecting to the issuer. - /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - /// The combination of a language code and a country code to specify the language to be used in the payment. - /// shopperName - /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - /// The shopper's social security number. - /// The shopper's telephone number. - /// threeDS2RequestData - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) - [JsonConstructor] - public DonationPaymentRequest(Amount amount, string merchantAccount, DonationPaymentMethod paymentMethod, string reference, string returnUrl, Option accountInfo = default, Option> additionalData = default, Option applicationInfo = default, Option authenticationData = default, Option billingAddress = default, Option browserInfo = default, Option channel = default, Option checkoutAttemptId = default, Option conversionId = default, Option countryCode = default, Option dateOfBirth = default, Option deliverAt = default, Option deliveryAddress = default, Option deviceFingerprint = default, Option donationAccount = default, Option donationCampaignId = default, Option donationOriginalPspReference = default, Option donationToken = default, Option> lineItems = default, Option merchantRiskIndicator = default, Option> metadata = default, Option mpiData = default, Option origin = default, Option recurringProcessingModel = default, Option redirectFromIssuerMethod = default, Option redirectToIssuerMethod = default, Option sessionValidity = default, Option shopperEmail = default, Option shopperIP = default, Option shopperInteraction = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option socialSecurityNumber = default, Option telephoneNumber = default, Option threeDS2RequestData = default, Option threeDSAuthenticationOnly = default) - { - Amount = amount; - MerchantAccount = merchantAccount; - PaymentMethod = paymentMethod; - Reference = reference; - ReturnUrl = returnUrl; - AccountInfoOption = accountInfo; - AdditionalDataOption = additionalData; - ApplicationInfoOption = applicationInfo; - AuthenticationDataOption = authenticationData; - BillingAddressOption = billingAddress; - BrowserInfoOption = browserInfo; - ChannelOption = channel; - CheckoutAttemptIdOption = checkoutAttemptId; - ConversionIdOption = conversionId; - CountryCodeOption = countryCode; - DateOfBirthOption = dateOfBirth; - DeliverAtOption = deliverAt; - DeliveryAddressOption = deliveryAddress; - DeviceFingerprintOption = deviceFingerprint; - DonationAccountOption = donationAccount; - DonationCampaignIdOption = donationCampaignId; - DonationOriginalPspReferenceOption = donationOriginalPspReference; - DonationTokenOption = donationToken; - LineItemsOption = lineItems; - MerchantRiskIndicatorOption = merchantRiskIndicator; - MetadataOption = metadata; - MpiDataOption = mpiData; - OriginOption = origin; - RecurringProcessingModelOption = recurringProcessingModel; - RedirectFromIssuerMethodOption = redirectFromIssuerMethod; - RedirectToIssuerMethodOption = redirectToIssuerMethod; - SessionValidityOption = sessionValidity; - ShopperEmailOption = shopperEmail; - ShopperIPOption = shopperIP; - ShopperInteractionOption = shopperInteraction; - ShopperLocaleOption = shopperLocale; - ShopperNameOption = shopperName; - ShopperReferenceOption = shopperReference; - SocialSecurityNumberOption = socialSecurityNumber; - TelephoneNumberOption = telephoneNumber; - ThreeDS2RequestDataOption = threeDS2RequestData; - ThreeDSAuthenticationOnlyOption = threeDSAuthenticationOnly; - OnCreated(); - } - - partial void OnCreated(); - /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web + [JsonConverter(typeof(StringEnumConverter))] public enum ChannelEnum { /// /// Enum IOS for value: iOS /// + [EnumMember(Value = "iOS")] IOS = 1, /// /// Enum Android for value: Android /// + [EnumMember(Value = "Android")] Android = 2, /// /// Enum Web for value: Web /// + [EnumMember(Value = "Web")] Web = 3 - } - /// - /// Returns a - /// - /// - /// - /// - public static ChannelEnum ChannelEnumFromString(string value) - { - if (value.Equals("iOS")) - return ChannelEnum.IOS; - - if (value.Equals("Android")) - return ChannelEnum.Android; - - if (value.Equals("Web")) - return ChannelEnum.Web; - - throw new NotImplementedException($"Could not convert value to type ChannelEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static ChannelEnum? ChannelEnumFromStringOrDefault(string value) - { - if (value.Equals("iOS")) - return ChannelEnum.IOS; - - if (value.Equals("Android")) - return ChannelEnum.Android; - - if (value.Equals("Web")) - return ChannelEnum.Web; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChannelEnumToJsonValue(ChannelEnum? value) - { - if (value == ChannelEnum.IOS) - return "iOS"; - - if (value == ChannelEnum.Android) - return "Android"; - - if (value == ChannelEnum.Web) - return "Web"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Channel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChannelOption { get; private set; } /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web - [JsonPropertyName("channel")] - public ChannelEnum? Channel { get { return this.ChannelOption; } set { this.ChannelOption = new Option(value); } } - + [DataMember(Name = "channel", EmitDefaultValue = false)] + public ChannelEnum? Channel { get; set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// + [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// + [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// + [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) - { - if (value == RecurringProcessingModelEnum.CardOnFile) - return "CardOnFile"; - - if (value == RecurringProcessingModelEnum.Subscription) - return "Subscription"; - - if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) - return "UnscheduledCardOnFile"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of RecurringProcessingModel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonPropertyName("recurringProcessingModel")] - public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } - + [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] + public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } /// - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorization rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorization (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorization rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorization (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + [JsonConverter(typeof(StringEnumConverter))] public enum ShopperInteractionEnum { /// /// Enum Ecommerce for value: Ecommerce /// + [EnumMember(Value = "Ecommerce")] Ecommerce = 1, /// /// Enum ContAuth for value: ContAuth /// + [EnumMember(Value = "ContAuth")] ContAuth = 2, /// /// Enum Moto for value: Moto /// + [EnumMember(Value = "Moto")] Moto = 3, /// /// Enum POS for value: POS /// + [EnumMember(Value = "POS")] POS = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ShopperInteractionEnum ShopperInteractionEnumFromString(string value) - { - if (value.Equals("Ecommerce")) - return ShopperInteractionEnum.Ecommerce; - - if (value.Equals("ContAuth")) - return ShopperInteractionEnum.ContAuth; - - if (value.Equals("Moto")) - return ShopperInteractionEnum.Moto; - - if (value.Equals("POS")) - return ShopperInteractionEnum.POS; - - throw new NotImplementedException($"Could not convert value to type ShopperInteractionEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ShopperInteractionEnum? ShopperInteractionEnumFromStringOrDefault(string value) - { - if (value.Equals("Ecommerce")) - return ShopperInteractionEnum.Ecommerce; - - if (value.Equals("ContAuth")) - return ShopperInteractionEnum.ContAuth; - if (value.Equals("Moto")) - return ShopperInteractionEnum.Moto; - - if (value.Equals("POS")) - return ShopperInteractionEnum.POS; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ShopperInteractionEnumToJsonValue(ShopperInteractionEnum? value) - { - if (value == ShopperInteractionEnum.Ecommerce) - return "Ecommerce"; - - if (value == ShopperInteractionEnum.ContAuth) - return "ContAuth"; - - if (value == ShopperInteractionEnum.Moto) - return "Moto"; - - if (value == ShopperInteractionEnum.POS) - return "POS"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ShopperInteraction - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperInteractionOption { get; private set; } - - /// - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - /// - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [JsonPropertyName("shopperInteraction")] - public ShopperInteractionEnum? ShopperInteraction { get { return this.ShopperInteractionOption; } set { this.ShopperInteractionOption = new Option(value); } } - - /// - /// Gets or Sets Amount - /// - [JsonPropertyName("amount")] - public Amount Amount { get; set; } - - /// - /// The merchant account identifier, with which you want to process the transaction. - /// - /// The merchant account identifier, with which you want to process the transaction. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } /// - /// Gets or Sets PaymentMethod + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorization rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorization (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// - [JsonPropertyName("paymentMethod")] - public DonationPaymentMethod PaymentMethod { get; set; } - + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorization rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorization (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] + public ShopperInteractionEnum? ShopperInteraction { get; set; } /// - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - /// - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - [JsonPropertyName("reference")] - public string Reference { get; set; } - - /// - /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// Initializes a new instance of the class. /// - /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. - [JsonPropertyName("returnUrl")] - public string ReturnUrl { get; set; } - + [JsonConstructorAttribute] + protected DonationPaymentRequest() { } /// - /// Used to track the state of AccountInfo + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountInfoOption { get; private set; } + /// accountInfo. + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. + /// amount (required). + /// applicationInfo. + /// authenticationData. + /// billingAddress. + /// browserInfo. + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web. + /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey.. + /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey.. + /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE. + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00. + /// deliveryAddress. + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting).. + /// Donation account to which the transaction is credited.. + /// The donation campaign ID received in the `/donationCampaigns` call.. + /// PSP reference of the transaction from which the donation token is generated. Required when `donationToken` is provided.. + /// Donation token received in the `/payments` call.. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip.. + /// The merchant account identifier, with which you want to process the transaction. (required). + /// merchantRiskIndicator. + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. . + /// mpiData. + /// > Required for browser-based (`channel` **Web**) 3D Secure 2 transactions.Set this to the origin URL of the page where you are rendering the Drop-in/Component. Do not include subdirectories and a trailing slash.. + /// paymentMethod (required). + /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer.. + /// Specifies the redirect method (GET or POST) when redirecting to the issuer.. + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. (required). + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. We strongly recommend that you use a maximum of 1024 characters. > The URL must not include personally identifiable information (PII), for example name or email address. (required). + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > Required for Visa and JCB transactions that require 3D Secure 2 authentication if you did not include the `telephoneNumber`.. + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new).. + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorization rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorization (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. + /// The combination of a language code and a country code to specify the language to be used in the payment.. + /// shopperName. + /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address.. + /// The shopper's social security number.. + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication.. + /// threeDS2RequestData. + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. (default to false). + public DonationPaymentRequest(AccountInfo accountInfo = default(AccountInfo), Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), AuthenticationData authenticationData = default(AuthenticationData), BillingAddress billingAddress = default(BillingAddress), BrowserInfo browserInfo = default(BrowserInfo), ChannelEnum? channel = default(ChannelEnum?), string checkoutAttemptId = default(string), string conversionId = default(string), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), DateTime deliverAt = default(DateTime), DeliveryAddress deliveryAddress = default(DeliveryAddress), string deviceFingerprint = default(string), string donationAccount = default(string), string donationCampaignId = default(string), string donationOriginalPspReference = default(string), string donationToken = default(string), List lineItems = default(List), string merchantAccount = default(string), MerchantRiskIndicator merchantRiskIndicator = default(MerchantRiskIndicator), Dictionary metadata = default(Dictionary), ThreeDSecureData mpiData = default(ThreeDSecureData), string origin = default(string), DonationPaymentMethod paymentMethod = default(DonationPaymentMethod), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string redirectFromIssuerMethod = default(string), string redirectToIssuerMethod = default(string), string reference = default(string), string returnUrl = default(string), string sessionValidity = default(string), string shopperEmail = default(string), string shopperIP = default(string), ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string socialSecurityNumber = default(string), string telephoneNumber = default(string), ThreeDS2RequestFields threeDS2RequestData = default(ThreeDS2RequestFields), bool? threeDSAuthenticationOnly = false) + { + this.Amount = amount; + this.MerchantAccount = merchantAccount; + this.PaymentMethod = paymentMethod; + this.Reference = reference; + this.ReturnUrl = returnUrl; + this.AccountInfo = accountInfo; + this.AdditionalData = additionalData; + this.ApplicationInfo = applicationInfo; + this.AuthenticationData = authenticationData; + this.BillingAddress = billingAddress; + this.BrowserInfo = browserInfo; + this.Channel = channel; + this.CheckoutAttemptId = checkoutAttemptId; + this.ConversionId = conversionId; + this.CountryCode = countryCode; + this.DateOfBirth = dateOfBirth; + this.DeliverAt = deliverAt; + this.DeliveryAddress = deliveryAddress; + this.DeviceFingerprint = deviceFingerprint; + this.DonationAccount = donationAccount; + this.DonationCampaignId = donationCampaignId; + this.DonationOriginalPspReference = donationOriginalPspReference; + this.DonationToken = donationToken; + this.LineItems = lineItems; + this.MerchantRiskIndicator = merchantRiskIndicator; + this.Metadata = metadata; + this.MpiData = mpiData; + this.Origin = origin; + this.RecurringProcessingModel = recurringProcessingModel; + this.RedirectFromIssuerMethod = redirectFromIssuerMethod; + this.RedirectToIssuerMethod = redirectToIssuerMethod; + this.SessionValidity = sessionValidity; + this.ShopperEmail = shopperEmail; + this.ShopperIP = shopperIP; + this.ShopperInteraction = shopperInteraction; + this.ShopperLocale = shopperLocale; + this.ShopperName = shopperName; + this.ShopperReference = shopperReference; + this.SocialSecurityNumber = socialSecurityNumber; + this.TelephoneNumber = telephoneNumber; + this.ThreeDS2RequestData = threeDS2RequestData; + this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; + } /// /// Gets or Sets AccountInfo /// - [JsonPropertyName("accountInfo")] - public AccountInfo AccountInfo { get { return this.AccountInfoOption; } set { this.AccountInfoOption = new Option(value); } } - - /// - /// Used to track the state of AdditionalData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AdditionalDataOption { get; private set; } + [DataMember(Name = "accountInfo", EmitDefaultValue = false)] + public AccountInfo AccountInfo { get; set; } /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - [JsonPropertyName("additionalData")] - public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } /// - /// Used to track the state of ApplicationInfo + /// Gets or Sets Amount /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ApplicationInfoOption { get; private set; } + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// Gets or Sets ApplicationInfo /// - [JsonPropertyName("applicationInfo")] - public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } - - /// - /// Used to track the state of AuthenticationData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthenticationDataOption { get; private set; } + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } /// /// Gets or Sets AuthenticationData /// - [JsonPropertyName("authenticationData")] - public AuthenticationData AuthenticationData { get { return this.AuthenticationDataOption; } set { this.AuthenticationDataOption = new Option(value); } } - - /// - /// Used to track the state of BillingAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressOption { get; private set; } + [DataMember(Name = "authenticationData", EmitDefaultValue = false)] + public AuthenticationData AuthenticationData { get; set; } /// /// Gets or Sets BillingAddress /// - [JsonPropertyName("billingAddress")] - public BillingAddress BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } - - /// - /// Used to track the state of BrowserInfo - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BrowserInfoOption { get; private set; } + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public BillingAddress BillingAddress { get; set; } /// /// Gets or Sets BrowserInfo /// - [JsonPropertyName("browserInfo")] - public BrowserInfo BrowserInfo { get { return this.BrowserInfoOption; } set { this.BrowserInfoOption = new Option(value); } } - - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + [DataMember(Name = "browserInfo", EmitDefaultValue = false)] + public BrowserInfo BrowserInfo { get; set; } /// /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. /// /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of ConversionId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ConversionIdOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. /// /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - [JsonPropertyName("conversionId")] - [Obsolete] - public string ConversionId { get { return this.ConversionIdOption; } set { this.ConversionIdOption = new Option(value); } } - - /// - /// Used to track the state of CountryCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CountryCodeOption { get; private set; } + [DataMember(Name = "conversionId", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v68. Use `checkoutAttemptId` instead")] + public string ConversionId { get; set; } /// /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE /// /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE - [JsonPropertyName("countryCode")] - public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } - - /// - /// Used to track the state of DateOfBirth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DateOfBirthOption { get; private set; } + [DataMember(Name = "countryCode", EmitDefaultValue = false)] + public string CountryCode { get; set; } /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - [JsonPropertyName("dateOfBirth")] - public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } - - /// - /// Used to track the state of DeliverAt - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliverAtOption { get; private set; } + [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] + public DateTime DateOfBirth { get; set; } /// /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 /// /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - [JsonPropertyName("deliverAt")] - public DateTime? DeliverAt { get { return this.DeliverAtOption; } set { this.DeliverAtOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryAddressOption { get; private set; } + [DataMember(Name = "deliverAt", EmitDefaultValue = false)] + public DateTime DeliverAt { get; set; } /// /// Gets or Sets DeliveryAddress /// - [JsonPropertyName("deliveryAddress")] - public DeliveryAddress DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } - - /// - /// Used to track the state of DeviceFingerprint - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeviceFingerprintOption { get; private set; } + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public DeliveryAddress DeliveryAddress { get; set; } /// /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). /// /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - [JsonPropertyName("deviceFingerprint")] - public string DeviceFingerprint { get { return this.DeviceFingerprintOption; } set { this.DeviceFingerprintOption = new Option(value); } } - - /// - /// Used to track the state of DonationAccount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DonationAccountOption { get; private set; } + [DataMember(Name = "deviceFingerprint", EmitDefaultValue = false)] + public string DeviceFingerprint { get; set; } /// /// Donation account to which the transaction is credited. /// /// Donation account to which the transaction is credited. - [JsonPropertyName("donationAccount")] - public string DonationAccount { get { return this.DonationAccountOption; } set { this.DonationAccountOption = new Option(value); } } - - /// - /// Used to track the state of DonationCampaignId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DonationCampaignIdOption { get; private set; } + [DataMember(Name = "donationAccount", EmitDefaultValue = false)] + public string DonationAccount { get; set; } /// /// The donation campaign ID received in the `/donationCampaigns` call. /// /// The donation campaign ID received in the `/donationCampaigns` call. - [JsonPropertyName("donationCampaignId")] - public string DonationCampaignId { get { return this.DonationCampaignIdOption; } set { this.DonationCampaignIdOption = new Option(value); } } - - /// - /// Used to track the state of DonationOriginalPspReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DonationOriginalPspReferenceOption { get; private set; } + [DataMember(Name = "donationCampaignId", EmitDefaultValue = false)] + public string DonationCampaignId { get; set; } /// /// PSP reference of the transaction from which the donation token is generated. Required when `donationToken` is provided. /// /// PSP reference of the transaction from which the donation token is generated. Required when `donationToken` is provided. - [JsonPropertyName("donationOriginalPspReference")] - public string DonationOriginalPspReference { get { return this.DonationOriginalPspReferenceOption; } set { this.DonationOriginalPspReferenceOption = new Option(value); } } - - /// - /// Used to track the state of DonationToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DonationTokenOption { get; private set; } + [DataMember(Name = "donationOriginalPspReference", EmitDefaultValue = false)] + public string DonationOriginalPspReference { get; set; } /// /// Donation token received in the `/payments` call. /// /// Donation token received in the `/payments` call. - [JsonPropertyName("donationToken")] - public string DonationToken { get { return this.DonationTokenOption; } set { this.DonationTokenOption = new Option(value); } } - - /// - /// Used to track the state of LineItems - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LineItemsOption { get; private set; } + [DataMember(Name = "donationToken", EmitDefaultValue = false)] + public string DonationToken { get; set; } /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. - [JsonPropertyName("lineItems")] - public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } /// - /// Used to track the state of MerchantRiskIndicator + /// The merchant account identifier, with which you want to process the transaction. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantRiskIndicatorOption { get; private set; } + /// The merchant account identifier, with which you want to process the transaction. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// Gets or Sets MerchantRiskIndicator /// - [JsonPropertyName("merchantRiskIndicator")] - public MerchantRiskIndicator MerchantRiskIndicator { get { return this.MerchantRiskIndicatorOption; } set { this.MerchantRiskIndicatorOption = new Option(value); } } - - /// - /// Used to track the state of Metadata - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> MetadataOption { get; private set; } + [DataMember(Name = "merchantRiskIndicator", EmitDefaultValue = false)] + public MerchantRiskIndicator MerchantRiskIndicator { get; set; } /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. /// /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - [JsonPropertyName("metadata")] - public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } - - /// - /// Used to track the state of MpiData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MpiDataOption { get; private set; } + [DataMember(Name = "metadata", EmitDefaultValue = false)] + public Dictionary Metadata { get; set; } /// /// Gets or Sets MpiData /// - [JsonPropertyName("mpiData")] - public ThreeDSecureData MpiData { get { return this.MpiDataOption; } set { this.MpiDataOption = new Option(value); } } + [DataMember(Name = "mpiData", EmitDefaultValue = false)] + public ThreeDSecureData MpiData { get; set; } /// - /// Used to track the state of Origin + /// > Required for browser-based (`channel` **Web**) 3D Secure 2 transactions.Set this to the origin URL of the page where you are rendering the Drop-in/Component. Do not include subdirectories and a trailing slash. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OriginOption { get; private set; } + /// > Required for browser-based (`channel` **Web**) 3D Secure 2 transactions.Set this to the origin URL of the page where you are rendering the Drop-in/Component. Do not include subdirectories and a trailing slash. + [DataMember(Name = "origin", EmitDefaultValue = false)] + public string Origin { get; set; } /// - /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. - /// - /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. - [JsonPropertyName("origin")] - public string Origin { get { return this.OriginOption; } set { this.OriginOption = new Option(value); } } - - /// - /// Used to track the state of RedirectFromIssuerMethod + /// Gets or Sets PaymentMethod /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RedirectFromIssuerMethodOption { get; private set; } + [DataMember(Name = "paymentMethod", IsRequired = false, EmitDefaultValue = false)] + public DonationPaymentMethod PaymentMethod { get; set; } /// /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. /// /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. - [JsonPropertyName("redirectFromIssuerMethod")] - public string RedirectFromIssuerMethod { get { return this.RedirectFromIssuerMethodOption; } set { this.RedirectFromIssuerMethodOption = new Option(value); } } - - /// - /// Used to track the state of RedirectToIssuerMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RedirectToIssuerMethodOption { get; private set; } + [DataMember(Name = "redirectFromIssuerMethod", EmitDefaultValue = false)] + public string RedirectFromIssuerMethod { get; set; } /// /// Specifies the redirect method (GET or POST) when redirecting to the issuer. /// /// Specifies the redirect method (GET or POST) when redirecting to the issuer. - [JsonPropertyName("redirectToIssuerMethod")] - public string RedirectToIssuerMethod { get { return this.RedirectToIssuerMethodOption; } set { this.RedirectToIssuerMethodOption = new Option(value); } } - - /// - /// Used to track the state of SessionValidity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SessionValidityOption { get; private set; } + [DataMember(Name = "redirectToIssuerMethod", EmitDefaultValue = false)] + public string RedirectToIssuerMethod { get; set; } /// - /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 - /// - /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 - [JsonPropertyName("sessionValidity")] - public string SessionValidity { get { return this.SessionValidityOption; } set { this.SessionValidityOption = new Option(value); } } - - /// - /// Used to track the state of ShopperEmail + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] + public string Reference { get; set; } /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. We strongly recommend that you use a maximum of 1024 characters. > The URL must not include personally identifiable information (PII), for example name or email address. /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. We strongly recommend that you use a maximum of 1024 characters. > The URL must not include personally identifiable information (PII), for example name or email address. + [DataMember(Name = "returnUrl", IsRequired = false, EmitDefaultValue = false)] + public string ReturnUrl { get; set; } /// - /// Used to track the state of ShopperIP + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperIPOption { get; private set; } + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 + [DataMember(Name = "sessionValidity", EmitDefaultValue = false)] + public string SessionValidity { get; set; } /// - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > Required for Visa and JCB transactions that require 3D Secure 2 authentication if you did not include the `telephoneNumber`. /// - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - [JsonPropertyName("shopperIP")] - public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > Required for Visa and JCB transactions that require 3D Secure 2 authentication if you did not include the `telephoneNumber`. + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// - /// Used to track the state of ShopperLocale + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperLocaleOption { get; private set; } + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + [DataMember(Name = "shopperIP", EmitDefaultValue = false)] + public string ShopperIP { get; set; } /// /// The combination of a language code and a country code to specify the language to be used in the payment. /// /// The combination of a language code and a country code to specify the language to be used in the payment. - [JsonPropertyName("shopperLocale")] - public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } - - /// - /// Used to track the state of ShopperName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNameOption { get; private set; } + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + public string ShopperLocale { get; set; } /// /// Gets or Sets ShopperName /// - [JsonPropertyName("shopperName")] - public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } - - /// - /// Used to track the state of ShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperReferenceOption { get; private set; } + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name ShopperName { get; set; } /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - [JsonPropertyName("shopperReference")] - public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of SocialSecurityNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SocialSecurityNumberOption { get; private set; } + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [JsonPropertyName("socialSecurityNumber")] - public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } + [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] + public string SocialSecurityNumber { get; set; } /// - /// Used to track the state of TelephoneNumber + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TelephoneNumberOption { get; private set; } - - /// - /// The shopper's telephone number. - /// - /// The shopper's telephone number. - [JsonPropertyName("telephoneNumber")] - public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2RequestData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2RequestDataOption { get; private set; } + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string TelephoneNumber { get; set; } /// /// Gets or Sets ThreeDS2RequestData /// - [JsonPropertyName("threeDS2RequestData")] - public ThreeDS2RequestFields ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } + [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] + public ThreeDS2RequestFields ThreeDS2RequestData { get; set; } /// - /// Used to track the state of ThreeDSAuthenticationOnly + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSAuthenticationOnlyOption { get; private set; } - - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [JsonPropertyName("threeDSAuthenticationOnly")] - [Obsolete] - public bool? ThreeDSAuthenticationOnly { get { return this.ThreeDSAuthenticationOnlyOption; } set { this.ThreeDSAuthenticationOnlyOption = new Option(value); } } + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorization.Default: **false**. + [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.authenticationOnly` instead.")] + public bool? ThreeDSAuthenticationOnly { get; set; } /// /// Returns the string presentation of the object @@ -931,13 +507,9 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class DonationPaymentRequest {\n"); - sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); - sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" AccountInfo: ").Append(AccountInfo).Append("\n"); sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" AuthenticationData: ").Append(AuthenticationData).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); @@ -955,13 +527,17 @@ public override string ToString() sb.Append(" DonationOriginalPspReference: ").Append(DonationOriginalPspReference).Append("\n"); sb.Append(" DonationToken: ").Append(DonationToken).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantRiskIndicator: ").Append(MerchantRiskIndicator).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append(" MpiData: ").Append(MpiData).Append("\n"); sb.Append(" Origin: ").Append(Origin).Append("\n"); + sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); sb.Append(" RedirectFromIssuerMethod: ").Append(RedirectFromIssuerMethod).Append("\n"); sb.Append(" RedirectToIssuerMethod: ").Append(RedirectToIssuerMethod).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" SessionValidity: ").Append(SessionValidity).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" ShopperIP: ").Append(ShopperIP).Append("\n"); @@ -978,723 +554,466 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // ReturnUrl (string) maxLength - if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) - { - yield return new ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); - } - - // CountryCode (string) maxLength - if (this.CountryCode != null && this.CountryCode.Length > 100) - { - yield return new ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); - } - - // DeviceFingerprint (string) maxLength - if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) - { - yield return new ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); - } - - // Origin (string) maxLength - if (this.Origin != null && this.Origin.Length > 80) - { - yield return new ValidationResult("Invalid value for Origin, length must be less than 80.", new [] { "Origin" }); - } - - // ShopperIP (string) maxLength - if (this.ShopperIP != null && this.ShopperIP.Length > 1000) - { - yield return new ValidationResult("Invalid value for ShopperIP, length must be less than 1000.", new [] { "ShopperIP" }); - } - - // ShopperReference (string) maxLength - if (this.ShopperReference != null && this.ShopperReference.Length > 256) - { - yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); - } - - // ShopperReference (string) minLength - if (this.ShopperReference != null && this.ShopperReference.Length < 3) - { - yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - - /// - /// A Json converter for type - /// - public class DonationPaymentRequestJsonConverter : JsonConverter - { - /// - /// The format to use to serialize DateOfBirth - /// - public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; /// - /// The format to use to serialize DeliverAt + /// Returns true if objects are equal /// - public static string DeliverAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as DonationPaymentRequest); + } /// - /// Deserializes json to + /// Returns true if DonationPaymentRequest instances are equal /// - /// - /// - /// - /// - /// - public override DonationPaymentRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Instance of DonationPaymentRequest to be compared + /// Boolean + public bool Equals(DonationPaymentRequest input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option merchantAccount = default; - Option paymentMethod = default; - Option reference = default; - Option returnUrl = default; - Option accountInfo = default; - Option> additionalData = default; - Option applicationInfo = default; - Option authenticationData = default; - Option billingAddress = default; - Option browserInfo = default; - Option channel = default; - Option checkoutAttemptId = default; - Option conversionId = default; - Option countryCode = default; - Option dateOfBirth = default; - Option deliverAt = default; - Option deliveryAddress = default; - Option deviceFingerprint = default; - Option donationAccount = default; - Option donationCampaignId = default; - Option donationOriginalPspReference = default; - Option donationToken = default; - Option> lineItems = default; - Option merchantRiskIndicator = default; - Option> metadata = default; - Option mpiData = default; - Option origin = default; - Option recurringProcessingModel = default; - Option redirectFromIssuerMethod = default; - Option redirectToIssuerMethod = default; - Option sessionValidity = default; - Option shopperEmail = default; - Option shopperIP = default; - Option shopperInteraction = default; - Option shopperLocale = default; - Option shopperName = default; - Option shopperReference = default; - Option socialSecurityNumber = default; - Option telephoneNumber = default; - Option threeDS2RequestData = default; - Option threeDSAuthenticationOnly = default; - - while (utf8JsonReader.Read()) + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethod": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "returnUrl": - returnUrl = new Option(utf8JsonReader.GetString()); - break; - case "accountInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - accountInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "additionalData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "applicationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "authenticationData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - authenticationData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "billingAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - billingAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "browserInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - browserInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "channel": - string channelRawValue = utf8JsonReader.GetString(); - if (channelRawValue != null) - channel = new Option(DonationPaymentRequest.ChannelEnumFromStringOrDefault(channelRawValue)); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "conversionId": - conversionId = new Option(utf8JsonReader.GetString()); - break; - case "countryCode": - countryCode = new Option(utf8JsonReader.GetString()); - break; - case "dateOfBirth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliverAt": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliverAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliveryAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliveryAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deviceFingerprint": - deviceFingerprint = new Option(utf8JsonReader.GetString()); - break; - case "donationAccount": - donationAccount = new Option(utf8JsonReader.GetString()); - break; - case "donationCampaignId": - donationCampaignId = new Option(utf8JsonReader.GetString()); - break; - case "donationOriginalPspReference": - donationOriginalPspReference = new Option(utf8JsonReader.GetString()); - break; - case "donationToken": - donationToken = new Option(utf8JsonReader.GetString()); - break; - case "lineItems": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantRiskIndicator": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - merchantRiskIndicator = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "metadata": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mpiData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mpiData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "origin": - origin = new Option(utf8JsonReader.GetString()); - break; - case "recurringProcessingModel": - string recurringProcessingModelRawValue = utf8JsonReader.GetString(); - if (recurringProcessingModelRawValue != null) - recurringProcessingModel = new Option(DonationPaymentRequest.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); - break; - case "redirectFromIssuerMethod": - redirectFromIssuerMethod = new Option(utf8JsonReader.GetString()); - break; - case "redirectToIssuerMethod": - redirectToIssuerMethod = new Option(utf8JsonReader.GetString()); - break; - case "sessionValidity": - sessionValidity = new Option(utf8JsonReader.GetString()); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "shopperIP": - shopperIP = new Option(utf8JsonReader.GetString()); - break; - case "shopperInteraction": - string shopperInteractionRawValue = utf8JsonReader.GetString(); - if (shopperInteractionRawValue != null) - shopperInteraction = new Option(DonationPaymentRequest.ShopperInteractionEnumFromStringOrDefault(shopperInteractionRawValue)); - break; - case "shopperLocale": - shopperLocale = new Option(utf8JsonReader.GetString()); - break; - case "shopperName": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperReference": - shopperReference = new Option(utf8JsonReader.GetString()); - break; - case "socialSecurityNumber": - socialSecurityNumber = new Option(utf8JsonReader.GetString()); - break; - case "telephoneNumber": - telephoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2RequestData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDSAuthenticationOnly": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDSAuthenticationOnly = new Option(utf8JsonReader.GetBoolean()); - break; - default: - break; - } - } + return false; } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class DonationPaymentRequest.", nameof(amount)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class DonationPaymentRequest.", nameof(merchantAccount)); - - if (!paymentMethod.IsSet) - throw new ArgumentException("Property is required for class DonationPaymentRequest.", nameof(paymentMethod)); - - if (!reference.IsSet) - throw new ArgumentException("Property is required for class DonationPaymentRequest.", nameof(reference)); - - if (!returnUrl.IsSet) - throw new ArgumentException("Property is required for class DonationPaymentRequest.", nameof(returnUrl)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class DonationPaymentRequest."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class DonationPaymentRequest."); - - if (paymentMethod.IsSet && paymentMethod.Value == null) - throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class DonationPaymentRequest."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class DonationPaymentRequest."); - - if (returnUrl.IsSet && returnUrl.Value == null) - throw new ArgumentNullException(nameof(returnUrl), "Property is not nullable for class DonationPaymentRequest."); - - if (accountInfo.IsSet && accountInfo.Value == null) - throw new ArgumentNullException(nameof(accountInfo), "Property is not nullable for class DonationPaymentRequest."); - - if (additionalData.IsSet && additionalData.Value == null) - throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class DonationPaymentRequest."); - - if (applicationInfo.IsSet && applicationInfo.Value == null) - throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class DonationPaymentRequest."); - - if (authenticationData.IsSet && authenticationData.Value == null) - throw new ArgumentNullException(nameof(authenticationData), "Property is not nullable for class DonationPaymentRequest."); - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class DonationPaymentRequest."); - - if (browserInfo.IsSet && browserInfo.Value == null) - throw new ArgumentNullException(nameof(browserInfo), "Property is not nullable for class DonationPaymentRequest."); - - if (channel.IsSet && channel.Value == null) - throw new ArgumentNullException(nameof(channel), "Property is not nullable for class DonationPaymentRequest."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class DonationPaymentRequest."); - - if (conversionId.IsSet && conversionId.Value == null) - throw new ArgumentNullException(nameof(conversionId), "Property is not nullable for class DonationPaymentRequest."); - - if (countryCode.IsSet && countryCode.Value == null) - throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class DonationPaymentRequest."); - - if (dateOfBirth.IsSet && dateOfBirth.Value == null) - throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class DonationPaymentRequest."); - - if (deliverAt.IsSet && deliverAt.Value == null) - throw new ArgumentNullException(nameof(deliverAt), "Property is not nullable for class DonationPaymentRequest."); - - if (deliveryAddress.IsSet && deliveryAddress.Value == null) - throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class DonationPaymentRequest."); - - if (deviceFingerprint.IsSet && deviceFingerprint.Value == null) - throw new ArgumentNullException(nameof(deviceFingerprint), "Property is not nullable for class DonationPaymentRequest."); - - if (donationAccount.IsSet && donationAccount.Value == null) - throw new ArgumentNullException(nameof(donationAccount), "Property is not nullable for class DonationPaymentRequest."); - - if (donationCampaignId.IsSet && donationCampaignId.Value == null) - throw new ArgumentNullException(nameof(donationCampaignId), "Property is not nullable for class DonationPaymentRequest."); - - if (donationOriginalPspReference.IsSet && donationOriginalPspReference.Value == null) - throw new ArgumentNullException(nameof(donationOriginalPspReference), "Property is not nullable for class DonationPaymentRequest."); - - if (donationToken.IsSet && donationToken.Value == null) - throw new ArgumentNullException(nameof(donationToken), "Property is not nullable for class DonationPaymentRequest."); - - if (lineItems.IsSet && lineItems.Value == null) - throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class DonationPaymentRequest."); - - if (merchantRiskIndicator.IsSet && merchantRiskIndicator.Value == null) - throw new ArgumentNullException(nameof(merchantRiskIndicator), "Property is not nullable for class DonationPaymentRequest."); - - if (metadata.IsSet && metadata.Value == null) - throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class DonationPaymentRequest."); - - if (mpiData.IsSet && mpiData.Value == null) - throw new ArgumentNullException(nameof(mpiData), "Property is not nullable for class DonationPaymentRequest."); - - if (origin.IsSet && origin.Value == null) - throw new ArgumentNullException(nameof(origin), "Property is not nullable for class DonationPaymentRequest."); - - if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) - throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class DonationPaymentRequest."); - - if (redirectFromIssuerMethod.IsSet && redirectFromIssuerMethod.Value == null) - throw new ArgumentNullException(nameof(redirectFromIssuerMethod), "Property is not nullable for class DonationPaymentRequest."); - - if (redirectToIssuerMethod.IsSet && redirectToIssuerMethod.Value == null) - throw new ArgumentNullException(nameof(redirectToIssuerMethod), "Property is not nullable for class DonationPaymentRequest."); - - if (sessionValidity.IsSet && sessionValidity.Value == null) - throw new ArgumentNullException(nameof(sessionValidity), "Property is not nullable for class DonationPaymentRequest."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class DonationPaymentRequest."); - - if (shopperIP.IsSet && shopperIP.Value == null) - throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class DonationPaymentRequest."); - - if (shopperInteraction.IsSet && shopperInteraction.Value == null) - throw new ArgumentNullException(nameof(shopperInteraction), "Property is not nullable for class DonationPaymentRequest."); - - if (shopperLocale.IsSet && shopperLocale.Value == null) - throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class DonationPaymentRequest."); - - if (shopperName.IsSet && shopperName.Value == null) - throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class DonationPaymentRequest."); - - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class DonationPaymentRequest."); - - if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) - throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class DonationPaymentRequest."); - - if (telephoneNumber.IsSet && telephoneNumber.Value == null) - throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class DonationPaymentRequest."); - - if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) - throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class DonationPaymentRequest."); - - if (threeDSAuthenticationOnly.IsSet && threeDSAuthenticationOnly.Value == null) - throw new ArgumentNullException(nameof(threeDSAuthenticationOnly), "Property is not nullable for class DonationPaymentRequest."); - - return new DonationPaymentRequest(amount.Value, merchantAccount.Value, paymentMethod.Value, reference.Value, returnUrl.Value, accountInfo, additionalData, applicationInfo, authenticationData, billingAddress, browserInfo, channel, checkoutAttemptId, conversionId, countryCode, dateOfBirth, deliverAt, deliveryAddress, deviceFingerprint, donationAccount, donationCampaignId, donationOriginalPspReference, donationToken, lineItems, merchantRiskIndicator, metadata, mpiData, origin, recurringProcessingModel, redirectFromIssuerMethod, redirectToIssuerMethod, sessionValidity, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, socialSecurityNumber, telephoneNumber, threeDS2RequestData, threeDSAuthenticationOnly); + return + ( + this.AccountInfo == input.AccountInfo || + (this.AccountInfo != null && + this.AccountInfo.Equals(input.AccountInfo)) + ) && + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + input.AdditionalData != null && + this.AdditionalData.SequenceEqual(input.AdditionalData) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.ApplicationInfo == input.ApplicationInfo || + (this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo)) + ) && + ( + this.AuthenticationData == input.AuthenticationData || + (this.AuthenticationData != null && + this.AuthenticationData.Equals(input.AuthenticationData)) + ) && + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.BrowserInfo == input.BrowserInfo || + (this.BrowserInfo != null && + this.BrowserInfo.Equals(input.BrowserInfo)) + ) && + ( + this.Channel == input.Channel || + this.Channel.Equals(input.Channel) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.ConversionId == input.ConversionId || + (this.ConversionId != null && + this.ConversionId.Equals(input.ConversionId)) + ) && + ( + this.CountryCode == input.CountryCode || + (this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode)) + ) && + ( + this.DateOfBirth == input.DateOfBirth || + (this.DateOfBirth != null && + this.DateOfBirth.Equals(input.DateOfBirth)) + ) && + ( + this.DeliverAt == input.DeliverAt || + (this.DeliverAt != null && + this.DeliverAt.Equals(input.DeliverAt)) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + (this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress)) + ) && + ( + this.DeviceFingerprint == input.DeviceFingerprint || + (this.DeviceFingerprint != null && + this.DeviceFingerprint.Equals(input.DeviceFingerprint)) + ) && + ( + this.DonationAccount == input.DonationAccount || + (this.DonationAccount != null && + this.DonationAccount.Equals(input.DonationAccount)) + ) && + ( + this.DonationCampaignId == input.DonationCampaignId || + (this.DonationCampaignId != null && + this.DonationCampaignId.Equals(input.DonationCampaignId)) + ) && + ( + this.DonationOriginalPspReference == input.DonationOriginalPspReference || + (this.DonationOriginalPspReference != null && + this.DonationOriginalPspReference.Equals(input.DonationOriginalPspReference)) + ) && + ( + this.DonationToken == input.DonationToken || + (this.DonationToken != null && + this.DonationToken.Equals(input.DonationToken)) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.MerchantRiskIndicator == input.MerchantRiskIndicator || + (this.MerchantRiskIndicator != null && + this.MerchantRiskIndicator.Equals(input.MerchantRiskIndicator)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.MpiData == input.MpiData || + (this.MpiData != null && + this.MpiData.Equals(input.MpiData)) + ) && + ( + this.Origin == input.Origin || + (this.Origin != null && + this.Origin.Equals(input.Origin)) + ) && + ( + this.PaymentMethod == input.PaymentMethod || + (this.PaymentMethod != null && + this.PaymentMethod.Equals(input.PaymentMethod)) + ) && + ( + this.RecurringProcessingModel == input.RecurringProcessingModel || + this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) + ) && + ( + this.RedirectFromIssuerMethod == input.RedirectFromIssuerMethod || + (this.RedirectFromIssuerMethod != null && + this.RedirectFromIssuerMethod.Equals(input.RedirectFromIssuerMethod)) + ) && + ( + this.RedirectToIssuerMethod == input.RedirectToIssuerMethod || + (this.RedirectToIssuerMethod != null && + this.RedirectToIssuerMethod.Equals(input.RedirectToIssuerMethod)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.ReturnUrl == input.ReturnUrl || + (this.ReturnUrl != null && + this.ReturnUrl.Equals(input.ReturnUrl)) + ) && + ( + this.SessionValidity == input.SessionValidity || + (this.SessionValidity != null && + this.SessionValidity.Equals(input.SessionValidity)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.ShopperIP == input.ShopperIP || + (this.ShopperIP != null && + this.ShopperIP.Equals(input.ShopperIP)) + ) && + ( + this.ShopperInteraction == input.ShopperInteraction || + this.ShopperInteraction.Equals(input.ShopperInteraction) + ) && + ( + this.ShopperLocale == input.ShopperLocale || + (this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale)) + ) && + ( + this.ShopperName == input.ShopperName || + (this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName)) + ) && + ( + this.ShopperReference == input.ShopperReference || + (this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference)) + ) && + ( + this.SocialSecurityNumber == input.SocialSecurityNumber || + (this.SocialSecurityNumber != null && + this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + (this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber)) + ) && + ( + this.ThreeDS2RequestData == input.ThreeDS2RequestData || + (this.ThreeDS2RequestData != null && + this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) + ) && + ( + this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || + this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DonationPaymentRequest donationPaymentRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, donationPaymentRequest, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AccountInfo != null) + { + hashCode = (hashCode * 59) + this.AccountInfo.GetHashCode(); + } + if (this.AdditionalData != null) + { + hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.ApplicationInfo != null) + { + hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); + } + if (this.AuthenticationData != null) + { + hashCode = (hashCode * 59) + this.AuthenticationData.GetHashCode(); + } + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.BrowserInfo != null) + { + hashCode = (hashCode * 59) + this.BrowserInfo.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Channel.GetHashCode(); + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.ConversionId != null) + { + hashCode = (hashCode * 59) + this.ConversionId.GetHashCode(); + } + if (this.CountryCode != null) + { + hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); + } + if (this.DateOfBirth != null) + { + hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); + } + if (this.DeliverAt != null) + { + hashCode = (hashCode * 59) + this.DeliverAt.GetHashCode(); + } + if (this.DeliveryAddress != null) + { + hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); + } + if (this.DeviceFingerprint != null) + { + hashCode = (hashCode * 59) + this.DeviceFingerprint.GetHashCode(); + } + if (this.DonationAccount != null) + { + hashCode = (hashCode * 59) + this.DonationAccount.GetHashCode(); + } + if (this.DonationCampaignId != null) + { + hashCode = (hashCode * 59) + this.DonationCampaignId.GetHashCode(); + } + if (this.DonationOriginalPspReference != null) + { + hashCode = (hashCode * 59) + this.DonationOriginalPspReference.GetHashCode(); + } + if (this.DonationToken != null) + { + hashCode = (hashCode * 59) + this.DonationToken.GetHashCode(); + } + if (this.LineItems != null) + { + hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.MerchantRiskIndicator != null) + { + hashCode = (hashCode * 59) + this.MerchantRiskIndicator.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + if (this.MpiData != null) + { + hashCode = (hashCode * 59) + this.MpiData.GetHashCode(); + } + if (this.Origin != null) + { + hashCode = (hashCode * 59) + this.Origin.GetHashCode(); + } + if (this.PaymentMethod != null) + { + hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); + if (this.RedirectFromIssuerMethod != null) + { + hashCode = (hashCode * 59) + this.RedirectFromIssuerMethod.GetHashCode(); + } + if (this.RedirectToIssuerMethod != null) + { + hashCode = (hashCode * 59) + this.RedirectToIssuerMethod.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.ReturnUrl != null) + { + hashCode = (hashCode * 59) + this.ReturnUrl.GetHashCode(); + } + if (this.SessionValidity != null) + { + hashCode = (hashCode * 59) + this.SessionValidity.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.ShopperIP != null) + { + hashCode = (hashCode * 59) + this.ShopperIP.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ShopperInteraction.GetHashCode(); + if (this.ShopperLocale != null) + { + hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); + } + if (this.ShopperName != null) + { + hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); + } + if (this.ShopperReference != null) + { + hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); + } + if (this.SocialSecurityNumber != null) + { + hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); + } + if (this.TelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); + } + if (this.ThreeDS2RequestData != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ThreeDSAuthenticationOnly.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, DonationPaymentRequest donationPaymentRequest, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (donationPaymentRequest.Amount == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.Amount), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.MerchantAccount), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.PaymentMethod == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.PaymentMethod), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.Reference == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.Reference), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.ReturnUrl == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.ReturnUrl), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.AccountInfoOption.IsSet && donationPaymentRequest.AccountInfo == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.AccountInfo), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.AdditionalDataOption.IsSet && donationPaymentRequest.AdditionalData == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.AdditionalData), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.ApplicationInfoOption.IsSet && donationPaymentRequest.ApplicationInfo == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.ApplicationInfo), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.AuthenticationDataOption.IsSet && donationPaymentRequest.AuthenticationData == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.AuthenticationData), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.BillingAddressOption.IsSet && donationPaymentRequest.BillingAddress == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.BillingAddress), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.BrowserInfoOption.IsSet && donationPaymentRequest.BrowserInfo == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.BrowserInfo), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.CheckoutAttemptIdOption.IsSet && donationPaymentRequest.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.CheckoutAttemptId), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.ConversionIdOption.IsSet && donationPaymentRequest.ConversionId == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.ConversionId), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.CountryCodeOption.IsSet && donationPaymentRequest.CountryCode == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.CountryCode), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.DeliveryAddressOption.IsSet && donationPaymentRequest.DeliveryAddress == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.DeliveryAddress), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.DeviceFingerprintOption.IsSet && donationPaymentRequest.DeviceFingerprint == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.DeviceFingerprint), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.DonationAccountOption.IsSet && donationPaymentRequest.DonationAccount == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.DonationAccount), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.DonationCampaignIdOption.IsSet && donationPaymentRequest.DonationCampaignId == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.DonationCampaignId), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.DonationOriginalPspReferenceOption.IsSet && donationPaymentRequest.DonationOriginalPspReference == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.DonationOriginalPspReference), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.DonationTokenOption.IsSet && donationPaymentRequest.DonationToken == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.DonationToken), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.LineItemsOption.IsSet && donationPaymentRequest.LineItems == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.LineItems), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.MerchantRiskIndicatorOption.IsSet && donationPaymentRequest.MerchantRiskIndicator == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.MerchantRiskIndicator), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.MetadataOption.IsSet && donationPaymentRequest.Metadata == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.Metadata), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.MpiDataOption.IsSet && donationPaymentRequest.MpiData == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.MpiData), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.OriginOption.IsSet && donationPaymentRequest.Origin == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.Origin), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.RedirectFromIssuerMethodOption.IsSet && donationPaymentRequest.RedirectFromIssuerMethod == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.RedirectFromIssuerMethod), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.RedirectToIssuerMethodOption.IsSet && donationPaymentRequest.RedirectToIssuerMethod == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.RedirectToIssuerMethod), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.SessionValidityOption.IsSet && donationPaymentRequest.SessionValidity == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.SessionValidity), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.ShopperEmailOption.IsSet && donationPaymentRequest.ShopperEmail == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.ShopperEmail), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.ShopperIPOption.IsSet && donationPaymentRequest.ShopperIP == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.ShopperIP), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.ShopperLocaleOption.IsSet && donationPaymentRequest.ShopperLocale == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.ShopperLocale), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.ShopperNameOption.IsSet && donationPaymentRequest.ShopperName == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.ShopperName), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.ShopperReferenceOption.IsSet && donationPaymentRequest.ShopperReference == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.ShopperReference), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.SocialSecurityNumberOption.IsSet && donationPaymentRequest.SocialSecurityNumber == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.SocialSecurityNumber), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.TelephoneNumberOption.IsSet && donationPaymentRequest.TelephoneNumber == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.TelephoneNumber), "Property is required for class DonationPaymentRequest."); - - if (donationPaymentRequest.ThreeDS2RequestDataOption.IsSet && donationPaymentRequest.ThreeDS2RequestData == null) - throw new ArgumentNullException(nameof(donationPaymentRequest.ThreeDS2RequestData), "Property is required for class DonationPaymentRequest."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, donationPaymentRequest.Amount, jsonSerializerOptions); - writer.WriteString("merchantAccount", donationPaymentRequest.MerchantAccount); - - writer.WritePropertyName("paymentMethod"); - JsonSerializer.Serialize(writer, donationPaymentRequest.PaymentMethod, jsonSerializerOptions); - writer.WriteString("reference", donationPaymentRequest.Reference); - - writer.WriteString("returnUrl", donationPaymentRequest.ReturnUrl); - - if (donationPaymentRequest.AccountInfoOption.IsSet) - { - writer.WritePropertyName("accountInfo"); - JsonSerializer.Serialize(writer, donationPaymentRequest.AccountInfo, jsonSerializerOptions); - } - if (donationPaymentRequest.AdditionalDataOption.IsSet) - { - writer.WritePropertyName("additionalData"); - JsonSerializer.Serialize(writer, donationPaymentRequest.AdditionalData, jsonSerializerOptions); - } - if (donationPaymentRequest.ApplicationInfoOption.IsSet) - { - writer.WritePropertyName("applicationInfo"); - JsonSerializer.Serialize(writer, donationPaymentRequest.ApplicationInfo, jsonSerializerOptions); - } - if (donationPaymentRequest.AuthenticationDataOption.IsSet) - { - writer.WritePropertyName("authenticationData"); - JsonSerializer.Serialize(writer, donationPaymentRequest.AuthenticationData, jsonSerializerOptions); - } - if (donationPaymentRequest.BillingAddressOption.IsSet) - { - writer.WritePropertyName("billingAddress"); - JsonSerializer.Serialize(writer, donationPaymentRequest.BillingAddress, jsonSerializerOptions); - } - if (donationPaymentRequest.BrowserInfoOption.IsSet) + // CountryCode (string) maxLength + if (this.CountryCode != null && this.CountryCode.Length > 100) { - writer.WritePropertyName("browserInfo"); - JsonSerializer.Serialize(writer, donationPaymentRequest.BrowserInfo, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); } - var channelRawValue = DonationPaymentRequest.ChannelEnumToJsonValue(donationPaymentRequest.ChannelOption.Value.Value); - writer.WriteString("channel", channelRawValue); - if (donationPaymentRequest.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", donationPaymentRequest.CheckoutAttemptId); - - if (donationPaymentRequest.ConversionIdOption.IsSet) - writer.WriteString("conversionId", donationPaymentRequest.ConversionId); - - if (donationPaymentRequest.CountryCodeOption.IsSet) - writer.WriteString("countryCode", donationPaymentRequest.CountryCode); - if (donationPaymentRequest.DateOfBirthOption.IsSet) - writer.WriteString("dateOfBirth", donationPaymentRequest.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); - - if (donationPaymentRequest.DeliverAtOption.IsSet) - writer.WriteString("deliverAt", donationPaymentRequest.DeliverAtOption.Value.Value.ToString(DeliverAtFormat)); - - if (donationPaymentRequest.DeliveryAddressOption.IsSet) + // DeviceFingerprint (string) maxLength + if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) { - writer.WritePropertyName("deliveryAddress"); - JsonSerializer.Serialize(writer, donationPaymentRequest.DeliveryAddress, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); } - if (donationPaymentRequest.DeviceFingerprintOption.IsSet) - writer.WriteString("deviceFingerprint", donationPaymentRequest.DeviceFingerprint); - - if (donationPaymentRequest.DonationAccountOption.IsSet) - writer.WriteString("donationAccount", donationPaymentRequest.DonationAccount); - - if (donationPaymentRequest.DonationCampaignIdOption.IsSet) - writer.WriteString("donationCampaignId", donationPaymentRequest.DonationCampaignId); - - if (donationPaymentRequest.DonationOriginalPspReferenceOption.IsSet) - writer.WriteString("donationOriginalPspReference", donationPaymentRequest.DonationOriginalPspReference); - if (donationPaymentRequest.DonationTokenOption.IsSet) - writer.WriteString("donationToken", donationPaymentRequest.DonationToken); - - if (donationPaymentRequest.LineItemsOption.IsSet) - { - writer.WritePropertyName("lineItems"); - JsonSerializer.Serialize(writer, donationPaymentRequest.LineItems, jsonSerializerOptions); - } - if (donationPaymentRequest.MerchantRiskIndicatorOption.IsSet) + // Origin (string) maxLength + if (this.Origin != null && this.Origin.Length > 80) { - writer.WritePropertyName("merchantRiskIndicator"); - JsonSerializer.Serialize(writer, donationPaymentRequest.MerchantRiskIndicator, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, length must be less than 80.", new [] { "Origin" }); } - if (donationPaymentRequest.MetadataOption.IsSet) + + // ReturnUrl (string) maxLength + if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) { - writer.WritePropertyName("metadata"); - JsonSerializer.Serialize(writer, donationPaymentRequest.Metadata, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); } - if (donationPaymentRequest.MpiDataOption.IsSet) + + // ShopperIP (string) maxLength + if (this.ShopperIP != null && this.ShopperIP.Length > 1000) { - writer.WritePropertyName("mpiData"); - JsonSerializer.Serialize(writer, donationPaymentRequest.MpiData, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperIP, length must be less than 1000.", new [] { "ShopperIP" }); } - if (donationPaymentRequest.OriginOption.IsSet) - writer.WriteString("origin", donationPaymentRequest.Origin); - var recurringProcessingModelRawValue = DonationPaymentRequest.RecurringProcessingModelEnumToJsonValue(donationPaymentRequest.RecurringProcessingModelOption.Value.Value); - writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); - if (donationPaymentRequest.RedirectFromIssuerMethodOption.IsSet) - writer.WriteString("redirectFromIssuerMethod", donationPaymentRequest.RedirectFromIssuerMethod); - - if (donationPaymentRequest.RedirectToIssuerMethodOption.IsSet) - writer.WriteString("redirectToIssuerMethod", donationPaymentRequest.RedirectToIssuerMethod); - - if (donationPaymentRequest.SessionValidityOption.IsSet) - writer.WriteString("sessionValidity", donationPaymentRequest.SessionValidity); - - if (donationPaymentRequest.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", donationPaymentRequest.ShopperEmail); - - if (donationPaymentRequest.ShopperIPOption.IsSet) - writer.WriteString("shopperIP", donationPaymentRequest.ShopperIP); - - var shopperInteractionRawValue = DonationPaymentRequest.ShopperInteractionEnumToJsonValue(donationPaymentRequest.ShopperInteractionOption.Value.Value); - writer.WriteString("shopperInteraction", shopperInteractionRawValue); - if (donationPaymentRequest.ShopperLocaleOption.IsSet) - writer.WriteString("shopperLocale", donationPaymentRequest.ShopperLocale); - - if (donationPaymentRequest.ShopperNameOption.IsSet) + // ShopperReference (string) maxLength + if (this.ShopperReference != null && this.ShopperReference.Length > 256) { - writer.WritePropertyName("shopperName"); - JsonSerializer.Serialize(writer, donationPaymentRequest.ShopperName, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); } - if (donationPaymentRequest.ShopperReferenceOption.IsSet) - writer.WriteString("shopperReference", donationPaymentRequest.ShopperReference); - if (donationPaymentRequest.SocialSecurityNumberOption.IsSet) - writer.WriteString("socialSecurityNumber", donationPaymentRequest.SocialSecurityNumber); - - if (donationPaymentRequest.TelephoneNumberOption.IsSet) - writer.WriteString("telephoneNumber", donationPaymentRequest.TelephoneNumber); - - if (donationPaymentRequest.ThreeDS2RequestDataOption.IsSet) + // ShopperReference (string) minLength + if (this.ShopperReference != null && this.ShopperReference.Length < 3) { - writer.WritePropertyName("threeDS2RequestData"); - JsonSerializer.Serialize(writer, donationPaymentRequest.ThreeDS2RequestData, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); } - if (donationPaymentRequest.ThreeDSAuthenticationOnlyOption.IsSet) - writer.WriteBoolean("threeDSAuthenticationOnly", donationPaymentRequest.ThreeDSAuthenticationOnlyOption.Value.Value); + + yield break; } } + } diff --git a/Adyen/Model/Checkout/DonationPaymentResponse.cs b/Adyen/Model/Checkout/DonationPaymentResponse.cs index 52f70bc3e..66364902b 100644 --- a/Adyen/Model/Checkout/DonationPaymentResponse.cs +++ b/Adyen/Model/Checkout/DonationPaymentResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,221 +15,117 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// DonationPaymentResponse /// - public partial class DonationPaymentResponse : IValidatableObject + [DataContract(Name = "DonationPaymentResponse")] + public partial class DonationPaymentResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The Adyen account name of your charity. We will provide you with this account name once your chosen charity has been [onboarded](https://docs.adyen.com/online-payments/donations#onboarding). - /// Your unique resource identifier. - /// The merchant account identifier, with which you want to process the transaction. - /// payment - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - /// The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** - [JsonConstructor] - public DonationPaymentResponse(Option amount = default, Option donationAccount = default, Option id = default, Option merchantAccount = default, Option payment = default, Option reference = default, Option status = default) - { - AmountOption = amount; - DonationAccountOption = donationAccount; - IdOption = id; - MerchantAccountOption = merchantAccount; - PaymentOption = payment; - ReferenceOption = reference; - StatusOption = status; - OnCreated(); - } - - partial void OnCreated(); - /// /// The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** /// /// The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** + [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Completed for value: completed /// + [EnumMember(Value = "completed")] Completed = 1, /// /// Enum Pending for value: pending /// + [EnumMember(Value = "pending")] Pending = 2, /// /// Enum Refused for value: refused /// + [EnumMember(Value = "refused")] Refused = 3 - } - /// - /// Returns a - /// - /// - /// - /// - public static StatusEnum StatusEnumFromString(string value) - { - if (value.Equals("completed")) - return StatusEnum.Completed; - - if (value.Equals("pending")) - return StatusEnum.Pending; - - if (value.Equals("refused")) - return StatusEnum.Refused; - - throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static StatusEnum? StatusEnumFromStringOrDefault(string value) - { - if (value.Equals("completed")) - return StatusEnum.Completed; - - if (value.Equals("pending")) - return StatusEnum.Pending; - - if (value.Equals("refused")) - return StatusEnum.Refused; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string StatusEnumToJsonValue(StatusEnum? value) - { - if (value == StatusEnum.Completed) - return "completed"; - - if (value == StatusEnum.Pending) - return "pending"; - - if (value == StatusEnum.Refused) - return "refused"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Status - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StatusOption { get; private set; } /// /// The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** /// /// The status of the donation transaction. Possible values: * **completed** * **pending** * **refused** - [JsonPropertyName("status")] - public StatusEnum? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } - + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } /// - /// Used to track the state of Amount + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountOption { get; private set; } + /// amount. + /// The Adyen account name of your charity. We will provide you with this account name once your chosen charity has been [onboarded](https://docs.adyen.com/online-payments/donations#onboarding).. + /// Your unique resource identifier.. + /// The merchant account identifier, with which you want to process the transaction.. + /// payment. + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.. + /// The status of the donation transaction. Possible values: * **completed** * **pending** * **refused**. + public DonationPaymentResponse(Amount amount = default(Amount), string donationAccount = default(string), string id = default(string), string merchantAccount = default(string), PaymentResponse payment = default(PaymentResponse), string reference = default(string), StatusEnum? status = default(StatusEnum?)) + { + this.Amount = amount; + this.DonationAccount = donationAccount; + this.Id = id; + this.MerchantAccount = merchantAccount; + this.Payment = payment; + this.Reference = reference; + this.Status = status; + } /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] - public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } - - /// - /// Used to track the state of DonationAccount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DonationAccountOption { get; private set; } + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// The Adyen account name of your charity. We will provide you with this account name once your chosen charity has been [onboarded](https://docs.adyen.com/online-payments/donations#onboarding). /// /// The Adyen account name of your charity. We will provide you with this account name once your chosen charity has been [onboarded](https://docs.adyen.com/online-payments/donations#onboarding). - [JsonPropertyName("donationAccount")] - public string DonationAccount { get { return this.DonationAccountOption; } set { this.DonationAccountOption = new Option(value); } } - - /// - /// Used to track the state of Id - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IdOption { get; private set; } + [DataMember(Name = "donationAccount", EmitDefaultValue = false)] + public string DonationAccount { get; set; } /// /// Your unique resource identifier. /// /// Your unique resource identifier. - [JsonPropertyName("id")] - public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } - - /// - /// Used to track the state of MerchantAccount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantAccountOption { get; private set; } + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } /// /// The merchant account identifier, with which you want to process the transaction. /// /// The merchant account identifier, with which you want to process the transaction. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get { return this.MerchantAccountOption; } set { this.MerchantAccountOption = new Option(value); } } - - /// - /// Used to track the state of Payment - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentOption { get; private set; } + [DataMember(Name = "merchantAccount", EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// Gets or Sets Payment /// - [JsonPropertyName("payment")] - public PaymentResponse Payment { get { return this.PaymentOption; } set { this.PaymentOption = new Option(value); } } - - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + [DataMember(Name = "payment", EmitDefaultValue = false)] + public PaymentResponse Payment { get; set; } /// /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. /// /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Returns the string presentation of the object @@ -250,182 +147,118 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class DonationPaymentResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override DonationPaymentResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option donationAccount = default; - Option id = default; - Option merchantAccount = default; - Option payment = default; - Option reference = default; - Option status = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "donationAccount": - donationAccount = new Option(utf8JsonReader.GetString()); - break; - case "id": - id = new Option(utf8JsonReader.GetString()); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "payment": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - payment = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "status": - string statusRawValue = utf8JsonReader.GetString(); - if (statusRawValue != null) - status = new Option(DonationPaymentResponse.StatusEnumFromStringOrDefault(statusRawValue)); - break; - default: - break; - } - } - } - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class DonationPaymentResponse."); - - if (donationAccount.IsSet && donationAccount.Value == null) - throw new ArgumentNullException(nameof(donationAccount), "Property is not nullable for class DonationPaymentResponse."); - - if (id.IsSet && id.Value == null) - throw new ArgumentNullException(nameof(id), "Property is not nullable for class DonationPaymentResponse."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class DonationPaymentResponse."); - - if (payment.IsSet && payment.Value == null) - throw new ArgumentNullException(nameof(payment), "Property is not nullable for class DonationPaymentResponse."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class DonationPaymentResponse."); - - if (status.IsSet && status.Value == null) - throw new ArgumentNullException(nameof(status), "Property is not nullable for class DonationPaymentResponse."); - - return new DonationPaymentResponse(amount, donationAccount, id, merchantAccount, payment, reference, status); + return this.Equals(input as DonationPaymentResponse); } /// - /// Serializes a + /// Returns true if DonationPaymentResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DonationPaymentResponse donationPaymentResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of DonationPaymentResponse to be compared + /// Boolean + public bool Equals(DonationPaymentResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, donationPaymentResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.DonationAccount == input.DonationAccount || + (this.DonationAccount != null && + this.DonationAccount.Equals(input.DonationAccount)) + ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.Payment == input.Payment || + (this.Payment != null && + this.Payment.Equals(input.Payment)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, DonationPaymentResponse donationPaymentResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (donationPaymentResponse.AmountOption.IsSet && donationPaymentResponse.Amount == null) - throw new ArgumentNullException(nameof(donationPaymentResponse.Amount), "Property is required for class DonationPaymentResponse."); - - if (donationPaymentResponse.DonationAccountOption.IsSet && donationPaymentResponse.DonationAccount == null) - throw new ArgumentNullException(nameof(donationPaymentResponse.DonationAccount), "Property is required for class DonationPaymentResponse."); - - if (donationPaymentResponse.IdOption.IsSet && donationPaymentResponse.Id == null) - throw new ArgumentNullException(nameof(donationPaymentResponse.Id), "Property is required for class DonationPaymentResponse."); - - if (donationPaymentResponse.MerchantAccountOption.IsSet && donationPaymentResponse.MerchantAccount == null) - throw new ArgumentNullException(nameof(donationPaymentResponse.MerchantAccount), "Property is required for class DonationPaymentResponse."); - - if (donationPaymentResponse.PaymentOption.IsSet && donationPaymentResponse.Payment == null) - throw new ArgumentNullException(nameof(donationPaymentResponse.Payment), "Property is required for class DonationPaymentResponse."); - - if (donationPaymentResponse.ReferenceOption.IsSet && donationPaymentResponse.Reference == null) - throw new ArgumentNullException(nameof(donationPaymentResponse.Reference), "Property is required for class DonationPaymentResponse."); - - if (donationPaymentResponse.AmountOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, donationPaymentResponse.Amount, jsonSerializerOptions); - } - if (donationPaymentResponse.DonationAccountOption.IsSet) - writer.WriteString("donationAccount", donationPaymentResponse.DonationAccount); - - if (donationPaymentResponse.IdOption.IsSet) - writer.WriteString("id", donationPaymentResponse.Id); - - if (donationPaymentResponse.MerchantAccountOption.IsSet) - writer.WriteString("merchantAccount", donationPaymentResponse.MerchantAccount); - - if (donationPaymentResponse.PaymentOption.IsSet) - { - writer.WritePropertyName("payment"); - JsonSerializer.Serialize(writer, donationPaymentResponse.Payment, jsonSerializerOptions); + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.DonationAccount != null) + { + hashCode = (hashCode * 59) + this.DonationAccount.GetHashCode(); + } + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.Payment != null) + { + hashCode = (hashCode * 59) + this.Payment.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + return hashCode; } - if (donationPaymentResponse.ReferenceOption.IsSet) - writer.WriteString("reference", donationPaymentResponse.Reference); - - var statusRawValue = DonationPaymentResponse.StatusEnumToJsonValue(donationPaymentResponse.StatusOption.Value.Value); - writer.WriteString("status", statusRawValue); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/DragonpayDetails.cs b/Adyen/Model/Checkout/DragonpayDetails.cs index 6b5a391c9..a0392b39d 100644 --- a/Adyen/Model/Checkout/DragonpayDetails.cs +++ b/Adyen/Model/Checkout/DragonpayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,175 +15,103 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// DragonpayDetails /// - public partial class DragonpayDetails : IValidatableObject + [DataContract(Name = "DragonpayDetails")] + public partial class DragonpayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The Dragonpay issuer value of the shopper's selected bank. Set this to an **id** of a Dragonpay issuer to preselect it. - /// **dragonpay** - /// The checkout attempt identifier. - /// The shopper’s email address. - [JsonConstructor] - public DragonpayDetails(string issuer, TypeEnum type, Option checkoutAttemptId = default, Option shopperEmail = default) - { - Issuer = issuer; - Type = type; - CheckoutAttemptIdOption = checkoutAttemptId; - ShopperEmailOption = shopperEmail; - OnCreated(); - } - - partial void OnCreated(); - /// /// **dragonpay** /// /// **dragonpay** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// - /// Enum DragonpayEbanking for value: dragonpay_ebanking + /// Enum Ebanking for value: dragonpay_ebanking /// - DragonpayEbanking = 1, + [EnumMember(Value = "dragonpay_ebanking")] + Ebanking = 1, /// - /// Enum DragonpayOtcBanking for value: dragonpay_otc_banking + /// Enum OtcBanking for value: dragonpay_otc_banking /// - DragonpayOtcBanking = 2, + [EnumMember(Value = "dragonpay_otc_banking")] + OtcBanking = 2, /// - /// Enum DragonpayOtcNonBanking for value: dragonpay_otc_non_banking + /// Enum OtcNonBanking for value: dragonpay_otc_non_banking /// - DragonpayOtcNonBanking = 3, + [EnumMember(Value = "dragonpay_otc_non_banking")] + OtcNonBanking = 3, /// - /// Enum DragonpayOtcPhilippines for value: dragonpay_otc_philippines + /// Enum OtcPhilippines for value: dragonpay_otc_philippines /// - DragonpayOtcPhilippines = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("dragonpay_ebanking")) - return TypeEnum.DragonpayEbanking; - - if (value.Equals("dragonpay_otc_banking")) - return TypeEnum.DragonpayOtcBanking; - - if (value.Equals("dragonpay_otc_non_banking")) - return TypeEnum.DragonpayOtcNonBanking; - - if (value.Equals("dragonpay_otc_philippines")) - return TypeEnum.DragonpayOtcPhilippines; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("dragonpay_ebanking")) - return TypeEnum.DragonpayEbanking; - - if (value.Equals("dragonpay_otc_banking")) - return TypeEnum.DragonpayOtcBanking; - - if (value.Equals("dragonpay_otc_non_banking")) - return TypeEnum.DragonpayOtcNonBanking; - - if (value.Equals("dragonpay_otc_philippines")) - return TypeEnum.DragonpayOtcPhilippines; + [EnumMember(Value = "dragonpay_otc_philippines")] + OtcPhilippines = 4 - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.DragonpayEbanking) - return "dragonpay_ebanking"; - - if (value == TypeEnum.DragonpayOtcBanking) - return "dragonpay_otc_banking"; - - if (value == TypeEnum.DragonpayOtcNonBanking) - return "dragonpay_otc_non_banking"; - - if (value == TypeEnum.DragonpayOtcPhilippines) - return "dragonpay_otc_philippines"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **dragonpay** /// /// **dragonpay** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// The Dragonpay issuer value of the shopper's selected bank. Set this to an **id** of a Dragonpay issuer to preselect it. + /// Initializes a new instance of the class. /// - /// The Dragonpay issuer value of the shopper's selected bank. Set this to an **id** of a Dragonpay issuer to preselect it. - [JsonPropertyName("issuer")] - public string Issuer { get; set; } - + [JsonConstructorAttribute] + protected DragonpayDetails() { } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// The Dragonpay issuer value of the shopper's selected bank. Set this to an **id** of a Dragonpay issuer to preselect it. (required). + /// The shopper’s email address.. + /// **dragonpay** (required). + public DragonpayDetails(string checkoutAttemptId = default(string), string issuer = default(string), string shopperEmail = default(string), TypeEnum type = default(TypeEnum)) + { + this.Issuer = issuer; + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; + this.ShopperEmail = shopperEmail; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// - /// Used to track the state of ShopperEmail + /// The Dragonpay issuer value of the shopper's selected bank. Set this to an **id** of a Dragonpay issuer to preselect it. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + /// The Dragonpay issuer value of the shopper's selected bank. Set this to an **id** of a Dragonpay issuer to preselect it. + [DataMember(Name = "issuer", IsRequired = false, EmitDefaultValue = false)] + public string Issuer { get; set; } /// /// The shopper’s email address. /// /// The shopper’s email address. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// /// Returns the string presentation of the object @@ -192,150 +121,100 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class DragonpayDetails {\n"); - sb.Append(" Issuer: ").Append(Issuer).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); + sb.Append(" Issuer: ").Append(Issuer).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class DragonpayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override DragonpayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option issuer = default; - Option type = default; - Option checkoutAttemptId = default; - Option shopperEmail = default; + return this.Equals(input as DragonpayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if DragonpayDetails instances are equal + /// + /// Instance of DragonpayDetails to be compared + /// Boolean + public bool Equals(DragonpayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "issuer": - issuer = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(DragonpayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!issuer.IsSet) - throw new ArgumentException("Property is required for class DragonpayDetails.", nameof(issuer)); - - if (!type.IsSet) - throw new ArgumentException("Property is required for class DragonpayDetails.", nameof(type)); - - if (issuer.IsSet && issuer.Value == null) - throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class DragonpayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class DragonpayDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class DragonpayDetails."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class DragonpayDetails."); - - return new DragonpayDetails(issuer.Value, type.Value.Value, checkoutAttemptId, shopperEmail); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Issuer == input.Issuer || + (this.Issuer != null && + this.Issuer.Equals(input.Issuer)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DragonpayDetails dragonpayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, dragonpayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.Issuer != null) + { + hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, DragonpayDetails dragonpayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (dragonpayDetails.Issuer == null) - throw new ArgumentNullException(nameof(dragonpayDetails.Issuer), "Property is required for class DragonpayDetails."); - - if (dragonpayDetails.CheckoutAttemptIdOption.IsSet && dragonpayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(dragonpayDetails.CheckoutAttemptId), "Property is required for class DragonpayDetails."); - - if (dragonpayDetails.ShopperEmailOption.IsSet && dragonpayDetails.ShopperEmail == null) - throw new ArgumentNullException(nameof(dragonpayDetails.ShopperEmail), "Property is required for class DragonpayDetails."); - - writer.WriteString("issuer", dragonpayDetails.Issuer); - - var typeRawValue = DragonpayDetails.TypeEnumToJsonValue(dragonpayDetails.Type); - writer.WriteString("type", typeRawValue); - if (dragonpayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", dragonpayDetails.CheckoutAttemptId); - - if (dragonpayDetails.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", dragonpayDetails.ShopperEmail); + yield break; } } + } diff --git a/Adyen/Model/Checkout/EBankingFinlandDetails.cs b/Adyen/Model/Checkout/EBankingFinlandDetails.cs index e90572bf0..1bd64ad57 100644 --- a/Adyen/Model/Checkout/EBankingFinlandDetails.cs +++ b/Adyen/Model/Checkout/EBankingFinlandDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,124 +15,76 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// EBankingFinlandDetails /// - public partial class EBankingFinlandDetails : IValidatableObject + [DataContract(Name = "EBankingFinlandDetails")] + public partial class EBankingFinlandDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// The Ebanking Finland issuer value of the shopper's selected bank. - /// **ebanking_FI** (default to TypeEnum.EbankingFI) - [JsonConstructor] - public EBankingFinlandDetails(Option checkoutAttemptId = default, Option issuer = default, TypeEnum type = TypeEnum.EbankingFI) - { - CheckoutAttemptIdOption = checkoutAttemptId; - IssuerOption = issuer; - Type = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **ebanking_FI** /// /// **ebanking_FI** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum EbankingFI for value: ebanking_FI /// + [EnumMember(Value = "ebanking_FI")] EbankingFI = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("ebanking_FI")) - return TypeEnum.EbankingFI; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("ebanking_FI")) - return TypeEnum.EbankingFI; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.EbankingFI) - return "ebanking_FI"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **ebanking_FI** /// /// **ebanking_FI** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - + [JsonConstructorAttribute] + protected EBankingFinlandDetails() { } /// - /// The checkout attempt identifier. + /// Initializes a new instance of the class. /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + /// The checkout attempt identifier.. + /// The Ebanking Finland issuer value of the shopper's selected bank.. + /// **ebanking_FI** (required) (default to TypeEnum.EbankingFI). + public EBankingFinlandDetails(string checkoutAttemptId = default(string), string issuer = default(string), TypeEnum type = TypeEnum.EbankingFI) + { + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; + this.Issuer = issuer; + } /// - /// Used to track the state of Issuer + /// The checkout attempt identifier. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IssuerOption { get; private set; } + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The Ebanking Finland issuer value of the shopper's selected bank. /// /// The Ebanking Finland issuer value of the shopper's selected bank. - [JsonPropertyName("issuer")] - public string Issuer { get { return this.IssuerOption; } set { this.IssuerOption = new Option(value); } } + [DataMember(Name = "issuer", EmitDefaultValue = false)] + public string Issuer { get; set; } /// /// Returns the string presentation of the object @@ -149,127 +102,82 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class EBankingFinlandDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override EBankingFinlandDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option issuer = default; - Option type = default; + return this.Equals(input as EBankingFinlandDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if EBankingFinlandDetails instances are equal + /// + /// Instance of EBankingFinlandDetails to be compared + /// Boolean + public bool Equals(EBankingFinlandDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "issuer": - issuer = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(EBankingFinlandDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class EBankingFinlandDetails.", nameof(type)); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class EBankingFinlandDetails."); - - if (issuer.IsSet && issuer.Value == null) - throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class EBankingFinlandDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class EBankingFinlandDetails."); - - return new EBankingFinlandDetails(checkoutAttemptId, issuer, type.Value.Value); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Issuer == input.Issuer || + (this.Issuer != null && + this.Issuer.Equals(input.Issuer)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, EBankingFinlandDetails eBankingFinlandDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, eBankingFinlandDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.Issuer != null) + { + hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, EBankingFinlandDetails eBankingFinlandDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (eBankingFinlandDetails.CheckoutAttemptIdOption.IsSet && eBankingFinlandDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(eBankingFinlandDetails.CheckoutAttemptId), "Property is required for class EBankingFinlandDetails."); - - if (eBankingFinlandDetails.IssuerOption.IsSet && eBankingFinlandDetails.Issuer == null) - throw new ArgumentNullException(nameof(eBankingFinlandDetails.Issuer), "Property is required for class EBankingFinlandDetails."); - - if (eBankingFinlandDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", eBankingFinlandDetails.CheckoutAttemptId); - - if (eBankingFinlandDetails.IssuerOption.IsSet) - writer.WriteString("issuer", eBankingFinlandDetails.Issuer); - - var typeRawValue = EBankingFinlandDetails.TypeEnumToJsonValue(eBankingFinlandDetails.Type); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/EcontextVoucherDetails.cs b/Adyen/Model/Checkout/EcontextVoucherDetails.cs index 5f0f7d44d..4365ff260 100644 --- a/Adyen/Model/Checkout/EcontextVoucherDetails.cs +++ b/Adyen/Model/Checkout/EcontextVoucherDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,201 +15,128 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// EcontextVoucherDetails /// - public partial class EcontextVoucherDetails : IValidatableObject + [DataContract(Name = "EcontextVoucherDetails")] + public partial class EcontextVoucherDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The shopper's first name. - /// The shopper's last name. - /// The shopper's email. - /// The shopper's contact number. It must have an international number format, for example **+31 20 779 1846**. Formats like **+31 (0)20 779 1846** or **0031 20 779 1846** are not accepted. - /// **econtextvoucher** - /// The checkout attempt identifier. - [JsonConstructor] - public EcontextVoucherDetails(string firstName, string lastName, string shopperEmail, string telephoneNumber, TypeEnum type, Option checkoutAttemptId = default) - { - FirstName = firstName; - LastName = lastName; - ShopperEmail = shopperEmail; - TelephoneNumber = telephoneNumber; - Type = type; - CheckoutAttemptIdOption = checkoutAttemptId; - OnCreated(); - } - - partial void OnCreated(); - /// /// **econtextvoucher** /// /// **econtextvoucher** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum EcontextSevenEleven for value: econtext_seven_eleven /// + [EnumMember(Value = "econtext_seven_eleven")] EcontextSevenEleven = 1, /// /// Enum EcontextOnline for value: econtext_online /// + [EnumMember(Value = "econtext_online")] EcontextOnline = 2, /// /// Enum Econtext for value: econtext /// + [EnumMember(Value = "econtext")] Econtext = 3, /// /// Enum EcontextStores for value: econtext_stores /// + [EnumMember(Value = "econtext_stores")] EcontextStores = 4, /// /// Enum EcontextAtm for value: econtext_atm /// + [EnumMember(Value = "econtext_atm")] EcontextAtm = 5 + } + /// - /// Returns a + /// **econtextvoucher** /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("econtext_seven_eleven")) - return TypeEnum.EcontextSevenEleven; - - if (value.Equals("econtext_online")) - return TypeEnum.EcontextOnline; - - if (value.Equals("econtext")) - return TypeEnum.Econtext; - - if (value.Equals("econtext_stores")) - return TypeEnum.EcontextStores; - - if (value.Equals("econtext_atm")) - return TypeEnum.EcontextAtm; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - + /// **econtextvoucher** + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + public TypeEnum Type { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("econtext_seven_eleven")) - return TypeEnum.EcontextSevenEleven; - - if (value.Equals("econtext_online")) - return TypeEnum.EcontextOnline; - - if (value.Equals("econtext")) - return TypeEnum.Econtext; - - if (value.Equals("econtext_stores")) - return TypeEnum.EcontextStores; - - if (value.Equals("econtext_atm")) - return TypeEnum.EcontextAtm; - - return null; - } - + [JsonConstructorAttribute] + protected EcontextVoucherDetails() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) + /// The checkout attempt identifier.. + /// The shopper's first name. (required). + /// The shopper's last name. (required). + /// The shopper's email. (required). + /// The shopper's contact number. It must have an international number format, for example **+31 20 779 1846**. Formats like **+31 (0)20 779 1846** or **0031 20 779 1846** are not accepted. (required). + /// **econtextvoucher** (required). + public EcontextVoucherDetails(string checkoutAttemptId = default(string), string firstName = default(string), string lastName = default(string), string shopperEmail = default(string), string telephoneNumber = default(string), TypeEnum type = default(TypeEnum)) { - if (value == TypeEnum.EcontextSevenEleven) - return "econtext_seven_eleven"; - - if (value == TypeEnum.EcontextOnline) - return "econtext_online"; - - if (value == TypeEnum.Econtext) - return "econtext"; - - if (value == TypeEnum.EcontextStores) - return "econtext_stores"; - - if (value == TypeEnum.EcontextAtm) - return "econtext_atm"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.FirstName = firstName; + this.LastName = lastName; + this.ShopperEmail = shopperEmail; + this.TelephoneNumber = telephoneNumber; + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; } /// - /// **econtextvoucher** + /// The checkout attempt identifier. /// - /// **econtextvoucher** - [JsonPropertyName("type")] - public TypeEnum Type { get; set; } + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The shopper's first name. /// /// The shopper's first name. - [JsonPropertyName("firstName")] + [DataMember(Name = "firstName", IsRequired = false, EmitDefaultValue = false)] public string FirstName { get; set; } /// /// The shopper's last name. /// /// The shopper's last name. - [JsonPropertyName("lastName")] + [DataMember(Name = "lastName", IsRequired = false, EmitDefaultValue = false)] public string LastName { get; set; } /// /// The shopper's email. /// /// The shopper's email. - [JsonPropertyName("shopperEmail")] + [DataMember(Name = "shopperEmail", IsRequired = false, EmitDefaultValue = false)] public string ShopperEmail { get; set; } /// /// The shopper's contact number. It must have an international number format, for example **+31 20 779 1846**. Formats like **+31 (0)20 779 1846** or **0031 20 779 1846** are not accepted. /// /// The shopper's contact number. It must have an international number format, for example **+31 20 779 1846**. Formats like **+31 (0)20 779 1846** or **0031 20 779 1846** are not accepted. - [JsonPropertyName("telephoneNumber")] + [DataMember(Name = "telephoneNumber", IsRequired = false, EmitDefaultValue = false)] public string TelephoneNumber { get; set; } - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - - /// - /// The checkout attempt identifier. - /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - /// /// Returns the string presentation of the object /// @@ -217,184 +145,120 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class EcontextVoucherDetails {\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FirstName: ").Append(FirstName).Append("\n"); sb.Append(" LastName: ").Append(LastName).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class EcontextVoucherDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override EcontextVoucherDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option firstName = default; - Option lastName = default; - Option shopperEmail = default; - Option telephoneNumber = default; - Option type = default; - Option checkoutAttemptId = default; + return this.Equals(input as EcontextVoucherDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if EcontextVoucherDetails instances are equal + /// + /// Instance of EcontextVoucherDetails to be compared + /// Boolean + public bool Equals(EcontextVoucherDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "firstName": - firstName = new Option(utf8JsonReader.GetString()); - break; - case "lastName": - lastName = new Option(utf8JsonReader.GetString()); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "telephoneNumber": - telephoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(EcontextVoucherDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!firstName.IsSet) - throw new ArgumentException("Property is required for class EcontextVoucherDetails.", nameof(firstName)); - - if (!lastName.IsSet) - throw new ArgumentException("Property is required for class EcontextVoucherDetails.", nameof(lastName)); - - if (!shopperEmail.IsSet) - throw new ArgumentException("Property is required for class EcontextVoucherDetails.", nameof(shopperEmail)); - - if (!telephoneNumber.IsSet) - throw new ArgumentException("Property is required for class EcontextVoucherDetails.", nameof(telephoneNumber)); - - if (!type.IsSet) - throw new ArgumentException("Property is required for class EcontextVoucherDetails.", nameof(type)); - - if (firstName.IsSet && firstName.Value == null) - throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class EcontextVoucherDetails."); - - if (lastName.IsSet && lastName.Value == null) - throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class EcontextVoucherDetails."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class EcontextVoucherDetails."); - - if (telephoneNumber.IsSet && telephoneNumber.Value == null) - throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class EcontextVoucherDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class EcontextVoucherDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class EcontextVoucherDetails."); - - return new EcontextVoucherDetails(firstName.Value, lastName.Value, shopperEmail.Value, telephoneNumber.Value, type.Value.Value, checkoutAttemptId); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.FirstName == input.FirstName || + (this.FirstName != null && + this.FirstName.Equals(input.FirstName)) + ) && + ( + this.LastName == input.LastName || + (this.LastName != null && + this.LastName.Equals(input.LastName)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + (this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, EcontextVoucherDetails econtextVoucherDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, econtextVoucherDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.FirstName != null) + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } + if (this.LastName != null) + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.TelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, EcontextVoucherDetails econtextVoucherDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (econtextVoucherDetails.FirstName == null) - throw new ArgumentNullException(nameof(econtextVoucherDetails.FirstName), "Property is required for class EcontextVoucherDetails."); - - if (econtextVoucherDetails.LastName == null) - throw new ArgumentNullException(nameof(econtextVoucherDetails.LastName), "Property is required for class EcontextVoucherDetails."); - - if (econtextVoucherDetails.ShopperEmail == null) - throw new ArgumentNullException(nameof(econtextVoucherDetails.ShopperEmail), "Property is required for class EcontextVoucherDetails."); - - if (econtextVoucherDetails.TelephoneNumber == null) - throw new ArgumentNullException(nameof(econtextVoucherDetails.TelephoneNumber), "Property is required for class EcontextVoucherDetails."); - - if (econtextVoucherDetails.CheckoutAttemptIdOption.IsSet && econtextVoucherDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(econtextVoucherDetails.CheckoutAttemptId), "Property is required for class EcontextVoucherDetails."); - - writer.WriteString("firstName", econtextVoucherDetails.FirstName); - - writer.WriteString("lastName", econtextVoucherDetails.LastName); - - writer.WriteString("shopperEmail", econtextVoucherDetails.ShopperEmail); - - writer.WriteString("telephoneNumber", econtextVoucherDetails.TelephoneNumber); - - var typeRawValue = EcontextVoucherDetails.TypeEnumToJsonValue(econtextVoucherDetails.Type); - writer.WriteString("type", typeRawValue); - if (econtextVoucherDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", econtextVoucherDetails.CheckoutAttemptId); + yield break; } } + } diff --git a/Adyen/Model/Checkout/EftDetails.cs b/Adyen/Model/Checkout/EftDetails.cs index 5bf29e533..326b7600f 100644 --- a/Adyen/Model/Checkout/EftDetails.cs +++ b/Adyen/Model/Checkout/EftDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,212 +15,117 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// EftDetails /// - public partial class EftDetails : IValidatableObject + [DataContract(Name = "EftDetails")] + public partial class EftDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The bank account number (without separators). - /// The financial institution code. - /// The bank routing number of the account. - /// The checkout attempt identifier. - /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **eft** (default to TypeEnum.EftDirectdebitCA) - [JsonConstructor] - public EftDetails(Option bankAccountNumber = default, Option bankCode = default, Option bankLocationId = default, Option checkoutAttemptId = default, Option ownerName = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - BankAccountNumberOption = bankAccountNumber; - BankCodeOption = bankCode; - BankLocationIdOption = bankLocationId; - CheckoutAttemptIdOption = checkoutAttemptId; - OwnerNameOption = ownerName; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **eft** /// /// **eft** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum EftDirectdebitCA for value: eft_directdebit_CA /// + [EnumMember(Value = "eft_directdebit_CA")] EftDirectdebitCA = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("eft_directdebit_CA")) - return TypeEnum.EftDirectdebitCA; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("eft_directdebit_CA")) - return TypeEnum.EftDirectdebitCA; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.EftDirectdebitCA) - return "eft_directdebit_CA"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **eft** /// /// **eft** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of BankAccountNumber + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankAccountNumberOption { get; private set; } + /// The bank account number (without separators).. + /// The financial institution code.. + /// The bank routing number of the account.. + /// The checkout attempt identifier.. + /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **eft** (default to TypeEnum.EftDirectdebitCA). + public EftDetails(string bankAccountNumber = default(string), string bankCode = default(string), string bankLocationId = default(string), string checkoutAttemptId = default(string), string ownerName = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.EftDirectdebitCA) + { + this.BankAccountNumber = bankAccountNumber; + this.BankCode = bankCode; + this.BankLocationId = bankLocationId; + this.CheckoutAttemptId = checkoutAttemptId; + this.OwnerName = ownerName; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The bank account number (without separators). /// /// The bank account number (without separators). - [JsonPropertyName("bankAccountNumber")] - public string BankAccountNumber { get { return this.BankAccountNumberOption; } set { this.BankAccountNumberOption = new Option(value); } } - - /// - /// Used to track the state of BankCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankCodeOption { get; private set; } + [DataMember(Name = "bankAccountNumber", EmitDefaultValue = false)] + public string BankAccountNumber { get; set; } /// /// The financial institution code. /// /// The financial institution code. - [JsonPropertyName("bankCode")] - public string BankCode { get { return this.BankCodeOption; } set { this.BankCodeOption = new Option(value); } } - - /// - /// Used to track the state of BankLocationId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankLocationIdOption { get; private set; } + [DataMember(Name = "bankCode", EmitDefaultValue = false)] + public string BankCode { get; set; } /// /// The bank routing number of the account. /// /// The bank routing number of the account. - [JsonPropertyName("bankLocationId")] - public string BankLocationId { get { return this.BankLocationIdOption; } set { this.BankLocationIdOption = new Option(value); } } - - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + [DataMember(Name = "bankLocationId", EmitDefaultValue = false)] + public string BankLocationId { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of OwnerName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OwnerNameOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. /// /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. - [JsonPropertyName("ownerName")] - public string OwnerName { get { return this.OwnerNameOption; } set { this.OwnerNameOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "ownerName", EmitDefaultValue = false)] + public string OwnerName { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -242,195 +148,133 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class EftDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override EftDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option bankAccountNumber = default; - Option bankCode = default; - Option bankLocationId = default; - Option checkoutAttemptId = default; - Option ownerName = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as EftDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if EftDetails instances are equal + /// + /// Instance of EftDetails to be compared + /// Boolean + public bool Equals(EftDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "bankAccountNumber": - bankAccountNumber = new Option(utf8JsonReader.GetString()); - break; - case "bankCode": - bankCode = new Option(utf8JsonReader.GetString()); - break; - case "bankLocationId": - bankLocationId = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "ownerName": - ownerName = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(EftDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (bankAccountNumber.IsSet && bankAccountNumber.Value == null) - throw new ArgumentNullException(nameof(bankAccountNumber), "Property is not nullable for class EftDetails."); - - if (bankCode.IsSet && bankCode.Value == null) - throw new ArgumentNullException(nameof(bankCode), "Property is not nullable for class EftDetails."); - - if (bankLocationId.IsSet && bankLocationId.Value == null) - throw new ArgumentNullException(nameof(bankLocationId), "Property is not nullable for class EftDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class EftDetails."); - - if (ownerName.IsSet && ownerName.Value == null) - throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class EftDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class EftDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class EftDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class EftDetails."); - - return new EftDetails(bankAccountNumber, bankCode, bankLocationId, checkoutAttemptId, ownerName, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.BankAccountNumber == input.BankAccountNumber || + (this.BankAccountNumber != null && + this.BankAccountNumber.Equals(input.BankAccountNumber)) + ) && + ( + this.BankCode == input.BankCode || + (this.BankCode != null && + this.BankCode.Equals(input.BankCode)) + ) && + ( + this.BankLocationId == input.BankLocationId || + (this.BankLocationId != null && + this.BankLocationId.Equals(input.BankLocationId)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.OwnerName == input.OwnerName || + (this.OwnerName != null && + this.OwnerName.Equals(input.OwnerName)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, EftDetails eftDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, eftDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.BankAccountNumber != null) + { + hashCode = (hashCode * 59) + this.BankAccountNumber.GetHashCode(); + } + if (this.BankCode != null) + { + hashCode = (hashCode * 59) + this.BankCode.GetHashCode(); + } + if (this.BankLocationId != null) + { + hashCode = (hashCode * 59) + this.BankLocationId.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.OwnerName != null) + { + hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, EftDetails eftDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (eftDetails.BankAccountNumberOption.IsSet && eftDetails.BankAccountNumber == null) - throw new ArgumentNullException(nameof(eftDetails.BankAccountNumber), "Property is required for class EftDetails."); - - if (eftDetails.BankCodeOption.IsSet && eftDetails.BankCode == null) - throw new ArgumentNullException(nameof(eftDetails.BankCode), "Property is required for class EftDetails."); - - if (eftDetails.BankLocationIdOption.IsSet && eftDetails.BankLocationId == null) - throw new ArgumentNullException(nameof(eftDetails.BankLocationId), "Property is required for class EftDetails."); - - if (eftDetails.CheckoutAttemptIdOption.IsSet && eftDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(eftDetails.CheckoutAttemptId), "Property is required for class EftDetails."); - - if (eftDetails.OwnerNameOption.IsSet && eftDetails.OwnerName == null) - throw new ArgumentNullException(nameof(eftDetails.OwnerName), "Property is required for class EftDetails."); - - if (eftDetails.RecurringDetailReferenceOption.IsSet && eftDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(eftDetails.RecurringDetailReference), "Property is required for class EftDetails."); - - if (eftDetails.StoredPaymentMethodIdOption.IsSet && eftDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(eftDetails.StoredPaymentMethodId), "Property is required for class EftDetails."); - - if (eftDetails.BankAccountNumberOption.IsSet) - writer.WriteString("bankAccountNumber", eftDetails.BankAccountNumber); - - if (eftDetails.BankCodeOption.IsSet) - writer.WriteString("bankCode", eftDetails.BankCode); - - if (eftDetails.BankLocationIdOption.IsSet) - writer.WriteString("bankLocationId", eftDetails.BankLocationId); - - if (eftDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", eftDetails.CheckoutAttemptId); - - if (eftDetails.OwnerNameOption.IsSet) - writer.WriteString("ownerName", eftDetails.OwnerName); - - if (eftDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", eftDetails.RecurringDetailReference); - - if (eftDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", eftDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = EftDetails.TypeEnumToJsonValue(eftDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/EncryptedOrderData.cs b/Adyen/Model/Checkout/EncryptedOrderData.cs index 0466d0841..0f73d11a0 100644 --- a/Adyen/Model/Checkout/EncryptedOrderData.cs +++ b/Adyen/Model/Checkout/EncryptedOrderData.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,47 +15,51 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// EncryptedOrderData /// - public partial class EncryptedOrderData : IValidatableObject + [DataContract(Name = "EncryptedOrderData")] + public partial class EncryptedOrderData : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The encrypted order data. - /// The `pspReference` that belongs to the order. - [JsonConstructor] - public EncryptedOrderData(string orderData, string pspReference) + [JsonConstructorAttribute] + protected EncryptedOrderData() { } + /// + /// Initializes a new instance of the class. + /// + /// The encrypted order data. (required). + /// The `pspReference` that belongs to the order. (required). + public EncryptedOrderData(string orderData = default(string), string pspReference = default(string)) { - OrderData = orderData; - PspReference = pspReference; - OnCreated(); + this.OrderData = orderData; + this.PspReference = pspReference; } - partial void OnCreated(); - /// /// The encrypted order data. /// /// The encrypted order data. - [JsonPropertyName("orderData")] + [DataMember(Name = "orderData", IsRequired = false, EmitDefaultValue = false)] public string OrderData { get; set; } /// /// The `pspReference` that belongs to the order. /// /// The `pspReference` that belongs to the order. - [JsonPropertyName("pspReference")] + [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] public string PspReference { get; set; } /// @@ -72,122 +77,83 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // OrderData (string) maxLength - if (this.OrderData != null && this.OrderData.Length > 5000) - { - yield return new ValidationResult("Invalid value for OrderData, length must be less than 5000.", new [] { "OrderData" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class EncryptedOrderDataJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override EncryptedOrderData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option orderData = default; - Option pspReference = default; + return this.Equals(input as EncryptedOrderData); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if EncryptedOrderData instances are equal + /// + /// Instance of EncryptedOrderData to be compared + /// Boolean + public bool Equals(EncryptedOrderData input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "orderData": - orderData = new Option(utf8JsonReader.GetString()); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!orderData.IsSet) - throw new ArgumentException("Property is required for class EncryptedOrderData.", nameof(orderData)); - - if (!pspReference.IsSet) - throw new ArgumentException("Property is required for class EncryptedOrderData.", nameof(pspReference)); - - if (orderData.IsSet && orderData.Value == null) - throw new ArgumentNullException(nameof(orderData), "Property is not nullable for class EncryptedOrderData."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class EncryptedOrderData."); - - return new EncryptedOrderData(orderData.Value, pspReference.Value); + return + ( + this.OrderData == input.OrderData || + (this.OrderData != null && + this.OrderData.Equals(input.OrderData)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, EncryptedOrderData encryptedOrderData, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, encryptedOrderData, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.OrderData != null) + { + hashCode = (hashCode * 59) + this.OrderData.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, EncryptedOrderData encryptedOrderData, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (encryptedOrderData.OrderData == null) - throw new ArgumentNullException(nameof(encryptedOrderData.OrderData), "Property is required for class EncryptedOrderData."); - - if (encryptedOrderData.PspReference == null) - throw new ArgumentNullException(nameof(encryptedOrderData.PspReference), "Property is required for class EncryptedOrderData."); - - writer.WriteString("orderData", encryptedOrderData.OrderData); + // OrderData (string) maxLength + if (this.OrderData != null && this.OrderData.Length > 5000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for OrderData, length must be less than 5000.", new [] { "OrderData" }); + } - writer.WriteString("pspReference", encryptedOrderData.PspReference); + yield break; } } + } diff --git a/Adyen/Model/Checkout/EnhancedSchemeData.cs b/Adyen/Model/Checkout/EnhancedSchemeData.cs index a339c8882..9a272d4c1 100644 --- a/Adyen/Model/Checkout/EnhancedSchemeData.cs +++ b/Adyen/Model/Checkout/EnhancedSchemeData.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,45 +15,37 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// EnhancedSchemeData /// - public partial class EnhancedSchemeData : IValidatableObject + [DataContract(Name = "EnhancedSchemeData")] + public partial class EnhancedSchemeData : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// airline - [JsonConstructor] - public EnhancedSchemeData(Option airline = default) + /// airline. + public EnhancedSchemeData(Airline airline = default(Airline)) { - AirlineOption = airline; - OnCreated(); + this.Airline = airline; } - partial void OnCreated(); - - /// - /// Used to track the state of Airline - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AirlineOption { get; private set; } - /// /// Gets or Sets Airline /// - [JsonPropertyName("airline")] - public Airline Airline { get { return this.AirlineOption; } set { this.AirlineOption = new Option(value); } } + [DataMember(Name = "airline", EmitDefaultValue = false)] + public Airline Airline { get; set; } /// /// Returns the string presentation of the object @@ -68,103 +61,68 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class EnhancedSchemeDataJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override EnhancedSchemeData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option airline = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "airline": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - airline = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (airline.IsSet && airline.Value == null) - throw new ArgumentNullException(nameof(airline), "Property is not nullable for class EnhancedSchemeData."); - - return new EnhancedSchemeData(airline); + return this.Equals(input as EnhancedSchemeData); } /// - /// Serializes a + /// Returns true if EnhancedSchemeData instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, EnhancedSchemeData enhancedSchemeData, JsonSerializerOptions jsonSerializerOptions) + /// Instance of EnhancedSchemeData to be compared + /// Boolean + public bool Equals(EnhancedSchemeData input) { - writer.WriteStartObject(); - - WriteProperties(writer, enhancedSchemeData, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Airline == input.Airline || + (this.Airline != null && + this.Airline.Equals(input.Airline)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, EnhancedSchemeData enhancedSchemeData, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (enhancedSchemeData.AirlineOption.IsSet && enhancedSchemeData.Airline == null) - throw new ArgumentNullException(nameof(enhancedSchemeData.Airline), "Property is required for class EnhancedSchemeData."); - - if (enhancedSchemeData.AirlineOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("airline"); - JsonSerializer.Serialize(writer, enhancedSchemeData.Airline, jsonSerializerOptions); + int hashCode = 41; + if (this.Airline != null) + { + hashCode = (hashCode * 59) + this.Airline.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/ExternalPlatform.cs b/Adyen/Model/Checkout/ExternalPlatform.cs index 7b791bc5a..755539a78 100644 --- a/Adyen/Model/Checkout/ExternalPlatform.cs +++ b/Adyen/Model/Checkout/ExternalPlatform.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,78 +15,56 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ExternalPlatform /// - public partial class ExternalPlatform : IValidatableObject + [DataContract(Name = "ExternalPlatform")] + public partial class ExternalPlatform : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// External platform integrator. - /// Name of the field. For example, Name of External Platform. - /// Version of the field. For example, Version of External Platform. - [JsonConstructor] - public ExternalPlatform(Option integrator = default, Option name = default, Option varVersion = default) + /// External platform integrator.. + /// Name of the field. For example, Name of External Platform.. + /// Version of the field. For example, Version of External Platform.. + public ExternalPlatform(string integrator = default(string), string name = default(string), string version = default(string)) { - IntegratorOption = integrator; - NameOption = name; - VarVersionOption = varVersion; - OnCreated(); + this.Integrator = integrator; + this.Name = name; + this.Version = version; } - partial void OnCreated(); - - /// - /// Used to track the state of Integrator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IntegratorOption { get; private set; } - /// /// External platform integrator. /// /// External platform integrator. - [JsonPropertyName("integrator")] - public string Integrator { get { return this.IntegratorOption; } set { this.IntegratorOption = new Option(value); } } - - /// - /// Used to track the state of Name - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NameOption { get; private set; } + [DataMember(Name = "integrator", EmitDefaultValue = false)] + public string Integrator { get; set; } /// /// Name of the field. For example, Name of External Platform. /// /// Name of the field. For example, Name of External Platform. - [JsonPropertyName("name")] - public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } - - /// - /// Used to track the state of VarVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option VarVersionOption { get; private set; } + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } /// /// Version of the field. For example, Version of External Platform. /// /// Version of the field. For example, Version of External Platform. - [JsonPropertyName("version")] - public string VarVersion { get { return this.VarVersionOption; } set { this.VarVersionOption = new Option(value); } } + [DataMember(Name = "version", EmitDefaultValue = false)] + public string Version { get; set; } /// /// Returns the string presentation of the object @@ -97,131 +76,92 @@ public override string ToString() sb.Append("class ExternalPlatform {\n"); sb.Append(" Integrator: ").Append(Integrator).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" VarVersion: ").Append(VarVersion).Append("\n"); + sb.Append(" Version: ").Append(Version).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ExternalPlatformJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ExternalPlatform Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option integrator = default; - Option name = default; - Option varVersion = default; + return this.Equals(input as ExternalPlatform); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ExternalPlatform instances are equal + /// + /// Instance of ExternalPlatform to be compared + /// Boolean + public bool Equals(ExternalPlatform input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "integrator": - integrator = new Option(utf8JsonReader.GetString()); - break; - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - case "version": - varVersion = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (integrator.IsSet && integrator.Value == null) - throw new ArgumentNullException(nameof(integrator), "Property is not nullable for class ExternalPlatform."); - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class ExternalPlatform."); - - if (varVersion.IsSet && varVersion.Value == null) - throw new ArgumentNullException(nameof(varVersion), "Property is not nullable for class ExternalPlatform."); - - return new ExternalPlatform(integrator, name, varVersion); + return + ( + this.Integrator == input.Integrator || + (this.Integrator != null && + this.Integrator.Equals(input.Integrator)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Version == input.Version || + (this.Version != null && + this.Version.Equals(input.Version)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ExternalPlatform externalPlatform, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, externalPlatform, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Integrator != null) + { + hashCode = (hashCode * 59) + this.Integrator.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.Version != null) + { + hashCode = (hashCode * 59) + this.Version.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ExternalPlatform externalPlatform, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (externalPlatform.IntegratorOption.IsSet && externalPlatform.Integrator == null) - throw new ArgumentNullException(nameof(externalPlatform.Integrator), "Property is required for class ExternalPlatform."); - - if (externalPlatform.NameOption.IsSet && externalPlatform.Name == null) - throw new ArgumentNullException(nameof(externalPlatform.Name), "Property is required for class ExternalPlatform."); - - if (externalPlatform.VarVersionOption.IsSet && externalPlatform.VarVersion == null) - throw new ArgumentNullException(nameof(externalPlatform.VarVersion), "Property is required for class ExternalPlatform."); - - if (externalPlatform.IntegratorOption.IsSet) - writer.WriteString("integrator", externalPlatform.Integrator); - - if (externalPlatform.NameOption.IsSet) - writer.WriteString("name", externalPlatform.Name); - - if (externalPlatform.VarVersionOption.IsSet) - writer.WriteString("version", externalPlatform.VarVersion); + yield break; } } + } diff --git a/Adyen/Model/Checkout/FastlaneDetails.cs b/Adyen/Model/Checkout/FastlaneDetails.cs index 808b1e1e8..4eb2cce34 100644 --- a/Adyen/Model/Checkout/FastlaneDetails.cs +++ b/Adyen/Model/Checkout/FastlaneDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,150 +15,95 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// FastlaneDetails /// - public partial class FastlaneDetails : IValidatableObject + [DataContract(Name = "FastlaneDetails")] + public partial class FastlaneDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The encoded fastlane data blob - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **fastlane** (default to TypeEnum.Fastlane) - [JsonConstructor] - public FastlaneDetails(string fastlaneData, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.Fastlane) - { - FastlaneData = fastlaneData; - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - Type = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **fastlane** /// /// **fastlane** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Fastlane for value: fastlane /// + [EnumMember(Value = "fastlane")] Fastlane = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("fastlane")) - return TypeEnum.Fastlane; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("fastlane")) - return TypeEnum.Fastlane; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.Fastlane) - return "fastlane"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **fastlane** /// /// **fastlane** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// The encoded fastlane data blob + /// Initializes a new instance of the class. /// - /// The encoded fastlane data blob - [JsonPropertyName("fastlaneData")] - public string FastlaneData { get; set; } - + [JsonConstructorAttribute] + protected FastlaneDetails() { } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// The encoded fastlane data blob (required). + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **fastlane** (required) (default to TypeEnum.Fastlane). + public FastlaneDetails(string checkoutAttemptId = default(string), string fastlaneData = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.Fastlane) + { + this.FastlaneData = fastlaneData; + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// - /// Used to track the state of RecurringDetailReference + /// The encoded fastlane data blob /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + /// The encoded fastlane data blob + [DataMember(Name = "fastlaneData", IsRequired = false, EmitDefaultValue = false)] + public string FastlaneData { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -167,8 +113,8 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class FastlaneDetails {\n"); - sb.Append(" FastlaneData: ").Append(FastlaneData).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); + sb.Append(" FastlaneData: ").Append(FastlaneData).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -177,161 +123,106 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class FastlaneDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override FastlaneDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option fastlaneData = default; - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as FastlaneDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if FastlaneDetails instances are equal + /// + /// Instance of FastlaneDetails to be compared + /// Boolean + public bool Equals(FastlaneDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "fastlaneData": - fastlaneData = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(FastlaneDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!fastlaneData.IsSet) - throw new ArgumentException("Property is required for class FastlaneDetails.", nameof(fastlaneData)); - - if (!type.IsSet) - throw new ArgumentException("Property is required for class FastlaneDetails.", nameof(type)); - - if (fastlaneData.IsSet && fastlaneData.Value == null) - throw new ArgumentNullException(nameof(fastlaneData), "Property is not nullable for class FastlaneDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class FastlaneDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class FastlaneDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class FastlaneDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class FastlaneDetails."); - - return new FastlaneDetails(fastlaneData.Value, checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type.Value.Value); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.FastlaneData == input.FastlaneData || + (this.FastlaneData != null && + this.FastlaneData.Equals(input.FastlaneData)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, FastlaneDetails fastlaneDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, fastlaneDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.FastlaneData != null) + { + hashCode = (hashCode * 59) + this.FastlaneData.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, FastlaneDetails fastlaneDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (fastlaneDetails.FastlaneData == null) - throw new ArgumentNullException(nameof(fastlaneDetails.FastlaneData), "Property is required for class FastlaneDetails."); - - if (fastlaneDetails.CheckoutAttemptIdOption.IsSet && fastlaneDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(fastlaneDetails.CheckoutAttemptId), "Property is required for class FastlaneDetails."); - - if (fastlaneDetails.RecurringDetailReferenceOption.IsSet && fastlaneDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(fastlaneDetails.RecurringDetailReference), "Property is required for class FastlaneDetails."); - - if (fastlaneDetails.StoredPaymentMethodIdOption.IsSet && fastlaneDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(fastlaneDetails.StoredPaymentMethodId), "Property is required for class FastlaneDetails."); - - writer.WriteString("fastlaneData", fastlaneDetails.FastlaneData); - - if (fastlaneDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", fastlaneDetails.CheckoutAttemptId); - - if (fastlaneDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", fastlaneDetails.RecurringDetailReference); - - if (fastlaneDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", fastlaneDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = FastlaneDetails.TypeEnumToJsonValue(fastlaneDetails.Type); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ForexQuote.cs b/Adyen/Model/Checkout/ForexQuote.cs index f9ffdf98f..67180acfc 100644 --- a/Adyen/Model/Checkout/ForexQuote.cs +++ b/Adyen/Model/Checkout/ForexQuote.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,204 +15,138 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ForexQuote /// - public partial class ForexQuote : IValidatableObject + [DataContract(Name = "ForexQuote")] + public partial class ForexQuote : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The base points. - /// The date until which the forex quote is valid. - /// The account name. - /// The account type. - /// baseAmount - /// buy - /// interbank - /// The reference assigned to the forex quote request. - /// sell - /// The signature to validate the integrity. - /// The source of the forex quote. - /// The type of forex. - [JsonConstructor] - public ForexQuote(int basePoints, DateTime validTill, Option account = default, Option accountType = default, Option baseAmount = default, Option buy = default, Option interbank = default, Option reference = default, Option sell = default, Option signature = default, Option source = default, Option type = default) - { - BasePoints = basePoints; - ValidTill = validTill; - AccountOption = account; - AccountTypeOption = accountType; - BaseAmountOption = baseAmount; - BuyOption = buy; - InterbankOption = interbank; - ReferenceOption = reference; - SellOption = sell; - SignatureOption = signature; - SourceOption = source; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - - /// - /// The base points. - /// - /// The base points. - [JsonPropertyName("basePoints")] - public int BasePoints { get; set; } - + [JsonConstructorAttribute] + protected ForexQuote() { } /// - /// The date until which the forex quote is valid. - /// - /// The date until which the forex quote is valid. - [JsonPropertyName("validTill")] - public DateTime ValidTill { get; set; } - - /// - /// Used to track the state of Account + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountOption { get; private set; } + /// The account name.. + /// The account type.. + /// baseAmount. + /// The base points. (required). + /// buy. + /// interbank. + /// The reference assigned to the forex quote request.. + /// sell. + /// The signature to validate the integrity.. + /// The source of the forex quote.. + /// The type of forex.. + /// The date until which the forex quote is valid. (required). + public ForexQuote(string account = default(string), string accountType = default(string), Amount baseAmount = default(Amount), int? basePoints = default(int?), Amount buy = default(Amount), Amount interbank = default(Amount), string reference = default(string), Amount sell = default(Amount), string signature = default(string), string source = default(string), string type = default(string), DateTime validTill = default(DateTime)) + { + this.BasePoints = basePoints; + this.ValidTill = validTill; + this.Account = account; + this.AccountType = accountType; + this.BaseAmount = baseAmount; + this.Buy = buy; + this.Interbank = interbank; + this.Reference = reference; + this.Sell = sell; + this.Signature = signature; + this.Source = source; + this.Type = type; + } /// /// The account name. /// /// The account name. - [JsonPropertyName("account")] - public string Account { get { return this.AccountOption; } set { this.AccountOption = new Option(value); } } - - /// - /// Used to track the state of AccountType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountTypeOption { get; private set; } + [DataMember(Name = "account", EmitDefaultValue = false)] + public string Account { get; set; } /// /// The account type. /// /// The account type. - [JsonPropertyName("accountType")] - public string AccountType { get { return this.AccountTypeOption; } set { this.AccountTypeOption = new Option(value); } } - - /// - /// Used to track the state of BaseAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BaseAmountOption { get; private set; } + [DataMember(Name = "accountType", EmitDefaultValue = false)] + public string AccountType { get; set; } /// /// Gets or Sets BaseAmount /// - [JsonPropertyName("baseAmount")] - public Amount BaseAmount { get { return this.BaseAmountOption; } set { this.BaseAmountOption = new Option(value); } } + [DataMember(Name = "baseAmount", EmitDefaultValue = false)] + public Amount BaseAmount { get; set; } /// - /// Used to track the state of Buy + /// The base points. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BuyOption { get; private set; } + /// The base points. + [DataMember(Name = "basePoints", IsRequired = false, EmitDefaultValue = false)] + public int? BasePoints { get; set; } /// /// Gets or Sets Buy /// - [JsonPropertyName("buy")] - public Amount Buy { get { return this.BuyOption; } set { this.BuyOption = new Option(value); } } - - /// - /// Used to track the state of Interbank - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InterbankOption { get; private set; } + [DataMember(Name = "buy", EmitDefaultValue = false)] + public Amount Buy { get; set; } /// /// Gets or Sets Interbank /// - [JsonPropertyName("interbank")] - public Amount Interbank { get { return this.InterbankOption; } set { this.InterbankOption = new Option(value); } } - - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + [DataMember(Name = "interbank", EmitDefaultValue = false)] + public Amount Interbank { get; set; } /// /// The reference assigned to the forex quote request. /// /// The reference assigned to the forex quote request. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Sell - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SellOption { get; private set; } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Gets or Sets Sell /// - [JsonPropertyName("sell")] - public Amount Sell { get { return this.SellOption; } set { this.SellOption = new Option(value); } } - - /// - /// Used to track the state of Signature - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SignatureOption { get; private set; } + [DataMember(Name = "sell", EmitDefaultValue = false)] + public Amount Sell { get; set; } /// /// The signature to validate the integrity. /// /// The signature to validate the integrity. - [JsonPropertyName("signature")] - public string Signature { get { return this.SignatureOption; } set { this.SignatureOption = new Option(value); } } - - /// - /// Used to track the state of Source - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SourceOption { get; private set; } + [DataMember(Name = "signature", EmitDefaultValue = false)] + public string Signature { get; set; } /// /// The source of the forex quote. /// /// The source of the forex quote. - [JsonPropertyName("source")] - public string Source { get { return this.SourceOption; } set { this.SourceOption = new Option(value); } } + [DataMember(Name = "source", EmitDefaultValue = false)] + public string Source { get; set; } /// - /// Used to track the state of Type + /// The type of forex. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } + /// The type of forex. + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } /// - /// The type of forex. + /// The date until which the forex quote is valid. /// - /// The type of forex. - [JsonPropertyName("type")] - public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// The date until which the forex quote is valid. + [DataMember(Name = "validTill", IsRequired = false, EmitDefaultValue = false)] + public DateTime ValidTill { get; set; } /// /// Returns the string presentation of the object @@ -221,11 +156,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class ForexQuote {\n"); - sb.Append(" BasePoints: ").Append(BasePoints).Append("\n"); - sb.Append(" ValidTill: ").Append(ValidTill).Append("\n"); sb.Append(" Account: ").Append(Account).Append("\n"); sb.Append(" AccountType: ").Append(AccountType).Append("\n"); sb.Append(" BaseAmount: ").Append(BaseAmount).Append("\n"); + sb.Append(" BasePoints: ").Append(BasePoints).Append("\n"); sb.Append(" Buy: ").Append(Buy).Append("\n"); sb.Append(" Interbank: ").Append(Interbank).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); @@ -233,264 +167,169 @@ public override string ToString() sb.Append(" Signature: ").Append(Signature).Append("\n"); sb.Append(" Source: ").Append(Source).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" ValidTill: ").Append(ValidTill).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ForexQuoteJsonConverter : JsonConverter - { /// - /// The format to use to serialize ValidTill + /// Returns true if objects are equal /// - public static string ValidTillFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ForexQuote); + } /// - /// Deserializes json to + /// Returns true if ForexQuote instances are equal /// - /// - /// - /// - /// - /// - public override ForexQuote Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Instance of ForexQuote to be compared + /// Boolean + public bool Equals(ForexQuote input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option basePoints = default; - Option validTill = default; - Option account = default; - Option accountType = default; - Option baseAmount = default; - Option buy = default; - Option interbank = default; - Option reference = default; - Option sell = default; - Option signature = default; - Option source = default; - Option type = default; - - while (utf8JsonReader.Read()) + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "basePoints": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - basePoints = new Option(utf8JsonReader.GetInt32()); - break; - case "validTill": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - validTill = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "account": - account = new Option(utf8JsonReader.GetString()); - break; - case "accountType": - accountType = new Option(utf8JsonReader.GetString()); - break; - case "baseAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - baseAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "buy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - buy = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "interbank": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - interbank = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "sell": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sell = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "signature": - signature = new Option(utf8JsonReader.GetString()); - break; - case "source": - source = new Option(utf8JsonReader.GetString()); - break; - case "type": - type = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!basePoints.IsSet) - throw new ArgumentException("Property is required for class ForexQuote.", nameof(basePoints)); - - if (!validTill.IsSet) - throw new ArgumentException("Property is required for class ForexQuote.", nameof(validTill)); - - if (basePoints.IsSet && basePoints.Value == null) - throw new ArgumentNullException(nameof(basePoints), "Property is not nullable for class ForexQuote."); - - if (validTill.IsSet && validTill.Value == null) - throw new ArgumentNullException(nameof(validTill), "Property is not nullable for class ForexQuote."); - - if (account.IsSet && account.Value == null) - throw new ArgumentNullException(nameof(account), "Property is not nullable for class ForexQuote."); - - if (accountType.IsSet && accountType.Value == null) - throw new ArgumentNullException(nameof(accountType), "Property is not nullable for class ForexQuote."); - - if (baseAmount.IsSet && baseAmount.Value == null) - throw new ArgumentNullException(nameof(baseAmount), "Property is not nullable for class ForexQuote."); - - if (buy.IsSet && buy.Value == null) - throw new ArgumentNullException(nameof(buy), "Property is not nullable for class ForexQuote."); - - if (interbank.IsSet && interbank.Value == null) - throw new ArgumentNullException(nameof(interbank), "Property is not nullable for class ForexQuote."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class ForexQuote."); - - if (sell.IsSet && sell.Value == null) - throw new ArgumentNullException(nameof(sell), "Property is not nullable for class ForexQuote."); - - if (signature.IsSet && signature.Value == null) - throw new ArgumentNullException(nameof(signature), "Property is not nullable for class ForexQuote."); - - if (source.IsSet && source.Value == null) - throw new ArgumentNullException(nameof(source), "Property is not nullable for class ForexQuote."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class ForexQuote."); - - return new ForexQuote(basePoints.Value.Value, validTill.Value.Value, account, accountType, baseAmount, buy, interbank, reference, sell, signature, source, type); + return + ( + this.Account == input.Account || + (this.Account != null && + this.Account.Equals(input.Account)) + ) && + ( + this.AccountType == input.AccountType || + (this.AccountType != null && + this.AccountType.Equals(input.AccountType)) + ) && + ( + this.BaseAmount == input.BaseAmount || + (this.BaseAmount != null && + this.BaseAmount.Equals(input.BaseAmount)) + ) && + ( + this.BasePoints == input.BasePoints || + this.BasePoints.Equals(input.BasePoints) + ) && + ( + this.Buy == input.Buy || + (this.Buy != null && + this.Buy.Equals(input.Buy)) + ) && + ( + this.Interbank == input.Interbank || + (this.Interbank != null && + this.Interbank.Equals(input.Interbank)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Sell == input.Sell || + (this.Sell != null && + this.Sell.Equals(input.Sell)) + ) && + ( + this.Signature == input.Signature || + (this.Signature != null && + this.Signature.Equals(input.Signature)) + ) && + ( + this.Source == input.Source || + (this.Source != null && + this.Source.Equals(input.Source)) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ) && + ( + this.ValidTill == input.ValidTill || + (this.ValidTill != null && + this.ValidTill.Equals(input.ValidTill)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ForexQuote forexQuote, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, forexQuote, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Account != null) + { + hashCode = (hashCode * 59) + this.Account.GetHashCode(); + } + if (this.AccountType != null) + { + hashCode = (hashCode * 59) + this.AccountType.GetHashCode(); + } + if (this.BaseAmount != null) + { + hashCode = (hashCode * 59) + this.BaseAmount.GetHashCode(); + } + hashCode = (hashCode * 59) + this.BasePoints.GetHashCode(); + if (this.Buy != null) + { + hashCode = (hashCode * 59) + this.Buy.GetHashCode(); + } + if (this.Interbank != null) + { + hashCode = (hashCode * 59) + this.Interbank.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.Sell != null) + { + hashCode = (hashCode * 59) + this.Sell.GetHashCode(); + } + if (this.Signature != null) + { + hashCode = (hashCode * 59) + this.Signature.GetHashCode(); + } + if (this.Source != null) + { + hashCode = (hashCode * 59) + this.Source.GetHashCode(); + } + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + if (this.ValidTill != null) + { + hashCode = (hashCode * 59) + this.ValidTill.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ForexQuote forexQuote, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (forexQuote.AccountOption.IsSet && forexQuote.Account == null) - throw new ArgumentNullException(nameof(forexQuote.Account), "Property is required for class ForexQuote."); - - if (forexQuote.AccountTypeOption.IsSet && forexQuote.AccountType == null) - throw new ArgumentNullException(nameof(forexQuote.AccountType), "Property is required for class ForexQuote."); - - if (forexQuote.BaseAmountOption.IsSet && forexQuote.BaseAmount == null) - throw new ArgumentNullException(nameof(forexQuote.BaseAmount), "Property is required for class ForexQuote."); - - if (forexQuote.BuyOption.IsSet && forexQuote.Buy == null) - throw new ArgumentNullException(nameof(forexQuote.Buy), "Property is required for class ForexQuote."); - - if (forexQuote.InterbankOption.IsSet && forexQuote.Interbank == null) - throw new ArgumentNullException(nameof(forexQuote.Interbank), "Property is required for class ForexQuote."); - - if (forexQuote.ReferenceOption.IsSet && forexQuote.Reference == null) - throw new ArgumentNullException(nameof(forexQuote.Reference), "Property is required for class ForexQuote."); - - if (forexQuote.SellOption.IsSet && forexQuote.Sell == null) - throw new ArgumentNullException(nameof(forexQuote.Sell), "Property is required for class ForexQuote."); - - if (forexQuote.SignatureOption.IsSet && forexQuote.Signature == null) - throw new ArgumentNullException(nameof(forexQuote.Signature), "Property is required for class ForexQuote."); - - if (forexQuote.SourceOption.IsSet && forexQuote.Source == null) - throw new ArgumentNullException(nameof(forexQuote.Source), "Property is required for class ForexQuote."); - - if (forexQuote.TypeOption.IsSet && forexQuote.Type == null) - throw new ArgumentNullException(nameof(forexQuote.Type), "Property is required for class ForexQuote."); - - writer.WriteNumber("basePoints", forexQuote.BasePoints); - - writer.WriteString("validTill", forexQuote.ValidTill.ToString(ValidTillFormat)); - - if (forexQuote.AccountOption.IsSet) - writer.WriteString("account", forexQuote.Account); - - if (forexQuote.AccountTypeOption.IsSet) - writer.WriteString("accountType", forexQuote.AccountType); - - if (forexQuote.BaseAmountOption.IsSet) - { - writer.WritePropertyName("baseAmount"); - JsonSerializer.Serialize(writer, forexQuote.BaseAmount, jsonSerializerOptions); - } - if (forexQuote.BuyOption.IsSet) - { - writer.WritePropertyName("buy"); - JsonSerializer.Serialize(writer, forexQuote.Buy, jsonSerializerOptions); - } - if (forexQuote.InterbankOption.IsSet) - { - writer.WritePropertyName("interbank"); - JsonSerializer.Serialize(writer, forexQuote.Interbank, jsonSerializerOptions); - } - if (forexQuote.ReferenceOption.IsSet) - writer.WriteString("reference", forexQuote.Reference); - - if (forexQuote.SellOption.IsSet) - { - writer.WritePropertyName("sell"); - JsonSerializer.Serialize(writer, forexQuote.Sell, jsonSerializerOptions); - } - if (forexQuote.SignatureOption.IsSet) - writer.WriteString("signature", forexQuote.Signature); - - if (forexQuote.SourceOption.IsSet) - writer.WriteString("source", forexQuote.Source); - - if (forexQuote.TypeOption.IsSet) - writer.WriteString("type", forexQuote.Type); + yield break; } } + } diff --git a/Adyen/Model/Checkout/FraudCheckResult.cs b/Adyen/Model/Checkout/FraudCheckResult.cs index 77e8213dc..74901ba76 100644 --- a/Adyen/Model/Checkout/FraudCheckResult.cs +++ b/Adyen/Model/Checkout/FraudCheckResult.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,56 +15,60 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// FraudCheckResult /// - public partial class FraudCheckResult : IValidatableObject + [DataContract(Name = "FraudCheckResult")] + public partial class FraudCheckResult : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The fraud score generated by the risk check. - /// The ID of the risk check. - /// The name of the risk check. - [JsonConstructor] - public FraudCheckResult(int accountScore, int checkId, string name) + [JsonConstructorAttribute] + protected FraudCheckResult() { } + /// + /// Initializes a new instance of the class. + /// + /// The fraud score generated by the risk check. (required). + /// The ID of the risk check. (required). + /// The name of the risk check. (required). + public FraudCheckResult(int? accountScore = default(int?), int? checkId = default(int?), string name = default(string)) { - AccountScore = accountScore; - CheckId = checkId; - Name = name; - OnCreated(); + this.AccountScore = accountScore; + this.CheckId = checkId; + this.Name = name; } - partial void OnCreated(); - /// /// The fraud score generated by the risk check. /// /// The fraud score generated by the risk check. - [JsonPropertyName("accountScore")] - public int AccountScore { get; set; } + [DataMember(Name = "accountScore", IsRequired = false, EmitDefaultValue = false)] + public int? AccountScore { get; set; } /// /// The ID of the risk check. /// /// The ID of the risk check. - [JsonPropertyName("checkId")] - public int CheckId { get; set; } + [DataMember(Name = "checkId", IsRequired = false, EmitDefaultValue = false)] + public int? CheckId { get; set; } /// /// The name of the risk check. /// /// The name of the risk check. - [JsonPropertyName("name")] + [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] public string Name { get; set; } /// @@ -82,127 +87,78 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class FraudCheckResultJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override FraudCheckResult Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option accountScore = default; - Option checkId = default; - Option name = default; + return this.Equals(input as FraudCheckResult); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if FraudCheckResult instances are equal + /// + /// Instance of FraudCheckResult to be compared + /// Boolean + public bool Equals(FraudCheckResult input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "accountScore": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - accountScore = new Option(utf8JsonReader.GetInt32()); - break; - case "checkId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - checkId = new Option(utf8JsonReader.GetInt32()); - break; - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!accountScore.IsSet) - throw new ArgumentException("Property is required for class FraudCheckResult.", nameof(accountScore)); - - if (!checkId.IsSet) - throw new ArgumentException("Property is required for class FraudCheckResult.", nameof(checkId)); - - if (!name.IsSet) - throw new ArgumentException("Property is required for class FraudCheckResult.", nameof(name)); - - if (accountScore.IsSet && accountScore.Value == null) - throw new ArgumentNullException(nameof(accountScore), "Property is not nullable for class FraudCheckResult."); - - if (checkId.IsSet && checkId.Value == null) - throw new ArgumentNullException(nameof(checkId), "Property is not nullable for class FraudCheckResult."); - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class FraudCheckResult."); - - return new FraudCheckResult(accountScore.Value.Value, checkId.Value.Value, name.Value); + return + ( + this.AccountScore == input.AccountScore || + this.AccountScore.Equals(input.AccountScore) + ) && + ( + this.CheckId == input.CheckId || + this.CheckId.Equals(input.CheckId) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, FraudCheckResult fraudCheckResult, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, fraudCheckResult, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.AccountScore.GetHashCode(); + hashCode = (hashCode * 59) + this.CheckId.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, FraudCheckResult fraudCheckResult, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (fraudCheckResult.Name == null) - throw new ArgumentNullException(nameof(fraudCheckResult.Name), "Property is required for class FraudCheckResult."); - - writer.WriteNumber("accountScore", fraudCheckResult.AccountScore); - - writer.WriteNumber("checkId", fraudCheckResult.CheckId); - - writer.WriteString("name", fraudCheckResult.Name); + yield break; } } + } diff --git a/Adyen/Model/Checkout/FraudResult.cs b/Adyen/Model/Checkout/FraudResult.cs index 54ebe6f08..bc85adb54 100644 --- a/Adyen/Model/Checkout/FraudResult.cs +++ b/Adyen/Model/Checkout/FraudResult.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,55 +15,52 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// FraudResult /// - public partial class FraudResult : IValidatableObject + [DataContract(Name = "FraudResult")] + public partial class FraudResult : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The total fraud score generated by the risk checks. - /// The result of the individual risk checks. - [JsonConstructor] - public FraudResult(int accountScore, Option> results = default) + [JsonConstructorAttribute] + protected FraudResult() { } + /// + /// Initializes a new instance of the class. + /// + /// The total fraud score generated by the risk checks. (required). + /// The result of the individual risk checks.. + public FraudResult(int? accountScore = default(int?), List results = default(List)) { - AccountScore = accountScore; - ResultsOption = results; - OnCreated(); + this.AccountScore = accountScore; + this.Results = results; } - partial void OnCreated(); - /// /// The total fraud score generated by the risk checks. /// /// The total fraud score generated by the risk checks. - [JsonPropertyName("accountScore")] - public int AccountScore { get; set; } - - /// - /// Used to track the state of Results - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> ResultsOption { get; private set; } + [DataMember(Name = "accountScore", IsRequired = false, EmitDefaultValue = false)] + public int? AccountScore { get; set; } /// /// The result of the individual risk checks. /// /// The result of the individual risk checks. - [JsonPropertyName("results")] - public List Results { get { return this.ResultsOption; } set { this.ResultsOption = new Option>(value); } } + [DataMember(Name = "results", EmitDefaultValue = false)] + public List Results { get; set; } /// /// Returns the string presentation of the object @@ -79,116 +77,74 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class FraudResultJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override FraudResult Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option accountScore = default; - Option> results = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "accountScore": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - accountScore = new Option(utf8JsonReader.GetInt32()); - break; - case "results": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - results = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (!accountScore.IsSet) - throw new ArgumentException("Property is required for class FraudResult.", nameof(accountScore)); - - if (accountScore.IsSet && accountScore.Value == null) - throw new ArgumentNullException(nameof(accountScore), "Property is not nullable for class FraudResult."); - - if (results.IsSet && results.Value == null) - throw new ArgumentNullException(nameof(results), "Property is not nullable for class FraudResult."); - - return new FraudResult(accountScore.Value.Value, results); + return this.Equals(input as FraudResult); } /// - /// Serializes a + /// Returns true if FraudResult instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, FraudResult fraudResult, JsonSerializerOptions jsonSerializerOptions) + /// Instance of FraudResult to be compared + /// Boolean + public bool Equals(FraudResult input) { - writer.WriteStartObject(); - - WriteProperties(writer, fraudResult, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AccountScore == input.AccountScore || + this.AccountScore.Equals(input.AccountScore) + ) && + ( + this.Results == input.Results || + this.Results != null && + input.Results != null && + this.Results.SequenceEqual(input.Results) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, FraudResult fraudResult, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (fraudResult.ResultsOption.IsSet && fraudResult.Results == null) - throw new ArgumentNullException(nameof(fraudResult.Results), "Property is required for class FraudResult."); - - writer.WriteNumber("accountScore", fraudResult.AccountScore); - - if (fraudResult.ResultsOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("results"); - JsonSerializer.Serialize(writer, fraudResult.Results, jsonSerializerOptions); + int hashCode = 41; + hashCode = (hashCode * 59) + this.AccountScore.GetHashCode(); + if (this.Results != null) + { + hashCode = (hashCode * 59) + this.Results.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/FundOrigin.cs b/Adyen/Model/Checkout/FundOrigin.cs index 0e4893205..a21b41e7b 100644 --- a/Adyen/Model/Checkout/FundOrigin.cs +++ b/Adyen/Model/Checkout/FundOrigin.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,108 +15,72 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// FundOrigin /// - public partial class FundOrigin : IValidatableObject + [DataContract(Name = "FundOrigin")] + public partial class FundOrigin : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// billingAddress - /// The email address of the person funding the money. - /// shopperName - /// The phone number of the person funding the money. - /// The unique identifier of the wallet where the funds are coming from. - [JsonConstructor] - public FundOrigin(Option
billingAddress = default, Option shopperEmail = default, Option shopperName = default, Option telephoneNumber = default, Option walletIdentifier = default) + /// billingAddress. + /// The email address of the person funding the money.. + /// shopperName. + /// The phone number of the person funding the money.. + /// The unique identifier of the wallet where the funds are coming from.. + public FundOrigin(Address billingAddress = default(Address), string shopperEmail = default(string), Name shopperName = default(Name), string telephoneNumber = default(string), string walletIdentifier = default(string)) { - BillingAddressOption = billingAddress; - ShopperEmailOption = shopperEmail; - ShopperNameOption = shopperName; - TelephoneNumberOption = telephoneNumber; - WalletIdentifierOption = walletIdentifier; - OnCreated(); + this.BillingAddress = billingAddress; + this.ShopperEmail = shopperEmail; + this.ShopperName = shopperName; + this.TelephoneNumber = telephoneNumber; + this.WalletIdentifier = walletIdentifier; } - partial void OnCreated(); - - /// - /// Used to track the state of BillingAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option
BillingAddressOption { get; private set; } - /// /// Gets or Sets BillingAddress /// - [JsonPropertyName("billingAddress")] - public Address BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option
(value); } } - - /// - /// Used to track the state of ShopperEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public Address BillingAddress { get; set; } /// /// The email address of the person funding the money. /// /// The email address of the person funding the money. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } - - /// - /// Used to track the state of ShopperName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNameOption { get; private set; } + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// /// Gets or Sets ShopperName /// - [JsonPropertyName("shopperName")] - public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } - - /// - /// Used to track the state of TelephoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TelephoneNumberOption { get; private set; } + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name ShopperName { get; set; } /// /// The phone number of the person funding the money. /// /// The phone number of the person funding the money. - [JsonPropertyName("telephoneNumber")] - public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } - - /// - /// Used to track the state of WalletIdentifier - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option WalletIdentifierOption { get; private set; } + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string TelephoneNumber { get; set; } /// /// The unique identifier of the wallet where the funds are coming from. /// /// The unique identifier of the wallet where the funds are coming from. - [JsonPropertyName("walletIdentifier")] - public string WalletIdentifier { get { return this.WalletIdentifierOption; } set { this.WalletIdentifierOption = new Option(value); } } + [DataMember(Name = "walletIdentifier", EmitDefaultValue = false)] + public string WalletIdentifier { get; set; } /// /// Returns the string presentation of the object @@ -135,157 +100,104 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class FundOriginJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override FundOrigin Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option
billingAddress = default; - Option shopperEmail = default; - Option shopperName = default; - Option telephoneNumber = default; - Option walletIdentifier = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "billingAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - billingAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "shopperName": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "telephoneNumber": - telephoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "walletIdentifier": - walletIdentifier = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class FundOrigin."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class FundOrigin."); - - if (shopperName.IsSet && shopperName.Value == null) - throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class FundOrigin."); - - if (telephoneNumber.IsSet && telephoneNumber.Value == null) - throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class FundOrigin."); - - if (walletIdentifier.IsSet && walletIdentifier.Value == null) - throw new ArgumentNullException(nameof(walletIdentifier), "Property is not nullable for class FundOrigin."); - - return new FundOrigin(billingAddress, shopperEmail, shopperName, telephoneNumber, walletIdentifier); + return this.Equals(input as FundOrigin); } /// - /// Serializes a + /// Returns true if FundOrigin instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, FundOrigin fundOrigin, JsonSerializerOptions jsonSerializerOptions) + /// Instance of FundOrigin to be compared + /// Boolean + public bool Equals(FundOrigin input) { - writer.WriteStartObject(); - - WriteProperties(writer, fundOrigin, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.ShopperName == input.ShopperName || + (this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName)) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + (this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber)) + ) && + ( + this.WalletIdentifier == input.WalletIdentifier || + (this.WalletIdentifier != null && + this.WalletIdentifier.Equals(input.WalletIdentifier)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, FundOrigin fundOrigin, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (fundOrigin.BillingAddressOption.IsSet && fundOrigin.BillingAddress == null) - throw new ArgumentNullException(nameof(fundOrigin.BillingAddress), "Property is required for class FundOrigin."); - - if (fundOrigin.ShopperEmailOption.IsSet && fundOrigin.ShopperEmail == null) - throw new ArgumentNullException(nameof(fundOrigin.ShopperEmail), "Property is required for class FundOrigin."); - - if (fundOrigin.ShopperNameOption.IsSet && fundOrigin.ShopperName == null) - throw new ArgumentNullException(nameof(fundOrigin.ShopperName), "Property is required for class FundOrigin."); - - if (fundOrigin.TelephoneNumberOption.IsSet && fundOrigin.TelephoneNumber == null) - throw new ArgumentNullException(nameof(fundOrigin.TelephoneNumber), "Property is required for class FundOrigin."); - - if (fundOrigin.WalletIdentifierOption.IsSet && fundOrigin.WalletIdentifier == null) - throw new ArgumentNullException(nameof(fundOrigin.WalletIdentifier), "Property is required for class FundOrigin."); - - if (fundOrigin.BillingAddressOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("billingAddress"); - JsonSerializer.Serialize(writer, fundOrigin.BillingAddress, jsonSerializerOptions); - } - if (fundOrigin.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", fundOrigin.ShopperEmail); - - if (fundOrigin.ShopperNameOption.IsSet) - { - writer.WritePropertyName("shopperName"); - JsonSerializer.Serialize(writer, fundOrigin.ShopperName, jsonSerializerOptions); + int hashCode = 41; + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.ShopperName != null) + { + hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); + } + if (this.TelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); + } + if (this.WalletIdentifier != null) + { + hashCode = (hashCode * 59) + this.WalletIdentifier.GetHashCode(); + } + return hashCode; } - if (fundOrigin.TelephoneNumberOption.IsSet) - writer.WriteString("telephoneNumber", fundOrigin.TelephoneNumber); - - if (fundOrigin.WalletIdentifierOption.IsSet) - writer.WriteString("walletIdentifier", fundOrigin.WalletIdentifier); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/FundRecipient.cs b/Adyen/Model/Checkout/FundRecipient.cs index 2d3ab0ed0..eb14fa2e7 100644 --- a/Adyen/Model/Checkout/FundRecipient.cs +++ b/Adyen/Model/Checkout/FundRecipient.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,327 +15,172 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// FundRecipient /// - public partial class FundRecipient : IValidatableObject + [DataContract(Name = "FundRecipient")] + public partial class FundRecipient : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The IBAN of the bank account where the funds are being transferred to. - /// billingAddress - /// paymentMethod - /// The email address of the shopper. - /// shopperName - /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// subMerchant - /// The telephone number of the shopper. - /// The unique identifier for the wallet the funds are being transferred to. You can use the shopper reference or any other identifier. - /// The tax identifier of the person receiving the funds. - /// The purpose of a digital wallet transaction. - [JsonConstructor] - public FundRecipient(Option iBAN = default, Option
billingAddress = default, Option paymentMethod = default, Option shopperEmail = default, Option shopperName = default, Option shopperReference = default, Option storedPaymentMethodId = default, Option subMerchant = default, Option telephoneNumber = default, Option walletIdentifier = default, Option walletOwnerTaxId = default, Option walletPurpose = default) - { - IBANOption = iBAN; - BillingAddressOption = billingAddress; - PaymentMethodOption = paymentMethod; - ShopperEmailOption = shopperEmail; - ShopperNameOption = shopperName; - ShopperReferenceOption = shopperReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - SubMerchantOption = subMerchant; - TelephoneNumberOption = telephoneNumber; - WalletIdentifierOption = walletIdentifier; - WalletOwnerTaxIdOption = walletOwnerTaxId; - WalletPurposeOption = walletPurpose; - OnCreated(); - } - - partial void OnCreated(); - /// /// The purpose of a digital wallet transaction. /// /// The purpose of a digital wallet transaction. + [JsonConverter(typeof(StringEnumConverter))] public enum WalletPurposeEnum { /// /// Enum IdentifiedBoleto for value: identifiedBoleto /// + [EnumMember(Value = "identifiedBoleto")] IdentifiedBoleto = 1, /// /// Enum TransferDifferentWallet for value: transferDifferentWallet /// + [EnumMember(Value = "transferDifferentWallet")] TransferDifferentWallet = 2, /// /// Enum TransferOwnWallet for value: transferOwnWallet /// + [EnumMember(Value = "transferOwnWallet")] TransferOwnWallet = 3, /// /// Enum TransferSameWallet for value: transferSameWallet /// + [EnumMember(Value = "transferSameWallet")] TransferSameWallet = 4, /// /// Enum UnidentifiedBoleto for value: unidentifiedBoleto /// + [EnumMember(Value = "unidentifiedBoleto")] UnidentifiedBoleto = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static WalletPurposeEnum WalletPurposeEnumFromString(string value) - { - if (value.Equals("identifiedBoleto")) - return WalletPurposeEnum.IdentifiedBoleto; - - if (value.Equals("transferDifferentWallet")) - return WalletPurposeEnum.TransferDifferentWallet; - - if (value.Equals("transferOwnWallet")) - return WalletPurposeEnum.TransferOwnWallet; - - if (value.Equals("transferSameWallet")) - return WalletPurposeEnum.TransferSameWallet; - - if (value.Equals("unidentifiedBoleto")) - return WalletPurposeEnum.UnidentifiedBoleto; - - throw new NotImplementedException($"Could not convert value to type WalletPurposeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static WalletPurposeEnum? WalletPurposeEnumFromStringOrDefault(string value) - { - if (value.Equals("identifiedBoleto")) - return WalletPurposeEnum.IdentifiedBoleto; - if (value.Equals("transferDifferentWallet")) - return WalletPurposeEnum.TransferDifferentWallet; - - if (value.Equals("transferOwnWallet")) - return WalletPurposeEnum.TransferOwnWallet; - - if (value.Equals("transferSameWallet")) - return WalletPurposeEnum.TransferSameWallet; - - if (value.Equals("unidentifiedBoleto")) - return WalletPurposeEnum.UnidentifiedBoleto; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string WalletPurposeEnumToJsonValue(WalletPurposeEnum? value) - { - if (value == WalletPurposeEnum.IdentifiedBoleto) - return "identifiedBoleto"; - - if (value == WalletPurposeEnum.TransferDifferentWallet) - return "transferDifferentWallet"; - - if (value == WalletPurposeEnum.TransferOwnWallet) - return "transferOwnWallet"; - - if (value == WalletPurposeEnum.TransferSameWallet) - return "transferSameWallet"; - - if (value == WalletPurposeEnum.UnidentifiedBoleto) - return "unidentifiedBoleto"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of WalletPurpose - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option WalletPurposeOption { get; private set; } /// /// The purpose of a digital wallet transaction. /// /// The purpose of a digital wallet transaction. - [JsonPropertyName("walletPurpose")] - public WalletPurposeEnum? WalletPurpose { get { return this.WalletPurposeOption; } set { this.WalletPurposeOption = new Option(value); } } - + [DataMember(Name = "walletPurpose", EmitDefaultValue = false)] + public WalletPurposeEnum? WalletPurpose { get; set; } /// - /// Used to track the state of IBAN + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IBANOption { get; private set; } + /// The IBAN of the bank account where the funds are being transferred to.. + /// billingAddress. + /// paymentMethod. + /// The email address of the shopper.. + /// shopperName. + /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// subMerchant. + /// The telephone number of the shopper.. + /// The unique identifier for the wallet the funds are being transferred to. You can use the shopper reference or any other identifier.. + /// The tax identifier of the person receiving the funds.. + /// The purpose of a digital wallet transaction.. + public FundRecipient(string iBAN = default(string), Address billingAddress = default(Address), CardDetails paymentMethod = default(CardDetails), string shopperEmail = default(string), Name shopperName = default(Name), string shopperReference = default(string), string storedPaymentMethodId = default(string), SubMerchant subMerchant = default(SubMerchant), string telephoneNumber = default(string), string walletIdentifier = default(string), string walletOwnerTaxId = default(string), WalletPurposeEnum? walletPurpose = default(WalletPurposeEnum?)) + { + this.IBAN = iBAN; + this.BillingAddress = billingAddress; + this.PaymentMethod = paymentMethod; + this.ShopperEmail = shopperEmail; + this.ShopperName = shopperName; + this.ShopperReference = shopperReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.SubMerchant = subMerchant; + this.TelephoneNumber = telephoneNumber; + this.WalletIdentifier = walletIdentifier; + this.WalletOwnerTaxId = walletOwnerTaxId; + this.WalletPurpose = walletPurpose; + } /// /// The IBAN of the bank account where the funds are being transferred to. /// /// The IBAN of the bank account where the funds are being transferred to. - [JsonPropertyName("IBAN")] - public string IBAN { get { return this.IBANOption; } set { this.IBANOption = new Option(value); } } - - /// - /// Used to track the state of BillingAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option
BillingAddressOption { get; private set; } + [DataMember(Name = "IBAN", EmitDefaultValue = false)] + public string IBAN { get; set; } /// /// Gets or Sets BillingAddress /// - [JsonPropertyName("billingAddress")] - public Address BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option
(value); } } - - /// - /// Used to track the state of PaymentMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodOption { get; private set; } + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public Address BillingAddress { get; set; } /// /// Gets or Sets PaymentMethod /// - [JsonPropertyName("paymentMethod")] - public CardDetails PaymentMethod { get { return this.PaymentMethodOption; } set { this.PaymentMethodOption = new Option(value); } } - - /// - /// Used to track the state of ShopperEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + [DataMember(Name = "paymentMethod", EmitDefaultValue = false)] + public CardDetails PaymentMethod { get; set; } /// /// The email address of the shopper. /// /// The email address of the shopper. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } - - /// - /// Used to track the state of ShopperName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNameOption { get; private set; } + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// /// Gets or Sets ShopperName /// - [JsonPropertyName("shopperName")] - public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } - - /// - /// Used to track the state of ShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperReferenceOption { get; private set; } + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name ShopperName { get; set; } /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [JsonPropertyName("shopperReference")] - public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchant - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubMerchantOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Gets or Sets SubMerchant /// - [JsonPropertyName("subMerchant")] - public SubMerchant SubMerchant { get { return this.SubMerchantOption; } set { this.SubMerchantOption = new Option(value); } } - - /// - /// Used to track the state of TelephoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TelephoneNumberOption { get; private set; } + [DataMember(Name = "subMerchant", EmitDefaultValue = false)] + public SubMerchant SubMerchant { get; set; } /// /// The telephone number of the shopper. /// /// The telephone number of the shopper. - [JsonPropertyName("telephoneNumber")] - public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } - - /// - /// Used to track the state of WalletIdentifier - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option WalletIdentifierOption { get; private set; } + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string TelephoneNumber { get; set; } /// /// The unique identifier for the wallet the funds are being transferred to. You can use the shopper reference or any other identifier. /// /// The unique identifier for the wallet the funds are being transferred to. You can use the shopper reference or any other identifier. - [JsonPropertyName("walletIdentifier")] - public string WalletIdentifier { get { return this.WalletIdentifierOption; } set { this.WalletIdentifierOption = new Option(value); } } - - /// - /// Used to track the state of WalletOwnerTaxId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option WalletOwnerTaxIdOption { get; private set; } + [DataMember(Name = "walletIdentifier", EmitDefaultValue = false)] + public string WalletIdentifier { get; set; } /// /// The tax identifier of the person receiving the funds. /// /// The tax identifier of the person receiving the funds. - [JsonPropertyName("walletOwnerTaxId")] - public string WalletOwnerTaxId { get { return this.WalletOwnerTaxIdOption; } set { this.WalletOwnerTaxIdOption = new Option(value); } } + [DataMember(Name = "walletOwnerTaxId", EmitDefaultValue = false)] + public string WalletOwnerTaxId { get; set; } /// /// Returns the string presentation of the object @@ -361,271 +207,181 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // ShopperReference (string) maxLength - if (this.ShopperReference != null && this.ShopperReference.Length > 256) - { - yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); - } - - // ShopperReference (string) minLength - if (this.ShopperReference != null && this.ShopperReference.Length < 3) - { - yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); - } - - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class FundRecipientJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override FundRecipient Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option iBAN = default; - Option
billingAddress = default; - Option paymentMethod = default; - Option shopperEmail = default; - Option shopperName = default; - Option shopperReference = default; - Option storedPaymentMethodId = default; - Option subMerchant = default; - Option telephoneNumber = default; - Option walletIdentifier = default; - Option walletOwnerTaxId = default; - Option walletPurpose = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "IBAN": - iBAN = new Option(utf8JsonReader.GetString()); - break; - case "billingAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - billingAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "paymentMethod": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "shopperName": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperReference": - shopperReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "subMerchant": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - subMerchant = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "telephoneNumber": - telephoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "walletIdentifier": - walletIdentifier = new Option(utf8JsonReader.GetString()); - break; - case "walletOwnerTaxId": - walletOwnerTaxId = new Option(utf8JsonReader.GetString()); - break; - case "walletPurpose": - string walletPurposeRawValue = utf8JsonReader.GetString(); - if (walletPurposeRawValue != null) - walletPurpose = new Option(FundRecipient.WalletPurposeEnumFromStringOrDefault(walletPurposeRawValue)); - break; - default: - break; - } - } - } - - if (iBAN.IsSet && iBAN.Value == null) - throw new ArgumentNullException(nameof(iBAN), "Property is not nullable for class FundRecipient."); - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class FundRecipient."); - - if (paymentMethod.IsSet && paymentMethod.Value == null) - throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class FundRecipient."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class FundRecipient."); - - if (shopperName.IsSet && shopperName.Value == null) - throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class FundRecipient."); - - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class FundRecipient."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class FundRecipient."); - - if (subMerchant.IsSet && subMerchant.Value == null) - throw new ArgumentNullException(nameof(subMerchant), "Property is not nullable for class FundRecipient."); - - if (telephoneNumber.IsSet && telephoneNumber.Value == null) - throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class FundRecipient."); - - if (walletIdentifier.IsSet && walletIdentifier.Value == null) - throw new ArgumentNullException(nameof(walletIdentifier), "Property is not nullable for class FundRecipient."); - - if (walletOwnerTaxId.IsSet && walletOwnerTaxId.Value == null) - throw new ArgumentNullException(nameof(walletOwnerTaxId), "Property is not nullable for class FundRecipient."); - - if (walletPurpose.IsSet && walletPurpose.Value == null) - throw new ArgumentNullException(nameof(walletPurpose), "Property is not nullable for class FundRecipient."); - - return new FundRecipient(iBAN, billingAddress, paymentMethod, shopperEmail, shopperName, shopperReference, storedPaymentMethodId, subMerchant, telephoneNumber, walletIdentifier, walletOwnerTaxId, walletPurpose); + return this.Equals(input as FundRecipient); } /// - /// Serializes a + /// Returns true if FundRecipient instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, FundRecipient fundRecipient, JsonSerializerOptions jsonSerializerOptions) + /// Instance of FundRecipient to be compared + /// Boolean + public bool Equals(FundRecipient input) { - writer.WriteStartObject(); - - WriteProperties(writer, fundRecipient, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.IBAN == input.IBAN || + (this.IBAN != null && + this.IBAN.Equals(input.IBAN)) + ) && + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.PaymentMethod == input.PaymentMethod || + (this.PaymentMethod != null && + this.PaymentMethod.Equals(input.PaymentMethod)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.ShopperName == input.ShopperName || + (this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName)) + ) && + ( + this.ShopperReference == input.ShopperReference || + (this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.SubMerchant == input.SubMerchant || + (this.SubMerchant != null && + this.SubMerchant.Equals(input.SubMerchant)) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + (this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber)) + ) && + ( + this.WalletIdentifier == input.WalletIdentifier || + (this.WalletIdentifier != null && + this.WalletIdentifier.Equals(input.WalletIdentifier)) + ) && + ( + this.WalletOwnerTaxId == input.WalletOwnerTaxId || + (this.WalletOwnerTaxId != null && + this.WalletOwnerTaxId.Equals(input.WalletOwnerTaxId)) + ) && + ( + this.WalletPurpose == input.WalletPurpose || + this.WalletPurpose.Equals(input.WalletPurpose) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, FundRecipient fundRecipient, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (fundRecipient.IBANOption.IsSet && fundRecipient.IBAN == null) - throw new ArgumentNullException(nameof(fundRecipient.IBAN), "Property is required for class FundRecipient."); - - if (fundRecipient.BillingAddressOption.IsSet && fundRecipient.BillingAddress == null) - throw new ArgumentNullException(nameof(fundRecipient.BillingAddress), "Property is required for class FundRecipient."); - - if (fundRecipient.PaymentMethodOption.IsSet && fundRecipient.PaymentMethod == null) - throw new ArgumentNullException(nameof(fundRecipient.PaymentMethod), "Property is required for class FundRecipient."); - - if (fundRecipient.ShopperEmailOption.IsSet && fundRecipient.ShopperEmail == null) - throw new ArgumentNullException(nameof(fundRecipient.ShopperEmail), "Property is required for class FundRecipient."); - - if (fundRecipient.ShopperNameOption.IsSet && fundRecipient.ShopperName == null) - throw new ArgumentNullException(nameof(fundRecipient.ShopperName), "Property is required for class FundRecipient."); - - if (fundRecipient.ShopperReferenceOption.IsSet && fundRecipient.ShopperReference == null) - throw new ArgumentNullException(nameof(fundRecipient.ShopperReference), "Property is required for class FundRecipient."); - - if (fundRecipient.StoredPaymentMethodIdOption.IsSet && fundRecipient.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(fundRecipient.StoredPaymentMethodId), "Property is required for class FundRecipient."); - - if (fundRecipient.SubMerchantOption.IsSet && fundRecipient.SubMerchant == null) - throw new ArgumentNullException(nameof(fundRecipient.SubMerchant), "Property is required for class FundRecipient."); - - if (fundRecipient.TelephoneNumberOption.IsSet && fundRecipient.TelephoneNumber == null) - throw new ArgumentNullException(nameof(fundRecipient.TelephoneNumber), "Property is required for class FundRecipient."); - - if (fundRecipient.WalletIdentifierOption.IsSet && fundRecipient.WalletIdentifier == null) - throw new ArgumentNullException(nameof(fundRecipient.WalletIdentifier), "Property is required for class FundRecipient."); - - if (fundRecipient.WalletOwnerTaxIdOption.IsSet && fundRecipient.WalletOwnerTaxId == null) - throw new ArgumentNullException(nameof(fundRecipient.WalletOwnerTaxId), "Property is required for class FundRecipient."); - - if (fundRecipient.IBANOption.IsSet) - writer.WriteString("IBAN", fundRecipient.IBAN); - - if (fundRecipient.BillingAddressOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("billingAddress"); - JsonSerializer.Serialize(writer, fundRecipient.BillingAddress, jsonSerializerOptions); + int hashCode = 41; + if (this.IBAN != null) + { + hashCode = (hashCode * 59) + this.IBAN.GetHashCode(); + } + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.PaymentMethod != null) + { + hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.ShopperName != null) + { + hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); + } + if (this.ShopperReference != null) + { + hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.SubMerchant != null) + { + hashCode = (hashCode * 59) + this.SubMerchant.GetHashCode(); + } + if (this.TelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); + } + if (this.WalletIdentifier != null) + { + hashCode = (hashCode * 59) + this.WalletIdentifier.GetHashCode(); + } + if (this.WalletOwnerTaxId != null) + { + hashCode = (hashCode * 59) + this.WalletOwnerTaxId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.WalletPurpose.GetHashCode(); + return hashCode; } - if (fundRecipient.PaymentMethodOption.IsSet) + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + // ShopperReference (string) maxLength + if (this.ShopperReference != null && this.ShopperReference.Length > 256) { - writer.WritePropertyName("paymentMethod"); - JsonSerializer.Serialize(writer, fundRecipient.PaymentMethod, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); } - if (fundRecipient.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", fundRecipient.ShopperEmail); - if (fundRecipient.ShopperNameOption.IsSet) + // ShopperReference (string) minLength + if (this.ShopperReference != null && this.ShopperReference.Length < 3) { - writer.WritePropertyName("shopperName"); - JsonSerializer.Serialize(writer, fundRecipient.ShopperName, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); } - if (fundRecipient.ShopperReferenceOption.IsSet) - writer.WriteString("shopperReference", fundRecipient.ShopperReference); - if (fundRecipient.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", fundRecipient.StoredPaymentMethodId); - - if (fundRecipient.SubMerchantOption.IsSet) + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) { - writer.WritePropertyName("subMerchant"); - JsonSerializer.Serialize(writer, fundRecipient.SubMerchant, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); } - if (fundRecipient.TelephoneNumberOption.IsSet) - writer.WriteString("telephoneNumber", fundRecipient.TelephoneNumber); - - if (fundRecipient.WalletIdentifierOption.IsSet) - writer.WriteString("walletIdentifier", fundRecipient.WalletIdentifier); - - if (fundRecipient.WalletOwnerTaxIdOption.IsSet) - writer.WriteString("walletOwnerTaxId", fundRecipient.WalletOwnerTaxId); - var walletPurposeRawValue = FundRecipient.WalletPurposeEnumToJsonValue(fundRecipient.WalletPurposeOption.Value.Value); - writer.WriteString("walletPurpose", walletPurposeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs b/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs index 20d3c7e39..1723bfce3 100644 --- a/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs +++ b/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,192 +15,113 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// GenericIssuerPaymentMethodDetails /// - public partial class GenericIssuerPaymentMethodDetails : IValidatableObject + [DataContract(Name = "GenericIssuerPaymentMethodDetails")] + public partial class GenericIssuerPaymentMethodDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The issuer id of the shopper's selected bank. - /// **genericissuer** - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonConstructor] - public GenericIssuerPaymentMethodDetails(string issuer, TypeEnum type, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default) - { - Issuer = issuer; - Type = type; - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - OnCreated(); - } - - partial void OnCreated(); - /// /// **genericissuer** /// /// **genericissuer** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum OnlineBankingPL for value: onlineBanking_PL /// + [EnumMember(Value = "onlineBanking_PL")] OnlineBankingPL = 1, /// /// Enum Eps for value: eps /// + [EnumMember(Value = "eps")] Eps = 2, /// /// Enum OnlineBankingSK for value: onlineBanking_SK /// + [EnumMember(Value = "onlineBanking_SK")] OnlineBankingSK = 3, /// /// Enum OnlineBankingCZ for value: onlineBanking_CZ /// + [EnumMember(Value = "onlineBanking_CZ")] OnlineBankingCZ = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("onlineBanking_PL")) - return TypeEnum.OnlineBankingPL; - - if (value.Equals("eps")) - return TypeEnum.Eps; - - if (value.Equals("onlineBanking_SK")) - return TypeEnum.OnlineBankingSK; - if (value.Equals("onlineBanking_CZ")) - return TypeEnum.OnlineBankingCZ; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("onlineBanking_PL")) - return TypeEnum.OnlineBankingPL; - - if (value.Equals("eps")) - return TypeEnum.Eps; - - if (value.Equals("onlineBanking_SK")) - return TypeEnum.OnlineBankingSK; - - if (value.Equals("onlineBanking_CZ")) - return TypeEnum.OnlineBankingCZ; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.OnlineBankingPL) - return "onlineBanking_PL"; - - if (value == TypeEnum.Eps) - return "eps"; - - if (value == TypeEnum.OnlineBankingSK) - return "onlineBanking_SK"; - - if (value == TypeEnum.OnlineBankingCZ) - return "onlineBanking_CZ"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **genericissuer** /// /// **genericissuer** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// The issuer id of the shopper's selected bank. + /// Initializes a new instance of the class. /// - /// The issuer id of the shopper's selected bank. - [JsonPropertyName("issuer")] - public string Issuer { get; set; } - + [JsonConstructorAttribute] + protected GenericIssuerPaymentMethodDetails() { } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// The issuer id of the shopper's selected bank. (required). + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **genericissuer** (required). + public GenericIssuerPaymentMethodDetails(string checkoutAttemptId = default(string), string issuer = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = default(TypeEnum)) + { + this.Issuer = issuer; + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// - /// Used to track the state of RecurringDetailReference + /// The issuer id of the shopper's selected bank. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + /// The issuer id of the shopper's selected bank. + [DataMember(Name = "issuer", IsRequired = false, EmitDefaultValue = false)] + public string Issuer { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -209,170 +131,116 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class GenericIssuerPaymentMethodDetails {\n"); - sb.Append(" Issuer: ").Append(Issuer).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); + sb.Append(" Issuer: ").Append(Issuer).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class GenericIssuerPaymentMethodDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override GenericIssuerPaymentMethodDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option issuer = default; - Option type = default; - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; + return this.Equals(input as GenericIssuerPaymentMethodDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if GenericIssuerPaymentMethodDetails instances are equal + /// + /// Instance of GenericIssuerPaymentMethodDetails to be compared + /// Boolean + public bool Equals(GenericIssuerPaymentMethodDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "issuer": - issuer = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(GenericIssuerPaymentMethodDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!issuer.IsSet) - throw new ArgumentException("Property is required for class GenericIssuerPaymentMethodDetails.", nameof(issuer)); - - if (!type.IsSet) - throw new ArgumentException("Property is required for class GenericIssuerPaymentMethodDetails.", nameof(type)); - - if (issuer.IsSet && issuer.Value == null) - throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class GenericIssuerPaymentMethodDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class GenericIssuerPaymentMethodDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class GenericIssuerPaymentMethodDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class GenericIssuerPaymentMethodDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class GenericIssuerPaymentMethodDetails."); - - return new GenericIssuerPaymentMethodDetails(issuer.Value, type.Value.Value, checkoutAttemptId, recurringDetailReference, storedPaymentMethodId); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Issuer == input.Issuer || + (this.Issuer != null && + this.Issuer.Equals(input.Issuer)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, GenericIssuerPaymentMethodDetails genericIssuerPaymentMethodDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, genericIssuerPaymentMethodDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.Issuer != null) + { + hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, GenericIssuerPaymentMethodDetails genericIssuerPaymentMethodDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (genericIssuerPaymentMethodDetails.Issuer == null) - throw new ArgumentNullException(nameof(genericIssuerPaymentMethodDetails.Issuer), "Property is required for class GenericIssuerPaymentMethodDetails."); - - if (genericIssuerPaymentMethodDetails.CheckoutAttemptIdOption.IsSet && genericIssuerPaymentMethodDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(genericIssuerPaymentMethodDetails.CheckoutAttemptId), "Property is required for class GenericIssuerPaymentMethodDetails."); - - if (genericIssuerPaymentMethodDetails.RecurringDetailReferenceOption.IsSet && genericIssuerPaymentMethodDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(genericIssuerPaymentMethodDetails.RecurringDetailReference), "Property is required for class GenericIssuerPaymentMethodDetails."); - - if (genericIssuerPaymentMethodDetails.StoredPaymentMethodIdOption.IsSet && genericIssuerPaymentMethodDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(genericIssuerPaymentMethodDetails.StoredPaymentMethodId), "Property is required for class GenericIssuerPaymentMethodDetails."); - - writer.WriteString("issuer", genericIssuerPaymentMethodDetails.Issuer); - - var typeRawValue = GenericIssuerPaymentMethodDetails.TypeEnumToJsonValue(genericIssuerPaymentMethodDetails.Type); - writer.WriteString("type", typeRawValue); - if (genericIssuerPaymentMethodDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", genericIssuerPaymentMethodDetails.CheckoutAttemptId); - - if (genericIssuerPaymentMethodDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", genericIssuerPaymentMethodDetails.RecurringDetailReference); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - if (genericIssuerPaymentMethodDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", genericIssuerPaymentMethodDetails.StoredPaymentMethodId); + yield break; } } + } diff --git a/Adyen/Model/Checkout/GooglePayDetails.cs b/Adyen/Model/Checkout/GooglePayDetails.cs index c13bee7c2..ece11396a 100644 --- a/Adyen/Model/Checkout/GooglePayDetails.cs +++ b/Adyen/Model/Checkout/GooglePayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,272 +15,143 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// GooglePayDetails /// - public partial class GooglePayDetails : IValidatableObject + [DataContract(Name = "GooglePayDetails")] + public partial class GooglePayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - /// The checkout attempt identifier. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - /// The selected payment card network. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - /// **googlepay**, **paywithgoogle** (default to TypeEnum.Googlepay) - [JsonConstructor] - public GooglePayDetails(string googlePayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option googlePayCardNetwork = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option threeDS2SdkVersion = default, Option type = default) - { - GooglePayToken = googlePayToken; - CheckoutAttemptIdOption = checkoutAttemptId; - FundingSourceOption = fundingSource; - GooglePayCardNetworkOption = googlePayCardNetwork; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - ThreeDS2SdkVersionOption = threeDS2SdkVersion; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// + [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// + [EnumMember(Value = "debit")] Debit = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static FundingSourceEnum FundingSourceEnumFromString(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) - { - if (value == FundingSourceEnum.Credit) - return "credit"; - - if (value == FundingSourceEnum.Debit) - return "debit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonPropertyName("fundingSource")] - public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } /// /// **googlepay**, **paywithgoogle** /// /// **googlepay**, **paywithgoogle** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Googlepay for value: googlepay /// + [EnumMember(Value = "googlepay")] Googlepay = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("googlepay")) - return TypeEnum.Googlepay; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("googlepay")) - return TypeEnum.Googlepay; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Googlepay) - return "googlepay"; - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **googlepay**, **paywithgoogle** /// /// **googlepay**, **paywithgoogle** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + /// Initializes a new instance of the class. /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - [JsonPropertyName("googlePayToken")] - public string GooglePayToken { get; set; } - + [JsonConstructorAttribute] + protected GooglePayDetails() { } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. + /// The selected payment card network. . + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. (required). + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK.. + /// **googlepay**, **paywithgoogle** (default to TypeEnum.Googlepay). + public GooglePayDetails(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string googlePayCardNetwork = default(string), string googlePayToken = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string threeDS2SdkVersion = default(string), TypeEnum? type = TypeEnum.Googlepay) + { + this.GooglePayToken = googlePayToken; + this.CheckoutAttemptId = checkoutAttemptId; + this.FundingSource = fundingSource; + this.GooglePayCardNetwork = googlePayCardNetwork; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.ThreeDS2SdkVersion = threeDS2SdkVersion; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of GooglePayCardNetwork - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option GooglePayCardNetworkOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The selected payment card network. /// /// The selected payment card network. - [JsonPropertyName("googlePayCardNetwork")] - public string GooglePayCardNetwork { get { return this.GooglePayCardNetworkOption; } set { this.GooglePayCardNetworkOption = new Option(value); } } + [DataMember(Name = "googlePayCardNetwork", EmitDefaultValue = false)] + public string GooglePayCardNetwork { get; set; } /// - /// Used to track the state of RecurringDetailReference + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + [DataMember(Name = "googlePayToken", IsRequired = false, EmitDefaultValue = false)] + public string GooglePayToken { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2SdkVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2SdkVersionOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - [JsonPropertyName("threeDS2SdkVersion")] - public string ThreeDS2SdkVersion { get { return this.ThreeDS2SdkVersionOption; } set { this.ThreeDS2SdkVersionOption = new Option(value); } } + [DataMember(Name = "threeDS2SdkVersion", EmitDefaultValue = false)] + public string ThreeDS2SdkVersion { get; set; } /// /// Returns the string presentation of the object @@ -289,10 +161,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class GooglePayDetails {\n"); - sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); sb.Append(" GooglePayCardNetwork: ").Append(GooglePayCardNetwork).Append("\n"); + sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" ThreeDS2SdkVersion: ").Append(ThreeDS2SdkVersion).Append("\n"); @@ -302,207 +174,141 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // GooglePayToken (string) maxLength - if (this.GooglePayToken != null && this.GooglePayToken.Length > 10000) - { - yield return new ValidationResult("Invalid value for GooglePayToken, length must be less than 10000.", new [] { "GooglePayToken" }); - } - - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - // ThreeDS2SdkVersion (string) maxLength - if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) - { - yield return new ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class GooglePayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override GooglePayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option googlePayToken = default; - Option checkoutAttemptId = default; - Option fundingSource = default; - Option googlePayCardNetwork = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option threeDS2SdkVersion = default; - Option type = default; + return this.Equals(input as GooglePayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if GooglePayDetails instances are equal + /// + /// Instance of GooglePayDetails to be compared + /// Boolean + public bool Equals(GooglePayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "googlePayToken": - googlePayToken = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "fundingSource": - string fundingSourceRawValue = utf8JsonReader.GetString(); - if (fundingSourceRawValue != null) - fundingSource = new Option(GooglePayDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); - break; - case "googlePayCardNetwork": - googlePayCardNetwork = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2SdkVersion": - threeDS2SdkVersion = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(GooglePayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!googlePayToken.IsSet) - throw new ArgumentException("Property is required for class GooglePayDetails.", nameof(googlePayToken)); - - if (googlePayToken.IsSet && googlePayToken.Value == null) - throw new ArgumentNullException(nameof(googlePayToken), "Property is not nullable for class GooglePayDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class GooglePayDetails."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class GooglePayDetails."); - - if (googlePayCardNetwork.IsSet && googlePayCardNetwork.Value == null) - throw new ArgumentNullException(nameof(googlePayCardNetwork), "Property is not nullable for class GooglePayDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class GooglePayDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class GooglePayDetails."); - - if (threeDS2SdkVersion.IsSet && threeDS2SdkVersion.Value == null) - throw new ArgumentNullException(nameof(threeDS2SdkVersion), "Property is not nullable for class GooglePayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class GooglePayDetails."); - - return new GooglePayDetails(googlePayToken.Value, checkoutAttemptId, fundingSource, googlePayCardNetwork, recurringDetailReference, storedPaymentMethodId, threeDS2SdkVersion, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource.Equals(input.FundingSource) + ) && + ( + this.GooglePayCardNetwork == input.GooglePayCardNetwork || + (this.GooglePayCardNetwork != null && + this.GooglePayCardNetwork.Equals(input.GooglePayCardNetwork)) + ) && + ( + this.GooglePayToken == input.GooglePayToken || + (this.GooglePayToken != null && + this.GooglePayToken.Equals(input.GooglePayToken)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.ThreeDS2SdkVersion == input.ThreeDS2SdkVersion || + (this.ThreeDS2SdkVersion != null && + this.ThreeDS2SdkVersion.Equals(input.ThreeDS2SdkVersion)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, GooglePayDetails googlePayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, googlePayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + if (this.GooglePayCardNetwork != null) + { + hashCode = (hashCode * 59) + this.GooglePayCardNetwork.GetHashCode(); + } + if (this.GooglePayToken != null) + { + hashCode = (hashCode * 59) + this.GooglePayToken.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.ThreeDS2SdkVersion != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2SdkVersion.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, GooglePayDetails googlePayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (googlePayDetails.GooglePayToken == null) - throw new ArgumentNullException(nameof(googlePayDetails.GooglePayToken), "Property is required for class GooglePayDetails."); - - if (googlePayDetails.CheckoutAttemptIdOption.IsSet && googlePayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(googlePayDetails.CheckoutAttemptId), "Property is required for class GooglePayDetails."); - - if (googlePayDetails.GooglePayCardNetworkOption.IsSet && googlePayDetails.GooglePayCardNetwork == null) - throw new ArgumentNullException(nameof(googlePayDetails.GooglePayCardNetwork), "Property is required for class GooglePayDetails."); - - if (googlePayDetails.RecurringDetailReferenceOption.IsSet && googlePayDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(googlePayDetails.RecurringDetailReference), "Property is required for class GooglePayDetails."); - - if (googlePayDetails.StoredPaymentMethodIdOption.IsSet && googlePayDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(googlePayDetails.StoredPaymentMethodId), "Property is required for class GooglePayDetails."); - - if (googlePayDetails.ThreeDS2SdkVersionOption.IsSet && googlePayDetails.ThreeDS2SdkVersion == null) - throw new ArgumentNullException(nameof(googlePayDetails.ThreeDS2SdkVersion), "Property is required for class GooglePayDetails."); - - writer.WriteString("googlePayToken", googlePayDetails.GooglePayToken); - - if (googlePayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", googlePayDetails.CheckoutAttemptId); - - var fundingSourceRawValue = GooglePayDetails.FundingSourceEnumToJsonValue(googlePayDetails.FundingSourceOption.Value.Value); - writer.WriteString("fundingSource", fundingSourceRawValue); - if (googlePayDetails.GooglePayCardNetworkOption.IsSet) - writer.WriteString("googlePayCardNetwork", googlePayDetails.GooglePayCardNetwork); - - if (googlePayDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", googlePayDetails.RecurringDetailReference); + // GooglePayToken (string) maxLength + if (this.GooglePayToken != null && this.GooglePayToken.Length > 10000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for GooglePayToken, length must be less than 10000.", new [] { "GooglePayToken" }); + } - if (googlePayDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", googlePayDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - if (googlePayDetails.ThreeDS2SdkVersionOption.IsSet) - writer.WriteString("threeDS2SdkVersion", googlePayDetails.ThreeDS2SdkVersion); + // ThreeDS2SdkVersion (string) maxLength + if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); + } - var typeRawValue = GooglePayDetails.TypeEnumToJsonValue(googlePayDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/GooglePayDonations.cs b/Adyen/Model/Checkout/GooglePayDonations.cs index 6fee1b7b7..610475245 100644 --- a/Adyen/Model/Checkout/GooglePayDonations.cs +++ b/Adyen/Model/Checkout/GooglePayDonations.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,272 +15,143 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// GooglePayDonations /// - public partial class GooglePayDonations : IValidatableObject + [DataContract(Name = "GooglePayDonations")] + public partial class GooglePayDonations : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - /// The checkout attempt identifier. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - /// The selected payment card network. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - /// **googlepay**, **paywithgoogle** (default to TypeEnum.Googlepay) - [JsonConstructor] - public GooglePayDonations(string googlePayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option googlePayCardNetwork = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option threeDS2SdkVersion = default, Option type = default) - { - GooglePayToken = googlePayToken; - CheckoutAttemptIdOption = checkoutAttemptId; - FundingSourceOption = fundingSource; - GooglePayCardNetworkOption = googlePayCardNetwork; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - ThreeDS2SdkVersionOption = threeDS2SdkVersion; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// + [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// + [EnumMember(Value = "debit")] Debit = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static FundingSourceEnum FundingSourceEnumFromString(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) - { - if (value == FundingSourceEnum.Credit) - return "credit"; - - if (value == FundingSourceEnum.Debit) - return "debit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonPropertyName("fundingSource")] - public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } /// /// **googlepay**, **paywithgoogle** /// /// **googlepay**, **paywithgoogle** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Googlepay for value: googlepay /// + [EnumMember(Value = "googlepay")] Googlepay = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("googlepay")) - return TypeEnum.Googlepay; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("googlepay")) - return TypeEnum.Googlepay; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Googlepay) - return "googlepay"; - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **googlepay**, **paywithgoogle** /// /// **googlepay**, **paywithgoogle** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + /// Initializes a new instance of the class. /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - [JsonPropertyName("googlePayToken")] - public string GooglePayToken { get; set; } - + [JsonConstructorAttribute] + protected GooglePayDonations() { } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. + /// The selected payment card network. . + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. (required). + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK.. + /// **googlepay**, **paywithgoogle** (default to TypeEnum.Googlepay). + public GooglePayDonations(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string googlePayCardNetwork = default(string), string googlePayToken = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string threeDS2SdkVersion = default(string), TypeEnum? type = TypeEnum.Googlepay) + { + this.GooglePayToken = googlePayToken; + this.CheckoutAttemptId = checkoutAttemptId; + this.FundingSource = fundingSource; + this.GooglePayCardNetwork = googlePayCardNetwork; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.ThreeDS2SdkVersion = threeDS2SdkVersion; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of GooglePayCardNetwork - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option GooglePayCardNetworkOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The selected payment card network. /// /// The selected payment card network. - [JsonPropertyName("googlePayCardNetwork")] - public string GooglePayCardNetwork { get { return this.GooglePayCardNetworkOption; } set { this.GooglePayCardNetworkOption = new Option(value); } } + [DataMember(Name = "googlePayCardNetwork", EmitDefaultValue = false)] + public string GooglePayCardNetwork { get; set; } /// - /// Used to track the state of RecurringDetailReference + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + [DataMember(Name = "googlePayToken", IsRequired = false, EmitDefaultValue = false)] + public string GooglePayToken { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2SdkVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2SdkVersionOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - [JsonPropertyName("threeDS2SdkVersion")] - public string ThreeDS2SdkVersion { get { return this.ThreeDS2SdkVersionOption; } set { this.ThreeDS2SdkVersionOption = new Option(value); } } + [DataMember(Name = "threeDS2SdkVersion", EmitDefaultValue = false)] + public string ThreeDS2SdkVersion { get; set; } /// /// Returns the string presentation of the object @@ -289,10 +161,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class GooglePayDonations {\n"); - sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); sb.Append(" GooglePayCardNetwork: ").Append(GooglePayCardNetwork).Append("\n"); + sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" ThreeDS2SdkVersion: ").Append(ThreeDS2SdkVersion).Append("\n"); @@ -302,207 +174,141 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // GooglePayToken (string) maxLength - if (this.GooglePayToken != null && this.GooglePayToken.Length > 10000) - { - yield return new ValidationResult("Invalid value for GooglePayToken, length must be less than 10000.", new [] { "GooglePayToken" }); - } - - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - // ThreeDS2SdkVersion (string) maxLength - if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) - { - yield return new ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class GooglePayDonationsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override GooglePayDonations Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option googlePayToken = default; - Option checkoutAttemptId = default; - Option fundingSource = default; - Option googlePayCardNetwork = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option threeDS2SdkVersion = default; - Option type = default; + return this.Equals(input as GooglePayDonations); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if GooglePayDonations instances are equal + /// + /// Instance of GooglePayDonations to be compared + /// Boolean + public bool Equals(GooglePayDonations input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "googlePayToken": - googlePayToken = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "fundingSource": - string fundingSourceRawValue = utf8JsonReader.GetString(); - if (fundingSourceRawValue != null) - fundingSource = new Option(GooglePayDonations.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); - break; - case "googlePayCardNetwork": - googlePayCardNetwork = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2SdkVersion": - threeDS2SdkVersion = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(GooglePayDonations.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!googlePayToken.IsSet) - throw new ArgumentException("Property is required for class GooglePayDonations.", nameof(googlePayToken)); - - if (googlePayToken.IsSet && googlePayToken.Value == null) - throw new ArgumentNullException(nameof(googlePayToken), "Property is not nullable for class GooglePayDonations."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class GooglePayDonations."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class GooglePayDonations."); - - if (googlePayCardNetwork.IsSet && googlePayCardNetwork.Value == null) - throw new ArgumentNullException(nameof(googlePayCardNetwork), "Property is not nullable for class GooglePayDonations."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class GooglePayDonations."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class GooglePayDonations."); - - if (threeDS2SdkVersion.IsSet && threeDS2SdkVersion.Value == null) - throw new ArgumentNullException(nameof(threeDS2SdkVersion), "Property is not nullable for class GooglePayDonations."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class GooglePayDonations."); - - return new GooglePayDonations(googlePayToken.Value, checkoutAttemptId, fundingSource, googlePayCardNetwork, recurringDetailReference, storedPaymentMethodId, threeDS2SdkVersion, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource.Equals(input.FundingSource) + ) && + ( + this.GooglePayCardNetwork == input.GooglePayCardNetwork || + (this.GooglePayCardNetwork != null && + this.GooglePayCardNetwork.Equals(input.GooglePayCardNetwork)) + ) && + ( + this.GooglePayToken == input.GooglePayToken || + (this.GooglePayToken != null && + this.GooglePayToken.Equals(input.GooglePayToken)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.ThreeDS2SdkVersion == input.ThreeDS2SdkVersion || + (this.ThreeDS2SdkVersion != null && + this.ThreeDS2SdkVersion.Equals(input.ThreeDS2SdkVersion)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, GooglePayDonations googlePayDonations, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, googlePayDonations, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + if (this.GooglePayCardNetwork != null) + { + hashCode = (hashCode * 59) + this.GooglePayCardNetwork.GetHashCode(); + } + if (this.GooglePayToken != null) + { + hashCode = (hashCode * 59) + this.GooglePayToken.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.ThreeDS2SdkVersion != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2SdkVersion.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, GooglePayDonations googlePayDonations, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (googlePayDonations.GooglePayToken == null) - throw new ArgumentNullException(nameof(googlePayDonations.GooglePayToken), "Property is required for class GooglePayDonations."); - - if (googlePayDonations.CheckoutAttemptIdOption.IsSet && googlePayDonations.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(googlePayDonations.CheckoutAttemptId), "Property is required for class GooglePayDonations."); - - if (googlePayDonations.GooglePayCardNetworkOption.IsSet && googlePayDonations.GooglePayCardNetwork == null) - throw new ArgumentNullException(nameof(googlePayDonations.GooglePayCardNetwork), "Property is required for class GooglePayDonations."); - - if (googlePayDonations.RecurringDetailReferenceOption.IsSet && googlePayDonations.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(googlePayDonations.RecurringDetailReference), "Property is required for class GooglePayDonations."); - - if (googlePayDonations.StoredPaymentMethodIdOption.IsSet && googlePayDonations.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(googlePayDonations.StoredPaymentMethodId), "Property is required for class GooglePayDonations."); - - if (googlePayDonations.ThreeDS2SdkVersionOption.IsSet && googlePayDonations.ThreeDS2SdkVersion == null) - throw new ArgumentNullException(nameof(googlePayDonations.ThreeDS2SdkVersion), "Property is required for class GooglePayDonations."); - - writer.WriteString("googlePayToken", googlePayDonations.GooglePayToken); - - if (googlePayDonations.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", googlePayDonations.CheckoutAttemptId); - - var fundingSourceRawValue = GooglePayDonations.FundingSourceEnumToJsonValue(googlePayDonations.FundingSourceOption.Value.Value); - writer.WriteString("fundingSource", fundingSourceRawValue); - if (googlePayDonations.GooglePayCardNetworkOption.IsSet) - writer.WriteString("googlePayCardNetwork", googlePayDonations.GooglePayCardNetwork); - - if (googlePayDonations.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", googlePayDonations.RecurringDetailReference); + // GooglePayToken (string) maxLength + if (this.GooglePayToken != null && this.GooglePayToken.Length > 10000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for GooglePayToken, length must be less than 10000.", new [] { "GooglePayToken" }); + } - if (googlePayDonations.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", googlePayDonations.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - if (googlePayDonations.ThreeDS2SdkVersionOption.IsSet) - writer.WriteString("threeDS2SdkVersion", googlePayDonations.ThreeDS2SdkVersion); + // ThreeDS2SdkVersion (string) maxLength + if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); + } - var typeRawValue = GooglePayDonations.TypeEnumToJsonValue(googlePayDonations.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/IdealDetails.cs b/Adyen/Model/Checkout/IdealDetails.cs index 84d1963c2..5468a7ffd 100644 --- a/Adyen/Model/Checkout/IdealDetails.cs +++ b/Adyen/Model/Checkout/IdealDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,164 +15,90 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// IdealDetails /// - public partial class IdealDetails : IValidatableObject + [DataContract(Name = "IdealDetails")] + public partial class IdealDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **ideal** (default to TypeEnum.Ideal) - [JsonConstructor] - public IdealDetails(Option checkoutAttemptId = default, Option issuer = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - IssuerOption = issuer; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **ideal** /// /// **ideal** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Ideal for value: ideal /// + [EnumMember(Value = "ideal")] Ideal = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("ideal")) - return TypeEnum.Ideal; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("ideal")) - return TypeEnum.Ideal; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Ideal) - return "ideal"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **ideal** /// /// **ideal** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **ideal** (default to TypeEnum.Ideal). + public IdealDetails(string checkoutAttemptId = default(string), string issuer = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Ideal) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.Issuer = issuer; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of Issuer - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IssuerOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. /// /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. - [JsonPropertyName("issuer")] - public string Issuer { get { return this.IssuerOption; } set { this.IssuerOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "issuer", EmitDefaultValue = false)] + public string Issuer { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -191,156 +118,106 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class IdealDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override IdealDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option issuer = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as IdealDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if IdealDetails instances are equal + /// + /// Instance of IdealDetails to be compared + /// Boolean + public bool Equals(IdealDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "issuer": - issuer = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(IdealDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class IdealDetails."); - - if (issuer.IsSet && issuer.Value == null) - throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class IdealDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class IdealDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class IdealDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class IdealDetails."); - - return new IdealDetails(checkoutAttemptId, issuer, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Issuer == input.Issuer || + (this.Issuer != null && + this.Issuer.Equals(input.Issuer)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, IdealDetails idealDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, idealDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.Issuer != null) + { + hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, IdealDetails idealDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (idealDetails.CheckoutAttemptIdOption.IsSet && idealDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(idealDetails.CheckoutAttemptId), "Property is required for class IdealDetails."); - - if (idealDetails.IssuerOption.IsSet && idealDetails.Issuer == null) - throw new ArgumentNullException(nameof(idealDetails.Issuer), "Property is required for class IdealDetails."); - - if (idealDetails.RecurringDetailReferenceOption.IsSet && idealDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(idealDetails.RecurringDetailReference), "Property is required for class IdealDetails."); - - if (idealDetails.StoredPaymentMethodIdOption.IsSet && idealDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(idealDetails.StoredPaymentMethodId), "Property is required for class IdealDetails."); - - if (idealDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", idealDetails.CheckoutAttemptId); - - if (idealDetails.IssuerOption.IsSet) - writer.WriteString("issuer", idealDetails.Issuer); - - if (idealDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", idealDetails.RecurringDetailReference); - - if (idealDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", idealDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = IdealDetails.TypeEnumToJsonValue(idealDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/IdealDonations.cs b/Adyen/Model/Checkout/IdealDonations.cs index 3b78c20bb..421a40fa4 100644 --- a/Adyen/Model/Checkout/IdealDonations.cs +++ b/Adyen/Model/Checkout/IdealDonations.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,164 +15,90 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// IdealDonations /// - public partial class IdealDonations : IValidatableObject + [DataContract(Name = "IdealDonations")] + public partial class IdealDonations : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **ideal** (default to TypeEnum.Ideal) - [JsonConstructor] - public IdealDonations(Option checkoutAttemptId = default, Option issuer = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - IssuerOption = issuer; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **ideal** /// /// **ideal** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Ideal for value: ideal /// + [EnumMember(Value = "ideal")] Ideal = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("ideal")) - return TypeEnum.Ideal; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("ideal")) - return TypeEnum.Ideal; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Ideal) - return "ideal"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **ideal** /// /// **ideal** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **ideal** (default to TypeEnum.Ideal). + public IdealDonations(string checkoutAttemptId = default(string), string issuer = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Ideal) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.Issuer = issuer; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of Issuer - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IssuerOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. /// /// The iDEAL issuer value of the shopper's selected bank. Set this to an **id** of an iDEAL issuer to preselect it. - [JsonPropertyName("issuer")] - public string Issuer { get { return this.IssuerOption; } set { this.IssuerOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "issuer", EmitDefaultValue = false)] + public string Issuer { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -191,156 +118,106 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class IdealDonationsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override IdealDonations Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option issuer = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as IdealDonations); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if IdealDonations instances are equal + /// + /// Instance of IdealDonations to be compared + /// Boolean + public bool Equals(IdealDonations input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "issuer": - issuer = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(IdealDonations.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class IdealDonations."); - - if (issuer.IsSet && issuer.Value == null) - throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class IdealDonations."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class IdealDonations."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class IdealDonations."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class IdealDonations."); - - return new IdealDonations(checkoutAttemptId, issuer, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Issuer == input.Issuer || + (this.Issuer != null && + this.Issuer.Equals(input.Issuer)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, IdealDonations idealDonations, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, idealDonations, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.Issuer != null) + { + hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, IdealDonations idealDonations, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (idealDonations.CheckoutAttemptIdOption.IsSet && idealDonations.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(idealDonations.CheckoutAttemptId), "Property is required for class IdealDonations."); - - if (idealDonations.IssuerOption.IsSet && idealDonations.Issuer == null) - throw new ArgumentNullException(nameof(idealDonations.Issuer), "Property is required for class IdealDonations."); - - if (idealDonations.RecurringDetailReferenceOption.IsSet && idealDonations.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(idealDonations.RecurringDetailReference), "Property is required for class IdealDonations."); - - if (idealDonations.StoredPaymentMethodIdOption.IsSet && idealDonations.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(idealDonations.StoredPaymentMethodId), "Property is required for class IdealDonations."); - - if (idealDonations.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", idealDonations.CheckoutAttemptId); - - if (idealDonations.IssuerOption.IsSet) - writer.WriteString("issuer", idealDonations.Issuer); - - if (idealDonations.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", idealDonations.RecurringDetailReference); - - if (idealDonations.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", idealDonations.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = IdealDonations.TypeEnumToJsonValue(idealDonations.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/InputDetail.cs b/Adyen/Model/Checkout/InputDetail.cs index 8c27d77b9..5d3c25f0a 100644 --- a/Adyen/Model/Checkout/InputDetail.cs +++ b/Adyen/Model/Checkout/InputDetail.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,175 +15,111 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// InputDetail /// - public partial class InputDetail : IValidatableObject + [DataContract(Name = "InputDetail")] + public partial class InputDetail : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Configuration parameters for the required input. - /// Input details can also be provided recursively. - /// Input details can also be provided recursively (deprecated). - /// In case of a select, the URL from which to query the items. - /// In case of a select, the items to choose from. - /// The value to provide in the result. - /// True if this input value is optional. - /// The type of the required input. - /// The value can be pre-filled, if available. - [JsonConstructor] - public InputDetail(Option> varConfiguration = default, Option> details = default, Option> inputDetails = default, Option itemSearchUrl = default, Option> items = default, Option key = default, Option optional = default, Option type = default, Option value = default) + /// Configuration parameters for the required input.. + /// Input details can also be provided recursively.. + /// Input details can also be provided recursively (deprecated).. + /// In case of a select, the URL from which to query the items.. + /// In case of a select, the items to choose from.. + /// The value to provide in the result.. + /// True if this input value is optional.. + /// The type of the required input.. + /// The value can be pre-filled, if available.. + public InputDetail(Dictionary configuration = default(Dictionary), List details = default(List), List inputDetails = default(List), string itemSearchUrl = default(string), List items = default(List), string key = default(string), bool? optional = default(bool?), string type = default(string), string value = default(string)) { - VarConfigurationOption = varConfiguration; - DetailsOption = details; - InputDetailsOption = inputDetails; - ItemSearchUrlOption = itemSearchUrl; - ItemsOption = items; - KeyOption = key; - OptionalOption = optional; - TypeOption = type; - ValueOption = value; - OnCreated(); + this._Configuration = configuration; + this.Details = details; + this.InputDetails = inputDetails; + this.ItemSearchUrl = itemSearchUrl; + this.Items = items; + this.Key = key; + this.Optional = optional; + this.Type = type; + this.Value = value; } - partial void OnCreated(); - - /// - /// Used to track the state of VarConfiguration - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> VarConfigurationOption { get; private set; } - /// /// Configuration parameters for the required input. /// /// Configuration parameters for the required input. - [JsonPropertyName("configuration")] - public Dictionary VarConfiguration { get { return this.VarConfigurationOption; } set { this.VarConfigurationOption = new Option>(value); } } - - /// - /// Used to track the state of Details - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> DetailsOption { get; private set; } + [DataMember(Name = "configuration", EmitDefaultValue = false)] + public Dictionary _Configuration { get; set; } /// /// Input details can also be provided recursively. /// /// Input details can also be provided recursively. - [JsonPropertyName("details")] - public List Details { get { return this.DetailsOption; } set { this.DetailsOption = new Option>(value); } } - - /// - /// Used to track the state of InputDetails - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> InputDetailsOption { get; private set; } + [DataMember(Name = "details", EmitDefaultValue = false)] + public List Details { get; set; } /// /// Input details can also be provided recursively (deprecated). /// /// Input details can also be provided recursively (deprecated). - [JsonPropertyName("inputDetails")] - [Obsolete] - public List InputDetails { get { return this.InputDetailsOption; } set { this.InputDetailsOption = new Option>(value); } } - - /// - /// Used to track the state of ItemSearchUrl - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ItemSearchUrlOption { get; private set; } + [DataMember(Name = "inputDetails", EmitDefaultValue = false)] + [Obsolete("")] + public List InputDetails { get; set; } /// /// In case of a select, the URL from which to query the items. /// /// In case of a select, the URL from which to query the items. - [JsonPropertyName("itemSearchUrl")] - public string ItemSearchUrl { get { return this.ItemSearchUrlOption; } set { this.ItemSearchUrlOption = new Option(value); } } - - /// - /// Used to track the state of Items - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> ItemsOption { get; private set; } + [DataMember(Name = "itemSearchUrl", EmitDefaultValue = false)] + public string ItemSearchUrl { get; set; } /// /// In case of a select, the items to choose from. /// /// In case of a select, the items to choose from. - [JsonPropertyName("items")] - public List Items { get { return this.ItemsOption; } set { this.ItemsOption = new Option>(value); } } - - /// - /// Used to track the state of Key - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option KeyOption { get; private set; } + [DataMember(Name = "items", EmitDefaultValue = false)] + public List Items { get; set; } /// /// The value to provide in the result. /// /// The value to provide in the result. - [JsonPropertyName("key")] - public string Key { get { return this.KeyOption; } set { this.KeyOption = new Option(value); } } - - /// - /// Used to track the state of Optional - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OptionalOption { get; private set; } + [DataMember(Name = "key", EmitDefaultValue = false)] + public string Key { get; set; } /// /// True if this input value is optional. /// /// True if this input value is optional. - [JsonPropertyName("optional")] - public bool? Optional { get { return this.OptionalOption; } set { this.OptionalOption = new Option(value); } } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } + [DataMember(Name = "optional", EmitDefaultValue = false)] + public bool? Optional { get; set; } /// /// The type of the required input. /// /// The type of the required input. - [JsonPropertyName("type")] - public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - - /// - /// Used to track the state of Value - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ValueOption { get; private set; } + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } /// /// The value can be pre-filled, if available. /// /// The value can be pre-filled, if available. - [JsonPropertyName("value")] - public string Value { get { return this.ValueOption; } set { this.ValueOption = new Option(value); } } + [DataMember(Name = "value", EmitDefaultValue = false)] + public string Value { get; set; } /// /// Returns the string presentation of the object @@ -192,7 +129,7 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class InputDetail {\n"); - sb.Append(" VarConfiguration: ").Append(VarConfiguration).Append("\n"); + sb.Append(" _Configuration: ").Append(_Configuration).Append("\n"); sb.Append(" Details: ").Append(Details).Append("\n"); sb.Append(" InputDetails: ").Append(InputDetails).Append("\n"); sb.Append(" ItemSearchUrl: ").Append(ItemSearchUrl).Append("\n"); @@ -206,213 +143,140 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class InputDetailJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override InputDetail Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option> varConfiguration = default; - Option> details = default; - Option> inputDetails = default; - Option itemSearchUrl = default; - Option> items = default; - Option key = default; - Option optional = default; - Option type = default; - Option value = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "configuration": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varConfiguration = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "details": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - details = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "inputDetails": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - inputDetails = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "itemSearchUrl": - itemSearchUrl = new Option(utf8JsonReader.GetString()); - break; - case "items": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - items = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "key": - key = new Option(utf8JsonReader.GetString()); - break; - case "optional": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - optional = new Option(utf8JsonReader.GetBoolean()); - break; - case "type": - type = new Option(utf8JsonReader.GetString()); - break; - case "value": - value = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (varConfiguration.IsSet && varConfiguration.Value == null) - throw new ArgumentNullException(nameof(varConfiguration), "Property is not nullable for class InputDetail."); - - if (details.IsSet && details.Value == null) - throw new ArgumentNullException(nameof(details), "Property is not nullable for class InputDetail."); - - if (inputDetails.IsSet && inputDetails.Value == null) - throw new ArgumentNullException(nameof(inputDetails), "Property is not nullable for class InputDetail."); - - if (itemSearchUrl.IsSet && itemSearchUrl.Value == null) - throw new ArgumentNullException(nameof(itemSearchUrl), "Property is not nullable for class InputDetail."); - - if (items.IsSet && items.Value == null) - throw new ArgumentNullException(nameof(items), "Property is not nullable for class InputDetail."); - - if (key.IsSet && key.Value == null) - throw new ArgumentNullException(nameof(key), "Property is not nullable for class InputDetail."); - - if (optional.IsSet && optional.Value == null) - throw new ArgumentNullException(nameof(optional), "Property is not nullable for class InputDetail."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class InputDetail."); - - if (value.IsSet && value.Value == null) - throw new ArgumentNullException(nameof(value), "Property is not nullable for class InputDetail."); - - return new InputDetail(varConfiguration, details, inputDetails, itemSearchUrl, items, key, optional, type, value); + return this.Equals(input as InputDetail); } /// - /// Serializes a + /// Returns true if InputDetail instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, InputDetail inputDetail, JsonSerializerOptions jsonSerializerOptions) + /// Instance of InputDetail to be compared + /// Boolean + public bool Equals(InputDetail input) { - writer.WriteStartObject(); - - WriteProperties(writer, inputDetail, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this._Configuration == input._Configuration || + this._Configuration != null && + input._Configuration != null && + this._Configuration.SequenceEqual(input._Configuration) + ) && + ( + this.Details == input.Details || + this.Details != null && + input.Details != null && + this.Details.SequenceEqual(input.Details) + ) && + ( + this.InputDetails == input.InputDetails || + this.InputDetails != null && + input.InputDetails != null && + this.InputDetails.SequenceEqual(input.InputDetails) + ) && + ( + this.ItemSearchUrl == input.ItemSearchUrl || + (this.ItemSearchUrl != null && + this.ItemSearchUrl.Equals(input.ItemSearchUrl)) + ) && + ( + this.Items == input.Items || + this.Items != null && + input.Items != null && + this.Items.SequenceEqual(input.Items) + ) && + ( + this.Key == input.Key || + (this.Key != null && + this.Key.Equals(input.Key)) + ) && + ( + this.Optional == input.Optional || + this.Optional.Equals(input.Optional) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ) && + ( + this.Value == input.Value || + (this.Value != null && + this.Value.Equals(input.Value)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, InputDetail inputDetail, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (inputDetail.VarConfigurationOption.IsSet && inputDetail.VarConfiguration == null) - throw new ArgumentNullException(nameof(inputDetail.VarConfiguration), "Property is required for class InputDetail."); - - if (inputDetail.DetailsOption.IsSet && inputDetail.Details == null) - throw new ArgumentNullException(nameof(inputDetail.Details), "Property is required for class InputDetail."); - - if (inputDetail.InputDetailsOption.IsSet && inputDetail.InputDetails == null) - throw new ArgumentNullException(nameof(inputDetail.InputDetails), "Property is required for class InputDetail."); - - if (inputDetail.ItemSearchUrlOption.IsSet && inputDetail.ItemSearchUrl == null) - throw new ArgumentNullException(nameof(inputDetail.ItemSearchUrl), "Property is required for class InputDetail."); - - if (inputDetail.ItemsOption.IsSet && inputDetail.Items == null) - throw new ArgumentNullException(nameof(inputDetail.Items), "Property is required for class InputDetail."); - - if (inputDetail.KeyOption.IsSet && inputDetail.Key == null) - throw new ArgumentNullException(nameof(inputDetail.Key), "Property is required for class InputDetail."); - - if (inputDetail.TypeOption.IsSet && inputDetail.Type == null) - throw new ArgumentNullException(nameof(inputDetail.Type), "Property is required for class InputDetail."); - - if (inputDetail.ValueOption.IsSet && inputDetail.Value == null) - throw new ArgumentNullException(nameof(inputDetail.Value), "Property is required for class InputDetail."); - - if (inputDetail.VarConfigurationOption.IsSet) - { - writer.WritePropertyName("configuration"); - JsonSerializer.Serialize(writer, inputDetail.VarConfiguration, jsonSerializerOptions); - } - if (inputDetail.DetailsOption.IsSet) - { - writer.WritePropertyName("details"); - JsonSerializer.Serialize(writer, inputDetail.Details, jsonSerializerOptions); - } - if (inputDetail.InputDetailsOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("inputDetails"); - JsonSerializer.Serialize(writer, inputDetail.InputDetails, jsonSerializerOptions); - } - if (inputDetail.ItemSearchUrlOption.IsSet) - writer.WriteString("itemSearchUrl", inputDetail.ItemSearchUrl); - - if (inputDetail.ItemsOption.IsSet) - { - writer.WritePropertyName("items"); - JsonSerializer.Serialize(writer, inputDetail.Items, jsonSerializerOptions); + int hashCode = 41; + if (this._Configuration != null) + { + hashCode = (hashCode * 59) + this._Configuration.GetHashCode(); + } + if (this.Details != null) + { + hashCode = (hashCode * 59) + this.Details.GetHashCode(); + } + if (this.InputDetails != null) + { + hashCode = (hashCode * 59) + this.InputDetails.GetHashCode(); + } + if (this.ItemSearchUrl != null) + { + hashCode = (hashCode * 59) + this.ItemSearchUrl.GetHashCode(); + } + if (this.Items != null) + { + hashCode = (hashCode * 59) + this.Items.GetHashCode(); + } + if (this.Key != null) + { + hashCode = (hashCode * 59) + this.Key.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Optional.GetHashCode(); + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + if (this.Value != null) + { + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + } + return hashCode; } - if (inputDetail.KeyOption.IsSet) - writer.WriteString("key", inputDetail.Key); - - if (inputDetail.OptionalOption.IsSet) - writer.WriteBoolean("optional", inputDetail.OptionalOption.Value.Value); - - if (inputDetail.TypeOption.IsSet) - writer.WriteString("type", inputDetail.Type); - - if (inputDetail.ValueOption.IsSet) - writer.WriteString("value", inputDetail.Value); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/InstallmentOption.cs b/Adyen/Model/Checkout/InstallmentOption.cs index e4c8d8f7e..e3fbf4b0b 100644 --- a/Adyen/Model/Checkout/InstallmentOption.cs +++ b/Adyen/Model/Checkout/InstallmentOption.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,272 +15,134 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// InstallmentOption /// - public partial class InstallmentOption : IValidatableObject + [DataContract(Name = "InstallmentOption")] + public partial class InstallmentOption : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The maximum number of installments offered for this payment method. - /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** - /// Preselected number of installments offered for this payment method. - /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. - [JsonConstructor] - public InstallmentOption(Option maxValue = default, Option> plans = default, Option preselectedValue = default, Option> values = default) - { - MaxValueOption = maxValue; - PlansOption = plans; - PreselectedValueOption = preselectedValue; - ValuesOption = values; - OnCreated(); - } - - partial void OnCreated(); - /// /// Defines Plans /// + [JsonConverter(typeof(StringEnumConverter))] public enum PlansEnum { /// /// Enum Bonus for value: bonus /// + [EnumMember(Value = "bonus")] Bonus = 1, /// /// Enum BuynowPaylater for value: buynow_paylater /// + [EnumMember(Value = "buynow_paylater")] BuynowPaylater = 2, /// /// Enum InteresRefundPrctg for value: interes_refund_prctg /// + [EnumMember(Value = "interes_refund_prctg")] InteresRefundPrctg = 3, /// /// Enum InterestBonus for value: interest_bonus /// + [EnumMember(Value = "interest_bonus")] InterestBonus = 4, /// /// Enum NointeresRefundPrctg for value: nointeres_refund_prctg /// + [EnumMember(Value = "nointeres_refund_prctg")] NointeresRefundPrctg = 5, /// /// Enum NointerestBonus for value: nointerest_bonus /// + [EnumMember(Value = "nointerest_bonus")] NointerestBonus = 6, /// /// Enum RefundPrctg for value: refund_prctg /// + [EnumMember(Value = "refund_prctg")] RefundPrctg = 7, /// /// Enum Regular for value: regular /// + [EnumMember(Value = "regular")] Regular = 8, /// /// Enum Revolving for value: revolving /// + [EnumMember(Value = "revolving")] Revolving = 9, /// /// Enum WithInterest for value: with_interest /// + [EnumMember(Value = "with_interest")] WithInterest = 10 - } - - /// - /// Returns a - /// - /// - /// - /// - public static PlansEnum PlansEnumFromString(string value) - { - if (value.Equals("bonus")) - return PlansEnum.Bonus; - - if (value.Equals("buynow_paylater")) - return PlansEnum.BuynowPaylater; - - if (value.Equals("interes_refund_prctg")) - return PlansEnum.InteresRefundPrctg; - if (value.Equals("interest_bonus")) - return PlansEnum.InterestBonus; - - if (value.Equals("nointeres_refund_prctg")) - return PlansEnum.NointeresRefundPrctg; - - if (value.Equals("nointerest_bonus")) - return PlansEnum.NointerestBonus; - - if (value.Equals("refund_prctg")) - return PlansEnum.RefundPrctg; - - if (value.Equals("regular")) - return PlansEnum.Regular; - - if (value.Equals("revolving")) - return PlansEnum.Revolving; + } - if (value.Equals("with_interest")) - return PlansEnum.WithInterest; - throw new NotImplementedException($"Could not convert value to type PlansEnum: '{value}'"); - } /// - /// Returns a + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** /// - /// - /// - public static PlansEnum? PlansEnumFromStringOrDefault(string value) - { - if (value.Equals("bonus")) - return PlansEnum.Bonus; - - if (value.Equals("buynow_paylater")) - return PlansEnum.BuynowPaylater; - - if (value.Equals("interes_refund_prctg")) - return PlansEnum.InteresRefundPrctg; - - if (value.Equals("interest_bonus")) - return PlansEnum.InterestBonus; - - if (value.Equals("nointeres_refund_prctg")) - return PlansEnum.NointeresRefundPrctg; - - if (value.Equals("nointerest_bonus")) - return PlansEnum.NointerestBonus; - - if (value.Equals("refund_prctg")) - return PlansEnum.RefundPrctg; - - if (value.Equals("regular")) - return PlansEnum.Regular; - - if (value.Equals("revolving")) - return PlansEnum.Revolving; - - if (value.Equals("with_interest")) - return PlansEnum.WithInterest; - - return null; - } - + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** + [DataMember(Name = "plans", EmitDefaultValue = false)] + public List Plans { get; set; } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string PlansEnumToJsonValue(PlansEnum value) + /// The maximum number of installments offered for this payment method.. + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving**. + /// Preselected number of installments offered for this payment method.. + /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`.. + public InstallmentOption(int? maxValue = default(int?), List plans = default(List), int? preselectedValue = default(int?), List values = default(List)) { - if (value == PlansEnum.Bonus) - return "bonus"; - - if (value == PlansEnum.BuynowPaylater) - return "buynow_paylater"; - - if (value == PlansEnum.InteresRefundPrctg) - return "interes_refund_prctg"; - - if (value == PlansEnum.InterestBonus) - return "interest_bonus"; - - if (value == PlansEnum.NointeresRefundPrctg) - return "nointeres_refund_prctg"; - - if (value == PlansEnum.NointerestBonus) - return "nointerest_bonus"; - - if (value == PlansEnum.RefundPrctg) - return "refund_prctg"; - - if (value == PlansEnum.Regular) - return "regular"; - - if (value == PlansEnum.Revolving) - return "revolving"; - - if (value == PlansEnum.WithInterest) - return "with_interest"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.MaxValue = maxValue; + this.Plans = plans; + this.PreselectedValue = preselectedValue; + this.Values = values; } - /// - /// Used to track the state of MaxValue - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MaxValueOption { get; private set; } - /// /// The maximum number of installments offered for this payment method. /// /// The maximum number of installments offered for this payment method. - [JsonPropertyName("maxValue")] - public int? MaxValue { get { return this.MaxValueOption; } set { this.MaxValueOption = new Option(value); } } - - /// - /// Used to track the state of Plans - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> PlansOption { get; private set; } - - /// - /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** - /// - /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** - [JsonPropertyName("plans")] - public List Plans { get { return this.PlansOption; } set { this.PlansOption = new Option>(value); } } - - /// - /// Used to track the state of PreselectedValue - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PreselectedValueOption { get; private set; } + [DataMember(Name = "maxValue", EmitDefaultValue = false)] + public int? MaxValue { get; set; } /// /// Preselected number of installments offered for this payment method. /// /// Preselected number of installments offered for this payment method. - [JsonPropertyName("preselectedValue")] - public int? PreselectedValue { get { return this.PreselectedValueOption; } set { this.PreselectedValueOption = new Option(value); } } - - /// - /// Used to track the state of Values - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> ValuesOption { get; private set; } + [DataMember(Name = "preselectedValue", EmitDefaultValue = false)] + public int? PreselectedValue { get; set; } /// /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. /// /// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. - [JsonPropertyName("values")] - public List Values { get { return this.ValuesOption; } set { this.ValuesOption = new Option>(value); } } + [DataMember(Name = "values", EmitDefaultValue = false)] + public List Values { get; set; } /// /// Returns the string presentation of the object @@ -298,141 +161,84 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class InstallmentOptionJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override InstallmentOption Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option maxValue = default; - Option> plans = default; - Option preselectedValue = default; - Option> values = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "maxValue": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - maxValue = new Option(utf8JsonReader.GetInt32()); - break; - case "plans": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - plans = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "preselectedValue": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - preselectedValue = new Option(utf8JsonReader.GetInt32()); - break; - case "values": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - values = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (maxValue.IsSet && maxValue.Value == null) - throw new ArgumentNullException(nameof(maxValue), "Property is not nullable for class InstallmentOption."); - - if (plans.IsSet && plans.Value == null) - throw new ArgumentNullException(nameof(plans), "Property is not nullable for class InstallmentOption."); - - if (preselectedValue.IsSet && preselectedValue.Value == null) - throw new ArgumentNullException(nameof(preselectedValue), "Property is not nullable for class InstallmentOption."); - - if (values.IsSet && values.Value == null) - throw new ArgumentNullException(nameof(values), "Property is not nullable for class InstallmentOption."); - - return new InstallmentOption(maxValue, plans, preselectedValue, values); + return this.Equals(input as InstallmentOption); } /// - /// Serializes a + /// Returns true if InstallmentOption instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, InstallmentOption installmentOption, JsonSerializerOptions jsonSerializerOptions) + /// Instance of InstallmentOption to be compared + /// Boolean + public bool Equals(InstallmentOption input) { - writer.WriteStartObject(); - - WriteProperties(writer, installmentOption, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.MaxValue == input.MaxValue || + this.MaxValue.Equals(input.MaxValue) + ) && + ( + this.Plans == input.Plans || + this.Plans.SequenceEqual(input.Plans) + ) && + ( + this.PreselectedValue == input.PreselectedValue || + this.PreselectedValue.Equals(input.PreselectedValue) + ) && + ( + this.Values == input.Values || + this.Values != null && + input.Values != null && + this.Values.SequenceEqual(input.Values) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, InstallmentOption installmentOption, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (installmentOption.PlansOption.IsSet && installmentOption.Plans == null) - throw new ArgumentNullException(nameof(installmentOption.Plans), "Property is required for class InstallmentOption."); - - if (installmentOption.ValuesOption.IsSet && installmentOption.Values == null) - throw new ArgumentNullException(nameof(installmentOption.Values), "Property is required for class InstallmentOption."); - - if (installmentOption.MaxValueOption.IsSet) - writer.WriteNumber("maxValue", installmentOption.MaxValueOption.Value.Value); - - if (installmentOption.PlansOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("plans"); - JsonSerializer.Serialize(writer, installmentOption.Plans, jsonSerializerOptions); - } - if (installmentOption.PreselectedValueOption.IsSet) - writer.WriteNumber("preselectedValue", installmentOption.PreselectedValueOption.Value.Value); - - if (installmentOption.ValuesOption.IsSet) - { - writer.WritePropertyName("values"); - JsonSerializer.Serialize(writer, installmentOption.Values, jsonSerializerOptions); + int hashCode = 41; + hashCode = (hashCode * 59) + this.MaxValue.GetHashCode(); + hashCode = (hashCode * 59) + this.Plans.GetHashCode(); + hashCode = (hashCode * 59) + this.PreselectedValue.GetHashCode(); + if (this.Values != null) + { + hashCode = (hashCode * 59) + this.Values.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/Installments.cs b/Adyen/Model/Checkout/Installments.cs index a9a957624..9d589e83c 100644 --- a/Adyen/Model/Checkout/Installments.cs +++ b/Adyen/Model/Checkout/Installments.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,250 +15,130 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Installments /// - public partial class Installments : IValidatableObject + [DataContract(Name = "Installments")] + public partial class Installments : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Defines the number of installments. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. This value can be zero for Installments processed in Mexico. - /// Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico) - /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. - [JsonConstructor] - public Installments(int value, Option extra = default, Option plan = default) - { - Value = value; - ExtraOption = extra; - PlanOption = plan; - OnCreated(); - } - - partial void OnCreated(); - /// /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. /// /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. + [JsonConverter(typeof(StringEnumConverter))] public enum PlanEnum { /// /// Enum Bonus for value: bonus /// + [EnumMember(Value = "bonus")] Bonus = 1, /// /// Enum BuynowPaylater for value: buynow_paylater /// + [EnumMember(Value = "buynow_paylater")] BuynowPaylater = 2, /// /// Enum InteresRefundPrctg for value: interes_refund_prctg /// + [EnumMember(Value = "interes_refund_prctg")] InteresRefundPrctg = 3, /// /// Enum InterestBonus for value: interest_bonus /// + [EnumMember(Value = "interest_bonus")] InterestBonus = 4, /// /// Enum NointeresRefundPrctg for value: nointeres_refund_prctg /// + [EnumMember(Value = "nointeres_refund_prctg")] NointeresRefundPrctg = 5, /// /// Enum NointerestBonus for value: nointerest_bonus /// + [EnumMember(Value = "nointerest_bonus")] NointerestBonus = 6, /// /// Enum RefundPrctg for value: refund_prctg /// + [EnumMember(Value = "refund_prctg")] RefundPrctg = 7, /// /// Enum Regular for value: regular /// + [EnumMember(Value = "regular")] Regular = 8, /// /// Enum Revolving for value: revolving /// + [EnumMember(Value = "revolving")] Revolving = 9, /// /// Enum WithInterest for value: with_interest /// + [EnumMember(Value = "with_interest")] WithInterest = 10 + } + /// - /// Returns a + /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. /// - /// - /// - /// - public static PlanEnum PlanEnumFromString(string value) - { - if (value.Equals("bonus")) - return PlanEnum.Bonus; - - if (value.Equals("buynow_paylater")) - return PlanEnum.BuynowPaylater; - - if (value.Equals("interes_refund_prctg")) - return PlanEnum.InteresRefundPrctg; - - if (value.Equals("interest_bonus")) - return PlanEnum.InterestBonus; - - if (value.Equals("nointeres_refund_prctg")) - return PlanEnum.NointeresRefundPrctg; - - if (value.Equals("nointerest_bonus")) - return PlanEnum.NointerestBonus; - - if (value.Equals("refund_prctg")) - return PlanEnum.RefundPrctg; - - if (value.Equals("regular")) - return PlanEnum.Regular; - - if (value.Equals("revolving")) - return PlanEnum.Revolving; - - if (value.Equals("with_interest")) - return PlanEnum.WithInterest; - - throw new NotImplementedException($"Could not convert value to type PlanEnum: '{value}'"); - } - + /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. + [DataMember(Name = "plan", EmitDefaultValue = false)] + public PlanEnum? Plan { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static PlanEnum? PlanEnumFromStringOrDefault(string value) - { - if (value.Equals("bonus")) - return PlanEnum.Bonus; - - if (value.Equals("buynow_paylater")) - return PlanEnum.BuynowPaylater; - - if (value.Equals("interes_refund_prctg")) - return PlanEnum.InteresRefundPrctg; - - if (value.Equals("interest_bonus")) - return PlanEnum.InterestBonus; - - if (value.Equals("nointeres_refund_prctg")) - return PlanEnum.NointeresRefundPrctg; - - if (value.Equals("nointerest_bonus")) - return PlanEnum.NointerestBonus; - - if (value.Equals("refund_prctg")) - return PlanEnum.RefundPrctg; - - if (value.Equals("regular")) - return PlanEnum.Regular; - - if (value.Equals("revolving")) - return PlanEnum.Revolving; - - if (value.Equals("with_interest")) - return PlanEnum.WithInterest; - - return null; - } - + [JsonConstructorAttribute] + protected Installments() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string PlanEnumToJsonValue(PlanEnum? value) + /// Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico) . + /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. . + /// Defines the number of installments. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. This value can be zero for Installments processed in Mexico. (required). + public Installments(int? extra = default(int?), PlanEnum? plan = default(PlanEnum?), int? value = default(int?)) { - if (value == PlanEnum.Bonus) - return "bonus"; - - if (value == PlanEnum.BuynowPaylater) - return "buynow_paylater"; - - if (value == PlanEnum.InteresRefundPrctg) - return "interes_refund_prctg"; - - if (value == PlanEnum.InterestBonus) - return "interest_bonus"; - - if (value == PlanEnum.NointeresRefundPrctg) - return "nointeres_refund_prctg"; - - if (value == PlanEnum.NointerestBonus) - return "nointerest_bonus"; - - if (value == PlanEnum.RefundPrctg) - return "refund_prctg"; - - if (value == PlanEnum.Regular) - return "regular"; - - if (value == PlanEnum.Revolving) - return "revolving"; - - if (value == PlanEnum.WithInterest) - return "with_interest"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.Value = value; + this.Extra = extra; + this.Plan = plan; } /// - /// Used to track the state of Plan - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PlanOption { get; private set; } - - /// - /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. + /// Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico) /// - /// The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. - [JsonPropertyName("plan")] - public PlanEnum? Plan { get { return this.PlanOption; } set { this.PlanOption = new Option(value); } } + /// Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico) + [DataMember(Name = "extra", EmitDefaultValue = false)] + public int? Extra { get; set; } /// /// Defines the number of installments. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. This value can be zero for Installments processed in Mexico. /// /// Defines the number of installments. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. This value can be zero for Installments processed in Mexico. - [JsonPropertyName("value")] - public int Value { get; set; } - - /// - /// Used to track the state of Extra - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExtraOption { get; private set; } - - /// - /// Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico) - /// - /// Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico) - [JsonPropertyName("extra")] - public int? Extra { get { return this.ExtraOption; } set { this.ExtraOption = new Option(value); } } + [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] + public int? Value { get; set; } /// /// Returns the string presentation of the object @@ -267,130 +148,82 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Installments {\n"); - sb.Append(" Value: ").Append(Value).Append("\n"); sb.Append(" Extra: ").Append(Extra).Append("\n"); sb.Append(" Plan: ").Append(Plan).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class InstallmentsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Installments Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option value = default; - Option extra = default; - Option plan = default; + return this.Equals(input as Installments); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if Installments instances are equal + /// + /// Instance of Installments to be compared + /// Boolean + public bool Equals(Installments input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "value": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - value = new Option(utf8JsonReader.GetInt32()); - break; - case "extra": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - extra = new Option(utf8JsonReader.GetInt32()); - break; - case "plan": - string planRawValue = utf8JsonReader.GetString(); - if (planRawValue != null) - plan = new Option(Installments.PlanEnumFromStringOrDefault(planRawValue)); - break; - default: - break; - } - } + return false; } - - if (!value.IsSet) - throw new ArgumentException("Property is required for class Installments.", nameof(value)); - - if (value.IsSet && value.Value == null) - throw new ArgumentNullException(nameof(value), "Property is not nullable for class Installments."); - - if (extra.IsSet && extra.Value == null) - throw new ArgumentNullException(nameof(extra), "Property is not nullable for class Installments."); - - if (plan.IsSet && plan.Value == null) - throw new ArgumentNullException(nameof(plan), "Property is not nullable for class Installments."); - - return new Installments(value.Value.Value, extra, plan); + return + ( + this.Extra == input.Extra || + this.Extra.Equals(input.Extra) + ) && + ( + this.Plan == input.Plan || + this.Plan.Equals(input.Plan) + ) && + ( + this.Value == input.Value || + this.Value.Equals(input.Value) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Installments installments, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, installments, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Extra.GetHashCode(); + hashCode = (hashCode * 59) + this.Plan.GetHashCode(); + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Installments installments, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - writer.WriteNumber("value", installments.Value); - - if (installments.ExtraOption.IsSet) - writer.WriteNumber("extra", installments.ExtraOption.Value.Value); - - var planRawValue = Installments.PlanEnumToJsonValue(installments.PlanOption.Value.Value); - writer.WriteString("plan", planRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Item.cs b/Adyen/Model/Checkout/Item.cs index 4d1d42912..5576c9b63 100644 --- a/Adyen/Model/Checkout/Item.cs +++ b/Adyen/Model/Checkout/Item.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,62 +15,47 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Item /// - public partial class Item : IValidatableObject + [DataContract(Name = "Item")] + public partial class Item : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The value to provide in the result. - /// The display name. - [JsonConstructor] - public Item(Option id = default, Option name = default) + /// The value to provide in the result.. + /// The display name.. + public Item(string id = default(string), string name = default(string)) { - IdOption = id; - NameOption = name; - OnCreated(); + this.Id = id; + this.Name = name; } - partial void OnCreated(); - - /// - /// Used to track the state of Id - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IdOption { get; private set; } - /// /// The value to provide in the result. /// /// The value to provide in the result. - [JsonPropertyName("id")] - public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } - - /// - /// Used to track the state of Name - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NameOption { get; private set; } + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } /// /// The display name. /// /// The display name. - [JsonPropertyName("name")] - public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } /// /// Returns the string presentation of the object @@ -86,112 +72,77 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ItemJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Item Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option id = default; - Option name = default; + return this.Equals(input as Item); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if Item instances are equal + /// + /// Instance of Item to be compared + /// Boolean + public bool Equals(Item input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "id": - id = new Option(utf8JsonReader.GetString()); - break; - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (id.IsSet && id.Value == null) - throw new ArgumentNullException(nameof(id), "Property is not nullable for class Item."); - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class Item."); - - return new Item(id, name); + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Item item, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, item, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Item item, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (item.IdOption.IsSet && item.Id == null) - throw new ArgumentNullException(nameof(item.Id), "Property is required for class Item."); - - if (item.NameOption.IsSet && item.Name == null) - throw new ArgumentNullException(nameof(item.Name), "Property is required for class Item."); - - if (item.IdOption.IsSet) - writer.WriteString("id", item.Id); - - if (item.NameOption.IsSet) - writer.WriteString("name", item.Name); + yield break; } } + } diff --git a/Adyen/Model/Checkout/KlarnaDetails.cs b/Adyen/Model/Checkout/KlarnaDetails.cs index 3f7b01428..49d130722 100644 --- a/Adyen/Model/Checkout/KlarnaDetails.cs +++ b/Adyen/Model/Checkout/KlarnaDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,289 +15,158 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// KlarnaDetails /// - public partial class KlarnaDetails : IValidatableObject + [DataContract(Name = "KlarnaDetails")] + public partial class KlarnaDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The address where to send the invoice. - /// The checkout attempt identifier. - /// The address where the goods should be delivered. - /// Shopper name, date of birth, phone number, and email address. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The type of flow to initiate. - /// **klarna** (default to TypeEnum.Klarna) - [JsonConstructor] - public KlarnaDetails(Option billingAddress = default, Option checkoutAttemptId = default, Option deliveryAddress = default, Option personalDetails = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option subtype = default, TypeEnum type = TypeEnum.Klarna) - { - BillingAddressOption = billingAddress; - CheckoutAttemptIdOption = checkoutAttemptId; - DeliveryAddressOption = deliveryAddress; - PersonalDetailsOption = personalDetails; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - SubtypeOption = subtype; - Type = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **klarna** /// /// **klarna** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Klarna for value: klarna /// + [EnumMember(Value = "klarna")] Klarna = 1, /// /// Enum Klarnapayments for value: klarnapayments /// + [EnumMember(Value = "klarnapayments")] Klarnapayments = 2, /// /// Enum KlarnapaymentsAccount for value: klarnapayments_account /// + [EnumMember(Value = "klarnapayments_account")] KlarnapaymentsAccount = 3, /// /// Enum KlarnapaymentsB2b for value: klarnapayments_b2b /// + [EnumMember(Value = "klarnapayments_b2b")] KlarnapaymentsB2b = 4, /// /// Enum KlarnaPaynow for value: klarna_paynow /// + [EnumMember(Value = "klarna_paynow")] KlarnaPaynow = 5, /// /// Enum KlarnaAccount for value: klarna_account /// + [EnumMember(Value = "klarna_account")] KlarnaAccount = 6, /// /// Enum KlarnaB2b for value: klarna_b2b /// + [EnumMember(Value = "klarna_b2b")] KlarnaB2b = 7 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("klarna")) - return TypeEnum.Klarna; - - if (value.Equals("klarnapayments")) - return TypeEnum.Klarnapayments; - - if (value.Equals("klarnapayments_account")) - return TypeEnum.KlarnapaymentsAccount; - - if (value.Equals("klarnapayments_b2b")) - return TypeEnum.KlarnapaymentsB2b; - - if (value.Equals("klarna_paynow")) - return TypeEnum.KlarnaPaynow; - - if (value.Equals("klarna_account")) - return TypeEnum.KlarnaAccount; - - if (value.Equals("klarna_b2b")) - return TypeEnum.KlarnaB2b; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("klarna")) - return TypeEnum.Klarna; - - if (value.Equals("klarnapayments")) - return TypeEnum.Klarnapayments; - - if (value.Equals("klarnapayments_account")) - return TypeEnum.KlarnapaymentsAccount; - - if (value.Equals("klarnapayments_b2b")) - return TypeEnum.KlarnapaymentsB2b; - - if (value.Equals("klarna_paynow")) - return TypeEnum.KlarnaPaynow; - - if (value.Equals("klarna_account")) - return TypeEnum.KlarnaAccount; - - if (value.Equals("klarna_b2b")) - return TypeEnum.KlarnaB2b; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.Klarna) - return "klarna"; - - if (value == TypeEnum.Klarnapayments) - return "klarnapayments"; - - if (value == TypeEnum.KlarnapaymentsAccount) - return "klarnapayments_account"; - - if (value == TypeEnum.KlarnapaymentsB2b) - return "klarnapayments_b2b"; - - if (value == TypeEnum.KlarnaPaynow) - return "klarna_paynow"; - - if (value == TypeEnum.KlarnaAccount) - return "klarna_account"; - - if (value == TypeEnum.KlarnaB2b) - return "klarna_b2b"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **klarna** /// /// **klarna** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of BillingAddress + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressOption { get; private set; } - + [JsonConstructorAttribute] + protected KlarnaDetails() { } /// - /// The address where to send the invoice. + /// Initializes a new instance of the class. /// - /// The address where to send the invoice. - [JsonPropertyName("billingAddress")] - public string BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } + /// The address where to send the invoice.. + /// The checkout attempt identifier.. + /// The address where the goods should be delivered.. + /// Shopper name, date of birth, phone number, and email address.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The type of flow to initiate.. + /// **klarna** (required) (default to TypeEnum.Klarna). + public KlarnaDetails(string billingAddress = default(string), string checkoutAttemptId = default(string), string deliveryAddress = default(string), string personalDetails = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string subtype = default(string), TypeEnum type = TypeEnum.Klarna) + { + this.Type = type; + this.BillingAddress = billingAddress; + this.CheckoutAttemptId = checkoutAttemptId; + this.DeliveryAddress = deliveryAddress; + this.PersonalDetails = personalDetails; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Subtype = subtype; + } /// - /// Used to track the state of CheckoutAttemptId + /// The address where to send the invoice. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The address where to send the invoice. + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public string BillingAddress { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryAddressOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The address where the goods should be delivered. /// /// The address where the goods should be delivered. - [JsonPropertyName("deliveryAddress")] - public string DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } - - /// - /// Used to track the state of PersonalDetails - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PersonalDetailsOption { get; private set; } + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public string DeliveryAddress { get; set; } /// /// Shopper name, date of birth, phone number, and email address. /// /// Shopper name, date of birth, phone number, and email address. - [JsonPropertyName("personalDetails")] - public string PersonalDetails { get { return this.PersonalDetailsOption; } set { this.PersonalDetailsOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "personalDetails", EmitDefaultValue = false)] + public string PersonalDetails { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of Subtype - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubtypeOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// The type of flow to initiate. /// /// The type of flow to initiate. - [JsonPropertyName("subtype")] - public string Subtype { get { return this.SubtypeOption; } set { this.SubtypeOption = new Option(value); } } + [DataMember(Name = "subtype", EmitDefaultValue = false)] + public string Subtype { get; set; } /// /// Returns the string presentation of the object @@ -319,198 +189,133 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class KlarnaDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override KlarnaDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option billingAddress = default; - Option checkoutAttemptId = default; - Option deliveryAddress = default; - Option personalDetails = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option subtype = default; - Option type = default; + return this.Equals(input as KlarnaDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if KlarnaDetails instances are equal + /// + /// Instance of KlarnaDetails to be compared + /// Boolean + public bool Equals(KlarnaDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "billingAddress": - billingAddress = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "deliveryAddress": - deliveryAddress = new Option(utf8JsonReader.GetString()); - break; - case "personalDetails": - personalDetails = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "subtype": - subtype = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(KlarnaDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class KlarnaDetails.", nameof(type)); - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class KlarnaDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class KlarnaDetails."); - - if (deliveryAddress.IsSet && deliveryAddress.Value == null) - throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class KlarnaDetails."); - - if (personalDetails.IsSet && personalDetails.Value == null) - throw new ArgumentNullException(nameof(personalDetails), "Property is not nullable for class KlarnaDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class KlarnaDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class KlarnaDetails."); - - if (subtype.IsSet && subtype.Value == null) - throw new ArgumentNullException(nameof(subtype), "Property is not nullable for class KlarnaDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class KlarnaDetails."); - - return new KlarnaDetails(billingAddress, checkoutAttemptId, deliveryAddress, personalDetails, recurringDetailReference, storedPaymentMethodId, subtype, type.Value.Value); + return + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + (this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress)) + ) && + ( + this.PersonalDetails == input.PersonalDetails || + (this.PersonalDetails != null && + this.PersonalDetails.Equals(input.PersonalDetails)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Subtype == input.Subtype || + (this.Subtype != null && + this.Subtype.Equals(input.Subtype)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, KlarnaDetails klarnaDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, klarnaDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.DeliveryAddress != null) + { + hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); + } + if (this.PersonalDetails != null) + { + hashCode = (hashCode * 59) + this.PersonalDetails.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.Subtype != null) + { + hashCode = (hashCode * 59) + this.Subtype.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, KlarnaDetails klarnaDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (klarnaDetails.BillingAddressOption.IsSet && klarnaDetails.BillingAddress == null) - throw new ArgumentNullException(nameof(klarnaDetails.BillingAddress), "Property is required for class KlarnaDetails."); - - if (klarnaDetails.CheckoutAttemptIdOption.IsSet && klarnaDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(klarnaDetails.CheckoutAttemptId), "Property is required for class KlarnaDetails."); - - if (klarnaDetails.DeliveryAddressOption.IsSet && klarnaDetails.DeliveryAddress == null) - throw new ArgumentNullException(nameof(klarnaDetails.DeliveryAddress), "Property is required for class KlarnaDetails."); - - if (klarnaDetails.PersonalDetailsOption.IsSet && klarnaDetails.PersonalDetails == null) - throw new ArgumentNullException(nameof(klarnaDetails.PersonalDetails), "Property is required for class KlarnaDetails."); - - if (klarnaDetails.RecurringDetailReferenceOption.IsSet && klarnaDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(klarnaDetails.RecurringDetailReference), "Property is required for class KlarnaDetails."); - - if (klarnaDetails.StoredPaymentMethodIdOption.IsSet && klarnaDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(klarnaDetails.StoredPaymentMethodId), "Property is required for class KlarnaDetails."); - - if (klarnaDetails.SubtypeOption.IsSet && klarnaDetails.Subtype == null) - throw new ArgumentNullException(nameof(klarnaDetails.Subtype), "Property is required for class KlarnaDetails."); - - if (klarnaDetails.BillingAddressOption.IsSet) - writer.WriteString("billingAddress", klarnaDetails.BillingAddress); - - if (klarnaDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", klarnaDetails.CheckoutAttemptId); - - if (klarnaDetails.DeliveryAddressOption.IsSet) - writer.WriteString("deliveryAddress", klarnaDetails.DeliveryAddress); - - if (klarnaDetails.PersonalDetailsOption.IsSet) - writer.WriteString("personalDetails", klarnaDetails.PersonalDetails); - - if (klarnaDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", klarnaDetails.RecurringDetailReference); - - if (klarnaDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", klarnaDetails.StoredPaymentMethodId); - - if (klarnaDetails.SubtypeOption.IsSet) - writer.WriteString("subtype", klarnaDetails.Subtype); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = KlarnaDetails.TypeEnumToJsonValue(klarnaDetails.Type); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Leg.cs b/Adyen/Model/Checkout/Leg.cs index bc73fbfda..72aa82eca 100644 --- a/Adyen/Model/Checkout/Leg.cs +++ b/Adyen/Model/Checkout/Leg.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,174 +15,110 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Leg /// - public partial class Leg : IValidatableObject + [DataContract(Name = "Leg")] + public partial class Leg : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros. - /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros. - /// Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. - /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros. - /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. - /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros. - /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros. - /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character - [JsonConstructor] - public Leg(Option carrierCode = default, Option classOfTravel = default, Option dateOfTravel = default, Option departureAirportCode = default, Option departureTax = default, Option destinationAirportCode = default, Option fareBasisCode = default, Option flightNumber = default, Option stopOverCode = default) + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros.. + /// Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters. + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros.. + /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character. + public Leg(string carrierCode = default(string), string classOfTravel = default(string), DateTime dateOfTravel = default(DateTime), string departureAirportCode = default(string), long? departureTax = default(long?), string destinationAirportCode = default(string), string fareBasisCode = default(string), string flightNumber = default(string), string stopOverCode = default(string)) { - CarrierCodeOption = carrierCode; - ClassOfTravelOption = classOfTravel; - DateOfTravelOption = dateOfTravel; - DepartureAirportCodeOption = departureAirportCode; - DepartureTaxOption = departureTax; - DestinationAirportCodeOption = destinationAirportCode; - FareBasisCodeOption = fareBasisCode; - FlightNumberOption = flightNumber; - StopOverCodeOption = stopOverCode; - OnCreated(); + this.CarrierCode = carrierCode; + this.ClassOfTravel = classOfTravel; + this.DateOfTravel = dateOfTravel; + this.DepartureAirportCode = departureAirportCode; + this.DepartureTax = departureTax; + this.DestinationAirportCode = destinationAirportCode; + this.FareBasisCode = fareBasisCode; + this.FlightNumber = flightNumber; + this.StopOverCode = stopOverCode; } - partial void OnCreated(); - - /// - /// Used to track the state of CarrierCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CarrierCodeOption { get; private set; } - /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("carrierCode")] - public string CarrierCode { get { return this.CarrierCodeOption; } set { this.CarrierCodeOption = new Option(value); } } - - /// - /// Used to track the state of ClassOfTravel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ClassOfTravelOption { get; private set; } + [DataMember(Name = "carrierCode", EmitDefaultValue = false)] + public string CarrierCode { get; set; } /// /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros. /// /// A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("classOfTravel")] - public string ClassOfTravel { get { return this.ClassOfTravelOption; } set { this.ClassOfTravelOption = new Option(value); } } - - /// - /// Used to track the state of DateOfTravel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DateOfTravelOption { get; private set; } + [DataMember(Name = "classOfTravel", EmitDefaultValue = false)] + public string ClassOfTravel { get; set; } /// /// Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters /// /// Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters - [JsonPropertyName("dateOfTravel")] - public DateTime? DateOfTravel { get { return this.DateOfTravelOption; } set { this.DateOfTravelOption = new Option(value); } } - - /// - /// Used to track the state of DepartureAirportCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DepartureAirportCodeOption { get; private set; } + [DataMember(Name = "dateOfTravel", EmitDefaultValue = false)] + public DateTime DateOfTravel { get; set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("departureAirportCode")] - public string DepartureAirportCode { get { return this.DepartureAirportCodeOption; } set { this.DepartureAirportCodeOption = new Option(value); } } - - /// - /// Used to track the state of DepartureTax - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DepartureTaxOption { get; private set; } + [DataMember(Name = "departureAirportCode", EmitDefaultValue = false)] + public string DepartureAirportCode { get; set; } /// /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros. /// /// The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros. - [JsonPropertyName("departureTax")] - public long? DepartureTax { get { return this.DepartureTaxOption; } set { this.DepartureTaxOption = new Option(value); } } - - /// - /// Used to track the state of DestinationAirportCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DestinationAirportCodeOption { get; private set; } + [DataMember(Name = "departureTax", EmitDefaultValue = false)] + public long? DepartureTax { get; set; } /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("destinationAirportCode")] - public string DestinationAirportCode { get { return this.DestinationAirportCodeOption; } set { this.DestinationAirportCodeOption = new Option(value); } } - - /// - /// Used to track the state of FareBasisCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FareBasisCodeOption { get; private set; } + [DataMember(Name = "destinationAirportCode", EmitDefaultValue = false)] + public string DestinationAirportCode { get; set; } /// /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("fareBasisCode")] - public string FareBasisCode { get { return this.FareBasisCodeOption; } set { this.FareBasisCodeOption = new Option(value); } } - - /// - /// Used to track the state of FlightNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FlightNumberOption { get; private set; } + [DataMember(Name = "fareBasisCode", EmitDefaultValue = false)] + public string FareBasisCode { get; set; } /// /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("flightNumber")] - public string FlightNumber { get { return this.FlightNumberOption; } set { this.FlightNumberOption = new Option(value); } } - - /// - /// Used to track the state of StopOverCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StopOverCodeOption { get; private set; } + [DataMember(Name = "flightNumber", EmitDefaultValue = false)] + public string FlightNumber { get; set; } /// /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character /// /// A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character - [JsonPropertyName("stopOverCode")] - public string StopOverCode { get { return this.StopOverCodeOption; } set { this.StopOverCodeOption = new Option(value); } } + [DataMember(Name = "stopOverCode", EmitDefaultValue = false)] + public string StopOverCode { get; set; } /// /// Returns the string presentation of the object @@ -205,204 +142,136 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class LegJsonConverter : JsonConverter - { /// - /// The format to use to serialize DateOfTravel + /// Returns true if objects are equal /// - public static string DateOfTravelFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Leg); + } /// - /// Deserializes json to + /// Returns true if Leg instances are equal /// - /// - /// - /// - /// - /// - public override Leg Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Instance of Leg to be compared + /// Boolean + public bool Equals(Leg input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option carrierCode = default; - Option classOfTravel = default; - Option dateOfTravel = default; - Option departureAirportCode = default; - Option departureTax = default; - Option destinationAirportCode = default; - Option fareBasisCode = default; - Option flightNumber = default; - Option stopOverCode = default; - - while (utf8JsonReader.Read()) + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "carrierCode": - carrierCode = new Option(utf8JsonReader.GetString()); - break; - case "classOfTravel": - classOfTravel = new Option(utf8JsonReader.GetString()); - break; - case "dateOfTravel": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOfTravel = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "departureAirportCode": - departureAirportCode = new Option(utf8JsonReader.GetString()); - break; - case "departureTax": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - departureTax = new Option(utf8JsonReader.GetInt64()); - break; - case "destinationAirportCode": - destinationAirportCode = new Option(utf8JsonReader.GetString()); - break; - case "fareBasisCode": - fareBasisCode = new Option(utf8JsonReader.GetString()); - break; - case "flightNumber": - flightNumber = new Option(utf8JsonReader.GetString()); - break; - case "stopOverCode": - stopOverCode = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (carrierCode.IsSet && carrierCode.Value == null) - throw new ArgumentNullException(nameof(carrierCode), "Property is not nullable for class Leg."); - - if (classOfTravel.IsSet && classOfTravel.Value == null) - throw new ArgumentNullException(nameof(classOfTravel), "Property is not nullable for class Leg."); - - if (dateOfTravel.IsSet && dateOfTravel.Value == null) - throw new ArgumentNullException(nameof(dateOfTravel), "Property is not nullable for class Leg."); - - if (departureAirportCode.IsSet && departureAirportCode.Value == null) - throw new ArgumentNullException(nameof(departureAirportCode), "Property is not nullable for class Leg."); - - if (departureTax.IsSet && departureTax.Value == null) - throw new ArgumentNullException(nameof(departureTax), "Property is not nullable for class Leg."); - - if (destinationAirportCode.IsSet && destinationAirportCode.Value == null) - throw new ArgumentNullException(nameof(destinationAirportCode), "Property is not nullable for class Leg."); - - if (fareBasisCode.IsSet && fareBasisCode.Value == null) - throw new ArgumentNullException(nameof(fareBasisCode), "Property is not nullable for class Leg."); - - if (flightNumber.IsSet && flightNumber.Value == null) - throw new ArgumentNullException(nameof(flightNumber), "Property is not nullable for class Leg."); - - if (stopOverCode.IsSet && stopOverCode.Value == null) - throw new ArgumentNullException(nameof(stopOverCode), "Property is not nullable for class Leg."); - - return new Leg(carrierCode, classOfTravel, dateOfTravel, departureAirportCode, departureTax, destinationAirportCode, fareBasisCode, flightNumber, stopOverCode); + return + ( + this.CarrierCode == input.CarrierCode || + (this.CarrierCode != null && + this.CarrierCode.Equals(input.CarrierCode)) + ) && + ( + this.ClassOfTravel == input.ClassOfTravel || + (this.ClassOfTravel != null && + this.ClassOfTravel.Equals(input.ClassOfTravel)) + ) && + ( + this.DateOfTravel == input.DateOfTravel || + (this.DateOfTravel != null && + this.DateOfTravel.Equals(input.DateOfTravel)) + ) && + ( + this.DepartureAirportCode == input.DepartureAirportCode || + (this.DepartureAirportCode != null && + this.DepartureAirportCode.Equals(input.DepartureAirportCode)) + ) && + ( + this.DepartureTax == input.DepartureTax || + this.DepartureTax.Equals(input.DepartureTax) + ) && + ( + this.DestinationAirportCode == input.DestinationAirportCode || + (this.DestinationAirportCode != null && + this.DestinationAirportCode.Equals(input.DestinationAirportCode)) + ) && + ( + this.FareBasisCode == input.FareBasisCode || + (this.FareBasisCode != null && + this.FareBasisCode.Equals(input.FareBasisCode)) + ) && + ( + this.FlightNumber == input.FlightNumber || + (this.FlightNumber != null && + this.FlightNumber.Equals(input.FlightNumber)) + ) && + ( + this.StopOverCode == input.StopOverCode || + (this.StopOverCode != null && + this.StopOverCode.Equals(input.StopOverCode)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Leg leg, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, leg, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CarrierCode != null) + { + hashCode = (hashCode * 59) + this.CarrierCode.GetHashCode(); + } + if (this.ClassOfTravel != null) + { + hashCode = (hashCode * 59) + this.ClassOfTravel.GetHashCode(); + } + if (this.DateOfTravel != null) + { + hashCode = (hashCode * 59) + this.DateOfTravel.GetHashCode(); + } + if (this.DepartureAirportCode != null) + { + hashCode = (hashCode * 59) + this.DepartureAirportCode.GetHashCode(); + } + hashCode = (hashCode * 59) + this.DepartureTax.GetHashCode(); + if (this.DestinationAirportCode != null) + { + hashCode = (hashCode * 59) + this.DestinationAirportCode.GetHashCode(); + } + if (this.FareBasisCode != null) + { + hashCode = (hashCode * 59) + this.FareBasisCode.GetHashCode(); + } + if (this.FlightNumber != null) + { + hashCode = (hashCode * 59) + this.FlightNumber.GetHashCode(); + } + if (this.StopOverCode != null) + { + hashCode = (hashCode * 59) + this.StopOverCode.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Leg leg, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (leg.CarrierCodeOption.IsSet && leg.CarrierCode == null) - throw new ArgumentNullException(nameof(leg.CarrierCode), "Property is required for class Leg."); - - if (leg.ClassOfTravelOption.IsSet && leg.ClassOfTravel == null) - throw new ArgumentNullException(nameof(leg.ClassOfTravel), "Property is required for class Leg."); - - if (leg.DepartureAirportCodeOption.IsSet && leg.DepartureAirportCode == null) - throw new ArgumentNullException(nameof(leg.DepartureAirportCode), "Property is required for class Leg."); - - if (leg.DestinationAirportCodeOption.IsSet && leg.DestinationAirportCode == null) - throw new ArgumentNullException(nameof(leg.DestinationAirportCode), "Property is required for class Leg."); - - if (leg.FareBasisCodeOption.IsSet && leg.FareBasisCode == null) - throw new ArgumentNullException(nameof(leg.FareBasisCode), "Property is required for class Leg."); - - if (leg.FlightNumberOption.IsSet && leg.FlightNumber == null) - throw new ArgumentNullException(nameof(leg.FlightNumber), "Property is required for class Leg."); - - if (leg.StopOverCodeOption.IsSet && leg.StopOverCode == null) - throw new ArgumentNullException(nameof(leg.StopOverCode), "Property is required for class Leg."); - - if (leg.CarrierCodeOption.IsSet) - writer.WriteString("carrierCode", leg.CarrierCode); - - if (leg.ClassOfTravelOption.IsSet) - writer.WriteString("classOfTravel", leg.ClassOfTravel); - - if (leg.DateOfTravelOption.IsSet) - writer.WriteString("dateOfTravel", leg.DateOfTravelOption.Value.Value.ToString(DateOfTravelFormat)); - - if (leg.DepartureAirportCodeOption.IsSet) - writer.WriteString("departureAirportCode", leg.DepartureAirportCode); - - if (leg.DepartureTaxOption.IsSet) - writer.WriteNumber("departureTax", leg.DepartureTaxOption.Value.Value); - - if (leg.DestinationAirportCodeOption.IsSet) - writer.WriteString("destinationAirportCode", leg.DestinationAirportCode); - - if (leg.FareBasisCodeOption.IsSet) - writer.WriteString("fareBasisCode", leg.FareBasisCode); - - if (leg.FlightNumberOption.IsSet) - writer.WriteString("flightNumber", leg.FlightNumber); - - if (leg.StopOverCodeOption.IsSet) - writer.WriteString("stopOverCode", leg.StopOverCode); + yield break; } } + } diff --git a/Adyen/Model/Checkout/LineItem.cs b/Adyen/Model/Checkout/LineItem.cs index 40df613c1..987a173fa 100644 --- a/Adyen/Model/Checkout/LineItem.cs +++ b/Adyen/Model/Checkout/LineItem.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,318 +15,191 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// LineItem /// - public partial class LineItem : IValidatableObject + [DataContract(Name = "LineItem")] + public partial class LineItem : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Item amount excluding the tax, in minor units. - /// Item amount including the tax, in minor units. - /// Brand of the item. - /// Color of the item. - /// Description of the line item. - /// ID of the line item. - /// Link to the picture of the purchased item. - /// Item category, used by the payment methods PayPal and Ratepay. - /// Manufacturer of the item. - /// Marketplace seller id. - /// Link to the purchased item. - /// Number of items. - /// Email associated with the given product in the basket (usually in electronic gift cards). - /// Size of the item. - /// Stock keeping unit. - /// Tax amount, in minor units. - /// Tax percentage, in minor units. - /// Universal Product Code. - [JsonConstructor] - public LineItem(Option amountExcludingTax = default, Option amountIncludingTax = default, Option brand = default, Option color = default, Option description = default, Option id = default, Option imageUrl = default, Option itemCategory = default, Option manufacturer = default, Option marketplaceSellerId = default, Option productUrl = default, Option quantity = default, Option receiverEmail = default, Option size = default, Option sku = default, Option taxAmount = default, Option taxPercentage = default, Option upc = default) + /// Item amount excluding the tax, in minor units.. + /// Item amount including the tax, in minor units.. + /// Brand of the item.. + /// Color of the item.. + /// Description of the line item.. + /// ID of the line item.. + /// Link to the picture of the purchased item.. + /// Item category, used by the payment methods PayPal and Ratepay.. + /// Manufacturer of the item.. + /// Marketplace seller id.. + /// Link to the purchased item.. + /// Number of items.. + /// Email associated with the given product in the basket (usually in electronic gift cards).. + /// Size of the item.. + /// Stock keeping unit.. + /// Tax amount, in minor units.. + /// Tax percentage, in minor units.. + /// Universal Product Code.. + public LineItem(long? amountExcludingTax = default(long?), long? amountIncludingTax = default(long?), string brand = default(string), string color = default(string), string description = default(string), string id = default(string), string imageUrl = default(string), string itemCategory = default(string), string manufacturer = default(string), string marketplaceSellerId = default(string), string productUrl = default(string), long? quantity = default(long?), string receiverEmail = default(string), string size = default(string), string sku = default(string), long? taxAmount = default(long?), long? taxPercentage = default(long?), string upc = default(string)) { - AmountExcludingTaxOption = amountExcludingTax; - AmountIncludingTaxOption = amountIncludingTax; - BrandOption = brand; - ColorOption = color; - DescriptionOption = description; - IdOption = id; - ImageUrlOption = imageUrl; - ItemCategoryOption = itemCategory; - ManufacturerOption = manufacturer; - MarketplaceSellerIdOption = marketplaceSellerId; - ProductUrlOption = productUrl; - QuantityOption = quantity; - ReceiverEmailOption = receiverEmail; - SizeOption = size; - SkuOption = sku; - TaxAmountOption = taxAmount; - TaxPercentageOption = taxPercentage; - UpcOption = upc; - OnCreated(); + this.AmountExcludingTax = amountExcludingTax; + this.AmountIncludingTax = amountIncludingTax; + this.Brand = brand; + this.Color = color; + this.Description = description; + this.Id = id; + this.ImageUrl = imageUrl; + this.ItemCategory = itemCategory; + this.Manufacturer = manufacturer; + this.MarketplaceSellerId = marketplaceSellerId; + this.ProductUrl = productUrl; + this.Quantity = quantity; + this.ReceiverEmail = receiverEmail; + this.Size = size; + this.Sku = sku; + this.TaxAmount = taxAmount; + this.TaxPercentage = taxPercentage; + this.Upc = upc; } - partial void OnCreated(); - - /// - /// Used to track the state of AmountExcludingTax - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountExcludingTaxOption { get; private set; } - /// /// Item amount excluding the tax, in minor units. /// /// Item amount excluding the tax, in minor units. - [JsonPropertyName("amountExcludingTax")] - public long? AmountExcludingTax { get { return this.AmountExcludingTaxOption; } set { this.AmountExcludingTaxOption = new Option(value); } } - - /// - /// Used to track the state of AmountIncludingTax - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountIncludingTaxOption { get; private set; } + [DataMember(Name = "amountExcludingTax", EmitDefaultValue = false)] + public long? AmountExcludingTax { get; set; } /// /// Item amount including the tax, in minor units. /// /// Item amount including the tax, in minor units. - [JsonPropertyName("amountIncludingTax")] - public long? AmountIncludingTax { get { return this.AmountIncludingTaxOption; } set { this.AmountIncludingTaxOption = new Option(value); } } - - /// - /// Used to track the state of Brand - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BrandOption { get; private set; } + [DataMember(Name = "amountIncludingTax", EmitDefaultValue = false)] + public long? AmountIncludingTax { get; set; } /// /// Brand of the item. /// /// Brand of the item. - [JsonPropertyName("brand")] - public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } - - /// - /// Used to track the state of Color - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ColorOption { get; private set; } + [DataMember(Name = "brand", EmitDefaultValue = false)] + public string Brand { get; set; } /// /// Color of the item. /// /// Color of the item. - [JsonPropertyName("color")] - public string Color { get { return this.ColorOption; } set { this.ColorOption = new Option(value); } } - - /// - /// Used to track the state of Description - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DescriptionOption { get; private set; } + [DataMember(Name = "color", EmitDefaultValue = false)] + public string Color { get; set; } /// /// Description of the line item. /// /// Description of the line item. - [JsonPropertyName("description")] - public string Description { get { return this.DescriptionOption; } set { this.DescriptionOption = new Option(value); } } - - /// - /// Used to track the state of Id - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IdOption { get; private set; } + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } /// /// ID of the line item. /// /// ID of the line item. - [JsonPropertyName("id")] - public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } - - /// - /// Used to track the state of ImageUrl - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ImageUrlOption { get; private set; } + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } /// /// Link to the picture of the purchased item. /// /// Link to the picture of the purchased item. - [JsonPropertyName("imageUrl")] - public string ImageUrl { get { return this.ImageUrlOption; } set { this.ImageUrlOption = new Option(value); } } - - /// - /// Used to track the state of ItemCategory - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ItemCategoryOption { get; private set; } + [DataMember(Name = "imageUrl", EmitDefaultValue = false)] + public string ImageUrl { get; set; } /// /// Item category, used by the payment methods PayPal and Ratepay. /// /// Item category, used by the payment methods PayPal and Ratepay. - [JsonPropertyName("itemCategory")] - public string ItemCategory { get { return this.ItemCategoryOption; } set { this.ItemCategoryOption = new Option(value); } } - - /// - /// Used to track the state of Manufacturer - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ManufacturerOption { get; private set; } + [DataMember(Name = "itemCategory", EmitDefaultValue = false)] + public string ItemCategory { get; set; } /// /// Manufacturer of the item. /// /// Manufacturer of the item. - [JsonPropertyName("manufacturer")] - public string Manufacturer { get { return this.ManufacturerOption; } set { this.ManufacturerOption = new Option(value); } } - - /// - /// Used to track the state of MarketplaceSellerId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MarketplaceSellerIdOption { get; private set; } + [DataMember(Name = "manufacturer", EmitDefaultValue = false)] + public string Manufacturer { get; set; } /// /// Marketplace seller id. /// /// Marketplace seller id. - [JsonPropertyName("marketplaceSellerId")] - public string MarketplaceSellerId { get { return this.MarketplaceSellerIdOption; } set { this.MarketplaceSellerIdOption = new Option(value); } } - - /// - /// Used to track the state of ProductUrl - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ProductUrlOption { get; private set; } + [DataMember(Name = "marketplaceSellerId", EmitDefaultValue = false)] + public string MarketplaceSellerId { get; set; } /// /// Link to the purchased item. /// /// Link to the purchased item. - [JsonPropertyName("productUrl")] - public string ProductUrl { get { return this.ProductUrlOption; } set { this.ProductUrlOption = new Option(value); } } - - /// - /// Used to track the state of Quantity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option QuantityOption { get; private set; } + [DataMember(Name = "productUrl", EmitDefaultValue = false)] + public string ProductUrl { get; set; } /// /// Number of items. /// /// Number of items. - [JsonPropertyName("quantity")] - public long? Quantity { get { return this.QuantityOption; } set { this.QuantityOption = new Option(value); } } - - /// - /// Used to track the state of ReceiverEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReceiverEmailOption { get; private set; } + [DataMember(Name = "quantity", EmitDefaultValue = false)] + public long? Quantity { get; set; } /// /// Email associated with the given product in the basket (usually in electronic gift cards). /// /// Email associated with the given product in the basket (usually in electronic gift cards). - [JsonPropertyName("receiverEmail")] - public string ReceiverEmail { get { return this.ReceiverEmailOption; } set { this.ReceiverEmailOption = new Option(value); } } - - /// - /// Used to track the state of Size - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SizeOption { get; private set; } + [DataMember(Name = "receiverEmail", EmitDefaultValue = false)] + public string ReceiverEmail { get; set; } /// /// Size of the item. /// /// Size of the item. - [JsonPropertyName("size")] - public string Size { get { return this.SizeOption; } set { this.SizeOption = new Option(value); } } - - /// - /// Used to track the state of Sku - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SkuOption { get; private set; } + [DataMember(Name = "size", EmitDefaultValue = false)] + public string Size { get; set; } /// /// Stock keeping unit. /// /// Stock keeping unit. - [JsonPropertyName("sku")] - public string Sku { get { return this.SkuOption; } set { this.SkuOption = new Option(value); } } - - /// - /// Used to track the state of TaxAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TaxAmountOption { get; private set; } + [DataMember(Name = "sku", EmitDefaultValue = false)] + public string Sku { get; set; } /// /// Tax amount, in minor units. /// /// Tax amount, in minor units. - [JsonPropertyName("taxAmount")] - public long? TaxAmount { get { return this.TaxAmountOption; } set { this.TaxAmountOption = new Option(value); } } - - /// - /// Used to track the state of TaxPercentage - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TaxPercentageOption { get; private set; } + [DataMember(Name = "taxAmount", EmitDefaultValue = false)] + public long? TaxAmount { get; set; } /// /// Tax percentage, in minor units. /// /// Tax percentage, in minor units. - [JsonPropertyName("taxPercentage")] - public long? TaxPercentage { get { return this.TaxPercentageOption; } set { this.TaxPercentageOption = new Option(value); } } - - /// - /// Used to track the state of Upc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option UpcOption { get; private set; } + [DataMember(Name = "taxPercentage", EmitDefaultValue = false)] + public long? TaxPercentage { get; set; } /// /// Universal Product Code. /// /// Universal Product Code. - [JsonPropertyName("upc")] - public string Upc { get { return this.UpcOption; } set { this.UpcOption = new Option(value); } } + [DataMember(Name = "upc", EmitDefaultValue = false)] + public string Upc { get; set; } /// /// Returns the string presentation of the object @@ -358,316 +232,207 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // Description (string) maxLength - if (this.Description != null && this.Description.Length > 10000) - { - yield return new ValidationResult("Invalid value for Description, length must be less than 10000.", new [] { "Description" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class LineItemJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override LineItem Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amountExcludingTax = default; - Option amountIncludingTax = default; - Option brand = default; - Option color = default; - Option description = default; - Option id = default; - Option imageUrl = default; - Option itemCategory = default; - Option manufacturer = default; - Option marketplaceSellerId = default; - Option productUrl = default; - Option quantity = default; - Option receiverEmail = default; - Option size = default; - Option sku = default; - Option taxAmount = default; - Option taxPercentage = default; - Option upc = default; + return this.Equals(input as LineItem); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if LineItem instances are equal + /// + /// Instance of LineItem to be compared + /// Boolean + public bool Equals(LineItem input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amountExcludingTax": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amountExcludingTax = new Option(utf8JsonReader.GetInt64()); - break; - case "amountIncludingTax": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amountIncludingTax = new Option(utf8JsonReader.GetInt64()); - break; - case "brand": - brand = new Option(utf8JsonReader.GetString()); - break; - case "color": - color = new Option(utf8JsonReader.GetString()); - break; - case "description": - description = new Option(utf8JsonReader.GetString()); - break; - case "id": - id = new Option(utf8JsonReader.GetString()); - break; - case "imageUrl": - imageUrl = new Option(utf8JsonReader.GetString()); - break; - case "itemCategory": - itemCategory = new Option(utf8JsonReader.GetString()); - break; - case "manufacturer": - manufacturer = new Option(utf8JsonReader.GetString()); - break; - case "marketplaceSellerId": - marketplaceSellerId = new Option(utf8JsonReader.GetString()); - break; - case "productUrl": - productUrl = new Option(utf8JsonReader.GetString()); - break; - case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt64()); - break; - case "receiverEmail": - receiverEmail = new Option(utf8JsonReader.GetString()); - break; - case "size": - size = new Option(utf8JsonReader.GetString()); - break; - case "sku": - sku = new Option(utf8JsonReader.GetString()); - break; - case "taxAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - taxAmount = new Option(utf8JsonReader.GetInt64()); - break; - case "taxPercentage": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - taxPercentage = new Option(utf8JsonReader.GetInt64()); - break; - case "upc": - upc = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (amountExcludingTax.IsSet && amountExcludingTax.Value == null) - throw new ArgumentNullException(nameof(amountExcludingTax), "Property is not nullable for class LineItem."); - - if (amountIncludingTax.IsSet && amountIncludingTax.Value == null) - throw new ArgumentNullException(nameof(amountIncludingTax), "Property is not nullable for class LineItem."); - - if (brand.IsSet && brand.Value == null) - throw new ArgumentNullException(nameof(brand), "Property is not nullable for class LineItem."); - - if (color.IsSet && color.Value == null) - throw new ArgumentNullException(nameof(color), "Property is not nullable for class LineItem."); - - if (description.IsSet && description.Value == null) - throw new ArgumentNullException(nameof(description), "Property is not nullable for class LineItem."); - - if (id.IsSet && id.Value == null) - throw new ArgumentNullException(nameof(id), "Property is not nullable for class LineItem."); - - if (imageUrl.IsSet && imageUrl.Value == null) - throw new ArgumentNullException(nameof(imageUrl), "Property is not nullable for class LineItem."); - - if (itemCategory.IsSet && itemCategory.Value == null) - throw new ArgumentNullException(nameof(itemCategory), "Property is not nullable for class LineItem."); - - if (manufacturer.IsSet && manufacturer.Value == null) - throw new ArgumentNullException(nameof(manufacturer), "Property is not nullable for class LineItem."); - - if (marketplaceSellerId.IsSet && marketplaceSellerId.Value == null) - throw new ArgumentNullException(nameof(marketplaceSellerId), "Property is not nullable for class LineItem."); - - if (productUrl.IsSet && productUrl.Value == null) - throw new ArgumentNullException(nameof(productUrl), "Property is not nullable for class LineItem."); - - if (quantity.IsSet && quantity.Value == null) - throw new ArgumentNullException(nameof(quantity), "Property is not nullable for class LineItem."); - - if (receiverEmail.IsSet && receiverEmail.Value == null) - throw new ArgumentNullException(nameof(receiverEmail), "Property is not nullable for class LineItem."); - - if (size.IsSet && size.Value == null) - throw new ArgumentNullException(nameof(size), "Property is not nullable for class LineItem."); - - if (sku.IsSet && sku.Value == null) - throw new ArgumentNullException(nameof(sku), "Property is not nullable for class LineItem."); - - if (taxAmount.IsSet && taxAmount.Value == null) - throw new ArgumentNullException(nameof(taxAmount), "Property is not nullable for class LineItem."); - - if (taxPercentage.IsSet && taxPercentage.Value == null) - throw new ArgumentNullException(nameof(taxPercentage), "Property is not nullable for class LineItem."); - - if (upc.IsSet && upc.Value == null) - throw new ArgumentNullException(nameof(upc), "Property is not nullable for class LineItem."); - - return new LineItem(amountExcludingTax, amountIncludingTax, brand, color, description, id, imageUrl, itemCategory, manufacturer, marketplaceSellerId, productUrl, quantity, receiverEmail, size, sku, taxAmount, taxPercentage, upc); + return + ( + this.AmountExcludingTax == input.AmountExcludingTax || + this.AmountExcludingTax.Equals(input.AmountExcludingTax) + ) && + ( + this.AmountIncludingTax == input.AmountIncludingTax || + this.AmountIncludingTax.Equals(input.AmountIncludingTax) + ) && + ( + this.Brand == input.Brand || + (this.Brand != null && + this.Brand.Equals(input.Brand)) + ) && + ( + this.Color == input.Color || + (this.Color != null && + this.Color.Equals(input.Color)) + ) && + ( + this.Description == input.Description || + (this.Description != null && + this.Description.Equals(input.Description)) + ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.ImageUrl == input.ImageUrl || + (this.ImageUrl != null && + this.ImageUrl.Equals(input.ImageUrl)) + ) && + ( + this.ItemCategory == input.ItemCategory || + (this.ItemCategory != null && + this.ItemCategory.Equals(input.ItemCategory)) + ) && + ( + this.Manufacturer == input.Manufacturer || + (this.Manufacturer != null && + this.Manufacturer.Equals(input.Manufacturer)) + ) && + ( + this.MarketplaceSellerId == input.MarketplaceSellerId || + (this.MarketplaceSellerId != null && + this.MarketplaceSellerId.Equals(input.MarketplaceSellerId)) + ) && + ( + this.ProductUrl == input.ProductUrl || + (this.ProductUrl != null && + this.ProductUrl.Equals(input.ProductUrl)) + ) && + ( + this.Quantity == input.Quantity || + this.Quantity.Equals(input.Quantity) + ) && + ( + this.ReceiverEmail == input.ReceiverEmail || + (this.ReceiverEmail != null && + this.ReceiverEmail.Equals(input.ReceiverEmail)) + ) && + ( + this.Size == input.Size || + (this.Size != null && + this.Size.Equals(input.Size)) + ) && + ( + this.Sku == input.Sku || + (this.Sku != null && + this.Sku.Equals(input.Sku)) + ) && + ( + this.TaxAmount == input.TaxAmount || + this.TaxAmount.Equals(input.TaxAmount) + ) && + ( + this.TaxPercentage == input.TaxPercentage || + this.TaxPercentage.Equals(input.TaxPercentage) + ) && + ( + this.Upc == input.Upc || + (this.Upc != null && + this.Upc.Equals(input.Upc)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, LineItem lineItem, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, lineItem, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.AmountExcludingTax.GetHashCode(); + hashCode = (hashCode * 59) + this.AmountIncludingTax.GetHashCode(); + if (this.Brand != null) + { + hashCode = (hashCode * 59) + this.Brand.GetHashCode(); + } + if (this.Color != null) + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } + if (this.Description != null) + { + hashCode = (hashCode * 59) + this.Description.GetHashCode(); + } + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.ImageUrl != null) + { + hashCode = (hashCode * 59) + this.ImageUrl.GetHashCode(); + } + if (this.ItemCategory != null) + { + hashCode = (hashCode * 59) + this.ItemCategory.GetHashCode(); + } + if (this.Manufacturer != null) + { + hashCode = (hashCode * 59) + this.Manufacturer.GetHashCode(); + } + if (this.MarketplaceSellerId != null) + { + hashCode = (hashCode * 59) + this.MarketplaceSellerId.GetHashCode(); + } + if (this.ProductUrl != null) + { + hashCode = (hashCode * 59) + this.ProductUrl.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); + if (this.ReceiverEmail != null) + { + hashCode = (hashCode * 59) + this.ReceiverEmail.GetHashCode(); + } + if (this.Size != null) + { + hashCode = (hashCode * 59) + this.Size.GetHashCode(); + } + if (this.Sku != null) + { + hashCode = (hashCode * 59) + this.Sku.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TaxAmount.GetHashCode(); + hashCode = (hashCode * 59) + this.TaxPercentage.GetHashCode(); + if (this.Upc != null) + { + hashCode = (hashCode * 59) + this.Upc.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, LineItem lineItem, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (lineItem.BrandOption.IsSet && lineItem.Brand == null) - throw new ArgumentNullException(nameof(lineItem.Brand), "Property is required for class LineItem."); - - if (lineItem.ColorOption.IsSet && lineItem.Color == null) - throw new ArgumentNullException(nameof(lineItem.Color), "Property is required for class LineItem."); - - if (lineItem.DescriptionOption.IsSet && lineItem.Description == null) - throw new ArgumentNullException(nameof(lineItem.Description), "Property is required for class LineItem."); - - if (lineItem.IdOption.IsSet && lineItem.Id == null) - throw new ArgumentNullException(nameof(lineItem.Id), "Property is required for class LineItem."); - - if (lineItem.ImageUrlOption.IsSet && lineItem.ImageUrl == null) - throw new ArgumentNullException(nameof(lineItem.ImageUrl), "Property is required for class LineItem."); - - if (lineItem.ItemCategoryOption.IsSet && lineItem.ItemCategory == null) - throw new ArgumentNullException(nameof(lineItem.ItemCategory), "Property is required for class LineItem."); - - if (lineItem.ManufacturerOption.IsSet && lineItem.Manufacturer == null) - throw new ArgumentNullException(nameof(lineItem.Manufacturer), "Property is required for class LineItem."); - - if (lineItem.MarketplaceSellerIdOption.IsSet && lineItem.MarketplaceSellerId == null) - throw new ArgumentNullException(nameof(lineItem.MarketplaceSellerId), "Property is required for class LineItem."); - - if (lineItem.ProductUrlOption.IsSet && lineItem.ProductUrl == null) - throw new ArgumentNullException(nameof(lineItem.ProductUrl), "Property is required for class LineItem."); - - if (lineItem.ReceiverEmailOption.IsSet && lineItem.ReceiverEmail == null) - throw new ArgumentNullException(nameof(lineItem.ReceiverEmail), "Property is required for class LineItem."); - - if (lineItem.SizeOption.IsSet && lineItem.Size == null) - throw new ArgumentNullException(nameof(lineItem.Size), "Property is required for class LineItem."); - - if (lineItem.SkuOption.IsSet && lineItem.Sku == null) - throw new ArgumentNullException(nameof(lineItem.Sku), "Property is required for class LineItem."); - - if (lineItem.UpcOption.IsSet && lineItem.Upc == null) - throw new ArgumentNullException(nameof(lineItem.Upc), "Property is required for class LineItem."); - - if (lineItem.AmountExcludingTaxOption.IsSet) - writer.WriteNumber("amountExcludingTax", lineItem.AmountExcludingTaxOption.Value.Value); - - if (lineItem.AmountIncludingTaxOption.IsSet) - writer.WriteNumber("amountIncludingTax", lineItem.AmountIncludingTaxOption.Value.Value); - - if (lineItem.BrandOption.IsSet) - writer.WriteString("brand", lineItem.Brand); - - if (lineItem.ColorOption.IsSet) - writer.WriteString("color", lineItem.Color); - - if (lineItem.DescriptionOption.IsSet) - writer.WriteString("description", lineItem.Description); - - if (lineItem.IdOption.IsSet) - writer.WriteString("id", lineItem.Id); - - if (lineItem.ImageUrlOption.IsSet) - writer.WriteString("imageUrl", lineItem.ImageUrl); - - if (lineItem.ItemCategoryOption.IsSet) - writer.WriteString("itemCategory", lineItem.ItemCategory); - - if (lineItem.ManufacturerOption.IsSet) - writer.WriteString("manufacturer", lineItem.Manufacturer); - - if (lineItem.MarketplaceSellerIdOption.IsSet) - writer.WriteString("marketplaceSellerId", lineItem.MarketplaceSellerId); - - if (lineItem.ProductUrlOption.IsSet) - writer.WriteString("productUrl", lineItem.ProductUrl); - - if (lineItem.QuantityOption.IsSet) - writer.WriteNumber("quantity", lineItem.QuantityOption.Value.Value); - - if (lineItem.ReceiverEmailOption.IsSet) - writer.WriteString("receiverEmail", lineItem.ReceiverEmail); - - if (lineItem.SizeOption.IsSet) - writer.WriteString("size", lineItem.Size); - - if (lineItem.SkuOption.IsSet) - writer.WriteString("sku", lineItem.Sku); - - if (lineItem.TaxAmountOption.IsSet) - writer.WriteNumber("taxAmount", lineItem.TaxAmountOption.Value.Value); - - if (lineItem.TaxPercentageOption.IsSet) - writer.WriteNumber("taxPercentage", lineItem.TaxPercentageOption.Value.Value); + // Description (string) maxLength + if (this.Description != null && this.Description.Length > 10000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Description, length must be less than 10000.", new [] { "Description" }); + } - if (lineItem.UpcOption.IsSet) - writer.WriteString("upc", lineItem.Upc); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs b/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs index a048a4e88..f91f5d14d 100644 --- a/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs +++ b/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,78 +15,56 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ListStoredPaymentMethodsResponse /// - public partial class ListStoredPaymentMethodsResponse : IValidatableObject + [DataContract(Name = "ListStoredPaymentMethodsResponse")] + public partial class ListStoredPaymentMethodsResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Your merchant account. - /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - /// List of all stored payment methods. - [JsonConstructor] - public ListStoredPaymentMethodsResponse(Option merchantAccount = default, Option shopperReference = default, Option> storedPaymentMethods = default) + /// Your merchant account.. + /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address.. + /// List of all stored payment methods.. + public ListStoredPaymentMethodsResponse(string merchantAccount = default(string), string shopperReference = default(string), List storedPaymentMethods = default(List)) { - MerchantAccountOption = merchantAccount; - ShopperReferenceOption = shopperReference; - StoredPaymentMethodsOption = storedPaymentMethods; - OnCreated(); + this.MerchantAccount = merchantAccount; + this.ShopperReference = shopperReference; + this.StoredPaymentMethods = storedPaymentMethods; } - partial void OnCreated(); - - /// - /// Used to track the state of MerchantAccount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantAccountOption { get; private set; } - /// /// Your merchant account. /// /// Your merchant account. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get { return this.MerchantAccountOption; } set { this.MerchantAccountOption = new Option(value); } } - - /// - /// Used to track the state of ShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperReferenceOption { get; private set; } + [DataMember(Name = "merchantAccount", EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - [JsonPropertyName("shopperReference")] - public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethods - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> StoredPaymentMethodsOption { get; private set; } + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } /// /// List of all stored payment methods. /// /// List of all stored payment methods. - [JsonPropertyName("storedPaymentMethods")] - public List StoredPaymentMethods { get { return this.StoredPaymentMethodsOption; } set { this.StoredPaymentMethodsOption = new Option>(value); } } + [DataMember(Name = "storedPaymentMethods", EmitDefaultValue = false)] + public List StoredPaymentMethods { get; set; } /// /// Returns the string presentation of the object @@ -103,129 +82,87 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ListStoredPaymentMethodsResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ListStoredPaymentMethodsResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option merchantAccount = default; - Option shopperReference = default; - Option> storedPaymentMethods = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "shopperReference": - shopperReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - storedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class ListStoredPaymentMethodsResponse."); - - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class ListStoredPaymentMethodsResponse."); - - if (storedPaymentMethods.IsSet && storedPaymentMethods.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethods), "Property is not nullable for class ListStoredPaymentMethodsResponse."); - - return new ListStoredPaymentMethodsResponse(merchantAccount, shopperReference, storedPaymentMethods); + return this.Equals(input as ListStoredPaymentMethodsResponse); } /// - /// Serializes a + /// Returns true if ListStoredPaymentMethodsResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ListStoredPaymentMethodsResponse listStoredPaymentMethodsResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of ListStoredPaymentMethodsResponse to be compared + /// Boolean + public bool Equals(ListStoredPaymentMethodsResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, listStoredPaymentMethodsResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.ShopperReference == input.ShopperReference || + (this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference)) + ) && + ( + this.StoredPaymentMethods == input.StoredPaymentMethods || + this.StoredPaymentMethods != null && + input.StoredPaymentMethods != null && + this.StoredPaymentMethods.SequenceEqual(input.StoredPaymentMethods) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ListStoredPaymentMethodsResponse listStoredPaymentMethodsResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (listStoredPaymentMethodsResponse.MerchantAccountOption.IsSet && listStoredPaymentMethodsResponse.MerchantAccount == null) - throw new ArgumentNullException(nameof(listStoredPaymentMethodsResponse.MerchantAccount), "Property is required for class ListStoredPaymentMethodsResponse."); - - if (listStoredPaymentMethodsResponse.ShopperReferenceOption.IsSet && listStoredPaymentMethodsResponse.ShopperReference == null) - throw new ArgumentNullException(nameof(listStoredPaymentMethodsResponse.ShopperReference), "Property is required for class ListStoredPaymentMethodsResponse."); - - if (listStoredPaymentMethodsResponse.StoredPaymentMethodsOption.IsSet && listStoredPaymentMethodsResponse.StoredPaymentMethods == null) - throw new ArgumentNullException(nameof(listStoredPaymentMethodsResponse.StoredPaymentMethods), "Property is required for class ListStoredPaymentMethodsResponse."); - - if (listStoredPaymentMethodsResponse.MerchantAccountOption.IsSet) - writer.WriteString("merchantAccount", listStoredPaymentMethodsResponse.MerchantAccount); - - if (listStoredPaymentMethodsResponse.ShopperReferenceOption.IsSet) - writer.WriteString("shopperReference", listStoredPaymentMethodsResponse.ShopperReference); - - if (listStoredPaymentMethodsResponse.StoredPaymentMethodsOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("storedPaymentMethods"); - JsonSerializer.Serialize(writer, listStoredPaymentMethodsResponse.StoredPaymentMethods, jsonSerializerOptions); + int hashCode = 41; + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.ShopperReference != null) + { + hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); + } + if (this.StoredPaymentMethods != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethods.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/Mandate.cs b/Adyen/Model/Checkout/Mandate.cs index eb480047f..8a41d68e2 100644 --- a/Adyen/Model/Checkout/Mandate.cs +++ b/Adyen/Model/Checkout/Mandate.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,452 +15,220 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Mandate /// - public partial class Mandate : IValidatableObject + [DataContract(Name = "Mandate")] + public partial class Mandate : IEquatable, IValidatableObject { /// - /// Initializes a new instance of the class. + /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. /// - /// The billing amount (in minor units) of the recurring transactions. - /// End date of the billing plan, in YYYY-MM-DD format. - /// The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. - /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. - /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. - /// The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. - /// The number of transactions that can be performed within the given frequency. - /// The message shown by UPI to the shopper on the approval screen. - /// Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date. - [JsonConstructor] - public Mandate(string amount, string endsAt, FrequencyEnum frequency, Option amountRule = default, Option billingAttemptsRule = default, Option billingDay = default, Option count = default, Option remarks = default, Option startsAt = default) + /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + [JsonConverter(typeof(StringEnumConverter))] + public enum AmountRuleEnum { - Amount = amount; - EndsAt = endsAt; - Frequency = frequency; - AmountRuleOption = amountRule; - BillingAttemptsRuleOption = billingAttemptsRule; - BillingDayOption = billingDay; - CountOption = count; - RemarksOption = remarks; - StartsAtOption = startsAt; - OnCreated(); + /// + /// Enum Max for value: max + /// + [EnumMember(Value = "max")] + Max = 1, + + /// + /// Enum Exact for value: exact + /// + [EnumMember(Value = "exact")] + Exact = 2 + } - partial void OnCreated(); + /// + /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + /// + /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. + [DataMember(Name = "amountRule", EmitDefaultValue = false)] + public AmountRuleEnum? AmountRule { get; set; } + /// + /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + /// + /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + [JsonConverter(typeof(StringEnumConverter))] + public enum BillingAttemptsRuleEnum + { + /// + /// Enum On for value: on + /// + [EnumMember(Value = "on")] + On = 1, + + /// + /// Enum Before for value: before + /// + [EnumMember(Value = "before")] + Before = 2, + + /// + /// Enum After for value: after + /// + [EnumMember(Value = "after")] + After = 3 + + } + + + /// + /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + /// + /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. + [DataMember(Name = "billingAttemptsRule", EmitDefaultValue = false)] + public BillingAttemptsRuleEnum? BillingAttemptsRule { get; set; } /// /// The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. /// /// The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. + [JsonConverter(typeof(StringEnumConverter))] public enum FrequencyEnum { /// /// Enum Adhoc for value: adhoc /// + [EnumMember(Value = "adhoc")] Adhoc = 1, /// /// Enum Daily for value: daily /// + [EnumMember(Value = "daily")] Daily = 2, /// /// Enum Weekly for value: weekly /// + [EnumMember(Value = "weekly")] Weekly = 3, /// /// Enum BiWeekly for value: biWeekly /// + [EnumMember(Value = "biWeekly")] BiWeekly = 4, /// /// Enum Monthly for value: monthly /// + [EnumMember(Value = "monthly")] Monthly = 5, /// /// Enum Quarterly for value: quarterly /// + [EnumMember(Value = "quarterly")] Quarterly = 6, /// /// Enum HalfYearly for value: halfYearly /// + [EnumMember(Value = "halfYearly")] HalfYearly = 7, /// /// Enum Yearly for value: yearly /// + [EnumMember(Value = "yearly")] Yearly = 8 - } - - /// - /// Returns a - /// - /// - /// - /// - public static FrequencyEnum FrequencyEnumFromString(string value) - { - if (value.Equals("adhoc")) - return FrequencyEnum.Adhoc; - if (value.Equals("daily")) - return FrequencyEnum.Daily; - - if (value.Equals("weekly")) - return FrequencyEnum.Weekly; - - if (value.Equals("biWeekly")) - return FrequencyEnum.BiWeekly; - - if (value.Equals("monthly")) - return FrequencyEnum.Monthly; - - if (value.Equals("quarterly")) - return FrequencyEnum.Quarterly; - - if (value.Equals("halfYearly")) - return FrequencyEnum.HalfYearly; - - if (value.Equals("yearly")) - return FrequencyEnum.Yearly; - - throw new NotImplementedException($"Could not convert value to type FrequencyEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static FrequencyEnum? FrequencyEnumFromStringOrDefault(string value) - { - if (value.Equals("adhoc")) - return FrequencyEnum.Adhoc; - - if (value.Equals("daily")) - return FrequencyEnum.Daily; - - if (value.Equals("weekly")) - return FrequencyEnum.Weekly; - - if (value.Equals("biWeekly")) - return FrequencyEnum.BiWeekly; - - if (value.Equals("monthly")) - return FrequencyEnum.Monthly; - - if (value.Equals("quarterly")) - return FrequencyEnum.Quarterly; - - if (value.Equals("halfYearly")) - return FrequencyEnum.HalfYearly; - - if (value.Equals("yearly")) - return FrequencyEnum.Yearly; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FrequencyEnumToJsonValue(FrequencyEnum value) - { - if (value == FrequencyEnum.Adhoc) - return "adhoc"; - - if (value == FrequencyEnum.Daily) - return "daily"; - - if (value == FrequencyEnum.Weekly) - return "weekly"; - - if (value == FrequencyEnum.BiWeekly) - return "biWeekly"; - - if (value == FrequencyEnum.Monthly) - return "monthly"; - - if (value == FrequencyEnum.Quarterly) - return "quarterly"; - - if (value == FrequencyEnum.HalfYearly) - return "halfYearly"; - - if (value == FrequencyEnum.Yearly) - return "yearly"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. /// /// The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. - [JsonPropertyName("frequency")] + [DataMember(Name = "frequency", IsRequired = false, EmitDefaultValue = false)] public FrequencyEnum Frequency { get; set; } - - /// - /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. - /// - /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. - public enum AmountRuleEnum - { - /// - /// Enum Max for value: max - /// - Max = 1, - - /// - /// Enum Exact for value: exact - /// - Exact = 2 - } - /// - /// Returns a - /// - /// - /// - /// - public static AmountRuleEnum AmountRuleEnumFromString(string value) - { - if (value.Equals("max")) - return AmountRuleEnum.Max; - - if (value.Equals("exact")) - return AmountRuleEnum.Exact; - - throw new NotImplementedException($"Could not convert value to type AmountRuleEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static AmountRuleEnum? AmountRuleEnumFromStringOrDefault(string value) - { - if (value.Equals("max")) - return AmountRuleEnum.Max; - - if (value.Equals("exact")) - return AmountRuleEnum.Exact; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string AmountRuleEnumToJsonValue(AmountRuleEnum? value) - { - if (value == AmountRuleEnum.Max) - return "max"; - - if (value == AmountRuleEnum.Exact) - return "exact"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of AmountRule - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountRuleOption { get; private set; } - - /// - /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. - /// - /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. - [JsonPropertyName("amountRule")] - public AmountRuleEnum? AmountRule { get { return this.AmountRuleOption; } set { this.AmountRuleOption = new Option(value); } } - - /// - /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. - /// - /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. - public enum BillingAttemptsRuleEnum - { - /// - /// Enum On for value: on - /// - On = 1, - - /// - /// Enum Before for value: before - /// - Before = 2, - - /// - /// Enum After for value: after - /// - After = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static BillingAttemptsRuleEnum BillingAttemptsRuleEnumFromString(string value) - { - if (value.Equals("on")) - return BillingAttemptsRuleEnum.On; - - if (value.Equals("before")) - return BillingAttemptsRuleEnum.Before; - - if (value.Equals("after")) - return BillingAttemptsRuleEnum.After; - - throw new NotImplementedException($"Could not convert value to type BillingAttemptsRuleEnum: '{value}'"); - } - - /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static BillingAttemptsRuleEnum? BillingAttemptsRuleEnumFromStringOrDefault(string value) - { - if (value.Equals("on")) - return BillingAttemptsRuleEnum.On; - - if (value.Equals("before")) - return BillingAttemptsRuleEnum.Before; - - if (value.Equals("after")) - return BillingAttemptsRuleEnum.After; - - return null; - } - + [JsonConstructorAttribute] + protected Mandate() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string BillingAttemptsRuleEnumToJsonValue(BillingAttemptsRuleEnum? value) + /// The billing amount (in minor units) of the recurring transactions. (required). + /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`. . + /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. . + /// The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`.. + /// The number of transactions that can be performed within the given frequency.. + /// End date of the billing plan, in YYYY-MM-DD format. (required). + /// The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. (required). + /// The message shown by UPI to the shopper on the approval screen.. + /// Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date.. + public Mandate(string amount = default(string), AmountRuleEnum? amountRule = default(AmountRuleEnum?), BillingAttemptsRuleEnum? billingAttemptsRule = default(BillingAttemptsRuleEnum?), string billingDay = default(string), string count = default(string), string endsAt = default(string), FrequencyEnum frequency = default(FrequencyEnum), string remarks = default(string), string startsAt = default(string)) { - if (value == BillingAttemptsRuleEnum.On) - return "on"; - - if (value == BillingAttemptsRuleEnum.Before) - return "before"; - - if (value == BillingAttemptsRuleEnum.After) - return "after"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.Amount = amount; + this.EndsAt = endsAt; + this.Frequency = frequency; + this.AmountRule = amountRule; + this.BillingAttemptsRule = billingAttemptsRule; + this.BillingDay = billingDay; + this.Count = count; + this.Remarks = remarks; + this.StartsAt = startsAt; } - /// - /// Used to track the state of BillingAttemptsRule - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAttemptsRuleOption { get; private set; } - - /// - /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. - /// - /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date. - [JsonPropertyName("billingAttemptsRule")] - public BillingAttemptsRuleEnum? BillingAttemptsRule { get { return this.BillingAttemptsRuleOption; } set { this.BillingAttemptsRuleOption = new Option(value); } } - /// /// The billing amount (in minor units) of the recurring transactions. /// /// The billing amount (in minor units) of the recurring transactions. - [JsonPropertyName("amount")] + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] public string Amount { get; set; } - /// - /// End date of the billing plan, in YYYY-MM-DD format. - /// - /// End date of the billing plan, in YYYY-MM-DD format. - [JsonPropertyName("endsAt")] - public string EndsAt { get; set; } - - /// - /// Used to track the state of BillingDay - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingDayOption { get; private set; } - /// /// The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. /// /// The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`. - [JsonPropertyName("billingDay")] - public string BillingDay { get { return this.BillingDayOption; } set { this.BillingDayOption = new Option(value); } } - - /// - /// Used to track the state of Count - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CountOption { get; private set; } + [DataMember(Name = "billingDay", EmitDefaultValue = false)] + public string BillingDay { get; set; } /// /// The number of transactions that can be performed within the given frequency. /// /// The number of transactions that can be performed within the given frequency. - [JsonPropertyName("count")] - public string Count { get { return this.CountOption; } set { this.CountOption = new Option(value); } } + [DataMember(Name = "count", EmitDefaultValue = false)] + public string Count { get; set; } /// - /// Used to track the state of Remarks + /// End date of the billing plan, in YYYY-MM-DD format. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RemarksOption { get; private set; } + /// End date of the billing plan, in YYYY-MM-DD format. + [DataMember(Name = "endsAt", IsRequired = false, EmitDefaultValue = false)] + public string EndsAt { get; set; } /// /// The message shown by UPI to the shopper on the approval screen. /// /// The message shown by UPI to the shopper on the approval screen. - [JsonPropertyName("remarks")] - public string Remarks { get { return this.RemarksOption; } set { this.RemarksOption = new Option(value); } } - - /// - /// Used to track the state of StartsAt - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StartsAtOption { get; private set; } + [DataMember(Name = "remarks", EmitDefaultValue = false)] + public string Remarks { get; set; } /// /// Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date. /// /// Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date. - [JsonPropertyName("startsAt")] - public string StartsAt { get { return this.StartsAtOption; } set { this.StartsAtOption = new Option(value); } } + [DataMember(Name = "startsAt", EmitDefaultValue = false)] + public string StartsAt { get; set; } /// /// Returns the string presentation of the object @@ -470,12 +239,12 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class Mandate {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" EndsAt: ").Append(EndsAt).Append("\n"); - sb.Append(" Frequency: ").Append(Frequency).Append("\n"); sb.Append(" AmountRule: ").Append(AmountRule).Append("\n"); sb.Append(" BillingAttemptsRule: ").Append(BillingAttemptsRule).Append("\n"); sb.Append(" BillingDay: ").Append(BillingDay).Append("\n"); sb.Append(" Count: ").Append(Count).Append("\n"); + sb.Append(" EndsAt: ").Append(EndsAt).Append("\n"); + sb.Append(" Frequency: ").Append(Frequency).Append("\n"); sb.Append(" Remarks: ").Append(Remarks).Append("\n"); sb.Append(" StartsAt: ").Append(StartsAt).Append("\n"); sb.Append("}\n"); @@ -483,204 +252,128 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class MandateJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Mandate Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option endsAt = default; - Option frequency = default; - Option amountRule = default; - Option billingAttemptsRule = default; - Option billingDay = default; - Option count = default; - Option remarks = default; - Option startsAt = default; + return this.Equals(input as Mandate); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if Mandate instances are equal + /// + /// Instance of Mandate to be compared + /// Boolean + public bool Equals(Mandate input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - amount = new Option(utf8JsonReader.GetString()); - break; - case "endsAt": - endsAt = new Option(utf8JsonReader.GetString()); - break; - case "frequency": - string frequencyRawValue = utf8JsonReader.GetString(); - if (frequencyRawValue != null) - frequency = new Option(Mandate.FrequencyEnumFromStringOrDefault(frequencyRawValue)); - break; - case "amountRule": - string amountRuleRawValue = utf8JsonReader.GetString(); - if (amountRuleRawValue != null) - amountRule = new Option(Mandate.AmountRuleEnumFromStringOrDefault(amountRuleRawValue)); - break; - case "billingAttemptsRule": - string billingAttemptsRuleRawValue = utf8JsonReader.GetString(); - if (billingAttemptsRuleRawValue != null) - billingAttemptsRule = new Option(Mandate.BillingAttemptsRuleEnumFromStringOrDefault(billingAttemptsRuleRawValue)); - break; - case "billingDay": - billingDay = new Option(utf8JsonReader.GetString()); - break; - case "count": - count = new Option(utf8JsonReader.GetString()); - break; - case "remarks": - remarks = new Option(utf8JsonReader.GetString()); - break; - case "startsAt": - startsAt = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class Mandate.", nameof(amount)); - - if (!endsAt.IsSet) - throw new ArgumentException("Property is required for class Mandate.", nameof(endsAt)); - - if (!frequency.IsSet) - throw new ArgumentException("Property is required for class Mandate.", nameof(frequency)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class Mandate."); - - if (endsAt.IsSet && endsAt.Value == null) - throw new ArgumentNullException(nameof(endsAt), "Property is not nullable for class Mandate."); - - if (frequency.IsSet && frequency.Value == null) - throw new ArgumentNullException(nameof(frequency), "Property is not nullable for class Mandate."); - - if (amountRule.IsSet && amountRule.Value == null) - throw new ArgumentNullException(nameof(amountRule), "Property is not nullable for class Mandate."); - - if (billingAttemptsRule.IsSet && billingAttemptsRule.Value == null) - throw new ArgumentNullException(nameof(billingAttemptsRule), "Property is not nullable for class Mandate."); - - if (billingDay.IsSet && billingDay.Value == null) - throw new ArgumentNullException(nameof(billingDay), "Property is not nullable for class Mandate."); - - if (count.IsSet && count.Value == null) - throw new ArgumentNullException(nameof(count), "Property is not nullable for class Mandate."); - - if (remarks.IsSet && remarks.Value == null) - throw new ArgumentNullException(nameof(remarks), "Property is not nullable for class Mandate."); - - if (startsAt.IsSet && startsAt.Value == null) - throw new ArgumentNullException(nameof(startsAt), "Property is not nullable for class Mandate."); - - return new Mandate(amount.Value, endsAt.Value, frequency.Value.Value, amountRule, billingAttemptsRule, billingDay, count, remarks, startsAt); + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.AmountRule == input.AmountRule || + this.AmountRule.Equals(input.AmountRule) + ) && + ( + this.BillingAttemptsRule == input.BillingAttemptsRule || + this.BillingAttemptsRule.Equals(input.BillingAttemptsRule) + ) && + ( + this.BillingDay == input.BillingDay || + (this.BillingDay != null && + this.BillingDay.Equals(input.BillingDay)) + ) && + ( + this.Count == input.Count || + (this.Count != null && + this.Count.Equals(input.Count)) + ) && + ( + this.EndsAt == input.EndsAt || + (this.EndsAt != null && + this.EndsAt.Equals(input.EndsAt)) + ) && + ( + this.Frequency == input.Frequency || + this.Frequency.Equals(input.Frequency) + ) && + ( + this.Remarks == input.Remarks || + (this.Remarks != null && + this.Remarks.Equals(input.Remarks)) + ) && + ( + this.StartsAt == input.StartsAt || + (this.StartsAt != null && + this.StartsAt.Equals(input.StartsAt)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Mandate mandate, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, mandate, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AmountRule.GetHashCode(); + hashCode = (hashCode * 59) + this.BillingAttemptsRule.GetHashCode(); + if (this.BillingDay != null) + { + hashCode = (hashCode * 59) + this.BillingDay.GetHashCode(); + } + if (this.Count != null) + { + hashCode = (hashCode * 59) + this.Count.GetHashCode(); + } + if (this.EndsAt != null) + { + hashCode = (hashCode * 59) + this.EndsAt.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Frequency.GetHashCode(); + if (this.Remarks != null) + { + hashCode = (hashCode * 59) + this.Remarks.GetHashCode(); + } + if (this.StartsAt != null) + { + hashCode = (hashCode * 59) + this.StartsAt.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Mandate mandate, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (mandate.Amount == null) - throw new ArgumentNullException(nameof(mandate.Amount), "Property is required for class Mandate."); - - if (mandate.EndsAt == null) - throw new ArgumentNullException(nameof(mandate.EndsAt), "Property is required for class Mandate."); - - if (mandate.BillingDayOption.IsSet && mandate.BillingDay == null) - throw new ArgumentNullException(nameof(mandate.BillingDay), "Property is required for class Mandate."); - - if (mandate.CountOption.IsSet && mandate.Count == null) - throw new ArgumentNullException(nameof(mandate.Count), "Property is required for class Mandate."); - - if (mandate.RemarksOption.IsSet && mandate.Remarks == null) - throw new ArgumentNullException(nameof(mandate.Remarks), "Property is required for class Mandate."); - - if (mandate.StartsAtOption.IsSet && mandate.StartsAt == null) - throw new ArgumentNullException(nameof(mandate.StartsAt), "Property is required for class Mandate."); - - writer.WriteString("amount", mandate.Amount); - - writer.WriteString("endsAt", mandate.EndsAt); - - var frequencyRawValue = Mandate.FrequencyEnumToJsonValue(mandate.Frequency); - writer.WriteString("frequency", frequencyRawValue); - var amountRuleRawValue = Mandate.AmountRuleEnumToJsonValue(mandate.AmountRuleOption.Value.Value); - writer.WriteString("amountRule", amountRuleRawValue); - var billingAttemptsRuleRawValue = Mandate.BillingAttemptsRuleEnumToJsonValue(mandate.BillingAttemptsRuleOption.Value.Value); - writer.WriteString("billingAttemptsRule", billingAttemptsRuleRawValue); - if (mandate.BillingDayOption.IsSet) - writer.WriteString("billingDay", mandate.BillingDay); - - if (mandate.CountOption.IsSet) - writer.WriteString("count", mandate.Count); - - if (mandate.RemarksOption.IsSet) - writer.WriteString("remarks", mandate.Remarks); - - if (mandate.StartsAtOption.IsSet) - writer.WriteString("startsAt", mandate.StartsAt); + yield break; } } + } diff --git a/Adyen/Model/Checkout/MasterpassDetails.cs b/Adyen/Model/Checkout/MasterpassDetails.cs index a483c3a5e..c78db8bd8 100644 --- a/Adyen/Model/Checkout/MasterpassDetails.cs +++ b/Adyen/Model/Checkout/MasterpassDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,208 +15,107 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// MasterpassDetails /// - public partial class MasterpassDetails : IValidatableObject + [DataContract(Name = "MasterpassDetails")] + public partial class MasterpassDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The Masterpass transaction ID. - /// The checkout attempt identifier. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - /// **masterpass** (default to TypeEnum.Masterpass) - [JsonConstructor] - public MasterpassDetails(string masterpassTransactionId, Option checkoutAttemptId = default, Option fundingSource = default, Option type = default) - { - MasterpassTransactionId = masterpassTransactionId; - CheckoutAttemptIdOption = checkoutAttemptId; - FundingSourceOption = fundingSource; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// + [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// + [EnumMember(Value = "debit")] Debit = 2 - } - /// - /// Returns a - /// - /// - /// - /// - public static FundingSourceEnum FundingSourceEnumFromString(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) - { - if (value == FundingSourceEnum.Credit) - return "credit"; - - if (value == FundingSourceEnum.Debit) - return "debit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonPropertyName("fundingSource")] - public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } /// /// **masterpass** /// /// **masterpass** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Masterpass for value: masterpass /// + [EnumMember(Value = "masterpass")] Masterpass = 1 + } + /// - /// Returns a + /// **masterpass** /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("masterpass")) - return TypeEnum.Masterpass; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - + /// **masterpass** + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("masterpass")) - return TypeEnum.Masterpass; - - return null; - } - + [JsonConstructorAttribute] + protected MasterpassDetails() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) + /// The checkout attempt identifier.. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. + /// The Masterpass transaction ID. (required). + /// **masterpass** (default to TypeEnum.Masterpass). + public MasterpassDetails(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string masterpassTransactionId = default(string), TypeEnum? type = TypeEnum.Masterpass) { - if (value == TypeEnum.Masterpass) - return "masterpass"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.MasterpassTransactionId = masterpassTransactionId; + this.CheckoutAttemptId = checkoutAttemptId; + this.FundingSource = fundingSource; + this.Type = type; } /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } - - /// - /// **masterpass** + /// The checkout attempt identifier. /// - /// **masterpass** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The Masterpass transaction ID. /// /// The Masterpass transaction ID. - [JsonPropertyName("masterpassTransactionId")] + [DataMember(Name = "masterpassTransactionId", IsRequired = false, EmitDefaultValue = false)] public string MasterpassTransactionId { get; set; } - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - - /// - /// The checkout attempt identifier. - /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - /// /// Returns the string presentation of the object /// @@ -224,146 +124,96 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class MasterpassDetails {\n"); - sb.Append(" MasterpassTransactionId: ").Append(MasterpassTransactionId).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); + sb.Append(" MasterpassTransactionId: ").Append(MasterpassTransactionId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class MasterpassDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override MasterpassDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option masterpassTransactionId = default; - Option checkoutAttemptId = default; - Option fundingSource = default; - Option type = default; + return this.Equals(input as MasterpassDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if MasterpassDetails instances are equal + /// + /// Instance of MasterpassDetails to be compared + /// Boolean + public bool Equals(MasterpassDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "masterpassTransactionId": - masterpassTransactionId = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "fundingSource": - string fundingSourceRawValue = utf8JsonReader.GetString(); - if (fundingSourceRawValue != null) - fundingSource = new Option(MasterpassDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(MasterpassDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!masterpassTransactionId.IsSet) - throw new ArgumentException("Property is required for class MasterpassDetails.", nameof(masterpassTransactionId)); - - if (masterpassTransactionId.IsSet && masterpassTransactionId.Value == null) - throw new ArgumentNullException(nameof(masterpassTransactionId), "Property is not nullable for class MasterpassDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class MasterpassDetails."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class MasterpassDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class MasterpassDetails."); - - return new MasterpassDetails(masterpassTransactionId.Value, checkoutAttemptId, fundingSource, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource.Equals(input.FundingSource) + ) && + ( + this.MasterpassTransactionId == input.MasterpassTransactionId || + (this.MasterpassTransactionId != null && + this.MasterpassTransactionId.Equals(input.MasterpassTransactionId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, MasterpassDetails masterpassDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, masterpassDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + if (this.MasterpassTransactionId != null) + { + hashCode = (hashCode * 59) + this.MasterpassTransactionId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, MasterpassDetails masterpassDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (masterpassDetails.MasterpassTransactionId == null) - throw new ArgumentNullException(nameof(masterpassDetails.MasterpassTransactionId), "Property is required for class MasterpassDetails."); - - if (masterpassDetails.CheckoutAttemptIdOption.IsSet && masterpassDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(masterpassDetails.CheckoutAttemptId), "Property is required for class MasterpassDetails."); - - writer.WriteString("masterpassTransactionId", masterpassDetails.MasterpassTransactionId); - - if (masterpassDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", masterpassDetails.CheckoutAttemptId); - - var fundingSourceRawValue = MasterpassDetails.FundingSourceEnumToJsonValue(masterpassDetails.FundingSourceOption.Value.Value); - writer.WriteString("fundingSource", fundingSourceRawValue); - var typeRawValue = MasterpassDetails.TypeEnumToJsonValue(masterpassDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/MbwayDetails.cs b/Adyen/Model/Checkout/MbwayDetails.cs index 33b4a39c6..01098eacb 100644 --- a/Adyen/Model/Checkout/MbwayDetails.cs +++ b/Adyen/Model/Checkout/MbwayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,132 +15,84 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// MbwayDetails /// - public partial class MbwayDetails : IValidatableObject + [DataContract(Name = "MbwayDetails")] + public partial class MbwayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// shopperEmail - /// telephoneNumber - /// The checkout attempt identifier. - /// **mbway** (default to TypeEnum.Mbway) - [JsonConstructor] - public MbwayDetails(string shopperEmail, string telephoneNumber, Option checkoutAttemptId = default, Option type = default) - { - ShopperEmail = shopperEmail; - TelephoneNumber = telephoneNumber; - CheckoutAttemptIdOption = checkoutAttemptId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **mbway** /// /// **mbway** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Mbway for value: mbway /// + [EnumMember(Value = "mbway")] Mbway = 1 + } + /// - /// Returns a + /// **mbway** /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("mbway")) - return TypeEnum.Mbway; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - + /// **mbway** + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("mbway")) - return TypeEnum.Mbway; - - return null; - } - + [JsonConstructorAttribute] + protected MbwayDetails() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) + /// The checkout attempt identifier.. + /// shopperEmail (required). + /// telephoneNumber (required). + /// **mbway** (default to TypeEnum.Mbway). + public MbwayDetails(string checkoutAttemptId = default(string), string shopperEmail = default(string), string telephoneNumber = default(string), TypeEnum? type = TypeEnum.Mbway) { - if (value == TypeEnum.Mbway) - return "mbway"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.ShopperEmail = shopperEmail; + this.TelephoneNumber = telephoneNumber; + this.CheckoutAttemptId = checkoutAttemptId; + this.Type = type; } /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } - - /// - /// **mbway** + /// The checkout attempt identifier. /// - /// **mbway** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Gets or Sets ShopperEmail /// - [JsonPropertyName("shopperEmail")] + [DataMember(Name = "shopperEmail", IsRequired = false, EmitDefaultValue = false)] public string ShopperEmail { get; set; } /// /// Gets or Sets TelephoneNumber /// - [JsonPropertyName("telephoneNumber")] + [DataMember(Name = "telephoneNumber", IsRequired = false, EmitDefaultValue = false)] public string TelephoneNumber { get; set; } - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - - /// - /// The checkout attempt identifier. - /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - /// /// Returns the string presentation of the object /// @@ -148,150 +101,100 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class MbwayDetails {\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class MbwayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override MbwayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option shopperEmail = default; - Option telephoneNumber = default; - Option checkoutAttemptId = default; - Option type = default; + return this.Equals(input as MbwayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if MbwayDetails instances are equal + /// + /// Instance of MbwayDetails to be compared + /// Boolean + public bool Equals(MbwayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "telephoneNumber": - telephoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(MbwayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!shopperEmail.IsSet) - throw new ArgumentException("Property is required for class MbwayDetails.", nameof(shopperEmail)); - - if (!telephoneNumber.IsSet) - throw new ArgumentException("Property is required for class MbwayDetails.", nameof(telephoneNumber)); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class MbwayDetails."); - - if (telephoneNumber.IsSet && telephoneNumber.Value == null) - throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class MbwayDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class MbwayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class MbwayDetails."); - - return new MbwayDetails(shopperEmail.Value, telephoneNumber.Value, checkoutAttemptId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + (this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, MbwayDetails mbwayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, mbwayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.TelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, MbwayDetails mbwayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (mbwayDetails.ShopperEmail == null) - throw new ArgumentNullException(nameof(mbwayDetails.ShopperEmail), "Property is required for class MbwayDetails."); - - if (mbwayDetails.TelephoneNumber == null) - throw new ArgumentNullException(nameof(mbwayDetails.TelephoneNumber), "Property is required for class MbwayDetails."); - - if (mbwayDetails.CheckoutAttemptIdOption.IsSet && mbwayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(mbwayDetails.CheckoutAttemptId), "Property is required for class MbwayDetails."); - - writer.WriteString("shopperEmail", mbwayDetails.ShopperEmail); - - writer.WriteString("telephoneNumber", mbwayDetails.TelephoneNumber); - - if (mbwayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", mbwayDetails.CheckoutAttemptId); - - var typeRawValue = MbwayDetails.TypeEnumToJsonValue(mbwayDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/MerchantDevice.cs b/Adyen/Model/Checkout/MerchantDevice.cs index d0cd99e99..099896191 100644 --- a/Adyen/Model/Checkout/MerchantDevice.cs +++ b/Adyen/Model/Checkout/MerchantDevice.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,78 +15,56 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// MerchantDevice /// - public partial class MerchantDevice : IValidatableObject + [DataContract(Name = "MerchantDevice")] + public partial class MerchantDevice : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Operating system running on the merchant device. - /// Version of the operating system on the merchant device. - /// Merchant device reference. - [JsonConstructor] - public MerchantDevice(Option os = default, Option osVersion = default, Option reference = default) + /// Operating system running on the merchant device.. + /// Version of the operating system on the merchant device.. + /// Merchant device reference.. + public MerchantDevice(string os = default(string), string osVersion = default(string), string reference = default(string)) { - OsOption = os; - OsVersionOption = osVersion; - ReferenceOption = reference; - OnCreated(); + this.Os = os; + this.OsVersion = osVersion; + this.Reference = reference; } - partial void OnCreated(); - - /// - /// Used to track the state of Os - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OsOption { get; private set; } - /// /// Operating system running on the merchant device. /// /// Operating system running on the merchant device. - [JsonPropertyName("os")] - public string Os { get { return this.OsOption; } set { this.OsOption = new Option(value); } } - - /// - /// Used to track the state of OsVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OsVersionOption { get; private set; } + [DataMember(Name = "os", EmitDefaultValue = false)] + public string Os { get; set; } /// /// Version of the operating system on the merchant device. /// /// Version of the operating system on the merchant device. - [JsonPropertyName("osVersion")] - public string OsVersion { get { return this.OsVersionOption; } set { this.OsVersionOption = new Option(value); } } - - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + [DataMember(Name = "osVersion", EmitDefaultValue = false)] + public string OsVersion { get; set; } /// /// Merchant device reference. /// /// Merchant device reference. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Returns the string presentation of the object @@ -103,125 +82,86 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class MerchantDeviceJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override MerchantDevice Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option os = default; - Option osVersion = default; - Option reference = default; + return this.Equals(input as MerchantDevice); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if MerchantDevice instances are equal + /// + /// Instance of MerchantDevice to be compared + /// Boolean + public bool Equals(MerchantDevice input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "os": - os = new Option(utf8JsonReader.GetString()); - break; - case "osVersion": - osVersion = new Option(utf8JsonReader.GetString()); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (os.IsSet && os.Value == null) - throw new ArgumentNullException(nameof(os), "Property is not nullable for class MerchantDevice."); - - if (osVersion.IsSet && osVersion.Value == null) - throw new ArgumentNullException(nameof(osVersion), "Property is not nullable for class MerchantDevice."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class MerchantDevice."); - - return new MerchantDevice(os, osVersion, reference); + return + ( + this.Os == input.Os || + (this.Os != null && + this.Os.Equals(input.Os)) + ) && + ( + this.OsVersion == input.OsVersion || + (this.OsVersion != null && + this.OsVersion.Equals(input.OsVersion)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, MerchantDevice merchantDevice, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, merchantDevice, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Os != null) + { + hashCode = (hashCode * 59) + this.Os.GetHashCode(); + } + if (this.OsVersion != null) + { + hashCode = (hashCode * 59) + this.OsVersion.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, MerchantDevice merchantDevice, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (merchantDevice.OsOption.IsSet && merchantDevice.Os == null) - throw new ArgumentNullException(nameof(merchantDevice.Os), "Property is required for class MerchantDevice."); - - if (merchantDevice.OsVersionOption.IsSet && merchantDevice.OsVersion == null) - throw new ArgumentNullException(nameof(merchantDevice.OsVersion), "Property is required for class MerchantDevice."); - - if (merchantDevice.ReferenceOption.IsSet && merchantDevice.Reference == null) - throw new ArgumentNullException(nameof(merchantDevice.Reference), "Property is required for class MerchantDevice."); - - if (merchantDevice.OsOption.IsSet) - writer.WriteString("os", merchantDevice.Os); - - if (merchantDevice.OsVersionOption.IsSet) - writer.WriteString("osVersion", merchantDevice.OsVersion); - - if (merchantDevice.ReferenceOption.IsSet) - writer.WriteString("reference", merchantDevice.Reference); + yield break; } } + } diff --git a/Adyen/Model/Checkout/MerchantRiskIndicator.cs b/Adyen/Model/Checkout/MerchantRiskIndicator.cs index 1d5bdbff5..0c4728a09 100644 --- a/Adyen/Model/Checkout/MerchantRiskIndicator.cs +++ b/Adyen/Model/Checkout/MerchantRiskIndicator.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,486 +15,239 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// MerchantRiskIndicator /// - public partial class MerchantRiskIndicator : IValidatableObject + [DataContract(Name = "MerchantRiskIndicator")] + public partial class MerchantRiskIndicator : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Whether the chosen delivery address is identical to the billing address. - /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` - /// The delivery email address (for digital goods). - /// For Electronic delivery, the email address to which the merchandise was delivered. Maximum length: 254 characters. - /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` - /// giftCardAmount - /// For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. - /// For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. - /// For pre-order purchases, the expected date this product will be available to the shopper. - /// Indicator for whether this transaction is for pre-ordering a product. - /// Indicates whether Cardholder is placing an order for merchandise with a future availability or release date. - /// Indicator for whether the shopper has already purchased the same items in the past. - /// Indicates whether the cardholder is reordering previously purchased merchandise. - /// Indicates shipping method chosen for the transaction. - [JsonConstructor] - public MerchantRiskIndicator(Option addressMatch = default, Option deliveryAddressIndicator = default, Option deliveryEmail = default, Option deliveryEmailAddress = default, Option deliveryTimeframe = default, Option giftCardAmount = default, Option giftCardCount = default, Option giftCardCurr = default, Option preOrderDate = default, Option preOrderPurchase = default, Option preOrderPurchaseInd = default, Option reorderItems = default, Option reorderItemsInd = default, Option shipIndicator = default) - { - AddressMatchOption = addressMatch; - DeliveryAddressIndicatorOption = deliveryAddressIndicator; - DeliveryEmailOption = deliveryEmail; - DeliveryEmailAddressOption = deliveryEmailAddress; - DeliveryTimeframeOption = deliveryTimeframe; - GiftCardAmountOption = giftCardAmount; - GiftCardCountOption = giftCardCount; - GiftCardCurrOption = giftCardCurr; - PreOrderDateOption = preOrderDate; - PreOrderPurchaseOption = preOrderPurchase; - PreOrderPurchaseIndOption = preOrderPurchaseInd; - ReorderItemsOption = reorderItems; - ReorderItemsIndOption = reorderItemsInd; - ShipIndicatorOption = shipIndicator; - OnCreated(); - } - - partial void OnCreated(); - /// /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` /// /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` + [JsonConverter(typeof(StringEnumConverter))] public enum DeliveryAddressIndicatorEnum { /// /// Enum ShipToBillingAddress for value: shipToBillingAddress /// + [EnumMember(Value = "shipToBillingAddress")] ShipToBillingAddress = 1, /// /// Enum ShipToVerifiedAddress for value: shipToVerifiedAddress /// + [EnumMember(Value = "shipToVerifiedAddress")] ShipToVerifiedAddress = 2, /// /// Enum ShipToNewAddress for value: shipToNewAddress /// + [EnumMember(Value = "shipToNewAddress")] ShipToNewAddress = 3, /// /// Enum ShipToStore for value: shipToStore /// + [EnumMember(Value = "shipToStore")] ShipToStore = 4, /// /// Enum DigitalGoods for value: digitalGoods /// + [EnumMember(Value = "digitalGoods")] DigitalGoods = 5, /// /// Enum GoodsNotShipped for value: goodsNotShipped /// + [EnumMember(Value = "goodsNotShipped")] GoodsNotShipped = 6, /// /// Enum Other for value: other /// + [EnumMember(Value = "other")] Other = 7 - } - - /// - /// Returns a - /// - /// - /// - /// - public static DeliveryAddressIndicatorEnum DeliveryAddressIndicatorEnumFromString(string value) - { - if (value.Equals("shipToBillingAddress")) - return DeliveryAddressIndicatorEnum.ShipToBillingAddress; - if (value.Equals("shipToVerifiedAddress")) - return DeliveryAddressIndicatorEnum.ShipToVerifiedAddress; - - if (value.Equals("shipToNewAddress")) - return DeliveryAddressIndicatorEnum.ShipToNewAddress; - - if (value.Equals("shipToStore")) - return DeliveryAddressIndicatorEnum.ShipToStore; - - if (value.Equals("digitalGoods")) - return DeliveryAddressIndicatorEnum.DigitalGoods; - - if (value.Equals("goodsNotShipped")) - return DeliveryAddressIndicatorEnum.GoodsNotShipped; - - if (value.Equals("other")) - return DeliveryAddressIndicatorEnum.Other; - - throw new NotImplementedException($"Could not convert value to type DeliveryAddressIndicatorEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static DeliveryAddressIndicatorEnum? DeliveryAddressIndicatorEnumFromStringOrDefault(string value) - { - if (value.Equals("shipToBillingAddress")) - return DeliveryAddressIndicatorEnum.ShipToBillingAddress; - - if (value.Equals("shipToVerifiedAddress")) - return DeliveryAddressIndicatorEnum.ShipToVerifiedAddress; - - if (value.Equals("shipToNewAddress")) - return DeliveryAddressIndicatorEnum.ShipToNewAddress; - - if (value.Equals("shipToStore")) - return DeliveryAddressIndicatorEnum.ShipToStore; - - if (value.Equals("digitalGoods")) - return DeliveryAddressIndicatorEnum.DigitalGoods; - - if (value.Equals("goodsNotShipped")) - return DeliveryAddressIndicatorEnum.GoodsNotShipped; - - if (value.Equals("other")) - return DeliveryAddressIndicatorEnum.Other; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string DeliveryAddressIndicatorEnumToJsonValue(DeliveryAddressIndicatorEnum? value) - { - if (value == DeliveryAddressIndicatorEnum.ShipToBillingAddress) - return "shipToBillingAddress"; - - if (value == DeliveryAddressIndicatorEnum.ShipToVerifiedAddress) - return "shipToVerifiedAddress"; - - if (value == DeliveryAddressIndicatorEnum.ShipToNewAddress) - return "shipToNewAddress"; - - if (value == DeliveryAddressIndicatorEnum.ShipToStore) - return "shipToStore"; - - if (value == DeliveryAddressIndicatorEnum.DigitalGoods) - return "digitalGoods"; - - if (value == DeliveryAddressIndicatorEnum.GoodsNotShipped) - return "goodsNotShipped"; - - if (value == DeliveryAddressIndicatorEnum.Other) - return "other"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of DeliveryAddressIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryAddressIndicatorOption { get; private set; } /// /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` /// /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` - [JsonPropertyName("deliveryAddressIndicator")] - public DeliveryAddressIndicatorEnum? DeliveryAddressIndicator { get { return this.DeliveryAddressIndicatorOption; } set { this.DeliveryAddressIndicatorOption = new Option(value); } } - + [DataMember(Name = "deliveryAddressIndicator", EmitDefaultValue = false)] + public DeliveryAddressIndicatorEnum? DeliveryAddressIndicator { get; set; } /// /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` /// /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` + [JsonConverter(typeof(StringEnumConverter))] public enum DeliveryTimeframeEnum { /// /// Enum ElectronicDelivery for value: electronicDelivery /// + [EnumMember(Value = "electronicDelivery")] ElectronicDelivery = 1, /// /// Enum SameDayShipping for value: sameDayShipping /// + [EnumMember(Value = "sameDayShipping")] SameDayShipping = 2, /// /// Enum OvernightShipping for value: overnightShipping /// + [EnumMember(Value = "overnightShipping")] OvernightShipping = 3, /// /// Enum TwoOrMoreDaysShipping for value: twoOrMoreDaysShipping /// + [EnumMember(Value = "twoOrMoreDaysShipping")] TwoOrMoreDaysShipping = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static DeliveryTimeframeEnum DeliveryTimeframeEnumFromString(string value) - { - if (value.Equals("electronicDelivery")) - return DeliveryTimeframeEnum.ElectronicDelivery; - - if (value.Equals("sameDayShipping")) - return DeliveryTimeframeEnum.SameDayShipping; - - if (value.Equals("overnightShipping")) - return DeliveryTimeframeEnum.OvernightShipping; - - if (value.Equals("twoOrMoreDaysShipping")) - return DeliveryTimeframeEnum.TwoOrMoreDaysShipping; - - throw new NotImplementedException($"Could not convert value to type DeliveryTimeframeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static DeliveryTimeframeEnum? DeliveryTimeframeEnumFromStringOrDefault(string value) - { - if (value.Equals("electronicDelivery")) - return DeliveryTimeframeEnum.ElectronicDelivery; - if (value.Equals("sameDayShipping")) - return DeliveryTimeframeEnum.SameDayShipping; - - if (value.Equals("overnightShipping")) - return DeliveryTimeframeEnum.OvernightShipping; - - if (value.Equals("twoOrMoreDaysShipping")) - return DeliveryTimeframeEnum.TwoOrMoreDaysShipping; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string DeliveryTimeframeEnumToJsonValue(DeliveryTimeframeEnum? value) - { - if (value == DeliveryTimeframeEnum.ElectronicDelivery) - return "electronicDelivery"; - - if (value == DeliveryTimeframeEnum.SameDayShipping) - return "sameDayShipping"; - - if (value == DeliveryTimeframeEnum.OvernightShipping) - return "overnightShipping"; - - if (value == DeliveryTimeframeEnum.TwoOrMoreDaysShipping) - return "twoOrMoreDaysShipping"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of DeliveryTimeframe - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryTimeframeOption { get; private set; } /// /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` /// /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` - [JsonPropertyName("deliveryTimeframe")] - public DeliveryTimeframeEnum? DeliveryTimeframe { get { return this.DeliveryTimeframeOption; } set { this.DeliveryTimeframeOption = new Option(value); } } - + [DataMember(Name = "deliveryTimeframe", EmitDefaultValue = false)] + public DeliveryTimeframeEnum? DeliveryTimeframe { get; set; } /// - /// Used to track the state of AddressMatch + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AddressMatchOption { get; private set; } + /// Whether the chosen delivery address is identical to the billing address.. + /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other`. + /// The delivery email address (for digital goods).. + /// For Electronic delivery, the email address to which the merchandise was delivered. Maximum length: 254 characters.. + /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping`. + /// giftCardAmount. + /// For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased.. + /// For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification.. + /// For pre-order purchases, the expected date this product will be available to the shopper.. + /// Indicator for whether this transaction is for pre-ordering a product.. + /// Indicates whether Cardholder is placing an order for merchandise with a future availability or release date.. + /// Indicator for whether the shopper has already purchased the same items in the past.. + /// Indicates whether the cardholder is reordering previously purchased merchandise.. + /// Indicates shipping method chosen for the transaction.. + public MerchantRiskIndicator(bool? addressMatch = default(bool?), DeliveryAddressIndicatorEnum? deliveryAddressIndicator = default(DeliveryAddressIndicatorEnum?), string deliveryEmail = default(string), string deliveryEmailAddress = default(string), DeliveryTimeframeEnum? deliveryTimeframe = default(DeliveryTimeframeEnum?), Amount giftCardAmount = default(Amount), int? giftCardCount = default(int?), string giftCardCurr = default(string), DateTime preOrderDate = default(DateTime), bool? preOrderPurchase = default(bool?), string preOrderPurchaseInd = default(string), bool? reorderItems = default(bool?), string reorderItemsInd = default(string), string shipIndicator = default(string)) + { + this.AddressMatch = addressMatch; + this.DeliveryAddressIndicator = deliveryAddressIndicator; + this.DeliveryEmail = deliveryEmail; + this.DeliveryEmailAddress = deliveryEmailAddress; + this.DeliveryTimeframe = deliveryTimeframe; + this.GiftCardAmount = giftCardAmount; + this.GiftCardCount = giftCardCount; + this.GiftCardCurr = giftCardCurr; + this.PreOrderDate = preOrderDate; + this.PreOrderPurchase = preOrderPurchase; + this.PreOrderPurchaseInd = preOrderPurchaseInd; + this.ReorderItems = reorderItems; + this.ReorderItemsInd = reorderItemsInd; + this.ShipIndicator = shipIndicator; + } /// /// Whether the chosen delivery address is identical to the billing address. /// /// Whether the chosen delivery address is identical to the billing address. - [JsonPropertyName("addressMatch")] - public bool? AddressMatch { get { return this.AddressMatchOption; } set { this.AddressMatchOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryEmailOption { get; private set; } + [DataMember(Name = "addressMatch", EmitDefaultValue = false)] + public bool? AddressMatch { get; set; } /// /// The delivery email address (for digital goods). /// /// The delivery email address (for digital goods). - [JsonPropertyName("deliveryEmail")] - [Obsolete] - public string DeliveryEmail { get { return this.DeliveryEmailOption; } set { this.DeliveryEmailOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryEmailAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryEmailAddressOption { get; private set; } + [DataMember(Name = "deliveryEmail", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v68. Use `deliveryEmailAddress` instead.")] + public string DeliveryEmail { get; set; } /// /// For Electronic delivery, the email address to which the merchandise was delivered. Maximum length: 254 characters. /// /// For Electronic delivery, the email address to which the merchandise was delivered. Maximum length: 254 characters. - [JsonPropertyName("deliveryEmailAddress")] - public string DeliveryEmailAddress { get { return this.DeliveryEmailAddressOption; } set { this.DeliveryEmailAddressOption = new Option(value); } } - - /// - /// Used to track the state of GiftCardAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option GiftCardAmountOption { get; private set; } + [DataMember(Name = "deliveryEmailAddress", EmitDefaultValue = false)] + public string DeliveryEmailAddress { get; set; } /// /// Gets or Sets GiftCardAmount /// - [JsonPropertyName("giftCardAmount")] - public Amount GiftCardAmount { get { return this.GiftCardAmountOption; } set { this.GiftCardAmountOption = new Option(value); } } - - /// - /// Used to track the state of GiftCardCount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option GiftCardCountOption { get; private set; } + [DataMember(Name = "giftCardAmount", EmitDefaultValue = false)] + public Amount GiftCardAmount { get; set; } /// /// For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. /// /// For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. - [JsonPropertyName("giftCardCount")] - public int? GiftCardCount { get { return this.GiftCardCountOption; } set { this.GiftCardCountOption = new Option(value); } } - - /// - /// Used to track the state of GiftCardCurr - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option GiftCardCurrOption { get; private set; } + [DataMember(Name = "giftCardCount", EmitDefaultValue = false)] + public int? GiftCardCount { get; set; } /// /// For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. /// /// For prepaid or gift card purchase, [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) three-digit currency code of the gift card, other than those listed in Table A.5 of the EMVCo 3D Secure Protocol and Core Functions Specification. - [JsonPropertyName("giftCardCurr")] - public string GiftCardCurr { get { return this.GiftCardCurrOption; } set { this.GiftCardCurrOption = new Option(value); } } - - /// - /// Used to track the state of PreOrderDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PreOrderDateOption { get; private set; } + [DataMember(Name = "giftCardCurr", EmitDefaultValue = false)] + public string GiftCardCurr { get; set; } /// /// For pre-order purchases, the expected date this product will be available to the shopper. /// /// For pre-order purchases, the expected date this product will be available to the shopper. - [JsonPropertyName("preOrderDate")] - public DateTime? PreOrderDate { get { return this.PreOrderDateOption; } set { this.PreOrderDateOption = new Option(value); } } - - /// - /// Used to track the state of PreOrderPurchase - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PreOrderPurchaseOption { get; private set; } + [DataMember(Name = "preOrderDate", EmitDefaultValue = false)] + public DateTime PreOrderDate { get; set; } /// /// Indicator for whether this transaction is for pre-ordering a product. /// /// Indicator for whether this transaction is for pre-ordering a product. - [JsonPropertyName("preOrderPurchase")] - public bool? PreOrderPurchase { get { return this.PreOrderPurchaseOption; } set { this.PreOrderPurchaseOption = new Option(value); } } - - /// - /// Used to track the state of PreOrderPurchaseInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PreOrderPurchaseIndOption { get; private set; } + [DataMember(Name = "preOrderPurchase", EmitDefaultValue = false)] + public bool? PreOrderPurchase { get; set; } /// /// Indicates whether Cardholder is placing an order for merchandise with a future availability or release date. /// /// Indicates whether Cardholder is placing an order for merchandise with a future availability or release date. - [JsonPropertyName("preOrderPurchaseInd")] - public string PreOrderPurchaseInd { get { return this.PreOrderPurchaseIndOption; } set { this.PreOrderPurchaseIndOption = new Option(value); } } - - /// - /// Used to track the state of ReorderItems - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReorderItemsOption { get; private set; } + [DataMember(Name = "preOrderPurchaseInd", EmitDefaultValue = false)] + public string PreOrderPurchaseInd { get; set; } /// /// Indicator for whether the shopper has already purchased the same items in the past. /// /// Indicator for whether the shopper has already purchased the same items in the past. - [JsonPropertyName("reorderItems")] - public bool? ReorderItems { get { return this.ReorderItemsOption; } set { this.ReorderItemsOption = new Option(value); } } - - /// - /// Used to track the state of ReorderItemsInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReorderItemsIndOption { get; private set; } + [DataMember(Name = "reorderItems", EmitDefaultValue = false)] + public bool? ReorderItems { get; set; } /// /// Indicates whether the cardholder is reordering previously purchased merchandise. /// /// Indicates whether the cardholder is reordering previously purchased merchandise. - [JsonPropertyName("reorderItemsInd")] - public string ReorderItemsInd { get { return this.ReorderItemsIndOption; } set { this.ReorderItemsIndOption = new Option(value); } } - - /// - /// Used to track the state of ShipIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShipIndicatorOption { get; private set; } + [DataMember(Name = "reorderItemsInd", EmitDefaultValue = false)] + public string ReorderItemsInd { get; set; } /// /// Indicates shipping method chosen for the transaction. /// /// Indicates shipping method chosen for the transaction. - [JsonPropertyName("shipIndicator")] - public string ShipIndicator { get { return this.ShipIndicatorOption; } set { this.ShipIndicatorOption = new Option(value); } } + [DataMember(Name = "shipIndicator", EmitDefaultValue = false)] + public string ShipIndicator { get; set; } /// /// Returns the string presentation of the object @@ -522,268 +276,167 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // DeliveryEmailAddress (string) maxLength - if (this.DeliveryEmailAddress != null && this.DeliveryEmailAddress.Length > 254) - { - yield return new ValidationResult("Invalid value for DeliveryEmailAddress, length must be less than 254.", new [] { "DeliveryEmailAddress" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class MerchantRiskIndicatorJsonConverter : JsonConverter - { /// - /// The format to use to serialize PreOrderDate + /// Returns true if objects are equal /// - public static string PreOrderDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as MerchantRiskIndicator); + } /// - /// Deserializes json to + /// Returns true if MerchantRiskIndicator instances are equal /// - /// - /// - /// - /// - /// - public override MerchantRiskIndicator Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Instance of MerchantRiskIndicator to be compared + /// Boolean + public bool Equals(MerchantRiskIndicator input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option addressMatch = default; - Option deliveryAddressIndicator = default; - Option deliveryEmail = default; - Option deliveryEmailAddress = default; - Option deliveryTimeframe = default; - Option giftCardAmount = default; - Option giftCardCount = default; - Option giftCardCurr = default; - Option preOrderDate = default; - Option preOrderPurchase = default; - Option preOrderPurchaseInd = default; - Option reorderItems = default; - Option reorderItemsInd = default; - Option shipIndicator = default; - - while (utf8JsonReader.Read()) + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "addressMatch": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - addressMatch = new Option(utf8JsonReader.GetBoolean()); - break; - case "deliveryAddressIndicator": - string deliveryAddressIndicatorRawValue = utf8JsonReader.GetString(); - if (deliveryAddressIndicatorRawValue != null) - deliveryAddressIndicator = new Option(MerchantRiskIndicator.DeliveryAddressIndicatorEnumFromStringOrDefault(deliveryAddressIndicatorRawValue)); - break; - case "deliveryEmail": - deliveryEmail = new Option(utf8JsonReader.GetString()); - break; - case "deliveryEmailAddress": - deliveryEmailAddress = new Option(utf8JsonReader.GetString()); - break; - case "deliveryTimeframe": - string deliveryTimeframeRawValue = utf8JsonReader.GetString(); - if (deliveryTimeframeRawValue != null) - deliveryTimeframe = new Option(MerchantRiskIndicator.DeliveryTimeframeEnumFromStringOrDefault(deliveryTimeframeRawValue)); - break; - case "giftCardAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - giftCardAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "giftCardCount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - giftCardCount = new Option(utf8JsonReader.GetInt32()); - break; - case "giftCardCurr": - giftCardCurr = new Option(utf8JsonReader.GetString()); - break; - case "preOrderDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - preOrderDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "preOrderPurchase": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - preOrderPurchase = new Option(utf8JsonReader.GetBoolean()); - break; - case "preOrderPurchaseInd": - preOrderPurchaseInd = new Option(utf8JsonReader.GetString()); - break; - case "reorderItems": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - reorderItems = new Option(utf8JsonReader.GetBoolean()); - break; - case "reorderItemsInd": - reorderItemsInd = new Option(utf8JsonReader.GetString()); - break; - case "shipIndicator": - shipIndicator = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (addressMatch.IsSet && addressMatch.Value == null) - throw new ArgumentNullException(nameof(addressMatch), "Property is not nullable for class MerchantRiskIndicator."); - - if (deliveryAddressIndicator.IsSet && deliveryAddressIndicator.Value == null) - throw new ArgumentNullException(nameof(deliveryAddressIndicator), "Property is not nullable for class MerchantRiskIndicator."); - - if (deliveryEmail.IsSet && deliveryEmail.Value == null) - throw new ArgumentNullException(nameof(deliveryEmail), "Property is not nullable for class MerchantRiskIndicator."); - - if (deliveryEmailAddress.IsSet && deliveryEmailAddress.Value == null) - throw new ArgumentNullException(nameof(deliveryEmailAddress), "Property is not nullable for class MerchantRiskIndicator."); - - if (deliveryTimeframe.IsSet && deliveryTimeframe.Value == null) - throw new ArgumentNullException(nameof(deliveryTimeframe), "Property is not nullable for class MerchantRiskIndicator."); - - if (giftCardAmount.IsSet && giftCardAmount.Value == null) - throw new ArgumentNullException(nameof(giftCardAmount), "Property is not nullable for class MerchantRiskIndicator."); - - if (giftCardCount.IsSet && giftCardCount.Value == null) - throw new ArgumentNullException(nameof(giftCardCount), "Property is not nullable for class MerchantRiskIndicator."); - - if (giftCardCurr.IsSet && giftCardCurr.Value == null) - throw new ArgumentNullException(nameof(giftCardCurr), "Property is not nullable for class MerchantRiskIndicator."); - - if (preOrderDate.IsSet && preOrderDate.Value == null) - throw new ArgumentNullException(nameof(preOrderDate), "Property is not nullable for class MerchantRiskIndicator."); - - if (preOrderPurchase.IsSet && preOrderPurchase.Value == null) - throw new ArgumentNullException(nameof(preOrderPurchase), "Property is not nullable for class MerchantRiskIndicator."); - - if (preOrderPurchaseInd.IsSet && preOrderPurchaseInd.Value == null) - throw new ArgumentNullException(nameof(preOrderPurchaseInd), "Property is not nullable for class MerchantRiskIndicator."); - - if (reorderItems.IsSet && reorderItems.Value == null) - throw new ArgumentNullException(nameof(reorderItems), "Property is not nullable for class MerchantRiskIndicator."); - - if (reorderItemsInd.IsSet && reorderItemsInd.Value == null) - throw new ArgumentNullException(nameof(reorderItemsInd), "Property is not nullable for class MerchantRiskIndicator."); - - if (shipIndicator.IsSet && shipIndicator.Value == null) - throw new ArgumentNullException(nameof(shipIndicator), "Property is not nullable for class MerchantRiskIndicator."); - - return new MerchantRiskIndicator(addressMatch, deliveryAddressIndicator, deliveryEmail, deliveryEmailAddress, deliveryTimeframe, giftCardAmount, giftCardCount, giftCardCurr, preOrderDate, preOrderPurchase, preOrderPurchaseInd, reorderItems, reorderItemsInd, shipIndicator); + return + ( + this.AddressMatch == input.AddressMatch || + this.AddressMatch.Equals(input.AddressMatch) + ) && + ( + this.DeliveryAddressIndicator == input.DeliveryAddressIndicator || + this.DeliveryAddressIndicator.Equals(input.DeliveryAddressIndicator) + ) && + ( + this.DeliveryEmail == input.DeliveryEmail || + (this.DeliveryEmail != null && + this.DeliveryEmail.Equals(input.DeliveryEmail)) + ) && + ( + this.DeliveryEmailAddress == input.DeliveryEmailAddress || + (this.DeliveryEmailAddress != null && + this.DeliveryEmailAddress.Equals(input.DeliveryEmailAddress)) + ) && + ( + this.DeliveryTimeframe == input.DeliveryTimeframe || + this.DeliveryTimeframe.Equals(input.DeliveryTimeframe) + ) && + ( + this.GiftCardAmount == input.GiftCardAmount || + (this.GiftCardAmount != null && + this.GiftCardAmount.Equals(input.GiftCardAmount)) + ) && + ( + this.GiftCardCount == input.GiftCardCount || + this.GiftCardCount.Equals(input.GiftCardCount) + ) && + ( + this.GiftCardCurr == input.GiftCardCurr || + (this.GiftCardCurr != null && + this.GiftCardCurr.Equals(input.GiftCardCurr)) + ) && + ( + this.PreOrderDate == input.PreOrderDate || + (this.PreOrderDate != null && + this.PreOrderDate.Equals(input.PreOrderDate)) + ) && + ( + this.PreOrderPurchase == input.PreOrderPurchase || + this.PreOrderPurchase.Equals(input.PreOrderPurchase) + ) && + ( + this.PreOrderPurchaseInd == input.PreOrderPurchaseInd || + (this.PreOrderPurchaseInd != null && + this.PreOrderPurchaseInd.Equals(input.PreOrderPurchaseInd)) + ) && + ( + this.ReorderItems == input.ReorderItems || + this.ReorderItems.Equals(input.ReorderItems) + ) && + ( + this.ReorderItemsInd == input.ReorderItemsInd || + (this.ReorderItemsInd != null && + this.ReorderItemsInd.Equals(input.ReorderItemsInd)) + ) && + ( + this.ShipIndicator == input.ShipIndicator || + (this.ShipIndicator != null && + this.ShipIndicator.Equals(input.ShipIndicator)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, MerchantRiskIndicator merchantRiskIndicator, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, merchantRiskIndicator, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.AddressMatch.GetHashCode(); + hashCode = (hashCode * 59) + this.DeliveryAddressIndicator.GetHashCode(); + if (this.DeliveryEmail != null) + { + hashCode = (hashCode * 59) + this.DeliveryEmail.GetHashCode(); + } + if (this.DeliveryEmailAddress != null) + { + hashCode = (hashCode * 59) + this.DeliveryEmailAddress.GetHashCode(); + } + hashCode = (hashCode * 59) + this.DeliveryTimeframe.GetHashCode(); + if (this.GiftCardAmount != null) + { + hashCode = (hashCode * 59) + this.GiftCardAmount.GetHashCode(); + } + hashCode = (hashCode * 59) + this.GiftCardCount.GetHashCode(); + if (this.GiftCardCurr != null) + { + hashCode = (hashCode * 59) + this.GiftCardCurr.GetHashCode(); + } + if (this.PreOrderDate != null) + { + hashCode = (hashCode * 59) + this.PreOrderDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PreOrderPurchase.GetHashCode(); + if (this.PreOrderPurchaseInd != null) + { + hashCode = (hashCode * 59) + this.PreOrderPurchaseInd.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ReorderItems.GetHashCode(); + if (this.ReorderItemsInd != null) + { + hashCode = (hashCode * 59) + this.ReorderItemsInd.GetHashCode(); + } + if (this.ShipIndicator != null) + { + hashCode = (hashCode * 59) + this.ShipIndicator.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, MerchantRiskIndicator merchantRiskIndicator, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (merchantRiskIndicator.DeliveryEmailOption.IsSet && merchantRiskIndicator.DeliveryEmail == null) - throw new ArgumentNullException(nameof(merchantRiskIndicator.DeliveryEmail), "Property is required for class MerchantRiskIndicator."); - - if (merchantRiskIndicator.DeliveryEmailAddressOption.IsSet && merchantRiskIndicator.DeliveryEmailAddress == null) - throw new ArgumentNullException(nameof(merchantRiskIndicator.DeliveryEmailAddress), "Property is required for class MerchantRiskIndicator."); - - if (merchantRiskIndicator.GiftCardAmountOption.IsSet && merchantRiskIndicator.GiftCardAmount == null) - throw new ArgumentNullException(nameof(merchantRiskIndicator.GiftCardAmount), "Property is required for class MerchantRiskIndicator."); - - if (merchantRiskIndicator.GiftCardCurrOption.IsSet && merchantRiskIndicator.GiftCardCurr == null) - throw new ArgumentNullException(nameof(merchantRiskIndicator.GiftCardCurr), "Property is required for class MerchantRiskIndicator."); - - if (merchantRiskIndicator.PreOrderPurchaseIndOption.IsSet && merchantRiskIndicator.PreOrderPurchaseInd == null) - throw new ArgumentNullException(nameof(merchantRiskIndicator.PreOrderPurchaseInd), "Property is required for class MerchantRiskIndicator."); - - if (merchantRiskIndicator.ReorderItemsIndOption.IsSet && merchantRiskIndicator.ReorderItemsInd == null) - throw new ArgumentNullException(nameof(merchantRiskIndicator.ReorderItemsInd), "Property is required for class MerchantRiskIndicator."); - - if (merchantRiskIndicator.ShipIndicatorOption.IsSet && merchantRiskIndicator.ShipIndicator == null) - throw new ArgumentNullException(nameof(merchantRiskIndicator.ShipIndicator), "Property is required for class MerchantRiskIndicator."); - - if (merchantRiskIndicator.AddressMatchOption.IsSet) - writer.WriteBoolean("addressMatch", merchantRiskIndicator.AddressMatchOption.Value.Value); - - var deliveryAddressIndicatorRawValue = MerchantRiskIndicator.DeliveryAddressIndicatorEnumToJsonValue(merchantRiskIndicator.DeliveryAddressIndicatorOption.Value.Value); - writer.WriteString("deliveryAddressIndicator", deliveryAddressIndicatorRawValue); - if (merchantRiskIndicator.DeliveryEmailOption.IsSet) - writer.WriteString("deliveryEmail", merchantRiskIndicator.DeliveryEmail); - - if (merchantRiskIndicator.DeliveryEmailAddressOption.IsSet) - writer.WriteString("deliveryEmailAddress", merchantRiskIndicator.DeliveryEmailAddress); - - var deliveryTimeframeRawValue = MerchantRiskIndicator.DeliveryTimeframeEnumToJsonValue(merchantRiskIndicator.DeliveryTimeframeOption.Value.Value); - writer.WriteString("deliveryTimeframe", deliveryTimeframeRawValue); - if (merchantRiskIndicator.GiftCardAmountOption.IsSet) + // DeliveryEmailAddress (string) maxLength + if (this.DeliveryEmailAddress != null && this.DeliveryEmailAddress.Length > 254) { - writer.WritePropertyName("giftCardAmount"); - JsonSerializer.Serialize(writer, merchantRiskIndicator.GiftCardAmount, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DeliveryEmailAddress, length must be less than 254.", new [] { "DeliveryEmailAddress" }); } - if (merchantRiskIndicator.GiftCardCountOption.IsSet) - writer.WriteNumber("giftCardCount", merchantRiskIndicator.GiftCardCountOption.Value.Value); - - if (merchantRiskIndicator.GiftCardCurrOption.IsSet) - writer.WriteString("giftCardCurr", merchantRiskIndicator.GiftCardCurr); - - if (merchantRiskIndicator.PreOrderDateOption.IsSet) - writer.WriteString("preOrderDate", merchantRiskIndicator.PreOrderDateOption.Value.Value.ToString(PreOrderDateFormat)); - - if (merchantRiskIndicator.PreOrderPurchaseOption.IsSet) - writer.WriteBoolean("preOrderPurchase", merchantRiskIndicator.PreOrderPurchaseOption.Value.Value); - if (merchantRiskIndicator.PreOrderPurchaseIndOption.IsSet) - writer.WriteString("preOrderPurchaseInd", merchantRiskIndicator.PreOrderPurchaseInd); - - if (merchantRiskIndicator.ReorderItemsOption.IsSet) - writer.WriteBoolean("reorderItems", merchantRiskIndicator.ReorderItemsOption.Value.Value); - - if (merchantRiskIndicator.ReorderItemsIndOption.IsSet) - writer.WriteString("reorderItemsInd", merchantRiskIndicator.ReorderItemsInd); - - if (merchantRiskIndicator.ShipIndicatorOption.IsSet) - writer.WriteString("shipIndicator", merchantRiskIndicator.ShipIndicator); + yield break; } } + } diff --git a/Adyen/Model/Checkout/MobilePayDetails.cs b/Adyen/Model/Checkout/MobilePayDetails.cs index 561b89b14..6b6e06a05 100644 --- a/Adyen/Model/Checkout/MobilePayDetails.cs +++ b/Adyen/Model/Checkout/MobilePayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,115 +15,62 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// MobilePayDetails /// - public partial class MobilePayDetails : IValidatableObject + [DataContract(Name = "MobilePayDetails")] + public partial class MobilePayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// **mobilepay** (default to TypeEnum.Mobilepay) - [JsonConstructor] - public MobilePayDetails(Option checkoutAttemptId = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **mobilepay** /// /// **mobilepay** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Mobilepay for value: mobilepay /// + [EnumMember(Value = "mobilepay")] Mobilepay = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("mobilepay")) - return TypeEnum.Mobilepay; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("mobilepay")) - return TypeEnum.Mobilepay; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Mobilepay) - return "mobilepay"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **mobilepay** /// /// **mobilepay** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// **mobilepay** (default to TypeEnum.Mobilepay). + public MobilePayDetails(string checkoutAttemptId = default(string), TypeEnum? type = TypeEnum.Mobilepay) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Returns the string presentation of the object @@ -139,111 +87,73 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class MobilePayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override MobilePayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option type = default; + return this.Equals(input as MobilePayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if MobilePayDetails instances are equal + /// + /// Instance of MobilePayDetails to be compared + /// Boolean + public bool Equals(MobilePayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(MobilePayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class MobilePayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class MobilePayDetails."); - - return new MobilePayDetails(checkoutAttemptId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, MobilePayDetails mobilePayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, mobilePayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, MobilePayDetails mobilePayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (mobilePayDetails.CheckoutAttemptIdOption.IsSet && mobilePayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(mobilePayDetails.CheckoutAttemptId), "Property is required for class MobilePayDetails."); - - if (mobilePayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", mobilePayDetails.CheckoutAttemptId); - - var typeRawValue = MobilePayDetails.TypeEnumToJsonValue(mobilePayDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/MolPayDetails.cs b/Adyen/Model/Checkout/MolPayDetails.cs index a909a04a2..e6b7f6a2d 100644 --- a/Adyen/Model/Checkout/MolPayDetails.cs +++ b/Adyen/Model/Checkout/MolPayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,132 +15,83 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// MolPayDetails /// - public partial class MolPayDetails : IValidatableObject + [DataContract(Name = "MolPayDetails")] + public partial class MolPayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The shopper's bank. Specify this with the issuer value that corresponds to this bank. - /// **molpay** - /// The checkout attempt identifier. - [JsonConstructor] - public MolPayDetails(string issuer, TypeEnum type, Option checkoutAttemptId = default) - { - Issuer = issuer; - Type = type; - CheckoutAttemptIdOption = checkoutAttemptId; - OnCreated(); - } - - partial void OnCreated(); - /// /// **molpay** /// /// **molpay** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// - /// Enum MolpayEbankingFpxMY for value: molpay_ebanking_fpx_MY + /// Enum FpxMY for value: molpay_ebanking_fpx_MY /// - MolpayEbankingFpxMY = 1, + [EnumMember(Value = "molpay_ebanking_fpx_MY")] + FpxMY = 1, /// - /// Enum MolpayEbankingTH for value: molpay_ebanking_TH + /// Enum TH for value: molpay_ebanking_TH /// - MolpayEbankingTH = 2 + [EnumMember(Value = "molpay_ebanking_TH")] + TH = 2 + } + /// - /// Returns a + /// **molpay** /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("molpay_ebanking_fpx_MY")) - return TypeEnum.MolpayEbankingFpxMY; - - if (value.Equals("molpay_ebanking_TH")) - return TypeEnum.MolpayEbankingTH; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - + /// **molpay** + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + public TypeEnum Type { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("molpay_ebanking_fpx_MY")) - return TypeEnum.MolpayEbankingFpxMY; - - if (value.Equals("molpay_ebanking_TH")) - return TypeEnum.MolpayEbankingTH; - - return null; - } - + [JsonConstructorAttribute] + protected MolPayDetails() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) + /// The checkout attempt identifier.. + /// The shopper's bank. Specify this with the issuer value that corresponds to this bank. (required). + /// **molpay** (required). + public MolPayDetails(string checkoutAttemptId = default(string), string issuer = default(string), TypeEnum type = default(TypeEnum)) { - if (value == TypeEnum.MolpayEbankingFpxMY) - return "molpay_ebanking_fpx_MY"; - - if (value == TypeEnum.MolpayEbankingTH) - return "molpay_ebanking_TH"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.Issuer = issuer; + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; } /// - /// **molpay** + /// The checkout attempt identifier. /// - /// **molpay** - [JsonPropertyName("type")] - public TypeEnum Type { get; set; } + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The shopper's bank. Specify this with the issuer value that corresponds to this bank. /// /// The shopper's bank. Specify this with the issuer value that corresponds to this bank. - [JsonPropertyName("issuer")] + [DataMember(Name = "issuer", IsRequired = false, EmitDefaultValue = false)] public string Issuer { get; set; } - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - - /// - /// The checkout attempt identifier. - /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - /// /// Returns the string presentation of the object /// @@ -148,136 +100,90 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class MolPayDetails {\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" Issuer: ").Append(Issuer).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class MolPayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override MolPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option issuer = default; - Option type = default; - Option checkoutAttemptId = default; + return this.Equals(input as MolPayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if MolPayDetails instances are equal + /// + /// Instance of MolPayDetails to be compared + /// Boolean + public bool Equals(MolPayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "issuer": - issuer = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(MolPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!issuer.IsSet) - throw new ArgumentException("Property is required for class MolPayDetails.", nameof(issuer)); - - if (!type.IsSet) - throw new ArgumentException("Property is required for class MolPayDetails.", nameof(type)); - - if (issuer.IsSet && issuer.Value == null) - throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class MolPayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class MolPayDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class MolPayDetails."); - - return new MolPayDetails(issuer.Value, type.Value.Value, checkoutAttemptId); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Issuer == input.Issuer || + (this.Issuer != null && + this.Issuer.Equals(input.Issuer)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, MolPayDetails molPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, molPayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.Issuer != null) + { + hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, MolPayDetails molPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (molPayDetails.Issuer == null) - throw new ArgumentNullException(nameof(molPayDetails.Issuer), "Property is required for class MolPayDetails."); - - if (molPayDetails.CheckoutAttemptIdOption.IsSet && molPayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(molPayDetails.CheckoutAttemptId), "Property is required for class MolPayDetails."); - - writer.WriteString("issuer", molPayDetails.Issuer); - - var typeRawValue = MolPayDetails.TypeEnumToJsonValue(molPayDetails.Type); - writer.WriteString("type", typeRawValue); - if (molPayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", molPayDetails.CheckoutAttemptId); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Name.cs b/Adyen/Model/Checkout/Name.cs index cb917d7e4..0839df0a6 100644 --- a/Adyen/Model/Checkout/Name.cs +++ b/Adyen/Model/Checkout/Name.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,47 +15,51 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Name /// - public partial class Name : IValidatableObject + [DataContract(Name = "Name")] + public partial class Name : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The first name. - /// The last name. - [JsonConstructor] - public Name(string firstName, string lastName) + [JsonConstructorAttribute] + protected Name() { } + /// + /// Initializes a new instance of the class. + /// + /// The first name. (required). + /// The last name. (required). + public Name(string firstName = default(string), string lastName = default(string)) { - FirstName = firstName; - LastName = lastName; - OnCreated(); + this.FirstName = firstName; + this.LastName = lastName; } - partial void OnCreated(); - /// /// The first name. /// /// The first name. - [JsonPropertyName("firstName")] + [DataMember(Name = "firstName", IsRequired = false, EmitDefaultValue = false)] public string FirstName { get; set; } /// /// The last name. /// /// The last name. - [JsonPropertyName("lastName")] + [DataMember(Name = "lastName", IsRequired = false, EmitDefaultValue = false)] public string LastName { get; set; } /// @@ -72,128 +77,89 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // FirstName (string) maxLength - if (this.FirstName != null && this.FirstName.Length > 80) - { - yield return new ValidationResult("Invalid value for FirstName, length must be less than 80.", new [] { "FirstName" }); - } - - // LastName (string) maxLength - if (this.LastName != null && this.LastName.Length > 80) - { - yield return new ValidationResult("Invalid value for LastName, length must be less than 80.", new [] { "LastName" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class NameJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Name Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option firstName = default; - Option lastName = default; + return this.Equals(input as Name); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if Name instances are equal + /// + /// Instance of Name to be compared + /// Boolean + public bool Equals(Name input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "firstName": - firstName = new Option(utf8JsonReader.GetString()); - break; - case "lastName": - lastName = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!firstName.IsSet) - throw new ArgumentException("Property is required for class Name.", nameof(firstName)); - - if (!lastName.IsSet) - throw new ArgumentException("Property is required for class Name.", nameof(lastName)); - - if (firstName.IsSet && firstName.Value == null) - throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Name."); - - if (lastName.IsSet && lastName.Value == null) - throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class Name."); - - return new Name(firstName.Value, lastName.Value); + return + ( + this.FirstName == input.FirstName || + (this.FirstName != null && + this.FirstName.Equals(input.FirstName)) + ) && + ( + this.LastName == input.LastName || + (this.LastName != null && + this.LastName.Equals(input.LastName)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, name, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.FirstName != null) + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } + if (this.LastName != null) + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (name.FirstName == null) - throw new ArgumentNullException(nameof(name.FirstName), "Property is required for class Name."); - - if (name.LastName == null) - throw new ArgumentNullException(nameof(name.LastName), "Property is required for class Name."); + // FirstName (string) maxLength + if (this.FirstName != null && this.FirstName.Length > 80) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for FirstName, length must be less than 80.", new [] { "FirstName" }); + } - writer.WriteString("firstName", name.FirstName); + // LastName (string) maxLength + if (this.LastName != null && this.LastName.Length > 80) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for LastName, length must be less than 80.", new [] { "LastName" }); + } - writer.WriteString("lastName", name.LastName); + yield break; } } + } diff --git a/Adyen/Model/Checkout/OpenInvoiceDetails.cs b/Adyen/Model/Checkout/OpenInvoiceDetails.cs index 02da0e71c..18a35115f 100644 --- a/Adyen/Model/Checkout/OpenInvoiceDetails.cs +++ b/Adyen/Model/Checkout/OpenInvoiceDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,224 +15,120 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// OpenInvoiceDetails /// - public partial class OpenInvoiceDetails : IValidatableObject + [DataContract(Name = "OpenInvoiceDetails")] + public partial class OpenInvoiceDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The address where to send the invoice. - /// The checkout attempt identifier. - /// The address where the goods should be delivered. - /// Shopper name, date of birth, phone number, and email address. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **openinvoice** (default to TypeEnum.Openinvoice) - [JsonConstructor] - public OpenInvoiceDetails(Option billingAddress = default, Option checkoutAttemptId = default, Option deliveryAddress = default, Option personalDetails = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - BillingAddressOption = billingAddress; - CheckoutAttemptIdOption = checkoutAttemptId; - DeliveryAddressOption = deliveryAddress; - PersonalDetailsOption = personalDetails; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **openinvoice** /// /// **openinvoice** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Openinvoice for value: openinvoice /// + [EnumMember(Value = "openinvoice")] Openinvoice = 1, /// /// Enum AfterpayDirectdebit for value: afterpay_directdebit /// + [EnumMember(Value = "afterpay_directdebit")] AfterpayDirectdebit = 2, /// /// Enum AtomePos for value: atome_pos /// + [EnumMember(Value = "atome_pos")] AtomePos = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("openinvoice")) - return TypeEnum.Openinvoice; - - if (value.Equals("afterpay_directdebit")) - return TypeEnum.AfterpayDirectdebit; - - if (value.Equals("atome_pos")) - return TypeEnum.AtomePos; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("openinvoice")) - return TypeEnum.Openinvoice; - - if (value.Equals("afterpay_directdebit")) - return TypeEnum.AfterpayDirectdebit; - - if (value.Equals("atome_pos")) - return TypeEnum.AtomePos; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Openinvoice) - return "openinvoice"; - - if (value == TypeEnum.AfterpayDirectdebit) - return "afterpay_directdebit"; - - if (value == TypeEnum.AtomePos) - return "atome_pos"; - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **openinvoice** /// /// **openinvoice** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of BillingAddress + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressOption { get; private set; } + /// The address where to send the invoice.. + /// The checkout attempt identifier.. + /// The address where the goods should be delivered.. + /// Shopper name, date of birth, phone number, and email address.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **openinvoice** (default to TypeEnum.Openinvoice). + public OpenInvoiceDetails(string billingAddress = default(string), string checkoutAttemptId = default(string), string deliveryAddress = default(string), string personalDetails = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Openinvoice) + { + this.BillingAddress = billingAddress; + this.CheckoutAttemptId = checkoutAttemptId; + this.DeliveryAddress = deliveryAddress; + this.PersonalDetails = personalDetails; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The address where to send the invoice. /// /// The address where to send the invoice. - [JsonPropertyName("billingAddress")] - public string BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } - - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public string BillingAddress { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryAddressOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The address where the goods should be delivered. /// /// The address where the goods should be delivered. - [JsonPropertyName("deliveryAddress")] - public string DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } - - /// - /// Used to track the state of PersonalDetails - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PersonalDetailsOption { get; private set; } + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public string DeliveryAddress { get; set; } /// /// Shopper name, date of birth, phone number, and email address. /// /// Shopper name, date of birth, phone number, and email address. - [JsonPropertyName("personalDetails")] - public string PersonalDetails { get { return this.PersonalDetailsOption; } set { this.PersonalDetailsOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "personalDetails", EmitDefaultValue = false)] + public string PersonalDetails { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -253,182 +150,124 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class OpenInvoiceDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override OpenInvoiceDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option billingAddress = default; - Option checkoutAttemptId = default; - Option deliveryAddress = default; - Option personalDetails = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as OpenInvoiceDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if OpenInvoiceDetails instances are equal + /// + /// Instance of OpenInvoiceDetails to be compared + /// Boolean + public bool Equals(OpenInvoiceDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "billingAddress": - billingAddress = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "deliveryAddress": - deliveryAddress = new Option(utf8JsonReader.GetString()); - break; - case "personalDetails": - personalDetails = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(OpenInvoiceDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class OpenInvoiceDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class OpenInvoiceDetails."); - - if (deliveryAddress.IsSet && deliveryAddress.Value == null) - throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class OpenInvoiceDetails."); - - if (personalDetails.IsSet && personalDetails.Value == null) - throw new ArgumentNullException(nameof(personalDetails), "Property is not nullable for class OpenInvoiceDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class OpenInvoiceDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class OpenInvoiceDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class OpenInvoiceDetails."); - - return new OpenInvoiceDetails(billingAddress, checkoutAttemptId, deliveryAddress, personalDetails, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + (this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress)) + ) && + ( + this.PersonalDetails == input.PersonalDetails || + (this.PersonalDetails != null && + this.PersonalDetails.Equals(input.PersonalDetails)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, OpenInvoiceDetails openInvoiceDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, openInvoiceDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.DeliveryAddress != null) + { + hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); + } + if (this.PersonalDetails != null) + { + hashCode = (hashCode * 59) + this.PersonalDetails.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, OpenInvoiceDetails openInvoiceDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (openInvoiceDetails.BillingAddressOption.IsSet && openInvoiceDetails.BillingAddress == null) - throw new ArgumentNullException(nameof(openInvoiceDetails.BillingAddress), "Property is required for class OpenInvoiceDetails."); - - if (openInvoiceDetails.CheckoutAttemptIdOption.IsSet && openInvoiceDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(openInvoiceDetails.CheckoutAttemptId), "Property is required for class OpenInvoiceDetails."); - - if (openInvoiceDetails.DeliveryAddressOption.IsSet && openInvoiceDetails.DeliveryAddress == null) - throw new ArgumentNullException(nameof(openInvoiceDetails.DeliveryAddress), "Property is required for class OpenInvoiceDetails."); - - if (openInvoiceDetails.PersonalDetailsOption.IsSet && openInvoiceDetails.PersonalDetails == null) - throw new ArgumentNullException(nameof(openInvoiceDetails.PersonalDetails), "Property is required for class OpenInvoiceDetails."); - - if (openInvoiceDetails.RecurringDetailReferenceOption.IsSet && openInvoiceDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(openInvoiceDetails.RecurringDetailReference), "Property is required for class OpenInvoiceDetails."); - - if (openInvoiceDetails.StoredPaymentMethodIdOption.IsSet && openInvoiceDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(openInvoiceDetails.StoredPaymentMethodId), "Property is required for class OpenInvoiceDetails."); - - if (openInvoiceDetails.BillingAddressOption.IsSet) - writer.WriteString("billingAddress", openInvoiceDetails.BillingAddress); - - if (openInvoiceDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", openInvoiceDetails.CheckoutAttemptId); - - if (openInvoiceDetails.DeliveryAddressOption.IsSet) - writer.WriteString("deliveryAddress", openInvoiceDetails.DeliveryAddress); - - if (openInvoiceDetails.PersonalDetailsOption.IsSet) - writer.WriteString("personalDetails", openInvoiceDetails.PersonalDetails); - - if (openInvoiceDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", openInvoiceDetails.RecurringDetailReference); - - if (openInvoiceDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", openInvoiceDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = OpenInvoiceDetails.TypeEnumToJsonValue(openInvoiceDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Passenger.cs b/Adyen/Model/Checkout/Passenger.cs index 00f3b1be4..63cc593c3 100644 --- a/Adyen/Model/Checkout/Passenger.cs +++ b/Adyen/Model/Checkout/Passenger.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,110 +15,75 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Passenger /// - public partial class Passenger : IValidatableObject + [DataContract(Name = "Passenger")] + public partial class Passenger : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10 - /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII - /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII - /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters - /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters - [JsonConstructor] - public Passenger(Option dateOfBirth = default, Option firstName = default, Option lastName = default, Option phoneNumber = default, Option travellerType = default) + /// The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10. + /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII. + /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII. + /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters. + /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters. + public Passenger(DateTime dateOfBirth = default(DateTime), string firstName = default(string), string lastName = default(string), string phoneNumber = default(string), string travellerType = default(string)) { - DateOfBirthOption = dateOfBirth; - FirstNameOption = firstName; - LastNameOption = lastName; - PhoneNumberOption = phoneNumber; - TravellerTypeOption = travellerType; - OnCreated(); + this.DateOfBirth = dateOfBirth; + this.FirstName = firstName; + this.LastName = lastName; + this.PhoneNumber = phoneNumber; + this.TravellerType = travellerType; } - partial void OnCreated(); - - /// - /// Used to track the state of DateOfBirth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DateOfBirthOption { get; private set; } - /// /// The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10 /// /// The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10 - [JsonPropertyName("dateOfBirth")] - public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } - - /// - /// Used to track the state of FirstName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FirstNameOption { get; private set; } + [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime DateOfBirth { get; set; } /// /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII /// /// The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII - [JsonPropertyName("firstName")] - public string FirstName { get { return this.FirstNameOption; } set { this.FirstNameOption = new Option(value); } } - - /// - /// Used to track the state of LastName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LastNameOption { get; private set; } + [DataMember(Name = "firstName", EmitDefaultValue = false)] + public string FirstName { get; set; } /// /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII /// /// The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII - [JsonPropertyName("lastName")] - public string LastName { get { return this.LastNameOption; } set { this.LastNameOption = new Option(value); } } - - /// - /// Used to track the state of PhoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PhoneNumberOption { get; private set; } + [DataMember(Name = "lastName", EmitDefaultValue = false)] + public string LastName { get; set; } /// /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters /// /// The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters - [JsonPropertyName("phoneNumber")] - public string PhoneNumber { get { return this.PhoneNumberOption; } set { this.PhoneNumberOption = new Option(value); } } - - /// - /// Used to track the state of TravellerType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TravellerTypeOption { get; private set; } + [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] + public string PhoneNumber { get; set; } /// /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters /// /// The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters - [JsonPropertyName("travellerType")] - public string TravellerType { get { return this.TravellerTypeOption; } set { this.TravellerTypeOption = new Option(value); } } + [DataMember(Name = "travellerType", EmitDefaultValue = false)] + public string TravellerType { get; set; } /// /// Returns the string presentation of the object @@ -137,154 +103,104 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PassengerJsonConverter : JsonConverter - { /// - /// The format to use to serialize DateOfBirth + /// Returns true if objects are equal /// - public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd"; + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Passenger); + } /// - /// Deserializes json to + /// Returns true if Passenger instances are equal /// - /// - /// - /// - /// - /// - public override Passenger Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Instance of Passenger to be compared + /// Boolean + public bool Equals(Passenger input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option dateOfBirth = default; - Option firstName = default; - Option lastName = default; - Option phoneNumber = default; - Option travellerType = default; - - while (utf8JsonReader.Read()) + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "dateOfBirth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "firstName": - firstName = new Option(utf8JsonReader.GetString()); - break; - case "lastName": - lastName = new Option(utf8JsonReader.GetString()); - break; - case "phoneNumber": - phoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "travellerType": - travellerType = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (dateOfBirth.IsSet && dateOfBirth.Value == null) - throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class Passenger."); - - if (firstName.IsSet && firstName.Value == null) - throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Passenger."); - - if (lastName.IsSet && lastName.Value == null) - throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class Passenger."); - - if (phoneNumber.IsSet && phoneNumber.Value == null) - throw new ArgumentNullException(nameof(phoneNumber), "Property is not nullable for class Passenger."); - - if (travellerType.IsSet && travellerType.Value == null) - throw new ArgumentNullException(nameof(travellerType), "Property is not nullable for class Passenger."); - - return new Passenger(dateOfBirth, firstName, lastName, phoneNumber, travellerType); + return + ( + this.DateOfBirth == input.DateOfBirth || + (this.DateOfBirth != null && + this.DateOfBirth.Equals(input.DateOfBirth)) + ) && + ( + this.FirstName == input.FirstName || + (this.FirstName != null && + this.FirstName.Equals(input.FirstName)) + ) && + ( + this.LastName == input.LastName || + (this.LastName != null && + this.LastName.Equals(input.LastName)) + ) && + ( + this.PhoneNumber == input.PhoneNumber || + (this.PhoneNumber != null && + this.PhoneNumber.Equals(input.PhoneNumber)) + ) && + ( + this.TravellerType == input.TravellerType || + (this.TravellerType != null && + this.TravellerType.Equals(input.TravellerType)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Passenger passenger, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, passenger, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.DateOfBirth != null) + { + hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); + } + if (this.FirstName != null) + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } + if (this.LastName != null) + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } + if (this.PhoneNumber != null) + { + hashCode = (hashCode * 59) + this.PhoneNumber.GetHashCode(); + } + if (this.TravellerType != null) + { + hashCode = (hashCode * 59) + this.TravellerType.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Passenger passenger, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (passenger.FirstNameOption.IsSet && passenger.FirstName == null) - throw new ArgumentNullException(nameof(passenger.FirstName), "Property is required for class Passenger."); - - if (passenger.LastNameOption.IsSet && passenger.LastName == null) - throw new ArgumentNullException(nameof(passenger.LastName), "Property is required for class Passenger."); - - if (passenger.PhoneNumberOption.IsSet && passenger.PhoneNumber == null) - throw new ArgumentNullException(nameof(passenger.PhoneNumber), "Property is required for class Passenger."); - - if (passenger.TravellerTypeOption.IsSet && passenger.TravellerType == null) - throw new ArgumentNullException(nameof(passenger.TravellerType), "Property is required for class Passenger."); - - if (passenger.DateOfBirthOption.IsSet) - writer.WriteString("dateOfBirth", passenger.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); - - if (passenger.FirstNameOption.IsSet) - writer.WriteString("firstName", passenger.FirstName); - - if (passenger.LastNameOption.IsSet) - writer.WriteString("lastName", passenger.LastName); - - if (passenger.PhoneNumberOption.IsSet) - writer.WriteString("phoneNumber", passenger.PhoneNumber); - - if (passenger.TravellerTypeOption.IsSet) - writer.WriteString("travellerType", passenger.TravellerType); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs b/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs index 0aa3ab001..4daaccd99 100644 --- a/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs +++ b/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,141 +15,86 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PayByBankAISDirectDebitDetails /// - public partial class PayByBankAISDirectDebitDetails : IValidatableObject + [DataContract(Name = "PayByBankAISDirectDebitDetails")] + public partial class PayByBankAISDirectDebitDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **paybybank_AIS_DD** (default to TypeEnum.PaybybankAISDD) - [JsonConstructor] - public PayByBankAISDirectDebitDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.PaybybankAISDD) - { - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - Type = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **paybybank_AIS_DD** /// /// **paybybank_AIS_DD** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum PaybybankAISDD for value: paybybank_AIS_DD /// + [EnumMember(Value = "paybybank_AIS_DD")] PaybybankAISDD = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("paybybank_AIS_DD")) - return TypeEnum.PaybybankAISDD; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("paybybank_AIS_DD")) - return TypeEnum.PaybybankAISDD; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.PaybybankAISDD) - return "paybybank_AIS_DD"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **paybybank_AIS_DD** /// /// **paybybank_AIS_DD** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - + [JsonConstructorAttribute] + protected PayByBankAISDirectDebitDetails() { } /// - /// The checkout attempt identifier. + /// Initializes a new instance of the class. /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + /// The checkout attempt identifier.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **paybybank_AIS_DD** (required) (default to TypeEnum.PaybybankAISDD). + public PayByBankAISDirectDebitDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.PaybybankAISDD) + { + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + } /// - /// Used to track the state of RecurringDetailReference + /// The checkout attempt identifier. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -167,146 +113,97 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PayByBankAISDirectDebitDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PayByBankAISDirectDebitDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as PayByBankAISDirectDebitDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PayByBankAISDirectDebitDetails instances are equal + /// + /// Instance of PayByBankAISDirectDebitDetails to be compared + /// Boolean + public bool Equals(PayByBankAISDirectDebitDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(PayByBankAISDirectDebitDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class PayByBankAISDirectDebitDetails.", nameof(type)); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayByBankAISDirectDebitDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayByBankAISDirectDebitDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayByBankAISDirectDebitDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayByBankAISDirectDebitDetails."); - - return new PayByBankAISDirectDebitDetails(checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type.Value.Value); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PayByBankAISDirectDebitDetails payByBankAISDirectDebitDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, payByBankAISDirectDebitDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PayByBankAISDirectDebitDetails payByBankAISDirectDebitDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (payByBankAISDirectDebitDetails.CheckoutAttemptIdOption.IsSet && payByBankAISDirectDebitDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(payByBankAISDirectDebitDetails.CheckoutAttemptId), "Property is required for class PayByBankAISDirectDebitDetails."); - - if (payByBankAISDirectDebitDetails.RecurringDetailReferenceOption.IsSet && payByBankAISDirectDebitDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(payByBankAISDirectDebitDetails.RecurringDetailReference), "Property is required for class PayByBankAISDirectDebitDetails."); - - if (payByBankAISDirectDebitDetails.StoredPaymentMethodIdOption.IsSet && payByBankAISDirectDebitDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(payByBankAISDirectDebitDetails.StoredPaymentMethodId), "Property is required for class PayByBankAISDirectDebitDetails."); - - if (payByBankAISDirectDebitDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", payByBankAISDirectDebitDetails.CheckoutAttemptId); - - if (payByBankAISDirectDebitDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", payByBankAISDirectDebitDetails.RecurringDetailReference); - - if (payByBankAISDirectDebitDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", payByBankAISDirectDebitDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = PayByBankAISDirectDebitDetails.TypeEnumToJsonValue(payByBankAISDirectDebitDetails.Type); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PayByBankDetails.cs b/Adyen/Model/Checkout/PayByBankDetails.cs index 5c79c8075..b34dca7de 100644 --- a/Adyen/Model/Checkout/PayByBankDetails.cs +++ b/Adyen/Model/Checkout/PayByBankDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,124 +15,76 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PayByBankDetails /// - public partial class PayByBankDetails : IValidatableObject + [DataContract(Name = "PayByBankDetails")] + public partial class PayByBankDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// The PayByBank issuer value of the shopper's selected bank. - /// **paybybank** (default to TypeEnum.Paybybank) - [JsonConstructor] - public PayByBankDetails(Option checkoutAttemptId = default, Option issuer = default, TypeEnum type = TypeEnum.Paybybank) - { - CheckoutAttemptIdOption = checkoutAttemptId; - IssuerOption = issuer; - Type = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **paybybank** /// /// **paybybank** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Paybybank for value: paybybank /// + [EnumMember(Value = "paybybank")] Paybybank = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("paybybank")) - return TypeEnum.Paybybank; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("paybybank")) - return TypeEnum.Paybybank; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.Paybybank) - return "paybybank"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **paybybank** /// /// **paybybank** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - + [JsonConstructorAttribute] + protected PayByBankDetails() { } /// - /// The checkout attempt identifier. + /// Initializes a new instance of the class. /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + /// The checkout attempt identifier.. + /// The PayByBank issuer value of the shopper's selected bank.. + /// **paybybank** (required) (default to TypeEnum.Paybybank). + public PayByBankDetails(string checkoutAttemptId = default(string), string issuer = default(string), TypeEnum type = TypeEnum.Paybybank) + { + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; + this.Issuer = issuer; + } /// - /// Used to track the state of Issuer + /// The checkout attempt identifier. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IssuerOption { get; private set; } + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The PayByBank issuer value of the shopper's selected bank. /// /// The PayByBank issuer value of the shopper's selected bank. - [JsonPropertyName("issuer")] - public string Issuer { get { return this.IssuerOption; } set { this.IssuerOption = new Option(value); } } + [DataMember(Name = "issuer", EmitDefaultValue = false)] + public string Issuer { get; set; } /// /// Returns the string presentation of the object @@ -149,127 +102,82 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PayByBankDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PayByBankDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option issuer = default; - Option type = default; + return this.Equals(input as PayByBankDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PayByBankDetails instances are equal + /// + /// Instance of PayByBankDetails to be compared + /// Boolean + public bool Equals(PayByBankDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "issuer": - issuer = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(PayByBankDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class PayByBankDetails.", nameof(type)); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayByBankDetails."); - - if (issuer.IsSet && issuer.Value == null) - throw new ArgumentNullException(nameof(issuer), "Property is not nullable for class PayByBankDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayByBankDetails."); - - return new PayByBankDetails(checkoutAttemptId, issuer, type.Value.Value); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Issuer == input.Issuer || + (this.Issuer != null && + this.Issuer.Equals(input.Issuer)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PayByBankDetails payByBankDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, payByBankDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.Issuer != null) + { + hashCode = (hashCode * 59) + this.Issuer.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PayByBankDetails payByBankDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (payByBankDetails.CheckoutAttemptIdOption.IsSet && payByBankDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(payByBankDetails.CheckoutAttemptId), "Property is required for class PayByBankDetails."); - - if (payByBankDetails.IssuerOption.IsSet && payByBankDetails.Issuer == null) - throw new ArgumentNullException(nameof(payByBankDetails.Issuer), "Property is required for class PayByBankDetails."); - - if (payByBankDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", payByBankDetails.CheckoutAttemptId); - - if (payByBankDetails.IssuerOption.IsSet) - writer.WriteString("issuer", payByBankDetails.Issuer); - - var typeRawValue = PayByBankDetails.TypeEnumToJsonValue(payByBankDetails.Type); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PayPalDetails.cs b/Adyen/Model/Checkout/PayPalDetails.cs index 0a552c15c..3faf34a69 100644 --- a/Adyen/Model/Checkout/PayPalDetails.cs +++ b/Adyen/Model/Checkout/PayPalDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,302 +15,158 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PayPalDetails /// - public partial class PayPalDetails : IValidatableObject + [DataContract(Name = "PayPalDetails")] + public partial class PayPalDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// The unique ID associated with the order. - /// IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED - /// The unique ID associated with the payer. - /// PAYPAL or PAYPAL_CREDIT - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The type of flow to initiate. - /// **paypal** (default to TypeEnum.Paypal) - [JsonConstructor] - public PayPalDetails(Option checkoutAttemptId = default, Option orderID = default, Option payeePreferred = default, Option payerID = default, Option payerSelected = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option subtype = default, TypeEnum type = TypeEnum.Paypal) - { - CheckoutAttemptIdOption = checkoutAttemptId; - OrderIDOption = orderID; - PayeePreferredOption = payeePreferred; - PayerIDOption = payerID; - PayerSelectedOption = payerSelected; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - SubtypeOption = subtype; - Type = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The type of flow to initiate. /// /// The type of flow to initiate. + [JsonConverter(typeof(StringEnumConverter))] public enum SubtypeEnum { /// /// Enum Express for value: express /// + [EnumMember(Value = "express")] Express = 1, /// /// Enum Redirect for value: redirect /// + [EnumMember(Value = "redirect")] Redirect = 2, /// /// Enum Sdk for value: sdk /// + [EnumMember(Value = "sdk")] Sdk = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static SubtypeEnum SubtypeEnumFromString(string value) - { - if (value.Equals("express")) - return SubtypeEnum.Express; - - if (value.Equals("redirect")) - return SubtypeEnum.Redirect; - - if (value.Equals("sdk")) - return SubtypeEnum.Sdk; - - throw new NotImplementedException($"Could not convert value to type SubtypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static SubtypeEnum? SubtypeEnumFromStringOrDefault(string value) - { - if (value.Equals("express")) - return SubtypeEnum.Express; - - if (value.Equals("redirect")) - return SubtypeEnum.Redirect; - - if (value.Equals("sdk")) - return SubtypeEnum.Sdk; - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string SubtypeEnumToJsonValue(SubtypeEnum? value) - { - if (value == SubtypeEnum.Express) - return "express"; - - if (value == SubtypeEnum.Redirect) - return "redirect"; - - if (value == SubtypeEnum.Sdk) - return "sdk"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Subtype - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubtypeOption { get; private set; } /// /// The type of flow to initiate. /// /// The type of flow to initiate. - [JsonPropertyName("subtype")] - public SubtypeEnum? Subtype { get { return this.SubtypeOption; } set { this.SubtypeOption = new Option(value); } } - + [DataMember(Name = "subtype", EmitDefaultValue = false)] + public SubtypeEnum? Subtype { get; set; } /// /// **paypal** /// /// **paypal** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Paypal for value: paypal /// + [EnumMember(Value = "paypal")] Paypal = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("paypal")) - return TypeEnum.Paypal; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("paypal")) - return TypeEnum.Paypal; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.Paypal) - return "paypal"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **paypal** /// /// **paypal** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - + [JsonConstructorAttribute] + protected PayPalDetails() { } /// - /// The checkout attempt identifier. + /// Initializes a new instance of the class. /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + /// The checkout attempt identifier.. + /// The unique ID associated with the order.. + /// IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED. + /// The unique ID associated with the payer.. + /// PAYPAL or PAYPAL_CREDIT. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The type of flow to initiate.. + /// **paypal** (required) (default to TypeEnum.Paypal). + public PayPalDetails(string checkoutAttemptId = default(string), string orderID = default(string), string payeePreferred = default(string), string payerID = default(string), string payerSelected = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), SubtypeEnum? subtype = default(SubtypeEnum?), TypeEnum type = TypeEnum.Paypal) + { + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; + this.OrderID = orderID; + this.PayeePreferred = payeePreferred; + this.PayerID = payerID; + this.PayerSelected = payerSelected; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Subtype = subtype; + } /// - /// Used to track the state of OrderID + /// The checkout attempt identifier. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OrderIDOption { get; private set; } + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The unique ID associated with the order. /// /// The unique ID associated with the order. - [JsonPropertyName("orderID")] - public string OrderID { get { return this.OrderIDOption; } set { this.OrderIDOption = new Option(value); } } - - /// - /// Used to track the state of PayeePreferred - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayeePreferredOption { get; private set; } + [DataMember(Name = "orderID", EmitDefaultValue = false)] + public string OrderID { get; set; } /// /// IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED /// /// IMMEDIATE_PAYMENT_REQUIRED or UNRESTRICTED - [JsonPropertyName("payeePreferred")] - public string PayeePreferred { get { return this.PayeePreferredOption; } set { this.PayeePreferredOption = new Option(value); } } - - /// - /// Used to track the state of PayerID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayerIDOption { get; private set; } + [DataMember(Name = "payeePreferred", EmitDefaultValue = false)] + public string PayeePreferred { get; set; } /// /// The unique ID associated with the payer. /// /// The unique ID associated with the payer. - [JsonPropertyName("payerID")] - public string PayerID { get { return this.PayerIDOption; } set { this.PayerIDOption = new Option(value); } } - - /// - /// Used to track the state of PayerSelected - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayerSelectedOption { get; private set; } + [DataMember(Name = "payerID", EmitDefaultValue = false)] + public string PayerID { get; set; } /// /// PAYPAL or PAYPAL_CREDIT /// /// PAYPAL or PAYPAL_CREDIT - [JsonPropertyName("payerSelected")] - public string PayerSelected { get { return this.PayerSelectedOption; } set { this.PayerSelectedOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "payerSelected", EmitDefaultValue = false)] + public string PayerSelected { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -333,209 +190,138 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PayPalDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PayPalDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option orderID = default; - Option payeePreferred = default; - Option payerID = default; - Option payerSelected = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option subtype = default; - Option type = default; + return this.Equals(input as PayPalDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PayPalDetails instances are equal + /// + /// Instance of PayPalDetails to be compared + /// Boolean + public bool Equals(PayPalDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "orderID": - orderID = new Option(utf8JsonReader.GetString()); - break; - case "payeePreferred": - payeePreferred = new Option(utf8JsonReader.GetString()); - break; - case "payerID": - payerID = new Option(utf8JsonReader.GetString()); - break; - case "payerSelected": - payerSelected = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "subtype": - string subtypeRawValue = utf8JsonReader.GetString(); - if (subtypeRawValue != null) - subtype = new Option(PayPalDetails.SubtypeEnumFromStringOrDefault(subtypeRawValue)); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(PayPalDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class PayPalDetails.", nameof(type)); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayPalDetails."); - - if (orderID.IsSet && orderID.Value == null) - throw new ArgumentNullException(nameof(orderID), "Property is not nullable for class PayPalDetails."); - - if (payeePreferred.IsSet && payeePreferred.Value == null) - throw new ArgumentNullException(nameof(payeePreferred), "Property is not nullable for class PayPalDetails."); - - if (payerID.IsSet && payerID.Value == null) - throw new ArgumentNullException(nameof(payerID), "Property is not nullable for class PayPalDetails."); - - if (payerSelected.IsSet && payerSelected.Value == null) - throw new ArgumentNullException(nameof(payerSelected), "Property is not nullable for class PayPalDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayPalDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayPalDetails."); - - if (subtype.IsSet && subtype.Value == null) - throw new ArgumentNullException(nameof(subtype), "Property is not nullable for class PayPalDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayPalDetails."); - - return new PayPalDetails(checkoutAttemptId, orderID, payeePreferred, payerID, payerSelected, recurringDetailReference, storedPaymentMethodId, subtype, type.Value.Value); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.OrderID == input.OrderID || + (this.OrderID != null && + this.OrderID.Equals(input.OrderID)) + ) && + ( + this.PayeePreferred == input.PayeePreferred || + (this.PayeePreferred != null && + this.PayeePreferred.Equals(input.PayeePreferred)) + ) && + ( + this.PayerID == input.PayerID || + (this.PayerID != null && + this.PayerID.Equals(input.PayerID)) + ) && + ( + this.PayerSelected == input.PayerSelected || + (this.PayerSelected != null && + this.PayerSelected.Equals(input.PayerSelected)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Subtype == input.Subtype || + this.Subtype.Equals(input.Subtype) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PayPalDetails payPalDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, payPalDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.OrderID != null) + { + hashCode = (hashCode * 59) + this.OrderID.GetHashCode(); + } + if (this.PayeePreferred != null) + { + hashCode = (hashCode * 59) + this.PayeePreferred.GetHashCode(); + } + if (this.PayerID != null) + { + hashCode = (hashCode * 59) + this.PayerID.GetHashCode(); + } + if (this.PayerSelected != null) + { + hashCode = (hashCode * 59) + this.PayerSelected.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Subtype.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PayPalDetails payPalDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (payPalDetails.CheckoutAttemptIdOption.IsSet && payPalDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(payPalDetails.CheckoutAttemptId), "Property is required for class PayPalDetails."); - - if (payPalDetails.OrderIDOption.IsSet && payPalDetails.OrderID == null) - throw new ArgumentNullException(nameof(payPalDetails.OrderID), "Property is required for class PayPalDetails."); - - if (payPalDetails.PayeePreferredOption.IsSet && payPalDetails.PayeePreferred == null) - throw new ArgumentNullException(nameof(payPalDetails.PayeePreferred), "Property is required for class PayPalDetails."); - - if (payPalDetails.PayerIDOption.IsSet && payPalDetails.PayerID == null) - throw new ArgumentNullException(nameof(payPalDetails.PayerID), "Property is required for class PayPalDetails."); - - if (payPalDetails.PayerSelectedOption.IsSet && payPalDetails.PayerSelected == null) - throw new ArgumentNullException(nameof(payPalDetails.PayerSelected), "Property is required for class PayPalDetails."); - - if (payPalDetails.RecurringDetailReferenceOption.IsSet && payPalDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(payPalDetails.RecurringDetailReference), "Property is required for class PayPalDetails."); - - if (payPalDetails.StoredPaymentMethodIdOption.IsSet && payPalDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(payPalDetails.StoredPaymentMethodId), "Property is required for class PayPalDetails."); - - if (payPalDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", payPalDetails.CheckoutAttemptId); - - if (payPalDetails.OrderIDOption.IsSet) - writer.WriteString("orderID", payPalDetails.OrderID); - - if (payPalDetails.PayeePreferredOption.IsSet) - writer.WriteString("payeePreferred", payPalDetails.PayeePreferred); - - if (payPalDetails.PayerIDOption.IsSet) - writer.WriteString("payerID", payPalDetails.PayerID); - - if (payPalDetails.PayerSelectedOption.IsSet) - writer.WriteString("payerSelected", payPalDetails.PayerSelected); - - if (payPalDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", payPalDetails.RecurringDetailReference); - - if (payPalDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", payPalDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var subtypeRawValue = PayPalDetails.SubtypeEnumToJsonValue(payPalDetails.SubtypeOption.Value.Value); - writer.WriteString("subtype", subtypeRawValue); - var typeRawValue = PayPalDetails.TypeEnumToJsonValue(payPalDetails.Type); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PayPayDetails.cs b/Adyen/Model/Checkout/PayPayDetails.cs index 32efdd794..796bc2287 100644 --- a/Adyen/Model/Checkout/PayPayDetails.cs +++ b/Adyen/Model/Checkout/PayPayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,148 +15,81 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PayPayDetails /// - public partial class PayPayDetails : IValidatableObject + [DataContract(Name = "PayPayDetails")] + public partial class PayPayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **paypay** (default to TypeEnum.Paypay) - [JsonConstructor] - public PayPayDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **paypay** /// /// **paypay** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Paypay for value: paypay /// + [EnumMember(Value = "paypay")] Paypay = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("paypay")) - return TypeEnum.Paypay; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("paypay")) - return TypeEnum.Paypay; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Paypay) - return "paypay"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **paypay** /// /// **paypay** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **paypay** (default to TypeEnum.Paypay). + public PayPayDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Paypay) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -174,143 +108,97 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PayPayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PayPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as PayPayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PayPayDetails instances are equal + /// + /// Instance of PayPayDetails to be compared + /// Boolean + public bool Equals(PayPayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(PayPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayPayDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayPayDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayPayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayPayDetails."); - - return new PayPayDetails(checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PayPayDetails payPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, payPayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PayPayDetails payPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (payPayDetails.CheckoutAttemptIdOption.IsSet && payPayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(payPayDetails.CheckoutAttemptId), "Property is required for class PayPayDetails."); - - if (payPayDetails.RecurringDetailReferenceOption.IsSet && payPayDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(payPayDetails.RecurringDetailReference), "Property is required for class PayPayDetails."); - - if (payPayDetails.StoredPaymentMethodIdOption.IsSet && payPayDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(payPayDetails.StoredPaymentMethodId), "Property is required for class PayPayDetails."); - - if (payPayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", payPayDetails.CheckoutAttemptId); - - if (payPayDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", payPayDetails.RecurringDetailReference); - - if (payPayDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", payPayDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = PayPayDetails.TypeEnumToJsonValue(payPayDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PayToDetails.cs b/Adyen/Model/Checkout/PayToDetails.cs index 39d7575d5..718ee3940 100644 --- a/Adyen/Model/Checkout/PayToDetails.cs +++ b/Adyen/Model/Checkout/PayToDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,164 +15,90 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PayToDetails /// - public partial class PayToDetails : IValidatableObject + [DataContract(Name = "PayToDetails")] + public partial class PayToDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The shopper's banking details or payId reference, used to complete payment. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **payto** (default to TypeEnum.Payto) - [JsonConstructor] - public PayToDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option shopperAccountIdentifier = default, Option storedPaymentMethodId = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - ShopperAccountIdentifierOption = shopperAccountIdentifier; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **payto** /// /// **payto** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Payto for value: payto /// + [EnumMember(Value = "payto")] Payto = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("payto")) - return TypeEnum.Payto; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("payto")) - return TypeEnum.Payto; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Payto) - return "payto"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **payto** /// /// **payto** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The shopper's banking details or payId reference, used to complete payment.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **payto** (default to TypeEnum.Payto). + public PayToDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string shopperAccountIdentifier = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Payto) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.ShopperAccountIdentifier = shopperAccountIdentifier; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperAccountIdentifier - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperAccountIdentifierOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// The shopper's banking details or payId reference, used to complete payment. /// /// The shopper's banking details or payId reference, used to complete payment. - [JsonPropertyName("shopperAccountIdentifier")] - public string ShopperAccountIdentifier { get { return this.ShopperAccountIdentifierOption; } set { this.ShopperAccountIdentifierOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "shopperAccountIdentifier", EmitDefaultValue = false)] + public string ShopperAccountIdentifier { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -191,156 +118,106 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PayToDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PayToDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option shopperAccountIdentifier = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as PayToDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PayToDetails instances are equal + /// + /// Instance of PayToDetails to be compared + /// Boolean + public bool Equals(PayToDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "shopperAccountIdentifier": - shopperAccountIdentifier = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(PayToDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayToDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayToDetails."); - - if (shopperAccountIdentifier.IsSet && shopperAccountIdentifier.Value == null) - throw new ArgumentNullException(nameof(shopperAccountIdentifier), "Property is not nullable for class PayToDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayToDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayToDetails."); - - return new PayToDetails(checkoutAttemptId, recurringDetailReference, shopperAccountIdentifier, storedPaymentMethodId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.ShopperAccountIdentifier == input.ShopperAccountIdentifier || + (this.ShopperAccountIdentifier != null && + this.ShopperAccountIdentifier.Equals(input.ShopperAccountIdentifier)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PayToDetails payToDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, payToDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.ShopperAccountIdentifier != null) + { + hashCode = (hashCode * 59) + this.ShopperAccountIdentifier.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PayToDetails payToDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (payToDetails.CheckoutAttemptIdOption.IsSet && payToDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(payToDetails.CheckoutAttemptId), "Property is required for class PayToDetails."); - - if (payToDetails.RecurringDetailReferenceOption.IsSet && payToDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(payToDetails.RecurringDetailReference), "Property is required for class PayToDetails."); - - if (payToDetails.ShopperAccountIdentifierOption.IsSet && payToDetails.ShopperAccountIdentifier == null) - throw new ArgumentNullException(nameof(payToDetails.ShopperAccountIdentifier), "Property is required for class PayToDetails."); - - if (payToDetails.StoredPaymentMethodIdOption.IsSet && payToDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(payToDetails.StoredPaymentMethodId), "Property is required for class PayToDetails."); - - if (payToDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", payToDetails.CheckoutAttemptId); - - if (payToDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", payToDetails.RecurringDetailReference); - - if (payToDetails.ShopperAccountIdentifierOption.IsSet) - writer.WriteString("shopperAccountIdentifier", payToDetails.ShopperAccountIdentifier); - - if (payToDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", payToDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = PayToDetails.TypeEnumToJsonValue(payToDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PayUUpiDetails.cs b/Adyen/Model/Checkout/PayUUpiDetails.cs index 7b7d2a83a..e61d26df4 100644 --- a/Adyen/Model/Checkout/PayUUpiDetails.cs +++ b/Adyen/Model/Checkout/PayUUpiDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,173 +15,104 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PayUUpiDetails /// - public partial class PayUUpiDetails : IValidatableObject + [DataContract(Name = "PayUUpiDetails")] + public partial class PayUUpiDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **payu_IN_upi** (default to TypeEnum.PayuINUpi) - /// The virtual payment address for UPI. - [JsonConstructor] - public PayUUpiDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option shopperNotificationReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.PayuINUpi, Option virtualPaymentAddress = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - ShopperNotificationReferenceOption = shopperNotificationReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - Type = type; - VirtualPaymentAddressOption = virtualPaymentAddress; - OnCreated(); - } - - partial void OnCreated(); - /// /// **payu_IN_upi** /// /// **payu_IN_upi** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum PayuINUpi for value: payu_IN_upi /// + [EnumMember(Value = "payu_IN_upi")] PayuINUpi = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("payu_IN_upi")) - return TypeEnum.PayuINUpi; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("payu_IN_upi")) - return TypeEnum.PayuINUpi; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.PayuINUpi) - return "payu_IN_upi"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **payu_IN_upi** /// /// **payu_IN_upi** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - + [JsonConstructorAttribute] + protected PayUUpiDetails() { } /// - /// The checkout attempt identifier. + /// Initializes a new instance of the class. /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + /// The checkout attempt identifier.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **payu_IN_upi** (required) (default to TypeEnum.PayuINUpi). + /// The virtual payment address for UPI.. + public PayUUpiDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string shopperNotificationReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.PayuINUpi, string virtualPaymentAddress = default(string)) + { + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.ShopperNotificationReference = shopperNotificationReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.VirtualPaymentAddress = virtualPaymentAddress; + } /// - /// Used to track the state of RecurringDetailReference + /// The checkout attempt identifier. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperNotificationReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNotificationReferenceOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. - [JsonPropertyName("shopperNotificationReference")] - public string ShopperNotificationReference { get { return this.ShopperNotificationReferenceOption; } set { this.ShopperNotificationReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "shopperNotificationReference", EmitDefaultValue = false)] + public string ShopperNotificationReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of VirtualPaymentAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option VirtualPaymentAddressOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// The virtual payment address for UPI. /// /// The virtual payment address for UPI. - [JsonPropertyName("virtualPaymentAddress")] - public string VirtualPaymentAddress { get { return this.VirtualPaymentAddressOption; } set { this.VirtualPaymentAddressOption = new Option(value); } } + [DataMember(Name = "virtualPaymentAddress", EmitDefaultValue = false)] + public string VirtualPaymentAddress { get; set; } /// /// Returns the string presentation of the object @@ -201,171 +133,115 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PayUUpiDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PayUUpiDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option shopperNotificationReference = default; - Option storedPaymentMethodId = default; - Option type = default; - Option virtualPaymentAddress = default; + return this.Equals(input as PayUUpiDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PayUUpiDetails instances are equal + /// + /// Instance of PayUUpiDetails to be compared + /// Boolean + public bool Equals(PayUUpiDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "shopperNotificationReference": - shopperNotificationReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(PayUUpiDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "virtualPaymentAddress": - virtualPaymentAddress = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class PayUUpiDetails.", nameof(type)); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayUUpiDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayUUpiDetails."); - - if (shopperNotificationReference.IsSet && shopperNotificationReference.Value == null) - throw new ArgumentNullException(nameof(shopperNotificationReference), "Property is not nullable for class PayUUpiDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayUUpiDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayUUpiDetails."); - - if (virtualPaymentAddress.IsSet && virtualPaymentAddress.Value == null) - throw new ArgumentNullException(nameof(virtualPaymentAddress), "Property is not nullable for class PayUUpiDetails."); - - return new PayUUpiDetails(checkoutAttemptId, recurringDetailReference, shopperNotificationReference, storedPaymentMethodId, type.Value.Value, virtualPaymentAddress); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.ShopperNotificationReference == input.ShopperNotificationReference || + (this.ShopperNotificationReference != null && + this.ShopperNotificationReference.Equals(input.ShopperNotificationReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this.VirtualPaymentAddress == input.VirtualPaymentAddress || + (this.VirtualPaymentAddress != null && + this.VirtualPaymentAddress.Equals(input.VirtualPaymentAddress)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PayUUpiDetails payUUpiDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, payUUpiDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.ShopperNotificationReference != null) + { + hashCode = (hashCode * 59) + this.ShopperNotificationReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.VirtualPaymentAddress != null) + { + hashCode = (hashCode * 59) + this.VirtualPaymentAddress.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PayUUpiDetails payUUpiDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (payUUpiDetails.CheckoutAttemptIdOption.IsSet && payUUpiDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(payUUpiDetails.CheckoutAttemptId), "Property is required for class PayUUpiDetails."); - - if (payUUpiDetails.RecurringDetailReferenceOption.IsSet && payUUpiDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(payUUpiDetails.RecurringDetailReference), "Property is required for class PayUUpiDetails."); - - if (payUUpiDetails.ShopperNotificationReferenceOption.IsSet && payUUpiDetails.ShopperNotificationReference == null) - throw new ArgumentNullException(nameof(payUUpiDetails.ShopperNotificationReference), "Property is required for class PayUUpiDetails."); - - if (payUUpiDetails.StoredPaymentMethodIdOption.IsSet && payUUpiDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(payUUpiDetails.StoredPaymentMethodId), "Property is required for class PayUUpiDetails."); - - if (payUUpiDetails.VirtualPaymentAddressOption.IsSet && payUUpiDetails.VirtualPaymentAddress == null) - throw new ArgumentNullException(nameof(payUUpiDetails.VirtualPaymentAddress), "Property is required for class PayUUpiDetails."); - - if (payUUpiDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", payUUpiDetails.CheckoutAttemptId); - - if (payUUpiDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", payUUpiDetails.RecurringDetailReference); - - if (payUUpiDetails.ShopperNotificationReferenceOption.IsSet) - writer.WriteString("shopperNotificationReference", payUUpiDetails.ShopperNotificationReference); - - if (payUUpiDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", payUUpiDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = PayUUpiDetails.TypeEnumToJsonValue(payUUpiDetails.Type); - writer.WriteString("type", typeRawValue); - if (payUUpiDetails.VirtualPaymentAddressOption.IsSet) - writer.WriteString("virtualPaymentAddress", payUUpiDetails.VirtualPaymentAddress); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PayWithGoogleDetails.cs b/Adyen/Model/Checkout/PayWithGoogleDetails.cs index b8702d8fd..39b4bfc98 100644 --- a/Adyen/Model/Checkout/PayWithGoogleDetails.cs +++ b/Adyen/Model/Checkout/PayWithGoogleDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,256 +15,134 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PayWithGoogleDetails /// - public partial class PayWithGoogleDetails : IValidatableObject + [DataContract(Name = "PayWithGoogleDetails")] + public partial class PayWithGoogleDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - /// The checkout attempt identifier. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - /// **paywithgoogle** (default to TypeEnum.Paywithgoogle) - [JsonConstructor] - public PayWithGoogleDetails(string googlePayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option threeDS2SdkVersion = default, Option type = default) - { - GooglePayToken = googlePayToken; - CheckoutAttemptIdOption = checkoutAttemptId; - FundingSourceOption = fundingSource; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - ThreeDS2SdkVersionOption = threeDS2SdkVersion; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// + [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// + [EnumMember(Value = "debit")] Debit = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static FundingSourceEnum FundingSourceEnumFromString(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) - { - if (value == FundingSourceEnum.Credit) - return "credit"; - - if (value == FundingSourceEnum.Debit) - return "debit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonPropertyName("fundingSource")] - public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } /// /// **paywithgoogle** /// /// **paywithgoogle** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Paywithgoogle for value: paywithgoogle /// + [EnumMember(Value = "paywithgoogle")] Paywithgoogle = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("paywithgoogle")) - return TypeEnum.Paywithgoogle; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("paywithgoogle")) - return TypeEnum.Paywithgoogle; - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Paywithgoogle) - return "paywithgoogle"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **paywithgoogle** /// /// **paywithgoogle** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + /// Initializes a new instance of the class. /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - [JsonPropertyName("googlePayToken")] - public string GooglePayToken { get; set; } - + [JsonConstructorAttribute] + protected PayWithGoogleDetails() { } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. (required). + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK.. + /// **paywithgoogle** (default to TypeEnum.Paywithgoogle). + public PayWithGoogleDetails(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string googlePayToken = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string threeDS2SdkVersion = default(string), TypeEnum? type = TypeEnum.Paywithgoogle) + { + this.GooglePayToken = googlePayToken; + this.CheckoutAttemptId = checkoutAttemptId; + this.FundingSource = fundingSource; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.ThreeDS2SdkVersion = threeDS2SdkVersion; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// - /// Used to track the state of RecurringDetailReference + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + [DataMember(Name = "googlePayToken", IsRequired = false, EmitDefaultValue = false)] + public string GooglePayToken { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2SdkVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2SdkVersionOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - [JsonPropertyName("threeDS2SdkVersion")] - public string ThreeDS2SdkVersion { get { return this.ThreeDS2SdkVersionOption; } set { this.ThreeDS2SdkVersionOption = new Option(value); } } + [DataMember(Name = "threeDS2SdkVersion", EmitDefaultValue = false)] + public string ThreeDS2SdkVersion { get; set; } /// /// Returns the string presentation of the object @@ -273,9 +152,9 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PayWithGoogleDetails {\n"); - sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); + sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" ThreeDS2SdkVersion: ").Append(ThreeDS2SdkVersion).Append("\n"); @@ -285,194 +164,132 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // GooglePayToken (string) maxLength - if (this.GooglePayToken != null && this.GooglePayToken.Length > 5000) - { - yield return new ValidationResult("Invalid value for GooglePayToken, length must be less than 5000.", new [] { "GooglePayToken" }); - } - - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - // ThreeDS2SdkVersion (string) maxLength - if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) - { - yield return new ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PayWithGoogleDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PayWithGoogleDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option googlePayToken = default; - Option checkoutAttemptId = default; - Option fundingSource = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option threeDS2SdkVersion = default; - Option type = default; + return this.Equals(input as PayWithGoogleDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PayWithGoogleDetails instances are equal + /// + /// Instance of PayWithGoogleDetails to be compared + /// Boolean + public bool Equals(PayWithGoogleDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "googlePayToken": - googlePayToken = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "fundingSource": - string fundingSourceRawValue = utf8JsonReader.GetString(); - if (fundingSourceRawValue != null) - fundingSource = new Option(PayWithGoogleDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2SdkVersion": - threeDS2SdkVersion = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(PayWithGoogleDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!googlePayToken.IsSet) - throw new ArgumentException("Property is required for class PayWithGoogleDetails.", nameof(googlePayToken)); - - if (googlePayToken.IsSet && googlePayToken.Value == null) - throw new ArgumentNullException(nameof(googlePayToken), "Property is not nullable for class PayWithGoogleDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayWithGoogleDetails."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class PayWithGoogleDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayWithGoogleDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayWithGoogleDetails."); - - if (threeDS2SdkVersion.IsSet && threeDS2SdkVersion.Value == null) - throw new ArgumentNullException(nameof(threeDS2SdkVersion), "Property is not nullable for class PayWithGoogleDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayWithGoogleDetails."); - - return new PayWithGoogleDetails(googlePayToken.Value, checkoutAttemptId, fundingSource, recurringDetailReference, storedPaymentMethodId, threeDS2SdkVersion, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource.Equals(input.FundingSource) + ) && + ( + this.GooglePayToken == input.GooglePayToken || + (this.GooglePayToken != null && + this.GooglePayToken.Equals(input.GooglePayToken)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.ThreeDS2SdkVersion == input.ThreeDS2SdkVersion || + (this.ThreeDS2SdkVersion != null && + this.ThreeDS2SdkVersion.Equals(input.ThreeDS2SdkVersion)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PayWithGoogleDetails payWithGoogleDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, payWithGoogleDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + if (this.GooglePayToken != null) + { + hashCode = (hashCode * 59) + this.GooglePayToken.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.ThreeDS2SdkVersion != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2SdkVersion.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PayWithGoogleDetails payWithGoogleDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (payWithGoogleDetails.GooglePayToken == null) - throw new ArgumentNullException(nameof(payWithGoogleDetails.GooglePayToken), "Property is required for class PayWithGoogleDetails."); - - if (payWithGoogleDetails.CheckoutAttemptIdOption.IsSet && payWithGoogleDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(payWithGoogleDetails.CheckoutAttemptId), "Property is required for class PayWithGoogleDetails."); - - if (payWithGoogleDetails.RecurringDetailReferenceOption.IsSet && payWithGoogleDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(payWithGoogleDetails.RecurringDetailReference), "Property is required for class PayWithGoogleDetails."); - - if (payWithGoogleDetails.StoredPaymentMethodIdOption.IsSet && payWithGoogleDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(payWithGoogleDetails.StoredPaymentMethodId), "Property is required for class PayWithGoogleDetails."); - - if (payWithGoogleDetails.ThreeDS2SdkVersionOption.IsSet && payWithGoogleDetails.ThreeDS2SdkVersion == null) - throw new ArgumentNullException(nameof(payWithGoogleDetails.ThreeDS2SdkVersion), "Property is required for class PayWithGoogleDetails."); - - writer.WriteString("googlePayToken", payWithGoogleDetails.GooglePayToken); - - if (payWithGoogleDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", payWithGoogleDetails.CheckoutAttemptId); - - var fundingSourceRawValue = PayWithGoogleDetails.FundingSourceEnumToJsonValue(payWithGoogleDetails.FundingSourceOption.Value.Value); - writer.WriteString("fundingSource", fundingSourceRawValue); - if (payWithGoogleDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", payWithGoogleDetails.RecurringDetailReference); + // GooglePayToken (string) maxLength + if (this.GooglePayToken != null && this.GooglePayToken.Length > 5000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for GooglePayToken, length must be less than 5000.", new [] { "GooglePayToken" }); + } - if (payWithGoogleDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", payWithGoogleDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - if (payWithGoogleDetails.ThreeDS2SdkVersionOption.IsSet) - writer.WriteString("threeDS2SdkVersion", payWithGoogleDetails.ThreeDS2SdkVersion); + // ThreeDS2SdkVersion (string) maxLength + if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); + } - var typeRawValue = PayWithGoogleDetails.TypeEnumToJsonValue(payWithGoogleDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PayWithGoogleDonations.cs b/Adyen/Model/Checkout/PayWithGoogleDonations.cs index e20baa034..3062f2d61 100644 --- a/Adyen/Model/Checkout/PayWithGoogleDonations.cs +++ b/Adyen/Model/Checkout/PayWithGoogleDonations.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,256 +15,134 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PayWithGoogleDonations /// - public partial class PayWithGoogleDonations : IValidatableObject + [DataContract(Name = "PayWithGoogleDonations")] + public partial class PayWithGoogleDonations : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - /// The checkout attempt identifier. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - /// **paywithgoogle** (default to TypeEnum.Paywithgoogle) - [JsonConstructor] - public PayWithGoogleDonations(string googlePayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option threeDS2SdkVersion = default, Option type = default) - { - GooglePayToken = googlePayToken; - CheckoutAttemptIdOption = checkoutAttemptId; - FundingSourceOption = fundingSource; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - ThreeDS2SdkVersionOption = threeDS2SdkVersion; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// + [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// + [EnumMember(Value = "debit")] Debit = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static FundingSourceEnum FundingSourceEnumFromString(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) - { - if (value == FundingSourceEnum.Credit) - return "credit"; - - if (value == FundingSourceEnum.Debit) - return "debit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonPropertyName("fundingSource")] - public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } /// /// **paywithgoogle** /// /// **paywithgoogle** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Paywithgoogle for value: paywithgoogle /// + [EnumMember(Value = "paywithgoogle")] Paywithgoogle = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("paywithgoogle")) - return TypeEnum.Paywithgoogle; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("paywithgoogle")) - return TypeEnum.Paywithgoogle; - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Paywithgoogle) - return "paywithgoogle"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **paywithgoogle** /// /// **paywithgoogle** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + /// Initializes a new instance of the class. /// - /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. - [JsonPropertyName("googlePayToken")] - public string GooglePayToken { get; set; } - + [JsonConstructorAttribute] + protected PayWithGoogleDonations() { } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. (required). + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK.. + /// **paywithgoogle** (default to TypeEnum.Paywithgoogle). + public PayWithGoogleDonations(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string googlePayToken = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string threeDS2SdkVersion = default(string), TypeEnum? type = TypeEnum.Paywithgoogle) + { + this.GooglePayToken = googlePayToken; + this.CheckoutAttemptId = checkoutAttemptId; + this.FundingSource = fundingSource; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.ThreeDS2SdkVersion = threeDS2SdkVersion; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// - /// Used to track the state of RecurringDetailReference + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + /// The `token` that you obtained from the [Google Pay API](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) `PaymentData` response. + [DataMember(Name = "googlePayToken", IsRequired = false, EmitDefaultValue = false)] + public string GooglePayToken { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2SdkVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2SdkVersionOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. /// /// Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. - [JsonPropertyName("threeDS2SdkVersion")] - public string ThreeDS2SdkVersion { get { return this.ThreeDS2SdkVersionOption; } set { this.ThreeDS2SdkVersionOption = new Option(value); } } + [DataMember(Name = "threeDS2SdkVersion", EmitDefaultValue = false)] + public string ThreeDS2SdkVersion { get; set; } /// /// Returns the string presentation of the object @@ -273,9 +152,9 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PayWithGoogleDonations {\n"); - sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); + sb.Append(" GooglePayToken: ").Append(GooglePayToken).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" ThreeDS2SdkVersion: ").Append(ThreeDS2SdkVersion).Append("\n"); @@ -285,194 +164,132 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // GooglePayToken (string) maxLength - if (this.GooglePayToken != null && this.GooglePayToken.Length > 5000) - { - yield return new ValidationResult("Invalid value for GooglePayToken, length must be less than 5000.", new [] { "GooglePayToken" }); - } - - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - // ThreeDS2SdkVersion (string) maxLength - if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) - { - yield return new ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PayWithGoogleDonationsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PayWithGoogleDonations Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option googlePayToken = default; - Option checkoutAttemptId = default; - Option fundingSource = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option threeDS2SdkVersion = default; - Option type = default; + return this.Equals(input as PayWithGoogleDonations); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PayWithGoogleDonations instances are equal + /// + /// Instance of PayWithGoogleDonations to be compared + /// Boolean + public bool Equals(PayWithGoogleDonations input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "googlePayToken": - googlePayToken = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "fundingSource": - string fundingSourceRawValue = utf8JsonReader.GetString(); - if (fundingSourceRawValue != null) - fundingSource = new Option(PayWithGoogleDonations.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2SdkVersion": - threeDS2SdkVersion = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(PayWithGoogleDonations.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!googlePayToken.IsSet) - throw new ArgumentException("Property is required for class PayWithGoogleDonations.", nameof(googlePayToken)); - - if (googlePayToken.IsSet && googlePayToken.Value == null) - throw new ArgumentNullException(nameof(googlePayToken), "Property is not nullable for class PayWithGoogleDonations."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PayWithGoogleDonations."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class PayWithGoogleDonations."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PayWithGoogleDonations."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PayWithGoogleDonations."); - - if (threeDS2SdkVersion.IsSet && threeDS2SdkVersion.Value == null) - throw new ArgumentNullException(nameof(threeDS2SdkVersion), "Property is not nullable for class PayWithGoogleDonations."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PayWithGoogleDonations."); - - return new PayWithGoogleDonations(googlePayToken.Value, checkoutAttemptId, fundingSource, recurringDetailReference, storedPaymentMethodId, threeDS2SdkVersion, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource.Equals(input.FundingSource) + ) && + ( + this.GooglePayToken == input.GooglePayToken || + (this.GooglePayToken != null && + this.GooglePayToken.Equals(input.GooglePayToken)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.ThreeDS2SdkVersion == input.ThreeDS2SdkVersion || + (this.ThreeDS2SdkVersion != null && + this.ThreeDS2SdkVersion.Equals(input.ThreeDS2SdkVersion)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PayWithGoogleDonations payWithGoogleDonations, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, payWithGoogleDonations, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + if (this.GooglePayToken != null) + { + hashCode = (hashCode * 59) + this.GooglePayToken.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.ThreeDS2SdkVersion != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2SdkVersion.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PayWithGoogleDonations payWithGoogleDonations, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (payWithGoogleDonations.GooglePayToken == null) - throw new ArgumentNullException(nameof(payWithGoogleDonations.GooglePayToken), "Property is required for class PayWithGoogleDonations."); - - if (payWithGoogleDonations.CheckoutAttemptIdOption.IsSet && payWithGoogleDonations.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(payWithGoogleDonations.CheckoutAttemptId), "Property is required for class PayWithGoogleDonations."); - - if (payWithGoogleDonations.RecurringDetailReferenceOption.IsSet && payWithGoogleDonations.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(payWithGoogleDonations.RecurringDetailReference), "Property is required for class PayWithGoogleDonations."); - - if (payWithGoogleDonations.StoredPaymentMethodIdOption.IsSet && payWithGoogleDonations.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(payWithGoogleDonations.StoredPaymentMethodId), "Property is required for class PayWithGoogleDonations."); - - if (payWithGoogleDonations.ThreeDS2SdkVersionOption.IsSet && payWithGoogleDonations.ThreeDS2SdkVersion == null) - throw new ArgumentNullException(nameof(payWithGoogleDonations.ThreeDS2SdkVersion), "Property is required for class PayWithGoogleDonations."); - - writer.WriteString("googlePayToken", payWithGoogleDonations.GooglePayToken); - - if (payWithGoogleDonations.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", payWithGoogleDonations.CheckoutAttemptId); - - var fundingSourceRawValue = PayWithGoogleDonations.FundingSourceEnumToJsonValue(payWithGoogleDonations.FundingSourceOption.Value.Value); - writer.WriteString("fundingSource", fundingSourceRawValue); - if (payWithGoogleDonations.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", payWithGoogleDonations.RecurringDetailReference); + // GooglePayToken (string) maxLength + if (this.GooglePayToken != null && this.GooglePayToken.Length > 5000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for GooglePayToken, length must be less than 5000.", new [] { "GooglePayToken" }); + } - if (payWithGoogleDonations.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", payWithGoogleDonations.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - if (payWithGoogleDonations.ThreeDS2SdkVersionOption.IsSet) - writer.WriteString("threeDS2SdkVersion", payWithGoogleDonations.ThreeDS2SdkVersion); + // ThreeDS2SdkVersion (string) maxLength + if (this.ThreeDS2SdkVersion != null && this.ThreeDS2SdkVersion.Length > 12) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDS2SdkVersion, length must be less than 12.", new [] { "ThreeDS2SdkVersion" }); + } - var typeRawValue = PayWithGoogleDonations.TypeEnumToJsonValue(payWithGoogleDonations.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Payment.cs b/Adyen/Model/Checkout/Payment.cs index 5cbfd1b3e..05d8a43c4 100644 --- a/Adyen/Model/Checkout/Payment.cs +++ b/Adyen/Model/Checkout/Payment.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,145 +15,78 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Payment /// - public partial class Payment : IValidatableObject + [DataContract(Name = "Payment")] + public partial class Payment : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// paymentMethod - /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique. Use this reference when you communicate with us about this request. - /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. - [JsonConstructor] - public Payment(Option amount = default, Option paymentMethod = default, Option pspReference = default, Option resultCode = default) - { - AmountOption = amount; - PaymentMethodOption = paymentMethod; - PspReferenceOption = pspReference; - ResultCodeOption = resultCode; - OnCreated(); - } - - partial void OnCreated(); - /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. + [JsonConverter(typeof(StringEnumConverter))] public enum ResultCodeEnum { /// /// Enum Authorised for value: Authorised /// + [EnumMember(Value = "Authorised")] Authorised = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ResultCodeEnum ResultCodeEnumFromString(string value) - { - if (value.Equals("Authorised")) - return ResultCodeEnum.Authorised; - - throw new NotImplementedException($"Could not convert value to type ResultCodeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ResultCodeEnum? ResultCodeEnumFromStringOrDefault(string value) - { - if (value.Equals("Authorised")) - return ResultCodeEnum.Authorised; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ResultCodeEnumToJsonValue(ResultCodeEnum? value) - { - if (value == ResultCodeEnum.Authorised) - return "Authorised"; - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of ResultCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ResultCodeOption { get; private set; } /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. - [JsonPropertyName("resultCode")] - public ResultCodeEnum? ResultCode { get { return this.ResultCodeOption; } set { this.ResultCodeOption = new Option(value); } } - + [DataMember(Name = "resultCode", EmitDefaultValue = false)] + public ResultCodeEnum? ResultCode { get; set; } /// - /// Used to track the state of Amount + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountOption { get; private set; } + /// amount. + /// paymentMethod. + /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique. Use this reference when you communicate with us about this request.. + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. . + public Payment(Amount amount = default(Amount), ResponsePaymentMethod paymentMethod = default(ResponsePaymentMethod), string pspReference = default(string), ResultCodeEnum? resultCode = default(ResultCodeEnum?)) + { + this.Amount = amount; + this.PaymentMethod = paymentMethod; + this.PspReference = pspReference; + this.ResultCode = resultCode; + } /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] - public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } - - /// - /// Used to track the state of PaymentMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodOption { get; private set; } + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// Gets or Sets PaymentMethod /// - [JsonPropertyName("paymentMethod")] - public ResponsePaymentMethod PaymentMethod { get { return this.PaymentMethodOption; } set { this.PaymentMethodOption = new Option(value); } } - - /// - /// Used to track the state of PspReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PspReferenceOption { get; private set; } + [DataMember(Name = "paymentMethod", EmitDefaultValue = false)] + public ResponsePaymentMethod PaymentMethod { get; set; } /// /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique. Use this reference when you communicate with us about this request. /// /// Adyen's 16-character reference associated with the transaction/request. This value is globally unique. Use this reference when you communicate with us about this request. - [JsonPropertyName("pspReference")] - public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + public string PspReference { get; set; } /// /// Returns the string presentation of the object @@ -171,143 +105,91 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Payment Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option paymentMethod = default; - Option pspReference = default; - Option resultCode = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "paymentMethod": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "resultCode": - string resultCodeRawValue = utf8JsonReader.GetString(); - if (resultCodeRawValue != null) - resultCode = new Option(Payment.ResultCodeEnumFromStringOrDefault(resultCodeRawValue)); - break; - default: - break; - } - } - } - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class Payment."); - - if (paymentMethod.IsSet && paymentMethod.Value == null) - throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class Payment."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class Payment."); - - if (resultCode.IsSet && resultCode.Value == null) - throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class Payment."); - - return new Payment(amount, paymentMethod, pspReference, resultCode); + return this.Equals(input as Payment); } /// - /// Serializes a + /// Returns true if Payment instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Payment payment, JsonSerializerOptions jsonSerializerOptions) + /// Instance of Payment to be compared + /// Boolean + public bool Equals(Payment input) { - writer.WriteStartObject(); - - WriteProperties(writer, payment, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.PaymentMethod == input.PaymentMethod || + (this.PaymentMethod != null && + this.PaymentMethod.Equals(input.PaymentMethod)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.ResultCode == input.ResultCode || + this.ResultCode.Equals(input.ResultCode) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Payment payment, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (payment.AmountOption.IsSet && payment.Amount == null) - throw new ArgumentNullException(nameof(payment.Amount), "Property is required for class Payment."); - - if (payment.PaymentMethodOption.IsSet && payment.PaymentMethod == null) - throw new ArgumentNullException(nameof(payment.PaymentMethod), "Property is required for class Payment."); - - if (payment.PspReferenceOption.IsSet && payment.PspReference == null) - throw new ArgumentNullException(nameof(payment.PspReference), "Property is required for class Payment."); - - if (payment.AmountOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, payment.Amount, jsonSerializerOptions); - } - if (payment.PaymentMethodOption.IsSet) - { - writer.WritePropertyName("paymentMethod"); - JsonSerializer.Serialize(writer, payment.PaymentMethod, jsonSerializerOptions); + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.PaymentMethod != null) + { + hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ResultCode.GetHashCode(); + return hashCode; } - if (payment.PspReferenceOption.IsSet) - writer.WriteString("pspReference", payment.PspReference); - - var resultCodeRawValue = Payment.ResultCodeEnumToJsonValue(payment.ResultCodeOption.Value.Value); - writer.WriteString("resultCode", resultCodeRawValue); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs b/Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs index e989b535b..61f584801 100644 --- a/Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs +++ b/Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,207 +15,130 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentAmountUpdateRequest /// - public partial class PaymentAmountUpdateRequest : IValidatableObject + [DataContract(Name = "PaymentAmountUpdateRequest")] + public partial class PaymentAmountUpdateRequest : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The merchant account that is used to process the payment. - /// applicationInfo - /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - /// Your reference for the amount update request. Maximum length: 80 characters. - /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments). - [JsonConstructor] - public PaymentAmountUpdateRequest(Amount amount, string merchantAccount, Option applicationInfo = default, Option industryUsage = default, Option> lineItems = default, Option reference = default, Option> splits = default) - { - Amount = amount; - MerchantAccount = merchantAccount; - ApplicationInfoOption = applicationInfo; - IndustryUsageOption = industryUsage; - LineItemsOption = lineItems; - ReferenceOption = reference; - SplitsOption = splits; - OnCreated(); - } - - partial void OnCreated(); - /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + [JsonConverter(typeof(StringEnumConverter))] public enum IndustryUsageEnum { /// /// Enum DelayedCharge for value: delayedCharge /// + [EnumMember(Value = "delayedCharge")] DelayedCharge = 1, /// /// Enum Installment for value: installment /// + [EnumMember(Value = "installment")] Installment = 2, /// /// Enum NoShow for value: noShow /// + [EnumMember(Value = "noShow")] NoShow = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static IndustryUsageEnum IndustryUsageEnumFromString(string value) - { - if (value.Equals("delayedCharge")) - return IndustryUsageEnum.DelayedCharge; - - if (value.Equals("installment")) - return IndustryUsageEnum.Installment; - - if (value.Equals("noShow")) - return IndustryUsageEnum.NoShow; - - throw new NotImplementedException($"Could not convert value to type IndustryUsageEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static IndustryUsageEnum? IndustryUsageEnumFromStringOrDefault(string value) - { - if (value.Equals("delayedCharge")) - return IndustryUsageEnum.DelayedCharge; - - if (value.Equals("installment")) - return IndustryUsageEnum.Installment; - - if (value.Equals("noShow")) - return IndustryUsageEnum.NoShow; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string IndustryUsageEnumToJsonValue(IndustryUsageEnum? value) - { - if (value == IndustryUsageEnum.DelayedCharge) - return "delayedCharge"; - - if (value == IndustryUsageEnum.Installment) - return "installment"; - - if (value == IndustryUsageEnum.NoShow) - return "noShow"; - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of IndustryUsage - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IndustryUsageOption { get; private set; } /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - [JsonPropertyName("industryUsage")] - public IndustryUsageEnum? IndustryUsage { get { return this.IndustryUsageOption; } set { this.IndustryUsageOption = new Option(value); } } - + [DataMember(Name = "industryUsage", EmitDefaultValue = false)] + public IndustryUsageEnum? IndustryUsage { get; set; } /// - /// Gets or Sets Amount + /// Initializes a new instance of the class. /// - [JsonPropertyName("amount")] - public Amount Amount { get; set; } - + [JsonConstructorAttribute] + protected PaymentAmountUpdateRequest() { } /// - /// The merchant account that is used to process the payment. + /// Initializes a new instance of the class. /// - /// The merchant account that is used to process the payment. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } + /// amount (required). + /// applicationInfo. + /// enhancedSchemeData. + /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment**. + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.. + /// The merchant account that is used to process the payment. (required). + /// Your reference for the amount update request. Maximum length: 80 characters.. + /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments).. + public PaymentAmountUpdateRequest(Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), EnhancedSchemeData enhancedSchemeData = default(EnhancedSchemeData), IndustryUsageEnum? industryUsage = default(IndustryUsageEnum?), List lineItems = default(List), string merchantAccount = default(string), string reference = default(string), List splits = default(List)) + { + this.Amount = amount; + this.MerchantAccount = merchantAccount; + this.ApplicationInfo = applicationInfo; + this.EnhancedSchemeData = enhancedSchemeData; + this.IndustryUsage = industryUsage; + this.LineItems = lineItems; + this.Reference = reference; + this.Splits = splits; + } /// - /// Used to track the state of ApplicationInfo + /// Gets or Sets Amount /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ApplicationInfoOption { get; private set; } + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// Gets or Sets ApplicationInfo /// - [JsonPropertyName("applicationInfo")] - public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } /// - /// Used to track the state of LineItems + /// Gets or Sets EnhancedSchemeData /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LineItemsOption { get; private set; } + [DataMember(Name = "enhancedSchemeData", EmitDefaultValue = false)] + public EnhancedSchemeData EnhancedSchemeData { get; set; } /// /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. /// /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - [JsonPropertyName("lineItems")] - public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } /// - /// Used to track the state of Reference + /// The merchant account that is used to process the payment. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + /// The merchant account that is used to process the payment. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// Your reference for the amount update request. Maximum length: 80 characters. /// /// Your reference for the amount update request. Maximum length: 80 characters. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Splits - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SplitsOption { get; private set; } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments). /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments). - [JsonPropertyName("splits")] - public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// Returns the string presentation of the object @@ -225,10 +149,11 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PaymentAmountUpdateRequest {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); + sb.Append(" EnhancedSchemeData: ").Append(EnhancedSchemeData).Append("\n"); sb.Append(" IndustryUsage: ").Append(IndustryUsage).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); sb.Append("}\n"); @@ -236,190 +161,129 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentAmountUpdateRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentAmountUpdateRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option merchantAccount = default; - Option applicationInfo = default; - Option industryUsage = default; - Option> lineItems = default; - Option reference = default; - Option> splits = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "applicationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "industryUsage": - string industryUsageRawValue = utf8JsonReader.GetString(); - if (industryUsageRawValue != null) - industryUsage = new Option(PaymentAmountUpdateRequest.IndustryUsageEnumFromStringOrDefault(industryUsageRawValue)); - break; - case "lineItems": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "splits": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class PaymentAmountUpdateRequest.", nameof(amount)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentAmountUpdateRequest.", nameof(merchantAccount)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentAmountUpdateRequest."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentAmountUpdateRequest."); - - if (applicationInfo.IsSet && applicationInfo.Value == null) - throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentAmountUpdateRequest."); - - if (industryUsage.IsSet && industryUsage.Value == null) - throw new ArgumentNullException(nameof(industryUsage), "Property is not nullable for class PaymentAmountUpdateRequest."); - - if (lineItems.IsSet && lineItems.Value == null) - throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentAmountUpdateRequest."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentAmountUpdateRequest."); - - if (splits.IsSet && splits.Value == null) - throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentAmountUpdateRequest."); - - return new PaymentAmountUpdateRequest(amount.Value, merchantAccount.Value, applicationInfo, industryUsage, lineItems, reference, splits); + return this.Equals(input as PaymentAmountUpdateRequest); } /// - /// Serializes a + /// Returns true if PaymentAmountUpdateRequest instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentAmountUpdateRequest paymentAmountUpdateRequest, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentAmountUpdateRequest to be compared + /// Boolean + public bool Equals(PaymentAmountUpdateRequest input) { - writer.WriteStartObject(); - - WriteProperties(writer, paymentAmountUpdateRequest, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.ApplicationInfo == input.ApplicationInfo || + (this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo)) + ) && + ( + this.EnhancedSchemeData == input.EnhancedSchemeData || + (this.EnhancedSchemeData != null && + this.EnhancedSchemeData.Equals(input.EnhancedSchemeData)) + ) && + ( + this.IndustryUsage == input.IndustryUsage || + this.IndustryUsage.Equals(input.IndustryUsage) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentAmountUpdateRequest paymentAmountUpdateRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paymentAmountUpdateRequest.Amount == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateRequest.Amount), "Property is required for class PaymentAmountUpdateRequest."); - - if (paymentAmountUpdateRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateRequest.MerchantAccount), "Property is required for class PaymentAmountUpdateRequest."); - - if (paymentAmountUpdateRequest.ApplicationInfoOption.IsSet && paymentAmountUpdateRequest.ApplicationInfo == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateRequest.ApplicationInfo), "Property is required for class PaymentAmountUpdateRequest."); - - if (paymentAmountUpdateRequest.LineItemsOption.IsSet && paymentAmountUpdateRequest.LineItems == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateRequest.LineItems), "Property is required for class PaymentAmountUpdateRequest."); - - if (paymentAmountUpdateRequest.ReferenceOption.IsSet && paymentAmountUpdateRequest.Reference == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateRequest.Reference), "Property is required for class PaymentAmountUpdateRequest."); - - if (paymentAmountUpdateRequest.SplitsOption.IsSet && paymentAmountUpdateRequest.Splits == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateRequest.Splits), "Property is required for class PaymentAmountUpdateRequest."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, paymentAmountUpdateRequest.Amount, jsonSerializerOptions); - writer.WriteString("merchantAccount", paymentAmountUpdateRequest.MerchantAccount); - - if (paymentAmountUpdateRequest.ApplicationInfoOption.IsSet) - { - writer.WritePropertyName("applicationInfo"); - JsonSerializer.Serialize(writer, paymentAmountUpdateRequest.ApplicationInfo, jsonSerializerOptions); - } - var industryUsageRawValue = PaymentAmountUpdateRequest.IndustryUsageEnumToJsonValue(paymentAmountUpdateRequest.IndustryUsageOption.Value.Value); - writer.WriteString("industryUsage", industryUsageRawValue); - if (paymentAmountUpdateRequest.LineItemsOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("lineItems"); - JsonSerializer.Serialize(writer, paymentAmountUpdateRequest.LineItems, jsonSerializerOptions); - } - if (paymentAmountUpdateRequest.ReferenceOption.IsSet) - writer.WriteString("reference", paymentAmountUpdateRequest.Reference); - - if (paymentAmountUpdateRequest.SplitsOption.IsSet) - { - writer.WritePropertyName("splits"); - JsonSerializer.Serialize(writer, paymentAmountUpdateRequest.Splits, jsonSerializerOptions); + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.ApplicationInfo != null) + { + hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); + } + if (this.EnhancedSchemeData != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.IndustryUsage.GetHashCode(); + if (this.LineItems != null) + { + hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.Splits != null) + { + hashCode = (hashCode * 59) + this.Splits.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs b/Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs index 099af8864..12681ad55 100644 --- a/Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs +++ b/Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,265 +15,156 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentAmountUpdateResponse /// - public partial class PaymentAmountUpdateResponse : IValidatableObject + [DataContract(Name = "PaymentAmountUpdateResponse")] + public partial class PaymentAmountUpdateResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The merchant account that is used to process the payment. - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. - /// Adyen's 16-character reference associated with the amount update request. - /// Your reference for the amount update request. Maximum length: 80 characters. - /// The status of your request. This will always have the value **received**. - /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments). - [JsonConstructor] - public PaymentAmountUpdateResponse(Amount amount, string merchantAccount, string paymentPspReference, string pspReference, string reference, StatusEnum status, Option industryUsage = default, Option> lineItems = default, Option> splits = default) - { - Amount = amount; - MerchantAccount = merchantAccount; - PaymentPspReference = paymentPspReference; - PspReference = pspReference; - Reference = reference; - Status = status; - IndustryUsageOption = industryUsage; - LineItemsOption = lineItems; - SplitsOption = splits; - OnCreated(); - } - - partial void OnCreated(); - - /// - /// The status of your request. This will always have the value **received**. - /// - /// The status of your request. This will always have the value **received**. - public enum StatusEnum - { - /// - /// Enum Received for value: received - /// - Received = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static StatusEnum StatusEnumFromString(string value) - { - if (value.Equals("received")) - return StatusEnum.Received; - - throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static StatusEnum? StatusEnumFromStringOrDefault(string value) - { - if (value.Equals("received")) - return StatusEnum.Received; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string StatusEnumToJsonValue(StatusEnum value) - { - if (value == StatusEnum.Received) - return "received"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// The status of your request. This will always have the value **received**. - /// - /// The status of your request. This will always have the value **received**. - [JsonPropertyName("status")] - public StatusEnum Status { get; set; } - /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + [JsonConverter(typeof(StringEnumConverter))] public enum IndustryUsageEnum { /// /// Enum DelayedCharge for value: delayedCharge /// + [EnumMember(Value = "delayedCharge")] DelayedCharge = 1, /// /// Enum Installment for value: installment /// + [EnumMember(Value = "installment")] Installment = 2, /// /// Enum NoShow for value: noShow /// + [EnumMember(Value = "noShow")] NoShow = 3 + } + /// - /// Returns a + /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** /// - /// - /// - /// - public static IndustryUsageEnum IndustryUsageEnumFromString(string value) - { - if (value.Equals("delayedCharge")) - return IndustryUsageEnum.DelayedCharge; - - if (value.Equals("installment")) - return IndustryUsageEnum.Installment; - - if (value.Equals("noShow")) - return IndustryUsageEnum.NoShow; - - throw new NotImplementedException($"Could not convert value to type IndustryUsageEnum: '{value}'"); - } - + /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + [DataMember(Name = "industryUsage", EmitDefaultValue = false)] + public IndustryUsageEnum? IndustryUsage { get; set; } /// - /// Returns a + /// The status of your request. This will always have the value **received**. /// - /// - /// - public static IndustryUsageEnum? IndustryUsageEnumFromStringOrDefault(string value) + /// The status of your request. This will always have the value **received**. + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum { - if (value.Equals("delayedCharge")) - return IndustryUsageEnum.DelayedCharge; - - if (value.Equals("installment")) - return IndustryUsageEnum.Installment; - - if (value.Equals("noShow")) - return IndustryUsageEnum.NoShow; + /// + /// Enum Received for value: received + /// + [EnumMember(Value = "received")] + Received = 1 - return null; } + /// - /// Converts the to the json value + /// The status of your request. This will always have the value **received**. /// - /// - /// - /// - public static string IndustryUsageEnumToJsonValue(IndustryUsageEnum? value) - { - if (value == IndustryUsageEnum.DelayedCharge) - return "delayedCharge"; - - if (value == IndustryUsageEnum.Installment) - return "installment"; - - if (value == IndustryUsageEnum.NoShow) - return "noShow"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - + /// The status of your request. This will always have the value **received**. + [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] + public StatusEnum Status { get; set; } /// - /// Used to track the state of IndustryUsage + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IndustryUsageOption { get; private set; } - + [JsonConstructorAttribute] + protected PaymentAmountUpdateResponse() { } /// - /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + /// Initializes a new instance of the class. /// - /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - [JsonPropertyName("industryUsage")] - public IndustryUsageEnum? IndustryUsage { get { return this.IndustryUsageOption; } set { this.IndustryUsageOption = new Option(value); } } + /// amount (required). + /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment**. + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.. + /// The merchant account that is used to process the payment. (required). + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. (required). + /// Adyen's 16-character reference associated with the amount update request. (required). + /// Your reference for the amount update request. Maximum length: 80 characters. (required). + /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments).. + /// The status of your request. This will always have the value **received**. (required). + public PaymentAmountUpdateResponse(Amount amount = default(Amount), IndustryUsageEnum? industryUsage = default(IndustryUsageEnum?), List lineItems = default(List), string merchantAccount = default(string), string paymentPspReference = default(string), string pspReference = default(string), string reference = default(string), List splits = default(List), StatusEnum status = default(StatusEnum)) + { + this.Amount = amount; + this.MerchantAccount = merchantAccount; + this.PaymentPspReference = paymentPspReference; + this.PspReference = pspReference; + this.Reference = reference; + this.Status = status; + this.IndustryUsage = industryUsage; + this.LineItems = lineItems; + this.Splits = splits; + } /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] public Amount Amount { get; set; } + /// + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + /// + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } + /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [JsonPropertyName("merchantAccount")] + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] public string MerchantAccount { get; set; } /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to update. - [JsonPropertyName("paymentPspReference")] + [DataMember(Name = "paymentPspReference", IsRequired = false, EmitDefaultValue = false)] public string PaymentPspReference { get; set; } /// /// Adyen's 16-character reference associated with the amount update request. /// /// Adyen's 16-character reference associated with the amount update request. - [JsonPropertyName("pspReference")] + [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] public string PspReference { get; set; } /// /// Your reference for the amount update request. Maximum length: 80 characters. /// /// Your reference for the amount update request. Maximum length: 80 characters. - [JsonPropertyName("reference")] + [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] public string Reference { get; set; } - /// - /// Used to track the state of LineItems - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LineItemsOption { get; private set; } - - /// - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - /// - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - [JsonPropertyName("lineItems")] - public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } - - /// - /// Used to track the state of Splits - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SplitsOption { get; private set; } - /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments). /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/process-payments) or [platforms](https://docs.adyen.com/platforms/process-payments). - [JsonPropertyName("splits")] - public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// Returns the string presentation of the object @@ -283,233 +175,147 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PaymentAmountUpdateResponse {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" IndustryUsage: ").Append(IndustryUsage).Append("\n"); + sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentPspReference: ").Append(PaymentPspReference).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append(" IndustryUsage: ").Append(IndustryUsage).Append("\n"); - sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentAmountUpdateResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentAmountUpdateResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option merchantAccount = default; - Option paymentPspReference = default; - Option pspReference = default; - Option reference = default; - Option status = default; - Option industryUsage = default; - Option> lineItems = default; - Option> splits = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "paymentPspReference": - paymentPspReference = new Option(utf8JsonReader.GetString()); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "status": - string statusRawValue = utf8JsonReader.GetString(); - if (statusRawValue != null) - status = new Option(PaymentAmountUpdateResponse.StatusEnumFromStringOrDefault(statusRawValue)); - break; - case "industryUsage": - string industryUsageRawValue = utf8JsonReader.GetString(); - if (industryUsageRawValue != null) - industryUsage = new Option(PaymentAmountUpdateResponse.IndustryUsageEnumFromStringOrDefault(industryUsageRawValue)); - break; - case "lineItems": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "splits": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class PaymentAmountUpdateResponse.", nameof(amount)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentAmountUpdateResponse.", nameof(merchantAccount)); - - if (!paymentPspReference.IsSet) - throw new ArgumentException("Property is required for class PaymentAmountUpdateResponse.", nameof(paymentPspReference)); - - if (!pspReference.IsSet) - throw new ArgumentException("Property is required for class PaymentAmountUpdateResponse.", nameof(pspReference)); - - if (!reference.IsSet) - throw new ArgumentException("Property is required for class PaymentAmountUpdateResponse.", nameof(reference)); - - if (!status.IsSet) - throw new ArgumentException("Property is required for class PaymentAmountUpdateResponse.", nameof(status)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentAmountUpdateResponse."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentAmountUpdateResponse."); - - if (paymentPspReference.IsSet && paymentPspReference.Value == null) - throw new ArgumentNullException(nameof(paymentPspReference), "Property is not nullable for class PaymentAmountUpdateResponse."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentAmountUpdateResponse."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentAmountUpdateResponse."); - - if (status.IsSet && status.Value == null) - throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaymentAmountUpdateResponse."); - - if (industryUsage.IsSet && industryUsage.Value == null) - throw new ArgumentNullException(nameof(industryUsage), "Property is not nullable for class PaymentAmountUpdateResponse."); - - if (lineItems.IsSet && lineItems.Value == null) - throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentAmountUpdateResponse."); - - if (splits.IsSet && splits.Value == null) - throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentAmountUpdateResponse."); - - return new PaymentAmountUpdateResponse(amount.Value, merchantAccount.Value, paymentPspReference.Value, pspReference.Value, reference.Value, status.Value.Value, industryUsage, lineItems, splits); + return this.Equals(input as PaymentAmountUpdateResponse); } /// - /// Serializes a + /// Returns true if PaymentAmountUpdateResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentAmountUpdateResponse paymentAmountUpdateResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentAmountUpdateResponse to be compared + /// Boolean + public bool Equals(PaymentAmountUpdateResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, paymentAmountUpdateResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.IndustryUsage == input.IndustryUsage || + this.IndustryUsage.Equals(input.IndustryUsage) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.PaymentPspReference == input.PaymentPspReference || + (this.PaymentPspReference != null && + this.PaymentPspReference.Equals(input.PaymentPspReference)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentAmountUpdateResponse paymentAmountUpdateResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paymentAmountUpdateResponse.Amount == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.Amount), "Property is required for class PaymentAmountUpdateResponse."); - - if (paymentAmountUpdateResponse.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.MerchantAccount), "Property is required for class PaymentAmountUpdateResponse."); - - if (paymentAmountUpdateResponse.PaymentPspReference == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.PaymentPspReference), "Property is required for class PaymentAmountUpdateResponse."); - - if (paymentAmountUpdateResponse.PspReference == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.PspReference), "Property is required for class PaymentAmountUpdateResponse."); - - if (paymentAmountUpdateResponse.Reference == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.Reference), "Property is required for class PaymentAmountUpdateResponse."); - - if (paymentAmountUpdateResponse.LineItemsOption.IsSet && paymentAmountUpdateResponse.LineItems == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.LineItems), "Property is required for class PaymentAmountUpdateResponse."); - - if (paymentAmountUpdateResponse.SplitsOption.IsSet && paymentAmountUpdateResponse.Splits == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateResponse.Splits), "Property is required for class PaymentAmountUpdateResponse."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, paymentAmountUpdateResponse.Amount, jsonSerializerOptions); - writer.WriteString("merchantAccount", paymentAmountUpdateResponse.MerchantAccount); - - writer.WriteString("paymentPspReference", paymentAmountUpdateResponse.PaymentPspReference); - - writer.WriteString("pspReference", paymentAmountUpdateResponse.PspReference); - - writer.WriteString("reference", paymentAmountUpdateResponse.Reference); - - var statusRawValue = PaymentAmountUpdateResponse.StatusEnumToJsonValue(paymentAmountUpdateResponse.Status); - writer.WriteString("status", statusRawValue); - var industryUsageRawValue = PaymentAmountUpdateResponse.IndustryUsageEnumToJsonValue(paymentAmountUpdateResponse.IndustryUsageOption.Value.Value); - writer.WriteString("industryUsage", industryUsageRawValue); - if (paymentAmountUpdateResponse.LineItemsOption.IsSet) - { - writer.WritePropertyName("lineItems"); - JsonSerializer.Serialize(writer, paymentAmountUpdateResponse.LineItems, jsonSerializerOptions); - } - if (paymentAmountUpdateResponse.SplitsOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("splits"); - JsonSerializer.Serialize(writer, paymentAmountUpdateResponse.Splits, jsonSerializerOptions); + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + hashCode = (hashCode * 59) + this.IndustryUsage.GetHashCode(); + if (this.LineItems != null) + { + hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.PaymentPspReference != null) + { + hashCode = (hashCode * 59) + this.PaymentPspReference.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.Splits != null) + { + hashCode = (hashCode * 59) + this.Splits.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/PaymentCancelRequest.cs b/Adyen/Model/Checkout/PaymentCancelRequest.cs index 3bf19c2f3..f31c3bf0b 100644 --- a/Adyen/Model/Checkout/PaymentCancelRequest.cs +++ b/Adyen/Model/Checkout/PaymentCancelRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,70 +15,68 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentCancelRequest /// - public partial class PaymentCancelRequest : IValidatableObject + [DataContract(Name = "PaymentCancelRequest")] + public partial class PaymentCancelRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The merchant account that is used to process the payment. - /// applicationInfo - /// Your reference for the cancel request. Maximum length: 80 characters. - [JsonConstructor] - public PaymentCancelRequest(string merchantAccount, Option applicationInfo = default, Option reference = default) - { - MerchantAccount = merchantAccount; - ApplicationInfoOption = applicationInfo; - ReferenceOption = reference; - OnCreated(); - } - - partial void OnCreated(); - + [JsonConstructorAttribute] + protected PaymentCancelRequest() { } /// - /// The merchant account that is used to process the payment. + /// Initializes a new instance of the class. /// - /// The merchant account that is used to process the payment. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } + /// applicationInfo. + /// enhancedSchemeData. + /// The merchant account that is used to process the payment. (required). + /// Your reference for the cancel request. Maximum length: 80 characters.. + public PaymentCancelRequest(ApplicationInfo applicationInfo = default(ApplicationInfo), EnhancedSchemeData enhancedSchemeData = default(EnhancedSchemeData), string merchantAccount = default(string), string reference = default(string)) + { + this.MerchantAccount = merchantAccount; + this.ApplicationInfo = applicationInfo; + this.EnhancedSchemeData = enhancedSchemeData; + this.Reference = reference; + } /// - /// Used to track the state of ApplicationInfo + /// Gets or Sets ApplicationInfo /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ApplicationInfoOption { get; private set; } + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } /// - /// Gets or Sets ApplicationInfo + /// Gets or Sets EnhancedSchemeData /// - [JsonPropertyName("applicationInfo")] - public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + [DataMember(Name = "enhancedSchemeData", EmitDefaultValue = false)] + public EnhancedSchemeData EnhancedSchemeData { get; set; } /// - /// Used to track the state of Reference + /// The merchant account that is used to process the payment. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + /// The merchant account that is used to process the payment. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// Your reference for the cancel request. Maximum length: 80 characters. /// /// Your reference for the cancel request. Maximum length: 80 characters. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Returns the string presentation of the object @@ -87,138 +86,104 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentCancelRequest {\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); + sb.Append(" EnhancedSchemeData: ").Append(EnhancedSchemeData).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentCancelRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentCancelRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option merchantAccount = default; - Option applicationInfo = default; - Option reference = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "applicationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentCancelRequest.", nameof(merchantAccount)); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentCancelRequest."); - - if (applicationInfo.IsSet && applicationInfo.Value == null) - throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentCancelRequest."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentCancelRequest."); - - return new PaymentCancelRequest(merchantAccount.Value, applicationInfo, reference); + return this.Equals(input as PaymentCancelRequest); } /// - /// Serializes a + /// Returns true if PaymentCancelRequest instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentCancelRequest paymentCancelRequest, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentCancelRequest to be compared + /// Boolean + public bool Equals(PaymentCancelRequest input) { - writer.WriteStartObject(); - - WriteProperties(writer, paymentCancelRequest, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.ApplicationInfo == input.ApplicationInfo || + (this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo)) + ) && + ( + this.EnhancedSchemeData == input.EnhancedSchemeData || + (this.EnhancedSchemeData != null && + this.EnhancedSchemeData.Equals(input.EnhancedSchemeData)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentCancelRequest paymentCancelRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paymentCancelRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentCancelRequest.MerchantAccount), "Property is required for class PaymentCancelRequest."); - - if (paymentCancelRequest.ApplicationInfoOption.IsSet && paymentCancelRequest.ApplicationInfo == null) - throw new ArgumentNullException(nameof(paymentCancelRequest.ApplicationInfo), "Property is required for class PaymentCancelRequest."); - - if (paymentCancelRequest.ReferenceOption.IsSet && paymentCancelRequest.Reference == null) - throw new ArgumentNullException(nameof(paymentCancelRequest.Reference), "Property is required for class PaymentCancelRequest."); - - writer.WriteString("merchantAccount", paymentCancelRequest.MerchantAccount); - - if (paymentCancelRequest.ApplicationInfoOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("applicationInfo"); - JsonSerializer.Serialize(writer, paymentCancelRequest.ApplicationInfo, jsonSerializerOptions); + int hashCode = 41; + if (this.ApplicationInfo != null) + { + hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); + } + if (this.EnhancedSchemeData != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeData.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + return hashCode; } - if (paymentCancelRequest.ReferenceOption.IsSet) - writer.WriteString("reference", paymentCancelRequest.Reference); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentCancelResponse.cs b/Adyen/Model/Checkout/PaymentCancelResponse.cs index 8cc30fb8a..97fee4ab7 100644 --- a/Adyen/Model/Checkout/PaymentCancelResponse.cs +++ b/Adyen/Model/Checkout/PaymentCancelResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,135 +15,94 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentCancelResponse /// - public partial class PaymentCancelResponse : IValidatableObject + [DataContract(Name = "PaymentCancelResponse")] + public partial class PaymentCancelResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The merchant account that is used to process the payment. - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. - /// Adyen's 16-character reference associated with the cancel request. - /// The status of your request. This will always have the value **received**. - /// Your reference for the cancel request. - [JsonConstructor] - public PaymentCancelResponse(string merchantAccount, string paymentPspReference, string pspReference, StatusEnum status, Option reference = default) - { - MerchantAccount = merchantAccount; - PaymentPspReference = paymentPspReference; - PspReference = pspReference; - Status = status; - ReferenceOption = reference; - OnCreated(); - } - - partial void OnCreated(); - /// /// The status of your request. This will always have the value **received**. /// /// The status of your request. This will always have the value **received**. + [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Received for value: received /// + [EnumMember(Value = "received")] Received = 1 + } + /// - /// Returns a + /// The status of your request. This will always have the value **received**. /// - /// - /// - /// - public static StatusEnum StatusEnumFromString(string value) - { - if (value.Equals("received")) - return StatusEnum.Received; - - throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); - } - + /// The status of your request. This will always have the value **received**. + [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] + public StatusEnum Status { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static StatusEnum? StatusEnumFromStringOrDefault(string value) - { - if (value.Equals("received")) - return StatusEnum.Received; - - return null; - } - + [JsonConstructorAttribute] + protected PaymentCancelResponse() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string StatusEnumToJsonValue(StatusEnum value) + /// The merchant account that is used to process the payment. (required). + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. (required). + /// Adyen's 16-character reference associated with the cancel request. (required). + /// Your reference for the cancel request.. + /// The status of your request. This will always have the value **received**. (required). + public PaymentCancelResponse(string merchantAccount = default(string), string paymentPspReference = default(string), string pspReference = default(string), string reference = default(string), StatusEnum status = default(StatusEnum)) { - if (value == StatusEnum.Received) - return "received"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.MerchantAccount = merchantAccount; + this.PaymentPspReference = paymentPspReference; + this.PspReference = pspReference; + this.Status = status; + this.Reference = reference; } - /// - /// The status of your request. This will always have the value **received**. - /// - /// The status of your request. This will always have the value **received**. - [JsonPropertyName("status")] - public StatusEnum Status { get; set; } - /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [JsonPropertyName("merchantAccount")] + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] public string MerchantAccount { get; set; } /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to cancel. - [JsonPropertyName("paymentPspReference")] + [DataMember(Name = "paymentPspReference", IsRequired = false, EmitDefaultValue = false)] public string PaymentPspReference { get; set; } /// /// Adyen's 16-character reference associated with the cancel request. /// /// Adyen's 16-character reference associated with the cancel request. - [JsonPropertyName("pspReference")] + [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] public string PspReference { get; set; } - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } - /// /// Your reference for the cancel request. /// /// Your reference for the cancel request. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Returns the string presentation of the object @@ -155,165 +115,107 @@ public override string ToString() sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentPspReference: ").Append(PaymentPspReference).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentCancelResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentCancelResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option merchantAccount = default; - Option paymentPspReference = default; - Option pspReference = default; - Option status = default; - Option reference = default; + return this.Equals(input as PaymentCancelResponse); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PaymentCancelResponse instances are equal + /// + /// Instance of PaymentCancelResponse to be compared + /// Boolean + public bool Equals(PaymentCancelResponse input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "paymentPspReference": - paymentPspReference = new Option(utf8JsonReader.GetString()); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "status": - string statusRawValue = utf8JsonReader.GetString(); - if (statusRawValue != null) - status = new Option(PaymentCancelResponse.StatusEnumFromStringOrDefault(statusRawValue)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentCancelResponse.", nameof(merchantAccount)); - - if (!paymentPspReference.IsSet) - throw new ArgumentException("Property is required for class PaymentCancelResponse.", nameof(paymentPspReference)); - - if (!pspReference.IsSet) - throw new ArgumentException("Property is required for class PaymentCancelResponse.", nameof(pspReference)); - - if (!status.IsSet) - throw new ArgumentException("Property is required for class PaymentCancelResponse.", nameof(status)); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentCancelResponse."); - - if (paymentPspReference.IsSet && paymentPspReference.Value == null) - throw new ArgumentNullException(nameof(paymentPspReference), "Property is not nullable for class PaymentCancelResponse."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentCancelResponse."); - - if (status.IsSet && status.Value == null) - throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaymentCancelResponse."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentCancelResponse."); - - return new PaymentCancelResponse(merchantAccount.Value, paymentPspReference.Value, pspReference.Value, status.Value.Value, reference); + return + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.PaymentPspReference == input.PaymentPspReference || + (this.PaymentPspReference != null && + this.PaymentPspReference.Equals(input.PaymentPspReference)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentCancelResponse paymentCancelResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, paymentCancelResponse, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.PaymentPspReference != null) + { + hashCode = (hashCode * 59) + this.PaymentPspReference.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentCancelResponse paymentCancelResponse, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (paymentCancelResponse.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentCancelResponse.MerchantAccount), "Property is required for class PaymentCancelResponse."); - - if (paymentCancelResponse.PaymentPspReference == null) - throw new ArgumentNullException(nameof(paymentCancelResponse.PaymentPspReference), "Property is required for class PaymentCancelResponse."); - - if (paymentCancelResponse.PspReference == null) - throw new ArgumentNullException(nameof(paymentCancelResponse.PspReference), "Property is required for class PaymentCancelResponse."); - - if (paymentCancelResponse.ReferenceOption.IsSet && paymentCancelResponse.Reference == null) - throw new ArgumentNullException(nameof(paymentCancelResponse.Reference), "Property is required for class PaymentCancelResponse."); - - writer.WriteString("merchantAccount", paymentCancelResponse.MerchantAccount); - - writer.WriteString("paymentPspReference", paymentCancelResponse.PaymentPspReference); - - writer.WriteString("pspReference", paymentCancelResponse.PspReference); - - var statusRawValue = PaymentCancelResponse.StatusEnumToJsonValue(paymentCancelResponse.Status); - writer.WriteString("status", statusRawValue); - if (paymentCancelResponse.ReferenceOption.IsSet) - writer.WriteString("reference", paymentCancelResponse.Reference); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentCaptureRequest.cs b/Adyen/Model/Checkout/PaymentCaptureRequest.cs index e78f6def0..7b9a3c0b7 100644 --- a/Adyen/Model/Checkout/PaymentCaptureRequest.cs +++ b/Adyen/Model/Checkout/PaymentCaptureRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,156 +15,111 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentCaptureRequest /// - public partial class PaymentCaptureRequest : IValidatableObject + [DataContract(Name = "PaymentCaptureRequest")] + public partial class PaymentCaptureRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// amount - /// The merchant account that is used to process the payment. - /// applicationInfo - /// enhancedSchemeData - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - /// platformChargebackLogic - /// Your reference for the capture request. Maximum length: 80 characters. - /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). - /// A List of sub-merchants. - [JsonConstructor] - public PaymentCaptureRequest(Amount amount, string merchantAccount, Option applicationInfo = default, Option enhancedSchemeData = default, Option> lineItems = default, Option platformChargebackLogic = default, Option reference = default, Option> splits = default, Option> subMerchants = default) + [JsonConstructorAttribute] + protected PaymentCaptureRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// amount (required). + /// applicationInfo. + /// enhancedSchemeData. + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.. + /// The merchant account that is used to process the payment. (required). + /// platformChargebackLogic. + /// Your reference for the capture request. Maximum length: 80 characters.. + /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/).. + /// A List of sub-merchants.. + public PaymentCaptureRequest(Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), EnhancedSchemeData enhancedSchemeData = default(EnhancedSchemeData), List lineItems = default(List), string merchantAccount = default(string), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), string reference = default(string), List splits = default(List), List subMerchants = default(List)) { - Amount = amount; - MerchantAccount = merchantAccount; - ApplicationInfoOption = applicationInfo; - EnhancedSchemeDataOption = enhancedSchemeData; - LineItemsOption = lineItems; - PlatformChargebackLogicOption = platformChargebackLogic; - ReferenceOption = reference; - SplitsOption = splits; - SubMerchantsOption = subMerchants; - OnCreated(); + this.Amount = amount; + this.MerchantAccount = merchantAccount; + this.ApplicationInfo = applicationInfo; + this.EnhancedSchemeData = enhancedSchemeData; + this.LineItems = lineItems; + this.PlatformChargebackLogic = platformChargebackLogic; + this.Reference = reference; + this.Splits = splits; + this.SubMerchants = subMerchants; } - partial void OnCreated(); - /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] public Amount Amount { get; set; } - /// - /// The merchant account that is used to process the payment. - /// - /// The merchant account that is used to process the payment. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } - - /// - /// Used to track the state of ApplicationInfo - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ApplicationInfoOption { get; private set; } - /// /// Gets or Sets ApplicationInfo /// - [JsonPropertyName("applicationInfo")] - public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataOption { get; private set; } + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } /// /// Gets or Sets EnhancedSchemeData /// - [JsonPropertyName("enhancedSchemeData")] - public EnhancedSchemeData EnhancedSchemeData { get { return this.EnhancedSchemeDataOption; } set { this.EnhancedSchemeDataOption = new Option(value); } } - - /// - /// Used to track the state of LineItems - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LineItemsOption { get; private set; } + [DataMember(Name = "enhancedSchemeData", EmitDefaultValue = false)] + public EnhancedSchemeData EnhancedSchemeData { get; set; } /// /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. /// /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - [JsonPropertyName("lineItems")] - public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } /// - /// Used to track the state of PlatformChargebackLogic + /// The merchant account that is used to process the payment. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PlatformChargebackLogicOption { get; private set; } + /// The merchant account that is used to process the payment. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// Gets or Sets PlatformChargebackLogic /// - [JsonPropertyName("platformChargebackLogic")] - public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } - - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] + public PlatformChargebackLogic PlatformChargebackLogic { get; set; } /// /// Your reference for the capture request. Maximum length: 80 characters. /// /// Your reference for the capture request. Maximum length: 80 characters. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Splits - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SplitsOption { get; private set; } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). - [JsonPropertyName("splits")] - public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } - - /// - /// Used to track the state of SubMerchants - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SubMerchantsOption { get; private set; } + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// A List of sub-merchants. /// /// A List of sub-merchants. - [JsonPropertyName("subMerchants")] - public List SubMerchants { get { return this.SubMerchantsOption; } set { this.SubMerchantsOption = new Option>(value); } } + [DataMember(Name = "subMerchants", EmitDefaultValue = false)] + public List SubMerchants { get; set; } /// /// Returns the string presentation of the object @@ -174,10 +130,10 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PaymentCaptureRequest {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" EnhancedSchemeData: ").Append(EnhancedSchemeData).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PlatformChargebackLogic: ").Append(PlatformChargebackLogic).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); @@ -187,227 +143,143 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentCaptureRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentCaptureRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option merchantAccount = default; - Option applicationInfo = default; - Option enhancedSchemeData = default; - Option> lineItems = default; - Option platformChargebackLogic = default; - Option reference = default; - Option> splits = default; - Option> subMerchants = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "applicationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "enhancedSchemeData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enhancedSchemeData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "lineItems": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "platformChargebackLogic": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "splits": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "subMerchants": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - subMerchants = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class PaymentCaptureRequest.", nameof(amount)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentCaptureRequest.", nameof(merchantAccount)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentCaptureRequest."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentCaptureRequest."); - - if (applicationInfo.IsSet && applicationInfo.Value == null) - throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentCaptureRequest."); - - if (enhancedSchemeData.IsSet && enhancedSchemeData.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeData), "Property is not nullable for class PaymentCaptureRequest."); - - if (lineItems.IsSet && lineItems.Value == null) - throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentCaptureRequest."); - - if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) - throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class PaymentCaptureRequest."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentCaptureRequest."); - - if (splits.IsSet && splits.Value == null) - throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentCaptureRequest."); - - if (subMerchants.IsSet && subMerchants.Value == null) - throw new ArgumentNullException(nameof(subMerchants), "Property is not nullable for class PaymentCaptureRequest."); - - return new PaymentCaptureRequest(amount.Value, merchantAccount.Value, applicationInfo, enhancedSchemeData, lineItems, platformChargebackLogic, reference, splits, subMerchants); + return this.Equals(input as PaymentCaptureRequest); } /// - /// Serializes a + /// Returns true if PaymentCaptureRequest instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentCaptureRequest paymentCaptureRequest, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentCaptureRequest to be compared + /// Boolean + public bool Equals(PaymentCaptureRequest input) { - writer.WriteStartObject(); - - WriteProperties(writer, paymentCaptureRequest, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.ApplicationInfo == input.ApplicationInfo || + (this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo)) + ) && + ( + this.EnhancedSchemeData == input.EnhancedSchemeData || + (this.EnhancedSchemeData != null && + this.EnhancedSchemeData.Equals(input.EnhancedSchemeData)) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.PlatformChargebackLogic == input.PlatformChargebackLogic || + (this.PlatformChargebackLogic != null && + this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.SubMerchants == input.SubMerchants || + this.SubMerchants != null && + input.SubMerchants != null && + this.SubMerchants.SequenceEqual(input.SubMerchants) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentCaptureRequest paymentCaptureRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paymentCaptureRequest.Amount == null) - throw new ArgumentNullException(nameof(paymentCaptureRequest.Amount), "Property is required for class PaymentCaptureRequest."); - - if (paymentCaptureRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentCaptureRequest.MerchantAccount), "Property is required for class PaymentCaptureRequest."); - - if (paymentCaptureRequest.ApplicationInfoOption.IsSet && paymentCaptureRequest.ApplicationInfo == null) - throw new ArgumentNullException(nameof(paymentCaptureRequest.ApplicationInfo), "Property is required for class PaymentCaptureRequest."); - - if (paymentCaptureRequest.EnhancedSchemeDataOption.IsSet && paymentCaptureRequest.EnhancedSchemeData == null) - throw new ArgumentNullException(nameof(paymentCaptureRequest.EnhancedSchemeData), "Property is required for class PaymentCaptureRequest."); - - if (paymentCaptureRequest.LineItemsOption.IsSet && paymentCaptureRequest.LineItems == null) - throw new ArgumentNullException(nameof(paymentCaptureRequest.LineItems), "Property is required for class PaymentCaptureRequest."); - - if (paymentCaptureRequest.PlatformChargebackLogicOption.IsSet && paymentCaptureRequest.PlatformChargebackLogic == null) - throw new ArgumentNullException(nameof(paymentCaptureRequest.PlatformChargebackLogic), "Property is required for class PaymentCaptureRequest."); - - if (paymentCaptureRequest.ReferenceOption.IsSet && paymentCaptureRequest.Reference == null) - throw new ArgumentNullException(nameof(paymentCaptureRequest.Reference), "Property is required for class PaymentCaptureRequest."); - - if (paymentCaptureRequest.SplitsOption.IsSet && paymentCaptureRequest.Splits == null) - throw new ArgumentNullException(nameof(paymentCaptureRequest.Splits), "Property is required for class PaymentCaptureRequest."); - - if (paymentCaptureRequest.SubMerchantsOption.IsSet && paymentCaptureRequest.SubMerchants == null) - throw new ArgumentNullException(nameof(paymentCaptureRequest.SubMerchants), "Property is required for class PaymentCaptureRequest."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, paymentCaptureRequest.Amount, jsonSerializerOptions); - writer.WriteString("merchantAccount", paymentCaptureRequest.MerchantAccount); - - if (paymentCaptureRequest.ApplicationInfoOption.IsSet) - { - writer.WritePropertyName("applicationInfo"); - JsonSerializer.Serialize(writer, paymentCaptureRequest.ApplicationInfo, jsonSerializerOptions); - } - if (paymentCaptureRequest.EnhancedSchemeDataOption.IsSet) - { - writer.WritePropertyName("enhancedSchemeData"); - JsonSerializer.Serialize(writer, paymentCaptureRequest.EnhancedSchemeData, jsonSerializerOptions); - } - if (paymentCaptureRequest.LineItemsOption.IsSet) - { - writer.WritePropertyName("lineItems"); - JsonSerializer.Serialize(writer, paymentCaptureRequest.LineItems, jsonSerializerOptions); - } - if (paymentCaptureRequest.PlatformChargebackLogicOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("platformChargebackLogic"); - JsonSerializer.Serialize(writer, paymentCaptureRequest.PlatformChargebackLogic, jsonSerializerOptions); - } - if (paymentCaptureRequest.ReferenceOption.IsSet) - writer.WriteString("reference", paymentCaptureRequest.Reference); - - if (paymentCaptureRequest.SplitsOption.IsSet) - { - writer.WritePropertyName("splits"); - JsonSerializer.Serialize(writer, paymentCaptureRequest.Splits, jsonSerializerOptions); - } - if (paymentCaptureRequest.SubMerchantsOption.IsSet) - { - writer.WritePropertyName("subMerchants"); - JsonSerializer.Serialize(writer, paymentCaptureRequest.SubMerchants, jsonSerializerOptions); + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.ApplicationInfo != null) + { + hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); + } + if (this.EnhancedSchemeData != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeData.GetHashCode(); + } + if (this.LineItems != null) + { + hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.PlatformChargebackLogic != null) + { + hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.Splits != null) + { + hashCode = (hashCode * 59) + this.Splits.GetHashCode(); + } + if (this.SubMerchants != null) + { + hashCode = (hashCode * 59) + this.SubMerchants.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/PaymentCaptureResponse.cs b/Adyen/Model/Checkout/PaymentCaptureResponse.cs index 191f120de..9f8c1ab45 100644 --- a/Adyen/Model/Checkout/PaymentCaptureResponse.cs +++ b/Adyen/Model/Checkout/PaymentCaptureResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,206 +15,137 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentCaptureResponse /// - public partial class PaymentCaptureResponse : IValidatableObject + [DataContract(Name = "PaymentCaptureResponse")] + public partial class PaymentCaptureResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The merchant account that is used to process the payment. - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. - /// Adyen's 16-character reference associated with the capture request. - /// The status of your request. This will always have the value **received**. - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - /// platformChargebackLogic - /// Your reference for the capture request. - /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). - /// List of sub-merchants. - [JsonConstructor] - public PaymentCaptureResponse(Amount amount, string merchantAccount, string paymentPspReference, string pspReference, StatusEnum status, Option> lineItems = default, Option platformChargebackLogic = default, Option reference = default, Option> splits = default, Option> subMerchants = default) - { - Amount = amount; - MerchantAccount = merchantAccount; - PaymentPspReference = paymentPspReference; - PspReference = pspReference; - Status = status; - LineItemsOption = lineItems; - PlatformChargebackLogicOption = platformChargebackLogic; - ReferenceOption = reference; - SplitsOption = splits; - SubMerchantsOption = subMerchants; - OnCreated(); - } - - partial void OnCreated(); - /// /// The status of your request. This will always have the value **received**. /// /// The status of your request. This will always have the value **received**. + [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Received for value: received /// + [EnumMember(Value = "received")] Received = 1 + } + /// - /// Returns a + /// The status of your request. This will always have the value **received**. /// - /// - /// - /// - public static StatusEnum StatusEnumFromString(string value) - { - if (value.Equals("received")) - return StatusEnum.Received; - - throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); - } - + /// The status of your request. This will always have the value **received**. + [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] + public StatusEnum Status { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static StatusEnum? StatusEnumFromStringOrDefault(string value) - { - if (value.Equals("received")) - return StatusEnum.Received; - - return null; - } - + [JsonConstructorAttribute] + protected PaymentCaptureResponse() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string StatusEnumToJsonValue(StatusEnum value) + /// amount (required). + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.. + /// The merchant account that is used to process the payment. (required). + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. (required). + /// platformChargebackLogic. + /// Adyen's 16-character reference associated with the capture request. (required). + /// Your reference for the capture request.. + /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/).. + /// The status of your request. This will always have the value **received**. (required). + /// List of sub-merchants.. + public PaymentCaptureResponse(Amount amount = default(Amount), List lineItems = default(List), string merchantAccount = default(string), string paymentPspReference = default(string), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), string pspReference = default(string), string reference = default(string), List splits = default(List), StatusEnum status = default(StatusEnum), List subMerchants = default(List)) { - if (value == StatusEnum.Received) - return "received"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.Amount = amount; + this.MerchantAccount = merchantAccount; + this.PaymentPspReference = paymentPspReference; + this.PspReference = pspReference; + this.Status = status; + this.LineItems = lineItems; + this.PlatformChargebackLogic = platformChargebackLogic; + this.Reference = reference; + this.Splits = splits; + this.SubMerchants = subMerchants; } /// - /// The status of your request. This will always have the value **received**. + /// Gets or Sets Amount /// - /// The status of your request. This will always have the value **received**. - [JsonPropertyName("status")] - public StatusEnum Status { get; set; } + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + public Amount Amount { get; set; } /// - /// Gets or Sets Amount + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. /// - [JsonPropertyName("amount")] - public Amount Amount { get; set; } + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [JsonPropertyName("merchantAccount")] + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] public string MerchantAccount { get; set; } /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to capture. - [JsonPropertyName("paymentPspReference")] + [DataMember(Name = "paymentPspReference", IsRequired = false, EmitDefaultValue = false)] public string PaymentPspReference { get; set; } - /// - /// Adyen's 16-character reference associated with the capture request. - /// - /// Adyen's 16-character reference associated with the capture request. - [JsonPropertyName("pspReference")] - public string PspReference { get; set; } - - /// - /// Used to track the state of LineItems - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LineItemsOption { get; private set; } - - /// - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - /// - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - [JsonPropertyName("lineItems")] - public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } - - /// - /// Used to track the state of PlatformChargebackLogic - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PlatformChargebackLogicOption { get; private set; } - /// /// Gets or Sets PlatformChargebackLogic /// - [JsonPropertyName("platformChargebackLogic")] - public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } + [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] + public PlatformChargebackLogic PlatformChargebackLogic { get; set; } /// - /// Used to track the state of Reference + /// Adyen's 16-character reference associated with the capture request. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + /// Adyen's 16-character reference associated with the capture request. + [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] + public string PspReference { get; set; } /// /// Your reference for the capture request. /// /// Your reference for the capture request. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Splits - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SplitsOption { get; private set; } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). - [JsonPropertyName("splits")] - public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } - - /// - /// Used to track the state of SubMerchants - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SubMerchantsOption { get; private set; } + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// List of sub-merchants. /// /// List of sub-merchants. - [JsonPropertyName("subMerchants")] - public List SubMerchants { get { return this.SubMerchantsOption; } set { this.SubMerchantsOption = new Option>(value); } } + [DataMember(Name = "subMerchants", EmitDefaultValue = false)] + public List SubMerchants { get; set; } /// /// Returns the string presentation of the object @@ -224,253 +156,162 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PaymentCaptureResponse {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentPspReference: ").Append(PaymentPspReference).Append("\n"); - sb.Append(" PspReference: ").Append(PspReference).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" PlatformChargebackLogic: ").Append(PlatformChargebackLogic).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" SubMerchants: ").Append(SubMerchants).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentCaptureResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentCaptureResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option merchantAccount = default; - Option paymentPspReference = default; - Option pspReference = default; - Option status = default; - Option> lineItems = default; - Option platformChargebackLogic = default; - Option reference = default; - Option> splits = default; - Option> subMerchants = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "paymentPspReference": - paymentPspReference = new Option(utf8JsonReader.GetString()); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "status": - string statusRawValue = utf8JsonReader.GetString(); - if (statusRawValue != null) - status = new Option(PaymentCaptureResponse.StatusEnumFromStringOrDefault(statusRawValue)); - break; - case "lineItems": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "platformChargebackLogic": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "splits": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "subMerchants": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - subMerchants = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class PaymentCaptureResponse.", nameof(amount)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentCaptureResponse.", nameof(merchantAccount)); - - if (!paymentPspReference.IsSet) - throw new ArgumentException("Property is required for class PaymentCaptureResponse.", nameof(paymentPspReference)); - - if (!pspReference.IsSet) - throw new ArgumentException("Property is required for class PaymentCaptureResponse.", nameof(pspReference)); - - if (!status.IsSet) - throw new ArgumentException("Property is required for class PaymentCaptureResponse.", nameof(status)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentCaptureResponse."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentCaptureResponse."); - - if (paymentPspReference.IsSet && paymentPspReference.Value == null) - throw new ArgumentNullException(nameof(paymentPspReference), "Property is not nullable for class PaymentCaptureResponse."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentCaptureResponse."); - - if (status.IsSet && status.Value == null) - throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaymentCaptureResponse."); - - if (lineItems.IsSet && lineItems.Value == null) - throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentCaptureResponse."); - - if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) - throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class PaymentCaptureResponse."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentCaptureResponse."); - - if (splits.IsSet && splits.Value == null) - throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentCaptureResponse."); - - if (subMerchants.IsSet && subMerchants.Value == null) - throw new ArgumentNullException(nameof(subMerchants), "Property is not nullable for class PaymentCaptureResponse."); - - return new PaymentCaptureResponse(amount.Value, merchantAccount.Value, paymentPspReference.Value, pspReference.Value, status.Value.Value, lineItems, platformChargebackLogic, reference, splits, subMerchants); + return this.Equals(input as PaymentCaptureResponse); } /// - /// Serializes a + /// Returns true if PaymentCaptureResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentCaptureResponse paymentCaptureResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentCaptureResponse to be compared + /// Boolean + public bool Equals(PaymentCaptureResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, paymentCaptureResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.PaymentPspReference == input.PaymentPspReference || + (this.PaymentPspReference != null && + this.PaymentPspReference.Equals(input.PaymentPspReference)) + ) && + ( + this.PlatformChargebackLogic == input.PlatformChargebackLogic || + (this.PlatformChargebackLogic != null && + this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ) && + ( + this.SubMerchants == input.SubMerchants || + this.SubMerchants != null && + input.SubMerchants != null && + this.SubMerchants.SequenceEqual(input.SubMerchants) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentCaptureResponse paymentCaptureResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paymentCaptureResponse.Amount == null) - throw new ArgumentNullException(nameof(paymentCaptureResponse.Amount), "Property is required for class PaymentCaptureResponse."); - - if (paymentCaptureResponse.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentCaptureResponse.MerchantAccount), "Property is required for class PaymentCaptureResponse."); - - if (paymentCaptureResponse.PaymentPspReference == null) - throw new ArgumentNullException(nameof(paymentCaptureResponse.PaymentPspReference), "Property is required for class PaymentCaptureResponse."); - - if (paymentCaptureResponse.PspReference == null) - throw new ArgumentNullException(nameof(paymentCaptureResponse.PspReference), "Property is required for class PaymentCaptureResponse."); - - if (paymentCaptureResponse.LineItemsOption.IsSet && paymentCaptureResponse.LineItems == null) - throw new ArgumentNullException(nameof(paymentCaptureResponse.LineItems), "Property is required for class PaymentCaptureResponse."); - - if (paymentCaptureResponse.PlatformChargebackLogicOption.IsSet && paymentCaptureResponse.PlatformChargebackLogic == null) - throw new ArgumentNullException(nameof(paymentCaptureResponse.PlatformChargebackLogic), "Property is required for class PaymentCaptureResponse."); - - if (paymentCaptureResponse.ReferenceOption.IsSet && paymentCaptureResponse.Reference == null) - throw new ArgumentNullException(nameof(paymentCaptureResponse.Reference), "Property is required for class PaymentCaptureResponse."); - - if (paymentCaptureResponse.SplitsOption.IsSet && paymentCaptureResponse.Splits == null) - throw new ArgumentNullException(nameof(paymentCaptureResponse.Splits), "Property is required for class PaymentCaptureResponse."); - - if (paymentCaptureResponse.SubMerchantsOption.IsSet && paymentCaptureResponse.SubMerchants == null) - throw new ArgumentNullException(nameof(paymentCaptureResponse.SubMerchants), "Property is required for class PaymentCaptureResponse."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, paymentCaptureResponse.Amount, jsonSerializerOptions); - writer.WriteString("merchantAccount", paymentCaptureResponse.MerchantAccount); - - writer.WriteString("paymentPspReference", paymentCaptureResponse.PaymentPspReference); - - writer.WriteString("pspReference", paymentCaptureResponse.PspReference); - - var statusRawValue = PaymentCaptureResponse.StatusEnumToJsonValue(paymentCaptureResponse.Status); - writer.WriteString("status", statusRawValue); - if (paymentCaptureResponse.LineItemsOption.IsSet) - { - writer.WritePropertyName("lineItems"); - JsonSerializer.Serialize(writer, paymentCaptureResponse.LineItems, jsonSerializerOptions); - } - if (paymentCaptureResponse.PlatformChargebackLogicOption.IsSet) - { - writer.WritePropertyName("platformChargebackLogic"); - JsonSerializer.Serialize(writer, paymentCaptureResponse.PlatformChargebackLogic, jsonSerializerOptions); - } - if (paymentCaptureResponse.ReferenceOption.IsSet) - writer.WriteString("reference", paymentCaptureResponse.Reference); - - if (paymentCaptureResponse.SplitsOption.IsSet) - { - writer.WritePropertyName("splits"); - JsonSerializer.Serialize(writer, paymentCaptureResponse.Splits, jsonSerializerOptions); - } - if (paymentCaptureResponse.SubMerchantsOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("subMerchants"); - JsonSerializer.Serialize(writer, paymentCaptureResponse.SubMerchants, jsonSerializerOptions); + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.LineItems != null) + { + hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.PaymentPspReference != null) + { + hashCode = (hashCode * 59) + this.PaymentPspReference.GetHashCode(); + } + if (this.PlatformChargebackLogic != null) + { + hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.Splits != null) + { + hashCode = (hashCode * 59) + this.Splits.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + if (this.SubMerchants != null) + { + hashCode = (hashCode * 59) + this.SubMerchants.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/PaymentCompletionDetails.cs b/Adyen/Model/Checkout/PaymentCompletionDetails.cs index ca2c94a4e..499717c02 100644 --- a/Adyen/Model/Checkout/PaymentCompletionDetails.cs +++ b/Adyen/Model/Checkout/PaymentCompletionDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,349 +15,208 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentCompletionDetails /// - public partial class PaymentCompletionDetails : IValidatableObject + [DataContract(Name = "PaymentCompletionDetails")] + public partial class PaymentCompletionDetails : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// A payment session identifier returned by the card issuer. - /// (3D) Payment Authentication Request data for the card issuer. - /// (3D) Payment Authentication Response data by the card issuer. - /// authorizationToken - /// PayPal-generated token for recurring payments. - /// The SMS verification code collected from the shopper. - /// PayPal-generated third party access token. - /// A random number sent to the mobile phone number of the shopper to verify the payment. - /// PayPal-assigned ID for the order. - /// PayPal-assigned ID for the payer (shopper). - /// Payload appended to the `returnURL` as a result of the redirect. - /// PayPal-generated ID for the payment. - /// Value passed from the WeChat MiniProgram `wx.requestPayment` **complete** callback. Possible values: any value starting with `requestPayment:`. - /// The result of the redirect as appended to the `returnURL`. - /// Value you received from the WeChat Pay SDK. - /// The query string as appended to the `returnURL` when using direct issuer links . - /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameters: `transStatus`, `authorisationToken`. - /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `transStatus`. - /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `threeDSCompInd`. - /// PayPalv2-generated token for recurring payments. - [JsonConstructor] - public PaymentCompletionDetails(Option mD = default, Option paReq = default, Option paRes = default, Option authorizationToken = default, Option billingToken = default, Option cupsecureplusSmscode = default, Option facilitatorAccessToken = default, Option oneTimePasscode = default, Option orderID = default, Option payerID = default, Option payload = default, Option paymentID = default, Option paymentStatus = default, Option redirectResult = default, Option resultCode = default, Option returnUrlQueryString = default, Option threeDSResult = default, Option threeds2ChallengeResult = default, Option threeds2Fingerprint = default, Option vaultToken = default) + /// A payment session identifier returned by the card issuer.. + /// (3D) Payment Authentication Request data for the card issuer.. + /// (3D) Payment Authentication Response data by the card issuer.. + /// authorizationToken. + /// PayPal-generated token for recurring payments.. + /// The SMS verification code collected from the shopper.. + /// PayPal-generated third party access token.. + /// A random number sent to the mobile phone number of the shopper to verify the payment.. + /// PayPal-assigned ID for the order.. + /// PayPal-assigned ID for the payer (shopper).. + /// Payload appended to the `returnURL` as a result of the redirect.. + /// PayPal-generated ID for the payment.. + /// Value passed from the WeChat MiniProgram `wx.requestPayment` **complete** callback. Possible values: any value starting with `requestPayment:`.. + /// The result of the redirect as appended to the `returnURL`.. + /// Value you received from the WeChat Pay SDK.. + /// The query string as appended to the `returnURL` when using direct issuer links .. + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameters: `transStatus`, `authorisationToken`.. + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `transStatus`.. + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `threeDSCompInd`.. + /// PayPalv2-generated token for recurring payments.. + public PaymentCompletionDetails(string mD = default(string), string paReq = default(string), string paRes = default(string), string authorizationToken = default(string), string billingToken = default(string), string cupsecureplusSmscode = default(string), string facilitatorAccessToken = default(string), string oneTimePasscode = default(string), string orderID = default(string), string payerID = default(string), string payload = default(string), string paymentID = default(string), string paymentStatus = default(string), string redirectResult = default(string), string resultCode = default(string), string returnUrlQueryString = default(string), string threeDSResult = default(string), string threeds2ChallengeResult = default(string), string threeds2Fingerprint = default(string), string vaultToken = default(string)) { - MDOption = mD; - PaReqOption = paReq; - PaResOption = paRes; - AuthorizationTokenOption = authorizationToken; - BillingTokenOption = billingToken; - CupsecureplusSmscodeOption = cupsecureplusSmscode; - FacilitatorAccessTokenOption = facilitatorAccessToken; - OneTimePasscodeOption = oneTimePasscode; - OrderIDOption = orderID; - PayerIDOption = payerID; - PayloadOption = payload; - PaymentIDOption = paymentID; - PaymentStatusOption = paymentStatus; - RedirectResultOption = redirectResult; - ResultCodeOption = resultCode; - ReturnUrlQueryStringOption = returnUrlQueryString; - ThreeDSResultOption = threeDSResult; - Threeds2ChallengeResultOption = threeds2ChallengeResult; - Threeds2FingerprintOption = threeds2Fingerprint; - VaultTokenOption = vaultToken; - OnCreated(); + this.MD = mD; + this.PaReq = paReq; + this.PaRes = paRes; + this.AuthorizationToken = authorizationToken; + this.BillingToken = billingToken; + this.CupsecureplusSmscode = cupsecureplusSmscode; + this.FacilitatorAccessToken = facilitatorAccessToken; + this.OneTimePasscode = oneTimePasscode; + this.OrderID = orderID; + this.PayerID = payerID; + this.Payload = payload; + this.PaymentID = paymentID; + this.PaymentStatus = paymentStatus; + this.RedirectResult = redirectResult; + this.ResultCode = resultCode; + this.ReturnUrlQueryString = returnUrlQueryString; + this.ThreeDSResult = threeDSResult; + this.Threeds2ChallengeResult = threeds2ChallengeResult; + this.Threeds2Fingerprint = threeds2Fingerprint; + this.VaultToken = vaultToken; } - partial void OnCreated(); - - /// - /// Used to track the state of MD - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MDOption { get; private set; } - /// /// A payment session identifier returned by the card issuer. /// /// A payment session identifier returned by the card issuer. - [JsonPropertyName("MD")] - public string MD { get { return this.MDOption; } set { this.MDOption = new Option(value); } } - - /// - /// Used to track the state of PaReq - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaReqOption { get; private set; } + [DataMember(Name = "MD", EmitDefaultValue = false)] + public string MD { get; set; } /// /// (3D) Payment Authentication Request data for the card issuer. /// /// (3D) Payment Authentication Request data for the card issuer. - [JsonPropertyName("PaReq")] - public string PaReq { get { return this.PaReqOption; } set { this.PaReqOption = new Option(value); } } - - /// - /// Used to track the state of PaRes - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaResOption { get; private set; } + [DataMember(Name = "PaReq", EmitDefaultValue = false)] + public string PaReq { get; set; } /// /// (3D) Payment Authentication Response data by the card issuer. /// /// (3D) Payment Authentication Response data by the card issuer. - [JsonPropertyName("PaRes")] - public string PaRes { get { return this.PaResOption; } set { this.PaResOption = new Option(value); } } - - /// - /// Used to track the state of AuthorizationToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthorizationTokenOption { get; private set; } + [DataMember(Name = "PaRes", EmitDefaultValue = false)] + public string PaRes { get; set; } /// /// Gets or Sets AuthorizationToken /// - [JsonPropertyName("authorization_token")] - public string AuthorizationToken { get { return this.AuthorizationTokenOption; } set { this.AuthorizationTokenOption = new Option(value); } } - - /// - /// Used to track the state of BillingToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingTokenOption { get; private set; } + [DataMember(Name = "authorization_token", EmitDefaultValue = false)] + public string AuthorizationToken { get; set; } /// /// PayPal-generated token for recurring payments. /// /// PayPal-generated token for recurring payments. - [JsonPropertyName("billingToken")] - public string BillingToken { get { return this.BillingTokenOption; } set { this.BillingTokenOption = new Option(value); } } - - /// - /// Used to track the state of CupsecureplusSmscode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CupsecureplusSmscodeOption { get; private set; } + [DataMember(Name = "billingToken", EmitDefaultValue = false)] + public string BillingToken { get; set; } /// /// The SMS verification code collected from the shopper. /// /// The SMS verification code collected from the shopper. - [JsonPropertyName("cupsecureplus.smscode")] - public string CupsecureplusSmscode { get { return this.CupsecureplusSmscodeOption; } set { this.CupsecureplusSmscodeOption = new Option(value); } } - - /// - /// Used to track the state of FacilitatorAccessToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FacilitatorAccessTokenOption { get; private set; } + [DataMember(Name = "cupsecureplus.smscode", EmitDefaultValue = false)] + public string CupsecureplusSmscode { get; set; } /// /// PayPal-generated third party access token. /// /// PayPal-generated third party access token. - [JsonPropertyName("facilitatorAccessToken")] - public string FacilitatorAccessToken { get { return this.FacilitatorAccessTokenOption; } set { this.FacilitatorAccessTokenOption = new Option(value); } } - - /// - /// Used to track the state of OneTimePasscode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OneTimePasscodeOption { get; private set; } + [DataMember(Name = "facilitatorAccessToken", EmitDefaultValue = false)] + public string FacilitatorAccessToken { get; set; } /// /// A random number sent to the mobile phone number of the shopper to verify the payment. /// /// A random number sent to the mobile phone number of the shopper to verify the payment. - [JsonPropertyName("oneTimePasscode")] - public string OneTimePasscode { get { return this.OneTimePasscodeOption; } set { this.OneTimePasscodeOption = new Option(value); } } - - /// - /// Used to track the state of OrderID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OrderIDOption { get; private set; } + [DataMember(Name = "oneTimePasscode", EmitDefaultValue = false)] + public string OneTimePasscode { get; set; } /// /// PayPal-assigned ID for the order. /// /// PayPal-assigned ID for the order. - [JsonPropertyName("orderID")] - public string OrderID { get { return this.OrderIDOption; } set { this.OrderIDOption = new Option(value); } } - - /// - /// Used to track the state of PayerID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayerIDOption { get; private set; } + [DataMember(Name = "orderID", EmitDefaultValue = false)] + public string OrderID { get; set; } /// /// PayPal-assigned ID for the payer (shopper). /// /// PayPal-assigned ID for the payer (shopper). - [JsonPropertyName("payerID")] - public string PayerID { get { return this.PayerIDOption; } set { this.PayerIDOption = new Option(value); } } - - /// - /// Used to track the state of Payload - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayloadOption { get; private set; } + [DataMember(Name = "payerID", EmitDefaultValue = false)] + public string PayerID { get; set; } /// /// Payload appended to the `returnURL` as a result of the redirect. /// /// Payload appended to the `returnURL` as a result of the redirect. - [JsonPropertyName("payload")] - public string Payload { get { return this.PayloadOption; } set { this.PayloadOption = new Option(value); } } - - /// - /// Used to track the state of PaymentID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentIDOption { get; private set; } + [DataMember(Name = "payload", EmitDefaultValue = false)] + public string Payload { get; set; } /// /// PayPal-generated ID for the payment. /// /// PayPal-generated ID for the payment. - [JsonPropertyName("paymentID")] - public string PaymentID { get { return this.PaymentIDOption; } set { this.PaymentIDOption = new Option(value); } } - - /// - /// Used to track the state of PaymentStatus - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentStatusOption { get; private set; } + [DataMember(Name = "paymentID", EmitDefaultValue = false)] + public string PaymentID { get; set; } /// /// Value passed from the WeChat MiniProgram `wx.requestPayment` **complete** callback. Possible values: any value starting with `requestPayment:`. /// /// Value passed from the WeChat MiniProgram `wx.requestPayment` **complete** callback. Possible values: any value starting with `requestPayment:`. - [JsonPropertyName("paymentStatus")] - public string PaymentStatus { get { return this.PaymentStatusOption; } set { this.PaymentStatusOption = new Option(value); } } - - /// - /// Used to track the state of RedirectResult - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RedirectResultOption { get; private set; } + [DataMember(Name = "paymentStatus", EmitDefaultValue = false)] + public string PaymentStatus { get; set; } /// /// The result of the redirect as appended to the `returnURL`. /// /// The result of the redirect as appended to the `returnURL`. - [JsonPropertyName("redirectResult")] - public string RedirectResult { get { return this.RedirectResultOption; } set { this.RedirectResultOption = new Option(value); } } - - /// - /// Used to track the state of ResultCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ResultCodeOption { get; private set; } + [DataMember(Name = "redirectResult", EmitDefaultValue = false)] + public string RedirectResult { get; set; } /// /// Value you received from the WeChat Pay SDK. /// /// Value you received from the WeChat Pay SDK. - [JsonPropertyName("resultCode")] - public string ResultCode { get { return this.ResultCodeOption; } set { this.ResultCodeOption = new Option(value); } } - - /// - /// Used to track the state of ReturnUrlQueryString - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReturnUrlQueryStringOption { get; private set; } + [DataMember(Name = "resultCode", EmitDefaultValue = false)] + public string ResultCode { get; set; } /// /// The query string as appended to the `returnURL` when using direct issuer links . /// /// The query string as appended to the `returnURL` when using direct issuer links . - [JsonPropertyName("returnUrlQueryString")] - public string ReturnUrlQueryString { get { return this.ReturnUrlQueryStringOption; } set { this.ReturnUrlQueryStringOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSResult - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSResultOption { get; private set; } + [DataMember(Name = "returnUrlQueryString", EmitDefaultValue = false)] + public string ReturnUrlQueryString { get; set; } /// /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameters: `transStatus`, `authorisationToken`. /// /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameters: `transStatus`, `authorisationToken`. - [JsonPropertyName("threeDSResult")] - public string ThreeDSResult { get { return this.ThreeDSResultOption; } set { this.ThreeDSResultOption = new Option(value); } } - - /// - /// Used to track the state of Threeds2ChallengeResult - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option Threeds2ChallengeResultOption { get; private set; } + [DataMember(Name = "threeDSResult", EmitDefaultValue = false)] + public string ThreeDSResult { get; set; } /// /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `transStatus`. /// /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `transStatus`. - [JsonPropertyName("threeds2.challengeResult")] - public string Threeds2ChallengeResult { get { return this.Threeds2ChallengeResultOption; } set { this.Threeds2ChallengeResultOption = new Option(value); } } - - /// - /// Used to track the state of Threeds2Fingerprint - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option Threeds2FingerprintOption { get; private set; } + [DataMember(Name = "threeds2.challengeResult", EmitDefaultValue = false)] + public string Threeds2ChallengeResult { get; set; } /// /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `threeDSCompInd`. /// /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `threeDSCompInd`. - [JsonPropertyName("threeds2.fingerprint")] - public string Threeds2Fingerprint { get { return this.Threeds2FingerprintOption; } set { this.Threeds2FingerprintOption = new Option(value); } } - - /// - /// Used to track the state of VaultToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option VaultTokenOption { get; private set; } + [DataMember(Name = "threeds2.fingerprint", EmitDefaultValue = false)] + public string Threeds2Fingerprint { get; set; } /// /// PayPalv2-generated token for recurring payments. /// /// PayPalv2-generated token for recurring payments. - [JsonPropertyName("vaultToken")] - public string VaultToken { get { return this.VaultTokenOption; } set { this.VaultTokenOption = new Option(value); } } + [DataMember(Name = "vaultToken", EmitDefaultValue = false)] + public string VaultToken { get; set; } /// /// Returns the string presentation of the object @@ -390,401 +250,294 @@ public override string ToString() return sb.ToString(); } + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PaymentCompletionDetails); + } + + /// + /// Returns true if PaymentCompletionDetails instances are equal + /// + /// Instance of PaymentCompletionDetails to be compared + /// Boolean + public bool Equals(PaymentCompletionDetails input) + { + if (input == null) + { + return false; + } + return + ( + this.MD == input.MD || + (this.MD != null && + this.MD.Equals(input.MD)) + ) && + ( + this.PaReq == input.PaReq || + (this.PaReq != null && + this.PaReq.Equals(input.PaReq)) + ) && + ( + this.PaRes == input.PaRes || + (this.PaRes != null && + this.PaRes.Equals(input.PaRes)) + ) && + ( + this.AuthorizationToken == input.AuthorizationToken || + (this.AuthorizationToken != null && + this.AuthorizationToken.Equals(input.AuthorizationToken)) + ) && + ( + this.BillingToken == input.BillingToken || + (this.BillingToken != null && + this.BillingToken.Equals(input.BillingToken)) + ) && + ( + this.CupsecureplusSmscode == input.CupsecureplusSmscode || + (this.CupsecureplusSmscode != null && + this.CupsecureplusSmscode.Equals(input.CupsecureplusSmscode)) + ) && + ( + this.FacilitatorAccessToken == input.FacilitatorAccessToken || + (this.FacilitatorAccessToken != null && + this.FacilitatorAccessToken.Equals(input.FacilitatorAccessToken)) + ) && + ( + this.OneTimePasscode == input.OneTimePasscode || + (this.OneTimePasscode != null && + this.OneTimePasscode.Equals(input.OneTimePasscode)) + ) && + ( + this.OrderID == input.OrderID || + (this.OrderID != null && + this.OrderID.Equals(input.OrderID)) + ) && + ( + this.PayerID == input.PayerID || + (this.PayerID != null && + this.PayerID.Equals(input.PayerID)) + ) && + ( + this.Payload == input.Payload || + (this.Payload != null && + this.Payload.Equals(input.Payload)) + ) && + ( + this.PaymentID == input.PaymentID || + (this.PaymentID != null && + this.PaymentID.Equals(input.PaymentID)) + ) && + ( + this.PaymentStatus == input.PaymentStatus || + (this.PaymentStatus != null && + this.PaymentStatus.Equals(input.PaymentStatus)) + ) && + ( + this.RedirectResult == input.RedirectResult || + (this.RedirectResult != null && + this.RedirectResult.Equals(input.RedirectResult)) + ) && + ( + this.ResultCode == input.ResultCode || + (this.ResultCode != null && + this.ResultCode.Equals(input.ResultCode)) + ) && + ( + this.ReturnUrlQueryString == input.ReturnUrlQueryString || + (this.ReturnUrlQueryString != null && + this.ReturnUrlQueryString.Equals(input.ReturnUrlQueryString)) + ) && + ( + this.ThreeDSResult == input.ThreeDSResult || + (this.ThreeDSResult != null && + this.ThreeDSResult.Equals(input.ThreeDSResult)) + ) && + ( + this.Threeds2ChallengeResult == input.Threeds2ChallengeResult || + (this.Threeds2ChallengeResult != null && + this.Threeds2ChallengeResult.Equals(input.Threeds2ChallengeResult)) + ) && + ( + this.Threeds2Fingerprint == input.Threeds2Fingerprint || + (this.Threeds2Fingerprint != null && + this.Threeds2Fingerprint.Equals(input.Threeds2Fingerprint)) + ) && + ( + this.VaultToken == input.VaultToken || + (this.VaultToken != null && + this.VaultToken.Equals(input.VaultToken)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MD != null) + { + hashCode = (hashCode * 59) + this.MD.GetHashCode(); + } + if (this.PaReq != null) + { + hashCode = (hashCode * 59) + this.PaReq.GetHashCode(); + } + if (this.PaRes != null) + { + hashCode = (hashCode * 59) + this.PaRes.GetHashCode(); + } + if (this.AuthorizationToken != null) + { + hashCode = (hashCode * 59) + this.AuthorizationToken.GetHashCode(); + } + if (this.BillingToken != null) + { + hashCode = (hashCode * 59) + this.BillingToken.GetHashCode(); + } + if (this.CupsecureplusSmscode != null) + { + hashCode = (hashCode * 59) + this.CupsecureplusSmscode.GetHashCode(); + } + if (this.FacilitatorAccessToken != null) + { + hashCode = (hashCode * 59) + this.FacilitatorAccessToken.GetHashCode(); + } + if (this.OneTimePasscode != null) + { + hashCode = (hashCode * 59) + this.OneTimePasscode.GetHashCode(); + } + if (this.OrderID != null) + { + hashCode = (hashCode * 59) + this.OrderID.GetHashCode(); + } + if (this.PayerID != null) + { + hashCode = (hashCode * 59) + this.PayerID.GetHashCode(); + } + if (this.Payload != null) + { + hashCode = (hashCode * 59) + this.Payload.GetHashCode(); + } + if (this.PaymentID != null) + { + hashCode = (hashCode * 59) + this.PaymentID.GetHashCode(); + } + if (this.PaymentStatus != null) + { + hashCode = (hashCode * 59) + this.PaymentStatus.GetHashCode(); + } + if (this.RedirectResult != null) + { + hashCode = (hashCode * 59) + this.RedirectResult.GetHashCode(); + } + if (this.ResultCode != null) + { + hashCode = (hashCode * 59) + this.ResultCode.GetHashCode(); + } + if (this.ReturnUrlQueryString != null) + { + hashCode = (hashCode * 59) + this.ReturnUrlQueryString.GetHashCode(); + } + if (this.ThreeDSResult != null) + { + hashCode = (hashCode * 59) + this.ThreeDSResult.GetHashCode(); + } + if (this.Threeds2ChallengeResult != null) + { + hashCode = (hashCode * 59) + this.Threeds2ChallengeResult.GetHashCode(); + } + if (this.Threeds2Fingerprint != null) + { + hashCode = (hashCode * 59) + this.Threeds2Fingerprint.GetHashCode(); + } + if (this.VaultToken != null) + { + hashCode = (hashCode * 59) + this.VaultToken.GetHashCode(); + } + return hashCode; + } + } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { // MD (string) maxLength if (this.MD != null && this.MD.Length > 20000) { - yield return new ValidationResult("Invalid value for MD, length must be less than 20000.", new [] { "MD" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for MD, length must be less than 20000.", new [] { "MD" }); } // PaReq (string) maxLength if (this.PaReq != null && this.PaReq.Length > 20000) { - yield return new ValidationResult("Invalid value for PaReq, length must be less than 20000.", new [] { "PaReq" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PaReq, length must be less than 20000.", new [] { "PaReq" }); } // PaRes (string) maxLength if (this.PaRes != null && this.PaRes.Length > 20000) { - yield return new ValidationResult("Invalid value for PaRes, length must be less than 20000.", new [] { "PaRes" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PaRes, length must be less than 20000.", new [] { "PaRes" }); } // Payload (string) maxLength if (this.Payload != null && this.Payload.Length > 20000) { - yield return new ValidationResult("Invalid value for Payload, length must be less than 20000.", new [] { "Payload" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Payload, length must be less than 20000.", new [] { "Payload" }); } // RedirectResult (string) maxLength if (this.RedirectResult != null && this.RedirectResult.Length > 20000) { - yield return new ValidationResult("Invalid value for RedirectResult, length must be less than 20000.", new [] { "RedirectResult" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for RedirectResult, length must be less than 20000.", new [] { "RedirectResult" }); } // ReturnUrlQueryString (string) maxLength if (this.ReturnUrlQueryString != null && this.ReturnUrlQueryString.Length > 20000) { - yield return new ValidationResult("Invalid value for ReturnUrlQueryString, length must be less than 20000.", new [] { "ReturnUrlQueryString" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ReturnUrlQueryString, length must be less than 20000.", new [] { "ReturnUrlQueryString" }); } // ThreeDSResult (string) maxLength if (this.ThreeDSResult != null && this.ThreeDSResult.Length > 50000) { - yield return new ValidationResult("Invalid value for ThreeDSResult, length must be less than 50000.", new [] { "ThreeDSResult" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSResult, length must be less than 50000.", new [] { "ThreeDSResult" }); } // Threeds2ChallengeResult (string) maxLength if (this.Threeds2ChallengeResult != null && this.Threeds2ChallengeResult.Length > 50000) { - yield return new ValidationResult("Invalid value for Threeds2ChallengeResult, length must be less than 50000.", new [] { "Threeds2ChallengeResult" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Threeds2ChallengeResult, length must be less than 50000.", new [] { "Threeds2ChallengeResult" }); } // Threeds2Fingerprint (string) maxLength if (this.Threeds2Fingerprint != null && this.Threeds2Fingerprint.Length > 100000) { - yield return new ValidationResult("Invalid value for Threeds2Fingerprint, length must be less than 100000.", new [] { "Threeds2Fingerprint" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Threeds2Fingerprint, length must be less than 100000.", new [] { "Threeds2Fingerprint" }); } yield break; } } - /// - /// A Json converter for type - /// - public class PaymentCompletionDetailsJsonConverter : JsonConverter - { - /// - /// Deserializes json to - /// - /// - /// - /// - /// - /// - public override PaymentCompletionDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) - { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option mD = default; - Option paReq = default; - Option paRes = default; - Option authorizationToken = default; - Option billingToken = default; - Option cupsecureplusSmscode = default; - Option facilitatorAccessToken = default; - Option oneTimePasscode = default; - Option orderID = default; - Option payerID = default; - Option payload = default; - Option paymentID = default; - Option paymentStatus = default; - Option redirectResult = default; - Option resultCode = default; - Option returnUrlQueryString = default; - Option threeDSResult = default; - Option threeds2ChallengeResult = default; - Option threeds2Fingerprint = default; - Option vaultToken = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "MD": - mD = new Option(utf8JsonReader.GetString()); - break; - case "PaReq": - paReq = new Option(utf8JsonReader.GetString()); - break; - case "PaRes": - paRes = new Option(utf8JsonReader.GetString()); - break; - case "authorization_token": - authorizationToken = new Option(utf8JsonReader.GetString()); - break; - case "billingToken": - billingToken = new Option(utf8JsonReader.GetString()); - break; - case "cupsecureplus.smscode": - cupsecureplusSmscode = new Option(utf8JsonReader.GetString()); - break; - case "facilitatorAccessToken": - facilitatorAccessToken = new Option(utf8JsonReader.GetString()); - break; - case "oneTimePasscode": - oneTimePasscode = new Option(utf8JsonReader.GetString()); - break; - case "orderID": - orderID = new Option(utf8JsonReader.GetString()); - break; - case "payerID": - payerID = new Option(utf8JsonReader.GetString()); - break; - case "payload": - payload = new Option(utf8JsonReader.GetString()); - break; - case "paymentID": - paymentID = new Option(utf8JsonReader.GetString()); - break; - case "paymentStatus": - paymentStatus = new Option(utf8JsonReader.GetString()); - break; - case "redirectResult": - redirectResult = new Option(utf8JsonReader.GetString()); - break; - case "resultCode": - resultCode = new Option(utf8JsonReader.GetString()); - break; - case "returnUrlQueryString": - returnUrlQueryString = new Option(utf8JsonReader.GetString()); - break; - case "threeDSResult": - threeDSResult = new Option(utf8JsonReader.GetString()); - break; - case "threeds2.challengeResult": - threeds2ChallengeResult = new Option(utf8JsonReader.GetString()); - break; - case "threeds2.fingerprint": - threeds2Fingerprint = new Option(utf8JsonReader.GetString()); - break; - case "vaultToken": - vaultToken = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (mD.IsSet && mD.Value == null) - throw new ArgumentNullException(nameof(mD), "Property is not nullable for class PaymentCompletionDetails."); - - if (paReq.IsSet && paReq.Value == null) - throw new ArgumentNullException(nameof(paReq), "Property is not nullable for class PaymentCompletionDetails."); - - if (paRes.IsSet && paRes.Value == null) - throw new ArgumentNullException(nameof(paRes), "Property is not nullable for class PaymentCompletionDetails."); - - if (authorizationToken.IsSet && authorizationToken.Value == null) - throw new ArgumentNullException(nameof(authorizationToken), "Property is not nullable for class PaymentCompletionDetails."); - - if (billingToken.IsSet && billingToken.Value == null) - throw new ArgumentNullException(nameof(billingToken), "Property is not nullable for class PaymentCompletionDetails."); - - if (cupsecureplusSmscode.IsSet && cupsecureplusSmscode.Value == null) - throw new ArgumentNullException(nameof(cupsecureplusSmscode), "Property is not nullable for class PaymentCompletionDetails."); - - if (facilitatorAccessToken.IsSet && facilitatorAccessToken.Value == null) - throw new ArgumentNullException(nameof(facilitatorAccessToken), "Property is not nullable for class PaymentCompletionDetails."); - - if (oneTimePasscode.IsSet && oneTimePasscode.Value == null) - throw new ArgumentNullException(nameof(oneTimePasscode), "Property is not nullable for class PaymentCompletionDetails."); - - if (orderID.IsSet && orderID.Value == null) - throw new ArgumentNullException(nameof(orderID), "Property is not nullable for class PaymentCompletionDetails."); - - if (payerID.IsSet && payerID.Value == null) - throw new ArgumentNullException(nameof(payerID), "Property is not nullable for class PaymentCompletionDetails."); - - if (payload.IsSet && payload.Value == null) - throw new ArgumentNullException(nameof(payload), "Property is not nullable for class PaymentCompletionDetails."); - - if (paymentID.IsSet && paymentID.Value == null) - throw new ArgumentNullException(nameof(paymentID), "Property is not nullable for class PaymentCompletionDetails."); - - if (paymentStatus.IsSet && paymentStatus.Value == null) - throw new ArgumentNullException(nameof(paymentStatus), "Property is not nullable for class PaymentCompletionDetails."); - - if (redirectResult.IsSet && redirectResult.Value == null) - throw new ArgumentNullException(nameof(redirectResult), "Property is not nullable for class PaymentCompletionDetails."); - - if (resultCode.IsSet && resultCode.Value == null) - throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class PaymentCompletionDetails."); - - if (returnUrlQueryString.IsSet && returnUrlQueryString.Value == null) - throw new ArgumentNullException(nameof(returnUrlQueryString), "Property is not nullable for class PaymentCompletionDetails."); - - if (threeDSResult.IsSet && threeDSResult.Value == null) - throw new ArgumentNullException(nameof(threeDSResult), "Property is not nullable for class PaymentCompletionDetails."); - - if (threeds2ChallengeResult.IsSet && threeds2ChallengeResult.Value == null) - throw new ArgumentNullException(nameof(threeds2ChallengeResult), "Property is not nullable for class PaymentCompletionDetails."); - - if (threeds2Fingerprint.IsSet && threeds2Fingerprint.Value == null) - throw new ArgumentNullException(nameof(threeds2Fingerprint), "Property is not nullable for class PaymentCompletionDetails."); - - if (vaultToken.IsSet && vaultToken.Value == null) - throw new ArgumentNullException(nameof(vaultToken), "Property is not nullable for class PaymentCompletionDetails."); - - return new PaymentCompletionDetails(mD, paReq, paRes, authorizationToken, billingToken, cupsecureplusSmscode, facilitatorAccessToken, oneTimePasscode, orderID, payerID, payload, paymentID, paymentStatus, redirectResult, resultCode, returnUrlQueryString, threeDSResult, threeds2ChallengeResult, threeds2Fingerprint, vaultToken); - } - - /// - /// Serializes a - /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentCompletionDetails paymentCompletionDetails, JsonSerializerOptions jsonSerializerOptions) - { - writer.WriteStartObject(); - - WriteProperties(writer, paymentCompletionDetails, jsonSerializerOptions); - writer.WriteEndObject(); - } - - /// - /// Serializes the properties of - /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentCompletionDetails paymentCompletionDetails, JsonSerializerOptions jsonSerializerOptions) - { - if (paymentCompletionDetails.MDOption.IsSet && paymentCompletionDetails.MD == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.MD), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.PaReqOption.IsSet && paymentCompletionDetails.PaReq == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.PaReq), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.PaResOption.IsSet && paymentCompletionDetails.PaRes == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.PaRes), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.AuthorizationTokenOption.IsSet && paymentCompletionDetails.AuthorizationToken == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.AuthorizationToken), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.BillingTokenOption.IsSet && paymentCompletionDetails.BillingToken == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.BillingToken), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.CupsecureplusSmscodeOption.IsSet && paymentCompletionDetails.CupsecureplusSmscode == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.CupsecureplusSmscode), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.FacilitatorAccessTokenOption.IsSet && paymentCompletionDetails.FacilitatorAccessToken == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.FacilitatorAccessToken), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.OneTimePasscodeOption.IsSet && paymentCompletionDetails.OneTimePasscode == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.OneTimePasscode), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.OrderIDOption.IsSet && paymentCompletionDetails.OrderID == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.OrderID), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.PayerIDOption.IsSet && paymentCompletionDetails.PayerID == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.PayerID), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.PayloadOption.IsSet && paymentCompletionDetails.Payload == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.Payload), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.PaymentIDOption.IsSet && paymentCompletionDetails.PaymentID == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.PaymentID), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.PaymentStatusOption.IsSet && paymentCompletionDetails.PaymentStatus == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.PaymentStatus), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.RedirectResultOption.IsSet && paymentCompletionDetails.RedirectResult == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.RedirectResult), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.ResultCodeOption.IsSet && paymentCompletionDetails.ResultCode == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.ResultCode), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.ReturnUrlQueryStringOption.IsSet && paymentCompletionDetails.ReturnUrlQueryString == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.ReturnUrlQueryString), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.ThreeDSResultOption.IsSet && paymentCompletionDetails.ThreeDSResult == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.ThreeDSResult), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.Threeds2ChallengeResultOption.IsSet && paymentCompletionDetails.Threeds2ChallengeResult == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.Threeds2ChallengeResult), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.Threeds2FingerprintOption.IsSet && paymentCompletionDetails.Threeds2Fingerprint == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.Threeds2Fingerprint), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.VaultTokenOption.IsSet && paymentCompletionDetails.VaultToken == null) - throw new ArgumentNullException(nameof(paymentCompletionDetails.VaultToken), "Property is required for class PaymentCompletionDetails."); - - if (paymentCompletionDetails.MDOption.IsSet) - writer.WriteString("MD", paymentCompletionDetails.MD); - - if (paymentCompletionDetails.PaReqOption.IsSet) - writer.WriteString("PaReq", paymentCompletionDetails.PaReq); - - if (paymentCompletionDetails.PaResOption.IsSet) - writer.WriteString("PaRes", paymentCompletionDetails.PaRes); - - if (paymentCompletionDetails.AuthorizationTokenOption.IsSet) - writer.WriteString("authorization_token", paymentCompletionDetails.AuthorizationToken); - - if (paymentCompletionDetails.BillingTokenOption.IsSet) - writer.WriteString("billingToken", paymentCompletionDetails.BillingToken); - - if (paymentCompletionDetails.CupsecureplusSmscodeOption.IsSet) - writer.WriteString("cupsecureplus.smscode", paymentCompletionDetails.CupsecureplusSmscode); - - if (paymentCompletionDetails.FacilitatorAccessTokenOption.IsSet) - writer.WriteString("facilitatorAccessToken", paymentCompletionDetails.FacilitatorAccessToken); - - if (paymentCompletionDetails.OneTimePasscodeOption.IsSet) - writer.WriteString("oneTimePasscode", paymentCompletionDetails.OneTimePasscode); - - if (paymentCompletionDetails.OrderIDOption.IsSet) - writer.WriteString("orderID", paymentCompletionDetails.OrderID); - - if (paymentCompletionDetails.PayerIDOption.IsSet) - writer.WriteString("payerID", paymentCompletionDetails.PayerID); - - if (paymentCompletionDetails.PayloadOption.IsSet) - writer.WriteString("payload", paymentCompletionDetails.Payload); - - if (paymentCompletionDetails.PaymentIDOption.IsSet) - writer.WriteString("paymentID", paymentCompletionDetails.PaymentID); - - if (paymentCompletionDetails.PaymentStatusOption.IsSet) - writer.WriteString("paymentStatus", paymentCompletionDetails.PaymentStatus); - - if (paymentCompletionDetails.RedirectResultOption.IsSet) - writer.WriteString("redirectResult", paymentCompletionDetails.RedirectResult); - - if (paymentCompletionDetails.ResultCodeOption.IsSet) - writer.WriteString("resultCode", paymentCompletionDetails.ResultCode); - - if (paymentCompletionDetails.ReturnUrlQueryStringOption.IsSet) - writer.WriteString("returnUrlQueryString", paymentCompletionDetails.ReturnUrlQueryString); - - if (paymentCompletionDetails.ThreeDSResultOption.IsSet) - writer.WriteString("threeDSResult", paymentCompletionDetails.ThreeDSResult); - - if (paymentCompletionDetails.Threeds2ChallengeResultOption.IsSet) - writer.WriteString("threeds2.challengeResult", paymentCompletionDetails.Threeds2ChallengeResult); - - if (paymentCompletionDetails.Threeds2FingerprintOption.IsSet) - writer.WriteString("threeds2.fingerprint", paymentCompletionDetails.Threeds2Fingerprint); - - if (paymentCompletionDetails.VaultTokenOption.IsSet) - writer.WriteString("vaultToken", paymentCompletionDetails.VaultToken); - } - } } diff --git a/Adyen/Model/Checkout/PaymentDetails.cs b/Adyen/Model/Checkout/PaymentDetails.cs index 9cfac6144..cf6bec41d 100644 --- a/Adyen/Model/Checkout/PaymentDetails.cs +++ b/Adyen/Model/Checkout/PaymentDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,1319 +15,590 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentDetails /// - public partial class PaymentDetails : IValidatableObject + [DataContract(Name = "PaymentDetails")] + public partial class PaymentDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// The payment method type. - [JsonConstructor] - public PaymentDetails(Option checkoutAttemptId = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The payment method type. /// /// The payment method type. + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Alipay for value: alipay /// + [EnumMember(Value = "alipay")] Alipay = 1, /// /// Enum Multibanco for value: multibanco /// + [EnumMember(Value = "multibanco")] Multibanco = 2, /// /// Enum BankTransferIBAN for value: bankTransfer_IBAN /// + [EnumMember(Value = "bankTransfer_IBAN")] BankTransferIBAN = 3, /// /// Enum Paybright for value: paybright /// + [EnumMember(Value = "paybright")] Paybright = 4, /// /// Enum Paynow for value: paynow /// + [EnumMember(Value = "paynow")] Paynow = 5, /// /// Enum AffirmPos for value: affirm_pos /// + [EnumMember(Value = "affirm_pos")] AffirmPos = 6, /// /// Enum Trustly for value: trustly /// + [EnumMember(Value = "trustly")] Trustly = 7, /// /// Enum Trustlyvector for value: trustlyvector /// + [EnumMember(Value = "trustlyvector")] Trustlyvector = 8, /// /// Enum Oney for value: oney /// + [EnumMember(Value = "oney")] Oney = 9, /// /// Enum Facilypay for value: facilypay /// + [EnumMember(Value = "facilypay")] Facilypay = 10, /// /// Enum Facilypay3x for value: facilypay_3x /// + [EnumMember(Value = "facilypay_3x")] Facilypay3x = 11, /// /// Enum Facilypay4x for value: facilypay_4x /// + [EnumMember(Value = "facilypay_4x")] Facilypay4x = 12, /// /// Enum Facilypay6x for value: facilypay_6x /// + [EnumMember(Value = "facilypay_6x")] Facilypay6x = 13, /// /// Enum Facilypay10x for value: facilypay_10x /// + [EnumMember(Value = "facilypay_10x")] Facilypay10x = 14, /// /// Enum Facilypay12x for value: facilypay_12x /// + [EnumMember(Value = "facilypay_12x")] Facilypay12x = 15, /// /// Enum Unionpay for value: unionpay /// + [EnumMember(Value = "unionpay")] Unionpay = 16, /// /// Enum KcpBanktransfer for value: kcp_banktransfer /// + [EnumMember(Value = "kcp_banktransfer")] KcpBanktransfer = 17, /// /// Enum KcpPayco for value: kcp_payco /// + [EnumMember(Value = "kcp_payco")] KcpPayco = 18, /// /// Enum KcpCreditcard for value: kcp_creditcard /// + [EnumMember(Value = "kcp_creditcard")] KcpCreditcard = 19, /// /// Enum WechatpaySDK for value: wechatpaySDK /// + [EnumMember(Value = "wechatpaySDK")] WechatpaySDK = 20, /// /// Enum WechatpayQR for value: wechatpayQR /// + [EnumMember(Value = "wechatpayQR")] WechatpayQR = 21, /// /// Enum WechatpayWeb for value: wechatpayWeb /// + [EnumMember(Value = "wechatpayWeb")] WechatpayWeb = 22, /// /// Enum MolpayBoost for value: molpay_boost /// + [EnumMember(Value = "molpay_boost")] MolpayBoost = 23, /// /// Enum WalletIN for value: wallet_IN /// + [EnumMember(Value = "wallet_IN")] WalletIN = 24, /// /// Enum PayuINCashcard for value: payu_IN_cashcard /// + [EnumMember(Value = "payu_IN_cashcard")] PayuINCashcard = 25, /// /// Enum PayuINNb for value: payu_IN_nb /// + [EnumMember(Value = "payu_IN_nb")] PayuINNb = 26, /// /// Enum UpiQr for value: upi_qr /// + [EnumMember(Value = "upi_qr")] UpiQr = 27, /// /// Enum Paytm for value: paytm /// + [EnumMember(Value = "paytm")] Paytm = 28, /// /// Enum MolpayEbankingVN for value: molpay_ebanking_VN /// + [EnumMember(Value = "molpay_ebanking_VN")] MolpayEbankingVN = 29, /// /// Enum MolpayEbankingMY for value: molpay_ebanking_MY /// + [EnumMember(Value = "molpay_ebanking_MY")] MolpayEbankingMY = 30, /// /// Enum MolpayEbankingDirectMY for value: molpay_ebanking_direct_MY /// + [EnumMember(Value = "molpay_ebanking_direct_MY")] MolpayEbankingDirectMY = 31, /// /// Enum Swish for value: swish /// + [EnumMember(Value = "swish")] Swish = 32, /// /// Enum Bizum for value: bizum /// + [EnumMember(Value = "bizum")] Bizum = 33, /// /// Enum Walley for value: walley /// + [EnumMember(Value = "walley")] Walley = 34, /// /// Enum WalleyB2b for value: walley_b2b /// + [EnumMember(Value = "walley_b2b")] WalleyB2b = 35, /// /// Enum Alma for value: alma /// + [EnumMember(Value = "alma")] Alma = 36, /// /// Enum Paypo for value: paypo /// + [EnumMember(Value = "paypo")] Paypo = 37, /// /// Enum Scalapay for value: scalapay /// + [EnumMember(Value = "scalapay")] Scalapay = 38, /// /// Enum Scalapay3x for value: scalapay_3x /// + [EnumMember(Value = "scalapay_3x")] Scalapay3x = 39, /// /// Enum Scalapay4x for value: scalapay_4x /// + [EnumMember(Value = "scalapay_4x")] Scalapay4x = 40, /// /// Enum MolpayFpx for value: molpay_fpx /// + [EnumMember(Value = "molpay_fpx")] MolpayFpx = 41, + /// + /// Enum Payme for value: payme + /// + [EnumMember(Value = "payme")] + Payme = 42, + + /// + /// Enum PaymePos for value: payme_pos + /// + [EnumMember(Value = "payme_pos")] + PaymePos = 43, + /// /// Enum Konbini for value: konbini /// - Konbini = 42, + [EnumMember(Value = "konbini")] + Konbini = 44, /// /// Enum DirectEbanking for value: directEbanking /// - DirectEbanking = 43, + [EnumMember(Value = "directEbanking")] + DirectEbanking = 45, /// /// Enum Boletobancario for value: boletobancario /// - Boletobancario = 44, + [EnumMember(Value = "boletobancario")] + Boletobancario = 46, /// /// Enum Neteller for value: neteller /// - Neteller = 45, + [EnumMember(Value = "neteller")] + Neteller = 47, /// /// Enum Cashticket for value: cashticket /// - Cashticket = 46, + [EnumMember(Value = "cashticket")] + Cashticket = 48, /// /// Enum Ikano for value: ikano /// - Ikano = 47, + [EnumMember(Value = "ikano")] + Ikano = 49, /// /// Enum Karenmillen for value: karenmillen /// - Karenmillen = 48, + [EnumMember(Value = "karenmillen")] + Karenmillen = 50, /// /// Enum Oasis for value: oasis /// - Oasis = 49, + [EnumMember(Value = "oasis")] + Oasis = 51, /// /// Enum Warehouse for value: warehouse /// - Warehouse = 50, + [EnumMember(Value = "warehouse")] + Warehouse = 52, /// /// Enum PrimeiropayBoleto for value: primeiropay_boleto /// - PrimeiropayBoleto = 51, + [EnumMember(Value = "primeiropay_boleto")] + PrimeiropayBoleto = 53, /// /// Enum Mada for value: mada /// - Mada = 52, + [EnumMember(Value = "mada")] + Mada = 54, /// /// Enum Benefit for value: benefit /// - Benefit = 53, + [EnumMember(Value = "benefit")] + Benefit = 55, /// /// Enum Knet for value: knet /// - Knet = 54, + [EnumMember(Value = "knet")] + Knet = 56, /// /// Enum Omannet for value: omannet /// - Omannet = 55, + [EnumMember(Value = "omannet")] + Omannet = 57, /// /// Enum GopayWallet for value: gopay_wallet /// - GopayWallet = 56, + [EnumMember(Value = "gopay_wallet")] + GopayWallet = 58, /// /// Enum KcpNaverpay for value: kcp_naverpay /// - KcpNaverpay = 57, + [EnumMember(Value = "kcp_naverpay")] + KcpNaverpay = 59, /// /// Enum OnlinebankingIN for value: onlinebanking_IN /// - OnlinebankingIN = 58, + [EnumMember(Value = "onlinebanking_IN")] + OnlinebankingIN = 60, /// /// Enum Fawry for value: fawry /// - Fawry = 59, + [EnumMember(Value = "fawry")] + Fawry = 61, /// /// Enum Atome for value: atome /// - Atome = 60, + [EnumMember(Value = "atome")] + Atome = 62, /// /// Enum Moneybookers for value: moneybookers /// - Moneybookers = 61, + [EnumMember(Value = "moneybookers")] + Moneybookers = 63, /// /// Enum Naps for value: naps /// - Naps = 62, + [EnumMember(Value = "naps")] + Naps = 64, /// /// Enum Nordea for value: nordea /// - Nordea = 63, + [EnumMember(Value = "nordea")] + Nordea = 65, /// /// Enum BoletobancarioBradesco for value: boletobancario_bradesco /// - BoletobancarioBradesco = 64, + [EnumMember(Value = "boletobancario_bradesco")] + BoletobancarioBradesco = 66, /// /// Enum BoletobancarioItau for value: boletobancario_itau /// - BoletobancarioItau = 65, + [EnumMember(Value = "boletobancario_itau")] + BoletobancarioItau = 67, /// /// Enum BoletobancarioSantander for value: boletobancario_santander /// - BoletobancarioSantander = 66, + [EnumMember(Value = "boletobancario_santander")] + BoletobancarioSantander = 68, /// /// Enum BoletobancarioBancodobrasil for value: boletobancario_bancodobrasil /// - BoletobancarioBancodobrasil = 67, + [EnumMember(Value = "boletobancario_bancodobrasil")] + BoletobancarioBancodobrasil = 69, /// /// Enum BoletobancarioHsbc for value: boletobancario_hsbc /// - BoletobancarioHsbc = 68, + [EnumMember(Value = "boletobancario_hsbc")] + BoletobancarioHsbc = 70, /// /// Enum MolpayMaybank2u for value: molpay_maybank2u /// - MolpayMaybank2u = 69, + [EnumMember(Value = "molpay_maybank2u")] + MolpayMaybank2u = 71, /// /// Enum MolpayCimb for value: molpay_cimb /// - MolpayCimb = 70, + [EnumMember(Value = "molpay_cimb")] + MolpayCimb = 72, /// /// Enum MolpayRhb for value: molpay_rhb /// - MolpayRhb = 71, + [EnumMember(Value = "molpay_rhb")] + MolpayRhb = 73, /// /// Enum MolpayAmb for value: molpay_amb /// - MolpayAmb = 72, + [EnumMember(Value = "molpay_amb")] + MolpayAmb = 74, /// /// Enum MolpayHlb for value: molpay_hlb /// - MolpayHlb = 73, + [EnumMember(Value = "molpay_hlb")] + MolpayHlb = 75, /// /// Enum MolpayAffinEpg for value: molpay_affin_epg /// - MolpayAffinEpg = 74, + [EnumMember(Value = "molpay_affin_epg")] + MolpayAffinEpg = 76, /// /// Enum MolpayBankislam for value: molpay_bankislam /// - MolpayBankislam = 75, + [EnumMember(Value = "molpay_bankislam")] + MolpayBankislam = 77, /// /// Enum MolpayPublicbank for value: molpay_publicbank /// - MolpayPublicbank = 76, + [EnumMember(Value = "molpay_publicbank")] + MolpayPublicbank = 78, /// /// Enum FpxAgrobank for value: fpx_agrobank /// - FpxAgrobank = 77, + [EnumMember(Value = "fpx_agrobank")] + FpxAgrobank = 79, /// /// Enum Touchngo for value: touchngo /// - Touchngo = 78, + [EnumMember(Value = "touchngo")] + Touchngo = 80, /// /// Enum Maybank2uMae for value: maybank2u_mae /// - Maybank2uMae = 79, + [EnumMember(Value = "maybank2u_mae")] + Maybank2uMae = 81, /// /// Enum Duitnow for value: duitnow /// - Duitnow = 80, + [EnumMember(Value = "duitnow")] + Duitnow = 82, /// /// Enum Promptpay for value: promptpay /// - Promptpay = 81, + [EnumMember(Value = "promptpay")] + Promptpay = 83, /// /// Enum TwintPos for value: twint_pos /// - TwintPos = 82, + [EnumMember(Value = "twint_pos")] + TwintPos = 84, /// /// Enum AlipayHk for value: alipay_hk /// - AlipayHk = 83, + [EnumMember(Value = "alipay_hk")] + AlipayHk = 85, /// /// Enum AlipayHkWeb for value: alipay_hk_web /// - AlipayHkWeb = 84, + [EnumMember(Value = "alipay_hk_web")] + AlipayHkWeb = 86, /// /// Enum AlipayHkWap for value: alipay_hk_wap /// - AlipayHkWap = 85, + [EnumMember(Value = "alipay_hk_wap")] + AlipayHkWap = 87, /// /// Enum AlipayWap for value: alipay_wap /// - AlipayWap = 86, + [EnumMember(Value = "alipay_wap")] + AlipayWap = 88, /// /// Enum Balanceplatform for value: balanceplatform /// - Balanceplatform = 87 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("alipay")) - return TypeEnum.Alipay; - - if (value.Equals("multibanco")) - return TypeEnum.Multibanco; - - if (value.Equals("bankTransfer_IBAN")) - return TypeEnum.BankTransferIBAN; - - if (value.Equals("paybright")) - return TypeEnum.Paybright; - - if (value.Equals("paynow")) - return TypeEnum.Paynow; - - if (value.Equals("affirm_pos")) - return TypeEnum.AffirmPos; - - if (value.Equals("trustly")) - return TypeEnum.Trustly; - - if (value.Equals("trustlyvector")) - return TypeEnum.Trustlyvector; - - if (value.Equals("oney")) - return TypeEnum.Oney; - - if (value.Equals("facilypay")) - return TypeEnum.Facilypay; - - if (value.Equals("facilypay_3x")) - return TypeEnum.Facilypay3x; - - if (value.Equals("facilypay_4x")) - return TypeEnum.Facilypay4x; - - if (value.Equals("facilypay_6x")) - return TypeEnum.Facilypay6x; - - if (value.Equals("facilypay_10x")) - return TypeEnum.Facilypay10x; - - if (value.Equals("facilypay_12x")) - return TypeEnum.Facilypay12x; - - if (value.Equals("unionpay")) - return TypeEnum.Unionpay; - - if (value.Equals("kcp_banktransfer")) - return TypeEnum.KcpBanktransfer; - - if (value.Equals("kcp_payco")) - return TypeEnum.KcpPayco; - - if (value.Equals("kcp_creditcard")) - return TypeEnum.KcpCreditcard; - - if (value.Equals("wechatpaySDK")) - return TypeEnum.WechatpaySDK; - - if (value.Equals("wechatpayQR")) - return TypeEnum.WechatpayQR; - - if (value.Equals("wechatpayWeb")) - return TypeEnum.WechatpayWeb; - - if (value.Equals("molpay_boost")) - return TypeEnum.MolpayBoost; - - if (value.Equals("wallet_IN")) - return TypeEnum.WalletIN; - - if (value.Equals("payu_IN_cashcard")) - return TypeEnum.PayuINCashcard; - - if (value.Equals("payu_IN_nb")) - return TypeEnum.PayuINNb; - - if (value.Equals("upi_qr")) - return TypeEnum.UpiQr; - - if (value.Equals("paytm")) - return TypeEnum.Paytm; - - if (value.Equals("molpay_ebanking_VN")) - return TypeEnum.MolpayEbankingVN; - - if (value.Equals("molpay_ebanking_MY")) - return TypeEnum.MolpayEbankingMY; - - if (value.Equals("molpay_ebanking_direct_MY")) - return TypeEnum.MolpayEbankingDirectMY; - - if (value.Equals("swish")) - return TypeEnum.Swish; - - if (value.Equals("bizum")) - return TypeEnum.Bizum; - - if (value.Equals("walley")) - return TypeEnum.Walley; - - if (value.Equals("walley_b2b")) - return TypeEnum.WalleyB2b; - - if (value.Equals("alma")) - return TypeEnum.Alma; - - if (value.Equals("paypo")) - return TypeEnum.Paypo; - - if (value.Equals("scalapay")) - return TypeEnum.Scalapay; - - if (value.Equals("scalapay_3x")) - return TypeEnum.Scalapay3x; - - if (value.Equals("scalapay_4x")) - return TypeEnum.Scalapay4x; - - if (value.Equals("molpay_fpx")) - return TypeEnum.MolpayFpx; - - if (value.Equals("konbini")) - return TypeEnum.Konbini; - - if (value.Equals("directEbanking")) - return TypeEnum.DirectEbanking; - - if (value.Equals("boletobancario")) - return TypeEnum.Boletobancario; - - if (value.Equals("neteller")) - return TypeEnum.Neteller; - - if (value.Equals("cashticket")) - return TypeEnum.Cashticket; - - if (value.Equals("ikano")) - return TypeEnum.Ikano; - - if (value.Equals("karenmillen")) - return TypeEnum.Karenmillen; - - if (value.Equals("oasis")) - return TypeEnum.Oasis; - - if (value.Equals("warehouse")) - return TypeEnum.Warehouse; - - if (value.Equals("primeiropay_boleto")) - return TypeEnum.PrimeiropayBoleto; - - if (value.Equals("mada")) - return TypeEnum.Mada; - - if (value.Equals("benefit")) - return TypeEnum.Benefit; - - if (value.Equals("knet")) - return TypeEnum.Knet; - - if (value.Equals("omannet")) - return TypeEnum.Omannet; - - if (value.Equals("gopay_wallet")) - return TypeEnum.GopayWallet; - - if (value.Equals("kcp_naverpay")) - return TypeEnum.KcpNaverpay; - - if (value.Equals("onlinebanking_IN")) - return TypeEnum.OnlinebankingIN; - - if (value.Equals("fawry")) - return TypeEnum.Fawry; - - if (value.Equals("atome")) - return TypeEnum.Atome; - - if (value.Equals("moneybookers")) - return TypeEnum.Moneybookers; - - if (value.Equals("naps")) - return TypeEnum.Naps; - - if (value.Equals("nordea")) - return TypeEnum.Nordea; - - if (value.Equals("boletobancario_bradesco")) - return TypeEnum.BoletobancarioBradesco; - - if (value.Equals("boletobancario_itau")) - return TypeEnum.BoletobancarioItau; - - if (value.Equals("boletobancario_santander")) - return TypeEnum.BoletobancarioSantander; + [EnumMember(Value = "balanceplatform")] + Balanceplatform = 89 - if (value.Equals("boletobancario_bancodobrasil")) - return TypeEnum.BoletobancarioBancodobrasil; - - if (value.Equals("boletobancario_hsbc")) - return TypeEnum.BoletobancarioHsbc; - - if (value.Equals("molpay_maybank2u")) - return TypeEnum.MolpayMaybank2u; - - if (value.Equals("molpay_cimb")) - return TypeEnum.MolpayCimb; - - if (value.Equals("molpay_rhb")) - return TypeEnum.MolpayRhb; - - if (value.Equals("molpay_amb")) - return TypeEnum.MolpayAmb; - - if (value.Equals("molpay_hlb")) - return TypeEnum.MolpayHlb; - - if (value.Equals("molpay_affin_epg")) - return TypeEnum.MolpayAffinEpg; - - if (value.Equals("molpay_bankislam")) - return TypeEnum.MolpayBankislam; - - if (value.Equals("molpay_publicbank")) - return TypeEnum.MolpayPublicbank; - - if (value.Equals("fpx_agrobank")) - return TypeEnum.FpxAgrobank; - - if (value.Equals("touchngo")) - return TypeEnum.Touchngo; - - if (value.Equals("maybank2u_mae")) - return TypeEnum.Maybank2uMae; - - if (value.Equals("duitnow")) - return TypeEnum.Duitnow; - - if (value.Equals("promptpay")) - return TypeEnum.Promptpay; - - if (value.Equals("twint_pos")) - return TypeEnum.TwintPos; - - if (value.Equals("alipay_hk")) - return TypeEnum.AlipayHk; - - if (value.Equals("alipay_hk_web")) - return TypeEnum.AlipayHkWeb; - - if (value.Equals("alipay_hk_wap")) - return TypeEnum.AlipayHkWap; - - if (value.Equals("alipay_wap")) - return TypeEnum.AlipayWap; - - if (value.Equals("balanceplatform")) - return TypeEnum.Balanceplatform; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("alipay")) - return TypeEnum.Alipay; - - if (value.Equals("multibanco")) - return TypeEnum.Multibanco; - - if (value.Equals("bankTransfer_IBAN")) - return TypeEnum.BankTransferIBAN; - - if (value.Equals("paybright")) - return TypeEnum.Paybright; - - if (value.Equals("paynow")) - return TypeEnum.Paynow; - - if (value.Equals("affirm_pos")) - return TypeEnum.AffirmPos; - - if (value.Equals("trustly")) - return TypeEnum.Trustly; - - if (value.Equals("trustlyvector")) - return TypeEnum.Trustlyvector; - - if (value.Equals("oney")) - return TypeEnum.Oney; - - if (value.Equals("facilypay")) - return TypeEnum.Facilypay; - - if (value.Equals("facilypay_3x")) - return TypeEnum.Facilypay3x; - - if (value.Equals("facilypay_4x")) - return TypeEnum.Facilypay4x; - - if (value.Equals("facilypay_6x")) - return TypeEnum.Facilypay6x; - - if (value.Equals("facilypay_10x")) - return TypeEnum.Facilypay10x; - - if (value.Equals("facilypay_12x")) - return TypeEnum.Facilypay12x; - - if (value.Equals("unionpay")) - return TypeEnum.Unionpay; - - if (value.Equals("kcp_banktransfer")) - return TypeEnum.KcpBanktransfer; - - if (value.Equals("kcp_payco")) - return TypeEnum.KcpPayco; - - if (value.Equals("kcp_creditcard")) - return TypeEnum.KcpCreditcard; - - if (value.Equals("wechatpaySDK")) - return TypeEnum.WechatpaySDK; - - if (value.Equals("wechatpayQR")) - return TypeEnum.WechatpayQR; - - if (value.Equals("wechatpayWeb")) - return TypeEnum.WechatpayWeb; - - if (value.Equals("molpay_boost")) - return TypeEnum.MolpayBoost; - - if (value.Equals("wallet_IN")) - return TypeEnum.WalletIN; - - if (value.Equals("payu_IN_cashcard")) - return TypeEnum.PayuINCashcard; - - if (value.Equals("payu_IN_nb")) - return TypeEnum.PayuINNb; - - if (value.Equals("upi_qr")) - return TypeEnum.UpiQr; - - if (value.Equals("paytm")) - return TypeEnum.Paytm; - - if (value.Equals("molpay_ebanking_VN")) - return TypeEnum.MolpayEbankingVN; - - if (value.Equals("molpay_ebanking_MY")) - return TypeEnum.MolpayEbankingMY; - - if (value.Equals("molpay_ebanking_direct_MY")) - return TypeEnum.MolpayEbankingDirectMY; - - if (value.Equals("swish")) - return TypeEnum.Swish; - - if (value.Equals("bizum")) - return TypeEnum.Bizum; - - if (value.Equals("walley")) - return TypeEnum.Walley; - - if (value.Equals("walley_b2b")) - return TypeEnum.WalleyB2b; - - if (value.Equals("alma")) - return TypeEnum.Alma; - - if (value.Equals("paypo")) - return TypeEnum.Paypo; - - if (value.Equals("scalapay")) - return TypeEnum.Scalapay; - - if (value.Equals("scalapay_3x")) - return TypeEnum.Scalapay3x; - - if (value.Equals("scalapay_4x")) - return TypeEnum.Scalapay4x; - - if (value.Equals("molpay_fpx")) - return TypeEnum.MolpayFpx; - - if (value.Equals("konbini")) - return TypeEnum.Konbini; - - if (value.Equals("directEbanking")) - return TypeEnum.DirectEbanking; - - if (value.Equals("boletobancario")) - return TypeEnum.Boletobancario; - - if (value.Equals("neteller")) - return TypeEnum.Neteller; - - if (value.Equals("cashticket")) - return TypeEnum.Cashticket; - - if (value.Equals("ikano")) - return TypeEnum.Ikano; - - if (value.Equals("karenmillen")) - return TypeEnum.Karenmillen; - - if (value.Equals("oasis")) - return TypeEnum.Oasis; - - if (value.Equals("warehouse")) - return TypeEnum.Warehouse; - - if (value.Equals("primeiropay_boleto")) - return TypeEnum.PrimeiropayBoleto; - - if (value.Equals("mada")) - return TypeEnum.Mada; - - if (value.Equals("benefit")) - return TypeEnum.Benefit; - - if (value.Equals("knet")) - return TypeEnum.Knet; - - if (value.Equals("omannet")) - return TypeEnum.Omannet; - - if (value.Equals("gopay_wallet")) - return TypeEnum.GopayWallet; - - if (value.Equals("kcp_naverpay")) - return TypeEnum.KcpNaverpay; - - if (value.Equals("onlinebanking_IN")) - return TypeEnum.OnlinebankingIN; - - if (value.Equals("fawry")) - return TypeEnum.Fawry; - - if (value.Equals("atome")) - return TypeEnum.Atome; - - if (value.Equals("moneybookers")) - return TypeEnum.Moneybookers; - - if (value.Equals("naps")) - return TypeEnum.Naps; - - if (value.Equals("nordea")) - return TypeEnum.Nordea; - - if (value.Equals("boletobancario_bradesco")) - return TypeEnum.BoletobancarioBradesco; - - if (value.Equals("boletobancario_itau")) - return TypeEnum.BoletobancarioItau; - - if (value.Equals("boletobancario_santander")) - return TypeEnum.BoletobancarioSantander; - - if (value.Equals("boletobancario_bancodobrasil")) - return TypeEnum.BoletobancarioBancodobrasil; - - if (value.Equals("boletobancario_hsbc")) - return TypeEnum.BoletobancarioHsbc; - - if (value.Equals("molpay_maybank2u")) - return TypeEnum.MolpayMaybank2u; - - if (value.Equals("molpay_cimb")) - return TypeEnum.MolpayCimb; - - if (value.Equals("molpay_rhb")) - return TypeEnum.MolpayRhb; - - if (value.Equals("molpay_amb")) - return TypeEnum.MolpayAmb; - - if (value.Equals("molpay_hlb")) - return TypeEnum.MolpayHlb; - - if (value.Equals("molpay_affin_epg")) - return TypeEnum.MolpayAffinEpg; - - if (value.Equals("molpay_bankislam")) - return TypeEnum.MolpayBankislam; - - if (value.Equals("molpay_publicbank")) - return TypeEnum.MolpayPublicbank; - - if (value.Equals("fpx_agrobank")) - return TypeEnum.FpxAgrobank; - - if (value.Equals("touchngo")) - return TypeEnum.Touchngo; - - if (value.Equals("maybank2u_mae")) - return TypeEnum.Maybank2uMae; - - if (value.Equals("duitnow")) - return TypeEnum.Duitnow; - - if (value.Equals("promptpay")) - return TypeEnum.Promptpay; - - if (value.Equals("twint_pos")) - return TypeEnum.TwintPos; - - if (value.Equals("alipay_hk")) - return TypeEnum.AlipayHk; - - if (value.Equals("alipay_hk_web")) - return TypeEnum.AlipayHkWeb; - - if (value.Equals("alipay_hk_wap")) - return TypeEnum.AlipayHkWap; - - if (value.Equals("alipay_wap")) - return TypeEnum.AlipayWap; - - if (value.Equals("balanceplatform")) - return TypeEnum.Balanceplatform; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Alipay) - return "alipay"; - - if (value == TypeEnum.Multibanco) - return "multibanco"; - - if (value == TypeEnum.BankTransferIBAN) - return "bankTransfer_IBAN"; - - if (value == TypeEnum.Paybright) - return "paybright"; - - if (value == TypeEnum.Paynow) - return "paynow"; - - if (value == TypeEnum.AffirmPos) - return "affirm_pos"; - - if (value == TypeEnum.Trustly) - return "trustly"; - - if (value == TypeEnum.Trustlyvector) - return "trustlyvector"; - - if (value == TypeEnum.Oney) - return "oney"; - - if (value == TypeEnum.Facilypay) - return "facilypay"; - - if (value == TypeEnum.Facilypay3x) - return "facilypay_3x"; - - if (value == TypeEnum.Facilypay4x) - return "facilypay_4x"; - - if (value == TypeEnum.Facilypay6x) - return "facilypay_6x"; - - if (value == TypeEnum.Facilypay10x) - return "facilypay_10x"; - - if (value == TypeEnum.Facilypay12x) - return "facilypay_12x"; - - if (value == TypeEnum.Unionpay) - return "unionpay"; - - if (value == TypeEnum.KcpBanktransfer) - return "kcp_banktransfer"; - - if (value == TypeEnum.KcpPayco) - return "kcp_payco"; - - if (value == TypeEnum.KcpCreditcard) - return "kcp_creditcard"; - - if (value == TypeEnum.WechatpaySDK) - return "wechatpaySDK"; - - if (value == TypeEnum.WechatpayQR) - return "wechatpayQR"; - - if (value == TypeEnum.WechatpayWeb) - return "wechatpayWeb"; - - if (value == TypeEnum.MolpayBoost) - return "molpay_boost"; - - if (value == TypeEnum.WalletIN) - return "wallet_IN"; - - if (value == TypeEnum.PayuINCashcard) - return "payu_IN_cashcard"; - - if (value == TypeEnum.PayuINNb) - return "payu_IN_nb"; - - if (value == TypeEnum.UpiQr) - return "upi_qr"; - - if (value == TypeEnum.Paytm) - return "paytm"; - - if (value == TypeEnum.MolpayEbankingVN) - return "molpay_ebanking_VN"; - - if (value == TypeEnum.MolpayEbankingMY) - return "molpay_ebanking_MY"; - - if (value == TypeEnum.MolpayEbankingDirectMY) - return "molpay_ebanking_direct_MY"; - - if (value == TypeEnum.Swish) - return "swish"; - - if (value == TypeEnum.Bizum) - return "bizum"; - - if (value == TypeEnum.Walley) - return "walley"; - - if (value == TypeEnum.WalleyB2b) - return "walley_b2b"; - - if (value == TypeEnum.Alma) - return "alma"; - - if (value == TypeEnum.Paypo) - return "paypo"; - - if (value == TypeEnum.Scalapay) - return "scalapay"; - - if (value == TypeEnum.Scalapay3x) - return "scalapay_3x"; - - if (value == TypeEnum.Scalapay4x) - return "scalapay_4x"; - - if (value == TypeEnum.MolpayFpx) - return "molpay_fpx"; - - if (value == TypeEnum.Konbini) - return "konbini"; - - if (value == TypeEnum.DirectEbanking) - return "directEbanking"; - - if (value == TypeEnum.Boletobancario) - return "boletobancario"; - - if (value == TypeEnum.Neteller) - return "neteller"; - - if (value == TypeEnum.Cashticket) - return "cashticket"; - - if (value == TypeEnum.Ikano) - return "ikano"; - - if (value == TypeEnum.Karenmillen) - return "karenmillen"; - - if (value == TypeEnum.Oasis) - return "oasis"; - - if (value == TypeEnum.Warehouse) - return "warehouse"; - - if (value == TypeEnum.PrimeiropayBoleto) - return "primeiropay_boleto"; - - if (value == TypeEnum.Mada) - return "mada"; - - if (value == TypeEnum.Benefit) - return "benefit"; - - if (value == TypeEnum.Knet) - return "knet"; - - if (value == TypeEnum.Omannet) - return "omannet"; - - if (value == TypeEnum.GopayWallet) - return "gopay_wallet"; - - if (value == TypeEnum.KcpNaverpay) - return "kcp_naverpay"; - - if (value == TypeEnum.OnlinebankingIN) - return "onlinebanking_IN"; - - if (value == TypeEnum.Fawry) - return "fawry"; - - if (value == TypeEnum.Atome) - return "atome"; - - if (value == TypeEnum.Moneybookers) - return "moneybookers"; - - if (value == TypeEnum.Naps) - return "naps"; - - if (value == TypeEnum.Nordea) - return "nordea"; - - if (value == TypeEnum.BoletobancarioBradesco) - return "boletobancario_bradesco"; - - if (value == TypeEnum.BoletobancarioItau) - return "boletobancario_itau"; - - if (value == TypeEnum.BoletobancarioSantander) - return "boletobancario_santander"; - - if (value == TypeEnum.BoletobancarioBancodobrasil) - return "boletobancario_bancodobrasil"; - - if (value == TypeEnum.BoletobancarioHsbc) - return "boletobancario_hsbc"; - - if (value == TypeEnum.MolpayMaybank2u) - return "molpay_maybank2u"; - - if (value == TypeEnum.MolpayCimb) - return "molpay_cimb"; - - if (value == TypeEnum.MolpayRhb) - return "molpay_rhb"; - - if (value == TypeEnum.MolpayAmb) - return "molpay_amb"; - - if (value == TypeEnum.MolpayHlb) - return "molpay_hlb"; - - if (value == TypeEnum.MolpayAffinEpg) - return "molpay_affin_epg"; - - if (value == TypeEnum.MolpayBankislam) - return "molpay_bankislam"; - - if (value == TypeEnum.MolpayPublicbank) - return "molpay_publicbank"; - - if (value == TypeEnum.FpxAgrobank) - return "fpx_agrobank"; - - if (value == TypeEnum.Touchngo) - return "touchngo"; - - if (value == TypeEnum.Maybank2uMae) - return "maybank2u_mae"; - - if (value == TypeEnum.Duitnow) - return "duitnow"; - - if (value == TypeEnum.Promptpay) - return "promptpay"; - - if (value == TypeEnum.TwintPos) - return "twint_pos"; - - if (value == TypeEnum.AlipayHk) - return "alipay_hk"; - - if (value == TypeEnum.AlipayHkWeb) - return "alipay_hk_web"; - - if (value == TypeEnum.AlipayHkWap) - return "alipay_hk_wap"; - - if (value == TypeEnum.AlipayWap) - return "alipay_wap"; - - if (value == TypeEnum.Balanceplatform) - return "balanceplatform"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// The payment method type. /// /// The payment method type. - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// The payment method type.. + public PaymentDetails(string checkoutAttemptId = default(string), TypeEnum? type = default(TypeEnum?)) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Returns the string presentation of the object @@ -1343,111 +615,73 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option type = default; + return this.Equals(input as PaymentDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PaymentDetails instances are equal + /// + /// Instance of PaymentDetails to be compared + /// Boolean + public bool Equals(PaymentDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(PaymentDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PaymentDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PaymentDetails."); - - return new PaymentDetails(checkoutAttemptId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentDetails paymentDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, paymentDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentDetails paymentDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (paymentDetails.CheckoutAttemptIdOption.IsSet && paymentDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(paymentDetails.CheckoutAttemptId), "Property is required for class PaymentDetails."); - - if (paymentDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", paymentDetails.CheckoutAttemptId); - - var typeRawValue = PaymentDetails.TypeEnumToJsonValue(paymentDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentDetailsRequest.cs b/Adyen/Model/Checkout/PaymentDetailsRequest.cs index a19378c84..0761390a4 100644 --- a/Adyen/Model/Checkout/PaymentDetailsRequest.cs +++ b/Adyen/Model/Checkout/PaymentDetailsRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,86 +15,69 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentDetailsRequest /// - public partial class PaymentDetailsRequest : IValidatableObject + [DataContract(Name = "PaymentDetailsRequest")] + public partial class PaymentDetailsRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// details - /// authenticationData - /// Encoded payment data. For [authorizing a payment after using 3D Secure 2 Authentication-only](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only/#authorise-the-payment-with-adyen): If you received `resultCode`: **AuthenticationNotRequired** in the `/payments` response, use the `threeDSPaymentData` from the same response. If you received `resultCode`: **AuthenticationFinished** in the `/payments` response, use the `action.paymentData` from the same response. - /// Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously. - [JsonConstructor] - public PaymentDetailsRequest(PaymentCompletionDetails details, Option authenticationData = default, Option paymentData = default, Option threeDSAuthenticationOnly = default) - { - Details = details; - AuthenticationDataOption = authenticationData; - PaymentDataOption = paymentData; - ThreeDSAuthenticationOnlyOption = threeDSAuthenticationOnly; - OnCreated(); - } - - partial void OnCreated(); - - /// - /// Gets or Sets Details - /// - [JsonPropertyName("details")] - public PaymentCompletionDetails Details { get; set; } - + [JsonConstructorAttribute] + protected PaymentDetailsRequest() { } /// - /// Used to track the state of AuthenticationData + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthenticationDataOption { get; private set; } + /// authenticationData. + /// details (required). + /// Encoded payment data. For [authorizing a payment after using 3D Secure 2 Authentication-only](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only/#authorise-the-payment-with-adyen): If you received `resultCode`: **AuthenticationNotRequired** in the `/payments` response, use the `threeDSPaymentData` from the same response. If you received `resultCode`: **AuthenticationFinished** in the `/payments` response, use the `action.paymentData` from the same response.. + /// Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously.. + public PaymentDetailsRequest(DetailsRequestAuthenticationData authenticationData = default(DetailsRequestAuthenticationData), PaymentCompletionDetails details = default(PaymentCompletionDetails), string paymentData = default(string), bool? threeDSAuthenticationOnly = default(bool?)) + { + this.Details = details; + this.AuthenticationData = authenticationData; + this.PaymentData = paymentData; + this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; + } /// /// Gets or Sets AuthenticationData /// - [JsonPropertyName("authenticationData")] - public DetailsRequestAuthenticationData AuthenticationData { get { return this.AuthenticationDataOption; } set { this.AuthenticationDataOption = new Option(value); } } + [DataMember(Name = "authenticationData", EmitDefaultValue = false)] + public DetailsRequestAuthenticationData AuthenticationData { get; set; } /// - /// Used to track the state of PaymentData + /// Gets or Sets Details /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentDataOption { get; private set; } + [DataMember(Name = "details", IsRequired = false, EmitDefaultValue = false)] + public PaymentCompletionDetails Details { get; set; } /// /// Encoded payment data. For [authorizing a payment after using 3D Secure 2 Authentication-only](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only/#authorise-the-payment-with-adyen): If you received `resultCode`: **AuthenticationNotRequired** in the `/payments` response, use the `threeDSPaymentData` from the same response. If you received `resultCode`: **AuthenticationFinished** in the `/payments` response, use the `action.paymentData` from the same response. /// /// Encoded payment data. For [authorizing a payment after using 3D Secure 2 Authentication-only](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only/#authorise-the-payment-with-adyen): If you received `resultCode`: **AuthenticationNotRequired** in the `/payments` response, use the `threeDSPaymentData` from the same response. If you received `resultCode`: **AuthenticationFinished** in the `/payments` response, use the `action.paymentData` from the same response. - [JsonPropertyName("paymentData")] - public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSAuthenticationOnly - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSAuthenticationOnlyOption { get; private set; } + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } /// /// Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously. /// /// Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously. - [JsonPropertyName("threeDSAuthenticationOnly")] - [Obsolete] - public bool? ThreeDSAuthenticationOnly { get { return this.ThreeDSAuthenticationOnlyOption; } set { this.ThreeDSAuthenticationOnlyOption = new Option(value); } } + [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.authenticationOnly` instead.")] + public bool? ThreeDSAuthenticationOnly { get; set; } /// /// Returns the string presentation of the object @@ -103,8 +87,8 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentDetailsRequest {\n"); - sb.Append(" Details: ").Append(Details).Append("\n"); sb.Append(" AuthenticationData: ").Append(AuthenticationData).Append("\n"); + sb.Append(" Details: ").Append(Details).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); sb.Append(" ThreeDSAuthenticationOnly: ").Append(ThreeDSAuthenticationOnly).Append("\n"); sb.Append("}\n"); @@ -112,148 +96,97 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // PaymentData (string) maxLength - if (this.PaymentData != null && this.PaymentData.Length > 200000) - { - yield return new ValidationResult("Invalid value for PaymentData, length must be less than 200000.", new [] { "PaymentData" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentDetailsRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentDetailsRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option details = default; - Option authenticationData = default; - Option paymentData = default; - Option threeDSAuthenticationOnly = default; + return this.Equals(input as PaymentDetailsRequest); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PaymentDetailsRequest instances are equal + /// + /// Instance of PaymentDetailsRequest to be compared + /// Boolean + public bool Equals(PaymentDetailsRequest input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "details": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - details = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "authenticationData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - authenticationData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "paymentData": - paymentData = new Option(utf8JsonReader.GetString()); - break; - case "threeDSAuthenticationOnly": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDSAuthenticationOnly = new Option(utf8JsonReader.GetBoolean()); - break; - default: - break; - } - } + return false; } - - if (!details.IsSet) - throw new ArgumentException("Property is required for class PaymentDetailsRequest.", nameof(details)); - - if (details.IsSet && details.Value == null) - throw new ArgumentNullException(nameof(details), "Property is not nullable for class PaymentDetailsRequest."); - - if (authenticationData.IsSet && authenticationData.Value == null) - throw new ArgumentNullException(nameof(authenticationData), "Property is not nullable for class PaymentDetailsRequest."); - - if (paymentData.IsSet && paymentData.Value == null) - throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class PaymentDetailsRequest."); - - if (threeDSAuthenticationOnly.IsSet && threeDSAuthenticationOnly.Value == null) - throw new ArgumentNullException(nameof(threeDSAuthenticationOnly), "Property is not nullable for class PaymentDetailsRequest."); - - return new PaymentDetailsRequest(details.Value, authenticationData, paymentData, threeDSAuthenticationOnly); + return + ( + this.AuthenticationData == input.AuthenticationData || + (this.AuthenticationData != null && + this.AuthenticationData.Equals(input.AuthenticationData)) + ) && + ( + this.Details == input.Details || + (this.Details != null && + this.Details.Equals(input.Details)) + ) && + ( + this.PaymentData == input.PaymentData || + (this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData)) + ) && + ( + this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || + this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentDetailsRequest paymentDetailsRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, paymentDetailsRequest, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AuthenticationData != null) + { + hashCode = (hashCode * 59) + this.AuthenticationData.GetHashCode(); + } + if (this.Details != null) + { + hashCode = (hashCode * 59) + this.Details.GetHashCode(); + } + if (this.PaymentData != null) + { + hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ThreeDSAuthenticationOnly.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentDetailsRequest paymentDetailsRequest, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (paymentDetailsRequest.Details == null) - throw new ArgumentNullException(nameof(paymentDetailsRequest.Details), "Property is required for class PaymentDetailsRequest."); - - if (paymentDetailsRequest.AuthenticationDataOption.IsSet && paymentDetailsRequest.AuthenticationData == null) - throw new ArgumentNullException(nameof(paymentDetailsRequest.AuthenticationData), "Property is required for class PaymentDetailsRequest."); - - if (paymentDetailsRequest.PaymentDataOption.IsSet && paymentDetailsRequest.PaymentData == null) - throw new ArgumentNullException(nameof(paymentDetailsRequest.PaymentData), "Property is required for class PaymentDetailsRequest."); - - writer.WritePropertyName("details"); - JsonSerializer.Serialize(writer, paymentDetailsRequest.Details, jsonSerializerOptions); - if (paymentDetailsRequest.AuthenticationDataOption.IsSet) + // PaymentData (string) maxLength + if (this.PaymentData != null && this.PaymentData.Length > 200000) { - writer.WritePropertyName("authenticationData"); - JsonSerializer.Serialize(writer, paymentDetailsRequest.AuthenticationData, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PaymentData, length must be less than 200000.", new [] { "PaymentData" }); } - if (paymentDetailsRequest.PaymentDataOption.IsSet) - writer.WriteString("paymentData", paymentDetailsRequest.PaymentData); - if (paymentDetailsRequest.ThreeDSAuthenticationOnlyOption.IsSet) - writer.WriteBoolean("threeDSAuthenticationOnly", paymentDetailsRequest.ThreeDSAuthenticationOnlyOption.Value.Value); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentDetailsResponse.cs b/Adyen/Model/Checkout/PaymentDetailsResponse.cs index ebf4e9a06..857e1cd3b 100644 --- a/Adyen/Model/Checkout/PaymentDetailsResponse.cs +++ b/Adyen/Model/Checkout/PaymentDetailsResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,499 +15,251 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentDetailsResponse /// - public partial class PaymentDetailsResponse : IValidatableObject + [DataContract(Name = "PaymentDetailsResponse")] + public partial class PaymentDetailsResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - /// amount - /// Donation Token containing payment details for Adyen Giving. - /// fraudResult - /// The reference used during the /payments request. - /// order - /// paymentMethod - /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - /// The shopperLocale. - /// threeDS2ResponseData - /// threeDS2Result - /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. - [JsonConstructor] - public PaymentDetailsResponse(Option> additionalData = default, Option amount = default, Option donationToken = default, Option fraudResult = default, Option merchantReference = default, Option order = default, Option paymentMethod = default, Option pspReference = default, Option refusalReason = default, Option refusalReasonCode = default, Option resultCode = default, Option shopperLocale = default, Option threeDS2ResponseData = default, Option threeDS2Result = default, Option threeDSPaymentData = default) - { - AdditionalDataOption = additionalData; - AmountOption = amount; - DonationTokenOption = donationToken; - FraudResultOption = fraudResult; - MerchantReferenceOption = merchantReference; - OrderOption = order; - PaymentMethodOption = paymentMethod; - PspReferenceOption = pspReference; - RefusalReasonOption = refusalReason; - RefusalReasonCodeOption = refusalReasonCode; - ResultCodeOption = resultCode; - ShopperLocaleOption = shopperLocale; - ThreeDS2ResponseDataOption = threeDS2ResponseData; - ThreeDS2ResultOption = threeDS2Result; - ThreeDSPaymentDataOption = threeDSPaymentData; - OnCreated(); - } - - partial void OnCreated(); - /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + [JsonConverter(typeof(StringEnumConverter))] public enum ResultCodeEnum { /// /// Enum AuthenticationFinished for value: AuthenticationFinished /// + [EnumMember(Value = "AuthenticationFinished")] AuthenticationFinished = 1, /// /// Enum AuthenticationNotRequired for value: AuthenticationNotRequired /// + [EnumMember(Value = "AuthenticationNotRequired")] AuthenticationNotRequired = 2, /// /// Enum Authorised for value: Authorised /// + [EnumMember(Value = "Authorised")] Authorised = 3, /// /// Enum Cancelled for value: Cancelled /// + [EnumMember(Value = "Cancelled")] Cancelled = 4, /// /// Enum ChallengeShopper for value: ChallengeShopper /// + [EnumMember(Value = "ChallengeShopper")] ChallengeShopper = 5, /// /// Enum Error for value: Error /// + [EnumMember(Value = "Error")] Error = 6, /// /// Enum IdentifyShopper for value: IdentifyShopper /// + [EnumMember(Value = "IdentifyShopper")] IdentifyShopper = 7, /// /// Enum PartiallyAuthorised for value: PartiallyAuthorised /// + [EnumMember(Value = "PartiallyAuthorised")] PartiallyAuthorised = 8, /// /// Enum Pending for value: Pending /// + [EnumMember(Value = "Pending")] Pending = 9, /// /// Enum PresentToShopper for value: PresentToShopper /// + [EnumMember(Value = "PresentToShopper")] PresentToShopper = 10, /// /// Enum Received for value: Received /// + [EnumMember(Value = "Received")] Received = 11, /// /// Enum RedirectShopper for value: RedirectShopper /// + [EnumMember(Value = "RedirectShopper")] RedirectShopper = 12, /// /// Enum Refused for value: Refused /// + [EnumMember(Value = "Refused")] Refused = 13, /// /// Enum Success for value: Success /// + [EnumMember(Value = "Success")] Success = 14 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ResultCodeEnum ResultCodeEnumFromString(string value) - { - if (value.Equals("AuthenticationFinished")) - return ResultCodeEnum.AuthenticationFinished; - - if (value.Equals("AuthenticationNotRequired")) - return ResultCodeEnum.AuthenticationNotRequired; - - if (value.Equals("Authorised")) - return ResultCodeEnum.Authorised; - if (value.Equals("Cancelled")) - return ResultCodeEnum.Cancelled; - - if (value.Equals("ChallengeShopper")) - return ResultCodeEnum.ChallengeShopper; - - if (value.Equals("Error")) - return ResultCodeEnum.Error; - - if (value.Equals("IdentifyShopper")) - return ResultCodeEnum.IdentifyShopper; - - if (value.Equals("PartiallyAuthorised")) - return ResultCodeEnum.PartiallyAuthorised; - - if (value.Equals("Pending")) - return ResultCodeEnum.Pending; - - if (value.Equals("PresentToShopper")) - return ResultCodeEnum.PresentToShopper; - - if (value.Equals("Received")) - return ResultCodeEnum.Received; - - if (value.Equals("RedirectShopper")) - return ResultCodeEnum.RedirectShopper; - - if (value.Equals("Refused")) - return ResultCodeEnum.Refused; - - if (value.Equals("Success")) - return ResultCodeEnum.Success; - - throw new NotImplementedException($"Could not convert value to type ResultCodeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static ResultCodeEnum? ResultCodeEnumFromStringOrDefault(string value) - { - if (value.Equals("AuthenticationFinished")) - return ResultCodeEnum.AuthenticationFinished; - - if (value.Equals("AuthenticationNotRequired")) - return ResultCodeEnum.AuthenticationNotRequired; - - if (value.Equals("Authorised")) - return ResultCodeEnum.Authorised; - - if (value.Equals("Cancelled")) - return ResultCodeEnum.Cancelled; - - if (value.Equals("ChallengeShopper")) - return ResultCodeEnum.ChallengeShopper; - - if (value.Equals("Error")) - return ResultCodeEnum.Error; - - if (value.Equals("IdentifyShopper")) - return ResultCodeEnum.IdentifyShopper; - - if (value.Equals("PartiallyAuthorised")) - return ResultCodeEnum.PartiallyAuthorised; - - if (value.Equals("Pending")) - return ResultCodeEnum.Pending; - - if (value.Equals("PresentToShopper")) - return ResultCodeEnum.PresentToShopper; - - if (value.Equals("Received")) - return ResultCodeEnum.Received; - - if (value.Equals("RedirectShopper")) - return ResultCodeEnum.RedirectShopper; - - if (value.Equals("Refused")) - return ResultCodeEnum.Refused; - - if (value.Equals("Success")) - return ResultCodeEnum.Success; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ResultCodeEnumToJsonValue(ResultCodeEnum? value) - { - if (value == ResultCodeEnum.AuthenticationFinished) - return "AuthenticationFinished"; - - if (value == ResultCodeEnum.AuthenticationNotRequired) - return "AuthenticationNotRequired"; - - if (value == ResultCodeEnum.Authorised) - return "Authorised"; - - if (value == ResultCodeEnum.Cancelled) - return "Cancelled"; - - if (value == ResultCodeEnum.ChallengeShopper) - return "ChallengeShopper"; - - if (value == ResultCodeEnum.Error) - return "Error"; - - if (value == ResultCodeEnum.IdentifyShopper) - return "IdentifyShopper"; - - if (value == ResultCodeEnum.PartiallyAuthorised) - return "PartiallyAuthorised"; - - if (value == ResultCodeEnum.Pending) - return "Pending"; - - if (value == ResultCodeEnum.PresentToShopper) - return "PresentToShopper"; - - if (value == ResultCodeEnum.Received) - return "Received"; - - if (value == ResultCodeEnum.RedirectShopper) - return "RedirectShopper"; - - if (value == ResultCodeEnum.Refused) - return "Refused"; - - if (value == ResultCodeEnum.Success) - return "Success"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ResultCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ResultCodeOption { get; private set; } /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - [JsonPropertyName("resultCode")] - public ResultCodeEnum? ResultCode { get { return this.ResultCodeOption; } set { this.ResultCodeOption = new Option(value); } } - + [DataMember(Name = "resultCode", EmitDefaultValue = false)] + public ResultCodeEnum? ResultCode { get; set; } /// - /// Used to track the state of AdditionalData + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AdditionalDataOption { get; private set; } + /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**.. + /// amount. + /// Donation Token containing payment details for Adyen Giving.. + /// fraudResult. + /// The reference used during the /payments request.. + /// order. + /// paymentMethod. + /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request.. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. + /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state.. + /// The shopperLocale.. + /// threeDS2ResponseData. + /// threeDS2Result. + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`.. + public PaymentDetailsResponse(Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), string donationToken = default(string), FraudResult fraudResult = default(FraudResult), string merchantReference = default(string), CheckoutOrderResponse order = default(CheckoutOrderResponse), ResponsePaymentMethod paymentMethod = default(ResponsePaymentMethod), string pspReference = default(string), string refusalReason = default(string), string refusalReasonCode = default(string), ResultCodeEnum? resultCode = default(ResultCodeEnum?), string shopperLocale = default(string), ThreeDS2ResponseData threeDS2ResponseData = default(ThreeDS2ResponseData), ThreeDS2Result threeDS2Result = default(ThreeDS2Result), string threeDSPaymentData = default(string)) + { + this.AdditionalData = additionalData; + this.Amount = amount; + this.DonationToken = donationToken; + this.FraudResult = fraudResult; + this.MerchantReference = merchantReference; + this.Order = order; + this.PaymentMethod = paymentMethod; + this.PspReference = pspReference; + this.RefusalReason = refusalReason; + this.RefusalReasonCode = refusalReasonCode; + this.ResultCode = resultCode; + this.ShopperLocale = shopperLocale; + this.ThreeDS2ResponseData = threeDS2ResponseData; + this.ThreeDS2Result = threeDS2Result; + this.ThreeDSPaymentData = threeDSPaymentData; + } /// /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. /// /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - [JsonPropertyName("additionalData")] - public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } - - /// - /// Used to track the state of Amount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountOption { get; private set; } + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] - public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } - - /// - /// Used to track the state of DonationToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DonationTokenOption { get; private set; } + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// Donation Token containing payment details for Adyen Giving. /// /// Donation Token containing payment details for Adyen Giving. - [JsonPropertyName("donationToken")] - public string DonationToken { get { return this.DonationTokenOption; } set { this.DonationTokenOption = new Option(value); } } - - /// - /// Used to track the state of FraudResult - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FraudResultOption { get; private set; } + [DataMember(Name = "donationToken", EmitDefaultValue = false)] + public string DonationToken { get; set; } /// /// Gets or Sets FraudResult /// - [JsonPropertyName("fraudResult")] - public FraudResult FraudResult { get { return this.FraudResultOption; } set { this.FraudResultOption = new Option(value); } } - - /// - /// Used to track the state of MerchantReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantReferenceOption { get; private set; } + [DataMember(Name = "fraudResult", EmitDefaultValue = false)] + public FraudResult FraudResult { get; set; } /// /// The reference used during the /payments request. /// /// The reference used during the /payments request. - [JsonPropertyName("merchantReference")] - public string MerchantReference { get { return this.MerchantReferenceOption; } set { this.MerchantReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Order - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OrderOption { get; private set; } + [DataMember(Name = "merchantReference", EmitDefaultValue = false)] + public string MerchantReference { get; set; } /// /// Gets or Sets Order /// - [JsonPropertyName("order")] - public CheckoutOrderResponse Order { get { return this.OrderOption; } set { this.OrderOption = new Option(value); } } - - /// - /// Used to track the state of PaymentMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodOption { get; private set; } + [DataMember(Name = "order", EmitDefaultValue = false)] + public CheckoutOrderResponse Order { get; set; } /// /// Gets or Sets PaymentMethod /// - [JsonPropertyName("paymentMethod")] - public ResponsePaymentMethod PaymentMethod { get { return this.PaymentMethodOption; } set { this.PaymentMethodOption = new Option(value); } } - - /// - /// Used to track the state of PspReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PspReferenceOption { get; private set; } + [DataMember(Name = "paymentMethod", EmitDefaultValue = false)] + public ResponsePaymentMethod PaymentMethod { get; set; } /// /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. /// /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - [JsonPropertyName("pspReference")] - public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } - - /// - /// Used to track the state of RefusalReason - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RefusalReasonOption { get; private set; } + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + public string PspReference { get; set; } /// /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). /// /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [JsonPropertyName("refusalReason")] - public string RefusalReason { get { return this.RefusalReasonOption; } set { this.RefusalReasonOption = new Option(value); } } - - /// - /// Used to track the state of RefusalReasonCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RefusalReasonCodeOption { get; private set; } + [DataMember(Name = "refusalReason", EmitDefaultValue = false)] + public string RefusalReason { get; set; } /// /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). /// /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [JsonPropertyName("refusalReasonCode")] - public string RefusalReasonCode { get { return this.RefusalReasonCodeOption; } set { this.RefusalReasonCodeOption = new Option(value); } } - - /// - /// Used to track the state of ShopperLocale - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperLocaleOption { get; private set; } + [DataMember(Name = "refusalReasonCode", EmitDefaultValue = false)] + public string RefusalReasonCode { get; set; } /// /// The shopperLocale. /// /// The shopperLocale. - [JsonPropertyName("shopperLocale")] - public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2ResponseData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2ResponseDataOption { get; private set; } + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + public string ShopperLocale { get; set; } /// /// Gets or Sets ThreeDS2ResponseData /// - [JsonPropertyName("threeDS2ResponseData")] - public ThreeDS2ResponseData ThreeDS2ResponseData { get { return this.ThreeDS2ResponseDataOption; } set { this.ThreeDS2ResponseDataOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2Result - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2ResultOption { get; private set; } + [DataMember(Name = "threeDS2ResponseData", EmitDefaultValue = false)] + public ThreeDS2ResponseData ThreeDS2ResponseData { get; set; } /// /// Gets or Sets ThreeDS2Result /// - [JsonPropertyName("threeDS2Result")] - public ThreeDS2Result ThreeDS2Result { get { return this.ThreeDS2ResultOption; } set { this.ThreeDS2ResultOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSPaymentData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSPaymentDataOption { get; private set; } + [DataMember(Name = "threeDS2Result", EmitDefaultValue = false)] + public ThreeDS2Result ThreeDS2Result { get; set; } /// /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. /// /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. - [JsonPropertyName("threeDSPaymentData")] - public string ThreeDSPaymentData { get { return this.ThreeDSPaymentDataOption; } set { this.ThreeDSPaymentDataOption = new Option(value); } } + [DataMember(Name = "threeDSPaymentData", EmitDefaultValue = false)] + public string ThreeDSPaymentData { get; set; } /// /// Returns the string presentation of the object @@ -536,300 +289,191 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentDetailsResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentDetailsResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option> additionalData = default; - Option amount = default; - Option donationToken = default; - Option fraudResult = default; - Option merchantReference = default; - Option order = default; - Option paymentMethod = default; - Option pspReference = default; - Option refusalReason = default; - Option refusalReasonCode = default; - Option resultCode = default; - Option shopperLocale = default; - Option threeDS2ResponseData = default; - Option threeDS2Result = default; - Option threeDSPaymentData = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "additionalData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "donationToken": - donationToken = new Option(utf8JsonReader.GetString()); - break; - case "fraudResult": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fraudResult = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantReference": - merchantReference = new Option(utf8JsonReader.GetString()); - break; - case "order": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - order = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "paymentMethod": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "refusalReason": - refusalReason = new Option(utf8JsonReader.GetString()); - break; - case "refusalReasonCode": - refusalReasonCode = new Option(utf8JsonReader.GetString()); - break; - case "resultCode": - string resultCodeRawValue = utf8JsonReader.GetString(); - if (resultCodeRawValue != null) - resultCode = new Option(PaymentDetailsResponse.ResultCodeEnumFromStringOrDefault(resultCodeRawValue)); - break; - case "shopperLocale": - shopperLocale = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2ResponseData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDS2ResponseData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDS2Result": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDS2Result = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDSPaymentData": - threeDSPaymentData = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (additionalData.IsSet && additionalData.Value == null) - throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class PaymentDetailsResponse."); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentDetailsResponse."); - - if (donationToken.IsSet && donationToken.Value == null) - throw new ArgumentNullException(nameof(donationToken), "Property is not nullable for class PaymentDetailsResponse."); - - if (fraudResult.IsSet && fraudResult.Value == null) - throw new ArgumentNullException(nameof(fraudResult), "Property is not nullable for class PaymentDetailsResponse."); - - if (merchantReference.IsSet && merchantReference.Value == null) - throw new ArgumentNullException(nameof(merchantReference), "Property is not nullable for class PaymentDetailsResponse."); - - if (order.IsSet && order.Value == null) - throw new ArgumentNullException(nameof(order), "Property is not nullable for class PaymentDetailsResponse."); - - if (paymentMethod.IsSet && paymentMethod.Value == null) - throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class PaymentDetailsResponse."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentDetailsResponse."); - - if (refusalReason.IsSet && refusalReason.Value == null) - throw new ArgumentNullException(nameof(refusalReason), "Property is not nullable for class PaymentDetailsResponse."); - - if (refusalReasonCode.IsSet && refusalReasonCode.Value == null) - throw new ArgumentNullException(nameof(refusalReasonCode), "Property is not nullable for class PaymentDetailsResponse."); - - if (resultCode.IsSet && resultCode.Value == null) - throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class PaymentDetailsResponse."); - - if (shopperLocale.IsSet && shopperLocale.Value == null) - throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class PaymentDetailsResponse."); - - if (threeDS2ResponseData.IsSet && threeDS2ResponseData.Value == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData), "Property is not nullable for class PaymentDetailsResponse."); - - if (threeDS2Result.IsSet && threeDS2Result.Value == null) - throw new ArgumentNullException(nameof(threeDS2Result), "Property is not nullable for class PaymentDetailsResponse."); - - if (threeDSPaymentData.IsSet && threeDSPaymentData.Value == null) - throw new ArgumentNullException(nameof(threeDSPaymentData), "Property is not nullable for class PaymentDetailsResponse."); - - return new PaymentDetailsResponse(additionalData, amount, donationToken, fraudResult, merchantReference, order, paymentMethod, pspReference, refusalReason, refusalReasonCode, resultCode, shopperLocale, threeDS2ResponseData, threeDS2Result, threeDSPaymentData); + return this.Equals(input as PaymentDetailsResponse); } /// - /// Serializes a + /// Returns true if PaymentDetailsResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentDetailsResponse paymentDetailsResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentDetailsResponse to be compared + /// Boolean + public bool Equals(PaymentDetailsResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, paymentDetailsResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + input.AdditionalData != null && + this.AdditionalData.SequenceEqual(input.AdditionalData) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.DonationToken == input.DonationToken || + (this.DonationToken != null && + this.DonationToken.Equals(input.DonationToken)) + ) && + ( + this.FraudResult == input.FraudResult || + (this.FraudResult != null && + this.FraudResult.Equals(input.FraudResult)) + ) && + ( + this.MerchantReference == input.MerchantReference || + (this.MerchantReference != null && + this.MerchantReference.Equals(input.MerchantReference)) + ) && + ( + this.Order == input.Order || + (this.Order != null && + this.Order.Equals(input.Order)) + ) && + ( + this.PaymentMethod == input.PaymentMethod || + (this.PaymentMethod != null && + this.PaymentMethod.Equals(input.PaymentMethod)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.RefusalReason == input.RefusalReason || + (this.RefusalReason != null && + this.RefusalReason.Equals(input.RefusalReason)) + ) && + ( + this.RefusalReasonCode == input.RefusalReasonCode || + (this.RefusalReasonCode != null && + this.RefusalReasonCode.Equals(input.RefusalReasonCode)) + ) && + ( + this.ResultCode == input.ResultCode || + this.ResultCode.Equals(input.ResultCode) + ) && + ( + this.ShopperLocale == input.ShopperLocale || + (this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale)) + ) && + ( + this.ThreeDS2ResponseData == input.ThreeDS2ResponseData || + (this.ThreeDS2ResponseData != null && + this.ThreeDS2ResponseData.Equals(input.ThreeDS2ResponseData)) + ) && + ( + this.ThreeDS2Result == input.ThreeDS2Result || + (this.ThreeDS2Result != null && + this.ThreeDS2Result.Equals(input.ThreeDS2Result)) + ) && + ( + this.ThreeDSPaymentData == input.ThreeDSPaymentData || + (this.ThreeDSPaymentData != null && + this.ThreeDSPaymentData.Equals(input.ThreeDSPaymentData)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentDetailsResponse paymentDetailsResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paymentDetailsResponse.AdditionalDataOption.IsSet && paymentDetailsResponse.AdditionalData == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.AdditionalData), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.AmountOption.IsSet && paymentDetailsResponse.Amount == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.Amount), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.DonationTokenOption.IsSet && paymentDetailsResponse.DonationToken == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.DonationToken), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.FraudResultOption.IsSet && paymentDetailsResponse.FraudResult == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.FraudResult), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.MerchantReferenceOption.IsSet && paymentDetailsResponse.MerchantReference == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.MerchantReference), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.OrderOption.IsSet && paymentDetailsResponse.Order == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.Order), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.PaymentMethodOption.IsSet && paymentDetailsResponse.PaymentMethod == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.PaymentMethod), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.PspReferenceOption.IsSet && paymentDetailsResponse.PspReference == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.PspReference), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.RefusalReasonOption.IsSet && paymentDetailsResponse.RefusalReason == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.RefusalReason), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.RefusalReasonCodeOption.IsSet && paymentDetailsResponse.RefusalReasonCode == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.RefusalReasonCode), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.ShopperLocaleOption.IsSet && paymentDetailsResponse.ShopperLocale == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.ShopperLocale), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.ThreeDS2ResponseDataOption.IsSet && paymentDetailsResponse.ThreeDS2ResponseData == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.ThreeDS2ResponseData), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.ThreeDS2ResultOption.IsSet && paymentDetailsResponse.ThreeDS2Result == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.ThreeDS2Result), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.ThreeDSPaymentDataOption.IsSet && paymentDetailsResponse.ThreeDSPaymentData == null) - throw new ArgumentNullException(nameof(paymentDetailsResponse.ThreeDSPaymentData), "Property is required for class PaymentDetailsResponse."); - - if (paymentDetailsResponse.AdditionalDataOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("additionalData"); - JsonSerializer.Serialize(writer, paymentDetailsResponse.AdditionalData, jsonSerializerOptions); - } - if (paymentDetailsResponse.AmountOption.IsSet) - { - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, paymentDetailsResponse.Amount, jsonSerializerOptions); - } - if (paymentDetailsResponse.DonationTokenOption.IsSet) - writer.WriteString("donationToken", paymentDetailsResponse.DonationToken); - - if (paymentDetailsResponse.FraudResultOption.IsSet) - { - writer.WritePropertyName("fraudResult"); - JsonSerializer.Serialize(writer, paymentDetailsResponse.FraudResult, jsonSerializerOptions); - } - if (paymentDetailsResponse.MerchantReferenceOption.IsSet) - writer.WriteString("merchantReference", paymentDetailsResponse.MerchantReference); - - if (paymentDetailsResponse.OrderOption.IsSet) - { - writer.WritePropertyName("order"); - JsonSerializer.Serialize(writer, paymentDetailsResponse.Order, jsonSerializerOptions); - } - if (paymentDetailsResponse.PaymentMethodOption.IsSet) - { - writer.WritePropertyName("paymentMethod"); - JsonSerializer.Serialize(writer, paymentDetailsResponse.PaymentMethod, jsonSerializerOptions); - } - if (paymentDetailsResponse.PspReferenceOption.IsSet) - writer.WriteString("pspReference", paymentDetailsResponse.PspReference); - - if (paymentDetailsResponse.RefusalReasonOption.IsSet) - writer.WriteString("refusalReason", paymentDetailsResponse.RefusalReason); - - if (paymentDetailsResponse.RefusalReasonCodeOption.IsSet) - writer.WriteString("refusalReasonCode", paymentDetailsResponse.RefusalReasonCode); - - var resultCodeRawValue = PaymentDetailsResponse.ResultCodeEnumToJsonValue(paymentDetailsResponse.ResultCodeOption.Value.Value); - writer.WriteString("resultCode", resultCodeRawValue); - if (paymentDetailsResponse.ShopperLocaleOption.IsSet) - writer.WriteString("shopperLocale", paymentDetailsResponse.ShopperLocale); - - if (paymentDetailsResponse.ThreeDS2ResponseDataOption.IsSet) - { - writer.WritePropertyName("threeDS2ResponseData"); - JsonSerializer.Serialize(writer, paymentDetailsResponse.ThreeDS2ResponseData, jsonSerializerOptions); - } - if (paymentDetailsResponse.ThreeDS2ResultOption.IsSet) - { - writer.WritePropertyName("threeDS2Result"); - JsonSerializer.Serialize(writer, paymentDetailsResponse.ThreeDS2Result, jsonSerializerOptions); + int hashCode = 41; + if (this.AdditionalData != null) + { + hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.DonationToken != null) + { + hashCode = (hashCode * 59) + this.DonationToken.GetHashCode(); + } + if (this.FraudResult != null) + { + hashCode = (hashCode * 59) + this.FraudResult.GetHashCode(); + } + if (this.MerchantReference != null) + { + hashCode = (hashCode * 59) + this.MerchantReference.GetHashCode(); + } + if (this.Order != null) + { + hashCode = (hashCode * 59) + this.Order.GetHashCode(); + } + if (this.PaymentMethod != null) + { + hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + if (this.RefusalReason != null) + { + hashCode = (hashCode * 59) + this.RefusalReason.GetHashCode(); + } + if (this.RefusalReasonCode != null) + { + hashCode = (hashCode * 59) + this.RefusalReasonCode.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ResultCode.GetHashCode(); + if (this.ShopperLocale != null) + { + hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); + } + if (this.ThreeDS2ResponseData != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2ResponseData.GetHashCode(); + } + if (this.ThreeDS2Result != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2Result.GetHashCode(); + } + if (this.ThreeDSPaymentData != null) + { + hashCode = (hashCode * 59) + this.ThreeDSPaymentData.GetHashCode(); + } + return hashCode; } - if (paymentDetailsResponse.ThreeDSPaymentDataOption.IsSet) - writer.WriteString("threeDSPaymentData", paymentDetailsResponse.ThreeDSPaymentData); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentLinkRequest.cs b/Adyen/Model/Checkout/PaymentLinkRequest.cs index db78e3b1f..b21f923cb 100644 --- a/Adyen/Model/Checkout/PaymentLinkRequest.cs +++ b/Adyen/Model/Checkout/PaymentLinkRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,941 +15,496 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentLinkRequest /// - public partial class PaymentLinkRequest : IValidatableObject + [DataContract(Name = "PaymentLinkRequest")] + public partial class PaymentLinkRequest : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The merchant account identifier for which the payment link is created. - /// A reference that is used to uniquely identify the payment in future communications about the payment status. - /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - /// applicationInfo - /// billingAddress - /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - /// The delay between the authorisation and scheduled auto-capture, specified in hours. - /// The shopper's two-letter country code. - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - /// deliveryAddress - /// A short description visible on the payment page. Maximum length: 280 characters. - /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. - /// fundOrigin - /// fundRecipient - /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip. - /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. - /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. - /// platformChargebackLogic - /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. - /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. - /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. - /// riskData - /// The shopper's email address. - /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). - /// shopperName - /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - /// Set to **false** to hide the button that lets the shopper remove a stored payment method. (default to true) - /// The shopper's social security number. - /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false) - /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - /// The physical store, for which this payment is processed. - /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. - /// The shopper's telephone number. - /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. - /// threeDS2RequestData - [JsonConstructor] - public PaymentLinkRequest(Amount amount, string merchantAccount, string reference, Option> allowedPaymentMethods = default, Option applicationInfo = default, Option
billingAddress = default, Option> blockedPaymentMethods = default, Option captureDelayHours = default, Option countryCode = default, Option dateOfBirth = default, Option deliverAt = default, Option
deliveryAddress = default, Option description = default, Option expiresAt = default, Option fundOrigin = default, Option fundRecipient = default, Option> installmentOptions = default, Option> lineItems = default, Option manualCapture = default, Option mcc = default, Option merchantOrderReference = default, Option> metadata = default, Option platformChargebackLogic = default, Option recurringProcessingModel = default, Option> requiredShopperFields = default, Option returnUrl = default, Option reusable = default, Option riskData = default, Option shopperEmail = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option shopperStatement = default, Option showRemovePaymentMethodButton = default, Option socialSecurityNumber = default, Option splitCardFundingSources = default, Option> splits = default, Option store = default, Option storePaymentMethodMode = default, Option telephoneNumber = default, Option themeId = default, Option threeDS2RequestData = default) - { - Amount = amount; - MerchantAccount = merchantAccount; - Reference = reference; - AllowedPaymentMethodsOption = allowedPaymentMethods; - ApplicationInfoOption = applicationInfo; - BillingAddressOption = billingAddress; - BlockedPaymentMethodsOption = blockedPaymentMethods; - CaptureDelayHoursOption = captureDelayHours; - CountryCodeOption = countryCode; - DateOfBirthOption = dateOfBirth; - DeliverAtOption = deliverAt; - DeliveryAddressOption = deliveryAddress; - DescriptionOption = description; - ExpiresAtOption = expiresAt; - FundOriginOption = fundOrigin; - FundRecipientOption = fundRecipient; - InstallmentOptionsOption = installmentOptions; - LineItemsOption = lineItems; - ManualCaptureOption = manualCapture; - MccOption = mcc; - MerchantOrderReferenceOption = merchantOrderReference; - MetadataOption = metadata; - PlatformChargebackLogicOption = platformChargebackLogic; - RecurringProcessingModelOption = recurringProcessingModel; - RequiredShopperFieldsOption = requiredShopperFields; - ReturnUrlOption = returnUrl; - ReusableOption = reusable; - RiskDataOption = riskData; - ShopperEmailOption = shopperEmail; - ShopperLocaleOption = shopperLocale; - ShopperNameOption = shopperName; - ShopperReferenceOption = shopperReference; - ShopperStatementOption = shopperStatement; - ShowRemovePaymentMethodButtonOption = showRemovePaymentMethodButton; - SocialSecurityNumberOption = socialSecurityNumber; - SplitCardFundingSourcesOption = splitCardFundingSources; - SplitsOption = splits; - StoreOption = store; - StorePaymentMethodModeOption = storePaymentMethodMode; - TelephoneNumberOption = telephoneNumber; - ThemeIdOption = themeId; - ThreeDS2RequestDataOption = threeDS2RequestData; - OnCreated(); - } - - partial void OnCreated(); - /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// + [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// + [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// + [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 - } - /// - /// Returns a - /// - /// - /// - /// - public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) - { - if (value == RecurringProcessingModelEnum.CardOnFile) - return "CardOnFile"; - - if (value == RecurringProcessingModelEnum.Subscription) - return "Subscription"; - - if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) - return "UnscheduledCardOnFile"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of RecurringProcessingModel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonPropertyName("recurringProcessingModel")] - public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } - + [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] + public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } /// /// Defines RequiredShopperFields /// + [JsonConverter(typeof(StringEnumConverter))] public enum RequiredShopperFieldsEnum { /// /// Enum BillingAddress for value: billingAddress /// + [EnumMember(Value = "billingAddress")] BillingAddress = 1, /// /// Enum DeliveryAddress for value: deliveryAddress /// + [EnumMember(Value = "deliveryAddress")] DeliveryAddress = 2, /// /// Enum ShopperEmail for value: shopperEmail /// + [EnumMember(Value = "shopperEmail")] ShopperEmail = 3, /// /// Enum ShopperName for value: shopperName /// + [EnumMember(Value = "shopperName")] ShopperName = 4, /// /// Enum TelephoneNumber for value: telephoneNumber /// + [EnumMember(Value = "telephoneNumber")] TelephoneNumber = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredShopperFieldsEnum RequiredShopperFieldsEnumFromString(string value) - { - if (value.Equals("billingAddress")) - return RequiredShopperFieldsEnum.BillingAddress; - - if (value.Equals("deliveryAddress")) - return RequiredShopperFieldsEnum.DeliveryAddress; - if (value.Equals("shopperEmail")) - return RequiredShopperFieldsEnum.ShopperEmail; - - if (value.Equals("shopperName")) - return RequiredShopperFieldsEnum.ShopperName; - - if (value.Equals("telephoneNumber")) - return RequiredShopperFieldsEnum.TelephoneNumber; - - throw new NotImplementedException($"Could not convert value to type RequiredShopperFieldsEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static RequiredShopperFieldsEnum? RequiredShopperFieldsEnumFromStringOrDefault(string value) - { - if (value.Equals("billingAddress")) - return RequiredShopperFieldsEnum.BillingAddress; - - if (value.Equals("deliveryAddress")) - return RequiredShopperFieldsEnum.DeliveryAddress; - if (value.Equals("shopperEmail")) - return RequiredShopperFieldsEnum.ShopperEmail; - - if (value.Equals("shopperName")) - return RequiredShopperFieldsEnum.ShopperName; - - if (value.Equals("telephoneNumber")) - return RequiredShopperFieldsEnum.TelephoneNumber; - - return null; - } /// - /// Converts the to the json value + /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. /// - /// - /// - /// - public static string RequiredShopperFieldsEnumToJsonValue(RequiredShopperFieldsEnum value) - { - if (value == RequiredShopperFieldsEnum.BillingAddress) - return "billingAddress"; - - if (value == RequiredShopperFieldsEnum.DeliveryAddress) - return "deliveryAddress"; - - if (value == RequiredShopperFieldsEnum.ShopperEmail) - return "shopperEmail"; - - if (value == RequiredShopperFieldsEnum.ShopperName) - return "shopperName"; - - if (value == RequiredShopperFieldsEnum.TelephoneNumber) - return "telephoneNumber"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - + /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + [DataMember(Name = "requiredShopperFields", EmitDefaultValue = false)] + public List RequiredShopperFields { get; set; } /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. + [JsonConverter(typeof(StringEnumConverter))] public enum StorePaymentMethodModeEnum { /// /// Enum AskForConsent for value: askForConsent /// + [EnumMember(Value = "askForConsent")] AskForConsent = 1, /// /// Enum Disabled for value: disabled /// + [EnumMember(Value = "disabled")] Disabled = 2, /// /// Enum Enabled for value: enabled /// + [EnumMember(Value = "enabled")] Enabled = 3 - } - /// - /// Returns a - /// - /// - /// - /// - public static StorePaymentMethodModeEnum StorePaymentMethodModeEnumFromString(string value) - { - if (value.Equals("askForConsent")) - return StorePaymentMethodModeEnum.AskForConsent; - - if (value.Equals("disabled")) - return StorePaymentMethodModeEnum.Disabled; - - if (value.Equals("enabled")) - return StorePaymentMethodModeEnum.Enabled; - - throw new NotImplementedException($"Could not convert value to type StorePaymentMethodModeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static StorePaymentMethodModeEnum? StorePaymentMethodModeEnumFromStringOrDefault(string value) - { - if (value.Equals("askForConsent")) - return StorePaymentMethodModeEnum.AskForConsent; - - if (value.Equals("disabled")) - return StorePaymentMethodModeEnum.Disabled; - - if (value.Equals("enabled")) - return StorePaymentMethodModeEnum.Enabled; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string StorePaymentMethodModeEnumToJsonValue(StorePaymentMethodModeEnum? value) - { - if (value == StorePaymentMethodModeEnum.AskForConsent) - return "askForConsent"; - - if (value == StorePaymentMethodModeEnum.Disabled) - return "disabled"; - - if (value == StorePaymentMethodModeEnum.Enabled) - return "enabled"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of StorePaymentMethodMode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StorePaymentMethodModeOption { get; private set; } /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. - [JsonPropertyName("storePaymentMethodMode")] - public StorePaymentMethodModeEnum? StorePaymentMethodMode { get { return this.StorePaymentMethodModeOption; } set { this.StorePaymentMethodModeOption = new Option(value); } } - - /// - /// Gets or Sets Amount - /// - [JsonPropertyName("amount")] - public Amount Amount { get; set; } - + [DataMember(Name = "storePaymentMethodMode", EmitDefaultValue = false)] + public StorePaymentMethodModeEnum? StorePaymentMethodMode { get; set; } /// - /// The merchant account identifier for which the payment link is created. + /// Initializes a new instance of the class. /// - /// The merchant account identifier for which the payment link is created. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } - + [JsonConstructorAttribute] + protected PaymentLinkRequest() { } /// - /// A reference that is used to uniquely identify the payment in future communications about the payment status. - /// - /// A reference that is used to uniquely identify the payment in future communications about the payment status. - [JsonPropertyName("reference")] - public string Reference { get; set; } - - /// - /// Used to track the state of AllowedPaymentMethods + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AllowedPaymentMethodsOption { get; private set; } + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]`. + /// amount (required). + /// applicationInfo. + /// billingAddress. + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]`. + /// The delay between the authorisation and scheduled auto-capture, specified in hours.. + /// The shopper's two-letter country code.. + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. + /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.. + /// deliveryAddress. + /// A short description visible on the payment page. Maximum length: 280 characters.. + /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created.. + /// fundOrigin. + /// fundRecipient. + /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options.. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip.. + /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture).. + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. + /// The merchant account identifier for which the payment link is created. (required). + /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle.. + /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID.. + /// platformChargebackLogic. + /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . + /// A reference that is used to uniquely identify the payment in future communications about the payment status. (required). + /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. . + /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL.. + /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only.. + /// riskData. + /// The shopper's email address.. + /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language).. + /// shopperName. + /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. + /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**.. + /// Set to **false** to hide the button that lets the shopper remove a stored payment method. (default to true). + /// The shopper's social security number.. + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false). + /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).. + /// The physical store, for which this payment is processed.. + /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter.. + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication.. + /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area.. + /// threeDS2RequestData. + public PaymentLinkRequest(List allowedPaymentMethods = default(List), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), Address billingAddress = default(Address), List blockedPaymentMethods = default(List), int? captureDelayHours = default(int?), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), DateTime deliverAt = default(DateTime), Address deliveryAddress = default(Address), string description = default(string), DateTime expiresAt = default(DateTime), FundOrigin fundOrigin = default(FundOrigin), FundRecipient fundRecipient = default(FundRecipient), Dictionary installmentOptions = default(Dictionary), List lineItems = default(List), bool? manualCapture = default(bool?), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), Dictionary metadata = default(Dictionary), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string reference = default(string), List requiredShopperFields = default(List), string returnUrl = default(string), bool? reusable = default(bool?), RiskData riskData = default(RiskData), string shopperEmail = default(string), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), bool? showRemovePaymentMethodButton = true, string socialSecurityNumber = default(string), bool? splitCardFundingSources = false, List splits = default(List), string store = default(string), StorePaymentMethodModeEnum? storePaymentMethodMode = default(StorePaymentMethodModeEnum?), string telephoneNumber = default(string), string themeId = default(string), CheckoutSessionThreeDS2RequestData threeDS2RequestData = default(CheckoutSessionThreeDS2RequestData)) + { + this.Amount = amount; + this.MerchantAccount = merchantAccount; + this.Reference = reference; + this.AllowedPaymentMethods = allowedPaymentMethods; + this.ApplicationInfo = applicationInfo; + this.BillingAddress = billingAddress; + this.BlockedPaymentMethods = blockedPaymentMethods; + this.CaptureDelayHours = captureDelayHours; + this.CountryCode = countryCode; + this.DateOfBirth = dateOfBirth; + this.DeliverAt = deliverAt; + this.DeliveryAddress = deliveryAddress; + this.Description = description; + this.ExpiresAt = expiresAt; + this.FundOrigin = fundOrigin; + this.FundRecipient = fundRecipient; + this.InstallmentOptions = installmentOptions; + this.LineItems = lineItems; + this.ManualCapture = manualCapture; + this.Mcc = mcc; + this.MerchantOrderReference = merchantOrderReference; + this.Metadata = metadata; + this.PlatformChargebackLogic = platformChargebackLogic; + this.RecurringProcessingModel = recurringProcessingModel; + this.RequiredShopperFields = requiredShopperFields; + this.ReturnUrl = returnUrl; + this.Reusable = reusable; + this.RiskData = riskData; + this.ShopperEmail = shopperEmail; + this.ShopperLocale = shopperLocale; + this.ShopperName = shopperName; + this.ShopperReference = shopperReference; + this.ShopperStatement = shopperStatement; + this.ShowRemovePaymentMethodButton = showRemovePaymentMethodButton; + this.SocialSecurityNumber = socialSecurityNumber; + this.SplitCardFundingSources = splitCardFundingSources; + this.Splits = splits; + this.Store = store; + this.StorePaymentMethodMode = storePaymentMethodMode; + this.TelephoneNumber = telephoneNumber; + this.ThemeId = themeId; + this.ThreeDS2RequestData = threeDS2RequestData; + } /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - [JsonPropertyName("allowedPaymentMethods")] - public List AllowedPaymentMethods { get { return this.AllowedPaymentMethodsOption; } set { this.AllowedPaymentMethodsOption = new Option>(value); } } + [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] + public List AllowedPaymentMethods { get; set; } /// - /// Used to track the state of ApplicationInfo + /// Gets or Sets Amount /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ApplicationInfoOption { get; private set; } + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// Gets or Sets ApplicationInfo /// - [JsonPropertyName("applicationInfo")] - public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } - - /// - /// Used to track the state of BillingAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option
BillingAddressOption { get; private set; } + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } /// /// Gets or Sets BillingAddress /// - [JsonPropertyName("billingAddress")] - public Address BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option
(value); } } - - /// - /// Used to track the state of BlockedPaymentMethods - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> BlockedPaymentMethodsOption { get; private set; } + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public Address BillingAddress { get; set; } /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - [JsonPropertyName("blockedPaymentMethods")] - public List BlockedPaymentMethods { get { return this.BlockedPaymentMethodsOption; } set { this.BlockedPaymentMethodsOption = new Option>(value); } } - - /// - /// Used to track the state of CaptureDelayHours - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CaptureDelayHoursOption { get; private set; } + [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] + public List BlockedPaymentMethods { get; set; } /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. - [JsonPropertyName("captureDelayHours")] - public int? CaptureDelayHours { get { return this.CaptureDelayHoursOption; } set { this.CaptureDelayHoursOption = new Option(value); } } - - /// - /// Used to track the state of CountryCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CountryCodeOption { get; private set; } + [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] + public int? CaptureDelayHours { get; set; } /// /// The shopper's two-letter country code. /// /// The shopper's two-letter country code. - [JsonPropertyName("countryCode")] - public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } - - /// - /// Used to track the state of DateOfBirth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DateOfBirthOption { get; private set; } + [DataMember(Name = "countryCode", EmitDefaultValue = false)] + public string CountryCode { get; set; } /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - [JsonPropertyName("dateOfBirth")] - public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } - - /// - /// Used to track the state of DeliverAt - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliverAtOption { get; private set; } + [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime DateOfBirth { get; set; } /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [JsonPropertyName("deliverAt")] - public DateTime? DeliverAt { get { return this.DeliverAtOption; } set { this.DeliverAtOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option
DeliveryAddressOption { get; private set; } + [DataMember(Name = "deliverAt", EmitDefaultValue = false)] + public DateTime DeliverAt { get; set; } /// /// Gets or Sets DeliveryAddress /// - [JsonPropertyName("deliveryAddress")] - public Address DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option
(value); } } - - /// - /// Used to track the state of Description - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DescriptionOption { get; private set; } + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public Address DeliveryAddress { get; set; } /// /// A short description visible on the payment page. Maximum length: 280 characters. /// /// A short description visible on the payment page. Maximum length: 280 characters. - [JsonPropertyName("description")] - public string Description { get { return this.DescriptionOption; } set { this.DescriptionOption = new Option(value); } } - - /// - /// Used to track the state of ExpiresAt - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiresAtOption { get; private set; } + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } /// /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. /// /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. - [JsonPropertyName("expiresAt")] - public DateTime? ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } - - /// - /// Used to track the state of FundOrigin - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundOriginOption { get; private set; } + [DataMember(Name = "expiresAt", EmitDefaultValue = false)] + public DateTime ExpiresAt { get; set; } /// /// Gets or Sets FundOrigin /// - [JsonPropertyName("fundOrigin")] - public FundOrigin FundOrigin { get { return this.FundOriginOption; } set { this.FundOriginOption = new Option(value); } } - - /// - /// Used to track the state of FundRecipient - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundRecipientOption { get; private set; } + [DataMember(Name = "fundOrigin", EmitDefaultValue = false)] + public FundOrigin FundOrigin { get; set; } /// /// Gets or Sets FundRecipient /// - [JsonPropertyName("fundRecipient")] - public FundRecipient FundRecipient { get { return this.FundRecipientOption; } set { this.FundRecipientOption = new Option(value); } } - - /// - /// Used to track the state of InstallmentOptions - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> InstallmentOptionsOption { get; private set; } + [DataMember(Name = "fundRecipient", EmitDefaultValue = false)] + public FundRecipient FundRecipient { get; set; } /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. - [JsonPropertyName("installmentOptions")] - public Dictionary InstallmentOptions { get { return this.InstallmentOptionsOption; } set { this.InstallmentOptionsOption = new Option>(value); } } - - /// - /// Used to track the state of LineItems - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LineItemsOption { get; private set; } + [DataMember(Name = "installmentOptions", EmitDefaultValue = false)] + public Dictionary InstallmentOptions { get; set; } /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip. /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip. - [JsonPropertyName("lineItems")] - public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } - - /// - /// Used to track the state of ManualCapture - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ManualCaptureOption { get; private set; } + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } /// /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). /// /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). - [JsonPropertyName("manualCapture")] - public bool? ManualCapture { get { return this.ManualCaptureOption; } set { this.ManualCaptureOption = new Option(value); } } - - /// - /// Used to track the state of Mcc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MccOption { get; private set; } + [DataMember(Name = "manualCapture", EmitDefaultValue = false)] + public bool? ManualCapture { get; set; } /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - [JsonPropertyName("mcc")] - public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string Mcc { get; set; } /// - /// Used to track the state of MerchantOrderReference + /// The merchant account identifier for which the payment link is created. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantOrderReferenceOption { get; private set; } + /// The merchant account identifier for which the payment link is created. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. /// /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. - [JsonPropertyName("merchantOrderReference")] - public string MerchantOrderReference { get { return this.MerchantOrderReferenceOption; } set { this.MerchantOrderReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Metadata - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> MetadataOption { get; private set; } + [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] + public string MerchantOrderReference { get; set; } /// /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. /// /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. - [JsonPropertyName("metadata")] - public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } - - /// - /// Used to track the state of PlatformChargebackLogic - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PlatformChargebackLogicOption { get; private set; } + [DataMember(Name = "metadata", EmitDefaultValue = false)] + public Dictionary Metadata { get; set; } /// /// Gets or Sets PlatformChargebackLogic /// - [JsonPropertyName("platformChargebackLogic")] - public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } - - /// - /// Used to track the state of RequiredShopperFields - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> RequiredShopperFieldsOption { get; private set; } - - /// - /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. - /// - /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. - [JsonPropertyName("requiredShopperFields")] - public List RequiredShopperFields { get { return this.RequiredShopperFieldsOption; } set { this.RequiredShopperFieldsOption = new Option>(value); } } + [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] + public PlatformChargebackLogic PlatformChargebackLogic { get; set; } /// - /// Used to track the state of ReturnUrl + /// A reference that is used to uniquely identify the payment in future communications about the payment status. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReturnUrlOption { get; private set; } + /// A reference that is used to uniquely identify the payment in future communications about the payment status. + [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. /// /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. - [JsonPropertyName("returnUrl")] - public string ReturnUrl { get { return this.ReturnUrlOption; } set { this.ReturnUrlOption = new Option(value); } } - - /// - /// Used to track the state of Reusable - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReusableOption { get; private set; } + [DataMember(Name = "returnUrl", EmitDefaultValue = false)] + public string ReturnUrl { get; set; } /// /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. /// /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. - [JsonPropertyName("reusable")] - public bool? Reusable { get { return this.ReusableOption; } set { this.ReusableOption = new Option(value); } } - - /// - /// Used to track the state of RiskData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskDataOption { get; private set; } + [DataMember(Name = "reusable", EmitDefaultValue = false)] + public bool? Reusable { get; set; } /// /// Gets or Sets RiskData /// - [JsonPropertyName("riskData")] - public RiskData RiskData { get { return this.RiskDataOption; } set { this.RiskDataOption = new Option(value); } } - - /// - /// Used to track the state of ShopperEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + [DataMember(Name = "riskData", EmitDefaultValue = false)] + public RiskData RiskData { get; set; } /// /// The shopper's email address. /// /// The shopper's email address. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } - - /// - /// Used to track the state of ShopperLocale - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperLocaleOption { get; private set; } + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). /// /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). - [JsonPropertyName("shopperLocale")] - public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } - - /// - /// Used to track the state of ShopperName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNameOption { get; private set; } + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + public string ShopperLocale { get; set; } /// /// Gets or Sets ShopperName /// - [JsonPropertyName("shopperName")] - public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } - - /// - /// Used to track the state of ShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperReferenceOption { get; private set; } + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name ShopperName { get; set; } /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [JsonPropertyName("shopperReference")] - public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperStatement - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperStatementOption { get; private set; } + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - [JsonPropertyName("shopperStatement")] - public string ShopperStatement { get { return this.ShopperStatementOption; } set { this.ShopperStatementOption = new Option(value); } } - - /// - /// Used to track the state of ShowRemovePaymentMethodButton - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShowRemovePaymentMethodButtonOption { get; private set; } + [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] + public string ShopperStatement { get; set; } /// /// Set to **false** to hide the button that lets the shopper remove a stored payment method. /// /// Set to **false** to hide the button that lets the shopper remove a stored payment method. - [JsonPropertyName("showRemovePaymentMethodButton")] - public bool? ShowRemovePaymentMethodButton { get { return this.ShowRemovePaymentMethodButtonOption; } set { this.ShowRemovePaymentMethodButtonOption = new Option(value); } } - - /// - /// Used to track the state of SocialSecurityNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SocialSecurityNumberOption { get; private set; } + [DataMember(Name = "showRemovePaymentMethodButton", EmitDefaultValue = false)] + public bool? ShowRemovePaymentMethodButton { get; set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [JsonPropertyName("socialSecurityNumber")] - public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } - - /// - /// Used to track the state of SplitCardFundingSources - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SplitCardFundingSourcesOption { get; private set; } + [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] + public string SocialSecurityNumber { get; set; } /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. - [JsonPropertyName("splitCardFundingSources")] - public bool? SplitCardFundingSources { get { return this.SplitCardFundingSourcesOption; } set { this.SplitCardFundingSourcesOption = new Option(value); } } - - /// - /// Used to track the state of Splits - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SplitsOption { get; private set; } + [DataMember(Name = "splitCardFundingSources", EmitDefaultValue = false)] + public bool? SplitCardFundingSources { get; set; } /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - [JsonPropertyName("splits")] - public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } - - /// - /// Used to track the state of Store - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoreOption { get; private set; } + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// The physical store, for which this payment is processed. /// /// The physical store, for which this payment is processed. - [JsonPropertyName("store")] - public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } - - /// - /// Used to track the state of TelephoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TelephoneNumberOption { get; private set; } + [DataMember(Name = "store", EmitDefaultValue = false)] + public string Store { get; set; } /// - /// The shopper's telephone number. + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. /// - /// The shopper's telephone number. - [JsonPropertyName("telephoneNumber")] - public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } - - /// - /// Used to track the state of ThemeId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThemeIdOption { get; private set; } + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string TelephoneNumber { get; set; } /// /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. /// /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. - [JsonPropertyName("themeId")] - public string ThemeId { get { return this.ThemeIdOption; } set { this.ThemeIdOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2RequestData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2RequestDataOption { get; private set; } + [DataMember(Name = "themeId", EmitDefaultValue = false)] + public string ThemeId { get; set; } /// /// Gets or Sets ThreeDS2RequestData /// - [JsonPropertyName("threeDS2RequestData")] - public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } + [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] + public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get; set; } /// /// Returns the string presentation of the object @@ -958,10 +514,8 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentLinkRequest {\n"); - sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); sb.Append(" BlockedPaymentMethods: ").Append(BlockedPaymentMethods).Append("\n"); @@ -978,10 +532,12 @@ public override string ToString() sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" ManualCapture: ").Append(ManualCapture).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append(" PlatformChargebackLogic: ").Append(PlatformChargebackLogic).Append("\n"); sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" RequiredShopperFields: ").Append(RequiredShopperFields).Append("\n"); sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" Reusable: ").Append(Reusable).Append("\n"); @@ -1004,750 +560,478 @@ public override string ToString() return sb.ToString(); } + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PaymentLinkRequest); + } + + /// + /// Returns true if PaymentLinkRequest instances are equal + /// + /// Instance of PaymentLinkRequest to be compared + /// Boolean + public bool Equals(PaymentLinkRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.AllowedPaymentMethods == input.AllowedPaymentMethods || + this.AllowedPaymentMethods != null && + input.AllowedPaymentMethods != null && + this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.ApplicationInfo == input.ApplicationInfo || + (this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo)) + ) && + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.BlockedPaymentMethods == input.BlockedPaymentMethods || + this.BlockedPaymentMethods != null && + input.BlockedPaymentMethods != null && + this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) + ) && + ( + this.CaptureDelayHours == input.CaptureDelayHours || + this.CaptureDelayHours.Equals(input.CaptureDelayHours) + ) && + ( + this.CountryCode == input.CountryCode || + (this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode)) + ) && + ( + this.DateOfBirth == input.DateOfBirth || + (this.DateOfBirth != null && + this.DateOfBirth.Equals(input.DateOfBirth)) + ) && + ( + this.DeliverAt == input.DeliverAt || + (this.DeliverAt != null && + this.DeliverAt.Equals(input.DeliverAt)) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + (this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress)) + ) && + ( + this.Description == input.Description || + (this.Description != null && + this.Description.Equals(input.Description)) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) + ) && + ( + this.FundOrigin == input.FundOrigin || + (this.FundOrigin != null && + this.FundOrigin.Equals(input.FundOrigin)) + ) && + ( + this.FundRecipient == input.FundRecipient || + (this.FundRecipient != null && + this.FundRecipient.Equals(input.FundRecipient)) + ) && + ( + this.InstallmentOptions == input.InstallmentOptions || + this.InstallmentOptions != null && + input.InstallmentOptions != null && + this.InstallmentOptions.SequenceEqual(input.InstallmentOptions) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.ManualCapture == input.ManualCapture || + this.ManualCapture.Equals(input.ManualCapture) + ) && + ( + this.Mcc == input.Mcc || + (this.Mcc != null && + this.Mcc.Equals(input.Mcc)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.MerchantOrderReference == input.MerchantOrderReference || + (this.MerchantOrderReference != null && + this.MerchantOrderReference.Equals(input.MerchantOrderReference)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.PlatformChargebackLogic == input.PlatformChargebackLogic || + (this.PlatformChargebackLogic != null && + this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) + ) && + ( + this.RecurringProcessingModel == input.RecurringProcessingModel || + this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.RequiredShopperFields == input.RequiredShopperFields || + this.RequiredShopperFields.SequenceEqual(input.RequiredShopperFields) + ) && + ( + this.ReturnUrl == input.ReturnUrl || + (this.ReturnUrl != null && + this.ReturnUrl.Equals(input.ReturnUrl)) + ) && + ( + this.Reusable == input.Reusable || + this.Reusable.Equals(input.Reusable) + ) && + ( + this.RiskData == input.RiskData || + (this.RiskData != null && + this.RiskData.Equals(input.RiskData)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.ShopperLocale == input.ShopperLocale || + (this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale)) + ) && + ( + this.ShopperName == input.ShopperName || + (this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName)) + ) && + ( + this.ShopperReference == input.ShopperReference || + (this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference)) + ) && + ( + this.ShopperStatement == input.ShopperStatement || + (this.ShopperStatement != null && + this.ShopperStatement.Equals(input.ShopperStatement)) + ) && + ( + this.ShowRemovePaymentMethodButton == input.ShowRemovePaymentMethodButton || + this.ShowRemovePaymentMethodButton.Equals(input.ShowRemovePaymentMethodButton) + ) && + ( + this.SocialSecurityNumber == input.SocialSecurityNumber || + (this.SocialSecurityNumber != null && + this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) + ) && + ( + this.SplitCardFundingSources == input.SplitCardFundingSources || + this.SplitCardFundingSources.Equals(input.SplitCardFundingSources) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.Store == input.Store || + (this.Store != null && + this.Store.Equals(input.Store)) + ) && + ( + this.StorePaymentMethodMode == input.StorePaymentMethodMode || + this.StorePaymentMethodMode.Equals(input.StorePaymentMethodMode) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + (this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber)) + ) && + ( + this.ThemeId == input.ThemeId || + (this.ThemeId != null && + this.ThemeId.Equals(input.ThemeId)) + ) && + ( + this.ThreeDS2RequestData == input.ThreeDS2RequestData || + (this.ThreeDS2RequestData != null && + this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AllowedPaymentMethods != null) + { + hashCode = (hashCode * 59) + this.AllowedPaymentMethods.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.ApplicationInfo != null) + { + hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); + } + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.BlockedPaymentMethods != null) + { + hashCode = (hashCode * 59) + this.BlockedPaymentMethods.GetHashCode(); + } + hashCode = (hashCode * 59) + this.CaptureDelayHours.GetHashCode(); + if (this.CountryCode != null) + { + hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); + } + if (this.DateOfBirth != null) + { + hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); + } + if (this.DeliverAt != null) + { + hashCode = (hashCode * 59) + this.DeliverAt.GetHashCode(); + } + if (this.DeliveryAddress != null) + { + hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); + } + if (this.Description != null) + { + hashCode = (hashCode * 59) + this.Description.GetHashCode(); + } + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } + if (this.FundOrigin != null) + { + hashCode = (hashCode * 59) + this.FundOrigin.GetHashCode(); + } + if (this.FundRecipient != null) + { + hashCode = (hashCode * 59) + this.FundRecipient.GetHashCode(); + } + if (this.InstallmentOptions != null) + { + hashCode = (hashCode * 59) + this.InstallmentOptions.GetHashCode(); + } + if (this.LineItems != null) + { + hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ManualCapture.GetHashCode(); + if (this.Mcc != null) + { + hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.MerchantOrderReference != null) + { + hashCode = (hashCode * 59) + this.MerchantOrderReference.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + if (this.PlatformChargebackLogic != null) + { + hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RequiredShopperFields.GetHashCode(); + if (this.ReturnUrl != null) + { + hashCode = (hashCode * 59) + this.ReturnUrl.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Reusable.GetHashCode(); + if (this.RiskData != null) + { + hashCode = (hashCode * 59) + this.RiskData.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.ShopperLocale != null) + { + hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); + } + if (this.ShopperName != null) + { + hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); + } + if (this.ShopperReference != null) + { + hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); + } + if (this.ShopperStatement != null) + { + hashCode = (hashCode * 59) + this.ShopperStatement.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ShowRemovePaymentMethodButton.GetHashCode(); + if (this.SocialSecurityNumber != null) + { + hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); + } + hashCode = (hashCode * 59) + this.SplitCardFundingSources.GetHashCode(); + if (this.Splits != null) + { + hashCode = (hashCode * 59) + this.Splits.GetHashCode(); + } + if (this.Store != null) + { + hashCode = (hashCode * 59) + this.Store.GetHashCode(); + } + hashCode = (hashCode * 59) + this.StorePaymentMethodMode.GetHashCode(); + if (this.TelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); + } + if (this.ThemeId != null) + { + hashCode = (hashCode * 59) + this.ThemeId.GetHashCode(); + } + if (this.ThreeDS2RequestData != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); + } + return hashCode; + } + } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { // CountryCode (string) maxLength if (this.CountryCode != null && this.CountryCode.Length > 100) { - yield return new ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); } // Mcc (string) maxLength if (this.Mcc != null && this.Mcc.Length > 16) { - yield return new ValidationResult("Invalid value for Mcc, length must be less than 16.", new [] { "Mcc" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Mcc, length must be less than 16.", new [] { "Mcc" }); } // MerchantOrderReference (string) maxLength if (this.MerchantOrderReference != null && this.MerchantOrderReference.Length > 1000) { - yield return new ValidationResult("Invalid value for MerchantOrderReference, length must be less than 1000.", new [] { "MerchantOrderReference" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for MerchantOrderReference, length must be less than 1000.", new [] { "MerchantOrderReference" }); } // ReturnUrl (string) maxLength if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) { - yield return new ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); } // ShopperEmail (string) maxLength if (this.ShopperEmail != null && this.ShopperEmail.Length > 500) { - yield return new ValidationResult("Invalid value for ShopperEmail, length must be less than 500.", new [] { "ShopperEmail" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperEmail, length must be less than 500.", new [] { "ShopperEmail" }); } // ShopperLocale (string) maxLength if (this.ShopperLocale != null && this.ShopperLocale.Length > 32) { - yield return new ValidationResult("Invalid value for ShopperLocale, length must be less than 32.", new [] { "ShopperLocale" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperLocale, length must be less than 32.", new [] { "ShopperLocale" }); } // ShopperReference (string) maxLength if (this.ShopperReference != null && this.ShopperReference.Length > 256) { - yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); } // ShopperReference (string) minLength if (this.ShopperReference != null && this.ShopperReference.Length < 3) { - yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); } // ShopperStatement (string) maxLength if (this.ShopperStatement != null && this.ShopperStatement.Length > 10000) { - yield return new ValidationResult("Invalid value for ShopperStatement, length must be less than 10000.", new [] { "ShopperStatement" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperStatement, length must be less than 10000.", new [] { "ShopperStatement" }); } // SocialSecurityNumber (string) maxLength if (this.SocialSecurityNumber != null && this.SocialSecurityNumber.Length > 32) { - yield return new ValidationResult("Invalid value for SocialSecurityNumber, length must be less than 32.", new [] { "SocialSecurityNumber" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for SocialSecurityNumber, length must be less than 32.", new [] { "SocialSecurityNumber" }); } // TelephoneNumber (string) maxLength if (this.TelephoneNumber != null && this.TelephoneNumber.Length > 32) { - yield return new ValidationResult("Invalid value for TelephoneNumber, length must be less than 32.", new [] { "TelephoneNumber" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TelephoneNumber, length must be less than 32.", new [] { "TelephoneNumber" }); } yield break; } } - /// - /// A Json converter for type - /// - public class PaymentLinkRequestJsonConverter : JsonConverter - { - /// - /// The format to use to serialize DateOfBirth - /// - public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd"; - - /// - /// The format to use to serialize DeliverAt - /// - public static string DeliverAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - - /// - /// The format to use to serialize ExpiresAt - /// - public static string ExpiresAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - - /// - /// Deserializes json to - /// - /// - /// - /// - /// - /// - public override PaymentLinkRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) - { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option merchantAccount = default; - Option reference = default; - Option> allowedPaymentMethods = default; - Option applicationInfo = default; - Option
billingAddress = default; - Option> blockedPaymentMethods = default; - Option captureDelayHours = default; - Option countryCode = default; - Option dateOfBirth = default; - Option deliverAt = default; - Option
deliveryAddress = default; - Option description = default; - Option expiresAt = default; - Option fundOrigin = default; - Option fundRecipient = default; - Option> installmentOptions = default; - Option> lineItems = default; - Option manualCapture = default; - Option mcc = default; - Option merchantOrderReference = default; - Option> metadata = default; - Option platformChargebackLogic = default; - Option recurringProcessingModel = default; - Option> requiredShopperFields = default; - Option returnUrl = default; - Option reusable = default; - Option riskData = default; - Option shopperEmail = default; - Option shopperLocale = default; - Option shopperName = default; - Option shopperReference = default; - Option shopperStatement = default; - Option showRemovePaymentMethodButton = default; - Option socialSecurityNumber = default; - Option splitCardFundingSources = default; - Option> splits = default; - Option store = default; - Option storePaymentMethodMode = default; - Option telephoneNumber = default; - Option themeId = default; - Option threeDS2RequestData = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "allowedPaymentMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - allowedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "applicationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "billingAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - billingAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "blockedPaymentMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - blockedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "captureDelayHours": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - captureDelayHours = new Option(utf8JsonReader.GetInt32()); - break; - case "countryCode": - countryCode = new Option(utf8JsonReader.GetString()); - break; - case "dateOfBirth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliverAt": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliverAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliveryAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliveryAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "description": - description = new Option(utf8JsonReader.GetString()); - break; - case "expiresAt": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - expiresAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "fundOrigin": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fundOrigin = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "fundRecipient": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fundRecipient = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "installmentOptions": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - installmentOptions = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "lineItems": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "manualCapture": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - manualCapture = new Option(utf8JsonReader.GetBoolean()); - break; - case "mcc": - mcc = new Option(utf8JsonReader.GetString()); - break; - case "merchantOrderReference": - merchantOrderReference = new Option(utf8JsonReader.GetString()); - break; - case "metadata": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "platformChargebackLogic": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "recurringProcessingModel": - string recurringProcessingModelRawValue = utf8JsonReader.GetString(); - if (recurringProcessingModelRawValue != null) - recurringProcessingModel = new Option(PaymentLinkRequest.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); - break; - case "requiredShopperFields": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredShopperFields = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "returnUrl": - returnUrl = new Option(utf8JsonReader.GetString()); - break; - case "reusable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - reusable = new Option(utf8JsonReader.GetBoolean()); - break; - case "riskData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - riskData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "shopperLocale": - shopperLocale = new Option(utf8JsonReader.GetString()); - break; - case "shopperName": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperReference": - shopperReference = new Option(utf8JsonReader.GetString()); - break; - case "shopperStatement": - shopperStatement = new Option(utf8JsonReader.GetString()); - break; - case "showRemovePaymentMethodButton": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - showRemovePaymentMethodButton = new Option(utf8JsonReader.GetBoolean()); - break; - case "socialSecurityNumber": - socialSecurityNumber = new Option(utf8JsonReader.GetString()); - break; - case "splitCardFundingSources": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splitCardFundingSources = new Option(utf8JsonReader.GetBoolean()); - break; - case "splits": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "store": - store = new Option(utf8JsonReader.GetString()); - break; - case "storePaymentMethodMode": - string storePaymentMethodModeRawValue = utf8JsonReader.GetString(); - if (storePaymentMethodModeRawValue != null) - storePaymentMethodMode = new Option(PaymentLinkRequest.StorePaymentMethodModeEnumFromStringOrDefault(storePaymentMethodModeRawValue)); - break; - case "telephoneNumber": - telephoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "themeId": - themeId = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2RequestData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class PaymentLinkRequest.", nameof(amount)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentLinkRequest.", nameof(merchantAccount)); - - if (!reference.IsSet) - throw new ArgumentException("Property is required for class PaymentLinkRequest.", nameof(reference)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentLinkRequest."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentLinkRequest."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentLinkRequest."); - - if (allowedPaymentMethods.IsSet && allowedPaymentMethods.Value == null) - throw new ArgumentNullException(nameof(allowedPaymentMethods), "Property is not nullable for class PaymentLinkRequest."); - - if (applicationInfo.IsSet && applicationInfo.Value == null) - throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentLinkRequest."); - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class PaymentLinkRequest."); - - if (blockedPaymentMethods.IsSet && blockedPaymentMethods.Value == null) - throw new ArgumentNullException(nameof(blockedPaymentMethods), "Property is not nullable for class PaymentLinkRequest."); - - if (captureDelayHours.IsSet && captureDelayHours.Value == null) - throw new ArgumentNullException(nameof(captureDelayHours), "Property is not nullable for class PaymentLinkRequest."); - - if (countryCode.IsSet && countryCode.Value == null) - throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class PaymentLinkRequest."); - - if (dateOfBirth.IsSet && dateOfBirth.Value == null) - throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class PaymentLinkRequest."); - - if (deliverAt.IsSet && deliverAt.Value == null) - throw new ArgumentNullException(nameof(deliverAt), "Property is not nullable for class PaymentLinkRequest."); - - if (deliveryAddress.IsSet && deliveryAddress.Value == null) - throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class PaymentLinkRequest."); - - if (description.IsSet && description.Value == null) - throw new ArgumentNullException(nameof(description), "Property is not nullable for class PaymentLinkRequest."); - - if (expiresAt.IsSet && expiresAt.Value == null) - throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class PaymentLinkRequest."); - - if (fundOrigin.IsSet && fundOrigin.Value == null) - throw new ArgumentNullException(nameof(fundOrigin), "Property is not nullable for class PaymentLinkRequest."); - - if (fundRecipient.IsSet && fundRecipient.Value == null) - throw new ArgumentNullException(nameof(fundRecipient), "Property is not nullable for class PaymentLinkRequest."); - - if (installmentOptions.IsSet && installmentOptions.Value == null) - throw new ArgumentNullException(nameof(installmentOptions), "Property is not nullable for class PaymentLinkRequest."); - - if (lineItems.IsSet && lineItems.Value == null) - throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentLinkRequest."); - - if (manualCapture.IsSet && manualCapture.Value == null) - throw new ArgumentNullException(nameof(manualCapture), "Property is not nullable for class PaymentLinkRequest."); - - if (mcc.IsSet && mcc.Value == null) - throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class PaymentLinkRequest."); - - if (merchantOrderReference.IsSet && merchantOrderReference.Value == null) - throw new ArgumentNullException(nameof(merchantOrderReference), "Property is not nullable for class PaymentLinkRequest."); - - if (metadata.IsSet && metadata.Value == null) - throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class PaymentLinkRequest."); - - if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) - throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class PaymentLinkRequest."); - - if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) - throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class PaymentLinkRequest."); - - if (requiredShopperFields.IsSet && requiredShopperFields.Value == null) - throw new ArgumentNullException(nameof(requiredShopperFields), "Property is not nullable for class PaymentLinkRequest."); - - if (returnUrl.IsSet && returnUrl.Value == null) - throw new ArgumentNullException(nameof(returnUrl), "Property is not nullable for class PaymentLinkRequest."); - - if (reusable.IsSet && reusable.Value == null) - throw new ArgumentNullException(nameof(reusable), "Property is not nullable for class PaymentLinkRequest."); - - if (riskData.IsSet && riskData.Value == null) - throw new ArgumentNullException(nameof(riskData), "Property is not nullable for class PaymentLinkRequest."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class PaymentLinkRequest."); - - if (shopperLocale.IsSet && shopperLocale.Value == null) - throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class PaymentLinkRequest."); - - if (shopperName.IsSet && shopperName.Value == null) - throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class PaymentLinkRequest."); - - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class PaymentLinkRequest."); - - if (shopperStatement.IsSet && shopperStatement.Value == null) - throw new ArgumentNullException(nameof(shopperStatement), "Property is not nullable for class PaymentLinkRequest."); - - if (showRemovePaymentMethodButton.IsSet && showRemovePaymentMethodButton.Value == null) - throw new ArgumentNullException(nameof(showRemovePaymentMethodButton), "Property is not nullable for class PaymentLinkRequest."); - - if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) - throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class PaymentLinkRequest."); - - if (splitCardFundingSources.IsSet && splitCardFundingSources.Value == null) - throw new ArgumentNullException(nameof(splitCardFundingSources), "Property is not nullable for class PaymentLinkRequest."); - - if (splits.IsSet && splits.Value == null) - throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentLinkRequest."); - - if (store.IsSet && store.Value == null) - throw new ArgumentNullException(nameof(store), "Property is not nullable for class PaymentLinkRequest."); - - if (storePaymentMethodMode.IsSet && storePaymentMethodMode.Value == null) - throw new ArgumentNullException(nameof(storePaymentMethodMode), "Property is not nullable for class PaymentLinkRequest."); - - if (telephoneNumber.IsSet && telephoneNumber.Value == null) - throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class PaymentLinkRequest."); - - if (themeId.IsSet && themeId.Value == null) - throw new ArgumentNullException(nameof(themeId), "Property is not nullable for class PaymentLinkRequest."); - - if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) - throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class PaymentLinkRequest."); - - return new PaymentLinkRequest(amount.Value, merchantAccount.Value, reference.Value, allowedPaymentMethods, applicationInfo, billingAddress, blockedPaymentMethods, captureDelayHours, countryCode, dateOfBirth, deliverAt, deliveryAddress, description, expiresAt, fundOrigin, fundRecipient, installmentOptions, lineItems, manualCapture, mcc, merchantOrderReference, metadata, platformChargebackLogic, recurringProcessingModel, requiredShopperFields, returnUrl, reusable, riskData, shopperEmail, shopperLocale, shopperName, shopperReference, shopperStatement, showRemovePaymentMethodButton, socialSecurityNumber, splitCardFundingSources, splits, store, storePaymentMethodMode, telephoneNumber, themeId, threeDS2RequestData); - } - - /// - /// Serializes a - /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentLinkRequest paymentLinkRequest, JsonSerializerOptions jsonSerializerOptions) - { - writer.WriteStartObject(); - - WriteProperties(writer, paymentLinkRequest, jsonSerializerOptions); - writer.WriteEndObject(); - } - - /// - /// Serializes the properties of - /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentLinkRequest paymentLinkRequest, JsonSerializerOptions jsonSerializerOptions) - { - if (paymentLinkRequest.Amount == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.Amount), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.MerchantAccount), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.Reference == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.Reference), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.AllowedPaymentMethodsOption.IsSet && paymentLinkRequest.AllowedPaymentMethods == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.AllowedPaymentMethods), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.ApplicationInfoOption.IsSet && paymentLinkRequest.ApplicationInfo == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.ApplicationInfo), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.BillingAddressOption.IsSet && paymentLinkRequest.BillingAddress == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.BillingAddress), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.BlockedPaymentMethodsOption.IsSet && paymentLinkRequest.BlockedPaymentMethods == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.BlockedPaymentMethods), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.CountryCodeOption.IsSet && paymentLinkRequest.CountryCode == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.CountryCode), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.DeliveryAddressOption.IsSet && paymentLinkRequest.DeliveryAddress == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.DeliveryAddress), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.DescriptionOption.IsSet && paymentLinkRequest.Description == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.Description), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.FundOriginOption.IsSet && paymentLinkRequest.FundOrigin == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.FundOrigin), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.FundRecipientOption.IsSet && paymentLinkRequest.FundRecipient == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.FundRecipient), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.InstallmentOptionsOption.IsSet && paymentLinkRequest.InstallmentOptions == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.InstallmentOptions), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.LineItemsOption.IsSet && paymentLinkRequest.LineItems == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.LineItems), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.MccOption.IsSet && paymentLinkRequest.Mcc == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.Mcc), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.MerchantOrderReferenceOption.IsSet && paymentLinkRequest.MerchantOrderReference == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.MerchantOrderReference), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.MetadataOption.IsSet && paymentLinkRequest.Metadata == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.Metadata), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.PlatformChargebackLogicOption.IsSet && paymentLinkRequest.PlatformChargebackLogic == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.PlatformChargebackLogic), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.RequiredShopperFieldsOption.IsSet && paymentLinkRequest.RequiredShopperFields == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.RequiredShopperFields), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.ReturnUrlOption.IsSet && paymentLinkRequest.ReturnUrl == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.ReturnUrl), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.RiskDataOption.IsSet && paymentLinkRequest.RiskData == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.RiskData), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.ShopperEmailOption.IsSet && paymentLinkRequest.ShopperEmail == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.ShopperEmail), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.ShopperLocaleOption.IsSet && paymentLinkRequest.ShopperLocale == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.ShopperLocale), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.ShopperNameOption.IsSet && paymentLinkRequest.ShopperName == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.ShopperName), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.ShopperReferenceOption.IsSet && paymentLinkRequest.ShopperReference == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.ShopperReference), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.ShopperStatementOption.IsSet && paymentLinkRequest.ShopperStatement == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.ShopperStatement), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.SocialSecurityNumberOption.IsSet && paymentLinkRequest.SocialSecurityNumber == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.SocialSecurityNumber), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.SplitsOption.IsSet && paymentLinkRequest.Splits == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.Splits), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.StoreOption.IsSet && paymentLinkRequest.Store == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.Store), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.TelephoneNumberOption.IsSet && paymentLinkRequest.TelephoneNumber == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.TelephoneNumber), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.ThemeIdOption.IsSet && paymentLinkRequest.ThemeId == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.ThemeId), "Property is required for class PaymentLinkRequest."); - - if (paymentLinkRequest.ThreeDS2RequestDataOption.IsSet && paymentLinkRequest.ThreeDS2RequestData == null) - throw new ArgumentNullException(nameof(paymentLinkRequest.ThreeDS2RequestData), "Property is required for class PaymentLinkRequest."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, paymentLinkRequest.Amount, jsonSerializerOptions); - writer.WriteString("merchantAccount", paymentLinkRequest.MerchantAccount); - - writer.WriteString("reference", paymentLinkRequest.Reference); - - if (paymentLinkRequest.AllowedPaymentMethodsOption.IsSet) - { - writer.WritePropertyName("allowedPaymentMethods"); - JsonSerializer.Serialize(writer, paymentLinkRequest.AllowedPaymentMethods, jsonSerializerOptions); - } - if (paymentLinkRequest.ApplicationInfoOption.IsSet) - { - writer.WritePropertyName("applicationInfo"); - JsonSerializer.Serialize(writer, paymentLinkRequest.ApplicationInfo, jsonSerializerOptions); - } - if (paymentLinkRequest.BillingAddressOption.IsSet) - { - writer.WritePropertyName("billingAddress"); - JsonSerializer.Serialize(writer, paymentLinkRequest.BillingAddress, jsonSerializerOptions); - } - if (paymentLinkRequest.BlockedPaymentMethodsOption.IsSet) - { - writer.WritePropertyName("blockedPaymentMethods"); - JsonSerializer.Serialize(writer, paymentLinkRequest.BlockedPaymentMethods, jsonSerializerOptions); - } - if (paymentLinkRequest.CaptureDelayHoursOption.IsSet) - writer.WriteNumber("captureDelayHours", paymentLinkRequest.CaptureDelayHoursOption.Value.Value); - - if (paymentLinkRequest.CountryCodeOption.IsSet) - writer.WriteString("countryCode", paymentLinkRequest.CountryCode); - - if (paymentLinkRequest.DateOfBirthOption.IsSet) - writer.WriteString("dateOfBirth", paymentLinkRequest.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); - - if (paymentLinkRequest.DeliverAtOption.IsSet) - writer.WriteString("deliverAt", paymentLinkRequest.DeliverAtOption.Value.Value.ToString(DeliverAtFormat)); - - if (paymentLinkRequest.DeliveryAddressOption.IsSet) - { - writer.WritePropertyName("deliveryAddress"); - JsonSerializer.Serialize(writer, paymentLinkRequest.DeliveryAddress, jsonSerializerOptions); - } - if (paymentLinkRequest.DescriptionOption.IsSet) - writer.WriteString("description", paymentLinkRequest.Description); - - if (paymentLinkRequest.ExpiresAtOption.IsSet) - writer.WriteString("expiresAt", paymentLinkRequest.ExpiresAtOption.Value.Value.ToString(ExpiresAtFormat)); - - if (paymentLinkRequest.FundOriginOption.IsSet) - { - writer.WritePropertyName("fundOrigin"); - JsonSerializer.Serialize(writer, paymentLinkRequest.FundOrigin, jsonSerializerOptions); - } - if (paymentLinkRequest.FundRecipientOption.IsSet) - { - writer.WritePropertyName("fundRecipient"); - JsonSerializer.Serialize(writer, paymentLinkRequest.FundRecipient, jsonSerializerOptions); - } - if (paymentLinkRequest.InstallmentOptionsOption.IsSet) - { - writer.WritePropertyName("installmentOptions"); - JsonSerializer.Serialize(writer, paymentLinkRequest.InstallmentOptions, jsonSerializerOptions); - } - if (paymentLinkRequest.LineItemsOption.IsSet) - { - writer.WritePropertyName("lineItems"); - JsonSerializer.Serialize(writer, paymentLinkRequest.LineItems, jsonSerializerOptions); - } - if (paymentLinkRequest.ManualCaptureOption.IsSet) - writer.WriteBoolean("manualCapture", paymentLinkRequest.ManualCaptureOption.Value.Value); - - if (paymentLinkRequest.MccOption.IsSet) - writer.WriteString("mcc", paymentLinkRequest.Mcc); - - if (paymentLinkRequest.MerchantOrderReferenceOption.IsSet) - writer.WriteString("merchantOrderReference", paymentLinkRequest.MerchantOrderReference); - - if (paymentLinkRequest.MetadataOption.IsSet) - { - writer.WritePropertyName("metadata"); - JsonSerializer.Serialize(writer, paymentLinkRequest.Metadata, jsonSerializerOptions); - } - if (paymentLinkRequest.PlatformChargebackLogicOption.IsSet) - { - writer.WritePropertyName("platformChargebackLogic"); - JsonSerializer.Serialize(writer, paymentLinkRequest.PlatformChargebackLogic, jsonSerializerOptions); - } - var recurringProcessingModelRawValue = PaymentLinkRequest.RecurringProcessingModelEnumToJsonValue(paymentLinkRequest.RecurringProcessingModelOption.Value.Value); - writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); - if (paymentLinkRequest.RequiredShopperFieldsOption.IsSet) - { - writer.WritePropertyName("requiredShopperFields"); - JsonSerializer.Serialize(writer, paymentLinkRequest.RequiredShopperFields, jsonSerializerOptions); - } - if (paymentLinkRequest.ReturnUrlOption.IsSet) - writer.WriteString("returnUrl", paymentLinkRequest.ReturnUrl); - - if (paymentLinkRequest.ReusableOption.IsSet) - writer.WriteBoolean("reusable", paymentLinkRequest.ReusableOption.Value.Value); - - if (paymentLinkRequest.RiskDataOption.IsSet) - { - writer.WritePropertyName("riskData"); - JsonSerializer.Serialize(writer, paymentLinkRequest.RiskData, jsonSerializerOptions); - } - if (paymentLinkRequest.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", paymentLinkRequest.ShopperEmail); - - if (paymentLinkRequest.ShopperLocaleOption.IsSet) - writer.WriteString("shopperLocale", paymentLinkRequest.ShopperLocale); - - if (paymentLinkRequest.ShopperNameOption.IsSet) - { - writer.WritePropertyName("shopperName"); - JsonSerializer.Serialize(writer, paymentLinkRequest.ShopperName, jsonSerializerOptions); - } - if (paymentLinkRequest.ShopperReferenceOption.IsSet) - writer.WriteString("shopperReference", paymentLinkRequest.ShopperReference); - - if (paymentLinkRequest.ShopperStatementOption.IsSet) - writer.WriteString("shopperStatement", paymentLinkRequest.ShopperStatement); - - if (paymentLinkRequest.ShowRemovePaymentMethodButtonOption.IsSet) - writer.WriteBoolean("showRemovePaymentMethodButton", paymentLinkRequest.ShowRemovePaymentMethodButtonOption.Value.Value); - - if (paymentLinkRequest.SocialSecurityNumberOption.IsSet) - writer.WriteString("socialSecurityNumber", paymentLinkRequest.SocialSecurityNumber); - - if (paymentLinkRequest.SplitCardFundingSourcesOption.IsSet) - writer.WriteBoolean("splitCardFundingSources", paymentLinkRequest.SplitCardFundingSourcesOption.Value.Value); - - if (paymentLinkRequest.SplitsOption.IsSet) - { - writer.WritePropertyName("splits"); - JsonSerializer.Serialize(writer, paymentLinkRequest.Splits, jsonSerializerOptions); - } - if (paymentLinkRequest.StoreOption.IsSet) - writer.WriteString("store", paymentLinkRequest.Store); - - var storePaymentMethodModeRawValue = PaymentLinkRequest.StorePaymentMethodModeEnumToJsonValue(paymentLinkRequest.StorePaymentMethodModeOption.Value.Value); - writer.WriteString("storePaymentMethodMode", storePaymentMethodModeRawValue); - if (paymentLinkRequest.TelephoneNumberOption.IsSet) - writer.WriteString("telephoneNumber", paymentLinkRequest.TelephoneNumber); - - if (paymentLinkRequest.ThemeIdOption.IsSet) - writer.WriteString("themeId", paymentLinkRequest.ThemeId); - - if (paymentLinkRequest.ThreeDS2RequestDataOption.IsSet) - { - writer.WritePropertyName("threeDS2RequestData"); - JsonSerializer.Serialize(writer, paymentLinkRequest.ThreeDS2RequestData, jsonSerializerOptions); - } - } - } } diff --git a/Adyen/Model/Checkout/PaymentLinkResponse.cs b/Adyen/Model/Checkout/PaymentLinkResponse.cs index cf6c381c4..6895075ad 100644 --- a/Adyen/Model/Checkout/PaymentLinkResponse.cs +++ b/Adyen/Model/Checkout/PaymentLinkResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,1093 +15,567 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentLinkResponse /// + [DataContract(Name = "PaymentLinkResponse")] public partial class PaymentLinkResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// A unique identifier of the payment link. - /// The merchant account identifier for which the payment link is created. - /// A reference that is used to uniquely identify the payment in future communications about the payment status. - /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. - /// The URL at which the shopper can complete the payment. - /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - /// applicationInfo - /// billingAddress - /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - /// The delay between the authorisation and scheduled auto-capture, specified in hours. - /// The shopper's two-letter country code. - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - /// deliveryAddress - /// A short description visible on the payment page. Maximum length: 280 characters. - /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. - /// fundOrigin - /// fundRecipient - /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip. - /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. - /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. - /// platformChargebackLogic - /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. - /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. - /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. - /// riskData - /// The shopper's email address. - /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). - /// shopperName - /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - /// Set to **false** to hide the button that lets the shopper remove a stored payment method. (default to true) - /// The shopper's social security number. - /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false) - /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - /// The physical store, for which this payment is processed. - /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. - /// The shopper's telephone number. - /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. - /// threeDS2RequestData - /// The date when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [JsonConstructor] - public PaymentLinkResponse(Amount amount, string id, string merchantAccount, string reference, StatusEnum status, string url, Option> allowedPaymentMethods = default, Option applicationInfo = default, Option
billingAddress = default, Option> blockedPaymentMethods = default, Option captureDelayHours = default, Option countryCode = default, Option dateOfBirth = default, Option deliverAt = default, Option
deliveryAddress = default, Option description = default, Option expiresAt = default, Option fundOrigin = default, Option fundRecipient = default, Option> installmentOptions = default, Option> lineItems = default, Option manualCapture = default, Option mcc = default, Option merchantOrderReference = default, Option> metadata = default, Option platformChargebackLogic = default, Option recurringProcessingModel = default, Option> requiredShopperFields = default, Option returnUrl = default, Option reusable = default, Option riskData = default, Option shopperEmail = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option shopperStatement = default, Option showRemovePaymentMethodButton = default, Option socialSecurityNumber = default, Option splitCardFundingSources = default, Option> splits = default, Option store = default, Option storePaymentMethodMode = default, Option telephoneNumber = default, Option themeId = default, Option threeDS2RequestData = default, Option updatedAt = default) - { - Amount = amount; - Id = id; - MerchantAccount = merchantAccount; - Reference = reference; - Status = status; - Url = url; - AllowedPaymentMethodsOption = allowedPaymentMethods; - ApplicationInfoOption = applicationInfo; - BillingAddressOption = billingAddress; - BlockedPaymentMethodsOption = blockedPaymentMethods; - CaptureDelayHoursOption = captureDelayHours; - CountryCodeOption = countryCode; - DateOfBirthOption = dateOfBirth; - DeliverAtOption = deliverAt; - DeliveryAddressOption = deliveryAddress; - DescriptionOption = description; - ExpiresAtOption = expiresAt; - FundOriginOption = fundOrigin; - FundRecipientOption = fundRecipient; - InstallmentOptionsOption = installmentOptions; - LineItemsOption = lineItems; - ManualCaptureOption = manualCapture; - MccOption = mcc; - MerchantOrderReferenceOption = merchantOrderReference; - MetadataOption = metadata; - PlatformChargebackLogicOption = platformChargebackLogic; - RecurringProcessingModelOption = recurringProcessingModel; - RequiredShopperFieldsOption = requiredShopperFields; - ReturnUrlOption = returnUrl; - ReusableOption = reusable; - RiskDataOption = riskData; - ShopperEmailOption = shopperEmail; - ShopperLocaleOption = shopperLocale; - ShopperNameOption = shopperName; - ShopperReferenceOption = shopperReference; - ShopperStatementOption = shopperStatement; - ShowRemovePaymentMethodButtonOption = showRemovePaymentMethodButton; - SocialSecurityNumberOption = socialSecurityNumber; - SplitCardFundingSourcesOption = splitCardFundingSources; - SplitsOption = splits; - StoreOption = store; - StorePaymentMethodModeOption = storePaymentMethodMode; - TelephoneNumberOption = telephoneNumber; - ThemeIdOption = themeId; - ThreeDS2RequestDataOption = threeDS2RequestData; - UpdatedAtOption = updatedAt; - OnCreated(); - } - - partial void OnCreated(); - - /// - /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. - /// - /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. - public enum StatusEnum - { - /// - /// Enum Active for value: active - /// - Active = 1, - - /// - /// Enum Completed for value: completed - /// - Completed = 2, - - /// - /// Enum Expired for value: expired - /// - Expired = 3, - - /// - /// Enum Paid for value: paid - /// - Paid = 4, - - /// - /// Enum PaymentPending for value: paymentPending - /// - PaymentPending = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static StatusEnum StatusEnumFromString(string value) - { - if (value.Equals("active")) - return StatusEnum.Active; - - if (value.Equals("completed")) - return StatusEnum.Completed; - - if (value.Equals("expired")) - return StatusEnum.Expired; - - if (value.Equals("paid")) - return StatusEnum.Paid; - - if (value.Equals("paymentPending")) - return StatusEnum.PaymentPending; - - throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static StatusEnum? StatusEnumFromStringOrDefault(string value) - { - if (value.Equals("active")) - return StatusEnum.Active; - - if (value.Equals("completed")) - return StatusEnum.Completed; - - if (value.Equals("expired")) - return StatusEnum.Expired; - - if (value.Equals("paid")) - return StatusEnum.Paid; - - if (value.Equals("paymentPending")) - return StatusEnum.PaymentPending; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string StatusEnumToJsonValue(StatusEnum value) - { - if (value == StatusEnum.Active) - return "active"; - - if (value == StatusEnum.Completed) - return "completed"; - - if (value == StatusEnum.Expired) - return "expired"; - - if (value == StatusEnum.Paid) - return "paid"; - - if (value == StatusEnum.PaymentPending) - return "paymentPending"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. - /// - /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. - [JsonPropertyName("status")] - public StatusEnum Status { get; set; } - /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// + [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// + [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// + [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) - { - if (value == RecurringProcessingModelEnum.CardOnFile) - return "CardOnFile"; - if (value == RecurringProcessingModelEnum.Subscription) - return "Subscription"; - - if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) - return "UnscheduledCardOnFile"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of RecurringProcessingModel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonPropertyName("recurringProcessingModel")] - public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } - + [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] + public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } /// /// Defines RequiredShopperFields /// + [JsonConverter(typeof(StringEnumConverter))] public enum RequiredShopperFieldsEnum { /// /// Enum BillingAddress for value: billingAddress /// + [EnumMember(Value = "billingAddress")] BillingAddress = 1, /// /// Enum DeliveryAddress for value: deliveryAddress /// + [EnumMember(Value = "deliveryAddress")] DeliveryAddress = 2, /// /// Enum ShopperEmail for value: shopperEmail /// + [EnumMember(Value = "shopperEmail")] ShopperEmail = 3, /// /// Enum ShopperName for value: shopperName /// + [EnumMember(Value = "shopperName")] ShopperName = 4, /// /// Enum TelephoneNumber for value: telephoneNumber /// + [EnumMember(Value = "telephoneNumber")] TelephoneNumber = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredShopperFieldsEnum RequiredShopperFieldsEnumFromString(string value) - { - if (value.Equals("billingAddress")) - return RequiredShopperFieldsEnum.BillingAddress; - - if (value.Equals("deliveryAddress")) - return RequiredShopperFieldsEnum.DeliveryAddress; - - if (value.Equals("shopperEmail")) - return RequiredShopperFieldsEnum.ShopperEmail; - if (value.Equals("shopperName")) - return RequiredShopperFieldsEnum.ShopperName; + } - if (value.Equals("telephoneNumber")) - return RequiredShopperFieldsEnum.TelephoneNumber; - throw new NotImplementedException($"Could not convert value to type RequiredShopperFieldsEnum: '{value}'"); - } /// - /// Returns a + /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. /// - /// - /// - public static RequiredShopperFieldsEnum? RequiredShopperFieldsEnumFromStringOrDefault(string value) - { - if (value.Equals("billingAddress")) - return RequiredShopperFieldsEnum.BillingAddress; - - if (value.Equals("deliveryAddress")) - return RequiredShopperFieldsEnum.DeliveryAddress; - - if (value.Equals("shopperEmail")) - return RequiredShopperFieldsEnum.ShopperEmail; - - if (value.Equals("shopperName")) - return RequiredShopperFieldsEnum.ShopperName; - - if (value.Equals("telephoneNumber")) - return RequiredShopperFieldsEnum.TelephoneNumber; - - return null; - } - + /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. + [DataMember(Name = "requiredShopperFields", EmitDefaultValue = false)] + public List RequiredShopperFields { get; set; } /// - /// Converts the to the json value + /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. /// - /// - /// - /// - public static string RequiredShopperFieldsEnumToJsonValue(RequiredShopperFieldsEnum value) + /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum { - if (value == RequiredShopperFieldsEnum.BillingAddress) - return "billingAddress"; + /// + /// Enum Active for value: active + /// + [EnumMember(Value = "active")] + Active = 1, - if (value == RequiredShopperFieldsEnum.DeliveryAddress) - return "deliveryAddress"; + /// + /// Enum Completed for value: completed + /// + [EnumMember(Value = "completed")] + Completed = 2, - if (value == RequiredShopperFieldsEnum.ShopperEmail) - return "shopperEmail"; + /// + /// Enum Expired for value: expired + /// + [EnumMember(Value = "expired")] + Expired = 3, - if (value == RequiredShopperFieldsEnum.ShopperName) - return "shopperName"; + /// + /// Enum Paid for value: paid + /// + [EnumMember(Value = "paid")] + Paid = 4, - if (value == RequiredShopperFieldsEnum.TelephoneNumber) - return "telephoneNumber"; + /// + /// Enum PaymentPending for value: paymentPending + /// + [EnumMember(Value = "paymentPending")] + PaymentPending = 5 - throw new NotImplementedException($"Value could not be handled: '{value}'"); } + + /// + /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. + /// + /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. + [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] + public StatusEnum Status { get; set; } /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. + [JsonConverter(typeof(StringEnumConverter))] public enum StorePaymentMethodModeEnum { /// /// Enum AskForConsent for value: askForConsent /// + [EnumMember(Value = "askForConsent")] AskForConsent = 1, /// /// Enum Disabled for value: disabled /// + [EnumMember(Value = "disabled")] Disabled = 2, /// /// Enum Enabled for value: enabled /// + [EnumMember(Value = "enabled")] Enabled = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static StorePaymentMethodModeEnum StorePaymentMethodModeEnumFromString(string value) - { - if (value.Equals("askForConsent")) - return StorePaymentMethodModeEnum.AskForConsent; - - if (value.Equals("disabled")) - return StorePaymentMethodModeEnum.Disabled; - - if (value.Equals("enabled")) - return StorePaymentMethodModeEnum.Enabled; - - throw new NotImplementedException($"Could not convert value to type StorePaymentMethodModeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static StorePaymentMethodModeEnum? StorePaymentMethodModeEnumFromStringOrDefault(string value) - { - if (value.Equals("askForConsent")) - return StorePaymentMethodModeEnum.AskForConsent; - - if (value.Equals("disabled")) - return StorePaymentMethodModeEnum.Disabled; - - if (value.Equals("enabled")) - return StorePaymentMethodModeEnum.Enabled; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string StorePaymentMethodModeEnumToJsonValue(StorePaymentMethodModeEnum? value) - { - if (value == StorePaymentMethodModeEnum.AskForConsent) - return "askForConsent"; - - if (value == StorePaymentMethodModeEnum.Disabled) - return "disabled"; - - if (value == StorePaymentMethodModeEnum.Enabled) - return "enabled"; - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of StorePaymentMethodMode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StorePaymentMethodModeOption { get; private set; } /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. /// /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter. - [JsonPropertyName("storePaymentMethodMode")] - public StorePaymentMethodModeEnum? StorePaymentMethodMode { get { return this.StorePaymentMethodModeOption; } set { this.StorePaymentMethodModeOption = new Option(value); } } - - /// - /// Gets or Sets Amount - /// - [JsonPropertyName("amount")] - public Amount Amount { get; set; } - - /// - /// A unique identifier of the payment link. - /// - /// A unique identifier of the payment link. - [JsonPropertyName("id")] - public string Id { get; } - - /// - /// The merchant account identifier for which the payment link is created. - /// - /// The merchant account identifier for which the payment link is created. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } - - /// - /// A reference that is used to uniquely identify the payment in future communications about the payment status. - /// - /// A reference that is used to uniquely identify the payment in future communications about the payment status. - [JsonPropertyName("reference")] - public string Reference { get; set; } - + [DataMember(Name = "storePaymentMethodMode", EmitDefaultValue = false)] + public StorePaymentMethodModeEnum? StorePaymentMethodMode { get; set; } /// - /// The URL at which the shopper can complete the payment. + /// Initializes a new instance of the class. /// - /// The URL at which the shopper can complete the payment. - [JsonPropertyName("url")] - public string Url { get; } - + [JsonConstructorAttribute] + protected PaymentLinkResponse() { } /// - /// Used to track the state of AllowedPaymentMethods + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AllowedPaymentMethodsOption { get; private set; } + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]`. + /// amount (required). + /// applicationInfo. + /// billingAddress. + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]`. + /// The delay between the authorisation and scheduled auto-capture, specified in hours.. + /// The shopper's two-letter country code.. + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. + /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.. + /// deliveryAddress. + /// A short description visible on the payment page. Maximum length: 280 characters.. + /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created.. + /// fundOrigin. + /// fundRecipient. + /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options.. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip.. + /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture).. + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. + /// The merchant account identifier for which the payment link is created. (required). + /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle.. + /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID.. + /// platformChargebackLogic. + /// Defines a recurring payment type. Required when `storePaymentMethodMode` is set to **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a fixed or variable amount, which follows a fixed schedule. * **CardOnFile** – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * **UnscheduledCardOnFile** – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . + /// A reference that is used to uniquely identify the payment in future communications about the payment status. (required). + /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. . + /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL.. + /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only.. + /// riskData. + /// The shopper's email address.. + /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language).. + /// shopperName. + /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. + /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**.. + /// Set to **false** to hide the button that lets the shopper remove a stored payment method. (default to true). + /// The shopper's social security number.. + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false). + /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).. + /// Status of the payment link. Possible values: * **active**: The link can be used to make payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no longer use the link to make payments. * **completed**: The shopper completed the payment. * **paymentPending**: The shopper is in the process of making the payment. Applies to payment methods with an asynchronous flow. (required). + /// The physical store, for which this payment is processed.. + /// Indicates if the details of the payment method will be stored for the shopper. Possible values: * **disabled** – No details will be stored (default). * **askForConsent** – If the `shopperReference` is provided, the UI lets the shopper choose if they want their payment details to be stored. * **enabled** – If the `shopperReference` is provided, the details will be stored without asking the shopper for consent. When set to **askForConsent** or **enabled**, you must also include the `recurringProcessingModel` parameter.. + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication.. + /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area.. + /// threeDS2RequestData. + /// The date when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**.. + public PaymentLinkResponse(List allowedPaymentMethods = default(List), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), Address billingAddress = default(Address), List blockedPaymentMethods = default(List), int? captureDelayHours = default(int?), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), DateTime deliverAt = default(DateTime), Address deliveryAddress = default(Address), string description = default(string), DateTime expiresAt = default(DateTime), FundOrigin fundOrigin = default(FundOrigin), FundRecipient fundRecipient = default(FundRecipient), Dictionary installmentOptions = default(Dictionary), List lineItems = default(List), bool? manualCapture = default(bool?), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), Dictionary metadata = default(Dictionary), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string reference = default(string), List requiredShopperFields = default(List), string returnUrl = default(string), bool? reusable = default(bool?), RiskData riskData = default(RiskData), string shopperEmail = default(string), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), bool? showRemovePaymentMethodButton = true, string socialSecurityNumber = default(string), bool? splitCardFundingSources = false, List splits = default(List), StatusEnum status = default(StatusEnum), string store = default(string), StorePaymentMethodModeEnum? storePaymentMethodMode = default(StorePaymentMethodModeEnum?), string telephoneNumber = default(string), string themeId = default(string), CheckoutSessionThreeDS2RequestData threeDS2RequestData = default(CheckoutSessionThreeDS2RequestData), DateTime updatedAt = default(DateTime)) + { + this.Amount = amount; + this.MerchantAccount = merchantAccount; + this.Reference = reference; + this.Status = status; + this.AllowedPaymentMethods = allowedPaymentMethods; + this.ApplicationInfo = applicationInfo; + this.BillingAddress = billingAddress; + this.BlockedPaymentMethods = blockedPaymentMethods; + this.CaptureDelayHours = captureDelayHours; + this.CountryCode = countryCode; + this.DateOfBirth = dateOfBirth; + this.DeliverAt = deliverAt; + this.DeliveryAddress = deliveryAddress; + this.Description = description; + this.ExpiresAt = expiresAt; + this.FundOrigin = fundOrigin; + this.FundRecipient = fundRecipient; + this.InstallmentOptions = installmentOptions; + this.LineItems = lineItems; + this.ManualCapture = manualCapture; + this.Mcc = mcc; + this.MerchantOrderReference = merchantOrderReference; + this.Metadata = metadata; + this.PlatformChargebackLogic = platformChargebackLogic; + this.RecurringProcessingModel = recurringProcessingModel; + this.RequiredShopperFields = requiredShopperFields; + this.ReturnUrl = returnUrl; + this.Reusable = reusable; + this.RiskData = riskData; + this.ShopperEmail = shopperEmail; + this.ShopperLocale = shopperLocale; + this.ShopperName = shopperName; + this.ShopperReference = shopperReference; + this.ShopperStatement = shopperStatement; + this.ShowRemovePaymentMethodButton = showRemovePaymentMethodButton; + this.SocialSecurityNumber = socialSecurityNumber; + this.SplitCardFundingSources = splitCardFundingSources; + this.Splits = splits; + this.Store = store; + this.StorePaymentMethodMode = storePaymentMethodMode; + this.TelephoneNumber = telephoneNumber; + this.ThemeId = themeId; + this.ThreeDS2RequestData = threeDS2RequestData; + this.UpdatedAt = updatedAt; + } /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - [JsonPropertyName("allowedPaymentMethods")] - public List AllowedPaymentMethods { get { return this.AllowedPaymentMethodsOption; } set { this.AllowedPaymentMethodsOption = new Option>(value); } } + [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] + public List AllowedPaymentMethods { get; set; } /// - /// Used to track the state of ApplicationInfo + /// Gets or Sets Amount /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ApplicationInfoOption { get; private set; } + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// Gets or Sets ApplicationInfo /// - [JsonPropertyName("applicationInfo")] - public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } - - /// - /// Used to track the state of BillingAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option
BillingAddressOption { get; private set; } + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } /// /// Gets or Sets BillingAddress /// - [JsonPropertyName("billingAddress")] - public Address BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option
(value); } } - - /// - /// Used to track the state of BlockedPaymentMethods - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> BlockedPaymentMethodsOption { get; private set; } + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public Address BillingAddress { get; set; } /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - [JsonPropertyName("blockedPaymentMethods")] - public List BlockedPaymentMethods { get { return this.BlockedPaymentMethodsOption; } set { this.BlockedPaymentMethodsOption = new Option>(value); } } - - /// - /// Used to track the state of CaptureDelayHours - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CaptureDelayHoursOption { get; private set; } + [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] + public List BlockedPaymentMethods { get; set; } /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. - [JsonPropertyName("captureDelayHours")] - public int? CaptureDelayHours { get { return this.CaptureDelayHoursOption; } set { this.CaptureDelayHoursOption = new Option(value); } } - - /// - /// Used to track the state of CountryCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CountryCodeOption { get; private set; } + [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] + public int? CaptureDelayHours { get; set; } /// /// The shopper's two-letter country code. /// /// The shopper's two-letter country code. - [JsonPropertyName("countryCode")] - public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } - - /// - /// Used to track the state of DateOfBirth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DateOfBirthOption { get; private set; } + [DataMember(Name = "countryCode", EmitDefaultValue = false)] + public string CountryCode { get; set; } /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - [JsonPropertyName("dateOfBirth")] - public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } - - /// - /// Used to track the state of DeliverAt - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliverAtOption { get; private set; } + [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime DateOfBirth { get; set; } /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. /// /// The date and time when the purchased goods should be delivered. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [JsonPropertyName("deliverAt")] - public DateTime? DeliverAt { get { return this.DeliverAtOption; } set { this.DeliverAtOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option
DeliveryAddressOption { get; private set; } + [DataMember(Name = "deliverAt", EmitDefaultValue = false)] + public DateTime DeliverAt { get; set; } /// /// Gets or Sets DeliveryAddress /// - [JsonPropertyName("deliveryAddress")] - public Address DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option
(value); } } - - /// - /// Used to track the state of Description - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DescriptionOption { get; private set; } + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public Address DeliveryAddress { get; set; } /// /// A short description visible on the payment page. Maximum length: 280 characters. /// /// A short description visible on the payment page. Maximum length: 280 characters. - [JsonPropertyName("description")] - public string Description { get { return this.DescriptionOption; } set { this.DescriptionOption = new Option(value); } } - - /// - /// Used to track the state of ExpiresAt - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiresAtOption { get; private set; } + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } /// /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. /// /// The date when the payment link expires. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format with time zone offset: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. The maximum expiry date is 70 days after the payment link is created. If not provided, the payment link expires 24 hours after it was created. - [JsonPropertyName("expiresAt")] - public DateTime? ExpiresAt { get { return this.ExpiresAtOption; } set { this.ExpiresAtOption = new Option(value); } } - - /// - /// Used to track the state of FundOrigin - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundOriginOption { get; private set; } + [DataMember(Name = "expiresAt", EmitDefaultValue = false)] + public DateTime ExpiresAt { get; set; } /// /// Gets or Sets FundOrigin /// - [JsonPropertyName("fundOrigin")] - public FundOrigin FundOrigin { get { return this.FundOriginOption; } set { this.FundOriginOption = new Option(value); } } - - /// - /// Used to track the state of FundRecipient - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundRecipientOption { get; private set; } + [DataMember(Name = "fundOrigin", EmitDefaultValue = false)] + public FundOrigin FundOrigin { get; set; } /// /// Gets or Sets FundRecipient /// - [JsonPropertyName("fundRecipient")] - public FundRecipient FundRecipient { get { return this.FundRecipientOption; } set { this.FundRecipientOption = new Option(value); } } + [DataMember(Name = "fundRecipient", EmitDefaultValue = false)] + public FundRecipient FundRecipient { get; set; } /// - /// Used to track the state of InstallmentOptions + /// A unique identifier of the payment link. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> InstallmentOptionsOption { get; private set; } + /// A unique identifier of the payment link. + [DataMember(Name = "id", IsRequired = false, EmitDefaultValue = false)] + public string Id { get; private set; } /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. /// /// A set of key-value pairs that specifies the installment options available per payment method. The key must be a payment method name in lowercase. For example, **card** to specify installment options for all cards, or **visa** or **mc**. The value must be an object containing the installment options. - [JsonPropertyName("installmentOptions")] - public Dictionary InstallmentOptions { get { return this.InstallmentOptionsOption; } set { this.InstallmentOptionsOption = new Option>(value); } } - - /// - /// Used to track the state of LineItems - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LineItemsOption { get; private set; } + [DataMember(Name = "installmentOptions", EmitDefaultValue = false)] + public Dictionary InstallmentOptions { get; set; } /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip. /// /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such Afterpay, Clearpay, Klarna, RatePay, Riverty, and Zip. - [JsonPropertyName("lineItems")] - public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } - - /// - /// Used to track the state of ManualCapture - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ManualCaptureOption { get; private set; } + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } /// /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). /// /// Indicates if the payment must be [captured manually](https://docs.adyen.com/online-payments/capture). - [JsonPropertyName("manualCapture")] - public bool? ManualCapture { get { return this.ManualCaptureOption; } set { this.ManualCaptureOption = new Option(value); } } - - /// - /// Used to track the state of Mcc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MccOption { get; private set; } + [DataMember(Name = "manualCapture", EmitDefaultValue = false)] + public bool? ManualCapture { get; set; } /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. /// /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - [JsonPropertyName("mcc")] - public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string Mcc { get; set; } /// - /// Used to track the state of MerchantOrderReference + /// The merchant account identifier for which the payment link is created. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantOrderReferenceOption { get; private set; } + /// The merchant account identifier for which the payment link is created. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. /// /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. - [JsonPropertyName("merchantOrderReference")] - public string MerchantOrderReference { get { return this.MerchantOrderReferenceOption; } set { this.MerchantOrderReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Metadata - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> MetadataOption { get; private set; } + [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] + public string MerchantOrderReference { get; set; } /// /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. /// /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. Otherwise, error \"177\" occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. Otherwise, error \"178\" occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Any value that you provide with this key is going to be replaced by the real payment link ID. - [JsonPropertyName("metadata")] - public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } - - /// - /// Used to track the state of PlatformChargebackLogic - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PlatformChargebackLogicOption { get; private set; } + [DataMember(Name = "metadata", EmitDefaultValue = false)] + public Dictionary Metadata { get; set; } /// /// Gets or Sets PlatformChargebackLogic /// - [JsonPropertyName("platformChargebackLogic")] - public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } - - /// - /// Used to track the state of RequiredShopperFields - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> RequiredShopperFieldsOption { get; private set; } - - /// - /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. - /// - /// List of fields that the shopper has to provide on the payment page before completing the payment. For more information, refer to [Provide shopper information](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#shopper-information). Possible values: * **billingAddress** – The address where to send the invoice. * **deliveryAddress** – The address where the purchased goods should be delivered. * **shopperEmail** – The shopper's email address. * **shopperName** – The shopper's full name. * **telephoneNumber** – The shopper's phone number. - [JsonPropertyName("requiredShopperFields")] - public List RequiredShopperFields { get { return this.RequiredShopperFieldsOption; } set { this.RequiredShopperFieldsOption = new Option>(value); } } + [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] + public PlatformChargebackLogic PlatformChargebackLogic { get; set; } /// - /// Used to track the state of ReturnUrl + /// A reference that is used to uniquely identify the payment in future communications about the payment status. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReturnUrlOption { get; private set; } + /// A reference that is used to uniquely identify the payment in future communications about the payment status. + [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. /// /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. - [JsonPropertyName("returnUrl")] - public string ReturnUrl { get { return this.ReturnUrlOption; } set { this.ReturnUrlOption = new Option(value); } } - - /// - /// Used to track the state of Reusable - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReusableOption { get; private set; } + [DataMember(Name = "returnUrl", EmitDefaultValue = false)] + public string ReturnUrl { get; set; } /// /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. /// /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. - [JsonPropertyName("reusable")] - public bool? Reusable { get { return this.ReusableOption; } set { this.ReusableOption = new Option(value); } } - - /// - /// Used to track the state of RiskData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskDataOption { get; private set; } + [DataMember(Name = "reusable", EmitDefaultValue = false)] + public bool? Reusable { get; set; } /// /// Gets or Sets RiskData /// - [JsonPropertyName("riskData")] - public RiskData RiskData { get { return this.RiskDataOption; } set { this.RiskDataOption = new Option(value); } } - - /// - /// Used to track the state of ShopperEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + [DataMember(Name = "riskData", EmitDefaultValue = false)] + public RiskData RiskData { get; set; } /// /// The shopper's email address. /// /// The shopper's email address. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } - - /// - /// Used to track the state of ShopperLocale - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperLocaleOption { get; private set; } + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). /// /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#language). - [JsonPropertyName("shopperLocale")] - public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } - - /// - /// Used to track the state of ShopperName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNameOption { get; private set; } + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + public string ShopperLocale { get; set; } /// /// Gets or Sets ShopperName /// - [JsonPropertyName("shopperName")] - public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } - - /// - /// Used to track the state of ShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperReferenceOption { get; private set; } + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name ShopperName { get; set; } /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [JsonPropertyName("shopperReference")] - public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperStatement - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperStatementOption { get; private set; } + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - [JsonPropertyName("shopperStatement")] - public string ShopperStatement { get { return this.ShopperStatementOption; } set { this.ShopperStatementOption = new Option(value); } } - - /// - /// Used to track the state of ShowRemovePaymentMethodButton - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShowRemovePaymentMethodButtonOption { get; private set; } + [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] + public string ShopperStatement { get; set; } /// /// Set to **false** to hide the button that lets the shopper remove a stored payment method. /// /// Set to **false** to hide the button that lets the shopper remove a stored payment method. - [JsonPropertyName("showRemovePaymentMethodButton")] - public bool? ShowRemovePaymentMethodButton { get { return this.ShowRemovePaymentMethodButtonOption; } set { this.ShowRemovePaymentMethodButtonOption = new Option(value); } } - - /// - /// Used to track the state of SocialSecurityNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SocialSecurityNumberOption { get; private set; } + [DataMember(Name = "showRemovePaymentMethodButton", EmitDefaultValue = false)] + public bool? ShowRemovePaymentMethodButton { get; set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [JsonPropertyName("socialSecurityNumber")] - public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } - - /// - /// Used to track the state of SplitCardFundingSources - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SplitCardFundingSourcesOption { get; private set; } + [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] + public string SocialSecurityNumber { get; set; } /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. - [JsonPropertyName("splitCardFundingSources")] - public bool? SplitCardFundingSources { get { return this.SplitCardFundingSourcesOption; } set { this.SplitCardFundingSourcesOption = new Option(value); } } - - /// - /// Used to track the state of Splits - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SplitsOption { get; private set; } + [DataMember(Name = "splitCardFundingSources", EmitDefaultValue = false)] + public bool? SplitCardFundingSources { get; set; } /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - [JsonPropertyName("splits")] - public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } - - /// - /// Used to track the state of Store - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoreOption { get; private set; } + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// The physical store, for which this payment is processed. /// /// The physical store, for which this payment is processed. - [JsonPropertyName("store")] - public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } - - /// - /// Used to track the state of TelephoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TelephoneNumberOption { get; private set; } - - /// - /// The shopper's telephone number. - /// - /// The shopper's telephone number. - [JsonPropertyName("telephoneNumber")] - public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } + [DataMember(Name = "store", EmitDefaultValue = false)] + public string Store { get; set; } /// - /// Used to track the state of ThemeId + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThemeIdOption { get; private set; } + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string TelephoneNumber { get; set; } /// /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. /// /// A [theme](https://docs.adyen.com/unified-commerce/pay-by-link/payment-links/api#themes) to customize the appearance of the payment page. If not specified, the payment page is rendered according to the theme set as default in your Customer Area. - [JsonPropertyName("themeId")] - public string ThemeId { get { return this.ThemeIdOption; } set { this.ThemeIdOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2RequestData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2RequestDataOption { get; private set; } + [DataMember(Name = "themeId", EmitDefaultValue = false)] + public string ThemeId { get; set; } /// /// Gets or Sets ThreeDS2RequestData /// - [JsonPropertyName("threeDS2RequestData")] - public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } + [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] + public CheckoutSessionThreeDS2RequestData ThreeDS2RequestData { get; set; } /// - /// Used to track the state of UpdatedAt + /// The date when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option UpdatedAtOption { get; private set; } + /// The date when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + [DataMember(Name = "updatedAt", EmitDefaultValue = false)] + public DateTime UpdatedAt { get; set; } /// - /// The date when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. + /// The URL at which the shopper can complete the payment. /// - /// The date when the payment link status was updated. [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format: YYYY-MM-DDThh:mm:ss+TZD, for example, **2020-12-18T10:15:30+01:00**. - [JsonPropertyName("updatedAt")] - public DateTime? UpdatedAt { get { return this.UpdatedAtOption; } set { this.UpdatedAtOption = new Option(value); } } + /// The URL at which the shopper can complete the payment. + [DataMember(Name = "url", IsRequired = false, EmitDefaultValue = false)] + public string Url { get; private set; } /// /// Returns the string presentation of the object @@ -1110,13 +585,8 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentLinkResponse {\n"); - sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); sb.Append(" BlockedPaymentMethods: ").Append(BlockedPaymentMethods).Append("\n"); @@ -1129,14 +599,17 @@ public override string ToString() sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append(" FundOrigin: ").Append(FundOrigin).Append("\n"); sb.Append(" FundRecipient: ").Append(FundRecipient).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" InstallmentOptions: ").Append(InstallmentOptions).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" ManualCapture: ").Append(ManualCapture).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append(" PlatformChargebackLogic: ").Append(PlatformChargebackLogic).Append("\n"); sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" RequiredShopperFields: ").Append(RequiredShopperFields).Append("\n"); sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" Reusable: ").Append(Reusable).Append("\n"); @@ -1150,16 +623,27 @@ public override string ToString() sb.Append(" SocialSecurityNumber: ").Append(SocialSecurityNumber).Append("\n"); sb.Append(" SplitCardFundingSources: ").Append(SplitCardFundingSources).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" Store: ").Append(Store).Append("\n"); sb.Append(" StorePaymentMethodMode: ").Append(StorePaymentMethodMode).Append("\n"); sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); sb.Append(" ThemeId: ").Append(ThemeId).Append("\n"); sb.Append(" ThreeDS2RequestData: ").Append(ThreeDS2RequestData).Append("\n"); sb.Append(" UpdatedAt: ").Append(UpdatedAt).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); } + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + /// /// Returns true if objects are equal /// @@ -1178,18 +662,236 @@ public override bool Equals(object input) public bool Equals(PaymentLinkResponse input) { if (input == null) + { return false; - + } return ( - Id == input.Id || - (Id != null && - Id.Equals(input.Id)) + this.AllowedPaymentMethods == input.AllowedPaymentMethods || + this.AllowedPaymentMethods != null && + input.AllowedPaymentMethods != null && + this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.ApplicationInfo == input.ApplicationInfo || + (this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo)) + ) && + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.BlockedPaymentMethods == input.BlockedPaymentMethods || + this.BlockedPaymentMethods != null && + input.BlockedPaymentMethods != null && + this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) + ) && + ( + this.CaptureDelayHours == input.CaptureDelayHours || + this.CaptureDelayHours.Equals(input.CaptureDelayHours) ) && ( - Url == input.Url || - (Url != null && - Url.Equals(input.Url)) + this.CountryCode == input.CountryCode || + (this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode)) + ) && + ( + this.DateOfBirth == input.DateOfBirth || + (this.DateOfBirth != null && + this.DateOfBirth.Equals(input.DateOfBirth)) + ) && + ( + this.DeliverAt == input.DeliverAt || + (this.DeliverAt != null && + this.DeliverAt.Equals(input.DeliverAt)) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + (this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress)) + ) && + ( + this.Description == input.Description || + (this.Description != null && + this.Description.Equals(input.Description)) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) + ) && + ( + this.FundOrigin == input.FundOrigin || + (this.FundOrigin != null && + this.FundOrigin.Equals(input.FundOrigin)) + ) && + ( + this.FundRecipient == input.FundRecipient || + (this.FundRecipient != null && + this.FundRecipient.Equals(input.FundRecipient)) + ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.InstallmentOptions == input.InstallmentOptions || + this.InstallmentOptions != null && + input.InstallmentOptions != null && + this.InstallmentOptions.SequenceEqual(input.InstallmentOptions) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.ManualCapture == input.ManualCapture || + this.ManualCapture.Equals(input.ManualCapture) + ) && + ( + this.Mcc == input.Mcc || + (this.Mcc != null && + this.Mcc.Equals(input.Mcc)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.MerchantOrderReference == input.MerchantOrderReference || + (this.MerchantOrderReference != null && + this.MerchantOrderReference.Equals(input.MerchantOrderReference)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.PlatformChargebackLogic == input.PlatformChargebackLogic || + (this.PlatformChargebackLogic != null && + this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) + ) && + ( + this.RecurringProcessingModel == input.RecurringProcessingModel || + this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.RequiredShopperFields == input.RequiredShopperFields || + this.RequiredShopperFields.SequenceEqual(input.RequiredShopperFields) + ) && + ( + this.ReturnUrl == input.ReturnUrl || + (this.ReturnUrl != null && + this.ReturnUrl.Equals(input.ReturnUrl)) + ) && + ( + this.Reusable == input.Reusable || + this.Reusable.Equals(input.Reusable) + ) && + ( + this.RiskData == input.RiskData || + (this.RiskData != null && + this.RiskData.Equals(input.RiskData)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.ShopperLocale == input.ShopperLocale || + (this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale)) + ) && + ( + this.ShopperName == input.ShopperName || + (this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName)) + ) && + ( + this.ShopperReference == input.ShopperReference || + (this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference)) + ) && + ( + this.ShopperStatement == input.ShopperStatement || + (this.ShopperStatement != null && + this.ShopperStatement.Equals(input.ShopperStatement)) + ) && + ( + this.ShowRemovePaymentMethodButton == input.ShowRemovePaymentMethodButton || + this.ShowRemovePaymentMethodButton.Equals(input.ShowRemovePaymentMethodButton) + ) && + ( + this.SocialSecurityNumber == input.SocialSecurityNumber || + (this.SocialSecurityNumber != null && + this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) + ) && + ( + this.SplitCardFundingSources == input.SplitCardFundingSources || + this.SplitCardFundingSources.Equals(input.SplitCardFundingSources) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ) && + ( + this.Store == input.Store || + (this.Store != null && + this.Store.Equals(input.Store)) + ) && + ( + this.StorePaymentMethodMode == input.StorePaymentMethodMode || + this.StorePaymentMethodMode.Equals(input.StorePaymentMethodMode) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + (this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber)) + ) && + ( + this.ThemeId == input.ThemeId || + (this.ThemeId != null && + this.ThemeId.Equals(input.ThemeId)) + ) && + ( + this.ThreeDS2RequestData == input.ThreeDS2RequestData || + (this.ThreeDS2RequestData != null && + this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) + ) && + ( + this.UpdatedAt == input.UpdatedAt || + (this.UpdatedAt != null && + this.UpdatedAt.Equals(input.UpdatedAt)) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) ); } @@ -1202,816 +904,241 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = (hashCode * 59) + Id.GetHashCode(); - hashCode = (hashCode * 59) + Url.GetHashCode(); - + if (this.AllowedPaymentMethods != null) + { + hashCode = (hashCode * 59) + this.AllowedPaymentMethods.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.ApplicationInfo != null) + { + hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); + } + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.BlockedPaymentMethods != null) + { + hashCode = (hashCode * 59) + this.BlockedPaymentMethods.GetHashCode(); + } + hashCode = (hashCode * 59) + this.CaptureDelayHours.GetHashCode(); + if (this.CountryCode != null) + { + hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); + } + if (this.DateOfBirth != null) + { + hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); + } + if (this.DeliverAt != null) + { + hashCode = (hashCode * 59) + this.DeliverAt.GetHashCode(); + } + if (this.DeliveryAddress != null) + { + hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); + } + if (this.Description != null) + { + hashCode = (hashCode * 59) + this.Description.GetHashCode(); + } + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } + if (this.FundOrigin != null) + { + hashCode = (hashCode * 59) + this.FundOrigin.GetHashCode(); + } + if (this.FundRecipient != null) + { + hashCode = (hashCode * 59) + this.FundRecipient.GetHashCode(); + } + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.InstallmentOptions != null) + { + hashCode = (hashCode * 59) + this.InstallmentOptions.GetHashCode(); + } + if (this.LineItems != null) + { + hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ManualCapture.GetHashCode(); + if (this.Mcc != null) + { + hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.MerchantOrderReference != null) + { + hashCode = (hashCode * 59) + this.MerchantOrderReference.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + if (this.PlatformChargebackLogic != null) + { + hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RequiredShopperFields.GetHashCode(); + if (this.ReturnUrl != null) + { + hashCode = (hashCode * 59) + this.ReturnUrl.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Reusable.GetHashCode(); + if (this.RiskData != null) + { + hashCode = (hashCode * 59) + this.RiskData.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.ShopperLocale != null) + { + hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); + } + if (this.ShopperName != null) + { + hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); + } + if (this.ShopperReference != null) + { + hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); + } + if (this.ShopperStatement != null) + { + hashCode = (hashCode * 59) + this.ShopperStatement.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ShowRemovePaymentMethodButton.GetHashCode(); + if (this.SocialSecurityNumber != null) + { + hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); + } + hashCode = (hashCode * 59) + this.SplitCardFundingSources.GetHashCode(); + if (this.Splits != null) + { + hashCode = (hashCode * 59) + this.Splits.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + if (this.Store != null) + { + hashCode = (hashCode * 59) + this.Store.GetHashCode(); + } + hashCode = (hashCode * 59) + this.StorePaymentMethodMode.GetHashCode(); + if (this.TelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); + } + if (this.ThemeId != null) + { + hashCode = (hashCode * 59) + this.ThemeId.GetHashCode(); + } + if (this.ThreeDS2RequestData != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); + } + if (this.UpdatedAt != null) + { + hashCode = (hashCode * 59) + this.UpdatedAt.GetHashCode(); + } + if (this.Url != null) + { + hashCode = (hashCode * 59) + this.Url.GetHashCode(); + } return hashCode; } } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { // CountryCode (string) maxLength if (this.CountryCode != null && this.CountryCode.Length > 100) { - yield return new ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); } // Mcc (string) maxLength if (this.Mcc != null && this.Mcc.Length > 16) { - yield return new ValidationResult("Invalid value for Mcc, length must be less than 16.", new [] { "Mcc" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Mcc, length must be less than 16.", new [] { "Mcc" }); } // MerchantOrderReference (string) maxLength if (this.MerchantOrderReference != null && this.MerchantOrderReference.Length > 1000) { - yield return new ValidationResult("Invalid value for MerchantOrderReference, length must be less than 1000.", new [] { "MerchantOrderReference" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for MerchantOrderReference, length must be less than 1000.", new [] { "MerchantOrderReference" }); } // ReturnUrl (string) maxLength if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) { - yield return new ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); } // ShopperEmail (string) maxLength if (this.ShopperEmail != null && this.ShopperEmail.Length > 500) { - yield return new ValidationResult("Invalid value for ShopperEmail, length must be less than 500.", new [] { "ShopperEmail" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperEmail, length must be less than 500.", new [] { "ShopperEmail" }); } // ShopperLocale (string) maxLength if (this.ShopperLocale != null && this.ShopperLocale.Length > 32) { - yield return new ValidationResult("Invalid value for ShopperLocale, length must be less than 32.", new [] { "ShopperLocale" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperLocale, length must be less than 32.", new [] { "ShopperLocale" }); } // ShopperReference (string) maxLength if (this.ShopperReference != null && this.ShopperReference.Length > 256) { - yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); } // ShopperReference (string) minLength if (this.ShopperReference != null && this.ShopperReference.Length < 3) { - yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); } // ShopperStatement (string) maxLength if (this.ShopperStatement != null && this.ShopperStatement.Length > 10000) { - yield return new ValidationResult("Invalid value for ShopperStatement, length must be less than 10000.", new [] { "ShopperStatement" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperStatement, length must be less than 10000.", new [] { "ShopperStatement" }); } // SocialSecurityNumber (string) maxLength if (this.SocialSecurityNumber != null && this.SocialSecurityNumber.Length > 32) { - yield return new ValidationResult("Invalid value for SocialSecurityNumber, length must be less than 32.", new [] { "SocialSecurityNumber" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for SocialSecurityNumber, length must be less than 32.", new [] { "SocialSecurityNumber" }); } // TelephoneNumber (string) maxLength if (this.TelephoneNumber != null && this.TelephoneNumber.Length > 32) { - yield return new ValidationResult("Invalid value for TelephoneNumber, length must be less than 32.", new [] { "TelephoneNumber" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TelephoneNumber, length must be less than 32.", new [] { "TelephoneNumber" }); } yield break; } } - /// - /// A Json converter for type - /// - public class PaymentLinkResponseJsonConverter : JsonConverter - { - /// - /// The format to use to serialize DateOfBirth - /// - public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd"; - - /// - /// The format to use to serialize DeliverAt - /// - public static string DeliverAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - - /// - /// The format to use to serialize ExpiresAt - /// - public static string ExpiresAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - - /// - /// The format to use to serialize UpdatedAt - /// - public static string UpdatedAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - - /// - /// Deserializes json to - /// - /// - /// - /// - /// - /// - public override PaymentLinkResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) - { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option id = default; - Option merchantAccount = default; - Option reference = default; - Option status = default; - Option url = default; - Option> allowedPaymentMethods = default; - Option applicationInfo = default; - Option
billingAddress = default; - Option> blockedPaymentMethods = default; - Option captureDelayHours = default; - Option countryCode = default; - Option dateOfBirth = default; - Option deliverAt = default; - Option
deliveryAddress = default; - Option description = default; - Option expiresAt = default; - Option fundOrigin = default; - Option fundRecipient = default; - Option> installmentOptions = default; - Option> lineItems = default; - Option manualCapture = default; - Option mcc = default; - Option merchantOrderReference = default; - Option> metadata = default; - Option platformChargebackLogic = default; - Option recurringProcessingModel = default; - Option> requiredShopperFields = default; - Option returnUrl = default; - Option reusable = default; - Option riskData = default; - Option shopperEmail = default; - Option shopperLocale = default; - Option shopperName = default; - Option shopperReference = default; - Option shopperStatement = default; - Option showRemovePaymentMethodButton = default; - Option socialSecurityNumber = default; - Option splitCardFundingSources = default; - Option> splits = default; - Option store = default; - Option storePaymentMethodMode = default; - Option telephoneNumber = default; - Option themeId = default; - Option threeDS2RequestData = default; - Option updatedAt = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "id": - id = new Option(utf8JsonReader.GetString()); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "status": - string statusRawValue = utf8JsonReader.GetString(); - if (statusRawValue != null) - status = new Option(PaymentLinkResponse.StatusEnumFromStringOrDefault(statusRawValue)); - break; - case "url": - url = new Option(utf8JsonReader.GetString()); - break; - case "allowedPaymentMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - allowedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "applicationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "billingAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - billingAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "blockedPaymentMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - blockedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "captureDelayHours": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - captureDelayHours = new Option(utf8JsonReader.GetInt32()); - break; - case "countryCode": - countryCode = new Option(utf8JsonReader.GetString()); - break; - case "dateOfBirth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliverAt": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliverAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliveryAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliveryAddress = new Option
(JsonSerializer.Deserialize
(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "description": - description = new Option(utf8JsonReader.GetString()); - break; - case "expiresAt": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - expiresAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "fundOrigin": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fundOrigin = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "fundRecipient": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fundRecipient = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "installmentOptions": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - installmentOptions = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "lineItems": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "manualCapture": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - manualCapture = new Option(utf8JsonReader.GetBoolean()); - break; - case "mcc": - mcc = new Option(utf8JsonReader.GetString()); - break; - case "merchantOrderReference": - merchantOrderReference = new Option(utf8JsonReader.GetString()); - break; - case "metadata": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "platformChargebackLogic": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "recurringProcessingModel": - string recurringProcessingModelRawValue = utf8JsonReader.GetString(); - if (recurringProcessingModelRawValue != null) - recurringProcessingModel = new Option(PaymentLinkResponse.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); - break; - case "requiredShopperFields": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredShopperFields = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "returnUrl": - returnUrl = new Option(utf8JsonReader.GetString()); - break; - case "reusable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - reusable = new Option(utf8JsonReader.GetBoolean()); - break; - case "riskData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - riskData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "shopperLocale": - shopperLocale = new Option(utf8JsonReader.GetString()); - break; - case "shopperName": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperReference": - shopperReference = new Option(utf8JsonReader.GetString()); - break; - case "shopperStatement": - shopperStatement = new Option(utf8JsonReader.GetString()); - break; - case "showRemovePaymentMethodButton": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - showRemovePaymentMethodButton = new Option(utf8JsonReader.GetBoolean()); - break; - case "socialSecurityNumber": - socialSecurityNumber = new Option(utf8JsonReader.GetString()); - break; - case "splitCardFundingSources": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splitCardFundingSources = new Option(utf8JsonReader.GetBoolean()); - break; - case "splits": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "store": - store = new Option(utf8JsonReader.GetString()); - break; - case "storePaymentMethodMode": - string storePaymentMethodModeRawValue = utf8JsonReader.GetString(); - if (storePaymentMethodModeRawValue != null) - storePaymentMethodMode = new Option(PaymentLinkResponse.StorePaymentMethodModeEnumFromStringOrDefault(storePaymentMethodModeRawValue)); - break; - case "telephoneNumber": - telephoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "themeId": - themeId = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2RequestData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "updatedAt": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - updatedAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class PaymentLinkResponse.", nameof(amount)); - - if (!id.IsSet) - throw new ArgumentException("Property is required for class PaymentLinkResponse.", nameof(id)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentLinkResponse.", nameof(merchantAccount)); - - if (!reference.IsSet) - throw new ArgumentException("Property is required for class PaymentLinkResponse.", nameof(reference)); - - if (!status.IsSet) - throw new ArgumentException("Property is required for class PaymentLinkResponse.", nameof(status)); - - if (!url.IsSet) - throw new ArgumentException("Property is required for class PaymentLinkResponse.", nameof(url)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentLinkResponse."); - - if (id.IsSet && id.Value == null) - throw new ArgumentNullException(nameof(id), "Property is not nullable for class PaymentLinkResponse."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentLinkResponse."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentLinkResponse."); - - if (status.IsSet && status.Value == null) - throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaymentLinkResponse."); - - if (url.IsSet && url.Value == null) - throw new ArgumentNullException(nameof(url), "Property is not nullable for class PaymentLinkResponse."); - - if (allowedPaymentMethods.IsSet && allowedPaymentMethods.Value == null) - throw new ArgumentNullException(nameof(allowedPaymentMethods), "Property is not nullable for class PaymentLinkResponse."); - - if (applicationInfo.IsSet && applicationInfo.Value == null) - throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentLinkResponse."); - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class PaymentLinkResponse."); - - if (blockedPaymentMethods.IsSet && blockedPaymentMethods.Value == null) - throw new ArgumentNullException(nameof(blockedPaymentMethods), "Property is not nullable for class PaymentLinkResponse."); - - if (captureDelayHours.IsSet && captureDelayHours.Value == null) - throw new ArgumentNullException(nameof(captureDelayHours), "Property is not nullable for class PaymentLinkResponse."); - - if (countryCode.IsSet && countryCode.Value == null) - throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class PaymentLinkResponse."); - - if (dateOfBirth.IsSet && dateOfBirth.Value == null) - throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class PaymentLinkResponse."); - - if (deliverAt.IsSet && deliverAt.Value == null) - throw new ArgumentNullException(nameof(deliverAt), "Property is not nullable for class PaymentLinkResponse."); - - if (deliveryAddress.IsSet && deliveryAddress.Value == null) - throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class PaymentLinkResponse."); - - if (description.IsSet && description.Value == null) - throw new ArgumentNullException(nameof(description), "Property is not nullable for class PaymentLinkResponse."); - - if (expiresAt.IsSet && expiresAt.Value == null) - throw new ArgumentNullException(nameof(expiresAt), "Property is not nullable for class PaymentLinkResponse."); - - if (fundOrigin.IsSet && fundOrigin.Value == null) - throw new ArgumentNullException(nameof(fundOrigin), "Property is not nullable for class PaymentLinkResponse."); - - if (fundRecipient.IsSet && fundRecipient.Value == null) - throw new ArgumentNullException(nameof(fundRecipient), "Property is not nullable for class PaymentLinkResponse."); - - if (installmentOptions.IsSet && installmentOptions.Value == null) - throw new ArgumentNullException(nameof(installmentOptions), "Property is not nullable for class PaymentLinkResponse."); - - if (lineItems.IsSet && lineItems.Value == null) - throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentLinkResponse."); - - if (manualCapture.IsSet && manualCapture.Value == null) - throw new ArgumentNullException(nameof(manualCapture), "Property is not nullable for class PaymentLinkResponse."); - - if (mcc.IsSet && mcc.Value == null) - throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class PaymentLinkResponse."); - - if (merchantOrderReference.IsSet && merchantOrderReference.Value == null) - throw new ArgumentNullException(nameof(merchantOrderReference), "Property is not nullable for class PaymentLinkResponse."); - - if (metadata.IsSet && metadata.Value == null) - throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class PaymentLinkResponse."); - - if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) - throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class PaymentLinkResponse."); - - if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) - throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class PaymentLinkResponse."); - - if (requiredShopperFields.IsSet && requiredShopperFields.Value == null) - throw new ArgumentNullException(nameof(requiredShopperFields), "Property is not nullable for class PaymentLinkResponse."); - - if (returnUrl.IsSet && returnUrl.Value == null) - throw new ArgumentNullException(nameof(returnUrl), "Property is not nullable for class PaymentLinkResponse."); - - if (reusable.IsSet && reusable.Value == null) - throw new ArgumentNullException(nameof(reusable), "Property is not nullable for class PaymentLinkResponse."); - - if (riskData.IsSet && riskData.Value == null) - throw new ArgumentNullException(nameof(riskData), "Property is not nullable for class PaymentLinkResponse."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class PaymentLinkResponse."); - - if (shopperLocale.IsSet && shopperLocale.Value == null) - throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class PaymentLinkResponse."); - - if (shopperName.IsSet && shopperName.Value == null) - throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class PaymentLinkResponse."); - - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class PaymentLinkResponse."); - - if (shopperStatement.IsSet && shopperStatement.Value == null) - throw new ArgumentNullException(nameof(shopperStatement), "Property is not nullable for class PaymentLinkResponse."); - - if (showRemovePaymentMethodButton.IsSet && showRemovePaymentMethodButton.Value == null) - throw new ArgumentNullException(nameof(showRemovePaymentMethodButton), "Property is not nullable for class PaymentLinkResponse."); - - if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) - throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class PaymentLinkResponse."); - - if (splitCardFundingSources.IsSet && splitCardFundingSources.Value == null) - throw new ArgumentNullException(nameof(splitCardFundingSources), "Property is not nullable for class PaymentLinkResponse."); - - if (splits.IsSet && splits.Value == null) - throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentLinkResponse."); - - if (store.IsSet && store.Value == null) - throw new ArgumentNullException(nameof(store), "Property is not nullable for class PaymentLinkResponse."); - - if (storePaymentMethodMode.IsSet && storePaymentMethodMode.Value == null) - throw new ArgumentNullException(nameof(storePaymentMethodMode), "Property is not nullable for class PaymentLinkResponse."); - - if (telephoneNumber.IsSet && telephoneNumber.Value == null) - throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class PaymentLinkResponse."); - - if (themeId.IsSet && themeId.Value == null) - throw new ArgumentNullException(nameof(themeId), "Property is not nullable for class PaymentLinkResponse."); - - if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) - throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class PaymentLinkResponse."); - - if (updatedAt.IsSet && updatedAt.Value == null) - throw new ArgumentNullException(nameof(updatedAt), "Property is not nullable for class PaymentLinkResponse."); - - return new PaymentLinkResponse(amount.Value, id.Value, merchantAccount.Value, reference.Value, status.Value.Value, url.Value, allowedPaymentMethods, applicationInfo, billingAddress, blockedPaymentMethods, captureDelayHours, countryCode, dateOfBirth, deliverAt, deliveryAddress, description, expiresAt, fundOrigin, fundRecipient, installmentOptions, lineItems, manualCapture, mcc, merchantOrderReference, metadata, platformChargebackLogic, recurringProcessingModel, requiredShopperFields, returnUrl, reusable, riskData, shopperEmail, shopperLocale, shopperName, shopperReference, shopperStatement, showRemovePaymentMethodButton, socialSecurityNumber, splitCardFundingSources, splits, store, storePaymentMethodMode, telephoneNumber, themeId, threeDS2RequestData, updatedAt); - } - - /// - /// Serializes a - /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentLinkResponse paymentLinkResponse, JsonSerializerOptions jsonSerializerOptions) - { - writer.WriteStartObject(); - - WriteProperties(writer, paymentLinkResponse, jsonSerializerOptions); - writer.WriteEndObject(); - } - - /// - /// Serializes the properties of - /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentLinkResponse paymentLinkResponse, JsonSerializerOptions jsonSerializerOptions) - { - if (paymentLinkResponse.Amount == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.Amount), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.Id == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.Id), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.MerchantAccount), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.Reference == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.Reference), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.Url == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.Url), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.AllowedPaymentMethodsOption.IsSet && paymentLinkResponse.AllowedPaymentMethods == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.AllowedPaymentMethods), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.ApplicationInfoOption.IsSet && paymentLinkResponse.ApplicationInfo == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.ApplicationInfo), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.BillingAddressOption.IsSet && paymentLinkResponse.BillingAddress == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.BillingAddress), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.BlockedPaymentMethodsOption.IsSet && paymentLinkResponse.BlockedPaymentMethods == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.BlockedPaymentMethods), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.CountryCodeOption.IsSet && paymentLinkResponse.CountryCode == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.CountryCode), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.DeliveryAddressOption.IsSet && paymentLinkResponse.DeliveryAddress == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.DeliveryAddress), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.DescriptionOption.IsSet && paymentLinkResponse.Description == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.Description), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.FundOriginOption.IsSet && paymentLinkResponse.FundOrigin == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.FundOrigin), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.FundRecipientOption.IsSet && paymentLinkResponse.FundRecipient == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.FundRecipient), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.InstallmentOptionsOption.IsSet && paymentLinkResponse.InstallmentOptions == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.InstallmentOptions), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.LineItemsOption.IsSet && paymentLinkResponse.LineItems == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.LineItems), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.MccOption.IsSet && paymentLinkResponse.Mcc == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.Mcc), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.MerchantOrderReferenceOption.IsSet && paymentLinkResponse.MerchantOrderReference == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.MerchantOrderReference), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.MetadataOption.IsSet && paymentLinkResponse.Metadata == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.Metadata), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.PlatformChargebackLogicOption.IsSet && paymentLinkResponse.PlatformChargebackLogic == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.PlatformChargebackLogic), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.RequiredShopperFieldsOption.IsSet && paymentLinkResponse.RequiredShopperFields == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.RequiredShopperFields), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.ReturnUrlOption.IsSet && paymentLinkResponse.ReturnUrl == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.ReturnUrl), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.RiskDataOption.IsSet && paymentLinkResponse.RiskData == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.RiskData), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.ShopperEmailOption.IsSet && paymentLinkResponse.ShopperEmail == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.ShopperEmail), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.ShopperLocaleOption.IsSet && paymentLinkResponse.ShopperLocale == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.ShopperLocale), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.ShopperNameOption.IsSet && paymentLinkResponse.ShopperName == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.ShopperName), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.ShopperReferenceOption.IsSet && paymentLinkResponse.ShopperReference == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.ShopperReference), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.ShopperStatementOption.IsSet && paymentLinkResponse.ShopperStatement == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.ShopperStatement), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.SocialSecurityNumberOption.IsSet && paymentLinkResponse.SocialSecurityNumber == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.SocialSecurityNumber), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.SplitsOption.IsSet && paymentLinkResponse.Splits == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.Splits), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.StoreOption.IsSet && paymentLinkResponse.Store == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.Store), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.TelephoneNumberOption.IsSet && paymentLinkResponse.TelephoneNumber == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.TelephoneNumber), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.ThemeIdOption.IsSet && paymentLinkResponse.ThemeId == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.ThemeId), "Property is required for class PaymentLinkResponse."); - - if (paymentLinkResponse.ThreeDS2RequestDataOption.IsSet && paymentLinkResponse.ThreeDS2RequestData == null) - throw new ArgumentNullException(nameof(paymentLinkResponse.ThreeDS2RequestData), "Property is required for class PaymentLinkResponse."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, paymentLinkResponse.Amount, jsonSerializerOptions); - writer.WriteString("id", paymentLinkResponse.Id); - - writer.WriteString("merchantAccount", paymentLinkResponse.MerchantAccount); - - writer.WriteString("reference", paymentLinkResponse.Reference); - - var statusRawValue = PaymentLinkResponse.StatusEnumToJsonValue(paymentLinkResponse.Status); - writer.WriteString("status", statusRawValue); - writer.WriteString("url", paymentLinkResponse.Url); - - if (paymentLinkResponse.AllowedPaymentMethodsOption.IsSet) - { - writer.WritePropertyName("allowedPaymentMethods"); - JsonSerializer.Serialize(writer, paymentLinkResponse.AllowedPaymentMethods, jsonSerializerOptions); - } - if (paymentLinkResponse.ApplicationInfoOption.IsSet) - { - writer.WritePropertyName("applicationInfo"); - JsonSerializer.Serialize(writer, paymentLinkResponse.ApplicationInfo, jsonSerializerOptions); - } - if (paymentLinkResponse.BillingAddressOption.IsSet) - { - writer.WritePropertyName("billingAddress"); - JsonSerializer.Serialize(writer, paymentLinkResponse.BillingAddress, jsonSerializerOptions); - } - if (paymentLinkResponse.BlockedPaymentMethodsOption.IsSet) - { - writer.WritePropertyName("blockedPaymentMethods"); - JsonSerializer.Serialize(writer, paymentLinkResponse.BlockedPaymentMethods, jsonSerializerOptions); - } - if (paymentLinkResponse.CaptureDelayHoursOption.IsSet) - writer.WriteNumber("captureDelayHours", paymentLinkResponse.CaptureDelayHoursOption.Value.Value); - - if (paymentLinkResponse.CountryCodeOption.IsSet) - writer.WriteString("countryCode", paymentLinkResponse.CountryCode); - - if (paymentLinkResponse.DateOfBirthOption.IsSet) - writer.WriteString("dateOfBirth", paymentLinkResponse.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); - - if (paymentLinkResponse.DeliverAtOption.IsSet) - writer.WriteString("deliverAt", paymentLinkResponse.DeliverAtOption.Value.Value.ToString(DeliverAtFormat)); - - if (paymentLinkResponse.DeliveryAddressOption.IsSet) - { - writer.WritePropertyName("deliveryAddress"); - JsonSerializer.Serialize(writer, paymentLinkResponse.DeliveryAddress, jsonSerializerOptions); - } - if (paymentLinkResponse.DescriptionOption.IsSet) - writer.WriteString("description", paymentLinkResponse.Description); - - if (paymentLinkResponse.ExpiresAtOption.IsSet) - writer.WriteString("expiresAt", paymentLinkResponse.ExpiresAtOption.Value.Value.ToString(ExpiresAtFormat)); - - if (paymentLinkResponse.FundOriginOption.IsSet) - { - writer.WritePropertyName("fundOrigin"); - JsonSerializer.Serialize(writer, paymentLinkResponse.FundOrigin, jsonSerializerOptions); - } - if (paymentLinkResponse.FundRecipientOption.IsSet) - { - writer.WritePropertyName("fundRecipient"); - JsonSerializer.Serialize(writer, paymentLinkResponse.FundRecipient, jsonSerializerOptions); - } - if (paymentLinkResponse.InstallmentOptionsOption.IsSet) - { - writer.WritePropertyName("installmentOptions"); - JsonSerializer.Serialize(writer, paymentLinkResponse.InstallmentOptions, jsonSerializerOptions); - } - if (paymentLinkResponse.LineItemsOption.IsSet) - { - writer.WritePropertyName("lineItems"); - JsonSerializer.Serialize(writer, paymentLinkResponse.LineItems, jsonSerializerOptions); - } - if (paymentLinkResponse.ManualCaptureOption.IsSet) - writer.WriteBoolean("manualCapture", paymentLinkResponse.ManualCaptureOption.Value.Value); - - if (paymentLinkResponse.MccOption.IsSet) - writer.WriteString("mcc", paymentLinkResponse.Mcc); - - if (paymentLinkResponse.MerchantOrderReferenceOption.IsSet) - writer.WriteString("merchantOrderReference", paymentLinkResponse.MerchantOrderReference); - - if (paymentLinkResponse.MetadataOption.IsSet) - { - writer.WritePropertyName("metadata"); - JsonSerializer.Serialize(writer, paymentLinkResponse.Metadata, jsonSerializerOptions); - } - if (paymentLinkResponse.PlatformChargebackLogicOption.IsSet) - { - writer.WritePropertyName("platformChargebackLogic"); - JsonSerializer.Serialize(writer, paymentLinkResponse.PlatformChargebackLogic, jsonSerializerOptions); - } - var recurringProcessingModelRawValue = PaymentLinkResponse.RecurringProcessingModelEnumToJsonValue(paymentLinkResponse.RecurringProcessingModelOption.Value.Value); - writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); - if (paymentLinkResponse.RequiredShopperFieldsOption.IsSet) - { - writer.WritePropertyName("requiredShopperFields"); - JsonSerializer.Serialize(writer, paymentLinkResponse.RequiredShopperFields, jsonSerializerOptions); - } - if (paymentLinkResponse.ReturnUrlOption.IsSet) - writer.WriteString("returnUrl", paymentLinkResponse.ReturnUrl); - - if (paymentLinkResponse.ReusableOption.IsSet) - writer.WriteBoolean("reusable", paymentLinkResponse.ReusableOption.Value.Value); - - if (paymentLinkResponse.RiskDataOption.IsSet) - { - writer.WritePropertyName("riskData"); - JsonSerializer.Serialize(writer, paymentLinkResponse.RiskData, jsonSerializerOptions); - } - if (paymentLinkResponse.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", paymentLinkResponse.ShopperEmail); - - if (paymentLinkResponse.ShopperLocaleOption.IsSet) - writer.WriteString("shopperLocale", paymentLinkResponse.ShopperLocale); - - if (paymentLinkResponse.ShopperNameOption.IsSet) - { - writer.WritePropertyName("shopperName"); - JsonSerializer.Serialize(writer, paymentLinkResponse.ShopperName, jsonSerializerOptions); - } - if (paymentLinkResponse.ShopperReferenceOption.IsSet) - writer.WriteString("shopperReference", paymentLinkResponse.ShopperReference); - - if (paymentLinkResponse.ShopperStatementOption.IsSet) - writer.WriteString("shopperStatement", paymentLinkResponse.ShopperStatement); - - if (paymentLinkResponse.ShowRemovePaymentMethodButtonOption.IsSet) - writer.WriteBoolean("showRemovePaymentMethodButton", paymentLinkResponse.ShowRemovePaymentMethodButtonOption.Value.Value); - - if (paymentLinkResponse.SocialSecurityNumberOption.IsSet) - writer.WriteString("socialSecurityNumber", paymentLinkResponse.SocialSecurityNumber); - - if (paymentLinkResponse.SplitCardFundingSourcesOption.IsSet) - writer.WriteBoolean("splitCardFundingSources", paymentLinkResponse.SplitCardFundingSourcesOption.Value.Value); - - if (paymentLinkResponse.SplitsOption.IsSet) - { - writer.WritePropertyName("splits"); - JsonSerializer.Serialize(writer, paymentLinkResponse.Splits, jsonSerializerOptions); - } - if (paymentLinkResponse.StoreOption.IsSet) - writer.WriteString("store", paymentLinkResponse.Store); - - var storePaymentMethodModeRawValue = PaymentLinkResponse.StorePaymentMethodModeEnumToJsonValue(paymentLinkResponse.StorePaymentMethodModeOption.Value.Value); - writer.WriteString("storePaymentMethodMode", storePaymentMethodModeRawValue); - if (paymentLinkResponse.TelephoneNumberOption.IsSet) - writer.WriteString("telephoneNumber", paymentLinkResponse.TelephoneNumber); - - if (paymentLinkResponse.ThemeIdOption.IsSet) - writer.WriteString("themeId", paymentLinkResponse.ThemeId); - - if (paymentLinkResponse.ThreeDS2RequestDataOption.IsSet) - { - writer.WritePropertyName("threeDS2RequestData"); - JsonSerializer.Serialize(writer, paymentLinkResponse.ThreeDS2RequestData, jsonSerializerOptions); - } - if (paymentLinkResponse.UpdatedAtOption.IsSet) - writer.WriteString("updatedAt", paymentLinkResponse.UpdatedAtOption.Value.Value.ToString(UpdatedAtFormat)); - } - } } diff --git a/Adyen/Model/Checkout/PaymentMethod.cs b/Adyen/Model/Checkout/PaymentMethod.cs index 74ef075b5..14a47b70b 100644 --- a/Adyen/Model/Checkout/PaymentMethod.cs +++ b/Adyen/Model/Checkout/PaymentMethod.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,257 +15,149 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentMethod /// - public partial class PaymentMethod : IValidatableObject + [DataContract(Name = "PaymentMethod")] + public partial class PaymentMethod : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// A list of apps for this payment method. - /// Brand for the selected gift card. For example: plastix, hmclub. - /// List of possible brands. For example: visa, mc. - /// The configuration of the payment method. - /// The funding source of the payment method. - /// group - /// All input details to be provided to complete the payment with this payment method. - /// A list of issuers for this payment method. - /// The displayable name of this payment method. - /// The unique payment method code. - [JsonConstructor] - public PaymentMethod(Option> apps = default, Option brand = default, Option> brands = default, Option> varConfiguration = default, Option fundingSource = default, Option group = default, Option> inputDetails = default, Option> issuers = default, Option name = default, Option type = default) - { - AppsOption = apps; - BrandOption = brand; - BrandsOption = brands; - VarConfigurationOption = varConfiguration; - FundingSourceOption = fundingSource; - GroupOption = group; - InputDetailsOption = inputDetails; - IssuersOption = issuers; - NameOption = name; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The funding source of the payment method. /// /// The funding source of the payment method. + [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// + [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// + [EnumMember(Value = "debit")] Debit = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static FundingSourceEnum FundingSourceEnumFromString(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) - { - if (value == FundingSourceEnum.Credit) - return "credit"; - - if (value == FundingSourceEnum.Debit) - return "debit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } /// /// The funding source of the payment method. /// /// The funding source of the payment method. - [JsonPropertyName("fundingSource")] - public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } /// - /// Used to track the state of Apps + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AppsOption { get; private set; } + /// A list of apps for this payment method.. + /// Brand for the selected gift card. For example: plastix, hmclub.. + /// List of possible brands. For example: visa, mc.. + /// The configuration of the payment method.. + /// The funding source of the payment method.. + /// group. + /// All input details to be provided to complete the payment with this payment method.. + /// A list of issuers for this payment method.. + /// The displayable name of this payment method.. + /// Indicates whether this payment method should be promoted or not.. + /// The unique payment method code.. + public PaymentMethod(List apps = default(List), string brand = default(string), List brands = default(List), Dictionary configuration = default(Dictionary), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), PaymentMethodGroup group = default(PaymentMethodGroup), List inputDetails = default(List), List issuers = default(List), string name = default(string), bool? promoted = default(bool?), string type = default(string)) + { + this.Apps = apps; + this.Brand = brand; + this.Brands = brands; + this._Configuration = configuration; + this.FundingSource = fundingSource; + this.Group = group; + this.InputDetails = inputDetails; + this.Issuers = issuers; + this.Name = name; + this.Promoted = promoted; + this.Type = type; + } /// /// A list of apps for this payment method. /// /// A list of apps for this payment method. - [JsonPropertyName("apps")] - public List Apps { get { return this.AppsOption; } set { this.AppsOption = new Option>(value); } } - - /// - /// Used to track the state of Brand - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BrandOption { get; private set; } + [DataMember(Name = "apps", EmitDefaultValue = false)] + public List Apps { get; set; } /// /// Brand for the selected gift card. For example: plastix, hmclub. /// /// Brand for the selected gift card. For example: plastix, hmclub. - [JsonPropertyName("brand")] - public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } - - /// - /// Used to track the state of Brands - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> BrandsOption { get; private set; } + [DataMember(Name = "brand", EmitDefaultValue = false)] + public string Brand { get; set; } /// /// List of possible brands. For example: visa, mc. /// /// List of possible brands. For example: visa, mc. - [JsonPropertyName("brands")] - public List Brands { get { return this.BrandsOption; } set { this.BrandsOption = new Option>(value); } } - - /// - /// Used to track the state of VarConfiguration - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> VarConfigurationOption { get; private set; } + [DataMember(Name = "brands", EmitDefaultValue = false)] + public List Brands { get; set; } /// /// The configuration of the payment method. /// /// The configuration of the payment method. - [JsonPropertyName("configuration")] - public Dictionary VarConfiguration { get { return this.VarConfigurationOption; } set { this.VarConfigurationOption = new Option>(value); } } - - /// - /// Used to track the state of Group - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option GroupOption { get; private set; } + [DataMember(Name = "configuration", EmitDefaultValue = false)] + public Dictionary _Configuration { get; set; } /// /// Gets or Sets Group /// - [JsonPropertyName("group")] - public PaymentMethodGroup Group { get { return this.GroupOption; } set { this.GroupOption = new Option(value); } } - - /// - /// Used to track the state of InputDetails - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> InputDetailsOption { get; private set; } + [DataMember(Name = "group", EmitDefaultValue = false)] + public PaymentMethodGroup Group { get; set; } /// /// All input details to be provided to complete the payment with this payment method. /// /// All input details to be provided to complete the payment with this payment method. - [JsonPropertyName("inputDetails")] - [Obsolete] - public List InputDetails { get { return this.InputDetailsOption; } set { this.InputDetailsOption = new Option>(value); } } - - /// - /// Used to track the state of Issuers - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> IssuersOption { get; private set; } + [DataMember(Name = "inputDetails", EmitDefaultValue = false)] + [Obsolete("")] + public List InputDetails { get; set; } /// /// A list of issuers for this payment method. /// /// A list of issuers for this payment method. - [JsonPropertyName("issuers")] - public List Issuers { get { return this.IssuersOption; } set { this.IssuersOption = new Option>(value); } } - - /// - /// Used to track the state of Name - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NameOption { get; private set; } + [DataMember(Name = "issuers", EmitDefaultValue = false)] + public List Issuers { get; set; } /// /// The displayable name of this payment method. /// /// The displayable name of this payment method. - [JsonPropertyName("name")] - public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } /// - /// Used to track the state of Type + /// Indicates whether this payment method should be promoted or not. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } + /// Indicates whether this payment method should be promoted or not. + [DataMember(Name = "promoted", EmitDefaultValue = false)] + public bool? Promoted { get; set; } /// /// The unique payment method code. /// /// The unique payment method code. - [JsonPropertyName("type")] - public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } /// /// Returns the string presentation of the object @@ -277,244 +170,168 @@ public override string ToString() sb.Append(" Apps: ").Append(Apps).Append("\n"); sb.Append(" Brand: ").Append(Brand).Append("\n"); sb.Append(" Brands: ").Append(Brands).Append("\n"); - sb.Append(" VarConfiguration: ").Append(VarConfiguration).Append("\n"); + sb.Append(" _Configuration: ").Append(_Configuration).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); sb.Append(" Group: ").Append(Group).Append("\n"); sb.Append(" InputDetails: ").Append(InputDetails).Append("\n"); sb.Append(" Issuers: ").Append(Issuers).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Promoted: ").Append(Promoted).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentMethodJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentMethod Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option> apps = default; - Option brand = default; - Option> brands = default; - Option> varConfiguration = default; - Option fundingSource = default; - Option group = default; - Option> inputDetails = default; - Option> issuers = default; - Option name = default; - Option type = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "apps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - apps = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "brand": - brand = new Option(utf8JsonReader.GetString()); - break; - case "brands": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - brands = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "configuration": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varConfiguration = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "fundingSource": - string fundingSourceRawValue = utf8JsonReader.GetString(); - if (fundingSourceRawValue != null) - fundingSource = new Option(PaymentMethod.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); - break; - case "group": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - group = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "inputDetails": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - inputDetails = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "issuers": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - issuers = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - case "type": - type = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (apps.IsSet && apps.Value == null) - throw new ArgumentNullException(nameof(apps), "Property is not nullable for class PaymentMethod."); - - if (brand.IsSet && brand.Value == null) - throw new ArgumentNullException(nameof(brand), "Property is not nullable for class PaymentMethod."); - - if (brands.IsSet && brands.Value == null) - throw new ArgumentNullException(nameof(brands), "Property is not nullable for class PaymentMethod."); - - if (varConfiguration.IsSet && varConfiguration.Value == null) - throw new ArgumentNullException(nameof(varConfiguration), "Property is not nullable for class PaymentMethod."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class PaymentMethod."); - - if (group.IsSet && group.Value == null) - throw new ArgumentNullException(nameof(group), "Property is not nullable for class PaymentMethod."); - - if (inputDetails.IsSet && inputDetails.Value == null) - throw new ArgumentNullException(nameof(inputDetails), "Property is not nullable for class PaymentMethod."); - - if (issuers.IsSet && issuers.Value == null) - throw new ArgumentNullException(nameof(issuers), "Property is not nullable for class PaymentMethod."); - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class PaymentMethod."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PaymentMethod."); - - return new PaymentMethod(apps, brand, brands, varConfiguration, fundingSource, group, inputDetails, issuers, name, type); + return this.Equals(input as PaymentMethod); } /// - /// Serializes a + /// Returns true if PaymentMethod instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentMethod paymentMethod, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentMethod to be compared + /// Boolean + public bool Equals(PaymentMethod input) { - writer.WriteStartObject(); - - WriteProperties(writer, paymentMethod, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Apps == input.Apps || + this.Apps != null && + input.Apps != null && + this.Apps.SequenceEqual(input.Apps) + ) && + ( + this.Brand == input.Brand || + (this.Brand != null && + this.Brand.Equals(input.Brand)) + ) && + ( + this.Brands == input.Brands || + this.Brands != null && + input.Brands != null && + this.Brands.SequenceEqual(input.Brands) + ) && + ( + this._Configuration == input._Configuration || + this._Configuration != null && + input._Configuration != null && + this._Configuration.SequenceEqual(input._Configuration) + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource.Equals(input.FundingSource) + ) && + ( + this.Group == input.Group || + (this.Group != null && + this.Group.Equals(input.Group)) + ) && + ( + this.InputDetails == input.InputDetails || + this.InputDetails != null && + input.InputDetails != null && + this.InputDetails.SequenceEqual(input.InputDetails) + ) && + ( + this.Issuers == input.Issuers || + this.Issuers != null && + input.Issuers != null && + this.Issuers.SequenceEqual(input.Issuers) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Promoted == input.Promoted || + this.Promoted.Equals(input.Promoted) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentMethod paymentMethod, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paymentMethod.AppsOption.IsSet && paymentMethod.Apps == null) - throw new ArgumentNullException(nameof(paymentMethod.Apps), "Property is required for class PaymentMethod."); - - if (paymentMethod.BrandOption.IsSet && paymentMethod.Brand == null) - throw new ArgumentNullException(nameof(paymentMethod.Brand), "Property is required for class PaymentMethod."); - - if (paymentMethod.BrandsOption.IsSet && paymentMethod.Brands == null) - throw new ArgumentNullException(nameof(paymentMethod.Brands), "Property is required for class PaymentMethod."); - - if (paymentMethod.VarConfigurationOption.IsSet && paymentMethod.VarConfiguration == null) - throw new ArgumentNullException(nameof(paymentMethod.VarConfiguration), "Property is required for class PaymentMethod."); - - if (paymentMethod.GroupOption.IsSet && paymentMethod.Group == null) - throw new ArgumentNullException(nameof(paymentMethod.Group), "Property is required for class PaymentMethod."); - - if (paymentMethod.InputDetailsOption.IsSet && paymentMethod.InputDetails == null) - throw new ArgumentNullException(nameof(paymentMethod.InputDetails), "Property is required for class PaymentMethod."); - - if (paymentMethod.IssuersOption.IsSet && paymentMethod.Issuers == null) - throw new ArgumentNullException(nameof(paymentMethod.Issuers), "Property is required for class PaymentMethod."); - - if (paymentMethod.NameOption.IsSet && paymentMethod.Name == null) - throw new ArgumentNullException(nameof(paymentMethod.Name), "Property is required for class PaymentMethod."); - - if (paymentMethod.TypeOption.IsSet && paymentMethod.Type == null) - throw new ArgumentNullException(nameof(paymentMethod.Type), "Property is required for class PaymentMethod."); - - if (paymentMethod.AppsOption.IsSet) - { - writer.WritePropertyName("apps"); - JsonSerializer.Serialize(writer, paymentMethod.Apps, jsonSerializerOptions); - } - if (paymentMethod.BrandOption.IsSet) - writer.WriteString("brand", paymentMethod.Brand); - - if (paymentMethod.BrandsOption.IsSet) - { - writer.WritePropertyName("brands"); - JsonSerializer.Serialize(writer, paymentMethod.Brands, jsonSerializerOptions); - } - if (paymentMethod.VarConfigurationOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("configuration"); - JsonSerializer.Serialize(writer, paymentMethod.VarConfiguration, jsonSerializerOptions); - } - var fundingSourceRawValue = PaymentMethod.FundingSourceEnumToJsonValue(paymentMethod.FundingSourceOption.Value.Value); - writer.WriteString("fundingSource", fundingSourceRawValue); - if (paymentMethod.GroupOption.IsSet) - { - writer.WritePropertyName("group"); - JsonSerializer.Serialize(writer, paymentMethod.Group, jsonSerializerOptions); - } - if (paymentMethod.InputDetailsOption.IsSet) - { - writer.WritePropertyName("inputDetails"); - JsonSerializer.Serialize(writer, paymentMethod.InputDetails, jsonSerializerOptions); - } - if (paymentMethod.IssuersOption.IsSet) - { - writer.WritePropertyName("issuers"); - JsonSerializer.Serialize(writer, paymentMethod.Issuers, jsonSerializerOptions); + int hashCode = 41; + if (this.Apps != null) + { + hashCode = (hashCode * 59) + this.Apps.GetHashCode(); + } + if (this.Brand != null) + { + hashCode = (hashCode * 59) + this.Brand.GetHashCode(); + } + if (this.Brands != null) + { + hashCode = (hashCode * 59) + this.Brands.GetHashCode(); + } + if (this._Configuration != null) + { + hashCode = (hashCode * 59) + this._Configuration.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + if (this.Group != null) + { + hashCode = (hashCode * 59) + this.Group.GetHashCode(); + } + if (this.InputDetails != null) + { + hashCode = (hashCode * 59) + this.InputDetails.GetHashCode(); + } + if (this.Issuers != null) + { + hashCode = (hashCode * 59) + this.Issuers.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Promoted.GetHashCode(); + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + return hashCode; } - if (paymentMethod.NameOption.IsSet) - writer.WriteString("name", paymentMethod.Name); - - if (paymentMethod.TypeOption.IsSet) - writer.WriteString("type", paymentMethod.Type); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentMethodGroup.cs b/Adyen/Model/Checkout/PaymentMethodGroup.cs index 1672f2cce..4feff3ada 100644 --- a/Adyen/Model/Checkout/PaymentMethodGroup.cs +++ b/Adyen/Model/Checkout/PaymentMethodGroup.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,78 +15,56 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentMethodGroup /// - public partial class PaymentMethodGroup : IValidatableObject + [DataContract(Name = "PaymentMethodGroup")] + public partial class PaymentMethodGroup : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The name of the group. - /// Echo data to be used if the payment method is displayed as part of this group. - /// The unique code of the group. - [JsonConstructor] - public PaymentMethodGroup(Option name = default, Option paymentMethodData = default, Option type = default) + /// The name of the group.. + /// Echo data to be used if the payment method is displayed as part of this group.. + /// The unique code of the group.. + public PaymentMethodGroup(string name = default(string), string paymentMethodData = default(string), string type = default(string)) { - NameOption = name; - PaymentMethodDataOption = paymentMethodData; - TypeOption = type; - OnCreated(); + this.Name = name; + this.PaymentMethodData = paymentMethodData; + this.Type = type; } - partial void OnCreated(); - - /// - /// Used to track the state of Name - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NameOption { get; private set; } - /// /// The name of the group. /// /// The name of the group. - [JsonPropertyName("name")] - public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } - - /// - /// Used to track the state of PaymentMethodData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodDataOption { get; private set; } + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } /// /// Echo data to be used if the payment method is displayed as part of this group. /// /// Echo data to be used if the payment method is displayed as part of this group. - [JsonPropertyName("paymentMethodData")] - public string PaymentMethodData { get { return this.PaymentMethodDataOption; } set { this.PaymentMethodDataOption = new Option(value); } } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } + [DataMember(Name = "paymentMethodData", EmitDefaultValue = false)] + public string PaymentMethodData { get; set; } /// /// The unique code of the group. /// /// The unique code of the group. - [JsonPropertyName("type")] - public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } /// /// Returns the string presentation of the object @@ -103,125 +82,86 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentMethodGroupJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentMethodGroup Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option name = default; - Option paymentMethodData = default; - Option type = default; + return this.Equals(input as PaymentMethodGroup); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PaymentMethodGroup instances are equal + /// + /// Instance of PaymentMethodGroup to be compared + /// Boolean + public bool Equals(PaymentMethodGroup input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethodData": - paymentMethodData = new Option(utf8JsonReader.GetString()); - break; - case "type": - type = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class PaymentMethodGroup."); - - if (paymentMethodData.IsSet && paymentMethodData.Value == null) - throw new ArgumentNullException(nameof(paymentMethodData), "Property is not nullable for class PaymentMethodGroup."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PaymentMethodGroup."); - - return new PaymentMethodGroup(name, paymentMethodData, type); + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.PaymentMethodData == input.PaymentMethodData || + (this.PaymentMethodData != null && + this.PaymentMethodData.Equals(input.PaymentMethodData)) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentMethodGroup paymentMethodGroup, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, paymentMethodGroup, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.PaymentMethodData != null) + { + hashCode = (hashCode * 59) + this.PaymentMethodData.GetHashCode(); + } + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentMethodGroup paymentMethodGroup, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (paymentMethodGroup.NameOption.IsSet && paymentMethodGroup.Name == null) - throw new ArgumentNullException(nameof(paymentMethodGroup.Name), "Property is required for class PaymentMethodGroup."); - - if (paymentMethodGroup.PaymentMethodDataOption.IsSet && paymentMethodGroup.PaymentMethodData == null) - throw new ArgumentNullException(nameof(paymentMethodGroup.PaymentMethodData), "Property is required for class PaymentMethodGroup."); - - if (paymentMethodGroup.TypeOption.IsSet && paymentMethodGroup.Type == null) - throw new ArgumentNullException(nameof(paymentMethodGroup.Type), "Property is required for class PaymentMethodGroup."); - - if (paymentMethodGroup.NameOption.IsSet) - writer.WriteString("name", paymentMethodGroup.Name); - - if (paymentMethodGroup.PaymentMethodDataOption.IsSet) - writer.WriteString("paymentMethodData", paymentMethodGroup.PaymentMethodData); - - if (paymentMethodGroup.TypeOption.IsSet) - writer.WriteString("type", paymentMethodGroup.Type); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentMethodIssuer.cs b/Adyen/Model/Checkout/PaymentMethodIssuer.cs index 5d1ec5950..82fae51a2 100644 --- a/Adyen/Model/Checkout/PaymentMethodIssuer.cs +++ b/Adyen/Model/Checkout/PaymentMethodIssuer.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,65 +15,62 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentMethodIssuer /// - public partial class PaymentMethodIssuer : IValidatableObject + [DataContract(Name = "PaymentMethodIssuer")] + public partial class PaymentMethodIssuer : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The unique identifier of this issuer, to submit in requests to /payments. - /// A localized name of the issuer. - /// A boolean value indicating whether this issuer is unavailable. Can be `true` whenever the issuer is offline. (default to false) - [JsonConstructor] - public PaymentMethodIssuer(string id, string name, Option disabled = default) + [JsonConstructorAttribute] + protected PaymentMethodIssuer() { } + /// + /// Initializes a new instance of the class. + /// + /// A boolean value indicating whether this issuer is unavailable. Can be `true` whenever the issuer is offline. (default to false). + /// The unique identifier of this issuer, to submit in requests to /payments. (required). + /// A localized name of the issuer. (required). + public PaymentMethodIssuer(bool? disabled = false, string id = default(string), string name = default(string)) { - Id = id; - Name = name; - DisabledOption = disabled; - OnCreated(); + this.Id = id; + this.Name = name; + this.Disabled = disabled; } - partial void OnCreated(); + /// + /// A boolean value indicating whether this issuer is unavailable. Can be `true` whenever the issuer is offline. + /// + /// A boolean value indicating whether this issuer is unavailable. Can be `true` whenever the issuer is offline. + [DataMember(Name = "disabled", EmitDefaultValue = false)] + public bool? Disabled { get; set; } /// /// The unique identifier of this issuer, to submit in requests to /payments. /// /// The unique identifier of this issuer, to submit in requests to /payments. - [JsonPropertyName("id")] + [DataMember(Name = "id", IsRequired = false, EmitDefaultValue = false)] public string Id { get; set; } /// /// A localized name of the issuer. /// /// A localized name of the issuer. - [JsonPropertyName("name")] + [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] public string Name { get; set; } - /// - /// Used to track the state of Disabled - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DisabledOption { get; private set; } - - /// - /// A boolean value indicating whether this issuer is unavailable. Can be `true` whenever the issuer is offline. - /// - /// A boolean value indicating whether this issuer is unavailable. Can be `true` whenever the issuer is offline. - [JsonPropertyName("disabled")] - public bool? Disabled { get { return this.DisabledOption; } set { this.DisabledOption = new Option(value); } } - /// /// Returns the string presentation of the object /// @@ -81,135 +79,90 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentMethodIssuer {\n"); + sb.Append(" Disabled: ").Append(Disabled).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Disabled: ").Append(Disabled).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentMethodIssuerJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentMethodIssuer Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option id = default; - Option name = default; - Option disabled = default; + return this.Equals(input as PaymentMethodIssuer); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PaymentMethodIssuer instances are equal + /// + /// Instance of PaymentMethodIssuer to be compared + /// Boolean + public bool Equals(PaymentMethodIssuer input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "id": - id = new Option(utf8JsonReader.GetString()); - break; - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - case "disabled": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - disabled = new Option(utf8JsonReader.GetBoolean()); - break; - default: - break; - } - } + return false; } - - if (!id.IsSet) - throw new ArgumentException("Property is required for class PaymentMethodIssuer.", nameof(id)); - - if (!name.IsSet) - throw new ArgumentException("Property is required for class PaymentMethodIssuer.", nameof(name)); - - if (id.IsSet && id.Value == null) - throw new ArgumentNullException(nameof(id), "Property is not nullable for class PaymentMethodIssuer."); - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class PaymentMethodIssuer."); - - if (disabled.IsSet && disabled.Value == null) - throw new ArgumentNullException(nameof(disabled), "Property is not nullable for class PaymentMethodIssuer."); - - return new PaymentMethodIssuer(id.Value, name.Value, disabled); + return + ( + this.Disabled == input.Disabled || + this.Disabled.Equals(input.Disabled) + ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentMethodIssuer paymentMethodIssuer, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, paymentMethodIssuer, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Disabled.GetHashCode(); + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentMethodIssuer paymentMethodIssuer, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (paymentMethodIssuer.Id == null) - throw new ArgumentNullException(nameof(paymentMethodIssuer.Id), "Property is required for class PaymentMethodIssuer."); - - if (paymentMethodIssuer.Name == null) - throw new ArgumentNullException(nameof(paymentMethodIssuer.Name), "Property is required for class PaymentMethodIssuer."); - - writer.WriteString("id", paymentMethodIssuer.Id); - - writer.WriteString("name", paymentMethodIssuer.Name); - - if (paymentMethodIssuer.DisabledOption.IsSet) - writer.WriteBoolean("disabled", paymentMethodIssuer.DisabledOption.Value.Value); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentMethodToStore.cs b/Adyen/Model/Checkout/PaymentMethodToStore.cs index 8e5cc9346..a42d81f91 100644 --- a/Adyen/Model/Checkout/PaymentMethodToStore.cs +++ b/Adyen/Model/Checkout/PaymentMethodToStore.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,222 +15,137 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentMethodToStore /// - public partial class PaymentMethodToStore : IValidatableObject + [DataContract(Name = "PaymentMethodToStore")] + public partial class PaymentMethodToStore : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Secondary brand of the card. For example: **plastix**, **hmclub**. - /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - /// The encrypted card. - /// The encrypted card number. - /// The encrypted card expiry month. - /// The encrypted card expiry year. - /// The encrypted card verification code. - /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - /// The name of the card holder. - /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - /// Set to **scheme**. - [JsonConstructor] - public PaymentMethodToStore(Option brand = default, Option cvc = default, Option encryptedCard = default, Option encryptedCardNumber = default, Option encryptedExpiryMonth = default, Option encryptedExpiryYear = default, Option encryptedSecurityCode = default, Option expiryMonth = default, Option expiryYear = default, Option holderName = default, Option number = default, Option type = default) + /// Secondary brand of the card. For example: **plastix**, **hmclub**.. + /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. + /// The encrypted card.. + /// The encrypted card number.. + /// The encrypted card expiry month.. + /// The encrypted card expiry year.. + /// The encrypted card verification code.. + /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. + /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. + /// The name of the card holder.. + /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide).. + /// Set to **scheme**.. + public PaymentMethodToStore(string brand = default(string), string cvc = default(string), string encryptedCard = default(string), string encryptedCardNumber = default(string), string encryptedExpiryMonth = default(string), string encryptedExpiryYear = default(string), string encryptedSecurityCode = default(string), string expiryMonth = default(string), string expiryYear = default(string), string holderName = default(string), string number = default(string), string type = default(string)) { - BrandOption = brand; - CvcOption = cvc; - EncryptedCardOption = encryptedCard; - EncryptedCardNumberOption = encryptedCardNumber; - EncryptedExpiryMonthOption = encryptedExpiryMonth; - EncryptedExpiryYearOption = encryptedExpiryYear; - EncryptedSecurityCodeOption = encryptedSecurityCode; - ExpiryMonthOption = expiryMonth; - ExpiryYearOption = expiryYear; - HolderNameOption = holderName; - NumberOption = number; - TypeOption = type; - OnCreated(); + this.Brand = brand; + this.Cvc = cvc; + this.EncryptedCard = encryptedCard; + this.EncryptedCardNumber = encryptedCardNumber; + this.EncryptedExpiryMonth = encryptedExpiryMonth; + this.EncryptedExpiryYear = encryptedExpiryYear; + this.EncryptedSecurityCode = encryptedSecurityCode; + this.ExpiryMonth = expiryMonth; + this.ExpiryYear = expiryYear; + this.HolderName = holderName; + this.Number = number; + this.Type = type; } - partial void OnCreated(); - - /// - /// Used to track the state of Brand - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BrandOption { get; private set; } - /// /// Secondary brand of the card. For example: **plastix**, **hmclub**. /// /// Secondary brand of the card. For example: **plastix**, **hmclub**. - [JsonPropertyName("brand")] - public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } - - /// - /// Used to track the state of Cvc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CvcOption { get; private set; } + [DataMember(Name = "brand", EmitDefaultValue = false)] + public string Brand { get; set; } /// /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [JsonPropertyName("cvc")] - public string Cvc { get { return this.CvcOption; } set { this.CvcOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedCard - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedCardOption { get; private set; } + [DataMember(Name = "cvc", EmitDefaultValue = false)] + public string Cvc { get; set; } /// /// The encrypted card. /// /// The encrypted card. - [JsonPropertyName("encryptedCard")] - public string EncryptedCard { get { return this.EncryptedCardOption; } set { this.EncryptedCardOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedCardNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedCardNumberOption { get; private set; } + [DataMember(Name = "encryptedCard", EmitDefaultValue = false)] + public string EncryptedCard { get; set; } /// /// The encrypted card number. /// /// The encrypted card number. - [JsonPropertyName("encryptedCardNumber")] - public string EncryptedCardNumber { get { return this.EncryptedCardNumberOption; } set { this.EncryptedCardNumberOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedExpiryMonth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedExpiryMonthOption { get; private set; } + [DataMember(Name = "encryptedCardNumber", EmitDefaultValue = false)] + public string EncryptedCardNumber { get; set; } /// /// The encrypted card expiry month. /// /// The encrypted card expiry month. - [JsonPropertyName("encryptedExpiryMonth")] - public string EncryptedExpiryMonth { get { return this.EncryptedExpiryMonthOption; } set { this.EncryptedExpiryMonthOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedExpiryYear - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedExpiryYearOption { get; private set; } + [DataMember(Name = "encryptedExpiryMonth", EmitDefaultValue = false)] + public string EncryptedExpiryMonth { get; set; } /// /// The encrypted card expiry year. /// /// The encrypted card expiry year. - [JsonPropertyName("encryptedExpiryYear")] - public string EncryptedExpiryYear { get { return this.EncryptedExpiryYearOption; } set { this.EncryptedExpiryYearOption = new Option(value); } } - - /// - /// Used to track the state of EncryptedSecurityCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EncryptedSecurityCodeOption { get; private set; } + [DataMember(Name = "encryptedExpiryYear", EmitDefaultValue = false)] + public string EncryptedExpiryYear { get; set; } /// /// The encrypted card verification code. /// /// The encrypted card verification code. - [JsonPropertyName("encryptedSecurityCode")] - public string EncryptedSecurityCode { get { return this.EncryptedSecurityCodeOption; } set { this.EncryptedSecurityCodeOption = new Option(value); } } - - /// - /// Used to track the state of ExpiryMonth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiryMonthOption { get; private set; } + [DataMember(Name = "encryptedSecurityCode", EmitDefaultValue = false)] + public string EncryptedSecurityCode { get; set; } /// /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card expiry month. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [JsonPropertyName("expiryMonth")] - public string ExpiryMonth { get { return this.ExpiryMonthOption; } set { this.ExpiryMonthOption = new Option(value); } } - - /// - /// Used to track the state of ExpiryYear - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiryYearOption { get; private set; } + [DataMember(Name = "expiryMonth", EmitDefaultValue = false)] + public string ExpiryMonth { get; set; } /// /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card expiry year. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [JsonPropertyName("expiryYear")] - public string ExpiryYear { get { return this.ExpiryYearOption; } set { this.ExpiryYearOption = new Option(value); } } - - /// - /// Used to track the state of HolderName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option HolderNameOption { get; private set; } + [DataMember(Name = "expiryYear", EmitDefaultValue = false)] + public string ExpiryYear { get; set; } /// /// The name of the card holder. /// /// The name of the card holder. - [JsonPropertyName("holderName")] - public string HolderName { get { return this.HolderNameOption; } set { this.HolderNameOption = new Option(value); } } - - /// - /// Used to track the state of Number - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NumberOption { get; private set; } + [DataMember(Name = "holderName", EmitDefaultValue = false)] + public string HolderName { get; set; } /// /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). /// /// The card number. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). - [JsonPropertyName("number")] - public string Number { get { return this.NumberOption; } set { this.NumberOption = new Option(value); } } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } + [DataMember(Name = "number", EmitDefaultValue = false)] + public string Number { get; set; } /// /// Set to **scheme**. /// /// Set to **scheme**. - [JsonPropertyName("type")] - public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } /// /// Returns the string presentation of the object @@ -255,273 +171,198 @@ public override string ToString() return sb.ToString(); } + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PaymentMethodToStore); + } + + /// + /// Returns true if PaymentMethodToStore instances are equal + /// + /// Instance of PaymentMethodToStore to be compared + /// Boolean + public bool Equals(PaymentMethodToStore input) + { + if (input == null) + { + return false; + } + return + ( + this.Brand == input.Brand || + (this.Brand != null && + this.Brand.Equals(input.Brand)) + ) && + ( + this.Cvc == input.Cvc || + (this.Cvc != null && + this.Cvc.Equals(input.Cvc)) + ) && + ( + this.EncryptedCard == input.EncryptedCard || + (this.EncryptedCard != null && + this.EncryptedCard.Equals(input.EncryptedCard)) + ) && + ( + this.EncryptedCardNumber == input.EncryptedCardNumber || + (this.EncryptedCardNumber != null && + this.EncryptedCardNumber.Equals(input.EncryptedCardNumber)) + ) && + ( + this.EncryptedExpiryMonth == input.EncryptedExpiryMonth || + (this.EncryptedExpiryMonth != null && + this.EncryptedExpiryMonth.Equals(input.EncryptedExpiryMonth)) + ) && + ( + this.EncryptedExpiryYear == input.EncryptedExpiryYear || + (this.EncryptedExpiryYear != null && + this.EncryptedExpiryYear.Equals(input.EncryptedExpiryYear)) + ) && + ( + this.EncryptedSecurityCode == input.EncryptedSecurityCode || + (this.EncryptedSecurityCode != null && + this.EncryptedSecurityCode.Equals(input.EncryptedSecurityCode)) + ) && + ( + this.ExpiryMonth == input.ExpiryMonth || + (this.ExpiryMonth != null && + this.ExpiryMonth.Equals(input.ExpiryMonth)) + ) && + ( + this.ExpiryYear == input.ExpiryYear || + (this.ExpiryYear != null && + this.ExpiryYear.Equals(input.ExpiryYear)) + ) && + ( + this.HolderName == input.HolderName || + (this.HolderName != null && + this.HolderName.Equals(input.HolderName)) + ) && + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Brand != null) + { + hashCode = (hashCode * 59) + this.Brand.GetHashCode(); + } + if (this.Cvc != null) + { + hashCode = (hashCode * 59) + this.Cvc.GetHashCode(); + } + if (this.EncryptedCard != null) + { + hashCode = (hashCode * 59) + this.EncryptedCard.GetHashCode(); + } + if (this.EncryptedCardNumber != null) + { + hashCode = (hashCode * 59) + this.EncryptedCardNumber.GetHashCode(); + } + if (this.EncryptedExpiryMonth != null) + { + hashCode = (hashCode * 59) + this.EncryptedExpiryMonth.GetHashCode(); + } + if (this.EncryptedExpiryYear != null) + { + hashCode = (hashCode * 59) + this.EncryptedExpiryYear.GetHashCode(); + } + if (this.EncryptedSecurityCode != null) + { + hashCode = (hashCode * 59) + this.EncryptedSecurityCode.GetHashCode(); + } + if (this.ExpiryMonth != null) + { + hashCode = (hashCode * 59) + this.ExpiryMonth.GetHashCode(); + } + if (this.ExpiryYear != null) + { + hashCode = (hashCode * 59) + this.ExpiryYear.GetHashCode(); + } + if (this.HolderName != null) + { + hashCode = (hashCode * 59) + this.HolderName.GetHashCode(); + } + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + } + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + return hashCode; + } + } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { // EncryptedCard (string) maxLength if (this.EncryptedCard != null && this.EncryptedCard.Length > 40000) { - yield return new ValidationResult("Invalid value for EncryptedCard, length must be less than 40000.", new [] { "EncryptedCard" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCard, length must be less than 40000.", new [] { "EncryptedCard" }); } // EncryptedCardNumber (string) maxLength if (this.EncryptedCardNumber != null && this.EncryptedCardNumber.Length > 15000) { - yield return new ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedCardNumber, length must be less than 15000.", new [] { "EncryptedCardNumber" }); } // EncryptedExpiryMonth (string) maxLength if (this.EncryptedExpiryMonth != null && this.EncryptedExpiryMonth.Length > 15000) { - yield return new ValidationResult("Invalid value for EncryptedExpiryMonth, length must be less than 15000.", new [] { "EncryptedExpiryMonth" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedExpiryMonth, length must be less than 15000.", new [] { "EncryptedExpiryMonth" }); } // EncryptedExpiryYear (string) maxLength if (this.EncryptedExpiryYear != null && this.EncryptedExpiryYear.Length > 15000) { - yield return new ValidationResult("Invalid value for EncryptedExpiryYear, length must be less than 15000.", new [] { "EncryptedExpiryYear" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedExpiryYear, length must be less than 15000.", new [] { "EncryptedExpiryYear" }); } // EncryptedSecurityCode (string) maxLength if (this.EncryptedSecurityCode != null && this.EncryptedSecurityCode.Length > 15000) { - yield return new ValidationResult("Invalid value for EncryptedSecurityCode, length must be less than 15000.", new [] { "EncryptedSecurityCode" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for EncryptedSecurityCode, length must be less than 15000.", new [] { "EncryptedSecurityCode" }); } yield break; } } - /// - /// A Json converter for type - /// - public class PaymentMethodToStoreJsonConverter : JsonConverter - { - /// - /// Deserializes json to - /// - /// - /// - /// - /// - /// - public override PaymentMethodToStore Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) - { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option brand = default; - Option cvc = default; - Option encryptedCard = default; - Option encryptedCardNumber = default; - Option encryptedExpiryMonth = default; - Option encryptedExpiryYear = default; - Option encryptedSecurityCode = default; - Option expiryMonth = default; - Option expiryYear = default; - Option holderName = default; - Option number = default; - Option type = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "brand": - brand = new Option(utf8JsonReader.GetString()); - break; - case "cvc": - cvc = new Option(utf8JsonReader.GetString()); - break; - case "encryptedCard": - encryptedCard = new Option(utf8JsonReader.GetString()); - break; - case "encryptedCardNumber": - encryptedCardNumber = new Option(utf8JsonReader.GetString()); - break; - case "encryptedExpiryMonth": - encryptedExpiryMonth = new Option(utf8JsonReader.GetString()); - break; - case "encryptedExpiryYear": - encryptedExpiryYear = new Option(utf8JsonReader.GetString()); - break; - case "encryptedSecurityCode": - encryptedSecurityCode = new Option(utf8JsonReader.GetString()); - break; - case "expiryMonth": - expiryMonth = new Option(utf8JsonReader.GetString()); - break; - case "expiryYear": - expiryYear = new Option(utf8JsonReader.GetString()); - break; - case "holderName": - holderName = new Option(utf8JsonReader.GetString()); - break; - case "number": - number = new Option(utf8JsonReader.GetString()); - break; - case "type": - type = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (brand.IsSet && brand.Value == null) - throw new ArgumentNullException(nameof(brand), "Property is not nullable for class PaymentMethodToStore."); - - if (cvc.IsSet && cvc.Value == null) - throw new ArgumentNullException(nameof(cvc), "Property is not nullable for class PaymentMethodToStore."); - - if (encryptedCard.IsSet && encryptedCard.Value == null) - throw new ArgumentNullException(nameof(encryptedCard), "Property is not nullable for class PaymentMethodToStore."); - - if (encryptedCardNumber.IsSet && encryptedCardNumber.Value == null) - throw new ArgumentNullException(nameof(encryptedCardNumber), "Property is not nullable for class PaymentMethodToStore."); - - if (encryptedExpiryMonth.IsSet && encryptedExpiryMonth.Value == null) - throw new ArgumentNullException(nameof(encryptedExpiryMonth), "Property is not nullable for class PaymentMethodToStore."); - - if (encryptedExpiryYear.IsSet && encryptedExpiryYear.Value == null) - throw new ArgumentNullException(nameof(encryptedExpiryYear), "Property is not nullable for class PaymentMethodToStore."); - - if (encryptedSecurityCode.IsSet && encryptedSecurityCode.Value == null) - throw new ArgumentNullException(nameof(encryptedSecurityCode), "Property is not nullable for class PaymentMethodToStore."); - - if (expiryMonth.IsSet && expiryMonth.Value == null) - throw new ArgumentNullException(nameof(expiryMonth), "Property is not nullable for class PaymentMethodToStore."); - - if (expiryYear.IsSet && expiryYear.Value == null) - throw new ArgumentNullException(nameof(expiryYear), "Property is not nullable for class PaymentMethodToStore."); - - if (holderName.IsSet && holderName.Value == null) - throw new ArgumentNullException(nameof(holderName), "Property is not nullable for class PaymentMethodToStore."); - - if (number.IsSet && number.Value == null) - throw new ArgumentNullException(nameof(number), "Property is not nullable for class PaymentMethodToStore."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PaymentMethodToStore."); - - return new PaymentMethodToStore(brand, cvc, encryptedCard, encryptedCardNumber, encryptedExpiryMonth, encryptedExpiryYear, encryptedSecurityCode, expiryMonth, expiryYear, holderName, number, type); - } - - /// - /// Serializes a - /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentMethodToStore paymentMethodToStore, JsonSerializerOptions jsonSerializerOptions) - { - writer.WriteStartObject(); - - WriteProperties(writer, paymentMethodToStore, jsonSerializerOptions); - writer.WriteEndObject(); - } - - /// - /// Serializes the properties of - /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentMethodToStore paymentMethodToStore, JsonSerializerOptions jsonSerializerOptions) - { - if (paymentMethodToStore.BrandOption.IsSet && paymentMethodToStore.Brand == null) - throw new ArgumentNullException(nameof(paymentMethodToStore.Brand), "Property is required for class PaymentMethodToStore."); - - if (paymentMethodToStore.CvcOption.IsSet && paymentMethodToStore.Cvc == null) - throw new ArgumentNullException(nameof(paymentMethodToStore.Cvc), "Property is required for class PaymentMethodToStore."); - - if (paymentMethodToStore.EncryptedCardOption.IsSet && paymentMethodToStore.EncryptedCard == null) - throw new ArgumentNullException(nameof(paymentMethodToStore.EncryptedCard), "Property is required for class PaymentMethodToStore."); - - if (paymentMethodToStore.EncryptedCardNumberOption.IsSet && paymentMethodToStore.EncryptedCardNumber == null) - throw new ArgumentNullException(nameof(paymentMethodToStore.EncryptedCardNumber), "Property is required for class PaymentMethodToStore."); - - if (paymentMethodToStore.EncryptedExpiryMonthOption.IsSet && paymentMethodToStore.EncryptedExpiryMonth == null) - throw new ArgumentNullException(nameof(paymentMethodToStore.EncryptedExpiryMonth), "Property is required for class PaymentMethodToStore."); - - if (paymentMethodToStore.EncryptedExpiryYearOption.IsSet && paymentMethodToStore.EncryptedExpiryYear == null) - throw new ArgumentNullException(nameof(paymentMethodToStore.EncryptedExpiryYear), "Property is required for class PaymentMethodToStore."); - - if (paymentMethodToStore.EncryptedSecurityCodeOption.IsSet && paymentMethodToStore.EncryptedSecurityCode == null) - throw new ArgumentNullException(nameof(paymentMethodToStore.EncryptedSecurityCode), "Property is required for class PaymentMethodToStore."); - - if (paymentMethodToStore.ExpiryMonthOption.IsSet && paymentMethodToStore.ExpiryMonth == null) - throw new ArgumentNullException(nameof(paymentMethodToStore.ExpiryMonth), "Property is required for class PaymentMethodToStore."); - - if (paymentMethodToStore.ExpiryYearOption.IsSet && paymentMethodToStore.ExpiryYear == null) - throw new ArgumentNullException(nameof(paymentMethodToStore.ExpiryYear), "Property is required for class PaymentMethodToStore."); - - if (paymentMethodToStore.HolderNameOption.IsSet && paymentMethodToStore.HolderName == null) - throw new ArgumentNullException(nameof(paymentMethodToStore.HolderName), "Property is required for class PaymentMethodToStore."); - - if (paymentMethodToStore.NumberOption.IsSet && paymentMethodToStore.Number == null) - throw new ArgumentNullException(nameof(paymentMethodToStore.Number), "Property is required for class PaymentMethodToStore."); - - if (paymentMethodToStore.TypeOption.IsSet && paymentMethodToStore.Type == null) - throw new ArgumentNullException(nameof(paymentMethodToStore.Type), "Property is required for class PaymentMethodToStore."); - - if (paymentMethodToStore.BrandOption.IsSet) - writer.WriteString("brand", paymentMethodToStore.Brand); - - if (paymentMethodToStore.CvcOption.IsSet) - writer.WriteString("cvc", paymentMethodToStore.Cvc); - - if (paymentMethodToStore.EncryptedCardOption.IsSet) - writer.WriteString("encryptedCard", paymentMethodToStore.EncryptedCard); - - if (paymentMethodToStore.EncryptedCardNumberOption.IsSet) - writer.WriteString("encryptedCardNumber", paymentMethodToStore.EncryptedCardNumber); - - if (paymentMethodToStore.EncryptedExpiryMonthOption.IsSet) - writer.WriteString("encryptedExpiryMonth", paymentMethodToStore.EncryptedExpiryMonth); - - if (paymentMethodToStore.EncryptedExpiryYearOption.IsSet) - writer.WriteString("encryptedExpiryYear", paymentMethodToStore.EncryptedExpiryYear); - - if (paymentMethodToStore.EncryptedSecurityCodeOption.IsSet) - writer.WriteString("encryptedSecurityCode", paymentMethodToStore.EncryptedSecurityCode); - - if (paymentMethodToStore.ExpiryMonthOption.IsSet) - writer.WriteString("expiryMonth", paymentMethodToStore.ExpiryMonth); - - if (paymentMethodToStore.ExpiryYearOption.IsSet) - writer.WriteString("expiryYear", paymentMethodToStore.ExpiryYear); - - if (paymentMethodToStore.HolderNameOption.IsSet) - writer.WriteString("holderName", paymentMethodToStore.HolderName); - - if (paymentMethodToStore.NumberOption.IsSet) - writer.WriteString("number", paymentMethodToStore.Number); - - if (paymentMethodToStore.TypeOption.IsSet) - writer.WriteString("type", paymentMethodToStore.Type); - } - } } diff --git a/Adyen/Model/Checkout/PaymentMethodUPIApps.cs b/Adyen/Model/Checkout/PaymentMethodUPIApps.cs index ebb779e50..b7af1ba93 100644 --- a/Adyen/Model/Checkout/PaymentMethodUPIApps.cs +++ b/Adyen/Model/Checkout/PaymentMethodUPIApps.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,47 +15,51 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentMethodUPIApps /// - public partial class PaymentMethodUPIApps : IValidatableObject + [DataContract(Name = "PaymentMethodUPIApps")] + public partial class PaymentMethodUPIApps : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The unique identifier of this app, to submit in requests to /payments. - /// A localized name of the app. - [JsonConstructor] - public PaymentMethodUPIApps(string id, string name) + [JsonConstructorAttribute] + protected PaymentMethodUPIApps() { } + /// + /// Initializes a new instance of the class. + /// + /// The unique identifier of this app, to submit in requests to /payments. (required). + /// A localized name of the app. (required). + public PaymentMethodUPIApps(string id = default(string), string name = default(string)) { - Id = id; - Name = name; - OnCreated(); + this.Id = id; + this.Name = name; } - partial void OnCreated(); - /// /// The unique identifier of this app, to submit in requests to /payments. /// /// The unique identifier of this app, to submit in requests to /payments. - [JsonPropertyName("id")] + [DataMember(Name = "id", IsRequired = false, EmitDefaultValue = false)] public string Id { get; set; } /// /// A localized name of the app. /// /// A localized name of the app. - [JsonPropertyName("name")] + [DataMember(Name = "name", IsRequired = false, EmitDefaultValue = false)] public string Name { get; set; } /// @@ -72,116 +77,77 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentMethodUPIAppsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentMethodUPIApps Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option id = default; - Option name = default; + return this.Equals(input as PaymentMethodUPIApps); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PaymentMethodUPIApps instances are equal + /// + /// Instance of PaymentMethodUPIApps to be compared + /// Boolean + public bool Equals(PaymentMethodUPIApps input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "id": - id = new Option(utf8JsonReader.GetString()); - break; - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!id.IsSet) - throw new ArgumentException("Property is required for class PaymentMethodUPIApps.", nameof(id)); - - if (!name.IsSet) - throw new ArgumentException("Property is required for class PaymentMethodUPIApps.", nameof(name)); - - if (id.IsSet && id.Value == null) - throw new ArgumentNullException(nameof(id), "Property is not nullable for class PaymentMethodUPIApps."); - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class PaymentMethodUPIApps."); - - return new PaymentMethodUPIApps(id.Value, name.Value); + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentMethodUPIApps paymentMethodUPIApps, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, paymentMethodUPIApps, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentMethodUPIApps paymentMethodUPIApps, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (paymentMethodUPIApps.Id == null) - throw new ArgumentNullException(nameof(paymentMethodUPIApps.Id), "Property is required for class PaymentMethodUPIApps."); - - if (paymentMethodUPIApps.Name == null) - throw new ArgumentNullException(nameof(paymentMethodUPIApps.Name), "Property is required for class PaymentMethodUPIApps."); - - writer.WriteString("id", paymentMethodUPIApps.Id); - - writer.WriteString("name", paymentMethodUPIApps.Name); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentMethodsRequest.cs b/Adyen/Model/Checkout/PaymentMethodsRequest.cs index 0bd7ebdb1..19f498a3a 100644 --- a/Adyen/Model/Checkout/PaymentMethodsRequest.cs +++ b/Adyen/Model/Checkout/PaymentMethodsRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,470 +15,247 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentMethodsRequest /// - public partial class PaymentMethodsRequest : IValidatableObject + [DataContract(Name = "PaymentMethodsRequest")] + public partial class PaymentMethodsRequest : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The merchant account identifier, with which you want to process the transaction. - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - /// amount - /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - /// browserInfo - /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web - /// The shopper's country code. - /// order - /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - /// The combination of a language code and a country code to specify the language to be used in the payment. - /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false) - /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - /// The shopper's telephone number. - [JsonConstructor] - public PaymentMethodsRequest(string merchantAccount, Option> additionalData = default, Option> allowedPaymentMethods = default, Option amount = default, Option> blockedPaymentMethods = default, Option browserInfo = default, Option channel = default, Option countryCode = default, Option order = default, Option shopperConversionId = default, Option shopperEmail = default, Option shopperIP = default, Option shopperLocale = default, Option shopperReference = default, Option splitCardFundingSources = default, Option store = default, Option storeFiltrationMode = default, Option telephoneNumber = default) - { - MerchantAccount = merchantAccount; - AdditionalDataOption = additionalData; - AllowedPaymentMethodsOption = allowedPaymentMethods; - AmountOption = amount; - BlockedPaymentMethodsOption = blockedPaymentMethods; - BrowserInfoOption = browserInfo; - ChannelOption = channel; - CountryCodeOption = countryCode; - OrderOption = order; - ShopperConversionIdOption = shopperConversionId; - ShopperEmailOption = shopperEmail; - ShopperIPOption = shopperIP; - ShopperLocaleOption = shopperLocale; - ShopperReferenceOption = shopperReference; - SplitCardFundingSourcesOption = splitCardFundingSources; - StoreOption = store; - StoreFiltrationModeOption = storeFiltrationMode; - TelephoneNumberOption = telephoneNumber; - OnCreated(); - } - - partial void OnCreated(); - /// /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web /// /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web + [JsonConverter(typeof(StringEnumConverter))] public enum ChannelEnum { /// /// Enum IOS for value: iOS /// + [EnumMember(Value = "iOS")] IOS = 1, /// /// Enum Android for value: Android /// + [EnumMember(Value = "Android")] Android = 2, /// /// Enum Web for value: Web /// + [EnumMember(Value = "Web")] Web = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ChannelEnum ChannelEnumFromString(string value) - { - if (value.Equals("iOS")) - return ChannelEnum.IOS; - - if (value.Equals("Android")) - return ChannelEnum.Android; - - if (value.Equals("Web")) - return ChannelEnum.Web; - - throw new NotImplementedException($"Could not convert value to type ChannelEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ChannelEnum? ChannelEnumFromStringOrDefault(string value) - { - if (value.Equals("iOS")) - return ChannelEnum.IOS; - - if (value.Equals("Android")) - return ChannelEnum.Android; - if (value.Equals("Web")) - return ChannelEnum.Web; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChannelEnumToJsonValue(ChannelEnum? value) - { - if (value == ChannelEnum.IOS) - return "iOS"; - - if (value == ChannelEnum.Android) - return "Android"; - - if (value == ChannelEnum.Web) - return "Web"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Channel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChannelOption { get; private set; } /// /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web /// /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web - [JsonPropertyName("channel")] - public ChannelEnum? Channel { get { return this.ChannelOption; } set { this.ChannelOption = new Option(value); } } - + [DataMember(Name = "channel", EmitDefaultValue = false)] + public ChannelEnum? Channel { get; set; } /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. + [JsonConverter(typeof(StringEnumConverter))] public enum StoreFiltrationModeEnum { /// /// Enum Exclusive for value: exclusive /// + [EnumMember(Value = "exclusive")] Exclusive = 1, /// /// Enum Inclusive for value: inclusive /// + [EnumMember(Value = "inclusive")] Inclusive = 2, /// /// Enum SkipFilter for value: skipFilter /// + [EnumMember(Value = "skipFilter")] SkipFilter = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static StoreFiltrationModeEnum StoreFiltrationModeEnumFromString(string value) - { - if (value.Equals("exclusive")) - return StoreFiltrationModeEnum.Exclusive; - if (value.Equals("inclusive")) - return StoreFiltrationModeEnum.Inclusive; - - if (value.Equals("skipFilter")) - return StoreFiltrationModeEnum.SkipFilter; - - throw new NotImplementedException($"Could not convert value to type StoreFiltrationModeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static StoreFiltrationModeEnum? StoreFiltrationModeEnumFromStringOrDefault(string value) - { - if (value.Equals("exclusive")) - return StoreFiltrationModeEnum.Exclusive; - - if (value.Equals("inclusive")) - return StoreFiltrationModeEnum.Inclusive; - - if (value.Equals("skipFilter")) - return StoreFiltrationModeEnum.SkipFilter; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string StoreFiltrationModeEnumToJsonValue(StoreFiltrationModeEnum? value) - { - if (value == StoreFiltrationModeEnum.Exclusive) - return "exclusive"; - - if (value == StoreFiltrationModeEnum.Inclusive) - return "inclusive"; - - if (value == StoreFiltrationModeEnum.SkipFilter) - return "skipFilter"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of StoreFiltrationMode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoreFiltrationModeOption { get; private set; } /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. /// /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned. - [JsonPropertyName("storeFiltrationMode")] - public StoreFiltrationModeEnum? StoreFiltrationMode { get { return this.StoreFiltrationModeOption; } set { this.StoreFiltrationModeOption = new Option(value); } } - + [DataMember(Name = "storeFiltrationMode", EmitDefaultValue = false)] + public StoreFiltrationModeEnum? StoreFiltrationMode { get; set; } /// - /// The merchant account identifier, with which you want to process the transaction. + /// Initializes a new instance of the class. /// - /// The merchant account identifier, with which you want to process the transaction. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } - + [JsonConstructorAttribute] + protected PaymentMethodsRequest() { } /// - /// Used to track the state of AdditionalData + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AdditionalDataOption { get; private set; } + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]`. + /// amount. + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]`. + /// browserInfo. + /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web. + /// The shopper's country code.. + /// The merchant account identifier, with which you want to process the transaction. (required). + /// order. + /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates.. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > Required for Visa and JCB transactions that require 3D Secure 2 authentication if you did not include the `telephoneNumber`.. + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new).. + /// The combination of a language code and a country code to specify the language to be used in the payment.. + /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false). + /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment.. + /// Specifies how payment methods should be filtered based on the 'store' parameter: - 'exclusive': Only payment methods belonging to the specified 'store' are returned. - 'inclusive': Payment methods from the 'store' and those not associated with any other store are returned.. + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication.. + public PaymentMethodsRequest(Dictionary additionalData = default(Dictionary), List allowedPaymentMethods = default(List), Amount amount = default(Amount), List blockedPaymentMethods = default(List), BrowserInfo browserInfo = default(BrowserInfo), ChannelEnum? channel = default(ChannelEnum?), string countryCode = default(string), string merchantAccount = default(string), EncryptedOrderData order = default(EncryptedOrderData), string shopperConversionId = default(string), string shopperEmail = default(string), string shopperIP = default(string), string shopperLocale = default(string), string shopperReference = default(string), bool? splitCardFundingSources = false, string store = default(string), StoreFiltrationModeEnum? storeFiltrationMode = default(StoreFiltrationModeEnum?), string telephoneNumber = default(string)) + { + this.MerchantAccount = merchantAccount; + this.AdditionalData = additionalData; + this.AllowedPaymentMethods = allowedPaymentMethods; + this.Amount = amount; + this.BlockedPaymentMethods = blockedPaymentMethods; + this.BrowserInfo = browserInfo; + this.Channel = channel; + this.CountryCode = countryCode; + this.Order = order; + this.ShopperConversionId = shopperConversionId; + this.ShopperEmail = shopperEmail; + this.ShopperIP = shopperIP; + this.ShopperLocale = shopperLocale; + this.ShopperReference = shopperReference; + this.SplitCardFundingSources = splitCardFundingSources; + this.Store = store; + this.StoreFiltrationMode = storeFiltrationMode; + this.TelephoneNumber = telephoneNumber; + } /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - [JsonPropertyName("additionalData")] - public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } - - /// - /// Used to track the state of AllowedPaymentMethods - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AllowedPaymentMethodsOption { get; private set; } + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"applepay\"]` - [JsonPropertyName("allowedPaymentMethods")] - public List AllowedPaymentMethods { get { return this.AllowedPaymentMethodsOption; } set { this.AllowedPaymentMethodsOption = new Option>(value); } } - - /// - /// Used to track the state of Amount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountOption { get; private set; } + [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] + public List AllowedPaymentMethods { get; set; } /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] - public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } - - /// - /// Used to track the state of BlockedPaymentMethods - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> BlockedPaymentMethodsOption { get; private set; } + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` /// /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"applepay\"]` - [JsonPropertyName("blockedPaymentMethods")] - public List BlockedPaymentMethods { get { return this.BlockedPaymentMethodsOption; } set { this.BlockedPaymentMethodsOption = new Option>(value); } } - - /// - /// Used to track the state of BrowserInfo - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BrowserInfoOption { get; private set; } + [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] + public List BlockedPaymentMethods { get; set; } /// /// Gets or Sets BrowserInfo /// - [JsonPropertyName("browserInfo")] - public BrowserInfo BrowserInfo { get { return this.BrowserInfoOption; } set { this.BrowserInfoOption = new Option(value); } } - - /// - /// Used to track the state of CountryCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CountryCodeOption { get; private set; } + [DataMember(Name = "browserInfo", EmitDefaultValue = false)] + public BrowserInfo BrowserInfo { get; set; } /// /// The shopper's country code. /// /// The shopper's country code. - [JsonPropertyName("countryCode")] - public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } + [DataMember(Name = "countryCode", EmitDefaultValue = false)] + public string CountryCode { get; set; } /// - /// Used to track the state of Order + /// The merchant account identifier, with which you want to process the transaction. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OrderOption { get; private set; } + /// The merchant account identifier, with which you want to process the transaction. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// Gets or Sets Order /// - [JsonPropertyName("order")] - public EncryptedOrderData Order { get { return this.OrderOption; } set { this.OrderOption = new Option(value); } } - - /// - /// Used to track the state of ShopperConversionId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperConversionIdOption { get; private set; } + [DataMember(Name = "order", EmitDefaultValue = false)] + public EncryptedOrderData Order { get; set; } /// /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. /// /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. - [JsonPropertyName("shopperConversionId")] - public string ShopperConversionId { get { return this.ShopperConversionIdOption; } set { this.ShopperConversionIdOption = new Option(value); } } + [DataMember(Name = "shopperConversionId", EmitDefaultValue = false)] + public string ShopperConversionId { get; set; } /// - /// Used to track the state of ShopperEmail + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > Required for Visa and JCB transactions that require 3D Secure 2 authentication if you did not include the `telephoneNumber`. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > Required for Visa and JCB transactions that require 3D Secure 2 authentication if you did not include the `telephoneNumber`. + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } - - /// - /// Used to track the state of ShopperIP - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperIPOption { get; private set; } - - /// - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - /// - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - [JsonPropertyName("shopperIP")] - public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } - - /// - /// Used to track the state of ShopperLocale - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperLocaleOption { get; private set; } + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + [DataMember(Name = "shopperIP", EmitDefaultValue = false)] + public string ShopperIP { get; set; } /// /// The combination of a language code and a country code to specify the language to be used in the payment. /// /// The combination of a language code and a country code to specify the language to be used in the payment. - [JsonPropertyName("shopperLocale")] - public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } - - /// - /// Used to track the state of ShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperReferenceOption { get; private set; } + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + public string ShopperLocale { get; set; } /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [JsonPropertyName("shopperReference")] - public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of SplitCardFundingSources - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SplitCardFundingSourcesOption { get; private set; } + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. /// /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. - [JsonPropertyName("splitCardFundingSources")] - public bool? SplitCardFundingSources { get { return this.SplitCardFundingSourcesOption; } set { this.SplitCardFundingSourcesOption = new Option(value); } } - - /// - /// Used to track the state of Store - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoreOption { get; private set; } + [DataMember(Name = "splitCardFundingSources", EmitDefaultValue = false)] + public bool? SplitCardFundingSources { get; set; } /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - [JsonPropertyName("store")] - public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } + [DataMember(Name = "store", EmitDefaultValue = false)] + public string Store { get; set; } /// - /// Used to track the state of TelephoneNumber + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TelephoneNumberOption { get; private set; } - - /// - /// The shopper's telephone number. - /// - /// The shopper's telephone number. - [JsonPropertyName("telephoneNumber")] - public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string TelephoneNumber { get; set; } /// /// Returns the string presentation of the object @@ -487,7 +265,6 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentMethodsRequest {\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); @@ -495,6 +272,7 @@ public override string ToString() sb.Append(" BrowserInfo: ").Append(BrowserInfo).Append("\n"); sb.Append(" Channel: ").Append(Channel).Append("\n"); sb.Append(" CountryCode: ").Append(CountryCode).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" Order: ").Append(Order).Append("\n"); sb.Append(" ShopperConversionId: ").Append(ShopperConversionId).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); @@ -510,352 +288,230 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // ShopperConversionId (string) maxLength - if (this.ShopperConversionId != null && this.ShopperConversionId.Length > 256) - { - yield return new ValidationResult("Invalid value for ShopperConversionId, length must be less than 256.", new [] { "ShopperConversionId" }); - } - - // Store (string) maxLength - if (this.Store != null && this.Store.Length > 16) - { - yield return new ValidationResult("Invalid value for Store, length must be less than 16.", new [] { "Store" }); - } - - // Store (string) minLength - if (this.Store != null && this.Store.Length < 1) - { - yield return new ValidationResult("Invalid value for Store, length must be greater than 1.", new [] { "Store" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentMethodsRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentMethodsRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option merchantAccount = default; - Option> additionalData = default; - Option> allowedPaymentMethods = default; - Option amount = default; - Option> blockedPaymentMethods = default; - Option browserInfo = default; - Option channel = default; - Option countryCode = default; - Option order = default; - Option shopperConversionId = default; - Option shopperEmail = default; - Option shopperIP = default; - Option shopperLocale = default; - Option shopperReference = default; - Option splitCardFundingSources = default; - Option store = default; - Option storeFiltrationMode = default; - Option telephoneNumber = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "additionalData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "allowedPaymentMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - allowedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "blockedPaymentMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - blockedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "browserInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - browserInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "channel": - string channelRawValue = utf8JsonReader.GetString(); - if (channelRawValue != null) - channel = new Option(PaymentMethodsRequest.ChannelEnumFromStringOrDefault(channelRawValue)); - break; - case "countryCode": - countryCode = new Option(utf8JsonReader.GetString()); - break; - case "order": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - order = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperConversionId": - shopperConversionId = new Option(utf8JsonReader.GetString()); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "shopperIP": - shopperIP = new Option(utf8JsonReader.GetString()); - break; - case "shopperLocale": - shopperLocale = new Option(utf8JsonReader.GetString()); - break; - case "shopperReference": - shopperReference = new Option(utf8JsonReader.GetString()); - break; - case "splitCardFundingSources": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splitCardFundingSources = new Option(utf8JsonReader.GetBoolean()); - break; - case "store": - store = new Option(utf8JsonReader.GetString()); - break; - case "storeFiltrationMode": - string storeFiltrationModeRawValue = utf8JsonReader.GetString(); - if (storeFiltrationModeRawValue != null) - storeFiltrationMode = new Option(PaymentMethodsRequest.StoreFiltrationModeEnumFromStringOrDefault(storeFiltrationModeRawValue)); - break; - case "telephoneNumber": - telephoneNumber = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentMethodsRequest.", nameof(merchantAccount)); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentMethodsRequest."); - - if (additionalData.IsSet && additionalData.Value == null) - throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class PaymentMethodsRequest."); - - if (allowedPaymentMethods.IsSet && allowedPaymentMethods.Value == null) - throw new ArgumentNullException(nameof(allowedPaymentMethods), "Property is not nullable for class PaymentMethodsRequest."); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentMethodsRequest."); - - if (blockedPaymentMethods.IsSet && blockedPaymentMethods.Value == null) - throw new ArgumentNullException(nameof(blockedPaymentMethods), "Property is not nullable for class PaymentMethodsRequest."); - - if (browserInfo.IsSet && browserInfo.Value == null) - throw new ArgumentNullException(nameof(browserInfo), "Property is not nullable for class PaymentMethodsRequest."); - - if (channel.IsSet && channel.Value == null) - throw new ArgumentNullException(nameof(channel), "Property is not nullable for class PaymentMethodsRequest."); - - if (countryCode.IsSet && countryCode.Value == null) - throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class PaymentMethodsRequest."); - - if (order.IsSet && order.Value == null) - throw new ArgumentNullException(nameof(order), "Property is not nullable for class PaymentMethodsRequest."); - - if (shopperConversionId.IsSet && shopperConversionId.Value == null) - throw new ArgumentNullException(nameof(shopperConversionId), "Property is not nullable for class PaymentMethodsRequest."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class PaymentMethodsRequest."); - - if (shopperIP.IsSet && shopperIP.Value == null) - throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class PaymentMethodsRequest."); - - if (shopperLocale.IsSet && shopperLocale.Value == null) - throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class PaymentMethodsRequest."); - - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class PaymentMethodsRequest."); - - if (splitCardFundingSources.IsSet && splitCardFundingSources.Value == null) - throw new ArgumentNullException(nameof(splitCardFundingSources), "Property is not nullable for class PaymentMethodsRequest."); - - if (store.IsSet && store.Value == null) - throw new ArgumentNullException(nameof(store), "Property is not nullable for class PaymentMethodsRequest."); - - if (storeFiltrationMode.IsSet && storeFiltrationMode.Value == null) - throw new ArgumentNullException(nameof(storeFiltrationMode), "Property is not nullable for class PaymentMethodsRequest."); - - if (telephoneNumber.IsSet && telephoneNumber.Value == null) - throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class PaymentMethodsRequest."); - - return new PaymentMethodsRequest(merchantAccount.Value, additionalData, allowedPaymentMethods, amount, blockedPaymentMethods, browserInfo, channel, countryCode, order, shopperConversionId, shopperEmail, shopperIP, shopperLocale, shopperReference, splitCardFundingSources, store, storeFiltrationMode, telephoneNumber); + return this.Equals(input as PaymentMethodsRequest); } /// - /// Serializes a + /// Returns true if PaymentMethodsRequest instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentMethodsRequest paymentMethodsRequest, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentMethodsRequest to be compared + /// Boolean + public bool Equals(PaymentMethodsRequest input) { - writer.WriteStartObject(); - - WriteProperties(writer, paymentMethodsRequest, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + input.AdditionalData != null && + this.AdditionalData.SequenceEqual(input.AdditionalData) + ) && + ( + this.AllowedPaymentMethods == input.AllowedPaymentMethods || + this.AllowedPaymentMethods != null && + input.AllowedPaymentMethods != null && + this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.BlockedPaymentMethods == input.BlockedPaymentMethods || + this.BlockedPaymentMethods != null && + input.BlockedPaymentMethods != null && + this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) + ) && + ( + this.BrowserInfo == input.BrowserInfo || + (this.BrowserInfo != null && + this.BrowserInfo.Equals(input.BrowserInfo)) + ) && + ( + this.Channel == input.Channel || + this.Channel.Equals(input.Channel) + ) && + ( + this.CountryCode == input.CountryCode || + (this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.Order == input.Order || + (this.Order != null && + this.Order.Equals(input.Order)) + ) && + ( + this.ShopperConversionId == input.ShopperConversionId || + (this.ShopperConversionId != null && + this.ShopperConversionId.Equals(input.ShopperConversionId)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.ShopperIP == input.ShopperIP || + (this.ShopperIP != null && + this.ShopperIP.Equals(input.ShopperIP)) + ) && + ( + this.ShopperLocale == input.ShopperLocale || + (this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale)) + ) && + ( + this.ShopperReference == input.ShopperReference || + (this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference)) + ) && + ( + this.SplitCardFundingSources == input.SplitCardFundingSources || + this.SplitCardFundingSources.Equals(input.SplitCardFundingSources) + ) && + ( + this.Store == input.Store || + (this.Store != null && + this.Store.Equals(input.Store)) + ) && + ( + this.StoreFiltrationMode == input.StoreFiltrationMode || + this.StoreFiltrationMode.Equals(input.StoreFiltrationMode) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + (this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentMethodsRequest paymentMethodsRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paymentMethodsRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.MerchantAccount), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.AdditionalDataOption.IsSet && paymentMethodsRequest.AdditionalData == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.AdditionalData), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.AllowedPaymentMethodsOption.IsSet && paymentMethodsRequest.AllowedPaymentMethods == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.AllowedPaymentMethods), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.AmountOption.IsSet && paymentMethodsRequest.Amount == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.Amount), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.BlockedPaymentMethodsOption.IsSet && paymentMethodsRequest.BlockedPaymentMethods == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.BlockedPaymentMethods), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.BrowserInfoOption.IsSet && paymentMethodsRequest.BrowserInfo == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.BrowserInfo), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.CountryCodeOption.IsSet && paymentMethodsRequest.CountryCode == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.CountryCode), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.OrderOption.IsSet && paymentMethodsRequest.Order == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.Order), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.ShopperConversionIdOption.IsSet && paymentMethodsRequest.ShopperConversionId == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.ShopperConversionId), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.ShopperEmailOption.IsSet && paymentMethodsRequest.ShopperEmail == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.ShopperEmail), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.ShopperIPOption.IsSet && paymentMethodsRequest.ShopperIP == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.ShopperIP), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.ShopperLocaleOption.IsSet && paymentMethodsRequest.ShopperLocale == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.ShopperLocale), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.ShopperReferenceOption.IsSet && paymentMethodsRequest.ShopperReference == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.ShopperReference), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.StoreOption.IsSet && paymentMethodsRequest.Store == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.Store), "Property is required for class PaymentMethodsRequest."); - - if (paymentMethodsRequest.TelephoneNumberOption.IsSet && paymentMethodsRequest.TelephoneNumber == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest.TelephoneNumber), "Property is required for class PaymentMethodsRequest."); - - writer.WriteString("merchantAccount", paymentMethodsRequest.MerchantAccount); - - if (paymentMethodsRequest.AdditionalDataOption.IsSet) - { - writer.WritePropertyName("additionalData"); - JsonSerializer.Serialize(writer, paymentMethodsRequest.AdditionalData, jsonSerializerOptions); - } - if (paymentMethodsRequest.AllowedPaymentMethodsOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("allowedPaymentMethods"); - JsonSerializer.Serialize(writer, paymentMethodsRequest.AllowedPaymentMethods, jsonSerializerOptions); - } - if (paymentMethodsRequest.AmountOption.IsSet) - { - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, paymentMethodsRequest.Amount, jsonSerializerOptions); + int hashCode = 41; + if (this.AdditionalData != null) + { + hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); + } + if (this.AllowedPaymentMethods != null) + { + hashCode = (hashCode * 59) + this.AllowedPaymentMethods.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.BlockedPaymentMethods != null) + { + hashCode = (hashCode * 59) + this.BlockedPaymentMethods.GetHashCode(); + } + if (this.BrowserInfo != null) + { + hashCode = (hashCode * 59) + this.BrowserInfo.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Channel.GetHashCode(); + if (this.CountryCode != null) + { + hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.Order != null) + { + hashCode = (hashCode * 59) + this.Order.GetHashCode(); + } + if (this.ShopperConversionId != null) + { + hashCode = (hashCode * 59) + this.ShopperConversionId.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.ShopperIP != null) + { + hashCode = (hashCode * 59) + this.ShopperIP.GetHashCode(); + } + if (this.ShopperLocale != null) + { + hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); + } + if (this.ShopperReference != null) + { + hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.SplitCardFundingSources.GetHashCode(); + if (this.Store != null) + { + hashCode = (hashCode * 59) + this.Store.GetHashCode(); + } + hashCode = (hashCode * 59) + this.StoreFiltrationMode.GetHashCode(); + if (this.TelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); + } + return hashCode; } - if (paymentMethodsRequest.BlockedPaymentMethodsOption.IsSet) + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + // ShopperConversionId (string) maxLength + if (this.ShopperConversionId != null && this.ShopperConversionId.Length > 256) { - writer.WritePropertyName("blockedPaymentMethods"); - JsonSerializer.Serialize(writer, paymentMethodsRequest.BlockedPaymentMethods, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperConversionId, length must be less than 256.", new [] { "ShopperConversionId" }); } - if (paymentMethodsRequest.BrowserInfoOption.IsSet) + + // Store (string) maxLength + if (this.Store != null && this.Store.Length > 16) { - writer.WritePropertyName("browserInfo"); - JsonSerializer.Serialize(writer, paymentMethodsRequest.BrowserInfo, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be less than 16.", new [] { "Store" }); } - var channelRawValue = PaymentMethodsRequest.ChannelEnumToJsonValue(paymentMethodsRequest.ChannelOption.Value.Value); - writer.WriteString("channel", channelRawValue); - if (paymentMethodsRequest.CountryCodeOption.IsSet) - writer.WriteString("countryCode", paymentMethodsRequest.CountryCode); - if (paymentMethodsRequest.OrderOption.IsSet) + // Store (string) minLength + if (this.Store != null && this.Store.Length < 1) { - writer.WritePropertyName("order"); - JsonSerializer.Serialize(writer, paymentMethodsRequest.Order, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be greater than 1.", new [] { "Store" }); } - if (paymentMethodsRequest.ShopperConversionIdOption.IsSet) - writer.WriteString("shopperConversionId", paymentMethodsRequest.ShopperConversionId); - - if (paymentMethodsRequest.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", paymentMethodsRequest.ShopperEmail); - if (paymentMethodsRequest.ShopperIPOption.IsSet) - writer.WriteString("shopperIP", paymentMethodsRequest.ShopperIP); - - if (paymentMethodsRequest.ShopperLocaleOption.IsSet) - writer.WriteString("shopperLocale", paymentMethodsRequest.ShopperLocale); - - if (paymentMethodsRequest.ShopperReferenceOption.IsSet) - writer.WriteString("shopperReference", paymentMethodsRequest.ShopperReference); - - if (paymentMethodsRequest.SplitCardFundingSourcesOption.IsSet) - writer.WriteBoolean("splitCardFundingSources", paymentMethodsRequest.SplitCardFundingSourcesOption.Value.Value); - - if (paymentMethodsRequest.StoreOption.IsSet) - writer.WriteString("store", paymentMethodsRequest.Store); - - var storeFiltrationModeRawValue = PaymentMethodsRequest.StoreFiltrationModeEnumToJsonValue(paymentMethodsRequest.StoreFiltrationModeOption.Value.Value); - writer.WriteString("storeFiltrationMode", storeFiltrationModeRawValue); - if (paymentMethodsRequest.TelephoneNumberOption.IsSet) - writer.WriteString("telephoneNumber", paymentMethodsRequest.TelephoneNumber); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentMethodsResponse.cs b/Adyen/Model/Checkout/PaymentMethodsResponse.cs index 8eafdf230..28780af40 100644 --- a/Adyen/Model/Checkout/PaymentMethodsResponse.cs +++ b/Adyen/Model/Checkout/PaymentMethodsResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,62 +15,47 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentMethodsResponse /// - public partial class PaymentMethodsResponse : IValidatableObject + [DataContract(Name = "PaymentMethodsResponse")] + public partial class PaymentMethodsResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Detailed list of payment methods required to generate payment forms. - /// List of all stored payment methods. - [JsonConstructor] - public PaymentMethodsResponse(Option> paymentMethods = default, Option> storedPaymentMethods = default) + /// Detailed list of payment methods required to generate payment forms.. + /// List of all stored payment methods.. + public PaymentMethodsResponse(List paymentMethods = default(List), List storedPaymentMethods = default(List)) { - PaymentMethodsOption = paymentMethods; - StoredPaymentMethodsOption = storedPaymentMethods; - OnCreated(); + this.PaymentMethods = paymentMethods; + this.StoredPaymentMethods = storedPaymentMethods; } - partial void OnCreated(); - - /// - /// Used to track the state of PaymentMethods - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> PaymentMethodsOption { get; private set; } - /// /// Detailed list of payment methods required to generate payment forms. /// /// Detailed list of payment methods required to generate payment forms. - [JsonPropertyName("paymentMethods")] - public List PaymentMethods { get { return this.PaymentMethodsOption; } set { this.PaymentMethodsOption = new Option>(value); } } - - /// - /// Used to track the state of StoredPaymentMethods - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> StoredPaymentMethodsOption { get; private set; } + [DataMember(Name = "paymentMethods", EmitDefaultValue = false)] + public List PaymentMethods { get; set; } /// /// List of all stored payment methods. /// /// List of all stored payment methods. - [JsonPropertyName("storedPaymentMethods")] - public List StoredPaymentMethods { get { return this.StoredPaymentMethodsOption; } set { this.StoredPaymentMethodsOption = new Option>(value); } } + [DataMember(Name = "storedPaymentMethods", EmitDefaultValue = false)] + public List StoredPaymentMethods { get; set; } /// /// Returns the string presentation of the object @@ -86,119 +72,79 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentMethodsResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentMethodsResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option> paymentMethods = default; - Option> storedPaymentMethods = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "paymentMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - paymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "storedPaymentMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - storedPaymentMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (paymentMethods.IsSet && paymentMethods.Value == null) - throw new ArgumentNullException(nameof(paymentMethods), "Property is not nullable for class PaymentMethodsResponse."); - - if (storedPaymentMethods.IsSet && storedPaymentMethods.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethods), "Property is not nullable for class PaymentMethodsResponse."); - - return new PaymentMethodsResponse(paymentMethods, storedPaymentMethods); + return this.Equals(input as PaymentMethodsResponse); } /// - /// Serializes a + /// Returns true if PaymentMethodsResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentMethodsResponse paymentMethodsResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentMethodsResponse to be compared + /// Boolean + public bool Equals(PaymentMethodsResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, paymentMethodsResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.PaymentMethods == input.PaymentMethods || + this.PaymentMethods != null && + input.PaymentMethods != null && + this.PaymentMethods.SequenceEqual(input.PaymentMethods) + ) && + ( + this.StoredPaymentMethods == input.StoredPaymentMethods || + this.StoredPaymentMethods != null && + input.StoredPaymentMethods != null && + this.StoredPaymentMethods.SequenceEqual(input.StoredPaymentMethods) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentMethodsResponse paymentMethodsResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paymentMethodsResponse.PaymentMethodsOption.IsSet && paymentMethodsResponse.PaymentMethods == null) - throw new ArgumentNullException(nameof(paymentMethodsResponse.PaymentMethods), "Property is required for class PaymentMethodsResponse."); - - if (paymentMethodsResponse.StoredPaymentMethodsOption.IsSet && paymentMethodsResponse.StoredPaymentMethods == null) - throw new ArgumentNullException(nameof(paymentMethodsResponse.StoredPaymentMethods), "Property is required for class PaymentMethodsResponse."); - - if (paymentMethodsResponse.PaymentMethodsOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("paymentMethods"); - JsonSerializer.Serialize(writer, paymentMethodsResponse.PaymentMethods, jsonSerializerOptions); - } - if (paymentMethodsResponse.StoredPaymentMethodsOption.IsSet) - { - writer.WritePropertyName("storedPaymentMethods"); - JsonSerializer.Serialize(writer, paymentMethodsResponse.StoredPaymentMethods, jsonSerializerOptions); + int hashCode = 41; + if (this.PaymentMethods != null) + { + hashCode = (hashCode * 59) + this.PaymentMethods.GetHashCode(); + } + if (this.StoredPaymentMethods != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethods.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/PaymentRefundRequest.cs b/Adyen/Model/Checkout/PaymentRefundRequest.cs index 72fca00bc..a5652d910 100644 --- a/Adyen/Model/Checkout/PaymentRefundRequest.cs +++ b/Adyen/Model/Checkout/PaymentRefundRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,254 +15,160 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentRefundRequest /// - public partial class PaymentRefundRequest : IValidatableObject + [DataContract(Name = "PaymentRefundRequest")] + public partial class PaymentRefundRequest : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The merchant account that is used to process the payment. - /// applicationInfo - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** - /// Your reference for the refund request. Maximum length: 80 characters. - /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). - /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. - [JsonConstructor] - public PaymentRefundRequest(Amount amount, string merchantAccount, Option applicationInfo = default, Option> lineItems = default, Option merchantRefundReason = default, Option reference = default, Option> splits = default, Option store = default) - { - Amount = amount; - MerchantAccount = merchantAccount; - ApplicationInfoOption = applicationInfo; - LineItemsOption = lineItems; - MerchantRefundReasonOption = merchantRefundReason; - ReferenceOption = reference; - SplitsOption = splits; - StoreOption = store; - OnCreated(); - } - - partial void OnCreated(); - /// /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** /// /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** + [JsonConverter(typeof(StringEnumConverter))] public enum MerchantRefundReasonEnum { /// /// Enum FRAUD for value: FRAUD /// + [EnumMember(Value = "FRAUD")] FRAUD = 1, /// /// Enum CUSTOMERREQUEST for value: CUSTOMER REQUEST /// + [EnumMember(Value = "CUSTOMER REQUEST")] CUSTOMERREQUEST = 2, /// /// Enum RETURN for value: RETURN /// + [EnumMember(Value = "RETURN")] RETURN = 3, /// /// Enum DUPLICATE for value: DUPLICATE /// + [EnumMember(Value = "DUPLICATE")] DUPLICATE = 4, /// /// Enum OTHER for value: OTHER /// + [EnumMember(Value = "OTHER")] OTHER = 5 - } - /// - /// Returns a - /// - /// - /// - /// - public static MerchantRefundReasonEnum MerchantRefundReasonEnumFromString(string value) - { - if (value.Equals("FRAUD")) - return MerchantRefundReasonEnum.FRAUD; - - if (value.Equals("CUSTOMER REQUEST")) - return MerchantRefundReasonEnum.CUSTOMERREQUEST; - - if (value.Equals("RETURN")) - return MerchantRefundReasonEnum.RETURN; - - if (value.Equals("DUPLICATE")) - return MerchantRefundReasonEnum.DUPLICATE; - - if (value.Equals("OTHER")) - return MerchantRefundReasonEnum.OTHER; - - throw new NotImplementedException($"Could not convert value to type MerchantRefundReasonEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static MerchantRefundReasonEnum? MerchantRefundReasonEnumFromStringOrDefault(string value) - { - if (value.Equals("FRAUD")) - return MerchantRefundReasonEnum.FRAUD; - - if (value.Equals("CUSTOMER REQUEST")) - return MerchantRefundReasonEnum.CUSTOMERREQUEST; - - if (value.Equals("RETURN")) - return MerchantRefundReasonEnum.RETURN; - - if (value.Equals("DUPLICATE")) - return MerchantRefundReasonEnum.DUPLICATE; - - if (value.Equals("OTHER")) - return MerchantRefundReasonEnum.OTHER; - - return null; - } /// - /// Converts the to the json value + /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** /// - /// - /// - /// - public static string MerchantRefundReasonEnumToJsonValue(MerchantRefundReasonEnum? value) - { - if (value == null) - return null; - - if (value == MerchantRefundReasonEnum.FRAUD) - return "FRAUD"; - - if (value == MerchantRefundReasonEnum.CUSTOMERREQUEST) - return "CUSTOMER REQUEST"; - - if (value == MerchantRefundReasonEnum.RETURN) - return "RETURN"; - - if (value == MerchantRefundReasonEnum.DUPLICATE) - return "DUPLICATE"; - - if (value == MerchantRefundReasonEnum.OTHER) - return "OTHER"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - + /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** + [DataMember(Name = "merchantRefundReason", EmitDefaultValue = false)] + public MerchantRefundReasonEnum? MerchantRefundReason { get; set; } /// - /// Used to track the state of MerchantRefundReason + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantRefundReasonOption { get; private set; } - + [JsonConstructorAttribute] + protected PaymentRefundRequest() { } /// - /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** + /// Initializes a new instance of the class. /// - /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** - [JsonPropertyName("merchantRefundReason")] - public MerchantRefundReasonEnum? MerchantRefundReason { get { return this.MerchantRefundReasonOption; } set { this.MerchantRefundReasonOption = new Option(value); } } + /// amount (required). + /// applicationInfo. + /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund.. + /// enhancedSchemeData. + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.. + /// The merchant account that is used to process the payment. (required). + /// The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * **RETURN** * **DUPLICATE** * **OTHER** . + /// Your reference for the refund request. Maximum length: 80 characters.. + /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/).. + /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails.. + public PaymentRefundRequest(Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), string capturePspReference = default(string), EnhancedSchemeData enhancedSchemeData = default(EnhancedSchemeData), List lineItems = default(List), string merchantAccount = default(string), MerchantRefundReasonEnum? merchantRefundReason = default(MerchantRefundReasonEnum?), string reference = default(string), List splits = default(List), string store = default(string)) + { + this.Amount = amount; + this.MerchantAccount = merchantAccount; + this.ApplicationInfo = applicationInfo; + this.CapturePspReference = capturePspReference; + this.EnhancedSchemeData = enhancedSchemeData; + this.LineItems = lineItems; + this.MerchantRefundReason = merchantRefundReason; + this.Reference = reference; + this.Splits = splits; + this.Store = store; + } /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] public Amount Amount { get; set; } /// - /// The merchant account that is used to process the payment. - /// - /// The merchant account that is used to process the payment. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } - - /// - /// Used to track the state of ApplicationInfo + /// Gets or Sets ApplicationInfo /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ApplicationInfoOption { get; private set; } + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } /// - /// Gets or Sets ApplicationInfo + /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund. /// - [JsonPropertyName("applicationInfo")] - public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund. + [DataMember(Name = "capturePspReference", EmitDefaultValue = false)] + public string CapturePspReference { get; set; } /// - /// Used to track the state of LineItems + /// Gets or Sets EnhancedSchemeData /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LineItemsOption { get; private set; } + [DataMember(Name = "enhancedSchemeData", EmitDefaultValue = false)] + public EnhancedSchemeData EnhancedSchemeData { get; set; } /// /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. /// /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - [JsonPropertyName("lineItems")] - public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } /// - /// Used to track the state of Reference + /// The merchant account that is used to process the payment. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + /// The merchant account that is used to process the payment. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// Your reference for the refund request. Maximum length: 80 characters. /// /// Your reference for the refund request. Maximum length: 80 characters. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Splits - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SplitsOption { get; private set; } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). - [JsonPropertyName("splits")] - public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } - - /// - /// Used to track the state of Store - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoreOption { get; private set; } + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. /// /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. - [JsonPropertyName("store")] - public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } + [DataMember(Name = "store", EmitDefaultValue = false)] + public string Store { get; set; } /// /// Returns the string presentation of the object @@ -272,9 +179,11 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PaymentRefundRequest {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); + sb.Append(" CapturePspReference: ").Append(CapturePspReference).Append("\n"); + sb.Append(" EnhancedSchemeData: ").Append(EnhancedSchemeData).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantRefundReason: ").Append(MerchantRefundReason).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); @@ -284,203 +193,147 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentRefundRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentRefundRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option merchantAccount = default; - Option applicationInfo = default; - Option> lineItems = default; - Option merchantRefundReason = default; - Option reference = default; - Option> splits = default; - Option store = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "applicationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "lineItems": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantRefundReason": - string merchantRefundReasonRawValue = utf8JsonReader.GetString(); - if (merchantRefundReasonRawValue != null) - merchantRefundReason = new Option(PaymentRefundRequest.MerchantRefundReasonEnumFromStringOrDefault(merchantRefundReasonRawValue)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "splits": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "store": - store = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class PaymentRefundRequest.", nameof(amount)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentRefundRequest.", nameof(merchantAccount)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentRefundRequest."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentRefundRequest."); - - if (applicationInfo.IsSet && applicationInfo.Value == null) - throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentRefundRequest."); - - if (lineItems.IsSet && lineItems.Value == null) - throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentRefundRequest."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentRefundRequest."); - - if (splits.IsSet && splits.Value == null) - throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentRefundRequest."); - - if (store.IsSet && store.Value == null) - throw new ArgumentNullException(nameof(store), "Property is not nullable for class PaymentRefundRequest."); - - return new PaymentRefundRequest(amount.Value, merchantAccount.Value, applicationInfo, lineItems, merchantRefundReason, reference, splits, store); + return this.Equals(input as PaymentRefundRequest); } /// - /// Serializes a + /// Returns true if PaymentRefundRequest instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentRefundRequest paymentRefundRequest, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentRefundRequest to be compared + /// Boolean + public bool Equals(PaymentRefundRequest input) { - writer.WriteStartObject(); - - WriteProperties(writer, paymentRefundRequest, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.ApplicationInfo == input.ApplicationInfo || + (this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo)) + ) && + ( + this.CapturePspReference == input.CapturePspReference || + (this.CapturePspReference != null && + this.CapturePspReference.Equals(input.CapturePspReference)) + ) && + ( + this.EnhancedSchemeData == input.EnhancedSchemeData || + (this.EnhancedSchemeData != null && + this.EnhancedSchemeData.Equals(input.EnhancedSchemeData)) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.MerchantRefundReason == input.MerchantRefundReason || + this.MerchantRefundReason.Equals(input.MerchantRefundReason) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.Store == input.Store || + (this.Store != null && + this.Store.Equals(input.Store)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentRefundRequest paymentRefundRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paymentRefundRequest.Amount == null) - throw new ArgumentNullException(nameof(paymentRefundRequest.Amount), "Property is required for class PaymentRefundRequest."); - - if (paymentRefundRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentRefundRequest.MerchantAccount), "Property is required for class PaymentRefundRequest."); - - if (paymentRefundRequest.ApplicationInfoOption.IsSet && paymentRefundRequest.ApplicationInfo == null) - throw new ArgumentNullException(nameof(paymentRefundRequest.ApplicationInfo), "Property is required for class PaymentRefundRequest."); - - if (paymentRefundRequest.LineItemsOption.IsSet && paymentRefundRequest.LineItems == null) - throw new ArgumentNullException(nameof(paymentRefundRequest.LineItems), "Property is required for class PaymentRefundRequest."); - - if (paymentRefundRequest.ReferenceOption.IsSet && paymentRefundRequest.Reference == null) - throw new ArgumentNullException(nameof(paymentRefundRequest.Reference), "Property is required for class PaymentRefundRequest."); - - if (paymentRefundRequest.SplitsOption.IsSet && paymentRefundRequest.Splits == null) - throw new ArgumentNullException(nameof(paymentRefundRequest.Splits), "Property is required for class PaymentRefundRequest."); - - if (paymentRefundRequest.StoreOption.IsSet && paymentRefundRequest.Store == null) - throw new ArgumentNullException(nameof(paymentRefundRequest.Store), "Property is required for class PaymentRefundRequest."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, paymentRefundRequest.Amount, jsonSerializerOptions); - writer.WriteString("merchantAccount", paymentRefundRequest.MerchantAccount); - - if (paymentRefundRequest.ApplicationInfoOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("applicationInfo"); - JsonSerializer.Serialize(writer, paymentRefundRequest.ApplicationInfo, jsonSerializerOptions); - } - if (paymentRefundRequest.LineItemsOption.IsSet) - { - writer.WritePropertyName("lineItems"); - JsonSerializer.Serialize(writer, paymentRefundRequest.LineItems, jsonSerializerOptions); - } - var merchantRefundReasonRawValue = PaymentRefundRequest.MerchantRefundReasonEnumToJsonValue(paymentRefundRequest.MerchantRefundReasonOption.Value.Value); - if (merchantRefundReasonRawValue != null) - writer.WriteString("merchantRefundReason", merchantRefundReasonRawValue); - else - writer.WriteNull("merchantRefundReason"); - - if (paymentRefundRequest.ReferenceOption.IsSet) - writer.WriteString("reference", paymentRefundRequest.Reference); - - if (paymentRefundRequest.SplitsOption.IsSet) - { - writer.WritePropertyName("splits"); - JsonSerializer.Serialize(writer, paymentRefundRequest.Splits, jsonSerializerOptions); + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.ApplicationInfo != null) + { + hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); + } + if (this.CapturePspReference != null) + { + hashCode = (hashCode * 59) + this.CapturePspReference.GetHashCode(); + } + if (this.EnhancedSchemeData != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeData.GetHashCode(); + } + if (this.LineItems != null) + { + hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MerchantRefundReason.GetHashCode(); + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.Splits != null) + { + hashCode = (hashCode * 59) + this.Splits.GetHashCode(); + } + if (this.Store != null) + { + hashCode = (hashCode * 59) + this.Store.GetHashCode(); + } + return hashCode; } - if (paymentRefundRequest.StoreOption.IsSet) - writer.WriteString("store", paymentRefundRequest.Store); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentRefundResponse.cs b/Adyen/Model/Checkout/PaymentRefundResponse.cs index 9e2249c41..a4478de85 100644 --- a/Adyen/Model/Checkout/PaymentRefundResponse.cs +++ b/Adyen/Model/Checkout/PaymentRefundResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,335 +15,186 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentRefundResponse /// - public partial class PaymentRefundResponse : IValidatableObject + [DataContract(Name = "PaymentRefundResponse")] + public partial class PaymentRefundResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The merchant account that is used to process the payment. - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. - /// Adyen's 16-character reference associated with the refund request. - /// The status of your request. This will always have the value **received**. - /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund. - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - /// Your reason for the refund request. - /// Your reference for the refund request. - /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). - /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. - [JsonConstructor] - public PaymentRefundResponse(Amount amount, string merchantAccount, string paymentPspReference, string pspReference, StatusEnum status, Option capturePspReference = default, Option> lineItems = default, Option merchantRefundReason = default, Option reference = default, Option> splits = default, Option store = default) - { - Amount = amount; - MerchantAccount = merchantAccount; - PaymentPspReference = paymentPspReference; - PspReference = pspReference; - Status = status; - CapturePspReferenceOption = capturePspReference; - LineItemsOption = lineItems; - MerchantRefundReasonOption = merchantRefundReason; - ReferenceOption = reference; - SplitsOption = splits; - StoreOption = store; - OnCreated(); - } - - partial void OnCreated(); - - /// - /// The status of your request. This will always have the value **received**. - /// - /// The status of your request. This will always have the value **received**. - public enum StatusEnum - { - /// - /// Enum Received for value: received - /// - Received = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static StatusEnum StatusEnumFromString(string value) - { - if (value.Equals("received")) - return StatusEnum.Received; - - throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static StatusEnum? StatusEnumFromStringOrDefault(string value) - { - if (value.Equals("received")) - return StatusEnum.Received; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string StatusEnumToJsonValue(StatusEnum value) - { - if (value == StatusEnum.Received) - return "received"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// The status of your request. This will always have the value **received**. - /// - /// The status of your request. This will always have the value **received**. - [JsonPropertyName("status")] - public StatusEnum Status { get; set; } - /// /// Your reason for the refund request. /// /// Your reason for the refund request. + [JsonConverter(typeof(StringEnumConverter))] public enum MerchantRefundReasonEnum { /// /// Enum FRAUD for value: FRAUD /// + [EnumMember(Value = "FRAUD")] FRAUD = 1, /// /// Enum CUSTOMERREQUEST for value: CUSTOMER REQUEST /// + [EnumMember(Value = "CUSTOMER REQUEST")] CUSTOMERREQUEST = 2, /// /// Enum RETURN for value: RETURN /// + [EnumMember(Value = "RETURN")] RETURN = 3, /// /// Enum DUPLICATE for value: DUPLICATE /// + [EnumMember(Value = "DUPLICATE")] DUPLICATE = 4, /// /// Enum OTHER for value: OTHER /// + [EnumMember(Value = "OTHER")] OTHER = 5 + } + /// - /// Returns a + /// Your reason for the refund request. /// - /// - /// - /// - public static MerchantRefundReasonEnum MerchantRefundReasonEnumFromString(string value) - { - if (value.Equals("FRAUD")) - return MerchantRefundReasonEnum.FRAUD; - - if (value.Equals("CUSTOMER REQUEST")) - return MerchantRefundReasonEnum.CUSTOMERREQUEST; - - if (value.Equals("RETURN")) - return MerchantRefundReasonEnum.RETURN; - - if (value.Equals("DUPLICATE")) - return MerchantRefundReasonEnum.DUPLICATE; - - if (value.Equals("OTHER")) - return MerchantRefundReasonEnum.OTHER; - - throw new NotImplementedException($"Could not convert value to type MerchantRefundReasonEnum: '{value}'"); - } - + /// Your reason for the refund request. + [DataMember(Name = "merchantRefundReason", EmitDefaultValue = false)] + public MerchantRefundReasonEnum? MerchantRefundReason { get; set; } /// - /// Returns a + /// The status of your request. This will always have the value **received**. /// - /// - /// - public static MerchantRefundReasonEnum? MerchantRefundReasonEnumFromStringOrDefault(string value) + /// The status of your request. This will always have the value **received**. + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum { - if (value.Equals("FRAUD")) - return MerchantRefundReasonEnum.FRAUD; - - if (value.Equals("CUSTOMER REQUEST")) - return MerchantRefundReasonEnum.CUSTOMERREQUEST; - - if (value.Equals("RETURN")) - return MerchantRefundReasonEnum.RETURN; - - if (value.Equals("DUPLICATE")) - return MerchantRefundReasonEnum.DUPLICATE; - - if (value.Equals("OTHER")) - return MerchantRefundReasonEnum.OTHER; + /// + /// Enum Received for value: received + /// + [EnumMember(Value = "received")] + Received = 1 - return null; } + /// - /// Converts the to the json value + /// The status of your request. This will always have the value **received**. /// - /// - /// - /// - public static string MerchantRefundReasonEnumToJsonValue(MerchantRefundReasonEnum? value) + /// The status of your request. This will always have the value **received**. + [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] + public StatusEnum Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected PaymentRefundResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// amount (required). + /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund.. + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.. + /// The merchant account that is used to process the payment. (required). + /// Your reason for the refund request.. + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. (required). + /// Adyen's 16-character reference associated with the refund request. (required). + /// Your reference for the refund request.. + /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/).. + /// The status of your request. This will always have the value **received**. (required). + /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails.. + public PaymentRefundResponse(Amount amount = default(Amount), string capturePspReference = default(string), List lineItems = default(List), string merchantAccount = default(string), MerchantRefundReasonEnum? merchantRefundReason = default(MerchantRefundReasonEnum?), string paymentPspReference = default(string), string pspReference = default(string), string reference = default(string), List splits = default(List), StatusEnum status = default(StatusEnum), string store = default(string)) { - if (value == null) - return null; - - if (value == MerchantRefundReasonEnum.FRAUD) - return "FRAUD"; - - if (value == MerchantRefundReasonEnum.CUSTOMERREQUEST) - return "CUSTOMER REQUEST"; - - if (value == MerchantRefundReasonEnum.RETURN) - return "RETURN"; - - if (value == MerchantRefundReasonEnum.DUPLICATE) - return "DUPLICATE"; - - if (value == MerchantRefundReasonEnum.OTHER) - return "OTHER"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.Amount = amount; + this.MerchantAccount = merchantAccount; + this.PaymentPspReference = paymentPspReference; + this.PspReference = pspReference; + this.Status = status; + this.CapturePspReference = capturePspReference; + this.LineItems = lineItems; + this.MerchantRefundReason = merchantRefundReason; + this.Reference = reference; + this.Splits = splits; + this.Store = store; } /// - /// Used to track the state of MerchantRefundReason + /// Gets or Sets Amount /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantRefundReasonOption { get; private set; } + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] + public Amount Amount { get; set; } /// - /// Your reason for the refund request. + /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund. /// - /// Your reason for the refund request. - [JsonPropertyName("merchantRefundReason")] - public MerchantRefundReasonEnum? MerchantRefundReason { get { return this.MerchantRefundReasonOption; } set { this.MerchantRefundReasonOption = new Option(value); } } + /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund. + [DataMember(Name = "capturePspReference", EmitDefaultValue = false)] + public string CapturePspReference { get; set; } /// - /// Gets or Sets Amount + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. /// - [JsonPropertyName("amount")] - public Amount Amount { get; set; } + /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [JsonPropertyName("merchantAccount")] + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] public string MerchantAccount { get; set; } /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. - [JsonPropertyName("paymentPspReference")] + [DataMember(Name = "paymentPspReference", IsRequired = false, EmitDefaultValue = false)] public string PaymentPspReference { get; set; } /// /// Adyen's 16-character reference associated with the refund request. /// /// Adyen's 16-character reference associated with the refund request. - [JsonPropertyName("pspReference")] + [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] public string PspReference { get; set; } - /// - /// Used to track the state of CapturePspReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CapturePspReferenceOption { get; private set; } - - /// - /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund. - /// - /// This is only available for PayPal refunds. The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the specific capture to refund. - [JsonPropertyName("capturePspReference")] - public string CapturePspReference { get { return this.CapturePspReferenceOption; } set { this.CapturePspReferenceOption = new Option(value); } } - - /// - /// Used to track the state of LineItems - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LineItemsOption { get; private set; } - - /// - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - /// - /// Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. - [JsonPropertyName("lineItems")] - public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } - - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } - /// /// Your reference for the refund request. /// /// Your reference for the refund request. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Splits - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SplitsOption { get; private set; } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). /// /// An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For more information, see how to process payments for [marketplaces](https://docs.adyen.com/marketplaces/split-payments) or [platforms](https://docs.adyen.com/platforms/online-payments/split-payments/). - [JsonPropertyName("splits")] - public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } - - /// - /// Used to track the state of Store - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoreOption { get; private set; } + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. /// /// The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area. Otherwise, you get an error and the refund fails. - [JsonPropertyName("store")] - public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } + [DataMember(Name = "store", EmitDefaultValue = false)] + public string Store { get; set; } /// /// Returns the string presentation of the object @@ -353,259 +205,167 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PaymentRefundResponse {\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); - sb.Append(" PaymentPspReference: ").Append(PaymentPspReference).Append("\n"); - sb.Append(" PspReference: ").Append(PspReference).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" CapturePspReference: ").Append(CapturePspReference).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantRefundReason: ").Append(MerchantRefundReason).Append("\n"); + sb.Append(" PaymentPspReference: ").Append(PaymentPspReference).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" Store: ").Append(Store).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentRefundResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentRefundResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option merchantAccount = default; - Option paymentPspReference = default; - Option pspReference = default; - Option status = default; - Option capturePspReference = default; - Option> lineItems = default; - Option merchantRefundReason = default; - Option reference = default; - Option> splits = default; - Option store = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "paymentPspReference": - paymentPspReference = new Option(utf8JsonReader.GetString()); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "status": - string statusRawValue = utf8JsonReader.GetString(); - if (statusRawValue != null) - status = new Option(PaymentRefundResponse.StatusEnumFromStringOrDefault(statusRawValue)); - break; - case "capturePspReference": - capturePspReference = new Option(utf8JsonReader.GetString()); - break; - case "lineItems": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantRefundReason": - string merchantRefundReasonRawValue = utf8JsonReader.GetString(); - if (merchantRefundReasonRawValue != null) - merchantRefundReason = new Option(PaymentRefundResponse.MerchantRefundReasonEnumFromStringOrDefault(merchantRefundReasonRawValue)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "splits": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "store": - store = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class PaymentRefundResponse.", nameof(amount)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentRefundResponse.", nameof(merchantAccount)); - - if (!paymentPspReference.IsSet) - throw new ArgumentException("Property is required for class PaymentRefundResponse.", nameof(paymentPspReference)); - - if (!pspReference.IsSet) - throw new ArgumentException("Property is required for class PaymentRefundResponse.", nameof(pspReference)); - - if (!status.IsSet) - throw new ArgumentException("Property is required for class PaymentRefundResponse.", nameof(status)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentRefundResponse."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentRefundResponse."); - - if (paymentPspReference.IsSet && paymentPspReference.Value == null) - throw new ArgumentNullException(nameof(paymentPspReference), "Property is not nullable for class PaymentRefundResponse."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentRefundResponse."); - - if (status.IsSet && status.Value == null) - throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaymentRefundResponse."); - - if (capturePspReference.IsSet && capturePspReference.Value == null) - throw new ArgumentNullException(nameof(capturePspReference), "Property is not nullable for class PaymentRefundResponse."); - - if (lineItems.IsSet && lineItems.Value == null) - throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentRefundResponse."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentRefundResponse."); - - if (splits.IsSet && splits.Value == null) - throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentRefundResponse."); - - if (store.IsSet && store.Value == null) - throw new ArgumentNullException(nameof(store), "Property is not nullable for class PaymentRefundResponse."); - - return new PaymentRefundResponse(amount.Value, merchantAccount.Value, paymentPspReference.Value, pspReference.Value, status.Value.Value, capturePspReference, lineItems, merchantRefundReason, reference, splits, store); + return this.Equals(input as PaymentRefundResponse); } /// - /// Serializes a + /// Returns true if PaymentRefundResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentRefundResponse paymentRefundResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentRefundResponse to be compared + /// Boolean + public bool Equals(PaymentRefundResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, paymentRefundResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.CapturePspReference == input.CapturePspReference || + (this.CapturePspReference != null && + this.CapturePspReference.Equals(input.CapturePspReference)) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.MerchantRefundReason == input.MerchantRefundReason || + this.MerchantRefundReason.Equals(input.MerchantRefundReason) + ) && + ( + this.PaymentPspReference == input.PaymentPspReference || + (this.PaymentPspReference != null && + this.PaymentPspReference.Equals(input.PaymentPspReference)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ) && + ( + this.Store == input.Store || + (this.Store != null && + this.Store.Equals(input.Store)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentRefundResponse paymentRefundResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paymentRefundResponse.Amount == null) - throw new ArgumentNullException(nameof(paymentRefundResponse.Amount), "Property is required for class PaymentRefundResponse."); - - if (paymentRefundResponse.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentRefundResponse.MerchantAccount), "Property is required for class PaymentRefundResponse."); - - if (paymentRefundResponse.PaymentPspReference == null) - throw new ArgumentNullException(nameof(paymentRefundResponse.PaymentPspReference), "Property is required for class PaymentRefundResponse."); - - if (paymentRefundResponse.PspReference == null) - throw new ArgumentNullException(nameof(paymentRefundResponse.PspReference), "Property is required for class PaymentRefundResponse."); - - if (paymentRefundResponse.CapturePspReferenceOption.IsSet && paymentRefundResponse.CapturePspReference == null) - throw new ArgumentNullException(nameof(paymentRefundResponse.CapturePspReference), "Property is required for class PaymentRefundResponse."); - - if (paymentRefundResponse.LineItemsOption.IsSet && paymentRefundResponse.LineItems == null) - throw new ArgumentNullException(nameof(paymentRefundResponse.LineItems), "Property is required for class PaymentRefundResponse."); - - if (paymentRefundResponse.ReferenceOption.IsSet && paymentRefundResponse.Reference == null) - throw new ArgumentNullException(nameof(paymentRefundResponse.Reference), "Property is required for class PaymentRefundResponse."); - - if (paymentRefundResponse.SplitsOption.IsSet && paymentRefundResponse.Splits == null) - throw new ArgumentNullException(nameof(paymentRefundResponse.Splits), "Property is required for class PaymentRefundResponse."); - - if (paymentRefundResponse.StoreOption.IsSet && paymentRefundResponse.Store == null) - throw new ArgumentNullException(nameof(paymentRefundResponse.Store), "Property is required for class PaymentRefundResponse."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, paymentRefundResponse.Amount, jsonSerializerOptions); - writer.WriteString("merchantAccount", paymentRefundResponse.MerchantAccount); - - writer.WriteString("paymentPspReference", paymentRefundResponse.PaymentPspReference); - - writer.WriteString("pspReference", paymentRefundResponse.PspReference); - - var statusRawValue = PaymentRefundResponse.StatusEnumToJsonValue(paymentRefundResponse.Status); - writer.WriteString("status", statusRawValue); - if (paymentRefundResponse.CapturePspReferenceOption.IsSet) - writer.WriteString("capturePspReference", paymentRefundResponse.CapturePspReference); - - if (paymentRefundResponse.LineItemsOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("lineItems"); - JsonSerializer.Serialize(writer, paymentRefundResponse.LineItems, jsonSerializerOptions); - } - var merchantRefundReasonRawValue = PaymentRefundResponse.MerchantRefundReasonEnumToJsonValue(paymentRefundResponse.MerchantRefundReasonOption.Value.Value); - if (merchantRefundReasonRawValue != null) - writer.WriteString("merchantRefundReason", merchantRefundReasonRawValue); - else - writer.WriteNull("merchantRefundReason"); - - if (paymentRefundResponse.ReferenceOption.IsSet) - writer.WriteString("reference", paymentRefundResponse.Reference); - - if (paymentRefundResponse.SplitsOption.IsSet) - { - writer.WritePropertyName("splits"); - JsonSerializer.Serialize(writer, paymentRefundResponse.Splits, jsonSerializerOptions); + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.CapturePspReference != null) + { + hashCode = (hashCode * 59) + this.CapturePspReference.GetHashCode(); + } + if (this.LineItems != null) + { + hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MerchantRefundReason.GetHashCode(); + if (this.PaymentPspReference != null) + { + hashCode = (hashCode * 59) + this.PaymentPspReference.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.Splits != null) + { + hashCode = (hashCode * 59) + this.Splits.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + if (this.Store != null) + { + hashCode = (hashCode * 59) + this.Store.GetHashCode(); + } + return hashCode; } - if (paymentRefundResponse.StoreOption.IsSet) - writer.WriteString("store", paymentRefundResponse.Store); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentRequest.cs b/Adyen/Model/Checkout/PaymentRequest.cs index 394488449..ddb2751e2 100644 --- a/Adyen/Model/Checkout/PaymentRequest.cs +++ b/Adyen/Model/Checkout/PaymentRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,1530 +15,795 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentRequest /// - public partial class PaymentRequest : IValidatableObject + [DataContract(Name = "PaymentRequest")] + public partial class PaymentRequest : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// amount - /// The merchant account identifier, with which you want to process the transaction. - /// paymentMethod - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.example.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. - /// accountInfo - /// additionalAmount - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - /// applicationInfo - /// authenticationData - /// bankAccount - /// billingAddress - /// browserInfo - /// The delay between the authorisation and scheduled auto-capture, specified in hours. - /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web - /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - /// company - /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - /// dccQuote - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - /// deliveryAddress - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. - /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. - /// enhancedSchemeData - /// The type of the entity the payment is processed for. - /// An integer value that is added to the normal fraud score. The value can be either positive or negative. - /// fundOrigin - /// fundRecipient - /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - /// installments - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. - /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. - /// mandate - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - /// merchantRiskIndicator - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - /// mpiData - /// order - /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. - /// platformChargebackLogic - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. - /// Minimum number of days between authorisations. Only for 3D Secure 2. - /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. - /// Specifies the redirect method (GET or POST) when redirecting to the issuer. - /// riskData - /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 - /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - /// The combination of a language code and a country code to specify the language to be used in the payment. - /// shopperName - /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - /// The shopper's social security number. - /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). - /// This field contains additional information on the submerchant, who is onboarded to an acquirer through a payment facilitator or aggregator - /// surcharge - /// The shopper's telephone number. - /// threeDS2RequestData - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) - /// Set to true if the payment should be routed to a trusted MID. - [JsonConstructor] - public PaymentRequest(Amount amount, string merchantAccount, CheckoutPaymentMethod paymentMethod, string reference, string returnUrl, Option accountInfo = default, Option additionalAmount = default, Option> additionalData = default, Option applicationInfo = default, Option authenticationData = default, Option bankAccount = default, Option billingAddress = default, Option browserInfo = default, Option captureDelayHours = default, Option channel = default, Option checkoutAttemptId = default, Option company = default, Option conversionId = default, Option countryCode = default, Option dateOfBirth = default, Option dccQuote = default, Option deliverAt = default, Option deliveryAddress = default, Option deliveryDate = default, Option deviceFingerprint = default, Option enableOneClick = default, Option enablePayOut = default, Option enableRecurring = default, Option enhancedSchemeData = default, Option entityType = default, Option fraudOffset = default, Option fundOrigin = default, Option fundRecipient = default, Option industryUsage = default, Option installments = default, Option> lineItems = default, Option> localizedShopperStatement = default, Option mandate = default, Option mcc = default, Option merchantOrderReference = default, Option merchantRiskIndicator = default, Option> metadata = default, Option mpiData = default, Option order = default, Option orderReference = default, Option origin = default, Option platformChargebackLogic = default, Option recurringExpiry = default, Option recurringFrequency = default, Option recurringProcessingModel = default, Option redirectFromIssuerMethod = default, Option redirectToIssuerMethod = default, Option riskData = default, Option sessionValidity = default, Option shopperConversionId = default, Option shopperEmail = default, Option shopperIP = default, Option shopperInteraction = default, Option shopperLocale = default, Option shopperName = default, Option shopperReference = default, Option shopperStatement = default, Option socialSecurityNumber = default, Option> splits = default, Option store = default, Option storePaymentMethod = default, Option> subMerchants = default, Option surcharge = default, Option telephoneNumber = default, Option threeDS2RequestData = default, Option threeDSAuthenticationOnly = default, Option trustedShopper = default) - { - Amount = amount; - MerchantAccount = merchantAccount; - PaymentMethod = paymentMethod; - Reference = reference; - ReturnUrl = returnUrl; - AccountInfoOption = accountInfo; - AdditionalAmountOption = additionalAmount; - AdditionalDataOption = additionalData; - ApplicationInfoOption = applicationInfo; - AuthenticationDataOption = authenticationData; - BankAccountOption = bankAccount; - BillingAddressOption = billingAddress; - BrowserInfoOption = browserInfo; - CaptureDelayHoursOption = captureDelayHours; - ChannelOption = channel; - CheckoutAttemptIdOption = checkoutAttemptId; - CompanyOption = company; - ConversionIdOption = conversionId; - CountryCodeOption = countryCode; - DateOfBirthOption = dateOfBirth; - DccQuoteOption = dccQuote; - DeliverAtOption = deliverAt; - DeliveryAddressOption = deliveryAddress; - DeliveryDateOption = deliveryDate; - DeviceFingerprintOption = deviceFingerprint; - EnableOneClickOption = enableOneClick; - EnablePayOutOption = enablePayOut; - EnableRecurringOption = enableRecurring; - EnhancedSchemeDataOption = enhancedSchemeData; - EntityTypeOption = entityType; - FraudOffsetOption = fraudOffset; - FundOriginOption = fundOrigin; - FundRecipientOption = fundRecipient; - IndustryUsageOption = industryUsage; - InstallmentsOption = installments; - LineItemsOption = lineItems; - LocalizedShopperStatementOption = localizedShopperStatement; - MandateOption = mandate; - MccOption = mcc; - MerchantOrderReferenceOption = merchantOrderReference; - MerchantRiskIndicatorOption = merchantRiskIndicator; - MetadataOption = metadata; - MpiDataOption = mpiData; - OrderOption = order; - OrderReferenceOption = orderReference; - OriginOption = origin; - PlatformChargebackLogicOption = platformChargebackLogic; - RecurringExpiryOption = recurringExpiry; - RecurringFrequencyOption = recurringFrequency; - RecurringProcessingModelOption = recurringProcessingModel; - RedirectFromIssuerMethodOption = redirectFromIssuerMethod; - RedirectToIssuerMethodOption = redirectToIssuerMethod; - RiskDataOption = riskData; - SessionValidityOption = sessionValidity; - ShopperConversionIdOption = shopperConversionId; - ShopperEmailOption = shopperEmail; - ShopperIPOption = shopperIP; - ShopperInteractionOption = shopperInteraction; - ShopperLocaleOption = shopperLocale; - ShopperNameOption = shopperName; - ShopperReferenceOption = shopperReference; - ShopperStatementOption = shopperStatement; - SocialSecurityNumberOption = socialSecurityNumber; - SplitsOption = splits; - StoreOption = store; - StorePaymentMethodOption = storePaymentMethod; - SubMerchantsOption = subMerchants; - SurchargeOption = surcharge; - TelephoneNumberOption = telephoneNumber; - ThreeDS2RequestDataOption = threeDS2RequestData; - ThreeDSAuthenticationOnlyOption = threeDSAuthenticationOnly; - TrustedShopperOption = trustedShopper; - OnCreated(); - } - - partial void OnCreated(); - /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web + [JsonConverter(typeof(StringEnumConverter))] public enum ChannelEnum { /// /// Enum IOS for value: iOS /// + [EnumMember(Value = "iOS")] IOS = 1, /// /// Enum Android for value: Android /// + [EnumMember(Value = "Android")] Android = 2, /// /// Enum Web for value: Web /// + [EnumMember(Value = "Web")] Web = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ChannelEnum ChannelEnumFromString(string value) - { - if (value.Equals("iOS")) - return ChannelEnum.IOS; - - if (value.Equals("Android")) - return ChannelEnum.Android; - - if (value.Equals("Web")) - return ChannelEnum.Web; - - throw new NotImplementedException($"Could not convert value to type ChannelEnum: '{value}'"); - } - /// - /// Returns a - /// - /// - /// - public static ChannelEnum? ChannelEnumFromStringOrDefault(string value) - { - if (value.Equals("iOS")) - return ChannelEnum.IOS; - - if (value.Equals("Android")) - return ChannelEnum.Android; - - if (value.Equals("Web")) - return ChannelEnum.Web; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChannelEnumToJsonValue(ChannelEnum? value) - { - if (value == ChannelEnum.IOS) - return "iOS"; - - if (value == ChannelEnum.Android) - return "Android"; - - if (value == ChannelEnum.Web) - return "Web"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Channel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChannelOption { get; private set; } /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web /// /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web - [JsonPropertyName("channel")] - public ChannelEnum? Channel { get { return this.ChannelOption; } set { this.ChannelOption = new Option(value); } } - + [DataMember(Name = "channel", EmitDefaultValue = false)] + public ChannelEnum? Channel { get; set; } /// /// The type of the entity the payment is processed for. /// /// The type of the entity the payment is processed for. + [JsonConverter(typeof(StringEnumConverter))] public enum EntityTypeEnum { /// /// Enum NaturalPerson for value: NaturalPerson /// + [EnumMember(Value = "NaturalPerson")] NaturalPerson = 1, /// /// Enum CompanyName for value: CompanyName /// + [EnumMember(Value = "CompanyName")] CompanyName = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static EntityTypeEnum EntityTypeEnumFromString(string value) - { - if (value.Equals("NaturalPerson")) - return EntityTypeEnum.NaturalPerson; - - if (value.Equals("CompanyName")) - return EntityTypeEnum.CompanyName; - - throw new NotImplementedException($"Could not convert value to type EntityTypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static EntityTypeEnum? EntityTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("NaturalPerson")) - return EntityTypeEnum.NaturalPerson; - - if (value.Equals("CompanyName")) - return EntityTypeEnum.CompanyName; - - return null; - } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string EntityTypeEnumToJsonValue(EntityTypeEnum? value) - { - if (value == EntityTypeEnum.NaturalPerson) - return "NaturalPerson"; - - if (value == EntityTypeEnum.CompanyName) - return "CompanyName"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of EntityType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EntityTypeOption { get; private set; } /// /// The type of the entity the payment is processed for. /// /// The type of the entity the payment is processed for. - [JsonPropertyName("entityType")] - public EntityTypeEnum? EntityType { get { return this.EntityTypeOption; } set { this.EntityTypeOption = new Option(value); } } - + [DataMember(Name = "entityType", EmitDefaultValue = false)] + public EntityTypeEnum? EntityType { get; set; } /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** + [JsonConverter(typeof(StringEnumConverter))] public enum IndustryUsageEnum { /// /// Enum DelayedCharge for value: delayedCharge /// + [EnumMember(Value = "delayedCharge")] DelayedCharge = 1, /// /// Enum Installment for value: installment /// + [EnumMember(Value = "installment")] Installment = 2, /// /// Enum NoShow for value: noShow /// + [EnumMember(Value = "noShow")] NoShow = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static IndustryUsageEnum IndustryUsageEnumFromString(string value) - { - if (value.Equals("delayedCharge")) - return IndustryUsageEnum.DelayedCharge; - - if (value.Equals("installment")) - return IndustryUsageEnum.Installment; - - if (value.Equals("noShow")) - return IndustryUsageEnum.NoShow; - - throw new NotImplementedException($"Could not convert value to type IndustryUsageEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static IndustryUsageEnum? IndustryUsageEnumFromStringOrDefault(string value) - { - if (value.Equals("delayedCharge")) - return IndustryUsageEnum.DelayedCharge; - - if (value.Equals("installment")) - return IndustryUsageEnum.Installment; - - if (value.Equals("noShow")) - return IndustryUsageEnum.NoShow; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string IndustryUsageEnumToJsonValue(IndustryUsageEnum? value) - { - if (value == IndustryUsageEnum.DelayedCharge) - return "delayedCharge"; - - if (value == IndustryUsageEnum.Installment) - return "installment"; - if (value == IndustryUsageEnum.NoShow) - return "noShow"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of IndustryUsage - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IndustryUsageOption { get; private set; } /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** /// /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment** - [JsonPropertyName("industryUsage")] - public IndustryUsageEnum? IndustryUsage { get { return this.IndustryUsageOption; } set { this.IndustryUsageOption = new Option(value); } } - + [DataMember(Name = "industryUsage", EmitDefaultValue = false)] + public IndustryUsageEnum? IndustryUsage { get; set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// + [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// + [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// + [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) - { - if (value == RecurringProcessingModelEnum.CardOnFile) - return "CardOnFile"; - - if (value == RecurringProcessingModelEnum.Subscription) - return "Subscription"; - - if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) - return "UnscheduledCardOnFile"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of RecurringProcessingModel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringProcessingModelOption { get; private set; } /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonPropertyName("recurringProcessingModel")] - public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } - + [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] + public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + [JsonConverter(typeof(StringEnumConverter))] public enum ShopperInteractionEnum { /// /// Enum Ecommerce for value: Ecommerce /// + [EnumMember(Value = "Ecommerce")] Ecommerce = 1, /// /// Enum ContAuth for value: ContAuth /// + [EnumMember(Value = "ContAuth")] ContAuth = 2, /// /// Enum Moto for value: Moto /// + [EnumMember(Value = "Moto")] Moto = 3, /// /// Enum POS for value: POS /// + [EnumMember(Value = "POS")] POS = 4 + } + /// - /// Returns a + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// - /// - /// - /// - public static ShopperInteractionEnum ShopperInteractionEnumFromString(string value) - { - if (value.Equals("Ecommerce")) - return ShopperInteractionEnum.Ecommerce; - - if (value.Equals("ContAuth")) - return ShopperInteractionEnum.ContAuth; - - if (value.Equals("Moto")) - return ShopperInteractionEnum.Moto; - - if (value.Equals("POS")) - return ShopperInteractionEnum.POS; - - throw new NotImplementedException($"Could not convert value to type ShopperInteractionEnum: '{value}'"); - } - + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] + public ShopperInteractionEnum? ShopperInteraction { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected PaymentRequest() { } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static ShopperInteractionEnum? ShopperInteractionEnumFromStringOrDefault(string value) + /// accountInfo. + /// additionalAmount. + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. + /// amount (required). + /// applicationInfo. + /// authenticationData. + /// bankAccount. + /// billingAddress. + /// browserInfo. + /// The delay between the authorisation and scheduled auto-capture, specified in hours.. + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web. + /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey.. + /// company. + /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey.. + /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE. + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. + /// dccQuote. + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00. + /// deliveryAddress. + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00. + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting).. + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition).. + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts.. + /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments.. + /// enhancedSchemeData. + /// The type of the entity the payment is processed for.. + /// An integer value that is added to the normal fraud score. The value can be either positive or negative.. + /// fundOrigin. + /// fundRecipient. + /// The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * **installment**. + /// installments. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip.. + /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters.. + /// mandate. + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. + /// The merchant account identifier, with which you want to process the transaction. (required). + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.. + /// merchantRiskIndicator. + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. . + /// mpiData. + /// order. + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead.. + /// > Required for browser-based (`channel` **Web**) 3D Secure 2 transactions.Set this to the origin URL of the page where you are rendering the Drop-in/Component. Do not include subdirectories and a trailing slash.. + /// paymentMethod (required). + /// platformChargebackLogic. + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2.. + /// Minimum number of days between authorisations. Only for 3D Secure 2.. + /// Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer.. + /// Specifies the redirect method (GET or POST) when redirecting to the issuer.. + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. (required). + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. We strongly recommend that you use a maximum of 1024 characters. > The URL must not include personally identifiable information (PII), for example name or email address. (required). + /// riskData. + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00. + /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates.. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > Required for Visa and JCB transactions that require 3D Secure 2 authentication if you did not include the `telephoneNumber`.. + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new).. + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. + /// The combination of a language code and a country code to specify the language to be used in the payment.. + /// shopperName. + /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address.. + /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**.. + /// The shopper's social security number.. + /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).. + /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment.. + /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types).. + /// This field contains additional information on the submerchant, who is onboarded to an acquirer through a payment facilitator or aggregator. + /// surcharge. + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication.. + /// threeDS2RequestData. + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorisation.Default: **false**. (default to false). + /// Set to true if the payment should be routed to a trusted MID.. + public PaymentRequest(AccountInfo accountInfo = default(AccountInfo), Amount additionalAmount = default(Amount), Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), AuthenticationData authenticationData = default(AuthenticationData), CheckoutBankAccount bankAccount = default(CheckoutBankAccount), BillingAddress billingAddress = default(BillingAddress), BrowserInfo browserInfo = default(BrowserInfo), int? captureDelayHours = default(int?), ChannelEnum? channel = default(ChannelEnum?), string checkoutAttemptId = default(string), Company company = default(Company), string conversionId = default(string), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), ForexQuote dccQuote = default(ForexQuote), DateTime deliverAt = default(DateTime), DeliveryAddress deliveryAddress = default(DeliveryAddress), DateTime deliveryDate = default(DateTime), string deviceFingerprint = default(string), bool? enableOneClick = default(bool?), bool? enablePayOut = default(bool?), bool? enableRecurring = default(bool?), EnhancedSchemeData enhancedSchemeData = default(EnhancedSchemeData), EntityTypeEnum? entityType = default(EntityTypeEnum?), int? fraudOffset = default(int?), FundOrigin fundOrigin = default(FundOrigin), FundRecipient fundRecipient = default(FundRecipient), IndustryUsageEnum? industryUsage = default(IndustryUsageEnum?), Installments installments = default(Installments), List lineItems = default(List), Dictionary localizedShopperStatement = default(Dictionary), Mandate mandate = default(Mandate), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), MerchantRiskIndicator merchantRiskIndicator = default(MerchantRiskIndicator), Dictionary metadata = default(Dictionary), ThreeDSecureData mpiData = default(ThreeDSecureData), EncryptedOrderData order = default(EncryptedOrderData), string orderReference = default(string), string origin = default(string), CheckoutPaymentMethod paymentMethod = default(CheckoutPaymentMethod), PlatformChargebackLogic platformChargebackLogic = default(PlatformChargebackLogic), string recurringExpiry = default(string), string recurringFrequency = default(string), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string redirectFromIssuerMethod = default(string), string redirectToIssuerMethod = default(string), string reference = default(string), string returnUrl = default(string), RiskData riskData = default(RiskData), string sessionValidity = default(string), string shopperConversionId = default(string), string shopperEmail = default(string), string shopperIP = default(string), ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), string socialSecurityNumber = default(string), List splits = default(List), string store = default(string), bool? storePaymentMethod = default(bool?), List subMerchants = default(List), Surcharge surcharge = default(Surcharge), string telephoneNumber = default(string), ThreeDS2RequestFields threeDS2RequestData = default(ThreeDS2RequestFields), bool? threeDSAuthenticationOnly = false, bool? trustedShopper = default(bool?)) { - if (value.Equals("Ecommerce")) - return ShopperInteractionEnum.Ecommerce; - - if (value.Equals("ContAuth")) - return ShopperInteractionEnum.ContAuth; - - if (value.Equals("Moto")) - return ShopperInteractionEnum.Moto; - - if (value.Equals("POS")) - return ShopperInteractionEnum.POS; - - return null; + this.Amount = amount; + this.MerchantAccount = merchantAccount; + this.PaymentMethod = paymentMethod; + this.Reference = reference; + this.ReturnUrl = returnUrl; + this.AccountInfo = accountInfo; + this.AdditionalAmount = additionalAmount; + this.AdditionalData = additionalData; + this.ApplicationInfo = applicationInfo; + this.AuthenticationData = authenticationData; + this.BankAccount = bankAccount; + this.BillingAddress = billingAddress; + this.BrowserInfo = browserInfo; + this.CaptureDelayHours = captureDelayHours; + this.Channel = channel; + this.CheckoutAttemptId = checkoutAttemptId; + this.Company = company; + this.ConversionId = conversionId; + this.CountryCode = countryCode; + this.DateOfBirth = dateOfBirth; + this.DccQuote = dccQuote; + this.DeliverAt = deliverAt; + this.DeliveryAddress = deliveryAddress; + this.DeliveryDate = deliveryDate; + this.DeviceFingerprint = deviceFingerprint; + this.EnableOneClick = enableOneClick; + this.EnablePayOut = enablePayOut; + this.EnableRecurring = enableRecurring; + this.EnhancedSchemeData = enhancedSchemeData; + this.EntityType = entityType; + this.FraudOffset = fraudOffset; + this.FundOrigin = fundOrigin; + this.FundRecipient = fundRecipient; + this.IndustryUsage = industryUsage; + this.Installments = installments; + this.LineItems = lineItems; + this.LocalizedShopperStatement = localizedShopperStatement; + this.Mandate = mandate; + this.Mcc = mcc; + this.MerchantOrderReference = merchantOrderReference; + this.MerchantRiskIndicator = merchantRiskIndicator; + this.Metadata = metadata; + this.MpiData = mpiData; + this.Order = order; + this.OrderReference = orderReference; + this.Origin = origin; + this.PlatformChargebackLogic = platformChargebackLogic; + this.RecurringExpiry = recurringExpiry; + this.RecurringFrequency = recurringFrequency; + this.RecurringProcessingModel = recurringProcessingModel; + this.RedirectFromIssuerMethod = redirectFromIssuerMethod; + this.RedirectToIssuerMethod = redirectToIssuerMethod; + this.RiskData = riskData; + this.SessionValidity = sessionValidity; + this.ShopperConversionId = shopperConversionId; + this.ShopperEmail = shopperEmail; + this.ShopperIP = shopperIP; + this.ShopperInteraction = shopperInteraction; + this.ShopperLocale = shopperLocale; + this.ShopperName = shopperName; + this.ShopperReference = shopperReference; + this.ShopperStatement = shopperStatement; + this.SocialSecurityNumber = socialSecurityNumber; + this.Splits = splits; + this.Store = store; + this.StorePaymentMethod = storePaymentMethod; + this.SubMerchants = subMerchants; + this.Surcharge = surcharge; + this.TelephoneNumber = telephoneNumber; + this.ThreeDS2RequestData = threeDS2RequestData; + this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; + this.TrustedShopper = trustedShopper; } /// - /// Converts the to the json value + /// Gets or Sets AccountInfo /// - /// - /// - /// - public static string ShopperInteractionEnumToJsonValue(ShopperInteractionEnum? value) - { - if (value == ShopperInteractionEnum.Ecommerce) - return "Ecommerce"; - - if (value == ShopperInteractionEnum.ContAuth) - return "ContAuth"; - - if (value == ShopperInteractionEnum.Moto) - return "Moto"; - - if (value == ShopperInteractionEnum.POS) - return "POS"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } + [DataMember(Name = "accountInfo", EmitDefaultValue = false)] + public AccountInfo AccountInfo { get; set; } /// - /// Used to track the state of ShopperInteraction + /// Gets or Sets AdditionalAmount /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperInteractionOption { get; private set; } + [DataMember(Name = "additionalAmount", EmitDefaultValue = false)] + public Amount AdditionalAmount { get; set; } /// - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - [JsonPropertyName("shopperInteraction")] - public ShopperInteractionEnum? ShopperInteraction { get { return this.ShopperInteractionOption; } set { this.ShopperInteractionOption = new Option(value); } } + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] + [DataMember(Name = "amount", IsRequired = false, EmitDefaultValue = false)] public Amount Amount { get; set; } /// - /// The merchant account identifier, with which you want to process the transaction. + /// Gets or Sets ApplicationInfo /// - /// The merchant account identifier, with which you want to process the transaction. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } /// - /// Gets or Sets PaymentMethod + /// Gets or Sets AuthenticationData /// - [JsonPropertyName("paymentMethod")] - public CheckoutPaymentMethod PaymentMethod { get; set; } + [DataMember(Name = "authenticationData", EmitDefaultValue = false)] + public AuthenticationData AuthenticationData { get; set; } /// - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + /// Gets or Sets BankAccount /// - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - [JsonPropertyName("reference")] - public string Reference { get; set; } + [DataMember(Name = "bankAccount", EmitDefaultValue = false)] + public CheckoutBankAccount BankAccount { get; set; } /// - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.example.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. + /// Gets or Sets BillingAddress /// - /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.example.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. > The URL must not include personally identifiable information (PII), for example name or email address. - [JsonPropertyName("returnUrl")] - public string ReturnUrl { get; set; } + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public BillingAddress BillingAddress { get; set; } /// - /// Used to track the state of AccountInfo + /// Gets or Sets BrowserInfo /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountInfoOption { get; private set; } + [DataMember(Name = "browserInfo", EmitDefaultValue = false)] + public BrowserInfo BrowserInfo { get; set; } /// - /// Gets or Sets AccountInfo + /// The delay between the authorisation and scheduled auto-capture, specified in hours. /// - [JsonPropertyName("accountInfo")] - public AccountInfo AccountInfo { get { return this.AccountInfoOption; } set { this.AccountInfoOption = new Option(value); } } + /// The delay between the authorisation and scheduled auto-capture, specified in hours. + [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] + public int? CaptureDelayHours { get; set; } /// - /// Used to track the state of AdditionalAmount + /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AdditionalAmountOption { get; private set; } + /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// - /// Gets or Sets AdditionalAmount + /// Gets or Sets Company /// - [JsonPropertyName("additionalAmount")] - public Amount AdditionalAmount { get { return this.AdditionalAmountOption; } set { this.AdditionalAmountOption = new Option(value); } } + [DataMember(Name = "company", EmitDefaultValue = false)] + public Company Company { get; set; } /// - /// Used to track the state of AdditionalData + /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AdditionalDataOption { get; private set; } + /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + [DataMember(Name = "conversionId", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v68. Use `checkoutAttemptId` instead")] + public string ConversionId { get; set; } /// - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE /// - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. - [JsonPropertyName("additionalData")] - public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } + /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE + [DataMember(Name = "countryCode", EmitDefaultValue = false)] + public string CountryCode { get; set; } /// - /// Used to track the state of ApplicationInfo + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ApplicationInfoOption { get; private set; } + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] + public DateTime DateOfBirth { get; set; } /// - /// Gets or Sets ApplicationInfo + /// Gets or Sets DccQuote /// - [JsonPropertyName("applicationInfo")] - public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + [DataMember(Name = "dccQuote", EmitDefaultValue = false)] + public ForexQuote DccQuote { get; set; } /// - /// Used to track the state of AuthenticationData + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthenticationDataOption { get; private set; } + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + [DataMember(Name = "deliverAt", EmitDefaultValue = false)] + public DateTime DeliverAt { get; set; } /// - /// Gets or Sets AuthenticationData + /// Gets or Sets DeliveryAddress /// - [JsonPropertyName("authenticationData")] - public AuthenticationData AuthenticationData { get { return this.AuthenticationDataOption; } set { this.AuthenticationDataOption = new Option(value); } } + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public DeliveryAddress DeliveryAddress { get; set; } /// - /// Used to track the state of BankAccount + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankAccountOption { get; private set; } + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + [DataMember(Name = "deliveryDate", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v70. Use `deliverAt` instead.")] + public DateTime DeliveryDate { get; set; } /// - /// Gets or Sets BankAccount + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). /// - [JsonPropertyName("bankAccount")] - public CheckoutBankAccount BankAccount { get { return this.BankAccountOption; } set { this.BankAccountOption = new Option(value); } } + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + [DataMember(Name = "deviceFingerprint", EmitDefaultValue = false)] + public string DeviceFingerprint { get; set; } /// - /// Used to track the state of BillingAddress + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressOption { get; private set; } + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). + [DataMember(Name = "enableOneClick", EmitDefaultValue = false)] + public bool? EnableOneClick { get; set; } /// - /// Gets or Sets BillingAddress + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. /// - [JsonPropertyName("billingAddress")] - public BillingAddress BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + [DataMember(Name = "enablePayOut", EmitDefaultValue = false)] + public bool? EnablePayOut { get; set; } /// - /// Used to track the state of BrowserInfo + /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BrowserInfoOption { get; private set; } + /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. + [DataMember(Name = "enableRecurring", EmitDefaultValue = false)] + public bool? EnableRecurring { get; set; } /// - /// Gets or Sets BrowserInfo + /// Gets or Sets EnhancedSchemeData /// - [JsonPropertyName("browserInfo")] - public BrowserInfo BrowserInfo { get { return this.BrowserInfoOption; } set { this.BrowserInfoOption = new Option(value); } } + [DataMember(Name = "enhancedSchemeData", EmitDefaultValue = false)] + public EnhancedSchemeData EnhancedSchemeData { get; set; } /// - /// Used to track the state of CaptureDelayHours + /// An integer value that is added to the normal fraud score. The value can be either positive or negative. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CaptureDelayHoursOption { get; private set; } + /// An integer value that is added to the normal fraud score. The value can be either positive or negative. + [DataMember(Name = "fraudOffset", EmitDefaultValue = false)] + public int? FraudOffset { get; set; } /// - /// The delay between the authorisation and scheduled auto-capture, specified in hours. + /// Gets or Sets FundOrigin /// - /// The delay between the authorisation and scheduled auto-capture, specified in hours. - [JsonPropertyName("captureDelayHours")] - public int? CaptureDelayHours { get { return this.CaptureDelayHoursOption; } set { this.CaptureDelayHoursOption = new Option(value); } } + [DataMember(Name = "fundOrigin", EmitDefaultValue = false)] + public FundOrigin FundOrigin { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Gets or Sets FundRecipient /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + [DataMember(Name = "fundRecipient", EmitDefaultValue = false)] + public FundRecipient FundRecipient { get; set; } /// - /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + /// Gets or Sets Installments /// - /// Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + [DataMember(Name = "installments", EmitDefaultValue = false)] + public Installments Installments { get; set; } /// - /// Used to track the state of Company + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CompanyOption { get; private set; } + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } /// - /// Gets or Sets Company + /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. /// - [JsonPropertyName("company")] - public Company Company { get { return this.CompanyOption; } set { this.CompanyOption = new Option(value); } } + /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. + [DataMember(Name = "localizedShopperStatement", EmitDefaultValue = false)] + public Dictionary LocalizedShopperStatement { get; set; } /// - /// Used to track the state of ConversionId + /// Gets or Sets Mandate /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ConversionIdOption { get; private set; } + [DataMember(Name = "mandate", EmitDefaultValue = false)] + public Mandate Mandate { get; set; } /// - /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. /// - /// Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. - [JsonPropertyName("conversionId")] - [Obsolete] - public string ConversionId { get { return this.ConversionIdOption; } set { this.ConversionIdOption = new Option(value); } } + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string Mcc { get; set; } /// - /// Used to track the state of CountryCode + /// The merchant account identifier, with which you want to process the transaction. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CountryCodeOption { get; private set; } + /// The merchant account identifier, with which you want to process the transaction. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// - /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. /// - /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE - [JsonPropertyName("countryCode")] - public string CountryCode { get { return this.CountryCodeOption; } set { this.CountryCodeOption = new Option(value); } } + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] + public string MerchantOrderReference { get; set; } /// - /// Used to track the state of DateOfBirth + /// Gets or Sets MerchantRiskIndicator /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DateOfBirthOption { get; private set; } + [DataMember(Name = "merchantRiskIndicator", EmitDefaultValue = false)] + public MerchantRiskIndicator MerchantRiskIndicator { get; set; } /// - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. /// - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD - [JsonPropertyName("dateOfBirth")] - public DateTime? DateOfBirth { get { return this.DateOfBirthOption; } set { this.DateOfBirthOption = new Option(value); } } + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. + [DataMember(Name = "metadata", EmitDefaultValue = false)] + public Dictionary Metadata { get; set; } /// - /// Used to track the state of DccQuote + /// Gets or Sets MpiData /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DccQuoteOption { get; private set; } + [DataMember(Name = "mpiData", EmitDefaultValue = false)] + public ThreeDSecureData MpiData { get; set; } /// - /// Gets or Sets DccQuote + /// Gets or Sets Order /// - [JsonPropertyName("dccQuote")] - public ForexQuote DccQuote { get { return this.DccQuoteOption; } set { this.DccQuoteOption = new Option(value); } } + [DataMember(Name = "order", EmitDefaultValue = false)] + public EncryptedOrderData Order { get; set; } /// - /// Used to track the state of DeliverAt + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliverAtOption { get; private set; } + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + [DataMember(Name = "orderReference", EmitDefaultValue = false)] + public string OrderReference { get; set; } /// - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + /// > Required for browser-based (`channel` **Web**) 3D Secure 2 transactions.Set this to the origin URL of the page where you are rendering the Drop-in/Component. Do not include subdirectories and a trailing slash. /// - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - [JsonPropertyName("deliverAt")] - public DateTime? DeliverAt { get { return this.DeliverAtOption; } set { this.DeliverAtOption = new Option(value); } } + /// > Required for browser-based (`channel` **Web**) 3D Secure 2 transactions.Set this to the origin URL of the page where you are rendering the Drop-in/Component. Do not include subdirectories and a trailing slash. + [DataMember(Name = "origin", EmitDefaultValue = false)] + public string Origin { get; set; } /// - /// Used to track the state of DeliveryAddress + /// Gets or Sets PaymentMethod /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryAddressOption { get; private set; } + [DataMember(Name = "paymentMethod", IsRequired = false, EmitDefaultValue = false)] + public CheckoutPaymentMethod PaymentMethod { get; set; } /// - /// Gets or Sets DeliveryAddress + /// Gets or Sets PlatformChargebackLogic /// - [JsonPropertyName("deliveryAddress")] - public DeliveryAddress DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } + [DataMember(Name = "platformChargebackLogic", EmitDefaultValue = false)] + public PlatformChargebackLogic PlatformChargebackLogic { get; set; } /// - /// Used to track the state of DeliveryDate + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryDateOption { get; private set; } + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] + public string RecurringExpiry { get; set; } /// - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + /// Minimum number of days between authorisations. Only for 3D Secure 2. /// - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 - [JsonPropertyName("deliveryDate")] - [Obsolete] - public DateTime? DeliveryDate { get { return this.DeliveryDateOption; } set { this.DeliveryDateOption = new Option(value); } } + /// Minimum number of days between authorisations. Only for 3D Secure 2. + [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] + public string RecurringFrequency { get; set; } /// - /// Used to track the state of DeviceFingerprint + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeviceFingerprintOption { get; private set; } + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. + [DataMember(Name = "redirectFromIssuerMethod", EmitDefaultValue = false)] + public string RedirectFromIssuerMethod { get; set; } /// - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. /// - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - [JsonPropertyName("deviceFingerprint")] - public string DeviceFingerprint { get { return this.DeviceFingerprintOption; } set { this.DeviceFingerprintOption = new Option(value); } } + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + [DataMember(Name = "redirectToIssuerMethod", EmitDefaultValue = false)] + public string RedirectToIssuerMethod { get; set; } /// - /// Used to track the state of EnableOneClick + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnableOneClickOption { get; private set; } + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + [DataMember(Name = "reference", IsRequired = false, EmitDefaultValue = false)] + public string Reference { get; set; } /// - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. We strongly recommend that you use a maximum of 1024 characters. > The URL must not include personally identifiable information (PII), for example name or email address. /// - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future [one-click payments](https://docs.adyen.com/get-started-with-adyen/payment-glossary/#one-click-payments-definition). - [JsonPropertyName("enableOneClick")] - public bool? EnableOneClick { get { return this.EnableOneClickOption; } set { this.EnableOneClickOption = new Option(value); } } + /// The URL to return to in case of a redirection. The format depends on the channel. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. We strongly recommend that you use a maximum of 1024 characters. > The URL must not include personally identifiable information (PII), for example name or email address. + [DataMember(Name = "returnUrl", IsRequired = false, EmitDefaultValue = false)] + public string ReturnUrl { get; set; } /// - /// Used to track the state of EnablePayOut + /// Gets or Sets RiskData /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnablePayOutOption { get; private set; } + [DataMember(Name = "riskData", EmitDefaultValue = false)] + public RiskData RiskData { get; set; } /// - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 /// - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. - [JsonPropertyName("enablePayOut")] - public bool? EnablePayOut { get { return this.EnablePayOutOption; } set { this.EnablePayOutOption = new Option(value); } } + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 + [DataMember(Name = "sessionValidity", EmitDefaultValue = false)] + public string SessionValidity { get; set; } /// - /// Used to track the state of EnableRecurring + /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnableRecurringOption { get; private set; } + /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. + [DataMember(Name = "shopperConversionId", EmitDefaultValue = false)] + public string ShopperConversionId { get; set; } /// - /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > Required for Visa and JCB transactions that require 3D Secure 2 authentication if you did not include the `telephoneNumber`. /// - /// When true and `shopperReference` is provided, the payment details will be stored for [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types) where the shopper is not present, such as subscription or automatic top-up payments. - [JsonPropertyName("enableRecurring")] - public bool? EnableRecurring { get { return this.EnableRecurringOption; } set { this.EnableRecurringOption = new Option(value); } } - - /// - /// Used to track the state of EnhancedSchemeData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EnhancedSchemeDataOption { get; private set; } - - /// - /// Gets or Sets EnhancedSchemeData - /// - [JsonPropertyName("enhancedSchemeData")] - public EnhancedSchemeData EnhancedSchemeData { get { return this.EnhancedSchemeDataOption; } set { this.EnhancedSchemeDataOption = new Option(value); } } - - /// - /// Used to track the state of FraudOffset - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FraudOffsetOption { get; private set; } - - /// - /// An integer value that is added to the normal fraud score. The value can be either positive or negative. - /// - /// An integer value that is added to the normal fraud score. The value can be either positive or negative. - [JsonPropertyName("fraudOffset")] - public int? FraudOffset { get { return this.FraudOffsetOption; } set { this.FraudOffsetOption = new Option(value); } } - - /// - /// Used to track the state of FundOrigin - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundOriginOption { get; private set; } - - /// - /// Gets or Sets FundOrigin - /// - [JsonPropertyName("fundOrigin")] - public FundOrigin FundOrigin { get { return this.FundOriginOption; } set { this.FundOriginOption = new Option(value); } } - - /// - /// Used to track the state of FundRecipient - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundRecipientOption { get; private set; } - - /// - /// Gets or Sets FundRecipient - /// - [JsonPropertyName("fundRecipient")] - public FundRecipient FundRecipient { get { return this.FundRecipientOption; } set { this.FundRecipientOption = new Option(value); } } - - /// - /// Used to track the state of Installments - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentsOption { get; private set; } - - /// - /// Gets or Sets Installments - /// - [JsonPropertyName("installments")] - public Installments Installments { get { return this.InstallmentsOption; } set { this.InstallmentsOption = new Option(value); } } - - /// - /// Used to track the state of LineItems - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LineItemsOption { get; private set; } - - /// - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. - /// - /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Riverty, and Zip. - [JsonPropertyName("lineItems")] - public List LineItems { get { return this.LineItemsOption; } set { this.LineItemsOption = new Option>(value); } } - - /// - /// Used to track the state of LocalizedShopperStatement - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> LocalizedShopperStatementOption { get; private set; } - - /// - /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. - /// - /// The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters. - [JsonPropertyName("localizedShopperStatement")] - public Dictionary LocalizedShopperStatement { get { return this.LocalizedShopperStatementOption; } set { this.LocalizedShopperStatementOption = new Option>(value); } } - - /// - /// Used to track the state of Mandate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MandateOption { get; private set; } - - /// - /// Gets or Sets Mandate - /// - [JsonPropertyName("mandate")] - public Mandate Mandate { get { return this.MandateOption; } set { this.MandateOption = new Option(value); } } - - /// - /// Used to track the state of Mcc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MccOption { get; private set; } - - /// - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - /// - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. - [JsonPropertyName("mcc")] - public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } - - /// - /// Used to track the state of MerchantOrderReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantOrderReferenceOption { get; private set; } - - /// - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - /// - /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. - [JsonPropertyName("merchantOrderReference")] - public string MerchantOrderReference { get { return this.MerchantOrderReferenceOption; } set { this.MerchantOrderReferenceOption = new Option(value); } } - - /// - /// Used to track the state of MerchantRiskIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantRiskIndicatorOption { get; private set; } - - /// - /// Gets or Sets MerchantRiskIndicator - /// - [JsonPropertyName("merchantRiskIndicator")] - public MerchantRiskIndicator MerchantRiskIndicator { get { return this.MerchantRiskIndicatorOption; } set { this.MerchantRiskIndicatorOption = new Option(value); } } - - /// - /// Used to track the state of Metadata - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> MetadataOption { get; private set; } - - /// - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - /// - /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". * Maximum 20 characters per key. * Maximum 80 characters per value. - [JsonPropertyName("metadata")] - public Dictionary Metadata { get { return this.MetadataOption; } set { this.MetadataOption = new Option>(value); } } - - /// - /// Used to track the state of MpiData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MpiDataOption { get; private set; } - - /// - /// Gets or Sets MpiData - /// - [JsonPropertyName("mpiData")] - public ThreeDSecureData MpiData { get { return this.MpiDataOption; } set { this.MpiDataOption = new Option(value); } } - - /// - /// Used to track the state of Order - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OrderOption { get; private set; } - - /// - /// Gets or Sets Order - /// - [JsonPropertyName("order")] - public EncryptedOrderData Order { get { return this.OrderOption; } set { this.OrderOption = new Option(value); } } - - /// - /// Used to track the state of OrderReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OrderReferenceOption { get; private set; } - - /// - /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - /// - /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. - [JsonPropertyName("orderReference")] - public string OrderReference { get { return this.OrderReferenceOption; } set { this.OrderReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Origin - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OriginOption { get; private set; } - - /// - /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. - /// - /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. - [JsonPropertyName("origin")] - public string Origin { get { return this.OriginOption; } set { this.OriginOption = new Option(value); } } - - /// - /// Used to track the state of PlatformChargebackLogic - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PlatformChargebackLogicOption { get; private set; } - - /// - /// Gets or Sets PlatformChargebackLogic - /// - [JsonPropertyName("platformChargebackLogic")] - public PlatformChargebackLogic PlatformChargebackLogic { get { return this.PlatformChargebackLogicOption; } set { this.PlatformChargebackLogicOption = new Option(value); } } - - /// - /// Used to track the state of RecurringExpiry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringExpiryOption { get; private set; } - - /// - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. - /// - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. - [JsonPropertyName("recurringExpiry")] - public string RecurringExpiry { get { return this.RecurringExpiryOption; } set { this.RecurringExpiryOption = new Option(value); } } - - /// - /// Used to track the state of RecurringFrequency - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringFrequencyOption { get; private set; } - - /// - /// Minimum number of days between authorisations. Only for 3D Secure 2. - /// - /// Minimum number of days between authorisations. Only for 3D Secure 2. - [JsonPropertyName("recurringFrequency")] - public string RecurringFrequency { get { return this.RecurringFrequencyOption; } set { this.RecurringFrequencyOption = new Option(value); } } - - /// - /// Used to track the state of RedirectFromIssuerMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RedirectFromIssuerMethodOption { get; private set; } - - /// - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. - /// - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. - [JsonPropertyName("redirectFromIssuerMethod")] - public string RedirectFromIssuerMethod { get { return this.RedirectFromIssuerMethodOption; } set { this.RedirectFromIssuerMethodOption = new Option(value); } } - - /// - /// Used to track the state of RedirectToIssuerMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RedirectToIssuerMethodOption { get; private set; } - - /// - /// Specifies the redirect method (GET or POST) when redirecting to the issuer. - /// - /// Specifies the redirect method (GET or POST) when redirecting to the issuer. - [JsonPropertyName("redirectToIssuerMethod")] - public string RedirectToIssuerMethod { get { return this.RedirectToIssuerMethodOption; } set { this.RedirectToIssuerMethodOption = new Option(value); } } - - /// - /// Used to track the state of RiskData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskDataOption { get; private set; } - - /// - /// Gets or Sets RiskData - /// - [JsonPropertyName("riskData")] - public RiskData RiskData { get { return this.RiskDataOption; } set { this.RiskDataOption = new Option(value); } } - - /// - /// Used to track the state of SessionValidity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SessionValidityOption { get; private set; } - - /// - /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 - /// - /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 - [JsonPropertyName("sessionValidity")] - public string SessionValidity { get { return this.SessionValidityOption; } set { this.SessionValidityOption = new Option(value); } } - - /// - /// Used to track the state of ShopperConversionId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperConversionIdOption { get; private set; } - - /// - /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. - /// - /// A unique ID that can be used to associate `/paymentMethods` and `/payments` requests with the same shopper transaction, offering insights into conversion rates. - [JsonPropertyName("shopperConversionId")] - public string ShopperConversionId { get { return this.ShopperConversionIdOption; } set { this.ShopperConversionIdOption = new Option(value); } } - - /// - /// Used to track the state of ShopperEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } - - /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } - - /// - /// Used to track the state of ShopperIP - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperIPOption { get; private set; } - - /// - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - /// - /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). - [JsonPropertyName("shopperIP")] - public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > Required for Visa and JCB transactions that require 3D Secure 2 authentication if you did not include the `telephoneNumber`. + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// - /// Used to track the state of ShopperLocale + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperLocaleOption { get; private set; } + /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks).> Required for Visa and JCB transactions that require 3D Secure 2 authentication for all web and mobile integrations, if you did not include the `shopperEmail`. For native mobile integrations, the field is required to support cases where authentication is routed to the redirect flow. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new). + [DataMember(Name = "shopperIP", EmitDefaultValue = false)] + public string ShopperIP { get; set; } /// /// The combination of a language code and a country code to specify the language to be used in the payment. /// /// The combination of a language code and a country code to specify the language to be used in the payment. - [JsonPropertyName("shopperLocale")] - public string ShopperLocale { get { return this.ShopperLocaleOption; } set { this.ShopperLocaleOption = new Option(value); } } - - /// - /// Used to track the state of ShopperName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNameOption { get; private set; } + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + public string ShopperLocale { get; set; } /// /// Gets or Sets ShopperName /// - [JsonPropertyName("shopperName")] - public Name ShopperName { get { return this.ShopperNameOption; } set { this.ShopperNameOption = new Option(value); } } - - /// - /// Used to track the state of ShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperReferenceOption { get; private set; } + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name ShopperName { get; set; } /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. /// /// Required for recurring payments. Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - [JsonPropertyName("shopperReference")] - public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperStatement - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperStatementOption { get; private set; } + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. /// /// The text to be shown on the shopper's bank statement. We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. Allowed characters: **a-z**, **A-Z**, **0-9**, spaces, and special characters **. , ' _ - ? + * /_**. - [JsonPropertyName("shopperStatement")] - public string ShopperStatement { get { return this.ShopperStatementOption; } set { this.ShopperStatementOption = new Option(value); } } - - /// - /// Used to track the state of SocialSecurityNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SocialSecurityNumberOption { get; private set; } + [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] + public string ShopperStatement { get; set; } /// /// The shopper's social security number. /// /// The shopper's social security number. - [JsonPropertyName("socialSecurityNumber")] - public string SocialSecurityNumber { get { return this.SocialSecurityNumberOption; } set { this.SocialSecurityNumberOption = new Option(value); } } - - /// - /// Used to track the state of Splits - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SplitsOption { get; private set; } + [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] + public string SocialSecurityNumber { get; set; } /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). /// /// An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/platforms/process-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/classic-platforms/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). - [JsonPropertyName("splits")] - public List Splits { get { return this.SplitsOption; } set { this.SplitsOption = new Option>(value); } } - - /// - /// Used to track the state of Store - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoreOption { get; private set; } + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. /// /// Required for Adyen for Platforms integrations if you are a platform model. This is your [reference](https://docs.adyen.com/api-explorer/Management/3/post/merchants/(merchantId)/stores#request-reference) (on [balance platform](https://docs.adyen.com/platforms)) or the [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccountHolder#request-accountHolderDetails-storeDetails-storeReference) (in the [classic integration](https://docs.adyen.com/classic-platforms/processing-payments/route-payment-to-store/#route-a-payment-to-a-store)) for the ecommerce or point-of-sale store that is processing the payment. - [JsonPropertyName("store")] - public string Store { get { return this.StoreOption; } set { this.StoreOption = new Option(value); } } - - /// - /// Used to track the state of StorePaymentMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StorePaymentMethodOption { get; private set; } + [DataMember(Name = "store", EmitDefaultValue = false)] + public string Store { get; set; } /// /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). /// /// When true and `shopperReference` is provided, the payment details will be stored for future [recurring payments](https://docs.adyen.com/online-payments/tokenization/#recurring-payment-types). - [JsonPropertyName("storePaymentMethod")] - public bool? StorePaymentMethod { get { return this.StorePaymentMethodOption; } set { this.StorePaymentMethodOption = new Option(value); } } - - /// - /// Used to track the state of SubMerchants - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SubMerchantsOption { get; private set; } + [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] + public bool? StorePaymentMethod { get; set; } /// /// This field contains additional information on the submerchant, who is onboarded to an acquirer through a payment facilitator or aggregator /// /// This field contains additional information on the submerchant, who is onboarded to an acquirer through a payment facilitator or aggregator - [JsonPropertyName("subMerchants")] - public List SubMerchants { get { return this.SubMerchantsOption; } set { this.SubMerchantsOption = new Option>(value); } } - - /// - /// Used to track the state of Surcharge - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SurchargeOption { get; private set; } + [DataMember(Name = "subMerchants", EmitDefaultValue = false)] + public List SubMerchants { get; set; } /// /// Gets or Sets Surcharge /// - [JsonPropertyName("surcharge")] - public Surcharge Surcharge { get { return this.SurchargeOption; } set { this.SurchargeOption = new Option(value); } } - - /// - /// Used to track the state of TelephoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TelephoneNumberOption { get; private set; } - - /// - /// The shopper's telephone number. - /// - /// The shopper's telephone number. - [JsonPropertyName("telephoneNumber")] - public string TelephoneNumber { get { return this.TelephoneNumberOption; } set { this.TelephoneNumberOption = new Option(value); } } + [DataMember(Name = "surcharge", EmitDefaultValue = false)] + public Surcharge Surcharge { get; set; } /// - /// Used to track the state of ThreeDS2RequestData + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2RequestDataOption { get; private set; } + /// The shopper's telephone number. > Required for Visa and JCB transactions that require 3D Secure 2 authentication, if you did not include the `shopperEmail`. The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string TelephoneNumber { get; set; } /// /// Gets or Sets ThreeDS2RequestData /// - [JsonPropertyName("threeDS2RequestData")] - public ThreeDS2RequestFields ThreeDS2RequestData { get { return this.ThreeDS2RequestDataOption; } set { this.ThreeDS2RequestDataOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSAuthenticationOnly - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSAuthenticationOnlyOption { get; private set; } - - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [JsonPropertyName("threeDSAuthenticationOnly")] - [Obsolete] - public bool? ThreeDSAuthenticationOnly { get { return this.ThreeDSAuthenticationOnlyOption; } set { this.ThreeDSAuthenticationOnlyOption = new Option(value); } } + [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] + public ThreeDS2RequestFields ThreeDS2RequestData { get; set; } /// - /// Used to track the state of TrustedShopper + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorisation.Default: **false**. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TrustedShopperOption { get; private set; } + /// Required to trigger the [authentication-only flow](https://docs.adyen.com/online-payments/3d-secure/authentication-only/). If set to **true**, you will only perform the 3D Secure 2 authentication, and will not proceed to the payment authorisation.Default: **false**. + [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v69. Use `authenticationData.authenticationOnly` instead.")] + public bool? ThreeDSAuthenticationOnly { get; set; } /// /// Set to true if the payment should be routed to a trusted MID. /// /// Set to true if the payment should be routed to a trusted MID. - [JsonPropertyName("trustedShopper")] - public bool? TrustedShopper { get { return this.TrustedShopperOption; } set { this.TrustedShopperOption = new Option(value); } } + [DataMember(Name = "trustedShopper", EmitDefaultValue = false)] + public bool? TrustedShopper { get; set; } /// /// Returns the string presentation of the object @@ -1547,14 +813,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentRequest {\n"); - sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); - sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" AccountInfo: ").Append(AccountInfo).Append("\n"); sb.Append(" AdditionalAmount: ").Append(AdditionalAmount).Append("\n"); sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" AuthenticationData: ").Append(AuthenticationData).Append("\n"); sb.Append(" BankAccount: ").Append(BankAccount).Append("\n"); @@ -1586,6 +848,7 @@ public override string ToString() sb.Append(" LocalizedShopperStatement: ").Append(LocalizedShopperStatement).Append("\n"); sb.Append(" Mandate: ").Append(Mandate).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); sb.Append(" MerchantRiskIndicator: ").Append(MerchantRiskIndicator).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); @@ -1593,12 +856,15 @@ public override string ToString() sb.Append(" Order: ").Append(Order).Append("\n"); sb.Append(" OrderReference: ").Append(OrderReference).Append("\n"); sb.Append(" Origin: ").Append(Origin).Append("\n"); + sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); sb.Append(" PlatformChargebackLogic: ").Append(PlatformChargebackLogic).Append("\n"); sb.Append(" RecurringExpiry: ").Append(RecurringExpiry).Append("\n"); sb.Append(" RecurringFrequency: ").Append(RecurringFrequency).Append("\n"); sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); sb.Append(" RedirectFromIssuerMethod: ").Append(RedirectFromIssuerMethod).Append("\n"); sb.Append(" RedirectToIssuerMethod: ").Append(RedirectToIssuerMethod).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" RiskData: ").Append(RiskData).Append("\n"); sb.Append(" SessionValidity: ").Append(SessionValidity).Append("\n"); sb.Append(" ShopperConversionId: ").Append(ShopperConversionId).Append("\n"); @@ -1624,1176 +890,739 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // CheckoutAttemptId (string) maxLength - if (this.CheckoutAttemptId != null && this.CheckoutAttemptId.Length > 256) - { - yield return new ValidationResult("Invalid value for CheckoutAttemptId, length must be less than 256.", new [] { "CheckoutAttemptId" }); - } - - // CountryCode (string) maxLength - if (this.CountryCode != null && this.CountryCode.Length > 100) - { - yield return new ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); - } + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } - // DeviceFingerprint (string) maxLength - if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) - { - yield return new ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); - } - - // MerchantOrderReference (string) maxLength - if (this.MerchantOrderReference != null && this.MerchantOrderReference.Length > 1000) - { - yield return new ValidationResult("Invalid value for MerchantOrderReference, length must be less than 1000.", new [] { "MerchantOrderReference" }); - } - - // Origin (string) maxLength - if (this.Origin != null && this.Origin.Length > 80) - { - yield return new ValidationResult("Invalid value for Origin, length must be less than 80.", new [] { "Origin" }); - } - - // ShopperConversionId (string) maxLength - if (this.ShopperConversionId != null && this.ShopperConversionId.Length > 256) - { - yield return new ValidationResult("Invalid value for ShopperConversionId, length must be less than 256.", new [] { "ShopperConversionId" }); - } - - // ShopperIP (string) maxLength - if (this.ShopperIP != null && this.ShopperIP.Length > 1000) - { - yield return new ValidationResult("Invalid value for ShopperIP, length must be less than 1000.", new [] { "ShopperIP" }); - } - - // ShopperReference (string) maxLength - if (this.ShopperReference != null && this.ShopperReference.Length > 256) - { - yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); - } - - // ShopperReference (string) minLength - if (this.ShopperReference != null && this.ShopperReference.Length < 3) - { - yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); - } - - // ShopperStatement (string) maxLength - if (this.ShopperStatement != null && this.ShopperStatement.Length > 10000) - { - yield return new ValidationResult("Invalid value for ShopperStatement, length must be less than 10000.", new [] { "ShopperStatement" }); - } - - // Store (string) maxLength - if (this.Store != null && this.Store.Length > 64) - { - yield return new ValidationResult("Invalid value for Store, length must be less than 64.", new [] { "Store" }); - } - - // Store (string) minLength - if (this.Store != null && this.Store.Length < 1) - { - yield return new ValidationResult("Invalid value for Store, length must be greater than 1.", new [] { "Store" }); - } - - yield break; - } - } - - /// - /// A Json converter for type - /// - public class PaymentRequestJsonConverter : JsonConverter - { /// - /// The format to use to serialize DateOfBirth + /// Returns true if objects are equal /// - public static string DateOfBirthFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - - /// - /// The format to use to serialize DeliverAt - /// - public static string DeliverAtFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - - /// - /// The format to use to serialize DeliveryDate - /// - public static string DeliveryDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PaymentRequest); + } /// - /// Deserializes json to + /// Returns true if PaymentRequest instances are equal /// - /// - /// - /// - /// - /// - public override PaymentRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentRequest to be compared + /// Boolean + public bool Equals(PaymentRequest input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option merchantAccount = default; - Option paymentMethod = default; - Option reference = default; - Option returnUrl = default; - Option accountInfo = default; - Option additionalAmount = default; - Option> additionalData = default; - Option applicationInfo = default; - Option authenticationData = default; - Option bankAccount = default; - Option billingAddress = default; - Option browserInfo = default; - Option captureDelayHours = default; - Option channel = default; - Option checkoutAttemptId = default; - Option company = default; - Option conversionId = default; - Option countryCode = default; - Option dateOfBirth = default; - Option dccQuote = default; - Option deliverAt = default; - Option deliveryAddress = default; - Option deliveryDate = default; - Option deviceFingerprint = default; - Option enableOneClick = default; - Option enablePayOut = default; - Option enableRecurring = default; - Option enhancedSchemeData = default; - Option entityType = default; - Option fraudOffset = default; - Option fundOrigin = default; - Option fundRecipient = default; - Option industryUsage = default; - Option installments = default; - Option> lineItems = default; - Option> localizedShopperStatement = default; - Option mandate = default; - Option mcc = default; - Option merchantOrderReference = default; - Option merchantRiskIndicator = default; - Option> metadata = default; - Option mpiData = default; - Option order = default; - Option orderReference = default; - Option origin = default; - Option platformChargebackLogic = default; - Option recurringExpiry = default; - Option recurringFrequency = default; - Option recurringProcessingModel = default; - Option redirectFromIssuerMethod = default; - Option redirectToIssuerMethod = default; - Option riskData = default; - Option sessionValidity = default; - Option shopperConversionId = default; - Option shopperEmail = default; - Option shopperIP = default; - Option shopperInteraction = default; - Option shopperLocale = default; - Option shopperName = default; - Option shopperReference = default; - Option shopperStatement = default; - Option socialSecurityNumber = default; - Option> splits = default; - Option store = default; - Option storePaymentMethod = default; - Option> subMerchants = default; - Option surcharge = default; - Option telephoneNumber = default; - Option threeDS2RequestData = default; - Option threeDSAuthenticationOnly = default; - Option trustedShopper = default; - - while (utf8JsonReader.Read()) + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethod": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "returnUrl": - returnUrl = new Option(utf8JsonReader.GetString()); - break; - case "accountInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - accountInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "additionalAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "additionalData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "applicationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "authenticationData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - authenticationData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "bankAccount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bankAccount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "billingAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - billingAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "browserInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - browserInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "captureDelayHours": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - captureDelayHours = new Option(utf8JsonReader.GetInt32()); - break; - case "channel": - string channelRawValue = utf8JsonReader.GetString(); - if (channelRawValue != null) - channel = new Option(PaymentRequest.ChannelEnumFromStringOrDefault(channelRawValue)); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "company": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - company = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "conversionId": - conversionId = new Option(utf8JsonReader.GetString()); - break; - case "countryCode": - countryCode = new Option(utf8JsonReader.GetString()); - break; - case "dateOfBirth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOfBirth = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "dccQuote": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dccQuote = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliverAt": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliverAt = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliveryAddress": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliveryAddress = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliveryDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliveryDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deviceFingerprint": - deviceFingerprint = new Option(utf8JsonReader.GetString()); - break; - case "enableOneClick": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enableOneClick = new Option(utf8JsonReader.GetBoolean()); - break; - case "enablePayOut": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enablePayOut = new Option(utf8JsonReader.GetBoolean()); - break; - case "enableRecurring": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enableRecurring = new Option(utf8JsonReader.GetBoolean()); - break; - case "enhancedSchemeData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enhancedSchemeData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "entityType": - string entityTypeRawValue = utf8JsonReader.GetString(); - if (entityTypeRawValue != null) - entityType = new Option(PaymentRequest.EntityTypeEnumFromStringOrDefault(entityTypeRawValue)); - break; - case "fraudOffset": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fraudOffset = new Option(utf8JsonReader.GetInt32()); - break; - case "fundOrigin": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fundOrigin = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "fundRecipient": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fundRecipient = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "industryUsage": - string industryUsageRawValue = utf8JsonReader.GetString(); - if (industryUsageRawValue != null) - industryUsage = new Option(PaymentRequest.IndustryUsageEnumFromStringOrDefault(industryUsageRawValue)); - break; - case "installments": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - installments = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "lineItems": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lineItems = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "localizedShopperStatement": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - localizedShopperStatement = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mandate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mandate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mcc": - mcc = new Option(utf8JsonReader.GetString()); - break; - case "merchantOrderReference": - merchantOrderReference = new Option(utf8JsonReader.GetString()); - break; - case "merchantRiskIndicator": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - merchantRiskIndicator = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "metadata": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - metadata = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mpiData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mpiData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "order": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - order = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "orderReference": - orderReference = new Option(utf8JsonReader.GetString()); - break; - case "origin": - origin = new Option(utf8JsonReader.GetString()); - break; - case "platformChargebackLogic": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - platformChargebackLogic = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "recurringExpiry": - recurringExpiry = new Option(utf8JsonReader.GetString()); - break; - case "recurringFrequency": - recurringFrequency = new Option(utf8JsonReader.GetString()); - break; - case "recurringProcessingModel": - string recurringProcessingModelRawValue = utf8JsonReader.GetString(); - if (recurringProcessingModelRawValue != null) - recurringProcessingModel = new Option(PaymentRequest.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); - break; - case "redirectFromIssuerMethod": - redirectFromIssuerMethod = new Option(utf8JsonReader.GetString()); - break; - case "redirectToIssuerMethod": - redirectToIssuerMethod = new Option(utf8JsonReader.GetString()); - break; - case "riskData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - riskData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "sessionValidity": - sessionValidity = new Option(utf8JsonReader.GetString()); - break; - case "shopperConversionId": - shopperConversionId = new Option(utf8JsonReader.GetString()); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "shopperIP": - shopperIP = new Option(utf8JsonReader.GetString()); - break; - case "shopperInteraction": - string shopperInteractionRawValue = utf8JsonReader.GetString(); - if (shopperInteractionRawValue != null) - shopperInteraction = new Option(PaymentRequest.ShopperInteractionEnumFromStringOrDefault(shopperInteractionRawValue)); - break; - case "shopperLocale": - shopperLocale = new Option(utf8JsonReader.GetString()); - break; - case "shopperName": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shopperName = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "shopperReference": - shopperReference = new Option(utf8JsonReader.GetString()); - break; - case "shopperStatement": - shopperStatement = new Option(utf8JsonReader.GetString()); - break; - case "socialSecurityNumber": - socialSecurityNumber = new Option(utf8JsonReader.GetString()); - break; - case "splits": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - splits = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "store": - store = new Option(utf8JsonReader.GetString()); - break; - case "storePaymentMethod": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - storePaymentMethod = new Option(utf8JsonReader.GetBoolean()); - break; - case "subMerchants": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - subMerchants = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "surcharge": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - surcharge = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "telephoneNumber": - telephoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "threeDS2RequestData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDS2RequestData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDSAuthenticationOnly": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDSAuthenticationOnly = new Option(utf8JsonReader.GetBoolean()); - break; - case "trustedShopper": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - trustedShopper = new Option(utf8JsonReader.GetBoolean()); - break; - default: - break; - } - } + return false; } - - if (!amount.IsSet) - throw new ArgumentException("Property is required for class PaymentRequest.", nameof(amount)); - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentRequest.", nameof(merchantAccount)); - - if (!paymentMethod.IsSet) - throw new ArgumentException("Property is required for class PaymentRequest.", nameof(paymentMethod)); - - if (!reference.IsSet) - throw new ArgumentException("Property is required for class PaymentRequest.", nameof(reference)); - - if (!returnUrl.IsSet) - throw new ArgumentException("Property is required for class PaymentRequest.", nameof(returnUrl)); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentRequest."); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentRequest."); - - if (paymentMethod.IsSet && paymentMethod.Value == null) - throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class PaymentRequest."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentRequest."); - - if (returnUrl.IsSet && returnUrl.Value == null) - throw new ArgumentNullException(nameof(returnUrl), "Property is not nullable for class PaymentRequest."); - - if (accountInfo.IsSet && accountInfo.Value == null) - throw new ArgumentNullException(nameof(accountInfo), "Property is not nullable for class PaymentRequest."); - - if (additionalAmount.IsSet && additionalAmount.Value == null) - throw new ArgumentNullException(nameof(additionalAmount), "Property is not nullable for class PaymentRequest."); - - if (additionalData.IsSet && additionalData.Value == null) - throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class PaymentRequest."); - - if (applicationInfo.IsSet && applicationInfo.Value == null) - throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentRequest."); - - if (authenticationData.IsSet && authenticationData.Value == null) - throw new ArgumentNullException(nameof(authenticationData), "Property is not nullable for class PaymentRequest."); - - if (bankAccount.IsSet && bankAccount.Value == null) - throw new ArgumentNullException(nameof(bankAccount), "Property is not nullable for class PaymentRequest."); - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class PaymentRequest."); - - if (browserInfo.IsSet && browserInfo.Value == null) - throw new ArgumentNullException(nameof(browserInfo), "Property is not nullable for class PaymentRequest."); - - if (captureDelayHours.IsSet && captureDelayHours.Value == null) - throw new ArgumentNullException(nameof(captureDelayHours), "Property is not nullable for class PaymentRequest."); - - if (channel.IsSet && channel.Value == null) - throw new ArgumentNullException(nameof(channel), "Property is not nullable for class PaymentRequest."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PaymentRequest."); - - if (company.IsSet && company.Value == null) - throw new ArgumentNullException(nameof(company), "Property is not nullable for class PaymentRequest."); - - if (conversionId.IsSet && conversionId.Value == null) - throw new ArgumentNullException(nameof(conversionId), "Property is not nullable for class PaymentRequest."); - - if (countryCode.IsSet && countryCode.Value == null) - throw new ArgumentNullException(nameof(countryCode), "Property is not nullable for class PaymentRequest."); - - if (dateOfBirth.IsSet && dateOfBirth.Value == null) - throw new ArgumentNullException(nameof(dateOfBirth), "Property is not nullable for class PaymentRequest."); - - if (dccQuote.IsSet && dccQuote.Value == null) - throw new ArgumentNullException(nameof(dccQuote), "Property is not nullable for class PaymentRequest."); - - if (deliverAt.IsSet && deliverAt.Value == null) - throw new ArgumentNullException(nameof(deliverAt), "Property is not nullable for class PaymentRequest."); - - if (deliveryAddress.IsSet && deliveryAddress.Value == null) - throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class PaymentRequest."); - - if (deliveryDate.IsSet && deliveryDate.Value == null) - throw new ArgumentNullException(nameof(deliveryDate), "Property is not nullable for class PaymentRequest."); - - if (deviceFingerprint.IsSet && deviceFingerprint.Value == null) - throw new ArgumentNullException(nameof(deviceFingerprint), "Property is not nullable for class PaymentRequest."); - - if (enableOneClick.IsSet && enableOneClick.Value == null) - throw new ArgumentNullException(nameof(enableOneClick), "Property is not nullable for class PaymentRequest."); - - if (enablePayOut.IsSet && enablePayOut.Value == null) - throw new ArgumentNullException(nameof(enablePayOut), "Property is not nullable for class PaymentRequest."); - - if (enableRecurring.IsSet && enableRecurring.Value == null) - throw new ArgumentNullException(nameof(enableRecurring), "Property is not nullable for class PaymentRequest."); - - if (enhancedSchemeData.IsSet && enhancedSchemeData.Value == null) - throw new ArgumentNullException(nameof(enhancedSchemeData), "Property is not nullable for class PaymentRequest."); - - if (entityType.IsSet && entityType.Value == null) - throw new ArgumentNullException(nameof(entityType), "Property is not nullable for class PaymentRequest."); - - if (fraudOffset.IsSet && fraudOffset.Value == null) - throw new ArgumentNullException(nameof(fraudOffset), "Property is not nullable for class PaymentRequest."); - - if (fundOrigin.IsSet && fundOrigin.Value == null) - throw new ArgumentNullException(nameof(fundOrigin), "Property is not nullable for class PaymentRequest."); - - if (fundRecipient.IsSet && fundRecipient.Value == null) - throw new ArgumentNullException(nameof(fundRecipient), "Property is not nullable for class PaymentRequest."); - - if (industryUsage.IsSet && industryUsage.Value == null) - throw new ArgumentNullException(nameof(industryUsage), "Property is not nullable for class PaymentRequest."); - - if (installments.IsSet && installments.Value == null) - throw new ArgumentNullException(nameof(installments), "Property is not nullable for class PaymentRequest."); - - if (lineItems.IsSet && lineItems.Value == null) - throw new ArgumentNullException(nameof(lineItems), "Property is not nullable for class PaymentRequest."); - - if (localizedShopperStatement.IsSet && localizedShopperStatement.Value == null) - throw new ArgumentNullException(nameof(localizedShopperStatement), "Property is not nullable for class PaymentRequest."); - - if (mandate.IsSet && mandate.Value == null) - throw new ArgumentNullException(nameof(mandate), "Property is not nullable for class PaymentRequest."); - - if (mcc.IsSet && mcc.Value == null) - throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class PaymentRequest."); - - if (merchantOrderReference.IsSet && merchantOrderReference.Value == null) - throw new ArgumentNullException(nameof(merchantOrderReference), "Property is not nullable for class PaymentRequest."); - - if (merchantRiskIndicator.IsSet && merchantRiskIndicator.Value == null) - throw new ArgumentNullException(nameof(merchantRiskIndicator), "Property is not nullable for class PaymentRequest."); - - if (metadata.IsSet && metadata.Value == null) - throw new ArgumentNullException(nameof(metadata), "Property is not nullable for class PaymentRequest."); - - if (mpiData.IsSet && mpiData.Value == null) - throw new ArgumentNullException(nameof(mpiData), "Property is not nullable for class PaymentRequest."); - - if (order.IsSet && order.Value == null) - throw new ArgumentNullException(nameof(order), "Property is not nullable for class PaymentRequest."); - - if (orderReference.IsSet && orderReference.Value == null) - throw new ArgumentNullException(nameof(orderReference), "Property is not nullable for class PaymentRequest."); - - if (origin.IsSet && origin.Value == null) - throw new ArgumentNullException(nameof(origin), "Property is not nullable for class PaymentRequest."); - - if (platformChargebackLogic.IsSet && platformChargebackLogic.Value == null) - throw new ArgumentNullException(nameof(platformChargebackLogic), "Property is not nullable for class PaymentRequest."); - - if (recurringExpiry.IsSet && recurringExpiry.Value == null) - throw new ArgumentNullException(nameof(recurringExpiry), "Property is not nullable for class PaymentRequest."); - - if (recurringFrequency.IsSet && recurringFrequency.Value == null) - throw new ArgumentNullException(nameof(recurringFrequency), "Property is not nullable for class PaymentRequest."); - - if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) - throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class PaymentRequest."); - - if (redirectFromIssuerMethod.IsSet && redirectFromIssuerMethod.Value == null) - throw new ArgumentNullException(nameof(redirectFromIssuerMethod), "Property is not nullable for class PaymentRequest."); - - if (redirectToIssuerMethod.IsSet && redirectToIssuerMethod.Value == null) - throw new ArgumentNullException(nameof(redirectToIssuerMethod), "Property is not nullable for class PaymentRequest."); - - if (riskData.IsSet && riskData.Value == null) - throw new ArgumentNullException(nameof(riskData), "Property is not nullable for class PaymentRequest."); - - if (sessionValidity.IsSet && sessionValidity.Value == null) - throw new ArgumentNullException(nameof(sessionValidity), "Property is not nullable for class PaymentRequest."); - - if (shopperConversionId.IsSet && shopperConversionId.Value == null) - throw new ArgumentNullException(nameof(shopperConversionId), "Property is not nullable for class PaymentRequest."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class PaymentRequest."); - - if (shopperIP.IsSet && shopperIP.Value == null) - throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class PaymentRequest."); - - if (shopperInteraction.IsSet && shopperInteraction.Value == null) - throw new ArgumentNullException(nameof(shopperInteraction), "Property is not nullable for class PaymentRequest."); - - if (shopperLocale.IsSet && shopperLocale.Value == null) - throw new ArgumentNullException(nameof(shopperLocale), "Property is not nullable for class PaymentRequest."); - - if (shopperName.IsSet && shopperName.Value == null) - throw new ArgumentNullException(nameof(shopperName), "Property is not nullable for class PaymentRequest."); - - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class PaymentRequest."); - - if (shopperStatement.IsSet && shopperStatement.Value == null) - throw new ArgumentNullException(nameof(shopperStatement), "Property is not nullable for class PaymentRequest."); - - if (socialSecurityNumber.IsSet && socialSecurityNumber.Value == null) - throw new ArgumentNullException(nameof(socialSecurityNumber), "Property is not nullable for class PaymentRequest."); - - if (splits.IsSet && splits.Value == null) - throw new ArgumentNullException(nameof(splits), "Property is not nullable for class PaymentRequest."); - - if (store.IsSet && store.Value == null) - throw new ArgumentNullException(nameof(store), "Property is not nullable for class PaymentRequest."); - - if (storePaymentMethod.IsSet && storePaymentMethod.Value == null) - throw new ArgumentNullException(nameof(storePaymentMethod), "Property is not nullable for class PaymentRequest."); - - if (subMerchants.IsSet && subMerchants.Value == null) - throw new ArgumentNullException(nameof(subMerchants), "Property is not nullable for class PaymentRequest."); - - if (surcharge.IsSet && surcharge.Value == null) - throw new ArgumentNullException(nameof(surcharge), "Property is not nullable for class PaymentRequest."); - - if (telephoneNumber.IsSet && telephoneNumber.Value == null) - throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class PaymentRequest."); - - if (threeDS2RequestData.IsSet && threeDS2RequestData.Value == null) - throw new ArgumentNullException(nameof(threeDS2RequestData), "Property is not nullable for class PaymentRequest."); - - if (threeDSAuthenticationOnly.IsSet && threeDSAuthenticationOnly.Value == null) - throw new ArgumentNullException(nameof(threeDSAuthenticationOnly), "Property is not nullable for class PaymentRequest."); - - if (trustedShopper.IsSet && trustedShopper.Value == null) - throw new ArgumentNullException(nameof(trustedShopper), "Property is not nullable for class PaymentRequest."); - - return new PaymentRequest(amount.Value, merchantAccount.Value, paymentMethod.Value, reference.Value, returnUrl.Value, accountInfo, additionalAmount, additionalData, applicationInfo, authenticationData, bankAccount, billingAddress, browserInfo, captureDelayHours, channel, checkoutAttemptId, company, conversionId, countryCode, dateOfBirth, dccQuote, deliverAt, deliveryAddress, deliveryDate, deviceFingerprint, enableOneClick, enablePayOut, enableRecurring, enhancedSchemeData, entityType, fraudOffset, fundOrigin, fundRecipient, industryUsage, installments, lineItems, localizedShopperStatement, mandate, mcc, merchantOrderReference, merchantRiskIndicator, metadata, mpiData, order, orderReference, origin, platformChargebackLogic, recurringExpiry, recurringFrequency, recurringProcessingModel, redirectFromIssuerMethod, redirectToIssuerMethod, riskData, sessionValidity, shopperConversionId, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, socialSecurityNumber, splits, store, storePaymentMethod, subMerchants, surcharge, telephoneNumber, threeDS2RequestData, threeDSAuthenticationOnly, trustedShopper); + return + ( + this.AccountInfo == input.AccountInfo || + (this.AccountInfo != null && + this.AccountInfo.Equals(input.AccountInfo)) + ) && + ( + this.AdditionalAmount == input.AdditionalAmount || + (this.AdditionalAmount != null && + this.AdditionalAmount.Equals(input.AdditionalAmount)) + ) && + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + input.AdditionalData != null && + this.AdditionalData.SequenceEqual(input.AdditionalData) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.ApplicationInfo == input.ApplicationInfo || + (this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo)) + ) && + ( + this.AuthenticationData == input.AuthenticationData || + (this.AuthenticationData != null && + this.AuthenticationData.Equals(input.AuthenticationData)) + ) && + ( + this.BankAccount == input.BankAccount || + (this.BankAccount != null && + this.BankAccount.Equals(input.BankAccount)) + ) && + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.BrowserInfo == input.BrowserInfo || + (this.BrowserInfo != null && + this.BrowserInfo.Equals(input.BrowserInfo)) + ) && + ( + this.CaptureDelayHours == input.CaptureDelayHours || + this.CaptureDelayHours.Equals(input.CaptureDelayHours) + ) && + ( + this.Channel == input.Channel || + this.Channel.Equals(input.Channel) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Company == input.Company || + (this.Company != null && + this.Company.Equals(input.Company)) + ) && + ( + this.ConversionId == input.ConversionId || + (this.ConversionId != null && + this.ConversionId.Equals(input.ConversionId)) + ) && + ( + this.CountryCode == input.CountryCode || + (this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode)) + ) && + ( + this.DateOfBirth == input.DateOfBirth || + (this.DateOfBirth != null && + this.DateOfBirth.Equals(input.DateOfBirth)) + ) && + ( + this.DccQuote == input.DccQuote || + (this.DccQuote != null && + this.DccQuote.Equals(input.DccQuote)) + ) && + ( + this.DeliverAt == input.DeliverAt || + (this.DeliverAt != null && + this.DeliverAt.Equals(input.DeliverAt)) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + (this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress)) + ) && + ( + this.DeliveryDate == input.DeliveryDate || + (this.DeliveryDate != null && + this.DeliveryDate.Equals(input.DeliveryDate)) + ) && + ( + this.DeviceFingerprint == input.DeviceFingerprint || + (this.DeviceFingerprint != null && + this.DeviceFingerprint.Equals(input.DeviceFingerprint)) + ) && + ( + this.EnableOneClick == input.EnableOneClick || + this.EnableOneClick.Equals(input.EnableOneClick) + ) && + ( + this.EnablePayOut == input.EnablePayOut || + this.EnablePayOut.Equals(input.EnablePayOut) + ) && + ( + this.EnableRecurring == input.EnableRecurring || + this.EnableRecurring.Equals(input.EnableRecurring) + ) && + ( + this.EnhancedSchemeData == input.EnhancedSchemeData || + (this.EnhancedSchemeData != null && + this.EnhancedSchemeData.Equals(input.EnhancedSchemeData)) + ) && + ( + this.EntityType == input.EntityType || + this.EntityType.Equals(input.EntityType) + ) && + ( + this.FraudOffset == input.FraudOffset || + this.FraudOffset.Equals(input.FraudOffset) + ) && + ( + this.FundOrigin == input.FundOrigin || + (this.FundOrigin != null && + this.FundOrigin.Equals(input.FundOrigin)) + ) && + ( + this.FundRecipient == input.FundRecipient || + (this.FundRecipient != null && + this.FundRecipient.Equals(input.FundRecipient)) + ) && + ( + this.IndustryUsage == input.IndustryUsage || + this.IndustryUsage.Equals(input.IndustryUsage) + ) && + ( + this.Installments == input.Installments || + (this.Installments != null && + this.Installments.Equals(input.Installments)) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.LocalizedShopperStatement == input.LocalizedShopperStatement || + this.LocalizedShopperStatement != null && + input.LocalizedShopperStatement != null && + this.LocalizedShopperStatement.SequenceEqual(input.LocalizedShopperStatement) + ) && + ( + this.Mandate == input.Mandate || + (this.Mandate != null && + this.Mandate.Equals(input.Mandate)) + ) && + ( + this.Mcc == input.Mcc || + (this.Mcc != null && + this.Mcc.Equals(input.Mcc)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.MerchantOrderReference == input.MerchantOrderReference || + (this.MerchantOrderReference != null && + this.MerchantOrderReference.Equals(input.MerchantOrderReference)) + ) && + ( + this.MerchantRiskIndicator == input.MerchantRiskIndicator || + (this.MerchantRiskIndicator != null && + this.MerchantRiskIndicator.Equals(input.MerchantRiskIndicator)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.MpiData == input.MpiData || + (this.MpiData != null && + this.MpiData.Equals(input.MpiData)) + ) && + ( + this.Order == input.Order || + (this.Order != null && + this.Order.Equals(input.Order)) + ) && + ( + this.OrderReference == input.OrderReference || + (this.OrderReference != null && + this.OrderReference.Equals(input.OrderReference)) + ) && + ( + this.Origin == input.Origin || + (this.Origin != null && + this.Origin.Equals(input.Origin)) + ) && + ( + this.PaymentMethod == input.PaymentMethod || + (this.PaymentMethod != null && + this.PaymentMethod.Equals(input.PaymentMethod)) + ) && + ( + this.PlatformChargebackLogic == input.PlatformChargebackLogic || + (this.PlatformChargebackLogic != null && + this.PlatformChargebackLogic.Equals(input.PlatformChargebackLogic)) + ) && + ( + this.RecurringExpiry == input.RecurringExpiry || + (this.RecurringExpiry != null && + this.RecurringExpiry.Equals(input.RecurringExpiry)) + ) && + ( + this.RecurringFrequency == input.RecurringFrequency || + (this.RecurringFrequency != null && + this.RecurringFrequency.Equals(input.RecurringFrequency)) + ) && + ( + this.RecurringProcessingModel == input.RecurringProcessingModel || + this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) + ) && + ( + this.RedirectFromIssuerMethod == input.RedirectFromIssuerMethod || + (this.RedirectFromIssuerMethod != null && + this.RedirectFromIssuerMethod.Equals(input.RedirectFromIssuerMethod)) + ) && + ( + this.RedirectToIssuerMethod == input.RedirectToIssuerMethod || + (this.RedirectToIssuerMethod != null && + this.RedirectToIssuerMethod.Equals(input.RedirectToIssuerMethod)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.ReturnUrl == input.ReturnUrl || + (this.ReturnUrl != null && + this.ReturnUrl.Equals(input.ReturnUrl)) + ) && + ( + this.RiskData == input.RiskData || + (this.RiskData != null && + this.RiskData.Equals(input.RiskData)) + ) && + ( + this.SessionValidity == input.SessionValidity || + (this.SessionValidity != null && + this.SessionValidity.Equals(input.SessionValidity)) + ) && + ( + this.ShopperConversionId == input.ShopperConversionId || + (this.ShopperConversionId != null && + this.ShopperConversionId.Equals(input.ShopperConversionId)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.ShopperIP == input.ShopperIP || + (this.ShopperIP != null && + this.ShopperIP.Equals(input.ShopperIP)) + ) && + ( + this.ShopperInteraction == input.ShopperInteraction || + this.ShopperInteraction.Equals(input.ShopperInteraction) + ) && + ( + this.ShopperLocale == input.ShopperLocale || + (this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale)) + ) && + ( + this.ShopperName == input.ShopperName || + (this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName)) + ) && + ( + this.ShopperReference == input.ShopperReference || + (this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference)) + ) && + ( + this.ShopperStatement == input.ShopperStatement || + (this.ShopperStatement != null && + this.ShopperStatement.Equals(input.ShopperStatement)) + ) && + ( + this.SocialSecurityNumber == input.SocialSecurityNumber || + (this.SocialSecurityNumber != null && + this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.Store == input.Store || + (this.Store != null && + this.Store.Equals(input.Store)) + ) && + ( + this.StorePaymentMethod == input.StorePaymentMethod || + this.StorePaymentMethod.Equals(input.StorePaymentMethod) + ) && + ( + this.SubMerchants == input.SubMerchants || + this.SubMerchants != null && + input.SubMerchants != null && + this.SubMerchants.SequenceEqual(input.SubMerchants) + ) && + ( + this.Surcharge == input.Surcharge || + (this.Surcharge != null && + this.Surcharge.Equals(input.Surcharge)) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + (this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber)) + ) && + ( + this.ThreeDS2RequestData == input.ThreeDS2RequestData || + (this.ThreeDS2RequestData != null && + this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) + ) && + ( + this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || + this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) + ) && + ( + this.TrustedShopper == input.TrustedShopper || + this.TrustedShopper.Equals(input.TrustedShopper) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentRequest paymentRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, paymentRequest, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AccountInfo != null) + { + hashCode = (hashCode * 59) + this.AccountInfo.GetHashCode(); + } + if (this.AdditionalAmount != null) + { + hashCode = (hashCode * 59) + this.AdditionalAmount.GetHashCode(); + } + if (this.AdditionalData != null) + { + hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.ApplicationInfo != null) + { + hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); + } + if (this.AuthenticationData != null) + { + hashCode = (hashCode * 59) + this.AuthenticationData.GetHashCode(); + } + if (this.BankAccount != null) + { + hashCode = (hashCode * 59) + this.BankAccount.GetHashCode(); + } + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.BrowserInfo != null) + { + hashCode = (hashCode * 59) + this.BrowserInfo.GetHashCode(); + } + hashCode = (hashCode * 59) + this.CaptureDelayHours.GetHashCode(); + hashCode = (hashCode * 59) + this.Channel.GetHashCode(); + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.Company != null) + { + hashCode = (hashCode * 59) + this.Company.GetHashCode(); + } + if (this.ConversionId != null) + { + hashCode = (hashCode * 59) + this.ConversionId.GetHashCode(); + } + if (this.CountryCode != null) + { + hashCode = (hashCode * 59) + this.CountryCode.GetHashCode(); + } + if (this.DateOfBirth != null) + { + hashCode = (hashCode * 59) + this.DateOfBirth.GetHashCode(); + } + if (this.DccQuote != null) + { + hashCode = (hashCode * 59) + this.DccQuote.GetHashCode(); + } + if (this.DeliverAt != null) + { + hashCode = (hashCode * 59) + this.DeliverAt.GetHashCode(); + } + if (this.DeliveryAddress != null) + { + hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); + } + if (this.DeliveryDate != null) + { + hashCode = (hashCode * 59) + this.DeliveryDate.GetHashCode(); + } + if (this.DeviceFingerprint != null) + { + hashCode = (hashCode * 59) + this.DeviceFingerprint.GetHashCode(); + } + hashCode = (hashCode * 59) + this.EnableOneClick.GetHashCode(); + hashCode = (hashCode * 59) + this.EnablePayOut.GetHashCode(); + hashCode = (hashCode * 59) + this.EnableRecurring.GetHashCode(); + if (this.EnhancedSchemeData != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.EntityType.GetHashCode(); + hashCode = (hashCode * 59) + this.FraudOffset.GetHashCode(); + if (this.FundOrigin != null) + { + hashCode = (hashCode * 59) + this.FundOrigin.GetHashCode(); + } + if (this.FundRecipient != null) + { + hashCode = (hashCode * 59) + this.FundRecipient.GetHashCode(); + } + hashCode = (hashCode * 59) + this.IndustryUsage.GetHashCode(); + if (this.Installments != null) + { + hashCode = (hashCode * 59) + this.Installments.GetHashCode(); + } + if (this.LineItems != null) + { + hashCode = (hashCode * 59) + this.LineItems.GetHashCode(); + } + if (this.LocalizedShopperStatement != null) + { + hashCode = (hashCode * 59) + this.LocalizedShopperStatement.GetHashCode(); + } + if (this.Mandate != null) + { + hashCode = (hashCode * 59) + this.Mandate.GetHashCode(); + } + if (this.Mcc != null) + { + hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.MerchantOrderReference != null) + { + hashCode = (hashCode * 59) + this.MerchantOrderReference.GetHashCode(); + } + if (this.MerchantRiskIndicator != null) + { + hashCode = (hashCode * 59) + this.MerchantRiskIndicator.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + if (this.MpiData != null) + { + hashCode = (hashCode * 59) + this.MpiData.GetHashCode(); + } + if (this.Order != null) + { + hashCode = (hashCode * 59) + this.Order.GetHashCode(); + } + if (this.OrderReference != null) + { + hashCode = (hashCode * 59) + this.OrderReference.GetHashCode(); + } + if (this.Origin != null) + { + hashCode = (hashCode * 59) + this.Origin.GetHashCode(); + } + if (this.PaymentMethod != null) + { + hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); + } + if (this.PlatformChargebackLogic != null) + { + hashCode = (hashCode * 59) + this.PlatformChargebackLogic.GetHashCode(); + } + if (this.RecurringExpiry != null) + { + hashCode = (hashCode * 59) + this.RecurringExpiry.GetHashCode(); + } + if (this.RecurringFrequency != null) + { + hashCode = (hashCode * 59) + this.RecurringFrequency.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); + if (this.RedirectFromIssuerMethod != null) + { + hashCode = (hashCode * 59) + this.RedirectFromIssuerMethod.GetHashCode(); + } + if (this.RedirectToIssuerMethod != null) + { + hashCode = (hashCode * 59) + this.RedirectToIssuerMethod.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + if (this.ReturnUrl != null) + { + hashCode = (hashCode * 59) + this.ReturnUrl.GetHashCode(); + } + if (this.RiskData != null) + { + hashCode = (hashCode * 59) + this.RiskData.GetHashCode(); + } + if (this.SessionValidity != null) + { + hashCode = (hashCode * 59) + this.SessionValidity.GetHashCode(); + } + if (this.ShopperConversionId != null) + { + hashCode = (hashCode * 59) + this.ShopperConversionId.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.ShopperIP != null) + { + hashCode = (hashCode * 59) + this.ShopperIP.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ShopperInteraction.GetHashCode(); + if (this.ShopperLocale != null) + { + hashCode = (hashCode * 59) + this.ShopperLocale.GetHashCode(); + } + if (this.ShopperName != null) + { + hashCode = (hashCode * 59) + this.ShopperName.GetHashCode(); + } + if (this.ShopperReference != null) + { + hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); + } + if (this.ShopperStatement != null) + { + hashCode = (hashCode * 59) + this.ShopperStatement.GetHashCode(); + } + if (this.SocialSecurityNumber != null) + { + hashCode = (hashCode * 59) + this.SocialSecurityNumber.GetHashCode(); + } + if (this.Splits != null) + { + hashCode = (hashCode * 59) + this.Splits.GetHashCode(); + } + if (this.Store != null) + { + hashCode = (hashCode * 59) + this.Store.GetHashCode(); + } + hashCode = (hashCode * 59) + this.StorePaymentMethod.GetHashCode(); + if (this.SubMerchants != null) + { + hashCode = (hashCode * 59) + this.SubMerchants.GetHashCode(); + } + if (this.Surcharge != null) + { + hashCode = (hashCode * 59) + this.Surcharge.GetHashCode(); + } + if (this.TelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); + } + if (this.ThreeDS2RequestData != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2RequestData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ThreeDSAuthenticationOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.TrustedShopper.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentRequest paymentRequest, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (paymentRequest.Amount == null) - throw new ArgumentNullException(nameof(paymentRequest.Amount), "Property is required for class PaymentRequest."); - - if (paymentRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentRequest.MerchantAccount), "Property is required for class PaymentRequest."); - - if (paymentRequest.PaymentMethod == null) - throw new ArgumentNullException(nameof(paymentRequest.PaymentMethod), "Property is required for class PaymentRequest."); - - if (paymentRequest.Reference == null) - throw new ArgumentNullException(nameof(paymentRequest.Reference), "Property is required for class PaymentRequest."); - - if (paymentRequest.ReturnUrl == null) - throw new ArgumentNullException(nameof(paymentRequest.ReturnUrl), "Property is required for class PaymentRequest."); - - if (paymentRequest.AccountInfoOption.IsSet && paymentRequest.AccountInfo == null) - throw new ArgumentNullException(nameof(paymentRequest.AccountInfo), "Property is required for class PaymentRequest."); - - if (paymentRequest.AdditionalAmountOption.IsSet && paymentRequest.AdditionalAmount == null) - throw new ArgumentNullException(nameof(paymentRequest.AdditionalAmount), "Property is required for class PaymentRequest."); - - if (paymentRequest.AdditionalDataOption.IsSet && paymentRequest.AdditionalData == null) - throw new ArgumentNullException(nameof(paymentRequest.AdditionalData), "Property is required for class PaymentRequest."); - - if (paymentRequest.ApplicationInfoOption.IsSet && paymentRequest.ApplicationInfo == null) - throw new ArgumentNullException(nameof(paymentRequest.ApplicationInfo), "Property is required for class PaymentRequest."); - - if (paymentRequest.AuthenticationDataOption.IsSet && paymentRequest.AuthenticationData == null) - throw new ArgumentNullException(nameof(paymentRequest.AuthenticationData), "Property is required for class PaymentRequest."); - - if (paymentRequest.BankAccountOption.IsSet && paymentRequest.BankAccount == null) - throw new ArgumentNullException(nameof(paymentRequest.BankAccount), "Property is required for class PaymentRequest."); - - if (paymentRequest.BillingAddressOption.IsSet && paymentRequest.BillingAddress == null) - throw new ArgumentNullException(nameof(paymentRequest.BillingAddress), "Property is required for class PaymentRequest."); - - if (paymentRequest.BrowserInfoOption.IsSet && paymentRequest.BrowserInfo == null) - throw new ArgumentNullException(nameof(paymentRequest.BrowserInfo), "Property is required for class PaymentRequest."); - - if (paymentRequest.CheckoutAttemptIdOption.IsSet && paymentRequest.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(paymentRequest.CheckoutAttemptId), "Property is required for class PaymentRequest."); - - if (paymentRequest.CompanyOption.IsSet && paymentRequest.Company == null) - throw new ArgumentNullException(nameof(paymentRequest.Company), "Property is required for class PaymentRequest."); - - if (paymentRequest.ConversionIdOption.IsSet && paymentRequest.ConversionId == null) - throw new ArgumentNullException(nameof(paymentRequest.ConversionId), "Property is required for class PaymentRequest."); - - if (paymentRequest.CountryCodeOption.IsSet && paymentRequest.CountryCode == null) - throw new ArgumentNullException(nameof(paymentRequest.CountryCode), "Property is required for class PaymentRequest."); - - if (paymentRequest.DccQuoteOption.IsSet && paymentRequest.DccQuote == null) - throw new ArgumentNullException(nameof(paymentRequest.DccQuote), "Property is required for class PaymentRequest."); - - if (paymentRequest.DeliveryAddressOption.IsSet && paymentRequest.DeliveryAddress == null) - throw new ArgumentNullException(nameof(paymentRequest.DeliveryAddress), "Property is required for class PaymentRequest."); - - if (paymentRequest.DeviceFingerprintOption.IsSet && paymentRequest.DeviceFingerprint == null) - throw new ArgumentNullException(nameof(paymentRequest.DeviceFingerprint), "Property is required for class PaymentRequest."); - - if (paymentRequest.EnhancedSchemeDataOption.IsSet && paymentRequest.EnhancedSchemeData == null) - throw new ArgumentNullException(nameof(paymentRequest.EnhancedSchemeData), "Property is required for class PaymentRequest."); - - if (paymentRequest.FundOriginOption.IsSet && paymentRequest.FundOrigin == null) - throw new ArgumentNullException(nameof(paymentRequest.FundOrigin), "Property is required for class PaymentRequest."); - - if (paymentRequest.FundRecipientOption.IsSet && paymentRequest.FundRecipient == null) - throw new ArgumentNullException(nameof(paymentRequest.FundRecipient), "Property is required for class PaymentRequest."); - - if (paymentRequest.InstallmentsOption.IsSet && paymentRequest.Installments == null) - throw new ArgumentNullException(nameof(paymentRequest.Installments), "Property is required for class PaymentRequest."); - - if (paymentRequest.LineItemsOption.IsSet && paymentRequest.LineItems == null) - throw new ArgumentNullException(nameof(paymentRequest.LineItems), "Property is required for class PaymentRequest."); - - if (paymentRequest.LocalizedShopperStatementOption.IsSet && paymentRequest.LocalizedShopperStatement == null) - throw new ArgumentNullException(nameof(paymentRequest.LocalizedShopperStatement), "Property is required for class PaymentRequest."); - - if (paymentRequest.MandateOption.IsSet && paymentRequest.Mandate == null) - throw new ArgumentNullException(nameof(paymentRequest.Mandate), "Property is required for class PaymentRequest."); - - if (paymentRequest.MccOption.IsSet && paymentRequest.Mcc == null) - throw new ArgumentNullException(nameof(paymentRequest.Mcc), "Property is required for class PaymentRequest."); - - if (paymentRequest.MerchantOrderReferenceOption.IsSet && paymentRequest.MerchantOrderReference == null) - throw new ArgumentNullException(nameof(paymentRequest.MerchantOrderReference), "Property is required for class PaymentRequest."); - - if (paymentRequest.MerchantRiskIndicatorOption.IsSet && paymentRequest.MerchantRiskIndicator == null) - throw new ArgumentNullException(nameof(paymentRequest.MerchantRiskIndicator), "Property is required for class PaymentRequest."); - - if (paymentRequest.MetadataOption.IsSet && paymentRequest.Metadata == null) - throw new ArgumentNullException(nameof(paymentRequest.Metadata), "Property is required for class PaymentRequest."); - - if (paymentRequest.MpiDataOption.IsSet && paymentRequest.MpiData == null) - throw new ArgumentNullException(nameof(paymentRequest.MpiData), "Property is required for class PaymentRequest."); - - if (paymentRequest.OrderOption.IsSet && paymentRequest.Order == null) - throw new ArgumentNullException(nameof(paymentRequest.Order), "Property is required for class PaymentRequest."); - - if (paymentRequest.OrderReferenceOption.IsSet && paymentRequest.OrderReference == null) - throw new ArgumentNullException(nameof(paymentRequest.OrderReference), "Property is required for class PaymentRequest."); - - if (paymentRequest.OriginOption.IsSet && paymentRequest.Origin == null) - throw new ArgumentNullException(nameof(paymentRequest.Origin), "Property is required for class PaymentRequest."); - - if (paymentRequest.PlatformChargebackLogicOption.IsSet && paymentRequest.PlatformChargebackLogic == null) - throw new ArgumentNullException(nameof(paymentRequest.PlatformChargebackLogic), "Property is required for class PaymentRequest."); - - if (paymentRequest.RecurringExpiryOption.IsSet && paymentRequest.RecurringExpiry == null) - throw new ArgumentNullException(nameof(paymentRequest.RecurringExpiry), "Property is required for class PaymentRequest."); - - if (paymentRequest.RecurringFrequencyOption.IsSet && paymentRequest.RecurringFrequency == null) - throw new ArgumentNullException(nameof(paymentRequest.RecurringFrequency), "Property is required for class PaymentRequest."); - - if (paymentRequest.RedirectFromIssuerMethodOption.IsSet && paymentRequest.RedirectFromIssuerMethod == null) - throw new ArgumentNullException(nameof(paymentRequest.RedirectFromIssuerMethod), "Property is required for class PaymentRequest."); - - if (paymentRequest.RedirectToIssuerMethodOption.IsSet && paymentRequest.RedirectToIssuerMethod == null) - throw new ArgumentNullException(nameof(paymentRequest.RedirectToIssuerMethod), "Property is required for class PaymentRequest."); - - if (paymentRequest.RiskDataOption.IsSet && paymentRequest.RiskData == null) - throw new ArgumentNullException(nameof(paymentRequest.RiskData), "Property is required for class PaymentRequest."); - - if (paymentRequest.SessionValidityOption.IsSet && paymentRequest.SessionValidity == null) - throw new ArgumentNullException(nameof(paymentRequest.SessionValidity), "Property is required for class PaymentRequest."); - - if (paymentRequest.ShopperConversionIdOption.IsSet && paymentRequest.ShopperConversionId == null) - throw new ArgumentNullException(nameof(paymentRequest.ShopperConversionId), "Property is required for class PaymentRequest."); - - if (paymentRequest.ShopperEmailOption.IsSet && paymentRequest.ShopperEmail == null) - throw new ArgumentNullException(nameof(paymentRequest.ShopperEmail), "Property is required for class PaymentRequest."); - - if (paymentRequest.ShopperIPOption.IsSet && paymentRequest.ShopperIP == null) - throw new ArgumentNullException(nameof(paymentRequest.ShopperIP), "Property is required for class PaymentRequest."); - - if (paymentRequest.ShopperLocaleOption.IsSet && paymentRequest.ShopperLocale == null) - throw new ArgumentNullException(nameof(paymentRequest.ShopperLocale), "Property is required for class PaymentRequest."); - - if (paymentRequest.ShopperNameOption.IsSet && paymentRequest.ShopperName == null) - throw new ArgumentNullException(nameof(paymentRequest.ShopperName), "Property is required for class PaymentRequest."); - - if (paymentRequest.ShopperReferenceOption.IsSet && paymentRequest.ShopperReference == null) - throw new ArgumentNullException(nameof(paymentRequest.ShopperReference), "Property is required for class PaymentRequest."); - - if (paymentRequest.ShopperStatementOption.IsSet && paymentRequest.ShopperStatement == null) - throw new ArgumentNullException(nameof(paymentRequest.ShopperStatement), "Property is required for class PaymentRequest."); - - if (paymentRequest.SocialSecurityNumberOption.IsSet && paymentRequest.SocialSecurityNumber == null) - throw new ArgumentNullException(nameof(paymentRequest.SocialSecurityNumber), "Property is required for class PaymentRequest."); - - if (paymentRequest.SplitsOption.IsSet && paymentRequest.Splits == null) - throw new ArgumentNullException(nameof(paymentRequest.Splits), "Property is required for class PaymentRequest."); - - if (paymentRequest.StoreOption.IsSet && paymentRequest.Store == null) - throw new ArgumentNullException(nameof(paymentRequest.Store), "Property is required for class PaymentRequest."); - - if (paymentRequest.SubMerchantsOption.IsSet && paymentRequest.SubMerchants == null) - throw new ArgumentNullException(nameof(paymentRequest.SubMerchants), "Property is required for class PaymentRequest."); - - if (paymentRequest.SurchargeOption.IsSet && paymentRequest.Surcharge == null) - throw new ArgumentNullException(nameof(paymentRequest.Surcharge), "Property is required for class PaymentRequest."); - - if (paymentRequest.TelephoneNumberOption.IsSet && paymentRequest.TelephoneNumber == null) - throw new ArgumentNullException(nameof(paymentRequest.TelephoneNumber), "Property is required for class PaymentRequest."); - - if (paymentRequest.ThreeDS2RequestDataOption.IsSet && paymentRequest.ThreeDS2RequestData == null) - throw new ArgumentNullException(nameof(paymentRequest.ThreeDS2RequestData), "Property is required for class PaymentRequest."); - - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, paymentRequest.Amount, jsonSerializerOptions); - writer.WriteString("merchantAccount", paymentRequest.MerchantAccount); - - writer.WritePropertyName("paymentMethod"); - JsonSerializer.Serialize(writer, paymentRequest.PaymentMethod, jsonSerializerOptions); - writer.WriteString("reference", paymentRequest.Reference); - - writer.WriteString("returnUrl", paymentRequest.ReturnUrl); - - if (paymentRequest.AccountInfoOption.IsSet) - { - writer.WritePropertyName("accountInfo"); - JsonSerializer.Serialize(writer, paymentRequest.AccountInfo, jsonSerializerOptions); - } - if (paymentRequest.AdditionalAmountOption.IsSet) - { - writer.WritePropertyName("additionalAmount"); - JsonSerializer.Serialize(writer, paymentRequest.AdditionalAmount, jsonSerializerOptions); - } - if (paymentRequest.AdditionalDataOption.IsSet) - { - writer.WritePropertyName("additionalData"); - JsonSerializer.Serialize(writer, paymentRequest.AdditionalData, jsonSerializerOptions); - } - if (paymentRequest.ApplicationInfoOption.IsSet) - { - writer.WritePropertyName("applicationInfo"); - JsonSerializer.Serialize(writer, paymentRequest.ApplicationInfo, jsonSerializerOptions); - } - if (paymentRequest.AuthenticationDataOption.IsSet) - { - writer.WritePropertyName("authenticationData"); - JsonSerializer.Serialize(writer, paymentRequest.AuthenticationData, jsonSerializerOptions); - } - if (paymentRequest.BankAccountOption.IsSet) - { - writer.WritePropertyName("bankAccount"); - JsonSerializer.Serialize(writer, paymentRequest.BankAccount, jsonSerializerOptions); - } - if (paymentRequest.BillingAddressOption.IsSet) - { - writer.WritePropertyName("billingAddress"); - JsonSerializer.Serialize(writer, paymentRequest.BillingAddress, jsonSerializerOptions); - } - if (paymentRequest.BrowserInfoOption.IsSet) + // CheckoutAttemptId (string) maxLength + if (this.CheckoutAttemptId != null && this.CheckoutAttemptId.Length > 256) { - writer.WritePropertyName("browserInfo"); - JsonSerializer.Serialize(writer, paymentRequest.BrowserInfo, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for CheckoutAttemptId, length must be less than 256.", new [] { "CheckoutAttemptId" }); } - if (paymentRequest.CaptureDelayHoursOption.IsSet) - writer.WriteNumber("captureDelayHours", paymentRequest.CaptureDelayHoursOption.Value.Value); - - var channelRawValue = PaymentRequest.ChannelEnumToJsonValue(paymentRequest.ChannelOption.Value.Value); - writer.WriteString("channel", channelRawValue); - if (paymentRequest.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", paymentRequest.CheckoutAttemptId); - if (paymentRequest.CompanyOption.IsSet) + // CountryCode (string) maxLength + if (this.CountryCode != null && this.CountryCode.Length > 100) { - writer.WritePropertyName("company"); - JsonSerializer.Serialize(writer, paymentRequest.Company, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for CountryCode, length must be less than 100.", new [] { "CountryCode" }); } - if (paymentRequest.ConversionIdOption.IsSet) - writer.WriteString("conversionId", paymentRequest.ConversionId); - - if (paymentRequest.CountryCodeOption.IsSet) - writer.WriteString("countryCode", paymentRequest.CountryCode); - - if (paymentRequest.DateOfBirthOption.IsSet) - writer.WriteString("dateOfBirth", paymentRequest.DateOfBirthOption.Value.Value.ToString(DateOfBirthFormat)); - if (paymentRequest.DccQuoteOption.IsSet) + // DeviceFingerprint (string) maxLength + if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) { - writer.WritePropertyName("dccQuote"); - JsonSerializer.Serialize(writer, paymentRequest.DccQuote, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); } - if (paymentRequest.DeliverAtOption.IsSet) - writer.WriteString("deliverAt", paymentRequest.DeliverAtOption.Value.Value.ToString(DeliverAtFormat)); - if (paymentRequest.DeliveryAddressOption.IsSet) + // MerchantOrderReference (string) maxLength + if (this.MerchantOrderReference != null && this.MerchantOrderReference.Length > 1000) { - writer.WritePropertyName("deliveryAddress"); - JsonSerializer.Serialize(writer, paymentRequest.DeliveryAddress, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for MerchantOrderReference, length must be less than 1000.", new [] { "MerchantOrderReference" }); } - if (paymentRequest.DeliveryDateOption.IsSet) - writer.WriteString("deliveryDate", paymentRequest.DeliveryDateOption.Value.Value.ToString(DeliveryDateFormat)); - - if (paymentRequest.DeviceFingerprintOption.IsSet) - writer.WriteString("deviceFingerprint", paymentRequest.DeviceFingerprint); - - if (paymentRequest.EnableOneClickOption.IsSet) - writer.WriteBoolean("enableOneClick", paymentRequest.EnableOneClickOption.Value.Value); - if (paymentRequest.EnablePayOutOption.IsSet) - writer.WriteBoolean("enablePayOut", paymentRequest.EnablePayOutOption.Value.Value); - - if (paymentRequest.EnableRecurringOption.IsSet) - writer.WriteBoolean("enableRecurring", paymentRequest.EnableRecurringOption.Value.Value); - - if (paymentRequest.EnhancedSchemeDataOption.IsSet) + // Origin (string) maxLength + if (this.Origin != null && this.Origin.Length > 80) { - writer.WritePropertyName("enhancedSchemeData"); - JsonSerializer.Serialize(writer, paymentRequest.EnhancedSchemeData, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, length must be less than 80.", new [] { "Origin" }); } - var entityTypeRawValue = PaymentRequest.EntityTypeEnumToJsonValue(paymentRequest.EntityTypeOption.Value.Value); - writer.WriteString("entityType", entityTypeRawValue); - if (paymentRequest.FraudOffsetOption.IsSet) - writer.WriteNumber("fraudOffset", paymentRequest.FraudOffsetOption.Value.Value); - if (paymentRequest.FundOriginOption.IsSet) + // ReturnUrl (string) maxLength + if (this.ReturnUrl != null && this.ReturnUrl.Length > 8000) { - writer.WritePropertyName("fundOrigin"); - JsonSerializer.Serialize(writer, paymentRequest.FundOrigin, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ReturnUrl, length must be less than 8000.", new [] { "ReturnUrl" }); } - if (paymentRequest.FundRecipientOption.IsSet) - { - writer.WritePropertyName("fundRecipient"); - JsonSerializer.Serialize(writer, paymentRequest.FundRecipient, jsonSerializerOptions); - } - var industryUsageRawValue = PaymentRequest.IndustryUsageEnumToJsonValue(paymentRequest.IndustryUsageOption.Value.Value); - writer.WriteString("industryUsage", industryUsageRawValue); - if (paymentRequest.InstallmentsOption.IsSet) - { - writer.WritePropertyName("installments"); - JsonSerializer.Serialize(writer, paymentRequest.Installments, jsonSerializerOptions); - } - if (paymentRequest.LineItemsOption.IsSet) - { - writer.WritePropertyName("lineItems"); - JsonSerializer.Serialize(writer, paymentRequest.LineItems, jsonSerializerOptions); - } - if (paymentRequest.LocalizedShopperStatementOption.IsSet) - { - writer.WritePropertyName("localizedShopperStatement"); - JsonSerializer.Serialize(writer, paymentRequest.LocalizedShopperStatement, jsonSerializerOptions); - } - if (paymentRequest.MandateOption.IsSet) - { - writer.WritePropertyName("mandate"); - JsonSerializer.Serialize(writer, paymentRequest.Mandate, jsonSerializerOptions); - } - if (paymentRequest.MccOption.IsSet) - writer.WriteString("mcc", paymentRequest.Mcc); - - if (paymentRequest.MerchantOrderReferenceOption.IsSet) - writer.WriteString("merchantOrderReference", paymentRequest.MerchantOrderReference); - if (paymentRequest.MerchantRiskIndicatorOption.IsSet) - { - writer.WritePropertyName("merchantRiskIndicator"); - JsonSerializer.Serialize(writer, paymentRequest.MerchantRiskIndicator, jsonSerializerOptions); - } - if (paymentRequest.MetadataOption.IsSet) - { - writer.WritePropertyName("metadata"); - JsonSerializer.Serialize(writer, paymentRequest.Metadata, jsonSerializerOptions); - } - if (paymentRequest.MpiDataOption.IsSet) - { - writer.WritePropertyName("mpiData"); - JsonSerializer.Serialize(writer, paymentRequest.MpiData, jsonSerializerOptions); - } - if (paymentRequest.OrderOption.IsSet) + // ShopperConversionId (string) maxLength + if (this.ShopperConversionId != null && this.ShopperConversionId.Length > 256) { - writer.WritePropertyName("order"); - JsonSerializer.Serialize(writer, paymentRequest.Order, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperConversionId, length must be less than 256.", new [] { "ShopperConversionId" }); } - if (paymentRequest.OrderReferenceOption.IsSet) - writer.WriteString("orderReference", paymentRequest.OrderReference); - - if (paymentRequest.OriginOption.IsSet) - writer.WriteString("origin", paymentRequest.Origin); - if (paymentRequest.PlatformChargebackLogicOption.IsSet) + // ShopperIP (string) maxLength + if (this.ShopperIP != null && this.ShopperIP.Length > 1000) { - writer.WritePropertyName("platformChargebackLogic"); - JsonSerializer.Serialize(writer, paymentRequest.PlatformChargebackLogic, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperIP, length must be less than 1000.", new [] { "ShopperIP" }); } - if (paymentRequest.RecurringExpiryOption.IsSet) - writer.WriteString("recurringExpiry", paymentRequest.RecurringExpiry); - - if (paymentRequest.RecurringFrequencyOption.IsSet) - writer.WriteString("recurringFrequency", paymentRequest.RecurringFrequency); - - var recurringProcessingModelRawValue = PaymentRequest.RecurringProcessingModelEnumToJsonValue(paymentRequest.RecurringProcessingModelOption.Value.Value); - writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); - if (paymentRequest.RedirectFromIssuerMethodOption.IsSet) - writer.WriteString("redirectFromIssuerMethod", paymentRequest.RedirectFromIssuerMethod); - - if (paymentRequest.RedirectToIssuerMethodOption.IsSet) - writer.WriteString("redirectToIssuerMethod", paymentRequest.RedirectToIssuerMethod); - if (paymentRequest.RiskDataOption.IsSet) + // ShopperReference (string) maxLength + if (this.ShopperReference != null && this.ShopperReference.Length > 256) { - writer.WritePropertyName("riskData"); - JsonSerializer.Serialize(writer, paymentRequest.RiskData, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); } - if (paymentRequest.SessionValidityOption.IsSet) - writer.WriteString("sessionValidity", paymentRequest.SessionValidity); - - if (paymentRequest.ShopperConversionIdOption.IsSet) - writer.WriteString("shopperConversionId", paymentRequest.ShopperConversionId); - if (paymentRequest.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", paymentRequest.ShopperEmail); - - if (paymentRequest.ShopperIPOption.IsSet) - writer.WriteString("shopperIP", paymentRequest.ShopperIP); - - var shopperInteractionRawValue = PaymentRequest.ShopperInteractionEnumToJsonValue(paymentRequest.ShopperInteractionOption.Value.Value); - writer.WriteString("shopperInteraction", shopperInteractionRawValue); - if (paymentRequest.ShopperLocaleOption.IsSet) - writer.WriteString("shopperLocale", paymentRequest.ShopperLocale); - - if (paymentRequest.ShopperNameOption.IsSet) + // ShopperReference (string) minLength + if (this.ShopperReference != null && this.ShopperReference.Length < 3) { - writer.WritePropertyName("shopperName"); - JsonSerializer.Serialize(writer, paymentRequest.ShopperName, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); } - if (paymentRequest.ShopperReferenceOption.IsSet) - writer.WriteString("shopperReference", paymentRequest.ShopperReference); - - if (paymentRequest.ShopperStatementOption.IsSet) - writer.WriteString("shopperStatement", paymentRequest.ShopperStatement); - if (paymentRequest.SocialSecurityNumberOption.IsSet) - writer.WriteString("socialSecurityNumber", paymentRequest.SocialSecurityNumber); - - if (paymentRequest.SplitsOption.IsSet) + // ShopperStatement (string) maxLength + if (this.ShopperStatement != null && this.ShopperStatement.Length > 10000) { - writer.WritePropertyName("splits"); - JsonSerializer.Serialize(writer, paymentRequest.Splits, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperStatement, length must be less than 10000.", new [] { "ShopperStatement" }); } - if (paymentRequest.StoreOption.IsSet) - writer.WriteString("store", paymentRequest.Store); - if (paymentRequest.StorePaymentMethodOption.IsSet) - writer.WriteBoolean("storePaymentMethod", paymentRequest.StorePaymentMethodOption.Value.Value); - - if (paymentRequest.SubMerchantsOption.IsSet) - { - writer.WritePropertyName("subMerchants"); - JsonSerializer.Serialize(writer, paymentRequest.SubMerchants, jsonSerializerOptions); - } - if (paymentRequest.SurchargeOption.IsSet) + // Store (string) maxLength + if (this.Store != null && this.Store.Length > 64) { - writer.WritePropertyName("surcharge"); - JsonSerializer.Serialize(writer, paymentRequest.Surcharge, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be less than 64.", new [] { "Store" }); } - if (paymentRequest.TelephoneNumberOption.IsSet) - writer.WriteString("telephoneNumber", paymentRequest.TelephoneNumber); - if (paymentRequest.ThreeDS2RequestDataOption.IsSet) + // Store (string) minLength + if (this.Store != null && this.Store.Length < 1) { - writer.WritePropertyName("threeDS2RequestData"); - JsonSerializer.Serialize(writer, paymentRequest.ThreeDS2RequestData, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be greater than 1.", new [] { "Store" }); } - if (paymentRequest.ThreeDSAuthenticationOnlyOption.IsSet) - writer.WriteBoolean("threeDSAuthenticationOnly", paymentRequest.ThreeDSAuthenticationOnlyOption.Value.Value); - if (paymentRequest.TrustedShopperOption.IsSet) - writer.WriteBoolean("trustedShopper", paymentRequest.TrustedShopperOption.Value.Value); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentResponse.cs b/Adyen/Model/Checkout/PaymentResponse.cs index 42708b0b2..ed9e81655 100644 --- a/Adyen/Model/Checkout/PaymentResponse.cs +++ b/Adyen/Model/Checkout/PaymentResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,498 +15,250 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentResponse /// - public partial class PaymentResponse : IValidatableObject + [DataContract(Name = "PaymentResponse")] + public partial class PaymentResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// action - /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - /// amount - /// Donation Token containing payment details for Adyen Giving. - /// fraudResult - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - /// order - /// paymentMethod - /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response. - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - /// threeDS2ResponseData - /// threeDS2Result - /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. - [JsonConstructor] - public PaymentResponse(Option action = default, Option> additionalData = default, Option amount = default, Option donationToken = default, Option fraudResult = default, Option merchantReference = default, Option order = default, Option paymentMethod = default, Option pspReference = default, Option refusalReason = default, Option refusalReasonCode = default, Option resultCode = default, Option threeDS2ResponseData = default, Option threeDS2Result = default, Option threeDSPaymentData = default) - { - ActionOption = action; - AdditionalDataOption = additionalData; - AmountOption = amount; - DonationTokenOption = donationToken; - FraudResultOption = fraudResult; - MerchantReferenceOption = merchantReference; - OrderOption = order; - PaymentMethodOption = paymentMethod; - PspReferenceOption = pspReference; - RefusalReasonOption = refusalReason; - RefusalReasonCodeOption = refusalReasonCode; - ResultCodeOption = resultCode; - ThreeDS2ResponseDataOption = threeDS2ResponseData; - ThreeDS2ResultOption = threeDS2Result; - ThreeDSPaymentDataOption = threeDSPaymentData; - OnCreated(); - } - - partial void OnCreated(); - /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. + [JsonConverter(typeof(StringEnumConverter))] public enum ResultCodeEnum { /// /// Enum AuthenticationFinished for value: AuthenticationFinished /// + [EnumMember(Value = "AuthenticationFinished")] AuthenticationFinished = 1, /// /// Enum AuthenticationNotRequired for value: AuthenticationNotRequired /// + [EnumMember(Value = "AuthenticationNotRequired")] AuthenticationNotRequired = 2, /// /// Enum Authorised for value: Authorised /// + [EnumMember(Value = "Authorised")] Authorised = 3, /// /// Enum Cancelled for value: Cancelled /// + [EnumMember(Value = "Cancelled")] Cancelled = 4, /// /// Enum ChallengeShopper for value: ChallengeShopper /// + [EnumMember(Value = "ChallengeShopper")] ChallengeShopper = 5, /// /// Enum Error for value: Error /// + [EnumMember(Value = "Error")] Error = 6, /// /// Enum IdentifyShopper for value: IdentifyShopper /// + [EnumMember(Value = "IdentifyShopper")] IdentifyShopper = 7, /// /// Enum PartiallyAuthorised for value: PartiallyAuthorised /// + [EnumMember(Value = "PartiallyAuthorised")] PartiallyAuthorised = 8, /// /// Enum Pending for value: Pending /// + [EnumMember(Value = "Pending")] Pending = 9, /// /// Enum PresentToShopper for value: PresentToShopper /// + [EnumMember(Value = "PresentToShopper")] PresentToShopper = 10, /// /// Enum Received for value: Received /// + [EnumMember(Value = "Received")] Received = 11, /// /// Enum RedirectShopper for value: RedirectShopper /// + [EnumMember(Value = "RedirectShopper")] RedirectShopper = 12, /// /// Enum Refused for value: Refused /// + [EnumMember(Value = "Refused")] Refused = 13, /// /// Enum Success for value: Success /// + [EnumMember(Value = "Success")] Success = 14 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ResultCodeEnum ResultCodeEnumFromString(string value) - { - if (value.Equals("AuthenticationFinished")) - return ResultCodeEnum.AuthenticationFinished; - - if (value.Equals("AuthenticationNotRequired")) - return ResultCodeEnum.AuthenticationNotRequired; - - if (value.Equals("Authorised")) - return ResultCodeEnum.Authorised; - - if (value.Equals("Cancelled")) - return ResultCodeEnum.Cancelled; - - if (value.Equals("ChallengeShopper")) - return ResultCodeEnum.ChallengeShopper; - - if (value.Equals("Error")) - return ResultCodeEnum.Error; - - if (value.Equals("IdentifyShopper")) - return ResultCodeEnum.IdentifyShopper; - - if (value.Equals("PartiallyAuthorised")) - return ResultCodeEnum.PartiallyAuthorised; - - if (value.Equals("Pending")) - return ResultCodeEnum.Pending; - - if (value.Equals("PresentToShopper")) - return ResultCodeEnum.PresentToShopper; - - if (value.Equals("Received")) - return ResultCodeEnum.Received; - - if (value.Equals("RedirectShopper")) - return ResultCodeEnum.RedirectShopper; - - if (value.Equals("Refused")) - return ResultCodeEnum.Refused; - - if (value.Equals("Success")) - return ResultCodeEnum.Success; - - throw new NotImplementedException($"Could not convert value to type ResultCodeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ResultCodeEnum? ResultCodeEnumFromStringOrDefault(string value) - { - if (value.Equals("AuthenticationFinished")) - return ResultCodeEnum.AuthenticationFinished; - - if (value.Equals("AuthenticationNotRequired")) - return ResultCodeEnum.AuthenticationNotRequired; - - if (value.Equals("Authorised")) - return ResultCodeEnum.Authorised; - - if (value.Equals("Cancelled")) - return ResultCodeEnum.Cancelled; - - if (value.Equals("ChallengeShopper")) - return ResultCodeEnum.ChallengeShopper; - - if (value.Equals("Error")) - return ResultCodeEnum.Error; - - if (value.Equals("IdentifyShopper")) - return ResultCodeEnum.IdentifyShopper; - - if (value.Equals("PartiallyAuthorised")) - return ResultCodeEnum.PartiallyAuthorised; - - if (value.Equals("Pending")) - return ResultCodeEnum.Pending; - - if (value.Equals("PresentToShopper")) - return ResultCodeEnum.PresentToShopper; - - if (value.Equals("Received")) - return ResultCodeEnum.Received; - - if (value.Equals("RedirectShopper")) - return ResultCodeEnum.RedirectShopper; - - if (value.Equals("Refused")) - return ResultCodeEnum.Refused; - - if (value.Equals("Success")) - return ResultCodeEnum.Success; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ResultCodeEnumToJsonValue(ResultCodeEnum? value) - { - if (value == ResultCodeEnum.AuthenticationFinished) - return "AuthenticationFinished"; - - if (value == ResultCodeEnum.AuthenticationNotRequired) - return "AuthenticationNotRequired"; - - if (value == ResultCodeEnum.Authorised) - return "Authorised"; - - if (value == ResultCodeEnum.Cancelled) - return "Cancelled"; - if (value == ResultCodeEnum.ChallengeShopper) - return "ChallengeShopper"; - - if (value == ResultCodeEnum.Error) - return "Error"; - - if (value == ResultCodeEnum.IdentifyShopper) - return "IdentifyShopper"; - - if (value == ResultCodeEnum.PartiallyAuthorised) - return "PartiallyAuthorised"; - - if (value == ResultCodeEnum.Pending) - return "Pending"; - - if (value == ResultCodeEnum.PresentToShopper) - return "PresentToShopper"; - - if (value == ResultCodeEnum.Received) - return "Received"; - - if (value == ResultCodeEnum.RedirectShopper) - return "RedirectShopper"; - - if (value == ResultCodeEnum.Refused) - return "Refused"; - - if (value == ResultCodeEnum.Success) - return "Success"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of ResultCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ResultCodeOption { get; private set; } /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. /// /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. - [JsonPropertyName("resultCode")] - public ResultCodeEnum? ResultCode { get { return this.ResultCodeOption; } set { this.ResultCodeOption = new Option(value); } } - + [DataMember(Name = "resultCode", EmitDefaultValue = false)] + public ResultCodeEnum? ResultCode { get; set; } /// - /// Used to track the state of Action + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ActionOption { get; private set; } + /// action. + /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**.. + /// amount. + /// Donation Token containing payment details for Adyen Giving.. + /// fraudResult. + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.. + /// order. + /// paymentMethod. + /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response.. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. + /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state.. + /// threeDS2ResponseData. + /// threeDS2Result. + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`.. + public PaymentResponse(PaymentResponseAction action = default(PaymentResponseAction), Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), string donationToken = default(string), FraudResult fraudResult = default(FraudResult), string merchantReference = default(string), CheckoutOrderResponse order = default(CheckoutOrderResponse), ResponsePaymentMethod paymentMethod = default(ResponsePaymentMethod), string pspReference = default(string), string refusalReason = default(string), string refusalReasonCode = default(string), ResultCodeEnum? resultCode = default(ResultCodeEnum?), ThreeDS2ResponseData threeDS2ResponseData = default(ThreeDS2ResponseData), ThreeDS2Result threeDS2Result = default(ThreeDS2Result), string threeDSPaymentData = default(string)) + { + this.Action = action; + this.AdditionalData = additionalData; + this.Amount = amount; + this.DonationToken = donationToken; + this.FraudResult = fraudResult; + this.MerchantReference = merchantReference; + this.Order = order; + this.PaymentMethod = paymentMethod; + this.PspReference = pspReference; + this.RefusalReason = refusalReason; + this.RefusalReasonCode = refusalReasonCode; + this.ResultCode = resultCode; + this.ThreeDS2ResponseData = threeDS2ResponseData; + this.ThreeDS2Result = threeDS2Result; + this.ThreeDSPaymentData = threeDSPaymentData; + } /// /// Gets or Sets Action /// - [JsonPropertyName("action")] - public PaymentResponseAction Action { get { return this.ActionOption; } set { this.ActionOption = new Option(value); } } - - /// - /// Used to track the state of AdditionalData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AdditionalDataOption { get; private set; } + [DataMember(Name = "action", EmitDefaultValue = false)] + public PaymentResponseAction Action { get; set; } /// /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. /// /// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**. - [JsonPropertyName("additionalData")] - public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } - - /// - /// Used to track the state of Amount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountOption { get; private set; } + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] - public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } - - /// - /// Used to track the state of DonationToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DonationTokenOption { get; private set; } + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// Donation Token containing payment details for Adyen Giving. /// /// Donation Token containing payment details for Adyen Giving. - [JsonPropertyName("donationToken")] - public string DonationToken { get { return this.DonationTokenOption; } set { this.DonationTokenOption = new Option(value); } } - - /// - /// Used to track the state of FraudResult - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FraudResultOption { get; private set; } + [DataMember(Name = "donationToken", EmitDefaultValue = false)] + public string DonationToken { get; set; } /// /// Gets or Sets FraudResult /// - [JsonPropertyName("fraudResult")] - public FraudResult FraudResult { get { return this.FraudResultOption; } set { this.FraudResultOption = new Option(value); } } - - /// - /// Used to track the state of MerchantReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantReferenceOption { get; private set; } + [DataMember(Name = "fraudResult", EmitDefaultValue = false)] + public FraudResult FraudResult { get; set; } /// /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. /// /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - [JsonPropertyName("merchantReference")] - public string MerchantReference { get { return this.MerchantReferenceOption; } set { this.MerchantReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Order - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OrderOption { get; private set; } + [DataMember(Name = "merchantReference", EmitDefaultValue = false)] + public string MerchantReference { get; set; } /// /// Gets or Sets Order /// - [JsonPropertyName("order")] - public CheckoutOrderResponse Order { get { return this.OrderOption; } set { this.OrderOption = new Option(value); } } - - /// - /// Used to track the state of PaymentMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodOption { get; private set; } + [DataMember(Name = "order", EmitDefaultValue = false)] + public CheckoutOrderResponse Order { get; set; } /// /// Gets or Sets PaymentMethod /// - [JsonPropertyName("paymentMethod")] - public ResponsePaymentMethod PaymentMethod { get { return this.PaymentMethodOption; } set { this.PaymentMethodOption = new Option(value); } } - - /// - /// Used to track the state of PspReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PspReferenceOption { get; private set; } + [DataMember(Name = "paymentMethod", EmitDefaultValue = false)] + public ResponsePaymentMethod PaymentMethod { get; set; } /// /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response. /// /// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response. - [JsonPropertyName("pspReference")] - public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } - - /// - /// Used to track the state of RefusalReason - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RefusalReasonOption { get; private set; } + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + public string PspReference { get; set; } /// /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). /// /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [JsonPropertyName("refusalReason")] - public string RefusalReason { get { return this.RefusalReasonOption; } set { this.RefusalReasonOption = new Option(value); } } - - /// - /// Used to track the state of RefusalReasonCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RefusalReasonCodeOption { get; private set; } + [DataMember(Name = "refusalReason", EmitDefaultValue = false)] + public string RefusalReason { get; set; } /// /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). /// /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [JsonPropertyName("refusalReasonCode")] - public string RefusalReasonCode { get { return this.RefusalReasonCodeOption; } set { this.RefusalReasonCodeOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2ResponseData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2ResponseDataOption { get; private set; } + [DataMember(Name = "refusalReasonCode", EmitDefaultValue = false)] + public string RefusalReasonCode { get; set; } /// /// Gets or Sets ThreeDS2ResponseData /// - [JsonPropertyName("threeDS2ResponseData")] - public ThreeDS2ResponseData ThreeDS2ResponseData { get { return this.ThreeDS2ResponseDataOption; } set { this.ThreeDS2ResponseDataOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDS2Result - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDS2ResultOption { get; private set; } + [DataMember(Name = "threeDS2ResponseData", EmitDefaultValue = false)] + public ThreeDS2ResponseData ThreeDS2ResponseData { get; set; } /// /// Gets or Sets ThreeDS2Result /// - [JsonPropertyName("threeDS2Result")] - public ThreeDS2Result ThreeDS2Result { get { return this.ThreeDS2ResultOption; } set { this.ThreeDS2ResultOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSPaymentData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSPaymentDataOption { get; private set; } + [DataMember(Name = "threeDS2Result", EmitDefaultValue = false)] + public ThreeDS2Result ThreeDS2Result { get; set; } /// /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. /// /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`. - [JsonPropertyName("threeDSPaymentData")] - public string ThreeDSPaymentData { get { return this.ThreeDSPaymentDataOption; } set { this.ThreeDSPaymentDataOption = new Option(value); } } + [DataMember(Name = "threeDSPaymentData", EmitDefaultValue = false)] + public string ThreeDSPaymentData { get; set; } /// /// Returns the string presentation of the object @@ -535,303 +288,191 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option action = default; - Option> additionalData = default; - Option amount = default; - Option donationToken = default; - Option fraudResult = default; - Option merchantReference = default; - Option order = default; - Option paymentMethod = default; - Option pspReference = default; - Option refusalReason = default; - Option refusalReasonCode = default; - Option resultCode = default; - Option threeDS2ResponseData = default; - Option threeDS2Result = default; - Option threeDSPaymentData = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "action": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - action = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "additionalData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "donationToken": - donationToken = new Option(utf8JsonReader.GetString()); - break; - case "fraudResult": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fraudResult = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "merchantReference": - merchantReference = new Option(utf8JsonReader.GetString()); - break; - case "order": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - order = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "paymentMethod": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "refusalReason": - refusalReason = new Option(utf8JsonReader.GetString()); - break; - case "refusalReasonCode": - refusalReasonCode = new Option(utf8JsonReader.GetString()); - break; - case "resultCode": - string resultCodeRawValue = utf8JsonReader.GetString(); - if (resultCodeRawValue != null) - resultCode = new Option(PaymentResponse.ResultCodeEnumFromStringOrDefault(resultCodeRawValue)); - break; - case "threeDS2ResponseData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDS2ResponseData = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDS2Result": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDS2Result = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDSPaymentData": - threeDSPaymentData = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (action.IsSet && action.Value == null) - throw new ArgumentNullException(nameof(action), "Property is not nullable for class PaymentResponse."); - - if (additionalData.IsSet && additionalData.Value == null) - throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class PaymentResponse."); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaymentResponse."); - - if (donationToken.IsSet && donationToken.Value == null) - throw new ArgumentNullException(nameof(donationToken), "Property is not nullable for class PaymentResponse."); - - if (fraudResult.IsSet && fraudResult.Value == null) - throw new ArgumentNullException(nameof(fraudResult), "Property is not nullable for class PaymentResponse."); - - if (merchantReference.IsSet && merchantReference.Value == null) - throw new ArgumentNullException(nameof(merchantReference), "Property is not nullable for class PaymentResponse."); - - if (order.IsSet && order.Value == null) - throw new ArgumentNullException(nameof(order), "Property is not nullable for class PaymentResponse."); - - if (paymentMethod.IsSet && paymentMethod.Value == null) - throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class PaymentResponse."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentResponse."); - - if (refusalReason.IsSet && refusalReason.Value == null) - throw new ArgumentNullException(nameof(refusalReason), "Property is not nullable for class PaymentResponse."); - - if (refusalReasonCode.IsSet && refusalReasonCode.Value == null) - throw new ArgumentNullException(nameof(refusalReasonCode), "Property is not nullable for class PaymentResponse."); - - if (resultCode.IsSet && resultCode.Value == null) - throw new ArgumentNullException(nameof(resultCode), "Property is not nullable for class PaymentResponse."); - - if (threeDS2ResponseData.IsSet && threeDS2ResponseData.Value == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData), "Property is not nullable for class PaymentResponse."); - - if (threeDS2Result.IsSet && threeDS2Result.Value == null) - throw new ArgumentNullException(nameof(threeDS2Result), "Property is not nullable for class PaymentResponse."); - - if (threeDSPaymentData.IsSet && threeDSPaymentData.Value == null) - throw new ArgumentNullException(nameof(threeDSPaymentData), "Property is not nullable for class PaymentResponse."); - - return new PaymentResponse(action, additionalData, amount, donationToken, fraudResult, merchantReference, order, paymentMethod, pspReference, refusalReason, refusalReasonCode, resultCode, threeDS2ResponseData, threeDS2Result, threeDSPaymentData); + return this.Equals(input as PaymentResponse); } /// - /// Serializes a + /// Returns true if PaymentResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentResponse paymentResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentResponse to be compared + /// Boolean + public bool Equals(PaymentResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, paymentResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Action == input.Action || + (this.Action != null && + this.Action.Equals(input.Action)) + ) && + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + input.AdditionalData != null && + this.AdditionalData.SequenceEqual(input.AdditionalData) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.DonationToken == input.DonationToken || + (this.DonationToken != null && + this.DonationToken.Equals(input.DonationToken)) + ) && + ( + this.FraudResult == input.FraudResult || + (this.FraudResult != null && + this.FraudResult.Equals(input.FraudResult)) + ) && + ( + this.MerchantReference == input.MerchantReference || + (this.MerchantReference != null && + this.MerchantReference.Equals(input.MerchantReference)) + ) && + ( + this.Order == input.Order || + (this.Order != null && + this.Order.Equals(input.Order)) + ) && + ( + this.PaymentMethod == input.PaymentMethod || + (this.PaymentMethod != null && + this.PaymentMethod.Equals(input.PaymentMethod)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.RefusalReason == input.RefusalReason || + (this.RefusalReason != null && + this.RefusalReason.Equals(input.RefusalReason)) + ) && + ( + this.RefusalReasonCode == input.RefusalReasonCode || + (this.RefusalReasonCode != null && + this.RefusalReasonCode.Equals(input.RefusalReasonCode)) + ) && + ( + this.ResultCode == input.ResultCode || + this.ResultCode.Equals(input.ResultCode) + ) && + ( + this.ThreeDS2ResponseData == input.ThreeDS2ResponseData || + (this.ThreeDS2ResponseData != null && + this.ThreeDS2ResponseData.Equals(input.ThreeDS2ResponseData)) + ) && + ( + this.ThreeDS2Result == input.ThreeDS2Result || + (this.ThreeDS2Result != null && + this.ThreeDS2Result.Equals(input.ThreeDS2Result)) + ) && + ( + this.ThreeDSPaymentData == input.ThreeDSPaymentData || + (this.ThreeDSPaymentData != null && + this.ThreeDSPaymentData.Equals(input.ThreeDSPaymentData)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentResponse paymentResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paymentResponse.ActionOption.IsSet && paymentResponse.Action == null) - throw new ArgumentNullException(nameof(paymentResponse.Action), "Property is required for class PaymentResponse."); - - if (paymentResponse.AdditionalDataOption.IsSet && paymentResponse.AdditionalData == null) - throw new ArgumentNullException(nameof(paymentResponse.AdditionalData), "Property is required for class PaymentResponse."); - - if (paymentResponse.AmountOption.IsSet && paymentResponse.Amount == null) - throw new ArgumentNullException(nameof(paymentResponse.Amount), "Property is required for class PaymentResponse."); - - if (paymentResponse.DonationTokenOption.IsSet && paymentResponse.DonationToken == null) - throw new ArgumentNullException(nameof(paymentResponse.DonationToken), "Property is required for class PaymentResponse."); - - if (paymentResponse.FraudResultOption.IsSet && paymentResponse.FraudResult == null) - throw new ArgumentNullException(nameof(paymentResponse.FraudResult), "Property is required for class PaymentResponse."); - - if (paymentResponse.MerchantReferenceOption.IsSet && paymentResponse.MerchantReference == null) - throw new ArgumentNullException(nameof(paymentResponse.MerchantReference), "Property is required for class PaymentResponse."); - - if (paymentResponse.OrderOption.IsSet && paymentResponse.Order == null) - throw new ArgumentNullException(nameof(paymentResponse.Order), "Property is required for class PaymentResponse."); - - if (paymentResponse.PaymentMethodOption.IsSet && paymentResponse.PaymentMethod == null) - throw new ArgumentNullException(nameof(paymentResponse.PaymentMethod), "Property is required for class PaymentResponse."); - - if (paymentResponse.PspReferenceOption.IsSet && paymentResponse.PspReference == null) - throw new ArgumentNullException(nameof(paymentResponse.PspReference), "Property is required for class PaymentResponse."); - - if (paymentResponse.RefusalReasonOption.IsSet && paymentResponse.RefusalReason == null) - throw new ArgumentNullException(nameof(paymentResponse.RefusalReason), "Property is required for class PaymentResponse."); - - if (paymentResponse.RefusalReasonCodeOption.IsSet && paymentResponse.RefusalReasonCode == null) - throw new ArgumentNullException(nameof(paymentResponse.RefusalReasonCode), "Property is required for class PaymentResponse."); - - if (paymentResponse.ThreeDS2ResponseDataOption.IsSet && paymentResponse.ThreeDS2ResponseData == null) - throw new ArgumentNullException(nameof(paymentResponse.ThreeDS2ResponseData), "Property is required for class PaymentResponse."); - - if (paymentResponse.ThreeDS2ResultOption.IsSet && paymentResponse.ThreeDS2Result == null) - throw new ArgumentNullException(nameof(paymentResponse.ThreeDS2Result), "Property is required for class PaymentResponse."); - - if (paymentResponse.ThreeDSPaymentDataOption.IsSet && paymentResponse.ThreeDSPaymentData == null) - throw new ArgumentNullException(nameof(paymentResponse.ThreeDSPaymentData), "Property is required for class PaymentResponse."); - - if (paymentResponse.ActionOption.IsSet) - { - writer.WritePropertyName("action"); - JsonSerializer.Serialize(writer, paymentResponse.Action, jsonSerializerOptions); - } - if (paymentResponse.AdditionalDataOption.IsSet) - { - writer.WritePropertyName("additionalData"); - JsonSerializer.Serialize(writer, paymentResponse.AdditionalData, jsonSerializerOptions); - } - if (paymentResponse.AmountOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, paymentResponse.Amount, jsonSerializerOptions); - } - if (paymentResponse.DonationTokenOption.IsSet) - writer.WriteString("donationToken", paymentResponse.DonationToken); - - if (paymentResponse.FraudResultOption.IsSet) - { - writer.WritePropertyName("fraudResult"); - JsonSerializer.Serialize(writer, paymentResponse.FraudResult, jsonSerializerOptions); - } - if (paymentResponse.MerchantReferenceOption.IsSet) - writer.WriteString("merchantReference", paymentResponse.MerchantReference); - - if (paymentResponse.OrderOption.IsSet) - { - writer.WritePropertyName("order"); - JsonSerializer.Serialize(writer, paymentResponse.Order, jsonSerializerOptions); - } - if (paymentResponse.PaymentMethodOption.IsSet) - { - writer.WritePropertyName("paymentMethod"); - JsonSerializer.Serialize(writer, paymentResponse.PaymentMethod, jsonSerializerOptions); - } - if (paymentResponse.PspReferenceOption.IsSet) - writer.WriteString("pspReference", paymentResponse.PspReference); - - if (paymentResponse.RefusalReasonOption.IsSet) - writer.WriteString("refusalReason", paymentResponse.RefusalReason); - - if (paymentResponse.RefusalReasonCodeOption.IsSet) - writer.WriteString("refusalReasonCode", paymentResponse.RefusalReasonCode); - - var resultCodeRawValue = PaymentResponse.ResultCodeEnumToJsonValue(paymentResponse.ResultCodeOption.Value.Value); - writer.WriteString("resultCode", resultCodeRawValue); - if (paymentResponse.ThreeDS2ResponseDataOption.IsSet) - { - writer.WritePropertyName("threeDS2ResponseData"); - JsonSerializer.Serialize(writer, paymentResponse.ThreeDS2ResponseData, jsonSerializerOptions); - } - if (paymentResponse.ThreeDS2ResultOption.IsSet) - { - writer.WritePropertyName("threeDS2Result"); - JsonSerializer.Serialize(writer, paymentResponse.ThreeDS2Result, jsonSerializerOptions); + int hashCode = 41; + if (this.Action != null) + { + hashCode = (hashCode * 59) + this.Action.GetHashCode(); + } + if (this.AdditionalData != null) + { + hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.DonationToken != null) + { + hashCode = (hashCode * 59) + this.DonationToken.GetHashCode(); + } + if (this.FraudResult != null) + { + hashCode = (hashCode * 59) + this.FraudResult.GetHashCode(); + } + if (this.MerchantReference != null) + { + hashCode = (hashCode * 59) + this.MerchantReference.GetHashCode(); + } + if (this.Order != null) + { + hashCode = (hashCode * 59) + this.Order.GetHashCode(); + } + if (this.PaymentMethod != null) + { + hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + if (this.RefusalReason != null) + { + hashCode = (hashCode * 59) + this.RefusalReason.GetHashCode(); + } + if (this.RefusalReasonCode != null) + { + hashCode = (hashCode * 59) + this.RefusalReasonCode.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ResultCode.GetHashCode(); + if (this.ThreeDS2ResponseData != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2ResponseData.GetHashCode(); + } + if (this.ThreeDS2Result != null) + { + hashCode = (hashCode * 59) + this.ThreeDS2Result.GetHashCode(); + } + if (this.ThreeDSPaymentData != null) + { + hashCode = (hashCode * 59) + this.ThreeDSPaymentData.GetHashCode(); + } + return hashCode; } - if (paymentResponse.ThreeDSPaymentDataOption.IsSet) - writer.WriteString("threeDSPaymentData", paymentResponse.ThreeDSPaymentData); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentResponseAction.cs b/Adyen/Model/Checkout/PaymentResponseAction.cs index 0ca79dcf6..9069a7e40 100644 --- a/Adyen/Model/Checkout/PaymentResponseAction.cs +++ b/Adyen/Model/Checkout/PaymentResponseAction.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,156 +15,279 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; +using System.Reflection; namespace Adyen.Model.Checkout { /// /// Action to be taken for completing the payment. /// - public partial class PaymentResponseAction : IValidatableObject + [JsonConverter(typeof(PaymentResponseActionJsonConverter))] + [DataContract(Name = "PaymentResponse_action")] + public partial class PaymentResponseAction : AbstractOpenAPISchema, IEquatable, IValidatableObject { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public PaymentResponseAction(CheckoutAwaitAction checkoutAwaitAction) + /// An instance of CheckoutAwaitAction. + public PaymentResponseAction(CheckoutAwaitAction actualInstance) { - CheckoutAwaitAction = checkoutAwaitAction; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public PaymentResponseAction(CheckoutBankTransferAction checkoutBankTransferAction) + /// An instance of CheckoutBankTransferAction. + public PaymentResponseAction(CheckoutBankTransferAction actualInstance) { - CheckoutBankTransferAction = checkoutBankTransferAction; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public PaymentResponseAction(CheckoutDelegatedAuthenticationAction checkoutDelegatedAuthenticationAction) + /// An instance of CheckoutDelegatedAuthenticationAction. + public PaymentResponseAction(CheckoutDelegatedAuthenticationAction actualInstance) { - CheckoutDelegatedAuthenticationAction = checkoutDelegatedAuthenticationAction; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public PaymentResponseAction(CheckoutNativeRedirectAction checkoutNativeRedirectAction) + /// An instance of CheckoutNativeRedirectAction. + public PaymentResponseAction(CheckoutNativeRedirectAction actualInstance) { - CheckoutNativeRedirectAction = checkoutNativeRedirectAction; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public PaymentResponseAction(CheckoutQrCodeAction checkoutQrCodeAction) + /// An instance of CheckoutQrCodeAction. + public PaymentResponseAction(CheckoutQrCodeAction actualInstance) { - CheckoutQrCodeAction = checkoutQrCodeAction; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public PaymentResponseAction(CheckoutRedirectAction checkoutRedirectAction) + /// An instance of CheckoutRedirectAction. + public PaymentResponseAction(CheckoutRedirectAction actualInstance) { - CheckoutRedirectAction = checkoutRedirectAction; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public PaymentResponseAction(CheckoutSDKAction checkoutSDKAction) + /// An instance of CheckoutSDKAction. + public PaymentResponseAction(CheckoutSDKAction actualInstance) { - CheckoutSDKAction = checkoutSDKAction; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public PaymentResponseAction(CheckoutThreeDS2Action checkoutThreeDS2Action) + /// An instance of CheckoutThreeDS2Action. + public PaymentResponseAction(CheckoutThreeDS2Action actualInstance) { - CheckoutThreeDS2Action = checkoutThreeDS2Action; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// with the class /// - /// - public PaymentResponseAction(CheckoutVoucherAction checkoutVoucherAction) + /// An instance of CheckoutVoucherAction. + public PaymentResponseAction(CheckoutVoucherAction actualInstance) { - CheckoutVoucherAction = checkoutVoucherAction; - OnCreated(); + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } - partial void OnCreated(); + + private Object _actualInstance; /// - /// Gets or Sets CheckoutAwaitAction + /// Gets or Sets ActualInstance /// - public CheckoutAwaitAction CheckoutAwaitAction { get; set; } + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(CheckoutAwaitAction)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(CheckoutBankTransferAction)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(CheckoutDelegatedAuthenticationAction)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(CheckoutNativeRedirectAction)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(CheckoutQrCodeAction)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(CheckoutRedirectAction)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(CheckoutSDKAction)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(CheckoutThreeDS2Action)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(CheckoutVoucherAction)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: CheckoutAwaitAction, CheckoutBankTransferAction, CheckoutDelegatedAuthenticationAction, CheckoutNativeRedirectAction, CheckoutQrCodeAction, CheckoutRedirectAction, CheckoutSDKAction, CheckoutThreeDS2Action, CheckoutVoucherAction"); + } + } + } /// - /// Gets or Sets CheckoutBankTransferAction + /// Get the actual instance of `CheckoutAwaitAction`. If the actual instance is not `CheckoutAwaitAction`, + /// the InvalidClassException will be thrown /// - public CheckoutBankTransferAction CheckoutBankTransferAction { get; set; } + /// An instance of CheckoutAwaitAction + public CheckoutAwaitAction GetCheckoutAwaitAction() + { + return (CheckoutAwaitAction)this.ActualInstance; + } /// - /// Gets or Sets CheckoutDelegatedAuthenticationAction + /// Get the actual instance of `CheckoutBankTransferAction`. If the actual instance is not `CheckoutBankTransferAction`, + /// the InvalidClassException will be thrown /// - public CheckoutDelegatedAuthenticationAction CheckoutDelegatedAuthenticationAction { get; set; } + /// An instance of CheckoutBankTransferAction + public CheckoutBankTransferAction GetCheckoutBankTransferAction() + { + return (CheckoutBankTransferAction)this.ActualInstance; + } /// - /// Gets or Sets CheckoutNativeRedirectAction + /// Get the actual instance of `CheckoutDelegatedAuthenticationAction`. If the actual instance is not `CheckoutDelegatedAuthenticationAction`, + /// the InvalidClassException will be thrown /// - public CheckoutNativeRedirectAction CheckoutNativeRedirectAction { get; set; } + /// An instance of CheckoutDelegatedAuthenticationAction + public CheckoutDelegatedAuthenticationAction GetCheckoutDelegatedAuthenticationAction() + { + return (CheckoutDelegatedAuthenticationAction)this.ActualInstance; + } /// - /// Gets or Sets CheckoutQrCodeAction + /// Get the actual instance of `CheckoutNativeRedirectAction`. If the actual instance is not `CheckoutNativeRedirectAction`, + /// the InvalidClassException will be thrown /// - public CheckoutQrCodeAction CheckoutQrCodeAction { get; set; } + /// An instance of CheckoutNativeRedirectAction + public CheckoutNativeRedirectAction GetCheckoutNativeRedirectAction() + { + return (CheckoutNativeRedirectAction)this.ActualInstance; + } /// - /// Gets or Sets CheckoutRedirectAction + /// Get the actual instance of `CheckoutQrCodeAction`. If the actual instance is not `CheckoutQrCodeAction`, + /// the InvalidClassException will be thrown /// - public CheckoutRedirectAction CheckoutRedirectAction { get; set; } + /// An instance of CheckoutQrCodeAction + public CheckoutQrCodeAction GetCheckoutQrCodeAction() + { + return (CheckoutQrCodeAction)this.ActualInstance; + } /// - /// Gets or Sets CheckoutSDKAction + /// Get the actual instance of `CheckoutRedirectAction`. If the actual instance is not `CheckoutRedirectAction`, + /// the InvalidClassException will be thrown /// - public CheckoutSDKAction CheckoutSDKAction { get; set; } + /// An instance of CheckoutRedirectAction + public CheckoutRedirectAction GetCheckoutRedirectAction() + { + return (CheckoutRedirectAction)this.ActualInstance; + } /// - /// Gets or Sets CheckoutThreeDS2Action + /// Get the actual instance of `CheckoutSDKAction`. If the actual instance is not `CheckoutSDKAction`, + /// the InvalidClassException will be thrown /// - public CheckoutThreeDS2Action CheckoutThreeDS2Action { get; set; } + /// An instance of CheckoutSDKAction + public CheckoutSDKAction GetCheckoutSDKAction() + { + return (CheckoutSDKAction)this.ActualInstance; + } /// - /// Gets or Sets CheckoutVoucherAction + /// Get the actual instance of `CheckoutThreeDS2Action`. If the actual instance is not `CheckoutThreeDS2Action`, + /// the InvalidClassException will be thrown /// - public CheckoutVoucherAction CheckoutVoucherAction { get; set; } + /// An instance of CheckoutThreeDS2Action + public CheckoutThreeDS2Action GetCheckoutThreeDS2Action() + { + return (CheckoutThreeDS2Action)this.ActualInstance; + } + + /// + /// Get the actual instance of `CheckoutVoucherAction`. If the actual instance is not `CheckoutVoucherAction`, + /// the InvalidClassException will be thrown + /// + /// An instance of CheckoutVoucherAction + public CheckoutVoucherAction GetCheckoutVoucherAction() + { + return (CheckoutVoucherAction)this.ActualInstance; + } /// /// Returns the string presentation of the object @@ -171,171 +295,218 @@ public PaymentResponseAction(CheckoutVoucherAction checkoutVoucherAction) /// String presentation of the object public override string ToString() { - StringBuilder sb = new StringBuilder(); + var sb = new StringBuilder(); sb.Append("class PaymentResponseAction {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public override string ToJson() { - yield break; + return JsonConvert.SerializeObject(this.ActualInstance, PaymentResponseAction.SerializerSettings); } - } - /// - /// A Json converter for type - /// - public class PaymentResponseActionJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Converts the JSON string into an instance of PaymentResponseAction /// - /// - /// - /// - /// - /// - public override PaymentResponseAction Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// JSON string + /// An instance of PaymentResponseAction + public static PaymentResponseAction FromJson(string jsonString) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - CheckoutAwaitAction checkoutAwaitAction = default; - CheckoutBankTransferAction checkoutBankTransferAction = default; - CheckoutDelegatedAuthenticationAction checkoutDelegatedAuthenticationAction = default; - CheckoutNativeRedirectAction checkoutNativeRedirectAction = default; - CheckoutQrCodeAction checkoutQrCodeAction = default; - CheckoutRedirectAction checkoutRedirectAction = default; - CheckoutSDKAction checkoutSDKAction = default; - CheckoutThreeDS2Action checkoutThreeDS2Action = default; - CheckoutVoucherAction checkoutVoucherAction = default; + PaymentResponseAction newPaymentResponseAction = null; - Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; - while (utf8JsonReaderOneOf.Read()) + if (string.IsNullOrEmpty(jsonString)) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) - break; - - if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + return newPaymentResponseAction; + } + int match = 0; + List matchedTypes = new List(); + JToken typeToken = JObject.Parse(jsonString).GetValue("type"); + string type = typeToken?.Value(); + // Throw exception if jsonString does not contain type param + if (type == null) + { + throw new InvalidDataException("JsonString does not contain required enum type for deserialization."); + } + try + { + // Check if the jsonString type enum matches the CheckoutAwaitAction type enums + if (ContainsValue(type)) { - Utf8JsonReader utf8JsonReaderCheckoutAwaitAction = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutAwaitAction, jsonSerializerOptions, out checkoutAwaitAction); - - Utf8JsonReader utf8JsonReaderCheckoutBankTransferAction = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutBankTransferAction, jsonSerializerOptions, out checkoutBankTransferAction); - - Utf8JsonReader utf8JsonReaderCheckoutDelegatedAuthenticationAction = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutDelegatedAuthenticationAction, jsonSerializerOptions, out checkoutDelegatedAuthenticationAction); - - Utf8JsonReader utf8JsonReaderCheckoutNativeRedirectAction = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutNativeRedirectAction, jsonSerializerOptions, out checkoutNativeRedirectAction); - - Utf8JsonReader utf8JsonReaderCheckoutQrCodeAction = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutQrCodeAction, jsonSerializerOptions, out checkoutQrCodeAction); - - Utf8JsonReader utf8JsonReaderCheckoutRedirectAction = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutRedirectAction, jsonSerializerOptions, out checkoutRedirectAction); - - Utf8JsonReader utf8JsonReaderCheckoutSDKAction = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutSDKAction, jsonSerializerOptions, out checkoutSDKAction); - - Utf8JsonReader utf8JsonReaderCheckoutThreeDS2Action = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutThreeDS2Action, jsonSerializerOptions, out checkoutThreeDS2Action); - - Utf8JsonReader utf8JsonReaderCheckoutVoucherAction = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderCheckoutVoucherAction, jsonSerializerOptions, out checkoutVoucherAction); + newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); + matchedTypes.Add("CheckoutAwaitAction"); + match++; } - } - - while (utf8JsonReader.Read()) + // Check if the jsonString type enum matches the CheckoutBankTransferAction type enums + if (ContainsValue(type)) + { + newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); + matchedTypes.Add("CheckoutBankTransferAction"); + match++; + } + // Check if the jsonString type enum matches the CheckoutDelegatedAuthenticationAction type enums + if (ContainsValue(type)) + { + newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); + matchedTypes.Add("CheckoutDelegatedAuthenticationAction"); + match++; + } + // Check if the jsonString type enum matches the CheckoutNativeRedirectAction type enums + if (ContainsValue(type)) + { + newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); + matchedTypes.Add("CheckoutNativeRedirectAction"); + match++; + } + // Check if the jsonString type enum matches the CheckoutQrCodeAction type enums + if (ContainsValue(type)) + { + newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); + matchedTypes.Add("CheckoutQrCodeAction"); + match++; + } + // Check if the jsonString type enum matches the CheckoutRedirectAction type enums + if (ContainsValue(type)) + { + newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); + matchedTypes.Add("CheckoutRedirectAction"); + match++; + } + // Check if the jsonString type enum matches the CheckoutSDKAction type enums + if (ContainsValue(type)) + { + newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); + matchedTypes.Add("CheckoutSDKAction"); + match++; + } + // Check if the jsonString type enum matches the CheckoutThreeDS2Action type enums + if (ContainsValue(type)) + { + newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); + matchedTypes.Add("CheckoutThreeDS2Action"); + match++; + } + // Check if the jsonString type enum matches the CheckoutVoucherAction type enums + if (ContainsValue(type)) + { + newPaymentResponseAction = new PaymentResponseAction(JsonConvert.DeserializeObject(jsonString, PaymentResponseAction.SerializerSettings)); + matchedTypes.Add("CheckoutVoucherAction"); + match++; + } + } + catch (Exception ex) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + if (!(ex is JsonSerializationException)) { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - default: - break; - } + throw new InvalidDataException(string.Format("Failed to deserialize `{0}` into target: {1}", jsonString, ex.ToString())); } } - if (checkoutAwaitAction != null) - return new PaymentResponseAction(checkoutAwaitAction); - - if (checkoutBankTransferAction != null) - return new PaymentResponseAction(checkoutBankTransferAction); - - if (checkoutDelegatedAuthenticationAction != null) - return new PaymentResponseAction(checkoutDelegatedAuthenticationAction); - - if (checkoutNativeRedirectAction != null) - return new PaymentResponseAction(checkoutNativeRedirectAction); - - if (checkoutQrCodeAction != null) - return new PaymentResponseAction(checkoutQrCodeAction); - - if (checkoutRedirectAction != null) - return new PaymentResponseAction(checkoutRedirectAction); + if (match != 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined. MatchedTypes are: " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newPaymentResponseAction; + } - if (checkoutSDKAction != null) - return new PaymentResponseAction(checkoutSDKAction); + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PaymentResponseAction); + } - if (checkoutThreeDS2Action != null) - return new PaymentResponseAction(checkoutThreeDS2Action); + /// + /// Returns true if PaymentResponseAction instances are equal + /// + /// Instance of PaymentResponseAction to be compared + /// Boolean + public bool Equals(PaymentResponseAction input) + { + if (input == null) + return false; - if (checkoutVoucherAction != null) - return new PaymentResponseAction(checkoutVoucherAction); + return this.ActualInstance.Equals(input.ActualInstance); + } - throw new JsonException(); + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } } /// - /// Serializes a + /// To validate all properties of the instance /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentResponseAction paymentResponseAction, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - writer.WriteStartObject(); + yield break; + } + } - WriteProperties(writer, paymentResponseAction, jsonSerializerOptions); - writer.WriteEndObject(); + /// + /// Custom JSON converter for PaymentResponseAction + /// + public class PaymentResponseActionJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(PaymentResponseAction).GetMethod("ToJson").Invoke(value, null))); } /// - /// Serializes the properties of + /// To convert a JSON string into an object /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentResponseAction paymentResponseAction, JsonSerializerOptions jsonSerializerOptions) + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { + if(reader.TokenType != JsonToken.Null) + { + return PaymentResponseAction.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; } } + } diff --git a/Adyen/Model/Checkout/PaymentReversalRequest.cs b/Adyen/Model/Checkout/PaymentReversalRequest.cs index d10b92064..7202748ad 100644 --- a/Adyen/Model/Checkout/PaymentReversalRequest.cs +++ b/Adyen/Model/Checkout/PaymentReversalRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,70 +15,68 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentReversalRequest /// - public partial class PaymentReversalRequest : IValidatableObject + [DataContract(Name = "PaymentReversalRequest")] + public partial class PaymentReversalRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The merchant account that is used to process the payment. - /// applicationInfo - /// Your reference for the reversal request. Maximum length: 80 characters. - [JsonConstructor] - public PaymentReversalRequest(string merchantAccount, Option applicationInfo = default, Option reference = default) - { - MerchantAccount = merchantAccount; - ApplicationInfoOption = applicationInfo; - ReferenceOption = reference; - OnCreated(); - } - - partial void OnCreated(); - + [JsonConstructorAttribute] + protected PaymentReversalRequest() { } /// - /// The merchant account that is used to process the payment. + /// Initializes a new instance of the class. /// - /// The merchant account that is used to process the payment. - [JsonPropertyName("merchantAccount")] - public string MerchantAccount { get; set; } + /// applicationInfo. + /// enhancedSchemeData. + /// The merchant account that is used to process the payment. (required). + /// Your reference for the reversal request. Maximum length: 80 characters.. + public PaymentReversalRequest(ApplicationInfo applicationInfo = default(ApplicationInfo), EnhancedSchemeData enhancedSchemeData = default(EnhancedSchemeData), string merchantAccount = default(string), string reference = default(string)) + { + this.MerchantAccount = merchantAccount; + this.ApplicationInfo = applicationInfo; + this.EnhancedSchemeData = enhancedSchemeData; + this.Reference = reference; + } /// - /// Used to track the state of ApplicationInfo + /// Gets or Sets ApplicationInfo /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ApplicationInfoOption { get; private set; } + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } /// - /// Gets or Sets ApplicationInfo + /// Gets or Sets EnhancedSchemeData /// - [JsonPropertyName("applicationInfo")] - public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } + [DataMember(Name = "enhancedSchemeData", EmitDefaultValue = false)] + public EnhancedSchemeData EnhancedSchemeData { get; set; } /// - /// Used to track the state of Reference + /// The merchant account that is used to process the payment. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + /// The merchant account that is used to process the payment. + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] + public string MerchantAccount { get; set; } /// /// Your reference for the reversal request. Maximum length: 80 characters. /// /// Your reference for the reversal request. Maximum length: 80 characters. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Returns the string presentation of the object @@ -87,138 +86,104 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PaymentReversalRequest {\n"); - sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); + sb.Append(" EnhancedSchemeData: ").Append(EnhancedSchemeData).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentReversalRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentReversalRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option merchantAccount = default; - Option applicationInfo = default; - Option reference = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "applicationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentReversalRequest.", nameof(merchantAccount)); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentReversalRequest."); - - if (applicationInfo.IsSet && applicationInfo.Value == null) - throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class PaymentReversalRequest."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentReversalRequest."); - - return new PaymentReversalRequest(merchantAccount.Value, applicationInfo, reference); + return this.Equals(input as PaymentReversalRequest); } /// - /// Serializes a + /// Returns true if PaymentReversalRequest instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentReversalRequest paymentReversalRequest, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaymentReversalRequest to be compared + /// Boolean + public bool Equals(PaymentReversalRequest input) { - writer.WriteStartObject(); - - WriteProperties(writer, paymentReversalRequest, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.ApplicationInfo == input.ApplicationInfo || + (this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo)) + ) && + ( + this.EnhancedSchemeData == input.EnhancedSchemeData || + (this.EnhancedSchemeData != null && + this.EnhancedSchemeData.Equals(input.EnhancedSchemeData)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentReversalRequest paymentReversalRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paymentReversalRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentReversalRequest.MerchantAccount), "Property is required for class PaymentReversalRequest."); - - if (paymentReversalRequest.ApplicationInfoOption.IsSet && paymentReversalRequest.ApplicationInfo == null) - throw new ArgumentNullException(nameof(paymentReversalRequest.ApplicationInfo), "Property is required for class PaymentReversalRequest."); - - if (paymentReversalRequest.ReferenceOption.IsSet && paymentReversalRequest.Reference == null) - throw new ArgumentNullException(nameof(paymentReversalRequest.Reference), "Property is required for class PaymentReversalRequest."); - - writer.WriteString("merchantAccount", paymentReversalRequest.MerchantAccount); - - if (paymentReversalRequest.ApplicationInfoOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("applicationInfo"); - JsonSerializer.Serialize(writer, paymentReversalRequest.ApplicationInfo, jsonSerializerOptions); + int hashCode = 41; + if (this.ApplicationInfo != null) + { + hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); + } + if (this.EnhancedSchemeData != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeData.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + return hashCode; } - if (paymentReversalRequest.ReferenceOption.IsSet) - writer.WriteString("reference", paymentReversalRequest.Reference); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaymentReversalResponse.cs b/Adyen/Model/Checkout/PaymentReversalResponse.cs index b33d2c68d..b3d5f5be3 100644 --- a/Adyen/Model/Checkout/PaymentReversalResponse.cs +++ b/Adyen/Model/Checkout/PaymentReversalResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,135 +15,94 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaymentReversalResponse /// - public partial class PaymentReversalResponse : IValidatableObject + [DataContract(Name = "PaymentReversalResponse")] + public partial class PaymentReversalResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The merchant account that is used to process the payment. - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. - /// Adyen's 16-character reference associated with the reversal request. - /// The status of your request. This will always have the value **received**. - /// Your reference for the reversal request. - [JsonConstructor] - public PaymentReversalResponse(string merchantAccount, string paymentPspReference, string pspReference, StatusEnum status, Option reference = default) - { - MerchantAccount = merchantAccount; - PaymentPspReference = paymentPspReference; - PspReference = pspReference; - Status = status; - ReferenceOption = reference; - OnCreated(); - } - - partial void OnCreated(); - /// /// The status of your request. This will always have the value **received**. /// /// The status of your request. This will always have the value **received**. + [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Received for value: received /// + [EnumMember(Value = "received")] Received = 1 + } + /// - /// Returns a + /// The status of your request. This will always have the value **received**. /// - /// - /// - /// - public static StatusEnum StatusEnumFromString(string value) - { - if (value.Equals("received")) - return StatusEnum.Received; - - throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); - } - + /// The status of your request. This will always have the value **received**. + [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] + public StatusEnum Status { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static StatusEnum? StatusEnumFromStringOrDefault(string value) - { - if (value.Equals("received")) - return StatusEnum.Received; - - return null; - } - + [JsonConstructorAttribute] + protected PaymentReversalResponse() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string StatusEnumToJsonValue(StatusEnum value) + /// The merchant account that is used to process the payment. (required). + /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. (required). + /// Adyen's 16-character reference associated with the reversal request. (required). + /// Your reference for the reversal request.. + /// The status of your request. This will always have the value **received**. (required). + public PaymentReversalResponse(string merchantAccount = default(string), string paymentPspReference = default(string), string pspReference = default(string), string reference = default(string), StatusEnum status = default(StatusEnum)) { - if (value == StatusEnum.Received) - return "received"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.MerchantAccount = merchantAccount; + this.PaymentPspReference = paymentPspReference; + this.PspReference = pspReference; + this.Status = status; + this.Reference = reference; } - /// - /// The status of your request. This will always have the value **received**. - /// - /// The status of your request. This will always have the value **received**. - [JsonPropertyName("status")] - public StatusEnum Status { get; set; } - /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [JsonPropertyName("merchantAccount")] + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] public string MerchantAccount { get; set; } /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. /// /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to reverse. - [JsonPropertyName("paymentPspReference")] + [DataMember(Name = "paymentPspReference", IsRequired = false, EmitDefaultValue = false)] public string PaymentPspReference { get; set; } /// /// Adyen's 16-character reference associated with the reversal request. /// /// Adyen's 16-character reference associated with the reversal request. - [JsonPropertyName("pspReference")] + [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] public string PspReference { get; set; } - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } - /// /// Your reference for the reversal request. /// /// Your reference for the reversal request. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Returns the string presentation of the object @@ -155,165 +115,107 @@ public override string ToString() sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentPspReference: ").Append(PaymentPspReference).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaymentReversalResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaymentReversalResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option merchantAccount = default; - Option paymentPspReference = default; - Option pspReference = default; - Option status = default; - Option reference = default; + return this.Equals(input as PaymentReversalResponse); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PaymentReversalResponse instances are equal + /// + /// Instance of PaymentReversalResponse to be compared + /// Boolean + public bool Equals(PaymentReversalResponse input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "paymentPspReference": - paymentPspReference = new Option(utf8JsonReader.GetString()); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "status": - string statusRawValue = utf8JsonReader.GetString(); - if (statusRawValue != null) - status = new Option(PaymentReversalResponse.StatusEnumFromStringOrDefault(statusRawValue)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class PaymentReversalResponse.", nameof(merchantAccount)); - - if (!paymentPspReference.IsSet) - throw new ArgumentException("Property is required for class PaymentReversalResponse.", nameof(paymentPspReference)); - - if (!pspReference.IsSet) - throw new ArgumentException("Property is required for class PaymentReversalResponse.", nameof(pspReference)); - - if (!status.IsSet) - throw new ArgumentException("Property is required for class PaymentReversalResponse.", nameof(status)); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class PaymentReversalResponse."); - - if (paymentPspReference.IsSet && paymentPspReference.Value == null) - throw new ArgumentNullException(nameof(paymentPspReference), "Property is not nullable for class PaymentReversalResponse."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaymentReversalResponse."); - - if (status.IsSet && status.Value == null) - throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaymentReversalResponse."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class PaymentReversalResponse."); - - return new PaymentReversalResponse(merchantAccount.Value, paymentPspReference.Value, pspReference.Value, status.Value.Value, reference); + return + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.PaymentPspReference == input.PaymentPspReference || + (this.PaymentPspReference != null && + this.PaymentPspReference.Equals(input.PaymentPspReference)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaymentReversalResponse paymentReversalResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, paymentReversalResponse, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.PaymentPspReference != null) + { + hashCode = (hashCode * 59) + this.PaymentPspReference.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaymentReversalResponse paymentReversalResponse, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (paymentReversalResponse.MerchantAccount == null) - throw new ArgumentNullException(nameof(paymentReversalResponse.MerchantAccount), "Property is required for class PaymentReversalResponse."); - - if (paymentReversalResponse.PaymentPspReference == null) - throw new ArgumentNullException(nameof(paymentReversalResponse.PaymentPspReference), "Property is required for class PaymentReversalResponse."); - - if (paymentReversalResponse.PspReference == null) - throw new ArgumentNullException(nameof(paymentReversalResponse.PspReference), "Property is required for class PaymentReversalResponse."); - - if (paymentReversalResponse.ReferenceOption.IsSet && paymentReversalResponse.Reference == null) - throw new ArgumentNullException(nameof(paymentReversalResponse.Reference), "Property is required for class PaymentReversalResponse."); - - writer.WriteString("merchantAccount", paymentReversalResponse.MerchantAccount); - - writer.WriteString("paymentPspReference", paymentReversalResponse.PaymentPspReference); - - writer.WriteString("pspReference", paymentReversalResponse.PspReference); - - var statusRawValue = PaymentReversalResponse.StatusEnumToJsonValue(paymentReversalResponse.Status); - writer.WriteString("status", statusRawValue); - if (paymentReversalResponse.ReferenceOption.IsSet) - writer.WriteString("reference", paymentReversalResponse.Reference); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs b/Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs index 56d51b68b..3ef2ab0e2 100644 --- a/Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs +++ b/Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,124 +15,81 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaypalUpdateOrderRequest /// - public partial class PaypalUpdateOrderRequest : IValidatableObject + [DataContract(Name = "PaypalUpdateOrderRequest")] + public partial class PaypalUpdateOrderRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// amount - /// The list of new delivery methods and the cost of each. - /// The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request. - /// The original `pspReference` from the `/payments` response. - /// The original `sessionId` from the `/sessions` response. - /// taxTotal - [JsonConstructor] - public PaypalUpdateOrderRequest(Option amount = default, Option> deliveryMethods = default, Option paymentData = default, Option pspReference = default, Option sessionId = default, Option taxTotal = default) + /// amount. + /// The list of new delivery methods and the cost of each.. + /// The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request.. + /// The original `pspReference` from the `/payments` response.. + /// The original `sessionId` from the `/sessions` response.. + /// taxTotal. + public PaypalUpdateOrderRequest(Amount amount = default(Amount), List deliveryMethods = default(List), string paymentData = default(string), string pspReference = default(string), string sessionId = default(string), TaxTotal taxTotal = default(TaxTotal)) { - AmountOption = amount; - DeliveryMethodsOption = deliveryMethods; - PaymentDataOption = paymentData; - PspReferenceOption = pspReference; - SessionIdOption = sessionId; - TaxTotalOption = taxTotal; - OnCreated(); + this.Amount = amount; + this.DeliveryMethods = deliveryMethods; + this.PaymentData = paymentData; + this.PspReference = pspReference; + this.SessionId = sessionId; + this.TaxTotal = taxTotal; } - partial void OnCreated(); - - /// - /// Used to track the state of Amount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountOption { get; private set; } - /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] - public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryMethods - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> DeliveryMethodsOption { get; private set; } + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// The list of new delivery methods and the cost of each. /// /// The list of new delivery methods and the cost of each. - [JsonPropertyName("deliveryMethods")] - public List DeliveryMethods { get { return this.DeliveryMethodsOption; } set { this.DeliveryMethodsOption = new Option>(value); } } - - /// - /// Used to track the state of PaymentData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentDataOption { get; private set; } + [DataMember(Name = "deliveryMethods", EmitDefaultValue = false)] + public List DeliveryMethods { get; set; } /// /// The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request. /// /// The `paymentData` from the client side. This value changes every time you make a `/paypal/updateOrder` request. - [JsonPropertyName("paymentData")] - public string PaymentData { get { return this.PaymentDataOption; } set { this.PaymentDataOption = new Option(value); } } - - /// - /// Used to track the state of PspReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PspReferenceOption { get; private set; } + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } /// /// The original `pspReference` from the `/payments` response. /// /// The original `pspReference` from the `/payments` response. - [JsonPropertyName("pspReference")] - public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } - - /// - /// Used to track the state of SessionId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SessionIdOption { get; private set; } + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + public string PspReference { get; set; } /// /// The original `sessionId` from the `/sessions` response. /// /// The original `sessionId` from the `/sessions` response. - [JsonPropertyName("sessionId")] - public string SessionId { get { return this.SessionIdOption; } set { this.SessionIdOption = new Option(value); } } - - /// - /// Used to track the state of TaxTotal - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TaxTotalOption { get; private set; } + [DataMember(Name = "sessionId", EmitDefaultValue = false)] + public string SessionId { get; set; } /// /// Gets or Sets TaxTotal /// - [JsonPropertyName("taxTotal")] - public TaxTotal TaxTotal { get { return this.TaxTotalOption; } set { this.TaxTotalOption = new Option(value); } } + [DataMember(Name = "taxTotal", EmitDefaultValue = false)] + public TaxTotal TaxTotal { get; set; } /// /// Returns the string presentation of the object @@ -152,174 +110,114 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaypalUpdateOrderRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaypalUpdateOrderRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - Option> deliveryMethods = default; - Option paymentData = default; - Option pspReference = default; - Option sessionId = default; - Option taxTotal = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "deliveryMethods": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deliveryMethods = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "paymentData": - paymentData = new Option(utf8JsonReader.GetString()); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "sessionId": - sessionId = new Option(utf8JsonReader.GetString()); - break; - case "taxTotal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - taxTotal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class PaypalUpdateOrderRequest."); - - if (deliveryMethods.IsSet && deliveryMethods.Value == null) - throw new ArgumentNullException(nameof(deliveryMethods), "Property is not nullable for class PaypalUpdateOrderRequest."); - - if (paymentData.IsSet && paymentData.Value == null) - throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class PaypalUpdateOrderRequest."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class PaypalUpdateOrderRequest."); - - if (sessionId.IsSet && sessionId.Value == null) - throw new ArgumentNullException(nameof(sessionId), "Property is not nullable for class PaypalUpdateOrderRequest."); - - if (taxTotal.IsSet && taxTotal.Value == null) - throw new ArgumentNullException(nameof(taxTotal), "Property is not nullable for class PaypalUpdateOrderRequest."); - - return new PaypalUpdateOrderRequest(amount, deliveryMethods, paymentData, pspReference, sessionId, taxTotal); + return this.Equals(input as PaypalUpdateOrderRequest); } /// - /// Serializes a + /// Returns true if PaypalUpdateOrderRequest instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaypalUpdateOrderRequest paypalUpdateOrderRequest, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PaypalUpdateOrderRequest to be compared + /// Boolean + public bool Equals(PaypalUpdateOrderRequest input) { - writer.WriteStartObject(); - - WriteProperties(writer, paypalUpdateOrderRequest, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.DeliveryMethods == input.DeliveryMethods || + this.DeliveryMethods != null && + input.DeliveryMethods != null && + this.DeliveryMethods.SequenceEqual(input.DeliveryMethods) + ) && + ( + this.PaymentData == input.PaymentData || + (this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.SessionId == input.SessionId || + (this.SessionId != null && + this.SessionId.Equals(input.SessionId)) + ) && + ( + this.TaxTotal == input.TaxTotal || + (this.TaxTotal != null && + this.TaxTotal.Equals(input.TaxTotal)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaypalUpdateOrderRequest paypalUpdateOrderRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (paypalUpdateOrderRequest.AmountOption.IsSet && paypalUpdateOrderRequest.Amount == null) - throw new ArgumentNullException(nameof(paypalUpdateOrderRequest.Amount), "Property is required for class PaypalUpdateOrderRequest."); - - if (paypalUpdateOrderRequest.DeliveryMethodsOption.IsSet && paypalUpdateOrderRequest.DeliveryMethods == null) - throw new ArgumentNullException(nameof(paypalUpdateOrderRequest.DeliveryMethods), "Property is required for class PaypalUpdateOrderRequest."); - - if (paypalUpdateOrderRequest.PaymentDataOption.IsSet && paypalUpdateOrderRequest.PaymentData == null) - throw new ArgumentNullException(nameof(paypalUpdateOrderRequest.PaymentData), "Property is required for class PaypalUpdateOrderRequest."); - - if (paypalUpdateOrderRequest.PspReferenceOption.IsSet && paypalUpdateOrderRequest.PspReference == null) - throw new ArgumentNullException(nameof(paypalUpdateOrderRequest.PspReference), "Property is required for class PaypalUpdateOrderRequest."); - - if (paypalUpdateOrderRequest.SessionIdOption.IsSet && paypalUpdateOrderRequest.SessionId == null) - throw new ArgumentNullException(nameof(paypalUpdateOrderRequest.SessionId), "Property is required for class PaypalUpdateOrderRequest."); - - if (paypalUpdateOrderRequest.TaxTotalOption.IsSet && paypalUpdateOrderRequest.TaxTotal == null) - throw new ArgumentNullException(nameof(paypalUpdateOrderRequest.TaxTotal), "Property is required for class PaypalUpdateOrderRequest."); - - if (paypalUpdateOrderRequest.AmountOption.IsSet) - { - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, paypalUpdateOrderRequest.Amount, jsonSerializerOptions); - } - if (paypalUpdateOrderRequest.DeliveryMethodsOption.IsSet) - { - writer.WritePropertyName("deliveryMethods"); - JsonSerializer.Serialize(writer, paypalUpdateOrderRequest.DeliveryMethods, jsonSerializerOptions); - } - if (paypalUpdateOrderRequest.PaymentDataOption.IsSet) - writer.WriteString("paymentData", paypalUpdateOrderRequest.PaymentData); - - if (paypalUpdateOrderRequest.PspReferenceOption.IsSet) - writer.WriteString("pspReference", paypalUpdateOrderRequest.PspReference); - - if (paypalUpdateOrderRequest.SessionIdOption.IsSet) - writer.WriteString("sessionId", paypalUpdateOrderRequest.SessionId); - - if (paypalUpdateOrderRequest.TaxTotalOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("taxTotal"); - JsonSerializer.Serialize(writer, paypalUpdateOrderRequest.TaxTotal, jsonSerializerOptions); + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.DeliveryMethods != null) + { + hashCode = (hashCode * 59) + this.DeliveryMethods.GetHashCode(); + } + if (this.PaymentData != null) + { + hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + if (this.SessionId != null) + { + hashCode = (hashCode * 59) + this.SessionId.GetHashCode(); + } + if (this.TaxTotal != null) + { + hashCode = (hashCode * 59) + this.TaxTotal.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs b/Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs index 2aaec14fa..40dfdec71 100644 --- a/Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs +++ b/Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,114 +15,72 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PaypalUpdateOrderResponse /// - public partial class PaypalUpdateOrderResponse : IValidatableObject + [DataContract(Name = "PaypalUpdateOrderResponse")] + public partial class PaypalUpdateOrderResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The updated paymentData. - /// The status of the request. This indicates whether the order was successfully updated with PayPal. - [JsonConstructor] - public PaypalUpdateOrderResponse(string paymentData, StatusEnum status) - { - PaymentData = paymentData; - Status = status; - OnCreated(); - } - - partial void OnCreated(); - /// /// The status of the request. This indicates whether the order was successfully updated with PayPal. /// /// The status of the request. This indicates whether the order was successfully updated with PayPal. + [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Error for value: error /// + [EnumMember(Value = "error")] Error = 1, /// /// Enum Success for value: success /// + [EnumMember(Value = "success")] Success = 2 + } + /// - /// Returns a + /// The status of the request. This indicates whether the order was successfully updated with PayPal. /// - /// - /// - /// - public static StatusEnum StatusEnumFromString(string value) - { - if (value.Equals("error")) - return StatusEnum.Error; - - if (value.Equals("success")) - return StatusEnum.Success; - - throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); - } - + /// The status of the request. This indicates whether the order was successfully updated with PayPal. + [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] + public StatusEnum Status { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static StatusEnum? StatusEnumFromStringOrDefault(string value) - { - if (value.Equals("error")) - return StatusEnum.Error; - - if (value.Equals("success")) - return StatusEnum.Success; - - return null; - } - + [JsonConstructorAttribute] + protected PaypalUpdateOrderResponse() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string StatusEnumToJsonValue(StatusEnum value) + /// The updated paymentData. (required). + /// The status of the request. This indicates whether the order was successfully updated with PayPal. (required). + public PaypalUpdateOrderResponse(string paymentData = default(string), StatusEnum status = default(StatusEnum)) { - if (value == StatusEnum.Error) - return "error"; - - if (value == StatusEnum.Success) - return "success"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.PaymentData = paymentData; + this.Status = status; } - /// - /// The status of the request. This indicates whether the order was successfully updated with PayPal. - /// - /// The status of the request. This indicates whether the order was successfully updated with PayPal. - [JsonPropertyName("status")] - public StatusEnum Status { get; set; } - /// /// The updated paymentData. /// /// The updated paymentData. - [JsonPropertyName("paymentData")] + [DataMember(Name = "paymentData", IsRequired = false, EmitDefaultValue = false)] public string PaymentData { get; set; } /// @@ -139,116 +98,73 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PaypalUpdateOrderResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PaypalUpdateOrderResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option paymentData = default; - Option status = default; + return this.Equals(input as PaypalUpdateOrderResponse); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PaypalUpdateOrderResponse instances are equal + /// + /// Instance of PaypalUpdateOrderResponse to be compared + /// Boolean + public bool Equals(PaypalUpdateOrderResponse input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "paymentData": - paymentData = new Option(utf8JsonReader.GetString()); - break; - case "status": - string statusRawValue = utf8JsonReader.GetString(); - if (statusRawValue != null) - status = new Option(PaypalUpdateOrderResponse.StatusEnumFromStringOrDefault(statusRawValue)); - break; - default: - break; - } - } + return false; } - - if (!paymentData.IsSet) - throw new ArgumentException("Property is required for class PaypalUpdateOrderResponse.", nameof(paymentData)); - - if (!status.IsSet) - throw new ArgumentException("Property is required for class PaypalUpdateOrderResponse.", nameof(status)); - - if (paymentData.IsSet && paymentData.Value == null) - throw new ArgumentNullException(nameof(paymentData), "Property is not nullable for class PaypalUpdateOrderResponse."); - - if (status.IsSet && status.Value == null) - throw new ArgumentNullException(nameof(status), "Property is not nullable for class PaypalUpdateOrderResponse."); - - return new PaypalUpdateOrderResponse(paymentData.Value, status.Value.Value); + return + ( + this.PaymentData == input.PaymentData || + (this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData)) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PaypalUpdateOrderResponse paypalUpdateOrderResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, paypalUpdateOrderResponse, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PaymentData != null) + { + hashCode = (hashCode * 59) + this.PaymentData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PaypalUpdateOrderResponse paypalUpdateOrderResponse, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (paypalUpdateOrderResponse.PaymentData == null) - throw new ArgumentNullException(nameof(paypalUpdateOrderResponse.PaymentData), "Property is required for class PaypalUpdateOrderResponse."); - - writer.WriteString("paymentData", paypalUpdateOrderResponse.PaymentData); - - var statusRawValue = PaypalUpdateOrderResponse.StatusEnumToJsonValue(paypalUpdateOrderResponse.Status); - writer.WriteString("status", statusRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Phone.cs b/Adyen/Model/Checkout/Phone.cs index 610137056..64fcbc46e 100644 --- a/Adyen/Model/Checkout/Phone.cs +++ b/Adyen/Model/Checkout/Phone.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,62 +15,47 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Phone /// - public partial class Phone : IValidatableObject + [DataContract(Name = "Phone")] + public partial class Phone : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Country code. Length: 1–3 characters. - /// Subscriber number. Maximum length: 15 characters. - [JsonConstructor] - public Phone(Option cc = default, Option subscriber = default) + /// Country code. Length: 1–3 characters.. + /// Subscriber number. Maximum length: 15 characters.. + public Phone(string cc = default(string), string subscriber = default(string)) { - CcOption = cc; - SubscriberOption = subscriber; - OnCreated(); + this.Cc = cc; + this.Subscriber = subscriber; } - partial void OnCreated(); - - /// - /// Used to track the state of Cc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CcOption { get; private set; } - /// /// Country code. Length: 1–3 characters. /// /// Country code. Length: 1–3 characters. - [JsonPropertyName("cc")] - public string Cc { get { return this.CcOption; } set { this.CcOption = new Option(value); } } - - /// - /// Used to track the state of Subscriber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubscriberOption { get; private set; } + [DataMember(Name = "cc", EmitDefaultValue = false)] + public string Cc { get; set; } /// /// Subscriber number. Maximum length: 15 characters. /// /// Subscriber number. Maximum length: 15 characters. - [JsonPropertyName("subscriber")] - public string Subscriber { get { return this.SubscriberOption; } set { this.SubscriberOption = new Option(value); } } + [DataMember(Name = "subscriber", EmitDefaultValue = false)] + public string Subscriber { get; set; } /// /// Returns the string presentation of the object @@ -86,130 +72,95 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // Cc (string) maxLength - if (this.Cc != null && this.Cc.Length > 3) - { - yield return new ValidationResult("Invalid value for Cc, length must be less than 3.", new [] { "Cc" }); - } - - // Cc (string) minLength - if (this.Cc != null && this.Cc.Length < 1) - { - yield return new ValidationResult("Invalid value for Cc, length must be greater than 1.", new [] { "Cc" }); - } - - // Subscriber (string) maxLength - if (this.Subscriber != null && this.Subscriber.Length > 15) - { - yield return new ValidationResult("Invalid value for Subscriber, length must be less than 15.", new [] { "Subscriber" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PhoneJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Phone Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option cc = default; - Option subscriber = default; + return this.Equals(input as Phone); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if Phone instances are equal + /// + /// Instance of Phone to be compared + /// Boolean + public bool Equals(Phone input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "cc": - cc = new Option(utf8JsonReader.GetString()); - break; - case "subscriber": - subscriber = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (cc.IsSet && cc.Value == null) - throw new ArgumentNullException(nameof(cc), "Property is not nullable for class Phone."); - - if (subscriber.IsSet && subscriber.Value == null) - throw new ArgumentNullException(nameof(subscriber), "Property is not nullable for class Phone."); - - return new Phone(cc, subscriber); + return + ( + this.Cc == input.Cc || + (this.Cc != null && + this.Cc.Equals(input.Cc)) + ) && + ( + this.Subscriber == input.Subscriber || + (this.Subscriber != null && + this.Subscriber.Equals(input.Subscriber)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Phone phone, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, phone, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Cc != null) + { + hashCode = (hashCode * 59) + this.Cc.GetHashCode(); + } + if (this.Subscriber != null) + { + hashCode = (hashCode * 59) + this.Subscriber.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Phone phone, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (phone.CcOption.IsSet && phone.Cc == null) - throw new ArgumentNullException(nameof(phone.Cc), "Property is required for class Phone."); + // Cc (string) maxLength + if (this.Cc != null && this.Cc.Length > 3) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cc, length must be less than 3.", new [] { "Cc" }); + } - if (phone.SubscriberOption.IsSet && phone.Subscriber == null) - throw new ArgumentNullException(nameof(phone.Subscriber), "Property is required for class Phone."); + // Cc (string) minLength + if (this.Cc != null && this.Cc.Length < 1) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cc, length must be greater than 1.", new [] { "Cc" }); + } - if (phone.CcOption.IsSet) - writer.WriteString("cc", phone.Cc); + // Subscriber (string) maxLength + if (this.Subscriber != null && this.Subscriber.Length > 15) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subscriber, length must be less than 15.", new [] { "Subscriber" }); + } - if (phone.SubscriberOption.IsSet) - writer.WriteString("subscriber", phone.Subscriber); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PixDetails.cs b/Adyen/Model/Checkout/PixDetails.cs index ce7470201..f72f7e641 100644 --- a/Adyen/Model/Checkout/PixDetails.cs +++ b/Adyen/Model/Checkout/PixDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,163 +15,89 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PixDetails /// - public partial class PixDetails : IValidatableObject + [DataContract(Name = "PixDetails")] + public partial class PixDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// pixRecurring - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The payment method type. - [JsonConstructor] - public PixDetails(Option checkoutAttemptId = default, Option pixRecurring = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - PixRecurringOption = pixRecurring; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The payment method type. /// /// The payment method type. + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Pix for value: pix /// + [EnumMember(Value = "pix")] Pix = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("pix")) - return TypeEnum.Pix; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("pix")) - return TypeEnum.Pix; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Pix) - return "pix"; - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// The payment method type. /// /// The payment method type. - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// pixRecurring. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The payment method type.. + public PixDetails(string checkoutAttemptId = default(string), PixRecurring pixRecurring = default(PixRecurring), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = default(TypeEnum?)) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.PixRecurring = pixRecurring; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of PixRecurring - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PixRecurringOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Gets or Sets PixRecurring /// - [JsonPropertyName("pixRecurring")] - public PixRecurring PixRecurring { get { return this.PixRecurringOption; } set { this.PixRecurringOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "pixRecurring", EmitDefaultValue = false)] + public PixRecurring PixRecurring { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -190,159 +117,106 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PixDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PixDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option pixRecurring = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as PixDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PixDetails instances are equal + /// + /// Instance of PixDetails to be compared + /// Boolean + public bool Equals(PixDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "pixRecurring": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pixRecurring = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(PixDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PixDetails."); - - if (pixRecurring.IsSet && pixRecurring.Value == null) - throw new ArgumentNullException(nameof(pixRecurring), "Property is not nullable for class PixDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class PixDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class PixDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PixDetails."); - - return new PixDetails(checkoutAttemptId, pixRecurring, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.PixRecurring == input.PixRecurring || + (this.PixRecurring != null && + this.PixRecurring.Equals(input.PixRecurring)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PixDetails pixDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, pixDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.PixRecurring != null) + { + hashCode = (hashCode * 59) + this.PixRecurring.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PixDetails pixDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (pixDetails.CheckoutAttemptIdOption.IsSet && pixDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(pixDetails.CheckoutAttemptId), "Property is required for class PixDetails."); - - if (pixDetails.PixRecurringOption.IsSet && pixDetails.PixRecurring == null) - throw new ArgumentNullException(nameof(pixDetails.PixRecurring), "Property is required for class PixDetails."); - - if (pixDetails.RecurringDetailReferenceOption.IsSet && pixDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(pixDetails.RecurringDetailReference), "Property is required for class PixDetails."); - - if (pixDetails.StoredPaymentMethodIdOption.IsSet && pixDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(pixDetails.StoredPaymentMethodId), "Property is required for class PixDetails."); - - if (pixDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", pixDetails.CheckoutAttemptId); - - if (pixDetails.PixRecurringOption.IsSet) + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) { - writer.WritePropertyName("pixRecurring"); - JsonSerializer.Serialize(writer, pixDetails.PixRecurring, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); } - if (pixDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", pixDetails.RecurringDetailReference); - - if (pixDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", pixDetails.StoredPaymentMethodId); - var typeRawValue = PixDetails.TypeEnumToJsonValue(pixDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PixRecurring.cs b/Adyen/Model/Checkout/PixRecurring.cs index 95b5922ed..fd084618e 100644 --- a/Adyen/Model/Checkout/PixRecurring.cs +++ b/Adyen/Model/Checkout/PixRecurring.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,281 +15,156 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PixRecurring /// - public partial class PixRecurring : IValidatableObject + [DataContract(Name = "PixRecurring")] + public partial class PixRecurring : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The date on which the shopper's payment method will be charged, in YYYY-MM-DD format. - /// End date of the billing plan, in YYYY-MM-DD format. The end date must align with the frequency and the start date of the billing plan. If left blank, the subscription will continue indefinitely unless it is cancelled by the shopper. - /// The frequency at which the shopper will be charged. - /// minAmount - /// The pspReference for the failed recurring payment. Find this in AUTHORISATION webhook you received after the billing date. - /// recurringAmount - /// The text that that will be shown on the shopper's bank statement for the recurring payments. We recommend to add a descriptive text about the subscription to let your shoppers recognize your recurring payments. Maximum length: 35 characters. - /// When set to true, you can retry for failed recurring payments. The default value is true. - /// Start date of the billing plan, in YYYY-MM-DD format. The default value is the transaction date. - [JsonConstructor] - public PixRecurring(Option billingDate = default, Option endsAt = default, Option frequency = default, Option minAmount = default, Option originalPspReference = default, Option recurringAmount = default, Option recurringStatement = default, Option retryPolicy = default, Option startsAt = default) - { - BillingDateOption = billingDate; - EndsAtOption = endsAt; - FrequencyOption = frequency; - MinAmountOption = minAmount; - OriginalPspReferenceOption = originalPspReference; - RecurringAmountOption = recurringAmount; - RecurringStatementOption = recurringStatement; - RetryPolicyOption = retryPolicy; - StartsAtOption = startsAt; - OnCreated(); - } - - partial void OnCreated(); - /// /// The frequency at which the shopper will be charged. /// /// The frequency at which the shopper will be charged. + [JsonConverter(typeof(StringEnumConverter))] public enum FrequencyEnum { /// /// Enum Weekly for value: weekly /// + [EnumMember(Value = "weekly")] Weekly = 1, /// /// Enum Monthly for value: monthly /// + [EnumMember(Value = "monthly")] Monthly = 2, /// /// Enum Quarterly for value: quarterly /// + [EnumMember(Value = "quarterly")] Quarterly = 3, /// /// Enum HalfYearly for value: half-yearly /// + [EnumMember(Value = "half-yearly")] HalfYearly = 4, /// /// Enum Yearly for value: yearly /// + [EnumMember(Value = "yearly")] Yearly = 5 - } - /// - /// Returns a - /// - /// - /// - /// - public static FrequencyEnum FrequencyEnumFromString(string value) - { - if (value.Equals("weekly")) - return FrequencyEnum.Weekly; - - if (value.Equals("monthly")) - return FrequencyEnum.Monthly; - - if (value.Equals("quarterly")) - return FrequencyEnum.Quarterly; - - if (value.Equals("half-yearly")) - return FrequencyEnum.HalfYearly; - - if (value.Equals("yearly")) - return FrequencyEnum.Yearly; - - throw new NotImplementedException($"Could not convert value to type FrequencyEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static FrequencyEnum? FrequencyEnumFromStringOrDefault(string value) - { - if (value.Equals("weekly")) - return FrequencyEnum.Weekly; - - if (value.Equals("monthly")) - return FrequencyEnum.Monthly; - - if (value.Equals("quarterly")) - return FrequencyEnum.Quarterly; - - if (value.Equals("half-yearly")) - return FrequencyEnum.HalfYearly; - - if (value.Equals("yearly")) - return FrequencyEnum.Yearly; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FrequencyEnumToJsonValue(FrequencyEnum? value) - { - if (value == FrequencyEnum.Weekly) - return "weekly"; - - if (value == FrequencyEnum.Monthly) - return "monthly"; - - if (value == FrequencyEnum.Quarterly) - return "quarterly"; - - if (value == FrequencyEnum.HalfYearly) - return "half-yearly"; - - if (value == FrequencyEnum.Yearly) - return "yearly"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Frequency - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FrequencyOption { get; private set; } /// /// The frequency at which the shopper will be charged. /// /// The frequency at which the shopper will be charged. - [JsonPropertyName("frequency")] - public FrequencyEnum? Frequency { get { return this.FrequencyOption; } set { this.FrequencyOption = new Option(value); } } - + [DataMember(Name = "frequency", EmitDefaultValue = false)] + public FrequencyEnum? Frequency { get; set; } /// - /// Used to track the state of BillingDate + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingDateOption { get; private set; } + /// The date on which the shopper's payment method will be charged, in YYYY-MM-DD format.. + /// Flag used to define whether liquidation can happen only on business days. + /// End date of the billing plan, in YYYY-MM-DD format. The end date must align with the frequency and the start date of the billing plan. If left blank, the subscription will continue indefinitely unless it is cancelled by the shopper.. + /// The frequency at which the shopper will be charged.. + /// minAmount. + /// The pspReference for the failed recurring payment. Find this in AUTHORISATION webhook you received after the billing date.. + /// recurringAmount. + /// The text that that will be shown on the shopper's bank statement for the recurring payments. We recommend to add a descriptive text about the subscription to let your shoppers recognize your recurring payments. Maximum length: 35 characters.. + /// When set to true, you can retry for failed recurring payments. The default value is true.. + /// Start date of the billing plan, in YYYY-MM-DD format. The default value is the transaction date.. + public PixRecurring(string billingDate = default(string), bool? businessDayOnly = default(bool?), string endsAt = default(string), FrequencyEnum? frequency = default(FrequencyEnum?), Amount minAmount = default(Amount), string originalPspReference = default(string), Amount recurringAmount = default(Amount), string recurringStatement = default(string), bool? retryPolicy = default(bool?), string startsAt = default(string)) + { + this.BillingDate = billingDate; + this.BusinessDayOnly = businessDayOnly; + this.EndsAt = endsAt; + this.Frequency = frequency; + this.MinAmount = minAmount; + this.OriginalPspReference = originalPspReference; + this.RecurringAmount = recurringAmount; + this.RecurringStatement = recurringStatement; + this.RetryPolicy = retryPolicy; + this.StartsAt = startsAt; + } /// /// The date on which the shopper's payment method will be charged, in YYYY-MM-DD format. /// /// The date on which the shopper's payment method will be charged, in YYYY-MM-DD format. - [JsonPropertyName("billingDate")] - public string BillingDate { get { return this.BillingDateOption; } set { this.BillingDateOption = new Option(value); } } + [DataMember(Name = "billingDate", EmitDefaultValue = false)] + public string BillingDate { get; set; } /// - /// Used to track the state of EndsAt + /// Flag used to define whether liquidation can happen only on business days /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EndsAtOption { get; private set; } + /// Flag used to define whether liquidation can happen only on business days + [DataMember(Name = "businessDayOnly", EmitDefaultValue = false)] + public bool? BusinessDayOnly { get; set; } /// /// End date of the billing plan, in YYYY-MM-DD format. The end date must align with the frequency and the start date of the billing plan. If left blank, the subscription will continue indefinitely unless it is cancelled by the shopper. /// /// End date of the billing plan, in YYYY-MM-DD format. The end date must align with the frequency and the start date of the billing plan. If left blank, the subscription will continue indefinitely unless it is cancelled by the shopper. - [JsonPropertyName("endsAt")] - public string EndsAt { get { return this.EndsAtOption; } set { this.EndsAtOption = new Option(value); } } - - /// - /// Used to track the state of MinAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MinAmountOption { get; private set; } + [DataMember(Name = "endsAt", EmitDefaultValue = false)] + public string EndsAt { get; set; } /// /// Gets or Sets MinAmount /// - [JsonPropertyName("minAmount")] - public Amount MinAmount { get { return this.MinAmountOption; } set { this.MinAmountOption = new Option(value); } } - - /// - /// Used to track the state of OriginalPspReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OriginalPspReferenceOption { get; private set; } + [DataMember(Name = "minAmount", EmitDefaultValue = false)] + public Amount MinAmount { get; set; } /// /// The pspReference for the failed recurring payment. Find this in AUTHORISATION webhook you received after the billing date. /// /// The pspReference for the failed recurring payment. Find this in AUTHORISATION webhook you received after the billing date. - [JsonPropertyName("originalPspReference")] - public string OriginalPspReference { get { return this.OriginalPspReferenceOption; } set { this.OriginalPspReferenceOption = new Option(value); } } - - /// - /// Used to track the state of RecurringAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringAmountOption { get; private set; } + [DataMember(Name = "originalPspReference", EmitDefaultValue = false)] + public string OriginalPspReference { get; set; } /// /// Gets or Sets RecurringAmount /// - [JsonPropertyName("recurringAmount")] - public Amount RecurringAmount { get { return this.RecurringAmountOption; } set { this.RecurringAmountOption = new Option(value); } } - - /// - /// Used to track the state of RecurringStatement - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringStatementOption { get; private set; } + [DataMember(Name = "recurringAmount", EmitDefaultValue = false)] + public Amount RecurringAmount { get; set; } /// /// The text that that will be shown on the shopper's bank statement for the recurring payments. We recommend to add a descriptive text about the subscription to let your shoppers recognize your recurring payments. Maximum length: 35 characters. /// /// The text that that will be shown on the shopper's bank statement for the recurring payments. We recommend to add a descriptive text about the subscription to let your shoppers recognize your recurring payments. Maximum length: 35 characters. - [JsonPropertyName("recurringStatement")] - public string RecurringStatement { get { return this.RecurringStatementOption; } set { this.RecurringStatementOption = new Option(value); } } - - /// - /// Used to track the state of RetryPolicy - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RetryPolicyOption { get; private set; } + [DataMember(Name = "recurringStatement", EmitDefaultValue = false)] + public string RecurringStatement { get; set; } /// /// When set to true, you can retry for failed recurring payments. The default value is true. /// /// When set to true, you can retry for failed recurring payments. The default value is true. - [JsonPropertyName("retryPolicy")] - public bool? RetryPolicy { get { return this.RetryPolicyOption; } set { this.RetryPolicyOption = new Option(value); } } - - /// - /// Used to track the state of StartsAt - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StartsAtOption { get; private set; } + [DataMember(Name = "retryPolicy", EmitDefaultValue = false)] + public bool? RetryPolicy { get; set; } /// /// Start date of the billing plan, in YYYY-MM-DD format. The default value is the transaction date. /// /// Start date of the billing plan, in YYYY-MM-DD format. The default value is the transaction date. - [JsonPropertyName("startsAt")] - public string StartsAt { get { return this.StartsAtOption; } set { this.StartsAtOption = new Option(value); } } + [DataMember(Name = "startsAt", EmitDefaultValue = false)] + public string StartsAt { get; set; } /// /// Returns the string presentation of the object @@ -299,6 +175,7 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PixRecurring {\n"); sb.Append(" BillingDate: ").Append(BillingDate).Append("\n"); + sb.Append(" BusinessDayOnly: ").Append(BusinessDayOnly).Append("\n"); sb.Append(" EndsAt: ").Append(EndsAt).Append("\n"); sb.Append(" Frequency: ").Append(Frequency).Append("\n"); sb.Append(" MinAmount: ").Append(MinAmount).Append("\n"); @@ -312,205 +189,137 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PixRecurringJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PixRecurring Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option billingDate = default; - Option endsAt = default; - Option frequency = default; - Option minAmount = default; - Option originalPspReference = default; - Option recurringAmount = default; - Option recurringStatement = default; - Option retryPolicy = default; - Option startsAt = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "billingDate": - billingDate = new Option(utf8JsonReader.GetString()); - break; - case "endsAt": - endsAt = new Option(utf8JsonReader.GetString()); - break; - case "frequency": - string frequencyRawValue = utf8JsonReader.GetString(); - if (frequencyRawValue != null) - frequency = new Option(PixRecurring.FrequencyEnumFromStringOrDefault(frequencyRawValue)); - break; - case "minAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - minAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "originalPspReference": - originalPspReference = new Option(utf8JsonReader.GetString()); - break; - case "recurringAmount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - recurringAmount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "recurringStatement": - recurringStatement = new Option(utf8JsonReader.GetString()); - break; - case "retryPolicy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - retryPolicy = new Option(utf8JsonReader.GetBoolean()); - break; - case "startsAt": - startsAt = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (billingDate.IsSet && billingDate.Value == null) - throw new ArgumentNullException(nameof(billingDate), "Property is not nullable for class PixRecurring."); - - if (endsAt.IsSet && endsAt.Value == null) - throw new ArgumentNullException(nameof(endsAt), "Property is not nullable for class PixRecurring."); - - if (frequency.IsSet && frequency.Value == null) - throw new ArgumentNullException(nameof(frequency), "Property is not nullable for class PixRecurring."); - - if (minAmount.IsSet && minAmount.Value == null) - throw new ArgumentNullException(nameof(minAmount), "Property is not nullable for class PixRecurring."); - - if (originalPspReference.IsSet && originalPspReference.Value == null) - throw new ArgumentNullException(nameof(originalPspReference), "Property is not nullable for class PixRecurring."); - - if (recurringAmount.IsSet && recurringAmount.Value == null) - throw new ArgumentNullException(nameof(recurringAmount), "Property is not nullable for class PixRecurring."); - - if (recurringStatement.IsSet && recurringStatement.Value == null) - throw new ArgumentNullException(nameof(recurringStatement), "Property is not nullable for class PixRecurring."); - - if (retryPolicy.IsSet && retryPolicy.Value == null) - throw new ArgumentNullException(nameof(retryPolicy), "Property is not nullable for class PixRecurring."); - - if (startsAt.IsSet && startsAt.Value == null) - throw new ArgumentNullException(nameof(startsAt), "Property is not nullable for class PixRecurring."); - - return new PixRecurring(billingDate, endsAt, frequency, minAmount, originalPspReference, recurringAmount, recurringStatement, retryPolicy, startsAt); + return this.Equals(input as PixRecurring); } /// - /// Serializes a + /// Returns true if PixRecurring instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PixRecurring pixRecurring, JsonSerializerOptions jsonSerializerOptions) + /// Instance of PixRecurring to be compared + /// Boolean + public bool Equals(PixRecurring input) { - writer.WriteStartObject(); - - WriteProperties(writer, pixRecurring, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.BillingDate == input.BillingDate || + (this.BillingDate != null && + this.BillingDate.Equals(input.BillingDate)) + ) && + ( + this.BusinessDayOnly == input.BusinessDayOnly || + this.BusinessDayOnly.Equals(input.BusinessDayOnly) + ) && + ( + this.EndsAt == input.EndsAt || + (this.EndsAt != null && + this.EndsAt.Equals(input.EndsAt)) + ) && + ( + this.Frequency == input.Frequency || + this.Frequency.Equals(input.Frequency) + ) && + ( + this.MinAmount == input.MinAmount || + (this.MinAmount != null && + this.MinAmount.Equals(input.MinAmount)) + ) && + ( + this.OriginalPspReference == input.OriginalPspReference || + (this.OriginalPspReference != null && + this.OriginalPspReference.Equals(input.OriginalPspReference)) + ) && + ( + this.RecurringAmount == input.RecurringAmount || + (this.RecurringAmount != null && + this.RecurringAmount.Equals(input.RecurringAmount)) + ) && + ( + this.RecurringStatement == input.RecurringStatement || + (this.RecurringStatement != null && + this.RecurringStatement.Equals(input.RecurringStatement)) + ) && + ( + this.RetryPolicy == input.RetryPolicy || + this.RetryPolicy.Equals(input.RetryPolicy) + ) && + ( + this.StartsAt == input.StartsAt || + (this.StartsAt != null && + this.StartsAt.Equals(input.StartsAt)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PixRecurring pixRecurring, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (pixRecurring.BillingDateOption.IsSet && pixRecurring.BillingDate == null) - throw new ArgumentNullException(nameof(pixRecurring.BillingDate), "Property is required for class PixRecurring."); - - if (pixRecurring.EndsAtOption.IsSet && pixRecurring.EndsAt == null) - throw new ArgumentNullException(nameof(pixRecurring.EndsAt), "Property is required for class PixRecurring."); - - if (pixRecurring.MinAmountOption.IsSet && pixRecurring.MinAmount == null) - throw new ArgumentNullException(nameof(pixRecurring.MinAmount), "Property is required for class PixRecurring."); - - if (pixRecurring.OriginalPspReferenceOption.IsSet && pixRecurring.OriginalPspReference == null) - throw new ArgumentNullException(nameof(pixRecurring.OriginalPspReference), "Property is required for class PixRecurring."); - - if (pixRecurring.RecurringAmountOption.IsSet && pixRecurring.RecurringAmount == null) - throw new ArgumentNullException(nameof(pixRecurring.RecurringAmount), "Property is required for class PixRecurring."); - - if (pixRecurring.RecurringStatementOption.IsSet && pixRecurring.RecurringStatement == null) - throw new ArgumentNullException(nameof(pixRecurring.RecurringStatement), "Property is required for class PixRecurring."); - - if (pixRecurring.StartsAtOption.IsSet && pixRecurring.StartsAt == null) - throw new ArgumentNullException(nameof(pixRecurring.StartsAt), "Property is required for class PixRecurring."); - - if (pixRecurring.BillingDateOption.IsSet) - writer.WriteString("billingDate", pixRecurring.BillingDate); - - if (pixRecurring.EndsAtOption.IsSet) - writer.WriteString("endsAt", pixRecurring.EndsAt); - - var frequencyRawValue = PixRecurring.FrequencyEnumToJsonValue(pixRecurring.FrequencyOption.Value.Value); - writer.WriteString("frequency", frequencyRawValue); - if (pixRecurring.MinAmountOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("minAmount"); - JsonSerializer.Serialize(writer, pixRecurring.MinAmount, jsonSerializerOptions); - } - if (pixRecurring.OriginalPspReferenceOption.IsSet) - writer.WriteString("originalPspReference", pixRecurring.OriginalPspReference); - - if (pixRecurring.RecurringAmountOption.IsSet) - { - writer.WritePropertyName("recurringAmount"); - JsonSerializer.Serialize(writer, pixRecurring.RecurringAmount, jsonSerializerOptions); + int hashCode = 41; + if (this.BillingDate != null) + { + hashCode = (hashCode * 59) + this.BillingDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.BusinessDayOnly.GetHashCode(); + if (this.EndsAt != null) + { + hashCode = (hashCode * 59) + this.EndsAt.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Frequency.GetHashCode(); + if (this.MinAmount != null) + { + hashCode = (hashCode * 59) + this.MinAmount.GetHashCode(); + } + if (this.OriginalPspReference != null) + { + hashCode = (hashCode * 59) + this.OriginalPspReference.GetHashCode(); + } + if (this.RecurringAmount != null) + { + hashCode = (hashCode * 59) + this.RecurringAmount.GetHashCode(); + } + if (this.RecurringStatement != null) + { + hashCode = (hashCode * 59) + this.RecurringStatement.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RetryPolicy.GetHashCode(); + if (this.StartsAt != null) + { + hashCode = (hashCode * 59) + this.StartsAt.GetHashCode(); + } + return hashCode; } - if (pixRecurring.RecurringStatementOption.IsSet) - writer.WriteString("recurringStatement", pixRecurring.RecurringStatement); - - if (pixRecurring.RetryPolicyOption.IsSet) - writer.WriteBoolean("retryPolicy", pixRecurring.RetryPolicyOption.Value.Value); - - if (pixRecurring.StartsAtOption.IsSet) - writer.WriteString("startsAt", pixRecurring.StartsAt); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/PlatformChargebackLogic.cs b/Adyen/Model/Checkout/PlatformChargebackLogic.cs index 75c5df90b..c5ba7356d 100644 --- a/Adyen/Model/Checkout/PlatformChargebackLogic.cs +++ b/Adyen/Model/Checkout/PlatformChargebackLogic.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,159 +15,83 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PlatformChargebackLogic /// - public partial class PlatformChargebackLogic : IValidatableObject + [DataContract(Name = "PlatformChargebackLogic")] + public partial class PlatformChargebackLogic : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. - /// The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. - /// The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. - [JsonConstructor] - public PlatformChargebackLogic(Option behavior = default, Option costAllocationAccount = default, Option targetAccount = default) - { - BehaviorOption = behavior; - CostAllocationAccountOption = costAllocationAccount; - TargetAccountOption = targetAccount; - OnCreated(); - } - - partial void OnCreated(); - /// /// The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. /// /// The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. + [JsonConverter(typeof(StringEnumConverter))] public enum BehaviorEnum { /// /// Enum DeductAccordingToSplitRatio for value: deductAccordingToSplitRatio /// + [EnumMember(Value = "deductAccordingToSplitRatio")] DeductAccordingToSplitRatio = 1, /// /// Enum DeductFromLiableAccount for value: deductFromLiableAccount /// + [EnumMember(Value = "deductFromLiableAccount")] DeductFromLiableAccount = 2, /// /// Enum DeductFromOneBalanceAccount for value: deductFromOneBalanceAccount /// + [EnumMember(Value = "deductFromOneBalanceAccount")] DeductFromOneBalanceAccount = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static BehaviorEnum BehaviorEnumFromString(string value) - { - if (value.Equals("deductAccordingToSplitRatio")) - return BehaviorEnum.DeductAccordingToSplitRatio; - - if (value.Equals("deductFromLiableAccount")) - return BehaviorEnum.DeductFromLiableAccount; - - if (value.Equals("deductFromOneBalanceAccount")) - return BehaviorEnum.DeductFromOneBalanceAccount; - - throw new NotImplementedException($"Could not convert value to type BehaviorEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static BehaviorEnum? BehaviorEnumFromStringOrDefault(string value) - { - if (value.Equals("deductAccordingToSplitRatio")) - return BehaviorEnum.DeductAccordingToSplitRatio; - if (value.Equals("deductFromLiableAccount")) - return BehaviorEnum.DeductFromLiableAccount; - - if (value.Equals("deductFromOneBalanceAccount")) - return BehaviorEnum.DeductFromOneBalanceAccount; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string BehaviorEnumToJsonValue(BehaviorEnum? value) - { - if (value == BehaviorEnum.DeductAccordingToSplitRatio) - return "deductAccordingToSplitRatio"; - - if (value == BehaviorEnum.DeductFromLiableAccount) - return "deductFromLiableAccount"; - - if (value == BehaviorEnum.DeductFromOneBalanceAccount) - return "deductFromOneBalanceAccount"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Behavior - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BehaviorOption { get; private set; } /// /// The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. /// /// The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. - [JsonPropertyName("behavior")] - public BehaviorEnum? Behavior { get { return this.BehaviorOption; } set { this.BehaviorOption = new Option(value); } } - + [DataMember(Name = "behavior", EmitDefaultValue = false)] + public BehaviorEnum? Behavior { get; set; } /// - /// Used to track the state of CostAllocationAccount + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CostAllocationAccountOption { get; private set; } + /// The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**.. + /// The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account.. + /// The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**.. + public PlatformChargebackLogic(BehaviorEnum? behavior = default(BehaviorEnum?), string costAllocationAccount = default(string), string targetAccount = default(string)) + { + this.Behavior = behavior; + this.CostAllocationAccount = costAllocationAccount; + this.TargetAccount = targetAccount; + } /// /// The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. /// /// The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. - [JsonPropertyName("costAllocationAccount")] - public string CostAllocationAccount { get { return this.CostAllocationAccountOption; } set { this.CostAllocationAccountOption = new Option(value); } } - - /// - /// Used to track the state of TargetAccount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TargetAccountOption { get; private set; } + [DataMember(Name = "costAllocationAccount", EmitDefaultValue = false)] + public string CostAllocationAccount { get; set; } /// /// The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. /// /// The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. - [JsonPropertyName("targetAccount")] - public string TargetAccount { get { return this.TargetAccountOption; } set { this.TargetAccountOption = new Option(value); } } + [DataMember(Name = "targetAccount", EmitDefaultValue = false)] + public string TargetAccount { get; set; } /// /// Returns the string presentation of the object @@ -184,123 +109,82 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PlatformChargebackLogicJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PlatformChargebackLogic Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option behavior = default; - Option costAllocationAccount = default; - Option targetAccount = default; + return this.Equals(input as PlatformChargebackLogic); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PlatformChargebackLogic instances are equal + /// + /// Instance of PlatformChargebackLogic to be compared + /// Boolean + public bool Equals(PlatformChargebackLogic input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "behavior": - string behaviorRawValue = utf8JsonReader.GetString(); - if (behaviorRawValue != null) - behavior = new Option(PlatformChargebackLogic.BehaviorEnumFromStringOrDefault(behaviorRawValue)); - break; - case "costAllocationAccount": - costAllocationAccount = new Option(utf8JsonReader.GetString()); - break; - case "targetAccount": - targetAccount = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (behavior.IsSet && behavior.Value == null) - throw new ArgumentNullException(nameof(behavior), "Property is not nullable for class PlatformChargebackLogic."); - - if (costAllocationAccount.IsSet && costAllocationAccount.Value == null) - throw new ArgumentNullException(nameof(costAllocationAccount), "Property is not nullable for class PlatformChargebackLogic."); - - if (targetAccount.IsSet && targetAccount.Value == null) - throw new ArgumentNullException(nameof(targetAccount), "Property is not nullable for class PlatformChargebackLogic."); - - return new PlatformChargebackLogic(behavior, costAllocationAccount, targetAccount); + return + ( + this.Behavior == input.Behavior || + this.Behavior.Equals(input.Behavior) + ) && + ( + this.CostAllocationAccount == input.CostAllocationAccount || + (this.CostAllocationAccount != null && + this.CostAllocationAccount.Equals(input.CostAllocationAccount)) + ) && + ( + this.TargetAccount == input.TargetAccount || + (this.TargetAccount != null && + this.TargetAccount.Equals(input.TargetAccount)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PlatformChargebackLogic platformChargebackLogic, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, platformChargebackLogic, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Behavior.GetHashCode(); + if (this.CostAllocationAccount != null) + { + hashCode = (hashCode * 59) + this.CostAllocationAccount.GetHashCode(); + } + if (this.TargetAccount != null) + { + hashCode = (hashCode * 59) + this.TargetAccount.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PlatformChargebackLogic platformChargebackLogic, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (platformChargebackLogic.CostAllocationAccountOption.IsSet && platformChargebackLogic.CostAllocationAccount == null) - throw new ArgumentNullException(nameof(platformChargebackLogic.CostAllocationAccount), "Property is required for class PlatformChargebackLogic."); - - if (platformChargebackLogic.TargetAccountOption.IsSet && platformChargebackLogic.TargetAccount == null) - throw new ArgumentNullException(nameof(platformChargebackLogic.TargetAccount), "Property is required for class PlatformChargebackLogic."); - - var behaviorRawValue = PlatformChargebackLogic.BehaviorEnumToJsonValue(platformChargebackLogic.BehaviorOption.Value.Value); - writer.WriteString("behavior", behaviorRawValue); - if (platformChargebackLogic.CostAllocationAccountOption.IsSet) - writer.WriteString("costAllocationAccount", platformChargebackLogic.CostAllocationAccount); - - if (platformChargebackLogic.TargetAccountOption.IsSet) - writer.WriteString("targetAccount", platformChargebackLogic.TargetAccount); + yield break; } } + } diff --git a/Adyen/Model/Checkout/PseDetails.cs b/Adyen/Model/Checkout/PseDetails.cs index 31f953d05..1d09e8d45 100644 --- a/Adyen/Model/Checkout/PseDetails.cs +++ b/Adyen/Model/Checkout/PseDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,152 +15,104 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// PseDetails /// - public partial class PseDetails : IValidatableObject + [DataContract(Name = "PseDetails")] + public partial class PseDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The shopper's bank. - /// The client type. - /// The identification code. - /// The identification type. - /// The checkout attempt identifier. - /// The payment method type. - [JsonConstructor] - public PseDetails(string bank, string clientType, string identification, string identificationType, Option checkoutAttemptId = default, Option type = default) - { - Bank = bank; - ClientType = clientType; - Identification = identification; - IdentificationType = identificationType; - CheckoutAttemptIdOption = checkoutAttemptId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The payment method type. /// /// The payment method type. + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum PsePayulatam for value: pse_payulatam /// + [EnumMember(Value = "pse_payulatam")] PsePayulatam = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("pse_payulatam")) - return TypeEnum.PsePayulatam; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("pse_payulatam")) - return TypeEnum.PsePayulatam; - - return null; - } /// - /// Converts the to the json value + /// The payment method type. /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.PsePayulatam) - return "pse_payulatam"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - + /// The payment method type. + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of Type + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } - + [JsonConstructorAttribute] + protected PseDetails() { } /// - /// The payment method type. + /// Initializes a new instance of the class. /// - /// The payment method type. - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// The shopper's bank. (required). + /// The checkout attempt identifier.. + /// The client type. (required). + /// The identification code. (required). + /// The identification type. (required). + /// The payment method type.. + public PseDetails(string bank = default(string), string checkoutAttemptId = default(string), string clientType = default(string), string identification = default(string), string identificationType = default(string), TypeEnum? type = default(TypeEnum?)) + { + this.Bank = bank; + this.ClientType = clientType; + this.Identification = identification; + this.IdentificationType = identificationType; + this.CheckoutAttemptId = checkoutAttemptId; + this.Type = type; + } /// /// The shopper's bank. /// /// The shopper's bank. - [JsonPropertyName("bank")] + [DataMember(Name = "bank", IsRequired = false, EmitDefaultValue = false)] public string Bank { get; set; } + /// + /// The checkout attempt identifier. + /// + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } + /// /// The client type. /// /// The client type. - [JsonPropertyName("clientType")] + [DataMember(Name = "clientType", IsRequired = false, EmitDefaultValue = false)] public string ClientType { get; set; } /// /// The identification code. /// /// The identification code. - [JsonPropertyName("identification")] + [DataMember(Name = "identification", IsRequired = false, EmitDefaultValue = false)] public string Identification { get; set; } /// /// The identification type. /// /// The identification type. - [JsonPropertyName("identificationType")] + [DataMember(Name = "identificationType", IsRequired = false, EmitDefaultValue = false)] public string IdentificationType { get; set; } - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - - /// - /// The checkout attempt identifier. - /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - /// /// Returns the string presentation of the object /// @@ -169,181 +122,119 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class PseDetails {\n"); sb.Append(" Bank: ").Append(Bank).Append("\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" ClientType: ").Append(ClientType).Append("\n"); sb.Append(" Identification: ").Append(Identification).Append("\n"); sb.Append(" IdentificationType: ").Append(IdentificationType).Append("\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class PseDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override PseDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option bank = default; - Option clientType = default; - Option identification = default; - Option identificationType = default; - Option checkoutAttemptId = default; - Option type = default; + return this.Equals(input as PseDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if PseDetails instances are equal + /// + /// Instance of PseDetails to be compared + /// Boolean + public bool Equals(PseDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "bank": - bank = new Option(utf8JsonReader.GetString()); - break; - case "clientType": - clientType = new Option(utf8JsonReader.GetString()); - break; - case "identification": - identification = new Option(utf8JsonReader.GetString()); - break; - case "identificationType": - identificationType = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(PseDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!bank.IsSet) - throw new ArgumentException("Property is required for class PseDetails.", nameof(bank)); - - if (!clientType.IsSet) - throw new ArgumentException("Property is required for class PseDetails.", nameof(clientType)); - - if (!identification.IsSet) - throw new ArgumentException("Property is required for class PseDetails.", nameof(identification)); - - if (!identificationType.IsSet) - throw new ArgumentException("Property is required for class PseDetails.", nameof(identificationType)); - - if (bank.IsSet && bank.Value == null) - throw new ArgumentNullException(nameof(bank), "Property is not nullable for class PseDetails."); - - if (clientType.IsSet && clientType.Value == null) - throw new ArgumentNullException(nameof(clientType), "Property is not nullable for class PseDetails."); - - if (identification.IsSet && identification.Value == null) - throw new ArgumentNullException(nameof(identification), "Property is not nullable for class PseDetails."); - - if (identificationType.IsSet && identificationType.Value == null) - throw new ArgumentNullException(nameof(identificationType), "Property is not nullable for class PseDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class PseDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class PseDetails."); - - return new PseDetails(bank.Value, clientType.Value, identification.Value, identificationType.Value, checkoutAttemptId, type); + return + ( + this.Bank == input.Bank || + (this.Bank != null && + this.Bank.Equals(input.Bank)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.ClientType == input.ClientType || + (this.ClientType != null && + this.ClientType.Equals(input.ClientType)) + ) && + ( + this.Identification == input.Identification || + (this.Identification != null && + this.Identification.Equals(input.Identification)) + ) && + ( + this.IdentificationType == input.IdentificationType || + (this.IdentificationType != null && + this.IdentificationType.Equals(input.IdentificationType)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, PseDetails pseDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, pseDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bank != null) + { + hashCode = (hashCode * 59) + this.Bank.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.ClientType != null) + { + hashCode = (hashCode * 59) + this.ClientType.GetHashCode(); + } + if (this.Identification != null) + { + hashCode = (hashCode * 59) + this.Identification.GetHashCode(); + } + if (this.IdentificationType != null) + { + hashCode = (hashCode * 59) + this.IdentificationType.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, PseDetails pseDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (pseDetails.Bank == null) - throw new ArgumentNullException(nameof(pseDetails.Bank), "Property is required for class PseDetails."); - - if (pseDetails.ClientType == null) - throw new ArgumentNullException(nameof(pseDetails.ClientType), "Property is required for class PseDetails."); - - if (pseDetails.Identification == null) - throw new ArgumentNullException(nameof(pseDetails.Identification), "Property is required for class PseDetails."); - - if (pseDetails.IdentificationType == null) - throw new ArgumentNullException(nameof(pseDetails.IdentificationType), "Property is required for class PseDetails."); - - if (pseDetails.CheckoutAttemptIdOption.IsSet && pseDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(pseDetails.CheckoutAttemptId), "Property is required for class PseDetails."); - - writer.WriteString("bank", pseDetails.Bank); - - writer.WriteString("clientType", pseDetails.ClientType); - - writer.WriteString("identification", pseDetails.Identification); - - writer.WriteString("identificationType", pseDetails.IdentificationType); - - if (pseDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", pseDetails.CheckoutAttemptId); - - var typeRawValue = PseDetails.TypeEnumToJsonValue(pseDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/RakutenPayDetails.cs b/Adyen/Model/Checkout/RakutenPayDetails.cs index 0099d978d..ee4929ddb 100644 --- a/Adyen/Model/Checkout/RakutenPayDetails.cs +++ b/Adyen/Model/Checkout/RakutenPayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,148 +15,81 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// RakutenPayDetails /// - public partial class RakutenPayDetails : IValidatableObject + [DataContract(Name = "RakutenPayDetails")] + public partial class RakutenPayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **rakutenpay** (default to TypeEnum.Rakutenpay) - [JsonConstructor] - public RakutenPayDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **rakutenpay** /// /// **rakutenpay** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Rakutenpay for value: rakutenpay /// + [EnumMember(Value = "rakutenpay")] Rakutenpay = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("rakutenpay")) - return TypeEnum.Rakutenpay; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("rakutenpay")) - return TypeEnum.Rakutenpay; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Rakutenpay) - return "rakutenpay"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **rakutenpay** /// /// **rakutenpay** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **rakutenpay** (default to TypeEnum.Rakutenpay). + public RakutenPayDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Rakutenpay) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -174,143 +108,97 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class RakutenPayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override RakutenPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as RakutenPayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if RakutenPayDetails instances are equal + /// + /// Instance of RakutenPayDetails to be compared + /// Boolean + public bool Equals(RakutenPayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(RakutenPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class RakutenPayDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class RakutenPayDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class RakutenPayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class RakutenPayDetails."); - - return new RakutenPayDetails(checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, RakutenPayDetails rakutenPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, rakutenPayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, RakutenPayDetails rakutenPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (rakutenPayDetails.CheckoutAttemptIdOption.IsSet && rakutenPayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(rakutenPayDetails.CheckoutAttemptId), "Property is required for class RakutenPayDetails."); - - if (rakutenPayDetails.RecurringDetailReferenceOption.IsSet && rakutenPayDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(rakutenPayDetails.RecurringDetailReference), "Property is required for class RakutenPayDetails."); - - if (rakutenPayDetails.StoredPaymentMethodIdOption.IsSet && rakutenPayDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(rakutenPayDetails.StoredPaymentMethodId), "Property is required for class RakutenPayDetails."); - - if (rakutenPayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", rakutenPayDetails.CheckoutAttemptId); - - if (rakutenPayDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", rakutenPayDetails.RecurringDetailReference); - - if (rakutenPayDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", rakutenPayDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = RakutenPayDetails.TypeEnumToJsonValue(rakutenPayDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/RatepayDetails.cs b/Adyen/Model/Checkout/RatepayDetails.cs index f10f2d292..a91182132 100644 --- a/Adyen/Model/Checkout/RatepayDetails.cs +++ b/Adyen/Model/Checkout/RatepayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,203 +15,119 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// RatepayDetails /// - public partial class RatepayDetails : IValidatableObject + [DataContract(Name = "RatepayDetails")] + public partial class RatepayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The address where to send the invoice. - /// The checkout attempt identifier. - /// The address where the goods should be delivered. - /// Shopper name, date of birth, phone number, and email address. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **ratepay** (default to TypeEnum.Ratepay) - [JsonConstructor] - public RatepayDetails(Option billingAddress = default, Option checkoutAttemptId = default, Option deliveryAddress = default, Option personalDetails = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.Ratepay) - { - BillingAddressOption = billingAddress; - CheckoutAttemptIdOption = checkoutAttemptId; - DeliveryAddressOption = deliveryAddress; - PersonalDetailsOption = personalDetails; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - Type = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **ratepay** /// /// **ratepay** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Ratepay for value: ratepay /// + [EnumMember(Value = "ratepay")] Ratepay = 1, /// /// Enum RatepayDirectdebit for value: ratepay_directdebit /// + [EnumMember(Value = "ratepay_directdebit")] RatepayDirectdebit = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("ratepay")) - return TypeEnum.Ratepay; - - if (value.Equals("ratepay_directdebit")) - return TypeEnum.RatepayDirectdebit; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("ratepay")) - return TypeEnum.Ratepay; - - if (value.Equals("ratepay_directdebit")) - return TypeEnum.RatepayDirectdebit; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.Ratepay) - return "ratepay"; - - if (value == TypeEnum.RatepayDirectdebit) - return "ratepay_directdebit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **ratepay** /// /// **ratepay** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of BillingAddress + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressOption { get; private set; } - + [JsonConstructorAttribute] + protected RatepayDetails() { } /// - /// The address where to send the invoice. + /// Initializes a new instance of the class. /// - /// The address where to send the invoice. - [JsonPropertyName("billingAddress")] - public string BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } + /// The address where to send the invoice.. + /// The checkout attempt identifier.. + /// The address where the goods should be delivered.. + /// Shopper name, date of birth, phone number, and email address.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **ratepay** (required) (default to TypeEnum.Ratepay). + public RatepayDetails(string billingAddress = default(string), string checkoutAttemptId = default(string), string deliveryAddress = default(string), string personalDetails = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.Ratepay) + { + this.Type = type; + this.BillingAddress = billingAddress; + this.CheckoutAttemptId = checkoutAttemptId; + this.DeliveryAddress = deliveryAddress; + this.PersonalDetails = personalDetails; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + } /// - /// Used to track the state of CheckoutAttemptId + /// The address where to send the invoice. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The address where to send the invoice. + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public string BillingAddress { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryAddressOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The address where the goods should be delivered. /// /// The address where the goods should be delivered. - [JsonPropertyName("deliveryAddress")] - public string DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } - - /// - /// Used to track the state of PersonalDetails - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PersonalDetailsOption { get; private set; } + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public string DeliveryAddress { get; set; } /// /// Shopper name, date of birth, phone number, and email address. /// /// Shopper name, date of birth, phone number, and email address. - [JsonPropertyName("personalDetails")] - public string PersonalDetails { get { return this.PersonalDetailsOption; } set { this.PersonalDetailsOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "personalDetails", EmitDefaultValue = false)] + public string PersonalDetails { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -232,185 +149,124 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class RatepayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override RatepayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option billingAddress = default; - Option checkoutAttemptId = default; - Option deliveryAddress = default; - Option personalDetails = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as RatepayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if RatepayDetails instances are equal + /// + /// Instance of RatepayDetails to be compared + /// Boolean + public bool Equals(RatepayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "billingAddress": - billingAddress = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "deliveryAddress": - deliveryAddress = new Option(utf8JsonReader.GetString()); - break; - case "personalDetails": - personalDetails = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(RatepayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class RatepayDetails.", nameof(type)); - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class RatepayDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class RatepayDetails."); - - if (deliveryAddress.IsSet && deliveryAddress.Value == null) - throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class RatepayDetails."); - - if (personalDetails.IsSet && personalDetails.Value == null) - throw new ArgumentNullException(nameof(personalDetails), "Property is not nullable for class RatepayDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class RatepayDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class RatepayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class RatepayDetails."); - - return new RatepayDetails(billingAddress, checkoutAttemptId, deliveryAddress, personalDetails, recurringDetailReference, storedPaymentMethodId, type.Value.Value); + return + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + (this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress)) + ) && + ( + this.PersonalDetails == input.PersonalDetails || + (this.PersonalDetails != null && + this.PersonalDetails.Equals(input.PersonalDetails)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, RatepayDetails ratepayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, ratepayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.DeliveryAddress != null) + { + hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); + } + if (this.PersonalDetails != null) + { + hashCode = (hashCode * 59) + this.PersonalDetails.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, RatepayDetails ratepayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (ratepayDetails.BillingAddressOption.IsSet && ratepayDetails.BillingAddress == null) - throw new ArgumentNullException(nameof(ratepayDetails.BillingAddress), "Property is required for class RatepayDetails."); - - if (ratepayDetails.CheckoutAttemptIdOption.IsSet && ratepayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(ratepayDetails.CheckoutAttemptId), "Property is required for class RatepayDetails."); - - if (ratepayDetails.DeliveryAddressOption.IsSet && ratepayDetails.DeliveryAddress == null) - throw new ArgumentNullException(nameof(ratepayDetails.DeliveryAddress), "Property is required for class RatepayDetails."); - - if (ratepayDetails.PersonalDetailsOption.IsSet && ratepayDetails.PersonalDetails == null) - throw new ArgumentNullException(nameof(ratepayDetails.PersonalDetails), "Property is required for class RatepayDetails."); - - if (ratepayDetails.RecurringDetailReferenceOption.IsSet && ratepayDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(ratepayDetails.RecurringDetailReference), "Property is required for class RatepayDetails."); - - if (ratepayDetails.StoredPaymentMethodIdOption.IsSet && ratepayDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(ratepayDetails.StoredPaymentMethodId), "Property is required for class RatepayDetails."); - - if (ratepayDetails.BillingAddressOption.IsSet) - writer.WriteString("billingAddress", ratepayDetails.BillingAddress); - - if (ratepayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", ratepayDetails.CheckoutAttemptId); - - if (ratepayDetails.DeliveryAddressOption.IsSet) - writer.WriteString("deliveryAddress", ratepayDetails.DeliveryAddress); - - if (ratepayDetails.PersonalDetailsOption.IsSet) - writer.WriteString("personalDetails", ratepayDetails.PersonalDetails); - - if (ratepayDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", ratepayDetails.RecurringDetailReference); - - if (ratepayDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", ratepayDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = RatepayDetails.TypeEnumToJsonValue(ratepayDetails.Type); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Recurring.cs b/Adyen/Model/Checkout/Recurring.cs index eeffb3836..27e435f8c 100644 --- a/Adyen/Model/Checkout/Recurring.cs +++ b/Adyen/Model/Checkout/Recurring.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,286 +15,134 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Recurring /// - public partial class Recurring : IValidatableObject + [DataContract(Name = "Recurring")] + public partial class Recurring : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts). - /// A descriptive name for this detail. - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. - /// Minimum number of days between authorisations. Only for 3D Secure 2. - /// The name of the token service. - [JsonConstructor] - public Recurring(Option contract = default, Option recurringDetailName = default, Option recurringExpiry = default, Option recurringFrequency = default, Option tokenService = default) - { - ContractOption = contract; - RecurringDetailNameOption = recurringDetailName; - RecurringExpiryOption = recurringExpiry; - RecurringFrequencyOption = recurringFrequency; - TokenServiceOption = tokenService; - OnCreated(); - } - - partial void OnCreated(); - /// /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts). /// /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts). + [JsonConverter(typeof(StringEnumConverter))] public enum ContractEnum { /// /// Enum ONECLICK for value: ONECLICK /// + [EnumMember(Value = "ONECLICK")] ONECLICK = 1, /// /// Enum RECURRING for value: RECURRING /// + [EnumMember(Value = "RECURRING")] RECURRING = 2, /// /// Enum PAYOUT for value: PAYOUT /// + [EnumMember(Value = "PAYOUT")] PAYOUT = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ContractEnum ContractEnumFromString(string value) - { - if (value.Equals("ONECLICK")) - return ContractEnum.ONECLICK; - - if (value.Equals("RECURRING")) - return ContractEnum.RECURRING; - - if (value.Equals("PAYOUT")) - return ContractEnum.PAYOUT; - - throw new NotImplementedException($"Could not convert value to type ContractEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ContractEnum? ContractEnumFromStringOrDefault(string value) - { - if (value.Equals("ONECLICK")) - return ContractEnum.ONECLICK; - - if (value.Equals("RECURRING")) - return ContractEnum.RECURRING; - - if (value.Equals("PAYOUT")) - return ContractEnum.PAYOUT; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ContractEnumToJsonValue(ContractEnum? value) - { - if (value == ContractEnum.ONECLICK) - return "ONECLICK"; - - if (value == ContractEnum.RECURRING) - return "RECURRING"; - if (value == ContractEnum.PAYOUT) - return "PAYOUT"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Contract - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ContractOption { get; private set; } /// /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts). /// /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts). - [JsonPropertyName("contract")] - public ContractEnum? Contract { get { return this.ContractOption; } set { this.ContractOption = new Option(value); } } - + [DataMember(Name = "contract", EmitDefaultValue = false)] + public ContractEnum? Contract { get; set; } /// /// The name of the token service. /// /// The name of the token service. + [JsonConverter(typeof(StringEnumConverter))] public enum TokenServiceEnum { /// /// Enum VISATOKENSERVICE for value: VISATOKENSERVICE /// + [EnumMember(Value = "VISATOKENSERVICE")] VISATOKENSERVICE = 1, /// /// Enum MCTOKENSERVICE for value: MCTOKENSERVICE /// + [EnumMember(Value = "MCTOKENSERVICE")] MCTOKENSERVICE = 2, /// /// Enum AMEXTOKENSERVICE for value: AMEXTOKENSERVICE /// + [EnumMember(Value = "AMEXTOKENSERVICE")] AMEXTOKENSERVICE = 3, /// /// Enum TOKENSHARING for value: TOKEN_SHARING /// + [EnumMember(Value = "TOKEN_SHARING")] TOKENSHARING = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TokenServiceEnum TokenServiceEnumFromString(string value) - { - if (value.Equals("VISATOKENSERVICE")) - return TokenServiceEnum.VISATOKENSERVICE; - - if (value.Equals("MCTOKENSERVICE")) - return TokenServiceEnum.MCTOKENSERVICE; - - if (value.Equals("AMEXTOKENSERVICE")) - return TokenServiceEnum.AMEXTOKENSERVICE; - - if (value.Equals("TOKEN_SHARING")) - return TokenServiceEnum.TOKENSHARING; - - throw new NotImplementedException($"Could not convert value to type TokenServiceEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TokenServiceEnum? TokenServiceEnumFromStringOrDefault(string value) - { - if (value.Equals("VISATOKENSERVICE")) - return TokenServiceEnum.VISATOKENSERVICE; - - if (value.Equals("MCTOKENSERVICE")) - return TokenServiceEnum.MCTOKENSERVICE; - - if (value.Equals("AMEXTOKENSERVICE")) - return TokenServiceEnum.AMEXTOKENSERVICE; - - if (value.Equals("TOKEN_SHARING")) - return TokenServiceEnum.TOKENSHARING; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TokenServiceEnumToJsonValue(TokenServiceEnum? value) - { - if (value == TokenServiceEnum.VISATOKENSERVICE) - return "VISATOKENSERVICE"; - - if (value == TokenServiceEnum.MCTOKENSERVICE) - return "MCTOKENSERVICE"; - - if (value == TokenServiceEnum.AMEXTOKENSERVICE) - return "AMEXTOKENSERVICE"; - if (value == TokenServiceEnum.TOKENSHARING) - return "TOKEN_SHARING"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of TokenService - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TokenServiceOption { get; private set; } /// /// The name of the token service. /// /// The name of the token service. - [JsonPropertyName("tokenService")] - public TokenServiceEnum? TokenService { get { return this.TokenServiceOption; } set { this.TokenServiceOption = new Option(value); } } - + [DataMember(Name = "tokenService", EmitDefaultValue = false)] + public TokenServiceEnum? TokenService { get; set; } /// - /// Used to track the state of RecurringDetailName + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailNameOption { get; private set; } + /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts).. + /// A descriptive name for this detail.. + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2.. + /// Minimum number of days between authorisations. Only for 3D Secure 2.. + /// The name of the token service.. + public Recurring(ContractEnum? contract = default(ContractEnum?), string recurringDetailName = default(string), DateTime recurringExpiry = default(DateTime), string recurringFrequency = default(string), TokenServiceEnum? tokenService = default(TokenServiceEnum?)) + { + this.Contract = contract; + this.RecurringDetailName = recurringDetailName; + this.RecurringExpiry = recurringExpiry; + this.RecurringFrequency = recurringFrequency; + this.TokenService = tokenService; + } /// /// A descriptive name for this detail. /// /// A descriptive name for this detail. - [JsonPropertyName("recurringDetailName")] - public string RecurringDetailName { get { return this.RecurringDetailNameOption; } set { this.RecurringDetailNameOption = new Option(value); } } - - /// - /// Used to track the state of RecurringExpiry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringExpiryOption { get; private set; } + [DataMember(Name = "recurringDetailName", EmitDefaultValue = false)] + public string RecurringDetailName { get; set; } /// /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. /// /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. - [JsonPropertyName("recurringExpiry")] - public DateTime? RecurringExpiry { get { return this.RecurringExpiryOption; } set { this.RecurringExpiryOption = new Option(value); } } - - /// - /// Used to track the state of RecurringFrequency - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringFrequencyOption { get; private set; } + [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] + public DateTime RecurringExpiry { get; set; } /// /// Minimum number of days between authorisations. Only for 3D Secure 2. /// /// Minimum number of days between authorisations. Only for 3D Secure 2. - [JsonPropertyName("recurringFrequency")] - public string RecurringFrequency { get { return this.RecurringFrequencyOption; } set { this.RecurringFrequencyOption = new Option(value); } } + [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] + public string RecurringFrequency { get; set; } /// /// Returns the string presentation of the object @@ -313,151 +162,96 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class RecurringJsonConverter : JsonConverter - { /// - /// The format to use to serialize RecurringExpiry + /// Returns true if objects are equal /// - public static string RecurringExpiryFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Recurring); + } /// - /// Deserializes json to + /// Returns true if Recurring instances are equal /// - /// - /// - /// - /// - /// - public override Recurring Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Instance of Recurring to be compared + /// Boolean + public bool Equals(Recurring input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option contract = default; - Option recurringDetailName = default; - Option recurringExpiry = default; - Option recurringFrequency = default; - Option tokenService = default; - - while (utf8JsonReader.Read()) + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "contract": - string contractRawValue = utf8JsonReader.GetString(); - if (contractRawValue != null) - contract = new Option(Recurring.ContractEnumFromStringOrDefault(contractRawValue)); - break; - case "recurringDetailName": - recurringDetailName = new Option(utf8JsonReader.GetString()); - break; - case "recurringExpiry": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - recurringExpiry = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "recurringFrequency": - recurringFrequency = new Option(utf8JsonReader.GetString()); - break; - case "tokenService": - string tokenServiceRawValue = utf8JsonReader.GetString(); - if (tokenServiceRawValue != null) - tokenService = new Option(Recurring.TokenServiceEnumFromStringOrDefault(tokenServiceRawValue)); - break; - default: - break; - } - } + return false; } - - if (contract.IsSet && contract.Value == null) - throw new ArgumentNullException(nameof(contract), "Property is not nullable for class Recurring."); - - if (recurringDetailName.IsSet && recurringDetailName.Value == null) - throw new ArgumentNullException(nameof(recurringDetailName), "Property is not nullable for class Recurring."); - - if (recurringExpiry.IsSet && recurringExpiry.Value == null) - throw new ArgumentNullException(nameof(recurringExpiry), "Property is not nullable for class Recurring."); - - if (recurringFrequency.IsSet && recurringFrequency.Value == null) - throw new ArgumentNullException(nameof(recurringFrequency), "Property is not nullable for class Recurring."); - - if (tokenService.IsSet && tokenService.Value == null) - throw new ArgumentNullException(nameof(tokenService), "Property is not nullable for class Recurring."); - - return new Recurring(contract, recurringDetailName, recurringExpiry, recurringFrequency, tokenService); + return + ( + this.Contract == input.Contract || + this.Contract.Equals(input.Contract) + ) && + ( + this.RecurringDetailName == input.RecurringDetailName || + (this.RecurringDetailName != null && + this.RecurringDetailName.Equals(input.RecurringDetailName)) + ) && + ( + this.RecurringExpiry == input.RecurringExpiry || + (this.RecurringExpiry != null && + this.RecurringExpiry.Equals(input.RecurringExpiry)) + ) && + ( + this.RecurringFrequency == input.RecurringFrequency || + (this.RecurringFrequency != null && + this.RecurringFrequency.Equals(input.RecurringFrequency)) + ) && + ( + this.TokenService == input.TokenService || + this.TokenService.Equals(input.TokenService) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Recurring recurring, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, recurring, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Contract.GetHashCode(); + if (this.RecurringDetailName != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailName.GetHashCode(); + } + if (this.RecurringExpiry != null) + { + hashCode = (hashCode * 59) + this.RecurringExpiry.GetHashCode(); + } + if (this.RecurringFrequency != null) + { + hashCode = (hashCode * 59) + this.RecurringFrequency.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TokenService.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Recurring recurring, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (recurring.RecurringDetailNameOption.IsSet && recurring.RecurringDetailName == null) - throw new ArgumentNullException(nameof(recurring.RecurringDetailName), "Property is required for class Recurring."); - - if (recurring.RecurringFrequencyOption.IsSet && recurring.RecurringFrequency == null) - throw new ArgumentNullException(nameof(recurring.RecurringFrequency), "Property is required for class Recurring."); - - var contractRawValue = Recurring.ContractEnumToJsonValue(recurring.ContractOption.Value.Value); - writer.WriteString("contract", contractRawValue); - if (recurring.RecurringDetailNameOption.IsSet) - writer.WriteString("recurringDetailName", recurring.RecurringDetailName); - - if (recurring.RecurringExpiryOption.IsSet) - writer.WriteString("recurringExpiry", recurring.RecurringExpiryOption.Value.Value.ToString(RecurringExpiryFormat)); - - if (recurring.RecurringFrequencyOption.IsSet) - writer.WriteString("recurringFrequency", recurring.RecurringFrequency); - - var tokenServiceRawValue = Recurring.TokenServiceEnumToJsonValue(recurring.TokenServiceOption.Value.Value); - writer.WriteString("tokenService", tokenServiceRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs b/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs index 50481d749..2daefcefe 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,110 +15,74 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalData3DSecure /// - public partial class ResponseAdditionalData3DSecure : IValidatableObject + [DataContract(Name = "ResponseAdditionalData3DSecure")] + public partial class ResponseAdditionalData3DSecure : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. - /// The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. - /// The CAVV algorithm used. - /// Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** - /// Indicates whether a card is enrolled for 3D Secure 2. - [JsonConstructor] - public ResponseAdditionalData3DSecure(Option cardHolderInfo = default, Option cavv = default, Option cavvAlgorithm = default, Option scaExemptionRequested = default, Option threeds2CardEnrolled = default) + /// Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. . + /// The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array.. + /// The CAVV algorithm used.. + /// Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** . + /// Indicates whether a card is enrolled for 3D Secure 2.. + public ResponseAdditionalData3DSecure(string cardHolderInfo = default(string), string cavv = default(string), string cavvAlgorithm = default(string), string scaExemptionRequested = default(string), bool? threeds2CardEnrolled = default(bool?)) { - CardHolderInfoOption = cardHolderInfo; - CavvOption = cavv; - CavvAlgorithmOption = cavvAlgorithm; - ScaExemptionRequestedOption = scaExemptionRequested; - Threeds2CardEnrolledOption = threeds2CardEnrolled; - OnCreated(); + this.CardHolderInfo = cardHolderInfo; + this.Cavv = cavv; + this.CavvAlgorithm = cavvAlgorithm; + this.ScaExemptionRequested = scaExemptionRequested; + this.Threeds2CardEnrolled = threeds2CardEnrolled; } - partial void OnCreated(); - - /// - /// Used to track the state of CardHolderInfo - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CardHolderInfoOption { get; private set; } - /// /// Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. /// /// Information provided by the issuer to the cardholder. If this field is present, you need to display this information to the cardholder. - [JsonPropertyName("cardHolderInfo")] - public string CardHolderInfo { get { return this.CardHolderInfoOption; } set { this.CardHolderInfoOption = new Option(value); } } - - /// - /// Used to track the state of Cavv - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CavvOption { get; private set; } + [DataMember(Name = "cardHolderInfo", EmitDefaultValue = false)] + public string CardHolderInfo { get; set; } /// /// The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. /// /// The Cardholder Authentication Verification Value (CAVV) for the 3D Secure authentication session, as a Base64-encoded 20-byte array. - [JsonPropertyName("cavv")] - public string Cavv { get { return this.CavvOption; } set { this.CavvOption = new Option(value); } } - - /// - /// Used to track the state of CavvAlgorithm - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CavvAlgorithmOption { get; private set; } + [DataMember(Name = "cavv", EmitDefaultValue = false)] + public string Cavv { get; set; } /// /// The CAVV algorithm used. /// /// The CAVV algorithm used. - [JsonPropertyName("cavvAlgorithm")] - public string CavvAlgorithm { get { return this.CavvAlgorithmOption; } set { this.CavvAlgorithmOption = new Option(value); } } - - /// - /// Used to track the state of ScaExemptionRequested - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ScaExemptionRequestedOption { get; private set; } + [DataMember(Name = "cavvAlgorithm", EmitDefaultValue = false)] + public string CavvAlgorithm { get; set; } /// /// Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** /// /// Shows the [exemption type](https://docs.adyen.com/payments-fundamentals/psd2-sca-compliance-and-implementation-guide#specifypreferenceinyourapirequest) that Adyen requested for the payment. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * **transactionRiskAnalysis** - [JsonPropertyName("scaExemptionRequested")] - public string ScaExemptionRequested { get { return this.ScaExemptionRequestedOption; } set { this.ScaExemptionRequestedOption = new Option(value); } } - - /// - /// Used to track the state of Threeds2CardEnrolled - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option Threeds2CardEnrolledOption { get; private set; } + [DataMember(Name = "scaExemptionRequested", EmitDefaultValue = false)] + public string ScaExemptionRequested { get; set; } /// /// Indicates whether a card is enrolled for 3D Secure 2. /// /// Indicates whether a card is enrolled for 3D Secure 2. - [JsonPropertyName("threeds2.cardEnrolled")] - public bool? Threeds2CardEnrolled { get { return this.Threeds2CardEnrolledOption; } set { this.Threeds2CardEnrolledOption = new Option(value); } } + [DataMember(Name = "threeds2.cardEnrolled", EmitDefaultValue = false)] + public bool? Threeds2CardEnrolled { get; set; } /// /// Returns the string presentation of the object @@ -137,149 +102,100 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ResponseAdditionalData3DSecureJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ResponseAdditionalData3DSecure Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option cardHolderInfo = default; - Option cavv = default; - Option cavvAlgorithm = default; - Option scaExemptionRequested = default; - Option threeds2CardEnrolled = default; + return this.Equals(input as ResponseAdditionalData3DSecure); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ResponseAdditionalData3DSecure instances are equal + /// + /// Instance of ResponseAdditionalData3DSecure to be compared + /// Boolean + public bool Equals(ResponseAdditionalData3DSecure input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "cardHolderInfo": - cardHolderInfo = new Option(utf8JsonReader.GetString()); - break; - case "cavv": - cavv = new Option(utf8JsonReader.GetString()); - break; - case "cavvAlgorithm": - cavvAlgorithm = new Option(utf8JsonReader.GetString()); - break; - case "scaExemptionRequested": - scaExemptionRequested = new Option(utf8JsonReader.GetString()); - break; - case "threeds2.cardEnrolled": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeds2CardEnrolled = new Option(utf8JsonReader.GetBoolean()); - break; - default: - break; - } - } + return false; } - - if (cardHolderInfo.IsSet && cardHolderInfo.Value == null) - throw new ArgumentNullException(nameof(cardHolderInfo), "Property is not nullable for class ResponseAdditionalData3DSecure."); - - if (cavv.IsSet && cavv.Value == null) - throw new ArgumentNullException(nameof(cavv), "Property is not nullable for class ResponseAdditionalData3DSecure."); - - if (cavvAlgorithm.IsSet && cavvAlgorithm.Value == null) - throw new ArgumentNullException(nameof(cavvAlgorithm), "Property is not nullable for class ResponseAdditionalData3DSecure."); - - if (scaExemptionRequested.IsSet && scaExemptionRequested.Value == null) - throw new ArgumentNullException(nameof(scaExemptionRequested), "Property is not nullable for class ResponseAdditionalData3DSecure."); - - if (threeds2CardEnrolled.IsSet && threeds2CardEnrolled.Value == null) - throw new ArgumentNullException(nameof(threeds2CardEnrolled), "Property is not nullable for class ResponseAdditionalData3DSecure."); - - return new ResponseAdditionalData3DSecure(cardHolderInfo, cavv, cavvAlgorithm, scaExemptionRequested, threeds2CardEnrolled); + return + ( + this.CardHolderInfo == input.CardHolderInfo || + (this.CardHolderInfo != null && + this.CardHolderInfo.Equals(input.CardHolderInfo)) + ) && + ( + this.Cavv == input.Cavv || + (this.Cavv != null && + this.Cavv.Equals(input.Cavv)) + ) && + ( + this.CavvAlgorithm == input.CavvAlgorithm || + (this.CavvAlgorithm != null && + this.CavvAlgorithm.Equals(input.CavvAlgorithm)) + ) && + ( + this.ScaExemptionRequested == input.ScaExemptionRequested || + (this.ScaExemptionRequested != null && + this.ScaExemptionRequested.Equals(input.ScaExemptionRequested)) + ) && + ( + this.Threeds2CardEnrolled == input.Threeds2CardEnrolled || + this.Threeds2CardEnrolled.Equals(input.Threeds2CardEnrolled) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ResponseAdditionalData3DSecure responseAdditionalData3DSecure, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, responseAdditionalData3DSecure, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CardHolderInfo != null) + { + hashCode = (hashCode * 59) + this.CardHolderInfo.GetHashCode(); + } + if (this.Cavv != null) + { + hashCode = (hashCode * 59) + this.Cavv.GetHashCode(); + } + if (this.CavvAlgorithm != null) + { + hashCode = (hashCode * 59) + this.CavvAlgorithm.GetHashCode(); + } + if (this.ScaExemptionRequested != null) + { + hashCode = (hashCode * 59) + this.ScaExemptionRequested.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Threeds2CardEnrolled.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalData3DSecure responseAdditionalData3DSecure, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (responseAdditionalData3DSecure.CardHolderInfoOption.IsSet && responseAdditionalData3DSecure.CardHolderInfo == null) - throw new ArgumentNullException(nameof(responseAdditionalData3DSecure.CardHolderInfo), "Property is required for class ResponseAdditionalData3DSecure."); - - if (responseAdditionalData3DSecure.CavvOption.IsSet && responseAdditionalData3DSecure.Cavv == null) - throw new ArgumentNullException(nameof(responseAdditionalData3DSecure.Cavv), "Property is required for class ResponseAdditionalData3DSecure."); - - if (responseAdditionalData3DSecure.CavvAlgorithmOption.IsSet && responseAdditionalData3DSecure.CavvAlgorithm == null) - throw new ArgumentNullException(nameof(responseAdditionalData3DSecure.CavvAlgorithm), "Property is required for class ResponseAdditionalData3DSecure."); - - if (responseAdditionalData3DSecure.ScaExemptionRequestedOption.IsSet && responseAdditionalData3DSecure.ScaExemptionRequested == null) - throw new ArgumentNullException(nameof(responseAdditionalData3DSecure.ScaExemptionRequested), "Property is required for class ResponseAdditionalData3DSecure."); - - if (responseAdditionalData3DSecure.CardHolderInfoOption.IsSet) - writer.WriteString("cardHolderInfo", responseAdditionalData3DSecure.CardHolderInfo); - - if (responseAdditionalData3DSecure.CavvOption.IsSet) - writer.WriteString("cavv", responseAdditionalData3DSecure.Cavv); - - if (responseAdditionalData3DSecure.CavvAlgorithmOption.IsSet) - writer.WriteString("cavvAlgorithm", responseAdditionalData3DSecure.CavvAlgorithm); - - if (responseAdditionalData3DSecure.ScaExemptionRequestedOption.IsSet) - writer.WriteString("scaExemptionRequested", responseAdditionalData3DSecure.ScaExemptionRequested); - - if (responseAdditionalData3DSecure.Threeds2CardEnrolledOption.IsSet) - writer.WriteBoolean("threeds2.cardEnrolled", responseAdditionalData3DSecure.Threeds2CardEnrolledOption.Value.Value); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs b/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs index e9b1843e4..360cc1be5 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,126 +15,83 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataBillingAddress /// - public partial class ResponseAdditionalDataBillingAddress : IValidatableObject + [DataContract(Name = "ResponseAdditionalDataBillingAddress")] + public partial class ResponseAdditionalDataBillingAddress : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The billing address city passed in the payment request. - /// The billing address country passed in the payment request. Example: NL - /// The billing address house number or name passed in the payment request. - /// The billing address postal code passed in the payment request. Example: 1011 DJ - /// The billing address state or province passed in the payment request. Example: NH - /// The billing address street passed in the payment request. - [JsonConstructor] - public ResponseAdditionalDataBillingAddress(Option billingAddressCity = default, Option billingAddressCountry = default, Option billingAddressHouseNumberOrName = default, Option billingAddressPostalCode = default, Option billingAddressStateOrProvince = default, Option billingAddressStreet = default) + /// The billing address city passed in the payment request.. + /// The billing address country passed in the payment request. Example: NL. + /// The billing address house number or name passed in the payment request.. + /// The billing address postal code passed in the payment request. Example: 1011 DJ. + /// The billing address state or province passed in the payment request. Example: NH. + /// The billing address street passed in the payment request.. + public ResponseAdditionalDataBillingAddress(string billingAddressCity = default(string), string billingAddressCountry = default(string), string billingAddressHouseNumberOrName = default(string), string billingAddressPostalCode = default(string), string billingAddressStateOrProvince = default(string), string billingAddressStreet = default(string)) { - BillingAddressCityOption = billingAddressCity; - BillingAddressCountryOption = billingAddressCountry; - BillingAddressHouseNumberOrNameOption = billingAddressHouseNumberOrName; - BillingAddressPostalCodeOption = billingAddressPostalCode; - BillingAddressStateOrProvinceOption = billingAddressStateOrProvince; - BillingAddressStreetOption = billingAddressStreet; - OnCreated(); + this.BillingAddressCity = billingAddressCity; + this.BillingAddressCountry = billingAddressCountry; + this.BillingAddressHouseNumberOrName = billingAddressHouseNumberOrName; + this.BillingAddressPostalCode = billingAddressPostalCode; + this.BillingAddressStateOrProvince = billingAddressStateOrProvince; + this.BillingAddressStreet = billingAddressStreet; } - partial void OnCreated(); - - /// - /// Used to track the state of BillingAddressCity - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressCityOption { get; private set; } - /// /// The billing address city passed in the payment request. /// /// The billing address city passed in the payment request. - [JsonPropertyName("billingAddress.city")] - public string BillingAddressCity { get { return this.BillingAddressCityOption; } set { this.BillingAddressCityOption = new Option(value); } } - - /// - /// Used to track the state of BillingAddressCountry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressCountryOption { get; private set; } + [DataMember(Name = "billingAddress.city", EmitDefaultValue = false)] + public string BillingAddressCity { get; set; } /// /// The billing address country passed in the payment request. Example: NL /// /// The billing address country passed in the payment request. Example: NL - [JsonPropertyName("billingAddress.country")] - public string BillingAddressCountry { get { return this.BillingAddressCountryOption; } set { this.BillingAddressCountryOption = new Option(value); } } - - /// - /// Used to track the state of BillingAddressHouseNumberOrName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressHouseNumberOrNameOption { get; private set; } + [DataMember(Name = "billingAddress.country", EmitDefaultValue = false)] + public string BillingAddressCountry { get; set; } /// /// The billing address house number or name passed in the payment request. /// /// The billing address house number or name passed in the payment request. - [JsonPropertyName("billingAddress.houseNumberOrName")] - public string BillingAddressHouseNumberOrName { get { return this.BillingAddressHouseNumberOrNameOption; } set { this.BillingAddressHouseNumberOrNameOption = new Option(value); } } - - /// - /// Used to track the state of BillingAddressPostalCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressPostalCodeOption { get; private set; } + [DataMember(Name = "billingAddress.houseNumberOrName", EmitDefaultValue = false)] + public string BillingAddressHouseNumberOrName { get; set; } /// /// The billing address postal code passed in the payment request. Example: 1011 DJ /// /// The billing address postal code passed in the payment request. Example: 1011 DJ - [JsonPropertyName("billingAddress.postalCode")] - public string BillingAddressPostalCode { get { return this.BillingAddressPostalCodeOption; } set { this.BillingAddressPostalCodeOption = new Option(value); } } - - /// - /// Used to track the state of BillingAddressStateOrProvince - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressStateOrProvinceOption { get; private set; } + [DataMember(Name = "billingAddress.postalCode", EmitDefaultValue = false)] + public string BillingAddressPostalCode { get; set; } /// /// The billing address state or province passed in the payment request. Example: NH /// /// The billing address state or province passed in the payment request. Example: NH - [JsonPropertyName("billingAddress.stateOrProvince")] - public string BillingAddressStateOrProvince { get { return this.BillingAddressStateOrProvinceOption; } set { this.BillingAddressStateOrProvinceOption = new Option(value); } } - - /// - /// Used to track the state of BillingAddressStreet - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressStreetOption { get; private set; } + [DataMember(Name = "billingAddress.stateOrProvince", EmitDefaultValue = false)] + public string BillingAddressStateOrProvince { get; set; } /// /// The billing address street passed in the payment request. /// /// The billing address street passed in the payment request. - [JsonPropertyName("billingAddress.street")] - public string BillingAddressStreet { get { return this.BillingAddressStreetOption; } set { this.BillingAddressStreetOption = new Option(value); } } + [DataMember(Name = "billingAddress.street", EmitDefaultValue = false)] + public string BillingAddressStreet { get; set; } /// /// Returns the string presentation of the object @@ -154,164 +112,113 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ResponseAdditionalDataBillingAddressJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ResponseAdditionalDataBillingAddress Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option billingAddressCity = default; - Option billingAddressCountry = default; - Option billingAddressHouseNumberOrName = default; - Option billingAddressPostalCode = default; - Option billingAddressStateOrProvince = default; - Option billingAddressStreet = default; + return this.Equals(input as ResponseAdditionalDataBillingAddress); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ResponseAdditionalDataBillingAddress instances are equal + /// + /// Instance of ResponseAdditionalDataBillingAddress to be compared + /// Boolean + public bool Equals(ResponseAdditionalDataBillingAddress input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "billingAddress.city": - billingAddressCity = new Option(utf8JsonReader.GetString()); - break; - case "billingAddress.country": - billingAddressCountry = new Option(utf8JsonReader.GetString()); - break; - case "billingAddress.houseNumberOrName": - billingAddressHouseNumberOrName = new Option(utf8JsonReader.GetString()); - break; - case "billingAddress.postalCode": - billingAddressPostalCode = new Option(utf8JsonReader.GetString()); - break; - case "billingAddress.stateOrProvince": - billingAddressStateOrProvince = new Option(utf8JsonReader.GetString()); - break; - case "billingAddress.street": - billingAddressStreet = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (billingAddressCity.IsSet && billingAddressCity.Value == null) - throw new ArgumentNullException(nameof(billingAddressCity), "Property is not nullable for class ResponseAdditionalDataBillingAddress."); - - if (billingAddressCountry.IsSet && billingAddressCountry.Value == null) - throw new ArgumentNullException(nameof(billingAddressCountry), "Property is not nullable for class ResponseAdditionalDataBillingAddress."); - - if (billingAddressHouseNumberOrName.IsSet && billingAddressHouseNumberOrName.Value == null) - throw new ArgumentNullException(nameof(billingAddressHouseNumberOrName), "Property is not nullable for class ResponseAdditionalDataBillingAddress."); - - if (billingAddressPostalCode.IsSet && billingAddressPostalCode.Value == null) - throw new ArgumentNullException(nameof(billingAddressPostalCode), "Property is not nullable for class ResponseAdditionalDataBillingAddress."); - - if (billingAddressStateOrProvince.IsSet && billingAddressStateOrProvince.Value == null) - throw new ArgumentNullException(nameof(billingAddressStateOrProvince), "Property is not nullable for class ResponseAdditionalDataBillingAddress."); - - if (billingAddressStreet.IsSet && billingAddressStreet.Value == null) - throw new ArgumentNullException(nameof(billingAddressStreet), "Property is not nullable for class ResponseAdditionalDataBillingAddress."); - - return new ResponseAdditionalDataBillingAddress(billingAddressCity, billingAddressCountry, billingAddressHouseNumberOrName, billingAddressPostalCode, billingAddressStateOrProvince, billingAddressStreet); + return + ( + this.BillingAddressCity == input.BillingAddressCity || + (this.BillingAddressCity != null && + this.BillingAddressCity.Equals(input.BillingAddressCity)) + ) && + ( + this.BillingAddressCountry == input.BillingAddressCountry || + (this.BillingAddressCountry != null && + this.BillingAddressCountry.Equals(input.BillingAddressCountry)) + ) && + ( + this.BillingAddressHouseNumberOrName == input.BillingAddressHouseNumberOrName || + (this.BillingAddressHouseNumberOrName != null && + this.BillingAddressHouseNumberOrName.Equals(input.BillingAddressHouseNumberOrName)) + ) && + ( + this.BillingAddressPostalCode == input.BillingAddressPostalCode || + (this.BillingAddressPostalCode != null && + this.BillingAddressPostalCode.Equals(input.BillingAddressPostalCode)) + ) && + ( + this.BillingAddressStateOrProvince == input.BillingAddressStateOrProvince || + (this.BillingAddressStateOrProvince != null && + this.BillingAddressStateOrProvince.Equals(input.BillingAddressStateOrProvince)) + ) && + ( + this.BillingAddressStreet == input.BillingAddressStreet || + (this.BillingAddressStreet != null && + this.BillingAddressStreet.Equals(input.BillingAddressStreet)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataBillingAddress responseAdditionalDataBillingAddress, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, responseAdditionalDataBillingAddress, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.BillingAddressCity != null) + { + hashCode = (hashCode * 59) + this.BillingAddressCity.GetHashCode(); + } + if (this.BillingAddressCountry != null) + { + hashCode = (hashCode * 59) + this.BillingAddressCountry.GetHashCode(); + } + if (this.BillingAddressHouseNumberOrName != null) + { + hashCode = (hashCode * 59) + this.BillingAddressHouseNumberOrName.GetHashCode(); + } + if (this.BillingAddressPostalCode != null) + { + hashCode = (hashCode * 59) + this.BillingAddressPostalCode.GetHashCode(); + } + if (this.BillingAddressStateOrProvince != null) + { + hashCode = (hashCode * 59) + this.BillingAddressStateOrProvince.GetHashCode(); + } + if (this.BillingAddressStreet != null) + { + hashCode = (hashCode * 59) + this.BillingAddressStreet.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataBillingAddress responseAdditionalDataBillingAddress, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (responseAdditionalDataBillingAddress.BillingAddressCityOption.IsSet && responseAdditionalDataBillingAddress.BillingAddressCity == null) - throw new ArgumentNullException(nameof(responseAdditionalDataBillingAddress.BillingAddressCity), "Property is required for class ResponseAdditionalDataBillingAddress."); - - if (responseAdditionalDataBillingAddress.BillingAddressCountryOption.IsSet && responseAdditionalDataBillingAddress.BillingAddressCountry == null) - throw new ArgumentNullException(nameof(responseAdditionalDataBillingAddress.BillingAddressCountry), "Property is required for class ResponseAdditionalDataBillingAddress."); - - if (responseAdditionalDataBillingAddress.BillingAddressHouseNumberOrNameOption.IsSet && responseAdditionalDataBillingAddress.BillingAddressHouseNumberOrName == null) - throw new ArgumentNullException(nameof(responseAdditionalDataBillingAddress.BillingAddressHouseNumberOrName), "Property is required for class ResponseAdditionalDataBillingAddress."); - - if (responseAdditionalDataBillingAddress.BillingAddressPostalCodeOption.IsSet && responseAdditionalDataBillingAddress.BillingAddressPostalCode == null) - throw new ArgumentNullException(nameof(responseAdditionalDataBillingAddress.BillingAddressPostalCode), "Property is required for class ResponseAdditionalDataBillingAddress."); - - if (responseAdditionalDataBillingAddress.BillingAddressStateOrProvinceOption.IsSet && responseAdditionalDataBillingAddress.BillingAddressStateOrProvince == null) - throw new ArgumentNullException(nameof(responseAdditionalDataBillingAddress.BillingAddressStateOrProvince), "Property is required for class ResponseAdditionalDataBillingAddress."); - - if (responseAdditionalDataBillingAddress.BillingAddressStreetOption.IsSet && responseAdditionalDataBillingAddress.BillingAddressStreet == null) - throw new ArgumentNullException(nameof(responseAdditionalDataBillingAddress.BillingAddressStreet), "Property is required for class ResponseAdditionalDataBillingAddress."); - - if (responseAdditionalDataBillingAddress.BillingAddressCityOption.IsSet) - writer.WriteString("billingAddress.city", responseAdditionalDataBillingAddress.BillingAddressCity); - - if (responseAdditionalDataBillingAddress.BillingAddressCountryOption.IsSet) - writer.WriteString("billingAddress.country", responseAdditionalDataBillingAddress.BillingAddressCountry); - - if (responseAdditionalDataBillingAddress.BillingAddressHouseNumberOrNameOption.IsSet) - writer.WriteString("billingAddress.houseNumberOrName", responseAdditionalDataBillingAddress.BillingAddressHouseNumberOrName); - - if (responseAdditionalDataBillingAddress.BillingAddressPostalCodeOption.IsSet) - writer.WriteString("billingAddress.postalCode", responseAdditionalDataBillingAddress.BillingAddressPostalCode); - - if (responseAdditionalDataBillingAddress.BillingAddressStateOrProvinceOption.IsSet) - writer.WriteString("billingAddress.stateOrProvince", responseAdditionalDataBillingAddress.BillingAddressStateOrProvince); - - if (responseAdditionalDataBillingAddress.BillingAddressStreetOption.IsSet) - writer.WriteString("billingAddress.street", responseAdditionalDataBillingAddress.BillingAddressStreet); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataCard.cs b/Adyen/Model/Checkout/ResponseAdditionalDataCard.cs index c90424d89..98107c5d3 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataCard.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataCard.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,367 +15,185 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataCard /// - public partial class ResponseAdditionalDataCard : IValidatableObject + [DataContract(Name = "ResponseAdditionalDataCard")] + public partial class ResponseAdditionalDataCard : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The first six digits of the card number. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with a six-digit BIN. Example: 521234 - /// The cardholder name passed in the payment request. - /// The bank or the financial institution granting lines of credit through card association branded payment cards. This information can be included when available. - /// The country where the card was issued. Example: US - /// The currency in which the card is issued, if this information is available. Provided as the currency code or currency number from the ISO-4217 standard. Example: USD - /// The card payment method used for the transaction. Example: amex - /// The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit - /// The last four digits of a card number. > Returned only in case of a card payment. - /// The first eight digits of the card number. Only returned if the card number is 16 digits or more. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with an eight-digit BIN. Example: 52123423 - [JsonConstructor] - public ResponseAdditionalDataCard(Option cardBin = default, Option cardHolderName = default, Option cardIssuingBank = default, Option cardIssuingCountry = default, Option cardIssuingCurrency = default, Option cardPaymentMethod = default, Option cardProductId = default, Option cardSummary = default, Option issuerBin = default) - { - CardBinOption = cardBin; - CardHolderNameOption = cardHolderName; - CardIssuingBankOption = cardIssuingBank; - CardIssuingCountryOption = cardIssuingCountry; - CardIssuingCurrencyOption = cardIssuingCurrency; - CardPaymentMethodOption = cardPaymentMethod; - CardProductIdOption = cardProductId; - CardSummaryOption = cardSummary; - IssuerBinOption = issuerBin; - OnCreated(); - } - - partial void OnCreated(); - /// /// The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit /// /// The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit + [JsonConverter(typeof(StringEnumConverter))] public enum CardProductIdEnum { /// /// Enum A for value: A /// + [EnumMember(Value = "A")] A = 1, /// /// Enum B for value: B /// + [EnumMember(Value = "B")] B = 2, /// /// Enum C for value: C /// + [EnumMember(Value = "C")] C = 3, /// /// Enum D for value: D /// + [EnumMember(Value = "D")] D = 4, /// /// Enum F for value: F /// + [EnumMember(Value = "F")] F = 5, /// /// Enum MCC for value: MCC /// + [EnumMember(Value = "MCC")] MCC = 6, /// /// Enum MCE for value: MCE /// + [EnumMember(Value = "MCE")] MCE = 7, /// /// Enum MCF for value: MCF /// + [EnumMember(Value = "MCF")] MCF = 8, /// /// Enum MCG for value: MCG /// + [EnumMember(Value = "MCG")] MCG = 9, /// /// Enum MCH for value: MCH /// + [EnumMember(Value = "MCH")] MCH = 10, /// /// Enum MCI for value: MCI /// + [EnumMember(Value = "MCI")] MCI = 11 - } - - /// - /// Returns a - /// - /// - /// - /// - public static CardProductIdEnum CardProductIdEnumFromString(string value) - { - if (value.Equals("A")) - return CardProductIdEnum.A; - - if (value.Equals("B")) - return CardProductIdEnum.B; - - if (value.Equals("C")) - return CardProductIdEnum.C; - - if (value.Equals("D")) - return CardProductIdEnum.D; - - if (value.Equals("F")) - return CardProductIdEnum.F; - - if (value.Equals("MCC")) - return CardProductIdEnum.MCC; - - if (value.Equals("MCE")) - return CardProductIdEnum.MCE; - - if (value.Equals("MCF")) - return CardProductIdEnum.MCF; - - if (value.Equals("MCG")) - return CardProductIdEnum.MCG; - - if (value.Equals("MCH")) - return CardProductIdEnum.MCH; - - if (value.Equals("MCI")) - return CardProductIdEnum.MCI; - - throw new NotImplementedException($"Could not convert value to type CardProductIdEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static CardProductIdEnum? CardProductIdEnumFromStringOrDefault(string value) - { - if (value.Equals("A")) - return CardProductIdEnum.A; - - if (value.Equals("B")) - return CardProductIdEnum.B; - - if (value.Equals("C")) - return CardProductIdEnum.C; - - if (value.Equals("D")) - return CardProductIdEnum.D; - - if (value.Equals("F")) - return CardProductIdEnum.F; - - if (value.Equals("MCC")) - return CardProductIdEnum.MCC; - - if (value.Equals("MCE")) - return CardProductIdEnum.MCE; - - if (value.Equals("MCF")) - return CardProductIdEnum.MCF; - - if (value.Equals("MCG")) - return CardProductIdEnum.MCG; - - if (value.Equals("MCH")) - return CardProductIdEnum.MCH; - - if (value.Equals("MCI")) - return CardProductIdEnum.MCI; - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string CardProductIdEnumToJsonValue(CardProductIdEnum? value) - { - if (value == CardProductIdEnum.A) - return "A"; - - if (value == CardProductIdEnum.B) - return "B"; - - if (value == CardProductIdEnum.C) - return "C"; - - if (value == CardProductIdEnum.D) - return "D"; - - if (value == CardProductIdEnum.F) - return "F"; - - if (value == CardProductIdEnum.MCC) - return "MCC"; - - if (value == CardProductIdEnum.MCE) - return "MCE"; - - if (value == CardProductIdEnum.MCF) - return "MCF"; - - if (value == CardProductIdEnum.MCG) - return "MCG"; - - if (value == CardProductIdEnum.MCH) - return "MCH"; - - if (value == CardProductIdEnum.MCI) - return "MCI"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of CardProductId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CardProductIdOption { get; private set; } /// /// The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit /// /// The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit - [JsonPropertyName("cardProductId")] - public CardProductIdEnum? CardProductId { get { return this.CardProductIdOption; } set { this.CardProductIdOption = new Option(value); } } - + [DataMember(Name = "cardProductId", EmitDefaultValue = false)] + public CardProductIdEnum? CardProductId { get; set; } /// - /// Used to track the state of CardBin + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CardBinOption { get; private set; } + /// The first six digits of the card number. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with a six-digit BIN. Example: 521234. + /// The cardholder name passed in the payment request.. + /// The bank or the financial institution granting lines of credit through card association branded payment cards. This information can be included when available.. + /// The country where the card was issued. Example: US. + /// The currency in which the card is issued, if this information is available. Provided as the currency code or currency number from the ISO-4217 standard. Example: USD. + /// The card payment method used for the transaction. Example: amex. + /// The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit . + /// The last four digits of a card number. > Returned only in case of a card payment.. + /// The first eight digits of the card number. Only returned if the card number is 16 digits or more. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with an eight-digit BIN. Example: 52123423. + public ResponseAdditionalDataCard(string cardBin = default(string), string cardHolderName = default(string), string cardIssuingBank = default(string), string cardIssuingCountry = default(string), string cardIssuingCurrency = default(string), string cardPaymentMethod = default(string), CardProductIdEnum? cardProductId = default(CardProductIdEnum?), string cardSummary = default(string), string issuerBin = default(string)) + { + this.CardBin = cardBin; + this.CardHolderName = cardHolderName; + this.CardIssuingBank = cardIssuingBank; + this.CardIssuingCountry = cardIssuingCountry; + this.CardIssuingCurrency = cardIssuingCurrency; + this.CardPaymentMethod = cardPaymentMethod; + this.CardProductId = cardProductId; + this.CardSummary = cardSummary; + this.IssuerBin = issuerBin; + } /// /// The first six digits of the card number. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with a six-digit BIN. Example: 521234 /// /// The first six digits of the card number. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with a six-digit BIN. Example: 521234 - [JsonPropertyName("cardBin")] - public string CardBin { get { return this.CardBinOption; } set { this.CardBinOption = new Option(value); } } - - /// - /// Used to track the state of CardHolderName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CardHolderNameOption { get; private set; } + [DataMember(Name = "cardBin", EmitDefaultValue = false)] + public string CardBin { get; set; } /// /// The cardholder name passed in the payment request. /// /// The cardholder name passed in the payment request. - [JsonPropertyName("cardHolderName")] - public string CardHolderName { get { return this.CardHolderNameOption; } set { this.CardHolderNameOption = new Option(value); } } - - /// - /// Used to track the state of CardIssuingBank - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CardIssuingBankOption { get; private set; } + [DataMember(Name = "cardHolderName", EmitDefaultValue = false)] + public string CardHolderName { get; set; } /// /// The bank or the financial institution granting lines of credit through card association branded payment cards. This information can be included when available. /// /// The bank or the financial institution granting lines of credit through card association branded payment cards. This information can be included when available. - [JsonPropertyName("cardIssuingBank")] - public string CardIssuingBank { get { return this.CardIssuingBankOption; } set { this.CardIssuingBankOption = new Option(value); } } - - /// - /// Used to track the state of CardIssuingCountry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CardIssuingCountryOption { get; private set; } + [DataMember(Name = "cardIssuingBank", EmitDefaultValue = false)] + public string CardIssuingBank { get; set; } /// /// The country where the card was issued. Example: US /// /// The country where the card was issued. Example: US - [JsonPropertyName("cardIssuingCountry")] - public string CardIssuingCountry { get { return this.CardIssuingCountryOption; } set { this.CardIssuingCountryOption = new Option(value); } } - - /// - /// Used to track the state of CardIssuingCurrency - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CardIssuingCurrencyOption { get; private set; } + [DataMember(Name = "cardIssuingCountry", EmitDefaultValue = false)] + public string CardIssuingCountry { get; set; } /// /// The currency in which the card is issued, if this information is available. Provided as the currency code or currency number from the ISO-4217 standard. Example: USD /// /// The currency in which the card is issued, if this information is available. Provided as the currency code or currency number from the ISO-4217 standard. Example: USD - [JsonPropertyName("cardIssuingCurrency")] - public string CardIssuingCurrency { get { return this.CardIssuingCurrencyOption; } set { this.CardIssuingCurrencyOption = new Option(value); } } - - /// - /// Used to track the state of CardPaymentMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CardPaymentMethodOption { get; private set; } + [DataMember(Name = "cardIssuingCurrency", EmitDefaultValue = false)] + public string CardIssuingCurrency { get; set; } /// /// The card payment method used for the transaction. Example: amex /// /// The card payment method used for the transaction. Example: amex - [JsonPropertyName("cardPaymentMethod")] - public string CardPaymentMethod { get { return this.CardPaymentMethodOption; } set { this.CardPaymentMethodOption = new Option(value); } } - - /// - /// Used to track the state of CardSummary - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CardSummaryOption { get; private set; } + [DataMember(Name = "cardPaymentMethod", EmitDefaultValue = false)] + public string CardPaymentMethod { get; set; } /// /// The last four digits of a card number. > Returned only in case of a card payment. /// /// The last four digits of a card number. > Returned only in case of a card payment. - [JsonPropertyName("cardSummary")] - public string CardSummary { get { return this.CardSummaryOption; } set { this.CardSummaryOption = new Option(value); } } - - /// - /// Used to track the state of IssuerBin - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IssuerBinOption { get; private set; } + [DataMember(Name = "cardSummary", EmitDefaultValue = false)] + public string CardSummary { get; set; } /// /// The first eight digits of the card number. Only returned if the card number is 16 digits or more. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with an eight-digit BIN. Example: 52123423 /// /// The first eight digits of the card number. Only returned if the card number is 16 digits or more. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with an eight-digit BIN. Example: 52123423 - [JsonPropertyName("issuerBin")] - public string IssuerBin { get { return this.IssuerBinOption; } set { this.IssuerBinOption = new Option(value); } } + [DataMember(Name = "issuerBin", EmitDefaultValue = false)] + public string IssuerBin { get; set; } /// /// Returns the string presentation of the object @@ -398,201 +217,136 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ResponseAdditionalDataCardJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ResponseAdditionalDataCard Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option cardBin = default; - Option cardHolderName = default; - Option cardIssuingBank = default; - Option cardIssuingCountry = default; - Option cardIssuingCurrency = default; - Option cardPaymentMethod = default; - Option cardProductId = default; - Option cardSummary = default; - Option issuerBin = default; + return this.Equals(input as ResponseAdditionalDataCard); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ResponseAdditionalDataCard instances are equal + /// + /// Instance of ResponseAdditionalDataCard to be compared + /// Boolean + public bool Equals(ResponseAdditionalDataCard input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "cardBin": - cardBin = new Option(utf8JsonReader.GetString()); - break; - case "cardHolderName": - cardHolderName = new Option(utf8JsonReader.GetString()); - break; - case "cardIssuingBank": - cardIssuingBank = new Option(utf8JsonReader.GetString()); - break; - case "cardIssuingCountry": - cardIssuingCountry = new Option(utf8JsonReader.GetString()); - break; - case "cardIssuingCurrency": - cardIssuingCurrency = new Option(utf8JsonReader.GetString()); - break; - case "cardPaymentMethod": - cardPaymentMethod = new Option(utf8JsonReader.GetString()); - break; - case "cardProductId": - string cardProductIdRawValue = utf8JsonReader.GetString(); - if (cardProductIdRawValue != null) - cardProductId = new Option(ResponseAdditionalDataCard.CardProductIdEnumFromStringOrDefault(cardProductIdRawValue)); - break; - case "cardSummary": - cardSummary = new Option(utf8JsonReader.GetString()); - break; - case "issuerBin": - issuerBin = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (cardBin.IsSet && cardBin.Value == null) - throw new ArgumentNullException(nameof(cardBin), "Property is not nullable for class ResponseAdditionalDataCard."); - - if (cardHolderName.IsSet && cardHolderName.Value == null) - throw new ArgumentNullException(nameof(cardHolderName), "Property is not nullable for class ResponseAdditionalDataCard."); - - if (cardIssuingBank.IsSet && cardIssuingBank.Value == null) - throw new ArgumentNullException(nameof(cardIssuingBank), "Property is not nullable for class ResponseAdditionalDataCard."); - - if (cardIssuingCountry.IsSet && cardIssuingCountry.Value == null) - throw new ArgumentNullException(nameof(cardIssuingCountry), "Property is not nullable for class ResponseAdditionalDataCard."); - - if (cardIssuingCurrency.IsSet && cardIssuingCurrency.Value == null) - throw new ArgumentNullException(nameof(cardIssuingCurrency), "Property is not nullable for class ResponseAdditionalDataCard."); - - if (cardPaymentMethod.IsSet && cardPaymentMethod.Value == null) - throw new ArgumentNullException(nameof(cardPaymentMethod), "Property is not nullable for class ResponseAdditionalDataCard."); - - if (cardProductId.IsSet && cardProductId.Value == null) - throw new ArgumentNullException(nameof(cardProductId), "Property is not nullable for class ResponseAdditionalDataCard."); - - if (cardSummary.IsSet && cardSummary.Value == null) - throw new ArgumentNullException(nameof(cardSummary), "Property is not nullable for class ResponseAdditionalDataCard."); - - if (issuerBin.IsSet && issuerBin.Value == null) - throw new ArgumentNullException(nameof(issuerBin), "Property is not nullable for class ResponseAdditionalDataCard."); - - return new ResponseAdditionalDataCard(cardBin, cardHolderName, cardIssuingBank, cardIssuingCountry, cardIssuingCurrency, cardPaymentMethod, cardProductId, cardSummary, issuerBin); + return + ( + this.CardBin == input.CardBin || + (this.CardBin != null && + this.CardBin.Equals(input.CardBin)) + ) && + ( + this.CardHolderName == input.CardHolderName || + (this.CardHolderName != null && + this.CardHolderName.Equals(input.CardHolderName)) + ) && + ( + this.CardIssuingBank == input.CardIssuingBank || + (this.CardIssuingBank != null && + this.CardIssuingBank.Equals(input.CardIssuingBank)) + ) && + ( + this.CardIssuingCountry == input.CardIssuingCountry || + (this.CardIssuingCountry != null && + this.CardIssuingCountry.Equals(input.CardIssuingCountry)) + ) && + ( + this.CardIssuingCurrency == input.CardIssuingCurrency || + (this.CardIssuingCurrency != null && + this.CardIssuingCurrency.Equals(input.CardIssuingCurrency)) + ) && + ( + this.CardPaymentMethod == input.CardPaymentMethod || + (this.CardPaymentMethod != null && + this.CardPaymentMethod.Equals(input.CardPaymentMethod)) + ) && + ( + this.CardProductId == input.CardProductId || + this.CardProductId.Equals(input.CardProductId) + ) && + ( + this.CardSummary == input.CardSummary || + (this.CardSummary != null && + this.CardSummary.Equals(input.CardSummary)) + ) && + ( + this.IssuerBin == input.IssuerBin || + (this.IssuerBin != null && + this.IssuerBin.Equals(input.IssuerBin)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataCard responseAdditionalDataCard, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, responseAdditionalDataCard, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CardBin != null) + { + hashCode = (hashCode * 59) + this.CardBin.GetHashCode(); + } + if (this.CardHolderName != null) + { + hashCode = (hashCode * 59) + this.CardHolderName.GetHashCode(); + } + if (this.CardIssuingBank != null) + { + hashCode = (hashCode * 59) + this.CardIssuingBank.GetHashCode(); + } + if (this.CardIssuingCountry != null) + { + hashCode = (hashCode * 59) + this.CardIssuingCountry.GetHashCode(); + } + if (this.CardIssuingCurrency != null) + { + hashCode = (hashCode * 59) + this.CardIssuingCurrency.GetHashCode(); + } + if (this.CardPaymentMethod != null) + { + hashCode = (hashCode * 59) + this.CardPaymentMethod.GetHashCode(); + } + hashCode = (hashCode * 59) + this.CardProductId.GetHashCode(); + if (this.CardSummary != null) + { + hashCode = (hashCode * 59) + this.CardSummary.GetHashCode(); + } + if (this.IssuerBin != null) + { + hashCode = (hashCode * 59) + this.IssuerBin.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataCard responseAdditionalDataCard, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (responseAdditionalDataCard.CardBinOption.IsSet && responseAdditionalDataCard.CardBin == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardBin), "Property is required for class ResponseAdditionalDataCard."); - - if (responseAdditionalDataCard.CardHolderNameOption.IsSet && responseAdditionalDataCard.CardHolderName == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardHolderName), "Property is required for class ResponseAdditionalDataCard."); - - if (responseAdditionalDataCard.CardIssuingBankOption.IsSet && responseAdditionalDataCard.CardIssuingBank == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardIssuingBank), "Property is required for class ResponseAdditionalDataCard."); - - if (responseAdditionalDataCard.CardIssuingCountryOption.IsSet && responseAdditionalDataCard.CardIssuingCountry == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardIssuingCountry), "Property is required for class ResponseAdditionalDataCard."); - - if (responseAdditionalDataCard.CardIssuingCurrencyOption.IsSet && responseAdditionalDataCard.CardIssuingCurrency == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardIssuingCurrency), "Property is required for class ResponseAdditionalDataCard."); - - if (responseAdditionalDataCard.CardPaymentMethodOption.IsSet && responseAdditionalDataCard.CardPaymentMethod == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardPaymentMethod), "Property is required for class ResponseAdditionalDataCard."); - - if (responseAdditionalDataCard.CardSummaryOption.IsSet && responseAdditionalDataCard.CardSummary == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCard.CardSummary), "Property is required for class ResponseAdditionalDataCard."); - - if (responseAdditionalDataCard.IssuerBinOption.IsSet && responseAdditionalDataCard.IssuerBin == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCard.IssuerBin), "Property is required for class ResponseAdditionalDataCard."); - - if (responseAdditionalDataCard.CardBinOption.IsSet) - writer.WriteString("cardBin", responseAdditionalDataCard.CardBin); - - if (responseAdditionalDataCard.CardHolderNameOption.IsSet) - writer.WriteString("cardHolderName", responseAdditionalDataCard.CardHolderName); - - if (responseAdditionalDataCard.CardIssuingBankOption.IsSet) - writer.WriteString("cardIssuingBank", responseAdditionalDataCard.CardIssuingBank); - - if (responseAdditionalDataCard.CardIssuingCountryOption.IsSet) - writer.WriteString("cardIssuingCountry", responseAdditionalDataCard.CardIssuingCountry); - - if (responseAdditionalDataCard.CardIssuingCurrencyOption.IsSet) - writer.WriteString("cardIssuingCurrency", responseAdditionalDataCard.CardIssuingCurrency); - - if (responseAdditionalDataCard.CardPaymentMethodOption.IsSet) - writer.WriteString("cardPaymentMethod", responseAdditionalDataCard.CardPaymentMethod); - - var cardProductIdRawValue = ResponseAdditionalDataCard.CardProductIdEnumToJsonValue(responseAdditionalDataCard.CardProductIdOption.Value.Value); - writer.WriteString("cardProductId", cardProductIdRawValue); - if (responseAdditionalDataCard.CardSummaryOption.IsSet) - writer.WriteString("cardSummary", responseAdditionalDataCard.CardSummary); - - if (responseAdditionalDataCard.IssuerBinOption.IsSet) - writer.WriteString("issuerBin", responseAdditionalDataCard.IssuerBin); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs b/Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs index 737f24698..914418d3a 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,1380 +15,712 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataCommon /// - public partial class ResponseAdditionalDataCommon : IValidatableObject + [DataContract(Name = "ResponseAdditionalDataCommon")] + public partial class ResponseAdditionalDataCommon : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The name of the Adyen acquirer account. Example: PayPalSandbox_TestAcquirer > Only relevant for PayPal transactions. - /// The name of the acquirer processing the payment request. Example: TestPmmAcquirer - /// The reference number that can be used for reconciliation in case a non-Adyen acquirer is used for settlement. Example: 7C9N3FNBKT9 - /// The Adyen alias of the card. Example: H167852639363479 - /// The type of the card alias. Example: Default - /// Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. Example: 58747 - /// Merchant ID known by the acquirer. - /// The currency of the authorised amount, as a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). - /// Value of the amount authorised. This amount is represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). - /// The AVS result code of the payment, which provides information about the outcome of the AVS check. For possible values, see [AVS](https://docs.adyen.com/risk-management/configure-standard-risk-rules/consistency-rules#billing-address-does-not-match-cardholder-address-avs). - /// Raw AVS result received from the acquirer, where available. Example: D - /// BIC of a bank account. Example: TESTNL01 > Only relevant for SEPA Direct Debit transactions. - /// Includes the co-branded card information. - /// The result of CVC verification. - /// The raw result of CVC verification. - /// Supported for 3D Secure 2. The unique transaction identifier assigned by the DS to identify a single transaction. - /// The Electronic Commerce Indicator returned from the schemes for the 3DS payment session. Example: 02 - /// The expiry date on the card. Example: 6/2016 > Returned only in case of a card payment. - /// The currency of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. Example: EUR - /// The value of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. The amount is in minor units. - /// The fraud score due to a particular fraud check. The fraud check name is found in the key of the key-value pair. - /// Indicates if the payment is sent to manual review. - /// The fraud result properties of the payment. - /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh > - /// Information regarding the funding type of the card. The possible return values are: * CHARGE * CREDIT * DEBIT * PREPAID * PREPAID_RELOADABLE * PREPAID_NONRELOADABLE * DEFFERED_DEBIT > This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. For receiving this field in the notification, enable **Include Funding Source** in **Notifications** > **Additional settings**. - /// Indicates availability of funds. Visa: * \"I\" (fast funds are supported) * \"N\" (otherwise) Mastercard: * \"I\" (product type is Prepaid or Debit, or issuing country is in CEE/HGEM list) * \"N\" (otherwise) > Returned when you verify a card BIN or estimate costs, and only if payoutEligible is \"Y\" or \"D\". - /// Provides the more granular indication of why a transaction was refused. When a transaction fails with either \"Refused\", \"Restricted Card\", \"Transaction Not Permitted\", \"Not supported\" or \"DeclinedNon Generic\" refusalReason from the issuer, Adyen cross references its PSP-wide data for extra insight into the refusal reason. If an inferred refusal reason is available, the `inferredRefusalReason`, field is populated and the `refusalReason`, is set to \"Not Supported\". Possible values: * 3D Secure Mandated * Closed Account * ContAuth Not Supported * CVC Mandated * Ecommerce Not Allowed * Crossborder Not Supported * Card Updated * Low Authrate Bin * Non-reloadable prepaid card - /// Indicates if the card is used for business purposes only. - /// The issuing country of the card based on the BIN list that Adyen maintains. Example: JP - /// A Boolean value indicating whether a liability shift was offered for this payment. - /// The `mcBankNetReferenceNumber`, is a minimum of six characters and a maximum of nine characters long. > Contact Support Team to enable this field. - /// The Merchant Advice Code (MAC) can be returned by Mastercard issuers for refused payments. If present, the MAC contains information about why the payment failed, and whether it can be retried. For more information see [Mastercard Merchant Advice Codes](https://docs.adyen.com/development-resources/raw-acquirer-responses#mastercard-merchant-advice-codes). - /// The reference provided for the transaction. - /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. - /// The owner name of a bank account. Only relevant for SEPA Direct Debit transactions. - /// The Payment Account Reference (PAR) value links a network token with the underlying primary account number (PAN). The PAR value consists of 29 uppercase alphanumeric characters. - /// The payment method used in the transaction. - /// The Adyen sub-variant of the payment method used for the payment request. For more information, refer to [PaymentMethodVariant](https://docs.adyen.com/development-resources/paymentmethodvariant). Example: mcpro - /// Indicates whether a payout is eligible or not for this card. Visa: * \"Y\" * \"N\" Mastercard: * \"Y\" (domestic and cross-border) * \"D\" (only domestic) * \"N\" (no MoneySend) * \"U\" (unknown) - /// The response code from the Real Time Account Updater service. Possible return values are: * CardChanged * CardExpiryChanged * CloseAccount * ContactCardAccountHolder - /// Message to be displayed on the terminal. - /// The recurring contract types applicable to the transaction. - /// The `pspReference`, of the first recurring payment that created the recurring detail. This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. - /// The reference that uniquely identifies the recurring transaction. - /// The provided reference of the shopper for a recurring transaction. - /// The processing model used for the recurring transaction. - /// If the payment is referred, this field is set to true. This field is unavailable if the payment is referred and is usually not returned with ecommerce transactions. Example: true - /// Raw refusal reason received from the acquirer, where available. Example: AUTHORISED - /// The amount of the payment request. - /// The currency of the payment request. - /// The shopper interaction type of the payment request. Example: Ecommerce - /// The shopperReference passed in the payment request. Example: AdyenTestShopperXX - /// The terminal ID used in a point-of-sale payment. Example: 06022622 - /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true - /// The raw 3DS authentication result from the card issuer. Example: N - /// A Boolean value indicating whether 3DS was offered for this payment. Example: true - /// The raw enrollment result from the 3DS directory services of the card schemes. Example: Y - /// The 3D Secure 2 version. - /// The reference for the shopper that you sent when tokenizing the payment details. - /// The operation performed on the token. Possible values: * **created**: the token has been created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details have already been stored. - /// The reference that uniquely identifies tokenized payment details. - /// The `visaTransactionId`, has a fixed length of 15 numeric characters. > Contact Support Team to enable this field. - /// The 3DS transaction ID of the 3DS session sent in notifications. The value is Base64-encoded and is returned for transactions with directoryResponse 'N' or 'Y'. Example: ODgxNDc2MDg2MDExODk5MAAAAAA= - [JsonConstructor] - public ResponseAdditionalDataCommon(Option acquirerAccountCode = default, Option acquirerCode = default, Option acquirerReference = default, Option alias = default, Option aliasType = default, Option authCode = default, Option authorisationMid = default, Option authorisedAmountCurrency = default, Option authorisedAmountValue = default, Option avsResult = default, Option avsResultRaw = default, Option bic = default, Option coBrandedWith = default, Option cvcResult = default, Option cvcResultRaw = default, Option dsTransID = default, Option eci = default, Option expiryDate = default, Option extraCostsCurrency = default, Option extraCostsValue = default, Option fraudCheckItemNrFraudCheckname = default, Option fraudManualReview = default, Option fraudResultType = default, Option fraudRiskLevel = default, Option fundingSource = default, Option fundsAvailability = default, Option inferredRefusalReason = default, Option isCardCommercial = default, Option issuerCountry = default, Option liabilityShift = default, Option mcBankNetReferenceNumber = default, Option merchantAdviceCode = default, Option merchantReference = default, Option networkTxReference = default, Option ownerName = default, Option paymentAccountReference = default, Option paymentMethod = default, Option paymentMethodVariant = default, Option payoutEligible = default, Option realtimeAccountUpdaterStatus = default, Option receiptFreeText = default, Option recurringContractTypes = default, Option recurringFirstPspReference = default, Option recurringRecurringDetailReference = default, Option recurringShopperReference = default, Option recurringProcessingModel = default, Option referred = default, Option refusalReasonRaw = default, Option requestAmount = default, Option requestCurrencyCode = default, Option shopperInteraction = default, Option shopperReference = default, Option terminalId = default, Option threeDAuthenticated = default, Option threeDAuthenticatedResponse = default, Option threeDOffered = default, Option threeDOfferedResponse = default, Option threeDSVersion = default, Option tokenizationShopperReference = default, Option tokenizationStoreOperationType = default, Option tokenizationStoredPaymentMethodId = default, Option visaTransactionId = default, Option xid = default) - { - AcquirerAccountCodeOption = acquirerAccountCode; - AcquirerCodeOption = acquirerCode; - AcquirerReferenceOption = acquirerReference; - AliasOption = alias; - AliasTypeOption = aliasType; - AuthCodeOption = authCode; - AuthorisationMidOption = authorisationMid; - AuthorisedAmountCurrencyOption = authorisedAmountCurrency; - AuthorisedAmountValueOption = authorisedAmountValue; - AvsResultOption = avsResult; - AvsResultRawOption = avsResultRaw; - BicOption = bic; - CoBrandedWithOption = coBrandedWith; - CvcResultOption = cvcResult; - CvcResultRawOption = cvcResultRaw; - DsTransIDOption = dsTransID; - EciOption = eci; - ExpiryDateOption = expiryDate; - ExtraCostsCurrencyOption = extraCostsCurrency; - ExtraCostsValueOption = extraCostsValue; - FraudCheckItemNrFraudChecknameOption = fraudCheckItemNrFraudCheckname; - FraudManualReviewOption = fraudManualReview; - FraudResultTypeOption = fraudResultType; - FraudRiskLevelOption = fraudRiskLevel; - FundingSourceOption = fundingSource; - FundsAvailabilityOption = fundsAvailability; - InferredRefusalReasonOption = inferredRefusalReason; - IsCardCommercialOption = isCardCommercial; - IssuerCountryOption = issuerCountry; - LiabilityShiftOption = liabilityShift; - McBankNetReferenceNumberOption = mcBankNetReferenceNumber; - MerchantAdviceCodeOption = merchantAdviceCode; - MerchantReferenceOption = merchantReference; - NetworkTxReferenceOption = networkTxReference; - OwnerNameOption = ownerName; - PaymentAccountReferenceOption = paymentAccountReference; - PaymentMethodOption = paymentMethod; - PaymentMethodVariantOption = paymentMethodVariant; - PayoutEligibleOption = payoutEligible; - RealtimeAccountUpdaterStatusOption = realtimeAccountUpdaterStatus; - ReceiptFreeTextOption = receiptFreeText; - RecurringContractTypesOption = recurringContractTypes; - RecurringFirstPspReferenceOption = recurringFirstPspReference; - RecurringRecurringDetailReferenceOption = recurringRecurringDetailReference; - RecurringShopperReferenceOption = recurringShopperReference; - RecurringProcessingModelOption = recurringProcessingModel; - ReferredOption = referred; - RefusalReasonRawOption = refusalReasonRaw; - RequestAmountOption = requestAmount; - RequestCurrencyCodeOption = requestCurrencyCode; - ShopperInteractionOption = shopperInteraction; - ShopperReferenceOption = shopperReference; - TerminalIdOption = terminalId; - ThreeDAuthenticatedOption = threeDAuthenticated; - ThreeDAuthenticatedResponseOption = threeDAuthenticatedResponse; - ThreeDOfferedOption = threeDOffered; - ThreeDOfferedResponseOption = threeDOfferedResponse; - ThreeDSVersionOption = threeDSVersion; - TokenizationShopperReferenceOption = tokenizationShopperReference; - TokenizationStoreOperationTypeOption = tokenizationStoreOperationType; - TokenizationStoredPaymentMethodIdOption = tokenizationStoredPaymentMethodId; - VisaTransactionIdOption = visaTransactionId; - XidOption = xid; - OnCreated(); - } - - partial void OnCreated(); - /// /// The fraud result properties of the payment. /// /// The fraud result properties of the payment. + [JsonConverter(typeof(StringEnumConverter))] public enum FraudResultTypeEnum { /// /// Enum GREEN for value: GREEN /// + [EnumMember(Value = "GREEN")] GREEN = 1, /// /// Enum FRAUD for value: FRAUD /// + [EnumMember(Value = "FRAUD")] FRAUD = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static FraudResultTypeEnum FraudResultTypeEnumFromString(string value) - { - if (value.Equals("GREEN")) - return FraudResultTypeEnum.GREEN; - - if (value.Equals("FRAUD")) - return FraudResultTypeEnum.FRAUD; - - throw new NotImplementedException($"Could not convert value to type FraudResultTypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static FraudResultTypeEnum? FraudResultTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("GREEN")) - return FraudResultTypeEnum.GREEN; - - if (value.Equals("FRAUD")) - return FraudResultTypeEnum.FRAUD; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FraudResultTypeEnumToJsonValue(FraudResultTypeEnum? value) - { - if (value == FraudResultTypeEnum.GREEN) - return "GREEN"; - if (value == FraudResultTypeEnum.FRAUD) - return "FRAUD"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of FraudResultType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FraudResultTypeOption { get; private set; } /// /// The fraud result properties of the payment. /// /// The fraud result properties of the payment. - [JsonPropertyName("fraudResultType")] - public FraudResultTypeEnum? FraudResultType { get { return this.FraudResultTypeOption; } set { this.FraudResultTypeOption = new Option(value); } } - + [DataMember(Name = "fraudResultType", EmitDefaultValue = false)] + public FraudResultTypeEnum? FraudResultType { get; set; } /// - /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh > + /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh /// - /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh > + /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh + [JsonConverter(typeof(StringEnumConverter))] public enum FraudRiskLevelEnum { /// /// Enum VeryLow for value: veryLow /// + [EnumMember(Value = "veryLow")] VeryLow = 1, /// /// Enum Low for value: low /// + [EnumMember(Value = "low")] Low = 2, /// /// Enum Medium for value: medium /// + [EnumMember(Value = "medium")] Medium = 3, /// /// Enum High for value: high /// + [EnumMember(Value = "high")] High = 4, /// /// Enum VeryHigh for value: veryHigh /// + [EnumMember(Value = "veryHigh")] VeryHigh = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static FraudRiskLevelEnum FraudRiskLevelEnumFromString(string value) - { - if (value.Equals("veryLow")) - return FraudRiskLevelEnum.VeryLow; - - if (value.Equals("low")) - return FraudRiskLevelEnum.Low; - - if (value.Equals("medium")) - return FraudRiskLevelEnum.Medium; - - if (value.Equals("high")) - return FraudRiskLevelEnum.High; - - if (value.Equals("veryHigh")) - return FraudRiskLevelEnum.VeryHigh; - - throw new NotImplementedException($"Could not convert value to type FraudRiskLevelEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static FraudRiskLevelEnum? FraudRiskLevelEnumFromStringOrDefault(string value) - { - if (value.Equals("veryLow")) - return FraudRiskLevelEnum.VeryLow; - - if (value.Equals("low")) - return FraudRiskLevelEnum.Low; - - if (value.Equals("medium")) - return FraudRiskLevelEnum.Medium; - - if (value.Equals("high")) - return FraudRiskLevelEnum.High; - if (value.Equals("veryHigh")) - return FraudRiskLevelEnum.VeryHigh; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FraudRiskLevelEnumToJsonValue(FraudRiskLevelEnum? value) - { - if (value == FraudRiskLevelEnum.VeryLow) - return "veryLow"; - - if (value == FraudRiskLevelEnum.Low) - return "low"; - - if (value == FraudRiskLevelEnum.Medium) - return "medium"; - - if (value == FraudRiskLevelEnum.High) - return "high"; - - if (value == FraudRiskLevelEnum.VeryHigh) - return "veryHigh"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of FraudRiskLevel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FraudRiskLevelOption { get; private set; } /// - /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh > + /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh /// - /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh > - [JsonPropertyName("fraudRiskLevel")] - public FraudRiskLevelEnum? FraudRiskLevel { get { return this.FraudRiskLevelOption; } set { this.FraudRiskLevelOption = new Option(value); } } - + /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh + [DataMember(Name = "fraudRiskLevel", EmitDefaultValue = false)] + public FraudRiskLevelEnum? FraudRiskLevel { get; set; } /// /// The processing model used for the recurring transaction. /// /// The processing model used for the recurring transaction. + [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// + [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// + [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// + [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum? value) - { - if (value == RecurringProcessingModelEnum.CardOnFile) - return "CardOnFile"; - - if (value == RecurringProcessingModelEnum.Subscription) - return "Subscription"; - if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) - return "UnscheduledCardOnFile"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of RecurringProcessingModel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringProcessingModelOption { get; private set; } /// /// The processing model used for the recurring transaction. /// /// The processing model used for the recurring transaction. - [JsonPropertyName("recurringProcessingModel")] - public RecurringProcessingModelEnum? RecurringProcessingModel { get { return this.RecurringProcessingModelOption; } set { this.RecurringProcessingModelOption = new Option(value); } } - + [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] + public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } /// /// The operation performed on the token. Possible values: * **created**: the token has been created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details have already been stored. /// /// The operation performed on the token. Possible values: * **created**: the token has been created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details have already been stored. + [JsonConverter(typeof(StringEnumConverter))] public enum TokenizationStoreOperationTypeEnum { /// /// Enum Created for value: created /// + [EnumMember(Value = "created")] Created = 1, /// /// Enum Updated for value: updated /// + [EnumMember(Value = "updated")] Updated = 2, /// /// Enum AlreadyExisting for value: alreadyExisting /// + [EnumMember(Value = "alreadyExisting")] AlreadyExisting = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TokenizationStoreOperationTypeEnum TokenizationStoreOperationTypeEnumFromString(string value) - { - if (value.Equals("created")) - return TokenizationStoreOperationTypeEnum.Created; - - if (value.Equals("updated")) - return TokenizationStoreOperationTypeEnum.Updated; - - if (value.Equals("alreadyExisting")) - return TokenizationStoreOperationTypeEnum.AlreadyExisting; - - throw new NotImplementedException($"Could not convert value to type TokenizationStoreOperationTypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TokenizationStoreOperationTypeEnum? TokenizationStoreOperationTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("created")) - return TokenizationStoreOperationTypeEnum.Created; - - if (value.Equals("updated")) - return TokenizationStoreOperationTypeEnum.Updated; - - if (value.Equals("alreadyExisting")) - return TokenizationStoreOperationTypeEnum.AlreadyExisting; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TokenizationStoreOperationTypeEnumToJsonValue(TokenizationStoreOperationTypeEnum? value) - { - if (value == TokenizationStoreOperationTypeEnum.Created) - return "created"; - - if (value == TokenizationStoreOperationTypeEnum.Updated) - return "updated"; - if (value == TokenizationStoreOperationTypeEnum.AlreadyExisting) - return "alreadyExisting"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of TokenizationStoreOperationType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TokenizationStoreOperationTypeOption { get; private set; } /// /// The operation performed on the token. Possible values: * **created**: the token has been created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details have already been stored. /// /// The operation performed on the token. Possible values: * **created**: the token has been created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details have already been stored. - [JsonPropertyName("tokenization.store.operationType")] - public TokenizationStoreOperationTypeEnum? TokenizationStoreOperationType { get { return this.TokenizationStoreOperationTypeOption; } set { this.TokenizationStoreOperationTypeOption = new Option(value); } } - + [DataMember(Name = "tokenization.store.operationType", EmitDefaultValue = false)] + public TokenizationStoreOperationTypeEnum? TokenizationStoreOperationType { get; set; } /// - /// Used to track the state of AcquirerAccountCode + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcquirerAccountCodeOption { get; private set; } + /// The name of the Adyen acquirer account. Example: PayPalSandbox_TestAcquirer > Only relevant for PayPal transactions.. + /// The name of the acquirer processing the payment request. Example: TestPmmAcquirer. + /// The reference number that can be used for reconciliation in case a non-Adyen acquirer is used for settlement. Example: 7C9N3FNBKT9. + /// The Adyen alias of the card. Example: H167852639363479. + /// The type of the card alias. Example: Default. + /// Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. Example: 58747. + /// Merchant ID known by the acquirer.. + /// The currency of the authorised amount, as a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).. + /// Value of the amount authorised. This amount is represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes).. + /// The AVS result code of the payment, which provides information about the outcome of the AVS check. For possible values, see [AVS](https://docs.adyen.com/risk-management/configure-standard-risk-rules/consistency-rules#billing-address-does-not-match-cardholder-address-avs).. + /// Raw AVS result received from the acquirer, where available. Example: D. + /// BIC of a bank account. Example: TESTNL01 > Only relevant for SEPA Direct Debit transactions.. + /// Includes the co-branded card information.. + /// The result of CVC verification.. + /// The raw result of CVC verification.. + /// Supported for 3D Secure 2. The unique transaction identifier assigned by the DS to identify a single transaction.. + /// The Electronic Commerce Indicator returned from the schemes for the 3DS payment session. Example: 02. + /// The expiry date on the card. Example: 6/2016 > Returned only in case of a card payment.. + /// The currency of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. Example: EUR. + /// The value of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. The amount is in minor units.. + /// The fraud score due to a particular fraud check. The fraud check name is found in the key of the key-value pair.. + /// Indicates if the payment is sent to manual review.. + /// The fraud result properties of the payment.. + /// The risk level of the transaction as classified by the [machine learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) fraud risk rule. The risk level indicates the likelihood that a transaction will result in a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh . + /// Information regarding the funding type of the card. The possible return values are: * CHARGE * CREDIT * DEBIT * PREPAID * PREPAID_RELOADABLE * PREPAID_NONRELOADABLE * DEFFERED_DEBIT > This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. For receiving this field in the notification, enable **Include Funding Source** in **Notifications** > **Additional settings**.. + /// Indicates availability of funds. Visa: * \"I\" (fast funds are supported) * \"N\" (otherwise) Mastercard: * \"I\" (product type is Prepaid or Debit, or issuing country is in CEE/HGEM list) * \"N\" (otherwise) > Returned when you verify a card BIN or estimate costs, and only if payoutEligible is \"Y\" or \"D\".. + /// Provides the more granular indication of why a transaction was refused. When a transaction fails with either \"Refused\", \"Restricted Card\", \"Transaction Not Permitted\", \"Not supported\" or \"DeclinedNon Generic\" refusalReason from the issuer, Adyen cross references its PSP-wide data for extra insight into the refusal reason. If an inferred refusal reason is available, the `inferredRefusalReason`, field is populated and the `refusalReason`, is set to \"Not Supported\". Possible values: * 3D Secure Mandated * Closed Account * ContAuth Not Supported * CVC Mandated * Ecommerce Not Allowed * Crossborder Not Supported * Card Updated * Low Authrate Bin * Non-reloadable prepaid card. + /// Indicates if the card is used for business purposes only.. + /// The issuing country of the card based on the BIN list that Adyen maintains. Example: JP. + /// A Boolean value indicating whether a liability shift was offered for this payment.. + /// The `mcBankNetReferenceNumber`, is a minimum of six characters and a maximum of nine characters long. > Contact Support Team to enable this field.. + /// The Merchant Advice Code (MAC) can be returned by Mastercard issuers for refused payments. If present, the MAC contains information about why the payment failed, and whether it can be retried. For more information see [Mastercard Merchant Advice Codes](https://docs.adyen.com/development-resources/raw-acquirer-responses#mastercard-merchant-advice-codes).. + /// The reference provided for the transaction.. + /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID.. + /// The owner name of a bank account. Only relevant for SEPA Direct Debit transactions.. + /// The Payment Account Reference (PAR) value links a network token with the underlying primary account number (PAN). The PAR value consists of 29 uppercase alphanumeric characters.. + /// The payment method used in the transaction.. + /// The Adyen sub-variant of the payment method used for the payment request. For more information, refer to [PaymentMethodVariant](https://docs.adyen.com/development-resources/paymentmethodvariant). Example: mcpro. + /// Indicates whether a payout is eligible or not for this card. Visa: * \"Y\" * \"N\" Mastercard: * \"Y\" (domestic and cross-border) * \"D\" (only domestic) * \"N\" (no MoneySend) * \"U\" (unknown). + /// The response code from the Real Time Account Updater service. Possible return values are: * CardChanged * CardExpiryChanged * CloseAccount * ContactCardAccountHolder. + /// Message to be displayed on the terminal.. + /// The recurring contract types applicable to the transaction.. + /// The `pspReference`, of the first recurring payment that created the recurring detail. This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team.. + /// The reference that uniquely identifies the recurring transaction.. + /// The provided reference of the shopper for a recurring transaction.. + /// The processing model used for the recurring transaction.. + /// If the payment is referred, this field is set to true. This field is unavailable if the payment is referred and is usually not returned with ecommerce transactions. Example: true. + /// Raw refusal reason received from the acquirer, where available. Example: AUTHORISED. + /// The amount of the payment request.. + /// The currency of the payment request.. + /// The shopper interaction type of the payment request. Example: Ecommerce. + /// The shopperReference passed in the payment request. Example: AdyenTestShopperXX. + /// The terminal ID used in a point-of-sale payment. Example: 06022622. + /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true. + /// The raw 3DS authentication result from the card issuer. Example: N. + /// A Boolean value indicating whether 3DS was offered for this payment. Example: true. + /// The raw enrollment result from the 3DS directory services of the card schemes. Example: Y. + /// The 3D Secure 2 version.. + /// The reference for the shopper that you sent when tokenizing the payment details.. + /// The operation performed on the token. Possible values: * **created**: the token has been created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details have already been stored. . + /// The reference that uniquely identifies tokenized payment details.. + /// The `visaTransactionId`, has a fixed length of 15 numeric characters. > Contact Support Team to enable this field.. + /// The 3DS transaction ID of the 3DS session sent in notifications. The value is Base64-encoded and is returned for transactions with directoryResponse 'N' or 'Y'. Example: ODgxNDc2MDg2MDExODk5MAAAAAA=. + public ResponseAdditionalDataCommon(string acquirerAccountCode = default(string), string acquirerCode = default(string), string acquirerReference = default(string), string alias = default(string), string aliasType = default(string), string authCode = default(string), string authorisationMid = default(string), string authorisedAmountCurrency = default(string), string authorisedAmountValue = default(string), string avsResult = default(string), string avsResultRaw = default(string), string bic = default(string), string coBrandedWith = default(string), string cvcResult = default(string), string cvcResultRaw = default(string), string dsTransID = default(string), string eci = default(string), string expiryDate = default(string), string extraCostsCurrency = default(string), string extraCostsValue = default(string), string fraudCheckItemNrFraudCheckname = default(string), string fraudManualReview = default(string), FraudResultTypeEnum? fraudResultType = default(FraudResultTypeEnum?), FraudRiskLevelEnum? fraudRiskLevel = default(FraudRiskLevelEnum?), string fundingSource = default(string), string fundsAvailability = default(string), string inferredRefusalReason = default(string), string isCardCommercial = default(string), string issuerCountry = default(string), string liabilityShift = default(string), string mcBankNetReferenceNumber = default(string), string merchantAdviceCode = default(string), string merchantReference = default(string), string networkTxReference = default(string), string ownerName = default(string), string paymentAccountReference = default(string), string paymentMethod = default(string), string paymentMethodVariant = default(string), string payoutEligible = default(string), string realtimeAccountUpdaterStatus = default(string), string receiptFreeText = default(string), string recurringContractTypes = default(string), string recurringFirstPspReference = default(string), string recurringRecurringDetailReference = default(string), string recurringShopperReference = default(string), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string referred = default(string), string refusalReasonRaw = default(string), string requestAmount = default(string), string requestCurrencyCode = default(string), string shopperInteraction = default(string), string shopperReference = default(string), string terminalId = default(string), string threeDAuthenticated = default(string), string threeDAuthenticatedResponse = default(string), string threeDOffered = default(string), string threeDOfferedResponse = default(string), string threeDSVersion = default(string), string tokenizationShopperReference = default(string), TokenizationStoreOperationTypeEnum? tokenizationStoreOperationType = default(TokenizationStoreOperationTypeEnum?), string tokenizationStoredPaymentMethodId = default(string), string visaTransactionId = default(string), string xid = default(string)) + { + this.AcquirerAccountCode = acquirerAccountCode; + this.AcquirerCode = acquirerCode; + this.AcquirerReference = acquirerReference; + this.Alias = alias; + this.AliasType = aliasType; + this.AuthCode = authCode; + this.AuthorisationMid = authorisationMid; + this.AuthorisedAmountCurrency = authorisedAmountCurrency; + this.AuthorisedAmountValue = authorisedAmountValue; + this.AvsResult = avsResult; + this.AvsResultRaw = avsResultRaw; + this.Bic = bic; + this.CoBrandedWith = coBrandedWith; + this.CvcResult = cvcResult; + this.CvcResultRaw = cvcResultRaw; + this.DsTransID = dsTransID; + this.Eci = eci; + this.ExpiryDate = expiryDate; + this.ExtraCostsCurrency = extraCostsCurrency; + this.ExtraCostsValue = extraCostsValue; + this.FraudCheckItemNrFraudCheckname = fraudCheckItemNrFraudCheckname; + this.FraudManualReview = fraudManualReview; + this.FraudResultType = fraudResultType; + this.FraudRiskLevel = fraudRiskLevel; + this.FundingSource = fundingSource; + this.FundsAvailability = fundsAvailability; + this.InferredRefusalReason = inferredRefusalReason; + this.IsCardCommercial = isCardCommercial; + this.IssuerCountry = issuerCountry; + this.LiabilityShift = liabilityShift; + this.McBankNetReferenceNumber = mcBankNetReferenceNumber; + this.MerchantAdviceCode = merchantAdviceCode; + this.MerchantReference = merchantReference; + this.NetworkTxReference = networkTxReference; + this.OwnerName = ownerName; + this.PaymentAccountReference = paymentAccountReference; + this.PaymentMethod = paymentMethod; + this.PaymentMethodVariant = paymentMethodVariant; + this.PayoutEligible = payoutEligible; + this.RealtimeAccountUpdaterStatus = realtimeAccountUpdaterStatus; + this.ReceiptFreeText = receiptFreeText; + this.RecurringContractTypes = recurringContractTypes; + this.RecurringFirstPspReference = recurringFirstPspReference; + this.RecurringRecurringDetailReference = recurringRecurringDetailReference; + this.RecurringShopperReference = recurringShopperReference; + this.RecurringProcessingModel = recurringProcessingModel; + this.Referred = referred; + this.RefusalReasonRaw = refusalReasonRaw; + this.RequestAmount = requestAmount; + this.RequestCurrencyCode = requestCurrencyCode; + this.ShopperInteraction = shopperInteraction; + this.ShopperReference = shopperReference; + this.TerminalId = terminalId; + this.ThreeDAuthenticated = threeDAuthenticated; + this.ThreeDAuthenticatedResponse = threeDAuthenticatedResponse; + this.ThreeDOffered = threeDOffered; + this.ThreeDOfferedResponse = threeDOfferedResponse; + this.ThreeDSVersion = threeDSVersion; + this.TokenizationShopperReference = tokenizationShopperReference; + this.TokenizationStoreOperationType = tokenizationStoreOperationType; + this.TokenizationStoredPaymentMethodId = tokenizationStoredPaymentMethodId; + this.VisaTransactionId = visaTransactionId; + this.Xid = xid; + } /// /// The name of the Adyen acquirer account. Example: PayPalSandbox_TestAcquirer > Only relevant for PayPal transactions. /// /// The name of the Adyen acquirer account. Example: PayPalSandbox_TestAcquirer > Only relevant for PayPal transactions. - [JsonPropertyName("acquirerAccountCode")] - public string AcquirerAccountCode { get { return this.AcquirerAccountCodeOption; } set { this.AcquirerAccountCodeOption = new Option(value); } } - - /// - /// Used to track the state of AcquirerCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcquirerCodeOption { get; private set; } + [DataMember(Name = "acquirerAccountCode", EmitDefaultValue = false)] + public string AcquirerAccountCode { get; set; } /// /// The name of the acquirer processing the payment request. Example: TestPmmAcquirer /// /// The name of the acquirer processing the payment request. Example: TestPmmAcquirer - [JsonPropertyName("acquirerCode")] - public string AcquirerCode { get { return this.AcquirerCodeOption; } set { this.AcquirerCodeOption = new Option(value); } } - - /// - /// Used to track the state of AcquirerReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcquirerReferenceOption { get; private set; } + [DataMember(Name = "acquirerCode", EmitDefaultValue = false)] + public string AcquirerCode { get; set; } /// /// The reference number that can be used for reconciliation in case a non-Adyen acquirer is used for settlement. Example: 7C9N3FNBKT9 /// /// The reference number that can be used for reconciliation in case a non-Adyen acquirer is used for settlement. Example: 7C9N3FNBKT9 - [JsonPropertyName("acquirerReference")] - public string AcquirerReference { get { return this.AcquirerReferenceOption; } set { this.AcquirerReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Alias - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AliasOption { get; private set; } + [DataMember(Name = "acquirerReference", EmitDefaultValue = false)] + public string AcquirerReference { get; set; } /// /// The Adyen alias of the card. Example: H167852639363479 /// /// The Adyen alias of the card. Example: H167852639363479 - [JsonPropertyName("alias")] - public string Alias { get { return this.AliasOption; } set { this.AliasOption = new Option(value); } } - - /// - /// Used to track the state of AliasType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AliasTypeOption { get; private set; } + [DataMember(Name = "alias", EmitDefaultValue = false)] + public string Alias { get; set; } /// /// The type of the card alias. Example: Default /// /// The type of the card alias. Example: Default - [JsonPropertyName("aliasType")] - public string AliasType { get { return this.AliasTypeOption; } set { this.AliasTypeOption = new Option(value); } } - - /// - /// Used to track the state of AuthCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthCodeOption { get; private set; } + [DataMember(Name = "aliasType", EmitDefaultValue = false)] + public string AliasType { get; set; } /// /// Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. Example: 58747 /// /// Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. Example: 58747 - [JsonPropertyName("authCode")] - public string AuthCode { get { return this.AuthCodeOption; } set { this.AuthCodeOption = new Option(value); } } - - /// - /// Used to track the state of AuthorisationMid - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthorisationMidOption { get; private set; } + [DataMember(Name = "authCode", EmitDefaultValue = false)] + public string AuthCode { get; set; } /// /// Merchant ID known by the acquirer. /// /// Merchant ID known by the acquirer. - [JsonPropertyName("authorisationMid")] - public string AuthorisationMid { get { return this.AuthorisationMidOption; } set { this.AuthorisationMidOption = new Option(value); } } - - /// - /// Used to track the state of AuthorisedAmountCurrency - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthorisedAmountCurrencyOption { get; private set; } + [DataMember(Name = "authorisationMid", EmitDefaultValue = false)] + public string AuthorisationMid { get; set; } /// /// The currency of the authorised amount, as a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). /// /// The currency of the authorised amount, as a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). - [JsonPropertyName("authorisedAmountCurrency")] - public string AuthorisedAmountCurrency { get { return this.AuthorisedAmountCurrencyOption; } set { this.AuthorisedAmountCurrencyOption = new Option(value); } } - - /// - /// Used to track the state of AuthorisedAmountValue - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthorisedAmountValueOption { get; private set; } + [DataMember(Name = "authorisedAmountCurrency", EmitDefaultValue = false)] + public string AuthorisedAmountCurrency { get; set; } /// /// Value of the amount authorised. This amount is represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). /// /// Value of the amount authorised. This amount is represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). - [JsonPropertyName("authorisedAmountValue")] - public string AuthorisedAmountValue { get { return this.AuthorisedAmountValueOption; } set { this.AuthorisedAmountValueOption = new Option(value); } } - - /// - /// Used to track the state of AvsResult - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AvsResultOption { get; private set; } + [DataMember(Name = "authorisedAmountValue", EmitDefaultValue = false)] + public string AuthorisedAmountValue { get; set; } /// /// The AVS result code of the payment, which provides information about the outcome of the AVS check. For possible values, see [AVS](https://docs.adyen.com/risk-management/configure-standard-risk-rules/consistency-rules#billing-address-does-not-match-cardholder-address-avs). /// /// The AVS result code of the payment, which provides information about the outcome of the AVS check. For possible values, see [AVS](https://docs.adyen.com/risk-management/configure-standard-risk-rules/consistency-rules#billing-address-does-not-match-cardholder-address-avs). - [JsonPropertyName("avsResult")] - public string AvsResult { get { return this.AvsResultOption; } set { this.AvsResultOption = new Option(value); } } - - /// - /// Used to track the state of AvsResultRaw - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AvsResultRawOption { get; private set; } + [DataMember(Name = "avsResult", EmitDefaultValue = false)] + public string AvsResult { get; set; } /// /// Raw AVS result received from the acquirer, where available. Example: D /// /// Raw AVS result received from the acquirer, where available. Example: D - [JsonPropertyName("avsResultRaw")] - public string AvsResultRaw { get { return this.AvsResultRawOption; } set { this.AvsResultRawOption = new Option(value); } } - - /// - /// Used to track the state of Bic - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BicOption { get; private set; } + [DataMember(Name = "avsResultRaw", EmitDefaultValue = false)] + public string AvsResultRaw { get; set; } /// /// BIC of a bank account. Example: TESTNL01 > Only relevant for SEPA Direct Debit transactions. /// /// BIC of a bank account. Example: TESTNL01 > Only relevant for SEPA Direct Debit transactions. - [JsonPropertyName("bic")] - public string Bic { get { return this.BicOption; } set { this.BicOption = new Option(value); } } - - /// - /// Used to track the state of CoBrandedWith - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CoBrandedWithOption { get; private set; } + [DataMember(Name = "bic", EmitDefaultValue = false)] + public string Bic { get; set; } /// /// Includes the co-branded card information. /// /// Includes the co-branded card information. - [JsonPropertyName("coBrandedWith")] - public string CoBrandedWith { get { return this.CoBrandedWithOption; } set { this.CoBrandedWithOption = new Option(value); } } - - /// - /// Used to track the state of CvcResult - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CvcResultOption { get; private set; } + [DataMember(Name = "coBrandedWith", EmitDefaultValue = false)] + public string CoBrandedWith { get; set; } /// /// The result of CVC verification. /// /// The result of CVC verification. - /* 1 Matches */ - [JsonPropertyName("cvcResult")] - public string CvcResult { get { return this.CvcResultOption; } set { this.CvcResultOption = new Option(value); } } - - /// - /// Used to track the state of CvcResultRaw - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CvcResultRawOption { get; private set; } + [DataMember(Name = "cvcResult", EmitDefaultValue = false)] + public string CvcResult { get; set; } /// /// The raw result of CVC verification. /// /// The raw result of CVC verification. - /* M */ - [JsonPropertyName("cvcResultRaw")] - public string CvcResultRaw { get { return this.CvcResultRawOption; } set { this.CvcResultRawOption = new Option(value); } } - - /// - /// Used to track the state of DsTransID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DsTransIDOption { get; private set; } + [DataMember(Name = "cvcResultRaw", EmitDefaultValue = false)] + public string CvcResultRaw { get; set; } /// /// Supported for 3D Secure 2. The unique transaction identifier assigned by the DS to identify a single transaction. /// /// Supported for 3D Secure 2. The unique transaction identifier assigned by the DS to identify a single transaction. - [JsonPropertyName("dsTransID")] - public string DsTransID { get { return this.DsTransIDOption; } set { this.DsTransIDOption = new Option(value); } } - - /// - /// Used to track the state of Eci - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EciOption { get; private set; } + [DataMember(Name = "dsTransID", EmitDefaultValue = false)] + public string DsTransID { get; set; } /// /// The Electronic Commerce Indicator returned from the schemes for the 3DS payment session. Example: 02 /// /// The Electronic Commerce Indicator returned from the schemes for the 3DS payment session. Example: 02 - [JsonPropertyName("eci")] - public string Eci { get { return this.EciOption; } set { this.EciOption = new Option(value); } } - - /// - /// Used to track the state of ExpiryDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiryDateOption { get; private set; } + [DataMember(Name = "eci", EmitDefaultValue = false)] + public string Eci { get; set; } /// /// The expiry date on the card. Example: 6/2016 > Returned only in case of a card payment. /// /// The expiry date on the card. Example: 6/2016 > Returned only in case of a card payment. - [JsonPropertyName("expiryDate")] - public string ExpiryDate { get { return this.ExpiryDateOption; } set { this.ExpiryDateOption = new Option(value); } } - - /// - /// Used to track the state of ExtraCostsCurrency - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExtraCostsCurrencyOption { get; private set; } + [DataMember(Name = "expiryDate", EmitDefaultValue = false)] + public string ExpiryDate { get; set; } /// /// The currency of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. Example: EUR /// /// The currency of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. Example: EUR - [JsonPropertyName("extraCostsCurrency")] - public string ExtraCostsCurrency { get { return this.ExtraCostsCurrencyOption; } set { this.ExtraCostsCurrencyOption = new Option(value); } } - - /// - /// Used to track the state of ExtraCostsValue - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExtraCostsValueOption { get; private set; } + [DataMember(Name = "extraCostsCurrency", EmitDefaultValue = false)] + public string ExtraCostsCurrency { get; set; } /// /// The value of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. The amount is in minor units. /// /// The value of the extra amount charged due to additional amounts set in the skin used in the HPP payment request. The amount is in minor units. - [JsonPropertyName("extraCostsValue")] - public string ExtraCostsValue { get { return this.ExtraCostsValueOption; } set { this.ExtraCostsValueOption = new Option(value); } } - - /// - /// Used to track the state of FraudCheckItemNrFraudCheckname - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FraudCheckItemNrFraudChecknameOption { get; private set; } + [DataMember(Name = "extraCostsValue", EmitDefaultValue = false)] + public string ExtraCostsValue { get; set; } /// /// The fraud score due to a particular fraud check. The fraud check name is found in the key of the key-value pair. /// /// The fraud score due to a particular fraud check. The fraud check name is found in the key of the key-value pair. - [JsonPropertyName("fraudCheck-[itemNr]-[FraudCheckname]")] - public string FraudCheckItemNrFraudCheckname { get { return this.FraudCheckItemNrFraudChecknameOption; } set { this.FraudCheckItemNrFraudChecknameOption = new Option(value); } } - - /// - /// Used to track the state of FraudManualReview - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FraudManualReviewOption { get; private set; } + [DataMember(Name = "fraudCheck-[itemNr]-[FraudCheckname]", EmitDefaultValue = false)] + public string FraudCheckItemNrFraudCheckname { get; set; } /// /// Indicates if the payment is sent to manual review. /// /// Indicates if the payment is sent to manual review. - [JsonPropertyName("fraudManualReview")] - public string FraudManualReview { get { return this.FraudManualReviewOption; } set { this.FraudManualReviewOption = new Option(value); } } - - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } + [DataMember(Name = "fraudManualReview", EmitDefaultValue = false)] + public string FraudManualReview { get; set; } /// /// Information regarding the funding type of the card. The possible return values are: * CHARGE * CREDIT * DEBIT * PREPAID * PREPAID_RELOADABLE * PREPAID_NONRELOADABLE * DEFFERED_DEBIT > This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. For receiving this field in the notification, enable **Include Funding Source** in **Notifications** > **Additional settings**. /// /// Information regarding the funding type of the card. The possible return values are: * CHARGE * CREDIT * DEBIT * PREPAID * PREPAID_RELOADABLE * PREPAID_NONRELOADABLE * DEFFERED_DEBIT > This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. For receiving this field in the notification, enable **Include Funding Source** in **Notifications** > **Additional settings**. - [JsonPropertyName("fundingSource")] - public string FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - - /// - /// Used to track the state of FundsAvailability - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundsAvailabilityOption { get; private set; } + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public string FundingSource { get; set; } /// /// Indicates availability of funds. Visa: * \"I\" (fast funds are supported) * \"N\" (otherwise) Mastercard: * \"I\" (product type is Prepaid or Debit, or issuing country is in CEE/HGEM list) * \"N\" (otherwise) > Returned when you verify a card BIN or estimate costs, and only if payoutEligible is \"Y\" or \"D\". /// /// Indicates availability of funds. Visa: * \"I\" (fast funds are supported) * \"N\" (otherwise) Mastercard: * \"I\" (product type is Prepaid or Debit, or issuing country is in CEE/HGEM list) * \"N\" (otherwise) > Returned when you verify a card BIN or estimate costs, and only if payoutEligible is \"Y\" or \"D\". - [JsonPropertyName("fundsAvailability")] - public string FundsAvailability { get { return this.FundsAvailabilityOption; } set { this.FundsAvailabilityOption = new Option(value); } } - - /// - /// Used to track the state of InferredRefusalReason - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InferredRefusalReasonOption { get; private set; } + [DataMember(Name = "fundsAvailability", EmitDefaultValue = false)] + public string FundsAvailability { get; set; } /// /// Provides the more granular indication of why a transaction was refused. When a transaction fails with either \"Refused\", \"Restricted Card\", \"Transaction Not Permitted\", \"Not supported\" or \"DeclinedNon Generic\" refusalReason from the issuer, Adyen cross references its PSP-wide data for extra insight into the refusal reason. If an inferred refusal reason is available, the `inferredRefusalReason`, field is populated and the `refusalReason`, is set to \"Not Supported\". Possible values: * 3D Secure Mandated * Closed Account * ContAuth Not Supported * CVC Mandated * Ecommerce Not Allowed * Crossborder Not Supported * Card Updated * Low Authrate Bin * Non-reloadable prepaid card /// /// Provides the more granular indication of why a transaction was refused. When a transaction fails with either \"Refused\", \"Restricted Card\", \"Transaction Not Permitted\", \"Not supported\" or \"DeclinedNon Generic\" refusalReason from the issuer, Adyen cross references its PSP-wide data for extra insight into the refusal reason. If an inferred refusal reason is available, the `inferredRefusalReason`, field is populated and the `refusalReason`, is set to \"Not Supported\". Possible values: * 3D Secure Mandated * Closed Account * ContAuth Not Supported * CVC Mandated * Ecommerce Not Allowed * Crossborder Not Supported * Card Updated * Low Authrate Bin * Non-reloadable prepaid card - [JsonPropertyName("inferredRefusalReason")] - public string InferredRefusalReason { get { return this.InferredRefusalReasonOption; } set { this.InferredRefusalReasonOption = new Option(value); } } - - /// - /// Used to track the state of IsCardCommercial - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IsCardCommercialOption { get; private set; } + [DataMember(Name = "inferredRefusalReason", EmitDefaultValue = false)] + public string InferredRefusalReason { get; set; } /// /// Indicates if the card is used for business purposes only. /// /// Indicates if the card is used for business purposes only. - [JsonPropertyName("isCardCommercial")] - public string IsCardCommercial { get { return this.IsCardCommercialOption; } set { this.IsCardCommercialOption = new Option(value); } } - - /// - /// Used to track the state of IssuerCountry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IssuerCountryOption { get; private set; } + [DataMember(Name = "isCardCommercial", EmitDefaultValue = false)] + public string IsCardCommercial { get; set; } /// /// The issuing country of the card based on the BIN list that Adyen maintains. Example: JP /// /// The issuing country of the card based on the BIN list that Adyen maintains. Example: JP - [JsonPropertyName("issuerCountry")] - public string IssuerCountry { get { return this.IssuerCountryOption; } set { this.IssuerCountryOption = new Option(value); } } - - /// - /// Used to track the state of LiabilityShift - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LiabilityShiftOption { get; private set; } + [DataMember(Name = "issuerCountry", EmitDefaultValue = false)] + public string IssuerCountry { get; set; } /// /// A Boolean value indicating whether a liability shift was offered for this payment. /// /// A Boolean value indicating whether a liability shift was offered for this payment. - [JsonPropertyName("liabilityShift")] - public string LiabilityShift { get { return this.LiabilityShiftOption; } set { this.LiabilityShiftOption = new Option(value); } } - - /// - /// Used to track the state of McBankNetReferenceNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option McBankNetReferenceNumberOption { get; private set; } + [DataMember(Name = "liabilityShift", EmitDefaultValue = false)] + public string LiabilityShift { get; set; } /// /// The `mcBankNetReferenceNumber`, is a minimum of six characters and a maximum of nine characters long. > Contact Support Team to enable this field. /// /// The `mcBankNetReferenceNumber`, is a minimum of six characters and a maximum of nine characters long. > Contact Support Team to enable this field. - [JsonPropertyName("mcBankNetReferenceNumber")] - public string McBankNetReferenceNumber { get { return this.McBankNetReferenceNumberOption; } set { this.McBankNetReferenceNumberOption = new Option(value); } } - - /// - /// Used to track the state of MerchantAdviceCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantAdviceCodeOption { get; private set; } + [DataMember(Name = "mcBankNetReferenceNumber", EmitDefaultValue = false)] + public string McBankNetReferenceNumber { get; set; } /// /// The Merchant Advice Code (MAC) can be returned by Mastercard issuers for refused payments. If present, the MAC contains information about why the payment failed, and whether it can be retried. For more information see [Mastercard Merchant Advice Codes](https://docs.adyen.com/development-resources/raw-acquirer-responses#mastercard-merchant-advice-codes). /// /// The Merchant Advice Code (MAC) can be returned by Mastercard issuers for refused payments. If present, the MAC contains information about why the payment failed, and whether it can be retried. For more information see [Mastercard Merchant Advice Codes](https://docs.adyen.com/development-resources/raw-acquirer-responses#mastercard-merchant-advice-codes). - [JsonPropertyName("merchantAdviceCode")] - public string MerchantAdviceCode { get { return this.MerchantAdviceCodeOption; } set { this.MerchantAdviceCodeOption = new Option(value); } } - - /// - /// Used to track the state of MerchantReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantReferenceOption { get; private set; } + [DataMember(Name = "merchantAdviceCode", EmitDefaultValue = false)] + public string MerchantAdviceCode { get; set; } /// /// The reference provided for the transaction. /// /// The reference provided for the transaction. - [JsonPropertyName("merchantReference")] - public string MerchantReference { get { return this.MerchantReferenceOption; } set { this.MerchantReferenceOption = new Option(value); } } - - /// - /// Used to track the state of NetworkTxReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NetworkTxReferenceOption { get; private set; } + [DataMember(Name = "merchantReference", EmitDefaultValue = false)] + public string MerchantReference { get; set; } /// /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. /// /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. - [JsonPropertyName("networkTxReference")] - public string NetworkTxReference { get { return this.NetworkTxReferenceOption; } set { this.NetworkTxReferenceOption = new Option(value); } } - - /// - /// Used to track the state of OwnerName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OwnerNameOption { get; private set; } + [DataMember(Name = "networkTxReference", EmitDefaultValue = false)] + public string NetworkTxReference { get; set; } /// /// The owner name of a bank account. Only relevant for SEPA Direct Debit transactions. /// /// The owner name of a bank account. Only relevant for SEPA Direct Debit transactions. - [JsonPropertyName("ownerName")] - public string OwnerName { get { return this.OwnerNameOption; } set { this.OwnerNameOption = new Option(value); } } - - /// - /// Used to track the state of PaymentAccountReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentAccountReferenceOption { get; private set; } + [DataMember(Name = "ownerName", EmitDefaultValue = false)] + public string OwnerName { get; set; } /// /// The Payment Account Reference (PAR) value links a network token with the underlying primary account number (PAN). The PAR value consists of 29 uppercase alphanumeric characters. /// /// The Payment Account Reference (PAR) value links a network token with the underlying primary account number (PAN). The PAR value consists of 29 uppercase alphanumeric characters. - [JsonPropertyName("paymentAccountReference")] - public string PaymentAccountReference { get { return this.PaymentAccountReferenceOption; } set { this.PaymentAccountReferenceOption = new Option(value); } } - - /// - /// Used to track the state of PaymentMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodOption { get; private set; } + [DataMember(Name = "paymentAccountReference", EmitDefaultValue = false)] + public string PaymentAccountReference { get; set; } /// /// The payment method used in the transaction. /// /// The payment method used in the transaction. - [JsonPropertyName("paymentMethod")] - public string PaymentMethod { get { return this.PaymentMethodOption; } set { this.PaymentMethodOption = new Option(value); } } - - /// - /// Used to track the state of PaymentMethodVariant - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentMethodVariantOption { get; private set; } + [DataMember(Name = "paymentMethod", EmitDefaultValue = false)] + public string PaymentMethod { get; set; } /// /// The Adyen sub-variant of the payment method used for the payment request. For more information, refer to [PaymentMethodVariant](https://docs.adyen.com/development-resources/paymentmethodvariant). Example: mcpro /// /// The Adyen sub-variant of the payment method used for the payment request. For more information, refer to [PaymentMethodVariant](https://docs.adyen.com/development-resources/paymentmethodvariant). Example: mcpro - [JsonPropertyName("paymentMethodVariant")] - public string PaymentMethodVariant { get { return this.PaymentMethodVariantOption; } set { this.PaymentMethodVariantOption = new Option(value); } } - - /// - /// Used to track the state of PayoutEligible - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayoutEligibleOption { get; private set; } + [DataMember(Name = "paymentMethodVariant", EmitDefaultValue = false)] + public string PaymentMethodVariant { get; set; } /// /// Indicates whether a payout is eligible or not for this card. Visa: * \"Y\" * \"N\" Mastercard: * \"Y\" (domestic and cross-border) * \"D\" (only domestic) * \"N\" (no MoneySend) * \"U\" (unknown) /// /// Indicates whether a payout is eligible or not for this card. Visa: * \"Y\" * \"N\" Mastercard: * \"Y\" (domestic and cross-border) * \"D\" (only domestic) * \"N\" (no MoneySend) * \"U\" (unknown) - [JsonPropertyName("payoutEligible")] - public string PayoutEligible { get { return this.PayoutEligibleOption; } set { this.PayoutEligibleOption = new Option(value); } } - - /// - /// Used to track the state of RealtimeAccountUpdaterStatus - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RealtimeAccountUpdaterStatusOption { get; private set; } + [DataMember(Name = "payoutEligible", EmitDefaultValue = false)] + public string PayoutEligible { get; set; } /// /// The response code from the Real Time Account Updater service. Possible return values are: * CardChanged * CardExpiryChanged * CloseAccount * ContactCardAccountHolder /// /// The response code from the Real Time Account Updater service. Possible return values are: * CardChanged * CardExpiryChanged * CloseAccount * ContactCardAccountHolder - [JsonPropertyName("realtimeAccountUpdaterStatus")] - public string RealtimeAccountUpdaterStatus { get { return this.RealtimeAccountUpdaterStatusOption; } set { this.RealtimeAccountUpdaterStatusOption = new Option(value); } } - - /// - /// Used to track the state of ReceiptFreeText - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReceiptFreeTextOption { get; private set; } + [DataMember(Name = "realtimeAccountUpdaterStatus", EmitDefaultValue = false)] + public string RealtimeAccountUpdaterStatus { get; set; } /// /// Message to be displayed on the terminal. /// /// Message to be displayed on the terminal. - [JsonPropertyName("receiptFreeText")] - public string ReceiptFreeText { get { return this.ReceiptFreeTextOption; } set { this.ReceiptFreeTextOption = new Option(value); } } - - /// - /// Used to track the state of RecurringContractTypes - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringContractTypesOption { get; private set; } + [DataMember(Name = "receiptFreeText", EmitDefaultValue = false)] + public string ReceiptFreeText { get; set; } /// /// The recurring contract types applicable to the transaction. /// /// The recurring contract types applicable to the transaction. - [JsonPropertyName("recurring.contractTypes")] - public string RecurringContractTypes { get { return this.RecurringContractTypesOption; } set { this.RecurringContractTypesOption = new Option(value); } } - - /// - /// Used to track the state of RecurringFirstPspReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringFirstPspReferenceOption { get; private set; } + [DataMember(Name = "recurring.contractTypes", EmitDefaultValue = false)] + public string RecurringContractTypes { get; set; } /// /// The `pspReference`, of the first recurring payment that created the recurring detail. This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. /// /// The `pspReference`, of the first recurring payment that created the recurring detail. This functionality requires additional configuration on Adyen's end. To enable it, contact the Support Team. - [JsonPropertyName("recurring.firstPspReference")] - public string RecurringFirstPspReference { get { return this.RecurringFirstPspReferenceOption; } set { this.RecurringFirstPspReferenceOption = new Option(value); } } - - /// - /// Used to track the state of RecurringRecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringRecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "recurring.firstPspReference", EmitDefaultValue = false)] + public string RecurringFirstPspReference { get; set; } /// /// The reference that uniquely identifies the recurring transaction. /// /// The reference that uniquely identifies the recurring transaction. - [JsonPropertyName("recurring.recurringDetailReference")] - [Obsolete] - public string RecurringRecurringDetailReference { get { return this.RecurringRecurringDetailReferenceOption; } set { this.RecurringRecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of RecurringShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringShopperReferenceOption { get; private set; } + [DataMember(Name = "recurring.recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v68. Use tokenization.storedPaymentMethodId instead.")] + public string RecurringRecurringDetailReference { get; set; } /// /// The provided reference of the shopper for a recurring transaction. /// /// The provided reference of the shopper for a recurring transaction. - [JsonPropertyName("recurring.shopperReference")] - [Obsolete] - public string RecurringShopperReference { get { return this.RecurringShopperReferenceOption; } set { this.RecurringShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Referred - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferredOption { get; private set; } + [DataMember(Name = "recurring.shopperReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v68. Use tokenization.shopperReference instead.")] + public string RecurringShopperReference { get; set; } /// /// If the payment is referred, this field is set to true. This field is unavailable if the payment is referred and is usually not returned with ecommerce transactions. Example: true /// /// If the payment is referred, this field is set to true. This field is unavailable if the payment is referred and is usually not returned with ecommerce transactions. Example: true - [JsonPropertyName("referred")] - public string Referred { get { return this.ReferredOption; } set { this.ReferredOption = new Option(value); } } - - /// - /// Used to track the state of RefusalReasonRaw - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RefusalReasonRawOption { get; private set; } + [DataMember(Name = "referred", EmitDefaultValue = false)] + public string Referred { get; set; } /// /// Raw refusal reason received from the acquirer, where available. Example: AUTHORISED /// /// Raw refusal reason received from the acquirer, where available. Example: AUTHORISED - [JsonPropertyName("refusalReasonRaw")] - public string RefusalReasonRaw { get { return this.RefusalReasonRawOption; } set { this.RefusalReasonRawOption = new Option(value); } } - - /// - /// Used to track the state of RequestAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RequestAmountOption { get; private set; } + [DataMember(Name = "refusalReasonRaw", EmitDefaultValue = false)] + public string RefusalReasonRaw { get; set; } /// /// The amount of the payment request. /// /// The amount of the payment request. - [JsonPropertyName("requestAmount")] - public string RequestAmount { get { return this.RequestAmountOption; } set { this.RequestAmountOption = new Option(value); } } - - /// - /// Used to track the state of RequestCurrencyCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RequestCurrencyCodeOption { get; private set; } + [DataMember(Name = "requestAmount", EmitDefaultValue = false)] + public string RequestAmount { get; set; } /// /// The currency of the payment request. /// /// The currency of the payment request. - [JsonPropertyName("requestCurrencyCode")] - public string RequestCurrencyCode { get { return this.RequestCurrencyCodeOption; } set { this.RequestCurrencyCodeOption = new Option(value); } } + [DataMember(Name = "requestCurrencyCode", EmitDefaultValue = false)] + public string RequestCurrencyCode { get; set; } /// - /// Used to track the state of ShopperInteraction - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperInteractionOption { get; private set; } - - /// - /// The shopper interaction type of the payment request. Example: Ecommerce + /// The shopper interaction type of the payment request. Example: Ecommerce /// /// The shopper interaction type of the payment request. Example: Ecommerce - [JsonPropertyName("shopperInteraction")] - public string ShopperInteraction { get { return this.ShopperInteractionOption; } set { this.ShopperInteractionOption = new Option(value); } } - - /// - /// Used to track the state of ShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperReferenceOption { get; private set; } + [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] + public string ShopperInteraction { get; set; } /// /// The shopperReference passed in the payment request. Example: AdyenTestShopperXX /// /// The shopperReference passed in the payment request. Example: AdyenTestShopperXX - [JsonPropertyName("shopperReference")] - public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of TerminalId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TerminalIdOption { get; private set; } + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } /// /// The terminal ID used in a point-of-sale payment. Example: 06022622 /// /// The terminal ID used in a point-of-sale payment. Example: 06022622 - [JsonPropertyName("terminalId")] - public string TerminalId { get { return this.TerminalIdOption; } set { this.TerminalIdOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDAuthenticated - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDAuthenticatedOption { get; private set; } + [DataMember(Name = "terminalId", EmitDefaultValue = false)] + public string TerminalId { get; set; } /// /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true /// /// A Boolean value indicating whether 3DS authentication was completed on this payment. Example: true - [JsonPropertyName("threeDAuthenticated")] - public string ThreeDAuthenticated { get { return this.ThreeDAuthenticatedOption; } set { this.ThreeDAuthenticatedOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDAuthenticatedResponse - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDAuthenticatedResponseOption { get; private set; } + [DataMember(Name = "threeDAuthenticated", EmitDefaultValue = false)] + public string ThreeDAuthenticated { get; set; } /// /// The raw 3DS authentication result from the card issuer. Example: N /// /// The raw 3DS authentication result from the card issuer. Example: N - [JsonPropertyName("threeDAuthenticatedResponse")] - public string ThreeDAuthenticatedResponse { get { return this.ThreeDAuthenticatedResponseOption; } set { this.ThreeDAuthenticatedResponseOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDOffered - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDOfferedOption { get; private set; } + [DataMember(Name = "threeDAuthenticatedResponse", EmitDefaultValue = false)] + public string ThreeDAuthenticatedResponse { get; set; } /// /// A Boolean value indicating whether 3DS was offered for this payment. Example: true /// /// A Boolean value indicating whether 3DS was offered for this payment. Example: true - [JsonPropertyName("threeDOffered")] - public string ThreeDOffered { get { return this.ThreeDOfferedOption; } set { this.ThreeDOfferedOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDOfferedResponse - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDOfferedResponseOption { get; private set; } + [DataMember(Name = "threeDOffered", EmitDefaultValue = false)] + public string ThreeDOffered { get; set; } /// /// The raw enrollment result from the 3DS directory services of the card schemes. Example: Y /// /// The raw enrollment result from the 3DS directory services of the card schemes. Example: Y - [JsonPropertyName("threeDOfferedResponse")] - public string ThreeDOfferedResponse { get { return this.ThreeDOfferedResponseOption; } set { this.ThreeDOfferedResponseOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSVersionOption { get; private set; } + [DataMember(Name = "threeDOfferedResponse", EmitDefaultValue = false)] + public string ThreeDOfferedResponse { get; set; } /// /// The 3D Secure 2 version. /// /// The 3D Secure 2 version. - [JsonPropertyName("threeDSVersion")] - public string ThreeDSVersion { get { return this.ThreeDSVersionOption; } set { this.ThreeDSVersionOption = new Option(value); } } - - /// - /// Used to track the state of TokenizationShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TokenizationShopperReferenceOption { get; private set; } + [DataMember(Name = "threeDSVersion", EmitDefaultValue = false)] + public string ThreeDSVersion { get; set; } /// /// The reference for the shopper that you sent when tokenizing the payment details. /// /// The reference for the shopper that you sent when tokenizing the payment details. - [JsonPropertyName("tokenization.shopperReference")] - public string TokenizationShopperReference { get { return this.TokenizationShopperReferenceOption; } set { this.TokenizationShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of TokenizationStoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TokenizationStoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "tokenization.shopperReference", EmitDefaultValue = false)] + public string TokenizationShopperReference { get; set; } /// /// The reference that uniquely identifies tokenized payment details. /// /// The reference that uniquely identifies tokenized payment details. - [JsonPropertyName("tokenization.storedPaymentMethodId")] - public string TokenizationStoredPaymentMethodId { get { return this.TokenizationStoredPaymentMethodIdOption; } set { this.TokenizationStoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of VisaTransactionId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option VisaTransactionIdOption { get; private set; } + [DataMember(Name = "tokenization.storedPaymentMethodId", EmitDefaultValue = false)] + public string TokenizationStoredPaymentMethodId { get; set; } /// /// The `visaTransactionId`, has a fixed length of 15 numeric characters. > Contact Support Team to enable this field. /// /// The `visaTransactionId`, has a fixed length of 15 numeric characters. > Contact Support Team to enable this field. - [JsonPropertyName("visaTransactionId")] - public string VisaTransactionId { get { return this.VisaTransactionIdOption; } set { this.VisaTransactionIdOption = new Option(value); } } - - /// - /// Used to track the state of Xid - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option XidOption { get; private set; } + [DataMember(Name = "visaTransactionId", EmitDefaultValue = false)] + public string VisaTransactionId { get; set; } /// /// The 3DS transaction ID of the 3DS session sent in notifications. The value is Base64-encoded and is returned for transactions with directoryResponse 'N' or 'Y'. Example: ODgxNDc2MDg2MDExODk5MAAAAAA= /// /// The 3DS transaction ID of the 3DS session sent in notifications. The value is Base64-encoded and is returned for transactions with directoryResponse 'N' or 'Y'. Example: ODgxNDc2MDg2MDExODk5MAAAAAA= - [JsonPropertyName("xid")] - public string Xid { get { return this.XidOption; } set { this.XidOption = new Option(value); } } + [DataMember(Name = "xid", EmitDefaultValue = false)] + public string Xid { get; set; } /// /// Returns the string presentation of the object @@ -1465,897 +798,610 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ResponseAdditionalDataCommonJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ResponseAdditionalDataCommon Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option acquirerAccountCode = default; - Option acquirerCode = default; - Option acquirerReference = default; - Option alias = default; - Option aliasType = default; - Option authCode = default; - Option authorisationMid = default; - Option authorisedAmountCurrency = default; - Option authorisedAmountValue = default; - Option avsResult = default; - Option avsResultRaw = default; - Option bic = default; - Option coBrandedWith = default; - Option cvcResult = default; - Option cvcResultRaw = default; - Option dsTransID = default; - Option eci = default; - Option expiryDate = default; - Option extraCostsCurrency = default; - Option extraCostsValue = default; - Option fraudCheckItemNrFraudCheckname = default; - Option fraudManualReview = default; - Option fraudResultType = default; - Option fraudRiskLevel = default; - Option fundingSource = default; - Option fundsAvailability = default; - Option inferredRefusalReason = default; - Option isCardCommercial = default; - Option issuerCountry = default; - Option liabilityShift = default; - Option mcBankNetReferenceNumber = default; - Option merchantAdviceCode = default; - Option merchantReference = default; - Option networkTxReference = default; - Option ownerName = default; - Option paymentAccountReference = default; - Option paymentMethod = default; - Option paymentMethodVariant = default; - Option payoutEligible = default; - Option realtimeAccountUpdaterStatus = default; - Option receiptFreeText = default; - Option recurringContractTypes = default; - Option recurringFirstPspReference = default; - Option recurringRecurringDetailReference = default; - Option recurringShopperReference = default; - Option recurringProcessingModel = default; - Option referred = default; - Option refusalReasonRaw = default; - Option requestAmount = default; - Option requestCurrencyCode = default; - Option shopperInteraction = default; - Option shopperReference = default; - Option terminalId = default; - Option threeDAuthenticated = default; - Option threeDAuthenticatedResponse = default; - Option threeDOffered = default; - Option threeDOfferedResponse = default; - Option threeDSVersion = default; - Option tokenizationShopperReference = default; - Option tokenizationStoreOperationType = default; - Option tokenizationStoredPaymentMethodId = default; - Option visaTransactionId = default; - Option xid = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; + return this.Equals(input as ResponseAdditionalDataCommon); + } - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "acquirerAccountCode": - acquirerAccountCode = new Option(utf8JsonReader.GetString()); - break; - case "acquirerCode": - acquirerCode = new Option(utf8JsonReader.GetString()); - break; - case "acquirerReference": - acquirerReference = new Option(utf8JsonReader.GetString()); - break; - case "alias": - alias = new Option(utf8JsonReader.GetString()); - break; - case "aliasType": - aliasType = new Option(utf8JsonReader.GetString()); - break; - case "authCode": - authCode = new Option(utf8JsonReader.GetString()); - break; - case "authorisationMid": - authorisationMid = new Option(utf8JsonReader.GetString()); - break; - case "authorisedAmountCurrency": - authorisedAmountCurrency = new Option(utf8JsonReader.GetString()); - break; - case "authorisedAmountValue": - authorisedAmountValue = new Option(utf8JsonReader.GetString()); - break; - case "avsResult": - avsResult = new Option(utf8JsonReader.GetString()); - break; - case "avsResultRaw": - avsResultRaw = new Option(utf8JsonReader.GetString()); - break; - case "bic": - bic = new Option(utf8JsonReader.GetString()); - break; - case "coBrandedWith": - coBrandedWith = new Option(utf8JsonReader.GetString()); - break; - case "cvcResult": - cvcResult = new Option(utf8JsonReader.GetString()); - break; - case "cvcResultRaw": - cvcResultRaw = new Option(utf8JsonReader.GetString()); - break; - case "dsTransID": - dsTransID = new Option(utf8JsonReader.GetString()); - break; - case "eci": - eci = new Option(utf8JsonReader.GetString()); - break; - case "expiryDate": - expiryDate = new Option(utf8JsonReader.GetString()); - break; - case "extraCostsCurrency": - extraCostsCurrency = new Option(utf8JsonReader.GetString()); - break; - case "extraCostsValue": - extraCostsValue = new Option(utf8JsonReader.GetString()); - break; - case "fraudCheck-[itemNr]-[FraudCheckname]": - fraudCheckItemNrFraudCheckname = new Option(utf8JsonReader.GetString()); - break; - case "fraudManualReview": - fraudManualReview = new Option(utf8JsonReader.GetString()); - break; - case "fraudResultType": - string fraudResultTypeRawValue = utf8JsonReader.GetString(); - if (fraudResultTypeRawValue != null) - fraudResultType = new Option(ResponseAdditionalDataCommon.FraudResultTypeEnumFromStringOrDefault(fraudResultTypeRawValue)); - break; - case "fraudRiskLevel": - string fraudRiskLevelRawValue = utf8JsonReader.GetString(); - if (fraudRiskLevelRawValue != null) - fraudRiskLevel = new Option(ResponseAdditionalDataCommon.FraudRiskLevelEnumFromStringOrDefault(fraudRiskLevelRawValue)); - break; - case "fundingSource": - fundingSource = new Option(utf8JsonReader.GetString()); - break; - case "fundsAvailability": - fundsAvailability = new Option(utf8JsonReader.GetString()); - break; - case "inferredRefusalReason": - inferredRefusalReason = new Option(utf8JsonReader.GetString()); - break; - case "isCardCommercial": - isCardCommercial = new Option(utf8JsonReader.GetString()); - break; - case "issuerCountry": - issuerCountry = new Option(utf8JsonReader.GetString()); - break; - case "liabilityShift": - liabilityShift = new Option(utf8JsonReader.GetString()); - break; - case "mcBankNetReferenceNumber": - mcBankNetReferenceNumber = new Option(utf8JsonReader.GetString()); - break; - case "merchantAdviceCode": - merchantAdviceCode = new Option(utf8JsonReader.GetString()); - break; - case "merchantReference": - merchantReference = new Option(utf8JsonReader.GetString()); - break; - case "networkTxReference": - networkTxReference = new Option(utf8JsonReader.GetString()); - break; - case "ownerName": - ownerName = new Option(utf8JsonReader.GetString()); - break; - case "paymentAccountReference": - paymentAccountReference = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethod": - paymentMethod = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethodVariant": - paymentMethodVariant = new Option(utf8JsonReader.GetString()); - break; - case "payoutEligible": - payoutEligible = new Option(utf8JsonReader.GetString()); - break; - case "realtimeAccountUpdaterStatus": - realtimeAccountUpdaterStatus = new Option(utf8JsonReader.GetString()); - break; - case "receiptFreeText": - receiptFreeText = new Option(utf8JsonReader.GetString()); - break; - case "recurring.contractTypes": - recurringContractTypes = new Option(utf8JsonReader.GetString()); - break; - case "recurring.firstPspReference": - recurringFirstPspReference = new Option(utf8JsonReader.GetString()); - break; - case "recurring.recurringDetailReference": - recurringRecurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "recurring.shopperReference": - recurringShopperReference = new Option(utf8JsonReader.GetString()); - break; - case "recurringProcessingModel": - string recurringProcessingModelRawValue = utf8JsonReader.GetString(); - if (recurringProcessingModelRawValue != null) - recurringProcessingModel = new Option(ResponseAdditionalDataCommon.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); - break; - case "referred": - referred = new Option(utf8JsonReader.GetString()); - break; - case "refusalReasonRaw": - refusalReasonRaw = new Option(utf8JsonReader.GetString()); - break; - case "requestAmount": - requestAmount = new Option(utf8JsonReader.GetString()); - break; - case "requestCurrencyCode": - requestCurrencyCode = new Option(utf8JsonReader.GetString()); - break; - case "shopperInteraction": - shopperInteraction = new Option(utf8JsonReader.GetString()); - break; - case "shopperReference": - shopperReference = new Option(utf8JsonReader.GetString()); - break; - case "terminalId": - terminalId = new Option(utf8JsonReader.GetString()); - break; - case "threeDAuthenticated": - threeDAuthenticated = new Option(utf8JsonReader.GetString()); - break; - case "threeDAuthenticatedResponse": - threeDAuthenticatedResponse = new Option(utf8JsonReader.GetString()); - break; - case "threeDOffered": - threeDOffered = new Option(utf8JsonReader.GetString()); - break; - case "threeDOfferedResponse": - threeDOfferedResponse = new Option(utf8JsonReader.GetString()); - break; - case "threeDSVersion": - threeDSVersion = new Option(utf8JsonReader.GetString()); - break; - case "tokenization.shopperReference": - tokenizationShopperReference = new Option(utf8JsonReader.GetString()); - break; - case "tokenization.store.operationType": - string tokenizationStoreOperationTypeRawValue = utf8JsonReader.GetString(); - if (tokenizationStoreOperationTypeRawValue != null) - tokenizationStoreOperationType = new Option(ResponseAdditionalDataCommon.TokenizationStoreOperationTypeEnumFromStringOrDefault(tokenizationStoreOperationTypeRawValue)); - break; - case "tokenization.storedPaymentMethodId": - tokenizationStoredPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "visaTransactionId": - visaTransactionId = new Option(utf8JsonReader.GetString()); - break; - case "xid": - xid = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + /// + /// Returns true if ResponseAdditionalDataCommon instances are equal + /// + /// Instance of ResponseAdditionalDataCommon to be compared + /// Boolean + public bool Equals(ResponseAdditionalDataCommon input) + { + if (input == null) + { + return false; } - - if (acquirerAccountCode.IsSet && acquirerAccountCode.Value == null) - throw new ArgumentNullException(nameof(acquirerAccountCode), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (acquirerCode.IsSet && acquirerCode.Value == null) - throw new ArgumentNullException(nameof(acquirerCode), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (acquirerReference.IsSet && acquirerReference.Value == null) - throw new ArgumentNullException(nameof(acquirerReference), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (alias.IsSet && alias.Value == null) - throw new ArgumentNullException(nameof(alias), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (aliasType.IsSet && aliasType.Value == null) - throw new ArgumentNullException(nameof(aliasType), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (authCode.IsSet && authCode.Value == null) - throw new ArgumentNullException(nameof(authCode), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (authorisationMid.IsSet && authorisationMid.Value == null) - throw new ArgumentNullException(nameof(authorisationMid), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (authorisedAmountCurrency.IsSet && authorisedAmountCurrency.Value == null) - throw new ArgumentNullException(nameof(authorisedAmountCurrency), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (authorisedAmountValue.IsSet && authorisedAmountValue.Value == null) - throw new ArgumentNullException(nameof(authorisedAmountValue), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (avsResult.IsSet && avsResult.Value == null) - throw new ArgumentNullException(nameof(avsResult), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (avsResultRaw.IsSet && avsResultRaw.Value == null) - throw new ArgumentNullException(nameof(avsResultRaw), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (bic.IsSet && bic.Value == null) - throw new ArgumentNullException(nameof(bic), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (coBrandedWith.IsSet && coBrandedWith.Value == null) - throw new ArgumentNullException(nameof(coBrandedWith), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (cvcResult.IsSet && cvcResult.Value == null) - throw new ArgumentNullException(nameof(cvcResult), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (cvcResultRaw.IsSet && cvcResultRaw.Value == null) - throw new ArgumentNullException(nameof(cvcResultRaw), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (dsTransID.IsSet && dsTransID.Value == null) - throw new ArgumentNullException(nameof(dsTransID), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (eci.IsSet && eci.Value == null) - throw new ArgumentNullException(nameof(eci), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (expiryDate.IsSet && expiryDate.Value == null) - throw new ArgumentNullException(nameof(expiryDate), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (extraCostsCurrency.IsSet && extraCostsCurrency.Value == null) - throw new ArgumentNullException(nameof(extraCostsCurrency), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (extraCostsValue.IsSet && extraCostsValue.Value == null) - throw new ArgumentNullException(nameof(extraCostsValue), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (fraudCheckItemNrFraudCheckname.IsSet && fraudCheckItemNrFraudCheckname.Value == null) - throw new ArgumentNullException(nameof(fraudCheckItemNrFraudCheckname), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (fraudManualReview.IsSet && fraudManualReview.Value == null) - throw new ArgumentNullException(nameof(fraudManualReview), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (fraudResultType.IsSet && fraudResultType.Value == null) - throw new ArgumentNullException(nameof(fraudResultType), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (fraudRiskLevel.IsSet && fraudRiskLevel.Value == null) - throw new ArgumentNullException(nameof(fraudRiskLevel), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (fundsAvailability.IsSet && fundsAvailability.Value == null) - throw new ArgumentNullException(nameof(fundsAvailability), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (inferredRefusalReason.IsSet && inferredRefusalReason.Value == null) - throw new ArgumentNullException(nameof(inferredRefusalReason), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (isCardCommercial.IsSet && isCardCommercial.Value == null) - throw new ArgumentNullException(nameof(isCardCommercial), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (issuerCountry.IsSet && issuerCountry.Value == null) - throw new ArgumentNullException(nameof(issuerCountry), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (liabilityShift.IsSet && liabilityShift.Value == null) - throw new ArgumentNullException(nameof(liabilityShift), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (mcBankNetReferenceNumber.IsSet && mcBankNetReferenceNumber.Value == null) - throw new ArgumentNullException(nameof(mcBankNetReferenceNumber), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (merchantAdviceCode.IsSet && merchantAdviceCode.Value == null) - throw new ArgumentNullException(nameof(merchantAdviceCode), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (merchantReference.IsSet && merchantReference.Value == null) - throw new ArgumentNullException(nameof(merchantReference), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (networkTxReference.IsSet && networkTxReference.Value == null) - throw new ArgumentNullException(nameof(networkTxReference), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (ownerName.IsSet && ownerName.Value == null) - throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (paymentAccountReference.IsSet && paymentAccountReference.Value == null) - throw new ArgumentNullException(nameof(paymentAccountReference), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (paymentMethod.IsSet && paymentMethod.Value == null) - throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (paymentMethodVariant.IsSet && paymentMethodVariant.Value == null) - throw new ArgumentNullException(nameof(paymentMethodVariant), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (payoutEligible.IsSet && payoutEligible.Value == null) - throw new ArgumentNullException(nameof(payoutEligible), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (realtimeAccountUpdaterStatus.IsSet && realtimeAccountUpdaterStatus.Value == null) - throw new ArgumentNullException(nameof(realtimeAccountUpdaterStatus), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (receiptFreeText.IsSet && receiptFreeText.Value == null) - throw new ArgumentNullException(nameof(receiptFreeText), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (recurringContractTypes.IsSet && recurringContractTypes.Value == null) - throw new ArgumentNullException(nameof(recurringContractTypes), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (recurringFirstPspReference.IsSet && recurringFirstPspReference.Value == null) - throw new ArgumentNullException(nameof(recurringFirstPspReference), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (recurringRecurringDetailReference.IsSet && recurringRecurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringRecurringDetailReference), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (recurringShopperReference.IsSet && recurringShopperReference.Value == null) - throw new ArgumentNullException(nameof(recurringShopperReference), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) - throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (referred.IsSet && referred.Value == null) - throw new ArgumentNullException(nameof(referred), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (refusalReasonRaw.IsSet && refusalReasonRaw.Value == null) - throw new ArgumentNullException(nameof(refusalReasonRaw), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (requestAmount.IsSet && requestAmount.Value == null) - throw new ArgumentNullException(nameof(requestAmount), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (requestCurrencyCode.IsSet && requestCurrencyCode.Value == null) - throw new ArgumentNullException(nameof(requestCurrencyCode), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (shopperInteraction.IsSet && shopperInteraction.Value == null) - throw new ArgumentNullException(nameof(shopperInteraction), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (terminalId.IsSet && terminalId.Value == null) - throw new ArgumentNullException(nameof(terminalId), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (threeDAuthenticated.IsSet && threeDAuthenticated.Value == null) - throw new ArgumentNullException(nameof(threeDAuthenticated), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (threeDAuthenticatedResponse.IsSet && threeDAuthenticatedResponse.Value == null) - throw new ArgumentNullException(nameof(threeDAuthenticatedResponse), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (threeDOffered.IsSet && threeDOffered.Value == null) - throw new ArgumentNullException(nameof(threeDOffered), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (threeDOfferedResponse.IsSet && threeDOfferedResponse.Value == null) - throw new ArgumentNullException(nameof(threeDOfferedResponse), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (threeDSVersion.IsSet && threeDSVersion.Value == null) - throw new ArgumentNullException(nameof(threeDSVersion), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (tokenizationShopperReference.IsSet && tokenizationShopperReference.Value == null) - throw new ArgumentNullException(nameof(tokenizationShopperReference), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (tokenizationStoreOperationType.IsSet && tokenizationStoreOperationType.Value == null) - throw new ArgumentNullException(nameof(tokenizationStoreOperationType), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (tokenizationStoredPaymentMethodId.IsSet && tokenizationStoredPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(tokenizationStoredPaymentMethodId), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (visaTransactionId.IsSet && visaTransactionId.Value == null) - throw new ArgumentNullException(nameof(visaTransactionId), "Property is not nullable for class ResponseAdditionalDataCommon."); - - if (xid.IsSet && xid.Value == null) - throw new ArgumentNullException(nameof(xid), "Property is not nullable for class ResponseAdditionalDataCommon."); - - return new ResponseAdditionalDataCommon(acquirerAccountCode, acquirerCode, acquirerReference, alias, aliasType, authCode, authorisationMid, authorisedAmountCurrency, authorisedAmountValue, avsResult, avsResultRaw, bic, coBrandedWith, cvcResult, cvcResultRaw, dsTransID, eci, expiryDate, extraCostsCurrency, extraCostsValue, fraudCheckItemNrFraudCheckname, fraudManualReview, fraudResultType, fraudRiskLevel, fundingSource, fundsAvailability, inferredRefusalReason, isCardCommercial, issuerCountry, liabilityShift, mcBankNetReferenceNumber, merchantAdviceCode, merchantReference, networkTxReference, ownerName, paymentAccountReference, paymentMethod, paymentMethodVariant, payoutEligible, realtimeAccountUpdaterStatus, receiptFreeText, recurringContractTypes, recurringFirstPspReference, recurringRecurringDetailReference, recurringShopperReference, recurringProcessingModel, referred, refusalReasonRaw, requestAmount, requestCurrencyCode, shopperInteraction, shopperReference, terminalId, threeDAuthenticated, threeDAuthenticatedResponse, threeDOffered, threeDOfferedResponse, threeDSVersion, tokenizationShopperReference, tokenizationStoreOperationType, tokenizationStoredPaymentMethodId, visaTransactionId, xid); + return + ( + this.AcquirerAccountCode == input.AcquirerAccountCode || + (this.AcquirerAccountCode != null && + this.AcquirerAccountCode.Equals(input.AcquirerAccountCode)) + ) && + ( + this.AcquirerCode == input.AcquirerCode || + (this.AcquirerCode != null && + this.AcquirerCode.Equals(input.AcquirerCode)) + ) && + ( + this.AcquirerReference == input.AcquirerReference || + (this.AcquirerReference != null && + this.AcquirerReference.Equals(input.AcquirerReference)) + ) && + ( + this.Alias == input.Alias || + (this.Alias != null && + this.Alias.Equals(input.Alias)) + ) && + ( + this.AliasType == input.AliasType || + (this.AliasType != null && + this.AliasType.Equals(input.AliasType)) + ) && + ( + this.AuthCode == input.AuthCode || + (this.AuthCode != null && + this.AuthCode.Equals(input.AuthCode)) + ) && + ( + this.AuthorisationMid == input.AuthorisationMid || + (this.AuthorisationMid != null && + this.AuthorisationMid.Equals(input.AuthorisationMid)) + ) && + ( + this.AuthorisedAmountCurrency == input.AuthorisedAmountCurrency || + (this.AuthorisedAmountCurrency != null && + this.AuthorisedAmountCurrency.Equals(input.AuthorisedAmountCurrency)) + ) && + ( + this.AuthorisedAmountValue == input.AuthorisedAmountValue || + (this.AuthorisedAmountValue != null && + this.AuthorisedAmountValue.Equals(input.AuthorisedAmountValue)) + ) && + ( + this.AvsResult == input.AvsResult || + (this.AvsResult != null && + this.AvsResult.Equals(input.AvsResult)) + ) && + ( + this.AvsResultRaw == input.AvsResultRaw || + (this.AvsResultRaw != null && + this.AvsResultRaw.Equals(input.AvsResultRaw)) + ) && + ( + this.Bic == input.Bic || + (this.Bic != null && + this.Bic.Equals(input.Bic)) + ) && + ( + this.CoBrandedWith == input.CoBrandedWith || + (this.CoBrandedWith != null && + this.CoBrandedWith.Equals(input.CoBrandedWith)) + ) && + ( + this.CvcResult == input.CvcResult || + (this.CvcResult != null && + this.CvcResult.Equals(input.CvcResult)) + ) && + ( + this.CvcResultRaw == input.CvcResultRaw || + (this.CvcResultRaw != null && + this.CvcResultRaw.Equals(input.CvcResultRaw)) + ) && + ( + this.DsTransID == input.DsTransID || + (this.DsTransID != null && + this.DsTransID.Equals(input.DsTransID)) + ) && + ( + this.Eci == input.Eci || + (this.Eci != null && + this.Eci.Equals(input.Eci)) + ) && + ( + this.ExpiryDate == input.ExpiryDate || + (this.ExpiryDate != null && + this.ExpiryDate.Equals(input.ExpiryDate)) + ) && + ( + this.ExtraCostsCurrency == input.ExtraCostsCurrency || + (this.ExtraCostsCurrency != null && + this.ExtraCostsCurrency.Equals(input.ExtraCostsCurrency)) + ) && + ( + this.ExtraCostsValue == input.ExtraCostsValue || + (this.ExtraCostsValue != null && + this.ExtraCostsValue.Equals(input.ExtraCostsValue)) + ) && + ( + this.FraudCheckItemNrFraudCheckname == input.FraudCheckItemNrFraudCheckname || + (this.FraudCheckItemNrFraudCheckname != null && + this.FraudCheckItemNrFraudCheckname.Equals(input.FraudCheckItemNrFraudCheckname)) + ) && + ( + this.FraudManualReview == input.FraudManualReview || + (this.FraudManualReview != null && + this.FraudManualReview.Equals(input.FraudManualReview)) + ) && + ( + this.FraudResultType == input.FraudResultType || + this.FraudResultType.Equals(input.FraudResultType) + ) && + ( + this.FraudRiskLevel == input.FraudRiskLevel || + this.FraudRiskLevel.Equals(input.FraudRiskLevel) + ) && + ( + this.FundingSource == input.FundingSource || + (this.FundingSource != null && + this.FundingSource.Equals(input.FundingSource)) + ) && + ( + this.FundsAvailability == input.FundsAvailability || + (this.FundsAvailability != null && + this.FundsAvailability.Equals(input.FundsAvailability)) + ) && + ( + this.InferredRefusalReason == input.InferredRefusalReason || + (this.InferredRefusalReason != null && + this.InferredRefusalReason.Equals(input.InferredRefusalReason)) + ) && + ( + this.IsCardCommercial == input.IsCardCommercial || + (this.IsCardCommercial != null && + this.IsCardCommercial.Equals(input.IsCardCommercial)) + ) && + ( + this.IssuerCountry == input.IssuerCountry || + (this.IssuerCountry != null && + this.IssuerCountry.Equals(input.IssuerCountry)) + ) && + ( + this.LiabilityShift == input.LiabilityShift || + (this.LiabilityShift != null && + this.LiabilityShift.Equals(input.LiabilityShift)) + ) && + ( + this.McBankNetReferenceNumber == input.McBankNetReferenceNumber || + (this.McBankNetReferenceNumber != null && + this.McBankNetReferenceNumber.Equals(input.McBankNetReferenceNumber)) + ) && + ( + this.MerchantAdviceCode == input.MerchantAdviceCode || + (this.MerchantAdviceCode != null && + this.MerchantAdviceCode.Equals(input.MerchantAdviceCode)) + ) && + ( + this.MerchantReference == input.MerchantReference || + (this.MerchantReference != null && + this.MerchantReference.Equals(input.MerchantReference)) + ) && + ( + this.NetworkTxReference == input.NetworkTxReference || + (this.NetworkTxReference != null && + this.NetworkTxReference.Equals(input.NetworkTxReference)) + ) && + ( + this.OwnerName == input.OwnerName || + (this.OwnerName != null && + this.OwnerName.Equals(input.OwnerName)) + ) && + ( + this.PaymentAccountReference == input.PaymentAccountReference || + (this.PaymentAccountReference != null && + this.PaymentAccountReference.Equals(input.PaymentAccountReference)) + ) && + ( + this.PaymentMethod == input.PaymentMethod || + (this.PaymentMethod != null && + this.PaymentMethod.Equals(input.PaymentMethod)) + ) && + ( + this.PaymentMethodVariant == input.PaymentMethodVariant || + (this.PaymentMethodVariant != null && + this.PaymentMethodVariant.Equals(input.PaymentMethodVariant)) + ) && + ( + this.PayoutEligible == input.PayoutEligible || + (this.PayoutEligible != null && + this.PayoutEligible.Equals(input.PayoutEligible)) + ) && + ( + this.RealtimeAccountUpdaterStatus == input.RealtimeAccountUpdaterStatus || + (this.RealtimeAccountUpdaterStatus != null && + this.RealtimeAccountUpdaterStatus.Equals(input.RealtimeAccountUpdaterStatus)) + ) && + ( + this.ReceiptFreeText == input.ReceiptFreeText || + (this.ReceiptFreeText != null && + this.ReceiptFreeText.Equals(input.ReceiptFreeText)) + ) && + ( + this.RecurringContractTypes == input.RecurringContractTypes || + (this.RecurringContractTypes != null && + this.RecurringContractTypes.Equals(input.RecurringContractTypes)) + ) && + ( + this.RecurringFirstPspReference == input.RecurringFirstPspReference || + (this.RecurringFirstPspReference != null && + this.RecurringFirstPspReference.Equals(input.RecurringFirstPspReference)) + ) && + ( + this.RecurringRecurringDetailReference == input.RecurringRecurringDetailReference || + (this.RecurringRecurringDetailReference != null && + this.RecurringRecurringDetailReference.Equals(input.RecurringRecurringDetailReference)) + ) && + ( + this.RecurringShopperReference == input.RecurringShopperReference || + (this.RecurringShopperReference != null && + this.RecurringShopperReference.Equals(input.RecurringShopperReference)) + ) && + ( + this.RecurringProcessingModel == input.RecurringProcessingModel || + this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) + ) && + ( + this.Referred == input.Referred || + (this.Referred != null && + this.Referred.Equals(input.Referred)) + ) && + ( + this.RefusalReasonRaw == input.RefusalReasonRaw || + (this.RefusalReasonRaw != null && + this.RefusalReasonRaw.Equals(input.RefusalReasonRaw)) + ) && + ( + this.RequestAmount == input.RequestAmount || + (this.RequestAmount != null && + this.RequestAmount.Equals(input.RequestAmount)) + ) && + ( + this.RequestCurrencyCode == input.RequestCurrencyCode || + (this.RequestCurrencyCode != null && + this.RequestCurrencyCode.Equals(input.RequestCurrencyCode)) + ) && + ( + this.ShopperInteraction == input.ShopperInteraction || + (this.ShopperInteraction != null && + this.ShopperInteraction.Equals(input.ShopperInteraction)) + ) && + ( + this.ShopperReference == input.ShopperReference || + (this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference)) + ) && + ( + this.TerminalId == input.TerminalId || + (this.TerminalId != null && + this.TerminalId.Equals(input.TerminalId)) + ) && + ( + this.ThreeDAuthenticated == input.ThreeDAuthenticated || + (this.ThreeDAuthenticated != null && + this.ThreeDAuthenticated.Equals(input.ThreeDAuthenticated)) + ) && + ( + this.ThreeDAuthenticatedResponse == input.ThreeDAuthenticatedResponse || + (this.ThreeDAuthenticatedResponse != null && + this.ThreeDAuthenticatedResponse.Equals(input.ThreeDAuthenticatedResponse)) + ) && + ( + this.ThreeDOffered == input.ThreeDOffered || + (this.ThreeDOffered != null && + this.ThreeDOffered.Equals(input.ThreeDOffered)) + ) && + ( + this.ThreeDOfferedResponse == input.ThreeDOfferedResponse || + (this.ThreeDOfferedResponse != null && + this.ThreeDOfferedResponse.Equals(input.ThreeDOfferedResponse)) + ) && + ( + this.ThreeDSVersion == input.ThreeDSVersion || + (this.ThreeDSVersion != null && + this.ThreeDSVersion.Equals(input.ThreeDSVersion)) + ) && + ( + this.TokenizationShopperReference == input.TokenizationShopperReference || + (this.TokenizationShopperReference != null && + this.TokenizationShopperReference.Equals(input.TokenizationShopperReference)) + ) && + ( + this.TokenizationStoreOperationType == input.TokenizationStoreOperationType || + this.TokenizationStoreOperationType.Equals(input.TokenizationStoreOperationType) + ) && + ( + this.TokenizationStoredPaymentMethodId == input.TokenizationStoredPaymentMethodId || + (this.TokenizationStoredPaymentMethodId != null && + this.TokenizationStoredPaymentMethodId.Equals(input.TokenizationStoredPaymentMethodId)) + ) && + ( + this.VisaTransactionId == input.VisaTransactionId || + (this.VisaTransactionId != null && + this.VisaTransactionId.Equals(input.VisaTransactionId)) + ) && + ( + this.Xid == input.Xid || + (this.Xid != null && + this.Xid.Equals(input.Xid)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataCommon responseAdditionalDataCommon, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, responseAdditionalDataCommon, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AcquirerAccountCode != null) + { + hashCode = (hashCode * 59) + this.AcquirerAccountCode.GetHashCode(); + } + if (this.AcquirerCode != null) + { + hashCode = (hashCode * 59) + this.AcquirerCode.GetHashCode(); + } + if (this.AcquirerReference != null) + { + hashCode = (hashCode * 59) + this.AcquirerReference.GetHashCode(); + } + if (this.Alias != null) + { + hashCode = (hashCode * 59) + this.Alias.GetHashCode(); + } + if (this.AliasType != null) + { + hashCode = (hashCode * 59) + this.AliasType.GetHashCode(); + } + if (this.AuthCode != null) + { + hashCode = (hashCode * 59) + this.AuthCode.GetHashCode(); + } + if (this.AuthorisationMid != null) + { + hashCode = (hashCode * 59) + this.AuthorisationMid.GetHashCode(); + } + if (this.AuthorisedAmountCurrency != null) + { + hashCode = (hashCode * 59) + this.AuthorisedAmountCurrency.GetHashCode(); + } + if (this.AuthorisedAmountValue != null) + { + hashCode = (hashCode * 59) + this.AuthorisedAmountValue.GetHashCode(); + } + if (this.AvsResult != null) + { + hashCode = (hashCode * 59) + this.AvsResult.GetHashCode(); + } + if (this.AvsResultRaw != null) + { + hashCode = (hashCode * 59) + this.AvsResultRaw.GetHashCode(); + } + if (this.Bic != null) + { + hashCode = (hashCode * 59) + this.Bic.GetHashCode(); + } + if (this.CoBrandedWith != null) + { + hashCode = (hashCode * 59) + this.CoBrandedWith.GetHashCode(); + } + if (this.CvcResult != null) + { + hashCode = (hashCode * 59) + this.CvcResult.GetHashCode(); + } + if (this.CvcResultRaw != null) + { + hashCode = (hashCode * 59) + this.CvcResultRaw.GetHashCode(); + } + if (this.DsTransID != null) + { + hashCode = (hashCode * 59) + this.DsTransID.GetHashCode(); + } + if (this.Eci != null) + { + hashCode = (hashCode * 59) + this.Eci.GetHashCode(); + } + if (this.ExpiryDate != null) + { + hashCode = (hashCode * 59) + this.ExpiryDate.GetHashCode(); + } + if (this.ExtraCostsCurrency != null) + { + hashCode = (hashCode * 59) + this.ExtraCostsCurrency.GetHashCode(); + } + if (this.ExtraCostsValue != null) + { + hashCode = (hashCode * 59) + this.ExtraCostsValue.GetHashCode(); + } + if (this.FraudCheckItemNrFraudCheckname != null) + { + hashCode = (hashCode * 59) + this.FraudCheckItemNrFraudCheckname.GetHashCode(); + } + if (this.FraudManualReview != null) + { + hashCode = (hashCode * 59) + this.FraudManualReview.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FraudResultType.GetHashCode(); + hashCode = (hashCode * 59) + this.FraudRiskLevel.GetHashCode(); + if (this.FundingSource != null) + { + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + } + if (this.FundsAvailability != null) + { + hashCode = (hashCode * 59) + this.FundsAvailability.GetHashCode(); + } + if (this.InferredRefusalReason != null) + { + hashCode = (hashCode * 59) + this.InferredRefusalReason.GetHashCode(); + } + if (this.IsCardCommercial != null) + { + hashCode = (hashCode * 59) + this.IsCardCommercial.GetHashCode(); + } + if (this.IssuerCountry != null) + { + hashCode = (hashCode * 59) + this.IssuerCountry.GetHashCode(); + } + if (this.LiabilityShift != null) + { + hashCode = (hashCode * 59) + this.LiabilityShift.GetHashCode(); + } + if (this.McBankNetReferenceNumber != null) + { + hashCode = (hashCode * 59) + this.McBankNetReferenceNumber.GetHashCode(); + } + if (this.MerchantAdviceCode != null) + { + hashCode = (hashCode * 59) + this.MerchantAdviceCode.GetHashCode(); + } + if (this.MerchantReference != null) + { + hashCode = (hashCode * 59) + this.MerchantReference.GetHashCode(); + } + if (this.NetworkTxReference != null) + { + hashCode = (hashCode * 59) + this.NetworkTxReference.GetHashCode(); + } + if (this.OwnerName != null) + { + hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); + } + if (this.PaymentAccountReference != null) + { + hashCode = (hashCode * 59) + this.PaymentAccountReference.GetHashCode(); + } + if (this.PaymentMethod != null) + { + hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); + } + if (this.PaymentMethodVariant != null) + { + hashCode = (hashCode * 59) + this.PaymentMethodVariant.GetHashCode(); + } + if (this.PayoutEligible != null) + { + hashCode = (hashCode * 59) + this.PayoutEligible.GetHashCode(); + } + if (this.RealtimeAccountUpdaterStatus != null) + { + hashCode = (hashCode * 59) + this.RealtimeAccountUpdaterStatus.GetHashCode(); + } + if (this.ReceiptFreeText != null) + { + hashCode = (hashCode * 59) + this.ReceiptFreeText.GetHashCode(); + } + if (this.RecurringContractTypes != null) + { + hashCode = (hashCode * 59) + this.RecurringContractTypes.GetHashCode(); + } + if (this.RecurringFirstPspReference != null) + { + hashCode = (hashCode * 59) + this.RecurringFirstPspReference.GetHashCode(); + } + if (this.RecurringRecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringRecurringDetailReference.GetHashCode(); + } + if (this.RecurringShopperReference != null) + { + hashCode = (hashCode * 59) + this.RecurringShopperReference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); + if (this.Referred != null) + { + hashCode = (hashCode * 59) + this.Referred.GetHashCode(); + } + if (this.RefusalReasonRaw != null) + { + hashCode = (hashCode * 59) + this.RefusalReasonRaw.GetHashCode(); + } + if (this.RequestAmount != null) + { + hashCode = (hashCode * 59) + this.RequestAmount.GetHashCode(); + } + if (this.RequestCurrencyCode != null) + { + hashCode = (hashCode * 59) + this.RequestCurrencyCode.GetHashCode(); + } + if (this.ShopperInteraction != null) + { + hashCode = (hashCode * 59) + this.ShopperInteraction.GetHashCode(); + } + if (this.ShopperReference != null) + { + hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); + } + if (this.TerminalId != null) + { + hashCode = (hashCode * 59) + this.TerminalId.GetHashCode(); + } + if (this.ThreeDAuthenticated != null) + { + hashCode = (hashCode * 59) + this.ThreeDAuthenticated.GetHashCode(); + } + if (this.ThreeDAuthenticatedResponse != null) + { + hashCode = (hashCode * 59) + this.ThreeDAuthenticatedResponse.GetHashCode(); + } + if (this.ThreeDOffered != null) + { + hashCode = (hashCode * 59) + this.ThreeDOffered.GetHashCode(); + } + if (this.ThreeDOfferedResponse != null) + { + hashCode = (hashCode * 59) + this.ThreeDOfferedResponse.GetHashCode(); + } + if (this.ThreeDSVersion != null) + { + hashCode = (hashCode * 59) + this.ThreeDSVersion.GetHashCode(); + } + if (this.TokenizationShopperReference != null) + { + hashCode = (hashCode * 59) + this.TokenizationShopperReference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TokenizationStoreOperationType.GetHashCode(); + if (this.TokenizationStoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.TokenizationStoredPaymentMethodId.GetHashCode(); + } + if (this.VisaTransactionId != null) + { + hashCode = (hashCode * 59) + this.VisaTransactionId.GetHashCode(); + } + if (this.Xid != null) + { + hashCode = (hashCode * 59) + this.Xid.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataCommon responseAdditionalDataCommon, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (responseAdditionalDataCommon.AcquirerAccountCodeOption.IsSet && responseAdditionalDataCommon.AcquirerAccountCode == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AcquirerAccountCode), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.AcquirerCodeOption.IsSet && responseAdditionalDataCommon.AcquirerCode == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AcquirerCode), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.AcquirerReferenceOption.IsSet && responseAdditionalDataCommon.AcquirerReference == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AcquirerReference), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.AliasOption.IsSet && responseAdditionalDataCommon.Alias == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.Alias), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.AliasTypeOption.IsSet && responseAdditionalDataCommon.AliasType == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AliasType), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.AuthCodeOption.IsSet && responseAdditionalDataCommon.AuthCode == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AuthCode), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.AuthorisationMidOption.IsSet && responseAdditionalDataCommon.AuthorisationMid == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AuthorisationMid), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.AuthorisedAmountCurrencyOption.IsSet && responseAdditionalDataCommon.AuthorisedAmountCurrency == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AuthorisedAmountCurrency), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.AuthorisedAmountValueOption.IsSet && responseAdditionalDataCommon.AuthorisedAmountValue == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AuthorisedAmountValue), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.AvsResultOption.IsSet && responseAdditionalDataCommon.AvsResult == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AvsResult), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.AvsResultRawOption.IsSet && responseAdditionalDataCommon.AvsResultRaw == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.AvsResultRaw), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.BicOption.IsSet && responseAdditionalDataCommon.Bic == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.Bic), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.CoBrandedWithOption.IsSet && responseAdditionalDataCommon.CoBrandedWith == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.CoBrandedWith), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.CvcResultOption.IsSet && responseAdditionalDataCommon.CvcResult == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.CvcResult), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.CvcResultRawOption.IsSet && responseAdditionalDataCommon.CvcResultRaw == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.CvcResultRaw), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.DsTransIDOption.IsSet && responseAdditionalDataCommon.DsTransID == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.DsTransID), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.EciOption.IsSet && responseAdditionalDataCommon.Eci == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.Eci), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.ExpiryDateOption.IsSet && responseAdditionalDataCommon.ExpiryDate == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ExpiryDate), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.ExtraCostsCurrencyOption.IsSet && responseAdditionalDataCommon.ExtraCostsCurrency == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ExtraCostsCurrency), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.ExtraCostsValueOption.IsSet && responseAdditionalDataCommon.ExtraCostsValue == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ExtraCostsValue), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.FraudCheckItemNrFraudChecknameOption.IsSet && responseAdditionalDataCommon.FraudCheckItemNrFraudCheckname == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.FraudCheckItemNrFraudCheckname), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.FraudManualReviewOption.IsSet && responseAdditionalDataCommon.FraudManualReview == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.FraudManualReview), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.FundingSourceOption.IsSet && responseAdditionalDataCommon.FundingSource == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.FundingSource), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.FundsAvailabilityOption.IsSet && responseAdditionalDataCommon.FundsAvailability == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.FundsAvailability), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.InferredRefusalReasonOption.IsSet && responseAdditionalDataCommon.InferredRefusalReason == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.InferredRefusalReason), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.IsCardCommercialOption.IsSet && responseAdditionalDataCommon.IsCardCommercial == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.IsCardCommercial), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.IssuerCountryOption.IsSet && responseAdditionalDataCommon.IssuerCountry == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.IssuerCountry), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.LiabilityShiftOption.IsSet && responseAdditionalDataCommon.LiabilityShift == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.LiabilityShift), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.McBankNetReferenceNumberOption.IsSet && responseAdditionalDataCommon.McBankNetReferenceNumber == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.McBankNetReferenceNumber), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.MerchantAdviceCodeOption.IsSet && responseAdditionalDataCommon.MerchantAdviceCode == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.MerchantAdviceCode), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.MerchantReferenceOption.IsSet && responseAdditionalDataCommon.MerchantReference == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.MerchantReference), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.NetworkTxReferenceOption.IsSet && responseAdditionalDataCommon.NetworkTxReference == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.NetworkTxReference), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.OwnerNameOption.IsSet && responseAdditionalDataCommon.OwnerName == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.OwnerName), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.PaymentAccountReferenceOption.IsSet && responseAdditionalDataCommon.PaymentAccountReference == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.PaymentAccountReference), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.PaymentMethodOption.IsSet && responseAdditionalDataCommon.PaymentMethod == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.PaymentMethod), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.PaymentMethodVariantOption.IsSet && responseAdditionalDataCommon.PaymentMethodVariant == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.PaymentMethodVariant), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.PayoutEligibleOption.IsSet && responseAdditionalDataCommon.PayoutEligible == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.PayoutEligible), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.RealtimeAccountUpdaterStatusOption.IsSet && responseAdditionalDataCommon.RealtimeAccountUpdaterStatus == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RealtimeAccountUpdaterStatus), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.ReceiptFreeTextOption.IsSet && responseAdditionalDataCommon.ReceiptFreeText == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ReceiptFreeText), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.RecurringContractTypesOption.IsSet && responseAdditionalDataCommon.RecurringContractTypes == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RecurringContractTypes), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.RecurringFirstPspReferenceOption.IsSet && responseAdditionalDataCommon.RecurringFirstPspReference == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RecurringFirstPspReference), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.RecurringRecurringDetailReferenceOption.IsSet && responseAdditionalDataCommon.RecurringRecurringDetailReference == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RecurringRecurringDetailReference), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.RecurringShopperReferenceOption.IsSet && responseAdditionalDataCommon.RecurringShopperReference == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RecurringShopperReference), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.ReferredOption.IsSet && responseAdditionalDataCommon.Referred == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.Referred), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.RefusalReasonRawOption.IsSet && responseAdditionalDataCommon.RefusalReasonRaw == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RefusalReasonRaw), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.RequestAmountOption.IsSet && responseAdditionalDataCommon.RequestAmount == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RequestAmount), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.RequestCurrencyCodeOption.IsSet && responseAdditionalDataCommon.RequestCurrencyCode == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.RequestCurrencyCode), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.ShopperInteractionOption.IsSet && responseAdditionalDataCommon.ShopperInteraction == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ShopperInteraction), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.ShopperReferenceOption.IsSet && responseAdditionalDataCommon.ShopperReference == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ShopperReference), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.TerminalIdOption.IsSet && responseAdditionalDataCommon.TerminalId == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.TerminalId), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.ThreeDAuthenticatedOption.IsSet && responseAdditionalDataCommon.ThreeDAuthenticated == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ThreeDAuthenticated), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.ThreeDAuthenticatedResponseOption.IsSet && responseAdditionalDataCommon.ThreeDAuthenticatedResponse == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ThreeDAuthenticatedResponse), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.ThreeDOfferedOption.IsSet && responseAdditionalDataCommon.ThreeDOffered == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ThreeDOffered), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.ThreeDOfferedResponseOption.IsSet && responseAdditionalDataCommon.ThreeDOfferedResponse == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ThreeDOfferedResponse), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.ThreeDSVersionOption.IsSet && responseAdditionalDataCommon.ThreeDSVersion == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.ThreeDSVersion), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.TokenizationShopperReferenceOption.IsSet && responseAdditionalDataCommon.TokenizationShopperReference == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.TokenizationShopperReference), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.TokenizationStoredPaymentMethodIdOption.IsSet && responseAdditionalDataCommon.TokenizationStoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.TokenizationStoredPaymentMethodId), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.VisaTransactionIdOption.IsSet && responseAdditionalDataCommon.VisaTransactionId == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.VisaTransactionId), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.XidOption.IsSet && responseAdditionalDataCommon.Xid == null) - throw new ArgumentNullException(nameof(responseAdditionalDataCommon.Xid), "Property is required for class ResponseAdditionalDataCommon."); - - if (responseAdditionalDataCommon.AcquirerAccountCodeOption.IsSet) - writer.WriteString("acquirerAccountCode", responseAdditionalDataCommon.AcquirerAccountCode); - - if (responseAdditionalDataCommon.AcquirerCodeOption.IsSet) - writer.WriteString("acquirerCode", responseAdditionalDataCommon.AcquirerCode); - - if (responseAdditionalDataCommon.AcquirerReferenceOption.IsSet) - writer.WriteString("acquirerReference", responseAdditionalDataCommon.AcquirerReference); - - if (responseAdditionalDataCommon.AliasOption.IsSet) - writer.WriteString("alias", responseAdditionalDataCommon.Alias); - - if (responseAdditionalDataCommon.AliasTypeOption.IsSet) - writer.WriteString("aliasType", responseAdditionalDataCommon.AliasType); - - if (responseAdditionalDataCommon.AuthCodeOption.IsSet) - writer.WriteString("authCode", responseAdditionalDataCommon.AuthCode); - - if (responseAdditionalDataCommon.AuthorisationMidOption.IsSet) - writer.WriteString("authorisationMid", responseAdditionalDataCommon.AuthorisationMid); - - if (responseAdditionalDataCommon.AuthorisedAmountCurrencyOption.IsSet) - writer.WriteString("authorisedAmountCurrency", responseAdditionalDataCommon.AuthorisedAmountCurrency); - - if (responseAdditionalDataCommon.AuthorisedAmountValueOption.IsSet) - writer.WriteString("authorisedAmountValue", responseAdditionalDataCommon.AuthorisedAmountValue); - - if (responseAdditionalDataCommon.AvsResultOption.IsSet) - writer.WriteString("avsResult", responseAdditionalDataCommon.AvsResult); - - if (responseAdditionalDataCommon.AvsResultRawOption.IsSet) - writer.WriteString("avsResultRaw", responseAdditionalDataCommon.AvsResultRaw); - - if (responseAdditionalDataCommon.BicOption.IsSet) - writer.WriteString("bic", responseAdditionalDataCommon.Bic); - - if (responseAdditionalDataCommon.CoBrandedWithOption.IsSet) - writer.WriteString("coBrandedWith", responseAdditionalDataCommon.CoBrandedWith); - - if (responseAdditionalDataCommon.CvcResultOption.IsSet) - writer.WriteString("cvcResult", responseAdditionalDataCommon.CvcResult); - - if (responseAdditionalDataCommon.CvcResultRawOption.IsSet) - writer.WriteString("cvcResultRaw", responseAdditionalDataCommon.CvcResultRaw); - - if (responseAdditionalDataCommon.DsTransIDOption.IsSet) - writer.WriteString("dsTransID", responseAdditionalDataCommon.DsTransID); - - if (responseAdditionalDataCommon.EciOption.IsSet) - writer.WriteString("eci", responseAdditionalDataCommon.Eci); - - if (responseAdditionalDataCommon.ExpiryDateOption.IsSet) - writer.WriteString("expiryDate", responseAdditionalDataCommon.ExpiryDate); - - if (responseAdditionalDataCommon.ExtraCostsCurrencyOption.IsSet) - writer.WriteString("extraCostsCurrency", responseAdditionalDataCommon.ExtraCostsCurrency); - - if (responseAdditionalDataCommon.ExtraCostsValueOption.IsSet) - writer.WriteString("extraCostsValue", responseAdditionalDataCommon.ExtraCostsValue); - - if (responseAdditionalDataCommon.FraudCheckItemNrFraudChecknameOption.IsSet) - writer.WriteString("fraudCheck-[itemNr]-[FraudCheckname]", responseAdditionalDataCommon.FraudCheckItemNrFraudCheckname); - - if (responseAdditionalDataCommon.FraudManualReviewOption.IsSet) - writer.WriteString("fraudManualReview", responseAdditionalDataCommon.FraudManualReview); - - var fraudResultTypeRawValue = ResponseAdditionalDataCommon.FraudResultTypeEnumToJsonValue(responseAdditionalDataCommon.FraudResultTypeOption.Value.Value); - writer.WriteString("fraudResultType", fraudResultTypeRawValue); - var fraudRiskLevelRawValue = ResponseAdditionalDataCommon.FraudRiskLevelEnumToJsonValue(responseAdditionalDataCommon.FraudRiskLevelOption.Value.Value); - writer.WriteString("fraudRiskLevel", fraudRiskLevelRawValue); - if (responseAdditionalDataCommon.FundingSourceOption.IsSet) - writer.WriteString("fundingSource", responseAdditionalDataCommon.FundingSource); - - if (responseAdditionalDataCommon.FundsAvailabilityOption.IsSet) - writer.WriteString("fundsAvailability", responseAdditionalDataCommon.FundsAvailability); - - if (responseAdditionalDataCommon.InferredRefusalReasonOption.IsSet) - writer.WriteString("inferredRefusalReason", responseAdditionalDataCommon.InferredRefusalReason); - - if (responseAdditionalDataCommon.IsCardCommercialOption.IsSet) - writer.WriteString("isCardCommercial", responseAdditionalDataCommon.IsCardCommercial); - - if (responseAdditionalDataCommon.IssuerCountryOption.IsSet) - writer.WriteString("issuerCountry", responseAdditionalDataCommon.IssuerCountry); - - if (responseAdditionalDataCommon.LiabilityShiftOption.IsSet) - writer.WriteString("liabilityShift", responseAdditionalDataCommon.LiabilityShift); - - if (responseAdditionalDataCommon.McBankNetReferenceNumberOption.IsSet) - writer.WriteString("mcBankNetReferenceNumber", responseAdditionalDataCommon.McBankNetReferenceNumber); - - if (responseAdditionalDataCommon.MerchantAdviceCodeOption.IsSet) - writer.WriteString("merchantAdviceCode", responseAdditionalDataCommon.MerchantAdviceCode); - - if (responseAdditionalDataCommon.MerchantReferenceOption.IsSet) - writer.WriteString("merchantReference", responseAdditionalDataCommon.MerchantReference); - - if (responseAdditionalDataCommon.NetworkTxReferenceOption.IsSet) - writer.WriteString("networkTxReference", responseAdditionalDataCommon.NetworkTxReference); - - if (responseAdditionalDataCommon.OwnerNameOption.IsSet) - writer.WriteString("ownerName", responseAdditionalDataCommon.OwnerName); - - if (responseAdditionalDataCommon.PaymentAccountReferenceOption.IsSet) - writer.WriteString("paymentAccountReference", responseAdditionalDataCommon.PaymentAccountReference); - - if (responseAdditionalDataCommon.PaymentMethodOption.IsSet) - writer.WriteString("paymentMethod", responseAdditionalDataCommon.PaymentMethod); - - if (responseAdditionalDataCommon.PaymentMethodVariantOption.IsSet) - writer.WriteString("paymentMethodVariant", responseAdditionalDataCommon.PaymentMethodVariant); - - if (responseAdditionalDataCommon.PayoutEligibleOption.IsSet) - writer.WriteString("payoutEligible", responseAdditionalDataCommon.PayoutEligible); - - if (responseAdditionalDataCommon.RealtimeAccountUpdaterStatusOption.IsSet) - writer.WriteString("realtimeAccountUpdaterStatus", responseAdditionalDataCommon.RealtimeAccountUpdaterStatus); - - if (responseAdditionalDataCommon.ReceiptFreeTextOption.IsSet) - writer.WriteString("receiptFreeText", responseAdditionalDataCommon.ReceiptFreeText); - - if (responseAdditionalDataCommon.RecurringContractTypesOption.IsSet) - writer.WriteString("recurring.contractTypes", responseAdditionalDataCommon.RecurringContractTypes); - - if (responseAdditionalDataCommon.RecurringFirstPspReferenceOption.IsSet) - writer.WriteString("recurring.firstPspReference", responseAdditionalDataCommon.RecurringFirstPspReference); - - if (responseAdditionalDataCommon.RecurringRecurringDetailReferenceOption.IsSet) - writer.WriteString("recurring.recurringDetailReference", responseAdditionalDataCommon.RecurringRecurringDetailReference); - - if (responseAdditionalDataCommon.RecurringShopperReferenceOption.IsSet) - writer.WriteString("recurring.shopperReference", responseAdditionalDataCommon.RecurringShopperReference); - - var recurringProcessingModelRawValue = ResponseAdditionalDataCommon.RecurringProcessingModelEnumToJsonValue(responseAdditionalDataCommon.RecurringProcessingModelOption.Value.Value); - writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); - if (responseAdditionalDataCommon.ReferredOption.IsSet) - writer.WriteString("referred", responseAdditionalDataCommon.Referred); - - if (responseAdditionalDataCommon.RefusalReasonRawOption.IsSet) - writer.WriteString("refusalReasonRaw", responseAdditionalDataCommon.RefusalReasonRaw); - - if (responseAdditionalDataCommon.RequestAmountOption.IsSet) - writer.WriteString("requestAmount", responseAdditionalDataCommon.RequestAmount); - - if (responseAdditionalDataCommon.RequestCurrencyCodeOption.IsSet) - writer.WriteString("requestCurrencyCode", responseAdditionalDataCommon.RequestCurrencyCode); - - if (responseAdditionalDataCommon.ShopperInteractionOption.IsSet) - writer.WriteString("shopperInteraction", responseAdditionalDataCommon.ShopperInteraction); - - if (responseAdditionalDataCommon.ShopperReferenceOption.IsSet) - writer.WriteString("shopperReference", responseAdditionalDataCommon.ShopperReference); - - if (responseAdditionalDataCommon.TerminalIdOption.IsSet) - writer.WriteString("terminalId", responseAdditionalDataCommon.TerminalId); - - if (responseAdditionalDataCommon.ThreeDAuthenticatedOption.IsSet) - writer.WriteString("threeDAuthenticated", responseAdditionalDataCommon.ThreeDAuthenticated); - - if (responseAdditionalDataCommon.ThreeDAuthenticatedResponseOption.IsSet) - writer.WriteString("threeDAuthenticatedResponse", responseAdditionalDataCommon.ThreeDAuthenticatedResponse); - - if (responseAdditionalDataCommon.ThreeDOfferedOption.IsSet) - writer.WriteString("threeDOffered", responseAdditionalDataCommon.ThreeDOffered); - - if (responseAdditionalDataCommon.ThreeDOfferedResponseOption.IsSet) - writer.WriteString("threeDOfferedResponse", responseAdditionalDataCommon.ThreeDOfferedResponse); - - if (responseAdditionalDataCommon.ThreeDSVersionOption.IsSet) - writer.WriteString("threeDSVersion", responseAdditionalDataCommon.ThreeDSVersion); - - if (responseAdditionalDataCommon.TokenizationShopperReferenceOption.IsSet) - writer.WriteString("tokenization.shopperReference", responseAdditionalDataCommon.TokenizationShopperReference); - - var tokenizationStoreOperationTypeRawValue = ResponseAdditionalDataCommon.TokenizationStoreOperationTypeEnumToJsonValue(responseAdditionalDataCommon.TokenizationStoreOperationTypeOption.Value.Value); - writer.WriteString("tokenization.store.operationType", tokenizationStoreOperationTypeRawValue); - if (responseAdditionalDataCommon.TokenizationStoredPaymentMethodIdOption.IsSet) - writer.WriteString("tokenization.storedPaymentMethodId", responseAdditionalDataCommon.TokenizationStoredPaymentMethodId); - - if (responseAdditionalDataCommon.VisaTransactionIdOption.IsSet) - writer.WriteString("visaTransactionId", responseAdditionalDataCommon.VisaTransactionId); - - if (responseAdditionalDataCommon.XidOption.IsSet) - writer.WriteString("xid", responseAdditionalDataCommon.Xid); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs b/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs index 58b75bfab..10fb4a993 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,62 +15,47 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataDomesticError /// - public partial class ResponseAdditionalDataDomesticError : IValidatableObject + [DataContract(Name = "ResponseAdditionalDataDomesticError")] + public partial class ResponseAdditionalDataDomesticError : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The reason the transaction was declined, given by the local issuer. Currently available for merchants in Japan. - /// The action the shopper should take, in a local language. Currently available in Japanese, for merchants in Japan. - [JsonConstructor] - public ResponseAdditionalDataDomesticError(Option domesticRefusalReasonRaw = default, Option domesticShopperAdvice = default) + /// The reason the transaction was declined, given by the local issuer. Currently available for merchants in Japan.. + /// The action the shopper should take, in a local language. Currently available in Japanese, for merchants in Japan.. + public ResponseAdditionalDataDomesticError(string domesticRefusalReasonRaw = default(string), string domesticShopperAdvice = default(string)) { - DomesticRefusalReasonRawOption = domesticRefusalReasonRaw; - DomesticShopperAdviceOption = domesticShopperAdvice; - OnCreated(); + this.DomesticRefusalReasonRaw = domesticRefusalReasonRaw; + this.DomesticShopperAdvice = domesticShopperAdvice; } - partial void OnCreated(); - - /// - /// Used to track the state of DomesticRefusalReasonRaw - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DomesticRefusalReasonRawOption { get; private set; } - /// /// The reason the transaction was declined, given by the local issuer. Currently available for merchants in Japan. /// /// The reason the transaction was declined, given by the local issuer. Currently available for merchants in Japan. - [JsonPropertyName("domesticRefusalReasonRaw")] - public string DomesticRefusalReasonRaw { get { return this.DomesticRefusalReasonRawOption; } set { this.DomesticRefusalReasonRawOption = new Option(value); } } - - /// - /// Used to track the state of DomesticShopperAdvice - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DomesticShopperAdviceOption { get; private set; } + [DataMember(Name = "domesticRefusalReasonRaw", EmitDefaultValue = false)] + public string DomesticRefusalReasonRaw { get; set; } /// /// The action the shopper should take, in a local language. Currently available in Japanese, for merchants in Japan. /// /// The action the shopper should take, in a local language. Currently available in Japanese, for merchants in Japan. - [JsonPropertyName("domesticShopperAdvice")] - public string DomesticShopperAdvice { get { return this.DomesticShopperAdviceOption; } set { this.DomesticShopperAdviceOption = new Option(value); } } + [DataMember(Name = "domesticShopperAdvice", EmitDefaultValue = false)] + public string DomesticShopperAdvice { get; set; } /// /// Returns the string presentation of the object @@ -86,112 +72,77 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ResponseAdditionalDataDomesticErrorJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ResponseAdditionalDataDomesticError Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option domesticRefusalReasonRaw = default; - Option domesticShopperAdvice = default; + return this.Equals(input as ResponseAdditionalDataDomesticError); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ResponseAdditionalDataDomesticError instances are equal + /// + /// Instance of ResponseAdditionalDataDomesticError to be compared + /// Boolean + public bool Equals(ResponseAdditionalDataDomesticError input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "domesticRefusalReasonRaw": - domesticRefusalReasonRaw = new Option(utf8JsonReader.GetString()); - break; - case "domesticShopperAdvice": - domesticShopperAdvice = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (domesticRefusalReasonRaw.IsSet && domesticRefusalReasonRaw.Value == null) - throw new ArgumentNullException(nameof(domesticRefusalReasonRaw), "Property is not nullable for class ResponseAdditionalDataDomesticError."); - - if (domesticShopperAdvice.IsSet && domesticShopperAdvice.Value == null) - throw new ArgumentNullException(nameof(domesticShopperAdvice), "Property is not nullable for class ResponseAdditionalDataDomesticError."); - - return new ResponseAdditionalDataDomesticError(domesticRefusalReasonRaw, domesticShopperAdvice); + return + ( + this.DomesticRefusalReasonRaw == input.DomesticRefusalReasonRaw || + (this.DomesticRefusalReasonRaw != null && + this.DomesticRefusalReasonRaw.Equals(input.DomesticRefusalReasonRaw)) + ) && + ( + this.DomesticShopperAdvice == input.DomesticShopperAdvice || + (this.DomesticShopperAdvice != null && + this.DomesticShopperAdvice.Equals(input.DomesticShopperAdvice)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataDomesticError responseAdditionalDataDomesticError, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, responseAdditionalDataDomesticError, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.DomesticRefusalReasonRaw != null) + { + hashCode = (hashCode * 59) + this.DomesticRefusalReasonRaw.GetHashCode(); + } + if (this.DomesticShopperAdvice != null) + { + hashCode = (hashCode * 59) + this.DomesticShopperAdvice.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataDomesticError responseAdditionalDataDomesticError, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (responseAdditionalDataDomesticError.DomesticRefusalReasonRawOption.IsSet && responseAdditionalDataDomesticError.DomesticRefusalReasonRaw == null) - throw new ArgumentNullException(nameof(responseAdditionalDataDomesticError.DomesticRefusalReasonRaw), "Property is required for class ResponseAdditionalDataDomesticError."); - - if (responseAdditionalDataDomesticError.DomesticShopperAdviceOption.IsSet && responseAdditionalDataDomesticError.DomesticShopperAdvice == null) - throw new ArgumentNullException(nameof(responseAdditionalDataDomesticError.DomesticShopperAdvice), "Property is required for class ResponseAdditionalDataDomesticError."); - - if (responseAdditionalDataDomesticError.DomesticRefusalReasonRawOption.IsSet) - writer.WriteString("domesticRefusalReasonRaw", responseAdditionalDataDomesticError.DomesticRefusalReasonRaw); - - if (responseAdditionalDataDomesticError.DomesticShopperAdviceOption.IsSet) - writer.WriteString("domesticShopperAdvice", responseAdditionalDataDomesticError.DomesticShopperAdvice); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs b/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs index d4dc61a7f..b2ce6fc11 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,222 +15,137 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataInstallments /// - public partial class ResponseAdditionalDataInstallments : IValidatableObject + [DataContract(Name = "ResponseAdditionalDataInstallments")] + public partial class ResponseAdditionalDataInstallments : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Type of installment. The value of `installmentType` should be **IssuerFinanced**. - /// Annual interest rate. - /// First Installment Amount in minor units. - /// Installment fee amount in minor units. - /// Interest rate for the installment period. - /// Maximum number of installments possible for this payment. - /// Minimum number of installments possible for this payment. - /// Total number of installments possible for this payment. - /// Subsequent Installment Amount in minor units. - /// Total amount in minor units. - /// Possible values: * PayInInstallmentsOnly * PayInFullOnly * PayInFullOrInstallments - /// The number of installments that the payment amount should be charged with. Example: 5 > Only relevant for card payments in countries that support installments. - [JsonConstructor] - public ResponseAdditionalDataInstallments(Option installmentPaymentDataInstallmentType = default, Option installmentPaymentDataOptionItemNrAnnualPercentageRate = default, Option installmentPaymentDataOptionItemNrFirstInstallmentAmount = default, Option installmentPaymentDataOptionItemNrInstallmentFee = default, Option installmentPaymentDataOptionItemNrInterestRate = default, Option installmentPaymentDataOptionItemNrMaximumNumberOfInstallments = default, Option installmentPaymentDataOptionItemNrMinimumNumberOfInstallments = default, Option installmentPaymentDataOptionItemNrNumberOfInstallments = default, Option installmentPaymentDataOptionItemNrSubsequentInstallmentAmount = default, Option installmentPaymentDataOptionItemNrTotalAmountDue = default, Option installmentPaymentDataPaymentOptions = default, Option installmentsValue = default) + /// Type of installment. The value of `installmentType` should be **IssuerFinanced**.. + /// Annual interest rate.. + /// First Installment Amount in minor units.. + /// Installment fee amount in minor units.. + /// Interest rate for the installment period.. + /// Maximum number of installments possible for this payment.. + /// Minimum number of installments possible for this payment.. + /// Total number of installments possible for this payment.. + /// Subsequent Installment Amount in minor units.. + /// Total amount in minor units.. + /// Possible values: * PayInInstallmentsOnly * PayInFullOnly * PayInFullOrInstallments. + /// The number of installments that the payment amount should be charged with. Example: 5 > Only relevant for card payments in countries that support installments.. + public ResponseAdditionalDataInstallments(string installmentPaymentDataInstallmentType = default(string), string installmentPaymentDataOptionItemNrAnnualPercentageRate = default(string), string installmentPaymentDataOptionItemNrFirstInstallmentAmount = default(string), string installmentPaymentDataOptionItemNrInstallmentFee = default(string), string installmentPaymentDataOptionItemNrInterestRate = default(string), string installmentPaymentDataOptionItemNrMaximumNumberOfInstallments = default(string), string installmentPaymentDataOptionItemNrMinimumNumberOfInstallments = default(string), string installmentPaymentDataOptionItemNrNumberOfInstallments = default(string), string installmentPaymentDataOptionItemNrSubsequentInstallmentAmount = default(string), string installmentPaymentDataOptionItemNrTotalAmountDue = default(string), string installmentPaymentDataPaymentOptions = default(string), string installmentsValue = default(string)) { - InstallmentPaymentDataInstallmentTypeOption = installmentPaymentDataInstallmentType; - InstallmentPaymentDataOptionItemNrAnnualPercentageRateOption = installmentPaymentDataOptionItemNrAnnualPercentageRate; - InstallmentPaymentDataOptionItemNrFirstInstallmentAmountOption = installmentPaymentDataOptionItemNrFirstInstallmentAmount; - InstallmentPaymentDataOptionItemNrInstallmentFeeOption = installmentPaymentDataOptionItemNrInstallmentFee; - InstallmentPaymentDataOptionItemNrInterestRateOption = installmentPaymentDataOptionItemNrInterestRate; - InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallmentsOption = installmentPaymentDataOptionItemNrMaximumNumberOfInstallments; - InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallmentsOption = installmentPaymentDataOptionItemNrMinimumNumberOfInstallments; - InstallmentPaymentDataOptionItemNrNumberOfInstallmentsOption = installmentPaymentDataOptionItemNrNumberOfInstallments; - InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmountOption = installmentPaymentDataOptionItemNrSubsequentInstallmentAmount; - InstallmentPaymentDataOptionItemNrTotalAmountDueOption = installmentPaymentDataOptionItemNrTotalAmountDue; - InstallmentPaymentDataPaymentOptionsOption = installmentPaymentDataPaymentOptions; - InstallmentsValueOption = installmentsValue; - OnCreated(); + this.InstallmentPaymentDataInstallmentType = installmentPaymentDataInstallmentType; + this.InstallmentPaymentDataOptionItemNrAnnualPercentageRate = installmentPaymentDataOptionItemNrAnnualPercentageRate; + this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount = installmentPaymentDataOptionItemNrFirstInstallmentAmount; + this.InstallmentPaymentDataOptionItemNrInstallmentFee = installmentPaymentDataOptionItemNrInstallmentFee; + this.InstallmentPaymentDataOptionItemNrInterestRate = installmentPaymentDataOptionItemNrInterestRate; + this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments = installmentPaymentDataOptionItemNrMaximumNumberOfInstallments; + this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments = installmentPaymentDataOptionItemNrMinimumNumberOfInstallments; + this.InstallmentPaymentDataOptionItemNrNumberOfInstallments = installmentPaymentDataOptionItemNrNumberOfInstallments; + this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount = installmentPaymentDataOptionItemNrSubsequentInstallmentAmount; + this.InstallmentPaymentDataOptionItemNrTotalAmountDue = installmentPaymentDataOptionItemNrTotalAmountDue; + this.InstallmentPaymentDataPaymentOptions = installmentPaymentDataPaymentOptions; + this.InstallmentsValue = installmentsValue; } - partial void OnCreated(); - - /// - /// Used to track the state of InstallmentPaymentDataInstallmentType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentPaymentDataInstallmentTypeOption { get; private set; } - /// /// Type of installment. The value of `installmentType` should be **IssuerFinanced**. /// /// Type of installment. The value of `installmentType` should be **IssuerFinanced**. - [JsonPropertyName("installmentPaymentData.installmentType")] - public string InstallmentPaymentDataInstallmentType { get { return this.InstallmentPaymentDataInstallmentTypeOption; } set { this.InstallmentPaymentDataInstallmentTypeOption = new Option(value); } } - - /// - /// Used to track the state of InstallmentPaymentDataOptionItemNrAnnualPercentageRate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentPaymentDataOptionItemNrAnnualPercentageRateOption { get; private set; } + [DataMember(Name = "installmentPaymentData.installmentType", EmitDefaultValue = false)] + public string InstallmentPaymentDataInstallmentType { get; set; } /// /// Annual interest rate. /// /// Annual interest rate. - [JsonPropertyName("installmentPaymentData.option[itemNr].annualPercentageRate")] - public string InstallmentPaymentDataOptionItemNrAnnualPercentageRate { get { return this.InstallmentPaymentDataOptionItemNrAnnualPercentageRateOption; } set { this.InstallmentPaymentDataOptionItemNrAnnualPercentageRateOption = new Option(value); } } - - /// - /// Used to track the state of InstallmentPaymentDataOptionItemNrFirstInstallmentAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentPaymentDataOptionItemNrFirstInstallmentAmountOption { get; private set; } + [DataMember(Name = "installmentPaymentData.option[itemNr].annualPercentageRate", EmitDefaultValue = false)] + public string InstallmentPaymentDataOptionItemNrAnnualPercentageRate { get; set; } /// /// First Installment Amount in minor units. /// /// First Installment Amount in minor units. - [JsonPropertyName("installmentPaymentData.option[itemNr].firstInstallmentAmount")] - public string InstallmentPaymentDataOptionItemNrFirstInstallmentAmount { get { return this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmountOption; } set { this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmountOption = new Option(value); } } - - /// - /// Used to track the state of InstallmentPaymentDataOptionItemNrInstallmentFee - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentPaymentDataOptionItemNrInstallmentFeeOption { get; private set; } + [DataMember(Name = "installmentPaymentData.option[itemNr].firstInstallmentAmount", EmitDefaultValue = false)] + public string InstallmentPaymentDataOptionItemNrFirstInstallmentAmount { get; set; } /// /// Installment fee amount in minor units. /// /// Installment fee amount in minor units. - [JsonPropertyName("installmentPaymentData.option[itemNr].installmentFee")] - public string InstallmentPaymentDataOptionItemNrInstallmentFee { get { return this.InstallmentPaymentDataOptionItemNrInstallmentFeeOption; } set { this.InstallmentPaymentDataOptionItemNrInstallmentFeeOption = new Option(value); } } - - /// - /// Used to track the state of InstallmentPaymentDataOptionItemNrInterestRate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentPaymentDataOptionItemNrInterestRateOption { get; private set; } + [DataMember(Name = "installmentPaymentData.option[itemNr].installmentFee", EmitDefaultValue = false)] + public string InstallmentPaymentDataOptionItemNrInstallmentFee { get; set; } /// /// Interest rate for the installment period. /// /// Interest rate for the installment period. - [JsonPropertyName("installmentPaymentData.option[itemNr].interestRate")] - public string InstallmentPaymentDataOptionItemNrInterestRate { get { return this.InstallmentPaymentDataOptionItemNrInterestRateOption; } set { this.InstallmentPaymentDataOptionItemNrInterestRateOption = new Option(value); } } - - /// - /// Used to track the state of InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallmentsOption { get; private set; } + [DataMember(Name = "installmentPaymentData.option[itemNr].interestRate", EmitDefaultValue = false)] + public string InstallmentPaymentDataOptionItemNrInterestRate { get; set; } /// /// Maximum number of installments possible for this payment. /// /// Maximum number of installments possible for this payment. - [JsonPropertyName("installmentPaymentData.option[itemNr].maximumNumberOfInstallments")] - public string InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments { get { return this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallmentsOption; } set { this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallmentsOption = new Option(value); } } - - /// - /// Used to track the state of InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallmentsOption { get; private set; } + [DataMember(Name = "installmentPaymentData.option[itemNr].maximumNumberOfInstallments", EmitDefaultValue = false)] + public string InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments { get; set; } /// /// Minimum number of installments possible for this payment. /// /// Minimum number of installments possible for this payment. - [JsonPropertyName("installmentPaymentData.option[itemNr].minimumNumberOfInstallments")] - public string InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments { get { return this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallmentsOption; } set { this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallmentsOption = new Option(value); } } - - /// - /// Used to track the state of InstallmentPaymentDataOptionItemNrNumberOfInstallments - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentPaymentDataOptionItemNrNumberOfInstallmentsOption { get; private set; } + [DataMember(Name = "installmentPaymentData.option[itemNr].minimumNumberOfInstallments", EmitDefaultValue = false)] + public string InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments { get; set; } /// /// Total number of installments possible for this payment. /// /// Total number of installments possible for this payment. - [JsonPropertyName("installmentPaymentData.option[itemNr].numberOfInstallments")] - public string InstallmentPaymentDataOptionItemNrNumberOfInstallments { get { return this.InstallmentPaymentDataOptionItemNrNumberOfInstallmentsOption; } set { this.InstallmentPaymentDataOptionItemNrNumberOfInstallmentsOption = new Option(value); } } - - /// - /// Used to track the state of InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmountOption { get; private set; } + [DataMember(Name = "installmentPaymentData.option[itemNr].numberOfInstallments", EmitDefaultValue = false)] + public string InstallmentPaymentDataOptionItemNrNumberOfInstallments { get; set; } /// /// Subsequent Installment Amount in minor units. /// /// Subsequent Installment Amount in minor units. - [JsonPropertyName("installmentPaymentData.option[itemNr].subsequentInstallmentAmount")] - public string InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount { get { return this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmountOption; } set { this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmountOption = new Option(value); } } - - /// - /// Used to track the state of InstallmentPaymentDataOptionItemNrTotalAmountDue - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentPaymentDataOptionItemNrTotalAmountDueOption { get; private set; } + [DataMember(Name = "installmentPaymentData.option[itemNr].subsequentInstallmentAmount", EmitDefaultValue = false)] + public string InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount { get; set; } /// /// Total amount in minor units. /// /// Total amount in minor units. - [JsonPropertyName("installmentPaymentData.option[itemNr].totalAmountDue")] - public string InstallmentPaymentDataOptionItemNrTotalAmountDue { get { return this.InstallmentPaymentDataOptionItemNrTotalAmountDueOption; } set { this.InstallmentPaymentDataOptionItemNrTotalAmountDueOption = new Option(value); } } - - /// - /// Used to track the state of InstallmentPaymentDataPaymentOptions - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentPaymentDataPaymentOptionsOption { get; private set; } + [DataMember(Name = "installmentPaymentData.option[itemNr].totalAmountDue", EmitDefaultValue = false)] + public string InstallmentPaymentDataOptionItemNrTotalAmountDue { get; set; } /// /// Possible values: * PayInInstallmentsOnly * PayInFullOnly * PayInFullOrInstallments /// /// Possible values: * PayInInstallmentsOnly * PayInFullOnly * PayInFullOrInstallments - [JsonPropertyName("installmentPaymentData.paymentOptions")] - public string InstallmentPaymentDataPaymentOptions { get { return this.InstallmentPaymentDataPaymentOptionsOption; } set { this.InstallmentPaymentDataPaymentOptionsOption = new Option(value); } } - - /// - /// Used to track the state of InstallmentsValue - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option InstallmentsValueOption { get; private set; } + [DataMember(Name = "installmentPaymentData.paymentOptions", EmitDefaultValue = false)] + public string InstallmentPaymentDataPaymentOptions { get; set; } /// /// The number of installments that the payment amount should be charged with. Example: 5 > Only relevant for card payments in countries that support installments. /// /// The number of installments that the payment amount should be charged with. Example: 5 > Only relevant for card payments in countries that support installments. - [JsonPropertyName("installments.value")] - public string InstallmentsValue { get { return this.InstallmentsValueOption; } set { this.InstallmentsValueOption = new Option(value); } } + [DataMember(Name = "installments.value", EmitDefaultValue = false)] + public string InstallmentsValue { get; set; } /// /// Returns the string presentation of the object @@ -256,242 +172,167 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ResponseAdditionalDataInstallmentsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ResponseAdditionalDataInstallments Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option installmentPaymentDataInstallmentType = default; - Option installmentPaymentDataOptionItemNrAnnualPercentageRate = default; - Option installmentPaymentDataOptionItemNrFirstInstallmentAmount = default; - Option installmentPaymentDataOptionItemNrInstallmentFee = default; - Option installmentPaymentDataOptionItemNrInterestRate = default; - Option installmentPaymentDataOptionItemNrMaximumNumberOfInstallments = default; - Option installmentPaymentDataOptionItemNrMinimumNumberOfInstallments = default; - Option installmentPaymentDataOptionItemNrNumberOfInstallments = default; - Option installmentPaymentDataOptionItemNrSubsequentInstallmentAmount = default; - Option installmentPaymentDataOptionItemNrTotalAmountDue = default; - Option installmentPaymentDataPaymentOptions = default; - Option installmentsValue = default; + return this.Equals(input as ResponseAdditionalDataInstallments); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ResponseAdditionalDataInstallments instances are equal + /// + /// Instance of ResponseAdditionalDataInstallments to be compared + /// Boolean + public bool Equals(ResponseAdditionalDataInstallments input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "installmentPaymentData.installmentType": - installmentPaymentDataInstallmentType = new Option(utf8JsonReader.GetString()); - break; - case "installmentPaymentData.option[itemNr].annualPercentageRate": - installmentPaymentDataOptionItemNrAnnualPercentageRate = new Option(utf8JsonReader.GetString()); - break; - case "installmentPaymentData.option[itemNr].firstInstallmentAmount": - installmentPaymentDataOptionItemNrFirstInstallmentAmount = new Option(utf8JsonReader.GetString()); - break; - case "installmentPaymentData.option[itemNr].installmentFee": - installmentPaymentDataOptionItemNrInstallmentFee = new Option(utf8JsonReader.GetString()); - break; - case "installmentPaymentData.option[itemNr].interestRate": - installmentPaymentDataOptionItemNrInterestRate = new Option(utf8JsonReader.GetString()); - break; - case "installmentPaymentData.option[itemNr].maximumNumberOfInstallments": - installmentPaymentDataOptionItemNrMaximumNumberOfInstallments = new Option(utf8JsonReader.GetString()); - break; - case "installmentPaymentData.option[itemNr].minimumNumberOfInstallments": - installmentPaymentDataOptionItemNrMinimumNumberOfInstallments = new Option(utf8JsonReader.GetString()); - break; - case "installmentPaymentData.option[itemNr].numberOfInstallments": - installmentPaymentDataOptionItemNrNumberOfInstallments = new Option(utf8JsonReader.GetString()); - break; - case "installmentPaymentData.option[itemNr].subsequentInstallmentAmount": - installmentPaymentDataOptionItemNrSubsequentInstallmentAmount = new Option(utf8JsonReader.GetString()); - break; - case "installmentPaymentData.option[itemNr].totalAmountDue": - installmentPaymentDataOptionItemNrTotalAmountDue = new Option(utf8JsonReader.GetString()); - break; - case "installmentPaymentData.paymentOptions": - installmentPaymentDataPaymentOptions = new Option(utf8JsonReader.GetString()); - break; - case "installments.value": - installmentsValue = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (installmentPaymentDataInstallmentType.IsSet && installmentPaymentDataInstallmentType.Value == null) - throw new ArgumentNullException(nameof(installmentPaymentDataInstallmentType), "Property is not nullable for class ResponseAdditionalDataInstallments."); - - if (installmentPaymentDataOptionItemNrAnnualPercentageRate.IsSet && installmentPaymentDataOptionItemNrAnnualPercentageRate.Value == null) - throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrAnnualPercentageRate), "Property is not nullable for class ResponseAdditionalDataInstallments."); - - if (installmentPaymentDataOptionItemNrFirstInstallmentAmount.IsSet && installmentPaymentDataOptionItemNrFirstInstallmentAmount.Value == null) - throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrFirstInstallmentAmount), "Property is not nullable for class ResponseAdditionalDataInstallments."); - - if (installmentPaymentDataOptionItemNrInstallmentFee.IsSet && installmentPaymentDataOptionItemNrInstallmentFee.Value == null) - throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrInstallmentFee), "Property is not nullable for class ResponseAdditionalDataInstallments."); - - if (installmentPaymentDataOptionItemNrInterestRate.IsSet && installmentPaymentDataOptionItemNrInterestRate.Value == null) - throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrInterestRate), "Property is not nullable for class ResponseAdditionalDataInstallments."); - - if (installmentPaymentDataOptionItemNrMaximumNumberOfInstallments.IsSet && installmentPaymentDataOptionItemNrMaximumNumberOfInstallments.Value == null) - throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrMaximumNumberOfInstallments), "Property is not nullable for class ResponseAdditionalDataInstallments."); - - if (installmentPaymentDataOptionItemNrMinimumNumberOfInstallments.IsSet && installmentPaymentDataOptionItemNrMinimumNumberOfInstallments.Value == null) - throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrMinimumNumberOfInstallments), "Property is not nullable for class ResponseAdditionalDataInstallments."); - - if (installmentPaymentDataOptionItemNrNumberOfInstallments.IsSet && installmentPaymentDataOptionItemNrNumberOfInstallments.Value == null) - throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrNumberOfInstallments), "Property is not nullable for class ResponseAdditionalDataInstallments."); - - if (installmentPaymentDataOptionItemNrSubsequentInstallmentAmount.IsSet && installmentPaymentDataOptionItemNrSubsequentInstallmentAmount.Value == null) - throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrSubsequentInstallmentAmount), "Property is not nullable for class ResponseAdditionalDataInstallments."); - - if (installmentPaymentDataOptionItemNrTotalAmountDue.IsSet && installmentPaymentDataOptionItemNrTotalAmountDue.Value == null) - throw new ArgumentNullException(nameof(installmentPaymentDataOptionItemNrTotalAmountDue), "Property is not nullable for class ResponseAdditionalDataInstallments."); - - if (installmentPaymentDataPaymentOptions.IsSet && installmentPaymentDataPaymentOptions.Value == null) - throw new ArgumentNullException(nameof(installmentPaymentDataPaymentOptions), "Property is not nullable for class ResponseAdditionalDataInstallments."); - - if (installmentsValue.IsSet && installmentsValue.Value == null) - throw new ArgumentNullException(nameof(installmentsValue), "Property is not nullable for class ResponseAdditionalDataInstallments."); - - return new ResponseAdditionalDataInstallments(installmentPaymentDataInstallmentType, installmentPaymentDataOptionItemNrAnnualPercentageRate, installmentPaymentDataOptionItemNrFirstInstallmentAmount, installmentPaymentDataOptionItemNrInstallmentFee, installmentPaymentDataOptionItemNrInterestRate, installmentPaymentDataOptionItemNrMaximumNumberOfInstallments, installmentPaymentDataOptionItemNrMinimumNumberOfInstallments, installmentPaymentDataOptionItemNrNumberOfInstallments, installmentPaymentDataOptionItemNrSubsequentInstallmentAmount, installmentPaymentDataOptionItemNrTotalAmountDue, installmentPaymentDataPaymentOptions, installmentsValue); + return + ( + this.InstallmentPaymentDataInstallmentType == input.InstallmentPaymentDataInstallmentType || + (this.InstallmentPaymentDataInstallmentType != null && + this.InstallmentPaymentDataInstallmentType.Equals(input.InstallmentPaymentDataInstallmentType)) + ) && + ( + this.InstallmentPaymentDataOptionItemNrAnnualPercentageRate == input.InstallmentPaymentDataOptionItemNrAnnualPercentageRate || + (this.InstallmentPaymentDataOptionItemNrAnnualPercentageRate != null && + this.InstallmentPaymentDataOptionItemNrAnnualPercentageRate.Equals(input.InstallmentPaymentDataOptionItemNrAnnualPercentageRate)) + ) && + ( + this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount == input.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount || + (this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount != null && + this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount.Equals(input.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount)) + ) && + ( + this.InstallmentPaymentDataOptionItemNrInstallmentFee == input.InstallmentPaymentDataOptionItemNrInstallmentFee || + (this.InstallmentPaymentDataOptionItemNrInstallmentFee != null && + this.InstallmentPaymentDataOptionItemNrInstallmentFee.Equals(input.InstallmentPaymentDataOptionItemNrInstallmentFee)) + ) && + ( + this.InstallmentPaymentDataOptionItemNrInterestRate == input.InstallmentPaymentDataOptionItemNrInterestRate || + (this.InstallmentPaymentDataOptionItemNrInterestRate != null && + this.InstallmentPaymentDataOptionItemNrInterestRate.Equals(input.InstallmentPaymentDataOptionItemNrInterestRate)) + ) && + ( + this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments == input.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments || + (this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments != null && + this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments.Equals(input.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments)) + ) && + ( + this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments == input.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments || + (this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments != null && + this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments.Equals(input.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments)) + ) && + ( + this.InstallmentPaymentDataOptionItemNrNumberOfInstallments == input.InstallmentPaymentDataOptionItemNrNumberOfInstallments || + (this.InstallmentPaymentDataOptionItemNrNumberOfInstallments != null && + this.InstallmentPaymentDataOptionItemNrNumberOfInstallments.Equals(input.InstallmentPaymentDataOptionItemNrNumberOfInstallments)) + ) && + ( + this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount == input.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount || + (this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount != null && + this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount.Equals(input.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount)) + ) && + ( + this.InstallmentPaymentDataOptionItemNrTotalAmountDue == input.InstallmentPaymentDataOptionItemNrTotalAmountDue || + (this.InstallmentPaymentDataOptionItemNrTotalAmountDue != null && + this.InstallmentPaymentDataOptionItemNrTotalAmountDue.Equals(input.InstallmentPaymentDataOptionItemNrTotalAmountDue)) + ) && + ( + this.InstallmentPaymentDataPaymentOptions == input.InstallmentPaymentDataPaymentOptions || + (this.InstallmentPaymentDataPaymentOptions != null && + this.InstallmentPaymentDataPaymentOptions.Equals(input.InstallmentPaymentDataPaymentOptions)) + ) && + ( + this.InstallmentsValue == input.InstallmentsValue || + (this.InstallmentsValue != null && + this.InstallmentsValue.Equals(input.InstallmentsValue)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataInstallments responseAdditionalDataInstallments, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, responseAdditionalDataInstallments, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.InstallmentPaymentDataInstallmentType != null) + { + hashCode = (hashCode * 59) + this.InstallmentPaymentDataInstallmentType.GetHashCode(); + } + if (this.InstallmentPaymentDataOptionItemNrAnnualPercentageRate != null) + { + hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrAnnualPercentageRate.GetHashCode(); + } + if (this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount != null) + { + hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount.GetHashCode(); + } + if (this.InstallmentPaymentDataOptionItemNrInstallmentFee != null) + { + hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrInstallmentFee.GetHashCode(); + } + if (this.InstallmentPaymentDataOptionItemNrInterestRate != null) + { + hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrInterestRate.GetHashCode(); + } + if (this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments != null) + { + hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments.GetHashCode(); + } + if (this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments != null) + { + hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments.GetHashCode(); + } + if (this.InstallmentPaymentDataOptionItemNrNumberOfInstallments != null) + { + hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrNumberOfInstallments.GetHashCode(); + } + if (this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount != null) + { + hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount.GetHashCode(); + } + if (this.InstallmentPaymentDataOptionItemNrTotalAmountDue != null) + { + hashCode = (hashCode * 59) + this.InstallmentPaymentDataOptionItemNrTotalAmountDue.GetHashCode(); + } + if (this.InstallmentPaymentDataPaymentOptions != null) + { + hashCode = (hashCode * 59) + this.InstallmentPaymentDataPaymentOptions.GetHashCode(); + } + if (this.InstallmentsValue != null) + { + hashCode = (hashCode * 59) + this.InstallmentsValue.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataInstallments responseAdditionalDataInstallments, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (responseAdditionalDataInstallments.InstallmentPaymentDataInstallmentTypeOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataInstallmentType == null) - throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataInstallmentType), "Property is required for class ResponseAdditionalDataInstallments."); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrAnnualPercentageRateOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrAnnualPercentageRate == null) - throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrAnnualPercentageRate), "Property is required for class ResponseAdditionalDataInstallments."); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrFirstInstallmentAmountOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount == null) - throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount), "Property is required for class ResponseAdditionalDataInstallments."); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInstallmentFeeOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInstallmentFee == null) - throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInstallmentFee), "Property is required for class ResponseAdditionalDataInstallments."); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInterestRateOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInterestRate == null) - throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInterestRate), "Property is required for class ResponseAdditionalDataInstallments."); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallmentsOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments == null) - throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments), "Property is required for class ResponseAdditionalDataInstallments."); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallmentsOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments == null) - throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments), "Property is required for class ResponseAdditionalDataInstallments."); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrNumberOfInstallmentsOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrNumberOfInstallments == null) - throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrNumberOfInstallments), "Property is required for class ResponseAdditionalDataInstallments."); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmountOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount == null) - throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount), "Property is required for class ResponseAdditionalDataInstallments."); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrTotalAmountDueOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrTotalAmountDue == null) - throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrTotalAmountDue), "Property is required for class ResponseAdditionalDataInstallments."); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataPaymentOptionsOption.IsSet && responseAdditionalDataInstallments.InstallmentPaymentDataPaymentOptions == null) - throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentPaymentDataPaymentOptions), "Property is required for class ResponseAdditionalDataInstallments."); - - if (responseAdditionalDataInstallments.InstallmentsValueOption.IsSet && responseAdditionalDataInstallments.InstallmentsValue == null) - throw new ArgumentNullException(nameof(responseAdditionalDataInstallments.InstallmentsValue), "Property is required for class ResponseAdditionalDataInstallments."); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataInstallmentTypeOption.IsSet) - writer.WriteString("installmentPaymentData.installmentType", responseAdditionalDataInstallments.InstallmentPaymentDataInstallmentType); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrAnnualPercentageRateOption.IsSet) - writer.WriteString("installmentPaymentData.option[itemNr].annualPercentageRate", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrAnnualPercentageRate); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrFirstInstallmentAmountOption.IsSet) - writer.WriteString("installmentPaymentData.option[itemNr].firstInstallmentAmount", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrFirstInstallmentAmount); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInstallmentFeeOption.IsSet) - writer.WriteString("installmentPaymentData.option[itemNr].installmentFee", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInstallmentFee); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInterestRateOption.IsSet) - writer.WriteString("installmentPaymentData.option[itemNr].interestRate", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrInterestRate); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallmentsOption.IsSet) - writer.WriteString("installmentPaymentData.option[itemNr].maximumNumberOfInstallments", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallmentsOption.IsSet) - writer.WriteString("installmentPaymentData.option[itemNr].minimumNumberOfInstallments", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrNumberOfInstallmentsOption.IsSet) - writer.WriteString("installmentPaymentData.option[itemNr].numberOfInstallments", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrNumberOfInstallments); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmountOption.IsSet) - writer.WriteString("installmentPaymentData.option[itemNr].subsequentInstallmentAmount", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrTotalAmountDueOption.IsSet) - writer.WriteString("installmentPaymentData.option[itemNr].totalAmountDue", responseAdditionalDataInstallments.InstallmentPaymentDataOptionItemNrTotalAmountDue); - - if (responseAdditionalDataInstallments.InstallmentPaymentDataPaymentOptionsOption.IsSet) - writer.WriteString("installmentPaymentData.paymentOptions", responseAdditionalDataInstallments.InstallmentPaymentDataPaymentOptions); - - if (responseAdditionalDataInstallments.InstallmentsValueOption.IsSet) - writer.WriteString("installments.value", responseAdditionalDataInstallments.InstallmentsValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs b/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs index 6ec70e728..e97413b9f 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,78 +15,56 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataNetworkTokens /// - public partial class ResponseAdditionalDataNetworkTokens : IValidatableObject + [DataContract(Name = "ResponseAdditionalDataNetworkTokens")] + public partial class ResponseAdditionalDataNetworkTokens : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Indicates whether a network token is available for the specified card. - /// The Bank Identification Number of a tokenized card, which is the first six digits of a card number. - /// The last four digits of a network token. - [JsonConstructor] - public ResponseAdditionalDataNetworkTokens(Option networkTokenAvailable = default, Option networkTokenBin = default, Option networkTokenTokenSummary = default) + /// Indicates whether a network token is available for the specified card.. + /// The Bank Identification Number of a tokenized card, which is the first six digits of a card number.. + /// The last four digits of a network token.. + public ResponseAdditionalDataNetworkTokens(string networkTokenAvailable = default(string), string networkTokenBin = default(string), string networkTokenTokenSummary = default(string)) { - NetworkTokenAvailableOption = networkTokenAvailable; - NetworkTokenBinOption = networkTokenBin; - NetworkTokenTokenSummaryOption = networkTokenTokenSummary; - OnCreated(); + this.NetworkTokenAvailable = networkTokenAvailable; + this.NetworkTokenBin = networkTokenBin; + this.NetworkTokenTokenSummary = networkTokenTokenSummary; } - partial void OnCreated(); - - /// - /// Used to track the state of NetworkTokenAvailable - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NetworkTokenAvailableOption { get; private set; } - /// /// Indicates whether a network token is available for the specified card. /// /// Indicates whether a network token is available for the specified card. - [JsonPropertyName("networkToken.available")] - public string NetworkTokenAvailable { get { return this.NetworkTokenAvailableOption; } set { this.NetworkTokenAvailableOption = new Option(value); } } - - /// - /// Used to track the state of NetworkTokenBin - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NetworkTokenBinOption { get; private set; } + [DataMember(Name = "networkToken.available", EmitDefaultValue = false)] + public string NetworkTokenAvailable { get; set; } /// /// The Bank Identification Number of a tokenized card, which is the first six digits of a card number. /// /// The Bank Identification Number of a tokenized card, which is the first six digits of a card number. - [JsonPropertyName("networkToken.bin")] - public string NetworkTokenBin { get { return this.NetworkTokenBinOption; } set { this.NetworkTokenBinOption = new Option(value); } } - - /// - /// Used to track the state of NetworkTokenTokenSummary - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NetworkTokenTokenSummaryOption { get; private set; } + [DataMember(Name = "networkToken.bin", EmitDefaultValue = false)] + public string NetworkTokenBin { get; set; } /// /// The last four digits of a network token. /// /// The last four digits of a network token. - [JsonPropertyName("networkToken.tokenSummary")] - public string NetworkTokenTokenSummary { get { return this.NetworkTokenTokenSummaryOption; } set { this.NetworkTokenTokenSummaryOption = new Option(value); } } + [DataMember(Name = "networkToken.tokenSummary", EmitDefaultValue = false)] + public string NetworkTokenTokenSummary { get; set; } /// /// Returns the string presentation of the object @@ -103,125 +82,86 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ResponseAdditionalDataNetworkTokensJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ResponseAdditionalDataNetworkTokens Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option networkTokenAvailable = default; - Option networkTokenBin = default; - Option networkTokenTokenSummary = default; + return this.Equals(input as ResponseAdditionalDataNetworkTokens); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ResponseAdditionalDataNetworkTokens instances are equal + /// + /// Instance of ResponseAdditionalDataNetworkTokens to be compared + /// Boolean + public bool Equals(ResponseAdditionalDataNetworkTokens input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "networkToken.available": - networkTokenAvailable = new Option(utf8JsonReader.GetString()); - break; - case "networkToken.bin": - networkTokenBin = new Option(utf8JsonReader.GetString()); - break; - case "networkToken.tokenSummary": - networkTokenTokenSummary = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (networkTokenAvailable.IsSet && networkTokenAvailable.Value == null) - throw new ArgumentNullException(nameof(networkTokenAvailable), "Property is not nullable for class ResponseAdditionalDataNetworkTokens."); - - if (networkTokenBin.IsSet && networkTokenBin.Value == null) - throw new ArgumentNullException(nameof(networkTokenBin), "Property is not nullable for class ResponseAdditionalDataNetworkTokens."); - - if (networkTokenTokenSummary.IsSet && networkTokenTokenSummary.Value == null) - throw new ArgumentNullException(nameof(networkTokenTokenSummary), "Property is not nullable for class ResponseAdditionalDataNetworkTokens."); - - return new ResponseAdditionalDataNetworkTokens(networkTokenAvailable, networkTokenBin, networkTokenTokenSummary); + return + ( + this.NetworkTokenAvailable == input.NetworkTokenAvailable || + (this.NetworkTokenAvailable != null && + this.NetworkTokenAvailable.Equals(input.NetworkTokenAvailable)) + ) && + ( + this.NetworkTokenBin == input.NetworkTokenBin || + (this.NetworkTokenBin != null && + this.NetworkTokenBin.Equals(input.NetworkTokenBin)) + ) && + ( + this.NetworkTokenTokenSummary == input.NetworkTokenTokenSummary || + (this.NetworkTokenTokenSummary != null && + this.NetworkTokenTokenSummary.Equals(input.NetworkTokenTokenSummary)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataNetworkTokens responseAdditionalDataNetworkTokens, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, responseAdditionalDataNetworkTokens, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.NetworkTokenAvailable != null) + { + hashCode = (hashCode * 59) + this.NetworkTokenAvailable.GetHashCode(); + } + if (this.NetworkTokenBin != null) + { + hashCode = (hashCode * 59) + this.NetworkTokenBin.GetHashCode(); + } + if (this.NetworkTokenTokenSummary != null) + { + hashCode = (hashCode * 59) + this.NetworkTokenTokenSummary.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataNetworkTokens responseAdditionalDataNetworkTokens, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (responseAdditionalDataNetworkTokens.NetworkTokenAvailableOption.IsSet && responseAdditionalDataNetworkTokens.NetworkTokenAvailable == null) - throw new ArgumentNullException(nameof(responseAdditionalDataNetworkTokens.NetworkTokenAvailable), "Property is required for class ResponseAdditionalDataNetworkTokens."); - - if (responseAdditionalDataNetworkTokens.NetworkTokenBinOption.IsSet && responseAdditionalDataNetworkTokens.NetworkTokenBin == null) - throw new ArgumentNullException(nameof(responseAdditionalDataNetworkTokens.NetworkTokenBin), "Property is required for class ResponseAdditionalDataNetworkTokens."); - - if (responseAdditionalDataNetworkTokens.NetworkTokenTokenSummaryOption.IsSet && responseAdditionalDataNetworkTokens.NetworkTokenTokenSummary == null) - throw new ArgumentNullException(nameof(responseAdditionalDataNetworkTokens.NetworkTokenTokenSummary), "Property is required for class ResponseAdditionalDataNetworkTokens."); - - if (responseAdditionalDataNetworkTokens.NetworkTokenAvailableOption.IsSet) - writer.WriteString("networkToken.available", responseAdditionalDataNetworkTokens.NetworkTokenAvailable); - - if (responseAdditionalDataNetworkTokens.NetworkTokenBinOption.IsSet) - writer.WriteString("networkToken.bin", responseAdditionalDataNetworkTokens.NetworkTokenBin); - - if (responseAdditionalDataNetworkTokens.NetworkTokenTokenSummaryOption.IsSet) - writer.WriteString("networkToken.tokenSummary", responseAdditionalDataNetworkTokens.NetworkTokenTokenSummary); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs b/Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs index 88d130844..9fd739dcf 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,46 +15,38 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataOpi /// - public partial class ResponseAdditionalDataOpi : IValidatableObject + [DataContract(Name = "ResponseAdditionalDataOpi")] + public partial class ResponseAdditionalDataOpi : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Returned in the response if you included `opi.includeTransToken: true` in an ecommerce payment request. This contains an Oracle Payment Interface token that you can store in your Oracle Opera database to identify tokenized ecommerce transactions. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). - [JsonConstructor] - public ResponseAdditionalDataOpi(Option opiTransToken = default) + /// Returned in the response if you included `opi.includeTransToken: true` in an ecommerce payment request. This contains an Oracle Payment Interface token that you can store in your Oracle Opera database to identify tokenized ecommerce transactions. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce).. + public ResponseAdditionalDataOpi(string opiTransToken = default(string)) { - OpiTransTokenOption = opiTransToken; - OnCreated(); + this.OpiTransToken = opiTransToken; } - partial void OnCreated(); - - /// - /// Used to track the state of OpiTransToken - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpiTransTokenOption { get; private set; } - /// /// Returned in the response if you included `opi.includeTransToken: true` in an ecommerce payment request. This contains an Oracle Payment Interface token that you can store in your Oracle Opera database to identify tokenized ecommerce transactions. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). /// /// Returned in the response if you included `opi.includeTransToken: true` in an ecommerce payment request. This contains an Oracle Payment Interface token that you can store in your Oracle Opera database to identify tokenized ecommerce transactions. For more information and required settings, see [Oracle Opera](https://docs.adyen.com/plugins/oracle-opera#opi-token-ecommerce). - [JsonPropertyName("opi.transToken")] - public string OpiTransToken { get { return this.OpiTransTokenOption; } set { this.OpiTransTokenOption = new Option(value); } } + [DataMember(Name = "opi.transToken", EmitDefaultValue = false)] + public string OpiTransToken { get; set; } /// /// Returns the string presentation of the object @@ -69,99 +62,68 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ResponseAdditionalDataOpiJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ResponseAdditionalDataOpi Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option opiTransToken = default; + return this.Equals(input as ResponseAdditionalDataOpi); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ResponseAdditionalDataOpi instances are equal + /// + /// Instance of ResponseAdditionalDataOpi to be compared + /// Boolean + public bool Equals(ResponseAdditionalDataOpi input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "opi.transToken": - opiTransToken = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (opiTransToken.IsSet && opiTransToken.Value == null) - throw new ArgumentNullException(nameof(opiTransToken), "Property is not nullable for class ResponseAdditionalDataOpi."); - - return new ResponseAdditionalDataOpi(opiTransToken); + return + ( + this.OpiTransToken == input.OpiTransToken || + (this.OpiTransToken != null && + this.OpiTransToken.Equals(input.OpiTransToken)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataOpi responseAdditionalDataOpi, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, responseAdditionalDataOpi, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.OpiTransToken != null) + { + hashCode = (hashCode * 59) + this.OpiTransToken.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataOpi responseAdditionalDataOpi, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (responseAdditionalDataOpi.OpiTransTokenOption.IsSet && responseAdditionalDataOpi.OpiTransToken == null) - throw new ArgumentNullException(nameof(responseAdditionalDataOpi.OpiTransToken), "Property is required for class ResponseAdditionalDataOpi."); - - if (responseAdditionalDataOpi.OpiTransTokenOption.IsSet) - writer.WriteString("opi.transToken", responseAdditionalDataOpi.OpiTransToken); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs b/Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs index 9f0f49c21..5144c6cef 100644 --- a/Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs +++ b/Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,78 +15,56 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ResponseAdditionalDataSepa /// - public partial class ResponseAdditionalDataSepa : IValidatableObject + [DataContract(Name = "ResponseAdditionalDataSepa")] + public partial class ResponseAdditionalDataSepa : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The transaction signature date. Format: yyyy-MM-dd - /// Its value corresponds to the pspReference value of the transaction. - /// This field can take one of the following values: * OneOff: (OOFF) Direct debit instruction to initiate exactly one direct debit transaction. * First: (FRST) Initial/first collection in a series of direct debit instructions. * Recurring: (RCUR) Direct debit instruction to carry out regular direct debit transactions initiated by the creditor. * Final: (FNAL) Last/final collection in a series of direct debit instructions. Example: OOFF - [JsonConstructor] - public ResponseAdditionalDataSepa(Option sepadirectdebitDateOfSignature = default, Option sepadirectdebitMandateId = default, Option sepadirectdebitSequenceType = default) + /// The transaction signature date. Format: yyyy-MM-dd. + /// Its value corresponds to the pspReference value of the transaction.. + /// This field can take one of the following values: * OneOff: (OOFF) Direct debit instruction to initiate exactly one direct debit transaction. * First: (FRST) Initial/first collection in a series of direct debit instructions. * Recurring: (RCUR) Direct debit instruction to carry out regular direct debit transactions initiated by the creditor. * Final: (FNAL) Last/final collection in a series of direct debit instructions. Example: OOFF. + public ResponseAdditionalDataSepa(string sepadirectdebitDateOfSignature = default(string), string sepadirectdebitMandateId = default(string), string sepadirectdebitSequenceType = default(string)) { - SepadirectdebitDateOfSignatureOption = sepadirectdebitDateOfSignature; - SepadirectdebitMandateIdOption = sepadirectdebitMandateId; - SepadirectdebitSequenceTypeOption = sepadirectdebitSequenceType; - OnCreated(); + this.SepadirectdebitDateOfSignature = sepadirectdebitDateOfSignature; + this.SepadirectdebitMandateId = sepadirectdebitMandateId; + this.SepadirectdebitSequenceType = sepadirectdebitSequenceType; } - partial void OnCreated(); - - /// - /// Used to track the state of SepadirectdebitDateOfSignature - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SepadirectdebitDateOfSignatureOption { get; private set; } - /// /// The transaction signature date. Format: yyyy-MM-dd /// /// The transaction signature date. Format: yyyy-MM-dd - [JsonPropertyName("sepadirectdebit.dateOfSignature")] - public string SepadirectdebitDateOfSignature { get { return this.SepadirectdebitDateOfSignatureOption; } set { this.SepadirectdebitDateOfSignatureOption = new Option(value); } } - - /// - /// Used to track the state of SepadirectdebitMandateId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SepadirectdebitMandateIdOption { get; private set; } + [DataMember(Name = "sepadirectdebit.dateOfSignature", EmitDefaultValue = false)] + public string SepadirectdebitDateOfSignature { get; set; } /// /// Its value corresponds to the pspReference value of the transaction. /// /// Its value corresponds to the pspReference value of the transaction. - [JsonPropertyName("sepadirectdebit.mandateId")] - public string SepadirectdebitMandateId { get { return this.SepadirectdebitMandateIdOption; } set { this.SepadirectdebitMandateIdOption = new Option(value); } } - - /// - /// Used to track the state of SepadirectdebitSequenceType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SepadirectdebitSequenceTypeOption { get; private set; } + [DataMember(Name = "sepadirectdebit.mandateId", EmitDefaultValue = false)] + public string SepadirectdebitMandateId { get; set; } /// /// This field can take one of the following values: * OneOff: (OOFF) Direct debit instruction to initiate exactly one direct debit transaction. * First: (FRST) Initial/first collection in a series of direct debit instructions. * Recurring: (RCUR) Direct debit instruction to carry out regular direct debit transactions initiated by the creditor. * Final: (FNAL) Last/final collection in a series of direct debit instructions. Example: OOFF /// /// This field can take one of the following values: * OneOff: (OOFF) Direct debit instruction to initiate exactly one direct debit transaction. * First: (FRST) Initial/first collection in a series of direct debit instructions. * Recurring: (RCUR) Direct debit instruction to carry out regular direct debit transactions initiated by the creditor. * Final: (FNAL) Last/final collection in a series of direct debit instructions. Example: OOFF - [JsonPropertyName("sepadirectdebit.sequenceType")] - public string SepadirectdebitSequenceType { get { return this.SepadirectdebitSequenceTypeOption; } set { this.SepadirectdebitSequenceTypeOption = new Option(value); } } + [DataMember(Name = "sepadirectdebit.sequenceType", EmitDefaultValue = false)] + public string SepadirectdebitSequenceType { get; set; } /// /// Returns the string presentation of the object @@ -103,125 +82,86 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ResponseAdditionalDataSepaJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ResponseAdditionalDataSepa Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option sepadirectdebitDateOfSignature = default; - Option sepadirectdebitMandateId = default; - Option sepadirectdebitSequenceType = default; + return this.Equals(input as ResponseAdditionalDataSepa); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ResponseAdditionalDataSepa instances are equal + /// + /// Instance of ResponseAdditionalDataSepa to be compared + /// Boolean + public bool Equals(ResponseAdditionalDataSepa input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "sepadirectdebit.dateOfSignature": - sepadirectdebitDateOfSignature = new Option(utf8JsonReader.GetString()); - break; - case "sepadirectdebit.mandateId": - sepadirectdebitMandateId = new Option(utf8JsonReader.GetString()); - break; - case "sepadirectdebit.sequenceType": - sepadirectdebitSequenceType = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (sepadirectdebitDateOfSignature.IsSet && sepadirectdebitDateOfSignature.Value == null) - throw new ArgumentNullException(nameof(sepadirectdebitDateOfSignature), "Property is not nullable for class ResponseAdditionalDataSepa."); - - if (sepadirectdebitMandateId.IsSet && sepadirectdebitMandateId.Value == null) - throw new ArgumentNullException(nameof(sepadirectdebitMandateId), "Property is not nullable for class ResponseAdditionalDataSepa."); - - if (sepadirectdebitSequenceType.IsSet && sepadirectdebitSequenceType.Value == null) - throw new ArgumentNullException(nameof(sepadirectdebitSequenceType), "Property is not nullable for class ResponseAdditionalDataSepa."); - - return new ResponseAdditionalDataSepa(sepadirectdebitDateOfSignature, sepadirectdebitMandateId, sepadirectdebitSequenceType); + return + ( + this.SepadirectdebitDateOfSignature == input.SepadirectdebitDateOfSignature || + (this.SepadirectdebitDateOfSignature != null && + this.SepadirectdebitDateOfSignature.Equals(input.SepadirectdebitDateOfSignature)) + ) && + ( + this.SepadirectdebitMandateId == input.SepadirectdebitMandateId || + (this.SepadirectdebitMandateId != null && + this.SepadirectdebitMandateId.Equals(input.SepadirectdebitMandateId)) + ) && + ( + this.SepadirectdebitSequenceType == input.SepadirectdebitSequenceType || + (this.SepadirectdebitSequenceType != null && + this.SepadirectdebitSequenceType.Equals(input.SepadirectdebitSequenceType)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ResponseAdditionalDataSepa responseAdditionalDataSepa, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, responseAdditionalDataSepa, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SepadirectdebitDateOfSignature != null) + { + hashCode = (hashCode * 59) + this.SepadirectdebitDateOfSignature.GetHashCode(); + } + if (this.SepadirectdebitMandateId != null) + { + hashCode = (hashCode * 59) + this.SepadirectdebitMandateId.GetHashCode(); + } + if (this.SepadirectdebitSequenceType != null) + { + hashCode = (hashCode * 59) + this.SepadirectdebitSequenceType.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ResponseAdditionalDataSepa responseAdditionalDataSepa, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (responseAdditionalDataSepa.SepadirectdebitDateOfSignatureOption.IsSet && responseAdditionalDataSepa.SepadirectdebitDateOfSignature == null) - throw new ArgumentNullException(nameof(responseAdditionalDataSepa.SepadirectdebitDateOfSignature), "Property is required for class ResponseAdditionalDataSepa."); - - if (responseAdditionalDataSepa.SepadirectdebitMandateIdOption.IsSet && responseAdditionalDataSepa.SepadirectdebitMandateId == null) - throw new ArgumentNullException(nameof(responseAdditionalDataSepa.SepadirectdebitMandateId), "Property is required for class ResponseAdditionalDataSepa."); - - if (responseAdditionalDataSepa.SepadirectdebitSequenceTypeOption.IsSet && responseAdditionalDataSepa.SepadirectdebitSequenceType == null) - throw new ArgumentNullException(nameof(responseAdditionalDataSepa.SepadirectdebitSequenceType), "Property is required for class ResponseAdditionalDataSepa."); - - if (responseAdditionalDataSepa.SepadirectdebitDateOfSignatureOption.IsSet) - writer.WriteString("sepadirectdebit.dateOfSignature", responseAdditionalDataSepa.SepadirectdebitDateOfSignature); - - if (responseAdditionalDataSepa.SepadirectdebitMandateIdOption.IsSet) - writer.WriteString("sepadirectdebit.mandateId", responseAdditionalDataSepa.SepadirectdebitMandateId); - - if (responseAdditionalDataSepa.SepadirectdebitSequenceTypeOption.IsSet) - writer.WriteString("sepadirectdebit.sequenceType", responseAdditionalDataSepa.SepadirectdebitSequenceType); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ResponsePaymentMethod.cs b/Adyen/Model/Checkout/ResponsePaymentMethod.cs index 448533127..075e3ae29 100644 --- a/Adyen/Model/Checkout/ResponsePaymentMethod.cs +++ b/Adyen/Model/Checkout/ResponsePaymentMethod.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,62 +15,47 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ResponsePaymentMethod /// - public partial class ResponsePaymentMethod : IValidatableObject + [DataContract(Name = "ResponsePaymentMethod")] + public partial class ResponsePaymentMethod : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The card brand that the shopper used to pay. Only returned if `paymentMethod.type` is **scheme**. - /// The `paymentMethod.type` value used in the request. - [JsonConstructor] - public ResponsePaymentMethod(Option brand = default, Option type = default) + /// The card brand that the shopper used to pay. Only returned if `paymentMethod.type` is **scheme**.. + /// The `paymentMethod.type` value used in the request.. + public ResponsePaymentMethod(string brand = default(string), string type = default(string)) { - BrandOption = brand; - TypeOption = type; - OnCreated(); + this.Brand = brand; + this.Type = type; } - partial void OnCreated(); - - /// - /// Used to track the state of Brand - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BrandOption { get; private set; } - /// /// The card brand that the shopper used to pay. Only returned if `paymentMethod.type` is **scheme**. /// /// The card brand that the shopper used to pay. Only returned if `paymentMethod.type` is **scheme**. - [JsonPropertyName("brand")] - public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } + [DataMember(Name = "brand", EmitDefaultValue = false)] + public string Brand { get; set; } /// /// The `paymentMethod.type` value used in the request. /// /// The `paymentMethod.type` value used in the request. - [JsonPropertyName("type")] - public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } /// /// Returns the string presentation of the object @@ -86,112 +72,77 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ResponsePaymentMethodJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ResponsePaymentMethod Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option brand = default; - Option type = default; + return this.Equals(input as ResponsePaymentMethod); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ResponsePaymentMethod instances are equal + /// + /// Instance of ResponsePaymentMethod to be compared + /// Boolean + public bool Equals(ResponsePaymentMethod input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "brand": - brand = new Option(utf8JsonReader.GetString()); - break; - case "type": - type = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (brand.IsSet && brand.Value == null) - throw new ArgumentNullException(nameof(brand), "Property is not nullable for class ResponsePaymentMethod."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class ResponsePaymentMethod."); - - return new ResponsePaymentMethod(brand, type); + return + ( + this.Brand == input.Brand || + (this.Brand != null && + this.Brand.Equals(input.Brand)) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ResponsePaymentMethod responsePaymentMethod, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, responsePaymentMethod, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Brand != null) + { + hashCode = (hashCode * 59) + this.Brand.GetHashCode(); + } + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ResponsePaymentMethod responsePaymentMethod, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (responsePaymentMethod.BrandOption.IsSet && responsePaymentMethod.Brand == null) - throw new ArgumentNullException(nameof(responsePaymentMethod.Brand), "Property is required for class ResponsePaymentMethod."); - - if (responsePaymentMethod.TypeOption.IsSet && responsePaymentMethod.Type == null) - throw new ArgumentNullException(nameof(responsePaymentMethod.Type), "Property is required for class ResponsePaymentMethod."); - - if (responsePaymentMethod.BrandOption.IsSet) - writer.WriteString("brand", responsePaymentMethod.Brand); - - if (responsePaymentMethod.TypeOption.IsSet) - writer.WriteString("type", responsePaymentMethod.Type); + yield break; } } + } diff --git a/Adyen/Model/Checkout/RiskData.cs b/Adyen/Model/Checkout/RiskData.cs index 451b492b5..d24cacd18 100644 --- a/Adyen/Model/Checkout/RiskData.cs +++ b/Adyen/Model/Checkout/RiskData.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,94 +15,65 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// RiskData /// - public partial class RiskData : IValidatableObject + [DataContract(Name = "RiskData")] + public partial class RiskData : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Contains client-side data, like the device fingerprint, cookies, and specific browser settings. - /// Any custom fields used as part of the input to configured risk rules. - /// An integer value that is added to the normal fraud score. The value can be either positive or negative. - /// The risk profile to assign to this payment. When left empty, the merchant-level account's default risk profile will be applied. - [JsonConstructor] - public RiskData(Option clientData = default, Option> customFields = default, Option fraudOffset = default, Option profileReference = default) + /// Contains client-side data, like the device fingerprint, cookies, and specific browser settings.. + /// Any custom fields used as part of the input to configured risk rules.. + /// An integer value that is added to the normal fraud score. The value can be either positive or negative.. + /// The risk profile to assign to this payment. When left empty, the merchant-level account's default risk profile will be applied.. + public RiskData(string clientData = default(string), Dictionary customFields = default(Dictionary), int? fraudOffset = default(int?), string profileReference = default(string)) { - ClientDataOption = clientData; - CustomFieldsOption = customFields; - FraudOffsetOption = fraudOffset; - ProfileReferenceOption = profileReference; - OnCreated(); + this.ClientData = clientData; + this.CustomFields = customFields; + this.FraudOffset = fraudOffset; + this.ProfileReference = profileReference; } - partial void OnCreated(); - - /// - /// Used to track the state of ClientData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ClientDataOption { get; private set; } - /// /// Contains client-side data, like the device fingerprint, cookies, and specific browser settings. /// /// Contains client-side data, like the device fingerprint, cookies, and specific browser settings. - [JsonPropertyName("clientData")] - public string ClientData { get { return this.ClientDataOption; } set { this.ClientDataOption = new Option(value); } } - - /// - /// Used to track the state of CustomFields - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> CustomFieldsOption { get; private set; } + [DataMember(Name = "clientData", EmitDefaultValue = false)] + public string ClientData { get; set; } /// /// Any custom fields used as part of the input to configured risk rules. /// /// Any custom fields used as part of the input to configured risk rules. - [JsonPropertyName("customFields")] - public Dictionary CustomFields { get { return this.CustomFieldsOption; } set { this.CustomFieldsOption = new Option>(value); } } - - /// - /// Used to track the state of FraudOffset - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FraudOffsetOption { get; private set; } + [DataMember(Name = "customFields", EmitDefaultValue = false)] + public Dictionary CustomFields { get; set; } /// /// An integer value that is added to the normal fraud score. The value can be either positive or negative. /// /// An integer value that is added to the normal fraud score. The value can be either positive or negative. - [JsonPropertyName("fraudOffset")] - public int? FraudOffset { get { return this.FraudOffsetOption; } set { this.FraudOffsetOption = new Option(value); } } - - /// - /// Used to track the state of ProfileReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ProfileReferenceOption { get; private set; } + [DataMember(Name = "fraudOffset", EmitDefaultValue = false)] + public int? FraudOffset { get; set; } /// /// The risk profile to assign to this payment. When left empty, the merchant-level account's default risk profile will be applied. /// /// The risk profile to assign to this payment. When left empty, the merchant-level account's default risk profile will be applied. - [JsonPropertyName("profileReference")] - public string ProfileReference { get { return this.ProfileReferenceOption; } set { this.ProfileReferenceOption = new Option(value); } } + [DataMember(Name = "profileReference", EmitDefaultValue = false)] + public string ProfileReference { get; set; } /// /// Returns the string presentation of the object @@ -120,145 +92,98 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // ClientData (string) maxLength - if (this.ClientData != null && this.ClientData.Length > 5000) - { - yield return new ValidationResult("Invalid value for ClientData, length must be less than 5000.", new [] { "ClientData" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class RiskDataJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override RiskData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option clientData = default; - Option> customFields = default; - Option fraudOffset = default; - Option profileReference = default; + return this.Equals(input as RiskData); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if RiskData instances are equal + /// + /// Instance of RiskData to be compared + /// Boolean + public bool Equals(RiskData input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "clientData": - clientData = new Option(utf8JsonReader.GetString()); - break; - case "customFields": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - customFields = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "fraudOffset": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - fraudOffset = new Option(utf8JsonReader.GetInt32()); - break; - case "profileReference": - profileReference = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (clientData.IsSet && clientData.Value == null) - throw new ArgumentNullException(nameof(clientData), "Property is not nullable for class RiskData."); - - if (customFields.IsSet && customFields.Value == null) - throw new ArgumentNullException(nameof(customFields), "Property is not nullable for class RiskData."); - - if (fraudOffset.IsSet && fraudOffset.Value == null) - throw new ArgumentNullException(nameof(fraudOffset), "Property is not nullable for class RiskData."); - - if (profileReference.IsSet && profileReference.Value == null) - throw new ArgumentNullException(nameof(profileReference), "Property is not nullable for class RiskData."); - - return new RiskData(clientData, customFields, fraudOffset, profileReference); + return + ( + this.ClientData == input.ClientData || + (this.ClientData != null && + this.ClientData.Equals(input.ClientData)) + ) && + ( + this.CustomFields == input.CustomFields || + this.CustomFields != null && + input.CustomFields != null && + this.CustomFields.SequenceEqual(input.CustomFields) + ) && + ( + this.FraudOffset == input.FraudOffset || + this.FraudOffset.Equals(input.FraudOffset) + ) && + ( + this.ProfileReference == input.ProfileReference || + (this.ProfileReference != null && + this.ProfileReference.Equals(input.ProfileReference)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, RiskData riskData, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, riskData, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClientData != null) + { + hashCode = (hashCode * 59) + this.ClientData.GetHashCode(); + } + if (this.CustomFields != null) + { + hashCode = (hashCode * 59) + this.CustomFields.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FraudOffset.GetHashCode(); + if (this.ProfileReference != null) + { + hashCode = (hashCode * 59) + this.ProfileReference.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, RiskData riskData, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (riskData.ClientDataOption.IsSet && riskData.ClientData == null) - throw new ArgumentNullException(nameof(riskData.ClientData), "Property is required for class RiskData."); - - if (riskData.CustomFieldsOption.IsSet && riskData.CustomFields == null) - throw new ArgumentNullException(nameof(riskData.CustomFields), "Property is required for class RiskData."); - - if (riskData.ProfileReferenceOption.IsSet && riskData.ProfileReference == null) - throw new ArgumentNullException(nameof(riskData.ProfileReference), "Property is required for class RiskData."); - - if (riskData.ClientDataOption.IsSet) - writer.WriteString("clientData", riskData.ClientData); - - if (riskData.CustomFieldsOption.IsSet) + // ClientData (string) maxLength + if (this.ClientData != null && this.ClientData.Length > 5000) { - writer.WritePropertyName("customFields"); - JsonSerializer.Serialize(writer, riskData.CustomFields, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ClientData, length must be less than 5000.", new [] { "ClientData" }); } - if (riskData.FraudOffsetOption.IsSet) - writer.WriteNumber("fraudOffset", riskData.FraudOffsetOption.Value.Value); - if (riskData.ProfileReferenceOption.IsSet) - writer.WriteString("profileReference", riskData.ProfileReference); + yield break; } } + } diff --git a/Adyen/Model/Checkout/RivertyDetails.cs b/Adyen/Model/Checkout/RivertyDetails.cs index 7f196cb59..7b43f55cf 100644 --- a/Adyen/Model/Checkout/RivertyDetails.cs +++ b/Adyen/Model/Checkout/RivertyDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,249 +15,152 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// RivertyDetails /// - public partial class RivertyDetails : IValidatableObject + [DataContract(Name = "RivertyDetails")] + public partial class RivertyDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The address where to send the invoice. - /// The checkout attempt identifier. - /// The address where the goods should be delivered. - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - /// The iban number of the customer - /// Shopper name, date of birth, phone number, and email address. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **riverty** (default to TypeEnum.Riverty) - [JsonConstructor] - public RivertyDetails(Option billingAddress = default, Option checkoutAttemptId = default, Option deliveryAddress = default, Option deviceFingerprint = default, Option iban = default, Option personalDetails = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.Riverty) - { - BillingAddressOption = billingAddress; - CheckoutAttemptIdOption = checkoutAttemptId; - DeliveryAddressOption = deliveryAddress; - DeviceFingerprintOption = deviceFingerprint; - IbanOption = iban; - PersonalDetailsOption = personalDetails; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - Type = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **riverty** /// /// **riverty** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Riverty for value: riverty /// + [EnumMember(Value = "riverty")] Riverty = 1, /// /// Enum RivertyAccount for value: riverty_account /// + [EnumMember(Value = "riverty_account")] RivertyAccount = 2, /// /// Enum SepadirectdebitRiverty for value: sepadirectdebit_riverty /// + [EnumMember(Value = "sepadirectdebit_riverty")] SepadirectdebitRiverty = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("riverty")) - return TypeEnum.Riverty; - - if (value.Equals("riverty_account")) - return TypeEnum.RivertyAccount; - if (value.Equals("sepadirectdebit_riverty")) - return TypeEnum.SepadirectdebitRiverty; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("riverty")) - return TypeEnum.Riverty; - - if (value.Equals("riverty_account")) - return TypeEnum.RivertyAccount; - - if (value.Equals("sepadirectdebit_riverty")) - return TypeEnum.SepadirectdebitRiverty; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.Riverty) - return "riverty"; - - if (value == TypeEnum.RivertyAccount) - return "riverty_account"; - - if (value == TypeEnum.SepadirectdebitRiverty) - return "sepadirectdebit_riverty"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **riverty** /// /// **riverty** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of BillingAddress + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BillingAddressOption { get; private set; } - + [JsonConstructorAttribute] + protected RivertyDetails() { } /// - /// The address where to send the invoice. + /// Initializes a new instance of the class. /// - /// The address where to send the invoice. - [JsonPropertyName("billingAddress")] - public string BillingAddress { get { return this.BillingAddressOption; } set { this.BillingAddressOption = new Option(value); } } + /// The address where to send the invoice.. + /// The checkout attempt identifier.. + /// The address where the goods should be delivered.. + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting).. + /// The iban number of the customer . + /// Shopper name, date of birth, phone number, and email address.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The payment method subtype.. + /// **riverty** (required) (default to TypeEnum.Riverty). + public RivertyDetails(string billingAddress = default(string), string checkoutAttemptId = default(string), string deliveryAddress = default(string), string deviceFingerprint = default(string), string iban = default(string), string personalDetails = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string subtype = default(string), TypeEnum type = TypeEnum.Riverty) + { + this.Type = type; + this.BillingAddress = billingAddress; + this.CheckoutAttemptId = checkoutAttemptId; + this.DeliveryAddress = deliveryAddress; + this.DeviceFingerprint = deviceFingerprint; + this.Iban = iban; + this.PersonalDetails = personalDetails; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Subtype = subtype; + } /// - /// Used to track the state of CheckoutAttemptId + /// The address where to send the invoice. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The address where to send the invoice. + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public string BillingAddress { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of DeliveryAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeliveryAddressOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The address where the goods should be delivered. /// /// The address where the goods should be delivered. - [JsonPropertyName("deliveryAddress")] - public string DeliveryAddress { get { return this.DeliveryAddressOption; } set { this.DeliveryAddressOption = new Option(value); } } - - /// - /// Used to track the state of DeviceFingerprint - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeviceFingerprintOption { get; private set; } + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public string DeliveryAddress { get; set; } /// /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). /// /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). - [JsonPropertyName("deviceFingerprint")] - public string DeviceFingerprint { get { return this.DeviceFingerprintOption; } set { this.DeviceFingerprintOption = new Option(value); } } - - /// - /// Used to track the state of Iban - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IbanOption { get; private set; } + [DataMember(Name = "deviceFingerprint", EmitDefaultValue = false)] + public string DeviceFingerprint { get; set; } /// /// The iban number of the customer /// /// The iban number of the customer - [JsonPropertyName("iban")] - public string Iban { get { return this.IbanOption; } set { this.IbanOption = new Option(value); } } - - /// - /// Used to track the state of PersonalDetails - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PersonalDetailsOption { get; private set; } + [DataMember(Name = "iban", EmitDefaultValue = false)] + public string Iban { get; set; } /// /// Shopper name, date of birth, phone number, and email address. /// /// Shopper name, date of birth, phone number, and email address. - [JsonPropertyName("personalDetails")] - public string PersonalDetails { get { return this.PersonalDetailsOption; } set { this.PersonalDetailsOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "personalDetails", EmitDefaultValue = false)] + public string PersonalDetails { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// - /// Used to track the state of StoredPaymentMethodId + /// This is the `recurringDetailReference` returned in the response when you created the token. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + /// This is the `recurringDetailReference` returned in the response when you created the token. + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// - /// This is the `recurringDetailReference` returned in the response when you created the token. + /// The payment method subtype. /// - /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + /// The payment method subtype. + [DataMember(Name = "subtype", EmitDefaultValue = false)] + public string Subtype { get; set; } /// /// Returns the string presentation of the object @@ -274,229 +178,170 @@ public override string ToString() sb.Append(" PersonalDetails: ").Append(PersonalDetails).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); + sb.Append(" Subtype: ").Append(Subtype).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // DeviceFingerprint (string) maxLength - if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) - { - yield return new ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); - } - - // Iban (string) maxLength - if (this.Iban != null && this.Iban.Length > 34) - { - yield return new ValidationResult("Invalid value for Iban, length must be less than 34.", new [] { "Iban" }); - } - - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class RivertyDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override RivertyDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option billingAddress = default; - Option checkoutAttemptId = default; - Option deliveryAddress = default; - Option deviceFingerprint = default; - Option iban = default; - Option personalDetails = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as RivertyDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if RivertyDetails instances are equal + /// + /// Instance of RivertyDetails to be compared + /// Boolean + public bool Equals(RivertyDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "billingAddress": - billingAddress = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "deliveryAddress": - deliveryAddress = new Option(utf8JsonReader.GetString()); - break; - case "deviceFingerprint": - deviceFingerprint = new Option(utf8JsonReader.GetString()); - break; - case "iban": - iban = new Option(utf8JsonReader.GetString()); - break; - case "personalDetails": - personalDetails = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(RivertyDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class RivertyDetails.", nameof(type)); - - if (billingAddress.IsSet && billingAddress.Value == null) - throw new ArgumentNullException(nameof(billingAddress), "Property is not nullable for class RivertyDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class RivertyDetails."); - - if (deliveryAddress.IsSet && deliveryAddress.Value == null) - throw new ArgumentNullException(nameof(deliveryAddress), "Property is not nullable for class RivertyDetails."); - - if (deviceFingerprint.IsSet && deviceFingerprint.Value == null) - throw new ArgumentNullException(nameof(deviceFingerprint), "Property is not nullable for class RivertyDetails."); - - if (iban.IsSet && iban.Value == null) - throw new ArgumentNullException(nameof(iban), "Property is not nullable for class RivertyDetails."); - - if (personalDetails.IsSet && personalDetails.Value == null) - throw new ArgumentNullException(nameof(personalDetails), "Property is not nullable for class RivertyDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class RivertyDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class RivertyDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class RivertyDetails."); - - return new RivertyDetails(billingAddress, checkoutAttemptId, deliveryAddress, deviceFingerprint, iban, personalDetails, recurringDetailReference, storedPaymentMethodId, type.Value.Value); + return + ( + this.BillingAddress == input.BillingAddress || + (this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + (this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress)) + ) && + ( + this.DeviceFingerprint == input.DeviceFingerprint || + (this.DeviceFingerprint != null && + this.DeviceFingerprint.Equals(input.DeviceFingerprint)) + ) && + ( + this.Iban == input.Iban || + (this.Iban != null && + this.Iban.Equals(input.Iban)) + ) && + ( + this.PersonalDetails == input.PersonalDetails || + (this.PersonalDetails != null && + this.PersonalDetails.Equals(input.PersonalDetails)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Subtype == input.Subtype || + (this.Subtype != null && + this.Subtype.Equals(input.Subtype)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, RivertyDetails rivertyDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, rivertyDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.BillingAddress != null) + { + hashCode = (hashCode * 59) + this.BillingAddress.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.DeliveryAddress != null) + { + hashCode = (hashCode * 59) + this.DeliveryAddress.GetHashCode(); + } + if (this.DeviceFingerprint != null) + { + hashCode = (hashCode * 59) + this.DeviceFingerprint.GetHashCode(); + } + if (this.Iban != null) + { + hashCode = (hashCode * 59) + this.Iban.GetHashCode(); + } + if (this.PersonalDetails != null) + { + hashCode = (hashCode * 59) + this.PersonalDetails.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.Subtype != null) + { + hashCode = (hashCode * 59) + this.Subtype.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, RivertyDetails rivertyDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (rivertyDetails.BillingAddressOption.IsSet && rivertyDetails.BillingAddress == null) - throw new ArgumentNullException(nameof(rivertyDetails.BillingAddress), "Property is required for class RivertyDetails."); - - if (rivertyDetails.CheckoutAttemptIdOption.IsSet && rivertyDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(rivertyDetails.CheckoutAttemptId), "Property is required for class RivertyDetails."); - - if (rivertyDetails.DeliveryAddressOption.IsSet && rivertyDetails.DeliveryAddress == null) - throw new ArgumentNullException(nameof(rivertyDetails.DeliveryAddress), "Property is required for class RivertyDetails."); - - if (rivertyDetails.DeviceFingerprintOption.IsSet && rivertyDetails.DeviceFingerprint == null) - throw new ArgumentNullException(nameof(rivertyDetails.DeviceFingerprint), "Property is required for class RivertyDetails."); - - if (rivertyDetails.IbanOption.IsSet && rivertyDetails.Iban == null) - throw new ArgumentNullException(nameof(rivertyDetails.Iban), "Property is required for class RivertyDetails."); - - if (rivertyDetails.PersonalDetailsOption.IsSet && rivertyDetails.PersonalDetails == null) - throw new ArgumentNullException(nameof(rivertyDetails.PersonalDetails), "Property is required for class RivertyDetails."); - - if (rivertyDetails.RecurringDetailReferenceOption.IsSet && rivertyDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(rivertyDetails.RecurringDetailReference), "Property is required for class RivertyDetails."); - - if (rivertyDetails.StoredPaymentMethodIdOption.IsSet && rivertyDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(rivertyDetails.StoredPaymentMethodId), "Property is required for class RivertyDetails."); - - if (rivertyDetails.BillingAddressOption.IsSet) - writer.WriteString("billingAddress", rivertyDetails.BillingAddress); - - if (rivertyDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", rivertyDetails.CheckoutAttemptId); - - if (rivertyDetails.DeliveryAddressOption.IsSet) - writer.WriteString("deliveryAddress", rivertyDetails.DeliveryAddress); - - if (rivertyDetails.DeviceFingerprintOption.IsSet) - writer.WriteString("deviceFingerprint", rivertyDetails.DeviceFingerprint); - - if (rivertyDetails.IbanOption.IsSet) - writer.WriteString("iban", rivertyDetails.Iban); - - if (rivertyDetails.PersonalDetailsOption.IsSet) - writer.WriteString("personalDetails", rivertyDetails.PersonalDetails); + // DeviceFingerprint (string) maxLength + if (this.DeviceFingerprint != null && this.DeviceFingerprint.Length > 5000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for DeviceFingerprint, length must be less than 5000.", new [] { "DeviceFingerprint" }); + } - if (rivertyDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", rivertyDetails.RecurringDetailReference); + // Iban (string) maxLength + if (this.Iban != null && this.Iban.Length > 34) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Iban, length must be less than 34.", new [] { "Iban" }); + } - if (rivertyDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", rivertyDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = RivertyDetails.TypeEnumToJsonValue(rivertyDetails.Type); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/SDKEphemPubKey.cs b/Adyen/Model/Checkout/SDKEphemPubKey.cs index 97357ee21..b8e7c7c98 100644 --- a/Adyen/Model/Checkout/SDKEphemPubKey.cs +++ b/Adyen/Model/Checkout/SDKEphemPubKey.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,94 +15,65 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// SDKEphemPubKey /// - public partial class SDKEphemPubKey : IValidatableObject + [DataContract(Name = "SDKEphemPubKey")] + public partial class SDKEphemPubKey : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The `crv` value as received from the 3D Secure 2 SDK. - /// The `kty` value as received from the 3D Secure 2 SDK. - /// The `x` value as received from the 3D Secure 2 SDK. - /// The `y` value as received from the 3D Secure 2 SDK. - [JsonConstructor] - public SDKEphemPubKey(Option crv = default, Option kty = default, Option x = default, Option y = default) + /// The `crv` value as received from the 3D Secure 2 SDK.. + /// The `kty` value as received from the 3D Secure 2 SDK.. + /// The `x` value as received from the 3D Secure 2 SDK.. + /// The `y` value as received from the 3D Secure 2 SDK.. + public SDKEphemPubKey(string crv = default(string), string kty = default(string), string x = default(string), string y = default(string)) { - CrvOption = crv; - KtyOption = kty; - XOption = x; - YOption = y; - OnCreated(); + this.Crv = crv; + this.Kty = kty; + this.X = x; + this.Y = y; } - partial void OnCreated(); - - /// - /// Used to track the state of Crv - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CrvOption { get; private set; } - /// /// The `crv` value as received from the 3D Secure 2 SDK. /// /// The `crv` value as received from the 3D Secure 2 SDK. - [JsonPropertyName("crv")] - public string Crv { get { return this.CrvOption; } set { this.CrvOption = new Option(value); } } - - /// - /// Used to track the state of Kty - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option KtyOption { get; private set; } + [DataMember(Name = "crv", EmitDefaultValue = false)] + public string Crv { get; set; } /// /// The `kty` value as received from the 3D Secure 2 SDK. /// /// The `kty` value as received from the 3D Secure 2 SDK. - [JsonPropertyName("kty")] - public string Kty { get { return this.KtyOption; } set { this.KtyOption = new Option(value); } } - - /// - /// Used to track the state of X - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option XOption { get; private set; } + [DataMember(Name = "kty", EmitDefaultValue = false)] + public string Kty { get; set; } /// /// The `x` value as received from the 3D Secure 2 SDK. /// /// The `x` value as received from the 3D Secure 2 SDK. - [JsonPropertyName("x")] - public string X { get { return this.XOption; } set { this.XOption = new Option(value); } } - - /// - /// Used to track the state of Y - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option YOption { get; private set; } + [DataMember(Name = "x", EmitDefaultValue = false)] + public string X { get; set; } /// /// The `y` value as received from the 3D Secure 2 SDK. /// /// The `y` value as received from the 3D Secure 2 SDK. - [JsonPropertyName("y")] - public string Y { get { return this.YOption; } set { this.YOption = new Option(value); } } + [DataMember(Name = "y", EmitDefaultValue = false)] + public string Y { get; set; } /// /// Returns the string presentation of the object @@ -120,138 +92,95 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class SDKEphemPubKeyJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override SDKEphemPubKey Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option crv = default; - Option kty = default; - Option x = default; - Option y = default; + return this.Equals(input as SDKEphemPubKey); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if SDKEphemPubKey instances are equal + /// + /// Instance of SDKEphemPubKey to be compared + /// Boolean + public bool Equals(SDKEphemPubKey input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "crv": - crv = new Option(utf8JsonReader.GetString()); - break; - case "kty": - kty = new Option(utf8JsonReader.GetString()); - break; - case "x": - x = new Option(utf8JsonReader.GetString()); - break; - case "y": - y = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (crv.IsSet && crv.Value == null) - throw new ArgumentNullException(nameof(crv), "Property is not nullable for class SDKEphemPubKey."); - - if (kty.IsSet && kty.Value == null) - throw new ArgumentNullException(nameof(kty), "Property is not nullable for class SDKEphemPubKey."); - - if (x.IsSet && x.Value == null) - throw new ArgumentNullException(nameof(x), "Property is not nullable for class SDKEphemPubKey."); - - if (y.IsSet && y.Value == null) - throw new ArgumentNullException(nameof(y), "Property is not nullable for class SDKEphemPubKey."); - - return new SDKEphemPubKey(crv, kty, x, y); + return + ( + this.Crv == input.Crv || + (this.Crv != null && + this.Crv.Equals(input.Crv)) + ) && + ( + this.Kty == input.Kty || + (this.Kty != null && + this.Kty.Equals(input.Kty)) + ) && + ( + this.X == input.X || + (this.X != null && + this.X.Equals(input.X)) + ) && + ( + this.Y == input.Y || + (this.Y != null && + this.Y.Equals(input.Y)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, SDKEphemPubKey sDKEphemPubKey, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, sDKEphemPubKey, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Crv != null) + { + hashCode = (hashCode * 59) + this.Crv.GetHashCode(); + } + if (this.Kty != null) + { + hashCode = (hashCode * 59) + this.Kty.GetHashCode(); + } + if (this.X != null) + { + hashCode = (hashCode * 59) + this.X.GetHashCode(); + } + if (this.Y != null) + { + hashCode = (hashCode * 59) + this.Y.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, SDKEphemPubKey sDKEphemPubKey, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (sDKEphemPubKey.CrvOption.IsSet && sDKEphemPubKey.Crv == null) - throw new ArgumentNullException(nameof(sDKEphemPubKey.Crv), "Property is required for class SDKEphemPubKey."); - - if (sDKEphemPubKey.KtyOption.IsSet && sDKEphemPubKey.Kty == null) - throw new ArgumentNullException(nameof(sDKEphemPubKey.Kty), "Property is required for class SDKEphemPubKey."); - - if (sDKEphemPubKey.XOption.IsSet && sDKEphemPubKey.X == null) - throw new ArgumentNullException(nameof(sDKEphemPubKey.X), "Property is required for class SDKEphemPubKey."); - - if (sDKEphemPubKey.YOption.IsSet && sDKEphemPubKey.Y == null) - throw new ArgumentNullException(nameof(sDKEphemPubKey.Y), "Property is required for class SDKEphemPubKey."); - - if (sDKEphemPubKey.CrvOption.IsSet) - writer.WriteString("crv", sDKEphemPubKey.Crv); - - if (sDKEphemPubKey.KtyOption.IsSet) - writer.WriteString("kty", sDKEphemPubKey.Kty); - - if (sDKEphemPubKey.XOption.IsSet) - writer.WriteString("x", sDKEphemPubKey.X); - - if (sDKEphemPubKey.YOption.IsSet) - writer.WriteString("y", sDKEphemPubKey.Y); + yield break; } } + } diff --git a/Adyen/Model/Checkout/SamsungPayDetails.cs b/Adyen/Model/Checkout/SamsungPayDetails.cs index 132363f43..06b92a3df 100644 --- a/Adyen/Model/Checkout/SamsungPayDetails.cs +++ b/Adyen/Model/Checkout/SamsungPayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,240 +15,125 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// SamsungPayDetails /// - public partial class SamsungPayDetails : IValidatableObject + [DataContract(Name = "SamsungPayDetails")] + public partial class SamsungPayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The payload you received from the Samsung Pay SDK response. - /// The checkout attempt identifier. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **samsungpay** (default to TypeEnum.Samsungpay) - [JsonConstructor] - public SamsungPayDetails(string samsungPayToken, Option checkoutAttemptId = default, Option fundingSource = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - SamsungPayToken = samsungPayToken; - CheckoutAttemptIdOption = checkoutAttemptId; - FundingSourceOption = fundingSource; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// + [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// + [EnumMember(Value = "debit")] Debit = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static FundingSourceEnum FundingSourceEnumFromString(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) - { - if (value == FundingSourceEnum.Credit) - return "credit"; - - if (value == FundingSourceEnum.Debit) - return "debit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonPropertyName("fundingSource")] - public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } /// /// **samsungpay** /// /// **samsungpay** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Samsungpay for value: samsungpay /// + [EnumMember(Value = "samsungpay")] Samsungpay = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("samsungpay")) - return TypeEnum.Samsungpay; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("samsungpay")) - return TypeEnum.Samsungpay; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Samsungpay) - return "samsungpay"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **samsungpay** /// /// **samsungpay** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// The payload you received from the Samsung Pay SDK response. + /// Initializes a new instance of the class. /// - /// The payload you received from the Samsung Pay SDK response. - [JsonPropertyName("samsungPayToken")] - public string SamsungPayToken { get; set; } - + [JsonConstructorAttribute] + protected SamsungPayDetails() { } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The payload you received from the Samsung Pay SDK response. (required). + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **samsungpay** (default to TypeEnum.Samsungpay). + public SamsungPayDetails(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string recurringDetailReference = default(string), string samsungPayToken = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Samsungpay) + { + this.SamsungPayToken = samsungPayToken; + this.CheckoutAttemptId = checkoutAttemptId; + this.FundingSource = fundingSource; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// - /// Used to track the state of StoredPaymentMethodId + /// The payload you received from the Samsung Pay SDK response. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + /// The payload you received from the Samsung Pay SDK response. + [DataMember(Name = "samsungPayToken", IsRequired = false, EmitDefaultValue = false)] + public string SamsungPayToken { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -257,10 +143,10 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class SamsungPayDetails {\n"); - sb.Append(" SamsungPayToken: ").Append(SamsungPayToken).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); + sb.Append(" SamsungPayToken: ").Append(SamsungPayToken).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); @@ -268,175 +154,117 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // SamsungPayToken (string) maxLength - if (this.SamsungPayToken != null && this.SamsungPayToken.Length > 10000) - { - yield return new ValidationResult("Invalid value for SamsungPayToken, length must be less than 10000.", new [] { "SamsungPayToken" }); - } - - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class SamsungPayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override SamsungPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option samsungPayToken = default; - Option checkoutAttemptId = default; - Option fundingSource = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as SamsungPayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if SamsungPayDetails instances are equal + /// + /// Instance of SamsungPayDetails to be compared + /// Boolean + public bool Equals(SamsungPayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "samsungPayToken": - samsungPayToken = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "fundingSource": - string fundingSourceRawValue = utf8JsonReader.GetString(); - if (fundingSourceRawValue != null) - fundingSource = new Option(SamsungPayDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(SamsungPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!samsungPayToken.IsSet) - throw new ArgumentException("Property is required for class SamsungPayDetails.", nameof(samsungPayToken)); - - if (samsungPayToken.IsSet && samsungPayToken.Value == null) - throw new ArgumentNullException(nameof(samsungPayToken), "Property is not nullable for class SamsungPayDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class SamsungPayDetails."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class SamsungPayDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class SamsungPayDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class SamsungPayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class SamsungPayDetails."); - - return new SamsungPayDetails(samsungPayToken.Value, checkoutAttemptId, fundingSource, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource.Equals(input.FundingSource) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.SamsungPayToken == input.SamsungPayToken || + (this.SamsungPayToken != null && + this.SamsungPayToken.Equals(input.SamsungPayToken)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, SamsungPayDetails samsungPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, samsungPayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.SamsungPayToken != null) + { + hashCode = (hashCode * 59) + this.SamsungPayToken.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, SamsungPayDetails samsungPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (samsungPayDetails.SamsungPayToken == null) - throw new ArgumentNullException(nameof(samsungPayDetails.SamsungPayToken), "Property is required for class SamsungPayDetails."); - - if (samsungPayDetails.CheckoutAttemptIdOption.IsSet && samsungPayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(samsungPayDetails.CheckoutAttemptId), "Property is required for class SamsungPayDetails."); - - if (samsungPayDetails.RecurringDetailReferenceOption.IsSet && samsungPayDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(samsungPayDetails.RecurringDetailReference), "Property is required for class SamsungPayDetails."); - - if (samsungPayDetails.StoredPaymentMethodIdOption.IsSet && samsungPayDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(samsungPayDetails.StoredPaymentMethodId), "Property is required for class SamsungPayDetails."); - - writer.WriteString("samsungPayToken", samsungPayDetails.SamsungPayToken); - - if (samsungPayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", samsungPayDetails.CheckoutAttemptId); - - var fundingSourceRawValue = SamsungPayDetails.FundingSourceEnumToJsonValue(samsungPayDetails.FundingSourceOption.Value.Value); - writer.WriteString("fundingSource", fundingSourceRawValue); - if (samsungPayDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", samsungPayDetails.RecurringDetailReference); + // SamsungPayToken (string) maxLength + if (this.SamsungPayToken != null && this.SamsungPayToken.Length > 10000) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for SamsungPayToken, length must be less than 10000.", new [] { "SamsungPayToken" }); + } - if (samsungPayDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", samsungPayDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = SamsungPayDetails.TypeEnumToJsonValue(samsungPayDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/SepaDirectDebitDetails.cs b/Adyen/Model/Checkout/SepaDirectDebitDetails.cs index e8e50850e..ccb9c3096 100644 --- a/Adyen/Model/Checkout/SepaDirectDebitDetails.cs +++ b/Adyen/Model/Checkout/SepaDirectDebitDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,196 +15,119 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// SepaDirectDebitDetails /// - public partial class SepaDirectDebitDetails : IValidatableObject + [DataContract(Name = "SepaDirectDebitDetails")] + public partial class SepaDirectDebitDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The International Bank Account Number (IBAN). - /// The name of the bank account holder. - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. - /// **sepadirectdebit** (default to TypeEnum.Sepadirectdebit) - [JsonConstructor] - public SepaDirectDebitDetails(string iban, string ownerName, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option transferInstrumentId = default, Option type = default) - { - Iban = iban; - OwnerName = ownerName; - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TransferInstrumentIdOption = transferInstrumentId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **sepadirectdebit** /// /// **sepadirectdebit** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Sepadirectdebit for value: sepadirectdebit /// + [EnumMember(Value = "sepadirectdebit")] Sepadirectdebit = 1, /// /// Enum SepadirectdebitAmazonpay for value: sepadirectdebit_amazonpay /// + [EnumMember(Value = "sepadirectdebit_amazonpay")] SepadirectdebitAmazonpay = 2 + } + /// - /// Returns a + /// **sepadirectdebit** /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("sepadirectdebit")) - return TypeEnum.Sepadirectdebit; - - if (value.Equals("sepadirectdebit_amazonpay")) - return TypeEnum.SepadirectdebitAmazonpay; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - + /// **sepadirectdebit** + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("sepadirectdebit")) - return TypeEnum.Sepadirectdebit; - - if (value.Equals("sepadirectdebit_amazonpay")) - return TypeEnum.SepadirectdebitAmazonpay; - - return null; - } - + [JsonConstructorAttribute] + protected SepaDirectDebitDetails() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) + /// The checkout attempt identifier.. + /// The International Bank Account Number (IBAN). (required). + /// The name of the bank account holder. (required). + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts.. + /// **sepadirectdebit** (default to TypeEnum.Sepadirectdebit). + public SepaDirectDebitDetails(string checkoutAttemptId = default(string), string iban = default(string), string ownerName = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string transferInstrumentId = default(string), TypeEnum? type = TypeEnum.Sepadirectdebit) { - if (value == TypeEnum.Sepadirectdebit) - return "sepadirectdebit"; - - if (value == TypeEnum.SepadirectdebitAmazonpay) - return "sepadirectdebit_amazonpay"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.Iban = iban; + this.OwnerName = ownerName; + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.TransferInstrumentId = transferInstrumentId; + this.Type = type; } /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } - - /// - /// **sepadirectdebit** + /// The checkout attempt identifier. /// - /// **sepadirectdebit** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The International Bank Account Number (IBAN). /// /// The International Bank Account Number (IBAN). - [JsonPropertyName("iban")] + [DataMember(Name = "iban", IsRequired = false, EmitDefaultValue = false)] public string Iban { get; set; } /// /// The name of the bank account holder. /// /// The name of the bank account holder. - [JsonPropertyName("ownerName")] + [DataMember(Name = "ownerName", IsRequired = false, EmitDefaultValue = false)] public string OwnerName { get; set; } - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - - /// - /// The checkout attempt identifier. - /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } - /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of TransferInstrumentId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TransferInstrumentIdOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. /// /// The unique identifier of your user's verified transfer instrument, which you can use to top up their balance accounts. - [JsonPropertyName("transferInstrumentId")] - public string TransferInstrumentId { get { return this.TransferInstrumentIdOption; } set { this.TransferInstrumentIdOption = new Option(value); } } + [DataMember(Name = "transferInstrumentId", EmitDefaultValue = false)] + public string TransferInstrumentId { get; set; } /// /// Returns the string presentation of the object @@ -213,9 +137,9 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class SepaDirectDebitDetails {\n"); + sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" Iban: ").Append(Iban).Append("\n"); sb.Append(" OwnerName: ").Append(OwnerName).Append("\n"); - sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" TransferInstrumentId: ").Append(TransferInstrumentId).Append("\n"); @@ -225,186 +149,124 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class SepaDirectDebitDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override SepaDirectDebitDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option iban = default; - Option ownerName = default; - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option transferInstrumentId = default; - Option type = default; + return this.Equals(input as SepaDirectDebitDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if SepaDirectDebitDetails instances are equal + /// + /// Instance of SepaDirectDebitDetails to be compared + /// Boolean + public bool Equals(SepaDirectDebitDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "iban": - iban = new Option(utf8JsonReader.GetString()); - break; - case "ownerName": - ownerName = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "transferInstrumentId": - transferInstrumentId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(SepaDirectDebitDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!iban.IsSet) - throw new ArgumentException("Property is required for class SepaDirectDebitDetails.", nameof(iban)); - - if (!ownerName.IsSet) - throw new ArgumentException("Property is required for class SepaDirectDebitDetails.", nameof(ownerName)); - - if (iban.IsSet && iban.Value == null) - throw new ArgumentNullException(nameof(iban), "Property is not nullable for class SepaDirectDebitDetails."); - - if (ownerName.IsSet && ownerName.Value == null) - throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class SepaDirectDebitDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class SepaDirectDebitDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class SepaDirectDebitDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class SepaDirectDebitDetails."); - - if (transferInstrumentId.IsSet && transferInstrumentId.Value == null) - throw new ArgumentNullException(nameof(transferInstrumentId), "Property is not nullable for class SepaDirectDebitDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class SepaDirectDebitDetails."); - - return new SepaDirectDebitDetails(iban.Value, ownerName.Value, checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, transferInstrumentId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Iban == input.Iban || + (this.Iban != null && + this.Iban.Equals(input.Iban)) + ) && + ( + this.OwnerName == input.OwnerName || + (this.OwnerName != null && + this.OwnerName.Equals(input.OwnerName)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.TransferInstrumentId == input.TransferInstrumentId || + (this.TransferInstrumentId != null && + this.TransferInstrumentId.Equals(input.TransferInstrumentId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, SepaDirectDebitDetails sepaDirectDebitDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, sepaDirectDebitDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.Iban != null) + { + hashCode = (hashCode * 59) + this.Iban.GetHashCode(); + } + if (this.OwnerName != null) + { + hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.TransferInstrumentId != null) + { + hashCode = (hashCode * 59) + this.TransferInstrumentId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, SepaDirectDebitDetails sepaDirectDebitDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (sepaDirectDebitDetails.Iban == null) - throw new ArgumentNullException(nameof(sepaDirectDebitDetails.Iban), "Property is required for class SepaDirectDebitDetails."); - - if (sepaDirectDebitDetails.OwnerName == null) - throw new ArgumentNullException(nameof(sepaDirectDebitDetails.OwnerName), "Property is required for class SepaDirectDebitDetails."); - - if (sepaDirectDebitDetails.CheckoutAttemptIdOption.IsSet && sepaDirectDebitDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(sepaDirectDebitDetails.CheckoutAttemptId), "Property is required for class SepaDirectDebitDetails."); - - if (sepaDirectDebitDetails.RecurringDetailReferenceOption.IsSet && sepaDirectDebitDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(sepaDirectDebitDetails.RecurringDetailReference), "Property is required for class SepaDirectDebitDetails."); - - if (sepaDirectDebitDetails.StoredPaymentMethodIdOption.IsSet && sepaDirectDebitDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(sepaDirectDebitDetails.StoredPaymentMethodId), "Property is required for class SepaDirectDebitDetails."); - - if (sepaDirectDebitDetails.TransferInstrumentIdOption.IsSet && sepaDirectDebitDetails.TransferInstrumentId == null) - throw new ArgumentNullException(nameof(sepaDirectDebitDetails.TransferInstrumentId), "Property is required for class SepaDirectDebitDetails."); - - writer.WriteString("iban", sepaDirectDebitDetails.Iban); - - writer.WriteString("ownerName", sepaDirectDebitDetails.OwnerName); - - if (sepaDirectDebitDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", sepaDirectDebitDetails.CheckoutAttemptId); - - if (sepaDirectDebitDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", sepaDirectDebitDetails.RecurringDetailReference); - - if (sepaDirectDebitDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", sepaDirectDebitDetails.StoredPaymentMethodId); - - if (sepaDirectDebitDetails.TransferInstrumentIdOption.IsSet) - writer.WriteString("transferInstrumentId", sepaDirectDebitDetails.TransferInstrumentId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = SepaDirectDebitDetails.TypeEnumToJsonValue(sepaDirectDebitDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ServiceError.cs b/Adyen/Model/Checkout/ServiceError.cs index 812902778..5878afc9f 100644 --- a/Adyen/Model/Checkout/ServiceError.cs +++ b/Adyen/Model/Checkout/ServiceError.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,126 +15,83 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ServiceError /// - public partial class ServiceError : IValidatableObject + [DataContract(Name = "ServiceError")] + public partial class ServiceError : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**. - /// The error code mapped to the error message. - /// The category of the error. - /// A short explanation of the issue. - /// The PSP reference of the payment. - /// The HTTP response status. - [JsonConstructor] - public ServiceError(Option> additionalData = default, Option errorCode = default, Option errorType = default, Option message = default, Option pspReference = default, Option status = default) + /// Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**.. + /// The error code mapped to the error message.. + /// The category of the error.. + /// A short explanation of the issue.. + /// The PSP reference of the payment.. + /// The HTTP response status.. + public ServiceError(Dictionary additionalData = default(Dictionary), string errorCode = default(string), string errorType = default(string), string message = default(string), string pspReference = default(string), int? status = default(int?)) { - AdditionalDataOption = additionalData; - ErrorCodeOption = errorCode; - ErrorTypeOption = errorType; - MessageOption = message; - PspReferenceOption = pspReference; - StatusOption = status; - OnCreated(); + this.AdditionalData = additionalData; + this.ErrorCode = errorCode; + this.ErrorType = errorType; + this.Message = message; + this.PspReference = pspReference; + this.Status = status; } - partial void OnCreated(); - - /// - /// Used to track the state of AdditionalData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AdditionalDataOption { get; private set; } - /// /// Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**. /// /// Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**. - [JsonPropertyName("additionalData")] - public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } - - /// - /// Used to track the state of ErrorCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ErrorCodeOption { get; private set; } + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } /// /// The error code mapped to the error message. /// /// The error code mapped to the error message. - [JsonPropertyName("errorCode")] - public string ErrorCode { get { return this.ErrorCodeOption; } set { this.ErrorCodeOption = new Option(value); } } - - /// - /// Used to track the state of ErrorType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ErrorTypeOption { get; private set; } + [DataMember(Name = "errorCode", EmitDefaultValue = false)] + public string ErrorCode { get; set; } /// /// The category of the error. /// /// The category of the error. - [JsonPropertyName("errorType")] - public string ErrorType { get { return this.ErrorTypeOption; } set { this.ErrorTypeOption = new Option(value); } } - - /// - /// Used to track the state of Message - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MessageOption { get; private set; } + [DataMember(Name = "errorType", EmitDefaultValue = false)] + public string ErrorType { get; set; } /// /// A short explanation of the issue. /// /// A short explanation of the issue. - [JsonPropertyName("message")] - public string Message { get { return this.MessageOption; } set { this.MessageOption = new Option(value); } } - - /// - /// Used to track the state of PspReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PspReferenceOption { get; private set; } + [DataMember(Name = "message", EmitDefaultValue = false)] + public string Message { get; set; } /// /// The PSP reference of the payment. /// /// The PSP reference of the payment. - [JsonPropertyName("pspReference")] - public string PspReference { get { return this.PspReferenceOption; } set { this.PspReferenceOption = new Option(value); } } - - /// - /// Used to track the state of Status - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StatusOption { get; private set; } + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + public string PspReference { get; set; } /// /// The HTTP response status. /// /// The HTTP response status. - [JsonPropertyName("status")] - public int? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } + [DataMember(Name = "status", EmitDefaultValue = false)] + public int? Status { get; set; } /// /// Returns the string presentation of the object @@ -154,165 +112,110 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ServiceErrorJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ServiceError Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option> additionalData = default; - Option errorCode = default; - Option errorType = default; - Option message = default; - Option pspReference = default; - Option status = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "additionalData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "errorCode": - errorCode = new Option(utf8JsonReader.GetString()); - break; - case "errorType": - errorType = new Option(utf8JsonReader.GetString()); - break; - case "message": - message = new Option(utf8JsonReader.GetString()); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "status": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - status = new Option(utf8JsonReader.GetInt32()); - break; - default: - break; - } - } - } - - if (additionalData.IsSet && additionalData.Value == null) - throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class ServiceError."); - - if (errorCode.IsSet && errorCode.Value == null) - throw new ArgumentNullException(nameof(errorCode), "Property is not nullable for class ServiceError."); - - if (errorType.IsSet && errorType.Value == null) - throw new ArgumentNullException(nameof(errorType), "Property is not nullable for class ServiceError."); - - if (message.IsSet && message.Value == null) - throw new ArgumentNullException(nameof(message), "Property is not nullable for class ServiceError."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class ServiceError."); - - if (status.IsSet && status.Value == null) - throw new ArgumentNullException(nameof(status), "Property is not nullable for class ServiceError."); - - return new ServiceError(additionalData, errorCode, errorType, message, pspReference, status); + return this.Equals(input as ServiceError); } /// - /// Serializes a + /// Returns true if ServiceError instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ServiceError serviceError, JsonSerializerOptions jsonSerializerOptions) + /// Instance of ServiceError to be compared + /// Boolean + public bool Equals(ServiceError input) { - writer.WriteStartObject(); - - WriteProperties(writer, serviceError, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + input.AdditionalData != null && + this.AdditionalData.SequenceEqual(input.AdditionalData) + ) && + ( + this.ErrorCode == input.ErrorCode || + (this.ErrorCode != null && + this.ErrorCode.Equals(input.ErrorCode)) + ) && + ( + this.ErrorType == input.ErrorType || + (this.ErrorType != null && + this.ErrorType.Equals(input.ErrorType)) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ServiceError serviceError, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (serviceError.AdditionalDataOption.IsSet && serviceError.AdditionalData == null) - throw new ArgumentNullException(nameof(serviceError.AdditionalData), "Property is required for class ServiceError."); - - if (serviceError.ErrorCodeOption.IsSet && serviceError.ErrorCode == null) - throw new ArgumentNullException(nameof(serviceError.ErrorCode), "Property is required for class ServiceError."); - - if (serviceError.ErrorTypeOption.IsSet && serviceError.ErrorType == null) - throw new ArgumentNullException(nameof(serviceError.ErrorType), "Property is required for class ServiceError."); - - if (serviceError.MessageOption.IsSet && serviceError.Message == null) - throw new ArgumentNullException(nameof(serviceError.Message), "Property is required for class ServiceError."); - - if (serviceError.PspReferenceOption.IsSet && serviceError.PspReference == null) - throw new ArgumentNullException(nameof(serviceError.PspReference), "Property is required for class ServiceError."); - - if (serviceError.AdditionalDataOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("additionalData"); - JsonSerializer.Serialize(writer, serviceError.AdditionalData, jsonSerializerOptions); + int hashCode = 41; + if (this.AdditionalData != null) + { + hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); + } + if (this.ErrorCode != null) + { + hashCode = (hashCode * 59) + this.ErrorCode.GetHashCode(); + } + if (this.ErrorType != null) + { + hashCode = (hashCode * 59) + this.ErrorType.GetHashCode(); + } + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + return hashCode; } - if (serviceError.ErrorCodeOption.IsSet) - writer.WriteString("errorCode", serviceError.ErrorCode); - - if (serviceError.ErrorTypeOption.IsSet) - writer.WriteString("errorType", serviceError.ErrorType); - - if (serviceError.MessageOption.IsSet) - writer.WriteString("message", serviceError.Message); - - if (serviceError.PspReferenceOption.IsSet) - writer.WriteString("pspReference", serviceError.PspReference); - - if (serviceError.StatusOption.IsSet) - writer.WriteNumber("status", serviceError.StatusOption.Value.Value); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/SessionResultResponse.cs b/Adyen/Model/Checkout/SessionResultResponse.cs index fcbfee6a0..60a5fe465 100644 --- a/Adyen/Model/Checkout/SessionResultResponse.cs +++ b/Adyen/Model/Checkout/SessionResultResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,233 +15,119 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// SessionResultResponse /// - public partial class SessionResultResponse : IValidatableObject + [DataContract(Name = "SessionResultResponse")] + public partial class SessionResultResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Contains additional information about the payment. Some fields are included only if you enable them. To enable these fields in your Customer Area, go to **Developers** > **Additional data**. - /// A unique identifier of the session. - /// A list of all authorised payments done for this session. - /// The unique reference that you provided in the original `/sessions` request. This identifies the payment and is used in all communication with you about the payment status. - /// The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed**: the shopper completed the payment, and the payment was authorized. * **paymentPending**: the shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow, like voucher payments where the shopper completes the payment in a physical shop. * **refused**: the session has been refused, because of too many refused payment attempts. The shopper can no longer complete the payment with this session. * **canceled**: the shopper canceled the payment. * **expired**: the session expired. The shopper can no longer complete the payment with this session. By default, the session expires one hour after it is created. - [JsonConstructor] - public SessionResultResponse(Option> additionalData = default, Option id = default, Option> payments = default, Option reference = default, Option status = default) - { - AdditionalDataOption = additionalData; - IdOption = id; - PaymentsOption = payments; - ReferenceOption = reference; - StatusOption = status; - OnCreated(); - } - - partial void OnCreated(); - /// /// The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed**: the shopper completed the payment, and the payment was authorized. * **paymentPending**: the shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow, like voucher payments where the shopper completes the payment in a physical shop. * **refused**: the session has been refused, because of too many refused payment attempts. The shopper can no longer complete the payment with this session. * **canceled**: the shopper canceled the payment. * **expired**: the session expired. The shopper can no longer complete the payment with this session. By default, the session expires one hour after it is created. /// /// The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed**: the shopper completed the payment, and the payment was authorized. * **paymentPending**: the shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow, like voucher payments where the shopper completes the payment in a physical shop. * **refused**: the session has been refused, because of too many refused payment attempts. The shopper can no longer complete the payment with this session. * **canceled**: the shopper canceled the payment. * **expired**: the session expired. The shopper can no longer complete the payment with this session. By default, the session expires one hour after it is created. + [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Active for value: active /// + [EnumMember(Value = "active")] Active = 1, /// /// Enum Canceled for value: canceled /// + [EnumMember(Value = "canceled")] Canceled = 2, /// /// Enum Completed for value: completed /// + [EnumMember(Value = "completed")] Completed = 3, /// /// Enum Expired for value: expired /// + [EnumMember(Value = "expired")] Expired = 4, /// /// Enum PaymentPending for value: paymentPending /// + [EnumMember(Value = "paymentPending")] PaymentPending = 5, /// /// Enum Refused for value: refused /// + [EnumMember(Value = "refused")] Refused = 6 - } - - /// - /// Returns a - /// - /// - /// - /// - public static StatusEnum StatusEnumFromString(string value) - { - if (value.Equals("active")) - return StatusEnum.Active; - - if (value.Equals("canceled")) - return StatusEnum.Canceled; - - if (value.Equals("completed")) - return StatusEnum.Completed; - - if (value.Equals("expired")) - return StatusEnum.Expired; - - if (value.Equals("paymentPending")) - return StatusEnum.PaymentPending; - - if (value.Equals("refused")) - return StatusEnum.Refused; - - throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static StatusEnum? StatusEnumFromStringOrDefault(string value) - { - if (value.Equals("active")) - return StatusEnum.Active; - - if (value.Equals("canceled")) - return StatusEnum.Canceled; - - if (value.Equals("completed")) - return StatusEnum.Completed; - - if (value.Equals("expired")) - return StatusEnum.Expired; - - if (value.Equals("paymentPending")) - return StatusEnum.PaymentPending; - if (value.Equals("refused")) - return StatusEnum.Refused; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string StatusEnumToJsonValue(StatusEnum? value) - { - if (value == StatusEnum.Active) - return "active"; - - if (value == StatusEnum.Canceled) - return "canceled"; - - if (value == StatusEnum.Completed) - return "completed"; - - if (value == StatusEnum.Expired) - return "expired"; - - if (value == StatusEnum.PaymentPending) - return "paymentPending"; - - if (value == StatusEnum.Refused) - return "refused"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Status - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StatusOption { get; private set; } /// /// The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed**: the shopper completed the payment, and the payment was authorized. * **paymentPending**: the shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow, like voucher payments where the shopper completes the payment in a physical shop. * **refused**: the session has been refused, because of too many refused payment attempts. The shopper can no longer complete the payment with this session. * **canceled**: the shopper canceled the payment. * **expired**: the session expired. The shopper can no longer complete the payment with this session. By default, the session expires one hour after it is created. /// /// The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed**: the shopper completed the payment, and the payment was authorized. * **paymentPending**: the shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow, like voucher payments where the shopper completes the payment in a physical shop. * **refused**: the session has been refused, because of too many refused payment attempts. The shopper can no longer complete the payment with this session. * **canceled**: the shopper canceled the payment. * **expired**: the session expired. The shopper can no longer complete the payment with this session. By default, the session expires one hour after it is created. - [JsonPropertyName("status")] - public StatusEnum? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } - + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } /// - /// Used to track the state of AdditionalData + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> AdditionalDataOption { get; private set; } + /// Contains additional information about the payment. Some fields are included only if you enable them. To enable these fields in your Customer Area, go to **Developers** > **Additional data**.. + /// A unique identifier of the session.. + /// A list of all authorised payments done for this session.. + /// The unique reference that you provided in the original `/sessions` request. This identifies the payment and is used in all communication with you about the payment status.. + /// The status of the session. The status included in the response doesn't get updated. Don't make the request again to check for payment status updates. Possible values: * **completed**: the shopper completed the payment, and the payment was authorized. * **paymentPending**: the shopper is in the process of making the payment. This applies to payment methods with an asynchronous flow, like voucher payments where the shopper completes the payment in a physical shop. * **refused**: the session has been refused, because of too many refused payment attempts. The shopper can no longer complete the payment with this session. * **canceled**: the shopper canceled the payment. * **expired**: the session expired. The shopper can no longer complete the payment with this session. By default, the session expires one hour after it is created.. + public SessionResultResponse(Dictionary additionalData = default(Dictionary), string id = default(string), List payments = default(List), string reference = default(string), StatusEnum? status = default(StatusEnum?)) + { + this.AdditionalData = additionalData; + this.Id = id; + this.Payments = payments; + this.Reference = reference; + this.Status = status; + } /// /// Contains additional information about the payment. Some fields are included only if you enable them. To enable these fields in your Customer Area, go to **Developers** > **Additional data**. /// /// Contains additional information about the payment. Some fields are included only if you enable them. To enable these fields in your Customer Area, go to **Developers** > **Additional data**. - [JsonPropertyName("additionalData")] - public Dictionary AdditionalData { get { return this.AdditionalDataOption; } set { this.AdditionalDataOption = new Option>(value); } } - - /// - /// Used to track the state of Id - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IdOption { get; private set; } + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } /// /// A unique identifier of the session. /// /// A unique identifier of the session. - [JsonPropertyName("id")] - public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } - - /// - /// Used to track the state of Payments - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> PaymentsOption { get; private set; } + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } /// /// A list of all authorised payments done for this session. /// /// A list of all authorised payments done for this session. - [JsonPropertyName("payments")] - public List Payments { get { return this.PaymentsOption; } set { this.PaymentsOption = new Option>(value); } } - - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + [DataMember(Name = "payments", EmitDefaultValue = false)] + public List Payments { get; set; } /// /// The unique reference that you provided in the original `/sessions` request. This identifies the payment and is used in all communication with you about the payment status. /// /// The unique reference that you provided in the original `/sessions` request. This identifies the payment and is used in all communication with you about the payment status. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Returns the string presentation of the object @@ -260,156 +147,102 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class SessionResultResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override SessionResultResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option> additionalData = default; - Option id = default; - Option> payments = default; - Option reference = default; - Option status = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "additionalData": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - additionalData = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "id": - id = new Option(utf8JsonReader.GetString()); - break; - case "payments": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - payments = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - case "status": - string statusRawValue = utf8JsonReader.GetString(); - if (statusRawValue != null) - status = new Option(SessionResultResponse.StatusEnumFromStringOrDefault(statusRawValue)); - break; - default: - break; - } - } - } - - if (additionalData.IsSet && additionalData.Value == null) - throw new ArgumentNullException(nameof(additionalData), "Property is not nullable for class SessionResultResponse."); - - if (id.IsSet && id.Value == null) - throw new ArgumentNullException(nameof(id), "Property is not nullable for class SessionResultResponse."); - - if (payments.IsSet && payments.Value == null) - throw new ArgumentNullException(nameof(payments), "Property is not nullable for class SessionResultResponse."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class SessionResultResponse."); - - if (status.IsSet && status.Value == null) - throw new ArgumentNullException(nameof(status), "Property is not nullable for class SessionResultResponse."); - - return new SessionResultResponse(additionalData, id, payments, reference, status); + return this.Equals(input as SessionResultResponse); } /// - /// Serializes a + /// Returns true if SessionResultResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, SessionResultResponse sessionResultResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of SessionResultResponse to be compared + /// Boolean + public bool Equals(SessionResultResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, sessionResultResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + input.AdditionalData != null && + this.AdditionalData.SequenceEqual(input.AdditionalData) + ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Payments == input.Payments || + this.Payments != null && + input.Payments != null && + this.Payments.SequenceEqual(input.Payments) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, SessionResultResponse sessionResultResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (sessionResultResponse.AdditionalDataOption.IsSet && sessionResultResponse.AdditionalData == null) - throw new ArgumentNullException(nameof(sessionResultResponse.AdditionalData), "Property is required for class SessionResultResponse."); - - if (sessionResultResponse.IdOption.IsSet && sessionResultResponse.Id == null) - throw new ArgumentNullException(nameof(sessionResultResponse.Id), "Property is required for class SessionResultResponse."); - - if (sessionResultResponse.PaymentsOption.IsSet && sessionResultResponse.Payments == null) - throw new ArgumentNullException(nameof(sessionResultResponse.Payments), "Property is required for class SessionResultResponse."); - - if (sessionResultResponse.ReferenceOption.IsSet && sessionResultResponse.Reference == null) - throw new ArgumentNullException(nameof(sessionResultResponse.Reference), "Property is required for class SessionResultResponse."); - - if (sessionResultResponse.AdditionalDataOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("additionalData"); - JsonSerializer.Serialize(writer, sessionResultResponse.AdditionalData, jsonSerializerOptions); - } - if (sessionResultResponse.IdOption.IsSet) - writer.WriteString("id", sessionResultResponse.Id); - - if (sessionResultResponse.PaymentsOption.IsSet) - { - writer.WritePropertyName("payments"); - JsonSerializer.Serialize(writer, sessionResultResponse.Payments, jsonSerializerOptions); + int hashCode = 41; + if (this.AdditionalData != null) + { + hashCode = (hashCode * 59) + this.AdditionalData.GetHashCode(); + } + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Payments != null) + { + hashCode = (hashCode * 59) + this.Payments.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + return hashCode; } - if (sessionResultResponse.ReferenceOption.IsSet) - writer.WriteString("reference", sessionResultResponse.Reference); - - var statusRawValue = SessionResultResponse.StatusEnumToJsonValue(sessionResultResponse.StatusOption.Value.Value); - writer.WriteString("status", statusRawValue); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/ShopperInteractionDevice.cs b/Adyen/Model/Checkout/ShopperInteractionDevice.cs index 41dcf3e94..7a43e370e 100644 --- a/Adyen/Model/Checkout/ShopperInteractionDevice.cs +++ b/Adyen/Model/Checkout/ShopperInteractionDevice.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,78 +15,56 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ShopperInteractionDevice /// - public partial class ShopperInteractionDevice : IValidatableObject + [DataContract(Name = "ShopperInteractionDevice")] + public partial class ShopperInteractionDevice : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Locale on the shopper interaction device. - /// Operating system running on the shopper interaction device. - /// Version of the operating system on the shopper interaction device. - [JsonConstructor] - public ShopperInteractionDevice(Option locale = default, Option os = default, Option osVersion = default) + /// Locale on the shopper interaction device.. + /// Operating system running on the shopper interaction device.. + /// Version of the operating system on the shopper interaction device.. + public ShopperInteractionDevice(string locale = default(string), string os = default(string), string osVersion = default(string)) { - LocaleOption = locale; - OsOption = os; - OsVersionOption = osVersion; - OnCreated(); + this.Locale = locale; + this.Os = os; + this.OsVersion = osVersion; } - partial void OnCreated(); - - /// - /// Used to track the state of Locale - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LocaleOption { get; private set; } - /// /// Locale on the shopper interaction device. /// /// Locale on the shopper interaction device. - [JsonPropertyName("locale")] - public string Locale { get { return this.LocaleOption; } set { this.LocaleOption = new Option(value); } } - - /// - /// Used to track the state of Os - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OsOption { get; private set; } + [DataMember(Name = "locale", EmitDefaultValue = false)] + public string Locale { get; set; } /// /// Operating system running on the shopper interaction device. /// /// Operating system running on the shopper interaction device. - [JsonPropertyName("os")] - public string Os { get { return this.OsOption; } set { this.OsOption = new Option(value); } } - - /// - /// Used to track the state of OsVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OsVersionOption { get; private set; } + [DataMember(Name = "os", EmitDefaultValue = false)] + public string Os { get; set; } /// /// Version of the operating system on the shopper interaction device. /// /// Version of the operating system on the shopper interaction device. - [JsonPropertyName("osVersion")] - public string OsVersion { get { return this.OsVersionOption; } set { this.OsVersionOption = new Option(value); } } + [DataMember(Name = "osVersion", EmitDefaultValue = false)] + public string OsVersion { get; set; } /// /// Returns the string presentation of the object @@ -103,125 +82,86 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ShopperInteractionDeviceJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ShopperInteractionDevice Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option locale = default; - Option os = default; - Option osVersion = default; + return this.Equals(input as ShopperInteractionDevice); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ShopperInteractionDevice instances are equal + /// + /// Instance of ShopperInteractionDevice to be compared + /// Boolean + public bool Equals(ShopperInteractionDevice input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "locale": - locale = new Option(utf8JsonReader.GetString()); - break; - case "os": - os = new Option(utf8JsonReader.GetString()); - break; - case "osVersion": - osVersion = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (locale.IsSet && locale.Value == null) - throw new ArgumentNullException(nameof(locale), "Property is not nullable for class ShopperInteractionDevice."); - - if (os.IsSet && os.Value == null) - throw new ArgumentNullException(nameof(os), "Property is not nullable for class ShopperInteractionDevice."); - - if (osVersion.IsSet && osVersion.Value == null) - throw new ArgumentNullException(nameof(osVersion), "Property is not nullable for class ShopperInteractionDevice."); - - return new ShopperInteractionDevice(locale, os, osVersion); + return + ( + this.Locale == input.Locale || + (this.Locale != null && + this.Locale.Equals(input.Locale)) + ) && + ( + this.Os == input.Os || + (this.Os != null && + this.Os.Equals(input.Os)) + ) && + ( + this.OsVersion == input.OsVersion || + (this.OsVersion != null && + this.OsVersion.Equals(input.OsVersion)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ShopperInteractionDevice shopperInteractionDevice, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, shopperInteractionDevice, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Locale != null) + { + hashCode = (hashCode * 59) + this.Locale.GetHashCode(); + } + if (this.Os != null) + { + hashCode = (hashCode * 59) + this.Os.GetHashCode(); + } + if (this.OsVersion != null) + { + hashCode = (hashCode * 59) + this.OsVersion.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ShopperInteractionDevice shopperInteractionDevice, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (shopperInteractionDevice.LocaleOption.IsSet && shopperInteractionDevice.Locale == null) - throw new ArgumentNullException(nameof(shopperInteractionDevice.Locale), "Property is required for class ShopperInteractionDevice."); - - if (shopperInteractionDevice.OsOption.IsSet && shopperInteractionDevice.Os == null) - throw new ArgumentNullException(nameof(shopperInteractionDevice.Os), "Property is required for class ShopperInteractionDevice."); - - if (shopperInteractionDevice.OsVersionOption.IsSet && shopperInteractionDevice.OsVersion == null) - throw new ArgumentNullException(nameof(shopperInteractionDevice.OsVersion), "Property is required for class ShopperInteractionDevice."); - - if (shopperInteractionDevice.LocaleOption.IsSet) - writer.WriteString("locale", shopperInteractionDevice.Locale); - - if (shopperInteractionDevice.OsOption.IsSet) - writer.WriteString("os", shopperInteractionDevice.Os); - - if (shopperInteractionDevice.OsVersionOption.IsSet) - writer.WriteString("osVersion", shopperInteractionDevice.OsVersion); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Split.cs b/Adyen/Model/Checkout/Split.cs index f039c5a6e..77a2a02b3 100644 --- a/Adyen/Model/Checkout/Split.cs +++ b/Adyen/Model/Checkout/Split.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,365 +15,183 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Split /// - public partial class Split : IValidatableObject + [DataContract(Name = "Split")] + public partial class Split : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. - /// The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/classic-platforms): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. - /// amount - /// Your description for the split item. - /// Your unique reference for the part of the payment booked to the specified `account`. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/classic-platforms)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/adyen-for-platforms-model)). For the other types, we also recommend providing a **unique** reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. - [JsonConstructor] - public Split(TypeEnum type, Option account = default, Option amount = default, Option description = default, Option reference = default) - { - Type = type; - AccountOption = account; - AmountOption = amount; - DescriptionOption = description; - ReferenceOption = reference; - OnCreated(); - } - - partial void OnCreated(); - /// /// The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. /// /// The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum AcquiringFees for value: AcquiringFees /// + [EnumMember(Value = "AcquiringFees")] AcquiringFees = 1, /// /// Enum AdyenCommission for value: AdyenCommission /// + [EnumMember(Value = "AdyenCommission")] AdyenCommission = 2, /// /// Enum AdyenFees for value: AdyenFees /// + [EnumMember(Value = "AdyenFees")] AdyenFees = 3, /// /// Enum AdyenMarkup for value: AdyenMarkup /// + [EnumMember(Value = "AdyenMarkup")] AdyenMarkup = 4, /// /// Enum BalanceAccount for value: BalanceAccount /// + [EnumMember(Value = "BalanceAccount")] BalanceAccount = 5, /// /// Enum Commission for value: Commission /// + [EnumMember(Value = "Commission")] Commission = 6, /// /// Enum Default for value: Default /// + [EnumMember(Value = "Default")] Default = 7, /// /// Enum Interchange for value: Interchange /// + [EnumMember(Value = "Interchange")] Interchange = 8, /// /// Enum MarketPlace for value: MarketPlace /// + [EnumMember(Value = "MarketPlace")] MarketPlace = 9, /// /// Enum PaymentFee for value: PaymentFee /// + [EnumMember(Value = "PaymentFee")] PaymentFee = 10, /// /// Enum Remainder for value: Remainder /// + [EnumMember(Value = "Remainder")] Remainder = 11, /// /// Enum SchemeFee for value: SchemeFee /// + [EnumMember(Value = "SchemeFee")] SchemeFee = 12, /// /// Enum Surcharge for value: Surcharge /// + [EnumMember(Value = "Surcharge")] Surcharge = 13, /// /// Enum Tip for value: Tip /// + [EnumMember(Value = "Tip")] Tip = 14, /// /// Enum TopUp for value: TopUp /// + [EnumMember(Value = "TopUp")] TopUp = 15, /// /// Enum VAT for value: VAT /// + [EnumMember(Value = "VAT")] VAT = 16 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("AcquiringFees")) - return TypeEnum.AcquiringFees; - - if (value.Equals("AdyenCommission")) - return TypeEnum.AdyenCommission; - - if (value.Equals("AdyenFees")) - return TypeEnum.AdyenFees; - - if (value.Equals("AdyenMarkup")) - return TypeEnum.AdyenMarkup; - - if (value.Equals("BalanceAccount")) - return TypeEnum.BalanceAccount; - - if (value.Equals("Commission")) - return TypeEnum.Commission; - - if (value.Equals("Default")) - return TypeEnum.Default; - if (value.Equals("Interchange")) - return TypeEnum.Interchange; - - if (value.Equals("MarketPlace")) - return TypeEnum.MarketPlace; - - if (value.Equals("PaymentFee")) - return TypeEnum.PaymentFee; - - if (value.Equals("Remainder")) - return TypeEnum.Remainder; - - if (value.Equals("SchemeFee")) - return TypeEnum.SchemeFee; - - if (value.Equals("Surcharge")) - return TypeEnum.Surcharge; - - if (value.Equals("Tip")) - return TypeEnum.Tip; - - if (value.Equals("TopUp")) - return TypeEnum.TopUp; - - if (value.Equals("VAT")) - return TypeEnum.VAT; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("AcquiringFees")) - return TypeEnum.AcquiringFees; - - if (value.Equals("AdyenCommission")) - return TypeEnum.AdyenCommission; - - if (value.Equals("AdyenFees")) - return TypeEnum.AdyenFees; - - if (value.Equals("AdyenMarkup")) - return TypeEnum.AdyenMarkup; - - if (value.Equals("BalanceAccount")) - return TypeEnum.BalanceAccount; - - if (value.Equals("Commission")) - return TypeEnum.Commission; - - if (value.Equals("Default")) - return TypeEnum.Default; - - if (value.Equals("Interchange")) - return TypeEnum.Interchange; - - if (value.Equals("MarketPlace")) - return TypeEnum.MarketPlace; - - if (value.Equals("PaymentFee")) - return TypeEnum.PaymentFee; - - if (value.Equals("Remainder")) - return TypeEnum.Remainder; - - if (value.Equals("SchemeFee")) - return TypeEnum.SchemeFee; - - if (value.Equals("Surcharge")) - return TypeEnum.Surcharge; - - if (value.Equals("Tip")) - return TypeEnum.Tip; - - if (value.Equals("TopUp")) - return TypeEnum.TopUp; - - if (value.Equals("VAT")) - return TypeEnum.VAT; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.AcquiringFees) - return "AcquiringFees"; - - if (value == TypeEnum.AdyenCommission) - return "AdyenCommission"; - - if (value == TypeEnum.AdyenFees) - return "AdyenFees"; - - if (value == TypeEnum.AdyenMarkup) - return "AdyenMarkup"; - - if (value == TypeEnum.BalanceAccount) - return "BalanceAccount"; - - if (value == TypeEnum.Commission) - return "Commission"; - - if (value == TypeEnum.Default) - return "Default"; - - if (value == TypeEnum.Interchange) - return "Interchange"; - - if (value == TypeEnum.MarketPlace) - return "MarketPlace"; - - if (value == TypeEnum.PaymentFee) - return "PaymentFee"; - - if (value == TypeEnum.Remainder) - return "Remainder"; - - if (value == TypeEnum.SchemeFee) - return "SchemeFee"; - - if (value == TypeEnum.Surcharge) - return "Surcharge"; - - if (value == TypeEnum.Tip) - return "Tip"; - - if (value == TypeEnum.TopUp) - return "TopUp"; - - if (value == TypeEnum.VAT) - return "VAT"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. /// /// The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of Account + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AccountOption { get; private set; } - + [JsonConstructorAttribute] + protected Split() { } /// - /// The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/classic-platforms): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. + /// Initializes a new instance of the class. /// - /// The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/classic-platforms): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. - [JsonPropertyName("account")] - public string Account { get { return this.AccountOption; } set { this.AccountOption = new Option(value); } } + /// The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/classic-platforms): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked.. + /// amount. + /// Your description for the split item.. + /// Your unique reference for the part of the payment booked to the specified `account`. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/classic-platforms)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/adyen-for-platforms-model)). For the other types, we also recommend providing a **unique** reference so you can reconcile the split and the associated payment in the transaction overview and in the reports.. + /// The part of the payment you want to book to the specified `account`. Possible values for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books part of the payment (specified in `amount`) to the specified `account`. * Transaction fees types that you can book to the specified `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the transaction fees due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the transaction fees due to Adyen under [Interchange ++ pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: your platform's commission on the payment (specified in `amount`), booked to your liable balance account. * **Remainder**: the amount left over after a currency conversion, booked to the specified `account`. * **TopUp**: allows you and your users to top up balance accounts using direct debit, card payments, or other payment methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms liable balance account. * **Commission**: your platform's commission (specified in `amount`) on the payment, booked to your liable balance account. * **Default**: in very specific use cases, allows you to book the specified `amount` to the specified `account`. For more information, contact Adyen support. Possible values for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. (required). + public Split(string account = default(string), SplitAmount amount = default(SplitAmount), string description = default(string), string reference = default(string), TypeEnum type = default(TypeEnum)) + { + this.Type = type; + this.Account = account; + this.Amount = amount; + this.Description = description; + this.Reference = reference; + } /// - /// Used to track the state of Amount + /// The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/classic-platforms): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountOption { get; private set; } + /// The unique identifier of the account to which the split amount is booked. Required if `type` is **MarketPlace** or **BalanceAccount**. * [Classic Platforms integration](https://docs.adyen.com/classic-platforms): The [`accountCode`](https://docs.adyen.com/api-explorer/Account/latest/post/updateAccount#request-accountCode) of the account to which the split amount is booked. * [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): The [`balanceAccountId`](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/balanceAccounts/_id_#path-id) of the account to which the split amount is booked. + [DataMember(Name = "account", EmitDefaultValue = false)] + public string Account { get; set; } /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] - public SplitAmount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } - - /// - /// Used to track the state of Description - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DescriptionOption { get; private set; } + [DataMember(Name = "amount", EmitDefaultValue = false)] + public SplitAmount Amount { get; set; } /// /// Your description for the split item. /// /// Your description for the split item. - [JsonPropertyName("description")] - public string Description { get { return this.DescriptionOption; } set { this.DescriptionOption = new Option(value); } } - - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } /// /// Your unique reference for the part of the payment booked to the specified `account`. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/classic-platforms)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/adyen-for-platforms-model)). For the other types, we also recommend providing a **unique** reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. /// /// Your unique reference for the part of the payment booked to the specified `account`. This is required if `type` is **MarketPlace** ([Classic Platforms integration](https://docs.adyen.com/classic-platforms)) or **BalanceAccount** ([Balance Platform](https://docs.adyen.com/adyen-for-platforms-model)). For the other types, we also recommend providing a **unique** reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Returns the string presentation of the object @@ -382,165 +201,110 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class Split {\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Account: ").Append(Account).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" Description: ").Append(Description).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class SplitJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Split Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option type = default; - Option account = default; - Option amount = default; - Option description = default; - Option reference = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(Split.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "account": - account = new Option(utf8JsonReader.GetString()); - break; - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "description": - description = new Option(utf8JsonReader.GetString()); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class Split.", nameof(type)); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class Split."); - - if (account.IsSet && account.Value == null) - throw new ArgumentNullException(nameof(account), "Property is not nullable for class Split."); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class Split."); - - if (description.IsSet && description.Value == null) - throw new ArgumentNullException(nameof(description), "Property is not nullable for class Split."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class Split."); - - return new Split(type.Value.Value, account, amount, description, reference); + return this.Equals(input as Split); } /// - /// Serializes a + /// Returns true if Split instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Split split, JsonSerializerOptions jsonSerializerOptions) + /// Instance of Split to be compared + /// Boolean + public bool Equals(Split input) { - writer.WriteStartObject(); - - WriteProperties(writer, split, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Account == input.Account || + (this.Account != null && + this.Account.Equals(input.Account)) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.Description == input.Description || + (this.Description != null && + this.Description.Equals(input.Description)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Split split, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (split.AccountOption.IsSet && split.Account == null) - throw new ArgumentNullException(nameof(split.Account), "Property is required for class Split."); - - if (split.AmountOption.IsSet && split.Amount == null) - throw new ArgumentNullException(nameof(split.Amount), "Property is required for class Split."); - - if (split.DescriptionOption.IsSet && split.Description == null) - throw new ArgumentNullException(nameof(split.Description), "Property is required for class Split."); - - if (split.ReferenceOption.IsSet && split.Reference == null) - throw new ArgumentNullException(nameof(split.Reference), "Property is required for class Split."); - - var typeRawValue = Split.TypeEnumToJsonValue(split.Type); - writer.WriteString("type", typeRawValue); - if (split.AccountOption.IsSet) - writer.WriteString("account", split.Account); - - if (split.AmountOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, split.Amount, jsonSerializerOptions); + int hashCode = 41; + if (this.Account != null) + { + hashCode = (hashCode * 59) + this.Account.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.Description != null) + { + hashCode = (hashCode * 59) + this.Description.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; } - if (split.DescriptionOption.IsSet) - writer.WriteString("description", split.Description); - - if (split.ReferenceOption.IsSet) - writer.WriteString("reference", split.Reference); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/SplitAmount.cs b/Adyen/Model/Checkout/SplitAmount.cs index cc47d74f7..667576485 100644 --- a/Adyen/Model/Checkout/SplitAmount.cs +++ b/Adyen/Model/Checkout/SplitAmount.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,55 +15,52 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// SplitAmount /// - public partial class SplitAmount : IValidatableObject + [DataContract(Name = "SplitAmount")] + public partial class SplitAmount : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. - [JsonConstructor] - public SplitAmount(long value, Option currency = default) - { - Value = value; - CurrencyOption = currency; - OnCreated(); - } - - partial void OnCreated(); - + [JsonConstructorAttribute] + protected SplitAmount() { } /// - /// The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + /// Initializes a new instance of the class. /// - /// The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). - [JsonPropertyName("value")] - public long Value { get; set; } + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency.. + /// The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). (required). + public SplitAmount(string currency = default(string), long? value = default(long?)) + { + this.Value = value; + this.Currency = currency; + } /// - /// Used to track the state of Currency + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CurrencyOption { get; private set; } + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. + [DataMember(Name = "currency", EmitDefaultValue = false)] + public string Currency { get; set; } /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. + /// The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). /// - /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). By default, this is the original payment currency. - [JsonPropertyName("currency")] - public string Currency { get { return this.CurrencyOption; } set { this.CurrencyOption = new Option(value); } } + /// The value of the split amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] + public long? Value { get; set; } /// /// Returns the string presentation of the object @@ -72,131 +70,92 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class SplitAmount {\n"); - sb.Append(" Value: ").Append(Value).Append("\n"); sb.Append(" Currency: ").Append(Currency).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // Currency (string) maxLength - if (this.Currency != null && this.Currency.Length > 3) - { - yield return new ValidationResult("Invalid value for Currency, length must be less than 3.", new [] { "Currency" }); - } - - // Currency (string) minLength - if (this.Currency != null && this.Currency.Length < 3) - { - yield return new ValidationResult("Invalid value for Currency, length must be greater than 3.", new [] { "Currency" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class SplitAmountJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override SplitAmount Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option value = default; - Option currency = default; + return this.Equals(input as SplitAmount); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if SplitAmount instances are equal + /// + /// Instance of SplitAmount to be compared + /// Boolean + public bool Equals(SplitAmount input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "value": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - value = new Option(utf8JsonReader.GetInt64()); - break; - case "currency": - currency = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!value.IsSet) - throw new ArgumentException("Property is required for class SplitAmount.", nameof(value)); - - if (value.IsSet && value.Value == null) - throw new ArgumentNullException(nameof(value), "Property is not nullable for class SplitAmount."); - - if (currency.IsSet && currency.Value == null) - throw new ArgumentNullException(nameof(currency), "Property is not nullable for class SplitAmount."); - - return new SplitAmount(value.Value.Value, currency); + return + ( + this.Currency == input.Currency || + (this.Currency != null && + this.Currency.Equals(input.Currency)) + ) && + ( + this.Value == input.Value || + this.Value.Equals(input.Value) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, SplitAmount splitAmount, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, splitAmount, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Currency != null) + { + hashCode = (hashCode * 59) + this.Currency.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, SplitAmount splitAmount, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (splitAmount.CurrencyOption.IsSet && splitAmount.Currency == null) - throw new ArgumentNullException(nameof(splitAmount.Currency), "Property is required for class SplitAmount."); + // Currency (string) maxLength + if (this.Currency != null && this.Currency.Length > 3) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Currency, length must be less than 3.", new [] { "Currency" }); + } - writer.WriteNumber("value", splitAmount.Value); + // Currency (string) minLength + if (this.Currency != null && this.Currency.Length < 3) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Currency, length must be greater than 3.", new [] { "Currency" }); + } - if (splitAmount.CurrencyOption.IsSet) - writer.WriteString("currency", splitAmount.Currency); + yield break; } } + } diff --git a/Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs b/Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs index fed296283..0f75335d7 100644 --- a/Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs +++ b/Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,79 +15,77 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// StandalonePaymentCancelRequest /// - public partial class StandalonePaymentCancelRequest : IValidatableObject + [DataContract(Name = "StandalonePaymentCancelRequest")] + public partial class StandalonePaymentCancelRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The merchant account that is used to process the payment. - /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment that you want to cancel. - /// applicationInfo - /// Your reference for the cancel request. Maximum length: 80 characters. - [JsonConstructor] - public StandalonePaymentCancelRequest(string merchantAccount, string paymentReference, Option applicationInfo = default, Option reference = default) + [JsonConstructorAttribute] + protected StandalonePaymentCancelRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// applicationInfo. + /// enhancedSchemeData. + /// The merchant account that is used to process the payment. (required). + /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment that you want to cancel. (required). + /// Your reference for the cancel request. Maximum length: 80 characters.. + public StandalonePaymentCancelRequest(ApplicationInfo applicationInfo = default(ApplicationInfo), EnhancedSchemeData enhancedSchemeData = default(EnhancedSchemeData), string merchantAccount = default(string), string paymentReference = default(string), string reference = default(string)) { - MerchantAccount = merchantAccount; - PaymentReference = paymentReference; - ApplicationInfoOption = applicationInfo; - ReferenceOption = reference; - OnCreated(); + this.MerchantAccount = merchantAccount; + this.PaymentReference = paymentReference; + this.ApplicationInfo = applicationInfo; + this.EnhancedSchemeData = enhancedSchemeData; + this.Reference = reference; } - partial void OnCreated(); + /// + /// Gets or Sets ApplicationInfo + /// + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } + + /// + /// Gets or Sets EnhancedSchemeData + /// + [DataMember(Name = "enhancedSchemeData", EmitDefaultValue = false)] + public EnhancedSchemeData EnhancedSchemeData { get; set; } /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [JsonPropertyName("merchantAccount")] + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] public string MerchantAccount { get; set; } /// /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment that you want to cancel. /// /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment that you want to cancel. - [JsonPropertyName("paymentReference")] + [DataMember(Name = "paymentReference", IsRequired = false, EmitDefaultValue = false)] public string PaymentReference { get; set; } - /// - /// Used to track the state of ApplicationInfo - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ApplicationInfoOption { get; private set; } - - /// - /// Gets or Sets ApplicationInfo - /// - [JsonPropertyName("applicationInfo")] - public ApplicationInfo ApplicationInfo { get { return this.ApplicationInfoOption; } set { this.ApplicationInfoOption = new Option(value); } } - - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } - /// /// Your reference for the cancel request. Maximum length: 80 characters. /// /// Your reference for the cancel request. Maximum length: 80 characters. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Returns the string presentation of the object @@ -96,154 +95,114 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class StandalonePaymentCancelRequest {\n"); + sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); + sb.Append(" EnhancedSchemeData: ").Append(EnhancedSchemeData).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentReference: ").Append(PaymentReference).Append("\n"); - sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class StandalonePaymentCancelRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override StandalonePaymentCancelRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option merchantAccount = default; - Option paymentReference = default; - Option applicationInfo = default; - Option reference = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "paymentReference": - paymentReference = new Option(utf8JsonReader.GetString()); - break; - case "applicationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - applicationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class StandalonePaymentCancelRequest.", nameof(merchantAccount)); - - if (!paymentReference.IsSet) - throw new ArgumentException("Property is required for class StandalonePaymentCancelRequest.", nameof(paymentReference)); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class StandalonePaymentCancelRequest."); - - if (paymentReference.IsSet && paymentReference.Value == null) - throw new ArgumentNullException(nameof(paymentReference), "Property is not nullable for class StandalonePaymentCancelRequest."); - - if (applicationInfo.IsSet && applicationInfo.Value == null) - throw new ArgumentNullException(nameof(applicationInfo), "Property is not nullable for class StandalonePaymentCancelRequest."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class StandalonePaymentCancelRequest."); - - return new StandalonePaymentCancelRequest(merchantAccount.Value, paymentReference.Value, applicationInfo, reference); + return this.Equals(input as StandalonePaymentCancelRequest); } /// - /// Serializes a + /// Returns true if StandalonePaymentCancelRequest instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, StandalonePaymentCancelRequest standalonePaymentCancelRequest, JsonSerializerOptions jsonSerializerOptions) + /// Instance of StandalonePaymentCancelRequest to be compared + /// Boolean + public bool Equals(StandalonePaymentCancelRequest input) { - writer.WriteStartObject(); - - WriteProperties(writer, standalonePaymentCancelRequest, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.ApplicationInfo == input.ApplicationInfo || + (this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo)) + ) && + ( + this.EnhancedSchemeData == input.EnhancedSchemeData || + (this.EnhancedSchemeData != null && + this.EnhancedSchemeData.Equals(input.EnhancedSchemeData)) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.PaymentReference == input.PaymentReference || + (this.PaymentReference != null && + this.PaymentReference.Equals(input.PaymentReference)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, StandalonePaymentCancelRequest standalonePaymentCancelRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (standalonePaymentCancelRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(standalonePaymentCancelRequest.MerchantAccount), "Property is required for class StandalonePaymentCancelRequest."); - - if (standalonePaymentCancelRequest.PaymentReference == null) - throw new ArgumentNullException(nameof(standalonePaymentCancelRequest.PaymentReference), "Property is required for class StandalonePaymentCancelRequest."); - - if (standalonePaymentCancelRequest.ApplicationInfoOption.IsSet && standalonePaymentCancelRequest.ApplicationInfo == null) - throw new ArgumentNullException(nameof(standalonePaymentCancelRequest.ApplicationInfo), "Property is required for class StandalonePaymentCancelRequest."); - - if (standalonePaymentCancelRequest.ReferenceOption.IsSet && standalonePaymentCancelRequest.Reference == null) - throw new ArgumentNullException(nameof(standalonePaymentCancelRequest.Reference), "Property is required for class StandalonePaymentCancelRequest."); - - writer.WriteString("merchantAccount", standalonePaymentCancelRequest.MerchantAccount); - - writer.WriteString("paymentReference", standalonePaymentCancelRequest.PaymentReference); - - if (standalonePaymentCancelRequest.ApplicationInfoOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("applicationInfo"); - JsonSerializer.Serialize(writer, standalonePaymentCancelRequest.ApplicationInfo, jsonSerializerOptions); + int hashCode = 41; + if (this.ApplicationInfo != null) + { + hashCode = (hashCode * 59) + this.ApplicationInfo.GetHashCode(); + } + if (this.EnhancedSchemeData != null) + { + hashCode = (hashCode * 59) + this.EnhancedSchemeData.GetHashCode(); + } + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.PaymentReference != null) + { + hashCode = (hashCode * 59) + this.PaymentReference.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + return hashCode; } - if (standalonePaymentCancelRequest.ReferenceOption.IsSet) - writer.WriteString("reference", standalonePaymentCancelRequest.Reference); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs b/Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs index 4be9e0cd2..bc43a844c 100644 --- a/Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs +++ b/Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,135 +15,94 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// StandalonePaymentCancelResponse /// - public partial class StandalonePaymentCancelResponse : IValidatableObject + [DataContract(Name = "StandalonePaymentCancelResponse")] + public partial class StandalonePaymentCancelResponse : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The merchant account that is used to process the payment. - /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment to cancel. - /// Adyen's 16-character reference associated with the cancel request. - /// The status of your request. This will always have the value **received**. - /// Your reference for the cancel request. - [JsonConstructor] - public StandalonePaymentCancelResponse(string merchantAccount, string paymentReference, string pspReference, StatusEnum status, Option reference = default) - { - MerchantAccount = merchantAccount; - PaymentReference = paymentReference; - PspReference = pspReference; - Status = status; - ReferenceOption = reference; - OnCreated(); - } - - partial void OnCreated(); - /// /// The status of your request. This will always have the value **received**. /// /// The status of your request. This will always have the value **received**. + [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Received for value: received /// + [EnumMember(Value = "received")] Received = 1 + } + /// - /// Returns a + /// The status of your request. This will always have the value **received**. /// - /// - /// - /// - public static StatusEnum StatusEnumFromString(string value) - { - if (value.Equals("received")) - return StatusEnum.Received; - - throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); - } - + /// The status of your request. This will always have the value **received**. + [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] + public StatusEnum Status { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static StatusEnum? StatusEnumFromStringOrDefault(string value) - { - if (value.Equals("received")) - return StatusEnum.Received; - - return null; - } - + [JsonConstructorAttribute] + protected StandalonePaymentCancelResponse() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string StatusEnumToJsonValue(StatusEnum value) + /// The merchant account that is used to process the payment. (required). + /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment to cancel. (required). + /// Adyen's 16-character reference associated with the cancel request. (required). + /// Your reference for the cancel request.. + /// The status of your request. This will always have the value **received**. (required). + public StandalonePaymentCancelResponse(string merchantAccount = default(string), string paymentReference = default(string), string pspReference = default(string), string reference = default(string), StatusEnum status = default(StatusEnum)) { - if (value == StatusEnum.Received) - return "received"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.MerchantAccount = merchantAccount; + this.PaymentReference = paymentReference; + this.PspReference = pspReference; + this.Status = status; + this.Reference = reference; } - /// - /// The status of your request. This will always have the value **received**. - /// - /// The status of your request. This will always have the value **received**. - [JsonPropertyName("status")] - public StatusEnum Status { get; set; } - /// /// The merchant account that is used to process the payment. /// /// The merchant account that is used to process the payment. - [JsonPropertyName("merchantAccount")] + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] public string MerchantAccount { get; set; } /// /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment to cancel. /// /// The [`reference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_reference) of the payment to cancel. - [JsonPropertyName("paymentReference")] + [DataMember(Name = "paymentReference", IsRequired = false, EmitDefaultValue = false)] public string PaymentReference { get; set; } /// /// Adyen's 16-character reference associated with the cancel request. /// /// Adyen's 16-character reference associated with the cancel request. - [JsonPropertyName("pspReference")] + [DataMember(Name = "pspReference", IsRequired = false, EmitDefaultValue = false)] public string PspReference { get; set; } - /// - /// Used to track the state of Reference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ReferenceOption { get; private set; } - /// /// Your reference for the cancel request. /// /// Your reference for the cancel request. - [JsonPropertyName("reference")] - public string Reference { get { return this.ReferenceOption; } set { this.ReferenceOption = new Option(value); } } + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } /// /// Returns the string presentation of the object @@ -155,165 +115,107 @@ public override string ToString() sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentReference: ").Append(PaymentReference).Append("\n"); sb.Append(" PspReference: ").Append(PspReference).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class StandalonePaymentCancelResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override StandalonePaymentCancelResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option merchantAccount = default; - Option paymentReference = default; - Option pspReference = default; - Option status = default; - Option reference = default; + return this.Equals(input as StandalonePaymentCancelResponse); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if StandalonePaymentCancelResponse instances are equal + /// + /// Instance of StandalonePaymentCancelResponse to be compared + /// Boolean + public bool Equals(StandalonePaymentCancelResponse input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "paymentReference": - paymentReference = new Option(utf8JsonReader.GetString()); - break; - case "pspReference": - pspReference = new Option(utf8JsonReader.GetString()); - break; - case "status": - string statusRawValue = utf8JsonReader.GetString(); - if (statusRawValue != null) - status = new Option(StandalonePaymentCancelResponse.StatusEnumFromStringOrDefault(statusRawValue)); - break; - case "reference": - reference = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class StandalonePaymentCancelResponse.", nameof(merchantAccount)); - - if (!paymentReference.IsSet) - throw new ArgumentException("Property is required for class StandalonePaymentCancelResponse.", nameof(paymentReference)); - - if (!pspReference.IsSet) - throw new ArgumentException("Property is required for class StandalonePaymentCancelResponse.", nameof(pspReference)); - - if (!status.IsSet) - throw new ArgumentException("Property is required for class StandalonePaymentCancelResponse.", nameof(status)); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class StandalonePaymentCancelResponse."); - - if (paymentReference.IsSet && paymentReference.Value == null) - throw new ArgumentNullException(nameof(paymentReference), "Property is not nullable for class StandalonePaymentCancelResponse."); - - if (pspReference.IsSet && pspReference.Value == null) - throw new ArgumentNullException(nameof(pspReference), "Property is not nullable for class StandalonePaymentCancelResponse."); - - if (status.IsSet && status.Value == null) - throw new ArgumentNullException(nameof(status), "Property is not nullable for class StandalonePaymentCancelResponse."); - - if (reference.IsSet && reference.Value == null) - throw new ArgumentNullException(nameof(reference), "Property is not nullable for class StandalonePaymentCancelResponse."); - - return new StandalonePaymentCancelResponse(merchantAccount.Value, paymentReference.Value, pspReference.Value, status.Value.Value, reference); + return + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.PaymentReference == input.PaymentReference || + (this.PaymentReference != null && + this.PaymentReference.Equals(input.PaymentReference)) + ) && + ( + this.PspReference == input.PspReference || + (this.PspReference != null && + this.PspReference.Equals(input.PspReference)) + ) && + ( + this.Reference == input.Reference || + (this.Reference != null && + this.Reference.Equals(input.Reference)) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, StandalonePaymentCancelResponse standalonePaymentCancelResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, standalonePaymentCancelResponse, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.PaymentReference != null) + { + hashCode = (hashCode * 59) + this.PaymentReference.GetHashCode(); + } + if (this.PspReference != null) + { + hashCode = (hashCode * 59) + this.PspReference.GetHashCode(); + } + if (this.Reference != null) + { + hashCode = (hashCode * 59) + this.Reference.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, StandalonePaymentCancelResponse standalonePaymentCancelResponse, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (standalonePaymentCancelResponse.MerchantAccount == null) - throw new ArgumentNullException(nameof(standalonePaymentCancelResponse.MerchantAccount), "Property is required for class StandalonePaymentCancelResponse."); - - if (standalonePaymentCancelResponse.PaymentReference == null) - throw new ArgumentNullException(nameof(standalonePaymentCancelResponse.PaymentReference), "Property is required for class StandalonePaymentCancelResponse."); - - if (standalonePaymentCancelResponse.PspReference == null) - throw new ArgumentNullException(nameof(standalonePaymentCancelResponse.PspReference), "Property is required for class StandalonePaymentCancelResponse."); - - if (standalonePaymentCancelResponse.ReferenceOption.IsSet && standalonePaymentCancelResponse.Reference == null) - throw new ArgumentNullException(nameof(standalonePaymentCancelResponse.Reference), "Property is required for class StandalonePaymentCancelResponse."); - - writer.WriteString("merchantAccount", standalonePaymentCancelResponse.MerchantAccount); - - writer.WriteString("paymentReference", standalonePaymentCancelResponse.PaymentReference); - - writer.WriteString("pspReference", standalonePaymentCancelResponse.PspReference); - - var statusRawValue = StandalonePaymentCancelResponse.StatusEnumToJsonValue(standalonePaymentCancelResponse.Status); - writer.WriteString("status", statusRawValue); - if (standalonePaymentCancelResponse.ReferenceOption.IsSet) - writer.WriteString("reference", standalonePaymentCancelResponse.Reference); + yield break; } } + } diff --git a/Adyen/Model/Checkout/StoredPaymentMethod.cs b/Adyen/Model/Checkout/StoredPaymentMethod.cs index 9206d84d9..eee217536 100644 --- a/Adyen/Model/Checkout/StoredPaymentMethod.cs +++ b/Adyen/Model/Checkout/StoredPaymentMethod.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,302 +15,182 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// StoredPaymentMethod /// - public partial class StoredPaymentMethod : IValidatableObject + [DataContract(Name = "StoredPaymentMethod")] + public partial class StoredPaymentMethod : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The bank account number (without separators). - /// The location id of the bank. The field value is `nil` in most cases. - /// The brand of the card. - /// The two-digit month when the card expires - /// The last two digits of the year the card expires. For example, **22** for the year 2022. - /// The unique payment method code. - /// The IBAN of the bank account. - /// A unique identifier of this stored payment method. - /// The shopper’s issuer account label - /// The last four digits of the PAN. - /// The display name of the stored payment method. - /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. - /// The name of the bank account holder. - /// The shopper’s email address. - /// The supported recurring processing models for this stored payment method. - /// The supported shopper interactions for this stored payment method. - /// The type of payment method. - [JsonConstructor] - public StoredPaymentMethod(Option bankAccountNumber = default, Option bankLocationId = default, Option brand = default, Option expiryMonth = default, Option expiryYear = default, Option holderName = default, Option iban = default, Option id = default, Option label = default, Option lastFour = default, Option name = default, Option networkTxReference = default, Option ownerName = default, Option shopperEmail = default, Option> supportedRecurringProcessingModels = default, Option> supportedShopperInteractions = default, Option type = default) + /// The bank account number (without separators).. + /// The location id of the bank. The field value is `nil` in most cases.. + /// The brand of the card.. + /// The two-digit month when the card expires. + /// The last two digits of the year the card expires. For example, **22** for the year 2022.. + /// The unique payment method code.. + /// The IBAN of the bank account.. + /// A unique identifier of this stored payment method.. + /// The shopper’s issuer account label. + /// The last four digits of the PAN.. + /// The display name of the stored payment method.. + /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID.. + /// The name of the bank account holder.. + /// The shopper’s email address.. + /// The supported recurring processing models for this stored payment method.. + /// The supported shopper interactions for this stored payment method.. + /// The type of payment method.. + public StoredPaymentMethod(string bankAccountNumber = default(string), string bankLocationId = default(string), string brand = default(string), string expiryMonth = default(string), string expiryYear = default(string), string holderName = default(string), string iban = default(string), string id = default(string), string label = default(string), string lastFour = default(string), string name = default(string), string networkTxReference = default(string), string ownerName = default(string), string shopperEmail = default(string), List supportedRecurringProcessingModels = default(List), List supportedShopperInteractions = default(List), string type = default(string)) { - BankAccountNumberOption = bankAccountNumber; - BankLocationIdOption = bankLocationId; - BrandOption = brand; - ExpiryMonthOption = expiryMonth; - ExpiryYearOption = expiryYear; - HolderNameOption = holderName; - IbanOption = iban; - IdOption = id; - LabelOption = label; - LastFourOption = lastFour; - NameOption = name; - NetworkTxReferenceOption = networkTxReference; - OwnerNameOption = ownerName; - ShopperEmailOption = shopperEmail; - SupportedRecurringProcessingModelsOption = supportedRecurringProcessingModels; - SupportedShopperInteractionsOption = supportedShopperInteractions; - TypeOption = type; - OnCreated(); + this.BankAccountNumber = bankAccountNumber; + this.BankLocationId = bankLocationId; + this.Brand = brand; + this.ExpiryMonth = expiryMonth; + this.ExpiryYear = expiryYear; + this.HolderName = holderName; + this.Iban = iban; + this.Id = id; + this.Label = label; + this.LastFour = lastFour; + this.Name = name; + this.NetworkTxReference = networkTxReference; + this.OwnerName = ownerName; + this.ShopperEmail = shopperEmail; + this.SupportedRecurringProcessingModels = supportedRecurringProcessingModels; + this.SupportedShopperInteractions = supportedShopperInteractions; + this.Type = type; } - partial void OnCreated(); - - /// - /// Used to track the state of BankAccountNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankAccountNumberOption { get; private set; } - /// /// The bank account number (without separators). /// /// The bank account number (without separators). - [JsonPropertyName("bankAccountNumber")] - public string BankAccountNumber { get { return this.BankAccountNumberOption; } set { this.BankAccountNumberOption = new Option(value); } } - - /// - /// Used to track the state of BankLocationId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BankLocationIdOption { get; private set; } + [DataMember(Name = "bankAccountNumber", EmitDefaultValue = false)] + public string BankAccountNumber { get; set; } /// /// The location id of the bank. The field value is `nil` in most cases. /// /// The location id of the bank. The field value is `nil` in most cases. - [JsonPropertyName("bankLocationId")] - public string BankLocationId { get { return this.BankLocationIdOption; } set { this.BankLocationIdOption = new Option(value); } } - - /// - /// Used to track the state of Brand - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BrandOption { get; private set; } + [DataMember(Name = "bankLocationId", EmitDefaultValue = false)] + public string BankLocationId { get; set; } /// /// The brand of the card. /// /// The brand of the card. - [JsonPropertyName("brand")] - public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } - - /// - /// Used to track the state of ExpiryMonth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiryMonthOption { get; private set; } + [DataMember(Name = "brand", EmitDefaultValue = false)] + public string Brand { get; set; } /// /// The two-digit month when the card expires /// /// The two-digit month when the card expires - [JsonPropertyName("expiryMonth")] - public string ExpiryMonth { get { return this.ExpiryMonthOption; } set { this.ExpiryMonthOption = new Option(value); } } - - /// - /// Used to track the state of ExpiryYear - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiryYearOption { get; private set; } + [DataMember(Name = "expiryMonth", EmitDefaultValue = false)] + public string ExpiryMonth { get; set; } /// /// The last two digits of the year the card expires. For example, **22** for the year 2022. /// /// The last two digits of the year the card expires. For example, **22** for the year 2022. - [JsonPropertyName("expiryYear")] - public string ExpiryYear { get { return this.ExpiryYearOption; } set { this.ExpiryYearOption = new Option(value); } } - - /// - /// Used to track the state of HolderName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option HolderNameOption { get; private set; } + [DataMember(Name = "expiryYear", EmitDefaultValue = false)] + public string ExpiryYear { get; set; } /// /// The unique payment method code. /// /// The unique payment method code. - [JsonPropertyName("holderName")] - public string HolderName { get { return this.HolderNameOption; } set { this.HolderNameOption = new Option(value); } } - - /// - /// Used to track the state of Iban - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IbanOption { get; private set; } + [DataMember(Name = "holderName", EmitDefaultValue = false)] + public string HolderName { get; set; } /// /// The IBAN of the bank account. /// /// The IBAN of the bank account. - [JsonPropertyName("iban")] - public string Iban { get { return this.IbanOption; } set { this.IbanOption = new Option(value); } } - - /// - /// Used to track the state of Id - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IdOption { get; private set; } + [DataMember(Name = "iban", EmitDefaultValue = false)] + public string Iban { get; set; } /// /// A unique identifier of this stored payment method. /// /// A unique identifier of this stored payment method. - [JsonPropertyName("id")] - public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } - - /// - /// Used to track the state of Label - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LabelOption { get; private set; } + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } /// /// The shopper’s issuer account label /// /// The shopper’s issuer account label - [JsonPropertyName("label")] - public string Label { get { return this.LabelOption; } set { this.LabelOption = new Option(value); } } - - /// - /// Used to track the state of LastFour - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LastFourOption { get; private set; } + [DataMember(Name = "label", EmitDefaultValue = false)] + public string Label { get; set; } /// /// The last four digits of the PAN. /// /// The last four digits of the PAN. - [JsonPropertyName("lastFour")] - public string LastFour { get { return this.LastFourOption; } set { this.LastFourOption = new Option(value); } } - - /// - /// Used to track the state of Name - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NameOption { get; private set; } + [DataMember(Name = "lastFour", EmitDefaultValue = false)] + public string LastFour { get; set; } /// /// The display name of the stored payment method. /// /// The display name of the stored payment method. - [JsonPropertyName("name")] - public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } - - /// - /// Used to track the state of NetworkTxReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NetworkTxReferenceOption { get; private set; } + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } /// /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. /// /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. - [JsonPropertyName("networkTxReference")] - public string NetworkTxReference { get { return this.NetworkTxReferenceOption; } set { this.NetworkTxReferenceOption = new Option(value); } } - - /// - /// Used to track the state of OwnerName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OwnerNameOption { get; private set; } + [DataMember(Name = "networkTxReference", EmitDefaultValue = false)] + public string NetworkTxReference { get; set; } /// /// The name of the bank account holder. /// /// The name of the bank account holder. - [JsonPropertyName("ownerName")] - public string OwnerName { get { return this.OwnerNameOption; } set { this.OwnerNameOption = new Option(value); } } - - /// - /// Used to track the state of ShopperEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + [DataMember(Name = "ownerName", EmitDefaultValue = false)] + public string OwnerName { get; set; } /// /// The shopper’s email address. /// /// The shopper’s email address. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } - - /// - /// Used to track the state of SupportedRecurringProcessingModels - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SupportedRecurringProcessingModelsOption { get; private set; } + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// /// The supported recurring processing models for this stored payment method. /// /// The supported recurring processing models for this stored payment method. - [JsonPropertyName("supportedRecurringProcessingModels")] - public List SupportedRecurringProcessingModels { get { return this.SupportedRecurringProcessingModelsOption; } set { this.SupportedRecurringProcessingModelsOption = new Option>(value); } } - - /// - /// Used to track the state of SupportedShopperInteractions - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SupportedShopperInteractionsOption { get; private set; } + [DataMember(Name = "supportedRecurringProcessingModels", EmitDefaultValue = false)] + public List SupportedRecurringProcessingModels { get; set; } /// /// The supported shopper interactions for this stored payment method. /// /// The supported shopper interactions for this stored payment method. - [JsonPropertyName("supportedShopperInteractions")] - public List SupportedShopperInteractions { get { return this.SupportedShopperInteractionsOption; } set { this.SupportedShopperInteractionsOption = new Option>(value); } } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } + [DataMember(Name = "supportedShopperInteractions", EmitDefaultValue = false)] + public List SupportedShopperInteractions { get; set; } /// /// The type of payment method. /// /// The type of payment method. - [JsonPropertyName("type")] - public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } /// /// Returns the string presentation of the object @@ -341,313 +222,214 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class StoredPaymentMethodJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override StoredPaymentMethod Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option bankAccountNumber = default; - Option bankLocationId = default; - Option brand = default; - Option expiryMonth = default; - Option expiryYear = default; - Option holderName = default; - Option iban = default; - Option id = default; - Option label = default; - Option lastFour = default; - Option name = default; - Option networkTxReference = default; - Option ownerName = default; - Option shopperEmail = default; - Option> supportedRecurringProcessingModels = default; - Option> supportedShopperInteractions = default; - Option type = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "bankAccountNumber": - bankAccountNumber = new Option(utf8JsonReader.GetString()); - break; - case "bankLocationId": - bankLocationId = new Option(utf8JsonReader.GetString()); - break; - case "brand": - brand = new Option(utf8JsonReader.GetString()); - break; - case "expiryMonth": - expiryMonth = new Option(utf8JsonReader.GetString()); - break; - case "expiryYear": - expiryYear = new Option(utf8JsonReader.GetString()); - break; - case "holderName": - holderName = new Option(utf8JsonReader.GetString()); - break; - case "iban": - iban = new Option(utf8JsonReader.GetString()); - break; - case "id": - id = new Option(utf8JsonReader.GetString()); - break; - case "label": - label = new Option(utf8JsonReader.GetString()); - break; - case "lastFour": - lastFour = new Option(utf8JsonReader.GetString()); - break; - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - case "networkTxReference": - networkTxReference = new Option(utf8JsonReader.GetString()); - break; - case "ownerName": - ownerName = new Option(utf8JsonReader.GetString()); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "supportedRecurringProcessingModels": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - supportedRecurringProcessingModels = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "supportedShopperInteractions": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - supportedShopperInteractions = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "type": - type = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (bankAccountNumber.IsSet && bankAccountNumber.Value == null) - throw new ArgumentNullException(nameof(bankAccountNumber), "Property is not nullable for class StoredPaymentMethod."); - - if (bankLocationId.IsSet && bankLocationId.Value == null) - throw new ArgumentNullException(nameof(bankLocationId), "Property is not nullable for class StoredPaymentMethod."); - - if (brand.IsSet && brand.Value == null) - throw new ArgumentNullException(nameof(brand), "Property is not nullable for class StoredPaymentMethod."); - - if (expiryMonth.IsSet && expiryMonth.Value == null) - throw new ArgumentNullException(nameof(expiryMonth), "Property is not nullable for class StoredPaymentMethod."); - - if (expiryYear.IsSet && expiryYear.Value == null) - throw new ArgumentNullException(nameof(expiryYear), "Property is not nullable for class StoredPaymentMethod."); - - if (holderName.IsSet && holderName.Value == null) - throw new ArgumentNullException(nameof(holderName), "Property is not nullable for class StoredPaymentMethod."); - - if (iban.IsSet && iban.Value == null) - throw new ArgumentNullException(nameof(iban), "Property is not nullable for class StoredPaymentMethod."); - - if (id.IsSet && id.Value == null) - throw new ArgumentNullException(nameof(id), "Property is not nullable for class StoredPaymentMethod."); - - if (label.IsSet && label.Value == null) - throw new ArgumentNullException(nameof(label), "Property is not nullable for class StoredPaymentMethod."); - - if (lastFour.IsSet && lastFour.Value == null) - throw new ArgumentNullException(nameof(lastFour), "Property is not nullable for class StoredPaymentMethod."); - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class StoredPaymentMethod."); - - if (networkTxReference.IsSet && networkTxReference.Value == null) - throw new ArgumentNullException(nameof(networkTxReference), "Property is not nullable for class StoredPaymentMethod."); - - if (ownerName.IsSet && ownerName.Value == null) - throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class StoredPaymentMethod."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class StoredPaymentMethod."); - - if (supportedRecurringProcessingModels.IsSet && supportedRecurringProcessingModels.Value == null) - throw new ArgumentNullException(nameof(supportedRecurringProcessingModels), "Property is not nullable for class StoredPaymentMethod."); - - if (supportedShopperInteractions.IsSet && supportedShopperInteractions.Value == null) - throw new ArgumentNullException(nameof(supportedShopperInteractions), "Property is not nullable for class StoredPaymentMethod."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class StoredPaymentMethod."); - - return new StoredPaymentMethod(bankAccountNumber, bankLocationId, brand, expiryMonth, expiryYear, holderName, iban, id, label, lastFour, name, networkTxReference, ownerName, shopperEmail, supportedRecurringProcessingModels, supportedShopperInteractions, type); + return this.Equals(input as StoredPaymentMethod); } /// - /// Serializes a + /// Returns true if StoredPaymentMethod instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, StoredPaymentMethod storedPaymentMethod, JsonSerializerOptions jsonSerializerOptions) + /// Instance of StoredPaymentMethod to be compared + /// Boolean + public bool Equals(StoredPaymentMethod input) { - writer.WriteStartObject(); - - WriteProperties(writer, storedPaymentMethod, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.BankAccountNumber == input.BankAccountNumber || + (this.BankAccountNumber != null && + this.BankAccountNumber.Equals(input.BankAccountNumber)) + ) && + ( + this.BankLocationId == input.BankLocationId || + (this.BankLocationId != null && + this.BankLocationId.Equals(input.BankLocationId)) + ) && + ( + this.Brand == input.Brand || + (this.Brand != null && + this.Brand.Equals(input.Brand)) + ) && + ( + this.ExpiryMonth == input.ExpiryMonth || + (this.ExpiryMonth != null && + this.ExpiryMonth.Equals(input.ExpiryMonth)) + ) && + ( + this.ExpiryYear == input.ExpiryYear || + (this.ExpiryYear != null && + this.ExpiryYear.Equals(input.ExpiryYear)) + ) && + ( + this.HolderName == input.HolderName || + (this.HolderName != null && + this.HolderName.Equals(input.HolderName)) + ) && + ( + this.Iban == input.Iban || + (this.Iban != null && + this.Iban.Equals(input.Iban)) + ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Label == input.Label || + (this.Label != null && + this.Label.Equals(input.Label)) + ) && + ( + this.LastFour == input.LastFour || + (this.LastFour != null && + this.LastFour.Equals(input.LastFour)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.NetworkTxReference == input.NetworkTxReference || + (this.NetworkTxReference != null && + this.NetworkTxReference.Equals(input.NetworkTxReference)) + ) && + ( + this.OwnerName == input.OwnerName || + (this.OwnerName != null && + this.OwnerName.Equals(input.OwnerName)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.SupportedRecurringProcessingModels == input.SupportedRecurringProcessingModels || + this.SupportedRecurringProcessingModels != null && + input.SupportedRecurringProcessingModels != null && + this.SupportedRecurringProcessingModels.SequenceEqual(input.SupportedRecurringProcessingModels) + ) && + ( + this.SupportedShopperInteractions == input.SupportedShopperInteractions || + this.SupportedShopperInteractions != null && + input.SupportedShopperInteractions != null && + this.SupportedShopperInteractions.SequenceEqual(input.SupportedShopperInteractions) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, StoredPaymentMethod storedPaymentMethod, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (storedPaymentMethod.BankAccountNumberOption.IsSet && storedPaymentMethod.BankAccountNumber == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.BankAccountNumber), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.BankLocationIdOption.IsSet && storedPaymentMethod.BankLocationId == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.BankLocationId), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.BrandOption.IsSet && storedPaymentMethod.Brand == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.Brand), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.ExpiryMonthOption.IsSet && storedPaymentMethod.ExpiryMonth == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.ExpiryMonth), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.ExpiryYearOption.IsSet && storedPaymentMethod.ExpiryYear == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.ExpiryYear), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.HolderNameOption.IsSet && storedPaymentMethod.HolderName == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.HolderName), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.IbanOption.IsSet && storedPaymentMethod.Iban == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.Iban), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.IdOption.IsSet && storedPaymentMethod.Id == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.Id), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.LabelOption.IsSet && storedPaymentMethod.Label == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.Label), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.LastFourOption.IsSet && storedPaymentMethod.LastFour == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.LastFour), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.NameOption.IsSet && storedPaymentMethod.Name == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.Name), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.NetworkTxReferenceOption.IsSet && storedPaymentMethod.NetworkTxReference == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.NetworkTxReference), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.OwnerNameOption.IsSet && storedPaymentMethod.OwnerName == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.OwnerName), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.ShopperEmailOption.IsSet && storedPaymentMethod.ShopperEmail == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.ShopperEmail), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.SupportedRecurringProcessingModelsOption.IsSet && storedPaymentMethod.SupportedRecurringProcessingModels == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.SupportedRecurringProcessingModels), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.SupportedShopperInteractionsOption.IsSet && storedPaymentMethod.SupportedShopperInteractions == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.SupportedShopperInteractions), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.TypeOption.IsSet && storedPaymentMethod.Type == null) - throw new ArgumentNullException(nameof(storedPaymentMethod.Type), "Property is required for class StoredPaymentMethod."); - - if (storedPaymentMethod.BankAccountNumberOption.IsSet) - writer.WriteString("bankAccountNumber", storedPaymentMethod.BankAccountNumber); - - if (storedPaymentMethod.BankLocationIdOption.IsSet) - writer.WriteString("bankLocationId", storedPaymentMethod.BankLocationId); - - if (storedPaymentMethod.BrandOption.IsSet) - writer.WriteString("brand", storedPaymentMethod.Brand); - - if (storedPaymentMethod.ExpiryMonthOption.IsSet) - writer.WriteString("expiryMonth", storedPaymentMethod.ExpiryMonth); - - if (storedPaymentMethod.ExpiryYearOption.IsSet) - writer.WriteString("expiryYear", storedPaymentMethod.ExpiryYear); - - if (storedPaymentMethod.HolderNameOption.IsSet) - writer.WriteString("holderName", storedPaymentMethod.HolderName); - - if (storedPaymentMethod.IbanOption.IsSet) - writer.WriteString("iban", storedPaymentMethod.Iban); - - if (storedPaymentMethod.IdOption.IsSet) - writer.WriteString("id", storedPaymentMethod.Id); - - if (storedPaymentMethod.LabelOption.IsSet) - writer.WriteString("label", storedPaymentMethod.Label); - - if (storedPaymentMethod.LastFourOption.IsSet) - writer.WriteString("lastFour", storedPaymentMethod.LastFour); - - if (storedPaymentMethod.NameOption.IsSet) - writer.WriteString("name", storedPaymentMethod.Name); - - if (storedPaymentMethod.NetworkTxReferenceOption.IsSet) - writer.WriteString("networkTxReference", storedPaymentMethod.NetworkTxReference); - - if (storedPaymentMethod.OwnerNameOption.IsSet) - writer.WriteString("ownerName", storedPaymentMethod.OwnerName); - - if (storedPaymentMethod.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", storedPaymentMethod.ShopperEmail); - - if (storedPaymentMethod.SupportedRecurringProcessingModelsOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("supportedRecurringProcessingModels"); - JsonSerializer.Serialize(writer, storedPaymentMethod.SupportedRecurringProcessingModels, jsonSerializerOptions); - } - if (storedPaymentMethod.SupportedShopperInteractionsOption.IsSet) - { - writer.WritePropertyName("supportedShopperInteractions"); - JsonSerializer.Serialize(writer, storedPaymentMethod.SupportedShopperInteractions, jsonSerializerOptions); + int hashCode = 41; + if (this.BankAccountNumber != null) + { + hashCode = (hashCode * 59) + this.BankAccountNumber.GetHashCode(); + } + if (this.BankLocationId != null) + { + hashCode = (hashCode * 59) + this.BankLocationId.GetHashCode(); + } + if (this.Brand != null) + { + hashCode = (hashCode * 59) + this.Brand.GetHashCode(); + } + if (this.ExpiryMonth != null) + { + hashCode = (hashCode * 59) + this.ExpiryMonth.GetHashCode(); + } + if (this.ExpiryYear != null) + { + hashCode = (hashCode * 59) + this.ExpiryYear.GetHashCode(); + } + if (this.HolderName != null) + { + hashCode = (hashCode * 59) + this.HolderName.GetHashCode(); + } + if (this.Iban != null) + { + hashCode = (hashCode * 59) + this.Iban.GetHashCode(); + } + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Label != null) + { + hashCode = (hashCode * 59) + this.Label.GetHashCode(); + } + if (this.LastFour != null) + { + hashCode = (hashCode * 59) + this.LastFour.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.NetworkTxReference != null) + { + hashCode = (hashCode * 59) + this.NetworkTxReference.GetHashCode(); + } + if (this.OwnerName != null) + { + hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.SupportedRecurringProcessingModels != null) + { + hashCode = (hashCode * 59) + this.SupportedRecurringProcessingModels.GetHashCode(); + } + if (this.SupportedShopperInteractions != null) + { + hashCode = (hashCode * 59) + this.SupportedShopperInteractions.GetHashCode(); + } + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + return hashCode; } - if (storedPaymentMethod.TypeOption.IsSet) - writer.WriteString("type", storedPaymentMethod.Type); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs b/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs index f43c4717e..fb8f4885f 100644 --- a/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs +++ b/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,386 +15,183 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// StoredPaymentMethodDetails /// - public partial class StoredPaymentMethodDetails : IValidatableObject + [DataContract(Name = "StoredPaymentMethodDetails")] + public partial class StoredPaymentMethodDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The payment method type. - [JsonConstructor] - public StoredPaymentMethodDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The payment method type. /// /// The payment method type. + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum BcmcMobile for value: bcmc_mobile /// + [EnumMember(Value = "bcmc_mobile")] BcmcMobile = 1, /// /// Enum BcmcMobileQR for value: bcmc_mobile_QR /// + [EnumMember(Value = "bcmc_mobile_QR")] BcmcMobileQR = 2, /// /// Enum BcmcMobileApp for value: bcmc_mobile_app /// + [EnumMember(Value = "bcmc_mobile_app")] BcmcMobileApp = 3, /// /// Enum MomoWallet for value: momo_wallet /// + [EnumMember(Value = "momo_wallet")] MomoWallet = 4, /// /// Enum MomoWalletApp for value: momo_wallet_app /// + [EnumMember(Value = "momo_wallet_app")] MomoWalletApp = 5, /// /// Enum PaymayaWallet for value: paymaya_wallet /// + [EnumMember(Value = "paymaya_wallet")] PaymayaWallet = 6, /// /// Enum GrabpaySG for value: grabpay_SG /// + [EnumMember(Value = "grabpay_SG")] GrabpaySG = 7, /// /// Enum GrabpayMY for value: grabpay_MY /// + [EnumMember(Value = "grabpay_MY")] GrabpayMY = 8, /// /// Enum GrabpayTH for value: grabpay_TH /// + [EnumMember(Value = "grabpay_TH")] GrabpayTH = 9, /// /// Enum GrabpayID for value: grabpay_ID /// + [EnumMember(Value = "grabpay_ID")] GrabpayID = 10, /// /// Enum GrabpayVN for value: grabpay_VN /// + [EnumMember(Value = "grabpay_VN")] GrabpayVN = 11, /// /// Enum GrabpayPH for value: grabpay_PH /// + [EnumMember(Value = "grabpay_PH")] GrabpayPH = 12, /// /// Enum Oxxo for value: oxxo /// + [EnumMember(Value = "oxxo")] Oxxo = 13, /// /// Enum Gcash for value: gcash /// + [EnumMember(Value = "gcash")] Gcash = 14, /// /// Enum Dana for value: dana /// + [EnumMember(Value = "dana")] Dana = 15, /// /// Enum Kakaopay for value: kakaopay /// + [EnumMember(Value = "kakaopay")] Kakaopay = 16, /// /// Enum Truemoney for value: truemoney /// + [EnumMember(Value = "truemoney")] Truemoney = 17, /// /// Enum Paysafecard for value: paysafecard /// + [EnumMember(Value = "paysafecard")] Paysafecard = 18 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("bcmc_mobile")) - return TypeEnum.BcmcMobile; - - if (value.Equals("bcmc_mobile_QR")) - return TypeEnum.BcmcMobileQR; - - if (value.Equals("bcmc_mobile_app")) - return TypeEnum.BcmcMobileApp; - - if (value.Equals("momo_wallet")) - return TypeEnum.MomoWallet; - - if (value.Equals("momo_wallet_app")) - return TypeEnum.MomoWalletApp; - - if (value.Equals("paymaya_wallet")) - return TypeEnum.PaymayaWallet; - - if (value.Equals("grabpay_SG")) - return TypeEnum.GrabpaySG; - - if (value.Equals("grabpay_MY")) - return TypeEnum.GrabpayMY; - - if (value.Equals("grabpay_TH")) - return TypeEnum.GrabpayTH; - - if (value.Equals("grabpay_ID")) - return TypeEnum.GrabpayID; - - if (value.Equals("grabpay_VN")) - return TypeEnum.GrabpayVN; - - if (value.Equals("grabpay_PH")) - return TypeEnum.GrabpayPH; - - if (value.Equals("oxxo")) - return TypeEnum.Oxxo; - - if (value.Equals("gcash")) - return TypeEnum.Gcash; - - if (value.Equals("dana")) - return TypeEnum.Dana; - - if (value.Equals("kakaopay")) - return TypeEnum.Kakaopay; - - if (value.Equals("truemoney")) - return TypeEnum.Truemoney; - - if (value.Equals("paysafecard")) - return TypeEnum.Paysafecard; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("bcmc_mobile")) - return TypeEnum.BcmcMobile; - - if (value.Equals("bcmc_mobile_QR")) - return TypeEnum.BcmcMobileQR; - - if (value.Equals("bcmc_mobile_app")) - return TypeEnum.BcmcMobileApp; - - if (value.Equals("momo_wallet")) - return TypeEnum.MomoWallet; - - if (value.Equals("momo_wallet_app")) - return TypeEnum.MomoWalletApp; - - if (value.Equals("paymaya_wallet")) - return TypeEnum.PaymayaWallet; - - if (value.Equals("grabpay_SG")) - return TypeEnum.GrabpaySG; - - if (value.Equals("grabpay_MY")) - return TypeEnum.GrabpayMY; - - if (value.Equals("grabpay_TH")) - return TypeEnum.GrabpayTH; - - if (value.Equals("grabpay_ID")) - return TypeEnum.GrabpayID; - - if (value.Equals("grabpay_VN")) - return TypeEnum.GrabpayVN; - - if (value.Equals("grabpay_PH")) - return TypeEnum.GrabpayPH; - - if (value.Equals("oxxo")) - return TypeEnum.Oxxo; - - if (value.Equals("gcash")) - return TypeEnum.Gcash; - - if (value.Equals("dana")) - return TypeEnum.Dana; - - if (value.Equals("kakaopay")) - return TypeEnum.Kakaopay; - - if (value.Equals("truemoney")) - return TypeEnum.Truemoney; - - if (value.Equals("paysafecard")) - return TypeEnum.Paysafecard; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.BcmcMobile) - return "bcmc_mobile"; - - if (value == TypeEnum.BcmcMobileQR) - return "bcmc_mobile_QR"; - - if (value == TypeEnum.BcmcMobileApp) - return "bcmc_mobile_app"; - - if (value == TypeEnum.MomoWallet) - return "momo_wallet"; - - if (value == TypeEnum.MomoWalletApp) - return "momo_wallet_app"; - - if (value == TypeEnum.PaymayaWallet) - return "paymaya_wallet"; - - if (value == TypeEnum.GrabpaySG) - return "grabpay_SG"; - - if (value == TypeEnum.GrabpayMY) - return "grabpay_MY"; - - if (value == TypeEnum.GrabpayTH) - return "grabpay_TH"; - - if (value == TypeEnum.GrabpayID) - return "grabpay_ID"; - - if (value == TypeEnum.GrabpayVN) - return "grabpay_VN"; - - if (value == TypeEnum.GrabpayPH) - return "grabpay_PH"; - - if (value == TypeEnum.Oxxo) - return "oxxo"; - if (value == TypeEnum.Gcash) - return "gcash"; - - if (value == TypeEnum.Dana) - return "dana"; - - if (value == TypeEnum.Kakaopay) - return "kakaopay"; - - if (value == TypeEnum.Truemoney) - return "truemoney"; - - if (value == TypeEnum.Paysafecard) - return "paysafecard"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// The payment method type. /// /// The payment method type. - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The payment method type.. + public StoredPaymentMethodDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = default(TypeEnum?)) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -412,143 +210,97 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class StoredPaymentMethodDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override StoredPaymentMethodDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as StoredPaymentMethodDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if StoredPaymentMethodDetails instances are equal + /// + /// Instance of StoredPaymentMethodDetails to be compared + /// Boolean + public bool Equals(StoredPaymentMethodDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(StoredPaymentMethodDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class StoredPaymentMethodDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class StoredPaymentMethodDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class StoredPaymentMethodDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class StoredPaymentMethodDetails."); - - return new StoredPaymentMethodDetails(checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, StoredPaymentMethodDetails storedPaymentMethodDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, storedPaymentMethodDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, StoredPaymentMethodDetails storedPaymentMethodDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (storedPaymentMethodDetails.CheckoutAttemptIdOption.IsSet && storedPaymentMethodDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(storedPaymentMethodDetails.CheckoutAttemptId), "Property is required for class StoredPaymentMethodDetails."); - - if (storedPaymentMethodDetails.RecurringDetailReferenceOption.IsSet && storedPaymentMethodDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(storedPaymentMethodDetails.RecurringDetailReference), "Property is required for class StoredPaymentMethodDetails."); - - if (storedPaymentMethodDetails.StoredPaymentMethodIdOption.IsSet && storedPaymentMethodDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(storedPaymentMethodDetails.StoredPaymentMethodId), "Property is required for class StoredPaymentMethodDetails."); - - if (storedPaymentMethodDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", storedPaymentMethodDetails.CheckoutAttemptId); - - if (storedPaymentMethodDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", storedPaymentMethodDetails.RecurringDetailReference); - - if (storedPaymentMethodDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", storedPaymentMethodDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = StoredPaymentMethodDetails.TypeEnumToJsonValue(storedPaymentMethodDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/StoredPaymentMethodRequest.cs b/Adyen/Model/Checkout/StoredPaymentMethodRequest.cs index 09acfa919..5d0410d79 100644 --- a/Adyen/Model/Checkout/StoredPaymentMethodRequest.cs +++ b/Adyen/Model/Checkout/StoredPaymentMethodRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,178 +15,114 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// StoredPaymentMethodRequest /// - public partial class StoredPaymentMethodRequest : IValidatableObject + [DataContract(Name = "StoredPaymentMethodRequest")] + public partial class StoredPaymentMethodRequest : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The merchant account identifier, with which you want to process the transaction. - /// paymentMethod - /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - /// A unique identifier for the shopper (for example, user ID or account ID). - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. - /// The IP address of a shopper. - [JsonConstructor] - public StoredPaymentMethodRequest(string merchantAccount, PaymentMethodToStore paymentMethod, RecurringProcessingModelEnum recurringProcessingModel, string shopperReference, Option shopperEmail = default, Option shopperIP = default) - { - MerchantAccount = merchantAccount; - PaymentMethod = paymentMethod; - RecurringProcessingModel = recurringProcessingModel; - ShopperReference = shopperReference; - ShopperEmailOption = shopperEmail; - ShopperIPOption = shopperIP; - OnCreated(); - } - - partial void OnCreated(); - /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { /// /// Enum CardOnFile for value: CardOnFile /// + [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// + [EnumMember(Value = "Subscription")] Subscription = 2, /// /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// + [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 + } + /// - /// Returns a + /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// - /// - /// - /// - public static RecurringProcessingModelEnum RecurringProcessingModelEnumFromString(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - throw new NotImplementedException($"Could not convert value to type RecurringProcessingModelEnum: '{value}'"); - } - + /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [DataMember(Name = "recurringProcessingModel", IsRequired = false, EmitDefaultValue = false)] + public RecurringProcessingModelEnum RecurringProcessingModel { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static RecurringProcessingModelEnum? RecurringProcessingModelEnumFromStringOrDefault(string value) - { - if (value.Equals("CardOnFile")) - return RecurringProcessingModelEnum.CardOnFile; - - if (value.Equals("Subscription")) - return RecurringProcessingModelEnum.Subscription; - - if (value.Equals("UnscheduledCardOnFile")) - return RecurringProcessingModelEnum.UnscheduledCardOnFile; - - return null; - } - + [JsonConstructorAttribute] + protected StoredPaymentMethodRequest() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string RecurringProcessingModelEnumToJsonValue(RecurringProcessingModelEnum value) + /// The merchant account identifier, with which you want to process the transaction. (required). + /// paymentMethod (required). + /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. (required). + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks.. + /// The IP address of a shopper.. + /// A unique identifier for the shopper (for example, user ID or account ID). (required). + public StoredPaymentMethodRequest(string merchantAccount = default(string), PaymentMethodToStore paymentMethod = default(PaymentMethodToStore), RecurringProcessingModelEnum recurringProcessingModel = default(RecurringProcessingModelEnum), string shopperEmail = default(string), string shopperIP = default(string), string shopperReference = default(string)) { - if (value == RecurringProcessingModelEnum.CardOnFile) - return "CardOnFile"; - - if (value == RecurringProcessingModelEnum.Subscription) - return "Subscription"; - - if (value == RecurringProcessingModelEnum.UnscheduledCardOnFile) - return "UnscheduledCardOnFile"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.MerchantAccount = merchantAccount; + this.PaymentMethod = paymentMethod; + this.RecurringProcessingModel = recurringProcessingModel; + this.ShopperReference = shopperReference; + this.ShopperEmail = shopperEmail; + this.ShopperIP = shopperIP; } - /// - /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - /// - /// Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonPropertyName("recurringProcessingModel")] - public RecurringProcessingModelEnum RecurringProcessingModel { get; set; } - /// /// The merchant account identifier, with which you want to process the transaction. /// /// The merchant account identifier, with which you want to process the transaction. - [JsonPropertyName("merchantAccount")] + [DataMember(Name = "merchantAccount", IsRequired = false, EmitDefaultValue = false)] public string MerchantAccount { get; set; } /// /// Gets or Sets PaymentMethod /// - [JsonPropertyName("paymentMethod")] + [DataMember(Name = "paymentMethod", IsRequired = false, EmitDefaultValue = false)] public PaymentMethodToStore PaymentMethod { get; set; } - /// - /// A unique identifier for the shopper (for example, user ID or account ID). - /// - /// A unique identifier for the shopper (for example, user ID or account ID). - [JsonPropertyName("shopperReference")] - public string ShopperReference { get; set; } - - /// - /// Used to track the state of ShopperEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } - /// /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. /// /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// - /// Used to track the state of ShopperIP + /// The IP address of a shopper. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperIPOption { get; private set; } + /// The IP address of a shopper. + [DataMember(Name = "shopperIP", EmitDefaultValue = false)] + public string ShopperIP { get; set; } /// - /// The IP address of a shopper. + /// A unique identifier for the shopper (for example, user ID or account ID). /// - /// The IP address of a shopper. - [JsonPropertyName("shopperIP")] - public string ShopperIP { get { return this.ShopperIPOption; } set { this.ShopperIPOption = new Option(value); } } + /// A unique identifier for the shopper (for example, user ID or account ID). + [DataMember(Name = "shopperReference", IsRequired = false, EmitDefaultValue = false)] + public string ShopperReference { get; set; } /// /// Returns the string presentation of the object @@ -198,180 +135,117 @@ public override string ToString() sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); - sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" ShopperIP: ").Append(ShopperIP).Append("\n"); + sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class StoredPaymentMethodRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override StoredPaymentMethodRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option merchantAccount = default; - Option paymentMethod = default; - Option recurringProcessingModel = default; - Option shopperReference = default; - Option shopperEmail = default; - Option shopperIP = default; + return this.Equals(input as StoredPaymentMethodRequest); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if StoredPaymentMethodRequest instances are equal + /// + /// Instance of StoredPaymentMethodRequest to be compared + /// Boolean + public bool Equals(StoredPaymentMethodRequest input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "merchantAccount": - merchantAccount = new Option(utf8JsonReader.GetString()); - break; - case "paymentMethod": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - paymentMethod = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "recurringProcessingModel": - string recurringProcessingModelRawValue = utf8JsonReader.GetString(); - if (recurringProcessingModelRawValue != null) - recurringProcessingModel = new Option(StoredPaymentMethodRequest.RecurringProcessingModelEnumFromStringOrDefault(recurringProcessingModelRawValue)); - break; - case "shopperReference": - shopperReference = new Option(utf8JsonReader.GetString()); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "shopperIP": - shopperIP = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!merchantAccount.IsSet) - throw new ArgumentException("Property is required for class StoredPaymentMethodRequest.", nameof(merchantAccount)); - - if (!paymentMethod.IsSet) - throw new ArgumentException("Property is required for class StoredPaymentMethodRequest.", nameof(paymentMethod)); - - if (!recurringProcessingModel.IsSet) - throw new ArgumentException("Property is required for class StoredPaymentMethodRequest.", nameof(recurringProcessingModel)); - - if (!shopperReference.IsSet) - throw new ArgumentException("Property is required for class StoredPaymentMethodRequest.", nameof(shopperReference)); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount), "Property is not nullable for class StoredPaymentMethodRequest."); - - if (paymentMethod.IsSet && paymentMethod.Value == null) - throw new ArgumentNullException(nameof(paymentMethod), "Property is not nullable for class StoredPaymentMethodRequest."); - - if (recurringProcessingModel.IsSet && recurringProcessingModel.Value == null) - throw new ArgumentNullException(nameof(recurringProcessingModel), "Property is not nullable for class StoredPaymentMethodRequest."); - - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class StoredPaymentMethodRequest."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class StoredPaymentMethodRequest."); - - if (shopperIP.IsSet && shopperIP.Value == null) - throw new ArgumentNullException(nameof(shopperIP), "Property is not nullable for class StoredPaymentMethodRequest."); - - return new StoredPaymentMethodRequest(merchantAccount.Value, paymentMethod.Value, recurringProcessingModel.Value.Value, shopperReference.Value, shopperEmail, shopperIP); + return + ( + this.MerchantAccount == input.MerchantAccount || + (this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount)) + ) && + ( + this.PaymentMethod == input.PaymentMethod || + (this.PaymentMethod != null && + this.PaymentMethod.Equals(input.PaymentMethod)) + ) && + ( + this.RecurringProcessingModel == input.RecurringProcessingModel || + this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.ShopperIP == input.ShopperIP || + (this.ShopperIP != null && + this.ShopperIP.Equals(input.ShopperIP)) + ) && + ( + this.ShopperReference == input.ShopperReference || + (this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, StoredPaymentMethodRequest storedPaymentMethodRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, storedPaymentMethodRequest, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MerchantAccount != null) + { + hashCode = (hashCode * 59) + this.MerchantAccount.GetHashCode(); + } + if (this.PaymentMethod != null) + { + hashCode = (hashCode * 59) + this.PaymentMethod.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RecurringProcessingModel.GetHashCode(); + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.ShopperIP != null) + { + hashCode = (hashCode * 59) + this.ShopperIP.GetHashCode(); + } + if (this.ShopperReference != null) + { + hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, StoredPaymentMethodRequest storedPaymentMethodRequest, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (storedPaymentMethodRequest.MerchantAccount == null) - throw new ArgumentNullException(nameof(storedPaymentMethodRequest.MerchantAccount), "Property is required for class StoredPaymentMethodRequest."); - - if (storedPaymentMethodRequest.PaymentMethod == null) - throw new ArgumentNullException(nameof(storedPaymentMethodRequest.PaymentMethod), "Property is required for class StoredPaymentMethodRequest."); - - if (storedPaymentMethodRequest.ShopperReference == null) - throw new ArgumentNullException(nameof(storedPaymentMethodRequest.ShopperReference), "Property is required for class StoredPaymentMethodRequest."); - - if (storedPaymentMethodRequest.ShopperEmailOption.IsSet && storedPaymentMethodRequest.ShopperEmail == null) - throw new ArgumentNullException(nameof(storedPaymentMethodRequest.ShopperEmail), "Property is required for class StoredPaymentMethodRequest."); - - if (storedPaymentMethodRequest.ShopperIPOption.IsSet && storedPaymentMethodRequest.ShopperIP == null) - throw new ArgumentNullException(nameof(storedPaymentMethodRequest.ShopperIP), "Property is required for class StoredPaymentMethodRequest."); - - writer.WriteString("merchantAccount", storedPaymentMethodRequest.MerchantAccount); - - writer.WritePropertyName("paymentMethod"); - JsonSerializer.Serialize(writer, storedPaymentMethodRequest.PaymentMethod, jsonSerializerOptions); - var recurringProcessingModelRawValue = StoredPaymentMethodRequest.RecurringProcessingModelEnumToJsonValue(storedPaymentMethodRequest.RecurringProcessingModel); - writer.WriteString("recurringProcessingModel", recurringProcessingModelRawValue); - writer.WriteString("shopperReference", storedPaymentMethodRequest.ShopperReference); - - if (storedPaymentMethodRequest.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", storedPaymentMethodRequest.ShopperEmail); - - if (storedPaymentMethodRequest.ShopperIPOption.IsSet) - writer.WriteString("shopperIP", storedPaymentMethodRequest.ShopperIP); + yield break; } } + } diff --git a/Adyen/Model/Checkout/StoredPaymentMethodResource.cs b/Adyen/Model/Checkout/StoredPaymentMethodResource.cs index df9d63580..8ec3b3ef6 100644 --- a/Adyen/Model/Checkout/StoredPaymentMethodResource.cs +++ b/Adyen/Model/Checkout/StoredPaymentMethodResource.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,302 +15,182 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// StoredPaymentMethodResource /// - public partial class StoredPaymentMethodResource : IValidatableObject + [DataContract(Name = "StoredPaymentMethodResource")] + public partial class StoredPaymentMethodResource : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The brand of the card. - /// The month the card expires. - /// The last two digits of the year the card expires. For example, **22** for the year 2022. - /// The response code returned by an external system (for example after a provisioning operation). - /// The token reference of a linked token in an external system (for example a network token reference). - /// The unique payment method code. - /// The IBAN of the bank account. - /// A unique identifier of this stored payment method. - /// The name of the issuer of token or card. - /// The last four digits of the PAN. - /// The display name of the stored payment method. - /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. - /// The name of the bank account holder. - /// The shopper’s email address. - /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - /// The type of payment method. - [JsonConstructor] - public StoredPaymentMethodResource(Option brand = default, Option expiryMonth = default, Option expiryYear = default, Option externalResponseCode = default, Option externalTokenReference = default, Option holderName = default, Option iban = default, Option id = default, Option issuerName = default, Option lastFour = default, Option name = default, Option networkTxReference = default, Option ownerName = default, Option shopperEmail = default, Option shopperReference = default, Option> supportedRecurringProcessingModels = default, Option type = default) + /// The brand of the card.. + /// The month the card expires.. + /// The last two digits of the year the card expires. For example, **22** for the year 2022.. + /// The response code returned by an external system (for example after a provisioning operation).. + /// The token reference of a linked token in an external system (for example a network token reference).. + /// The unique payment method code.. + /// The IBAN of the bank account.. + /// A unique identifier of this stored payment method.. + /// The name of the issuer of token or card.. + /// The last four digits of the PAN.. + /// The display name of the stored payment method.. + /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID.. + /// The name of the bank account holder.. + /// The shopper’s email address.. + /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.. + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount.. + /// The type of payment method.. + public StoredPaymentMethodResource(string brand = default(string), string expiryMonth = default(string), string expiryYear = default(string), string externalResponseCode = default(string), string externalTokenReference = default(string), string holderName = default(string), string iban = default(string), string id = default(string), string issuerName = default(string), string lastFour = default(string), string name = default(string), string networkTxReference = default(string), string ownerName = default(string), string shopperEmail = default(string), string shopperReference = default(string), List supportedRecurringProcessingModels = default(List), string type = default(string)) { - BrandOption = brand; - ExpiryMonthOption = expiryMonth; - ExpiryYearOption = expiryYear; - ExternalResponseCodeOption = externalResponseCode; - ExternalTokenReferenceOption = externalTokenReference; - HolderNameOption = holderName; - IbanOption = iban; - IdOption = id; - IssuerNameOption = issuerName; - LastFourOption = lastFour; - NameOption = name; - NetworkTxReferenceOption = networkTxReference; - OwnerNameOption = ownerName; - ShopperEmailOption = shopperEmail; - ShopperReferenceOption = shopperReference; - SupportedRecurringProcessingModelsOption = supportedRecurringProcessingModels; - TypeOption = type; - OnCreated(); + this.Brand = brand; + this.ExpiryMonth = expiryMonth; + this.ExpiryYear = expiryYear; + this.ExternalResponseCode = externalResponseCode; + this.ExternalTokenReference = externalTokenReference; + this.HolderName = holderName; + this.Iban = iban; + this.Id = id; + this.IssuerName = issuerName; + this.LastFour = lastFour; + this.Name = name; + this.NetworkTxReference = networkTxReference; + this.OwnerName = ownerName; + this.ShopperEmail = shopperEmail; + this.ShopperReference = shopperReference; + this.SupportedRecurringProcessingModels = supportedRecurringProcessingModels; + this.Type = type; } - partial void OnCreated(); - - /// - /// Used to track the state of Brand - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option BrandOption { get; private set; } - /// /// The brand of the card. /// /// The brand of the card. - [JsonPropertyName("brand")] - public string Brand { get { return this.BrandOption; } set { this.BrandOption = new Option(value); } } - - /// - /// Used to track the state of ExpiryMonth - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiryMonthOption { get; private set; } + [DataMember(Name = "brand", EmitDefaultValue = false)] + public string Brand { get; set; } /// /// The month the card expires. /// /// The month the card expires. - [JsonPropertyName("expiryMonth")] - public string ExpiryMonth { get { return this.ExpiryMonthOption; } set { this.ExpiryMonthOption = new Option(value); } } - - /// - /// Used to track the state of ExpiryYear - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExpiryYearOption { get; private set; } + [DataMember(Name = "expiryMonth", EmitDefaultValue = false)] + public string ExpiryMonth { get; set; } /// /// The last two digits of the year the card expires. For example, **22** for the year 2022. /// /// The last two digits of the year the card expires. For example, **22** for the year 2022. - [JsonPropertyName("expiryYear")] - public string ExpiryYear { get { return this.ExpiryYearOption; } set { this.ExpiryYearOption = new Option(value); } } - - /// - /// Used to track the state of ExternalResponseCode - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExternalResponseCodeOption { get; private set; } + [DataMember(Name = "expiryYear", EmitDefaultValue = false)] + public string ExpiryYear { get; set; } /// /// The response code returned by an external system (for example after a provisioning operation). /// /// The response code returned by an external system (for example after a provisioning operation). - [JsonPropertyName("externalResponseCode")] - public string ExternalResponseCode { get { return this.ExternalResponseCodeOption; } set { this.ExternalResponseCodeOption = new Option(value); } } - - /// - /// Used to track the state of ExternalTokenReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExternalTokenReferenceOption { get; private set; } + [DataMember(Name = "externalResponseCode", EmitDefaultValue = false)] + public string ExternalResponseCode { get; set; } /// /// The token reference of a linked token in an external system (for example a network token reference). /// /// The token reference of a linked token in an external system (for example a network token reference). - [JsonPropertyName("externalTokenReference")] - public string ExternalTokenReference { get { return this.ExternalTokenReferenceOption; } set { this.ExternalTokenReferenceOption = new Option(value); } } - - /// - /// Used to track the state of HolderName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option HolderNameOption { get; private set; } + [DataMember(Name = "externalTokenReference", EmitDefaultValue = false)] + public string ExternalTokenReference { get; set; } /// /// The unique payment method code. /// /// The unique payment method code. - [JsonPropertyName("holderName")] - public string HolderName { get { return this.HolderNameOption; } set { this.HolderNameOption = new Option(value); } } - - /// - /// Used to track the state of Iban - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IbanOption { get; private set; } + [DataMember(Name = "holderName", EmitDefaultValue = false)] + public string HolderName { get; set; } /// /// The IBAN of the bank account. /// /// The IBAN of the bank account. - [JsonPropertyName("iban")] - public string Iban { get { return this.IbanOption; } set { this.IbanOption = new Option(value); } } - - /// - /// Used to track the state of Id - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IdOption { get; private set; } + [DataMember(Name = "iban", EmitDefaultValue = false)] + public string Iban { get; set; } /// /// A unique identifier of this stored payment method. /// /// A unique identifier of this stored payment method. - [JsonPropertyName("id")] - public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } - - /// - /// Used to track the state of IssuerName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IssuerNameOption { get; private set; } + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } /// /// The name of the issuer of token or card. /// /// The name of the issuer of token or card. - [JsonPropertyName("issuerName")] - public string IssuerName { get { return this.IssuerNameOption; } set { this.IssuerNameOption = new Option(value); } } - - /// - /// Used to track the state of LastFour - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option LastFourOption { get; private set; } + [DataMember(Name = "issuerName", EmitDefaultValue = false)] + public string IssuerName { get; set; } /// /// The last four digits of the PAN. /// /// The last four digits of the PAN. - [JsonPropertyName("lastFour")] - public string LastFour { get { return this.LastFourOption; } set { this.LastFourOption = new Option(value); } } - - /// - /// Used to track the state of Name - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NameOption { get; private set; } + [DataMember(Name = "lastFour", EmitDefaultValue = false)] + public string LastFour { get; set; } /// /// The display name of the stored payment method. /// /// The display name of the stored payment method. - [JsonPropertyName("name")] - public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } - - /// - /// Used to track the state of NetworkTxReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NetworkTxReferenceOption { get; private set; } + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } /// /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. /// /// Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID. - [JsonPropertyName("networkTxReference")] - public string NetworkTxReference { get { return this.NetworkTxReferenceOption; } set { this.NetworkTxReferenceOption = new Option(value); } } - - /// - /// Used to track the state of OwnerName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OwnerNameOption { get; private set; } + [DataMember(Name = "networkTxReference", EmitDefaultValue = false)] + public string NetworkTxReference { get; set; } /// /// The name of the bank account holder. /// /// The name of the bank account holder. - [JsonPropertyName("ownerName")] - public string OwnerName { get { return this.OwnerNameOption; } set { this.OwnerNameOption = new Option(value); } } - - /// - /// Used to track the state of ShopperEmail - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperEmailOption { get; private set; } + [DataMember(Name = "ownerName", EmitDefaultValue = false)] + public string OwnerName { get; set; } /// /// The shopper’s email address. /// /// The shopper’s email address. - [JsonPropertyName("shopperEmail")] - public string ShopperEmail { get { return this.ShopperEmailOption; } set { this.ShopperEmailOption = new Option(value); } } - - /// - /// Used to track the state of ShopperReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperReferenceOption { get; private set; } + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. /// /// Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address. - [JsonPropertyName("shopperReference")] - public string ShopperReference { get { return this.ShopperReferenceOption; } set { this.ShopperReferenceOption = new Option(value); } } - - /// - /// Used to track the state of SupportedRecurringProcessingModels - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> SupportedRecurringProcessingModelsOption { get; private set; } + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } /// /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. - [JsonPropertyName("supportedRecurringProcessingModels")] - public List SupportedRecurringProcessingModels { get { return this.SupportedRecurringProcessingModelsOption; } set { this.SupportedRecurringProcessingModelsOption = new Option>(value); } } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } + [DataMember(Name = "supportedRecurringProcessingModels", EmitDefaultValue = false)] + public List SupportedRecurringProcessingModels { get; set; } /// /// The type of payment method. /// /// The type of payment method. - [JsonPropertyName("type")] - public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } /// /// Returns the string presentation of the object @@ -341,322 +222,225 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // ShopperReference (string) maxLength - if (this.ShopperReference != null && this.ShopperReference.Length > 256) - { - yield return new ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); - } - - // ShopperReference (string) minLength - if (this.ShopperReference != null && this.ShopperReference.Length < 3) - { - yield return new ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class StoredPaymentMethodResourceJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override StoredPaymentMethodResource Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option brand = default; - Option expiryMonth = default; - Option expiryYear = default; - Option externalResponseCode = default; - Option externalTokenReference = default; - Option holderName = default; - Option iban = default; - Option id = default; - Option issuerName = default; - Option lastFour = default; - Option name = default; - Option networkTxReference = default; - Option ownerName = default; - Option shopperEmail = default; - Option shopperReference = default; - Option> supportedRecurringProcessingModels = default; - Option type = default; + return this.Equals(input as StoredPaymentMethodResource); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if StoredPaymentMethodResource instances are equal + /// + /// Instance of StoredPaymentMethodResource to be compared + /// Boolean + public bool Equals(StoredPaymentMethodResource input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "brand": - brand = new Option(utf8JsonReader.GetString()); - break; - case "expiryMonth": - expiryMonth = new Option(utf8JsonReader.GetString()); - break; - case "expiryYear": - expiryYear = new Option(utf8JsonReader.GetString()); - break; - case "externalResponseCode": - externalResponseCode = new Option(utf8JsonReader.GetString()); - break; - case "externalTokenReference": - externalTokenReference = new Option(utf8JsonReader.GetString()); - break; - case "holderName": - holderName = new Option(utf8JsonReader.GetString()); - break; - case "iban": - iban = new Option(utf8JsonReader.GetString()); - break; - case "id": - id = new Option(utf8JsonReader.GetString()); - break; - case "issuerName": - issuerName = new Option(utf8JsonReader.GetString()); - break; - case "lastFour": - lastFour = new Option(utf8JsonReader.GetString()); - break; - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - case "networkTxReference": - networkTxReference = new Option(utf8JsonReader.GetString()); - break; - case "ownerName": - ownerName = new Option(utf8JsonReader.GetString()); - break; - case "shopperEmail": - shopperEmail = new Option(utf8JsonReader.GetString()); - break; - case "shopperReference": - shopperReference = new Option(utf8JsonReader.GetString()); - break; - case "supportedRecurringProcessingModels": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - supportedRecurringProcessingModels = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "type": - type = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (brand.IsSet && brand.Value == null) - throw new ArgumentNullException(nameof(brand), "Property is not nullable for class StoredPaymentMethodResource."); - - if (expiryMonth.IsSet && expiryMonth.Value == null) - throw new ArgumentNullException(nameof(expiryMonth), "Property is not nullable for class StoredPaymentMethodResource."); - - if (expiryYear.IsSet && expiryYear.Value == null) - throw new ArgumentNullException(nameof(expiryYear), "Property is not nullable for class StoredPaymentMethodResource."); - - if (externalResponseCode.IsSet && externalResponseCode.Value == null) - throw new ArgumentNullException(nameof(externalResponseCode), "Property is not nullable for class StoredPaymentMethodResource."); - - if (externalTokenReference.IsSet && externalTokenReference.Value == null) - throw new ArgumentNullException(nameof(externalTokenReference), "Property is not nullable for class StoredPaymentMethodResource."); - - if (holderName.IsSet && holderName.Value == null) - throw new ArgumentNullException(nameof(holderName), "Property is not nullable for class StoredPaymentMethodResource."); - - if (iban.IsSet && iban.Value == null) - throw new ArgumentNullException(nameof(iban), "Property is not nullable for class StoredPaymentMethodResource."); - - if (id.IsSet && id.Value == null) - throw new ArgumentNullException(nameof(id), "Property is not nullable for class StoredPaymentMethodResource."); - - if (issuerName.IsSet && issuerName.Value == null) - throw new ArgumentNullException(nameof(issuerName), "Property is not nullable for class StoredPaymentMethodResource."); - - if (lastFour.IsSet && lastFour.Value == null) - throw new ArgumentNullException(nameof(lastFour), "Property is not nullable for class StoredPaymentMethodResource."); - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class StoredPaymentMethodResource."); - - if (networkTxReference.IsSet && networkTxReference.Value == null) - throw new ArgumentNullException(nameof(networkTxReference), "Property is not nullable for class StoredPaymentMethodResource."); - - if (ownerName.IsSet && ownerName.Value == null) - throw new ArgumentNullException(nameof(ownerName), "Property is not nullable for class StoredPaymentMethodResource."); - - if (shopperEmail.IsSet && shopperEmail.Value == null) - throw new ArgumentNullException(nameof(shopperEmail), "Property is not nullable for class StoredPaymentMethodResource."); - - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference), "Property is not nullable for class StoredPaymentMethodResource."); - - if (supportedRecurringProcessingModels.IsSet && supportedRecurringProcessingModels.Value == null) - throw new ArgumentNullException(nameof(supportedRecurringProcessingModels), "Property is not nullable for class StoredPaymentMethodResource."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class StoredPaymentMethodResource."); - - return new StoredPaymentMethodResource(brand, expiryMonth, expiryYear, externalResponseCode, externalTokenReference, holderName, iban, id, issuerName, lastFour, name, networkTxReference, ownerName, shopperEmail, shopperReference, supportedRecurringProcessingModels, type); + return + ( + this.Brand == input.Brand || + (this.Brand != null && + this.Brand.Equals(input.Brand)) + ) && + ( + this.ExpiryMonth == input.ExpiryMonth || + (this.ExpiryMonth != null && + this.ExpiryMonth.Equals(input.ExpiryMonth)) + ) && + ( + this.ExpiryYear == input.ExpiryYear || + (this.ExpiryYear != null && + this.ExpiryYear.Equals(input.ExpiryYear)) + ) && + ( + this.ExternalResponseCode == input.ExternalResponseCode || + (this.ExternalResponseCode != null && + this.ExternalResponseCode.Equals(input.ExternalResponseCode)) + ) && + ( + this.ExternalTokenReference == input.ExternalTokenReference || + (this.ExternalTokenReference != null && + this.ExternalTokenReference.Equals(input.ExternalTokenReference)) + ) && + ( + this.HolderName == input.HolderName || + (this.HolderName != null && + this.HolderName.Equals(input.HolderName)) + ) && + ( + this.Iban == input.Iban || + (this.Iban != null && + this.Iban.Equals(input.Iban)) + ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.IssuerName == input.IssuerName || + (this.IssuerName != null && + this.IssuerName.Equals(input.IssuerName)) + ) && + ( + this.LastFour == input.LastFour || + (this.LastFour != null && + this.LastFour.Equals(input.LastFour)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.NetworkTxReference == input.NetworkTxReference || + (this.NetworkTxReference != null && + this.NetworkTxReference.Equals(input.NetworkTxReference)) + ) && + ( + this.OwnerName == input.OwnerName || + (this.OwnerName != null && + this.OwnerName.Equals(input.OwnerName)) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + (this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail)) + ) && + ( + this.ShopperReference == input.ShopperReference || + (this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference)) + ) && + ( + this.SupportedRecurringProcessingModels == input.SupportedRecurringProcessingModels || + this.SupportedRecurringProcessingModels != null && + input.SupportedRecurringProcessingModels != null && + this.SupportedRecurringProcessingModels.SequenceEqual(input.SupportedRecurringProcessingModels) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, StoredPaymentMethodResource storedPaymentMethodResource, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, storedPaymentMethodResource, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Brand != null) + { + hashCode = (hashCode * 59) + this.Brand.GetHashCode(); + } + if (this.ExpiryMonth != null) + { + hashCode = (hashCode * 59) + this.ExpiryMonth.GetHashCode(); + } + if (this.ExpiryYear != null) + { + hashCode = (hashCode * 59) + this.ExpiryYear.GetHashCode(); + } + if (this.ExternalResponseCode != null) + { + hashCode = (hashCode * 59) + this.ExternalResponseCode.GetHashCode(); + } + if (this.ExternalTokenReference != null) + { + hashCode = (hashCode * 59) + this.ExternalTokenReference.GetHashCode(); + } + if (this.HolderName != null) + { + hashCode = (hashCode * 59) + this.HolderName.GetHashCode(); + } + if (this.Iban != null) + { + hashCode = (hashCode * 59) + this.Iban.GetHashCode(); + } + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.IssuerName != null) + { + hashCode = (hashCode * 59) + this.IssuerName.GetHashCode(); + } + if (this.LastFour != null) + { + hashCode = (hashCode * 59) + this.LastFour.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.NetworkTxReference != null) + { + hashCode = (hashCode * 59) + this.NetworkTxReference.GetHashCode(); + } + if (this.OwnerName != null) + { + hashCode = (hashCode * 59) + this.OwnerName.GetHashCode(); + } + if (this.ShopperEmail != null) + { + hashCode = (hashCode * 59) + this.ShopperEmail.GetHashCode(); + } + if (this.ShopperReference != null) + { + hashCode = (hashCode * 59) + this.ShopperReference.GetHashCode(); + } + if (this.SupportedRecurringProcessingModels != null) + { + hashCode = (hashCode * 59) + this.SupportedRecurringProcessingModels.GetHashCode(); + } + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, StoredPaymentMethodResource storedPaymentMethodResource, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (storedPaymentMethodResource.BrandOption.IsSet && storedPaymentMethodResource.Brand == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.Brand), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.ExpiryMonthOption.IsSet && storedPaymentMethodResource.ExpiryMonth == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.ExpiryMonth), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.ExpiryYearOption.IsSet && storedPaymentMethodResource.ExpiryYear == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.ExpiryYear), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.ExternalResponseCodeOption.IsSet && storedPaymentMethodResource.ExternalResponseCode == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.ExternalResponseCode), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.ExternalTokenReferenceOption.IsSet && storedPaymentMethodResource.ExternalTokenReference == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.ExternalTokenReference), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.HolderNameOption.IsSet && storedPaymentMethodResource.HolderName == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.HolderName), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.IbanOption.IsSet && storedPaymentMethodResource.Iban == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.Iban), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.IdOption.IsSet && storedPaymentMethodResource.Id == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.Id), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.IssuerNameOption.IsSet && storedPaymentMethodResource.IssuerName == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.IssuerName), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.LastFourOption.IsSet && storedPaymentMethodResource.LastFour == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.LastFour), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.NameOption.IsSet && storedPaymentMethodResource.Name == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.Name), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.NetworkTxReferenceOption.IsSet && storedPaymentMethodResource.NetworkTxReference == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.NetworkTxReference), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.OwnerNameOption.IsSet && storedPaymentMethodResource.OwnerName == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.OwnerName), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.ShopperEmailOption.IsSet && storedPaymentMethodResource.ShopperEmail == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.ShopperEmail), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.ShopperReferenceOption.IsSet && storedPaymentMethodResource.ShopperReference == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.ShopperReference), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.SupportedRecurringProcessingModelsOption.IsSet && storedPaymentMethodResource.SupportedRecurringProcessingModels == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.SupportedRecurringProcessingModels), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.TypeOption.IsSet && storedPaymentMethodResource.Type == null) - throw new ArgumentNullException(nameof(storedPaymentMethodResource.Type), "Property is required for class StoredPaymentMethodResource."); - - if (storedPaymentMethodResource.BrandOption.IsSet) - writer.WriteString("brand", storedPaymentMethodResource.Brand); - - if (storedPaymentMethodResource.ExpiryMonthOption.IsSet) - writer.WriteString("expiryMonth", storedPaymentMethodResource.ExpiryMonth); - - if (storedPaymentMethodResource.ExpiryYearOption.IsSet) - writer.WriteString("expiryYear", storedPaymentMethodResource.ExpiryYear); - - if (storedPaymentMethodResource.ExternalResponseCodeOption.IsSet) - writer.WriteString("externalResponseCode", storedPaymentMethodResource.ExternalResponseCode); - - if (storedPaymentMethodResource.ExternalTokenReferenceOption.IsSet) - writer.WriteString("externalTokenReference", storedPaymentMethodResource.ExternalTokenReference); - - if (storedPaymentMethodResource.HolderNameOption.IsSet) - writer.WriteString("holderName", storedPaymentMethodResource.HolderName); - - if (storedPaymentMethodResource.IbanOption.IsSet) - writer.WriteString("iban", storedPaymentMethodResource.Iban); - - if (storedPaymentMethodResource.IdOption.IsSet) - writer.WriteString("id", storedPaymentMethodResource.Id); - - if (storedPaymentMethodResource.IssuerNameOption.IsSet) - writer.WriteString("issuerName", storedPaymentMethodResource.IssuerName); - - if (storedPaymentMethodResource.LastFourOption.IsSet) - writer.WriteString("lastFour", storedPaymentMethodResource.LastFour); - - if (storedPaymentMethodResource.NameOption.IsSet) - writer.WriteString("name", storedPaymentMethodResource.Name); - - if (storedPaymentMethodResource.NetworkTxReferenceOption.IsSet) - writer.WriteString("networkTxReference", storedPaymentMethodResource.NetworkTxReference); - - if (storedPaymentMethodResource.OwnerNameOption.IsSet) - writer.WriteString("ownerName", storedPaymentMethodResource.OwnerName); - - if (storedPaymentMethodResource.ShopperEmailOption.IsSet) - writer.WriteString("shopperEmail", storedPaymentMethodResource.ShopperEmail); - - if (storedPaymentMethodResource.ShopperReferenceOption.IsSet) - writer.WriteString("shopperReference", storedPaymentMethodResource.ShopperReference); + // ShopperReference (string) maxLength + if (this.ShopperReference != null && this.ShopperReference.Length > 256) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be less than 256.", new [] { "ShopperReference" }); + } - if (storedPaymentMethodResource.SupportedRecurringProcessingModelsOption.IsSet) + // ShopperReference (string) minLength + if (this.ShopperReference != null && this.ShopperReference.Length < 3) { - writer.WritePropertyName("supportedRecurringProcessingModels"); - JsonSerializer.Serialize(writer, storedPaymentMethodResource.SupportedRecurringProcessingModels, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ShopperReference, length must be greater than 3.", new [] { "ShopperReference" }); } - if (storedPaymentMethodResource.TypeOption.IsSet) - writer.WriteString("type", storedPaymentMethodResource.Type); + + yield break; } } + } diff --git a/Adyen/Model/Checkout/SubInputDetail.cs b/Adyen/Model/Checkout/SubInputDetail.cs index 073684cda..2784e2215 100644 --- a/Adyen/Model/Checkout/SubInputDetail.cs +++ b/Adyen/Model/Checkout/SubInputDetail.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,126 +15,83 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// SubInputDetail /// - public partial class SubInputDetail : IValidatableObject + [DataContract(Name = "SubInputDetail")] + public partial class SubInputDetail : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Configuration parameters for the required input. - /// In case of a select, the items to choose from. - /// The value to provide in the result. - /// True if this input is optional to provide. - /// The type of the required input. - /// The value can be pre-filled, if available. - [JsonConstructor] - public SubInputDetail(Option> varConfiguration = default, Option> items = default, Option key = default, Option optional = default, Option type = default, Option value = default) + /// Configuration parameters for the required input.. + /// In case of a select, the items to choose from.. + /// The value to provide in the result.. + /// True if this input is optional to provide.. + /// The type of the required input.. + /// The value can be pre-filled, if available.. + public SubInputDetail(Dictionary configuration = default(Dictionary), List items = default(List), string key = default(string), bool? optional = default(bool?), string type = default(string), string value = default(string)) { - VarConfigurationOption = varConfiguration; - ItemsOption = items; - KeyOption = key; - OptionalOption = optional; - TypeOption = type; - ValueOption = value; - OnCreated(); + this._Configuration = configuration; + this.Items = items; + this.Key = key; + this.Optional = optional; + this.Type = type; + this.Value = value; } - partial void OnCreated(); - - /// - /// Used to track the state of VarConfiguration - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> VarConfigurationOption { get; private set; } - /// /// Configuration parameters for the required input. /// /// Configuration parameters for the required input. - [JsonPropertyName("configuration")] - public Dictionary VarConfiguration { get { return this.VarConfigurationOption; } set { this.VarConfigurationOption = new Option>(value); } } - - /// - /// Used to track the state of Items - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> ItemsOption { get; private set; } + [DataMember(Name = "configuration", EmitDefaultValue = false)] + public Dictionary _Configuration { get; set; } /// /// In case of a select, the items to choose from. /// /// In case of a select, the items to choose from. - [JsonPropertyName("items")] - public List Items { get { return this.ItemsOption; } set { this.ItemsOption = new Option>(value); } } - - /// - /// Used to track the state of Key - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option KeyOption { get; private set; } + [DataMember(Name = "items", EmitDefaultValue = false)] + public List Items { get; set; } /// /// The value to provide in the result. /// /// The value to provide in the result. - [JsonPropertyName("key")] - public string Key { get { return this.KeyOption; } set { this.KeyOption = new Option(value); } } - - /// - /// Used to track the state of Optional - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OptionalOption { get; private set; } + [DataMember(Name = "key", EmitDefaultValue = false)] + public string Key { get; set; } /// /// True if this input is optional to provide. /// /// True if this input is optional to provide. - [JsonPropertyName("optional")] - public bool? Optional { get { return this.OptionalOption; } set { this.OptionalOption = new Option(value); } } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } + [DataMember(Name = "optional", EmitDefaultValue = false)] + public bool? Optional { get; set; } /// /// The type of the required input. /// /// The type of the required input. - [JsonPropertyName("type")] - public string Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - - /// - /// Used to track the state of Value - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ValueOption { get; private set; } + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } /// /// The value can be pre-filled, if available. /// /// The value can be pre-filled, if available. - [JsonPropertyName("value")] - public string Value { get { return this.ValueOption; } set { this.ValueOption = new Option(value); } } + [DataMember(Name = "value", EmitDefaultValue = false)] + public string Value { get; set; } /// /// Returns the string presentation of the object @@ -143,7 +101,7 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class SubInputDetail {\n"); - sb.Append(" VarConfiguration: ").Append(VarConfiguration).Append("\n"); + sb.Append(" _Configuration: ").Append(_Configuration).Append("\n"); sb.Append(" Items: ").Append(Items).Append("\n"); sb.Append(" Key: ").Append(Key).Append("\n"); sb.Append(" Optional: ").Append(Optional).Append("\n"); @@ -154,168 +112,111 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class SubInputDetailJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override SubInputDetail Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option> varConfiguration = default; - Option> items = default; - Option key = default; - Option optional = default; - Option type = default; - Option value = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "configuration": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varConfiguration = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "items": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - items = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "key": - key = new Option(utf8JsonReader.GetString()); - break; - case "optional": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - optional = new Option(utf8JsonReader.GetBoolean()); - break; - case "type": - type = new Option(utf8JsonReader.GetString()); - break; - case "value": - value = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (varConfiguration.IsSet && varConfiguration.Value == null) - throw new ArgumentNullException(nameof(varConfiguration), "Property is not nullable for class SubInputDetail."); - - if (items.IsSet && items.Value == null) - throw new ArgumentNullException(nameof(items), "Property is not nullable for class SubInputDetail."); - - if (key.IsSet && key.Value == null) - throw new ArgumentNullException(nameof(key), "Property is not nullable for class SubInputDetail."); - - if (optional.IsSet && optional.Value == null) - throw new ArgumentNullException(nameof(optional), "Property is not nullable for class SubInputDetail."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class SubInputDetail."); - - if (value.IsSet && value.Value == null) - throw new ArgumentNullException(nameof(value), "Property is not nullable for class SubInputDetail."); - - return new SubInputDetail(varConfiguration, items, key, optional, type, value); + return this.Equals(input as SubInputDetail); } /// - /// Serializes a + /// Returns true if SubInputDetail instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, SubInputDetail subInputDetail, JsonSerializerOptions jsonSerializerOptions) + /// Instance of SubInputDetail to be compared + /// Boolean + public bool Equals(SubInputDetail input) { - writer.WriteStartObject(); - - WriteProperties(writer, subInputDetail, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this._Configuration == input._Configuration || + this._Configuration != null && + input._Configuration != null && + this._Configuration.SequenceEqual(input._Configuration) + ) && + ( + this.Items == input.Items || + this.Items != null && + input.Items != null && + this.Items.SequenceEqual(input.Items) + ) && + ( + this.Key == input.Key || + (this.Key != null && + this.Key.Equals(input.Key)) + ) && + ( + this.Optional == input.Optional || + this.Optional.Equals(input.Optional) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ) && + ( + this.Value == input.Value || + (this.Value != null && + this.Value.Equals(input.Value)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, SubInputDetail subInputDetail, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (subInputDetail.VarConfigurationOption.IsSet && subInputDetail.VarConfiguration == null) - throw new ArgumentNullException(nameof(subInputDetail.VarConfiguration), "Property is required for class SubInputDetail."); - - if (subInputDetail.ItemsOption.IsSet && subInputDetail.Items == null) - throw new ArgumentNullException(nameof(subInputDetail.Items), "Property is required for class SubInputDetail."); - - if (subInputDetail.KeyOption.IsSet && subInputDetail.Key == null) - throw new ArgumentNullException(nameof(subInputDetail.Key), "Property is required for class SubInputDetail."); - - if (subInputDetail.TypeOption.IsSet && subInputDetail.Type == null) - throw new ArgumentNullException(nameof(subInputDetail.Type), "Property is required for class SubInputDetail."); - - if (subInputDetail.ValueOption.IsSet && subInputDetail.Value == null) - throw new ArgumentNullException(nameof(subInputDetail.Value), "Property is required for class SubInputDetail."); - - if (subInputDetail.VarConfigurationOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("configuration"); - JsonSerializer.Serialize(writer, subInputDetail.VarConfiguration, jsonSerializerOptions); - } - if (subInputDetail.ItemsOption.IsSet) - { - writer.WritePropertyName("items"); - JsonSerializer.Serialize(writer, subInputDetail.Items, jsonSerializerOptions); + int hashCode = 41; + if (this._Configuration != null) + { + hashCode = (hashCode * 59) + this._Configuration.GetHashCode(); + } + if (this.Items != null) + { + hashCode = (hashCode * 59) + this.Items.GetHashCode(); + } + if (this.Key != null) + { + hashCode = (hashCode * 59) + this.Key.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Optional.GetHashCode(); + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + if (this.Value != null) + { + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + } + return hashCode; } - if (subInputDetail.KeyOption.IsSet) - writer.WriteString("key", subInputDetail.Key); - - if (subInputDetail.OptionalOption.IsSet) - writer.WriteBoolean("optional", subInputDetail.OptionalOption.Value.Value); - - if (subInputDetail.TypeOption.IsSet) - writer.WriteString("type", subInputDetail.Type); - - if (subInputDetail.ValueOption.IsSet) - writer.WriteString("value", subInputDetail.Value); + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; } } + } diff --git a/Adyen/Model/Checkout/SubMerchant.cs b/Adyen/Model/Checkout/SubMerchant.cs index c0e9cd9b0..54d64c8a9 100644 --- a/Adyen/Model/Checkout/SubMerchant.cs +++ b/Adyen/Model/Checkout/SubMerchant.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,110 +15,74 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// SubMerchant /// - public partial class SubMerchant : IValidatableObject + [DataContract(Name = "SubMerchant")] + public partial class SubMerchant : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters - /// The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters - /// The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits - /// The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters - /// The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ - [JsonConstructor] - public SubMerchant(Option city = default, Option country = default, Option mcc = default, Option name = default, Option taxId = default) + /// The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters. + /// The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters. + /// The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits. + /// The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters. + /// The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ. + public SubMerchant(string city = default(string), string country = default(string), string mcc = default(string), string name = default(string), string taxId = default(string)) { - CityOption = city; - CountryOption = country; - MccOption = mcc; - NameOption = name; - TaxIdOption = taxId; - OnCreated(); + this.City = city; + this.Country = country; + this.Mcc = mcc; + this.Name = name; + this.TaxId = taxId; } - partial void OnCreated(); - - /// - /// Used to track the state of City - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CityOption { get; private set; } - /// /// The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters /// /// The city of the sub-merchant's address. * Format: Alphanumeric * Maximum length: 13 characters - [JsonPropertyName("city")] - public string City { get { return this.CityOption; } set { this.CityOption = new Option(value); } } - - /// - /// Used to track the state of Country - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CountryOption { get; private set; } + [DataMember(Name = "city", EmitDefaultValue = false)] + public string City { get; set; } /// /// The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters /// /// The three-letter country code of the sub-merchant's address. For example, **BRA** for Brazil. * Format: [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) * Fixed length: 3 characters - [JsonPropertyName("country")] - public string Country { get { return this.CountryOption; } set { this.CountryOption = new Option(value); } } - - /// - /// Used to track the state of Mcc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MccOption { get; private set; } + [DataMember(Name = "country", EmitDefaultValue = false)] + public string Country { get; set; } /// /// The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits /// /// The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits - [JsonPropertyName("mcc")] - public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } - - /// - /// Used to track the state of Name - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NameOption { get; private set; } + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string Mcc { get; set; } /// /// The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters /// /// The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters - [JsonPropertyName("name")] - public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } - - /// - /// Used to track the state of TaxId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TaxIdOption { get; private set; } + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } /// /// The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ /// /// The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ - [JsonPropertyName("taxId")] - public string TaxId { get { return this.TaxIdOption; } set { this.TaxIdOption = new Option(value); } } + [DataMember(Name = "taxId", EmitDefaultValue = false)] + public string TaxId { get; set; } /// /// Returns the string presentation of the object @@ -137,151 +102,104 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class SubMerchantJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override SubMerchant Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option city = default; - Option country = default; - Option mcc = default; - Option name = default; - Option taxId = default; + return this.Equals(input as SubMerchant); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if SubMerchant instances are equal + /// + /// Instance of SubMerchant to be compared + /// Boolean + public bool Equals(SubMerchant input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "city": - city = new Option(utf8JsonReader.GetString()); - break; - case "country": - country = new Option(utf8JsonReader.GetString()); - break; - case "mcc": - mcc = new Option(utf8JsonReader.GetString()); - break; - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - case "taxId": - taxId = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (city.IsSet && city.Value == null) - throw new ArgumentNullException(nameof(city), "Property is not nullable for class SubMerchant."); - - if (country.IsSet && country.Value == null) - throw new ArgumentNullException(nameof(country), "Property is not nullable for class SubMerchant."); - - if (mcc.IsSet && mcc.Value == null) - throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class SubMerchant."); - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class SubMerchant."); - - if (taxId.IsSet && taxId.Value == null) - throw new ArgumentNullException(nameof(taxId), "Property is not nullable for class SubMerchant."); - - return new SubMerchant(city, country, mcc, name, taxId); + return + ( + this.City == input.City || + (this.City != null && + this.City.Equals(input.City)) + ) && + ( + this.Country == input.Country || + (this.Country != null && + this.Country.Equals(input.Country)) + ) && + ( + this.Mcc == input.Mcc || + (this.Mcc != null && + this.Mcc.Equals(input.Mcc)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.TaxId == input.TaxId || + (this.TaxId != null && + this.TaxId.Equals(input.TaxId)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, SubMerchant subMerchant, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, subMerchant, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.City != null) + { + hashCode = (hashCode * 59) + this.City.GetHashCode(); + } + if (this.Country != null) + { + hashCode = (hashCode * 59) + this.Country.GetHashCode(); + } + if (this.Mcc != null) + { + hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.TaxId != null) + { + hashCode = (hashCode * 59) + this.TaxId.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, SubMerchant subMerchant, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (subMerchant.CityOption.IsSet && subMerchant.City == null) - throw new ArgumentNullException(nameof(subMerchant.City), "Property is required for class SubMerchant."); - - if (subMerchant.CountryOption.IsSet && subMerchant.Country == null) - throw new ArgumentNullException(nameof(subMerchant.Country), "Property is required for class SubMerchant."); - - if (subMerchant.MccOption.IsSet && subMerchant.Mcc == null) - throw new ArgumentNullException(nameof(subMerchant.Mcc), "Property is required for class SubMerchant."); - - if (subMerchant.NameOption.IsSet && subMerchant.Name == null) - throw new ArgumentNullException(nameof(subMerchant.Name), "Property is required for class SubMerchant."); - - if (subMerchant.TaxIdOption.IsSet && subMerchant.TaxId == null) - throw new ArgumentNullException(nameof(subMerchant.TaxId), "Property is required for class SubMerchant."); - - if (subMerchant.CityOption.IsSet) - writer.WriteString("city", subMerchant.City); - - if (subMerchant.CountryOption.IsSet) - writer.WriteString("country", subMerchant.Country); - - if (subMerchant.MccOption.IsSet) - writer.WriteString("mcc", subMerchant.Mcc); - - if (subMerchant.NameOption.IsSet) - writer.WriteString("name", subMerchant.Name); - - if (subMerchant.TaxIdOption.IsSet) - writer.WriteString("taxId", subMerchant.TaxId); + yield break; } } + } diff --git a/Adyen/Model/Checkout/SubMerchantInfo.cs b/Adyen/Model/Checkout/SubMerchantInfo.cs index e44344711..b6faa1053 100644 --- a/Adyen/Model/Checkout/SubMerchantInfo.cs +++ b/Adyen/Model/Checkout/SubMerchantInfo.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,187 +15,116 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// SubMerchantInfo /// - public partial class SubMerchantInfo : IValidatableObject + [DataContract(Name = "SubMerchantInfo")] + public partial class SubMerchantInfo : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// address - /// amount - /// Required for transactions performed by registered payment facilitators. The email associated with the sub-merchant's account. - /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters - /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits - /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters - /// Required for transactions performed by registered payment facilitators. The phone number associated with the sub-merchant's account. - /// registeredSince - /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ - /// Required for transactions performed by registered payment facilitators. The sub-merchant's URL on the platform, i.e. the sub-merchant's shop. - [JsonConstructor] - public SubMerchantInfo(Option address = default, Option amount = default, Option email = default, Option id = default, Option mcc = default, Option name = default, Option phoneNumber = default, Option registeredSince = default, Option taxId = default, Option url = default) + /// address. + /// amount. + /// Required for transactions performed by registered payment facilitators. The email associated with the sub-merchant's account.. + /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters. + /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits. + /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. Exception: for acquirers in Brazil, this value does not overwrite the shopper statement. * Format: Alphanumeric * Maximum length: 22 characters. + /// Required for transactions performed by registered payment facilitators. The phone number associated with the sub-merchant's account.. + /// registeredSince. + /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ. + /// Required for transactions performed by registered payment facilitators. The sub-merchant's URL on the platform, i.e. the sub-merchant's shop.. + public SubMerchantInfo(BillingAddress address = default(BillingAddress), Amount amount = default(Amount), string email = default(string), string id = default(string), string mcc = default(string), string name = default(string), string phoneNumber = default(string), string registeredSince = default(string), string taxId = default(string), string url = default(string)) { - AddressOption = address; - AmountOption = amount; - EmailOption = email; - IdOption = id; - MccOption = mcc; - NameOption = name; - PhoneNumberOption = phoneNumber; - RegisteredSinceOption = registeredSince; - TaxIdOption = taxId; - UrlOption = url; - OnCreated(); + this.Address = address; + this.Amount = amount; + this.Email = email; + this.Id = id; + this.Mcc = mcc; + this.Name = name; + this.PhoneNumber = phoneNumber; + this.RegisteredSince = registeredSince; + this.TaxId = taxId; + this.Url = url; } - partial void OnCreated(); - - /// - /// Used to track the state of Address - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AddressOption { get; private set; } - /// /// Gets or Sets Address /// - [JsonPropertyName("address")] - public BillingAddress Address { get { return this.AddressOption; } set { this.AddressOption = new Option(value); } } - - /// - /// Used to track the state of Amount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountOption { get; private set; } + [DataMember(Name = "address", EmitDefaultValue = false)] + public BillingAddress Address { get; set; } /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] - public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } - - /// - /// Used to track the state of Email - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EmailOption { get; private set; } + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// Required for transactions performed by registered payment facilitators. The email associated with the sub-merchant's account. /// /// Required for transactions performed by registered payment facilitators. The email associated with the sub-merchant's account. - [JsonPropertyName("email")] - public string Email { get { return this.EmailOption; } set { this.EmailOption = new Option(value); } } - - /// - /// Used to track the state of Id - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IdOption { get; private set; } + [DataMember(Name = "email", EmitDefaultValue = false)] + public string Email { get; set; } /// /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters /// /// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant. * Format: Alphanumeric * Maximum length: 15 characters - [JsonPropertyName("id")] - public string Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } - - /// - /// Used to track the state of Mcc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MccOption { get; private set; } + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } /// /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits /// /// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC). * Format: Numeric * Fixed length: 4 digits - [JsonPropertyName("mcc")] - public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string Mcc { get; set; } /// - /// Used to track the state of Name + /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. Exception: for acquirers in Brazil, this value does not overwrite the shopper statement. * Format: Alphanumeric * Maximum length: 22 characters /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NameOption { get; private set; } - - /// - /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters - /// - /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters - [JsonPropertyName("name")] - public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } - - /// - /// Used to track the state of PhoneNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PhoneNumberOption { get; private set; } + /// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. Exception: for acquirers in Brazil, this value does not overwrite the shopper statement. * Format: Alphanumeric * Maximum length: 22 characters + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } /// /// Required for transactions performed by registered payment facilitators. The phone number associated with the sub-merchant's account. /// /// Required for transactions performed by registered payment facilitators. The phone number associated with the sub-merchant's account. - [JsonPropertyName("phoneNumber")] - public string PhoneNumber { get { return this.PhoneNumberOption; } set { this.PhoneNumberOption = new Option(value); } } - - /// - /// Used to track the state of RegisteredSince - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RegisteredSinceOption { get; private set; } + [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] + public string PhoneNumber { get; set; } /// /// Gets or Sets RegisteredSince /// - [JsonPropertyName("registeredSince")] - public string RegisteredSince { get { return this.RegisteredSinceOption; } set { this.RegisteredSinceOption = new Option(value); } } - - /// - /// Used to track the state of TaxId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TaxIdOption { get; private set; } + [DataMember(Name = "registeredSince", EmitDefaultValue = false)] + public string RegisteredSince { get; set; } /// /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ /// /// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ - [JsonPropertyName("taxId")] - public string TaxId { get { return this.TaxIdOption; } set { this.TaxIdOption = new Option(value); } } - - /// - /// Used to track the state of Url - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option UrlOption { get; private set; } + [DataMember(Name = "taxId", EmitDefaultValue = false)] + public string TaxId { get; set; } /// /// Required for transactions performed by registered payment facilitators. The sub-merchant's URL on the platform, i.e. the sub-merchant's shop. /// /// Required for transactions performed by registered payment facilitators. The sub-merchant's URL on the platform, i.e. the sub-merchant's shop. - [JsonPropertyName("url")] - public string Url { get { return this.UrlOption; } set { this.UrlOption = new Option(value); } } + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; set; } /// /// Returns the string presentation of the object @@ -219,240 +149,167 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // Email (string) maxLength - if (this.Email != null && this.Email.Length > 320) - { - yield return new ValidationResult("Invalid value for Email, length must be less than 320.", new [] { "Email" }); - } - - // PhoneNumber (string) maxLength - if (this.PhoneNumber != null && this.PhoneNumber.Length > 20) - { - yield return new ValidationResult("Invalid value for PhoneNumber, length must be less than 20.", new [] { "PhoneNumber" }); - } - - // Url (string) maxLength - if (this.Url != null && this.Url.Length > 320) - { - yield return new ValidationResult("Invalid value for Url, length must be less than 320.", new [] { "Url" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class SubMerchantInfoJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override SubMerchantInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option address = default; - Option amount = default; - Option email = default; - Option id = default; - Option mcc = default; - Option name = default; - Option phoneNumber = default; - Option registeredSince = default; - Option taxId = default; - Option url = default; + return this.Equals(input as SubMerchantInfo); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if SubMerchantInfo instances are equal + /// + /// Instance of SubMerchantInfo to be compared + /// Boolean + public bool Equals(SubMerchantInfo input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "address": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - address = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "email": - email = new Option(utf8JsonReader.GetString()); - break; - case "id": - id = new Option(utf8JsonReader.GetString()); - break; - case "mcc": - mcc = new Option(utf8JsonReader.GetString()); - break; - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - case "phoneNumber": - phoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "registeredSince": - registeredSince = new Option(utf8JsonReader.GetString()); - break; - case "taxId": - taxId = new Option(utf8JsonReader.GetString()); - break; - case "url": - url = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (address.IsSet && address.Value == null) - throw new ArgumentNullException(nameof(address), "Property is not nullable for class SubMerchantInfo."); - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class SubMerchantInfo."); - - if (email.IsSet && email.Value == null) - throw new ArgumentNullException(nameof(email), "Property is not nullable for class SubMerchantInfo."); - - if (id.IsSet && id.Value == null) - throw new ArgumentNullException(nameof(id), "Property is not nullable for class SubMerchantInfo."); - - if (mcc.IsSet && mcc.Value == null) - throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class SubMerchantInfo."); - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class SubMerchantInfo."); - - if (phoneNumber.IsSet && phoneNumber.Value == null) - throw new ArgumentNullException(nameof(phoneNumber), "Property is not nullable for class SubMerchantInfo."); - - if (registeredSince.IsSet && registeredSince.Value == null) - throw new ArgumentNullException(nameof(registeredSince), "Property is not nullable for class SubMerchantInfo."); - - if (taxId.IsSet && taxId.Value == null) - throw new ArgumentNullException(nameof(taxId), "Property is not nullable for class SubMerchantInfo."); - - if (url.IsSet && url.Value == null) - throw new ArgumentNullException(nameof(url), "Property is not nullable for class SubMerchantInfo."); - - return new SubMerchantInfo(address, amount, email, id, mcc, name, phoneNumber, registeredSince, taxId, url); + return + ( + this.Address == input.Address || + (this.Address != null && + this.Address.Equals(input.Address)) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ) && + ( + this.Email == input.Email || + (this.Email != null && + this.Email.Equals(input.Email)) + ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Mcc == input.Mcc || + (this.Mcc != null && + this.Mcc.Equals(input.Mcc)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.PhoneNumber == input.PhoneNumber || + (this.PhoneNumber != null && + this.PhoneNumber.Equals(input.PhoneNumber)) + ) && + ( + this.RegisteredSince == input.RegisteredSince || + (this.RegisteredSince != null && + this.RegisteredSince.Equals(input.RegisteredSince)) + ) && + ( + this.TaxId == input.TaxId || + (this.TaxId != null && + this.TaxId.Equals(input.TaxId)) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, SubMerchantInfo subMerchantInfo, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, subMerchantInfo, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Address != null) + { + hashCode = (hashCode * 59) + this.Address.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + if (this.Email != null) + { + hashCode = (hashCode * 59) + this.Email.GetHashCode(); + } + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Mcc != null) + { + hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.PhoneNumber != null) + { + hashCode = (hashCode * 59) + this.PhoneNumber.GetHashCode(); + } + if (this.RegisteredSince != null) + { + hashCode = (hashCode * 59) + this.RegisteredSince.GetHashCode(); + } + if (this.TaxId != null) + { + hashCode = (hashCode * 59) + this.TaxId.GetHashCode(); + } + if (this.Url != null) + { + hashCode = (hashCode * 59) + this.Url.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, SubMerchantInfo subMerchantInfo, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (subMerchantInfo.AddressOption.IsSet && subMerchantInfo.Address == null) - throw new ArgumentNullException(nameof(subMerchantInfo.Address), "Property is required for class SubMerchantInfo."); - - if (subMerchantInfo.AmountOption.IsSet && subMerchantInfo.Amount == null) - throw new ArgumentNullException(nameof(subMerchantInfo.Amount), "Property is required for class SubMerchantInfo."); - - if (subMerchantInfo.EmailOption.IsSet && subMerchantInfo.Email == null) - throw new ArgumentNullException(nameof(subMerchantInfo.Email), "Property is required for class SubMerchantInfo."); - - if (subMerchantInfo.IdOption.IsSet && subMerchantInfo.Id == null) - throw new ArgumentNullException(nameof(subMerchantInfo.Id), "Property is required for class SubMerchantInfo."); - - if (subMerchantInfo.MccOption.IsSet && subMerchantInfo.Mcc == null) - throw new ArgumentNullException(nameof(subMerchantInfo.Mcc), "Property is required for class SubMerchantInfo."); - - if (subMerchantInfo.NameOption.IsSet && subMerchantInfo.Name == null) - throw new ArgumentNullException(nameof(subMerchantInfo.Name), "Property is required for class SubMerchantInfo."); - - if (subMerchantInfo.PhoneNumberOption.IsSet && subMerchantInfo.PhoneNumber == null) - throw new ArgumentNullException(nameof(subMerchantInfo.PhoneNumber), "Property is required for class SubMerchantInfo."); - - if (subMerchantInfo.RegisteredSinceOption.IsSet && subMerchantInfo.RegisteredSince == null) - throw new ArgumentNullException(nameof(subMerchantInfo.RegisteredSince), "Property is required for class SubMerchantInfo."); - - if (subMerchantInfo.TaxIdOption.IsSet && subMerchantInfo.TaxId == null) - throw new ArgumentNullException(nameof(subMerchantInfo.TaxId), "Property is required for class SubMerchantInfo."); - - if (subMerchantInfo.UrlOption.IsSet && subMerchantInfo.Url == null) - throw new ArgumentNullException(nameof(subMerchantInfo.Url), "Property is required for class SubMerchantInfo."); - - if (subMerchantInfo.AddressOption.IsSet) + // Email (string) maxLength + if (this.Email != null && this.Email.Length > 320) { - writer.WritePropertyName("address"); - JsonSerializer.Serialize(writer, subMerchantInfo.Address, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Email, length must be less than 320.", new [] { "Email" }); } - if (subMerchantInfo.AmountOption.IsSet) + + // PhoneNumber (string) maxLength + if (this.PhoneNumber != null && this.PhoneNumber.Length > 20) { - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, subMerchantInfo.Amount, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PhoneNumber, length must be less than 20.", new [] { "PhoneNumber" }); } - if (subMerchantInfo.EmailOption.IsSet) - writer.WriteString("email", subMerchantInfo.Email); - - if (subMerchantInfo.IdOption.IsSet) - writer.WriteString("id", subMerchantInfo.Id); - - if (subMerchantInfo.MccOption.IsSet) - writer.WriteString("mcc", subMerchantInfo.Mcc); - - if (subMerchantInfo.NameOption.IsSet) - writer.WriteString("name", subMerchantInfo.Name); - if (subMerchantInfo.PhoneNumberOption.IsSet) - writer.WriteString("phoneNumber", subMerchantInfo.PhoneNumber); - - if (subMerchantInfo.RegisteredSinceOption.IsSet) - writer.WriteString("registeredSince", subMerchantInfo.RegisteredSince); - - if (subMerchantInfo.TaxIdOption.IsSet) - writer.WriteString("taxId", subMerchantInfo.TaxId); + // Url (string) maxLength + if (this.Url != null && this.Url.Length > 320) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Url, length must be less than 320.", new [] { "Url" }); + } - if (subMerchantInfo.UrlOption.IsSet) - writer.WriteString("url", subMerchantInfo.Url); + yield break; } } + } diff --git a/Adyen/Model/Checkout/Surcharge.cs b/Adyen/Model/Checkout/Surcharge.cs index 809d965c6..83eaed16b 100644 --- a/Adyen/Model/Checkout/Surcharge.cs +++ b/Adyen/Model/Checkout/Surcharge.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,39 +15,43 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Surcharge /// - public partial class Surcharge : IValidatableObject + [DataContract(Name = "Surcharge")] + public partial class Surcharge : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The [surcharge](https://docs.adyen.com/online-payments/surcharge/) amount to apply to the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). When you apply surcharge, include the surcharge in the `amount.value` field. Review our [Surcharge compliance guide](https://docs.adyen.com/development-resources/surcharge-compliance/) to learn about how to comply with regulatory requirements when applying surcharge. - [JsonConstructor] - public Surcharge(long value) + [JsonConstructorAttribute] + protected Surcharge() { } + /// + /// Initializes a new instance of the class. + /// + /// The [surcharge](https://docs.adyen.com/online-payments/surcharge/) amount to apply to the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). When you apply surcharge, include the surcharge in the `amount.value` field. Review our [Surcharge compliance guide](https://docs.adyen.com/development-resources/surcharge-compliance/) to learn about how to comply with regulatory requirements when applying surcharge. (required). + public Surcharge(long? value = default(long?)) { - Value = value; - OnCreated(); + this.Value = value; } - partial void OnCreated(); - /// /// The [surcharge](https://docs.adyen.com/online-payments/surcharge/) amount to apply to the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). When you apply surcharge, include the surcharge in the `amount.value` field. Review our [Surcharge compliance guide](https://docs.adyen.com/development-resources/surcharge-compliance/) to learn about how to comply with regulatory requirements when applying surcharge. /// /// The [surcharge](https://docs.adyen.com/online-payments/surcharge/) amount to apply to the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). When you apply surcharge, include the surcharge in the `amount.value` field. Review our [Surcharge compliance guide](https://docs.adyen.com/development-resources/surcharge-compliance/) to learn about how to comply with regulatory requirements when applying surcharge. - [JsonPropertyName("value")] - public long Value { get; set; } + [DataMember(Name = "value", IsRequired = false, EmitDefaultValue = false)] + public long? Value { get; set; } /// /// Returns the string presentation of the object @@ -62,99 +67,64 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class SurchargeJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override Surcharge Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option value = default; + return this.Equals(input as Surcharge); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if Surcharge instances are equal + /// + /// Instance of Surcharge to be compared + /// Boolean + public bool Equals(Surcharge input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "value": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - value = new Option(utf8JsonReader.GetInt64()); - break; - default: - break; - } - } + return false; } - - if (!value.IsSet) - throw new ArgumentException("Property is required for class Surcharge.", nameof(value)); - - if (value.IsSet && value.Value == null) - throw new ArgumentNullException(nameof(value), "Property is not nullable for class Surcharge."); - - return new Surcharge(value.Value.Value); + return + ( + this.Value == input.Value || + this.Value.Equals(input.Value) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Surcharge surcharge, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, surcharge, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Surcharge surcharge, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - writer.WriteNumber("value", surcharge.Value); + yield break; } } + } diff --git a/Adyen/Model/Checkout/TaxTotal.cs b/Adyen/Model/Checkout/TaxTotal.cs index daa6f447b..793064969 100644 --- a/Adyen/Model/Checkout/TaxTotal.cs +++ b/Adyen/Model/Checkout/TaxTotal.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,45 +15,37 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// TaxTotal /// - public partial class TaxTotal : IValidatableObject + [DataContract(Name = "TaxTotal")] + public partial class TaxTotal : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// amount - [JsonConstructor] - public TaxTotal(Option amount = default) + /// amount. + public TaxTotal(Amount amount = default(Amount)) { - AmountOption = amount; - OnCreated(); + this.Amount = amount; } - partial void OnCreated(); - - /// - /// Used to track the state of Amount - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AmountOption { get; private set; } - /// /// Gets or Sets Amount /// - [JsonPropertyName("amount")] - public Amount Amount { get { return this.AmountOption; } set { this.AmountOption = new Option(value); } } + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } /// /// Returns the string presentation of the object @@ -68,103 +61,68 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class TaxTotalJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override TaxTotal Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option amount = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "amount": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - amount = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (amount.IsSet && amount.Value == null) - throw new ArgumentNullException(nameof(amount), "Property is not nullable for class TaxTotal."); - - return new TaxTotal(amount); + return this.Equals(input as TaxTotal); } /// - /// Serializes a + /// Returns true if TaxTotal instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, TaxTotal taxTotal, JsonSerializerOptions jsonSerializerOptions) + /// Instance of TaxTotal to be compared + /// Boolean + public bool Equals(TaxTotal input) { - writer.WriteStartObject(); - - WriteProperties(writer, taxTotal, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, TaxTotal taxTotal, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (taxTotal.AmountOption.IsSet && taxTotal.Amount == null) - throw new ArgumentNullException(nameof(taxTotal.Amount), "Property is required for class TaxTotal."); - - if (taxTotal.AmountOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("amount"); - JsonSerializer.Serialize(writer, taxTotal.Amount, jsonSerializerOptions); + int hashCode = 41; + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/ThreeDS2RequestData.cs b/Adyen/Model/Checkout/ThreeDS2RequestData.cs index edf175891..97da42098 100644 --- a/Adyen/Model/Checkout/ThreeDS2RequestData.cs +++ b/Adyen/Model/Checkout/ThreeDS2RequestData.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,1225 +15,583 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ThreeDS2RequestData /// - public partial class ThreeDS2RequestData : IValidatableObject + [DataContract(Name = "ThreeDS2RequestData")] + public partial class ThreeDS2RequestData : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The environment of the shopper. Allowed values: * `app` * `browser` - /// acctInfo - /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. - /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) - /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` - /// deviceRenderOptions - /// homePhone - /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. - /// The `messageVersion` value indicating the 3D Secure 2 protocol version. - /// mobilePhone - /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. - /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. - /// Indicates the type of payment for which an authentication is requested (message extension) - /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. - /// Date after which no further authorisations shall be performed. Format: YYYYMMDD - /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters. - /// The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. - /// The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. - /// sdkEphemPubKey - /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. (default to 60) - /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. - /// The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. - /// Version of the 3D Secure 2 mobile SDK. Only for `deviceChannel` set to **app**. - /// Completion indicator for the device fingerprinting. - /// Indicates the type of Authentication request. - /// threeDSRequestorAuthenticationInfo - /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. - /// threeDSRequestorPriorAuthenticationInfo - /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. - /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load - /// Identify the type of the transaction being authenticated. - /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. - /// workPhone - [JsonConstructor] - public ThreeDS2RequestData(string deviceChannel, Option acctInfo = default, Option acctType = default, Option acquirerBIN = default, Option acquirerMerchantID = default, Option addrMatch = default, Option authenticationOnly = default, Option challengeIndicator = default, Option deviceRenderOptions = default, Option homePhone = default, Option mcc = default, Option merchantName = default, Option messageVersion = default, Option mobilePhone = default, Option notificationURL = default, Option payTokenInd = default, Option paymentAuthenticationUseCase = default, Option purchaseInstalData = default, Option recurringExpiry = default, Option recurringFrequency = default, Option sdkAppID = default, Option sdkEncData = default, Option sdkEphemPubKey = default, Option sdkMaxTimeout = default, Option sdkReferenceNumber = default, Option sdkTransID = default, Option sdkVersion = default, Option threeDSCompInd = default, Option threeDSRequestorAuthenticationInd = default, Option threeDSRequestorAuthenticationInfo = default, Option threeDSRequestorChallengeInd = default, Option threeDSRequestorID = default, Option threeDSRequestorName = default, Option threeDSRequestorPriorAuthenticationInfo = default, Option threeDSRequestorURL = default, Option transType = default, Option transactionType = default, Option whiteListStatus = default, Option workPhone = default) - { - DeviceChannel = deviceChannel; - AcctInfoOption = acctInfo; - AcctTypeOption = acctType; - AcquirerBINOption = acquirerBIN; - AcquirerMerchantIDOption = acquirerMerchantID; - AddrMatchOption = addrMatch; - AuthenticationOnlyOption = authenticationOnly; - ChallengeIndicatorOption = challengeIndicator; - DeviceRenderOptionsOption = deviceRenderOptions; - HomePhoneOption = homePhone; - MccOption = mcc; - MerchantNameOption = merchantName; - MessageVersionOption = messageVersion; - MobilePhoneOption = mobilePhone; - NotificationURLOption = notificationURL; - PayTokenIndOption = payTokenInd; - PaymentAuthenticationUseCaseOption = paymentAuthenticationUseCase; - PurchaseInstalDataOption = purchaseInstalData; - RecurringExpiryOption = recurringExpiry; - RecurringFrequencyOption = recurringFrequency; - SdkAppIDOption = sdkAppID; - SdkEncDataOption = sdkEncData; - SdkEphemPubKeyOption = sdkEphemPubKey; - SdkMaxTimeoutOption = sdkMaxTimeout; - SdkReferenceNumberOption = sdkReferenceNumber; - SdkTransIDOption = sdkTransID; - SdkVersionOption = sdkVersion; - ThreeDSCompIndOption = threeDSCompInd; - ThreeDSRequestorAuthenticationIndOption = threeDSRequestorAuthenticationInd; - ThreeDSRequestorAuthenticationInfoOption = threeDSRequestorAuthenticationInfo; - ThreeDSRequestorChallengeIndOption = threeDSRequestorChallengeInd; - ThreeDSRequestorIDOption = threeDSRequestorID; - ThreeDSRequestorNameOption = threeDSRequestorName; - ThreeDSRequestorPriorAuthenticationInfoOption = threeDSRequestorPriorAuthenticationInfo; - ThreeDSRequestorURLOption = threeDSRequestorURL; - TransTypeOption = transType; - TransactionTypeOption = transactionType; - WhiteListStatusOption = whiteListStatus; - WorkPhoneOption = workPhone; - OnCreated(); - } - - partial void OnCreated(); - /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit + [JsonConverter(typeof(StringEnumConverter))] public enum AcctTypeEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3 - } - /// - /// Returns a - /// - /// - /// - /// - public static AcctTypeEnum AcctTypeEnumFromString(string value) - { - if (value.Equals("01")) - return AcctTypeEnum._01; - - if (value.Equals("02")) - return AcctTypeEnum._02; - - if (value.Equals("03")) - return AcctTypeEnum._03; - - throw new NotImplementedException($"Could not convert value to type AcctTypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static AcctTypeEnum? AcctTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return AcctTypeEnum._01; - - if (value.Equals("02")) - return AcctTypeEnum._02; - - if (value.Equals("03")) - return AcctTypeEnum._03; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string AcctTypeEnumToJsonValue(AcctTypeEnum? value) - { - if (value == AcctTypeEnum._01) - return "01"; - - if (value == AcctTypeEnum._02) - return "02"; - - if (value == AcctTypeEnum._03) - return "03"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of AcctType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcctTypeOption { get; private set; } /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit - [JsonPropertyName("acctType")] - public AcctTypeEnum? AcctType { get { return this.AcctTypeOption; } set { this.AcctTypeOption = new Option(value); } } - + [DataMember(Name = "acctType", EmitDefaultValue = false)] + public AcctTypeEnum? AcctType { get; set; } /// - /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + /// Indicates whether the cardholder shipping address and cardholder billing address are the same. Allowed values: * **Y** — Shipping address matches billing address. * **N** — Shipping address does not match billing address. /// - /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + /// Indicates whether the cardholder shipping address and cardholder billing address are the same. Allowed values: * **Y** — Shipping address matches billing address. * **N** — Shipping address does not match billing address. + [JsonConverter(typeof(StringEnumConverter))] public enum AddrMatchEnum { /// /// Enum Y for value: Y /// + [EnumMember(Value = "Y")] Y = 1, /// /// Enum N for value: N /// + [EnumMember(Value = "N")] N = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static AddrMatchEnum AddrMatchEnumFromString(string value) - { - if (value.Equals("Y")) - return AddrMatchEnum.Y; - - if (value.Equals("N")) - return AddrMatchEnum.N; - throw new NotImplementedException($"Could not convert value to type AddrMatchEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static AddrMatchEnum? AddrMatchEnumFromStringOrDefault(string value) - { - if (value.Equals("Y")) - return AddrMatchEnum.Y; - - if (value.Equals("N")) - return AddrMatchEnum.N; - - return null; - } /// - /// Converts the to the json value + /// Indicates whether the cardholder shipping address and cardholder billing address are the same. Allowed values: * **Y** — Shipping address matches billing address. * **N** — Shipping address does not match billing address. /// - /// - /// - /// - public static string AddrMatchEnumToJsonValue(AddrMatchEnum? value) - { - if (value == AddrMatchEnum.Y) - return "Y"; - - if (value == AddrMatchEnum.N) - return "N"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of AddrMatch - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AddrMatchOption { get; private set; } - - /// - /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. - /// - /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. - [JsonPropertyName("addrMatch")] - public AddrMatchEnum? AddrMatch { get { return this.AddrMatchOption; } set { this.AddrMatchOption = new Option(value); } } - + /// Indicates whether the cardholder shipping address and cardholder billing address are the same. Allowed values: * **Y** — Shipping address matches billing address. * **N** — Shipping address does not match billing address. + [DataMember(Name = "addrMatch", EmitDefaultValue = false)] + public AddrMatchEnum? AddrMatch { get; set; } /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + [JsonConverter(typeof(StringEnumConverter))] public enum ChallengeIndicatorEnum { /// /// Enum NoPreference for value: noPreference /// + [EnumMember(Value = "noPreference")] NoPreference = 1, /// /// Enum RequestNoChallenge for value: requestNoChallenge /// + [EnumMember(Value = "requestNoChallenge")] RequestNoChallenge = 2, /// /// Enum RequestChallenge for value: requestChallenge /// + [EnumMember(Value = "requestChallenge")] RequestChallenge = 3, /// /// Enum RequestChallengeAsMandate for value: requestChallengeAsMandate /// + [EnumMember(Value = "requestChallengeAsMandate")] RequestChallengeAsMandate = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ChallengeIndicatorEnum ChallengeIndicatorEnumFromString(string value) - { - if (value.Equals("noPreference")) - return ChallengeIndicatorEnum.NoPreference; - - if (value.Equals("requestNoChallenge")) - return ChallengeIndicatorEnum.RequestNoChallenge; - if (value.Equals("requestChallenge")) - return ChallengeIndicatorEnum.RequestChallenge; - - if (value.Equals("requestChallengeAsMandate")) - return ChallengeIndicatorEnum.RequestChallengeAsMandate; - - throw new NotImplementedException($"Could not convert value to type ChallengeIndicatorEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static ChallengeIndicatorEnum? ChallengeIndicatorEnumFromStringOrDefault(string value) - { - if (value.Equals("noPreference")) - return ChallengeIndicatorEnum.NoPreference; - - if (value.Equals("requestNoChallenge")) - return ChallengeIndicatorEnum.RequestNoChallenge; - - if (value.Equals("requestChallenge")) - return ChallengeIndicatorEnum.RequestChallenge; - - if (value.Equals("requestChallengeAsMandate")) - return ChallengeIndicatorEnum.RequestChallengeAsMandate; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChallengeIndicatorEnumToJsonValue(ChallengeIndicatorEnum? value) - { - if (value == ChallengeIndicatorEnum.NoPreference) - return "noPreference"; - - if (value == ChallengeIndicatorEnum.RequestNoChallenge) - return "requestNoChallenge"; - - if (value == ChallengeIndicatorEnum.RequestChallenge) - return "requestChallenge"; - - if (value == ChallengeIndicatorEnum.RequestChallengeAsMandate) - return "requestChallengeAsMandate"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ChallengeIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChallengeIndicatorOption { get; private set; } /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` - [JsonPropertyName("challengeIndicator")] - [Obsolete] - public ChallengeIndicatorEnum? ChallengeIndicator { get { return this.ChallengeIndicatorOption; } set { this.ChallengeIndicatorOption = new Option(value); } } - + [DataMember(Name = "challengeIndicator", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v68. Use `threeDSRequestorChallengeInd` instead.")] + public ChallengeIndicatorEnum? ChallengeIndicator { get; set; } /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSRequestorChallengeIndEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// + [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// + [EnumMember(Value = "06")] _06 = 6 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ThreeDSRequestorChallengeIndEnum ThreeDSRequestorChallengeIndEnumFromString(string value) - { - if (value.Equals("01")) - return ThreeDSRequestorChallengeIndEnum._01; - - if (value.Equals("02")) - return ThreeDSRequestorChallengeIndEnum._02; - - if (value.Equals("03")) - return ThreeDSRequestorChallengeIndEnum._03; - - if (value.Equals("04")) - return ThreeDSRequestorChallengeIndEnum._04; - if (value.Equals("05")) - return ThreeDSRequestorChallengeIndEnum._05; - - if (value.Equals("06")) - return ThreeDSRequestorChallengeIndEnum._06; - - throw new NotImplementedException($"Could not convert value to type ThreeDSRequestorChallengeIndEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeIndEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ThreeDSRequestorChallengeIndEnum._01; - - if (value.Equals("02")) - return ThreeDSRequestorChallengeIndEnum._02; - - if (value.Equals("03")) - return ThreeDSRequestorChallengeIndEnum._03; - - if (value.Equals("04")) - return ThreeDSRequestorChallengeIndEnum._04; - - if (value.Equals("05")) - return ThreeDSRequestorChallengeIndEnum._05; - - if (value.Equals("06")) - return ThreeDSRequestorChallengeIndEnum._06; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ThreeDSRequestorChallengeIndEnumToJsonValue(ThreeDSRequestorChallengeIndEnum? value) - { - if (value == ThreeDSRequestorChallengeIndEnum._01) - return "01"; - - if (value == ThreeDSRequestorChallengeIndEnum._02) - return "02"; - - if (value == ThreeDSRequestorChallengeIndEnum._03) - return "03"; - - if (value == ThreeDSRequestorChallengeIndEnum._04) - return "04"; - - if (value == ThreeDSRequestorChallengeIndEnum._05) - return "05"; - - if (value == ThreeDSRequestorChallengeIndEnum._06) - return "06"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of ThreeDSRequestorChallengeInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorChallengeIndOption { get; private set; } /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - [JsonPropertyName("threeDSRequestorChallengeInd")] - public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get { return this.ThreeDSRequestorChallengeIndOption; } set { this.ThreeDSRequestorChallengeIndOption = new Option(value); } } - + [DataMember(Name = "threeDSRequestorChallengeInd", EmitDefaultValue = false)] + public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get; set; } /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load + [JsonConverter(typeof(StringEnumConverter))] public enum TransTypeEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 2, /// /// Enum _10 for value: 10 /// + [EnumMember(Value = "10")] _10 = 3, /// /// Enum _11 for value: 11 /// + [EnumMember(Value = "11")] _11 = 4, /// /// Enum _28 for value: 28 /// + [EnumMember(Value = "28")] _28 = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TransTypeEnum TransTypeEnumFromString(string value) - { - if (value.Equals("01")) - return TransTypeEnum._01; - - if (value.Equals("03")) - return TransTypeEnum._03; - - if (value.Equals("10")) - return TransTypeEnum._10; - if (value.Equals("11")) - return TransTypeEnum._11; - - if (value.Equals("28")) - return TransTypeEnum._28; - - throw new NotImplementedException($"Could not convert value to type TransTypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TransTypeEnum? TransTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return TransTypeEnum._01; - - if (value.Equals("03")) - return TransTypeEnum._03; - - if (value.Equals("10")) - return TransTypeEnum._10; - - if (value.Equals("11")) - return TransTypeEnum._11; - - if (value.Equals("28")) - return TransTypeEnum._28; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TransTypeEnumToJsonValue(TransTypeEnum? value) - { - if (value == TransTypeEnum._01) - return "01"; - - if (value == TransTypeEnum._03) - return "03"; - - if (value == TransTypeEnum._10) - return "10"; - - if (value == TransTypeEnum._11) - return "11"; - - if (value == TransTypeEnum._28) - return "28"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of TransType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TransTypeOption { get; private set; } /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load - [JsonPropertyName("transType")] - public TransTypeEnum? TransType { get { return this.TransTypeOption; } set { this.TransTypeOption = new Option(value); } } - + [DataMember(Name = "transType", EmitDefaultValue = false)] + public TransTypeEnum? TransType { get; set; } /// /// Identify the type of the transaction being authenticated. /// /// Identify the type of the transaction being authenticated. + [JsonConverter(typeof(StringEnumConverter))] public enum TransactionTypeEnum { /// /// Enum GoodsOrServicePurchase for value: goodsOrServicePurchase /// + [EnumMember(Value = "goodsOrServicePurchase")] GoodsOrServicePurchase = 1, /// /// Enum CheckAcceptance for value: checkAcceptance /// + [EnumMember(Value = "checkAcceptance")] CheckAcceptance = 2, /// /// Enum AccountFunding for value: accountFunding /// + [EnumMember(Value = "accountFunding")] AccountFunding = 3, /// /// Enum QuasiCashTransaction for value: quasiCashTransaction /// + [EnumMember(Value = "quasiCashTransaction")] QuasiCashTransaction = 4, /// /// Enum PrepaidActivationAndLoad for value: prepaidActivationAndLoad /// + [EnumMember(Value = "prepaidActivationAndLoad")] PrepaidActivationAndLoad = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TransactionTypeEnum TransactionTypeEnumFromString(string value) - { - if (value.Equals("goodsOrServicePurchase")) - return TransactionTypeEnum.GoodsOrServicePurchase; - - if (value.Equals("checkAcceptance")) - return TransactionTypeEnum.CheckAcceptance; - if (value.Equals("accountFunding")) - return TransactionTypeEnum.AccountFunding; - - if (value.Equals("quasiCashTransaction")) - return TransactionTypeEnum.QuasiCashTransaction; - - if (value.Equals("prepaidActivationAndLoad")) - return TransactionTypeEnum.PrepaidActivationAndLoad; - - throw new NotImplementedException($"Could not convert value to type TransactionTypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TransactionTypeEnum? TransactionTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("goodsOrServicePurchase")) - return TransactionTypeEnum.GoodsOrServicePurchase; - - if (value.Equals("checkAcceptance")) - return TransactionTypeEnum.CheckAcceptance; - - if (value.Equals("accountFunding")) - return TransactionTypeEnum.AccountFunding; - - if (value.Equals("quasiCashTransaction")) - return TransactionTypeEnum.QuasiCashTransaction; - - if (value.Equals("prepaidActivationAndLoad")) - return TransactionTypeEnum.PrepaidActivationAndLoad; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TransactionTypeEnumToJsonValue(TransactionTypeEnum? value) - { - if (value == TransactionTypeEnum.GoodsOrServicePurchase) - return "goodsOrServicePurchase"; - - if (value == TransactionTypeEnum.CheckAcceptance) - return "checkAcceptance"; - - if (value == TransactionTypeEnum.AccountFunding) - return "accountFunding"; - - if (value == TransactionTypeEnum.QuasiCashTransaction) - return "quasiCashTransaction"; - - if (value == TransactionTypeEnum.PrepaidActivationAndLoad) - return "prepaidActivationAndLoad"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of TransactionType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TransactionTypeOption { get; private set; } /// /// Identify the type of the transaction being authenticated. /// /// Identify the type of the transaction being authenticated. - [JsonPropertyName("transactionType")] - public TransactionTypeEnum? TransactionType { get { return this.TransactionTypeOption; } set { this.TransactionTypeOption = new Option(value); } } - + [DataMember(Name = "transactionType", EmitDefaultValue = false)] + public TransactionTypeEnum? TransactionType { get; set; } /// - /// The environment of the shopper. Allowed values: * `app` * `browser` + /// Initializes a new instance of the class. /// - /// The environment of the shopper. Allowed values: * `app` * `browser` - [JsonPropertyName("deviceChannel")] - public string DeviceChannel { get; set; } - + [JsonConstructorAttribute] + protected ThreeDS2RequestData() { } /// - /// Used to track the state of AcctInfo + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcctInfoOption { get; private set; } + /// acctInfo. + /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform.. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform.. + /// Indicates whether the cardholder shipping address and cardholder billing address are the same. Allowed values: * **Y** — Shipping address matches billing address. * **N** — Shipping address does not match billing address.. + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false). + /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` . + /// The environment of the shopper. Allowed values: * `app` * `browser` (required). + /// deviceRenderOptions. + /// homePhone. + /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme.. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account.. + /// The `messageVersion` value indicating the 3D Secure 2 protocol version.. + /// mobilePhone. + /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**.. + /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS.. + /// Indicates the type of payment for which an authentication is requested (message extension). + /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters.. + /// Date after which no further authorisations shall be performed. Format: YYYYMMDD. + /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters.. + /// The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**.. + /// The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**.. + /// sdkEphemPubKey. + /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. (default to 60). + /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**.. + /// The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**.. + /// Version of the 3D Secure 2 mobile SDK. Only for `deviceChannel` set to **app**.. + /// Completion indicator for the device fingerprinting.. + /// Indicates the type of Authentication request.. + /// threeDSRequestorAuthenticationInfo. + /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2.. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2.. + /// threeDSRequestorPriorAuthenticationInfo. + /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process.. + /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load. + /// Identify the type of the transaction being authenticated.. + /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0.. + /// workPhone. + public ThreeDS2RequestData(AcctInfo acctInfo = default(AcctInfo), AcctTypeEnum? acctType = default(AcctTypeEnum?), string acquirerBIN = default(string), string acquirerMerchantID = default(string), AddrMatchEnum? addrMatch = default(AddrMatchEnum?), bool? authenticationOnly = false, ChallengeIndicatorEnum? challengeIndicator = default(ChallengeIndicatorEnum?), string deviceChannel = default(string), DeviceRenderOptions deviceRenderOptions = default(DeviceRenderOptions), Phone homePhone = default(Phone), string mcc = default(string), string merchantName = default(string), string messageVersion = default(string), Phone mobilePhone = default(Phone), string notificationURL = default(string), bool? payTokenInd = default(bool?), string paymentAuthenticationUseCase = default(string), string purchaseInstalData = default(string), string recurringExpiry = default(string), string recurringFrequency = default(string), string sdkAppID = default(string), string sdkEncData = default(string), SDKEphemPubKey sdkEphemPubKey = default(SDKEphemPubKey), int? sdkMaxTimeout = 60, string sdkReferenceNumber = default(string), string sdkTransID = default(string), string sdkVersion = default(string), string threeDSCompInd = default(string), string threeDSRequestorAuthenticationInd = default(string), ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo = default(ThreeDSRequestorAuthenticationInfo), ThreeDSRequestorChallengeIndEnum? threeDSRequestorChallengeInd = default(ThreeDSRequestorChallengeIndEnum?), string threeDSRequestorID = default(string), string threeDSRequestorName = default(string), ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo = default(ThreeDSRequestorPriorAuthenticationInfo), string threeDSRequestorURL = default(string), TransTypeEnum? transType = default(TransTypeEnum?), TransactionTypeEnum? transactionType = default(TransactionTypeEnum?), string whiteListStatus = default(string), Phone workPhone = default(Phone)) + { + this.DeviceChannel = deviceChannel; + this.AcctInfo = acctInfo; + this.AcctType = acctType; + this.AcquirerBIN = acquirerBIN; + this.AcquirerMerchantID = acquirerMerchantID; + this.AddrMatch = addrMatch; + this.AuthenticationOnly = authenticationOnly; + this.ChallengeIndicator = challengeIndicator; + this.DeviceRenderOptions = deviceRenderOptions; + this.HomePhone = homePhone; + this.Mcc = mcc; + this.MerchantName = merchantName; + this.MessageVersion = messageVersion; + this.MobilePhone = mobilePhone; + this.NotificationURL = notificationURL; + this.PayTokenInd = payTokenInd; + this.PaymentAuthenticationUseCase = paymentAuthenticationUseCase; + this.PurchaseInstalData = purchaseInstalData; + this.RecurringExpiry = recurringExpiry; + this.RecurringFrequency = recurringFrequency; + this.SdkAppID = sdkAppID; + this.SdkEncData = sdkEncData; + this.SdkEphemPubKey = sdkEphemPubKey; + this.SdkMaxTimeout = sdkMaxTimeout; + this.SdkReferenceNumber = sdkReferenceNumber; + this.SdkTransID = sdkTransID; + this.SdkVersion = sdkVersion; + this.ThreeDSCompInd = threeDSCompInd; + this.ThreeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; + this.ThreeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; + this.ThreeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + this.ThreeDSRequestorID = threeDSRequestorID; + this.ThreeDSRequestorName = threeDSRequestorName; + this.ThreeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; + this.ThreeDSRequestorURL = threeDSRequestorURL; + this.TransType = transType; + this.TransactionType = transactionType; + this.WhiteListStatus = whiteListStatus; + this.WorkPhone = workPhone; + } /// /// Gets or Sets AcctInfo /// - [JsonPropertyName("acctInfo")] - public AcctInfo AcctInfo { get { return this.AcctInfoOption; } set { this.AcctInfoOption = new Option(value); } } - - /// - /// Used to track the state of AcquirerBIN - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcquirerBINOption { get; private set; } + [DataMember(Name = "acctInfo", EmitDefaultValue = false)] + public AcctInfo AcctInfo { get; set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. - [JsonPropertyName("acquirerBIN")] - public string AcquirerBIN { get { return this.AcquirerBINOption; } set { this.AcquirerBINOption = new Option(value); } } - - /// - /// Used to track the state of AcquirerMerchantID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcquirerMerchantIDOption { get; private set; } + [DataMember(Name = "acquirerBIN", EmitDefaultValue = false)] + public string AcquirerBIN { get; set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. - [JsonPropertyName("acquirerMerchantID")] - public string AcquirerMerchantID { get { return this.AcquirerMerchantIDOption; } set { this.AcquirerMerchantIDOption = new Option(value); } } - - /// - /// Used to track the state of AuthenticationOnly - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthenticationOnlyOption { get; private set; } + [DataMember(Name = "acquirerMerchantID", EmitDefaultValue = false)] + public string AcquirerMerchantID { get; set; } /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [JsonPropertyName("authenticationOnly")] - [Obsolete] - public bool? AuthenticationOnly { get { return this.AuthenticationOnlyOption; } set { this.AuthenticationOnlyOption = new Option(value); } } + [DataMember(Name = "authenticationOnly", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v50. Use `threeDSAuthenticationOnly` instead.")] + public bool? AuthenticationOnly { get; set; } /// - /// Used to track the state of DeviceRenderOptions + /// The environment of the shopper. Allowed values: * `app` * `browser` /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeviceRenderOptionsOption { get; private set; } + /// The environment of the shopper. Allowed values: * `app` * `browser` + [DataMember(Name = "deviceChannel", IsRequired = false, EmitDefaultValue = false)] + public string DeviceChannel { get; set; } /// /// Gets or Sets DeviceRenderOptions /// - [JsonPropertyName("deviceRenderOptions")] - public DeviceRenderOptions DeviceRenderOptions { get { return this.DeviceRenderOptionsOption; } set { this.DeviceRenderOptionsOption = new Option(value); } } - - /// - /// Used to track the state of HomePhone - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option HomePhoneOption { get; private set; } + [DataMember(Name = "deviceRenderOptions", EmitDefaultValue = false)] + public DeviceRenderOptions DeviceRenderOptions { get; set; } /// /// Gets or Sets HomePhone /// - [JsonPropertyName("homePhone")] - public Phone HomePhone { get { return this.HomePhoneOption; } set { this.HomePhoneOption = new Option(value); } } - - /// - /// Used to track the state of Mcc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MccOption { get; private set; } + [DataMember(Name = "homePhone", EmitDefaultValue = false)] + public Phone HomePhone { get; set; } /// /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. /// /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. - [JsonPropertyName("mcc")] - public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } - - /// - /// Used to track the state of MerchantName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantNameOption { get; private set; } + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string Mcc { get; set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. - [JsonPropertyName("merchantName")] - public string MerchantName { get { return this.MerchantNameOption; } set { this.MerchantNameOption = new Option(value); } } - - /// - /// Used to track the state of MessageVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MessageVersionOption { get; private set; } + [DataMember(Name = "merchantName", EmitDefaultValue = false)] + public string MerchantName { get; set; } /// /// The `messageVersion` value indicating the 3D Secure 2 protocol version. /// /// The `messageVersion` value indicating the 3D Secure 2 protocol version. - [JsonPropertyName("messageVersion")] - public string MessageVersion { get { return this.MessageVersionOption; } set { this.MessageVersionOption = new Option(value); } } - - /// - /// Used to track the state of MobilePhone - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MobilePhoneOption { get; private set; } + [DataMember(Name = "messageVersion", EmitDefaultValue = false)] + public string MessageVersion { get; set; } /// /// Gets or Sets MobilePhone /// - [JsonPropertyName("mobilePhone")] - public Phone MobilePhone { get { return this.MobilePhoneOption; } set { this.MobilePhoneOption = new Option(value); } } - - /// - /// Used to track the state of NotificationURL - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NotificationURLOption { get; private set; } + [DataMember(Name = "mobilePhone", EmitDefaultValue = false)] + public Phone MobilePhone { get; set; } /// /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. /// /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. - [JsonPropertyName("notificationURL")] - public string NotificationURL { get { return this.NotificationURLOption; } set { this.NotificationURLOption = new Option(value); } } - - /// - /// Used to track the state of PayTokenInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayTokenIndOption { get; private set; } + [DataMember(Name = "notificationURL", EmitDefaultValue = false)] + public string NotificationURL { get; set; } /// /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. /// /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. - [JsonPropertyName("payTokenInd")] - public bool? PayTokenInd { get { return this.PayTokenIndOption; } set { this.PayTokenIndOption = new Option(value); } } - - /// - /// Used to track the state of PaymentAuthenticationUseCase - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentAuthenticationUseCaseOption { get; private set; } + [DataMember(Name = "payTokenInd", EmitDefaultValue = false)] + public bool? PayTokenInd { get; set; } /// /// Indicates the type of payment for which an authentication is requested (message extension) /// /// Indicates the type of payment for which an authentication is requested (message extension) - [JsonPropertyName("paymentAuthenticationUseCase")] - public string PaymentAuthenticationUseCase { get { return this.PaymentAuthenticationUseCaseOption; } set { this.PaymentAuthenticationUseCaseOption = new Option(value); } } - - /// - /// Used to track the state of PurchaseInstalData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PurchaseInstalDataOption { get; private set; } + [DataMember(Name = "paymentAuthenticationUseCase", EmitDefaultValue = false)] + public string PaymentAuthenticationUseCase { get; set; } /// /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. /// /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. - [JsonPropertyName("purchaseInstalData")] - public string PurchaseInstalData { get { return this.PurchaseInstalDataOption; } set { this.PurchaseInstalDataOption = new Option(value); } } - - /// - /// Used to track the state of RecurringExpiry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringExpiryOption { get; private set; } + [DataMember(Name = "purchaseInstalData", EmitDefaultValue = false)] + public string PurchaseInstalData { get; set; } /// /// Date after which no further authorisations shall be performed. Format: YYYYMMDD /// /// Date after which no further authorisations shall be performed. Format: YYYYMMDD - [JsonPropertyName("recurringExpiry")] - public string RecurringExpiry { get { return this.RecurringExpiryOption; } set { this.RecurringExpiryOption = new Option(value); } } - - /// - /// Used to track the state of RecurringFrequency - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringFrequencyOption { get; private set; } + [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] + public string RecurringExpiry { get; set; } /// /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters. /// /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters. - [JsonPropertyName("recurringFrequency")] - public string RecurringFrequency { get { return this.RecurringFrequencyOption; } set { this.RecurringFrequencyOption = new Option(value); } } - - /// - /// Used to track the state of SdkAppID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkAppIDOption { get; private set; } + [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] + public string RecurringFrequency { get; set; } /// /// The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. /// /// The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. - [JsonPropertyName("sdkAppID")] - public string SdkAppID { get { return this.SdkAppIDOption; } set { this.SdkAppIDOption = new Option(value); } } - - /// - /// Used to track the state of SdkEncData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkEncDataOption { get; private set; } + [DataMember(Name = "sdkAppID", EmitDefaultValue = false)] + public string SdkAppID { get; set; } /// /// The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. /// /// The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. - [JsonPropertyName("sdkEncData")] - public string SdkEncData { get { return this.SdkEncDataOption; } set { this.SdkEncDataOption = new Option(value); } } - - /// - /// Used to track the state of SdkEphemPubKey - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkEphemPubKeyOption { get; private set; } + [DataMember(Name = "sdkEncData", EmitDefaultValue = false)] + public string SdkEncData { get; set; } /// /// Gets or Sets SdkEphemPubKey /// - [JsonPropertyName("sdkEphemPubKey")] - public SDKEphemPubKey SdkEphemPubKey { get { return this.SdkEphemPubKeyOption; } set { this.SdkEphemPubKeyOption = new Option(value); } } - - /// - /// Used to track the state of SdkMaxTimeout - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkMaxTimeoutOption { get; private set; } + [DataMember(Name = "sdkEphemPubKey", EmitDefaultValue = false)] + public SDKEphemPubKey SdkEphemPubKey { get; set; } /// /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. /// /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. - [JsonPropertyName("sdkMaxTimeout")] - public int? SdkMaxTimeout { get { return this.SdkMaxTimeoutOption; } set { this.SdkMaxTimeoutOption = new Option(value); } } - - /// - /// Used to track the state of SdkReferenceNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkReferenceNumberOption { get; private set; } + [DataMember(Name = "sdkMaxTimeout", EmitDefaultValue = false)] + public int? SdkMaxTimeout { get; set; } /// /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. /// /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. - [JsonPropertyName("sdkReferenceNumber")] - public string SdkReferenceNumber { get { return this.SdkReferenceNumberOption; } set { this.SdkReferenceNumberOption = new Option(value); } } - - /// - /// Used to track the state of SdkTransID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkTransIDOption { get; private set; } + [DataMember(Name = "sdkReferenceNumber", EmitDefaultValue = false)] + public string SdkReferenceNumber { get; set; } /// /// The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. /// /// The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. - [JsonPropertyName("sdkTransID")] - public string SdkTransID { get { return this.SdkTransIDOption; } set { this.SdkTransIDOption = new Option(value); } } - - /// - /// Used to track the state of SdkVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkVersionOption { get; private set; } + [DataMember(Name = "sdkTransID", EmitDefaultValue = false)] + public string SdkTransID { get; set; } /// /// Version of the 3D Secure 2 mobile SDK. Only for `deviceChannel` set to **app**. /// /// Version of the 3D Secure 2 mobile SDK. Only for `deviceChannel` set to **app**. - [JsonPropertyName("sdkVersion")] - public string SdkVersion { get { return this.SdkVersionOption; } set { this.SdkVersionOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSCompInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSCompIndOption { get; private set; } + [DataMember(Name = "sdkVersion", EmitDefaultValue = false)] + public string SdkVersion { get; set; } /// /// Completion indicator for the device fingerprinting. /// /// Completion indicator for the device fingerprinting. - [JsonPropertyName("threeDSCompInd")] - public string ThreeDSCompInd { get { return this.ThreeDSCompIndOption; } set { this.ThreeDSCompIndOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSRequestorAuthenticationInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorAuthenticationIndOption { get; private set; } + [DataMember(Name = "threeDSCompInd", EmitDefaultValue = false)] + public string ThreeDSCompInd { get; set; } /// /// Indicates the type of Authentication request. /// /// Indicates the type of Authentication request. - [JsonPropertyName("threeDSRequestorAuthenticationInd")] - public string ThreeDSRequestorAuthenticationInd { get { return this.ThreeDSRequestorAuthenticationIndOption; } set { this.ThreeDSRequestorAuthenticationIndOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSRequestorAuthenticationInfo - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorAuthenticationInfoOption { get; private set; } + [DataMember(Name = "threeDSRequestorAuthenticationInd", EmitDefaultValue = false)] + public string ThreeDSRequestorAuthenticationInd { get; set; } /// /// Gets or Sets ThreeDSRequestorAuthenticationInfo /// - [JsonPropertyName("threeDSRequestorAuthenticationInfo")] - public ThreeDSRequestorAuthenticationInfo ThreeDSRequestorAuthenticationInfo { get { return this.ThreeDSRequestorAuthenticationInfoOption; } set { this.ThreeDSRequestorAuthenticationInfoOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSRequestorID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorIDOption { get; private set; } + [DataMember(Name = "threeDSRequestorAuthenticationInfo", EmitDefaultValue = false)] + public ThreeDSRequestorAuthenticationInfo ThreeDSRequestorAuthenticationInfo { get; set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. - [JsonPropertyName("threeDSRequestorID")] - public string ThreeDSRequestorID { get { return this.ThreeDSRequestorIDOption; } set { this.ThreeDSRequestorIDOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSRequestorName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorNameOption { get; private set; } + [DataMember(Name = "threeDSRequestorID", EmitDefaultValue = false)] + public string ThreeDSRequestorID { get; set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. - [JsonPropertyName("threeDSRequestorName")] - public string ThreeDSRequestorName { get { return this.ThreeDSRequestorNameOption; } set { this.ThreeDSRequestorNameOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSRequestorPriorAuthenticationInfo - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorPriorAuthenticationInfoOption { get; private set; } + [DataMember(Name = "threeDSRequestorName", EmitDefaultValue = false)] + public string ThreeDSRequestorName { get; set; } /// /// Gets or Sets ThreeDSRequestorPriorAuthenticationInfo /// - [JsonPropertyName("threeDSRequestorPriorAuthenticationInfo")] - public ThreeDSRequestorPriorAuthenticationInfo ThreeDSRequestorPriorAuthenticationInfo { get { return this.ThreeDSRequestorPriorAuthenticationInfoOption; } set { this.ThreeDSRequestorPriorAuthenticationInfoOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSRequestorURL - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorURLOption { get; private set; } + [DataMember(Name = "threeDSRequestorPriorAuthenticationInfo", EmitDefaultValue = false)] + public ThreeDSRequestorPriorAuthenticationInfo ThreeDSRequestorPriorAuthenticationInfo { get; set; } /// /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. /// /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. - [JsonPropertyName("threeDSRequestorURL")] - public string ThreeDSRequestorURL { get { return this.ThreeDSRequestorURLOption; } set { this.ThreeDSRequestorURLOption = new Option(value); } } - - /// - /// Used to track the state of WhiteListStatus - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option WhiteListStatusOption { get; private set; } + [DataMember(Name = "threeDSRequestorURL", EmitDefaultValue = false)] + public string ThreeDSRequestorURL { get; set; } /// /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. /// /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. - [JsonPropertyName("whiteListStatus")] - public string WhiteListStatus { get { return this.WhiteListStatusOption; } set { this.WhiteListStatusOption = new Option(value); } } - - /// - /// Used to track the state of WorkPhone - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option WorkPhoneOption { get; private set; } + [DataMember(Name = "whiteListStatus", EmitDefaultValue = false)] + public string WhiteListStatus { get; set; } /// /// Gets or Sets WorkPhone /// - [JsonPropertyName("workPhone")] - public Phone WorkPhone { get { return this.WorkPhoneOption; } set { this.WorkPhoneOption = new Option(value); } } + [DataMember(Name = "workPhone", EmitDefaultValue = false)] + public Phone WorkPhone { get; set; } /// /// Returns the string presentation of the object @@ -1242,7 +601,6 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class ThreeDS2RequestData {\n"); - sb.Append(" DeviceChannel: ").Append(DeviceChannel).Append("\n"); sb.Append(" AcctInfo: ").Append(AcctInfo).Append("\n"); sb.Append(" AcctType: ").Append(AcctType).Append("\n"); sb.Append(" AcquirerBIN: ").Append(AcquirerBIN).Append("\n"); @@ -1250,6 +608,7 @@ public override string ToString() sb.Append(" AddrMatch: ").Append(AddrMatch).Append("\n"); sb.Append(" AuthenticationOnly: ").Append(AuthenticationOnly).Append("\n"); sb.Append(" ChallengeIndicator: ").Append(ChallengeIndicator).Append("\n"); + sb.Append(" DeviceChannel: ").Append(DeviceChannel).Append("\n"); sb.Append(" DeviceRenderOptions: ").Append(DeviceRenderOptions).Append("\n"); sb.Append(" HomePhone: ").Append(HomePhone).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); @@ -1286,620 +645,392 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // PurchaseInstalData (string) maxLength - if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length > 3) - { - yield return new ValidationResult("Invalid value for PurchaseInstalData, length must be less than 3.", new [] { "PurchaseInstalData" }); - } - - // PurchaseInstalData (string) minLength - if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length < 1) - { - yield return new ValidationResult("Invalid value for PurchaseInstalData, length must be greater than 1.", new [] { "PurchaseInstalData" }); - } - - // RecurringFrequency (string) maxLength - if (this.RecurringFrequency != null && this.RecurringFrequency.Length > 4) - { - yield return new ValidationResult("Invalid value for RecurringFrequency, length must be less than 4.", new [] { "RecurringFrequency" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ThreeDS2RequestDataJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ThreeDS2RequestData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option deviceChannel = default; - Option acctInfo = default; - Option acctType = default; - Option acquirerBIN = default; - Option acquirerMerchantID = default; - Option addrMatch = default; - Option authenticationOnly = default; - Option challengeIndicator = default; - Option deviceRenderOptions = default; - Option homePhone = default; - Option mcc = default; - Option merchantName = default; - Option messageVersion = default; - Option mobilePhone = default; - Option notificationURL = default; - Option payTokenInd = default; - Option paymentAuthenticationUseCase = default; - Option purchaseInstalData = default; - Option recurringExpiry = default; - Option recurringFrequency = default; - Option sdkAppID = default; - Option sdkEncData = default; - Option sdkEphemPubKey = default; - Option sdkMaxTimeout = default; - Option sdkReferenceNumber = default; - Option sdkTransID = default; - Option sdkVersion = default; - Option threeDSCompInd = default; - Option threeDSRequestorAuthenticationInd = default; - Option threeDSRequestorAuthenticationInfo = default; - Option threeDSRequestorChallengeInd = default; - Option threeDSRequestorID = default; - Option threeDSRequestorName = default; - Option threeDSRequestorPriorAuthenticationInfo = default; - Option threeDSRequestorURL = default; - Option transType = default; - Option transactionType = default; - Option whiteListStatus = default; - Option workPhone = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "deviceChannel": - deviceChannel = new Option(utf8JsonReader.GetString()); - break; - case "acctInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - acctInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "acctType": - string acctTypeRawValue = utf8JsonReader.GetString(); - if (acctTypeRawValue != null) - acctType = new Option(ThreeDS2RequestData.AcctTypeEnumFromStringOrDefault(acctTypeRawValue)); - break; - case "acquirerBIN": - acquirerBIN = new Option(utf8JsonReader.GetString()); - break; - case "acquirerMerchantID": - acquirerMerchantID = new Option(utf8JsonReader.GetString()); - break; - case "addrMatch": - string addrMatchRawValue = utf8JsonReader.GetString(); - if (addrMatchRawValue != null) - addrMatch = new Option(ThreeDS2RequestData.AddrMatchEnumFromStringOrDefault(addrMatchRawValue)); - break; - case "authenticationOnly": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - authenticationOnly = new Option(utf8JsonReader.GetBoolean()); - break; - case "challengeIndicator": - string challengeIndicatorRawValue = utf8JsonReader.GetString(); - if (challengeIndicatorRawValue != null) - challengeIndicator = new Option(ThreeDS2RequestData.ChallengeIndicatorEnumFromStringOrDefault(challengeIndicatorRawValue)); - break; - case "deviceRenderOptions": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deviceRenderOptions = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "homePhone": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - homePhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mcc": - mcc = new Option(utf8JsonReader.GetString()); - break; - case "merchantName": - merchantName = new Option(utf8JsonReader.GetString()); - break; - case "messageVersion": - messageVersion = new Option(utf8JsonReader.GetString()); - break; - case "mobilePhone": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mobilePhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "notificationURL": - notificationURL = new Option(utf8JsonReader.GetString()); - break; - case "payTokenInd": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - payTokenInd = new Option(utf8JsonReader.GetBoolean()); - break; - case "paymentAuthenticationUseCase": - paymentAuthenticationUseCase = new Option(utf8JsonReader.GetString()); - break; - case "purchaseInstalData": - purchaseInstalData = new Option(utf8JsonReader.GetString()); - break; - case "recurringExpiry": - recurringExpiry = new Option(utf8JsonReader.GetString()); - break; - case "recurringFrequency": - recurringFrequency = new Option(utf8JsonReader.GetString()); - break; - case "sdkAppID": - sdkAppID = new Option(utf8JsonReader.GetString()); - break; - case "sdkEncData": - sdkEncData = new Option(utf8JsonReader.GetString()); - break; - case "sdkEphemPubKey": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sdkEphemPubKey = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "sdkMaxTimeout": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sdkMaxTimeout = new Option(utf8JsonReader.GetInt32()); - break; - case "sdkReferenceNumber": - sdkReferenceNumber = new Option(utf8JsonReader.GetString()); - break; - case "sdkTransID": - sdkTransID = new Option(utf8JsonReader.GetString()); - break; - case "sdkVersion": - sdkVersion = new Option(utf8JsonReader.GetString()); - break; - case "threeDSCompInd": - threeDSCompInd = new Option(utf8JsonReader.GetString()); - break; - case "threeDSRequestorAuthenticationInd": - threeDSRequestorAuthenticationInd = new Option(utf8JsonReader.GetString()); - break; - case "threeDSRequestorAuthenticationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDSRequestorAuthenticationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDSRequestorChallengeInd": - string threeDSRequestorChallengeIndRawValue = utf8JsonReader.GetString(); - if (threeDSRequestorChallengeIndRawValue != null) - threeDSRequestorChallengeInd = new Option(ThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumFromStringOrDefault(threeDSRequestorChallengeIndRawValue)); - break; - case "threeDSRequestorID": - threeDSRequestorID = new Option(utf8JsonReader.GetString()); - break; - case "threeDSRequestorName": - threeDSRequestorName = new Option(utf8JsonReader.GetString()); - break; - case "threeDSRequestorPriorAuthenticationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDSRequestorPriorAuthenticationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDSRequestorURL": - threeDSRequestorURL = new Option(utf8JsonReader.GetString()); - break; - case "transType": - string transTypeRawValue = utf8JsonReader.GetString(); - if (transTypeRawValue != null) - transType = new Option(ThreeDS2RequestData.TransTypeEnumFromStringOrDefault(transTypeRawValue)); - break; - case "transactionType": - string transactionTypeRawValue = utf8JsonReader.GetString(); - if (transactionTypeRawValue != null) - transactionType = new Option(ThreeDS2RequestData.TransactionTypeEnumFromStringOrDefault(transactionTypeRawValue)); - break; - case "whiteListStatus": - whiteListStatus = new Option(utf8JsonReader.GetString()); - break; - case "workPhone": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - workPhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (!deviceChannel.IsSet) - throw new ArgumentException("Property is required for class ThreeDS2RequestData.", nameof(deviceChannel)); - - if (deviceChannel.IsSet && deviceChannel.Value == null) - throw new ArgumentNullException(nameof(deviceChannel), "Property is not nullable for class ThreeDS2RequestData."); - - if (acctInfo.IsSet && acctInfo.Value == null) - throw new ArgumentNullException(nameof(acctInfo), "Property is not nullable for class ThreeDS2RequestData."); - - if (acctType.IsSet && acctType.Value == null) - throw new ArgumentNullException(nameof(acctType), "Property is not nullable for class ThreeDS2RequestData."); - - if (acquirerBIN.IsSet && acquirerBIN.Value == null) - throw new ArgumentNullException(nameof(acquirerBIN), "Property is not nullable for class ThreeDS2RequestData."); - - if (acquirerMerchantID.IsSet && acquirerMerchantID.Value == null) - throw new ArgumentNullException(nameof(acquirerMerchantID), "Property is not nullable for class ThreeDS2RequestData."); - - if (addrMatch.IsSet && addrMatch.Value == null) - throw new ArgumentNullException(nameof(addrMatch), "Property is not nullable for class ThreeDS2RequestData."); - - if (authenticationOnly.IsSet && authenticationOnly.Value == null) - throw new ArgumentNullException(nameof(authenticationOnly), "Property is not nullable for class ThreeDS2RequestData."); - - if (challengeIndicator.IsSet && challengeIndicator.Value == null) - throw new ArgumentNullException(nameof(challengeIndicator), "Property is not nullable for class ThreeDS2RequestData."); - - if (deviceRenderOptions.IsSet && deviceRenderOptions.Value == null) - throw new ArgumentNullException(nameof(deviceRenderOptions), "Property is not nullable for class ThreeDS2RequestData."); - - if (homePhone.IsSet && homePhone.Value == null) - throw new ArgumentNullException(nameof(homePhone), "Property is not nullable for class ThreeDS2RequestData."); - - if (mcc.IsSet && mcc.Value == null) - throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class ThreeDS2RequestData."); - - if (merchantName.IsSet && merchantName.Value == null) - throw new ArgumentNullException(nameof(merchantName), "Property is not nullable for class ThreeDS2RequestData."); - - if (messageVersion.IsSet && messageVersion.Value == null) - throw new ArgumentNullException(nameof(messageVersion), "Property is not nullable for class ThreeDS2RequestData."); - - if (mobilePhone.IsSet && mobilePhone.Value == null) - throw new ArgumentNullException(nameof(mobilePhone), "Property is not nullable for class ThreeDS2RequestData."); - - if (notificationURL.IsSet && notificationURL.Value == null) - throw new ArgumentNullException(nameof(notificationURL), "Property is not nullable for class ThreeDS2RequestData."); - - if (payTokenInd.IsSet && payTokenInd.Value == null) - throw new ArgumentNullException(nameof(payTokenInd), "Property is not nullable for class ThreeDS2RequestData."); - - if (paymentAuthenticationUseCase.IsSet && paymentAuthenticationUseCase.Value == null) - throw new ArgumentNullException(nameof(paymentAuthenticationUseCase), "Property is not nullable for class ThreeDS2RequestData."); - - if (purchaseInstalData.IsSet && purchaseInstalData.Value == null) - throw new ArgumentNullException(nameof(purchaseInstalData), "Property is not nullable for class ThreeDS2RequestData."); - - if (recurringExpiry.IsSet && recurringExpiry.Value == null) - throw new ArgumentNullException(nameof(recurringExpiry), "Property is not nullable for class ThreeDS2RequestData."); - - if (recurringFrequency.IsSet && recurringFrequency.Value == null) - throw new ArgumentNullException(nameof(recurringFrequency), "Property is not nullable for class ThreeDS2RequestData."); - - if (sdkAppID.IsSet && sdkAppID.Value == null) - throw new ArgumentNullException(nameof(sdkAppID), "Property is not nullable for class ThreeDS2RequestData."); - - if (sdkEncData.IsSet && sdkEncData.Value == null) - throw new ArgumentNullException(nameof(sdkEncData), "Property is not nullable for class ThreeDS2RequestData."); - - if (sdkEphemPubKey.IsSet && sdkEphemPubKey.Value == null) - throw new ArgumentNullException(nameof(sdkEphemPubKey), "Property is not nullable for class ThreeDS2RequestData."); - - if (sdkMaxTimeout.IsSet && sdkMaxTimeout.Value == null) - throw new ArgumentNullException(nameof(sdkMaxTimeout), "Property is not nullable for class ThreeDS2RequestData."); - - if (sdkReferenceNumber.IsSet && sdkReferenceNumber.Value == null) - throw new ArgumentNullException(nameof(sdkReferenceNumber), "Property is not nullable for class ThreeDS2RequestData."); - - if (sdkTransID.IsSet && sdkTransID.Value == null) - throw new ArgumentNullException(nameof(sdkTransID), "Property is not nullable for class ThreeDS2RequestData."); - - if (sdkVersion.IsSet && sdkVersion.Value == null) - throw new ArgumentNullException(nameof(sdkVersion), "Property is not nullable for class ThreeDS2RequestData."); - - if (threeDSCompInd.IsSet && threeDSCompInd.Value == null) - throw new ArgumentNullException(nameof(threeDSCompInd), "Property is not nullable for class ThreeDS2RequestData."); - - if (threeDSRequestorAuthenticationInd.IsSet && threeDSRequestorAuthenticationInd.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorAuthenticationInd), "Property is not nullable for class ThreeDS2RequestData."); - - if (threeDSRequestorAuthenticationInfo.IsSet && threeDSRequestorAuthenticationInfo.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorAuthenticationInfo), "Property is not nullable for class ThreeDS2RequestData."); - - if (threeDSRequestorChallengeInd.IsSet && threeDSRequestorChallengeInd.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorChallengeInd), "Property is not nullable for class ThreeDS2RequestData."); - - if (threeDSRequestorID.IsSet && threeDSRequestorID.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorID), "Property is not nullable for class ThreeDS2RequestData."); - - if (threeDSRequestorName.IsSet && threeDSRequestorName.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorName), "Property is not nullable for class ThreeDS2RequestData."); - - if (threeDSRequestorPriorAuthenticationInfo.IsSet && threeDSRequestorPriorAuthenticationInfo.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorPriorAuthenticationInfo), "Property is not nullable for class ThreeDS2RequestData."); - - if (threeDSRequestorURL.IsSet && threeDSRequestorURL.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorURL), "Property is not nullable for class ThreeDS2RequestData."); - - if (transType.IsSet && transType.Value == null) - throw new ArgumentNullException(nameof(transType), "Property is not nullable for class ThreeDS2RequestData."); - - if (transactionType.IsSet && transactionType.Value == null) - throw new ArgumentNullException(nameof(transactionType), "Property is not nullable for class ThreeDS2RequestData."); - - if (whiteListStatus.IsSet && whiteListStatus.Value == null) - throw new ArgumentNullException(nameof(whiteListStatus), "Property is not nullable for class ThreeDS2RequestData."); - - if (workPhone.IsSet && workPhone.Value == null) - throw new ArgumentNullException(nameof(workPhone), "Property is not nullable for class ThreeDS2RequestData."); - - return new ThreeDS2RequestData(deviceChannel.Value, acctInfo, acctType, acquirerBIN, acquirerMerchantID, addrMatch, authenticationOnly, challengeIndicator, deviceRenderOptions, homePhone, mcc, merchantName, messageVersion, mobilePhone, notificationURL, payTokenInd, paymentAuthenticationUseCase, purchaseInstalData, recurringExpiry, recurringFrequency, sdkAppID, sdkEncData, sdkEphemPubKey, sdkMaxTimeout, sdkReferenceNumber, sdkTransID, sdkVersion, threeDSCompInd, threeDSRequestorAuthenticationInd, threeDSRequestorAuthenticationInfo, threeDSRequestorChallengeInd, threeDSRequestorID, threeDSRequestorName, threeDSRequestorPriorAuthenticationInfo, threeDSRequestorURL, transType, transactionType, whiteListStatus, workPhone); + return this.Equals(input as ThreeDS2RequestData); } /// - /// Serializes a + /// Returns true if ThreeDS2RequestData instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ThreeDS2RequestData threeDS2RequestData, JsonSerializerOptions jsonSerializerOptions) + /// Instance of ThreeDS2RequestData to be compared + /// Boolean + public bool Equals(ThreeDS2RequestData input) { - writer.WriteStartObject(); - - WriteProperties(writer, threeDS2RequestData, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AcctInfo == input.AcctInfo || + (this.AcctInfo != null && + this.AcctInfo.Equals(input.AcctInfo)) + ) && + ( + this.AcctType == input.AcctType || + this.AcctType.Equals(input.AcctType) + ) && + ( + this.AcquirerBIN == input.AcquirerBIN || + (this.AcquirerBIN != null && + this.AcquirerBIN.Equals(input.AcquirerBIN)) + ) && + ( + this.AcquirerMerchantID == input.AcquirerMerchantID || + (this.AcquirerMerchantID != null && + this.AcquirerMerchantID.Equals(input.AcquirerMerchantID)) + ) && + ( + this.AddrMatch == input.AddrMatch || + this.AddrMatch.Equals(input.AddrMatch) + ) && + ( + this.AuthenticationOnly == input.AuthenticationOnly || + this.AuthenticationOnly.Equals(input.AuthenticationOnly) + ) && + ( + this.ChallengeIndicator == input.ChallengeIndicator || + this.ChallengeIndicator.Equals(input.ChallengeIndicator) + ) && + ( + this.DeviceChannel == input.DeviceChannel || + (this.DeviceChannel != null && + this.DeviceChannel.Equals(input.DeviceChannel)) + ) && + ( + this.DeviceRenderOptions == input.DeviceRenderOptions || + (this.DeviceRenderOptions != null && + this.DeviceRenderOptions.Equals(input.DeviceRenderOptions)) + ) && + ( + this.HomePhone == input.HomePhone || + (this.HomePhone != null && + this.HomePhone.Equals(input.HomePhone)) + ) && + ( + this.Mcc == input.Mcc || + (this.Mcc != null && + this.Mcc.Equals(input.Mcc)) + ) && + ( + this.MerchantName == input.MerchantName || + (this.MerchantName != null && + this.MerchantName.Equals(input.MerchantName)) + ) && + ( + this.MessageVersion == input.MessageVersion || + (this.MessageVersion != null && + this.MessageVersion.Equals(input.MessageVersion)) + ) && + ( + this.MobilePhone == input.MobilePhone || + (this.MobilePhone != null && + this.MobilePhone.Equals(input.MobilePhone)) + ) && + ( + this.NotificationURL == input.NotificationURL || + (this.NotificationURL != null && + this.NotificationURL.Equals(input.NotificationURL)) + ) && + ( + this.PayTokenInd == input.PayTokenInd || + this.PayTokenInd.Equals(input.PayTokenInd) + ) && + ( + this.PaymentAuthenticationUseCase == input.PaymentAuthenticationUseCase || + (this.PaymentAuthenticationUseCase != null && + this.PaymentAuthenticationUseCase.Equals(input.PaymentAuthenticationUseCase)) + ) && + ( + this.PurchaseInstalData == input.PurchaseInstalData || + (this.PurchaseInstalData != null && + this.PurchaseInstalData.Equals(input.PurchaseInstalData)) + ) && + ( + this.RecurringExpiry == input.RecurringExpiry || + (this.RecurringExpiry != null && + this.RecurringExpiry.Equals(input.RecurringExpiry)) + ) && + ( + this.RecurringFrequency == input.RecurringFrequency || + (this.RecurringFrequency != null && + this.RecurringFrequency.Equals(input.RecurringFrequency)) + ) && + ( + this.SdkAppID == input.SdkAppID || + (this.SdkAppID != null && + this.SdkAppID.Equals(input.SdkAppID)) + ) && + ( + this.SdkEncData == input.SdkEncData || + (this.SdkEncData != null && + this.SdkEncData.Equals(input.SdkEncData)) + ) && + ( + this.SdkEphemPubKey == input.SdkEphemPubKey || + (this.SdkEphemPubKey != null && + this.SdkEphemPubKey.Equals(input.SdkEphemPubKey)) + ) && + ( + this.SdkMaxTimeout == input.SdkMaxTimeout || + this.SdkMaxTimeout.Equals(input.SdkMaxTimeout) + ) && + ( + this.SdkReferenceNumber == input.SdkReferenceNumber || + (this.SdkReferenceNumber != null && + this.SdkReferenceNumber.Equals(input.SdkReferenceNumber)) + ) && + ( + this.SdkTransID == input.SdkTransID || + (this.SdkTransID != null && + this.SdkTransID.Equals(input.SdkTransID)) + ) && + ( + this.SdkVersion == input.SdkVersion || + (this.SdkVersion != null && + this.SdkVersion.Equals(input.SdkVersion)) + ) && + ( + this.ThreeDSCompInd == input.ThreeDSCompInd || + (this.ThreeDSCompInd != null && + this.ThreeDSCompInd.Equals(input.ThreeDSCompInd)) + ) && + ( + this.ThreeDSRequestorAuthenticationInd == input.ThreeDSRequestorAuthenticationInd || + (this.ThreeDSRequestorAuthenticationInd != null && + this.ThreeDSRequestorAuthenticationInd.Equals(input.ThreeDSRequestorAuthenticationInd)) + ) && + ( + this.ThreeDSRequestorAuthenticationInfo == input.ThreeDSRequestorAuthenticationInfo || + (this.ThreeDSRequestorAuthenticationInfo != null && + this.ThreeDSRequestorAuthenticationInfo.Equals(input.ThreeDSRequestorAuthenticationInfo)) + ) && + ( + this.ThreeDSRequestorChallengeInd == input.ThreeDSRequestorChallengeInd || + this.ThreeDSRequestorChallengeInd.Equals(input.ThreeDSRequestorChallengeInd) + ) && + ( + this.ThreeDSRequestorID == input.ThreeDSRequestorID || + (this.ThreeDSRequestorID != null && + this.ThreeDSRequestorID.Equals(input.ThreeDSRequestorID)) + ) && + ( + this.ThreeDSRequestorName == input.ThreeDSRequestorName || + (this.ThreeDSRequestorName != null && + this.ThreeDSRequestorName.Equals(input.ThreeDSRequestorName)) + ) && + ( + this.ThreeDSRequestorPriorAuthenticationInfo == input.ThreeDSRequestorPriorAuthenticationInfo || + (this.ThreeDSRequestorPriorAuthenticationInfo != null && + this.ThreeDSRequestorPriorAuthenticationInfo.Equals(input.ThreeDSRequestorPriorAuthenticationInfo)) + ) && + ( + this.ThreeDSRequestorURL == input.ThreeDSRequestorURL || + (this.ThreeDSRequestorURL != null && + this.ThreeDSRequestorURL.Equals(input.ThreeDSRequestorURL)) + ) && + ( + this.TransType == input.TransType || + this.TransType.Equals(input.TransType) + ) && + ( + this.TransactionType == input.TransactionType || + this.TransactionType.Equals(input.TransactionType) + ) && + ( + this.WhiteListStatus == input.WhiteListStatus || + (this.WhiteListStatus != null && + this.WhiteListStatus.Equals(input.WhiteListStatus)) + ) && + ( + this.WorkPhone == input.WorkPhone || + (this.WorkPhone != null && + this.WorkPhone.Equals(input.WorkPhone)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ThreeDS2RequestData threeDS2RequestData, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (threeDS2RequestData.DeviceChannel == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.DeviceChannel), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.AcctInfoOption.IsSet && threeDS2RequestData.AcctInfo == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.AcctInfo), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.AcquirerBINOption.IsSet && threeDS2RequestData.AcquirerBIN == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.AcquirerBIN), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.AcquirerMerchantIDOption.IsSet && threeDS2RequestData.AcquirerMerchantID == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.AcquirerMerchantID), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.DeviceRenderOptionsOption.IsSet && threeDS2RequestData.DeviceRenderOptions == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.DeviceRenderOptions), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.HomePhoneOption.IsSet && threeDS2RequestData.HomePhone == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.HomePhone), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.MccOption.IsSet && threeDS2RequestData.Mcc == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.Mcc), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.MerchantNameOption.IsSet && threeDS2RequestData.MerchantName == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.MerchantName), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.MessageVersionOption.IsSet && threeDS2RequestData.MessageVersion == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.MessageVersion), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.MobilePhoneOption.IsSet && threeDS2RequestData.MobilePhone == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.MobilePhone), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.NotificationURLOption.IsSet && threeDS2RequestData.NotificationURL == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.NotificationURL), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.PaymentAuthenticationUseCaseOption.IsSet && threeDS2RequestData.PaymentAuthenticationUseCase == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.PaymentAuthenticationUseCase), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.PurchaseInstalDataOption.IsSet && threeDS2RequestData.PurchaseInstalData == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.PurchaseInstalData), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.RecurringExpiryOption.IsSet && threeDS2RequestData.RecurringExpiry == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.RecurringExpiry), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.RecurringFrequencyOption.IsSet && threeDS2RequestData.RecurringFrequency == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.RecurringFrequency), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.SdkAppIDOption.IsSet && threeDS2RequestData.SdkAppID == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.SdkAppID), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.SdkEncDataOption.IsSet && threeDS2RequestData.SdkEncData == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.SdkEncData), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.SdkEphemPubKeyOption.IsSet && threeDS2RequestData.SdkEphemPubKey == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.SdkEphemPubKey), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.SdkReferenceNumberOption.IsSet && threeDS2RequestData.SdkReferenceNumber == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.SdkReferenceNumber), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.SdkTransIDOption.IsSet && threeDS2RequestData.SdkTransID == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.SdkTransID), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.SdkVersionOption.IsSet && threeDS2RequestData.SdkVersion == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.SdkVersion), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.ThreeDSCompIndOption.IsSet && threeDS2RequestData.ThreeDSCompInd == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSCompInd), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.ThreeDSRequestorAuthenticationIndOption.IsSet && threeDS2RequestData.ThreeDSRequestorAuthenticationInd == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSRequestorAuthenticationInd), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.ThreeDSRequestorAuthenticationInfoOption.IsSet && threeDS2RequestData.ThreeDSRequestorAuthenticationInfo == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSRequestorAuthenticationInfo), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.ThreeDSRequestorIDOption.IsSet && threeDS2RequestData.ThreeDSRequestorID == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSRequestorID), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.ThreeDSRequestorNameOption.IsSet && threeDS2RequestData.ThreeDSRequestorName == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSRequestorName), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.ThreeDSRequestorPriorAuthenticationInfoOption.IsSet && threeDS2RequestData.ThreeDSRequestorPriorAuthenticationInfo == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSRequestorPriorAuthenticationInfo), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.ThreeDSRequestorURLOption.IsSet && threeDS2RequestData.ThreeDSRequestorURL == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.ThreeDSRequestorURL), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.WhiteListStatusOption.IsSet && threeDS2RequestData.WhiteListStatus == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.WhiteListStatus), "Property is required for class ThreeDS2RequestData."); - - if (threeDS2RequestData.WorkPhoneOption.IsSet && threeDS2RequestData.WorkPhone == null) - throw new ArgumentNullException(nameof(threeDS2RequestData.WorkPhone), "Property is required for class ThreeDS2RequestData."); - - writer.WriteString("deviceChannel", threeDS2RequestData.DeviceChannel); - - if (threeDS2RequestData.AcctInfoOption.IsSet) - { - writer.WritePropertyName("acctInfo"); - JsonSerializer.Serialize(writer, threeDS2RequestData.AcctInfo, jsonSerializerOptions); - } - var acctTypeRawValue = ThreeDS2RequestData.AcctTypeEnumToJsonValue(threeDS2RequestData.AcctTypeOption.Value.Value); - writer.WriteString("acctType", acctTypeRawValue); - if (threeDS2RequestData.AcquirerBINOption.IsSet) - writer.WriteString("acquirerBIN", threeDS2RequestData.AcquirerBIN); - - if (threeDS2RequestData.AcquirerMerchantIDOption.IsSet) - writer.WriteString("acquirerMerchantID", threeDS2RequestData.AcquirerMerchantID); - - var addrMatchRawValue = ThreeDS2RequestData.AddrMatchEnumToJsonValue(threeDS2RequestData.AddrMatchOption.Value.Value); - writer.WriteString("addrMatch", addrMatchRawValue); - if (threeDS2RequestData.AuthenticationOnlyOption.IsSet) - writer.WriteBoolean("authenticationOnly", threeDS2RequestData.AuthenticationOnlyOption.Value.Value); - - var challengeIndicatorRawValue = ThreeDS2RequestData.ChallengeIndicatorEnumToJsonValue(threeDS2RequestData.ChallengeIndicatorOption.Value.Value); - writer.WriteString("challengeIndicator", challengeIndicatorRawValue); - if (threeDS2RequestData.DeviceRenderOptionsOption.IsSet) - { - writer.WritePropertyName("deviceRenderOptions"); - JsonSerializer.Serialize(writer, threeDS2RequestData.DeviceRenderOptions, jsonSerializerOptions); - } - if (threeDS2RequestData.HomePhoneOption.IsSet) - { - writer.WritePropertyName("homePhone"); - JsonSerializer.Serialize(writer, threeDS2RequestData.HomePhone, jsonSerializerOptions); - } - if (threeDS2RequestData.MccOption.IsSet) - writer.WriteString("mcc", threeDS2RequestData.Mcc); - - if (threeDS2RequestData.MerchantNameOption.IsSet) - writer.WriteString("merchantName", threeDS2RequestData.MerchantName); - - if (threeDS2RequestData.MessageVersionOption.IsSet) - writer.WriteString("messageVersion", threeDS2RequestData.MessageVersion); - - if (threeDS2RequestData.MobilePhoneOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("mobilePhone"); - JsonSerializer.Serialize(writer, threeDS2RequestData.MobilePhone, jsonSerializerOptions); + int hashCode = 41; + if (this.AcctInfo != null) + { + hashCode = (hashCode * 59) + this.AcctInfo.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AcctType.GetHashCode(); + if (this.AcquirerBIN != null) + { + hashCode = (hashCode * 59) + this.AcquirerBIN.GetHashCode(); + } + if (this.AcquirerMerchantID != null) + { + hashCode = (hashCode * 59) + this.AcquirerMerchantID.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AddrMatch.GetHashCode(); + hashCode = (hashCode * 59) + this.AuthenticationOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.ChallengeIndicator.GetHashCode(); + if (this.DeviceChannel != null) + { + hashCode = (hashCode * 59) + this.DeviceChannel.GetHashCode(); + } + if (this.DeviceRenderOptions != null) + { + hashCode = (hashCode * 59) + this.DeviceRenderOptions.GetHashCode(); + } + if (this.HomePhone != null) + { + hashCode = (hashCode * 59) + this.HomePhone.GetHashCode(); + } + if (this.Mcc != null) + { + hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); + } + if (this.MerchantName != null) + { + hashCode = (hashCode * 59) + this.MerchantName.GetHashCode(); + } + if (this.MessageVersion != null) + { + hashCode = (hashCode * 59) + this.MessageVersion.GetHashCode(); + } + if (this.MobilePhone != null) + { + hashCode = (hashCode * 59) + this.MobilePhone.GetHashCode(); + } + if (this.NotificationURL != null) + { + hashCode = (hashCode * 59) + this.NotificationURL.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PayTokenInd.GetHashCode(); + if (this.PaymentAuthenticationUseCase != null) + { + hashCode = (hashCode * 59) + this.PaymentAuthenticationUseCase.GetHashCode(); + } + if (this.PurchaseInstalData != null) + { + hashCode = (hashCode * 59) + this.PurchaseInstalData.GetHashCode(); + } + if (this.RecurringExpiry != null) + { + hashCode = (hashCode * 59) + this.RecurringExpiry.GetHashCode(); + } + if (this.RecurringFrequency != null) + { + hashCode = (hashCode * 59) + this.RecurringFrequency.GetHashCode(); + } + if (this.SdkAppID != null) + { + hashCode = (hashCode * 59) + this.SdkAppID.GetHashCode(); + } + if (this.SdkEncData != null) + { + hashCode = (hashCode * 59) + this.SdkEncData.GetHashCode(); + } + if (this.SdkEphemPubKey != null) + { + hashCode = (hashCode * 59) + this.SdkEphemPubKey.GetHashCode(); + } + hashCode = (hashCode * 59) + this.SdkMaxTimeout.GetHashCode(); + if (this.SdkReferenceNumber != null) + { + hashCode = (hashCode * 59) + this.SdkReferenceNumber.GetHashCode(); + } + if (this.SdkTransID != null) + { + hashCode = (hashCode * 59) + this.SdkTransID.GetHashCode(); + } + if (this.SdkVersion != null) + { + hashCode = (hashCode * 59) + this.SdkVersion.GetHashCode(); + } + if (this.ThreeDSCompInd != null) + { + hashCode = (hashCode * 59) + this.ThreeDSCompInd.GetHashCode(); + } + if (this.ThreeDSRequestorAuthenticationInd != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestorAuthenticationInd.GetHashCode(); + } + if (this.ThreeDSRequestorAuthenticationInfo != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestorAuthenticationInfo.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ThreeDSRequestorChallengeInd.GetHashCode(); + if (this.ThreeDSRequestorID != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestorID.GetHashCode(); + } + if (this.ThreeDSRequestorName != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestorName.GetHashCode(); + } + if (this.ThreeDSRequestorPriorAuthenticationInfo != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestorPriorAuthenticationInfo.GetHashCode(); + } + if (this.ThreeDSRequestorURL != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestorURL.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TransType.GetHashCode(); + hashCode = (hashCode * 59) + this.TransactionType.GetHashCode(); + if (this.WhiteListStatus != null) + { + hashCode = (hashCode * 59) + this.WhiteListStatus.GetHashCode(); + } + if (this.WorkPhone != null) + { + hashCode = (hashCode * 59) + this.WorkPhone.GetHashCode(); + } + return hashCode; } - if (threeDS2RequestData.NotificationURLOption.IsSet) - writer.WriteString("notificationURL", threeDS2RequestData.NotificationURL); - - if (threeDS2RequestData.PayTokenIndOption.IsSet) - writer.WriteBoolean("payTokenInd", threeDS2RequestData.PayTokenIndOption.Value.Value); - - if (threeDS2RequestData.PaymentAuthenticationUseCaseOption.IsSet) - writer.WriteString("paymentAuthenticationUseCase", threeDS2RequestData.PaymentAuthenticationUseCase); - - if (threeDS2RequestData.PurchaseInstalDataOption.IsSet) - writer.WriteString("purchaseInstalData", threeDS2RequestData.PurchaseInstalData); - - if (threeDS2RequestData.RecurringExpiryOption.IsSet) - writer.WriteString("recurringExpiry", threeDS2RequestData.RecurringExpiry); - - if (threeDS2RequestData.RecurringFrequencyOption.IsSet) - writer.WriteString("recurringFrequency", threeDS2RequestData.RecurringFrequency); - - if (threeDS2RequestData.SdkAppIDOption.IsSet) - writer.WriteString("sdkAppID", threeDS2RequestData.SdkAppID); - - if (threeDS2RequestData.SdkEncDataOption.IsSet) - writer.WriteString("sdkEncData", threeDS2RequestData.SdkEncData); - - if (threeDS2RequestData.SdkEphemPubKeyOption.IsSet) + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + // PurchaseInstalData (string) maxLength + if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length > 3) { - writer.WritePropertyName("sdkEphemPubKey"); - JsonSerializer.Serialize(writer, threeDS2RequestData.SdkEphemPubKey, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PurchaseInstalData, length must be less than 3.", new [] { "PurchaseInstalData" }); } - if (threeDS2RequestData.SdkMaxTimeoutOption.IsSet) - writer.WriteNumber("sdkMaxTimeout", threeDS2RequestData.SdkMaxTimeoutOption.Value.Value); - if (threeDS2RequestData.SdkReferenceNumberOption.IsSet) - writer.WriteString("sdkReferenceNumber", threeDS2RequestData.SdkReferenceNumber); - - if (threeDS2RequestData.SdkTransIDOption.IsSet) - writer.WriteString("sdkTransID", threeDS2RequestData.SdkTransID); - - if (threeDS2RequestData.SdkVersionOption.IsSet) - writer.WriteString("sdkVersion", threeDS2RequestData.SdkVersion); - - if (threeDS2RequestData.ThreeDSCompIndOption.IsSet) - writer.WriteString("threeDSCompInd", threeDS2RequestData.ThreeDSCompInd); - - if (threeDS2RequestData.ThreeDSRequestorAuthenticationIndOption.IsSet) - writer.WriteString("threeDSRequestorAuthenticationInd", threeDS2RequestData.ThreeDSRequestorAuthenticationInd); - - if (threeDS2RequestData.ThreeDSRequestorAuthenticationInfoOption.IsSet) + // PurchaseInstalData (string) minLength + if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length < 1) { - writer.WritePropertyName("threeDSRequestorAuthenticationInfo"); - JsonSerializer.Serialize(writer, threeDS2RequestData.ThreeDSRequestorAuthenticationInfo, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PurchaseInstalData, length must be greater than 1.", new [] { "PurchaseInstalData" }); } - var threeDSRequestorChallengeIndRawValue = ThreeDS2RequestData.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2RequestData.ThreeDSRequestorChallengeIndOption.Value.Value); - writer.WriteString("threeDSRequestorChallengeInd", threeDSRequestorChallengeIndRawValue); - if (threeDS2RequestData.ThreeDSRequestorIDOption.IsSet) - writer.WriteString("threeDSRequestorID", threeDS2RequestData.ThreeDSRequestorID); - - if (threeDS2RequestData.ThreeDSRequestorNameOption.IsSet) - writer.WriteString("threeDSRequestorName", threeDS2RequestData.ThreeDSRequestorName); - if (threeDS2RequestData.ThreeDSRequestorPriorAuthenticationInfoOption.IsSet) + // RecurringFrequency (string) maxLength + if (this.RecurringFrequency != null && this.RecurringFrequency.Length > 4) { - writer.WritePropertyName("threeDSRequestorPriorAuthenticationInfo"); - JsonSerializer.Serialize(writer, threeDS2RequestData.ThreeDSRequestorPriorAuthenticationInfo, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for RecurringFrequency, length must be less than 4.", new [] { "RecurringFrequency" }); } - if (threeDS2RequestData.ThreeDSRequestorURLOption.IsSet) - writer.WriteString("threeDSRequestorURL", threeDS2RequestData.ThreeDSRequestorURL); - var transTypeRawValue = ThreeDS2RequestData.TransTypeEnumToJsonValue(threeDS2RequestData.TransTypeOption.Value.Value); - writer.WriteString("transType", transTypeRawValue); - var transactionTypeRawValue = ThreeDS2RequestData.TransactionTypeEnumToJsonValue(threeDS2RequestData.TransactionTypeOption.Value.Value); - writer.WriteString("transactionType", transactionTypeRawValue); - if (threeDS2RequestData.WhiteListStatusOption.IsSet) - writer.WriteString("whiteListStatus", threeDS2RequestData.WhiteListStatus); - - if (threeDS2RequestData.WorkPhoneOption.IsSet) - { - writer.WritePropertyName("workPhone"); - JsonSerializer.Serialize(writer, threeDS2RequestData.WorkPhone, jsonSerializerOptions); - } + yield break; } } + } diff --git a/Adyen/Model/Checkout/ThreeDS2RequestFields.cs b/Adyen/Model/Checkout/ThreeDS2RequestFields.cs index df36f3b84..f53902a61 100644 --- a/Adyen/Model/Checkout/ThreeDS2RequestFields.cs +++ b/Adyen/Model/Checkout/ThreeDS2RequestFields.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,1184 +15,551 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ThreeDS2RequestFields /// - public partial class ThreeDS2RequestFields : IValidatableObject + [DataContract(Name = "ThreeDS2RequestFields")] + public partial class ThreeDS2RequestFields : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// acctInfo - /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. - /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false) - /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` - /// deviceRenderOptions - /// homePhone - /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. - /// The `messageVersion` value indicating the 3D Secure 2 protocol version. - /// mobilePhone - /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. - /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. - /// Indicates the type of payment for which an authentication is requested (message extension) - /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. - /// Date after which no further authorisations shall be performed. Format: YYYYMMDD - /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters. - /// The `sdkAppID` value as received from the 3D Secure 2 SDK. - /// sdkEphemPubKey - /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. (default to 60) - /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. - /// The `sdkTransID` value as received from the 3D Secure 2 SDK. - /// Completion indicator for the device fingerprinting. - /// Indicates the type of Authentication request. - /// threeDSRequestorAuthenticationInfo - /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. - /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. - /// threeDSRequestorPriorAuthenticationInfo - /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. - /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load - /// Identify the type of the transaction being authenticated. - /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. - /// workPhone - [JsonConstructor] - public ThreeDS2RequestFields(Option acctInfo = default, Option acctType = default, Option acquirerBIN = default, Option acquirerMerchantID = default, Option addrMatch = default, Option authenticationOnly = default, Option challengeIndicator = default, Option deviceRenderOptions = default, Option homePhone = default, Option mcc = default, Option merchantName = default, Option messageVersion = default, Option mobilePhone = default, Option notificationURL = default, Option payTokenInd = default, Option paymentAuthenticationUseCase = default, Option purchaseInstalData = default, Option recurringExpiry = default, Option recurringFrequency = default, Option sdkAppID = default, Option sdkEphemPubKey = default, Option sdkMaxTimeout = default, Option sdkReferenceNumber = default, Option sdkTransID = default, Option threeDSCompInd = default, Option threeDSRequestorAuthenticationInd = default, Option threeDSRequestorAuthenticationInfo = default, Option threeDSRequestorChallengeInd = default, Option threeDSRequestorID = default, Option threeDSRequestorName = default, Option threeDSRequestorPriorAuthenticationInfo = default, Option threeDSRequestorURL = default, Option transType = default, Option transactionType = default, Option whiteListStatus = default, Option workPhone = default) - { - AcctInfoOption = acctInfo; - AcctTypeOption = acctType; - AcquirerBINOption = acquirerBIN; - AcquirerMerchantIDOption = acquirerMerchantID; - AddrMatchOption = addrMatch; - AuthenticationOnlyOption = authenticationOnly; - ChallengeIndicatorOption = challengeIndicator; - DeviceRenderOptionsOption = deviceRenderOptions; - HomePhoneOption = homePhone; - MccOption = mcc; - MerchantNameOption = merchantName; - MessageVersionOption = messageVersion; - MobilePhoneOption = mobilePhone; - NotificationURLOption = notificationURL; - PayTokenIndOption = payTokenInd; - PaymentAuthenticationUseCaseOption = paymentAuthenticationUseCase; - PurchaseInstalDataOption = purchaseInstalData; - RecurringExpiryOption = recurringExpiry; - RecurringFrequencyOption = recurringFrequency; - SdkAppIDOption = sdkAppID; - SdkEphemPubKeyOption = sdkEphemPubKey; - SdkMaxTimeoutOption = sdkMaxTimeout; - SdkReferenceNumberOption = sdkReferenceNumber; - SdkTransIDOption = sdkTransID; - ThreeDSCompIndOption = threeDSCompInd; - ThreeDSRequestorAuthenticationIndOption = threeDSRequestorAuthenticationInd; - ThreeDSRequestorAuthenticationInfoOption = threeDSRequestorAuthenticationInfo; - ThreeDSRequestorChallengeIndOption = threeDSRequestorChallengeInd; - ThreeDSRequestorIDOption = threeDSRequestorID; - ThreeDSRequestorNameOption = threeDSRequestorName; - ThreeDSRequestorPriorAuthenticationInfoOption = threeDSRequestorPriorAuthenticationInfo; - ThreeDSRequestorURLOption = threeDSRequestorURL; - TransTypeOption = transType; - TransactionTypeOption = transactionType; - WhiteListStatusOption = whiteListStatus; - WorkPhoneOption = workPhone; - OnCreated(); - } - - partial void OnCreated(); - /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit + [JsonConverter(typeof(StringEnumConverter))] public enum AcctTypeEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3 - } - - /// - /// Returns a - /// - /// - /// - /// - public static AcctTypeEnum AcctTypeEnumFromString(string value) - { - if (value.Equals("01")) - return AcctTypeEnum._01; - - if (value.Equals("02")) - return AcctTypeEnum._02; - - if (value.Equals("03")) - return AcctTypeEnum._03; - - throw new NotImplementedException($"Could not convert value to type AcctTypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static AcctTypeEnum? AcctTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return AcctTypeEnum._01; - - if (value.Equals("02")) - return AcctTypeEnum._02; - - if (value.Equals("03")) - return AcctTypeEnum._03; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string AcctTypeEnumToJsonValue(AcctTypeEnum? value) - { - if (value == AcctTypeEnum._01) - return "01"; - - if (value == AcctTypeEnum._02) - return "02"; - if (value == AcctTypeEnum._03) - return "03"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of AcctType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcctTypeOption { get; private set; } /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit /// /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit - [JsonPropertyName("acctType")] - public AcctTypeEnum? AcctType { get { return this.AcctTypeOption; } set { this.AcctTypeOption = new Option(value); } } - + [DataMember(Name = "acctType", EmitDefaultValue = false)] + public AcctTypeEnum? AcctType { get; set; } /// - /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + /// Indicates whether the cardholder shipping Address and cardholder billing address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. /// - /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + /// Indicates whether the cardholder shipping Address and cardholder billing address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + [JsonConverter(typeof(StringEnumConverter))] public enum AddrMatchEnum { /// /// Enum Y for value: Y /// + [EnumMember(Value = "Y")] Y = 1, /// /// Enum N for value: N /// + [EnumMember(Value = "N")] N = 2 - } - /// - /// Returns a - /// - /// - /// - /// - public static AddrMatchEnum AddrMatchEnumFromString(string value) - { - if (value.Equals("Y")) - return AddrMatchEnum.Y; - - if (value.Equals("N")) - return AddrMatchEnum.N; - - throw new NotImplementedException($"Could not convert value to type AddrMatchEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static AddrMatchEnum? AddrMatchEnumFromStringOrDefault(string value) - { - if (value.Equals("Y")) - return AddrMatchEnum.Y; - - if (value.Equals("N")) - return AddrMatchEnum.N; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string AddrMatchEnumToJsonValue(AddrMatchEnum? value) - { - if (value == AddrMatchEnum.Y) - return "Y"; - - if (value == AddrMatchEnum.N) - return "N"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// - /// Used to track the state of AddrMatch + /// Indicates whether the cardholder shipping Address and cardholder billing address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AddrMatchOption { get; private set; } - - /// - /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. - /// - /// Indicates whether the Cardholder Shipping Address and Cardholder Billing Address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. - [JsonPropertyName("addrMatch")] - public AddrMatchEnum? AddrMatch { get { return this.AddrMatchOption; } set { this.AddrMatchOption = new Option(value); } } - + /// Indicates whether the cardholder shipping Address and cardholder billing address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address. + [DataMember(Name = "addrMatch", EmitDefaultValue = false)] + public AddrMatchEnum? AddrMatch { get; set; } /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` + [JsonConverter(typeof(StringEnumConverter))] public enum ChallengeIndicatorEnum { /// /// Enum NoPreference for value: noPreference /// + [EnumMember(Value = "noPreference")] NoPreference = 1, /// /// Enum RequestNoChallenge for value: requestNoChallenge /// + [EnumMember(Value = "requestNoChallenge")] RequestNoChallenge = 2, /// /// Enum RequestChallenge for value: requestChallenge /// + [EnumMember(Value = "requestChallenge")] RequestChallenge = 3, /// /// Enum RequestChallengeAsMandate for value: requestChallengeAsMandate /// + [EnumMember(Value = "requestChallengeAsMandate")] RequestChallengeAsMandate = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ChallengeIndicatorEnum ChallengeIndicatorEnumFromString(string value) - { - if (value.Equals("noPreference")) - return ChallengeIndicatorEnum.NoPreference; - - if (value.Equals("requestNoChallenge")) - return ChallengeIndicatorEnum.RequestNoChallenge; - if (value.Equals("requestChallenge")) - return ChallengeIndicatorEnum.RequestChallenge; - - if (value.Equals("requestChallengeAsMandate")) - return ChallengeIndicatorEnum.RequestChallengeAsMandate; - - throw new NotImplementedException($"Could not convert value to type ChallengeIndicatorEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static ChallengeIndicatorEnum? ChallengeIndicatorEnumFromStringOrDefault(string value) - { - if (value.Equals("noPreference")) - return ChallengeIndicatorEnum.NoPreference; - - if (value.Equals("requestNoChallenge")) - return ChallengeIndicatorEnum.RequestNoChallenge; - - if (value.Equals("requestChallenge")) - return ChallengeIndicatorEnum.RequestChallenge; - - if (value.Equals("requestChallengeAsMandate")) - return ChallengeIndicatorEnum.RequestChallengeAsMandate; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChallengeIndicatorEnumToJsonValue(ChallengeIndicatorEnum? value) - { - if (value == ChallengeIndicatorEnum.NoPreference) - return "noPreference"; - - if (value == ChallengeIndicatorEnum.RequestNoChallenge) - return "requestNoChallenge"; - - if (value == ChallengeIndicatorEnum.RequestChallenge) - return "requestChallenge"; - - if (value == ChallengeIndicatorEnum.RequestChallengeAsMandate) - return "requestChallengeAsMandate"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ChallengeIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChallengeIndicatorOption { get; private set; } /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` - [JsonPropertyName("challengeIndicator")] - [Obsolete] - public ChallengeIndicatorEnum? ChallengeIndicator { get { return this.ChallengeIndicatorOption; } set { this.ChallengeIndicatorOption = new Option(value); } } - + [DataMember(Name = "challengeIndicator", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v68. Use `threeDSRequestorChallengeInd` instead.")] + public ChallengeIndicatorEnum? ChallengeIndicator { get; set; } /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSRequestorChallengeIndEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// + [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// + [EnumMember(Value = "06")] _06 = 6 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ThreeDSRequestorChallengeIndEnum ThreeDSRequestorChallengeIndEnumFromString(string value) - { - if (value.Equals("01")) - return ThreeDSRequestorChallengeIndEnum._01; - - if (value.Equals("02")) - return ThreeDSRequestorChallengeIndEnum._02; - - if (value.Equals("03")) - return ThreeDSRequestorChallengeIndEnum._03; - - if (value.Equals("04")) - return ThreeDSRequestorChallengeIndEnum._04; - - if (value.Equals("05")) - return ThreeDSRequestorChallengeIndEnum._05; - - if (value.Equals("06")) - return ThreeDSRequestorChallengeIndEnum._06; - - throw new NotImplementedException($"Could not convert value to type ThreeDSRequestorChallengeIndEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeIndEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ThreeDSRequestorChallengeIndEnum._01; - - if (value.Equals("02")) - return ThreeDSRequestorChallengeIndEnum._02; - - if (value.Equals("03")) - return ThreeDSRequestorChallengeIndEnum._03; - - if (value.Equals("04")) - return ThreeDSRequestorChallengeIndEnum._04; - - if (value.Equals("05")) - return ThreeDSRequestorChallengeIndEnum._05; - - if (value.Equals("06")) - return ThreeDSRequestorChallengeIndEnum._06; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ThreeDSRequestorChallengeIndEnumToJsonValue(ThreeDSRequestorChallengeIndEnum? value) - { - if (value == ThreeDSRequestorChallengeIndEnum._01) - return "01"; - - if (value == ThreeDSRequestorChallengeIndEnum._02) - return "02"; - - if (value == ThreeDSRequestorChallengeIndEnum._03) - return "03"; - - if (value == ThreeDSRequestorChallengeIndEnum._04) - return "04"; - - if (value == ThreeDSRequestorChallengeIndEnum._05) - return "05"; - if (value == ThreeDSRequestorChallengeIndEnum._06) - return "06"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of ThreeDSRequestorChallengeInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorChallengeIndOption { get; private set; } /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - [JsonPropertyName("threeDSRequestorChallengeInd")] - public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get { return this.ThreeDSRequestorChallengeIndOption; } set { this.ThreeDSRequestorChallengeIndOption = new Option(value); } } - + [DataMember(Name = "threeDSRequestorChallengeInd", EmitDefaultValue = false)] + public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get; set; } /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load + [JsonConverter(typeof(StringEnumConverter))] public enum TransTypeEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 2, /// /// Enum _10 for value: 10 /// + [EnumMember(Value = "10")] _10 = 3, /// /// Enum _11 for value: 11 /// + [EnumMember(Value = "11")] _11 = 4, /// /// Enum _28 for value: 28 /// + [EnumMember(Value = "28")] _28 = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TransTypeEnum TransTypeEnumFromString(string value) - { - if (value.Equals("01")) - return TransTypeEnum._01; - - if (value.Equals("03")) - return TransTypeEnum._03; - - if (value.Equals("10")) - return TransTypeEnum._10; - - if (value.Equals("11")) - return TransTypeEnum._11; - - if (value.Equals("28")) - return TransTypeEnum._28; - - throw new NotImplementedException($"Could not convert value to type TransTypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TransTypeEnum? TransTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return TransTypeEnum._01; - - if (value.Equals("03")) - return TransTypeEnum._03; - - if (value.Equals("10")) - return TransTypeEnum._10; - - if (value.Equals("11")) - return TransTypeEnum._11; - - if (value.Equals("28")) - return TransTypeEnum._28; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TransTypeEnumToJsonValue(TransTypeEnum? value) - { - if (value == TransTypeEnum._01) - return "01"; - if (value == TransTypeEnum._03) - return "03"; - - if (value == TransTypeEnum._10) - return "10"; - - if (value == TransTypeEnum._11) - return "11"; - - if (value == TransTypeEnum._28) - return "28"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of TransType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TransTypeOption { get; private set; } /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load /// /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load - [JsonPropertyName("transType")] - public TransTypeEnum? TransType { get { return this.TransTypeOption; } set { this.TransTypeOption = new Option(value); } } - + [DataMember(Name = "transType", EmitDefaultValue = false)] + public TransTypeEnum? TransType { get; set; } /// /// Identify the type of the transaction being authenticated. /// /// Identify the type of the transaction being authenticated. + [JsonConverter(typeof(StringEnumConverter))] public enum TransactionTypeEnum { /// /// Enum GoodsOrServicePurchase for value: goodsOrServicePurchase /// + [EnumMember(Value = "goodsOrServicePurchase")] GoodsOrServicePurchase = 1, /// /// Enum CheckAcceptance for value: checkAcceptance /// + [EnumMember(Value = "checkAcceptance")] CheckAcceptance = 2, /// /// Enum AccountFunding for value: accountFunding /// + [EnumMember(Value = "accountFunding")] AccountFunding = 3, /// /// Enum QuasiCashTransaction for value: quasiCashTransaction /// + [EnumMember(Value = "quasiCashTransaction")] QuasiCashTransaction = 4, /// /// Enum PrepaidActivationAndLoad for value: prepaidActivationAndLoad /// + [EnumMember(Value = "prepaidActivationAndLoad")] PrepaidActivationAndLoad = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TransactionTypeEnum TransactionTypeEnumFromString(string value) - { - if (value.Equals("goodsOrServicePurchase")) - return TransactionTypeEnum.GoodsOrServicePurchase; - - if (value.Equals("checkAcceptance")) - return TransactionTypeEnum.CheckAcceptance; - - if (value.Equals("accountFunding")) - return TransactionTypeEnum.AccountFunding; - - if (value.Equals("quasiCashTransaction")) - return TransactionTypeEnum.QuasiCashTransaction; - - if (value.Equals("prepaidActivationAndLoad")) - return TransactionTypeEnum.PrepaidActivationAndLoad; - - throw new NotImplementedException($"Could not convert value to type TransactionTypeEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static TransactionTypeEnum? TransactionTypeEnumFromStringOrDefault(string value) - { - if (value.Equals("goodsOrServicePurchase")) - return TransactionTypeEnum.GoodsOrServicePurchase; - - if (value.Equals("checkAcceptance")) - return TransactionTypeEnum.CheckAcceptance; - - if (value.Equals("accountFunding")) - return TransactionTypeEnum.AccountFunding; - - if (value.Equals("quasiCashTransaction")) - return TransactionTypeEnum.QuasiCashTransaction; - - if (value.Equals("prepaidActivationAndLoad")) - return TransactionTypeEnum.PrepaidActivationAndLoad; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TransactionTypeEnumToJsonValue(TransactionTypeEnum? value) - { - if (value == TransactionTypeEnum.GoodsOrServicePurchase) - return "goodsOrServicePurchase"; - - if (value == TransactionTypeEnum.CheckAcceptance) - return "checkAcceptance"; - if (value == TransactionTypeEnum.AccountFunding) - return "accountFunding"; - - if (value == TransactionTypeEnum.QuasiCashTransaction) - return "quasiCashTransaction"; - - if (value == TransactionTypeEnum.PrepaidActivationAndLoad) - return "prepaidActivationAndLoad"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of TransactionType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TransactionTypeOption { get; private set; } /// /// Identify the type of the transaction being authenticated. /// /// Identify the type of the transaction being authenticated. - [JsonPropertyName("transactionType")] - public TransactionTypeEnum? TransactionType { get { return this.TransactionTypeOption; } set { this.TransactionTypeOption = new Option(value); } } - + [DataMember(Name = "transactionType", EmitDefaultValue = false)] + public TransactionTypeEnum? TransactionType { get; set; } /// - /// Used to track the state of AcctInfo + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcctInfoOption { get; private set; } + /// acctInfo. + /// Indicates the type of account. For example, for a multi-account card product. Length: 2 characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform.. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform.. + /// Indicates whether the cardholder shipping Address and cardholder billing address are the same. Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address does not match Billing Address.. + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false). + /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` . + /// deviceRenderOptions. + /// homePhone. + /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme.. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account.. + /// The `messageVersion` value indicating the 3D Secure 2 protocol version.. + /// mobilePhone. + /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**.. + /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS.. + /// Indicates the type of payment for which an authentication is requested (message extension). + /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters.. + /// Date after which no further authorisations shall be performed. Format: YYYYMMDD. + /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters.. + /// The `sdkAppID` value as received from the 3D Secure 2 SDK.. + /// sdkEphemPubKey. + /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. (default to 60). + /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK.. + /// The `sdkTransID` value as received from the 3D Secure 2 SDK.. + /// Completion indicator for the device fingerprinting.. + /// Indicates the type of Authentication request.. + /// threeDSRequestorAuthenticationInfo. + /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2.. + /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2.. + /// threeDSRequestorPriorAuthenticationInfo. + /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process.. + /// Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** — Quasi-Cash Transaction * **28** — Prepaid Activation and Load. + /// Identify the type of the transaction being authenticated.. + /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0.. + /// workPhone. + public ThreeDS2RequestFields(AcctInfo acctInfo = default(AcctInfo), AcctTypeEnum? acctType = default(AcctTypeEnum?), string acquirerBIN = default(string), string acquirerMerchantID = default(string), AddrMatchEnum? addrMatch = default(AddrMatchEnum?), bool? authenticationOnly = false, ChallengeIndicatorEnum? challengeIndicator = default(ChallengeIndicatorEnum?), DeviceRenderOptions deviceRenderOptions = default(DeviceRenderOptions), Phone homePhone = default(Phone), string mcc = default(string), string merchantName = default(string), string messageVersion = default(string), Phone mobilePhone = default(Phone), string notificationURL = default(string), bool? payTokenInd = default(bool?), string paymentAuthenticationUseCase = default(string), string purchaseInstalData = default(string), string recurringExpiry = default(string), string recurringFrequency = default(string), string sdkAppID = default(string), SDKEphemPubKey sdkEphemPubKey = default(SDKEphemPubKey), int? sdkMaxTimeout = 60, string sdkReferenceNumber = default(string), string sdkTransID = default(string), string threeDSCompInd = default(string), string threeDSRequestorAuthenticationInd = default(string), ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo = default(ThreeDSRequestorAuthenticationInfo), ThreeDSRequestorChallengeIndEnum? threeDSRequestorChallengeInd = default(ThreeDSRequestorChallengeIndEnum?), string threeDSRequestorID = default(string), string threeDSRequestorName = default(string), ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo = default(ThreeDSRequestorPriorAuthenticationInfo), string threeDSRequestorURL = default(string), TransTypeEnum? transType = default(TransTypeEnum?), TransactionTypeEnum? transactionType = default(TransactionTypeEnum?), string whiteListStatus = default(string), Phone workPhone = default(Phone)) + { + this.AcctInfo = acctInfo; + this.AcctType = acctType; + this.AcquirerBIN = acquirerBIN; + this.AcquirerMerchantID = acquirerMerchantID; + this.AddrMatch = addrMatch; + this.AuthenticationOnly = authenticationOnly; + this.ChallengeIndicator = challengeIndicator; + this.DeviceRenderOptions = deviceRenderOptions; + this.HomePhone = homePhone; + this.Mcc = mcc; + this.MerchantName = merchantName; + this.MessageVersion = messageVersion; + this.MobilePhone = mobilePhone; + this.NotificationURL = notificationURL; + this.PayTokenInd = payTokenInd; + this.PaymentAuthenticationUseCase = paymentAuthenticationUseCase; + this.PurchaseInstalData = purchaseInstalData; + this.RecurringExpiry = recurringExpiry; + this.RecurringFrequency = recurringFrequency; + this.SdkAppID = sdkAppID; + this.SdkEphemPubKey = sdkEphemPubKey; + this.SdkMaxTimeout = sdkMaxTimeout; + this.SdkReferenceNumber = sdkReferenceNumber; + this.SdkTransID = sdkTransID; + this.ThreeDSCompInd = threeDSCompInd; + this.ThreeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; + this.ThreeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; + this.ThreeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + this.ThreeDSRequestorID = threeDSRequestorID; + this.ThreeDSRequestorName = threeDSRequestorName; + this.ThreeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; + this.ThreeDSRequestorURL = threeDSRequestorURL; + this.TransType = transType; + this.TransactionType = transactionType; + this.WhiteListStatus = whiteListStatus; + this.WorkPhone = workPhone; + } /// /// Gets or Sets AcctInfo /// - [JsonPropertyName("acctInfo")] - public AcctInfo AcctInfo { get { return this.AcctInfoOption; } set { this.AcctInfoOption = new Option(value); } } - - /// - /// Used to track the state of AcquirerBIN - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcquirerBINOption { get; private set; } + [DataMember(Name = "acctInfo", EmitDefaultValue = false)] + public AcctInfo AcctInfo { get; set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. - [JsonPropertyName("acquirerBIN")] - public string AcquirerBIN { get { return this.AcquirerBINOption; } set { this.AcquirerBINOption = new Option(value); } } - - /// - /// Used to track the state of AcquirerMerchantID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcquirerMerchantIDOption { get; private set; } + [DataMember(Name = "acquirerBIN", EmitDefaultValue = false)] + public string AcquirerBIN { get; set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. - [JsonPropertyName("acquirerMerchantID")] - public string AcquirerMerchantID { get { return this.AcquirerMerchantIDOption; } set { this.AcquirerMerchantIDOption = new Option(value); } } - - /// - /// Used to track the state of AuthenticationOnly - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthenticationOnlyOption { get; private set; } + [DataMember(Name = "acquirerMerchantID", EmitDefaultValue = false)] + public string AcquirerMerchantID { get; set; } /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. /// /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [JsonPropertyName("authenticationOnly")] - [Obsolete] - public bool? AuthenticationOnly { get { return this.AuthenticationOnlyOption; } set { this.AuthenticationOnlyOption = new Option(value); } } - - /// - /// Used to track the state of DeviceRenderOptions - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DeviceRenderOptionsOption { get; private set; } + [DataMember(Name = "authenticationOnly", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v50. Use `threeDSAuthenticationOnly` instead.")] + public bool? AuthenticationOnly { get; set; } /// /// Gets or Sets DeviceRenderOptions /// - [JsonPropertyName("deviceRenderOptions")] - public DeviceRenderOptions DeviceRenderOptions { get { return this.DeviceRenderOptionsOption; } set { this.DeviceRenderOptionsOption = new Option(value); } } - - /// - /// Used to track the state of HomePhone - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option HomePhoneOption { get; private set; } + [DataMember(Name = "deviceRenderOptions", EmitDefaultValue = false)] + public DeviceRenderOptions DeviceRenderOptions { get; set; } /// /// Gets or Sets HomePhone /// - [JsonPropertyName("homePhone")] - public Phone HomePhone { get { return this.HomePhoneOption; } set { this.HomePhoneOption = new Option(value); } } - - /// - /// Used to track the state of Mcc - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MccOption { get; private set; } + [DataMember(Name = "homePhone", EmitDefaultValue = false)] + public Phone HomePhone { get; set; } /// /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. /// /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. - [JsonPropertyName("mcc")] - public string Mcc { get { return this.MccOption; } set { this.MccOption = new Option(value); } } - - /// - /// Used to track the state of MerchantName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MerchantNameOption { get; private set; } + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string Mcc { get; set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/online-payments/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. - [JsonPropertyName("merchantName")] - public string MerchantName { get { return this.MerchantNameOption; } set { this.MerchantNameOption = new Option(value); } } - - /// - /// Used to track the state of MessageVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MessageVersionOption { get; private set; } + [DataMember(Name = "merchantName", EmitDefaultValue = false)] + public string MerchantName { get; set; } /// /// The `messageVersion` value indicating the 3D Secure 2 protocol version. /// /// The `messageVersion` value indicating the 3D Secure 2 protocol version. - [JsonPropertyName("messageVersion")] - public string MessageVersion { get { return this.MessageVersionOption; } set { this.MessageVersionOption = new Option(value); } } - - /// - /// Used to track the state of MobilePhone - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MobilePhoneOption { get; private set; } + [DataMember(Name = "messageVersion", EmitDefaultValue = false)] + public string MessageVersion { get; set; } /// /// Gets or Sets MobilePhone /// - [JsonPropertyName("mobilePhone")] - public Phone MobilePhone { get { return this.MobilePhoneOption; } set { this.MobilePhoneOption = new Option(value); } } - - /// - /// Used to track the state of NotificationURL - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NotificationURLOption { get; private set; } + [DataMember(Name = "mobilePhone", EmitDefaultValue = false)] + public Phone MobilePhone { get; set; } /// /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. /// /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. - [JsonPropertyName("notificationURL")] - public string NotificationURL { get { return this.NotificationURLOption; } set { this.NotificationURLOption = new Option(value); } } - - /// - /// Used to track the state of PayTokenInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PayTokenIndOption { get; private set; } + [DataMember(Name = "notificationURL", EmitDefaultValue = false)] + public string NotificationURL { get; set; } /// /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. /// /// Value **true** indicates that the transaction was de-tokenised prior to being received by the ACS. - [JsonPropertyName("payTokenInd")] - public bool? PayTokenInd { get { return this.PayTokenIndOption; } set { this.PayTokenIndOption = new Option(value); } } - - /// - /// Used to track the state of PaymentAuthenticationUseCase - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PaymentAuthenticationUseCaseOption { get; private set; } + [DataMember(Name = "payTokenInd", EmitDefaultValue = false)] + public bool? PayTokenInd { get; set; } /// /// Indicates the type of payment for which an authentication is requested (message extension) /// /// Indicates the type of payment for which an authentication is requested (message extension) - [JsonPropertyName("paymentAuthenticationUseCase")] - public string PaymentAuthenticationUseCase { get { return this.PaymentAuthenticationUseCaseOption; } set { this.PaymentAuthenticationUseCaseOption = new Option(value); } } - - /// - /// Used to track the state of PurchaseInstalData - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option PurchaseInstalDataOption { get; private set; } + [DataMember(Name = "paymentAuthenticationUseCase", EmitDefaultValue = false)] + public string PaymentAuthenticationUseCase { get; set; } /// /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. /// /// Indicates the maximum number of authorisations permitted for instalment payments. Length: 1–3 characters. - [JsonPropertyName("purchaseInstalData")] - public string PurchaseInstalData { get { return this.PurchaseInstalDataOption; } set { this.PurchaseInstalDataOption = new Option(value); } } - - /// - /// Used to track the state of RecurringExpiry - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringExpiryOption { get; private set; } + [DataMember(Name = "purchaseInstalData", EmitDefaultValue = false)] + public string PurchaseInstalData { get; set; } /// /// Date after which no further authorisations shall be performed. Format: YYYYMMDD /// /// Date after which no further authorisations shall be performed. Format: YYYYMMDD - [JsonPropertyName("recurringExpiry")] - public string RecurringExpiry { get { return this.RecurringExpiryOption; } set { this.RecurringExpiryOption = new Option(value); } } - - /// - /// Used to track the state of RecurringFrequency - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringFrequencyOption { get; private set; } + [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] + public string RecurringExpiry { get; set; } /// /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters. /// /// Indicates the minimum number of days between authorisations. Maximum length: 4 characters. - [JsonPropertyName("recurringFrequency")] - public string RecurringFrequency { get { return this.RecurringFrequencyOption; } set { this.RecurringFrequencyOption = new Option(value); } } - - /// - /// Used to track the state of SdkAppID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkAppIDOption { get; private set; } + [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] + public string RecurringFrequency { get; set; } /// /// The `sdkAppID` value as received from the 3D Secure 2 SDK. /// /// The `sdkAppID` value as received from the 3D Secure 2 SDK. - [JsonPropertyName("sdkAppID")] - public string SdkAppID { get { return this.SdkAppIDOption; } set { this.SdkAppIDOption = new Option(value); } } - - /// - /// Used to track the state of SdkEphemPubKey - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkEphemPubKeyOption { get; private set; } + [DataMember(Name = "sdkAppID", EmitDefaultValue = false)] + public string SdkAppID { get; set; } /// /// Gets or Sets SdkEphemPubKey /// - [JsonPropertyName("sdkEphemPubKey")] - public SDKEphemPubKey SdkEphemPubKey { get { return this.SdkEphemPubKeyOption; } set { this.SdkEphemPubKeyOption = new Option(value); } } - - /// - /// Used to track the state of SdkMaxTimeout - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkMaxTimeoutOption { get; private set; } + [DataMember(Name = "sdkEphemPubKey", EmitDefaultValue = false)] + public SDKEphemPubKey SdkEphemPubKey { get; set; } /// /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. /// /// The maximum amount of time in minutes for the 3D Secure 2 authentication process. Optional and only for `deviceChannel` set to **app**. Defaults to **60** minutes. - [JsonPropertyName("sdkMaxTimeout")] - public int? SdkMaxTimeout { get { return this.SdkMaxTimeoutOption; } set { this.SdkMaxTimeoutOption = new Option(value); } } - - /// - /// Used to track the state of SdkReferenceNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkReferenceNumberOption { get; private set; } + [DataMember(Name = "sdkMaxTimeout", EmitDefaultValue = false)] + public int? SdkMaxTimeout { get; set; } /// /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. /// /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. - [JsonPropertyName("sdkReferenceNumber")] - public string SdkReferenceNumber { get { return this.SdkReferenceNumberOption; } set { this.SdkReferenceNumberOption = new Option(value); } } - - /// - /// Used to track the state of SdkTransID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkTransIDOption { get; private set; } + [DataMember(Name = "sdkReferenceNumber", EmitDefaultValue = false)] + public string SdkReferenceNumber { get; set; } /// /// The `sdkTransID` value as received from the 3D Secure 2 SDK. /// /// The `sdkTransID` value as received from the 3D Secure 2 SDK. - [JsonPropertyName("sdkTransID")] - public string SdkTransID { get { return this.SdkTransIDOption; } set { this.SdkTransIDOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSCompInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSCompIndOption { get; private set; } + [DataMember(Name = "sdkTransID", EmitDefaultValue = false)] + public string SdkTransID { get; set; } /// /// Completion indicator for the device fingerprinting. /// /// Completion indicator for the device fingerprinting. - [JsonPropertyName("threeDSCompInd")] - public string ThreeDSCompInd { get { return this.ThreeDSCompIndOption; } set { this.ThreeDSCompIndOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSRequestorAuthenticationInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorAuthenticationIndOption { get; private set; } + [DataMember(Name = "threeDSCompInd", EmitDefaultValue = false)] + public string ThreeDSCompInd { get; set; } /// /// Indicates the type of Authentication request. /// /// Indicates the type of Authentication request. - [JsonPropertyName("threeDSRequestorAuthenticationInd")] - public string ThreeDSRequestorAuthenticationInd { get { return this.ThreeDSRequestorAuthenticationIndOption; } set { this.ThreeDSRequestorAuthenticationIndOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSRequestorAuthenticationInfo - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorAuthenticationInfoOption { get; private set; } + [DataMember(Name = "threeDSRequestorAuthenticationInd", EmitDefaultValue = false)] + public string ThreeDSRequestorAuthenticationInd { get; set; } /// /// Gets or Sets ThreeDSRequestorAuthenticationInfo /// - [JsonPropertyName("threeDSRequestorAuthenticationInfo")] - public ThreeDSRequestorAuthenticationInfo ThreeDSRequestorAuthenticationInfo { get { return this.ThreeDSRequestorAuthenticationInfoOption; } set { this.ThreeDSRequestorAuthenticationInfoOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSRequestorID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorIDOption { get; private set; } + [DataMember(Name = "threeDSRequestorAuthenticationInfo", EmitDefaultValue = false)] + public ThreeDSRequestorAuthenticationInfo ThreeDSRequestorAuthenticationInfo { get; set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. - [JsonPropertyName("threeDSRequestorID")] - public string ThreeDSRequestorID { get { return this.ThreeDSRequestorIDOption; } set { this.ThreeDSRequestorIDOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSRequestorName - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorNameOption { get; private set; } + [DataMember(Name = "threeDSRequestorID", EmitDefaultValue = false)] + public string ThreeDSRequestorID { get; set; } /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. /// /// Required for [authentication-only integration](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. - [JsonPropertyName("threeDSRequestorName")] - public string ThreeDSRequestorName { get { return this.ThreeDSRequestorNameOption; } set { this.ThreeDSRequestorNameOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSRequestorPriorAuthenticationInfo - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorPriorAuthenticationInfoOption { get; private set; } + [DataMember(Name = "threeDSRequestorName", EmitDefaultValue = false)] + public string ThreeDSRequestorName { get; set; } /// /// Gets or Sets ThreeDSRequestorPriorAuthenticationInfo /// - [JsonPropertyName("threeDSRequestorPriorAuthenticationInfo")] - public ThreeDSRequestorPriorAuthenticationInfo ThreeDSRequestorPriorAuthenticationInfo { get { return this.ThreeDSRequestorPriorAuthenticationInfoOption; } set { this.ThreeDSRequestorPriorAuthenticationInfoOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSRequestorURL - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorURLOption { get; private set; } + [DataMember(Name = "threeDSRequestorPriorAuthenticationInfo", EmitDefaultValue = false)] + public ThreeDSRequestorPriorAuthenticationInfo ThreeDSRequestorPriorAuthenticationInfo { get; set; } /// /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. /// /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. - [JsonPropertyName("threeDSRequestorURL")] - public string ThreeDSRequestorURL { get { return this.ThreeDSRequestorURLOption; } set { this.ThreeDSRequestorURLOption = new Option(value); } } - - /// - /// Used to track the state of WhiteListStatus - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option WhiteListStatusOption { get; private set; } + [DataMember(Name = "threeDSRequestorURL", EmitDefaultValue = false)] + public string ThreeDSRequestorURL { get; set; } /// /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. /// /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. - [JsonPropertyName("whiteListStatus")] - public string WhiteListStatus { get { return this.WhiteListStatusOption; } set { this.WhiteListStatusOption = new Option(value); } } - - /// - /// Used to track the state of WorkPhone - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option WorkPhoneOption { get; private set; } + [DataMember(Name = "whiteListStatus", EmitDefaultValue = false)] + public string WhiteListStatus { get; set; } /// /// Gets or Sets WorkPhone /// - [JsonPropertyName("workPhone")] - public Phone WorkPhone { get { return this.WorkPhoneOption; } set { this.WorkPhoneOption = new Option(value); } } + [DataMember(Name = "workPhone", EmitDefaultValue = false)] + public Phone WorkPhone { get; set; } /// /// Returns the string presentation of the object @@ -1242,579 +610,365 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // PurchaseInstalData (string) maxLength - if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length > 3) - { - yield return new ValidationResult("Invalid value for PurchaseInstalData, length must be less than 3.", new [] { "PurchaseInstalData" }); - } - - // PurchaseInstalData (string) minLength - if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length < 1) - { - yield return new ValidationResult("Invalid value for PurchaseInstalData, length must be greater than 1.", new [] { "PurchaseInstalData" }); - } - - // RecurringFrequency (string) maxLength - if (this.RecurringFrequency != null && this.RecurringFrequency.Length > 4) - { - yield return new ValidationResult("Invalid value for RecurringFrequency, length must be less than 4.", new [] { "RecurringFrequency" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ThreeDS2RequestFieldsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ThreeDS2RequestFields Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option acctInfo = default; - Option acctType = default; - Option acquirerBIN = default; - Option acquirerMerchantID = default; - Option addrMatch = default; - Option authenticationOnly = default; - Option challengeIndicator = default; - Option deviceRenderOptions = default; - Option homePhone = default; - Option mcc = default; - Option merchantName = default; - Option messageVersion = default; - Option mobilePhone = default; - Option notificationURL = default; - Option payTokenInd = default; - Option paymentAuthenticationUseCase = default; - Option purchaseInstalData = default; - Option recurringExpiry = default; - Option recurringFrequency = default; - Option sdkAppID = default; - Option sdkEphemPubKey = default; - Option sdkMaxTimeout = default; - Option sdkReferenceNumber = default; - Option sdkTransID = default; - Option threeDSCompInd = default; - Option threeDSRequestorAuthenticationInd = default; - Option threeDSRequestorAuthenticationInfo = default; - Option threeDSRequestorChallengeInd = default; - Option threeDSRequestorID = default; - Option threeDSRequestorName = default; - Option threeDSRequestorPriorAuthenticationInfo = default; - Option threeDSRequestorURL = default; - Option transType = default; - Option transactionType = default; - Option whiteListStatus = default; - Option workPhone = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "acctInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - acctInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "acctType": - string acctTypeRawValue = utf8JsonReader.GetString(); - if (acctTypeRawValue != null) - acctType = new Option(ThreeDS2RequestFields.AcctTypeEnumFromStringOrDefault(acctTypeRawValue)); - break; - case "acquirerBIN": - acquirerBIN = new Option(utf8JsonReader.GetString()); - break; - case "acquirerMerchantID": - acquirerMerchantID = new Option(utf8JsonReader.GetString()); - break; - case "addrMatch": - string addrMatchRawValue = utf8JsonReader.GetString(); - if (addrMatchRawValue != null) - addrMatch = new Option(ThreeDS2RequestFields.AddrMatchEnumFromStringOrDefault(addrMatchRawValue)); - break; - case "authenticationOnly": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - authenticationOnly = new Option(utf8JsonReader.GetBoolean()); - break; - case "challengeIndicator": - string challengeIndicatorRawValue = utf8JsonReader.GetString(); - if (challengeIndicatorRawValue != null) - challengeIndicator = new Option(ThreeDS2RequestFields.ChallengeIndicatorEnumFromStringOrDefault(challengeIndicatorRawValue)); - break; - case "deviceRenderOptions": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deviceRenderOptions = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "homePhone": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - homePhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "mcc": - mcc = new Option(utf8JsonReader.GetString()); - break; - case "merchantName": - merchantName = new Option(utf8JsonReader.GetString()); - break; - case "messageVersion": - messageVersion = new Option(utf8JsonReader.GetString()); - break; - case "mobilePhone": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mobilePhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "notificationURL": - notificationURL = new Option(utf8JsonReader.GetString()); - break; - case "payTokenInd": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - payTokenInd = new Option(utf8JsonReader.GetBoolean()); - break; - case "paymentAuthenticationUseCase": - paymentAuthenticationUseCase = new Option(utf8JsonReader.GetString()); - break; - case "purchaseInstalData": - purchaseInstalData = new Option(utf8JsonReader.GetString()); - break; - case "recurringExpiry": - recurringExpiry = new Option(utf8JsonReader.GetString()); - break; - case "recurringFrequency": - recurringFrequency = new Option(utf8JsonReader.GetString()); - break; - case "sdkAppID": - sdkAppID = new Option(utf8JsonReader.GetString()); - break; - case "sdkEphemPubKey": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sdkEphemPubKey = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "sdkMaxTimeout": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sdkMaxTimeout = new Option(utf8JsonReader.GetInt32()); - break; - case "sdkReferenceNumber": - sdkReferenceNumber = new Option(utf8JsonReader.GetString()); - break; - case "sdkTransID": - sdkTransID = new Option(utf8JsonReader.GetString()); - break; - case "threeDSCompInd": - threeDSCompInd = new Option(utf8JsonReader.GetString()); - break; - case "threeDSRequestorAuthenticationInd": - threeDSRequestorAuthenticationInd = new Option(utf8JsonReader.GetString()); - break; - case "threeDSRequestorAuthenticationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDSRequestorAuthenticationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDSRequestorChallengeInd": - string threeDSRequestorChallengeIndRawValue = utf8JsonReader.GetString(); - if (threeDSRequestorChallengeIndRawValue != null) - threeDSRequestorChallengeInd = new Option(ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnumFromStringOrDefault(threeDSRequestorChallengeIndRawValue)); - break; - case "threeDSRequestorID": - threeDSRequestorID = new Option(utf8JsonReader.GetString()); - break; - case "threeDSRequestorName": - threeDSRequestorName = new Option(utf8JsonReader.GetString()); - break; - case "threeDSRequestorPriorAuthenticationInfo": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - threeDSRequestorPriorAuthenticationInfo = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "threeDSRequestorURL": - threeDSRequestorURL = new Option(utf8JsonReader.GetString()); - break; - case "transType": - string transTypeRawValue = utf8JsonReader.GetString(); - if (transTypeRawValue != null) - transType = new Option(ThreeDS2RequestFields.TransTypeEnumFromStringOrDefault(transTypeRawValue)); - break; - case "transactionType": - string transactionTypeRawValue = utf8JsonReader.GetString(); - if (transactionTypeRawValue != null) - transactionType = new Option(ThreeDS2RequestFields.TransactionTypeEnumFromStringOrDefault(transactionTypeRawValue)); - break; - case "whiteListStatus": - whiteListStatus = new Option(utf8JsonReader.GetString()); - break; - case "workPhone": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - workPhone = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (acctInfo.IsSet && acctInfo.Value == null) - throw new ArgumentNullException(nameof(acctInfo), "Property is not nullable for class ThreeDS2RequestFields."); - - if (acctType.IsSet && acctType.Value == null) - throw new ArgumentNullException(nameof(acctType), "Property is not nullable for class ThreeDS2RequestFields."); - - if (acquirerBIN.IsSet && acquirerBIN.Value == null) - throw new ArgumentNullException(nameof(acquirerBIN), "Property is not nullable for class ThreeDS2RequestFields."); - - if (acquirerMerchantID.IsSet && acquirerMerchantID.Value == null) - throw new ArgumentNullException(nameof(acquirerMerchantID), "Property is not nullable for class ThreeDS2RequestFields."); - - if (addrMatch.IsSet && addrMatch.Value == null) - throw new ArgumentNullException(nameof(addrMatch), "Property is not nullable for class ThreeDS2RequestFields."); - - if (authenticationOnly.IsSet && authenticationOnly.Value == null) - throw new ArgumentNullException(nameof(authenticationOnly), "Property is not nullable for class ThreeDS2RequestFields."); - - if (challengeIndicator.IsSet && challengeIndicator.Value == null) - throw new ArgumentNullException(nameof(challengeIndicator), "Property is not nullable for class ThreeDS2RequestFields."); - - if (deviceRenderOptions.IsSet && deviceRenderOptions.Value == null) - throw new ArgumentNullException(nameof(deviceRenderOptions), "Property is not nullable for class ThreeDS2RequestFields."); - - if (homePhone.IsSet && homePhone.Value == null) - throw new ArgumentNullException(nameof(homePhone), "Property is not nullable for class ThreeDS2RequestFields."); - - if (mcc.IsSet && mcc.Value == null) - throw new ArgumentNullException(nameof(mcc), "Property is not nullable for class ThreeDS2RequestFields."); - - if (merchantName.IsSet && merchantName.Value == null) - throw new ArgumentNullException(nameof(merchantName), "Property is not nullable for class ThreeDS2RequestFields."); - - if (messageVersion.IsSet && messageVersion.Value == null) - throw new ArgumentNullException(nameof(messageVersion), "Property is not nullable for class ThreeDS2RequestFields."); - - if (mobilePhone.IsSet && mobilePhone.Value == null) - throw new ArgumentNullException(nameof(mobilePhone), "Property is not nullable for class ThreeDS2RequestFields."); - - if (notificationURL.IsSet && notificationURL.Value == null) - throw new ArgumentNullException(nameof(notificationURL), "Property is not nullable for class ThreeDS2RequestFields."); - - if (payTokenInd.IsSet && payTokenInd.Value == null) - throw new ArgumentNullException(nameof(payTokenInd), "Property is not nullable for class ThreeDS2RequestFields."); - - if (paymentAuthenticationUseCase.IsSet && paymentAuthenticationUseCase.Value == null) - throw new ArgumentNullException(nameof(paymentAuthenticationUseCase), "Property is not nullable for class ThreeDS2RequestFields."); - - if (purchaseInstalData.IsSet && purchaseInstalData.Value == null) - throw new ArgumentNullException(nameof(purchaseInstalData), "Property is not nullable for class ThreeDS2RequestFields."); - - if (recurringExpiry.IsSet && recurringExpiry.Value == null) - throw new ArgumentNullException(nameof(recurringExpiry), "Property is not nullable for class ThreeDS2RequestFields."); - - if (recurringFrequency.IsSet && recurringFrequency.Value == null) - throw new ArgumentNullException(nameof(recurringFrequency), "Property is not nullable for class ThreeDS2RequestFields."); - - if (sdkAppID.IsSet && sdkAppID.Value == null) - throw new ArgumentNullException(nameof(sdkAppID), "Property is not nullable for class ThreeDS2RequestFields."); - - if (sdkEphemPubKey.IsSet && sdkEphemPubKey.Value == null) - throw new ArgumentNullException(nameof(sdkEphemPubKey), "Property is not nullable for class ThreeDS2RequestFields."); - - if (sdkMaxTimeout.IsSet && sdkMaxTimeout.Value == null) - throw new ArgumentNullException(nameof(sdkMaxTimeout), "Property is not nullable for class ThreeDS2RequestFields."); - - if (sdkReferenceNumber.IsSet && sdkReferenceNumber.Value == null) - throw new ArgumentNullException(nameof(sdkReferenceNumber), "Property is not nullable for class ThreeDS2RequestFields."); - - if (sdkTransID.IsSet && sdkTransID.Value == null) - throw new ArgumentNullException(nameof(sdkTransID), "Property is not nullable for class ThreeDS2RequestFields."); - - if (threeDSCompInd.IsSet && threeDSCompInd.Value == null) - throw new ArgumentNullException(nameof(threeDSCompInd), "Property is not nullable for class ThreeDS2RequestFields."); - - if (threeDSRequestorAuthenticationInd.IsSet && threeDSRequestorAuthenticationInd.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorAuthenticationInd), "Property is not nullable for class ThreeDS2RequestFields."); - - if (threeDSRequestorAuthenticationInfo.IsSet && threeDSRequestorAuthenticationInfo.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorAuthenticationInfo), "Property is not nullable for class ThreeDS2RequestFields."); - - if (threeDSRequestorChallengeInd.IsSet && threeDSRequestorChallengeInd.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorChallengeInd), "Property is not nullable for class ThreeDS2RequestFields."); - - if (threeDSRequestorID.IsSet && threeDSRequestorID.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorID), "Property is not nullable for class ThreeDS2RequestFields."); - - if (threeDSRequestorName.IsSet && threeDSRequestorName.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorName), "Property is not nullable for class ThreeDS2RequestFields."); - - if (threeDSRequestorPriorAuthenticationInfo.IsSet && threeDSRequestorPriorAuthenticationInfo.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorPriorAuthenticationInfo), "Property is not nullable for class ThreeDS2RequestFields."); - - if (threeDSRequestorURL.IsSet && threeDSRequestorURL.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorURL), "Property is not nullable for class ThreeDS2RequestFields."); - - if (transType.IsSet && transType.Value == null) - throw new ArgumentNullException(nameof(transType), "Property is not nullable for class ThreeDS2RequestFields."); - - if (transactionType.IsSet && transactionType.Value == null) - throw new ArgumentNullException(nameof(transactionType), "Property is not nullable for class ThreeDS2RequestFields."); - - if (whiteListStatus.IsSet && whiteListStatus.Value == null) - throw new ArgumentNullException(nameof(whiteListStatus), "Property is not nullable for class ThreeDS2RequestFields."); - - if (workPhone.IsSet && workPhone.Value == null) - throw new ArgumentNullException(nameof(workPhone), "Property is not nullable for class ThreeDS2RequestFields."); - - return new ThreeDS2RequestFields(acctInfo, acctType, acquirerBIN, acquirerMerchantID, addrMatch, authenticationOnly, challengeIndicator, deviceRenderOptions, homePhone, mcc, merchantName, messageVersion, mobilePhone, notificationURL, payTokenInd, paymentAuthenticationUseCase, purchaseInstalData, recurringExpiry, recurringFrequency, sdkAppID, sdkEphemPubKey, sdkMaxTimeout, sdkReferenceNumber, sdkTransID, threeDSCompInd, threeDSRequestorAuthenticationInd, threeDSRequestorAuthenticationInfo, threeDSRequestorChallengeInd, threeDSRequestorID, threeDSRequestorName, threeDSRequestorPriorAuthenticationInfo, threeDSRequestorURL, transType, transactionType, whiteListStatus, workPhone); + return this.Equals(input as ThreeDS2RequestFields); } /// - /// Serializes a + /// Returns true if ThreeDS2RequestFields instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ThreeDS2RequestFields threeDS2RequestFields, JsonSerializerOptions jsonSerializerOptions) + /// Instance of ThreeDS2RequestFields to be compared + /// Boolean + public bool Equals(ThreeDS2RequestFields input) { - writer.WriteStartObject(); - - WriteProperties(writer, threeDS2RequestFields, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AcctInfo == input.AcctInfo || + (this.AcctInfo != null && + this.AcctInfo.Equals(input.AcctInfo)) + ) && + ( + this.AcctType == input.AcctType || + this.AcctType.Equals(input.AcctType) + ) && + ( + this.AcquirerBIN == input.AcquirerBIN || + (this.AcquirerBIN != null && + this.AcquirerBIN.Equals(input.AcquirerBIN)) + ) && + ( + this.AcquirerMerchantID == input.AcquirerMerchantID || + (this.AcquirerMerchantID != null && + this.AcquirerMerchantID.Equals(input.AcquirerMerchantID)) + ) && + ( + this.AddrMatch == input.AddrMatch || + this.AddrMatch.Equals(input.AddrMatch) + ) && + ( + this.AuthenticationOnly == input.AuthenticationOnly || + this.AuthenticationOnly.Equals(input.AuthenticationOnly) + ) && + ( + this.ChallengeIndicator == input.ChallengeIndicator || + this.ChallengeIndicator.Equals(input.ChallengeIndicator) + ) && + ( + this.DeviceRenderOptions == input.DeviceRenderOptions || + (this.DeviceRenderOptions != null && + this.DeviceRenderOptions.Equals(input.DeviceRenderOptions)) + ) && + ( + this.HomePhone == input.HomePhone || + (this.HomePhone != null && + this.HomePhone.Equals(input.HomePhone)) + ) && + ( + this.Mcc == input.Mcc || + (this.Mcc != null && + this.Mcc.Equals(input.Mcc)) + ) && + ( + this.MerchantName == input.MerchantName || + (this.MerchantName != null && + this.MerchantName.Equals(input.MerchantName)) + ) && + ( + this.MessageVersion == input.MessageVersion || + (this.MessageVersion != null && + this.MessageVersion.Equals(input.MessageVersion)) + ) && + ( + this.MobilePhone == input.MobilePhone || + (this.MobilePhone != null && + this.MobilePhone.Equals(input.MobilePhone)) + ) && + ( + this.NotificationURL == input.NotificationURL || + (this.NotificationURL != null && + this.NotificationURL.Equals(input.NotificationURL)) + ) && + ( + this.PayTokenInd == input.PayTokenInd || + this.PayTokenInd.Equals(input.PayTokenInd) + ) && + ( + this.PaymentAuthenticationUseCase == input.PaymentAuthenticationUseCase || + (this.PaymentAuthenticationUseCase != null && + this.PaymentAuthenticationUseCase.Equals(input.PaymentAuthenticationUseCase)) + ) && + ( + this.PurchaseInstalData == input.PurchaseInstalData || + (this.PurchaseInstalData != null && + this.PurchaseInstalData.Equals(input.PurchaseInstalData)) + ) && + ( + this.RecurringExpiry == input.RecurringExpiry || + (this.RecurringExpiry != null && + this.RecurringExpiry.Equals(input.RecurringExpiry)) + ) && + ( + this.RecurringFrequency == input.RecurringFrequency || + (this.RecurringFrequency != null && + this.RecurringFrequency.Equals(input.RecurringFrequency)) + ) && + ( + this.SdkAppID == input.SdkAppID || + (this.SdkAppID != null && + this.SdkAppID.Equals(input.SdkAppID)) + ) && + ( + this.SdkEphemPubKey == input.SdkEphemPubKey || + (this.SdkEphemPubKey != null && + this.SdkEphemPubKey.Equals(input.SdkEphemPubKey)) + ) && + ( + this.SdkMaxTimeout == input.SdkMaxTimeout || + this.SdkMaxTimeout.Equals(input.SdkMaxTimeout) + ) && + ( + this.SdkReferenceNumber == input.SdkReferenceNumber || + (this.SdkReferenceNumber != null && + this.SdkReferenceNumber.Equals(input.SdkReferenceNumber)) + ) && + ( + this.SdkTransID == input.SdkTransID || + (this.SdkTransID != null && + this.SdkTransID.Equals(input.SdkTransID)) + ) && + ( + this.ThreeDSCompInd == input.ThreeDSCompInd || + (this.ThreeDSCompInd != null && + this.ThreeDSCompInd.Equals(input.ThreeDSCompInd)) + ) && + ( + this.ThreeDSRequestorAuthenticationInd == input.ThreeDSRequestorAuthenticationInd || + (this.ThreeDSRequestorAuthenticationInd != null && + this.ThreeDSRequestorAuthenticationInd.Equals(input.ThreeDSRequestorAuthenticationInd)) + ) && + ( + this.ThreeDSRequestorAuthenticationInfo == input.ThreeDSRequestorAuthenticationInfo || + (this.ThreeDSRequestorAuthenticationInfo != null && + this.ThreeDSRequestorAuthenticationInfo.Equals(input.ThreeDSRequestorAuthenticationInfo)) + ) && + ( + this.ThreeDSRequestorChallengeInd == input.ThreeDSRequestorChallengeInd || + this.ThreeDSRequestorChallengeInd.Equals(input.ThreeDSRequestorChallengeInd) + ) && + ( + this.ThreeDSRequestorID == input.ThreeDSRequestorID || + (this.ThreeDSRequestorID != null && + this.ThreeDSRequestorID.Equals(input.ThreeDSRequestorID)) + ) && + ( + this.ThreeDSRequestorName == input.ThreeDSRequestorName || + (this.ThreeDSRequestorName != null && + this.ThreeDSRequestorName.Equals(input.ThreeDSRequestorName)) + ) && + ( + this.ThreeDSRequestorPriorAuthenticationInfo == input.ThreeDSRequestorPriorAuthenticationInfo || + (this.ThreeDSRequestorPriorAuthenticationInfo != null && + this.ThreeDSRequestorPriorAuthenticationInfo.Equals(input.ThreeDSRequestorPriorAuthenticationInfo)) + ) && + ( + this.ThreeDSRequestorURL == input.ThreeDSRequestorURL || + (this.ThreeDSRequestorURL != null && + this.ThreeDSRequestorURL.Equals(input.ThreeDSRequestorURL)) + ) && + ( + this.TransType == input.TransType || + this.TransType.Equals(input.TransType) + ) && + ( + this.TransactionType == input.TransactionType || + this.TransactionType.Equals(input.TransactionType) + ) && + ( + this.WhiteListStatus == input.WhiteListStatus || + (this.WhiteListStatus != null && + this.WhiteListStatus.Equals(input.WhiteListStatus)) + ) && + ( + this.WorkPhone == input.WorkPhone || + (this.WorkPhone != null && + this.WorkPhone.Equals(input.WorkPhone)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ThreeDS2RequestFields threeDS2RequestFields, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (threeDS2RequestFields.AcctInfoOption.IsSet && threeDS2RequestFields.AcctInfo == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.AcctInfo), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.AcquirerBINOption.IsSet && threeDS2RequestFields.AcquirerBIN == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.AcquirerBIN), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.AcquirerMerchantIDOption.IsSet && threeDS2RequestFields.AcquirerMerchantID == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.AcquirerMerchantID), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.DeviceRenderOptionsOption.IsSet && threeDS2RequestFields.DeviceRenderOptions == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.DeviceRenderOptions), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.HomePhoneOption.IsSet && threeDS2RequestFields.HomePhone == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.HomePhone), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.MccOption.IsSet && threeDS2RequestFields.Mcc == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.Mcc), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.MerchantNameOption.IsSet && threeDS2RequestFields.MerchantName == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.MerchantName), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.MessageVersionOption.IsSet && threeDS2RequestFields.MessageVersion == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.MessageVersion), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.MobilePhoneOption.IsSet && threeDS2RequestFields.MobilePhone == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.MobilePhone), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.NotificationURLOption.IsSet && threeDS2RequestFields.NotificationURL == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.NotificationURL), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.PaymentAuthenticationUseCaseOption.IsSet && threeDS2RequestFields.PaymentAuthenticationUseCase == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.PaymentAuthenticationUseCase), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.PurchaseInstalDataOption.IsSet && threeDS2RequestFields.PurchaseInstalData == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.PurchaseInstalData), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.RecurringExpiryOption.IsSet && threeDS2RequestFields.RecurringExpiry == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.RecurringExpiry), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.RecurringFrequencyOption.IsSet && threeDS2RequestFields.RecurringFrequency == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.RecurringFrequency), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.SdkAppIDOption.IsSet && threeDS2RequestFields.SdkAppID == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.SdkAppID), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.SdkEphemPubKeyOption.IsSet && threeDS2RequestFields.SdkEphemPubKey == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.SdkEphemPubKey), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.SdkReferenceNumberOption.IsSet && threeDS2RequestFields.SdkReferenceNumber == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.SdkReferenceNumber), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.SdkTransIDOption.IsSet && threeDS2RequestFields.SdkTransID == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.SdkTransID), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.ThreeDSCompIndOption.IsSet && threeDS2RequestFields.ThreeDSCompInd == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSCompInd), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.ThreeDSRequestorAuthenticationIndOption.IsSet && threeDS2RequestFields.ThreeDSRequestorAuthenticationInd == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSRequestorAuthenticationInd), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.ThreeDSRequestorAuthenticationInfoOption.IsSet && threeDS2RequestFields.ThreeDSRequestorAuthenticationInfo == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSRequestorAuthenticationInfo), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.ThreeDSRequestorIDOption.IsSet && threeDS2RequestFields.ThreeDSRequestorID == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSRequestorID), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.ThreeDSRequestorNameOption.IsSet && threeDS2RequestFields.ThreeDSRequestorName == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSRequestorName), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.ThreeDSRequestorPriorAuthenticationInfoOption.IsSet && threeDS2RequestFields.ThreeDSRequestorPriorAuthenticationInfo == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSRequestorPriorAuthenticationInfo), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.ThreeDSRequestorURLOption.IsSet && threeDS2RequestFields.ThreeDSRequestorURL == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.ThreeDSRequestorURL), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.WhiteListStatusOption.IsSet && threeDS2RequestFields.WhiteListStatus == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.WhiteListStatus), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.WorkPhoneOption.IsSet && threeDS2RequestFields.WorkPhone == null) - throw new ArgumentNullException(nameof(threeDS2RequestFields.WorkPhone), "Property is required for class ThreeDS2RequestFields."); - - if (threeDS2RequestFields.AcctInfoOption.IsSet) - { - writer.WritePropertyName("acctInfo"); - JsonSerializer.Serialize(writer, threeDS2RequestFields.AcctInfo, jsonSerializerOptions); - } - var acctTypeRawValue = ThreeDS2RequestFields.AcctTypeEnumToJsonValue(threeDS2RequestFields.AcctTypeOption.Value.Value); - writer.WriteString("acctType", acctTypeRawValue); - if (threeDS2RequestFields.AcquirerBINOption.IsSet) - writer.WriteString("acquirerBIN", threeDS2RequestFields.AcquirerBIN); - - if (threeDS2RequestFields.AcquirerMerchantIDOption.IsSet) - writer.WriteString("acquirerMerchantID", threeDS2RequestFields.AcquirerMerchantID); - - var addrMatchRawValue = ThreeDS2RequestFields.AddrMatchEnumToJsonValue(threeDS2RequestFields.AddrMatchOption.Value.Value); - writer.WriteString("addrMatch", addrMatchRawValue); - if (threeDS2RequestFields.AuthenticationOnlyOption.IsSet) - writer.WriteBoolean("authenticationOnly", threeDS2RequestFields.AuthenticationOnlyOption.Value.Value); - - var challengeIndicatorRawValue = ThreeDS2RequestFields.ChallengeIndicatorEnumToJsonValue(threeDS2RequestFields.ChallengeIndicatorOption.Value.Value); - writer.WriteString("challengeIndicator", challengeIndicatorRawValue); - if (threeDS2RequestFields.DeviceRenderOptionsOption.IsSet) - { - writer.WritePropertyName("deviceRenderOptions"); - JsonSerializer.Serialize(writer, threeDS2RequestFields.DeviceRenderOptions, jsonSerializerOptions); - } - if (threeDS2RequestFields.HomePhoneOption.IsSet) - { - writer.WritePropertyName("homePhone"); - JsonSerializer.Serialize(writer, threeDS2RequestFields.HomePhone, jsonSerializerOptions); - } - if (threeDS2RequestFields.MccOption.IsSet) - writer.WriteString("mcc", threeDS2RequestFields.Mcc); - - if (threeDS2RequestFields.MerchantNameOption.IsSet) - writer.WriteString("merchantName", threeDS2RequestFields.MerchantName); - - if (threeDS2RequestFields.MessageVersionOption.IsSet) - writer.WriteString("messageVersion", threeDS2RequestFields.MessageVersion); - - if (threeDS2RequestFields.MobilePhoneOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("mobilePhone"); - JsonSerializer.Serialize(writer, threeDS2RequestFields.MobilePhone, jsonSerializerOptions); + int hashCode = 41; + if (this.AcctInfo != null) + { + hashCode = (hashCode * 59) + this.AcctInfo.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AcctType.GetHashCode(); + if (this.AcquirerBIN != null) + { + hashCode = (hashCode * 59) + this.AcquirerBIN.GetHashCode(); + } + if (this.AcquirerMerchantID != null) + { + hashCode = (hashCode * 59) + this.AcquirerMerchantID.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AddrMatch.GetHashCode(); + hashCode = (hashCode * 59) + this.AuthenticationOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.ChallengeIndicator.GetHashCode(); + if (this.DeviceRenderOptions != null) + { + hashCode = (hashCode * 59) + this.DeviceRenderOptions.GetHashCode(); + } + if (this.HomePhone != null) + { + hashCode = (hashCode * 59) + this.HomePhone.GetHashCode(); + } + if (this.Mcc != null) + { + hashCode = (hashCode * 59) + this.Mcc.GetHashCode(); + } + if (this.MerchantName != null) + { + hashCode = (hashCode * 59) + this.MerchantName.GetHashCode(); + } + if (this.MessageVersion != null) + { + hashCode = (hashCode * 59) + this.MessageVersion.GetHashCode(); + } + if (this.MobilePhone != null) + { + hashCode = (hashCode * 59) + this.MobilePhone.GetHashCode(); + } + if (this.NotificationURL != null) + { + hashCode = (hashCode * 59) + this.NotificationURL.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PayTokenInd.GetHashCode(); + if (this.PaymentAuthenticationUseCase != null) + { + hashCode = (hashCode * 59) + this.PaymentAuthenticationUseCase.GetHashCode(); + } + if (this.PurchaseInstalData != null) + { + hashCode = (hashCode * 59) + this.PurchaseInstalData.GetHashCode(); + } + if (this.RecurringExpiry != null) + { + hashCode = (hashCode * 59) + this.RecurringExpiry.GetHashCode(); + } + if (this.RecurringFrequency != null) + { + hashCode = (hashCode * 59) + this.RecurringFrequency.GetHashCode(); + } + if (this.SdkAppID != null) + { + hashCode = (hashCode * 59) + this.SdkAppID.GetHashCode(); + } + if (this.SdkEphemPubKey != null) + { + hashCode = (hashCode * 59) + this.SdkEphemPubKey.GetHashCode(); + } + hashCode = (hashCode * 59) + this.SdkMaxTimeout.GetHashCode(); + if (this.SdkReferenceNumber != null) + { + hashCode = (hashCode * 59) + this.SdkReferenceNumber.GetHashCode(); + } + if (this.SdkTransID != null) + { + hashCode = (hashCode * 59) + this.SdkTransID.GetHashCode(); + } + if (this.ThreeDSCompInd != null) + { + hashCode = (hashCode * 59) + this.ThreeDSCompInd.GetHashCode(); + } + if (this.ThreeDSRequestorAuthenticationInd != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestorAuthenticationInd.GetHashCode(); + } + if (this.ThreeDSRequestorAuthenticationInfo != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestorAuthenticationInfo.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ThreeDSRequestorChallengeInd.GetHashCode(); + if (this.ThreeDSRequestorID != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestorID.GetHashCode(); + } + if (this.ThreeDSRequestorName != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestorName.GetHashCode(); + } + if (this.ThreeDSRequestorPriorAuthenticationInfo != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestorPriorAuthenticationInfo.GetHashCode(); + } + if (this.ThreeDSRequestorURL != null) + { + hashCode = (hashCode * 59) + this.ThreeDSRequestorURL.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TransType.GetHashCode(); + hashCode = (hashCode * 59) + this.TransactionType.GetHashCode(); + if (this.WhiteListStatus != null) + { + hashCode = (hashCode * 59) + this.WhiteListStatus.GetHashCode(); + } + if (this.WorkPhone != null) + { + hashCode = (hashCode * 59) + this.WorkPhone.GetHashCode(); + } + return hashCode; } - if (threeDS2RequestFields.NotificationURLOption.IsSet) - writer.WriteString("notificationURL", threeDS2RequestFields.NotificationURL); - - if (threeDS2RequestFields.PayTokenIndOption.IsSet) - writer.WriteBoolean("payTokenInd", threeDS2RequestFields.PayTokenIndOption.Value.Value); - - if (threeDS2RequestFields.PaymentAuthenticationUseCaseOption.IsSet) - writer.WriteString("paymentAuthenticationUseCase", threeDS2RequestFields.PaymentAuthenticationUseCase); - - if (threeDS2RequestFields.PurchaseInstalDataOption.IsSet) - writer.WriteString("purchaseInstalData", threeDS2RequestFields.PurchaseInstalData); - - if (threeDS2RequestFields.RecurringExpiryOption.IsSet) - writer.WriteString("recurringExpiry", threeDS2RequestFields.RecurringExpiry); - - if (threeDS2RequestFields.RecurringFrequencyOption.IsSet) - writer.WriteString("recurringFrequency", threeDS2RequestFields.RecurringFrequency); - - if (threeDS2RequestFields.SdkAppIDOption.IsSet) - writer.WriteString("sdkAppID", threeDS2RequestFields.SdkAppID); - - if (threeDS2RequestFields.SdkEphemPubKeyOption.IsSet) + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + // PurchaseInstalData (string) maxLength + if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length > 3) { - writer.WritePropertyName("sdkEphemPubKey"); - JsonSerializer.Serialize(writer, threeDS2RequestFields.SdkEphemPubKey, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PurchaseInstalData, length must be less than 3.", new [] { "PurchaseInstalData" }); } - if (threeDS2RequestFields.SdkMaxTimeoutOption.IsSet) - writer.WriteNumber("sdkMaxTimeout", threeDS2RequestFields.SdkMaxTimeoutOption.Value.Value); - if (threeDS2RequestFields.SdkReferenceNumberOption.IsSet) - writer.WriteString("sdkReferenceNumber", threeDS2RequestFields.SdkReferenceNumber); - - if (threeDS2RequestFields.SdkTransIDOption.IsSet) - writer.WriteString("sdkTransID", threeDS2RequestFields.SdkTransID); - - if (threeDS2RequestFields.ThreeDSCompIndOption.IsSet) - writer.WriteString("threeDSCompInd", threeDS2RequestFields.ThreeDSCompInd); - - if (threeDS2RequestFields.ThreeDSRequestorAuthenticationIndOption.IsSet) - writer.WriteString("threeDSRequestorAuthenticationInd", threeDS2RequestFields.ThreeDSRequestorAuthenticationInd); - - if (threeDS2RequestFields.ThreeDSRequestorAuthenticationInfoOption.IsSet) + // PurchaseInstalData (string) minLength + if (this.PurchaseInstalData != null && this.PurchaseInstalData.Length < 1) { - writer.WritePropertyName("threeDSRequestorAuthenticationInfo"); - JsonSerializer.Serialize(writer, threeDS2RequestFields.ThreeDSRequestorAuthenticationInfo, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PurchaseInstalData, length must be greater than 1.", new [] { "PurchaseInstalData" }); } - var threeDSRequestorChallengeIndRawValue = ThreeDS2RequestFields.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2RequestFields.ThreeDSRequestorChallengeIndOption.Value.Value); - writer.WriteString("threeDSRequestorChallengeInd", threeDSRequestorChallengeIndRawValue); - if (threeDS2RequestFields.ThreeDSRequestorIDOption.IsSet) - writer.WriteString("threeDSRequestorID", threeDS2RequestFields.ThreeDSRequestorID); - - if (threeDS2RequestFields.ThreeDSRequestorNameOption.IsSet) - writer.WriteString("threeDSRequestorName", threeDS2RequestFields.ThreeDSRequestorName); - if (threeDS2RequestFields.ThreeDSRequestorPriorAuthenticationInfoOption.IsSet) + // RecurringFrequency (string) maxLength + if (this.RecurringFrequency != null && this.RecurringFrequency.Length > 4) { - writer.WritePropertyName("threeDSRequestorPriorAuthenticationInfo"); - JsonSerializer.Serialize(writer, threeDS2RequestFields.ThreeDSRequestorPriorAuthenticationInfo, jsonSerializerOptions); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for RecurringFrequency, length must be less than 4.", new [] { "RecurringFrequency" }); } - if (threeDS2RequestFields.ThreeDSRequestorURLOption.IsSet) - writer.WriteString("threeDSRequestorURL", threeDS2RequestFields.ThreeDSRequestorURL); - var transTypeRawValue = ThreeDS2RequestFields.TransTypeEnumToJsonValue(threeDS2RequestFields.TransTypeOption.Value.Value); - writer.WriteString("transType", transTypeRawValue); - var transactionTypeRawValue = ThreeDS2RequestFields.TransactionTypeEnumToJsonValue(threeDS2RequestFields.TransactionTypeOption.Value.Value); - writer.WriteString("transactionType", transactionTypeRawValue); - if (threeDS2RequestFields.WhiteListStatusOption.IsSet) - writer.WriteString("whiteListStatus", threeDS2RequestFields.WhiteListStatus); - - if (threeDS2RequestFields.WorkPhoneOption.IsSet) - { - writer.WritePropertyName("workPhone"); - JsonSerializer.Serialize(writer, threeDS2RequestFields.WorkPhone, jsonSerializerOptions); - } + yield break; } } + } diff --git a/Adyen/Model/Checkout/ThreeDS2ResponseData.cs b/Adyen/Model/Checkout/ThreeDS2ResponseData.cs index 1b6e9ac94..b2e7a8fee 100644 --- a/Adyen/Model/Checkout/ThreeDS2ResponseData.cs +++ b/Adyen/Model/Checkout/ThreeDS2ResponseData.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,315 +15,181 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ThreeDS2ResponseData /// - public partial class ThreeDS2ResponseData : IValidatableObject + [DataContract(Name = "ThreeDS2ResponseData")] + public partial class ThreeDS2ResponseData : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// acsChallengeMandated - /// acsOperatorID - /// acsReferenceNumber - /// acsSignedContent - /// acsTransID - /// acsURL - /// authenticationType - /// cardHolderInfo - /// cavvAlgorithm - /// challengeIndicator - /// dsReferenceNumber - /// dsTransID - /// exemptionIndicator - /// messageVersion - /// riskScore - /// sdkEphemPubKey - /// threeDSServerTransID - /// transStatus - /// transStatusReason - [JsonConstructor] - public ThreeDS2ResponseData(Option acsChallengeMandated = default, Option acsOperatorID = default, Option acsReferenceNumber = default, Option acsSignedContent = default, Option acsTransID = default, Option acsURL = default, Option authenticationType = default, Option cardHolderInfo = default, Option cavvAlgorithm = default, Option challengeIndicator = default, Option dsReferenceNumber = default, Option dsTransID = default, Option exemptionIndicator = default, Option messageVersion = default, Option riskScore = default, Option sdkEphemPubKey = default, Option threeDSServerTransID = default, Option transStatus = default, Option transStatusReason = default) + /// acsChallengeMandated. + /// acsOperatorID. + /// acsReferenceNumber. + /// acsSignedContent. + /// acsTransID. + /// acsURL. + /// authenticationType. + /// cardHolderInfo. + /// cavvAlgorithm. + /// challengeIndicator. + /// dsReferenceNumber. + /// dsTransID. + /// exemptionIndicator. + /// messageVersion. + /// riskScore. + /// sdkEphemPubKey. + /// threeDSServerTransID. + /// transStatus. + /// transStatusReason. + public ThreeDS2ResponseData(string acsChallengeMandated = default(string), string acsOperatorID = default(string), string acsReferenceNumber = default(string), string acsSignedContent = default(string), string acsTransID = default(string), string acsURL = default(string), string authenticationType = default(string), string cardHolderInfo = default(string), string cavvAlgorithm = default(string), string challengeIndicator = default(string), string dsReferenceNumber = default(string), string dsTransID = default(string), string exemptionIndicator = default(string), string messageVersion = default(string), string riskScore = default(string), string sdkEphemPubKey = default(string), string threeDSServerTransID = default(string), string transStatus = default(string), string transStatusReason = default(string)) { - AcsChallengeMandatedOption = acsChallengeMandated; - AcsOperatorIDOption = acsOperatorID; - AcsReferenceNumberOption = acsReferenceNumber; - AcsSignedContentOption = acsSignedContent; - AcsTransIDOption = acsTransID; - AcsURLOption = acsURL; - AuthenticationTypeOption = authenticationType; - CardHolderInfoOption = cardHolderInfo; - CavvAlgorithmOption = cavvAlgorithm; - ChallengeIndicatorOption = challengeIndicator; - DsReferenceNumberOption = dsReferenceNumber; - DsTransIDOption = dsTransID; - ExemptionIndicatorOption = exemptionIndicator; - MessageVersionOption = messageVersion; - RiskScoreOption = riskScore; - SdkEphemPubKeyOption = sdkEphemPubKey; - ThreeDSServerTransIDOption = threeDSServerTransID; - TransStatusOption = transStatus; - TransStatusReasonOption = transStatusReason; - OnCreated(); + this.AcsChallengeMandated = acsChallengeMandated; + this.AcsOperatorID = acsOperatorID; + this.AcsReferenceNumber = acsReferenceNumber; + this.AcsSignedContent = acsSignedContent; + this.AcsTransID = acsTransID; + this.AcsURL = acsURL; + this.AuthenticationType = authenticationType; + this.CardHolderInfo = cardHolderInfo; + this.CavvAlgorithm = cavvAlgorithm; + this.ChallengeIndicator = challengeIndicator; + this.DsReferenceNumber = dsReferenceNumber; + this.DsTransID = dsTransID; + this.ExemptionIndicator = exemptionIndicator; + this.MessageVersion = messageVersion; + this.RiskScore = riskScore; + this.SdkEphemPubKey = sdkEphemPubKey; + this.ThreeDSServerTransID = threeDSServerTransID; + this.TransStatus = transStatus; + this.TransStatusReason = transStatusReason; } - partial void OnCreated(); - - /// - /// Used to track the state of AcsChallengeMandated - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcsChallengeMandatedOption { get; private set; } - /// /// Gets or Sets AcsChallengeMandated /// - [JsonPropertyName("acsChallengeMandated")] - public string AcsChallengeMandated { get { return this.AcsChallengeMandatedOption; } set { this.AcsChallengeMandatedOption = new Option(value); } } - - /// - /// Used to track the state of AcsOperatorID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcsOperatorIDOption { get; private set; } + [DataMember(Name = "acsChallengeMandated", EmitDefaultValue = false)] + public string AcsChallengeMandated { get; set; } /// /// Gets or Sets AcsOperatorID /// - [JsonPropertyName("acsOperatorID")] - public string AcsOperatorID { get { return this.AcsOperatorIDOption; } set { this.AcsOperatorIDOption = new Option(value); } } - - /// - /// Used to track the state of AcsReferenceNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcsReferenceNumberOption { get; private set; } + [DataMember(Name = "acsOperatorID", EmitDefaultValue = false)] + public string AcsOperatorID { get; set; } /// /// Gets or Sets AcsReferenceNumber /// - [JsonPropertyName("acsReferenceNumber")] - public string AcsReferenceNumber { get { return this.AcsReferenceNumberOption; } set { this.AcsReferenceNumberOption = new Option(value); } } - - /// - /// Used to track the state of AcsSignedContent - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcsSignedContentOption { get; private set; } + [DataMember(Name = "acsReferenceNumber", EmitDefaultValue = false)] + public string AcsReferenceNumber { get; set; } /// /// Gets or Sets AcsSignedContent /// - [JsonPropertyName("acsSignedContent")] - public string AcsSignedContent { get { return this.AcsSignedContentOption; } set { this.AcsSignedContentOption = new Option(value); } } - - /// - /// Used to track the state of AcsTransID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcsTransIDOption { get; private set; } + [DataMember(Name = "acsSignedContent", EmitDefaultValue = false)] + public string AcsSignedContent { get; set; } /// /// Gets or Sets AcsTransID /// - [JsonPropertyName("acsTransID")] - public string AcsTransID { get { return this.AcsTransIDOption; } set { this.AcsTransIDOption = new Option(value); } } - - /// - /// Used to track the state of AcsURL - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AcsURLOption { get; private set; } + [DataMember(Name = "acsTransID", EmitDefaultValue = false)] + public string AcsTransID { get; set; } /// /// Gets or Sets AcsURL /// - [JsonPropertyName("acsURL")] - public string AcsURL { get { return this.AcsURLOption; } set { this.AcsURLOption = new Option(value); } } - - /// - /// Used to track the state of AuthenticationType - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthenticationTypeOption { get; private set; } + [DataMember(Name = "acsURL", EmitDefaultValue = false)] + public string AcsURL { get; set; } /// /// Gets or Sets AuthenticationType /// - [JsonPropertyName("authenticationType")] - public string AuthenticationType { get { return this.AuthenticationTypeOption; } set { this.AuthenticationTypeOption = new Option(value); } } - - /// - /// Used to track the state of CardHolderInfo - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CardHolderInfoOption { get; private set; } + [DataMember(Name = "authenticationType", EmitDefaultValue = false)] + public string AuthenticationType { get; set; } /// /// Gets or Sets CardHolderInfo /// - [JsonPropertyName("cardHolderInfo")] - public string CardHolderInfo { get { return this.CardHolderInfoOption; } set { this.CardHolderInfoOption = new Option(value); } } - - /// - /// Used to track the state of CavvAlgorithm - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CavvAlgorithmOption { get; private set; } + [DataMember(Name = "cardHolderInfo", EmitDefaultValue = false)] + public string CardHolderInfo { get; set; } /// /// Gets or Sets CavvAlgorithm /// - [JsonPropertyName("cavvAlgorithm")] - public string CavvAlgorithm { get { return this.CavvAlgorithmOption; } set { this.CavvAlgorithmOption = new Option(value); } } - - /// - /// Used to track the state of ChallengeIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChallengeIndicatorOption { get; private set; } + [DataMember(Name = "cavvAlgorithm", EmitDefaultValue = false)] + public string CavvAlgorithm { get; set; } /// /// Gets or Sets ChallengeIndicator /// - [JsonPropertyName("challengeIndicator")] - public string ChallengeIndicator { get { return this.ChallengeIndicatorOption; } set { this.ChallengeIndicatorOption = new Option(value); } } - - /// - /// Used to track the state of DsReferenceNumber - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DsReferenceNumberOption { get; private set; } + [DataMember(Name = "challengeIndicator", EmitDefaultValue = false)] + public string ChallengeIndicator { get; set; } /// /// Gets or Sets DsReferenceNumber /// - [JsonPropertyName("dsReferenceNumber")] - public string DsReferenceNumber { get { return this.DsReferenceNumberOption; } set { this.DsReferenceNumberOption = new Option(value); } } - - /// - /// Used to track the state of DsTransID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DsTransIDOption { get; private set; } + [DataMember(Name = "dsReferenceNumber", EmitDefaultValue = false)] + public string DsReferenceNumber { get; set; } /// /// Gets or Sets DsTransID /// - [JsonPropertyName("dsTransID")] - public string DsTransID { get { return this.DsTransIDOption; } set { this.DsTransIDOption = new Option(value); } } - - /// - /// Used to track the state of ExemptionIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExemptionIndicatorOption { get; private set; } + [DataMember(Name = "dsTransID", EmitDefaultValue = false)] + public string DsTransID { get; set; } /// /// Gets or Sets ExemptionIndicator /// - [JsonPropertyName("exemptionIndicator")] - public string ExemptionIndicator { get { return this.ExemptionIndicatorOption; } set { this.ExemptionIndicatorOption = new Option(value); } } - - /// - /// Used to track the state of MessageVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MessageVersionOption { get; private set; } + [DataMember(Name = "exemptionIndicator", EmitDefaultValue = false)] + public string ExemptionIndicator { get; set; } /// /// Gets or Sets MessageVersion /// - [JsonPropertyName("messageVersion")] - public string MessageVersion { get { return this.MessageVersionOption; } set { this.MessageVersionOption = new Option(value); } } - - /// - /// Used to track the state of RiskScore - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskScoreOption { get; private set; } + [DataMember(Name = "messageVersion", EmitDefaultValue = false)] + public string MessageVersion { get; set; } /// /// Gets or Sets RiskScore /// - [JsonPropertyName("riskScore")] - public string RiskScore { get { return this.RiskScoreOption; } set { this.RiskScoreOption = new Option(value); } } - - /// - /// Used to track the state of SdkEphemPubKey - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SdkEphemPubKeyOption { get; private set; } + [DataMember(Name = "riskScore", EmitDefaultValue = false)] + public string RiskScore { get; set; } /// /// Gets or Sets SdkEphemPubKey /// - [JsonPropertyName("sdkEphemPubKey")] - public string SdkEphemPubKey { get { return this.SdkEphemPubKeyOption; } set { this.SdkEphemPubKeyOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSServerTransID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSServerTransIDOption { get; private set; } + [DataMember(Name = "sdkEphemPubKey", EmitDefaultValue = false)] + public string SdkEphemPubKey { get; set; } /// /// Gets or Sets ThreeDSServerTransID /// - [JsonPropertyName("threeDSServerTransID")] - public string ThreeDSServerTransID { get { return this.ThreeDSServerTransIDOption; } set { this.ThreeDSServerTransIDOption = new Option(value); } } - - /// - /// Used to track the state of TransStatus - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TransStatusOption { get; private set; } + [DataMember(Name = "threeDSServerTransID", EmitDefaultValue = false)] + public string ThreeDSServerTransID { get; set; } /// /// Gets or Sets TransStatus /// - [JsonPropertyName("transStatus")] - public string TransStatus { get { return this.TransStatusOption; } set { this.TransStatusOption = new Option(value); } } - - /// - /// Used to track the state of TransStatusReason - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TransStatusReasonOption { get; private set; } + [DataMember(Name = "transStatus", EmitDefaultValue = false)] + public string TransStatus { get; set; } /// /// Gets or Sets TransStatusReason /// - [JsonPropertyName("transStatusReason")] - public string TransStatusReason { get { return this.TransStatusReasonOption; } set { this.TransStatusReasonOption = new Option(value); } } + [DataMember(Name = "transStatusReason", EmitDefaultValue = false)] + public string TransStatusReason { get; set; } /// /// Returns the string presentation of the object @@ -356,333 +223,230 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ThreeDS2ResponseDataJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ThreeDS2ResponseData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option acsChallengeMandated = default; - Option acsOperatorID = default; - Option acsReferenceNumber = default; - Option acsSignedContent = default; - Option acsTransID = default; - Option acsURL = default; - Option authenticationType = default; - Option cardHolderInfo = default; - Option cavvAlgorithm = default; - Option challengeIndicator = default; - Option dsReferenceNumber = default; - Option dsTransID = default; - Option exemptionIndicator = default; - Option messageVersion = default; - Option riskScore = default; - Option sdkEphemPubKey = default; - Option threeDSServerTransID = default; - Option transStatus = default; - Option transStatusReason = default; + return this.Equals(input as ThreeDS2ResponseData); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ThreeDS2ResponseData instances are equal + /// + /// Instance of ThreeDS2ResponseData to be compared + /// Boolean + public bool Equals(ThreeDS2ResponseData input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "acsChallengeMandated": - acsChallengeMandated = new Option(utf8JsonReader.GetString()); - break; - case "acsOperatorID": - acsOperatorID = new Option(utf8JsonReader.GetString()); - break; - case "acsReferenceNumber": - acsReferenceNumber = new Option(utf8JsonReader.GetString()); - break; - case "acsSignedContent": - acsSignedContent = new Option(utf8JsonReader.GetString()); - break; - case "acsTransID": - acsTransID = new Option(utf8JsonReader.GetString()); - break; - case "acsURL": - acsURL = new Option(utf8JsonReader.GetString()); - break; - case "authenticationType": - authenticationType = new Option(utf8JsonReader.GetString()); - break; - case "cardHolderInfo": - cardHolderInfo = new Option(utf8JsonReader.GetString()); - break; - case "cavvAlgorithm": - cavvAlgorithm = new Option(utf8JsonReader.GetString()); - break; - case "challengeIndicator": - challengeIndicator = new Option(utf8JsonReader.GetString()); - break; - case "dsReferenceNumber": - dsReferenceNumber = new Option(utf8JsonReader.GetString()); - break; - case "dsTransID": - dsTransID = new Option(utf8JsonReader.GetString()); - break; - case "exemptionIndicator": - exemptionIndicator = new Option(utf8JsonReader.GetString()); - break; - case "messageVersion": - messageVersion = new Option(utf8JsonReader.GetString()); - break; - case "riskScore": - riskScore = new Option(utf8JsonReader.GetString()); - break; - case "sdkEphemPubKey": - sdkEphemPubKey = new Option(utf8JsonReader.GetString()); - break; - case "threeDSServerTransID": - threeDSServerTransID = new Option(utf8JsonReader.GetString()); - break; - case "transStatus": - transStatus = new Option(utf8JsonReader.GetString()); - break; - case "transStatusReason": - transStatusReason = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (acsChallengeMandated.IsSet && acsChallengeMandated.Value == null) - throw new ArgumentNullException(nameof(acsChallengeMandated), "Property is not nullable for class ThreeDS2ResponseData."); - - if (acsOperatorID.IsSet && acsOperatorID.Value == null) - throw new ArgumentNullException(nameof(acsOperatorID), "Property is not nullable for class ThreeDS2ResponseData."); - - if (acsReferenceNumber.IsSet && acsReferenceNumber.Value == null) - throw new ArgumentNullException(nameof(acsReferenceNumber), "Property is not nullable for class ThreeDS2ResponseData."); - - if (acsSignedContent.IsSet && acsSignedContent.Value == null) - throw new ArgumentNullException(nameof(acsSignedContent), "Property is not nullable for class ThreeDS2ResponseData."); - - if (acsTransID.IsSet && acsTransID.Value == null) - throw new ArgumentNullException(nameof(acsTransID), "Property is not nullable for class ThreeDS2ResponseData."); - - if (acsURL.IsSet && acsURL.Value == null) - throw new ArgumentNullException(nameof(acsURL), "Property is not nullable for class ThreeDS2ResponseData."); - - if (authenticationType.IsSet && authenticationType.Value == null) - throw new ArgumentNullException(nameof(authenticationType), "Property is not nullable for class ThreeDS2ResponseData."); - - if (cardHolderInfo.IsSet && cardHolderInfo.Value == null) - throw new ArgumentNullException(nameof(cardHolderInfo), "Property is not nullable for class ThreeDS2ResponseData."); - - if (cavvAlgorithm.IsSet && cavvAlgorithm.Value == null) - throw new ArgumentNullException(nameof(cavvAlgorithm), "Property is not nullable for class ThreeDS2ResponseData."); - - if (challengeIndicator.IsSet && challengeIndicator.Value == null) - throw new ArgumentNullException(nameof(challengeIndicator), "Property is not nullable for class ThreeDS2ResponseData."); - - if (dsReferenceNumber.IsSet && dsReferenceNumber.Value == null) - throw new ArgumentNullException(nameof(dsReferenceNumber), "Property is not nullable for class ThreeDS2ResponseData."); - - if (dsTransID.IsSet && dsTransID.Value == null) - throw new ArgumentNullException(nameof(dsTransID), "Property is not nullable for class ThreeDS2ResponseData."); - - if (exemptionIndicator.IsSet && exemptionIndicator.Value == null) - throw new ArgumentNullException(nameof(exemptionIndicator), "Property is not nullable for class ThreeDS2ResponseData."); - - if (messageVersion.IsSet && messageVersion.Value == null) - throw new ArgumentNullException(nameof(messageVersion), "Property is not nullable for class ThreeDS2ResponseData."); - - if (riskScore.IsSet && riskScore.Value == null) - throw new ArgumentNullException(nameof(riskScore), "Property is not nullable for class ThreeDS2ResponseData."); - - if (sdkEphemPubKey.IsSet && sdkEphemPubKey.Value == null) - throw new ArgumentNullException(nameof(sdkEphemPubKey), "Property is not nullable for class ThreeDS2ResponseData."); - - if (threeDSServerTransID.IsSet && threeDSServerTransID.Value == null) - throw new ArgumentNullException(nameof(threeDSServerTransID), "Property is not nullable for class ThreeDS2ResponseData."); - - if (transStatus.IsSet && transStatus.Value == null) - throw new ArgumentNullException(nameof(transStatus), "Property is not nullable for class ThreeDS2ResponseData."); - - if (transStatusReason.IsSet && transStatusReason.Value == null) - throw new ArgumentNullException(nameof(transStatusReason), "Property is not nullable for class ThreeDS2ResponseData."); - - return new ThreeDS2ResponseData(acsChallengeMandated, acsOperatorID, acsReferenceNumber, acsSignedContent, acsTransID, acsURL, authenticationType, cardHolderInfo, cavvAlgorithm, challengeIndicator, dsReferenceNumber, dsTransID, exemptionIndicator, messageVersion, riskScore, sdkEphemPubKey, threeDSServerTransID, transStatus, transStatusReason); + return + ( + this.AcsChallengeMandated == input.AcsChallengeMandated || + (this.AcsChallengeMandated != null && + this.AcsChallengeMandated.Equals(input.AcsChallengeMandated)) + ) && + ( + this.AcsOperatorID == input.AcsOperatorID || + (this.AcsOperatorID != null && + this.AcsOperatorID.Equals(input.AcsOperatorID)) + ) && + ( + this.AcsReferenceNumber == input.AcsReferenceNumber || + (this.AcsReferenceNumber != null && + this.AcsReferenceNumber.Equals(input.AcsReferenceNumber)) + ) && + ( + this.AcsSignedContent == input.AcsSignedContent || + (this.AcsSignedContent != null && + this.AcsSignedContent.Equals(input.AcsSignedContent)) + ) && + ( + this.AcsTransID == input.AcsTransID || + (this.AcsTransID != null && + this.AcsTransID.Equals(input.AcsTransID)) + ) && + ( + this.AcsURL == input.AcsURL || + (this.AcsURL != null && + this.AcsURL.Equals(input.AcsURL)) + ) && + ( + this.AuthenticationType == input.AuthenticationType || + (this.AuthenticationType != null && + this.AuthenticationType.Equals(input.AuthenticationType)) + ) && + ( + this.CardHolderInfo == input.CardHolderInfo || + (this.CardHolderInfo != null && + this.CardHolderInfo.Equals(input.CardHolderInfo)) + ) && + ( + this.CavvAlgorithm == input.CavvAlgorithm || + (this.CavvAlgorithm != null && + this.CavvAlgorithm.Equals(input.CavvAlgorithm)) + ) && + ( + this.ChallengeIndicator == input.ChallengeIndicator || + (this.ChallengeIndicator != null && + this.ChallengeIndicator.Equals(input.ChallengeIndicator)) + ) && + ( + this.DsReferenceNumber == input.DsReferenceNumber || + (this.DsReferenceNumber != null && + this.DsReferenceNumber.Equals(input.DsReferenceNumber)) + ) && + ( + this.DsTransID == input.DsTransID || + (this.DsTransID != null && + this.DsTransID.Equals(input.DsTransID)) + ) && + ( + this.ExemptionIndicator == input.ExemptionIndicator || + (this.ExemptionIndicator != null && + this.ExemptionIndicator.Equals(input.ExemptionIndicator)) + ) && + ( + this.MessageVersion == input.MessageVersion || + (this.MessageVersion != null && + this.MessageVersion.Equals(input.MessageVersion)) + ) && + ( + this.RiskScore == input.RiskScore || + (this.RiskScore != null && + this.RiskScore.Equals(input.RiskScore)) + ) && + ( + this.SdkEphemPubKey == input.SdkEphemPubKey || + (this.SdkEphemPubKey != null && + this.SdkEphemPubKey.Equals(input.SdkEphemPubKey)) + ) && + ( + this.ThreeDSServerTransID == input.ThreeDSServerTransID || + (this.ThreeDSServerTransID != null && + this.ThreeDSServerTransID.Equals(input.ThreeDSServerTransID)) + ) && + ( + this.TransStatus == input.TransStatus || + (this.TransStatus != null && + this.TransStatus.Equals(input.TransStatus)) + ) && + ( + this.TransStatusReason == input.TransStatusReason || + (this.TransStatusReason != null && + this.TransStatusReason.Equals(input.TransStatusReason)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ThreeDS2ResponseData threeDS2ResponseData, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, threeDS2ResponseData, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AcsChallengeMandated != null) + { + hashCode = (hashCode * 59) + this.AcsChallengeMandated.GetHashCode(); + } + if (this.AcsOperatorID != null) + { + hashCode = (hashCode * 59) + this.AcsOperatorID.GetHashCode(); + } + if (this.AcsReferenceNumber != null) + { + hashCode = (hashCode * 59) + this.AcsReferenceNumber.GetHashCode(); + } + if (this.AcsSignedContent != null) + { + hashCode = (hashCode * 59) + this.AcsSignedContent.GetHashCode(); + } + if (this.AcsTransID != null) + { + hashCode = (hashCode * 59) + this.AcsTransID.GetHashCode(); + } + if (this.AcsURL != null) + { + hashCode = (hashCode * 59) + this.AcsURL.GetHashCode(); + } + if (this.AuthenticationType != null) + { + hashCode = (hashCode * 59) + this.AuthenticationType.GetHashCode(); + } + if (this.CardHolderInfo != null) + { + hashCode = (hashCode * 59) + this.CardHolderInfo.GetHashCode(); + } + if (this.CavvAlgorithm != null) + { + hashCode = (hashCode * 59) + this.CavvAlgorithm.GetHashCode(); + } + if (this.ChallengeIndicator != null) + { + hashCode = (hashCode * 59) + this.ChallengeIndicator.GetHashCode(); + } + if (this.DsReferenceNumber != null) + { + hashCode = (hashCode * 59) + this.DsReferenceNumber.GetHashCode(); + } + if (this.DsTransID != null) + { + hashCode = (hashCode * 59) + this.DsTransID.GetHashCode(); + } + if (this.ExemptionIndicator != null) + { + hashCode = (hashCode * 59) + this.ExemptionIndicator.GetHashCode(); + } + if (this.MessageVersion != null) + { + hashCode = (hashCode * 59) + this.MessageVersion.GetHashCode(); + } + if (this.RiskScore != null) + { + hashCode = (hashCode * 59) + this.RiskScore.GetHashCode(); + } + if (this.SdkEphemPubKey != null) + { + hashCode = (hashCode * 59) + this.SdkEphemPubKey.GetHashCode(); + } + if (this.ThreeDSServerTransID != null) + { + hashCode = (hashCode * 59) + this.ThreeDSServerTransID.GetHashCode(); + } + if (this.TransStatus != null) + { + hashCode = (hashCode * 59) + this.TransStatus.GetHashCode(); + } + if (this.TransStatusReason != null) + { + hashCode = (hashCode * 59) + this.TransStatusReason.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ThreeDS2ResponseData threeDS2ResponseData, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (threeDS2ResponseData.AcsChallengeMandatedOption.IsSet && threeDS2ResponseData.AcsChallengeMandated == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.AcsChallengeMandated), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.AcsOperatorIDOption.IsSet && threeDS2ResponseData.AcsOperatorID == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.AcsOperatorID), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.AcsReferenceNumberOption.IsSet && threeDS2ResponseData.AcsReferenceNumber == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.AcsReferenceNumber), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.AcsSignedContentOption.IsSet && threeDS2ResponseData.AcsSignedContent == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.AcsSignedContent), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.AcsTransIDOption.IsSet && threeDS2ResponseData.AcsTransID == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.AcsTransID), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.AcsURLOption.IsSet && threeDS2ResponseData.AcsURL == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.AcsURL), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.AuthenticationTypeOption.IsSet && threeDS2ResponseData.AuthenticationType == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.AuthenticationType), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.CardHolderInfoOption.IsSet && threeDS2ResponseData.CardHolderInfo == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.CardHolderInfo), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.CavvAlgorithmOption.IsSet && threeDS2ResponseData.CavvAlgorithm == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.CavvAlgorithm), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.ChallengeIndicatorOption.IsSet && threeDS2ResponseData.ChallengeIndicator == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.ChallengeIndicator), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.DsReferenceNumberOption.IsSet && threeDS2ResponseData.DsReferenceNumber == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.DsReferenceNumber), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.DsTransIDOption.IsSet && threeDS2ResponseData.DsTransID == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.DsTransID), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.ExemptionIndicatorOption.IsSet && threeDS2ResponseData.ExemptionIndicator == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.ExemptionIndicator), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.MessageVersionOption.IsSet && threeDS2ResponseData.MessageVersion == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.MessageVersion), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.RiskScoreOption.IsSet && threeDS2ResponseData.RiskScore == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.RiskScore), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.SdkEphemPubKeyOption.IsSet && threeDS2ResponseData.SdkEphemPubKey == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.SdkEphemPubKey), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.ThreeDSServerTransIDOption.IsSet && threeDS2ResponseData.ThreeDSServerTransID == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.ThreeDSServerTransID), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.TransStatusOption.IsSet && threeDS2ResponseData.TransStatus == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.TransStatus), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.TransStatusReasonOption.IsSet && threeDS2ResponseData.TransStatusReason == null) - throw new ArgumentNullException(nameof(threeDS2ResponseData.TransStatusReason), "Property is required for class ThreeDS2ResponseData."); - - if (threeDS2ResponseData.AcsChallengeMandatedOption.IsSet) - writer.WriteString("acsChallengeMandated", threeDS2ResponseData.AcsChallengeMandated); - - if (threeDS2ResponseData.AcsOperatorIDOption.IsSet) - writer.WriteString("acsOperatorID", threeDS2ResponseData.AcsOperatorID); - - if (threeDS2ResponseData.AcsReferenceNumberOption.IsSet) - writer.WriteString("acsReferenceNumber", threeDS2ResponseData.AcsReferenceNumber); - - if (threeDS2ResponseData.AcsSignedContentOption.IsSet) - writer.WriteString("acsSignedContent", threeDS2ResponseData.AcsSignedContent); - - if (threeDS2ResponseData.AcsTransIDOption.IsSet) - writer.WriteString("acsTransID", threeDS2ResponseData.AcsTransID); - - if (threeDS2ResponseData.AcsURLOption.IsSet) - writer.WriteString("acsURL", threeDS2ResponseData.AcsURL); - - if (threeDS2ResponseData.AuthenticationTypeOption.IsSet) - writer.WriteString("authenticationType", threeDS2ResponseData.AuthenticationType); - - if (threeDS2ResponseData.CardHolderInfoOption.IsSet) - writer.WriteString("cardHolderInfo", threeDS2ResponseData.CardHolderInfo); - - if (threeDS2ResponseData.CavvAlgorithmOption.IsSet) - writer.WriteString("cavvAlgorithm", threeDS2ResponseData.CavvAlgorithm); - - if (threeDS2ResponseData.ChallengeIndicatorOption.IsSet) - writer.WriteString("challengeIndicator", threeDS2ResponseData.ChallengeIndicator); - - if (threeDS2ResponseData.DsReferenceNumberOption.IsSet) - writer.WriteString("dsReferenceNumber", threeDS2ResponseData.DsReferenceNumber); - - if (threeDS2ResponseData.DsTransIDOption.IsSet) - writer.WriteString("dsTransID", threeDS2ResponseData.DsTransID); - - if (threeDS2ResponseData.ExemptionIndicatorOption.IsSet) - writer.WriteString("exemptionIndicator", threeDS2ResponseData.ExemptionIndicator); - - if (threeDS2ResponseData.MessageVersionOption.IsSet) - writer.WriteString("messageVersion", threeDS2ResponseData.MessageVersion); - - if (threeDS2ResponseData.RiskScoreOption.IsSet) - writer.WriteString("riskScore", threeDS2ResponseData.RiskScore); - - if (threeDS2ResponseData.SdkEphemPubKeyOption.IsSet) - writer.WriteString("sdkEphemPubKey", threeDS2ResponseData.SdkEphemPubKey); - - if (threeDS2ResponseData.ThreeDSServerTransIDOption.IsSet) - writer.WriteString("threeDSServerTransID", threeDS2ResponseData.ThreeDSServerTransID); - - if (threeDS2ResponseData.TransStatusOption.IsSet) - writer.WriteString("transStatus", threeDS2ResponseData.TransStatus); - - if (threeDS2ResponseData.TransStatusReasonOption.IsSet) - writer.WriteString("transStatusReason", threeDS2ResponseData.TransStatusReason); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ThreeDS2Result.cs b/Adyen/Model/Checkout/ThreeDS2Result.cs index fd11b9518..1589c9f2e 100644 --- a/Adyen/Model/Checkout/ThreeDS2Result.cs +++ b/Adyen/Model/Checkout/ThreeDS2Result.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,609 +15,284 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ThreeDS2Result /// - public partial class ThreeDS2Result : IValidatableObject + [DataContract(Name = "ThreeDS2Result")] + public partial class ThreeDS2Result : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The `authenticationValue` value as defined in the 3D Secure 2 specification. - /// The algorithm used by the ACS to calculate the authentication value, only for Cartes Bancaires integrations. - /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). - /// The `dsTransID` value as defined in the 3D Secure 2 specification. - /// The `eci` value as defined in the 3D Secure 2 specification. - /// Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` - /// The `messageVersion` value as defined in the 3D Secure 2 specification. - /// Risk score calculated by Cartes Bancaires Directory Server (DS). - /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - /// The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. - /// The `timestamp` value of the 3D Secure 2 authentication. - /// The `transStatus` value as defined in the 3D Secure 2 specification. - /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). - /// The `whiteListStatus` value as defined in the 3D Secure 2 specification. - [JsonConstructor] - public ThreeDS2Result(Option authenticationValue = default, Option cavvAlgorithm = default, Option challengeCancel = default, Option dsTransID = default, Option eci = default, Option exemptionIndicator = default, Option messageVersion = default, Option riskScore = default, Option threeDSRequestorChallengeInd = default, Option threeDSServerTransID = default, Option timestamp = default, Option transStatus = default, Option transStatusReason = default, Option whiteListStatus = default) - { - AuthenticationValueOption = authenticationValue; - CavvAlgorithmOption = cavvAlgorithm; - ChallengeCancelOption = challengeCancel; - DsTransIDOption = dsTransID; - EciOption = eci; - ExemptionIndicatorOption = exemptionIndicator; - MessageVersionOption = messageVersion; - RiskScoreOption = riskScore; - ThreeDSRequestorChallengeIndOption = threeDSRequestorChallengeInd; - ThreeDSServerTransIDOption = threeDSServerTransID; - TimestampOption = timestamp; - TransStatusOption = transStatus; - TransStatusReasonOption = transStatusReason; - WhiteListStatusOption = whiteListStatus; - OnCreated(); - } - - partial void OnCreated(); - /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). + [JsonConverter(typeof(StringEnumConverter))] public enum ChallengeCancelEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// + [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// + [EnumMember(Value = "06")] _06 = 6, /// /// Enum _07 for value: 07 /// + [EnumMember(Value = "07")] _07 = 7 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ChallengeCancelEnum ChallengeCancelEnumFromString(string value) - { - if (value.Equals("01")) - return ChallengeCancelEnum._01; - - if (value.Equals("02")) - return ChallengeCancelEnum._02; - - if (value.Equals("03")) - return ChallengeCancelEnum._03; - - if (value.Equals("04")) - return ChallengeCancelEnum._04; - if (value.Equals("05")) - return ChallengeCancelEnum._05; - - if (value.Equals("06")) - return ChallengeCancelEnum._06; - - if (value.Equals("07")) - return ChallengeCancelEnum._07; - - throw new NotImplementedException($"Could not convert value to type ChallengeCancelEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static ChallengeCancelEnum? ChallengeCancelEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ChallengeCancelEnum._01; - - if (value.Equals("02")) - return ChallengeCancelEnum._02; - - if (value.Equals("03")) - return ChallengeCancelEnum._03; - - if (value.Equals("04")) - return ChallengeCancelEnum._04; - - if (value.Equals("05")) - return ChallengeCancelEnum._05; - - if (value.Equals("06")) - return ChallengeCancelEnum._06; - - if (value.Equals("07")) - return ChallengeCancelEnum._07; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChallengeCancelEnumToJsonValue(ChallengeCancelEnum? value) - { - if (value == ChallengeCancelEnum._01) - return "01"; - - if (value == ChallengeCancelEnum._02) - return "02"; - - if (value == ChallengeCancelEnum._03) - return "03"; - - if (value == ChallengeCancelEnum._04) - return "04"; - - if (value == ChallengeCancelEnum._05) - return "05"; - - if (value == ChallengeCancelEnum._06) - return "06"; - - if (value == ChallengeCancelEnum._07) - return "07"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ChallengeCancel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChallengeCancelOption { get; private set; } /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). - [JsonPropertyName("challengeCancel")] - public ChallengeCancelEnum? ChallengeCancel { get { return this.ChallengeCancelOption; } set { this.ChallengeCancelOption = new Option(value); } } - + [DataMember(Name = "challengeCancel", EmitDefaultValue = false)] + public ChallengeCancelEnum? ChallengeCancel { get; set; } /// /// Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` /// /// Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` + [JsonConverter(typeof(StringEnumConverter))] public enum ExemptionIndicatorEnum { /// /// Enum LowValue for value: lowValue /// + [EnumMember(Value = "lowValue")] LowValue = 1, /// /// Enum SecureCorporate for value: secureCorporate /// + [EnumMember(Value = "secureCorporate")] SecureCorporate = 2, /// /// Enum TrustedBeneficiary for value: trustedBeneficiary /// + [EnumMember(Value = "trustedBeneficiary")] TrustedBeneficiary = 3, /// /// Enum TransactionRiskAnalysis for value: transactionRiskAnalysis /// + [EnumMember(Value = "transactionRiskAnalysis")] TransactionRiskAnalysis = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ExemptionIndicatorEnum ExemptionIndicatorEnumFromString(string value) - { - if (value.Equals("lowValue")) - return ExemptionIndicatorEnum.LowValue; - if (value.Equals("secureCorporate")) - return ExemptionIndicatorEnum.SecureCorporate; - - if (value.Equals("trustedBeneficiary")) - return ExemptionIndicatorEnum.TrustedBeneficiary; - - if (value.Equals("transactionRiskAnalysis")) - return ExemptionIndicatorEnum.TransactionRiskAnalysis; - - throw new NotImplementedException($"Could not convert value to type ExemptionIndicatorEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static ExemptionIndicatorEnum? ExemptionIndicatorEnumFromStringOrDefault(string value) - { - if (value.Equals("lowValue")) - return ExemptionIndicatorEnum.LowValue; - - if (value.Equals("secureCorporate")) - return ExemptionIndicatorEnum.SecureCorporate; - - if (value.Equals("trustedBeneficiary")) - return ExemptionIndicatorEnum.TrustedBeneficiary; - - if (value.Equals("transactionRiskAnalysis")) - return ExemptionIndicatorEnum.TransactionRiskAnalysis; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ExemptionIndicatorEnumToJsonValue(ExemptionIndicatorEnum? value) - { - if (value == ExemptionIndicatorEnum.LowValue) - return "lowValue"; - - if (value == ExemptionIndicatorEnum.SecureCorporate) - return "secureCorporate"; - - if (value == ExemptionIndicatorEnum.TrustedBeneficiary) - return "trustedBeneficiary"; - - if (value == ExemptionIndicatorEnum.TransactionRiskAnalysis) - return "transactionRiskAnalysis"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ExemptionIndicator - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ExemptionIndicatorOption { get; private set; } /// /// Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` /// /// Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` - [JsonPropertyName("exemptionIndicator")] - public ExemptionIndicatorEnum? ExemptionIndicator { get { return this.ExemptionIndicatorOption; } set { this.ExemptionIndicatorOption = new Option(value); } } - + [DataMember(Name = "exemptionIndicator", EmitDefaultValue = false)] + public ExemptionIndicatorEnum? ExemptionIndicator { get; set; } /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only + [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSRequestorChallengeIndEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// + [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// + [EnumMember(Value = "06")] _06 = 6 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ThreeDSRequestorChallengeIndEnum ThreeDSRequestorChallengeIndEnumFromString(string value) - { - if (value.Equals("01")) - return ThreeDSRequestorChallengeIndEnum._01; - - if (value.Equals("02")) - return ThreeDSRequestorChallengeIndEnum._02; - - if (value.Equals("03")) - return ThreeDSRequestorChallengeIndEnum._03; - - if (value.Equals("04")) - return ThreeDSRequestorChallengeIndEnum._04; - - if (value.Equals("05")) - return ThreeDSRequestorChallengeIndEnum._05; - - if (value.Equals("06")) - return ThreeDSRequestorChallengeIndEnum._06; - - throw new NotImplementedException($"Could not convert value to type ThreeDSRequestorChallengeIndEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeIndEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ThreeDSRequestorChallengeIndEnum._01; - - if (value.Equals("02")) - return ThreeDSRequestorChallengeIndEnum._02; - - if (value.Equals("03")) - return ThreeDSRequestorChallengeIndEnum._03; - - if (value.Equals("04")) - return ThreeDSRequestorChallengeIndEnum._04; - - if (value.Equals("05")) - return ThreeDSRequestorChallengeIndEnum._05; - - if (value.Equals("06")) - return ThreeDSRequestorChallengeIndEnum._06; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ThreeDSRequestorChallengeIndEnumToJsonValue(ThreeDSRequestorChallengeIndEnum? value) - { - if (value == ThreeDSRequestorChallengeIndEnum._01) - return "01"; - - if (value == ThreeDSRequestorChallengeIndEnum._02) - return "02"; - - if (value == ThreeDSRequestorChallengeIndEnum._03) - return "03"; - - if (value == ThreeDSRequestorChallengeIndEnum._04) - return "04"; - - if (value == ThreeDSRequestorChallengeIndEnum._05) - return "05"; - - if (value == ThreeDSRequestorChallengeIndEnum._06) - return "06"; - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of ThreeDSRequestorChallengeInd - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSRequestorChallengeIndOption { get; private set; } /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only /// /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only - [JsonPropertyName("threeDSRequestorChallengeInd")] - public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get { return this.ThreeDSRequestorChallengeIndOption; } set { this.ThreeDSRequestorChallengeIndOption = new Option(value); } } - + [DataMember(Name = "threeDSRequestorChallengeInd", EmitDefaultValue = false)] + public ThreeDSRequestorChallengeIndEnum? ThreeDSRequestorChallengeInd { get; set; } /// - /// Used to track the state of AuthenticationValue + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthenticationValueOption { get; private set; } + /// The `authenticationValue` value as defined in the 3D Secure 2 specification.. + /// The algorithm used by the ACS to calculate the authentication value, only for Cartes Bancaires integrations.. + /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata).. + /// The `dsTransID` value as defined in the 3D Secure 2 specification.. + /// The `eci` value as defined in the 3D Secure 2 specification.. + /// Indicates the exemption type that was applied by the issuer to the authentication, if exemption applied. Allowed values: * `lowValue` * `secureCorporate` * `trustedBeneficiary` * `transactionRiskAnalysis` . + /// The `messageVersion` value as defined in the 3D Secure 2 specification.. + /// Risk score calculated by Cartes Bancaires Directory Server (DS).. + /// Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor preference) * **04** — Challenge requested (Mandate) * **05** — No challenge (transactional risk analysis is already performed) * **06** — Data Only. + /// The `threeDSServerTransID` value as defined in the 3D Secure 2 specification.. + /// The `timestamp` value of the 3D Secure 2 authentication.. + /// The `transStatus` value as defined in the 3D Secure 2 specification.. + /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values).. + /// The `whiteListStatus` value as defined in the 3D Secure 2 specification.. + public ThreeDS2Result(string authenticationValue = default(string), string cavvAlgorithm = default(string), ChallengeCancelEnum? challengeCancel = default(ChallengeCancelEnum?), string dsTransID = default(string), string eci = default(string), ExemptionIndicatorEnum? exemptionIndicator = default(ExemptionIndicatorEnum?), string messageVersion = default(string), string riskScore = default(string), ThreeDSRequestorChallengeIndEnum? threeDSRequestorChallengeInd = default(ThreeDSRequestorChallengeIndEnum?), string threeDSServerTransID = default(string), string timestamp = default(string), string transStatus = default(string), string transStatusReason = default(string), string whiteListStatus = default(string)) + { + this.AuthenticationValue = authenticationValue; + this.CavvAlgorithm = cavvAlgorithm; + this.ChallengeCancel = challengeCancel; + this.DsTransID = dsTransID; + this.Eci = eci; + this.ExemptionIndicator = exemptionIndicator; + this.MessageVersion = messageVersion; + this.RiskScore = riskScore; + this.ThreeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + this.ThreeDSServerTransID = threeDSServerTransID; + this.Timestamp = timestamp; + this.TransStatus = transStatus; + this.TransStatusReason = transStatusReason; + this.WhiteListStatus = whiteListStatus; + } /// /// The `authenticationValue` value as defined in the 3D Secure 2 specification. /// /// The `authenticationValue` value as defined in the 3D Secure 2 specification. - [JsonPropertyName("authenticationValue")] - public string AuthenticationValue { get { return this.AuthenticationValueOption; } set { this.AuthenticationValueOption = new Option(value); } } - - /// - /// Used to track the state of CavvAlgorithm - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CavvAlgorithmOption { get; private set; } + [DataMember(Name = "authenticationValue", EmitDefaultValue = false)] + public string AuthenticationValue { get; set; } /// /// The algorithm used by the ACS to calculate the authentication value, only for Cartes Bancaires integrations. /// /// The algorithm used by the ACS to calculate the authentication value, only for Cartes Bancaires integrations. - [JsonPropertyName("cavvAlgorithm")] - public string CavvAlgorithm { get { return this.CavvAlgorithmOption; } set { this.CavvAlgorithmOption = new Option(value); } } - - /// - /// Used to track the state of DsTransID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DsTransIDOption { get; private set; } + [DataMember(Name = "cavvAlgorithm", EmitDefaultValue = false)] + public string CavvAlgorithm { get; set; } /// /// The `dsTransID` value as defined in the 3D Secure 2 specification. /// /// The `dsTransID` value as defined in the 3D Secure 2 specification. - [JsonPropertyName("dsTransID")] - public string DsTransID { get { return this.DsTransIDOption; } set { this.DsTransIDOption = new Option(value); } } - - /// - /// Used to track the state of Eci - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EciOption { get; private set; } + [DataMember(Name = "dsTransID", EmitDefaultValue = false)] + public string DsTransID { get; set; } /// /// The `eci` value as defined in the 3D Secure 2 specification. /// /// The `eci` value as defined in the 3D Secure 2 specification. - [JsonPropertyName("eci")] - public string Eci { get { return this.EciOption; } set { this.EciOption = new Option(value); } } - - /// - /// Used to track the state of MessageVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option MessageVersionOption { get; private set; } + [DataMember(Name = "eci", EmitDefaultValue = false)] + public string Eci { get; set; } /// /// The `messageVersion` value as defined in the 3D Secure 2 specification. /// /// The `messageVersion` value as defined in the 3D Secure 2 specification. - [JsonPropertyName("messageVersion")] - public string MessageVersion { get { return this.MessageVersionOption; } set { this.MessageVersionOption = new Option(value); } } - - /// - /// Used to track the state of RiskScore - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskScoreOption { get; private set; } + [DataMember(Name = "messageVersion", EmitDefaultValue = false)] + public string MessageVersion { get; set; } /// /// Risk score calculated by Cartes Bancaires Directory Server (DS). /// /// Risk score calculated by Cartes Bancaires Directory Server (DS). - [JsonPropertyName("riskScore")] - public string RiskScore { get { return this.RiskScoreOption; } set { this.RiskScoreOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSServerTransID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSServerTransIDOption { get; private set; } + [DataMember(Name = "riskScore", EmitDefaultValue = false)] + public string RiskScore { get; set; } /// /// The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. /// /// The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. - [JsonPropertyName("threeDSServerTransID")] - public string ThreeDSServerTransID { get { return this.ThreeDSServerTransIDOption; } set { this.ThreeDSServerTransIDOption = new Option(value); } } - - /// - /// Used to track the state of Timestamp - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TimestampOption { get; private set; } + [DataMember(Name = "threeDSServerTransID", EmitDefaultValue = false)] + public string ThreeDSServerTransID { get; set; } /// /// The `timestamp` value of the 3D Secure 2 authentication. /// /// The `timestamp` value of the 3D Secure 2 authentication. - [JsonPropertyName("timestamp")] - public string Timestamp { get { return this.TimestampOption; } set { this.TimestampOption = new Option(value); } } - - /// - /// Used to track the state of TransStatus - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TransStatusOption { get; private set; } + [DataMember(Name = "timestamp", EmitDefaultValue = false)] + public string Timestamp { get; set; } /// /// The `transStatus` value as defined in the 3D Secure 2 specification. /// /// The `transStatus` value as defined in the 3D Secure 2 specification. - [JsonPropertyName("transStatus")] - public string TransStatus { get { return this.TransStatusOption; } set { this.TransStatusOption = new Option(value); } } - - /// - /// Used to track the state of TransStatusReason - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TransStatusReasonOption { get; private set; } + [DataMember(Name = "transStatus", EmitDefaultValue = false)] + public string TransStatus { get; set; } /// /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). /// /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). - [JsonPropertyName("transStatusReason")] - public string TransStatusReason { get { return this.TransStatusReasonOption; } set { this.TransStatusReasonOption = new Option(value); } } - - /// - /// Used to track the state of WhiteListStatus - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option WhiteListStatusOption { get; private set; } + [DataMember(Name = "transStatusReason", EmitDefaultValue = false)] + public string TransStatusReason { get; set; } /// /// The `whiteListStatus` value as defined in the 3D Secure 2 specification. /// /// The `whiteListStatus` value as defined in the 3D Secure 2 specification. - [JsonPropertyName("whiteListStatus")] - public string WhiteListStatus { get { return this.WhiteListStatusOption; } set { this.WhiteListStatusOption = new Option(value); } } + [DataMember(Name = "whiteListStatus", EmitDefaultValue = false)] + public string WhiteListStatus { get; set; } /// /// Returns the string presentation of the object @@ -645,262 +321,173 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ThreeDS2ResultJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ThreeDS2Result Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option authenticationValue = default; - Option cavvAlgorithm = default; - Option challengeCancel = default; - Option dsTransID = default; - Option eci = default; - Option exemptionIndicator = default; - Option messageVersion = default; - Option riskScore = default; - Option threeDSRequestorChallengeInd = default; - Option threeDSServerTransID = default; - Option timestamp = default; - Option transStatus = default; - Option transStatusReason = default; - Option whiteListStatus = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; + return this.Equals(input as ThreeDS2Result); + } - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "authenticationValue": - authenticationValue = new Option(utf8JsonReader.GetString()); - break; - case "cavvAlgorithm": - cavvAlgorithm = new Option(utf8JsonReader.GetString()); - break; - case "challengeCancel": - string challengeCancelRawValue = utf8JsonReader.GetString(); - if (challengeCancelRawValue != null) - challengeCancel = new Option(ThreeDS2Result.ChallengeCancelEnumFromStringOrDefault(challengeCancelRawValue)); - break; - case "dsTransID": - dsTransID = new Option(utf8JsonReader.GetString()); - break; - case "eci": - eci = new Option(utf8JsonReader.GetString()); - break; - case "exemptionIndicator": - string exemptionIndicatorRawValue = utf8JsonReader.GetString(); - if (exemptionIndicatorRawValue != null) - exemptionIndicator = new Option(ThreeDS2Result.ExemptionIndicatorEnumFromStringOrDefault(exemptionIndicatorRawValue)); - break; - case "messageVersion": - messageVersion = new Option(utf8JsonReader.GetString()); - break; - case "riskScore": - riskScore = new Option(utf8JsonReader.GetString()); - break; - case "threeDSRequestorChallengeInd": - string threeDSRequestorChallengeIndRawValue = utf8JsonReader.GetString(); - if (threeDSRequestorChallengeIndRawValue != null) - threeDSRequestorChallengeInd = new Option(ThreeDS2Result.ThreeDSRequestorChallengeIndEnumFromStringOrDefault(threeDSRequestorChallengeIndRawValue)); - break; - case "threeDSServerTransID": - threeDSServerTransID = new Option(utf8JsonReader.GetString()); - break; - case "timestamp": - timestamp = new Option(utf8JsonReader.GetString()); - break; - case "transStatus": - transStatus = new Option(utf8JsonReader.GetString()); - break; - case "transStatusReason": - transStatusReason = new Option(utf8JsonReader.GetString()); - break; - case "whiteListStatus": - whiteListStatus = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + /// + /// Returns true if ThreeDS2Result instances are equal + /// + /// Instance of ThreeDS2Result to be compared + /// Boolean + public bool Equals(ThreeDS2Result input) + { + if (input == null) + { + return false; } - - if (authenticationValue.IsSet && authenticationValue.Value == null) - throw new ArgumentNullException(nameof(authenticationValue), "Property is not nullable for class ThreeDS2Result."); - - if (cavvAlgorithm.IsSet && cavvAlgorithm.Value == null) - throw new ArgumentNullException(nameof(cavvAlgorithm), "Property is not nullable for class ThreeDS2Result."); - - if (challengeCancel.IsSet && challengeCancel.Value == null) - throw new ArgumentNullException(nameof(challengeCancel), "Property is not nullable for class ThreeDS2Result."); - - if (dsTransID.IsSet && dsTransID.Value == null) - throw new ArgumentNullException(nameof(dsTransID), "Property is not nullable for class ThreeDS2Result."); - - if (eci.IsSet && eci.Value == null) - throw new ArgumentNullException(nameof(eci), "Property is not nullable for class ThreeDS2Result."); - - if (exemptionIndicator.IsSet && exemptionIndicator.Value == null) - throw new ArgumentNullException(nameof(exemptionIndicator), "Property is not nullable for class ThreeDS2Result."); - - if (messageVersion.IsSet && messageVersion.Value == null) - throw new ArgumentNullException(nameof(messageVersion), "Property is not nullable for class ThreeDS2Result."); - - if (riskScore.IsSet && riskScore.Value == null) - throw new ArgumentNullException(nameof(riskScore), "Property is not nullable for class ThreeDS2Result."); - - if (threeDSRequestorChallengeInd.IsSet && threeDSRequestorChallengeInd.Value == null) - throw new ArgumentNullException(nameof(threeDSRequestorChallengeInd), "Property is not nullable for class ThreeDS2Result."); - - if (threeDSServerTransID.IsSet && threeDSServerTransID.Value == null) - throw new ArgumentNullException(nameof(threeDSServerTransID), "Property is not nullable for class ThreeDS2Result."); - - if (timestamp.IsSet && timestamp.Value == null) - throw new ArgumentNullException(nameof(timestamp), "Property is not nullable for class ThreeDS2Result."); - - if (transStatus.IsSet && transStatus.Value == null) - throw new ArgumentNullException(nameof(transStatus), "Property is not nullable for class ThreeDS2Result."); - - if (transStatusReason.IsSet && transStatusReason.Value == null) - throw new ArgumentNullException(nameof(transStatusReason), "Property is not nullable for class ThreeDS2Result."); - - if (whiteListStatus.IsSet && whiteListStatus.Value == null) - throw new ArgumentNullException(nameof(whiteListStatus), "Property is not nullable for class ThreeDS2Result."); - - return new ThreeDS2Result(authenticationValue, cavvAlgorithm, challengeCancel, dsTransID, eci, exemptionIndicator, messageVersion, riskScore, threeDSRequestorChallengeInd, threeDSServerTransID, timestamp, transStatus, transStatusReason, whiteListStatus); + return + ( + this.AuthenticationValue == input.AuthenticationValue || + (this.AuthenticationValue != null && + this.AuthenticationValue.Equals(input.AuthenticationValue)) + ) && + ( + this.CavvAlgorithm == input.CavvAlgorithm || + (this.CavvAlgorithm != null && + this.CavvAlgorithm.Equals(input.CavvAlgorithm)) + ) && + ( + this.ChallengeCancel == input.ChallengeCancel || + this.ChallengeCancel.Equals(input.ChallengeCancel) + ) && + ( + this.DsTransID == input.DsTransID || + (this.DsTransID != null && + this.DsTransID.Equals(input.DsTransID)) + ) && + ( + this.Eci == input.Eci || + (this.Eci != null && + this.Eci.Equals(input.Eci)) + ) && + ( + this.ExemptionIndicator == input.ExemptionIndicator || + this.ExemptionIndicator.Equals(input.ExemptionIndicator) + ) && + ( + this.MessageVersion == input.MessageVersion || + (this.MessageVersion != null && + this.MessageVersion.Equals(input.MessageVersion)) + ) && + ( + this.RiskScore == input.RiskScore || + (this.RiskScore != null && + this.RiskScore.Equals(input.RiskScore)) + ) && + ( + this.ThreeDSRequestorChallengeInd == input.ThreeDSRequestorChallengeInd || + this.ThreeDSRequestorChallengeInd.Equals(input.ThreeDSRequestorChallengeInd) + ) && + ( + this.ThreeDSServerTransID == input.ThreeDSServerTransID || + (this.ThreeDSServerTransID != null && + this.ThreeDSServerTransID.Equals(input.ThreeDSServerTransID)) + ) && + ( + this.Timestamp == input.Timestamp || + (this.Timestamp != null && + this.Timestamp.Equals(input.Timestamp)) + ) && + ( + this.TransStatus == input.TransStatus || + (this.TransStatus != null && + this.TransStatus.Equals(input.TransStatus)) + ) && + ( + this.TransStatusReason == input.TransStatusReason || + (this.TransStatusReason != null && + this.TransStatusReason.Equals(input.TransStatusReason)) + ) && + ( + this.WhiteListStatus == input.WhiteListStatus || + (this.WhiteListStatus != null && + this.WhiteListStatus.Equals(input.WhiteListStatus)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ThreeDS2Result threeDS2Result, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, threeDS2Result, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AuthenticationValue != null) + { + hashCode = (hashCode * 59) + this.AuthenticationValue.GetHashCode(); + } + if (this.CavvAlgorithm != null) + { + hashCode = (hashCode * 59) + this.CavvAlgorithm.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ChallengeCancel.GetHashCode(); + if (this.DsTransID != null) + { + hashCode = (hashCode * 59) + this.DsTransID.GetHashCode(); + } + if (this.Eci != null) + { + hashCode = (hashCode * 59) + this.Eci.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ExemptionIndicator.GetHashCode(); + if (this.MessageVersion != null) + { + hashCode = (hashCode * 59) + this.MessageVersion.GetHashCode(); + } + if (this.RiskScore != null) + { + hashCode = (hashCode * 59) + this.RiskScore.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ThreeDSRequestorChallengeInd.GetHashCode(); + if (this.ThreeDSServerTransID != null) + { + hashCode = (hashCode * 59) + this.ThreeDSServerTransID.GetHashCode(); + } + if (this.Timestamp != null) + { + hashCode = (hashCode * 59) + this.Timestamp.GetHashCode(); + } + if (this.TransStatus != null) + { + hashCode = (hashCode * 59) + this.TransStatus.GetHashCode(); + } + if (this.TransStatusReason != null) + { + hashCode = (hashCode * 59) + this.TransStatusReason.GetHashCode(); + } + if (this.WhiteListStatus != null) + { + hashCode = (hashCode * 59) + this.WhiteListStatus.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ThreeDS2Result threeDS2Result, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (threeDS2Result.AuthenticationValueOption.IsSet && threeDS2Result.AuthenticationValue == null) - throw new ArgumentNullException(nameof(threeDS2Result.AuthenticationValue), "Property is required for class ThreeDS2Result."); - - if (threeDS2Result.CavvAlgorithmOption.IsSet && threeDS2Result.CavvAlgorithm == null) - throw new ArgumentNullException(nameof(threeDS2Result.CavvAlgorithm), "Property is required for class ThreeDS2Result."); - - if (threeDS2Result.DsTransIDOption.IsSet && threeDS2Result.DsTransID == null) - throw new ArgumentNullException(nameof(threeDS2Result.DsTransID), "Property is required for class ThreeDS2Result."); - - if (threeDS2Result.EciOption.IsSet && threeDS2Result.Eci == null) - throw new ArgumentNullException(nameof(threeDS2Result.Eci), "Property is required for class ThreeDS2Result."); - - if (threeDS2Result.MessageVersionOption.IsSet && threeDS2Result.MessageVersion == null) - throw new ArgumentNullException(nameof(threeDS2Result.MessageVersion), "Property is required for class ThreeDS2Result."); - - if (threeDS2Result.RiskScoreOption.IsSet && threeDS2Result.RiskScore == null) - throw new ArgumentNullException(nameof(threeDS2Result.RiskScore), "Property is required for class ThreeDS2Result."); - - if (threeDS2Result.ThreeDSServerTransIDOption.IsSet && threeDS2Result.ThreeDSServerTransID == null) - throw new ArgumentNullException(nameof(threeDS2Result.ThreeDSServerTransID), "Property is required for class ThreeDS2Result."); - - if (threeDS2Result.TimestampOption.IsSet && threeDS2Result.Timestamp == null) - throw new ArgumentNullException(nameof(threeDS2Result.Timestamp), "Property is required for class ThreeDS2Result."); - - if (threeDS2Result.TransStatusOption.IsSet && threeDS2Result.TransStatus == null) - throw new ArgumentNullException(nameof(threeDS2Result.TransStatus), "Property is required for class ThreeDS2Result."); - - if (threeDS2Result.TransStatusReasonOption.IsSet && threeDS2Result.TransStatusReason == null) - throw new ArgumentNullException(nameof(threeDS2Result.TransStatusReason), "Property is required for class ThreeDS2Result."); - - if (threeDS2Result.WhiteListStatusOption.IsSet && threeDS2Result.WhiteListStatus == null) - throw new ArgumentNullException(nameof(threeDS2Result.WhiteListStatus), "Property is required for class ThreeDS2Result."); - - if (threeDS2Result.AuthenticationValueOption.IsSet) - writer.WriteString("authenticationValue", threeDS2Result.AuthenticationValue); - - if (threeDS2Result.CavvAlgorithmOption.IsSet) - writer.WriteString("cavvAlgorithm", threeDS2Result.CavvAlgorithm); - - var challengeCancelRawValue = ThreeDS2Result.ChallengeCancelEnumToJsonValue(threeDS2Result.ChallengeCancelOption.Value.Value); - writer.WriteString("challengeCancel", challengeCancelRawValue); - if (threeDS2Result.DsTransIDOption.IsSet) - writer.WriteString("dsTransID", threeDS2Result.DsTransID); - - if (threeDS2Result.EciOption.IsSet) - writer.WriteString("eci", threeDS2Result.Eci); - - var exemptionIndicatorRawValue = ThreeDS2Result.ExemptionIndicatorEnumToJsonValue(threeDS2Result.ExemptionIndicatorOption.Value.Value); - writer.WriteString("exemptionIndicator", exemptionIndicatorRawValue); - if (threeDS2Result.MessageVersionOption.IsSet) - writer.WriteString("messageVersion", threeDS2Result.MessageVersion); - - if (threeDS2Result.RiskScoreOption.IsSet) - writer.WriteString("riskScore", threeDS2Result.RiskScore); - - var threeDSRequestorChallengeIndRawValue = ThreeDS2Result.ThreeDSRequestorChallengeIndEnumToJsonValue(threeDS2Result.ThreeDSRequestorChallengeIndOption.Value.Value); - writer.WriteString("threeDSRequestorChallengeInd", threeDSRequestorChallengeIndRawValue); - if (threeDS2Result.ThreeDSServerTransIDOption.IsSet) - writer.WriteString("threeDSServerTransID", threeDS2Result.ThreeDSServerTransID); - - if (threeDS2Result.TimestampOption.IsSet) - writer.WriteString("timestamp", threeDS2Result.Timestamp); - - if (threeDS2Result.TransStatusOption.IsSet) - writer.WriteString("transStatus", threeDS2Result.TransStatus); - - if (threeDS2Result.TransStatusReasonOption.IsSet) - writer.WriteString("transStatusReason", threeDS2Result.TransStatusReason); - - if (threeDS2Result.WhiteListStatusOption.IsSet) - writer.WriteString("whiteListStatus", threeDS2Result.WhiteListStatus); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ThreeDSRequestData.cs b/Adyen/Model/Checkout/ThreeDSRequestData.cs index 13fc160c9..4b5d418bb 100644 --- a/Adyen/Model/Checkout/ThreeDSRequestData.cs +++ b/Adyen/Model/Checkout/ThreeDSRequestData.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,405 +15,168 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ThreeDSRequestData /// - public partial class ThreeDSRequestData : IValidatableObject + [DataContract(Name = "ThreeDSRequestData")] + public partial class ThreeDSRequestData : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen - /// Flag for data only flow. - /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Only use the redirect 3D Secure authentication flow. - /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** - [JsonConstructor] - public ThreeDSRequestData(Option challengeWindowSize = default, Option dataOnly = default, Option nativeThreeDS = default, Option threeDSVersion = default) - { - ChallengeWindowSizeOption = challengeWindowSize; - DataOnlyOption = dataOnly; - NativeThreeDSOption = nativeThreeDS; - ThreeDSVersionOption = threeDSVersion; - OnCreated(); - } - - partial void OnCreated(); - /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen + [JsonConverter(typeof(StringEnumConverter))] public enum ChallengeWindowSizeEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// + [EnumMember(Value = "05")] _05 = 5 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ChallengeWindowSizeEnum ChallengeWindowSizeEnumFromString(string value) - { - if (value.Equals("01")) - return ChallengeWindowSizeEnum._01; - - if (value.Equals("02")) - return ChallengeWindowSizeEnum._02; - - if (value.Equals("03")) - return ChallengeWindowSizeEnum._03; - - if (value.Equals("04")) - return ChallengeWindowSizeEnum._04; - - if (value.Equals("05")) - return ChallengeWindowSizeEnum._05; - - throw new NotImplementedException($"Could not convert value to type ChallengeWindowSizeEnum: '{value}'"); - } - /// - /// Returns a - /// - /// - /// - public static ChallengeWindowSizeEnum? ChallengeWindowSizeEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ChallengeWindowSizeEnum._01; - - if (value.Equals("02")) - return ChallengeWindowSizeEnum._02; - - if (value.Equals("03")) - return ChallengeWindowSizeEnum._03; - - if (value.Equals("04")) - return ChallengeWindowSizeEnum._04; - - if (value.Equals("05")) - return ChallengeWindowSizeEnum._05; - - return null; } - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChallengeWindowSizeEnumToJsonValue(ChallengeWindowSizeEnum? value) - { - if (value == ChallengeWindowSizeEnum._01) - return "01"; - - if (value == ChallengeWindowSizeEnum._02) - return "02"; - - if (value == ChallengeWindowSizeEnum._03) - return "03"; - - if (value == ChallengeWindowSizeEnum._04) - return "04"; - - if (value == ChallengeWindowSizeEnum._05) - return "05"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ChallengeWindowSize - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChallengeWindowSizeOption { get; private set; } /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen /// /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen - [JsonPropertyName("challengeWindowSize")] - public ChallengeWindowSizeEnum? ChallengeWindowSize { get { return this.ChallengeWindowSizeOption; } set { this.ChallengeWindowSizeOption = new Option(value); } } - + [DataMember(Name = "challengeWindowSize", EmitDefaultValue = false)] + public ChallengeWindowSizeEnum? ChallengeWindowSize { get; set; } /// - /// Flag for data only flow. + /// Required to trigger the [data-only flow](https://docs.adyen.com/online-payments/3d-secure/data-only/). When set to **true**, forces the 3D Secure 2 data-only flow for all transactions where it is possible. /// - /// Flag for data only flow. + /// Required to trigger the [data-only flow](https://docs.adyen.com/online-payments/3d-secure/data-only/). When set to **true**, forces the 3D Secure 2 data-only flow for all transactions where it is possible. + [JsonConverter(typeof(StringEnumConverter))] public enum DataOnlyEnum { /// /// Enum False for value: false /// + [EnumMember(Value = "false")] False = 1, /// /// Enum True for value: true /// + [EnumMember(Value = "true")] True = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static DataOnlyEnum DataOnlyEnumFromString(string value) - { - if (value.Equals("false")) - return DataOnlyEnum.False; - - if (value.Equals("true")) - return DataOnlyEnum.True; - throw new NotImplementedException($"Could not convert value to type DataOnlyEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static DataOnlyEnum? DataOnlyEnumFromStringOrDefault(string value) - { - if (value.Equals("false")) - return DataOnlyEnum.False; - - if (value.Equals("true")) - return DataOnlyEnum.True; - - return null; - } /// - /// Converts the to the json value + /// Required to trigger the [data-only flow](https://docs.adyen.com/online-payments/3d-secure/data-only/). When set to **true**, forces the 3D Secure 2 data-only flow for all transactions where it is possible. /// - /// - /// - /// - public static string DataOnlyEnumToJsonValue(DataOnlyEnum? value) - { - if (value == DataOnlyEnum.False) - return "false"; - - if (value == DataOnlyEnum.True) - return "true"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of DataOnly - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DataOnlyOption { get; private set; } - + /// Required to trigger the [data-only flow](https://docs.adyen.com/online-payments/3d-secure/data-only/). When set to **true**, forces the 3D Secure 2 data-only flow for all transactions where it is possible. + [DataMember(Name = "dataOnly", EmitDefaultValue = false)] + public DataOnlyEnum? DataOnly { get; set; } /// - /// Flag for data only flow. + /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be triggered when available. Adyen can still select to fallback to the redirect flow to optimize authorization rates and improve the shopper's experience. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Use the redirect 3D Secure authentication flow. /// - /// Flag for data only flow. - [JsonPropertyName("dataOnly")] - public DataOnlyEnum? DataOnly { get { return this.DataOnlyOption; } set { this.DataOnlyOption = new Option(value); } } - - /// - /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Only use the redirect 3D Secure authentication flow. - /// - /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Only use the redirect 3D Secure authentication flow. + /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be triggered when available. Adyen can still select to fallback to the redirect flow to optimize authorization rates and improve the shopper's experience. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Use the redirect 3D Secure authentication flow. + [JsonConverter(typeof(StringEnumConverter))] public enum NativeThreeDSEnum { /// /// Enum Preferred for value: preferred /// + [EnumMember(Value = "preferred")] Preferred = 1, /// /// Enum Disabled for value: disabled /// + [EnumMember(Value = "disabled")] Disabled = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static NativeThreeDSEnum NativeThreeDSEnumFromString(string value) - { - if (value.Equals("preferred")) - return NativeThreeDSEnum.Preferred; - - if (value.Equals("disabled")) - return NativeThreeDSEnum.Disabled; - - throw new NotImplementedException($"Could not convert value to type NativeThreeDSEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static NativeThreeDSEnum? NativeThreeDSEnumFromStringOrDefault(string value) - { - if (value.Equals("preferred")) - return NativeThreeDSEnum.Preferred; - - if (value.Equals("disabled")) - return NativeThreeDSEnum.Disabled; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string NativeThreeDSEnumToJsonValue(NativeThreeDSEnum? value) - { - if (value == NativeThreeDSEnum.Preferred) - return "preferred"; - - if (value == NativeThreeDSEnum.Disabled) - return "disabled"; - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of NativeThreeDS - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NativeThreeDSOption { get; private set; } /// - /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Only use the redirect 3D Secure authentication flow. + /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be triggered when available. Adyen can still select to fallback to the redirect flow to optimize authorization rates and improve the shopper's experience. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Use the redirect 3D Secure authentication flow. /// - /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be used when available. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Only use the redirect 3D Secure authentication flow. - [JsonPropertyName("nativeThreeDS")] - public NativeThreeDSEnum? NativeThreeDS { get { return this.NativeThreeDSOption; } set { this.NativeThreeDSOption = new Option(value); } } - + /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be triggered when available. Adyen can still select to fallback to the redirect flow to optimize authorization rates and improve the shopper's experience. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Use the redirect 3D Secure authentication flow. + [DataMember(Name = "nativeThreeDS", EmitDefaultValue = false)] + public NativeThreeDSEnum? NativeThreeDS { get; set; } /// /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** /// /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** + [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSVersionEnum { /// - /// Enum _210 for value: 2.1.0 + /// Enum _10 for value: 2.1.0 /// - _210 = 1, + [EnumMember(Value = "2.1.0")] + _10 = 1, /// - /// Enum _220 for value: 2.2.0 + /// Enum _20 for value: 2.2.0 /// - _220 = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ThreeDSVersionEnum ThreeDSVersionEnumFromString(string value) - { - if (value.Equals("2.1.0")) - return ThreeDSVersionEnum._210; - - if (value.Equals("2.2.0")) - return ThreeDSVersionEnum._220; + [EnumMember(Value = "2.2.0")] + _20 = 2 - throw new NotImplementedException($"Could not convert value to type ThreeDSVersionEnum: '{value}'"); } + /// - /// Returns a + /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** /// - /// - /// - public static ThreeDSVersionEnum? ThreeDSVersionEnumFromStringOrDefault(string value) - { - if (value.Equals("2.1.0")) - return ThreeDSVersionEnum._210; - - if (value.Equals("2.2.0")) - return ThreeDSVersionEnum._220; - - return null; - } - + /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** + [DataMember(Name = "threeDSVersion", EmitDefaultValue = false)] + public ThreeDSVersionEnum? ThreeDSVersion { get; set; } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string ThreeDSVersionEnumToJsonValue(ThreeDSVersionEnum? value) + /// Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size of 600x400 * **05** - Fullscreen. + /// Required to trigger the [data-only flow](https://docs.adyen.com/online-payments/3d-secure/data-only/). When set to **true**, forces the 3D Secure 2 data-only flow for all transactions where it is possible. . + /// Indicates if [native 3D Secure authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be triggered when available. Adyen can still select to fallback to the redirect flow to optimize authorization rates and improve the shopper's experience. Possible values: * **preferred**: Use native 3D Secure authentication when available. * **disabled**: Use the redirect 3D Secure authentication flow.. + /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0**. + public ThreeDSRequestData(ChallengeWindowSizeEnum? challengeWindowSize = default(ChallengeWindowSizeEnum?), DataOnlyEnum? dataOnly = default(DataOnlyEnum?), NativeThreeDSEnum? nativeThreeDS = default(NativeThreeDSEnum?), ThreeDSVersionEnum? threeDSVersion = default(ThreeDSVersionEnum?)) { - if (value == ThreeDSVersionEnum._210) - return "2.1.0"; - - if (value == ThreeDSVersionEnum._220) - return "2.2.0"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.ChallengeWindowSize = challengeWindowSize; + this.DataOnly = dataOnly; + this.NativeThreeDS = nativeThreeDS; + this.ThreeDSVersion = threeDSVersion; } - /// - /// Used to track the state of ThreeDSVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSVersionOption { get; private set; } - - /// - /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** - /// - /// The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** - [JsonPropertyName("threeDSVersion")] - public ThreeDSVersionEnum? ThreeDSVersion { get { return this.ThreeDSVersionOption; } set { this.ThreeDSVersionOption = new Option(value); } } - /// /// Returns the string presentation of the object /// @@ -430,131 +194,79 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ThreeDSRequestDataJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ThreeDSRequestData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option challengeWindowSize = default; - Option dataOnly = default; - Option nativeThreeDS = default; - Option threeDSVersion = default; + return this.Equals(input as ThreeDSRequestData); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ThreeDSRequestData instances are equal + /// + /// Instance of ThreeDSRequestData to be compared + /// Boolean + public bool Equals(ThreeDSRequestData input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "challengeWindowSize": - string challengeWindowSizeRawValue = utf8JsonReader.GetString(); - if (challengeWindowSizeRawValue != null) - challengeWindowSize = new Option(ThreeDSRequestData.ChallengeWindowSizeEnumFromStringOrDefault(challengeWindowSizeRawValue)); - break; - case "dataOnly": - string dataOnlyRawValue = utf8JsonReader.GetString(); - if (dataOnlyRawValue != null) - dataOnly = new Option(ThreeDSRequestData.DataOnlyEnumFromStringOrDefault(dataOnlyRawValue)); - break; - case "nativeThreeDS": - string nativeThreeDSRawValue = utf8JsonReader.GetString(); - if (nativeThreeDSRawValue != null) - nativeThreeDS = new Option(ThreeDSRequestData.NativeThreeDSEnumFromStringOrDefault(nativeThreeDSRawValue)); - break; - case "threeDSVersion": - string threeDSVersionRawValue = utf8JsonReader.GetString(); - if (threeDSVersionRawValue != null) - threeDSVersion = new Option(ThreeDSRequestData.ThreeDSVersionEnumFromStringOrDefault(threeDSVersionRawValue)); - break; - default: - break; - } - } + return false; } - - if (challengeWindowSize.IsSet && challengeWindowSize.Value == null) - throw new ArgumentNullException(nameof(challengeWindowSize), "Property is not nullable for class ThreeDSRequestData."); - - if (dataOnly.IsSet && dataOnly.Value == null) - throw new ArgumentNullException(nameof(dataOnly), "Property is not nullable for class ThreeDSRequestData."); - - if (nativeThreeDS.IsSet && nativeThreeDS.Value == null) - throw new ArgumentNullException(nameof(nativeThreeDS), "Property is not nullable for class ThreeDSRequestData."); - - if (threeDSVersion.IsSet && threeDSVersion.Value == null) - throw new ArgumentNullException(nameof(threeDSVersion), "Property is not nullable for class ThreeDSRequestData."); - - return new ThreeDSRequestData(challengeWindowSize, dataOnly, nativeThreeDS, threeDSVersion); + return + ( + this.ChallengeWindowSize == input.ChallengeWindowSize || + this.ChallengeWindowSize.Equals(input.ChallengeWindowSize) + ) && + ( + this.DataOnly == input.DataOnly || + this.DataOnly.Equals(input.DataOnly) + ) && + ( + this.NativeThreeDS == input.NativeThreeDS || + this.NativeThreeDS.Equals(input.NativeThreeDS) + ) && + ( + this.ThreeDSVersion == input.ThreeDSVersion || + this.ThreeDSVersion.Equals(input.ThreeDSVersion) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ThreeDSRequestData threeDSRequestData, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, threeDSRequestData, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.ChallengeWindowSize.GetHashCode(); + hashCode = (hashCode * 59) + this.DataOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.NativeThreeDS.GetHashCode(); + hashCode = (hashCode * 59) + this.ThreeDSVersion.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ThreeDSRequestData threeDSRequestData, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - var challengeWindowSizeRawValue = ThreeDSRequestData.ChallengeWindowSizeEnumToJsonValue(threeDSRequestData.ChallengeWindowSizeOption.Value.Value); - writer.WriteString("challengeWindowSize", challengeWindowSizeRawValue); - var dataOnlyRawValue = ThreeDSRequestData.DataOnlyEnumToJsonValue(threeDSRequestData.DataOnlyOption.Value.Value); - writer.WriteString("dataOnly", dataOnlyRawValue); - var nativeThreeDSRawValue = ThreeDSRequestData.NativeThreeDSEnumToJsonValue(threeDSRequestData.NativeThreeDSOption.Value.Value); - writer.WriteString("nativeThreeDS", nativeThreeDSRawValue); - var threeDSVersionRawValue = ThreeDSRequestData.ThreeDSVersionEnumToJsonValue(threeDSRequestData.ThreeDSVersionOption.Value.Value); - writer.WriteString("threeDSVersion", threeDSVersionRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs b/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs index 000286420..a4574f947 100644 --- a/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs +++ b/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,201 +15,101 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ThreeDSRequestorAuthenticationInfo /// - public partial class ThreeDSRequestorAuthenticationInfo : IValidatableObject + [DataContract(Name = "ThreeDSRequestorAuthenticationInfo")] + public partial class ThreeDSRequestorAuthenticationInfo : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. - /// Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator. - /// Date and time in UTC of the cardholder authentication. Format: YYYYMMDDHHMM - [JsonConstructor] - public ThreeDSRequestorAuthenticationInfo(Option threeDSReqAuthData = default, Option threeDSReqAuthMethod = default, Option threeDSReqAuthTimestamp = default) - { - ThreeDSReqAuthDataOption = threeDSReqAuthData; - ThreeDSReqAuthMethodOption = threeDSReqAuthMethod; - ThreeDSReqAuthTimestampOption = threeDSReqAuthTimestamp; - OnCreated(); - } - - partial void OnCreated(); - /// /// Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator. /// /// Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator. + [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSReqAuthMethodEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// + [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// + [EnumMember(Value = "06")] _06 = 6 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ThreeDSReqAuthMethodEnum ThreeDSReqAuthMethodEnumFromString(string value) - { - if (value.Equals("01")) - return ThreeDSReqAuthMethodEnum._01; - - if (value.Equals("02")) - return ThreeDSReqAuthMethodEnum._02; - - if (value.Equals("03")) - return ThreeDSReqAuthMethodEnum._03; - - if (value.Equals("04")) - return ThreeDSReqAuthMethodEnum._04; - - if (value.Equals("05")) - return ThreeDSReqAuthMethodEnum._05; - - if (value.Equals("06")) - return ThreeDSReqAuthMethodEnum._06; - - throw new NotImplementedException($"Could not convert value to type ThreeDSReqAuthMethodEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static ThreeDSReqAuthMethodEnum? ThreeDSReqAuthMethodEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ThreeDSReqAuthMethodEnum._01; - - if (value.Equals("02")) - return ThreeDSReqAuthMethodEnum._02; - - if (value.Equals("03")) - return ThreeDSReqAuthMethodEnum._03; - - if (value.Equals("04")) - return ThreeDSReqAuthMethodEnum._04; - if (value.Equals("05")) - return ThreeDSReqAuthMethodEnum._05; - - if (value.Equals("06")) - return ThreeDSReqAuthMethodEnum._06; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ThreeDSReqAuthMethodEnumToJsonValue(ThreeDSReqAuthMethodEnum? value) - { - if (value == ThreeDSReqAuthMethodEnum._01) - return "01"; - - if (value == ThreeDSReqAuthMethodEnum._02) - return "02"; - - if (value == ThreeDSReqAuthMethodEnum._03) - return "03"; - - if (value == ThreeDSReqAuthMethodEnum._04) - return "04"; - - if (value == ThreeDSReqAuthMethodEnum._05) - return "05"; - - if (value == ThreeDSReqAuthMethodEnum._06) - return "06"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of ThreeDSReqAuthMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSReqAuthMethodOption { get; private set; } /// /// Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator. /// /// Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator. - [JsonPropertyName("threeDSReqAuthMethod")] - public ThreeDSReqAuthMethodEnum? ThreeDSReqAuthMethod { get { return this.ThreeDSReqAuthMethodOption; } set { this.ThreeDSReqAuthMethodOption = new Option(value); } } - + [DataMember(Name = "threeDSReqAuthMethod", EmitDefaultValue = false)] + public ThreeDSReqAuthMethodEnum? ThreeDSReqAuthMethod { get; set; } /// - /// Used to track the state of ThreeDSReqAuthData + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSReqAuthDataOption { get; private set; } + /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes.. + /// Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * **02** — Login to the cardholder account at the 3DS Requestor system using 3DS Requestor’s own credentials. * **03** — Login to the cardholder account at the 3DS Requestor system using federated ID. * **04** — Login to the cardholder account at the 3DS Requestor system using issuer credentials. * **05** — Login to the cardholder account at the 3DS Requestor system using third-party authentication. * **06** — Login to the cardholder account at the 3DS Requestor system using FIDO Authenticator.. + /// Date and time in UTC of the cardholder authentication. Format: YYYYMMDDHHMM. + public ThreeDSRequestorAuthenticationInfo(string threeDSReqAuthData = default(string), ThreeDSReqAuthMethodEnum? threeDSReqAuthMethod = default(ThreeDSReqAuthMethodEnum?), string threeDSReqAuthTimestamp = default(string)) + { + this.ThreeDSReqAuthData = threeDSReqAuthData; + this.ThreeDSReqAuthMethod = threeDSReqAuthMethod; + this.ThreeDSReqAuthTimestamp = threeDSReqAuthTimestamp; + } /// /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. /// /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. - [JsonPropertyName("threeDSReqAuthData")] - public string ThreeDSReqAuthData { get { return this.ThreeDSReqAuthDataOption; } set { this.ThreeDSReqAuthDataOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSReqAuthTimestamp - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSReqAuthTimestampOption { get; private set; } + [DataMember(Name = "threeDSReqAuthData", EmitDefaultValue = false)] + public string ThreeDSReqAuthData { get; set; } /// /// Date and time in UTC of the cardholder authentication. Format: YYYYMMDDHHMM /// /// Date and time in UTC of the cardholder authentication. Format: YYYYMMDDHHMM - [JsonPropertyName("threeDSReqAuthTimestamp")] - public string ThreeDSReqAuthTimestamp { get { return this.ThreeDSReqAuthTimestampOption; } set { this.ThreeDSReqAuthTimestampOption = new Option(value); } } + [DataMember(Name = "threeDSReqAuthTimestamp", EmitDefaultValue = false)] + public string ThreeDSReqAuthTimestamp { get; set; } /// /// Returns the string presentation of the object @@ -226,135 +127,94 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // ThreeDSReqAuthTimestamp (string) maxLength - if (this.ThreeDSReqAuthTimestamp != null && this.ThreeDSReqAuthTimestamp.Length > 12) - { - yield return new ValidationResult("Invalid value for ThreeDSReqAuthTimestamp, length must be less than 12.", new [] { "ThreeDSReqAuthTimestamp" }); - } - - // ThreeDSReqAuthTimestamp (string) minLength - if (this.ThreeDSReqAuthTimestamp != null && this.ThreeDSReqAuthTimestamp.Length < 12) - { - yield return new ValidationResult("Invalid value for ThreeDSReqAuthTimestamp, length must be greater than 12.", new [] { "ThreeDSReqAuthTimestamp" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ThreeDSRequestorAuthenticationInfoJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ThreeDSRequestorAuthenticationInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option threeDSReqAuthData = default; - Option threeDSReqAuthMethod = default; - Option threeDSReqAuthTimestamp = default; + return this.Equals(input as ThreeDSRequestorAuthenticationInfo); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ThreeDSRequestorAuthenticationInfo instances are equal + /// + /// Instance of ThreeDSRequestorAuthenticationInfo to be compared + /// Boolean + public bool Equals(ThreeDSRequestorAuthenticationInfo input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "threeDSReqAuthData": - threeDSReqAuthData = new Option(utf8JsonReader.GetString()); - break; - case "threeDSReqAuthMethod": - string threeDSReqAuthMethodRawValue = utf8JsonReader.GetString(); - if (threeDSReqAuthMethodRawValue != null) - threeDSReqAuthMethod = new Option(ThreeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodEnumFromStringOrDefault(threeDSReqAuthMethodRawValue)); - break; - case "threeDSReqAuthTimestamp": - threeDSReqAuthTimestamp = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (threeDSReqAuthData.IsSet && threeDSReqAuthData.Value == null) - throw new ArgumentNullException(nameof(threeDSReqAuthData), "Property is not nullable for class ThreeDSRequestorAuthenticationInfo."); - - if (threeDSReqAuthMethod.IsSet && threeDSReqAuthMethod.Value == null) - throw new ArgumentNullException(nameof(threeDSReqAuthMethod), "Property is not nullable for class ThreeDSRequestorAuthenticationInfo."); - - if (threeDSReqAuthTimestamp.IsSet && threeDSReqAuthTimestamp.Value == null) - throw new ArgumentNullException(nameof(threeDSReqAuthTimestamp), "Property is not nullable for class ThreeDSRequestorAuthenticationInfo."); - - return new ThreeDSRequestorAuthenticationInfo(threeDSReqAuthData, threeDSReqAuthMethod, threeDSReqAuthTimestamp); + return + ( + this.ThreeDSReqAuthData == input.ThreeDSReqAuthData || + (this.ThreeDSReqAuthData != null && + this.ThreeDSReqAuthData.Equals(input.ThreeDSReqAuthData)) + ) && + ( + this.ThreeDSReqAuthMethod == input.ThreeDSReqAuthMethod || + this.ThreeDSReqAuthMethod.Equals(input.ThreeDSReqAuthMethod) + ) && + ( + this.ThreeDSReqAuthTimestamp == input.ThreeDSReqAuthTimestamp || + (this.ThreeDSReqAuthTimestamp != null && + this.ThreeDSReqAuthTimestamp.Equals(input.ThreeDSReqAuthTimestamp)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, threeDSRequestorAuthenticationInfo, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ThreeDSReqAuthData != null) + { + hashCode = (hashCode * 59) + this.ThreeDSReqAuthData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ThreeDSReqAuthMethod.GetHashCode(); + if (this.ThreeDSReqAuthTimestamp != null) + { + hashCode = (hashCode * 59) + this.ThreeDSReqAuthTimestamp.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (threeDSRequestorAuthenticationInfo.ThreeDSReqAuthDataOption.IsSet && threeDSRequestorAuthenticationInfo.ThreeDSReqAuthData == null) - throw new ArgumentNullException(nameof(threeDSRequestorAuthenticationInfo.ThreeDSReqAuthData), "Property is required for class ThreeDSRequestorAuthenticationInfo."); - - if (threeDSRequestorAuthenticationInfo.ThreeDSReqAuthTimestampOption.IsSet && threeDSRequestorAuthenticationInfo.ThreeDSReqAuthTimestamp == null) - throw new ArgumentNullException(nameof(threeDSRequestorAuthenticationInfo.ThreeDSReqAuthTimestamp), "Property is required for class ThreeDSRequestorAuthenticationInfo."); + // ThreeDSReqAuthTimestamp (string) maxLength + if (this.ThreeDSReqAuthTimestamp != null && this.ThreeDSReqAuthTimestamp.Length > 12) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSReqAuthTimestamp, length must be less than 12.", new [] { "ThreeDSReqAuthTimestamp" }); + } - if (threeDSRequestorAuthenticationInfo.ThreeDSReqAuthDataOption.IsSet) - writer.WriteString("threeDSReqAuthData", threeDSRequestorAuthenticationInfo.ThreeDSReqAuthData); + // ThreeDSReqAuthTimestamp (string) minLength + if (this.ThreeDSReqAuthTimestamp != null && this.ThreeDSReqAuthTimestamp.Length < 12) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSReqAuthTimestamp, length must be greater than 12.", new [] { "ThreeDSReqAuthTimestamp" }); + } - var threeDSReqAuthMethodRawValue = ThreeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodEnumToJsonValue(threeDSRequestorAuthenticationInfo.ThreeDSReqAuthMethodOption.Value.Value); - writer.WriteString("threeDSReqAuthMethod", threeDSReqAuthMethodRawValue); - if (threeDSRequestorAuthenticationInfo.ThreeDSReqAuthTimestampOption.IsSet) - writer.WriteString("threeDSReqAuthTimestamp", threeDSRequestorAuthenticationInfo.ThreeDSReqAuthTimestamp); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs b/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs index abb3d6035..25f873932 100644 --- a/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs +++ b/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,189 +15,98 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ThreeDSRequestorPriorAuthenticationInfo /// - public partial class ThreeDSRequestorPriorAuthenticationInfo : IValidatableObject + [DataContract(Name = "ThreeDSRequestorPriorAuthenticationInfo")] + public partial class ThreeDSRequestorPriorAuthenticationInfo : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. - /// Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods. - /// Date and time in UTC of the prior cardholder authentication. Format: YYYYMMDDHHMM - /// This data element provides additional information to the ACS to determine the best approach for handing a request. This data element contains an ACS Transaction ID for a prior authenticated transaction. For example, the first recurring transaction that was authenticated with the cardholder. Length: 30 characters. - [JsonConstructor] - public ThreeDSRequestorPriorAuthenticationInfo(Option threeDSReqPriorAuthData = default, Option threeDSReqPriorAuthMethod = default, Option threeDSReqPriorAuthTimestamp = default, Option threeDSReqPriorRef = default) - { - ThreeDSReqPriorAuthDataOption = threeDSReqPriorAuthData; - ThreeDSReqPriorAuthMethodOption = threeDSReqPriorAuthMethod; - ThreeDSReqPriorAuthTimestampOption = threeDSReqPriorAuthTimestamp; - ThreeDSReqPriorRefOption = threeDSReqPriorRef; - OnCreated(); - } - - partial void OnCreated(); - /// /// Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods. /// /// Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods. + [JsonConverter(typeof(StringEnumConverter))] public enum ThreeDSReqPriorAuthMethodEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ThreeDSReqPriorAuthMethodEnum ThreeDSReqPriorAuthMethodEnumFromString(string value) - { - if (value.Equals("01")) - return ThreeDSReqPriorAuthMethodEnum._01; - - if (value.Equals("02")) - return ThreeDSReqPriorAuthMethodEnum._02; - - if (value.Equals("03")) - return ThreeDSReqPriorAuthMethodEnum._03; - - if (value.Equals("04")) - return ThreeDSReqPriorAuthMethodEnum._04; - throw new NotImplementedException($"Could not convert value to type ThreeDSReqPriorAuthMethodEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static ThreeDSReqPriorAuthMethodEnum? ThreeDSReqPriorAuthMethodEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ThreeDSReqPriorAuthMethodEnum._01; - - if (value.Equals("02")) - return ThreeDSReqPriorAuthMethodEnum._02; - - if (value.Equals("03")) - return ThreeDSReqPriorAuthMethodEnum._03; - - if (value.Equals("04")) - return ThreeDSReqPriorAuthMethodEnum._04; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ThreeDSReqPriorAuthMethodEnumToJsonValue(ThreeDSReqPriorAuthMethodEnum? value) - { - if (value == ThreeDSReqPriorAuthMethodEnum._01) - return "01"; - - if (value == ThreeDSReqPriorAuthMethodEnum._02) - return "02"; - - if (value == ThreeDSReqPriorAuthMethodEnum._03) - return "03"; - - if (value == ThreeDSReqPriorAuthMethodEnum._04) - return "04"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ThreeDSReqPriorAuthMethod - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSReqPriorAuthMethodOption { get; private set; } /// /// Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods. /// /// Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods. - [JsonPropertyName("threeDSReqPriorAuthMethod")] - public ThreeDSReqPriorAuthMethodEnum? ThreeDSReqPriorAuthMethod { get { return this.ThreeDSReqPriorAuthMethodOption; } set { this.ThreeDSReqPriorAuthMethodOption = new Option(value); } } - + [DataMember(Name = "threeDSReqPriorAuthMethod", EmitDefaultValue = false)] + public ThreeDSReqPriorAuthMethodEnum? ThreeDSReqPriorAuthMethod { get; set; } /// - /// Used to track the state of ThreeDSReqPriorAuthData + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSReqPriorAuthDataOption { get; private set; } + /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes.. + /// Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge occurred by ACS. * **03** — AVS verified. * **04** — Other issuer methods.. + /// Date and time in UTC of the prior cardholder authentication. Format: YYYYMMDDHHMM. + /// This data element provides additional information to the ACS to determine the best approach for handing a request. This data element contains an ACS Transaction ID for a prior authenticated transaction. For example, the first recurring transaction that was authenticated with the cardholder. Length: 30 characters.. + public ThreeDSRequestorPriorAuthenticationInfo(string threeDSReqPriorAuthData = default(string), ThreeDSReqPriorAuthMethodEnum? threeDSReqPriorAuthMethod = default(ThreeDSReqPriorAuthMethodEnum?), string threeDSReqPriorAuthTimestamp = default(string), string threeDSReqPriorRef = default(string)) + { + this.ThreeDSReqPriorAuthData = threeDSReqPriorAuthData; + this.ThreeDSReqPriorAuthMethod = threeDSReqPriorAuthMethod; + this.ThreeDSReqPriorAuthTimestamp = threeDSReqPriorAuthTimestamp; + this.ThreeDSReqPriorRef = threeDSReqPriorRef; + } /// /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. /// /// Data that documents and supports a specific authentication process. Maximum length: 2048 bytes. - [JsonPropertyName("threeDSReqPriorAuthData")] - public string ThreeDSReqPriorAuthData { get { return this.ThreeDSReqPriorAuthDataOption; } set { this.ThreeDSReqPriorAuthDataOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSReqPriorAuthTimestamp - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSReqPriorAuthTimestampOption { get; private set; } + [DataMember(Name = "threeDSReqPriorAuthData", EmitDefaultValue = false)] + public string ThreeDSReqPriorAuthData { get; set; } /// /// Date and time in UTC of the prior cardholder authentication. Format: YYYYMMDDHHMM /// /// Date and time in UTC of the prior cardholder authentication. Format: YYYYMMDDHHMM - [JsonPropertyName("threeDSReqPriorAuthTimestamp")] - public string ThreeDSReqPriorAuthTimestamp { get { return this.ThreeDSReqPriorAuthTimestampOption; } set { this.ThreeDSReqPriorAuthTimestampOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSReqPriorRef - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSReqPriorRefOption { get; private set; } + [DataMember(Name = "threeDSReqPriorAuthTimestamp", EmitDefaultValue = false)] + public string ThreeDSReqPriorAuthTimestamp { get; set; } /// /// This data element provides additional information to the ACS to determine the best approach for handing a request. This data element contains an ACS Transaction ID for a prior authenticated transaction. For example, the first recurring transaction that was authenticated with the cardholder. Length: 30 characters. /// /// This data element provides additional information to the ACS to determine the best approach for handing a request. This data element contains an ACS Transaction ID for a prior authenticated transaction. For example, the first recurring transaction that was authenticated with the cardholder. Length: 30 characters. - [JsonPropertyName("threeDSReqPriorRef")] - public string ThreeDSReqPriorRef { get { return this.ThreeDSReqPriorRefOption; } set { this.ThreeDSReqPriorRefOption = new Option(value); } } + [DataMember(Name = "threeDSReqPriorRef", EmitDefaultValue = false)] + public string ThreeDSReqPriorRef { get; set; } /// /// Returns the string presentation of the object @@ -214,161 +124,116 @@ public override string ToString() return sb.ToString(); } + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ThreeDSRequestorPriorAuthenticationInfo); + } + + /// + /// Returns true if ThreeDSRequestorPriorAuthenticationInfo instances are equal + /// + /// Instance of ThreeDSRequestorPriorAuthenticationInfo to be compared + /// Boolean + public bool Equals(ThreeDSRequestorPriorAuthenticationInfo input) + { + if (input == null) + { + return false; + } + return + ( + this.ThreeDSReqPriorAuthData == input.ThreeDSReqPriorAuthData || + (this.ThreeDSReqPriorAuthData != null && + this.ThreeDSReqPriorAuthData.Equals(input.ThreeDSReqPriorAuthData)) + ) && + ( + this.ThreeDSReqPriorAuthMethod == input.ThreeDSReqPriorAuthMethod || + this.ThreeDSReqPriorAuthMethod.Equals(input.ThreeDSReqPriorAuthMethod) + ) && + ( + this.ThreeDSReqPriorAuthTimestamp == input.ThreeDSReqPriorAuthTimestamp || + (this.ThreeDSReqPriorAuthTimestamp != null && + this.ThreeDSReqPriorAuthTimestamp.Equals(input.ThreeDSReqPriorAuthTimestamp)) + ) && + ( + this.ThreeDSReqPriorRef == input.ThreeDSReqPriorRef || + (this.ThreeDSReqPriorRef != null && + this.ThreeDSReqPriorRef.Equals(input.ThreeDSReqPriorRef)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ThreeDSReqPriorAuthData != null) + { + hashCode = (hashCode * 59) + this.ThreeDSReqPriorAuthData.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ThreeDSReqPriorAuthMethod.GetHashCode(); + if (this.ThreeDSReqPriorAuthTimestamp != null) + { + hashCode = (hashCode * 59) + this.ThreeDSReqPriorAuthTimestamp.GetHashCode(); + } + if (this.ThreeDSReqPriorRef != null) + { + hashCode = (hashCode * 59) + this.ThreeDSReqPriorRef.GetHashCode(); + } + return hashCode; + } + } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { // ThreeDSReqPriorAuthTimestamp (string) maxLength if (this.ThreeDSReqPriorAuthTimestamp != null && this.ThreeDSReqPriorAuthTimestamp.Length > 12) { - yield return new ValidationResult("Invalid value for ThreeDSReqPriorAuthTimestamp, length must be less than 12.", new [] { "ThreeDSReqPriorAuthTimestamp" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSReqPriorAuthTimestamp, length must be less than 12.", new [] { "ThreeDSReqPriorAuthTimestamp" }); } // ThreeDSReqPriorAuthTimestamp (string) minLength if (this.ThreeDSReqPriorAuthTimestamp != null && this.ThreeDSReqPriorAuthTimestamp.Length < 12) { - yield return new ValidationResult("Invalid value for ThreeDSReqPriorAuthTimestamp, length must be greater than 12.", new [] { "ThreeDSReqPriorAuthTimestamp" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSReqPriorAuthTimestamp, length must be greater than 12.", new [] { "ThreeDSReqPriorAuthTimestamp" }); } // ThreeDSReqPriorRef (string) maxLength if (this.ThreeDSReqPriorRef != null && this.ThreeDSReqPriorRef.Length > 36) { - yield return new ValidationResult("Invalid value for ThreeDSReqPriorRef, length must be less than 36.", new [] { "ThreeDSReqPriorRef" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSReqPriorRef, length must be less than 36.", new [] { "ThreeDSReqPriorRef" }); } // ThreeDSReqPriorRef (string) minLength if (this.ThreeDSReqPriorRef != null && this.ThreeDSReqPriorRef.Length < 36) { - yield return new ValidationResult("Invalid value for ThreeDSReqPriorRef, length must be greater than 36.", new [] { "ThreeDSReqPriorRef" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ThreeDSReqPriorRef, length must be greater than 36.", new [] { "ThreeDSReqPriorRef" }); } yield break; } } - /// - /// A Json converter for type - /// - public class ThreeDSRequestorPriorAuthenticationInfoJsonConverter : JsonConverter - { - /// - /// Deserializes json to - /// - /// - /// - /// - /// - /// - public override ThreeDSRequestorPriorAuthenticationInfo Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) - { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option threeDSReqPriorAuthData = default; - Option threeDSReqPriorAuthMethod = default; - Option threeDSReqPriorAuthTimestamp = default; - Option threeDSReqPriorRef = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "threeDSReqPriorAuthData": - threeDSReqPriorAuthData = new Option(utf8JsonReader.GetString()); - break; - case "threeDSReqPriorAuthMethod": - string threeDSReqPriorAuthMethodRawValue = utf8JsonReader.GetString(); - if (threeDSReqPriorAuthMethodRawValue != null) - threeDSReqPriorAuthMethod = new Option(ThreeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodEnumFromStringOrDefault(threeDSReqPriorAuthMethodRawValue)); - break; - case "threeDSReqPriorAuthTimestamp": - threeDSReqPriorAuthTimestamp = new Option(utf8JsonReader.GetString()); - break; - case "threeDSReqPriorRef": - threeDSReqPriorRef = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } - } - - if (threeDSReqPriorAuthData.IsSet && threeDSReqPriorAuthData.Value == null) - throw new ArgumentNullException(nameof(threeDSReqPriorAuthData), "Property is not nullable for class ThreeDSRequestorPriorAuthenticationInfo."); - - if (threeDSReqPriorAuthMethod.IsSet && threeDSReqPriorAuthMethod.Value == null) - throw new ArgumentNullException(nameof(threeDSReqPriorAuthMethod), "Property is not nullable for class ThreeDSRequestorPriorAuthenticationInfo."); - - if (threeDSReqPriorAuthTimestamp.IsSet && threeDSReqPriorAuthTimestamp.Value == null) - throw new ArgumentNullException(nameof(threeDSReqPriorAuthTimestamp), "Property is not nullable for class ThreeDSRequestorPriorAuthenticationInfo."); - - if (threeDSReqPriorRef.IsSet && threeDSReqPriorRef.Value == null) - throw new ArgumentNullException(nameof(threeDSReqPriorRef), "Property is not nullable for class ThreeDSRequestorPriorAuthenticationInfo."); - - return new ThreeDSRequestorPriorAuthenticationInfo(threeDSReqPriorAuthData, threeDSReqPriorAuthMethod, threeDSReqPriorAuthTimestamp, threeDSReqPriorRef); - } - - /// - /// Serializes a - /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo, JsonSerializerOptions jsonSerializerOptions) - { - writer.WriteStartObject(); - - WriteProperties(writer, threeDSRequestorPriorAuthenticationInfo, jsonSerializerOptions); - writer.WriteEndObject(); - } - - /// - /// Serializes the properties of - /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo, JsonSerializerOptions jsonSerializerOptions) - { - if (threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthDataOption.IsSet && threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthData == null) - throw new ArgumentNullException(nameof(threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthData), "Property is required for class ThreeDSRequestorPriorAuthenticationInfo."); - - if (threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthTimestampOption.IsSet && threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthTimestamp == null) - throw new ArgumentNullException(nameof(threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthTimestamp), "Property is required for class ThreeDSRequestorPriorAuthenticationInfo."); - - if (threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorRefOption.IsSet && threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorRef == null) - throw new ArgumentNullException(nameof(threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorRef), "Property is required for class ThreeDSRequestorPriorAuthenticationInfo."); - - if (threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthDataOption.IsSet) - writer.WriteString("threeDSReqPriorAuthData", threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthData); - - var threeDSReqPriorAuthMethodRawValue = ThreeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodEnumToJsonValue(threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthMethodOption.Value.Value); - writer.WriteString("threeDSReqPriorAuthMethod", threeDSReqPriorAuthMethodRawValue); - if (threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthTimestampOption.IsSet) - writer.WriteString("threeDSReqPriorAuthTimestamp", threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorAuthTimestamp); - - if (threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorRefOption.IsSet) - writer.WriteString("threeDSReqPriorRef", threeDSRequestorPriorAuthenticationInfo.ThreeDSReqPriorRef); - } - } } diff --git a/Adyen/Model/Checkout/ThreeDSecureData.cs b/Adyen/Model/Checkout/ThreeDSecureData.cs index 443df7aee..9688f6845 100644 --- a/Adyen/Model/Checkout/ThreeDSecureData.cs +++ b/Adyen/Model/Checkout/ThreeDSecureData.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,605 +15,278 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ThreeDSecureData /// - public partial class ThreeDSecureData : IValidatableObject + [DataContract(Name = "ThreeDSecureData")] + public partial class ThreeDSecureData : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. - /// The cardholder authentication value (base64 encoded, 20 bytes in a decoded form). - /// The CAVV algorithm used. Include this only for 3D Secure 1. - /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). - /// In 3D Secure 2, this is the `transStatus` from the `ARes`. - /// Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction. - /// The electronic commerce indicator. - /// Risk score calculated by Directory Server (DS). Required for Cartes Bancaires integrations. - /// The version of the 3D Secure protocol. - /// Network token authentication verification value (TAVV). The network token cryptogram. - /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). - /// Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form). - [JsonConstructor] - public ThreeDSecureData(Option authenticationResponse = default, Option cavv = default, Option cavvAlgorithm = default, Option challengeCancel = default, Option directoryResponse = default, Option dsTransID = default, Option eci = default, Option riskScore = default, Option threeDSVersion = default, Option tokenAuthenticationVerificationValue = default, Option transStatusReason = default, Option xid = default) - { - AuthenticationResponseOption = authenticationResponse; - CavvOption = cavv; - CavvAlgorithmOption = cavvAlgorithm; - ChallengeCancelOption = challengeCancel; - DirectoryResponseOption = directoryResponse; - DsTransIDOption = dsTransID; - EciOption = eci; - RiskScoreOption = riskScore; - ThreeDSVersionOption = threeDSVersion; - TokenAuthenticationVerificationValueOption = tokenAuthenticationVerificationValue; - TransStatusReasonOption = transStatusReason; - XidOption = xid; - OnCreated(); - } - - partial void OnCreated(); - /// /// In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. /// /// In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. + [JsonConverter(typeof(StringEnumConverter))] public enum AuthenticationResponseEnum { /// /// Enum Y for value: Y /// + [EnumMember(Value = "Y")] Y = 1, /// /// Enum N for value: N /// + [EnumMember(Value = "N")] N = 2, /// /// Enum U for value: U /// + [EnumMember(Value = "U")] U = 3, /// /// Enum A for value: A /// + [EnumMember(Value = "A")] A = 4 - } - - /// - /// Returns a - /// - /// - /// - /// - public static AuthenticationResponseEnum AuthenticationResponseEnumFromString(string value) - { - if (value.Equals("Y")) - return AuthenticationResponseEnum.Y; - - if (value.Equals("N")) - return AuthenticationResponseEnum.N; - - if (value.Equals("U")) - return AuthenticationResponseEnum.U; - if (value.Equals("A")) - return AuthenticationResponseEnum.A; - - throw new NotImplementedException($"Could not convert value to type AuthenticationResponseEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static AuthenticationResponseEnum? AuthenticationResponseEnumFromStringOrDefault(string value) - { - if (value.Equals("Y")) - return AuthenticationResponseEnum.Y; - - if (value.Equals("N")) - return AuthenticationResponseEnum.N; - - if (value.Equals("U")) - return AuthenticationResponseEnum.U; - - if (value.Equals("A")) - return AuthenticationResponseEnum.A; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string AuthenticationResponseEnumToJsonValue(AuthenticationResponseEnum? value) - { - if (value == AuthenticationResponseEnum.Y) - return "Y"; - - if (value == AuthenticationResponseEnum.N) - return "N"; - - if (value == AuthenticationResponseEnum.U) - return "U"; - - if (value == AuthenticationResponseEnum.A) - return "A"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of AuthenticationResponse - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AuthenticationResponseOption { get; private set; } /// /// In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. /// /// In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. - [JsonPropertyName("authenticationResponse")] - public AuthenticationResponseEnum? AuthenticationResponse { get { return this.AuthenticationResponseOption; } set { this.AuthenticationResponseOption = new Option(value); } } - + [DataMember(Name = "authenticationResponse", EmitDefaultValue = false)] + public AuthenticationResponseEnum? AuthenticationResponse { get; set; } /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). + [JsonConverter(typeof(StringEnumConverter))] public enum ChallengeCancelEnum { /// /// Enum _01 for value: 01 /// + [EnumMember(Value = "01")] _01 = 1, /// /// Enum _02 for value: 02 /// + [EnumMember(Value = "02")] _02 = 2, /// /// Enum _03 for value: 03 /// + [EnumMember(Value = "03")] _03 = 3, /// /// Enum _04 for value: 04 /// + [EnumMember(Value = "04")] _04 = 4, /// /// Enum _05 for value: 05 /// + [EnumMember(Value = "05")] _05 = 5, /// /// Enum _06 for value: 06 /// + [EnumMember(Value = "06")] _06 = 6, /// /// Enum _07 for value: 07 /// + [EnumMember(Value = "07")] _07 = 7 - } - - /// - /// Returns a - /// - /// - /// - /// - public static ChallengeCancelEnum ChallengeCancelEnumFromString(string value) - { - if (value.Equals("01")) - return ChallengeCancelEnum._01; - - if (value.Equals("02")) - return ChallengeCancelEnum._02; - if (value.Equals("03")) - return ChallengeCancelEnum._03; - - if (value.Equals("04")) - return ChallengeCancelEnum._04; - - if (value.Equals("05")) - return ChallengeCancelEnum._05; - - if (value.Equals("06")) - return ChallengeCancelEnum._06; - - if (value.Equals("07")) - return ChallengeCancelEnum._07; - - throw new NotImplementedException($"Could not convert value to type ChallengeCancelEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static ChallengeCancelEnum? ChallengeCancelEnumFromStringOrDefault(string value) - { - if (value.Equals("01")) - return ChallengeCancelEnum._01; - - if (value.Equals("02")) - return ChallengeCancelEnum._02; - - if (value.Equals("03")) - return ChallengeCancelEnum._03; - - if (value.Equals("04")) - return ChallengeCancelEnum._04; - - if (value.Equals("05")) - return ChallengeCancelEnum._05; - - if (value.Equals("06")) - return ChallengeCancelEnum._06; - - if (value.Equals("07")) - return ChallengeCancelEnum._07; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string ChallengeCancelEnumToJsonValue(ChallengeCancelEnum? value) - { - if (value == ChallengeCancelEnum._01) - return "01"; - - if (value == ChallengeCancelEnum._02) - return "02"; - - if (value == ChallengeCancelEnum._03) - return "03"; - - if (value == ChallengeCancelEnum._04) - return "04"; - - if (value == ChallengeCancelEnum._05) - return "05"; - - if (value == ChallengeCancelEnum._06) - return "06"; - - if (value == ChallengeCancelEnum._07) - return "07"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of ChallengeCancel - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ChallengeCancelOption { get; private set; } /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). /// /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata). - [JsonPropertyName("challengeCancel")] - public ChallengeCancelEnum? ChallengeCancel { get { return this.ChallengeCancelOption; } set { this.ChallengeCancelOption = new Option(value); } } - + [DataMember(Name = "challengeCancel", EmitDefaultValue = false)] + public ChallengeCancelEnum? ChallengeCancel { get; set; } /// /// In 3D Secure 2, this is the `transStatus` from the `ARes`. /// /// In 3D Secure 2, this is the `transStatus` from the `ARes`. + [JsonConverter(typeof(StringEnumConverter))] public enum DirectoryResponseEnum { /// /// Enum A for value: A /// + [EnumMember(Value = "A")] A = 1, /// /// Enum C for value: C /// + [EnumMember(Value = "C")] C = 2, /// /// Enum D for value: D /// + [EnumMember(Value = "D")] D = 3, /// /// Enum I for value: I /// + [EnumMember(Value = "I")] I = 4, /// /// Enum N for value: N /// + [EnumMember(Value = "N")] N = 5, /// /// Enum R for value: R /// + [EnumMember(Value = "R")] R = 6, /// /// Enum U for value: U /// + [EnumMember(Value = "U")] U = 7, /// /// Enum Y for value: Y /// + [EnumMember(Value = "Y")] Y = 8 - } - - /// - /// Returns a - /// - /// - /// - /// - public static DirectoryResponseEnum DirectoryResponseEnumFromString(string value) - { - if (value.Equals("A")) - return DirectoryResponseEnum.A; - - if (value.Equals("C")) - return DirectoryResponseEnum.C; - - if (value.Equals("D")) - return DirectoryResponseEnum.D; - - if (value.Equals("I")) - return DirectoryResponseEnum.I; - - if (value.Equals("N")) - return DirectoryResponseEnum.N; - - if (value.Equals("R")) - return DirectoryResponseEnum.R; - - if (value.Equals("U")) - return DirectoryResponseEnum.U; - - if (value.Equals("Y")) - return DirectoryResponseEnum.Y; - - throw new NotImplementedException($"Could not convert value to type DirectoryResponseEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static DirectoryResponseEnum? DirectoryResponseEnumFromStringOrDefault(string value) - { - if (value.Equals("A")) - return DirectoryResponseEnum.A; - - if (value.Equals("C")) - return DirectoryResponseEnum.C; - - if (value.Equals("D")) - return DirectoryResponseEnum.D; - - if (value.Equals("I")) - return DirectoryResponseEnum.I; - - if (value.Equals("N")) - return DirectoryResponseEnum.N; - - if (value.Equals("R")) - return DirectoryResponseEnum.R; - - if (value.Equals("U")) - return DirectoryResponseEnum.U; - - if (value.Equals("Y")) - return DirectoryResponseEnum.Y; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string DirectoryResponseEnumToJsonValue(DirectoryResponseEnum? value) - { - if (value == DirectoryResponseEnum.A) - return "A"; - - if (value == DirectoryResponseEnum.C) - return "C"; - - if (value == DirectoryResponseEnum.D) - return "D"; - - if (value == DirectoryResponseEnum.I) - return "I"; - - if (value == DirectoryResponseEnum.N) - return "N"; - if (value == DirectoryResponseEnum.R) - return "R"; - - if (value == DirectoryResponseEnum.U) - return "U"; - - if (value == DirectoryResponseEnum.Y) - return "Y"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Used to track the state of DirectoryResponse - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DirectoryResponseOption { get; private set; } /// /// In 3D Secure 2, this is the `transStatus` from the `ARes`. /// /// In 3D Secure 2, this is the `transStatus` from the `ARes`. - [JsonPropertyName("directoryResponse")] - public DirectoryResponseEnum? DirectoryResponse { get { return this.DirectoryResponseOption; } set { this.DirectoryResponseOption = new Option(value); } } - + [DataMember(Name = "directoryResponse", EmitDefaultValue = false)] + public DirectoryResponseEnum? DirectoryResponse { get; set; } /// - /// Used to track the state of Cavv + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CavvOption { get; private set; } + /// In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. . + /// The cardholder authentication value (base64 encoded, 20 bytes in a decoded form).. + /// The CAVV algorithm used. Include this only for 3D Secure 1.. + /// Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the authentication has been cancelled. For possible values, refer to [3D Secure API reference](https://docs.adyen.com/online-payments/3d-secure/api-reference#mpidata).. + /// In 3D Secure 2, this is the `transStatus` from the `ARes`. . + /// Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction.. + /// The electronic commerce indicator.. + /// Risk score calculated by Directory Server (DS). Required for Cartes Bancaires integrations.. + /// The version of the 3D Secure protocol.. + /// Network token authentication verification value (TAVV). The network token cryptogram.. + /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values).. + /// Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form).. + public ThreeDSecureData(AuthenticationResponseEnum? authenticationResponse = default(AuthenticationResponseEnum?), byte[] cavv = default(byte[]), string cavvAlgorithm = default(string), ChallengeCancelEnum? challengeCancel = default(ChallengeCancelEnum?), DirectoryResponseEnum? directoryResponse = default(DirectoryResponseEnum?), string dsTransID = default(string), string eci = default(string), string riskScore = default(string), string threeDSVersion = default(string), byte[] tokenAuthenticationVerificationValue = default(byte[]), string transStatusReason = default(string), byte[] xid = default(byte[])) + { + this.AuthenticationResponse = authenticationResponse; + this.Cavv = cavv; + this.CavvAlgorithm = cavvAlgorithm; + this.ChallengeCancel = challengeCancel; + this.DirectoryResponse = directoryResponse; + this.DsTransID = dsTransID; + this.Eci = eci; + this.RiskScore = riskScore; + this.ThreeDSVersion = threeDSVersion; + this.TokenAuthenticationVerificationValue = tokenAuthenticationVerificationValue; + this.TransStatusReason = transStatusReason; + this.Xid = xid; + } /// /// The cardholder authentication value (base64 encoded, 20 bytes in a decoded form). /// /// The cardholder authentication value (base64 encoded, 20 bytes in a decoded form). - [JsonPropertyName("cavv")] - public byte[] Cavv { get { return this.CavvOption; } set { this.CavvOption = new Option(value); } } - - /// - /// Used to track the state of CavvAlgorithm - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CavvAlgorithmOption { get; private set; } + [DataMember(Name = "cavv", EmitDefaultValue = false)] + public byte[] Cavv { get; set; } /// /// The CAVV algorithm used. Include this only for 3D Secure 1. /// /// The CAVV algorithm used. Include this only for 3D Secure 1. - [JsonPropertyName("cavvAlgorithm")] - public string CavvAlgorithm { get { return this.CavvAlgorithmOption; } set { this.CavvAlgorithmOption = new Option(value); } } - - /// - /// Used to track the state of DsTransID - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option DsTransIDOption { get; private set; } + [DataMember(Name = "cavvAlgorithm", EmitDefaultValue = false)] + public string CavvAlgorithm { get; set; } /// /// Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction. /// /// Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction. - [JsonPropertyName("dsTransID")] - public string DsTransID { get { return this.DsTransIDOption; } set { this.DsTransIDOption = new Option(value); } } - - /// - /// Used to track the state of Eci - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option EciOption { get; private set; } + [DataMember(Name = "dsTransID", EmitDefaultValue = false)] + public string DsTransID { get; set; } /// /// The electronic commerce indicator. /// /// The electronic commerce indicator. - [JsonPropertyName("eci")] - public string Eci { get { return this.EciOption; } set { this.EciOption = new Option(value); } } - - /// - /// Used to track the state of RiskScore - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RiskScoreOption { get; private set; } + [DataMember(Name = "eci", EmitDefaultValue = false)] + public string Eci { get; set; } /// /// Risk score calculated by Directory Server (DS). Required for Cartes Bancaires integrations. /// /// Risk score calculated by Directory Server (DS). Required for Cartes Bancaires integrations. - [JsonPropertyName("riskScore")] - public string RiskScore { get { return this.RiskScoreOption; } set { this.RiskScoreOption = new Option(value); } } - - /// - /// Used to track the state of ThreeDSVersion - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ThreeDSVersionOption { get; private set; } + [DataMember(Name = "riskScore", EmitDefaultValue = false)] + public string RiskScore { get; set; } /// /// The version of the 3D Secure protocol. /// /// The version of the 3D Secure protocol. - [JsonPropertyName("threeDSVersion")] - public string ThreeDSVersion { get { return this.ThreeDSVersionOption; } set { this.ThreeDSVersionOption = new Option(value); } } - - /// - /// Used to track the state of TokenAuthenticationVerificationValue - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TokenAuthenticationVerificationValueOption { get; private set; } + [DataMember(Name = "threeDSVersion", EmitDefaultValue = false)] + public string ThreeDSVersion { get; set; } /// /// Network token authentication verification value (TAVV). The network token cryptogram. /// /// Network token authentication verification value (TAVV). The network token cryptogram. - [JsonPropertyName("tokenAuthenticationVerificationValue")] - public byte[] TokenAuthenticationVerificationValue { get { return this.TokenAuthenticationVerificationValueOption; } set { this.TokenAuthenticationVerificationValueOption = new Option(value); } } - - /// - /// Used to track the state of TransStatusReason - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TransStatusReasonOption { get; private set; } + [DataMember(Name = "tokenAuthenticationVerificationValue", EmitDefaultValue = false)] + public byte[] TokenAuthenticationVerificationValue { get; set; } /// /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). /// /// Provides information on why the `transStatus` field has the specified value. For possible values, refer to [our docs](https://docs.adyen.com/online-payments/3d-secure/api-reference#possible-transstatusreason-values). - [JsonPropertyName("transStatusReason")] - public string TransStatusReason { get { return this.TransStatusReasonOption; } set { this.TransStatusReasonOption = new Option(value); } } - - /// - /// Used to track the state of Xid - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option XidOption { get; private set; } + [DataMember(Name = "transStatusReason", EmitDefaultValue = false)] + public string TransStatusReason { get; set; } /// /// Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form). /// /// Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form). - [JsonPropertyName("xid")] - public byte[] Xid { get { return this.XidOption; } set { this.XidOption = new Option(value); } } + [DataMember(Name = "xid", EmitDefaultValue = false)] + public byte[] Xid { get; set; } /// /// Returns the string presentation of the object @@ -639,246 +313,155 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ThreeDSecureDataJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ThreeDSecureData Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option authenticationResponse = default; - Option cavv = default; - Option cavvAlgorithm = default; - Option challengeCancel = default; - Option directoryResponse = default; - Option dsTransID = default; - Option eci = default; - Option riskScore = default; - Option threeDSVersion = default; - Option tokenAuthenticationVerificationValue = default; - Option transStatusReason = default; - Option xid = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "authenticationResponse": - string authenticationResponseRawValue = utf8JsonReader.GetString(); - if (authenticationResponseRawValue != null) - authenticationResponse = new Option(ThreeDSecureData.AuthenticationResponseEnumFromStringOrDefault(authenticationResponseRawValue)); - break; - case "cavv": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - cavv = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "cavvAlgorithm": - cavvAlgorithm = new Option(utf8JsonReader.GetString()); - break; - case "challengeCancel": - string challengeCancelRawValue = utf8JsonReader.GetString(); - if (challengeCancelRawValue != null) - challengeCancel = new Option(ThreeDSecureData.ChallengeCancelEnumFromStringOrDefault(challengeCancelRawValue)); - break; - case "directoryResponse": - string directoryResponseRawValue = utf8JsonReader.GetString(); - if (directoryResponseRawValue != null) - directoryResponse = new Option(ThreeDSecureData.DirectoryResponseEnumFromStringOrDefault(directoryResponseRawValue)); - break; - case "dsTransID": - dsTransID = new Option(utf8JsonReader.GetString()); - break; - case "eci": - eci = new Option(utf8JsonReader.GetString()); - break; - case "riskScore": - riskScore = new Option(utf8JsonReader.GetString()); - break; - case "threeDSVersion": - threeDSVersion = new Option(utf8JsonReader.GetString()); - break; - case "tokenAuthenticationVerificationValue": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tokenAuthenticationVerificationValue = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "transStatusReason": - transStatusReason = new Option(utf8JsonReader.GetString()); - break; - case "xid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - xid = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (authenticationResponse.IsSet && authenticationResponse.Value == null) - throw new ArgumentNullException(nameof(authenticationResponse), "Property is not nullable for class ThreeDSecureData."); - - if (cavv.IsSet && cavv.Value == null) - throw new ArgumentNullException(nameof(cavv), "Property is not nullable for class ThreeDSecureData."); - - if (cavvAlgorithm.IsSet && cavvAlgorithm.Value == null) - throw new ArgumentNullException(nameof(cavvAlgorithm), "Property is not nullable for class ThreeDSecureData."); - - if (challengeCancel.IsSet && challengeCancel.Value == null) - throw new ArgumentNullException(nameof(challengeCancel), "Property is not nullable for class ThreeDSecureData."); - - if (directoryResponse.IsSet && directoryResponse.Value == null) - throw new ArgumentNullException(nameof(directoryResponse), "Property is not nullable for class ThreeDSecureData."); - - if (dsTransID.IsSet && dsTransID.Value == null) - throw new ArgumentNullException(nameof(dsTransID), "Property is not nullable for class ThreeDSecureData."); - - if (eci.IsSet && eci.Value == null) - throw new ArgumentNullException(nameof(eci), "Property is not nullable for class ThreeDSecureData."); - - if (riskScore.IsSet && riskScore.Value == null) - throw new ArgumentNullException(nameof(riskScore), "Property is not nullable for class ThreeDSecureData."); - - if (threeDSVersion.IsSet && threeDSVersion.Value == null) - throw new ArgumentNullException(nameof(threeDSVersion), "Property is not nullable for class ThreeDSecureData."); - - if (tokenAuthenticationVerificationValue.IsSet && tokenAuthenticationVerificationValue.Value == null) - throw new ArgumentNullException(nameof(tokenAuthenticationVerificationValue), "Property is not nullable for class ThreeDSecureData."); - - if (transStatusReason.IsSet && transStatusReason.Value == null) - throw new ArgumentNullException(nameof(transStatusReason), "Property is not nullable for class ThreeDSecureData."); - - if (xid.IsSet && xid.Value == null) - throw new ArgumentNullException(nameof(xid), "Property is not nullable for class ThreeDSecureData."); - - return new ThreeDSecureData(authenticationResponse, cavv, cavvAlgorithm, challengeCancel, directoryResponse, dsTransID, eci, riskScore, threeDSVersion, tokenAuthenticationVerificationValue, transStatusReason, xid); + return this.Equals(input as ThreeDSecureData); } /// - /// Serializes a + /// Returns true if ThreeDSecureData instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ThreeDSecureData threeDSecureData, JsonSerializerOptions jsonSerializerOptions) + /// Instance of ThreeDSecureData to be compared + /// Boolean + public bool Equals(ThreeDSecureData input) { - writer.WriteStartObject(); - - WriteProperties(writer, threeDSecureData, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.AuthenticationResponse == input.AuthenticationResponse || + this.AuthenticationResponse.Equals(input.AuthenticationResponse) + ) && + ( + this.Cavv == input.Cavv || + (this.Cavv != null && + this.Cavv.Equals(input.Cavv)) + ) && + ( + this.CavvAlgorithm == input.CavvAlgorithm || + (this.CavvAlgorithm != null && + this.CavvAlgorithm.Equals(input.CavvAlgorithm)) + ) && + ( + this.ChallengeCancel == input.ChallengeCancel || + this.ChallengeCancel.Equals(input.ChallengeCancel) + ) && + ( + this.DirectoryResponse == input.DirectoryResponse || + this.DirectoryResponse.Equals(input.DirectoryResponse) + ) && + ( + this.DsTransID == input.DsTransID || + (this.DsTransID != null && + this.DsTransID.Equals(input.DsTransID)) + ) && + ( + this.Eci == input.Eci || + (this.Eci != null && + this.Eci.Equals(input.Eci)) + ) && + ( + this.RiskScore == input.RiskScore || + (this.RiskScore != null && + this.RiskScore.Equals(input.RiskScore)) + ) && + ( + this.ThreeDSVersion == input.ThreeDSVersion || + (this.ThreeDSVersion != null && + this.ThreeDSVersion.Equals(input.ThreeDSVersion)) + ) && + ( + this.TokenAuthenticationVerificationValue == input.TokenAuthenticationVerificationValue || + (this.TokenAuthenticationVerificationValue != null && + this.TokenAuthenticationVerificationValue.Equals(input.TokenAuthenticationVerificationValue)) + ) && + ( + this.TransStatusReason == input.TransStatusReason || + (this.TransStatusReason != null && + this.TransStatusReason.Equals(input.TransStatusReason)) + ) && + ( + this.Xid == input.Xid || + (this.Xid != null && + this.Xid.Equals(input.Xid)) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ThreeDSecureData threeDSecureData, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (threeDSecureData.CavvOption.IsSet && threeDSecureData.Cavv == null) - throw new ArgumentNullException(nameof(threeDSecureData.Cavv), "Property is required for class ThreeDSecureData."); - - if (threeDSecureData.CavvAlgorithmOption.IsSet && threeDSecureData.CavvAlgorithm == null) - throw new ArgumentNullException(nameof(threeDSecureData.CavvAlgorithm), "Property is required for class ThreeDSecureData."); - - if (threeDSecureData.DsTransIDOption.IsSet && threeDSecureData.DsTransID == null) - throw new ArgumentNullException(nameof(threeDSecureData.DsTransID), "Property is required for class ThreeDSecureData."); - - if (threeDSecureData.EciOption.IsSet && threeDSecureData.Eci == null) - throw new ArgumentNullException(nameof(threeDSecureData.Eci), "Property is required for class ThreeDSecureData."); - - if (threeDSecureData.RiskScoreOption.IsSet && threeDSecureData.RiskScore == null) - throw new ArgumentNullException(nameof(threeDSecureData.RiskScore), "Property is required for class ThreeDSecureData."); - - if (threeDSecureData.ThreeDSVersionOption.IsSet && threeDSecureData.ThreeDSVersion == null) - throw new ArgumentNullException(nameof(threeDSecureData.ThreeDSVersion), "Property is required for class ThreeDSecureData."); - - if (threeDSecureData.TokenAuthenticationVerificationValueOption.IsSet && threeDSecureData.TokenAuthenticationVerificationValue == null) - throw new ArgumentNullException(nameof(threeDSecureData.TokenAuthenticationVerificationValue), "Property is required for class ThreeDSecureData."); - - if (threeDSecureData.TransStatusReasonOption.IsSet && threeDSecureData.TransStatusReason == null) - throw new ArgumentNullException(nameof(threeDSecureData.TransStatusReason), "Property is required for class ThreeDSecureData."); - - if (threeDSecureData.XidOption.IsSet && threeDSecureData.Xid == null) - throw new ArgumentNullException(nameof(threeDSecureData.Xid), "Property is required for class ThreeDSecureData."); - - var authenticationResponseRawValue = ThreeDSecureData.AuthenticationResponseEnumToJsonValue(threeDSecureData.AuthenticationResponseOption.Value.Value); - writer.WriteString("authenticationResponse", authenticationResponseRawValue); - if (threeDSecureData.CavvOption.IsSet) - { - writer.WritePropertyName("cavv"); - JsonSerializer.Serialize(writer, threeDSecureData.Cavv, jsonSerializerOptions); - } - if (threeDSecureData.CavvAlgorithmOption.IsSet) - writer.WriteString("cavvAlgorithm", threeDSecureData.CavvAlgorithm); - - var challengeCancelRawValue = ThreeDSecureData.ChallengeCancelEnumToJsonValue(threeDSecureData.ChallengeCancelOption.Value.Value); - writer.WriteString("challengeCancel", challengeCancelRawValue); - var directoryResponseRawValue = ThreeDSecureData.DirectoryResponseEnumToJsonValue(threeDSecureData.DirectoryResponseOption.Value.Value); - writer.WriteString("directoryResponse", directoryResponseRawValue); - if (threeDSecureData.DsTransIDOption.IsSet) - writer.WriteString("dsTransID", threeDSecureData.DsTransID); - - if (threeDSecureData.EciOption.IsSet) - writer.WriteString("eci", threeDSecureData.Eci); - - if (threeDSecureData.RiskScoreOption.IsSet) - writer.WriteString("riskScore", threeDSecureData.RiskScore); - - if (threeDSecureData.ThreeDSVersionOption.IsSet) - writer.WriteString("threeDSVersion", threeDSecureData.ThreeDSVersion); - - if (threeDSecureData.TokenAuthenticationVerificationValueOption.IsSet) - { - writer.WritePropertyName("tokenAuthenticationVerificationValue"); - JsonSerializer.Serialize(writer, threeDSecureData.TokenAuthenticationVerificationValue, jsonSerializerOptions); - } - if (threeDSecureData.TransStatusReasonOption.IsSet) - writer.WriteString("transStatusReason", threeDSecureData.TransStatusReason); - - if (threeDSecureData.XidOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("xid"); - JsonSerializer.Serialize(writer, threeDSecureData.Xid, jsonSerializerOptions); + int hashCode = 41; + hashCode = (hashCode * 59) + this.AuthenticationResponse.GetHashCode(); + if (this.Cavv != null) + { + hashCode = (hashCode * 59) + this.Cavv.GetHashCode(); + } + if (this.CavvAlgorithm != null) + { + hashCode = (hashCode * 59) + this.CavvAlgorithm.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ChallengeCancel.GetHashCode(); + hashCode = (hashCode * 59) + this.DirectoryResponse.GetHashCode(); + if (this.DsTransID != null) + { + hashCode = (hashCode * 59) + this.DsTransID.GetHashCode(); + } + if (this.Eci != null) + { + hashCode = (hashCode * 59) + this.Eci.GetHashCode(); + } + if (this.RiskScore != null) + { + hashCode = (hashCode * 59) + this.RiskScore.GetHashCode(); + } + if (this.ThreeDSVersion != null) + { + hashCode = (hashCode * 59) + this.ThreeDSVersion.GetHashCode(); + } + if (this.TokenAuthenticationVerificationValue != null) + { + hashCode = (hashCode * 59) + this.TokenAuthenticationVerificationValue.GetHashCode(); + } + if (this.TransStatusReason != null) + { + hashCode = (hashCode * 59) + this.TransStatusReason.GetHashCode(); + } + if (this.Xid != null) + { + hashCode = (hashCode * 59) + this.Xid.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/Ticket.cs b/Adyen/Model/Checkout/Ticket.cs index 0fb334720..9caee123c 100644 --- a/Adyen/Model/Checkout/Ticket.cs +++ b/Adyen/Model/Checkout/Ticket.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,78 +15,57 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// Ticket /// - public partial class Ticket : IValidatableObject + [DataContract(Name = "Ticket")] + public partial class Ticket : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters - /// The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd - /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonConstructor] - public Ticket(Option issueAddress = default, Option issueDate = default, Option number = default) + /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters. + /// The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd. + /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + public Ticket(string issueAddress = default(string), DateTime issueDate = default(DateTime), string number = default(string)) { - IssueAddressOption = issueAddress; - IssueDateOption = issueDate; - NumberOption = number; - OnCreated(); + this.IssueAddress = issueAddress; + this.IssueDate = issueDate; + this.Number = number; } - partial void OnCreated(); - - /// - /// Used to track the state of IssueAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IssueAddressOption { get; private set; } - /// /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters /// /// The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters - [JsonPropertyName("issueAddress")] - public string IssueAddress { get { return this.IssueAddressOption; } set { this.IssueAddressOption = new Option(value); } } - - /// - /// Used to track the state of IssueDate - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option IssueDateOption { get; private set; } + [DataMember(Name = "issueAddress", EmitDefaultValue = false)] + public string IssueAddress { get; set; } /// /// The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd /// /// The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd - [JsonPropertyName("issueDate")] - public DateTime? IssueDate { get { return this.IssueDateOption; } set { this.IssueDateOption = new Option(value); } } - - /// - /// Used to track the state of Number - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NumberOption { get; private set; } + [DataMember(Name = "issueDate", EmitDefaultValue = false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime IssueDate { get; set; } /// /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("number")] - public string Number { get { return this.NumberOption; } set { this.NumberOption = new Option(value); } } + [DataMember(Name = "number", EmitDefaultValue = false)] + public string Number { get; set; } /// /// Returns the string presentation of the object @@ -103,128 +83,86 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class TicketJsonConverter : JsonConverter - { /// - /// The format to use to serialize IssueDate + /// Returns true if objects are equal /// - public static string IssueDateFormat { get; set; } = "yyyy'-'MM'-'dd"; + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Ticket); + } /// - /// Deserializes json to + /// Returns true if Ticket instances are equal /// - /// - /// - /// - /// - /// - public override Ticket Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Instance of Ticket to be compared + /// Boolean + public bool Equals(Ticket input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option issueAddress = default; - Option issueDate = default; - Option number = default; - - while (utf8JsonReader.Read()) + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "issueAddress": - issueAddress = new Option(utf8JsonReader.GetString()); - break; - case "issueDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - issueDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "number": - number = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (issueAddress.IsSet && issueAddress.Value == null) - throw new ArgumentNullException(nameof(issueAddress), "Property is not nullable for class Ticket."); - - if (issueDate.IsSet && issueDate.Value == null) - throw new ArgumentNullException(nameof(issueDate), "Property is not nullable for class Ticket."); - - if (number.IsSet && number.Value == null) - throw new ArgumentNullException(nameof(number), "Property is not nullable for class Ticket."); - - return new Ticket(issueAddress, issueDate, number); + return + ( + this.IssueAddress == input.IssueAddress || + (this.IssueAddress != null && + this.IssueAddress.Equals(input.IssueAddress)) + ) && + ( + this.IssueDate == input.IssueDate || + (this.IssueDate != null && + this.IssueDate.Equals(input.IssueDate)) + ) && + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, Ticket ticket, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, ticket, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.IssueAddress != null) + { + hashCode = (hashCode * 59) + this.IssueAddress.GetHashCode(); + } + if (this.IssueDate != null) + { + hashCode = (hashCode * 59) + this.IssueDate.GetHashCode(); + } + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, Ticket ticket, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (ticket.IssueAddressOption.IsSet && ticket.IssueAddress == null) - throw new ArgumentNullException(nameof(ticket.IssueAddress), "Property is required for class Ticket."); - - if (ticket.NumberOption.IsSet && ticket.Number == null) - throw new ArgumentNullException(nameof(ticket.Number), "Property is required for class Ticket."); - - if (ticket.IssueAddressOption.IsSet) - writer.WriteString("issueAddress", ticket.IssueAddress); - - if (ticket.IssueDateOption.IsSet) - writer.WriteString("issueDate", ticket.IssueDateOption.Value.Value.ToString(IssueDateFormat)); - - if (ticket.NumberOption.IsSet) - writer.WriteString("number", ticket.Number); + yield break; } } + } diff --git a/Adyen/Model/Checkout/TravelAgency.cs b/Adyen/Model/Checkout/TravelAgency.cs index 8841bc411..f217308e9 100644 --- a/Adyen/Model/Checkout/TravelAgency.cs +++ b/Adyen/Model/Checkout/TravelAgency.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,62 +15,47 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// TravelAgency /// - public partial class TravelAgency : IValidatableObject + [DataContract(Name = "TravelAgency")] + public partial class TravelAgency : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not start with a space or be all spaces. * Must not be all zeros. - /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonConstructor] - public TravelAgency(Option code = default, Option name = default) + /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros.. + public TravelAgency(string code = default(string), string name = default(string)) { - CodeOption = code; - NameOption = name; - OnCreated(); + this.Code = code; + this.Name = name; } - partial void OnCreated(); - - /// - /// Used to track the state of Code - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CodeOption { get; private set; } - /// /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("code")] - public string Code { get { return this.CodeOption; } set { this.CodeOption = new Option(value); } } - - /// - /// Used to track the state of Name - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option NameOption { get; private set; } + [DataMember(Name = "code", EmitDefaultValue = false)] + public string Code { get; set; } /// /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros. /// /// The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not start with a space or be all spaces. * Must not be all zeros. - [JsonPropertyName("name")] - public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } /// /// Returns the string presentation of the object @@ -86,112 +72,77 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class TravelAgencyJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override TravelAgency Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option code = default; - Option name = default; + return this.Equals(input as TravelAgency); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if TravelAgency instances are equal + /// + /// Instance of TravelAgency to be compared + /// Boolean + public bool Equals(TravelAgency input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "code": - code = new Option(utf8JsonReader.GetString()); - break; - case "name": - name = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (code.IsSet && code.Value == null) - throw new ArgumentNullException(nameof(code), "Property is not nullable for class TravelAgency."); - - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name), "Property is not nullable for class TravelAgency."); - - return new TravelAgency(code, name); + return + ( + this.Code == input.Code || + (this.Code != null && + this.Code.Equals(input.Code)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, TravelAgency travelAgency, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, travelAgency, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Code != null) + { + hashCode = (hashCode * 59) + this.Code.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, TravelAgency travelAgency, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (travelAgency.CodeOption.IsSet && travelAgency.Code == null) - throw new ArgumentNullException(nameof(travelAgency.Code), "Property is required for class TravelAgency."); - - if (travelAgency.NameOption.IsSet && travelAgency.Name == null) - throw new ArgumentNullException(nameof(travelAgency.Name), "Property is required for class TravelAgency."); - - if (travelAgency.CodeOption.IsSet) - writer.WriteString("code", travelAgency.Code); - - if (travelAgency.NameOption.IsSet) - writer.WriteString("name", travelAgency.Name); + yield break; } } + } diff --git a/Adyen/Model/Checkout/TwintDetails.cs b/Adyen/Model/Checkout/TwintDetails.cs index a3af0b06d..52c4b3e03 100644 --- a/Adyen/Model/Checkout/TwintDetails.cs +++ b/Adyen/Model/Checkout/TwintDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,164 +15,90 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// TwintDetails /// - public partial class TwintDetails : IValidatableObject + [DataContract(Name = "TwintDetails")] + public partial class TwintDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The type of flow to initiate. - /// The payment method type. - [JsonConstructor] - public TwintDetails(Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option subtype = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - SubtypeOption = subtype; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The payment method type. /// /// The payment method type. + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Twint for value: twint /// + [EnumMember(Value = "twint")] Twint = 1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("twint")) - return TypeEnum.Twint; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("twint")) - return TypeEnum.Twint; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Twint) - return "twint"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// The payment method type. /// /// The payment method type. - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The type of flow to initiate.. + /// The payment method type.. + public TwintDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string subtype = default(string), TypeEnum? type = default(TypeEnum?)) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Subtype = subtype; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of Subtype - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option SubtypeOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// The type of flow to initiate. /// /// The type of flow to initiate. - [JsonPropertyName("subtype")] - public string Subtype { get { return this.SubtypeOption; } set { this.SubtypeOption = new Option(value); } } + [DataMember(Name = "subtype", EmitDefaultValue = false)] + public string Subtype { get; set; } /// /// Returns the string presentation of the object @@ -191,156 +118,106 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class TwintDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override TwintDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option subtype = default; - Option type = default; + return this.Equals(input as TwintDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if TwintDetails instances are equal + /// + /// Instance of TwintDetails to be compared + /// Boolean + public bool Equals(TwintDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "subtype": - subtype = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(TwintDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class TwintDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class TwintDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class TwintDetails."); - - if (subtype.IsSet && subtype.Value == null) - throw new ArgumentNullException(nameof(subtype), "Property is not nullable for class TwintDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class TwintDetails."); - - return new TwintDetails(checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, subtype, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Subtype == input.Subtype || + (this.Subtype != null && + this.Subtype.Equals(input.Subtype)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, TwintDetails twintDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, twintDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.Subtype != null) + { + hashCode = (hashCode * 59) + this.Subtype.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, TwintDetails twintDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (twintDetails.CheckoutAttemptIdOption.IsSet && twintDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(twintDetails.CheckoutAttemptId), "Property is required for class TwintDetails."); - - if (twintDetails.RecurringDetailReferenceOption.IsSet && twintDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(twintDetails.RecurringDetailReference), "Property is required for class TwintDetails."); - - if (twintDetails.StoredPaymentMethodIdOption.IsSet && twintDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(twintDetails.StoredPaymentMethodId), "Property is required for class TwintDetails."); - - if (twintDetails.SubtypeOption.IsSet && twintDetails.Subtype == null) - throw new ArgumentNullException(nameof(twintDetails.Subtype), "Property is required for class TwintDetails."); - - if (twintDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", twintDetails.CheckoutAttemptId); - - if (twintDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", twintDetails.RecurringDetailReference); - - if (twintDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", twintDetails.StoredPaymentMethodId); - - if (twintDetails.SubtypeOption.IsSet) - writer.WriteString("subtype", twintDetails.Subtype); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = TwintDetails.TypeEnumToJsonValue(twintDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs b/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs index 9a2612ab0..260214207 100644 --- a/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs +++ b/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,93 +15,59 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// UpdatePaymentLinkRequest /// - public partial class UpdatePaymentLinkRequest : IValidatableObject + [DataContract(Name = "UpdatePaymentLinkRequest")] + public partial class UpdatePaymentLinkRequest : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// Status of the payment link. Possible values: * **expired** - [JsonConstructor] - public UpdatePaymentLinkRequest(StatusEnum status) - { - Status = status; - OnCreated(); - } - - partial void OnCreated(); - /// /// Status of the payment link. Possible values: * **expired** /// /// Status of the payment link. Possible values: * **expired** + [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { /// /// Enum Expired for value: expired /// + [EnumMember(Value = "expired")] Expired = 1 + } + /// - /// Returns a + /// Status of the payment link. Possible values: * **expired** /// - /// - /// - /// - public static StatusEnum StatusEnumFromString(string value) - { - if (value.Equals("expired")) - return StatusEnum.Expired; - - throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); - } - + /// Status of the payment link. Possible values: * **expired** + [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] + public StatusEnum Status { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static StatusEnum? StatusEnumFromStringOrDefault(string value) - { - if (value.Equals("expired")) - return StatusEnum.Expired; - - return null; - } - + [JsonConstructorAttribute] + protected UpdatePaymentLinkRequest() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string StatusEnumToJsonValue(StatusEnum value) + /// Status of the payment link. Possible values: * **expired** (required). + public UpdatePaymentLinkRequest(StatusEnum status = default(StatusEnum)) { - if (value == StatusEnum.Expired) - return "expired"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.Status = status; } - /// - /// Status of the payment link. Possible values: * **expired** - /// - /// Status of the payment link. Possible values: * **expired** - [JsonPropertyName("status")] - public StatusEnum Status { get; set; } - /// /// Returns the string presentation of the object /// @@ -115,101 +82,64 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class UpdatePaymentLinkRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override UpdatePaymentLinkRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option status = default; + return this.Equals(input as UpdatePaymentLinkRequest); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if UpdatePaymentLinkRequest instances are equal + /// + /// Instance of UpdatePaymentLinkRequest to be compared + /// Boolean + public bool Equals(UpdatePaymentLinkRequest input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "status": - string statusRawValue = utf8JsonReader.GetString(); - if (statusRawValue != null) - status = new Option(UpdatePaymentLinkRequest.StatusEnumFromStringOrDefault(statusRawValue)); - break; - default: - break; - } - } + return false; } - - if (!status.IsSet) - throw new ArgumentException("Property is required for class UpdatePaymentLinkRequest.", nameof(status)); - - if (status.IsSet && status.Value == null) - throw new ArgumentNullException(nameof(status), "Property is not nullable for class UpdatePaymentLinkRequest."); - - return new UpdatePaymentLinkRequest(status.Value.Value); + return + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, UpdatePaymentLinkRequest updatePaymentLinkRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, updatePaymentLinkRequest, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, UpdatePaymentLinkRequest updatePaymentLinkRequest, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - var statusRawValue = UpdatePaymentLinkRequest.StatusEnumToJsonValue(updatePaymentLinkRequest.Status); - writer.WriteString("status", statusRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/UpiCollectDetails.cs b/Adyen/Model/Checkout/UpiCollectDetails.cs index 48c635043..e8839f31a 100644 --- a/Adyen/Model/Checkout/UpiCollectDetails.cs +++ b/Adyen/Model/Checkout/UpiCollectDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,182 +15,113 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// UpiCollectDetails /// - public partial class UpiCollectDetails : IValidatableObject + [DataContract(Name = "UpiCollectDetails")] + public partial class UpiCollectDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The sequence number for the debit. For example, send **2** if this is the second debit for the subscription. The sequence number is included in the notification sent to the shopper. - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **upi_collect** (default to TypeEnum.UpiCollect) - /// The virtual payment address for UPI. - [JsonConstructor] - public UpiCollectDetails(string billingSequenceNumber, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option shopperNotificationReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.UpiCollect, Option virtualPaymentAddress = default) - { - BillingSequenceNumber = billingSequenceNumber; - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - ShopperNotificationReferenceOption = shopperNotificationReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - Type = type; - VirtualPaymentAddressOption = virtualPaymentAddress; - OnCreated(); - } - - partial void OnCreated(); - /// /// **upi_collect** /// /// **upi_collect** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum UpiCollect for value: upi_collect /// + [EnumMember(Value = "upi_collect")] UpiCollect = 1 + } + /// - /// Returns a + /// **upi_collect** /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("upi_collect")) - return TypeEnum.UpiCollect; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - + /// **upi_collect** + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + public TypeEnum Type { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("upi_collect")) - return TypeEnum.UpiCollect; - - return null; - } - + [JsonConstructorAttribute] + protected UpiCollectDetails() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) + /// The sequence number for the debit. For example, send **2** if this is the second debit for the subscription. The sequence number is included in the notification sent to the shopper. (required). + /// The checkout attempt identifier.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **upi_collect** (required) (default to TypeEnum.UpiCollect). + /// The virtual payment address for UPI.. + public UpiCollectDetails(string billingSequenceNumber = default(string), string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string shopperNotificationReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.UpiCollect, string virtualPaymentAddress = default(string)) { - if (value == TypeEnum.UpiCollect) - return "upi_collect"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.BillingSequenceNumber = billingSequenceNumber; + this.Type = type; + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.ShopperNotificationReference = shopperNotificationReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.VirtualPaymentAddress = virtualPaymentAddress; } - /// - /// **upi_collect** - /// - /// **upi_collect** - [JsonPropertyName("type")] - public TypeEnum Type { get; set; } - /// /// The sequence number for the debit. For example, send **2** if this is the second debit for the subscription. The sequence number is included in the notification sent to the shopper. /// /// The sequence number for the debit. For example, send **2** if this is the second debit for the subscription. The sequence number is included in the notification sent to the shopper. - [JsonPropertyName("billingSequenceNumber")] + [DataMember(Name = "billingSequenceNumber", IsRequired = false, EmitDefaultValue = false)] public string BillingSequenceNumber { get; set; } - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperNotificationReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNotificationReferenceOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. - [JsonPropertyName("shopperNotificationReference")] - public string ShopperNotificationReference { get { return this.ShopperNotificationReferenceOption; } set { this.ShopperNotificationReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "shopperNotificationReference", EmitDefaultValue = false)] + public string ShopperNotificationReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } - - /// - /// Used to track the state of VirtualPaymentAddress - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option VirtualPaymentAddressOption { get; private set; } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// The virtual payment address for UPI. /// /// The virtual payment address for UPI. - [JsonPropertyName("virtualPaymentAddress")] - public string VirtualPaymentAddress { get { return this.VirtualPaymentAddressOption; } set { this.VirtualPaymentAddressOption = new Option(value); } } + [DataMember(Name = "virtualPaymentAddress", EmitDefaultValue = false)] + public string VirtualPaymentAddress { get; set; } /// /// Returns the string presentation of the object @@ -211,186 +143,124 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class UpiCollectDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override UpiCollectDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option billingSequenceNumber = default; - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option shopperNotificationReference = default; - Option storedPaymentMethodId = default; - Option type = default; - Option virtualPaymentAddress = default; + return this.Equals(input as UpiCollectDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if UpiCollectDetails instances are equal + /// + /// Instance of UpiCollectDetails to be compared + /// Boolean + public bool Equals(UpiCollectDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "billingSequenceNumber": - billingSequenceNumber = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "shopperNotificationReference": - shopperNotificationReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(UpiCollectDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - case "virtualPaymentAddress": - virtualPaymentAddress = new Option(utf8JsonReader.GetString()); - break; - default: - break; - } - } + return false; } - - if (!billingSequenceNumber.IsSet) - throw new ArgumentException("Property is required for class UpiCollectDetails.", nameof(billingSequenceNumber)); - - if (!type.IsSet) - throw new ArgumentException("Property is required for class UpiCollectDetails.", nameof(type)); - - if (billingSequenceNumber.IsSet && billingSequenceNumber.Value == null) - throw new ArgumentNullException(nameof(billingSequenceNumber), "Property is not nullable for class UpiCollectDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class UpiCollectDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class UpiCollectDetails."); - - if (shopperNotificationReference.IsSet && shopperNotificationReference.Value == null) - throw new ArgumentNullException(nameof(shopperNotificationReference), "Property is not nullable for class UpiCollectDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class UpiCollectDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class UpiCollectDetails."); - - if (virtualPaymentAddress.IsSet && virtualPaymentAddress.Value == null) - throw new ArgumentNullException(nameof(virtualPaymentAddress), "Property is not nullable for class UpiCollectDetails."); - - return new UpiCollectDetails(billingSequenceNumber.Value, checkoutAttemptId, recurringDetailReference, shopperNotificationReference, storedPaymentMethodId, type.Value.Value, virtualPaymentAddress); + return + ( + this.BillingSequenceNumber == input.BillingSequenceNumber || + (this.BillingSequenceNumber != null && + this.BillingSequenceNumber.Equals(input.BillingSequenceNumber)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.ShopperNotificationReference == input.ShopperNotificationReference || + (this.ShopperNotificationReference != null && + this.ShopperNotificationReference.Equals(input.ShopperNotificationReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this.VirtualPaymentAddress == input.VirtualPaymentAddress || + (this.VirtualPaymentAddress != null && + this.VirtualPaymentAddress.Equals(input.VirtualPaymentAddress)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, UpiCollectDetails upiCollectDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, upiCollectDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.BillingSequenceNumber != null) + { + hashCode = (hashCode * 59) + this.BillingSequenceNumber.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.ShopperNotificationReference != null) + { + hashCode = (hashCode * 59) + this.ShopperNotificationReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.VirtualPaymentAddress != null) + { + hashCode = (hashCode * 59) + this.VirtualPaymentAddress.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, UpiCollectDetails upiCollectDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (upiCollectDetails.BillingSequenceNumber == null) - throw new ArgumentNullException(nameof(upiCollectDetails.BillingSequenceNumber), "Property is required for class UpiCollectDetails."); - - if (upiCollectDetails.CheckoutAttemptIdOption.IsSet && upiCollectDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(upiCollectDetails.CheckoutAttemptId), "Property is required for class UpiCollectDetails."); - - if (upiCollectDetails.RecurringDetailReferenceOption.IsSet && upiCollectDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(upiCollectDetails.RecurringDetailReference), "Property is required for class UpiCollectDetails."); - - if (upiCollectDetails.ShopperNotificationReferenceOption.IsSet && upiCollectDetails.ShopperNotificationReference == null) - throw new ArgumentNullException(nameof(upiCollectDetails.ShopperNotificationReference), "Property is required for class UpiCollectDetails."); - - if (upiCollectDetails.StoredPaymentMethodIdOption.IsSet && upiCollectDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(upiCollectDetails.StoredPaymentMethodId), "Property is required for class UpiCollectDetails."); - - if (upiCollectDetails.VirtualPaymentAddressOption.IsSet && upiCollectDetails.VirtualPaymentAddress == null) - throw new ArgumentNullException(nameof(upiCollectDetails.VirtualPaymentAddress), "Property is required for class UpiCollectDetails."); - - writer.WriteString("billingSequenceNumber", upiCollectDetails.BillingSequenceNumber); - - if (upiCollectDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", upiCollectDetails.CheckoutAttemptId); - - if (upiCollectDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", upiCollectDetails.RecurringDetailReference); - - if (upiCollectDetails.ShopperNotificationReferenceOption.IsSet) - writer.WriteString("shopperNotificationReference", upiCollectDetails.ShopperNotificationReference); - - if (upiCollectDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", upiCollectDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = UpiCollectDetails.TypeEnumToJsonValue(upiCollectDetails.Type); - writer.WriteString("type", typeRawValue); - if (upiCollectDetails.VirtualPaymentAddressOption.IsSet) - writer.WriteString("virtualPaymentAddress", upiCollectDetails.VirtualPaymentAddress); + yield break; } } + } diff --git a/Adyen/Model/Checkout/UpiIntentDetails.cs b/Adyen/Model/Checkout/UpiIntentDetails.cs index ff9622873..d8c015a59 100644 --- a/Adyen/Model/Checkout/UpiIntentDetails.cs +++ b/Adyen/Model/Checkout/UpiIntentDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,173 +15,104 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// UpiIntentDetails /// - public partial class UpiIntentDetails : IValidatableObject + [DataContract(Name = "UpiIntentDetails")] + public partial class UpiIntentDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// TPAP (Third Party Application) Id that is being used to make the UPI payment - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **upi_intent** (default to TypeEnum.UpiIntent) - [JsonConstructor] - public UpiIntentDetails(Option appId = default, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option shopperNotificationReference = default, Option storedPaymentMethodId = default, TypeEnum type = TypeEnum.UpiIntent) - { - AppIdOption = appId; - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - ShopperNotificationReferenceOption = shopperNotificationReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - Type = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **upi_intent** /// /// **upi_intent** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum UpiIntent for value: upi_intent /// + [EnumMember(Value = "upi_intent")] UpiIntent = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("upi_intent")) - return TypeEnum.UpiIntent; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("upi_intent")) - return TypeEnum.UpiIntent; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum value) - { - if (value == TypeEnum.UpiIntent) - return "upi_intent"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } /// /// **upi_intent** /// /// **upi_intent** - [JsonPropertyName("type")] + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } - /// - /// Used to track the state of AppId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AppIdOption { get; private set; } - + [JsonConstructorAttribute] + protected UpiIntentDetails() { } /// - /// TPAP (Third Party Application) Id that is being used to make the UPI payment + /// Initializes a new instance of the class. /// - /// TPAP (Third Party Application) Id that is being used to make the UPI payment - [JsonPropertyName("appId")] - public string AppId { get { return this.AppIdOption; } set { this.AppIdOption = new Option(value); } } + /// TPAP (Third Party Application) Id that is being used to make the UPI payment. + /// The checkout attempt identifier.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **upi_intent** (required) (default to TypeEnum.UpiIntent). + public UpiIntentDetails(string appId = default(string), string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string shopperNotificationReference = default(string), string storedPaymentMethodId = default(string), TypeEnum type = TypeEnum.UpiIntent) + { + this.Type = type; + this.AppId = appId; + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.ShopperNotificationReference = shopperNotificationReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + } /// - /// Used to track the state of CheckoutAttemptId + /// TPAP (Third Party Application) Id that is being used to make the UPI payment /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// TPAP (Third Party Application) Id that is being used to make the UPI payment + [DataMember(Name = "appId", EmitDefaultValue = false)] + public string AppId { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of ShopperNotificationReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ShopperNotificationReferenceOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. /// /// The `shopperNotificationReference` returned in the response when you requested to notify the shopper. Used for recurring payment only. - [JsonPropertyName("shopperNotificationReference")] - public string ShopperNotificationReference { get { return this.ShopperNotificationReferenceOption; } set { this.ShopperNotificationReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "shopperNotificationReference", EmitDefaultValue = false)] + public string ShopperNotificationReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -201,172 +133,115 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class UpiIntentDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override UpiIntentDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option appId = default; - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option shopperNotificationReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as UpiIntentDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if UpiIntentDetails instances are equal + /// + /// Instance of UpiIntentDetails to be compared + /// Boolean + public bool Equals(UpiIntentDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "appId": - appId = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "shopperNotificationReference": - shopperNotificationReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(UpiIntentDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!type.IsSet) - throw new ArgumentException("Property is required for class UpiIntentDetails.", nameof(type)); - - if (appId.IsSet && appId.Value == null) - throw new ArgumentNullException(nameof(appId), "Property is not nullable for class UpiIntentDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class UpiIntentDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class UpiIntentDetails."); - - if (shopperNotificationReference.IsSet && shopperNotificationReference.Value == null) - throw new ArgumentNullException(nameof(shopperNotificationReference), "Property is not nullable for class UpiIntentDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class UpiIntentDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class UpiIntentDetails."); - - return new UpiIntentDetails(appId, checkoutAttemptId, recurringDetailReference, shopperNotificationReference, storedPaymentMethodId, type.Value.Value); + return + ( + this.AppId == input.AppId || + (this.AppId != null && + this.AppId.Equals(input.AppId)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.ShopperNotificationReference == input.ShopperNotificationReference || + (this.ShopperNotificationReference != null && + this.ShopperNotificationReference.Equals(input.ShopperNotificationReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, UpiIntentDetails upiIntentDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, upiIntentDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AppId != null) + { + hashCode = (hashCode * 59) + this.AppId.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.ShopperNotificationReference != null) + { + hashCode = (hashCode * 59) + this.ShopperNotificationReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, UpiIntentDetails upiIntentDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (upiIntentDetails.AppIdOption.IsSet && upiIntentDetails.AppId == null) - throw new ArgumentNullException(nameof(upiIntentDetails.AppId), "Property is required for class UpiIntentDetails."); - - if (upiIntentDetails.CheckoutAttemptIdOption.IsSet && upiIntentDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(upiIntentDetails.CheckoutAttemptId), "Property is required for class UpiIntentDetails."); - - if (upiIntentDetails.RecurringDetailReferenceOption.IsSet && upiIntentDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(upiIntentDetails.RecurringDetailReference), "Property is required for class UpiIntentDetails."); - - if (upiIntentDetails.ShopperNotificationReferenceOption.IsSet && upiIntentDetails.ShopperNotificationReference == null) - throw new ArgumentNullException(nameof(upiIntentDetails.ShopperNotificationReference), "Property is required for class UpiIntentDetails."); - - if (upiIntentDetails.StoredPaymentMethodIdOption.IsSet && upiIntentDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(upiIntentDetails.StoredPaymentMethodId), "Property is required for class UpiIntentDetails."); - - if (upiIntentDetails.AppIdOption.IsSet) - writer.WriteString("appId", upiIntentDetails.AppId); - - if (upiIntentDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", upiIntentDetails.CheckoutAttemptId); - - if (upiIntentDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", upiIntentDetails.RecurringDetailReference); - - if (upiIntentDetails.ShopperNotificationReferenceOption.IsSet) - writer.WriteString("shopperNotificationReference", upiIntentDetails.ShopperNotificationReference); - - if (upiIntentDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", upiIntentDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = UpiIntentDetails.TypeEnumToJsonValue(upiIntentDetails.Type); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/UtilityRequest.cs b/Adyen/Model/Checkout/UtilityRequest.cs index be210b84f..8c95957c0 100644 --- a/Adyen/Model/Checkout/UtilityRequest.cs +++ b/Adyen/Model/Checkout/UtilityRequest.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,38 +15,42 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// UtilityRequest /// - public partial class UtilityRequest : IValidatableObject + [DataContract(Name = "UtilityRequest")] + public partial class UtilityRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The list of origin domains, for which origin keys are requested. - [JsonConstructor] - public UtilityRequest(List originDomains) + [JsonConstructorAttribute] + protected UtilityRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// The list of origin domains, for which origin keys are requested. (required). + public UtilityRequest(List originDomains = default(List)) { - OriginDomains = originDomains; - OnCreated(); + this.OriginDomains = originDomains; } - partial void OnCreated(); - /// /// The list of origin domains, for which origin keys are requested. /// /// The list of origin domains, for which origin keys are requested. - [JsonPropertyName("originDomains")] + [DataMember(Name = "originDomains", IsRequired = false, EmitDefaultValue = false)] public List OriginDomains { get; set; } /// @@ -62,103 +67,69 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class UtilityRequestJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override UtilityRequest Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option> originDomains = default; + return this.Equals(input as UtilityRequest); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if UtilityRequest instances are equal + /// + /// Instance of UtilityRequest to be compared + /// Boolean + public bool Equals(UtilityRequest input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "originDomains": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - originDomains = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } + return false; } - - if (!originDomains.IsSet) - throw new ArgumentException("Property is required for class UtilityRequest.", nameof(originDomains)); - - if (originDomains.IsSet && originDomains.Value == null) - throw new ArgumentNullException(nameof(originDomains), "Property is not nullable for class UtilityRequest."); - - return new UtilityRequest(originDomains.Value); + return + ( + this.OriginDomains == input.OriginDomains || + this.OriginDomains != null && + input.OriginDomains != null && + this.OriginDomains.SequenceEqual(input.OriginDomains) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, UtilityRequest utilityRequest, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, utilityRequest, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.OriginDomains != null) + { + hashCode = (hashCode * 59) + this.OriginDomains.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, UtilityRequest utilityRequest, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (utilityRequest.OriginDomains == null) - throw new ArgumentNullException(nameof(utilityRequest.OriginDomains), "Property is required for class UtilityRequest."); - - writer.WritePropertyName("originDomains"); - JsonSerializer.Serialize(writer, utilityRequest.OriginDomains, jsonSerializerOptions); + yield break; } } + } diff --git a/Adyen/Model/Checkout/UtilityResponse.cs b/Adyen/Model/Checkout/UtilityResponse.cs index c3a3439ea..4006a5c86 100644 --- a/Adyen/Model/Checkout/UtilityResponse.cs +++ b/Adyen/Model/Checkout/UtilityResponse.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,46 +15,38 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// UtilityResponse /// - public partial class UtilityResponse : IValidatableObject + [DataContract(Name = "UtilityResponse")] + public partial class UtilityResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key. - [JsonConstructor] - public UtilityResponse(Option> originKeys = default) + /// The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key.. + public UtilityResponse(Dictionary originKeys = default(Dictionary)) { - OriginKeysOption = originKeys; - OnCreated(); + this.OriginKeys = originKeys; } - partial void OnCreated(); - - /// - /// Used to track the state of OriginKeys - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option> OriginKeysOption { get; private set; } - /// /// The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key. /// /// The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key. - [JsonPropertyName("originKeys")] - public Dictionary OriginKeys { get { return this.OriginKeysOption; } set { this.OriginKeysOption = new Option>(value); } } + [DataMember(Name = "originKeys", EmitDefaultValue = false)] + public Dictionary OriginKeys { get; set; } /// /// Returns the string presentation of the object @@ -69,103 +62,69 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class UtilityResponseJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override UtilityResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option> originKeys = default; - - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "originKeys": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - originKeys = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } - } - } - - if (originKeys.IsSet && originKeys.Value == null) - throw new ArgumentNullException(nameof(originKeys), "Property is not nullable for class UtilityResponse."); - - return new UtilityResponse(originKeys); + return this.Equals(input as UtilityResponse); } /// - /// Serializes a + /// Returns true if UtilityResponse instances are equal /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, UtilityResponse utilityResponse, JsonSerializerOptions jsonSerializerOptions) + /// Instance of UtilityResponse to be compared + /// Boolean + public bool Equals(UtilityResponse input) { - writer.WriteStartObject(); - - WriteProperties(writer, utilityResponse, jsonSerializerOptions); - writer.WriteEndObject(); + if (input == null) + { + return false; + } + return + ( + this.OriginKeys == input.OriginKeys || + this.OriginKeys != null && + input.OriginKeys != null && + this.OriginKeys.SequenceEqual(input.OriginKeys) + ); } /// - /// Serializes the properties of + /// Gets the hash code /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, UtilityResponse utilityResponse, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - if (utilityResponse.OriginKeysOption.IsSet && utilityResponse.OriginKeys == null) - throw new ArgumentNullException(nameof(utilityResponse.OriginKeys), "Property is required for class UtilityResponse."); - - if (utilityResponse.OriginKeysOption.IsSet) + unchecked // Overflow is fine, just wrap { - writer.WritePropertyName("originKeys"); - JsonSerializer.Serialize(writer, utilityResponse.OriginKeys, jsonSerializerOptions); + int hashCode = 41; + if (this.OriginKeys != null) + { + hashCode = (hashCode * 59) + this.OriginKeys.GetHashCode(); + } + return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } } + } diff --git a/Adyen/Model/Checkout/VippsDetails.cs b/Adyen/Model/Checkout/VippsDetails.cs index ac844bd0c..f3d88f6ba 100644 --- a/Adyen/Model/Checkout/VippsDetails.cs +++ b/Adyen/Model/Checkout/VippsDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,156 +15,94 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// VippsDetails /// - public partial class VippsDetails : IValidatableObject + [DataContract(Name = "VippsDetails")] + public partial class VippsDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// telephoneNumber - /// The checkout attempt identifier. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **vipps** (default to TypeEnum.Vipps) - [JsonConstructor] - public VippsDetails(string telephoneNumber, Option checkoutAttemptId = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - TelephoneNumber = telephoneNumber; - CheckoutAttemptIdOption = checkoutAttemptId; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **vipps** /// /// **vipps** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Vipps for value: vipps /// + [EnumMember(Value = "vipps")] Vipps = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("vipps")) - return TypeEnum.Vipps; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("vipps")) - return TypeEnum.Vipps; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Vipps) - return "vipps"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **vipps** /// /// **vipps** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Gets or Sets TelephoneNumber + /// Initializes a new instance of the class. /// - [JsonPropertyName("telephoneNumber")] - public string TelephoneNumber { get; set; } - + [JsonConstructorAttribute] + protected VippsDetails() { } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// telephoneNumber (required). + /// **vipps** (default to TypeEnum.Vipps). + public VippsDetails(string checkoutAttemptId = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), string telephoneNumber = default(string), TypeEnum? type = TypeEnum.Vipps) + { + this.TelephoneNumber = telephoneNumber; + this.CheckoutAttemptId = checkoutAttemptId; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// - /// Used to track the state of StoredPaymentMethodId + /// This is the `recurringDetailReference` returned in the response when you created the token. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + /// This is the `recurringDetailReference` returned in the response when you created the token. + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// - /// This is the `recurringDetailReference` returned in the response when you created the token. + /// Gets or Sets TelephoneNumber /// - /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "telephoneNumber", IsRequired = false, EmitDefaultValue = false)] + public string TelephoneNumber { get; set; } /// /// Returns the string presentation of the object @@ -173,168 +112,116 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class VippsDetails {\n"); - sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); + sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class VippsDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override VippsDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option telephoneNumber = default; - Option checkoutAttemptId = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as VippsDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if VippsDetails instances are equal + /// + /// Instance of VippsDetails to be compared + /// Boolean + public bool Equals(VippsDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "telephoneNumber": - telephoneNumber = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(VippsDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!telephoneNumber.IsSet) - throw new ArgumentException("Property is required for class VippsDetails.", nameof(telephoneNumber)); - - if (telephoneNumber.IsSet && telephoneNumber.Value == null) - throw new ArgumentNullException(nameof(telephoneNumber), "Property is not nullable for class VippsDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class VippsDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class VippsDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class VippsDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class VippsDetails."); - - return new VippsDetails(telephoneNumber.Value, checkoutAttemptId, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + (this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, VippsDetails vippsDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, vippsDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + if (this.TelephoneNumber != null) + { + hashCode = (hashCode * 59) + this.TelephoneNumber.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, VippsDetails vippsDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (vippsDetails.TelephoneNumber == null) - throw new ArgumentNullException(nameof(vippsDetails.TelephoneNumber), "Property is required for class VippsDetails."); - - if (vippsDetails.CheckoutAttemptIdOption.IsSet && vippsDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(vippsDetails.CheckoutAttemptId), "Property is required for class VippsDetails."); - - if (vippsDetails.RecurringDetailReferenceOption.IsSet && vippsDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(vippsDetails.RecurringDetailReference), "Property is required for class VippsDetails."); - - if (vippsDetails.StoredPaymentMethodIdOption.IsSet && vippsDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(vippsDetails.StoredPaymentMethodId), "Property is required for class VippsDetails."); - - writer.WriteString("telephoneNumber", vippsDetails.TelephoneNumber); - - if (vippsDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", vippsDetails.CheckoutAttemptId); - - if (vippsDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", vippsDetails.RecurringDetailReference); - - if (vippsDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", vippsDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = VippsDetails.TypeEnumToJsonValue(vippsDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/VisaCheckoutDetails.cs b/Adyen/Model/Checkout/VisaCheckoutDetails.cs index d3ed8913a..e51dd8658 100644 --- a/Adyen/Model/Checkout/VisaCheckoutDetails.cs +++ b/Adyen/Model/Checkout/VisaCheckoutDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,208 +15,107 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// VisaCheckoutDetails /// - public partial class VisaCheckoutDetails : IValidatableObject + [DataContract(Name = "VisaCheckoutDetails")] + public partial class VisaCheckoutDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The Visa Click to Pay Call ID value. When your shopper selects a payment and/or a shipping address from Visa Click to Pay, you will receive a Visa Click to Pay Call ID. - /// The checkout attempt identifier. - /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - /// **visacheckout** (default to TypeEnum.Visacheckout) - [JsonConstructor] - public VisaCheckoutDetails(string visaCheckoutCallId, Option checkoutAttemptId = default, Option fundingSource = default, Option type = default) - { - VisaCheckoutCallId = visaCheckoutCallId; - CheckoutAttemptIdOption = checkoutAttemptId; - FundingSourceOption = fundingSource; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. + [JsonConverter(typeof(StringEnumConverter))] public enum FundingSourceEnum { /// /// Enum Credit for value: credit /// + [EnumMember(Value = "credit")] Credit = 1, /// /// Enum Debit for value: debit /// + [EnumMember(Value = "debit")] Debit = 2 - } - /// - /// Returns a - /// - /// - /// - /// - public static FundingSourceEnum FundingSourceEnumFromString(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - throw new NotImplementedException($"Could not convert value to type FundingSourceEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static FundingSourceEnum? FundingSourceEnumFromStringOrDefault(string value) - { - if (value.Equals("credit")) - return FundingSourceEnum.Credit; - - if (value.Equals("debit")) - return FundingSourceEnum.Debit; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string FundingSourceEnumToJsonValue(FundingSourceEnum? value) - { - if (value == FundingSourceEnum.Credit) - return "credit"; - - if (value == FundingSourceEnum.Debit) - return "debit"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of FundingSource - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option FundingSourceOption { get; private set; } /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. /// /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**. - [JsonPropertyName("fundingSource")] - public FundingSourceEnum? FundingSource { get { return this.FundingSourceOption; } set { this.FundingSourceOption = new Option(value); } } - + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } /// /// **visacheckout** /// /// **visacheckout** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Visacheckout for value: visacheckout /// + [EnumMember(Value = "visacheckout")] Visacheckout = 1 + } + /// - /// Returns a + /// **visacheckout** /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("visacheckout")) - return TypeEnum.Visacheckout; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); - } - + /// **visacheckout** + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Returns a + /// Initializes a new instance of the class. /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("visacheckout")) - return TypeEnum.Visacheckout; - - return null; - } - + [JsonConstructorAttribute] + protected VisaCheckoutDetails() { } /// - /// Converts the to the json value + /// Initializes a new instance of the class. /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) + /// The checkout attempt identifier.. + /// The funding source that should be used when multiple sources are available. For Brazilian combo cards, by default the funding source is credit. To use debit, set this value to **debit**.. + /// **visacheckout** (default to TypeEnum.Visacheckout). + /// The Visa Click to Pay Call ID value. When your shopper selects a payment and/or a shipping address from Visa Click to Pay, you will receive a Visa Click to Pay Call ID. (required). + public VisaCheckoutDetails(string checkoutAttemptId = default(string), FundingSourceEnum? fundingSource = default(FundingSourceEnum?), TypeEnum? type = TypeEnum.Visacheckout, string visaCheckoutCallId = default(string)) { - if (value == TypeEnum.Visacheckout) - return "visacheckout"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); + this.VisaCheckoutCallId = visaCheckoutCallId; + this.CheckoutAttemptId = checkoutAttemptId; + this.FundingSource = fundingSource; + this.Type = type; } /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } - - /// - /// **visacheckout** + /// The checkout attempt identifier. /// - /// **visacheckout** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + /// The checkout attempt identifier. + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// The Visa Click to Pay Call ID value. When your shopper selects a payment and/or a shipping address from Visa Click to Pay, you will receive a Visa Click to Pay Call ID. /// /// The Visa Click to Pay Call ID value. When your shopper selects a payment and/or a shipping address from Visa Click to Pay, you will receive a Visa Click to Pay Call ID. - [JsonPropertyName("visaCheckoutCallId")] + [DataMember(Name = "visaCheckoutCallId", IsRequired = false, EmitDefaultValue = false)] public string VisaCheckoutCallId { get; set; } - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } - - /// - /// The checkout attempt identifier. - /// - /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - /// /// Returns the string presentation of the object /// @@ -224,146 +124,96 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class VisaCheckoutDetails {\n"); - sb.Append(" VisaCheckoutCallId: ").Append(VisaCheckoutCallId).Append("\n"); sb.Append(" CheckoutAttemptId: ").Append(CheckoutAttemptId).Append("\n"); sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" VisaCheckoutCallId: ").Append(VisaCheckoutCallId).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class VisaCheckoutDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override VisaCheckoutDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option visaCheckoutCallId = default; - Option checkoutAttemptId = default; - Option fundingSource = default; - Option type = default; + return this.Equals(input as VisaCheckoutDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if VisaCheckoutDetails instances are equal + /// + /// Instance of VisaCheckoutDetails to be compared + /// Boolean + public bool Equals(VisaCheckoutDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "visaCheckoutCallId": - visaCheckoutCallId = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "fundingSource": - string fundingSourceRawValue = utf8JsonReader.GetString(); - if (fundingSourceRawValue != null) - fundingSource = new Option(VisaCheckoutDetails.FundingSourceEnumFromStringOrDefault(fundingSourceRawValue)); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(VisaCheckoutDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (!visaCheckoutCallId.IsSet) - throw new ArgumentException("Property is required for class VisaCheckoutDetails.", nameof(visaCheckoutCallId)); - - if (visaCheckoutCallId.IsSet && visaCheckoutCallId.Value == null) - throw new ArgumentNullException(nameof(visaCheckoutCallId), "Property is not nullable for class VisaCheckoutDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class VisaCheckoutDetails."); - - if (fundingSource.IsSet && fundingSource.Value == null) - throw new ArgumentNullException(nameof(fundingSource), "Property is not nullable for class VisaCheckoutDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class VisaCheckoutDetails."); - - return new VisaCheckoutDetails(visaCheckoutCallId.Value, checkoutAttemptId, fundingSource, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource.Equals(input.FundingSource) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this.VisaCheckoutCallId == input.VisaCheckoutCallId || + (this.VisaCheckoutCallId != null && + this.VisaCheckoutCallId.Equals(input.VisaCheckoutCallId)) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, VisaCheckoutDetails visaCheckoutDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, visaCheckoutDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.FundingSource.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.VisaCheckoutCallId != null) + { + hashCode = (hashCode * 59) + this.VisaCheckoutCallId.GetHashCode(); + } + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, VisaCheckoutDetails visaCheckoutDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (visaCheckoutDetails.VisaCheckoutCallId == null) - throw new ArgumentNullException(nameof(visaCheckoutDetails.VisaCheckoutCallId), "Property is required for class VisaCheckoutDetails."); - - if (visaCheckoutDetails.CheckoutAttemptIdOption.IsSet && visaCheckoutDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(visaCheckoutDetails.CheckoutAttemptId), "Property is required for class VisaCheckoutDetails."); - - writer.WriteString("visaCheckoutCallId", visaCheckoutDetails.VisaCheckoutCallId); - - if (visaCheckoutDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", visaCheckoutDetails.CheckoutAttemptId); - - var fundingSourceRawValue = VisaCheckoutDetails.FundingSourceEnumToJsonValue(visaCheckoutDetails.FundingSourceOption.Value.Value); - writer.WriteString("fundingSource", fundingSourceRawValue); - var typeRawValue = VisaCheckoutDetails.TypeEnumToJsonValue(visaCheckoutDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/WeChatPayDetails.cs b/Adyen/Model/Checkout/WeChatPayDetails.cs index dd382d819..ef5b1aafb 100644 --- a/Adyen/Model/Checkout/WeChatPayDetails.cs +++ b/Adyen/Model/Checkout/WeChatPayDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,129 +15,68 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// WeChatPayDetails /// - public partial class WeChatPayDetails : IValidatableObject + [DataContract(Name = "WeChatPayDetails")] + public partial class WeChatPayDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// **wechatpay** (default to TypeEnum.Wechatpay) - [JsonConstructor] - public WeChatPayDetails(Option checkoutAttemptId = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **wechatpay** /// /// **wechatpay** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Wechatpay for value: wechatpay /// + [EnumMember(Value = "wechatpay")] Wechatpay = 1, /// /// Enum WechatpayPos for value: wechatpay_pos /// + [EnumMember(Value = "wechatpay_pos")] WechatpayPos = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("wechatpay")) - return TypeEnum.Wechatpay; - if (value.Equals("wechatpay_pos")) - return TypeEnum.WechatpayPos; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("wechatpay")) - return TypeEnum.Wechatpay; - - if (value.Equals("wechatpay_pos")) - return TypeEnum.WechatpayPos; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Wechatpay) - return "wechatpay"; - - if (value == TypeEnum.WechatpayPos) - return "wechatpay_pos"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **wechatpay** /// /// **wechatpay** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// **wechatpay** (default to TypeEnum.Wechatpay). + public WeChatPayDetails(string checkoutAttemptId = default(string), TypeEnum? type = TypeEnum.Wechatpay) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Returns the string presentation of the object @@ -153,111 +93,73 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class WeChatPayDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override WeChatPayDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option type = default; + return this.Equals(input as WeChatPayDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if WeChatPayDetails instances are equal + /// + /// Instance of WeChatPayDetails to be compared + /// Boolean + public bool Equals(WeChatPayDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(WeChatPayDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class WeChatPayDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class WeChatPayDetails."); - - return new WeChatPayDetails(checkoutAttemptId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, WeChatPayDetails weChatPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, weChatPayDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, WeChatPayDetails weChatPayDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (weChatPayDetails.CheckoutAttemptIdOption.IsSet && weChatPayDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(weChatPayDetails.CheckoutAttemptId), "Property is required for class WeChatPayDetails."); - - if (weChatPayDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", weChatPayDetails.CheckoutAttemptId); - - var typeRawValue = WeChatPayDetails.TypeEnumToJsonValue(weChatPayDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs b/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs index eaa676b6f..f7ed49490 100644 --- a/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs +++ b/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,145 +15,78 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// WeChatPayMiniProgramDetails /// - public partial class WeChatPayMiniProgramDetails : IValidatableObject + [DataContract(Name = "WeChatPayMiniProgramDetails")] + public partial class WeChatPayMiniProgramDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// appId - /// The checkout attempt identifier. - /// openid - /// **wechatpayMiniProgram** (default to TypeEnum.WechatpayMiniProgram) - [JsonConstructor] - public WeChatPayMiniProgramDetails(Option appId = default, Option checkoutAttemptId = default, Option openid = default, Option type = default) - { - AppIdOption = appId; - CheckoutAttemptIdOption = checkoutAttemptId; - OpenidOption = openid; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **wechatpayMiniProgram** /// /// **wechatpayMiniProgram** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum WechatpayMiniProgram for value: wechatpayMiniProgram /// + [EnumMember(Value = "wechatpayMiniProgram")] WechatpayMiniProgram = 1 - } - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("wechatpayMiniProgram")) - return TypeEnum.WechatpayMiniProgram; - - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("wechatpayMiniProgram")) - return TypeEnum.WechatpayMiniProgram; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.WechatpayMiniProgram) - return "wechatpayMiniProgram"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **wechatpayMiniProgram** /// /// **wechatpayMiniProgram** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of AppId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option AppIdOption { get; private set; } + /// appId. + /// The checkout attempt identifier.. + /// openid. + /// **wechatpayMiniProgram** (default to TypeEnum.WechatpayMiniProgram). + public WeChatPayMiniProgramDetails(string appId = default(string), string checkoutAttemptId = default(string), string openid = default(string), TypeEnum? type = TypeEnum.WechatpayMiniProgram) + { + this.AppId = appId; + this.CheckoutAttemptId = checkoutAttemptId; + this.Openid = openid; + this.Type = type; + } /// /// Gets or Sets AppId /// - [JsonPropertyName("appId")] - public string AppId { get { return this.AppIdOption; } set { this.AppIdOption = new Option(value); } } - - /// - /// Used to track the state of CheckoutAttemptId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + [DataMember(Name = "appId", EmitDefaultValue = false)] + public string AppId { get; set; } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of Openid - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option OpenidOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Gets or Sets Openid /// - [JsonPropertyName("openid")] - public string Openid { get { return this.OpenidOption; } set { this.OpenidOption = new Option(value); } } + [DataMember(Name = "openid", EmitDefaultValue = false)] + public string Openid { get; set; } /// /// Returns the string presentation of the object @@ -171,137 +105,91 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class WeChatPayMiniProgramDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override WeChatPayMiniProgramDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option appId = default; - Option checkoutAttemptId = default; - Option openid = default; - Option type = default; + return this.Equals(input as WeChatPayMiniProgramDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if WeChatPayMiniProgramDetails instances are equal + /// + /// Instance of WeChatPayMiniProgramDetails to be compared + /// Boolean + public bool Equals(WeChatPayMiniProgramDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "appId": - appId = new Option(utf8JsonReader.GetString()); - break; - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "openid": - openid = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(WeChatPayMiniProgramDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (appId.IsSet && appId.Value == null) - throw new ArgumentNullException(nameof(appId), "Property is not nullable for class WeChatPayMiniProgramDetails."); - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class WeChatPayMiniProgramDetails."); - - if (openid.IsSet && openid.Value == null) - throw new ArgumentNullException(nameof(openid), "Property is not nullable for class WeChatPayMiniProgramDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class WeChatPayMiniProgramDetails."); - - return new WeChatPayMiniProgramDetails(appId, checkoutAttemptId, openid, type); + return + ( + this.AppId == input.AppId || + (this.AppId != null && + this.AppId.Equals(input.AppId)) + ) && + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.Openid == input.Openid || + (this.Openid != null && + this.Openid.Equals(input.Openid)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, WeChatPayMiniProgramDetails weChatPayMiniProgramDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, weChatPayMiniProgramDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AppId != null) + { + hashCode = (hashCode * 59) + this.AppId.GetHashCode(); + } + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.Openid != null) + { + hashCode = (hashCode * 59) + this.Openid.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, WeChatPayMiniProgramDetails weChatPayMiniProgramDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (weChatPayMiniProgramDetails.AppIdOption.IsSet && weChatPayMiniProgramDetails.AppId == null) - throw new ArgumentNullException(nameof(weChatPayMiniProgramDetails.AppId), "Property is required for class WeChatPayMiniProgramDetails."); - - if (weChatPayMiniProgramDetails.CheckoutAttemptIdOption.IsSet && weChatPayMiniProgramDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(weChatPayMiniProgramDetails.CheckoutAttemptId), "Property is required for class WeChatPayMiniProgramDetails."); - - if (weChatPayMiniProgramDetails.OpenidOption.IsSet && weChatPayMiniProgramDetails.Openid == null) - throw new ArgumentNullException(nameof(weChatPayMiniProgramDetails.Openid), "Property is required for class WeChatPayMiniProgramDetails."); - - if (weChatPayMiniProgramDetails.AppIdOption.IsSet) - writer.WriteString("appId", weChatPayMiniProgramDetails.AppId); - - if (weChatPayMiniProgramDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", weChatPayMiniProgramDetails.CheckoutAttemptId); - - if (weChatPayMiniProgramDetails.OpenidOption.IsSet) - writer.WriteString("openid", weChatPayMiniProgramDetails.Openid); - - var typeRawValue = WeChatPayMiniProgramDetails.TypeEnumToJsonValue(weChatPayMiniProgramDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/Checkout/ZipDetails.cs b/Adyen/Model/Checkout/ZipDetails.cs index 2ee55899c..d4c340e79 100644 --- a/Adyen/Model/Checkout/ZipDetails.cs +++ b/Adyen/Model/Checkout/ZipDetails.cs @@ -1,12 +1,13 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections; @@ -14,178 +15,96 @@ using System.Collections.ObjectModel; using System.Linq; using System.IO; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Text.Json; -using System.Text.Json.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; -using Adyen.Client; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; namespace Adyen.Model.Checkout { /// /// ZipDetails /// - public partial class ZipDetails : IValidatableObject + [DataContract(Name = "ZipDetails")] + public partial class ZipDetails : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - /// The checkout attempt identifier. - /// Set this to **true** if the shopper would like to pick up and collect their order, instead of having the goods delivered to them. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// This is the `recurringDetailReference` returned in the response when you created the token. - /// **zip** (default to TypeEnum.Zip) - [JsonConstructor] - public ZipDetails(Option checkoutAttemptId = default, Option clickAndCollect = default, Option recurringDetailReference = default, Option storedPaymentMethodId = default, Option type = default) - { - CheckoutAttemptIdOption = checkoutAttemptId; - ClickAndCollectOption = clickAndCollect; - RecurringDetailReferenceOption = recurringDetailReference; - StoredPaymentMethodIdOption = storedPaymentMethodId; - TypeOption = type; - OnCreated(); - } - - partial void OnCreated(); - /// /// **zip** /// /// **zip** + [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { /// /// Enum Zip for value: zip /// + [EnumMember(Value = "zip")] Zip = 1, /// /// Enum ZipPos for value: zip_pos /// + [EnumMember(Value = "zip_pos")] ZipPos = 2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static TypeEnum TypeEnumFromString(string value) - { - if (value.Equals("zip")) - return TypeEnum.Zip; - - if (value.Equals("zip_pos")) - return TypeEnum.ZipPos; - throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); } - /// - /// Returns a - /// - /// - /// - public static TypeEnum? TypeEnumFromStringOrDefault(string value) - { - if (value.Equals("zip")) - return TypeEnum.Zip; - - if (value.Equals("zip_pos")) - return TypeEnum.ZipPos; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string TypeEnumToJsonValue(TypeEnum? value) - { - if (value == TypeEnum.Zip) - return "zip"; - - if (value == TypeEnum.ZipPos) - return "zip_pos"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Used to track the state of Type - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } /// /// **zip** /// /// **zip** - [JsonPropertyName("type")] - public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } - + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } /// - /// Used to track the state of CheckoutAttemptId + /// Initializes a new instance of the class. /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option CheckoutAttemptIdOption { get; private set; } + /// The checkout attempt identifier.. + /// Set this to **true** if the shopper would like to pick up and collect their order, instead of having the goods delivered to them.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// This is the `recurringDetailReference` returned in the response when you created the token.. + /// **zip** (default to TypeEnum.Zip). + public ZipDetails(string checkoutAttemptId = default(string), string clickAndCollect = default(string), string recurringDetailReference = default(string), string storedPaymentMethodId = default(string), TypeEnum? type = TypeEnum.Zip) + { + this.CheckoutAttemptId = checkoutAttemptId; + this.ClickAndCollect = clickAndCollect; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } /// /// The checkout attempt identifier. /// /// The checkout attempt identifier. - [JsonPropertyName("checkoutAttemptId")] - public string CheckoutAttemptId { get { return this.CheckoutAttemptIdOption; } set { this.CheckoutAttemptIdOption = new Option(value); } } - - /// - /// Used to track the state of ClickAndCollect - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option ClickAndCollectOption { get; private set; } + [DataMember(Name = "checkoutAttemptId", EmitDefaultValue = false)] + public string CheckoutAttemptId { get; set; } /// /// Set this to **true** if the shopper would like to pick up and collect their order, instead of having the goods delivered to them. /// /// Set this to **true** if the shopper would like to pick up and collect their order, instead of having the goods delivered to them. - [JsonPropertyName("clickAndCollect")] - public string ClickAndCollect { get { return this.ClickAndCollectOption; } set { this.ClickAndCollectOption = new Option(value); } } - - /// - /// Used to track the state of RecurringDetailReference - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option RecurringDetailReferenceOption { get; private set; } + [DataMember(Name = "clickAndCollect", EmitDefaultValue = false)] + public string ClickAndCollect { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("recurringDetailReference")] - [Obsolete] - public string RecurringDetailReference { get { return this.RecurringDetailReferenceOption; } set { this.RecurringDetailReferenceOption = new Option(value); } } - - /// - /// Used to track the state of StoredPaymentMethodId - /// - [JsonIgnore] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option StoredPaymentMethodIdOption { get; private set; } + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] + [Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")] + public string RecurringDetailReference { get; set; } /// /// This is the `recurringDetailReference` returned in the response when you created the token. /// /// This is the `recurringDetailReference` returned in the response when you created the token. - [JsonPropertyName("storedPaymentMethodId")] - public string StoredPaymentMethodId { get { return this.StoredPaymentMethodIdOption; } set { this.StoredPaymentMethodIdOption = new Option(value); } } + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } /// /// Returns the string presentation of the object @@ -205,156 +124,106 @@ public override string ToString() } /// - /// To validate all properties of the instance + /// Returns the JSON string presentation of the object /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + /// JSON string presentation of the object + public virtual string ToJson() { - // StoredPaymentMethodId (string) maxLength - if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) - { - yield return new ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); - } - - yield break; + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } - } - /// - /// A Json converter for type - /// - public class ZipDetailsJsonConverter : JsonConverter - { /// - /// Deserializes json to + /// Returns true if objects are equal /// - /// - /// - /// - /// - /// - public override ZipDetails Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { - int currentDepth = utf8JsonReader.CurrentDepth; - - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); - - JsonTokenType startingTokenType = utf8JsonReader.TokenType; - - Option checkoutAttemptId = default; - Option clickAndCollect = default; - Option recurringDetailReference = default; - Option storedPaymentMethodId = default; - Option type = default; + return this.Equals(input as ZipDetails); + } - while (utf8JsonReader.Read()) + /// + /// Returns true if ZipDetails instances are equal + /// + /// Instance of ZipDetails to be compared + /// Boolean + public bool Equals(ZipDetails input) + { + if (input == null) { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; - - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) - { - string localVarJsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (localVarJsonPropertyName) - { - case "checkoutAttemptId": - checkoutAttemptId = new Option(utf8JsonReader.GetString()); - break; - case "clickAndCollect": - clickAndCollect = new Option(utf8JsonReader.GetString()); - break; - case "recurringDetailReference": - recurringDetailReference = new Option(utf8JsonReader.GetString()); - break; - case "storedPaymentMethodId": - storedPaymentMethodId = new Option(utf8JsonReader.GetString()); - break; - case "type": - string typeRawValue = utf8JsonReader.GetString(); - if (typeRawValue != null) - type = new Option(ZipDetails.TypeEnumFromStringOrDefault(typeRawValue)); - break; - default: - break; - } - } + return false; } - - if (checkoutAttemptId.IsSet && checkoutAttemptId.Value == null) - throw new ArgumentNullException(nameof(checkoutAttemptId), "Property is not nullable for class ZipDetails."); - - if (clickAndCollect.IsSet && clickAndCollect.Value == null) - throw new ArgumentNullException(nameof(clickAndCollect), "Property is not nullable for class ZipDetails."); - - if (recurringDetailReference.IsSet && recurringDetailReference.Value == null) - throw new ArgumentNullException(nameof(recurringDetailReference), "Property is not nullable for class ZipDetails."); - - if (storedPaymentMethodId.IsSet && storedPaymentMethodId.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId), "Property is not nullable for class ZipDetails."); - - if (type.IsSet && type.Value == null) - throw new ArgumentNullException(nameof(type), "Property is not nullable for class ZipDetails."); - - return new ZipDetails(checkoutAttemptId, clickAndCollect, recurringDetailReference, storedPaymentMethodId, type); + return + ( + this.CheckoutAttemptId == input.CheckoutAttemptId || + (this.CheckoutAttemptId != null && + this.CheckoutAttemptId.Equals(input.CheckoutAttemptId)) + ) && + ( + this.ClickAndCollect == input.ClickAndCollect || + (this.ClickAndCollect != null && + this.ClickAndCollect.Equals(input.ClickAndCollect)) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + (this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference)) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + (this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); } /// - /// Serializes a + /// Gets the hash code /// - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, ZipDetails zipDetails, JsonSerializerOptions jsonSerializerOptions) + /// Hash code + public override int GetHashCode() { - writer.WriteStartObject(); - - WriteProperties(writer, zipDetails, jsonSerializerOptions); - writer.WriteEndObject(); + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CheckoutAttemptId != null) + { + hashCode = (hashCode * 59) + this.CheckoutAttemptId.GetHashCode(); + } + if (this.ClickAndCollect != null) + { + hashCode = (hashCode * 59) + this.ClickAndCollect.GetHashCode(); + } + if (this.RecurringDetailReference != null) + { + hashCode = (hashCode * 59) + this.RecurringDetailReference.GetHashCode(); + } + if (this.StoredPaymentMethodId != null) + { + hashCode = (hashCode * 59) + this.StoredPaymentMethodId.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } } - /// - /// Serializes the properties of + /// To validate all properties of the instance /// - /// - /// - /// - /// - public void WriteProperties(Utf8JsonWriter writer, ZipDetails zipDetails, JsonSerializerOptions jsonSerializerOptions) + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) { - if (zipDetails.CheckoutAttemptIdOption.IsSet && zipDetails.CheckoutAttemptId == null) - throw new ArgumentNullException(nameof(zipDetails.CheckoutAttemptId), "Property is required for class ZipDetails."); - - if (zipDetails.ClickAndCollectOption.IsSet && zipDetails.ClickAndCollect == null) - throw new ArgumentNullException(nameof(zipDetails.ClickAndCollect), "Property is required for class ZipDetails."); - - if (zipDetails.RecurringDetailReferenceOption.IsSet && zipDetails.RecurringDetailReference == null) - throw new ArgumentNullException(nameof(zipDetails.RecurringDetailReference), "Property is required for class ZipDetails."); - - if (zipDetails.StoredPaymentMethodIdOption.IsSet && zipDetails.StoredPaymentMethodId == null) - throw new ArgumentNullException(nameof(zipDetails.StoredPaymentMethodId), "Property is required for class ZipDetails."); - - if (zipDetails.CheckoutAttemptIdOption.IsSet) - writer.WriteString("checkoutAttemptId", zipDetails.CheckoutAttemptId); - - if (zipDetails.ClickAndCollectOption.IsSet) - writer.WriteString("clickAndCollect", zipDetails.ClickAndCollect); - - if (zipDetails.RecurringDetailReferenceOption.IsSet) - writer.WriteString("recurringDetailReference", zipDetails.RecurringDetailReference); - - if (zipDetails.StoredPaymentMethodIdOption.IsSet) - writer.WriteString("storedPaymentMethodId", zipDetails.StoredPaymentMethodId); + // StoredPaymentMethodId (string) maxLength + if (this.StoredPaymentMethodId != null && this.StoredPaymentMethodId.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StoredPaymentMethodId, length must be less than 64.", new [] { "StoredPaymentMethodId" }); + } - var typeRawValue = ZipDetails.TypeEnumToJsonValue(zipDetails.TypeOption.Value.Value); - writer.WriteString("type", typeRawValue); + yield break; } } + } diff --git a/Adyen/Model/ConfigurationWebhooks/Card.cs b/Adyen/Model/ConfigurationWebhooks/Card.cs index 3e1d4f563..4bcabca25 100644 --- a/Adyen/Model/ConfigurationWebhooks/Card.cs +++ b/Adyen/Model/ConfigurationWebhooks/Card.cs @@ -86,7 +86,7 @@ protected Card() { } /// The form factor of the card. Possible values: **virtual**, **physical**. (required). /// Last last four digits of the card number.. /// The primary account number (PAN) of the card. > The PAN is masked by default and returned only for single-use virtual cards. (required). - /// Allocates a specific product range for either a physical or a virtual card. Possible values: **fullySupported**, **secureCorporate**. >Reach out to your Adyen contact to get the values relevant for your integration.. + /// The 3DS configuration of the physical or the virtual card. Possible values: **fullySupported**, **secureCorporate**. > Reach out to your Adyen contact to get the values relevant for your integration.. public Card(Authentication authentication = default(Authentication), string bin = default(string), string brand = default(string), string brandVariant = default(string), string cardholderName = default(string), CardConfiguration configuration = default(CardConfiguration), string cvc = default(string), DeliveryContact deliveryContact = default(DeliveryContact), Expiry expiration = default(Expiry), FormFactorEnum formFactor = default(FormFactorEnum), string lastFour = default(string), string number = default(string), string threeDSecure = default(string)) { this.Brand = brand; @@ -178,9 +178,9 @@ protected Card() { } public string Number { get; set; } /// - /// Allocates a specific product range for either a physical or a virtual card. Possible values: **fullySupported**, **secureCorporate**. >Reach out to your Adyen contact to get the values relevant for your integration. + /// The 3DS configuration of the physical or the virtual card. Possible values: **fullySupported**, **secureCorporate**. > Reach out to your Adyen contact to get the values relevant for your integration. /// - /// Allocates a specific product range for either a physical or a virtual card. Possible values: **fullySupported**, **secureCorporate**. >Reach out to your Adyen contact to get the values relevant for your integration. + /// The 3DS configuration of the physical or the virtual card. Possible values: **fullySupported**, **secureCorporate**. > Reach out to your Adyen contact to get the values relevant for your integration. [DataMember(Name = "threeDSecure", EmitDefaultValue = false)] public string ThreeDSecure { get; set; } diff --git a/Adyen/Model/ConfigurationWebhooks/Device.cs b/Adyen/Model/ConfigurationWebhooks/Device.cs new file mode 100644 index 000000000..57051897d --- /dev/null +++ b/Adyen/Model/ConfigurationWebhooks/Device.cs @@ -0,0 +1,148 @@ +/* +* Configuration webhooks +* +* +* The version of the OpenAPI document: 2 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.ConfigurationWebhooks +{ + /// + /// Device + /// + [DataContract(Name = "Device")] + public partial class Device : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The type of the device used for provisioning the network token. For example, **phone**, **mobile_phone**, **watch**, **mobilephone_or_tablet**, etc. + /// The operating system of the device used for provisioning the network token.. + public Device(string formFactor = default(string), string osName = default(string)) + { + this.FormFactor = formFactor; + this.OsName = osName; + } + + /// + /// The type of the device used for provisioning the network token. For example, **phone**, **mobile_phone**, **watch**, **mobilephone_or_tablet**, etc + /// + /// The type of the device used for provisioning the network token. For example, **phone**, **mobile_phone**, **watch**, **mobilephone_or_tablet**, etc + [DataMember(Name = "formFactor", EmitDefaultValue = false)] + public string FormFactor { get; set; } + + /// + /// The operating system of the device used for provisioning the network token. + /// + /// The operating system of the device used for provisioning the network token. + [DataMember(Name = "osName", EmitDefaultValue = false)] + public string OsName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Device {\n"); + sb.Append(" FormFactor: ").Append(FormFactor).Append("\n"); + sb.Append(" OsName: ").Append(OsName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Device); + } + + /// + /// Returns true if Device instances are equal + /// + /// Instance of Device to be compared + /// Boolean + public bool Equals(Device input) + { + if (input == null) + { + return false; + } + return + ( + this.FormFactor == input.FormFactor || + (this.FormFactor != null && + this.FormFactor.Equals(input.FormFactor)) + ) && + ( + this.OsName == input.OsName || + (this.OsName != null && + this.OsName.Equals(input.OsName)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.FormFactor != null) + { + hashCode = (hashCode * 59) + this.FormFactor.GetHashCode(); + } + if (this.OsName != null) + { + hashCode = (hashCode * 59) + this.OsName.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs b/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs new file mode 100644 index 000000000..48eed65c6 --- /dev/null +++ b/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs @@ -0,0 +1,332 @@ +/* +* Configuration webhooks +* +* +* The version of the OpenAPI document: 2 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.ConfigurationWebhooks +{ + /// + /// NetworkTokenNotificationDataV2 + /// + [DataContract(Name = "NetworkTokenNotificationDataV2")] + public partial class NetworkTokenNotificationDataV2 : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// authentication. + /// Specifies whether the authentication process was triggered during token provisioning.. + /// The unique identifier of the balance platform.. + /// The decision about the network token provisioning. Possible values: **approved**, **declined**, **requiresAuthentication**.. + /// The unique identifier of the network token.. + /// The unique identifier of the payment instrument to which the network token is associated.. + /// The status of the network token.. + /// The last four digits of the network token. Use this value to help your user to identify their network token.. + /// tokenRequestor. + /// The type of network token.. + /// The rules used to validate the request for provisioning the network token.. + /// wallet. + public NetworkTokenNotificationDataV2(TokenAuthentication authentication = default(TokenAuthentication), bool? authenticationApplied = default(bool?), string balancePlatform = default(string), string decision = default(string), string id = default(string), string paymentInstrumentId = default(string), string status = default(string), string tokenLastFour = default(string), NetworkTokenRequestor tokenRequestor = default(NetworkTokenRequestor), string type = default(string), List validationFacts = default(List), Wallet wallet = default(Wallet)) + { + this.Authentication = authentication; + this.AuthenticationApplied = authenticationApplied; + this.BalancePlatform = balancePlatform; + this.Decision = decision; + this.Id = id; + this.PaymentInstrumentId = paymentInstrumentId; + this.Status = status; + this.TokenLastFour = tokenLastFour; + this.TokenRequestor = tokenRequestor; + this.Type = type; + this.ValidationFacts = validationFacts; + this.Wallet = wallet; + } + + /// + /// Gets or Sets Authentication + /// + [DataMember(Name = "authentication", EmitDefaultValue = false)] + public TokenAuthentication Authentication { get; set; } + + /// + /// Specifies whether the authentication process was triggered during token provisioning. + /// + /// Specifies whether the authentication process was triggered during token provisioning. + [DataMember(Name = "authenticationApplied", EmitDefaultValue = false)] + public bool? AuthenticationApplied { get; set; } + + /// + /// The unique identifier of the balance platform. + /// + /// The unique identifier of the balance platform. + [DataMember(Name = "balancePlatform", EmitDefaultValue = false)] + public string BalancePlatform { get; set; } + + /// + /// The decision about the network token provisioning. Possible values: **approved**, **declined**, **requiresAuthentication**. + /// + /// The decision about the network token provisioning. Possible values: **approved**, **declined**, **requiresAuthentication**. + [DataMember(Name = "decision", EmitDefaultValue = false)] + public string Decision { get; set; } + + /// + /// The unique identifier of the network token. + /// + /// The unique identifier of the network token. + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// The unique identifier of the payment instrument to which the network token is associated. + /// + /// The unique identifier of the payment instrument to which the network token is associated. + [DataMember(Name = "paymentInstrumentId", EmitDefaultValue = false)] + public string PaymentInstrumentId { get; set; } + + /// + /// The status of the network token. + /// + /// The status of the network token. + [DataMember(Name = "status", EmitDefaultValue = false)] + public string Status { get; set; } + + /// + /// The last four digits of the network token. Use this value to help your user to identify their network token. + /// + /// The last four digits of the network token. Use this value to help your user to identify their network token. + [DataMember(Name = "tokenLastFour", EmitDefaultValue = false)] + public string TokenLastFour { get; set; } + + /// + /// Gets or Sets TokenRequestor + /// + [DataMember(Name = "tokenRequestor", EmitDefaultValue = false)] + public NetworkTokenRequestor TokenRequestor { get; set; } + + /// + /// The type of network token. + /// + /// The type of network token. + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } + + /// + /// The rules used to validate the request for provisioning the network token. + /// + /// The rules used to validate the request for provisioning the network token. + [DataMember(Name = "validationFacts", EmitDefaultValue = false)] + public List ValidationFacts { get; set; } + + /// + /// Gets or Sets Wallet + /// + [DataMember(Name = "wallet", EmitDefaultValue = false)] + public Wallet Wallet { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NetworkTokenNotificationDataV2 {\n"); + sb.Append(" Authentication: ").Append(Authentication).Append("\n"); + sb.Append(" AuthenticationApplied: ").Append(AuthenticationApplied).Append("\n"); + sb.Append(" BalancePlatform: ").Append(BalancePlatform).Append("\n"); + sb.Append(" Decision: ").Append(Decision).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PaymentInstrumentId: ").Append(PaymentInstrumentId).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" TokenLastFour: ").Append(TokenLastFour).Append("\n"); + sb.Append(" TokenRequestor: ").Append(TokenRequestor).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" ValidationFacts: ").Append(ValidationFacts).Append("\n"); + sb.Append(" Wallet: ").Append(Wallet).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NetworkTokenNotificationDataV2); + } + + /// + /// Returns true if NetworkTokenNotificationDataV2 instances are equal + /// + /// Instance of NetworkTokenNotificationDataV2 to be compared + /// Boolean + public bool Equals(NetworkTokenNotificationDataV2 input) + { + if (input == null) + { + return false; + } + return + ( + this.Authentication == input.Authentication || + (this.Authentication != null && + this.Authentication.Equals(input.Authentication)) + ) && + ( + this.AuthenticationApplied == input.AuthenticationApplied || + this.AuthenticationApplied.Equals(input.AuthenticationApplied) + ) && + ( + this.BalancePlatform == input.BalancePlatform || + (this.BalancePlatform != null && + this.BalancePlatform.Equals(input.BalancePlatform)) + ) && + ( + this.Decision == input.Decision || + (this.Decision != null && + this.Decision.Equals(input.Decision)) + ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.PaymentInstrumentId == input.PaymentInstrumentId || + (this.PaymentInstrumentId != null && + this.PaymentInstrumentId.Equals(input.PaymentInstrumentId)) + ) && + ( + this.Status == input.Status || + (this.Status != null && + this.Status.Equals(input.Status)) + ) && + ( + this.TokenLastFour == input.TokenLastFour || + (this.TokenLastFour != null && + this.TokenLastFour.Equals(input.TokenLastFour)) + ) && + ( + this.TokenRequestor == input.TokenRequestor || + (this.TokenRequestor != null && + this.TokenRequestor.Equals(input.TokenRequestor)) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ) && + ( + this.ValidationFacts == input.ValidationFacts || + this.ValidationFacts != null && + input.ValidationFacts != null && + this.ValidationFacts.SequenceEqual(input.ValidationFacts) + ) && + ( + this.Wallet == input.Wallet || + (this.Wallet != null && + this.Wallet.Equals(input.Wallet)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Authentication != null) + { + hashCode = (hashCode * 59) + this.Authentication.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AuthenticationApplied.GetHashCode(); + if (this.BalancePlatform != null) + { + hashCode = (hashCode * 59) + this.BalancePlatform.GetHashCode(); + } + if (this.Decision != null) + { + hashCode = (hashCode * 59) + this.Decision.GetHashCode(); + } + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.PaymentInstrumentId != null) + { + hashCode = (hashCode * 59) + this.PaymentInstrumentId.GetHashCode(); + } + if (this.Status != null) + { + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + } + if (this.TokenLastFour != null) + { + hashCode = (hashCode * 59) + this.TokenLastFour.GetHashCode(); + } + if (this.TokenRequestor != null) + { + hashCode = (hashCode * 59) + this.TokenRequestor.GetHashCode(); + } + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + if (this.ValidationFacts != null) + { + hashCode = (hashCode * 59) + this.ValidationFacts.GetHashCode(); + } + if (this.Wallet != null) + { + hashCode = (hashCode * 59) + this.Wallet.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs b/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs new file mode 100644 index 000000000..4b080ddf6 --- /dev/null +++ b/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs @@ -0,0 +1,207 @@ +/* +* Configuration webhooks +* +* +* The version of the OpenAPI document: 2 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.ConfigurationWebhooks +{ + /// + /// NetworkTokenNotificationRequest + /// + [DataContract(Name = "NetworkTokenNotificationRequest")] + public partial class NetworkTokenNotificationRequest : IEquatable, IValidatableObject + { + /// + /// The type of webhook. + /// + /// The type of webhook. + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum Created for value: balancePlatform.networkToken.created + /// + [EnumMember(Value = "balancePlatform.networkToken.created")] + Created = 1, + + /// + /// Enum Updated for value: balancePlatform.networkToken.updated + /// + [EnumMember(Value = "balancePlatform.networkToken.updated")] + Updated = 2 + + } + + + /// + /// The type of webhook. + /// + /// The type of webhook. + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] + public TypeEnum Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NetworkTokenNotificationRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// data (required). + /// The environment from which the webhook originated. Possible values: **test**, **live**. (required). + /// When the event was queued.. + /// The type of webhook. (required). + public NetworkTokenNotificationRequest(NetworkTokenNotificationDataV2 data = default(NetworkTokenNotificationDataV2), string environment = default(string), DateTime timestamp = default(DateTime), TypeEnum type = default(TypeEnum)) + { + this.Data = data; + this.Environment = environment; + this.Type = type; + this.Timestamp = timestamp; + } + + /// + /// Gets or Sets Data + /// + [DataMember(Name = "data", IsRequired = false, EmitDefaultValue = false)] + public NetworkTokenNotificationDataV2 Data { get; set; } + + /// + /// The environment from which the webhook originated. Possible values: **test**, **live**. + /// + /// The environment from which the webhook originated. Possible values: **test**, **live**. + [DataMember(Name = "environment", IsRequired = false, EmitDefaultValue = false)] + public string Environment { get; set; } + + /// + /// When the event was queued. + /// + /// When the event was queued. + [DataMember(Name = "timestamp", EmitDefaultValue = false)] + public DateTime Timestamp { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NetworkTokenNotificationRequest {\n"); + sb.Append(" Data: ").Append(Data).Append("\n"); + sb.Append(" Environment: ").Append(Environment).Append("\n"); + sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NetworkTokenNotificationRequest); + } + + /// + /// Returns true if NetworkTokenNotificationRequest instances are equal + /// + /// Instance of NetworkTokenNotificationRequest to be compared + /// Boolean + public bool Equals(NetworkTokenNotificationRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.Data == input.Data || + (this.Data != null && + this.Data.Equals(input.Data)) + ) && + ( + this.Environment == input.Environment || + (this.Environment != null && + this.Environment.Equals(input.Environment)) + ) && + ( + this.Timestamp == input.Timestamp || + (this.Timestamp != null && + this.Timestamp.Equals(input.Timestamp)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Data != null) + { + hashCode = (hashCode * 59) + this.Data.GetHashCode(); + } + if (this.Environment != null) + { + hashCode = (hashCode * 59) + this.Environment.GetHashCode(); + } + if (this.Timestamp != null) + { + hashCode = (hashCode * 59) + this.Timestamp.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs b/Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs new file mode 100644 index 000000000..a46d337f8 --- /dev/null +++ b/Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs @@ -0,0 +1,148 @@ +/* +* Configuration webhooks +* +* +* The version of the OpenAPI document: 2 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.ConfigurationWebhooks +{ + /// + /// NetworkTokenRequestor + /// + [DataContract(Name = "NetworkTokenRequestor")] + public partial class NetworkTokenRequestor : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The id of the network token requestor.. + /// The name of the network token requestor.. + public NetworkTokenRequestor(string id = default(string), string name = default(string)) + { + this.Id = id; + this.Name = name; + } + + /// + /// The id of the network token requestor. + /// + /// The id of the network token requestor. + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// The name of the network token requestor. + /// + /// The name of the network token requestor. + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NetworkTokenRequestor {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NetworkTokenRequestor); + } + + /// + /// Returns true if NetworkTokenRequestor instances are equal + /// + /// Instance of NetworkTokenRequestor to be compared + /// Boolean + public bool Equals(NetworkTokenRequestor input) + { + if (input == null) + { + return false; + } + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs b/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs index ba2c0c489..fbb4fd82f 100644 --- a/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs +++ b/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs @@ -35,8 +35,8 @@ public partial class PlatformPaymentConfiguration : IEquatable /// Initializes a new instance of the class. /// - /// Specifies at what time a [sales day](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#sales-day) ends for this account. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**.. - /// Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#settlement-batch) are made available in this balance account. Possible values: **1** to **20**, or **null**. * Setting this value to an integer enables Sales day settlement in this balance account. See how Sales day settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/sales-day-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables Pass-through settlement in this balance account. See how Pass-through settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/pass-through-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/pass-through-settlement). Default value: **null**.. + /// Specifies at what time a sales day ends for this account. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**.. + /// Specifies after how many business days the funds in a settlement batch are made available in this balance account. Possible values: **1** to **20**, or **null**. Default value: **null**.. public PlatformPaymentConfiguration(string salesDayClosingTime = default(string), int? settlementDelayDays = default(int?)) { this.SalesDayClosingTime = salesDayClosingTime; @@ -44,16 +44,16 @@ public partial class PlatformPaymentConfiguration : IEquatable - /// Specifies at what time a [sales day](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#sales-day) ends for this account. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. + /// Specifies at what time a sales day ends for this account. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. /// - /// Specifies at what time a [sales day](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#sales-day) ends for this account. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. + /// Specifies at what time a sales day ends for this account. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. [DataMember(Name = "salesDayClosingTime", EmitDefaultValue = false)] public string SalesDayClosingTime { get; set; } /// - /// Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#settlement-batch) are made available in this balance account. Possible values: **1** to **20**, or **null**. * Setting this value to an integer enables Sales day settlement in this balance account. See how Sales day settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/sales-day-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables Pass-through settlement in this balance account. See how Pass-through settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/pass-through-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/pass-through-settlement). Default value: **null**. + /// Specifies after how many business days the funds in a settlement batch are made available in this balance account. Possible values: **1** to **20**, or **null**. Default value: **null**. /// - /// Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement#settlement-batch) are made available in this balance account. Possible values: **1** to **20**, or **null**. * Setting this value to an integer enables Sales day settlement in this balance account. See how Sales day settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/sales-day-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/sales-day-settlement). * Setting this value to **null** enables Pass-through settlement in this balance account. See how Pass-through settlement works in your [marketplace](https://docs.adyen.com/marketplaces/settle-funds/pass-through-settlement) or [platform](https://docs.adyen.com/platforms/settle-funds/pass-through-settlement). Default value: **null**. + /// Specifies after how many business days the funds in a settlement batch are made available in this balance account. Possible values: **1** to **20**, or **null**. Default value: **null**. [DataMember(Name = "settlementDelayDays", EmitDefaultValue = false)] public int? SettlementDelayDays { get; set; } diff --git a/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.cs b/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.cs index bf9a72e76..600e905ce 100644 --- a/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.cs +++ b/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.cs @@ -113,9 +113,9 @@ public enum PrioritiesEnum /// - /// The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + /// The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). /// - /// The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + /// The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). [DataMember(Name = "priorities", EmitDefaultValue = false)] public List Priorities { get; set; } /// @@ -347,7 +347,7 @@ protected SweepConfigurationV2() { } /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). (required). /// The message that will be used in the sweep transfer's description body with a maximum length of 140 characters. If the message is longer after replacing placeholders, the message will be cut off at 140 characters.. /// The unique identifier of the sweep. (required). - /// The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup).. + /// The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup).. /// The reason for disabling the sweep.. /// The human readable reason for disabling the sweep.. /// Your reference for the sweep configuration.. diff --git a/Adyen/Model/ConfigurationWebhooks/TokenAuthentication.cs b/Adyen/Model/ConfigurationWebhooks/TokenAuthentication.cs new file mode 100644 index 000000000..2624aaf5d --- /dev/null +++ b/Adyen/Model/ConfigurationWebhooks/TokenAuthentication.cs @@ -0,0 +1,148 @@ +/* +* Configuration webhooks +* +* +* The version of the OpenAPI document: 2 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.ConfigurationWebhooks +{ + /// + /// TokenAuthentication + /// + [DataContract(Name = "TokenAuthentication")] + public partial class TokenAuthentication : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The method used to complete the authentication process. Possible values: **sms_OTP**, **email_OTP**.. + /// The result of the authentication process.. + public TokenAuthentication(string method = default(string), string result = default(string)) + { + this.Method = method; + this.Result = result; + } + + /// + /// The method used to complete the authentication process. Possible values: **sms_OTP**, **email_OTP**. + /// + /// The method used to complete the authentication process. Possible values: **sms_OTP**, **email_OTP**. + [DataMember(Name = "method", EmitDefaultValue = false)] + public string Method { get; set; } + + /// + /// The result of the authentication process. + /// + /// The result of the authentication process. + [DataMember(Name = "result", EmitDefaultValue = false)] + public string Result { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TokenAuthentication {\n"); + sb.Append(" Method: ").Append(Method).Append("\n"); + sb.Append(" Result: ").Append(Result).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as TokenAuthentication); + } + + /// + /// Returns true if TokenAuthentication instances are equal + /// + /// Instance of TokenAuthentication to be compared + /// Boolean + public bool Equals(TokenAuthentication input) + { + if (input == null) + { + return false; + } + return + ( + this.Method == input.Method || + (this.Method != null && + this.Method.Equals(input.Method)) + ) && + ( + this.Result == input.Result || + (this.Result != null && + this.Result.Equals(input.Result)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Method != null) + { + hashCode = (hashCode * 59) + this.Method.GetHashCode(); + } + if (this.Result != null) + { + hashCode = (hashCode * 59) + this.Result.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/ConfigurationWebhooks/ValidationFacts.cs b/Adyen/Model/ConfigurationWebhooks/ValidationFacts.cs new file mode 100644 index 000000000..a32b90f8d --- /dev/null +++ b/Adyen/Model/ConfigurationWebhooks/ValidationFacts.cs @@ -0,0 +1,197 @@ +/* +* Configuration webhooks +* +* +* The version of the OpenAPI document: 2 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.ConfigurationWebhooks +{ + /// + /// ValidationFacts + /// + [DataContract(Name = "ValidationFacts")] + public partial class ValidationFacts : IEquatable, IValidatableObject + { + /// + /// The evaluation result of the validation facts. Possible values: **valid**, **invalid**, **notValidated**, **notApplicable**. + /// + /// The evaluation result of the validation facts. Possible values: **valid**, **invalid**, **notValidated**, **notApplicable**. + [JsonConverter(typeof(StringEnumConverter))] + public enum ResultEnum + { + /// + /// Enum Invalid for value: invalid + /// + [EnumMember(Value = "invalid")] + Invalid = 1, + + /// + /// Enum NotApplicable for value: notApplicable + /// + [EnumMember(Value = "notApplicable")] + NotApplicable = 2, + + /// + /// Enum NotValidated for value: notValidated + /// + [EnumMember(Value = "notValidated")] + NotValidated = 3, + + /// + /// Enum Valid for value: valid + /// + [EnumMember(Value = "valid")] + Valid = 4 + + } + + + /// + /// The evaluation result of the validation facts. Possible values: **valid**, **invalid**, **notValidated**, **notApplicable**. + /// + /// The evaluation result of the validation facts. Possible values: **valid**, **invalid**, **notValidated**, **notApplicable**. + [DataMember(Name = "result", EmitDefaultValue = false)] + public ResultEnum? Result { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// The reason for the `result` of the validations. This field is only sent for `validationFacts.type` **walletValidation**, when `validationFacts.result` is **invalid**.. + /// The evaluation result of the validation facts. Possible values: **valid**, **invalid**, **notValidated**, **notApplicable**.. + /// The type of the validation fact.. + public ValidationFacts(List reasons = default(List), ResultEnum? result = default(ResultEnum?), string type = default(string)) + { + this.Reasons = reasons; + this.Result = result; + this.Type = type; + } + + /// + /// The reason for the `result` of the validations. This field is only sent for `validationFacts.type` **walletValidation**, when `validationFacts.result` is **invalid**. + /// + /// The reason for the `result` of the validations. This field is only sent for `validationFacts.type` **walletValidation**, when `validationFacts.result` is **invalid**. + [DataMember(Name = "reasons", EmitDefaultValue = false)] + public List Reasons { get; set; } + + /// + /// The type of the validation fact. + /// + /// The type of the validation fact. + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ValidationFacts {\n"); + sb.Append(" Reasons: ").Append(Reasons).Append("\n"); + sb.Append(" Result: ").Append(Result).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ValidationFacts); + } + + /// + /// Returns true if ValidationFacts instances are equal + /// + /// Instance of ValidationFacts to be compared + /// Boolean + public bool Equals(ValidationFacts input) + { + if (input == null) + { + return false; + } + return + ( + this.Reasons == input.Reasons || + this.Reasons != null && + input.Reasons != null && + this.Reasons.SequenceEqual(input.Reasons) + ) && + ( + this.Result == input.Result || + this.Result.Equals(input.Result) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Reasons != null) + { + hashCode = (hashCode * 59) + this.Reasons.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Result.GetHashCode(); + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/ConfigurationWebhooks/VerificationError.cs b/Adyen/Model/ConfigurationWebhooks/VerificationError.cs index f53da3050..13056cb02 100644 --- a/Adyen/Model/ConfigurationWebhooks/VerificationError.cs +++ b/Adyen/Model/ConfigurationWebhooks/VerificationError.cs @@ -379,9 +379,9 @@ public enum CapabilitiesEnum [DataMember(Name = "capabilities", EmitDefaultValue = false)] public List Capabilities { get; set; } /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { @@ -401,15 +401,20 @@ public enum TypeEnum /// Enum PendingStatus for value: pendingStatus /// [EnumMember(Value = "pendingStatus")] - PendingStatus = 3 - + PendingStatus = 3, + + /// + /// Enum DataReview for value: dataReview + /// + [EnumMember(Value = "dataReview")] + DataReview = 4 } /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** [DataMember(Name = "type", EmitDefaultValue = false)] public TypeEnum? Type { get; set; } /// @@ -420,7 +425,7 @@ public enum TypeEnum /// A description of the error.. /// Contains the actions that you can take to resolve the verification error.. /// Contains more granular information about the verification error.. - /// The type of error. Possible values: **invalidInput**, **dataMissing**.. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** . public VerificationError(List capabilities = default(List), string code = default(string), string message = default(string), List remediatingActions = default(List), List subErrors = default(List), TypeEnum? type = default(TypeEnum?)) { this.Capabilities = capabilities; diff --git a/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs b/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs index f7df3cfaa..0a7dd6603 100644 --- a/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs +++ b/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs @@ -379,9 +379,9 @@ public enum CapabilitiesEnum [DataMember(Name = "capabilities", EmitDefaultValue = false)] public List Capabilities { get; set; } /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { @@ -401,15 +401,21 @@ public enum TypeEnum /// Enum PendingStatus for value: pendingStatus /// [EnumMember(Value = "pendingStatus")] - PendingStatus = 3 + PendingStatus = 3, + + /// + /// Enum DataReview for value: dataReview + /// + [EnumMember(Value = "dataReview")] + DataReview = 4 } /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** /// - /// The type of error. Possible values: **invalidInput**, **dataMissing**. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** [DataMember(Name = "type", EmitDefaultValue = false)] public TypeEnum? Type { get; set; } /// @@ -418,7 +424,7 @@ public enum TypeEnum /// Contains the capabilities that the verification error applies to.. /// The verification error code.. /// A description of the error.. - /// The type of error. Possible values: **invalidInput**, **dataMissing**.. + /// The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** . /// Contains the actions that you can take to resolve the verification error.. public VerificationErrorRecursive(List capabilities = default(List), string code = default(string), string message = default(string), TypeEnum? type = default(TypeEnum?), List remediatingActions = default(List)) { diff --git a/Adyen/Model/ConfigurationWebhooks/Wallet.cs b/Adyen/Model/ConfigurationWebhooks/Wallet.cs new file mode 100644 index 000000000..1f3e1cb73 --- /dev/null +++ b/Adyen/Model/ConfigurationWebhooks/Wallet.cs @@ -0,0 +1,475 @@ +/* +* Configuration webhooks +* +* +* The version of the OpenAPI document: 2 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.ConfigurationWebhooks +{ + /// + /// Wallet + /// + [DataContract(Name = "Wallet")] + public partial class Wallet : IEquatable, IValidatableObject + { + /// + /// Defines RecommendationReasons + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum RecommendationReasonsEnum + { + /// + /// Enum AccountCardTooNew for value: accountCardTooNew + /// + [EnumMember(Value = "accountCardTooNew")] + AccountCardTooNew = 1, + + /// + /// Enum AccountHighRisk for value: accountHighRisk + /// + [EnumMember(Value = "accountHighRisk")] + AccountHighRisk = 2, + + /// + /// Enum AccountRecentlyChanged for value: accountRecentlyChanged + /// + [EnumMember(Value = "accountRecentlyChanged")] + AccountRecentlyChanged = 3, + + /// + /// Enum AccountTooNew for value: accountTooNew + /// + [EnumMember(Value = "accountTooNew")] + AccountTooNew = 4, + + /// + /// Enum AccountTooNewSinceLaunch for value: accountTooNewSinceLaunch + /// + [EnumMember(Value = "accountTooNewSinceLaunch")] + AccountTooNewSinceLaunch = 5, + + /// + /// Enum CardholderPanAssociatedToAccountWithinThresholdDays for value: cardholderPanAssociatedToAccountWithinThresholdDays + /// + [EnumMember(Value = "cardholderPanAssociatedToAccountWithinThresholdDays")] + CardholderPanAssociatedToAccountWithinThresholdDays = 6, + + /// + /// Enum ChangesMadeToAccountDataWithinThresholdDays for value: changesMadeToAccountDataWithinThresholdDays + /// + [EnumMember(Value = "changesMadeToAccountDataWithinThresholdDays")] + ChangesMadeToAccountDataWithinThresholdDays = 7, + + /// + /// Enum DeviceProvisioningLocationOutsideOfCardholdersWalletAccountHomeCountry for value: deviceProvisioningLocationOutsideOfCardholdersWalletAccountHomeCountry + /// + [EnumMember(Value = "deviceProvisioningLocationOutsideOfCardholdersWalletAccountHomeCountry")] + DeviceProvisioningLocationOutsideOfCardholdersWalletAccountHomeCountry = 8, + + /// + /// Enum DeviceRecentlyLost for value: deviceRecentlyLost + /// + [EnumMember(Value = "deviceRecentlyLost")] + DeviceRecentlyLost = 9, + + /// + /// Enum EncryptedPaymentInstrumentDataIsBeingPushedByTheIssuerToTheSameDeviceThatIssuerApplicationAuthenticatedButWithSuccessfulUpfrontAuthentication for value: encryptedPaymentInstrumentDataIsBeingPushedByTheIssuerToTheSameDeviceThatIssuerApplicationAuthenticatedButWithSuccessfulUpfrontAuthentication + /// + [EnumMember(Value = "encryptedPaymentInstrumentDataIsBeingPushedByTheIssuerToTheSameDeviceThatIssuerApplicationAuthenticatedButWithSuccessfulUpfrontAuthentication")] + EncryptedPaymentInstrumentDataIsBeingPushedByTheIssuerToTheSameDeviceThatIssuerApplicationAuthenticatedButWithSuccessfulUpfrontAuthentication = 10, + + /// + /// Enum EncryptedPaymentInstrumentDataIsBeingPushedByTheIssuerToTheSameDeviceThatIssuerApplicationAuthenticatedButWithoutAnyUpfrontAuthentication for value: encryptedPaymentInstrumentDataIsBeingPushedByTheIssuerToTheSameDeviceThatIssuerApplicationAuthenticatedButWithoutAnyUpfrontAuthentication + /// + [EnumMember(Value = "encryptedPaymentInstrumentDataIsBeingPushedByTheIssuerToTheSameDeviceThatIssuerApplicationAuthenticatedButWithoutAnyUpfrontAuthentication")] + EncryptedPaymentInstrumentDataIsBeingPushedByTheIssuerToTheSameDeviceThatIssuerApplicationAuthenticatedButWithoutAnyUpfrontAuthentication = 11, + + /// + /// Enum EncryptedPaymentInstrumentDataIsPushedToADifferentDeviceThanTheOneThatIssuerApplicationAuthenticated for value: encryptedPaymentInstrumentDataIsPushedToADifferentDeviceThanTheOneThatIssuerApplicationAuthenticated + /// + [EnumMember(Value = "encryptedPaymentInstrumentDataIsPushedToADifferentDeviceThanTheOneThatIssuerApplicationAuthenticated")] + EncryptedPaymentInstrumentDataIsPushedToADifferentDeviceThanTheOneThatIssuerApplicationAuthenticated = 12, + + /// + /// Enum EncryptedPaymentInstrumentDataIsPushedToADifferentUserThanTheCardHolder for value: encryptedPaymentInstrumentDataIsPushedToADifferentUserThanTheCardHolder + /// + [EnumMember(Value = "encryptedPaymentInstrumentDataIsPushedToADifferentUserThanTheCardHolder")] + EncryptedPaymentInstrumentDataIsPushedToADifferentUserThanTheCardHolder = 13, + + /// + /// Enum HasSuspendedTokens for value: hasSuspendedTokens + /// + [EnumMember(Value = "hasSuspendedTokens")] + HasSuspendedTokens = 14, + + /// + /// Enum InactiveAccount for value: inactiveAccount + /// + [EnumMember(Value = "inactiveAccount")] + InactiveAccount = 15, + + /// + /// Enum IssuerDeferredIDVDecision for value: issuerDeferredIDVDecision + /// + [EnumMember(Value = "issuerDeferredIDVDecision")] + IssuerDeferredIDVDecision = 16, + + /// + /// Enum IssuerEncryptedPaymentInstrumentDataExpired for value: issuerEncryptedPaymentInstrumentDataExpired + /// + [EnumMember(Value = "issuerEncryptedPaymentInstrumentDataExpired")] + IssuerEncryptedPaymentInstrumentDataExpired = 17, + + /// + /// Enum LowAccountScore for value: lowAccountScore + /// + [EnumMember(Value = "lowAccountScore")] + LowAccountScore = 18, + + /// + /// Enum LowDeviceScore for value: lowDeviceScore + /// + [EnumMember(Value = "lowDeviceScore")] + LowDeviceScore = 19, + + /// + /// Enum LowPhoneNumberScore for value: lowPhoneNumberScore + /// + [EnumMember(Value = "lowPhoneNumberScore")] + LowPhoneNumberScore = 20, + + /// + /// Enum NumberOfActiveTokensGreaterThanThreshold for value: numberOfActiveTokensGreaterThanThreshold + /// + [EnumMember(Value = "numberOfActiveTokensGreaterThanThreshold")] + NumberOfActiveTokensGreaterThanThreshold = 21, + + /// + /// Enum NumberOfActiveTokensOnAllDevicesIsGreaterThanThreshold for value: numberOfActiveTokensOnAllDevicesIsGreaterThanThreshold + /// + [EnumMember(Value = "numberOfActiveTokensOnAllDevicesIsGreaterThanThreshold")] + NumberOfActiveTokensOnAllDevicesIsGreaterThanThreshold = 22, + + /// + /// Enum NumberOfDaysSinceDeviceWasLastReportedLostIsLessThanThresholdDays for value: numberOfDaysSinceDeviceWasLastReportedLostIsLessThanThresholdDays + /// + [EnumMember(Value = "numberOfDaysSinceDeviceWasLastReportedLostIsLessThanThresholdDays")] + NumberOfDaysSinceDeviceWasLastReportedLostIsLessThanThresholdDays = 23, + + /// + /// Enum NumberOfDevicesWithSameUseridWithTokenIsGreaterThanThreshold for value: numberOfDevicesWithSameUseridWithTokenIsGreaterThanThreshold + /// + [EnumMember(Value = "numberOfDevicesWithSameUseridWithTokenIsGreaterThanThreshold")] + NumberOfDevicesWithSameUseridWithTokenIsGreaterThanThreshold = 24, + + /// + /// Enum NumberOfTransactionsInLast12MonthsLessThanThresholdNumber for value: numberOfTransactionsInLast12MonthsLessThanThresholdNumber + /// + [EnumMember(Value = "numberOfTransactionsInLast12MonthsLessThanThresholdNumber")] + NumberOfTransactionsInLast12MonthsLessThanThresholdNumber = 25, + + /// + /// Enum OutSideHomeTerritory for value: outSideHomeTerritory + /// + [EnumMember(Value = "outSideHomeTerritory")] + OutSideHomeTerritory = 26, + + /// + /// Enum SuspendedCardsInTheWALLETAccountIsGreaterThanThreshold for value: suspendedCardsInTheWALLETAccountIsGreaterThanThreshold + /// + [EnumMember(Value = "suspendedCardsInTheWALLETAccountIsGreaterThanThreshold")] + SuspendedCardsInTheWALLETAccountIsGreaterThanThreshold = 27, + + /// + /// Enum SuspiciousActivity for value: suspiciousActivity + /// + [EnumMember(Value = "suspiciousActivity")] + SuspiciousActivity = 28, + + /// + /// Enum TheNumberOfProvisioningAttemptsAcrossAllCardsOnThisDeviceInTheLast24HoursExceedsTheThreshold for value: theNumberOfProvisioningAttemptsAcrossAllCardsOnThisDeviceInTheLast24HoursExceedsTheThreshold + /// + [EnumMember(Value = "theNumberOfProvisioningAttemptsAcrossAllCardsOnThisDeviceInTheLast24HoursExceedsTheThreshold")] + TheNumberOfProvisioningAttemptsAcrossAllCardsOnThisDeviceInTheLast24HoursExceedsTheThreshold = 29, + + /// + /// Enum TheWALLETAccountIntoWhichTheCardIsBeingProvisionedContainDistinctNamesGreaterThanThreshold for value: theWALLETAccountIntoWhichTheCardIsBeingProvisionedContainDistinctNamesGreaterThanThreshold + /// + [EnumMember(Value = "theWALLETAccountIntoWhichTheCardIsBeingProvisionedContainDistinctNamesGreaterThanThreshold")] + TheWALLETAccountIntoWhichTheCardIsBeingProvisionedContainDistinctNamesGreaterThanThreshold = 30, + + /// + /// Enum ThisAccountHasNotHadActivityWithinThresholdPeriod for value: thisAccountHasNotHadActivityWithinThresholdPeriod + /// + [EnumMember(Value = "thisAccountHasNotHadActivityWithinThresholdPeriod")] + ThisAccountHasNotHadActivityWithinThresholdPeriod = 31, + + /// + /// Enum TooManyDifferentCardholders for value: tooManyDifferentCardholders + /// + [EnumMember(Value = "tooManyDifferentCardholders")] + TooManyDifferentCardholders = 32, + + /// + /// Enum TooManyRecentAttempts for value: tooManyRecentAttempts + /// + [EnumMember(Value = "tooManyRecentAttempts")] + TooManyRecentAttempts = 33, + + /// + /// Enum TooManyRecentTokens for value: tooManyRecentTokens + /// + [EnumMember(Value = "tooManyRecentTokens")] + TooManyRecentTokens = 34, + + /// + /// Enum UnableToAssess for value: unableToAssess + /// + [EnumMember(Value = "unableToAssess")] + UnableToAssess = 35, + + /// + /// Enum Unknown for value: unknown + /// + [EnumMember(Value = "unknown")] + Unknown = 36, + + /// + /// Enum UserAccountWasCreatedWithinThresholdDays for value: userAccountWasCreatedWithinThresholdDays + /// + [EnumMember(Value = "userAccountWasCreatedWithinThresholdDays")] + UserAccountWasCreatedWithinThresholdDays = 37, + + /// + /// Enum UserDeviceReceivingEncryptedPaymentInstrumentDataIsDifferentThanTheOneThatIsProvisioningTheToken for value: userDeviceReceivingEncryptedPaymentInstrumentDataIsDifferentThanTheOneThatIsProvisioningTheToken + /// + [EnumMember(Value = "userDeviceReceivingEncryptedPaymentInstrumentDataIsDifferentThanTheOneThatIsProvisioningTheToken")] + UserDeviceReceivingEncryptedPaymentInstrumentDataIsDifferentThanTheOneThatIsProvisioningTheToken = 38, + + /// + /// Enum UsersAccountOnDeviceLessThanThresholdDays for value: usersAccountOnDeviceLessThanThresholdDays + /// + [EnumMember(Value = "usersAccountOnDeviceLessThanThresholdDays")] + UsersAccountOnDeviceLessThanThresholdDays = 39, + + /// + /// Enum WalletAccountCreatedWithinThresholdDays for value: walletAccountCreatedWithinThresholdDays + /// + [EnumMember(Value = "walletAccountCreatedWithinThresholdDays")] + WalletAccountCreatedWithinThresholdDays = 40, + + /// + /// Enum WalletAccountHolderNameOnFileDoesNotMatchCardholderEnteredName for value: walletAccountHolderNameOnFileDoesNotMatchCardholderEnteredName + /// + [EnumMember(Value = "walletAccountHolderNameOnFileDoesNotMatchCardholderEnteredName")] + WalletAccountHolderNameOnFileDoesNotMatchCardholderEnteredName = 41 + + } + + + + /// + /// A list of risk indicators triggered at the time of provisioning the network token. Some example values of risk indicators are: * **accountTooNewSinceLaunch** * **tooManyRecentAttempts** * **lowDeviceScore** * **lowAccountScore** + /// + /// A list of risk indicators triggered at the time of provisioning the network token. Some example values of risk indicators are: * **accountTooNewSinceLaunch** * **tooManyRecentAttempts** * **lowDeviceScore** * **lowAccountScore** + [DataMember(Name = "recommendationReasons", EmitDefaultValue = false)] + public List RecommendationReasons { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// The confidence score of the wallet account, calculated by the wallet provider. A high score means that account is considered trustworthy. A low score means that the account is considered suspicious. Possible values: **1** to **5**.. + /// device. + /// The confidence score of the device, calculated by the wallet provider. A high score means that device is considered trustworthy. A low score means that the device is considered suspicious. Possible values: **1** to **5**.. + /// The method used for provisioning the network token. Possible values: **push**, **manual**.. + /// A list of risk indicators triggered at the time of provisioning the network token. Some example values of risk indicators are: * **accountTooNewSinceLaunch** * **tooManyRecentAttempts** * **lowDeviceScore** * **lowAccountScore** . + /// The type of wallet that the network token is associated with. Possible values: **applePay**, **googlePay**, **garminPay**.. + public Wallet(string accountScore = default(string), Device device = default(Device), string deviceScore = default(string), string provisioningMethod = default(string), List recommendationReasons = default(List), string type = default(string)) + { + this.AccountScore = accountScore; + this.Device = device; + this.DeviceScore = deviceScore; + this.ProvisioningMethod = provisioningMethod; + this.RecommendationReasons = recommendationReasons; + this.Type = type; + } + + /// + /// The confidence score of the wallet account, calculated by the wallet provider. A high score means that account is considered trustworthy. A low score means that the account is considered suspicious. Possible values: **1** to **5**. + /// + /// The confidence score of the wallet account, calculated by the wallet provider. A high score means that account is considered trustworthy. A low score means that the account is considered suspicious. Possible values: **1** to **5**. + [DataMember(Name = "accountScore", EmitDefaultValue = false)] + public string AccountScore { get; set; } + + /// + /// Gets or Sets Device + /// + [DataMember(Name = "device", EmitDefaultValue = false)] + public Device Device { get; set; } + + /// + /// The confidence score of the device, calculated by the wallet provider. A high score means that device is considered trustworthy. A low score means that the device is considered suspicious. Possible values: **1** to **5**. + /// + /// The confidence score of the device, calculated by the wallet provider. A high score means that device is considered trustworthy. A low score means that the device is considered suspicious. Possible values: **1** to **5**. + [DataMember(Name = "deviceScore", EmitDefaultValue = false)] + public string DeviceScore { get; set; } + + /// + /// The method used for provisioning the network token. Possible values: **push**, **manual**. + /// + /// The method used for provisioning the network token. Possible values: **push**, **manual**. + [DataMember(Name = "provisioningMethod", EmitDefaultValue = false)] + public string ProvisioningMethod { get; set; } + + /// + /// The type of wallet that the network token is associated with. Possible values: **applePay**, **googlePay**, **garminPay**. + /// + /// The type of wallet that the network token is associated with. Possible values: **applePay**, **googlePay**, **garminPay**. + [DataMember(Name = "type", EmitDefaultValue = false)] + [Obsolete("Deprecated since Configuration webhooks v2. Use name of the `tokenRequestor` instead.")] + public string Type { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Wallet {\n"); + sb.Append(" AccountScore: ").Append(AccountScore).Append("\n"); + sb.Append(" Device: ").Append(Device).Append("\n"); + sb.Append(" DeviceScore: ").Append(DeviceScore).Append("\n"); + sb.Append(" ProvisioningMethod: ").Append(ProvisioningMethod).Append("\n"); + sb.Append(" RecommendationReasons: ").Append(RecommendationReasons).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Wallet); + } + + /// + /// Returns true if Wallet instances are equal + /// + /// Instance of Wallet to be compared + /// Boolean + public bool Equals(Wallet input) + { + if (input == null) + { + return false; + } + return + ( + this.AccountScore == input.AccountScore || + (this.AccountScore != null && + this.AccountScore.Equals(input.AccountScore)) + ) && + ( + this.Device == input.Device || + (this.Device != null && + this.Device.Equals(input.Device)) + ) && + ( + this.DeviceScore == input.DeviceScore || + (this.DeviceScore != null && + this.DeviceScore.Equals(input.DeviceScore)) + ) && + ( + this.ProvisioningMethod == input.ProvisioningMethod || + (this.ProvisioningMethod != null && + this.ProvisioningMethod.Equals(input.ProvisioningMethod)) + ) && + ( + this.RecommendationReasons == input.RecommendationReasons || + this.RecommendationReasons.SequenceEqual(input.RecommendationReasons) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AccountScore != null) + { + hashCode = (hashCode * 59) + this.AccountScore.GetHashCode(); + } + if (this.Device != null) + { + hashCode = (hashCode * 59) + this.Device.GetHashCode(); + } + if (this.DeviceScore != null) + { + hashCode = (hashCode * 59) + this.DeviceScore.GetHashCode(); + } + if (this.ProvisioningMethod != null) + { + hashCode = (hashCode * 59) + this.ProvisioningMethod.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RecommendationReasons.GetHashCode(); + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs b/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs index 43914f22e..b91ac3008 100644 --- a/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs +++ b/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs @@ -33,9 +33,9 @@ namespace Adyen.Model.LegalEntityManagement public partial class AcceptTermsOfServiceResponse : IEquatable, IValidatableObject { /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { @@ -91,15 +91,21 @@ public enum TypeEnum /// Enum AdyenPccr for value: adyenPccr /// [EnumMember(Value = "adyenPccr")] - AdyenPccr = 9 + AdyenPccr = 9, + + /// + /// Enum KycOnInvite for value: kycOnInvite + /// + [EnumMember(Value = "kycOnInvite")] + KycOnInvite = 10 } /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** [DataMember(Name = "type", EmitDefaultValue = false)] public TypeEnum? Type { get; set; } /// @@ -110,7 +116,7 @@ public enum TypeEnum /// The IP address of the user that accepted the Terms of Service.. /// The language used for the Terms of Service document, specified by the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: **en** for English.. /// The unique identifier of the Terms of Service document.. - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** . + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** . public AcceptTermsOfServiceResponse(string acceptedBy = default(string), string id = default(string), string ipAddress = default(string), string language = default(string), string termsOfServiceDocumentId = default(string), TypeEnum? type = default(TypeEnum?)) { this.AcceptedBy = acceptedBy; diff --git a/Adyen/Model/LegalEntityManagement/AdditionalBankIdentification.cs b/Adyen/Model/LegalEntityManagement/AdditionalBankIdentification.cs index 8b0a48558..e39455e1e 100644 --- a/Adyen/Model/LegalEntityManagement/AdditionalBankIdentification.cs +++ b/Adyen/Model/LegalEntityManagement/AdditionalBankIdentification.cs @@ -33,9 +33,9 @@ namespace Adyen.Model.LegalEntityManagement public partial class AdditionalBankIdentification : IEquatable, IValidatableObject { /// - /// The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. + /// The type of additional bank identification, depending on the country. Possible values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. * **caRoutingNumber**: The 9-digit [Canadian routing number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without separators or spaces. * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. /// - /// The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. + /// The type of additional bank identification, depending on the country. Possible values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. * **caRoutingNumber**: The 9-digit [Canadian routing number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without separators or spaces. * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { @@ -49,22 +49,33 @@ public enum TypeEnum /// Enum UsRoutingNumber for value: usRoutingNumber /// [EnumMember(Value = "usRoutingNumber")] - UsRoutingNumber = 2 + UsRoutingNumber = 2, + + /// + /// Enum AuBsbCode for value: auBsbCode + /// + [EnumMember(Value = "auBsbCode")] + AuBsbCode = 3, + /// + /// Enum CaRoutingNumber for value: caRoutingNumber + /// + [EnumMember(Value = "caRoutingNumber")] + CaRoutingNumber = 4 + } - /// - /// The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. + /// The type of additional bank identification, depending on the country. Possible values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. * **caRoutingNumber**: The 9-digit [Canadian routing number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without separators or spaces. * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. /// - /// The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. + /// The type of additional bank identification, depending on the country. Possible values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. * **caRoutingNumber**: The 9-digit [Canadian routing number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without separators or spaces. * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. [DataMember(Name = "type", EmitDefaultValue = false)] public TypeEnum? Type { get; set; } /// /// Initializes a new instance of the class. /// /// The value of the additional bank identification.. - /// The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces.. + /// The type of additional bank identification, depending on the country. Possible values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. * **caRoutingNumber**: The 9-digit [Canadian routing number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without separators or spaces. * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces.. public AdditionalBankIdentification(string code = default(string), TypeEnum? type = default(TypeEnum?)) { this.Code = code; diff --git a/Adyen/Model/LegalEntityManagement/Address.cs b/Adyen/Model/LegalEntityManagement/Address.cs index 838f8fee8..33f278fbd 100644 --- a/Adyen/Model/LegalEntityManagement/Address.cs +++ b/Adyen/Model/LegalEntityManagement/Address.cs @@ -42,7 +42,7 @@ protected Address() { } /// /// The name of the city. Required if `stateOrProvince` is provided. If you specify the city, you must also send `postalCode` and `street`.. /// The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. (required). - /// Postal code. Required if `stateOrProvince` and/or `city` is provided.. + /// The postal code. Required if `stateOrProvince` and/or `city` is provided. When using alphanumeric postal codes, all letters must be uppercase. For example, 1234 AB or SW1A 1AA.. /// The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`.. /// The name of the street, and the house or building number. Required if `stateOrProvince` and/or `city` is provided.. /// The apartment, unit, or suite number.. @@ -71,9 +71,9 @@ protected Address() { } public string Country { get; set; } /// - /// Postal code. Required if `stateOrProvince` and/or `city` is provided. + /// The postal code. Required if `stateOrProvince` and/or `city` is provided. When using alphanumeric postal codes, all letters must be uppercase. For example, 1234 AB or SW1A 1AA. /// - /// Postal code. Required if `stateOrProvince` and/or `city` is provided. + /// The postal code. Required if `stateOrProvince` and/or `city` is provided. When using alphanumeric postal codes, all letters must be uppercase. For example, 1234 AB or SW1A 1AA. [DataMember(Name = "postalCode", EmitDefaultValue = false)] public string PostalCode { get; set; } diff --git a/Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs b/Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs index 4cffb8946..9d9a0f1c8 100644 --- a/Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs +++ b/Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs @@ -90,7 +90,13 @@ public enum TermsOfServiceTypesEnum /// Enum AdyenPccr for value: adyenPccr /// [EnumMember(Value = "adyenPccr")] - AdyenPccr = 9 + AdyenPccr = 9, + + /// + /// Enum KycOnInvite for value: kycOnInvite + /// + [EnumMember(Value = "kycOnInvite")] + KycOnInvite = 10 } diff --git a/Adyen/Model/LegalEntityManagement/FinancialReport.cs b/Adyen/Model/LegalEntityManagement/FinancialReport.cs index 96a8d68e8..d16c30112 100644 --- a/Adyen/Model/LegalEntityManagement/FinancialReport.cs +++ b/Adyen/Model/LegalEntityManagement/FinancialReport.cs @@ -221,4 +221,4 @@ public override int GetHashCode() } } -} +} \ No newline at end of file diff --git a/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs b/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs index ea43ec103..33a5d6dec 100644 --- a/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs +++ b/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs @@ -33,9 +33,9 @@ namespace Adyen.Model.LegalEntityManagement public partial class GetTermsOfServiceDocumentRequest : IEquatable, IValidatableObject { /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { @@ -91,15 +91,21 @@ public enum TypeEnum /// Enum AdyenPccr for value: adyenPccr /// [EnumMember(Value = "adyenPccr")] - AdyenPccr = 9 + AdyenPccr = 9, + + /// + /// Enum KycOnInvite for value: kycOnInvite + /// + [EnumMember(Value = "kycOnInvite")] + KycOnInvite = 10 } /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] public TypeEnum Type { get; set; } /// @@ -112,7 +118,7 @@ protected GetTermsOfServiceDocumentRequest() { } /// /// The language to be used for the Terms of Service document, specified by the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: **en** for English. (required). /// The requested format for the Terms of Service document. Default value: JSON. Possible values: **JSON**, **PDF**, or **TXT**.. - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** (required). + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** (required). public GetTermsOfServiceDocumentRequest(string language = default(string), string termsOfServiceDocumentFormat = default(string), TypeEnum type = default(TypeEnum)) { this.Language = language; diff --git a/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs b/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs index 356ad6924..b155cf761 100644 --- a/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs +++ b/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs @@ -33,9 +33,9 @@ namespace Adyen.Model.LegalEntityManagement public partial class GetTermsOfServiceDocumentResponse : IEquatable, IValidatableObject { /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { @@ -91,15 +91,21 @@ public enum TypeEnum /// Enum AdyenPccr for value: adyenPccr /// [EnumMember(Value = "adyenPccr")] - AdyenPccr = 9 + AdyenPccr = 9, + + /// + /// Enum KycOnInvite for value: kycOnInvite + /// + [EnumMember(Value = "kycOnInvite")] + KycOnInvite = 10 } /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** [DataMember(Name = "type", EmitDefaultValue = false)] public TypeEnum? Type { get; set; } /// @@ -110,7 +116,7 @@ public enum TypeEnum /// The language used for the Terms of Service document, specified by the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: **en** for English.. /// The format of the Terms of Service document.. /// The unique identifier of the Terms of Service document.. - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** . + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** . public GetTermsOfServiceDocumentResponse(byte[] document = default(byte[]), string id = default(string), string language = default(string), string termsOfServiceDocumentFormat = default(string), string termsOfServiceDocumentId = default(string), TypeEnum? type = default(TypeEnum?)) { this.Document = document; diff --git a/Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs b/Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs index 1aa00d04a..09713eefb 100644 --- a/Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs +++ b/Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs @@ -33,9 +33,9 @@ namespace Adyen.Model.LegalEntityManagement public partial class TermsOfServiceAcceptanceInfo : IEquatable, IValidatableObject { /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** [JsonConverter(typeof(StringEnumConverter))] public enum TypeEnum { @@ -91,15 +91,21 @@ public enum TypeEnum /// Enum AdyenPccr for value: adyenPccr /// [EnumMember(Value = "adyenPccr")] - AdyenPccr = 9 + AdyenPccr = 9, + + /// + /// Enum KycOnInvite for value: kycOnInvite + /// + [EnumMember(Value = "kycOnInvite")] + KycOnInvite = 10 } /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** /// - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** [DataMember(Name = "type", EmitDefaultValue = false)] public TypeEnum? Type { get; set; } /// @@ -109,7 +115,7 @@ public enum TypeEnum /// The unique identifier of the legal entity for which the Terms of Service are accepted.. /// The date when the Terms of Service were accepted, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00.. /// An Adyen-generated reference for the accepted Terms of Service.. - /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** . + /// The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard** * **kycOnInvite** . /// The expiration date for the Terms of Service acceptance, in ISO 8601 extended format. For example, 2022-12-18T00:00:00+01:00.. public TermsOfServiceAcceptanceInfo(string acceptedBy = default(string), string acceptedFor = default(string), DateTime createdAt = default(DateTime), string id = default(string), TypeEnum? type = default(TypeEnum?), DateTime validTo = default(DateTime)) { diff --git a/Adyen/Model/Management/SplitConfigurationRule.cs b/Adyen/Model/Management/SplitConfigurationRule.cs index 40e6e5fb2..d82d51e76 100644 --- a/Adyen/Model/Management/SplitConfigurationRule.cs +++ b/Adyen/Model/Management/SplitConfigurationRule.cs @@ -55,8 +55,25 @@ public enum FundingSourceEnum /// Enum ANY for value: ANY /// [EnumMember(Value = "ANY")] - ANY = 3 + ANY = 3, + /// + /// Enum Charged for value: charged + /// + [EnumMember(Value = "charged")] + Charged = 4, + + /// + /// Enum DeferredDebit for value: deferred_debit + /// + [EnumMember(Value = "deferred_debit")] + DeferredDebit = 5, + + /// + /// Enum Prepaid for value: prepaid + /// + [EnumMember(Value = "prepaid")] + Prepaid = 6 } diff --git a/Adyen/Model/TerminalApi/EventToNotifyType.cs b/Adyen/Model/TerminalApi/EventToNotifyType.cs index 612cdca7b..6350f2988 100644 --- a/Adyen/Model/TerminalApi/EventToNotifyType.cs +++ b/Adyen/Model/TerminalApi/EventToNotifyType.cs @@ -1,7 +1,6 @@ namespace Adyen.Model.TerminalApi { /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] [System.SerializableAttribute] public enum EventToNotifyType { @@ -53,5 +52,14 @@ public enum EventToNotifyType /// Reject, + + /// Indicates that the terminal has established a network connection. + NetworkConnected, + + /// Indicates that the terminal has no longer a network connection. + NetworkDisconnected, + + /// Delivers the result (or timeout failure) of the Barcode scan. + ScanBarcodeResult, } -} \ No newline at end of file +} diff --git a/Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs index 9a20bae19..79ef5c400 100644 --- a/Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs +++ b/Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs @@ -35,16 +35,16 @@ public partial class BalancePlatformNotificationResponse : IEquatable /// Initializes a new instance of the class. /// - /// Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications).. + /// Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks).. public BalancePlatformNotificationResponse(string notificationResponse = default(string)) { this.NotificationResponse = notificationResponse; } /// - /// Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + /// Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks). /// - /// Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + /// Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks). [DataMember(Name = "notificationResponse", EmitDefaultValue = false)] public string NotificationResponse { get; set; } diff --git a/Adyen/Model/TransactionWebhooks/BankCategoryData.cs b/Adyen/Model/TransactionWebhooks/BankCategoryData.cs index 9eb725b4a..81b2565d2 100644 --- a/Adyen/Model/TransactionWebhooks/BankCategoryData.cs +++ b/Adyen/Model/TransactionWebhooks/BankCategoryData.cs @@ -33,9 +33,9 @@ namespace Adyen.Model.TransactionWebhooks public partial class BankCategoryData : IEquatable, IValidatableObject { /// - /// The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). + /// The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). /// - /// The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). + /// The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). [JsonConverter(typeof(StringEnumConverter))] public enum PriorityEnum { @@ -79,9 +79,9 @@ public enum PriorityEnum /// - /// The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). + /// The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). /// - /// The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). + /// The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). [DataMember(Name = "priority", EmitDefaultValue = false)] public PriorityEnum? Priority { get; set; } /// @@ -109,7 +109,7 @@ public enum TypeEnum /// /// Initializes a new instance of the class. /// - /// The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN).. + /// The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN).. /// **bank** (default to TypeEnum.Bank). public BankCategoryData(PriorityEnum? priority = default(PriorityEnum?), TypeEnum? type = TypeEnum.Bank) { diff --git a/Adyen/Model/TransactionWebhooks/IssuedCard.cs b/Adyen/Model/TransactionWebhooks/IssuedCard.cs index 35b807d17..7900f7bda 100644 --- a/Adyen/Model/TransactionWebhooks/IssuedCard.cs +++ b/Adyen/Model/TransactionWebhooks/IssuedCard.cs @@ -185,9 +185,10 @@ public enum TypeEnum /// relayedAuthorisationData. /// The identifier of the original payment. This ID is provided by the scheme and can be alphanumeric or numeric, depending on the scheme. The `schemeTraceID` should refer to an original `schemeUniqueTransactionID` provided in an earlier payment (not necessarily processed by Adyen). A `schemeTraceId` is typically available for authorization adjustments or recurring payments.. /// The unique identifier created by the scheme. This ID can be alphanumeric or numeric depending on the scheme.. + /// threeDSecure. /// **issuedCard** (default to TypeEnum.IssuedCard). /// The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information.. - public IssuedCard(string authorisationType = default(string), PanEntryModeEnum? panEntryMode = default(PanEntryModeEnum?), ProcessingTypeEnum? processingType = default(ProcessingTypeEnum?), RelayedAuthorisationData relayedAuthorisationData = default(RelayedAuthorisationData), string schemeTraceId = default(string), string schemeUniqueTransactionId = default(string), TypeEnum? type = TypeEnum.IssuedCard, List validationFacts = default(List)) + public IssuedCard(string authorisationType = default(string), PanEntryModeEnum? panEntryMode = default(PanEntryModeEnum?), ProcessingTypeEnum? processingType = default(ProcessingTypeEnum?), RelayedAuthorisationData relayedAuthorisationData = default(RelayedAuthorisationData), string schemeTraceId = default(string), string schemeUniqueTransactionId = default(string), ThreeDSecure threeDSecure = default(ThreeDSecure), TypeEnum? type = TypeEnum.IssuedCard, List validationFacts = default(List)) { this.AuthorisationType = authorisationType; this.PanEntryMode = panEntryMode; @@ -195,6 +196,7 @@ public enum TypeEnum this.RelayedAuthorisationData = relayedAuthorisationData; this.SchemeTraceId = schemeTraceId; this.SchemeUniqueTransactionId = schemeUniqueTransactionId; + this.ThreeDSecure = threeDSecure; this.Type = type; this.ValidationFacts = validationFacts; } @@ -226,6 +228,12 @@ public enum TypeEnum [DataMember(Name = "schemeUniqueTransactionId", EmitDefaultValue = false)] public string SchemeUniqueTransactionId { get; set; } + /// + /// Gets or Sets ThreeDSecure + /// + [DataMember(Name = "threeDSecure", EmitDefaultValue = false)] + public ThreeDSecure ThreeDSecure { get; set; } + /// /// The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information. /// @@ -247,6 +255,7 @@ public override string ToString() sb.Append(" RelayedAuthorisationData: ").Append(RelayedAuthorisationData).Append("\n"); sb.Append(" SchemeTraceId: ").Append(SchemeTraceId).Append("\n"); sb.Append(" SchemeUniqueTransactionId: ").Append(SchemeUniqueTransactionId).Append("\n"); + sb.Append(" ThreeDSecure: ").Append(ThreeDSecure).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" ValidationFacts: ").Append(ValidationFacts).Append("\n"); sb.Append("}\n"); @@ -312,6 +321,11 @@ public bool Equals(IssuedCard input) (this.SchemeUniqueTransactionId != null && this.SchemeUniqueTransactionId.Equals(input.SchemeUniqueTransactionId)) ) && + ( + this.ThreeDSecure == input.ThreeDSecure || + (this.ThreeDSecure != null && + this.ThreeDSecure.Equals(input.ThreeDSecure)) + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) @@ -351,6 +365,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.SchemeUniqueTransactionId.GetHashCode(); } + if (this.ThreeDSecure != null) + { + hashCode = (hashCode * 59) + this.ThreeDSecure.GetHashCode(); + } hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.ValidationFacts != null) { diff --git a/Adyen/Model/TransactionWebhooks/Resource.cs b/Adyen/Model/TransactionWebhooks/Resource.cs index d90729e37..4c51d2dfa 100644 --- a/Adyen/Model/TransactionWebhooks/Resource.cs +++ b/Adyen/Model/TransactionWebhooks/Resource.cs @@ -36,7 +36,7 @@ public partial class Resource : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// The unique identifier of the balance platform.. - /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.. + /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**.. /// The ID of the resource.. public Resource(string balancePlatform = default(string), DateTime creationDate = default(DateTime), string id = default(string)) { @@ -53,9 +53,9 @@ public partial class Resource : IEquatable, IValidatableObject public string BalancePlatform { get; set; } /// - /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**. /// - /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**. [DataMember(Name = "creationDate", EmitDefaultValue = false)] public DateTime CreationDate { get; set; } diff --git a/Adyen/Model/TransactionWebhooks/ThreeDSecure.cs b/Adyen/Model/TransactionWebhooks/ThreeDSecure.cs new file mode 100644 index 000000000..71b9254bb --- /dev/null +++ b/Adyen/Model/TransactionWebhooks/ThreeDSecure.cs @@ -0,0 +1,129 @@ +/* +* Transaction webhooks +* +* +* The version of the OpenAPI document: 4 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; + +namespace Adyen.Model.TransactionWebhooks +{ + /// + /// ThreeDSecure + /// + [DataContract(Name = "ThreeDSecure")] + public partial class ThreeDSecure : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The transaction identifier for the Access Control Server. + public ThreeDSecure(string acsTransactionId = default(string)) + { + this.AcsTransactionId = acsTransactionId; + } + + /// + /// The transaction identifier for the Access Control Server + /// + /// The transaction identifier for the Access Control Server + [DataMember(Name = "acsTransactionId", EmitDefaultValue = false)] + public string AcsTransactionId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ThreeDSecure {\n"); + sb.Append(" AcsTransactionId: ").Append(AcsTransactionId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ThreeDSecure); + } + + /// + /// Returns true if ThreeDSecure instances are equal + /// + /// Instance of ThreeDSecure to be compared + /// Boolean + public bool Equals(ThreeDSecure input) + { + if (input == null) + { + return false; + } + return + ( + this.AcsTransactionId == input.AcsTransactionId || + (this.AcsTransactionId != null && + this.AcsTransactionId.Equals(input.AcsTransactionId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AcsTransactionId != null) + { + hashCode = (hashCode * 59) + this.AcsTransactionId.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/TransactionWebhooks/Transaction.cs b/Adyen/Model/TransactionWebhooks/Transaction.cs index 60ad7b697..9e0614204 100644 --- a/Adyen/Model/TransactionWebhooks/Transaction.cs +++ b/Adyen/Model/TransactionWebhooks/Transaction.cs @@ -73,7 +73,7 @@ protected Transaction() { } /// balanceAccount (required). /// The unique identifier of the balance platform. (required). /// The date the transaction was booked into the balance account. (required). - /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.. + /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**.. /// The `description` from the `/transfers` request.. /// The unique identifier of the transaction. (required). /// paymentInstrument. @@ -131,9 +131,9 @@ protected Transaction() { } public DateTime BookingDate { get; set; } /// - /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**. /// - /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + /// The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**. [DataMember(Name = "creationDate", EmitDefaultValue = false)] public DateTime CreationDate { get; set; } diff --git a/Adyen/Model/TransferWebhooks/AdditionalBankIdentification.cs b/Adyen/Model/TransferWebhooks/AdditionalBankIdentification.cs index 08e15d14c..a87e5399e 100644 --- a/Adyen/Model/TransferWebhooks/AdditionalBankIdentification.cs +++ b/Adyen/Model/TransferWebhooks/AdditionalBankIdentification.cs @@ -49,8 +49,20 @@ public enum TypeEnum /// Enum UsRoutingNumber for value: usRoutingNumber /// [EnumMember(Value = "usRoutingNumber")] - UsRoutingNumber = 2 + UsRoutingNumber = 2, + + /// + /// Enum AuBsbCode for value: auBsbCode + /// + [EnumMember(Value = "auBsbCode")] + AuBsbCode = 3, + /// + /// Enum CaRoutingNumber for value: caRoutingNumber + /// + [EnumMember(Value = "caRoutingNumber")] + CaRoutingNumber = 4 + } diff --git a/Adyen/Model/Transfers/AdditionalBankIdentification.cs b/Adyen/Model/Transfers/AdditionalBankIdentification.cs index fe6830f37..a25b56001 100644 --- a/Adyen/Model/Transfers/AdditionalBankIdentification.cs +++ b/Adyen/Model/Transfers/AdditionalBankIdentification.cs @@ -49,7 +49,19 @@ public enum TypeEnum /// Enum UsRoutingNumber for value: usRoutingNumber /// [EnumMember(Value = "usRoutingNumber")] - UsRoutingNumber = 2 + UsRoutingNumber = 2, + + /// + /// Enum AuBsbCode for value: auBsbCode + /// + [EnumMember(Value = "auBsbCode")] + AuBsbCode = 3, + + /// + /// Enum CaRoutingNumber for value: caRoutingNumber + /// + [EnumMember(Value = "caRoutingNumber")] + CaRoutingNumber = 4 } diff --git a/Adyen/Service/Checkout/DonationsService.cs b/Adyen/Service/Checkout/DonationsService.cs index 1ec1878f2..ba1a57496 100644 --- a/Adyen/Service/Checkout/DonationsService.cs +++ b/Adyen/Service/Checkout/DonationsService.cs @@ -1,1166 +1,99 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections.Generic; -using System.Net; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; using System.Net.Http; -using System.Net.Http.Headers; -using System.Text.Json; -using Adyen.Client; +using System.Threading; +using System.Threading.Tasks; +using Adyen.Model; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// Represents a collection of functions to interact with the API endpoints - /// This class is registered as transient. + /// DonationsService Interface /// - public interface IDonationsService : IApi + public interface IDonationsService { - /// - /// The class containing the events - /// - DonationsServiceEvents Events { get; } - /// /// Get a list of donation campaigns. /// - /// - /// Queries the available donation campaigns for a donation based on the donation context (like merchant account, currency, and locale). The response contains active donation campaigns. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task DonationCampaignsAsync(Option idempotencyKey = default, Option donationCampaignsRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.DonationCampaignsResponse DonationCampaigns(DonationCampaignsRequest donationCampaignsRequest = default, RequestOptions requestOptions = default); + /// /// Get a list of donation campaigns. /// - /// - /// Queries the available donation campaigns for a donation based on the donation context (like merchant account, currency, and locale). The response contains active donation campaigns. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task DonationCampaignsOrDefaultAsync(Option idempotencyKey = default, Option donationCampaignsRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task DonationCampaignsAsync(DonationCampaignsRequest donationCampaignsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Start a transaction for donations /// - /// - /// Takes in the donation token generated by the `/payments` request and uses it to make the donation for the donation account specified in the request. For more information, see [Donations](https://docs.adyen.com/online-payments/donations). - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task DonationsAsync(Option idempotencyKey = default, Option donationPaymentRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.DonationPaymentResponse Donations(DonationPaymentRequest donationPaymentRequest = default, RequestOptions requestOptions = default); + /// /// Start a transaction for donations /// - /// - /// Takes in the donation token generated by the `/payments` request and uses it to make the donation for the donation account specified in the request. For more information, see [Donations](https://docs.adyen.com/online-payments/donations). - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task DonationsOrDefaultAsync(Option idempotencyKey = default, Option donationPaymentRequest = default, System.Threading.CancellationToken cancellationToken = default); - } - - /// - /// The - /// - public interface IDonationCampaignsApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// The - /// - public interface IDonationsApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class DonationsServiceEvents - { - /// - /// The event raised after the server response - /// - public event EventHandler OnDonationCampaigns; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorDonationCampaigns; - - internal void ExecuteOnDonationCampaigns(DonationsService.DonationCampaignsApiResponse apiResponse) - { - OnDonationCampaigns?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorDonationCampaigns(Exception exception) - { - OnErrorDonationCampaigns?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnDonations; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorDonations; - - internal void ExecuteOnDonations(DonationsService.DonationsApiResponse apiResponse) - { - OnDonations?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorDonations(Exception exception) - { - OnErrorDonations?.Invoke(this, new ExceptionEventArgs(exception)); - } + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task DonationsAsync(DonationPaymentRequest donationPaymentRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + } - + /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the DonationsService API endpoints /// - public sealed partial class DonationsService : IDonationsService + public class DonationsService : AbstractService, IDonationsService { - private JsonSerializerOptions _jsonSerializerOptions; - - /// - /// The logger factory - /// - public ILoggerFactory LoggerFactory { get; } - - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The HttpClient - /// - public System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The class containing the events - /// - public DonationsServiceEvents Events { get; } - - /// - /// A token provider of type - /// - public TokenProvider ApiKeyProvider { get; } - - /// - /// A token provider of type - /// - public TokenProvider BasicTokenProvider { get; } - - /// - /// Initializes a new instance of the class. - /// - /// - public DonationsService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DonationsServiceEvents donationsServiceEvents, - TokenProvider apiKeyProvider, - TokenProvider basicTokenProvider) - { - _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; - LoggerFactory = loggerFactory; - Logger = LoggerFactory.CreateLogger(); - HttpClient = httpClient; - Events = donationsServiceEvents; - ApiKeyProvider = apiKeyProvider; - BasicTokenProvider = basicTokenProvider; - } - - partial void FormatDonationCampaigns(ref string idempotencyKey, DonationCampaignsRequest donationCampaignsRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateDonationCampaigns(string idempotencyKey, DonationCampaignsRequest donationCampaignsRequest) - { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (donationCampaignsRequest.IsSet && donationCampaignsRequest.Value == null) - throw new ArgumentNullException(nameof(donationCampaignsRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterDonationCampaignsDefaultImplementation(IDonationCampaignsApiResponse apiResponseLocalVar, string idempotencyKey, DonationCampaignsRequest donationCampaignsRequest) - { - bool suppressDefaultLog = false; - AfterDonationCampaigns(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, donationCampaignsRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterDonationCampaigns(ref bool suppressDefaultLog, IDonationCampaignsApiResponse apiResponseLocalVar, string idempotencyKey, DonationCampaignsRequest donationCampaignsRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorDonationCampaignsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, DonationCampaignsRequest donationCampaignsRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorDonationCampaigns(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, donationCampaignsRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorDonationCampaigns(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, DonationCampaignsRequest donationCampaignsRequest); - - /// - /// Get a list of donation campaigns. Queries the available donation campaigns for a donation based on the donation context (like merchant account, currency, and locale). The response contains active donation campaigns. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task DonationCampaignsOrDefaultAsync(Option idempotencyKey = default, Option donationCampaignsRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await DonationCampaignsAsync(idempotencyKey, donationCampaignsRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Get a list of donation campaigns. Queries the available donation campaigns for a donation based on the donation context (like merchant account, currency, and locale). The response contains active donation campaigns. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task DonationCampaignsAsync(Option idempotencyKey = default, Option donationCampaignsRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateDonationCampaigns(idempotencyKey, donationCampaignsRequest); - - FormatDonationCampaigns(ref idempotencyKey, donationCampaignsRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/donationCampaigns"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (donationCampaignsRequest.IsSet) - httpRequestMessageLocalVar.Content = (donationCampaignsRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(donationCampaignsRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - DonationCampaignsApiResponse apiResponseLocalVar = new DonationCampaignsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/donationCampaigns", requestedAtLocalVar, _jsonSerializerOptions); - - AfterDonationCampaignsDefaultImplementation(apiResponseLocalVar, idempotencyKey, donationCampaignsRequest); - - Events.ExecuteOnDonationCampaigns(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorDonationCampaignsDefaultImplementation(e, "/donationCampaigns", uriBuilderLocalVar.Path, idempotencyKey, donationCampaignsRequest); - Events.ExecuteOnErrorDonationCampaigns(e); - throw; - } - } - - /// - /// The - /// - public partial class DonationCampaignsApiResponse : Adyen.Client.ApiResponse, IDonationCampaignsApiResponse + private readonly string _baseUrl; + + public DonationsService(AdyenClient client) : base(client) { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public DonationCampaignsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.DonationCampaignsResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.DonationCampaignsResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatDonations(ref string idempotencyKey, DonationPaymentRequest donationPaymentRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateDonations(string idempotencyKey, DonationPaymentRequest donationPaymentRequest) - { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (donationPaymentRequest.IsSet && donationPaymentRequest.Value == null) - throw new ArgumentNullException(nameof(donationPaymentRequest)); + _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterDonationsDefaultImplementation(IDonationsApiResponse apiResponseLocalVar, string idempotencyKey, DonationPaymentRequest donationPaymentRequest) - { - bool suppressDefaultLog = false; - AfterDonations(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, donationPaymentRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterDonations(ref bool suppressDefaultLog, IDonationsApiResponse apiResponseLocalVar, string idempotencyKey, DonationPaymentRequest donationPaymentRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorDonationsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, DonationPaymentRequest donationPaymentRequest) + + public Model.Checkout.DonationCampaignsResponse DonationCampaigns(DonationCampaignsRequest donationCampaignsRequest = default, RequestOptions requestOptions = default) { - bool suppressDefaultLogLocalVar = false; - OnErrorDonations(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, donationPaymentRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + return DonationCampaignsAsync(donationCampaignsRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorDonations(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, DonationPaymentRequest donationPaymentRequest); - - /// - /// Start a transaction for donations Takes in the donation token generated by the `/payments` request and uses it to make the donation for the donation account specified in the request. For more information, see [Donations](https://docs.adyen.com/online-payments/donations). - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task DonationsOrDefaultAsync(Option idempotencyKey = default, Option donationPaymentRequest = default, System.Threading.CancellationToken cancellationToken = default) + public async Task DonationCampaignsAsync(DonationCampaignsRequest donationCampaignsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - try - { - return await DonationsAsync(idempotencyKey, donationPaymentRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } + var endpoint = _baseUrl + "/donationCampaigns"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(donationCampaignsRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - /// - /// Start a transaction for donations Takes in the donation token generated by the `/payments` request and uses it to make the donation for the donation account specified in the request. For more information, see [Donations](https://docs.adyen.com/online-payments/donations). - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task DonationsAsync(Option idempotencyKey = default, Option donationPaymentRequest = default, System.Threading.CancellationToken cancellationToken = default) + + public Model.Checkout.DonationPaymentResponse Donations(DonationPaymentRequest donationPaymentRequest = default, RequestOptions requestOptions = default) { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateDonations(idempotencyKey, donationPaymentRequest); - - FormatDonations(ref idempotencyKey, donationPaymentRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/donations"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (donationPaymentRequest.IsSet) - httpRequestMessageLocalVar.Content = (donationPaymentRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(donationPaymentRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - DonationsApiResponse apiResponseLocalVar = new DonationsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/donations", requestedAtLocalVar, _jsonSerializerOptions); - - AfterDonationsDefaultImplementation(apiResponseLocalVar, idempotencyKey, donationPaymentRequest); - - Events.ExecuteOnDonations(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorDonationsDefaultImplementation(e, "/donations", uriBuilderLocalVar.Path, idempotencyKey, donationPaymentRequest); - Events.ExecuteOnErrorDonations(e); - throw; - } + return DonationsAsync(donationPaymentRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// The - /// - public partial class DonationsApiResponse : Adyen.Client.ApiResponse, IDonationsApiResponse + public async Task DonationsAsync(DonationPaymentRequest donationPaymentRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public DonationsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.DonationPaymentResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.DonationPaymentResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + var endpoint = _baseUrl + "/donations"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(donationPaymentRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } } -} +} \ No newline at end of file diff --git a/Adyen/Service/Checkout/ModificationsService.cs b/Adyen/Service/Checkout/ModificationsService.cs index 9c2304907..dd755c4c6 100644 --- a/Adyen/Service/Checkout/ModificationsService.cs +++ b/Adyen/Service/Checkout/ModificationsService.cs @@ -1,3371 +1,225 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections.Generic; -using System.Net; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; using System.Net.Http; -using System.Net.Http.Headers; -using System.Text.Json; -using Adyen.Client; +using System.Threading; +using System.Threading.Tasks; +using Adyen.Model; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// Represents a collection of functions to interact with the API endpoints - /// This class is registered as transient. + /// ModificationsService Interface /// - public interface IModificationsService : IApi + public interface IModificationsService { - /// - /// The class containing the events - /// - ModificationsServiceEvents Events { get; } - /// /// Cancel an authorised payment /// - /// - /// Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**TECHNICAL_CANCEL** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment using the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/payments/{paymentPspReference}/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task CancelAuthorisedPaymentAsync(Option idempotencyKey = default, Option standalonePaymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.StandalonePaymentCancelResponse CancelAuthorisedPayment(StandalonePaymentCancelRequest standalonePaymentCancelRequest = default, RequestOptions requestOptions = default); + /// /// Cancel an authorised payment /// - /// - /// Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**TECHNICAL_CANCEL** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment using the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/payments/{paymentPspReference}/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task CancelAuthorisedPaymentOrDefaultAsync(Option idempotencyKey = default, Option standalonePaymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task CancelAuthorisedPaymentAsync(StandalonePaymentCancelRequest standalonePaymentCancelRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Cancel an authorised payment /// - /// - /// Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCELLATION** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment but don't have the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). - /// - /// Thrown when fails to make API call - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task CancelAuthorisedPaymentByPspReferenceAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. + /// - + /// - Additional request options. + /// . + Model.Checkout.PaymentCancelResponse CancelAuthorisedPaymentByPspReference(string paymentPspReference, PaymentCancelRequest paymentCancelRequest = default, RequestOptions requestOptions = default); + /// /// Cancel an authorised payment /// - /// - /// Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCELLATION** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment but don't have the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). - /// - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task CancelAuthorisedPaymentByPspReferenceOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task CancelAuthorisedPaymentByPspReferenceAsync(string paymentPspReference, PaymentCancelRequest paymentCancelRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Capture an authorised payment /// - /// - /// Captures an authorised payment and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CAPTURE** webhook](https://docs.adyen.com/online-payments/capture#capture-notification). You can capture either the full authorised amount or a part of the authorised amount. By default, any unclaimed amount after a partial capture gets cancelled. This does not apply if you enabled multiple partial captures on your account and the payment method supports multiple partial captures. [Automatic capture](https://docs.adyen.com/online-payments/capture#automatic-capture) is the default setting for most payment methods. In these cases, you don't need to make capture requests. However, making capture requests for payments that are captured automatically does not result in double charges. For more information, refer to [Capture](https://docs.adyen.com/online-payments/capture). - /// - /// Thrown when fails to make API call - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task CaptureAuthorisedPaymentAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCaptureRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. + /// - + /// - Additional request options. + /// . + Model.Checkout.PaymentCaptureResponse CaptureAuthorisedPayment(string paymentPspReference, PaymentCaptureRequest paymentCaptureRequest = default, RequestOptions requestOptions = default); + /// /// Capture an authorised payment /// - /// - /// Captures an authorised payment and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CAPTURE** webhook](https://docs.adyen.com/online-payments/capture#capture-notification). You can capture either the full authorised amount or a part of the authorised amount. By default, any unclaimed amount after a partial capture gets cancelled. This does not apply if you enabled multiple partial captures on your account and the payment method supports multiple partial captures. [Automatic capture](https://docs.adyen.com/online-payments/capture#automatic-capture) is the default setting for most payment methods. In these cases, you don't need to make capture requests. However, making capture requests for payments that are captured automatically does not result in double charges. For more information, refer to [Capture](https://docs.adyen.com/online-payments/capture). - /// - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task CaptureAuthorisedPaymentOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCaptureRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task CaptureAuthorisedPaymentAsync(string paymentPspReference, PaymentCaptureRequest paymentCaptureRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Refund a captured payment /// - /// - /// Refunds a payment that has been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**REFUND** webhook](https://docs.adyen.com/online-payments/refund#refund-webhook). You can refund either the full captured amount or a part of the captured amount. You can also perform multiple partial refunds, as long as their sum doesn't exceed the captured amount. > Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as [cards](https://docs.adyen.com/payment-methods/cards#supported-cards), [iDEAL](https://docs.adyen.com/payment-methods/ideal), or [Klarna](https://docs.adyen.com/payment-methods/klarna). If you want to refund a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Refund](https://docs.adyen.com/online-payments/refund). - /// - /// Thrown when fails to make API call - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task RefundCapturedPaymentAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentRefundRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. + /// - + /// - Additional request options. + /// . + Model.Checkout.PaymentRefundResponse RefundCapturedPayment(string paymentPspReference, PaymentRefundRequest paymentRefundRequest = default, RequestOptions requestOptions = default); + /// /// Refund a captured payment /// - /// - /// Refunds a payment that has been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**REFUND** webhook](https://docs.adyen.com/online-payments/refund#refund-webhook). You can refund either the full captured amount or a part of the captured amount. You can also perform multiple partial refunds, as long as their sum doesn't exceed the captured amount. > Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as [cards](https://docs.adyen.com/payment-methods/cards#supported-cards), [iDEAL](https://docs.adyen.com/payment-methods/ideal), or [Klarna](https://docs.adyen.com/payment-methods/klarna). If you want to refund a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Refund](https://docs.adyen.com/online-payments/refund). - /// - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task RefundCapturedPaymentOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentRefundRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task RefundCapturedPaymentAsync(string paymentPspReference, PaymentRefundRequest paymentRefundRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Refund or cancel a payment /// - /// - /// [Refunds](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/refunds) a payment if it has already been captured, and [cancels](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) a payment if it has not yet been captured. Returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCEL_OR_REFUND** webhook](https://docs.adyen.com/online-payments/reverse#cancel-or-refund-webhook). The reversed amount is always the full payment amount. > Do not use this request for payments that involve multiple partial captures. For more information, refer to [Reversal](https://docs.adyen.com/online-payments/reversal). - /// - /// Thrown when fails to make API call - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task RefundOrCancelPaymentAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentReversalRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. + /// - + /// - Additional request options. + /// . + Model.Checkout.PaymentReversalResponse RefundOrCancelPayment(string paymentPspReference, PaymentReversalRequest paymentReversalRequest = default, RequestOptions requestOptions = default); + /// /// Refund or cancel a payment /// - /// - /// [Refunds](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/refunds) a payment if it has already been captured, and [cancels](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) a payment if it has not yet been captured. Returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCEL_OR_REFUND** webhook](https://docs.adyen.com/online-payments/reverse#cancel-or-refund-webhook). The reversed amount is always the full payment amount. > Do not use this request for payments that involve multiple partial captures. For more information, refer to [Reversal](https://docs.adyen.com/online-payments/reversal). - /// - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task RefundOrCancelPaymentOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentReversalRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task RefundOrCancelPaymentAsync(string paymentPspReference, PaymentReversalRequest paymentReversalRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Update an authorised amount /// - /// - /// Increases or decreases the authorised payment amount and returns a unique reference for this request. You get the outcome of the request asynchronously, in an [**AUTHORISATION_ADJUSTMENT** webhook](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes). You can only update authorised amounts that have not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures). The amount you specify in the request is the updated amount, which is larger or smaller than the initial authorised amount. For more information, refer to [Authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#use-cases). - /// - /// Thrown when fails to make API call - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task UpdateAuthorisedAmountAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentAmountUpdateRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. + /// - + /// - Additional request options. + /// . + Model.Checkout.PaymentAmountUpdateResponse UpdateAuthorisedAmount(string paymentPspReference, PaymentAmountUpdateRequest paymentAmountUpdateRequest = default, RequestOptions requestOptions = default); + /// /// Update an authorised amount /// - /// - /// Increases or decreases the authorised payment amount and returns a unique reference for this request. You get the outcome of the request asynchronously, in an [**AUTHORISATION_ADJUSTMENT** webhook](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes). You can only update authorised amounts that have not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures). The amount you specify in the request is the updated amount, which is larger or smaller than the initial authorised amount. For more information, refer to [Authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#use-cases). - /// - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task UpdateAuthorisedAmountOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentAmountUpdateRequest = default, System.Threading.CancellationToken cancellationToken = default); - } - - /// - /// The - /// - public interface ICancelAuthorisedPaymentApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 201 Created - /// - /// - bool IsCreated { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// The - /// - public interface ICancelAuthorisedPaymentByPspReferenceApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 201 Created - /// - /// - bool IsCreated { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// The - /// - public interface ICaptureAuthorisedPaymentApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 201 Created - /// - /// - bool IsCreated { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// The - /// - public interface IRefundCapturedPaymentApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 201 Created - /// - /// - bool IsCreated { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// The - /// - public interface IRefundOrCancelPaymentApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 201 Created - /// - /// - bool IsCreated { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// The - /// - public interface IUpdateAuthorisedAmountApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 201 Created - /// - /// - bool IsCreated { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } + /// - The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task UpdateAuthorisedAmountAsync(string paymentPspReference, PaymentAmountUpdateRequest paymentAmountUpdateRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + } - + /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the ModificationsService API endpoints /// - public class ModificationsServiceEvents + public class ModificationsService : AbstractService, IModificationsService { - /// - /// The event raised after the server response - /// - public event EventHandler OnCancelAuthorisedPayment; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorCancelAuthorisedPayment; - - internal void ExecuteOnCancelAuthorisedPayment(ModificationsService.CancelAuthorisedPaymentApiResponse apiResponse) - { - OnCancelAuthorisedPayment?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorCancelAuthorisedPayment(Exception exception) - { - OnErrorCancelAuthorisedPayment?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnCancelAuthorisedPaymentByPspReference; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorCancelAuthorisedPaymentByPspReference; - - internal void ExecuteOnCancelAuthorisedPaymentByPspReference(ModificationsService.CancelAuthorisedPaymentByPspReferenceApiResponse apiResponse) - { - OnCancelAuthorisedPaymentByPspReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorCancelAuthorisedPaymentByPspReference(Exception exception) - { - OnErrorCancelAuthorisedPaymentByPspReference?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnCaptureAuthorisedPayment; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorCaptureAuthorisedPayment; - - internal void ExecuteOnCaptureAuthorisedPayment(ModificationsService.CaptureAuthorisedPaymentApiResponse apiResponse) - { - OnCaptureAuthorisedPayment?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorCaptureAuthorisedPayment(Exception exception) + private readonly string _baseUrl; + + public ModificationsService(AdyenClient client) : base(client) { - OnErrorCaptureAuthorisedPayment?.Invoke(this, new ExceptionEventArgs(exception)); + _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } - - /// - /// The event raised after the server response - /// - public event EventHandler OnRefundCapturedPayment; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorRefundCapturedPayment; - - internal void ExecuteOnRefundCapturedPayment(ModificationsService.RefundCapturedPaymentApiResponse apiResponse) + + public Model.Checkout.StandalonePaymentCancelResponse CancelAuthorisedPayment(StandalonePaymentCancelRequest standalonePaymentCancelRequest = default, RequestOptions requestOptions = default) { - OnRefundCapturedPayment?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + return CancelAuthorisedPaymentAsync(standalonePaymentCancelRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - internal void ExecuteOnErrorRefundCapturedPayment(Exception exception) + public async Task CancelAuthorisedPaymentAsync(StandalonePaymentCancelRequest standalonePaymentCancelRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - OnErrorRefundCapturedPayment?.Invoke(this, new ExceptionEventArgs(exception)); + var endpoint = _baseUrl + "/cancels"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(standalonePaymentCancelRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - /// - /// The event raised after the server response - /// - public event EventHandler OnRefundOrCancelPayment; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorRefundOrCancelPayment; - - internal void ExecuteOnRefundOrCancelPayment(ModificationsService.RefundOrCancelPaymentApiResponse apiResponse) + + public Model.Checkout.PaymentCancelResponse CancelAuthorisedPaymentByPspReference(string paymentPspReference, PaymentCancelRequest paymentCancelRequest = default, RequestOptions requestOptions = default) { - OnRefundOrCancelPayment?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + return CancelAuthorisedPaymentByPspReferenceAsync(paymentPspReference, paymentCancelRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - internal void ExecuteOnErrorRefundOrCancelPayment(Exception exception) + public async Task CancelAuthorisedPaymentByPspReferenceAsync(string paymentPspReference, PaymentCancelRequest paymentCancelRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - OnErrorRefundOrCancelPayment?.Invoke(this, new ExceptionEventArgs(exception)); + var endpoint = _baseUrl + $"/payments/{paymentPspReference}/cancels"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(paymentCancelRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - /// - /// The event raised after the server response - /// - public event EventHandler OnUpdateAuthorisedAmount; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorUpdateAuthorisedAmount; - - internal void ExecuteOnUpdateAuthorisedAmount(ModificationsService.UpdateAuthorisedAmountApiResponse apiResponse) + + public Model.Checkout.PaymentCaptureResponse CaptureAuthorisedPayment(string paymentPspReference, PaymentCaptureRequest paymentCaptureRequest = default, RequestOptions requestOptions = default) { - OnUpdateAuthorisedAmount?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + return CaptureAuthorisedPaymentAsync(paymentPspReference, paymentCaptureRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - internal void ExecuteOnErrorUpdateAuthorisedAmount(Exception exception) + public async Task CaptureAuthorisedPaymentAsync(string paymentPspReference, PaymentCaptureRequest paymentCaptureRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - OnErrorUpdateAuthorisedAmount?.Invoke(this, new ExceptionEventArgs(exception)); + var endpoint = _baseUrl + $"/payments/{paymentPspReference}/captures"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(paymentCaptureRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public sealed partial class ModificationsService : IModificationsService - { - private JsonSerializerOptions _jsonSerializerOptions; - - /// - /// The logger factory - /// - public ILoggerFactory LoggerFactory { get; } - - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The HttpClient - /// - public System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The class containing the events - /// - public ModificationsServiceEvents Events { get; } - - /// - /// A token provider of type - /// - public TokenProvider ApiKeyProvider { get; } - - /// - /// A token provider of type - /// - public TokenProvider BasicTokenProvider { get; } - - /// - /// Initializes a new instance of the class. - /// - /// - public ModificationsService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, ModificationsServiceEvents modificationsServiceEvents, - TokenProvider apiKeyProvider, - TokenProvider basicTokenProvider) + + public Model.Checkout.PaymentRefundResponse RefundCapturedPayment(string paymentPspReference, PaymentRefundRequest paymentRefundRequest = default, RequestOptions requestOptions = default) { - _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; - LoggerFactory = loggerFactory; - Logger = LoggerFactory.CreateLogger(); - HttpClient = httpClient; - Events = modificationsServiceEvents; - ApiKeyProvider = apiKeyProvider; - BasicTokenProvider = basicTokenProvider; + return RefundCapturedPaymentAsync(paymentPspReference, paymentRefundRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - partial void FormatCancelAuthorisedPayment(ref string idempotencyKey, StandalonePaymentCancelRequest standalonePaymentCancelRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateCancelAuthorisedPayment(string idempotencyKey, StandalonePaymentCancelRequest standalonePaymentCancelRequest) + public async Task RefundCapturedPaymentAsync(string paymentPspReference, PaymentRefundRequest paymentRefundRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (standalonePaymentCancelRequest.IsSet && standalonePaymentCancelRequest.Value == null) - throw new ArgumentNullException(nameof(standalonePaymentCancelRequest)); + var endpoint = _baseUrl + $"/payments/{paymentPspReference}/refunds"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(paymentRefundRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterCancelAuthorisedPaymentDefaultImplementation(ICancelAuthorisedPaymentApiResponse apiResponseLocalVar, string idempotencyKey, StandalonePaymentCancelRequest standalonePaymentCancelRequest) + + public Model.Checkout.PaymentReversalResponse RefundOrCancelPayment(string paymentPspReference, PaymentReversalRequest paymentReversalRequest = default, RequestOptions requestOptions = default) { - bool suppressDefaultLog = false; - AfterCancelAuthorisedPayment(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, standalonePaymentCancelRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + return RefundOrCancelPaymentAsync(paymentPspReference, paymentReversalRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterCancelAuthorisedPayment(ref bool suppressDefaultLog, ICancelAuthorisedPaymentApiResponse apiResponseLocalVar, string idempotencyKey, StandalonePaymentCancelRequest standalonePaymentCancelRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorCancelAuthorisedPaymentDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, StandalonePaymentCancelRequest standalonePaymentCancelRequest) + public async Task RefundOrCancelPaymentAsync(string paymentPspReference, PaymentReversalRequest paymentReversalRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - bool suppressDefaultLogLocalVar = false; - OnErrorCancelAuthorisedPayment(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, standalonePaymentCancelRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + var endpoint = _baseUrl + $"/payments/{paymentPspReference}/reversals"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(paymentReversalRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorCancelAuthorisedPayment(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, StandalonePaymentCancelRequest standalonePaymentCancelRequest); - - /// - /// Cancel an authorised payment Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**TECHNICAL_CANCEL** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment using the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/payments/{paymentPspReference}/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task CancelAuthorisedPaymentOrDefaultAsync(Option idempotencyKey = default, Option standalonePaymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default) + + public Model.Checkout.PaymentAmountUpdateResponse UpdateAuthorisedAmount(string paymentPspReference, PaymentAmountUpdateRequest paymentAmountUpdateRequest = default, RequestOptions requestOptions = default) { - try - { - return await CancelAuthorisedPaymentAsync(idempotencyKey, standalonePaymentCancelRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } + return UpdateAuthorisedAmountAsync(paymentPspReference, paymentAmountUpdateRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// Cancel an authorised payment Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**TECHNICAL_CANCEL** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment using the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/payments/{paymentPspReference}/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task CancelAuthorisedPaymentAsync(Option idempotencyKey = default, Option standalonePaymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default) + public async Task UpdateAuthorisedAmountAsync(string paymentPspReference, PaymentAmountUpdateRequest paymentAmountUpdateRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateCancelAuthorisedPayment(idempotencyKey, standalonePaymentCancelRequest); - - FormatCancelAuthorisedPayment(ref idempotencyKey, standalonePaymentCancelRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/cancels"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (standalonePaymentCancelRequest.IsSet) - httpRequestMessageLocalVar.Content = (standalonePaymentCancelRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(standalonePaymentCancelRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - CancelAuthorisedPaymentApiResponse apiResponseLocalVar = new CancelAuthorisedPaymentApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/cancels", requestedAtLocalVar, _jsonSerializerOptions); - - AfterCancelAuthorisedPaymentDefaultImplementation(apiResponseLocalVar, idempotencyKey, standalonePaymentCancelRequest); - - Events.ExecuteOnCancelAuthorisedPayment(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorCancelAuthorisedPaymentDefaultImplementation(e, "/cancels", uriBuilderLocalVar.Path, idempotencyKey, standalonePaymentCancelRequest); - Events.ExecuteOnErrorCancelAuthorisedPayment(e); - throw; - } - } - - /// - /// The - /// - public partial class CancelAuthorisedPaymentApiResponse : Adyen.Client.ApiResponse, ICancelAuthorisedPaymentApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public CancelAuthorisedPaymentApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 201 Created - /// - /// - public bool IsCreated => 201 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 201 Created - /// - /// - public Adyen.Model.Checkout.StandalonePaymentCancelResponse Created() - { - // This logic may be modified with the AsModel.mustache template - return IsCreated - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 201 Created and the deserialized response is not null - /// - /// - /// - public bool TryCreated(out Adyen.Model.Checkout.StandalonePaymentCancelResponse result) - { - result = null; - - try - { - result = Created(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatCancelAuthorisedPaymentByPspReference(ref string paymentPspReference, ref string idempotencyKey, PaymentCancelRequest paymentCancelRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - /// - private void ValidateCancelAuthorisedPaymentByPspReference(string paymentPspReference, string idempotencyKey, PaymentCancelRequest paymentCancelRequest) - { - if (paymentPspReference == null) - throw new ArgumentNullException(nameof(paymentPspReference)); - - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (paymentCancelRequest.IsSet && paymentCancelRequest.Value == null) - throw new ArgumentNullException(nameof(paymentCancelRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - private void AfterCancelAuthorisedPaymentByPspReferenceDefaultImplementation(ICancelAuthorisedPaymentByPspReferenceApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentCancelRequest paymentCancelRequest) - { - bool suppressDefaultLog = false; - AfterCancelAuthorisedPaymentByPspReference(ref suppressDefaultLog, apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentCancelRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - /// - partial void AfterCancelAuthorisedPaymentByPspReference(ref bool suppressDefaultLog, ICancelAuthorisedPaymentByPspReferenceApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentCancelRequest paymentCancelRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - /// - private void OnErrorCancelAuthorisedPaymentByPspReferenceDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentCancelRequest paymentCancelRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorCancelAuthorisedPaymentByPspReference(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, paymentPspReference, idempotencyKey, paymentCancelRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorCancelAuthorisedPaymentByPspReference(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentCancelRequest paymentCancelRequest); - - /// - /// Cancel an authorised payment Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCELLATION** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment but don't have the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). - /// - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task CancelAuthorisedPaymentByPspReferenceOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await CancelAuthorisedPaymentByPspReferenceAsync(paymentPspReference, idempotencyKey, paymentCancelRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Cancel an authorised payment Cancels the authorisation on a payment that has not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCELLATION** webhook](https://docs.adyen.com/online-payments/cancel#cancellation-webhook). If you want to cancel a payment but don't have the [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference), use the [`/cancels`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cancels) endpoint instead. If you want to cancel a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Cancel](https://docs.adyen.com/online-payments/cancel). - /// - /// Thrown when fails to make API call - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task CancelAuthorisedPaymentByPspReferenceAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCancelRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateCancelAuthorisedPaymentByPspReference(paymentPspReference, idempotencyKey, paymentCancelRequest); - - FormatCancelAuthorisedPaymentByPspReference(ref paymentPspReference, ref idempotencyKey, paymentCancelRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments/{paymentPspReference}/cancels"; - uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpaymentPspReference%7D", Uri.EscapeDataString(paymentPspReference.ToString())); - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (paymentCancelRequest.IsSet) - httpRequestMessageLocalVar.Content = (paymentCancelRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentCancelRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - CancelAuthorisedPaymentByPspReferenceApiResponse apiResponseLocalVar = new CancelAuthorisedPaymentByPspReferenceApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments/{paymentPspReference}/cancels", requestedAtLocalVar, _jsonSerializerOptions); - - AfterCancelAuthorisedPaymentByPspReferenceDefaultImplementation(apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentCancelRequest); - - Events.ExecuteOnCancelAuthorisedPaymentByPspReference(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorCancelAuthorisedPaymentByPspReferenceDefaultImplementation(e, "/payments/{paymentPspReference}/cancels", uriBuilderLocalVar.Path, paymentPspReference, idempotencyKey, paymentCancelRequest); - Events.ExecuteOnErrorCancelAuthorisedPaymentByPspReference(e); - throw; - } - } - - /// - /// The - /// - public partial class CancelAuthorisedPaymentByPspReferenceApiResponse : Adyen.Client.ApiResponse, ICancelAuthorisedPaymentByPspReferenceApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public CancelAuthorisedPaymentByPspReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 201 Created - /// - /// - public bool IsCreated => 201 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 201 Created - /// - /// - public Adyen.Model.Checkout.PaymentCancelResponse Created() - { - // This logic may be modified with the AsModel.mustache template - return IsCreated - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 201 Created and the deserialized response is not null - /// - /// - /// - public bool TryCreated(out Adyen.Model.Checkout.PaymentCancelResponse result) - { - result = null; - - try - { - result = Created(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatCaptureAuthorisedPayment(ref string paymentPspReference, ref string idempotencyKey, PaymentCaptureRequest paymentCaptureRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - /// - private void ValidateCaptureAuthorisedPayment(string paymentPspReference, string idempotencyKey, PaymentCaptureRequest paymentCaptureRequest) - { - if (paymentPspReference == null) - throw new ArgumentNullException(nameof(paymentPspReference)); - - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (paymentCaptureRequest.IsSet && paymentCaptureRequest.Value == null) - throw new ArgumentNullException(nameof(paymentCaptureRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - private void AfterCaptureAuthorisedPaymentDefaultImplementation(ICaptureAuthorisedPaymentApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentCaptureRequest paymentCaptureRequest) - { - bool suppressDefaultLog = false; - AfterCaptureAuthorisedPayment(ref suppressDefaultLog, apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentCaptureRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - /// - partial void AfterCaptureAuthorisedPayment(ref bool suppressDefaultLog, ICaptureAuthorisedPaymentApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentCaptureRequest paymentCaptureRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - /// - private void OnErrorCaptureAuthorisedPaymentDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentCaptureRequest paymentCaptureRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorCaptureAuthorisedPayment(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, paymentPspReference, idempotencyKey, paymentCaptureRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorCaptureAuthorisedPayment(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentCaptureRequest paymentCaptureRequest); - - /// - /// Capture an authorised payment Captures an authorised payment and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CAPTURE** webhook](https://docs.adyen.com/online-payments/capture#capture-notification). You can capture either the full authorised amount or a part of the authorised amount. By default, any unclaimed amount after a partial capture gets cancelled. This does not apply if you enabled multiple partial captures on your account and the payment method supports multiple partial captures. [Automatic capture](https://docs.adyen.com/online-payments/capture#automatic-capture) is the default setting for most payment methods. In these cases, you don't need to make capture requests. However, making capture requests for payments that are captured automatically does not result in double charges. For more information, refer to [Capture](https://docs.adyen.com/online-payments/capture). - /// - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task CaptureAuthorisedPaymentOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCaptureRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await CaptureAuthorisedPaymentAsync(paymentPspReference, idempotencyKey, paymentCaptureRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Capture an authorised payment Captures an authorised payment and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CAPTURE** webhook](https://docs.adyen.com/online-payments/capture#capture-notification). You can capture either the full authorised amount or a part of the authorised amount. By default, any unclaimed amount after a partial capture gets cancelled. This does not apply if you enabled multiple partial captures on your account and the payment method supports multiple partial captures. [Automatic capture](https://docs.adyen.com/online-payments/capture#automatic-capture) is the default setting for most payment methods. In these cases, you don't need to make capture requests. However, making capture requests for payments that are captured automatically does not result in double charges. For more information, refer to [Capture](https://docs.adyen.com/online-payments/capture). - /// - /// Thrown when fails to make API call - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task CaptureAuthorisedPaymentAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentCaptureRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateCaptureAuthorisedPayment(paymentPspReference, idempotencyKey, paymentCaptureRequest); - - FormatCaptureAuthorisedPayment(ref paymentPspReference, ref idempotencyKey, paymentCaptureRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments/{paymentPspReference}/captures"; - uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpaymentPspReference%7D", Uri.EscapeDataString(paymentPspReference.ToString())); - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (paymentCaptureRequest.IsSet) - httpRequestMessageLocalVar.Content = (paymentCaptureRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentCaptureRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - CaptureAuthorisedPaymentApiResponse apiResponseLocalVar = new CaptureAuthorisedPaymentApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments/{paymentPspReference}/captures", requestedAtLocalVar, _jsonSerializerOptions); - - AfterCaptureAuthorisedPaymentDefaultImplementation(apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentCaptureRequest); - - Events.ExecuteOnCaptureAuthorisedPayment(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorCaptureAuthorisedPaymentDefaultImplementation(e, "/payments/{paymentPspReference}/captures", uriBuilderLocalVar.Path, paymentPspReference, idempotencyKey, paymentCaptureRequest); - Events.ExecuteOnErrorCaptureAuthorisedPayment(e); - throw; - } - } - - /// - /// The - /// - public partial class CaptureAuthorisedPaymentApiResponse : Adyen.Client.ApiResponse, ICaptureAuthorisedPaymentApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public CaptureAuthorisedPaymentApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 201 Created - /// - /// - public bool IsCreated => 201 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 201 Created - /// - /// - public Adyen.Model.Checkout.PaymentCaptureResponse Created() - { - // This logic may be modified with the AsModel.mustache template - return IsCreated - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 201 Created and the deserialized response is not null - /// - /// - /// - public bool TryCreated(out Adyen.Model.Checkout.PaymentCaptureResponse result) - { - result = null; - - try - { - result = Created(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatRefundCapturedPayment(ref string paymentPspReference, ref string idempotencyKey, PaymentRefundRequest paymentRefundRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - /// - private void ValidateRefundCapturedPayment(string paymentPspReference, string idempotencyKey, PaymentRefundRequest paymentRefundRequest) - { - if (paymentPspReference == null) - throw new ArgumentNullException(nameof(paymentPspReference)); - - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (paymentRefundRequest.IsSet && paymentRefundRequest.Value == null) - throw new ArgumentNullException(nameof(paymentRefundRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - private void AfterRefundCapturedPaymentDefaultImplementation(IRefundCapturedPaymentApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentRefundRequest paymentRefundRequest) - { - bool suppressDefaultLog = false; - AfterRefundCapturedPayment(ref suppressDefaultLog, apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentRefundRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - /// - partial void AfterRefundCapturedPayment(ref bool suppressDefaultLog, IRefundCapturedPaymentApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentRefundRequest paymentRefundRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - /// - private void OnErrorRefundCapturedPaymentDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentRefundRequest paymentRefundRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorRefundCapturedPayment(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, paymentPspReference, idempotencyKey, paymentRefundRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorRefundCapturedPayment(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentRefundRequest paymentRefundRequest); - - /// - /// Refund a captured payment Refunds a payment that has been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**REFUND** webhook](https://docs.adyen.com/online-payments/refund#refund-webhook). You can refund either the full captured amount or a part of the captured amount. You can also perform multiple partial refunds, as long as their sum doesn't exceed the captured amount. > Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as [cards](https://docs.adyen.com/payment-methods/cards#supported-cards), [iDEAL](https://docs.adyen.com/payment-methods/ideal), or [Klarna](https://docs.adyen.com/payment-methods/klarna). If you want to refund a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Refund](https://docs.adyen.com/online-payments/refund). - /// - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task RefundCapturedPaymentOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentRefundRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await RefundCapturedPaymentAsync(paymentPspReference, idempotencyKey, paymentRefundRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Refund a captured payment Refunds a payment that has been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures), and returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**REFUND** webhook](https://docs.adyen.com/online-payments/refund#refund-webhook). You can refund either the full captured amount or a part of the captured amount. You can also perform multiple partial refunds, as long as their sum doesn't exceed the captured amount. > Some payment methods do not support partial refunds. To learn if a payment method supports partial refunds, refer to the payment method page such as [cards](https://docs.adyen.com/payment-methods/cards#supported-cards), [iDEAL](https://docs.adyen.com/payment-methods/ideal), or [Klarna](https://docs.adyen.com/payment-methods/klarna). If you want to refund a payment but are not sure whether it has been captured, use the [`/payments/{paymentPspReference}/reversals`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/reversals) endpoint instead. For more information, refer to [Refund](https://docs.adyen.com/online-payments/refund). - /// - /// Thrown when fails to make API call - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task RefundCapturedPaymentAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentRefundRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateRefundCapturedPayment(paymentPspReference, idempotencyKey, paymentRefundRequest); - - FormatRefundCapturedPayment(ref paymentPspReference, ref idempotencyKey, paymentRefundRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments/{paymentPspReference}/refunds"; - uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpaymentPspReference%7D", Uri.EscapeDataString(paymentPspReference.ToString())); - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (paymentRefundRequest.IsSet) - httpRequestMessageLocalVar.Content = (paymentRefundRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentRefundRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - RefundCapturedPaymentApiResponse apiResponseLocalVar = new RefundCapturedPaymentApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments/{paymentPspReference}/refunds", requestedAtLocalVar, _jsonSerializerOptions); - - AfterRefundCapturedPaymentDefaultImplementation(apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentRefundRequest); - - Events.ExecuteOnRefundCapturedPayment(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorRefundCapturedPaymentDefaultImplementation(e, "/payments/{paymentPspReference}/refunds", uriBuilderLocalVar.Path, paymentPspReference, idempotencyKey, paymentRefundRequest); - Events.ExecuteOnErrorRefundCapturedPayment(e); - throw; - } - } - - /// - /// The - /// - public partial class RefundCapturedPaymentApiResponse : Adyen.Client.ApiResponse, IRefundCapturedPaymentApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public RefundCapturedPaymentApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 201 Created - /// - /// - public bool IsCreated => 201 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 201 Created - /// - /// - public Adyen.Model.Checkout.PaymentRefundResponse Created() - { - // This logic may be modified with the AsModel.mustache template - return IsCreated - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 201 Created and the deserialized response is not null - /// - /// - /// - public bool TryCreated(out Adyen.Model.Checkout.PaymentRefundResponse result) - { - result = null; - - try - { - result = Created(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatRefundOrCancelPayment(ref string paymentPspReference, ref string idempotencyKey, PaymentReversalRequest paymentReversalRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - /// - private void ValidateRefundOrCancelPayment(string paymentPspReference, string idempotencyKey, PaymentReversalRequest paymentReversalRequest) - { - if (paymentPspReference == null) - throw new ArgumentNullException(nameof(paymentPspReference)); - - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (paymentReversalRequest.IsSet && paymentReversalRequest.Value == null) - throw new ArgumentNullException(nameof(paymentReversalRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - private void AfterRefundOrCancelPaymentDefaultImplementation(IRefundOrCancelPaymentApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentReversalRequest paymentReversalRequest) - { - bool suppressDefaultLog = false; - AfterRefundOrCancelPayment(ref suppressDefaultLog, apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentReversalRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - /// - partial void AfterRefundOrCancelPayment(ref bool suppressDefaultLog, IRefundOrCancelPaymentApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentReversalRequest paymentReversalRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - /// - private void OnErrorRefundOrCancelPaymentDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentReversalRequest paymentReversalRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorRefundOrCancelPayment(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, paymentPspReference, idempotencyKey, paymentReversalRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorRefundOrCancelPayment(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentReversalRequest paymentReversalRequest); - - /// - /// Refund or cancel a payment [Refunds](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/refunds) a payment if it has already been captured, and [cancels](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) a payment if it has not yet been captured. Returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCEL_OR_REFUND** webhook](https://docs.adyen.com/online-payments/reverse#cancel-or-refund-webhook). The reversed amount is always the full payment amount. > Do not use this request for payments that involve multiple partial captures. For more information, refer to [Reversal](https://docs.adyen.com/online-payments/reversal). - /// - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task RefundOrCancelPaymentOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentReversalRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await RefundOrCancelPaymentAsync(paymentPspReference, idempotencyKey, paymentReversalRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Refund or cancel a payment [Refunds](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/refunds) a payment if it has already been captured, and [cancels](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/cancels) a payment if it has not yet been captured. Returns a unique reference for this request. You get the outcome of the request asynchronously, in a [**CANCEL_OR_REFUND** webhook](https://docs.adyen.com/online-payments/reverse#cancel-or-refund-webhook). The reversed amount is always the full payment amount. > Do not use this request for payments that involve multiple partial captures. For more information, refer to [Reversal](https://docs.adyen.com/online-payments/reversal). - /// - /// Thrown when fails to make API call - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task RefundOrCancelPaymentAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentReversalRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateRefundOrCancelPayment(paymentPspReference, idempotencyKey, paymentReversalRequest); - - FormatRefundOrCancelPayment(ref paymentPspReference, ref idempotencyKey, paymentReversalRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments/{paymentPspReference}/reversals"; - uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpaymentPspReference%7D", Uri.EscapeDataString(paymentPspReference.ToString())); - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (paymentReversalRequest.IsSet) - httpRequestMessageLocalVar.Content = (paymentReversalRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentReversalRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - RefundOrCancelPaymentApiResponse apiResponseLocalVar = new RefundOrCancelPaymentApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments/{paymentPspReference}/reversals", requestedAtLocalVar, _jsonSerializerOptions); - - AfterRefundOrCancelPaymentDefaultImplementation(apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentReversalRequest); - - Events.ExecuteOnRefundOrCancelPayment(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorRefundOrCancelPaymentDefaultImplementation(e, "/payments/{paymentPspReference}/reversals", uriBuilderLocalVar.Path, paymentPspReference, idempotencyKey, paymentReversalRequest); - Events.ExecuteOnErrorRefundOrCancelPayment(e); - throw; - } - } - - /// - /// The - /// - public partial class RefundOrCancelPaymentApiResponse : Adyen.Client.ApiResponse, IRefundOrCancelPaymentApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public RefundOrCancelPaymentApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 201 Created - /// - /// - public bool IsCreated => 201 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 201 Created - /// - /// - public Adyen.Model.Checkout.PaymentReversalResponse Created() - { - // This logic may be modified with the AsModel.mustache template - return IsCreated - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 201 Created and the deserialized response is not null - /// - /// - /// - public bool TryCreated(out Adyen.Model.Checkout.PaymentReversalResponse result) - { - result = null; - - try - { - result = Created(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatUpdateAuthorisedAmount(ref string paymentPspReference, ref string idempotencyKey, PaymentAmountUpdateRequest paymentAmountUpdateRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - /// - private void ValidateUpdateAuthorisedAmount(string paymentPspReference, string idempotencyKey, PaymentAmountUpdateRequest paymentAmountUpdateRequest) - { - if (paymentPspReference == null) - throw new ArgumentNullException(nameof(paymentPspReference)); - - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (paymentAmountUpdateRequest.IsSet && paymentAmountUpdateRequest.Value == null) - throw new ArgumentNullException(nameof(paymentAmountUpdateRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - private void AfterUpdateAuthorisedAmountDefaultImplementation(IUpdateAuthorisedAmountApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentAmountUpdateRequest paymentAmountUpdateRequest) - { - bool suppressDefaultLog = false; - AfterUpdateAuthorisedAmount(ref suppressDefaultLog, apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentAmountUpdateRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - /// - partial void AfterUpdateAuthorisedAmount(ref bool suppressDefaultLog, IUpdateAuthorisedAmountApiResponse apiResponseLocalVar, string paymentPspReference, string idempotencyKey, PaymentAmountUpdateRequest paymentAmountUpdateRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - /// - private void OnErrorUpdateAuthorisedAmountDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentAmountUpdateRequest paymentAmountUpdateRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorUpdateAuthorisedAmount(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, paymentPspReference, idempotencyKey, paymentAmountUpdateRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorUpdateAuthorisedAmount(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string paymentPspReference, string idempotencyKey, PaymentAmountUpdateRequest paymentAmountUpdateRequest); - - /// - /// Update an authorised amount Increases or decreases the authorised payment amount and returns a unique reference for this request. You get the outcome of the request asynchronously, in an [**AUTHORISATION_ADJUSTMENT** webhook](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes). You can only update authorised amounts that have not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures). The amount you specify in the request is the updated amount, which is larger or smaller than the initial authorised amount. For more information, refer to [Authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#use-cases). - /// - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task UpdateAuthorisedAmountOrDefaultAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentAmountUpdateRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await UpdateAuthorisedAmountAsync(paymentPspReference, idempotencyKey, paymentAmountUpdateRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Update an authorised amount Increases or decreases the authorised payment amount and returns a unique reference for this request. You get the outcome of the request asynchronously, in an [**AUTHORISATION_ADJUSTMENT** webhook](https://docs.adyen.com/development-resources/webhooks/understand-notifications#event-codes). You can only update authorised amounts that have not yet been [captured](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/captures). The amount you specify in the request is the updated amount, which is larger or smaller than the initial authorised amount. For more information, refer to [Authorisation adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#use-cases). - /// - /// Thrown when fails to make API call - /// The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task UpdateAuthorisedAmountAsync(string paymentPspReference, Option idempotencyKey = default, Option paymentAmountUpdateRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateUpdateAuthorisedAmount(paymentPspReference, idempotencyKey, paymentAmountUpdateRequest); - - FormatUpdateAuthorisedAmount(ref paymentPspReference, ref idempotencyKey, paymentAmountUpdateRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments/{paymentPspReference}/amountUpdates"; - uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpaymentPspReference%7D", Uri.EscapeDataString(paymentPspReference.ToString())); - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (paymentAmountUpdateRequest.IsSet) - httpRequestMessageLocalVar.Content = (paymentAmountUpdateRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentAmountUpdateRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - UpdateAuthorisedAmountApiResponse apiResponseLocalVar = new UpdateAuthorisedAmountApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments/{paymentPspReference}/amountUpdates", requestedAtLocalVar, _jsonSerializerOptions); - - AfterUpdateAuthorisedAmountDefaultImplementation(apiResponseLocalVar, paymentPspReference, idempotencyKey, paymentAmountUpdateRequest); - - Events.ExecuteOnUpdateAuthorisedAmount(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorUpdateAuthorisedAmountDefaultImplementation(e, "/payments/{paymentPspReference}/amountUpdates", uriBuilderLocalVar.Path, paymentPspReference, idempotencyKey, paymentAmountUpdateRequest); - Events.ExecuteOnErrorUpdateAuthorisedAmount(e); - throw; - } - } - - /// - /// The - /// - public partial class UpdateAuthorisedAmountApiResponse : Adyen.Client.ApiResponse, IUpdateAuthorisedAmountApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public UpdateAuthorisedAmountApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 201 Created - /// - /// - public bool IsCreated => 201 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 201 Created - /// - /// - public Adyen.Model.Checkout.PaymentAmountUpdateResponse Created() - { - // This logic may be modified with the AsModel.mustache template - return IsCreated - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 201 Created and the deserialized response is not null - /// - /// - /// - public bool TryCreated(out Adyen.Model.Checkout.PaymentAmountUpdateResponse result) - { - result = null; - - try - { - result = Created(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + var endpoint = _baseUrl + $"/payments/{paymentPspReference}/amountUpdates"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(paymentAmountUpdateRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } } -} +} \ No newline at end of file diff --git a/Adyen/Service/Checkout/OrdersService.cs b/Adyen/Service/Checkout/OrdersService.cs index 3e21cbed0..61f1a97a3 100644 --- a/Adyen/Service/Checkout/OrdersService.cs +++ b/Adyen/Service/Checkout/OrdersService.cs @@ -1,1701 +1,128 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections.Generic; -using System.Net; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; using System.Net.Http; -using System.Net.Http.Headers; -using System.Text.Json; -using Adyen.Client; +using System.Threading; +using System.Threading.Tasks; +using Adyen.Model; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// Represents a collection of functions to interact with the API endpoints - /// This class is registered as transient. + /// OrdersService Interface /// - public interface IOrdersService : IApi + public interface IOrdersService { - /// - /// The class containing the events - /// - OrdersServiceEvents Events { get; } - /// /// Cancel an order /// - /// - /// Cancels an order. Cancellation of an order results in an automatic rollback of all payments made in the order, either by canceling or refunding the payment, depending on the type of payment method. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task CancelOrderAsync(Option idempotencyKey = default, Option cancelOrderRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.CancelOrderResponse CancelOrder(CancelOrderRequest cancelOrderRequest = default, RequestOptions requestOptions = default); + /// /// Cancel an order /// - /// - /// Cancels an order. Cancellation of an order results in an automatic rollback of all payments made in the order, either by canceling or refunding the payment, depending on the type of payment method. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task CancelOrderOrDefaultAsync(Option idempotencyKey = default, Option cancelOrderRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task CancelOrderAsync(CancelOrderRequest cancelOrderRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Get the balance of a gift card /// - /// - /// Retrieves the balance remaining on a shopper's gift card. To check a gift card's balance, make a POST `/paymentMethods/balance` call and include the gift card's details inside a `paymentMethod` object. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task GetBalanceOfGiftCardAsync(Option idempotencyKey = default, Option balanceCheckRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.BalanceCheckResponse GetBalanceOfGiftCard(BalanceCheckRequest balanceCheckRequest = default, RequestOptions requestOptions = default); + /// /// Get the balance of a gift card /// - /// - /// Retrieves the balance remaining on a shopper's gift card. To check a gift card's balance, make a POST `/paymentMethods/balance` call and include the gift card's details inside a `paymentMethod` object. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task GetBalanceOfGiftCardOrDefaultAsync(Option idempotencyKey = default, Option balanceCheckRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task GetBalanceOfGiftCardAsync(BalanceCheckRequest balanceCheckRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Create an order /// - /// - /// Creates an order to be used for partial payments. Make a POST `/orders` call before making a `/payments` call when processing payments with different payment methods. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task OrdersAsync(Option idempotencyKey = default, Option createOrderRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.CreateOrderResponse Orders(CreateOrderRequest createOrderRequest = default, RequestOptions requestOptions = default); + /// /// Create an order /// - /// - /// Creates an order to be used for partial payments. Make a POST `/orders` call before making a `/payments` call when processing payments with different payment methods. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task OrdersOrDefaultAsync(Option idempotencyKey = default, Option createOrderRequest = default, System.Threading.CancellationToken cancellationToken = default); - } - - /// - /// The - /// - public interface ICancelOrderApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// The - /// - public interface IGetBalanceOfGiftCardApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// The - /// - public interface IOrdersApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class OrdersServiceEvents - { - /// - /// The event raised after the server response - /// - public event EventHandler OnCancelOrder; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorCancelOrder; - - internal void ExecuteOnCancelOrder(OrdersService.CancelOrderApiResponse apiResponse) - { - OnCancelOrder?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorCancelOrder(Exception exception) - { - OnErrorCancelOrder?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnGetBalanceOfGiftCard; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorGetBalanceOfGiftCard; - - internal void ExecuteOnGetBalanceOfGiftCard(OrdersService.GetBalanceOfGiftCardApiResponse apiResponse) - { - OnGetBalanceOfGiftCard?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorGetBalanceOfGiftCard(Exception exception) - { - OnErrorGetBalanceOfGiftCard?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnOrders; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorOrders; - - internal void ExecuteOnOrders(OrdersService.OrdersApiResponse apiResponse) - { - OnOrders?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorOrders(Exception exception) - { - OnErrorOrders?.Invoke(this, new ExceptionEventArgs(exception)); - } + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task OrdersAsync(CreateOrderRequest createOrderRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + } - + /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the OrdersService API endpoints /// - public sealed partial class OrdersService : IOrdersService + public class OrdersService : AbstractService, IOrdersService { - private JsonSerializerOptions _jsonSerializerOptions; - - /// - /// The logger factory - /// - public ILoggerFactory LoggerFactory { get; } - - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The HttpClient - /// - public System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The class containing the events - /// - public OrdersServiceEvents Events { get; } - - /// - /// A token provider of type - /// - public TokenProvider ApiKeyProvider { get; } - - /// - /// A token provider of type - /// - public TokenProvider BasicTokenProvider { get; } - - /// - /// Initializes a new instance of the class. - /// - /// - public OrdersService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, OrdersServiceEvents ordersServiceEvents, - TokenProvider apiKeyProvider, - TokenProvider basicTokenProvider) + private readonly string _baseUrl; + + public OrdersService(AdyenClient client) : base(client) { - _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; - LoggerFactory = loggerFactory; - Logger = LoggerFactory.CreateLogger(); - HttpClient = httpClient; - Events = ordersServiceEvents; - ApiKeyProvider = apiKeyProvider; - BasicTokenProvider = basicTokenProvider; + _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } - - partial void FormatCancelOrder(ref string idempotencyKey, CancelOrderRequest cancelOrderRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateCancelOrder(string idempotencyKey, CancelOrderRequest cancelOrderRequest) + + public Model.Checkout.CancelOrderResponse CancelOrder(CancelOrderRequest cancelOrderRequest = default, RequestOptions requestOptions = default) { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (cancelOrderRequest.IsSet && cancelOrderRequest.Value == null) - throw new ArgumentNullException(nameof(cancelOrderRequest)); + return CancelOrderAsync(cancelOrderRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterCancelOrderDefaultImplementation(ICancelOrderApiResponse apiResponseLocalVar, string idempotencyKey, CancelOrderRequest cancelOrderRequest) + public async Task CancelOrderAsync(CancelOrderRequest cancelOrderRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - bool suppressDefaultLog = false; - AfterCancelOrder(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, cancelOrderRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + var endpoint = _baseUrl + "/orders/cancel"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(cancelOrderRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterCancelOrder(ref bool suppressDefaultLog, ICancelOrderApiResponse apiResponseLocalVar, string idempotencyKey, CancelOrderRequest cancelOrderRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorCancelOrderDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CancelOrderRequest cancelOrderRequest) + + public Model.Checkout.BalanceCheckResponse GetBalanceOfGiftCard(BalanceCheckRequest balanceCheckRequest = default, RequestOptions requestOptions = default) { - bool suppressDefaultLogLocalVar = false; - OnErrorCancelOrder(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, cancelOrderRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + return GetBalanceOfGiftCardAsync(balanceCheckRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorCancelOrder(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CancelOrderRequest cancelOrderRequest); - - /// - /// Cancel an order Cancels an order. Cancellation of an order results in an automatic rollback of all payments made in the order, either by canceling or refunding the payment, depending on the type of payment method. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task CancelOrderOrDefaultAsync(Option idempotencyKey = default, Option cancelOrderRequest = default, System.Threading.CancellationToken cancellationToken = default) + public async Task GetBalanceOfGiftCardAsync(BalanceCheckRequest balanceCheckRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - try - { - return await CancelOrderAsync(idempotencyKey, cancelOrderRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } + var endpoint = _baseUrl + "/paymentMethods/balance"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(balanceCheckRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - /// - /// Cancel an order Cancels an order. Cancellation of an order results in an automatic rollback of all payments made in the order, either by canceling or refunding the payment, depending on the type of payment method. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task CancelOrderAsync(Option idempotencyKey = default, Option cancelOrderRequest = default, System.Threading.CancellationToken cancellationToken = default) + + public Model.Checkout.CreateOrderResponse Orders(CreateOrderRequest createOrderRequest = default, RequestOptions requestOptions = default) { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateCancelOrder(idempotencyKey, cancelOrderRequest); - - FormatCancelOrder(ref idempotencyKey, cancelOrderRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/orders/cancel"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (cancelOrderRequest.IsSet) - httpRequestMessageLocalVar.Content = (cancelOrderRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(cancelOrderRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - CancelOrderApiResponse apiResponseLocalVar = new CancelOrderApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/orders/cancel", requestedAtLocalVar, _jsonSerializerOptions); - - AfterCancelOrderDefaultImplementation(apiResponseLocalVar, idempotencyKey, cancelOrderRequest); - - Events.ExecuteOnCancelOrder(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorCancelOrderDefaultImplementation(e, "/orders/cancel", uriBuilderLocalVar.Path, idempotencyKey, cancelOrderRequest); - Events.ExecuteOnErrorCancelOrder(e); - throw; - } + return OrdersAsync(createOrderRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// The - /// - public partial class CancelOrderApiResponse : Adyen.Client.ApiResponse, ICancelOrderApiResponse + public async Task OrdersAsync(CreateOrderRequest createOrderRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public CancelOrderApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.CancelOrderResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.CancelOrderResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatGetBalanceOfGiftCard(ref string idempotencyKey, BalanceCheckRequest balanceCheckRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateGetBalanceOfGiftCard(string idempotencyKey, BalanceCheckRequest balanceCheckRequest) - { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (balanceCheckRequest.IsSet && balanceCheckRequest.Value == null) - throw new ArgumentNullException(nameof(balanceCheckRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterGetBalanceOfGiftCardDefaultImplementation(IGetBalanceOfGiftCardApiResponse apiResponseLocalVar, string idempotencyKey, BalanceCheckRequest balanceCheckRequest) - { - bool suppressDefaultLog = false; - AfterGetBalanceOfGiftCard(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, balanceCheckRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterGetBalanceOfGiftCard(ref bool suppressDefaultLog, IGetBalanceOfGiftCardApiResponse apiResponseLocalVar, string idempotencyKey, BalanceCheckRequest balanceCheckRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorGetBalanceOfGiftCardDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, BalanceCheckRequest balanceCheckRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorGetBalanceOfGiftCard(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, balanceCheckRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorGetBalanceOfGiftCard(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, BalanceCheckRequest balanceCheckRequest); - - /// - /// Get the balance of a gift card Retrieves the balance remaining on a shopper's gift card. To check a gift card's balance, make a POST `/paymentMethods/balance` call and include the gift card's details inside a `paymentMethod` object. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task GetBalanceOfGiftCardOrDefaultAsync(Option idempotencyKey = default, Option balanceCheckRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await GetBalanceOfGiftCardAsync(idempotencyKey, balanceCheckRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Get the balance of a gift card Retrieves the balance remaining on a shopper's gift card. To check a gift card's balance, make a POST `/paymentMethods/balance` call and include the gift card's details inside a `paymentMethod` object. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task GetBalanceOfGiftCardAsync(Option idempotencyKey = default, Option balanceCheckRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateGetBalanceOfGiftCard(idempotencyKey, balanceCheckRequest); - - FormatGetBalanceOfGiftCard(ref idempotencyKey, balanceCheckRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/paymentMethods/balance"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (balanceCheckRequest.IsSet) - httpRequestMessageLocalVar.Content = (balanceCheckRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(balanceCheckRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - GetBalanceOfGiftCardApiResponse apiResponseLocalVar = new GetBalanceOfGiftCardApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/paymentMethods/balance", requestedAtLocalVar, _jsonSerializerOptions); - - AfterGetBalanceOfGiftCardDefaultImplementation(apiResponseLocalVar, idempotencyKey, balanceCheckRequest); - - Events.ExecuteOnGetBalanceOfGiftCard(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorGetBalanceOfGiftCardDefaultImplementation(e, "/paymentMethods/balance", uriBuilderLocalVar.Path, idempotencyKey, balanceCheckRequest); - Events.ExecuteOnErrorGetBalanceOfGiftCard(e); - throw; - } - } - - /// - /// The - /// - public partial class GetBalanceOfGiftCardApiResponse : Adyen.Client.ApiResponse, IGetBalanceOfGiftCardApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public GetBalanceOfGiftCardApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.BalanceCheckResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.BalanceCheckResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatOrders(ref string idempotencyKey, CreateOrderRequest createOrderRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateOrders(string idempotencyKey, CreateOrderRequest createOrderRequest) - { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (createOrderRequest.IsSet && createOrderRequest.Value == null) - throw new ArgumentNullException(nameof(createOrderRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterOrdersDefaultImplementation(IOrdersApiResponse apiResponseLocalVar, string idempotencyKey, CreateOrderRequest createOrderRequest) - { - bool suppressDefaultLog = false; - AfterOrders(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, createOrderRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterOrders(ref bool suppressDefaultLog, IOrdersApiResponse apiResponseLocalVar, string idempotencyKey, CreateOrderRequest createOrderRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorOrdersDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CreateOrderRequest createOrderRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorOrders(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, createOrderRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorOrders(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CreateOrderRequest createOrderRequest); - - /// - /// Create an order Creates an order to be used for partial payments. Make a POST `/orders` call before making a `/payments` call when processing payments with different payment methods. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task OrdersOrDefaultAsync(Option idempotencyKey = default, Option createOrderRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await OrdersAsync(idempotencyKey, createOrderRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Create an order Creates an order to be used for partial payments. Make a POST `/orders` call before making a `/payments` call when processing payments with different payment methods. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task OrdersAsync(Option idempotencyKey = default, Option createOrderRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateOrders(idempotencyKey, createOrderRequest); - - FormatOrders(ref idempotencyKey, createOrderRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/orders"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (createOrderRequest.IsSet) - httpRequestMessageLocalVar.Content = (createOrderRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(createOrderRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - OrdersApiResponse apiResponseLocalVar = new OrdersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/orders", requestedAtLocalVar, _jsonSerializerOptions); - - AfterOrdersDefaultImplementation(apiResponseLocalVar, idempotencyKey, createOrderRequest); - - Events.ExecuteOnOrders(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorOrdersDefaultImplementation(e, "/orders", uriBuilderLocalVar.Path, idempotencyKey, createOrderRequest); - Events.ExecuteOnErrorOrders(e); - throw; - } - } - - /// - /// The - /// - public partial class OrdersApiResponse : Adyen.Client.ApiResponse, IOrdersApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public OrdersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.CreateOrderResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.CreateOrderResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + var endpoint = _baseUrl + "/orders"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(createOrderRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } } -} +} \ No newline at end of file diff --git a/Adyen/Service/Checkout/PaymentLinksService.cs b/Adyen/Service/Checkout/PaymentLinksService.cs index f607b4f97..943ce428d 100644 --- a/Adyen/Service/Checkout/PaymentLinksService.cs +++ b/Adyen/Service/Checkout/PaymentLinksService.cs @@ -1,1671 +1,130 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections.Generic; -using System.Net; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; using System.Net.Http; -using System.Net.Http.Headers; -using System.Text.Json; -using Adyen.Client; +using System.Threading; +using System.Threading.Tasks; +using Adyen.Model; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// Represents a collection of functions to interact with the API endpoints - /// This class is registered as transient. + /// PaymentLinksService Interface /// - public interface IPaymentLinksService : IApi + public interface IPaymentLinksService { - /// - /// The class containing the events - /// - PaymentLinksServiceEvents Events { get; } - /// /// Get a payment link /// - /// - /// Retrieves the payment link details using the payment link `id`. - /// - /// Thrown when fails to make API call - /// Unique identifier of the payment link. - /// Cancellation Token to cancel the request. - /// <> - Task GetPaymentLinkAsync(string linkId, System.Threading.CancellationToken cancellationToken = default); - + /// - Unique identifier of the payment link. + /// - Additional request options. + /// . + Model.Checkout.PaymentLinkResponse GetPaymentLink(string linkId, RequestOptions requestOptions = default); + /// /// Get a payment link /// - /// - /// Retrieves the payment link details using the payment link `id`. - /// - /// Unique identifier of the payment link. - /// Cancellation Token to cancel the request. - /// <> - Task GetPaymentLinkOrDefaultAsync(string linkId, System.Threading.CancellationToken cancellationToken = default); - + /// - Unique identifier of the payment link. + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task GetPaymentLinkAsync(string linkId, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Create a payment link /// - /// - /// Creates a payment link to a [Pay by Link](https://docs.adyen.com/unified-commerce/pay-by-link/) page where the shopper can pay. The list of payment methods presented to the shopper depends on the `currency` and `country` parameters sent in the request. For more information, refer to [Pay by Link documentation](https://docs.adyen.com/online-payments/pay-by-link#create-payment-links-through-api). - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task PaymentLinksAsync(Option idempotencyKey = default, Option paymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.PaymentLinkResponse PaymentLinks(PaymentLinkRequest paymentLinkRequest = default, RequestOptions requestOptions = default); + /// /// Create a payment link /// - /// - /// Creates a payment link to a [Pay by Link](https://docs.adyen.com/unified-commerce/pay-by-link/) page where the shopper can pay. The list of payment methods presented to the shopper depends on the `currency` and `country` parameters sent in the request. For more information, refer to [Pay by Link documentation](https://docs.adyen.com/online-payments/pay-by-link#create-payment-links-through-api). - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task PaymentLinksOrDefaultAsync(Option idempotencyKey = default, Option paymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task PaymentLinksAsync(PaymentLinkRequest paymentLinkRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Update the status of a payment link /// - /// - /// Updates the status of a payment link. Use this endpoint to [force the expiry of a payment link](https://docs.adyen.com/online-payments/pay-by-link#update-payment-link-status). - /// - /// Thrown when fails to make API call - /// Unique identifier of the payment link. - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task UpdatePaymentLinkAsync(string linkId, Option updatePaymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - Unique identifier of the payment link. + /// - + /// - Additional request options. + /// . + Model.Checkout.PaymentLinkResponse UpdatePaymentLink(string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest = default, RequestOptions requestOptions = default); + /// /// Update the status of a payment link /// - /// - /// Updates the status of a payment link. Use this endpoint to [force the expiry of a payment link](https://docs.adyen.com/online-payments/pay-by-link#update-payment-link-status). - /// - /// Unique identifier of the payment link. - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task UpdatePaymentLinkOrDefaultAsync(string linkId, Option updatePaymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default); - } - - /// - /// The - /// - public interface IGetPaymentLinkApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// The - /// - public interface IPaymentLinksApiResponse : Adyen.Client.IApiResponse, ICreated, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 201 Created - /// - /// - bool IsCreated { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// The - /// - public interface IUpdatePaymentLinkApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class PaymentLinksServiceEvents - { - /// - /// The event raised after the server response - /// - public event EventHandler OnGetPaymentLink; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorGetPaymentLink; - - internal void ExecuteOnGetPaymentLink(PaymentLinksService.GetPaymentLinkApiResponse apiResponse) - { - OnGetPaymentLink?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorGetPaymentLink(Exception exception) - { - OnErrorGetPaymentLink?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnPaymentLinks; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorPaymentLinks; - - internal void ExecuteOnPaymentLinks(PaymentLinksService.PaymentLinksApiResponse apiResponse) - { - OnPaymentLinks?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorPaymentLinks(Exception exception) - { - OnErrorPaymentLinks?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnUpdatePaymentLink; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorUpdatePaymentLink; - - internal void ExecuteOnUpdatePaymentLink(PaymentLinksService.UpdatePaymentLinkApiResponse apiResponse) - { - OnUpdatePaymentLink?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorUpdatePaymentLink(Exception exception) - { - OnErrorUpdatePaymentLink?.Invoke(this, new ExceptionEventArgs(exception)); - } + /// - Unique identifier of the payment link. + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task UpdatePaymentLinkAsync(string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + } - + /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the PaymentLinksService API endpoints /// - public sealed partial class PaymentLinksService : IPaymentLinksService + public class PaymentLinksService : AbstractService, IPaymentLinksService { - private JsonSerializerOptions _jsonSerializerOptions; - - /// - /// The logger factory - /// - public ILoggerFactory LoggerFactory { get; } - - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The HttpClient - /// - public System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The class containing the events - /// - public PaymentLinksServiceEvents Events { get; } - - /// - /// A token provider of type - /// - public TokenProvider ApiKeyProvider { get; } - - /// - /// A token provider of type - /// - public TokenProvider BasicTokenProvider { get; } - - /// - /// Initializes a new instance of the class. - /// - /// - public PaymentLinksService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, PaymentLinksServiceEvents paymentLinksServiceEvents, - TokenProvider apiKeyProvider, - TokenProvider basicTokenProvider) - { - _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; - LoggerFactory = loggerFactory; - Logger = LoggerFactory.CreateLogger(); - HttpClient = httpClient; - Events = paymentLinksServiceEvents; - ApiKeyProvider = apiKeyProvider; - BasicTokenProvider = basicTokenProvider; - } - - partial void FormatGetPaymentLink(ref string linkId); - - /// - /// Validates the request parameters - /// - /// - /// - private void ValidateGetPaymentLink(string linkId) - { - if (linkId == null) - throw new ArgumentNullException(nameof(linkId)); - } - - /// - /// Processes the server response - /// - /// - /// - private void AfterGetPaymentLinkDefaultImplementation(IGetPaymentLinkApiResponse apiResponseLocalVar, string linkId) - { - bool suppressDefaultLog = false; - AfterGetPaymentLink(ref suppressDefaultLog, apiResponseLocalVar, linkId); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - partial void AfterGetPaymentLink(ref bool suppressDefaultLog, IGetPaymentLinkApiResponse apiResponseLocalVar, string linkId); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - private void OnErrorGetPaymentLinkDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string linkId) - { - bool suppressDefaultLogLocalVar = false; - OnErrorGetPaymentLink(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, linkId); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - partial void OnErrorGetPaymentLink(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string linkId); - - /// - /// Get a payment link Retrieves the payment link details using the payment link `id`. - /// - /// Unique identifier of the payment link. - /// Cancellation Token to cancel the request. - /// <> - public async Task GetPaymentLinkOrDefaultAsync(string linkId, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await GetPaymentLinkAsync(linkId, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Get a payment link Retrieves the payment link details using the payment link `id`. - /// - /// Thrown when fails to make API call - /// Unique identifier of the payment link. - /// Cancellation Token to cancel the request. - /// <> - public async Task GetPaymentLinkAsync(string linkId, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateGetPaymentLink(linkId); - - FormatGetPaymentLink(ref linkId); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/paymentLinks/{linkId}"; - uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BlinkId%7D", Uri.EscapeDataString(linkId.ToString())); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - GetPaymentLinkApiResponse apiResponseLocalVar = new GetPaymentLinkApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/paymentLinks/{linkId}", requestedAtLocalVar, _jsonSerializerOptions); - - AfterGetPaymentLinkDefaultImplementation(apiResponseLocalVar, linkId); - - Events.ExecuteOnGetPaymentLink(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorGetPaymentLinkDefaultImplementation(e, "/paymentLinks/{linkId}", uriBuilderLocalVar.Path, linkId); - Events.ExecuteOnErrorGetPaymentLink(e); - throw; - } - } - - /// - /// The - /// - public partial class GetPaymentLinkApiResponse : Adyen.Client.ApiResponse, IGetPaymentLinkApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public GetPaymentLinkApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.PaymentLinkResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.PaymentLinkResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatPaymentLinks(ref string idempotencyKey, PaymentLinkRequest paymentLinkRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidatePaymentLinks(string idempotencyKey, PaymentLinkRequest paymentLinkRequest) + private readonly string _baseUrl; + + public PaymentLinksService(AdyenClient client) : base(client) { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (paymentLinkRequest.IsSet && paymentLinkRequest.Value == null) - throw new ArgumentNullException(nameof(paymentLinkRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterPaymentLinksDefaultImplementation(IPaymentLinksApiResponse apiResponseLocalVar, string idempotencyKey, PaymentLinkRequest paymentLinkRequest) - { - bool suppressDefaultLog = false; - AfterPaymentLinks(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, paymentLinkRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterPaymentLinks(ref bool suppressDefaultLog, IPaymentLinksApiResponse apiResponseLocalVar, string idempotencyKey, PaymentLinkRequest paymentLinkRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorPaymentLinksDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentLinkRequest paymentLinkRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorPaymentLinks(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, paymentLinkRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorPaymentLinks(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentLinkRequest paymentLinkRequest); - - /// - /// Create a payment link Creates a payment link to a [Pay by Link](https://docs.adyen.com/unified-commerce/pay-by-link/) page where the shopper can pay. The list of payment methods presented to the shopper depends on the `currency` and `country` parameters sent in the request. For more information, refer to [Pay by Link documentation](https://docs.adyen.com/online-payments/pay-by-link#create-payment-links-through-api). - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task PaymentLinksOrDefaultAsync(Option idempotencyKey = default, Option paymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await PaymentLinksAsync(idempotencyKey, paymentLinkRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Create a payment link Creates a payment link to a [Pay by Link](https://docs.adyen.com/unified-commerce/pay-by-link/) page where the shopper can pay. The list of payment methods presented to the shopper depends on the `currency` and `country` parameters sent in the request. For more information, refer to [Pay by Link documentation](https://docs.adyen.com/online-payments/pay-by-link#create-payment-links-through-api). - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task PaymentLinksAsync(Option idempotencyKey = default, Option paymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidatePaymentLinks(idempotencyKey, paymentLinkRequest); - - FormatPaymentLinks(ref idempotencyKey, paymentLinkRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/paymentLinks"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (paymentLinkRequest.IsSet) - httpRequestMessageLocalVar.Content = (paymentLinkRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentLinkRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - PaymentLinksApiResponse apiResponseLocalVar = new PaymentLinksApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/paymentLinks", requestedAtLocalVar, _jsonSerializerOptions); - - AfterPaymentLinksDefaultImplementation(apiResponseLocalVar, idempotencyKey, paymentLinkRequest); - - Events.ExecuteOnPaymentLinks(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorPaymentLinksDefaultImplementation(e, "/paymentLinks", uriBuilderLocalVar.Path, idempotencyKey, paymentLinkRequest); - Events.ExecuteOnErrorPaymentLinks(e); - throw; - } - } - - /// - /// The - /// - public partial class PaymentLinksApiResponse : Adyen.Client.ApiResponse, IPaymentLinksApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public PaymentLinksApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 201 Created - /// - /// - public bool IsCreated => 201 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 201 Created - /// - /// - public Adyen.Model.Checkout.PaymentLinkResponse Created() - { - // This logic may be modified with the AsModel.mustache template - return IsCreated - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 201 Created and the deserialized response is not null - /// - /// - /// - public bool TryCreated(out Adyen.Model.Checkout.PaymentLinkResponse result) - { - result = null; - - try - { - result = Created(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } - - partial void FormatUpdatePaymentLink(ref string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateUpdatePaymentLink(string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest) + + public Model.Checkout.PaymentLinkResponse GetPaymentLink(string linkId, RequestOptions requestOptions = default) { - if (linkId == null) - throw new ArgumentNullException(nameof(linkId)); - - if (updatePaymentLinkRequest.IsSet && updatePaymentLinkRequest.Value == null) - throw new ArgumentNullException(nameof(updatePaymentLinkRequest)); + return GetPaymentLinkAsync(linkId, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterUpdatePaymentLinkDefaultImplementation(IUpdatePaymentLinkApiResponse apiResponseLocalVar, string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest) + public async Task GetPaymentLinkAsync(string linkId, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - bool suppressDefaultLog = false; - AfterUpdatePaymentLink(ref suppressDefaultLog, apiResponseLocalVar, linkId, updatePaymentLinkRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + var endpoint = _baseUrl + $"/paymentLinks/{linkId}"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(null, requestOptions, new HttpMethod("GET"), cancellationToken).ConfigureAwait(false); } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterUpdatePaymentLink(ref bool suppressDefaultLog, IUpdatePaymentLinkApiResponse apiResponseLocalVar, string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorUpdatePaymentLinkDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest) + + public Model.Checkout.PaymentLinkResponse PaymentLinks(PaymentLinkRequest paymentLinkRequest = default, RequestOptions requestOptions = default) { - bool suppressDefaultLogLocalVar = false; - OnErrorUpdatePaymentLink(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, linkId, updatePaymentLinkRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + return PaymentLinksAsync(paymentLinkRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorUpdatePaymentLink(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest); - - /// - /// Update the status of a payment link Updates the status of a payment link. Use this endpoint to [force the expiry of a payment link](https://docs.adyen.com/online-payments/pay-by-link#update-payment-link-status). - /// - /// Unique identifier of the payment link. - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task UpdatePaymentLinkOrDefaultAsync(string linkId, Option updatePaymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default) + public async Task PaymentLinksAsync(PaymentLinkRequest paymentLinkRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - try - { - return await UpdatePaymentLinkAsync(linkId, updatePaymentLinkRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } + var endpoint = _baseUrl + "/paymentLinks"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(paymentLinkRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - /// - /// Update the status of a payment link Updates the status of a payment link. Use this endpoint to [force the expiry of a payment link](https://docs.adyen.com/online-payments/pay-by-link#update-payment-link-status). - /// - /// Thrown when fails to make API call - /// Unique identifier of the payment link. - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task UpdatePaymentLinkAsync(string linkId, Option updatePaymentLinkRequest = default, System.Threading.CancellationToken cancellationToken = default) + + public Model.Checkout.PaymentLinkResponse UpdatePaymentLink(string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest = default, RequestOptions requestOptions = default) { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateUpdatePaymentLink(linkId, updatePaymentLinkRequest); - - FormatUpdatePaymentLink(ref linkId, updatePaymentLinkRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/paymentLinks/{linkId}"; - uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BlinkId%7D", Uri.EscapeDataString(linkId.ToString())); - - if (updatePaymentLinkRequest.IsSet) - httpRequestMessageLocalVar.Content = (updatePaymentLinkRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(updatePaymentLinkRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - UpdatePaymentLinkApiResponse apiResponseLocalVar = new UpdatePaymentLinkApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/paymentLinks/{linkId}", requestedAtLocalVar, _jsonSerializerOptions); - - AfterUpdatePaymentLinkDefaultImplementation(apiResponseLocalVar, linkId, updatePaymentLinkRequest); - - Events.ExecuteOnUpdatePaymentLink(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorUpdatePaymentLinkDefaultImplementation(e, "/paymentLinks/{linkId}", uriBuilderLocalVar.Path, linkId, updatePaymentLinkRequest); - Events.ExecuteOnErrorUpdatePaymentLink(e); - throw; - } + return UpdatePaymentLinkAsync(linkId, updatePaymentLinkRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// The - /// - public partial class UpdatePaymentLinkApiResponse : Adyen.Client.ApiResponse, IUpdatePaymentLinkApiResponse + public async Task UpdatePaymentLinkAsync(string linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public UpdatePaymentLinkApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.PaymentLinkResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.PaymentLinkResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + var endpoint = _baseUrl + $"/paymentLinks/{linkId}"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(updatePaymentLinkRequest.ToJson(), requestOptions, new HttpMethod("PATCH"), cancellationToken).ConfigureAwait(false); } } -} +} \ No newline at end of file diff --git a/Adyen/Service/Checkout/PaymentsService.cs b/Adyen/Service/Checkout/PaymentsService.cs index 8a43622ca..6c29b22cb 100644 --- a/Adyen/Service/Checkout/PaymentsService.cs +++ b/Adyen/Service/Checkout/PaymentsService.cs @@ -1,2636 +1,220 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections.Generic; -using System.Net; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; using System.Net.Http; -using System.Net.Http.Headers; -using System.Text.Json; -using Adyen.Client; +using System.Threading; +using System.Threading.Tasks; +using Adyen.Model; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// Represents a collection of functions to interact with the API endpoints - /// This class is registered as transient. + /// PaymentsService Interface /// - public interface IPaymentsService : IApi + public interface IPaymentsService { - /// - /// The class containing the events - /// - PaymentsServiceEvents Events { get; } - /// /// Get the brands and other details of a card /// - /// - /// Use this endpoint to get information about the card or network token that enables you to decideon the routing of the transaction and the eligibility of the card for the type of transaction. If you include [your supported brands](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__reqParam_supportedBrands) in the request, the response also tells you if you support each [brand that was identified on the card](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__resParam_details). If you have an API-only integration and collect card data, use this endpoint to find out if the shopper's card is co-branded. For co-branded cards, you must let the shopper choose the brand to pay with if you support both brands. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task CardDetailsAsync(Option idempotencyKey = default, Option cardDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.CardDetailsResponse CardDetails(CardDetailsRequest cardDetailsRequest = default, RequestOptions requestOptions = default); + /// /// Get the brands and other details of a card /// - /// - /// Use this endpoint to get information about the card or network token that enables you to decideon the routing of the transaction and the eligibility of the card for the type of transaction. If you include [your supported brands](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__reqParam_supportedBrands) in the request, the response also tells you if you support each [brand that was identified on the card](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__resParam_details). If you have an API-only integration and collect card data, use this endpoint to find out if the shopper's card is co-branded. For co-branded cards, you must let the shopper choose the brand to pay with if you support both brands. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task CardDetailsOrDefaultAsync(Option idempotencyKey = default, Option cardDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task CardDetailsAsync(CardDetailsRequest cardDetailsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Get the result of a payment session /// - /// - /// Returns the status of the payment session with the `sessionId` and `sessionResult` specified in the path. - /// - /// Thrown when fails to make API call - /// A unique identifier of the session. - /// The `sessionResult` value from the Drop-in or Component. - /// Cancellation Token to cancel the request. - /// <> - Task GetResultOfPaymentSessionAsync(string sessionId, string sessionResult, System.Threading.CancellationToken cancellationToken = default); - + /// - A unique identifier of the session. + /// - The `sessionResult` value from the Drop-in or Component. + /// - Additional request options. + /// . + Model.Checkout.SessionResultResponse GetResultOfPaymentSession(string sessionId, string sessionResult, RequestOptions requestOptions = default); + /// /// Get the result of a payment session /// - /// - /// Returns the status of the payment session with the `sessionId` and `sessionResult` specified in the path. - /// - /// A unique identifier of the session. - /// The `sessionResult` value from the Drop-in or Component. - /// Cancellation Token to cancel the request. - /// <> - Task GetResultOfPaymentSessionOrDefaultAsync(string sessionId, string sessionResult, System.Threading.CancellationToken cancellationToken = default); - + /// - A unique identifier of the session. + /// - The `sessionResult` value from the Drop-in or Component. + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task GetResultOfPaymentSessionAsync(string sessionId, string sessionResult, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Get a list of available payment methods /// - /// - /// Retrieves the list of available payment methods for the transaction, based on the transaction information like amount, country, and currency. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task PaymentMethodsAsync(Option idempotencyKey = default, Option paymentMethodsRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.PaymentMethodsResponse PaymentMethods(PaymentMethodsRequest paymentMethodsRequest = default, RequestOptions requestOptions = default); + /// /// Get a list of available payment methods /// - /// - /// Retrieves the list of available payment methods for the transaction, based on the transaction information like amount, country, and currency. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task PaymentMethodsOrDefaultAsync(Option idempotencyKey = default, Option paymentMethodsRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task PaymentMethodsAsync(PaymentMethodsRequest paymentMethodsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Start a transaction /// - /// - /// Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). The response depends on the [payment flow](https://docs.adyen.com/payment-methods#payment-flow): * For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. * For a redirect or additional action, the response contains an `action` object. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task PaymentsAsync(Option idempotencyKey = default, Option paymentRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.PaymentResponse Payments(PaymentRequest paymentRequest = default, RequestOptions requestOptions = default); + /// /// Start a transaction /// - /// - /// Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). The response depends on the [payment flow](https://docs.adyen.com/payment-methods#payment-flow): * For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. * For a redirect or additional action, the response contains an `action` object. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task PaymentsOrDefaultAsync(Option idempotencyKey = default, Option paymentRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task PaymentsAsync(PaymentRequest paymentRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Submit details for a payment /// - /// - /// Submits details for a payment created using `/payments`. This step is only needed when no final state has been reached on the `/payments` request, for example when the shopper was redirected to another page to complete the payment. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task PaymentsDetailsAsync(Option idempotencyKey = default, Option paymentDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.PaymentDetailsResponse PaymentsDetails(PaymentDetailsRequest paymentDetailsRequest = default, RequestOptions requestOptions = default); + /// /// Submit details for a payment /// - /// - /// Submits details for a payment created using `/payments`. This step is only needed when no final state has been reached on the `/payments` request, for example when the shopper was redirected to another page to complete the payment. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task PaymentsDetailsOrDefaultAsync(Option idempotencyKey = default, Option paymentDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task PaymentsDetailsAsync(PaymentDetailsRequest paymentDetailsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Create a payment session /// - /// - /// Creates a payment session for [Drop-in](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Drop-in), [Components](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Components), and [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Hosted+Checkout) integrations. The response contains encrypted payment session data. The front end then uses the session data to make any required server-side calls for the payment flow. You get the payment outcome asynchronously, in an [AUTHORISATION](https://docs.adyen.com/api-explorer/#/Webhooks/latest/post/AUTHORISATION) webhook. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task SessionsAsync(Option idempotencyKey = default, Option createCheckoutSessionRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.CreateCheckoutSessionResponse Sessions(CreateCheckoutSessionRequest createCheckoutSessionRequest = default, RequestOptions requestOptions = default); + /// /// Create a payment session /// - /// - /// Creates a payment session for [Drop-in](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Drop-in), [Components](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Components), and [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Hosted+Checkout) integrations. The response contains encrypted payment session data. The front end then uses the session data to make any required server-side calls for the payment flow. You get the payment outcome asynchronously, in an [AUTHORISATION](https://docs.adyen.com/api-explorer/#/Webhooks/latest/post/AUTHORISATION) webhook. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task SessionsOrDefaultAsync(Option idempotencyKey = default, Option createCheckoutSessionRequest = default, System.Threading.CancellationToken cancellationToken = default); - } - - /// - /// The - /// - public interface ICardDetailsApiResponse : Adyen.Client.IApiResponse, IOk - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - } - - /// - /// The - /// - public interface IGetResultOfPaymentSessionApiResponse : Adyen.Client.IApiResponse, IOk - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - } - - /// - /// The - /// - public interface IPaymentMethodsApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// The - /// - public interface IPaymentsApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// The - /// - public interface IPaymentsDetailsApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task SessionsAsync(CreateCheckoutSessionRequest createCheckoutSessionRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + } - - /// - /// The - /// - public interface ISessionsApiResponse : Adyen.Client.IApiResponse, ICreated - { - /// - /// Returns true if the response is 201 Created - /// - /// - bool IsCreated { get; } - } - + /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the PaymentsService API endpoints /// - public class PaymentsServiceEvents + public class PaymentsService : AbstractService, IPaymentsService { - /// - /// The event raised after the server response - /// - public event EventHandler OnCardDetails; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorCardDetails; - - internal void ExecuteOnCardDetails(PaymentsService.CardDetailsApiResponse apiResponse) - { - OnCardDetails?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorCardDetails(Exception exception) - { - OnErrorCardDetails?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnGetResultOfPaymentSession; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorGetResultOfPaymentSession; - - internal void ExecuteOnGetResultOfPaymentSession(PaymentsService.GetResultOfPaymentSessionApiResponse apiResponse) - { - OnGetResultOfPaymentSession?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorGetResultOfPaymentSession(Exception exception) - { - OnErrorGetResultOfPaymentSession?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnPaymentMethods; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorPaymentMethods; - - internal void ExecuteOnPaymentMethods(PaymentsService.PaymentMethodsApiResponse apiResponse) - { - OnPaymentMethods?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorPaymentMethods(Exception exception) - { - OnErrorPaymentMethods?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnPayments; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorPayments; - - internal void ExecuteOnPayments(PaymentsService.PaymentsApiResponse apiResponse) - { - OnPayments?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorPayments(Exception exception) - { - OnErrorPayments?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnPaymentsDetails; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorPaymentsDetails; - - internal void ExecuteOnPaymentsDetails(PaymentsService.PaymentsDetailsApiResponse apiResponse) + private readonly string _baseUrl; + + public PaymentsService(AdyenClient client) : base(client) { - OnPaymentsDetails?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } - - internal void ExecuteOnErrorPaymentsDetails(Exception exception) + + public Model.Checkout.CardDetailsResponse CardDetails(CardDetailsRequest cardDetailsRequest = default, RequestOptions requestOptions = default) { - OnErrorPaymentsDetails?.Invoke(this, new ExceptionEventArgs(exception)); + return CardDetailsAsync(cardDetailsRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// The event raised after the server response - /// - public event EventHandler OnSessions; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorSessions; - - internal void ExecuteOnSessions(PaymentsService.SessionsApiResponse apiResponse) + public async Task CardDetailsAsync(CardDetailsRequest cardDetailsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - OnSessions?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + var endpoint = _baseUrl + "/cardDetails"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(cardDetailsRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - internal void ExecuteOnErrorSessions(Exception exception) + + public Model.Checkout.SessionResultResponse GetResultOfPaymentSession(string sessionId, string sessionResult, RequestOptions requestOptions = default) { - OnErrorSessions?.Invoke(this, new ExceptionEventArgs(exception)); + return GetResultOfPaymentSessionAsync(sessionId, sessionResult, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public sealed partial class PaymentsService : IPaymentsService - { - private JsonSerializerOptions _jsonSerializerOptions; - - /// - /// The logger factory - /// - public ILoggerFactory LoggerFactory { get; } - - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The HttpClient - /// - public System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The class containing the events - /// - public PaymentsServiceEvents Events { get; } - - /// - /// A token provider of type - /// - public TokenProvider ApiKeyProvider { get; } - - /// - /// A token provider of type - /// - public TokenProvider BasicTokenProvider { get; } - /// - /// Initializes a new instance of the class. - /// - /// - public PaymentsService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, PaymentsServiceEvents paymentsServiceEvents, - TokenProvider apiKeyProvider, - TokenProvider basicTokenProvider) + public async Task GetResultOfPaymentSessionAsync(string sessionId, string sessionResult, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; - LoggerFactory = loggerFactory; - Logger = LoggerFactory.CreateLogger(); - HttpClient = httpClient; - Events = paymentsServiceEvents; - ApiKeyProvider = apiKeyProvider; - BasicTokenProvider = basicTokenProvider; + // Build the query string + var queryParams = new Dictionary(); + queryParams.Add("sessionResult", sessionResult); + var endpoint = _baseUrl + $"/sessions/{sessionId}" + ToQueryString(queryParams); + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(null, requestOptions, new HttpMethod("GET"), cancellationToken).ConfigureAwait(false); } - - partial void FormatCardDetails(ref string idempotencyKey, CardDetailsRequest cardDetailsRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateCardDetails(string idempotencyKey, CardDetailsRequest cardDetailsRequest) + + public Model.Checkout.PaymentMethodsResponse PaymentMethods(PaymentMethodsRequest paymentMethodsRequest = default, RequestOptions requestOptions = default) { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (cardDetailsRequest.IsSet && cardDetailsRequest.Value == null) - throw new ArgumentNullException(nameof(cardDetailsRequest)); + return PaymentMethodsAsync(paymentMethodsRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterCardDetailsDefaultImplementation(ICardDetailsApiResponse apiResponseLocalVar, string idempotencyKey, CardDetailsRequest cardDetailsRequest) + public async Task PaymentMethodsAsync(PaymentMethodsRequest paymentMethodsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - bool suppressDefaultLog = false; - AfterCardDetails(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, cardDetailsRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + var endpoint = _baseUrl + "/paymentMethods"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(paymentMethodsRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterCardDetails(ref bool suppressDefaultLog, ICardDetailsApiResponse apiResponseLocalVar, string idempotencyKey, CardDetailsRequest cardDetailsRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorCardDetailsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CardDetailsRequest cardDetailsRequest) + + public Model.Checkout.PaymentResponse Payments(PaymentRequest paymentRequest = default, RequestOptions requestOptions = default) { - bool suppressDefaultLogLocalVar = false; - OnErrorCardDetails(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, cardDetailsRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + return PaymentsAsync(paymentRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorCardDetails(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CardDetailsRequest cardDetailsRequest); - - /// - /// Get the brands and other details of a card Use this endpoint to get information about the card or network token that enables you to decideon the routing of the transaction and the eligibility of the card for the type of transaction. If you include [your supported brands](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__reqParam_supportedBrands) in the request, the response also tells you if you support each [brand that was identified on the card](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__resParam_details). If you have an API-only integration and collect card data, use this endpoint to find out if the shopper's card is co-branded. For co-branded cards, you must let the shopper choose the brand to pay with if you support both brands. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task CardDetailsOrDefaultAsync(Option idempotencyKey = default, Option cardDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default) + public async Task PaymentsAsync(PaymentRequest paymentRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - try - { - return await CardDetailsAsync(idempotencyKey, cardDetailsRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } + var endpoint = _baseUrl + "/payments"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(paymentRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - /// - /// Get the brands and other details of a card Use this endpoint to get information about the card or network token that enables you to decideon the routing of the transaction and the eligibility of the card for the type of transaction. If you include [your supported brands](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__reqParam_supportedBrands) in the request, the response also tells you if you support each [brand that was identified on the card](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/cardDetails__resParam_details). If you have an API-only integration and collect card data, use this endpoint to find out if the shopper's card is co-branded. For co-branded cards, you must let the shopper choose the brand to pay with if you support both brands. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task CardDetailsAsync(Option idempotencyKey = default, Option cardDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default) + + public Model.Checkout.PaymentDetailsResponse PaymentsDetails(PaymentDetailsRequest paymentDetailsRequest = default, RequestOptions requestOptions = default) { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateCardDetails(idempotencyKey, cardDetailsRequest); - - FormatCardDetails(ref idempotencyKey, cardDetailsRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/cardDetails"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (cardDetailsRequest.IsSet) - httpRequestMessageLocalVar.Content = (cardDetailsRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(cardDetailsRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - CardDetailsApiResponse apiResponseLocalVar = new CardDetailsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/cardDetails", requestedAtLocalVar, _jsonSerializerOptions); - - AfterCardDetailsDefaultImplementation(apiResponseLocalVar, idempotencyKey, cardDetailsRequest); - - Events.ExecuteOnCardDetails(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorCardDetailsDefaultImplementation(e, "/cardDetails", uriBuilderLocalVar.Path, idempotencyKey, cardDetailsRequest); - Events.ExecuteOnErrorCardDetails(e); - throw; - } + return PaymentsDetailsAsync(paymentDetailsRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// The - /// - public partial class CardDetailsApiResponse : Adyen.Client.ApiResponse, ICardDetailsApiResponse + public async Task PaymentsDetailsAsync(PaymentDetailsRequest paymentDetailsRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public CardDetailsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.CardDetailsResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.CardDetailsResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + var endpoint = _baseUrl + "/payments/details"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(paymentDetailsRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - partial void FormatGetResultOfPaymentSession(ref string sessionId, ref string sessionResult); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateGetResultOfPaymentSession(string sessionId, string sessionResult) + + public Model.Checkout.CreateCheckoutSessionResponse Sessions(CreateCheckoutSessionRequest createCheckoutSessionRequest = default, RequestOptions requestOptions = default) { - if (sessionId == null) - throw new ArgumentNullException(nameof(sessionId)); - - if (sessionResult == null) - throw new ArgumentNullException(nameof(sessionResult)); + return SessionsAsync(createCheckoutSessionRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterGetResultOfPaymentSessionDefaultImplementation(IGetResultOfPaymentSessionApiResponse apiResponseLocalVar, string sessionId, string sessionResult) + public async Task SessionsAsync(CreateCheckoutSessionRequest createCheckoutSessionRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - bool suppressDefaultLog = false; - AfterGetResultOfPaymentSession(ref suppressDefaultLog, apiResponseLocalVar, sessionId, sessionResult); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterGetResultOfPaymentSession(ref bool suppressDefaultLog, IGetResultOfPaymentSessionApiResponse apiResponseLocalVar, string sessionId, string sessionResult); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorGetResultOfPaymentSessionDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string sessionId, string sessionResult) - { - bool suppressDefaultLogLocalVar = false; - OnErrorGetResultOfPaymentSession(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, sessionId, sessionResult); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorGetResultOfPaymentSession(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string sessionId, string sessionResult); - - /// - /// Get the result of a payment session Returns the status of the payment session with the `sessionId` and `sessionResult` specified in the path. - /// - /// A unique identifier of the session. - /// The `sessionResult` value from the Drop-in or Component. - /// Cancellation Token to cancel the request. - /// <> - public async Task GetResultOfPaymentSessionOrDefaultAsync(string sessionId, string sessionResult, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await GetResultOfPaymentSessionAsync(sessionId, sessionResult, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Get the result of a payment session Returns the status of the payment session with the `sessionId` and `sessionResult` specified in the path. - /// - /// Thrown when fails to make API call - /// A unique identifier of the session. - /// The `sessionResult` value from the Drop-in or Component. - /// Cancellation Token to cancel the request. - /// <> - public async Task GetResultOfPaymentSessionAsync(string sessionId, string sessionResult, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateGetResultOfPaymentSession(sessionId, sessionResult); - - FormatGetResultOfPaymentSession(ref sessionId, ref sessionResult); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/sessions/{sessionId}"; - uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BsessionId%7D", Uri.EscapeDataString(sessionId.ToString())); - - System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - - parseQueryStringLocalVar["sessionResult"] = ClientUtils.ParameterToString(sessionResult); - - uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - GetResultOfPaymentSessionApiResponse apiResponseLocalVar = new GetResultOfPaymentSessionApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/sessions/{sessionId}", requestedAtLocalVar, _jsonSerializerOptions); - - AfterGetResultOfPaymentSessionDefaultImplementation(apiResponseLocalVar, sessionId, sessionResult); - - Events.ExecuteOnGetResultOfPaymentSession(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorGetResultOfPaymentSessionDefaultImplementation(e, "/sessions/{sessionId}", uriBuilderLocalVar.Path, sessionId, sessionResult); - Events.ExecuteOnErrorGetResultOfPaymentSession(e); - throw; - } - } - - /// - /// The - /// - public partial class GetResultOfPaymentSessionApiResponse : Adyen.Client.ApiResponse, IGetResultOfPaymentSessionApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public GetResultOfPaymentSessionApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.SessionResultResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.SessionResultResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatPaymentMethods(ref string idempotencyKey, PaymentMethodsRequest paymentMethodsRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidatePaymentMethods(string idempotencyKey, PaymentMethodsRequest paymentMethodsRequest) - { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (paymentMethodsRequest.IsSet && paymentMethodsRequest.Value == null) - throw new ArgumentNullException(nameof(paymentMethodsRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterPaymentMethodsDefaultImplementation(IPaymentMethodsApiResponse apiResponseLocalVar, string idempotencyKey, PaymentMethodsRequest paymentMethodsRequest) - { - bool suppressDefaultLog = false; - AfterPaymentMethods(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, paymentMethodsRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterPaymentMethods(ref bool suppressDefaultLog, IPaymentMethodsApiResponse apiResponseLocalVar, string idempotencyKey, PaymentMethodsRequest paymentMethodsRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorPaymentMethodsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentMethodsRequest paymentMethodsRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorPaymentMethods(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, paymentMethodsRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorPaymentMethods(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentMethodsRequest paymentMethodsRequest); - - /// - /// Get a list of available payment methods Retrieves the list of available payment methods for the transaction, based on the transaction information like amount, country, and currency. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task PaymentMethodsOrDefaultAsync(Option idempotencyKey = default, Option paymentMethodsRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await PaymentMethodsAsync(idempotencyKey, paymentMethodsRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Get a list of available payment methods Retrieves the list of available payment methods for the transaction, based on the transaction information like amount, country, and currency. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task PaymentMethodsAsync(Option idempotencyKey = default, Option paymentMethodsRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidatePaymentMethods(idempotencyKey, paymentMethodsRequest); - - FormatPaymentMethods(ref idempotencyKey, paymentMethodsRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/paymentMethods"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (paymentMethodsRequest.IsSet) - httpRequestMessageLocalVar.Content = (paymentMethodsRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentMethodsRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - PaymentMethodsApiResponse apiResponseLocalVar = new PaymentMethodsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/paymentMethods", requestedAtLocalVar, _jsonSerializerOptions); - - AfterPaymentMethodsDefaultImplementation(apiResponseLocalVar, idempotencyKey, paymentMethodsRequest); - - Events.ExecuteOnPaymentMethods(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorPaymentMethodsDefaultImplementation(e, "/paymentMethods", uriBuilderLocalVar.Path, idempotencyKey, paymentMethodsRequest); - Events.ExecuteOnErrorPaymentMethods(e); - throw; - } - } - - /// - /// The - /// - public partial class PaymentMethodsApiResponse : Adyen.Client.ApiResponse, IPaymentMethodsApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public PaymentMethodsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.PaymentMethodsResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.PaymentMethodsResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatPayments(ref string idempotencyKey, PaymentRequest paymentRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidatePayments(string idempotencyKey, PaymentRequest paymentRequest) - { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (paymentRequest.IsSet && paymentRequest.Value == null) - throw new ArgumentNullException(nameof(paymentRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterPaymentsDefaultImplementation(IPaymentsApiResponse apiResponseLocalVar, string idempotencyKey, PaymentRequest paymentRequest) - { - bool suppressDefaultLog = false; - AfterPayments(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, paymentRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterPayments(ref bool suppressDefaultLog, IPaymentsApiResponse apiResponseLocalVar, string idempotencyKey, PaymentRequest paymentRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorPaymentsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentRequest paymentRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorPayments(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, paymentRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorPayments(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentRequest paymentRequest); - - /// - /// Start a transaction Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). The response depends on the [payment flow](https://docs.adyen.com/payment-methods#payment-flow): * For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. * For a redirect or additional action, the response contains an `action` object. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task PaymentsOrDefaultAsync(Option idempotencyKey = default, Option paymentRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await PaymentsAsync(idempotencyKey, paymentRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Start a transaction Sends payment parameters (like amount, country, and currency) together with other required input details collected from the shopper. To know more about required parameters for specific payment methods, refer to our [payment method guides](https://docs.adyen.com/payment-methods). The response depends on the [payment flow](https://docs.adyen.com/payment-methods#payment-flow): * For a direct flow, the response includes a `pspReference` and a `resultCode` with the payment result, for example **Authorised** or **Refused**. * For a redirect or additional action, the response contains an `action` object. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task PaymentsAsync(Option idempotencyKey = default, Option paymentRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidatePayments(idempotencyKey, paymentRequest); - - FormatPayments(ref idempotencyKey, paymentRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (paymentRequest.IsSet) - httpRequestMessageLocalVar.Content = (paymentRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - PaymentsApiResponse apiResponseLocalVar = new PaymentsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments", requestedAtLocalVar, _jsonSerializerOptions); - - AfterPaymentsDefaultImplementation(apiResponseLocalVar, idempotencyKey, paymentRequest); - - Events.ExecuteOnPayments(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorPaymentsDefaultImplementation(e, "/payments", uriBuilderLocalVar.Path, idempotencyKey, paymentRequest); - Events.ExecuteOnErrorPayments(e); - throw; - } - } - - /// - /// The - /// - public partial class PaymentsApiResponse : Adyen.Client.ApiResponse, IPaymentsApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public PaymentsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.PaymentResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.PaymentResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatPaymentsDetails(ref string idempotencyKey, PaymentDetailsRequest paymentDetailsRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidatePaymentsDetails(string idempotencyKey, PaymentDetailsRequest paymentDetailsRequest) - { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (paymentDetailsRequest.IsSet && paymentDetailsRequest.Value == null) - throw new ArgumentNullException(nameof(paymentDetailsRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterPaymentsDetailsDefaultImplementation(IPaymentsDetailsApiResponse apiResponseLocalVar, string idempotencyKey, PaymentDetailsRequest paymentDetailsRequest) - { - bool suppressDefaultLog = false; - AfterPaymentsDetails(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, paymentDetailsRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterPaymentsDetails(ref bool suppressDefaultLog, IPaymentsDetailsApiResponse apiResponseLocalVar, string idempotencyKey, PaymentDetailsRequest paymentDetailsRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorPaymentsDetailsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentDetailsRequest paymentDetailsRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorPaymentsDetails(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, paymentDetailsRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorPaymentsDetails(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaymentDetailsRequest paymentDetailsRequest); - - /// - /// Submit details for a payment Submits details for a payment created using `/payments`. This step is only needed when no final state has been reached on the `/payments` request, for example when the shopper was redirected to another page to complete the payment. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task PaymentsDetailsOrDefaultAsync(Option idempotencyKey = default, Option paymentDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await PaymentsDetailsAsync(idempotencyKey, paymentDetailsRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Submit details for a payment Submits details for a payment created using `/payments`. This step is only needed when no final state has been reached on the `/payments` request, for example when the shopper was redirected to another page to complete the payment. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task PaymentsDetailsAsync(Option idempotencyKey = default, Option paymentDetailsRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidatePaymentsDetails(idempotencyKey, paymentDetailsRequest); - - FormatPaymentsDetails(ref idempotencyKey, paymentDetailsRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/payments/details"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (paymentDetailsRequest.IsSet) - httpRequestMessageLocalVar.Content = (paymentDetailsRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paymentDetailsRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - PaymentsDetailsApiResponse apiResponseLocalVar = new PaymentsDetailsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/payments/details", requestedAtLocalVar, _jsonSerializerOptions); - - AfterPaymentsDetailsDefaultImplementation(apiResponseLocalVar, idempotencyKey, paymentDetailsRequest); - - Events.ExecuteOnPaymentsDetails(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorPaymentsDetailsDefaultImplementation(e, "/payments/details", uriBuilderLocalVar.Path, idempotencyKey, paymentDetailsRequest); - Events.ExecuteOnErrorPaymentsDetails(e); - throw; - } - } - - /// - /// The - /// - public partial class PaymentsDetailsApiResponse : Adyen.Client.ApiResponse, IPaymentsDetailsApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public PaymentsDetailsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.PaymentDetailsResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.PaymentDetailsResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatSessions(ref string idempotencyKey, CreateCheckoutSessionRequest createCheckoutSessionRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateSessions(string idempotencyKey, CreateCheckoutSessionRequest createCheckoutSessionRequest) - { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (createCheckoutSessionRequest.IsSet && createCheckoutSessionRequest.Value == null) - throw new ArgumentNullException(nameof(createCheckoutSessionRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterSessionsDefaultImplementation(ISessionsApiResponse apiResponseLocalVar, string idempotencyKey, CreateCheckoutSessionRequest createCheckoutSessionRequest) - { - bool suppressDefaultLog = false; - AfterSessions(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, createCheckoutSessionRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterSessions(ref bool suppressDefaultLog, ISessionsApiResponse apiResponseLocalVar, string idempotencyKey, CreateCheckoutSessionRequest createCheckoutSessionRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorSessionsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CreateCheckoutSessionRequest createCheckoutSessionRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorSessions(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, createCheckoutSessionRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorSessions(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, CreateCheckoutSessionRequest createCheckoutSessionRequest); - - /// - /// Create a payment session Creates a payment session for [Drop-in](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Drop-in), [Components](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Components), and [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Hosted+Checkout) integrations. The response contains encrypted payment session data. The front end then uses the session data to make any required server-side calls for the payment flow. You get the payment outcome asynchronously, in an [AUTHORISATION](https://docs.adyen.com/api-explorer/#/Webhooks/latest/post/AUTHORISATION) webhook. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task SessionsOrDefaultAsync(Option idempotencyKey = default, Option createCheckoutSessionRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await SessionsAsync(idempotencyKey, createCheckoutSessionRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Create a payment session Creates a payment session for [Drop-in](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Drop-in), [Components](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Components), and [Hosted Checkout](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Hosted+Checkout) integrations. The response contains encrypted payment session data. The front end then uses the session data to make any required server-side calls for the payment flow. You get the payment outcome asynchronously, in an [AUTHORISATION](https://docs.adyen.com/api-explorer/#/Webhooks/latest/post/AUTHORISATION) webhook. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task SessionsAsync(Option idempotencyKey = default, Option createCheckoutSessionRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateSessions(idempotencyKey, createCheckoutSessionRequest); - - FormatSessions(ref idempotencyKey, createCheckoutSessionRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/sessions"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (createCheckoutSessionRequest.IsSet) - httpRequestMessageLocalVar.Content = (createCheckoutSessionRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(createCheckoutSessionRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - SessionsApiResponse apiResponseLocalVar = new SessionsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/sessions", requestedAtLocalVar, _jsonSerializerOptions); - - AfterSessionsDefaultImplementation(apiResponseLocalVar, idempotencyKey, createCheckoutSessionRequest); - - Events.ExecuteOnSessions(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorSessionsDefaultImplementation(e, "/sessions", uriBuilderLocalVar.Path, idempotencyKey, createCheckoutSessionRequest); - Events.ExecuteOnErrorSessions(e); - throw; - } - } - - /// - /// The - /// - public partial class SessionsApiResponse : Adyen.Client.ApiResponse, ISessionsApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public SessionsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 201 Created - /// - /// - public bool IsCreated => 201 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 201 Created - /// - /// - public Adyen.Model.Checkout.CreateCheckoutSessionResponse Created() - { - // This logic may be modified with the AsModel.mustache template - return IsCreated - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 201 Created and the deserialized response is not null - /// - /// - /// - public bool TryCreated(out Adyen.Model.Checkout.CreateCheckoutSessionResponse result) - { - result = null; - - try - { - result = Created(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + var endpoint = _baseUrl + "/sessions"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(createCheckoutSessionRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } } -} +} \ No newline at end of file diff --git a/Adyen/Service/Checkout/RecurringService.cs b/Adyen/Service/Checkout/RecurringService.cs index c03fa5f8a..46f6571c0 100644 --- a/Adyen/Service/Checkout/RecurringService.cs +++ b/Adyen/Service/Checkout/RecurringService.cs @@ -1,996 +1,140 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections.Generic; -using System.Net; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; using System.Net.Http; -using System.Net.Http.Headers; -using System.Text.Json; -using Adyen.Client; +using System.Threading; +using System.Threading.Tasks; +using Adyen.Model; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// Represents a collection of functions to interact with the API endpoints - /// This class is registered as transient. + /// RecurringService Interface /// - public interface IRecurringService : IApi + public interface IRecurringService { - /// - /// The class containing the events - /// - RecurringServiceEvents Events { get; } - /// /// Delete a token for stored payment details /// - /// - /// Deletes the token identified in the path. The token can no longer be used with payment requests. - /// - /// Thrown when fails to make API call - /// The unique identifier of the token. - /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - /// Your merchant account. - /// Cancellation Token to cancel the request. - /// <> - Task DeleteTokenForStoredPaymentDetailsAsync(string storedPaymentMethodId, string shopperReference, string merchantAccount, System.Threading.CancellationToken cancellationToken = default); - + /// - The unique identifier of the token. + /// - Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + /// - Your merchant account. + /// - Additional request options. + void DeleteTokenForStoredPaymentDetails(string storedPaymentMethodId, string shopperReference, string merchantAccount, RequestOptions requestOptions = default); + /// /// Delete a token for stored payment details /// - /// - /// Deletes the token identified in the path. The token can no longer be used with payment requests. - /// - /// The unique identifier of the token. - /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - /// Your merchant account. - /// Cancellation Token to cancel the request. - /// <> - Task DeleteTokenForStoredPaymentDetailsOrDefaultAsync(string storedPaymentMethodId, string shopperReference, string merchantAccount, System.Threading.CancellationToken cancellationToken = default); - + /// - The unique identifier of the token. + /// - Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + /// - Your merchant account. + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + Task DeleteTokenForStoredPaymentDetailsAsync(string storedPaymentMethodId, string shopperReference, string merchantAccount, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Get tokens for stored payment details /// - /// - /// Lists the tokens for stored payment details for the shopper identified in the path, if there are any available. The token ID can be used with payment requests for the shopper's payment. A summary of the stored details is included. - /// - /// Thrown when fails to make API call - /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. (optional) - /// Your merchant account. (optional) - /// Cancellation Token to cancel the request. - /// <> - Task GetTokensForStoredPaymentDetailsAsync(Option shopperReference = default, Option merchantAccount = default, System.Threading.CancellationToken cancellationToken = default); - + /// - Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + /// - Your merchant account. + /// - Additional request options. + /// . + Model.Checkout.ListStoredPaymentMethodsResponse GetTokensForStoredPaymentDetails(string shopperReference = default, string merchantAccount = default, RequestOptions requestOptions = default); + /// /// Get tokens for stored payment details /// - /// - /// Lists the tokens for stored payment details for the shopper identified in the path, if there are any available. The token ID can be used with payment requests for the shopper's payment. A summary of the stored details is included. - /// - /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. (optional) - /// Your merchant account. (optional) - /// Cancellation Token to cancel the request. - /// <> - Task GetTokensForStoredPaymentDetailsOrDefaultAsync(Option shopperReference = default, Option merchantAccount = default, System.Threading.CancellationToken cancellationToken = default); - + /// - Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + /// - Your merchant account. + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task GetTokensForStoredPaymentDetailsAsync(string shopperReference = default, string merchantAccount = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Create a token to store payment details /// - /// - /// Creates a token to store the shopper's payment details. This token can be used for the shopper's future payments. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task StoredPaymentMethodsAsync(Option idempotencyKey = default, Option storedPaymentMethodRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.StoredPaymentMethodResource StoredPaymentMethods(StoredPaymentMethodRequest storedPaymentMethodRequest = default, RequestOptions requestOptions = default); + /// /// Create a token to store payment details /// - /// - /// Creates a token to store the shopper's payment details. This token can be used for the shopper's future payments. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task StoredPaymentMethodsOrDefaultAsync(Option idempotencyKey = default, Option storedPaymentMethodRequest = default, System.Threading.CancellationToken cancellationToken = default); - } - - /// - /// The - /// - public interface IDeleteTokenForStoredPaymentDetailsApiResponse : Adyen.Client.IApiResponse - { - /// - /// Returns true if the response is 204 NoContent - /// - /// - bool IsNoContent { get; } - } - - /// - /// The - /// - public interface IGetTokensForStoredPaymentDetailsApiResponse : Adyen.Client.IApiResponse, IOk - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - } - - /// - /// The - /// - public interface IStoredPaymentMethodsApiResponse : Adyen.Client.IApiResponse, ICreated - { - /// - /// Returns true if the response is 201 Created - /// - /// - bool IsCreated { get; } + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task StoredPaymentMethodsAsync(StoredPaymentMethodRequest storedPaymentMethodRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + } - + /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the RecurringService API endpoints /// - public class RecurringServiceEvents + public class RecurringService : AbstractService, IRecurringService { - /// - /// The event raised after the server response - /// - public event EventHandler OnDeleteTokenForStoredPaymentDetails; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorDeleteTokenForStoredPaymentDetails; - - internal void ExecuteOnDeleteTokenForStoredPaymentDetails(RecurringService.DeleteTokenForStoredPaymentDetailsApiResponse apiResponse) - { - OnDeleteTokenForStoredPaymentDetails?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorDeleteTokenForStoredPaymentDetails(Exception exception) - { - OnErrorDeleteTokenForStoredPaymentDetails?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnGetTokensForStoredPaymentDetails; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorGetTokensForStoredPaymentDetails; - - internal void ExecuteOnGetTokensForStoredPaymentDetails(RecurringService.GetTokensForStoredPaymentDetailsApiResponse apiResponse) - { - OnGetTokensForStoredPaymentDetails?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorGetTokensForStoredPaymentDetails(Exception exception) - { - OnErrorGetTokensForStoredPaymentDetails?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnStoredPaymentMethods; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorStoredPaymentMethods; - - internal void ExecuteOnStoredPaymentMethods(RecurringService.StoredPaymentMethodsApiResponse apiResponse) - { - OnStoredPaymentMethods?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorStoredPaymentMethods(Exception exception) - { - OnErrorStoredPaymentMethods?.Invoke(this, new ExceptionEventArgs(exception)); - } - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public sealed partial class RecurringService : IRecurringService - { - private JsonSerializerOptions _jsonSerializerOptions; - - /// - /// The logger factory - /// - public ILoggerFactory LoggerFactory { get; } - - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The HttpClient - /// - public System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The class containing the events - /// - public RecurringServiceEvents Events { get; } - - /// - /// A token provider of type - /// - public TokenProvider ApiKeyProvider { get; } - - /// - /// A token provider of type - /// - public TokenProvider BasicTokenProvider { get; } - - /// - /// Initializes a new instance of the class. - /// - /// - public RecurringService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, RecurringServiceEvents recurringServiceEvents, - TokenProvider apiKeyProvider, - TokenProvider basicTokenProvider) - { - _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; - LoggerFactory = loggerFactory; - Logger = LoggerFactory.CreateLogger(); - HttpClient = httpClient; - Events = recurringServiceEvents; - ApiKeyProvider = apiKeyProvider; - BasicTokenProvider = basicTokenProvider; - } - - partial void FormatDeleteTokenForStoredPaymentDetails(ref string storedPaymentMethodId, ref string shopperReference, ref string merchantAccount); - - /// - /// Validates the request parameters - /// - /// - /// - /// - /// - private void ValidateDeleteTokenForStoredPaymentDetails(string storedPaymentMethodId, string shopperReference, string merchantAccount) - { - if (storedPaymentMethodId == null) - throw new ArgumentNullException(nameof(storedPaymentMethodId)); - - if (shopperReference == null) - throw new ArgumentNullException(nameof(shopperReference)); - - if (merchantAccount == null) - throw new ArgumentNullException(nameof(merchantAccount)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - private void AfterDeleteTokenForStoredPaymentDetailsDefaultImplementation(IDeleteTokenForStoredPaymentDetailsApiResponse apiResponseLocalVar, string storedPaymentMethodId, string shopperReference, string merchantAccount) - { - bool suppressDefaultLog = false; - AfterDeleteTokenForStoredPaymentDetails(ref suppressDefaultLog, apiResponseLocalVar, storedPaymentMethodId, shopperReference, merchantAccount); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - /// - partial void AfterDeleteTokenForStoredPaymentDetails(ref bool suppressDefaultLog, IDeleteTokenForStoredPaymentDetailsApiResponse apiResponseLocalVar, string storedPaymentMethodId, string shopperReference, string merchantAccount); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - /// - private void OnErrorDeleteTokenForStoredPaymentDetailsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string storedPaymentMethodId, string shopperReference, string merchantAccount) - { - bool suppressDefaultLogLocalVar = false; - OnErrorDeleteTokenForStoredPaymentDetails(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, storedPaymentMethodId, shopperReference, merchantAccount); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorDeleteTokenForStoredPaymentDetails(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string storedPaymentMethodId, string shopperReference, string merchantAccount); - - /// - /// Delete a token for stored payment details Deletes the token identified in the path. The token can no longer be used with payment requests. - /// - /// The unique identifier of the token. - /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - /// Your merchant account. - /// Cancellation Token to cancel the request. - /// <> - public async Task DeleteTokenForStoredPaymentDetailsOrDefaultAsync(string storedPaymentMethodId, string shopperReference, string merchantAccount, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await DeleteTokenForStoredPaymentDetailsAsync(storedPaymentMethodId, shopperReference, merchantAccount, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Delete a token for stored payment details Deletes the token identified in the path. The token can no longer be used with payment requests. - /// - /// Thrown when fails to make API call - /// The unique identifier of the token. - /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. - /// Your merchant account. - /// Cancellation Token to cancel the request. - /// <> - public async Task DeleteTokenForStoredPaymentDetailsAsync(string storedPaymentMethodId, string shopperReference, string merchantAccount, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateDeleteTokenForStoredPaymentDetails(storedPaymentMethodId, shopperReference, merchantAccount); - - FormatDeleteTokenForStoredPaymentDetails(ref storedPaymentMethodId, ref shopperReference, ref merchantAccount); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/storedPaymentMethods/{storedPaymentMethodId}"; - uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BstoredPaymentMethodId%7D", Uri.EscapeDataString(storedPaymentMethodId.ToString())); - - System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - - parseQueryStringLocalVar["shopperReference"] = ClientUtils.ParameterToString(shopperReference); - parseQueryStringLocalVar["merchantAccount"] = ClientUtils.ParameterToString(merchantAccount); - - uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - DeleteTokenForStoredPaymentDetailsApiResponse apiResponseLocalVar = new DeleteTokenForStoredPaymentDetailsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/storedPaymentMethods/{storedPaymentMethodId}", requestedAtLocalVar, _jsonSerializerOptions); - - AfterDeleteTokenForStoredPaymentDetailsDefaultImplementation(apiResponseLocalVar, storedPaymentMethodId, shopperReference, merchantAccount); - - Events.ExecuteOnDeleteTokenForStoredPaymentDetails(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorDeleteTokenForStoredPaymentDetailsDefaultImplementation(e, "/storedPaymentMethods/{storedPaymentMethodId}", uriBuilderLocalVar.Path, storedPaymentMethodId, shopperReference, merchantAccount); - Events.ExecuteOnErrorDeleteTokenForStoredPaymentDetails(e); - throw; - } - } - - /// - /// The - /// - public partial class DeleteTokenForStoredPaymentDetailsApiResponse : Adyen.Client.ApiResponse, IDeleteTokenForStoredPaymentDetailsApiResponse + private readonly string _baseUrl; + + public RecurringService(AdyenClient client) : base(client) { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public DeleteTokenForStoredPaymentDetailsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 204 NoContent - /// - /// - public bool IsNoContent => 204 == (int)StatusCode; - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } - - partial void FormatGetTokensForStoredPaymentDetails(ref string shopperReference, ref string merchantAccount); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateGetTokensForStoredPaymentDetails(string shopperReference, string merchantAccount) + + public void DeleteTokenForStoredPaymentDetails(string storedPaymentMethodId, string shopperReference, string merchantAccount, RequestOptions requestOptions = default) { - if (shopperReference.IsSet && shopperReference.Value == null) - throw new ArgumentNullException(nameof(shopperReference)); - - if (merchantAccount.IsSet && merchantAccount.Value == null) - throw new ArgumentNullException(nameof(merchantAccount)); + DeleteTokenForStoredPaymentDetailsAsync(storedPaymentMethodId, shopperReference, merchantAccount, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterGetTokensForStoredPaymentDetailsDefaultImplementation(IGetTokensForStoredPaymentDetailsApiResponse apiResponseLocalVar, string shopperReference, string merchantAccount) + public async Task DeleteTokenForStoredPaymentDetailsAsync(string storedPaymentMethodId, string shopperReference, string merchantAccount, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - bool suppressDefaultLog = false; - AfterGetTokensForStoredPaymentDetails(ref suppressDefaultLog, apiResponseLocalVar, shopperReference, merchantAccount); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + // Build the query string + var queryParams = new Dictionary(); + queryParams.Add("shopperReference", shopperReference); + queryParams.Add("merchantAccount", merchantAccount); + var endpoint = _baseUrl + $"/storedPaymentMethods/{storedPaymentMethodId}" + ToQueryString(queryParams); + var resource = new ServiceResource(this, endpoint); + await resource.RequestAsync(null, requestOptions, new HttpMethod("DELETE"), cancellationToken).ConfigureAwait(false); } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterGetTokensForStoredPaymentDetails(ref bool suppressDefaultLog, IGetTokensForStoredPaymentDetailsApiResponse apiResponseLocalVar, string shopperReference, string merchantAccount); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorGetTokensForStoredPaymentDetailsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string shopperReference, string merchantAccount) + + public Model.Checkout.ListStoredPaymentMethodsResponse GetTokensForStoredPaymentDetails(string shopperReference = default, string merchantAccount = default, RequestOptions requestOptions = default) { - bool suppressDefaultLogLocalVar = false; - OnErrorGetTokensForStoredPaymentDetails(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, shopperReference, merchantAccount); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + return GetTokensForStoredPaymentDetailsAsync(shopperReference, merchantAccount, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorGetTokensForStoredPaymentDetails(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string shopperReference, string merchantAccount); - - /// - /// Get tokens for stored payment details Lists the tokens for stored payment details for the shopper identified in the path, if there are any available. The token ID can be used with payment requests for the shopper's payment. A summary of the stored details is included. - /// - /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. (optional) - /// Your merchant account. (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task GetTokensForStoredPaymentDetailsOrDefaultAsync(Option shopperReference = default, Option merchantAccount = default, System.Threading.CancellationToken cancellationToken = default) + public async Task GetTokensForStoredPaymentDetailsAsync(string shopperReference = default, string merchantAccount = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - try - { - return await GetTokensForStoredPaymentDetailsAsync(shopperReference, merchantAccount, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } + // Build the query string + var queryParams = new Dictionary(); + if (shopperReference != null) queryParams.Add("shopperReference", shopperReference); + if (merchantAccount != null) queryParams.Add("merchantAccount", merchantAccount); + var endpoint = _baseUrl + "/storedPaymentMethods" + ToQueryString(queryParams); + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(null, requestOptions, new HttpMethod("GET"), cancellationToken).ConfigureAwait(false); } - - /// - /// Get tokens for stored payment details Lists the tokens for stored payment details for the shopper identified in the path, if there are any available. The token ID can be used with payment requests for the shopper's payment. A summary of the stored details is included. - /// - /// Thrown when fails to make API call - /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. (optional) - /// Your merchant account. (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task GetTokensForStoredPaymentDetailsAsync(Option shopperReference = default, Option merchantAccount = default, System.Threading.CancellationToken cancellationToken = default) + + public Model.Checkout.StoredPaymentMethodResource StoredPaymentMethods(StoredPaymentMethodRequest storedPaymentMethodRequest = default, RequestOptions requestOptions = default) { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateGetTokensForStoredPaymentDetails(shopperReference, merchantAccount); - - FormatGetTokensForStoredPaymentDetails(ref shopperReference, ref merchantAccount); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/storedPaymentMethods"; - - System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - - if (shopperReference.IsSet) - parseQueryStringLocalVar["shopperReference"] = ClientUtils.ParameterToString(shopperReference.Value); - - if (merchantAccount.IsSet) - parseQueryStringLocalVar["merchantAccount"] = ClientUtils.ParameterToString(merchantAccount.Value); - - uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - GetTokensForStoredPaymentDetailsApiResponse apiResponseLocalVar = new GetTokensForStoredPaymentDetailsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/storedPaymentMethods", requestedAtLocalVar, _jsonSerializerOptions); - - AfterGetTokensForStoredPaymentDetailsDefaultImplementation(apiResponseLocalVar, shopperReference, merchantAccount); - - Events.ExecuteOnGetTokensForStoredPaymentDetails(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorGetTokensForStoredPaymentDetailsDefaultImplementation(e, "/storedPaymentMethods", uriBuilderLocalVar.Path, shopperReference, merchantAccount); - Events.ExecuteOnErrorGetTokensForStoredPaymentDetails(e); - throw; - } + return StoredPaymentMethodsAsync(storedPaymentMethodRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// The - /// - public partial class GetTokensForStoredPaymentDetailsApiResponse : Adyen.Client.ApiResponse, IGetTokensForStoredPaymentDetailsApiResponse + public async Task StoredPaymentMethodsAsync(StoredPaymentMethodRequest storedPaymentMethodRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public GetTokensForStoredPaymentDetailsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.ListStoredPaymentMethodsResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.ListStoredPaymentMethodsResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatStoredPaymentMethods(ref string idempotencyKey, StoredPaymentMethodRequest storedPaymentMethodRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateStoredPaymentMethods(string idempotencyKey, StoredPaymentMethodRequest storedPaymentMethodRequest) - { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (storedPaymentMethodRequest.IsSet && storedPaymentMethodRequest.Value == null) - throw new ArgumentNullException(nameof(storedPaymentMethodRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterStoredPaymentMethodsDefaultImplementation(IStoredPaymentMethodsApiResponse apiResponseLocalVar, string idempotencyKey, StoredPaymentMethodRequest storedPaymentMethodRequest) - { - bool suppressDefaultLog = false; - AfterStoredPaymentMethods(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, storedPaymentMethodRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterStoredPaymentMethods(ref bool suppressDefaultLog, IStoredPaymentMethodsApiResponse apiResponseLocalVar, string idempotencyKey, StoredPaymentMethodRequest storedPaymentMethodRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorStoredPaymentMethodsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, StoredPaymentMethodRequest storedPaymentMethodRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorStoredPaymentMethods(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, storedPaymentMethodRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorStoredPaymentMethods(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, StoredPaymentMethodRequest storedPaymentMethodRequest); - - /// - /// Create a token to store payment details Creates a token to store the shopper's payment details. This token can be used for the shopper's future payments. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task StoredPaymentMethodsOrDefaultAsync(Option idempotencyKey = default, Option storedPaymentMethodRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await StoredPaymentMethodsAsync(idempotencyKey, storedPaymentMethodRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Create a token to store payment details Creates a token to store the shopper's payment details. This token can be used for the shopper's future payments. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task StoredPaymentMethodsAsync(Option idempotencyKey = default, Option storedPaymentMethodRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateStoredPaymentMethods(idempotencyKey, storedPaymentMethodRequest); - - FormatStoredPaymentMethods(ref idempotencyKey, storedPaymentMethodRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/storedPaymentMethods"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (storedPaymentMethodRequest.IsSet) - httpRequestMessageLocalVar.Content = (storedPaymentMethodRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(storedPaymentMethodRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - StoredPaymentMethodsApiResponse apiResponseLocalVar = new StoredPaymentMethodsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/storedPaymentMethods", requestedAtLocalVar, _jsonSerializerOptions); - - AfterStoredPaymentMethodsDefaultImplementation(apiResponseLocalVar, idempotencyKey, storedPaymentMethodRequest); - - Events.ExecuteOnStoredPaymentMethods(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorStoredPaymentMethodsDefaultImplementation(e, "/storedPaymentMethods", uriBuilderLocalVar.Path, idempotencyKey, storedPaymentMethodRequest); - Events.ExecuteOnErrorStoredPaymentMethods(e); - throw; - } - } - - /// - /// The - /// - public partial class StoredPaymentMethodsApiResponse : Adyen.Client.ApiResponse, IStoredPaymentMethodsApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public StoredPaymentMethodsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 201 Created - /// - /// - public bool IsCreated => 201 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 201 Created - /// - /// - public Adyen.Model.Checkout.StoredPaymentMethodResource Created() - { - // This logic may be modified with the AsModel.mustache template - return IsCreated - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 201 Created and the deserialized response is not null - /// - /// - /// - public bool TryCreated(out Adyen.Model.Checkout.StoredPaymentMethodResource result) - { - result = null; - - try - { - result = Created(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)201); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + var endpoint = _baseUrl + "/storedPaymentMethods"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(storedPaymentMethodRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } } -} +} \ No newline at end of file diff --git a/Adyen/Service/Checkout/UtilityService.cs b/Adyen/Service/Checkout/UtilityService.cs index 3aa463f78..8edd07053 100644 --- a/Adyen/Service/Checkout/UtilityService.cs +++ b/Adyen/Service/Checkout/UtilityService.cs @@ -1,1483 +1,132 @@ -// /* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ +* Adyen Checkout API +* +* +* The version of the OpenAPI document: 71 +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ using System; using System.Collections.Generic; -using System.Net; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; using System.Net.Http; -using System.Net.Http.Headers; -using System.Text.Json; -using Adyen.Client; +using System.Threading; +using System.Threading.Tasks; +using Adyen.Model; using Adyen.Model.Checkout; namespace Adyen.Service.Checkout { /// - /// Represents a collection of functions to interact with the API endpoints - /// This class is registered as transient. + /// UtilityService Interface /// - public interface IUtilityService : IApi + public interface IUtilityService { - /// - /// The class containing the events - /// - UtilityServiceEvents Events { get; } - /// /// Get an Apple Pay session /// - /// - /// You need to use this endpoint if you have an API-only integration with Apple Pay which uses Adyen's Apple Pay certificate. The endpoint returns the Apple Pay session data which you need to complete the [Apple Pay session validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task GetApplePaySessionAsync(Option idempotencyKey = default, Option applePaySessionRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.ApplePaySessionResponse GetApplePaySession(ApplePaySessionRequest applePaySessionRequest = default, RequestOptions requestOptions = default); + /// /// Get an Apple Pay session /// - /// - /// You need to use this endpoint if you have an API-only integration with Apple Pay which uses Adyen's Apple Pay certificate. The endpoint returns the Apple Pay session data which you need to complete the [Apple Pay session validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task GetApplePaySessionOrDefaultAsync(Option idempotencyKey = default, Option applePaySessionRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task GetApplePaySessionAsync(ApplePaySessionRequest applePaySessionRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Create originKey values for domains /// - /// - /// This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. > If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - [Obsolete] - Task OriginKeysAsync(Option idempotencyKey = default, Option utilityRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + [Obsolete("Deprecated since Adyen Checkout API v67.")] + Model.Checkout.UtilityResponse OriginKeys(UtilityRequest utilityRequest = default, RequestOptions requestOptions = default); + /// /// Create originKey values for domains /// - /// - /// This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. > If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - [Obsolete] - Task OriginKeysOrDefaultAsync(Option idempotencyKey = default, Option utilityRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + [Obsolete("Deprecated since Adyen Checkout API v67.")] + Task OriginKeysAsync(UtilityRequest utilityRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + /// /// Updates the order for PayPal Express Checkout /// - /// - /// Updates the order for PayPal Express Checkout. This can be used to update the PayPal lightbox with an updated amount and delivery methods based on the delivery address. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task UpdatesOrderForPaypalExpressCheckoutAsync(Option idempotencyKey = default, Option paypalUpdateOrderRequest = default, System.Threading.CancellationToken cancellationToken = default); - + /// - + /// - Additional request options. + /// . + Model.Checkout.PaypalUpdateOrderResponse UpdatesOrderForPaypalExpressCheckout(PaypalUpdateOrderRequest paypalUpdateOrderRequest = default, RequestOptions requestOptions = default); + /// /// Updates the order for PayPal Express Checkout /// - /// - /// Updates the order for PayPal Express Checkout. This can be used to update the PayPal lightbox with an updated amount and delivery methods based on the delivery address. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - Task UpdatesOrderForPaypalExpressCheckoutOrDefaultAsync(Option idempotencyKey = default, Option paypalUpdateOrderRequest = default, System.Threading.CancellationToken cancellationToken = default); - } - - /// - /// The - /// - public interface IGetApplePaySessionApiResponse : Adyen.Client.IApiResponse, IOk - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - } - - /// - /// The - /// - public interface IOriginKeysApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// The - /// - public interface IUpdatesOrderForPaypalExpressCheckoutApiResponse : Adyen.Client.IApiResponse, IOk, IBadRequest, IUnauthorized, IForbidden, IUnprocessableContent, IInternalServerError - { - /// - /// Returns true if the response is 200 Ok - /// - /// - bool IsOk { get; } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - bool IsBadRequest { get; } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - bool IsUnauthorized { get; } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - bool IsForbidden { get; } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - bool IsUnprocessableContent { get; } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - bool IsInternalServerError { get; } - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class UtilityServiceEvents - { - /// - /// The event raised after the server response - /// - public event EventHandler OnGetApplePaySession; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorGetApplePaySession; - - internal void ExecuteOnGetApplePaySession(UtilityService.GetApplePaySessionApiResponse apiResponse) - { - OnGetApplePaySession?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorGetApplePaySession(Exception exception) - { - OnErrorGetApplePaySession?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnOriginKeys; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorOriginKeys; - - internal void ExecuteOnOriginKeys(UtilityService.OriginKeysApiResponse apiResponse) - { - OnOriginKeys?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorOriginKeys(Exception exception) - { - OnErrorOriginKeys?.Invoke(this, new ExceptionEventArgs(exception)); - } - - /// - /// The event raised after the server response - /// - public event EventHandler OnUpdatesOrderForPaypalExpressCheckout; - - /// - /// The event raised after an error querying the server - /// - public event EventHandler OnErrorUpdatesOrderForPaypalExpressCheckout; - - internal void ExecuteOnUpdatesOrderForPaypalExpressCheckout(UtilityService.UpdatesOrderForPaypalExpressCheckoutApiResponse apiResponse) - { - OnUpdatesOrderForPaypalExpressCheckout?.Invoke(this, new ApiResponseEventArgs(apiResponse)); - } - - internal void ExecuteOnErrorUpdatesOrderForPaypalExpressCheckout(Exception exception) - { - OnErrorUpdatesOrderForPaypalExpressCheckout?.Invoke(this, new ExceptionEventArgs(exception)); - } + /// - + /// - Additional request options. + /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects. + /// Task of . + Task UpdatesOrderForPaypalExpressCheckoutAsync(PaypalUpdateOrderRequest paypalUpdateOrderRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default); + } - + /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the UtilityService API endpoints /// - public sealed partial class UtilityService : IUtilityService + public class UtilityService : AbstractService, IUtilityService { - private JsonSerializerOptions _jsonSerializerOptions; - - /// - /// The logger factory - /// - public ILoggerFactory LoggerFactory { get; } - - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The HttpClient - /// - public System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The class containing the events - /// - public UtilityServiceEvents Events { get; } - - /// - /// A token provider of type - /// - public TokenProvider ApiKeyProvider { get; } - - /// - /// A token provider of type - /// - public TokenProvider BasicTokenProvider { get; } - - /// - /// Initializes a new instance of the class. - /// - /// - public UtilityService(ILogger logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, UtilityServiceEvents utilityServiceEvents, - TokenProvider apiKeyProvider, - TokenProvider basicTokenProvider) + private readonly string _baseUrl; + + public UtilityService(AdyenClient client) : base(client) { - _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; - LoggerFactory = loggerFactory; - Logger = LoggerFactory.CreateLogger(); - HttpClient = httpClient; - Events = utilityServiceEvents; - ApiKeyProvider = apiKeyProvider; - BasicTokenProvider = basicTokenProvider; + _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } - - partial void FormatGetApplePaySession(ref string idempotencyKey, ApplePaySessionRequest applePaySessionRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateGetApplePaySession(string idempotencyKey, ApplePaySessionRequest applePaySessionRequest) + + public Model.Checkout.ApplePaySessionResponse GetApplePaySession(ApplePaySessionRequest applePaySessionRequest = default, RequestOptions requestOptions = default) { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (applePaySessionRequest.IsSet && applePaySessionRequest.Value == null) - throw new ArgumentNullException(nameof(applePaySessionRequest)); + return GetApplePaySessionAsync(applePaySessionRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterGetApplePaySessionDefaultImplementation(IGetApplePaySessionApiResponse apiResponseLocalVar, string idempotencyKey, ApplePaySessionRequest applePaySessionRequest) + public async Task GetApplePaySessionAsync(ApplePaySessionRequest applePaySessionRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - bool suppressDefaultLog = false; - AfterGetApplePaySession(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, applePaySessionRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + var endpoint = _baseUrl + "/applePay/sessions"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(applePaySessionRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterGetApplePaySession(ref bool suppressDefaultLog, IGetApplePaySessionApiResponse apiResponseLocalVar, string idempotencyKey, ApplePaySessionRequest applePaySessionRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorGetApplePaySessionDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, ApplePaySessionRequest applePaySessionRequest) + + [Obsolete("Deprecated since Adyen Checkout API v67.")] + public Model.Checkout.UtilityResponse OriginKeys(UtilityRequest utilityRequest = default, RequestOptions requestOptions = default) { - bool suppressDefaultLogLocalVar = false; - OnErrorGetApplePaySession(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, applePaySessionRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); + return OriginKeysAsync(utilityRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorGetApplePaySession(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, ApplePaySessionRequest applePaySessionRequest); - - /// - /// Get an Apple Pay session You need to use this endpoint if you have an API-only integration with Apple Pay which uses Adyen's Apple Pay certificate. The endpoint returns the Apple Pay session data which you need to complete the [Apple Pay session validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task GetApplePaySessionOrDefaultAsync(Option idempotencyKey = default, Option applePaySessionRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await GetApplePaySessionAsync(idempotencyKey, applePaySessionRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Get an Apple Pay session You need to use this endpoint if you have an API-only integration with Apple Pay which uses Adyen's Apple Pay certificate. The endpoint returns the Apple Pay session data which you need to complete the [Apple Pay session validation](https://docs.adyen.com/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1#complete-apple-pay-session-validation). - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task GetApplePaySessionAsync(Option idempotencyKey = default, Option applePaySessionRequest = default, System.Threading.CancellationToken cancellationToken = default) + [Obsolete("Deprecated since Adyen Checkout API v67.")] + public async Task OriginKeysAsync(UtilityRequest utilityRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateGetApplePaySession(idempotencyKey, applePaySessionRequest); - - FormatGetApplePaySession(ref idempotencyKey, applePaySessionRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/applePay/sessions"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (applePaySessionRequest.IsSet) - httpRequestMessageLocalVar.Content = (applePaySessionRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(applePaySessionRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - GetApplePaySessionApiResponse apiResponseLocalVar = new GetApplePaySessionApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/applePay/sessions", requestedAtLocalVar, _jsonSerializerOptions); - - AfterGetApplePaySessionDefaultImplementation(apiResponseLocalVar, idempotencyKey, applePaySessionRequest); - - Events.ExecuteOnGetApplePaySession(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorGetApplePaySessionDefaultImplementation(e, "/applePay/sessions", uriBuilderLocalVar.Path, idempotencyKey, applePaySessionRequest); - Events.ExecuteOnErrorGetApplePaySession(e); - throw; - } + var endpoint = _baseUrl + "/originKeys"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(utilityRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } - - /// - /// The - /// - public partial class GetApplePaySessionApiResponse : Adyen.Client.ApiResponse, IGetApplePaySessionApiResponse + + public Model.Checkout.PaypalUpdateOrderResponse UpdatesOrderForPaypalExpressCheckout(PaypalUpdateOrderRequest paypalUpdateOrderRequest = default, RequestOptions requestOptions = default) { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public GetApplePaySessionApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.ApplePaySessionResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.ApplePaySessionResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + return UpdatesOrderForPaypalExpressCheckoutAsync(paypalUpdateOrderRequest, requestOptions).ConfigureAwait(false).GetAwaiter().GetResult(); } - partial void FormatOriginKeys(ref string idempotencyKey, UtilityRequest utilityRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateOriginKeys(string idempotencyKey, UtilityRequest utilityRequest) + public async Task UpdatesOrderForPaypalExpressCheckoutAsync(PaypalUpdateOrderRequest paypalUpdateOrderRequest = default, RequestOptions requestOptions = default, CancellationToken cancellationToken = default) { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (utilityRequest.IsSet && utilityRequest.Value == null) - throw new ArgumentNullException(nameof(utilityRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterOriginKeysDefaultImplementation(IOriginKeysApiResponse apiResponseLocalVar, string idempotencyKey, UtilityRequest utilityRequest) - { - bool suppressDefaultLog = false; - AfterOriginKeys(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, utilityRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterOriginKeys(ref bool suppressDefaultLog, IOriginKeysApiResponse apiResponseLocalVar, string idempotencyKey, UtilityRequest utilityRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorOriginKeysDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, UtilityRequest utilityRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorOriginKeys(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, utilityRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorOriginKeys(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, UtilityRequest utilityRequest); - - /// - /// Create originKey values for domains This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. > If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task OriginKeysOrDefaultAsync(Option idempotencyKey = default, Option utilityRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await OriginKeysAsync(idempotencyKey, utilityRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Create originKey values for domains This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. > If you're still using origin key for your Web Drop-in or Components integration, we recommend [switching to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key). This allows you to use a single key for all origins, add or remove origins without generating a new key, and detect the card type from the number entered in your payment form. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task OriginKeysAsync(Option idempotencyKey = default, Option utilityRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateOriginKeys(idempotencyKey, utilityRequest); - - FormatOriginKeys(ref idempotencyKey, utilityRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/originKeys"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (utilityRequest.IsSet) - httpRequestMessageLocalVar.Content = (utilityRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(utilityRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - OriginKeysApiResponse apiResponseLocalVar = new OriginKeysApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/originKeys", requestedAtLocalVar, _jsonSerializerOptions); - - AfterOriginKeysDefaultImplementation(apiResponseLocalVar, idempotencyKey, utilityRequest); - - Events.ExecuteOnOriginKeys(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorOriginKeysDefaultImplementation(e, "/originKeys", uriBuilderLocalVar.Path, idempotencyKey, utilityRequest); - Events.ExecuteOnErrorOriginKeys(e); - throw; - } - } - - /// - /// The - /// - public partial class OriginKeysApiResponse : Adyen.Client.ApiResponse, IOriginKeysApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public OriginKeysApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.UtilityResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.UtilityResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); - } - - partial void FormatUpdatesOrderForPaypalExpressCheckout(ref string idempotencyKey, PaypalUpdateOrderRequest paypalUpdateOrderRequest); - - /// - /// Validates the request parameters - /// - /// - /// - /// - private void ValidateUpdatesOrderForPaypalExpressCheckout(string idempotencyKey, PaypalUpdateOrderRequest paypalUpdateOrderRequest) - { - if (idempotencyKey.IsSet && idempotencyKey.Value == null) - throw new ArgumentNullException(nameof(idempotencyKey)); - - if (paypalUpdateOrderRequest.IsSet && paypalUpdateOrderRequest.Value == null) - throw new ArgumentNullException(nameof(paypalUpdateOrderRequest)); - } - - /// - /// Processes the server response - /// - /// - /// - /// - private void AfterUpdatesOrderForPaypalExpressCheckoutDefaultImplementation(IUpdatesOrderForPaypalExpressCheckoutApiResponse apiResponseLocalVar, string idempotencyKey, PaypalUpdateOrderRequest paypalUpdateOrderRequest) - { - bool suppressDefaultLog = false; - AfterUpdatesOrderForPaypalExpressCheckout(ref suppressDefaultLog, apiResponseLocalVar, idempotencyKey, paypalUpdateOrderRequest); - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); - } - - /// - /// Processes the server response - /// - /// - /// - /// - /// - partial void AfterUpdatesOrderForPaypalExpressCheckout(ref bool suppressDefaultLog, IUpdatesOrderForPaypalExpressCheckoutApiResponse apiResponseLocalVar, string idempotencyKey, PaypalUpdateOrderRequest paypalUpdateOrderRequest); - - /// - /// Logs exceptions that occur while retrieving the server response - /// - /// - /// - /// - /// - /// - private void OnErrorUpdatesOrderForPaypalExpressCheckoutDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaypalUpdateOrderRequest paypalUpdateOrderRequest) - { - bool suppressDefaultLogLocalVar = false; - OnErrorUpdatesOrderForPaypalExpressCheckout(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, idempotencyKey, paypalUpdateOrderRequest); - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); - } - - /// - /// A partial method that gives developers a way to provide customized exception handling - /// - /// - /// - /// - /// - /// - /// - partial void OnErrorUpdatesOrderForPaypalExpressCheckout(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string idempotencyKey, PaypalUpdateOrderRequest paypalUpdateOrderRequest); - - /// - /// Updates the order for PayPal Express Checkout Updates the order for PayPal Express Checkout. This can be used to update the PayPal lightbox with an updated amount and delivery methods based on the delivery address. - /// - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task UpdatesOrderForPaypalExpressCheckoutOrDefaultAsync(Option idempotencyKey = default, Option paypalUpdateOrderRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - try - { - return await UpdatesOrderForPaypalExpressCheckoutAsync(idempotencyKey, paypalUpdateOrderRequest, cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - - /// - /// Updates the order for PayPal Express Checkout Updates the order for PayPal Express Checkout. This can be used to update the PayPal lightbox with an updated amount and delivery methods based on the delivery address. - /// - /// Thrown when fails to make API call - /// A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). (optional) - /// (optional) - /// Cancellation Token to cancel the request. - /// <> - public async Task UpdatesOrderForPaypalExpressCheckoutAsync(Option idempotencyKey = default, Option paypalUpdateOrderRequest = default, System.Threading.CancellationToken cancellationToken = default) - { - UriBuilder uriBuilderLocalVar = new UriBuilder(); - - try - { - ValidateUpdatesOrderForPaypalExpressCheckout(idempotencyKey, paypalUpdateOrderRequest); - - FormatUpdatesOrderForPaypalExpressCheckout(ref idempotencyKey, paypalUpdateOrderRequest); - - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) - { - uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/paypal/updateOrder"; - - if (idempotencyKey.IsSet) - httpRequestMessageLocalVar.Headers.Add("Idempotency-Key", ClientUtils.ParameterToString(idempotencyKey.Value)); - - if (paypalUpdateOrderRequest.IsSet) - httpRequestMessageLocalVar.Content = (paypalUpdateOrderRequest.Value as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(paypalUpdateOrderRequest.Value, _jsonSerializerOptions)); - - List tokenBaseLocalVars = new List(); - ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("X-API-Key", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); - apiKeyTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar); - - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - - BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar1); - - basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); - - string[] contentTypes = new string[] { - "application/json" - }; - - string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - - string[] acceptLocalVars = new string[] { - "application/json" - }; - - string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - - DateTime requestedAtLocalVar = DateTime.UtcNow; - - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) - { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - - ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); - - UpdatesOrderForPaypalExpressCheckoutApiResponse apiResponseLocalVar = new UpdatesOrderForPaypalExpressCheckoutApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/paypal/updateOrder", requestedAtLocalVar, _jsonSerializerOptions); - - AfterUpdatesOrderForPaypalExpressCheckoutDefaultImplementation(apiResponseLocalVar, idempotencyKey, paypalUpdateOrderRequest); - - Events.ExecuteOnUpdatesOrderForPaypalExpressCheckout(apiResponseLocalVar); - - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); - - return apiResponseLocalVar; - } - } - } - catch(Exception e) - { - OnErrorUpdatesOrderForPaypalExpressCheckoutDefaultImplementation(e, "/paypal/updateOrder", uriBuilderLocalVar.Path, idempotencyKey, paypalUpdateOrderRequest); - Events.ExecuteOnErrorUpdatesOrderForPaypalExpressCheckout(e); - throw; - } - } - - /// - /// The - /// - public partial class UpdatesOrderForPaypalExpressCheckoutApiResponse : Adyen.Client.ApiResponse, IUpdatesOrderForPaypalExpressCheckoutApiResponse - { - /// - /// The logger - /// - public ILogger Logger { get; } - - /// - /// The - /// - /// - /// - /// - /// - /// - /// - /// - public UpdatesOrderForPaypalExpressCheckoutApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) - { - Logger = logger; - OnCreated(httpRequestMessage, httpResponseMessage); - } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Returns true if the response is 200 Ok - /// - /// - public bool IsOk => 200 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 200 Ok - /// - /// - public Adyen.Model.Checkout.PaypalUpdateOrderResponse Ok() - { - // This logic may be modified with the AsModel.mustache template - return IsOk - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 200 Ok and the deserialized response is not null - /// - /// - /// - public bool TryOk(out Adyen.Model.Checkout.PaypalUpdateOrderResponse result) - { - result = null; - - try - { - result = Ok(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); - } - - return result != null; - } - - /// - /// Returns true if the response is 400 BadRequest - /// - /// - public bool IsBadRequest => 400 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 400 BadRequest - /// - /// - public Adyen.Model.Checkout.ServiceError BadRequest() - { - // This logic may be modified with the AsModel.mustache template - return IsBadRequest - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 400 BadRequest and the deserialized response is not null - /// - /// - /// - public bool TryBadRequest(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = BadRequest(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)400); - } - - return result != null; - } - - /// - /// Returns true if the response is 401 Unauthorized - /// - /// - public bool IsUnauthorized => 401 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 401 Unauthorized - /// - /// - public Adyen.Model.Checkout.ServiceError Unauthorized() - { - // This logic may be modified with the AsModel.mustache template - return IsUnauthorized - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 401 Unauthorized and the deserialized response is not null - /// - /// - /// - public bool TryUnauthorized(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Unauthorized(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)401); - } - - return result != null; - } - - /// - /// Returns true if the response is 403 Forbidden - /// - /// - public bool IsForbidden => 403 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 403 Forbidden - /// - /// - public Adyen.Model.Checkout.ServiceError Forbidden() - { - // This logic may be modified with the AsModel.mustache template - return IsForbidden - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 403 Forbidden and the deserialized response is not null - /// - /// - /// - public bool TryForbidden(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = Forbidden(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)403); - } - - return result != null; - } - - /// - /// Returns true if the response is 422 UnprocessableContent - /// - /// - public bool IsUnprocessableContent => 422 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 422 UnprocessableContent - /// - /// - public Adyen.Model.Checkout.ServiceError UnprocessableContent() - { - // This logic may be modified with the AsModel.mustache template - return IsUnprocessableContent - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 422 UnprocessableContent and the deserialized response is not null - /// - /// - /// - public bool TryUnprocessableContent(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = UnprocessableContent(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)422); - } - - return result != null; - } - - /// - /// Returns true if the response is 500 InternalServerError - /// - /// - public bool IsInternalServerError => 500 == (int)StatusCode; - - /// - /// Deserializes the response if the response is 500 InternalServerError - /// - /// - public Adyen.Model.Checkout.ServiceError InternalServerError() - { - // This logic may be modified with the AsModel.mustache template - return IsInternalServerError - ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) - : default; - } - - /// - /// Returns true if the response is 500 InternalServerError and the deserialized response is not null - /// - /// - /// - public bool TryInternalServerError(out Adyen.Model.Checkout.ServiceError result) - { - result = null; - - try - { - result = InternalServerError(); - } catch (Exception e) - { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)500); - } - - return result != null; - } - - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) - { - bool suppressDefaultLog = false; - OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); - } - - partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + var endpoint = _baseUrl + "/paypal/updateOrder"; + var resource = new ServiceResource(this, endpoint); + return await resource.RequestAsync(paypalUpdateOrderRequest.ToJson(), requestOptions, new HttpMethod("POST"), cancellationToken).ConfigureAwait(false); } } -} +} \ No newline at end of file From 5899fa8cdd30421a46294e455769c09e7e357282 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 26 Sep 2025 15:01:55 +0200 Subject: [PATCH 021/126] Move everything to /src --- Adyen/Adyen.csproj | 3 +- .../Converter/JsonBase64Converter.cs | 0 .../JsonConvertDeserializerWrapper.cs | 0 .../Converter/JsonConvertSerializerWrapper.cs | 0 .../Converter/SaleToPoiMessageConverter.cs | 0 .../SaleToPoiMessageSecuredConverter.cs | 0 .../ApiSerialization/IMessagePayload.cs | 0 .../IMessagePayloadSerializer.cs | 0 .../MessageHeaderSerializer.cs | 0 .../MessagePayloadSerializer.cs | 0 .../MessagePayloadSerializerFactory.cs | 0 .../ApiSerialization/OpenAPIDateConverter.cs | 0 .../SaleToPoiMessageSecuredSerializer.cs | 0 .../SaleToPoiMessageSerializer.cs | 0 .../{ => src}/ApiSerialization/TypeHelper.cs | 0 Adyen/{ => src}/Constants/ApiConstants.cs | 0 Adyen/{ => src}/Constants/ClientConfig.cs | 0 Adyen/{ => src}/Constants/Region.cs | 0 .../Exceptions/DeserializationException.cs | 0 .../{ => src}/Exceptions/ExceptionMessages.cs | 0 .../HttpClient/HttpClientException.cs | 0 .../HttpClient/HttpClientExtension.cs | 0 .../{ => src}/HttpClient/HttpClientWrapper.cs | 0 .../HttpClient/Interfaces/IClient.cs | 0 .../AcsWebhooks/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/AcsWebhooks/Amount.cs | 0 .../AcsWebhooks/AuthenticationDecision.cs | 0 .../Model/AcsWebhooks/AuthenticationInfo.cs | 0 .../AuthenticationNotificationData.cs | 0 .../AuthenticationNotificationRequest.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../Model/AcsWebhooks/ChallengeInfo.cs | 0 Adyen/{ => src}/Model/AcsWebhooks/Purchase.cs | 0 .../Model/AcsWebhooks/PurchaseInfo.cs | 0 .../RelayedAuthenticationRequest.cs | 0 .../RelayedAuthenticationResponse.cs | 0 Adyen/{ => src}/Model/AcsWebhooks/Resource.cs | 0 .../Model/AcsWebhooks/ServiceError.cs | 0 Adyen/{ => src}/Model/ApiError.cs | 282 +++++++++--------- .../ApplicationInformation/ApplicationInfo.cs | 0 .../ApplicationInformation/CommonField.cs | 0 .../ExternalPlatform.cs | 0 .../ApplicationInformation/MerchantDevice.cs | 0 .../ShopperInteractionDevice.cs | 0 .../BalanceControl/AbstractOpenAPISchema.cs | 0 .../{ => src}/Model/BalanceControl/Amount.cs | 0 .../BalanceControl/BalanceTransferRequest.cs | 0 .../BalanceControl/BalanceTransferResponse.cs | 0 .../AULocalAccountIdentification.cs | 0 .../BalancePlatform/AbstractOpenAPISchema.cs | 0 .../Model/BalancePlatform/AccountHolder.cs | 0 .../AccountHolderCapability.cs | 0 .../BalancePlatform/AccountHolderInfo.cs | 0 .../AccountHolderUpdateRequest.cs | 0 .../AccountSupportingEntityCapability.cs | 0 .../ActiveNetworkTokensRestriction.cs | 0 .../AdditionalBankIdentification.cs | 0 .../Model/BalancePlatform/Address.cs | 0 .../BalancePlatform/AddressRequirement.cs | 0 .../{ => src}/Model/BalancePlatform/Amount.cs | 0 .../AmountMinMaxRequirement.cs | 0 .../AmountNonZeroDecimalsRequirement.cs | 0 .../AssociationDelegatedAuthenticationData.cs | 0 .../AssociationFinaliseRequest.cs | 0 .../AssociationFinaliseResponse.cs | 0 .../AssociationInitiateRequest.cs | 0 .../AssociationInitiateResponse.cs | 0 .../Model/BalancePlatform/Authentication.cs | 0 .../BRLocalAccountIdentification.cs | 0 .../Model/BalancePlatform/Balance.cs | 0 .../Model/BalancePlatform/BalanceAccount.cs | 0 .../BalancePlatform/BalanceAccountBase.cs | 0 .../BalancePlatform/BalanceAccountInfo.cs | 0 .../BalanceAccountUpdateRequest.cs | 0 .../Model/BalancePlatform/BalancePlatform.cs | 0 .../BalanceSweepConfigurationsResponse.cs | 0 .../Model/BalancePlatform/BankAccount.cs | 0 .../BankAccountAccountIdentification.cs | 0 .../BalancePlatform/BankAccountDetails.cs | 0 ...ankAccountIdentificationTypeRequirement.cs | 0 ...kAccountIdentificationValidationRequest.cs | 0 ...nValidationRequestAccountIdentification.cs | 0 .../Model/BalancePlatform/BankAccountModel.cs | 0 .../BalancePlatform/BankIdentification.cs | 0 .../BrandVariantsRestriction.cs | 0 .../Model/BalancePlatform/BulkAddress.cs | 0 .../CALocalAccountIdentification.cs | 0 .../CZLocalAccountIdentification.cs | 0 .../BalancePlatform/CapabilityProblem.cs | 0 .../CapabilityProblemEntity.cs | 0 .../CapabilityProblemEntityRecursive.cs | 0 .../BalancePlatform/CapabilitySettings.cs | 0 .../Model/BalancePlatform/CapitalBalance.cs | 0 .../BalancePlatform/CapitalGrantAccount.cs | 0 Adyen/{ => src}/Model/BalancePlatform/Card.cs | 0 .../BalancePlatform/CardConfiguration.cs | 0 .../Model/BalancePlatform/CardInfo.cs | 0 .../Model/BalancePlatform/CardOrder.cs | 0 .../Model/BalancePlatform/CardOrderItem.cs | 0 .../CardOrderItemDeliveryStatus.cs | 0 .../Model/BalancePlatform/ContactDetails.cs | 0 .../Model/BalancePlatform/Counterparty.cs | 0 .../CounterpartyBankRestriction.cs | 0 .../CounterpartyTypesRestriction.cs | 0 .../BalancePlatform/CountriesRestriction.cs | 0 .../CreateSweepConfigurationV2.cs | 0 .../DKLocalAccountIdentification.cs | 0 .../BalancePlatform/DayOfWeekRestriction.cs | 0 .../DelegatedAuthenticationData.cs | 0 .../Model/BalancePlatform/DeliveryAddress.cs | 0 .../Model/BalancePlatform/DeliveryContact.cs | 0 .../{ => src}/Model/BalancePlatform/Device.cs | 0 .../Model/BalancePlatform/DeviceInfo.cs | 0 .../DifferentCurrenciesRestriction.cs | 0 .../Model/BalancePlatform/Duration.cs | 0 .../BalancePlatform/EntryModesRestriction.cs | 0 .../{ => src}/Model/BalancePlatform/Expiry.cs | 0 Adyen/{ => src}/Model/BalancePlatform/Fee.cs | 0 .../GetNetworkTokenResponse.cs | 0 .../BalancePlatform/GetTaxFormResponse.cs | 0 .../Model/BalancePlatform/GrantLimit.cs | 0 .../Model/BalancePlatform/GrantOffer.cs | 0 .../Model/BalancePlatform/GrantOffers.cs | 0 .../HKLocalAccountIdentification.cs | 0 .../HULocalAccountIdentification.cs | 0 Adyen/{ => src}/Model/BalancePlatform/Href.cs | 0 .../IbanAccountIdentification.cs | 0 .../IbanAccountIdentificationRequirement.cs | 0 .../InternationalTransactionRestriction.cs | 0 .../Model/BalancePlatform/InvalidField.cs | 0 Adyen/{ => src}/Model/BalancePlatform/Link.cs | 0 .../ListNetworkTokensResponse.cs | 0 .../MatchingTransactionsRestriction.cs | 0 .../MatchingValuesRestriction.cs | 0 .../Model/BalancePlatform/MccsRestriction.cs | 0 .../BalancePlatform/MerchantAcquirerPair.cs | 0 .../MerchantNamesRestriction.cs | 0 .../BalancePlatform/MerchantsRestriction.cs | 0 .../NOLocalAccountIdentification.cs | 0 .../NZLocalAccountIdentification.cs | 0 Adyen/{ => src}/Model/BalancePlatform/Name.cs | 0 .../Model/BalancePlatform/NetworkToken.cs | 0 .../NumberAndBicAccountIdentification.cs | 0 .../PLLocalAccountIdentification.cs | 0 .../PaginatedAccountHoldersResponse.cs | 0 .../PaginatedBalanceAccountsResponse.cs | 0 .../PaginatedGetCardOrderItemResponse.cs | 0 .../PaginatedGetCardOrderResponse.cs | 0 .../PaginatedPaymentInstrumentsResponse.cs | 0 .../BalancePlatform/PaymentInstrument.cs | 0 ...ditionalBankAccountIdentificationsInner.cs | 0 .../BalancePlatform/PaymentInstrumentGroup.cs | 0 .../PaymentInstrumentGroupInfo.cs | 0 .../BalancePlatform/PaymentInstrumentInfo.cs | 0 .../PaymentInstrumentRequirement.cs | 0 .../PaymentInstrumentRevealInfo.cs | 0 .../PaymentInstrumentRevealRequest.cs | 0 .../PaymentInstrumentRevealResponse.cs | 0 .../PaymentInstrumentUpdateRequest.cs | 0 .../{ => src}/Model/BalancePlatform/Phone.cs | 0 .../Model/BalancePlatform/PhoneNumber.cs | 0 .../Model/BalancePlatform/PinChangeRequest.cs | 0 .../BalancePlatform/PinChangeResponse.cs | 0 .../PlatformPaymentConfiguration.cs | 0 .../ProcessingTypesRestriction.cs | 0 .../BalancePlatform/PublicKeyResponse.cs | 0 .../RegisterSCAFinalResponse.cs | 0 .../BalancePlatform/RegisterSCARequest.cs | 0 .../BalancePlatform/RegisterSCAResponse.cs | 0 .../BalancePlatform/RemediatingAction.cs | 0 .../Model/BalancePlatform/Repayment.cs | 0 .../Model/BalancePlatform/RepaymentTerm.cs | 0 .../Model/BalancePlatform/RestServiceError.cs | 0 .../Model/BalancePlatform/RevealPinRequest.cs | 0 .../BalancePlatform/RevealPinResponse.cs | 0 .../Model/BalancePlatform/RiskScores.cs | 0 .../BalancePlatform/RiskScoresRestriction.cs | 0 .../SELocalAccountIdentification.cs | 0 .../SGLocalAccountIdentification.cs | 0 .../BalancePlatform/SameAmountRestriction.cs | 0 .../SameCounterpartyRestriction.cs | 0 .../SearchRegisteredDevicesResponse.cs | 0 .../SourceAccountTypesRestriction.cs | 0 .../Model/BalancePlatform/StringMatch.cs | 0 .../BalancePlatform/SweepConfigurationV2.cs | 0 .../BalancePlatform/SweepCounterparty.cs | 0 .../Model/BalancePlatform/SweepSchedule.cs | 0 .../BalancePlatform/ThresholdRepayment.cs | 0 .../Model/BalancePlatform/TimeOfDay.cs | 0 .../BalancePlatform/TimeOfDayRestriction.cs | 0 .../TokenRequestorsRestriction.cs | 0 .../BalancePlatform/TotalAmountRestriction.cs | 0 .../Model/BalancePlatform/TransactionRule.cs | 0 .../TransactionRuleEntityKey.cs | 0 .../BalancePlatform/TransactionRuleInfo.cs | 0 .../TransactionRuleInterval.cs | 0 .../TransactionRuleResponse.cs | 0 .../TransactionRuleRestrictions.cs | 0 .../TransactionRulesResponse.cs | 0 .../Model/BalancePlatform/TransferRoute.cs | 0 .../BalancePlatform/TransferRouteRequest.cs | 0 .../TransferRouteRequirementsInner.cs | 0 .../BalancePlatform/TransferRouteResponse.cs | 0 .../UKLocalAccountIdentification.cs | 0 .../USInternationalAchAddressRequirement.cs | 0 .../USLocalAccountIdentification.cs | 0 .../UpdateNetworkTokenRequest.cs | 0 .../UpdatePaymentInstrument.cs | 0 .../UpdateSweepConfigurationV2.cs | 0 .../BalancePlatform/VerificationDeadline.cs | 0 .../BalancePlatform/VerificationError.cs | 0 .../VerificationErrorRecursive.cs | 0 .../Model/BinLookup/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/BinLookup/Amount.cs | 0 Adyen/{ => src}/Model/BinLookup/BinDetail.cs | 0 Adyen/{ => src}/Model/BinLookup/CardBin.cs | 0 .../BinLookup/CostEstimateAssumptions.cs | 0 .../Model/BinLookup/CostEstimateRequest.cs | 0 .../Model/BinLookup/CostEstimateResponse.cs | 0 .../Model/BinLookup/DSPublicKeyDetail.cs | 0 .../Model/BinLookup/MerchantDetails.cs | 0 Adyen/{ => src}/Model/BinLookup/Recurring.cs | 0 .../{ => src}/Model/BinLookup/ServiceError.cs | 0 .../BinLookup/ThreeDS2CardRangeDetail.cs | 0 .../BinLookup/ThreeDSAvailabilityRequest.cs | 0 .../BinLookup/ThreeDSAvailabilityResponse.cs | 0 .../Model/Checkout/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/Checkout/AccountInfo.cs | 0 Adyen/{ => src}/Model/Checkout/AcctInfo.cs | 0 Adyen/{ => src}/Model/Checkout/AchDetails.cs | 0 .../Model/Checkout/AdditionalData3DSecure.cs | 0 .../Model/Checkout/AdditionalDataAirline.cs | 0 .../Model/Checkout/AdditionalDataCarRental.cs | 0 .../Model/Checkout/AdditionalDataCommon.cs | 0 .../Model/Checkout/AdditionalDataLevel23.cs | 0 .../Model/Checkout/AdditionalDataLodging.cs | 0 .../Checkout/AdditionalDataOpenInvoice.cs | 0 .../Model/Checkout/AdditionalDataOpi.cs | 0 .../Model/Checkout/AdditionalDataRatepay.cs | 0 .../Model/Checkout/AdditionalDataRetry.cs | 0 .../Model/Checkout/AdditionalDataRisk.cs | 0 .../Checkout/AdditionalDataRiskStandalone.cs | 0 .../Checkout/AdditionalDataSubMerchant.cs | 0 .../AdditionalDataTemporaryServices.cs | 0 .../Model/Checkout/AdditionalDataWallets.cs | 0 Adyen/{ => src}/Model/Checkout/Address.cs | 0 .../{ => src}/Model/Checkout/AffirmDetails.cs | 0 .../Model/Checkout/AfterpayDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Agency.cs | 0 Adyen/{ => src}/Model/Checkout/Airline.cs | 0 .../Model/Checkout/AmazonPayDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Amount.cs | 0 Adyen/{ => src}/Model/Checkout/Amounts.cs | 0 Adyen/{ => src}/Model/Checkout/AncvDetails.cs | 0 .../Model/Checkout/AndroidPayDetails.cs | 0 .../Model/Checkout/ApplePayDetails.cs | 0 .../Model/Checkout/ApplePayDonations.cs | 0 .../Model/Checkout/ApplePaySessionRequest.cs | 0 .../Model/Checkout/ApplePaySessionResponse.cs | 0 .../Model/Checkout/ApplicationInfo.cs | 0 .../Model/Checkout/AuthenticationData.cs | 0 .../Model/Checkout/BacsDirectDebitDetails.cs | 0 .../Model/Checkout/BalanceCheckRequest.cs | 0 .../Model/Checkout/BalanceCheckResponse.cs | 0 .../Model/Checkout/BillDeskDetails.cs | 0 .../Model/Checkout/BillingAddress.cs | 0 Adyen/{ => src}/Model/Checkout/BlikDetails.cs | 0 Adyen/{ => src}/Model/Checkout/BrowserInfo.cs | 0 .../Model/Checkout/CancelOrderRequest.cs | 0 .../Model/Checkout/CancelOrderResponse.cs | 0 .../Model/Checkout/CardBrandDetails.cs | 0 Adyen/{ => src}/Model/Checkout/CardDetails.cs | 0 .../Model/Checkout/CardDetailsRequest.cs | 0 .../Model/Checkout/CardDetailsResponse.cs | 0 .../{ => src}/Model/Checkout/CardDonations.cs | 0 .../Model/Checkout/CashAppDetails.cs | 0 .../Model/Checkout/CellulantDetails.cs | 0 .../Model/Checkout/CheckoutAwaitAction.cs | 0 .../Model/Checkout/CheckoutBankAccount.cs | 0 .../Checkout/CheckoutBankTransferAction.cs | 0 .../CheckoutDelegatedAuthenticationAction.cs | 0 .../Checkout/CheckoutNativeRedirectAction.cs | 0 .../Model/Checkout/CheckoutOrderResponse.cs | 0 .../Model/Checkout/CheckoutPaymentMethod.cs | 0 .../Model/Checkout/CheckoutQrCodeAction.cs | 0 .../Model/Checkout/CheckoutRedirectAction.cs | 0 .../Model/Checkout/CheckoutSDKAction.cs | 0 .../CheckoutSessionInstallmentOption.cs | 0 .../CheckoutSessionThreeDS2RequestData.cs | 0 .../Model/Checkout/CheckoutThreeDS2Action.cs | 0 .../Model/Checkout/CheckoutVoucherAction.cs | 0 Adyen/{ => src}/Model/Checkout/CommonField.cs | 0 Adyen/{ => src}/Model/Checkout/Company.cs | 0 .../Checkout/CreateCheckoutSessionRequest.cs | 0 .../Checkout/CreateCheckoutSessionResponse.cs | 0 .../Model/Checkout/CreateOrderRequest.cs | 0 .../Model/Checkout/CreateOrderResponse.cs | 0 .../Model/Checkout/DeliveryAddress.cs | 0 .../Model/Checkout/DeliveryMethod.cs | 0 .../DetailsRequestAuthenticationData.cs | 0 .../Model/Checkout/DeviceRenderOptions.cs | 0 Adyen/{ => src}/Model/Checkout/DokuDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Donation.cs | 0 .../Model/Checkout/DonationCampaign.cs | 0 .../Checkout/DonationCampaignsRequest.cs | 0 .../Checkout/DonationCampaignsResponse.cs | 0 .../Model/Checkout/DonationPaymentMethod.cs | 0 .../Model/Checkout/DonationPaymentRequest.cs | 0 .../Model/Checkout/DonationPaymentResponse.cs | 0 .../Model/Checkout/DragonpayDetails.cs | 0 .../Model/Checkout/EBankingFinlandDetails.cs | 0 .../Model/Checkout/EcontextVoucherDetails.cs | 0 Adyen/{ => src}/Model/Checkout/EftDetails.cs | 0 .../Model/Checkout/EncryptedOrderData.cs | 0 .../Model/Checkout/EnhancedSchemeData.cs | 0 .../Model/Checkout/ExternalPlatform.cs | 0 .../Model/Checkout/FastlaneDetails.cs | 0 Adyen/{ => src}/Model/Checkout/ForexQuote.cs | 0 .../Model/Checkout/FraudCheckResult.cs | 0 Adyen/{ => src}/Model/Checkout/FraudResult.cs | 0 Adyen/{ => src}/Model/Checkout/FundOrigin.cs | 0 .../{ => src}/Model/Checkout/FundRecipient.cs | 0 .../GenericIssuerPaymentMethodDetails.cs | 0 .../Model/Checkout/GooglePayDetails.cs | 0 .../Model/Checkout/GooglePayDonations.cs | 0 .../{ => src}/Model/Checkout/IdealDetails.cs | 0 .../Model/Checkout/IdealDonations.cs | 0 Adyen/{ => src}/Model/Checkout/InputDetail.cs | 0 .../Model/Checkout/InstallmentOption.cs | 0 .../{ => src}/Model/Checkout/Installments.cs | 0 Adyen/{ => src}/Model/Checkout/Item.cs | 0 .../{ => src}/Model/Checkout/KlarnaDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Leg.cs | 0 Adyen/{ => src}/Model/Checkout/LineItem.cs | 0 .../ListStoredPaymentMethodsResponse.cs | 0 Adyen/{ => src}/Model/Checkout/Mandate.cs | 0 .../Model/Checkout/MasterpassDetails.cs | 0 .../{ => src}/Model/Checkout/MbwayDetails.cs | 0 .../Model/Checkout/MerchantDevice.cs | 0 .../Model/Checkout/MerchantRiskIndicator.cs | 0 .../Model/Checkout/MobilePayDetails.cs | 0 .../{ => src}/Model/Checkout/MolPayDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Name.cs | 0 .../Model/Checkout/OpenInvoiceDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Passenger.cs | 0 .../PayByBankAISDirectDebitDetails.cs | 0 .../Model/Checkout/PayByBankDetails.cs | 0 .../{ => src}/Model/Checkout/PayPalDetails.cs | 0 .../{ => src}/Model/Checkout/PayPayDetails.cs | 0 .../{ => src}/Model/Checkout/PayToDetails.cs | 0 .../Model/Checkout/PayUUpiDetails.cs | 0 .../Model/Checkout/PayWithGoogleDetails.cs | 0 .../Model/Checkout/PayWithGoogleDonations.cs | 0 Adyen/{ => src}/Model/Checkout/Payment.cs | 0 .../Checkout/PaymentAmountUpdateRequest.cs | 0 .../Checkout/PaymentAmountUpdateResponse.cs | 0 .../Model/Checkout/PaymentCancelRequest.cs | 0 .../Model/Checkout/PaymentCancelResponse.cs | 0 .../Model/Checkout/PaymentCaptureRequest.cs | 0 .../Model/Checkout/PaymentCaptureResponse.cs | 0 .../Checkout/PaymentCompletionDetails.cs | 0 .../Model/Checkout/PaymentDetails.cs | 0 .../Model/Checkout/PaymentDetailsRequest.cs | 0 .../Model/Checkout/PaymentDetailsResponse.cs | 0 .../Model/Checkout/PaymentLinkRequest.cs | 0 .../Model/Checkout/PaymentLinkResponse.cs | 0 .../{ => src}/Model/Checkout/PaymentMethod.cs | 0 .../Model/Checkout/PaymentMethodGroup.cs | 0 .../Model/Checkout/PaymentMethodIssuer.cs | 0 .../Model/Checkout/PaymentMethodToStore.cs | 0 .../Model/Checkout/PaymentMethodUPIApps.cs | 0 .../Model/Checkout/PaymentMethodsRequest.cs | 0 .../Model/Checkout/PaymentMethodsResponse.cs | 0 .../Model/Checkout/PaymentRefundRequest.cs | 0 .../Model/Checkout/PaymentRefundResponse.cs | 0 .../Model/Checkout/PaymentRequest.cs | 0 .../Model/Checkout/PaymentResponse.cs | 0 .../Model/Checkout/PaymentResponseAction.cs | 0 .../Model/Checkout/PaymentReversalRequest.cs | 0 .../Model/Checkout/PaymentReversalResponse.cs | 0 .../Checkout/PaypalUpdateOrderRequest.cs | 0 .../Checkout/PaypalUpdateOrderResponse.cs | 0 Adyen/{ => src}/Model/Checkout/Phone.cs | 0 Adyen/{ => src}/Model/Checkout/PixDetails.cs | 0 .../{ => src}/Model/Checkout/PixRecurring.cs | 0 .../Model/Checkout/PlatformChargebackLogic.cs | 0 Adyen/{ => src}/Model/Checkout/PseDetails.cs | 0 .../Model/Checkout/RakutenPayDetails.cs | 0 .../Model/Checkout/RatepayDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Recurring.cs | 0 .../ResponseAdditionalData3DSecure.cs | 0 .../ResponseAdditionalDataBillingAddress.cs | 0 .../Checkout/ResponseAdditionalDataCard.cs | 0 .../Checkout/ResponseAdditionalDataCommon.cs | 0 .../ResponseAdditionalDataDomesticError.cs | 0 .../ResponseAdditionalDataInstallments.cs | 0 .../ResponseAdditionalDataNetworkTokens.cs | 0 .../Checkout/ResponseAdditionalDataOpi.cs | 0 .../Checkout/ResponseAdditionalDataSepa.cs | 0 .../Model/Checkout/ResponsePaymentMethod.cs | 0 Adyen/{ => src}/Model/Checkout/RiskData.cs | 0 .../Model/Checkout/RivertyDetails.cs | 0 .../Model/Checkout/SDKEphemPubKey.cs | 0 .../Model/Checkout/SamsungPayDetails.cs | 0 .../Model/Checkout/SepaDirectDebitDetails.cs | 0 .../{ => src}/Model/Checkout/ServiceError.cs | 0 .../Model/Checkout/SessionResultResponse.cs | 0 .../Checkout/ShopperInteractionDevice.cs | 0 Adyen/{ => src}/Model/Checkout/Split.cs | 0 Adyen/{ => src}/Model/Checkout/SplitAmount.cs | 0 .../StandalonePaymentCancelRequest.cs | 0 .../StandalonePaymentCancelResponse.cs | 0 .../Model/Checkout/StoredPaymentMethod.cs | 0 .../Checkout/StoredPaymentMethodDetails.cs | 0 .../Checkout/StoredPaymentMethodRequest.cs | 0 .../Checkout/StoredPaymentMethodResource.cs | 0 .../Model/Checkout/SubInputDetail.cs | 0 Adyen/{ => src}/Model/Checkout/SubMerchant.cs | 0 .../Model/Checkout/SubMerchantInfo.cs | 0 Adyen/{ => src}/Model/Checkout/Surcharge.cs | 0 Adyen/{ => src}/Model/Checkout/TaxTotal.cs | 0 .../Model/Checkout/ThreeDS2RequestData.cs | 0 .../Model/Checkout/ThreeDS2RequestFields.cs | 0 .../Model/Checkout/ThreeDS2ResponseData.cs | 0 .../Model/Checkout/ThreeDS2Result.cs | 0 .../Model/Checkout/ThreeDSRequestData.cs | 0 .../ThreeDSRequestorAuthenticationInfo.cs | 0 ...ThreeDSRequestorPriorAuthenticationInfo.cs | 0 .../Model/Checkout/ThreeDSecureData.cs | 0 Adyen/{ => src}/Model/Checkout/Ticket.cs | 0 .../{ => src}/Model/Checkout/TravelAgency.cs | 0 .../{ => src}/Model/Checkout/TwintDetails.cs | 0 .../Checkout/UpdatePaymentLinkRequest.cs | 0 .../Model/Checkout/UpiCollectDetails.cs | 0 .../Model/Checkout/UpiIntentDetails.cs | 0 .../Model/Checkout/UtilityRequest.cs | 0 .../Model/Checkout/UtilityResponse.cs | 0 .../{ => src}/Model/Checkout/VippsDetails.cs | 0 .../Model/Checkout/VisaCheckoutDetails.cs | 0 .../Model/Checkout/WeChatPayDetails.cs | 0 .../Checkout/WeChatPayMiniProgramDetails.cs | 0 Adyen/{ => src}/Model/Checkout/ZipDetails.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../ConfigurationWebhooks/AccountHolder.cs | 0 .../AccountHolderCapability.cs | 0 .../AccountHolderNotificationData.cs | 0 .../AccountHolderNotificationRequest.cs | 0 .../AccountSupportingEntityCapability.cs | 0 .../Model/ConfigurationWebhooks/Address.cs | 0 .../Model/ConfigurationWebhooks/Amount.cs | 0 .../ConfigurationWebhooks/Authentication.cs | 0 .../Model/ConfigurationWebhooks/Balance.cs | 0 .../ConfigurationWebhooks/BalanceAccount.cs | 0 .../BalanceAccountNotificationData.cs | 0 .../BalanceAccountNotificationRequest.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../BankAccountDetails.cs | 0 .../ConfigurationWebhooks/BulkAddress.cs | 0 .../CapabilityProblem.cs | 0 .../CapabilityProblemEntity.cs | 0 .../CapabilityProblemEntityRecursive.cs | 0 .../CapabilitySettings.cs | 0 .../Model/ConfigurationWebhooks/Card.cs | 0 .../CardConfiguration.cs | 0 .../ConfigurationWebhooks/CardOrderItem.cs | 0 .../CardOrderItemDeliveryStatus.cs | 0 .../CardOrderNotificationRequest.cs | 0 .../ConfigurationWebhooks/ContactDetails.cs | 0 .../ConfigurationWebhooks/DeliveryAddress.cs | 0 .../ConfigurationWebhooks/DeliveryContact.cs | 0 .../Model/ConfigurationWebhooks/Device.cs | 0 .../Model/ConfigurationWebhooks/Expiry.cs | 0 .../IbanAccountIdentification.cs | 0 .../Model/ConfigurationWebhooks/Name.cs | 0 .../NetworkTokenNotificationDataV2.cs | 0 .../NetworkTokenNotificationRequest.cs | 0 .../NetworkTokenRequestor.cs | 0 .../PaymentInstrument.cs | 0 ...ditionalBankAccountIdentificationsInner.cs | 0 .../PaymentInstrumentNotificationData.cs | 0 .../PaymentNotificationRequest.cs | 0 .../Model/ConfigurationWebhooks/Phone.cs | 0 .../ConfigurationWebhooks/PhoneNumber.cs | 0 .../PlatformPaymentConfiguration.cs | 0 .../RemediatingAction.cs | 0 .../Model/ConfigurationWebhooks/Resource.cs | 0 .../SweepConfigurationNotificationData.cs | 0 .../SweepConfigurationNotificationRequest.cs | 0 .../SweepConfigurationV2.cs | 0 .../SweepCounterparty.cs | 0 .../ConfigurationWebhooks/SweepSchedule.cs | 0 .../TokenAuthentication.cs | 0 .../ConfigurationWebhooks/ValidationFacts.cs | 0 .../VerificationDeadline.cs | 0 .../VerificationError.cs | 0 .../VerificationErrorRecursive.cs | 0 .../Model/ConfigurationWebhooks/Wallet.cs | 0 .../DataProtection/AbstractOpenAPISchema.cs | 0 .../Model/DataProtection/ServiceError.cs | 0 .../SubjectErasureByPspReferenceRequest.cs | 0 .../DataProtection/SubjectErasureResponse.cs | 0 .../DisputeWebhooks/AbstractOpenAPISchema.cs | 0 .../{ => src}/Model/DisputeWebhooks/Amount.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../DisputeEventNotification.cs | 0 .../DisputeNotificationRequest.cs | 0 .../Model/Disputes/AbstractOpenAPISchema.cs | 0 .../Model/Disputes/AcceptDisputeRequest.cs | 0 .../Model/Disputes/AcceptDisputeResponse.cs | 0 .../Model/Disputes/DefendDisputeRequest.cs | 0 .../Model/Disputes/DefendDisputeResponse.cs | 0 .../Model/Disputes/DefenseDocument.cs | 0 .../Model/Disputes/DefenseDocumentType.cs | 0 .../{ => src}/Model/Disputes/DefenseReason.cs | 0 .../Model/Disputes/DefenseReasonsRequest.cs | 0 .../Model/Disputes/DefenseReasonsResponse.cs | 0 .../Disputes/DeleteDefenseDocumentRequest.cs | 0 .../Disputes/DeleteDefenseDocumentResponse.cs | 0 .../Model/Disputes/DisputeServiceResult.cs | 0 .../{ => src}/Model/Disputes/ServiceError.cs | 0 .../Disputes/SupplyDefenseDocumentRequest.cs | 0 .../Disputes/SupplyDefenseDocumentResponse.cs | 0 Adyen/{ => src}/Model/Environment.cs | 0 .../AULocalAccountIdentification.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../AcceptTermsOfServiceRequest.cs | 0 .../AcceptTermsOfServiceResponse.cs | 0 .../AdditionalBankIdentification.cs | 0 .../Model/LegalEntityManagement/Address.cs | 0 .../Model/LegalEntityManagement/Amount.cs | 0 .../Model/LegalEntityManagement/Attachment.cs | 0 .../LegalEntityManagement/BankAccountInfo.cs | 0 .../BankAccountInfoAccountIdentification.cs | 0 .../Model/LegalEntityManagement/BirthData.cs | 0 .../LegalEntityManagement/BusinessLine.cs | 0 .../LegalEntityManagement/BusinessLineInfo.cs | 0 .../BusinessLineInfoUpdate.cs | 0 .../LegalEntityManagement/BusinessLines.cs | 0 .../CALocalAccountIdentification.cs | 0 .../CZLocalAccountIdentification.cs | 0 .../CalculatePciStatusRequest.cs | 0 .../CalculatePciStatusResponse.cs | 0 .../CalculateTermsOfServiceStatusResponse.cs | 0 .../CapabilityProblem.cs | 0 .../CapabilityProblemEntity.cs | 0 .../CapabilityProblemEntityRecursive.cs | 0 .../CapabilitySettings.cs | 0 ...eckTaxElectronicDeliveryConsentResponse.cs | 0 .../DKLocalAccountIdentification.cs | 0 .../DataReviewConfirmationResponse.cs | 0 .../Model/LegalEntityManagement/Document.cs | 0 .../LegalEntityManagement/DocumentPage.cs | 0 .../DocumentReference.cs | 0 .../LegalEntityManagement/EntityReference.cs | 0 .../LegalEntityManagement/FinancialReport.cs | 0 .../GeneratePciDescriptionRequest.cs | 0 .../GeneratePciDescriptionResponse.cs | 0 ...tAcceptedTermsOfServiceDocumentResponse.cs | 0 .../GetPciQuestionnaireInfosResponse.cs | 0 .../GetPciQuestionnaireResponse.cs | 0 ...etTermsOfServiceAcceptanceInfosResponse.cs | 0 .../GetTermsOfServiceDocumentRequest.cs | 0 .../GetTermsOfServiceDocumentResponse.cs | 0 .../HKLocalAccountIdentification.cs | 0 .../HULocalAccountIdentification.cs | 0 .../IbanAccountIdentification.cs | 0 .../IdentificationData.cs | 0 .../Model/LegalEntityManagement/Individual.cs | 0 .../LegalEntityManagement/LegalEntity.cs | 0 .../LegalEntityAssociation.cs | 0 .../LegalEntityCapability.cs | 0 .../LegalEntityManagement/LegalEntityInfo.cs | 0 .../LegalEntityInfoRequiredType.cs | 0 .../NOLocalAccountIdentification.cs | 0 .../NZLocalAccountIdentification.cs | 0 .../Model/LegalEntityManagement/Name.cs | 0 .../NumberAndBicAccountIdentification.cs | 0 .../LegalEntityManagement/OnboardingLink.cs | 0 .../OnboardingLinkInfo.cs | 0 .../OnboardingLinkSettings.cs | 0 .../LegalEntityManagement/OnboardingTheme.cs | 0 .../LegalEntityManagement/OnboardingThemes.cs | 0 .../LegalEntityManagement/Organization.cs | 0 .../LegalEntityManagement/OwnerEntity.cs | 0 .../PLLocalAccountIdentification.cs | 0 .../LegalEntityManagement/PciDocumentInfo.cs | 0 .../PciSigningRequest.cs | 0 .../PciSigningResponse.cs | 0 .../LegalEntityManagement/PhoneNumber.cs | 0 .../RemediatingAction.cs | 0 .../SELocalAccountIdentification.cs | 0 .../SGLocalAccountIdentification.cs | 0 .../LegalEntityManagement/ServiceError.cs | 0 .../SetTaxElectronicDeliveryConsentRequest.cs | 0 .../SoleProprietorship.cs | 0 .../LegalEntityManagement/SourceOfFunds.cs | 0 .../Model/LegalEntityManagement/StockData.cs | 0 .../SupportingEntityCapability.cs | 0 .../LegalEntityManagement/TaxInformation.cs | 0 .../TaxReportingClassification.cs | 0 .../TermsOfServiceAcceptanceInfo.cs | 0 .../TransferInstrument.cs | 0 .../TransferInstrumentInfo.cs | 0 .../TransferInstrumentReference.cs | 0 .../Model/LegalEntityManagement/Trust.cs | 0 .../UKLocalAccountIdentification.cs | 0 .../USLocalAccountIdentification.cs | 0 .../UndefinedBeneficiary.cs | 0 .../UnincorporatedPartnership.cs | 0 .../VerificationDeadline.cs | 0 .../VerificationError.cs | 0 .../VerificationErrorRecursive.cs | 0 .../VerificationErrors.cs | 0 .../Model/LegalEntityManagement/WebData.cs | 0 .../LegalEntityManagement/WebDataExemption.cs | 0 .../Model/Management/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/Management/AccelInfo.cs | 0 .../Model/Management/AdditionalCommission.cs | 0 .../Model/Management/AdditionalSettings.cs | 0 .../Management/AdditionalSettingsResponse.cs | 0 Adyen/{ => src}/Model/Management/Address.cs | 0 .../{ => src}/Model/Management/AffirmInfo.cs | 0 .../Model/Management/AfterpayTouchInfo.cs | 0 .../Model/Management/AllowedOrigin.cs | 0 .../Management/AllowedOriginsResponse.cs | 0 Adyen/{ => src}/Model/Management/AmexInfo.cs | 0 Adyen/{ => src}/Model/Management/Amount.cs | 0 .../{ => src}/Model/Management/AndroidApp.cs | 0 .../Model/Management/AndroidAppError.cs | 0 .../Model/Management/AndroidAppsResponse.cs | 0 .../Model/Management/AndroidCertificate.cs | 0 .../Management/AndroidCertificatesResponse.cs | 0 .../Model/Management/ApiCredential.cs | 0 .../Model/Management/ApiCredentialLinks.cs | 0 .../Model/Management/ApplePayInfo.cs | 0 Adyen/{ => src}/Model/Management/BcmcInfo.cs | 0 .../Management/BillingEntitiesResponse.cs | 0 .../Model/Management/BillingEntity.cs | 0 .../Model/Management/CardholderReceipt.cs | 0 .../Model/Management/CartesBancairesInfo.cs | 0 .../Model/Management/ClearpayInfo.cs | 0 .../{ => src}/Model/Management/Commission.cs | 0 Adyen/{ => src}/Model/Management/Company.cs | 0 .../Model/Management/CompanyApiCredential.cs | 0 .../Model/Management/CompanyLinks.cs | 0 .../{ => src}/Model/Management/CompanyUser.cs | 0 .../Model/Management/Connectivity.cs | 0 Adyen/{ => src}/Model/Management/Contact.cs | 0 .../Management/CreateAllowedOriginRequest.cs | 0 .../Management/CreateApiCredentialResponse.cs | 0 .../CreateCompanyApiCredentialRequest.cs | 0 .../CreateCompanyApiCredentialResponse.cs | 0 .../Management/CreateCompanyUserRequest.cs | 0 .../Management/CreateCompanyUserResponse.cs | 0 .../Management/CreateCompanyWebhookRequest.cs | 0 .../CreateMerchantApiCredentialRequest.cs | 0 .../Model/Management/CreateMerchantRequest.cs | 0 .../Management/CreateMerchantResponse.cs | 0 .../Management/CreateMerchantUserRequest.cs | 0 .../CreateMerchantWebhookRequest.cs | 0 .../Model/Management/CreateUserResponse.cs | 0 Adyen/{ => src}/Model/Management/Currency.cs | 0 .../Model/Management/CustomNotification.cs | 0 .../{ => src}/Model/Management/DataCenter.cs | 0 .../{ => src}/Model/Management/DinersInfo.cs | 0 Adyen/{ => src}/Model/Management/EventUrl.cs | 0 .../Management/ExternalTerminalAction.cs | 0 Adyen/{ => src}/Model/Management/File.cs | 0 .../Management/GenerateApiKeyResponse.cs | 0 .../Management/GenerateClientKeyResponse.cs | 0 .../Management/GenerateHmacKeyResponse.cs | 0 .../Model/Management/GenericPmWithTdiInfo.cs | 0 .../{ => src}/Model/Management/GiroPayInfo.cs | 0 .../Model/Management/GooglePayInfo.cs | 0 Adyen/{ => src}/Model/Management/Gratuity.cs | 0 Adyen/{ => src}/Model/Management/Hardware.cs | 0 Adyen/{ => src}/Model/Management/IdName.cs | 0 .../Management/InstallAndroidAppDetails.cs | 0 .../InstallAndroidCertificateDetails.cs | 0 .../Model/Management/InvalidField.cs | 0 Adyen/{ => src}/Model/Management/JCBInfo.cs | 0 Adyen/{ => src}/Model/Management/Key.cs | 0 .../{ => src}/Model/Management/KlarnaInfo.cs | 0 Adyen/{ => src}/Model/Management/Links.cs | 0 .../Model/Management/LinksElement.cs | 0 .../ListCompanyApiCredentialsResponse.cs | 0 .../Model/Management/ListCompanyResponse.cs | 0 .../Management/ListCompanyUsersResponse.cs | 0 .../ListExternalTerminalActionsResponse.cs | 0 .../ListMerchantApiCredentialsResponse.cs | 0 .../Model/Management/ListMerchantResponse.cs | 0 .../Management/ListMerchantUsersResponse.cs | 0 .../Model/Management/ListStoresResponse.cs | 0 .../Model/Management/ListTerminalsResponse.cs | 0 .../Model/Management/ListWebhooksResponse.cs | 0 .../Model/Management/Localization.cs | 0 Adyen/{ => src}/Model/Management/Logo.cs | 0 .../Model/Management/MeApiCredential.cs | 0 .../Model/Management/MealVoucherFRInfo.cs | 0 Adyen/{ => src}/Model/Management/Merchant.cs | 0 .../Model/Management/MerchantLinks.cs | 0 .../Management/MinorUnitsMonetaryValue.cs | 0 .../Model/Management/ModelConfiguration.cs | 0 Adyen/{ => src}/Model/Management/Name.cs | 0 Adyen/{ => src}/Model/Management/Name2.cs | 0 Adyen/{ => src}/Model/Management/Nexo.cs | 0 .../Model/Management/Notification.cs | 0 .../Model/Management/NotificationUrl.cs | 0 Adyen/{ => src}/Model/Management/NyceInfo.cs | 0 .../Model/Management/OfflineProcessing.cs | 0 Adyen/{ => src}/Model/Management/Opi.cs | 0 Adyen/{ => src}/Model/Management/OrderItem.cs | 0 .../Model/Management/PaginationLinks.cs | 0 Adyen/{ => src}/Model/Management/Passcodes.cs | 0 .../{ => src}/Model/Management/PayAtTable.cs | 0 Adyen/{ => src}/Model/Management/PayMeInfo.cs | 0 .../{ => src}/Model/Management/PayPalInfo.cs | 0 Adyen/{ => src}/Model/Management/PayToInfo.cs | 0 Adyen/{ => src}/Model/Management/Payment.cs | 0 .../Model/Management/PaymentMethod.cs | 0 .../Model/Management/PaymentMethodResponse.cs | 0 .../Management/PaymentMethodSetupInfo.cs | 0 .../Model/Management/PayoutSettings.cs | 0 .../Model/Management/PayoutSettingsRequest.cs | 0 .../Management/PayoutSettingsResponse.cs | 0 Adyen/{ => src}/Model/Management/Profile.cs | 0 Adyen/{ => src}/Model/Management/PulseInfo.cs | 0 .../Model/Management/ReceiptOptions.cs | 0 .../Model/Management/ReceiptPrinting.cs | 0 .../{ => src}/Model/Management/Referenced.cs | 0 Adyen/{ => src}/Model/Management/Refunds.cs | 0 .../Model/Management/ReleaseUpdateDetails.cs | 0 .../Management/ReprocessAndroidAppResponse.cs | 0 .../Management/RequestActivationResponse.cs | 0 .../Model/Management/RestServiceError.cs | 0 .../ScheduleTerminalActionsRequest.cs | 0 ...duleTerminalActionsRequestActionDetails.cs | 0 .../ScheduleTerminalActionsResponse.cs | 0 Adyen/{ => src}/Model/Management/Settings.cs | 0 .../Model/Management/ShippingLocation.cs | 0 .../Management/ShippingLocationsResponse.cs | 0 Adyen/{ => src}/Model/Management/Signature.cs | 0 .../{ => src}/Model/Management/SodexoInfo.cs | 0 .../{ => src}/Model/Management/SofortInfo.cs | 0 .../Model/Management/SplitConfiguration.cs | 0 .../Management/SplitConfigurationList.cs | 0 .../Management/SplitConfigurationLogic.cs | 0 .../Management/SplitConfigurationRule.cs | 0 .../{ => src}/Model/Management/Standalone.cs | 0 Adyen/{ => src}/Model/Management/StarInfo.cs | 0 Adyen/{ => src}/Model/Management/Store.cs | 0 .../Model/Management/StoreAndForward.cs | 0 .../Model/Management/StoreCreationRequest.cs | 0 .../StoreCreationWithMerchantCodeRequest.cs | 0 .../Model/Management/StoreLocation.cs | 0 .../Management/StoreSplitConfiguration.cs | 0 .../Model/Management/SupportedCardTypes.cs | 0 Adyen/{ => src}/Model/Management/Surcharge.cs | 0 Adyen/{ => src}/Model/Management/SwishInfo.cs | 0 Adyen/{ => src}/Model/Management/TapToPay.cs | 0 Adyen/{ => src}/Model/Management/Terminal.cs | 0 .../TerminalActionScheduleDetail.cs | 0 .../Model/Management/TerminalAssignment.cs | 0 .../Model/Management/TerminalConnectivity.cs | 0 .../TerminalConnectivityBluetooth.cs | 0 .../TerminalConnectivityCellular.cs | 0 .../TerminalConnectivityEthernet.cs | 0 .../Management/TerminalConnectivityWifi.cs | 0 .../Model/Management/TerminalInstructions.cs | 0 .../Management/TerminalModelsResponse.cs | 0 .../Model/Management/TerminalOrder.cs | 0 .../Model/Management/TerminalOrderRequest.cs | 0 .../Management/TerminalOrdersResponse.cs | 0 .../Model/Management/TerminalProduct.cs | 0 .../Model/Management/TerminalProductPrice.cs | 0 .../Management/TerminalProductsResponse.cs | 0 .../Management/TerminalReassignmentRequest.cs | 0 .../Management/TerminalReassignmentTarget.cs | 0 .../Model/Management/TerminalSettings.cs | 0 .../Management/TestCompanyWebhookRequest.cs | 0 .../{ => src}/Model/Management/TestOutput.cs | 0 .../Model/Management/TestWebhookRequest.cs | 0 .../Model/Management/TestWebhookResponse.cs | 0 .../{ => src}/Model/Management/TicketInfo.cs | 0 Adyen/{ => src}/Model/Management/Timeouts.cs | 0 .../Management/TransactionDescriptionInfo.cs | 0 Adyen/{ => src}/Model/Management/TwintInfo.cs | 0 .../Management/UninstallAndroidAppDetails.cs | 0 .../UninstallAndroidCertificateDetails.cs | 0 .../Model/Management/UpdatableAddress.cs | 0 .../UpdateCompanyApiCredentialRequest.cs | 0 .../Management/UpdateCompanyUserRequest.cs | 0 .../Management/UpdateCompanyWebhookRequest.cs | 0 .../UpdateMerchantApiCredentialRequest.cs | 0 .../Management/UpdateMerchantUserRequest.cs | 0 .../UpdateMerchantWebhookRequest.cs | 0 .../Management/UpdatePaymentMethodInfo.cs | 0 .../Management/UpdatePayoutSettingsRequest.cs | 0 .../UpdateSplitConfigurationLogicRequest.cs | 0 .../UpdateSplitConfigurationRequest.cs | 0 .../UpdateSplitConfigurationRuleRequest.cs | 0 .../Model/Management/UpdateStoreRequest.cs | 0 .../Management/UploadAndroidAppResponse.cs | 0 .../UploadAndroidCertificateResponse.cs | 0 Adyen/{ => src}/Model/Management/Url.cs | 0 Adyen/{ => src}/Model/Management/User.cs | 0 Adyen/{ => src}/Model/Management/VippsInfo.cs | 0 .../Model/Management/WeChatPayInfo.cs | 0 .../Model/Management/WeChatPayPosInfo.cs | 0 Adyen/{ => src}/Model/Management/Webhook.cs | 0 .../Model/Management/WebhookLinks.cs | 0 .../Model/Management/WifiProfiles.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../AccountCapabilityData.cs | 0 .../AccountCreateNotificationData.cs | 0 .../AccountNotificationResponse.cs | 0 .../AccountUpdateNotificationData.cs | 0 .../ManagementWebhooks/CapabilityProblem.cs | 0 .../CapabilityProblemEntity.cs | 0 .../CapabilityProblemEntityRecursive.cs | 0 .../MerchantCreatedNotificationRequest.cs | 0 .../MerchantUpdatedNotificationRequest.cs | 0 .../MidServiceNotificationData.cs | 0 ...PaymentMethodCreatedNotificationRequest.cs | 0 .../PaymentMethodNotificationResponse.cs | 0 ...MethodRequestRemovedNotificationRequest.cs | 0 ...dScheduledForRemovalNotificationRequest.cs | 0 .../ManagementWebhooks/RemediatingAction.cs | 0 .../TerminalAssignmentNotificationRequest.cs | 0 .../TerminalAssignmentNotificationResponse.cs | 0 .../TerminalBoardingData.cs | 0 .../TerminalBoardingNotificationRequest.cs | 0 .../TerminalBoardingNotificationResponse.cs | 0 .../TerminalSettingsData.cs | 0 .../TerminalSettingsNotificationRequest.cs | 0 .../TerminalSettingsNotificationResponse.cs | 0 .../ManagementWebhooks/VerificationError.cs | 0 .../VerificationErrorRecursive.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../NegativeBalanceWarningWebhooks/Amount.cs | 0 ...anceCompensationWarningNotificationData.cs | 0 ...eCompensationWarningNotificationRequest.cs | 0 .../Resource.cs | 0 .../ResourceReference.cs | 0 .../Model/Notification/NotificationRequest.cs | 122 ++++---- .../Notification/NotificationRequestConst.cs | 134 ++++----- .../Notification/NotificationRequestItem.cs | 86 +++--- .../NotificationRequestItemContainer.cs | 90 +++--- .../Model/Payment/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/Payment/AccountInfo.cs | 0 Adyen/{ => src}/Model/Payment/AcctInfo.cs | 0 .../Model/Payment/AdditionalData3DSecure.cs | 0 .../Model/Payment/AdditionalDataAirline.cs | 0 .../Model/Payment/AdditionalDataCarRental.cs | 0 .../Model/Payment/AdditionalDataCommon.cs | 0 .../Model/Payment/AdditionalDataLevel23.cs | 0 .../Model/Payment/AdditionalDataLodging.cs | 0 .../Payment/AdditionalDataModifications.cs | 0 .../Payment/AdditionalDataOpenInvoice.cs | 0 .../Model/Payment/AdditionalDataOpi.cs | 0 .../Model/Payment/AdditionalDataRatepay.cs | 0 .../Model/Payment/AdditionalDataRetry.cs | 0 .../Model/Payment/AdditionalDataRisk.cs | 0 .../Payment/AdditionalDataRiskStandalone.cs | 0 .../Payment/AdditionalDataSubMerchant.cs | 0 .../AdditionalDataTemporaryServices.cs | 0 .../Model/Payment/AdditionalDataWallets.cs | 0 Adyen/{ => src}/Model/Payment/Address.cs | 0 .../Payment/AdjustAuthorisationRequest.cs | 0 Adyen/{ => src}/Model/Payment/Amount.cs | 0 .../Model/Payment/ApplicationInfo.cs | 0 .../Payment/AuthenticationResultRequest.cs | 0 .../Payment/AuthenticationResultResponse.cs | 0 Adyen/{ => src}/Model/Payment/BankAccount.cs | 0 Adyen/{ => src}/Model/Payment/BrowserInfo.cs | 0 .../Model/Payment/CancelOrRefundRequest.cs | 0 .../{ => src}/Model/Payment/CancelRequest.cs | 0 .../{ => src}/Model/Payment/CaptureRequest.cs | 0 Adyen/{ => src}/Model/Payment/Card.cs | 0 Adyen/{ => src}/Model/Payment/CommonField.cs | 0 .../Model/Payment/DeviceRenderOptions.cs | 0 .../Model/Payment/DonationRequest.cs | 0 .../Model/Payment/ExternalPlatform.cs | 0 Adyen/{ => src}/Model/Payment/ForexQuote.cs | 0 .../Model/Payment/FraudCheckResult.cs | 0 .../Model/Payment/FraudCheckResultWrapper.cs | 0 Adyen/{ => src}/Model/Payment/FraudResult.cs | 0 .../Model/Payment/FundDestination.cs | 0 Adyen/{ => src}/Model/Payment/FundSource.cs | 0 Adyen/{ => src}/Model/Payment/Installments.cs | 0 Adyen/{ => src}/Model/Payment/Mandate.cs | 0 .../{ => src}/Model/Payment/MerchantDevice.cs | 0 .../Model/Payment/MerchantRiskIndicator.cs | 0 .../Model/Payment/ModificationResult.cs | 0 Adyen/{ => src}/Model/Payment/Name.cs | 0 .../{ => src}/Model/Payment/PaymentRequest.cs | 0 .../Model/Payment/PaymentRequest3d.cs | 0 .../Model/Payment/PaymentRequest3ds2.cs | 0 .../{ => src}/Model/Payment/PaymentResult.cs | 0 Adyen/{ => src}/Model/Payment/Phone.cs | 0 .../Model/Payment/PlatformChargebackLogic.cs | 0 Adyen/{ => src}/Model/Payment/Recurring.cs | 0 .../{ => src}/Model/Payment/RefundRequest.cs | 0 .../Payment/ResponseAdditionalData3DSecure.cs | 0 .../ResponseAdditionalDataBillingAddress.cs | 0 .../Payment/ResponseAdditionalDataCard.cs | 0 .../Payment/ResponseAdditionalDataCommon.cs | 0 .../ResponseAdditionalDataDomesticError.cs | 0 .../ResponseAdditionalDataInstallments.cs | 0 .../ResponseAdditionalDataNetworkTokens.cs | 0 .../Payment/ResponseAdditionalDataOpi.cs | 0 .../Payment/ResponseAdditionalDataSepa.cs | 0 .../{ => src}/Model/Payment/SDKEphemPubKey.cs | 0 .../SecureRemoteCommerceCheckoutData.cs | 0 Adyen/{ => src}/Model/Payment/ServiceError.cs | 0 .../Model/Payment/ShopperInteractionDevice.cs | 0 Adyen/{ => src}/Model/Payment/Split.cs | 0 Adyen/{ => src}/Model/Payment/SplitAmount.cs | 0 Adyen/{ => src}/Model/Payment/SubMerchant.cs | 0 .../Model/Payment/TechnicalCancelRequest.cs | 0 .../{ => src}/Model/Payment/ThreeDS1Result.cs | 0 .../Model/Payment/ThreeDS2RequestData.cs | 0 .../{ => src}/Model/Payment/ThreeDS2Result.cs | 0 .../Model/Payment/ThreeDS2ResultRequest.cs | 0 .../Model/Payment/ThreeDS2ResultResponse.cs | 0 .../ThreeDSRequestorAuthenticationInfo.cs | 0 ...ThreeDSRequestorPriorAuthenticationInfo.cs | 0 .../Model/Payment/ThreeDSecureData.cs | 0 .../Model/Payment/VoidPendingRefundRequest.cs | 0 .../PaymentsApp/AbstractOpenAPISchema.cs | 0 .../Model/PaymentsApp/BoardingTokenRequest.cs | 0 .../PaymentsApp/BoardingTokenResponse.cs | 0 .../PaymentsApp/DefaultErrorResponseEntity.cs | 0 .../Model/PaymentsApp/InvalidField.cs | 0 .../Model/PaymentsApp/PaymentsAppDto.cs | 0 .../Model/PaymentsApp/PaymentsAppResponse.cs | 0 .../Model/Payout/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/Payout/Address.cs | 0 Adyen/{ => src}/Model/Payout/Amount.cs | 0 Adyen/{ => src}/Model/Payout/BankAccount.cs | 0 Adyen/{ => src}/Model/Payout/Card.cs | 0 .../Model/Payout/FraudCheckResult.cs | 0 .../Model/Payout/FraudCheckResultWrapper.cs | 0 Adyen/{ => src}/Model/Payout/FraudResult.cs | 0 Adyen/{ => src}/Model/Payout/FundSource.cs | 0 Adyen/{ => src}/Model/Payout/ModifyRequest.cs | 0 .../{ => src}/Model/Payout/ModifyResponse.cs | 0 Adyen/{ => src}/Model/Payout/Name.cs | 0 Adyen/{ => src}/Model/Payout/PayoutRequest.cs | 0 .../{ => src}/Model/Payout/PayoutResponse.cs | 0 Adyen/{ => src}/Model/Payout/Recurring.cs | 0 .../Payout/ResponseAdditionalData3DSecure.cs | 0 .../ResponseAdditionalDataBillingAddress.cs | 0 .../Payout/ResponseAdditionalDataCard.cs | 0 .../Payout/ResponseAdditionalDataCommon.cs | 0 .../ResponseAdditionalDataDomesticError.cs | 0 .../ResponseAdditionalDataInstallments.cs | 0 .../ResponseAdditionalDataNetworkTokens.cs | 0 .../Model/Payout/ResponseAdditionalDataOpi.cs | 0 .../Payout/ResponseAdditionalDataSepa.cs | 0 Adyen/{ => src}/Model/Payout/ServiceError.cs | 0 .../Payout/StoreDetailAndSubmitRequest.cs | 0 .../Payout/StoreDetailAndSubmitResponse.cs | 0 .../Model/Payout/StoreDetailRequest.cs | 0 .../Model/Payout/StoreDetailResponse.cs | 0 Adyen/{ => src}/Model/Payout/SubmitRequest.cs | 0 .../{ => src}/Model/Payout/SubmitResponse.cs | 0 .../PlatformsAccount/AbstractOpenAPISchema.cs | 0 .../Model/PlatformsAccount/Account.cs | 0 .../Model/PlatformsAccount/AccountEvent.cs | 0 .../PlatformsAccount/AccountHolderDetails.cs | 0 .../PlatformsAccount/AccountHolderStatus.cs | 0 .../PlatformsAccount/AccountPayoutState.cs | 0 .../AccountProcessingState.cs | 0 .../Model/PlatformsAccount/Amount.cs | 0 .../PlatformsAccount/BankAccountDetail.cs | 0 .../Model/PlatformsAccount/BusinessDetails.cs | 0 .../CloseAccountHolderRequest.cs | 0 .../CloseAccountHolderResponse.cs | 0 .../PlatformsAccount/CloseAccountRequest.cs | 0 .../PlatformsAccount/CloseAccountResponse.cs | 0 .../PlatformsAccount/CloseStoresRequest.cs | 0 .../CreateAccountHolderRequest.cs | 0 .../CreateAccountHolderResponse.cs | 0 .../PlatformsAccount/CreateAccountRequest.cs | 0 .../PlatformsAccount/CreateAccountResponse.cs | 0 .../DeleteBankAccountRequest.cs | 0 .../DeleteLegalArrangementRequest.cs | 0 .../DeletePayoutMethodRequest.cs | 0 .../DeleteShareholderRequest.cs | 0 .../DeleteSignatoriesRequest.cs | 0 .../Model/PlatformsAccount/DocumentDetail.cs | 0 .../Model/PlatformsAccount/ErrorFieldType.cs | 0 .../Model/PlatformsAccount/FieldType.cs | 0 .../Model/PlatformsAccount/GenericResponse.cs | 0 .../GetAccountHolderRequest.cs | 0 .../GetAccountHolderResponse.cs | 0 .../GetAccountHolderStatusResponse.cs | 0 .../PlatformsAccount/GetTaxFormRequest.cs | 0 .../PlatformsAccount/GetTaxFormResponse.cs | 0 .../GetUploadedDocumentsRequest.cs | 0 .../GetUploadedDocumentsResponse.cs | 0 .../PlatformsAccount/IndividualDetails.cs | 0 .../Model/PlatformsAccount/KYCCheckResult.cs | 0 .../PlatformsAccount/KYCCheckStatusData.cs | 0 .../Model/PlatformsAccount/KYCCheckSummary.cs | 0 .../KYCLegalArrangementCheckResult.cs | 0 .../KYCLegalArrangementEntityCheckResult.cs | 0 .../KYCPayoutMethodCheckResult.cs | 0 .../KYCShareholderCheckResult.cs | 0 .../KYCSignatoryCheckResult.cs | 0 .../KYCUltimateParentCompanyCheckResult.cs | 0 .../PlatformsAccount/KYCVerificationResult.cs | 0 .../LegalArrangementDetail.cs | 0 .../LegalArrangementEntityDetail.cs | 0 .../LegalArrangementRequest.cs | 0 .../PlatformsAccount/MigratedAccounts.cs | 0 .../PlatformsAccount/MigratedShareholders.cs | 0 .../Model/PlatformsAccount/MigratedStores.cs | 0 .../Model/PlatformsAccount/MigrationData.cs | 0 .../Model/PlatformsAccount/PayoutMethod.cs | 0 .../PayoutScheduleResponse.cs | 0 .../PerformVerificationRequest.cs | 0 .../PlatformsAccount/PersonalDocumentData.cs | 0 .../Model/PlatformsAccount/ServiceError.cs | 0 .../PlatformsAccount/ShareholderContact.cs | 0 .../PlatformsAccount/SignatoryContact.cs | 0 .../Model/PlatformsAccount/StoreDetail.cs | 0 .../SuspendAccountHolderRequest.cs | 0 .../SuspendAccountHolderResponse.cs | 0 .../PlatformsAccount/UltimateParentCompany.cs | 0 .../UltimateParentCompanyBusinessDetails.cs | 0 .../UnSuspendAccountHolderRequest.cs | 0 .../UnSuspendAccountHolderResponse.cs | 0 .../UpdateAccountHolderRequest.cs | 0 .../UpdateAccountHolderResponse.cs | 0 .../UpdateAccountHolderStateRequest.cs | 0 .../PlatformsAccount/UpdateAccountRequest.cs | 0 .../PlatformsAccount/UpdateAccountResponse.cs | 0 .../UpdatePayoutScheduleRequest.cs | 0 .../PlatformsAccount/UploadDocumentRequest.cs | 0 .../Model/PlatformsAccount/ViasAddress.cs | 0 .../Model/PlatformsAccount/ViasName.cs | 0 .../PlatformsAccount/ViasPersonalData.cs | 0 .../Model/PlatformsAccount/ViasPhoneNumber.cs | 0 .../PlatformsFund/AbstractOpenAPISchema.cs | 0 .../PlatformsFund/AccountDetailBalance.cs | 0 .../AccountHolderBalanceRequest.cs | 0 .../AccountHolderBalanceResponse.cs | 0 .../AccountHolderTransactionListRequest.cs | 0 .../AccountHolderTransactionListResponse.cs | 0 .../PlatformsFund/AccountTransactionList.cs | 0 Adyen/{ => src}/Model/PlatformsFund/Amount.cs | 0 .../Model/PlatformsFund/BankAccountDetail.cs | 0 .../DebitAccountHolderRequest.cs | 0 .../DebitAccountHolderResponse.cs | 0 .../Model/PlatformsFund/DetailBalance.cs | 0 .../Model/PlatformsFund/ErrorFieldType.cs | 0 .../Model/PlatformsFund/FieldType.cs | 0 .../PayoutAccountHolderRequest.cs | 0 .../PayoutAccountHolderResponse.cs | 0 .../RefundFundsTransferRequest.cs | 0 .../RefundFundsTransferResponse.cs | 0 .../RefundNotPaidOutTransfersRequest.cs | 0 .../RefundNotPaidOutTransfersResponse.cs | 0 .../Model/PlatformsFund/ServiceError.cs | 0 .../PlatformsFund/SetupBeneficiaryRequest.cs | 0 .../PlatformsFund/SetupBeneficiaryResponse.cs | 0 Adyen/{ => src}/Model/PlatformsFund/Split.cs | 0 .../Model/PlatformsFund/SplitAmount.cs | 0 .../Model/PlatformsFund/Transaction.cs | 0 .../TransactionListForAccount.cs | 0 .../PlatformsFund/TransferFundsRequest.cs | 0 .../PlatformsFund/TransferFundsResponse.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../CollectInformation.cs | 0 .../ErrorFieldType.cs | 0 .../FieldType.cs | 0 .../GetOnboardingUrlRequest.cs | 0 .../GetOnboardingUrlResponse.cs | 0 .../GetPciUrlRequest.cs | 0 .../GetPciUrlResponse.cs | 0 .../ServiceError.cs | 0 .../ShowPages.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../CreateNotificationConfigurationRequest.cs | 0 .../DeleteNotificationConfigurationRequest.cs | 0 .../ErrorFieldType.cs | 0 .../ExchangeMessage.cs | 0 .../FieldType.cs | 0 .../GenericResponse.cs | 0 ...etNotificationConfigurationListResponse.cs | 0 .../GetNotificationConfigurationRequest.cs | 0 .../GetNotificationConfigurationResponse.cs | 0 .../NotificationConfigurationDetails.cs | 0 .../NotificationEventConfiguration.cs | 0 .../ServiceError.cs | 0 .../TestNotificationConfigurationRequest.cs | 0 .../TestNotificationConfigurationResponse.cs | 0 .../UpdateNotificationConfigurationRequest.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../AccountCloseNotification.cs | 0 .../AccountCreateNotification.cs | 0 .../Model/PlatformsWebhooks/AccountEvent.cs | 0 .../AccountFundsBelowThresholdNotification.cs | 0 ...tFundsBelowThresholdNotificationContent.cs | 0 .../AccountHolderCreateNotification.cs | 0 .../PlatformsWebhooks/AccountHolderDetails.cs | 0 .../AccountHolderPayoutNotification.cs | 0 .../AccountHolderPayoutNotificationContent.cs | 0 .../PlatformsWebhooks/AccountHolderStatus.cs | 0 .../AccountHolderStatusChangeNotification.cs | 0 ...ntHolderStatusChangeNotificationContent.cs | 0 ...ountHolderStoreStatusChangeNotification.cs | 0 ...derStoreStatusChangeNotificationContent.cs | 0 ...countHolderUpcomingDeadlineNotification.cs | 0 ...lderUpcomingDeadlineNotificationContent.cs | 0 .../AccountHolderUpdateNotification.cs | 0 .../AccountHolderVerificationNotification.cs | 0 ...ntHolderVerificationNotificationContent.cs | 0 .../PlatformsWebhooks/AccountPayoutState.cs | 0 .../AccountProcessingState.cs | 0 .../AccountUpdateNotification.cs | 0 .../Model/PlatformsWebhooks/Amount.cs | 0 .../PlatformsWebhooks/BankAccountDetail.cs | 0 .../BeneficiarySetupNotification.cs | 0 .../BeneficiarySetupNotificationContent.cs | 0 .../PlatformsWebhooks/BusinessDetails.cs | 0 .../PlatformsWebhooks/CloseAccountResponse.cs | 0 .../CompensateNegativeBalanceNotification.cs | 0 ...nsateNegativeBalanceNotificationContent.cs | 0 ...ensateNegativeBalanceNotificationRecord.cs | 0 .../CreateAccountHolderResponse.cs | 0 .../CreateAccountResponse.cs | 0 .../DirectDebitInitiatedNotification.cs | 0 ...DirectDebitInitiatedNotificationContent.cs | 0 .../Model/PlatformsWebhooks/ErrorFieldType.cs | 0 .../Model/PlatformsWebhooks/FieldType.cs | 0 .../PlatformsWebhooks/IndividualDetails.cs | 0 .../Model/PlatformsWebhooks/KYCCheckResult.cs | 0 .../PlatformsWebhooks/KYCCheckStatusData.cs | 0 .../PlatformsWebhooks/KYCCheckSummary.cs | 0 .../KYCLegalArrangementCheckResult.cs | 0 .../KYCLegalArrangementEntityCheckResult.cs | 0 .../KYCPayoutMethodCheckResult.cs | 0 .../KYCShareholderCheckResult.cs | 0 .../KYCSignatoryCheckResult.cs | 0 .../KYCUltimateParentCompanyCheckResult.cs | 0 .../KYCVerificationResult.cs | 0 .../LegalArrangementDetail.cs | 0 .../LegalArrangementEntityDetail.cs | 0 .../Model/PlatformsWebhooks/LocalDate.cs | 0 .../Model/PlatformsWebhooks/Message.cs | 0 .../NotificationErrorContainer.cs | 0 .../PlatformsWebhooks/NotificationResponse.cs | 0 .../PlatformsWebhooks/OperationStatus.cs | 0 .../PaymentFailureNotification.cs | 0 .../PaymentFailureNotificationContent.cs | 0 .../Model/PlatformsWebhooks/PayoutMethod.cs | 0 .../PayoutScheduleResponse.cs | 0 .../PlatformsWebhooks/PersonalDocumentData.cs | 0 .../RefundFundsTransferNotification.cs | 0 .../RefundFundsTransferNotificationContent.cs | 0 .../Model/PlatformsWebhooks/RefundResult.cs | 0 .../ReportAvailableNotification.cs | 0 .../ReportAvailableNotificationContent.cs | 0 .../ScheduledRefundsNotification.cs | 0 .../ScheduledRefundsNotificationContent.cs | 0 .../PlatformsWebhooks/ShareholderContact.cs | 0 .../PlatformsWebhooks/SignatoryContact.cs | 0 .../Model/PlatformsWebhooks/Split.cs | 0 .../Model/PlatformsWebhooks/SplitAmount.cs | 0 .../Model/PlatformsWebhooks/StoreDetail.cs | 0 .../Model/PlatformsWebhooks/Transaction.cs | 0 .../TransferFundsNotification.cs | 0 .../TransferFundsNotificationContent.cs | 0 .../UltimateParentCompany.cs | 0 .../UltimateParentCompanyBusinessDetails.cs | 0 .../UpdateAccountHolderResponse.cs | 0 .../UpdateAccountResponse.cs | 0 .../Model/PlatformsWebhooks/ViasAddress.cs | 0 .../Model/PlatformsWebhooks/ViasName.cs | 0 .../PlatformsWebhooks/ViasPersonalData.cs | 0 .../PlatformsWebhooks/ViasPhoneNumber.cs | 0 .../Model/PosMobile/AbstractOpenAPISchema.cs | 0 .../Model/PosMobile/CreateSessionRequest.cs | 0 .../Model/PosMobile/CreateSessionResponse.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../Model/PosTerminalManagement/Address.cs | 0 .../AssignTerminalsRequest.cs | 0 .../AssignTerminalsResponse.cs | 0 .../FindTerminalRequest.cs | 0 .../FindTerminalResponse.cs | 0 .../GetStoresUnderAccountRequest.cs | 0 .../GetStoresUnderAccountResponse.cs | 0 .../GetTerminalDetailsRequest.cs | 0 .../GetTerminalDetailsResponse.cs | 0 .../GetTerminalsUnderAccountRequest.cs | 0 .../GetTerminalsUnderAccountResponse.cs | 0 .../PosTerminalManagement/MerchantAccount.cs | 0 .../PosTerminalManagement/ServiceError.cs | 0 .../Model/PosTerminalManagement/Store.cs | 0 .../Model/Recurring/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/Recurring/Address.cs | 0 Adyen/{ => src}/Model/Recurring/Amount.cs | 0 .../{ => src}/Model/Recurring/BankAccount.cs | 0 Adyen/{ => src}/Model/Recurring/Card.cs | 0 .../Model/Recurring/CreatePermitRequest.cs | 0 .../Model/Recurring/CreatePermitResult.cs | 0 .../Model/Recurring/DisablePermitRequest.cs | 0 .../Model/Recurring/DisablePermitResult.cs | 0 .../Model/Recurring/DisableRequest.cs | 0 .../Model/Recurring/DisableResult.cs | 0 Adyen/{ => src}/Model/Recurring/Name.cs | 0 .../Model/Recurring/NotifyShopperRequest.cs | 0 .../Model/Recurring/NotifyShopperResult.cs | 0 Adyen/{ => src}/Model/Recurring/Permit.cs | 0 .../Model/Recurring/PermitRestriction.cs | 0 .../{ => src}/Model/Recurring/PermitResult.cs | 0 Adyen/{ => src}/Model/Recurring/Recurring.cs | 0 .../Model/Recurring/RecurringDetail.cs | 0 .../Model/Recurring/RecurringDetailWrapper.cs | 0 .../Recurring/RecurringDetailsRequest.cs | 0 .../Model/Recurring/RecurringDetailsResult.cs | 0 .../ScheduleAccountUpdaterRequest.cs | 0 .../Recurring/ScheduleAccountUpdaterResult.cs | 0 .../{ => src}/Model/Recurring/ServiceError.cs | 0 .../{ => src}/Model/Recurring/TokenDetails.cs | 0 .../ReportWebhooks/AbstractOpenAPISchema.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../ReportWebhooks/ReportNotificationData.cs | 0 .../ReportNotificationRequest.cs | 0 .../Model/ReportWebhooks/Resource.cs | 0 .../Model/ReportWebhooks/ResourceReference.cs | 0 Adyen/{ => src}/Model/RequestOptions.cs | 0 .../StoredValue/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/StoredValue/Amount.cs | 0 .../Model/StoredValue/ServiceError.cs | 0 .../StoredValueBalanceCheckRequest.cs | 0 .../StoredValueBalanceCheckResponse.cs | 0 .../StoredValueBalanceMergeRequest.cs | 0 .../StoredValueBalanceMergeResponse.cs | 0 .../StoredValue/StoredValueIssueRequest.cs | 0 .../StoredValue/StoredValueIssueResponse.cs | 0 .../StoredValue/StoredValueLoadRequest.cs | 0 .../StoredValue/StoredValueLoadResponse.cs | 0 .../StoredValueStatusChangeRequest.cs | 0 .../StoredValueStatusChangeResponse.cs | 0 .../StoredValue/StoredValueVoidRequest.cs | 0 .../StoredValue/StoredValueVoidResponse.cs | 0 .../Model/Terminal/SaleToAcquirerData.cs | 0 Adyen/{ => src}/Model/Terminal/Split.cs | 0 Adyen/{ => src}/Model/Terminal/SplitItem.cs | 0 .../{ => src}/Model/Terminal/SplitItemType.cs | 0 .../Model/TerminalApi/AbortRequest.cs | 0 .../Model/TerminalApi/AccountType.cs | 0 .../Model/TerminalApi/AdminRequest.cs | 0 .../Model/TerminalApi/AdminResponse.cs | 0 .../Model/TerminalApi/AlgorithmIdentifier.cs | 0 .../Model/TerminalApi/AlgorithmType.cs | 0 .../Model/TerminalApi/AlignmentType.cs | 0 .../Model/TerminalApi/AllowedProduct.cs | 0 Adyen/{ => src}/Model/TerminalApi/Amount.cs | 0 .../{ => src}/Model/TerminalApi/AmountsReq.cs | 0 .../Model/TerminalApi/AmountsResp.cs | 0 Adyen/{ => src}/Model/TerminalApi/AreaSize.cs | 0 .../Model/TerminalApi/AuthenticatedData.cs | 0 .../TerminalApi/AuthenticationMethodType.cs | 0 .../TerminalApi/BalanceInquiryRequest.cs | 0 .../TerminalApi/BalanceInquiryResponse.cs | 0 .../Model/TerminalApi/BarcodeType.cs | 0 .../Model/TerminalApi/BatchRequest.cs | 0 .../Model/TerminalApi/BatchResponse.cs | 0 .../Model/TerminalApi/CapturedSignature.cs | 0 .../TerminalApi/CardAcquisitionRequest.cs | 0 .../TerminalApi/CardAcquisitionResponse.cs | 0 .../TerminalApi/CardAcquisitionTransaction.cs | 0 Adyen/{ => src}/Model/TerminalApi/CardData.cs | 0 .../TerminalApi/CardReaderAPDURequest.cs | 0 .../TerminalApi/CardReaderAPDUResponse.cs | 0 .../TerminalApi/CardReaderInitRequest.cs | 0 .../TerminalApi/CardReaderInitResponse.cs | 0 .../TerminalApi/CardReaderPowerOffRequest.cs | 0 .../TerminalApi/CardReaderPowerOffResponse.cs | 0 .../Model/TerminalApi/CardholderPIN.cs | 0 .../Model/TerminalApi/CashHandlingDevice.cs | 0 .../Model/TerminalApi/CharacterHeightType.cs | 0 .../Model/TerminalApi/CharacterStyleType.cs | 0 .../Model/TerminalApi/CharacterWidthType.cs | 0 .../{ => src}/Model/TerminalApi/CheckData.cs | 0 .../Model/TerminalApi/CheckTypeCodeType.cs | 0 .../Model/TerminalApi/CoinsOrBills.cs | 0 .../{ => src}/Model/TerminalApi/ColorType.cs | 0 .../Model/TerminalApi/ContentInformation.cs | 0 .../Model/TerminalApi/ContentType.cs | 0 .../Model/TerminalApi/CurrencyConversion.cs | 0 .../Model/TerminalApi/CustomerOrder.cs | 0 .../Model/TerminalApi/CustomerOrderReqType.cs | 0 .../{ => src}/Model/TerminalApi/DeviceType.cs | 0 .../Model/TerminalApi/DiagnosisRequest.cs | 0 .../Model/TerminalApi/DiagnosisResponse.cs | 0 .../Model/TerminalApi/DigestedData.cs | 0 .../Model/TerminalApi/DisplayOutput.cs | 0 .../Model/TerminalApi/DisplayRequest.cs | 0 .../Model/TerminalApi/DisplayResponse.cs | 0 .../TerminalApi/DocumentQualifierType.cs | 0 .../Model/TerminalApi/EnableServiceRequest.cs | 0 .../TerminalApi/EnableServiceResponse.cs | 0 .../Model/TerminalApi/EncapsulatedContent.cs | 0 .../Model/TerminalApi/EncryptedContent.cs | 0 .../Model/TerminalApi/EntryModeType.cs | 0 .../Model/TerminalApi/EnvelopedData.cs | 0 .../Model/TerminalApi/ErrorConditionType.cs | 0 .../Model/TerminalApi/EventNotification.cs | 0 .../Model/TerminalApi/EventToNotifyType.cs | 0 .../Model/TerminalApi/ForceTypeModeType.cs | 0 .../Model/TerminalApi/GenericProfileType.cs | 0 .../TerminalApi/GeographicCoordinates.cs | 0 .../Model/TerminalApi/Geolocation.cs | 0 .../Model/TerminalApi/GetTotalsRequest.cs | 0 .../Model/TerminalApi/GetTotalsResponse.cs | 0 .../Model/TerminalApi/GlobalStatusType.cs | 0 .../{ => src}/Model/TerminalApi/HostStatus.cs | 0 .../Model/TerminalApi/ICCResetData.cs | 0 .../TerminalApi/IdentificationSupportType.cs | 0 .../Model/TerminalApi/IdentificationType.cs | 0 .../Model/TerminalApi/InfoQualifyType.cs | 0 Adyen/{ => src}/Model/TerminalApi/Input.cs | 0 .../Model/TerminalApi/InputCommandType.cs | 0 .../{ => src}/Model/TerminalApi/InputData.cs | 0 .../Model/TerminalApi/InputRequest.cs | 0 .../Model/TerminalApi/InputResponse.cs | 0 .../Model/TerminalApi/InputResult.cs | 0 .../Model/TerminalApi/InputUpdate.cs | 0 .../{ => src}/Model/TerminalApi/Instalment.cs | 0 .../TerminalApi/IssuerAndSerialNumber.cs | 0 Adyen/{ => src}/Model/TerminalApi/KEK.cs | 0 .../Model/TerminalApi/KEKIdentifier.cs | 0 .../Model/TerminalApi/KeyTransport.cs | 0 .../Model/TerminalApi/LoginRequest.cs | 0 .../Model/TerminalApi/LoginResponse.cs | 0 .../Model/TerminalApi/LogoutRequest.cs | 0 .../Model/TerminalApi/LogoutResponse.cs | 0 .../Model/TerminalApi/LoyaltyAccount.cs | 0 .../Model/TerminalApi/LoyaltyAccountID.cs | 0 .../Model/TerminalApi/LoyaltyAccountReq.cs | 0 .../Model/TerminalApi/LoyaltyAccountStatus.cs | 0 .../Model/TerminalApi/LoyaltyAcquirerData.cs | 0 .../Model/TerminalApi/LoyaltyAmount.cs | 0 .../Model/TerminalApi/LoyaltyData.cs | 0 .../Model/TerminalApi/LoyaltyHandlingType.cs | 0 .../Model/TerminalApi/LoyaltyRequest.cs | 0 .../Model/TerminalApi/LoyaltyResponse.cs | 0 .../Model/TerminalApi/LoyaltyResult.cs | 0 .../Model/TerminalApi/LoyaltyTotals.cs | 0 .../Model/TerminalApi/LoyaltyTransaction.cs | 0 .../TerminalApi/LoyaltyTransactionType.cs | 0 .../Model/TerminalApi/LoyaltyUnitType.cs | 0 .../{ => src}/Model/TerminalApi/MenuEntry.cs | 0 .../Model/TerminalApi/MenuEntryTagType.cs | 0 .../TerminalApi/Message/SaleToPOIRequest.cs | 0 .../Message/SaleToPoiRequestSecured.cs | 0 .../Message/SaleToPoiResponseSecured.cs | 0 .../Model/TerminalApi/MessageCategoryType.cs | 0 .../Model/TerminalApi/MessageClassType.cs | 0 .../Model/TerminalApi/MessageHeader.cs | 0 .../Model/TerminalApi/MessageReference.cs | 0 .../Model/TerminalApi/MessageType.cs | 0 .../{ => src}/Model/TerminalApi/MobileData.cs | 0 .../TerminalApi/NamedKeyEncryptedData.cs | 0 .../TerminalApi/OriginalPOITransaction.cs | 0 .../Model/TerminalApi/OutputBarcode.cs | 0 .../Model/TerminalApi/OutputContent.cs | 0 .../Model/TerminalApi/OutputFormatType.cs | 0 .../Model/TerminalApi/OutputResult.cs | 0 .../{ => src}/Model/TerminalApi/OutputText.cs | 0 .../Model/TerminalApi/PINFormatType.cs | 0 .../{ => src}/Model/TerminalApi/PINRequest.cs | 0 .../Model/TerminalApi/PINRequestType.cs | 0 .../Model/TerminalApi/PINResponse.cs | 0 Adyen/{ => src}/Model/TerminalApi/POIData.cs | 0 .../{ => src}/Model/TerminalApi/POIProfile.cs | 0 .../Model/TerminalApi/POISoftware.cs | 0 .../{ => src}/Model/TerminalApi/POIStatus.cs | 0 .../Model/TerminalApi/POISystemData.cs | 0 .../Model/TerminalApi/POITerminalData.cs | 0 .../{ => src}/Model/TerminalApi/Parameter.cs | 0 .../Model/TerminalApi/PaymentAccountReq.cs | 0 .../Model/TerminalApi/PaymentAccountStatus.cs | 0 .../Model/TerminalApi/PaymentAcquirerData.cs | 0 .../Model/TerminalApi/PaymentData.cs | 0 .../TerminalApi/PaymentInstrumentData.cs | 0 .../TerminalApi/PaymentInstrumentType.cs | 0 .../Model/TerminalApi/PaymentReceipt.cs | 0 .../Model/TerminalApi/PaymentRequest.cs | 0 .../Model/TerminalApi/PaymentResponse.cs | 0 .../Model/TerminalApi/PaymentResult.cs | 0 .../Model/TerminalApi/PaymentToken.cs | 0 .../Model/TerminalApi/PaymentTotals.cs | 0 .../Model/TerminalApi/PaymentTransaction.cs | 0 .../Model/TerminalApi/PaymentType.cs | 0 .../Model/TerminalApi/PerformedTransaction.cs | 0 .../Model/TerminalApi/PeriodUnitType.cs | 0 .../Model/TerminalApi/PredefinedContent.cs | 0 .../Model/TerminalApi/PrintOutput.cs | 0 .../Model/TerminalApi/PrintRequest.cs | 0 .../Model/TerminalApi/PrintResponse.cs | 0 .../Model/TerminalApi/PrinterStatusType.cs | 0 Adyen/{ => src}/Model/TerminalApi/Rebates.cs | 0 .../Model/TerminalApi/RecipientIdentifier.cs | 0 .../TerminalApi/ReconciliationRequest.cs | 0 .../TerminalApi/ReconciliationResponse.cs | 0 .../Model/TerminalApi/ReconciliationType.cs | 0 .../TerminalApi/RelativeDistinguishedName.cs | 0 .../TerminalApi/RepeatedMessageResponse.cs | 0 .../RepeatedResponseMessageBody.cs | 0 Adyen/{ => src}/Model/TerminalApi/Response.cs | 0 .../Model/TerminalApi/ResponseModeType.cs | 0 .../{ => src}/Model/TerminalApi/ResultType.cs | 0 .../Model/TerminalApi/ReversalReasonType.cs | 0 .../Model/TerminalApi/ReversalRequest.cs | 0 .../Model/TerminalApi/ReversalResponse.cs | 0 Adyen/{ => src}/Model/TerminalApi/SaleData.cs | 0 Adyen/{ => src}/Model/TerminalApi/SaleItem.cs | 0 .../Model/TerminalApi/SaleItemRebate.cs | 0 .../Model/TerminalApi/SaleProfile.cs | 0 .../Model/TerminalApi/SaleSoftware.cs | 0 .../Model/TerminalApi/SaleTerminalData.cs | 0 .../Model/TerminalApi/SaleToIssuerData.cs | 0 .../Model/TerminalApi/SaleToPOIMessage.cs | 0 .../Model/TerminalApi/SaleToPOIResponse.cs | 0 .../Model/TerminalApi/SensitiveCardData.cs | 0 .../Model/TerminalApi/SensitiveMobileData.cs | 0 .../Model/TerminalApi/SignaturePoint.cs | 0 .../{ => src}/Model/TerminalApi/SignedData.cs | 0 Adyen/{ => src}/Model/TerminalApi/Signer.cs | 0 .../Model/TerminalApi/SignerIdentifier.cs | 0 .../Model/TerminalApi/SoundActionType.cs | 0 .../Model/TerminalApi/SoundContent.cs | 0 .../Model/TerminalApi/SoundFormatType.cs | 0 .../Model/TerminalApi/SoundRequest.cs | 0 .../Model/TerminalApi/SoundResponse.cs | 0 .../Model/TerminalApi/SponsoredMerchant.cs | 0 .../Model/TerminalApi/StoredValueAccountID.cs | 0 .../TerminalApi/StoredValueAccountStatus.cs | 0 .../TerminalApi/StoredValueAccountType.cs | 0 .../Model/TerminalApi/StoredValueData.cs | 0 .../Model/TerminalApi/StoredValueRequest.cs | 0 .../Model/TerminalApi/StoredValueResponse.cs | 0 .../Model/TerminalApi/StoredValueResult.cs | 0 .../TerminalApi/StoredValueTransactionType.cs | 0 .../TerminalApi/TerminalEnvironmentType.cs | 0 .../Model/TerminalApi/TokenRequestedType.cs | 0 .../Model/TerminalApi/TotalDetailsType.cs | 0 .../Model/TerminalApi/TotalFilter.cs | 0 .../{ => src}/Model/TerminalApi/TrackData.cs | 0 .../Model/TerminalApi/TrackFormatType.cs | 0 .../TerminalApi/TransactionActionType.cs | 0 .../TerminalApi/TransactionConditions.cs | 0 .../TerminalApi/TransactionIdentification.cs | 0 .../TerminalApi/TransactionStatusRequest.cs | 0 .../TerminalApi/TransactionStatusResponse.cs | 0 .../Model/TerminalApi/TransactionToPerform.cs | 0 .../Model/TerminalApi/TransactionTotals.cs | 0 .../Model/TerminalApi/TransactionType.cs | 0 .../Model/TerminalApi/TransmitRequest.cs | 0 .../Model/TerminalApi/TransmitResponse.cs | 0 .../Model/TerminalApi/UTMCoordinates.cs | 0 .../Model/TerminalApi/UnitOfMeasureType.cs | 0 .../Model/TerminalApi/VersionType.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../Model/TransactionWebhooks/Amount.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../TransactionWebhooks/BankCategoryData.cs | 0 .../InternalCategoryData.cs | 0 .../Model/TransactionWebhooks/IssuedCard.cs | 0 .../TransactionWebhooks/PaymentInstrument.cs | 0 .../TransactionWebhooks/PlatformPayment.cs | 0 .../RelayedAuthorisationData.cs | 0 .../Model/TransactionWebhooks/Resource.cs | 0 .../TransactionWebhooks/ResourceReference.cs | 0 .../Model/TransactionWebhooks/ThreeDSecure.cs | 0 .../Model/TransactionWebhooks/Transaction.cs | 0 .../TransactionNotificationRequestV4.cs | 0 .../TransferNotificationValidationFact.cs | 0 .../Model/TransactionWebhooks/TransferView.cs | 0 .../TransferViewCategoryData.cs | 0 .../AULocalAccountIdentification.cs | 0 .../TransferWebhooks/AbstractOpenAPISchema.cs | 0 .../AdditionalBankIdentification.cs | 0 .../Model/TransferWebhooks/Address.cs | 0 .../Model/TransferWebhooks/Airline.cs | 0 .../Model/TransferWebhooks/Amount.cs | 0 .../TransferWebhooks/AmountAdjustment.cs | 0 .../BRLocalAccountIdentification.cs | 0 .../Model/TransferWebhooks/BalanceMutation.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../Model/TransferWebhooks/BankAccountV3.cs | 0 .../BankAccountV3AccountIdentification.cs | 0 .../TransferWebhooks/BankCategoryData.cs | 0 .../CALocalAccountIdentification.cs | 0 .../CZLocalAccountIdentification.cs | 0 .../{ => src}/Model/TransferWebhooks/Card.cs | 0 .../TransferWebhooks/CardIdentification.cs | 0 .../ConfirmationTrackingData.cs | 0 .../Model/TransferWebhooks/CounterpartyV3.cs | 0 .../DKLocalAccountIdentification.cs | 0 .../DirectDebitInformation.cs | 0 .../EstimationTrackingData.cs | 0 .../Model/TransferWebhooks/ExternalReason.cs | 0 .../HKLocalAccountIdentification.cs | 0 .../HULocalAccountIdentification.cs | 0 .../IbanAccountIdentification.cs | 0 .../TransferWebhooks/InternalCategoryData.cs | 0 .../InternalReviewTrackingData.cs | 0 .../Model/TransferWebhooks/IssuedCard.cs | 0 .../IssuingTransactionData.cs | 0 Adyen/{ => src}/Model/TransferWebhooks/Leg.cs | 0 .../Model/TransferWebhooks/Lodging.cs | 0 .../Model/TransferWebhooks/MerchantData.cs | 0 .../TransferWebhooks/MerchantPurchaseData.cs | 0 .../Model/TransferWebhooks/Modification.cs | 0 .../NOLocalAccountIdentification.cs | 0 .../NZLocalAccountIdentification.cs | 0 .../Model/TransferWebhooks/NameLocation.cs | 0 .../NumberAndBicAccountIdentification.cs | 0 .../PLLocalAccountIdentification.cs | 0 .../TransferWebhooks/PartyIdentification.cs | 0 .../TransferWebhooks/PaymentInstrument.cs | 0 .../Model/TransferWebhooks/PlatformPayment.cs | 0 .../RelayedAuthorisationData.cs | 0 .../Model/TransferWebhooks/Resource.cs | 0 .../TransferWebhooks/ResourceReference.cs | 0 .../SELocalAccountIdentification.cs | 0 .../SGLocalAccountIdentification.cs | 0 .../TransactionEventViolation.cs | 0 .../TransactionRuleReference.cs | 0 .../TransferWebhooks/TransactionRuleSource.cs | 0 .../TransactionRulesResult.cs | 0 .../Model/TransferWebhooks/TransferData.cs | 0 .../TransferDataCategoryData.cs | 0 .../TransferWebhooks/TransferDataTracking.cs | 0 .../Model/TransferWebhooks/TransferEvent.cs | 0 .../TransferEventEventsDataInner.cs | 0 .../TransferEventTrackingData.cs | 0 .../TransferNotificationCounterParty.cs | 0 .../TransferNotificationMerchantData.cs | 0 .../TransferNotificationRequest.cs | 0 .../TransferNotificationValidationFact.cs | 0 .../Model/TransferWebhooks/TransferReview.cs | 0 .../UKLocalAccountIdentification.cs | 0 .../USLocalAccountIdentification.cs | 0 .../Transfers/AULocalAccountIdentification.cs | 0 .../Model/Transfers/AbstractOpenAPISchema.cs | 0 .../Transfers/AdditionalBankIdentification.cs | 0 Adyen/{ => src}/Model/Transfers/Address.cs | 0 Adyen/{ => src}/Model/Transfers/Airline.cs | 0 Adyen/{ => src}/Model/Transfers/Amount.cs | 0 .../Model/Transfers/AmountAdjustment.cs | 0 .../Transfers/ApproveTransfersRequest.cs | 0 .../Transfers/BRLocalAccountIdentification.cs | 0 .../Model/Transfers/BalanceMutation.cs | 0 .../Model/Transfers/BankAccountV3.cs | 0 .../BankAccountV3AccountIdentification.cs | 0 .../Model/Transfers/BankCategoryData.cs | 0 .../Transfers/CALocalAccountIdentification.cs | 0 .../Transfers/CZLocalAccountIdentification.cs | 0 .../Model/Transfers/CancelTransfersRequest.cs | 0 .../Model/Transfers/CapitalBalance.cs | 0 .../{ => src}/Model/Transfers/CapitalGrant.cs | 0 .../Model/Transfers/CapitalGrantInfo.cs | 0 .../Model/Transfers/CapitalGrants.cs | 0 Adyen/{ => src}/Model/Transfers/Card.cs | 0 .../Model/Transfers/CardIdentification.cs | 0 .../Transfers/ConfirmationTrackingData.cs | 0 .../{ => src}/Model/Transfers/Counterparty.cs | 0 .../Model/Transfers/CounterpartyInfoV3.cs | 0 .../Model/Transfers/CounterpartyV3.cs | 0 .../Transfers/DKLocalAccountIdentification.cs | 0 .../Model/Transfers/DirectDebitInformation.cs | 0 .../Model/Transfers/EstimationTrackingData.cs | 0 .../Model/Transfers/ExternalReason.cs | 0 Adyen/{ => src}/Model/Transfers/Fee.cs | 0 .../Model/Transfers/FindTransfersResponse.cs | 0 .../Transfers/HKLocalAccountIdentification.cs | 0 .../Transfers/HULocalAccountIdentification.cs | 0 .../Transfers/IbanAccountIdentification.cs | 0 .../Model/Transfers/InternalCategoryData.cs | 0 .../Transfers/InternalReviewTrackingData.cs | 0 .../{ => src}/Model/Transfers/InvalidField.cs | 0 Adyen/{ => src}/Model/Transfers/IssuedCard.cs | 0 .../Model/Transfers/IssuingTransactionData.cs | 0 Adyen/{ => src}/Model/Transfers/Leg.cs | 0 Adyen/{ => src}/Model/Transfers/Link.cs | 0 Adyen/{ => src}/Model/Transfers/Links.cs | 0 Adyen/{ => src}/Model/Transfers/Lodging.cs | 0 .../{ => src}/Model/Transfers/MerchantData.cs | 0 .../Model/Transfers/MerchantPurchaseData.cs | 0 .../{ => src}/Model/Transfers/Modification.cs | 0 .../Transfers/NOLocalAccountIdentification.cs | 0 .../Transfers/NZLocalAccountIdentification.cs | 0 .../{ => src}/Model/Transfers/NameLocation.cs | 0 .../NumberAndBicAccountIdentification.cs | 0 .../Transfers/PLLocalAccountIdentification.cs | 0 .../Model/Transfers/PartyIdentification.cs | 0 .../Model/Transfers/PaymentInstrument.cs | 0 .../Model/Transfers/PlatformPayment.cs | 0 .../Transfers/RelayedAuthorisationData.cs | 0 Adyen/{ => src}/Model/Transfers/Repayment.cs | 0 .../Model/Transfers/RepaymentTerm.cs | 0 .../Model/Transfers/ResourceReference.cs | 0 .../Model/Transfers/RestServiceError.cs | 0 .../Model/Transfers/ReturnTransferRequest.cs | 0 .../Model/Transfers/ReturnTransferResponse.cs | 0 .../Model/Transfers/RoutingDetails.cs | 0 .../Transfers/SELocalAccountIdentification.cs | 0 .../Transfers/SGLocalAccountIdentification.cs | 0 .../{ => src}/Model/Transfers/ServiceError.cs | 0 .../Model/Transfers/ThresholdRepayment.cs | 0 .../{ => src}/Model/Transfers/Transaction.cs | 0 .../Transfers/TransactionEventViolation.cs | 0 .../Transfers/TransactionRuleReference.cs | 0 .../Model/Transfers/TransactionRuleSource.cs | 0 .../Model/Transfers/TransactionRulesResult.cs | 0 .../Transfers/TransactionSearchResponse.cs | 0 Adyen/{ => src}/Model/Transfers/Transfer.cs | 0 .../Model/Transfers/TransferCategoryData.cs | 0 .../{ => src}/Model/Transfers/TransferData.cs | 0 .../Model/Transfers/TransferDataTracking.cs | 0 .../Model/Transfers/TransferEvent.cs | 0 .../Transfers/TransferEventEventsDataInner.cs | 0 .../Transfers/TransferEventTrackingData.cs | 0 .../{ => src}/Model/Transfers/TransferInfo.cs | 0 .../TransferNotificationCounterParty.cs | 0 .../TransferNotificationMerchantData.cs | 0 .../TransferNotificationValidationFact.cs | 0 .../Model/Transfers/TransferRequestReview.cs | 0 .../Model/Transfers/TransferReview.cs | 0 .../TransferServiceRestServiceError.cs | 0 .../{ => src}/Model/Transfers/TransferView.cs | 0 .../Transfers/UKLocalAccountIdentification.cs | 0 .../Transfers/USLocalAccountIdentification.cs | 0 .../Transfers/UltimatePartyIdentification.cs | 0 Adyen/{ => src}/Security/AesEncryptor.cs | 0 .../Security/EncryptionCredentialDetails.cs | 0 .../Security/EncryptionDerivedKey.cs | 0 .../Security/EncryptionDerivedKeyGenerator.cs | 0 .../Exceptions/NexoCryptoException.cs | 0 .../Security/Extension/ArrayExtension.cs | 0 Adyen/{ => src}/Security/HmacSha256Wrapper.cs | 0 Adyen/{ => src}/Security/IvModGenerator.cs | 0 .../Security/SaleToPoiMessageSecured.cs | 0 .../SaleToPoiMessageSecuredEncryptor.cs | 0 Adyen/{ => src}/Security/SecurityTrailer.cs | 0 .../Security/TerminalCommonNameValidator.cs | 0 Adyen/{ => src}/Service/AbstractService.cs | 262 ++++++++-------- Adyen/{ => src}/Service/ApiException.cs | 36 +-- .../Service/BalanceControlService.cs | 0 .../BalancePlatform/AccountHoldersService.cs | 0 .../BalancePlatform/BalanceAccountsService.cs | 0 .../BankAccountValidationService.cs | 0 .../BalancePlatform/CardOrdersService.cs | 0 .../BalancePlatform/GrantAccountsService.cs | 0 .../BalancePlatform/GrantOffersService.cs | 0 .../BalancePlatform/ManageCardPINService.cs | 0 .../ManageSCADevicesService.cs | 0 .../BalancePlatform/NetworkTokensService.cs | 0 .../PaymentInstrumentGroupsService.cs | 0 .../PaymentInstrumentsService.cs | 0 .../BalancePlatform/PlatformService.cs | 0 .../TransactionRulesService.cs | 0 .../BalancePlatform/TransferRoutesService.cs | 0 Adyen/{ => src}/Service/BinLookupService.cs | 0 .../Service/Checkout/DonationsService.cs | 0 .../Service/Checkout/ModificationsService.cs | 0 .../Service/Checkout/OrdersService.cs | 0 .../Service/Checkout/PaymentLinksService.cs | 0 .../Service/Checkout/PaymentsService.cs | 0 .../Service/Checkout/RecurringService.cs | 0 .../Service/Checkout/UtilityService.cs | 0 .../Service/DataProtectionService.cs | 0 Adyen/{ => src}/Service/DisputesService.cs | 0 .../BusinessLinesService.cs | 0 .../LegalEntityManagement/DocumentsService.cs | 0 .../HostedOnboardingService.cs | 0 .../LegalEntitiesService.cs | 0 .../PCIQuestionnairesService.cs | 0 .../TaxEDeliveryConsentService.cs | 0 .../TermsOfServiceService.cs | 0 .../TransferInstrumentsService.cs | 0 .../APICredentialsCompanyLevelService.cs | 0 .../APICredentialsMerchantLevelService.cs | 0 .../Management/APIKeyCompanyLevelService.cs | 0 .../Management/APIKeyMerchantLevelService.cs | 0 .../Management/AccountCompanyLevelService.cs | 0 .../Management/AccountMerchantLevelService.cs | 0 .../Management/AccountStoreLevelService.cs | 0 .../AllowedOriginsCompanyLevelService.cs | 0 .../AllowedOriginsMerchantLevelService.cs | 0 .../AndroidFilesCompanyLevelService.cs | 0 .../ClientKeyCompanyLevelService.cs | 0 .../ClientKeyMerchantLevelService.cs | 0 .../Management/MyAPICredentialService.cs | 0 .../PaymentMethodsMerchantLevelService.cs | 0 .../PayoutSettingsMerchantLevelService.cs | 0 .../SplitConfigurationMerchantLevelService.cs | 0 .../TerminalActionsCompanyLevelService.cs | 0 .../TerminalActionsTerminalLevelService.cs | 0 .../TerminalOrdersCompanyLevelService.cs | 0 .../TerminalOrdersMerchantLevelService.cs | 0 .../TerminalSettingsCompanyLevelService.cs | 0 .../TerminalSettingsMerchantLevelService.cs | 0 .../TerminalSettingsStoreLevelService.cs | 0 .../TerminalSettingsTerminalLevelService.cs | 0 .../TerminalsTerminalLevelService.cs | 0 .../Management/UsersCompanyLevelService.cs | 0 .../Management/UsersMerchantLevelService.cs | 0 .../Management/WebhooksCompanyLevelService.cs | 0 .../WebhooksMerchantLevelService.cs | 0 Adyen/{ => src}/Service/PaymentService.cs | 0 Adyen/{ => src}/Service/PaymentsAppService.cs | 0 .../Service/Payout/InitializationService.cs | 0 .../Service/Payout/InstantPayoutsService.cs | 0 .../Service/Payout/ReviewingService.cs | 0 .../PlatformsAccount/AccountHoldersService.cs | 0 .../PlatformsAccount/AccountsService.cs | 0 .../PlatformsAccount/VerificationService.cs | 0 .../{ => src}/Service/PlatformsFundService.cs | 0 .../HostedOnboardingPageService.cs | 0 .../PCIComplianceQuestionnairePageService.cs | 0 ...atformsNotificationConfigurationService.cs | 0 Adyen/{ => src}/Service/PosMobileService.cs | 0 .../Service/PosTerminalManagementService.cs | 0 Adyen/{ => src}/Service/RecurringService.cs | 0 .../Service/Resource/Terminal/TerminalApi.cs | 0 .../Terminal/TerminalApiAsyncClient.cs | 0 .../Resource/Terminal/TerminalApiLocal.cs | 0 .../Terminal/TerminalApiLocalClient.cs | 0 .../Terminal/TerminalApiSyncClient.cs | 0 Adyen/{ => src}/Service/ServiceResource.cs | 90 +++--- Adyen/{ => src}/Service/StoredValueService.cs | 0 .../Service/TerminalApiAsyncService.cs | 0 .../Service/TerminalApiLocalService.cs | 0 .../Service/TerminalApiSyncService.cs | 0 Adyen/{ => src}/Service/TerminalCloudApi.cs | 0 Adyen/{ => src}/Service/TerminalLocalApi.cs | 0 .../Service/TerminalLocalApiUnencrypted.cs | 0 .../Service/Transfers/CapitalService.cs | 0 .../Service/Transfers/TransactionsService.cs | 0 .../Service/Transfers/TransfersService.cs | 0 Adyen/{ => src}/Util/ByteArrayConverter.cs | 0 Adyen/{ => src}/Util/HMACValidator.cs | 246 +++++++-------- Adyen/{ => src}/Util/JsonOperation.cs | 64 ++-- .../Util/TerminalApi/AdditionalResponse.cs | 0 .../Util/TerminalApi/CardAcquisitionUtil.cs | 0 Adyen/{ => src}/Util/Util.cs | 30 +- .../Webhooks/BalancePlatformWebhookHandler.cs | 0 .../Webhooks/ClassicPlatformWebhookHandler.cs | 0 .../Webhooks/ManagementWebhookHandler.cs | 0 Adyen/{ => src}/Webhooks/WebhookHandler.cs | 0 1760 files changed, 722 insertions(+), 723 deletions(-) rename Adyen/{ => src}/ApiSerialization/Converter/JsonBase64Converter.cs (100%) rename Adyen/{ => src}/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs (100%) rename Adyen/{ => src}/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs (100%) rename Adyen/{ => src}/ApiSerialization/Converter/SaleToPoiMessageConverter.cs (100%) rename Adyen/{ => src}/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs (100%) rename Adyen/{ => src}/ApiSerialization/IMessagePayload.cs (100%) rename Adyen/{ => src}/ApiSerialization/IMessagePayloadSerializer.cs (100%) rename Adyen/{ => src}/ApiSerialization/MessageHeaderSerializer.cs (100%) rename Adyen/{ => src}/ApiSerialization/MessagePayloadSerializer.cs (100%) rename Adyen/{ => src}/ApiSerialization/MessagePayloadSerializerFactory.cs (100%) rename Adyen/{ => src}/ApiSerialization/OpenAPIDateConverter.cs (100%) rename Adyen/{ => src}/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs (100%) rename Adyen/{ => src}/ApiSerialization/SaleToPoiMessageSerializer.cs (100%) rename Adyen/{ => src}/ApiSerialization/TypeHelper.cs (100%) rename Adyen/{ => src}/Constants/ApiConstants.cs (100%) rename Adyen/{ => src}/Constants/ClientConfig.cs (100%) rename Adyen/{ => src}/Constants/Region.cs (100%) rename Adyen/{ => src}/Exceptions/DeserializationException.cs (100%) rename Adyen/{ => src}/Exceptions/ExceptionMessages.cs (100%) rename Adyen/{ => src}/HttpClient/HttpClientException.cs (100%) rename Adyen/{ => src}/HttpClient/HttpClientExtension.cs (100%) rename Adyen/{ => src}/HttpClient/HttpClientWrapper.cs (100%) rename Adyen/{ => src}/HttpClient/Interfaces/IClient.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/AuthenticationDecision.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/AuthenticationInfo.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/AuthenticationNotificationData.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/AuthenticationNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/ChallengeInfo.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/Purchase.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/PurchaseInfo.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/RelayedAuthenticationRequest.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/RelayedAuthenticationResponse.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/Resource.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/ServiceError.cs (100%) rename Adyen/{ => src}/Model/ApiError.cs (97%) rename Adyen/{ => src}/Model/ApplicationInformation/ApplicationInfo.cs (100%) rename Adyen/{ => src}/Model/ApplicationInformation/CommonField.cs (100%) rename Adyen/{ => src}/Model/ApplicationInformation/ExternalPlatform.cs (100%) rename Adyen/{ => src}/Model/ApplicationInformation/MerchantDevice.cs (100%) rename Adyen/{ => src}/Model/ApplicationInformation/ShopperInteractionDevice.cs (100%) rename Adyen/{ => src}/Model/BalanceControl/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/BalanceControl/Amount.cs (100%) rename Adyen/{ => src}/Model/BalanceControl/BalanceTransferRequest.cs (100%) rename Adyen/{ => src}/Model/BalanceControl/BalanceTransferResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AccountHolder.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AccountHolderCapability.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AccountHolderInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AccountHolderUpdateRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AccountSupportingEntityCapability.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AdditionalBankIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Address.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AddressRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Amount.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AmountMinMaxRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AssociationFinaliseRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AssociationFinaliseResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AssociationInitiateRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AssociationInitiateResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Authentication.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BRLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Balance.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BalanceAccount.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BalanceAccountBase.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BalanceAccountInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BalanceAccountUpdateRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BalancePlatform.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccount.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccountAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccountDetails.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccountModel.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BrandVariantsRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BulkAddress.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CALocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CapabilityProblem.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CapabilityProblemEntity.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CapabilitySettings.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CapitalBalance.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CapitalGrantAccount.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Card.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CardConfiguration.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CardInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CardOrder.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CardOrderItem.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/ContactDetails.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Counterparty.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CounterpartyBankRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CounterpartyTypesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CountriesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CreateSweepConfigurationV2.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DayOfWeekRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DelegatedAuthenticationData.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DeliveryAddress.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DeliveryContact.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Device.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DeviceInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DifferentCurrenciesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Duration.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/EntryModesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Expiry.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Fee.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/GetNetworkTokenResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/GetTaxFormResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/GrantLimit.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/GrantOffer.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/GrantOffers.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/HKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/HULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Href.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/IbanAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/InternationalTransactionRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/InvalidField.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Link.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/ListNetworkTokensResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/MatchingTransactionsRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/MatchingValuesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/MccsRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/MerchantAcquirerPair.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/MerchantNamesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/MerchantsRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/NOLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/NZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Name.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/NetworkToken.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PLLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrument.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentGroup.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Phone.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PhoneNumber.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PinChangeRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PinChangeResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PlatformPaymentConfiguration.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/ProcessingTypesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PublicKeyResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RegisterSCAFinalResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RegisterSCARequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RegisterSCAResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RemediatingAction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Repayment.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RepaymentTerm.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RestServiceError.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RevealPinRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RevealPinResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RiskScores.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RiskScoresRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SELocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SGLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SameAmountRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SameCounterpartyRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SourceAccountTypesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/StringMatch.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SweepConfigurationV2.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SweepCounterparty.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SweepSchedule.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/ThresholdRepayment.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TimeOfDay.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TimeOfDayRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TokenRequestorsRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TotalAmountRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRule.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRuleEntityKey.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRuleInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRuleInterval.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRuleResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRuleRestrictions.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRulesResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransferRoute.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransferRouteRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransferRouteRequirementsInner.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransferRouteResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/UKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/USInternationalAchAddressRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/USLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/UpdateNetworkTokenRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/UpdatePaymentInstrument.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/UpdateSweepConfigurationV2.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/VerificationDeadline.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/VerificationError.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/VerificationErrorRecursive.cs (100%) rename Adyen/{ => src}/Model/BinLookup/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/BinLookup/Amount.cs (100%) rename Adyen/{ => src}/Model/BinLookup/BinDetail.cs (100%) rename Adyen/{ => src}/Model/BinLookup/CardBin.cs (100%) rename Adyen/{ => src}/Model/BinLookup/CostEstimateAssumptions.cs (100%) rename Adyen/{ => src}/Model/BinLookup/CostEstimateRequest.cs (100%) rename Adyen/{ => src}/Model/BinLookup/CostEstimateResponse.cs (100%) rename Adyen/{ => src}/Model/BinLookup/DSPublicKeyDetail.cs (100%) rename Adyen/{ => src}/Model/BinLookup/MerchantDetails.cs (100%) rename Adyen/{ => src}/Model/BinLookup/Recurring.cs (100%) rename Adyen/{ => src}/Model/BinLookup/ServiceError.cs (100%) rename Adyen/{ => src}/Model/BinLookup/ThreeDS2CardRangeDetail.cs (100%) rename Adyen/{ => src}/Model/BinLookup/ThreeDSAvailabilityRequest.cs (100%) rename Adyen/{ => src}/Model/BinLookup/ThreeDSAvailabilityResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Checkout/AccountInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/AcctInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/AchDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalData3DSecure.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataAirline.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataCarRental.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataCommon.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataLevel23.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataLodging.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataOpenInvoice.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataOpi.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataRatepay.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataRetry.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataRisk.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataRiskStandalone.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataSubMerchant.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataTemporaryServices.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataWallets.cs (100%) rename Adyen/{ => src}/Model/Checkout/Address.cs (100%) rename Adyen/{ => src}/Model/Checkout/AffirmDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/AfterpayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Agency.cs (100%) rename Adyen/{ => src}/Model/Checkout/Airline.cs (100%) rename Adyen/{ => src}/Model/Checkout/AmazonPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Amount.cs (100%) rename Adyen/{ => src}/Model/Checkout/Amounts.cs (100%) rename Adyen/{ => src}/Model/Checkout/AncvDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/AndroidPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/ApplePayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/ApplePayDonations.cs (100%) rename Adyen/{ => src}/Model/Checkout/ApplePaySessionRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/ApplePaySessionResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/ApplicationInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/AuthenticationData.cs (100%) rename Adyen/{ => src}/Model/Checkout/BacsDirectDebitDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/BalanceCheckRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/BalanceCheckResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/BillDeskDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/BillingAddress.cs (100%) rename Adyen/{ => src}/Model/Checkout/BlikDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/BrowserInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/CancelOrderRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/CancelOrderResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/CardBrandDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/CardDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/CardDetailsRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/CardDetailsResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/CardDonations.cs (100%) rename Adyen/{ => src}/Model/Checkout/CashAppDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/CellulantDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutAwaitAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutBankAccount.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutBankTransferAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutNativeRedirectAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutOrderResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutPaymentMethod.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutQrCodeAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutRedirectAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutSDKAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutSessionInstallmentOption.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutThreeDS2Action.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutVoucherAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CommonField.cs (100%) rename Adyen/{ => src}/Model/Checkout/Company.cs (100%) rename Adyen/{ => src}/Model/Checkout/CreateCheckoutSessionRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/CreateCheckoutSessionResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/CreateOrderRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/CreateOrderResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/DeliveryAddress.cs (100%) rename Adyen/{ => src}/Model/Checkout/DeliveryMethod.cs (100%) rename Adyen/{ => src}/Model/Checkout/DetailsRequestAuthenticationData.cs (100%) rename Adyen/{ => src}/Model/Checkout/DeviceRenderOptions.cs (100%) rename Adyen/{ => src}/Model/Checkout/DokuDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Donation.cs (100%) rename Adyen/{ => src}/Model/Checkout/DonationCampaign.cs (100%) rename Adyen/{ => src}/Model/Checkout/DonationCampaignsRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/DonationCampaignsResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/DonationPaymentMethod.cs (100%) rename Adyen/{ => src}/Model/Checkout/DonationPaymentRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/DonationPaymentResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/DragonpayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/EBankingFinlandDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/EcontextVoucherDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/EftDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/EncryptedOrderData.cs (100%) rename Adyen/{ => src}/Model/Checkout/EnhancedSchemeData.cs (100%) rename Adyen/{ => src}/Model/Checkout/ExternalPlatform.cs (100%) rename Adyen/{ => src}/Model/Checkout/FastlaneDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/ForexQuote.cs (100%) rename Adyen/{ => src}/Model/Checkout/FraudCheckResult.cs (100%) rename Adyen/{ => src}/Model/Checkout/FraudResult.cs (100%) rename Adyen/{ => src}/Model/Checkout/FundOrigin.cs (100%) rename Adyen/{ => src}/Model/Checkout/FundRecipient.cs (100%) rename Adyen/{ => src}/Model/Checkout/GenericIssuerPaymentMethodDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/GooglePayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/GooglePayDonations.cs (100%) rename Adyen/{ => src}/Model/Checkout/IdealDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/IdealDonations.cs (100%) rename Adyen/{ => src}/Model/Checkout/InputDetail.cs (100%) rename Adyen/{ => src}/Model/Checkout/InstallmentOption.cs (100%) rename Adyen/{ => src}/Model/Checkout/Installments.cs (100%) rename Adyen/{ => src}/Model/Checkout/Item.cs (100%) rename Adyen/{ => src}/Model/Checkout/KlarnaDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Leg.cs (100%) rename Adyen/{ => src}/Model/Checkout/LineItem.cs (100%) rename Adyen/{ => src}/Model/Checkout/ListStoredPaymentMethodsResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/Mandate.cs (100%) rename Adyen/{ => src}/Model/Checkout/MasterpassDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/MbwayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/MerchantDevice.cs (100%) rename Adyen/{ => src}/Model/Checkout/MerchantRiskIndicator.cs (100%) rename Adyen/{ => src}/Model/Checkout/MobilePayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/MolPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Name.cs (100%) rename Adyen/{ => src}/Model/Checkout/OpenInvoiceDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Passenger.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayByBankAISDirectDebitDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayByBankDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayPalDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayToDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayUUpiDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayWithGoogleDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayWithGoogleDonations.cs (100%) rename Adyen/{ => src}/Model/Checkout/Payment.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentAmountUpdateRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentAmountUpdateResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentCancelRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentCancelResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentCaptureRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentCaptureResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentCompletionDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentDetailsRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentDetailsResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentLinkRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentLinkResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethod.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethodGroup.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethodIssuer.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethodToStore.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethodUPIApps.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethodsRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethodsResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentRefundRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentRefundResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentResponseAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentReversalRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentReversalResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaypalUpdateOrderRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaypalUpdateOrderResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/Phone.cs (100%) rename Adyen/{ => src}/Model/Checkout/PixDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PixRecurring.cs (100%) rename Adyen/{ => src}/Model/Checkout/PlatformChargebackLogic.cs (100%) rename Adyen/{ => src}/Model/Checkout/PseDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/RakutenPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/RatepayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Recurring.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalData3DSecure.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataBillingAddress.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataCard.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataCommon.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataDomesticError.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataInstallments.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataOpi.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataSepa.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponsePaymentMethod.cs (100%) rename Adyen/{ => src}/Model/Checkout/RiskData.cs (100%) rename Adyen/{ => src}/Model/Checkout/RivertyDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/SDKEphemPubKey.cs (100%) rename Adyen/{ => src}/Model/Checkout/SamsungPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/SepaDirectDebitDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/ServiceError.cs (100%) rename Adyen/{ => src}/Model/Checkout/SessionResultResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/ShopperInteractionDevice.cs (100%) rename Adyen/{ => src}/Model/Checkout/Split.cs (100%) rename Adyen/{ => src}/Model/Checkout/SplitAmount.cs (100%) rename Adyen/{ => src}/Model/Checkout/StandalonePaymentCancelRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/StandalonePaymentCancelResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/StoredPaymentMethod.cs (100%) rename Adyen/{ => src}/Model/Checkout/StoredPaymentMethodDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/StoredPaymentMethodRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/StoredPaymentMethodResource.cs (100%) rename Adyen/{ => src}/Model/Checkout/SubInputDetail.cs (100%) rename Adyen/{ => src}/Model/Checkout/SubMerchant.cs (100%) rename Adyen/{ => src}/Model/Checkout/SubMerchantInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/Surcharge.cs (100%) rename Adyen/{ => src}/Model/Checkout/TaxTotal.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDS2RequestData.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDS2RequestFields.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDS2ResponseData.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDS2Result.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDSRequestData.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDSecureData.cs (100%) rename Adyen/{ => src}/Model/Checkout/Ticket.cs (100%) rename Adyen/{ => src}/Model/Checkout/TravelAgency.cs (100%) rename Adyen/{ => src}/Model/Checkout/TwintDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/UpdatePaymentLinkRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/UpiCollectDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/UpiIntentDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/UtilityRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/UtilityResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/VippsDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/VisaCheckoutDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/WeChatPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/WeChatPayMiniProgramDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/ZipDetails.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/AccountHolder.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/AccountHolderCapability.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Address.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Authentication.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Balance.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/BalanceAccount.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/BankAccountDetails.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/BulkAddress.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CapabilityProblem.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CapabilitySettings.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Card.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CardConfiguration.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CardOrderItem.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/ContactDetails.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/DeliveryAddress.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/DeliveryContact.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Device.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Expiry.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/IbanAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Name.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/PaymentInstrument.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Phone.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/PhoneNumber.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/RemediatingAction.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Resource.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/SweepConfigurationV2.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/SweepCounterparty.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/SweepSchedule.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/TokenAuthentication.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/ValidationFacts.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/VerificationDeadline.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/VerificationError.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Wallet.cs (100%) rename Adyen/{ => src}/Model/DataProtection/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/DataProtection/ServiceError.cs (100%) rename Adyen/{ => src}/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs (100%) rename Adyen/{ => src}/Model/DataProtection/SubjectErasureResponse.cs (100%) rename Adyen/{ => src}/Model/DisputeWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/DisputeWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/DisputeWebhooks/DisputeEventNotification.cs (100%) rename Adyen/{ => src}/Model/DisputeWebhooks/DisputeNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/Disputes/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Disputes/AcceptDisputeRequest.cs (100%) rename Adyen/{ => src}/Model/Disputes/AcceptDisputeResponse.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefendDisputeRequest.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefendDisputeResponse.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefenseDocument.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefenseDocumentType.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefenseReason.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefenseReasonsRequest.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefenseReasonsResponse.cs (100%) rename Adyen/{ => src}/Model/Disputes/DeleteDefenseDocumentRequest.cs (100%) rename Adyen/{ => src}/Model/Disputes/DeleteDefenseDocumentResponse.cs (100%) rename Adyen/{ => src}/Model/Disputes/DisputeServiceResult.cs (100%) rename Adyen/{ => src}/Model/Disputes/ServiceError.cs (100%) rename Adyen/{ => src}/Model/Disputes/SupplyDefenseDocumentRequest.cs (100%) rename Adyen/{ => src}/Model/Disputes/SupplyDefenseDocumentResponse.cs (100%) rename Adyen/{ => src}/Model/Environment.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/AULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/AdditionalBankIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Address.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Amount.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Attachment.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BankAccountInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BirthData.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BusinessLine.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BusinessLineInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BusinessLines.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CALocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CalculatePciStatusRequest.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CalculatePciStatusResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CapabilityProblem.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CapabilityProblemEntity.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CapabilitySettings.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/DKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Document.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/DocumentPage.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/DocumentReference.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/EntityReference.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/FinancialReport.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/HKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/HULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/IbanAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/IdentificationData.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Individual.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/LegalEntity.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/LegalEntityAssociation.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/LegalEntityCapability.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/LegalEntityInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/NOLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/NZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Name.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/OnboardingLink.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/OnboardingLinkInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/OnboardingLinkSettings.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/OnboardingTheme.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/OnboardingThemes.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Organization.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/OwnerEntity.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/PLLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/PciDocumentInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/PciSigningRequest.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/PciSigningResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/PhoneNumber.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/RemediatingAction.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/SELocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/SGLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/ServiceError.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/SoleProprietorship.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/SourceOfFunds.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/StockData.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/SupportingEntityCapability.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/TaxInformation.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/TaxReportingClassification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/TransferInstrument.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/TransferInstrumentInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/TransferInstrumentReference.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Trust.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/UKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/USLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/UndefinedBeneficiary.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/UnincorporatedPartnership.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/VerificationDeadline.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/VerificationError.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/VerificationErrorRecursive.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/VerificationErrors.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/WebData.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/WebDataExemption.cs (100%) rename Adyen/{ => src}/Model/Management/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Management/AccelInfo.cs (100%) rename Adyen/{ => src}/Model/Management/AdditionalCommission.cs (100%) rename Adyen/{ => src}/Model/Management/AdditionalSettings.cs (100%) rename Adyen/{ => src}/Model/Management/AdditionalSettingsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Address.cs (100%) rename Adyen/{ => src}/Model/Management/AffirmInfo.cs (100%) rename Adyen/{ => src}/Model/Management/AfterpayTouchInfo.cs (100%) rename Adyen/{ => src}/Model/Management/AllowedOrigin.cs (100%) rename Adyen/{ => src}/Model/Management/AllowedOriginsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/AmexInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Amount.cs (100%) rename Adyen/{ => src}/Model/Management/AndroidApp.cs (100%) rename Adyen/{ => src}/Model/Management/AndroidAppError.cs (100%) rename Adyen/{ => src}/Model/Management/AndroidAppsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/AndroidCertificate.cs (100%) rename Adyen/{ => src}/Model/Management/AndroidCertificatesResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ApiCredential.cs (100%) rename Adyen/{ => src}/Model/Management/ApiCredentialLinks.cs (100%) rename Adyen/{ => src}/Model/Management/ApplePayInfo.cs (100%) rename Adyen/{ => src}/Model/Management/BcmcInfo.cs (100%) rename Adyen/{ => src}/Model/Management/BillingEntitiesResponse.cs (100%) rename Adyen/{ => src}/Model/Management/BillingEntity.cs (100%) rename Adyen/{ => src}/Model/Management/CardholderReceipt.cs (100%) rename Adyen/{ => src}/Model/Management/CartesBancairesInfo.cs (100%) rename Adyen/{ => src}/Model/Management/ClearpayInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Commission.cs (100%) rename Adyen/{ => src}/Model/Management/Company.cs (100%) rename Adyen/{ => src}/Model/Management/CompanyApiCredential.cs (100%) rename Adyen/{ => src}/Model/Management/CompanyLinks.cs (100%) rename Adyen/{ => src}/Model/Management/CompanyUser.cs (100%) rename Adyen/{ => src}/Model/Management/Connectivity.cs (100%) rename Adyen/{ => src}/Model/Management/Contact.cs (100%) rename Adyen/{ => src}/Model/Management/CreateAllowedOriginRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateApiCredentialResponse.cs (100%) rename Adyen/{ => src}/Model/Management/CreateCompanyApiCredentialRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateCompanyApiCredentialResponse.cs (100%) rename Adyen/{ => src}/Model/Management/CreateCompanyUserRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateCompanyUserResponse.cs (100%) rename Adyen/{ => src}/Model/Management/CreateCompanyWebhookRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateMerchantApiCredentialRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateMerchantRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateMerchantResponse.cs (100%) rename Adyen/{ => src}/Model/Management/CreateMerchantUserRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateMerchantWebhookRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateUserResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Currency.cs (100%) rename Adyen/{ => src}/Model/Management/CustomNotification.cs (100%) rename Adyen/{ => src}/Model/Management/DataCenter.cs (100%) rename Adyen/{ => src}/Model/Management/DinersInfo.cs (100%) rename Adyen/{ => src}/Model/Management/EventUrl.cs (100%) rename Adyen/{ => src}/Model/Management/ExternalTerminalAction.cs (100%) rename Adyen/{ => src}/Model/Management/File.cs (100%) rename Adyen/{ => src}/Model/Management/GenerateApiKeyResponse.cs (100%) rename Adyen/{ => src}/Model/Management/GenerateClientKeyResponse.cs (100%) rename Adyen/{ => src}/Model/Management/GenerateHmacKeyResponse.cs (100%) rename Adyen/{ => src}/Model/Management/GenericPmWithTdiInfo.cs (100%) rename Adyen/{ => src}/Model/Management/GiroPayInfo.cs (100%) rename Adyen/{ => src}/Model/Management/GooglePayInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Gratuity.cs (100%) rename Adyen/{ => src}/Model/Management/Hardware.cs (100%) rename Adyen/{ => src}/Model/Management/IdName.cs (100%) rename Adyen/{ => src}/Model/Management/InstallAndroidAppDetails.cs (100%) rename Adyen/{ => src}/Model/Management/InstallAndroidCertificateDetails.cs (100%) rename Adyen/{ => src}/Model/Management/InvalidField.cs (100%) rename Adyen/{ => src}/Model/Management/JCBInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Key.cs (100%) rename Adyen/{ => src}/Model/Management/KlarnaInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Links.cs (100%) rename Adyen/{ => src}/Model/Management/LinksElement.cs (100%) rename Adyen/{ => src}/Model/Management/ListCompanyApiCredentialsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListCompanyResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListCompanyUsersResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListExternalTerminalActionsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListMerchantApiCredentialsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListMerchantResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListMerchantUsersResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListStoresResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListTerminalsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListWebhooksResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Localization.cs (100%) rename Adyen/{ => src}/Model/Management/Logo.cs (100%) rename Adyen/{ => src}/Model/Management/MeApiCredential.cs (100%) rename Adyen/{ => src}/Model/Management/MealVoucherFRInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Merchant.cs (100%) rename Adyen/{ => src}/Model/Management/MerchantLinks.cs (100%) rename Adyen/{ => src}/Model/Management/MinorUnitsMonetaryValue.cs (100%) rename Adyen/{ => src}/Model/Management/ModelConfiguration.cs (100%) rename Adyen/{ => src}/Model/Management/Name.cs (100%) rename Adyen/{ => src}/Model/Management/Name2.cs (100%) rename Adyen/{ => src}/Model/Management/Nexo.cs (100%) rename Adyen/{ => src}/Model/Management/Notification.cs (100%) rename Adyen/{ => src}/Model/Management/NotificationUrl.cs (100%) rename Adyen/{ => src}/Model/Management/NyceInfo.cs (100%) rename Adyen/{ => src}/Model/Management/OfflineProcessing.cs (100%) rename Adyen/{ => src}/Model/Management/Opi.cs (100%) rename Adyen/{ => src}/Model/Management/OrderItem.cs (100%) rename Adyen/{ => src}/Model/Management/PaginationLinks.cs (100%) rename Adyen/{ => src}/Model/Management/Passcodes.cs (100%) rename Adyen/{ => src}/Model/Management/PayAtTable.cs (100%) rename Adyen/{ => src}/Model/Management/PayMeInfo.cs (100%) rename Adyen/{ => src}/Model/Management/PayPalInfo.cs (100%) rename Adyen/{ => src}/Model/Management/PayToInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Payment.cs (100%) rename Adyen/{ => src}/Model/Management/PaymentMethod.cs (100%) rename Adyen/{ => src}/Model/Management/PaymentMethodResponse.cs (100%) rename Adyen/{ => src}/Model/Management/PaymentMethodSetupInfo.cs (100%) rename Adyen/{ => src}/Model/Management/PayoutSettings.cs (100%) rename Adyen/{ => src}/Model/Management/PayoutSettingsRequest.cs (100%) rename Adyen/{ => src}/Model/Management/PayoutSettingsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Profile.cs (100%) rename Adyen/{ => src}/Model/Management/PulseInfo.cs (100%) rename Adyen/{ => src}/Model/Management/ReceiptOptions.cs (100%) rename Adyen/{ => src}/Model/Management/ReceiptPrinting.cs (100%) rename Adyen/{ => src}/Model/Management/Referenced.cs (100%) rename Adyen/{ => src}/Model/Management/Refunds.cs (100%) rename Adyen/{ => src}/Model/Management/ReleaseUpdateDetails.cs (100%) rename Adyen/{ => src}/Model/Management/ReprocessAndroidAppResponse.cs (100%) rename Adyen/{ => src}/Model/Management/RequestActivationResponse.cs (100%) rename Adyen/{ => src}/Model/Management/RestServiceError.cs (100%) rename Adyen/{ => src}/Model/Management/ScheduleTerminalActionsRequest.cs (100%) rename Adyen/{ => src}/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs (100%) rename Adyen/{ => src}/Model/Management/ScheduleTerminalActionsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Settings.cs (100%) rename Adyen/{ => src}/Model/Management/ShippingLocation.cs (100%) rename Adyen/{ => src}/Model/Management/ShippingLocationsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Signature.cs (100%) rename Adyen/{ => src}/Model/Management/SodexoInfo.cs (100%) rename Adyen/{ => src}/Model/Management/SofortInfo.cs (100%) rename Adyen/{ => src}/Model/Management/SplitConfiguration.cs (100%) rename Adyen/{ => src}/Model/Management/SplitConfigurationList.cs (100%) rename Adyen/{ => src}/Model/Management/SplitConfigurationLogic.cs (100%) rename Adyen/{ => src}/Model/Management/SplitConfigurationRule.cs (100%) rename Adyen/{ => src}/Model/Management/Standalone.cs (100%) rename Adyen/{ => src}/Model/Management/StarInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Store.cs (100%) rename Adyen/{ => src}/Model/Management/StoreAndForward.cs (100%) rename Adyen/{ => src}/Model/Management/StoreCreationRequest.cs (100%) rename Adyen/{ => src}/Model/Management/StoreCreationWithMerchantCodeRequest.cs (100%) rename Adyen/{ => src}/Model/Management/StoreLocation.cs (100%) rename Adyen/{ => src}/Model/Management/StoreSplitConfiguration.cs (100%) rename Adyen/{ => src}/Model/Management/SupportedCardTypes.cs (100%) rename Adyen/{ => src}/Model/Management/Surcharge.cs (100%) rename Adyen/{ => src}/Model/Management/SwishInfo.cs (100%) rename Adyen/{ => src}/Model/Management/TapToPay.cs (100%) rename Adyen/{ => src}/Model/Management/Terminal.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalActionScheduleDetail.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalAssignment.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalConnectivity.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalConnectivityBluetooth.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalConnectivityCellular.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalConnectivityEthernet.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalConnectivityWifi.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalInstructions.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalModelsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalOrder.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalOrderRequest.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalOrdersResponse.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalProduct.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalProductPrice.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalProductsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalReassignmentRequest.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalReassignmentTarget.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalSettings.cs (100%) rename Adyen/{ => src}/Model/Management/TestCompanyWebhookRequest.cs (100%) rename Adyen/{ => src}/Model/Management/TestOutput.cs (100%) rename Adyen/{ => src}/Model/Management/TestWebhookRequest.cs (100%) rename Adyen/{ => src}/Model/Management/TestWebhookResponse.cs (100%) rename Adyen/{ => src}/Model/Management/TicketInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Timeouts.cs (100%) rename Adyen/{ => src}/Model/Management/TransactionDescriptionInfo.cs (100%) rename Adyen/{ => src}/Model/Management/TwintInfo.cs (100%) rename Adyen/{ => src}/Model/Management/UninstallAndroidAppDetails.cs (100%) rename Adyen/{ => src}/Model/Management/UninstallAndroidCertificateDetails.cs (100%) rename Adyen/{ => src}/Model/Management/UpdatableAddress.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateCompanyApiCredentialRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateCompanyUserRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateCompanyWebhookRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateMerchantApiCredentialRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateMerchantUserRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateMerchantWebhookRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdatePaymentMethodInfo.cs (100%) rename Adyen/{ => src}/Model/Management/UpdatePayoutSettingsRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateSplitConfigurationLogicRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateSplitConfigurationRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateSplitConfigurationRuleRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateStoreRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UploadAndroidAppResponse.cs (100%) rename Adyen/{ => src}/Model/Management/UploadAndroidCertificateResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Url.cs (100%) rename Adyen/{ => src}/Model/Management/User.cs (100%) rename Adyen/{ => src}/Model/Management/VippsInfo.cs (100%) rename Adyen/{ => src}/Model/Management/WeChatPayInfo.cs (100%) rename Adyen/{ => src}/Model/Management/WeChatPayPosInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Webhook.cs (100%) rename Adyen/{ => src}/Model/Management/WebhookLinks.cs (100%) rename Adyen/{ => src}/Model/Management/WifiProfiles.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/AccountCapabilityData.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/AccountCreateNotificationData.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/AccountNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/AccountUpdateNotificationData.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/CapabilityProblem.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/CapabilityProblemEntity.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/MidServiceNotificationData.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/RemediatingAction.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalBoardingData.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalSettingsData.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/VerificationError.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/VerificationErrorRecursive.cs (100%) rename Adyen/{ => src}/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/NegativeBalanceWarningWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs (100%) rename Adyen/{ => src}/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/NegativeBalanceWarningWebhooks/Resource.cs (100%) rename Adyen/{ => src}/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs (100%) rename Adyen/{ => src}/Model/Notification/NotificationRequest.cs (97%) rename Adyen/{ => src}/Model/Notification/NotificationRequestConst.cs (98%) rename Adyen/{ => src}/Model/Notification/NotificationRequestItem.cs (97%) rename Adyen/{ => src}/Model/Notification/NotificationRequestItemContainer.cs (97%) rename Adyen/{ => src}/Model/Payment/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Payment/AccountInfo.cs (100%) rename Adyen/{ => src}/Model/Payment/AcctInfo.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalData3DSecure.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataAirline.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataCarRental.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataCommon.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataLevel23.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataLodging.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataModifications.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataOpenInvoice.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataOpi.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataRatepay.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataRetry.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataRisk.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataRiskStandalone.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataSubMerchant.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataTemporaryServices.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataWallets.cs (100%) rename Adyen/{ => src}/Model/Payment/Address.cs (100%) rename Adyen/{ => src}/Model/Payment/AdjustAuthorisationRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/Amount.cs (100%) rename Adyen/{ => src}/Model/Payment/ApplicationInfo.cs (100%) rename Adyen/{ => src}/Model/Payment/AuthenticationResultRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/AuthenticationResultResponse.cs (100%) rename Adyen/{ => src}/Model/Payment/BankAccount.cs (100%) rename Adyen/{ => src}/Model/Payment/BrowserInfo.cs (100%) rename Adyen/{ => src}/Model/Payment/CancelOrRefundRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/CancelRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/CaptureRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/Card.cs (100%) rename Adyen/{ => src}/Model/Payment/CommonField.cs (100%) rename Adyen/{ => src}/Model/Payment/DeviceRenderOptions.cs (100%) rename Adyen/{ => src}/Model/Payment/DonationRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/ExternalPlatform.cs (100%) rename Adyen/{ => src}/Model/Payment/ForexQuote.cs (100%) rename Adyen/{ => src}/Model/Payment/FraudCheckResult.cs (100%) rename Adyen/{ => src}/Model/Payment/FraudCheckResultWrapper.cs (100%) rename Adyen/{ => src}/Model/Payment/FraudResult.cs (100%) rename Adyen/{ => src}/Model/Payment/FundDestination.cs (100%) rename Adyen/{ => src}/Model/Payment/FundSource.cs (100%) rename Adyen/{ => src}/Model/Payment/Installments.cs (100%) rename Adyen/{ => src}/Model/Payment/Mandate.cs (100%) rename Adyen/{ => src}/Model/Payment/MerchantDevice.cs (100%) rename Adyen/{ => src}/Model/Payment/MerchantRiskIndicator.cs (100%) rename Adyen/{ => src}/Model/Payment/ModificationResult.cs (100%) rename Adyen/{ => src}/Model/Payment/Name.cs (100%) rename Adyen/{ => src}/Model/Payment/PaymentRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/PaymentRequest3d.cs (100%) rename Adyen/{ => src}/Model/Payment/PaymentRequest3ds2.cs (100%) rename Adyen/{ => src}/Model/Payment/PaymentResult.cs (100%) rename Adyen/{ => src}/Model/Payment/Phone.cs (100%) rename Adyen/{ => src}/Model/Payment/PlatformChargebackLogic.cs (100%) rename Adyen/{ => src}/Model/Payment/Recurring.cs (100%) rename Adyen/{ => src}/Model/Payment/RefundRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalData3DSecure.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataBillingAddress.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataCard.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataCommon.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataDomesticError.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataInstallments.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataNetworkTokens.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataOpi.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataSepa.cs (100%) rename Adyen/{ => src}/Model/Payment/SDKEphemPubKey.cs (100%) rename Adyen/{ => src}/Model/Payment/SecureRemoteCommerceCheckoutData.cs (100%) rename Adyen/{ => src}/Model/Payment/ServiceError.cs (100%) rename Adyen/{ => src}/Model/Payment/ShopperInteractionDevice.cs (100%) rename Adyen/{ => src}/Model/Payment/Split.cs (100%) rename Adyen/{ => src}/Model/Payment/SplitAmount.cs (100%) rename Adyen/{ => src}/Model/Payment/SubMerchant.cs (100%) rename Adyen/{ => src}/Model/Payment/TechnicalCancelRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDS1Result.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDS2RequestData.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDS2Result.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDS2ResultRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDS2ResultResponse.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDSecureData.cs (100%) rename Adyen/{ => src}/Model/Payment/VoidPendingRefundRequest.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/BoardingTokenRequest.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/BoardingTokenResponse.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/DefaultErrorResponseEntity.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/InvalidField.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/PaymentsAppDto.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/PaymentsAppResponse.cs (100%) rename Adyen/{ => src}/Model/Payout/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Payout/Address.cs (100%) rename Adyen/{ => src}/Model/Payout/Amount.cs (100%) rename Adyen/{ => src}/Model/Payout/BankAccount.cs (100%) rename Adyen/{ => src}/Model/Payout/Card.cs (100%) rename Adyen/{ => src}/Model/Payout/FraudCheckResult.cs (100%) rename Adyen/{ => src}/Model/Payout/FraudCheckResultWrapper.cs (100%) rename Adyen/{ => src}/Model/Payout/FraudResult.cs (100%) rename Adyen/{ => src}/Model/Payout/FundSource.cs (100%) rename Adyen/{ => src}/Model/Payout/ModifyRequest.cs (100%) rename Adyen/{ => src}/Model/Payout/ModifyResponse.cs (100%) rename Adyen/{ => src}/Model/Payout/Name.cs (100%) rename Adyen/{ => src}/Model/Payout/PayoutRequest.cs (100%) rename Adyen/{ => src}/Model/Payout/PayoutResponse.cs (100%) rename Adyen/{ => src}/Model/Payout/Recurring.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalData3DSecure.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataBillingAddress.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataCard.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataCommon.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataDomesticError.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataInstallments.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataNetworkTokens.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataOpi.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataSepa.cs (100%) rename Adyen/{ => src}/Model/Payout/ServiceError.cs (100%) rename Adyen/{ => src}/Model/Payout/StoreDetailAndSubmitRequest.cs (100%) rename Adyen/{ => src}/Model/Payout/StoreDetailAndSubmitResponse.cs (100%) rename Adyen/{ => src}/Model/Payout/StoreDetailRequest.cs (100%) rename Adyen/{ => src}/Model/Payout/StoreDetailResponse.cs (100%) rename Adyen/{ => src}/Model/Payout/SubmitRequest.cs (100%) rename Adyen/{ => src}/Model/Payout/SubmitResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/Account.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/AccountEvent.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/AccountHolderDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/AccountHolderStatus.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/AccountPayoutState.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/AccountProcessingState.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/Amount.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/BankAccountDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/BusinessDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CloseAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CloseAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CloseAccountRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CloseAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CloseStoresRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CreateAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CreateAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CreateAccountRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CreateAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/DeleteBankAccountRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/DeletePayoutMethodRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/DeleteShareholderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/DeleteSignatoriesRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/DocumentDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ErrorFieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/FieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GenericResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetTaxFormRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetTaxFormResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/IndividualDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCCheckStatusData.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCCheckSummary.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCShareholderCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCSignatoryCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCVerificationResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/LegalArrangementDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/LegalArrangementEntityDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/LegalArrangementRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/MigratedAccounts.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/MigratedShareholders.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/MigratedStores.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/MigrationData.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/PayoutMethod.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/PayoutScheduleResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/PerformVerificationRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/PersonalDocumentData.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ServiceError.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ShareholderContact.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/SignatoryContact.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/StoreDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/SuspendAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/SuspendAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UltimateParentCompany.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UpdateAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UpdateAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UpdateAccountRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UpdateAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UploadDocumentRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ViasAddress.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ViasName.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ViasPersonalData.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ViasPhoneNumber.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AccountDetailBalance.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AccountHolderBalanceRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AccountHolderBalanceResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AccountHolderTransactionListRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AccountHolderTransactionListResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AccountTransactionList.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/Amount.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/BankAccountDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/DebitAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/DebitAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/DetailBalance.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/ErrorFieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/FieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/PayoutAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/PayoutAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/RefundFundsTransferRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/RefundFundsTransferResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/ServiceError.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/SetupBeneficiaryRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/SetupBeneficiaryResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/Split.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/SplitAmount.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/Transaction.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/TransactionListForAccount.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/TransferFundsRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/TransferFundsResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/CollectInformation.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/FieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/ServiceError.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/ShowPages.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/FieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/GenericResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/ServiceError.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountCloseNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountCreateNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountEvent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderStatus.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountPayoutState.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountProcessingState.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountUpdateNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/BankAccountDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/BusinessDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/CloseAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/CreateAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ErrorFieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/FieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/IndividualDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCCheckStatusData.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCCheckSummary.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCVerificationResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/LegalArrangementDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/LocalDate.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/Message.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/NotificationErrorContainer.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/NotificationResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/OperationStatus.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/PaymentFailureNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/PayoutMethod.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/PayoutScheduleResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/PersonalDocumentData.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/RefundResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ReportAvailableNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ShareholderContact.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/SignatoryContact.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/Split.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/SplitAmount.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/StoreDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/Transaction.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/TransferFundsNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/UltimateParentCompany.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/UpdateAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ViasAddress.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ViasName.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ViasPersonalData.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ViasPhoneNumber.cs (100%) rename Adyen/{ => src}/Model/PosMobile/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PosMobile/CreateSessionRequest.cs (100%) rename Adyen/{ => src}/Model/PosMobile/CreateSessionResponse.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/Address.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/AssignTerminalsRequest.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/AssignTerminalsResponse.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/FindTerminalRequest.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/FindTerminalResponse.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/MerchantAccount.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/ServiceError.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/Store.cs (100%) rename Adyen/{ => src}/Model/Recurring/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Recurring/Address.cs (100%) rename Adyen/{ => src}/Model/Recurring/Amount.cs (100%) rename Adyen/{ => src}/Model/Recurring/BankAccount.cs (100%) rename Adyen/{ => src}/Model/Recurring/Card.cs (100%) rename Adyen/{ => src}/Model/Recurring/CreatePermitRequest.cs (100%) rename Adyen/{ => src}/Model/Recurring/CreatePermitResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/DisablePermitRequest.cs (100%) rename Adyen/{ => src}/Model/Recurring/DisablePermitResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/DisableRequest.cs (100%) rename Adyen/{ => src}/Model/Recurring/DisableResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/Name.cs (100%) rename Adyen/{ => src}/Model/Recurring/NotifyShopperRequest.cs (100%) rename Adyen/{ => src}/Model/Recurring/NotifyShopperResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/Permit.cs (100%) rename Adyen/{ => src}/Model/Recurring/PermitRestriction.cs (100%) rename Adyen/{ => src}/Model/Recurring/PermitResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/Recurring.cs (100%) rename Adyen/{ => src}/Model/Recurring/RecurringDetail.cs (100%) rename Adyen/{ => src}/Model/Recurring/RecurringDetailWrapper.cs (100%) rename Adyen/{ => src}/Model/Recurring/RecurringDetailsRequest.cs (100%) rename Adyen/{ => src}/Model/Recurring/RecurringDetailsResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/ScheduleAccountUpdaterRequest.cs (100%) rename Adyen/{ => src}/Model/Recurring/ScheduleAccountUpdaterResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/ServiceError.cs (100%) rename Adyen/{ => src}/Model/Recurring/TokenDetails.cs (100%) rename Adyen/{ => src}/Model/ReportWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ReportWebhooks/ReportNotificationData.cs (100%) rename Adyen/{ => src}/Model/ReportWebhooks/ReportNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ReportWebhooks/Resource.cs (100%) rename Adyen/{ => src}/Model/ReportWebhooks/ResourceReference.cs (100%) rename Adyen/{ => src}/Model/RequestOptions.cs (100%) rename Adyen/{ => src}/Model/StoredValue/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/StoredValue/Amount.cs (100%) rename Adyen/{ => src}/Model/StoredValue/ServiceError.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueBalanceCheckRequest.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueBalanceCheckResponse.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueBalanceMergeRequest.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueBalanceMergeResponse.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueIssueRequest.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueIssueResponse.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueLoadRequest.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueLoadResponse.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueStatusChangeRequest.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueStatusChangeResponse.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueVoidRequest.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueVoidResponse.cs (100%) rename Adyen/{ => src}/Model/Terminal/SaleToAcquirerData.cs (100%) rename Adyen/{ => src}/Model/Terminal/Split.cs (100%) rename Adyen/{ => src}/Model/Terminal/SplitItem.cs (100%) rename Adyen/{ => src}/Model/Terminal/SplitItemType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AbortRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AccountType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AdminRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AdminResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AlgorithmIdentifier.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AlgorithmType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AlignmentType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AllowedProduct.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Amount.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AmountsReq.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AmountsResp.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AreaSize.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AuthenticatedData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AuthenticationMethodType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/BalanceInquiryRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/BalanceInquiryResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/BarcodeType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/BatchRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/BatchResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CapturedSignature.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardAcquisitionRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardAcquisitionResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardAcquisitionTransaction.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardReaderAPDURequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardReaderAPDUResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardReaderInitRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardReaderInitResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardReaderPowerOffRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardReaderPowerOffResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardholderPIN.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CashHandlingDevice.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CharacterHeightType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CharacterStyleType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CharacterWidthType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CheckData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CheckTypeCodeType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CoinsOrBills.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ColorType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ContentInformation.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ContentType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CurrencyConversion.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CustomerOrder.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CustomerOrderReqType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DeviceType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DiagnosisRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DiagnosisResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DigestedData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DisplayOutput.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DisplayRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DisplayResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DocumentQualifierType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EnableServiceRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EnableServiceResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EncapsulatedContent.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EncryptedContent.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EntryModeType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EnvelopedData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ErrorConditionType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EventNotification.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EventToNotifyType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ForceTypeModeType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/GenericProfileType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/GeographicCoordinates.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Geolocation.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/GetTotalsRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/GetTotalsResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/GlobalStatusType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/HostStatus.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ICCResetData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/IdentificationSupportType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/IdentificationType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InfoQualifyType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Input.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InputCommandType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InputData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InputRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InputResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InputResult.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InputUpdate.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Instalment.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/IssuerAndSerialNumber.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/KEK.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/KEKIdentifier.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/KeyTransport.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoginRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoginResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LogoutRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LogoutResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyAccount.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyAccountID.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyAccountReq.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyAccountStatus.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyAcquirerData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyAmount.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyHandlingType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyResult.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyTotals.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyTransaction.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyTransactionType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyUnitType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MenuEntry.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MenuEntryTagType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Message/SaleToPOIRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MessageCategoryType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MessageClassType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MessageHeader.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MessageReference.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MessageType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MobileData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/NamedKeyEncryptedData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/OriginalPOITransaction.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/OutputBarcode.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/OutputContent.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/OutputFormatType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/OutputResult.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/OutputText.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PINFormatType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PINRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PINRequestType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PINResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/POIData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/POIProfile.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/POISoftware.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/POIStatus.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/POISystemData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/POITerminalData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Parameter.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentAccountReq.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentAccountStatus.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentAcquirerData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentInstrumentData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentInstrumentType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentReceipt.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentResult.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentToken.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentTotals.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentTransaction.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PerformedTransaction.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PeriodUnitType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PredefinedContent.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PrintOutput.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PrintRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PrintResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PrinterStatusType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Rebates.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/RecipientIdentifier.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ReconciliationRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ReconciliationResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ReconciliationType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/RelativeDistinguishedName.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/RepeatedMessageResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/RepeatedResponseMessageBody.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Response.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ResponseModeType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ResultType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ReversalReasonType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ReversalRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ReversalResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleItem.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleItemRebate.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleProfile.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleSoftware.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleTerminalData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleToIssuerData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleToPOIMessage.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleToPOIResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SensitiveCardData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SensitiveMobileData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SignaturePoint.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SignedData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Signer.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SignerIdentifier.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SoundActionType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SoundContent.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SoundFormatType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SoundRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SoundResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SponsoredMerchant.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueAccountID.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueAccountStatus.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueAccountType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueResult.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueTransactionType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TerminalEnvironmentType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TokenRequestedType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TotalDetailsType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TotalFilter.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TrackData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TrackFormatType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionActionType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionConditions.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionIdentification.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionStatusRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionStatusResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionToPerform.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionTotals.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransmitRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransmitResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/UTMCoordinates.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/UnitOfMeasureType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/VersionType.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/BankCategoryData.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/InternalCategoryData.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/IssuedCard.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/PaymentInstrument.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/PlatformPayment.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/RelayedAuthorisationData.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/Resource.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/ResourceReference.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/ThreeDSecure.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/Transaction.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/TransferNotificationValidationFact.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/TransferView.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/TransferViewCategoryData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/AULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/AdditionalBankIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Address.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Airline.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/AmountAdjustment.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/BRLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/BalanceMutation.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/BankAccountV3.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/BankCategoryData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/CALocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/CZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Card.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/CardIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/ConfirmationTrackingData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/CounterpartyV3.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/DKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/DirectDebitInformation.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/EstimationTrackingData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/ExternalReason.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/HKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/HULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/IbanAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/InternalCategoryData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/InternalReviewTrackingData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/IssuedCard.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/IssuingTransactionData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Leg.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Lodging.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/MerchantData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/MerchantPurchaseData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Modification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/NOLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/NZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/NameLocation.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/PLLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/PartyIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/PaymentInstrument.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/PlatformPayment.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/RelayedAuthorisationData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Resource.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/ResourceReference.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/SELocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/SGLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransactionEventViolation.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransactionRuleReference.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransactionRuleSource.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransactionRulesResult.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferDataCategoryData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferDataTracking.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferEvent.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferEventEventsDataInner.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferEventTrackingData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferNotificationCounterParty.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferNotificationMerchantData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferNotificationValidationFact.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferReview.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/UKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/USLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/AULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Transfers/AdditionalBankIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/Address.cs (100%) rename Adyen/{ => src}/Model/Transfers/Airline.cs (100%) rename Adyen/{ => src}/Model/Transfers/Amount.cs (100%) rename Adyen/{ => src}/Model/Transfers/AmountAdjustment.cs (100%) rename Adyen/{ => src}/Model/Transfers/ApproveTransfersRequest.cs (100%) rename Adyen/{ => src}/Model/Transfers/BRLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/BalanceMutation.cs (100%) rename Adyen/{ => src}/Model/Transfers/BankAccountV3.cs (100%) rename Adyen/{ => src}/Model/Transfers/BankAccountV3AccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/BankCategoryData.cs (100%) rename Adyen/{ => src}/Model/Transfers/CALocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/CZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/CancelTransfersRequest.cs (100%) rename Adyen/{ => src}/Model/Transfers/CapitalBalance.cs (100%) rename Adyen/{ => src}/Model/Transfers/CapitalGrant.cs (100%) rename Adyen/{ => src}/Model/Transfers/CapitalGrantInfo.cs (100%) rename Adyen/{ => src}/Model/Transfers/CapitalGrants.cs (100%) rename Adyen/{ => src}/Model/Transfers/Card.cs (100%) rename Adyen/{ => src}/Model/Transfers/CardIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/ConfirmationTrackingData.cs (100%) rename Adyen/{ => src}/Model/Transfers/Counterparty.cs (100%) rename Adyen/{ => src}/Model/Transfers/CounterpartyInfoV3.cs (100%) rename Adyen/{ => src}/Model/Transfers/CounterpartyV3.cs (100%) rename Adyen/{ => src}/Model/Transfers/DKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/DirectDebitInformation.cs (100%) rename Adyen/{ => src}/Model/Transfers/EstimationTrackingData.cs (100%) rename Adyen/{ => src}/Model/Transfers/ExternalReason.cs (100%) rename Adyen/{ => src}/Model/Transfers/Fee.cs (100%) rename Adyen/{ => src}/Model/Transfers/FindTransfersResponse.cs (100%) rename Adyen/{ => src}/Model/Transfers/HKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/HULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/IbanAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/InternalCategoryData.cs (100%) rename Adyen/{ => src}/Model/Transfers/InternalReviewTrackingData.cs (100%) rename Adyen/{ => src}/Model/Transfers/InvalidField.cs (100%) rename Adyen/{ => src}/Model/Transfers/IssuedCard.cs (100%) rename Adyen/{ => src}/Model/Transfers/IssuingTransactionData.cs (100%) rename Adyen/{ => src}/Model/Transfers/Leg.cs (100%) rename Adyen/{ => src}/Model/Transfers/Link.cs (100%) rename Adyen/{ => src}/Model/Transfers/Links.cs (100%) rename Adyen/{ => src}/Model/Transfers/Lodging.cs (100%) rename Adyen/{ => src}/Model/Transfers/MerchantData.cs (100%) rename Adyen/{ => src}/Model/Transfers/MerchantPurchaseData.cs (100%) rename Adyen/{ => src}/Model/Transfers/Modification.cs (100%) rename Adyen/{ => src}/Model/Transfers/NOLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/NZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/NameLocation.cs (100%) rename Adyen/{ => src}/Model/Transfers/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/PLLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/PartyIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/PaymentInstrument.cs (100%) rename Adyen/{ => src}/Model/Transfers/PlatformPayment.cs (100%) rename Adyen/{ => src}/Model/Transfers/RelayedAuthorisationData.cs (100%) rename Adyen/{ => src}/Model/Transfers/Repayment.cs (100%) rename Adyen/{ => src}/Model/Transfers/RepaymentTerm.cs (100%) rename Adyen/{ => src}/Model/Transfers/ResourceReference.cs (100%) rename Adyen/{ => src}/Model/Transfers/RestServiceError.cs (100%) rename Adyen/{ => src}/Model/Transfers/ReturnTransferRequest.cs (100%) rename Adyen/{ => src}/Model/Transfers/ReturnTransferResponse.cs (100%) rename Adyen/{ => src}/Model/Transfers/RoutingDetails.cs (100%) rename Adyen/{ => src}/Model/Transfers/SELocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/SGLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/ServiceError.cs (100%) rename Adyen/{ => src}/Model/Transfers/ThresholdRepayment.cs (100%) rename Adyen/{ => src}/Model/Transfers/Transaction.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransactionEventViolation.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransactionRuleReference.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransactionRuleSource.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransactionRulesResult.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransactionSearchResponse.cs (100%) rename Adyen/{ => src}/Model/Transfers/Transfer.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferCategoryData.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferData.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferDataTracking.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferEvent.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferEventEventsDataInner.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferEventTrackingData.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferInfo.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferNotificationCounterParty.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferNotificationMerchantData.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferNotificationValidationFact.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferRequestReview.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferReview.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferServiceRestServiceError.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferView.cs (100%) rename Adyen/{ => src}/Model/Transfers/UKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/USLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/UltimatePartyIdentification.cs (100%) rename Adyen/{ => src}/Security/AesEncryptor.cs (100%) rename Adyen/{ => src}/Security/EncryptionCredentialDetails.cs (100%) rename Adyen/{ => src}/Security/EncryptionDerivedKey.cs (100%) rename Adyen/{ => src}/Security/EncryptionDerivedKeyGenerator.cs (100%) rename Adyen/{ => src}/Security/Exceptions/NexoCryptoException.cs (100%) rename Adyen/{ => src}/Security/Extension/ArrayExtension.cs (100%) rename Adyen/{ => src}/Security/HmacSha256Wrapper.cs (100%) rename Adyen/{ => src}/Security/IvModGenerator.cs (100%) rename Adyen/{ => src}/Security/SaleToPoiMessageSecured.cs (100%) rename Adyen/{ => src}/Security/SaleToPoiMessageSecuredEncryptor.cs (100%) rename Adyen/{ => src}/Security/SecurityTrailer.cs (100%) rename Adyen/{ => src}/Security/TerminalCommonNameValidator.cs (100%) rename Adyen/{ => src}/Service/AbstractService.cs (97%) rename Adyen/{ => src}/Service/ApiException.cs (95%) rename Adyen/{ => src}/Service/BalanceControlService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/AccountHoldersService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/BalanceAccountsService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/BankAccountValidationService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/CardOrdersService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/GrantAccountsService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/GrantOffersService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/ManageCardPINService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/ManageSCADevicesService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/NetworkTokensService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/PaymentInstrumentGroupsService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/PaymentInstrumentsService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/PlatformService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/TransactionRulesService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/TransferRoutesService.cs (100%) rename Adyen/{ => src}/Service/BinLookupService.cs (100%) rename Adyen/{ => src}/Service/Checkout/DonationsService.cs (100%) rename Adyen/{ => src}/Service/Checkout/ModificationsService.cs (100%) rename Adyen/{ => src}/Service/Checkout/OrdersService.cs (100%) rename Adyen/{ => src}/Service/Checkout/PaymentLinksService.cs (100%) rename Adyen/{ => src}/Service/Checkout/PaymentsService.cs (100%) rename Adyen/{ => src}/Service/Checkout/RecurringService.cs (100%) rename Adyen/{ => src}/Service/Checkout/UtilityService.cs (100%) rename Adyen/{ => src}/Service/DataProtectionService.cs (100%) rename Adyen/{ => src}/Service/DisputesService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/BusinessLinesService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/DocumentsService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/HostedOnboardingService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/LegalEntitiesService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/PCIQuestionnairesService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/TermsOfServiceService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/TransferInstrumentsService.cs (100%) rename Adyen/{ => src}/Service/Management/APICredentialsCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/APICredentialsMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/APIKeyCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/APIKeyMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/AccountCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/AccountMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/AccountStoreLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/AllowedOriginsCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/AllowedOriginsMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/AndroidFilesCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/ClientKeyCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/ClientKeyMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/MyAPICredentialService.cs (100%) rename Adyen/{ => src}/Service/Management/PaymentMethodsMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/PayoutSettingsMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/SplitConfigurationMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalActionsCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalActionsTerminalLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalOrdersCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalOrdersMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalSettingsCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalSettingsMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalSettingsStoreLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalSettingsTerminalLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalsTerminalLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/UsersCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/UsersMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/WebhooksCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/WebhooksMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/PaymentService.cs (100%) rename Adyen/{ => src}/Service/PaymentsAppService.cs (100%) rename Adyen/{ => src}/Service/Payout/InitializationService.cs (100%) rename Adyen/{ => src}/Service/Payout/InstantPayoutsService.cs (100%) rename Adyen/{ => src}/Service/Payout/ReviewingService.cs (100%) rename Adyen/{ => src}/Service/PlatformsAccount/AccountHoldersService.cs (100%) rename Adyen/{ => src}/Service/PlatformsAccount/AccountsService.cs (100%) rename Adyen/{ => src}/Service/PlatformsAccount/VerificationService.cs (100%) rename Adyen/{ => src}/Service/PlatformsFundService.cs (100%) rename Adyen/{ => src}/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs (100%) rename Adyen/{ => src}/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs (100%) rename Adyen/{ => src}/Service/PlatformsNotificationConfigurationService.cs (100%) rename Adyen/{ => src}/Service/PosMobileService.cs (100%) rename Adyen/{ => src}/Service/PosTerminalManagementService.cs (100%) rename Adyen/{ => src}/Service/RecurringService.cs (100%) rename Adyen/{ => src}/Service/Resource/Terminal/TerminalApi.cs (100%) rename Adyen/{ => src}/Service/Resource/Terminal/TerminalApiAsyncClient.cs (100%) rename Adyen/{ => src}/Service/Resource/Terminal/TerminalApiLocal.cs (100%) rename Adyen/{ => src}/Service/Resource/Terminal/TerminalApiLocalClient.cs (100%) rename Adyen/{ => src}/Service/Resource/Terminal/TerminalApiSyncClient.cs (100%) rename Adyen/{ => src}/Service/ServiceResource.cs (97%) rename Adyen/{ => src}/Service/StoredValueService.cs (100%) rename Adyen/{ => src}/Service/TerminalApiAsyncService.cs (100%) rename Adyen/{ => src}/Service/TerminalApiLocalService.cs (100%) rename Adyen/{ => src}/Service/TerminalApiSyncService.cs (100%) rename Adyen/{ => src}/Service/TerminalCloudApi.cs (100%) rename Adyen/{ => src}/Service/TerminalLocalApi.cs (100%) rename Adyen/{ => src}/Service/TerminalLocalApiUnencrypted.cs (100%) rename Adyen/{ => src}/Service/Transfers/CapitalService.cs (100%) rename Adyen/{ => src}/Service/Transfers/TransactionsService.cs (100%) rename Adyen/{ => src}/Service/Transfers/TransfersService.cs (100%) rename Adyen/{ => src}/Util/ByteArrayConverter.cs (100%) rename Adyen/{ => src}/Util/HMACValidator.cs (97%) rename Adyen/{ => src}/Util/JsonOperation.cs (97%) rename Adyen/{ => src}/Util/TerminalApi/AdditionalResponse.cs (100%) rename Adyen/{ => src}/Util/TerminalApi/CardAcquisitionUtil.cs (100%) rename Adyen/{ => src}/Util/Util.cs (95%) rename Adyen/{ => src}/Webhooks/BalancePlatformWebhookHandler.cs (100%) rename Adyen/{ => src}/Webhooks/ClassicPlatformWebhookHandler.cs (100%) rename Adyen/{ => src}/Webhooks/ManagementWebhookHandler.cs (100%) rename Adyen/{ => src}/Webhooks/WebhookHandler.cs (100%) diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index b6d4ba385..1cd2f26cb 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -58,8 +58,7 @@ - - + diff --git a/Adyen/ApiSerialization/Converter/JsonBase64Converter.cs b/Adyen/src/ApiSerialization/Converter/JsonBase64Converter.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/JsonBase64Converter.cs rename to Adyen/src/ApiSerialization/Converter/JsonBase64Converter.cs diff --git a/Adyen/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs b/Adyen/src/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs rename to Adyen/src/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs diff --git a/Adyen/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs b/Adyen/src/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs rename to Adyen/src/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs diff --git a/Adyen/ApiSerialization/Converter/SaleToPoiMessageConverter.cs b/Adyen/src/ApiSerialization/Converter/SaleToPoiMessageConverter.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/SaleToPoiMessageConverter.cs rename to Adyen/src/ApiSerialization/Converter/SaleToPoiMessageConverter.cs diff --git a/Adyen/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs b/Adyen/src/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs rename to Adyen/src/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs diff --git a/Adyen/ApiSerialization/IMessagePayload.cs b/Adyen/src/ApiSerialization/IMessagePayload.cs similarity index 100% rename from Adyen/ApiSerialization/IMessagePayload.cs rename to Adyen/src/ApiSerialization/IMessagePayload.cs diff --git a/Adyen/ApiSerialization/IMessagePayloadSerializer.cs b/Adyen/src/ApiSerialization/IMessagePayloadSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/IMessagePayloadSerializer.cs rename to Adyen/src/ApiSerialization/IMessagePayloadSerializer.cs diff --git a/Adyen/ApiSerialization/MessageHeaderSerializer.cs b/Adyen/src/ApiSerialization/MessageHeaderSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/MessageHeaderSerializer.cs rename to Adyen/src/ApiSerialization/MessageHeaderSerializer.cs diff --git a/Adyen/ApiSerialization/MessagePayloadSerializer.cs b/Adyen/src/ApiSerialization/MessagePayloadSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/MessagePayloadSerializer.cs rename to Adyen/src/ApiSerialization/MessagePayloadSerializer.cs diff --git a/Adyen/ApiSerialization/MessagePayloadSerializerFactory.cs b/Adyen/src/ApiSerialization/MessagePayloadSerializerFactory.cs similarity index 100% rename from Adyen/ApiSerialization/MessagePayloadSerializerFactory.cs rename to Adyen/src/ApiSerialization/MessagePayloadSerializerFactory.cs diff --git a/Adyen/ApiSerialization/OpenAPIDateConverter.cs b/Adyen/src/ApiSerialization/OpenAPIDateConverter.cs similarity index 100% rename from Adyen/ApiSerialization/OpenAPIDateConverter.cs rename to Adyen/src/ApiSerialization/OpenAPIDateConverter.cs diff --git a/Adyen/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs b/Adyen/src/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs rename to Adyen/src/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs diff --git a/Adyen/ApiSerialization/SaleToPoiMessageSerializer.cs b/Adyen/src/ApiSerialization/SaleToPoiMessageSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/SaleToPoiMessageSerializer.cs rename to Adyen/src/ApiSerialization/SaleToPoiMessageSerializer.cs diff --git a/Adyen/ApiSerialization/TypeHelper.cs b/Adyen/src/ApiSerialization/TypeHelper.cs similarity index 100% rename from Adyen/ApiSerialization/TypeHelper.cs rename to Adyen/src/ApiSerialization/TypeHelper.cs diff --git a/Adyen/Constants/ApiConstants.cs b/Adyen/src/Constants/ApiConstants.cs similarity index 100% rename from Adyen/Constants/ApiConstants.cs rename to Adyen/src/Constants/ApiConstants.cs diff --git a/Adyen/Constants/ClientConfig.cs b/Adyen/src/Constants/ClientConfig.cs similarity index 100% rename from Adyen/Constants/ClientConfig.cs rename to Adyen/src/Constants/ClientConfig.cs diff --git a/Adyen/Constants/Region.cs b/Adyen/src/Constants/Region.cs similarity index 100% rename from Adyen/Constants/Region.cs rename to Adyen/src/Constants/Region.cs diff --git a/Adyen/Exceptions/DeserializationException.cs b/Adyen/src/Exceptions/DeserializationException.cs similarity index 100% rename from Adyen/Exceptions/DeserializationException.cs rename to Adyen/src/Exceptions/DeserializationException.cs diff --git a/Adyen/Exceptions/ExceptionMessages.cs b/Adyen/src/Exceptions/ExceptionMessages.cs similarity index 100% rename from Adyen/Exceptions/ExceptionMessages.cs rename to Adyen/src/Exceptions/ExceptionMessages.cs diff --git a/Adyen/HttpClient/HttpClientException.cs b/Adyen/src/HttpClient/HttpClientException.cs similarity index 100% rename from Adyen/HttpClient/HttpClientException.cs rename to Adyen/src/HttpClient/HttpClientException.cs diff --git a/Adyen/HttpClient/HttpClientExtension.cs b/Adyen/src/HttpClient/HttpClientExtension.cs similarity index 100% rename from Adyen/HttpClient/HttpClientExtension.cs rename to Adyen/src/HttpClient/HttpClientExtension.cs diff --git a/Adyen/HttpClient/HttpClientWrapper.cs b/Adyen/src/HttpClient/HttpClientWrapper.cs similarity index 100% rename from Adyen/HttpClient/HttpClientWrapper.cs rename to Adyen/src/HttpClient/HttpClientWrapper.cs diff --git a/Adyen/HttpClient/Interfaces/IClient.cs b/Adyen/src/HttpClient/Interfaces/IClient.cs similarity index 100% rename from Adyen/HttpClient/Interfaces/IClient.cs rename to Adyen/src/HttpClient/Interfaces/IClient.cs diff --git a/Adyen/Model/AcsWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/AcsWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/AcsWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/AcsWebhooks/Amount.cs b/Adyen/src/Model/AcsWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/Amount.cs rename to Adyen/src/Model/AcsWebhooks/Amount.cs diff --git a/Adyen/Model/AcsWebhooks/AuthenticationDecision.cs b/Adyen/src/Model/AcsWebhooks/AuthenticationDecision.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/AuthenticationDecision.cs rename to Adyen/src/Model/AcsWebhooks/AuthenticationDecision.cs diff --git a/Adyen/Model/AcsWebhooks/AuthenticationInfo.cs b/Adyen/src/Model/AcsWebhooks/AuthenticationInfo.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/AuthenticationInfo.cs rename to Adyen/src/Model/AcsWebhooks/AuthenticationInfo.cs diff --git a/Adyen/Model/AcsWebhooks/AuthenticationNotificationData.cs b/Adyen/src/Model/AcsWebhooks/AuthenticationNotificationData.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/AuthenticationNotificationData.cs rename to Adyen/src/Model/AcsWebhooks/AuthenticationNotificationData.cs diff --git a/Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.cs b/Adyen/src/Model/AcsWebhooks/AuthenticationNotificationRequest.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.cs rename to Adyen/src/Model/AcsWebhooks/AuthenticationNotificationRequest.cs diff --git a/Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/src/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/src/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/Model/AcsWebhooks/ChallengeInfo.cs b/Adyen/src/Model/AcsWebhooks/ChallengeInfo.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/ChallengeInfo.cs rename to Adyen/src/Model/AcsWebhooks/ChallengeInfo.cs diff --git a/Adyen/Model/AcsWebhooks/Purchase.cs b/Adyen/src/Model/AcsWebhooks/Purchase.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/Purchase.cs rename to Adyen/src/Model/AcsWebhooks/Purchase.cs diff --git a/Adyen/Model/AcsWebhooks/PurchaseInfo.cs b/Adyen/src/Model/AcsWebhooks/PurchaseInfo.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/PurchaseInfo.cs rename to Adyen/src/Model/AcsWebhooks/PurchaseInfo.cs diff --git a/Adyen/Model/AcsWebhooks/RelayedAuthenticationRequest.cs b/Adyen/src/Model/AcsWebhooks/RelayedAuthenticationRequest.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/RelayedAuthenticationRequest.cs rename to Adyen/src/Model/AcsWebhooks/RelayedAuthenticationRequest.cs diff --git a/Adyen/Model/AcsWebhooks/RelayedAuthenticationResponse.cs b/Adyen/src/Model/AcsWebhooks/RelayedAuthenticationResponse.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/RelayedAuthenticationResponse.cs rename to Adyen/src/Model/AcsWebhooks/RelayedAuthenticationResponse.cs diff --git a/Adyen/Model/AcsWebhooks/Resource.cs b/Adyen/src/Model/AcsWebhooks/Resource.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/Resource.cs rename to Adyen/src/Model/AcsWebhooks/Resource.cs diff --git a/Adyen/Model/AcsWebhooks/ServiceError.cs b/Adyen/src/Model/AcsWebhooks/ServiceError.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/ServiceError.cs rename to Adyen/src/Model/AcsWebhooks/ServiceError.cs diff --git a/Adyen/Model/ApiError.cs b/Adyen/src/Model/ApiError.cs similarity index 97% rename from Adyen/Model/ApiError.cs rename to Adyen/src/Model/ApiError.cs index 6a544f85e..fb26ab339 100644 --- a/Adyen/Model/ApiError.cs +++ b/Adyen/src/Model/ApiError.cs @@ -1,141 +1,141 @@ -#region License -// /* -// * ###### -// * ###### -// * ############ ####( ###### #####. ###### ############ ############ -// * ############# #####( ###### #####. ###### ############# ############# -// * ###### #####( ###### #####. ###### ##### ###### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ###### -// * ############# ############# ############# ############# ##### ###### -// * ############ ############ ############# ############ ##### ###### -// * ###### -// * ############# -// * ############ -// * -// * Adyen Dotnet API Library -// * -// * Copyright (c) 2020 Adyen B.V. -// * This file is open source and available under the MIT license. -// * See the LICENSE file for more info. -// */ -#endregion - -using Adyen.Model.Recurring; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; - -namespace Adyen.Model -{ - public class ApiError : IEquatable, IValidatableObject - { - public int Status { get; set; } - public string ErrorCode { get; set; } - public string Message { get; set; } - public string ErrorType { get; set; } - public string PspReference { get; set; } - - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ApiError {\n"); - sb.Append(" ErrorCode: ").Append(ErrorCode).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); - sb.Append(" ErrorType: ").Append(ErrorType).Append("\n"); - sb.Append(" PspReference: ").Append(PspReference).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as RecurringDetailsResult); - } - - /// - /// Returns true if RecurringDetailsResult instances are equal - /// - /// Instance of RecurringDetailsResult to be compared - /// Boolean - public bool Equals(ApiError other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.Status == other.Status || - - this.Status.Equals(other.Status) - ) && - ( - this.ErrorCode == other.ErrorCode || - this.ErrorCode != null && - this.ErrorCode.Equals(other.ErrorCode) - ) && - ( - this.Message == other.Message || - this.Message != null && - this.Message.Equals(other.Message) - ) && - ( - this.ErrorType == other.ErrorType || - this.ErrorType != null && - this.ErrorType.Equals(other.ErrorType) - ) && - ( - this.PspReference == other.PspReference || - this.PspReference != null && - this.PspReference.Equals(other.PspReference) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - hash = hash * 59 + this.Status.GetHashCode(); - if (this.ErrorCode != null) - hash = hash * 59 + this.ErrorCode.GetHashCode(); - if (this.Message != null) - hash = hash * 59 + this.Message.GetHashCode(); - if (this.ErrorType != null) - hash = hash * 59 + this.ErrorType.GetHashCode(); - if (this.PspReference != null) - hash = hash * 59 + this.PspReference.GetHashCode(); - return hash; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } -} +#region License +// /* +// * ###### +// * ###### +// * ############ ####( ###### #####. ###### ############ ############ +// * ############# #####( ###### #####. ###### ############# ############# +// * ###### #####( ###### #####. ###### ##### ###### ##### ###### +// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// * ###### ###### #####( ###### #####. ###### ##### ##### ###### +// * ############# ############# ############# ############# ##### ###### +// * ############ ############ ############# ############ ##### ###### +// * ###### +// * ############# +// * ############ +// * +// * Adyen Dotnet API Library +// * +// * Copyright (c) 2020 Adyen B.V. +// * This file is open source and available under the MIT license. +// * See the LICENSE file for more info. +// */ +#endregion + +using Adyen.Model.Recurring; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Text; + +namespace Adyen.Model +{ + public class ApiError : IEquatable, IValidatableObject + { + public int Status { get; set; } + public string ErrorCode { get; set; } + public string Message { get; set; } + public string ErrorType { get; set; } + public string PspReference { get; set; } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ApiError {\n"); + sb.Append(" ErrorCode: ").Append(ErrorCode).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" ErrorType: ").Append(ErrorType).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as RecurringDetailsResult); + } + + /// + /// Returns true if RecurringDetailsResult instances are equal + /// + /// Instance of RecurringDetailsResult to be compared + /// Boolean + public bool Equals(ApiError other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return + ( + this.Status == other.Status || + + this.Status.Equals(other.Status) + ) && + ( + this.ErrorCode == other.ErrorCode || + this.ErrorCode != null && + this.ErrorCode.Equals(other.ErrorCode) + ) && + ( + this.Message == other.Message || + this.Message != null && + this.Message.Equals(other.Message) + ) && + ( + this.ErrorType == other.ErrorType || + this.ErrorType != null && + this.ErrorType.Equals(other.ErrorType) + ) && + ( + this.PspReference == other.PspReference || + this.PspReference != null && + this.PspReference.Equals(other.PspReference) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + hash = hash * 59 + this.Status.GetHashCode(); + if (this.ErrorCode != null) + hash = hash * 59 + this.ErrorCode.GetHashCode(); + if (this.Message != null) + hash = hash * 59 + this.Message.GetHashCode(); + if (this.ErrorType != null) + hash = hash * 59 + this.ErrorType.GetHashCode(); + if (this.PspReference != null) + hash = hash * 59 + this.PspReference.GetHashCode(); + return hash; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } +} diff --git a/Adyen/Model/ApplicationInformation/ApplicationInfo.cs b/Adyen/src/Model/ApplicationInformation/ApplicationInfo.cs similarity index 100% rename from Adyen/Model/ApplicationInformation/ApplicationInfo.cs rename to Adyen/src/Model/ApplicationInformation/ApplicationInfo.cs diff --git a/Adyen/Model/ApplicationInformation/CommonField.cs b/Adyen/src/Model/ApplicationInformation/CommonField.cs similarity index 100% rename from Adyen/Model/ApplicationInformation/CommonField.cs rename to Adyen/src/Model/ApplicationInformation/CommonField.cs diff --git a/Adyen/Model/ApplicationInformation/ExternalPlatform.cs b/Adyen/src/Model/ApplicationInformation/ExternalPlatform.cs similarity index 100% rename from Adyen/Model/ApplicationInformation/ExternalPlatform.cs rename to Adyen/src/Model/ApplicationInformation/ExternalPlatform.cs diff --git a/Adyen/Model/ApplicationInformation/MerchantDevice.cs b/Adyen/src/Model/ApplicationInformation/MerchantDevice.cs similarity index 100% rename from Adyen/Model/ApplicationInformation/MerchantDevice.cs rename to Adyen/src/Model/ApplicationInformation/MerchantDevice.cs diff --git a/Adyen/Model/ApplicationInformation/ShopperInteractionDevice.cs b/Adyen/src/Model/ApplicationInformation/ShopperInteractionDevice.cs similarity index 100% rename from Adyen/Model/ApplicationInformation/ShopperInteractionDevice.cs rename to Adyen/src/Model/ApplicationInformation/ShopperInteractionDevice.cs diff --git a/Adyen/Model/BalanceControl/AbstractOpenAPISchema.cs b/Adyen/src/Model/BalanceControl/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/BalanceControl/AbstractOpenAPISchema.cs rename to Adyen/src/Model/BalanceControl/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/BalanceControl/Amount.cs b/Adyen/src/Model/BalanceControl/Amount.cs similarity index 100% rename from Adyen/Model/BalanceControl/Amount.cs rename to Adyen/src/Model/BalanceControl/Amount.cs diff --git a/Adyen/Model/BalanceControl/BalanceTransferRequest.cs b/Adyen/src/Model/BalanceControl/BalanceTransferRequest.cs similarity index 100% rename from Adyen/Model/BalanceControl/BalanceTransferRequest.cs rename to Adyen/src/Model/BalanceControl/BalanceTransferRequest.cs diff --git a/Adyen/Model/BalanceControl/BalanceTransferResponse.cs b/Adyen/src/Model/BalanceControl/BalanceTransferResponse.cs similarity index 100% rename from Adyen/Model/BalanceControl/BalanceTransferResponse.cs rename to Adyen/src/Model/BalanceControl/BalanceTransferResponse.cs diff --git a/Adyen/Model/BalancePlatform/AULocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AULocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/AULocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/AbstractOpenAPISchema.cs b/Adyen/src/Model/BalancePlatform/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AbstractOpenAPISchema.cs rename to Adyen/src/Model/BalancePlatform/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/BalancePlatform/AccountHolder.cs b/Adyen/src/Model/BalancePlatform/AccountHolder.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AccountHolder.cs rename to Adyen/src/Model/BalancePlatform/AccountHolder.cs diff --git a/Adyen/Model/BalancePlatform/AccountHolderCapability.cs b/Adyen/src/Model/BalancePlatform/AccountHolderCapability.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AccountHolderCapability.cs rename to Adyen/src/Model/BalancePlatform/AccountHolderCapability.cs diff --git a/Adyen/Model/BalancePlatform/AccountHolderInfo.cs b/Adyen/src/Model/BalancePlatform/AccountHolderInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AccountHolderInfo.cs rename to Adyen/src/Model/BalancePlatform/AccountHolderInfo.cs diff --git a/Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.cs b/Adyen/src/Model/BalancePlatform/AccountHolderUpdateRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.cs rename to Adyen/src/Model/BalancePlatform/AccountHolderUpdateRequest.cs diff --git a/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.cs b/Adyen/src/Model/BalancePlatform/AccountSupportingEntityCapability.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.cs rename to Adyen/src/Model/BalancePlatform/AccountSupportingEntityCapability.cs diff --git a/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs b/Adyen/src/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs rename to Adyen/src/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs diff --git a/Adyen/Model/BalancePlatform/AdditionalBankIdentification.cs b/Adyen/src/Model/BalancePlatform/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AdditionalBankIdentification.cs rename to Adyen/src/Model/BalancePlatform/AdditionalBankIdentification.cs diff --git a/Adyen/Model/BalancePlatform/Address.cs b/Adyen/src/Model/BalancePlatform/Address.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Address.cs rename to Adyen/src/Model/BalancePlatform/Address.cs diff --git a/Adyen/Model/BalancePlatform/AddressRequirement.cs b/Adyen/src/Model/BalancePlatform/AddressRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AddressRequirement.cs rename to Adyen/src/Model/BalancePlatform/AddressRequirement.cs diff --git a/Adyen/Model/BalancePlatform/Amount.cs b/Adyen/src/Model/BalancePlatform/Amount.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Amount.cs rename to Adyen/src/Model/BalancePlatform/Amount.cs diff --git a/Adyen/Model/BalancePlatform/AmountMinMaxRequirement.cs b/Adyen/src/Model/BalancePlatform/AmountMinMaxRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AmountMinMaxRequirement.cs rename to Adyen/src/Model/BalancePlatform/AmountMinMaxRequirement.cs diff --git a/Adyen/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs b/Adyen/src/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs rename to Adyen/src/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs diff --git a/Adyen/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs b/Adyen/src/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs rename to Adyen/src/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs diff --git a/Adyen/Model/BalancePlatform/AssociationFinaliseRequest.cs b/Adyen/src/Model/BalancePlatform/AssociationFinaliseRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AssociationFinaliseRequest.cs rename to Adyen/src/Model/BalancePlatform/AssociationFinaliseRequest.cs diff --git a/Adyen/Model/BalancePlatform/AssociationFinaliseResponse.cs b/Adyen/src/Model/BalancePlatform/AssociationFinaliseResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AssociationFinaliseResponse.cs rename to Adyen/src/Model/BalancePlatform/AssociationFinaliseResponse.cs diff --git a/Adyen/Model/BalancePlatform/AssociationInitiateRequest.cs b/Adyen/src/Model/BalancePlatform/AssociationInitiateRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AssociationInitiateRequest.cs rename to Adyen/src/Model/BalancePlatform/AssociationInitiateRequest.cs diff --git a/Adyen/Model/BalancePlatform/AssociationInitiateResponse.cs b/Adyen/src/Model/BalancePlatform/AssociationInitiateResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AssociationInitiateResponse.cs rename to Adyen/src/Model/BalancePlatform/AssociationInitiateResponse.cs diff --git a/Adyen/Model/BalancePlatform/Authentication.cs b/Adyen/src/Model/BalancePlatform/Authentication.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Authentication.cs rename to Adyen/src/Model/BalancePlatform/Authentication.cs diff --git a/Adyen/Model/BalancePlatform/BRLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/BRLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BRLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/BRLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/Balance.cs b/Adyen/src/Model/BalancePlatform/Balance.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Balance.cs rename to Adyen/src/Model/BalancePlatform/Balance.cs diff --git a/Adyen/Model/BalancePlatform/BalanceAccount.cs b/Adyen/src/Model/BalancePlatform/BalanceAccount.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BalanceAccount.cs rename to Adyen/src/Model/BalancePlatform/BalanceAccount.cs diff --git a/Adyen/Model/BalancePlatform/BalanceAccountBase.cs b/Adyen/src/Model/BalancePlatform/BalanceAccountBase.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BalanceAccountBase.cs rename to Adyen/src/Model/BalancePlatform/BalanceAccountBase.cs diff --git a/Adyen/Model/BalancePlatform/BalanceAccountInfo.cs b/Adyen/src/Model/BalancePlatform/BalanceAccountInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BalanceAccountInfo.cs rename to Adyen/src/Model/BalancePlatform/BalanceAccountInfo.cs diff --git a/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.cs b/Adyen/src/Model/BalancePlatform/BalanceAccountUpdateRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.cs rename to Adyen/src/Model/BalancePlatform/BalanceAccountUpdateRequest.cs diff --git a/Adyen/Model/BalancePlatform/BalancePlatform.cs b/Adyen/src/Model/BalancePlatform/BalancePlatform.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BalancePlatform.cs rename to Adyen/src/Model/BalancePlatform/BalancePlatform.cs diff --git a/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs b/Adyen/src/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs rename to Adyen/src/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs diff --git a/Adyen/Model/BalancePlatform/BankAccount.cs b/Adyen/src/Model/BalancePlatform/BankAccount.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccount.cs rename to Adyen/src/Model/BalancePlatform/BankAccount.cs diff --git a/Adyen/Model/BalancePlatform/BankAccountAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/BankAccountAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccountAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/BankAccountAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/BankAccountDetails.cs b/Adyen/src/Model/BalancePlatform/BankAccountDetails.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccountDetails.cs rename to Adyen/src/Model/BalancePlatform/BankAccountDetails.cs diff --git a/Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs b/Adyen/src/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs rename to Adyen/src/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs diff --git a/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs b/Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs rename to Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs diff --git a/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/BankAccountModel.cs b/Adyen/src/Model/BalancePlatform/BankAccountModel.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccountModel.cs rename to Adyen/src/Model/BalancePlatform/BankAccountModel.cs diff --git a/Adyen/Model/BalancePlatform/BankIdentification.cs b/Adyen/src/Model/BalancePlatform/BankIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankIdentification.cs rename to Adyen/src/Model/BalancePlatform/BankIdentification.cs diff --git a/Adyen/Model/BalancePlatform/BrandVariantsRestriction.cs b/Adyen/src/Model/BalancePlatform/BrandVariantsRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BrandVariantsRestriction.cs rename to Adyen/src/Model/BalancePlatform/BrandVariantsRestriction.cs diff --git a/Adyen/Model/BalancePlatform/BulkAddress.cs b/Adyen/src/Model/BalancePlatform/BulkAddress.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BulkAddress.cs rename to Adyen/src/Model/BalancePlatform/BulkAddress.cs diff --git a/Adyen/Model/BalancePlatform/CALocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CALocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/CALocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CZLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/CZLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/CapabilityProblem.cs b/Adyen/src/Model/BalancePlatform/CapabilityProblem.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CapabilityProblem.cs rename to Adyen/src/Model/BalancePlatform/CapabilityProblem.cs diff --git a/Adyen/Model/BalancePlatform/CapabilityProblemEntity.cs b/Adyen/src/Model/BalancePlatform/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CapabilityProblemEntity.cs rename to Adyen/src/Model/BalancePlatform/CapabilityProblemEntity.cs diff --git a/Adyen/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs b/Adyen/src/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs rename to Adyen/src/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/Model/BalancePlatform/CapabilitySettings.cs b/Adyen/src/Model/BalancePlatform/CapabilitySettings.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CapabilitySettings.cs rename to Adyen/src/Model/BalancePlatform/CapabilitySettings.cs diff --git a/Adyen/Model/BalancePlatform/CapitalBalance.cs b/Adyen/src/Model/BalancePlatform/CapitalBalance.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CapitalBalance.cs rename to Adyen/src/Model/BalancePlatform/CapitalBalance.cs diff --git a/Adyen/Model/BalancePlatform/CapitalGrantAccount.cs b/Adyen/src/Model/BalancePlatform/CapitalGrantAccount.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CapitalGrantAccount.cs rename to Adyen/src/Model/BalancePlatform/CapitalGrantAccount.cs diff --git a/Adyen/Model/BalancePlatform/Card.cs b/Adyen/src/Model/BalancePlatform/Card.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Card.cs rename to Adyen/src/Model/BalancePlatform/Card.cs diff --git a/Adyen/Model/BalancePlatform/CardConfiguration.cs b/Adyen/src/Model/BalancePlatform/CardConfiguration.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CardConfiguration.cs rename to Adyen/src/Model/BalancePlatform/CardConfiguration.cs diff --git a/Adyen/Model/BalancePlatform/CardInfo.cs b/Adyen/src/Model/BalancePlatform/CardInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CardInfo.cs rename to Adyen/src/Model/BalancePlatform/CardInfo.cs diff --git a/Adyen/Model/BalancePlatform/CardOrder.cs b/Adyen/src/Model/BalancePlatform/CardOrder.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CardOrder.cs rename to Adyen/src/Model/BalancePlatform/CardOrder.cs diff --git a/Adyen/Model/BalancePlatform/CardOrderItem.cs b/Adyen/src/Model/BalancePlatform/CardOrderItem.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CardOrderItem.cs rename to Adyen/src/Model/BalancePlatform/CardOrderItem.cs diff --git a/Adyen/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs b/Adyen/src/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs rename to Adyen/src/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs diff --git a/Adyen/Model/BalancePlatform/ContactDetails.cs b/Adyen/src/Model/BalancePlatform/ContactDetails.cs similarity index 100% rename from Adyen/Model/BalancePlatform/ContactDetails.cs rename to Adyen/src/Model/BalancePlatform/ContactDetails.cs diff --git a/Adyen/Model/BalancePlatform/Counterparty.cs b/Adyen/src/Model/BalancePlatform/Counterparty.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Counterparty.cs rename to Adyen/src/Model/BalancePlatform/Counterparty.cs diff --git a/Adyen/Model/BalancePlatform/CounterpartyBankRestriction.cs b/Adyen/src/Model/BalancePlatform/CounterpartyBankRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CounterpartyBankRestriction.cs rename to Adyen/src/Model/BalancePlatform/CounterpartyBankRestriction.cs diff --git a/Adyen/Model/BalancePlatform/CounterpartyTypesRestriction.cs b/Adyen/src/Model/BalancePlatform/CounterpartyTypesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CounterpartyTypesRestriction.cs rename to Adyen/src/Model/BalancePlatform/CounterpartyTypesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/CountriesRestriction.cs b/Adyen/src/Model/BalancePlatform/CountriesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CountriesRestriction.cs rename to Adyen/src/Model/BalancePlatform/CountriesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.cs b/Adyen/src/Model/BalancePlatform/CreateSweepConfigurationV2.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.cs rename to Adyen/src/Model/BalancePlatform/CreateSweepConfigurationV2.cs diff --git a/Adyen/Model/BalancePlatform/DKLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DKLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/DKLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/DayOfWeekRestriction.cs b/Adyen/src/Model/BalancePlatform/DayOfWeekRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DayOfWeekRestriction.cs rename to Adyen/src/Model/BalancePlatform/DayOfWeekRestriction.cs diff --git a/Adyen/Model/BalancePlatform/DelegatedAuthenticationData.cs b/Adyen/src/Model/BalancePlatform/DelegatedAuthenticationData.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DelegatedAuthenticationData.cs rename to Adyen/src/Model/BalancePlatform/DelegatedAuthenticationData.cs diff --git a/Adyen/Model/BalancePlatform/DeliveryAddress.cs b/Adyen/src/Model/BalancePlatform/DeliveryAddress.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DeliveryAddress.cs rename to Adyen/src/Model/BalancePlatform/DeliveryAddress.cs diff --git a/Adyen/Model/BalancePlatform/DeliveryContact.cs b/Adyen/src/Model/BalancePlatform/DeliveryContact.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DeliveryContact.cs rename to Adyen/src/Model/BalancePlatform/DeliveryContact.cs diff --git a/Adyen/Model/BalancePlatform/Device.cs b/Adyen/src/Model/BalancePlatform/Device.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Device.cs rename to Adyen/src/Model/BalancePlatform/Device.cs diff --git a/Adyen/Model/BalancePlatform/DeviceInfo.cs b/Adyen/src/Model/BalancePlatform/DeviceInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DeviceInfo.cs rename to Adyen/src/Model/BalancePlatform/DeviceInfo.cs diff --git a/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.cs b/Adyen/src/Model/BalancePlatform/DifferentCurrenciesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.cs rename to Adyen/src/Model/BalancePlatform/DifferentCurrenciesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/Duration.cs b/Adyen/src/Model/BalancePlatform/Duration.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Duration.cs rename to Adyen/src/Model/BalancePlatform/Duration.cs diff --git a/Adyen/Model/BalancePlatform/EntryModesRestriction.cs b/Adyen/src/Model/BalancePlatform/EntryModesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/EntryModesRestriction.cs rename to Adyen/src/Model/BalancePlatform/EntryModesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/Expiry.cs b/Adyen/src/Model/BalancePlatform/Expiry.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Expiry.cs rename to Adyen/src/Model/BalancePlatform/Expiry.cs diff --git a/Adyen/Model/BalancePlatform/Fee.cs b/Adyen/src/Model/BalancePlatform/Fee.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Fee.cs rename to Adyen/src/Model/BalancePlatform/Fee.cs diff --git a/Adyen/Model/BalancePlatform/GetNetworkTokenResponse.cs b/Adyen/src/Model/BalancePlatform/GetNetworkTokenResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/GetNetworkTokenResponse.cs rename to Adyen/src/Model/BalancePlatform/GetNetworkTokenResponse.cs diff --git a/Adyen/Model/BalancePlatform/GetTaxFormResponse.cs b/Adyen/src/Model/BalancePlatform/GetTaxFormResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/GetTaxFormResponse.cs rename to Adyen/src/Model/BalancePlatform/GetTaxFormResponse.cs diff --git a/Adyen/Model/BalancePlatform/GrantLimit.cs b/Adyen/src/Model/BalancePlatform/GrantLimit.cs similarity index 100% rename from Adyen/Model/BalancePlatform/GrantLimit.cs rename to Adyen/src/Model/BalancePlatform/GrantLimit.cs diff --git a/Adyen/Model/BalancePlatform/GrantOffer.cs b/Adyen/src/Model/BalancePlatform/GrantOffer.cs similarity index 100% rename from Adyen/Model/BalancePlatform/GrantOffer.cs rename to Adyen/src/Model/BalancePlatform/GrantOffer.cs diff --git a/Adyen/Model/BalancePlatform/GrantOffers.cs b/Adyen/src/Model/BalancePlatform/GrantOffers.cs similarity index 100% rename from Adyen/Model/BalancePlatform/GrantOffers.cs rename to Adyen/src/Model/BalancePlatform/GrantOffers.cs diff --git a/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/HKLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/HKLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/HULocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/HULocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/HULocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/Href.cs b/Adyen/src/Model/BalancePlatform/Href.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Href.cs rename to Adyen/src/Model/BalancePlatform/Href.cs diff --git a/Adyen/Model/BalancePlatform/IbanAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/IbanAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/IbanAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/IbanAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs b/Adyen/src/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs rename to Adyen/src/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs diff --git a/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.cs b/Adyen/src/Model/BalancePlatform/InternationalTransactionRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/InternationalTransactionRestriction.cs rename to Adyen/src/Model/BalancePlatform/InternationalTransactionRestriction.cs diff --git a/Adyen/Model/BalancePlatform/InvalidField.cs b/Adyen/src/Model/BalancePlatform/InvalidField.cs similarity index 100% rename from Adyen/Model/BalancePlatform/InvalidField.cs rename to Adyen/src/Model/BalancePlatform/InvalidField.cs diff --git a/Adyen/Model/BalancePlatform/Link.cs b/Adyen/src/Model/BalancePlatform/Link.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Link.cs rename to Adyen/src/Model/BalancePlatform/Link.cs diff --git a/Adyen/Model/BalancePlatform/ListNetworkTokensResponse.cs b/Adyen/src/Model/BalancePlatform/ListNetworkTokensResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/ListNetworkTokensResponse.cs rename to Adyen/src/Model/BalancePlatform/ListNetworkTokensResponse.cs diff --git a/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.cs b/Adyen/src/Model/BalancePlatform/MatchingTransactionsRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.cs rename to Adyen/src/Model/BalancePlatform/MatchingTransactionsRestriction.cs diff --git a/Adyen/Model/BalancePlatform/MatchingValuesRestriction.cs b/Adyen/src/Model/BalancePlatform/MatchingValuesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/MatchingValuesRestriction.cs rename to Adyen/src/Model/BalancePlatform/MatchingValuesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/MccsRestriction.cs b/Adyen/src/Model/BalancePlatform/MccsRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/MccsRestriction.cs rename to Adyen/src/Model/BalancePlatform/MccsRestriction.cs diff --git a/Adyen/Model/BalancePlatform/MerchantAcquirerPair.cs b/Adyen/src/Model/BalancePlatform/MerchantAcquirerPair.cs similarity index 100% rename from Adyen/Model/BalancePlatform/MerchantAcquirerPair.cs rename to Adyen/src/Model/BalancePlatform/MerchantAcquirerPair.cs diff --git a/Adyen/Model/BalancePlatform/MerchantNamesRestriction.cs b/Adyen/src/Model/BalancePlatform/MerchantNamesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/MerchantNamesRestriction.cs rename to Adyen/src/Model/BalancePlatform/MerchantNamesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/MerchantsRestriction.cs b/Adyen/src/Model/BalancePlatform/MerchantsRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/MerchantsRestriction.cs rename to Adyen/src/Model/BalancePlatform/MerchantsRestriction.cs diff --git a/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/NOLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/NOLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/NZLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/NZLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/NZLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/Name.cs b/Adyen/src/Model/BalancePlatform/Name.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Name.cs rename to Adyen/src/Model/BalancePlatform/Name.cs diff --git a/Adyen/Model/BalancePlatform/NetworkToken.cs b/Adyen/src/Model/BalancePlatform/NetworkToken.cs similarity index 100% rename from Adyen/Model/BalancePlatform/NetworkToken.cs rename to Adyen/src/Model/BalancePlatform/NetworkToken.cs diff --git a/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/NumberAndBicAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PLLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/PLLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs b/Adyen/src/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs rename to Adyen/src/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs diff --git a/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs b/Adyen/src/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs rename to Adyen/src/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs diff --git a/Adyen/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs b/Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs rename to Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs diff --git a/Adyen/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs b/Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs rename to Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs diff --git a/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs b/Adyen/src/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs rename to Adyen/src/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrument.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrument.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrument.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrument.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentGroup.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentGroup.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentGroup.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentInfo.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentInfo.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentRequirement.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentRequirement.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentRequirement.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs diff --git a/Adyen/Model/BalancePlatform/Phone.cs b/Adyen/src/Model/BalancePlatform/Phone.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Phone.cs rename to Adyen/src/Model/BalancePlatform/Phone.cs diff --git a/Adyen/Model/BalancePlatform/PhoneNumber.cs b/Adyen/src/Model/BalancePlatform/PhoneNumber.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PhoneNumber.cs rename to Adyen/src/Model/BalancePlatform/PhoneNumber.cs diff --git a/Adyen/Model/BalancePlatform/PinChangeRequest.cs b/Adyen/src/Model/BalancePlatform/PinChangeRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PinChangeRequest.cs rename to Adyen/src/Model/BalancePlatform/PinChangeRequest.cs diff --git a/Adyen/Model/BalancePlatform/PinChangeResponse.cs b/Adyen/src/Model/BalancePlatform/PinChangeResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PinChangeResponse.cs rename to Adyen/src/Model/BalancePlatform/PinChangeResponse.cs diff --git a/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.cs b/Adyen/src/Model/BalancePlatform/PlatformPaymentConfiguration.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.cs rename to Adyen/src/Model/BalancePlatform/PlatformPaymentConfiguration.cs diff --git a/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.cs b/Adyen/src/Model/BalancePlatform/ProcessingTypesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/ProcessingTypesRestriction.cs rename to Adyen/src/Model/BalancePlatform/ProcessingTypesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/PublicKeyResponse.cs b/Adyen/src/Model/BalancePlatform/PublicKeyResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PublicKeyResponse.cs rename to Adyen/src/Model/BalancePlatform/PublicKeyResponse.cs diff --git a/Adyen/Model/BalancePlatform/RegisterSCAFinalResponse.cs b/Adyen/src/Model/BalancePlatform/RegisterSCAFinalResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RegisterSCAFinalResponse.cs rename to Adyen/src/Model/BalancePlatform/RegisterSCAFinalResponse.cs diff --git a/Adyen/Model/BalancePlatform/RegisterSCARequest.cs b/Adyen/src/Model/BalancePlatform/RegisterSCARequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RegisterSCARequest.cs rename to Adyen/src/Model/BalancePlatform/RegisterSCARequest.cs diff --git a/Adyen/Model/BalancePlatform/RegisterSCAResponse.cs b/Adyen/src/Model/BalancePlatform/RegisterSCAResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RegisterSCAResponse.cs rename to Adyen/src/Model/BalancePlatform/RegisterSCAResponse.cs diff --git a/Adyen/Model/BalancePlatform/RemediatingAction.cs b/Adyen/src/Model/BalancePlatform/RemediatingAction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RemediatingAction.cs rename to Adyen/src/Model/BalancePlatform/RemediatingAction.cs diff --git a/Adyen/Model/BalancePlatform/Repayment.cs b/Adyen/src/Model/BalancePlatform/Repayment.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Repayment.cs rename to Adyen/src/Model/BalancePlatform/Repayment.cs diff --git a/Adyen/Model/BalancePlatform/RepaymentTerm.cs b/Adyen/src/Model/BalancePlatform/RepaymentTerm.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RepaymentTerm.cs rename to Adyen/src/Model/BalancePlatform/RepaymentTerm.cs diff --git a/Adyen/Model/BalancePlatform/RestServiceError.cs b/Adyen/src/Model/BalancePlatform/RestServiceError.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RestServiceError.cs rename to Adyen/src/Model/BalancePlatform/RestServiceError.cs diff --git a/Adyen/Model/BalancePlatform/RevealPinRequest.cs b/Adyen/src/Model/BalancePlatform/RevealPinRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RevealPinRequest.cs rename to Adyen/src/Model/BalancePlatform/RevealPinRequest.cs diff --git a/Adyen/Model/BalancePlatform/RevealPinResponse.cs b/Adyen/src/Model/BalancePlatform/RevealPinResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RevealPinResponse.cs rename to Adyen/src/Model/BalancePlatform/RevealPinResponse.cs diff --git a/Adyen/Model/BalancePlatform/RiskScores.cs b/Adyen/src/Model/BalancePlatform/RiskScores.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RiskScores.cs rename to Adyen/src/Model/BalancePlatform/RiskScores.cs diff --git a/Adyen/Model/BalancePlatform/RiskScoresRestriction.cs b/Adyen/src/Model/BalancePlatform/RiskScoresRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RiskScoresRestriction.cs rename to Adyen/src/Model/BalancePlatform/RiskScoresRestriction.cs diff --git a/Adyen/Model/BalancePlatform/SELocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SELocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/SELocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SGLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/SGLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/SameAmountRestriction.cs b/Adyen/src/Model/BalancePlatform/SameAmountRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SameAmountRestriction.cs rename to Adyen/src/Model/BalancePlatform/SameAmountRestriction.cs diff --git a/Adyen/Model/BalancePlatform/SameCounterpartyRestriction.cs b/Adyen/src/Model/BalancePlatform/SameCounterpartyRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SameCounterpartyRestriction.cs rename to Adyen/src/Model/BalancePlatform/SameCounterpartyRestriction.cs diff --git a/Adyen/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs b/Adyen/src/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs rename to Adyen/src/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs diff --git a/Adyen/Model/BalancePlatform/SourceAccountTypesRestriction.cs b/Adyen/src/Model/BalancePlatform/SourceAccountTypesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SourceAccountTypesRestriction.cs rename to Adyen/src/Model/BalancePlatform/SourceAccountTypesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/StringMatch.cs b/Adyen/src/Model/BalancePlatform/StringMatch.cs similarity index 100% rename from Adyen/Model/BalancePlatform/StringMatch.cs rename to Adyen/src/Model/BalancePlatform/StringMatch.cs diff --git a/Adyen/Model/BalancePlatform/SweepConfigurationV2.cs b/Adyen/src/Model/BalancePlatform/SweepConfigurationV2.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SweepConfigurationV2.cs rename to Adyen/src/Model/BalancePlatform/SweepConfigurationV2.cs diff --git a/Adyen/Model/BalancePlatform/SweepCounterparty.cs b/Adyen/src/Model/BalancePlatform/SweepCounterparty.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SweepCounterparty.cs rename to Adyen/src/Model/BalancePlatform/SweepCounterparty.cs diff --git a/Adyen/Model/BalancePlatform/SweepSchedule.cs b/Adyen/src/Model/BalancePlatform/SweepSchedule.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SweepSchedule.cs rename to Adyen/src/Model/BalancePlatform/SweepSchedule.cs diff --git a/Adyen/Model/BalancePlatform/ThresholdRepayment.cs b/Adyen/src/Model/BalancePlatform/ThresholdRepayment.cs similarity index 100% rename from Adyen/Model/BalancePlatform/ThresholdRepayment.cs rename to Adyen/src/Model/BalancePlatform/ThresholdRepayment.cs diff --git a/Adyen/Model/BalancePlatform/TimeOfDay.cs b/Adyen/src/Model/BalancePlatform/TimeOfDay.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TimeOfDay.cs rename to Adyen/src/Model/BalancePlatform/TimeOfDay.cs diff --git a/Adyen/Model/BalancePlatform/TimeOfDayRestriction.cs b/Adyen/src/Model/BalancePlatform/TimeOfDayRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TimeOfDayRestriction.cs rename to Adyen/src/Model/BalancePlatform/TimeOfDayRestriction.cs diff --git a/Adyen/Model/BalancePlatform/TokenRequestorsRestriction.cs b/Adyen/src/Model/BalancePlatform/TokenRequestorsRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TokenRequestorsRestriction.cs rename to Adyen/src/Model/BalancePlatform/TokenRequestorsRestriction.cs diff --git a/Adyen/Model/BalancePlatform/TotalAmountRestriction.cs b/Adyen/src/Model/BalancePlatform/TotalAmountRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TotalAmountRestriction.cs rename to Adyen/src/Model/BalancePlatform/TotalAmountRestriction.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRule.cs b/Adyen/src/Model/BalancePlatform/TransactionRule.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRule.cs rename to Adyen/src/Model/BalancePlatform/TransactionRule.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.cs b/Adyen/src/Model/BalancePlatform/TransactionRuleEntityKey.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRuleEntityKey.cs rename to Adyen/src/Model/BalancePlatform/TransactionRuleEntityKey.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRuleInfo.cs b/Adyen/src/Model/BalancePlatform/TransactionRuleInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRuleInfo.cs rename to Adyen/src/Model/BalancePlatform/TransactionRuleInfo.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRuleInterval.cs b/Adyen/src/Model/BalancePlatform/TransactionRuleInterval.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRuleInterval.cs rename to Adyen/src/Model/BalancePlatform/TransactionRuleInterval.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRuleResponse.cs b/Adyen/src/Model/BalancePlatform/TransactionRuleResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRuleResponse.cs rename to Adyen/src/Model/BalancePlatform/TransactionRuleResponse.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.cs b/Adyen/src/Model/BalancePlatform/TransactionRuleRestrictions.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRuleRestrictions.cs rename to Adyen/src/Model/BalancePlatform/TransactionRuleRestrictions.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRulesResponse.cs b/Adyen/src/Model/BalancePlatform/TransactionRulesResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRulesResponse.cs rename to Adyen/src/Model/BalancePlatform/TransactionRulesResponse.cs diff --git a/Adyen/Model/BalancePlatform/TransferRoute.cs b/Adyen/src/Model/BalancePlatform/TransferRoute.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransferRoute.cs rename to Adyen/src/Model/BalancePlatform/TransferRoute.cs diff --git a/Adyen/Model/BalancePlatform/TransferRouteRequest.cs b/Adyen/src/Model/BalancePlatform/TransferRouteRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransferRouteRequest.cs rename to Adyen/src/Model/BalancePlatform/TransferRouteRequest.cs diff --git a/Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.cs b/Adyen/src/Model/BalancePlatform/TransferRouteRequirementsInner.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.cs rename to Adyen/src/Model/BalancePlatform/TransferRouteRequirementsInner.cs diff --git a/Adyen/Model/BalancePlatform/TransferRouteResponse.cs b/Adyen/src/Model/BalancePlatform/TransferRouteResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransferRouteResponse.cs rename to Adyen/src/Model/BalancePlatform/TransferRouteResponse.cs diff --git a/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/UKLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/UKLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/USInternationalAchAddressRequirement.cs b/Adyen/src/Model/BalancePlatform/USInternationalAchAddressRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/USInternationalAchAddressRequirement.cs rename to Adyen/src/Model/BalancePlatform/USInternationalAchAddressRequirement.cs diff --git a/Adyen/Model/BalancePlatform/USLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/USLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/USLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/UpdateNetworkTokenRequest.cs b/Adyen/src/Model/BalancePlatform/UpdateNetworkTokenRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/UpdateNetworkTokenRequest.cs rename to Adyen/src/Model/BalancePlatform/UpdateNetworkTokenRequest.cs diff --git a/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.cs b/Adyen/src/Model/BalancePlatform/UpdatePaymentInstrument.cs similarity index 100% rename from Adyen/Model/BalancePlatform/UpdatePaymentInstrument.cs rename to Adyen/src/Model/BalancePlatform/UpdatePaymentInstrument.cs diff --git a/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.cs b/Adyen/src/Model/BalancePlatform/UpdateSweepConfigurationV2.cs similarity index 100% rename from Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.cs rename to Adyen/src/Model/BalancePlatform/UpdateSweepConfigurationV2.cs diff --git a/Adyen/Model/BalancePlatform/VerificationDeadline.cs b/Adyen/src/Model/BalancePlatform/VerificationDeadline.cs similarity index 100% rename from Adyen/Model/BalancePlatform/VerificationDeadline.cs rename to Adyen/src/Model/BalancePlatform/VerificationDeadline.cs diff --git a/Adyen/Model/BalancePlatform/VerificationError.cs b/Adyen/src/Model/BalancePlatform/VerificationError.cs similarity index 100% rename from Adyen/Model/BalancePlatform/VerificationError.cs rename to Adyen/src/Model/BalancePlatform/VerificationError.cs diff --git a/Adyen/Model/BalancePlatform/VerificationErrorRecursive.cs b/Adyen/src/Model/BalancePlatform/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/Model/BalancePlatform/VerificationErrorRecursive.cs rename to Adyen/src/Model/BalancePlatform/VerificationErrorRecursive.cs diff --git a/Adyen/Model/BinLookup/AbstractOpenAPISchema.cs b/Adyen/src/Model/BinLookup/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/BinLookup/AbstractOpenAPISchema.cs rename to Adyen/src/Model/BinLookup/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/BinLookup/Amount.cs b/Adyen/src/Model/BinLookup/Amount.cs similarity index 100% rename from Adyen/Model/BinLookup/Amount.cs rename to Adyen/src/Model/BinLookup/Amount.cs diff --git a/Adyen/Model/BinLookup/BinDetail.cs b/Adyen/src/Model/BinLookup/BinDetail.cs similarity index 100% rename from Adyen/Model/BinLookup/BinDetail.cs rename to Adyen/src/Model/BinLookup/BinDetail.cs diff --git a/Adyen/Model/BinLookup/CardBin.cs b/Adyen/src/Model/BinLookup/CardBin.cs similarity index 100% rename from Adyen/Model/BinLookup/CardBin.cs rename to Adyen/src/Model/BinLookup/CardBin.cs diff --git a/Adyen/Model/BinLookup/CostEstimateAssumptions.cs b/Adyen/src/Model/BinLookup/CostEstimateAssumptions.cs similarity index 100% rename from Adyen/Model/BinLookup/CostEstimateAssumptions.cs rename to Adyen/src/Model/BinLookup/CostEstimateAssumptions.cs diff --git a/Adyen/Model/BinLookup/CostEstimateRequest.cs b/Adyen/src/Model/BinLookup/CostEstimateRequest.cs similarity index 100% rename from Adyen/Model/BinLookup/CostEstimateRequest.cs rename to Adyen/src/Model/BinLookup/CostEstimateRequest.cs diff --git a/Adyen/Model/BinLookup/CostEstimateResponse.cs b/Adyen/src/Model/BinLookup/CostEstimateResponse.cs similarity index 100% rename from Adyen/Model/BinLookup/CostEstimateResponse.cs rename to Adyen/src/Model/BinLookup/CostEstimateResponse.cs diff --git a/Adyen/Model/BinLookup/DSPublicKeyDetail.cs b/Adyen/src/Model/BinLookup/DSPublicKeyDetail.cs similarity index 100% rename from Adyen/Model/BinLookup/DSPublicKeyDetail.cs rename to Adyen/src/Model/BinLookup/DSPublicKeyDetail.cs diff --git a/Adyen/Model/BinLookup/MerchantDetails.cs b/Adyen/src/Model/BinLookup/MerchantDetails.cs similarity index 100% rename from Adyen/Model/BinLookup/MerchantDetails.cs rename to Adyen/src/Model/BinLookup/MerchantDetails.cs diff --git a/Adyen/Model/BinLookup/Recurring.cs b/Adyen/src/Model/BinLookup/Recurring.cs similarity index 100% rename from Adyen/Model/BinLookup/Recurring.cs rename to Adyen/src/Model/BinLookup/Recurring.cs diff --git a/Adyen/Model/BinLookup/ServiceError.cs b/Adyen/src/Model/BinLookup/ServiceError.cs similarity index 100% rename from Adyen/Model/BinLookup/ServiceError.cs rename to Adyen/src/Model/BinLookup/ServiceError.cs diff --git a/Adyen/Model/BinLookup/ThreeDS2CardRangeDetail.cs b/Adyen/src/Model/BinLookup/ThreeDS2CardRangeDetail.cs similarity index 100% rename from Adyen/Model/BinLookup/ThreeDS2CardRangeDetail.cs rename to Adyen/src/Model/BinLookup/ThreeDS2CardRangeDetail.cs diff --git a/Adyen/Model/BinLookup/ThreeDSAvailabilityRequest.cs b/Adyen/src/Model/BinLookup/ThreeDSAvailabilityRequest.cs similarity index 100% rename from Adyen/Model/BinLookup/ThreeDSAvailabilityRequest.cs rename to Adyen/src/Model/BinLookup/ThreeDSAvailabilityRequest.cs diff --git a/Adyen/Model/BinLookup/ThreeDSAvailabilityResponse.cs b/Adyen/src/Model/BinLookup/ThreeDSAvailabilityResponse.cs similarity index 100% rename from Adyen/Model/BinLookup/ThreeDSAvailabilityResponse.cs rename to Adyen/src/Model/BinLookup/ThreeDSAvailabilityResponse.cs diff --git a/Adyen/Model/Checkout/AbstractOpenAPISchema.cs b/Adyen/src/Model/Checkout/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Checkout/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Checkout/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Checkout/AccountInfo.cs b/Adyen/src/Model/Checkout/AccountInfo.cs similarity index 100% rename from Adyen/Model/Checkout/AccountInfo.cs rename to Adyen/src/Model/Checkout/AccountInfo.cs diff --git a/Adyen/Model/Checkout/AcctInfo.cs b/Adyen/src/Model/Checkout/AcctInfo.cs similarity index 100% rename from Adyen/Model/Checkout/AcctInfo.cs rename to Adyen/src/Model/Checkout/AcctInfo.cs diff --git a/Adyen/Model/Checkout/AchDetails.cs b/Adyen/src/Model/Checkout/AchDetails.cs similarity index 100% rename from Adyen/Model/Checkout/AchDetails.cs rename to Adyen/src/Model/Checkout/AchDetails.cs diff --git a/Adyen/Model/Checkout/AdditionalData3DSecure.cs b/Adyen/src/Model/Checkout/AdditionalData3DSecure.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalData3DSecure.cs rename to Adyen/src/Model/Checkout/AdditionalData3DSecure.cs diff --git a/Adyen/Model/Checkout/AdditionalDataAirline.cs b/Adyen/src/Model/Checkout/AdditionalDataAirline.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataAirline.cs rename to Adyen/src/Model/Checkout/AdditionalDataAirline.cs diff --git a/Adyen/Model/Checkout/AdditionalDataCarRental.cs b/Adyen/src/Model/Checkout/AdditionalDataCarRental.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataCarRental.cs rename to Adyen/src/Model/Checkout/AdditionalDataCarRental.cs diff --git a/Adyen/Model/Checkout/AdditionalDataCommon.cs b/Adyen/src/Model/Checkout/AdditionalDataCommon.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataCommon.cs rename to Adyen/src/Model/Checkout/AdditionalDataCommon.cs diff --git a/Adyen/Model/Checkout/AdditionalDataLevel23.cs b/Adyen/src/Model/Checkout/AdditionalDataLevel23.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataLevel23.cs rename to Adyen/src/Model/Checkout/AdditionalDataLevel23.cs diff --git a/Adyen/Model/Checkout/AdditionalDataLodging.cs b/Adyen/src/Model/Checkout/AdditionalDataLodging.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataLodging.cs rename to Adyen/src/Model/Checkout/AdditionalDataLodging.cs diff --git a/Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs b/Adyen/src/Model/Checkout/AdditionalDataOpenInvoice.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs rename to Adyen/src/Model/Checkout/AdditionalDataOpenInvoice.cs diff --git a/Adyen/Model/Checkout/AdditionalDataOpi.cs b/Adyen/src/Model/Checkout/AdditionalDataOpi.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataOpi.cs rename to Adyen/src/Model/Checkout/AdditionalDataOpi.cs diff --git a/Adyen/Model/Checkout/AdditionalDataRatepay.cs b/Adyen/src/Model/Checkout/AdditionalDataRatepay.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataRatepay.cs rename to Adyen/src/Model/Checkout/AdditionalDataRatepay.cs diff --git a/Adyen/Model/Checkout/AdditionalDataRetry.cs b/Adyen/src/Model/Checkout/AdditionalDataRetry.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataRetry.cs rename to Adyen/src/Model/Checkout/AdditionalDataRetry.cs diff --git a/Adyen/Model/Checkout/AdditionalDataRisk.cs b/Adyen/src/Model/Checkout/AdditionalDataRisk.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataRisk.cs rename to Adyen/src/Model/Checkout/AdditionalDataRisk.cs diff --git a/Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs b/Adyen/src/Model/Checkout/AdditionalDataRiskStandalone.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs rename to Adyen/src/Model/Checkout/AdditionalDataRiskStandalone.cs diff --git a/Adyen/Model/Checkout/AdditionalDataSubMerchant.cs b/Adyen/src/Model/Checkout/AdditionalDataSubMerchant.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataSubMerchant.cs rename to Adyen/src/Model/Checkout/AdditionalDataSubMerchant.cs diff --git a/Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs b/Adyen/src/Model/Checkout/AdditionalDataTemporaryServices.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs rename to Adyen/src/Model/Checkout/AdditionalDataTemporaryServices.cs diff --git a/Adyen/Model/Checkout/AdditionalDataWallets.cs b/Adyen/src/Model/Checkout/AdditionalDataWallets.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataWallets.cs rename to Adyen/src/Model/Checkout/AdditionalDataWallets.cs diff --git a/Adyen/Model/Checkout/Address.cs b/Adyen/src/Model/Checkout/Address.cs similarity index 100% rename from Adyen/Model/Checkout/Address.cs rename to Adyen/src/Model/Checkout/Address.cs diff --git a/Adyen/Model/Checkout/AffirmDetails.cs b/Adyen/src/Model/Checkout/AffirmDetails.cs similarity index 100% rename from Adyen/Model/Checkout/AffirmDetails.cs rename to Adyen/src/Model/Checkout/AffirmDetails.cs diff --git a/Adyen/Model/Checkout/AfterpayDetails.cs b/Adyen/src/Model/Checkout/AfterpayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/AfterpayDetails.cs rename to Adyen/src/Model/Checkout/AfterpayDetails.cs diff --git a/Adyen/Model/Checkout/Agency.cs b/Adyen/src/Model/Checkout/Agency.cs similarity index 100% rename from Adyen/Model/Checkout/Agency.cs rename to Adyen/src/Model/Checkout/Agency.cs diff --git a/Adyen/Model/Checkout/Airline.cs b/Adyen/src/Model/Checkout/Airline.cs similarity index 100% rename from Adyen/Model/Checkout/Airline.cs rename to Adyen/src/Model/Checkout/Airline.cs diff --git a/Adyen/Model/Checkout/AmazonPayDetails.cs b/Adyen/src/Model/Checkout/AmazonPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/AmazonPayDetails.cs rename to Adyen/src/Model/Checkout/AmazonPayDetails.cs diff --git a/Adyen/Model/Checkout/Amount.cs b/Adyen/src/Model/Checkout/Amount.cs similarity index 100% rename from Adyen/Model/Checkout/Amount.cs rename to Adyen/src/Model/Checkout/Amount.cs diff --git a/Adyen/Model/Checkout/Amounts.cs b/Adyen/src/Model/Checkout/Amounts.cs similarity index 100% rename from Adyen/Model/Checkout/Amounts.cs rename to Adyen/src/Model/Checkout/Amounts.cs diff --git a/Adyen/Model/Checkout/AncvDetails.cs b/Adyen/src/Model/Checkout/AncvDetails.cs similarity index 100% rename from Adyen/Model/Checkout/AncvDetails.cs rename to Adyen/src/Model/Checkout/AncvDetails.cs diff --git a/Adyen/Model/Checkout/AndroidPayDetails.cs b/Adyen/src/Model/Checkout/AndroidPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/AndroidPayDetails.cs rename to Adyen/src/Model/Checkout/AndroidPayDetails.cs diff --git a/Adyen/Model/Checkout/ApplePayDetails.cs b/Adyen/src/Model/Checkout/ApplePayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/ApplePayDetails.cs rename to Adyen/src/Model/Checkout/ApplePayDetails.cs diff --git a/Adyen/Model/Checkout/ApplePayDonations.cs b/Adyen/src/Model/Checkout/ApplePayDonations.cs similarity index 100% rename from Adyen/Model/Checkout/ApplePayDonations.cs rename to Adyen/src/Model/Checkout/ApplePayDonations.cs diff --git a/Adyen/Model/Checkout/ApplePaySessionRequest.cs b/Adyen/src/Model/Checkout/ApplePaySessionRequest.cs similarity index 100% rename from Adyen/Model/Checkout/ApplePaySessionRequest.cs rename to Adyen/src/Model/Checkout/ApplePaySessionRequest.cs diff --git a/Adyen/Model/Checkout/ApplePaySessionResponse.cs b/Adyen/src/Model/Checkout/ApplePaySessionResponse.cs similarity index 100% rename from Adyen/Model/Checkout/ApplePaySessionResponse.cs rename to Adyen/src/Model/Checkout/ApplePaySessionResponse.cs diff --git a/Adyen/Model/Checkout/ApplicationInfo.cs b/Adyen/src/Model/Checkout/ApplicationInfo.cs similarity index 100% rename from Adyen/Model/Checkout/ApplicationInfo.cs rename to Adyen/src/Model/Checkout/ApplicationInfo.cs diff --git a/Adyen/Model/Checkout/AuthenticationData.cs b/Adyen/src/Model/Checkout/AuthenticationData.cs similarity index 100% rename from Adyen/Model/Checkout/AuthenticationData.cs rename to Adyen/src/Model/Checkout/AuthenticationData.cs diff --git a/Adyen/Model/Checkout/BacsDirectDebitDetails.cs b/Adyen/src/Model/Checkout/BacsDirectDebitDetails.cs similarity index 100% rename from Adyen/Model/Checkout/BacsDirectDebitDetails.cs rename to Adyen/src/Model/Checkout/BacsDirectDebitDetails.cs diff --git a/Adyen/Model/Checkout/BalanceCheckRequest.cs b/Adyen/src/Model/Checkout/BalanceCheckRequest.cs similarity index 100% rename from Adyen/Model/Checkout/BalanceCheckRequest.cs rename to Adyen/src/Model/Checkout/BalanceCheckRequest.cs diff --git a/Adyen/Model/Checkout/BalanceCheckResponse.cs b/Adyen/src/Model/Checkout/BalanceCheckResponse.cs similarity index 100% rename from Adyen/Model/Checkout/BalanceCheckResponse.cs rename to Adyen/src/Model/Checkout/BalanceCheckResponse.cs diff --git a/Adyen/Model/Checkout/BillDeskDetails.cs b/Adyen/src/Model/Checkout/BillDeskDetails.cs similarity index 100% rename from Adyen/Model/Checkout/BillDeskDetails.cs rename to Adyen/src/Model/Checkout/BillDeskDetails.cs diff --git a/Adyen/Model/Checkout/BillingAddress.cs b/Adyen/src/Model/Checkout/BillingAddress.cs similarity index 100% rename from Adyen/Model/Checkout/BillingAddress.cs rename to Adyen/src/Model/Checkout/BillingAddress.cs diff --git a/Adyen/Model/Checkout/BlikDetails.cs b/Adyen/src/Model/Checkout/BlikDetails.cs similarity index 100% rename from Adyen/Model/Checkout/BlikDetails.cs rename to Adyen/src/Model/Checkout/BlikDetails.cs diff --git a/Adyen/Model/Checkout/BrowserInfo.cs b/Adyen/src/Model/Checkout/BrowserInfo.cs similarity index 100% rename from Adyen/Model/Checkout/BrowserInfo.cs rename to Adyen/src/Model/Checkout/BrowserInfo.cs diff --git a/Adyen/Model/Checkout/CancelOrderRequest.cs b/Adyen/src/Model/Checkout/CancelOrderRequest.cs similarity index 100% rename from Adyen/Model/Checkout/CancelOrderRequest.cs rename to Adyen/src/Model/Checkout/CancelOrderRequest.cs diff --git a/Adyen/Model/Checkout/CancelOrderResponse.cs b/Adyen/src/Model/Checkout/CancelOrderResponse.cs similarity index 100% rename from Adyen/Model/Checkout/CancelOrderResponse.cs rename to Adyen/src/Model/Checkout/CancelOrderResponse.cs diff --git a/Adyen/Model/Checkout/CardBrandDetails.cs b/Adyen/src/Model/Checkout/CardBrandDetails.cs similarity index 100% rename from Adyen/Model/Checkout/CardBrandDetails.cs rename to Adyen/src/Model/Checkout/CardBrandDetails.cs diff --git a/Adyen/Model/Checkout/CardDetails.cs b/Adyen/src/Model/Checkout/CardDetails.cs similarity index 100% rename from Adyen/Model/Checkout/CardDetails.cs rename to Adyen/src/Model/Checkout/CardDetails.cs diff --git a/Adyen/Model/Checkout/CardDetailsRequest.cs b/Adyen/src/Model/Checkout/CardDetailsRequest.cs similarity index 100% rename from Adyen/Model/Checkout/CardDetailsRequest.cs rename to Adyen/src/Model/Checkout/CardDetailsRequest.cs diff --git a/Adyen/Model/Checkout/CardDetailsResponse.cs b/Adyen/src/Model/Checkout/CardDetailsResponse.cs similarity index 100% rename from Adyen/Model/Checkout/CardDetailsResponse.cs rename to Adyen/src/Model/Checkout/CardDetailsResponse.cs diff --git a/Adyen/Model/Checkout/CardDonations.cs b/Adyen/src/Model/Checkout/CardDonations.cs similarity index 100% rename from Adyen/Model/Checkout/CardDonations.cs rename to Adyen/src/Model/Checkout/CardDonations.cs diff --git a/Adyen/Model/Checkout/CashAppDetails.cs b/Adyen/src/Model/Checkout/CashAppDetails.cs similarity index 100% rename from Adyen/Model/Checkout/CashAppDetails.cs rename to Adyen/src/Model/Checkout/CashAppDetails.cs diff --git a/Adyen/Model/Checkout/CellulantDetails.cs b/Adyen/src/Model/Checkout/CellulantDetails.cs similarity index 100% rename from Adyen/Model/Checkout/CellulantDetails.cs rename to Adyen/src/Model/Checkout/CellulantDetails.cs diff --git a/Adyen/Model/Checkout/CheckoutAwaitAction.cs b/Adyen/src/Model/Checkout/CheckoutAwaitAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutAwaitAction.cs rename to Adyen/src/Model/Checkout/CheckoutAwaitAction.cs diff --git a/Adyen/Model/Checkout/CheckoutBankAccount.cs b/Adyen/src/Model/Checkout/CheckoutBankAccount.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutBankAccount.cs rename to Adyen/src/Model/Checkout/CheckoutBankAccount.cs diff --git a/Adyen/Model/Checkout/CheckoutBankTransferAction.cs b/Adyen/src/Model/Checkout/CheckoutBankTransferAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutBankTransferAction.cs rename to Adyen/src/Model/Checkout/CheckoutBankTransferAction.cs diff --git a/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs b/Adyen/src/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs rename to Adyen/src/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs diff --git a/Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs b/Adyen/src/Model/Checkout/CheckoutNativeRedirectAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs rename to Adyen/src/Model/Checkout/CheckoutNativeRedirectAction.cs diff --git a/Adyen/Model/Checkout/CheckoutOrderResponse.cs b/Adyen/src/Model/Checkout/CheckoutOrderResponse.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutOrderResponse.cs rename to Adyen/src/Model/Checkout/CheckoutOrderResponse.cs diff --git a/Adyen/Model/Checkout/CheckoutPaymentMethod.cs b/Adyen/src/Model/Checkout/CheckoutPaymentMethod.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutPaymentMethod.cs rename to Adyen/src/Model/Checkout/CheckoutPaymentMethod.cs diff --git a/Adyen/Model/Checkout/CheckoutQrCodeAction.cs b/Adyen/src/Model/Checkout/CheckoutQrCodeAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutQrCodeAction.cs rename to Adyen/src/Model/Checkout/CheckoutQrCodeAction.cs diff --git a/Adyen/Model/Checkout/CheckoutRedirectAction.cs b/Adyen/src/Model/Checkout/CheckoutRedirectAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutRedirectAction.cs rename to Adyen/src/Model/Checkout/CheckoutRedirectAction.cs diff --git a/Adyen/Model/Checkout/CheckoutSDKAction.cs b/Adyen/src/Model/Checkout/CheckoutSDKAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutSDKAction.cs rename to Adyen/src/Model/Checkout/CheckoutSDKAction.cs diff --git a/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs b/Adyen/src/Model/Checkout/CheckoutSessionInstallmentOption.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs rename to Adyen/src/Model/Checkout/CheckoutSessionInstallmentOption.cs diff --git a/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs b/Adyen/src/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs rename to Adyen/src/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs diff --git a/Adyen/Model/Checkout/CheckoutThreeDS2Action.cs b/Adyen/src/Model/Checkout/CheckoutThreeDS2Action.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutThreeDS2Action.cs rename to Adyen/src/Model/Checkout/CheckoutThreeDS2Action.cs diff --git a/Adyen/Model/Checkout/CheckoutVoucherAction.cs b/Adyen/src/Model/Checkout/CheckoutVoucherAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutVoucherAction.cs rename to Adyen/src/Model/Checkout/CheckoutVoucherAction.cs diff --git a/Adyen/Model/Checkout/CommonField.cs b/Adyen/src/Model/Checkout/CommonField.cs similarity index 100% rename from Adyen/Model/Checkout/CommonField.cs rename to Adyen/src/Model/Checkout/CommonField.cs diff --git a/Adyen/Model/Checkout/Company.cs b/Adyen/src/Model/Checkout/Company.cs similarity index 100% rename from Adyen/Model/Checkout/Company.cs rename to Adyen/src/Model/Checkout/Company.cs diff --git a/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs b/Adyen/src/Model/Checkout/CreateCheckoutSessionRequest.cs similarity index 100% rename from Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs rename to Adyen/src/Model/Checkout/CreateCheckoutSessionRequest.cs diff --git a/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs b/Adyen/src/Model/Checkout/CreateCheckoutSessionResponse.cs similarity index 100% rename from Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs rename to Adyen/src/Model/Checkout/CreateCheckoutSessionResponse.cs diff --git a/Adyen/Model/Checkout/CreateOrderRequest.cs b/Adyen/src/Model/Checkout/CreateOrderRequest.cs similarity index 100% rename from Adyen/Model/Checkout/CreateOrderRequest.cs rename to Adyen/src/Model/Checkout/CreateOrderRequest.cs diff --git a/Adyen/Model/Checkout/CreateOrderResponse.cs b/Adyen/src/Model/Checkout/CreateOrderResponse.cs similarity index 100% rename from Adyen/Model/Checkout/CreateOrderResponse.cs rename to Adyen/src/Model/Checkout/CreateOrderResponse.cs diff --git a/Adyen/Model/Checkout/DeliveryAddress.cs b/Adyen/src/Model/Checkout/DeliveryAddress.cs similarity index 100% rename from Adyen/Model/Checkout/DeliveryAddress.cs rename to Adyen/src/Model/Checkout/DeliveryAddress.cs diff --git a/Adyen/Model/Checkout/DeliveryMethod.cs b/Adyen/src/Model/Checkout/DeliveryMethod.cs similarity index 100% rename from Adyen/Model/Checkout/DeliveryMethod.cs rename to Adyen/src/Model/Checkout/DeliveryMethod.cs diff --git a/Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs b/Adyen/src/Model/Checkout/DetailsRequestAuthenticationData.cs similarity index 100% rename from Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs rename to Adyen/src/Model/Checkout/DetailsRequestAuthenticationData.cs diff --git a/Adyen/Model/Checkout/DeviceRenderOptions.cs b/Adyen/src/Model/Checkout/DeviceRenderOptions.cs similarity index 100% rename from Adyen/Model/Checkout/DeviceRenderOptions.cs rename to Adyen/src/Model/Checkout/DeviceRenderOptions.cs diff --git a/Adyen/Model/Checkout/DokuDetails.cs b/Adyen/src/Model/Checkout/DokuDetails.cs similarity index 100% rename from Adyen/Model/Checkout/DokuDetails.cs rename to Adyen/src/Model/Checkout/DokuDetails.cs diff --git a/Adyen/Model/Checkout/Donation.cs b/Adyen/src/Model/Checkout/Donation.cs similarity index 100% rename from Adyen/Model/Checkout/Donation.cs rename to Adyen/src/Model/Checkout/Donation.cs diff --git a/Adyen/Model/Checkout/DonationCampaign.cs b/Adyen/src/Model/Checkout/DonationCampaign.cs similarity index 100% rename from Adyen/Model/Checkout/DonationCampaign.cs rename to Adyen/src/Model/Checkout/DonationCampaign.cs diff --git a/Adyen/Model/Checkout/DonationCampaignsRequest.cs b/Adyen/src/Model/Checkout/DonationCampaignsRequest.cs similarity index 100% rename from Adyen/Model/Checkout/DonationCampaignsRequest.cs rename to Adyen/src/Model/Checkout/DonationCampaignsRequest.cs diff --git a/Adyen/Model/Checkout/DonationCampaignsResponse.cs b/Adyen/src/Model/Checkout/DonationCampaignsResponse.cs similarity index 100% rename from Adyen/Model/Checkout/DonationCampaignsResponse.cs rename to Adyen/src/Model/Checkout/DonationCampaignsResponse.cs diff --git a/Adyen/Model/Checkout/DonationPaymentMethod.cs b/Adyen/src/Model/Checkout/DonationPaymentMethod.cs similarity index 100% rename from Adyen/Model/Checkout/DonationPaymentMethod.cs rename to Adyen/src/Model/Checkout/DonationPaymentMethod.cs diff --git a/Adyen/Model/Checkout/DonationPaymentRequest.cs b/Adyen/src/Model/Checkout/DonationPaymentRequest.cs similarity index 100% rename from Adyen/Model/Checkout/DonationPaymentRequest.cs rename to Adyen/src/Model/Checkout/DonationPaymentRequest.cs diff --git a/Adyen/Model/Checkout/DonationPaymentResponse.cs b/Adyen/src/Model/Checkout/DonationPaymentResponse.cs similarity index 100% rename from Adyen/Model/Checkout/DonationPaymentResponse.cs rename to Adyen/src/Model/Checkout/DonationPaymentResponse.cs diff --git a/Adyen/Model/Checkout/DragonpayDetails.cs b/Adyen/src/Model/Checkout/DragonpayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/DragonpayDetails.cs rename to Adyen/src/Model/Checkout/DragonpayDetails.cs diff --git a/Adyen/Model/Checkout/EBankingFinlandDetails.cs b/Adyen/src/Model/Checkout/EBankingFinlandDetails.cs similarity index 100% rename from Adyen/Model/Checkout/EBankingFinlandDetails.cs rename to Adyen/src/Model/Checkout/EBankingFinlandDetails.cs diff --git a/Adyen/Model/Checkout/EcontextVoucherDetails.cs b/Adyen/src/Model/Checkout/EcontextVoucherDetails.cs similarity index 100% rename from Adyen/Model/Checkout/EcontextVoucherDetails.cs rename to Adyen/src/Model/Checkout/EcontextVoucherDetails.cs diff --git a/Adyen/Model/Checkout/EftDetails.cs b/Adyen/src/Model/Checkout/EftDetails.cs similarity index 100% rename from Adyen/Model/Checkout/EftDetails.cs rename to Adyen/src/Model/Checkout/EftDetails.cs diff --git a/Adyen/Model/Checkout/EncryptedOrderData.cs b/Adyen/src/Model/Checkout/EncryptedOrderData.cs similarity index 100% rename from Adyen/Model/Checkout/EncryptedOrderData.cs rename to Adyen/src/Model/Checkout/EncryptedOrderData.cs diff --git a/Adyen/Model/Checkout/EnhancedSchemeData.cs b/Adyen/src/Model/Checkout/EnhancedSchemeData.cs similarity index 100% rename from Adyen/Model/Checkout/EnhancedSchemeData.cs rename to Adyen/src/Model/Checkout/EnhancedSchemeData.cs diff --git a/Adyen/Model/Checkout/ExternalPlatform.cs b/Adyen/src/Model/Checkout/ExternalPlatform.cs similarity index 100% rename from Adyen/Model/Checkout/ExternalPlatform.cs rename to Adyen/src/Model/Checkout/ExternalPlatform.cs diff --git a/Adyen/Model/Checkout/FastlaneDetails.cs b/Adyen/src/Model/Checkout/FastlaneDetails.cs similarity index 100% rename from Adyen/Model/Checkout/FastlaneDetails.cs rename to Adyen/src/Model/Checkout/FastlaneDetails.cs diff --git a/Adyen/Model/Checkout/ForexQuote.cs b/Adyen/src/Model/Checkout/ForexQuote.cs similarity index 100% rename from Adyen/Model/Checkout/ForexQuote.cs rename to Adyen/src/Model/Checkout/ForexQuote.cs diff --git a/Adyen/Model/Checkout/FraudCheckResult.cs b/Adyen/src/Model/Checkout/FraudCheckResult.cs similarity index 100% rename from Adyen/Model/Checkout/FraudCheckResult.cs rename to Adyen/src/Model/Checkout/FraudCheckResult.cs diff --git a/Adyen/Model/Checkout/FraudResult.cs b/Adyen/src/Model/Checkout/FraudResult.cs similarity index 100% rename from Adyen/Model/Checkout/FraudResult.cs rename to Adyen/src/Model/Checkout/FraudResult.cs diff --git a/Adyen/Model/Checkout/FundOrigin.cs b/Adyen/src/Model/Checkout/FundOrigin.cs similarity index 100% rename from Adyen/Model/Checkout/FundOrigin.cs rename to Adyen/src/Model/Checkout/FundOrigin.cs diff --git a/Adyen/Model/Checkout/FundRecipient.cs b/Adyen/src/Model/Checkout/FundRecipient.cs similarity index 100% rename from Adyen/Model/Checkout/FundRecipient.cs rename to Adyen/src/Model/Checkout/FundRecipient.cs diff --git a/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs b/Adyen/src/Model/Checkout/GenericIssuerPaymentMethodDetails.cs similarity index 100% rename from Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs rename to Adyen/src/Model/Checkout/GenericIssuerPaymentMethodDetails.cs diff --git a/Adyen/Model/Checkout/GooglePayDetails.cs b/Adyen/src/Model/Checkout/GooglePayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/GooglePayDetails.cs rename to Adyen/src/Model/Checkout/GooglePayDetails.cs diff --git a/Adyen/Model/Checkout/GooglePayDonations.cs b/Adyen/src/Model/Checkout/GooglePayDonations.cs similarity index 100% rename from Adyen/Model/Checkout/GooglePayDonations.cs rename to Adyen/src/Model/Checkout/GooglePayDonations.cs diff --git a/Adyen/Model/Checkout/IdealDetails.cs b/Adyen/src/Model/Checkout/IdealDetails.cs similarity index 100% rename from Adyen/Model/Checkout/IdealDetails.cs rename to Adyen/src/Model/Checkout/IdealDetails.cs diff --git a/Adyen/Model/Checkout/IdealDonations.cs b/Adyen/src/Model/Checkout/IdealDonations.cs similarity index 100% rename from Adyen/Model/Checkout/IdealDonations.cs rename to Adyen/src/Model/Checkout/IdealDonations.cs diff --git a/Adyen/Model/Checkout/InputDetail.cs b/Adyen/src/Model/Checkout/InputDetail.cs similarity index 100% rename from Adyen/Model/Checkout/InputDetail.cs rename to Adyen/src/Model/Checkout/InputDetail.cs diff --git a/Adyen/Model/Checkout/InstallmentOption.cs b/Adyen/src/Model/Checkout/InstallmentOption.cs similarity index 100% rename from Adyen/Model/Checkout/InstallmentOption.cs rename to Adyen/src/Model/Checkout/InstallmentOption.cs diff --git a/Adyen/Model/Checkout/Installments.cs b/Adyen/src/Model/Checkout/Installments.cs similarity index 100% rename from Adyen/Model/Checkout/Installments.cs rename to Adyen/src/Model/Checkout/Installments.cs diff --git a/Adyen/Model/Checkout/Item.cs b/Adyen/src/Model/Checkout/Item.cs similarity index 100% rename from Adyen/Model/Checkout/Item.cs rename to Adyen/src/Model/Checkout/Item.cs diff --git a/Adyen/Model/Checkout/KlarnaDetails.cs b/Adyen/src/Model/Checkout/KlarnaDetails.cs similarity index 100% rename from Adyen/Model/Checkout/KlarnaDetails.cs rename to Adyen/src/Model/Checkout/KlarnaDetails.cs diff --git a/Adyen/Model/Checkout/Leg.cs b/Adyen/src/Model/Checkout/Leg.cs similarity index 100% rename from Adyen/Model/Checkout/Leg.cs rename to Adyen/src/Model/Checkout/Leg.cs diff --git a/Adyen/Model/Checkout/LineItem.cs b/Adyen/src/Model/Checkout/LineItem.cs similarity index 100% rename from Adyen/Model/Checkout/LineItem.cs rename to Adyen/src/Model/Checkout/LineItem.cs diff --git a/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs b/Adyen/src/Model/Checkout/ListStoredPaymentMethodsResponse.cs similarity index 100% rename from Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs rename to Adyen/src/Model/Checkout/ListStoredPaymentMethodsResponse.cs diff --git a/Adyen/Model/Checkout/Mandate.cs b/Adyen/src/Model/Checkout/Mandate.cs similarity index 100% rename from Adyen/Model/Checkout/Mandate.cs rename to Adyen/src/Model/Checkout/Mandate.cs diff --git a/Adyen/Model/Checkout/MasterpassDetails.cs b/Adyen/src/Model/Checkout/MasterpassDetails.cs similarity index 100% rename from Adyen/Model/Checkout/MasterpassDetails.cs rename to Adyen/src/Model/Checkout/MasterpassDetails.cs diff --git a/Adyen/Model/Checkout/MbwayDetails.cs b/Adyen/src/Model/Checkout/MbwayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/MbwayDetails.cs rename to Adyen/src/Model/Checkout/MbwayDetails.cs diff --git a/Adyen/Model/Checkout/MerchantDevice.cs b/Adyen/src/Model/Checkout/MerchantDevice.cs similarity index 100% rename from Adyen/Model/Checkout/MerchantDevice.cs rename to Adyen/src/Model/Checkout/MerchantDevice.cs diff --git a/Adyen/Model/Checkout/MerchantRiskIndicator.cs b/Adyen/src/Model/Checkout/MerchantRiskIndicator.cs similarity index 100% rename from Adyen/Model/Checkout/MerchantRiskIndicator.cs rename to Adyen/src/Model/Checkout/MerchantRiskIndicator.cs diff --git a/Adyen/Model/Checkout/MobilePayDetails.cs b/Adyen/src/Model/Checkout/MobilePayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/MobilePayDetails.cs rename to Adyen/src/Model/Checkout/MobilePayDetails.cs diff --git a/Adyen/Model/Checkout/MolPayDetails.cs b/Adyen/src/Model/Checkout/MolPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/MolPayDetails.cs rename to Adyen/src/Model/Checkout/MolPayDetails.cs diff --git a/Adyen/Model/Checkout/Name.cs b/Adyen/src/Model/Checkout/Name.cs similarity index 100% rename from Adyen/Model/Checkout/Name.cs rename to Adyen/src/Model/Checkout/Name.cs diff --git a/Adyen/Model/Checkout/OpenInvoiceDetails.cs b/Adyen/src/Model/Checkout/OpenInvoiceDetails.cs similarity index 100% rename from Adyen/Model/Checkout/OpenInvoiceDetails.cs rename to Adyen/src/Model/Checkout/OpenInvoiceDetails.cs diff --git a/Adyen/Model/Checkout/Passenger.cs b/Adyen/src/Model/Checkout/Passenger.cs similarity index 100% rename from Adyen/Model/Checkout/Passenger.cs rename to Adyen/src/Model/Checkout/Passenger.cs diff --git a/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs b/Adyen/src/Model/Checkout/PayByBankAISDirectDebitDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs rename to Adyen/src/Model/Checkout/PayByBankAISDirectDebitDetails.cs diff --git a/Adyen/Model/Checkout/PayByBankDetails.cs b/Adyen/src/Model/Checkout/PayByBankDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayByBankDetails.cs rename to Adyen/src/Model/Checkout/PayByBankDetails.cs diff --git a/Adyen/Model/Checkout/PayPalDetails.cs b/Adyen/src/Model/Checkout/PayPalDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayPalDetails.cs rename to Adyen/src/Model/Checkout/PayPalDetails.cs diff --git a/Adyen/Model/Checkout/PayPayDetails.cs b/Adyen/src/Model/Checkout/PayPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayPayDetails.cs rename to Adyen/src/Model/Checkout/PayPayDetails.cs diff --git a/Adyen/Model/Checkout/PayToDetails.cs b/Adyen/src/Model/Checkout/PayToDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayToDetails.cs rename to Adyen/src/Model/Checkout/PayToDetails.cs diff --git a/Adyen/Model/Checkout/PayUUpiDetails.cs b/Adyen/src/Model/Checkout/PayUUpiDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayUUpiDetails.cs rename to Adyen/src/Model/Checkout/PayUUpiDetails.cs diff --git a/Adyen/Model/Checkout/PayWithGoogleDetails.cs b/Adyen/src/Model/Checkout/PayWithGoogleDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayWithGoogleDetails.cs rename to Adyen/src/Model/Checkout/PayWithGoogleDetails.cs diff --git a/Adyen/Model/Checkout/PayWithGoogleDonations.cs b/Adyen/src/Model/Checkout/PayWithGoogleDonations.cs similarity index 100% rename from Adyen/Model/Checkout/PayWithGoogleDonations.cs rename to Adyen/src/Model/Checkout/PayWithGoogleDonations.cs diff --git a/Adyen/Model/Checkout/Payment.cs b/Adyen/src/Model/Checkout/Payment.cs similarity index 100% rename from Adyen/Model/Checkout/Payment.cs rename to Adyen/src/Model/Checkout/Payment.cs diff --git a/Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs b/Adyen/src/Model/Checkout/PaymentAmountUpdateRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs rename to Adyen/src/Model/Checkout/PaymentAmountUpdateRequest.cs diff --git a/Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs b/Adyen/src/Model/Checkout/PaymentAmountUpdateResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs rename to Adyen/src/Model/Checkout/PaymentAmountUpdateResponse.cs diff --git a/Adyen/Model/Checkout/PaymentCancelRequest.cs b/Adyen/src/Model/Checkout/PaymentCancelRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentCancelRequest.cs rename to Adyen/src/Model/Checkout/PaymentCancelRequest.cs diff --git a/Adyen/Model/Checkout/PaymentCancelResponse.cs b/Adyen/src/Model/Checkout/PaymentCancelResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentCancelResponse.cs rename to Adyen/src/Model/Checkout/PaymentCancelResponse.cs diff --git a/Adyen/Model/Checkout/PaymentCaptureRequest.cs b/Adyen/src/Model/Checkout/PaymentCaptureRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentCaptureRequest.cs rename to Adyen/src/Model/Checkout/PaymentCaptureRequest.cs diff --git a/Adyen/Model/Checkout/PaymentCaptureResponse.cs b/Adyen/src/Model/Checkout/PaymentCaptureResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentCaptureResponse.cs rename to Adyen/src/Model/Checkout/PaymentCaptureResponse.cs diff --git a/Adyen/Model/Checkout/PaymentCompletionDetails.cs b/Adyen/src/Model/Checkout/PaymentCompletionDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentCompletionDetails.cs rename to Adyen/src/Model/Checkout/PaymentCompletionDetails.cs diff --git a/Adyen/Model/Checkout/PaymentDetails.cs b/Adyen/src/Model/Checkout/PaymentDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentDetails.cs rename to Adyen/src/Model/Checkout/PaymentDetails.cs diff --git a/Adyen/Model/Checkout/PaymentDetailsRequest.cs b/Adyen/src/Model/Checkout/PaymentDetailsRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentDetailsRequest.cs rename to Adyen/src/Model/Checkout/PaymentDetailsRequest.cs diff --git a/Adyen/Model/Checkout/PaymentDetailsResponse.cs b/Adyen/src/Model/Checkout/PaymentDetailsResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentDetailsResponse.cs rename to Adyen/src/Model/Checkout/PaymentDetailsResponse.cs diff --git a/Adyen/Model/Checkout/PaymentLinkRequest.cs b/Adyen/src/Model/Checkout/PaymentLinkRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentLinkRequest.cs rename to Adyen/src/Model/Checkout/PaymentLinkRequest.cs diff --git a/Adyen/Model/Checkout/PaymentLinkResponse.cs b/Adyen/src/Model/Checkout/PaymentLinkResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentLinkResponse.cs rename to Adyen/src/Model/Checkout/PaymentLinkResponse.cs diff --git a/Adyen/Model/Checkout/PaymentMethod.cs b/Adyen/src/Model/Checkout/PaymentMethod.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethod.cs rename to Adyen/src/Model/Checkout/PaymentMethod.cs diff --git a/Adyen/Model/Checkout/PaymentMethodGroup.cs b/Adyen/src/Model/Checkout/PaymentMethodGroup.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethodGroup.cs rename to Adyen/src/Model/Checkout/PaymentMethodGroup.cs diff --git a/Adyen/Model/Checkout/PaymentMethodIssuer.cs b/Adyen/src/Model/Checkout/PaymentMethodIssuer.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethodIssuer.cs rename to Adyen/src/Model/Checkout/PaymentMethodIssuer.cs diff --git a/Adyen/Model/Checkout/PaymentMethodToStore.cs b/Adyen/src/Model/Checkout/PaymentMethodToStore.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethodToStore.cs rename to Adyen/src/Model/Checkout/PaymentMethodToStore.cs diff --git a/Adyen/Model/Checkout/PaymentMethodUPIApps.cs b/Adyen/src/Model/Checkout/PaymentMethodUPIApps.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethodUPIApps.cs rename to Adyen/src/Model/Checkout/PaymentMethodUPIApps.cs diff --git a/Adyen/Model/Checkout/PaymentMethodsRequest.cs b/Adyen/src/Model/Checkout/PaymentMethodsRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethodsRequest.cs rename to Adyen/src/Model/Checkout/PaymentMethodsRequest.cs diff --git a/Adyen/Model/Checkout/PaymentMethodsResponse.cs b/Adyen/src/Model/Checkout/PaymentMethodsResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethodsResponse.cs rename to Adyen/src/Model/Checkout/PaymentMethodsResponse.cs diff --git a/Adyen/Model/Checkout/PaymentRefundRequest.cs b/Adyen/src/Model/Checkout/PaymentRefundRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentRefundRequest.cs rename to Adyen/src/Model/Checkout/PaymentRefundRequest.cs diff --git a/Adyen/Model/Checkout/PaymentRefundResponse.cs b/Adyen/src/Model/Checkout/PaymentRefundResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentRefundResponse.cs rename to Adyen/src/Model/Checkout/PaymentRefundResponse.cs diff --git a/Adyen/Model/Checkout/PaymentRequest.cs b/Adyen/src/Model/Checkout/PaymentRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentRequest.cs rename to Adyen/src/Model/Checkout/PaymentRequest.cs diff --git a/Adyen/Model/Checkout/PaymentResponse.cs b/Adyen/src/Model/Checkout/PaymentResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentResponse.cs rename to Adyen/src/Model/Checkout/PaymentResponse.cs diff --git a/Adyen/Model/Checkout/PaymentResponseAction.cs b/Adyen/src/Model/Checkout/PaymentResponseAction.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentResponseAction.cs rename to Adyen/src/Model/Checkout/PaymentResponseAction.cs diff --git a/Adyen/Model/Checkout/PaymentReversalRequest.cs b/Adyen/src/Model/Checkout/PaymentReversalRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentReversalRequest.cs rename to Adyen/src/Model/Checkout/PaymentReversalRequest.cs diff --git a/Adyen/Model/Checkout/PaymentReversalResponse.cs b/Adyen/src/Model/Checkout/PaymentReversalResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentReversalResponse.cs rename to Adyen/src/Model/Checkout/PaymentReversalResponse.cs diff --git a/Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs b/Adyen/src/Model/Checkout/PaypalUpdateOrderRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs rename to Adyen/src/Model/Checkout/PaypalUpdateOrderRequest.cs diff --git a/Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs b/Adyen/src/Model/Checkout/PaypalUpdateOrderResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs rename to Adyen/src/Model/Checkout/PaypalUpdateOrderResponse.cs diff --git a/Adyen/Model/Checkout/Phone.cs b/Adyen/src/Model/Checkout/Phone.cs similarity index 100% rename from Adyen/Model/Checkout/Phone.cs rename to Adyen/src/Model/Checkout/Phone.cs diff --git a/Adyen/Model/Checkout/PixDetails.cs b/Adyen/src/Model/Checkout/PixDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PixDetails.cs rename to Adyen/src/Model/Checkout/PixDetails.cs diff --git a/Adyen/Model/Checkout/PixRecurring.cs b/Adyen/src/Model/Checkout/PixRecurring.cs similarity index 100% rename from Adyen/Model/Checkout/PixRecurring.cs rename to Adyen/src/Model/Checkout/PixRecurring.cs diff --git a/Adyen/Model/Checkout/PlatformChargebackLogic.cs b/Adyen/src/Model/Checkout/PlatformChargebackLogic.cs similarity index 100% rename from Adyen/Model/Checkout/PlatformChargebackLogic.cs rename to Adyen/src/Model/Checkout/PlatformChargebackLogic.cs diff --git a/Adyen/Model/Checkout/PseDetails.cs b/Adyen/src/Model/Checkout/PseDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PseDetails.cs rename to Adyen/src/Model/Checkout/PseDetails.cs diff --git a/Adyen/Model/Checkout/RakutenPayDetails.cs b/Adyen/src/Model/Checkout/RakutenPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/RakutenPayDetails.cs rename to Adyen/src/Model/Checkout/RakutenPayDetails.cs diff --git a/Adyen/Model/Checkout/RatepayDetails.cs b/Adyen/src/Model/Checkout/RatepayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/RatepayDetails.cs rename to Adyen/src/Model/Checkout/RatepayDetails.cs diff --git a/Adyen/Model/Checkout/Recurring.cs b/Adyen/src/Model/Checkout/Recurring.cs similarity index 100% rename from Adyen/Model/Checkout/Recurring.cs rename to Adyen/src/Model/Checkout/Recurring.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs b/Adyen/src/Model/Checkout/ResponseAdditionalData3DSecure.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalData3DSecure.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataBillingAddress.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataBillingAddress.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataCard.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataCard.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataCard.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataCard.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataCommon.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataCommon.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataDomesticError.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataDomesticError.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataInstallments.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataInstallments.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataOpi.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataOpi.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataSepa.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataSepa.cs diff --git a/Adyen/Model/Checkout/ResponsePaymentMethod.cs b/Adyen/src/Model/Checkout/ResponsePaymentMethod.cs similarity index 100% rename from Adyen/Model/Checkout/ResponsePaymentMethod.cs rename to Adyen/src/Model/Checkout/ResponsePaymentMethod.cs diff --git a/Adyen/Model/Checkout/RiskData.cs b/Adyen/src/Model/Checkout/RiskData.cs similarity index 100% rename from Adyen/Model/Checkout/RiskData.cs rename to Adyen/src/Model/Checkout/RiskData.cs diff --git a/Adyen/Model/Checkout/RivertyDetails.cs b/Adyen/src/Model/Checkout/RivertyDetails.cs similarity index 100% rename from Adyen/Model/Checkout/RivertyDetails.cs rename to Adyen/src/Model/Checkout/RivertyDetails.cs diff --git a/Adyen/Model/Checkout/SDKEphemPubKey.cs b/Adyen/src/Model/Checkout/SDKEphemPubKey.cs similarity index 100% rename from Adyen/Model/Checkout/SDKEphemPubKey.cs rename to Adyen/src/Model/Checkout/SDKEphemPubKey.cs diff --git a/Adyen/Model/Checkout/SamsungPayDetails.cs b/Adyen/src/Model/Checkout/SamsungPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/SamsungPayDetails.cs rename to Adyen/src/Model/Checkout/SamsungPayDetails.cs diff --git a/Adyen/Model/Checkout/SepaDirectDebitDetails.cs b/Adyen/src/Model/Checkout/SepaDirectDebitDetails.cs similarity index 100% rename from Adyen/Model/Checkout/SepaDirectDebitDetails.cs rename to Adyen/src/Model/Checkout/SepaDirectDebitDetails.cs diff --git a/Adyen/Model/Checkout/ServiceError.cs b/Adyen/src/Model/Checkout/ServiceError.cs similarity index 100% rename from Adyen/Model/Checkout/ServiceError.cs rename to Adyen/src/Model/Checkout/ServiceError.cs diff --git a/Adyen/Model/Checkout/SessionResultResponse.cs b/Adyen/src/Model/Checkout/SessionResultResponse.cs similarity index 100% rename from Adyen/Model/Checkout/SessionResultResponse.cs rename to Adyen/src/Model/Checkout/SessionResultResponse.cs diff --git a/Adyen/Model/Checkout/ShopperInteractionDevice.cs b/Adyen/src/Model/Checkout/ShopperInteractionDevice.cs similarity index 100% rename from Adyen/Model/Checkout/ShopperInteractionDevice.cs rename to Adyen/src/Model/Checkout/ShopperInteractionDevice.cs diff --git a/Adyen/Model/Checkout/Split.cs b/Adyen/src/Model/Checkout/Split.cs similarity index 100% rename from Adyen/Model/Checkout/Split.cs rename to Adyen/src/Model/Checkout/Split.cs diff --git a/Adyen/Model/Checkout/SplitAmount.cs b/Adyen/src/Model/Checkout/SplitAmount.cs similarity index 100% rename from Adyen/Model/Checkout/SplitAmount.cs rename to Adyen/src/Model/Checkout/SplitAmount.cs diff --git a/Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs b/Adyen/src/Model/Checkout/StandalonePaymentCancelRequest.cs similarity index 100% rename from Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs rename to Adyen/src/Model/Checkout/StandalonePaymentCancelRequest.cs diff --git a/Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs b/Adyen/src/Model/Checkout/StandalonePaymentCancelResponse.cs similarity index 100% rename from Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs rename to Adyen/src/Model/Checkout/StandalonePaymentCancelResponse.cs diff --git a/Adyen/Model/Checkout/StoredPaymentMethod.cs b/Adyen/src/Model/Checkout/StoredPaymentMethod.cs similarity index 100% rename from Adyen/Model/Checkout/StoredPaymentMethod.cs rename to Adyen/src/Model/Checkout/StoredPaymentMethod.cs diff --git a/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs b/Adyen/src/Model/Checkout/StoredPaymentMethodDetails.cs similarity index 100% rename from Adyen/Model/Checkout/StoredPaymentMethodDetails.cs rename to Adyen/src/Model/Checkout/StoredPaymentMethodDetails.cs diff --git a/Adyen/Model/Checkout/StoredPaymentMethodRequest.cs b/Adyen/src/Model/Checkout/StoredPaymentMethodRequest.cs similarity index 100% rename from Adyen/Model/Checkout/StoredPaymentMethodRequest.cs rename to Adyen/src/Model/Checkout/StoredPaymentMethodRequest.cs diff --git a/Adyen/Model/Checkout/StoredPaymentMethodResource.cs b/Adyen/src/Model/Checkout/StoredPaymentMethodResource.cs similarity index 100% rename from Adyen/Model/Checkout/StoredPaymentMethodResource.cs rename to Adyen/src/Model/Checkout/StoredPaymentMethodResource.cs diff --git a/Adyen/Model/Checkout/SubInputDetail.cs b/Adyen/src/Model/Checkout/SubInputDetail.cs similarity index 100% rename from Adyen/Model/Checkout/SubInputDetail.cs rename to Adyen/src/Model/Checkout/SubInputDetail.cs diff --git a/Adyen/Model/Checkout/SubMerchant.cs b/Adyen/src/Model/Checkout/SubMerchant.cs similarity index 100% rename from Adyen/Model/Checkout/SubMerchant.cs rename to Adyen/src/Model/Checkout/SubMerchant.cs diff --git a/Adyen/Model/Checkout/SubMerchantInfo.cs b/Adyen/src/Model/Checkout/SubMerchantInfo.cs similarity index 100% rename from Adyen/Model/Checkout/SubMerchantInfo.cs rename to Adyen/src/Model/Checkout/SubMerchantInfo.cs diff --git a/Adyen/Model/Checkout/Surcharge.cs b/Adyen/src/Model/Checkout/Surcharge.cs similarity index 100% rename from Adyen/Model/Checkout/Surcharge.cs rename to Adyen/src/Model/Checkout/Surcharge.cs diff --git a/Adyen/Model/Checkout/TaxTotal.cs b/Adyen/src/Model/Checkout/TaxTotal.cs similarity index 100% rename from Adyen/Model/Checkout/TaxTotal.cs rename to Adyen/src/Model/Checkout/TaxTotal.cs diff --git a/Adyen/Model/Checkout/ThreeDS2RequestData.cs b/Adyen/src/Model/Checkout/ThreeDS2RequestData.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDS2RequestData.cs rename to Adyen/src/Model/Checkout/ThreeDS2RequestData.cs diff --git a/Adyen/Model/Checkout/ThreeDS2RequestFields.cs b/Adyen/src/Model/Checkout/ThreeDS2RequestFields.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDS2RequestFields.cs rename to Adyen/src/Model/Checkout/ThreeDS2RequestFields.cs diff --git a/Adyen/Model/Checkout/ThreeDS2ResponseData.cs b/Adyen/src/Model/Checkout/ThreeDS2ResponseData.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDS2ResponseData.cs rename to Adyen/src/Model/Checkout/ThreeDS2ResponseData.cs diff --git a/Adyen/Model/Checkout/ThreeDS2Result.cs b/Adyen/src/Model/Checkout/ThreeDS2Result.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDS2Result.cs rename to Adyen/src/Model/Checkout/ThreeDS2Result.cs diff --git a/Adyen/Model/Checkout/ThreeDSRequestData.cs b/Adyen/src/Model/Checkout/ThreeDSRequestData.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDSRequestData.cs rename to Adyen/src/Model/Checkout/ThreeDSRequestData.cs diff --git a/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs b/Adyen/src/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs rename to Adyen/src/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs diff --git a/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs b/Adyen/src/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs rename to Adyen/src/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs diff --git a/Adyen/Model/Checkout/ThreeDSecureData.cs b/Adyen/src/Model/Checkout/ThreeDSecureData.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDSecureData.cs rename to Adyen/src/Model/Checkout/ThreeDSecureData.cs diff --git a/Adyen/Model/Checkout/Ticket.cs b/Adyen/src/Model/Checkout/Ticket.cs similarity index 100% rename from Adyen/Model/Checkout/Ticket.cs rename to Adyen/src/Model/Checkout/Ticket.cs diff --git a/Adyen/Model/Checkout/TravelAgency.cs b/Adyen/src/Model/Checkout/TravelAgency.cs similarity index 100% rename from Adyen/Model/Checkout/TravelAgency.cs rename to Adyen/src/Model/Checkout/TravelAgency.cs diff --git a/Adyen/Model/Checkout/TwintDetails.cs b/Adyen/src/Model/Checkout/TwintDetails.cs similarity index 100% rename from Adyen/Model/Checkout/TwintDetails.cs rename to Adyen/src/Model/Checkout/TwintDetails.cs diff --git a/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs b/Adyen/src/Model/Checkout/UpdatePaymentLinkRequest.cs similarity index 100% rename from Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs rename to Adyen/src/Model/Checkout/UpdatePaymentLinkRequest.cs diff --git a/Adyen/Model/Checkout/UpiCollectDetails.cs b/Adyen/src/Model/Checkout/UpiCollectDetails.cs similarity index 100% rename from Adyen/Model/Checkout/UpiCollectDetails.cs rename to Adyen/src/Model/Checkout/UpiCollectDetails.cs diff --git a/Adyen/Model/Checkout/UpiIntentDetails.cs b/Adyen/src/Model/Checkout/UpiIntentDetails.cs similarity index 100% rename from Adyen/Model/Checkout/UpiIntentDetails.cs rename to Adyen/src/Model/Checkout/UpiIntentDetails.cs diff --git a/Adyen/Model/Checkout/UtilityRequest.cs b/Adyen/src/Model/Checkout/UtilityRequest.cs similarity index 100% rename from Adyen/Model/Checkout/UtilityRequest.cs rename to Adyen/src/Model/Checkout/UtilityRequest.cs diff --git a/Adyen/Model/Checkout/UtilityResponse.cs b/Adyen/src/Model/Checkout/UtilityResponse.cs similarity index 100% rename from Adyen/Model/Checkout/UtilityResponse.cs rename to Adyen/src/Model/Checkout/UtilityResponse.cs diff --git a/Adyen/Model/Checkout/VippsDetails.cs b/Adyen/src/Model/Checkout/VippsDetails.cs similarity index 100% rename from Adyen/Model/Checkout/VippsDetails.cs rename to Adyen/src/Model/Checkout/VippsDetails.cs diff --git a/Adyen/Model/Checkout/VisaCheckoutDetails.cs b/Adyen/src/Model/Checkout/VisaCheckoutDetails.cs similarity index 100% rename from Adyen/Model/Checkout/VisaCheckoutDetails.cs rename to Adyen/src/Model/Checkout/VisaCheckoutDetails.cs diff --git a/Adyen/Model/Checkout/WeChatPayDetails.cs b/Adyen/src/Model/Checkout/WeChatPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/WeChatPayDetails.cs rename to Adyen/src/Model/Checkout/WeChatPayDetails.cs diff --git a/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs b/Adyen/src/Model/Checkout/WeChatPayMiniProgramDetails.cs similarity index 100% rename from Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs rename to Adyen/src/Model/Checkout/WeChatPayMiniProgramDetails.cs diff --git a/Adyen/Model/Checkout/ZipDetails.cs b/Adyen/src/Model/Checkout/ZipDetails.cs similarity index 100% rename from Adyen/Model/Checkout/ZipDetails.cs rename to Adyen/src/Model/Checkout/ZipDetails.cs diff --git a/Adyen/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/ConfigurationWebhooks/AccountHolder.cs b/Adyen/src/Model/ConfigurationWebhooks/AccountHolder.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/AccountHolder.cs rename to Adyen/src/Model/ConfigurationWebhooks/AccountHolder.cs diff --git a/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.cs b/Adyen/src/Model/ConfigurationWebhooks/AccountHolderCapability.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.cs rename to Adyen/src/Model/ConfigurationWebhooks/AccountHolderCapability.cs diff --git a/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs b/Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs rename to Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs diff --git a/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs b/Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs rename to Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs diff --git a/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs b/Adyen/src/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs rename to Adyen/src/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Address.cs b/Adyen/src/Model/ConfigurationWebhooks/Address.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Address.cs rename to Adyen/src/Model/ConfigurationWebhooks/Address.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Amount.cs b/Adyen/src/Model/ConfigurationWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Amount.cs rename to Adyen/src/Model/ConfigurationWebhooks/Amount.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Authentication.cs b/Adyen/src/Model/ConfigurationWebhooks/Authentication.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Authentication.cs rename to Adyen/src/Model/ConfigurationWebhooks/Authentication.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Balance.cs b/Adyen/src/Model/ConfigurationWebhooks/Balance.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Balance.cs rename to Adyen/src/Model/ConfigurationWebhooks/Balance.cs diff --git a/Adyen/Model/ConfigurationWebhooks/BalanceAccount.cs b/Adyen/src/Model/ConfigurationWebhooks/BalanceAccount.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/BalanceAccount.cs rename to Adyen/src/Model/ConfigurationWebhooks/BalanceAccount.cs diff --git a/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs b/Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs rename to Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs diff --git a/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs b/Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs rename to Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs diff --git a/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/src/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/src/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.cs b/Adyen/src/Model/ConfigurationWebhooks/BankAccountDetails.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/BankAccountDetails.cs rename to Adyen/src/Model/ConfigurationWebhooks/BankAccountDetails.cs diff --git a/Adyen/Model/ConfigurationWebhooks/BulkAddress.cs b/Adyen/src/Model/ConfigurationWebhooks/BulkAddress.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/BulkAddress.cs rename to Adyen/src/Model/ConfigurationWebhooks/BulkAddress.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CapabilityProblem.cs b/Adyen/src/Model/ConfigurationWebhooks/CapabilityProblem.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CapabilityProblem.cs rename to Adyen/src/Model/ConfigurationWebhooks/CapabilityProblem.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs b/Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs rename to Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs b/Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs rename to Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.cs b/Adyen/src/Model/ConfigurationWebhooks/CapabilitySettings.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CapabilitySettings.cs rename to Adyen/src/Model/ConfigurationWebhooks/CapabilitySettings.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Card.cs b/Adyen/src/Model/ConfigurationWebhooks/Card.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Card.cs rename to Adyen/src/Model/ConfigurationWebhooks/Card.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CardConfiguration.cs b/Adyen/src/Model/ConfigurationWebhooks/CardConfiguration.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CardConfiguration.cs rename to Adyen/src/Model/ConfigurationWebhooks/CardConfiguration.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CardOrderItem.cs b/Adyen/src/Model/ConfigurationWebhooks/CardOrderItem.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CardOrderItem.cs rename to Adyen/src/Model/ConfigurationWebhooks/CardOrderItem.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs b/Adyen/src/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs rename to Adyen/src/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs b/Adyen/src/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs rename to Adyen/src/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs diff --git a/Adyen/Model/ConfigurationWebhooks/ContactDetails.cs b/Adyen/src/Model/ConfigurationWebhooks/ContactDetails.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/ContactDetails.cs rename to Adyen/src/Model/ConfigurationWebhooks/ContactDetails.cs diff --git a/Adyen/Model/ConfigurationWebhooks/DeliveryAddress.cs b/Adyen/src/Model/ConfigurationWebhooks/DeliveryAddress.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/DeliveryAddress.cs rename to Adyen/src/Model/ConfigurationWebhooks/DeliveryAddress.cs diff --git a/Adyen/Model/ConfigurationWebhooks/DeliveryContact.cs b/Adyen/src/Model/ConfigurationWebhooks/DeliveryContact.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/DeliveryContact.cs rename to Adyen/src/Model/ConfigurationWebhooks/DeliveryContact.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Device.cs b/Adyen/src/Model/ConfigurationWebhooks/Device.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Device.cs rename to Adyen/src/Model/ConfigurationWebhooks/Device.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Expiry.cs b/Adyen/src/Model/ConfigurationWebhooks/Expiry.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Expiry.cs rename to Adyen/src/Model/ConfigurationWebhooks/Expiry.cs diff --git a/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.cs b/Adyen/src/Model/ConfigurationWebhooks/IbanAccountIdentification.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.cs rename to Adyen/src/Model/ConfigurationWebhooks/IbanAccountIdentification.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Name.cs b/Adyen/src/Model/ConfigurationWebhooks/Name.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Name.cs rename to Adyen/src/Model/ConfigurationWebhooks/Name.cs diff --git a/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs b/Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs rename to Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs diff --git a/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs b/Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs rename to Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs diff --git a/Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs b/Adyen/src/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs rename to Adyen/src/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs diff --git a/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.cs b/Adyen/src/Model/ConfigurationWebhooks/PaymentInstrument.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/PaymentInstrument.cs rename to Adyen/src/Model/ConfigurationWebhooks/PaymentInstrument.cs diff --git a/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs b/Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs rename to Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs diff --git a/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs b/Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs rename to Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs diff --git a/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs b/Adyen/src/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs rename to Adyen/src/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Phone.cs b/Adyen/src/Model/ConfigurationWebhooks/Phone.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Phone.cs rename to Adyen/src/Model/ConfigurationWebhooks/Phone.cs diff --git a/Adyen/Model/ConfigurationWebhooks/PhoneNumber.cs b/Adyen/src/Model/ConfigurationWebhooks/PhoneNumber.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/PhoneNumber.cs rename to Adyen/src/Model/ConfigurationWebhooks/PhoneNumber.cs diff --git a/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs b/Adyen/src/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs rename to Adyen/src/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs diff --git a/Adyen/Model/ConfigurationWebhooks/RemediatingAction.cs b/Adyen/src/Model/ConfigurationWebhooks/RemediatingAction.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/RemediatingAction.cs rename to Adyen/src/Model/ConfigurationWebhooks/RemediatingAction.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Resource.cs b/Adyen/src/Model/ConfigurationWebhooks/Resource.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Resource.cs rename to Adyen/src/Model/ConfigurationWebhooks/Resource.cs diff --git a/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs b/Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs rename to Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs diff --git a/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs b/Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs rename to Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs diff --git a/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.cs b/Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationV2.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.cs rename to Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationV2.cs diff --git a/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.cs b/Adyen/src/Model/ConfigurationWebhooks/SweepCounterparty.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/SweepCounterparty.cs rename to Adyen/src/Model/ConfigurationWebhooks/SweepCounterparty.cs diff --git a/Adyen/Model/ConfigurationWebhooks/SweepSchedule.cs b/Adyen/src/Model/ConfigurationWebhooks/SweepSchedule.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/SweepSchedule.cs rename to Adyen/src/Model/ConfigurationWebhooks/SweepSchedule.cs diff --git a/Adyen/Model/ConfigurationWebhooks/TokenAuthentication.cs b/Adyen/src/Model/ConfigurationWebhooks/TokenAuthentication.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/TokenAuthentication.cs rename to Adyen/src/Model/ConfigurationWebhooks/TokenAuthentication.cs diff --git a/Adyen/Model/ConfigurationWebhooks/ValidationFacts.cs b/Adyen/src/Model/ConfigurationWebhooks/ValidationFacts.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/ValidationFacts.cs rename to Adyen/src/Model/ConfigurationWebhooks/ValidationFacts.cs diff --git a/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.cs b/Adyen/src/Model/ConfigurationWebhooks/VerificationDeadline.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/VerificationDeadline.cs rename to Adyen/src/Model/ConfigurationWebhooks/VerificationDeadline.cs diff --git a/Adyen/Model/ConfigurationWebhooks/VerificationError.cs b/Adyen/src/Model/ConfigurationWebhooks/VerificationError.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/VerificationError.cs rename to Adyen/src/Model/ConfigurationWebhooks/VerificationError.cs diff --git a/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs b/Adyen/src/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs rename to Adyen/src/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Wallet.cs b/Adyen/src/Model/ConfigurationWebhooks/Wallet.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Wallet.cs rename to Adyen/src/Model/ConfigurationWebhooks/Wallet.cs diff --git a/Adyen/Model/DataProtection/AbstractOpenAPISchema.cs b/Adyen/src/Model/DataProtection/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/DataProtection/AbstractOpenAPISchema.cs rename to Adyen/src/Model/DataProtection/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/DataProtection/ServiceError.cs b/Adyen/src/Model/DataProtection/ServiceError.cs similarity index 100% rename from Adyen/Model/DataProtection/ServiceError.cs rename to Adyen/src/Model/DataProtection/ServiceError.cs diff --git a/Adyen/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs b/Adyen/src/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs similarity index 100% rename from Adyen/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs rename to Adyen/src/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs diff --git a/Adyen/Model/DataProtection/SubjectErasureResponse.cs b/Adyen/src/Model/DataProtection/SubjectErasureResponse.cs similarity index 100% rename from Adyen/Model/DataProtection/SubjectErasureResponse.cs rename to Adyen/src/Model/DataProtection/SubjectErasureResponse.cs diff --git a/Adyen/Model/DisputeWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/DisputeWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/DisputeWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/DisputeWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/DisputeWebhooks/Amount.cs b/Adyen/src/Model/DisputeWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/DisputeWebhooks/Amount.cs rename to Adyen/src/Model/DisputeWebhooks/Amount.cs diff --git a/Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/src/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/src/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/Model/DisputeWebhooks/DisputeEventNotification.cs b/Adyen/src/Model/DisputeWebhooks/DisputeEventNotification.cs similarity index 100% rename from Adyen/Model/DisputeWebhooks/DisputeEventNotification.cs rename to Adyen/src/Model/DisputeWebhooks/DisputeEventNotification.cs diff --git a/Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.cs b/Adyen/src/Model/DisputeWebhooks/DisputeNotificationRequest.cs similarity index 100% rename from Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.cs rename to Adyen/src/Model/DisputeWebhooks/DisputeNotificationRequest.cs diff --git a/Adyen/Model/Disputes/AbstractOpenAPISchema.cs b/Adyen/src/Model/Disputes/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Disputes/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Disputes/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Disputes/AcceptDisputeRequest.cs b/Adyen/src/Model/Disputes/AcceptDisputeRequest.cs similarity index 100% rename from Adyen/Model/Disputes/AcceptDisputeRequest.cs rename to Adyen/src/Model/Disputes/AcceptDisputeRequest.cs diff --git a/Adyen/Model/Disputes/AcceptDisputeResponse.cs b/Adyen/src/Model/Disputes/AcceptDisputeResponse.cs similarity index 100% rename from Adyen/Model/Disputes/AcceptDisputeResponse.cs rename to Adyen/src/Model/Disputes/AcceptDisputeResponse.cs diff --git a/Adyen/Model/Disputes/DefendDisputeRequest.cs b/Adyen/src/Model/Disputes/DefendDisputeRequest.cs similarity index 100% rename from Adyen/Model/Disputes/DefendDisputeRequest.cs rename to Adyen/src/Model/Disputes/DefendDisputeRequest.cs diff --git a/Adyen/Model/Disputes/DefendDisputeResponse.cs b/Adyen/src/Model/Disputes/DefendDisputeResponse.cs similarity index 100% rename from Adyen/Model/Disputes/DefendDisputeResponse.cs rename to Adyen/src/Model/Disputes/DefendDisputeResponse.cs diff --git a/Adyen/Model/Disputes/DefenseDocument.cs b/Adyen/src/Model/Disputes/DefenseDocument.cs similarity index 100% rename from Adyen/Model/Disputes/DefenseDocument.cs rename to Adyen/src/Model/Disputes/DefenseDocument.cs diff --git a/Adyen/Model/Disputes/DefenseDocumentType.cs b/Adyen/src/Model/Disputes/DefenseDocumentType.cs similarity index 100% rename from Adyen/Model/Disputes/DefenseDocumentType.cs rename to Adyen/src/Model/Disputes/DefenseDocumentType.cs diff --git a/Adyen/Model/Disputes/DefenseReason.cs b/Adyen/src/Model/Disputes/DefenseReason.cs similarity index 100% rename from Adyen/Model/Disputes/DefenseReason.cs rename to Adyen/src/Model/Disputes/DefenseReason.cs diff --git a/Adyen/Model/Disputes/DefenseReasonsRequest.cs b/Adyen/src/Model/Disputes/DefenseReasonsRequest.cs similarity index 100% rename from Adyen/Model/Disputes/DefenseReasonsRequest.cs rename to Adyen/src/Model/Disputes/DefenseReasonsRequest.cs diff --git a/Adyen/Model/Disputes/DefenseReasonsResponse.cs b/Adyen/src/Model/Disputes/DefenseReasonsResponse.cs similarity index 100% rename from Adyen/Model/Disputes/DefenseReasonsResponse.cs rename to Adyen/src/Model/Disputes/DefenseReasonsResponse.cs diff --git a/Adyen/Model/Disputes/DeleteDefenseDocumentRequest.cs b/Adyen/src/Model/Disputes/DeleteDefenseDocumentRequest.cs similarity index 100% rename from Adyen/Model/Disputes/DeleteDefenseDocumentRequest.cs rename to Adyen/src/Model/Disputes/DeleteDefenseDocumentRequest.cs diff --git a/Adyen/Model/Disputes/DeleteDefenseDocumentResponse.cs b/Adyen/src/Model/Disputes/DeleteDefenseDocumentResponse.cs similarity index 100% rename from Adyen/Model/Disputes/DeleteDefenseDocumentResponse.cs rename to Adyen/src/Model/Disputes/DeleteDefenseDocumentResponse.cs diff --git a/Adyen/Model/Disputes/DisputeServiceResult.cs b/Adyen/src/Model/Disputes/DisputeServiceResult.cs similarity index 100% rename from Adyen/Model/Disputes/DisputeServiceResult.cs rename to Adyen/src/Model/Disputes/DisputeServiceResult.cs diff --git a/Adyen/Model/Disputes/ServiceError.cs b/Adyen/src/Model/Disputes/ServiceError.cs similarity index 100% rename from Adyen/Model/Disputes/ServiceError.cs rename to Adyen/src/Model/Disputes/ServiceError.cs diff --git a/Adyen/Model/Disputes/SupplyDefenseDocumentRequest.cs b/Adyen/src/Model/Disputes/SupplyDefenseDocumentRequest.cs similarity index 100% rename from Adyen/Model/Disputes/SupplyDefenseDocumentRequest.cs rename to Adyen/src/Model/Disputes/SupplyDefenseDocumentRequest.cs diff --git a/Adyen/Model/Disputes/SupplyDefenseDocumentResponse.cs b/Adyen/src/Model/Disputes/SupplyDefenseDocumentResponse.cs similarity index 100% rename from Adyen/Model/Disputes/SupplyDefenseDocumentResponse.cs rename to Adyen/src/Model/Disputes/SupplyDefenseDocumentResponse.cs diff --git a/Adyen/Model/Environment.cs b/Adyen/src/Model/Environment.cs similarity index 100% rename from Adyen/Model/Environment.cs rename to Adyen/src/Model/Environment.cs diff --git a/Adyen/Model/LegalEntityManagement/AULocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/AULocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/AULocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/AbstractOpenAPISchema.cs b/Adyen/src/Model/LegalEntityManagement/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/AbstractOpenAPISchema.cs rename to Adyen/src/Model/LegalEntityManagement/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs b/Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs rename to Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs diff --git a/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs b/Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs rename to Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/AdditionalBankIdentification.cs b/Adyen/src/Model/LegalEntityManagement/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/AdditionalBankIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/AdditionalBankIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/Address.cs b/Adyen/src/Model/LegalEntityManagement/Address.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Address.cs rename to Adyen/src/Model/LegalEntityManagement/Address.cs diff --git a/Adyen/Model/LegalEntityManagement/Amount.cs b/Adyen/src/Model/LegalEntityManagement/Amount.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Amount.cs rename to Adyen/src/Model/LegalEntityManagement/Amount.cs diff --git a/Adyen/Model/LegalEntityManagement/Attachment.cs b/Adyen/src/Model/LegalEntityManagement/Attachment.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Attachment.cs rename to Adyen/src/Model/LegalEntityManagement/Attachment.cs diff --git a/Adyen/Model/LegalEntityManagement/BankAccountInfo.cs b/Adyen/src/Model/LegalEntityManagement/BankAccountInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BankAccountInfo.cs rename to Adyen/src/Model/LegalEntityManagement/BankAccountInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/BirthData.cs b/Adyen/src/Model/LegalEntityManagement/BirthData.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BirthData.cs rename to Adyen/src/Model/LegalEntityManagement/BirthData.cs diff --git a/Adyen/Model/LegalEntityManagement/BusinessLine.cs b/Adyen/src/Model/LegalEntityManagement/BusinessLine.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BusinessLine.cs rename to Adyen/src/Model/LegalEntityManagement/BusinessLine.cs diff --git a/Adyen/Model/LegalEntityManagement/BusinessLineInfo.cs b/Adyen/src/Model/LegalEntityManagement/BusinessLineInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BusinessLineInfo.cs rename to Adyen/src/Model/LegalEntityManagement/BusinessLineInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs b/Adyen/src/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs rename to Adyen/src/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs diff --git a/Adyen/Model/LegalEntityManagement/BusinessLines.cs b/Adyen/src/Model/LegalEntityManagement/BusinessLines.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BusinessLines.cs rename to Adyen/src/Model/LegalEntityManagement/BusinessLines.cs diff --git a/Adyen/Model/LegalEntityManagement/CALocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CALocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/CALocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/CZLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CZLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/CZLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/CalculatePciStatusRequest.cs b/Adyen/src/Model/LegalEntityManagement/CalculatePciStatusRequest.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CalculatePciStatusRequest.cs rename to Adyen/src/Model/LegalEntityManagement/CalculatePciStatusRequest.cs diff --git a/Adyen/Model/LegalEntityManagement/CalculatePciStatusResponse.cs b/Adyen/src/Model/LegalEntityManagement/CalculatePciStatusResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CalculatePciStatusResponse.cs rename to Adyen/src/Model/LegalEntityManagement/CalculatePciStatusResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs b/Adyen/src/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs rename to Adyen/src/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/CapabilityProblem.cs b/Adyen/src/Model/LegalEntityManagement/CapabilityProblem.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CapabilityProblem.cs rename to Adyen/src/Model/LegalEntityManagement/CapabilityProblem.cs diff --git a/Adyen/Model/LegalEntityManagement/CapabilityProblemEntity.cs b/Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CapabilityProblemEntity.cs rename to Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntity.cs diff --git a/Adyen/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs b/Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs rename to Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/Model/LegalEntityManagement/CapabilitySettings.cs b/Adyen/src/Model/LegalEntityManagement/CapabilitySettings.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CapabilitySettings.cs rename to Adyen/src/Model/LegalEntityManagement/CapabilitySettings.cs diff --git a/Adyen/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs b/Adyen/src/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs rename to Adyen/src/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/DKLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/DKLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/DKLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs b/Adyen/src/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs rename to Adyen/src/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/Document.cs b/Adyen/src/Model/LegalEntityManagement/Document.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Document.cs rename to Adyen/src/Model/LegalEntityManagement/Document.cs diff --git a/Adyen/Model/LegalEntityManagement/DocumentPage.cs b/Adyen/src/Model/LegalEntityManagement/DocumentPage.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/DocumentPage.cs rename to Adyen/src/Model/LegalEntityManagement/DocumentPage.cs diff --git a/Adyen/Model/LegalEntityManagement/DocumentReference.cs b/Adyen/src/Model/LegalEntityManagement/DocumentReference.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/DocumentReference.cs rename to Adyen/src/Model/LegalEntityManagement/DocumentReference.cs diff --git a/Adyen/Model/LegalEntityManagement/EntityReference.cs b/Adyen/src/Model/LegalEntityManagement/EntityReference.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/EntityReference.cs rename to Adyen/src/Model/LegalEntityManagement/EntityReference.cs diff --git a/Adyen/Model/LegalEntityManagement/FinancialReport.cs b/Adyen/src/Model/LegalEntityManagement/FinancialReport.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/FinancialReport.cs rename to Adyen/src/Model/LegalEntityManagement/FinancialReport.cs diff --git a/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs b/Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs rename to Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs diff --git a/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs b/Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs rename to Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs b/Adyen/src/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs rename to Adyen/src/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs b/Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs rename to Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs b/Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs rename to Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs b/Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs rename to Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs b/Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs rename to Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs diff --git a/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs b/Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs rename to Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/HKLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/HKLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/HKLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/HULocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/HULocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/HULocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/IbanAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/IbanAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/IbanAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/IbanAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/IdentificationData.cs b/Adyen/src/Model/LegalEntityManagement/IdentificationData.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/IdentificationData.cs rename to Adyen/src/Model/LegalEntityManagement/IdentificationData.cs diff --git a/Adyen/Model/LegalEntityManagement/Individual.cs b/Adyen/src/Model/LegalEntityManagement/Individual.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Individual.cs rename to Adyen/src/Model/LegalEntityManagement/Individual.cs diff --git a/Adyen/Model/LegalEntityManagement/LegalEntity.cs b/Adyen/src/Model/LegalEntityManagement/LegalEntity.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/LegalEntity.cs rename to Adyen/src/Model/LegalEntityManagement/LegalEntity.cs diff --git a/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.cs b/Adyen/src/Model/LegalEntityManagement/LegalEntityAssociation.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/LegalEntityAssociation.cs rename to Adyen/src/Model/LegalEntityManagement/LegalEntityAssociation.cs diff --git a/Adyen/Model/LegalEntityManagement/LegalEntityCapability.cs b/Adyen/src/Model/LegalEntityManagement/LegalEntityCapability.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/LegalEntityCapability.cs rename to Adyen/src/Model/LegalEntityManagement/LegalEntityCapability.cs diff --git a/Adyen/Model/LegalEntityManagement/LegalEntityInfo.cs b/Adyen/src/Model/LegalEntityManagement/LegalEntityInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/LegalEntityInfo.cs rename to Adyen/src/Model/LegalEntityManagement/LegalEntityInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs b/Adyen/src/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs rename to Adyen/src/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs diff --git a/Adyen/Model/LegalEntityManagement/NOLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/NOLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/NOLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/NZLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/NZLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/NZLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/Name.cs b/Adyen/src/Model/LegalEntityManagement/Name.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Name.cs rename to Adyen/src/Model/LegalEntityManagement/Name.cs diff --git a/Adyen/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/OnboardingLink.cs b/Adyen/src/Model/LegalEntityManagement/OnboardingLink.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/OnboardingLink.cs rename to Adyen/src/Model/LegalEntityManagement/OnboardingLink.cs diff --git a/Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.cs b/Adyen/src/Model/LegalEntityManagement/OnboardingLinkInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.cs rename to Adyen/src/Model/LegalEntityManagement/OnboardingLinkInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.cs b/Adyen/src/Model/LegalEntityManagement/OnboardingLinkSettings.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.cs rename to Adyen/src/Model/LegalEntityManagement/OnboardingLinkSettings.cs diff --git a/Adyen/Model/LegalEntityManagement/OnboardingTheme.cs b/Adyen/src/Model/LegalEntityManagement/OnboardingTheme.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/OnboardingTheme.cs rename to Adyen/src/Model/LegalEntityManagement/OnboardingTheme.cs diff --git a/Adyen/Model/LegalEntityManagement/OnboardingThemes.cs b/Adyen/src/Model/LegalEntityManagement/OnboardingThemes.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/OnboardingThemes.cs rename to Adyen/src/Model/LegalEntityManagement/OnboardingThemes.cs diff --git a/Adyen/Model/LegalEntityManagement/Organization.cs b/Adyen/src/Model/LegalEntityManagement/Organization.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Organization.cs rename to Adyen/src/Model/LegalEntityManagement/Organization.cs diff --git a/Adyen/Model/LegalEntityManagement/OwnerEntity.cs b/Adyen/src/Model/LegalEntityManagement/OwnerEntity.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/OwnerEntity.cs rename to Adyen/src/Model/LegalEntityManagement/OwnerEntity.cs diff --git a/Adyen/Model/LegalEntityManagement/PLLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/PLLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/PLLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/PciDocumentInfo.cs b/Adyen/src/Model/LegalEntityManagement/PciDocumentInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/PciDocumentInfo.cs rename to Adyen/src/Model/LegalEntityManagement/PciDocumentInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/PciSigningRequest.cs b/Adyen/src/Model/LegalEntityManagement/PciSigningRequest.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/PciSigningRequest.cs rename to Adyen/src/Model/LegalEntityManagement/PciSigningRequest.cs diff --git a/Adyen/Model/LegalEntityManagement/PciSigningResponse.cs b/Adyen/src/Model/LegalEntityManagement/PciSigningResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/PciSigningResponse.cs rename to Adyen/src/Model/LegalEntityManagement/PciSigningResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/PhoneNumber.cs b/Adyen/src/Model/LegalEntityManagement/PhoneNumber.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/PhoneNumber.cs rename to Adyen/src/Model/LegalEntityManagement/PhoneNumber.cs diff --git a/Adyen/Model/LegalEntityManagement/RemediatingAction.cs b/Adyen/src/Model/LegalEntityManagement/RemediatingAction.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/RemediatingAction.cs rename to Adyen/src/Model/LegalEntityManagement/RemediatingAction.cs diff --git a/Adyen/Model/LegalEntityManagement/SELocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/SELocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/SELocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/SGLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/SGLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/SGLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/ServiceError.cs b/Adyen/src/Model/LegalEntityManagement/ServiceError.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/ServiceError.cs rename to Adyen/src/Model/LegalEntityManagement/ServiceError.cs diff --git a/Adyen/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs b/Adyen/src/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs rename to Adyen/src/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs diff --git a/Adyen/Model/LegalEntityManagement/SoleProprietorship.cs b/Adyen/src/Model/LegalEntityManagement/SoleProprietorship.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/SoleProprietorship.cs rename to Adyen/src/Model/LegalEntityManagement/SoleProprietorship.cs diff --git a/Adyen/Model/LegalEntityManagement/SourceOfFunds.cs b/Adyen/src/Model/LegalEntityManagement/SourceOfFunds.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/SourceOfFunds.cs rename to Adyen/src/Model/LegalEntityManagement/SourceOfFunds.cs diff --git a/Adyen/Model/LegalEntityManagement/StockData.cs b/Adyen/src/Model/LegalEntityManagement/StockData.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/StockData.cs rename to Adyen/src/Model/LegalEntityManagement/StockData.cs diff --git a/Adyen/Model/LegalEntityManagement/SupportingEntityCapability.cs b/Adyen/src/Model/LegalEntityManagement/SupportingEntityCapability.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/SupportingEntityCapability.cs rename to Adyen/src/Model/LegalEntityManagement/SupportingEntityCapability.cs diff --git a/Adyen/Model/LegalEntityManagement/TaxInformation.cs b/Adyen/src/Model/LegalEntityManagement/TaxInformation.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/TaxInformation.cs rename to Adyen/src/Model/LegalEntityManagement/TaxInformation.cs diff --git a/Adyen/Model/LegalEntityManagement/TaxReportingClassification.cs b/Adyen/src/Model/LegalEntityManagement/TaxReportingClassification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/TaxReportingClassification.cs rename to Adyen/src/Model/LegalEntityManagement/TaxReportingClassification.cs diff --git a/Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs b/Adyen/src/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs rename to Adyen/src/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/TransferInstrument.cs b/Adyen/src/Model/LegalEntityManagement/TransferInstrument.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/TransferInstrument.cs rename to Adyen/src/Model/LegalEntityManagement/TransferInstrument.cs diff --git a/Adyen/Model/LegalEntityManagement/TransferInstrumentInfo.cs b/Adyen/src/Model/LegalEntityManagement/TransferInstrumentInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/TransferInstrumentInfo.cs rename to Adyen/src/Model/LegalEntityManagement/TransferInstrumentInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/TransferInstrumentReference.cs b/Adyen/src/Model/LegalEntityManagement/TransferInstrumentReference.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/TransferInstrumentReference.cs rename to Adyen/src/Model/LegalEntityManagement/TransferInstrumentReference.cs diff --git a/Adyen/Model/LegalEntityManagement/Trust.cs b/Adyen/src/Model/LegalEntityManagement/Trust.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Trust.cs rename to Adyen/src/Model/LegalEntityManagement/Trust.cs diff --git a/Adyen/Model/LegalEntityManagement/UKLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/UKLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/UKLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/USLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/USLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/USLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/UndefinedBeneficiary.cs b/Adyen/src/Model/LegalEntityManagement/UndefinedBeneficiary.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/UndefinedBeneficiary.cs rename to Adyen/src/Model/LegalEntityManagement/UndefinedBeneficiary.cs diff --git a/Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.cs b/Adyen/src/Model/LegalEntityManagement/UnincorporatedPartnership.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.cs rename to Adyen/src/Model/LegalEntityManagement/UnincorporatedPartnership.cs diff --git a/Adyen/Model/LegalEntityManagement/VerificationDeadline.cs b/Adyen/src/Model/LegalEntityManagement/VerificationDeadline.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/VerificationDeadline.cs rename to Adyen/src/Model/LegalEntityManagement/VerificationDeadline.cs diff --git a/Adyen/Model/LegalEntityManagement/VerificationError.cs b/Adyen/src/Model/LegalEntityManagement/VerificationError.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/VerificationError.cs rename to Adyen/src/Model/LegalEntityManagement/VerificationError.cs diff --git a/Adyen/Model/LegalEntityManagement/VerificationErrorRecursive.cs b/Adyen/src/Model/LegalEntityManagement/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/VerificationErrorRecursive.cs rename to Adyen/src/Model/LegalEntityManagement/VerificationErrorRecursive.cs diff --git a/Adyen/Model/LegalEntityManagement/VerificationErrors.cs b/Adyen/src/Model/LegalEntityManagement/VerificationErrors.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/VerificationErrors.cs rename to Adyen/src/Model/LegalEntityManagement/VerificationErrors.cs diff --git a/Adyen/Model/LegalEntityManagement/WebData.cs b/Adyen/src/Model/LegalEntityManagement/WebData.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/WebData.cs rename to Adyen/src/Model/LegalEntityManagement/WebData.cs diff --git a/Adyen/Model/LegalEntityManagement/WebDataExemption.cs b/Adyen/src/Model/LegalEntityManagement/WebDataExemption.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/WebDataExemption.cs rename to Adyen/src/Model/LegalEntityManagement/WebDataExemption.cs diff --git a/Adyen/Model/Management/AbstractOpenAPISchema.cs b/Adyen/src/Model/Management/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Management/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Management/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Management/AccelInfo.cs b/Adyen/src/Model/Management/AccelInfo.cs similarity index 100% rename from Adyen/Model/Management/AccelInfo.cs rename to Adyen/src/Model/Management/AccelInfo.cs diff --git a/Adyen/Model/Management/AdditionalCommission.cs b/Adyen/src/Model/Management/AdditionalCommission.cs similarity index 100% rename from Adyen/Model/Management/AdditionalCommission.cs rename to Adyen/src/Model/Management/AdditionalCommission.cs diff --git a/Adyen/Model/Management/AdditionalSettings.cs b/Adyen/src/Model/Management/AdditionalSettings.cs similarity index 100% rename from Adyen/Model/Management/AdditionalSettings.cs rename to Adyen/src/Model/Management/AdditionalSettings.cs diff --git a/Adyen/Model/Management/AdditionalSettingsResponse.cs b/Adyen/src/Model/Management/AdditionalSettingsResponse.cs similarity index 100% rename from Adyen/Model/Management/AdditionalSettingsResponse.cs rename to Adyen/src/Model/Management/AdditionalSettingsResponse.cs diff --git a/Adyen/Model/Management/Address.cs b/Adyen/src/Model/Management/Address.cs similarity index 100% rename from Adyen/Model/Management/Address.cs rename to Adyen/src/Model/Management/Address.cs diff --git a/Adyen/Model/Management/AffirmInfo.cs b/Adyen/src/Model/Management/AffirmInfo.cs similarity index 100% rename from Adyen/Model/Management/AffirmInfo.cs rename to Adyen/src/Model/Management/AffirmInfo.cs diff --git a/Adyen/Model/Management/AfterpayTouchInfo.cs b/Adyen/src/Model/Management/AfterpayTouchInfo.cs similarity index 100% rename from Adyen/Model/Management/AfterpayTouchInfo.cs rename to Adyen/src/Model/Management/AfterpayTouchInfo.cs diff --git a/Adyen/Model/Management/AllowedOrigin.cs b/Adyen/src/Model/Management/AllowedOrigin.cs similarity index 100% rename from Adyen/Model/Management/AllowedOrigin.cs rename to Adyen/src/Model/Management/AllowedOrigin.cs diff --git a/Adyen/Model/Management/AllowedOriginsResponse.cs b/Adyen/src/Model/Management/AllowedOriginsResponse.cs similarity index 100% rename from Adyen/Model/Management/AllowedOriginsResponse.cs rename to Adyen/src/Model/Management/AllowedOriginsResponse.cs diff --git a/Adyen/Model/Management/AmexInfo.cs b/Adyen/src/Model/Management/AmexInfo.cs similarity index 100% rename from Adyen/Model/Management/AmexInfo.cs rename to Adyen/src/Model/Management/AmexInfo.cs diff --git a/Adyen/Model/Management/Amount.cs b/Adyen/src/Model/Management/Amount.cs similarity index 100% rename from Adyen/Model/Management/Amount.cs rename to Adyen/src/Model/Management/Amount.cs diff --git a/Adyen/Model/Management/AndroidApp.cs b/Adyen/src/Model/Management/AndroidApp.cs similarity index 100% rename from Adyen/Model/Management/AndroidApp.cs rename to Adyen/src/Model/Management/AndroidApp.cs diff --git a/Adyen/Model/Management/AndroidAppError.cs b/Adyen/src/Model/Management/AndroidAppError.cs similarity index 100% rename from Adyen/Model/Management/AndroidAppError.cs rename to Adyen/src/Model/Management/AndroidAppError.cs diff --git a/Adyen/Model/Management/AndroidAppsResponse.cs b/Adyen/src/Model/Management/AndroidAppsResponse.cs similarity index 100% rename from Adyen/Model/Management/AndroidAppsResponse.cs rename to Adyen/src/Model/Management/AndroidAppsResponse.cs diff --git a/Adyen/Model/Management/AndroidCertificate.cs b/Adyen/src/Model/Management/AndroidCertificate.cs similarity index 100% rename from Adyen/Model/Management/AndroidCertificate.cs rename to Adyen/src/Model/Management/AndroidCertificate.cs diff --git a/Adyen/Model/Management/AndroidCertificatesResponse.cs b/Adyen/src/Model/Management/AndroidCertificatesResponse.cs similarity index 100% rename from Adyen/Model/Management/AndroidCertificatesResponse.cs rename to Adyen/src/Model/Management/AndroidCertificatesResponse.cs diff --git a/Adyen/Model/Management/ApiCredential.cs b/Adyen/src/Model/Management/ApiCredential.cs similarity index 100% rename from Adyen/Model/Management/ApiCredential.cs rename to Adyen/src/Model/Management/ApiCredential.cs diff --git a/Adyen/Model/Management/ApiCredentialLinks.cs b/Adyen/src/Model/Management/ApiCredentialLinks.cs similarity index 100% rename from Adyen/Model/Management/ApiCredentialLinks.cs rename to Adyen/src/Model/Management/ApiCredentialLinks.cs diff --git a/Adyen/Model/Management/ApplePayInfo.cs b/Adyen/src/Model/Management/ApplePayInfo.cs similarity index 100% rename from Adyen/Model/Management/ApplePayInfo.cs rename to Adyen/src/Model/Management/ApplePayInfo.cs diff --git a/Adyen/Model/Management/BcmcInfo.cs b/Adyen/src/Model/Management/BcmcInfo.cs similarity index 100% rename from Adyen/Model/Management/BcmcInfo.cs rename to Adyen/src/Model/Management/BcmcInfo.cs diff --git a/Adyen/Model/Management/BillingEntitiesResponse.cs b/Adyen/src/Model/Management/BillingEntitiesResponse.cs similarity index 100% rename from Adyen/Model/Management/BillingEntitiesResponse.cs rename to Adyen/src/Model/Management/BillingEntitiesResponse.cs diff --git a/Adyen/Model/Management/BillingEntity.cs b/Adyen/src/Model/Management/BillingEntity.cs similarity index 100% rename from Adyen/Model/Management/BillingEntity.cs rename to Adyen/src/Model/Management/BillingEntity.cs diff --git a/Adyen/Model/Management/CardholderReceipt.cs b/Adyen/src/Model/Management/CardholderReceipt.cs similarity index 100% rename from Adyen/Model/Management/CardholderReceipt.cs rename to Adyen/src/Model/Management/CardholderReceipt.cs diff --git a/Adyen/Model/Management/CartesBancairesInfo.cs b/Adyen/src/Model/Management/CartesBancairesInfo.cs similarity index 100% rename from Adyen/Model/Management/CartesBancairesInfo.cs rename to Adyen/src/Model/Management/CartesBancairesInfo.cs diff --git a/Adyen/Model/Management/ClearpayInfo.cs b/Adyen/src/Model/Management/ClearpayInfo.cs similarity index 100% rename from Adyen/Model/Management/ClearpayInfo.cs rename to Adyen/src/Model/Management/ClearpayInfo.cs diff --git a/Adyen/Model/Management/Commission.cs b/Adyen/src/Model/Management/Commission.cs similarity index 100% rename from Adyen/Model/Management/Commission.cs rename to Adyen/src/Model/Management/Commission.cs diff --git a/Adyen/Model/Management/Company.cs b/Adyen/src/Model/Management/Company.cs similarity index 100% rename from Adyen/Model/Management/Company.cs rename to Adyen/src/Model/Management/Company.cs diff --git a/Adyen/Model/Management/CompanyApiCredential.cs b/Adyen/src/Model/Management/CompanyApiCredential.cs similarity index 100% rename from Adyen/Model/Management/CompanyApiCredential.cs rename to Adyen/src/Model/Management/CompanyApiCredential.cs diff --git a/Adyen/Model/Management/CompanyLinks.cs b/Adyen/src/Model/Management/CompanyLinks.cs similarity index 100% rename from Adyen/Model/Management/CompanyLinks.cs rename to Adyen/src/Model/Management/CompanyLinks.cs diff --git a/Adyen/Model/Management/CompanyUser.cs b/Adyen/src/Model/Management/CompanyUser.cs similarity index 100% rename from Adyen/Model/Management/CompanyUser.cs rename to Adyen/src/Model/Management/CompanyUser.cs diff --git a/Adyen/Model/Management/Connectivity.cs b/Adyen/src/Model/Management/Connectivity.cs similarity index 100% rename from Adyen/Model/Management/Connectivity.cs rename to Adyen/src/Model/Management/Connectivity.cs diff --git a/Adyen/Model/Management/Contact.cs b/Adyen/src/Model/Management/Contact.cs similarity index 100% rename from Adyen/Model/Management/Contact.cs rename to Adyen/src/Model/Management/Contact.cs diff --git a/Adyen/Model/Management/CreateAllowedOriginRequest.cs b/Adyen/src/Model/Management/CreateAllowedOriginRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateAllowedOriginRequest.cs rename to Adyen/src/Model/Management/CreateAllowedOriginRequest.cs diff --git a/Adyen/Model/Management/CreateApiCredentialResponse.cs b/Adyen/src/Model/Management/CreateApiCredentialResponse.cs similarity index 100% rename from Adyen/Model/Management/CreateApiCredentialResponse.cs rename to Adyen/src/Model/Management/CreateApiCredentialResponse.cs diff --git a/Adyen/Model/Management/CreateCompanyApiCredentialRequest.cs b/Adyen/src/Model/Management/CreateCompanyApiCredentialRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateCompanyApiCredentialRequest.cs rename to Adyen/src/Model/Management/CreateCompanyApiCredentialRequest.cs diff --git a/Adyen/Model/Management/CreateCompanyApiCredentialResponse.cs b/Adyen/src/Model/Management/CreateCompanyApiCredentialResponse.cs similarity index 100% rename from Adyen/Model/Management/CreateCompanyApiCredentialResponse.cs rename to Adyen/src/Model/Management/CreateCompanyApiCredentialResponse.cs diff --git a/Adyen/Model/Management/CreateCompanyUserRequest.cs b/Adyen/src/Model/Management/CreateCompanyUserRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateCompanyUserRequest.cs rename to Adyen/src/Model/Management/CreateCompanyUserRequest.cs diff --git a/Adyen/Model/Management/CreateCompanyUserResponse.cs b/Adyen/src/Model/Management/CreateCompanyUserResponse.cs similarity index 100% rename from Adyen/Model/Management/CreateCompanyUserResponse.cs rename to Adyen/src/Model/Management/CreateCompanyUserResponse.cs diff --git a/Adyen/Model/Management/CreateCompanyWebhookRequest.cs b/Adyen/src/Model/Management/CreateCompanyWebhookRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateCompanyWebhookRequest.cs rename to Adyen/src/Model/Management/CreateCompanyWebhookRequest.cs diff --git a/Adyen/Model/Management/CreateMerchantApiCredentialRequest.cs b/Adyen/src/Model/Management/CreateMerchantApiCredentialRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateMerchantApiCredentialRequest.cs rename to Adyen/src/Model/Management/CreateMerchantApiCredentialRequest.cs diff --git a/Adyen/Model/Management/CreateMerchantRequest.cs b/Adyen/src/Model/Management/CreateMerchantRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateMerchantRequest.cs rename to Adyen/src/Model/Management/CreateMerchantRequest.cs diff --git a/Adyen/Model/Management/CreateMerchantResponse.cs b/Adyen/src/Model/Management/CreateMerchantResponse.cs similarity index 100% rename from Adyen/Model/Management/CreateMerchantResponse.cs rename to Adyen/src/Model/Management/CreateMerchantResponse.cs diff --git a/Adyen/Model/Management/CreateMerchantUserRequest.cs b/Adyen/src/Model/Management/CreateMerchantUserRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateMerchantUserRequest.cs rename to Adyen/src/Model/Management/CreateMerchantUserRequest.cs diff --git a/Adyen/Model/Management/CreateMerchantWebhookRequest.cs b/Adyen/src/Model/Management/CreateMerchantWebhookRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateMerchantWebhookRequest.cs rename to Adyen/src/Model/Management/CreateMerchantWebhookRequest.cs diff --git a/Adyen/Model/Management/CreateUserResponse.cs b/Adyen/src/Model/Management/CreateUserResponse.cs similarity index 100% rename from Adyen/Model/Management/CreateUserResponse.cs rename to Adyen/src/Model/Management/CreateUserResponse.cs diff --git a/Adyen/Model/Management/Currency.cs b/Adyen/src/Model/Management/Currency.cs similarity index 100% rename from Adyen/Model/Management/Currency.cs rename to Adyen/src/Model/Management/Currency.cs diff --git a/Adyen/Model/Management/CustomNotification.cs b/Adyen/src/Model/Management/CustomNotification.cs similarity index 100% rename from Adyen/Model/Management/CustomNotification.cs rename to Adyen/src/Model/Management/CustomNotification.cs diff --git a/Adyen/Model/Management/DataCenter.cs b/Adyen/src/Model/Management/DataCenter.cs similarity index 100% rename from Adyen/Model/Management/DataCenter.cs rename to Adyen/src/Model/Management/DataCenter.cs diff --git a/Adyen/Model/Management/DinersInfo.cs b/Adyen/src/Model/Management/DinersInfo.cs similarity index 100% rename from Adyen/Model/Management/DinersInfo.cs rename to Adyen/src/Model/Management/DinersInfo.cs diff --git a/Adyen/Model/Management/EventUrl.cs b/Adyen/src/Model/Management/EventUrl.cs similarity index 100% rename from Adyen/Model/Management/EventUrl.cs rename to Adyen/src/Model/Management/EventUrl.cs diff --git a/Adyen/Model/Management/ExternalTerminalAction.cs b/Adyen/src/Model/Management/ExternalTerminalAction.cs similarity index 100% rename from Adyen/Model/Management/ExternalTerminalAction.cs rename to Adyen/src/Model/Management/ExternalTerminalAction.cs diff --git a/Adyen/Model/Management/File.cs b/Adyen/src/Model/Management/File.cs similarity index 100% rename from Adyen/Model/Management/File.cs rename to Adyen/src/Model/Management/File.cs diff --git a/Adyen/Model/Management/GenerateApiKeyResponse.cs b/Adyen/src/Model/Management/GenerateApiKeyResponse.cs similarity index 100% rename from Adyen/Model/Management/GenerateApiKeyResponse.cs rename to Adyen/src/Model/Management/GenerateApiKeyResponse.cs diff --git a/Adyen/Model/Management/GenerateClientKeyResponse.cs b/Adyen/src/Model/Management/GenerateClientKeyResponse.cs similarity index 100% rename from Adyen/Model/Management/GenerateClientKeyResponse.cs rename to Adyen/src/Model/Management/GenerateClientKeyResponse.cs diff --git a/Adyen/Model/Management/GenerateHmacKeyResponse.cs b/Adyen/src/Model/Management/GenerateHmacKeyResponse.cs similarity index 100% rename from Adyen/Model/Management/GenerateHmacKeyResponse.cs rename to Adyen/src/Model/Management/GenerateHmacKeyResponse.cs diff --git a/Adyen/Model/Management/GenericPmWithTdiInfo.cs b/Adyen/src/Model/Management/GenericPmWithTdiInfo.cs similarity index 100% rename from Adyen/Model/Management/GenericPmWithTdiInfo.cs rename to Adyen/src/Model/Management/GenericPmWithTdiInfo.cs diff --git a/Adyen/Model/Management/GiroPayInfo.cs b/Adyen/src/Model/Management/GiroPayInfo.cs similarity index 100% rename from Adyen/Model/Management/GiroPayInfo.cs rename to Adyen/src/Model/Management/GiroPayInfo.cs diff --git a/Adyen/Model/Management/GooglePayInfo.cs b/Adyen/src/Model/Management/GooglePayInfo.cs similarity index 100% rename from Adyen/Model/Management/GooglePayInfo.cs rename to Adyen/src/Model/Management/GooglePayInfo.cs diff --git a/Adyen/Model/Management/Gratuity.cs b/Adyen/src/Model/Management/Gratuity.cs similarity index 100% rename from Adyen/Model/Management/Gratuity.cs rename to Adyen/src/Model/Management/Gratuity.cs diff --git a/Adyen/Model/Management/Hardware.cs b/Adyen/src/Model/Management/Hardware.cs similarity index 100% rename from Adyen/Model/Management/Hardware.cs rename to Adyen/src/Model/Management/Hardware.cs diff --git a/Adyen/Model/Management/IdName.cs b/Adyen/src/Model/Management/IdName.cs similarity index 100% rename from Adyen/Model/Management/IdName.cs rename to Adyen/src/Model/Management/IdName.cs diff --git a/Adyen/Model/Management/InstallAndroidAppDetails.cs b/Adyen/src/Model/Management/InstallAndroidAppDetails.cs similarity index 100% rename from Adyen/Model/Management/InstallAndroidAppDetails.cs rename to Adyen/src/Model/Management/InstallAndroidAppDetails.cs diff --git a/Adyen/Model/Management/InstallAndroidCertificateDetails.cs b/Adyen/src/Model/Management/InstallAndroidCertificateDetails.cs similarity index 100% rename from Adyen/Model/Management/InstallAndroidCertificateDetails.cs rename to Adyen/src/Model/Management/InstallAndroidCertificateDetails.cs diff --git a/Adyen/Model/Management/InvalidField.cs b/Adyen/src/Model/Management/InvalidField.cs similarity index 100% rename from Adyen/Model/Management/InvalidField.cs rename to Adyen/src/Model/Management/InvalidField.cs diff --git a/Adyen/Model/Management/JCBInfo.cs b/Adyen/src/Model/Management/JCBInfo.cs similarity index 100% rename from Adyen/Model/Management/JCBInfo.cs rename to Adyen/src/Model/Management/JCBInfo.cs diff --git a/Adyen/Model/Management/Key.cs b/Adyen/src/Model/Management/Key.cs similarity index 100% rename from Adyen/Model/Management/Key.cs rename to Adyen/src/Model/Management/Key.cs diff --git a/Adyen/Model/Management/KlarnaInfo.cs b/Adyen/src/Model/Management/KlarnaInfo.cs similarity index 100% rename from Adyen/Model/Management/KlarnaInfo.cs rename to Adyen/src/Model/Management/KlarnaInfo.cs diff --git a/Adyen/Model/Management/Links.cs b/Adyen/src/Model/Management/Links.cs similarity index 100% rename from Adyen/Model/Management/Links.cs rename to Adyen/src/Model/Management/Links.cs diff --git a/Adyen/Model/Management/LinksElement.cs b/Adyen/src/Model/Management/LinksElement.cs similarity index 100% rename from Adyen/Model/Management/LinksElement.cs rename to Adyen/src/Model/Management/LinksElement.cs diff --git a/Adyen/Model/Management/ListCompanyApiCredentialsResponse.cs b/Adyen/src/Model/Management/ListCompanyApiCredentialsResponse.cs similarity index 100% rename from Adyen/Model/Management/ListCompanyApiCredentialsResponse.cs rename to Adyen/src/Model/Management/ListCompanyApiCredentialsResponse.cs diff --git a/Adyen/Model/Management/ListCompanyResponse.cs b/Adyen/src/Model/Management/ListCompanyResponse.cs similarity index 100% rename from Adyen/Model/Management/ListCompanyResponse.cs rename to Adyen/src/Model/Management/ListCompanyResponse.cs diff --git a/Adyen/Model/Management/ListCompanyUsersResponse.cs b/Adyen/src/Model/Management/ListCompanyUsersResponse.cs similarity index 100% rename from Adyen/Model/Management/ListCompanyUsersResponse.cs rename to Adyen/src/Model/Management/ListCompanyUsersResponse.cs diff --git a/Adyen/Model/Management/ListExternalTerminalActionsResponse.cs b/Adyen/src/Model/Management/ListExternalTerminalActionsResponse.cs similarity index 100% rename from Adyen/Model/Management/ListExternalTerminalActionsResponse.cs rename to Adyen/src/Model/Management/ListExternalTerminalActionsResponse.cs diff --git a/Adyen/Model/Management/ListMerchantApiCredentialsResponse.cs b/Adyen/src/Model/Management/ListMerchantApiCredentialsResponse.cs similarity index 100% rename from Adyen/Model/Management/ListMerchantApiCredentialsResponse.cs rename to Adyen/src/Model/Management/ListMerchantApiCredentialsResponse.cs diff --git a/Adyen/Model/Management/ListMerchantResponse.cs b/Adyen/src/Model/Management/ListMerchantResponse.cs similarity index 100% rename from Adyen/Model/Management/ListMerchantResponse.cs rename to Adyen/src/Model/Management/ListMerchantResponse.cs diff --git a/Adyen/Model/Management/ListMerchantUsersResponse.cs b/Adyen/src/Model/Management/ListMerchantUsersResponse.cs similarity index 100% rename from Adyen/Model/Management/ListMerchantUsersResponse.cs rename to Adyen/src/Model/Management/ListMerchantUsersResponse.cs diff --git a/Adyen/Model/Management/ListStoresResponse.cs b/Adyen/src/Model/Management/ListStoresResponse.cs similarity index 100% rename from Adyen/Model/Management/ListStoresResponse.cs rename to Adyen/src/Model/Management/ListStoresResponse.cs diff --git a/Adyen/Model/Management/ListTerminalsResponse.cs b/Adyen/src/Model/Management/ListTerminalsResponse.cs similarity index 100% rename from Adyen/Model/Management/ListTerminalsResponse.cs rename to Adyen/src/Model/Management/ListTerminalsResponse.cs diff --git a/Adyen/Model/Management/ListWebhooksResponse.cs b/Adyen/src/Model/Management/ListWebhooksResponse.cs similarity index 100% rename from Adyen/Model/Management/ListWebhooksResponse.cs rename to Adyen/src/Model/Management/ListWebhooksResponse.cs diff --git a/Adyen/Model/Management/Localization.cs b/Adyen/src/Model/Management/Localization.cs similarity index 100% rename from Adyen/Model/Management/Localization.cs rename to Adyen/src/Model/Management/Localization.cs diff --git a/Adyen/Model/Management/Logo.cs b/Adyen/src/Model/Management/Logo.cs similarity index 100% rename from Adyen/Model/Management/Logo.cs rename to Adyen/src/Model/Management/Logo.cs diff --git a/Adyen/Model/Management/MeApiCredential.cs b/Adyen/src/Model/Management/MeApiCredential.cs similarity index 100% rename from Adyen/Model/Management/MeApiCredential.cs rename to Adyen/src/Model/Management/MeApiCredential.cs diff --git a/Adyen/Model/Management/MealVoucherFRInfo.cs b/Adyen/src/Model/Management/MealVoucherFRInfo.cs similarity index 100% rename from Adyen/Model/Management/MealVoucherFRInfo.cs rename to Adyen/src/Model/Management/MealVoucherFRInfo.cs diff --git a/Adyen/Model/Management/Merchant.cs b/Adyen/src/Model/Management/Merchant.cs similarity index 100% rename from Adyen/Model/Management/Merchant.cs rename to Adyen/src/Model/Management/Merchant.cs diff --git a/Adyen/Model/Management/MerchantLinks.cs b/Adyen/src/Model/Management/MerchantLinks.cs similarity index 100% rename from Adyen/Model/Management/MerchantLinks.cs rename to Adyen/src/Model/Management/MerchantLinks.cs diff --git a/Adyen/Model/Management/MinorUnitsMonetaryValue.cs b/Adyen/src/Model/Management/MinorUnitsMonetaryValue.cs similarity index 100% rename from Adyen/Model/Management/MinorUnitsMonetaryValue.cs rename to Adyen/src/Model/Management/MinorUnitsMonetaryValue.cs diff --git a/Adyen/Model/Management/ModelConfiguration.cs b/Adyen/src/Model/Management/ModelConfiguration.cs similarity index 100% rename from Adyen/Model/Management/ModelConfiguration.cs rename to Adyen/src/Model/Management/ModelConfiguration.cs diff --git a/Adyen/Model/Management/Name.cs b/Adyen/src/Model/Management/Name.cs similarity index 100% rename from Adyen/Model/Management/Name.cs rename to Adyen/src/Model/Management/Name.cs diff --git a/Adyen/Model/Management/Name2.cs b/Adyen/src/Model/Management/Name2.cs similarity index 100% rename from Adyen/Model/Management/Name2.cs rename to Adyen/src/Model/Management/Name2.cs diff --git a/Adyen/Model/Management/Nexo.cs b/Adyen/src/Model/Management/Nexo.cs similarity index 100% rename from Adyen/Model/Management/Nexo.cs rename to Adyen/src/Model/Management/Nexo.cs diff --git a/Adyen/Model/Management/Notification.cs b/Adyen/src/Model/Management/Notification.cs similarity index 100% rename from Adyen/Model/Management/Notification.cs rename to Adyen/src/Model/Management/Notification.cs diff --git a/Adyen/Model/Management/NotificationUrl.cs b/Adyen/src/Model/Management/NotificationUrl.cs similarity index 100% rename from Adyen/Model/Management/NotificationUrl.cs rename to Adyen/src/Model/Management/NotificationUrl.cs diff --git a/Adyen/Model/Management/NyceInfo.cs b/Adyen/src/Model/Management/NyceInfo.cs similarity index 100% rename from Adyen/Model/Management/NyceInfo.cs rename to Adyen/src/Model/Management/NyceInfo.cs diff --git a/Adyen/Model/Management/OfflineProcessing.cs b/Adyen/src/Model/Management/OfflineProcessing.cs similarity index 100% rename from Adyen/Model/Management/OfflineProcessing.cs rename to Adyen/src/Model/Management/OfflineProcessing.cs diff --git a/Adyen/Model/Management/Opi.cs b/Adyen/src/Model/Management/Opi.cs similarity index 100% rename from Adyen/Model/Management/Opi.cs rename to Adyen/src/Model/Management/Opi.cs diff --git a/Adyen/Model/Management/OrderItem.cs b/Adyen/src/Model/Management/OrderItem.cs similarity index 100% rename from Adyen/Model/Management/OrderItem.cs rename to Adyen/src/Model/Management/OrderItem.cs diff --git a/Adyen/Model/Management/PaginationLinks.cs b/Adyen/src/Model/Management/PaginationLinks.cs similarity index 100% rename from Adyen/Model/Management/PaginationLinks.cs rename to Adyen/src/Model/Management/PaginationLinks.cs diff --git a/Adyen/Model/Management/Passcodes.cs b/Adyen/src/Model/Management/Passcodes.cs similarity index 100% rename from Adyen/Model/Management/Passcodes.cs rename to Adyen/src/Model/Management/Passcodes.cs diff --git a/Adyen/Model/Management/PayAtTable.cs b/Adyen/src/Model/Management/PayAtTable.cs similarity index 100% rename from Adyen/Model/Management/PayAtTable.cs rename to Adyen/src/Model/Management/PayAtTable.cs diff --git a/Adyen/Model/Management/PayMeInfo.cs b/Adyen/src/Model/Management/PayMeInfo.cs similarity index 100% rename from Adyen/Model/Management/PayMeInfo.cs rename to Adyen/src/Model/Management/PayMeInfo.cs diff --git a/Adyen/Model/Management/PayPalInfo.cs b/Adyen/src/Model/Management/PayPalInfo.cs similarity index 100% rename from Adyen/Model/Management/PayPalInfo.cs rename to Adyen/src/Model/Management/PayPalInfo.cs diff --git a/Adyen/Model/Management/PayToInfo.cs b/Adyen/src/Model/Management/PayToInfo.cs similarity index 100% rename from Adyen/Model/Management/PayToInfo.cs rename to Adyen/src/Model/Management/PayToInfo.cs diff --git a/Adyen/Model/Management/Payment.cs b/Adyen/src/Model/Management/Payment.cs similarity index 100% rename from Adyen/Model/Management/Payment.cs rename to Adyen/src/Model/Management/Payment.cs diff --git a/Adyen/Model/Management/PaymentMethod.cs b/Adyen/src/Model/Management/PaymentMethod.cs similarity index 100% rename from Adyen/Model/Management/PaymentMethod.cs rename to Adyen/src/Model/Management/PaymentMethod.cs diff --git a/Adyen/Model/Management/PaymentMethodResponse.cs b/Adyen/src/Model/Management/PaymentMethodResponse.cs similarity index 100% rename from Adyen/Model/Management/PaymentMethodResponse.cs rename to Adyen/src/Model/Management/PaymentMethodResponse.cs diff --git a/Adyen/Model/Management/PaymentMethodSetupInfo.cs b/Adyen/src/Model/Management/PaymentMethodSetupInfo.cs similarity index 100% rename from Adyen/Model/Management/PaymentMethodSetupInfo.cs rename to Adyen/src/Model/Management/PaymentMethodSetupInfo.cs diff --git a/Adyen/Model/Management/PayoutSettings.cs b/Adyen/src/Model/Management/PayoutSettings.cs similarity index 100% rename from Adyen/Model/Management/PayoutSettings.cs rename to Adyen/src/Model/Management/PayoutSettings.cs diff --git a/Adyen/Model/Management/PayoutSettingsRequest.cs b/Adyen/src/Model/Management/PayoutSettingsRequest.cs similarity index 100% rename from Adyen/Model/Management/PayoutSettingsRequest.cs rename to Adyen/src/Model/Management/PayoutSettingsRequest.cs diff --git a/Adyen/Model/Management/PayoutSettingsResponse.cs b/Adyen/src/Model/Management/PayoutSettingsResponse.cs similarity index 100% rename from Adyen/Model/Management/PayoutSettingsResponse.cs rename to Adyen/src/Model/Management/PayoutSettingsResponse.cs diff --git a/Adyen/Model/Management/Profile.cs b/Adyen/src/Model/Management/Profile.cs similarity index 100% rename from Adyen/Model/Management/Profile.cs rename to Adyen/src/Model/Management/Profile.cs diff --git a/Adyen/Model/Management/PulseInfo.cs b/Adyen/src/Model/Management/PulseInfo.cs similarity index 100% rename from Adyen/Model/Management/PulseInfo.cs rename to Adyen/src/Model/Management/PulseInfo.cs diff --git a/Adyen/Model/Management/ReceiptOptions.cs b/Adyen/src/Model/Management/ReceiptOptions.cs similarity index 100% rename from Adyen/Model/Management/ReceiptOptions.cs rename to Adyen/src/Model/Management/ReceiptOptions.cs diff --git a/Adyen/Model/Management/ReceiptPrinting.cs b/Adyen/src/Model/Management/ReceiptPrinting.cs similarity index 100% rename from Adyen/Model/Management/ReceiptPrinting.cs rename to Adyen/src/Model/Management/ReceiptPrinting.cs diff --git a/Adyen/Model/Management/Referenced.cs b/Adyen/src/Model/Management/Referenced.cs similarity index 100% rename from Adyen/Model/Management/Referenced.cs rename to Adyen/src/Model/Management/Referenced.cs diff --git a/Adyen/Model/Management/Refunds.cs b/Adyen/src/Model/Management/Refunds.cs similarity index 100% rename from Adyen/Model/Management/Refunds.cs rename to Adyen/src/Model/Management/Refunds.cs diff --git a/Adyen/Model/Management/ReleaseUpdateDetails.cs b/Adyen/src/Model/Management/ReleaseUpdateDetails.cs similarity index 100% rename from Adyen/Model/Management/ReleaseUpdateDetails.cs rename to Adyen/src/Model/Management/ReleaseUpdateDetails.cs diff --git a/Adyen/Model/Management/ReprocessAndroidAppResponse.cs b/Adyen/src/Model/Management/ReprocessAndroidAppResponse.cs similarity index 100% rename from Adyen/Model/Management/ReprocessAndroidAppResponse.cs rename to Adyen/src/Model/Management/ReprocessAndroidAppResponse.cs diff --git a/Adyen/Model/Management/RequestActivationResponse.cs b/Adyen/src/Model/Management/RequestActivationResponse.cs similarity index 100% rename from Adyen/Model/Management/RequestActivationResponse.cs rename to Adyen/src/Model/Management/RequestActivationResponse.cs diff --git a/Adyen/Model/Management/RestServiceError.cs b/Adyen/src/Model/Management/RestServiceError.cs similarity index 100% rename from Adyen/Model/Management/RestServiceError.cs rename to Adyen/src/Model/Management/RestServiceError.cs diff --git a/Adyen/Model/Management/ScheduleTerminalActionsRequest.cs b/Adyen/src/Model/Management/ScheduleTerminalActionsRequest.cs similarity index 100% rename from Adyen/Model/Management/ScheduleTerminalActionsRequest.cs rename to Adyen/src/Model/Management/ScheduleTerminalActionsRequest.cs diff --git a/Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs b/Adyen/src/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs similarity index 100% rename from Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs rename to Adyen/src/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs diff --git a/Adyen/Model/Management/ScheduleTerminalActionsResponse.cs b/Adyen/src/Model/Management/ScheduleTerminalActionsResponse.cs similarity index 100% rename from Adyen/Model/Management/ScheduleTerminalActionsResponse.cs rename to Adyen/src/Model/Management/ScheduleTerminalActionsResponse.cs diff --git a/Adyen/Model/Management/Settings.cs b/Adyen/src/Model/Management/Settings.cs similarity index 100% rename from Adyen/Model/Management/Settings.cs rename to Adyen/src/Model/Management/Settings.cs diff --git a/Adyen/Model/Management/ShippingLocation.cs b/Adyen/src/Model/Management/ShippingLocation.cs similarity index 100% rename from Adyen/Model/Management/ShippingLocation.cs rename to Adyen/src/Model/Management/ShippingLocation.cs diff --git a/Adyen/Model/Management/ShippingLocationsResponse.cs b/Adyen/src/Model/Management/ShippingLocationsResponse.cs similarity index 100% rename from Adyen/Model/Management/ShippingLocationsResponse.cs rename to Adyen/src/Model/Management/ShippingLocationsResponse.cs diff --git a/Adyen/Model/Management/Signature.cs b/Adyen/src/Model/Management/Signature.cs similarity index 100% rename from Adyen/Model/Management/Signature.cs rename to Adyen/src/Model/Management/Signature.cs diff --git a/Adyen/Model/Management/SodexoInfo.cs b/Adyen/src/Model/Management/SodexoInfo.cs similarity index 100% rename from Adyen/Model/Management/SodexoInfo.cs rename to Adyen/src/Model/Management/SodexoInfo.cs diff --git a/Adyen/Model/Management/SofortInfo.cs b/Adyen/src/Model/Management/SofortInfo.cs similarity index 100% rename from Adyen/Model/Management/SofortInfo.cs rename to Adyen/src/Model/Management/SofortInfo.cs diff --git a/Adyen/Model/Management/SplitConfiguration.cs b/Adyen/src/Model/Management/SplitConfiguration.cs similarity index 100% rename from Adyen/Model/Management/SplitConfiguration.cs rename to Adyen/src/Model/Management/SplitConfiguration.cs diff --git a/Adyen/Model/Management/SplitConfigurationList.cs b/Adyen/src/Model/Management/SplitConfigurationList.cs similarity index 100% rename from Adyen/Model/Management/SplitConfigurationList.cs rename to Adyen/src/Model/Management/SplitConfigurationList.cs diff --git a/Adyen/Model/Management/SplitConfigurationLogic.cs b/Adyen/src/Model/Management/SplitConfigurationLogic.cs similarity index 100% rename from Adyen/Model/Management/SplitConfigurationLogic.cs rename to Adyen/src/Model/Management/SplitConfigurationLogic.cs diff --git a/Adyen/Model/Management/SplitConfigurationRule.cs b/Adyen/src/Model/Management/SplitConfigurationRule.cs similarity index 100% rename from Adyen/Model/Management/SplitConfigurationRule.cs rename to Adyen/src/Model/Management/SplitConfigurationRule.cs diff --git a/Adyen/Model/Management/Standalone.cs b/Adyen/src/Model/Management/Standalone.cs similarity index 100% rename from Adyen/Model/Management/Standalone.cs rename to Adyen/src/Model/Management/Standalone.cs diff --git a/Adyen/Model/Management/StarInfo.cs b/Adyen/src/Model/Management/StarInfo.cs similarity index 100% rename from Adyen/Model/Management/StarInfo.cs rename to Adyen/src/Model/Management/StarInfo.cs diff --git a/Adyen/Model/Management/Store.cs b/Adyen/src/Model/Management/Store.cs similarity index 100% rename from Adyen/Model/Management/Store.cs rename to Adyen/src/Model/Management/Store.cs diff --git a/Adyen/Model/Management/StoreAndForward.cs b/Adyen/src/Model/Management/StoreAndForward.cs similarity index 100% rename from Adyen/Model/Management/StoreAndForward.cs rename to Adyen/src/Model/Management/StoreAndForward.cs diff --git a/Adyen/Model/Management/StoreCreationRequest.cs b/Adyen/src/Model/Management/StoreCreationRequest.cs similarity index 100% rename from Adyen/Model/Management/StoreCreationRequest.cs rename to Adyen/src/Model/Management/StoreCreationRequest.cs diff --git a/Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.cs b/Adyen/src/Model/Management/StoreCreationWithMerchantCodeRequest.cs similarity index 100% rename from Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.cs rename to Adyen/src/Model/Management/StoreCreationWithMerchantCodeRequest.cs diff --git a/Adyen/Model/Management/StoreLocation.cs b/Adyen/src/Model/Management/StoreLocation.cs similarity index 100% rename from Adyen/Model/Management/StoreLocation.cs rename to Adyen/src/Model/Management/StoreLocation.cs diff --git a/Adyen/Model/Management/StoreSplitConfiguration.cs b/Adyen/src/Model/Management/StoreSplitConfiguration.cs similarity index 100% rename from Adyen/Model/Management/StoreSplitConfiguration.cs rename to Adyen/src/Model/Management/StoreSplitConfiguration.cs diff --git a/Adyen/Model/Management/SupportedCardTypes.cs b/Adyen/src/Model/Management/SupportedCardTypes.cs similarity index 100% rename from Adyen/Model/Management/SupportedCardTypes.cs rename to Adyen/src/Model/Management/SupportedCardTypes.cs diff --git a/Adyen/Model/Management/Surcharge.cs b/Adyen/src/Model/Management/Surcharge.cs similarity index 100% rename from Adyen/Model/Management/Surcharge.cs rename to Adyen/src/Model/Management/Surcharge.cs diff --git a/Adyen/Model/Management/SwishInfo.cs b/Adyen/src/Model/Management/SwishInfo.cs similarity index 100% rename from Adyen/Model/Management/SwishInfo.cs rename to Adyen/src/Model/Management/SwishInfo.cs diff --git a/Adyen/Model/Management/TapToPay.cs b/Adyen/src/Model/Management/TapToPay.cs similarity index 100% rename from Adyen/Model/Management/TapToPay.cs rename to Adyen/src/Model/Management/TapToPay.cs diff --git a/Adyen/Model/Management/Terminal.cs b/Adyen/src/Model/Management/Terminal.cs similarity index 100% rename from Adyen/Model/Management/Terminal.cs rename to Adyen/src/Model/Management/Terminal.cs diff --git a/Adyen/Model/Management/TerminalActionScheduleDetail.cs b/Adyen/src/Model/Management/TerminalActionScheduleDetail.cs similarity index 100% rename from Adyen/Model/Management/TerminalActionScheduleDetail.cs rename to Adyen/src/Model/Management/TerminalActionScheduleDetail.cs diff --git a/Adyen/Model/Management/TerminalAssignment.cs b/Adyen/src/Model/Management/TerminalAssignment.cs similarity index 100% rename from Adyen/Model/Management/TerminalAssignment.cs rename to Adyen/src/Model/Management/TerminalAssignment.cs diff --git a/Adyen/Model/Management/TerminalConnectivity.cs b/Adyen/src/Model/Management/TerminalConnectivity.cs similarity index 100% rename from Adyen/Model/Management/TerminalConnectivity.cs rename to Adyen/src/Model/Management/TerminalConnectivity.cs diff --git a/Adyen/Model/Management/TerminalConnectivityBluetooth.cs b/Adyen/src/Model/Management/TerminalConnectivityBluetooth.cs similarity index 100% rename from Adyen/Model/Management/TerminalConnectivityBluetooth.cs rename to Adyen/src/Model/Management/TerminalConnectivityBluetooth.cs diff --git a/Adyen/Model/Management/TerminalConnectivityCellular.cs b/Adyen/src/Model/Management/TerminalConnectivityCellular.cs similarity index 100% rename from Adyen/Model/Management/TerminalConnectivityCellular.cs rename to Adyen/src/Model/Management/TerminalConnectivityCellular.cs diff --git a/Adyen/Model/Management/TerminalConnectivityEthernet.cs b/Adyen/src/Model/Management/TerminalConnectivityEthernet.cs similarity index 100% rename from Adyen/Model/Management/TerminalConnectivityEthernet.cs rename to Adyen/src/Model/Management/TerminalConnectivityEthernet.cs diff --git a/Adyen/Model/Management/TerminalConnectivityWifi.cs b/Adyen/src/Model/Management/TerminalConnectivityWifi.cs similarity index 100% rename from Adyen/Model/Management/TerminalConnectivityWifi.cs rename to Adyen/src/Model/Management/TerminalConnectivityWifi.cs diff --git a/Adyen/Model/Management/TerminalInstructions.cs b/Adyen/src/Model/Management/TerminalInstructions.cs similarity index 100% rename from Adyen/Model/Management/TerminalInstructions.cs rename to Adyen/src/Model/Management/TerminalInstructions.cs diff --git a/Adyen/Model/Management/TerminalModelsResponse.cs b/Adyen/src/Model/Management/TerminalModelsResponse.cs similarity index 100% rename from Adyen/Model/Management/TerminalModelsResponse.cs rename to Adyen/src/Model/Management/TerminalModelsResponse.cs diff --git a/Adyen/Model/Management/TerminalOrder.cs b/Adyen/src/Model/Management/TerminalOrder.cs similarity index 100% rename from Adyen/Model/Management/TerminalOrder.cs rename to Adyen/src/Model/Management/TerminalOrder.cs diff --git a/Adyen/Model/Management/TerminalOrderRequest.cs b/Adyen/src/Model/Management/TerminalOrderRequest.cs similarity index 100% rename from Adyen/Model/Management/TerminalOrderRequest.cs rename to Adyen/src/Model/Management/TerminalOrderRequest.cs diff --git a/Adyen/Model/Management/TerminalOrdersResponse.cs b/Adyen/src/Model/Management/TerminalOrdersResponse.cs similarity index 100% rename from Adyen/Model/Management/TerminalOrdersResponse.cs rename to Adyen/src/Model/Management/TerminalOrdersResponse.cs diff --git a/Adyen/Model/Management/TerminalProduct.cs b/Adyen/src/Model/Management/TerminalProduct.cs similarity index 100% rename from Adyen/Model/Management/TerminalProduct.cs rename to Adyen/src/Model/Management/TerminalProduct.cs diff --git a/Adyen/Model/Management/TerminalProductPrice.cs b/Adyen/src/Model/Management/TerminalProductPrice.cs similarity index 100% rename from Adyen/Model/Management/TerminalProductPrice.cs rename to Adyen/src/Model/Management/TerminalProductPrice.cs diff --git a/Adyen/Model/Management/TerminalProductsResponse.cs b/Adyen/src/Model/Management/TerminalProductsResponse.cs similarity index 100% rename from Adyen/Model/Management/TerminalProductsResponse.cs rename to Adyen/src/Model/Management/TerminalProductsResponse.cs diff --git a/Adyen/Model/Management/TerminalReassignmentRequest.cs b/Adyen/src/Model/Management/TerminalReassignmentRequest.cs similarity index 100% rename from Adyen/Model/Management/TerminalReassignmentRequest.cs rename to Adyen/src/Model/Management/TerminalReassignmentRequest.cs diff --git a/Adyen/Model/Management/TerminalReassignmentTarget.cs b/Adyen/src/Model/Management/TerminalReassignmentTarget.cs similarity index 100% rename from Adyen/Model/Management/TerminalReassignmentTarget.cs rename to Adyen/src/Model/Management/TerminalReassignmentTarget.cs diff --git a/Adyen/Model/Management/TerminalSettings.cs b/Adyen/src/Model/Management/TerminalSettings.cs similarity index 100% rename from Adyen/Model/Management/TerminalSettings.cs rename to Adyen/src/Model/Management/TerminalSettings.cs diff --git a/Adyen/Model/Management/TestCompanyWebhookRequest.cs b/Adyen/src/Model/Management/TestCompanyWebhookRequest.cs similarity index 100% rename from Adyen/Model/Management/TestCompanyWebhookRequest.cs rename to Adyen/src/Model/Management/TestCompanyWebhookRequest.cs diff --git a/Adyen/Model/Management/TestOutput.cs b/Adyen/src/Model/Management/TestOutput.cs similarity index 100% rename from Adyen/Model/Management/TestOutput.cs rename to Adyen/src/Model/Management/TestOutput.cs diff --git a/Adyen/Model/Management/TestWebhookRequest.cs b/Adyen/src/Model/Management/TestWebhookRequest.cs similarity index 100% rename from Adyen/Model/Management/TestWebhookRequest.cs rename to Adyen/src/Model/Management/TestWebhookRequest.cs diff --git a/Adyen/Model/Management/TestWebhookResponse.cs b/Adyen/src/Model/Management/TestWebhookResponse.cs similarity index 100% rename from Adyen/Model/Management/TestWebhookResponse.cs rename to Adyen/src/Model/Management/TestWebhookResponse.cs diff --git a/Adyen/Model/Management/TicketInfo.cs b/Adyen/src/Model/Management/TicketInfo.cs similarity index 100% rename from Adyen/Model/Management/TicketInfo.cs rename to Adyen/src/Model/Management/TicketInfo.cs diff --git a/Adyen/Model/Management/Timeouts.cs b/Adyen/src/Model/Management/Timeouts.cs similarity index 100% rename from Adyen/Model/Management/Timeouts.cs rename to Adyen/src/Model/Management/Timeouts.cs diff --git a/Adyen/Model/Management/TransactionDescriptionInfo.cs b/Adyen/src/Model/Management/TransactionDescriptionInfo.cs similarity index 100% rename from Adyen/Model/Management/TransactionDescriptionInfo.cs rename to Adyen/src/Model/Management/TransactionDescriptionInfo.cs diff --git a/Adyen/Model/Management/TwintInfo.cs b/Adyen/src/Model/Management/TwintInfo.cs similarity index 100% rename from Adyen/Model/Management/TwintInfo.cs rename to Adyen/src/Model/Management/TwintInfo.cs diff --git a/Adyen/Model/Management/UninstallAndroidAppDetails.cs b/Adyen/src/Model/Management/UninstallAndroidAppDetails.cs similarity index 100% rename from Adyen/Model/Management/UninstallAndroidAppDetails.cs rename to Adyen/src/Model/Management/UninstallAndroidAppDetails.cs diff --git a/Adyen/Model/Management/UninstallAndroidCertificateDetails.cs b/Adyen/src/Model/Management/UninstallAndroidCertificateDetails.cs similarity index 100% rename from Adyen/Model/Management/UninstallAndroidCertificateDetails.cs rename to Adyen/src/Model/Management/UninstallAndroidCertificateDetails.cs diff --git a/Adyen/Model/Management/UpdatableAddress.cs b/Adyen/src/Model/Management/UpdatableAddress.cs similarity index 100% rename from Adyen/Model/Management/UpdatableAddress.cs rename to Adyen/src/Model/Management/UpdatableAddress.cs diff --git a/Adyen/Model/Management/UpdateCompanyApiCredentialRequest.cs b/Adyen/src/Model/Management/UpdateCompanyApiCredentialRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateCompanyApiCredentialRequest.cs rename to Adyen/src/Model/Management/UpdateCompanyApiCredentialRequest.cs diff --git a/Adyen/Model/Management/UpdateCompanyUserRequest.cs b/Adyen/src/Model/Management/UpdateCompanyUserRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateCompanyUserRequest.cs rename to Adyen/src/Model/Management/UpdateCompanyUserRequest.cs diff --git a/Adyen/Model/Management/UpdateCompanyWebhookRequest.cs b/Adyen/src/Model/Management/UpdateCompanyWebhookRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateCompanyWebhookRequest.cs rename to Adyen/src/Model/Management/UpdateCompanyWebhookRequest.cs diff --git a/Adyen/Model/Management/UpdateMerchantApiCredentialRequest.cs b/Adyen/src/Model/Management/UpdateMerchantApiCredentialRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateMerchantApiCredentialRequest.cs rename to Adyen/src/Model/Management/UpdateMerchantApiCredentialRequest.cs diff --git a/Adyen/Model/Management/UpdateMerchantUserRequest.cs b/Adyen/src/Model/Management/UpdateMerchantUserRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateMerchantUserRequest.cs rename to Adyen/src/Model/Management/UpdateMerchantUserRequest.cs diff --git a/Adyen/Model/Management/UpdateMerchantWebhookRequest.cs b/Adyen/src/Model/Management/UpdateMerchantWebhookRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateMerchantWebhookRequest.cs rename to Adyen/src/Model/Management/UpdateMerchantWebhookRequest.cs diff --git a/Adyen/Model/Management/UpdatePaymentMethodInfo.cs b/Adyen/src/Model/Management/UpdatePaymentMethodInfo.cs similarity index 100% rename from Adyen/Model/Management/UpdatePaymentMethodInfo.cs rename to Adyen/src/Model/Management/UpdatePaymentMethodInfo.cs diff --git a/Adyen/Model/Management/UpdatePayoutSettingsRequest.cs b/Adyen/src/Model/Management/UpdatePayoutSettingsRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdatePayoutSettingsRequest.cs rename to Adyen/src/Model/Management/UpdatePayoutSettingsRequest.cs diff --git a/Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.cs b/Adyen/src/Model/Management/UpdateSplitConfigurationLogicRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.cs rename to Adyen/src/Model/Management/UpdateSplitConfigurationLogicRequest.cs diff --git a/Adyen/Model/Management/UpdateSplitConfigurationRequest.cs b/Adyen/src/Model/Management/UpdateSplitConfigurationRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateSplitConfigurationRequest.cs rename to Adyen/src/Model/Management/UpdateSplitConfigurationRequest.cs diff --git a/Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.cs b/Adyen/src/Model/Management/UpdateSplitConfigurationRuleRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.cs rename to Adyen/src/Model/Management/UpdateSplitConfigurationRuleRequest.cs diff --git a/Adyen/Model/Management/UpdateStoreRequest.cs b/Adyen/src/Model/Management/UpdateStoreRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateStoreRequest.cs rename to Adyen/src/Model/Management/UpdateStoreRequest.cs diff --git a/Adyen/Model/Management/UploadAndroidAppResponse.cs b/Adyen/src/Model/Management/UploadAndroidAppResponse.cs similarity index 100% rename from Adyen/Model/Management/UploadAndroidAppResponse.cs rename to Adyen/src/Model/Management/UploadAndroidAppResponse.cs diff --git a/Adyen/Model/Management/UploadAndroidCertificateResponse.cs b/Adyen/src/Model/Management/UploadAndroidCertificateResponse.cs similarity index 100% rename from Adyen/Model/Management/UploadAndroidCertificateResponse.cs rename to Adyen/src/Model/Management/UploadAndroidCertificateResponse.cs diff --git a/Adyen/Model/Management/Url.cs b/Adyen/src/Model/Management/Url.cs similarity index 100% rename from Adyen/Model/Management/Url.cs rename to Adyen/src/Model/Management/Url.cs diff --git a/Adyen/Model/Management/User.cs b/Adyen/src/Model/Management/User.cs similarity index 100% rename from Adyen/Model/Management/User.cs rename to Adyen/src/Model/Management/User.cs diff --git a/Adyen/Model/Management/VippsInfo.cs b/Adyen/src/Model/Management/VippsInfo.cs similarity index 100% rename from Adyen/Model/Management/VippsInfo.cs rename to Adyen/src/Model/Management/VippsInfo.cs diff --git a/Adyen/Model/Management/WeChatPayInfo.cs b/Adyen/src/Model/Management/WeChatPayInfo.cs similarity index 100% rename from Adyen/Model/Management/WeChatPayInfo.cs rename to Adyen/src/Model/Management/WeChatPayInfo.cs diff --git a/Adyen/Model/Management/WeChatPayPosInfo.cs b/Adyen/src/Model/Management/WeChatPayPosInfo.cs similarity index 100% rename from Adyen/Model/Management/WeChatPayPosInfo.cs rename to Adyen/src/Model/Management/WeChatPayPosInfo.cs diff --git a/Adyen/Model/Management/Webhook.cs b/Adyen/src/Model/Management/Webhook.cs similarity index 100% rename from Adyen/Model/Management/Webhook.cs rename to Adyen/src/Model/Management/Webhook.cs diff --git a/Adyen/Model/Management/WebhookLinks.cs b/Adyen/src/Model/Management/WebhookLinks.cs similarity index 100% rename from Adyen/Model/Management/WebhookLinks.cs rename to Adyen/src/Model/Management/WebhookLinks.cs diff --git a/Adyen/Model/Management/WifiProfiles.cs b/Adyen/src/Model/Management/WifiProfiles.cs similarity index 100% rename from Adyen/Model/Management/WifiProfiles.cs rename to Adyen/src/Model/Management/WifiProfiles.cs diff --git a/Adyen/Model/ManagementWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/ManagementWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/ManagementWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/ManagementWebhooks/AccountCapabilityData.cs b/Adyen/src/Model/ManagementWebhooks/AccountCapabilityData.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/AccountCapabilityData.cs rename to Adyen/src/Model/ManagementWebhooks/AccountCapabilityData.cs diff --git a/Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.cs b/Adyen/src/Model/ManagementWebhooks/AccountCreateNotificationData.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.cs rename to Adyen/src/Model/ManagementWebhooks/AccountCreateNotificationData.cs diff --git a/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.cs b/Adyen/src/Model/ManagementWebhooks/AccountNotificationResponse.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/AccountNotificationResponse.cs rename to Adyen/src/Model/ManagementWebhooks/AccountNotificationResponse.cs diff --git a/Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.cs b/Adyen/src/Model/ManagementWebhooks/AccountUpdateNotificationData.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.cs rename to Adyen/src/Model/ManagementWebhooks/AccountUpdateNotificationData.cs diff --git a/Adyen/Model/ManagementWebhooks/CapabilityProblem.cs b/Adyen/src/Model/ManagementWebhooks/CapabilityProblem.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/CapabilityProblem.cs rename to Adyen/src/Model/ManagementWebhooks/CapabilityProblem.cs diff --git a/Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.cs b/Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.cs rename to Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntity.cs diff --git a/Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs b/Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs rename to Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/MidServiceNotificationData.cs b/Adyen/src/Model/ManagementWebhooks/MidServiceNotificationData.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/MidServiceNotificationData.cs rename to Adyen/src/Model/ManagementWebhooks/MidServiceNotificationData.cs diff --git a/Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs b/Adyen/src/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs rename to Adyen/src/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs diff --git a/Adyen/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/RemediatingAction.cs b/Adyen/src/Model/ManagementWebhooks/RemediatingAction.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/RemediatingAction.cs rename to Adyen/src/Model/ManagementWebhooks/RemediatingAction.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs b/Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalBoardingData.cs b/Adyen/src/Model/ManagementWebhooks/TerminalBoardingData.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalBoardingData.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalBoardingData.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs b/Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalSettingsData.cs b/Adyen/src/Model/ManagementWebhooks/TerminalSettingsData.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalSettingsData.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalSettingsData.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs b/Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs diff --git a/Adyen/Model/ManagementWebhooks/VerificationError.cs b/Adyen/src/Model/ManagementWebhooks/VerificationError.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/VerificationError.cs rename to Adyen/src/Model/ManagementWebhooks/VerificationError.cs diff --git a/Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.cs b/Adyen/src/Model/ManagementWebhooks/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.cs rename to Adyen/src/Model/ManagementWebhooks/VerificationErrorRecursive.cs diff --git a/Adyen/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/NegativeBalanceWarningWebhooks/Amount.cs b/Adyen/src/Model/NegativeBalanceWarningWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/NegativeBalanceWarningWebhooks/Amount.cs rename to Adyen/src/Model/NegativeBalanceWarningWebhooks/Amount.cs diff --git a/Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs b/Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs similarity index 100% rename from Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs rename to Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs diff --git a/Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs b/Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs similarity index 100% rename from Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs rename to Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs diff --git a/Adyen/Model/NegativeBalanceWarningWebhooks/Resource.cs b/Adyen/src/Model/NegativeBalanceWarningWebhooks/Resource.cs similarity index 100% rename from Adyen/Model/NegativeBalanceWarningWebhooks/Resource.cs rename to Adyen/src/Model/NegativeBalanceWarningWebhooks/Resource.cs diff --git a/Adyen/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs b/Adyen/src/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs rename to Adyen/src/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs diff --git a/Adyen/Model/Notification/NotificationRequest.cs b/Adyen/src/Model/Notification/NotificationRequest.cs similarity index 97% rename from Adyen/Model/Notification/NotificationRequest.cs rename to Adyen/src/Model/Notification/NotificationRequest.cs index 038da3cba..d537aaf78 100644 --- a/Adyen/Model/Notification/NotificationRequest.cs +++ b/Adyen/src/Model/Notification/NotificationRequest.cs @@ -1,61 +1,61 @@ -#region License -// /* -// * ###### -// * ###### -// * ############ ####( ###### #####. ###### ############ ############ -// * ############# #####( ###### #####. ###### ############# ############# -// * ###### #####( ###### #####. ###### ##### ###### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ###### -// * ############# ############# ############# ############# ##### ###### -// * ############ ############ ############# ############ ##### ###### -// * ###### -// * ############# -// * ############ -// * -// * Adyen Dotnet API Library -// * -// * Copyright (c) 2020 Adyen B.V. -// * This file is open source and available under the MIT license. -// * See the LICENSE file for more info. -// */ -#endregion - -using Newtonsoft.Json; -using System.Collections.Generic; -using System.Text; - -namespace Adyen.Model.Notification -{ - public class NotificationRequest - { - public string Live { get; set; } - - [JsonProperty("NotificationItems")] - public List NotificationItemContainers { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class NotificationRequest {\n"); - sb.Append(" Live: ").Append(this.Live).Append("\n"); - sb.Append(" NotificationItemContainers: ").Append(NotificationItemContainers).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - } -} +#region License +// /* +// * ###### +// * ###### +// * ############ ####( ###### #####. ###### ############ ############ +// * ############# #####( ###### #####. ###### ############# ############# +// * ###### #####( ###### #####. ###### ##### ###### ##### ###### +// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// * ###### ###### #####( ###### #####. ###### ##### ##### ###### +// * ############# ############# ############# ############# ##### ###### +// * ############ ############ ############# ############ ##### ###### +// * ###### +// * ############# +// * ############ +// * +// * Adyen Dotnet API Library +// * +// * Copyright (c) 2020 Adyen B.V. +// * This file is open source and available under the MIT license. +// * See the LICENSE file for more info. +// */ +#endregion + +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; + +namespace Adyen.Model.Notification +{ + public class NotificationRequest + { + public string Live { get; set; } + + [JsonProperty("NotificationItems")] + public List NotificationItemContainers { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class NotificationRequest {\n"); + sb.Append(" Live: ").Append(this.Live).Append("\n"); + sb.Append(" NotificationItemContainers: ").Append(NotificationItemContainers).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + } +} diff --git a/Adyen/Model/Notification/NotificationRequestConst.cs b/Adyen/src/Model/Notification/NotificationRequestConst.cs similarity index 98% rename from Adyen/Model/Notification/NotificationRequestConst.cs rename to Adyen/src/Model/Notification/NotificationRequestConst.cs index bcbe9af48..aba031e08 100644 --- a/Adyen/Model/Notification/NotificationRequestConst.cs +++ b/Adyen/src/Model/Notification/NotificationRequestConst.cs @@ -1,68 +1,68 @@ -#region License -// /* -// * ###### -// * ###### -// * ############ ####( ###### #####. ###### ############ ############ -// * ############# #####( ###### #####. ###### ############# ############# -// * ###### #####( ###### #####. ###### ##### ###### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ###### -// * ############# ############# ############# ############# ##### ###### -// * ############ ############ ############# ############ ##### ###### -// * ###### -// * ############# -// * ############ -// * -// * Adyen Dotnet API Library -// * -// * Copyright (c) 2020 Adyen B.V. -// * This file is open source and available under the MIT license. -// * See the LICENSE file for more info. -// */ -#endregion - -namespace Adyen.Model.Notification -{ - public class NotificationRequestConst - { - //Event codes - public const string EventCodeAuthorisation = "AUTHORISATION"; - public const string EventCodeAuthorisationAdjustment = "AUTHORISATION_ADJUSTMENT"; - public const string EventCodeCancellation = "CANCELLATION"; - public const string EventCodeCancelOrRefund = "CANCEL_OR_REFUND"; - public const string EventCodeCapture = "CAPTURE"; - public const string EventCodeCaptureFailed = "CAPTURE_FAILED"; - public const string EventCodeChargeback = "CHARGEBACK"; - public const string EventCodeChargebackReversed = "CHARGEBACK_REVERSED"; - public const string EventCodeHandledExternally = "HANDLED_EXTERNALLY"; - public const string EventCodeManualReviewAccept = "MANUAL_REVIEW_ACCEPT"; - public const string EventCodeManualReviewReject = "MANUAL_REVIEW_REJECT"; - public const string EventCodeNotificationOfChargeback = "NOTIFICATION_OF_CHARGEBACK"; - public const string EventCodeNotificationOfFraud = "NOTIFICATION_OF_FRAUD"; - public const string EventCodeOfferClosed = "OFFER_CLOSED"; - public const string EventCodeOrderClosed = "ORDER_CLOSED"; - public const string EventCodeOrderOpened = "ORDER_OPENED"; - public const string EventCodePaidoutReversed = "PAIDOUT_REVERSED"; - public const string EventCodePayoutDecline = "PAYOUT_DECLINE"; - public const string EventCodePayoutExpire = "PAYOUT_EXPIRE"; - public const string EventCodePayoutThirdparty = "PAYOUT_THIRDPARTY"; - public const string EventCodePending = "PENDING"; - public const string EventCodePostponedRefund = "POSTPONED_REFUND"; - public const string EventCodePrearbitrationLost = "PREARBITRATION_LOST"; - public const string EventCodePrearbitrationWon = "PREARBITRATION_WON"; - public const string EventCodeProcessRetry = "PROCESS_RETRY"; - public const string EventCodeRecurringContract = "RECURRING_CONTRACT"; - public const string EventCodeRefund = "REFUND"; - public const string EventCodeRefundedReversed = "REFUNDED_REVERSED"; - public const string EventCodeRefundFailed = "REFUND_FAILED"; - public const string EventCodeRefundWithData = "REFUND_WITH_DATA"; - public const string EventCodeReportAvailable = "REPORT_AVAILABLE"; - public const string EventCodeRequestForInformation = "REQUEST_FOR_INFORMATION"; - public const string EventCodeSecondChargeback = "SECOND_CHARGEBACK"; - public const string EventCodeVoidPendingRefund = "VOID_PENDING_REFUND"; - - //Additional Data - public const string AdditionalDataTotalFraudScore = "totalFraudScore"; - public const string AdditionalDataFraudCheckPattern = "fraudCheck-(\\d+)-([A-Za-z0-9]+)"; - } +#region License +// /* +// * ###### +// * ###### +// * ############ ####( ###### #####. ###### ############ ############ +// * ############# #####( ###### #####. ###### ############# ############# +// * ###### #####( ###### #####. ###### ##### ###### ##### ###### +// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// * ###### ###### #####( ###### #####. ###### ##### ##### ###### +// * ############# ############# ############# ############# ##### ###### +// * ############ ############ ############# ############ ##### ###### +// * ###### +// * ############# +// * ############ +// * +// * Adyen Dotnet API Library +// * +// * Copyright (c) 2020 Adyen B.V. +// * This file is open source and available under the MIT license. +// * See the LICENSE file for more info. +// */ +#endregion + +namespace Adyen.Model.Notification +{ + public class NotificationRequestConst + { + //Event codes + public const string EventCodeAuthorisation = "AUTHORISATION"; + public const string EventCodeAuthorisationAdjustment = "AUTHORISATION_ADJUSTMENT"; + public const string EventCodeCancellation = "CANCELLATION"; + public const string EventCodeCancelOrRefund = "CANCEL_OR_REFUND"; + public const string EventCodeCapture = "CAPTURE"; + public const string EventCodeCaptureFailed = "CAPTURE_FAILED"; + public const string EventCodeChargeback = "CHARGEBACK"; + public const string EventCodeChargebackReversed = "CHARGEBACK_REVERSED"; + public const string EventCodeHandledExternally = "HANDLED_EXTERNALLY"; + public const string EventCodeManualReviewAccept = "MANUAL_REVIEW_ACCEPT"; + public const string EventCodeManualReviewReject = "MANUAL_REVIEW_REJECT"; + public const string EventCodeNotificationOfChargeback = "NOTIFICATION_OF_CHARGEBACK"; + public const string EventCodeNotificationOfFraud = "NOTIFICATION_OF_FRAUD"; + public const string EventCodeOfferClosed = "OFFER_CLOSED"; + public const string EventCodeOrderClosed = "ORDER_CLOSED"; + public const string EventCodeOrderOpened = "ORDER_OPENED"; + public const string EventCodePaidoutReversed = "PAIDOUT_REVERSED"; + public const string EventCodePayoutDecline = "PAYOUT_DECLINE"; + public const string EventCodePayoutExpire = "PAYOUT_EXPIRE"; + public const string EventCodePayoutThirdparty = "PAYOUT_THIRDPARTY"; + public const string EventCodePending = "PENDING"; + public const string EventCodePostponedRefund = "POSTPONED_REFUND"; + public const string EventCodePrearbitrationLost = "PREARBITRATION_LOST"; + public const string EventCodePrearbitrationWon = "PREARBITRATION_WON"; + public const string EventCodeProcessRetry = "PROCESS_RETRY"; + public const string EventCodeRecurringContract = "RECURRING_CONTRACT"; + public const string EventCodeRefund = "REFUND"; + public const string EventCodeRefundedReversed = "REFUNDED_REVERSED"; + public const string EventCodeRefundFailed = "REFUND_FAILED"; + public const string EventCodeRefundWithData = "REFUND_WITH_DATA"; + public const string EventCodeReportAvailable = "REPORT_AVAILABLE"; + public const string EventCodeRequestForInformation = "REQUEST_FOR_INFORMATION"; + public const string EventCodeSecondChargeback = "SECOND_CHARGEBACK"; + public const string EventCodeVoidPendingRefund = "VOID_PENDING_REFUND"; + + //Additional Data + public const string AdditionalDataTotalFraudScore = "totalFraudScore"; + public const string AdditionalDataFraudCheckPattern = "fraudCheck-(\\d+)-([A-Za-z0-9]+)"; + } } \ No newline at end of file diff --git a/Adyen/Model/Notification/NotificationRequestItem.cs b/Adyen/src/Model/Notification/NotificationRequestItem.cs similarity index 97% rename from Adyen/Model/Notification/NotificationRequestItem.cs rename to Adyen/src/Model/Notification/NotificationRequestItem.cs index 153a43583..cbb4a6bd8 100644 --- a/Adyen/Model/Notification/NotificationRequestItem.cs +++ b/Adyen/src/Model/Notification/NotificationRequestItem.cs @@ -1,44 +1,44 @@ -#region License -// /* -// * ###### -// * ###### -// * ############ ####( ###### #####. ###### ############ ############ -// * ############# #####( ###### #####. ###### ############# ############# -// * ###### #####( ###### #####. ###### ##### ###### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ###### -// * ############# ############# ############# ############# ##### ###### -// * ############ ############ ############# ############ ##### ###### -// * ###### -// * ############# -// * ############ -// * -// * Adyen Dotnet API Library -// * -// * Copyright (c) 2020 Adyen B.V. -// * This file is open source and available under the MIT license. -// * See the LICENSE file for more info. -// */ -#endregion - -using System.Collections.Generic; -using Adyen.Model.Checkout; - -namespace Adyen.Model.Notification -{ - public class NotificationRequestItem - { - public Amount Amount { get; set; } - public string EventCode { get; set; } - public string EventDate { get; set; } - public string MerchantAccountCode { get; set; } - public string MerchantReference { get; set; } - public string OriginalReference { get; set; } - public string PspReference { get; set; } - public string Reason { get; set; } - public bool Success { get; set; } - public string PaymentMethod { get; set; } - public List Operations { get; set; } - public Dictionary AdditionalData { get; set; } - } +#region License +// /* +// * ###### +// * ###### +// * ############ ####( ###### #####. ###### ############ ############ +// * ############# #####( ###### #####. ###### ############# ############# +// * ###### #####( ###### #####. ###### ##### ###### ##### ###### +// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// * ###### ###### #####( ###### #####. ###### ##### ##### ###### +// * ############# ############# ############# ############# ##### ###### +// * ############ ############ ############# ############ ##### ###### +// * ###### +// * ############# +// * ############ +// * +// * Adyen Dotnet API Library +// * +// * Copyright (c) 2020 Adyen B.V. +// * This file is open source and available under the MIT license. +// * See the LICENSE file for more info. +// */ +#endregion + +using System.Collections.Generic; +using Adyen.Model.Checkout; + +namespace Adyen.Model.Notification +{ + public class NotificationRequestItem + { + public Amount Amount { get; set; } + public string EventCode { get; set; } + public string EventDate { get; set; } + public string MerchantAccountCode { get; set; } + public string MerchantReference { get; set; } + public string OriginalReference { get; set; } + public string PspReference { get; set; } + public string Reason { get; set; } + public bool Success { get; set; } + public string PaymentMethod { get; set; } + public List Operations { get; set; } + public Dictionary AdditionalData { get; set; } + } } \ No newline at end of file diff --git a/Adyen/Model/Notification/NotificationRequestItemContainer.cs b/Adyen/src/Model/Notification/NotificationRequestItemContainer.cs similarity index 97% rename from Adyen/Model/Notification/NotificationRequestItemContainer.cs rename to Adyen/src/Model/Notification/NotificationRequestItemContainer.cs index 01ea102cd..f21b226f5 100644 --- a/Adyen/Model/Notification/NotificationRequestItemContainer.cs +++ b/Adyen/src/Model/Notification/NotificationRequestItemContainer.cs @@ -1,46 +1,46 @@ -#region License -// /* -// * ###### -// * ###### -// * ############ ####( ###### #####. ###### ############ ############ -// * ############# #####( ###### #####. ###### ############# ############# -// * ###### #####( ###### #####. ###### ##### ###### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ###### -// * ############# ############# ############# ############# ##### ###### -// * ############ ############ ############# ############ ##### ###### -// * ###### -// * ############# -// * ############ -// * -// * Adyen Dotnet API Library -// * -// * Copyright (c) 2020 Adyen B.V. -// * This file is open source and available under the MIT license. -// * See the LICENSE file for more info. -// */ -#endregion - -using Adyen.Util; -using System.Text; - -namespace Adyen.Model.Notification -{ - using Newtonsoft.Json; - - public class NotificationRequestItemContainer - { - [JsonProperty("NotificationRequestItem")] - public NotificationRequestItem NotificationItem { get; set; } - - public override string ToString() - { - StringBuilder sb = new StringBuilder(); - sb.Append("class NotificationRequestItemContainer {\n"); - - sb.Append(" notificationItem: ").Append(NotificationItem).Append("\n"); - sb.Append("}"); - return sb.ToString(); - } - } +#region License +// /* +// * ###### +// * ###### +// * ############ ####( ###### #####. ###### ############ ############ +// * ############# #####( ###### #####. ###### ############# ############# +// * ###### #####( ###### #####. ###### ##### ###### ##### ###### +// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// * ###### ###### #####( ###### #####. ###### ##### ##### ###### +// * ############# ############# ############# ############# ##### ###### +// * ############ ############ ############# ############ ##### ###### +// * ###### +// * ############# +// * ############ +// * +// * Adyen Dotnet API Library +// * +// * Copyright (c) 2020 Adyen B.V. +// * This file is open source and available under the MIT license. +// * See the LICENSE file for more info. +// */ +#endregion + +using Adyen.Util; +using System.Text; + +namespace Adyen.Model.Notification +{ + using Newtonsoft.Json; + + public class NotificationRequestItemContainer + { + [JsonProperty("NotificationRequestItem")] + public NotificationRequestItem NotificationItem { get; set; } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NotificationRequestItemContainer {\n"); + + sb.Append(" notificationItem: ").Append(NotificationItem).Append("\n"); + sb.Append("}"); + return sb.ToString(); + } + } } \ No newline at end of file diff --git a/Adyen/Model/Payment/AbstractOpenAPISchema.cs b/Adyen/src/Model/Payment/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Payment/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Payment/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Payment/AccountInfo.cs b/Adyen/src/Model/Payment/AccountInfo.cs similarity index 100% rename from Adyen/Model/Payment/AccountInfo.cs rename to Adyen/src/Model/Payment/AccountInfo.cs diff --git a/Adyen/Model/Payment/AcctInfo.cs b/Adyen/src/Model/Payment/AcctInfo.cs similarity index 100% rename from Adyen/Model/Payment/AcctInfo.cs rename to Adyen/src/Model/Payment/AcctInfo.cs diff --git a/Adyen/Model/Payment/AdditionalData3DSecure.cs b/Adyen/src/Model/Payment/AdditionalData3DSecure.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalData3DSecure.cs rename to Adyen/src/Model/Payment/AdditionalData3DSecure.cs diff --git a/Adyen/Model/Payment/AdditionalDataAirline.cs b/Adyen/src/Model/Payment/AdditionalDataAirline.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataAirline.cs rename to Adyen/src/Model/Payment/AdditionalDataAirline.cs diff --git a/Adyen/Model/Payment/AdditionalDataCarRental.cs b/Adyen/src/Model/Payment/AdditionalDataCarRental.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataCarRental.cs rename to Adyen/src/Model/Payment/AdditionalDataCarRental.cs diff --git a/Adyen/Model/Payment/AdditionalDataCommon.cs b/Adyen/src/Model/Payment/AdditionalDataCommon.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataCommon.cs rename to Adyen/src/Model/Payment/AdditionalDataCommon.cs diff --git a/Adyen/Model/Payment/AdditionalDataLevel23.cs b/Adyen/src/Model/Payment/AdditionalDataLevel23.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataLevel23.cs rename to Adyen/src/Model/Payment/AdditionalDataLevel23.cs diff --git a/Adyen/Model/Payment/AdditionalDataLodging.cs b/Adyen/src/Model/Payment/AdditionalDataLodging.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataLodging.cs rename to Adyen/src/Model/Payment/AdditionalDataLodging.cs diff --git a/Adyen/Model/Payment/AdditionalDataModifications.cs b/Adyen/src/Model/Payment/AdditionalDataModifications.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataModifications.cs rename to Adyen/src/Model/Payment/AdditionalDataModifications.cs diff --git a/Adyen/Model/Payment/AdditionalDataOpenInvoice.cs b/Adyen/src/Model/Payment/AdditionalDataOpenInvoice.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataOpenInvoice.cs rename to Adyen/src/Model/Payment/AdditionalDataOpenInvoice.cs diff --git a/Adyen/Model/Payment/AdditionalDataOpi.cs b/Adyen/src/Model/Payment/AdditionalDataOpi.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataOpi.cs rename to Adyen/src/Model/Payment/AdditionalDataOpi.cs diff --git a/Adyen/Model/Payment/AdditionalDataRatepay.cs b/Adyen/src/Model/Payment/AdditionalDataRatepay.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataRatepay.cs rename to Adyen/src/Model/Payment/AdditionalDataRatepay.cs diff --git a/Adyen/Model/Payment/AdditionalDataRetry.cs b/Adyen/src/Model/Payment/AdditionalDataRetry.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataRetry.cs rename to Adyen/src/Model/Payment/AdditionalDataRetry.cs diff --git a/Adyen/Model/Payment/AdditionalDataRisk.cs b/Adyen/src/Model/Payment/AdditionalDataRisk.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataRisk.cs rename to Adyen/src/Model/Payment/AdditionalDataRisk.cs diff --git a/Adyen/Model/Payment/AdditionalDataRiskStandalone.cs b/Adyen/src/Model/Payment/AdditionalDataRiskStandalone.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataRiskStandalone.cs rename to Adyen/src/Model/Payment/AdditionalDataRiskStandalone.cs diff --git a/Adyen/Model/Payment/AdditionalDataSubMerchant.cs b/Adyen/src/Model/Payment/AdditionalDataSubMerchant.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataSubMerchant.cs rename to Adyen/src/Model/Payment/AdditionalDataSubMerchant.cs diff --git a/Adyen/Model/Payment/AdditionalDataTemporaryServices.cs b/Adyen/src/Model/Payment/AdditionalDataTemporaryServices.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataTemporaryServices.cs rename to Adyen/src/Model/Payment/AdditionalDataTemporaryServices.cs diff --git a/Adyen/Model/Payment/AdditionalDataWallets.cs b/Adyen/src/Model/Payment/AdditionalDataWallets.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataWallets.cs rename to Adyen/src/Model/Payment/AdditionalDataWallets.cs diff --git a/Adyen/Model/Payment/Address.cs b/Adyen/src/Model/Payment/Address.cs similarity index 100% rename from Adyen/Model/Payment/Address.cs rename to Adyen/src/Model/Payment/Address.cs diff --git a/Adyen/Model/Payment/AdjustAuthorisationRequest.cs b/Adyen/src/Model/Payment/AdjustAuthorisationRequest.cs similarity index 100% rename from Adyen/Model/Payment/AdjustAuthorisationRequest.cs rename to Adyen/src/Model/Payment/AdjustAuthorisationRequest.cs diff --git a/Adyen/Model/Payment/Amount.cs b/Adyen/src/Model/Payment/Amount.cs similarity index 100% rename from Adyen/Model/Payment/Amount.cs rename to Adyen/src/Model/Payment/Amount.cs diff --git a/Adyen/Model/Payment/ApplicationInfo.cs b/Adyen/src/Model/Payment/ApplicationInfo.cs similarity index 100% rename from Adyen/Model/Payment/ApplicationInfo.cs rename to Adyen/src/Model/Payment/ApplicationInfo.cs diff --git a/Adyen/Model/Payment/AuthenticationResultRequest.cs b/Adyen/src/Model/Payment/AuthenticationResultRequest.cs similarity index 100% rename from Adyen/Model/Payment/AuthenticationResultRequest.cs rename to Adyen/src/Model/Payment/AuthenticationResultRequest.cs diff --git a/Adyen/Model/Payment/AuthenticationResultResponse.cs b/Adyen/src/Model/Payment/AuthenticationResultResponse.cs similarity index 100% rename from Adyen/Model/Payment/AuthenticationResultResponse.cs rename to Adyen/src/Model/Payment/AuthenticationResultResponse.cs diff --git a/Adyen/Model/Payment/BankAccount.cs b/Adyen/src/Model/Payment/BankAccount.cs similarity index 100% rename from Adyen/Model/Payment/BankAccount.cs rename to Adyen/src/Model/Payment/BankAccount.cs diff --git a/Adyen/Model/Payment/BrowserInfo.cs b/Adyen/src/Model/Payment/BrowserInfo.cs similarity index 100% rename from Adyen/Model/Payment/BrowserInfo.cs rename to Adyen/src/Model/Payment/BrowserInfo.cs diff --git a/Adyen/Model/Payment/CancelOrRefundRequest.cs b/Adyen/src/Model/Payment/CancelOrRefundRequest.cs similarity index 100% rename from Adyen/Model/Payment/CancelOrRefundRequest.cs rename to Adyen/src/Model/Payment/CancelOrRefundRequest.cs diff --git a/Adyen/Model/Payment/CancelRequest.cs b/Adyen/src/Model/Payment/CancelRequest.cs similarity index 100% rename from Adyen/Model/Payment/CancelRequest.cs rename to Adyen/src/Model/Payment/CancelRequest.cs diff --git a/Adyen/Model/Payment/CaptureRequest.cs b/Adyen/src/Model/Payment/CaptureRequest.cs similarity index 100% rename from Adyen/Model/Payment/CaptureRequest.cs rename to Adyen/src/Model/Payment/CaptureRequest.cs diff --git a/Adyen/Model/Payment/Card.cs b/Adyen/src/Model/Payment/Card.cs similarity index 100% rename from Adyen/Model/Payment/Card.cs rename to Adyen/src/Model/Payment/Card.cs diff --git a/Adyen/Model/Payment/CommonField.cs b/Adyen/src/Model/Payment/CommonField.cs similarity index 100% rename from Adyen/Model/Payment/CommonField.cs rename to Adyen/src/Model/Payment/CommonField.cs diff --git a/Adyen/Model/Payment/DeviceRenderOptions.cs b/Adyen/src/Model/Payment/DeviceRenderOptions.cs similarity index 100% rename from Adyen/Model/Payment/DeviceRenderOptions.cs rename to Adyen/src/Model/Payment/DeviceRenderOptions.cs diff --git a/Adyen/Model/Payment/DonationRequest.cs b/Adyen/src/Model/Payment/DonationRequest.cs similarity index 100% rename from Adyen/Model/Payment/DonationRequest.cs rename to Adyen/src/Model/Payment/DonationRequest.cs diff --git a/Adyen/Model/Payment/ExternalPlatform.cs b/Adyen/src/Model/Payment/ExternalPlatform.cs similarity index 100% rename from Adyen/Model/Payment/ExternalPlatform.cs rename to Adyen/src/Model/Payment/ExternalPlatform.cs diff --git a/Adyen/Model/Payment/ForexQuote.cs b/Adyen/src/Model/Payment/ForexQuote.cs similarity index 100% rename from Adyen/Model/Payment/ForexQuote.cs rename to Adyen/src/Model/Payment/ForexQuote.cs diff --git a/Adyen/Model/Payment/FraudCheckResult.cs b/Adyen/src/Model/Payment/FraudCheckResult.cs similarity index 100% rename from Adyen/Model/Payment/FraudCheckResult.cs rename to Adyen/src/Model/Payment/FraudCheckResult.cs diff --git a/Adyen/Model/Payment/FraudCheckResultWrapper.cs b/Adyen/src/Model/Payment/FraudCheckResultWrapper.cs similarity index 100% rename from Adyen/Model/Payment/FraudCheckResultWrapper.cs rename to Adyen/src/Model/Payment/FraudCheckResultWrapper.cs diff --git a/Adyen/Model/Payment/FraudResult.cs b/Adyen/src/Model/Payment/FraudResult.cs similarity index 100% rename from Adyen/Model/Payment/FraudResult.cs rename to Adyen/src/Model/Payment/FraudResult.cs diff --git a/Adyen/Model/Payment/FundDestination.cs b/Adyen/src/Model/Payment/FundDestination.cs similarity index 100% rename from Adyen/Model/Payment/FundDestination.cs rename to Adyen/src/Model/Payment/FundDestination.cs diff --git a/Adyen/Model/Payment/FundSource.cs b/Adyen/src/Model/Payment/FundSource.cs similarity index 100% rename from Adyen/Model/Payment/FundSource.cs rename to Adyen/src/Model/Payment/FundSource.cs diff --git a/Adyen/Model/Payment/Installments.cs b/Adyen/src/Model/Payment/Installments.cs similarity index 100% rename from Adyen/Model/Payment/Installments.cs rename to Adyen/src/Model/Payment/Installments.cs diff --git a/Adyen/Model/Payment/Mandate.cs b/Adyen/src/Model/Payment/Mandate.cs similarity index 100% rename from Adyen/Model/Payment/Mandate.cs rename to Adyen/src/Model/Payment/Mandate.cs diff --git a/Adyen/Model/Payment/MerchantDevice.cs b/Adyen/src/Model/Payment/MerchantDevice.cs similarity index 100% rename from Adyen/Model/Payment/MerchantDevice.cs rename to Adyen/src/Model/Payment/MerchantDevice.cs diff --git a/Adyen/Model/Payment/MerchantRiskIndicator.cs b/Adyen/src/Model/Payment/MerchantRiskIndicator.cs similarity index 100% rename from Adyen/Model/Payment/MerchantRiskIndicator.cs rename to Adyen/src/Model/Payment/MerchantRiskIndicator.cs diff --git a/Adyen/Model/Payment/ModificationResult.cs b/Adyen/src/Model/Payment/ModificationResult.cs similarity index 100% rename from Adyen/Model/Payment/ModificationResult.cs rename to Adyen/src/Model/Payment/ModificationResult.cs diff --git a/Adyen/Model/Payment/Name.cs b/Adyen/src/Model/Payment/Name.cs similarity index 100% rename from Adyen/Model/Payment/Name.cs rename to Adyen/src/Model/Payment/Name.cs diff --git a/Adyen/Model/Payment/PaymentRequest.cs b/Adyen/src/Model/Payment/PaymentRequest.cs similarity index 100% rename from Adyen/Model/Payment/PaymentRequest.cs rename to Adyen/src/Model/Payment/PaymentRequest.cs diff --git a/Adyen/Model/Payment/PaymentRequest3d.cs b/Adyen/src/Model/Payment/PaymentRequest3d.cs similarity index 100% rename from Adyen/Model/Payment/PaymentRequest3d.cs rename to Adyen/src/Model/Payment/PaymentRequest3d.cs diff --git a/Adyen/Model/Payment/PaymentRequest3ds2.cs b/Adyen/src/Model/Payment/PaymentRequest3ds2.cs similarity index 100% rename from Adyen/Model/Payment/PaymentRequest3ds2.cs rename to Adyen/src/Model/Payment/PaymentRequest3ds2.cs diff --git a/Adyen/Model/Payment/PaymentResult.cs b/Adyen/src/Model/Payment/PaymentResult.cs similarity index 100% rename from Adyen/Model/Payment/PaymentResult.cs rename to Adyen/src/Model/Payment/PaymentResult.cs diff --git a/Adyen/Model/Payment/Phone.cs b/Adyen/src/Model/Payment/Phone.cs similarity index 100% rename from Adyen/Model/Payment/Phone.cs rename to Adyen/src/Model/Payment/Phone.cs diff --git a/Adyen/Model/Payment/PlatformChargebackLogic.cs b/Adyen/src/Model/Payment/PlatformChargebackLogic.cs similarity index 100% rename from Adyen/Model/Payment/PlatformChargebackLogic.cs rename to Adyen/src/Model/Payment/PlatformChargebackLogic.cs diff --git a/Adyen/Model/Payment/Recurring.cs b/Adyen/src/Model/Payment/Recurring.cs similarity index 100% rename from Adyen/Model/Payment/Recurring.cs rename to Adyen/src/Model/Payment/Recurring.cs diff --git a/Adyen/Model/Payment/RefundRequest.cs b/Adyen/src/Model/Payment/RefundRequest.cs similarity index 100% rename from Adyen/Model/Payment/RefundRequest.cs rename to Adyen/src/Model/Payment/RefundRequest.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalData3DSecure.cs b/Adyen/src/Model/Payment/ResponseAdditionalData3DSecure.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalData3DSecure.cs rename to Adyen/src/Model/Payment/ResponseAdditionalData3DSecure.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataBillingAddress.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataBillingAddress.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataBillingAddress.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataBillingAddress.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataCard.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataCard.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataCard.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataCard.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataCommon.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataCommon.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataCommon.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataCommon.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataDomesticError.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataDomesticError.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataDomesticError.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataDomesticError.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataInstallments.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataInstallments.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataInstallments.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataInstallments.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataNetworkTokens.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataNetworkTokens.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataNetworkTokens.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataNetworkTokens.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataOpi.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataOpi.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataOpi.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataOpi.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataSepa.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataSepa.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataSepa.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataSepa.cs diff --git a/Adyen/Model/Payment/SDKEphemPubKey.cs b/Adyen/src/Model/Payment/SDKEphemPubKey.cs similarity index 100% rename from Adyen/Model/Payment/SDKEphemPubKey.cs rename to Adyen/src/Model/Payment/SDKEphemPubKey.cs diff --git a/Adyen/Model/Payment/SecureRemoteCommerceCheckoutData.cs b/Adyen/src/Model/Payment/SecureRemoteCommerceCheckoutData.cs similarity index 100% rename from Adyen/Model/Payment/SecureRemoteCommerceCheckoutData.cs rename to Adyen/src/Model/Payment/SecureRemoteCommerceCheckoutData.cs diff --git a/Adyen/Model/Payment/ServiceError.cs b/Adyen/src/Model/Payment/ServiceError.cs similarity index 100% rename from Adyen/Model/Payment/ServiceError.cs rename to Adyen/src/Model/Payment/ServiceError.cs diff --git a/Adyen/Model/Payment/ShopperInteractionDevice.cs b/Adyen/src/Model/Payment/ShopperInteractionDevice.cs similarity index 100% rename from Adyen/Model/Payment/ShopperInteractionDevice.cs rename to Adyen/src/Model/Payment/ShopperInteractionDevice.cs diff --git a/Adyen/Model/Payment/Split.cs b/Adyen/src/Model/Payment/Split.cs similarity index 100% rename from Adyen/Model/Payment/Split.cs rename to Adyen/src/Model/Payment/Split.cs diff --git a/Adyen/Model/Payment/SplitAmount.cs b/Adyen/src/Model/Payment/SplitAmount.cs similarity index 100% rename from Adyen/Model/Payment/SplitAmount.cs rename to Adyen/src/Model/Payment/SplitAmount.cs diff --git a/Adyen/Model/Payment/SubMerchant.cs b/Adyen/src/Model/Payment/SubMerchant.cs similarity index 100% rename from Adyen/Model/Payment/SubMerchant.cs rename to Adyen/src/Model/Payment/SubMerchant.cs diff --git a/Adyen/Model/Payment/TechnicalCancelRequest.cs b/Adyen/src/Model/Payment/TechnicalCancelRequest.cs similarity index 100% rename from Adyen/Model/Payment/TechnicalCancelRequest.cs rename to Adyen/src/Model/Payment/TechnicalCancelRequest.cs diff --git a/Adyen/Model/Payment/ThreeDS1Result.cs b/Adyen/src/Model/Payment/ThreeDS1Result.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDS1Result.cs rename to Adyen/src/Model/Payment/ThreeDS1Result.cs diff --git a/Adyen/Model/Payment/ThreeDS2RequestData.cs b/Adyen/src/Model/Payment/ThreeDS2RequestData.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDS2RequestData.cs rename to Adyen/src/Model/Payment/ThreeDS2RequestData.cs diff --git a/Adyen/Model/Payment/ThreeDS2Result.cs b/Adyen/src/Model/Payment/ThreeDS2Result.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDS2Result.cs rename to Adyen/src/Model/Payment/ThreeDS2Result.cs diff --git a/Adyen/Model/Payment/ThreeDS2ResultRequest.cs b/Adyen/src/Model/Payment/ThreeDS2ResultRequest.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDS2ResultRequest.cs rename to Adyen/src/Model/Payment/ThreeDS2ResultRequest.cs diff --git a/Adyen/Model/Payment/ThreeDS2ResultResponse.cs b/Adyen/src/Model/Payment/ThreeDS2ResultResponse.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDS2ResultResponse.cs rename to Adyen/src/Model/Payment/ThreeDS2ResultResponse.cs diff --git a/Adyen/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs b/Adyen/src/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs rename to Adyen/src/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs diff --git a/Adyen/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs b/Adyen/src/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs rename to Adyen/src/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs diff --git a/Adyen/Model/Payment/ThreeDSecureData.cs b/Adyen/src/Model/Payment/ThreeDSecureData.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDSecureData.cs rename to Adyen/src/Model/Payment/ThreeDSecureData.cs diff --git a/Adyen/Model/Payment/VoidPendingRefundRequest.cs b/Adyen/src/Model/Payment/VoidPendingRefundRequest.cs similarity index 100% rename from Adyen/Model/Payment/VoidPendingRefundRequest.cs rename to Adyen/src/Model/Payment/VoidPendingRefundRequest.cs diff --git a/Adyen/Model/PaymentsApp/AbstractOpenAPISchema.cs b/Adyen/src/Model/PaymentsApp/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PaymentsApp/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PaymentsApp/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PaymentsApp/BoardingTokenRequest.cs b/Adyen/src/Model/PaymentsApp/BoardingTokenRequest.cs similarity index 100% rename from Adyen/Model/PaymentsApp/BoardingTokenRequest.cs rename to Adyen/src/Model/PaymentsApp/BoardingTokenRequest.cs diff --git a/Adyen/Model/PaymentsApp/BoardingTokenResponse.cs b/Adyen/src/Model/PaymentsApp/BoardingTokenResponse.cs similarity index 100% rename from Adyen/Model/PaymentsApp/BoardingTokenResponse.cs rename to Adyen/src/Model/PaymentsApp/BoardingTokenResponse.cs diff --git a/Adyen/Model/PaymentsApp/DefaultErrorResponseEntity.cs b/Adyen/src/Model/PaymentsApp/DefaultErrorResponseEntity.cs similarity index 100% rename from Adyen/Model/PaymentsApp/DefaultErrorResponseEntity.cs rename to Adyen/src/Model/PaymentsApp/DefaultErrorResponseEntity.cs diff --git a/Adyen/Model/PaymentsApp/InvalidField.cs b/Adyen/src/Model/PaymentsApp/InvalidField.cs similarity index 100% rename from Adyen/Model/PaymentsApp/InvalidField.cs rename to Adyen/src/Model/PaymentsApp/InvalidField.cs diff --git a/Adyen/Model/PaymentsApp/PaymentsAppDto.cs b/Adyen/src/Model/PaymentsApp/PaymentsAppDto.cs similarity index 100% rename from Adyen/Model/PaymentsApp/PaymentsAppDto.cs rename to Adyen/src/Model/PaymentsApp/PaymentsAppDto.cs diff --git a/Adyen/Model/PaymentsApp/PaymentsAppResponse.cs b/Adyen/src/Model/PaymentsApp/PaymentsAppResponse.cs similarity index 100% rename from Adyen/Model/PaymentsApp/PaymentsAppResponse.cs rename to Adyen/src/Model/PaymentsApp/PaymentsAppResponse.cs diff --git a/Adyen/Model/Payout/AbstractOpenAPISchema.cs b/Adyen/src/Model/Payout/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Payout/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Payout/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Payout/Address.cs b/Adyen/src/Model/Payout/Address.cs similarity index 100% rename from Adyen/Model/Payout/Address.cs rename to Adyen/src/Model/Payout/Address.cs diff --git a/Adyen/Model/Payout/Amount.cs b/Adyen/src/Model/Payout/Amount.cs similarity index 100% rename from Adyen/Model/Payout/Amount.cs rename to Adyen/src/Model/Payout/Amount.cs diff --git a/Adyen/Model/Payout/BankAccount.cs b/Adyen/src/Model/Payout/BankAccount.cs similarity index 100% rename from Adyen/Model/Payout/BankAccount.cs rename to Adyen/src/Model/Payout/BankAccount.cs diff --git a/Adyen/Model/Payout/Card.cs b/Adyen/src/Model/Payout/Card.cs similarity index 100% rename from Adyen/Model/Payout/Card.cs rename to Adyen/src/Model/Payout/Card.cs diff --git a/Adyen/Model/Payout/FraudCheckResult.cs b/Adyen/src/Model/Payout/FraudCheckResult.cs similarity index 100% rename from Adyen/Model/Payout/FraudCheckResult.cs rename to Adyen/src/Model/Payout/FraudCheckResult.cs diff --git a/Adyen/Model/Payout/FraudCheckResultWrapper.cs b/Adyen/src/Model/Payout/FraudCheckResultWrapper.cs similarity index 100% rename from Adyen/Model/Payout/FraudCheckResultWrapper.cs rename to Adyen/src/Model/Payout/FraudCheckResultWrapper.cs diff --git a/Adyen/Model/Payout/FraudResult.cs b/Adyen/src/Model/Payout/FraudResult.cs similarity index 100% rename from Adyen/Model/Payout/FraudResult.cs rename to Adyen/src/Model/Payout/FraudResult.cs diff --git a/Adyen/Model/Payout/FundSource.cs b/Adyen/src/Model/Payout/FundSource.cs similarity index 100% rename from Adyen/Model/Payout/FundSource.cs rename to Adyen/src/Model/Payout/FundSource.cs diff --git a/Adyen/Model/Payout/ModifyRequest.cs b/Adyen/src/Model/Payout/ModifyRequest.cs similarity index 100% rename from Adyen/Model/Payout/ModifyRequest.cs rename to Adyen/src/Model/Payout/ModifyRequest.cs diff --git a/Adyen/Model/Payout/ModifyResponse.cs b/Adyen/src/Model/Payout/ModifyResponse.cs similarity index 100% rename from Adyen/Model/Payout/ModifyResponse.cs rename to Adyen/src/Model/Payout/ModifyResponse.cs diff --git a/Adyen/Model/Payout/Name.cs b/Adyen/src/Model/Payout/Name.cs similarity index 100% rename from Adyen/Model/Payout/Name.cs rename to Adyen/src/Model/Payout/Name.cs diff --git a/Adyen/Model/Payout/PayoutRequest.cs b/Adyen/src/Model/Payout/PayoutRequest.cs similarity index 100% rename from Adyen/Model/Payout/PayoutRequest.cs rename to Adyen/src/Model/Payout/PayoutRequest.cs diff --git a/Adyen/Model/Payout/PayoutResponse.cs b/Adyen/src/Model/Payout/PayoutResponse.cs similarity index 100% rename from Adyen/Model/Payout/PayoutResponse.cs rename to Adyen/src/Model/Payout/PayoutResponse.cs diff --git a/Adyen/Model/Payout/Recurring.cs b/Adyen/src/Model/Payout/Recurring.cs similarity index 100% rename from Adyen/Model/Payout/Recurring.cs rename to Adyen/src/Model/Payout/Recurring.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalData3DSecure.cs b/Adyen/src/Model/Payout/ResponseAdditionalData3DSecure.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalData3DSecure.cs rename to Adyen/src/Model/Payout/ResponseAdditionalData3DSecure.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataBillingAddress.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataBillingAddress.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataBillingAddress.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataBillingAddress.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataCard.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataCard.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataCard.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataCard.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataCommon.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataCommon.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataCommon.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataCommon.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataDomesticError.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataDomesticError.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataDomesticError.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataDomesticError.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataInstallments.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataInstallments.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataInstallments.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataInstallments.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataNetworkTokens.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataNetworkTokens.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataNetworkTokens.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataNetworkTokens.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataOpi.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataOpi.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataOpi.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataOpi.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataSepa.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataSepa.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataSepa.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataSepa.cs diff --git a/Adyen/Model/Payout/ServiceError.cs b/Adyen/src/Model/Payout/ServiceError.cs similarity index 100% rename from Adyen/Model/Payout/ServiceError.cs rename to Adyen/src/Model/Payout/ServiceError.cs diff --git a/Adyen/Model/Payout/StoreDetailAndSubmitRequest.cs b/Adyen/src/Model/Payout/StoreDetailAndSubmitRequest.cs similarity index 100% rename from Adyen/Model/Payout/StoreDetailAndSubmitRequest.cs rename to Adyen/src/Model/Payout/StoreDetailAndSubmitRequest.cs diff --git a/Adyen/Model/Payout/StoreDetailAndSubmitResponse.cs b/Adyen/src/Model/Payout/StoreDetailAndSubmitResponse.cs similarity index 100% rename from Adyen/Model/Payout/StoreDetailAndSubmitResponse.cs rename to Adyen/src/Model/Payout/StoreDetailAndSubmitResponse.cs diff --git a/Adyen/Model/Payout/StoreDetailRequest.cs b/Adyen/src/Model/Payout/StoreDetailRequest.cs similarity index 100% rename from Adyen/Model/Payout/StoreDetailRequest.cs rename to Adyen/src/Model/Payout/StoreDetailRequest.cs diff --git a/Adyen/Model/Payout/StoreDetailResponse.cs b/Adyen/src/Model/Payout/StoreDetailResponse.cs similarity index 100% rename from Adyen/Model/Payout/StoreDetailResponse.cs rename to Adyen/src/Model/Payout/StoreDetailResponse.cs diff --git a/Adyen/Model/Payout/SubmitRequest.cs b/Adyen/src/Model/Payout/SubmitRequest.cs similarity index 100% rename from Adyen/Model/Payout/SubmitRequest.cs rename to Adyen/src/Model/Payout/SubmitRequest.cs diff --git a/Adyen/Model/Payout/SubmitResponse.cs b/Adyen/src/Model/Payout/SubmitResponse.cs similarity index 100% rename from Adyen/Model/Payout/SubmitResponse.cs rename to Adyen/src/Model/Payout/SubmitResponse.cs diff --git a/Adyen/Model/PlatformsAccount/AbstractOpenAPISchema.cs b/Adyen/src/Model/PlatformsAccount/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PlatformsAccount/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PlatformsAccount/Account.cs b/Adyen/src/Model/PlatformsAccount/Account.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/Account.cs rename to Adyen/src/Model/PlatformsAccount/Account.cs diff --git a/Adyen/Model/PlatformsAccount/AccountEvent.cs b/Adyen/src/Model/PlatformsAccount/AccountEvent.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/AccountEvent.cs rename to Adyen/src/Model/PlatformsAccount/AccountEvent.cs diff --git a/Adyen/Model/PlatformsAccount/AccountHolderDetails.cs b/Adyen/src/Model/PlatformsAccount/AccountHolderDetails.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/AccountHolderDetails.cs rename to Adyen/src/Model/PlatformsAccount/AccountHolderDetails.cs diff --git a/Adyen/Model/PlatformsAccount/AccountHolderStatus.cs b/Adyen/src/Model/PlatformsAccount/AccountHolderStatus.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/AccountHolderStatus.cs rename to Adyen/src/Model/PlatformsAccount/AccountHolderStatus.cs diff --git a/Adyen/Model/PlatformsAccount/AccountPayoutState.cs b/Adyen/src/Model/PlatformsAccount/AccountPayoutState.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/AccountPayoutState.cs rename to Adyen/src/Model/PlatformsAccount/AccountPayoutState.cs diff --git a/Adyen/Model/PlatformsAccount/AccountProcessingState.cs b/Adyen/src/Model/PlatformsAccount/AccountProcessingState.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/AccountProcessingState.cs rename to Adyen/src/Model/PlatformsAccount/AccountProcessingState.cs diff --git a/Adyen/Model/PlatformsAccount/Amount.cs b/Adyen/src/Model/PlatformsAccount/Amount.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/Amount.cs rename to Adyen/src/Model/PlatformsAccount/Amount.cs diff --git a/Adyen/Model/PlatformsAccount/BankAccountDetail.cs b/Adyen/src/Model/PlatformsAccount/BankAccountDetail.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/BankAccountDetail.cs rename to Adyen/src/Model/PlatformsAccount/BankAccountDetail.cs diff --git a/Adyen/Model/PlatformsAccount/BusinessDetails.cs b/Adyen/src/Model/PlatformsAccount/BusinessDetails.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/BusinessDetails.cs rename to Adyen/src/Model/PlatformsAccount/BusinessDetails.cs diff --git a/Adyen/Model/PlatformsAccount/CloseAccountHolderRequest.cs b/Adyen/src/Model/PlatformsAccount/CloseAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CloseAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsAccount/CloseAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/CloseAccountHolderResponse.cs b/Adyen/src/Model/PlatformsAccount/CloseAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CloseAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsAccount/CloseAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsAccount/CloseAccountRequest.cs b/Adyen/src/Model/PlatformsAccount/CloseAccountRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CloseAccountRequest.cs rename to Adyen/src/Model/PlatformsAccount/CloseAccountRequest.cs diff --git a/Adyen/Model/PlatformsAccount/CloseAccountResponse.cs b/Adyen/src/Model/PlatformsAccount/CloseAccountResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CloseAccountResponse.cs rename to Adyen/src/Model/PlatformsAccount/CloseAccountResponse.cs diff --git a/Adyen/Model/PlatformsAccount/CloseStoresRequest.cs b/Adyen/src/Model/PlatformsAccount/CloseStoresRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CloseStoresRequest.cs rename to Adyen/src/Model/PlatformsAccount/CloseStoresRequest.cs diff --git a/Adyen/Model/PlatformsAccount/CreateAccountHolderRequest.cs b/Adyen/src/Model/PlatformsAccount/CreateAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CreateAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsAccount/CreateAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/CreateAccountHolderResponse.cs b/Adyen/src/Model/PlatformsAccount/CreateAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CreateAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsAccount/CreateAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsAccount/CreateAccountRequest.cs b/Adyen/src/Model/PlatformsAccount/CreateAccountRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CreateAccountRequest.cs rename to Adyen/src/Model/PlatformsAccount/CreateAccountRequest.cs diff --git a/Adyen/Model/PlatformsAccount/CreateAccountResponse.cs b/Adyen/src/Model/PlatformsAccount/CreateAccountResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CreateAccountResponse.cs rename to Adyen/src/Model/PlatformsAccount/CreateAccountResponse.cs diff --git a/Adyen/Model/PlatformsAccount/DeleteBankAccountRequest.cs b/Adyen/src/Model/PlatformsAccount/DeleteBankAccountRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/DeleteBankAccountRequest.cs rename to Adyen/src/Model/PlatformsAccount/DeleteBankAccountRequest.cs diff --git a/Adyen/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs b/Adyen/src/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs rename to Adyen/src/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs diff --git a/Adyen/Model/PlatformsAccount/DeletePayoutMethodRequest.cs b/Adyen/src/Model/PlatformsAccount/DeletePayoutMethodRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/DeletePayoutMethodRequest.cs rename to Adyen/src/Model/PlatformsAccount/DeletePayoutMethodRequest.cs diff --git a/Adyen/Model/PlatformsAccount/DeleteShareholderRequest.cs b/Adyen/src/Model/PlatformsAccount/DeleteShareholderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/DeleteShareholderRequest.cs rename to Adyen/src/Model/PlatformsAccount/DeleteShareholderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/DeleteSignatoriesRequest.cs b/Adyen/src/Model/PlatformsAccount/DeleteSignatoriesRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/DeleteSignatoriesRequest.cs rename to Adyen/src/Model/PlatformsAccount/DeleteSignatoriesRequest.cs diff --git a/Adyen/Model/PlatformsAccount/DocumentDetail.cs b/Adyen/src/Model/PlatformsAccount/DocumentDetail.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/DocumentDetail.cs rename to Adyen/src/Model/PlatformsAccount/DocumentDetail.cs diff --git a/Adyen/Model/PlatformsAccount/ErrorFieldType.cs b/Adyen/src/Model/PlatformsAccount/ErrorFieldType.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ErrorFieldType.cs rename to Adyen/src/Model/PlatformsAccount/ErrorFieldType.cs diff --git a/Adyen/Model/PlatformsAccount/FieldType.cs b/Adyen/src/Model/PlatformsAccount/FieldType.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/FieldType.cs rename to Adyen/src/Model/PlatformsAccount/FieldType.cs diff --git a/Adyen/Model/PlatformsAccount/GenericResponse.cs b/Adyen/src/Model/PlatformsAccount/GenericResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GenericResponse.cs rename to Adyen/src/Model/PlatformsAccount/GenericResponse.cs diff --git a/Adyen/Model/PlatformsAccount/GetAccountHolderRequest.cs b/Adyen/src/Model/PlatformsAccount/GetAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsAccount/GetAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/GetAccountHolderResponse.cs b/Adyen/src/Model/PlatformsAccount/GetAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsAccount/GetAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs b/Adyen/src/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs rename to Adyen/src/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs diff --git a/Adyen/Model/PlatformsAccount/GetTaxFormRequest.cs b/Adyen/src/Model/PlatformsAccount/GetTaxFormRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetTaxFormRequest.cs rename to Adyen/src/Model/PlatformsAccount/GetTaxFormRequest.cs diff --git a/Adyen/Model/PlatformsAccount/GetTaxFormResponse.cs b/Adyen/src/Model/PlatformsAccount/GetTaxFormResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetTaxFormResponse.cs rename to Adyen/src/Model/PlatformsAccount/GetTaxFormResponse.cs diff --git a/Adyen/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs b/Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs rename to Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs diff --git a/Adyen/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs b/Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs rename to Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs diff --git a/Adyen/Model/PlatformsAccount/IndividualDetails.cs b/Adyen/src/Model/PlatformsAccount/IndividualDetails.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/IndividualDetails.cs rename to Adyen/src/Model/PlatformsAccount/IndividualDetails.cs diff --git a/Adyen/Model/PlatformsAccount/KYCCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCCheckStatusData.cs b/Adyen/src/Model/PlatformsAccount/KYCCheckStatusData.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCCheckStatusData.cs rename to Adyen/src/Model/PlatformsAccount/KYCCheckStatusData.cs diff --git a/Adyen/Model/PlatformsAccount/KYCCheckSummary.cs b/Adyen/src/Model/PlatformsAccount/KYCCheckSummary.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCCheckSummary.cs rename to Adyen/src/Model/PlatformsAccount/KYCCheckSummary.cs diff --git a/Adyen/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCShareholderCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCShareholderCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCShareholderCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCShareholderCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCSignatoryCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCSignatoryCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCSignatoryCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCSignatoryCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCVerificationResult.cs b/Adyen/src/Model/PlatformsAccount/KYCVerificationResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCVerificationResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCVerificationResult.cs diff --git a/Adyen/Model/PlatformsAccount/LegalArrangementDetail.cs b/Adyen/src/Model/PlatformsAccount/LegalArrangementDetail.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/LegalArrangementDetail.cs rename to Adyen/src/Model/PlatformsAccount/LegalArrangementDetail.cs diff --git a/Adyen/Model/PlatformsAccount/LegalArrangementEntityDetail.cs b/Adyen/src/Model/PlatformsAccount/LegalArrangementEntityDetail.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/LegalArrangementEntityDetail.cs rename to Adyen/src/Model/PlatformsAccount/LegalArrangementEntityDetail.cs diff --git a/Adyen/Model/PlatformsAccount/LegalArrangementRequest.cs b/Adyen/src/Model/PlatformsAccount/LegalArrangementRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/LegalArrangementRequest.cs rename to Adyen/src/Model/PlatformsAccount/LegalArrangementRequest.cs diff --git a/Adyen/Model/PlatformsAccount/MigratedAccounts.cs b/Adyen/src/Model/PlatformsAccount/MigratedAccounts.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/MigratedAccounts.cs rename to Adyen/src/Model/PlatformsAccount/MigratedAccounts.cs diff --git a/Adyen/Model/PlatformsAccount/MigratedShareholders.cs b/Adyen/src/Model/PlatformsAccount/MigratedShareholders.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/MigratedShareholders.cs rename to Adyen/src/Model/PlatformsAccount/MigratedShareholders.cs diff --git a/Adyen/Model/PlatformsAccount/MigratedStores.cs b/Adyen/src/Model/PlatformsAccount/MigratedStores.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/MigratedStores.cs rename to Adyen/src/Model/PlatformsAccount/MigratedStores.cs diff --git a/Adyen/Model/PlatformsAccount/MigrationData.cs b/Adyen/src/Model/PlatformsAccount/MigrationData.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/MigrationData.cs rename to Adyen/src/Model/PlatformsAccount/MigrationData.cs diff --git a/Adyen/Model/PlatformsAccount/PayoutMethod.cs b/Adyen/src/Model/PlatformsAccount/PayoutMethod.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/PayoutMethod.cs rename to Adyen/src/Model/PlatformsAccount/PayoutMethod.cs diff --git a/Adyen/Model/PlatformsAccount/PayoutScheduleResponse.cs b/Adyen/src/Model/PlatformsAccount/PayoutScheduleResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/PayoutScheduleResponse.cs rename to Adyen/src/Model/PlatformsAccount/PayoutScheduleResponse.cs diff --git a/Adyen/Model/PlatformsAccount/PerformVerificationRequest.cs b/Adyen/src/Model/PlatformsAccount/PerformVerificationRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/PerformVerificationRequest.cs rename to Adyen/src/Model/PlatformsAccount/PerformVerificationRequest.cs diff --git a/Adyen/Model/PlatformsAccount/PersonalDocumentData.cs b/Adyen/src/Model/PlatformsAccount/PersonalDocumentData.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/PersonalDocumentData.cs rename to Adyen/src/Model/PlatformsAccount/PersonalDocumentData.cs diff --git a/Adyen/Model/PlatformsAccount/ServiceError.cs b/Adyen/src/Model/PlatformsAccount/ServiceError.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ServiceError.cs rename to Adyen/src/Model/PlatformsAccount/ServiceError.cs diff --git a/Adyen/Model/PlatformsAccount/ShareholderContact.cs b/Adyen/src/Model/PlatformsAccount/ShareholderContact.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ShareholderContact.cs rename to Adyen/src/Model/PlatformsAccount/ShareholderContact.cs diff --git a/Adyen/Model/PlatformsAccount/SignatoryContact.cs b/Adyen/src/Model/PlatformsAccount/SignatoryContact.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/SignatoryContact.cs rename to Adyen/src/Model/PlatformsAccount/SignatoryContact.cs diff --git a/Adyen/Model/PlatformsAccount/StoreDetail.cs b/Adyen/src/Model/PlatformsAccount/StoreDetail.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/StoreDetail.cs rename to Adyen/src/Model/PlatformsAccount/StoreDetail.cs diff --git a/Adyen/Model/PlatformsAccount/SuspendAccountHolderRequest.cs b/Adyen/src/Model/PlatformsAccount/SuspendAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/SuspendAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsAccount/SuspendAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/SuspendAccountHolderResponse.cs b/Adyen/src/Model/PlatformsAccount/SuspendAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/SuspendAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsAccount/SuspendAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsAccount/UltimateParentCompany.cs b/Adyen/src/Model/PlatformsAccount/UltimateParentCompany.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UltimateParentCompany.cs rename to Adyen/src/Model/PlatformsAccount/UltimateParentCompany.cs diff --git a/Adyen/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs b/Adyen/src/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs rename to Adyen/src/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs diff --git a/Adyen/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs b/Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs b/Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsAccount/UpdateAccountHolderRequest.cs b/Adyen/src/Model/PlatformsAccount/UpdateAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UpdateAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsAccount/UpdateAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/UpdateAccountHolderResponse.cs b/Adyen/src/Model/PlatformsAccount/UpdateAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UpdateAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsAccount/UpdateAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs b/Adyen/src/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs rename to Adyen/src/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs diff --git a/Adyen/Model/PlatformsAccount/UpdateAccountRequest.cs b/Adyen/src/Model/PlatformsAccount/UpdateAccountRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UpdateAccountRequest.cs rename to Adyen/src/Model/PlatformsAccount/UpdateAccountRequest.cs diff --git a/Adyen/Model/PlatformsAccount/UpdateAccountResponse.cs b/Adyen/src/Model/PlatformsAccount/UpdateAccountResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UpdateAccountResponse.cs rename to Adyen/src/Model/PlatformsAccount/UpdateAccountResponse.cs diff --git a/Adyen/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs b/Adyen/src/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs rename to Adyen/src/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs diff --git a/Adyen/Model/PlatformsAccount/UploadDocumentRequest.cs b/Adyen/src/Model/PlatformsAccount/UploadDocumentRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UploadDocumentRequest.cs rename to Adyen/src/Model/PlatformsAccount/UploadDocumentRequest.cs diff --git a/Adyen/Model/PlatformsAccount/ViasAddress.cs b/Adyen/src/Model/PlatformsAccount/ViasAddress.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ViasAddress.cs rename to Adyen/src/Model/PlatformsAccount/ViasAddress.cs diff --git a/Adyen/Model/PlatformsAccount/ViasName.cs b/Adyen/src/Model/PlatformsAccount/ViasName.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ViasName.cs rename to Adyen/src/Model/PlatformsAccount/ViasName.cs diff --git a/Adyen/Model/PlatformsAccount/ViasPersonalData.cs b/Adyen/src/Model/PlatformsAccount/ViasPersonalData.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ViasPersonalData.cs rename to Adyen/src/Model/PlatformsAccount/ViasPersonalData.cs diff --git a/Adyen/Model/PlatformsAccount/ViasPhoneNumber.cs b/Adyen/src/Model/PlatformsAccount/ViasPhoneNumber.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ViasPhoneNumber.cs rename to Adyen/src/Model/PlatformsAccount/ViasPhoneNumber.cs diff --git a/Adyen/Model/PlatformsFund/AbstractOpenAPISchema.cs b/Adyen/src/Model/PlatformsFund/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PlatformsFund/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PlatformsFund/AccountDetailBalance.cs b/Adyen/src/Model/PlatformsFund/AccountDetailBalance.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AccountDetailBalance.cs rename to Adyen/src/Model/PlatformsFund/AccountDetailBalance.cs diff --git a/Adyen/Model/PlatformsFund/AccountHolderBalanceRequest.cs b/Adyen/src/Model/PlatformsFund/AccountHolderBalanceRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AccountHolderBalanceRequest.cs rename to Adyen/src/Model/PlatformsFund/AccountHolderBalanceRequest.cs diff --git a/Adyen/Model/PlatformsFund/AccountHolderBalanceResponse.cs b/Adyen/src/Model/PlatformsFund/AccountHolderBalanceResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AccountHolderBalanceResponse.cs rename to Adyen/src/Model/PlatformsFund/AccountHolderBalanceResponse.cs diff --git a/Adyen/Model/PlatformsFund/AccountHolderTransactionListRequest.cs b/Adyen/src/Model/PlatformsFund/AccountHolderTransactionListRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AccountHolderTransactionListRequest.cs rename to Adyen/src/Model/PlatformsFund/AccountHolderTransactionListRequest.cs diff --git a/Adyen/Model/PlatformsFund/AccountHolderTransactionListResponse.cs b/Adyen/src/Model/PlatformsFund/AccountHolderTransactionListResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AccountHolderTransactionListResponse.cs rename to Adyen/src/Model/PlatformsFund/AccountHolderTransactionListResponse.cs diff --git a/Adyen/Model/PlatformsFund/AccountTransactionList.cs b/Adyen/src/Model/PlatformsFund/AccountTransactionList.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AccountTransactionList.cs rename to Adyen/src/Model/PlatformsFund/AccountTransactionList.cs diff --git a/Adyen/Model/PlatformsFund/Amount.cs b/Adyen/src/Model/PlatformsFund/Amount.cs similarity index 100% rename from Adyen/Model/PlatformsFund/Amount.cs rename to Adyen/src/Model/PlatformsFund/Amount.cs diff --git a/Adyen/Model/PlatformsFund/BankAccountDetail.cs b/Adyen/src/Model/PlatformsFund/BankAccountDetail.cs similarity index 100% rename from Adyen/Model/PlatformsFund/BankAccountDetail.cs rename to Adyen/src/Model/PlatformsFund/BankAccountDetail.cs diff --git a/Adyen/Model/PlatformsFund/DebitAccountHolderRequest.cs b/Adyen/src/Model/PlatformsFund/DebitAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/DebitAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsFund/DebitAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsFund/DebitAccountHolderResponse.cs b/Adyen/src/Model/PlatformsFund/DebitAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/DebitAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsFund/DebitAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsFund/DetailBalance.cs b/Adyen/src/Model/PlatformsFund/DetailBalance.cs similarity index 100% rename from Adyen/Model/PlatformsFund/DetailBalance.cs rename to Adyen/src/Model/PlatformsFund/DetailBalance.cs diff --git a/Adyen/Model/PlatformsFund/ErrorFieldType.cs b/Adyen/src/Model/PlatformsFund/ErrorFieldType.cs similarity index 100% rename from Adyen/Model/PlatformsFund/ErrorFieldType.cs rename to Adyen/src/Model/PlatformsFund/ErrorFieldType.cs diff --git a/Adyen/Model/PlatformsFund/FieldType.cs b/Adyen/src/Model/PlatformsFund/FieldType.cs similarity index 100% rename from Adyen/Model/PlatformsFund/FieldType.cs rename to Adyen/src/Model/PlatformsFund/FieldType.cs diff --git a/Adyen/Model/PlatformsFund/PayoutAccountHolderRequest.cs b/Adyen/src/Model/PlatformsFund/PayoutAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/PayoutAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsFund/PayoutAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsFund/PayoutAccountHolderResponse.cs b/Adyen/src/Model/PlatformsFund/PayoutAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/PayoutAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsFund/PayoutAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsFund/RefundFundsTransferRequest.cs b/Adyen/src/Model/PlatformsFund/RefundFundsTransferRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/RefundFundsTransferRequest.cs rename to Adyen/src/Model/PlatformsFund/RefundFundsTransferRequest.cs diff --git a/Adyen/Model/PlatformsFund/RefundFundsTransferResponse.cs b/Adyen/src/Model/PlatformsFund/RefundFundsTransferResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/RefundFundsTransferResponse.cs rename to Adyen/src/Model/PlatformsFund/RefundFundsTransferResponse.cs diff --git a/Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs b/Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs rename to Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs diff --git a/Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs b/Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs rename to Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs diff --git a/Adyen/Model/PlatformsFund/ServiceError.cs b/Adyen/src/Model/PlatformsFund/ServiceError.cs similarity index 100% rename from Adyen/Model/PlatformsFund/ServiceError.cs rename to Adyen/src/Model/PlatformsFund/ServiceError.cs diff --git a/Adyen/Model/PlatformsFund/SetupBeneficiaryRequest.cs b/Adyen/src/Model/PlatformsFund/SetupBeneficiaryRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/SetupBeneficiaryRequest.cs rename to Adyen/src/Model/PlatformsFund/SetupBeneficiaryRequest.cs diff --git a/Adyen/Model/PlatformsFund/SetupBeneficiaryResponse.cs b/Adyen/src/Model/PlatformsFund/SetupBeneficiaryResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/SetupBeneficiaryResponse.cs rename to Adyen/src/Model/PlatformsFund/SetupBeneficiaryResponse.cs diff --git a/Adyen/Model/PlatformsFund/Split.cs b/Adyen/src/Model/PlatformsFund/Split.cs similarity index 100% rename from Adyen/Model/PlatformsFund/Split.cs rename to Adyen/src/Model/PlatformsFund/Split.cs diff --git a/Adyen/Model/PlatformsFund/SplitAmount.cs b/Adyen/src/Model/PlatformsFund/SplitAmount.cs similarity index 100% rename from Adyen/Model/PlatformsFund/SplitAmount.cs rename to Adyen/src/Model/PlatformsFund/SplitAmount.cs diff --git a/Adyen/Model/PlatformsFund/Transaction.cs b/Adyen/src/Model/PlatformsFund/Transaction.cs similarity index 100% rename from Adyen/Model/PlatformsFund/Transaction.cs rename to Adyen/src/Model/PlatformsFund/Transaction.cs diff --git a/Adyen/Model/PlatformsFund/TransactionListForAccount.cs b/Adyen/src/Model/PlatformsFund/TransactionListForAccount.cs similarity index 100% rename from Adyen/Model/PlatformsFund/TransactionListForAccount.cs rename to Adyen/src/Model/PlatformsFund/TransactionListForAccount.cs diff --git a/Adyen/Model/PlatformsFund/TransferFundsRequest.cs b/Adyen/src/Model/PlatformsFund/TransferFundsRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/TransferFundsRequest.cs rename to Adyen/src/Model/PlatformsFund/TransferFundsRequest.cs diff --git a/Adyen/Model/PlatformsFund/TransferFundsResponse.cs b/Adyen/src/Model/PlatformsFund/TransferFundsResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/TransferFundsResponse.cs rename to Adyen/src/Model/PlatformsFund/TransferFundsResponse.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/CollectInformation.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/CollectInformation.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/CollectInformation.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/CollectInformation.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/FieldType.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/FieldType.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/FieldType.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/FieldType.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/ServiceError.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/ServiceError.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/ServiceError.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/ServiceError.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/ShowPages.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/ShowPages.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/ShowPages.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/ShowPages.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/FieldType.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/FieldType.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/FieldType.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/FieldType.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/GenericResponse.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/GenericResponse.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/GenericResponse.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/GenericResponse.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/ServiceError.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/ServiceError.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/ServiceError.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/ServiceError.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs diff --git a/Adyen/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountCloseNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountCloseNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountCloseNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountCloseNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountCreateNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountCreateNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountCreateNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountCreateNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountEvent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountEvent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountEvent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountEvent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderDetails.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderDetails.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderDetails.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderDetails.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderStatus.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderStatus.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderStatus.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderStatus.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountPayoutState.cs b/Adyen/src/Model/PlatformsWebhooks/AccountPayoutState.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountPayoutState.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountPayoutState.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountProcessingState.cs b/Adyen/src/Model/PlatformsWebhooks/AccountProcessingState.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountProcessingState.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountProcessingState.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountUpdateNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountUpdateNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountUpdateNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountUpdateNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/Amount.cs b/Adyen/src/Model/PlatformsWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/Amount.cs rename to Adyen/src/Model/PlatformsWebhooks/Amount.cs diff --git a/Adyen/Model/PlatformsWebhooks/BankAccountDetail.cs b/Adyen/src/Model/PlatformsWebhooks/BankAccountDetail.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/BankAccountDetail.cs rename to Adyen/src/Model/PlatformsWebhooks/BankAccountDetail.cs diff --git a/Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs b/Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/BusinessDetails.cs b/Adyen/src/Model/PlatformsWebhooks/BusinessDetails.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/BusinessDetails.cs rename to Adyen/src/Model/PlatformsWebhooks/BusinessDetails.cs diff --git a/Adyen/Model/PlatformsWebhooks/CloseAccountResponse.cs b/Adyen/src/Model/PlatformsWebhooks/CloseAccountResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/CloseAccountResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/CloseAccountResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs b/Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs b/Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs rename to Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs diff --git a/Adyen/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs b/Adyen/src/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/CreateAccountResponse.cs b/Adyen/src/Model/PlatformsWebhooks/CreateAccountResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/CreateAccountResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/CreateAccountResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs b/Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/ErrorFieldType.cs b/Adyen/src/Model/PlatformsWebhooks/ErrorFieldType.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ErrorFieldType.cs rename to Adyen/src/Model/PlatformsWebhooks/ErrorFieldType.cs diff --git a/Adyen/Model/PlatformsWebhooks/FieldType.cs b/Adyen/src/Model/PlatformsWebhooks/FieldType.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/FieldType.cs rename to Adyen/src/Model/PlatformsWebhooks/FieldType.cs diff --git a/Adyen/Model/PlatformsWebhooks/IndividualDetails.cs b/Adyen/src/Model/PlatformsWebhooks/IndividualDetails.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/IndividualDetails.cs rename to Adyen/src/Model/PlatformsWebhooks/IndividualDetails.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCCheckStatusData.cs b/Adyen/src/Model/PlatformsWebhooks/KYCCheckStatusData.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCCheckStatusData.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCCheckStatusData.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCCheckSummary.cs b/Adyen/src/Model/PlatformsWebhooks/KYCCheckSummary.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCCheckSummary.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCCheckSummary.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCVerificationResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCVerificationResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCVerificationResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCVerificationResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/LegalArrangementDetail.cs b/Adyen/src/Model/PlatformsWebhooks/LegalArrangementDetail.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/LegalArrangementDetail.cs rename to Adyen/src/Model/PlatformsWebhooks/LegalArrangementDetail.cs diff --git a/Adyen/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs b/Adyen/src/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs rename to Adyen/src/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs diff --git a/Adyen/Model/PlatformsWebhooks/LocalDate.cs b/Adyen/src/Model/PlatformsWebhooks/LocalDate.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/LocalDate.cs rename to Adyen/src/Model/PlatformsWebhooks/LocalDate.cs diff --git a/Adyen/Model/PlatformsWebhooks/Message.cs b/Adyen/src/Model/PlatformsWebhooks/Message.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/Message.cs rename to Adyen/src/Model/PlatformsWebhooks/Message.cs diff --git a/Adyen/Model/PlatformsWebhooks/NotificationErrorContainer.cs b/Adyen/src/Model/PlatformsWebhooks/NotificationErrorContainer.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/NotificationErrorContainer.cs rename to Adyen/src/Model/PlatformsWebhooks/NotificationErrorContainer.cs diff --git a/Adyen/Model/PlatformsWebhooks/NotificationResponse.cs b/Adyen/src/Model/PlatformsWebhooks/NotificationResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/NotificationResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/NotificationResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/OperationStatus.cs b/Adyen/src/Model/PlatformsWebhooks/OperationStatus.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/OperationStatus.cs rename to Adyen/src/Model/PlatformsWebhooks/OperationStatus.cs diff --git a/Adyen/Model/PlatformsWebhooks/PaymentFailureNotification.cs b/Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/PaymentFailureNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/PayoutMethod.cs b/Adyen/src/Model/PlatformsWebhooks/PayoutMethod.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/PayoutMethod.cs rename to Adyen/src/Model/PlatformsWebhooks/PayoutMethod.cs diff --git a/Adyen/Model/PlatformsWebhooks/PayoutScheduleResponse.cs b/Adyen/src/Model/PlatformsWebhooks/PayoutScheduleResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/PayoutScheduleResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/PayoutScheduleResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/PersonalDocumentData.cs b/Adyen/src/Model/PlatformsWebhooks/PersonalDocumentData.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/PersonalDocumentData.cs rename to Adyen/src/Model/PlatformsWebhooks/PersonalDocumentData.cs diff --git a/Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs b/Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/RefundResult.cs b/Adyen/src/Model/PlatformsWebhooks/RefundResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/RefundResult.cs rename to Adyen/src/Model/PlatformsWebhooks/RefundResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/ReportAvailableNotification.cs b/Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ReportAvailableNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs b/Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/ShareholderContact.cs b/Adyen/src/Model/PlatformsWebhooks/ShareholderContact.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ShareholderContact.cs rename to Adyen/src/Model/PlatformsWebhooks/ShareholderContact.cs diff --git a/Adyen/Model/PlatformsWebhooks/SignatoryContact.cs b/Adyen/src/Model/PlatformsWebhooks/SignatoryContact.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/SignatoryContact.cs rename to Adyen/src/Model/PlatformsWebhooks/SignatoryContact.cs diff --git a/Adyen/Model/PlatformsWebhooks/Split.cs b/Adyen/src/Model/PlatformsWebhooks/Split.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/Split.cs rename to Adyen/src/Model/PlatformsWebhooks/Split.cs diff --git a/Adyen/Model/PlatformsWebhooks/SplitAmount.cs b/Adyen/src/Model/PlatformsWebhooks/SplitAmount.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/SplitAmount.cs rename to Adyen/src/Model/PlatformsWebhooks/SplitAmount.cs diff --git a/Adyen/Model/PlatformsWebhooks/StoreDetail.cs b/Adyen/src/Model/PlatformsWebhooks/StoreDetail.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/StoreDetail.cs rename to Adyen/src/Model/PlatformsWebhooks/StoreDetail.cs diff --git a/Adyen/Model/PlatformsWebhooks/Transaction.cs b/Adyen/src/Model/PlatformsWebhooks/Transaction.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/Transaction.cs rename to Adyen/src/Model/PlatformsWebhooks/Transaction.cs diff --git a/Adyen/Model/PlatformsWebhooks/TransferFundsNotification.cs b/Adyen/src/Model/PlatformsWebhooks/TransferFundsNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/TransferFundsNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/TransferFundsNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/UltimateParentCompany.cs b/Adyen/src/Model/PlatformsWebhooks/UltimateParentCompany.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/UltimateParentCompany.cs rename to Adyen/src/Model/PlatformsWebhooks/UltimateParentCompany.cs diff --git a/Adyen/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs b/Adyen/src/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs rename to Adyen/src/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs diff --git a/Adyen/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs b/Adyen/src/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/UpdateAccountResponse.cs b/Adyen/src/Model/PlatformsWebhooks/UpdateAccountResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/UpdateAccountResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/UpdateAccountResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/ViasAddress.cs b/Adyen/src/Model/PlatformsWebhooks/ViasAddress.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ViasAddress.cs rename to Adyen/src/Model/PlatformsWebhooks/ViasAddress.cs diff --git a/Adyen/Model/PlatformsWebhooks/ViasName.cs b/Adyen/src/Model/PlatformsWebhooks/ViasName.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ViasName.cs rename to Adyen/src/Model/PlatformsWebhooks/ViasName.cs diff --git a/Adyen/Model/PlatformsWebhooks/ViasPersonalData.cs b/Adyen/src/Model/PlatformsWebhooks/ViasPersonalData.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ViasPersonalData.cs rename to Adyen/src/Model/PlatformsWebhooks/ViasPersonalData.cs diff --git a/Adyen/Model/PlatformsWebhooks/ViasPhoneNumber.cs b/Adyen/src/Model/PlatformsWebhooks/ViasPhoneNumber.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ViasPhoneNumber.cs rename to Adyen/src/Model/PlatformsWebhooks/ViasPhoneNumber.cs diff --git a/Adyen/Model/PosMobile/AbstractOpenAPISchema.cs b/Adyen/src/Model/PosMobile/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PosMobile/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PosMobile/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PosMobile/CreateSessionRequest.cs b/Adyen/src/Model/PosMobile/CreateSessionRequest.cs similarity index 100% rename from Adyen/Model/PosMobile/CreateSessionRequest.cs rename to Adyen/src/Model/PosMobile/CreateSessionRequest.cs diff --git a/Adyen/Model/PosMobile/CreateSessionResponse.cs b/Adyen/src/Model/PosMobile/CreateSessionResponse.cs similarity index 100% rename from Adyen/Model/PosMobile/CreateSessionResponse.cs rename to Adyen/src/Model/PosMobile/CreateSessionResponse.cs diff --git a/Adyen/Model/PosTerminalManagement/AbstractOpenAPISchema.cs b/Adyen/src/Model/PosTerminalManagement/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PosTerminalManagement/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PosTerminalManagement/Address.cs b/Adyen/src/Model/PosTerminalManagement/Address.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/Address.cs rename to Adyen/src/Model/PosTerminalManagement/Address.cs diff --git a/Adyen/Model/PosTerminalManagement/AssignTerminalsRequest.cs b/Adyen/src/Model/PosTerminalManagement/AssignTerminalsRequest.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/AssignTerminalsRequest.cs rename to Adyen/src/Model/PosTerminalManagement/AssignTerminalsRequest.cs diff --git a/Adyen/Model/PosTerminalManagement/AssignTerminalsResponse.cs b/Adyen/src/Model/PosTerminalManagement/AssignTerminalsResponse.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/AssignTerminalsResponse.cs rename to Adyen/src/Model/PosTerminalManagement/AssignTerminalsResponse.cs diff --git a/Adyen/Model/PosTerminalManagement/FindTerminalRequest.cs b/Adyen/src/Model/PosTerminalManagement/FindTerminalRequest.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/FindTerminalRequest.cs rename to Adyen/src/Model/PosTerminalManagement/FindTerminalRequest.cs diff --git a/Adyen/Model/PosTerminalManagement/FindTerminalResponse.cs b/Adyen/src/Model/PosTerminalManagement/FindTerminalResponse.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/FindTerminalResponse.cs rename to Adyen/src/Model/PosTerminalManagement/FindTerminalResponse.cs diff --git a/Adyen/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs b/Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs rename to Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs diff --git a/Adyen/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs b/Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs rename to Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs diff --git a/Adyen/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs b/Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs rename to Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs diff --git a/Adyen/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs b/Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs rename to Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs diff --git a/Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs b/Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs rename to Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs diff --git a/Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs b/Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs rename to Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs diff --git a/Adyen/Model/PosTerminalManagement/MerchantAccount.cs b/Adyen/src/Model/PosTerminalManagement/MerchantAccount.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/MerchantAccount.cs rename to Adyen/src/Model/PosTerminalManagement/MerchantAccount.cs diff --git a/Adyen/Model/PosTerminalManagement/ServiceError.cs b/Adyen/src/Model/PosTerminalManagement/ServiceError.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/ServiceError.cs rename to Adyen/src/Model/PosTerminalManagement/ServiceError.cs diff --git a/Adyen/Model/PosTerminalManagement/Store.cs b/Adyen/src/Model/PosTerminalManagement/Store.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/Store.cs rename to Adyen/src/Model/PosTerminalManagement/Store.cs diff --git a/Adyen/Model/Recurring/AbstractOpenAPISchema.cs b/Adyen/src/Model/Recurring/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Recurring/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Recurring/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Recurring/Address.cs b/Adyen/src/Model/Recurring/Address.cs similarity index 100% rename from Adyen/Model/Recurring/Address.cs rename to Adyen/src/Model/Recurring/Address.cs diff --git a/Adyen/Model/Recurring/Amount.cs b/Adyen/src/Model/Recurring/Amount.cs similarity index 100% rename from Adyen/Model/Recurring/Amount.cs rename to Adyen/src/Model/Recurring/Amount.cs diff --git a/Adyen/Model/Recurring/BankAccount.cs b/Adyen/src/Model/Recurring/BankAccount.cs similarity index 100% rename from Adyen/Model/Recurring/BankAccount.cs rename to Adyen/src/Model/Recurring/BankAccount.cs diff --git a/Adyen/Model/Recurring/Card.cs b/Adyen/src/Model/Recurring/Card.cs similarity index 100% rename from Adyen/Model/Recurring/Card.cs rename to Adyen/src/Model/Recurring/Card.cs diff --git a/Adyen/Model/Recurring/CreatePermitRequest.cs b/Adyen/src/Model/Recurring/CreatePermitRequest.cs similarity index 100% rename from Adyen/Model/Recurring/CreatePermitRequest.cs rename to Adyen/src/Model/Recurring/CreatePermitRequest.cs diff --git a/Adyen/Model/Recurring/CreatePermitResult.cs b/Adyen/src/Model/Recurring/CreatePermitResult.cs similarity index 100% rename from Adyen/Model/Recurring/CreatePermitResult.cs rename to Adyen/src/Model/Recurring/CreatePermitResult.cs diff --git a/Adyen/Model/Recurring/DisablePermitRequest.cs b/Adyen/src/Model/Recurring/DisablePermitRequest.cs similarity index 100% rename from Adyen/Model/Recurring/DisablePermitRequest.cs rename to Adyen/src/Model/Recurring/DisablePermitRequest.cs diff --git a/Adyen/Model/Recurring/DisablePermitResult.cs b/Adyen/src/Model/Recurring/DisablePermitResult.cs similarity index 100% rename from Adyen/Model/Recurring/DisablePermitResult.cs rename to Adyen/src/Model/Recurring/DisablePermitResult.cs diff --git a/Adyen/Model/Recurring/DisableRequest.cs b/Adyen/src/Model/Recurring/DisableRequest.cs similarity index 100% rename from Adyen/Model/Recurring/DisableRequest.cs rename to Adyen/src/Model/Recurring/DisableRequest.cs diff --git a/Adyen/Model/Recurring/DisableResult.cs b/Adyen/src/Model/Recurring/DisableResult.cs similarity index 100% rename from Adyen/Model/Recurring/DisableResult.cs rename to Adyen/src/Model/Recurring/DisableResult.cs diff --git a/Adyen/Model/Recurring/Name.cs b/Adyen/src/Model/Recurring/Name.cs similarity index 100% rename from Adyen/Model/Recurring/Name.cs rename to Adyen/src/Model/Recurring/Name.cs diff --git a/Adyen/Model/Recurring/NotifyShopperRequest.cs b/Adyen/src/Model/Recurring/NotifyShopperRequest.cs similarity index 100% rename from Adyen/Model/Recurring/NotifyShopperRequest.cs rename to Adyen/src/Model/Recurring/NotifyShopperRequest.cs diff --git a/Adyen/Model/Recurring/NotifyShopperResult.cs b/Adyen/src/Model/Recurring/NotifyShopperResult.cs similarity index 100% rename from Adyen/Model/Recurring/NotifyShopperResult.cs rename to Adyen/src/Model/Recurring/NotifyShopperResult.cs diff --git a/Adyen/Model/Recurring/Permit.cs b/Adyen/src/Model/Recurring/Permit.cs similarity index 100% rename from Adyen/Model/Recurring/Permit.cs rename to Adyen/src/Model/Recurring/Permit.cs diff --git a/Adyen/Model/Recurring/PermitRestriction.cs b/Adyen/src/Model/Recurring/PermitRestriction.cs similarity index 100% rename from Adyen/Model/Recurring/PermitRestriction.cs rename to Adyen/src/Model/Recurring/PermitRestriction.cs diff --git a/Adyen/Model/Recurring/PermitResult.cs b/Adyen/src/Model/Recurring/PermitResult.cs similarity index 100% rename from Adyen/Model/Recurring/PermitResult.cs rename to Adyen/src/Model/Recurring/PermitResult.cs diff --git a/Adyen/Model/Recurring/Recurring.cs b/Adyen/src/Model/Recurring/Recurring.cs similarity index 100% rename from Adyen/Model/Recurring/Recurring.cs rename to Adyen/src/Model/Recurring/Recurring.cs diff --git a/Adyen/Model/Recurring/RecurringDetail.cs b/Adyen/src/Model/Recurring/RecurringDetail.cs similarity index 100% rename from Adyen/Model/Recurring/RecurringDetail.cs rename to Adyen/src/Model/Recurring/RecurringDetail.cs diff --git a/Adyen/Model/Recurring/RecurringDetailWrapper.cs b/Adyen/src/Model/Recurring/RecurringDetailWrapper.cs similarity index 100% rename from Adyen/Model/Recurring/RecurringDetailWrapper.cs rename to Adyen/src/Model/Recurring/RecurringDetailWrapper.cs diff --git a/Adyen/Model/Recurring/RecurringDetailsRequest.cs b/Adyen/src/Model/Recurring/RecurringDetailsRequest.cs similarity index 100% rename from Adyen/Model/Recurring/RecurringDetailsRequest.cs rename to Adyen/src/Model/Recurring/RecurringDetailsRequest.cs diff --git a/Adyen/Model/Recurring/RecurringDetailsResult.cs b/Adyen/src/Model/Recurring/RecurringDetailsResult.cs similarity index 100% rename from Adyen/Model/Recurring/RecurringDetailsResult.cs rename to Adyen/src/Model/Recurring/RecurringDetailsResult.cs diff --git a/Adyen/Model/Recurring/ScheduleAccountUpdaterRequest.cs b/Adyen/src/Model/Recurring/ScheduleAccountUpdaterRequest.cs similarity index 100% rename from Adyen/Model/Recurring/ScheduleAccountUpdaterRequest.cs rename to Adyen/src/Model/Recurring/ScheduleAccountUpdaterRequest.cs diff --git a/Adyen/Model/Recurring/ScheduleAccountUpdaterResult.cs b/Adyen/src/Model/Recurring/ScheduleAccountUpdaterResult.cs similarity index 100% rename from Adyen/Model/Recurring/ScheduleAccountUpdaterResult.cs rename to Adyen/src/Model/Recurring/ScheduleAccountUpdaterResult.cs diff --git a/Adyen/Model/Recurring/ServiceError.cs b/Adyen/src/Model/Recurring/ServiceError.cs similarity index 100% rename from Adyen/Model/Recurring/ServiceError.cs rename to Adyen/src/Model/Recurring/ServiceError.cs diff --git a/Adyen/Model/Recurring/TokenDetails.cs b/Adyen/src/Model/Recurring/TokenDetails.cs similarity index 100% rename from Adyen/Model/Recurring/TokenDetails.cs rename to Adyen/src/Model/Recurring/TokenDetails.cs diff --git a/Adyen/Model/ReportWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/ReportWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/ReportWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/ReportWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/src/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/src/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/Model/ReportWebhooks/ReportNotificationData.cs b/Adyen/src/Model/ReportWebhooks/ReportNotificationData.cs similarity index 100% rename from Adyen/Model/ReportWebhooks/ReportNotificationData.cs rename to Adyen/src/Model/ReportWebhooks/ReportNotificationData.cs diff --git a/Adyen/Model/ReportWebhooks/ReportNotificationRequest.cs b/Adyen/src/Model/ReportWebhooks/ReportNotificationRequest.cs similarity index 100% rename from Adyen/Model/ReportWebhooks/ReportNotificationRequest.cs rename to Adyen/src/Model/ReportWebhooks/ReportNotificationRequest.cs diff --git a/Adyen/Model/ReportWebhooks/Resource.cs b/Adyen/src/Model/ReportWebhooks/Resource.cs similarity index 100% rename from Adyen/Model/ReportWebhooks/Resource.cs rename to Adyen/src/Model/ReportWebhooks/Resource.cs diff --git a/Adyen/Model/ReportWebhooks/ResourceReference.cs b/Adyen/src/Model/ReportWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/Model/ReportWebhooks/ResourceReference.cs rename to Adyen/src/Model/ReportWebhooks/ResourceReference.cs diff --git a/Adyen/Model/RequestOptions.cs b/Adyen/src/Model/RequestOptions.cs similarity index 100% rename from Adyen/Model/RequestOptions.cs rename to Adyen/src/Model/RequestOptions.cs diff --git a/Adyen/Model/StoredValue/AbstractOpenAPISchema.cs b/Adyen/src/Model/StoredValue/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/StoredValue/AbstractOpenAPISchema.cs rename to Adyen/src/Model/StoredValue/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/StoredValue/Amount.cs b/Adyen/src/Model/StoredValue/Amount.cs similarity index 100% rename from Adyen/Model/StoredValue/Amount.cs rename to Adyen/src/Model/StoredValue/Amount.cs diff --git a/Adyen/Model/StoredValue/ServiceError.cs b/Adyen/src/Model/StoredValue/ServiceError.cs similarity index 100% rename from Adyen/Model/StoredValue/ServiceError.cs rename to Adyen/src/Model/StoredValue/ServiceError.cs diff --git a/Adyen/Model/StoredValue/StoredValueBalanceCheckRequest.cs b/Adyen/src/Model/StoredValue/StoredValueBalanceCheckRequest.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueBalanceCheckRequest.cs rename to Adyen/src/Model/StoredValue/StoredValueBalanceCheckRequest.cs diff --git a/Adyen/Model/StoredValue/StoredValueBalanceCheckResponse.cs b/Adyen/src/Model/StoredValue/StoredValueBalanceCheckResponse.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueBalanceCheckResponse.cs rename to Adyen/src/Model/StoredValue/StoredValueBalanceCheckResponse.cs diff --git a/Adyen/Model/StoredValue/StoredValueBalanceMergeRequest.cs b/Adyen/src/Model/StoredValue/StoredValueBalanceMergeRequest.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueBalanceMergeRequest.cs rename to Adyen/src/Model/StoredValue/StoredValueBalanceMergeRequest.cs diff --git a/Adyen/Model/StoredValue/StoredValueBalanceMergeResponse.cs b/Adyen/src/Model/StoredValue/StoredValueBalanceMergeResponse.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueBalanceMergeResponse.cs rename to Adyen/src/Model/StoredValue/StoredValueBalanceMergeResponse.cs diff --git a/Adyen/Model/StoredValue/StoredValueIssueRequest.cs b/Adyen/src/Model/StoredValue/StoredValueIssueRequest.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueIssueRequest.cs rename to Adyen/src/Model/StoredValue/StoredValueIssueRequest.cs diff --git a/Adyen/Model/StoredValue/StoredValueIssueResponse.cs b/Adyen/src/Model/StoredValue/StoredValueIssueResponse.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueIssueResponse.cs rename to Adyen/src/Model/StoredValue/StoredValueIssueResponse.cs diff --git a/Adyen/Model/StoredValue/StoredValueLoadRequest.cs b/Adyen/src/Model/StoredValue/StoredValueLoadRequest.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueLoadRequest.cs rename to Adyen/src/Model/StoredValue/StoredValueLoadRequest.cs diff --git a/Adyen/Model/StoredValue/StoredValueLoadResponse.cs b/Adyen/src/Model/StoredValue/StoredValueLoadResponse.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueLoadResponse.cs rename to Adyen/src/Model/StoredValue/StoredValueLoadResponse.cs diff --git a/Adyen/Model/StoredValue/StoredValueStatusChangeRequest.cs b/Adyen/src/Model/StoredValue/StoredValueStatusChangeRequest.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueStatusChangeRequest.cs rename to Adyen/src/Model/StoredValue/StoredValueStatusChangeRequest.cs diff --git a/Adyen/Model/StoredValue/StoredValueStatusChangeResponse.cs b/Adyen/src/Model/StoredValue/StoredValueStatusChangeResponse.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueStatusChangeResponse.cs rename to Adyen/src/Model/StoredValue/StoredValueStatusChangeResponse.cs diff --git a/Adyen/Model/StoredValue/StoredValueVoidRequest.cs b/Adyen/src/Model/StoredValue/StoredValueVoidRequest.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueVoidRequest.cs rename to Adyen/src/Model/StoredValue/StoredValueVoidRequest.cs diff --git a/Adyen/Model/StoredValue/StoredValueVoidResponse.cs b/Adyen/src/Model/StoredValue/StoredValueVoidResponse.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueVoidResponse.cs rename to Adyen/src/Model/StoredValue/StoredValueVoidResponse.cs diff --git a/Adyen/Model/Terminal/SaleToAcquirerData.cs b/Adyen/src/Model/Terminal/SaleToAcquirerData.cs similarity index 100% rename from Adyen/Model/Terminal/SaleToAcquirerData.cs rename to Adyen/src/Model/Terminal/SaleToAcquirerData.cs diff --git a/Adyen/Model/Terminal/Split.cs b/Adyen/src/Model/Terminal/Split.cs similarity index 100% rename from Adyen/Model/Terminal/Split.cs rename to Adyen/src/Model/Terminal/Split.cs diff --git a/Adyen/Model/Terminal/SplitItem.cs b/Adyen/src/Model/Terminal/SplitItem.cs similarity index 100% rename from Adyen/Model/Terminal/SplitItem.cs rename to Adyen/src/Model/Terminal/SplitItem.cs diff --git a/Adyen/Model/Terminal/SplitItemType.cs b/Adyen/src/Model/Terminal/SplitItemType.cs similarity index 100% rename from Adyen/Model/Terminal/SplitItemType.cs rename to Adyen/src/Model/Terminal/SplitItemType.cs diff --git a/Adyen/Model/TerminalApi/AbortRequest.cs b/Adyen/src/Model/TerminalApi/AbortRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/AbortRequest.cs rename to Adyen/src/Model/TerminalApi/AbortRequest.cs diff --git a/Adyen/Model/TerminalApi/AccountType.cs b/Adyen/src/Model/TerminalApi/AccountType.cs similarity index 100% rename from Adyen/Model/TerminalApi/AccountType.cs rename to Adyen/src/Model/TerminalApi/AccountType.cs diff --git a/Adyen/Model/TerminalApi/AdminRequest.cs b/Adyen/src/Model/TerminalApi/AdminRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/AdminRequest.cs rename to Adyen/src/Model/TerminalApi/AdminRequest.cs diff --git a/Adyen/Model/TerminalApi/AdminResponse.cs b/Adyen/src/Model/TerminalApi/AdminResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/AdminResponse.cs rename to Adyen/src/Model/TerminalApi/AdminResponse.cs diff --git a/Adyen/Model/TerminalApi/AlgorithmIdentifier.cs b/Adyen/src/Model/TerminalApi/AlgorithmIdentifier.cs similarity index 100% rename from Adyen/Model/TerminalApi/AlgorithmIdentifier.cs rename to Adyen/src/Model/TerminalApi/AlgorithmIdentifier.cs diff --git a/Adyen/Model/TerminalApi/AlgorithmType.cs b/Adyen/src/Model/TerminalApi/AlgorithmType.cs similarity index 100% rename from Adyen/Model/TerminalApi/AlgorithmType.cs rename to Adyen/src/Model/TerminalApi/AlgorithmType.cs diff --git a/Adyen/Model/TerminalApi/AlignmentType.cs b/Adyen/src/Model/TerminalApi/AlignmentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/AlignmentType.cs rename to Adyen/src/Model/TerminalApi/AlignmentType.cs diff --git a/Adyen/Model/TerminalApi/AllowedProduct.cs b/Adyen/src/Model/TerminalApi/AllowedProduct.cs similarity index 100% rename from Adyen/Model/TerminalApi/AllowedProduct.cs rename to Adyen/src/Model/TerminalApi/AllowedProduct.cs diff --git a/Adyen/Model/TerminalApi/Amount.cs b/Adyen/src/Model/TerminalApi/Amount.cs similarity index 100% rename from Adyen/Model/TerminalApi/Amount.cs rename to Adyen/src/Model/TerminalApi/Amount.cs diff --git a/Adyen/Model/TerminalApi/AmountsReq.cs b/Adyen/src/Model/TerminalApi/AmountsReq.cs similarity index 100% rename from Adyen/Model/TerminalApi/AmountsReq.cs rename to Adyen/src/Model/TerminalApi/AmountsReq.cs diff --git a/Adyen/Model/TerminalApi/AmountsResp.cs b/Adyen/src/Model/TerminalApi/AmountsResp.cs similarity index 100% rename from Adyen/Model/TerminalApi/AmountsResp.cs rename to Adyen/src/Model/TerminalApi/AmountsResp.cs diff --git a/Adyen/Model/TerminalApi/AreaSize.cs b/Adyen/src/Model/TerminalApi/AreaSize.cs similarity index 100% rename from Adyen/Model/TerminalApi/AreaSize.cs rename to Adyen/src/Model/TerminalApi/AreaSize.cs diff --git a/Adyen/Model/TerminalApi/AuthenticatedData.cs b/Adyen/src/Model/TerminalApi/AuthenticatedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/AuthenticatedData.cs rename to Adyen/src/Model/TerminalApi/AuthenticatedData.cs diff --git a/Adyen/Model/TerminalApi/AuthenticationMethodType.cs b/Adyen/src/Model/TerminalApi/AuthenticationMethodType.cs similarity index 100% rename from Adyen/Model/TerminalApi/AuthenticationMethodType.cs rename to Adyen/src/Model/TerminalApi/AuthenticationMethodType.cs diff --git a/Adyen/Model/TerminalApi/BalanceInquiryRequest.cs b/Adyen/src/Model/TerminalApi/BalanceInquiryRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/BalanceInquiryRequest.cs rename to Adyen/src/Model/TerminalApi/BalanceInquiryRequest.cs diff --git a/Adyen/Model/TerminalApi/BalanceInquiryResponse.cs b/Adyen/src/Model/TerminalApi/BalanceInquiryResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/BalanceInquiryResponse.cs rename to Adyen/src/Model/TerminalApi/BalanceInquiryResponse.cs diff --git a/Adyen/Model/TerminalApi/BarcodeType.cs b/Adyen/src/Model/TerminalApi/BarcodeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/BarcodeType.cs rename to Adyen/src/Model/TerminalApi/BarcodeType.cs diff --git a/Adyen/Model/TerminalApi/BatchRequest.cs b/Adyen/src/Model/TerminalApi/BatchRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/BatchRequest.cs rename to Adyen/src/Model/TerminalApi/BatchRequest.cs diff --git a/Adyen/Model/TerminalApi/BatchResponse.cs b/Adyen/src/Model/TerminalApi/BatchResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/BatchResponse.cs rename to Adyen/src/Model/TerminalApi/BatchResponse.cs diff --git a/Adyen/Model/TerminalApi/CapturedSignature.cs b/Adyen/src/Model/TerminalApi/CapturedSignature.cs similarity index 100% rename from Adyen/Model/TerminalApi/CapturedSignature.cs rename to Adyen/src/Model/TerminalApi/CapturedSignature.cs diff --git a/Adyen/Model/TerminalApi/CardAcquisitionRequest.cs b/Adyen/src/Model/TerminalApi/CardAcquisitionRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardAcquisitionRequest.cs rename to Adyen/src/Model/TerminalApi/CardAcquisitionRequest.cs diff --git a/Adyen/Model/TerminalApi/CardAcquisitionResponse.cs b/Adyen/src/Model/TerminalApi/CardAcquisitionResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardAcquisitionResponse.cs rename to Adyen/src/Model/TerminalApi/CardAcquisitionResponse.cs diff --git a/Adyen/Model/TerminalApi/CardAcquisitionTransaction.cs b/Adyen/src/Model/TerminalApi/CardAcquisitionTransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardAcquisitionTransaction.cs rename to Adyen/src/Model/TerminalApi/CardAcquisitionTransaction.cs diff --git a/Adyen/Model/TerminalApi/CardData.cs b/Adyen/src/Model/TerminalApi/CardData.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardData.cs rename to Adyen/src/Model/TerminalApi/CardData.cs diff --git a/Adyen/Model/TerminalApi/CardReaderAPDURequest.cs b/Adyen/src/Model/TerminalApi/CardReaderAPDURequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderAPDURequest.cs rename to Adyen/src/Model/TerminalApi/CardReaderAPDURequest.cs diff --git a/Adyen/Model/TerminalApi/CardReaderAPDUResponse.cs b/Adyen/src/Model/TerminalApi/CardReaderAPDUResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderAPDUResponse.cs rename to Adyen/src/Model/TerminalApi/CardReaderAPDUResponse.cs diff --git a/Adyen/Model/TerminalApi/CardReaderInitRequest.cs b/Adyen/src/Model/TerminalApi/CardReaderInitRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderInitRequest.cs rename to Adyen/src/Model/TerminalApi/CardReaderInitRequest.cs diff --git a/Adyen/Model/TerminalApi/CardReaderInitResponse.cs b/Adyen/src/Model/TerminalApi/CardReaderInitResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderInitResponse.cs rename to Adyen/src/Model/TerminalApi/CardReaderInitResponse.cs diff --git a/Adyen/Model/TerminalApi/CardReaderPowerOffRequest.cs b/Adyen/src/Model/TerminalApi/CardReaderPowerOffRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderPowerOffRequest.cs rename to Adyen/src/Model/TerminalApi/CardReaderPowerOffRequest.cs diff --git a/Adyen/Model/TerminalApi/CardReaderPowerOffResponse.cs b/Adyen/src/Model/TerminalApi/CardReaderPowerOffResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderPowerOffResponse.cs rename to Adyen/src/Model/TerminalApi/CardReaderPowerOffResponse.cs diff --git a/Adyen/Model/TerminalApi/CardholderPIN.cs b/Adyen/src/Model/TerminalApi/CardholderPIN.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardholderPIN.cs rename to Adyen/src/Model/TerminalApi/CardholderPIN.cs diff --git a/Adyen/Model/TerminalApi/CashHandlingDevice.cs b/Adyen/src/Model/TerminalApi/CashHandlingDevice.cs similarity index 100% rename from Adyen/Model/TerminalApi/CashHandlingDevice.cs rename to Adyen/src/Model/TerminalApi/CashHandlingDevice.cs diff --git a/Adyen/Model/TerminalApi/CharacterHeightType.cs b/Adyen/src/Model/TerminalApi/CharacterHeightType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CharacterHeightType.cs rename to Adyen/src/Model/TerminalApi/CharacterHeightType.cs diff --git a/Adyen/Model/TerminalApi/CharacterStyleType.cs b/Adyen/src/Model/TerminalApi/CharacterStyleType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CharacterStyleType.cs rename to Adyen/src/Model/TerminalApi/CharacterStyleType.cs diff --git a/Adyen/Model/TerminalApi/CharacterWidthType.cs b/Adyen/src/Model/TerminalApi/CharacterWidthType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CharacterWidthType.cs rename to Adyen/src/Model/TerminalApi/CharacterWidthType.cs diff --git a/Adyen/Model/TerminalApi/CheckData.cs b/Adyen/src/Model/TerminalApi/CheckData.cs similarity index 100% rename from Adyen/Model/TerminalApi/CheckData.cs rename to Adyen/src/Model/TerminalApi/CheckData.cs diff --git a/Adyen/Model/TerminalApi/CheckTypeCodeType.cs b/Adyen/src/Model/TerminalApi/CheckTypeCodeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CheckTypeCodeType.cs rename to Adyen/src/Model/TerminalApi/CheckTypeCodeType.cs diff --git a/Adyen/Model/TerminalApi/CoinsOrBills.cs b/Adyen/src/Model/TerminalApi/CoinsOrBills.cs similarity index 100% rename from Adyen/Model/TerminalApi/CoinsOrBills.cs rename to Adyen/src/Model/TerminalApi/CoinsOrBills.cs diff --git a/Adyen/Model/TerminalApi/ColorType.cs b/Adyen/src/Model/TerminalApi/ColorType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ColorType.cs rename to Adyen/src/Model/TerminalApi/ColorType.cs diff --git a/Adyen/Model/TerminalApi/ContentInformation.cs b/Adyen/src/Model/TerminalApi/ContentInformation.cs similarity index 100% rename from Adyen/Model/TerminalApi/ContentInformation.cs rename to Adyen/src/Model/TerminalApi/ContentInformation.cs diff --git a/Adyen/Model/TerminalApi/ContentType.cs b/Adyen/src/Model/TerminalApi/ContentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ContentType.cs rename to Adyen/src/Model/TerminalApi/ContentType.cs diff --git a/Adyen/Model/TerminalApi/CurrencyConversion.cs b/Adyen/src/Model/TerminalApi/CurrencyConversion.cs similarity index 100% rename from Adyen/Model/TerminalApi/CurrencyConversion.cs rename to Adyen/src/Model/TerminalApi/CurrencyConversion.cs diff --git a/Adyen/Model/TerminalApi/CustomerOrder.cs b/Adyen/src/Model/TerminalApi/CustomerOrder.cs similarity index 100% rename from Adyen/Model/TerminalApi/CustomerOrder.cs rename to Adyen/src/Model/TerminalApi/CustomerOrder.cs diff --git a/Adyen/Model/TerminalApi/CustomerOrderReqType.cs b/Adyen/src/Model/TerminalApi/CustomerOrderReqType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CustomerOrderReqType.cs rename to Adyen/src/Model/TerminalApi/CustomerOrderReqType.cs diff --git a/Adyen/Model/TerminalApi/DeviceType.cs b/Adyen/src/Model/TerminalApi/DeviceType.cs similarity index 100% rename from Adyen/Model/TerminalApi/DeviceType.cs rename to Adyen/src/Model/TerminalApi/DeviceType.cs diff --git a/Adyen/Model/TerminalApi/DiagnosisRequest.cs b/Adyen/src/Model/TerminalApi/DiagnosisRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/DiagnosisRequest.cs rename to Adyen/src/Model/TerminalApi/DiagnosisRequest.cs diff --git a/Adyen/Model/TerminalApi/DiagnosisResponse.cs b/Adyen/src/Model/TerminalApi/DiagnosisResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/DiagnosisResponse.cs rename to Adyen/src/Model/TerminalApi/DiagnosisResponse.cs diff --git a/Adyen/Model/TerminalApi/DigestedData.cs b/Adyen/src/Model/TerminalApi/DigestedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/DigestedData.cs rename to Adyen/src/Model/TerminalApi/DigestedData.cs diff --git a/Adyen/Model/TerminalApi/DisplayOutput.cs b/Adyen/src/Model/TerminalApi/DisplayOutput.cs similarity index 100% rename from Adyen/Model/TerminalApi/DisplayOutput.cs rename to Adyen/src/Model/TerminalApi/DisplayOutput.cs diff --git a/Adyen/Model/TerminalApi/DisplayRequest.cs b/Adyen/src/Model/TerminalApi/DisplayRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/DisplayRequest.cs rename to Adyen/src/Model/TerminalApi/DisplayRequest.cs diff --git a/Adyen/Model/TerminalApi/DisplayResponse.cs b/Adyen/src/Model/TerminalApi/DisplayResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/DisplayResponse.cs rename to Adyen/src/Model/TerminalApi/DisplayResponse.cs diff --git a/Adyen/Model/TerminalApi/DocumentQualifierType.cs b/Adyen/src/Model/TerminalApi/DocumentQualifierType.cs similarity index 100% rename from Adyen/Model/TerminalApi/DocumentQualifierType.cs rename to Adyen/src/Model/TerminalApi/DocumentQualifierType.cs diff --git a/Adyen/Model/TerminalApi/EnableServiceRequest.cs b/Adyen/src/Model/TerminalApi/EnableServiceRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/EnableServiceRequest.cs rename to Adyen/src/Model/TerminalApi/EnableServiceRequest.cs diff --git a/Adyen/Model/TerminalApi/EnableServiceResponse.cs b/Adyen/src/Model/TerminalApi/EnableServiceResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/EnableServiceResponse.cs rename to Adyen/src/Model/TerminalApi/EnableServiceResponse.cs diff --git a/Adyen/Model/TerminalApi/EncapsulatedContent.cs b/Adyen/src/Model/TerminalApi/EncapsulatedContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/EncapsulatedContent.cs rename to Adyen/src/Model/TerminalApi/EncapsulatedContent.cs diff --git a/Adyen/Model/TerminalApi/EncryptedContent.cs b/Adyen/src/Model/TerminalApi/EncryptedContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/EncryptedContent.cs rename to Adyen/src/Model/TerminalApi/EncryptedContent.cs diff --git a/Adyen/Model/TerminalApi/EntryModeType.cs b/Adyen/src/Model/TerminalApi/EntryModeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/EntryModeType.cs rename to Adyen/src/Model/TerminalApi/EntryModeType.cs diff --git a/Adyen/Model/TerminalApi/EnvelopedData.cs b/Adyen/src/Model/TerminalApi/EnvelopedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/EnvelopedData.cs rename to Adyen/src/Model/TerminalApi/EnvelopedData.cs diff --git a/Adyen/Model/TerminalApi/ErrorConditionType.cs b/Adyen/src/Model/TerminalApi/ErrorConditionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ErrorConditionType.cs rename to Adyen/src/Model/TerminalApi/ErrorConditionType.cs diff --git a/Adyen/Model/TerminalApi/EventNotification.cs b/Adyen/src/Model/TerminalApi/EventNotification.cs similarity index 100% rename from Adyen/Model/TerminalApi/EventNotification.cs rename to Adyen/src/Model/TerminalApi/EventNotification.cs diff --git a/Adyen/Model/TerminalApi/EventToNotifyType.cs b/Adyen/src/Model/TerminalApi/EventToNotifyType.cs similarity index 100% rename from Adyen/Model/TerminalApi/EventToNotifyType.cs rename to Adyen/src/Model/TerminalApi/EventToNotifyType.cs diff --git a/Adyen/Model/TerminalApi/ForceTypeModeType.cs b/Adyen/src/Model/TerminalApi/ForceTypeModeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ForceTypeModeType.cs rename to Adyen/src/Model/TerminalApi/ForceTypeModeType.cs diff --git a/Adyen/Model/TerminalApi/GenericProfileType.cs b/Adyen/src/Model/TerminalApi/GenericProfileType.cs similarity index 100% rename from Adyen/Model/TerminalApi/GenericProfileType.cs rename to Adyen/src/Model/TerminalApi/GenericProfileType.cs diff --git a/Adyen/Model/TerminalApi/GeographicCoordinates.cs b/Adyen/src/Model/TerminalApi/GeographicCoordinates.cs similarity index 100% rename from Adyen/Model/TerminalApi/GeographicCoordinates.cs rename to Adyen/src/Model/TerminalApi/GeographicCoordinates.cs diff --git a/Adyen/Model/TerminalApi/Geolocation.cs b/Adyen/src/Model/TerminalApi/Geolocation.cs similarity index 100% rename from Adyen/Model/TerminalApi/Geolocation.cs rename to Adyen/src/Model/TerminalApi/Geolocation.cs diff --git a/Adyen/Model/TerminalApi/GetTotalsRequest.cs b/Adyen/src/Model/TerminalApi/GetTotalsRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/GetTotalsRequest.cs rename to Adyen/src/Model/TerminalApi/GetTotalsRequest.cs diff --git a/Adyen/Model/TerminalApi/GetTotalsResponse.cs b/Adyen/src/Model/TerminalApi/GetTotalsResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/GetTotalsResponse.cs rename to Adyen/src/Model/TerminalApi/GetTotalsResponse.cs diff --git a/Adyen/Model/TerminalApi/GlobalStatusType.cs b/Adyen/src/Model/TerminalApi/GlobalStatusType.cs similarity index 100% rename from Adyen/Model/TerminalApi/GlobalStatusType.cs rename to Adyen/src/Model/TerminalApi/GlobalStatusType.cs diff --git a/Adyen/Model/TerminalApi/HostStatus.cs b/Adyen/src/Model/TerminalApi/HostStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/HostStatus.cs rename to Adyen/src/Model/TerminalApi/HostStatus.cs diff --git a/Adyen/Model/TerminalApi/ICCResetData.cs b/Adyen/src/Model/TerminalApi/ICCResetData.cs similarity index 100% rename from Adyen/Model/TerminalApi/ICCResetData.cs rename to Adyen/src/Model/TerminalApi/ICCResetData.cs diff --git a/Adyen/Model/TerminalApi/IdentificationSupportType.cs b/Adyen/src/Model/TerminalApi/IdentificationSupportType.cs similarity index 100% rename from Adyen/Model/TerminalApi/IdentificationSupportType.cs rename to Adyen/src/Model/TerminalApi/IdentificationSupportType.cs diff --git a/Adyen/Model/TerminalApi/IdentificationType.cs b/Adyen/src/Model/TerminalApi/IdentificationType.cs similarity index 100% rename from Adyen/Model/TerminalApi/IdentificationType.cs rename to Adyen/src/Model/TerminalApi/IdentificationType.cs diff --git a/Adyen/Model/TerminalApi/InfoQualifyType.cs b/Adyen/src/Model/TerminalApi/InfoQualifyType.cs similarity index 100% rename from Adyen/Model/TerminalApi/InfoQualifyType.cs rename to Adyen/src/Model/TerminalApi/InfoQualifyType.cs diff --git a/Adyen/Model/TerminalApi/Input.cs b/Adyen/src/Model/TerminalApi/Input.cs similarity index 100% rename from Adyen/Model/TerminalApi/Input.cs rename to Adyen/src/Model/TerminalApi/Input.cs diff --git a/Adyen/Model/TerminalApi/InputCommandType.cs b/Adyen/src/Model/TerminalApi/InputCommandType.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputCommandType.cs rename to Adyen/src/Model/TerminalApi/InputCommandType.cs diff --git a/Adyen/Model/TerminalApi/InputData.cs b/Adyen/src/Model/TerminalApi/InputData.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputData.cs rename to Adyen/src/Model/TerminalApi/InputData.cs diff --git a/Adyen/Model/TerminalApi/InputRequest.cs b/Adyen/src/Model/TerminalApi/InputRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputRequest.cs rename to Adyen/src/Model/TerminalApi/InputRequest.cs diff --git a/Adyen/Model/TerminalApi/InputResponse.cs b/Adyen/src/Model/TerminalApi/InputResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputResponse.cs rename to Adyen/src/Model/TerminalApi/InputResponse.cs diff --git a/Adyen/Model/TerminalApi/InputResult.cs b/Adyen/src/Model/TerminalApi/InputResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputResult.cs rename to Adyen/src/Model/TerminalApi/InputResult.cs diff --git a/Adyen/Model/TerminalApi/InputUpdate.cs b/Adyen/src/Model/TerminalApi/InputUpdate.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputUpdate.cs rename to Adyen/src/Model/TerminalApi/InputUpdate.cs diff --git a/Adyen/Model/TerminalApi/Instalment.cs b/Adyen/src/Model/TerminalApi/Instalment.cs similarity index 100% rename from Adyen/Model/TerminalApi/Instalment.cs rename to Adyen/src/Model/TerminalApi/Instalment.cs diff --git a/Adyen/Model/TerminalApi/IssuerAndSerialNumber.cs b/Adyen/src/Model/TerminalApi/IssuerAndSerialNumber.cs similarity index 100% rename from Adyen/Model/TerminalApi/IssuerAndSerialNumber.cs rename to Adyen/src/Model/TerminalApi/IssuerAndSerialNumber.cs diff --git a/Adyen/Model/TerminalApi/KEK.cs b/Adyen/src/Model/TerminalApi/KEK.cs similarity index 100% rename from Adyen/Model/TerminalApi/KEK.cs rename to Adyen/src/Model/TerminalApi/KEK.cs diff --git a/Adyen/Model/TerminalApi/KEKIdentifier.cs b/Adyen/src/Model/TerminalApi/KEKIdentifier.cs similarity index 100% rename from Adyen/Model/TerminalApi/KEKIdentifier.cs rename to Adyen/src/Model/TerminalApi/KEKIdentifier.cs diff --git a/Adyen/Model/TerminalApi/KeyTransport.cs b/Adyen/src/Model/TerminalApi/KeyTransport.cs similarity index 100% rename from Adyen/Model/TerminalApi/KeyTransport.cs rename to Adyen/src/Model/TerminalApi/KeyTransport.cs diff --git a/Adyen/Model/TerminalApi/LoginRequest.cs b/Adyen/src/Model/TerminalApi/LoginRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoginRequest.cs rename to Adyen/src/Model/TerminalApi/LoginRequest.cs diff --git a/Adyen/Model/TerminalApi/LoginResponse.cs b/Adyen/src/Model/TerminalApi/LoginResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoginResponse.cs rename to Adyen/src/Model/TerminalApi/LoginResponse.cs diff --git a/Adyen/Model/TerminalApi/LogoutRequest.cs b/Adyen/src/Model/TerminalApi/LogoutRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/LogoutRequest.cs rename to Adyen/src/Model/TerminalApi/LogoutRequest.cs diff --git a/Adyen/Model/TerminalApi/LogoutResponse.cs b/Adyen/src/Model/TerminalApi/LogoutResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/LogoutResponse.cs rename to Adyen/src/Model/TerminalApi/LogoutResponse.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAccount.cs b/Adyen/src/Model/TerminalApi/LoyaltyAccount.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAccount.cs rename to Adyen/src/Model/TerminalApi/LoyaltyAccount.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAccountID.cs b/Adyen/src/Model/TerminalApi/LoyaltyAccountID.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAccountID.cs rename to Adyen/src/Model/TerminalApi/LoyaltyAccountID.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAccountReq.cs b/Adyen/src/Model/TerminalApi/LoyaltyAccountReq.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAccountReq.cs rename to Adyen/src/Model/TerminalApi/LoyaltyAccountReq.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAccountStatus.cs b/Adyen/src/Model/TerminalApi/LoyaltyAccountStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAccountStatus.cs rename to Adyen/src/Model/TerminalApi/LoyaltyAccountStatus.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAcquirerData.cs b/Adyen/src/Model/TerminalApi/LoyaltyAcquirerData.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAcquirerData.cs rename to Adyen/src/Model/TerminalApi/LoyaltyAcquirerData.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAmount.cs b/Adyen/src/Model/TerminalApi/LoyaltyAmount.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAmount.cs rename to Adyen/src/Model/TerminalApi/LoyaltyAmount.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyData.cs b/Adyen/src/Model/TerminalApi/LoyaltyData.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyData.cs rename to Adyen/src/Model/TerminalApi/LoyaltyData.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyHandlingType.cs b/Adyen/src/Model/TerminalApi/LoyaltyHandlingType.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyHandlingType.cs rename to Adyen/src/Model/TerminalApi/LoyaltyHandlingType.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyRequest.cs b/Adyen/src/Model/TerminalApi/LoyaltyRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyRequest.cs rename to Adyen/src/Model/TerminalApi/LoyaltyRequest.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyResponse.cs b/Adyen/src/Model/TerminalApi/LoyaltyResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyResponse.cs rename to Adyen/src/Model/TerminalApi/LoyaltyResponse.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyResult.cs b/Adyen/src/Model/TerminalApi/LoyaltyResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyResult.cs rename to Adyen/src/Model/TerminalApi/LoyaltyResult.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyTotals.cs b/Adyen/src/Model/TerminalApi/LoyaltyTotals.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyTotals.cs rename to Adyen/src/Model/TerminalApi/LoyaltyTotals.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyTransaction.cs b/Adyen/src/Model/TerminalApi/LoyaltyTransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyTransaction.cs rename to Adyen/src/Model/TerminalApi/LoyaltyTransaction.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyTransactionType.cs b/Adyen/src/Model/TerminalApi/LoyaltyTransactionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyTransactionType.cs rename to Adyen/src/Model/TerminalApi/LoyaltyTransactionType.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyUnitType.cs b/Adyen/src/Model/TerminalApi/LoyaltyUnitType.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyUnitType.cs rename to Adyen/src/Model/TerminalApi/LoyaltyUnitType.cs diff --git a/Adyen/Model/TerminalApi/MenuEntry.cs b/Adyen/src/Model/TerminalApi/MenuEntry.cs similarity index 100% rename from Adyen/Model/TerminalApi/MenuEntry.cs rename to Adyen/src/Model/TerminalApi/MenuEntry.cs diff --git a/Adyen/Model/TerminalApi/MenuEntryTagType.cs b/Adyen/src/Model/TerminalApi/MenuEntryTagType.cs similarity index 100% rename from Adyen/Model/TerminalApi/MenuEntryTagType.cs rename to Adyen/src/Model/TerminalApi/MenuEntryTagType.cs diff --git a/Adyen/Model/TerminalApi/Message/SaleToPOIRequest.cs b/Adyen/src/Model/TerminalApi/Message/SaleToPOIRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/Message/SaleToPOIRequest.cs rename to Adyen/src/Model/TerminalApi/Message/SaleToPOIRequest.cs diff --git a/Adyen/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs b/Adyen/src/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs similarity index 100% rename from Adyen/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs rename to Adyen/src/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs diff --git a/Adyen/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs b/Adyen/src/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs similarity index 100% rename from Adyen/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs rename to Adyen/src/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs diff --git a/Adyen/Model/TerminalApi/MessageCategoryType.cs b/Adyen/src/Model/TerminalApi/MessageCategoryType.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageCategoryType.cs rename to Adyen/src/Model/TerminalApi/MessageCategoryType.cs diff --git a/Adyen/Model/TerminalApi/MessageClassType.cs b/Adyen/src/Model/TerminalApi/MessageClassType.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageClassType.cs rename to Adyen/src/Model/TerminalApi/MessageClassType.cs diff --git a/Adyen/Model/TerminalApi/MessageHeader.cs b/Adyen/src/Model/TerminalApi/MessageHeader.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageHeader.cs rename to Adyen/src/Model/TerminalApi/MessageHeader.cs diff --git a/Adyen/Model/TerminalApi/MessageReference.cs b/Adyen/src/Model/TerminalApi/MessageReference.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageReference.cs rename to Adyen/src/Model/TerminalApi/MessageReference.cs diff --git a/Adyen/Model/TerminalApi/MessageType.cs b/Adyen/src/Model/TerminalApi/MessageType.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageType.cs rename to Adyen/src/Model/TerminalApi/MessageType.cs diff --git a/Adyen/Model/TerminalApi/MobileData.cs b/Adyen/src/Model/TerminalApi/MobileData.cs similarity index 100% rename from Adyen/Model/TerminalApi/MobileData.cs rename to Adyen/src/Model/TerminalApi/MobileData.cs diff --git a/Adyen/Model/TerminalApi/NamedKeyEncryptedData.cs b/Adyen/src/Model/TerminalApi/NamedKeyEncryptedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/NamedKeyEncryptedData.cs rename to Adyen/src/Model/TerminalApi/NamedKeyEncryptedData.cs diff --git a/Adyen/Model/TerminalApi/OriginalPOITransaction.cs b/Adyen/src/Model/TerminalApi/OriginalPOITransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/OriginalPOITransaction.cs rename to Adyen/src/Model/TerminalApi/OriginalPOITransaction.cs diff --git a/Adyen/Model/TerminalApi/OutputBarcode.cs b/Adyen/src/Model/TerminalApi/OutputBarcode.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputBarcode.cs rename to Adyen/src/Model/TerminalApi/OutputBarcode.cs diff --git a/Adyen/Model/TerminalApi/OutputContent.cs b/Adyen/src/Model/TerminalApi/OutputContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputContent.cs rename to Adyen/src/Model/TerminalApi/OutputContent.cs diff --git a/Adyen/Model/TerminalApi/OutputFormatType.cs b/Adyen/src/Model/TerminalApi/OutputFormatType.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputFormatType.cs rename to Adyen/src/Model/TerminalApi/OutputFormatType.cs diff --git a/Adyen/Model/TerminalApi/OutputResult.cs b/Adyen/src/Model/TerminalApi/OutputResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputResult.cs rename to Adyen/src/Model/TerminalApi/OutputResult.cs diff --git a/Adyen/Model/TerminalApi/OutputText.cs b/Adyen/src/Model/TerminalApi/OutputText.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputText.cs rename to Adyen/src/Model/TerminalApi/OutputText.cs diff --git a/Adyen/Model/TerminalApi/PINFormatType.cs b/Adyen/src/Model/TerminalApi/PINFormatType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PINFormatType.cs rename to Adyen/src/Model/TerminalApi/PINFormatType.cs diff --git a/Adyen/Model/TerminalApi/PINRequest.cs b/Adyen/src/Model/TerminalApi/PINRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/PINRequest.cs rename to Adyen/src/Model/TerminalApi/PINRequest.cs diff --git a/Adyen/Model/TerminalApi/PINRequestType.cs b/Adyen/src/Model/TerminalApi/PINRequestType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PINRequestType.cs rename to Adyen/src/Model/TerminalApi/PINRequestType.cs diff --git a/Adyen/Model/TerminalApi/PINResponse.cs b/Adyen/src/Model/TerminalApi/PINResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/PINResponse.cs rename to Adyen/src/Model/TerminalApi/PINResponse.cs diff --git a/Adyen/Model/TerminalApi/POIData.cs b/Adyen/src/Model/TerminalApi/POIData.cs similarity index 100% rename from Adyen/Model/TerminalApi/POIData.cs rename to Adyen/src/Model/TerminalApi/POIData.cs diff --git a/Adyen/Model/TerminalApi/POIProfile.cs b/Adyen/src/Model/TerminalApi/POIProfile.cs similarity index 100% rename from Adyen/Model/TerminalApi/POIProfile.cs rename to Adyen/src/Model/TerminalApi/POIProfile.cs diff --git a/Adyen/Model/TerminalApi/POISoftware.cs b/Adyen/src/Model/TerminalApi/POISoftware.cs similarity index 100% rename from Adyen/Model/TerminalApi/POISoftware.cs rename to Adyen/src/Model/TerminalApi/POISoftware.cs diff --git a/Adyen/Model/TerminalApi/POIStatus.cs b/Adyen/src/Model/TerminalApi/POIStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/POIStatus.cs rename to Adyen/src/Model/TerminalApi/POIStatus.cs diff --git a/Adyen/Model/TerminalApi/POISystemData.cs b/Adyen/src/Model/TerminalApi/POISystemData.cs similarity index 100% rename from Adyen/Model/TerminalApi/POISystemData.cs rename to Adyen/src/Model/TerminalApi/POISystemData.cs diff --git a/Adyen/Model/TerminalApi/POITerminalData.cs b/Adyen/src/Model/TerminalApi/POITerminalData.cs similarity index 100% rename from Adyen/Model/TerminalApi/POITerminalData.cs rename to Adyen/src/Model/TerminalApi/POITerminalData.cs diff --git a/Adyen/Model/TerminalApi/Parameter.cs b/Adyen/src/Model/TerminalApi/Parameter.cs similarity index 100% rename from Adyen/Model/TerminalApi/Parameter.cs rename to Adyen/src/Model/TerminalApi/Parameter.cs diff --git a/Adyen/Model/TerminalApi/PaymentAccountReq.cs b/Adyen/src/Model/TerminalApi/PaymentAccountReq.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentAccountReq.cs rename to Adyen/src/Model/TerminalApi/PaymentAccountReq.cs diff --git a/Adyen/Model/TerminalApi/PaymentAccountStatus.cs b/Adyen/src/Model/TerminalApi/PaymentAccountStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentAccountStatus.cs rename to Adyen/src/Model/TerminalApi/PaymentAccountStatus.cs diff --git a/Adyen/Model/TerminalApi/PaymentAcquirerData.cs b/Adyen/src/Model/TerminalApi/PaymentAcquirerData.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentAcquirerData.cs rename to Adyen/src/Model/TerminalApi/PaymentAcquirerData.cs diff --git a/Adyen/Model/TerminalApi/PaymentData.cs b/Adyen/src/Model/TerminalApi/PaymentData.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentData.cs rename to Adyen/src/Model/TerminalApi/PaymentData.cs diff --git a/Adyen/Model/TerminalApi/PaymentInstrumentData.cs b/Adyen/src/Model/TerminalApi/PaymentInstrumentData.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentInstrumentData.cs rename to Adyen/src/Model/TerminalApi/PaymentInstrumentData.cs diff --git a/Adyen/Model/TerminalApi/PaymentInstrumentType.cs b/Adyen/src/Model/TerminalApi/PaymentInstrumentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentInstrumentType.cs rename to Adyen/src/Model/TerminalApi/PaymentInstrumentType.cs diff --git a/Adyen/Model/TerminalApi/PaymentReceipt.cs b/Adyen/src/Model/TerminalApi/PaymentReceipt.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentReceipt.cs rename to Adyen/src/Model/TerminalApi/PaymentReceipt.cs diff --git a/Adyen/Model/TerminalApi/PaymentRequest.cs b/Adyen/src/Model/TerminalApi/PaymentRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentRequest.cs rename to Adyen/src/Model/TerminalApi/PaymentRequest.cs diff --git a/Adyen/Model/TerminalApi/PaymentResponse.cs b/Adyen/src/Model/TerminalApi/PaymentResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentResponse.cs rename to Adyen/src/Model/TerminalApi/PaymentResponse.cs diff --git a/Adyen/Model/TerminalApi/PaymentResult.cs b/Adyen/src/Model/TerminalApi/PaymentResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentResult.cs rename to Adyen/src/Model/TerminalApi/PaymentResult.cs diff --git a/Adyen/Model/TerminalApi/PaymentToken.cs b/Adyen/src/Model/TerminalApi/PaymentToken.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentToken.cs rename to Adyen/src/Model/TerminalApi/PaymentToken.cs diff --git a/Adyen/Model/TerminalApi/PaymentTotals.cs b/Adyen/src/Model/TerminalApi/PaymentTotals.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentTotals.cs rename to Adyen/src/Model/TerminalApi/PaymentTotals.cs diff --git a/Adyen/Model/TerminalApi/PaymentTransaction.cs b/Adyen/src/Model/TerminalApi/PaymentTransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentTransaction.cs rename to Adyen/src/Model/TerminalApi/PaymentTransaction.cs diff --git a/Adyen/Model/TerminalApi/PaymentType.cs b/Adyen/src/Model/TerminalApi/PaymentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentType.cs rename to Adyen/src/Model/TerminalApi/PaymentType.cs diff --git a/Adyen/Model/TerminalApi/PerformedTransaction.cs b/Adyen/src/Model/TerminalApi/PerformedTransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/PerformedTransaction.cs rename to Adyen/src/Model/TerminalApi/PerformedTransaction.cs diff --git a/Adyen/Model/TerminalApi/PeriodUnitType.cs b/Adyen/src/Model/TerminalApi/PeriodUnitType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PeriodUnitType.cs rename to Adyen/src/Model/TerminalApi/PeriodUnitType.cs diff --git a/Adyen/Model/TerminalApi/PredefinedContent.cs b/Adyen/src/Model/TerminalApi/PredefinedContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/PredefinedContent.cs rename to Adyen/src/Model/TerminalApi/PredefinedContent.cs diff --git a/Adyen/Model/TerminalApi/PrintOutput.cs b/Adyen/src/Model/TerminalApi/PrintOutput.cs similarity index 100% rename from Adyen/Model/TerminalApi/PrintOutput.cs rename to Adyen/src/Model/TerminalApi/PrintOutput.cs diff --git a/Adyen/Model/TerminalApi/PrintRequest.cs b/Adyen/src/Model/TerminalApi/PrintRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/PrintRequest.cs rename to Adyen/src/Model/TerminalApi/PrintRequest.cs diff --git a/Adyen/Model/TerminalApi/PrintResponse.cs b/Adyen/src/Model/TerminalApi/PrintResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/PrintResponse.cs rename to Adyen/src/Model/TerminalApi/PrintResponse.cs diff --git a/Adyen/Model/TerminalApi/PrinterStatusType.cs b/Adyen/src/Model/TerminalApi/PrinterStatusType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PrinterStatusType.cs rename to Adyen/src/Model/TerminalApi/PrinterStatusType.cs diff --git a/Adyen/Model/TerminalApi/Rebates.cs b/Adyen/src/Model/TerminalApi/Rebates.cs similarity index 100% rename from Adyen/Model/TerminalApi/Rebates.cs rename to Adyen/src/Model/TerminalApi/Rebates.cs diff --git a/Adyen/Model/TerminalApi/RecipientIdentifier.cs b/Adyen/src/Model/TerminalApi/RecipientIdentifier.cs similarity index 100% rename from Adyen/Model/TerminalApi/RecipientIdentifier.cs rename to Adyen/src/Model/TerminalApi/RecipientIdentifier.cs diff --git a/Adyen/Model/TerminalApi/ReconciliationRequest.cs b/Adyen/src/Model/TerminalApi/ReconciliationRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReconciliationRequest.cs rename to Adyen/src/Model/TerminalApi/ReconciliationRequest.cs diff --git a/Adyen/Model/TerminalApi/ReconciliationResponse.cs b/Adyen/src/Model/TerminalApi/ReconciliationResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReconciliationResponse.cs rename to Adyen/src/Model/TerminalApi/ReconciliationResponse.cs diff --git a/Adyen/Model/TerminalApi/ReconciliationType.cs b/Adyen/src/Model/TerminalApi/ReconciliationType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReconciliationType.cs rename to Adyen/src/Model/TerminalApi/ReconciliationType.cs diff --git a/Adyen/Model/TerminalApi/RelativeDistinguishedName.cs b/Adyen/src/Model/TerminalApi/RelativeDistinguishedName.cs similarity index 100% rename from Adyen/Model/TerminalApi/RelativeDistinguishedName.cs rename to Adyen/src/Model/TerminalApi/RelativeDistinguishedName.cs diff --git a/Adyen/Model/TerminalApi/RepeatedMessageResponse.cs b/Adyen/src/Model/TerminalApi/RepeatedMessageResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/RepeatedMessageResponse.cs rename to Adyen/src/Model/TerminalApi/RepeatedMessageResponse.cs diff --git a/Adyen/Model/TerminalApi/RepeatedResponseMessageBody.cs b/Adyen/src/Model/TerminalApi/RepeatedResponseMessageBody.cs similarity index 100% rename from Adyen/Model/TerminalApi/RepeatedResponseMessageBody.cs rename to Adyen/src/Model/TerminalApi/RepeatedResponseMessageBody.cs diff --git a/Adyen/Model/TerminalApi/Response.cs b/Adyen/src/Model/TerminalApi/Response.cs similarity index 100% rename from Adyen/Model/TerminalApi/Response.cs rename to Adyen/src/Model/TerminalApi/Response.cs diff --git a/Adyen/Model/TerminalApi/ResponseModeType.cs b/Adyen/src/Model/TerminalApi/ResponseModeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ResponseModeType.cs rename to Adyen/src/Model/TerminalApi/ResponseModeType.cs diff --git a/Adyen/Model/TerminalApi/ResultType.cs b/Adyen/src/Model/TerminalApi/ResultType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ResultType.cs rename to Adyen/src/Model/TerminalApi/ResultType.cs diff --git a/Adyen/Model/TerminalApi/ReversalReasonType.cs b/Adyen/src/Model/TerminalApi/ReversalReasonType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReversalReasonType.cs rename to Adyen/src/Model/TerminalApi/ReversalReasonType.cs diff --git a/Adyen/Model/TerminalApi/ReversalRequest.cs b/Adyen/src/Model/TerminalApi/ReversalRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReversalRequest.cs rename to Adyen/src/Model/TerminalApi/ReversalRequest.cs diff --git a/Adyen/Model/TerminalApi/ReversalResponse.cs b/Adyen/src/Model/TerminalApi/ReversalResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReversalResponse.cs rename to Adyen/src/Model/TerminalApi/ReversalResponse.cs diff --git a/Adyen/Model/TerminalApi/SaleData.cs b/Adyen/src/Model/TerminalApi/SaleData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleData.cs rename to Adyen/src/Model/TerminalApi/SaleData.cs diff --git a/Adyen/Model/TerminalApi/SaleItem.cs b/Adyen/src/Model/TerminalApi/SaleItem.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleItem.cs rename to Adyen/src/Model/TerminalApi/SaleItem.cs diff --git a/Adyen/Model/TerminalApi/SaleItemRebate.cs b/Adyen/src/Model/TerminalApi/SaleItemRebate.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleItemRebate.cs rename to Adyen/src/Model/TerminalApi/SaleItemRebate.cs diff --git a/Adyen/Model/TerminalApi/SaleProfile.cs b/Adyen/src/Model/TerminalApi/SaleProfile.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleProfile.cs rename to Adyen/src/Model/TerminalApi/SaleProfile.cs diff --git a/Adyen/Model/TerminalApi/SaleSoftware.cs b/Adyen/src/Model/TerminalApi/SaleSoftware.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleSoftware.cs rename to Adyen/src/Model/TerminalApi/SaleSoftware.cs diff --git a/Adyen/Model/TerminalApi/SaleTerminalData.cs b/Adyen/src/Model/TerminalApi/SaleTerminalData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleTerminalData.cs rename to Adyen/src/Model/TerminalApi/SaleTerminalData.cs diff --git a/Adyen/Model/TerminalApi/SaleToIssuerData.cs b/Adyen/src/Model/TerminalApi/SaleToIssuerData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleToIssuerData.cs rename to Adyen/src/Model/TerminalApi/SaleToIssuerData.cs diff --git a/Adyen/Model/TerminalApi/SaleToPOIMessage.cs b/Adyen/src/Model/TerminalApi/SaleToPOIMessage.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleToPOIMessage.cs rename to Adyen/src/Model/TerminalApi/SaleToPOIMessage.cs diff --git a/Adyen/Model/TerminalApi/SaleToPOIResponse.cs b/Adyen/src/Model/TerminalApi/SaleToPOIResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleToPOIResponse.cs rename to Adyen/src/Model/TerminalApi/SaleToPOIResponse.cs diff --git a/Adyen/Model/TerminalApi/SensitiveCardData.cs b/Adyen/src/Model/TerminalApi/SensitiveCardData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SensitiveCardData.cs rename to Adyen/src/Model/TerminalApi/SensitiveCardData.cs diff --git a/Adyen/Model/TerminalApi/SensitiveMobileData.cs b/Adyen/src/Model/TerminalApi/SensitiveMobileData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SensitiveMobileData.cs rename to Adyen/src/Model/TerminalApi/SensitiveMobileData.cs diff --git a/Adyen/Model/TerminalApi/SignaturePoint.cs b/Adyen/src/Model/TerminalApi/SignaturePoint.cs similarity index 100% rename from Adyen/Model/TerminalApi/SignaturePoint.cs rename to Adyen/src/Model/TerminalApi/SignaturePoint.cs diff --git a/Adyen/Model/TerminalApi/SignedData.cs b/Adyen/src/Model/TerminalApi/SignedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SignedData.cs rename to Adyen/src/Model/TerminalApi/SignedData.cs diff --git a/Adyen/Model/TerminalApi/Signer.cs b/Adyen/src/Model/TerminalApi/Signer.cs similarity index 100% rename from Adyen/Model/TerminalApi/Signer.cs rename to Adyen/src/Model/TerminalApi/Signer.cs diff --git a/Adyen/Model/TerminalApi/SignerIdentifier.cs b/Adyen/src/Model/TerminalApi/SignerIdentifier.cs similarity index 100% rename from Adyen/Model/TerminalApi/SignerIdentifier.cs rename to Adyen/src/Model/TerminalApi/SignerIdentifier.cs diff --git a/Adyen/Model/TerminalApi/SoundActionType.cs b/Adyen/src/Model/TerminalApi/SoundActionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundActionType.cs rename to Adyen/src/Model/TerminalApi/SoundActionType.cs diff --git a/Adyen/Model/TerminalApi/SoundContent.cs b/Adyen/src/Model/TerminalApi/SoundContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundContent.cs rename to Adyen/src/Model/TerminalApi/SoundContent.cs diff --git a/Adyen/Model/TerminalApi/SoundFormatType.cs b/Adyen/src/Model/TerminalApi/SoundFormatType.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundFormatType.cs rename to Adyen/src/Model/TerminalApi/SoundFormatType.cs diff --git a/Adyen/Model/TerminalApi/SoundRequest.cs b/Adyen/src/Model/TerminalApi/SoundRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundRequest.cs rename to Adyen/src/Model/TerminalApi/SoundRequest.cs diff --git a/Adyen/Model/TerminalApi/SoundResponse.cs b/Adyen/src/Model/TerminalApi/SoundResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundResponse.cs rename to Adyen/src/Model/TerminalApi/SoundResponse.cs diff --git a/Adyen/Model/TerminalApi/SponsoredMerchant.cs b/Adyen/src/Model/TerminalApi/SponsoredMerchant.cs similarity index 100% rename from Adyen/Model/TerminalApi/SponsoredMerchant.cs rename to Adyen/src/Model/TerminalApi/SponsoredMerchant.cs diff --git a/Adyen/Model/TerminalApi/StoredValueAccountID.cs b/Adyen/src/Model/TerminalApi/StoredValueAccountID.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueAccountID.cs rename to Adyen/src/Model/TerminalApi/StoredValueAccountID.cs diff --git a/Adyen/Model/TerminalApi/StoredValueAccountStatus.cs b/Adyen/src/Model/TerminalApi/StoredValueAccountStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueAccountStatus.cs rename to Adyen/src/Model/TerminalApi/StoredValueAccountStatus.cs diff --git a/Adyen/Model/TerminalApi/StoredValueAccountType.cs b/Adyen/src/Model/TerminalApi/StoredValueAccountType.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueAccountType.cs rename to Adyen/src/Model/TerminalApi/StoredValueAccountType.cs diff --git a/Adyen/Model/TerminalApi/StoredValueData.cs b/Adyen/src/Model/TerminalApi/StoredValueData.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueData.cs rename to Adyen/src/Model/TerminalApi/StoredValueData.cs diff --git a/Adyen/Model/TerminalApi/StoredValueRequest.cs b/Adyen/src/Model/TerminalApi/StoredValueRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueRequest.cs rename to Adyen/src/Model/TerminalApi/StoredValueRequest.cs diff --git a/Adyen/Model/TerminalApi/StoredValueResponse.cs b/Adyen/src/Model/TerminalApi/StoredValueResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueResponse.cs rename to Adyen/src/Model/TerminalApi/StoredValueResponse.cs diff --git a/Adyen/Model/TerminalApi/StoredValueResult.cs b/Adyen/src/Model/TerminalApi/StoredValueResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueResult.cs rename to Adyen/src/Model/TerminalApi/StoredValueResult.cs diff --git a/Adyen/Model/TerminalApi/StoredValueTransactionType.cs b/Adyen/src/Model/TerminalApi/StoredValueTransactionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueTransactionType.cs rename to Adyen/src/Model/TerminalApi/StoredValueTransactionType.cs diff --git a/Adyen/Model/TerminalApi/TerminalEnvironmentType.cs b/Adyen/src/Model/TerminalApi/TerminalEnvironmentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TerminalEnvironmentType.cs rename to Adyen/src/Model/TerminalApi/TerminalEnvironmentType.cs diff --git a/Adyen/Model/TerminalApi/TokenRequestedType.cs b/Adyen/src/Model/TerminalApi/TokenRequestedType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TokenRequestedType.cs rename to Adyen/src/Model/TerminalApi/TokenRequestedType.cs diff --git a/Adyen/Model/TerminalApi/TotalDetailsType.cs b/Adyen/src/Model/TerminalApi/TotalDetailsType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TotalDetailsType.cs rename to Adyen/src/Model/TerminalApi/TotalDetailsType.cs diff --git a/Adyen/Model/TerminalApi/TotalFilter.cs b/Adyen/src/Model/TerminalApi/TotalFilter.cs similarity index 100% rename from Adyen/Model/TerminalApi/TotalFilter.cs rename to Adyen/src/Model/TerminalApi/TotalFilter.cs diff --git a/Adyen/Model/TerminalApi/TrackData.cs b/Adyen/src/Model/TerminalApi/TrackData.cs similarity index 100% rename from Adyen/Model/TerminalApi/TrackData.cs rename to Adyen/src/Model/TerminalApi/TrackData.cs diff --git a/Adyen/Model/TerminalApi/TrackFormatType.cs b/Adyen/src/Model/TerminalApi/TrackFormatType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TrackFormatType.cs rename to Adyen/src/Model/TerminalApi/TrackFormatType.cs diff --git a/Adyen/Model/TerminalApi/TransactionActionType.cs b/Adyen/src/Model/TerminalApi/TransactionActionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionActionType.cs rename to Adyen/src/Model/TerminalApi/TransactionActionType.cs diff --git a/Adyen/Model/TerminalApi/TransactionConditions.cs b/Adyen/src/Model/TerminalApi/TransactionConditions.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionConditions.cs rename to Adyen/src/Model/TerminalApi/TransactionConditions.cs diff --git a/Adyen/Model/TerminalApi/TransactionIdentification.cs b/Adyen/src/Model/TerminalApi/TransactionIdentification.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionIdentification.cs rename to Adyen/src/Model/TerminalApi/TransactionIdentification.cs diff --git a/Adyen/Model/TerminalApi/TransactionStatusRequest.cs b/Adyen/src/Model/TerminalApi/TransactionStatusRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionStatusRequest.cs rename to Adyen/src/Model/TerminalApi/TransactionStatusRequest.cs diff --git a/Adyen/Model/TerminalApi/TransactionStatusResponse.cs b/Adyen/src/Model/TerminalApi/TransactionStatusResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionStatusResponse.cs rename to Adyen/src/Model/TerminalApi/TransactionStatusResponse.cs diff --git a/Adyen/Model/TerminalApi/TransactionToPerform.cs b/Adyen/src/Model/TerminalApi/TransactionToPerform.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionToPerform.cs rename to Adyen/src/Model/TerminalApi/TransactionToPerform.cs diff --git a/Adyen/Model/TerminalApi/TransactionTotals.cs b/Adyen/src/Model/TerminalApi/TransactionTotals.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionTotals.cs rename to Adyen/src/Model/TerminalApi/TransactionTotals.cs diff --git a/Adyen/Model/TerminalApi/TransactionType.cs b/Adyen/src/Model/TerminalApi/TransactionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionType.cs rename to Adyen/src/Model/TerminalApi/TransactionType.cs diff --git a/Adyen/Model/TerminalApi/TransmitRequest.cs b/Adyen/src/Model/TerminalApi/TransmitRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransmitRequest.cs rename to Adyen/src/Model/TerminalApi/TransmitRequest.cs diff --git a/Adyen/Model/TerminalApi/TransmitResponse.cs b/Adyen/src/Model/TerminalApi/TransmitResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransmitResponse.cs rename to Adyen/src/Model/TerminalApi/TransmitResponse.cs diff --git a/Adyen/Model/TerminalApi/UTMCoordinates.cs b/Adyen/src/Model/TerminalApi/UTMCoordinates.cs similarity index 100% rename from Adyen/Model/TerminalApi/UTMCoordinates.cs rename to Adyen/src/Model/TerminalApi/UTMCoordinates.cs diff --git a/Adyen/Model/TerminalApi/UnitOfMeasureType.cs b/Adyen/src/Model/TerminalApi/UnitOfMeasureType.cs similarity index 100% rename from Adyen/Model/TerminalApi/UnitOfMeasureType.cs rename to Adyen/src/Model/TerminalApi/UnitOfMeasureType.cs diff --git a/Adyen/Model/TerminalApi/VersionType.cs b/Adyen/src/Model/TerminalApi/VersionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/VersionType.cs rename to Adyen/src/Model/TerminalApi/VersionType.cs diff --git a/Adyen/Model/TransactionWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/TransactionWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/TransactionWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/TransactionWebhooks/Amount.cs b/Adyen/src/Model/TransactionWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/Amount.cs rename to Adyen/src/Model/TransactionWebhooks/Amount.cs diff --git a/Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/src/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/src/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/Model/TransactionWebhooks/BankCategoryData.cs b/Adyen/src/Model/TransactionWebhooks/BankCategoryData.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/BankCategoryData.cs rename to Adyen/src/Model/TransactionWebhooks/BankCategoryData.cs diff --git a/Adyen/Model/TransactionWebhooks/InternalCategoryData.cs b/Adyen/src/Model/TransactionWebhooks/InternalCategoryData.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/InternalCategoryData.cs rename to Adyen/src/Model/TransactionWebhooks/InternalCategoryData.cs diff --git a/Adyen/Model/TransactionWebhooks/IssuedCard.cs b/Adyen/src/Model/TransactionWebhooks/IssuedCard.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/IssuedCard.cs rename to Adyen/src/Model/TransactionWebhooks/IssuedCard.cs diff --git a/Adyen/Model/TransactionWebhooks/PaymentInstrument.cs b/Adyen/src/Model/TransactionWebhooks/PaymentInstrument.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/PaymentInstrument.cs rename to Adyen/src/Model/TransactionWebhooks/PaymentInstrument.cs diff --git a/Adyen/Model/TransactionWebhooks/PlatformPayment.cs b/Adyen/src/Model/TransactionWebhooks/PlatformPayment.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/PlatformPayment.cs rename to Adyen/src/Model/TransactionWebhooks/PlatformPayment.cs diff --git a/Adyen/Model/TransactionWebhooks/RelayedAuthorisationData.cs b/Adyen/src/Model/TransactionWebhooks/RelayedAuthorisationData.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/RelayedAuthorisationData.cs rename to Adyen/src/Model/TransactionWebhooks/RelayedAuthorisationData.cs diff --git a/Adyen/Model/TransactionWebhooks/Resource.cs b/Adyen/src/Model/TransactionWebhooks/Resource.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/Resource.cs rename to Adyen/src/Model/TransactionWebhooks/Resource.cs diff --git a/Adyen/Model/TransactionWebhooks/ResourceReference.cs b/Adyen/src/Model/TransactionWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/ResourceReference.cs rename to Adyen/src/Model/TransactionWebhooks/ResourceReference.cs diff --git a/Adyen/Model/TransactionWebhooks/ThreeDSecure.cs b/Adyen/src/Model/TransactionWebhooks/ThreeDSecure.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/ThreeDSecure.cs rename to Adyen/src/Model/TransactionWebhooks/ThreeDSecure.cs diff --git a/Adyen/Model/TransactionWebhooks/Transaction.cs b/Adyen/src/Model/TransactionWebhooks/Transaction.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/Transaction.cs rename to Adyen/src/Model/TransactionWebhooks/Transaction.cs diff --git a/Adyen/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs b/Adyen/src/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs rename to Adyen/src/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs diff --git a/Adyen/Model/TransactionWebhooks/TransferNotificationValidationFact.cs b/Adyen/src/Model/TransactionWebhooks/TransferNotificationValidationFact.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/TransferNotificationValidationFact.cs rename to Adyen/src/Model/TransactionWebhooks/TransferNotificationValidationFact.cs diff --git a/Adyen/Model/TransactionWebhooks/TransferView.cs b/Adyen/src/Model/TransactionWebhooks/TransferView.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/TransferView.cs rename to Adyen/src/Model/TransactionWebhooks/TransferView.cs diff --git a/Adyen/Model/TransactionWebhooks/TransferViewCategoryData.cs b/Adyen/src/Model/TransactionWebhooks/TransferViewCategoryData.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/TransferViewCategoryData.cs rename to Adyen/src/Model/TransactionWebhooks/TransferViewCategoryData.cs diff --git a/Adyen/Model/TransferWebhooks/AULocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/AULocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/AULocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/TransferWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/TransferWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/TransferWebhooks/AdditionalBankIdentification.cs b/Adyen/src/Model/TransferWebhooks/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/AdditionalBankIdentification.cs rename to Adyen/src/Model/TransferWebhooks/AdditionalBankIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/Address.cs b/Adyen/src/Model/TransferWebhooks/Address.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Address.cs rename to Adyen/src/Model/TransferWebhooks/Address.cs diff --git a/Adyen/Model/TransferWebhooks/Airline.cs b/Adyen/src/Model/TransferWebhooks/Airline.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Airline.cs rename to Adyen/src/Model/TransferWebhooks/Airline.cs diff --git a/Adyen/Model/TransferWebhooks/Amount.cs b/Adyen/src/Model/TransferWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Amount.cs rename to Adyen/src/Model/TransferWebhooks/Amount.cs diff --git a/Adyen/Model/TransferWebhooks/AmountAdjustment.cs b/Adyen/src/Model/TransferWebhooks/AmountAdjustment.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/AmountAdjustment.cs rename to Adyen/src/Model/TransferWebhooks/AmountAdjustment.cs diff --git a/Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/BRLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/BRLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/BalanceMutation.cs b/Adyen/src/Model/TransferWebhooks/BalanceMutation.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/BalanceMutation.cs rename to Adyen/src/Model/TransferWebhooks/BalanceMutation.cs diff --git a/Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/src/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/src/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/Model/TransferWebhooks/BankAccountV3.cs b/Adyen/src/Model/TransferWebhooks/BankAccountV3.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/BankAccountV3.cs rename to Adyen/src/Model/TransferWebhooks/BankAccountV3.cs diff --git a/Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/BankCategoryData.cs b/Adyen/src/Model/TransferWebhooks/BankCategoryData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/BankCategoryData.cs rename to Adyen/src/Model/TransferWebhooks/BankCategoryData.cs diff --git a/Adyen/Model/TransferWebhooks/CALocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/CALocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/CALocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/CZLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/Card.cs b/Adyen/src/Model/TransferWebhooks/Card.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Card.cs rename to Adyen/src/Model/TransferWebhooks/Card.cs diff --git a/Adyen/Model/TransferWebhooks/CardIdentification.cs b/Adyen/src/Model/TransferWebhooks/CardIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/CardIdentification.cs rename to Adyen/src/Model/TransferWebhooks/CardIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/ConfirmationTrackingData.cs b/Adyen/src/Model/TransferWebhooks/ConfirmationTrackingData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/ConfirmationTrackingData.cs rename to Adyen/src/Model/TransferWebhooks/ConfirmationTrackingData.cs diff --git a/Adyen/Model/TransferWebhooks/CounterpartyV3.cs b/Adyen/src/Model/TransferWebhooks/CounterpartyV3.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/CounterpartyV3.cs rename to Adyen/src/Model/TransferWebhooks/CounterpartyV3.cs diff --git a/Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/DKLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/DirectDebitInformation.cs b/Adyen/src/Model/TransferWebhooks/DirectDebitInformation.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/DirectDebitInformation.cs rename to Adyen/src/Model/TransferWebhooks/DirectDebitInformation.cs diff --git a/Adyen/Model/TransferWebhooks/EstimationTrackingData.cs b/Adyen/src/Model/TransferWebhooks/EstimationTrackingData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/EstimationTrackingData.cs rename to Adyen/src/Model/TransferWebhooks/EstimationTrackingData.cs diff --git a/Adyen/Model/TransferWebhooks/ExternalReason.cs b/Adyen/src/Model/TransferWebhooks/ExternalReason.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/ExternalReason.cs rename to Adyen/src/Model/TransferWebhooks/ExternalReason.cs diff --git a/Adyen/Model/TransferWebhooks/HKLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/HKLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/HKLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/HULocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/HULocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/HULocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/IbanAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/IbanAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/IbanAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/IbanAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/InternalCategoryData.cs b/Adyen/src/Model/TransferWebhooks/InternalCategoryData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/InternalCategoryData.cs rename to Adyen/src/Model/TransferWebhooks/InternalCategoryData.cs diff --git a/Adyen/Model/TransferWebhooks/InternalReviewTrackingData.cs b/Adyen/src/Model/TransferWebhooks/InternalReviewTrackingData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/InternalReviewTrackingData.cs rename to Adyen/src/Model/TransferWebhooks/InternalReviewTrackingData.cs diff --git a/Adyen/Model/TransferWebhooks/IssuedCard.cs b/Adyen/src/Model/TransferWebhooks/IssuedCard.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/IssuedCard.cs rename to Adyen/src/Model/TransferWebhooks/IssuedCard.cs diff --git a/Adyen/Model/TransferWebhooks/IssuingTransactionData.cs b/Adyen/src/Model/TransferWebhooks/IssuingTransactionData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/IssuingTransactionData.cs rename to Adyen/src/Model/TransferWebhooks/IssuingTransactionData.cs diff --git a/Adyen/Model/TransferWebhooks/Leg.cs b/Adyen/src/Model/TransferWebhooks/Leg.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Leg.cs rename to Adyen/src/Model/TransferWebhooks/Leg.cs diff --git a/Adyen/Model/TransferWebhooks/Lodging.cs b/Adyen/src/Model/TransferWebhooks/Lodging.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Lodging.cs rename to Adyen/src/Model/TransferWebhooks/Lodging.cs diff --git a/Adyen/Model/TransferWebhooks/MerchantData.cs b/Adyen/src/Model/TransferWebhooks/MerchantData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/MerchantData.cs rename to Adyen/src/Model/TransferWebhooks/MerchantData.cs diff --git a/Adyen/Model/TransferWebhooks/MerchantPurchaseData.cs b/Adyen/src/Model/TransferWebhooks/MerchantPurchaseData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/MerchantPurchaseData.cs rename to Adyen/src/Model/TransferWebhooks/MerchantPurchaseData.cs diff --git a/Adyen/Model/TransferWebhooks/Modification.cs b/Adyen/src/Model/TransferWebhooks/Modification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Modification.cs rename to Adyen/src/Model/TransferWebhooks/Modification.cs diff --git a/Adyen/Model/TransferWebhooks/NOLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/NOLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/NOLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/NZLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/NameLocation.cs b/Adyen/src/Model/TransferWebhooks/NameLocation.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/NameLocation.cs rename to Adyen/src/Model/TransferWebhooks/NameLocation.cs diff --git a/Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/PLLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/PartyIdentification.cs b/Adyen/src/Model/TransferWebhooks/PartyIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/PartyIdentification.cs rename to Adyen/src/Model/TransferWebhooks/PartyIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/PaymentInstrument.cs b/Adyen/src/Model/TransferWebhooks/PaymentInstrument.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/PaymentInstrument.cs rename to Adyen/src/Model/TransferWebhooks/PaymentInstrument.cs diff --git a/Adyen/Model/TransferWebhooks/PlatformPayment.cs b/Adyen/src/Model/TransferWebhooks/PlatformPayment.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/PlatformPayment.cs rename to Adyen/src/Model/TransferWebhooks/PlatformPayment.cs diff --git a/Adyen/Model/TransferWebhooks/RelayedAuthorisationData.cs b/Adyen/src/Model/TransferWebhooks/RelayedAuthorisationData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/RelayedAuthorisationData.cs rename to Adyen/src/Model/TransferWebhooks/RelayedAuthorisationData.cs diff --git a/Adyen/Model/TransferWebhooks/Resource.cs b/Adyen/src/Model/TransferWebhooks/Resource.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Resource.cs rename to Adyen/src/Model/TransferWebhooks/Resource.cs diff --git a/Adyen/Model/TransferWebhooks/ResourceReference.cs b/Adyen/src/Model/TransferWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/ResourceReference.cs rename to Adyen/src/Model/TransferWebhooks/ResourceReference.cs diff --git a/Adyen/Model/TransferWebhooks/SELocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/SELocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/SELocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/SGLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/TransactionEventViolation.cs b/Adyen/src/Model/TransferWebhooks/TransactionEventViolation.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransactionEventViolation.cs rename to Adyen/src/Model/TransferWebhooks/TransactionEventViolation.cs diff --git a/Adyen/Model/TransferWebhooks/TransactionRuleReference.cs b/Adyen/src/Model/TransferWebhooks/TransactionRuleReference.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransactionRuleReference.cs rename to Adyen/src/Model/TransferWebhooks/TransactionRuleReference.cs diff --git a/Adyen/Model/TransferWebhooks/TransactionRuleSource.cs b/Adyen/src/Model/TransferWebhooks/TransactionRuleSource.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransactionRuleSource.cs rename to Adyen/src/Model/TransferWebhooks/TransactionRuleSource.cs diff --git a/Adyen/Model/TransferWebhooks/TransactionRulesResult.cs b/Adyen/src/Model/TransferWebhooks/TransactionRulesResult.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransactionRulesResult.cs rename to Adyen/src/Model/TransferWebhooks/TransactionRulesResult.cs diff --git a/Adyen/Model/TransferWebhooks/TransferData.cs b/Adyen/src/Model/TransferWebhooks/TransferData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferData.cs rename to Adyen/src/Model/TransferWebhooks/TransferData.cs diff --git a/Adyen/Model/TransferWebhooks/TransferDataCategoryData.cs b/Adyen/src/Model/TransferWebhooks/TransferDataCategoryData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferDataCategoryData.cs rename to Adyen/src/Model/TransferWebhooks/TransferDataCategoryData.cs diff --git a/Adyen/Model/TransferWebhooks/TransferDataTracking.cs b/Adyen/src/Model/TransferWebhooks/TransferDataTracking.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferDataTracking.cs rename to Adyen/src/Model/TransferWebhooks/TransferDataTracking.cs diff --git a/Adyen/Model/TransferWebhooks/TransferEvent.cs b/Adyen/src/Model/TransferWebhooks/TransferEvent.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferEvent.cs rename to Adyen/src/Model/TransferWebhooks/TransferEvent.cs diff --git a/Adyen/Model/TransferWebhooks/TransferEventEventsDataInner.cs b/Adyen/src/Model/TransferWebhooks/TransferEventEventsDataInner.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferEventEventsDataInner.cs rename to Adyen/src/Model/TransferWebhooks/TransferEventEventsDataInner.cs diff --git a/Adyen/Model/TransferWebhooks/TransferEventTrackingData.cs b/Adyen/src/Model/TransferWebhooks/TransferEventTrackingData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferEventTrackingData.cs rename to Adyen/src/Model/TransferWebhooks/TransferEventTrackingData.cs diff --git a/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.cs b/Adyen/src/Model/TransferWebhooks/TransferNotificationCounterParty.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.cs rename to Adyen/src/Model/TransferWebhooks/TransferNotificationCounterParty.cs diff --git a/Adyen/Model/TransferWebhooks/TransferNotificationMerchantData.cs b/Adyen/src/Model/TransferWebhooks/TransferNotificationMerchantData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferNotificationMerchantData.cs rename to Adyen/src/Model/TransferWebhooks/TransferNotificationMerchantData.cs diff --git a/Adyen/Model/TransferWebhooks/TransferNotificationRequest.cs b/Adyen/src/Model/TransferWebhooks/TransferNotificationRequest.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferNotificationRequest.cs rename to Adyen/src/Model/TransferWebhooks/TransferNotificationRequest.cs diff --git a/Adyen/Model/TransferWebhooks/TransferNotificationValidationFact.cs b/Adyen/src/Model/TransferWebhooks/TransferNotificationValidationFact.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferNotificationValidationFact.cs rename to Adyen/src/Model/TransferWebhooks/TransferNotificationValidationFact.cs diff --git a/Adyen/Model/TransferWebhooks/TransferReview.cs b/Adyen/src/Model/TransferWebhooks/TransferReview.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferReview.cs rename to Adyen/src/Model/TransferWebhooks/TransferReview.cs diff --git a/Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/UKLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/USLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/USLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/USLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/AULocalAccountIdentification.cs b/Adyen/src/Model/Transfers/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/AULocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/AULocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/AbstractOpenAPISchema.cs b/Adyen/src/Model/Transfers/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Transfers/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Transfers/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Transfers/AdditionalBankIdentification.cs b/Adyen/src/Model/Transfers/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/AdditionalBankIdentification.cs rename to Adyen/src/Model/Transfers/AdditionalBankIdentification.cs diff --git a/Adyen/Model/Transfers/Address.cs b/Adyen/src/Model/Transfers/Address.cs similarity index 100% rename from Adyen/Model/Transfers/Address.cs rename to Adyen/src/Model/Transfers/Address.cs diff --git a/Adyen/Model/Transfers/Airline.cs b/Adyen/src/Model/Transfers/Airline.cs similarity index 100% rename from Adyen/Model/Transfers/Airline.cs rename to Adyen/src/Model/Transfers/Airline.cs diff --git a/Adyen/Model/Transfers/Amount.cs b/Adyen/src/Model/Transfers/Amount.cs similarity index 100% rename from Adyen/Model/Transfers/Amount.cs rename to Adyen/src/Model/Transfers/Amount.cs diff --git a/Adyen/Model/Transfers/AmountAdjustment.cs b/Adyen/src/Model/Transfers/AmountAdjustment.cs similarity index 100% rename from Adyen/Model/Transfers/AmountAdjustment.cs rename to Adyen/src/Model/Transfers/AmountAdjustment.cs diff --git a/Adyen/Model/Transfers/ApproveTransfersRequest.cs b/Adyen/src/Model/Transfers/ApproveTransfersRequest.cs similarity index 100% rename from Adyen/Model/Transfers/ApproveTransfersRequest.cs rename to Adyen/src/Model/Transfers/ApproveTransfersRequest.cs diff --git a/Adyen/Model/Transfers/BRLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/BRLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/BRLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/BRLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/BalanceMutation.cs b/Adyen/src/Model/Transfers/BalanceMutation.cs similarity index 100% rename from Adyen/Model/Transfers/BalanceMutation.cs rename to Adyen/src/Model/Transfers/BalanceMutation.cs diff --git a/Adyen/Model/Transfers/BankAccountV3.cs b/Adyen/src/Model/Transfers/BankAccountV3.cs similarity index 100% rename from Adyen/Model/Transfers/BankAccountV3.cs rename to Adyen/src/Model/Transfers/BankAccountV3.cs diff --git a/Adyen/Model/Transfers/BankAccountV3AccountIdentification.cs b/Adyen/src/Model/Transfers/BankAccountV3AccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/BankAccountV3AccountIdentification.cs rename to Adyen/src/Model/Transfers/BankAccountV3AccountIdentification.cs diff --git a/Adyen/Model/Transfers/BankCategoryData.cs b/Adyen/src/Model/Transfers/BankCategoryData.cs similarity index 100% rename from Adyen/Model/Transfers/BankCategoryData.cs rename to Adyen/src/Model/Transfers/BankCategoryData.cs diff --git a/Adyen/Model/Transfers/CALocalAccountIdentification.cs b/Adyen/src/Model/Transfers/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/CALocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/CALocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/CZLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/CZLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/CZLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/CancelTransfersRequest.cs b/Adyen/src/Model/Transfers/CancelTransfersRequest.cs similarity index 100% rename from Adyen/Model/Transfers/CancelTransfersRequest.cs rename to Adyen/src/Model/Transfers/CancelTransfersRequest.cs diff --git a/Adyen/Model/Transfers/CapitalBalance.cs b/Adyen/src/Model/Transfers/CapitalBalance.cs similarity index 100% rename from Adyen/Model/Transfers/CapitalBalance.cs rename to Adyen/src/Model/Transfers/CapitalBalance.cs diff --git a/Adyen/Model/Transfers/CapitalGrant.cs b/Adyen/src/Model/Transfers/CapitalGrant.cs similarity index 100% rename from Adyen/Model/Transfers/CapitalGrant.cs rename to Adyen/src/Model/Transfers/CapitalGrant.cs diff --git a/Adyen/Model/Transfers/CapitalGrantInfo.cs b/Adyen/src/Model/Transfers/CapitalGrantInfo.cs similarity index 100% rename from Adyen/Model/Transfers/CapitalGrantInfo.cs rename to Adyen/src/Model/Transfers/CapitalGrantInfo.cs diff --git a/Adyen/Model/Transfers/CapitalGrants.cs b/Adyen/src/Model/Transfers/CapitalGrants.cs similarity index 100% rename from Adyen/Model/Transfers/CapitalGrants.cs rename to Adyen/src/Model/Transfers/CapitalGrants.cs diff --git a/Adyen/Model/Transfers/Card.cs b/Adyen/src/Model/Transfers/Card.cs similarity index 100% rename from Adyen/Model/Transfers/Card.cs rename to Adyen/src/Model/Transfers/Card.cs diff --git a/Adyen/Model/Transfers/CardIdentification.cs b/Adyen/src/Model/Transfers/CardIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/CardIdentification.cs rename to Adyen/src/Model/Transfers/CardIdentification.cs diff --git a/Adyen/Model/Transfers/ConfirmationTrackingData.cs b/Adyen/src/Model/Transfers/ConfirmationTrackingData.cs similarity index 100% rename from Adyen/Model/Transfers/ConfirmationTrackingData.cs rename to Adyen/src/Model/Transfers/ConfirmationTrackingData.cs diff --git a/Adyen/Model/Transfers/Counterparty.cs b/Adyen/src/Model/Transfers/Counterparty.cs similarity index 100% rename from Adyen/Model/Transfers/Counterparty.cs rename to Adyen/src/Model/Transfers/Counterparty.cs diff --git a/Adyen/Model/Transfers/CounterpartyInfoV3.cs b/Adyen/src/Model/Transfers/CounterpartyInfoV3.cs similarity index 100% rename from Adyen/Model/Transfers/CounterpartyInfoV3.cs rename to Adyen/src/Model/Transfers/CounterpartyInfoV3.cs diff --git a/Adyen/Model/Transfers/CounterpartyV3.cs b/Adyen/src/Model/Transfers/CounterpartyV3.cs similarity index 100% rename from Adyen/Model/Transfers/CounterpartyV3.cs rename to Adyen/src/Model/Transfers/CounterpartyV3.cs diff --git a/Adyen/Model/Transfers/DKLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/DKLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/DKLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/DirectDebitInformation.cs b/Adyen/src/Model/Transfers/DirectDebitInformation.cs similarity index 100% rename from Adyen/Model/Transfers/DirectDebitInformation.cs rename to Adyen/src/Model/Transfers/DirectDebitInformation.cs diff --git a/Adyen/Model/Transfers/EstimationTrackingData.cs b/Adyen/src/Model/Transfers/EstimationTrackingData.cs similarity index 100% rename from Adyen/Model/Transfers/EstimationTrackingData.cs rename to Adyen/src/Model/Transfers/EstimationTrackingData.cs diff --git a/Adyen/Model/Transfers/ExternalReason.cs b/Adyen/src/Model/Transfers/ExternalReason.cs similarity index 100% rename from Adyen/Model/Transfers/ExternalReason.cs rename to Adyen/src/Model/Transfers/ExternalReason.cs diff --git a/Adyen/Model/Transfers/Fee.cs b/Adyen/src/Model/Transfers/Fee.cs similarity index 100% rename from Adyen/Model/Transfers/Fee.cs rename to Adyen/src/Model/Transfers/Fee.cs diff --git a/Adyen/Model/Transfers/FindTransfersResponse.cs b/Adyen/src/Model/Transfers/FindTransfersResponse.cs similarity index 100% rename from Adyen/Model/Transfers/FindTransfersResponse.cs rename to Adyen/src/Model/Transfers/FindTransfersResponse.cs diff --git a/Adyen/Model/Transfers/HKLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/HKLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/HKLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/HULocalAccountIdentification.cs b/Adyen/src/Model/Transfers/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/HULocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/HULocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/IbanAccountIdentification.cs b/Adyen/src/Model/Transfers/IbanAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/IbanAccountIdentification.cs rename to Adyen/src/Model/Transfers/IbanAccountIdentification.cs diff --git a/Adyen/Model/Transfers/InternalCategoryData.cs b/Adyen/src/Model/Transfers/InternalCategoryData.cs similarity index 100% rename from Adyen/Model/Transfers/InternalCategoryData.cs rename to Adyen/src/Model/Transfers/InternalCategoryData.cs diff --git a/Adyen/Model/Transfers/InternalReviewTrackingData.cs b/Adyen/src/Model/Transfers/InternalReviewTrackingData.cs similarity index 100% rename from Adyen/Model/Transfers/InternalReviewTrackingData.cs rename to Adyen/src/Model/Transfers/InternalReviewTrackingData.cs diff --git a/Adyen/Model/Transfers/InvalidField.cs b/Adyen/src/Model/Transfers/InvalidField.cs similarity index 100% rename from Adyen/Model/Transfers/InvalidField.cs rename to Adyen/src/Model/Transfers/InvalidField.cs diff --git a/Adyen/Model/Transfers/IssuedCard.cs b/Adyen/src/Model/Transfers/IssuedCard.cs similarity index 100% rename from Adyen/Model/Transfers/IssuedCard.cs rename to Adyen/src/Model/Transfers/IssuedCard.cs diff --git a/Adyen/Model/Transfers/IssuingTransactionData.cs b/Adyen/src/Model/Transfers/IssuingTransactionData.cs similarity index 100% rename from Adyen/Model/Transfers/IssuingTransactionData.cs rename to Adyen/src/Model/Transfers/IssuingTransactionData.cs diff --git a/Adyen/Model/Transfers/Leg.cs b/Adyen/src/Model/Transfers/Leg.cs similarity index 100% rename from Adyen/Model/Transfers/Leg.cs rename to Adyen/src/Model/Transfers/Leg.cs diff --git a/Adyen/Model/Transfers/Link.cs b/Adyen/src/Model/Transfers/Link.cs similarity index 100% rename from Adyen/Model/Transfers/Link.cs rename to Adyen/src/Model/Transfers/Link.cs diff --git a/Adyen/Model/Transfers/Links.cs b/Adyen/src/Model/Transfers/Links.cs similarity index 100% rename from Adyen/Model/Transfers/Links.cs rename to Adyen/src/Model/Transfers/Links.cs diff --git a/Adyen/Model/Transfers/Lodging.cs b/Adyen/src/Model/Transfers/Lodging.cs similarity index 100% rename from Adyen/Model/Transfers/Lodging.cs rename to Adyen/src/Model/Transfers/Lodging.cs diff --git a/Adyen/Model/Transfers/MerchantData.cs b/Adyen/src/Model/Transfers/MerchantData.cs similarity index 100% rename from Adyen/Model/Transfers/MerchantData.cs rename to Adyen/src/Model/Transfers/MerchantData.cs diff --git a/Adyen/Model/Transfers/MerchantPurchaseData.cs b/Adyen/src/Model/Transfers/MerchantPurchaseData.cs similarity index 100% rename from Adyen/Model/Transfers/MerchantPurchaseData.cs rename to Adyen/src/Model/Transfers/MerchantPurchaseData.cs diff --git a/Adyen/Model/Transfers/Modification.cs b/Adyen/src/Model/Transfers/Modification.cs similarity index 100% rename from Adyen/Model/Transfers/Modification.cs rename to Adyen/src/Model/Transfers/Modification.cs diff --git a/Adyen/Model/Transfers/NOLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/NOLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/NOLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/NZLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/NZLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/NZLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/NameLocation.cs b/Adyen/src/Model/Transfers/NameLocation.cs similarity index 100% rename from Adyen/Model/Transfers/NameLocation.cs rename to Adyen/src/Model/Transfers/NameLocation.cs diff --git a/Adyen/Model/Transfers/NumberAndBicAccountIdentification.cs b/Adyen/src/Model/Transfers/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/NumberAndBicAccountIdentification.cs rename to Adyen/src/Model/Transfers/NumberAndBicAccountIdentification.cs diff --git a/Adyen/Model/Transfers/PLLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/PLLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/PLLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/PartyIdentification.cs b/Adyen/src/Model/Transfers/PartyIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/PartyIdentification.cs rename to Adyen/src/Model/Transfers/PartyIdentification.cs diff --git a/Adyen/Model/Transfers/PaymentInstrument.cs b/Adyen/src/Model/Transfers/PaymentInstrument.cs similarity index 100% rename from Adyen/Model/Transfers/PaymentInstrument.cs rename to Adyen/src/Model/Transfers/PaymentInstrument.cs diff --git a/Adyen/Model/Transfers/PlatformPayment.cs b/Adyen/src/Model/Transfers/PlatformPayment.cs similarity index 100% rename from Adyen/Model/Transfers/PlatformPayment.cs rename to Adyen/src/Model/Transfers/PlatformPayment.cs diff --git a/Adyen/Model/Transfers/RelayedAuthorisationData.cs b/Adyen/src/Model/Transfers/RelayedAuthorisationData.cs similarity index 100% rename from Adyen/Model/Transfers/RelayedAuthorisationData.cs rename to Adyen/src/Model/Transfers/RelayedAuthorisationData.cs diff --git a/Adyen/Model/Transfers/Repayment.cs b/Adyen/src/Model/Transfers/Repayment.cs similarity index 100% rename from Adyen/Model/Transfers/Repayment.cs rename to Adyen/src/Model/Transfers/Repayment.cs diff --git a/Adyen/Model/Transfers/RepaymentTerm.cs b/Adyen/src/Model/Transfers/RepaymentTerm.cs similarity index 100% rename from Adyen/Model/Transfers/RepaymentTerm.cs rename to Adyen/src/Model/Transfers/RepaymentTerm.cs diff --git a/Adyen/Model/Transfers/ResourceReference.cs b/Adyen/src/Model/Transfers/ResourceReference.cs similarity index 100% rename from Adyen/Model/Transfers/ResourceReference.cs rename to Adyen/src/Model/Transfers/ResourceReference.cs diff --git a/Adyen/Model/Transfers/RestServiceError.cs b/Adyen/src/Model/Transfers/RestServiceError.cs similarity index 100% rename from Adyen/Model/Transfers/RestServiceError.cs rename to Adyen/src/Model/Transfers/RestServiceError.cs diff --git a/Adyen/Model/Transfers/ReturnTransferRequest.cs b/Adyen/src/Model/Transfers/ReturnTransferRequest.cs similarity index 100% rename from Adyen/Model/Transfers/ReturnTransferRequest.cs rename to Adyen/src/Model/Transfers/ReturnTransferRequest.cs diff --git a/Adyen/Model/Transfers/ReturnTransferResponse.cs b/Adyen/src/Model/Transfers/ReturnTransferResponse.cs similarity index 100% rename from Adyen/Model/Transfers/ReturnTransferResponse.cs rename to Adyen/src/Model/Transfers/ReturnTransferResponse.cs diff --git a/Adyen/Model/Transfers/RoutingDetails.cs b/Adyen/src/Model/Transfers/RoutingDetails.cs similarity index 100% rename from Adyen/Model/Transfers/RoutingDetails.cs rename to Adyen/src/Model/Transfers/RoutingDetails.cs diff --git a/Adyen/Model/Transfers/SELocalAccountIdentification.cs b/Adyen/src/Model/Transfers/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/SELocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/SELocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/SGLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/SGLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/SGLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/ServiceError.cs b/Adyen/src/Model/Transfers/ServiceError.cs similarity index 100% rename from Adyen/Model/Transfers/ServiceError.cs rename to Adyen/src/Model/Transfers/ServiceError.cs diff --git a/Adyen/Model/Transfers/ThresholdRepayment.cs b/Adyen/src/Model/Transfers/ThresholdRepayment.cs similarity index 100% rename from Adyen/Model/Transfers/ThresholdRepayment.cs rename to Adyen/src/Model/Transfers/ThresholdRepayment.cs diff --git a/Adyen/Model/Transfers/Transaction.cs b/Adyen/src/Model/Transfers/Transaction.cs similarity index 100% rename from Adyen/Model/Transfers/Transaction.cs rename to Adyen/src/Model/Transfers/Transaction.cs diff --git a/Adyen/Model/Transfers/TransactionEventViolation.cs b/Adyen/src/Model/Transfers/TransactionEventViolation.cs similarity index 100% rename from Adyen/Model/Transfers/TransactionEventViolation.cs rename to Adyen/src/Model/Transfers/TransactionEventViolation.cs diff --git a/Adyen/Model/Transfers/TransactionRuleReference.cs b/Adyen/src/Model/Transfers/TransactionRuleReference.cs similarity index 100% rename from Adyen/Model/Transfers/TransactionRuleReference.cs rename to Adyen/src/Model/Transfers/TransactionRuleReference.cs diff --git a/Adyen/Model/Transfers/TransactionRuleSource.cs b/Adyen/src/Model/Transfers/TransactionRuleSource.cs similarity index 100% rename from Adyen/Model/Transfers/TransactionRuleSource.cs rename to Adyen/src/Model/Transfers/TransactionRuleSource.cs diff --git a/Adyen/Model/Transfers/TransactionRulesResult.cs b/Adyen/src/Model/Transfers/TransactionRulesResult.cs similarity index 100% rename from Adyen/Model/Transfers/TransactionRulesResult.cs rename to Adyen/src/Model/Transfers/TransactionRulesResult.cs diff --git a/Adyen/Model/Transfers/TransactionSearchResponse.cs b/Adyen/src/Model/Transfers/TransactionSearchResponse.cs similarity index 100% rename from Adyen/Model/Transfers/TransactionSearchResponse.cs rename to Adyen/src/Model/Transfers/TransactionSearchResponse.cs diff --git a/Adyen/Model/Transfers/Transfer.cs b/Adyen/src/Model/Transfers/Transfer.cs similarity index 100% rename from Adyen/Model/Transfers/Transfer.cs rename to Adyen/src/Model/Transfers/Transfer.cs diff --git a/Adyen/Model/Transfers/TransferCategoryData.cs b/Adyen/src/Model/Transfers/TransferCategoryData.cs similarity index 100% rename from Adyen/Model/Transfers/TransferCategoryData.cs rename to Adyen/src/Model/Transfers/TransferCategoryData.cs diff --git a/Adyen/Model/Transfers/TransferData.cs b/Adyen/src/Model/Transfers/TransferData.cs similarity index 100% rename from Adyen/Model/Transfers/TransferData.cs rename to Adyen/src/Model/Transfers/TransferData.cs diff --git a/Adyen/Model/Transfers/TransferDataTracking.cs b/Adyen/src/Model/Transfers/TransferDataTracking.cs similarity index 100% rename from Adyen/Model/Transfers/TransferDataTracking.cs rename to Adyen/src/Model/Transfers/TransferDataTracking.cs diff --git a/Adyen/Model/Transfers/TransferEvent.cs b/Adyen/src/Model/Transfers/TransferEvent.cs similarity index 100% rename from Adyen/Model/Transfers/TransferEvent.cs rename to Adyen/src/Model/Transfers/TransferEvent.cs diff --git a/Adyen/Model/Transfers/TransferEventEventsDataInner.cs b/Adyen/src/Model/Transfers/TransferEventEventsDataInner.cs similarity index 100% rename from Adyen/Model/Transfers/TransferEventEventsDataInner.cs rename to Adyen/src/Model/Transfers/TransferEventEventsDataInner.cs diff --git a/Adyen/Model/Transfers/TransferEventTrackingData.cs b/Adyen/src/Model/Transfers/TransferEventTrackingData.cs similarity index 100% rename from Adyen/Model/Transfers/TransferEventTrackingData.cs rename to Adyen/src/Model/Transfers/TransferEventTrackingData.cs diff --git a/Adyen/Model/Transfers/TransferInfo.cs b/Adyen/src/Model/Transfers/TransferInfo.cs similarity index 100% rename from Adyen/Model/Transfers/TransferInfo.cs rename to Adyen/src/Model/Transfers/TransferInfo.cs diff --git a/Adyen/Model/Transfers/TransferNotificationCounterParty.cs b/Adyen/src/Model/Transfers/TransferNotificationCounterParty.cs similarity index 100% rename from Adyen/Model/Transfers/TransferNotificationCounterParty.cs rename to Adyen/src/Model/Transfers/TransferNotificationCounterParty.cs diff --git a/Adyen/Model/Transfers/TransferNotificationMerchantData.cs b/Adyen/src/Model/Transfers/TransferNotificationMerchantData.cs similarity index 100% rename from Adyen/Model/Transfers/TransferNotificationMerchantData.cs rename to Adyen/src/Model/Transfers/TransferNotificationMerchantData.cs diff --git a/Adyen/Model/Transfers/TransferNotificationValidationFact.cs b/Adyen/src/Model/Transfers/TransferNotificationValidationFact.cs similarity index 100% rename from Adyen/Model/Transfers/TransferNotificationValidationFact.cs rename to Adyen/src/Model/Transfers/TransferNotificationValidationFact.cs diff --git a/Adyen/Model/Transfers/TransferRequestReview.cs b/Adyen/src/Model/Transfers/TransferRequestReview.cs similarity index 100% rename from Adyen/Model/Transfers/TransferRequestReview.cs rename to Adyen/src/Model/Transfers/TransferRequestReview.cs diff --git a/Adyen/Model/Transfers/TransferReview.cs b/Adyen/src/Model/Transfers/TransferReview.cs similarity index 100% rename from Adyen/Model/Transfers/TransferReview.cs rename to Adyen/src/Model/Transfers/TransferReview.cs diff --git a/Adyen/Model/Transfers/TransferServiceRestServiceError.cs b/Adyen/src/Model/Transfers/TransferServiceRestServiceError.cs similarity index 100% rename from Adyen/Model/Transfers/TransferServiceRestServiceError.cs rename to Adyen/src/Model/Transfers/TransferServiceRestServiceError.cs diff --git a/Adyen/Model/Transfers/TransferView.cs b/Adyen/src/Model/Transfers/TransferView.cs similarity index 100% rename from Adyen/Model/Transfers/TransferView.cs rename to Adyen/src/Model/Transfers/TransferView.cs diff --git a/Adyen/Model/Transfers/UKLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/UKLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/UKLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/USLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/USLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/USLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/UltimatePartyIdentification.cs b/Adyen/src/Model/Transfers/UltimatePartyIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/UltimatePartyIdentification.cs rename to Adyen/src/Model/Transfers/UltimatePartyIdentification.cs diff --git a/Adyen/Security/AesEncryptor.cs b/Adyen/src/Security/AesEncryptor.cs similarity index 100% rename from Adyen/Security/AesEncryptor.cs rename to Adyen/src/Security/AesEncryptor.cs diff --git a/Adyen/Security/EncryptionCredentialDetails.cs b/Adyen/src/Security/EncryptionCredentialDetails.cs similarity index 100% rename from Adyen/Security/EncryptionCredentialDetails.cs rename to Adyen/src/Security/EncryptionCredentialDetails.cs diff --git a/Adyen/Security/EncryptionDerivedKey.cs b/Adyen/src/Security/EncryptionDerivedKey.cs similarity index 100% rename from Adyen/Security/EncryptionDerivedKey.cs rename to Adyen/src/Security/EncryptionDerivedKey.cs diff --git a/Adyen/Security/EncryptionDerivedKeyGenerator.cs b/Adyen/src/Security/EncryptionDerivedKeyGenerator.cs similarity index 100% rename from Adyen/Security/EncryptionDerivedKeyGenerator.cs rename to Adyen/src/Security/EncryptionDerivedKeyGenerator.cs diff --git a/Adyen/Security/Exceptions/NexoCryptoException.cs b/Adyen/src/Security/Exceptions/NexoCryptoException.cs similarity index 100% rename from Adyen/Security/Exceptions/NexoCryptoException.cs rename to Adyen/src/Security/Exceptions/NexoCryptoException.cs diff --git a/Adyen/Security/Extension/ArrayExtension.cs b/Adyen/src/Security/Extension/ArrayExtension.cs similarity index 100% rename from Adyen/Security/Extension/ArrayExtension.cs rename to Adyen/src/Security/Extension/ArrayExtension.cs diff --git a/Adyen/Security/HmacSha256Wrapper.cs b/Adyen/src/Security/HmacSha256Wrapper.cs similarity index 100% rename from Adyen/Security/HmacSha256Wrapper.cs rename to Adyen/src/Security/HmacSha256Wrapper.cs diff --git a/Adyen/Security/IvModGenerator.cs b/Adyen/src/Security/IvModGenerator.cs similarity index 100% rename from Adyen/Security/IvModGenerator.cs rename to Adyen/src/Security/IvModGenerator.cs diff --git a/Adyen/Security/SaleToPoiMessageSecured.cs b/Adyen/src/Security/SaleToPoiMessageSecured.cs similarity index 100% rename from Adyen/Security/SaleToPoiMessageSecured.cs rename to Adyen/src/Security/SaleToPoiMessageSecured.cs diff --git a/Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs b/Adyen/src/Security/SaleToPoiMessageSecuredEncryptor.cs similarity index 100% rename from Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs rename to Adyen/src/Security/SaleToPoiMessageSecuredEncryptor.cs diff --git a/Adyen/Security/SecurityTrailer.cs b/Adyen/src/Security/SecurityTrailer.cs similarity index 100% rename from Adyen/Security/SecurityTrailer.cs rename to Adyen/src/Security/SecurityTrailer.cs diff --git a/Adyen/Security/TerminalCommonNameValidator.cs b/Adyen/src/Security/TerminalCommonNameValidator.cs similarity index 100% rename from Adyen/Security/TerminalCommonNameValidator.cs rename to Adyen/src/Security/TerminalCommonNameValidator.cs diff --git a/Adyen/Service/AbstractService.cs b/Adyen/src/Service/AbstractService.cs similarity index 97% rename from Adyen/Service/AbstractService.cs rename to Adyen/src/Service/AbstractService.cs index 3a89e446a..a6c6e740e 100644 --- a/Adyen/Service/AbstractService.cs +++ b/Adyen/src/Service/AbstractService.cs @@ -1,132 +1,132 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using Adyen.Exceptions; -using Environment = Adyen.Model.Environment; - -namespace Adyen.Service -{ - public class AbstractService - { - public AdyenClient AdyenClient { get; set; } - - private const string PaymentPrefix = "pal-"; - private const string CheckoutPrefix = "checkout-"; - - protected AbstractService(AdyenClient adyenClient) - { - AdyenClient = adyenClient; - } - - /// - /// Build the query string - /// - /// Key, value pairs - /// URL encoded query string - private protected static string ToQueryString(IDictionary queryParams) - { - if (queryParams == null || queryParams.Count == 0) - { - return string.Empty; - } - - var queryString = string.Join("&", - queryParams.Select(kvp => $"{kvp.Key}={HttpUtility.UrlEncode(kvp.Value)}")); - - if (!string.IsNullOrEmpty(queryString)) - { - return "?" + queryString; - } - - return string.Empty; - } - - /// - /// The base URL creation for the environment - /// - /// String - /// baseURL - private protected string CreateBaseUrl(string url) - { - var config = AdyenClient.Config; - return config.Environment == Environment.Live - ? ConstructLiveUrl(config, - url) - : ConstructTestUrl(config, - url); - } - - /// - /// Allow users to override the baseUrl in a test environment - /// - /// Config - /// String - /// baseUrl - private static string ConstructTestUrl(Config config, string url) - { - if (config.BaseUrlConfig == null) return url.Replace("-live", "-test"); - - var baseUrl = config.BaseUrlConfig.BaseUrl; - if (url.Contains(PaymentPrefix) - && !string.IsNullOrEmpty(config.BaseUrlConfig.PaymentUrl)) - { - baseUrl = config.BaseUrlConfig.PaymentUrl; - } else if (url.Contains(CheckoutPrefix) - && !string.IsNullOrEmpty(config.BaseUrlConfig.CheckoutUrl)) - { - baseUrl = config.BaseUrlConfig.CheckoutUrl; - } - - var urlPath = new Uri(url).AbsolutePath; - var returnUrl = new Uri(baseUrl + urlPath).ToString(); - - return returnUrl; - } - - /// - /// Construct live baseUrl - /// - /// Config - /// String - /// baseUrl - /// - private static string ConstructLiveUrl(Config config, string url) - { - // Change base url for Live environment - if (url.Contains(PaymentPrefix)) - { - if (config.LiveEndpointUrlPrefix == default) - { - throw new InvalidOperationException(ExceptionMessages.MissingLiveEndpointUrlPrefix); - } - - url = url.Replace("https://pal-test.adyen.com/pal/servlet/", - "https://" + config.LiveEndpointUrlPrefix + "-pal-live.adyenpayments.com/pal/servlet/"); - } - else if (url.Contains(CheckoutPrefix)) - { - if (config.LiveEndpointUrlPrefix == default) - { - throw new InvalidOperationException(ExceptionMessages.MissingLiveEndpointUrlPrefix); - } - - if (url.Contains("possdk")) - { - url = url.Replace("https://checkout-test.adyen.com/", - "https://" + config.LiveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/"); - } - else - { - url = url.Replace("https://checkout-test.adyen.com/", - "https://" + config.LiveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/"); - } - } - - - // If no prefix is required just replace "test" -> "live" - url = url.Replace("-test", "-live"); - return url; - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using Adyen.Exceptions; +using Environment = Adyen.Model.Environment; + +namespace Adyen.Service +{ + public class AbstractService + { + public AdyenClient AdyenClient { get; set; } + + private const string PaymentPrefix = "pal-"; + private const string CheckoutPrefix = "checkout-"; + + protected AbstractService(AdyenClient adyenClient) + { + AdyenClient = adyenClient; + } + + /// + /// Build the query string + /// + /// Key, value pairs + /// URL encoded query string + private protected static string ToQueryString(IDictionary queryParams) + { + if (queryParams == null || queryParams.Count == 0) + { + return string.Empty; + } + + var queryString = string.Join("&", + queryParams.Select(kvp => $"{kvp.Key}={HttpUtility.UrlEncode(kvp.Value)}")); + + if (!string.IsNullOrEmpty(queryString)) + { + return "?" + queryString; + } + + return string.Empty; + } + + /// + /// The base URL creation for the environment + /// + /// String + /// baseURL + private protected string CreateBaseUrl(string url) + { + var config = AdyenClient.Config; + return config.Environment == Environment.Live + ? ConstructLiveUrl(config, + url) + : ConstructTestUrl(config, + url); + } + + /// + /// Allow users to override the baseUrl in a test environment + /// + /// Config + /// String + /// baseUrl + private static string ConstructTestUrl(Config config, string url) + { + if (config.BaseUrlConfig == null) return url.Replace("-live", "-test"); + + var baseUrl = config.BaseUrlConfig.BaseUrl; + if (url.Contains(PaymentPrefix) + && !string.IsNullOrEmpty(config.BaseUrlConfig.PaymentUrl)) + { + baseUrl = config.BaseUrlConfig.PaymentUrl; + } else if (url.Contains(CheckoutPrefix) + && !string.IsNullOrEmpty(config.BaseUrlConfig.CheckoutUrl)) + { + baseUrl = config.BaseUrlConfig.CheckoutUrl; + } + + var urlPath = new Uri(url).AbsolutePath; + var returnUrl = new Uri(baseUrl + urlPath).ToString(); + + return returnUrl; + } + + /// + /// Construct live baseUrl + /// + /// Config + /// String + /// baseUrl + /// + private static string ConstructLiveUrl(Config config, string url) + { + // Change base url for Live environment + if (url.Contains(PaymentPrefix)) + { + if (config.LiveEndpointUrlPrefix == default) + { + throw new InvalidOperationException(ExceptionMessages.MissingLiveEndpointUrlPrefix); + } + + url = url.Replace("https://pal-test.adyen.com/pal/servlet/", + "https://" + config.LiveEndpointUrlPrefix + "-pal-live.adyenpayments.com/pal/servlet/"); + } + else if (url.Contains(CheckoutPrefix)) + { + if (config.LiveEndpointUrlPrefix == default) + { + throw new InvalidOperationException(ExceptionMessages.MissingLiveEndpointUrlPrefix); + } + + if (url.Contains("possdk")) + { + url = url.Replace("https://checkout-test.adyen.com/", + "https://" + config.LiveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/"); + } + else + { + url = url.Replace("https://checkout-test.adyen.com/", + "https://" + config.LiveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/"); + } + } + + + // If no prefix is required just replace "test" -> "live" + url = url.Replace("-test", "-live"); + return url; + } + } } \ No newline at end of file diff --git a/Adyen/Service/ApiException.cs b/Adyen/src/Service/ApiException.cs similarity index 95% rename from Adyen/Service/ApiException.cs rename to Adyen/src/Service/ApiException.cs index 5c687f468..b254228f3 100644 --- a/Adyen/Service/ApiException.cs +++ b/Adyen/src/Service/ApiException.cs @@ -1,18 +1,18 @@ -using System; -using Adyen.Model; - -namespace Adyen.Service -{ - public class ApiException:Exception - { - public int StatusCode { get; set; } - - public ApiError ApiError{ get; set; } - - public ApiException(int statusCode,string message) - :base(message) - { - StatusCode = statusCode; - } - } -} +using System; +using Adyen.Model; + +namespace Adyen.Service +{ + public class ApiException:Exception + { + public int StatusCode { get; set; } + + public ApiError ApiError{ get; set; } + + public ApiException(int statusCode,string message) + :base(message) + { + StatusCode = statusCode; + } + } +} diff --git a/Adyen/Service/BalanceControlService.cs b/Adyen/src/Service/BalanceControlService.cs similarity index 100% rename from Adyen/Service/BalanceControlService.cs rename to Adyen/src/Service/BalanceControlService.cs diff --git a/Adyen/Service/BalancePlatform/AccountHoldersService.cs b/Adyen/src/Service/BalancePlatform/AccountHoldersService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/AccountHoldersService.cs rename to Adyen/src/Service/BalancePlatform/AccountHoldersService.cs diff --git a/Adyen/Service/BalancePlatform/BalanceAccountsService.cs b/Adyen/src/Service/BalancePlatform/BalanceAccountsService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/BalanceAccountsService.cs rename to Adyen/src/Service/BalancePlatform/BalanceAccountsService.cs diff --git a/Adyen/Service/BalancePlatform/BankAccountValidationService.cs b/Adyen/src/Service/BalancePlatform/BankAccountValidationService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/BankAccountValidationService.cs rename to Adyen/src/Service/BalancePlatform/BankAccountValidationService.cs diff --git a/Adyen/Service/BalancePlatform/CardOrdersService.cs b/Adyen/src/Service/BalancePlatform/CardOrdersService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/CardOrdersService.cs rename to Adyen/src/Service/BalancePlatform/CardOrdersService.cs diff --git a/Adyen/Service/BalancePlatform/GrantAccountsService.cs b/Adyen/src/Service/BalancePlatform/GrantAccountsService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/GrantAccountsService.cs rename to Adyen/src/Service/BalancePlatform/GrantAccountsService.cs diff --git a/Adyen/Service/BalancePlatform/GrantOffersService.cs b/Adyen/src/Service/BalancePlatform/GrantOffersService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/GrantOffersService.cs rename to Adyen/src/Service/BalancePlatform/GrantOffersService.cs diff --git a/Adyen/Service/BalancePlatform/ManageCardPINService.cs b/Adyen/src/Service/BalancePlatform/ManageCardPINService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/ManageCardPINService.cs rename to Adyen/src/Service/BalancePlatform/ManageCardPINService.cs diff --git a/Adyen/Service/BalancePlatform/ManageSCADevicesService.cs b/Adyen/src/Service/BalancePlatform/ManageSCADevicesService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/ManageSCADevicesService.cs rename to Adyen/src/Service/BalancePlatform/ManageSCADevicesService.cs diff --git a/Adyen/Service/BalancePlatform/NetworkTokensService.cs b/Adyen/src/Service/BalancePlatform/NetworkTokensService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/NetworkTokensService.cs rename to Adyen/src/Service/BalancePlatform/NetworkTokensService.cs diff --git a/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs b/Adyen/src/Service/BalancePlatform/PaymentInstrumentGroupsService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs rename to Adyen/src/Service/BalancePlatform/PaymentInstrumentGroupsService.cs diff --git a/Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs b/Adyen/src/Service/BalancePlatform/PaymentInstrumentsService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs rename to Adyen/src/Service/BalancePlatform/PaymentInstrumentsService.cs diff --git a/Adyen/Service/BalancePlatform/PlatformService.cs b/Adyen/src/Service/BalancePlatform/PlatformService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/PlatformService.cs rename to Adyen/src/Service/BalancePlatform/PlatformService.cs diff --git a/Adyen/Service/BalancePlatform/TransactionRulesService.cs b/Adyen/src/Service/BalancePlatform/TransactionRulesService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/TransactionRulesService.cs rename to Adyen/src/Service/BalancePlatform/TransactionRulesService.cs diff --git a/Adyen/Service/BalancePlatform/TransferRoutesService.cs b/Adyen/src/Service/BalancePlatform/TransferRoutesService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/TransferRoutesService.cs rename to Adyen/src/Service/BalancePlatform/TransferRoutesService.cs diff --git a/Adyen/Service/BinLookupService.cs b/Adyen/src/Service/BinLookupService.cs similarity index 100% rename from Adyen/Service/BinLookupService.cs rename to Adyen/src/Service/BinLookupService.cs diff --git a/Adyen/Service/Checkout/DonationsService.cs b/Adyen/src/Service/Checkout/DonationsService.cs similarity index 100% rename from Adyen/Service/Checkout/DonationsService.cs rename to Adyen/src/Service/Checkout/DonationsService.cs diff --git a/Adyen/Service/Checkout/ModificationsService.cs b/Adyen/src/Service/Checkout/ModificationsService.cs similarity index 100% rename from Adyen/Service/Checkout/ModificationsService.cs rename to Adyen/src/Service/Checkout/ModificationsService.cs diff --git a/Adyen/Service/Checkout/OrdersService.cs b/Adyen/src/Service/Checkout/OrdersService.cs similarity index 100% rename from Adyen/Service/Checkout/OrdersService.cs rename to Adyen/src/Service/Checkout/OrdersService.cs diff --git a/Adyen/Service/Checkout/PaymentLinksService.cs b/Adyen/src/Service/Checkout/PaymentLinksService.cs similarity index 100% rename from Adyen/Service/Checkout/PaymentLinksService.cs rename to Adyen/src/Service/Checkout/PaymentLinksService.cs diff --git a/Adyen/Service/Checkout/PaymentsService.cs b/Adyen/src/Service/Checkout/PaymentsService.cs similarity index 100% rename from Adyen/Service/Checkout/PaymentsService.cs rename to Adyen/src/Service/Checkout/PaymentsService.cs diff --git a/Adyen/Service/Checkout/RecurringService.cs b/Adyen/src/Service/Checkout/RecurringService.cs similarity index 100% rename from Adyen/Service/Checkout/RecurringService.cs rename to Adyen/src/Service/Checkout/RecurringService.cs diff --git a/Adyen/Service/Checkout/UtilityService.cs b/Adyen/src/Service/Checkout/UtilityService.cs similarity index 100% rename from Adyen/Service/Checkout/UtilityService.cs rename to Adyen/src/Service/Checkout/UtilityService.cs diff --git a/Adyen/Service/DataProtectionService.cs b/Adyen/src/Service/DataProtectionService.cs similarity index 100% rename from Adyen/Service/DataProtectionService.cs rename to Adyen/src/Service/DataProtectionService.cs diff --git a/Adyen/Service/DisputesService.cs b/Adyen/src/Service/DisputesService.cs similarity index 100% rename from Adyen/Service/DisputesService.cs rename to Adyen/src/Service/DisputesService.cs diff --git a/Adyen/Service/LegalEntityManagement/BusinessLinesService.cs b/Adyen/src/Service/LegalEntityManagement/BusinessLinesService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/BusinessLinesService.cs rename to Adyen/src/Service/LegalEntityManagement/BusinessLinesService.cs diff --git a/Adyen/Service/LegalEntityManagement/DocumentsService.cs b/Adyen/src/Service/LegalEntityManagement/DocumentsService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/DocumentsService.cs rename to Adyen/src/Service/LegalEntityManagement/DocumentsService.cs diff --git a/Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs b/Adyen/src/Service/LegalEntityManagement/HostedOnboardingService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs rename to Adyen/src/Service/LegalEntityManagement/HostedOnboardingService.cs diff --git a/Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs b/Adyen/src/Service/LegalEntityManagement/LegalEntitiesService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs rename to Adyen/src/Service/LegalEntityManagement/LegalEntitiesService.cs diff --git a/Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs b/Adyen/src/Service/LegalEntityManagement/PCIQuestionnairesService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs rename to Adyen/src/Service/LegalEntityManagement/PCIQuestionnairesService.cs diff --git a/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs b/Adyen/src/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs rename to Adyen/src/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs diff --git a/Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs b/Adyen/src/Service/LegalEntityManagement/TermsOfServiceService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs rename to Adyen/src/Service/LegalEntityManagement/TermsOfServiceService.cs diff --git a/Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs b/Adyen/src/Service/LegalEntityManagement/TransferInstrumentsService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs rename to Adyen/src/Service/LegalEntityManagement/TransferInstrumentsService.cs diff --git a/Adyen/Service/Management/APICredentialsCompanyLevelService.cs b/Adyen/src/Service/Management/APICredentialsCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/APICredentialsCompanyLevelService.cs rename to Adyen/src/Service/Management/APICredentialsCompanyLevelService.cs diff --git a/Adyen/Service/Management/APICredentialsMerchantLevelService.cs b/Adyen/src/Service/Management/APICredentialsMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/APICredentialsMerchantLevelService.cs rename to Adyen/src/Service/Management/APICredentialsMerchantLevelService.cs diff --git a/Adyen/Service/Management/APIKeyCompanyLevelService.cs b/Adyen/src/Service/Management/APIKeyCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/APIKeyCompanyLevelService.cs rename to Adyen/src/Service/Management/APIKeyCompanyLevelService.cs diff --git a/Adyen/Service/Management/APIKeyMerchantLevelService.cs b/Adyen/src/Service/Management/APIKeyMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/APIKeyMerchantLevelService.cs rename to Adyen/src/Service/Management/APIKeyMerchantLevelService.cs diff --git a/Adyen/Service/Management/AccountCompanyLevelService.cs b/Adyen/src/Service/Management/AccountCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/AccountCompanyLevelService.cs rename to Adyen/src/Service/Management/AccountCompanyLevelService.cs diff --git a/Adyen/Service/Management/AccountMerchantLevelService.cs b/Adyen/src/Service/Management/AccountMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/AccountMerchantLevelService.cs rename to Adyen/src/Service/Management/AccountMerchantLevelService.cs diff --git a/Adyen/Service/Management/AccountStoreLevelService.cs b/Adyen/src/Service/Management/AccountStoreLevelService.cs similarity index 100% rename from Adyen/Service/Management/AccountStoreLevelService.cs rename to Adyen/src/Service/Management/AccountStoreLevelService.cs diff --git a/Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs b/Adyen/src/Service/Management/AllowedOriginsCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs rename to Adyen/src/Service/Management/AllowedOriginsCompanyLevelService.cs diff --git a/Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs b/Adyen/src/Service/Management/AllowedOriginsMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs rename to Adyen/src/Service/Management/AllowedOriginsMerchantLevelService.cs diff --git a/Adyen/Service/Management/AndroidFilesCompanyLevelService.cs b/Adyen/src/Service/Management/AndroidFilesCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/AndroidFilesCompanyLevelService.cs rename to Adyen/src/Service/Management/AndroidFilesCompanyLevelService.cs diff --git a/Adyen/Service/Management/ClientKeyCompanyLevelService.cs b/Adyen/src/Service/Management/ClientKeyCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/ClientKeyCompanyLevelService.cs rename to Adyen/src/Service/Management/ClientKeyCompanyLevelService.cs diff --git a/Adyen/Service/Management/ClientKeyMerchantLevelService.cs b/Adyen/src/Service/Management/ClientKeyMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/ClientKeyMerchantLevelService.cs rename to Adyen/src/Service/Management/ClientKeyMerchantLevelService.cs diff --git a/Adyen/Service/Management/MyAPICredentialService.cs b/Adyen/src/Service/Management/MyAPICredentialService.cs similarity index 100% rename from Adyen/Service/Management/MyAPICredentialService.cs rename to Adyen/src/Service/Management/MyAPICredentialService.cs diff --git a/Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs b/Adyen/src/Service/Management/PaymentMethodsMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs rename to Adyen/src/Service/Management/PaymentMethodsMerchantLevelService.cs diff --git a/Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs b/Adyen/src/Service/Management/PayoutSettingsMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs rename to Adyen/src/Service/Management/PayoutSettingsMerchantLevelService.cs diff --git a/Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs b/Adyen/src/Service/Management/SplitConfigurationMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs rename to Adyen/src/Service/Management/SplitConfigurationMerchantLevelService.cs diff --git a/Adyen/Service/Management/TerminalActionsCompanyLevelService.cs b/Adyen/src/Service/Management/TerminalActionsCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalActionsCompanyLevelService.cs rename to Adyen/src/Service/Management/TerminalActionsCompanyLevelService.cs diff --git a/Adyen/Service/Management/TerminalActionsTerminalLevelService.cs b/Adyen/src/Service/Management/TerminalActionsTerminalLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalActionsTerminalLevelService.cs rename to Adyen/src/Service/Management/TerminalActionsTerminalLevelService.cs diff --git a/Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs b/Adyen/src/Service/Management/TerminalOrdersCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs rename to Adyen/src/Service/Management/TerminalOrdersCompanyLevelService.cs diff --git a/Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs b/Adyen/src/Service/Management/TerminalOrdersMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs rename to Adyen/src/Service/Management/TerminalOrdersMerchantLevelService.cs diff --git a/Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs b/Adyen/src/Service/Management/TerminalSettingsCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs rename to Adyen/src/Service/Management/TerminalSettingsCompanyLevelService.cs diff --git a/Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs b/Adyen/src/Service/Management/TerminalSettingsMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs rename to Adyen/src/Service/Management/TerminalSettingsMerchantLevelService.cs diff --git a/Adyen/Service/Management/TerminalSettingsStoreLevelService.cs b/Adyen/src/Service/Management/TerminalSettingsStoreLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalSettingsStoreLevelService.cs rename to Adyen/src/Service/Management/TerminalSettingsStoreLevelService.cs diff --git a/Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs b/Adyen/src/Service/Management/TerminalSettingsTerminalLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs rename to Adyen/src/Service/Management/TerminalSettingsTerminalLevelService.cs diff --git a/Adyen/Service/Management/TerminalsTerminalLevelService.cs b/Adyen/src/Service/Management/TerminalsTerminalLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalsTerminalLevelService.cs rename to Adyen/src/Service/Management/TerminalsTerminalLevelService.cs diff --git a/Adyen/Service/Management/UsersCompanyLevelService.cs b/Adyen/src/Service/Management/UsersCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/UsersCompanyLevelService.cs rename to Adyen/src/Service/Management/UsersCompanyLevelService.cs diff --git a/Adyen/Service/Management/UsersMerchantLevelService.cs b/Adyen/src/Service/Management/UsersMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/UsersMerchantLevelService.cs rename to Adyen/src/Service/Management/UsersMerchantLevelService.cs diff --git a/Adyen/Service/Management/WebhooksCompanyLevelService.cs b/Adyen/src/Service/Management/WebhooksCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/WebhooksCompanyLevelService.cs rename to Adyen/src/Service/Management/WebhooksCompanyLevelService.cs diff --git a/Adyen/Service/Management/WebhooksMerchantLevelService.cs b/Adyen/src/Service/Management/WebhooksMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/WebhooksMerchantLevelService.cs rename to Adyen/src/Service/Management/WebhooksMerchantLevelService.cs diff --git a/Adyen/Service/PaymentService.cs b/Adyen/src/Service/PaymentService.cs similarity index 100% rename from Adyen/Service/PaymentService.cs rename to Adyen/src/Service/PaymentService.cs diff --git a/Adyen/Service/PaymentsAppService.cs b/Adyen/src/Service/PaymentsAppService.cs similarity index 100% rename from Adyen/Service/PaymentsAppService.cs rename to Adyen/src/Service/PaymentsAppService.cs diff --git a/Adyen/Service/Payout/InitializationService.cs b/Adyen/src/Service/Payout/InitializationService.cs similarity index 100% rename from Adyen/Service/Payout/InitializationService.cs rename to Adyen/src/Service/Payout/InitializationService.cs diff --git a/Adyen/Service/Payout/InstantPayoutsService.cs b/Adyen/src/Service/Payout/InstantPayoutsService.cs similarity index 100% rename from Adyen/Service/Payout/InstantPayoutsService.cs rename to Adyen/src/Service/Payout/InstantPayoutsService.cs diff --git a/Adyen/Service/Payout/ReviewingService.cs b/Adyen/src/Service/Payout/ReviewingService.cs similarity index 100% rename from Adyen/Service/Payout/ReviewingService.cs rename to Adyen/src/Service/Payout/ReviewingService.cs diff --git a/Adyen/Service/PlatformsAccount/AccountHoldersService.cs b/Adyen/src/Service/PlatformsAccount/AccountHoldersService.cs similarity index 100% rename from Adyen/Service/PlatformsAccount/AccountHoldersService.cs rename to Adyen/src/Service/PlatformsAccount/AccountHoldersService.cs diff --git a/Adyen/Service/PlatformsAccount/AccountsService.cs b/Adyen/src/Service/PlatformsAccount/AccountsService.cs similarity index 100% rename from Adyen/Service/PlatformsAccount/AccountsService.cs rename to Adyen/src/Service/PlatformsAccount/AccountsService.cs diff --git a/Adyen/Service/PlatformsAccount/VerificationService.cs b/Adyen/src/Service/PlatformsAccount/VerificationService.cs similarity index 100% rename from Adyen/Service/PlatformsAccount/VerificationService.cs rename to Adyen/src/Service/PlatformsAccount/VerificationService.cs diff --git a/Adyen/Service/PlatformsFundService.cs b/Adyen/src/Service/PlatformsFundService.cs similarity index 100% rename from Adyen/Service/PlatformsFundService.cs rename to Adyen/src/Service/PlatformsFundService.cs diff --git a/Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs b/Adyen/src/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs similarity index 100% rename from Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs rename to Adyen/src/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs diff --git a/Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs b/Adyen/src/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs similarity index 100% rename from Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs rename to Adyen/src/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs diff --git a/Adyen/Service/PlatformsNotificationConfigurationService.cs b/Adyen/src/Service/PlatformsNotificationConfigurationService.cs similarity index 100% rename from Adyen/Service/PlatformsNotificationConfigurationService.cs rename to Adyen/src/Service/PlatformsNotificationConfigurationService.cs diff --git a/Adyen/Service/PosMobileService.cs b/Adyen/src/Service/PosMobileService.cs similarity index 100% rename from Adyen/Service/PosMobileService.cs rename to Adyen/src/Service/PosMobileService.cs diff --git a/Adyen/Service/PosTerminalManagementService.cs b/Adyen/src/Service/PosTerminalManagementService.cs similarity index 100% rename from Adyen/Service/PosTerminalManagementService.cs rename to Adyen/src/Service/PosTerminalManagementService.cs diff --git a/Adyen/Service/RecurringService.cs b/Adyen/src/Service/RecurringService.cs similarity index 100% rename from Adyen/Service/RecurringService.cs rename to Adyen/src/Service/RecurringService.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApi.cs b/Adyen/src/Service/Resource/Terminal/TerminalApi.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApi.cs rename to Adyen/src/Service/Resource/Terminal/TerminalApi.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs b/Adyen/src/Service/Resource/Terminal/TerminalApiAsyncClient.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs rename to Adyen/src/Service/Resource/Terminal/TerminalApiAsyncClient.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApiLocal.cs b/Adyen/src/Service/Resource/Terminal/TerminalApiLocal.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApiLocal.cs rename to Adyen/src/Service/Resource/Terminal/TerminalApiLocal.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs b/Adyen/src/Service/Resource/Terminal/TerminalApiLocalClient.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs rename to Adyen/src/Service/Resource/Terminal/TerminalApiLocalClient.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs b/Adyen/src/Service/Resource/Terminal/TerminalApiSyncClient.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs rename to Adyen/src/Service/Resource/Terminal/TerminalApiSyncClient.cs diff --git a/Adyen/Service/ServiceResource.cs b/Adyen/src/Service/ServiceResource.cs similarity index 97% rename from Adyen/Service/ServiceResource.cs rename to Adyen/src/Service/ServiceResource.cs index fd4dadb6e..43f161a92 100644 --- a/Adyen/Service/ServiceResource.cs +++ b/Adyen/src/Service/ServiceResource.cs @@ -1,46 +1,46 @@ -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using Adyen.Model; -using Newtonsoft.Json; - -namespace Adyen.Service -{ - public class ServiceResource - { - private readonly AbstractService _abstractService; - protected string Endpoint; - - public ServiceResource(AbstractService abstractService, string endpoint) - { - _abstractService = abstractService; - Endpoint = endpoint; - } - - public string Request(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null) - { - var clientInterface = _abstractService.AdyenClient.HttpClient; - return clientInterface.Request(Endpoint, json, requestOptions, httpMethod); - } - - public T Request(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null) - { - var clientInterface = _abstractService.AdyenClient.HttpClient; - var jsonResponse = clientInterface.Request(Endpoint, json, requestOptions, httpMethod); - return JsonConvert.DeserializeObject(jsonResponse); - } - - public async Task RequestAsync(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null, CancellationToken cancellationToken = default) - { - var clientInterface = _abstractService.AdyenClient.HttpClient; - return await clientInterface.RequestAsync(Endpoint, json, requestOptions, httpMethod, cancellationToken).ConfigureAwait(false); - } - - public async Task RequestAsync(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null, CancellationToken cancellationToken = default) - { - var clientInterface = _abstractService.AdyenClient.HttpClient; - var jsonResponse = await clientInterface.RequestAsync(Endpoint, json, requestOptions, httpMethod, cancellationToken).ConfigureAwait(false); - return JsonConvert.DeserializeObject(jsonResponse); - } - } +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Adyen.Model; +using Newtonsoft.Json; + +namespace Adyen.Service +{ + public class ServiceResource + { + private readonly AbstractService _abstractService; + protected string Endpoint; + + public ServiceResource(AbstractService abstractService, string endpoint) + { + _abstractService = abstractService; + Endpoint = endpoint; + } + + public string Request(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null) + { + var clientInterface = _abstractService.AdyenClient.HttpClient; + return clientInterface.Request(Endpoint, json, requestOptions, httpMethod); + } + + public T Request(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null) + { + var clientInterface = _abstractService.AdyenClient.HttpClient; + var jsonResponse = clientInterface.Request(Endpoint, json, requestOptions, httpMethod); + return JsonConvert.DeserializeObject(jsonResponse); + } + + public async Task RequestAsync(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null, CancellationToken cancellationToken = default) + { + var clientInterface = _abstractService.AdyenClient.HttpClient; + return await clientInterface.RequestAsync(Endpoint, json, requestOptions, httpMethod, cancellationToken).ConfigureAwait(false); + } + + public async Task RequestAsync(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null, CancellationToken cancellationToken = default) + { + var clientInterface = _abstractService.AdyenClient.HttpClient; + var jsonResponse = await clientInterface.RequestAsync(Endpoint, json, requestOptions, httpMethod, cancellationToken).ConfigureAwait(false); + return JsonConvert.DeserializeObject(jsonResponse); + } + } } \ No newline at end of file diff --git a/Adyen/Service/StoredValueService.cs b/Adyen/src/Service/StoredValueService.cs similarity index 100% rename from Adyen/Service/StoredValueService.cs rename to Adyen/src/Service/StoredValueService.cs diff --git a/Adyen/Service/TerminalApiAsyncService.cs b/Adyen/src/Service/TerminalApiAsyncService.cs similarity index 100% rename from Adyen/Service/TerminalApiAsyncService.cs rename to Adyen/src/Service/TerminalApiAsyncService.cs diff --git a/Adyen/Service/TerminalApiLocalService.cs b/Adyen/src/Service/TerminalApiLocalService.cs similarity index 100% rename from Adyen/Service/TerminalApiLocalService.cs rename to Adyen/src/Service/TerminalApiLocalService.cs diff --git a/Adyen/Service/TerminalApiSyncService.cs b/Adyen/src/Service/TerminalApiSyncService.cs similarity index 100% rename from Adyen/Service/TerminalApiSyncService.cs rename to Adyen/src/Service/TerminalApiSyncService.cs diff --git a/Adyen/Service/TerminalCloudApi.cs b/Adyen/src/Service/TerminalCloudApi.cs similarity index 100% rename from Adyen/Service/TerminalCloudApi.cs rename to Adyen/src/Service/TerminalCloudApi.cs diff --git a/Adyen/Service/TerminalLocalApi.cs b/Adyen/src/Service/TerminalLocalApi.cs similarity index 100% rename from Adyen/Service/TerminalLocalApi.cs rename to Adyen/src/Service/TerminalLocalApi.cs diff --git a/Adyen/Service/TerminalLocalApiUnencrypted.cs b/Adyen/src/Service/TerminalLocalApiUnencrypted.cs similarity index 100% rename from Adyen/Service/TerminalLocalApiUnencrypted.cs rename to Adyen/src/Service/TerminalLocalApiUnencrypted.cs diff --git a/Adyen/Service/Transfers/CapitalService.cs b/Adyen/src/Service/Transfers/CapitalService.cs similarity index 100% rename from Adyen/Service/Transfers/CapitalService.cs rename to Adyen/src/Service/Transfers/CapitalService.cs diff --git a/Adyen/Service/Transfers/TransactionsService.cs b/Adyen/src/Service/Transfers/TransactionsService.cs similarity index 100% rename from Adyen/Service/Transfers/TransactionsService.cs rename to Adyen/src/Service/Transfers/TransactionsService.cs diff --git a/Adyen/Service/Transfers/TransfersService.cs b/Adyen/src/Service/Transfers/TransfersService.cs similarity index 100% rename from Adyen/Service/Transfers/TransfersService.cs rename to Adyen/src/Service/Transfers/TransfersService.cs diff --git a/Adyen/Util/ByteArrayConverter.cs b/Adyen/src/Util/ByteArrayConverter.cs similarity index 100% rename from Adyen/Util/ByteArrayConverter.cs rename to Adyen/src/Util/ByteArrayConverter.cs diff --git a/Adyen/Util/HMACValidator.cs b/Adyen/src/Util/HMACValidator.cs similarity index 97% rename from Adyen/Util/HMACValidator.cs rename to Adyen/src/Util/HMACValidator.cs index b3da7fc34..150f68e52 100644 --- a/Adyen/Util/HMACValidator.cs +++ b/Adyen/src/Util/HMACValidator.cs @@ -1,123 +1,123 @@ -using System; -using System.Collections.Generic; -using System.Security.Cryptography; -using System.Text; -using Adyen.Model.Notification; - -namespace Adyen.Util -{ - public class HmacValidator - { - private const string HmacSignature = "hmacSignature"; - - // Computes the Base64 encoded signature using the HMAC algorithm with the HMACSHA256 hashing function. - public string CalculateHmac(string payload, string hmacKey) - { - byte[] key = PackH(hmacKey); - byte[] data = Encoding.UTF8.GetBytes(payload); - - try - { - using (HMACSHA256 hmac = new HMACSHA256(key)) - { - // Compute the hmac on input data bytes - byte[] rawHmac = hmac.ComputeHash(data); - - // Base64-encode the hmac - return Convert.ToBase64String(rawHmac); - } - } - catch (Exception e) - { - throw new Exception("Failed to generate HMAC : " + e.Message); - } - } - - public string CalculateHmac(NotificationRequestItem notificationRequestItem, string hmacKey) - { - var notificationRequestItemData = GetDataToSign(notificationRequestItem); - return CalculateHmac(notificationRequestItemData, hmacKey); - } - - private byte[] PackH(string hex) - { - if ((hex.Length % 2) == 1) - { - hex += '0'; - } - - byte[] bytes = new byte[hex.Length / 2]; - for (int i = 0; i < hex.Length; i += 2) - { - bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16); - } - - return bytes; - } - - public string GetDataToSign(NotificationRequestItem notificationRequestItem) - { - var amount = notificationRequestItem.Amount; - var signedDataList = new List - { - notificationRequestItem.PspReference, - notificationRequestItem.OriginalReference, - notificationRequestItem.MerchantAccountCode, - notificationRequestItem.MerchantReference, - Convert.ToString(amount.Value), - amount.Currency, - notificationRequestItem.EventCode, - notificationRequestItem.Success.ToString().ToLower() - }; - return String.Join(":", signedDataList); - } - - /// - /// Validates a regular webhook with the given . - /// - /// . - /// The HMAC key, retrieved from the Adyen Customer Area. - /// A return value indicates the HMAC validation succeeded. - public bool IsValidHmac(NotificationRequestItem notificationRequestItem, string hmacKey) - { - if (notificationRequestItem.AdditionalData == null) - { - return false; - } - - if (!notificationRequestItem.AdditionalData.ContainsKey(HmacSignature)) - { - return false; - } - var expectedSign = CalculateHmac(notificationRequestItem, hmacKey); - var merchantSign = notificationRequestItem.AdditionalData[HmacSignature]; - return string.Equals(expectedSign, merchantSign); - } - - - /// - /// Validates a balance platform and management webhook payload with the given and . - /// - /// The HMAC signature, retrieved from the request header. - /// The HMAC key, retrieved from the Adyen Customer Area. - /// The webhook payload. - /// A return value indicates the HMAC validation succeeded. - public bool IsValidWebhook(string hmacSignature, string hmacKey, string payload) - { - var calculatedSign = CalculateHmac(payload, hmacKey); - return TimeSafeEquals(Encoding.UTF8.GetBytes(hmacSignature), Encoding.UTF8.GetBytes(calculatedSign)); - } - - /// - /// This method compares two bytestrings in constant time based on length of shortest bytestring to prevent timing attacks. - /// - /// True if different. - private static bool TimeSafeEquals(byte[] a, byte[] b) - { - uint diff = (uint)a.Length ^ (uint)b.Length; - for (int i = 0; i < a.Length && i < b.Length; i++) { diff |= (uint)(a[i] ^ b[i]); } - return diff == 0; - } - } -} - +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using System.Text; +using Adyen.Model.Notification; + +namespace Adyen.Util +{ + public class HmacValidator + { + private const string HmacSignature = "hmacSignature"; + + // Computes the Base64 encoded signature using the HMAC algorithm with the HMACSHA256 hashing function. + public string CalculateHmac(string payload, string hmacKey) + { + byte[] key = PackH(hmacKey); + byte[] data = Encoding.UTF8.GetBytes(payload); + + try + { + using (HMACSHA256 hmac = new HMACSHA256(key)) + { + // Compute the hmac on input data bytes + byte[] rawHmac = hmac.ComputeHash(data); + + // Base64-encode the hmac + return Convert.ToBase64String(rawHmac); + } + } + catch (Exception e) + { + throw new Exception("Failed to generate HMAC : " + e.Message); + } + } + + public string CalculateHmac(NotificationRequestItem notificationRequestItem, string hmacKey) + { + var notificationRequestItemData = GetDataToSign(notificationRequestItem); + return CalculateHmac(notificationRequestItemData, hmacKey); + } + + private byte[] PackH(string hex) + { + if ((hex.Length % 2) == 1) + { + hex += '0'; + } + + byte[] bytes = new byte[hex.Length / 2]; + for (int i = 0; i < hex.Length; i += 2) + { + bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16); + } + + return bytes; + } + + public string GetDataToSign(NotificationRequestItem notificationRequestItem) + { + var amount = notificationRequestItem.Amount; + var signedDataList = new List + { + notificationRequestItem.PspReference, + notificationRequestItem.OriginalReference, + notificationRequestItem.MerchantAccountCode, + notificationRequestItem.MerchantReference, + Convert.ToString(amount.Value), + amount.Currency, + notificationRequestItem.EventCode, + notificationRequestItem.Success.ToString().ToLower() + }; + return String.Join(":", signedDataList); + } + + /// + /// Validates a regular webhook with the given . + /// + /// . + /// The HMAC key, retrieved from the Adyen Customer Area. + /// A return value indicates the HMAC validation succeeded. + public bool IsValidHmac(NotificationRequestItem notificationRequestItem, string hmacKey) + { + if (notificationRequestItem.AdditionalData == null) + { + return false; + } + + if (!notificationRequestItem.AdditionalData.ContainsKey(HmacSignature)) + { + return false; + } + var expectedSign = CalculateHmac(notificationRequestItem, hmacKey); + var merchantSign = notificationRequestItem.AdditionalData[HmacSignature]; + return string.Equals(expectedSign, merchantSign); + } + + + /// + /// Validates a balance platform and management webhook payload with the given and . + /// + /// The HMAC signature, retrieved from the request header. + /// The HMAC key, retrieved from the Adyen Customer Area. + /// The webhook payload. + /// A return value indicates the HMAC validation succeeded. + public bool IsValidWebhook(string hmacSignature, string hmacKey, string payload) + { + var calculatedSign = CalculateHmac(payload, hmacKey); + return TimeSafeEquals(Encoding.UTF8.GetBytes(hmacSignature), Encoding.UTF8.GetBytes(calculatedSign)); + } + + /// + /// This method compares two bytestrings in constant time based on length of shortest bytestring to prevent timing attacks. + /// + /// True if different. + private static bool TimeSafeEquals(byte[] a, byte[] b) + { + uint diff = (uint)a.Length ^ (uint)b.Length; + for (int i = 0; i < a.Length && i < b.Length; i++) { diff |= (uint)(a[i] ^ b[i]); } + return diff == 0; + } + } +} + diff --git a/Adyen/Util/JsonOperation.cs b/Adyen/src/Util/JsonOperation.cs similarity index 97% rename from Adyen/Util/JsonOperation.cs rename to Adyen/src/Util/JsonOperation.cs index cfee35d6f..4cefb5981 100644 --- a/Adyen/Util/JsonOperation.cs +++ b/Adyen/src/Util/JsonOperation.cs @@ -1,32 +1,32 @@ -using Newtonsoft.Json; - -namespace Adyen.Util -{ - public class JsonOperation - { - /// - /// Deserialize to an object T - /// - /// - /// - /// - public static T Deserialize(string response) - { - var jsonSettings = new JsonSerializerSettings(); - jsonSettings.Converters.Add(new ByteArrayConverter()); - - return JsonConvert.DeserializeObject(response, jsonSettings); - } - - public static string SerializeRequest(object request) - { - var jsonSettings = new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Include, - }; - jsonSettings.Converters.Add(new ByteArrayConverter()); - return JsonConvert.SerializeObject(request, Formatting.None, jsonSettings); - } - } -} +using Newtonsoft.Json; + +namespace Adyen.Util +{ + public class JsonOperation + { + /// + /// Deserialize to an object T + /// + /// + /// + /// + public static T Deserialize(string response) + { + var jsonSettings = new JsonSerializerSettings(); + jsonSettings.Converters.Add(new ByteArrayConverter()); + + return JsonConvert.DeserializeObject(response, jsonSettings); + } + + public static string SerializeRequest(object request) + { + var jsonSettings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + DefaultValueHandling = DefaultValueHandling.Include, + }; + jsonSettings.Converters.Add(new ByteArrayConverter()); + return JsonConvert.SerializeObject(request, Formatting.None, jsonSettings); + } + } +} diff --git a/Adyen/Util/TerminalApi/AdditionalResponse.cs b/Adyen/src/Util/TerminalApi/AdditionalResponse.cs similarity index 100% rename from Adyen/Util/TerminalApi/AdditionalResponse.cs rename to Adyen/src/Util/TerminalApi/AdditionalResponse.cs diff --git a/Adyen/Util/TerminalApi/CardAcquisitionUtil.cs b/Adyen/src/Util/TerminalApi/CardAcquisitionUtil.cs similarity index 100% rename from Adyen/Util/TerminalApi/CardAcquisitionUtil.cs rename to Adyen/src/Util/TerminalApi/CardAcquisitionUtil.cs diff --git a/Adyen/Util/Util.cs b/Adyen/src/Util/Util.cs similarity index 95% rename from Adyen/Util/Util.cs rename to Adyen/src/Util/Util.cs index 710fd1a85..6da184eee 100644 --- a/Adyen/Util/Util.cs +++ b/Adyen/src/Util/Util.cs @@ -1,15 +1,15 @@ -using System; - -namespace Adyen.Util -{ - public class Util - { - public static string CalculateSessionValidity() - { - //+1day - var dateTime=DateTime.Now.AddDays(1); - return String.Format("{0:s}", dateTime); - - } - } -} +using System; + +namespace Adyen.Util +{ + public class Util + { + public static string CalculateSessionValidity() + { + //+1day + var dateTime=DateTime.Now.AddDays(1); + return String.Format("{0:s}", dateTime); + + } + } +} diff --git a/Adyen/Webhooks/BalancePlatformWebhookHandler.cs b/Adyen/src/Webhooks/BalancePlatformWebhookHandler.cs similarity index 100% rename from Adyen/Webhooks/BalancePlatformWebhookHandler.cs rename to Adyen/src/Webhooks/BalancePlatformWebhookHandler.cs diff --git a/Adyen/Webhooks/ClassicPlatformWebhookHandler.cs b/Adyen/src/Webhooks/ClassicPlatformWebhookHandler.cs similarity index 100% rename from Adyen/Webhooks/ClassicPlatformWebhookHandler.cs rename to Adyen/src/Webhooks/ClassicPlatformWebhookHandler.cs diff --git a/Adyen/Webhooks/ManagementWebhookHandler.cs b/Adyen/src/Webhooks/ManagementWebhookHandler.cs similarity index 100% rename from Adyen/Webhooks/ManagementWebhookHandler.cs rename to Adyen/src/Webhooks/ManagementWebhookHandler.cs diff --git a/Adyen/Webhooks/WebhookHandler.cs b/Adyen/src/Webhooks/WebhookHandler.cs similarity index 100% rename from Adyen/Webhooks/WebhookHandler.cs rename to Adyen/src/Webhooks/WebhookHandler.cs From 8b999dca4be2148b6d9f76b441c4917dac799776 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 1 Oct 2025 16:09:47 +0200 Subject: [PATCH 022/126] Add IAPI parent service Fix Namespaces for System.Net.Http --- templates-v7/csharp/libraries/generichost/ApiFactory.mustache | 4 ++-- .../csharp/libraries/generichost/ClientUtils.mustache | 2 +- .../csharp/libraries/generichost/HostConfiguration.mustache | 2 +- .../generichost/{IAdyenApiService.mustache => IApi.mustache} | 2 +- templates-v7/csharp/libraries/generichost/api.mustache | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename templates-v7/csharp/libraries/generichost/{IAdyenApiService.mustache => IApi.mustache} (85%) diff --git a/templates-v7/csharp/libraries/generichost/ApiFactory.mustache b/templates-v7/csharp/libraries/generichost/ApiFactory.mustache index def73ec18..c2a84be34 100644 --- a/templates-v7/csharp/libraries/generichost/ApiFactory.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiFactory.mustache @@ -14,7 +14,7 @@ namespace {{packageName}}.{{clientPackage}} /// /// /// - IResult Create() where IResult : I{{packageName}}Service; + IResult Create() where IResult : {{interfacePrefix}}Api; } /// @@ -41,7 +41,7 @@ namespace {{packageName}}.{{clientPackage}} /// /// /// - public IResult Create() where IResult : I{{packageName}}Service + public IResult Create() where IResult : {{interfacePrefix}}Api { return Services.GetRequiredService(); } diff --git a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache index 357d2197c..fa78bcf02 100644 --- a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache +++ b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache @@ -19,7 +19,7 @@ using {{packageName}}.{{modelPackage}}; {{/models}} using System.Runtime.CompilerServices; -{{>Assembly}}namespace {{packageName}}.{{clientPackage}} +namespace {{packageName}}.{{clientPackage}} { /// /// Utility functions providing some benefit to API client consumers. diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 837de1dc5..324d50911 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -89,7 +89,7 @@ namespace {{packageName}}.{{clientPackage}} /// /// /// - public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} client = null, Action{{nrt?}} builder = null) + public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} client = null, Action{{nrt?}} builder = null) { if (client == null) client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); diff --git a/templates-v7/csharp/libraries/generichost/IAdyenApiService.mustache b/templates-v7/csharp/libraries/generichost/IApi.mustache similarity index 85% rename from templates-v7/csharp/libraries/generichost/IAdyenApiService.mustache rename to templates-v7/csharp/libraries/generichost/IApi.mustache index 500c3b870..99f98fe19 100644 --- a/templates-v7/csharp/libraries/generichost/IAdyenApiService.mustache +++ b/templates-v7/csharp/libraries/generichost/IApi.mustache @@ -3,7 +3,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// Interface for interacting with any {{packageName}} API using . /// - {{>visibility}} interface {{interfacePrefix}}{{apiName}}Service + {{>visibility}} interface {{interfacePrefix}}Api { /// /// The object, preferably instantiated and managed using the . diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 60e243f15..006923d97 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -40,7 +40,7 @@ namespace {{packageName}}.{{apiPackage}} /// Represents a collection of functions to interact with the API endpoints /// This class is registered as transient. /// - {{>visibility}} interface {{interfacePrefix}}{{classname}} : I{{packageName}}ApiService + {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}Api { /// /// The class containing the events From 4622fb5cd47febbe1a3f939bf5199e9b807acb64 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 6 Oct 2025 13:27:42 +0200 Subject: [PATCH 023/126] Add obsolete tags with deprecation information Remove method DefaultOrAsync on interface-level --- templates-v7/csharp/api.mustache | 4 +- .../libraries/generichost/Assembly.mustache | 2 - .../csharp/libraries/generichost/api.mustache | 41 +------------------ .../generichost/modelGeneric.mustache | 10 ++--- 4 files changed, 8 insertions(+), 49 deletions(-) delete mode 100644 templates-v7/csharp/libraries/generichost/Assembly.mustache diff --git a/templates-v7/csharp/api.mustache b/templates-v7/csharp/api.mustache index 7093752ea..e7ac679bb 100644 --- a/templates-v7/csharp/api.mustache +++ b/templates-v7/csharp/api.mustache @@ -36,7 +36,7 @@ namespace {{packageName}}.{{apiPackage}} {{/allParams}}/// Index associated with the operation. /// {{returnType}} {{#isDeprecated}} - [Obsolete] + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/isDeprecated}} {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); @@ -51,7 +51,7 @@ namespace {{packageName}}.{{apiPackage}} {{/allParams}}/// Index associated with the operation. /// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} - [Obsolete] + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/isDeprecated}} ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); {{/operation}} diff --git a/templates-v7/csharp/libraries/generichost/Assembly.mustache b/templates-v7/csharp/libraries/generichost/Assembly.mustache deleted file mode 100644 index a22cc2326..000000000 --- a/templates-v7/csharp/libraries/generichost/Assembly.mustache +++ /dev/null @@ -1,2 +0,0 @@ -[assembly: InternalsVisibleTo("{{packageName}}.Test")] - diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 006923d97..19b9b20f5 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -61,28 +61,9 @@ namespace {{packageName}}.{{apiPackage}} /// Cancellation Token to cancel the request. /// <> {{#isDeprecated}} - [Obsolete] + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/isDeprecated}} Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}); - - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// <{{nrt?}}> - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - Task<{{interfacePrefix}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}); - {{^-last}} - - {{/-last}} {{/operation}} } {{#operation}} @@ -332,26 +313,6 @@ namespace {{packageName}}.{{apiPackage}} {{/allParams}} partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLogLocalVar Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); - /// - /// {{summary}} {{notes}} - /// - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// <> - public async Task<{{interfacePrefix}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}) - { - try - { - return await {{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - return null; - } - } - /// /// {{summary}} {{notes}} /// diff --git a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache index 93ca620dd..84c321235 100644 --- a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache +++ b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache @@ -129,7 +129,7 @@ {{/example}} [JsonPropertyName("{{baseName}}")] {{#deprecated}} - [Obsolete] + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/deprecated}} public {{#isNew}}new {{/isNew}}{{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} @@ -155,7 +155,7 @@ /* {{.}} */ {{/example}} {{#deprecated}} - [Obsolete] + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/deprecated}} public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option; } {{^isReadOnly}}set { this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} @@ -171,7 +171,7 @@ /* {{.}} */ {{/example}} {{#deprecated}} - [Obsolete] + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/deprecated}} public {{{dataType}}}{{>NullConditionalProperty}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}} { get; {{^isReadOnly}}set; {{/isReadOnly}}} @@ -213,7 +213,7 @@ {{/example}} [JsonPropertyName("{{baseName}}")] {{#deprecated}} - [Obsolete] + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/deprecated}} public new {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} @@ -238,7 +238,7 @@ {{/example}} [JsonPropertyName("{{baseName}}")] {{#deprecated}} - [Obsolete] + [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/deprecated}} public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} From 6fec826a76d3fedb1a7e8ff0a541578650e48140 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:18:35 +0200 Subject: [PATCH 024/126] Remove BasicToken support --- .../libraries/generichost/BasicToken.mustache | 46 ------------------- .../generichost/README.client.mustache | 2 +- .../csharp/libraries/generichost/api.mustache | 24 ++-------- 3 files changed, 6 insertions(+), 66 deletions(-) delete mode 100644 templates-v7/csharp/libraries/generichost/BasicToken.mustache diff --git a/templates-v7/csharp/libraries/generichost/BasicToken.mustache b/templates-v7/csharp/libraries/generichost/BasicToken.mustache deleted file mode 100644 index ed6f53e54..000000000 --- a/templates-v7/csharp/libraries/generichost/BasicToken.mustache +++ /dev/null @@ -1,46 +0,0 @@ -// -{{partial_header}} -{{#nrt}} -#nullable enable - -{{/nrt}} -using System; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -namespace {{packageName}}.{{clientPackage}} -{ - /// - /// A token constructed from a username and password. - /// - {{>visibility}} class BasicToken : TokenBase - { - private string _username; - - private string _password; - - /// - /// Constructs a BasicToken object. - /// - /// - /// - /// - public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) - { - _username = username; - - _password = password; - } - - /// - /// Places the token in the header. - /// - /// - /// - public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) - { - request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", {{packageName}}.Client.ClientUtils.Base64Encode(_username + ":" + _password)); - } - } -} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/README.client.mustache b/templates-v7/csharp/libraries/generichost/README.client.mustache index 6ea118b08..247cbe399 100644 --- a/templates-v7/csharp/libraries/generichost/README.client.mustache +++ b/templates-v7/csharp/libraries/generichost/README.client.mustache @@ -79,7 +79,7 @@ namespace YourProject {{#authMethods}} {{#-first}} // The type of token here depends on the api security specifications - // Available token types are ApiKeyToken, BasicToken, BearerToken, HttpSigningToken, and OAuthToken. + // Available token types are ApiKeyToken, BearerToken, HttpSigningToken, and OAuthToken. BearerToken token = new(""); options.AddTokens(token); diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 19b9b20f5..b5777d2e7 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -167,12 +167,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// A token provider of type /// - public TokenProvider BearerTokenProvider { get; }{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} - - /// - /// A token provider of type - /// - public TokenProvider BasicTokenProvider { get; }{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} + public TokenProvider BearerTokenProvider { get; }{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}} /// /// A token provider of type @@ -203,8 +198,7 @@ namespace {{packageName}}.{{apiPackage}} /// public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, - TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}, - TokenProvider basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}, + TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}}, TokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, TokenProvider oauthTokenProvider{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}}, {{packageName}}.{{clientPackage}}.CookieContainer cookieContainer{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}}) @@ -215,8 +209,7 @@ namespace {{packageName}}.{{apiPackage}} HttpClient = httpClient; Events = {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}};{{#hasApiKeyMethods}} ApiKeyProvider = apiKeyProvider;{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} - BearerTokenProvider = bearerTokenProvider;{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} - BasicTokenProvider = basicTokenProvider;{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} + BearerTokenProvider = bearerTokenProvider;{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}} HttpSignatureTokenProvider = httpSignatureTokenProvider;{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} OauthTokenProvider = oauthTokenProvider;{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}} CookieContainer = cookieContainer;{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}} @@ -496,14 +489,6 @@ namespace {{packageName}}.{{apiPackage}} {{/authMethods}} httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; {{#authMethods}} - {{#isBasicBasic}} - - BasicToken basicTokenLocalVar{{-index}} = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - - tokenBaseLocalVars.Add(basicTokenLocalVar{{-index}}); - - basicTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); - {{/isBasicBasic}} {{#isBasicBearer}} BearerToken bearerTokenLocalVar{{-index}} = (BearerToken) await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); @@ -773,7 +758,8 @@ namespace {{packageName}}.{{apiPackage}} try { result = {{vendorExtensions.x-http-status}}(); - } catch (Exception e) + } + catch (Exception e) { OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode){{#vendorExtensions.x-http-status-range}}{{.}}{{/vendorExtensions.x-http-status-range}}{{^vendorExtensions.x-http-status-range}}{{code}}{{/vendorExtensions.x-http-status-range}}); } From 0a5590d6b01b292c7e8f58cd92ff9be026ef62b8 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:18:52 +0200 Subject: [PATCH 025/126] Add Checkout.oneOf serialization support --- .../generichost/JsonConverter.mustache | 19 ++++++++++++++++--- .../generichost/modelGeneric.mustache | 4 ++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index 24810c9ce..6c80475b3 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -426,6 +426,7 @@ { {{#lambda.trimTrailingWithNewLine}} {{#lambda.trimLineBreaks}} + /* // Remove guards (null-checks) for required-properties in our open-api-specs. {{#allVars}} {{^isDiscriminator}} {{^isNullable}} @@ -437,12 +438,20 @@ {{/isNullable}} {{/isDiscriminator}} {{/allVars}} + */ + + {{! This line supports oneOf for CheckoutPaymentMethod.WriteProperties(...)}} + {{#composedSchemas.oneOf}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + {{/composedSchemas.oneOf}} + {{#allVars}} {{#isDiscriminator}} {{^model.composedSchemas.anyOf}} {{^model.composedSchemas.oneOf}} writer.WriteString("{{baseName}}", {{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{/isEnum}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}.Value{{/required}}){{/isEnum}}); - + {{/model.composedSchemas.oneOf}} {{/model.composedSchemas.anyOf}} {{/isDiscriminator}} @@ -521,8 +530,12 @@ {{/isNullable}} {{^isNullable}} - var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); - writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); + if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) + { + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); + } + {{/isNullable}} {{/isInnerEnum}} {{^isInnerEnum}} diff --git a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache index 84c321235..dac6dc069 100644 --- a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache +++ b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache @@ -264,6 +264,10 @@ { StringBuilder sb = new StringBuilder(); sb.Append("class {{classname}} {\n"); + {{#composedSchemas.oneOf}} + if (this.{{name}} != null) + sb.Append({{name}}.ToString().Replace("\n", "\n ")); + {{/composedSchemas.oneOf}} {{#parent}} sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); {{/parent}} From f7ca01e8b137bd44a2f8e9aa4d6bc652b6246812 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Tue, 7 Oct 2025 10:12:59 +0200 Subject: [PATCH 026/126] Commented out CheckoutPaymentMethod support oneOf --- .../csharp/libraries/generichost/JsonConverter.mustache | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index 6c80475b3..72a17ac3c 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -441,10 +441,12 @@ */ {{! This line supports oneOf for CheckoutPaymentMethod.WriteProperties(...)}} + /* {{#composedSchemas.oneOf}} if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); {{/composedSchemas.oneOf}} + */ {{#allVars}} {{#isDiscriminator}} From 76b20a5fe53c27c889e78105adec96b598471b55 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 13 Oct 2025 14:46:27 +0200 Subject: [PATCH 027/126] Move custom template to support oneOf without mapping/ref --- .../generichost/JsonConverter.mustache | 28 +- .../libraries/httpclient/ApiClient.mustache | 792 ++++++++++++++++++ .../httpclient/FileParameter.mustache | 72 ++ .../httpclient/RequestOptions.mustache | 66 ++ 4 files changed, 948 insertions(+), 10 deletions(-) create mode 100644 templates-v7/csharp/libraries/httpclient/ApiClient.mustache create mode 100644 templates-v7/csharp/libraries/httpclient/FileParameter.mustache create mode 100644 templates-v7/csharp/libraries/httpclient/RequestOptions.mustache diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index 72a17ac3c..8abb04681 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -350,8 +350,20 @@ {{/children}} {{/discriminator}} + {{! start | support oneOf without discriminator.mapping property - WriteProperties }} + {{^model.discriminator}} + // Write oneOf mappings when no `discriminator.mapping` is provided + {{#composedSchemas.oneOf}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + {{/composedSchemas.oneOf}} + {{/model.discriminator}} + {{! end | oneOf support without discriminator.mapping property - WriteProperties }} + {{! start | support oneOf without discriminator.mapping property- WriteStartObject }} + {{^model.discriminator}}{{#oneOf}}{{#-first}}/* {{/-first}}{{/oneOf}}{{/model.discriminator}} writer.WriteStartObject(); - + {{^model.discriminator}}{{#oneOf}}{{#-first}} */{{/-first}}{{/oneOf}}{{/model.discriminator}} + {{! end | support oneOf without discriminator.mapping property - WriteStartObject }} {{#model.discriminator}} {{#model.hasDiscriminatorWithNonEmptyMapping}} {{#composedSchemas.oneOf}} @@ -411,7 +423,11 @@ {{/composedSchemas}} {{/model.discriminator}} WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); + {{! start | support oneOf without discriminator.mapping property- WriteEndObject }} + {{^model.discriminator}}{{#oneOf}}{{#-first}}/* {{/-first}}{{/oneOf}}{{/model.discriminator}} writer.WriteEndObject(); + {{^model.discriminator}}{{#oneOf}}{{#-first}} */{{/-first}}{{/oneOf}}{{/model.discriminator}} + {{! end | support oneOf without discriminator.mapping property - WriteEndObject }} {{/lambda.trimLineBreaks}} } @@ -426,7 +442,7 @@ { {{#lambda.trimTrailingWithNewLine}} {{#lambda.trimLineBreaks}} - /* // Remove guards (null-checks) for required-properties in our open-api-specs. + /* // TODO: Remove guards (null-checks) for required-properties in our open-api-specs. {{#allVars}} {{^isDiscriminator}} {{^isNullable}} @@ -439,14 +455,6 @@ {{/isDiscriminator}} {{/allVars}} */ - - {{! This line supports oneOf for CheckoutPaymentMethod.WriteProperties(...)}} - /* - {{#composedSchemas.oneOf}} - if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) - JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); - {{/composedSchemas.oneOf}} - */ {{#allVars}} {{#isDiscriminator}} diff --git a/templates-v7/csharp/libraries/httpclient/ApiClient.mustache b/templates-v7/csharp/libraries/httpclient/ApiClient.mustache new file mode 100644 index 000000000..1cf7b5d7c --- /dev/null +++ b/templates-v7/csharp/libraries/httpclient/ApiClient.mustache @@ -0,0 +1,792 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +{{^netStandard}} +using System.Web; +{{/netStandard}} +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using System.Net.Http; +using System.Net.Http.Headers; +{{#supportsRetry}} +using Polly; +{{/supportsRetry}} + +namespace {{packageName}}.Client +{ + /// + /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public async Task Deserialize(HttpResponseMessage response) + { + var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal async Task Deserialize(HttpResponseMessage response, Type type) + { + IList headers = new List(); + // process response headers, e.g. Access-Control-Allow-Methods + foreach (var responseHeader in response.Headers) + { + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + } + + // process response content headers, e.g. Content-Type + foreach (var responseHeader in response.Content.Headers) + { + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + } + + // RFC 2183 & RFC 2616 + var fileNameRegex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$", RegexOptions.IgnoreCase); + if (type == typeof(byte[])) // return byte array + { + return await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + } + else if (type == typeof(FileParameter)) + { + if (headers != null) { + foreach (var header in headers) + { + var match = fileNameRegex.Match(header.ToString()); + if (match.Success) + { + string fileName = ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + return new FileParameter(fileName, await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); + } + } + } + return new FileParameter(await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + if (headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? Path.GetTempPath() + : _configuration.TempFolderPath; + + foreach (var header in headers) + { + var match = fileNameRegex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(await response.Content.ReadAsStringAsync().ConfigureAwait(false), null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + /// + /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. + /// + {{>visibility}} partial class ApiClient : IDisposable, ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + { + private readonly string _baseUrl; + + private readonly HttpClientHandler _httpClientHandler; + private readonly System.Net.Http.HttpClient _httpClient; + private readonly bool _disposeClient; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + public ApiClient() : + this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) + { + } + + /// + /// Initializes a new instance of the . + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _httpClientHandler = new HttpClientHandler(); + _httpClient = new System.Net.Http.HttpClient(_httpClientHandler, true); + _disposeClient = true; + _baseUrl = basePath; + } + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + /// An instance of HttpClient. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public ApiClient(System.Net.Http.HttpClient client, HttpClientHandler handler = null) : + this(client, {{packageName}}.Client.GlobalConfiguration.Instance.BasePath, handler) + { + } + + /// + /// Initializes a new instance of the . + /// + /// An instance of HttpClient. + /// The target service's base path in URL format. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public ApiClient(System.Net.Http.HttpClient client, string basePath, HttpClientHandler handler = null) + { + if (client == null) throw new ArgumentNullException("client cannot be null"); + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _httpClientHandler = handler; + _httpClient = client; + _baseUrl = basePath; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + if(_disposeClient) { + _httpClient.Dispose(); + } + } + + /// Prepares multipart/form-data content + {{! TODO: Add handling of improper usage }} + HttpContent PrepareMultipartFormDataContent(RequestOptions options) + { + string boundary = "---------" + Guid.NewGuid().ToString().ToUpperInvariant(); + var multipartContent = new MultipartFormDataContent(boundary); + foreach (var formParameter in options.FormParameters) + { + multipartContent.Add(new StringContent(formParameter.Value), formParameter.Key); + } + + if (options.FileParameters != null && options.FileParameters.Count > 0) + { + foreach (var fileParam in options.FileParameters) + { + foreach (var file in fileParam.Value) + { + var content = new StreamContent(file.Content); + content.Headers.ContentType = new MediaTypeHeaderValue(file.ContentType); + multipartContent.Add(content, fileParam.Key, file.Name); + } + } + } + return multipartContent; + } + + /// + /// Provides all logic for constructing a new HttpRequestMessage. + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the a HttpRequestMessage. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new HttpRequestMessage instance. + /// + private HttpRequestMessage NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); + + builder.AddPathParameters(options.PathParameters); + + builder.AddQueryParameters(options.QueryParameters); + + HttpRequestMessage request = new HttpRequestMessage(method, builder.GetFullUri()); + + if (configuration.UserAgent != null) + { + request.Headers.TryAddWithoutValidation("User-Agent", configuration.UserAgent); + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.Headers.Add(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + // Todo make content headers actually content headers + request.Headers.TryAddWithoutValidation(headerParam.Key, value); + } + } + } + + List> contentList = new List>(); + + string contentType = null; + if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes.FirstOrDefault(); + } + + {{!// TODO Add error handling in case of improper usage}} + if (contentType == "multipart/form-data") + { + request.Content = PrepareMultipartFormDataContent(options); + } + else if (contentType == "application/x-www-form-urlencoded") + { + request.Content = new FormUrlEncodedContent(options.FormParameters); + } + else + { + if (options.Data != null) + { + if (options.Data is FileParameter fp) + { + contentType = contentType ?? "application/octet-stream"; + + var streamContent = new StreamContent(fp.Content); + streamContent.Headers.ContentType = new MediaTypeHeaderValue(contentType); + request.Content = streamContent; + } + else + { + var serializer = new CustomJsonCodec(SerializerSettings, configuration); + request.Content = new StringContent(serializer.Serialize(options.Data), new UTF8Encoding(), + "application/json"); + } + } + } + + + + // TODO provide an alternative that allows cookies per request instead of per API client + if (options.Cookies != null && options.Cookies.Count > 0) + { + request.Properties["CookieContainer"] = options.Cookies; + } + + return request; + } + + {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptRequest(HttpRequestMessage req){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} + {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} + + private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) + { + T result = (T) responseData; + string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + + var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) + { + ErrorText = response.ReasonPhrase, + Cookies = new List() + }; + + // process response headers, e.g. Access-Control-Allow-Methods + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + // process response content headers, e.g. Content-Type + if (response.Content.Headers != null) + { + foreach (var responseHeader in response.Content.Headers) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (_httpClientHandler != null && response != null) + { + try { + foreach (Cookie cookie in _httpClientHandler.CookieContainer.GetCookies(uri)) + { + transformed.Cookies.Add(cookie); + } + } + catch (PlatformNotSupportedException) {} + } + + return transformed; + } + + private ApiResponse Exec(HttpRequestMessage req, IReadableConfiguration configuration) + { + return ExecAsync(req, configuration).GetAwaiter().GetResult(); + } + + private async Task> ExecAsync(HttpRequestMessage req, + IReadableConfiguration configuration, + System.Threading.CancellationToken cancellationToken = default) + { + CancellationTokenSource timeoutTokenSource = null; + CancellationTokenSource finalTokenSource = null; + var deserializer = new CustomJsonCodec(SerializerSettings, configuration); + var finalToken = cancellationToken; + + try + { + if (configuration.Timeout > TimeSpan.Zero) + { + timeoutTokenSource = new CancellationTokenSource(configuration.Timeout); + finalTokenSource = CancellationTokenSource.CreateLinkedTokenSource(finalToken, timeoutTokenSource.Token); + finalToken = finalTokenSource.Token; + } + + if (configuration.Proxy != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `Proxy` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + _httpClientHandler.Proxy = configuration.Proxy; + } + + if (configuration.ClientCertificates != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + _httpClientHandler.ClientCertificates.AddRange(configuration.ClientCertificates); + } + + var cookieContainer = req.Properties.ContainsKey("CookieContainer") ? req.Properties["CookieContainer"] as List : null; + + if (cookieContainer != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + foreach (var cookie in cookieContainer) + { + _httpClientHandler.CookieContainer.Add(cookie); + } + } + + InterceptRequest(req); + + HttpResponseMessage response; + {{#supportsRetry}} + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy + .ExecuteAndCaptureAsync(() => _httpClient.SendAsync(req, finalToken)) + .ConfigureAwait(false); + response = (policyResult.Outcome == OutcomeType.Successful) ? + policyResult.Result : new HttpResponseMessage() + { + ReasonPhrase = policyResult.FinalException.ToString(), + RequestMessage = req + }; + } + else + { + {{/supportsRetry}} + response = await _httpClient.SendAsync(req, finalToken).ConfigureAwait(false); + {{#supportsRetry}} + } + {{/supportsRetry}} + + if (!response.IsSuccessStatusCode) + { + return await ToApiResponse(response, default, req.RequestUri).ConfigureAwait(false); + } + + object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + } + + InterceptResponse(req, response); + + return await ToApiResponse(response, responseData, req.RequestUri).ConfigureAwait(false); + } + catch (OperationCanceledException original) + { + if (timeoutTokenSource != null && timeoutTokenSource.IsCancellationRequested) + { + throw new TaskCanceledException($"[{req.Method}] {req.RequestUri} was timeout.", + new TimeoutException(original.Message, original)); + } + throw; + } + finally + { + if (timeoutTokenSource != null) + { + timeoutTokenSource.Dispose(); + } + + if (finalTokenSource != null) + { + finalTokenSource.Dispose(); + } + } + } + + {{#supportsAsync}} + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); + } + #endregion IAsynchronousClient + {{/supportsAsync}} + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(new HttpMethod("PATCH"), path, options, config), config); + } + #endregion ISynchronousClient + } +} diff --git a/templates-v7/csharp/libraries/httpclient/FileParameter.mustache b/templates-v7/csharp/libraries/httpclient/FileParameter.mustache new file mode 100644 index 000000000..87e5fcdc9 --- /dev/null +++ b/templates-v7/csharp/libraries/httpclient/FileParameter.mustache @@ -0,0 +1,72 @@ +{{>partial_header}} + +using System.IO; + +namespace {{packageName}}.Client +{ + + /// + /// Represents a File passed to the API as a Parameter, allows using different backends for files + /// + public class FileParameter + { + /// + /// The filename + /// + public string Name { get; set; } = "no_name_provided"; + + /// + /// The content type of the file + /// + public string ContentType { get; set; } = "application/octet-stream"; + + /// + /// The content of the file + /// + public Stream Content { get; set; } + + /// + /// Construct a FileParameter just from the contents, will extract the filename from a filestream + /// + /// The file content + public FileParameter(Stream content) + { + if (content is FileStream fs) + { + Name = fs.Name; + } + Content = content; + } + + /// + /// Construct a FileParameter from name and content + /// + /// The filename + /// The file content + public FileParameter(string filename, Stream content) + { + Name = filename; + Content = content; + } + + /// + /// Construct a FileParameter from name and content + /// + /// The filename + /// The content type of the file + /// The file content + public FileParameter(string filename, string contentType, Stream content) + { + Name = filename; + ContentType = contentType; + Content = content; + } + + /// + /// Implicit conversion of stream to file parameter. Useful for backwards compatibility. + /// + /// Stream to convert + /// FileParameter + public static implicit operator FileParameter(Stream s) => new FileParameter(s); + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache b/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache new file mode 100644 index 000000000..25e76d03d --- /dev/null +++ b/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache @@ -0,0 +1,66 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace {{packageName}}.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// File parameters to be sent along with the request. + /// + public Multimap FileParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + FileParameters = new Multimap(); + Cookies = new List(); + } + } +} From b7e71f72a7fda8ebc4c2fce96f295c242d37ef5c Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 13 Oct 2025 15:25:25 +0200 Subject: [PATCH 028/126] Move CheckoutTest to integration tests in its own folder --- .../src/Checkout/CheckoutTest.cs | 226 ++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs diff --git a/Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs b/Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs new file mode 100644 index 000000000..7dd097052 --- /dev/null +++ b/Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs @@ -0,0 +1,226 @@ +using Adyen.Checkout.Models; +using Adyen.Checkout.Services; +using Adyen.Client; +using Adyen.Extensions; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.Extensions.Hosting; +using Amount = Adyen.Checkout.Models.Amount; +using JsonSerializer = System.Text.Json.JsonSerializer; + +namespace Adyen.IntegrationTest.Checkout +{ + [TestClass] + public class CheckoutTest + { + private readonly IPaymentsService _paymentsService; + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public CheckoutTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + var apiKey = new ApiKeyToken( + context.Configuration["ADYEN_API_KEY"], + ClientUtils.ApiKeyHeader.X_API_Key, + "" + ); + config.AddTokens(apiKey); + }) + .Build(); + + _paymentsService = host.Services.GetRequiredService(); + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public async Task Given_Payments_When_CardDetails_Provided_Returns_OK() + { + // Arrange + var request = new PaymentRequest( + amount: new Amount("EUR", 1999), + merchantAccount: "HeapUnderflowECOM", + reference: "Your order number4", + returnUrl: "https://adyen.com/", + paymentMethod: new CheckoutPaymentMethod( + new CardDetails( + type: CardDetails.TypeEnum.Scheme, + encryptedCardNumber: "test_4111111111111111", + encryptedExpiryMonth: "test_03", + encryptedExpiryYear: "test_2030", + encryptedSecurityCode: "test_737", + holderName: "John Smith" + ) + ) + ); + var result = await _paymentsService.PaymentsAsync(Guid.NewGuid().ToString(), request); + + Assert.IsNotNull(result); + } + + [TestMethod] + public async Task DeserializePaymentMethodsTest() + { + string json = @" +{ + ""paymentMethods"": [ + { + ""name"": ""AliPay"", + ""type"": ""alipay"" + }, + { + ""brands"": [ + ""cartebancaire"", + ""amex"", + ""mc"", + ""visa"" + ], + ""configuration"": { + ""mcDpaId"": ""6d41d4d6-45b1-42c3-a5d0-a28c0e69d4b1_dpa2"", + ""visaSrcInitiatorId"": ""B9SECVKIQX2SOBQ6J9X721dVBBKHhJJl1nxxVbemHGn5oB6S8"", + ""mcSrcClientId"": ""6d41d4d6-45b1-42c3-a5d0-a28c0e69d4b1"", + ""visaSrciDpaId"": ""8e6e347c-254e-863f-0e6a-196bf2d9df02"" + }, + ""name"": ""Cards"", + ""type"": ""scheme"" + }, + { + ""configuration"": { + ""merchantId"": ""000000000202326"", + ""merchantName"": ""TestMerchantAccount"" + }, + ""name"": ""Apple Pay"", + ""type"": ""applepay"" + }, + { + ""name"": ""Payconiq by Bancontact"", + ""type"": ""bcmc_mobile"" + }, + { + ""name"": ""Boleto Bancario"", + ""type"": ""boletobancario"" + }, + { + ""name"": ""Online bank transfer."", + ""type"": ""directEbanking"" + }, + { + ""name"": ""DOKU"", + ""type"": ""doku"" + }, + { + ""name"": ""DOKU wallet"", + ""type"": ""doku_wallet"" + }, + { + ""brand"": ""***************"", + ""name"": ""Generic GiftCard"", + ""type"": ""giftcard"" + }, + { + ""brand"": ""*****"", + ""name"": ""Givex"", + ""type"": ""giftcard"" + }, + { + ""name"": ""GoPay Wallet"", + ""type"": ""gopay_wallet"" + }, + { + ""name"": ""GrabPay"", + ""type"": ""grabpay_SG"" + }, + { + ""issuers"": [ + { + ""id"": ""************"", + ""name"": ""*****"" + } + ], + ""name"": ""iDEAL"", + ""type"": ""ideal"" + }, + { + ""name"": ""Korea–issued cards"", + ""type"": ""kcp_creditcard"" + }, + { + ""name"": ""Pay later with Klarna."", + ""type"": ""klarna"" + }, + { + ""name"": ""Pay over time with Klarna."", + ""type"": ""klarna_account"" + }, + { + ""name"": ""Pay now with Klarna."", + ""type"": ""klarna_paynow"" + }, + { + ""name"": ""MB WAY"", + ""type"": ""mbway"" + }, + { + ""name"": ""MobilePay"", + ""type"": ""mobilepay"" + }, + { + ""configuration"": { + ""merchantId"": ""50"", + ""gatewayMerchantId"": ""TestMerchantAccount"" + }, + ""name"": ""Google Pay"", + ""type"": ""paywithgoogle"" + }, + { + ""name"": ""pix"", + ""type"": ""pix"" + }, + { + ""name"": ""SEPA Direct Debit"", + ""type"": ""sepadirectdebit"" + }, + { + ""brand"": ""***"", + ""name"": ""SVS"", + ""type"": ""giftcard"" + }, + { + ""name"": ""UPI Collect"", + ""type"": ""upi_collect"" + }, + { + ""name"": ""UPI Intent"", + ""type"": ""upi_intent"" + }, + { + ""name"": ""UPI QR"", + ""type"": ""upi_qr"" + }, + { + ""brand"": ""*********"", + ""name"": ""Valuelink"", + ""type"": ""giftcard"" + }, + { + ""name"": ""Vipps"", + ""type"": ""vipps"" + }, + { + ""brand"": ""***********"", + ""name"": ""VVV Giftcard"", + ""type"": ""giftcard"" + } + ] +} +"; + + // Act + var r = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNotNull(r); + } + } +} \ No newline at end of file From e90671931e4513d991bac8cbb59a58ac6792cacf Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 13 Oct 2025 18:37:10 +0200 Subject: [PATCH 029/126] Fix templates to use "Core" as the common namespace name --- .../src/Checkout/CheckoutTest.cs | 10 +- Adyen/src/Core/Auth/ApiKeyToken.cs | 39 +++ Adyen/src/Core/Auth/BasicToken.cs | 52 +++ Adyen/src/Core/Auth/CookieContainer.cs | 18 + Adyen/src/Core/Auth/RateLimitProvider.cs | 74 ++++ Adyen/src/Core/Auth/TokenBase.cs | 68 ++++ Adyen/src/Core/Auth/TokenContainer.cs | 32 ++ Adyen/src/Core/Auth/TokenProvider.cs | 43 +++ Adyen/src/Core/Client/ApiException.cs | 40 +++ Adyen/src/Core/Client/ApiFactory.cs | 49 +++ Adyen/src/Core/Client/ApiResponse.cs | 316 ++++++++++++++++++ Adyen/src/Core/Client/ApiResponseEventArgs.cs | 24 ++ Adyen/src/Core/Client/ExceptionEventArgs.cs | 24 ++ .../Extensions/HttpClientBuilderExtensions.cs | 67 ++++ .../Core/Converters/DateOnlyJsonConverter.cs | 52 +++ .../DateOnlyNullableJsonConverter.cs | 57 ++++ .../Core/Converters/DateTimeJsonConverter.cs | 66 ++++ .../DateTimeNullableJsonConverter.cs | 71 ++++ .../src/Core/JsonSerializerOptionsProvider.cs | 25 ++ Adyen/src/Core/Option.cs | 43 +++ templates-v7/csharp/ClientUtils.mustache | 2 +- .../csharp/auth/OAuthAuthenticator.mustache | 2 +- templates-v7/csharp/auth/OAuthFlow.mustache | 2 +- .../csharp/auth/TokenResponse.mustache | 2 +- .../generichost/ClientUtils.mustache | 49 +-- .../generichost/HostConfiguration.mustache | 8 +- .../libraries/generichost/IApi.mustache | 2 +- .../IHostBuilderExtensions.mustache | 17 +- .../IServiceCollectionExtensions.mustache | 9 +- .../csharp/libraries/generichost/api.mustache | 11 +- .../libraries/generichost/model.mustache | 3 +- 31 files changed, 1202 insertions(+), 75 deletions(-) create mode 100644 Adyen/src/Core/Auth/ApiKeyToken.cs create mode 100644 Adyen/src/Core/Auth/BasicToken.cs create mode 100644 Adyen/src/Core/Auth/CookieContainer.cs create mode 100644 Adyen/src/Core/Auth/RateLimitProvider.cs create mode 100644 Adyen/src/Core/Auth/TokenBase.cs create mode 100644 Adyen/src/Core/Auth/TokenContainer.cs create mode 100644 Adyen/src/Core/Auth/TokenProvider.cs create mode 100644 Adyen/src/Core/Client/ApiException.cs create mode 100644 Adyen/src/Core/Client/ApiFactory.cs create mode 100644 Adyen/src/Core/Client/ApiResponse.cs create mode 100644 Adyen/src/Core/Client/ApiResponseEventArgs.cs create mode 100644 Adyen/src/Core/Client/ExceptionEventArgs.cs create mode 100644 Adyen/src/Core/Client/Extensions/HttpClientBuilderExtensions.cs create mode 100644 Adyen/src/Core/Converters/DateOnlyJsonConverter.cs create mode 100644 Adyen/src/Core/Converters/DateOnlyNullableJsonConverter.cs create mode 100644 Adyen/src/Core/Converters/DateTimeJsonConverter.cs create mode 100644 Adyen/src/Core/Converters/DateTimeNullableJsonConverter.cs create mode 100644 Adyen/src/Core/JsonSerializerOptionsProvider.cs create mode 100644 Adyen/src/Core/Option.cs diff --git a/Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs b/Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs index 7dd097052..99f1b66d0 100644 --- a/Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs +++ b/Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs @@ -1,7 +1,9 @@ +using Adyen.Checkout.Client; +using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; -using Adyen.Client; -using Adyen.Extensions; +using Adyen.Core; +using Adyen.Core.Auth; using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; @@ -23,8 +25,8 @@ public CheckoutTest() { var apiKey = new ApiKeyToken( context.Configuration["ADYEN_API_KEY"], - ClientUtils.ApiKeyHeader.X_API_Key, - "" + "", + null ); config.AddTokens(apiKey); }) diff --git a/Adyen/src/Core/Auth/ApiKeyToken.cs b/Adyen/src/Core/Auth/ApiKeyToken.cs new file mode 100644 index 000000000..ddcc80dcb --- /dev/null +++ b/Adyen/src/Core/Auth/ApiKeyToken.cs @@ -0,0 +1,39 @@ +#nullable enable + +using System; + +namespace Adyen.Core.Auth +{ + /// + /// A token constructed from an apiKey. + /// + public class ApiKeyToken : TokenBase + { + private string _apiKeyValue; + + /// + /// The key of the header for your API Key. + /// + public string Key { get; } = "X-API-Key"; + + /// + /// Constructs an ApiKeyToken object. + /// + /// + /// + /// + public ApiKeyToken(string value, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + { + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(Key, _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/src/Core/Auth/BasicToken.cs b/Adyen/src/Core/Auth/BasicToken.cs new file mode 100644 index 000000000..77c78da9b --- /dev/null +++ b/Adyen/src/Core/Auth/BasicToken.cs @@ -0,0 +1,52 @@ +#nullable enable + +using System; + +namespace Adyen.Core.Auth +{ + /// + /// A token constructed from a username and password. + /// + public class BasicToken : TokenBase + { + private string _username; + + private string _password; + + /// + /// The key of the header for basic authentication. + /// + public string Key { get; } = "Basic"; + + /// + /// Constructs a BasicToken object. + /// + /// + /// + /// + public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) + { + _username = username; + _password = password; + } + + /// + /// Places the username/password token in the header. + /// + /// + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(Key, Base64Encode(_username + ":" + _password)); + } + + /// + /// Encodes to a Base64-string. + /// + /// The string to encode. + /// Base64-encoded string. + private static string Base64Encode(string value) + { + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(value)); + } + } +} \ No newline at end of file diff --git a/Adyen/src/Core/Auth/CookieContainer.cs b/Adyen/src/Core/Auth/CookieContainer.cs new file mode 100644 index 000000000..3406885e7 --- /dev/null +++ b/Adyen/src/Core/Auth/CookieContainer.cs @@ -0,0 +1,18 @@ +#nullable enable + +using System.Linq; +using System.Collections.Generic; + +namespace Adyen.Core.Auth +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/Adyen/src/Core/Auth/RateLimitProvider.cs b/Adyen/src/Core/Auth/RateLimitProvider.cs new file mode 100644 index 000000000..f593f0254 --- /dev/null +++ b/Adyen/src/Core/Auth/RateLimitProvider.cs @@ -0,0 +1,74 @@ +#nullable enable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Adyen.Core.Auth +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + if (container is TokenContainer apiKeyTokenContainer) + { + string[] headers = apiKeyTokenContainer.Tokens.Select(t => t.Key).Distinct().ToArray(); + + foreach (string header in headers) + { + global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => t.Key.Equals(header))) + { + FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(header, global::System.Threading.Channels.Channel.CreateBounded(options)); + } + } + else + { + global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length) + { + FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded(options)); + } + + foreach (var availableToken in AvailableTokens) + foreach(TTokenBase token in _tokens) + { + if (token is ApiKeyToken apiKeyToken) + { + if (apiKeyToken.Key == availableToken.Key) + { + token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); + } + } else + { + token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); + } + } + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/Adyen/src/Core/Auth/TokenBase.cs b/Adyen/src/Core/Auth/TokenBase.cs new file mode 100644 index 000000000..b73db7cd8 --- /dev/null +++ b/Adyen/src/Core/Auth/TokenBase.cs @@ -0,0 +1,68 @@ +#nullable enable + +using System; + +namespace Adyen.Core.Auth +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler? TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + /// + /// Starts the token's timer. + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests. + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object? sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/Adyen/src/Core/Auth/TokenContainer.cs b/Adyen/src/Core/Auth/TokenContainer.cs new file mode 100644 index 000000000..0f1215ef8 --- /dev/null +++ b/Adyen/src/Core/Auth/TokenContainer.cs @@ -0,0 +1,32 @@ +#nullable enable + +namespace Adyen.Core.Auth +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// List of tokens. + public TokenContainer(IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/Adyen/src/Core/Auth/TokenProvider.cs b/Adyen/src/Core/Auth/TokenProvider.cs new file mode 100644 index 000000000..fb641f8e0 --- /dev/null +++ b/Adyen/src/Core/Auth/TokenProvider.cs @@ -0,0 +1,43 @@ +// +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Linq; +using System.Collections.Generic; + +namespace Adyen.Core.Auth +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/Adyen/src/Core/Client/ApiException.cs b/Adyen/src/Core/Client/ApiException.cs new file mode 100644 index 000000000..23a732bc9 --- /dev/null +++ b/Adyen/src/Core/Client/ApiException.cs @@ -0,0 +1,40 @@ +#nullable enable + +using System; + +namespace Adyen.Core.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string? ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the API + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// Reason for ApiException + /// + /// Raw content + public ApiException(string? reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + StatusCode = statusCode; + RawContent = rawContent; + } + } +} diff --git a/Adyen/src/Core/Client/ApiFactory.cs b/Adyen/src/Core/Client/ApiFactory.cs new file mode 100644 index 000000000..0bb654dea --- /dev/null +++ b/Adyen/src/Core/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Adyen.Checkout.Services; + +namespace Adyen.Core.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/Adyen/src/Core/Client/ApiResponse.cs b/Adyen/src/Core/Client/ApiResponse.cs new file mode 100644 index 000000000..83cfff10b --- /dev/null +++ b/Adyen/src/Core/Client/ApiResponse.cs @@ -0,0 +1,316 @@ +#nullable enable + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Adyen.Core.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The raw binary stream (only set for binary responses) + /// + System.IO.Stream? ContentStream { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string? ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri? RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The raw binary stream (only set for binary responses) + /// + public System.IO.Stream? ContentStream { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string? ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri? RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + ContentStream = contentStream; + RawContent = string.Empty; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IBadRequest : IApiResponse + { + /// + /// Deserializes the response if the response is BadRequest + /// + /// + TType BadRequest(); + + /// + /// Returns true if the response is BadRequest and the deserialized response is not null + /// + /// + /// + bool TryBadRequest([NotNullWhen(true)]out TType? result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IUnauthorized : IApiResponse + { + /// + /// Deserializes the response if the response is Unauthorized + /// + /// + TType Unauthorized(); + + /// + /// Returns true if the response is Unauthorized and the deserialized response is not null + /// + /// + /// + bool TryUnauthorized([NotNullWhen(true)]out TType? result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IForbidden : IApiResponse + { + /// + /// Deserializes the response if the response is Forbidden + /// + /// + TType Forbidden(); + + /// + /// Returns true if the response is Forbidden and the deserialized response is not null + /// + /// + /// + bool TryForbidden([NotNullWhen(true)]out TType? result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk([NotNullWhen(true)]out TType? result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IUnprocessableContent : IApiResponse + { + /// + /// Deserializes the response if the response is UnprocessableContent + /// + /// + TType UnprocessableContent(); + + /// + /// Returns true if the response is UnprocessableContent and the deserialized response is not null + /// + /// + /// + bool TryUnprocessableContent([NotNullWhen(true)]out TType? result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IInternalServerError : IApiResponse + { + /// + /// Deserializes the response if the response is InternalServerError + /// + /// + TType InternalServerError(); + + /// + /// Returns true if the response is InternalServerError and the deserialized response is not null + /// + /// + /// + bool TryInternalServerError([NotNullWhen(true)]out TType? result); + } + + /// + /// An interface for responses of type + /// + /// + public interface ICreated : IApiResponse + { + /// + /// Deserializes the response if the response is Created + /// + /// + TType Created(); + + /// + /// Returns true if the response is Created and the deserialized response is not null + /// + /// + /// + bool TryCreated([NotNullWhen(true)]out TType? result); + } +} diff --git a/Adyen/src/Core/Client/ApiResponseEventArgs.cs b/Adyen/src/Core/Client/ApiResponseEventArgs.cs new file mode 100644 index 000000000..baf9e69e6 --- /dev/null +++ b/Adyen/src/Core/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Adyen.Core.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/Adyen/src/Core/Client/ExceptionEventArgs.cs b/Adyen/src/Core/Client/ExceptionEventArgs.cs new file mode 100644 index 000000000..1cbfc25fa --- /dev/null +++ b/Adyen/src/Core/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Adyen.Core.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse exception + /// + public Exception Exception { get; } + + /// + /// The ExceptionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/Adyen/src/Core/Client/Extensions/HttpClientBuilderExtensions.cs b/Adyen/src/Core/Client/Extensions/HttpClientBuilderExtensions.cs new file mode 100644 index 000000000..28bae0131 --- /dev/null +++ b/Adyen/src/Core/Client/Extensions/HttpClientBuilderExtensions.cs @@ -0,0 +1,67 @@ +#nullable enable + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Adyen.Core.Client.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class HttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/Adyen/src/Core/Converters/DateOnlyJsonConverter.cs b/Adyen/src/Core/Converters/DateOnlyJsonConverter.cs new file mode 100644 index 000000000..01c166216 --- /dev/null +++ b/Adyen/src/Core/Converters/DateOnlyJsonConverter.cs @@ -0,0 +1,52 @@ +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Adyen.Core.Converters +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateOnlyJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd", + "yyyyMMdd" + + }; + + /// + /// Returns a DateOnly from the Json object + /// + /// + /// + /// + /// + public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString()!; + + foreach(string format in Formats) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnly dateOnlyValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateOnlyValue.ToString("yyyy'-'MM'-'dd", CultureInfo.InvariantCulture)); + } +} diff --git a/Adyen/src/Core/Converters/DateOnlyNullableJsonConverter.cs b/Adyen/src/Core/Converters/DateOnlyNullableJsonConverter.cs new file mode 100644 index 000000000..199d8796a --- /dev/null +++ b/Adyen/src/Core/Converters/DateOnlyNullableJsonConverter.cs @@ -0,0 +1,57 @@ +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Adyen.Core.Converters +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateOnlyNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd", + "yyyyMMdd" + + }; + + /// + /// Returns a DateOnly from the Json object + /// + /// + /// + /// + /// + public override DateOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString()!; + + foreach(string format in Formats) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnly? dateOnlyValue, JsonSerializerOptions options) + { + if (dateOnlyValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateOnlyValue.Value.ToString("yyyy'-'MM'-'dd", CultureInfo.InvariantCulture)); + } + } +} diff --git a/Adyen/src/Core/Converters/DateTimeJsonConverter.cs b/Adyen/src/Core/Converters/DateTimeJsonConverter.cs new file mode 100644 index 000000000..cbf1f4dde --- /dev/null +++ b/Adyen/src/Core/Converters/DateTimeJsonConverter.cs @@ -0,0 +1,66 @@ +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Adyen.Core.Converters +{ + /// + /// Formatter for 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString()!; + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/Adyen/src/Core/Converters/DateTimeNullableJsonConverter.cs b/Adyen/src/Core/Converters/DateTimeNullableJsonConverter.cs new file mode 100644 index 000000000..f828a2ce0 --- /dev/null +++ b/Adyen/src/Core/Converters/DateTimeNullableJsonConverter.cs @@ -0,0 +1,71 @@ +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Adyen.Core.Converters +{ + /// + /// Formatter for 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString()!; + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/Adyen/src/Core/JsonSerializerOptionsProvider.cs b/Adyen/src/Core/JsonSerializerOptionsProvider.cs new file mode 100644 index 000000000..5cc1a641e --- /dev/null +++ b/Adyen/src/Core/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +#nullable enable + +using System.Text.Json; + +namespace Adyen.Core +{ + /// + /// Provides the . + /// + public class JsonSerializerOptionsProvider + { + /// + /// The . + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider to access . + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/Adyen/src/Core/Option.cs b/Adyen/src/Core/Option.cs new file mode 100644 index 000000000..60bd77ce7 --- /dev/null +++ b/Adyen/src/Core/Option.cs @@ -0,0 +1,43 @@ +#nullable enable + + +namespace Adyen.Core +{ + /// + /// A wrapper for operation parameters which are not required. + /// + public struct Option + { + /// + /// The value to send to the server. + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server. + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required. + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type. + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option. + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/templates-v7/csharp/ClientUtils.mustache b/templates-v7/csharp/ClientUtils.mustache index 5c42d2e4f..f79c5f132 100644 --- a/templates-v7/csharp/ClientUtils.mustache +++ b/templates-v7/csharp/ClientUtils.mustache @@ -13,7 +13,7 @@ using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; {{/useCompareNetObjects}} -namespace {{packageName}}.Client +namespace {{packageName}}.{{apiName}}.{{clientPackage}} { /// /// Utility functions providing some benefit to API client consumers. diff --git a/templates-v7/csharp/auth/OAuthAuthenticator.mustache b/templates-v7/csharp/auth/OAuthAuthenticator.mustache index c336c8ad5..4a2a3fa85 100644 --- a/templates-v7/csharp/auth/OAuthAuthenticator.mustache +++ b/templates-v7/csharp/auth/OAuthAuthenticator.mustache @@ -6,7 +6,7 @@ using Newtonsoft.Json; using RestSharp; using RestSharp.Authenticators; -namespace {{packageName}}.Client.Auth +namespace {{packageName}}.{{clientPackage}}.Auth { /// /// An authenticator for OAuth2 authentication flows diff --git a/templates-v7/csharp/auth/OAuthFlow.mustache b/templates-v7/csharp/auth/OAuthFlow.mustache index 768ddd0aa..0578a2d16 100644 --- a/templates-v7/csharp/auth/OAuthFlow.mustache +++ b/templates-v7/csharp/auth/OAuthFlow.mustache @@ -1,6 +1,6 @@ {{>partial_header}} -namespace {{packageName}}.Client.Auth +namespace {{packageName}}.{{clientPackage}}.Auth { /// /// Available flows for OAuth2 authentication diff --git a/templates-v7/csharp/auth/TokenResponse.mustache b/templates-v7/csharp/auth/TokenResponse.mustache index 7a72e04c1..fc90d0c51 100644 --- a/templates-v7/csharp/auth/TokenResponse.mustache +++ b/templates-v7/csharp/auth/TokenResponse.mustache @@ -3,7 +3,7 @@ using System; using Newtonsoft.Json; -namespace {{packageName}}.Client.Auth +namespace {{packageName}}.{{clientPackage}}.Auth { class TokenResponse { diff --git a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache index fa78bcf02..8c0923d75 100644 --- a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache +++ b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache @@ -19,7 +19,7 @@ using {{packageName}}.{{modelPackage}}; {{/models}} using System.Runtime.CompilerServices; -namespace {{packageName}}.{{clientPackage}} +namespace {{packageName}}.{{apiName}}.{{clientPackage}} { /// /// Utility functions providing some benefit to API client consumers. @@ -53,52 +53,7 @@ namespace {{packageName}}.{{clientPackage}} /// /// public delegate void EventHandler(object sender, T e) where T : EventArgs; - - {{#hasApiKeyMethods}} - /// - /// An enum of headers - /// - public enum ApiKeyHeader - { - {{#apiKeyMethods}} - /// - /// The {{keyParamName}} header - /// - {{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}{{^-last}},{{/-last}} - {{/apiKeyMethods}} - } - - /// - /// Converte an ApiKeyHeader to a string - /// - /// - /// - /// - {{>visibility}} static string ApiKeyHeaderToString(ApiKeyHeader value) - { - {{#net80OrLater}} - return value switch - { - {{#apiKeyMethods}} - ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}} => "{{keyParamName}}", - {{/apiKeyMethods}} - _ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)), - }; - {{/net80OrLater}} - {{^net80OrLater}} - switch(value) - { - {{#apiKeyMethods}} - case ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}: - return "{{keyParamName}}"; - {{/apiKeyMethods}} - default: - throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); - } - {{/net80OrLater}} - } - - {{/hasApiKeyMethods}} + /// /// Returns true when deserialization succeeds. /// diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 324d50911..12e445c8d 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -14,13 +14,17 @@ using {{packageName}}.{{apiPackage}}; {{#models}} {{#-first}} using {{packageName}}.{{modelPackage}}; +using {{packageName}}.{{coreName}}; +using {{packageName}}.{{coreName}}.Auth; +using {{packageName}}.{{coreName}}.Client; +using {{packageName}}.{{coreName}}.Converters; {{/-first}} {{/models}} -namespace {{packageName}}.{{clientPackage}} +namespace {{packageName}}.{{apiName}}.{{clientPackage}} { /// - /// Provides hosting configuration for {{packageName}} + /// Provides hosting configuration for {{apiName}} /// {{>visibility}} class HostConfiguration { diff --git a/templates-v7/csharp/libraries/generichost/IApi.mustache b/templates-v7/csharp/libraries/generichost/IApi.mustache index 99f98fe19..2f5ccc333 100644 --- a/templates-v7/csharp/libraries/generichost/IApi.mustache +++ b/templates-v7/csharp/libraries/generichost/IApi.mustache @@ -6,7 +6,7 @@ namespace {{packageName}}.{{apiPackage}} {{>visibility}} interface {{interfacePrefix}}Api { /// - /// The object, preferably instantiated and managed using the . + /// The object, best practice: instantiate and manage object using the . /// System.Net.Http.HttpClient HttpClient { get; } } diff --git a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache index 5361f06f5..d00410da0 100644 --- a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache @@ -6,18 +6,19 @@ using System; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using {{packageName}}.{{clientPackage}}; +using {{packageName}}.{{apiName}}; +using {{packageName}}.{{apiName}}.{{clientPackage}}; -namespace {{packageName}}.Extensions +namespace {{packageName}}.{{apiName}}.Extensions { /// - /// Extension methods for IHostBuilder + /// Extension methods for IHostBuilder. /// - {{>visibility}} static class IHostBuilderExtensions + {{>visibility}} static class HostBuilderExtensions { {{^hasAuthMethods}} /// - /// Add the api to your host builder. + /// Add the API services to your host builder. /// /// public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder) @@ -26,7 +27,7 @@ namespace {{packageName}}.Extensions { HostConfiguration config = new HostConfiguration(services); - IServiceCollectionExtensions.Add{{apiName}}Services(services, config); + ServiceCollectionExtensions.Add{{apiName}}Services(services, config); }); return builder; @@ -34,7 +35,7 @@ namespace {{packageName}}.Extensions {{/hasAuthMethods}} /// - /// Add the api to your host builder. + /// Add the API services to your host builder. /// /// /// @@ -46,7 +47,7 @@ namespace {{packageName}}.Extensions options(context, services, config); - IServiceCollectionExtensions.Add{{apiName}}Services(services, config); + ServiceCollectionExtensions.Add{{apiName}}Services(services, config); }); return builder; diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index d00d3ddff..064752062 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -6,14 +6,15 @@ using System; using System.Linq; using Microsoft.Extensions.DependencyInjection; -using {{packageName}}.{{clientPackage}}; +using {{packageName}}.{{apiName}}.{{clientPackage}}; +using {{packageName}}.{{coreName}}.Auth; -namespace {{packageName}}.Extensions +namespace {{packageName}}.{{apiName}} { /// - /// Extension methods for IServiceCollection + /// Extension methods for ServiceCollection /// - {{>visibility}} static class IServiceCollectionExtensions + {{>visibility}} static class ServiceCollectionExtensions { {{^hasAuthMethods}} /// diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index b5777d2e7..75808d599 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -25,7 +25,10 @@ using Microsoft.Extensions.Logging; using System.Net.Http; using System.Net.Http.Headers; using System.Text.Json; -using {{packageName}}.{{clientPackage}}; +using {{packageName}}.{{coreName}}; +using {{packageName}}.{{coreName}}.Auth; +using {{packageName}}.{{coreName}}.Client; +using {{packageName}}.{{apiName}}.{{clientPackage}}; {{#hasImport}} using {{packageName}}.{{modelPackage}}; {{/hasImport}} @@ -74,7 +77,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// The /// - {{>visibility}} interface {{interfacePrefix}}{{operationId}}ApiResponse : {{#lambda.joinWithComma}}{{packageName}}.{{clientPackage}}.{{interfacePrefix}}ApiResponse {{#responses}}{{#dataType}}{{interfacePrefix}}{{vendorExtensions.x-http-status}}<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{/dataType}}{{/responses}}{{/lambda.joinWithComma}} + {{>visibility}} interface {{interfacePrefix}}{{operationId}}ApiResponse : {{#lambda.joinWithComma}}{{packageName}}.{{coreName}}.{{clientPackage}}.{{interfacePrefix}}ApiResponse {{#responses}}{{#dataType}}{{interfacePrefix}}{{vendorExtensions.x-http-status}}<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{/dataType}}{{/responses}}{{/lambda.joinWithComma}} { {{#responses}} {{#vendorExtensions.x-http-status-is-default}} @@ -186,7 +189,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// The token cookie container /// - public {{packageName}}.{{clientPackage}}.CookieContainer CookieContainer { get; } + public {{packageName}}.{{coreName}}.Auth.CookieContainer CookieContainer { get; } {{/vendorExtensions.x-set-cookie}} {{/operation}} @@ -663,7 +666,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// The /// - {{>visibility}} partial class {{operationId}}ApiResponse : {{packageName}}.{{clientPackage}}.ApiResponse, {{interfacePrefix}}{{operationId}}ApiResponse + {{>visibility}} partial class {{operationId}}ApiResponse : {{packageName}}.{{coreName}}.{{clientPackage}}.ApiResponse, {{interfacePrefix}}{{operationId}}ApiResponse { /// /// The logger diff --git a/templates-v7/csharp/libraries/generichost/model.mustache b/templates-v7/csharp/libraries/generichost/model.mustache index a9f6c2e4c..313ce8265 100644 --- a/templates-v7/csharp/libraries/generichost/model.mustache +++ b/templates-v7/csharp/libraries/generichost/model.mustache @@ -28,7 +28,8 @@ using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; {{#useSourceGeneration}} using System.Text.Json.Serialization.Metadata; {{/useSourceGeneration}} -using {{packageName}}.{{clientPackage}}; +using {{packageName}}.{{coreName}}; +using {{packageName}}.{{apiName}}.{{clientPackage}}; {{/useGenericHost}} {{#models}} {{#lambda.trimTrailingWithNewLine}} From be5ecdb6105ea248c5a9d59559ffccbeb89629b2 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 13 Oct 2025 21:12:13 +0200 Subject: [PATCH 030/126] Rename coreName to corePackageName for consistency Rename IApi to IAdyenApiService to match /services folder --- Adyen/src/Core/Client/ApiFactory.cs | 11 +++++------ Adyen/src/Core/Client/IAdyenApiService.cs | 13 +++++++++++++ templates-v7/csharp/api.mustache | 2 +- .../libraries/generichost/ApiFactory.mustache | 15 +++++++-------- .../generichost/HostConfiguration.mustache | 10 +++++----- .../csharp/libraries/generichost/IApi.mustache | 4 ++-- .../IServiceCollectionExtensions.mustache | 2 +- .../csharp/libraries/generichost/api.mustache | 14 +++++++------- .../csharp/libraries/generichost/model.mustache | 2 +- 9 files changed, 42 insertions(+), 31 deletions(-) create mode 100644 Adyen/src/Core/Client/IAdyenApiService.cs diff --git a/Adyen/src/Core/Client/ApiFactory.cs b/Adyen/src/Core/Client/ApiFactory.cs index 0bb654dea..2c073ba34 100644 --- a/Adyen/src/Core/Client/ApiFactory.cs +++ b/Adyen/src/Core/Client/ApiFactory.cs @@ -1,11 +1,10 @@ using System; using Microsoft.Extensions.DependencyInjection; -using Adyen.Checkout.Services; namespace Adyen.Core.Client { /// - /// An IApiFactory interface + /// The factory interface for creating the services that can communicate with the Adyen APIs. /// public interface IApiFactory { @@ -14,11 +13,11 @@ public interface IApiFactory /// /// /// - IResult Create() where IResult : IApi; + IResult Create() where IResult : IAdyenApiService; } /// - /// An ApiFactory + /// The implementation of . /// public class ApiFactory : IApiFactory { @@ -41,9 +40,9 @@ public ApiFactory(IServiceProvider services) /// /// /// - public IResult Create() where IResult : IApi + public IResult Create() where IResult : IAdyenApiService { return Services.GetRequiredService(); } } -} +} \ No newline at end of file diff --git a/Adyen/src/Core/Client/IAdyenApiService.cs b/Adyen/src/Core/Client/IAdyenApiService.cs new file mode 100644 index 000000000..ca6e164d6 --- /dev/null +++ b/Adyen/src/Core/Client/IAdyenApiService.cs @@ -0,0 +1,13 @@ +namespace Adyen.Core.Client +{ + /// + /// Interface for interacting with any Adyen API using . + /// + public interface IAdyenApiService + { + /// + /// The object, best practice: instantiate and manage object using the . + /// + System.Net.Http.HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/api.mustache b/templates-v7/csharp/api.mustache index e7ac679bb..84cc5d2a0 100644 --- a/templates-v7/csharp/api.mustache +++ b/templates-v7/csharp/api.mustache @@ -6,7 +6,7 @@ using System.Collections.ObjectModel; using System.Linq; using System.Net; using System.Net.Mime; -using {{packageName}}.Client; +using {{packageName}}.{{clientPackage}}; {{#hasOAuthMethods}}using {{packageName}}.Client.Auth; {{/hasOAuthMethods}} {{#hasImport}}using {{packageName}}.{{modelPackage}}; diff --git a/templates-v7/csharp/libraries/generichost/ApiFactory.mustache b/templates-v7/csharp/libraries/generichost/ApiFactory.mustache index c2a84be34..873c8b355 100644 --- a/templates-v7/csharp/libraries/generichost/ApiFactory.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiFactory.mustache @@ -1,26 +1,25 @@ using System; using Microsoft.Extensions.DependencyInjection; -using {{packageName}}.{{apiPackage}}; -namespace {{packageName}}.{{clientPackage}} +namespace {{packageName}}.{{corePackageName}}.{{clientPackage}} { /// - /// An IApiFactory interface + /// The factory interface for creating the services that can communicate with the {{packageName}} APIs. /// - {{>visibility}} interface IApiFactory + {{>visibility}} interface {{interfacePrefix}}ApiFactory { /// /// A method to create an IApi of type IResult /// /// /// - IResult Create() where IResult : {{interfacePrefix}}Api; + IResult Create() where IResult : {{interfacePrefix}}{{packageName}}ApiService; } /// - /// An ApiFactory + /// The implementation of . /// - {{>visibility}} class ApiFactory : IApiFactory + {{>visibility}} class ApiFactory : {{interfacePrefix}}ApiFactory { /// /// The service provider @@ -41,7 +40,7 @@ namespace {{packageName}}.{{clientPackage}} /// /// /// - public IResult Create() where IResult : {{interfacePrefix}}Api + public IResult Create() where IResult : {{interfacePrefix}}{{packageName}}ApiService { return Services.GetRequiredService(); } diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 12e445c8d..335308a2c 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -14,10 +14,10 @@ using {{packageName}}.{{apiPackage}}; {{#models}} {{#-first}} using {{packageName}}.{{modelPackage}}; -using {{packageName}}.{{coreName}}; -using {{packageName}}.{{coreName}}.Auth; -using {{packageName}}.{{coreName}}.Client; -using {{packageName}}.{{coreName}}.Converters; +using {{packageName}}.{{corePackageName}}; +using {{packageName}}.{{corePackageName}}.Auth; +using {{packageName}}.{{corePackageName}}.Client; +using {{packageName}}.{{corePackageName}}.Converters; {{/-first}} {{/models}} @@ -83,7 +83,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} {{/models}} {{/useSourceGeneration}} - _services.AddSingleton();{{#apiInfo}}{{#apis}} + _services.AddSingleton<{{interfacePrefix}}ApiFactory, ApiFactory>();{{#apiInfo}}{{#apis}} _services.AddSingleton<{{classname}}Events>();{{/apis}}{{/apiInfo}} } diff --git a/templates-v7/csharp/libraries/generichost/IApi.mustache b/templates-v7/csharp/libraries/generichost/IApi.mustache index 2f5ccc333..a2fc6d1ea 100644 --- a/templates-v7/csharp/libraries/generichost/IApi.mustache +++ b/templates-v7/csharp/libraries/generichost/IApi.mustache @@ -3,10 +3,10 @@ namespace {{packageName}}.{{apiPackage}} /// /// Interface for interacting with any {{packageName}} API using . /// - {{>visibility}} interface {{interfacePrefix}}Api + {{>visibility}} interface {{interfacePrefix}}{{packageName}}ApiService { /// - /// The object, best practice: instantiate and manage object using the . + /// The object, best practice: instantiate and manage object using the . /// System.Net.Http.HttpClient HttpClient { get; } } diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index 064752062..705e499f0 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -7,7 +7,7 @@ using System; using System.Linq; using Microsoft.Extensions.DependencyInjection; using {{packageName}}.{{apiName}}.{{clientPackage}}; -using {{packageName}}.{{coreName}}.Auth; +using {{packageName}}.{{corePackageName}}.Auth; namespace {{packageName}}.{{apiName}} { diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 75808d599..454ae4a7a 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -25,9 +25,9 @@ using Microsoft.Extensions.Logging; using System.Net.Http; using System.Net.Http.Headers; using System.Text.Json; -using {{packageName}}.{{coreName}}; -using {{packageName}}.{{coreName}}.Auth; -using {{packageName}}.{{coreName}}.Client; +using {{packageName}}.{{corePackageName}}; +using {{packageName}}.{{corePackageName}}.Auth; +using {{packageName}}.{{corePackageName}}.Client; using {{packageName}}.{{apiName}}.{{clientPackage}}; {{#hasImport}} using {{packageName}}.{{modelPackage}}; @@ -43,7 +43,7 @@ namespace {{packageName}}.{{apiPackage}} /// Represents a collection of functions to interact with the API endpoints /// This class is registered as transient. /// - {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}Api + {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{packageName}}ApiService { /// /// The class containing the events @@ -77,7 +77,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// The /// - {{>visibility}} interface {{interfacePrefix}}{{operationId}}ApiResponse : {{#lambda.joinWithComma}}{{packageName}}.{{coreName}}.{{clientPackage}}.{{interfacePrefix}}ApiResponse {{#responses}}{{#dataType}}{{interfacePrefix}}{{vendorExtensions.x-http-status}}<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{/dataType}}{{/responses}}{{/lambda.joinWithComma}} + {{>visibility}} interface {{interfacePrefix}}{{operationId}}ApiResponse : {{#lambda.joinWithComma}}{{packageName}}.{{corePackageName}}.{{clientPackage}}.{{interfacePrefix}}ApiResponse {{#responses}}{{#dataType}}{{interfacePrefix}}{{vendorExtensions.x-http-status}}<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{/dataType}}{{/responses}}{{/lambda.joinWithComma}} { {{#responses}} {{#vendorExtensions.x-http-status-is-default}} @@ -189,7 +189,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// The token cookie container /// - public {{packageName}}.{{coreName}}.Auth.CookieContainer CookieContainer { get; } + public {{packageName}}.{{corePackageName}}.Auth.CookieContainer CookieContainer { get; } {{/vendorExtensions.x-set-cookie}} {{/operation}} @@ -666,7 +666,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// The /// - {{>visibility}} partial class {{operationId}}ApiResponse : {{packageName}}.{{coreName}}.{{clientPackage}}.ApiResponse, {{interfacePrefix}}{{operationId}}ApiResponse + {{>visibility}} partial class {{operationId}}ApiResponse : {{packageName}}.{{corePackageName}}.{{clientPackage}}.ApiResponse, {{interfacePrefix}}{{operationId}}ApiResponse { /// /// The logger diff --git a/templates-v7/csharp/libraries/generichost/model.mustache b/templates-v7/csharp/libraries/generichost/model.mustache index 313ce8265..fa07a7053 100644 --- a/templates-v7/csharp/libraries/generichost/model.mustache +++ b/templates-v7/csharp/libraries/generichost/model.mustache @@ -28,7 +28,7 @@ using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; {{#useSourceGeneration}} using System.Text.Json.Serialization.Metadata; {{/useSourceGeneration}} -using {{packageName}}.{{coreName}}; +using {{packageName}}.{{corePackageName}}; using {{packageName}}.{{apiName}}.{{clientPackage}}; {{/useGenericHost}} {{#models}} From a6a7eaa40c38521eff142aeda1b7c52f4032b1c9 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 13 Oct 2025 21:32:32 +0200 Subject: [PATCH 031/126] Write enum --- .../csharp/libraries/generichost/JsonConverter.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index 8abb04681..d1fb749f7 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -540,7 +540,7 @@ {{/isNullable}} {{^isNullable}} - if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) + if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) {{! - }} { var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); From ce2fabc1353e345c282891dd93a9320b9f772057 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 13 Oct 2025 21:33:12 +0200 Subject: [PATCH 032/126] Remove old templates --- .../csharp/AbstractOpenAPISchema.mustache | 71 -- z_templates-mod/csharp/api-single.mustache | 87 -- z_templates-mod/csharp/api.mustache | 799 ------------------ z_templates-mod/csharp/api_invoke.mustache | 1 - .../csharp/api_parameter_ordering.mustache | 1 - .../api_parameter_ordering_required.mustache | 1 - .../csharp/api_parameters.mustache | 2 - .../csharp/api_parameters_async.mustache | 2 - .../csharp/auth/OAuthAuthenticator.mustache | 136 --- .../csharp/auth/OAuthFlow.mustache | 19 - .../csharp/auth/TokenResponse.mustache | 24 - z_templates-mod/csharp/config.yaml | 6 - .../csharp/method_documentation.mustache | 13 - z_templates-mod/csharp/model.mustache | 50 -- z_templates-mod/csharp/modelAnyOf.mustache | 275 ------ z_templates-mod/csharp/modelEnum.mustache | 185 ---- z_templates-mod/csharp/modelGeneric.mustache | 420 --------- .../csharp/modelInnerEnum.mustache | 99 --- z_templates-mod/csharp/modelOneOf.mustache | 320 ------- z_templates-mod/csharp/model_doc.mustache | 22 - .../csharp/partial_header.mustache | 12 - .../csharp/AbstractOpenAPISchema.mustache | 71 -- z_templates/csharp/api-single.mustache | 87 -- z_templates/csharp/api.mustache | 86 -- z_templates/csharp/api_invoke.mustache | 1 - .../csharp/api_parameter_ordering.mustache | 1 - .../api_parameter_ordering_required.mustache | 1 - z_templates/csharp/api_parameters.mustache | 2 - .../csharp/api_parameters_async.mustache | 2 - z_templates/csharp/config.yaml | 6 - .../csharp/method_documentation.mustache | 13 - z_templates/csharp/model.mustache | 43 - z_templates/csharp/modelGeneric.mustache | 384 --------- z_templates/csharp/modelOneOf.mustache | 286 ------- z_templates/csharp/partial_header.mustache | 12 - 35 files changed, 3540 deletions(-) delete mode 100644 z_templates-mod/csharp/AbstractOpenAPISchema.mustache delete mode 100644 z_templates-mod/csharp/api-single.mustache delete mode 100644 z_templates-mod/csharp/api.mustache delete mode 100644 z_templates-mod/csharp/api_invoke.mustache delete mode 100644 z_templates-mod/csharp/api_parameter_ordering.mustache delete mode 100644 z_templates-mod/csharp/api_parameter_ordering_required.mustache delete mode 100644 z_templates-mod/csharp/api_parameters.mustache delete mode 100644 z_templates-mod/csharp/api_parameters_async.mustache delete mode 100644 z_templates-mod/csharp/auth/OAuthAuthenticator.mustache delete mode 100644 z_templates-mod/csharp/auth/OAuthFlow.mustache delete mode 100644 z_templates-mod/csharp/auth/TokenResponse.mustache delete mode 100644 z_templates-mod/csharp/config.yaml delete mode 100644 z_templates-mod/csharp/method_documentation.mustache delete mode 100644 z_templates-mod/csharp/model.mustache delete mode 100644 z_templates-mod/csharp/modelAnyOf.mustache delete mode 100644 z_templates-mod/csharp/modelEnum.mustache delete mode 100644 z_templates-mod/csharp/modelGeneric.mustache delete mode 100644 z_templates-mod/csharp/modelInnerEnum.mustache delete mode 100644 z_templates-mod/csharp/modelOneOf.mustache delete mode 100644 z_templates-mod/csharp/model_doc.mustache delete mode 100644 z_templates-mod/csharp/partial_header.mustache delete mode 100644 z_templates/csharp/AbstractOpenAPISchema.mustache delete mode 100644 z_templates/csharp/api-single.mustache delete mode 100644 z_templates/csharp/api.mustache delete mode 100644 z_templates/csharp/api_invoke.mustache delete mode 100644 z_templates/csharp/api_parameter_ordering.mustache delete mode 100644 z_templates/csharp/api_parameter_ordering_required.mustache delete mode 100644 z_templates/csharp/api_parameters.mustache delete mode 100644 z_templates/csharp/api_parameters_async.mustache delete mode 100644 z_templates/csharp/config.yaml delete mode 100644 z_templates/csharp/method_documentation.mustache delete mode 100644 z_templates/csharp/model.mustache delete mode 100644 z_templates/csharp/modelGeneric.mustache delete mode 100644 z_templates/csharp/modelOneOf.mustache delete mode 100644 z_templates/csharp/partial_header.mustache diff --git a/z_templates-mod/csharp/AbstractOpenAPISchema.mustache b/z_templates-mod/csharp/AbstractOpenAPISchema.mustache deleted file mode 100644 index ab90f174c..000000000 --- a/z_templates-mod/csharp/AbstractOpenAPISchema.mustache +++ /dev/null @@ -1,71 +0,0 @@ -{{>partial_header}} -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; - -namespace {{packageName}}.{{modelPackage}} -{ - /// - /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification - /// - {{>visibility}} abstract partial class AbstractOpenAPISchema - { - /// - /// Custom JSON serializer - /// - static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - MissingMemberHandling = MissingMemberHandling.Ignore, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Gets or Sets the actual instance - /// - public abstract Object ActualInstance { get; set; } - - /// - /// Gets or Sets IsNullable to indicate whether the instance is nullable - /// - public bool IsNullable { get; protected set; } - - /// - /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` - /// - public string SchemaType { get; protected set; } - - /// - /// Converts the instance into JSON string. - /// - public abstract string ToJson(); - - // Check if the contains TypeEnum value - protected static bool ContainsValue(string type) where T : struct, IConvertible - { - // Search for type in .TypeEnum - List list = new List(); - var members = typeof(T).GetTypeInfo().DeclaredMembers; - foreach (var member in members) - { - var val = member?.GetCustomAttribute(false)?.Value; - if (!string.IsNullOrEmpty(val)) - { - list.Add(val); - } - } - - return list.Contains(type); - } - } -} diff --git a/z_templates-mod/csharp/api-single.mustache b/z_templates-mod/csharp/api-single.mustache deleted file mode 100644 index da60553d0..000000000 --- a/z_templates-mod/csharp/api-single.mustache +++ /dev/null @@ -1,87 +0,0 @@ -{{>partial_header}} -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using Adyen.Constants; -using Adyen.Model; -{{#hasImport}}using Adyen.{{modelPackage}}; -{{/hasImport}} - -namespace {{packageName}}.Service -{ -{{#operations}} - /// - /// {{classname}} Interface - /// - public interface I{{customApi}}Service - { - {{#operation}} -{{>method_documentation}} - {{#returnType}} - /// . - {{/returnType}} - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - {{#returnType}}{{modelPackage}}.{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}({{>api_parameters}}); - - {{#supportsAsync}} -{{>method_documentation}} - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects.{{#returnType}} - /// Task of .{{/returnType}} - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - {{#returnType}}Task<{{modelPackage}}.{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_parameters_async}}); - - {{/supportsAsync}} - {{/operation}} - } - {{/operations}} - - {{#operations}} - /// - /// Represents a collection of functions to interact with the {{customApi}}Service API endpoints - /// - {{>visibility}} class {{customApi}}Service : AbstractService, I{{customApi}}Service - { - private readonly string _baseUrl; - - public {{customApi}}Service(Client client) : base(client) - { - _baseUrl = CreateBaseUrl("{{{basePath}}}"); - } - {{#operation}} - - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - public {{#returnType}}{{modelPackage}}.{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}({{>api_parameters}}) - { - {{#returnType}}return {{/returnType}}{{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_invoke}}).ConfigureAwait(false).GetAwaiter().GetResult(); - } - - {{#supportsAsync}} - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - {{#returnType}}public async Task<{{modelPackage}}.{{{.}}}>{{/returnType}}{{^returnType}}public async Task{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_parameters_async}}) - { - {{#hasQueryParams}} - // Build the query string - var queryParams = new Dictionary(); - {{#queryParams}} - {{^required}}if ({{paramName}} != null) {{/required}}queryParams.Add("{{baseName}}", {{paramName}}{{^isString}}{{^isDateTime}}.Value.ToString(){{/isDateTime}}{{#isDateTime}}.ToString("yyyy-MM-ddTHH:mm:ssZ"){{/isDateTime}}{{/isString}}); - {{/queryParams}} - {{/hasQueryParams}} - var endpoint = _baseUrl + {{#hasPathParams}}${{/hasPathParams}}"{{{path}}}"{{#hasQueryParams}} + ToQueryString(queryParams){{/hasQueryParams}}; - var resource = new ServiceResource(this, endpoint); - {{#returnType}}return {{/returnType}}await resource.RequestAsync{{#returnType}}<{{modelPackage}}.{{returnType}}>{{/returnType}}({{#bodyParam}}{{paramName}}.ToJson(){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, requestOptions, new HttpMethod("{{httpMethod}}"), cancellationToken).ConfigureAwait(false); - } - {{/supportsAsync}} - {{/operation}} - } - {{/operations}} -} \ No newline at end of file diff --git a/z_templates-mod/csharp/api.mustache b/z_templates-mod/csharp/api.mustache deleted file mode 100644 index 527434ba1..000000000 --- a/z_templates-mod/csharp/api.mustache +++ /dev/null @@ -1,799 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Net; -using System.Net.Mime; -using {{packageName}}.Client; -{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; -{{/hasOAuthMethods}} -{{#hasImport}}using {{packageName}}.{{modelPackage}}; -{{/hasImport}} - -namespace {{packageName}}.{{apiPackage}} -{ - {{#operations}} - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor - { - #region Synchronous Operations - {{#operation}} - /// - /// {{summary}} - /// - {{#notes}} - /// - /// {{.}} - /// - {{/notes}} - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// Index associated with the operation. - /// {{returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); - - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// Index associated with the operation. - /// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); - {{/operation}} - #endregion Synchronous Operations - } - - {{#supportsAsync}} - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor - { - #region Asynchronous Operations - {{#operation}} - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of {{returnType}}{{^returnType}}void{{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); - - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); - {{/operation}} - #endregion Asynchronous Operations - } - {{/supportsAsync}} - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} - { - - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} partial class {{classname}} : {{interfacePrefix}}{{classname}} - { - private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public {{classname}}() : this((string)null) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// - public {{classname}}(string basePath) - { - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - new {{packageName}}.Client.Configuration { BasePath = basePath } - ); - this.Client = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - {{#supportsAsync}} - this.AsynchronousClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - {{/supportsAsync}} - this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public {{classname}}({{packageName}}.Client.Configuration configuration) - { - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - configuration - ); - this.Client = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - {{#supportsAsync}} - this.AsynchronousClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - {{/supportsAsync}} - ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using a Configuration object and client instance. - /// - /// The client interface for synchronous API access.{{#supportsAsync}} - /// The client interface for asynchronous API access.{{/supportsAsync}} - /// The configuration object. - public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) - { - if (client == null) throw new ArgumentNullException("client"); - {{#supportsAsync}} - if (asyncClient == null) throw new ArgumentNullException("asyncClient"); - {{/supportsAsync}} - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Client = client; - {{#supportsAsync}} - this.AsynchronousClient = asyncClient; - {{/supportsAsync}} - this.Configuration = configuration; - this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - {{#supportsAsync}} - /// - /// The client for accessing this underlying API asynchronously. - /// - public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } - {{/supportsAsync}} - - /// - /// The client for accessing this underlying API synchronously. - /// - public {{packageName}}.Client.ISynchronousClient Client { get; set; } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public string GetBasePath() - { - return this.Configuration.BasePath; - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public {{packageName}}.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - {{#operation}} - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// Index associated with the operation. - /// {{returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) - { - {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} - } - - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// Index associated with the operation. - /// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) - { - {{#allParams}} - {{#required}} - {{^vendorExtensions.x-csharp-value-type}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) - { - throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); - } - - {{/vendorExtensions.x-csharp-value-type}} - {{/required}} - {{/allParams}} - {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - {{#consumes}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/consumes}} - }; - - // to determine the Accept header - string[] _accepts = new string[] { - {{#produces}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/produces}} - }; - - var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - var localVarMultipartFormData = localVarContentType == "multipart/form-data"; - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - {{#pathParams}} - {{#required}} - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - } - {{/required}} - {{/pathParams}} - {{#queryParams}} - {{#required}} - {{#isDeepObject}} - {{#items.vars}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isDeepObject}} - {{#items.vars}} - if ({{paramName}}.{{name}} != null) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{paramName}}[{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}]", {{paramName}}.{{name}})); - } - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - } - {{/required}} - {{/queryParams}} - {{#headerParams}} - {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - } - {{/required}} - {{/headerParams}} - {{#formParams}} - {{#required}} - {{#isFile}} - {{#isArray}} - {{#supportsFileParameters}} - foreach (var file in {{paramName}}) - { - localVarRequestOptions.FileParameters.Add("{{baseName}}", file); - } - {{/supportsFileParameters}} - {{/isArray}} - {{^isArray}} - {{#supportsFileParameters}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/supportsFileParameters}} - {{/isArray}} - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{#isPrimitiveType}}{{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}){{/isPrimitiveType}}{{^isPrimitiveType}}localVarMultipartFormData ? {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}) : {{packageName}}.Client.ClientUtils.Serialize({{paramName}}){{/isPrimitiveType}}); // form parameter - {{/isFile}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isFile}} - {{#isArray}} - {{#supportsFileParameters}} - foreach (var file in {{paramName}}) - { - localVarRequestOptions.FileParameters.Add("{{baseName}}", file); - } - {{/supportsFileParameters}} - {{/isArray}} - {{^isArray}} - {{#supportsFileParameters}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/supportsFileParameters}} - {{/isArray}} - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{#isPrimitiveType}}{{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}){{/isPrimitiveType}}{{^isPrimitiveType}}localVarMultipartFormData ? {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}) : {{packageName}}.Client.ClientUtils.Serialize({{paramName}}){{/isPrimitiveType}}); // form parameter - {{/isFile}} - } - {{/required}} - {{/formParams}} - {{#bodyParam}} - localVarRequestOptions.Data = {{paramName}}; - {{/bodyParam}} - - localVarRequestOptions.Operation = "{{classname}}.{{operationId}}"; - localVarRequestOptions.OperationIndex = operationIndex; - - {{#authMethods}} - // authentication ({{name}}) required - {{#isApiKey}} - {{#isKeyInCookie}} - // cookie parameter support - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInCookie}} - {{#isKeyInHeader}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); - } - {{/isKeyInHeader}} - {{#isKeyInQuery}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInQuery}} - {{/isApiKey}} - {{#isBasicBasic}} - // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); - } - {{/isBasicBasic}} - {{#isBasicBearer}} - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isBasicBearer}} - {{#isOAuth}} - // oauth required - if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{#hasOAuthMethods}} - else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && - !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && - this.Configuration.OAuthFlow != null) - { - localVarRequestOptions.OAuth = true; - } - {{/hasOAuthMethods}} - } - {{/isOAuth}} - {{#isHttpSignature}} - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } - {{/isHttpSignature}} - {{/authMethods}} - - // make the HTTP request - var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - {{#supportsAsync}} - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of {{returnType}}{{^returnType}}void{{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false);{{/returnType}} - } - - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - {{#allParams}} - {{#required}} - {{^vendorExtensions.x-csharp-value-type}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) - { - throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); - } - - {{/vendorExtensions.x-csharp-value-type}} - {{/required}} - {{/allParams}} - - {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - {{#consumes}} - "{{{mediaType}}}"{{^-last}}, {{/-last}} - {{/consumes}} - }; - - // to determine the Accept header - string[] _accepts = new string[] { - {{#produces}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/produces}} - }; - - var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - {{#constantParams}} - {{#isPathParam}} - // Set client side default value of Path Param "{{baseName}}". - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant path parameter - {{/isPathParam}} - {{/constantParams}} - {{#pathParams}} - {{#required}} - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - } - {{/required}} - {{/pathParams}} - {{#constantParams}} - {{#isQueryParam}} - // Set client side default value of Query Param "{{baseName}}". - localVarRequestOptions.QueryParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant query parameter - {{/isQueryParam}} - {{/constantParams}} - {{#queryParams}} - {{#required}} - {{#isDeepObject}} - {{#items.vars}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isDeepObject}} - {{#items.vars}} - if ({{paramName}}.{{name}} != null) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{paramName}}[{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}]", {{paramName}}.{{name}})); - } - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - } - {{/required}} - {{/queryParams}} - {{#constantParams}} - {{#isHeaderParam}} - // Set client side default value of Header Param "{{baseName}}". - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter - {{/isHeaderParam}} - {{/constantParams}} - {{#headerParams}} - {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - } - {{/required}} - {{/headerParams}} - {{#formParams}} - {{#required}} - {{#isFile}} - {{#isArray}} - {{#supportsFileParameters}} - foreach (var file in {{paramName}}) - { - localVarRequestOptions.FileParameters.Add("{{baseName}}", file); - } - {{/supportsFileParameters}} - {{/isArray}} - {{^isArray}} - {{#supportsFileParameters}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/supportsFileParameters}} - {{/isArray}} - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter - {{/isFile}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isFile}} - {{#isArray}} - {{#supportsFileParameters}} - foreach (var file in {{paramName}}) - { - localVarRequestOptions.FileParameters.Add("{{baseName}}", file); - } - {{/supportsFileParameters}} - {{/isArray}} - {{^isArray}} - {{#supportsFileParameters}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/supportsFileParameters}} - {{/isArray}} - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter - {{/isFile}} - } - {{/required}} - {{/formParams}} - {{#bodyParam}} - localVarRequestOptions.Data = {{paramName}}; - {{/bodyParam}} - - localVarRequestOptions.Operation = "{{classname}}.{{operationId}}"; - localVarRequestOptions.OperationIndex = operationIndex; - - {{#authMethods}} - // authentication ({{name}}) required - {{#isApiKey}} - {{#isKeyInCookie}} - // cookie parameter support - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInCookie}} - {{#isKeyInHeader}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); - } - {{/isKeyInHeader}} - {{#isKeyInQuery}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInQuery}} - {{/isApiKey}} - {{#isBasic}} - {{#isBasicBasic}} - // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); - } - {{/isBasicBasic}} - {{#isBasicBearer}} - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isBasicBearer}} - {{/isBasic}} - {{#isOAuth}} - // oauth required - if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{#hasOAuthMethods}} - else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && - !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && - this.Configuration.OAuthFlow != null) - { - localVarRequestOptions.OAuth = true; - } - {{/hasOAuthMethods}} - } - {{/isOAuth}} - {{#isHttpSignature}} - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } - {{/isHttpSignature}} - {{/authMethods}} - - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - {{/supportsAsync}} - {{/operation}} - } - {{/operations}} -} diff --git a/z_templates-mod/csharp/api_invoke.mustache b/z_templates-mod/csharp/api_invoke.mustache deleted file mode 100644 index 45815fc53..000000000 --- a/z_templates-mod/csharp/api_invoke.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#requiredParams}}{{#isPathParam}}{{paramName}}, {{/isPathParam}}{{#isBodyParam}}{{paramName}}, {{/isBodyParam}}{{#isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/requiredParams}}{{#optionalParams}}{{#isPathParam}}{{paramName}}, {{/isPathParam}}{{#isBodyParam}}{{paramName}}, {{/isBodyParam}}{{#isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/optionalParams}}requestOptions \ No newline at end of file diff --git a/z_templates-mod/csharp/api_parameter_ordering.mustache b/z_templates-mod/csharp/api_parameter_ordering.mustache deleted file mode 100644 index 593846f25..000000000 --- a/z_templates-mod/csharp/api_parameter_ordering.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isPathParam}}{{{dataType}}} {{paramName}} = default, {{/isPathParam}}{{#isBodyParam}}{{{dataType}}} {{paramName}} = default, {{/isBodyParam}}{{#isQueryParam}}{{{dataType}}} {{paramName}} = default, {{/isQueryParam}} \ No newline at end of file diff --git a/z_templates-mod/csharp/api_parameter_ordering_required.mustache b/z_templates-mod/csharp/api_parameter_ordering_required.mustache deleted file mode 100644 index 0c1ecfea1..000000000 --- a/z_templates-mod/csharp/api_parameter_ordering_required.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isPathParam}}{{{dataType}}} {{paramName}}, {{/isPathParam}}{{#isBodyParam}}{{{dataType}}} {{paramName}}, {{/isBodyParam}}{{#isQueryParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}} \ No newline at end of file diff --git a/z_templates-mod/csharp/api_parameters.mustache b/z_templates-mod/csharp/api_parameters.mustache deleted file mode 100644 index 3ca742884..000000000 --- a/z_templates-mod/csharp/api_parameters.mustache +++ /dev/null @@ -1,2 +0,0 @@ -{{! Path and body are required, followed by optional query string and request options }} -{{#requiredParams}}{{>api_parameter_ordering_required}}{{/requiredParams}}{{#optionalParams}}{{>api_parameter_ordering}}{{/optionalParams}}RequestOptions requestOptions = default \ No newline at end of file diff --git a/z_templates-mod/csharp/api_parameters_async.mustache b/z_templates-mod/csharp/api_parameters_async.mustache deleted file mode 100644 index 4287dc8b4..000000000 --- a/z_templates-mod/csharp/api_parameters_async.mustache +++ /dev/null @@ -1,2 +0,0 @@ -{{! Path and body are required, followed by optional query string and request options }} -{{#requiredParams}}{{>api_parameter_ordering_required}}{{/requiredParams}}{{#optionalParams}}{{>api_parameter_ordering}}{{/optionalParams}}RequestOptions requestOptions = default, CancellationToken cancellationToken = default \ No newline at end of file diff --git a/z_templates-mod/csharp/auth/OAuthAuthenticator.mustache b/z_templates-mod/csharp/auth/OAuthAuthenticator.mustache deleted file mode 100644 index c336c8ad5..000000000 --- a/z_templates-mod/csharp/auth/OAuthAuthenticator.mustache +++ /dev/null @@ -1,136 +0,0 @@ -{{>partial_header}} - -using System; -using System.Threading.Tasks; -using Newtonsoft.Json; -using RestSharp; -using RestSharp.Authenticators; - -namespace {{packageName}}.Client.Auth -{ - /// - /// An authenticator for OAuth2 authentication flows - /// - public class OAuthAuthenticator : IAuthenticator - { - private TokenResponse{{nrt?}} _token; - - /// - /// Returns the current authentication token. Can return null if there is no authentication token, or it has expired. - /// - public string{{nrt?}} Token - { - get - { - if (_token == null) return null; - if (_token.ExpiresIn == null) return _token.AccessToken; - if (_token.ExpiresAt < DateTime.Now) return null; - - return _token.AccessToken; - } - } - - readonly string _tokenUrl; - readonly string _clientId; - readonly string _clientSecret; - readonly string{{nrt?}} _scope; - readonly string _grantType; - readonly JsonSerializerSettings _serializerSettings; - readonly IReadableConfiguration _configuration; - - /// - /// Initialize the OAuth2 Authenticator - /// - public OAuthAuthenticator( - string tokenUrl, - string clientId, - string clientSecret, - string{{nrt?}} scope, - OAuthFlow? flow, - JsonSerializerSettings serializerSettings, - IReadableConfiguration configuration) - { - _tokenUrl = tokenUrl; - _clientId = clientId; - _clientSecret = clientSecret; - _scope = scope; - _serializerSettings = serializerSettings; - _configuration = configuration; - - switch (flow) - { - /*case OAuthFlow.ACCESS_CODE: - _grantType = "authorization_code"; - break; - case OAuthFlow.IMPLICIT: - _grantType = "implicit"; - break; - case OAuthFlow.PASSWORD: - _grantType = "password"; - break;*/ - case OAuthFlow.APPLICATION: - _grantType = "client_credentials"; - break; - default: - break; - } - } - - /// - /// Creates an authentication parameter from an access token. - /// - /// An authentication parameter. - protected async ValueTask GetAuthenticationParameter() - { - var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; - return new HeaderParameter(KnownHeaders.Authorization, token); - } - - /// - /// Gets the token from the OAuth2 server. - /// - /// An authentication token. - async Task GetToken() - { - var client = new RestClient(_tokenUrl, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(_serializerSettings, _configuration))); - - var request = new RestRequest(); - if (!string.IsNullOrWhiteSpace(_token?.RefreshToken)) - { - request.AddParameter("grant_type", "refresh_token") - .AddParameter("refresh_token", _token.RefreshToken); - } - else - { - request - .AddParameter("grant_type", _grantType) - .AddParameter("client_id", _clientId) - .AddParameter("client_secret", _clientSecret); - } - if (!string.IsNullOrEmpty(_scope)) - { - request.AddParameter("scope", _scope); - } - _token = await client.PostAsync(request).ConfigureAwait(false); - // RFC6749 - token_type is case insensitive. - // RFC6750 - In Authorization header Bearer should be capitalized. - // Fix the capitalization irrespective of token_type casing. - switch (_token?.TokenType?.ToLower()) - { - case "bearer": - return $"Bearer {_token.AccessToken}"; - default: - return $"{_token?.TokenType} {_token?.AccessToken}"; - } - } - - /// - /// Retrieves the authentication token (creating a new one if necessary) and adds it to the current request - /// - /// - /// - /// - public async ValueTask Authenticate(IRestClient client, RestRequest request) - => request.AddOrUpdateParameter(await GetAuthenticationParameter().ConfigureAwait(false)); - } -} diff --git a/z_templates-mod/csharp/auth/OAuthFlow.mustache b/z_templates-mod/csharp/auth/OAuthFlow.mustache deleted file mode 100644 index 768ddd0aa..000000000 --- a/z_templates-mod/csharp/auth/OAuthFlow.mustache +++ /dev/null @@ -1,19 +0,0 @@ -{{>partial_header}} - -namespace {{packageName}}.Client.Auth -{ - /// - /// Available flows for OAuth2 authentication - /// - public enum OAuthFlow - { - /// Authorization code flow - ACCESS_CODE, - /// Implicit flow - IMPLICIT, - /// Password flow - PASSWORD, - /// Client credentials flow - APPLICATION - } -} \ No newline at end of file diff --git a/z_templates-mod/csharp/auth/TokenResponse.mustache b/z_templates-mod/csharp/auth/TokenResponse.mustache deleted file mode 100644 index 7a72e04c1..000000000 --- a/z_templates-mod/csharp/auth/TokenResponse.mustache +++ /dev/null @@ -1,24 +0,0 @@ -{{>partial_header}} - -using System; -using Newtonsoft.Json; - -namespace {{packageName}}.Client.Auth -{ - class TokenResponse - { - [JsonProperty("token_type")] - public string TokenType { get; set; } - [JsonProperty("access_token")] - public string AccessToken { get; set; } - [JsonProperty("expires_in")] - public int? ExpiresIn { get; set; } - [JsonProperty("created")] - public DateTime? Created { get; set; } - - [JsonProperty("refresh_token")] - public string{{nrt?}} RefreshToken { get; set; } - - public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value); - } -} \ No newline at end of file diff --git a/z_templates-mod/csharp/config.yaml b/z_templates-mod/csharp/config.yaml deleted file mode 100644 index 829b2714b..000000000 --- a/z_templates-mod/csharp/config.yaml +++ /dev/null @@ -1,6 +0,0 @@ -templateDir: ./templates/csharp -files: - api-single.mustache: - folder: api - templateType: API - destinationFilename: Single.cs \ No newline at end of file diff --git a/z_templates-mod/csharp/method_documentation.mustache b/z_templates-mod/csharp/method_documentation.mustache deleted file mode 100644 index 537b3924e..000000000 --- a/z_templates-mod/csharp/method_documentation.mustache +++ /dev/null @@ -1,13 +0,0 @@ - /// - /// {{{summary}}} - /// - {{#pathParams}} - /// - {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/pathParams}} - {{#bodyParams}} - /// - {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/bodyParams}} - {{#queryParams}} - /// - {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/queryParams}} - /// - Additional request options. \ No newline at end of file diff --git a/z_templates-mod/csharp/model.mustache b/z_templates-mod/csharp/model.mustache deleted file mode 100644 index 0d0c0b683..000000000 --- a/z_templates-mod/csharp/model.mustache +++ /dev/null @@ -1,50 +0,0 @@ -{{>partial_header}} - -{{#models}} -{{#model}} -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.IO; -{{#vendorExtensions.x-com-visible}} -using System.Runtime.InteropServices; -{{/vendorExtensions.x-com-visible}} -using System.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -{{#discriminator}} -using JsonSubTypes; -{{/discriminator}} -{{/model}} -{{/models}} -{{#validatable}} -using System.ComponentModel.DataAnnotations; -{{/validatable}} -using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; -{{#useCompareNetObjects}} -using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; -{{/useCompareNetObjects}} -{{#models}} -{{#model}} -{{#oneOf}} -{{#-first}} -using System.Reflection; -{{/-first}} -{{/oneOf}} -{{#anyOf}} -{{#-first}} -using System.Reflection; -{{/-first}} -{{/anyOf}} - -namespace {{packageName}}.{{modelPackage}} -{ -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} -{{/model}} -{{/models}} -} diff --git a/z_templates-mod/csharp/modelAnyOf.mustache b/z_templates-mod/csharp/modelAnyOf.mustache deleted file mode 100644 index f3eac973d..000000000 --- a/z_templates-mod/csharp/modelAnyOf.mustache +++ /dev/null @@ -1,275 +0,0 @@ -{{#model}} - /// - /// {{description}}{{^description}}{{classname}}{{/description}} - /// - {{#vendorExtensions.x-cls-compliant}} - [CLSCompliant({{{.}}})] - {{/vendorExtensions.x-cls-compliant}} - {{#vendorExtensions.x-com-visible}} - [ComVisible({{{.}}})] - {{/vendorExtensions.x-com-visible}} - [JsonConverter(typeof({{classname}}JsonConverter))] - [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} - { - {{#isNullable}} - /// - /// Initializes a new instance of the class. - /// - public {{classname}}() - { - IsNullable = true; - SchemaType= "anyOf"; - } - - {{/isNullable}} - {{#composedSchemas.anyOf}} - {{^vendorExtensions.x-duplicated-data-type}} - {{^isNull}} - /// - /// Initializes a new instance of the class - /// with the class - /// - /// An instance of {{dataType}}. - public {{classname}}({{{dataType}}} actualInstance) - { - IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; - SchemaType= "anyOf"; - ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; - } - - {{/isNull}} - {{/vendorExtensions.x-duplicated-data-type}} - {{/composedSchemas.anyOf}} - - private Object _actualInstance; - - /// - /// Gets or Sets ActualInstance - /// - public override Object ActualInstance - { - get - { - return _actualInstance; - } - set - { - {{#anyOf}} - {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) - { - _actualInstance = value; - } - {{/anyOf}} - else - { - throw new ArgumentException("Invalid instance found. Must be the following types:{{#anyOf}} {{{.}}}{{^-last}},{{/-last}}{{/anyOf}}"); - } - } - } - {{#composedSchemas.anyOf}} - {{^vendorExtensions.x-duplicated-data-type}} - {{^isNull}} - - /// - /// Get the actual instance of `{{dataType}}`. If the actual instance is not `{{dataType}}`, - /// the InvalidClassException will be thrown - /// - /// An instance of {{dataType}} - public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}() - { - return ({{{dataType}}})ActualInstance; - } - {{/isNull}} - {{/vendorExtensions.x-duplicated-data-type}} - {{/composedSchemas.anyOf}} - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class {{classname}} {\n"); - sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public override string ToJson() - { - return JsonConvert.SerializeObject(ActualInstance, {{classname}}.SerializerSettings); - } - - /// - /// Converts the JSON string into an instance of {{classname}} - /// - /// JSON string - /// An instance of {{classname}} - public static {{classname}} FromJson(string jsonString) - { - {{classname}} new{{classname}} = null; - - if (string.IsNullOrEmpty(jsonString)) - { - return new{{classname}}; - } - {{#anyOf}} - - try - { - new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.SerializerSettings)); - // deserialization is considered successful at this point if no exception has been thrown. - return new{{classname}}; - } - catch (Exception exception) - { - // deserialization failed, try the next one - System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into {{{.}}}: {1}", jsonString, exception.ToString())); - } - {{/anyOf}} - - // no match found, throw an exception - throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); - } - {{#equatable}} - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - return Equals(input as {{classname}}); - {{/useCompareNetObjects}} - } - - /// - /// Returns true if {{classname}} instances are equal - /// - /// Instance of {{classname}} to be compared - /// Boolean - public bool Equals({{classname}} input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - if (input == null) - return false; - - return ActualInstance.Equals(input.ActualInstance); - {{/useCompareNetObjects}} - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (ActualInstance != null) - hashCode = hashCode * 59 + ActualInstance.GetHashCode(); - return hashCode; - } - } - {{/equatable}} - - {{#validatable}} - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - {{/validatable}} - } - - /// - /// Custom JSON converter for {{classname}} - /// - public class {{classname}}JsonConverter : JsonConverter - { - /// - /// To write the JSON string - /// - /// JSON writer - /// Object to be converted into a JSON string - /// JSON Serializer - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - writer.WriteRawValue((string)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); - } - - /// - /// To convert a JSON string into an object - /// - /// JSON reader - /// Object type - /// Existing value - /// JSON Serializer - /// The object converted from the JSON string - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - switch(reader.TokenType) - { - {{#composedSchemas.anyOf}} - {{^vendorExtensions.x-duplicated-data-type}} - {{#isInteger}} - case JsonToken.Integer: - return new {{classname}}(Convert.ToInt32(reader.Value)); - {{/isInteger}} - {{#isNumber}} - case JsonToken.Float: - return new {{classname}}(Convert.ToDecimal(reader.Value)); - {{/isNumber}} - {{#isString}} - case JsonToken.String: - return new {{classname}}(Convert.ToString(reader.Value)); - {{/isString}} - {{#isBoolean}} - case JsonToken.Boolean: - return new {{classname}}(Convert.ToBoolean(reader.Value)); - {{/isBoolean}} - {{#isDate}} - case JsonToken.Date: - return new {{classname}}(Convert.ToDateTime(reader.Value)); - {{/isDate}} - {{/vendorExtensions.x-duplicated-data-type}} - {{/composedSchemas.anyOf}} - case JsonToken.StartObject: - return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); - case JsonToken.StartArray: - return {{classname}}.FromJson(JArray.Load(reader).ToString(Formatting.None)); - default: - return null; - } - } - - /// - /// Check if the object can be converted - /// - /// Object type - /// True if the object can be converted - public override bool CanConvert(Type objectType) - { - return false; - } - } -{{/model}} \ No newline at end of file diff --git a/z_templates-mod/csharp/modelEnum.mustache b/z_templates-mod/csharp/modelEnum.mustache deleted file mode 100644 index 029055d35..000000000 --- a/z_templates-mod/csharp/modelEnum.mustache +++ /dev/null @@ -1,185 +0,0 @@ - /// - /// {{description}}{{^description}}Defines {{{name}}}{{/description}} - /// - {{#description}} - /// {{.}} - {{/description}} - {{#vendorExtensions.x-cls-compliant}} - [CLSCompliant({{{.}}})] - {{/vendorExtensions.x-cls-compliant}} - {{#vendorExtensions.x-com-visible}} - [ComVisible({{{.}}})] - {{/vendorExtensions.x-com-visible}} - {{#allowableValues}} - {{#enumVars}} - {{#-first}} - {{#isString}} - {{^useGenericHost}} - [JsonConverter(typeof(StringEnumConverter))] - {{/useGenericHost}} - {{/isString}} - {{/-first}} - {{/enumVars}} - {{/allowableValues}} - {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} - { - {{#allowableValues}} - {{#enumVars}} - /// - /// Enum {{name}} for value: {{value}} - /// - {{#isString}} - {{^useGenericHost}} - {{! EnumMember not currently supported in System.Text.Json, use a converter instead }} - [EnumMember(Value = "{{{value}}}")] - {{/useGenericHost}} - {{/isString}} - {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}}{{^vendorExtensions.x-zero-based-enum}} = {{-index}}{{/vendorExtensions.x-zero-based-enum}}{{/isString}}{{^-last}},{{/-last}} - {{^-last}} - - {{/-last}} - {{/enumVars}} - {{/allowableValues}} - } - {{#useGenericHost}} - - /// - /// Converts to and from the JSON value - /// - public static class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter - { - /// - /// Parses a given value to - /// - /// - /// - public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} FromString(string value) - { - {{#allowableValues}} - {{#enumVars}} - if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) - return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; - - {{/enumVars}} - {{/allowableValues}} - throw new NotImplementedException($"Could not convert value to type {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}: '{value}'"); // TODO - } - - /// - /// Parses a given value to - /// - /// - /// - public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? FromStringOrDefault(string value) - { - {{#allowableValues}} - {{#enumVars}} - if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) - return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; - - {{/enumVars}} - {{/allowableValues}} - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static {{>EnumValueDataType}} ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} value) - { - {{^isString}} - return ({{>EnumValueDataType}}) value; - {{/isString}} - {{#isString}} - {{#allowableValues}} - {{#enumVars}} - if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) - return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; - - {{/enumVars}} - {{/allowableValues}} - throw new NotImplementedException($"Value could not be handled: '{value}'"); - {{/isString}} - } - } - - /// - /// A Json converter for type - /// - /// - public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> - { - /// - /// Returns a {{datatypeWithEnum}} from the Json object - /// - /// - /// - /// - /// - public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - string{{nrt?}} rawValue = reader.GetString(); - - {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null - ? null - : {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); - - if (result != null) - return result.Value; - - throw new JsonException(); - } - - /// - /// Writes the {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} to the json writer - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) - { - writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.ToString()); - } - } - - /// - /// A Json converter for type - /// - public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}?> - { - /// - /// Returns a {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} from the Json object - /// - /// - /// - /// - /// - public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - string{{nrt?}} rawValue = reader.GetString(); - - {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null - ? null - : {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); - - if (result != null) - return result.Value; - - throw new JsonException(); - } - - /// - /// Writes the DateTime to the json writer - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) - { - writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}?.ToString() ?? "null"); - } - } - {{/useGenericHost}} diff --git a/z_templates-mod/csharp/modelGeneric.mustache b/z_templates-mod/csharp/modelGeneric.mustache deleted file mode 100644 index 8aeb55522..000000000 --- a/z_templates-mod/csharp/modelGeneric.mustache +++ /dev/null @@ -1,420 +0,0 @@ - /// - /// {{description}}{{^description}}{{classname}}{{/description}} - /// - {{#vendorExtensions.x-cls-compliant}} - [CLSCompliant({{{vendorExtensions.x-cls-compliant}}})] - {{/vendorExtensions.x-cls-compliant}} - {{#vendorExtensions.x-com-visible}} - [ComVisible({{{vendorExtensions.x-com-visible}}})] - {{/vendorExtensions.x-com-visible}} - [DataContract(Name = "{{{name}}}")] - {{#discriminator}} - {{#mappedModels.size}} - [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")] - {{/mappedModels.size}} - {{#mappedModels}} - [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] - {{/mappedModels}} - {{/discriminator}} - {{>visibility}} partial class {{classname}}{{#lambda.firstDot}}{{#parent}} : .{{/parent}}{{#validatable}} : .{{/validatable}}{{#equatable}} : .{{/equatable}}{{/lambda.firstDot}}{{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} - { - {{#vars}} - {{#items.isEnum}} - {{#items}} - {{^complexType}} -{{>modelInnerEnum}} - {{/complexType}} - {{/items}} - {{/items.isEnum}} - {{#isEnum}} - {{^complexType}} -{{>modelInnerEnum}} - {{/complexType}} - {{/isEnum}} - {{#isEnum}} - - /// - /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} - /// - {{#description}} - /// {{.}} - {{/description}} - {{#example}} - /* - {{.}} - */ - {{/example}} - {{^conditionalSerialization}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#deprecated}} - [Obsolete] - {{/deprecated}} - public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } - {{#isReadOnly}} - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return false; - } - {{/isReadOnly}} - {{/conditionalSerialization}} - {{#conditionalSerialization}} - {{#isReadOnly}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#deprecated}} - [Obsolete] - {{/deprecated}} - public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } - - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return false; - } - {{/isReadOnly}} - - {{^isReadOnly}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#deprecated}} - [Obsolete] - {{/deprecated}} - public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} - { - get{ return _{{name}};} - set - { - _{{name}} = value; - _flag{{name}} = true; - } - } - private {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} _{{name}}; - private bool _flag{{name}}; - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return _flag{{name}}; - } - {{/isReadOnly}} - {{/conditionalSerialization}} - {{/isEnum}} - {{/vars}} - {{#hasRequired}} - {{^hasOnlyReadOnly}} - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - {{^isAdditionalPropertiesTrue}} - protected {{classname}}() { } - {{/isAdditionalPropertiesTrue}} - {{#isAdditionalPropertiesTrue}} - protected {{classname}}() - { - this.AdditionalProperties = new Dictionary(); - } - {{/isAdditionalPropertiesTrue}} - {{/hasOnlyReadOnly}} - {{/hasRequired}} - /// - /// Initializes a new instance of the class. - /// - {{#readWriteVars}} - /// {{description}}{{^description}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. - {{/readWriteVars}} - {{#hasOnlyReadOnly}} - [JsonConstructorAttribute] - {{/hasOnlyReadOnly}} - public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} - { - {{#vars}} - {{^isInherited}} - {{^isReadOnly}} - {{#required}} - {{^conditionalSerialization}} - {{^vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{#vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{/conditionalSerialization}} - {{#conditionalSerialization}} - {{^vendorExtensions.x-csharp-value-type}} - this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{#vendorExtensions.x-csharp-value-type}} - this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{/conditionalSerialization}} - {{/required}} - {{/isReadOnly}} - {{/isInherited}} - {{/vars}} - {{#vars}} - {{^isInherited}} - {{^isReadOnly}} - {{^required}} - {{#defaultValue}} - {{^conditionalSerialization}} - {{^vendorExtensions.x-csharp-value-type}} - // use default value if no "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" provided - this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} ?? {{#isString}}@{{/isString}}{{{defaultValue}}}; - {{/vendorExtensions.x-csharp-value-type}} - {{#vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{/conditionalSerialization}} - {{/defaultValue}} - {{^defaultValue}} - {{^conditionalSerialization}} - this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - {{/conditionalSerialization}} - {{#conditionalSerialization}} - this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - if (this.{{name}} != null) - { - this._flag{{name}} = true; - } - {{/conditionalSerialization}} - {{/defaultValue}} - {{/required}} - {{/isReadOnly}} - {{/isInherited}} - {{/vars}} - {{#isAdditionalPropertiesTrue}} - this.AdditionalProperties = new Dictionary(); - {{/isAdditionalPropertiesTrue}} - } - - {{#vars}} - {{^isInherited}} - {{^isEnum}} - /// - /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} - /// {{#description}} - /// {{.}}{{/description}} - {{#example}} - /* - {{.}} - */ - {{/example}} - {{^conditionalSerialization}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#isDate}} - {{^supportsDateOnly}} - [JsonConverter(typeof(OpenAPIDateConverter))] - {{/supportsDateOnly}} - {{/isDate}} - {{#deprecated}} - [Obsolete] - {{/deprecated}} - public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } - - {{#isReadOnly}} - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return false; - } - {{/isReadOnly}} - {{/conditionalSerialization}} - {{#conditionalSerialization}} - {{#isReadOnly}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#isDate}} - [JsonConverter(typeof(OpenAPIDateConverter))] - {{/isDate}} - {{#deprecated}} - [Obsolete] - {{/deprecated}} - public {{{dataType}}} {{name}} { get; private set; } - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return false; - } - {{/isReadOnly}} - {{^isReadOnly}} - {{#isDate}} - [JsonConverter(typeof(OpenAPIDateConverter))] - {{/isDate}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#deprecated}} - [Obsolete] - {{/deprecated}} - public {{{dataType}}} {{name}} - { - get{ return _{{name}};} - set - { - _{{name}} = value; - _flag{{name}} = true; - } - } - private {{{dataType}}} _{{name}}; - private bool _flag{{name}}; - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return _flag{{name}}; - } - {{/isReadOnly}} - {{/conditionalSerialization}} - {{/isEnum}} - {{/isInherited}} - {{/vars}} - {{#isAdditionalPropertiesTrue}} - /// - /// Gets or Sets additional properties - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { get; set; } - - {{/isAdditionalPropertiesTrue}} - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - StringBuilder sb = new StringBuilder(); - sb.Append("class {{classname}} {\n"); - {{#parent}} - sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - {{/parent}} - {{#vars}} - sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); - {{/vars}} - {{#isAdditionalPropertiesTrue}} - sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); - {{/isAdditionalPropertiesTrue}} - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public {{#parent}}{{^isArray}}{{^isMap}}override {{/isMap}}{{/isArray}}{{/parent}}{{^parent}}virtual {{/parent}}string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - {{#equatable}} - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - return this.Equals(input as {{classname}}); - {{/useCompareNetObjects}} - } - - /// - /// Returns true if {{classname}} instances are equal - /// - /// Instance of {{classname}} to be compared - /// Boolean - public bool Equals({{classname}} input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - if (input == null) - { - return false; - } - return {{#vars}}{{#parent}}base.Equals(input) && {{/parent}}{{^isContainer}} - ( - this.{{name}} == input.{{name}} || - {{^vendorExtensions.x-is-value-type}} - (this.{{name}} != null && - this.{{name}}.Equals(input.{{name}})) - {{/vendorExtensions.x-is-value-type}} - {{#vendorExtensions.x-is-value-type}} - this.{{name}}.Equals(input.{{name}}) - {{/vendorExtensions.x-is-value-type}} - ){{^-last}} && {{/-last}}{{/isContainer}}{{#isContainer}} - ( - this.{{name}} == input.{{name}} || - {{^vendorExtensions.x-is-value-type}}this.{{name}} != null && - input.{{name}} != null && - {{/vendorExtensions.x-is-value-type}}this.{{name}}.SequenceEqual(input.{{name}}) - ){{^-last}} && {{/-last}}{{/isContainer}}{{/vars}}{{^vars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/vars}}{{^isAdditionalPropertiesTrue}};{{/isAdditionalPropertiesTrue}} - {{#isAdditionalPropertiesTrue}} - && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); - {{/isAdditionalPropertiesTrue}} - {{/useCompareNetObjects}} - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - {{#parent}} - int hashCode = base.GetHashCode(); - {{/parent}} - {{^parent}} - int hashCode = 41; - {{/parent}} - {{#vars}} - {{^vendorExtensions.x-is-value-type}} - if (this.{{name}} != null) - { - hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); - } - {{/vendorExtensions.x-is-value-type}} - {{#vendorExtensions.x-is-value-type}} - hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); - {{/vendorExtensions.x-is-value-type}} - {{/vars}} - {{#isAdditionalPropertiesTrue}} - if (this.AdditionalProperties != null) - { - hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); - } - {{/isAdditionalPropertiesTrue}} - return hashCode; - } - } - {{/equatable}} - -{{#validatable}} -{{>validatable}} -{{/validatable}} - } diff --git a/z_templates-mod/csharp/modelInnerEnum.mustache b/z_templates-mod/csharp/modelInnerEnum.mustache deleted file mode 100644 index 62b8a003f..000000000 --- a/z_templates-mod/csharp/modelInnerEnum.mustache +++ /dev/null @@ -1,99 +0,0 @@ - {{^isContainer}} - /// - /// {{description}}{{^description}}Defines {{{name}}}{{/description}} - /// - {{#description}} - /// {{.}} - {{/description}} - {{#isString}} - {{^useGenericHost}} - [JsonConverter(typeof(StringEnumConverter))] - {{/useGenericHost}} - {{/isString}} - {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} - { - {{#allowableValues}} - {{#enumVars}} - /// - /// Enum {{name}} for value: {{value}} - /// - {{^useGenericHost}} - {{#isString}} - [EnumMember(Value = "{{{value}}}")] - {{/isString}} - {{/useGenericHost}} - {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}}{{^vendorExtensions.x-zero-based-enum}} = {{-index}}{{/vendorExtensions.x-zero-based-enum}}{{/isString}}{{^-last}},{{/-last}} - {{^-last}} - - {{/-last}} - {{/enumVars}} - {{/allowableValues}} - } - {{#useGenericHost}} - - /// - /// Returns a - /// - /// - /// - /// - public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}FromString(string value) - { - {{#allowableValues}} - {{#enumVars}} - if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) - return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; - - {{/enumVars}} - {{/allowableValues}} - throw new NotImplementedException($"Could not convert value to type {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}: '{value}'"); // TODO - } - - /// - /// Returns a - /// - /// - /// - public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}FromStringOrDefault(string value) - { - {{#allowableValues}} - {{#enumVars}} - if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) - return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; - - {{/enumVars}} - {{/allowableValues}} - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - {{#isString}} - /// - {{/isString}} - public static {{>EnumValueDataType}}{{#lambda.first}}{{#nrt}}{{#isString}}{{#isNullable}}{{nrt?}} {{^nrt}}{{#vendorExtensions.x-is-value-type}}? {{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}}{{/isString}}{{/nrt}}{{/lambda.first}} {{datatypeWithEnum}}ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#isString}}{{>NullConditionalProperty}}{{/isString}} value) - { - {{^isString}} - return ({{>EnumValueDataType}}) value; - {{/isString}} - {{#isString}} - {{#isNullable}} - if (value == null) - return null; - - {{/isNullable}} - {{#allowableValues}} - {{#enumVars}} - if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) - return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; - - {{/enumVars}} - {{/allowableValues}} - throw new NotImplementedException($"Value could not be handled: '{value}'"); - {{/isString}} - } - {{/useGenericHost}} - {{/isContainer}} \ No newline at end of file diff --git a/z_templates-mod/csharp/modelOneOf.mustache b/z_templates-mod/csharp/modelOneOf.mustache deleted file mode 100644 index ab42e4eef..000000000 --- a/z_templates-mod/csharp/modelOneOf.mustache +++ /dev/null @@ -1,320 +0,0 @@ -{{#model}} - /// - /// {{description}}{{^description}}{{classname}}{{/description}} - /// - {{#vendorExtensions.x-cls-compliant}} - [CLSCompliant({{{.}}})] - {{/vendorExtensions.x-cls-compliant}} - {{#vendorExtensions.x-com-visible}} - [ComVisible({{{.}}})] - {{/vendorExtensions.x-com-visible}} - [JsonConverter(typeof({{classname}}JsonConverter))] - [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : {{#lambda.joinWithComma}}AbstractOpenAPISchema {{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} - { - {{#isNullable}} - /// - /// Initializes a new instance of the class. - /// - public {{classname}}() - { - this.IsNullable = true; - this.SchemaType= "oneOf"; - } - - {{/isNullable}} - {{#composedSchemas.oneOf}} - {{^vendorExtensions.x-duplicated-data-type}} - {{^isNull}} - /// - /// Initializes a new instance of the class - /// with the class - /// - /// An instance of {{dataType}}. - public {{classname}}({{{dataType}}} actualInstance) - { - this.IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; - } - - {{/isNull}} - {{/vendorExtensions.x-duplicated-data-type}} - {{/composedSchemas.oneOf}} - - private Object _actualInstance; - - /// - /// Gets or Sets ActualInstance - /// - public override Object ActualInstance - { - get - { - return _actualInstance; - } - set - { - {{#oneOf}} - {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}}) || value is {{{.}}}) - { - this._actualInstance = value; - } - {{/oneOf}} - else - { - throw new ArgumentException("Invalid instance found. Must be the following types:{{#oneOf}} {{{.}}}{{^-last}},{{/-last}}{{/oneOf}}"); - } - } - } - {{#composedSchemas.oneOf}} - {{^vendorExtensions.x-duplicated-data-type}} - {{^isNull}} - - /// - /// Get the actual instance of `{{dataType}}`. If the actual instance is not `{{dataType}}`, - /// the InvalidClassException will be thrown - /// - /// An instance of {{dataType}} - public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}() - { - return ({{{dataType}}})this.ActualInstance; - } - {{/isNull}} - {{/vendorExtensions.x-duplicated-data-type}} - {{/composedSchemas.oneOf}} - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class {{classname}} {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public override string ToJson() - { - return JsonConvert.SerializeObject(this.ActualInstance, {{classname}}.SerializerSettings); - } - - /// - /// Converts the JSON string into an instance of {{classname}} - /// - /// JSON string - /// An instance of {{classname}} - public static {{classname}} FromJson(string jsonString) - { - {{classname}} new{{classname}} = null; - - if (string.IsNullOrEmpty(jsonString)) - { - return new{{classname}}; - } - {{#useOneOfDiscriminatorLookup}} - {{#discriminator}} - - try - { - var discriminatorObj = JObject.Parse(jsonString)["{{{propertyBaseName}}}"]; - string discriminatorValue = discriminatorObj == null ?string.Empty :discriminatorObj.ToString(); - switch (discriminatorValue) - { - {{#mappedModels}} - case "{{{mappingName}}}": - new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{modelName}}}>(jsonString, {{classname}}.AdditionalPropertiesSerializerSettings)); - return new{{classname}}; - {{/mappedModels}} - default: - System.Diagnostics.Debug.WriteLine(string.Format("Failed to lookup discriminator value `{0}` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); - break; - } - } - catch (Exception ex) - { - System.Diagnostics.Debug.WriteLine(string.Format("Failed to parse the json data : `{0}` {1}", jsonString, ex.ToString())); - } - - {{/discriminator}} - {{/useOneOfDiscriminatorLookup}} - int match = 0; - List matchedTypes = new List(); - {{#oneOf}} - - try - { - // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize - if (typeof({{{.}}}).GetProperty("AdditionalProperties") == null) - { - new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.SerializerSettings)); - } - else - { - new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.AdditionalPropertiesSerializerSettings)); - } - matchedTypes.Add("{{{.}}}"); - match++; - } - catch (Exception exception) - { - // deserialization failed, try the next one - System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into {{{.}}}: {1}", jsonString, exception.ToString())); - } - {{/oneOf}} - - if (match == 0) - { - throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); - } - else if (match > 1) - { - throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + String.Join(",", matchedTypes)); - } - - // deserialization is considered successful at this point if no exception has been thrown. - return new{{classname}}; - } - - {{#equatable}} - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - return this.Equals(input as {{classname}}); - {{/useCompareNetObjects}} - } - - /// - /// Returns true if {{classname}} instances are equal - /// - /// Instance of {{classname}} to be compared - /// Boolean - public bool Equals({{classname}} input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - if (input == null) - return false; - - return this.ActualInstance.Equals(input.ActualInstance); - {{/useCompareNetObjects}} - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); - return hashCode; - } - } - {{/equatable}} - {{#validatable}} - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - {{/validatable}} - } - - /// - /// Custom JSON converter for {{classname}} - /// - public class {{classname}}JsonConverter : JsonConverter - { - /// - /// To write the JSON string - /// - /// JSON writer - /// Object to be converted into a JSON string - /// JSON Serializer - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - writer.WriteRawValue((string)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); - } - - /// - /// To convert a JSON string into an object - /// - /// JSON reader - /// Object type - /// Existing value - /// JSON Serializer - /// The object converted from the JSON string - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - switch(reader.TokenType) - { - {{#composedSchemas.oneOf}} - {{^vendorExtensions.x-duplicated-data-type}} - {{#isInteger}} - case JsonToken.Integer: - return new {{classname}}(Convert.ToInt32(reader.Value)); - {{/isInteger}} - {{#isNumber}} - case JsonToken.Float: - return new {{classname}}(Convert.ToDecimal(reader.Value)); - {{/isNumber}} - {{#isString}} - case JsonToken.String: - return new {{classname}}(Convert.ToString(reader.Value)); - {{/isString}} - {{#isBoolean}} - case JsonToken.Boolean: - return new {{classname}}(Convert.ToBoolean(reader.Value)); - {{/isBoolean}} - {{#isDate}} - case JsonToken.Date: - return new {{classname}}(Convert.ToDateTime(reader.Value)); - {{/isDate}} - {{/vendorExtensions.x-duplicated-data-type}} - {{/composedSchemas.oneOf}} - case JsonToken.StartObject: - return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); - case JsonToken.StartArray: - return {{classname}}.FromJson(JArray.Load(reader).ToString(Formatting.None)); - default: - return null; - } - } - - /// - /// Check if the object can be converted - /// - /// Object type - /// True if the object can be converted - public override bool CanConvert(Type objectType) - { - return false; - } - } -{{/model}} diff --git a/z_templates-mod/csharp/model_doc.mustache b/z_templates-mod/csharp/model_doc.mustache deleted file mode 100644 index 3c7f8b2db..000000000 --- a/z_templates-mod/csharp/model_doc.mustache +++ /dev/null @@ -1,22 +0,0 @@ -{{#models}} -{{#model}} -# {{{packageName}}}.{{modelPackage}}.{{{classname}}} -{{#description}}{{&description}} -{{/description}} - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -{{#parent}} -{{#parentVars}} -**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} -{{/parentVars}} -{{/parent}} -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} -{{/vars}} - -[[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) - -{{/model}} -{{/models}} diff --git a/z_templates-mod/csharp/partial_header.mustache b/z_templates-mod/csharp/partial_header.mustache deleted file mode 100644 index a4c7dd929..000000000 --- a/z_templates-mod/csharp/partial_header.mustache +++ /dev/null @@ -1,12 +0,0 @@ -/* -{{#appName}} -* {{{.}}} -* -{{/appName}} -* -* {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ diff --git a/z_templates/csharp/AbstractOpenAPISchema.mustache b/z_templates/csharp/AbstractOpenAPISchema.mustache deleted file mode 100644 index ab90f174c..000000000 --- a/z_templates/csharp/AbstractOpenAPISchema.mustache +++ /dev/null @@ -1,71 +0,0 @@ -{{>partial_header}} -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; - -namespace {{packageName}}.{{modelPackage}} -{ - /// - /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification - /// - {{>visibility}} abstract partial class AbstractOpenAPISchema - { - /// - /// Custom JSON serializer - /// - static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - MissingMemberHandling = MissingMemberHandling.Ignore, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Gets or Sets the actual instance - /// - public abstract Object ActualInstance { get; set; } - - /// - /// Gets or Sets IsNullable to indicate whether the instance is nullable - /// - public bool IsNullable { get; protected set; } - - /// - /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` - /// - public string SchemaType { get; protected set; } - - /// - /// Converts the instance into JSON string. - /// - public abstract string ToJson(); - - // Check if the contains TypeEnum value - protected static bool ContainsValue(string type) where T : struct, IConvertible - { - // Search for type in .TypeEnum - List list = new List(); - var members = typeof(T).GetTypeInfo().DeclaredMembers; - foreach (var member in members) - { - var val = member?.GetCustomAttribute(false)?.Value; - if (!string.IsNullOrEmpty(val)) - { - list.Add(val); - } - } - - return list.Contains(type); - } - } -} diff --git a/z_templates/csharp/api-single.mustache b/z_templates/csharp/api-single.mustache deleted file mode 100644 index da60553d0..000000000 --- a/z_templates/csharp/api-single.mustache +++ /dev/null @@ -1,87 +0,0 @@ -{{>partial_header}} -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using Adyen.Constants; -using Adyen.Model; -{{#hasImport}}using Adyen.{{modelPackage}}; -{{/hasImport}} - -namespace {{packageName}}.Service -{ -{{#operations}} - /// - /// {{classname}} Interface - /// - public interface I{{customApi}}Service - { - {{#operation}} -{{>method_documentation}} - {{#returnType}} - /// . - {{/returnType}} - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - {{#returnType}}{{modelPackage}}.{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}({{>api_parameters}}); - - {{#supportsAsync}} -{{>method_documentation}} - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects.{{#returnType}} - /// Task of .{{/returnType}} - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - {{#returnType}}Task<{{modelPackage}}.{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_parameters_async}}); - - {{/supportsAsync}} - {{/operation}} - } - {{/operations}} - - {{#operations}} - /// - /// Represents a collection of functions to interact with the {{customApi}}Service API endpoints - /// - {{>visibility}} class {{customApi}}Service : AbstractService, I{{customApi}}Service - { - private readonly string _baseUrl; - - public {{customApi}}Service(Client client) : base(client) - { - _baseUrl = CreateBaseUrl("{{{basePath}}}"); - } - {{#operation}} - - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - public {{#returnType}}{{modelPackage}}.{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}({{>api_parameters}}) - { - {{#returnType}}return {{/returnType}}{{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_invoke}}).ConfigureAwait(false).GetAwaiter().GetResult(); - } - - {{#supportsAsync}} - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - {{#returnType}}public async Task<{{modelPackage}}.{{{.}}}>{{/returnType}}{{^returnType}}public async Task{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_parameters_async}}) - { - {{#hasQueryParams}} - // Build the query string - var queryParams = new Dictionary(); - {{#queryParams}} - {{^required}}if ({{paramName}} != null) {{/required}}queryParams.Add("{{baseName}}", {{paramName}}{{^isString}}{{^isDateTime}}.Value.ToString(){{/isDateTime}}{{#isDateTime}}.ToString("yyyy-MM-ddTHH:mm:ssZ"){{/isDateTime}}{{/isString}}); - {{/queryParams}} - {{/hasQueryParams}} - var endpoint = _baseUrl + {{#hasPathParams}}${{/hasPathParams}}"{{{path}}}"{{#hasQueryParams}} + ToQueryString(queryParams){{/hasQueryParams}}; - var resource = new ServiceResource(this, endpoint); - {{#returnType}}return {{/returnType}}await resource.RequestAsync{{#returnType}}<{{modelPackage}}.{{returnType}}>{{/returnType}}({{#bodyParam}}{{paramName}}.ToJson(){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, requestOptions, new HttpMethod("{{httpMethod}}"), cancellationToken).ConfigureAwait(false); - } - {{/supportsAsync}} - {{/operation}} - } - {{/operations}} -} \ No newline at end of file diff --git a/z_templates/csharp/api.mustache b/z_templates/csharp/api.mustache deleted file mode 100644 index 27ff0eb4d..000000000 --- a/z_templates/csharp/api.mustache +++ /dev/null @@ -1,86 +0,0 @@ -{{>partial_header}} -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using Adyen.Model; -{{#hasImport}}using Adyen.{{modelPackage}}; -{{/hasImport}} - -namespace {{packageName}}.{{apiPackage}} -{ -{{#operations}} - /// - /// {{classname}} Interface - /// - public interface I{{classname}} - { - {{#operation}} -{{>method_documentation}} - {{#returnType}} - /// . - {{/returnType}} - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - {{#returnType}}{{modelPackage}}.{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}({{>api_parameters}}); - - {{#supportsAsync}} -{{>method_documentation}} - /// A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects.{{#returnType}} - /// Task of .{{/returnType}} - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - {{#returnType}}Task<{{modelPackage}}.{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_parameters_async}}); - - {{/supportsAsync}} - {{/operation}} - } - {{/operations}} - - {{#operations}} - /// - /// Represents a collection of functions to interact with the {{classname}} API endpoints - /// - {{>visibility}} class {{classname}} : AbstractService, I{{classname}} - { - private readonly string _baseUrl; - - public {{classname}}(Client client) : base(client) - { - _baseUrl = CreateBaseUrl("{{{basePath}}}"); - } - {{#operation}} - - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - public {{#returnType}}{{modelPackage}}.{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}({{>api_parameters}}) - { - {{#returnType}}return {{/returnType}}{{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_invoke}}).ConfigureAwait(false).GetAwaiter().GetResult(); - } - - {{#supportsAsync}} - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - {{#returnType}}public async Task<{{modelPackage}}.{{{.}}}>{{/returnType}}{{^returnType}}public async Task{{/returnType}} {{#lambda.pascalcase}}{{vendorExtensions.x-methodName}}{{/lambda.pascalcase}}Async({{>api_parameters_async}}) - { - {{#hasQueryParams}} - // Build the query string - var queryParams = new Dictionary(); - {{#queryParams}} - {{^required}}if ({{paramName}} != null) {{/required}}queryParams.Add("{{baseName}}", {{paramName}}{{^isString}}{{^isDateTime}}.ToString(){{/isDateTime}}{{#isDateTime}}{{^required}}.Value{{/required}}.ToString("yyyy-MM-ddTHH:mm:ssZ"){{/isDateTime}}{{/isString}}); - {{/queryParams}} - {{/hasQueryParams}} - var endpoint = _baseUrl + {{#hasPathParams}}${{/hasPathParams}}"{{{path}}}"{{#hasQueryParams}} + ToQueryString(queryParams){{/hasQueryParams}}; - var resource = new ServiceResource(this, endpoint); - {{#returnType}}return {{/returnType}}await resource.RequestAsync{{#returnType}}<{{modelPackage}}.{{returnType}}>{{/returnType}}({{#bodyParam}}{{paramName}}.ToJson(){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, requestOptions, new HttpMethod("{{httpMethod}}"), cancellationToken).ConfigureAwait(false); - } - {{/supportsAsync}} - {{/operation}} - } - {{/operations}} -} \ No newline at end of file diff --git a/z_templates/csharp/api_invoke.mustache b/z_templates/csharp/api_invoke.mustache deleted file mode 100644 index 45815fc53..000000000 --- a/z_templates/csharp/api_invoke.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#requiredParams}}{{#isPathParam}}{{paramName}}, {{/isPathParam}}{{#isBodyParam}}{{paramName}}, {{/isBodyParam}}{{#isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/requiredParams}}{{#optionalParams}}{{#isPathParam}}{{paramName}}, {{/isPathParam}}{{#isBodyParam}}{{paramName}}, {{/isBodyParam}}{{#isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/optionalParams}}requestOptions \ No newline at end of file diff --git a/z_templates/csharp/api_parameter_ordering.mustache b/z_templates/csharp/api_parameter_ordering.mustache deleted file mode 100644 index 593846f25..000000000 --- a/z_templates/csharp/api_parameter_ordering.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isPathParam}}{{{dataType}}} {{paramName}} = default, {{/isPathParam}}{{#isBodyParam}}{{{dataType}}} {{paramName}} = default, {{/isBodyParam}}{{#isQueryParam}}{{{dataType}}} {{paramName}} = default, {{/isQueryParam}} \ No newline at end of file diff --git a/z_templates/csharp/api_parameter_ordering_required.mustache b/z_templates/csharp/api_parameter_ordering_required.mustache deleted file mode 100644 index 0c1ecfea1..000000000 --- a/z_templates/csharp/api_parameter_ordering_required.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isPathParam}}{{{dataType}}} {{paramName}}, {{/isPathParam}}{{#isBodyParam}}{{{dataType}}} {{paramName}}, {{/isBodyParam}}{{#isQueryParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}} \ No newline at end of file diff --git a/z_templates/csharp/api_parameters.mustache b/z_templates/csharp/api_parameters.mustache deleted file mode 100644 index 3ca742884..000000000 --- a/z_templates/csharp/api_parameters.mustache +++ /dev/null @@ -1,2 +0,0 @@ -{{! Path and body are required, followed by optional query string and request options }} -{{#requiredParams}}{{>api_parameter_ordering_required}}{{/requiredParams}}{{#optionalParams}}{{>api_parameter_ordering}}{{/optionalParams}}RequestOptions requestOptions = default \ No newline at end of file diff --git a/z_templates/csharp/api_parameters_async.mustache b/z_templates/csharp/api_parameters_async.mustache deleted file mode 100644 index 4287dc8b4..000000000 --- a/z_templates/csharp/api_parameters_async.mustache +++ /dev/null @@ -1,2 +0,0 @@ -{{! Path and body are required, followed by optional query string and request options }} -{{#requiredParams}}{{>api_parameter_ordering_required}}{{/requiredParams}}{{#optionalParams}}{{>api_parameter_ordering}}{{/optionalParams}}RequestOptions requestOptions = default, CancellationToken cancellationToken = default \ No newline at end of file diff --git a/z_templates/csharp/config.yaml b/z_templates/csharp/config.yaml deleted file mode 100644 index 829b2714b..000000000 --- a/z_templates/csharp/config.yaml +++ /dev/null @@ -1,6 +0,0 @@ -templateDir: ./templates/csharp -files: - api-single.mustache: - folder: api - templateType: API - destinationFilename: Single.cs \ No newline at end of file diff --git a/z_templates/csharp/method_documentation.mustache b/z_templates/csharp/method_documentation.mustache deleted file mode 100644 index 537b3924e..000000000 --- a/z_templates/csharp/method_documentation.mustache +++ /dev/null @@ -1,13 +0,0 @@ - /// - /// {{{summary}}} - /// - {{#pathParams}} - /// - {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/pathParams}} - {{#bodyParams}} - /// - {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/bodyParams}} - {{#queryParams}} - /// - {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/queryParams}} - /// - Additional request options. \ No newline at end of file diff --git a/z_templates/csharp/model.mustache b/z_templates/csharp/model.mustache deleted file mode 100644 index 069785679..000000000 --- a/z_templates/csharp/model.mustache +++ /dev/null @@ -1,43 +0,0 @@ -{{>partial_header}} -{{#models}} -{{#model}} -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.IO; -{{#vendorExtensions.x-com-visible}} -using System.Runtime.InteropServices; -{{/vendorExtensions.x-com-visible}} -using System.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -{{#discriminator}} -using JsonSubTypes; -{{/discriminator}} -{{/model}} -{{/models}} -using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; -{{#models}} -{{#model}} -{{#oneOf}} -{{#-first}} -using System.Reflection; -{{/-first}} -{{/oneOf}} -{{#anyOf}} -{{#-first}} -using System.Reflection; -{{/-first}} -{{/anyOf}} - -namespace {{packageName}}.{{modelPackage}} -{ -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} -{{/model}} -{{/models}} -} diff --git a/z_templates/csharp/modelGeneric.mustache b/z_templates/csharp/modelGeneric.mustache deleted file mode 100644 index ffeedcb6e..000000000 --- a/z_templates/csharp/modelGeneric.mustache +++ /dev/null @@ -1,384 +0,0 @@ - /// - /// {{description}}{{^description}}{{classname}}{{/description}} - /// - {{#vendorExtensions.x-cls-compliant}} - [CLSCompliant({{{vendorExtensions.x-cls-compliant}}})] - {{/vendorExtensions.x-cls-compliant}} - {{#vendorExtensions.x-com-visible}} - [ComVisible({{{vendorExtensions.x-com-visible}}})] - {{/vendorExtensions.x-com-visible}} - [DataContract(Name = "{{{name}}}")] - {{#discriminator}} - [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")] - {{#mappedModels}} - [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] - {{/mappedModels}} - {{/discriminator}} - {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} - { - {{#vars}} - {{#items.isEnum}} - {{#items}} - {{^complexType}} -{{>modelInnerEnum}} - {{/complexType}} - {{/items}} - {{/items.isEnum}} - {{#isEnum}} - {{^complexType}} -{{>modelInnerEnum}} - {{/complexType}} - {{/isEnum}} - {{#isEnum}} - - /// - /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} - /// - {{#description}} - /// {{.}} - {{/description}} - {{^conditionalSerialization}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}false{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}false{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#deprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/deprecated}} - public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } - {{#isReadOnly}} - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return false; - } - {{/isReadOnly}} - {{/conditionalSerialization}} - {{#conditionalSerialization}} - {{#isReadOnly}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}false{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}false{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#deprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/deprecated}} - public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return false; - } - {{/isReadOnly}} - - {{^isReadOnly}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#deprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/deprecated}} - public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} - { - get{ return _{{name}};} - set - { - _{{name}} = value; - _flag{{name}} = true; - } - } - private {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} _{{name}}; - private bool _flag{{name}}; - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return _flag{{name}}; - } - {{/isReadOnly}} - {{/conditionalSerialization}} - {{/isEnum}} - {{/vars}} - {{#hasRequired}} - {{^hasOnlyReadOnly}} - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - {{^isAdditionalPropertiesTrue}} - protected {{classname}}() { } - {{/isAdditionalPropertiesTrue}} - {{#isAdditionalPropertiesTrue}} - protected {{classname}}() - { - this.AdditionalProperties = new Dictionary(); - } - {{/isAdditionalPropertiesTrue}} - {{/hasOnlyReadOnly}} - {{/hasRequired}} - /// - /// Initializes a new instance of the class. - /// - {{#readWriteVars}} - /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. - {{/readWriteVars}} - {{#hasOnlyReadOnly}} - [JsonConstructorAttribute] - {{/hasOnlyReadOnly}} - public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isNumeric}}?{{/isNumeric}}{{#isBoolean}}{{^isNullable}}?{{/isNullable}}{{/isBoolean}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{#defaultValue}}{{^isDateTime}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isNumeric}}?{{/isNumeric}}{{#isBoolean}}{{^isNullable}}?{{/isNullable}}{{/isBoolean}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} - { - {{#vars}} - {{^isInherited}} - {{^isReadOnly}} - {{#required}} - {{^conditionalSerialization}} - {{^vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{#vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{/conditionalSerialization}} - {{#conditionalSerialization}} - {{^vendorExtensions.x-csharp-value-type}} - this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{#vendorExtensions.x-csharp-value-type}} - this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{/conditionalSerialization}} - {{/required}} - {{/isReadOnly}} - {{/isInherited}} - {{/vars}} - {{#vars}} - {{^isInherited}} - {{^isReadOnly}} - {{^required}} - {{#defaultValue}} - {{^conditionalSerialization}} - {{^vendorExtensions.x-csharp-value-type}} - // use default value if no "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" provided - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? {{{defaultValue}}}; - {{/vendorExtensions.x-csharp-value-type}} - {{#vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{/conditionalSerialization}} - {{/defaultValue}} - {{^defaultValue}} - {{^conditionalSerialization}} - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - {{/conditionalSerialization}} - {{#conditionalSerialization}} - this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - if (this.{{name}} != null) - { - this._flag{{name}} = true; - } - {{/conditionalSerialization}} - {{/defaultValue}} - {{/required}} - {{/isReadOnly}} - {{/isInherited}} - {{/vars}} - {{#isAdditionalPropertiesTrue}} - this.AdditionalProperties = new Dictionary(); - {{/isAdditionalPropertiesTrue}} - } - - {{#vars}} - {{^isInherited}} - {{^isEnum}} - /// - /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} - /// {{#description}} - /// {{.}}{{/description}} - {{^conditionalSerialization}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}false{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}false{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#isDate}} - [JsonConverter(typeof(OpenAPIDateConverter))] - {{/isDate}} - {{#deprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/deprecated}} - public {{{dataType}}}{{#isNumeric}}?{{/isNumeric}}{{#isBoolean}}{{^isNullable}}?{{/isNullable}}{{/isBoolean}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } - - {{/conditionalSerialization}} - {{#conditionalSerialization}} - {{#isReadOnly}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#isDate}} - [JsonConverter(typeof(OpenAPIDateConverter))] - {{/isDate}} - {{#deprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/deprecated}} - public {{{dataType}}} {{name}} { get; private set; } - - {{/isReadOnly}} - {{^isReadOnly}} - {{#isDate}} - [JsonConverter(typeof(OpenAPIDateConverter))] - {{/isDate}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = false{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}false{{/required}}{{^required}}{{#isBoolean}}false{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#deprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/deprecated}} - public {{{dataType}}} {{name}} - { - get{ return _{{name}};} - set - { - _{{name}} = value; - _flag{{name}} = true; - } - } - private {{{dataType}}} _{{name}}; - private bool _flag{{name}}; - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return _flag{{name}}; - } - {{/isReadOnly}} - {{/conditionalSerialization}} - {{/isEnum}} - {{/isInherited}} - {{/vars}} - {{#isAdditionalPropertiesTrue}} - /// - /// Gets or Sets additional properties - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { get; set; } - - {{/isAdditionalPropertiesTrue}} - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - StringBuilder sb = new StringBuilder(); - sb.Append("class {{classname}} {\n"); - {{#parent}} - sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - {{/parent}} - {{#vars}} - sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); - {{/vars}} - {{#isAdditionalPropertiesTrue}} - sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); - {{/isAdditionalPropertiesTrue}} - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public {{#parent}}{{^isArray}}{{^isMap}}override {{/isMap}}{{/isArray}}{{/parent}}{{^parent}}virtual {{/parent}}string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - return this.Equals(input as {{classname}}); - {{/useCompareNetObjects}} - } - - /// - /// Returns true if {{classname}} instances are equal - /// - /// Instance of {{classname}} to be compared - /// Boolean - public bool Equals({{classname}} input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - if (input == null) - { - return false; - } - return {{#vars}}{{#parent}}base.Equals(input) && {{/parent}}{{^isContainer}} - ( - this.{{name}} == input.{{name}} || - {{^vendorExtensions.x-is-value-type}} - (this.{{name}} != null && - this.{{name}}.Equals(input.{{name}})) - {{/vendorExtensions.x-is-value-type}} - {{#vendorExtensions.x-is-value-type}} - this.{{name}}.Equals(input.{{name}}) - {{/vendorExtensions.x-is-value-type}} - ){{^-last}} && {{/-last}}{{/isContainer}}{{#isContainer}} - ( - this.{{name}} == input.{{name}} || - {{^vendorExtensions.x-is-value-type}}this.{{name}} != null && - input.{{name}} != null && - {{/vendorExtensions.x-is-value-type}}this.{{name}}.SequenceEqual(input.{{name}}) - ){{^-last}} && {{/-last}}{{/isContainer}}{{/vars}}{{^vars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/vars}}{{^isAdditionalPropertiesTrue}};{{/isAdditionalPropertiesTrue}} - {{#isAdditionalPropertiesTrue}} - && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); - {{/isAdditionalPropertiesTrue}} - {{/useCompareNetObjects}} - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - {{#parent}} - int hashCode = base.GetHashCode(); - {{/parent}} - {{^parent}} - int hashCode = 41; - {{/parent}} - {{#vars}} - {{^vendorExtensions.x-is-value-type}} - if (this.{{name}} != null) - { - hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); - } - {{/vendorExtensions.x-is-value-type}} - {{#vendorExtensions.x-is-value-type}} - hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); - {{/vendorExtensions.x-is-value-type}} - {{/vars}} - {{#isAdditionalPropertiesTrue}} - if (this.AdditionalProperties != null) - { - hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); - } - {{/isAdditionalPropertiesTrue}} - return hashCode; - } - } -{{#validatable}} -{{>validatable}} -{{/validatable}} - } diff --git a/z_templates/csharp/modelOneOf.mustache b/z_templates/csharp/modelOneOf.mustache deleted file mode 100644 index 66721caf6..000000000 --- a/z_templates/csharp/modelOneOf.mustache +++ /dev/null @@ -1,286 +0,0 @@ -{{#model}} - /// - /// {{description}}{{^description}}{{classname}}{{/description}} - /// - {{#vendorExtensions.x-cls-compliant}} - [CLSCompliant({{{.}}})] - {{/vendorExtensions.x-cls-compliant}} - {{#vendorExtensions.x-com-visible}} - [ComVisible({{{.}}})] - {{/vendorExtensions.x-com-visible}} - [JsonConverter(typeof({{classname}}JsonConverter))] - [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} - { - {{#isNullable}} - /// - /// Initializes a new instance of the class. - /// - public {{classname}}() - { - this.IsNullable = true; - this.SchemaType= "oneOf"; - } - - {{/isNullable}} - {{#composedSchemas.oneOf}} - {{^isNull}} - /// - /// Initializes a new instance of the class - /// with the class - /// - /// An instance of {{dataType}}. - public {{classname}}({{{dataType}}} actualInstance) - { - this.IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; - } - - {{/isNull}} - {{/composedSchemas.oneOf}} - - private Object _actualInstance; - - /// - /// Gets or Sets ActualInstance - /// - public override Object ActualInstance - { - get - { - return _actualInstance; - } - set - { - {{#oneOf}} - {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) - { - this._actualInstance = value; - } - {{/oneOf}} - else - { - throw new ArgumentException("Invalid instance found. Must be the following types:{{#oneOf}} {{{.}}}{{^-last}},{{/-last}}{{/oneOf}}"); - } - } - } - {{#composedSchemas.oneOf}} - {{^isNull}} - - /// - /// Get the actual instance of `{{dataType}}`. If the actual instance is not `{{dataType}}`, - /// the InvalidClassException will be thrown - /// - /// An instance of {{dataType}} - public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}() - { - return ({{{dataType}}})this.ActualInstance; - } - {{/isNull}} - {{/composedSchemas.oneOf}} - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class {{classname}} {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public override string ToJson() - { - return JsonConvert.SerializeObject(this.ActualInstance, {{classname}}.SerializerSettings); - } - - /// - /// Converts the JSON string into an instance of {{classname}} - /// - /// JSON string - /// An instance of {{classname}} - public static {{classname}} FromJson(string jsonString) - { - {{classname}} new{{classname}} = null; - - if (string.IsNullOrEmpty(jsonString)) - { - return new{{classname}}; - } - {{#useOneOfDiscriminatorLookup}} - {{#discriminator}} - - try - { - var discriminatorObj = JObject.Parse(jsonString)["{{{propertyBaseName}}}"]; - string discriminatorValue = discriminatorObj == null ?string.Empty :discriminatorObj.ToString(); - switch (discriminatorValue) - { - {{#mappedModels}} - case "{{{mappingName}}}": - new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{modelName}}}>(jsonString, {{classname}}.AdditionalPropertiesSerializerSettings)); - return new{{classname}}; - {{/mappedModels}} - default: - System.Diagnostics.Debug.WriteLine(string.Format("Failed to lookup discriminator value `{0}` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); - break; - } - } - catch (Exception ex) - { - System.Diagnostics.Debug.WriteLine(string.Format("Failed to parse the json data : `{0}` {1}", jsonString, ex.ToString())); - } - - {{/discriminator}} - {{/useOneOfDiscriminatorLookup}} - int match = 0; - List matchedTypes = new List(); - JToken typeToken = JObject.Parse(jsonString).GetValue("type"); - string type = typeToken?.Value(); - // Throw exception if jsonString does not contain type param - if (type == null) - { - throw new InvalidDataException("JsonString does not contain required enum type for deserialization."); - } - try - { - {{#oneOf}} - // Check if the jsonString type enum matches the {{{.}}} type enums - if (ContainsValue<{{{.}}}.TypeEnum>(type)) - { - new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.SerializerSettings)); - matchedTypes.Add("{{{.}}}"); - match++; - } - {{/oneOf}} - } - catch (Exception ex) - { - if (!(ex is JsonSerializationException)) - { - throw new InvalidDataException(string.Format("Failed to deserialize `{0}` into target: {1}", jsonString, ex.ToString())); - } - } - - if (match != 1) - { - throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined. MatchedTypes are: " + matchedTypes); - } - - // deserialization is considered successful at this point if no exception has been thrown. - return new{{classname}}; - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - return this.Equals(input as {{classname}}); - {{/useCompareNetObjects}} - } - - /// - /// Returns true if {{classname}} instances are equal - /// - /// Instance of {{classname}} to be compared - /// Boolean - public bool Equals({{classname}} input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - if (input == null) - return false; - - return this.ActualInstance.Equals(input.ActualInstance); - {{/useCompareNetObjects}} - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); - return hashCode; - } - } - - {{#validatable}} - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - {{/validatable}} - } - - /// - /// Custom JSON converter for {{classname}} - /// - public class {{classname}}JsonConverter : JsonConverter - { - /// - /// To write the JSON string - /// - /// JSON writer - /// Object to be converted into a JSON string - /// JSON Serializer - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - writer.WriteRawValue((string)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); - } - - /// - /// To convert a JSON string into an object - /// - /// JSON reader - /// Object type - /// Existing value - /// JSON Serializer - /// The object converted from the JSON string - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - if(reader.TokenType != JsonToken.Null) - { - return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); - } - return null; - } - - /// - /// Check if the object can be converted - /// - /// Object type - /// True if the object can be converted - public override bool CanConvert(Type objectType) - { - return false; - } - } -{{/model}} diff --git a/z_templates/csharp/partial_header.mustache b/z_templates/csharp/partial_header.mustache deleted file mode 100644 index a4c7dd929..000000000 --- a/z_templates/csharp/partial_header.mustache +++ /dev/null @@ -1,12 +0,0 @@ -/* -{{#appName}} -* {{{.}}} -* -{{/appName}} -* -* {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ From f067c06daa818a592a64f535dbeafa5a0dd956b5 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 13 Oct 2025 21:44:54 +0200 Subject: [PATCH 033/126] Move from /src to root --- Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs | 12 +++++------- Adyen/Adyen.csproj | 5 ----- .../Converter/JsonBase64Converter.cs | 0 .../Converter/JsonConvertDeserializerWrapper.cs | 0 .../Converter/JsonConvertSerializerWrapper.cs | 0 .../Converter/SaleToPoiMessageConverter.cs | 0 .../Converter/SaleToPoiMessageSecuredConverter.cs | 0 Adyen/{src => }/ApiSerialization/IMessagePayload.cs | 0 .../ApiSerialization/IMessagePayloadSerializer.cs | 0 .../ApiSerialization/MessageHeaderSerializer.cs | 0 .../ApiSerialization/MessagePayloadSerializer.cs | 0 .../MessagePayloadSerializerFactory.cs | 0 .../ApiSerialization/OpenAPIDateConverter.cs | 0 .../SaleToPoiMessageSecuredSerializer.cs | 0 .../ApiSerialization/SaleToPoiMessageSerializer.cs | 0 Adyen/{src => }/ApiSerialization/TypeHelper.cs | 0 Adyen/{src => }/Constants/ApiConstants.cs | 0 Adyen/{src => }/Constants/ClientConfig.cs | 0 Adyen/{src => }/Constants/Region.cs | 0 Adyen/{src => }/Core/Auth/ApiKeyToken.cs | 0 Adyen/{src => }/Core/Auth/BasicToken.cs | 0 Adyen/{src => }/Core/Auth/CookieContainer.cs | 0 Adyen/{src => }/Core/Auth/RateLimitProvider.cs | 0 Adyen/{src => }/Core/Auth/TokenBase.cs | 0 Adyen/{src => }/Core/Auth/TokenContainer.cs | 0 Adyen/{src => }/Core/Auth/TokenProvider.cs | 0 Adyen/{src => }/Core/Client/ApiException.cs | 0 Adyen/{src => }/Core/Client/ApiFactory.cs | 0 Adyen/{src => }/Core/Client/ApiResponse.cs | 0 Adyen/{src => }/Core/Client/ApiResponseEventArgs.cs | 0 Adyen/{src => }/Core/Client/ExceptionEventArgs.cs | 0 .../Client/Extensions/HttpClientBuilderExtensions.cs | 0 Adyen/{src => }/Core/Client/IAdyenApiService.cs | 0 .../Core/Converters/DateOnlyJsonConverter.cs | 0 .../Core/Converters/DateOnlyNullableJsonConverter.cs | 0 .../Core/Converters/DateTimeJsonConverter.cs | 0 .../Core/Converters/DateTimeNullableJsonConverter.cs | 0 .../{src => }/Core/JsonSerializerOptionsProvider.cs | 0 Adyen/{src => }/Core/Option.cs | 0 .../{src => }/Exceptions/DeserializationException.cs | 0 Adyen/{src => }/Exceptions/ExceptionMessages.cs | 0 Adyen/{src => }/HttpClient/HttpClientException.cs | 0 Adyen/{src => }/HttpClient/HttpClientExtension.cs | 0 Adyen/{src => }/HttpClient/HttpClientWrapper.cs | 0 Adyen/{src => }/HttpClient/Interfaces/IClient.cs | 0 .../Model/AcsWebhooks/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/AcsWebhooks/Amount.cs | 0 .../Model/AcsWebhooks/AuthenticationDecision.cs | 0 .../Model/AcsWebhooks/AuthenticationInfo.cs | 0 .../AcsWebhooks/AuthenticationNotificationData.cs | 0 .../AcsWebhooks/AuthenticationNotificationRequest.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 Adyen/{src => }/Model/AcsWebhooks/ChallengeInfo.cs | 0 Adyen/{src => }/Model/AcsWebhooks/Purchase.cs | 0 Adyen/{src => }/Model/AcsWebhooks/PurchaseInfo.cs | 0 .../AcsWebhooks/RelayedAuthenticationRequest.cs | 0 .../AcsWebhooks/RelayedAuthenticationResponse.cs | 0 Adyen/{src => }/Model/AcsWebhooks/Resource.cs | 0 Adyen/{src => }/Model/AcsWebhooks/ServiceError.cs | 0 Adyen/{src => }/Model/ApiError.cs | 0 .../Model/ApplicationInformation/ApplicationInfo.cs | 0 .../Model/ApplicationInformation/CommonField.cs | 0 .../Model/ApplicationInformation/ExternalPlatform.cs | 0 .../Model/ApplicationInformation/MerchantDevice.cs | 0 .../ShopperInteractionDevice.cs | 0 .../Model/BalanceControl/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/BalanceControl/Amount.cs | 0 .../Model/BalanceControl/BalanceTransferRequest.cs | 0 .../Model/BalanceControl/BalanceTransferResponse.cs | 0 .../BalancePlatform/AULocalAccountIdentification.cs | 0 .../Model/BalancePlatform/AbstractOpenAPISchema.cs | 0 .../{src => }/Model/BalancePlatform/AccountHolder.cs | 0 .../Model/BalancePlatform/AccountHolderCapability.cs | 0 .../Model/BalancePlatform/AccountHolderInfo.cs | 0 .../BalancePlatform/AccountHolderUpdateRequest.cs | 0 .../AccountSupportingEntityCapability.cs | 0 .../ActiveNetworkTokensRestriction.cs | 0 .../BalancePlatform/AdditionalBankIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/Address.cs | 0 .../Model/BalancePlatform/AddressRequirement.cs | 0 Adyen/{src => }/Model/BalancePlatform/Amount.cs | 0 .../Model/BalancePlatform/AmountMinMaxRequirement.cs | 0 .../AmountNonZeroDecimalsRequirement.cs | 0 .../AssociationDelegatedAuthenticationData.cs | 0 .../BalancePlatform/AssociationFinaliseRequest.cs | 0 .../BalancePlatform/AssociationFinaliseResponse.cs | 0 .../BalancePlatform/AssociationInitiateRequest.cs | 0 .../BalancePlatform/AssociationInitiateResponse.cs | 0 .../Model/BalancePlatform/Authentication.cs | 0 .../BalancePlatform/BRLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/Balance.cs | 0 .../Model/BalancePlatform/BalanceAccount.cs | 0 .../Model/BalancePlatform/BalanceAccountBase.cs | 0 .../Model/BalancePlatform/BalanceAccountInfo.cs | 0 .../BalancePlatform/BalanceAccountUpdateRequest.cs | 0 .../Model/BalancePlatform/BalancePlatform.cs | 0 .../BalanceSweepConfigurationsResponse.cs | 0 Adyen/{src => }/Model/BalancePlatform/BankAccount.cs | 0 .../BankAccountAccountIdentification.cs | 0 .../Model/BalancePlatform/BankAccountDetails.cs | 0 .../BankAccountIdentificationTypeRequirement.cs | 0 .../BankAccountIdentificationValidationRequest.cs | 0 ...ficationValidationRequestAccountIdentification.cs | 0 .../Model/BalancePlatform/BankAccountModel.cs | 0 .../Model/BalancePlatform/BankIdentification.cs | 0 .../BalancePlatform/BrandVariantsRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/BulkAddress.cs | 0 .../BalancePlatform/CALocalAccountIdentification.cs | 0 .../BalancePlatform/CZLocalAccountIdentification.cs | 0 .../Model/BalancePlatform/CapabilityProblem.cs | 0 .../Model/BalancePlatform/CapabilityProblemEntity.cs | 0 .../CapabilityProblemEntityRecursive.cs | 0 .../Model/BalancePlatform/CapabilitySettings.cs | 0 .../Model/BalancePlatform/CapitalBalance.cs | 0 .../Model/BalancePlatform/CapitalGrantAccount.cs | 0 Adyen/{src => }/Model/BalancePlatform/Card.cs | 0 .../Model/BalancePlatform/CardConfiguration.cs | 0 Adyen/{src => }/Model/BalancePlatform/CardInfo.cs | 0 Adyen/{src => }/Model/BalancePlatform/CardOrder.cs | 0 .../{src => }/Model/BalancePlatform/CardOrderItem.cs | 0 .../BalancePlatform/CardOrderItemDeliveryStatus.cs | 0 .../Model/BalancePlatform/ContactDetails.cs | 0 .../{src => }/Model/BalancePlatform/Counterparty.cs | 0 .../BalancePlatform/CounterpartyBankRestriction.cs | 0 .../BalancePlatform/CounterpartyTypesRestriction.cs | 0 .../Model/BalancePlatform/CountriesRestriction.cs | 0 .../BalancePlatform/CreateSweepConfigurationV2.cs | 0 .../BalancePlatform/DKLocalAccountIdentification.cs | 0 .../Model/BalancePlatform/DayOfWeekRestriction.cs | 0 .../BalancePlatform/DelegatedAuthenticationData.cs | 0 .../Model/BalancePlatform/DeliveryAddress.cs | 0 .../Model/BalancePlatform/DeliveryContact.cs | 0 Adyen/{src => }/Model/BalancePlatform/Device.cs | 0 Adyen/{src => }/Model/BalancePlatform/DeviceInfo.cs | 0 .../DifferentCurrenciesRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/Duration.cs | 0 .../Model/BalancePlatform/EntryModesRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/Expiry.cs | 0 Adyen/{src => }/Model/BalancePlatform/Fee.cs | 0 .../Model/BalancePlatform/GetNetworkTokenResponse.cs | 0 .../Model/BalancePlatform/GetTaxFormResponse.cs | 0 Adyen/{src => }/Model/BalancePlatform/GrantLimit.cs | 0 Adyen/{src => }/Model/BalancePlatform/GrantOffer.cs | 0 Adyen/{src => }/Model/BalancePlatform/GrantOffers.cs | 0 .../BalancePlatform/HKLocalAccountIdentification.cs | 0 .../BalancePlatform/HULocalAccountIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/Href.cs | 0 .../BalancePlatform/IbanAccountIdentification.cs | 0 .../IbanAccountIdentificationRequirement.cs | 0 .../InternationalTransactionRestriction.cs | 0 .../{src => }/Model/BalancePlatform/InvalidField.cs | 0 Adyen/{src => }/Model/BalancePlatform/Link.cs | 0 .../BalancePlatform/ListNetworkTokensResponse.cs | 0 .../MatchingTransactionsRestriction.cs | 0 .../BalancePlatform/MatchingValuesRestriction.cs | 0 .../Model/BalancePlatform/MccsRestriction.cs | 0 .../Model/BalancePlatform/MerchantAcquirerPair.cs | 0 .../BalancePlatform/MerchantNamesRestriction.cs | 0 .../Model/BalancePlatform/MerchantsRestriction.cs | 0 .../BalancePlatform/NOLocalAccountIdentification.cs | 0 .../BalancePlatform/NZLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/Name.cs | 0 .../{src => }/Model/BalancePlatform/NetworkToken.cs | 0 .../NumberAndBicAccountIdentification.cs | 0 .../BalancePlatform/PLLocalAccountIdentification.cs | 0 .../PaginatedAccountHoldersResponse.cs | 0 .../PaginatedBalanceAccountsResponse.cs | 0 .../PaginatedGetCardOrderItemResponse.cs | 0 .../BalancePlatform/PaginatedGetCardOrderResponse.cs | 0 .../PaginatedPaymentInstrumentsResponse.cs | 0 .../Model/BalancePlatform/PaymentInstrument.cs | 0 ...umentAdditionalBankAccountIdentificationsInner.cs | 0 .../Model/BalancePlatform/PaymentInstrumentGroup.cs | 0 .../BalancePlatform/PaymentInstrumentGroupInfo.cs | 0 .../Model/BalancePlatform/PaymentInstrumentInfo.cs | 0 .../BalancePlatform/PaymentInstrumentRequirement.cs | 0 .../BalancePlatform/PaymentInstrumentRevealInfo.cs | 0 .../PaymentInstrumentRevealRequest.cs | 0 .../PaymentInstrumentRevealResponse.cs | 0 .../PaymentInstrumentUpdateRequest.cs | 0 Adyen/{src => }/Model/BalancePlatform/Phone.cs | 0 Adyen/{src => }/Model/BalancePlatform/PhoneNumber.cs | 0 .../Model/BalancePlatform/PinChangeRequest.cs | 0 .../Model/BalancePlatform/PinChangeResponse.cs | 0 .../BalancePlatform/PlatformPaymentConfiguration.cs | 0 .../BalancePlatform/ProcessingTypesRestriction.cs | 0 .../Model/BalancePlatform/PublicKeyResponse.cs | 0 .../BalancePlatform/RegisterSCAFinalResponse.cs | 0 .../Model/BalancePlatform/RegisterSCARequest.cs | 0 .../Model/BalancePlatform/RegisterSCAResponse.cs | 0 .../Model/BalancePlatform/RemediatingAction.cs | 0 Adyen/{src => }/Model/BalancePlatform/Repayment.cs | 0 .../{src => }/Model/BalancePlatform/RepaymentTerm.cs | 0 .../Model/BalancePlatform/RestServiceError.cs | 0 .../Model/BalancePlatform/RevealPinRequest.cs | 0 .../Model/BalancePlatform/RevealPinResponse.cs | 0 Adyen/{src => }/Model/BalancePlatform/RiskScores.cs | 0 .../Model/BalancePlatform/RiskScoresRestriction.cs | 0 .../BalancePlatform/SELocalAccountIdentification.cs | 0 .../BalancePlatform/SGLocalAccountIdentification.cs | 0 .../Model/BalancePlatform/SameAmountRestriction.cs | 0 .../BalancePlatform/SameCounterpartyRestriction.cs | 0 .../SearchRegisteredDevicesResponse.cs | 0 .../BalancePlatform/SourceAccountTypesRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/StringMatch.cs | 0 .../Model/BalancePlatform/SweepConfigurationV2.cs | 0 .../Model/BalancePlatform/SweepCounterparty.cs | 0 .../{src => }/Model/BalancePlatform/SweepSchedule.cs | 0 .../Model/BalancePlatform/ThresholdRepayment.cs | 0 Adyen/{src => }/Model/BalancePlatform/TimeOfDay.cs | 0 .../Model/BalancePlatform/TimeOfDayRestriction.cs | 0 .../BalancePlatform/TokenRequestorsRestriction.cs | 0 .../Model/BalancePlatform/TotalAmountRestriction.cs | 0 .../Model/BalancePlatform/TransactionRule.cs | 0 .../BalancePlatform/TransactionRuleEntityKey.cs | 0 .../Model/BalancePlatform/TransactionRuleInfo.cs | 0 .../Model/BalancePlatform/TransactionRuleInterval.cs | 0 .../Model/BalancePlatform/TransactionRuleResponse.cs | 0 .../BalancePlatform/TransactionRuleRestrictions.cs | 0 .../BalancePlatform/TransactionRulesResponse.cs | 0 .../{src => }/Model/BalancePlatform/TransferRoute.cs | 0 .../Model/BalancePlatform/TransferRouteRequest.cs | 0 .../TransferRouteRequirementsInner.cs | 0 .../Model/BalancePlatform/TransferRouteResponse.cs | 0 .../BalancePlatform/UKLocalAccountIdentification.cs | 0 .../USInternationalAchAddressRequirement.cs | 0 .../BalancePlatform/USLocalAccountIdentification.cs | 0 .../BalancePlatform/UpdateNetworkTokenRequest.cs | 0 .../Model/BalancePlatform/UpdatePaymentInstrument.cs | 0 .../BalancePlatform/UpdateSweepConfigurationV2.cs | 0 .../Model/BalancePlatform/VerificationDeadline.cs | 0 .../Model/BalancePlatform/VerificationError.cs | 0 .../BalancePlatform/VerificationErrorRecursive.cs | 0 .../Model/BinLookup/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/BinLookup/Amount.cs | 0 Adyen/{src => }/Model/BinLookup/BinDetail.cs | 0 Adyen/{src => }/Model/BinLookup/CardBin.cs | 0 .../Model/BinLookup/CostEstimateAssumptions.cs | 0 .../{src => }/Model/BinLookup/CostEstimateRequest.cs | 0 .../Model/BinLookup/CostEstimateResponse.cs | 0 Adyen/{src => }/Model/BinLookup/DSPublicKeyDetail.cs | 0 Adyen/{src => }/Model/BinLookup/MerchantDetails.cs | 0 Adyen/{src => }/Model/BinLookup/Recurring.cs | 0 Adyen/{src => }/Model/BinLookup/ServiceError.cs | 0 .../Model/BinLookup/ThreeDS2CardRangeDetail.cs | 0 .../Model/BinLookup/ThreeDSAvailabilityRequest.cs | 0 .../Model/BinLookup/ThreeDSAvailabilityResponse.cs | 0 .../Model/Checkout/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/Checkout/AccountInfo.cs | 0 Adyen/{src => }/Model/Checkout/AcctInfo.cs | 0 Adyen/{src => }/Model/Checkout/AchDetails.cs | 0 .../Model/Checkout/AdditionalData3DSecure.cs | 0 .../Model/Checkout/AdditionalDataAirline.cs | 0 .../Model/Checkout/AdditionalDataCarRental.cs | 0 .../{src => }/Model/Checkout/AdditionalDataCommon.cs | 0 .../Model/Checkout/AdditionalDataLevel23.cs | 0 .../Model/Checkout/AdditionalDataLodging.cs | 0 .../Model/Checkout/AdditionalDataOpenInvoice.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataOpi.cs | 0 .../Model/Checkout/AdditionalDataRatepay.cs | 0 .../{src => }/Model/Checkout/AdditionalDataRetry.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataRisk.cs | 0 .../Model/Checkout/AdditionalDataRiskStandalone.cs | 0 .../Model/Checkout/AdditionalDataSubMerchant.cs | 0 .../Checkout/AdditionalDataTemporaryServices.cs | 0 .../Model/Checkout/AdditionalDataWallets.cs | 0 Adyen/{src => }/Model/Checkout/Address.cs | 0 Adyen/{src => }/Model/Checkout/AffirmDetails.cs | 0 Adyen/{src => }/Model/Checkout/AfterpayDetails.cs | 0 Adyen/{src => }/Model/Checkout/Agency.cs | 0 Adyen/{src => }/Model/Checkout/Airline.cs | 0 Adyen/{src => }/Model/Checkout/AmazonPayDetails.cs | 0 Adyen/{src => }/Model/Checkout/Amount.cs | 0 Adyen/{src => }/Model/Checkout/Amounts.cs | 0 Adyen/{src => }/Model/Checkout/AncvDetails.cs | 0 Adyen/{src => }/Model/Checkout/AndroidPayDetails.cs | 0 Adyen/{src => }/Model/Checkout/ApplePayDetails.cs | 0 Adyen/{src => }/Model/Checkout/ApplePayDonations.cs | 0 .../Model/Checkout/ApplePaySessionRequest.cs | 0 .../Model/Checkout/ApplePaySessionResponse.cs | 0 Adyen/{src => }/Model/Checkout/ApplicationInfo.cs | 0 Adyen/{src => }/Model/Checkout/AuthenticationData.cs | 0 .../Model/Checkout/BacsDirectDebitDetails.cs | 0 .../{src => }/Model/Checkout/BalanceCheckRequest.cs | 0 .../{src => }/Model/Checkout/BalanceCheckResponse.cs | 0 Adyen/{src => }/Model/Checkout/BillDeskDetails.cs | 0 Adyen/{src => }/Model/Checkout/BillingAddress.cs | 0 Adyen/{src => }/Model/Checkout/BlikDetails.cs | 0 Adyen/{src => }/Model/Checkout/BrowserInfo.cs | 0 Adyen/{src => }/Model/Checkout/CancelOrderRequest.cs | 0 .../{src => }/Model/Checkout/CancelOrderResponse.cs | 0 Adyen/{src => }/Model/Checkout/CardBrandDetails.cs | 0 Adyen/{src => }/Model/Checkout/CardDetails.cs | 0 Adyen/{src => }/Model/Checkout/CardDetailsRequest.cs | 0 .../{src => }/Model/Checkout/CardDetailsResponse.cs | 0 Adyen/{src => }/Model/Checkout/CardDonations.cs | 0 Adyen/{src => }/Model/Checkout/CashAppDetails.cs | 0 Adyen/{src => }/Model/Checkout/CellulantDetails.cs | 0 .../{src => }/Model/Checkout/CheckoutAwaitAction.cs | 0 .../{src => }/Model/Checkout/CheckoutBankAccount.cs | 0 .../Model/Checkout/CheckoutBankTransferAction.cs | 0 .../CheckoutDelegatedAuthenticationAction.cs | 0 .../Model/Checkout/CheckoutNativeRedirectAction.cs | 0 .../Model/Checkout/CheckoutOrderResponse.cs | 0 .../Model/Checkout/CheckoutPaymentMethod.cs | 0 .../{src => }/Model/Checkout/CheckoutQrCodeAction.cs | 0 .../Model/Checkout/CheckoutRedirectAction.cs | 0 Adyen/{src => }/Model/Checkout/CheckoutSDKAction.cs | 0 .../Checkout/CheckoutSessionInstallmentOption.cs | 0 .../Checkout/CheckoutSessionThreeDS2RequestData.cs | 0 .../Model/Checkout/CheckoutThreeDS2Action.cs | 0 .../Model/Checkout/CheckoutVoucherAction.cs | 0 Adyen/{src => }/Model/Checkout/CommonField.cs | 0 Adyen/{src => }/Model/Checkout/Company.cs | 0 .../Model/Checkout/CreateCheckoutSessionRequest.cs | 0 .../Model/Checkout/CreateCheckoutSessionResponse.cs | 0 Adyen/{src => }/Model/Checkout/CreateOrderRequest.cs | 0 .../{src => }/Model/Checkout/CreateOrderResponse.cs | 0 Adyen/{src => }/Model/Checkout/DeliveryAddress.cs | 0 Adyen/{src => }/Model/Checkout/DeliveryMethod.cs | 0 .../Checkout/DetailsRequestAuthenticationData.cs | 0 .../{src => }/Model/Checkout/DeviceRenderOptions.cs | 0 Adyen/{src => }/Model/Checkout/DokuDetails.cs | 0 Adyen/{src => }/Model/Checkout/Donation.cs | 0 Adyen/{src => }/Model/Checkout/DonationCampaign.cs | 0 .../Model/Checkout/DonationCampaignsRequest.cs | 0 .../Model/Checkout/DonationCampaignsResponse.cs | 0 .../Model/Checkout/DonationPaymentMethod.cs | 0 .../Model/Checkout/DonationPaymentRequest.cs | 0 .../Model/Checkout/DonationPaymentResponse.cs | 0 Adyen/{src => }/Model/Checkout/DragonpayDetails.cs | 0 .../Model/Checkout/EBankingFinlandDetails.cs | 0 .../Model/Checkout/EcontextVoucherDetails.cs | 0 Adyen/{src => }/Model/Checkout/EftDetails.cs | 0 Adyen/{src => }/Model/Checkout/EncryptedOrderData.cs | 0 Adyen/{src => }/Model/Checkout/EnhancedSchemeData.cs | 0 Adyen/{src => }/Model/Checkout/ExternalPlatform.cs | 0 Adyen/{src => }/Model/Checkout/FastlaneDetails.cs | 0 Adyen/{src => }/Model/Checkout/ForexQuote.cs | 0 Adyen/{src => }/Model/Checkout/FraudCheckResult.cs | 0 Adyen/{src => }/Model/Checkout/FraudResult.cs | 0 Adyen/{src => }/Model/Checkout/FundOrigin.cs | 0 Adyen/{src => }/Model/Checkout/FundRecipient.cs | 0 .../Checkout/GenericIssuerPaymentMethodDetails.cs | 0 Adyen/{src => }/Model/Checkout/GooglePayDetails.cs | 0 Adyen/{src => }/Model/Checkout/GooglePayDonations.cs | 0 Adyen/{src => }/Model/Checkout/IdealDetails.cs | 0 Adyen/{src => }/Model/Checkout/IdealDonations.cs | 0 Adyen/{src => }/Model/Checkout/InputDetail.cs | 0 Adyen/{src => }/Model/Checkout/InstallmentOption.cs | 0 Adyen/{src => }/Model/Checkout/Installments.cs | 0 Adyen/{src => }/Model/Checkout/Item.cs | 0 Adyen/{src => }/Model/Checkout/KlarnaDetails.cs | 0 Adyen/{src => }/Model/Checkout/Leg.cs | 0 Adyen/{src => }/Model/Checkout/LineItem.cs | 0 .../Checkout/ListStoredPaymentMethodsResponse.cs | 0 Adyen/{src => }/Model/Checkout/Mandate.cs | 0 Adyen/{src => }/Model/Checkout/MasterpassDetails.cs | 0 Adyen/{src => }/Model/Checkout/MbwayDetails.cs | 0 Adyen/{src => }/Model/Checkout/MerchantDevice.cs | 0 .../Model/Checkout/MerchantRiskIndicator.cs | 0 Adyen/{src => }/Model/Checkout/MobilePayDetails.cs | 0 Adyen/{src => }/Model/Checkout/MolPayDetails.cs | 0 Adyen/{src => }/Model/Checkout/Name.cs | 0 Adyen/{src => }/Model/Checkout/OpenInvoiceDetails.cs | 0 Adyen/{src => }/Model/Checkout/Passenger.cs | 0 .../Model/Checkout/PayByBankAISDirectDebitDetails.cs | 0 Adyen/{src => }/Model/Checkout/PayByBankDetails.cs | 0 Adyen/{src => }/Model/Checkout/PayPalDetails.cs | 0 Adyen/{src => }/Model/Checkout/PayPayDetails.cs | 0 Adyen/{src => }/Model/Checkout/PayToDetails.cs | 0 Adyen/{src => }/Model/Checkout/PayUUpiDetails.cs | 0 .../{src => }/Model/Checkout/PayWithGoogleDetails.cs | 0 .../Model/Checkout/PayWithGoogleDonations.cs | 0 Adyen/{src => }/Model/Checkout/Payment.cs | 0 .../Model/Checkout/PaymentAmountUpdateRequest.cs | 0 .../Model/Checkout/PaymentAmountUpdateResponse.cs | 0 .../{src => }/Model/Checkout/PaymentCancelRequest.cs | 0 .../Model/Checkout/PaymentCancelResponse.cs | 0 .../Model/Checkout/PaymentCaptureRequest.cs | 0 .../Model/Checkout/PaymentCaptureResponse.cs | 0 .../Model/Checkout/PaymentCompletionDetails.cs | 0 Adyen/{src => }/Model/Checkout/PaymentDetails.cs | 0 .../Model/Checkout/PaymentDetailsRequest.cs | 0 .../Model/Checkout/PaymentDetailsResponse.cs | 0 Adyen/{src => }/Model/Checkout/PaymentLinkRequest.cs | 0 .../{src => }/Model/Checkout/PaymentLinkResponse.cs | 0 Adyen/{src => }/Model/Checkout/PaymentMethod.cs | 0 Adyen/{src => }/Model/Checkout/PaymentMethodGroup.cs | 0 .../{src => }/Model/Checkout/PaymentMethodIssuer.cs | 0 .../{src => }/Model/Checkout/PaymentMethodToStore.cs | 0 .../{src => }/Model/Checkout/PaymentMethodUPIApps.cs | 0 .../Model/Checkout/PaymentMethodsRequest.cs | 0 .../Model/Checkout/PaymentMethodsResponse.cs | 0 .../{src => }/Model/Checkout/PaymentRefundRequest.cs | 0 .../Model/Checkout/PaymentRefundResponse.cs | 0 Adyen/{src => }/Model/Checkout/PaymentRequest.cs | 0 Adyen/{src => }/Model/Checkout/PaymentResponse.cs | 0 .../Model/Checkout/PaymentResponseAction.cs | 0 .../Model/Checkout/PaymentReversalRequest.cs | 0 .../Model/Checkout/PaymentReversalResponse.cs | 0 .../Model/Checkout/PaypalUpdateOrderRequest.cs | 0 .../Model/Checkout/PaypalUpdateOrderResponse.cs | 0 Adyen/{src => }/Model/Checkout/Phone.cs | 0 Adyen/{src => }/Model/Checkout/PixDetails.cs | 0 Adyen/{src => }/Model/Checkout/PixRecurring.cs | 0 .../Model/Checkout/PlatformChargebackLogic.cs | 0 Adyen/{src => }/Model/Checkout/PseDetails.cs | 0 Adyen/{src => }/Model/Checkout/RakutenPayDetails.cs | 0 Adyen/{src => }/Model/Checkout/RatepayDetails.cs | 0 Adyen/{src => }/Model/Checkout/Recurring.cs | 0 .../Model/Checkout/ResponseAdditionalData3DSecure.cs | 0 .../Checkout/ResponseAdditionalDataBillingAddress.cs | 0 .../Model/Checkout/ResponseAdditionalDataCard.cs | 0 .../Model/Checkout/ResponseAdditionalDataCommon.cs | 0 .../Checkout/ResponseAdditionalDataDomesticError.cs | 0 .../Checkout/ResponseAdditionalDataInstallments.cs | 0 .../Checkout/ResponseAdditionalDataNetworkTokens.cs | 0 .../Model/Checkout/ResponseAdditionalDataOpi.cs | 0 .../Model/Checkout/ResponseAdditionalDataSepa.cs | 0 .../Model/Checkout/ResponsePaymentMethod.cs | 0 Adyen/{src => }/Model/Checkout/RiskData.cs | 0 Adyen/{src => }/Model/Checkout/RivertyDetails.cs | 0 Adyen/{src => }/Model/Checkout/SDKEphemPubKey.cs | 0 Adyen/{src => }/Model/Checkout/SamsungPayDetails.cs | 0 .../Model/Checkout/SepaDirectDebitDetails.cs | 0 Adyen/{src => }/Model/Checkout/ServiceError.cs | 0 .../Model/Checkout/SessionResultResponse.cs | 0 .../Model/Checkout/ShopperInteractionDevice.cs | 0 Adyen/{src => }/Model/Checkout/Split.cs | 0 Adyen/{src => }/Model/Checkout/SplitAmount.cs | 0 .../Model/Checkout/StandalonePaymentCancelRequest.cs | 0 .../Checkout/StandalonePaymentCancelResponse.cs | 0 .../{src => }/Model/Checkout/StoredPaymentMethod.cs | 0 .../Model/Checkout/StoredPaymentMethodDetails.cs | 0 .../Model/Checkout/StoredPaymentMethodRequest.cs | 0 .../Model/Checkout/StoredPaymentMethodResource.cs | 0 Adyen/{src => }/Model/Checkout/SubInputDetail.cs | 0 Adyen/{src => }/Model/Checkout/SubMerchant.cs | 0 Adyen/{src => }/Model/Checkout/SubMerchantInfo.cs | 0 Adyen/{src => }/Model/Checkout/Surcharge.cs | 0 Adyen/{src => }/Model/Checkout/TaxTotal.cs | 0 .../{src => }/Model/Checkout/ThreeDS2RequestData.cs | 0 .../Model/Checkout/ThreeDS2RequestFields.cs | 0 .../{src => }/Model/Checkout/ThreeDS2ResponseData.cs | 0 Adyen/{src => }/Model/Checkout/ThreeDS2Result.cs | 0 Adyen/{src => }/Model/Checkout/ThreeDSRequestData.cs | 0 .../Checkout/ThreeDSRequestorAuthenticationInfo.cs | 0 .../ThreeDSRequestorPriorAuthenticationInfo.cs | 0 Adyen/{src => }/Model/Checkout/ThreeDSecureData.cs | 0 Adyen/{src => }/Model/Checkout/Ticket.cs | 0 Adyen/{src => }/Model/Checkout/TravelAgency.cs | 0 Adyen/{src => }/Model/Checkout/TwintDetails.cs | 0 .../Model/Checkout/UpdatePaymentLinkRequest.cs | 0 Adyen/{src => }/Model/Checkout/UpiCollectDetails.cs | 0 Adyen/{src => }/Model/Checkout/UpiIntentDetails.cs | 0 Adyen/{src => }/Model/Checkout/UtilityRequest.cs | 0 Adyen/{src => }/Model/Checkout/UtilityResponse.cs | 0 Adyen/{src => }/Model/Checkout/VippsDetails.cs | 0 .../{src => }/Model/Checkout/VisaCheckoutDetails.cs | 0 Adyen/{src => }/Model/Checkout/WeChatPayDetails.cs | 0 .../Model/Checkout/WeChatPayMiniProgramDetails.cs | 0 Adyen/{src => }/Model/Checkout/ZipDetails.cs | 0 .../ConfigurationWebhooks/AbstractOpenAPISchema.cs | 0 .../Model/ConfigurationWebhooks/AccountHolder.cs | 0 .../ConfigurationWebhooks/AccountHolderCapability.cs | 0 .../AccountHolderNotificationData.cs | 0 .../AccountHolderNotificationRequest.cs | 0 .../AccountSupportingEntityCapability.cs | 0 .../{src => }/Model/ConfigurationWebhooks/Address.cs | 0 .../{src => }/Model/ConfigurationWebhooks/Amount.cs | 0 .../Model/ConfigurationWebhooks/Authentication.cs | 0 .../{src => }/Model/ConfigurationWebhooks/Balance.cs | 0 .../Model/ConfigurationWebhooks/BalanceAccount.cs | 0 .../BalanceAccountNotificationData.cs | 0 .../BalanceAccountNotificationRequest.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../ConfigurationWebhooks/BankAccountDetails.cs | 0 .../Model/ConfigurationWebhooks/BulkAddress.cs | 0 .../Model/ConfigurationWebhooks/CapabilityProblem.cs | 0 .../ConfigurationWebhooks/CapabilityProblemEntity.cs | 0 .../CapabilityProblemEntityRecursive.cs | 0 .../ConfigurationWebhooks/CapabilitySettings.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Card.cs | 0 .../Model/ConfigurationWebhooks/CardConfiguration.cs | 0 .../Model/ConfigurationWebhooks/CardOrderItem.cs | 0 .../CardOrderItemDeliveryStatus.cs | 0 .../CardOrderNotificationRequest.cs | 0 .../Model/ConfigurationWebhooks/ContactDetails.cs | 0 .../Model/ConfigurationWebhooks/DeliveryAddress.cs | 0 .../Model/ConfigurationWebhooks/DeliveryContact.cs | 0 .../{src => }/Model/ConfigurationWebhooks/Device.cs | 0 .../{src => }/Model/ConfigurationWebhooks/Expiry.cs | 0 .../IbanAccountIdentification.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Name.cs | 0 .../NetworkTokenNotificationDataV2.cs | 0 .../NetworkTokenNotificationRequest.cs | 0 .../ConfigurationWebhooks/NetworkTokenRequestor.cs | 0 .../Model/ConfigurationWebhooks/PaymentInstrument.cs | 0 ...umentAdditionalBankAccountIdentificationsInner.cs | 0 .../PaymentInstrumentNotificationData.cs | 0 .../PaymentNotificationRequest.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Phone.cs | 0 .../Model/ConfigurationWebhooks/PhoneNumber.cs | 0 .../PlatformPaymentConfiguration.cs | 0 .../Model/ConfigurationWebhooks/RemediatingAction.cs | 0 .../Model/ConfigurationWebhooks/Resource.cs | 0 .../SweepConfigurationNotificationData.cs | 0 .../SweepConfigurationNotificationRequest.cs | 0 .../ConfigurationWebhooks/SweepConfigurationV2.cs | 0 .../Model/ConfigurationWebhooks/SweepCounterparty.cs | 0 .../Model/ConfigurationWebhooks/SweepSchedule.cs | 0 .../ConfigurationWebhooks/TokenAuthentication.cs | 0 .../Model/ConfigurationWebhooks/ValidationFacts.cs | 0 .../ConfigurationWebhooks/VerificationDeadline.cs | 0 .../Model/ConfigurationWebhooks/VerificationError.cs | 0 .../VerificationErrorRecursive.cs | 0 .../{src => }/Model/ConfigurationWebhooks/Wallet.cs | 0 .../Model/DataProtection/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/DataProtection/ServiceError.cs | 0 .../SubjectErasureByPspReferenceRequest.cs | 0 .../Model/DataProtection/SubjectErasureResponse.cs | 0 .../Model/DisputeWebhooks/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/DisputeWebhooks/Amount.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../DisputeWebhooks/DisputeEventNotification.cs | 0 .../DisputeWebhooks/DisputeNotificationRequest.cs | 0 .../Model/Disputes/AbstractOpenAPISchema.cs | 0 .../{src => }/Model/Disputes/AcceptDisputeRequest.cs | 0 .../Model/Disputes/AcceptDisputeResponse.cs | 0 .../{src => }/Model/Disputes/DefendDisputeRequest.cs | 0 .../Model/Disputes/DefendDisputeResponse.cs | 0 Adyen/{src => }/Model/Disputes/DefenseDocument.cs | 0 .../{src => }/Model/Disputes/DefenseDocumentType.cs | 0 Adyen/{src => }/Model/Disputes/DefenseReason.cs | 0 .../Model/Disputes/DefenseReasonsRequest.cs | 0 .../Model/Disputes/DefenseReasonsResponse.cs | 0 .../Model/Disputes/DeleteDefenseDocumentRequest.cs | 0 .../Model/Disputes/DeleteDefenseDocumentResponse.cs | 0 .../{src => }/Model/Disputes/DisputeServiceResult.cs | 0 Adyen/{src => }/Model/Disputes/ServiceError.cs | 0 .../Model/Disputes/SupplyDefenseDocumentRequest.cs | 0 .../Model/Disputes/SupplyDefenseDocumentResponse.cs | 0 Adyen/{src => }/Model/Environment.cs | 0 .../AULocalAccountIdentification.cs | 0 .../LegalEntityManagement/AbstractOpenAPISchema.cs | 0 .../AcceptTermsOfServiceRequest.cs | 0 .../AcceptTermsOfServiceResponse.cs | 0 .../AdditionalBankIdentification.cs | 0 .../{src => }/Model/LegalEntityManagement/Address.cs | 0 .../{src => }/Model/LegalEntityManagement/Amount.cs | 0 .../Model/LegalEntityManagement/Attachment.cs | 0 .../Model/LegalEntityManagement/BankAccountInfo.cs | 0 .../BankAccountInfoAccountIdentification.cs | 0 .../Model/LegalEntityManagement/BirthData.cs | 0 .../Model/LegalEntityManagement/BusinessLine.cs | 0 .../Model/LegalEntityManagement/BusinessLineInfo.cs | 0 .../LegalEntityManagement/BusinessLineInfoUpdate.cs | 0 .../Model/LegalEntityManagement/BusinessLines.cs | 0 .../CALocalAccountIdentification.cs | 0 .../CZLocalAccountIdentification.cs | 0 .../CalculatePciStatusRequest.cs | 0 .../CalculatePciStatusResponse.cs | 0 .../CalculateTermsOfServiceStatusResponse.cs | 0 .../Model/LegalEntityManagement/CapabilityProblem.cs | 0 .../LegalEntityManagement/CapabilityProblemEntity.cs | 0 .../CapabilityProblemEntityRecursive.cs | 0 .../LegalEntityManagement/CapabilitySettings.cs | 0 .../CheckTaxElectronicDeliveryConsentResponse.cs | 0 .../DKLocalAccountIdentification.cs | 0 .../DataReviewConfirmationResponse.cs | 0 .../Model/LegalEntityManagement/Document.cs | 0 .../Model/LegalEntityManagement/DocumentPage.cs | 0 .../Model/LegalEntityManagement/DocumentReference.cs | 0 .../Model/LegalEntityManagement/EntityReference.cs | 0 .../Model/LegalEntityManagement/FinancialReport.cs | 0 .../GeneratePciDescriptionRequest.cs | 0 .../GeneratePciDescriptionResponse.cs | 0 .../GetAcceptedTermsOfServiceDocumentResponse.cs | 0 .../GetPciQuestionnaireInfosResponse.cs | 0 .../GetPciQuestionnaireResponse.cs | 0 .../GetTermsOfServiceAcceptanceInfosResponse.cs | 0 .../GetTermsOfServiceDocumentRequest.cs | 0 .../GetTermsOfServiceDocumentResponse.cs | 0 .../HKLocalAccountIdentification.cs | 0 .../HULocalAccountIdentification.cs | 0 .../IbanAccountIdentification.cs | 0 .../LegalEntityManagement/IdentificationData.cs | 0 .../Model/LegalEntityManagement/Individual.cs | 0 .../Model/LegalEntityManagement/LegalEntity.cs | 0 .../LegalEntityManagement/LegalEntityAssociation.cs | 0 .../LegalEntityManagement/LegalEntityCapability.cs | 0 .../Model/LegalEntityManagement/LegalEntityInfo.cs | 0 .../LegalEntityInfoRequiredType.cs | 0 .../NOLocalAccountIdentification.cs | 0 .../NZLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/Name.cs | 0 .../NumberAndBicAccountIdentification.cs | 0 .../Model/LegalEntityManagement/OnboardingLink.cs | 0 .../LegalEntityManagement/OnboardingLinkInfo.cs | 0 .../LegalEntityManagement/OnboardingLinkSettings.cs | 0 .../Model/LegalEntityManagement/OnboardingTheme.cs | 0 .../Model/LegalEntityManagement/OnboardingThemes.cs | 0 .../Model/LegalEntityManagement/Organization.cs | 0 .../Model/LegalEntityManagement/OwnerEntity.cs | 0 .../PLLocalAccountIdentification.cs | 0 .../Model/LegalEntityManagement/PciDocumentInfo.cs | 0 .../Model/LegalEntityManagement/PciSigningRequest.cs | 0 .../LegalEntityManagement/PciSigningResponse.cs | 0 .../Model/LegalEntityManagement/PhoneNumber.cs | 0 .../Model/LegalEntityManagement/RemediatingAction.cs | 0 .../SELocalAccountIdentification.cs | 0 .../SGLocalAccountIdentification.cs | 0 .../Model/LegalEntityManagement/ServiceError.cs | 0 .../SetTaxElectronicDeliveryConsentRequest.cs | 0 .../LegalEntityManagement/SoleProprietorship.cs | 0 .../Model/LegalEntityManagement/SourceOfFunds.cs | 0 .../Model/LegalEntityManagement/StockData.cs | 0 .../SupportingEntityCapability.cs | 0 .../Model/LegalEntityManagement/TaxInformation.cs | 0 .../TaxReportingClassification.cs | 0 .../TermsOfServiceAcceptanceInfo.cs | 0 .../LegalEntityManagement/TransferInstrument.cs | 0 .../LegalEntityManagement/TransferInstrumentInfo.cs | 0 .../TransferInstrumentReference.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/Trust.cs | 0 .../UKLocalAccountIdentification.cs | 0 .../USLocalAccountIdentification.cs | 0 .../LegalEntityManagement/UndefinedBeneficiary.cs | 0 .../UnincorporatedPartnership.cs | 0 .../LegalEntityManagement/VerificationDeadline.cs | 0 .../Model/LegalEntityManagement/VerificationError.cs | 0 .../VerificationErrorRecursive.cs | 0 .../LegalEntityManagement/VerificationErrors.cs | 0 .../{src => }/Model/LegalEntityManagement/WebData.cs | 0 .../Model/LegalEntityManagement/WebDataExemption.cs | 0 .../Model/Management/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/Management/AccelInfo.cs | 0 .../Model/Management/AdditionalCommission.cs | 0 .../{src => }/Model/Management/AdditionalSettings.cs | 0 .../Model/Management/AdditionalSettingsResponse.cs | 0 Adyen/{src => }/Model/Management/Address.cs | 0 Adyen/{src => }/Model/Management/AffirmInfo.cs | 0 .../{src => }/Model/Management/AfterpayTouchInfo.cs | 0 Adyen/{src => }/Model/Management/AllowedOrigin.cs | 0 .../Model/Management/AllowedOriginsResponse.cs | 0 Adyen/{src => }/Model/Management/AmexInfo.cs | 0 Adyen/{src => }/Model/Management/Amount.cs | 0 Adyen/{src => }/Model/Management/AndroidApp.cs | 0 Adyen/{src => }/Model/Management/AndroidAppError.cs | 0 .../Model/Management/AndroidAppsResponse.cs | 0 .../{src => }/Model/Management/AndroidCertificate.cs | 0 .../Model/Management/AndroidCertificatesResponse.cs | 0 Adyen/{src => }/Model/Management/ApiCredential.cs | 0 .../{src => }/Model/Management/ApiCredentialLinks.cs | 0 Adyen/{src => }/Model/Management/ApplePayInfo.cs | 0 Adyen/{src => }/Model/Management/BcmcInfo.cs | 0 .../Model/Management/BillingEntitiesResponse.cs | 0 Adyen/{src => }/Model/Management/BillingEntity.cs | 0 .../{src => }/Model/Management/CardholderReceipt.cs | 0 .../Model/Management/CartesBancairesInfo.cs | 0 Adyen/{src => }/Model/Management/ClearpayInfo.cs | 0 Adyen/{src => }/Model/Management/Commission.cs | 0 Adyen/{src => }/Model/Management/Company.cs | 0 .../Model/Management/CompanyApiCredential.cs | 0 Adyen/{src => }/Model/Management/CompanyLinks.cs | 0 Adyen/{src => }/Model/Management/CompanyUser.cs | 0 Adyen/{src => }/Model/Management/Connectivity.cs | 0 Adyen/{src => }/Model/Management/Contact.cs | 0 .../Model/Management/CreateAllowedOriginRequest.cs | 0 .../Model/Management/CreateApiCredentialResponse.cs | 0 .../Management/CreateCompanyApiCredentialRequest.cs | 0 .../Management/CreateCompanyApiCredentialResponse.cs | 0 .../Model/Management/CreateCompanyUserRequest.cs | 0 .../Model/Management/CreateCompanyUserResponse.cs | 0 .../Model/Management/CreateCompanyWebhookRequest.cs | 0 .../Management/CreateMerchantApiCredentialRequest.cs | 0 .../Model/Management/CreateMerchantRequest.cs | 0 .../Model/Management/CreateMerchantResponse.cs | 0 .../Model/Management/CreateMerchantUserRequest.cs | 0 .../Model/Management/CreateMerchantWebhookRequest.cs | 0 .../{src => }/Model/Management/CreateUserResponse.cs | 0 Adyen/{src => }/Model/Management/Currency.cs | 0 .../{src => }/Model/Management/CustomNotification.cs | 0 Adyen/{src => }/Model/Management/DataCenter.cs | 0 Adyen/{src => }/Model/Management/DinersInfo.cs | 0 Adyen/{src => }/Model/Management/EventUrl.cs | 0 .../Model/Management/ExternalTerminalAction.cs | 0 Adyen/{src => }/Model/Management/File.cs | 0 .../Model/Management/GenerateApiKeyResponse.cs | 0 .../Model/Management/GenerateClientKeyResponse.cs | 0 .../Model/Management/GenerateHmacKeyResponse.cs | 0 .../Model/Management/GenericPmWithTdiInfo.cs | 0 Adyen/{src => }/Model/Management/GiroPayInfo.cs | 0 Adyen/{src => }/Model/Management/GooglePayInfo.cs | 0 Adyen/{src => }/Model/Management/Gratuity.cs | 0 Adyen/{src => }/Model/Management/Hardware.cs | 0 Adyen/{src => }/Model/Management/IdName.cs | 0 .../Model/Management/InstallAndroidAppDetails.cs | 0 .../Management/InstallAndroidCertificateDetails.cs | 0 Adyen/{src => }/Model/Management/InvalidField.cs | 0 Adyen/{src => }/Model/Management/JCBInfo.cs | 0 Adyen/{src => }/Model/Management/Key.cs | 0 Adyen/{src => }/Model/Management/KlarnaInfo.cs | 0 Adyen/{src => }/Model/Management/Links.cs | 0 Adyen/{src => }/Model/Management/LinksElement.cs | 0 .../Management/ListCompanyApiCredentialsResponse.cs | 0 .../Model/Management/ListCompanyResponse.cs | 0 .../Model/Management/ListCompanyUsersResponse.cs | 0 .../ListExternalTerminalActionsResponse.cs | 0 .../Management/ListMerchantApiCredentialsResponse.cs | 0 .../Model/Management/ListMerchantResponse.cs | 0 .../Model/Management/ListMerchantUsersResponse.cs | 0 .../{src => }/Model/Management/ListStoresResponse.cs | 0 .../Model/Management/ListTerminalsResponse.cs | 0 .../Model/Management/ListWebhooksResponse.cs | 0 Adyen/{src => }/Model/Management/Localization.cs | 0 Adyen/{src => }/Model/Management/Logo.cs | 0 Adyen/{src => }/Model/Management/MeApiCredential.cs | 0 .../{src => }/Model/Management/MealVoucherFRInfo.cs | 0 Adyen/{src => }/Model/Management/Merchant.cs | 0 Adyen/{src => }/Model/Management/MerchantLinks.cs | 0 .../Model/Management/MinorUnitsMonetaryValue.cs | 0 .../{src => }/Model/Management/ModelConfiguration.cs | 0 Adyen/{src => }/Model/Management/Name.cs | 0 Adyen/{src => }/Model/Management/Name2.cs | 0 Adyen/{src => }/Model/Management/Nexo.cs | 0 Adyen/{src => }/Model/Management/Notification.cs | 0 Adyen/{src => }/Model/Management/NotificationUrl.cs | 0 Adyen/{src => }/Model/Management/NyceInfo.cs | 0 .../{src => }/Model/Management/OfflineProcessing.cs | 0 Adyen/{src => }/Model/Management/Opi.cs | 0 Adyen/{src => }/Model/Management/OrderItem.cs | 0 Adyen/{src => }/Model/Management/PaginationLinks.cs | 0 Adyen/{src => }/Model/Management/Passcodes.cs | 0 Adyen/{src => }/Model/Management/PayAtTable.cs | 0 Adyen/{src => }/Model/Management/PayMeInfo.cs | 0 Adyen/{src => }/Model/Management/PayPalInfo.cs | 0 Adyen/{src => }/Model/Management/PayToInfo.cs | 0 Adyen/{src => }/Model/Management/Payment.cs | 0 Adyen/{src => }/Model/Management/PaymentMethod.cs | 0 .../Model/Management/PaymentMethodResponse.cs | 0 .../Model/Management/PaymentMethodSetupInfo.cs | 0 Adyen/{src => }/Model/Management/PayoutSettings.cs | 0 .../Model/Management/PayoutSettingsRequest.cs | 0 .../Model/Management/PayoutSettingsResponse.cs | 0 Adyen/{src => }/Model/Management/Profile.cs | 0 Adyen/{src => }/Model/Management/PulseInfo.cs | 0 Adyen/{src => }/Model/Management/ReceiptOptions.cs | 0 Adyen/{src => }/Model/Management/ReceiptPrinting.cs | 0 Adyen/{src => }/Model/Management/Referenced.cs | 0 Adyen/{src => }/Model/Management/Refunds.cs | 0 .../Model/Management/ReleaseUpdateDetails.cs | 0 .../Model/Management/ReprocessAndroidAppResponse.cs | 0 .../Model/Management/RequestActivationResponse.cs | 0 Adyen/{src => }/Model/Management/RestServiceError.cs | 0 .../Management/ScheduleTerminalActionsRequest.cs | 0 .../ScheduleTerminalActionsRequestActionDetails.cs | 0 .../Management/ScheduleTerminalActionsResponse.cs | 0 Adyen/{src => }/Model/Management/Settings.cs | 0 Adyen/{src => }/Model/Management/ShippingLocation.cs | 0 .../Model/Management/ShippingLocationsResponse.cs | 0 Adyen/{src => }/Model/Management/Signature.cs | 0 Adyen/{src => }/Model/Management/SodexoInfo.cs | 0 Adyen/{src => }/Model/Management/SofortInfo.cs | 0 .../{src => }/Model/Management/SplitConfiguration.cs | 0 .../Model/Management/SplitConfigurationList.cs | 0 .../Model/Management/SplitConfigurationLogic.cs | 0 .../Model/Management/SplitConfigurationRule.cs | 0 Adyen/{src => }/Model/Management/Standalone.cs | 0 Adyen/{src => }/Model/Management/StarInfo.cs | 0 Adyen/{src => }/Model/Management/Store.cs | 0 Adyen/{src => }/Model/Management/StoreAndForward.cs | 0 .../Model/Management/StoreCreationRequest.cs | 0 .../StoreCreationWithMerchantCodeRequest.cs | 0 Adyen/{src => }/Model/Management/StoreLocation.cs | 0 .../Model/Management/StoreSplitConfiguration.cs | 0 .../{src => }/Model/Management/SupportedCardTypes.cs | 0 Adyen/{src => }/Model/Management/Surcharge.cs | 0 Adyen/{src => }/Model/Management/SwishInfo.cs | 0 Adyen/{src => }/Model/Management/TapToPay.cs | 0 Adyen/{src => }/Model/Management/Terminal.cs | 0 .../Model/Management/TerminalActionScheduleDetail.cs | 0 .../{src => }/Model/Management/TerminalAssignment.cs | 0 .../Model/Management/TerminalConnectivity.cs | 0 .../Management/TerminalConnectivityBluetooth.cs | 0 .../Model/Management/TerminalConnectivityCellular.cs | 0 .../Model/Management/TerminalConnectivityEthernet.cs | 0 .../Model/Management/TerminalConnectivityWifi.cs | 0 .../Model/Management/TerminalInstructions.cs | 0 .../Model/Management/TerminalModelsResponse.cs | 0 Adyen/{src => }/Model/Management/TerminalOrder.cs | 0 .../Model/Management/TerminalOrderRequest.cs | 0 .../Model/Management/TerminalOrdersResponse.cs | 0 Adyen/{src => }/Model/Management/TerminalProduct.cs | 0 .../Model/Management/TerminalProductPrice.cs | 0 .../Model/Management/TerminalProductsResponse.cs | 0 .../Model/Management/TerminalReassignmentRequest.cs | 0 .../Model/Management/TerminalReassignmentTarget.cs | 0 Adyen/{src => }/Model/Management/TerminalSettings.cs | 0 .../Model/Management/TestCompanyWebhookRequest.cs | 0 Adyen/{src => }/Model/Management/TestOutput.cs | 0 .../{src => }/Model/Management/TestWebhookRequest.cs | 0 .../Model/Management/TestWebhookResponse.cs | 0 Adyen/{src => }/Model/Management/TicketInfo.cs | 0 Adyen/{src => }/Model/Management/Timeouts.cs | 0 .../Model/Management/TransactionDescriptionInfo.cs | 0 Adyen/{src => }/Model/Management/TwintInfo.cs | 0 .../Model/Management/UninstallAndroidAppDetails.cs | 0 .../Management/UninstallAndroidCertificateDetails.cs | 0 Adyen/{src => }/Model/Management/UpdatableAddress.cs | 0 .../Management/UpdateCompanyApiCredentialRequest.cs | 0 .../Model/Management/UpdateCompanyUserRequest.cs | 0 .../Model/Management/UpdateCompanyWebhookRequest.cs | 0 .../Management/UpdateMerchantApiCredentialRequest.cs | 0 .../Model/Management/UpdateMerchantUserRequest.cs | 0 .../Model/Management/UpdateMerchantWebhookRequest.cs | 0 .../Model/Management/UpdatePaymentMethodInfo.cs | 0 .../Model/Management/UpdatePayoutSettingsRequest.cs | 0 .../UpdateSplitConfigurationLogicRequest.cs | 0 .../Management/UpdateSplitConfigurationRequest.cs | 0 .../UpdateSplitConfigurationRuleRequest.cs | 0 .../{src => }/Model/Management/UpdateStoreRequest.cs | 0 .../Model/Management/UploadAndroidAppResponse.cs | 0 .../Management/UploadAndroidCertificateResponse.cs | 0 Adyen/{src => }/Model/Management/Url.cs | 0 Adyen/{src => }/Model/Management/User.cs | 0 Adyen/{src => }/Model/Management/VippsInfo.cs | 0 Adyen/{src => }/Model/Management/WeChatPayInfo.cs | 0 Adyen/{src => }/Model/Management/WeChatPayPosInfo.cs | 0 Adyen/{src => }/Model/Management/Webhook.cs | 0 Adyen/{src => }/Model/Management/WebhookLinks.cs | 0 Adyen/{src => }/Model/Management/WifiProfiles.cs | 0 .../ManagementWebhooks/AbstractOpenAPISchema.cs | 0 .../ManagementWebhooks/AccountCapabilityData.cs | 0 .../AccountCreateNotificationData.cs | 0 .../AccountNotificationResponse.cs | 0 .../AccountUpdateNotificationData.cs | 0 .../Model/ManagementWebhooks/CapabilityProblem.cs | 0 .../ManagementWebhooks/CapabilityProblemEntity.cs | 0 .../CapabilityProblemEntityRecursive.cs | 0 .../MerchantCreatedNotificationRequest.cs | 0 .../MerchantUpdatedNotificationRequest.cs | 0 .../ManagementWebhooks/MidServiceNotificationData.cs | 0 .../PaymentMethodCreatedNotificationRequest.cs | 0 .../PaymentMethodNotificationResponse.cs | 0 ...PaymentMethodRequestRemovedNotificationRequest.cs | 0 ...ntMethodScheduledForRemovalNotificationRequest.cs | 0 .../Model/ManagementWebhooks/RemediatingAction.cs | 0 .../TerminalAssignmentNotificationRequest.cs | 0 .../TerminalAssignmentNotificationResponse.cs | 0 .../Model/ManagementWebhooks/TerminalBoardingData.cs | 0 .../TerminalBoardingNotificationRequest.cs | 0 .../TerminalBoardingNotificationResponse.cs | 0 .../Model/ManagementWebhooks/TerminalSettingsData.cs | 0 .../TerminalSettingsNotificationRequest.cs | 0 .../TerminalSettingsNotificationResponse.cs | 0 .../Model/ManagementWebhooks/VerificationError.cs | 0 .../ManagementWebhooks/VerificationErrorRecursive.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../Model/NegativeBalanceWarningWebhooks/Amount.cs | 0 ...tiveBalanceCompensationWarningNotificationData.cs | 0 ...eBalanceCompensationWarningNotificationRequest.cs | 0 .../Model/NegativeBalanceWarningWebhooks/Resource.cs | 0 .../ResourceReference.cs | 0 .../Model/Notification/NotificationRequest.cs | 0 .../Model/Notification/NotificationRequestConst.cs | 0 .../Model/Notification/NotificationRequestItem.cs | 0 .../Notification/NotificationRequestItemContainer.cs | 0 .../{src => }/Model/Payment/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/Payment/AccountInfo.cs | 0 Adyen/{src => }/Model/Payment/AcctInfo.cs | 0 .../Model/Payment/AdditionalData3DSecure.cs | 0 .../{src => }/Model/Payment/AdditionalDataAirline.cs | 0 .../Model/Payment/AdditionalDataCarRental.cs | 0 .../{src => }/Model/Payment/AdditionalDataCommon.cs | 0 .../{src => }/Model/Payment/AdditionalDataLevel23.cs | 0 .../{src => }/Model/Payment/AdditionalDataLodging.cs | 0 .../Model/Payment/AdditionalDataModifications.cs | 0 .../Model/Payment/AdditionalDataOpenInvoice.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataOpi.cs | 0 .../{src => }/Model/Payment/AdditionalDataRatepay.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataRetry.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataRisk.cs | 0 .../Model/Payment/AdditionalDataRiskStandalone.cs | 0 .../Model/Payment/AdditionalDataSubMerchant.cs | 0 .../Model/Payment/AdditionalDataTemporaryServices.cs | 0 .../{src => }/Model/Payment/AdditionalDataWallets.cs | 0 Adyen/{src => }/Model/Payment/Address.cs | 0 .../Model/Payment/AdjustAuthorisationRequest.cs | 0 Adyen/{src => }/Model/Payment/Amount.cs | 0 Adyen/{src => }/Model/Payment/ApplicationInfo.cs | 0 .../Model/Payment/AuthenticationResultRequest.cs | 0 .../Model/Payment/AuthenticationResultResponse.cs | 0 Adyen/{src => }/Model/Payment/BankAccount.cs | 0 Adyen/{src => }/Model/Payment/BrowserInfo.cs | 0 .../{src => }/Model/Payment/CancelOrRefundRequest.cs | 0 Adyen/{src => }/Model/Payment/CancelRequest.cs | 0 Adyen/{src => }/Model/Payment/CaptureRequest.cs | 0 Adyen/{src => }/Model/Payment/Card.cs | 0 Adyen/{src => }/Model/Payment/CommonField.cs | 0 Adyen/{src => }/Model/Payment/DeviceRenderOptions.cs | 0 Adyen/{src => }/Model/Payment/DonationRequest.cs | 0 Adyen/{src => }/Model/Payment/ExternalPlatform.cs | 0 Adyen/{src => }/Model/Payment/ForexQuote.cs | 0 Adyen/{src => }/Model/Payment/FraudCheckResult.cs | 0 .../Model/Payment/FraudCheckResultWrapper.cs | 0 Adyen/{src => }/Model/Payment/FraudResult.cs | 0 Adyen/{src => }/Model/Payment/FundDestination.cs | 0 Adyen/{src => }/Model/Payment/FundSource.cs | 0 Adyen/{src => }/Model/Payment/Installments.cs | 0 Adyen/{src => }/Model/Payment/Mandate.cs | 0 Adyen/{src => }/Model/Payment/MerchantDevice.cs | 0 .../{src => }/Model/Payment/MerchantRiskIndicator.cs | 0 Adyen/{src => }/Model/Payment/ModificationResult.cs | 0 Adyen/{src => }/Model/Payment/Name.cs | 0 Adyen/{src => }/Model/Payment/PaymentRequest.cs | 0 Adyen/{src => }/Model/Payment/PaymentRequest3d.cs | 0 Adyen/{src => }/Model/Payment/PaymentRequest3ds2.cs | 0 Adyen/{src => }/Model/Payment/PaymentResult.cs | 0 Adyen/{src => }/Model/Payment/Phone.cs | 0 .../Model/Payment/PlatformChargebackLogic.cs | 0 Adyen/{src => }/Model/Payment/Recurring.cs | 0 Adyen/{src => }/Model/Payment/RefundRequest.cs | 0 .../Model/Payment/ResponseAdditionalData3DSecure.cs | 0 .../Payment/ResponseAdditionalDataBillingAddress.cs | 0 .../Model/Payment/ResponseAdditionalDataCard.cs | 0 .../Model/Payment/ResponseAdditionalDataCommon.cs | 0 .../Payment/ResponseAdditionalDataDomesticError.cs | 0 .../Payment/ResponseAdditionalDataInstallments.cs | 0 .../Payment/ResponseAdditionalDataNetworkTokens.cs | 0 .../Model/Payment/ResponseAdditionalDataOpi.cs | 0 .../Model/Payment/ResponseAdditionalDataSepa.cs | 0 Adyen/{src => }/Model/Payment/SDKEphemPubKey.cs | 0 .../Payment/SecureRemoteCommerceCheckoutData.cs | 0 Adyen/{src => }/Model/Payment/ServiceError.cs | 0 .../Model/Payment/ShopperInteractionDevice.cs | 0 Adyen/{src => }/Model/Payment/Split.cs | 0 Adyen/{src => }/Model/Payment/SplitAmount.cs | 0 Adyen/{src => }/Model/Payment/SubMerchant.cs | 0 .../Model/Payment/TechnicalCancelRequest.cs | 0 Adyen/{src => }/Model/Payment/ThreeDS1Result.cs | 0 Adyen/{src => }/Model/Payment/ThreeDS2RequestData.cs | 0 Adyen/{src => }/Model/Payment/ThreeDS2Result.cs | 0 .../{src => }/Model/Payment/ThreeDS2ResultRequest.cs | 0 .../Model/Payment/ThreeDS2ResultResponse.cs | 0 .../Payment/ThreeDSRequestorAuthenticationInfo.cs | 0 .../ThreeDSRequestorPriorAuthenticationInfo.cs | 0 Adyen/{src => }/Model/Payment/ThreeDSecureData.cs | 0 .../Model/Payment/VoidPendingRefundRequest.cs | 0 .../Model/PaymentsApp/AbstractOpenAPISchema.cs | 0 .../Model/PaymentsApp/BoardingTokenRequest.cs | 0 .../Model/PaymentsApp/BoardingTokenResponse.cs | 0 .../Model/PaymentsApp/DefaultErrorResponseEntity.cs | 0 Adyen/{src => }/Model/PaymentsApp/InvalidField.cs | 0 Adyen/{src => }/Model/PaymentsApp/PaymentsAppDto.cs | 0 .../Model/PaymentsApp/PaymentsAppResponse.cs | 0 .../{src => }/Model/Payout/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/Payout/Address.cs | 0 Adyen/{src => }/Model/Payout/Amount.cs | 0 Adyen/{src => }/Model/Payout/BankAccount.cs | 0 Adyen/{src => }/Model/Payout/Card.cs | 0 Adyen/{src => }/Model/Payout/FraudCheckResult.cs | 0 .../Model/Payout/FraudCheckResultWrapper.cs | 0 Adyen/{src => }/Model/Payout/FraudResult.cs | 0 Adyen/{src => }/Model/Payout/FundSource.cs | 0 Adyen/{src => }/Model/Payout/ModifyRequest.cs | 0 Adyen/{src => }/Model/Payout/ModifyResponse.cs | 0 Adyen/{src => }/Model/Payout/Name.cs | 0 Adyen/{src => }/Model/Payout/PayoutRequest.cs | 0 Adyen/{src => }/Model/Payout/PayoutResponse.cs | 0 Adyen/{src => }/Model/Payout/Recurring.cs | 0 .../Model/Payout/ResponseAdditionalData3DSecure.cs | 0 .../Payout/ResponseAdditionalDataBillingAddress.cs | 0 .../Model/Payout/ResponseAdditionalDataCard.cs | 0 .../Model/Payout/ResponseAdditionalDataCommon.cs | 0 .../Payout/ResponseAdditionalDataDomesticError.cs | 0 .../Payout/ResponseAdditionalDataInstallments.cs | 0 .../Payout/ResponseAdditionalDataNetworkTokens.cs | 0 .../Model/Payout/ResponseAdditionalDataOpi.cs | 0 .../Model/Payout/ResponseAdditionalDataSepa.cs | 0 Adyen/{src => }/Model/Payout/ServiceError.cs | 0 .../Model/Payout/StoreDetailAndSubmitRequest.cs | 0 .../Model/Payout/StoreDetailAndSubmitResponse.cs | 0 Adyen/{src => }/Model/Payout/StoreDetailRequest.cs | 0 Adyen/{src => }/Model/Payout/StoreDetailResponse.cs | 0 Adyen/{src => }/Model/Payout/SubmitRequest.cs | 0 Adyen/{src => }/Model/Payout/SubmitResponse.cs | 0 .../Model/PlatformsAccount/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/PlatformsAccount/Account.cs | 0 .../{src => }/Model/PlatformsAccount/AccountEvent.cs | 0 .../Model/PlatformsAccount/AccountHolderDetails.cs | 0 .../Model/PlatformsAccount/AccountHolderStatus.cs | 0 .../Model/PlatformsAccount/AccountPayoutState.cs | 0 .../Model/PlatformsAccount/AccountProcessingState.cs | 0 Adyen/{src => }/Model/PlatformsAccount/Amount.cs | 0 .../Model/PlatformsAccount/BankAccountDetail.cs | 0 .../Model/PlatformsAccount/BusinessDetails.cs | 0 .../PlatformsAccount/CloseAccountHolderRequest.cs | 0 .../PlatformsAccount/CloseAccountHolderResponse.cs | 0 .../Model/PlatformsAccount/CloseAccountRequest.cs | 0 .../Model/PlatformsAccount/CloseAccountResponse.cs | 0 .../Model/PlatformsAccount/CloseStoresRequest.cs | 0 .../PlatformsAccount/CreateAccountHolderRequest.cs | 0 .../PlatformsAccount/CreateAccountHolderResponse.cs | 0 .../Model/PlatformsAccount/CreateAccountRequest.cs | 0 .../Model/PlatformsAccount/CreateAccountResponse.cs | 0 .../PlatformsAccount/DeleteBankAccountRequest.cs | 0 .../DeleteLegalArrangementRequest.cs | 0 .../PlatformsAccount/DeletePayoutMethodRequest.cs | 0 .../PlatformsAccount/DeleteShareholderRequest.cs | 0 .../PlatformsAccount/DeleteSignatoriesRequest.cs | 0 .../Model/PlatformsAccount/DocumentDetail.cs | 0 .../Model/PlatformsAccount/ErrorFieldType.cs | 0 Adyen/{src => }/Model/PlatformsAccount/FieldType.cs | 0 .../Model/PlatformsAccount/GenericResponse.cs | 0 .../PlatformsAccount/GetAccountHolderRequest.cs | 0 .../PlatformsAccount/GetAccountHolderResponse.cs | 0 .../GetAccountHolderStatusResponse.cs | 0 .../Model/PlatformsAccount/GetTaxFormRequest.cs | 0 .../Model/PlatformsAccount/GetTaxFormResponse.cs | 0 .../PlatformsAccount/GetUploadedDocumentsRequest.cs | 0 .../PlatformsAccount/GetUploadedDocumentsResponse.cs | 0 .../Model/PlatformsAccount/IndividualDetails.cs | 0 .../Model/PlatformsAccount/KYCCheckResult.cs | 0 .../Model/PlatformsAccount/KYCCheckStatusData.cs | 0 .../Model/PlatformsAccount/KYCCheckSummary.cs | 0 .../KYCLegalArrangementCheckResult.cs | 0 .../KYCLegalArrangementEntityCheckResult.cs | 0 .../PlatformsAccount/KYCPayoutMethodCheckResult.cs | 0 .../PlatformsAccount/KYCShareholderCheckResult.cs | 0 .../PlatformsAccount/KYCSignatoryCheckResult.cs | 0 .../KYCUltimateParentCompanyCheckResult.cs | 0 .../Model/PlatformsAccount/KYCVerificationResult.cs | 0 .../Model/PlatformsAccount/LegalArrangementDetail.cs | 0 .../PlatformsAccount/LegalArrangementEntityDetail.cs | 0 .../PlatformsAccount/LegalArrangementRequest.cs | 0 .../Model/PlatformsAccount/MigratedAccounts.cs | 0 .../Model/PlatformsAccount/MigratedShareholders.cs | 0 .../Model/PlatformsAccount/MigratedStores.cs | 0 .../Model/PlatformsAccount/MigrationData.cs | 0 .../{src => }/Model/PlatformsAccount/PayoutMethod.cs | 0 .../Model/PlatformsAccount/PayoutScheduleResponse.cs | 0 .../PlatformsAccount/PerformVerificationRequest.cs | 0 .../Model/PlatformsAccount/PersonalDocumentData.cs | 0 .../{src => }/Model/PlatformsAccount/ServiceError.cs | 0 .../Model/PlatformsAccount/ShareholderContact.cs | 0 .../Model/PlatformsAccount/SignatoryContact.cs | 0 .../{src => }/Model/PlatformsAccount/StoreDetail.cs | 0 .../PlatformsAccount/SuspendAccountHolderRequest.cs | 0 .../PlatformsAccount/SuspendAccountHolderResponse.cs | 0 .../Model/PlatformsAccount/UltimateParentCompany.cs | 0 .../UltimateParentCompanyBusinessDetails.cs | 0 .../UnSuspendAccountHolderRequest.cs | 0 .../UnSuspendAccountHolderResponse.cs | 0 .../PlatformsAccount/UpdateAccountHolderRequest.cs | 0 .../PlatformsAccount/UpdateAccountHolderResponse.cs | 0 .../UpdateAccountHolderStateRequest.cs | 0 .../Model/PlatformsAccount/UpdateAccountRequest.cs | 0 .../Model/PlatformsAccount/UpdateAccountResponse.cs | 0 .../PlatformsAccount/UpdatePayoutScheduleRequest.cs | 0 .../Model/PlatformsAccount/UploadDocumentRequest.cs | 0 .../{src => }/Model/PlatformsAccount/ViasAddress.cs | 0 Adyen/{src => }/Model/PlatformsAccount/ViasName.cs | 0 .../Model/PlatformsAccount/ViasPersonalData.cs | 0 .../Model/PlatformsAccount/ViasPhoneNumber.cs | 0 .../Model/PlatformsFund/AbstractOpenAPISchema.cs | 0 .../Model/PlatformsFund/AccountDetailBalance.cs | 0 .../PlatformsFund/AccountHolderBalanceRequest.cs | 0 .../PlatformsFund/AccountHolderBalanceResponse.cs | 0 .../AccountHolderTransactionListRequest.cs | 0 .../AccountHolderTransactionListResponse.cs | 0 .../Model/PlatformsFund/AccountTransactionList.cs | 0 Adyen/{src => }/Model/PlatformsFund/Amount.cs | 0 .../Model/PlatformsFund/BankAccountDetail.cs | 0 .../Model/PlatformsFund/DebitAccountHolderRequest.cs | 0 .../PlatformsFund/DebitAccountHolderResponse.cs | 0 Adyen/{src => }/Model/PlatformsFund/DetailBalance.cs | 0 .../{src => }/Model/PlatformsFund/ErrorFieldType.cs | 0 Adyen/{src => }/Model/PlatformsFund/FieldType.cs | 0 .../PlatformsFund/PayoutAccountHolderRequest.cs | 0 .../PlatformsFund/PayoutAccountHolderResponse.cs | 0 .../PlatformsFund/RefundFundsTransferRequest.cs | 0 .../PlatformsFund/RefundFundsTransferResponse.cs | 0 .../RefundNotPaidOutTransfersRequest.cs | 0 .../RefundNotPaidOutTransfersResponse.cs | 0 Adyen/{src => }/Model/PlatformsFund/ServiceError.cs | 0 .../Model/PlatformsFund/SetupBeneficiaryRequest.cs | 0 .../Model/PlatformsFund/SetupBeneficiaryResponse.cs | 0 Adyen/{src => }/Model/PlatformsFund/Split.cs | 0 Adyen/{src => }/Model/PlatformsFund/SplitAmount.cs | 0 Adyen/{src => }/Model/PlatformsFund/Transaction.cs | 0 .../Model/PlatformsFund/TransactionListForAccount.cs | 0 .../Model/PlatformsFund/TransferFundsRequest.cs | 0 .../Model/PlatformsFund/TransferFundsResponse.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../CollectInformation.cs | 0 .../PlatformsHostedOnboardingPage/ErrorFieldType.cs | 0 .../Model/PlatformsHostedOnboardingPage/FieldType.cs | 0 .../GetOnboardingUrlRequest.cs | 0 .../GetOnboardingUrlResponse.cs | 0 .../GetPciUrlRequest.cs | 0 .../GetPciUrlResponse.cs | 0 .../PlatformsHostedOnboardingPage/ServiceError.cs | 0 .../Model/PlatformsHostedOnboardingPage/ShowPages.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../CreateNotificationConfigurationRequest.cs | 0 .../DeleteNotificationConfigurationRequest.cs | 0 .../ErrorFieldType.cs | 0 .../ExchangeMessage.cs | 0 .../PlatformsNotificationConfiguration/FieldType.cs | 0 .../GenericResponse.cs | 0 .../GetNotificationConfigurationListResponse.cs | 0 .../GetNotificationConfigurationRequest.cs | 0 .../GetNotificationConfigurationResponse.cs | 0 .../NotificationConfigurationDetails.cs | 0 .../NotificationEventConfiguration.cs | 0 .../ServiceError.cs | 0 .../TestNotificationConfigurationRequest.cs | 0 .../TestNotificationConfigurationResponse.cs | 0 .../UpdateNotificationConfigurationRequest.cs | 0 .../Model/PlatformsWebhooks/AbstractOpenAPISchema.cs | 0 .../PlatformsWebhooks/AccountCloseNotification.cs | 0 .../PlatformsWebhooks/AccountCreateNotification.cs | 0 .../Model/PlatformsWebhooks/AccountEvent.cs | 0 .../AccountFundsBelowThresholdNotification.cs | 0 .../AccountFundsBelowThresholdNotificationContent.cs | 0 .../AccountHolderCreateNotification.cs | 0 .../Model/PlatformsWebhooks/AccountHolderDetails.cs | 0 .../AccountHolderPayoutNotification.cs | 0 .../AccountHolderPayoutNotificationContent.cs | 0 .../Model/PlatformsWebhooks/AccountHolderStatus.cs | 0 .../AccountHolderStatusChangeNotification.cs | 0 .../AccountHolderStatusChangeNotificationContent.cs | 0 .../AccountHolderStoreStatusChangeNotification.cs | 0 ...ountHolderStoreStatusChangeNotificationContent.cs | 0 .../AccountHolderUpcomingDeadlineNotification.cs | 0 ...countHolderUpcomingDeadlineNotificationContent.cs | 0 .../AccountHolderUpdateNotification.cs | 0 .../AccountHolderVerificationNotification.cs | 0 .../AccountHolderVerificationNotificationContent.cs | 0 .../Model/PlatformsWebhooks/AccountPayoutState.cs | 0 .../PlatformsWebhooks/AccountProcessingState.cs | 0 .../PlatformsWebhooks/AccountUpdateNotification.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/Amount.cs | 0 .../Model/PlatformsWebhooks/BankAccountDetail.cs | 0 .../BeneficiarySetupNotification.cs | 0 .../BeneficiarySetupNotificationContent.cs | 0 .../Model/PlatformsWebhooks/BusinessDetails.cs | 0 .../Model/PlatformsWebhooks/CloseAccountResponse.cs | 0 .../CompensateNegativeBalanceNotification.cs | 0 .../CompensateNegativeBalanceNotificationContent.cs | 0 .../CompensateNegativeBalanceNotificationRecord.cs | 0 .../PlatformsWebhooks/CreateAccountHolderResponse.cs | 0 .../Model/PlatformsWebhooks/CreateAccountResponse.cs | 0 .../DirectDebitInitiatedNotification.cs | 0 .../DirectDebitInitiatedNotificationContent.cs | 0 .../Model/PlatformsWebhooks/ErrorFieldType.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/FieldType.cs | 0 .../Model/PlatformsWebhooks/IndividualDetails.cs | 0 .../Model/PlatformsWebhooks/KYCCheckResult.cs | 0 .../Model/PlatformsWebhooks/KYCCheckStatusData.cs | 0 .../Model/PlatformsWebhooks/KYCCheckSummary.cs | 0 .../KYCLegalArrangementCheckResult.cs | 0 .../KYCLegalArrangementEntityCheckResult.cs | 0 .../PlatformsWebhooks/KYCPayoutMethodCheckResult.cs | 0 .../PlatformsWebhooks/KYCShareholderCheckResult.cs | 0 .../PlatformsWebhooks/KYCSignatoryCheckResult.cs | 0 .../KYCUltimateParentCompanyCheckResult.cs | 0 .../Model/PlatformsWebhooks/KYCVerificationResult.cs | 0 .../PlatformsWebhooks/LegalArrangementDetail.cs | 0 .../LegalArrangementEntityDetail.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/LocalDate.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/Message.cs | 0 .../PlatformsWebhooks/NotificationErrorContainer.cs | 0 .../Model/PlatformsWebhooks/NotificationResponse.cs | 0 .../Model/PlatformsWebhooks/OperationStatus.cs | 0 .../PlatformsWebhooks/PaymentFailureNotification.cs | 0 .../PaymentFailureNotificationContent.cs | 0 .../Model/PlatformsWebhooks/PayoutMethod.cs | 0 .../PlatformsWebhooks/PayoutScheduleResponse.cs | 0 .../Model/PlatformsWebhooks/PersonalDocumentData.cs | 0 .../RefundFundsTransferNotification.cs | 0 .../RefundFundsTransferNotificationContent.cs | 0 .../Model/PlatformsWebhooks/RefundResult.cs | 0 .../PlatformsWebhooks/ReportAvailableNotification.cs | 0 .../ReportAvailableNotificationContent.cs | 0 .../ScheduledRefundsNotification.cs | 0 .../ScheduledRefundsNotificationContent.cs | 0 .../Model/PlatformsWebhooks/ShareholderContact.cs | 0 .../Model/PlatformsWebhooks/SignatoryContact.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/Split.cs | 0 .../{src => }/Model/PlatformsWebhooks/SplitAmount.cs | 0 .../{src => }/Model/PlatformsWebhooks/StoreDetail.cs | 0 .../{src => }/Model/PlatformsWebhooks/Transaction.cs | 0 .../PlatformsWebhooks/TransferFundsNotification.cs | 0 .../TransferFundsNotificationContent.cs | 0 .../Model/PlatformsWebhooks/UltimateParentCompany.cs | 0 .../UltimateParentCompanyBusinessDetails.cs | 0 .../PlatformsWebhooks/UpdateAccountHolderResponse.cs | 0 .../Model/PlatformsWebhooks/UpdateAccountResponse.cs | 0 .../{src => }/Model/PlatformsWebhooks/ViasAddress.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/ViasName.cs | 0 .../Model/PlatformsWebhooks/ViasPersonalData.cs | 0 .../Model/PlatformsWebhooks/ViasPhoneNumber.cs | 0 .../Model/PosMobile/AbstractOpenAPISchema.cs | 0 .../Model/PosMobile/CreateSessionRequest.cs | 0 .../Model/PosMobile/CreateSessionResponse.cs | 0 .../PosTerminalManagement/AbstractOpenAPISchema.cs | 0 .../{src => }/Model/PosTerminalManagement/Address.cs | 0 .../PosTerminalManagement/AssignTerminalsRequest.cs | 0 .../PosTerminalManagement/AssignTerminalsResponse.cs | 0 .../PosTerminalManagement/FindTerminalRequest.cs | 0 .../PosTerminalManagement/FindTerminalResponse.cs | 0 .../GetStoresUnderAccountRequest.cs | 0 .../GetStoresUnderAccountResponse.cs | 0 .../GetTerminalDetailsRequest.cs | 0 .../GetTerminalDetailsResponse.cs | 0 .../GetTerminalsUnderAccountRequest.cs | 0 .../GetTerminalsUnderAccountResponse.cs | 0 .../Model/PosTerminalManagement/MerchantAccount.cs | 0 .../Model/PosTerminalManagement/ServiceError.cs | 0 Adyen/{src => }/Model/PosTerminalManagement/Store.cs | 0 .../Model/Recurring/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/Recurring/Address.cs | 0 Adyen/{src => }/Model/Recurring/Amount.cs | 0 Adyen/{src => }/Model/Recurring/BankAccount.cs | 0 Adyen/{src => }/Model/Recurring/Card.cs | 0 .../{src => }/Model/Recurring/CreatePermitRequest.cs | 0 .../{src => }/Model/Recurring/CreatePermitResult.cs | 0 .../Model/Recurring/DisablePermitRequest.cs | 0 .../{src => }/Model/Recurring/DisablePermitResult.cs | 0 Adyen/{src => }/Model/Recurring/DisableRequest.cs | 0 Adyen/{src => }/Model/Recurring/DisableResult.cs | 0 Adyen/{src => }/Model/Recurring/Name.cs | 0 .../Model/Recurring/NotifyShopperRequest.cs | 0 .../{src => }/Model/Recurring/NotifyShopperResult.cs | 0 Adyen/{src => }/Model/Recurring/Permit.cs | 0 Adyen/{src => }/Model/Recurring/PermitRestriction.cs | 0 Adyen/{src => }/Model/Recurring/PermitResult.cs | 0 Adyen/{src => }/Model/Recurring/Recurring.cs | 0 Adyen/{src => }/Model/Recurring/RecurringDetail.cs | 0 .../Model/Recurring/RecurringDetailWrapper.cs | 0 .../Model/Recurring/RecurringDetailsRequest.cs | 0 .../Model/Recurring/RecurringDetailsResult.cs | 0 .../Model/Recurring/ScheduleAccountUpdaterRequest.cs | 0 .../Model/Recurring/ScheduleAccountUpdaterResult.cs | 0 Adyen/{src => }/Model/Recurring/ServiceError.cs | 0 Adyen/{src => }/Model/Recurring/TokenDetails.cs | 0 .../Model/ReportWebhooks/AbstractOpenAPISchema.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../Model/ReportWebhooks/ReportNotificationData.cs | 0 .../ReportWebhooks/ReportNotificationRequest.cs | 0 Adyen/{src => }/Model/ReportWebhooks/Resource.cs | 0 .../Model/ReportWebhooks/ResourceReference.cs | 0 Adyen/{src => }/Model/RequestOptions.cs | 0 .../Model/StoredValue/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/StoredValue/Amount.cs | 0 Adyen/{src => }/Model/StoredValue/ServiceError.cs | 0 .../StoredValue/StoredValueBalanceCheckRequest.cs | 0 .../StoredValue/StoredValueBalanceCheckResponse.cs | 0 .../StoredValue/StoredValueBalanceMergeRequest.cs | 0 .../StoredValue/StoredValueBalanceMergeResponse.cs | 0 .../Model/StoredValue/StoredValueIssueRequest.cs | 0 .../Model/StoredValue/StoredValueIssueResponse.cs | 0 .../Model/StoredValue/StoredValueLoadRequest.cs | 0 .../Model/StoredValue/StoredValueLoadResponse.cs | 0 .../StoredValue/StoredValueStatusChangeRequest.cs | 0 .../StoredValue/StoredValueStatusChangeResponse.cs | 0 .../Model/StoredValue/StoredValueVoidRequest.cs | 0 .../Model/StoredValue/StoredValueVoidResponse.cs | 0 Adyen/{src => }/Model/Terminal/SaleToAcquirerData.cs | 0 Adyen/{src => }/Model/Terminal/Split.cs | 0 Adyen/{src => }/Model/Terminal/SplitItem.cs | 0 Adyen/{src => }/Model/Terminal/SplitItemType.cs | 0 Adyen/{src => }/Model/TerminalApi/AbortRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/AccountType.cs | 0 Adyen/{src => }/Model/TerminalApi/AdminRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/AdminResponse.cs | 0 .../Model/TerminalApi/AlgorithmIdentifier.cs | 0 Adyen/{src => }/Model/TerminalApi/AlgorithmType.cs | 0 Adyen/{src => }/Model/TerminalApi/AlignmentType.cs | 0 Adyen/{src => }/Model/TerminalApi/AllowedProduct.cs | 0 Adyen/{src => }/Model/TerminalApi/Amount.cs | 0 Adyen/{src => }/Model/TerminalApi/AmountsReq.cs | 0 Adyen/{src => }/Model/TerminalApi/AmountsResp.cs | 0 Adyen/{src => }/Model/TerminalApi/AreaSize.cs | 0 .../{src => }/Model/TerminalApi/AuthenticatedData.cs | 0 .../Model/TerminalApi/AuthenticationMethodType.cs | 0 .../Model/TerminalApi/BalanceInquiryRequest.cs | 0 .../Model/TerminalApi/BalanceInquiryResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/BarcodeType.cs | 0 Adyen/{src => }/Model/TerminalApi/BatchRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/BatchResponse.cs | 0 .../{src => }/Model/TerminalApi/CapturedSignature.cs | 0 .../Model/TerminalApi/CardAcquisitionRequest.cs | 0 .../Model/TerminalApi/CardAcquisitionResponse.cs | 0 .../Model/TerminalApi/CardAcquisitionTransaction.cs | 0 Adyen/{src => }/Model/TerminalApi/CardData.cs | 0 .../Model/TerminalApi/CardReaderAPDURequest.cs | 0 .../Model/TerminalApi/CardReaderAPDUResponse.cs | 0 .../Model/TerminalApi/CardReaderInitRequest.cs | 0 .../Model/TerminalApi/CardReaderInitResponse.cs | 0 .../Model/TerminalApi/CardReaderPowerOffRequest.cs | 0 .../Model/TerminalApi/CardReaderPowerOffResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/CardholderPIN.cs | 0 .../Model/TerminalApi/CashHandlingDevice.cs | 0 .../Model/TerminalApi/CharacterHeightType.cs | 0 .../Model/TerminalApi/CharacterStyleType.cs | 0 .../Model/TerminalApi/CharacterWidthType.cs | 0 Adyen/{src => }/Model/TerminalApi/CheckData.cs | 0 .../{src => }/Model/TerminalApi/CheckTypeCodeType.cs | 0 Adyen/{src => }/Model/TerminalApi/CoinsOrBills.cs | 0 Adyen/{src => }/Model/TerminalApi/ColorType.cs | 0 .../Model/TerminalApi/ContentInformation.cs | 0 Adyen/{src => }/Model/TerminalApi/ContentType.cs | 0 .../Model/TerminalApi/CurrencyConversion.cs | 0 Adyen/{src => }/Model/TerminalApi/CustomerOrder.cs | 0 .../Model/TerminalApi/CustomerOrderReqType.cs | 0 Adyen/{src => }/Model/TerminalApi/DeviceType.cs | 0 .../{src => }/Model/TerminalApi/DiagnosisRequest.cs | 0 .../{src => }/Model/TerminalApi/DiagnosisResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/DigestedData.cs | 0 Adyen/{src => }/Model/TerminalApi/DisplayOutput.cs | 0 Adyen/{src => }/Model/TerminalApi/DisplayRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/DisplayResponse.cs | 0 .../Model/TerminalApi/DocumentQualifierType.cs | 0 .../Model/TerminalApi/EnableServiceRequest.cs | 0 .../Model/TerminalApi/EnableServiceResponse.cs | 0 .../Model/TerminalApi/EncapsulatedContent.cs | 0 .../{src => }/Model/TerminalApi/EncryptedContent.cs | 0 Adyen/{src => }/Model/TerminalApi/EntryModeType.cs | 0 Adyen/{src => }/Model/TerminalApi/EnvelopedData.cs | 0 .../Model/TerminalApi/ErrorConditionType.cs | 0 .../{src => }/Model/TerminalApi/EventNotification.cs | 0 .../{src => }/Model/TerminalApi/EventToNotifyType.cs | 0 .../{src => }/Model/TerminalApi/ForceTypeModeType.cs | 0 .../Model/TerminalApi/GenericProfileType.cs | 0 .../Model/TerminalApi/GeographicCoordinates.cs | 0 Adyen/{src => }/Model/TerminalApi/Geolocation.cs | 0 .../{src => }/Model/TerminalApi/GetTotalsRequest.cs | 0 .../{src => }/Model/TerminalApi/GetTotalsResponse.cs | 0 .../{src => }/Model/TerminalApi/GlobalStatusType.cs | 0 Adyen/{src => }/Model/TerminalApi/HostStatus.cs | 0 Adyen/{src => }/Model/TerminalApi/ICCResetData.cs | 0 .../Model/TerminalApi/IdentificationSupportType.cs | 0 .../Model/TerminalApi/IdentificationType.cs | 0 Adyen/{src => }/Model/TerminalApi/InfoQualifyType.cs | 0 Adyen/{src => }/Model/TerminalApi/Input.cs | 0 .../{src => }/Model/TerminalApi/InputCommandType.cs | 0 Adyen/{src => }/Model/TerminalApi/InputData.cs | 0 Adyen/{src => }/Model/TerminalApi/InputRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/InputResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/InputResult.cs | 0 Adyen/{src => }/Model/TerminalApi/InputUpdate.cs | 0 Adyen/{src => }/Model/TerminalApi/Instalment.cs | 0 .../Model/TerminalApi/IssuerAndSerialNumber.cs | 0 Adyen/{src => }/Model/TerminalApi/KEK.cs | 0 Adyen/{src => }/Model/TerminalApi/KEKIdentifier.cs | 0 Adyen/{src => }/Model/TerminalApi/KeyTransport.cs | 0 Adyen/{src => }/Model/TerminalApi/LoginRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/LoginResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/LogoutRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/LogoutResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyAccount.cs | 0 .../{src => }/Model/TerminalApi/LoyaltyAccountID.cs | 0 .../{src => }/Model/TerminalApi/LoyaltyAccountReq.cs | 0 .../Model/TerminalApi/LoyaltyAccountStatus.cs | 0 .../Model/TerminalApi/LoyaltyAcquirerData.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyAmount.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyData.cs | 0 .../Model/TerminalApi/LoyaltyHandlingType.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyResult.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyTotals.cs | 0 .../Model/TerminalApi/LoyaltyTransaction.cs | 0 .../Model/TerminalApi/LoyaltyTransactionType.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyUnitType.cs | 0 Adyen/{src => }/Model/TerminalApi/MenuEntry.cs | 0 .../{src => }/Model/TerminalApi/MenuEntryTagType.cs | 0 .../Model/TerminalApi/Message/SaleToPOIRequest.cs | 0 .../TerminalApi/Message/SaleToPoiRequestSecured.cs | 0 .../TerminalApi/Message/SaleToPoiResponseSecured.cs | 0 .../Model/TerminalApi/MessageCategoryType.cs | 0 .../{src => }/Model/TerminalApi/MessageClassType.cs | 0 Adyen/{src => }/Model/TerminalApi/MessageHeader.cs | 0 .../{src => }/Model/TerminalApi/MessageReference.cs | 0 Adyen/{src => }/Model/TerminalApi/MessageType.cs | 0 Adyen/{src => }/Model/TerminalApi/MobileData.cs | 0 .../Model/TerminalApi/NamedKeyEncryptedData.cs | 0 .../Model/TerminalApi/OriginalPOITransaction.cs | 0 Adyen/{src => }/Model/TerminalApi/OutputBarcode.cs | 0 Adyen/{src => }/Model/TerminalApi/OutputContent.cs | 0 .../{src => }/Model/TerminalApi/OutputFormatType.cs | 0 Adyen/{src => }/Model/TerminalApi/OutputResult.cs | 0 Adyen/{src => }/Model/TerminalApi/OutputText.cs | 0 Adyen/{src => }/Model/TerminalApi/PINFormatType.cs | 0 Adyen/{src => }/Model/TerminalApi/PINRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/PINRequestType.cs | 0 Adyen/{src => }/Model/TerminalApi/PINResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/POIData.cs | 0 Adyen/{src => }/Model/TerminalApi/POIProfile.cs | 0 Adyen/{src => }/Model/TerminalApi/POISoftware.cs | 0 Adyen/{src => }/Model/TerminalApi/POIStatus.cs | 0 Adyen/{src => }/Model/TerminalApi/POISystemData.cs | 0 Adyen/{src => }/Model/TerminalApi/POITerminalData.cs | 0 Adyen/{src => }/Model/TerminalApi/Parameter.cs | 0 .../{src => }/Model/TerminalApi/PaymentAccountReq.cs | 0 .../Model/TerminalApi/PaymentAccountStatus.cs | 0 .../Model/TerminalApi/PaymentAcquirerData.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentData.cs | 0 .../Model/TerminalApi/PaymentInstrumentData.cs | 0 .../Model/TerminalApi/PaymentInstrumentType.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentReceipt.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentResult.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentToken.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentTotals.cs | 0 .../Model/TerminalApi/PaymentTransaction.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentType.cs | 0 .../Model/TerminalApi/PerformedTransaction.cs | 0 Adyen/{src => }/Model/TerminalApi/PeriodUnitType.cs | 0 .../{src => }/Model/TerminalApi/PredefinedContent.cs | 0 Adyen/{src => }/Model/TerminalApi/PrintOutput.cs | 0 Adyen/{src => }/Model/TerminalApi/PrintRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/PrintResponse.cs | 0 .../{src => }/Model/TerminalApi/PrinterStatusType.cs | 0 Adyen/{src => }/Model/TerminalApi/Rebates.cs | 0 .../Model/TerminalApi/RecipientIdentifier.cs | 0 .../Model/TerminalApi/ReconciliationRequest.cs | 0 .../Model/TerminalApi/ReconciliationResponse.cs | 0 .../Model/TerminalApi/ReconciliationType.cs | 0 .../Model/TerminalApi/RelativeDistinguishedName.cs | 0 .../Model/TerminalApi/RepeatedMessageResponse.cs | 0 .../Model/TerminalApi/RepeatedResponseMessageBody.cs | 0 Adyen/{src => }/Model/TerminalApi/Response.cs | 0 .../{src => }/Model/TerminalApi/ResponseModeType.cs | 0 Adyen/{src => }/Model/TerminalApi/ResultType.cs | 0 .../Model/TerminalApi/ReversalReasonType.cs | 0 Adyen/{src => }/Model/TerminalApi/ReversalRequest.cs | 0 .../{src => }/Model/TerminalApi/ReversalResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleData.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleItem.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleItemRebate.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleProfile.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleSoftware.cs | 0 .../{src => }/Model/TerminalApi/SaleTerminalData.cs | 0 .../{src => }/Model/TerminalApi/SaleToIssuerData.cs | 0 .../{src => }/Model/TerminalApi/SaleToPOIMessage.cs | 0 .../{src => }/Model/TerminalApi/SaleToPOIResponse.cs | 0 .../{src => }/Model/TerminalApi/SensitiveCardData.cs | 0 .../Model/TerminalApi/SensitiveMobileData.cs | 0 Adyen/{src => }/Model/TerminalApi/SignaturePoint.cs | 0 Adyen/{src => }/Model/TerminalApi/SignedData.cs | 0 Adyen/{src => }/Model/TerminalApi/Signer.cs | 0 .../{src => }/Model/TerminalApi/SignerIdentifier.cs | 0 Adyen/{src => }/Model/TerminalApi/SoundActionType.cs | 0 Adyen/{src => }/Model/TerminalApi/SoundContent.cs | 0 Adyen/{src => }/Model/TerminalApi/SoundFormatType.cs | 0 Adyen/{src => }/Model/TerminalApi/SoundRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/SoundResponse.cs | 0 .../{src => }/Model/TerminalApi/SponsoredMerchant.cs | 0 .../Model/TerminalApi/StoredValueAccountID.cs | 0 .../Model/TerminalApi/StoredValueAccountStatus.cs | 0 .../Model/TerminalApi/StoredValueAccountType.cs | 0 Adyen/{src => }/Model/TerminalApi/StoredValueData.cs | 0 .../Model/TerminalApi/StoredValueRequest.cs | 0 .../Model/TerminalApi/StoredValueResponse.cs | 0 .../{src => }/Model/TerminalApi/StoredValueResult.cs | 0 .../Model/TerminalApi/StoredValueTransactionType.cs | 0 .../Model/TerminalApi/TerminalEnvironmentType.cs | 0 .../Model/TerminalApi/TokenRequestedType.cs | 0 .../{src => }/Model/TerminalApi/TotalDetailsType.cs | 0 Adyen/{src => }/Model/TerminalApi/TotalFilter.cs | 0 Adyen/{src => }/Model/TerminalApi/TrackData.cs | 0 Adyen/{src => }/Model/TerminalApi/TrackFormatType.cs | 0 .../Model/TerminalApi/TransactionActionType.cs | 0 .../Model/TerminalApi/TransactionConditions.cs | 0 .../Model/TerminalApi/TransactionIdentification.cs | 0 .../Model/TerminalApi/TransactionStatusRequest.cs | 0 .../Model/TerminalApi/TransactionStatusResponse.cs | 0 .../Model/TerminalApi/TransactionToPerform.cs | 0 .../{src => }/Model/TerminalApi/TransactionTotals.cs | 0 Adyen/{src => }/Model/TerminalApi/TransactionType.cs | 0 Adyen/{src => }/Model/TerminalApi/TransmitRequest.cs | 0 .../{src => }/Model/TerminalApi/TransmitResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/UTMCoordinates.cs | 0 .../{src => }/Model/TerminalApi/UnitOfMeasureType.cs | 0 Adyen/{src => }/Model/TerminalApi/VersionType.cs | 0 .../TransactionWebhooks/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/TransactionWebhooks/Amount.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../Model/TransactionWebhooks/BankCategoryData.cs | 0 .../TransactionWebhooks/InternalCategoryData.cs | 0 .../Model/TransactionWebhooks/IssuedCard.cs | 0 .../Model/TransactionWebhooks/PaymentInstrument.cs | 0 .../Model/TransactionWebhooks/PlatformPayment.cs | 0 .../TransactionWebhooks/RelayedAuthorisationData.cs | 0 .../{src => }/Model/TransactionWebhooks/Resource.cs | 0 .../Model/TransactionWebhooks/ResourceReference.cs | 0 .../Model/TransactionWebhooks/ThreeDSecure.cs | 0 .../Model/TransactionWebhooks/Transaction.cs | 0 .../TransactionNotificationRequestV4.cs | 0 .../TransferNotificationValidationFact.cs | 0 .../Model/TransactionWebhooks/TransferView.cs | 0 .../TransactionWebhooks/TransferViewCategoryData.cs | 0 .../TransferWebhooks/AULocalAccountIdentification.cs | 0 .../Model/TransferWebhooks/AbstractOpenAPISchema.cs | 0 .../TransferWebhooks/AdditionalBankIdentification.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Address.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Airline.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Amount.cs | 0 .../Model/TransferWebhooks/AmountAdjustment.cs | 0 .../TransferWebhooks/BRLocalAccountIdentification.cs | 0 .../Model/TransferWebhooks/BalanceMutation.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../Model/TransferWebhooks/BankAccountV3.cs | 0 .../BankAccountV3AccountIdentification.cs | 0 .../Model/TransferWebhooks/BankCategoryData.cs | 0 .../TransferWebhooks/CALocalAccountIdentification.cs | 0 .../TransferWebhooks/CZLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Card.cs | 0 .../Model/TransferWebhooks/CardIdentification.cs | 0 .../TransferWebhooks/ConfirmationTrackingData.cs | 0 .../Model/TransferWebhooks/CounterpartyV3.cs | 0 .../TransferWebhooks/DKLocalAccountIdentification.cs | 0 .../Model/TransferWebhooks/DirectDebitInformation.cs | 0 .../Model/TransferWebhooks/EstimationTrackingData.cs | 0 .../Model/TransferWebhooks/ExternalReason.cs | 0 .../TransferWebhooks/HKLocalAccountIdentification.cs | 0 .../TransferWebhooks/HULocalAccountIdentification.cs | 0 .../TransferWebhooks/IbanAccountIdentification.cs | 0 .../Model/TransferWebhooks/InternalCategoryData.cs | 0 .../TransferWebhooks/InternalReviewTrackingData.cs | 0 Adyen/{src => }/Model/TransferWebhooks/IssuedCard.cs | 0 .../Model/TransferWebhooks/IssuingTransactionData.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Leg.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Lodging.cs | 0 .../{src => }/Model/TransferWebhooks/MerchantData.cs | 0 .../Model/TransferWebhooks/MerchantPurchaseData.cs | 0 .../{src => }/Model/TransferWebhooks/Modification.cs | 0 .../TransferWebhooks/NOLocalAccountIdentification.cs | 0 .../TransferWebhooks/NZLocalAccountIdentification.cs | 0 .../{src => }/Model/TransferWebhooks/NameLocation.cs | 0 .../NumberAndBicAccountIdentification.cs | 0 .../TransferWebhooks/PLLocalAccountIdentification.cs | 0 .../Model/TransferWebhooks/PartyIdentification.cs | 0 .../Model/TransferWebhooks/PaymentInstrument.cs | 0 .../Model/TransferWebhooks/PlatformPayment.cs | 0 .../TransferWebhooks/RelayedAuthorisationData.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Resource.cs | 0 .../Model/TransferWebhooks/ResourceReference.cs | 0 .../TransferWebhooks/SELocalAccountIdentification.cs | 0 .../TransferWebhooks/SGLocalAccountIdentification.cs | 0 .../TransferWebhooks/TransactionEventViolation.cs | 0 .../TransferWebhooks/TransactionRuleReference.cs | 0 .../Model/TransferWebhooks/TransactionRuleSource.cs | 0 .../Model/TransferWebhooks/TransactionRulesResult.cs | 0 .../{src => }/Model/TransferWebhooks/TransferData.cs | 0 .../TransferWebhooks/TransferDataCategoryData.cs | 0 .../Model/TransferWebhooks/TransferDataTracking.cs | 0 .../Model/TransferWebhooks/TransferEvent.cs | 0 .../TransferWebhooks/TransferEventEventsDataInner.cs | 0 .../TransferWebhooks/TransferEventTrackingData.cs | 0 .../TransferNotificationCounterParty.cs | 0 .../TransferNotificationMerchantData.cs | 0 .../TransferWebhooks/TransferNotificationRequest.cs | 0 .../TransferNotificationValidationFact.cs | 0 .../Model/TransferWebhooks/TransferReview.cs | 0 .../TransferWebhooks/UKLocalAccountIdentification.cs | 0 .../TransferWebhooks/USLocalAccountIdentification.cs | 0 .../Model/Transfers/AULocalAccountIdentification.cs | 0 .../Model/Transfers/AbstractOpenAPISchema.cs | 0 .../Model/Transfers/AdditionalBankIdentification.cs | 0 Adyen/{src => }/Model/Transfers/Address.cs | 0 Adyen/{src => }/Model/Transfers/Airline.cs | 0 Adyen/{src => }/Model/Transfers/Amount.cs | 0 Adyen/{src => }/Model/Transfers/AmountAdjustment.cs | 0 .../Model/Transfers/ApproveTransfersRequest.cs | 0 .../Model/Transfers/BRLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/BalanceMutation.cs | 0 Adyen/{src => }/Model/Transfers/BankAccountV3.cs | 0 .../Transfers/BankAccountV3AccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/BankCategoryData.cs | 0 .../Model/Transfers/CALocalAccountIdentification.cs | 0 .../Model/Transfers/CZLocalAccountIdentification.cs | 0 .../Model/Transfers/CancelTransfersRequest.cs | 0 Adyen/{src => }/Model/Transfers/CapitalBalance.cs | 0 Adyen/{src => }/Model/Transfers/CapitalGrant.cs | 0 Adyen/{src => }/Model/Transfers/CapitalGrantInfo.cs | 0 Adyen/{src => }/Model/Transfers/CapitalGrants.cs | 0 Adyen/{src => }/Model/Transfers/Card.cs | 0 .../{src => }/Model/Transfers/CardIdentification.cs | 0 .../Model/Transfers/ConfirmationTrackingData.cs | 0 Adyen/{src => }/Model/Transfers/Counterparty.cs | 0 .../{src => }/Model/Transfers/CounterpartyInfoV3.cs | 0 Adyen/{src => }/Model/Transfers/CounterpartyV3.cs | 0 .../Model/Transfers/DKLocalAccountIdentification.cs | 0 .../Model/Transfers/DirectDebitInformation.cs | 0 .../Model/Transfers/EstimationTrackingData.cs | 0 Adyen/{src => }/Model/Transfers/ExternalReason.cs | 0 Adyen/{src => }/Model/Transfers/Fee.cs | 0 .../Model/Transfers/FindTransfersResponse.cs | 0 .../Model/Transfers/HKLocalAccountIdentification.cs | 0 .../Model/Transfers/HULocalAccountIdentification.cs | 0 .../Model/Transfers/IbanAccountIdentification.cs | 0 .../Model/Transfers/InternalCategoryData.cs | 0 .../Model/Transfers/InternalReviewTrackingData.cs | 0 Adyen/{src => }/Model/Transfers/InvalidField.cs | 0 Adyen/{src => }/Model/Transfers/IssuedCard.cs | 0 .../Model/Transfers/IssuingTransactionData.cs | 0 Adyen/{src => }/Model/Transfers/Leg.cs | 0 Adyen/{src => }/Model/Transfers/Link.cs | 0 Adyen/{src => }/Model/Transfers/Links.cs | 0 Adyen/{src => }/Model/Transfers/Lodging.cs | 0 Adyen/{src => }/Model/Transfers/MerchantData.cs | 0 .../Model/Transfers/MerchantPurchaseData.cs | 0 Adyen/{src => }/Model/Transfers/Modification.cs | 0 .../Model/Transfers/NOLocalAccountIdentification.cs | 0 .../Model/Transfers/NZLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/NameLocation.cs | 0 .../Transfers/NumberAndBicAccountIdentification.cs | 0 .../Model/Transfers/PLLocalAccountIdentification.cs | 0 .../{src => }/Model/Transfers/PartyIdentification.cs | 0 Adyen/{src => }/Model/Transfers/PaymentInstrument.cs | 0 Adyen/{src => }/Model/Transfers/PlatformPayment.cs | 0 .../Model/Transfers/RelayedAuthorisationData.cs | 0 Adyen/{src => }/Model/Transfers/Repayment.cs | 0 Adyen/{src => }/Model/Transfers/RepaymentTerm.cs | 0 Adyen/{src => }/Model/Transfers/ResourceReference.cs | 0 Adyen/{src => }/Model/Transfers/RestServiceError.cs | 0 .../Model/Transfers/ReturnTransferRequest.cs | 0 .../Model/Transfers/ReturnTransferResponse.cs | 0 Adyen/{src => }/Model/Transfers/RoutingDetails.cs | 0 .../Model/Transfers/SELocalAccountIdentification.cs | 0 .../Model/Transfers/SGLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/ServiceError.cs | 0 .../{src => }/Model/Transfers/ThresholdRepayment.cs | 0 Adyen/{src => }/Model/Transfers/Transaction.cs | 0 .../Model/Transfers/TransactionEventViolation.cs | 0 .../Model/Transfers/TransactionRuleReference.cs | 0 .../Model/Transfers/TransactionRuleSource.cs | 0 .../Model/Transfers/TransactionRulesResult.cs | 0 .../Model/Transfers/TransactionSearchResponse.cs | 0 Adyen/{src => }/Model/Transfers/Transfer.cs | 0 .../Model/Transfers/TransferCategoryData.cs | 0 Adyen/{src => }/Model/Transfers/TransferData.cs | 0 .../Model/Transfers/TransferDataTracking.cs | 0 Adyen/{src => }/Model/Transfers/TransferEvent.cs | 0 .../Model/Transfers/TransferEventEventsDataInner.cs | 0 .../Model/Transfers/TransferEventTrackingData.cs | 0 Adyen/{src => }/Model/Transfers/TransferInfo.cs | 0 .../Transfers/TransferNotificationCounterParty.cs | 0 .../Transfers/TransferNotificationMerchantData.cs | 0 .../Transfers/TransferNotificationValidationFact.cs | 0 .../Model/Transfers/TransferRequestReview.cs | 0 Adyen/{src => }/Model/Transfers/TransferReview.cs | 0 .../Transfers/TransferServiceRestServiceError.cs | 0 Adyen/{src => }/Model/Transfers/TransferView.cs | 0 .../Model/Transfers/UKLocalAccountIdentification.cs | 0 .../Model/Transfers/USLocalAccountIdentification.cs | 0 .../Model/Transfers/UltimatePartyIdentification.cs | 0 Adyen/{src => }/Security/AesEncryptor.cs | 0 .../Security/EncryptionCredentialDetails.cs | 0 Adyen/{src => }/Security/EncryptionDerivedKey.cs | 0 .../Security/EncryptionDerivedKeyGenerator.cs | 0 .../Security/Exceptions/NexoCryptoException.cs | 0 Adyen/{src => }/Security/Extension/ArrayExtension.cs | 0 Adyen/{src => }/Security/HmacSha256Wrapper.cs | 0 Adyen/{src => }/Security/IvModGenerator.cs | 0 Adyen/{src => }/Security/SaleToPoiMessageSecured.cs | 0 .../Security/SaleToPoiMessageSecuredEncryptor.cs | 0 Adyen/{src => }/Security/SecurityTrailer.cs | 0 .../Security/TerminalCommonNameValidator.cs | 0 Adyen/{src => }/Service/AbstractService.cs | 0 Adyen/{src => }/Service/ApiException.cs | 0 Adyen/{src => }/Service/BalanceControlService.cs | 0 .../Service/BalancePlatform/AccountHoldersService.cs | 0 .../BalancePlatform/BalanceAccountsService.cs | 0 .../BalancePlatform/BankAccountValidationService.cs | 0 .../Service/BalancePlatform/CardOrdersService.cs | 0 .../Service/BalancePlatform/GrantAccountsService.cs | 0 .../Service/BalancePlatform/GrantOffersService.cs | 0 .../Service/BalancePlatform/ManageCardPINService.cs | 0 .../BalancePlatform/ManageSCADevicesService.cs | 0 .../Service/BalancePlatform/NetworkTokensService.cs | 0 .../PaymentInstrumentGroupsService.cs | 0 .../BalancePlatform/PaymentInstrumentsService.cs | 0 .../Service/BalancePlatform/PlatformService.cs | 0 .../BalancePlatform/TransactionRulesService.cs | 0 .../Service/BalancePlatform/TransferRoutesService.cs | 0 Adyen/{src => }/Service/BinLookupService.cs | 0 Adyen/{src => }/Service/Checkout/DonationsService.cs | 0 .../Service/Checkout/ModificationsService.cs | 0 Adyen/{src => }/Service/Checkout/OrdersService.cs | 0 .../Service/Checkout/PaymentLinksService.cs | 0 Adyen/{src => }/Service/Checkout/PaymentsService.cs | 0 Adyen/{src => }/Service/Checkout/RecurringService.cs | 0 Adyen/{src => }/Service/Checkout/UtilityService.cs | 0 Adyen/{src => }/Service/DataProtectionService.cs | 0 Adyen/{src => }/Service/DisputesService.cs | 0 .../LegalEntityManagement/BusinessLinesService.cs | 0 .../LegalEntityManagement/DocumentsService.cs | 0 .../LegalEntityManagement/HostedOnboardingService.cs | 0 .../LegalEntityManagement/LegalEntitiesService.cs | 0 .../PCIQuestionnairesService.cs | 0 .../TaxEDeliveryConsentService.cs | 0 .../LegalEntityManagement/TermsOfServiceService.cs | 0 .../TransferInstrumentsService.cs | 0 .../Management/APICredentialsCompanyLevelService.cs | 0 .../Management/APICredentialsMerchantLevelService.cs | 0 .../Service/Management/APIKeyCompanyLevelService.cs | 0 .../Service/Management/APIKeyMerchantLevelService.cs | 0 .../Service/Management/AccountCompanyLevelService.cs | 0 .../Management/AccountMerchantLevelService.cs | 0 .../Service/Management/AccountStoreLevelService.cs | 0 .../Management/AllowedOriginsCompanyLevelService.cs | 0 .../Management/AllowedOriginsMerchantLevelService.cs | 0 .../Management/AndroidFilesCompanyLevelService.cs | 0 .../Management/ClientKeyCompanyLevelService.cs | 0 .../Management/ClientKeyMerchantLevelService.cs | 0 .../Service/Management/MyAPICredentialService.cs | 0 .../Management/PaymentMethodsMerchantLevelService.cs | 0 .../Management/PayoutSettingsMerchantLevelService.cs | 0 .../SplitConfigurationMerchantLevelService.cs | 0 .../Management/TerminalActionsCompanyLevelService.cs | 0 .../TerminalActionsTerminalLevelService.cs | 0 .../Management/TerminalOrdersCompanyLevelService.cs | 0 .../Management/TerminalOrdersMerchantLevelService.cs | 0 .../TerminalSettingsCompanyLevelService.cs | 0 .../TerminalSettingsMerchantLevelService.cs | 0 .../Management/TerminalSettingsStoreLevelService.cs | 0 .../TerminalSettingsTerminalLevelService.cs | 0 .../Management/TerminalsTerminalLevelService.cs | 0 .../Service/Management/UsersCompanyLevelService.cs | 0 .../Service/Management/UsersMerchantLevelService.cs | 0 .../Management/WebhooksCompanyLevelService.cs | 0 .../Management/WebhooksMerchantLevelService.cs | 0 Adyen/{src => }/Service/PaymentService.cs | 0 Adyen/{src => }/Service/PaymentsAppService.cs | 0 .../Service/Payout/InitializationService.cs | 0 .../Service/Payout/InstantPayoutsService.cs | 0 Adyen/{src => }/Service/Payout/ReviewingService.cs | 0 .../PlatformsAccount/AccountHoldersService.cs | 0 .../Service/PlatformsAccount/AccountsService.cs | 0 .../Service/PlatformsAccount/VerificationService.cs | 0 Adyen/{src => }/Service/PlatformsFundService.cs | 0 .../HostedOnboardingPageService.cs | 0 .../PCIComplianceQuestionnairePageService.cs | 0 .../PlatformsNotificationConfigurationService.cs | 0 Adyen/{src => }/Service/PosMobileService.cs | 0 .../Service/PosTerminalManagementService.cs | 0 Adyen/{src => }/Service/RecurringService.cs | 0 .../Service/Resource/Terminal/TerminalApi.cs | 0 .../Resource/Terminal/TerminalApiAsyncClient.cs | 0 .../Service/Resource/Terminal/TerminalApiLocal.cs | 0 .../Resource/Terminal/TerminalApiLocalClient.cs | 0 .../Resource/Terminal/TerminalApiSyncClient.cs | 0 Adyen/{src => }/Service/ServiceResource.cs | 0 Adyen/{src => }/Service/StoredValueService.cs | 0 Adyen/{src => }/Service/TerminalApiAsyncService.cs | 0 Adyen/{src => }/Service/TerminalApiLocalService.cs | 0 Adyen/{src => }/Service/TerminalApiSyncService.cs | 0 Adyen/{src => }/Service/TerminalCloudApi.cs | 0 Adyen/{src => }/Service/TerminalLocalApi.cs | 0 .../{src => }/Service/TerminalLocalApiUnencrypted.cs | 0 Adyen/{src => }/Service/Transfers/CapitalService.cs | 0 .../Service/Transfers/TransactionsService.cs | 0 .../{src => }/Service/Transfers/TransfersService.cs | 0 Adyen/{src => }/Util/ByteArrayConverter.cs | 0 Adyen/{src => }/Util/HMACValidator.cs | 0 Adyen/{src => }/Util/JsonOperation.cs | 0 .../{src => }/Util/TerminalApi/AdditionalResponse.cs | 0 .../Util/TerminalApi/CardAcquisitionUtil.cs | 0 Adyen/{src => }/Util/Util.cs | 0 .../Webhooks/BalancePlatformWebhookHandler.cs | 0 .../Webhooks/ClassicPlatformWebhookHandler.cs | 0 Adyen/{src => }/Webhooks/ManagementWebhookHandler.cs | 0 Adyen/{src => }/Webhooks/WebhookHandler.cs | 0 1781 files changed, 5 insertions(+), 12 deletions(-) rename Adyen/{src => }/ApiSerialization/Converter/JsonBase64Converter.cs (100%) rename Adyen/{src => }/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs (100%) rename Adyen/{src => }/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs (100%) rename Adyen/{src => }/ApiSerialization/Converter/SaleToPoiMessageConverter.cs (100%) rename Adyen/{src => }/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs (100%) rename Adyen/{src => }/ApiSerialization/IMessagePayload.cs (100%) rename Adyen/{src => }/ApiSerialization/IMessagePayloadSerializer.cs (100%) rename Adyen/{src => }/ApiSerialization/MessageHeaderSerializer.cs (100%) rename Adyen/{src => }/ApiSerialization/MessagePayloadSerializer.cs (100%) rename Adyen/{src => }/ApiSerialization/MessagePayloadSerializerFactory.cs (100%) rename Adyen/{src => }/ApiSerialization/OpenAPIDateConverter.cs (100%) rename Adyen/{src => }/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs (100%) rename Adyen/{src => }/ApiSerialization/SaleToPoiMessageSerializer.cs (100%) rename Adyen/{src => }/ApiSerialization/TypeHelper.cs (100%) rename Adyen/{src => }/Constants/ApiConstants.cs (100%) rename Adyen/{src => }/Constants/ClientConfig.cs (100%) rename Adyen/{src => }/Constants/Region.cs (100%) rename Adyen/{src => }/Core/Auth/ApiKeyToken.cs (100%) rename Adyen/{src => }/Core/Auth/BasicToken.cs (100%) rename Adyen/{src => }/Core/Auth/CookieContainer.cs (100%) rename Adyen/{src => }/Core/Auth/RateLimitProvider.cs (100%) rename Adyen/{src => }/Core/Auth/TokenBase.cs (100%) rename Adyen/{src => }/Core/Auth/TokenContainer.cs (100%) rename Adyen/{src => }/Core/Auth/TokenProvider.cs (100%) rename Adyen/{src => }/Core/Client/ApiException.cs (100%) rename Adyen/{src => }/Core/Client/ApiFactory.cs (100%) rename Adyen/{src => }/Core/Client/ApiResponse.cs (100%) rename Adyen/{src => }/Core/Client/ApiResponseEventArgs.cs (100%) rename Adyen/{src => }/Core/Client/ExceptionEventArgs.cs (100%) rename Adyen/{src => }/Core/Client/Extensions/HttpClientBuilderExtensions.cs (100%) rename Adyen/{src => }/Core/Client/IAdyenApiService.cs (100%) rename Adyen/{src => }/Core/Converters/DateOnlyJsonConverter.cs (100%) rename Adyen/{src => }/Core/Converters/DateOnlyNullableJsonConverter.cs (100%) rename Adyen/{src => }/Core/Converters/DateTimeJsonConverter.cs (100%) rename Adyen/{src => }/Core/Converters/DateTimeNullableJsonConverter.cs (100%) rename Adyen/{src => }/Core/JsonSerializerOptionsProvider.cs (100%) rename Adyen/{src => }/Core/Option.cs (100%) rename Adyen/{src => }/Exceptions/DeserializationException.cs (100%) rename Adyen/{src => }/Exceptions/ExceptionMessages.cs (100%) rename Adyen/{src => }/HttpClient/HttpClientException.cs (100%) rename Adyen/{src => }/HttpClient/HttpClientExtension.cs (100%) rename Adyen/{src => }/HttpClient/HttpClientWrapper.cs (100%) rename Adyen/{src => }/HttpClient/Interfaces/IClient.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/AuthenticationDecision.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/AuthenticationInfo.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/AuthenticationNotificationData.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/AuthenticationNotificationRequest.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/ChallengeInfo.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/Purchase.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/PurchaseInfo.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/RelayedAuthenticationRequest.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/RelayedAuthenticationResponse.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/Resource.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/ServiceError.cs (100%) rename Adyen/{src => }/Model/ApiError.cs (100%) rename Adyen/{src => }/Model/ApplicationInformation/ApplicationInfo.cs (100%) rename Adyen/{src => }/Model/ApplicationInformation/CommonField.cs (100%) rename Adyen/{src => }/Model/ApplicationInformation/ExternalPlatform.cs (100%) rename Adyen/{src => }/Model/ApplicationInformation/MerchantDevice.cs (100%) rename Adyen/{src => }/Model/ApplicationInformation/ShopperInteractionDevice.cs (100%) rename Adyen/{src => }/Model/BalanceControl/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/BalanceControl/Amount.cs (100%) rename Adyen/{src => }/Model/BalanceControl/BalanceTransferRequest.cs (100%) rename Adyen/{src => }/Model/BalanceControl/BalanceTransferResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AccountHolder.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AccountHolderCapability.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AccountHolderInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AccountHolderUpdateRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AccountSupportingEntityCapability.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AdditionalBankIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Address.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AddressRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Amount.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AmountMinMaxRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AssociationFinaliseRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AssociationFinaliseResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AssociationInitiateRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AssociationInitiateResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Authentication.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BRLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Balance.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BalanceAccount.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BalanceAccountBase.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BalanceAccountInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BalanceAccountUpdateRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BalancePlatform.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccount.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccountAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccountDetails.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccountModel.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BrandVariantsRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BulkAddress.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CALocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CapabilityProblem.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CapabilityProblemEntity.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CapabilitySettings.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CapitalBalance.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CapitalGrantAccount.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Card.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CardConfiguration.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CardInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CardOrder.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CardOrderItem.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/ContactDetails.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Counterparty.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CounterpartyBankRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CounterpartyTypesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CountriesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CreateSweepConfigurationV2.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DayOfWeekRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DelegatedAuthenticationData.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DeliveryAddress.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DeliveryContact.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Device.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DeviceInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DifferentCurrenciesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Duration.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/EntryModesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Expiry.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Fee.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/GetNetworkTokenResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/GetTaxFormResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/GrantLimit.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/GrantOffer.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/GrantOffers.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/HKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/HULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Href.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/IbanAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/InternationalTransactionRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/InvalidField.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Link.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/ListNetworkTokensResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/MatchingTransactionsRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/MatchingValuesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/MccsRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/MerchantAcquirerPair.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/MerchantNamesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/MerchantsRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/NOLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/NZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Name.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/NetworkToken.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PLLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrument.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentGroup.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Phone.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PhoneNumber.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PinChangeRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PinChangeResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PlatformPaymentConfiguration.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/ProcessingTypesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PublicKeyResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RegisterSCAFinalResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RegisterSCARequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RegisterSCAResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RemediatingAction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Repayment.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RepaymentTerm.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RestServiceError.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RevealPinRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RevealPinResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RiskScores.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RiskScoresRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SELocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SGLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SameAmountRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SameCounterpartyRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SourceAccountTypesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/StringMatch.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SweepConfigurationV2.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SweepCounterparty.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SweepSchedule.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/ThresholdRepayment.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TimeOfDay.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TimeOfDayRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TokenRequestorsRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TotalAmountRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRule.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRuleEntityKey.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRuleInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRuleInterval.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRuleResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRuleRestrictions.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRulesResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransferRoute.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransferRouteRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransferRouteRequirementsInner.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransferRouteResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/UKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/USInternationalAchAddressRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/USLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/UpdateNetworkTokenRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/UpdatePaymentInstrument.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/UpdateSweepConfigurationV2.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/VerificationDeadline.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/VerificationError.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/VerificationErrorRecursive.cs (100%) rename Adyen/{src => }/Model/BinLookup/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/BinLookup/Amount.cs (100%) rename Adyen/{src => }/Model/BinLookup/BinDetail.cs (100%) rename Adyen/{src => }/Model/BinLookup/CardBin.cs (100%) rename Adyen/{src => }/Model/BinLookup/CostEstimateAssumptions.cs (100%) rename Adyen/{src => }/Model/BinLookup/CostEstimateRequest.cs (100%) rename Adyen/{src => }/Model/BinLookup/CostEstimateResponse.cs (100%) rename Adyen/{src => }/Model/BinLookup/DSPublicKeyDetail.cs (100%) rename Adyen/{src => }/Model/BinLookup/MerchantDetails.cs (100%) rename Adyen/{src => }/Model/BinLookup/Recurring.cs (100%) rename Adyen/{src => }/Model/BinLookup/ServiceError.cs (100%) rename Adyen/{src => }/Model/BinLookup/ThreeDS2CardRangeDetail.cs (100%) rename Adyen/{src => }/Model/BinLookup/ThreeDSAvailabilityRequest.cs (100%) rename Adyen/{src => }/Model/BinLookup/ThreeDSAvailabilityResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Checkout/AccountInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/AcctInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/AchDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalData3DSecure.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataAirline.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataCarRental.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataCommon.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataLevel23.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataLodging.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataOpenInvoice.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataOpi.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataRatepay.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataRetry.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataRisk.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataRiskStandalone.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataSubMerchant.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataTemporaryServices.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataWallets.cs (100%) rename Adyen/{src => }/Model/Checkout/Address.cs (100%) rename Adyen/{src => }/Model/Checkout/AffirmDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/AfterpayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Agency.cs (100%) rename Adyen/{src => }/Model/Checkout/Airline.cs (100%) rename Adyen/{src => }/Model/Checkout/AmazonPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Amount.cs (100%) rename Adyen/{src => }/Model/Checkout/Amounts.cs (100%) rename Adyen/{src => }/Model/Checkout/AncvDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/AndroidPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/ApplePayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/ApplePayDonations.cs (100%) rename Adyen/{src => }/Model/Checkout/ApplePaySessionRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/ApplePaySessionResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/ApplicationInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/AuthenticationData.cs (100%) rename Adyen/{src => }/Model/Checkout/BacsDirectDebitDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/BalanceCheckRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/BalanceCheckResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/BillDeskDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/BillingAddress.cs (100%) rename Adyen/{src => }/Model/Checkout/BlikDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/BrowserInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/CancelOrderRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/CancelOrderResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/CardBrandDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/CardDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/CardDetailsRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/CardDetailsResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/CardDonations.cs (100%) rename Adyen/{src => }/Model/Checkout/CashAppDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/CellulantDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutAwaitAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutBankAccount.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutBankTransferAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutNativeRedirectAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutOrderResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutPaymentMethod.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutQrCodeAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutRedirectAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutSDKAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutSessionInstallmentOption.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutThreeDS2Action.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutVoucherAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CommonField.cs (100%) rename Adyen/{src => }/Model/Checkout/Company.cs (100%) rename Adyen/{src => }/Model/Checkout/CreateCheckoutSessionRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/CreateCheckoutSessionResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/CreateOrderRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/CreateOrderResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/DeliveryAddress.cs (100%) rename Adyen/{src => }/Model/Checkout/DeliveryMethod.cs (100%) rename Adyen/{src => }/Model/Checkout/DetailsRequestAuthenticationData.cs (100%) rename Adyen/{src => }/Model/Checkout/DeviceRenderOptions.cs (100%) rename Adyen/{src => }/Model/Checkout/DokuDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Donation.cs (100%) rename Adyen/{src => }/Model/Checkout/DonationCampaign.cs (100%) rename Adyen/{src => }/Model/Checkout/DonationCampaignsRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/DonationCampaignsResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/DonationPaymentMethod.cs (100%) rename Adyen/{src => }/Model/Checkout/DonationPaymentRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/DonationPaymentResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/DragonpayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/EBankingFinlandDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/EcontextVoucherDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/EftDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/EncryptedOrderData.cs (100%) rename Adyen/{src => }/Model/Checkout/EnhancedSchemeData.cs (100%) rename Adyen/{src => }/Model/Checkout/ExternalPlatform.cs (100%) rename Adyen/{src => }/Model/Checkout/FastlaneDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/ForexQuote.cs (100%) rename Adyen/{src => }/Model/Checkout/FraudCheckResult.cs (100%) rename Adyen/{src => }/Model/Checkout/FraudResult.cs (100%) rename Adyen/{src => }/Model/Checkout/FundOrigin.cs (100%) rename Adyen/{src => }/Model/Checkout/FundRecipient.cs (100%) rename Adyen/{src => }/Model/Checkout/GenericIssuerPaymentMethodDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/GooglePayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/GooglePayDonations.cs (100%) rename Adyen/{src => }/Model/Checkout/IdealDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/IdealDonations.cs (100%) rename Adyen/{src => }/Model/Checkout/InputDetail.cs (100%) rename Adyen/{src => }/Model/Checkout/InstallmentOption.cs (100%) rename Adyen/{src => }/Model/Checkout/Installments.cs (100%) rename Adyen/{src => }/Model/Checkout/Item.cs (100%) rename Adyen/{src => }/Model/Checkout/KlarnaDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Leg.cs (100%) rename Adyen/{src => }/Model/Checkout/LineItem.cs (100%) rename Adyen/{src => }/Model/Checkout/ListStoredPaymentMethodsResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/Mandate.cs (100%) rename Adyen/{src => }/Model/Checkout/MasterpassDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/MbwayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/MerchantDevice.cs (100%) rename Adyen/{src => }/Model/Checkout/MerchantRiskIndicator.cs (100%) rename Adyen/{src => }/Model/Checkout/MobilePayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/MolPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Name.cs (100%) rename Adyen/{src => }/Model/Checkout/OpenInvoiceDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Passenger.cs (100%) rename Adyen/{src => }/Model/Checkout/PayByBankAISDirectDebitDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayByBankDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayPalDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayToDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayUUpiDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayWithGoogleDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayWithGoogleDonations.cs (100%) rename Adyen/{src => }/Model/Checkout/Payment.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentAmountUpdateRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentAmountUpdateResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentCancelRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentCancelResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentCaptureRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentCaptureResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentCompletionDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentDetailsRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentDetailsResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentLinkRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentLinkResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethod.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethodGroup.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethodIssuer.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethodToStore.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethodUPIApps.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethodsRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethodsResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentRefundRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentRefundResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentResponseAction.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentReversalRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentReversalResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaypalUpdateOrderRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaypalUpdateOrderResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/Phone.cs (100%) rename Adyen/{src => }/Model/Checkout/PixDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PixRecurring.cs (100%) rename Adyen/{src => }/Model/Checkout/PlatformChargebackLogic.cs (100%) rename Adyen/{src => }/Model/Checkout/PseDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/RakutenPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/RatepayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Recurring.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalData3DSecure.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataBillingAddress.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataCard.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataCommon.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataDomesticError.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataInstallments.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataOpi.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataSepa.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponsePaymentMethod.cs (100%) rename Adyen/{src => }/Model/Checkout/RiskData.cs (100%) rename Adyen/{src => }/Model/Checkout/RivertyDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/SDKEphemPubKey.cs (100%) rename Adyen/{src => }/Model/Checkout/SamsungPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/SepaDirectDebitDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/ServiceError.cs (100%) rename Adyen/{src => }/Model/Checkout/SessionResultResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/ShopperInteractionDevice.cs (100%) rename Adyen/{src => }/Model/Checkout/Split.cs (100%) rename Adyen/{src => }/Model/Checkout/SplitAmount.cs (100%) rename Adyen/{src => }/Model/Checkout/StandalonePaymentCancelRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/StandalonePaymentCancelResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/StoredPaymentMethod.cs (100%) rename Adyen/{src => }/Model/Checkout/StoredPaymentMethodDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/StoredPaymentMethodRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/StoredPaymentMethodResource.cs (100%) rename Adyen/{src => }/Model/Checkout/SubInputDetail.cs (100%) rename Adyen/{src => }/Model/Checkout/SubMerchant.cs (100%) rename Adyen/{src => }/Model/Checkout/SubMerchantInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/Surcharge.cs (100%) rename Adyen/{src => }/Model/Checkout/TaxTotal.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDS2RequestData.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDS2RequestFields.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDS2ResponseData.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDS2Result.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDSRequestData.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDSecureData.cs (100%) rename Adyen/{src => }/Model/Checkout/Ticket.cs (100%) rename Adyen/{src => }/Model/Checkout/TravelAgency.cs (100%) rename Adyen/{src => }/Model/Checkout/TwintDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/UpdatePaymentLinkRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/UpiCollectDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/UpiIntentDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/UtilityRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/UtilityResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/VippsDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/VisaCheckoutDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/WeChatPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/WeChatPayMiniProgramDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/ZipDetails.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/AccountHolder.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/AccountHolderCapability.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Address.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Authentication.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Balance.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/BalanceAccount.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/BankAccountDetails.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/BulkAddress.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CapabilityProblem.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CapabilitySettings.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Card.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CardConfiguration.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CardOrderItem.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/ContactDetails.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/DeliveryAddress.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/DeliveryContact.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Device.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Expiry.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/IbanAccountIdentification.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Name.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/PaymentInstrument.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Phone.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/PhoneNumber.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/RemediatingAction.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Resource.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/SweepConfigurationV2.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/SweepCounterparty.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/SweepSchedule.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/TokenAuthentication.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/ValidationFacts.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/VerificationDeadline.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/VerificationError.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Wallet.cs (100%) rename Adyen/{src => }/Model/DataProtection/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/DataProtection/ServiceError.cs (100%) rename Adyen/{src => }/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs (100%) rename Adyen/{src => }/Model/DataProtection/SubjectErasureResponse.cs (100%) rename Adyen/{src => }/Model/DisputeWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/DisputeWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{src => }/Model/DisputeWebhooks/DisputeEventNotification.cs (100%) rename Adyen/{src => }/Model/DisputeWebhooks/DisputeNotificationRequest.cs (100%) rename Adyen/{src => }/Model/Disputes/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Disputes/AcceptDisputeRequest.cs (100%) rename Adyen/{src => }/Model/Disputes/AcceptDisputeResponse.cs (100%) rename Adyen/{src => }/Model/Disputes/DefendDisputeRequest.cs (100%) rename Adyen/{src => }/Model/Disputes/DefendDisputeResponse.cs (100%) rename Adyen/{src => }/Model/Disputes/DefenseDocument.cs (100%) rename Adyen/{src => }/Model/Disputes/DefenseDocumentType.cs (100%) rename Adyen/{src => }/Model/Disputes/DefenseReason.cs (100%) rename Adyen/{src => }/Model/Disputes/DefenseReasonsRequest.cs (100%) rename Adyen/{src => }/Model/Disputes/DefenseReasonsResponse.cs (100%) rename Adyen/{src => }/Model/Disputes/DeleteDefenseDocumentRequest.cs (100%) rename Adyen/{src => }/Model/Disputes/DeleteDefenseDocumentResponse.cs (100%) rename Adyen/{src => }/Model/Disputes/DisputeServiceResult.cs (100%) rename Adyen/{src => }/Model/Disputes/ServiceError.cs (100%) rename Adyen/{src => }/Model/Disputes/SupplyDefenseDocumentRequest.cs (100%) rename Adyen/{src => }/Model/Disputes/SupplyDefenseDocumentResponse.cs (100%) rename Adyen/{src => }/Model/Environment.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/AULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/AdditionalBankIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Address.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Amount.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Attachment.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BankAccountInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BirthData.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BusinessLine.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BusinessLineInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BusinessLines.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CALocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CalculatePciStatusRequest.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CalculatePciStatusResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CapabilityProblem.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CapabilityProblemEntity.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CapabilitySettings.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/DKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Document.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/DocumentPage.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/DocumentReference.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/EntityReference.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/FinancialReport.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/HKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/HULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/IbanAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/IdentificationData.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Individual.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/LegalEntity.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/LegalEntityAssociation.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/LegalEntityCapability.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/LegalEntityInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/NOLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/NZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Name.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/OnboardingLink.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/OnboardingLinkInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/OnboardingLinkSettings.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/OnboardingTheme.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/OnboardingThemes.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Organization.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/OwnerEntity.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/PLLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/PciDocumentInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/PciSigningRequest.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/PciSigningResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/PhoneNumber.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/RemediatingAction.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/SELocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/SGLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/ServiceError.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/SoleProprietorship.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/SourceOfFunds.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/StockData.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/SupportingEntityCapability.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/TaxInformation.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/TaxReportingClassification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/TransferInstrument.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/TransferInstrumentInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/TransferInstrumentReference.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Trust.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/UKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/USLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/UndefinedBeneficiary.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/UnincorporatedPartnership.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/VerificationDeadline.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/VerificationError.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/VerificationErrorRecursive.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/VerificationErrors.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/WebData.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/WebDataExemption.cs (100%) rename Adyen/{src => }/Model/Management/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Management/AccelInfo.cs (100%) rename Adyen/{src => }/Model/Management/AdditionalCommission.cs (100%) rename Adyen/{src => }/Model/Management/AdditionalSettings.cs (100%) rename Adyen/{src => }/Model/Management/AdditionalSettingsResponse.cs (100%) rename Adyen/{src => }/Model/Management/Address.cs (100%) rename Adyen/{src => }/Model/Management/AffirmInfo.cs (100%) rename Adyen/{src => }/Model/Management/AfterpayTouchInfo.cs (100%) rename Adyen/{src => }/Model/Management/AllowedOrigin.cs (100%) rename Adyen/{src => }/Model/Management/AllowedOriginsResponse.cs (100%) rename Adyen/{src => }/Model/Management/AmexInfo.cs (100%) rename Adyen/{src => }/Model/Management/Amount.cs (100%) rename Adyen/{src => }/Model/Management/AndroidApp.cs (100%) rename Adyen/{src => }/Model/Management/AndroidAppError.cs (100%) rename Adyen/{src => }/Model/Management/AndroidAppsResponse.cs (100%) rename Adyen/{src => }/Model/Management/AndroidCertificate.cs (100%) rename Adyen/{src => }/Model/Management/AndroidCertificatesResponse.cs (100%) rename Adyen/{src => }/Model/Management/ApiCredential.cs (100%) rename Adyen/{src => }/Model/Management/ApiCredentialLinks.cs (100%) rename Adyen/{src => }/Model/Management/ApplePayInfo.cs (100%) rename Adyen/{src => }/Model/Management/BcmcInfo.cs (100%) rename Adyen/{src => }/Model/Management/BillingEntitiesResponse.cs (100%) rename Adyen/{src => }/Model/Management/BillingEntity.cs (100%) rename Adyen/{src => }/Model/Management/CardholderReceipt.cs (100%) rename Adyen/{src => }/Model/Management/CartesBancairesInfo.cs (100%) rename Adyen/{src => }/Model/Management/ClearpayInfo.cs (100%) rename Adyen/{src => }/Model/Management/Commission.cs (100%) rename Adyen/{src => }/Model/Management/Company.cs (100%) rename Adyen/{src => }/Model/Management/CompanyApiCredential.cs (100%) rename Adyen/{src => }/Model/Management/CompanyLinks.cs (100%) rename Adyen/{src => }/Model/Management/CompanyUser.cs (100%) rename Adyen/{src => }/Model/Management/Connectivity.cs (100%) rename Adyen/{src => }/Model/Management/Contact.cs (100%) rename Adyen/{src => }/Model/Management/CreateAllowedOriginRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateApiCredentialResponse.cs (100%) rename Adyen/{src => }/Model/Management/CreateCompanyApiCredentialRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateCompanyApiCredentialResponse.cs (100%) rename Adyen/{src => }/Model/Management/CreateCompanyUserRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateCompanyUserResponse.cs (100%) rename Adyen/{src => }/Model/Management/CreateCompanyWebhookRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateMerchantApiCredentialRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateMerchantRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateMerchantResponse.cs (100%) rename Adyen/{src => }/Model/Management/CreateMerchantUserRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateMerchantWebhookRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateUserResponse.cs (100%) rename Adyen/{src => }/Model/Management/Currency.cs (100%) rename Adyen/{src => }/Model/Management/CustomNotification.cs (100%) rename Adyen/{src => }/Model/Management/DataCenter.cs (100%) rename Adyen/{src => }/Model/Management/DinersInfo.cs (100%) rename Adyen/{src => }/Model/Management/EventUrl.cs (100%) rename Adyen/{src => }/Model/Management/ExternalTerminalAction.cs (100%) rename Adyen/{src => }/Model/Management/File.cs (100%) rename Adyen/{src => }/Model/Management/GenerateApiKeyResponse.cs (100%) rename Adyen/{src => }/Model/Management/GenerateClientKeyResponse.cs (100%) rename Adyen/{src => }/Model/Management/GenerateHmacKeyResponse.cs (100%) rename Adyen/{src => }/Model/Management/GenericPmWithTdiInfo.cs (100%) rename Adyen/{src => }/Model/Management/GiroPayInfo.cs (100%) rename Adyen/{src => }/Model/Management/GooglePayInfo.cs (100%) rename Adyen/{src => }/Model/Management/Gratuity.cs (100%) rename Adyen/{src => }/Model/Management/Hardware.cs (100%) rename Adyen/{src => }/Model/Management/IdName.cs (100%) rename Adyen/{src => }/Model/Management/InstallAndroidAppDetails.cs (100%) rename Adyen/{src => }/Model/Management/InstallAndroidCertificateDetails.cs (100%) rename Adyen/{src => }/Model/Management/InvalidField.cs (100%) rename Adyen/{src => }/Model/Management/JCBInfo.cs (100%) rename Adyen/{src => }/Model/Management/Key.cs (100%) rename Adyen/{src => }/Model/Management/KlarnaInfo.cs (100%) rename Adyen/{src => }/Model/Management/Links.cs (100%) rename Adyen/{src => }/Model/Management/LinksElement.cs (100%) rename Adyen/{src => }/Model/Management/ListCompanyApiCredentialsResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListCompanyResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListCompanyUsersResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListExternalTerminalActionsResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListMerchantApiCredentialsResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListMerchantResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListMerchantUsersResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListStoresResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListTerminalsResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListWebhooksResponse.cs (100%) rename Adyen/{src => }/Model/Management/Localization.cs (100%) rename Adyen/{src => }/Model/Management/Logo.cs (100%) rename Adyen/{src => }/Model/Management/MeApiCredential.cs (100%) rename Adyen/{src => }/Model/Management/MealVoucherFRInfo.cs (100%) rename Adyen/{src => }/Model/Management/Merchant.cs (100%) rename Adyen/{src => }/Model/Management/MerchantLinks.cs (100%) rename Adyen/{src => }/Model/Management/MinorUnitsMonetaryValue.cs (100%) rename Adyen/{src => }/Model/Management/ModelConfiguration.cs (100%) rename Adyen/{src => }/Model/Management/Name.cs (100%) rename Adyen/{src => }/Model/Management/Name2.cs (100%) rename Adyen/{src => }/Model/Management/Nexo.cs (100%) rename Adyen/{src => }/Model/Management/Notification.cs (100%) rename Adyen/{src => }/Model/Management/NotificationUrl.cs (100%) rename Adyen/{src => }/Model/Management/NyceInfo.cs (100%) rename Adyen/{src => }/Model/Management/OfflineProcessing.cs (100%) rename Adyen/{src => }/Model/Management/Opi.cs (100%) rename Adyen/{src => }/Model/Management/OrderItem.cs (100%) rename Adyen/{src => }/Model/Management/PaginationLinks.cs (100%) rename Adyen/{src => }/Model/Management/Passcodes.cs (100%) rename Adyen/{src => }/Model/Management/PayAtTable.cs (100%) rename Adyen/{src => }/Model/Management/PayMeInfo.cs (100%) rename Adyen/{src => }/Model/Management/PayPalInfo.cs (100%) rename Adyen/{src => }/Model/Management/PayToInfo.cs (100%) rename Adyen/{src => }/Model/Management/Payment.cs (100%) rename Adyen/{src => }/Model/Management/PaymentMethod.cs (100%) rename Adyen/{src => }/Model/Management/PaymentMethodResponse.cs (100%) rename Adyen/{src => }/Model/Management/PaymentMethodSetupInfo.cs (100%) rename Adyen/{src => }/Model/Management/PayoutSettings.cs (100%) rename Adyen/{src => }/Model/Management/PayoutSettingsRequest.cs (100%) rename Adyen/{src => }/Model/Management/PayoutSettingsResponse.cs (100%) rename Adyen/{src => }/Model/Management/Profile.cs (100%) rename Adyen/{src => }/Model/Management/PulseInfo.cs (100%) rename Adyen/{src => }/Model/Management/ReceiptOptions.cs (100%) rename Adyen/{src => }/Model/Management/ReceiptPrinting.cs (100%) rename Adyen/{src => }/Model/Management/Referenced.cs (100%) rename Adyen/{src => }/Model/Management/Refunds.cs (100%) rename Adyen/{src => }/Model/Management/ReleaseUpdateDetails.cs (100%) rename Adyen/{src => }/Model/Management/ReprocessAndroidAppResponse.cs (100%) rename Adyen/{src => }/Model/Management/RequestActivationResponse.cs (100%) rename Adyen/{src => }/Model/Management/RestServiceError.cs (100%) rename Adyen/{src => }/Model/Management/ScheduleTerminalActionsRequest.cs (100%) rename Adyen/{src => }/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs (100%) rename Adyen/{src => }/Model/Management/ScheduleTerminalActionsResponse.cs (100%) rename Adyen/{src => }/Model/Management/Settings.cs (100%) rename Adyen/{src => }/Model/Management/ShippingLocation.cs (100%) rename Adyen/{src => }/Model/Management/ShippingLocationsResponse.cs (100%) rename Adyen/{src => }/Model/Management/Signature.cs (100%) rename Adyen/{src => }/Model/Management/SodexoInfo.cs (100%) rename Adyen/{src => }/Model/Management/SofortInfo.cs (100%) rename Adyen/{src => }/Model/Management/SplitConfiguration.cs (100%) rename Adyen/{src => }/Model/Management/SplitConfigurationList.cs (100%) rename Adyen/{src => }/Model/Management/SplitConfigurationLogic.cs (100%) rename Adyen/{src => }/Model/Management/SplitConfigurationRule.cs (100%) rename Adyen/{src => }/Model/Management/Standalone.cs (100%) rename Adyen/{src => }/Model/Management/StarInfo.cs (100%) rename Adyen/{src => }/Model/Management/Store.cs (100%) rename Adyen/{src => }/Model/Management/StoreAndForward.cs (100%) rename Adyen/{src => }/Model/Management/StoreCreationRequest.cs (100%) rename Adyen/{src => }/Model/Management/StoreCreationWithMerchantCodeRequest.cs (100%) rename Adyen/{src => }/Model/Management/StoreLocation.cs (100%) rename Adyen/{src => }/Model/Management/StoreSplitConfiguration.cs (100%) rename Adyen/{src => }/Model/Management/SupportedCardTypes.cs (100%) rename Adyen/{src => }/Model/Management/Surcharge.cs (100%) rename Adyen/{src => }/Model/Management/SwishInfo.cs (100%) rename Adyen/{src => }/Model/Management/TapToPay.cs (100%) rename Adyen/{src => }/Model/Management/Terminal.cs (100%) rename Adyen/{src => }/Model/Management/TerminalActionScheduleDetail.cs (100%) rename Adyen/{src => }/Model/Management/TerminalAssignment.cs (100%) rename Adyen/{src => }/Model/Management/TerminalConnectivity.cs (100%) rename Adyen/{src => }/Model/Management/TerminalConnectivityBluetooth.cs (100%) rename Adyen/{src => }/Model/Management/TerminalConnectivityCellular.cs (100%) rename Adyen/{src => }/Model/Management/TerminalConnectivityEthernet.cs (100%) rename Adyen/{src => }/Model/Management/TerminalConnectivityWifi.cs (100%) rename Adyen/{src => }/Model/Management/TerminalInstructions.cs (100%) rename Adyen/{src => }/Model/Management/TerminalModelsResponse.cs (100%) rename Adyen/{src => }/Model/Management/TerminalOrder.cs (100%) rename Adyen/{src => }/Model/Management/TerminalOrderRequest.cs (100%) rename Adyen/{src => }/Model/Management/TerminalOrdersResponse.cs (100%) rename Adyen/{src => }/Model/Management/TerminalProduct.cs (100%) rename Adyen/{src => }/Model/Management/TerminalProductPrice.cs (100%) rename Adyen/{src => }/Model/Management/TerminalProductsResponse.cs (100%) rename Adyen/{src => }/Model/Management/TerminalReassignmentRequest.cs (100%) rename Adyen/{src => }/Model/Management/TerminalReassignmentTarget.cs (100%) rename Adyen/{src => }/Model/Management/TerminalSettings.cs (100%) rename Adyen/{src => }/Model/Management/TestCompanyWebhookRequest.cs (100%) rename Adyen/{src => }/Model/Management/TestOutput.cs (100%) rename Adyen/{src => }/Model/Management/TestWebhookRequest.cs (100%) rename Adyen/{src => }/Model/Management/TestWebhookResponse.cs (100%) rename Adyen/{src => }/Model/Management/TicketInfo.cs (100%) rename Adyen/{src => }/Model/Management/Timeouts.cs (100%) rename Adyen/{src => }/Model/Management/TransactionDescriptionInfo.cs (100%) rename Adyen/{src => }/Model/Management/TwintInfo.cs (100%) rename Adyen/{src => }/Model/Management/UninstallAndroidAppDetails.cs (100%) rename Adyen/{src => }/Model/Management/UninstallAndroidCertificateDetails.cs (100%) rename Adyen/{src => }/Model/Management/UpdatableAddress.cs (100%) rename Adyen/{src => }/Model/Management/UpdateCompanyApiCredentialRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateCompanyUserRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateCompanyWebhookRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateMerchantApiCredentialRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateMerchantUserRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateMerchantWebhookRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdatePaymentMethodInfo.cs (100%) rename Adyen/{src => }/Model/Management/UpdatePayoutSettingsRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateSplitConfigurationLogicRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateSplitConfigurationRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateSplitConfigurationRuleRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateStoreRequest.cs (100%) rename Adyen/{src => }/Model/Management/UploadAndroidAppResponse.cs (100%) rename Adyen/{src => }/Model/Management/UploadAndroidCertificateResponse.cs (100%) rename Adyen/{src => }/Model/Management/Url.cs (100%) rename Adyen/{src => }/Model/Management/User.cs (100%) rename Adyen/{src => }/Model/Management/VippsInfo.cs (100%) rename Adyen/{src => }/Model/Management/WeChatPayInfo.cs (100%) rename Adyen/{src => }/Model/Management/WeChatPayPosInfo.cs (100%) rename Adyen/{src => }/Model/Management/Webhook.cs (100%) rename Adyen/{src => }/Model/Management/WebhookLinks.cs (100%) rename Adyen/{src => }/Model/Management/WifiProfiles.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/AccountCapabilityData.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/AccountCreateNotificationData.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/AccountNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/AccountUpdateNotificationData.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/CapabilityProblem.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/CapabilityProblemEntity.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/MidServiceNotificationData.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/RemediatingAction.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalBoardingData.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalSettingsData.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/VerificationError.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/VerificationErrorRecursive.cs (100%) rename Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs (100%) rename Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs (100%) rename Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/Resource.cs (100%) rename Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs (100%) rename Adyen/{src => }/Model/Notification/NotificationRequest.cs (100%) rename Adyen/{src => }/Model/Notification/NotificationRequestConst.cs (100%) rename Adyen/{src => }/Model/Notification/NotificationRequestItem.cs (100%) rename Adyen/{src => }/Model/Notification/NotificationRequestItemContainer.cs (100%) rename Adyen/{src => }/Model/Payment/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Payment/AccountInfo.cs (100%) rename Adyen/{src => }/Model/Payment/AcctInfo.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalData3DSecure.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataAirline.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataCarRental.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataCommon.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataLevel23.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataLodging.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataModifications.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataOpenInvoice.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataOpi.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataRatepay.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataRetry.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataRisk.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataRiskStandalone.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataSubMerchant.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataTemporaryServices.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataWallets.cs (100%) rename Adyen/{src => }/Model/Payment/Address.cs (100%) rename Adyen/{src => }/Model/Payment/AdjustAuthorisationRequest.cs (100%) rename Adyen/{src => }/Model/Payment/Amount.cs (100%) rename Adyen/{src => }/Model/Payment/ApplicationInfo.cs (100%) rename Adyen/{src => }/Model/Payment/AuthenticationResultRequest.cs (100%) rename Adyen/{src => }/Model/Payment/AuthenticationResultResponse.cs (100%) rename Adyen/{src => }/Model/Payment/BankAccount.cs (100%) rename Adyen/{src => }/Model/Payment/BrowserInfo.cs (100%) rename Adyen/{src => }/Model/Payment/CancelOrRefundRequest.cs (100%) rename Adyen/{src => }/Model/Payment/CancelRequest.cs (100%) rename Adyen/{src => }/Model/Payment/CaptureRequest.cs (100%) rename Adyen/{src => }/Model/Payment/Card.cs (100%) rename Adyen/{src => }/Model/Payment/CommonField.cs (100%) rename Adyen/{src => }/Model/Payment/DeviceRenderOptions.cs (100%) rename Adyen/{src => }/Model/Payment/DonationRequest.cs (100%) rename Adyen/{src => }/Model/Payment/ExternalPlatform.cs (100%) rename Adyen/{src => }/Model/Payment/ForexQuote.cs (100%) rename Adyen/{src => }/Model/Payment/FraudCheckResult.cs (100%) rename Adyen/{src => }/Model/Payment/FraudCheckResultWrapper.cs (100%) rename Adyen/{src => }/Model/Payment/FraudResult.cs (100%) rename Adyen/{src => }/Model/Payment/FundDestination.cs (100%) rename Adyen/{src => }/Model/Payment/FundSource.cs (100%) rename Adyen/{src => }/Model/Payment/Installments.cs (100%) rename Adyen/{src => }/Model/Payment/Mandate.cs (100%) rename Adyen/{src => }/Model/Payment/MerchantDevice.cs (100%) rename Adyen/{src => }/Model/Payment/MerchantRiskIndicator.cs (100%) rename Adyen/{src => }/Model/Payment/ModificationResult.cs (100%) rename Adyen/{src => }/Model/Payment/Name.cs (100%) rename Adyen/{src => }/Model/Payment/PaymentRequest.cs (100%) rename Adyen/{src => }/Model/Payment/PaymentRequest3d.cs (100%) rename Adyen/{src => }/Model/Payment/PaymentRequest3ds2.cs (100%) rename Adyen/{src => }/Model/Payment/PaymentResult.cs (100%) rename Adyen/{src => }/Model/Payment/Phone.cs (100%) rename Adyen/{src => }/Model/Payment/PlatformChargebackLogic.cs (100%) rename Adyen/{src => }/Model/Payment/Recurring.cs (100%) rename Adyen/{src => }/Model/Payment/RefundRequest.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalData3DSecure.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataBillingAddress.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataCard.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataCommon.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataDomesticError.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataInstallments.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataNetworkTokens.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataOpi.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataSepa.cs (100%) rename Adyen/{src => }/Model/Payment/SDKEphemPubKey.cs (100%) rename Adyen/{src => }/Model/Payment/SecureRemoteCommerceCheckoutData.cs (100%) rename Adyen/{src => }/Model/Payment/ServiceError.cs (100%) rename Adyen/{src => }/Model/Payment/ShopperInteractionDevice.cs (100%) rename Adyen/{src => }/Model/Payment/Split.cs (100%) rename Adyen/{src => }/Model/Payment/SplitAmount.cs (100%) rename Adyen/{src => }/Model/Payment/SubMerchant.cs (100%) rename Adyen/{src => }/Model/Payment/TechnicalCancelRequest.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDS1Result.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDS2RequestData.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDS2Result.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDS2ResultRequest.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDS2ResultResponse.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDSecureData.cs (100%) rename Adyen/{src => }/Model/Payment/VoidPendingRefundRequest.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/BoardingTokenRequest.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/BoardingTokenResponse.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/DefaultErrorResponseEntity.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/InvalidField.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/PaymentsAppDto.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/PaymentsAppResponse.cs (100%) rename Adyen/{src => }/Model/Payout/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Payout/Address.cs (100%) rename Adyen/{src => }/Model/Payout/Amount.cs (100%) rename Adyen/{src => }/Model/Payout/BankAccount.cs (100%) rename Adyen/{src => }/Model/Payout/Card.cs (100%) rename Adyen/{src => }/Model/Payout/FraudCheckResult.cs (100%) rename Adyen/{src => }/Model/Payout/FraudCheckResultWrapper.cs (100%) rename Adyen/{src => }/Model/Payout/FraudResult.cs (100%) rename Adyen/{src => }/Model/Payout/FundSource.cs (100%) rename Adyen/{src => }/Model/Payout/ModifyRequest.cs (100%) rename Adyen/{src => }/Model/Payout/ModifyResponse.cs (100%) rename Adyen/{src => }/Model/Payout/Name.cs (100%) rename Adyen/{src => }/Model/Payout/PayoutRequest.cs (100%) rename Adyen/{src => }/Model/Payout/PayoutResponse.cs (100%) rename Adyen/{src => }/Model/Payout/Recurring.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalData3DSecure.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataBillingAddress.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataCard.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataCommon.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataDomesticError.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataInstallments.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataNetworkTokens.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataOpi.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataSepa.cs (100%) rename Adyen/{src => }/Model/Payout/ServiceError.cs (100%) rename Adyen/{src => }/Model/Payout/StoreDetailAndSubmitRequest.cs (100%) rename Adyen/{src => }/Model/Payout/StoreDetailAndSubmitResponse.cs (100%) rename Adyen/{src => }/Model/Payout/StoreDetailRequest.cs (100%) rename Adyen/{src => }/Model/Payout/StoreDetailResponse.cs (100%) rename Adyen/{src => }/Model/Payout/SubmitRequest.cs (100%) rename Adyen/{src => }/Model/Payout/SubmitResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/Account.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/AccountEvent.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/AccountHolderDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/AccountHolderStatus.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/AccountPayoutState.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/AccountProcessingState.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/Amount.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/BankAccountDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/BusinessDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CloseAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CloseAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CloseAccountRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CloseAccountResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CloseStoresRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CreateAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CreateAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CreateAccountRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CreateAccountResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/DeleteBankAccountRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/DeletePayoutMethodRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/DeleteShareholderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/DeleteSignatoriesRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/DocumentDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ErrorFieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/FieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GenericResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetTaxFormRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetTaxFormResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/IndividualDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCCheckStatusData.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCCheckSummary.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCShareholderCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCSignatoryCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCVerificationResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/LegalArrangementDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/LegalArrangementEntityDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/LegalArrangementRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/MigratedAccounts.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/MigratedShareholders.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/MigratedStores.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/MigrationData.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/PayoutMethod.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/PayoutScheduleResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/PerformVerificationRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/PersonalDocumentData.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ServiceError.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ShareholderContact.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/SignatoryContact.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/StoreDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/SuspendAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/SuspendAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UltimateParentCompany.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UpdateAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UpdateAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UpdateAccountRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UpdateAccountResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UploadDocumentRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ViasAddress.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ViasName.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ViasPersonalData.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ViasPhoneNumber.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AccountDetailBalance.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AccountHolderBalanceRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AccountHolderBalanceResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AccountHolderTransactionListRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AccountHolderTransactionListResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AccountTransactionList.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/Amount.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/BankAccountDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/DebitAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/DebitAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/DetailBalance.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/ErrorFieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/FieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/PayoutAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/PayoutAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/RefundFundsTransferRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/RefundFundsTransferResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/ServiceError.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/SetupBeneficiaryRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/SetupBeneficiaryResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/Split.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/SplitAmount.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/Transaction.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/TransactionListForAccount.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/TransferFundsRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/TransferFundsResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/CollectInformation.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/FieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/ServiceError.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/ShowPages.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/FieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/GenericResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/ServiceError.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountCloseNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountCreateNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountEvent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderStatus.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountPayoutState.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountProcessingState.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountUpdateNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/BankAccountDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/BusinessDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/CloseAccountResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/CreateAccountResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ErrorFieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/FieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/IndividualDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCCheckStatusData.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCCheckSummary.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCVerificationResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/LegalArrangementDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/LocalDate.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/Message.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/NotificationErrorContainer.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/NotificationResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/OperationStatus.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/PaymentFailureNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/PayoutMethod.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/PayoutScheduleResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/PersonalDocumentData.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/RefundResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ReportAvailableNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ShareholderContact.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/SignatoryContact.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/Split.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/SplitAmount.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/StoreDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/Transaction.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/TransferFundsNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/UltimateParentCompany.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/UpdateAccountResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ViasAddress.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ViasName.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ViasPersonalData.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ViasPhoneNumber.cs (100%) rename Adyen/{src => }/Model/PosMobile/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PosMobile/CreateSessionRequest.cs (100%) rename Adyen/{src => }/Model/PosMobile/CreateSessionResponse.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/Address.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/AssignTerminalsRequest.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/AssignTerminalsResponse.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/FindTerminalRequest.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/FindTerminalResponse.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/MerchantAccount.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/ServiceError.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/Store.cs (100%) rename Adyen/{src => }/Model/Recurring/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Recurring/Address.cs (100%) rename Adyen/{src => }/Model/Recurring/Amount.cs (100%) rename Adyen/{src => }/Model/Recurring/BankAccount.cs (100%) rename Adyen/{src => }/Model/Recurring/Card.cs (100%) rename Adyen/{src => }/Model/Recurring/CreatePermitRequest.cs (100%) rename Adyen/{src => }/Model/Recurring/CreatePermitResult.cs (100%) rename Adyen/{src => }/Model/Recurring/DisablePermitRequest.cs (100%) rename Adyen/{src => }/Model/Recurring/DisablePermitResult.cs (100%) rename Adyen/{src => }/Model/Recurring/DisableRequest.cs (100%) rename Adyen/{src => }/Model/Recurring/DisableResult.cs (100%) rename Adyen/{src => }/Model/Recurring/Name.cs (100%) rename Adyen/{src => }/Model/Recurring/NotifyShopperRequest.cs (100%) rename Adyen/{src => }/Model/Recurring/NotifyShopperResult.cs (100%) rename Adyen/{src => }/Model/Recurring/Permit.cs (100%) rename Adyen/{src => }/Model/Recurring/PermitRestriction.cs (100%) rename Adyen/{src => }/Model/Recurring/PermitResult.cs (100%) rename Adyen/{src => }/Model/Recurring/Recurring.cs (100%) rename Adyen/{src => }/Model/Recurring/RecurringDetail.cs (100%) rename Adyen/{src => }/Model/Recurring/RecurringDetailWrapper.cs (100%) rename Adyen/{src => }/Model/Recurring/RecurringDetailsRequest.cs (100%) rename Adyen/{src => }/Model/Recurring/RecurringDetailsResult.cs (100%) rename Adyen/{src => }/Model/Recurring/ScheduleAccountUpdaterRequest.cs (100%) rename Adyen/{src => }/Model/Recurring/ScheduleAccountUpdaterResult.cs (100%) rename Adyen/{src => }/Model/Recurring/ServiceError.cs (100%) rename Adyen/{src => }/Model/Recurring/TokenDetails.cs (100%) rename Adyen/{src => }/Model/ReportWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ReportWebhooks/ReportNotificationData.cs (100%) rename Adyen/{src => }/Model/ReportWebhooks/ReportNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ReportWebhooks/Resource.cs (100%) rename Adyen/{src => }/Model/ReportWebhooks/ResourceReference.cs (100%) rename Adyen/{src => }/Model/RequestOptions.cs (100%) rename Adyen/{src => }/Model/StoredValue/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/StoredValue/Amount.cs (100%) rename Adyen/{src => }/Model/StoredValue/ServiceError.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueBalanceCheckRequest.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueBalanceCheckResponse.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueBalanceMergeRequest.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueBalanceMergeResponse.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueIssueRequest.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueIssueResponse.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueLoadRequest.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueLoadResponse.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueStatusChangeRequest.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueStatusChangeResponse.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueVoidRequest.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueVoidResponse.cs (100%) rename Adyen/{src => }/Model/Terminal/SaleToAcquirerData.cs (100%) rename Adyen/{src => }/Model/Terminal/Split.cs (100%) rename Adyen/{src => }/Model/Terminal/SplitItem.cs (100%) rename Adyen/{src => }/Model/Terminal/SplitItemType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AbortRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AccountType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AdminRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AdminResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AlgorithmIdentifier.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AlgorithmType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AlignmentType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AllowedProduct.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Amount.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AmountsReq.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AmountsResp.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AreaSize.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AuthenticatedData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AuthenticationMethodType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/BalanceInquiryRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/BalanceInquiryResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/BarcodeType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/BatchRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/BatchResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CapturedSignature.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardAcquisitionRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardAcquisitionResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardAcquisitionTransaction.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardReaderAPDURequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardReaderAPDUResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardReaderInitRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardReaderInitResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardReaderPowerOffRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardReaderPowerOffResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardholderPIN.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CashHandlingDevice.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CharacterHeightType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CharacterStyleType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CharacterWidthType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CheckData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CheckTypeCodeType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CoinsOrBills.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ColorType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ContentInformation.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ContentType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CurrencyConversion.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CustomerOrder.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CustomerOrderReqType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DeviceType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DiagnosisRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DiagnosisResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DigestedData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DisplayOutput.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DisplayRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DisplayResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DocumentQualifierType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EnableServiceRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EnableServiceResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EncapsulatedContent.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EncryptedContent.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EntryModeType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EnvelopedData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ErrorConditionType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EventNotification.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EventToNotifyType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ForceTypeModeType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/GenericProfileType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/GeographicCoordinates.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Geolocation.cs (100%) rename Adyen/{src => }/Model/TerminalApi/GetTotalsRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/GetTotalsResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/GlobalStatusType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/HostStatus.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ICCResetData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/IdentificationSupportType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/IdentificationType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InfoQualifyType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Input.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InputCommandType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InputData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InputRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InputResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InputResult.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InputUpdate.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Instalment.cs (100%) rename Adyen/{src => }/Model/TerminalApi/IssuerAndSerialNumber.cs (100%) rename Adyen/{src => }/Model/TerminalApi/KEK.cs (100%) rename Adyen/{src => }/Model/TerminalApi/KEKIdentifier.cs (100%) rename Adyen/{src => }/Model/TerminalApi/KeyTransport.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoginRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoginResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LogoutRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LogoutResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyAccount.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyAccountID.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyAccountReq.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyAccountStatus.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyAcquirerData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyAmount.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyHandlingType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyResult.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyTotals.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyTransaction.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyTransactionType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyUnitType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MenuEntry.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MenuEntryTagType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Message/SaleToPOIRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MessageCategoryType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MessageClassType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MessageHeader.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MessageReference.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MessageType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MobileData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/NamedKeyEncryptedData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/OriginalPOITransaction.cs (100%) rename Adyen/{src => }/Model/TerminalApi/OutputBarcode.cs (100%) rename Adyen/{src => }/Model/TerminalApi/OutputContent.cs (100%) rename Adyen/{src => }/Model/TerminalApi/OutputFormatType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/OutputResult.cs (100%) rename Adyen/{src => }/Model/TerminalApi/OutputText.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PINFormatType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PINRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PINRequestType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PINResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/POIData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/POIProfile.cs (100%) rename Adyen/{src => }/Model/TerminalApi/POISoftware.cs (100%) rename Adyen/{src => }/Model/TerminalApi/POIStatus.cs (100%) rename Adyen/{src => }/Model/TerminalApi/POISystemData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/POITerminalData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Parameter.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentAccountReq.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentAccountStatus.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentAcquirerData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentInstrumentData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentInstrumentType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentReceipt.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentResult.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentToken.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentTotals.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentTransaction.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PerformedTransaction.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PeriodUnitType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PredefinedContent.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PrintOutput.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PrintRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PrintResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PrinterStatusType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Rebates.cs (100%) rename Adyen/{src => }/Model/TerminalApi/RecipientIdentifier.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ReconciliationRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ReconciliationResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ReconciliationType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/RelativeDistinguishedName.cs (100%) rename Adyen/{src => }/Model/TerminalApi/RepeatedMessageResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/RepeatedResponseMessageBody.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Response.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ResponseModeType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ResultType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ReversalReasonType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ReversalRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ReversalResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleItem.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleItemRebate.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleProfile.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleSoftware.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleTerminalData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleToIssuerData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleToPOIMessage.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleToPOIResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SensitiveCardData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SensitiveMobileData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SignaturePoint.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SignedData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Signer.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SignerIdentifier.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SoundActionType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SoundContent.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SoundFormatType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SoundRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SoundResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SponsoredMerchant.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueAccountID.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueAccountStatus.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueAccountType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueResult.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueTransactionType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TerminalEnvironmentType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TokenRequestedType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TotalDetailsType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TotalFilter.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TrackData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TrackFormatType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionActionType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionConditions.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionIdentification.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionStatusRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionStatusResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionToPerform.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionTotals.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransmitRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransmitResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/UTMCoordinates.cs (100%) rename Adyen/{src => }/Model/TerminalApi/UnitOfMeasureType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/VersionType.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/BankCategoryData.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/InternalCategoryData.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/IssuedCard.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/PaymentInstrument.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/PlatformPayment.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/RelayedAuthorisationData.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/Resource.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/ResourceReference.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/ThreeDSecure.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/Transaction.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/TransferNotificationValidationFact.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/TransferView.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/TransferViewCategoryData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/AULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/AdditionalBankIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Address.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Airline.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/AmountAdjustment.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/BRLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/BalanceMutation.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/BankAccountV3.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/BankCategoryData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/CALocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/CZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Card.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/CardIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/ConfirmationTrackingData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/CounterpartyV3.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/DKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/DirectDebitInformation.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/EstimationTrackingData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/ExternalReason.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/HKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/HULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/IbanAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/InternalCategoryData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/InternalReviewTrackingData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/IssuedCard.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/IssuingTransactionData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Leg.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Lodging.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/MerchantData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/MerchantPurchaseData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Modification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/NOLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/NZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/NameLocation.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/PLLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/PartyIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/PaymentInstrument.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/PlatformPayment.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/RelayedAuthorisationData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Resource.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/ResourceReference.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/SELocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/SGLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransactionEventViolation.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransactionRuleReference.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransactionRuleSource.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransactionRulesResult.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferDataCategoryData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferDataTracking.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferEvent.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferEventEventsDataInner.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferEventTrackingData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferNotificationCounterParty.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferNotificationMerchantData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferNotificationRequest.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferNotificationValidationFact.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferReview.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/UKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/USLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/AULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Transfers/AdditionalBankIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/Address.cs (100%) rename Adyen/{src => }/Model/Transfers/Airline.cs (100%) rename Adyen/{src => }/Model/Transfers/Amount.cs (100%) rename Adyen/{src => }/Model/Transfers/AmountAdjustment.cs (100%) rename Adyen/{src => }/Model/Transfers/ApproveTransfersRequest.cs (100%) rename Adyen/{src => }/Model/Transfers/BRLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/BalanceMutation.cs (100%) rename Adyen/{src => }/Model/Transfers/BankAccountV3.cs (100%) rename Adyen/{src => }/Model/Transfers/BankAccountV3AccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/BankCategoryData.cs (100%) rename Adyen/{src => }/Model/Transfers/CALocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/CZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/CancelTransfersRequest.cs (100%) rename Adyen/{src => }/Model/Transfers/CapitalBalance.cs (100%) rename Adyen/{src => }/Model/Transfers/CapitalGrant.cs (100%) rename Adyen/{src => }/Model/Transfers/CapitalGrantInfo.cs (100%) rename Adyen/{src => }/Model/Transfers/CapitalGrants.cs (100%) rename Adyen/{src => }/Model/Transfers/Card.cs (100%) rename Adyen/{src => }/Model/Transfers/CardIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/ConfirmationTrackingData.cs (100%) rename Adyen/{src => }/Model/Transfers/Counterparty.cs (100%) rename Adyen/{src => }/Model/Transfers/CounterpartyInfoV3.cs (100%) rename Adyen/{src => }/Model/Transfers/CounterpartyV3.cs (100%) rename Adyen/{src => }/Model/Transfers/DKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/DirectDebitInformation.cs (100%) rename Adyen/{src => }/Model/Transfers/EstimationTrackingData.cs (100%) rename Adyen/{src => }/Model/Transfers/ExternalReason.cs (100%) rename Adyen/{src => }/Model/Transfers/Fee.cs (100%) rename Adyen/{src => }/Model/Transfers/FindTransfersResponse.cs (100%) rename Adyen/{src => }/Model/Transfers/HKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/HULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/IbanAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/InternalCategoryData.cs (100%) rename Adyen/{src => }/Model/Transfers/InternalReviewTrackingData.cs (100%) rename Adyen/{src => }/Model/Transfers/InvalidField.cs (100%) rename Adyen/{src => }/Model/Transfers/IssuedCard.cs (100%) rename Adyen/{src => }/Model/Transfers/IssuingTransactionData.cs (100%) rename Adyen/{src => }/Model/Transfers/Leg.cs (100%) rename Adyen/{src => }/Model/Transfers/Link.cs (100%) rename Adyen/{src => }/Model/Transfers/Links.cs (100%) rename Adyen/{src => }/Model/Transfers/Lodging.cs (100%) rename Adyen/{src => }/Model/Transfers/MerchantData.cs (100%) rename Adyen/{src => }/Model/Transfers/MerchantPurchaseData.cs (100%) rename Adyen/{src => }/Model/Transfers/Modification.cs (100%) rename Adyen/{src => }/Model/Transfers/NOLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/NZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/NameLocation.cs (100%) rename Adyen/{src => }/Model/Transfers/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/PLLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/PartyIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/PaymentInstrument.cs (100%) rename Adyen/{src => }/Model/Transfers/PlatformPayment.cs (100%) rename Adyen/{src => }/Model/Transfers/RelayedAuthorisationData.cs (100%) rename Adyen/{src => }/Model/Transfers/Repayment.cs (100%) rename Adyen/{src => }/Model/Transfers/RepaymentTerm.cs (100%) rename Adyen/{src => }/Model/Transfers/ResourceReference.cs (100%) rename Adyen/{src => }/Model/Transfers/RestServiceError.cs (100%) rename Adyen/{src => }/Model/Transfers/ReturnTransferRequest.cs (100%) rename Adyen/{src => }/Model/Transfers/ReturnTransferResponse.cs (100%) rename Adyen/{src => }/Model/Transfers/RoutingDetails.cs (100%) rename Adyen/{src => }/Model/Transfers/SELocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/SGLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/ServiceError.cs (100%) rename Adyen/{src => }/Model/Transfers/ThresholdRepayment.cs (100%) rename Adyen/{src => }/Model/Transfers/Transaction.cs (100%) rename Adyen/{src => }/Model/Transfers/TransactionEventViolation.cs (100%) rename Adyen/{src => }/Model/Transfers/TransactionRuleReference.cs (100%) rename Adyen/{src => }/Model/Transfers/TransactionRuleSource.cs (100%) rename Adyen/{src => }/Model/Transfers/TransactionRulesResult.cs (100%) rename Adyen/{src => }/Model/Transfers/TransactionSearchResponse.cs (100%) rename Adyen/{src => }/Model/Transfers/Transfer.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferCategoryData.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferData.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferDataTracking.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferEvent.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferEventEventsDataInner.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferEventTrackingData.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferInfo.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferNotificationCounterParty.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferNotificationMerchantData.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferNotificationValidationFact.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferRequestReview.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferReview.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferServiceRestServiceError.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferView.cs (100%) rename Adyen/{src => }/Model/Transfers/UKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/USLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/UltimatePartyIdentification.cs (100%) rename Adyen/{src => }/Security/AesEncryptor.cs (100%) rename Adyen/{src => }/Security/EncryptionCredentialDetails.cs (100%) rename Adyen/{src => }/Security/EncryptionDerivedKey.cs (100%) rename Adyen/{src => }/Security/EncryptionDerivedKeyGenerator.cs (100%) rename Adyen/{src => }/Security/Exceptions/NexoCryptoException.cs (100%) rename Adyen/{src => }/Security/Extension/ArrayExtension.cs (100%) rename Adyen/{src => }/Security/HmacSha256Wrapper.cs (100%) rename Adyen/{src => }/Security/IvModGenerator.cs (100%) rename Adyen/{src => }/Security/SaleToPoiMessageSecured.cs (100%) rename Adyen/{src => }/Security/SaleToPoiMessageSecuredEncryptor.cs (100%) rename Adyen/{src => }/Security/SecurityTrailer.cs (100%) rename Adyen/{src => }/Security/TerminalCommonNameValidator.cs (100%) rename Adyen/{src => }/Service/AbstractService.cs (100%) rename Adyen/{src => }/Service/ApiException.cs (100%) rename Adyen/{src => }/Service/BalanceControlService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/AccountHoldersService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/BalanceAccountsService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/BankAccountValidationService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/CardOrdersService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/GrantAccountsService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/GrantOffersService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/ManageCardPINService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/ManageSCADevicesService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/NetworkTokensService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/PaymentInstrumentGroupsService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/PaymentInstrumentsService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/PlatformService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/TransactionRulesService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/TransferRoutesService.cs (100%) rename Adyen/{src => }/Service/BinLookupService.cs (100%) rename Adyen/{src => }/Service/Checkout/DonationsService.cs (100%) rename Adyen/{src => }/Service/Checkout/ModificationsService.cs (100%) rename Adyen/{src => }/Service/Checkout/OrdersService.cs (100%) rename Adyen/{src => }/Service/Checkout/PaymentLinksService.cs (100%) rename Adyen/{src => }/Service/Checkout/PaymentsService.cs (100%) rename Adyen/{src => }/Service/Checkout/RecurringService.cs (100%) rename Adyen/{src => }/Service/Checkout/UtilityService.cs (100%) rename Adyen/{src => }/Service/DataProtectionService.cs (100%) rename Adyen/{src => }/Service/DisputesService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/BusinessLinesService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/DocumentsService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/HostedOnboardingService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/LegalEntitiesService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/PCIQuestionnairesService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/TermsOfServiceService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/TransferInstrumentsService.cs (100%) rename Adyen/{src => }/Service/Management/APICredentialsCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/APICredentialsMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/APIKeyCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/APIKeyMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/AccountCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/AccountMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/AccountStoreLevelService.cs (100%) rename Adyen/{src => }/Service/Management/AllowedOriginsCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/AllowedOriginsMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/AndroidFilesCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/ClientKeyCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/ClientKeyMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/MyAPICredentialService.cs (100%) rename Adyen/{src => }/Service/Management/PaymentMethodsMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/PayoutSettingsMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/SplitConfigurationMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalActionsCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalActionsTerminalLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalOrdersCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalOrdersMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalSettingsCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalSettingsMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalSettingsStoreLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalSettingsTerminalLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalsTerminalLevelService.cs (100%) rename Adyen/{src => }/Service/Management/UsersCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/UsersMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/WebhooksCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/WebhooksMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/PaymentService.cs (100%) rename Adyen/{src => }/Service/PaymentsAppService.cs (100%) rename Adyen/{src => }/Service/Payout/InitializationService.cs (100%) rename Adyen/{src => }/Service/Payout/InstantPayoutsService.cs (100%) rename Adyen/{src => }/Service/Payout/ReviewingService.cs (100%) rename Adyen/{src => }/Service/PlatformsAccount/AccountHoldersService.cs (100%) rename Adyen/{src => }/Service/PlatformsAccount/AccountsService.cs (100%) rename Adyen/{src => }/Service/PlatformsAccount/VerificationService.cs (100%) rename Adyen/{src => }/Service/PlatformsFundService.cs (100%) rename Adyen/{src => }/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs (100%) rename Adyen/{src => }/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs (100%) rename Adyen/{src => }/Service/PlatformsNotificationConfigurationService.cs (100%) rename Adyen/{src => }/Service/PosMobileService.cs (100%) rename Adyen/{src => }/Service/PosTerminalManagementService.cs (100%) rename Adyen/{src => }/Service/RecurringService.cs (100%) rename Adyen/{src => }/Service/Resource/Terminal/TerminalApi.cs (100%) rename Adyen/{src => }/Service/Resource/Terminal/TerminalApiAsyncClient.cs (100%) rename Adyen/{src => }/Service/Resource/Terminal/TerminalApiLocal.cs (100%) rename Adyen/{src => }/Service/Resource/Terminal/TerminalApiLocalClient.cs (100%) rename Adyen/{src => }/Service/Resource/Terminal/TerminalApiSyncClient.cs (100%) rename Adyen/{src => }/Service/ServiceResource.cs (100%) rename Adyen/{src => }/Service/StoredValueService.cs (100%) rename Adyen/{src => }/Service/TerminalApiAsyncService.cs (100%) rename Adyen/{src => }/Service/TerminalApiLocalService.cs (100%) rename Adyen/{src => }/Service/TerminalApiSyncService.cs (100%) rename Adyen/{src => }/Service/TerminalCloudApi.cs (100%) rename Adyen/{src => }/Service/TerminalLocalApi.cs (100%) rename Adyen/{src => }/Service/TerminalLocalApiUnencrypted.cs (100%) rename Adyen/{src => }/Service/Transfers/CapitalService.cs (100%) rename Adyen/{src => }/Service/Transfers/TransactionsService.cs (100%) rename Adyen/{src => }/Service/Transfers/TransfersService.cs (100%) rename Adyen/{src => }/Util/ByteArrayConverter.cs (100%) rename Adyen/{src => }/Util/HMACValidator.cs (100%) rename Adyen/{src => }/Util/JsonOperation.cs (100%) rename Adyen/{src => }/Util/TerminalApi/AdditionalResponse.cs (100%) rename Adyen/{src => }/Util/TerminalApi/CardAcquisitionUtil.cs (100%) rename Adyen/{src => }/Util/Util.cs (100%) rename Adyen/{src => }/Webhooks/BalancePlatformWebhookHandler.cs (100%) rename Adyen/{src => }/Webhooks/ClassicPlatformWebhookHandler.cs (100%) rename Adyen/{src => }/Webhooks/ManagementWebhookHandler.cs (100%) rename Adyen/{src => }/Webhooks/WebhookHandler.cs (100%) diff --git a/Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs b/Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs index 99f1b66d0..536688b71 100644 --- a/Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs +++ b/Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs @@ -1,4 +1,3 @@ -using Adyen.Checkout.Client; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; @@ -7,15 +6,14 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; -using Amount = Adyen.Checkout.Models.Amount; -using JsonSerializer = System.Text.Json.JsonSerializer; +using System.Text.Json; namespace Adyen.IntegrationTest.Checkout { [TestClass] public class CheckoutTest { - private readonly IPaymentsService _paymentsService; + private readonly IPaymentsService _paymentsApiService; private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; public CheckoutTest() @@ -32,7 +30,7 @@ public CheckoutTest() }) .Build(); - _paymentsService = host.Services.GetRequiredService(); + _paymentsApiService = host.Services.GetRequiredService(); _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); } @@ -56,9 +54,9 @@ public async Task Given_Payments_When_CardDetails_Provided_Returns_OK() ) ) ); - var result = await _paymentsService.PaymentsAsync(Guid.NewGuid().ToString(), request); + var result = await _paymentsApiService.PaymentsAsync(Guid.NewGuid().ToString(), request); - Assert.IsNotNull(result); + Assert.IsTrue(result.IsOk); } [TestMethod] diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index 1cd2f26cb..10619d977 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -56,9 +56,4 @@ - - - - - diff --git a/Adyen/src/ApiSerialization/Converter/JsonBase64Converter.cs b/Adyen/ApiSerialization/Converter/JsonBase64Converter.cs similarity index 100% rename from Adyen/src/ApiSerialization/Converter/JsonBase64Converter.cs rename to Adyen/ApiSerialization/Converter/JsonBase64Converter.cs diff --git a/Adyen/src/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs b/Adyen/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs similarity index 100% rename from Adyen/src/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs rename to Adyen/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs diff --git a/Adyen/src/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs b/Adyen/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs similarity index 100% rename from Adyen/src/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs rename to Adyen/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs diff --git a/Adyen/src/ApiSerialization/Converter/SaleToPoiMessageConverter.cs b/Adyen/ApiSerialization/Converter/SaleToPoiMessageConverter.cs similarity index 100% rename from Adyen/src/ApiSerialization/Converter/SaleToPoiMessageConverter.cs rename to Adyen/ApiSerialization/Converter/SaleToPoiMessageConverter.cs diff --git a/Adyen/src/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs b/Adyen/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs similarity index 100% rename from Adyen/src/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs rename to Adyen/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs diff --git a/Adyen/src/ApiSerialization/IMessagePayload.cs b/Adyen/ApiSerialization/IMessagePayload.cs similarity index 100% rename from Adyen/src/ApiSerialization/IMessagePayload.cs rename to Adyen/ApiSerialization/IMessagePayload.cs diff --git a/Adyen/src/ApiSerialization/IMessagePayloadSerializer.cs b/Adyen/ApiSerialization/IMessagePayloadSerializer.cs similarity index 100% rename from Adyen/src/ApiSerialization/IMessagePayloadSerializer.cs rename to Adyen/ApiSerialization/IMessagePayloadSerializer.cs diff --git a/Adyen/src/ApiSerialization/MessageHeaderSerializer.cs b/Adyen/ApiSerialization/MessageHeaderSerializer.cs similarity index 100% rename from Adyen/src/ApiSerialization/MessageHeaderSerializer.cs rename to Adyen/ApiSerialization/MessageHeaderSerializer.cs diff --git a/Adyen/src/ApiSerialization/MessagePayloadSerializer.cs b/Adyen/ApiSerialization/MessagePayloadSerializer.cs similarity index 100% rename from Adyen/src/ApiSerialization/MessagePayloadSerializer.cs rename to Adyen/ApiSerialization/MessagePayloadSerializer.cs diff --git a/Adyen/src/ApiSerialization/MessagePayloadSerializerFactory.cs b/Adyen/ApiSerialization/MessagePayloadSerializerFactory.cs similarity index 100% rename from Adyen/src/ApiSerialization/MessagePayloadSerializerFactory.cs rename to Adyen/ApiSerialization/MessagePayloadSerializerFactory.cs diff --git a/Adyen/src/ApiSerialization/OpenAPIDateConverter.cs b/Adyen/ApiSerialization/OpenAPIDateConverter.cs similarity index 100% rename from Adyen/src/ApiSerialization/OpenAPIDateConverter.cs rename to Adyen/ApiSerialization/OpenAPIDateConverter.cs diff --git a/Adyen/src/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs b/Adyen/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs similarity index 100% rename from Adyen/src/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs rename to Adyen/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs diff --git a/Adyen/src/ApiSerialization/SaleToPoiMessageSerializer.cs b/Adyen/ApiSerialization/SaleToPoiMessageSerializer.cs similarity index 100% rename from Adyen/src/ApiSerialization/SaleToPoiMessageSerializer.cs rename to Adyen/ApiSerialization/SaleToPoiMessageSerializer.cs diff --git a/Adyen/src/ApiSerialization/TypeHelper.cs b/Adyen/ApiSerialization/TypeHelper.cs similarity index 100% rename from Adyen/src/ApiSerialization/TypeHelper.cs rename to Adyen/ApiSerialization/TypeHelper.cs diff --git a/Adyen/src/Constants/ApiConstants.cs b/Adyen/Constants/ApiConstants.cs similarity index 100% rename from Adyen/src/Constants/ApiConstants.cs rename to Adyen/Constants/ApiConstants.cs diff --git a/Adyen/src/Constants/ClientConfig.cs b/Adyen/Constants/ClientConfig.cs similarity index 100% rename from Adyen/src/Constants/ClientConfig.cs rename to Adyen/Constants/ClientConfig.cs diff --git a/Adyen/src/Constants/Region.cs b/Adyen/Constants/Region.cs similarity index 100% rename from Adyen/src/Constants/Region.cs rename to Adyen/Constants/Region.cs diff --git a/Adyen/src/Core/Auth/ApiKeyToken.cs b/Adyen/Core/Auth/ApiKeyToken.cs similarity index 100% rename from Adyen/src/Core/Auth/ApiKeyToken.cs rename to Adyen/Core/Auth/ApiKeyToken.cs diff --git a/Adyen/src/Core/Auth/BasicToken.cs b/Adyen/Core/Auth/BasicToken.cs similarity index 100% rename from Adyen/src/Core/Auth/BasicToken.cs rename to Adyen/Core/Auth/BasicToken.cs diff --git a/Adyen/src/Core/Auth/CookieContainer.cs b/Adyen/Core/Auth/CookieContainer.cs similarity index 100% rename from Adyen/src/Core/Auth/CookieContainer.cs rename to Adyen/Core/Auth/CookieContainer.cs diff --git a/Adyen/src/Core/Auth/RateLimitProvider.cs b/Adyen/Core/Auth/RateLimitProvider.cs similarity index 100% rename from Adyen/src/Core/Auth/RateLimitProvider.cs rename to Adyen/Core/Auth/RateLimitProvider.cs diff --git a/Adyen/src/Core/Auth/TokenBase.cs b/Adyen/Core/Auth/TokenBase.cs similarity index 100% rename from Adyen/src/Core/Auth/TokenBase.cs rename to Adyen/Core/Auth/TokenBase.cs diff --git a/Adyen/src/Core/Auth/TokenContainer.cs b/Adyen/Core/Auth/TokenContainer.cs similarity index 100% rename from Adyen/src/Core/Auth/TokenContainer.cs rename to Adyen/Core/Auth/TokenContainer.cs diff --git a/Adyen/src/Core/Auth/TokenProvider.cs b/Adyen/Core/Auth/TokenProvider.cs similarity index 100% rename from Adyen/src/Core/Auth/TokenProvider.cs rename to Adyen/Core/Auth/TokenProvider.cs diff --git a/Adyen/src/Core/Client/ApiException.cs b/Adyen/Core/Client/ApiException.cs similarity index 100% rename from Adyen/src/Core/Client/ApiException.cs rename to Adyen/Core/Client/ApiException.cs diff --git a/Adyen/src/Core/Client/ApiFactory.cs b/Adyen/Core/Client/ApiFactory.cs similarity index 100% rename from Adyen/src/Core/Client/ApiFactory.cs rename to Adyen/Core/Client/ApiFactory.cs diff --git a/Adyen/src/Core/Client/ApiResponse.cs b/Adyen/Core/Client/ApiResponse.cs similarity index 100% rename from Adyen/src/Core/Client/ApiResponse.cs rename to Adyen/Core/Client/ApiResponse.cs diff --git a/Adyen/src/Core/Client/ApiResponseEventArgs.cs b/Adyen/Core/Client/ApiResponseEventArgs.cs similarity index 100% rename from Adyen/src/Core/Client/ApiResponseEventArgs.cs rename to Adyen/Core/Client/ApiResponseEventArgs.cs diff --git a/Adyen/src/Core/Client/ExceptionEventArgs.cs b/Adyen/Core/Client/ExceptionEventArgs.cs similarity index 100% rename from Adyen/src/Core/Client/ExceptionEventArgs.cs rename to Adyen/Core/Client/ExceptionEventArgs.cs diff --git a/Adyen/src/Core/Client/Extensions/HttpClientBuilderExtensions.cs b/Adyen/Core/Client/Extensions/HttpClientBuilderExtensions.cs similarity index 100% rename from Adyen/src/Core/Client/Extensions/HttpClientBuilderExtensions.cs rename to Adyen/Core/Client/Extensions/HttpClientBuilderExtensions.cs diff --git a/Adyen/src/Core/Client/IAdyenApiService.cs b/Adyen/Core/Client/IAdyenApiService.cs similarity index 100% rename from Adyen/src/Core/Client/IAdyenApiService.cs rename to Adyen/Core/Client/IAdyenApiService.cs diff --git a/Adyen/src/Core/Converters/DateOnlyJsonConverter.cs b/Adyen/Core/Converters/DateOnlyJsonConverter.cs similarity index 100% rename from Adyen/src/Core/Converters/DateOnlyJsonConverter.cs rename to Adyen/Core/Converters/DateOnlyJsonConverter.cs diff --git a/Adyen/src/Core/Converters/DateOnlyNullableJsonConverter.cs b/Adyen/Core/Converters/DateOnlyNullableJsonConverter.cs similarity index 100% rename from Adyen/src/Core/Converters/DateOnlyNullableJsonConverter.cs rename to Adyen/Core/Converters/DateOnlyNullableJsonConverter.cs diff --git a/Adyen/src/Core/Converters/DateTimeJsonConverter.cs b/Adyen/Core/Converters/DateTimeJsonConverter.cs similarity index 100% rename from Adyen/src/Core/Converters/DateTimeJsonConverter.cs rename to Adyen/Core/Converters/DateTimeJsonConverter.cs diff --git a/Adyen/src/Core/Converters/DateTimeNullableJsonConverter.cs b/Adyen/Core/Converters/DateTimeNullableJsonConverter.cs similarity index 100% rename from Adyen/src/Core/Converters/DateTimeNullableJsonConverter.cs rename to Adyen/Core/Converters/DateTimeNullableJsonConverter.cs diff --git a/Adyen/src/Core/JsonSerializerOptionsProvider.cs b/Adyen/Core/JsonSerializerOptionsProvider.cs similarity index 100% rename from Adyen/src/Core/JsonSerializerOptionsProvider.cs rename to Adyen/Core/JsonSerializerOptionsProvider.cs diff --git a/Adyen/src/Core/Option.cs b/Adyen/Core/Option.cs similarity index 100% rename from Adyen/src/Core/Option.cs rename to Adyen/Core/Option.cs diff --git a/Adyen/src/Exceptions/DeserializationException.cs b/Adyen/Exceptions/DeserializationException.cs similarity index 100% rename from Adyen/src/Exceptions/DeserializationException.cs rename to Adyen/Exceptions/DeserializationException.cs diff --git a/Adyen/src/Exceptions/ExceptionMessages.cs b/Adyen/Exceptions/ExceptionMessages.cs similarity index 100% rename from Adyen/src/Exceptions/ExceptionMessages.cs rename to Adyen/Exceptions/ExceptionMessages.cs diff --git a/Adyen/src/HttpClient/HttpClientException.cs b/Adyen/HttpClient/HttpClientException.cs similarity index 100% rename from Adyen/src/HttpClient/HttpClientException.cs rename to Adyen/HttpClient/HttpClientException.cs diff --git a/Adyen/src/HttpClient/HttpClientExtension.cs b/Adyen/HttpClient/HttpClientExtension.cs similarity index 100% rename from Adyen/src/HttpClient/HttpClientExtension.cs rename to Adyen/HttpClient/HttpClientExtension.cs diff --git a/Adyen/src/HttpClient/HttpClientWrapper.cs b/Adyen/HttpClient/HttpClientWrapper.cs similarity index 100% rename from Adyen/src/HttpClient/HttpClientWrapper.cs rename to Adyen/HttpClient/HttpClientWrapper.cs diff --git a/Adyen/src/HttpClient/Interfaces/IClient.cs b/Adyen/HttpClient/Interfaces/IClient.cs similarity index 100% rename from Adyen/src/HttpClient/Interfaces/IClient.cs rename to Adyen/HttpClient/Interfaces/IClient.cs diff --git a/Adyen/src/Model/AcsWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/AcsWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/AcsWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/AcsWebhooks/Amount.cs b/Adyen/Model/AcsWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/Amount.cs rename to Adyen/Model/AcsWebhooks/Amount.cs diff --git a/Adyen/src/Model/AcsWebhooks/AuthenticationDecision.cs b/Adyen/Model/AcsWebhooks/AuthenticationDecision.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/AuthenticationDecision.cs rename to Adyen/Model/AcsWebhooks/AuthenticationDecision.cs diff --git a/Adyen/src/Model/AcsWebhooks/AuthenticationInfo.cs b/Adyen/Model/AcsWebhooks/AuthenticationInfo.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/AuthenticationInfo.cs rename to Adyen/Model/AcsWebhooks/AuthenticationInfo.cs diff --git a/Adyen/src/Model/AcsWebhooks/AuthenticationNotificationData.cs b/Adyen/Model/AcsWebhooks/AuthenticationNotificationData.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/AuthenticationNotificationData.cs rename to Adyen/Model/AcsWebhooks/AuthenticationNotificationData.cs diff --git a/Adyen/src/Model/AcsWebhooks/AuthenticationNotificationRequest.cs b/Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/AuthenticationNotificationRequest.cs rename to Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.cs diff --git a/Adyen/src/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/src/Model/AcsWebhooks/ChallengeInfo.cs b/Adyen/Model/AcsWebhooks/ChallengeInfo.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/ChallengeInfo.cs rename to Adyen/Model/AcsWebhooks/ChallengeInfo.cs diff --git a/Adyen/src/Model/AcsWebhooks/Purchase.cs b/Adyen/Model/AcsWebhooks/Purchase.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/Purchase.cs rename to Adyen/Model/AcsWebhooks/Purchase.cs diff --git a/Adyen/src/Model/AcsWebhooks/PurchaseInfo.cs b/Adyen/Model/AcsWebhooks/PurchaseInfo.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/PurchaseInfo.cs rename to Adyen/Model/AcsWebhooks/PurchaseInfo.cs diff --git a/Adyen/src/Model/AcsWebhooks/RelayedAuthenticationRequest.cs b/Adyen/Model/AcsWebhooks/RelayedAuthenticationRequest.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/RelayedAuthenticationRequest.cs rename to Adyen/Model/AcsWebhooks/RelayedAuthenticationRequest.cs diff --git a/Adyen/src/Model/AcsWebhooks/RelayedAuthenticationResponse.cs b/Adyen/Model/AcsWebhooks/RelayedAuthenticationResponse.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/RelayedAuthenticationResponse.cs rename to Adyen/Model/AcsWebhooks/RelayedAuthenticationResponse.cs diff --git a/Adyen/src/Model/AcsWebhooks/Resource.cs b/Adyen/Model/AcsWebhooks/Resource.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/Resource.cs rename to Adyen/Model/AcsWebhooks/Resource.cs diff --git a/Adyen/src/Model/AcsWebhooks/ServiceError.cs b/Adyen/Model/AcsWebhooks/ServiceError.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/ServiceError.cs rename to Adyen/Model/AcsWebhooks/ServiceError.cs diff --git a/Adyen/src/Model/ApiError.cs b/Adyen/Model/ApiError.cs similarity index 100% rename from Adyen/src/Model/ApiError.cs rename to Adyen/Model/ApiError.cs diff --git a/Adyen/src/Model/ApplicationInformation/ApplicationInfo.cs b/Adyen/Model/ApplicationInformation/ApplicationInfo.cs similarity index 100% rename from Adyen/src/Model/ApplicationInformation/ApplicationInfo.cs rename to Adyen/Model/ApplicationInformation/ApplicationInfo.cs diff --git a/Adyen/src/Model/ApplicationInformation/CommonField.cs b/Adyen/Model/ApplicationInformation/CommonField.cs similarity index 100% rename from Adyen/src/Model/ApplicationInformation/CommonField.cs rename to Adyen/Model/ApplicationInformation/CommonField.cs diff --git a/Adyen/src/Model/ApplicationInformation/ExternalPlatform.cs b/Adyen/Model/ApplicationInformation/ExternalPlatform.cs similarity index 100% rename from Adyen/src/Model/ApplicationInformation/ExternalPlatform.cs rename to Adyen/Model/ApplicationInformation/ExternalPlatform.cs diff --git a/Adyen/src/Model/ApplicationInformation/MerchantDevice.cs b/Adyen/Model/ApplicationInformation/MerchantDevice.cs similarity index 100% rename from Adyen/src/Model/ApplicationInformation/MerchantDevice.cs rename to Adyen/Model/ApplicationInformation/MerchantDevice.cs diff --git a/Adyen/src/Model/ApplicationInformation/ShopperInteractionDevice.cs b/Adyen/Model/ApplicationInformation/ShopperInteractionDevice.cs similarity index 100% rename from Adyen/src/Model/ApplicationInformation/ShopperInteractionDevice.cs rename to Adyen/Model/ApplicationInformation/ShopperInteractionDevice.cs diff --git a/Adyen/src/Model/BalanceControl/AbstractOpenAPISchema.cs b/Adyen/Model/BalanceControl/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/BalanceControl/AbstractOpenAPISchema.cs rename to Adyen/Model/BalanceControl/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/BalanceControl/Amount.cs b/Adyen/Model/BalanceControl/Amount.cs similarity index 100% rename from Adyen/src/Model/BalanceControl/Amount.cs rename to Adyen/Model/BalanceControl/Amount.cs diff --git a/Adyen/src/Model/BalanceControl/BalanceTransferRequest.cs b/Adyen/Model/BalanceControl/BalanceTransferRequest.cs similarity index 100% rename from Adyen/src/Model/BalanceControl/BalanceTransferRequest.cs rename to Adyen/Model/BalanceControl/BalanceTransferRequest.cs diff --git a/Adyen/src/Model/BalanceControl/BalanceTransferResponse.cs b/Adyen/Model/BalanceControl/BalanceTransferResponse.cs similarity index 100% rename from Adyen/src/Model/BalanceControl/BalanceTransferResponse.cs rename to Adyen/Model/BalanceControl/BalanceTransferResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/AULocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AULocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/AULocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/AbstractOpenAPISchema.cs b/Adyen/Model/BalancePlatform/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AbstractOpenAPISchema.cs rename to Adyen/Model/BalancePlatform/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/BalancePlatform/AccountHolder.cs b/Adyen/Model/BalancePlatform/AccountHolder.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AccountHolder.cs rename to Adyen/Model/BalancePlatform/AccountHolder.cs diff --git a/Adyen/src/Model/BalancePlatform/AccountHolderCapability.cs b/Adyen/Model/BalancePlatform/AccountHolderCapability.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AccountHolderCapability.cs rename to Adyen/Model/BalancePlatform/AccountHolderCapability.cs diff --git a/Adyen/src/Model/BalancePlatform/AccountHolderInfo.cs b/Adyen/Model/BalancePlatform/AccountHolderInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AccountHolderInfo.cs rename to Adyen/Model/BalancePlatform/AccountHolderInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/AccountHolderUpdateRequest.cs b/Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AccountHolderUpdateRequest.cs rename to Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/AccountSupportingEntityCapability.cs b/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AccountSupportingEntityCapability.cs rename to Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.cs diff --git a/Adyen/src/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs b/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs rename to Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/AdditionalBankIdentification.cs b/Adyen/Model/BalancePlatform/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AdditionalBankIdentification.cs rename to Adyen/Model/BalancePlatform/AdditionalBankIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/Address.cs b/Adyen/Model/BalancePlatform/Address.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Address.cs rename to Adyen/Model/BalancePlatform/Address.cs diff --git a/Adyen/src/Model/BalancePlatform/AddressRequirement.cs b/Adyen/Model/BalancePlatform/AddressRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AddressRequirement.cs rename to Adyen/Model/BalancePlatform/AddressRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/Amount.cs b/Adyen/Model/BalancePlatform/Amount.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Amount.cs rename to Adyen/Model/BalancePlatform/Amount.cs diff --git a/Adyen/src/Model/BalancePlatform/AmountMinMaxRequirement.cs b/Adyen/Model/BalancePlatform/AmountMinMaxRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AmountMinMaxRequirement.cs rename to Adyen/Model/BalancePlatform/AmountMinMaxRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs b/Adyen/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs rename to Adyen/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs b/Adyen/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs rename to Adyen/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs diff --git a/Adyen/src/Model/BalancePlatform/AssociationFinaliseRequest.cs b/Adyen/Model/BalancePlatform/AssociationFinaliseRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AssociationFinaliseRequest.cs rename to Adyen/Model/BalancePlatform/AssociationFinaliseRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/AssociationFinaliseResponse.cs b/Adyen/Model/BalancePlatform/AssociationFinaliseResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AssociationFinaliseResponse.cs rename to Adyen/Model/BalancePlatform/AssociationFinaliseResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/AssociationInitiateRequest.cs b/Adyen/Model/BalancePlatform/AssociationInitiateRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AssociationInitiateRequest.cs rename to Adyen/Model/BalancePlatform/AssociationInitiateRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/AssociationInitiateResponse.cs b/Adyen/Model/BalancePlatform/AssociationInitiateResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AssociationInitiateResponse.cs rename to Adyen/Model/BalancePlatform/AssociationInitiateResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/Authentication.cs b/Adyen/Model/BalancePlatform/Authentication.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Authentication.cs rename to Adyen/Model/BalancePlatform/Authentication.cs diff --git a/Adyen/src/Model/BalancePlatform/BRLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/BRLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BRLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/BRLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/Balance.cs b/Adyen/Model/BalancePlatform/Balance.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Balance.cs rename to Adyen/Model/BalancePlatform/Balance.cs diff --git a/Adyen/src/Model/BalancePlatform/BalanceAccount.cs b/Adyen/Model/BalancePlatform/BalanceAccount.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BalanceAccount.cs rename to Adyen/Model/BalancePlatform/BalanceAccount.cs diff --git a/Adyen/src/Model/BalancePlatform/BalanceAccountBase.cs b/Adyen/Model/BalancePlatform/BalanceAccountBase.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BalanceAccountBase.cs rename to Adyen/Model/BalancePlatform/BalanceAccountBase.cs diff --git a/Adyen/src/Model/BalancePlatform/BalanceAccountInfo.cs b/Adyen/Model/BalancePlatform/BalanceAccountInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BalanceAccountInfo.cs rename to Adyen/Model/BalancePlatform/BalanceAccountInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/BalanceAccountUpdateRequest.cs b/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BalanceAccountUpdateRequest.cs rename to Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/BalancePlatform.cs b/Adyen/Model/BalancePlatform/BalancePlatform.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BalancePlatform.cs rename to Adyen/Model/BalancePlatform/BalancePlatform.cs diff --git a/Adyen/src/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs b/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs rename to Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccount.cs b/Adyen/Model/BalancePlatform/BankAccount.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccount.cs rename to Adyen/Model/BalancePlatform/BankAccount.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccountAccountIdentification.cs b/Adyen/Model/BalancePlatform/BankAccountAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccountAccountIdentification.cs rename to Adyen/Model/BalancePlatform/BankAccountAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccountDetails.cs b/Adyen/Model/BalancePlatform/BankAccountDetails.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccountDetails.cs rename to Adyen/Model/BalancePlatform/BankAccountDetails.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs b/Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs rename to Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs b/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs rename to Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs b/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs rename to Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccountModel.cs b/Adyen/Model/BalancePlatform/BankAccountModel.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccountModel.cs rename to Adyen/Model/BalancePlatform/BankAccountModel.cs diff --git a/Adyen/src/Model/BalancePlatform/BankIdentification.cs b/Adyen/Model/BalancePlatform/BankIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankIdentification.cs rename to Adyen/Model/BalancePlatform/BankIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/BrandVariantsRestriction.cs b/Adyen/Model/BalancePlatform/BrandVariantsRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BrandVariantsRestriction.cs rename to Adyen/Model/BalancePlatform/BrandVariantsRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/BulkAddress.cs b/Adyen/Model/BalancePlatform/BulkAddress.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BulkAddress.cs rename to Adyen/Model/BalancePlatform/BulkAddress.cs diff --git a/Adyen/src/Model/BalancePlatform/CALocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CALocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/CALocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/CZLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CZLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/CZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/CapabilityProblem.cs b/Adyen/Model/BalancePlatform/CapabilityProblem.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CapabilityProblem.cs rename to Adyen/Model/BalancePlatform/CapabilityProblem.cs diff --git a/Adyen/src/Model/BalancePlatform/CapabilityProblemEntity.cs b/Adyen/Model/BalancePlatform/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CapabilityProblemEntity.cs rename to Adyen/Model/BalancePlatform/CapabilityProblemEntity.cs diff --git a/Adyen/src/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs b/Adyen/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs rename to Adyen/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/src/Model/BalancePlatform/CapabilitySettings.cs b/Adyen/Model/BalancePlatform/CapabilitySettings.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CapabilitySettings.cs rename to Adyen/Model/BalancePlatform/CapabilitySettings.cs diff --git a/Adyen/src/Model/BalancePlatform/CapitalBalance.cs b/Adyen/Model/BalancePlatform/CapitalBalance.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CapitalBalance.cs rename to Adyen/Model/BalancePlatform/CapitalBalance.cs diff --git a/Adyen/src/Model/BalancePlatform/CapitalGrantAccount.cs b/Adyen/Model/BalancePlatform/CapitalGrantAccount.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CapitalGrantAccount.cs rename to Adyen/Model/BalancePlatform/CapitalGrantAccount.cs diff --git a/Adyen/src/Model/BalancePlatform/Card.cs b/Adyen/Model/BalancePlatform/Card.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Card.cs rename to Adyen/Model/BalancePlatform/Card.cs diff --git a/Adyen/src/Model/BalancePlatform/CardConfiguration.cs b/Adyen/Model/BalancePlatform/CardConfiguration.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CardConfiguration.cs rename to Adyen/Model/BalancePlatform/CardConfiguration.cs diff --git a/Adyen/src/Model/BalancePlatform/CardInfo.cs b/Adyen/Model/BalancePlatform/CardInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CardInfo.cs rename to Adyen/Model/BalancePlatform/CardInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/CardOrder.cs b/Adyen/Model/BalancePlatform/CardOrder.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CardOrder.cs rename to Adyen/Model/BalancePlatform/CardOrder.cs diff --git a/Adyen/src/Model/BalancePlatform/CardOrderItem.cs b/Adyen/Model/BalancePlatform/CardOrderItem.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CardOrderItem.cs rename to Adyen/Model/BalancePlatform/CardOrderItem.cs diff --git a/Adyen/src/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs b/Adyen/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs rename to Adyen/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs diff --git a/Adyen/src/Model/BalancePlatform/ContactDetails.cs b/Adyen/Model/BalancePlatform/ContactDetails.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/ContactDetails.cs rename to Adyen/Model/BalancePlatform/ContactDetails.cs diff --git a/Adyen/src/Model/BalancePlatform/Counterparty.cs b/Adyen/Model/BalancePlatform/Counterparty.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Counterparty.cs rename to Adyen/Model/BalancePlatform/Counterparty.cs diff --git a/Adyen/src/Model/BalancePlatform/CounterpartyBankRestriction.cs b/Adyen/Model/BalancePlatform/CounterpartyBankRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CounterpartyBankRestriction.cs rename to Adyen/Model/BalancePlatform/CounterpartyBankRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/CounterpartyTypesRestriction.cs b/Adyen/Model/BalancePlatform/CounterpartyTypesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CounterpartyTypesRestriction.cs rename to Adyen/Model/BalancePlatform/CounterpartyTypesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/CountriesRestriction.cs b/Adyen/Model/BalancePlatform/CountriesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CountriesRestriction.cs rename to Adyen/Model/BalancePlatform/CountriesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/CreateSweepConfigurationV2.cs b/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CreateSweepConfigurationV2.cs rename to Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.cs diff --git a/Adyen/src/Model/BalancePlatform/DKLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DKLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/DKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/DayOfWeekRestriction.cs b/Adyen/Model/BalancePlatform/DayOfWeekRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DayOfWeekRestriction.cs rename to Adyen/Model/BalancePlatform/DayOfWeekRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/DelegatedAuthenticationData.cs b/Adyen/Model/BalancePlatform/DelegatedAuthenticationData.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DelegatedAuthenticationData.cs rename to Adyen/Model/BalancePlatform/DelegatedAuthenticationData.cs diff --git a/Adyen/src/Model/BalancePlatform/DeliveryAddress.cs b/Adyen/Model/BalancePlatform/DeliveryAddress.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DeliveryAddress.cs rename to Adyen/Model/BalancePlatform/DeliveryAddress.cs diff --git a/Adyen/src/Model/BalancePlatform/DeliveryContact.cs b/Adyen/Model/BalancePlatform/DeliveryContact.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DeliveryContact.cs rename to Adyen/Model/BalancePlatform/DeliveryContact.cs diff --git a/Adyen/src/Model/BalancePlatform/Device.cs b/Adyen/Model/BalancePlatform/Device.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Device.cs rename to Adyen/Model/BalancePlatform/Device.cs diff --git a/Adyen/src/Model/BalancePlatform/DeviceInfo.cs b/Adyen/Model/BalancePlatform/DeviceInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DeviceInfo.cs rename to Adyen/Model/BalancePlatform/DeviceInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/DifferentCurrenciesRestriction.cs b/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DifferentCurrenciesRestriction.cs rename to Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/Duration.cs b/Adyen/Model/BalancePlatform/Duration.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Duration.cs rename to Adyen/Model/BalancePlatform/Duration.cs diff --git a/Adyen/src/Model/BalancePlatform/EntryModesRestriction.cs b/Adyen/Model/BalancePlatform/EntryModesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/EntryModesRestriction.cs rename to Adyen/Model/BalancePlatform/EntryModesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/Expiry.cs b/Adyen/Model/BalancePlatform/Expiry.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Expiry.cs rename to Adyen/Model/BalancePlatform/Expiry.cs diff --git a/Adyen/src/Model/BalancePlatform/Fee.cs b/Adyen/Model/BalancePlatform/Fee.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Fee.cs rename to Adyen/Model/BalancePlatform/Fee.cs diff --git a/Adyen/src/Model/BalancePlatform/GetNetworkTokenResponse.cs b/Adyen/Model/BalancePlatform/GetNetworkTokenResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/GetNetworkTokenResponse.cs rename to Adyen/Model/BalancePlatform/GetNetworkTokenResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/GetTaxFormResponse.cs b/Adyen/Model/BalancePlatform/GetTaxFormResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/GetTaxFormResponse.cs rename to Adyen/Model/BalancePlatform/GetTaxFormResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/GrantLimit.cs b/Adyen/Model/BalancePlatform/GrantLimit.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/GrantLimit.cs rename to Adyen/Model/BalancePlatform/GrantLimit.cs diff --git a/Adyen/src/Model/BalancePlatform/GrantOffer.cs b/Adyen/Model/BalancePlatform/GrantOffer.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/GrantOffer.cs rename to Adyen/Model/BalancePlatform/GrantOffer.cs diff --git a/Adyen/src/Model/BalancePlatform/GrantOffers.cs b/Adyen/Model/BalancePlatform/GrantOffers.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/GrantOffers.cs rename to Adyen/Model/BalancePlatform/GrantOffers.cs diff --git a/Adyen/src/Model/BalancePlatform/HKLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/HKLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/HKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/HULocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/HULocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/HULocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/Href.cs b/Adyen/Model/BalancePlatform/Href.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Href.cs rename to Adyen/Model/BalancePlatform/Href.cs diff --git a/Adyen/src/Model/BalancePlatform/IbanAccountIdentification.cs b/Adyen/Model/BalancePlatform/IbanAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/IbanAccountIdentification.cs rename to Adyen/Model/BalancePlatform/IbanAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs b/Adyen/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs rename to Adyen/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/InternationalTransactionRestriction.cs b/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/InternationalTransactionRestriction.cs rename to Adyen/Model/BalancePlatform/InternationalTransactionRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/InvalidField.cs b/Adyen/Model/BalancePlatform/InvalidField.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/InvalidField.cs rename to Adyen/Model/BalancePlatform/InvalidField.cs diff --git a/Adyen/src/Model/BalancePlatform/Link.cs b/Adyen/Model/BalancePlatform/Link.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Link.cs rename to Adyen/Model/BalancePlatform/Link.cs diff --git a/Adyen/src/Model/BalancePlatform/ListNetworkTokensResponse.cs b/Adyen/Model/BalancePlatform/ListNetworkTokensResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/ListNetworkTokensResponse.cs rename to Adyen/Model/BalancePlatform/ListNetworkTokensResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/MatchingTransactionsRestriction.cs b/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/MatchingTransactionsRestriction.cs rename to Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/MatchingValuesRestriction.cs b/Adyen/Model/BalancePlatform/MatchingValuesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/MatchingValuesRestriction.cs rename to Adyen/Model/BalancePlatform/MatchingValuesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/MccsRestriction.cs b/Adyen/Model/BalancePlatform/MccsRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/MccsRestriction.cs rename to Adyen/Model/BalancePlatform/MccsRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/MerchantAcquirerPair.cs b/Adyen/Model/BalancePlatform/MerchantAcquirerPair.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/MerchantAcquirerPair.cs rename to Adyen/Model/BalancePlatform/MerchantAcquirerPair.cs diff --git a/Adyen/src/Model/BalancePlatform/MerchantNamesRestriction.cs b/Adyen/Model/BalancePlatform/MerchantNamesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/MerchantNamesRestriction.cs rename to Adyen/Model/BalancePlatform/MerchantNamesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/MerchantsRestriction.cs b/Adyen/Model/BalancePlatform/MerchantsRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/MerchantsRestriction.cs rename to Adyen/Model/BalancePlatform/MerchantsRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/NOLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/NOLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/NOLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/NZLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/NZLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/NZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/Name.cs b/Adyen/Model/BalancePlatform/Name.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Name.cs rename to Adyen/Model/BalancePlatform/Name.cs diff --git a/Adyen/src/Model/BalancePlatform/NetworkToken.cs b/Adyen/Model/BalancePlatform/NetworkToken.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/NetworkToken.cs rename to Adyen/Model/BalancePlatform/NetworkToken.cs diff --git a/Adyen/src/Model/BalancePlatform/NumberAndBicAccountIdentification.cs b/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/NumberAndBicAccountIdentification.cs rename to Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/PLLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PLLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/PLLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs b/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs rename to Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs b/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs rename to Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs b/Adyen/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs rename to Adyen/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs b/Adyen/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs rename to Adyen/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs b/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs rename to Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrument.cs b/Adyen/Model/BalancePlatform/PaymentInstrument.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrument.cs rename to Adyen/Model/BalancePlatform/PaymentInstrument.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentGroup.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentGroup.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentGroup.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentInfo.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentInfo.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentRequirement.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentRequirement.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/Phone.cs b/Adyen/Model/BalancePlatform/Phone.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Phone.cs rename to Adyen/Model/BalancePlatform/Phone.cs diff --git a/Adyen/src/Model/BalancePlatform/PhoneNumber.cs b/Adyen/Model/BalancePlatform/PhoneNumber.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PhoneNumber.cs rename to Adyen/Model/BalancePlatform/PhoneNumber.cs diff --git a/Adyen/src/Model/BalancePlatform/PinChangeRequest.cs b/Adyen/Model/BalancePlatform/PinChangeRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PinChangeRequest.cs rename to Adyen/Model/BalancePlatform/PinChangeRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/PinChangeResponse.cs b/Adyen/Model/BalancePlatform/PinChangeResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PinChangeResponse.cs rename to Adyen/Model/BalancePlatform/PinChangeResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PlatformPaymentConfiguration.cs b/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PlatformPaymentConfiguration.cs rename to Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.cs diff --git a/Adyen/src/Model/BalancePlatform/ProcessingTypesRestriction.cs b/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/ProcessingTypesRestriction.cs rename to Adyen/Model/BalancePlatform/ProcessingTypesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/PublicKeyResponse.cs b/Adyen/Model/BalancePlatform/PublicKeyResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PublicKeyResponse.cs rename to Adyen/Model/BalancePlatform/PublicKeyResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/RegisterSCAFinalResponse.cs b/Adyen/Model/BalancePlatform/RegisterSCAFinalResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RegisterSCAFinalResponse.cs rename to Adyen/Model/BalancePlatform/RegisterSCAFinalResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/RegisterSCARequest.cs b/Adyen/Model/BalancePlatform/RegisterSCARequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RegisterSCARequest.cs rename to Adyen/Model/BalancePlatform/RegisterSCARequest.cs diff --git a/Adyen/src/Model/BalancePlatform/RegisterSCAResponse.cs b/Adyen/Model/BalancePlatform/RegisterSCAResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RegisterSCAResponse.cs rename to Adyen/Model/BalancePlatform/RegisterSCAResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/RemediatingAction.cs b/Adyen/Model/BalancePlatform/RemediatingAction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RemediatingAction.cs rename to Adyen/Model/BalancePlatform/RemediatingAction.cs diff --git a/Adyen/src/Model/BalancePlatform/Repayment.cs b/Adyen/Model/BalancePlatform/Repayment.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Repayment.cs rename to Adyen/Model/BalancePlatform/Repayment.cs diff --git a/Adyen/src/Model/BalancePlatform/RepaymentTerm.cs b/Adyen/Model/BalancePlatform/RepaymentTerm.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RepaymentTerm.cs rename to Adyen/Model/BalancePlatform/RepaymentTerm.cs diff --git a/Adyen/src/Model/BalancePlatform/RestServiceError.cs b/Adyen/Model/BalancePlatform/RestServiceError.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RestServiceError.cs rename to Adyen/Model/BalancePlatform/RestServiceError.cs diff --git a/Adyen/src/Model/BalancePlatform/RevealPinRequest.cs b/Adyen/Model/BalancePlatform/RevealPinRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RevealPinRequest.cs rename to Adyen/Model/BalancePlatform/RevealPinRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/RevealPinResponse.cs b/Adyen/Model/BalancePlatform/RevealPinResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RevealPinResponse.cs rename to Adyen/Model/BalancePlatform/RevealPinResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/RiskScores.cs b/Adyen/Model/BalancePlatform/RiskScores.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RiskScores.cs rename to Adyen/Model/BalancePlatform/RiskScores.cs diff --git a/Adyen/src/Model/BalancePlatform/RiskScoresRestriction.cs b/Adyen/Model/BalancePlatform/RiskScoresRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RiskScoresRestriction.cs rename to Adyen/Model/BalancePlatform/RiskScoresRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/SELocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SELocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/SELocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/SGLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SGLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/SGLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/SameAmountRestriction.cs b/Adyen/Model/BalancePlatform/SameAmountRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SameAmountRestriction.cs rename to Adyen/Model/BalancePlatform/SameAmountRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/SameCounterpartyRestriction.cs b/Adyen/Model/BalancePlatform/SameCounterpartyRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SameCounterpartyRestriction.cs rename to Adyen/Model/BalancePlatform/SameCounterpartyRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs b/Adyen/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs rename to Adyen/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/SourceAccountTypesRestriction.cs b/Adyen/Model/BalancePlatform/SourceAccountTypesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SourceAccountTypesRestriction.cs rename to Adyen/Model/BalancePlatform/SourceAccountTypesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/StringMatch.cs b/Adyen/Model/BalancePlatform/StringMatch.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/StringMatch.cs rename to Adyen/Model/BalancePlatform/StringMatch.cs diff --git a/Adyen/src/Model/BalancePlatform/SweepConfigurationV2.cs b/Adyen/Model/BalancePlatform/SweepConfigurationV2.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SweepConfigurationV2.cs rename to Adyen/Model/BalancePlatform/SweepConfigurationV2.cs diff --git a/Adyen/src/Model/BalancePlatform/SweepCounterparty.cs b/Adyen/Model/BalancePlatform/SweepCounterparty.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SweepCounterparty.cs rename to Adyen/Model/BalancePlatform/SweepCounterparty.cs diff --git a/Adyen/src/Model/BalancePlatform/SweepSchedule.cs b/Adyen/Model/BalancePlatform/SweepSchedule.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SweepSchedule.cs rename to Adyen/Model/BalancePlatform/SweepSchedule.cs diff --git a/Adyen/src/Model/BalancePlatform/ThresholdRepayment.cs b/Adyen/Model/BalancePlatform/ThresholdRepayment.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/ThresholdRepayment.cs rename to Adyen/Model/BalancePlatform/ThresholdRepayment.cs diff --git a/Adyen/src/Model/BalancePlatform/TimeOfDay.cs b/Adyen/Model/BalancePlatform/TimeOfDay.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TimeOfDay.cs rename to Adyen/Model/BalancePlatform/TimeOfDay.cs diff --git a/Adyen/src/Model/BalancePlatform/TimeOfDayRestriction.cs b/Adyen/Model/BalancePlatform/TimeOfDayRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TimeOfDayRestriction.cs rename to Adyen/Model/BalancePlatform/TimeOfDayRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/TokenRequestorsRestriction.cs b/Adyen/Model/BalancePlatform/TokenRequestorsRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TokenRequestorsRestriction.cs rename to Adyen/Model/BalancePlatform/TokenRequestorsRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/TotalAmountRestriction.cs b/Adyen/Model/BalancePlatform/TotalAmountRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TotalAmountRestriction.cs rename to Adyen/Model/BalancePlatform/TotalAmountRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRule.cs b/Adyen/Model/BalancePlatform/TransactionRule.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRule.cs rename to Adyen/Model/BalancePlatform/TransactionRule.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRuleEntityKey.cs b/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRuleEntityKey.cs rename to Adyen/Model/BalancePlatform/TransactionRuleEntityKey.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRuleInfo.cs b/Adyen/Model/BalancePlatform/TransactionRuleInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRuleInfo.cs rename to Adyen/Model/BalancePlatform/TransactionRuleInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRuleInterval.cs b/Adyen/Model/BalancePlatform/TransactionRuleInterval.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRuleInterval.cs rename to Adyen/Model/BalancePlatform/TransactionRuleInterval.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRuleResponse.cs b/Adyen/Model/BalancePlatform/TransactionRuleResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRuleResponse.cs rename to Adyen/Model/BalancePlatform/TransactionRuleResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRuleRestrictions.cs b/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRuleRestrictions.cs rename to Adyen/Model/BalancePlatform/TransactionRuleRestrictions.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRulesResponse.cs b/Adyen/Model/BalancePlatform/TransactionRulesResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRulesResponse.cs rename to Adyen/Model/BalancePlatform/TransactionRulesResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/TransferRoute.cs b/Adyen/Model/BalancePlatform/TransferRoute.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransferRoute.cs rename to Adyen/Model/BalancePlatform/TransferRoute.cs diff --git a/Adyen/src/Model/BalancePlatform/TransferRouteRequest.cs b/Adyen/Model/BalancePlatform/TransferRouteRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransferRouteRequest.cs rename to Adyen/Model/BalancePlatform/TransferRouteRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/TransferRouteRequirementsInner.cs b/Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransferRouteRequirementsInner.cs rename to Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.cs diff --git a/Adyen/src/Model/BalancePlatform/TransferRouteResponse.cs b/Adyen/Model/BalancePlatform/TransferRouteResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransferRouteResponse.cs rename to Adyen/Model/BalancePlatform/TransferRouteResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/UKLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/UKLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/UKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/USInternationalAchAddressRequirement.cs b/Adyen/Model/BalancePlatform/USInternationalAchAddressRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/USInternationalAchAddressRequirement.cs rename to Adyen/Model/BalancePlatform/USInternationalAchAddressRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/USLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/USLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/USLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/UpdateNetworkTokenRequest.cs b/Adyen/Model/BalancePlatform/UpdateNetworkTokenRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/UpdateNetworkTokenRequest.cs rename to Adyen/Model/BalancePlatform/UpdateNetworkTokenRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/UpdatePaymentInstrument.cs b/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/UpdatePaymentInstrument.cs rename to Adyen/Model/BalancePlatform/UpdatePaymentInstrument.cs diff --git a/Adyen/src/Model/BalancePlatform/UpdateSweepConfigurationV2.cs b/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/UpdateSweepConfigurationV2.cs rename to Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.cs diff --git a/Adyen/src/Model/BalancePlatform/VerificationDeadline.cs b/Adyen/Model/BalancePlatform/VerificationDeadline.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/VerificationDeadline.cs rename to Adyen/Model/BalancePlatform/VerificationDeadline.cs diff --git a/Adyen/src/Model/BalancePlatform/VerificationError.cs b/Adyen/Model/BalancePlatform/VerificationError.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/VerificationError.cs rename to Adyen/Model/BalancePlatform/VerificationError.cs diff --git a/Adyen/src/Model/BalancePlatform/VerificationErrorRecursive.cs b/Adyen/Model/BalancePlatform/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/VerificationErrorRecursive.cs rename to Adyen/Model/BalancePlatform/VerificationErrorRecursive.cs diff --git a/Adyen/src/Model/BinLookup/AbstractOpenAPISchema.cs b/Adyen/Model/BinLookup/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/BinLookup/AbstractOpenAPISchema.cs rename to Adyen/Model/BinLookup/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/BinLookup/Amount.cs b/Adyen/Model/BinLookup/Amount.cs similarity index 100% rename from Adyen/src/Model/BinLookup/Amount.cs rename to Adyen/Model/BinLookup/Amount.cs diff --git a/Adyen/src/Model/BinLookup/BinDetail.cs b/Adyen/Model/BinLookup/BinDetail.cs similarity index 100% rename from Adyen/src/Model/BinLookup/BinDetail.cs rename to Adyen/Model/BinLookup/BinDetail.cs diff --git a/Adyen/src/Model/BinLookup/CardBin.cs b/Adyen/Model/BinLookup/CardBin.cs similarity index 100% rename from Adyen/src/Model/BinLookup/CardBin.cs rename to Adyen/Model/BinLookup/CardBin.cs diff --git a/Adyen/src/Model/BinLookup/CostEstimateAssumptions.cs b/Adyen/Model/BinLookup/CostEstimateAssumptions.cs similarity index 100% rename from Adyen/src/Model/BinLookup/CostEstimateAssumptions.cs rename to Adyen/Model/BinLookup/CostEstimateAssumptions.cs diff --git a/Adyen/src/Model/BinLookup/CostEstimateRequest.cs b/Adyen/Model/BinLookup/CostEstimateRequest.cs similarity index 100% rename from Adyen/src/Model/BinLookup/CostEstimateRequest.cs rename to Adyen/Model/BinLookup/CostEstimateRequest.cs diff --git a/Adyen/src/Model/BinLookup/CostEstimateResponse.cs b/Adyen/Model/BinLookup/CostEstimateResponse.cs similarity index 100% rename from Adyen/src/Model/BinLookup/CostEstimateResponse.cs rename to Adyen/Model/BinLookup/CostEstimateResponse.cs diff --git a/Adyen/src/Model/BinLookup/DSPublicKeyDetail.cs b/Adyen/Model/BinLookup/DSPublicKeyDetail.cs similarity index 100% rename from Adyen/src/Model/BinLookup/DSPublicKeyDetail.cs rename to Adyen/Model/BinLookup/DSPublicKeyDetail.cs diff --git a/Adyen/src/Model/BinLookup/MerchantDetails.cs b/Adyen/Model/BinLookup/MerchantDetails.cs similarity index 100% rename from Adyen/src/Model/BinLookup/MerchantDetails.cs rename to Adyen/Model/BinLookup/MerchantDetails.cs diff --git a/Adyen/src/Model/BinLookup/Recurring.cs b/Adyen/Model/BinLookup/Recurring.cs similarity index 100% rename from Adyen/src/Model/BinLookup/Recurring.cs rename to Adyen/Model/BinLookup/Recurring.cs diff --git a/Adyen/src/Model/BinLookup/ServiceError.cs b/Adyen/Model/BinLookup/ServiceError.cs similarity index 100% rename from Adyen/src/Model/BinLookup/ServiceError.cs rename to Adyen/Model/BinLookup/ServiceError.cs diff --git a/Adyen/src/Model/BinLookup/ThreeDS2CardRangeDetail.cs b/Adyen/Model/BinLookup/ThreeDS2CardRangeDetail.cs similarity index 100% rename from Adyen/src/Model/BinLookup/ThreeDS2CardRangeDetail.cs rename to Adyen/Model/BinLookup/ThreeDS2CardRangeDetail.cs diff --git a/Adyen/src/Model/BinLookup/ThreeDSAvailabilityRequest.cs b/Adyen/Model/BinLookup/ThreeDSAvailabilityRequest.cs similarity index 100% rename from Adyen/src/Model/BinLookup/ThreeDSAvailabilityRequest.cs rename to Adyen/Model/BinLookup/ThreeDSAvailabilityRequest.cs diff --git a/Adyen/src/Model/BinLookup/ThreeDSAvailabilityResponse.cs b/Adyen/Model/BinLookup/ThreeDSAvailabilityResponse.cs similarity index 100% rename from Adyen/src/Model/BinLookup/ThreeDSAvailabilityResponse.cs rename to Adyen/Model/BinLookup/ThreeDSAvailabilityResponse.cs diff --git a/Adyen/src/Model/Checkout/AbstractOpenAPISchema.cs b/Adyen/Model/Checkout/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Checkout/AbstractOpenAPISchema.cs rename to Adyen/Model/Checkout/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Checkout/AccountInfo.cs b/Adyen/Model/Checkout/AccountInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/AccountInfo.cs rename to Adyen/Model/Checkout/AccountInfo.cs diff --git a/Adyen/src/Model/Checkout/AcctInfo.cs b/Adyen/Model/Checkout/AcctInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/AcctInfo.cs rename to Adyen/Model/Checkout/AcctInfo.cs diff --git a/Adyen/src/Model/Checkout/AchDetails.cs b/Adyen/Model/Checkout/AchDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/AchDetails.cs rename to Adyen/Model/Checkout/AchDetails.cs diff --git a/Adyen/src/Model/Checkout/AdditionalData3DSecure.cs b/Adyen/Model/Checkout/AdditionalData3DSecure.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalData3DSecure.cs rename to Adyen/Model/Checkout/AdditionalData3DSecure.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataAirline.cs b/Adyen/Model/Checkout/AdditionalDataAirline.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataAirline.cs rename to Adyen/Model/Checkout/AdditionalDataAirline.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataCarRental.cs b/Adyen/Model/Checkout/AdditionalDataCarRental.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataCarRental.cs rename to Adyen/Model/Checkout/AdditionalDataCarRental.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataCommon.cs b/Adyen/Model/Checkout/AdditionalDataCommon.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataCommon.cs rename to Adyen/Model/Checkout/AdditionalDataCommon.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataLevel23.cs b/Adyen/Model/Checkout/AdditionalDataLevel23.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataLevel23.cs rename to Adyen/Model/Checkout/AdditionalDataLevel23.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataLodging.cs b/Adyen/Model/Checkout/AdditionalDataLodging.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataLodging.cs rename to Adyen/Model/Checkout/AdditionalDataLodging.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataOpenInvoice.cs b/Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataOpenInvoice.cs rename to Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataOpi.cs b/Adyen/Model/Checkout/AdditionalDataOpi.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataOpi.cs rename to Adyen/Model/Checkout/AdditionalDataOpi.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataRatepay.cs b/Adyen/Model/Checkout/AdditionalDataRatepay.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataRatepay.cs rename to Adyen/Model/Checkout/AdditionalDataRatepay.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataRetry.cs b/Adyen/Model/Checkout/AdditionalDataRetry.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataRetry.cs rename to Adyen/Model/Checkout/AdditionalDataRetry.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataRisk.cs b/Adyen/Model/Checkout/AdditionalDataRisk.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataRisk.cs rename to Adyen/Model/Checkout/AdditionalDataRisk.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataRiskStandalone.cs b/Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataRiskStandalone.cs rename to Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataSubMerchant.cs b/Adyen/Model/Checkout/AdditionalDataSubMerchant.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataSubMerchant.cs rename to Adyen/Model/Checkout/AdditionalDataSubMerchant.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataTemporaryServices.cs b/Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataTemporaryServices.cs rename to Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataWallets.cs b/Adyen/Model/Checkout/AdditionalDataWallets.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataWallets.cs rename to Adyen/Model/Checkout/AdditionalDataWallets.cs diff --git a/Adyen/src/Model/Checkout/Address.cs b/Adyen/Model/Checkout/Address.cs similarity index 100% rename from Adyen/src/Model/Checkout/Address.cs rename to Adyen/Model/Checkout/Address.cs diff --git a/Adyen/src/Model/Checkout/AffirmDetails.cs b/Adyen/Model/Checkout/AffirmDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/AffirmDetails.cs rename to Adyen/Model/Checkout/AffirmDetails.cs diff --git a/Adyen/src/Model/Checkout/AfterpayDetails.cs b/Adyen/Model/Checkout/AfterpayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/AfterpayDetails.cs rename to Adyen/Model/Checkout/AfterpayDetails.cs diff --git a/Adyen/src/Model/Checkout/Agency.cs b/Adyen/Model/Checkout/Agency.cs similarity index 100% rename from Adyen/src/Model/Checkout/Agency.cs rename to Adyen/Model/Checkout/Agency.cs diff --git a/Adyen/src/Model/Checkout/Airline.cs b/Adyen/Model/Checkout/Airline.cs similarity index 100% rename from Adyen/src/Model/Checkout/Airline.cs rename to Adyen/Model/Checkout/Airline.cs diff --git a/Adyen/src/Model/Checkout/AmazonPayDetails.cs b/Adyen/Model/Checkout/AmazonPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/AmazonPayDetails.cs rename to Adyen/Model/Checkout/AmazonPayDetails.cs diff --git a/Adyen/src/Model/Checkout/Amount.cs b/Adyen/Model/Checkout/Amount.cs similarity index 100% rename from Adyen/src/Model/Checkout/Amount.cs rename to Adyen/Model/Checkout/Amount.cs diff --git a/Adyen/src/Model/Checkout/Amounts.cs b/Adyen/Model/Checkout/Amounts.cs similarity index 100% rename from Adyen/src/Model/Checkout/Amounts.cs rename to Adyen/Model/Checkout/Amounts.cs diff --git a/Adyen/src/Model/Checkout/AncvDetails.cs b/Adyen/Model/Checkout/AncvDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/AncvDetails.cs rename to Adyen/Model/Checkout/AncvDetails.cs diff --git a/Adyen/src/Model/Checkout/AndroidPayDetails.cs b/Adyen/Model/Checkout/AndroidPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/AndroidPayDetails.cs rename to Adyen/Model/Checkout/AndroidPayDetails.cs diff --git a/Adyen/src/Model/Checkout/ApplePayDetails.cs b/Adyen/Model/Checkout/ApplePayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/ApplePayDetails.cs rename to Adyen/Model/Checkout/ApplePayDetails.cs diff --git a/Adyen/src/Model/Checkout/ApplePayDonations.cs b/Adyen/Model/Checkout/ApplePayDonations.cs similarity index 100% rename from Adyen/src/Model/Checkout/ApplePayDonations.cs rename to Adyen/Model/Checkout/ApplePayDonations.cs diff --git a/Adyen/src/Model/Checkout/ApplePaySessionRequest.cs b/Adyen/Model/Checkout/ApplePaySessionRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/ApplePaySessionRequest.cs rename to Adyen/Model/Checkout/ApplePaySessionRequest.cs diff --git a/Adyen/src/Model/Checkout/ApplePaySessionResponse.cs b/Adyen/Model/Checkout/ApplePaySessionResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/ApplePaySessionResponse.cs rename to Adyen/Model/Checkout/ApplePaySessionResponse.cs diff --git a/Adyen/src/Model/Checkout/ApplicationInfo.cs b/Adyen/Model/Checkout/ApplicationInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/ApplicationInfo.cs rename to Adyen/Model/Checkout/ApplicationInfo.cs diff --git a/Adyen/src/Model/Checkout/AuthenticationData.cs b/Adyen/Model/Checkout/AuthenticationData.cs similarity index 100% rename from Adyen/src/Model/Checkout/AuthenticationData.cs rename to Adyen/Model/Checkout/AuthenticationData.cs diff --git a/Adyen/src/Model/Checkout/BacsDirectDebitDetails.cs b/Adyen/Model/Checkout/BacsDirectDebitDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/BacsDirectDebitDetails.cs rename to Adyen/Model/Checkout/BacsDirectDebitDetails.cs diff --git a/Adyen/src/Model/Checkout/BalanceCheckRequest.cs b/Adyen/Model/Checkout/BalanceCheckRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/BalanceCheckRequest.cs rename to Adyen/Model/Checkout/BalanceCheckRequest.cs diff --git a/Adyen/src/Model/Checkout/BalanceCheckResponse.cs b/Adyen/Model/Checkout/BalanceCheckResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/BalanceCheckResponse.cs rename to Adyen/Model/Checkout/BalanceCheckResponse.cs diff --git a/Adyen/src/Model/Checkout/BillDeskDetails.cs b/Adyen/Model/Checkout/BillDeskDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/BillDeskDetails.cs rename to Adyen/Model/Checkout/BillDeskDetails.cs diff --git a/Adyen/src/Model/Checkout/BillingAddress.cs b/Adyen/Model/Checkout/BillingAddress.cs similarity index 100% rename from Adyen/src/Model/Checkout/BillingAddress.cs rename to Adyen/Model/Checkout/BillingAddress.cs diff --git a/Adyen/src/Model/Checkout/BlikDetails.cs b/Adyen/Model/Checkout/BlikDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/BlikDetails.cs rename to Adyen/Model/Checkout/BlikDetails.cs diff --git a/Adyen/src/Model/Checkout/BrowserInfo.cs b/Adyen/Model/Checkout/BrowserInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/BrowserInfo.cs rename to Adyen/Model/Checkout/BrowserInfo.cs diff --git a/Adyen/src/Model/Checkout/CancelOrderRequest.cs b/Adyen/Model/Checkout/CancelOrderRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/CancelOrderRequest.cs rename to Adyen/Model/Checkout/CancelOrderRequest.cs diff --git a/Adyen/src/Model/Checkout/CancelOrderResponse.cs b/Adyen/Model/Checkout/CancelOrderResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/CancelOrderResponse.cs rename to Adyen/Model/Checkout/CancelOrderResponse.cs diff --git a/Adyen/src/Model/Checkout/CardBrandDetails.cs b/Adyen/Model/Checkout/CardBrandDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/CardBrandDetails.cs rename to Adyen/Model/Checkout/CardBrandDetails.cs diff --git a/Adyen/src/Model/Checkout/CardDetails.cs b/Adyen/Model/Checkout/CardDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/CardDetails.cs rename to Adyen/Model/Checkout/CardDetails.cs diff --git a/Adyen/src/Model/Checkout/CardDetailsRequest.cs b/Adyen/Model/Checkout/CardDetailsRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/CardDetailsRequest.cs rename to Adyen/Model/Checkout/CardDetailsRequest.cs diff --git a/Adyen/src/Model/Checkout/CardDetailsResponse.cs b/Adyen/Model/Checkout/CardDetailsResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/CardDetailsResponse.cs rename to Adyen/Model/Checkout/CardDetailsResponse.cs diff --git a/Adyen/src/Model/Checkout/CardDonations.cs b/Adyen/Model/Checkout/CardDonations.cs similarity index 100% rename from Adyen/src/Model/Checkout/CardDonations.cs rename to Adyen/Model/Checkout/CardDonations.cs diff --git a/Adyen/src/Model/Checkout/CashAppDetails.cs b/Adyen/Model/Checkout/CashAppDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/CashAppDetails.cs rename to Adyen/Model/Checkout/CashAppDetails.cs diff --git a/Adyen/src/Model/Checkout/CellulantDetails.cs b/Adyen/Model/Checkout/CellulantDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/CellulantDetails.cs rename to Adyen/Model/Checkout/CellulantDetails.cs diff --git a/Adyen/src/Model/Checkout/CheckoutAwaitAction.cs b/Adyen/Model/Checkout/CheckoutAwaitAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutAwaitAction.cs rename to Adyen/Model/Checkout/CheckoutAwaitAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutBankAccount.cs b/Adyen/Model/Checkout/CheckoutBankAccount.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutBankAccount.cs rename to Adyen/Model/Checkout/CheckoutBankAccount.cs diff --git a/Adyen/src/Model/Checkout/CheckoutBankTransferAction.cs b/Adyen/Model/Checkout/CheckoutBankTransferAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutBankTransferAction.cs rename to Adyen/Model/Checkout/CheckoutBankTransferAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs b/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs rename to Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutNativeRedirectAction.cs b/Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutNativeRedirectAction.cs rename to Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutOrderResponse.cs b/Adyen/Model/Checkout/CheckoutOrderResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutOrderResponse.cs rename to Adyen/Model/Checkout/CheckoutOrderResponse.cs diff --git a/Adyen/src/Model/Checkout/CheckoutPaymentMethod.cs b/Adyen/Model/Checkout/CheckoutPaymentMethod.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutPaymentMethod.cs rename to Adyen/Model/Checkout/CheckoutPaymentMethod.cs diff --git a/Adyen/src/Model/Checkout/CheckoutQrCodeAction.cs b/Adyen/Model/Checkout/CheckoutQrCodeAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutQrCodeAction.cs rename to Adyen/Model/Checkout/CheckoutQrCodeAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutRedirectAction.cs b/Adyen/Model/Checkout/CheckoutRedirectAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutRedirectAction.cs rename to Adyen/Model/Checkout/CheckoutRedirectAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutSDKAction.cs b/Adyen/Model/Checkout/CheckoutSDKAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutSDKAction.cs rename to Adyen/Model/Checkout/CheckoutSDKAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutSessionInstallmentOption.cs b/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutSessionInstallmentOption.cs rename to Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs diff --git a/Adyen/src/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs b/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs rename to Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs diff --git a/Adyen/src/Model/Checkout/CheckoutThreeDS2Action.cs b/Adyen/Model/Checkout/CheckoutThreeDS2Action.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutThreeDS2Action.cs rename to Adyen/Model/Checkout/CheckoutThreeDS2Action.cs diff --git a/Adyen/src/Model/Checkout/CheckoutVoucherAction.cs b/Adyen/Model/Checkout/CheckoutVoucherAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutVoucherAction.cs rename to Adyen/Model/Checkout/CheckoutVoucherAction.cs diff --git a/Adyen/src/Model/Checkout/CommonField.cs b/Adyen/Model/Checkout/CommonField.cs similarity index 100% rename from Adyen/src/Model/Checkout/CommonField.cs rename to Adyen/Model/Checkout/CommonField.cs diff --git a/Adyen/src/Model/Checkout/Company.cs b/Adyen/Model/Checkout/Company.cs similarity index 100% rename from Adyen/src/Model/Checkout/Company.cs rename to Adyen/Model/Checkout/Company.cs diff --git a/Adyen/src/Model/Checkout/CreateCheckoutSessionRequest.cs b/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/CreateCheckoutSessionRequest.cs rename to Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs diff --git a/Adyen/src/Model/Checkout/CreateCheckoutSessionResponse.cs b/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/CreateCheckoutSessionResponse.cs rename to Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs diff --git a/Adyen/src/Model/Checkout/CreateOrderRequest.cs b/Adyen/Model/Checkout/CreateOrderRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/CreateOrderRequest.cs rename to Adyen/Model/Checkout/CreateOrderRequest.cs diff --git a/Adyen/src/Model/Checkout/CreateOrderResponse.cs b/Adyen/Model/Checkout/CreateOrderResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/CreateOrderResponse.cs rename to Adyen/Model/Checkout/CreateOrderResponse.cs diff --git a/Adyen/src/Model/Checkout/DeliveryAddress.cs b/Adyen/Model/Checkout/DeliveryAddress.cs similarity index 100% rename from Adyen/src/Model/Checkout/DeliveryAddress.cs rename to Adyen/Model/Checkout/DeliveryAddress.cs diff --git a/Adyen/src/Model/Checkout/DeliveryMethod.cs b/Adyen/Model/Checkout/DeliveryMethod.cs similarity index 100% rename from Adyen/src/Model/Checkout/DeliveryMethod.cs rename to Adyen/Model/Checkout/DeliveryMethod.cs diff --git a/Adyen/src/Model/Checkout/DetailsRequestAuthenticationData.cs b/Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs similarity index 100% rename from Adyen/src/Model/Checkout/DetailsRequestAuthenticationData.cs rename to Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs diff --git a/Adyen/src/Model/Checkout/DeviceRenderOptions.cs b/Adyen/Model/Checkout/DeviceRenderOptions.cs similarity index 100% rename from Adyen/src/Model/Checkout/DeviceRenderOptions.cs rename to Adyen/Model/Checkout/DeviceRenderOptions.cs diff --git a/Adyen/src/Model/Checkout/DokuDetails.cs b/Adyen/Model/Checkout/DokuDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/DokuDetails.cs rename to Adyen/Model/Checkout/DokuDetails.cs diff --git a/Adyen/src/Model/Checkout/Donation.cs b/Adyen/Model/Checkout/Donation.cs similarity index 100% rename from Adyen/src/Model/Checkout/Donation.cs rename to Adyen/Model/Checkout/Donation.cs diff --git a/Adyen/src/Model/Checkout/DonationCampaign.cs b/Adyen/Model/Checkout/DonationCampaign.cs similarity index 100% rename from Adyen/src/Model/Checkout/DonationCampaign.cs rename to Adyen/Model/Checkout/DonationCampaign.cs diff --git a/Adyen/src/Model/Checkout/DonationCampaignsRequest.cs b/Adyen/Model/Checkout/DonationCampaignsRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/DonationCampaignsRequest.cs rename to Adyen/Model/Checkout/DonationCampaignsRequest.cs diff --git a/Adyen/src/Model/Checkout/DonationCampaignsResponse.cs b/Adyen/Model/Checkout/DonationCampaignsResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/DonationCampaignsResponse.cs rename to Adyen/Model/Checkout/DonationCampaignsResponse.cs diff --git a/Adyen/src/Model/Checkout/DonationPaymentMethod.cs b/Adyen/Model/Checkout/DonationPaymentMethod.cs similarity index 100% rename from Adyen/src/Model/Checkout/DonationPaymentMethod.cs rename to Adyen/Model/Checkout/DonationPaymentMethod.cs diff --git a/Adyen/src/Model/Checkout/DonationPaymentRequest.cs b/Adyen/Model/Checkout/DonationPaymentRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/DonationPaymentRequest.cs rename to Adyen/Model/Checkout/DonationPaymentRequest.cs diff --git a/Adyen/src/Model/Checkout/DonationPaymentResponse.cs b/Adyen/Model/Checkout/DonationPaymentResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/DonationPaymentResponse.cs rename to Adyen/Model/Checkout/DonationPaymentResponse.cs diff --git a/Adyen/src/Model/Checkout/DragonpayDetails.cs b/Adyen/Model/Checkout/DragonpayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/DragonpayDetails.cs rename to Adyen/Model/Checkout/DragonpayDetails.cs diff --git a/Adyen/src/Model/Checkout/EBankingFinlandDetails.cs b/Adyen/Model/Checkout/EBankingFinlandDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/EBankingFinlandDetails.cs rename to Adyen/Model/Checkout/EBankingFinlandDetails.cs diff --git a/Adyen/src/Model/Checkout/EcontextVoucherDetails.cs b/Adyen/Model/Checkout/EcontextVoucherDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/EcontextVoucherDetails.cs rename to Adyen/Model/Checkout/EcontextVoucherDetails.cs diff --git a/Adyen/src/Model/Checkout/EftDetails.cs b/Adyen/Model/Checkout/EftDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/EftDetails.cs rename to Adyen/Model/Checkout/EftDetails.cs diff --git a/Adyen/src/Model/Checkout/EncryptedOrderData.cs b/Adyen/Model/Checkout/EncryptedOrderData.cs similarity index 100% rename from Adyen/src/Model/Checkout/EncryptedOrderData.cs rename to Adyen/Model/Checkout/EncryptedOrderData.cs diff --git a/Adyen/src/Model/Checkout/EnhancedSchemeData.cs b/Adyen/Model/Checkout/EnhancedSchemeData.cs similarity index 100% rename from Adyen/src/Model/Checkout/EnhancedSchemeData.cs rename to Adyen/Model/Checkout/EnhancedSchemeData.cs diff --git a/Adyen/src/Model/Checkout/ExternalPlatform.cs b/Adyen/Model/Checkout/ExternalPlatform.cs similarity index 100% rename from Adyen/src/Model/Checkout/ExternalPlatform.cs rename to Adyen/Model/Checkout/ExternalPlatform.cs diff --git a/Adyen/src/Model/Checkout/FastlaneDetails.cs b/Adyen/Model/Checkout/FastlaneDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/FastlaneDetails.cs rename to Adyen/Model/Checkout/FastlaneDetails.cs diff --git a/Adyen/src/Model/Checkout/ForexQuote.cs b/Adyen/Model/Checkout/ForexQuote.cs similarity index 100% rename from Adyen/src/Model/Checkout/ForexQuote.cs rename to Adyen/Model/Checkout/ForexQuote.cs diff --git a/Adyen/src/Model/Checkout/FraudCheckResult.cs b/Adyen/Model/Checkout/FraudCheckResult.cs similarity index 100% rename from Adyen/src/Model/Checkout/FraudCheckResult.cs rename to Adyen/Model/Checkout/FraudCheckResult.cs diff --git a/Adyen/src/Model/Checkout/FraudResult.cs b/Adyen/Model/Checkout/FraudResult.cs similarity index 100% rename from Adyen/src/Model/Checkout/FraudResult.cs rename to Adyen/Model/Checkout/FraudResult.cs diff --git a/Adyen/src/Model/Checkout/FundOrigin.cs b/Adyen/Model/Checkout/FundOrigin.cs similarity index 100% rename from Adyen/src/Model/Checkout/FundOrigin.cs rename to Adyen/Model/Checkout/FundOrigin.cs diff --git a/Adyen/src/Model/Checkout/FundRecipient.cs b/Adyen/Model/Checkout/FundRecipient.cs similarity index 100% rename from Adyen/src/Model/Checkout/FundRecipient.cs rename to Adyen/Model/Checkout/FundRecipient.cs diff --git a/Adyen/src/Model/Checkout/GenericIssuerPaymentMethodDetails.cs b/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/GenericIssuerPaymentMethodDetails.cs rename to Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs diff --git a/Adyen/src/Model/Checkout/GooglePayDetails.cs b/Adyen/Model/Checkout/GooglePayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/GooglePayDetails.cs rename to Adyen/Model/Checkout/GooglePayDetails.cs diff --git a/Adyen/src/Model/Checkout/GooglePayDonations.cs b/Adyen/Model/Checkout/GooglePayDonations.cs similarity index 100% rename from Adyen/src/Model/Checkout/GooglePayDonations.cs rename to Adyen/Model/Checkout/GooglePayDonations.cs diff --git a/Adyen/src/Model/Checkout/IdealDetails.cs b/Adyen/Model/Checkout/IdealDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/IdealDetails.cs rename to Adyen/Model/Checkout/IdealDetails.cs diff --git a/Adyen/src/Model/Checkout/IdealDonations.cs b/Adyen/Model/Checkout/IdealDonations.cs similarity index 100% rename from Adyen/src/Model/Checkout/IdealDonations.cs rename to Adyen/Model/Checkout/IdealDonations.cs diff --git a/Adyen/src/Model/Checkout/InputDetail.cs b/Adyen/Model/Checkout/InputDetail.cs similarity index 100% rename from Adyen/src/Model/Checkout/InputDetail.cs rename to Adyen/Model/Checkout/InputDetail.cs diff --git a/Adyen/src/Model/Checkout/InstallmentOption.cs b/Adyen/Model/Checkout/InstallmentOption.cs similarity index 100% rename from Adyen/src/Model/Checkout/InstallmentOption.cs rename to Adyen/Model/Checkout/InstallmentOption.cs diff --git a/Adyen/src/Model/Checkout/Installments.cs b/Adyen/Model/Checkout/Installments.cs similarity index 100% rename from Adyen/src/Model/Checkout/Installments.cs rename to Adyen/Model/Checkout/Installments.cs diff --git a/Adyen/src/Model/Checkout/Item.cs b/Adyen/Model/Checkout/Item.cs similarity index 100% rename from Adyen/src/Model/Checkout/Item.cs rename to Adyen/Model/Checkout/Item.cs diff --git a/Adyen/src/Model/Checkout/KlarnaDetails.cs b/Adyen/Model/Checkout/KlarnaDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/KlarnaDetails.cs rename to Adyen/Model/Checkout/KlarnaDetails.cs diff --git a/Adyen/src/Model/Checkout/Leg.cs b/Adyen/Model/Checkout/Leg.cs similarity index 100% rename from Adyen/src/Model/Checkout/Leg.cs rename to Adyen/Model/Checkout/Leg.cs diff --git a/Adyen/src/Model/Checkout/LineItem.cs b/Adyen/Model/Checkout/LineItem.cs similarity index 100% rename from Adyen/src/Model/Checkout/LineItem.cs rename to Adyen/Model/Checkout/LineItem.cs diff --git a/Adyen/src/Model/Checkout/ListStoredPaymentMethodsResponse.cs b/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/ListStoredPaymentMethodsResponse.cs rename to Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs diff --git a/Adyen/src/Model/Checkout/Mandate.cs b/Adyen/Model/Checkout/Mandate.cs similarity index 100% rename from Adyen/src/Model/Checkout/Mandate.cs rename to Adyen/Model/Checkout/Mandate.cs diff --git a/Adyen/src/Model/Checkout/MasterpassDetails.cs b/Adyen/Model/Checkout/MasterpassDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/MasterpassDetails.cs rename to Adyen/Model/Checkout/MasterpassDetails.cs diff --git a/Adyen/src/Model/Checkout/MbwayDetails.cs b/Adyen/Model/Checkout/MbwayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/MbwayDetails.cs rename to Adyen/Model/Checkout/MbwayDetails.cs diff --git a/Adyen/src/Model/Checkout/MerchantDevice.cs b/Adyen/Model/Checkout/MerchantDevice.cs similarity index 100% rename from Adyen/src/Model/Checkout/MerchantDevice.cs rename to Adyen/Model/Checkout/MerchantDevice.cs diff --git a/Adyen/src/Model/Checkout/MerchantRiskIndicator.cs b/Adyen/Model/Checkout/MerchantRiskIndicator.cs similarity index 100% rename from Adyen/src/Model/Checkout/MerchantRiskIndicator.cs rename to Adyen/Model/Checkout/MerchantRiskIndicator.cs diff --git a/Adyen/src/Model/Checkout/MobilePayDetails.cs b/Adyen/Model/Checkout/MobilePayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/MobilePayDetails.cs rename to Adyen/Model/Checkout/MobilePayDetails.cs diff --git a/Adyen/src/Model/Checkout/MolPayDetails.cs b/Adyen/Model/Checkout/MolPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/MolPayDetails.cs rename to Adyen/Model/Checkout/MolPayDetails.cs diff --git a/Adyen/src/Model/Checkout/Name.cs b/Adyen/Model/Checkout/Name.cs similarity index 100% rename from Adyen/src/Model/Checkout/Name.cs rename to Adyen/Model/Checkout/Name.cs diff --git a/Adyen/src/Model/Checkout/OpenInvoiceDetails.cs b/Adyen/Model/Checkout/OpenInvoiceDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/OpenInvoiceDetails.cs rename to Adyen/Model/Checkout/OpenInvoiceDetails.cs diff --git a/Adyen/src/Model/Checkout/Passenger.cs b/Adyen/Model/Checkout/Passenger.cs similarity index 100% rename from Adyen/src/Model/Checkout/Passenger.cs rename to Adyen/Model/Checkout/Passenger.cs diff --git a/Adyen/src/Model/Checkout/PayByBankAISDirectDebitDetails.cs b/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayByBankAISDirectDebitDetails.cs rename to Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs diff --git a/Adyen/src/Model/Checkout/PayByBankDetails.cs b/Adyen/Model/Checkout/PayByBankDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayByBankDetails.cs rename to Adyen/Model/Checkout/PayByBankDetails.cs diff --git a/Adyen/src/Model/Checkout/PayPalDetails.cs b/Adyen/Model/Checkout/PayPalDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayPalDetails.cs rename to Adyen/Model/Checkout/PayPalDetails.cs diff --git a/Adyen/src/Model/Checkout/PayPayDetails.cs b/Adyen/Model/Checkout/PayPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayPayDetails.cs rename to Adyen/Model/Checkout/PayPayDetails.cs diff --git a/Adyen/src/Model/Checkout/PayToDetails.cs b/Adyen/Model/Checkout/PayToDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayToDetails.cs rename to Adyen/Model/Checkout/PayToDetails.cs diff --git a/Adyen/src/Model/Checkout/PayUUpiDetails.cs b/Adyen/Model/Checkout/PayUUpiDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayUUpiDetails.cs rename to Adyen/Model/Checkout/PayUUpiDetails.cs diff --git a/Adyen/src/Model/Checkout/PayWithGoogleDetails.cs b/Adyen/Model/Checkout/PayWithGoogleDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayWithGoogleDetails.cs rename to Adyen/Model/Checkout/PayWithGoogleDetails.cs diff --git a/Adyen/src/Model/Checkout/PayWithGoogleDonations.cs b/Adyen/Model/Checkout/PayWithGoogleDonations.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayWithGoogleDonations.cs rename to Adyen/Model/Checkout/PayWithGoogleDonations.cs diff --git a/Adyen/src/Model/Checkout/Payment.cs b/Adyen/Model/Checkout/Payment.cs similarity index 100% rename from Adyen/src/Model/Checkout/Payment.cs rename to Adyen/Model/Checkout/Payment.cs diff --git a/Adyen/src/Model/Checkout/PaymentAmountUpdateRequest.cs b/Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentAmountUpdateRequest.cs rename to Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentAmountUpdateResponse.cs b/Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentAmountUpdateResponse.cs rename to Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentCancelRequest.cs b/Adyen/Model/Checkout/PaymentCancelRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentCancelRequest.cs rename to Adyen/Model/Checkout/PaymentCancelRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentCancelResponse.cs b/Adyen/Model/Checkout/PaymentCancelResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentCancelResponse.cs rename to Adyen/Model/Checkout/PaymentCancelResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentCaptureRequest.cs b/Adyen/Model/Checkout/PaymentCaptureRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentCaptureRequest.cs rename to Adyen/Model/Checkout/PaymentCaptureRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentCaptureResponse.cs b/Adyen/Model/Checkout/PaymentCaptureResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentCaptureResponse.cs rename to Adyen/Model/Checkout/PaymentCaptureResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentCompletionDetails.cs b/Adyen/Model/Checkout/PaymentCompletionDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentCompletionDetails.cs rename to Adyen/Model/Checkout/PaymentCompletionDetails.cs diff --git a/Adyen/src/Model/Checkout/PaymentDetails.cs b/Adyen/Model/Checkout/PaymentDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentDetails.cs rename to Adyen/Model/Checkout/PaymentDetails.cs diff --git a/Adyen/src/Model/Checkout/PaymentDetailsRequest.cs b/Adyen/Model/Checkout/PaymentDetailsRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentDetailsRequest.cs rename to Adyen/Model/Checkout/PaymentDetailsRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentDetailsResponse.cs b/Adyen/Model/Checkout/PaymentDetailsResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentDetailsResponse.cs rename to Adyen/Model/Checkout/PaymentDetailsResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentLinkRequest.cs b/Adyen/Model/Checkout/PaymentLinkRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentLinkRequest.cs rename to Adyen/Model/Checkout/PaymentLinkRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentLinkResponse.cs b/Adyen/Model/Checkout/PaymentLinkResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentLinkResponse.cs rename to Adyen/Model/Checkout/PaymentLinkResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethod.cs b/Adyen/Model/Checkout/PaymentMethod.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethod.cs rename to Adyen/Model/Checkout/PaymentMethod.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethodGroup.cs b/Adyen/Model/Checkout/PaymentMethodGroup.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethodGroup.cs rename to Adyen/Model/Checkout/PaymentMethodGroup.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethodIssuer.cs b/Adyen/Model/Checkout/PaymentMethodIssuer.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethodIssuer.cs rename to Adyen/Model/Checkout/PaymentMethodIssuer.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethodToStore.cs b/Adyen/Model/Checkout/PaymentMethodToStore.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethodToStore.cs rename to Adyen/Model/Checkout/PaymentMethodToStore.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethodUPIApps.cs b/Adyen/Model/Checkout/PaymentMethodUPIApps.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethodUPIApps.cs rename to Adyen/Model/Checkout/PaymentMethodUPIApps.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethodsRequest.cs b/Adyen/Model/Checkout/PaymentMethodsRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethodsRequest.cs rename to Adyen/Model/Checkout/PaymentMethodsRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethodsResponse.cs b/Adyen/Model/Checkout/PaymentMethodsResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethodsResponse.cs rename to Adyen/Model/Checkout/PaymentMethodsResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentRefundRequest.cs b/Adyen/Model/Checkout/PaymentRefundRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentRefundRequest.cs rename to Adyen/Model/Checkout/PaymentRefundRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentRefundResponse.cs b/Adyen/Model/Checkout/PaymentRefundResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentRefundResponse.cs rename to Adyen/Model/Checkout/PaymentRefundResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentRequest.cs b/Adyen/Model/Checkout/PaymentRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentRequest.cs rename to Adyen/Model/Checkout/PaymentRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentResponse.cs b/Adyen/Model/Checkout/PaymentResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentResponse.cs rename to Adyen/Model/Checkout/PaymentResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentResponseAction.cs b/Adyen/Model/Checkout/PaymentResponseAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentResponseAction.cs rename to Adyen/Model/Checkout/PaymentResponseAction.cs diff --git a/Adyen/src/Model/Checkout/PaymentReversalRequest.cs b/Adyen/Model/Checkout/PaymentReversalRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentReversalRequest.cs rename to Adyen/Model/Checkout/PaymentReversalRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentReversalResponse.cs b/Adyen/Model/Checkout/PaymentReversalResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentReversalResponse.cs rename to Adyen/Model/Checkout/PaymentReversalResponse.cs diff --git a/Adyen/src/Model/Checkout/PaypalUpdateOrderRequest.cs b/Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaypalUpdateOrderRequest.cs rename to Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs diff --git a/Adyen/src/Model/Checkout/PaypalUpdateOrderResponse.cs b/Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaypalUpdateOrderResponse.cs rename to Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs diff --git a/Adyen/src/Model/Checkout/Phone.cs b/Adyen/Model/Checkout/Phone.cs similarity index 100% rename from Adyen/src/Model/Checkout/Phone.cs rename to Adyen/Model/Checkout/Phone.cs diff --git a/Adyen/src/Model/Checkout/PixDetails.cs b/Adyen/Model/Checkout/PixDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PixDetails.cs rename to Adyen/Model/Checkout/PixDetails.cs diff --git a/Adyen/src/Model/Checkout/PixRecurring.cs b/Adyen/Model/Checkout/PixRecurring.cs similarity index 100% rename from Adyen/src/Model/Checkout/PixRecurring.cs rename to Adyen/Model/Checkout/PixRecurring.cs diff --git a/Adyen/src/Model/Checkout/PlatformChargebackLogic.cs b/Adyen/Model/Checkout/PlatformChargebackLogic.cs similarity index 100% rename from Adyen/src/Model/Checkout/PlatformChargebackLogic.cs rename to Adyen/Model/Checkout/PlatformChargebackLogic.cs diff --git a/Adyen/src/Model/Checkout/PseDetails.cs b/Adyen/Model/Checkout/PseDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PseDetails.cs rename to Adyen/Model/Checkout/PseDetails.cs diff --git a/Adyen/src/Model/Checkout/RakutenPayDetails.cs b/Adyen/Model/Checkout/RakutenPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/RakutenPayDetails.cs rename to Adyen/Model/Checkout/RakutenPayDetails.cs diff --git a/Adyen/src/Model/Checkout/RatepayDetails.cs b/Adyen/Model/Checkout/RatepayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/RatepayDetails.cs rename to Adyen/Model/Checkout/RatepayDetails.cs diff --git a/Adyen/src/Model/Checkout/Recurring.cs b/Adyen/Model/Checkout/Recurring.cs similarity index 100% rename from Adyen/src/Model/Checkout/Recurring.cs rename to Adyen/Model/Checkout/Recurring.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalData3DSecure.cs b/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalData3DSecure.cs rename to Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataBillingAddress.cs b/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataBillingAddress.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataCard.cs b/Adyen/Model/Checkout/ResponseAdditionalDataCard.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataCard.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataCard.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataCommon.cs b/Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataCommon.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataDomesticError.cs b/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataDomesticError.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataInstallments.cs b/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataInstallments.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs b/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataOpi.cs b/Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataOpi.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataSepa.cs b/Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataSepa.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs diff --git a/Adyen/src/Model/Checkout/ResponsePaymentMethod.cs b/Adyen/Model/Checkout/ResponsePaymentMethod.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponsePaymentMethod.cs rename to Adyen/Model/Checkout/ResponsePaymentMethod.cs diff --git a/Adyen/src/Model/Checkout/RiskData.cs b/Adyen/Model/Checkout/RiskData.cs similarity index 100% rename from Adyen/src/Model/Checkout/RiskData.cs rename to Adyen/Model/Checkout/RiskData.cs diff --git a/Adyen/src/Model/Checkout/RivertyDetails.cs b/Adyen/Model/Checkout/RivertyDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/RivertyDetails.cs rename to Adyen/Model/Checkout/RivertyDetails.cs diff --git a/Adyen/src/Model/Checkout/SDKEphemPubKey.cs b/Adyen/Model/Checkout/SDKEphemPubKey.cs similarity index 100% rename from Adyen/src/Model/Checkout/SDKEphemPubKey.cs rename to Adyen/Model/Checkout/SDKEphemPubKey.cs diff --git a/Adyen/src/Model/Checkout/SamsungPayDetails.cs b/Adyen/Model/Checkout/SamsungPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/SamsungPayDetails.cs rename to Adyen/Model/Checkout/SamsungPayDetails.cs diff --git a/Adyen/src/Model/Checkout/SepaDirectDebitDetails.cs b/Adyen/Model/Checkout/SepaDirectDebitDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/SepaDirectDebitDetails.cs rename to Adyen/Model/Checkout/SepaDirectDebitDetails.cs diff --git a/Adyen/src/Model/Checkout/ServiceError.cs b/Adyen/Model/Checkout/ServiceError.cs similarity index 100% rename from Adyen/src/Model/Checkout/ServiceError.cs rename to Adyen/Model/Checkout/ServiceError.cs diff --git a/Adyen/src/Model/Checkout/SessionResultResponse.cs b/Adyen/Model/Checkout/SessionResultResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/SessionResultResponse.cs rename to Adyen/Model/Checkout/SessionResultResponse.cs diff --git a/Adyen/src/Model/Checkout/ShopperInteractionDevice.cs b/Adyen/Model/Checkout/ShopperInteractionDevice.cs similarity index 100% rename from Adyen/src/Model/Checkout/ShopperInteractionDevice.cs rename to Adyen/Model/Checkout/ShopperInteractionDevice.cs diff --git a/Adyen/src/Model/Checkout/Split.cs b/Adyen/Model/Checkout/Split.cs similarity index 100% rename from Adyen/src/Model/Checkout/Split.cs rename to Adyen/Model/Checkout/Split.cs diff --git a/Adyen/src/Model/Checkout/SplitAmount.cs b/Adyen/Model/Checkout/SplitAmount.cs similarity index 100% rename from Adyen/src/Model/Checkout/SplitAmount.cs rename to Adyen/Model/Checkout/SplitAmount.cs diff --git a/Adyen/src/Model/Checkout/StandalonePaymentCancelRequest.cs b/Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/StandalonePaymentCancelRequest.cs rename to Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs diff --git a/Adyen/src/Model/Checkout/StandalonePaymentCancelResponse.cs b/Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/StandalonePaymentCancelResponse.cs rename to Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs diff --git a/Adyen/src/Model/Checkout/StoredPaymentMethod.cs b/Adyen/Model/Checkout/StoredPaymentMethod.cs similarity index 100% rename from Adyen/src/Model/Checkout/StoredPaymentMethod.cs rename to Adyen/Model/Checkout/StoredPaymentMethod.cs diff --git a/Adyen/src/Model/Checkout/StoredPaymentMethodDetails.cs b/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/StoredPaymentMethodDetails.cs rename to Adyen/Model/Checkout/StoredPaymentMethodDetails.cs diff --git a/Adyen/src/Model/Checkout/StoredPaymentMethodRequest.cs b/Adyen/Model/Checkout/StoredPaymentMethodRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/StoredPaymentMethodRequest.cs rename to Adyen/Model/Checkout/StoredPaymentMethodRequest.cs diff --git a/Adyen/src/Model/Checkout/StoredPaymentMethodResource.cs b/Adyen/Model/Checkout/StoredPaymentMethodResource.cs similarity index 100% rename from Adyen/src/Model/Checkout/StoredPaymentMethodResource.cs rename to Adyen/Model/Checkout/StoredPaymentMethodResource.cs diff --git a/Adyen/src/Model/Checkout/SubInputDetail.cs b/Adyen/Model/Checkout/SubInputDetail.cs similarity index 100% rename from Adyen/src/Model/Checkout/SubInputDetail.cs rename to Adyen/Model/Checkout/SubInputDetail.cs diff --git a/Adyen/src/Model/Checkout/SubMerchant.cs b/Adyen/Model/Checkout/SubMerchant.cs similarity index 100% rename from Adyen/src/Model/Checkout/SubMerchant.cs rename to Adyen/Model/Checkout/SubMerchant.cs diff --git a/Adyen/src/Model/Checkout/SubMerchantInfo.cs b/Adyen/Model/Checkout/SubMerchantInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/SubMerchantInfo.cs rename to Adyen/Model/Checkout/SubMerchantInfo.cs diff --git a/Adyen/src/Model/Checkout/Surcharge.cs b/Adyen/Model/Checkout/Surcharge.cs similarity index 100% rename from Adyen/src/Model/Checkout/Surcharge.cs rename to Adyen/Model/Checkout/Surcharge.cs diff --git a/Adyen/src/Model/Checkout/TaxTotal.cs b/Adyen/Model/Checkout/TaxTotal.cs similarity index 100% rename from Adyen/src/Model/Checkout/TaxTotal.cs rename to Adyen/Model/Checkout/TaxTotal.cs diff --git a/Adyen/src/Model/Checkout/ThreeDS2RequestData.cs b/Adyen/Model/Checkout/ThreeDS2RequestData.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDS2RequestData.cs rename to Adyen/Model/Checkout/ThreeDS2RequestData.cs diff --git a/Adyen/src/Model/Checkout/ThreeDS2RequestFields.cs b/Adyen/Model/Checkout/ThreeDS2RequestFields.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDS2RequestFields.cs rename to Adyen/Model/Checkout/ThreeDS2RequestFields.cs diff --git a/Adyen/src/Model/Checkout/ThreeDS2ResponseData.cs b/Adyen/Model/Checkout/ThreeDS2ResponseData.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDS2ResponseData.cs rename to Adyen/Model/Checkout/ThreeDS2ResponseData.cs diff --git a/Adyen/src/Model/Checkout/ThreeDS2Result.cs b/Adyen/Model/Checkout/ThreeDS2Result.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDS2Result.cs rename to Adyen/Model/Checkout/ThreeDS2Result.cs diff --git a/Adyen/src/Model/Checkout/ThreeDSRequestData.cs b/Adyen/Model/Checkout/ThreeDSRequestData.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDSRequestData.cs rename to Adyen/Model/Checkout/ThreeDSRequestData.cs diff --git a/Adyen/src/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs b/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs rename to Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs diff --git a/Adyen/src/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs b/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs rename to Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs diff --git a/Adyen/src/Model/Checkout/ThreeDSecureData.cs b/Adyen/Model/Checkout/ThreeDSecureData.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDSecureData.cs rename to Adyen/Model/Checkout/ThreeDSecureData.cs diff --git a/Adyen/src/Model/Checkout/Ticket.cs b/Adyen/Model/Checkout/Ticket.cs similarity index 100% rename from Adyen/src/Model/Checkout/Ticket.cs rename to Adyen/Model/Checkout/Ticket.cs diff --git a/Adyen/src/Model/Checkout/TravelAgency.cs b/Adyen/Model/Checkout/TravelAgency.cs similarity index 100% rename from Adyen/src/Model/Checkout/TravelAgency.cs rename to Adyen/Model/Checkout/TravelAgency.cs diff --git a/Adyen/src/Model/Checkout/TwintDetails.cs b/Adyen/Model/Checkout/TwintDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/TwintDetails.cs rename to Adyen/Model/Checkout/TwintDetails.cs diff --git a/Adyen/src/Model/Checkout/UpdatePaymentLinkRequest.cs b/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/UpdatePaymentLinkRequest.cs rename to Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs diff --git a/Adyen/src/Model/Checkout/UpiCollectDetails.cs b/Adyen/Model/Checkout/UpiCollectDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/UpiCollectDetails.cs rename to Adyen/Model/Checkout/UpiCollectDetails.cs diff --git a/Adyen/src/Model/Checkout/UpiIntentDetails.cs b/Adyen/Model/Checkout/UpiIntentDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/UpiIntentDetails.cs rename to Adyen/Model/Checkout/UpiIntentDetails.cs diff --git a/Adyen/src/Model/Checkout/UtilityRequest.cs b/Adyen/Model/Checkout/UtilityRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/UtilityRequest.cs rename to Adyen/Model/Checkout/UtilityRequest.cs diff --git a/Adyen/src/Model/Checkout/UtilityResponse.cs b/Adyen/Model/Checkout/UtilityResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/UtilityResponse.cs rename to Adyen/Model/Checkout/UtilityResponse.cs diff --git a/Adyen/src/Model/Checkout/VippsDetails.cs b/Adyen/Model/Checkout/VippsDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/VippsDetails.cs rename to Adyen/Model/Checkout/VippsDetails.cs diff --git a/Adyen/src/Model/Checkout/VisaCheckoutDetails.cs b/Adyen/Model/Checkout/VisaCheckoutDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/VisaCheckoutDetails.cs rename to Adyen/Model/Checkout/VisaCheckoutDetails.cs diff --git a/Adyen/src/Model/Checkout/WeChatPayDetails.cs b/Adyen/Model/Checkout/WeChatPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/WeChatPayDetails.cs rename to Adyen/Model/Checkout/WeChatPayDetails.cs diff --git a/Adyen/src/Model/Checkout/WeChatPayMiniProgramDetails.cs b/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/WeChatPayMiniProgramDetails.cs rename to Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs diff --git a/Adyen/src/Model/Checkout/ZipDetails.cs b/Adyen/Model/Checkout/ZipDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/ZipDetails.cs rename to Adyen/Model/Checkout/ZipDetails.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/AccountHolder.cs b/Adyen/Model/ConfigurationWebhooks/AccountHolder.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/AccountHolder.cs rename to Adyen/Model/ConfigurationWebhooks/AccountHolder.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/AccountHolderCapability.cs b/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/AccountHolderCapability.cs rename to Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs b/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs rename to Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs b/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs rename to Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs b/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs rename to Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Address.cs b/Adyen/Model/ConfigurationWebhooks/Address.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Address.cs rename to Adyen/Model/ConfigurationWebhooks/Address.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Amount.cs b/Adyen/Model/ConfigurationWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Amount.cs rename to Adyen/Model/ConfigurationWebhooks/Amount.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Authentication.cs b/Adyen/Model/ConfigurationWebhooks/Authentication.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Authentication.cs rename to Adyen/Model/ConfigurationWebhooks/Authentication.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Balance.cs b/Adyen/Model/ConfigurationWebhooks/Balance.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Balance.cs rename to Adyen/Model/ConfigurationWebhooks/Balance.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/BalanceAccount.cs b/Adyen/Model/ConfigurationWebhooks/BalanceAccount.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/BalanceAccount.cs rename to Adyen/Model/ConfigurationWebhooks/BalanceAccount.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs b/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs rename to Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs b/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs rename to Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/BankAccountDetails.cs b/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/BankAccountDetails.cs rename to Adyen/Model/ConfigurationWebhooks/BankAccountDetails.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/BulkAddress.cs b/Adyen/Model/ConfigurationWebhooks/BulkAddress.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/BulkAddress.cs rename to Adyen/Model/ConfigurationWebhooks/BulkAddress.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CapabilityProblem.cs b/Adyen/Model/ConfigurationWebhooks/CapabilityProblem.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CapabilityProblem.cs rename to Adyen/Model/ConfigurationWebhooks/CapabilityProblem.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs b/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs rename to Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs b/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs rename to Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CapabilitySettings.cs b/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CapabilitySettings.cs rename to Adyen/Model/ConfigurationWebhooks/CapabilitySettings.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Card.cs b/Adyen/Model/ConfigurationWebhooks/Card.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Card.cs rename to Adyen/Model/ConfigurationWebhooks/Card.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CardConfiguration.cs b/Adyen/Model/ConfigurationWebhooks/CardConfiguration.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CardConfiguration.cs rename to Adyen/Model/ConfigurationWebhooks/CardConfiguration.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CardOrderItem.cs b/Adyen/Model/ConfigurationWebhooks/CardOrderItem.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CardOrderItem.cs rename to Adyen/Model/ConfigurationWebhooks/CardOrderItem.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs b/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs rename to Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs b/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs rename to Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/ContactDetails.cs b/Adyen/Model/ConfigurationWebhooks/ContactDetails.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/ContactDetails.cs rename to Adyen/Model/ConfigurationWebhooks/ContactDetails.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/DeliveryAddress.cs b/Adyen/Model/ConfigurationWebhooks/DeliveryAddress.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/DeliveryAddress.cs rename to Adyen/Model/ConfigurationWebhooks/DeliveryAddress.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/DeliveryContact.cs b/Adyen/Model/ConfigurationWebhooks/DeliveryContact.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/DeliveryContact.cs rename to Adyen/Model/ConfigurationWebhooks/DeliveryContact.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Device.cs b/Adyen/Model/ConfigurationWebhooks/Device.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Device.cs rename to Adyen/Model/ConfigurationWebhooks/Device.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Expiry.cs b/Adyen/Model/ConfigurationWebhooks/Expiry.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Expiry.cs rename to Adyen/Model/ConfigurationWebhooks/Expiry.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/IbanAccountIdentification.cs b/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/IbanAccountIdentification.cs rename to Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Name.cs b/Adyen/Model/ConfigurationWebhooks/Name.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Name.cs rename to Adyen/Model/ConfigurationWebhooks/Name.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs b/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs rename to Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs b/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs rename to Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs b/Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs rename to Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/PaymentInstrument.cs b/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/PaymentInstrument.cs rename to Adyen/Model/ConfigurationWebhooks/PaymentInstrument.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs b/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs rename to Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs b/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs rename to Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs b/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs rename to Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Phone.cs b/Adyen/Model/ConfigurationWebhooks/Phone.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Phone.cs rename to Adyen/Model/ConfigurationWebhooks/Phone.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/PhoneNumber.cs b/Adyen/Model/ConfigurationWebhooks/PhoneNumber.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/PhoneNumber.cs rename to Adyen/Model/ConfigurationWebhooks/PhoneNumber.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs b/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs rename to Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/RemediatingAction.cs b/Adyen/Model/ConfigurationWebhooks/RemediatingAction.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/RemediatingAction.cs rename to Adyen/Model/ConfigurationWebhooks/RemediatingAction.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Resource.cs b/Adyen/Model/ConfigurationWebhooks/Resource.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Resource.cs rename to Adyen/Model/ConfigurationWebhooks/Resource.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs b/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs rename to Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs b/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs rename to Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationV2.cs b/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationV2.cs rename to Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/SweepCounterparty.cs b/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/SweepCounterparty.cs rename to Adyen/Model/ConfigurationWebhooks/SweepCounterparty.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/SweepSchedule.cs b/Adyen/Model/ConfigurationWebhooks/SweepSchedule.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/SweepSchedule.cs rename to Adyen/Model/ConfigurationWebhooks/SweepSchedule.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/TokenAuthentication.cs b/Adyen/Model/ConfigurationWebhooks/TokenAuthentication.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/TokenAuthentication.cs rename to Adyen/Model/ConfigurationWebhooks/TokenAuthentication.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/ValidationFacts.cs b/Adyen/Model/ConfigurationWebhooks/ValidationFacts.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/ValidationFacts.cs rename to Adyen/Model/ConfigurationWebhooks/ValidationFacts.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/VerificationDeadline.cs b/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/VerificationDeadline.cs rename to Adyen/Model/ConfigurationWebhooks/VerificationDeadline.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/VerificationError.cs b/Adyen/Model/ConfigurationWebhooks/VerificationError.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/VerificationError.cs rename to Adyen/Model/ConfigurationWebhooks/VerificationError.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs b/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs rename to Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Wallet.cs b/Adyen/Model/ConfigurationWebhooks/Wallet.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Wallet.cs rename to Adyen/Model/ConfigurationWebhooks/Wallet.cs diff --git a/Adyen/src/Model/DataProtection/AbstractOpenAPISchema.cs b/Adyen/Model/DataProtection/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/DataProtection/AbstractOpenAPISchema.cs rename to Adyen/Model/DataProtection/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/DataProtection/ServiceError.cs b/Adyen/Model/DataProtection/ServiceError.cs similarity index 100% rename from Adyen/src/Model/DataProtection/ServiceError.cs rename to Adyen/Model/DataProtection/ServiceError.cs diff --git a/Adyen/src/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs b/Adyen/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs similarity index 100% rename from Adyen/src/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs rename to Adyen/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs diff --git a/Adyen/src/Model/DataProtection/SubjectErasureResponse.cs b/Adyen/Model/DataProtection/SubjectErasureResponse.cs similarity index 100% rename from Adyen/src/Model/DataProtection/SubjectErasureResponse.cs rename to Adyen/Model/DataProtection/SubjectErasureResponse.cs diff --git a/Adyen/src/Model/DisputeWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/DisputeWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/DisputeWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/DisputeWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/DisputeWebhooks/Amount.cs b/Adyen/Model/DisputeWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/DisputeWebhooks/Amount.cs rename to Adyen/Model/DisputeWebhooks/Amount.cs diff --git a/Adyen/src/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/src/Model/DisputeWebhooks/DisputeEventNotification.cs b/Adyen/Model/DisputeWebhooks/DisputeEventNotification.cs similarity index 100% rename from Adyen/src/Model/DisputeWebhooks/DisputeEventNotification.cs rename to Adyen/Model/DisputeWebhooks/DisputeEventNotification.cs diff --git a/Adyen/src/Model/DisputeWebhooks/DisputeNotificationRequest.cs b/Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/DisputeWebhooks/DisputeNotificationRequest.cs rename to Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.cs diff --git a/Adyen/src/Model/Disputes/AbstractOpenAPISchema.cs b/Adyen/Model/Disputes/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Disputes/AbstractOpenAPISchema.cs rename to Adyen/Model/Disputes/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Disputes/AcceptDisputeRequest.cs b/Adyen/Model/Disputes/AcceptDisputeRequest.cs similarity index 100% rename from Adyen/src/Model/Disputes/AcceptDisputeRequest.cs rename to Adyen/Model/Disputes/AcceptDisputeRequest.cs diff --git a/Adyen/src/Model/Disputes/AcceptDisputeResponse.cs b/Adyen/Model/Disputes/AcceptDisputeResponse.cs similarity index 100% rename from Adyen/src/Model/Disputes/AcceptDisputeResponse.cs rename to Adyen/Model/Disputes/AcceptDisputeResponse.cs diff --git a/Adyen/src/Model/Disputes/DefendDisputeRequest.cs b/Adyen/Model/Disputes/DefendDisputeRequest.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefendDisputeRequest.cs rename to Adyen/Model/Disputes/DefendDisputeRequest.cs diff --git a/Adyen/src/Model/Disputes/DefendDisputeResponse.cs b/Adyen/Model/Disputes/DefendDisputeResponse.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefendDisputeResponse.cs rename to Adyen/Model/Disputes/DefendDisputeResponse.cs diff --git a/Adyen/src/Model/Disputes/DefenseDocument.cs b/Adyen/Model/Disputes/DefenseDocument.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefenseDocument.cs rename to Adyen/Model/Disputes/DefenseDocument.cs diff --git a/Adyen/src/Model/Disputes/DefenseDocumentType.cs b/Adyen/Model/Disputes/DefenseDocumentType.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefenseDocumentType.cs rename to Adyen/Model/Disputes/DefenseDocumentType.cs diff --git a/Adyen/src/Model/Disputes/DefenseReason.cs b/Adyen/Model/Disputes/DefenseReason.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefenseReason.cs rename to Adyen/Model/Disputes/DefenseReason.cs diff --git a/Adyen/src/Model/Disputes/DefenseReasonsRequest.cs b/Adyen/Model/Disputes/DefenseReasonsRequest.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefenseReasonsRequest.cs rename to Adyen/Model/Disputes/DefenseReasonsRequest.cs diff --git a/Adyen/src/Model/Disputes/DefenseReasonsResponse.cs b/Adyen/Model/Disputes/DefenseReasonsResponse.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefenseReasonsResponse.cs rename to Adyen/Model/Disputes/DefenseReasonsResponse.cs diff --git a/Adyen/src/Model/Disputes/DeleteDefenseDocumentRequest.cs b/Adyen/Model/Disputes/DeleteDefenseDocumentRequest.cs similarity index 100% rename from Adyen/src/Model/Disputes/DeleteDefenseDocumentRequest.cs rename to Adyen/Model/Disputes/DeleteDefenseDocumentRequest.cs diff --git a/Adyen/src/Model/Disputes/DeleteDefenseDocumentResponse.cs b/Adyen/Model/Disputes/DeleteDefenseDocumentResponse.cs similarity index 100% rename from Adyen/src/Model/Disputes/DeleteDefenseDocumentResponse.cs rename to Adyen/Model/Disputes/DeleteDefenseDocumentResponse.cs diff --git a/Adyen/src/Model/Disputes/DisputeServiceResult.cs b/Adyen/Model/Disputes/DisputeServiceResult.cs similarity index 100% rename from Adyen/src/Model/Disputes/DisputeServiceResult.cs rename to Adyen/Model/Disputes/DisputeServiceResult.cs diff --git a/Adyen/src/Model/Disputes/ServiceError.cs b/Adyen/Model/Disputes/ServiceError.cs similarity index 100% rename from Adyen/src/Model/Disputes/ServiceError.cs rename to Adyen/Model/Disputes/ServiceError.cs diff --git a/Adyen/src/Model/Disputes/SupplyDefenseDocumentRequest.cs b/Adyen/Model/Disputes/SupplyDefenseDocumentRequest.cs similarity index 100% rename from Adyen/src/Model/Disputes/SupplyDefenseDocumentRequest.cs rename to Adyen/Model/Disputes/SupplyDefenseDocumentRequest.cs diff --git a/Adyen/src/Model/Disputes/SupplyDefenseDocumentResponse.cs b/Adyen/Model/Disputes/SupplyDefenseDocumentResponse.cs similarity index 100% rename from Adyen/src/Model/Disputes/SupplyDefenseDocumentResponse.cs rename to Adyen/Model/Disputes/SupplyDefenseDocumentResponse.cs diff --git a/Adyen/src/Model/Environment.cs b/Adyen/Model/Environment.cs similarity index 100% rename from Adyen/src/Model/Environment.cs rename to Adyen/Model/Environment.cs diff --git a/Adyen/src/Model/LegalEntityManagement/AULocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/AULocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/AULocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/AbstractOpenAPISchema.cs b/Adyen/Model/LegalEntityManagement/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/AbstractOpenAPISchema.cs rename to Adyen/Model/LegalEntityManagement/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs b/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs rename to Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs diff --git a/Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs b/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs rename to Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/AdditionalBankIdentification.cs b/Adyen/Model/LegalEntityManagement/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/AdditionalBankIdentification.cs rename to Adyen/Model/LegalEntityManagement/AdditionalBankIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Address.cs b/Adyen/Model/LegalEntityManagement/Address.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Address.cs rename to Adyen/Model/LegalEntityManagement/Address.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Amount.cs b/Adyen/Model/LegalEntityManagement/Amount.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Amount.cs rename to Adyen/Model/LegalEntityManagement/Amount.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Attachment.cs b/Adyen/Model/LegalEntityManagement/Attachment.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Attachment.cs rename to Adyen/Model/LegalEntityManagement/Attachment.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BankAccountInfo.cs b/Adyen/Model/LegalEntityManagement/BankAccountInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BankAccountInfo.cs rename to Adyen/Model/LegalEntityManagement/BankAccountInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BirthData.cs b/Adyen/Model/LegalEntityManagement/BirthData.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BirthData.cs rename to Adyen/Model/LegalEntityManagement/BirthData.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BusinessLine.cs b/Adyen/Model/LegalEntityManagement/BusinessLine.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BusinessLine.cs rename to Adyen/Model/LegalEntityManagement/BusinessLine.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BusinessLineInfo.cs b/Adyen/Model/LegalEntityManagement/BusinessLineInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BusinessLineInfo.cs rename to Adyen/Model/LegalEntityManagement/BusinessLineInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs b/Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs rename to Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BusinessLines.cs b/Adyen/Model/LegalEntityManagement/BusinessLines.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BusinessLines.cs rename to Adyen/Model/LegalEntityManagement/BusinessLines.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CALocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CALocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/CALocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CZLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CZLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/CZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CalculatePciStatusRequest.cs b/Adyen/Model/LegalEntityManagement/CalculatePciStatusRequest.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CalculatePciStatusRequest.cs rename to Adyen/Model/LegalEntityManagement/CalculatePciStatusRequest.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CalculatePciStatusResponse.cs b/Adyen/Model/LegalEntityManagement/CalculatePciStatusResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CalculatePciStatusResponse.cs rename to Adyen/Model/LegalEntityManagement/CalculatePciStatusResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs b/Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs rename to Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CapabilityProblem.cs b/Adyen/Model/LegalEntityManagement/CapabilityProblem.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CapabilityProblem.cs rename to Adyen/Model/LegalEntityManagement/CapabilityProblem.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntity.cs b/Adyen/Model/LegalEntityManagement/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntity.cs rename to Adyen/Model/LegalEntityManagement/CapabilityProblemEntity.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs b/Adyen/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs rename to Adyen/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CapabilitySettings.cs b/Adyen/Model/LegalEntityManagement/CapabilitySettings.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CapabilitySettings.cs rename to Adyen/Model/LegalEntityManagement/CapabilitySettings.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs b/Adyen/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs rename to Adyen/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/DKLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/DKLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/DKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs b/Adyen/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs rename to Adyen/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Document.cs b/Adyen/Model/LegalEntityManagement/Document.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Document.cs rename to Adyen/Model/LegalEntityManagement/Document.cs diff --git a/Adyen/src/Model/LegalEntityManagement/DocumentPage.cs b/Adyen/Model/LegalEntityManagement/DocumentPage.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/DocumentPage.cs rename to Adyen/Model/LegalEntityManagement/DocumentPage.cs diff --git a/Adyen/src/Model/LegalEntityManagement/DocumentReference.cs b/Adyen/Model/LegalEntityManagement/DocumentReference.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/DocumentReference.cs rename to Adyen/Model/LegalEntityManagement/DocumentReference.cs diff --git a/Adyen/src/Model/LegalEntityManagement/EntityReference.cs b/Adyen/Model/LegalEntityManagement/EntityReference.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/EntityReference.cs rename to Adyen/Model/LegalEntityManagement/EntityReference.cs diff --git a/Adyen/src/Model/LegalEntityManagement/FinancialReport.cs b/Adyen/Model/LegalEntityManagement/FinancialReport.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/FinancialReport.cs rename to Adyen/Model/LegalEntityManagement/FinancialReport.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs b/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs rename to Adyen/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs b/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs rename to Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs b/Adyen/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs rename to Adyen/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs b/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs rename to Adyen/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs b/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs rename to Adyen/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs b/Adyen/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs rename to Adyen/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs b/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs rename to Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs b/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs rename to Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/HKLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/HKLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/HKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/HULocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/HULocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/HULocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/IbanAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/IbanAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/IbanAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/IbanAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/IdentificationData.cs b/Adyen/Model/LegalEntityManagement/IdentificationData.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/IdentificationData.cs rename to Adyen/Model/LegalEntityManagement/IdentificationData.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Individual.cs b/Adyen/Model/LegalEntityManagement/Individual.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Individual.cs rename to Adyen/Model/LegalEntityManagement/Individual.cs diff --git a/Adyen/src/Model/LegalEntityManagement/LegalEntity.cs b/Adyen/Model/LegalEntityManagement/LegalEntity.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/LegalEntity.cs rename to Adyen/Model/LegalEntityManagement/LegalEntity.cs diff --git a/Adyen/src/Model/LegalEntityManagement/LegalEntityAssociation.cs b/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/LegalEntityAssociation.cs rename to Adyen/Model/LegalEntityManagement/LegalEntityAssociation.cs diff --git a/Adyen/src/Model/LegalEntityManagement/LegalEntityCapability.cs b/Adyen/Model/LegalEntityManagement/LegalEntityCapability.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/LegalEntityCapability.cs rename to Adyen/Model/LegalEntityManagement/LegalEntityCapability.cs diff --git a/Adyen/src/Model/LegalEntityManagement/LegalEntityInfo.cs b/Adyen/Model/LegalEntityManagement/LegalEntityInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/LegalEntityInfo.cs rename to Adyen/Model/LegalEntityManagement/LegalEntityInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs b/Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs rename to Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs diff --git a/Adyen/src/Model/LegalEntityManagement/NOLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/NOLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/NOLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/NZLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/NZLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/NZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Name.cs b/Adyen/Model/LegalEntityManagement/Name.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Name.cs rename to Adyen/Model/LegalEntityManagement/Name.cs diff --git a/Adyen/src/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/OnboardingLink.cs b/Adyen/Model/LegalEntityManagement/OnboardingLink.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/OnboardingLink.cs rename to Adyen/Model/LegalEntityManagement/OnboardingLink.cs diff --git a/Adyen/src/Model/LegalEntityManagement/OnboardingLinkInfo.cs b/Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/OnboardingLinkInfo.cs rename to Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/OnboardingLinkSettings.cs b/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/OnboardingLinkSettings.cs rename to Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.cs diff --git a/Adyen/src/Model/LegalEntityManagement/OnboardingTheme.cs b/Adyen/Model/LegalEntityManagement/OnboardingTheme.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/OnboardingTheme.cs rename to Adyen/Model/LegalEntityManagement/OnboardingTheme.cs diff --git a/Adyen/src/Model/LegalEntityManagement/OnboardingThemes.cs b/Adyen/Model/LegalEntityManagement/OnboardingThemes.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/OnboardingThemes.cs rename to Adyen/Model/LegalEntityManagement/OnboardingThemes.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Organization.cs b/Adyen/Model/LegalEntityManagement/Organization.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Organization.cs rename to Adyen/Model/LegalEntityManagement/Organization.cs diff --git a/Adyen/src/Model/LegalEntityManagement/OwnerEntity.cs b/Adyen/Model/LegalEntityManagement/OwnerEntity.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/OwnerEntity.cs rename to Adyen/Model/LegalEntityManagement/OwnerEntity.cs diff --git a/Adyen/src/Model/LegalEntityManagement/PLLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/PLLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/PLLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/PciDocumentInfo.cs b/Adyen/Model/LegalEntityManagement/PciDocumentInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/PciDocumentInfo.cs rename to Adyen/Model/LegalEntityManagement/PciDocumentInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/PciSigningRequest.cs b/Adyen/Model/LegalEntityManagement/PciSigningRequest.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/PciSigningRequest.cs rename to Adyen/Model/LegalEntityManagement/PciSigningRequest.cs diff --git a/Adyen/src/Model/LegalEntityManagement/PciSigningResponse.cs b/Adyen/Model/LegalEntityManagement/PciSigningResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/PciSigningResponse.cs rename to Adyen/Model/LegalEntityManagement/PciSigningResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/PhoneNumber.cs b/Adyen/Model/LegalEntityManagement/PhoneNumber.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/PhoneNumber.cs rename to Adyen/Model/LegalEntityManagement/PhoneNumber.cs diff --git a/Adyen/src/Model/LegalEntityManagement/RemediatingAction.cs b/Adyen/Model/LegalEntityManagement/RemediatingAction.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/RemediatingAction.cs rename to Adyen/Model/LegalEntityManagement/RemediatingAction.cs diff --git a/Adyen/src/Model/LegalEntityManagement/SELocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/SELocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/SELocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/SGLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/SGLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/SGLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/ServiceError.cs b/Adyen/Model/LegalEntityManagement/ServiceError.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/ServiceError.cs rename to Adyen/Model/LegalEntityManagement/ServiceError.cs diff --git a/Adyen/src/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs b/Adyen/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs rename to Adyen/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs diff --git a/Adyen/src/Model/LegalEntityManagement/SoleProprietorship.cs b/Adyen/Model/LegalEntityManagement/SoleProprietorship.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/SoleProprietorship.cs rename to Adyen/Model/LegalEntityManagement/SoleProprietorship.cs diff --git a/Adyen/src/Model/LegalEntityManagement/SourceOfFunds.cs b/Adyen/Model/LegalEntityManagement/SourceOfFunds.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/SourceOfFunds.cs rename to Adyen/Model/LegalEntityManagement/SourceOfFunds.cs diff --git a/Adyen/src/Model/LegalEntityManagement/StockData.cs b/Adyen/Model/LegalEntityManagement/StockData.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/StockData.cs rename to Adyen/Model/LegalEntityManagement/StockData.cs diff --git a/Adyen/src/Model/LegalEntityManagement/SupportingEntityCapability.cs b/Adyen/Model/LegalEntityManagement/SupportingEntityCapability.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/SupportingEntityCapability.cs rename to Adyen/Model/LegalEntityManagement/SupportingEntityCapability.cs diff --git a/Adyen/src/Model/LegalEntityManagement/TaxInformation.cs b/Adyen/Model/LegalEntityManagement/TaxInformation.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/TaxInformation.cs rename to Adyen/Model/LegalEntityManagement/TaxInformation.cs diff --git a/Adyen/src/Model/LegalEntityManagement/TaxReportingClassification.cs b/Adyen/Model/LegalEntityManagement/TaxReportingClassification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/TaxReportingClassification.cs rename to Adyen/Model/LegalEntityManagement/TaxReportingClassification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs b/Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs rename to Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/TransferInstrument.cs b/Adyen/Model/LegalEntityManagement/TransferInstrument.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/TransferInstrument.cs rename to Adyen/Model/LegalEntityManagement/TransferInstrument.cs diff --git a/Adyen/src/Model/LegalEntityManagement/TransferInstrumentInfo.cs b/Adyen/Model/LegalEntityManagement/TransferInstrumentInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/TransferInstrumentInfo.cs rename to Adyen/Model/LegalEntityManagement/TransferInstrumentInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/TransferInstrumentReference.cs b/Adyen/Model/LegalEntityManagement/TransferInstrumentReference.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/TransferInstrumentReference.cs rename to Adyen/Model/LegalEntityManagement/TransferInstrumentReference.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Trust.cs b/Adyen/Model/LegalEntityManagement/Trust.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Trust.cs rename to Adyen/Model/LegalEntityManagement/Trust.cs diff --git a/Adyen/src/Model/LegalEntityManagement/UKLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/UKLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/UKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/USLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/USLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/USLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/UndefinedBeneficiary.cs b/Adyen/Model/LegalEntityManagement/UndefinedBeneficiary.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/UndefinedBeneficiary.cs rename to Adyen/Model/LegalEntityManagement/UndefinedBeneficiary.cs diff --git a/Adyen/src/Model/LegalEntityManagement/UnincorporatedPartnership.cs b/Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/UnincorporatedPartnership.cs rename to Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.cs diff --git a/Adyen/src/Model/LegalEntityManagement/VerificationDeadline.cs b/Adyen/Model/LegalEntityManagement/VerificationDeadline.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/VerificationDeadline.cs rename to Adyen/Model/LegalEntityManagement/VerificationDeadline.cs diff --git a/Adyen/src/Model/LegalEntityManagement/VerificationError.cs b/Adyen/Model/LegalEntityManagement/VerificationError.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/VerificationError.cs rename to Adyen/Model/LegalEntityManagement/VerificationError.cs diff --git a/Adyen/src/Model/LegalEntityManagement/VerificationErrorRecursive.cs b/Adyen/Model/LegalEntityManagement/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/VerificationErrorRecursive.cs rename to Adyen/Model/LegalEntityManagement/VerificationErrorRecursive.cs diff --git a/Adyen/src/Model/LegalEntityManagement/VerificationErrors.cs b/Adyen/Model/LegalEntityManagement/VerificationErrors.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/VerificationErrors.cs rename to Adyen/Model/LegalEntityManagement/VerificationErrors.cs diff --git a/Adyen/src/Model/LegalEntityManagement/WebData.cs b/Adyen/Model/LegalEntityManagement/WebData.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/WebData.cs rename to Adyen/Model/LegalEntityManagement/WebData.cs diff --git a/Adyen/src/Model/LegalEntityManagement/WebDataExemption.cs b/Adyen/Model/LegalEntityManagement/WebDataExemption.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/WebDataExemption.cs rename to Adyen/Model/LegalEntityManagement/WebDataExemption.cs diff --git a/Adyen/src/Model/Management/AbstractOpenAPISchema.cs b/Adyen/Model/Management/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Management/AbstractOpenAPISchema.cs rename to Adyen/Model/Management/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Management/AccelInfo.cs b/Adyen/Model/Management/AccelInfo.cs similarity index 100% rename from Adyen/src/Model/Management/AccelInfo.cs rename to Adyen/Model/Management/AccelInfo.cs diff --git a/Adyen/src/Model/Management/AdditionalCommission.cs b/Adyen/Model/Management/AdditionalCommission.cs similarity index 100% rename from Adyen/src/Model/Management/AdditionalCommission.cs rename to Adyen/Model/Management/AdditionalCommission.cs diff --git a/Adyen/src/Model/Management/AdditionalSettings.cs b/Adyen/Model/Management/AdditionalSettings.cs similarity index 100% rename from Adyen/src/Model/Management/AdditionalSettings.cs rename to Adyen/Model/Management/AdditionalSettings.cs diff --git a/Adyen/src/Model/Management/AdditionalSettingsResponse.cs b/Adyen/Model/Management/AdditionalSettingsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/AdditionalSettingsResponse.cs rename to Adyen/Model/Management/AdditionalSettingsResponse.cs diff --git a/Adyen/src/Model/Management/Address.cs b/Adyen/Model/Management/Address.cs similarity index 100% rename from Adyen/src/Model/Management/Address.cs rename to Adyen/Model/Management/Address.cs diff --git a/Adyen/src/Model/Management/AffirmInfo.cs b/Adyen/Model/Management/AffirmInfo.cs similarity index 100% rename from Adyen/src/Model/Management/AffirmInfo.cs rename to Adyen/Model/Management/AffirmInfo.cs diff --git a/Adyen/src/Model/Management/AfterpayTouchInfo.cs b/Adyen/Model/Management/AfterpayTouchInfo.cs similarity index 100% rename from Adyen/src/Model/Management/AfterpayTouchInfo.cs rename to Adyen/Model/Management/AfterpayTouchInfo.cs diff --git a/Adyen/src/Model/Management/AllowedOrigin.cs b/Adyen/Model/Management/AllowedOrigin.cs similarity index 100% rename from Adyen/src/Model/Management/AllowedOrigin.cs rename to Adyen/Model/Management/AllowedOrigin.cs diff --git a/Adyen/src/Model/Management/AllowedOriginsResponse.cs b/Adyen/Model/Management/AllowedOriginsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/AllowedOriginsResponse.cs rename to Adyen/Model/Management/AllowedOriginsResponse.cs diff --git a/Adyen/src/Model/Management/AmexInfo.cs b/Adyen/Model/Management/AmexInfo.cs similarity index 100% rename from Adyen/src/Model/Management/AmexInfo.cs rename to Adyen/Model/Management/AmexInfo.cs diff --git a/Adyen/src/Model/Management/Amount.cs b/Adyen/Model/Management/Amount.cs similarity index 100% rename from Adyen/src/Model/Management/Amount.cs rename to Adyen/Model/Management/Amount.cs diff --git a/Adyen/src/Model/Management/AndroidApp.cs b/Adyen/Model/Management/AndroidApp.cs similarity index 100% rename from Adyen/src/Model/Management/AndroidApp.cs rename to Adyen/Model/Management/AndroidApp.cs diff --git a/Adyen/src/Model/Management/AndroidAppError.cs b/Adyen/Model/Management/AndroidAppError.cs similarity index 100% rename from Adyen/src/Model/Management/AndroidAppError.cs rename to Adyen/Model/Management/AndroidAppError.cs diff --git a/Adyen/src/Model/Management/AndroidAppsResponse.cs b/Adyen/Model/Management/AndroidAppsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/AndroidAppsResponse.cs rename to Adyen/Model/Management/AndroidAppsResponse.cs diff --git a/Adyen/src/Model/Management/AndroidCertificate.cs b/Adyen/Model/Management/AndroidCertificate.cs similarity index 100% rename from Adyen/src/Model/Management/AndroidCertificate.cs rename to Adyen/Model/Management/AndroidCertificate.cs diff --git a/Adyen/src/Model/Management/AndroidCertificatesResponse.cs b/Adyen/Model/Management/AndroidCertificatesResponse.cs similarity index 100% rename from Adyen/src/Model/Management/AndroidCertificatesResponse.cs rename to Adyen/Model/Management/AndroidCertificatesResponse.cs diff --git a/Adyen/src/Model/Management/ApiCredential.cs b/Adyen/Model/Management/ApiCredential.cs similarity index 100% rename from Adyen/src/Model/Management/ApiCredential.cs rename to Adyen/Model/Management/ApiCredential.cs diff --git a/Adyen/src/Model/Management/ApiCredentialLinks.cs b/Adyen/Model/Management/ApiCredentialLinks.cs similarity index 100% rename from Adyen/src/Model/Management/ApiCredentialLinks.cs rename to Adyen/Model/Management/ApiCredentialLinks.cs diff --git a/Adyen/src/Model/Management/ApplePayInfo.cs b/Adyen/Model/Management/ApplePayInfo.cs similarity index 100% rename from Adyen/src/Model/Management/ApplePayInfo.cs rename to Adyen/Model/Management/ApplePayInfo.cs diff --git a/Adyen/src/Model/Management/BcmcInfo.cs b/Adyen/Model/Management/BcmcInfo.cs similarity index 100% rename from Adyen/src/Model/Management/BcmcInfo.cs rename to Adyen/Model/Management/BcmcInfo.cs diff --git a/Adyen/src/Model/Management/BillingEntitiesResponse.cs b/Adyen/Model/Management/BillingEntitiesResponse.cs similarity index 100% rename from Adyen/src/Model/Management/BillingEntitiesResponse.cs rename to Adyen/Model/Management/BillingEntitiesResponse.cs diff --git a/Adyen/src/Model/Management/BillingEntity.cs b/Adyen/Model/Management/BillingEntity.cs similarity index 100% rename from Adyen/src/Model/Management/BillingEntity.cs rename to Adyen/Model/Management/BillingEntity.cs diff --git a/Adyen/src/Model/Management/CardholderReceipt.cs b/Adyen/Model/Management/CardholderReceipt.cs similarity index 100% rename from Adyen/src/Model/Management/CardholderReceipt.cs rename to Adyen/Model/Management/CardholderReceipt.cs diff --git a/Adyen/src/Model/Management/CartesBancairesInfo.cs b/Adyen/Model/Management/CartesBancairesInfo.cs similarity index 100% rename from Adyen/src/Model/Management/CartesBancairesInfo.cs rename to Adyen/Model/Management/CartesBancairesInfo.cs diff --git a/Adyen/src/Model/Management/ClearpayInfo.cs b/Adyen/Model/Management/ClearpayInfo.cs similarity index 100% rename from Adyen/src/Model/Management/ClearpayInfo.cs rename to Adyen/Model/Management/ClearpayInfo.cs diff --git a/Adyen/src/Model/Management/Commission.cs b/Adyen/Model/Management/Commission.cs similarity index 100% rename from Adyen/src/Model/Management/Commission.cs rename to Adyen/Model/Management/Commission.cs diff --git a/Adyen/src/Model/Management/Company.cs b/Adyen/Model/Management/Company.cs similarity index 100% rename from Adyen/src/Model/Management/Company.cs rename to Adyen/Model/Management/Company.cs diff --git a/Adyen/src/Model/Management/CompanyApiCredential.cs b/Adyen/Model/Management/CompanyApiCredential.cs similarity index 100% rename from Adyen/src/Model/Management/CompanyApiCredential.cs rename to Adyen/Model/Management/CompanyApiCredential.cs diff --git a/Adyen/src/Model/Management/CompanyLinks.cs b/Adyen/Model/Management/CompanyLinks.cs similarity index 100% rename from Adyen/src/Model/Management/CompanyLinks.cs rename to Adyen/Model/Management/CompanyLinks.cs diff --git a/Adyen/src/Model/Management/CompanyUser.cs b/Adyen/Model/Management/CompanyUser.cs similarity index 100% rename from Adyen/src/Model/Management/CompanyUser.cs rename to Adyen/Model/Management/CompanyUser.cs diff --git a/Adyen/src/Model/Management/Connectivity.cs b/Adyen/Model/Management/Connectivity.cs similarity index 100% rename from Adyen/src/Model/Management/Connectivity.cs rename to Adyen/Model/Management/Connectivity.cs diff --git a/Adyen/src/Model/Management/Contact.cs b/Adyen/Model/Management/Contact.cs similarity index 100% rename from Adyen/src/Model/Management/Contact.cs rename to Adyen/Model/Management/Contact.cs diff --git a/Adyen/src/Model/Management/CreateAllowedOriginRequest.cs b/Adyen/Model/Management/CreateAllowedOriginRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateAllowedOriginRequest.cs rename to Adyen/Model/Management/CreateAllowedOriginRequest.cs diff --git a/Adyen/src/Model/Management/CreateApiCredentialResponse.cs b/Adyen/Model/Management/CreateApiCredentialResponse.cs similarity index 100% rename from Adyen/src/Model/Management/CreateApiCredentialResponse.cs rename to Adyen/Model/Management/CreateApiCredentialResponse.cs diff --git a/Adyen/src/Model/Management/CreateCompanyApiCredentialRequest.cs b/Adyen/Model/Management/CreateCompanyApiCredentialRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateCompanyApiCredentialRequest.cs rename to Adyen/Model/Management/CreateCompanyApiCredentialRequest.cs diff --git a/Adyen/src/Model/Management/CreateCompanyApiCredentialResponse.cs b/Adyen/Model/Management/CreateCompanyApiCredentialResponse.cs similarity index 100% rename from Adyen/src/Model/Management/CreateCompanyApiCredentialResponse.cs rename to Adyen/Model/Management/CreateCompanyApiCredentialResponse.cs diff --git a/Adyen/src/Model/Management/CreateCompanyUserRequest.cs b/Adyen/Model/Management/CreateCompanyUserRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateCompanyUserRequest.cs rename to Adyen/Model/Management/CreateCompanyUserRequest.cs diff --git a/Adyen/src/Model/Management/CreateCompanyUserResponse.cs b/Adyen/Model/Management/CreateCompanyUserResponse.cs similarity index 100% rename from Adyen/src/Model/Management/CreateCompanyUserResponse.cs rename to Adyen/Model/Management/CreateCompanyUserResponse.cs diff --git a/Adyen/src/Model/Management/CreateCompanyWebhookRequest.cs b/Adyen/Model/Management/CreateCompanyWebhookRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateCompanyWebhookRequest.cs rename to Adyen/Model/Management/CreateCompanyWebhookRequest.cs diff --git a/Adyen/src/Model/Management/CreateMerchantApiCredentialRequest.cs b/Adyen/Model/Management/CreateMerchantApiCredentialRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateMerchantApiCredentialRequest.cs rename to Adyen/Model/Management/CreateMerchantApiCredentialRequest.cs diff --git a/Adyen/src/Model/Management/CreateMerchantRequest.cs b/Adyen/Model/Management/CreateMerchantRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateMerchantRequest.cs rename to Adyen/Model/Management/CreateMerchantRequest.cs diff --git a/Adyen/src/Model/Management/CreateMerchantResponse.cs b/Adyen/Model/Management/CreateMerchantResponse.cs similarity index 100% rename from Adyen/src/Model/Management/CreateMerchantResponse.cs rename to Adyen/Model/Management/CreateMerchantResponse.cs diff --git a/Adyen/src/Model/Management/CreateMerchantUserRequest.cs b/Adyen/Model/Management/CreateMerchantUserRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateMerchantUserRequest.cs rename to Adyen/Model/Management/CreateMerchantUserRequest.cs diff --git a/Adyen/src/Model/Management/CreateMerchantWebhookRequest.cs b/Adyen/Model/Management/CreateMerchantWebhookRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateMerchantWebhookRequest.cs rename to Adyen/Model/Management/CreateMerchantWebhookRequest.cs diff --git a/Adyen/src/Model/Management/CreateUserResponse.cs b/Adyen/Model/Management/CreateUserResponse.cs similarity index 100% rename from Adyen/src/Model/Management/CreateUserResponse.cs rename to Adyen/Model/Management/CreateUserResponse.cs diff --git a/Adyen/src/Model/Management/Currency.cs b/Adyen/Model/Management/Currency.cs similarity index 100% rename from Adyen/src/Model/Management/Currency.cs rename to Adyen/Model/Management/Currency.cs diff --git a/Adyen/src/Model/Management/CustomNotification.cs b/Adyen/Model/Management/CustomNotification.cs similarity index 100% rename from Adyen/src/Model/Management/CustomNotification.cs rename to Adyen/Model/Management/CustomNotification.cs diff --git a/Adyen/src/Model/Management/DataCenter.cs b/Adyen/Model/Management/DataCenter.cs similarity index 100% rename from Adyen/src/Model/Management/DataCenter.cs rename to Adyen/Model/Management/DataCenter.cs diff --git a/Adyen/src/Model/Management/DinersInfo.cs b/Adyen/Model/Management/DinersInfo.cs similarity index 100% rename from Adyen/src/Model/Management/DinersInfo.cs rename to Adyen/Model/Management/DinersInfo.cs diff --git a/Adyen/src/Model/Management/EventUrl.cs b/Adyen/Model/Management/EventUrl.cs similarity index 100% rename from Adyen/src/Model/Management/EventUrl.cs rename to Adyen/Model/Management/EventUrl.cs diff --git a/Adyen/src/Model/Management/ExternalTerminalAction.cs b/Adyen/Model/Management/ExternalTerminalAction.cs similarity index 100% rename from Adyen/src/Model/Management/ExternalTerminalAction.cs rename to Adyen/Model/Management/ExternalTerminalAction.cs diff --git a/Adyen/src/Model/Management/File.cs b/Adyen/Model/Management/File.cs similarity index 100% rename from Adyen/src/Model/Management/File.cs rename to Adyen/Model/Management/File.cs diff --git a/Adyen/src/Model/Management/GenerateApiKeyResponse.cs b/Adyen/Model/Management/GenerateApiKeyResponse.cs similarity index 100% rename from Adyen/src/Model/Management/GenerateApiKeyResponse.cs rename to Adyen/Model/Management/GenerateApiKeyResponse.cs diff --git a/Adyen/src/Model/Management/GenerateClientKeyResponse.cs b/Adyen/Model/Management/GenerateClientKeyResponse.cs similarity index 100% rename from Adyen/src/Model/Management/GenerateClientKeyResponse.cs rename to Adyen/Model/Management/GenerateClientKeyResponse.cs diff --git a/Adyen/src/Model/Management/GenerateHmacKeyResponse.cs b/Adyen/Model/Management/GenerateHmacKeyResponse.cs similarity index 100% rename from Adyen/src/Model/Management/GenerateHmacKeyResponse.cs rename to Adyen/Model/Management/GenerateHmacKeyResponse.cs diff --git a/Adyen/src/Model/Management/GenericPmWithTdiInfo.cs b/Adyen/Model/Management/GenericPmWithTdiInfo.cs similarity index 100% rename from Adyen/src/Model/Management/GenericPmWithTdiInfo.cs rename to Adyen/Model/Management/GenericPmWithTdiInfo.cs diff --git a/Adyen/src/Model/Management/GiroPayInfo.cs b/Adyen/Model/Management/GiroPayInfo.cs similarity index 100% rename from Adyen/src/Model/Management/GiroPayInfo.cs rename to Adyen/Model/Management/GiroPayInfo.cs diff --git a/Adyen/src/Model/Management/GooglePayInfo.cs b/Adyen/Model/Management/GooglePayInfo.cs similarity index 100% rename from Adyen/src/Model/Management/GooglePayInfo.cs rename to Adyen/Model/Management/GooglePayInfo.cs diff --git a/Adyen/src/Model/Management/Gratuity.cs b/Adyen/Model/Management/Gratuity.cs similarity index 100% rename from Adyen/src/Model/Management/Gratuity.cs rename to Adyen/Model/Management/Gratuity.cs diff --git a/Adyen/src/Model/Management/Hardware.cs b/Adyen/Model/Management/Hardware.cs similarity index 100% rename from Adyen/src/Model/Management/Hardware.cs rename to Adyen/Model/Management/Hardware.cs diff --git a/Adyen/src/Model/Management/IdName.cs b/Adyen/Model/Management/IdName.cs similarity index 100% rename from Adyen/src/Model/Management/IdName.cs rename to Adyen/Model/Management/IdName.cs diff --git a/Adyen/src/Model/Management/InstallAndroidAppDetails.cs b/Adyen/Model/Management/InstallAndroidAppDetails.cs similarity index 100% rename from Adyen/src/Model/Management/InstallAndroidAppDetails.cs rename to Adyen/Model/Management/InstallAndroidAppDetails.cs diff --git a/Adyen/src/Model/Management/InstallAndroidCertificateDetails.cs b/Adyen/Model/Management/InstallAndroidCertificateDetails.cs similarity index 100% rename from Adyen/src/Model/Management/InstallAndroidCertificateDetails.cs rename to Adyen/Model/Management/InstallAndroidCertificateDetails.cs diff --git a/Adyen/src/Model/Management/InvalidField.cs b/Adyen/Model/Management/InvalidField.cs similarity index 100% rename from Adyen/src/Model/Management/InvalidField.cs rename to Adyen/Model/Management/InvalidField.cs diff --git a/Adyen/src/Model/Management/JCBInfo.cs b/Adyen/Model/Management/JCBInfo.cs similarity index 100% rename from Adyen/src/Model/Management/JCBInfo.cs rename to Adyen/Model/Management/JCBInfo.cs diff --git a/Adyen/src/Model/Management/Key.cs b/Adyen/Model/Management/Key.cs similarity index 100% rename from Adyen/src/Model/Management/Key.cs rename to Adyen/Model/Management/Key.cs diff --git a/Adyen/src/Model/Management/KlarnaInfo.cs b/Adyen/Model/Management/KlarnaInfo.cs similarity index 100% rename from Adyen/src/Model/Management/KlarnaInfo.cs rename to Adyen/Model/Management/KlarnaInfo.cs diff --git a/Adyen/src/Model/Management/Links.cs b/Adyen/Model/Management/Links.cs similarity index 100% rename from Adyen/src/Model/Management/Links.cs rename to Adyen/Model/Management/Links.cs diff --git a/Adyen/src/Model/Management/LinksElement.cs b/Adyen/Model/Management/LinksElement.cs similarity index 100% rename from Adyen/src/Model/Management/LinksElement.cs rename to Adyen/Model/Management/LinksElement.cs diff --git a/Adyen/src/Model/Management/ListCompanyApiCredentialsResponse.cs b/Adyen/Model/Management/ListCompanyApiCredentialsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListCompanyApiCredentialsResponse.cs rename to Adyen/Model/Management/ListCompanyApiCredentialsResponse.cs diff --git a/Adyen/src/Model/Management/ListCompanyResponse.cs b/Adyen/Model/Management/ListCompanyResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListCompanyResponse.cs rename to Adyen/Model/Management/ListCompanyResponse.cs diff --git a/Adyen/src/Model/Management/ListCompanyUsersResponse.cs b/Adyen/Model/Management/ListCompanyUsersResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListCompanyUsersResponse.cs rename to Adyen/Model/Management/ListCompanyUsersResponse.cs diff --git a/Adyen/src/Model/Management/ListExternalTerminalActionsResponse.cs b/Adyen/Model/Management/ListExternalTerminalActionsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListExternalTerminalActionsResponse.cs rename to Adyen/Model/Management/ListExternalTerminalActionsResponse.cs diff --git a/Adyen/src/Model/Management/ListMerchantApiCredentialsResponse.cs b/Adyen/Model/Management/ListMerchantApiCredentialsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListMerchantApiCredentialsResponse.cs rename to Adyen/Model/Management/ListMerchantApiCredentialsResponse.cs diff --git a/Adyen/src/Model/Management/ListMerchantResponse.cs b/Adyen/Model/Management/ListMerchantResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListMerchantResponse.cs rename to Adyen/Model/Management/ListMerchantResponse.cs diff --git a/Adyen/src/Model/Management/ListMerchantUsersResponse.cs b/Adyen/Model/Management/ListMerchantUsersResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListMerchantUsersResponse.cs rename to Adyen/Model/Management/ListMerchantUsersResponse.cs diff --git a/Adyen/src/Model/Management/ListStoresResponse.cs b/Adyen/Model/Management/ListStoresResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListStoresResponse.cs rename to Adyen/Model/Management/ListStoresResponse.cs diff --git a/Adyen/src/Model/Management/ListTerminalsResponse.cs b/Adyen/Model/Management/ListTerminalsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListTerminalsResponse.cs rename to Adyen/Model/Management/ListTerminalsResponse.cs diff --git a/Adyen/src/Model/Management/ListWebhooksResponse.cs b/Adyen/Model/Management/ListWebhooksResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListWebhooksResponse.cs rename to Adyen/Model/Management/ListWebhooksResponse.cs diff --git a/Adyen/src/Model/Management/Localization.cs b/Adyen/Model/Management/Localization.cs similarity index 100% rename from Adyen/src/Model/Management/Localization.cs rename to Adyen/Model/Management/Localization.cs diff --git a/Adyen/src/Model/Management/Logo.cs b/Adyen/Model/Management/Logo.cs similarity index 100% rename from Adyen/src/Model/Management/Logo.cs rename to Adyen/Model/Management/Logo.cs diff --git a/Adyen/src/Model/Management/MeApiCredential.cs b/Adyen/Model/Management/MeApiCredential.cs similarity index 100% rename from Adyen/src/Model/Management/MeApiCredential.cs rename to Adyen/Model/Management/MeApiCredential.cs diff --git a/Adyen/src/Model/Management/MealVoucherFRInfo.cs b/Adyen/Model/Management/MealVoucherFRInfo.cs similarity index 100% rename from Adyen/src/Model/Management/MealVoucherFRInfo.cs rename to Adyen/Model/Management/MealVoucherFRInfo.cs diff --git a/Adyen/src/Model/Management/Merchant.cs b/Adyen/Model/Management/Merchant.cs similarity index 100% rename from Adyen/src/Model/Management/Merchant.cs rename to Adyen/Model/Management/Merchant.cs diff --git a/Adyen/src/Model/Management/MerchantLinks.cs b/Adyen/Model/Management/MerchantLinks.cs similarity index 100% rename from Adyen/src/Model/Management/MerchantLinks.cs rename to Adyen/Model/Management/MerchantLinks.cs diff --git a/Adyen/src/Model/Management/MinorUnitsMonetaryValue.cs b/Adyen/Model/Management/MinorUnitsMonetaryValue.cs similarity index 100% rename from Adyen/src/Model/Management/MinorUnitsMonetaryValue.cs rename to Adyen/Model/Management/MinorUnitsMonetaryValue.cs diff --git a/Adyen/src/Model/Management/ModelConfiguration.cs b/Adyen/Model/Management/ModelConfiguration.cs similarity index 100% rename from Adyen/src/Model/Management/ModelConfiguration.cs rename to Adyen/Model/Management/ModelConfiguration.cs diff --git a/Adyen/src/Model/Management/Name.cs b/Adyen/Model/Management/Name.cs similarity index 100% rename from Adyen/src/Model/Management/Name.cs rename to Adyen/Model/Management/Name.cs diff --git a/Adyen/src/Model/Management/Name2.cs b/Adyen/Model/Management/Name2.cs similarity index 100% rename from Adyen/src/Model/Management/Name2.cs rename to Adyen/Model/Management/Name2.cs diff --git a/Adyen/src/Model/Management/Nexo.cs b/Adyen/Model/Management/Nexo.cs similarity index 100% rename from Adyen/src/Model/Management/Nexo.cs rename to Adyen/Model/Management/Nexo.cs diff --git a/Adyen/src/Model/Management/Notification.cs b/Adyen/Model/Management/Notification.cs similarity index 100% rename from Adyen/src/Model/Management/Notification.cs rename to Adyen/Model/Management/Notification.cs diff --git a/Adyen/src/Model/Management/NotificationUrl.cs b/Adyen/Model/Management/NotificationUrl.cs similarity index 100% rename from Adyen/src/Model/Management/NotificationUrl.cs rename to Adyen/Model/Management/NotificationUrl.cs diff --git a/Adyen/src/Model/Management/NyceInfo.cs b/Adyen/Model/Management/NyceInfo.cs similarity index 100% rename from Adyen/src/Model/Management/NyceInfo.cs rename to Adyen/Model/Management/NyceInfo.cs diff --git a/Adyen/src/Model/Management/OfflineProcessing.cs b/Adyen/Model/Management/OfflineProcessing.cs similarity index 100% rename from Adyen/src/Model/Management/OfflineProcessing.cs rename to Adyen/Model/Management/OfflineProcessing.cs diff --git a/Adyen/src/Model/Management/Opi.cs b/Adyen/Model/Management/Opi.cs similarity index 100% rename from Adyen/src/Model/Management/Opi.cs rename to Adyen/Model/Management/Opi.cs diff --git a/Adyen/src/Model/Management/OrderItem.cs b/Adyen/Model/Management/OrderItem.cs similarity index 100% rename from Adyen/src/Model/Management/OrderItem.cs rename to Adyen/Model/Management/OrderItem.cs diff --git a/Adyen/src/Model/Management/PaginationLinks.cs b/Adyen/Model/Management/PaginationLinks.cs similarity index 100% rename from Adyen/src/Model/Management/PaginationLinks.cs rename to Adyen/Model/Management/PaginationLinks.cs diff --git a/Adyen/src/Model/Management/Passcodes.cs b/Adyen/Model/Management/Passcodes.cs similarity index 100% rename from Adyen/src/Model/Management/Passcodes.cs rename to Adyen/Model/Management/Passcodes.cs diff --git a/Adyen/src/Model/Management/PayAtTable.cs b/Adyen/Model/Management/PayAtTable.cs similarity index 100% rename from Adyen/src/Model/Management/PayAtTable.cs rename to Adyen/Model/Management/PayAtTable.cs diff --git a/Adyen/src/Model/Management/PayMeInfo.cs b/Adyen/Model/Management/PayMeInfo.cs similarity index 100% rename from Adyen/src/Model/Management/PayMeInfo.cs rename to Adyen/Model/Management/PayMeInfo.cs diff --git a/Adyen/src/Model/Management/PayPalInfo.cs b/Adyen/Model/Management/PayPalInfo.cs similarity index 100% rename from Adyen/src/Model/Management/PayPalInfo.cs rename to Adyen/Model/Management/PayPalInfo.cs diff --git a/Adyen/src/Model/Management/PayToInfo.cs b/Adyen/Model/Management/PayToInfo.cs similarity index 100% rename from Adyen/src/Model/Management/PayToInfo.cs rename to Adyen/Model/Management/PayToInfo.cs diff --git a/Adyen/src/Model/Management/Payment.cs b/Adyen/Model/Management/Payment.cs similarity index 100% rename from Adyen/src/Model/Management/Payment.cs rename to Adyen/Model/Management/Payment.cs diff --git a/Adyen/src/Model/Management/PaymentMethod.cs b/Adyen/Model/Management/PaymentMethod.cs similarity index 100% rename from Adyen/src/Model/Management/PaymentMethod.cs rename to Adyen/Model/Management/PaymentMethod.cs diff --git a/Adyen/src/Model/Management/PaymentMethodResponse.cs b/Adyen/Model/Management/PaymentMethodResponse.cs similarity index 100% rename from Adyen/src/Model/Management/PaymentMethodResponse.cs rename to Adyen/Model/Management/PaymentMethodResponse.cs diff --git a/Adyen/src/Model/Management/PaymentMethodSetupInfo.cs b/Adyen/Model/Management/PaymentMethodSetupInfo.cs similarity index 100% rename from Adyen/src/Model/Management/PaymentMethodSetupInfo.cs rename to Adyen/Model/Management/PaymentMethodSetupInfo.cs diff --git a/Adyen/src/Model/Management/PayoutSettings.cs b/Adyen/Model/Management/PayoutSettings.cs similarity index 100% rename from Adyen/src/Model/Management/PayoutSettings.cs rename to Adyen/Model/Management/PayoutSettings.cs diff --git a/Adyen/src/Model/Management/PayoutSettingsRequest.cs b/Adyen/Model/Management/PayoutSettingsRequest.cs similarity index 100% rename from Adyen/src/Model/Management/PayoutSettingsRequest.cs rename to Adyen/Model/Management/PayoutSettingsRequest.cs diff --git a/Adyen/src/Model/Management/PayoutSettingsResponse.cs b/Adyen/Model/Management/PayoutSettingsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/PayoutSettingsResponse.cs rename to Adyen/Model/Management/PayoutSettingsResponse.cs diff --git a/Adyen/src/Model/Management/Profile.cs b/Adyen/Model/Management/Profile.cs similarity index 100% rename from Adyen/src/Model/Management/Profile.cs rename to Adyen/Model/Management/Profile.cs diff --git a/Adyen/src/Model/Management/PulseInfo.cs b/Adyen/Model/Management/PulseInfo.cs similarity index 100% rename from Adyen/src/Model/Management/PulseInfo.cs rename to Adyen/Model/Management/PulseInfo.cs diff --git a/Adyen/src/Model/Management/ReceiptOptions.cs b/Adyen/Model/Management/ReceiptOptions.cs similarity index 100% rename from Adyen/src/Model/Management/ReceiptOptions.cs rename to Adyen/Model/Management/ReceiptOptions.cs diff --git a/Adyen/src/Model/Management/ReceiptPrinting.cs b/Adyen/Model/Management/ReceiptPrinting.cs similarity index 100% rename from Adyen/src/Model/Management/ReceiptPrinting.cs rename to Adyen/Model/Management/ReceiptPrinting.cs diff --git a/Adyen/src/Model/Management/Referenced.cs b/Adyen/Model/Management/Referenced.cs similarity index 100% rename from Adyen/src/Model/Management/Referenced.cs rename to Adyen/Model/Management/Referenced.cs diff --git a/Adyen/src/Model/Management/Refunds.cs b/Adyen/Model/Management/Refunds.cs similarity index 100% rename from Adyen/src/Model/Management/Refunds.cs rename to Adyen/Model/Management/Refunds.cs diff --git a/Adyen/src/Model/Management/ReleaseUpdateDetails.cs b/Adyen/Model/Management/ReleaseUpdateDetails.cs similarity index 100% rename from Adyen/src/Model/Management/ReleaseUpdateDetails.cs rename to Adyen/Model/Management/ReleaseUpdateDetails.cs diff --git a/Adyen/src/Model/Management/ReprocessAndroidAppResponse.cs b/Adyen/Model/Management/ReprocessAndroidAppResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ReprocessAndroidAppResponse.cs rename to Adyen/Model/Management/ReprocessAndroidAppResponse.cs diff --git a/Adyen/src/Model/Management/RequestActivationResponse.cs b/Adyen/Model/Management/RequestActivationResponse.cs similarity index 100% rename from Adyen/src/Model/Management/RequestActivationResponse.cs rename to Adyen/Model/Management/RequestActivationResponse.cs diff --git a/Adyen/src/Model/Management/RestServiceError.cs b/Adyen/Model/Management/RestServiceError.cs similarity index 100% rename from Adyen/src/Model/Management/RestServiceError.cs rename to Adyen/Model/Management/RestServiceError.cs diff --git a/Adyen/src/Model/Management/ScheduleTerminalActionsRequest.cs b/Adyen/Model/Management/ScheduleTerminalActionsRequest.cs similarity index 100% rename from Adyen/src/Model/Management/ScheduleTerminalActionsRequest.cs rename to Adyen/Model/Management/ScheduleTerminalActionsRequest.cs diff --git a/Adyen/src/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs b/Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs similarity index 100% rename from Adyen/src/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs rename to Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs diff --git a/Adyen/src/Model/Management/ScheduleTerminalActionsResponse.cs b/Adyen/Model/Management/ScheduleTerminalActionsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ScheduleTerminalActionsResponse.cs rename to Adyen/Model/Management/ScheduleTerminalActionsResponse.cs diff --git a/Adyen/src/Model/Management/Settings.cs b/Adyen/Model/Management/Settings.cs similarity index 100% rename from Adyen/src/Model/Management/Settings.cs rename to Adyen/Model/Management/Settings.cs diff --git a/Adyen/src/Model/Management/ShippingLocation.cs b/Adyen/Model/Management/ShippingLocation.cs similarity index 100% rename from Adyen/src/Model/Management/ShippingLocation.cs rename to Adyen/Model/Management/ShippingLocation.cs diff --git a/Adyen/src/Model/Management/ShippingLocationsResponse.cs b/Adyen/Model/Management/ShippingLocationsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ShippingLocationsResponse.cs rename to Adyen/Model/Management/ShippingLocationsResponse.cs diff --git a/Adyen/src/Model/Management/Signature.cs b/Adyen/Model/Management/Signature.cs similarity index 100% rename from Adyen/src/Model/Management/Signature.cs rename to Adyen/Model/Management/Signature.cs diff --git a/Adyen/src/Model/Management/SodexoInfo.cs b/Adyen/Model/Management/SodexoInfo.cs similarity index 100% rename from Adyen/src/Model/Management/SodexoInfo.cs rename to Adyen/Model/Management/SodexoInfo.cs diff --git a/Adyen/src/Model/Management/SofortInfo.cs b/Adyen/Model/Management/SofortInfo.cs similarity index 100% rename from Adyen/src/Model/Management/SofortInfo.cs rename to Adyen/Model/Management/SofortInfo.cs diff --git a/Adyen/src/Model/Management/SplitConfiguration.cs b/Adyen/Model/Management/SplitConfiguration.cs similarity index 100% rename from Adyen/src/Model/Management/SplitConfiguration.cs rename to Adyen/Model/Management/SplitConfiguration.cs diff --git a/Adyen/src/Model/Management/SplitConfigurationList.cs b/Adyen/Model/Management/SplitConfigurationList.cs similarity index 100% rename from Adyen/src/Model/Management/SplitConfigurationList.cs rename to Adyen/Model/Management/SplitConfigurationList.cs diff --git a/Adyen/src/Model/Management/SplitConfigurationLogic.cs b/Adyen/Model/Management/SplitConfigurationLogic.cs similarity index 100% rename from Adyen/src/Model/Management/SplitConfigurationLogic.cs rename to Adyen/Model/Management/SplitConfigurationLogic.cs diff --git a/Adyen/src/Model/Management/SplitConfigurationRule.cs b/Adyen/Model/Management/SplitConfigurationRule.cs similarity index 100% rename from Adyen/src/Model/Management/SplitConfigurationRule.cs rename to Adyen/Model/Management/SplitConfigurationRule.cs diff --git a/Adyen/src/Model/Management/Standalone.cs b/Adyen/Model/Management/Standalone.cs similarity index 100% rename from Adyen/src/Model/Management/Standalone.cs rename to Adyen/Model/Management/Standalone.cs diff --git a/Adyen/src/Model/Management/StarInfo.cs b/Adyen/Model/Management/StarInfo.cs similarity index 100% rename from Adyen/src/Model/Management/StarInfo.cs rename to Adyen/Model/Management/StarInfo.cs diff --git a/Adyen/src/Model/Management/Store.cs b/Adyen/Model/Management/Store.cs similarity index 100% rename from Adyen/src/Model/Management/Store.cs rename to Adyen/Model/Management/Store.cs diff --git a/Adyen/src/Model/Management/StoreAndForward.cs b/Adyen/Model/Management/StoreAndForward.cs similarity index 100% rename from Adyen/src/Model/Management/StoreAndForward.cs rename to Adyen/Model/Management/StoreAndForward.cs diff --git a/Adyen/src/Model/Management/StoreCreationRequest.cs b/Adyen/Model/Management/StoreCreationRequest.cs similarity index 100% rename from Adyen/src/Model/Management/StoreCreationRequest.cs rename to Adyen/Model/Management/StoreCreationRequest.cs diff --git a/Adyen/src/Model/Management/StoreCreationWithMerchantCodeRequest.cs b/Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.cs similarity index 100% rename from Adyen/src/Model/Management/StoreCreationWithMerchantCodeRequest.cs rename to Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.cs diff --git a/Adyen/src/Model/Management/StoreLocation.cs b/Adyen/Model/Management/StoreLocation.cs similarity index 100% rename from Adyen/src/Model/Management/StoreLocation.cs rename to Adyen/Model/Management/StoreLocation.cs diff --git a/Adyen/src/Model/Management/StoreSplitConfiguration.cs b/Adyen/Model/Management/StoreSplitConfiguration.cs similarity index 100% rename from Adyen/src/Model/Management/StoreSplitConfiguration.cs rename to Adyen/Model/Management/StoreSplitConfiguration.cs diff --git a/Adyen/src/Model/Management/SupportedCardTypes.cs b/Adyen/Model/Management/SupportedCardTypes.cs similarity index 100% rename from Adyen/src/Model/Management/SupportedCardTypes.cs rename to Adyen/Model/Management/SupportedCardTypes.cs diff --git a/Adyen/src/Model/Management/Surcharge.cs b/Adyen/Model/Management/Surcharge.cs similarity index 100% rename from Adyen/src/Model/Management/Surcharge.cs rename to Adyen/Model/Management/Surcharge.cs diff --git a/Adyen/src/Model/Management/SwishInfo.cs b/Adyen/Model/Management/SwishInfo.cs similarity index 100% rename from Adyen/src/Model/Management/SwishInfo.cs rename to Adyen/Model/Management/SwishInfo.cs diff --git a/Adyen/src/Model/Management/TapToPay.cs b/Adyen/Model/Management/TapToPay.cs similarity index 100% rename from Adyen/src/Model/Management/TapToPay.cs rename to Adyen/Model/Management/TapToPay.cs diff --git a/Adyen/src/Model/Management/Terminal.cs b/Adyen/Model/Management/Terminal.cs similarity index 100% rename from Adyen/src/Model/Management/Terminal.cs rename to Adyen/Model/Management/Terminal.cs diff --git a/Adyen/src/Model/Management/TerminalActionScheduleDetail.cs b/Adyen/Model/Management/TerminalActionScheduleDetail.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalActionScheduleDetail.cs rename to Adyen/Model/Management/TerminalActionScheduleDetail.cs diff --git a/Adyen/src/Model/Management/TerminalAssignment.cs b/Adyen/Model/Management/TerminalAssignment.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalAssignment.cs rename to Adyen/Model/Management/TerminalAssignment.cs diff --git a/Adyen/src/Model/Management/TerminalConnectivity.cs b/Adyen/Model/Management/TerminalConnectivity.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalConnectivity.cs rename to Adyen/Model/Management/TerminalConnectivity.cs diff --git a/Adyen/src/Model/Management/TerminalConnectivityBluetooth.cs b/Adyen/Model/Management/TerminalConnectivityBluetooth.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalConnectivityBluetooth.cs rename to Adyen/Model/Management/TerminalConnectivityBluetooth.cs diff --git a/Adyen/src/Model/Management/TerminalConnectivityCellular.cs b/Adyen/Model/Management/TerminalConnectivityCellular.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalConnectivityCellular.cs rename to Adyen/Model/Management/TerminalConnectivityCellular.cs diff --git a/Adyen/src/Model/Management/TerminalConnectivityEthernet.cs b/Adyen/Model/Management/TerminalConnectivityEthernet.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalConnectivityEthernet.cs rename to Adyen/Model/Management/TerminalConnectivityEthernet.cs diff --git a/Adyen/src/Model/Management/TerminalConnectivityWifi.cs b/Adyen/Model/Management/TerminalConnectivityWifi.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalConnectivityWifi.cs rename to Adyen/Model/Management/TerminalConnectivityWifi.cs diff --git a/Adyen/src/Model/Management/TerminalInstructions.cs b/Adyen/Model/Management/TerminalInstructions.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalInstructions.cs rename to Adyen/Model/Management/TerminalInstructions.cs diff --git a/Adyen/src/Model/Management/TerminalModelsResponse.cs b/Adyen/Model/Management/TerminalModelsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalModelsResponse.cs rename to Adyen/Model/Management/TerminalModelsResponse.cs diff --git a/Adyen/src/Model/Management/TerminalOrder.cs b/Adyen/Model/Management/TerminalOrder.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalOrder.cs rename to Adyen/Model/Management/TerminalOrder.cs diff --git a/Adyen/src/Model/Management/TerminalOrderRequest.cs b/Adyen/Model/Management/TerminalOrderRequest.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalOrderRequest.cs rename to Adyen/Model/Management/TerminalOrderRequest.cs diff --git a/Adyen/src/Model/Management/TerminalOrdersResponse.cs b/Adyen/Model/Management/TerminalOrdersResponse.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalOrdersResponse.cs rename to Adyen/Model/Management/TerminalOrdersResponse.cs diff --git a/Adyen/src/Model/Management/TerminalProduct.cs b/Adyen/Model/Management/TerminalProduct.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalProduct.cs rename to Adyen/Model/Management/TerminalProduct.cs diff --git a/Adyen/src/Model/Management/TerminalProductPrice.cs b/Adyen/Model/Management/TerminalProductPrice.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalProductPrice.cs rename to Adyen/Model/Management/TerminalProductPrice.cs diff --git a/Adyen/src/Model/Management/TerminalProductsResponse.cs b/Adyen/Model/Management/TerminalProductsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalProductsResponse.cs rename to Adyen/Model/Management/TerminalProductsResponse.cs diff --git a/Adyen/src/Model/Management/TerminalReassignmentRequest.cs b/Adyen/Model/Management/TerminalReassignmentRequest.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalReassignmentRequest.cs rename to Adyen/Model/Management/TerminalReassignmentRequest.cs diff --git a/Adyen/src/Model/Management/TerminalReassignmentTarget.cs b/Adyen/Model/Management/TerminalReassignmentTarget.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalReassignmentTarget.cs rename to Adyen/Model/Management/TerminalReassignmentTarget.cs diff --git a/Adyen/src/Model/Management/TerminalSettings.cs b/Adyen/Model/Management/TerminalSettings.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalSettings.cs rename to Adyen/Model/Management/TerminalSettings.cs diff --git a/Adyen/src/Model/Management/TestCompanyWebhookRequest.cs b/Adyen/Model/Management/TestCompanyWebhookRequest.cs similarity index 100% rename from Adyen/src/Model/Management/TestCompanyWebhookRequest.cs rename to Adyen/Model/Management/TestCompanyWebhookRequest.cs diff --git a/Adyen/src/Model/Management/TestOutput.cs b/Adyen/Model/Management/TestOutput.cs similarity index 100% rename from Adyen/src/Model/Management/TestOutput.cs rename to Adyen/Model/Management/TestOutput.cs diff --git a/Adyen/src/Model/Management/TestWebhookRequest.cs b/Adyen/Model/Management/TestWebhookRequest.cs similarity index 100% rename from Adyen/src/Model/Management/TestWebhookRequest.cs rename to Adyen/Model/Management/TestWebhookRequest.cs diff --git a/Adyen/src/Model/Management/TestWebhookResponse.cs b/Adyen/Model/Management/TestWebhookResponse.cs similarity index 100% rename from Adyen/src/Model/Management/TestWebhookResponse.cs rename to Adyen/Model/Management/TestWebhookResponse.cs diff --git a/Adyen/src/Model/Management/TicketInfo.cs b/Adyen/Model/Management/TicketInfo.cs similarity index 100% rename from Adyen/src/Model/Management/TicketInfo.cs rename to Adyen/Model/Management/TicketInfo.cs diff --git a/Adyen/src/Model/Management/Timeouts.cs b/Adyen/Model/Management/Timeouts.cs similarity index 100% rename from Adyen/src/Model/Management/Timeouts.cs rename to Adyen/Model/Management/Timeouts.cs diff --git a/Adyen/src/Model/Management/TransactionDescriptionInfo.cs b/Adyen/Model/Management/TransactionDescriptionInfo.cs similarity index 100% rename from Adyen/src/Model/Management/TransactionDescriptionInfo.cs rename to Adyen/Model/Management/TransactionDescriptionInfo.cs diff --git a/Adyen/src/Model/Management/TwintInfo.cs b/Adyen/Model/Management/TwintInfo.cs similarity index 100% rename from Adyen/src/Model/Management/TwintInfo.cs rename to Adyen/Model/Management/TwintInfo.cs diff --git a/Adyen/src/Model/Management/UninstallAndroidAppDetails.cs b/Adyen/Model/Management/UninstallAndroidAppDetails.cs similarity index 100% rename from Adyen/src/Model/Management/UninstallAndroidAppDetails.cs rename to Adyen/Model/Management/UninstallAndroidAppDetails.cs diff --git a/Adyen/src/Model/Management/UninstallAndroidCertificateDetails.cs b/Adyen/Model/Management/UninstallAndroidCertificateDetails.cs similarity index 100% rename from Adyen/src/Model/Management/UninstallAndroidCertificateDetails.cs rename to Adyen/Model/Management/UninstallAndroidCertificateDetails.cs diff --git a/Adyen/src/Model/Management/UpdatableAddress.cs b/Adyen/Model/Management/UpdatableAddress.cs similarity index 100% rename from Adyen/src/Model/Management/UpdatableAddress.cs rename to Adyen/Model/Management/UpdatableAddress.cs diff --git a/Adyen/src/Model/Management/UpdateCompanyApiCredentialRequest.cs b/Adyen/Model/Management/UpdateCompanyApiCredentialRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateCompanyApiCredentialRequest.cs rename to Adyen/Model/Management/UpdateCompanyApiCredentialRequest.cs diff --git a/Adyen/src/Model/Management/UpdateCompanyUserRequest.cs b/Adyen/Model/Management/UpdateCompanyUserRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateCompanyUserRequest.cs rename to Adyen/Model/Management/UpdateCompanyUserRequest.cs diff --git a/Adyen/src/Model/Management/UpdateCompanyWebhookRequest.cs b/Adyen/Model/Management/UpdateCompanyWebhookRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateCompanyWebhookRequest.cs rename to Adyen/Model/Management/UpdateCompanyWebhookRequest.cs diff --git a/Adyen/src/Model/Management/UpdateMerchantApiCredentialRequest.cs b/Adyen/Model/Management/UpdateMerchantApiCredentialRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateMerchantApiCredentialRequest.cs rename to Adyen/Model/Management/UpdateMerchantApiCredentialRequest.cs diff --git a/Adyen/src/Model/Management/UpdateMerchantUserRequest.cs b/Adyen/Model/Management/UpdateMerchantUserRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateMerchantUserRequest.cs rename to Adyen/Model/Management/UpdateMerchantUserRequest.cs diff --git a/Adyen/src/Model/Management/UpdateMerchantWebhookRequest.cs b/Adyen/Model/Management/UpdateMerchantWebhookRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateMerchantWebhookRequest.cs rename to Adyen/Model/Management/UpdateMerchantWebhookRequest.cs diff --git a/Adyen/src/Model/Management/UpdatePaymentMethodInfo.cs b/Adyen/Model/Management/UpdatePaymentMethodInfo.cs similarity index 100% rename from Adyen/src/Model/Management/UpdatePaymentMethodInfo.cs rename to Adyen/Model/Management/UpdatePaymentMethodInfo.cs diff --git a/Adyen/src/Model/Management/UpdatePayoutSettingsRequest.cs b/Adyen/Model/Management/UpdatePayoutSettingsRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdatePayoutSettingsRequest.cs rename to Adyen/Model/Management/UpdatePayoutSettingsRequest.cs diff --git a/Adyen/src/Model/Management/UpdateSplitConfigurationLogicRequest.cs b/Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateSplitConfigurationLogicRequest.cs rename to Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.cs diff --git a/Adyen/src/Model/Management/UpdateSplitConfigurationRequest.cs b/Adyen/Model/Management/UpdateSplitConfigurationRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateSplitConfigurationRequest.cs rename to Adyen/Model/Management/UpdateSplitConfigurationRequest.cs diff --git a/Adyen/src/Model/Management/UpdateSplitConfigurationRuleRequest.cs b/Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateSplitConfigurationRuleRequest.cs rename to Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.cs diff --git a/Adyen/src/Model/Management/UpdateStoreRequest.cs b/Adyen/Model/Management/UpdateStoreRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateStoreRequest.cs rename to Adyen/Model/Management/UpdateStoreRequest.cs diff --git a/Adyen/src/Model/Management/UploadAndroidAppResponse.cs b/Adyen/Model/Management/UploadAndroidAppResponse.cs similarity index 100% rename from Adyen/src/Model/Management/UploadAndroidAppResponse.cs rename to Adyen/Model/Management/UploadAndroidAppResponse.cs diff --git a/Adyen/src/Model/Management/UploadAndroidCertificateResponse.cs b/Adyen/Model/Management/UploadAndroidCertificateResponse.cs similarity index 100% rename from Adyen/src/Model/Management/UploadAndroidCertificateResponse.cs rename to Adyen/Model/Management/UploadAndroidCertificateResponse.cs diff --git a/Adyen/src/Model/Management/Url.cs b/Adyen/Model/Management/Url.cs similarity index 100% rename from Adyen/src/Model/Management/Url.cs rename to Adyen/Model/Management/Url.cs diff --git a/Adyen/src/Model/Management/User.cs b/Adyen/Model/Management/User.cs similarity index 100% rename from Adyen/src/Model/Management/User.cs rename to Adyen/Model/Management/User.cs diff --git a/Adyen/src/Model/Management/VippsInfo.cs b/Adyen/Model/Management/VippsInfo.cs similarity index 100% rename from Adyen/src/Model/Management/VippsInfo.cs rename to Adyen/Model/Management/VippsInfo.cs diff --git a/Adyen/src/Model/Management/WeChatPayInfo.cs b/Adyen/Model/Management/WeChatPayInfo.cs similarity index 100% rename from Adyen/src/Model/Management/WeChatPayInfo.cs rename to Adyen/Model/Management/WeChatPayInfo.cs diff --git a/Adyen/src/Model/Management/WeChatPayPosInfo.cs b/Adyen/Model/Management/WeChatPayPosInfo.cs similarity index 100% rename from Adyen/src/Model/Management/WeChatPayPosInfo.cs rename to Adyen/Model/Management/WeChatPayPosInfo.cs diff --git a/Adyen/src/Model/Management/Webhook.cs b/Adyen/Model/Management/Webhook.cs similarity index 100% rename from Adyen/src/Model/Management/Webhook.cs rename to Adyen/Model/Management/Webhook.cs diff --git a/Adyen/src/Model/Management/WebhookLinks.cs b/Adyen/Model/Management/WebhookLinks.cs similarity index 100% rename from Adyen/src/Model/Management/WebhookLinks.cs rename to Adyen/Model/Management/WebhookLinks.cs diff --git a/Adyen/src/Model/Management/WifiProfiles.cs b/Adyen/Model/Management/WifiProfiles.cs similarity index 100% rename from Adyen/src/Model/Management/WifiProfiles.cs rename to Adyen/Model/Management/WifiProfiles.cs diff --git a/Adyen/src/Model/ManagementWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/ManagementWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/ManagementWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/ManagementWebhooks/AccountCapabilityData.cs b/Adyen/Model/ManagementWebhooks/AccountCapabilityData.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/AccountCapabilityData.cs rename to Adyen/Model/ManagementWebhooks/AccountCapabilityData.cs diff --git a/Adyen/src/Model/ManagementWebhooks/AccountCreateNotificationData.cs b/Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/AccountCreateNotificationData.cs rename to Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.cs diff --git a/Adyen/src/Model/ManagementWebhooks/AccountNotificationResponse.cs b/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/AccountNotificationResponse.cs rename to Adyen/Model/ManagementWebhooks/AccountNotificationResponse.cs diff --git a/Adyen/src/Model/ManagementWebhooks/AccountUpdateNotificationData.cs b/Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/AccountUpdateNotificationData.cs rename to Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.cs diff --git a/Adyen/src/Model/ManagementWebhooks/CapabilityProblem.cs b/Adyen/Model/ManagementWebhooks/CapabilityProblem.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/CapabilityProblem.cs rename to Adyen/Model/ManagementWebhooks/CapabilityProblem.cs diff --git a/Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntity.cs b/Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntity.cs rename to Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.cs diff --git a/Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs b/Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs rename to Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/src/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/MidServiceNotificationData.cs b/Adyen/Model/ManagementWebhooks/MidServiceNotificationData.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/MidServiceNotificationData.cs rename to Adyen/Model/ManagementWebhooks/MidServiceNotificationData.cs diff --git a/Adyen/src/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs b/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs rename to Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs diff --git a/Adyen/src/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/RemediatingAction.cs b/Adyen/Model/ManagementWebhooks/RemediatingAction.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/RemediatingAction.cs rename to Adyen/Model/ManagementWebhooks/RemediatingAction.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs b/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs rename to Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalBoardingData.cs b/Adyen/Model/ManagementWebhooks/TerminalBoardingData.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalBoardingData.cs rename to Adyen/Model/ManagementWebhooks/TerminalBoardingData.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs b/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs rename to Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalSettingsData.cs b/Adyen/Model/ManagementWebhooks/TerminalSettingsData.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalSettingsData.cs rename to Adyen/Model/ManagementWebhooks/TerminalSettingsData.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs b/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs rename to Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs diff --git a/Adyen/src/Model/ManagementWebhooks/VerificationError.cs b/Adyen/Model/ManagementWebhooks/VerificationError.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/VerificationError.cs rename to Adyen/Model/ManagementWebhooks/VerificationError.cs diff --git a/Adyen/src/Model/ManagementWebhooks/VerificationErrorRecursive.cs b/Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/VerificationErrorRecursive.cs rename to Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.cs diff --git a/Adyen/src/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/NegativeBalanceWarningWebhooks/Amount.cs b/Adyen/Model/NegativeBalanceWarningWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/NegativeBalanceWarningWebhooks/Amount.cs rename to Adyen/Model/NegativeBalanceWarningWebhooks/Amount.cs diff --git a/Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs b/Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs similarity index 100% rename from Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs rename to Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs diff --git a/Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs b/Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs rename to Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs diff --git a/Adyen/src/Model/NegativeBalanceWarningWebhooks/Resource.cs b/Adyen/Model/NegativeBalanceWarningWebhooks/Resource.cs similarity index 100% rename from Adyen/src/Model/NegativeBalanceWarningWebhooks/Resource.cs rename to Adyen/Model/NegativeBalanceWarningWebhooks/Resource.cs diff --git a/Adyen/src/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs b/Adyen/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/src/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs rename to Adyen/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs diff --git a/Adyen/src/Model/Notification/NotificationRequest.cs b/Adyen/Model/Notification/NotificationRequest.cs similarity index 100% rename from Adyen/src/Model/Notification/NotificationRequest.cs rename to Adyen/Model/Notification/NotificationRequest.cs diff --git a/Adyen/src/Model/Notification/NotificationRequestConst.cs b/Adyen/Model/Notification/NotificationRequestConst.cs similarity index 100% rename from Adyen/src/Model/Notification/NotificationRequestConst.cs rename to Adyen/Model/Notification/NotificationRequestConst.cs diff --git a/Adyen/src/Model/Notification/NotificationRequestItem.cs b/Adyen/Model/Notification/NotificationRequestItem.cs similarity index 100% rename from Adyen/src/Model/Notification/NotificationRequestItem.cs rename to Adyen/Model/Notification/NotificationRequestItem.cs diff --git a/Adyen/src/Model/Notification/NotificationRequestItemContainer.cs b/Adyen/Model/Notification/NotificationRequestItemContainer.cs similarity index 100% rename from Adyen/src/Model/Notification/NotificationRequestItemContainer.cs rename to Adyen/Model/Notification/NotificationRequestItemContainer.cs diff --git a/Adyen/src/Model/Payment/AbstractOpenAPISchema.cs b/Adyen/Model/Payment/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Payment/AbstractOpenAPISchema.cs rename to Adyen/Model/Payment/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Payment/AccountInfo.cs b/Adyen/Model/Payment/AccountInfo.cs similarity index 100% rename from Adyen/src/Model/Payment/AccountInfo.cs rename to Adyen/Model/Payment/AccountInfo.cs diff --git a/Adyen/src/Model/Payment/AcctInfo.cs b/Adyen/Model/Payment/AcctInfo.cs similarity index 100% rename from Adyen/src/Model/Payment/AcctInfo.cs rename to Adyen/Model/Payment/AcctInfo.cs diff --git a/Adyen/src/Model/Payment/AdditionalData3DSecure.cs b/Adyen/Model/Payment/AdditionalData3DSecure.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalData3DSecure.cs rename to Adyen/Model/Payment/AdditionalData3DSecure.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataAirline.cs b/Adyen/Model/Payment/AdditionalDataAirline.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataAirline.cs rename to Adyen/Model/Payment/AdditionalDataAirline.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataCarRental.cs b/Adyen/Model/Payment/AdditionalDataCarRental.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataCarRental.cs rename to Adyen/Model/Payment/AdditionalDataCarRental.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataCommon.cs b/Adyen/Model/Payment/AdditionalDataCommon.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataCommon.cs rename to Adyen/Model/Payment/AdditionalDataCommon.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataLevel23.cs b/Adyen/Model/Payment/AdditionalDataLevel23.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataLevel23.cs rename to Adyen/Model/Payment/AdditionalDataLevel23.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataLodging.cs b/Adyen/Model/Payment/AdditionalDataLodging.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataLodging.cs rename to Adyen/Model/Payment/AdditionalDataLodging.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataModifications.cs b/Adyen/Model/Payment/AdditionalDataModifications.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataModifications.cs rename to Adyen/Model/Payment/AdditionalDataModifications.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataOpenInvoice.cs b/Adyen/Model/Payment/AdditionalDataOpenInvoice.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataOpenInvoice.cs rename to Adyen/Model/Payment/AdditionalDataOpenInvoice.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataOpi.cs b/Adyen/Model/Payment/AdditionalDataOpi.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataOpi.cs rename to Adyen/Model/Payment/AdditionalDataOpi.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataRatepay.cs b/Adyen/Model/Payment/AdditionalDataRatepay.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataRatepay.cs rename to Adyen/Model/Payment/AdditionalDataRatepay.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataRetry.cs b/Adyen/Model/Payment/AdditionalDataRetry.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataRetry.cs rename to Adyen/Model/Payment/AdditionalDataRetry.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataRisk.cs b/Adyen/Model/Payment/AdditionalDataRisk.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataRisk.cs rename to Adyen/Model/Payment/AdditionalDataRisk.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataRiskStandalone.cs b/Adyen/Model/Payment/AdditionalDataRiskStandalone.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataRiskStandalone.cs rename to Adyen/Model/Payment/AdditionalDataRiskStandalone.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataSubMerchant.cs b/Adyen/Model/Payment/AdditionalDataSubMerchant.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataSubMerchant.cs rename to Adyen/Model/Payment/AdditionalDataSubMerchant.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataTemporaryServices.cs b/Adyen/Model/Payment/AdditionalDataTemporaryServices.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataTemporaryServices.cs rename to Adyen/Model/Payment/AdditionalDataTemporaryServices.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataWallets.cs b/Adyen/Model/Payment/AdditionalDataWallets.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataWallets.cs rename to Adyen/Model/Payment/AdditionalDataWallets.cs diff --git a/Adyen/src/Model/Payment/Address.cs b/Adyen/Model/Payment/Address.cs similarity index 100% rename from Adyen/src/Model/Payment/Address.cs rename to Adyen/Model/Payment/Address.cs diff --git a/Adyen/src/Model/Payment/AdjustAuthorisationRequest.cs b/Adyen/Model/Payment/AdjustAuthorisationRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/AdjustAuthorisationRequest.cs rename to Adyen/Model/Payment/AdjustAuthorisationRequest.cs diff --git a/Adyen/src/Model/Payment/Amount.cs b/Adyen/Model/Payment/Amount.cs similarity index 100% rename from Adyen/src/Model/Payment/Amount.cs rename to Adyen/Model/Payment/Amount.cs diff --git a/Adyen/src/Model/Payment/ApplicationInfo.cs b/Adyen/Model/Payment/ApplicationInfo.cs similarity index 100% rename from Adyen/src/Model/Payment/ApplicationInfo.cs rename to Adyen/Model/Payment/ApplicationInfo.cs diff --git a/Adyen/src/Model/Payment/AuthenticationResultRequest.cs b/Adyen/Model/Payment/AuthenticationResultRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/AuthenticationResultRequest.cs rename to Adyen/Model/Payment/AuthenticationResultRequest.cs diff --git a/Adyen/src/Model/Payment/AuthenticationResultResponse.cs b/Adyen/Model/Payment/AuthenticationResultResponse.cs similarity index 100% rename from Adyen/src/Model/Payment/AuthenticationResultResponse.cs rename to Adyen/Model/Payment/AuthenticationResultResponse.cs diff --git a/Adyen/src/Model/Payment/BankAccount.cs b/Adyen/Model/Payment/BankAccount.cs similarity index 100% rename from Adyen/src/Model/Payment/BankAccount.cs rename to Adyen/Model/Payment/BankAccount.cs diff --git a/Adyen/src/Model/Payment/BrowserInfo.cs b/Adyen/Model/Payment/BrowserInfo.cs similarity index 100% rename from Adyen/src/Model/Payment/BrowserInfo.cs rename to Adyen/Model/Payment/BrowserInfo.cs diff --git a/Adyen/src/Model/Payment/CancelOrRefundRequest.cs b/Adyen/Model/Payment/CancelOrRefundRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/CancelOrRefundRequest.cs rename to Adyen/Model/Payment/CancelOrRefundRequest.cs diff --git a/Adyen/src/Model/Payment/CancelRequest.cs b/Adyen/Model/Payment/CancelRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/CancelRequest.cs rename to Adyen/Model/Payment/CancelRequest.cs diff --git a/Adyen/src/Model/Payment/CaptureRequest.cs b/Adyen/Model/Payment/CaptureRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/CaptureRequest.cs rename to Adyen/Model/Payment/CaptureRequest.cs diff --git a/Adyen/src/Model/Payment/Card.cs b/Adyen/Model/Payment/Card.cs similarity index 100% rename from Adyen/src/Model/Payment/Card.cs rename to Adyen/Model/Payment/Card.cs diff --git a/Adyen/src/Model/Payment/CommonField.cs b/Adyen/Model/Payment/CommonField.cs similarity index 100% rename from Adyen/src/Model/Payment/CommonField.cs rename to Adyen/Model/Payment/CommonField.cs diff --git a/Adyen/src/Model/Payment/DeviceRenderOptions.cs b/Adyen/Model/Payment/DeviceRenderOptions.cs similarity index 100% rename from Adyen/src/Model/Payment/DeviceRenderOptions.cs rename to Adyen/Model/Payment/DeviceRenderOptions.cs diff --git a/Adyen/src/Model/Payment/DonationRequest.cs b/Adyen/Model/Payment/DonationRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/DonationRequest.cs rename to Adyen/Model/Payment/DonationRequest.cs diff --git a/Adyen/src/Model/Payment/ExternalPlatform.cs b/Adyen/Model/Payment/ExternalPlatform.cs similarity index 100% rename from Adyen/src/Model/Payment/ExternalPlatform.cs rename to Adyen/Model/Payment/ExternalPlatform.cs diff --git a/Adyen/src/Model/Payment/ForexQuote.cs b/Adyen/Model/Payment/ForexQuote.cs similarity index 100% rename from Adyen/src/Model/Payment/ForexQuote.cs rename to Adyen/Model/Payment/ForexQuote.cs diff --git a/Adyen/src/Model/Payment/FraudCheckResult.cs b/Adyen/Model/Payment/FraudCheckResult.cs similarity index 100% rename from Adyen/src/Model/Payment/FraudCheckResult.cs rename to Adyen/Model/Payment/FraudCheckResult.cs diff --git a/Adyen/src/Model/Payment/FraudCheckResultWrapper.cs b/Adyen/Model/Payment/FraudCheckResultWrapper.cs similarity index 100% rename from Adyen/src/Model/Payment/FraudCheckResultWrapper.cs rename to Adyen/Model/Payment/FraudCheckResultWrapper.cs diff --git a/Adyen/src/Model/Payment/FraudResult.cs b/Adyen/Model/Payment/FraudResult.cs similarity index 100% rename from Adyen/src/Model/Payment/FraudResult.cs rename to Adyen/Model/Payment/FraudResult.cs diff --git a/Adyen/src/Model/Payment/FundDestination.cs b/Adyen/Model/Payment/FundDestination.cs similarity index 100% rename from Adyen/src/Model/Payment/FundDestination.cs rename to Adyen/Model/Payment/FundDestination.cs diff --git a/Adyen/src/Model/Payment/FundSource.cs b/Adyen/Model/Payment/FundSource.cs similarity index 100% rename from Adyen/src/Model/Payment/FundSource.cs rename to Adyen/Model/Payment/FundSource.cs diff --git a/Adyen/src/Model/Payment/Installments.cs b/Adyen/Model/Payment/Installments.cs similarity index 100% rename from Adyen/src/Model/Payment/Installments.cs rename to Adyen/Model/Payment/Installments.cs diff --git a/Adyen/src/Model/Payment/Mandate.cs b/Adyen/Model/Payment/Mandate.cs similarity index 100% rename from Adyen/src/Model/Payment/Mandate.cs rename to Adyen/Model/Payment/Mandate.cs diff --git a/Adyen/src/Model/Payment/MerchantDevice.cs b/Adyen/Model/Payment/MerchantDevice.cs similarity index 100% rename from Adyen/src/Model/Payment/MerchantDevice.cs rename to Adyen/Model/Payment/MerchantDevice.cs diff --git a/Adyen/src/Model/Payment/MerchantRiskIndicator.cs b/Adyen/Model/Payment/MerchantRiskIndicator.cs similarity index 100% rename from Adyen/src/Model/Payment/MerchantRiskIndicator.cs rename to Adyen/Model/Payment/MerchantRiskIndicator.cs diff --git a/Adyen/src/Model/Payment/ModificationResult.cs b/Adyen/Model/Payment/ModificationResult.cs similarity index 100% rename from Adyen/src/Model/Payment/ModificationResult.cs rename to Adyen/Model/Payment/ModificationResult.cs diff --git a/Adyen/src/Model/Payment/Name.cs b/Adyen/Model/Payment/Name.cs similarity index 100% rename from Adyen/src/Model/Payment/Name.cs rename to Adyen/Model/Payment/Name.cs diff --git a/Adyen/src/Model/Payment/PaymentRequest.cs b/Adyen/Model/Payment/PaymentRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/PaymentRequest.cs rename to Adyen/Model/Payment/PaymentRequest.cs diff --git a/Adyen/src/Model/Payment/PaymentRequest3d.cs b/Adyen/Model/Payment/PaymentRequest3d.cs similarity index 100% rename from Adyen/src/Model/Payment/PaymentRequest3d.cs rename to Adyen/Model/Payment/PaymentRequest3d.cs diff --git a/Adyen/src/Model/Payment/PaymentRequest3ds2.cs b/Adyen/Model/Payment/PaymentRequest3ds2.cs similarity index 100% rename from Adyen/src/Model/Payment/PaymentRequest3ds2.cs rename to Adyen/Model/Payment/PaymentRequest3ds2.cs diff --git a/Adyen/src/Model/Payment/PaymentResult.cs b/Adyen/Model/Payment/PaymentResult.cs similarity index 100% rename from Adyen/src/Model/Payment/PaymentResult.cs rename to Adyen/Model/Payment/PaymentResult.cs diff --git a/Adyen/src/Model/Payment/Phone.cs b/Adyen/Model/Payment/Phone.cs similarity index 100% rename from Adyen/src/Model/Payment/Phone.cs rename to Adyen/Model/Payment/Phone.cs diff --git a/Adyen/src/Model/Payment/PlatformChargebackLogic.cs b/Adyen/Model/Payment/PlatformChargebackLogic.cs similarity index 100% rename from Adyen/src/Model/Payment/PlatformChargebackLogic.cs rename to Adyen/Model/Payment/PlatformChargebackLogic.cs diff --git a/Adyen/src/Model/Payment/Recurring.cs b/Adyen/Model/Payment/Recurring.cs similarity index 100% rename from Adyen/src/Model/Payment/Recurring.cs rename to Adyen/Model/Payment/Recurring.cs diff --git a/Adyen/src/Model/Payment/RefundRequest.cs b/Adyen/Model/Payment/RefundRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/RefundRequest.cs rename to Adyen/Model/Payment/RefundRequest.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalData3DSecure.cs b/Adyen/Model/Payment/ResponseAdditionalData3DSecure.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalData3DSecure.cs rename to Adyen/Model/Payment/ResponseAdditionalData3DSecure.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataBillingAddress.cs b/Adyen/Model/Payment/ResponseAdditionalDataBillingAddress.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataBillingAddress.cs rename to Adyen/Model/Payment/ResponseAdditionalDataBillingAddress.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataCard.cs b/Adyen/Model/Payment/ResponseAdditionalDataCard.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataCard.cs rename to Adyen/Model/Payment/ResponseAdditionalDataCard.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataCommon.cs b/Adyen/Model/Payment/ResponseAdditionalDataCommon.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataCommon.cs rename to Adyen/Model/Payment/ResponseAdditionalDataCommon.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataDomesticError.cs b/Adyen/Model/Payment/ResponseAdditionalDataDomesticError.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataDomesticError.cs rename to Adyen/Model/Payment/ResponseAdditionalDataDomesticError.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataInstallments.cs b/Adyen/Model/Payment/ResponseAdditionalDataInstallments.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataInstallments.cs rename to Adyen/Model/Payment/ResponseAdditionalDataInstallments.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataNetworkTokens.cs b/Adyen/Model/Payment/ResponseAdditionalDataNetworkTokens.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataNetworkTokens.cs rename to Adyen/Model/Payment/ResponseAdditionalDataNetworkTokens.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataOpi.cs b/Adyen/Model/Payment/ResponseAdditionalDataOpi.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataOpi.cs rename to Adyen/Model/Payment/ResponseAdditionalDataOpi.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataSepa.cs b/Adyen/Model/Payment/ResponseAdditionalDataSepa.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataSepa.cs rename to Adyen/Model/Payment/ResponseAdditionalDataSepa.cs diff --git a/Adyen/src/Model/Payment/SDKEphemPubKey.cs b/Adyen/Model/Payment/SDKEphemPubKey.cs similarity index 100% rename from Adyen/src/Model/Payment/SDKEphemPubKey.cs rename to Adyen/Model/Payment/SDKEphemPubKey.cs diff --git a/Adyen/src/Model/Payment/SecureRemoteCommerceCheckoutData.cs b/Adyen/Model/Payment/SecureRemoteCommerceCheckoutData.cs similarity index 100% rename from Adyen/src/Model/Payment/SecureRemoteCommerceCheckoutData.cs rename to Adyen/Model/Payment/SecureRemoteCommerceCheckoutData.cs diff --git a/Adyen/src/Model/Payment/ServiceError.cs b/Adyen/Model/Payment/ServiceError.cs similarity index 100% rename from Adyen/src/Model/Payment/ServiceError.cs rename to Adyen/Model/Payment/ServiceError.cs diff --git a/Adyen/src/Model/Payment/ShopperInteractionDevice.cs b/Adyen/Model/Payment/ShopperInteractionDevice.cs similarity index 100% rename from Adyen/src/Model/Payment/ShopperInteractionDevice.cs rename to Adyen/Model/Payment/ShopperInteractionDevice.cs diff --git a/Adyen/src/Model/Payment/Split.cs b/Adyen/Model/Payment/Split.cs similarity index 100% rename from Adyen/src/Model/Payment/Split.cs rename to Adyen/Model/Payment/Split.cs diff --git a/Adyen/src/Model/Payment/SplitAmount.cs b/Adyen/Model/Payment/SplitAmount.cs similarity index 100% rename from Adyen/src/Model/Payment/SplitAmount.cs rename to Adyen/Model/Payment/SplitAmount.cs diff --git a/Adyen/src/Model/Payment/SubMerchant.cs b/Adyen/Model/Payment/SubMerchant.cs similarity index 100% rename from Adyen/src/Model/Payment/SubMerchant.cs rename to Adyen/Model/Payment/SubMerchant.cs diff --git a/Adyen/src/Model/Payment/TechnicalCancelRequest.cs b/Adyen/Model/Payment/TechnicalCancelRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/TechnicalCancelRequest.cs rename to Adyen/Model/Payment/TechnicalCancelRequest.cs diff --git a/Adyen/src/Model/Payment/ThreeDS1Result.cs b/Adyen/Model/Payment/ThreeDS1Result.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDS1Result.cs rename to Adyen/Model/Payment/ThreeDS1Result.cs diff --git a/Adyen/src/Model/Payment/ThreeDS2RequestData.cs b/Adyen/Model/Payment/ThreeDS2RequestData.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDS2RequestData.cs rename to Adyen/Model/Payment/ThreeDS2RequestData.cs diff --git a/Adyen/src/Model/Payment/ThreeDS2Result.cs b/Adyen/Model/Payment/ThreeDS2Result.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDS2Result.cs rename to Adyen/Model/Payment/ThreeDS2Result.cs diff --git a/Adyen/src/Model/Payment/ThreeDS2ResultRequest.cs b/Adyen/Model/Payment/ThreeDS2ResultRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDS2ResultRequest.cs rename to Adyen/Model/Payment/ThreeDS2ResultRequest.cs diff --git a/Adyen/src/Model/Payment/ThreeDS2ResultResponse.cs b/Adyen/Model/Payment/ThreeDS2ResultResponse.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDS2ResultResponse.cs rename to Adyen/Model/Payment/ThreeDS2ResultResponse.cs diff --git a/Adyen/src/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs b/Adyen/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs rename to Adyen/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs diff --git a/Adyen/src/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs b/Adyen/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs rename to Adyen/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs diff --git a/Adyen/src/Model/Payment/ThreeDSecureData.cs b/Adyen/Model/Payment/ThreeDSecureData.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDSecureData.cs rename to Adyen/Model/Payment/ThreeDSecureData.cs diff --git a/Adyen/src/Model/Payment/VoidPendingRefundRequest.cs b/Adyen/Model/Payment/VoidPendingRefundRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/VoidPendingRefundRequest.cs rename to Adyen/Model/Payment/VoidPendingRefundRequest.cs diff --git a/Adyen/src/Model/PaymentsApp/AbstractOpenAPISchema.cs b/Adyen/Model/PaymentsApp/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/AbstractOpenAPISchema.cs rename to Adyen/Model/PaymentsApp/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PaymentsApp/BoardingTokenRequest.cs b/Adyen/Model/PaymentsApp/BoardingTokenRequest.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/BoardingTokenRequest.cs rename to Adyen/Model/PaymentsApp/BoardingTokenRequest.cs diff --git a/Adyen/src/Model/PaymentsApp/BoardingTokenResponse.cs b/Adyen/Model/PaymentsApp/BoardingTokenResponse.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/BoardingTokenResponse.cs rename to Adyen/Model/PaymentsApp/BoardingTokenResponse.cs diff --git a/Adyen/src/Model/PaymentsApp/DefaultErrorResponseEntity.cs b/Adyen/Model/PaymentsApp/DefaultErrorResponseEntity.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/DefaultErrorResponseEntity.cs rename to Adyen/Model/PaymentsApp/DefaultErrorResponseEntity.cs diff --git a/Adyen/src/Model/PaymentsApp/InvalidField.cs b/Adyen/Model/PaymentsApp/InvalidField.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/InvalidField.cs rename to Adyen/Model/PaymentsApp/InvalidField.cs diff --git a/Adyen/src/Model/PaymentsApp/PaymentsAppDto.cs b/Adyen/Model/PaymentsApp/PaymentsAppDto.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/PaymentsAppDto.cs rename to Adyen/Model/PaymentsApp/PaymentsAppDto.cs diff --git a/Adyen/src/Model/PaymentsApp/PaymentsAppResponse.cs b/Adyen/Model/PaymentsApp/PaymentsAppResponse.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/PaymentsAppResponse.cs rename to Adyen/Model/PaymentsApp/PaymentsAppResponse.cs diff --git a/Adyen/src/Model/Payout/AbstractOpenAPISchema.cs b/Adyen/Model/Payout/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Payout/AbstractOpenAPISchema.cs rename to Adyen/Model/Payout/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Payout/Address.cs b/Adyen/Model/Payout/Address.cs similarity index 100% rename from Adyen/src/Model/Payout/Address.cs rename to Adyen/Model/Payout/Address.cs diff --git a/Adyen/src/Model/Payout/Amount.cs b/Adyen/Model/Payout/Amount.cs similarity index 100% rename from Adyen/src/Model/Payout/Amount.cs rename to Adyen/Model/Payout/Amount.cs diff --git a/Adyen/src/Model/Payout/BankAccount.cs b/Adyen/Model/Payout/BankAccount.cs similarity index 100% rename from Adyen/src/Model/Payout/BankAccount.cs rename to Adyen/Model/Payout/BankAccount.cs diff --git a/Adyen/src/Model/Payout/Card.cs b/Adyen/Model/Payout/Card.cs similarity index 100% rename from Adyen/src/Model/Payout/Card.cs rename to Adyen/Model/Payout/Card.cs diff --git a/Adyen/src/Model/Payout/FraudCheckResult.cs b/Adyen/Model/Payout/FraudCheckResult.cs similarity index 100% rename from Adyen/src/Model/Payout/FraudCheckResult.cs rename to Adyen/Model/Payout/FraudCheckResult.cs diff --git a/Adyen/src/Model/Payout/FraudCheckResultWrapper.cs b/Adyen/Model/Payout/FraudCheckResultWrapper.cs similarity index 100% rename from Adyen/src/Model/Payout/FraudCheckResultWrapper.cs rename to Adyen/Model/Payout/FraudCheckResultWrapper.cs diff --git a/Adyen/src/Model/Payout/FraudResult.cs b/Adyen/Model/Payout/FraudResult.cs similarity index 100% rename from Adyen/src/Model/Payout/FraudResult.cs rename to Adyen/Model/Payout/FraudResult.cs diff --git a/Adyen/src/Model/Payout/FundSource.cs b/Adyen/Model/Payout/FundSource.cs similarity index 100% rename from Adyen/src/Model/Payout/FundSource.cs rename to Adyen/Model/Payout/FundSource.cs diff --git a/Adyen/src/Model/Payout/ModifyRequest.cs b/Adyen/Model/Payout/ModifyRequest.cs similarity index 100% rename from Adyen/src/Model/Payout/ModifyRequest.cs rename to Adyen/Model/Payout/ModifyRequest.cs diff --git a/Adyen/src/Model/Payout/ModifyResponse.cs b/Adyen/Model/Payout/ModifyResponse.cs similarity index 100% rename from Adyen/src/Model/Payout/ModifyResponse.cs rename to Adyen/Model/Payout/ModifyResponse.cs diff --git a/Adyen/src/Model/Payout/Name.cs b/Adyen/Model/Payout/Name.cs similarity index 100% rename from Adyen/src/Model/Payout/Name.cs rename to Adyen/Model/Payout/Name.cs diff --git a/Adyen/src/Model/Payout/PayoutRequest.cs b/Adyen/Model/Payout/PayoutRequest.cs similarity index 100% rename from Adyen/src/Model/Payout/PayoutRequest.cs rename to Adyen/Model/Payout/PayoutRequest.cs diff --git a/Adyen/src/Model/Payout/PayoutResponse.cs b/Adyen/Model/Payout/PayoutResponse.cs similarity index 100% rename from Adyen/src/Model/Payout/PayoutResponse.cs rename to Adyen/Model/Payout/PayoutResponse.cs diff --git a/Adyen/src/Model/Payout/Recurring.cs b/Adyen/Model/Payout/Recurring.cs similarity index 100% rename from Adyen/src/Model/Payout/Recurring.cs rename to Adyen/Model/Payout/Recurring.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalData3DSecure.cs b/Adyen/Model/Payout/ResponseAdditionalData3DSecure.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalData3DSecure.cs rename to Adyen/Model/Payout/ResponseAdditionalData3DSecure.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataBillingAddress.cs b/Adyen/Model/Payout/ResponseAdditionalDataBillingAddress.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataBillingAddress.cs rename to Adyen/Model/Payout/ResponseAdditionalDataBillingAddress.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataCard.cs b/Adyen/Model/Payout/ResponseAdditionalDataCard.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataCard.cs rename to Adyen/Model/Payout/ResponseAdditionalDataCard.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataCommon.cs b/Adyen/Model/Payout/ResponseAdditionalDataCommon.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataCommon.cs rename to Adyen/Model/Payout/ResponseAdditionalDataCommon.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataDomesticError.cs b/Adyen/Model/Payout/ResponseAdditionalDataDomesticError.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataDomesticError.cs rename to Adyen/Model/Payout/ResponseAdditionalDataDomesticError.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataInstallments.cs b/Adyen/Model/Payout/ResponseAdditionalDataInstallments.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataInstallments.cs rename to Adyen/Model/Payout/ResponseAdditionalDataInstallments.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataNetworkTokens.cs b/Adyen/Model/Payout/ResponseAdditionalDataNetworkTokens.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataNetworkTokens.cs rename to Adyen/Model/Payout/ResponseAdditionalDataNetworkTokens.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataOpi.cs b/Adyen/Model/Payout/ResponseAdditionalDataOpi.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataOpi.cs rename to Adyen/Model/Payout/ResponseAdditionalDataOpi.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataSepa.cs b/Adyen/Model/Payout/ResponseAdditionalDataSepa.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataSepa.cs rename to Adyen/Model/Payout/ResponseAdditionalDataSepa.cs diff --git a/Adyen/src/Model/Payout/ServiceError.cs b/Adyen/Model/Payout/ServiceError.cs similarity index 100% rename from Adyen/src/Model/Payout/ServiceError.cs rename to Adyen/Model/Payout/ServiceError.cs diff --git a/Adyen/src/Model/Payout/StoreDetailAndSubmitRequest.cs b/Adyen/Model/Payout/StoreDetailAndSubmitRequest.cs similarity index 100% rename from Adyen/src/Model/Payout/StoreDetailAndSubmitRequest.cs rename to Adyen/Model/Payout/StoreDetailAndSubmitRequest.cs diff --git a/Adyen/src/Model/Payout/StoreDetailAndSubmitResponse.cs b/Adyen/Model/Payout/StoreDetailAndSubmitResponse.cs similarity index 100% rename from Adyen/src/Model/Payout/StoreDetailAndSubmitResponse.cs rename to Adyen/Model/Payout/StoreDetailAndSubmitResponse.cs diff --git a/Adyen/src/Model/Payout/StoreDetailRequest.cs b/Adyen/Model/Payout/StoreDetailRequest.cs similarity index 100% rename from Adyen/src/Model/Payout/StoreDetailRequest.cs rename to Adyen/Model/Payout/StoreDetailRequest.cs diff --git a/Adyen/src/Model/Payout/StoreDetailResponse.cs b/Adyen/Model/Payout/StoreDetailResponse.cs similarity index 100% rename from Adyen/src/Model/Payout/StoreDetailResponse.cs rename to Adyen/Model/Payout/StoreDetailResponse.cs diff --git a/Adyen/src/Model/Payout/SubmitRequest.cs b/Adyen/Model/Payout/SubmitRequest.cs similarity index 100% rename from Adyen/src/Model/Payout/SubmitRequest.cs rename to Adyen/Model/Payout/SubmitRequest.cs diff --git a/Adyen/src/Model/Payout/SubmitResponse.cs b/Adyen/Model/Payout/SubmitResponse.cs similarity index 100% rename from Adyen/src/Model/Payout/SubmitResponse.cs rename to Adyen/Model/Payout/SubmitResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/AbstractOpenAPISchema.cs b/Adyen/Model/PlatformsAccount/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/AbstractOpenAPISchema.cs rename to Adyen/Model/PlatformsAccount/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PlatformsAccount/Account.cs b/Adyen/Model/PlatformsAccount/Account.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/Account.cs rename to Adyen/Model/PlatformsAccount/Account.cs diff --git a/Adyen/src/Model/PlatformsAccount/AccountEvent.cs b/Adyen/Model/PlatformsAccount/AccountEvent.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/AccountEvent.cs rename to Adyen/Model/PlatformsAccount/AccountEvent.cs diff --git a/Adyen/src/Model/PlatformsAccount/AccountHolderDetails.cs b/Adyen/Model/PlatformsAccount/AccountHolderDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/AccountHolderDetails.cs rename to Adyen/Model/PlatformsAccount/AccountHolderDetails.cs diff --git a/Adyen/src/Model/PlatformsAccount/AccountHolderStatus.cs b/Adyen/Model/PlatformsAccount/AccountHolderStatus.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/AccountHolderStatus.cs rename to Adyen/Model/PlatformsAccount/AccountHolderStatus.cs diff --git a/Adyen/src/Model/PlatformsAccount/AccountPayoutState.cs b/Adyen/Model/PlatformsAccount/AccountPayoutState.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/AccountPayoutState.cs rename to Adyen/Model/PlatformsAccount/AccountPayoutState.cs diff --git a/Adyen/src/Model/PlatformsAccount/AccountProcessingState.cs b/Adyen/Model/PlatformsAccount/AccountProcessingState.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/AccountProcessingState.cs rename to Adyen/Model/PlatformsAccount/AccountProcessingState.cs diff --git a/Adyen/src/Model/PlatformsAccount/Amount.cs b/Adyen/Model/PlatformsAccount/Amount.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/Amount.cs rename to Adyen/Model/PlatformsAccount/Amount.cs diff --git a/Adyen/src/Model/PlatformsAccount/BankAccountDetail.cs b/Adyen/Model/PlatformsAccount/BankAccountDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/BankAccountDetail.cs rename to Adyen/Model/PlatformsAccount/BankAccountDetail.cs diff --git a/Adyen/src/Model/PlatformsAccount/BusinessDetails.cs b/Adyen/Model/PlatformsAccount/BusinessDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/BusinessDetails.cs rename to Adyen/Model/PlatformsAccount/BusinessDetails.cs diff --git a/Adyen/src/Model/PlatformsAccount/CloseAccountHolderRequest.cs b/Adyen/Model/PlatformsAccount/CloseAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CloseAccountHolderRequest.cs rename to Adyen/Model/PlatformsAccount/CloseAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/CloseAccountHolderResponse.cs b/Adyen/Model/PlatformsAccount/CloseAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CloseAccountHolderResponse.cs rename to Adyen/Model/PlatformsAccount/CloseAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/CloseAccountRequest.cs b/Adyen/Model/PlatformsAccount/CloseAccountRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CloseAccountRequest.cs rename to Adyen/Model/PlatformsAccount/CloseAccountRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/CloseAccountResponse.cs b/Adyen/Model/PlatformsAccount/CloseAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CloseAccountResponse.cs rename to Adyen/Model/PlatformsAccount/CloseAccountResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/CloseStoresRequest.cs b/Adyen/Model/PlatformsAccount/CloseStoresRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CloseStoresRequest.cs rename to Adyen/Model/PlatformsAccount/CloseStoresRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/CreateAccountHolderRequest.cs b/Adyen/Model/PlatformsAccount/CreateAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CreateAccountHolderRequest.cs rename to Adyen/Model/PlatformsAccount/CreateAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/CreateAccountHolderResponse.cs b/Adyen/Model/PlatformsAccount/CreateAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CreateAccountHolderResponse.cs rename to Adyen/Model/PlatformsAccount/CreateAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/CreateAccountRequest.cs b/Adyen/Model/PlatformsAccount/CreateAccountRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CreateAccountRequest.cs rename to Adyen/Model/PlatformsAccount/CreateAccountRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/CreateAccountResponse.cs b/Adyen/Model/PlatformsAccount/CreateAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CreateAccountResponse.cs rename to Adyen/Model/PlatformsAccount/CreateAccountResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/DeleteBankAccountRequest.cs b/Adyen/Model/PlatformsAccount/DeleteBankAccountRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/DeleteBankAccountRequest.cs rename to Adyen/Model/PlatformsAccount/DeleteBankAccountRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs b/Adyen/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs rename to Adyen/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/DeletePayoutMethodRequest.cs b/Adyen/Model/PlatformsAccount/DeletePayoutMethodRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/DeletePayoutMethodRequest.cs rename to Adyen/Model/PlatformsAccount/DeletePayoutMethodRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/DeleteShareholderRequest.cs b/Adyen/Model/PlatformsAccount/DeleteShareholderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/DeleteShareholderRequest.cs rename to Adyen/Model/PlatformsAccount/DeleteShareholderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/DeleteSignatoriesRequest.cs b/Adyen/Model/PlatformsAccount/DeleteSignatoriesRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/DeleteSignatoriesRequest.cs rename to Adyen/Model/PlatformsAccount/DeleteSignatoriesRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/DocumentDetail.cs b/Adyen/Model/PlatformsAccount/DocumentDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/DocumentDetail.cs rename to Adyen/Model/PlatformsAccount/DocumentDetail.cs diff --git a/Adyen/src/Model/PlatformsAccount/ErrorFieldType.cs b/Adyen/Model/PlatformsAccount/ErrorFieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ErrorFieldType.cs rename to Adyen/Model/PlatformsAccount/ErrorFieldType.cs diff --git a/Adyen/src/Model/PlatformsAccount/FieldType.cs b/Adyen/Model/PlatformsAccount/FieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/FieldType.cs rename to Adyen/Model/PlatformsAccount/FieldType.cs diff --git a/Adyen/src/Model/PlatformsAccount/GenericResponse.cs b/Adyen/Model/PlatformsAccount/GenericResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GenericResponse.cs rename to Adyen/Model/PlatformsAccount/GenericResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetAccountHolderRequest.cs b/Adyen/Model/PlatformsAccount/GetAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetAccountHolderRequest.cs rename to Adyen/Model/PlatformsAccount/GetAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetAccountHolderResponse.cs b/Adyen/Model/PlatformsAccount/GetAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetAccountHolderResponse.cs rename to Adyen/Model/PlatformsAccount/GetAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs b/Adyen/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs rename to Adyen/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetTaxFormRequest.cs b/Adyen/Model/PlatformsAccount/GetTaxFormRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetTaxFormRequest.cs rename to Adyen/Model/PlatformsAccount/GetTaxFormRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetTaxFormResponse.cs b/Adyen/Model/PlatformsAccount/GetTaxFormResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetTaxFormResponse.cs rename to Adyen/Model/PlatformsAccount/GetTaxFormResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs b/Adyen/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs rename to Adyen/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs b/Adyen/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs rename to Adyen/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/IndividualDetails.cs b/Adyen/Model/PlatformsAccount/IndividualDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/IndividualDetails.cs rename to Adyen/Model/PlatformsAccount/IndividualDetails.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCCheckStatusData.cs b/Adyen/Model/PlatformsAccount/KYCCheckStatusData.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCCheckStatusData.cs rename to Adyen/Model/PlatformsAccount/KYCCheckStatusData.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCCheckSummary.cs b/Adyen/Model/PlatformsAccount/KYCCheckSummary.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCCheckSummary.cs rename to Adyen/Model/PlatformsAccount/KYCCheckSummary.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCShareholderCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCShareholderCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCShareholderCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCShareholderCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCSignatoryCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCSignatoryCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCSignatoryCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCSignatoryCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCVerificationResult.cs b/Adyen/Model/PlatformsAccount/KYCVerificationResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCVerificationResult.cs rename to Adyen/Model/PlatformsAccount/KYCVerificationResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/LegalArrangementDetail.cs b/Adyen/Model/PlatformsAccount/LegalArrangementDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/LegalArrangementDetail.cs rename to Adyen/Model/PlatformsAccount/LegalArrangementDetail.cs diff --git a/Adyen/src/Model/PlatformsAccount/LegalArrangementEntityDetail.cs b/Adyen/Model/PlatformsAccount/LegalArrangementEntityDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/LegalArrangementEntityDetail.cs rename to Adyen/Model/PlatformsAccount/LegalArrangementEntityDetail.cs diff --git a/Adyen/src/Model/PlatformsAccount/LegalArrangementRequest.cs b/Adyen/Model/PlatformsAccount/LegalArrangementRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/LegalArrangementRequest.cs rename to Adyen/Model/PlatformsAccount/LegalArrangementRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/MigratedAccounts.cs b/Adyen/Model/PlatformsAccount/MigratedAccounts.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/MigratedAccounts.cs rename to Adyen/Model/PlatformsAccount/MigratedAccounts.cs diff --git a/Adyen/src/Model/PlatformsAccount/MigratedShareholders.cs b/Adyen/Model/PlatformsAccount/MigratedShareholders.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/MigratedShareholders.cs rename to Adyen/Model/PlatformsAccount/MigratedShareholders.cs diff --git a/Adyen/src/Model/PlatformsAccount/MigratedStores.cs b/Adyen/Model/PlatformsAccount/MigratedStores.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/MigratedStores.cs rename to Adyen/Model/PlatformsAccount/MigratedStores.cs diff --git a/Adyen/src/Model/PlatformsAccount/MigrationData.cs b/Adyen/Model/PlatformsAccount/MigrationData.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/MigrationData.cs rename to Adyen/Model/PlatformsAccount/MigrationData.cs diff --git a/Adyen/src/Model/PlatformsAccount/PayoutMethod.cs b/Adyen/Model/PlatformsAccount/PayoutMethod.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/PayoutMethod.cs rename to Adyen/Model/PlatformsAccount/PayoutMethod.cs diff --git a/Adyen/src/Model/PlatformsAccount/PayoutScheduleResponse.cs b/Adyen/Model/PlatformsAccount/PayoutScheduleResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/PayoutScheduleResponse.cs rename to Adyen/Model/PlatformsAccount/PayoutScheduleResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/PerformVerificationRequest.cs b/Adyen/Model/PlatformsAccount/PerformVerificationRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/PerformVerificationRequest.cs rename to Adyen/Model/PlatformsAccount/PerformVerificationRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/PersonalDocumentData.cs b/Adyen/Model/PlatformsAccount/PersonalDocumentData.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/PersonalDocumentData.cs rename to Adyen/Model/PlatformsAccount/PersonalDocumentData.cs diff --git a/Adyen/src/Model/PlatformsAccount/ServiceError.cs b/Adyen/Model/PlatformsAccount/ServiceError.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ServiceError.cs rename to Adyen/Model/PlatformsAccount/ServiceError.cs diff --git a/Adyen/src/Model/PlatformsAccount/ShareholderContact.cs b/Adyen/Model/PlatformsAccount/ShareholderContact.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ShareholderContact.cs rename to Adyen/Model/PlatformsAccount/ShareholderContact.cs diff --git a/Adyen/src/Model/PlatformsAccount/SignatoryContact.cs b/Adyen/Model/PlatformsAccount/SignatoryContact.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/SignatoryContact.cs rename to Adyen/Model/PlatformsAccount/SignatoryContact.cs diff --git a/Adyen/src/Model/PlatformsAccount/StoreDetail.cs b/Adyen/Model/PlatformsAccount/StoreDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/StoreDetail.cs rename to Adyen/Model/PlatformsAccount/StoreDetail.cs diff --git a/Adyen/src/Model/PlatformsAccount/SuspendAccountHolderRequest.cs b/Adyen/Model/PlatformsAccount/SuspendAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/SuspendAccountHolderRequest.cs rename to Adyen/Model/PlatformsAccount/SuspendAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/SuspendAccountHolderResponse.cs b/Adyen/Model/PlatformsAccount/SuspendAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/SuspendAccountHolderResponse.cs rename to Adyen/Model/PlatformsAccount/SuspendAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/UltimateParentCompany.cs b/Adyen/Model/PlatformsAccount/UltimateParentCompany.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UltimateParentCompany.cs rename to Adyen/Model/PlatformsAccount/UltimateParentCompany.cs diff --git a/Adyen/src/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs b/Adyen/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs rename to Adyen/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs diff --git a/Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs b/Adyen/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs rename to Adyen/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs b/Adyen/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs rename to Adyen/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/UpdateAccountHolderRequest.cs b/Adyen/Model/PlatformsAccount/UpdateAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UpdateAccountHolderRequest.cs rename to Adyen/Model/PlatformsAccount/UpdateAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/UpdateAccountHolderResponse.cs b/Adyen/Model/PlatformsAccount/UpdateAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UpdateAccountHolderResponse.cs rename to Adyen/Model/PlatformsAccount/UpdateAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs b/Adyen/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs rename to Adyen/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/UpdateAccountRequest.cs b/Adyen/Model/PlatformsAccount/UpdateAccountRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UpdateAccountRequest.cs rename to Adyen/Model/PlatformsAccount/UpdateAccountRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/UpdateAccountResponse.cs b/Adyen/Model/PlatformsAccount/UpdateAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UpdateAccountResponse.cs rename to Adyen/Model/PlatformsAccount/UpdateAccountResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs b/Adyen/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs rename to Adyen/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/UploadDocumentRequest.cs b/Adyen/Model/PlatformsAccount/UploadDocumentRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UploadDocumentRequest.cs rename to Adyen/Model/PlatformsAccount/UploadDocumentRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/ViasAddress.cs b/Adyen/Model/PlatformsAccount/ViasAddress.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ViasAddress.cs rename to Adyen/Model/PlatformsAccount/ViasAddress.cs diff --git a/Adyen/src/Model/PlatformsAccount/ViasName.cs b/Adyen/Model/PlatformsAccount/ViasName.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ViasName.cs rename to Adyen/Model/PlatformsAccount/ViasName.cs diff --git a/Adyen/src/Model/PlatformsAccount/ViasPersonalData.cs b/Adyen/Model/PlatformsAccount/ViasPersonalData.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ViasPersonalData.cs rename to Adyen/Model/PlatformsAccount/ViasPersonalData.cs diff --git a/Adyen/src/Model/PlatformsAccount/ViasPhoneNumber.cs b/Adyen/Model/PlatformsAccount/ViasPhoneNumber.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ViasPhoneNumber.cs rename to Adyen/Model/PlatformsAccount/ViasPhoneNumber.cs diff --git a/Adyen/src/Model/PlatformsFund/AbstractOpenAPISchema.cs b/Adyen/Model/PlatformsFund/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AbstractOpenAPISchema.cs rename to Adyen/Model/PlatformsFund/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PlatformsFund/AccountDetailBalance.cs b/Adyen/Model/PlatformsFund/AccountDetailBalance.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AccountDetailBalance.cs rename to Adyen/Model/PlatformsFund/AccountDetailBalance.cs diff --git a/Adyen/src/Model/PlatformsFund/AccountHolderBalanceRequest.cs b/Adyen/Model/PlatformsFund/AccountHolderBalanceRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AccountHolderBalanceRequest.cs rename to Adyen/Model/PlatformsFund/AccountHolderBalanceRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/AccountHolderBalanceResponse.cs b/Adyen/Model/PlatformsFund/AccountHolderBalanceResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AccountHolderBalanceResponse.cs rename to Adyen/Model/PlatformsFund/AccountHolderBalanceResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/AccountHolderTransactionListRequest.cs b/Adyen/Model/PlatformsFund/AccountHolderTransactionListRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AccountHolderTransactionListRequest.cs rename to Adyen/Model/PlatformsFund/AccountHolderTransactionListRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/AccountHolderTransactionListResponse.cs b/Adyen/Model/PlatformsFund/AccountHolderTransactionListResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AccountHolderTransactionListResponse.cs rename to Adyen/Model/PlatformsFund/AccountHolderTransactionListResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/AccountTransactionList.cs b/Adyen/Model/PlatformsFund/AccountTransactionList.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AccountTransactionList.cs rename to Adyen/Model/PlatformsFund/AccountTransactionList.cs diff --git a/Adyen/src/Model/PlatformsFund/Amount.cs b/Adyen/Model/PlatformsFund/Amount.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/Amount.cs rename to Adyen/Model/PlatformsFund/Amount.cs diff --git a/Adyen/src/Model/PlatformsFund/BankAccountDetail.cs b/Adyen/Model/PlatformsFund/BankAccountDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/BankAccountDetail.cs rename to Adyen/Model/PlatformsFund/BankAccountDetail.cs diff --git a/Adyen/src/Model/PlatformsFund/DebitAccountHolderRequest.cs b/Adyen/Model/PlatformsFund/DebitAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/DebitAccountHolderRequest.cs rename to Adyen/Model/PlatformsFund/DebitAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/DebitAccountHolderResponse.cs b/Adyen/Model/PlatformsFund/DebitAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/DebitAccountHolderResponse.cs rename to Adyen/Model/PlatformsFund/DebitAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/DetailBalance.cs b/Adyen/Model/PlatformsFund/DetailBalance.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/DetailBalance.cs rename to Adyen/Model/PlatformsFund/DetailBalance.cs diff --git a/Adyen/src/Model/PlatformsFund/ErrorFieldType.cs b/Adyen/Model/PlatformsFund/ErrorFieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/ErrorFieldType.cs rename to Adyen/Model/PlatformsFund/ErrorFieldType.cs diff --git a/Adyen/src/Model/PlatformsFund/FieldType.cs b/Adyen/Model/PlatformsFund/FieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/FieldType.cs rename to Adyen/Model/PlatformsFund/FieldType.cs diff --git a/Adyen/src/Model/PlatformsFund/PayoutAccountHolderRequest.cs b/Adyen/Model/PlatformsFund/PayoutAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/PayoutAccountHolderRequest.cs rename to Adyen/Model/PlatformsFund/PayoutAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/PayoutAccountHolderResponse.cs b/Adyen/Model/PlatformsFund/PayoutAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/PayoutAccountHolderResponse.cs rename to Adyen/Model/PlatformsFund/PayoutAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/RefundFundsTransferRequest.cs b/Adyen/Model/PlatformsFund/RefundFundsTransferRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/RefundFundsTransferRequest.cs rename to Adyen/Model/PlatformsFund/RefundFundsTransferRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/RefundFundsTransferResponse.cs b/Adyen/Model/PlatformsFund/RefundFundsTransferResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/RefundFundsTransferResponse.cs rename to Adyen/Model/PlatformsFund/RefundFundsTransferResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs b/Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs rename to Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs b/Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs rename to Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/ServiceError.cs b/Adyen/Model/PlatformsFund/ServiceError.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/ServiceError.cs rename to Adyen/Model/PlatformsFund/ServiceError.cs diff --git a/Adyen/src/Model/PlatformsFund/SetupBeneficiaryRequest.cs b/Adyen/Model/PlatformsFund/SetupBeneficiaryRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/SetupBeneficiaryRequest.cs rename to Adyen/Model/PlatformsFund/SetupBeneficiaryRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/SetupBeneficiaryResponse.cs b/Adyen/Model/PlatformsFund/SetupBeneficiaryResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/SetupBeneficiaryResponse.cs rename to Adyen/Model/PlatformsFund/SetupBeneficiaryResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/Split.cs b/Adyen/Model/PlatformsFund/Split.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/Split.cs rename to Adyen/Model/PlatformsFund/Split.cs diff --git a/Adyen/src/Model/PlatformsFund/SplitAmount.cs b/Adyen/Model/PlatformsFund/SplitAmount.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/SplitAmount.cs rename to Adyen/Model/PlatformsFund/SplitAmount.cs diff --git a/Adyen/src/Model/PlatformsFund/Transaction.cs b/Adyen/Model/PlatformsFund/Transaction.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/Transaction.cs rename to Adyen/Model/PlatformsFund/Transaction.cs diff --git a/Adyen/src/Model/PlatformsFund/TransactionListForAccount.cs b/Adyen/Model/PlatformsFund/TransactionListForAccount.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/TransactionListForAccount.cs rename to Adyen/Model/PlatformsFund/TransactionListForAccount.cs diff --git a/Adyen/src/Model/PlatformsFund/TransferFundsRequest.cs b/Adyen/Model/PlatformsFund/TransferFundsRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/TransferFundsRequest.cs rename to Adyen/Model/PlatformsFund/TransferFundsRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/TransferFundsResponse.cs b/Adyen/Model/PlatformsFund/TransferFundsResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/TransferFundsResponse.cs rename to Adyen/Model/PlatformsFund/TransferFundsResponse.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs b/Adyen/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/CollectInformation.cs b/Adyen/Model/PlatformsHostedOnboardingPage/CollectInformation.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/CollectInformation.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/CollectInformation.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs b/Adyen/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/FieldType.cs b/Adyen/Model/PlatformsHostedOnboardingPage/FieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/FieldType.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/FieldType.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs b/Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs b/Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs b/Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs b/Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/ServiceError.cs b/Adyen/Model/PlatformsHostedOnboardingPage/ServiceError.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/ServiceError.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/ServiceError.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/ShowPages.cs b/Adyen/Model/PlatformsHostedOnboardingPage/ShowPages.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/ShowPages.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/ShowPages.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs b/Adyen/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs rename to Adyen/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs b/Adyen/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs rename to Adyen/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs b/Adyen/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs rename to Adyen/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs b/Adyen/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs rename to Adyen/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs b/Adyen/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs rename to Adyen/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/FieldType.cs b/Adyen/Model/PlatformsNotificationConfiguration/FieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/FieldType.cs rename to Adyen/Model/PlatformsNotificationConfiguration/FieldType.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/GenericResponse.cs b/Adyen/Model/PlatformsNotificationConfiguration/GenericResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/GenericResponse.cs rename to Adyen/Model/PlatformsNotificationConfiguration/GenericResponse.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs b/Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs rename to Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs b/Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs rename to Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs b/Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs rename to Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs b/Adyen/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs rename to Adyen/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs b/Adyen/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs rename to Adyen/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/ServiceError.cs b/Adyen/Model/PlatformsNotificationConfiguration/ServiceError.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/ServiceError.cs rename to Adyen/Model/PlatformsNotificationConfiguration/ServiceError.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs b/Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs rename to Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs b/Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs rename to Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs b/Adyen/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs rename to Adyen/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountCloseNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountCloseNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountCloseNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountCloseNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountCreateNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountCreateNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountCreateNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountCreateNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountEvent.cs b/Adyen/Model/PlatformsWebhooks/AccountEvent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountEvent.cs rename to Adyen/Model/PlatformsWebhooks/AccountEvent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderDetails.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderDetails.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderDetails.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderStatus.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderStatus.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderStatus.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderStatus.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountPayoutState.cs b/Adyen/Model/PlatformsWebhooks/AccountPayoutState.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountPayoutState.cs rename to Adyen/Model/PlatformsWebhooks/AccountPayoutState.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountProcessingState.cs b/Adyen/Model/PlatformsWebhooks/AccountProcessingState.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountProcessingState.cs rename to Adyen/Model/PlatformsWebhooks/AccountProcessingState.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountUpdateNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountUpdateNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountUpdateNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountUpdateNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/Amount.cs b/Adyen/Model/PlatformsWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/Amount.cs rename to Adyen/Model/PlatformsWebhooks/Amount.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/BankAccountDetail.cs b/Adyen/Model/PlatformsWebhooks/BankAccountDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/BankAccountDetail.cs rename to Adyen/Model/PlatformsWebhooks/BankAccountDetail.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs b/Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs rename to Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/BusinessDetails.cs b/Adyen/Model/PlatformsWebhooks/BusinessDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/BusinessDetails.cs rename to Adyen/Model/PlatformsWebhooks/BusinessDetails.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/CloseAccountResponse.cs b/Adyen/Model/PlatformsWebhooks/CloseAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/CloseAccountResponse.cs rename to Adyen/Model/PlatformsWebhooks/CloseAccountResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs b/Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs rename to Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs b/Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs rename to Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs b/Adyen/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs rename to Adyen/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/CreateAccountResponse.cs b/Adyen/Model/PlatformsWebhooks/CreateAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/CreateAccountResponse.cs rename to Adyen/Model/PlatformsWebhooks/CreateAccountResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs b/Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs rename to Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ErrorFieldType.cs b/Adyen/Model/PlatformsWebhooks/ErrorFieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ErrorFieldType.cs rename to Adyen/Model/PlatformsWebhooks/ErrorFieldType.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/FieldType.cs b/Adyen/Model/PlatformsWebhooks/FieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/FieldType.cs rename to Adyen/Model/PlatformsWebhooks/FieldType.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/IndividualDetails.cs b/Adyen/Model/PlatformsWebhooks/IndividualDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/IndividualDetails.cs rename to Adyen/Model/PlatformsWebhooks/IndividualDetails.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCCheckStatusData.cs b/Adyen/Model/PlatformsWebhooks/KYCCheckStatusData.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCCheckStatusData.cs rename to Adyen/Model/PlatformsWebhooks/KYCCheckStatusData.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCCheckSummary.cs b/Adyen/Model/PlatformsWebhooks/KYCCheckSummary.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCCheckSummary.cs rename to Adyen/Model/PlatformsWebhooks/KYCCheckSummary.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCVerificationResult.cs b/Adyen/Model/PlatformsWebhooks/KYCVerificationResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCVerificationResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCVerificationResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/LegalArrangementDetail.cs b/Adyen/Model/PlatformsWebhooks/LegalArrangementDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/LegalArrangementDetail.cs rename to Adyen/Model/PlatformsWebhooks/LegalArrangementDetail.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs b/Adyen/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs rename to Adyen/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/LocalDate.cs b/Adyen/Model/PlatformsWebhooks/LocalDate.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/LocalDate.cs rename to Adyen/Model/PlatformsWebhooks/LocalDate.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/Message.cs b/Adyen/Model/PlatformsWebhooks/Message.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/Message.cs rename to Adyen/Model/PlatformsWebhooks/Message.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/NotificationErrorContainer.cs b/Adyen/Model/PlatformsWebhooks/NotificationErrorContainer.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/NotificationErrorContainer.cs rename to Adyen/Model/PlatformsWebhooks/NotificationErrorContainer.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/NotificationResponse.cs b/Adyen/Model/PlatformsWebhooks/NotificationResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/NotificationResponse.cs rename to Adyen/Model/PlatformsWebhooks/NotificationResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/OperationStatus.cs b/Adyen/Model/PlatformsWebhooks/OperationStatus.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/OperationStatus.cs rename to Adyen/Model/PlatformsWebhooks/OperationStatus.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotification.cs b/Adyen/Model/PlatformsWebhooks/PaymentFailureNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotification.cs rename to Adyen/Model/PlatformsWebhooks/PaymentFailureNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/PayoutMethod.cs b/Adyen/Model/PlatformsWebhooks/PayoutMethod.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/PayoutMethod.cs rename to Adyen/Model/PlatformsWebhooks/PayoutMethod.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/PayoutScheduleResponse.cs b/Adyen/Model/PlatformsWebhooks/PayoutScheduleResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/PayoutScheduleResponse.cs rename to Adyen/Model/PlatformsWebhooks/PayoutScheduleResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/PersonalDocumentData.cs b/Adyen/Model/PlatformsWebhooks/PersonalDocumentData.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/PersonalDocumentData.cs rename to Adyen/Model/PlatformsWebhooks/PersonalDocumentData.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs b/Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs rename to Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/RefundResult.cs b/Adyen/Model/PlatformsWebhooks/RefundResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/RefundResult.cs rename to Adyen/Model/PlatformsWebhooks/RefundResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotification.cs b/Adyen/Model/PlatformsWebhooks/ReportAvailableNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotification.cs rename to Adyen/Model/PlatformsWebhooks/ReportAvailableNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs b/Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs rename to Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ShareholderContact.cs b/Adyen/Model/PlatformsWebhooks/ShareholderContact.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ShareholderContact.cs rename to Adyen/Model/PlatformsWebhooks/ShareholderContact.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/SignatoryContact.cs b/Adyen/Model/PlatformsWebhooks/SignatoryContact.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/SignatoryContact.cs rename to Adyen/Model/PlatformsWebhooks/SignatoryContact.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/Split.cs b/Adyen/Model/PlatformsWebhooks/Split.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/Split.cs rename to Adyen/Model/PlatformsWebhooks/Split.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/SplitAmount.cs b/Adyen/Model/PlatformsWebhooks/SplitAmount.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/SplitAmount.cs rename to Adyen/Model/PlatformsWebhooks/SplitAmount.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/StoreDetail.cs b/Adyen/Model/PlatformsWebhooks/StoreDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/StoreDetail.cs rename to Adyen/Model/PlatformsWebhooks/StoreDetail.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/Transaction.cs b/Adyen/Model/PlatformsWebhooks/Transaction.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/Transaction.cs rename to Adyen/Model/PlatformsWebhooks/Transaction.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/TransferFundsNotification.cs b/Adyen/Model/PlatformsWebhooks/TransferFundsNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/TransferFundsNotification.cs rename to Adyen/Model/PlatformsWebhooks/TransferFundsNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/UltimateParentCompany.cs b/Adyen/Model/PlatformsWebhooks/UltimateParentCompany.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/UltimateParentCompany.cs rename to Adyen/Model/PlatformsWebhooks/UltimateParentCompany.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs b/Adyen/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs rename to Adyen/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs b/Adyen/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs rename to Adyen/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/UpdateAccountResponse.cs b/Adyen/Model/PlatformsWebhooks/UpdateAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/UpdateAccountResponse.cs rename to Adyen/Model/PlatformsWebhooks/UpdateAccountResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ViasAddress.cs b/Adyen/Model/PlatformsWebhooks/ViasAddress.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ViasAddress.cs rename to Adyen/Model/PlatformsWebhooks/ViasAddress.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ViasName.cs b/Adyen/Model/PlatformsWebhooks/ViasName.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ViasName.cs rename to Adyen/Model/PlatformsWebhooks/ViasName.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ViasPersonalData.cs b/Adyen/Model/PlatformsWebhooks/ViasPersonalData.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ViasPersonalData.cs rename to Adyen/Model/PlatformsWebhooks/ViasPersonalData.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ViasPhoneNumber.cs b/Adyen/Model/PlatformsWebhooks/ViasPhoneNumber.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ViasPhoneNumber.cs rename to Adyen/Model/PlatformsWebhooks/ViasPhoneNumber.cs diff --git a/Adyen/src/Model/PosMobile/AbstractOpenAPISchema.cs b/Adyen/Model/PosMobile/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PosMobile/AbstractOpenAPISchema.cs rename to Adyen/Model/PosMobile/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PosMobile/CreateSessionRequest.cs b/Adyen/Model/PosMobile/CreateSessionRequest.cs similarity index 100% rename from Adyen/src/Model/PosMobile/CreateSessionRequest.cs rename to Adyen/Model/PosMobile/CreateSessionRequest.cs diff --git a/Adyen/src/Model/PosMobile/CreateSessionResponse.cs b/Adyen/Model/PosMobile/CreateSessionResponse.cs similarity index 100% rename from Adyen/src/Model/PosMobile/CreateSessionResponse.cs rename to Adyen/Model/PosMobile/CreateSessionResponse.cs diff --git a/Adyen/src/Model/PosTerminalManagement/AbstractOpenAPISchema.cs b/Adyen/Model/PosTerminalManagement/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/AbstractOpenAPISchema.cs rename to Adyen/Model/PosTerminalManagement/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PosTerminalManagement/Address.cs b/Adyen/Model/PosTerminalManagement/Address.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/Address.cs rename to Adyen/Model/PosTerminalManagement/Address.cs diff --git a/Adyen/src/Model/PosTerminalManagement/AssignTerminalsRequest.cs b/Adyen/Model/PosTerminalManagement/AssignTerminalsRequest.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/AssignTerminalsRequest.cs rename to Adyen/Model/PosTerminalManagement/AssignTerminalsRequest.cs diff --git a/Adyen/src/Model/PosTerminalManagement/AssignTerminalsResponse.cs b/Adyen/Model/PosTerminalManagement/AssignTerminalsResponse.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/AssignTerminalsResponse.cs rename to Adyen/Model/PosTerminalManagement/AssignTerminalsResponse.cs diff --git a/Adyen/src/Model/PosTerminalManagement/FindTerminalRequest.cs b/Adyen/Model/PosTerminalManagement/FindTerminalRequest.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/FindTerminalRequest.cs rename to Adyen/Model/PosTerminalManagement/FindTerminalRequest.cs diff --git a/Adyen/src/Model/PosTerminalManagement/FindTerminalResponse.cs b/Adyen/Model/PosTerminalManagement/FindTerminalResponse.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/FindTerminalResponse.cs rename to Adyen/Model/PosTerminalManagement/FindTerminalResponse.cs diff --git a/Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs b/Adyen/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs rename to Adyen/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs diff --git a/Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs b/Adyen/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs rename to Adyen/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs diff --git a/Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs b/Adyen/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs rename to Adyen/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs diff --git a/Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs b/Adyen/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs rename to Adyen/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs diff --git a/Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs b/Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs rename to Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs diff --git a/Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs b/Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs rename to Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs diff --git a/Adyen/src/Model/PosTerminalManagement/MerchantAccount.cs b/Adyen/Model/PosTerminalManagement/MerchantAccount.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/MerchantAccount.cs rename to Adyen/Model/PosTerminalManagement/MerchantAccount.cs diff --git a/Adyen/src/Model/PosTerminalManagement/ServiceError.cs b/Adyen/Model/PosTerminalManagement/ServiceError.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/ServiceError.cs rename to Adyen/Model/PosTerminalManagement/ServiceError.cs diff --git a/Adyen/src/Model/PosTerminalManagement/Store.cs b/Adyen/Model/PosTerminalManagement/Store.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/Store.cs rename to Adyen/Model/PosTerminalManagement/Store.cs diff --git a/Adyen/src/Model/Recurring/AbstractOpenAPISchema.cs b/Adyen/Model/Recurring/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Recurring/AbstractOpenAPISchema.cs rename to Adyen/Model/Recurring/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Recurring/Address.cs b/Adyen/Model/Recurring/Address.cs similarity index 100% rename from Adyen/src/Model/Recurring/Address.cs rename to Adyen/Model/Recurring/Address.cs diff --git a/Adyen/src/Model/Recurring/Amount.cs b/Adyen/Model/Recurring/Amount.cs similarity index 100% rename from Adyen/src/Model/Recurring/Amount.cs rename to Adyen/Model/Recurring/Amount.cs diff --git a/Adyen/src/Model/Recurring/BankAccount.cs b/Adyen/Model/Recurring/BankAccount.cs similarity index 100% rename from Adyen/src/Model/Recurring/BankAccount.cs rename to Adyen/Model/Recurring/BankAccount.cs diff --git a/Adyen/src/Model/Recurring/Card.cs b/Adyen/Model/Recurring/Card.cs similarity index 100% rename from Adyen/src/Model/Recurring/Card.cs rename to Adyen/Model/Recurring/Card.cs diff --git a/Adyen/src/Model/Recurring/CreatePermitRequest.cs b/Adyen/Model/Recurring/CreatePermitRequest.cs similarity index 100% rename from Adyen/src/Model/Recurring/CreatePermitRequest.cs rename to Adyen/Model/Recurring/CreatePermitRequest.cs diff --git a/Adyen/src/Model/Recurring/CreatePermitResult.cs b/Adyen/Model/Recurring/CreatePermitResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/CreatePermitResult.cs rename to Adyen/Model/Recurring/CreatePermitResult.cs diff --git a/Adyen/src/Model/Recurring/DisablePermitRequest.cs b/Adyen/Model/Recurring/DisablePermitRequest.cs similarity index 100% rename from Adyen/src/Model/Recurring/DisablePermitRequest.cs rename to Adyen/Model/Recurring/DisablePermitRequest.cs diff --git a/Adyen/src/Model/Recurring/DisablePermitResult.cs b/Adyen/Model/Recurring/DisablePermitResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/DisablePermitResult.cs rename to Adyen/Model/Recurring/DisablePermitResult.cs diff --git a/Adyen/src/Model/Recurring/DisableRequest.cs b/Adyen/Model/Recurring/DisableRequest.cs similarity index 100% rename from Adyen/src/Model/Recurring/DisableRequest.cs rename to Adyen/Model/Recurring/DisableRequest.cs diff --git a/Adyen/src/Model/Recurring/DisableResult.cs b/Adyen/Model/Recurring/DisableResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/DisableResult.cs rename to Adyen/Model/Recurring/DisableResult.cs diff --git a/Adyen/src/Model/Recurring/Name.cs b/Adyen/Model/Recurring/Name.cs similarity index 100% rename from Adyen/src/Model/Recurring/Name.cs rename to Adyen/Model/Recurring/Name.cs diff --git a/Adyen/src/Model/Recurring/NotifyShopperRequest.cs b/Adyen/Model/Recurring/NotifyShopperRequest.cs similarity index 100% rename from Adyen/src/Model/Recurring/NotifyShopperRequest.cs rename to Adyen/Model/Recurring/NotifyShopperRequest.cs diff --git a/Adyen/src/Model/Recurring/NotifyShopperResult.cs b/Adyen/Model/Recurring/NotifyShopperResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/NotifyShopperResult.cs rename to Adyen/Model/Recurring/NotifyShopperResult.cs diff --git a/Adyen/src/Model/Recurring/Permit.cs b/Adyen/Model/Recurring/Permit.cs similarity index 100% rename from Adyen/src/Model/Recurring/Permit.cs rename to Adyen/Model/Recurring/Permit.cs diff --git a/Adyen/src/Model/Recurring/PermitRestriction.cs b/Adyen/Model/Recurring/PermitRestriction.cs similarity index 100% rename from Adyen/src/Model/Recurring/PermitRestriction.cs rename to Adyen/Model/Recurring/PermitRestriction.cs diff --git a/Adyen/src/Model/Recurring/PermitResult.cs b/Adyen/Model/Recurring/PermitResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/PermitResult.cs rename to Adyen/Model/Recurring/PermitResult.cs diff --git a/Adyen/src/Model/Recurring/Recurring.cs b/Adyen/Model/Recurring/Recurring.cs similarity index 100% rename from Adyen/src/Model/Recurring/Recurring.cs rename to Adyen/Model/Recurring/Recurring.cs diff --git a/Adyen/src/Model/Recurring/RecurringDetail.cs b/Adyen/Model/Recurring/RecurringDetail.cs similarity index 100% rename from Adyen/src/Model/Recurring/RecurringDetail.cs rename to Adyen/Model/Recurring/RecurringDetail.cs diff --git a/Adyen/src/Model/Recurring/RecurringDetailWrapper.cs b/Adyen/Model/Recurring/RecurringDetailWrapper.cs similarity index 100% rename from Adyen/src/Model/Recurring/RecurringDetailWrapper.cs rename to Adyen/Model/Recurring/RecurringDetailWrapper.cs diff --git a/Adyen/src/Model/Recurring/RecurringDetailsRequest.cs b/Adyen/Model/Recurring/RecurringDetailsRequest.cs similarity index 100% rename from Adyen/src/Model/Recurring/RecurringDetailsRequest.cs rename to Adyen/Model/Recurring/RecurringDetailsRequest.cs diff --git a/Adyen/src/Model/Recurring/RecurringDetailsResult.cs b/Adyen/Model/Recurring/RecurringDetailsResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/RecurringDetailsResult.cs rename to Adyen/Model/Recurring/RecurringDetailsResult.cs diff --git a/Adyen/src/Model/Recurring/ScheduleAccountUpdaterRequest.cs b/Adyen/Model/Recurring/ScheduleAccountUpdaterRequest.cs similarity index 100% rename from Adyen/src/Model/Recurring/ScheduleAccountUpdaterRequest.cs rename to Adyen/Model/Recurring/ScheduleAccountUpdaterRequest.cs diff --git a/Adyen/src/Model/Recurring/ScheduleAccountUpdaterResult.cs b/Adyen/Model/Recurring/ScheduleAccountUpdaterResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/ScheduleAccountUpdaterResult.cs rename to Adyen/Model/Recurring/ScheduleAccountUpdaterResult.cs diff --git a/Adyen/src/Model/Recurring/ServiceError.cs b/Adyen/Model/Recurring/ServiceError.cs similarity index 100% rename from Adyen/src/Model/Recurring/ServiceError.cs rename to Adyen/Model/Recurring/ServiceError.cs diff --git a/Adyen/src/Model/Recurring/TokenDetails.cs b/Adyen/Model/Recurring/TokenDetails.cs similarity index 100% rename from Adyen/src/Model/Recurring/TokenDetails.cs rename to Adyen/Model/Recurring/TokenDetails.cs diff --git a/Adyen/src/Model/ReportWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/ReportWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/ReportWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/ReportWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/src/Model/ReportWebhooks/ReportNotificationData.cs b/Adyen/Model/ReportWebhooks/ReportNotificationData.cs similarity index 100% rename from Adyen/src/Model/ReportWebhooks/ReportNotificationData.cs rename to Adyen/Model/ReportWebhooks/ReportNotificationData.cs diff --git a/Adyen/src/Model/ReportWebhooks/ReportNotificationRequest.cs b/Adyen/Model/ReportWebhooks/ReportNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ReportWebhooks/ReportNotificationRequest.cs rename to Adyen/Model/ReportWebhooks/ReportNotificationRequest.cs diff --git a/Adyen/src/Model/ReportWebhooks/Resource.cs b/Adyen/Model/ReportWebhooks/Resource.cs similarity index 100% rename from Adyen/src/Model/ReportWebhooks/Resource.cs rename to Adyen/Model/ReportWebhooks/Resource.cs diff --git a/Adyen/src/Model/ReportWebhooks/ResourceReference.cs b/Adyen/Model/ReportWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/src/Model/ReportWebhooks/ResourceReference.cs rename to Adyen/Model/ReportWebhooks/ResourceReference.cs diff --git a/Adyen/src/Model/RequestOptions.cs b/Adyen/Model/RequestOptions.cs similarity index 100% rename from Adyen/src/Model/RequestOptions.cs rename to Adyen/Model/RequestOptions.cs diff --git a/Adyen/src/Model/StoredValue/AbstractOpenAPISchema.cs b/Adyen/Model/StoredValue/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/StoredValue/AbstractOpenAPISchema.cs rename to Adyen/Model/StoredValue/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/StoredValue/Amount.cs b/Adyen/Model/StoredValue/Amount.cs similarity index 100% rename from Adyen/src/Model/StoredValue/Amount.cs rename to Adyen/Model/StoredValue/Amount.cs diff --git a/Adyen/src/Model/StoredValue/ServiceError.cs b/Adyen/Model/StoredValue/ServiceError.cs similarity index 100% rename from Adyen/src/Model/StoredValue/ServiceError.cs rename to Adyen/Model/StoredValue/ServiceError.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueBalanceCheckRequest.cs b/Adyen/Model/StoredValue/StoredValueBalanceCheckRequest.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueBalanceCheckRequest.cs rename to Adyen/Model/StoredValue/StoredValueBalanceCheckRequest.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueBalanceCheckResponse.cs b/Adyen/Model/StoredValue/StoredValueBalanceCheckResponse.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueBalanceCheckResponse.cs rename to Adyen/Model/StoredValue/StoredValueBalanceCheckResponse.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueBalanceMergeRequest.cs b/Adyen/Model/StoredValue/StoredValueBalanceMergeRequest.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueBalanceMergeRequest.cs rename to Adyen/Model/StoredValue/StoredValueBalanceMergeRequest.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueBalanceMergeResponse.cs b/Adyen/Model/StoredValue/StoredValueBalanceMergeResponse.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueBalanceMergeResponse.cs rename to Adyen/Model/StoredValue/StoredValueBalanceMergeResponse.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueIssueRequest.cs b/Adyen/Model/StoredValue/StoredValueIssueRequest.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueIssueRequest.cs rename to Adyen/Model/StoredValue/StoredValueIssueRequest.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueIssueResponse.cs b/Adyen/Model/StoredValue/StoredValueIssueResponse.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueIssueResponse.cs rename to Adyen/Model/StoredValue/StoredValueIssueResponse.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueLoadRequest.cs b/Adyen/Model/StoredValue/StoredValueLoadRequest.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueLoadRequest.cs rename to Adyen/Model/StoredValue/StoredValueLoadRequest.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueLoadResponse.cs b/Adyen/Model/StoredValue/StoredValueLoadResponse.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueLoadResponse.cs rename to Adyen/Model/StoredValue/StoredValueLoadResponse.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueStatusChangeRequest.cs b/Adyen/Model/StoredValue/StoredValueStatusChangeRequest.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueStatusChangeRequest.cs rename to Adyen/Model/StoredValue/StoredValueStatusChangeRequest.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueStatusChangeResponse.cs b/Adyen/Model/StoredValue/StoredValueStatusChangeResponse.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueStatusChangeResponse.cs rename to Adyen/Model/StoredValue/StoredValueStatusChangeResponse.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueVoidRequest.cs b/Adyen/Model/StoredValue/StoredValueVoidRequest.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueVoidRequest.cs rename to Adyen/Model/StoredValue/StoredValueVoidRequest.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueVoidResponse.cs b/Adyen/Model/StoredValue/StoredValueVoidResponse.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueVoidResponse.cs rename to Adyen/Model/StoredValue/StoredValueVoidResponse.cs diff --git a/Adyen/src/Model/Terminal/SaleToAcquirerData.cs b/Adyen/Model/Terminal/SaleToAcquirerData.cs similarity index 100% rename from Adyen/src/Model/Terminal/SaleToAcquirerData.cs rename to Adyen/Model/Terminal/SaleToAcquirerData.cs diff --git a/Adyen/src/Model/Terminal/Split.cs b/Adyen/Model/Terminal/Split.cs similarity index 100% rename from Adyen/src/Model/Terminal/Split.cs rename to Adyen/Model/Terminal/Split.cs diff --git a/Adyen/src/Model/Terminal/SplitItem.cs b/Adyen/Model/Terminal/SplitItem.cs similarity index 100% rename from Adyen/src/Model/Terminal/SplitItem.cs rename to Adyen/Model/Terminal/SplitItem.cs diff --git a/Adyen/src/Model/Terminal/SplitItemType.cs b/Adyen/Model/Terminal/SplitItemType.cs similarity index 100% rename from Adyen/src/Model/Terminal/SplitItemType.cs rename to Adyen/Model/Terminal/SplitItemType.cs diff --git a/Adyen/src/Model/TerminalApi/AbortRequest.cs b/Adyen/Model/TerminalApi/AbortRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AbortRequest.cs rename to Adyen/Model/TerminalApi/AbortRequest.cs diff --git a/Adyen/src/Model/TerminalApi/AccountType.cs b/Adyen/Model/TerminalApi/AccountType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AccountType.cs rename to Adyen/Model/TerminalApi/AccountType.cs diff --git a/Adyen/src/Model/TerminalApi/AdminRequest.cs b/Adyen/Model/TerminalApi/AdminRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AdminRequest.cs rename to Adyen/Model/TerminalApi/AdminRequest.cs diff --git a/Adyen/src/Model/TerminalApi/AdminResponse.cs b/Adyen/Model/TerminalApi/AdminResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AdminResponse.cs rename to Adyen/Model/TerminalApi/AdminResponse.cs diff --git a/Adyen/src/Model/TerminalApi/AlgorithmIdentifier.cs b/Adyen/Model/TerminalApi/AlgorithmIdentifier.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AlgorithmIdentifier.cs rename to Adyen/Model/TerminalApi/AlgorithmIdentifier.cs diff --git a/Adyen/src/Model/TerminalApi/AlgorithmType.cs b/Adyen/Model/TerminalApi/AlgorithmType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AlgorithmType.cs rename to Adyen/Model/TerminalApi/AlgorithmType.cs diff --git a/Adyen/src/Model/TerminalApi/AlignmentType.cs b/Adyen/Model/TerminalApi/AlignmentType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AlignmentType.cs rename to Adyen/Model/TerminalApi/AlignmentType.cs diff --git a/Adyen/src/Model/TerminalApi/AllowedProduct.cs b/Adyen/Model/TerminalApi/AllowedProduct.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AllowedProduct.cs rename to Adyen/Model/TerminalApi/AllowedProduct.cs diff --git a/Adyen/src/Model/TerminalApi/Amount.cs b/Adyen/Model/TerminalApi/Amount.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Amount.cs rename to Adyen/Model/TerminalApi/Amount.cs diff --git a/Adyen/src/Model/TerminalApi/AmountsReq.cs b/Adyen/Model/TerminalApi/AmountsReq.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AmountsReq.cs rename to Adyen/Model/TerminalApi/AmountsReq.cs diff --git a/Adyen/src/Model/TerminalApi/AmountsResp.cs b/Adyen/Model/TerminalApi/AmountsResp.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AmountsResp.cs rename to Adyen/Model/TerminalApi/AmountsResp.cs diff --git a/Adyen/src/Model/TerminalApi/AreaSize.cs b/Adyen/Model/TerminalApi/AreaSize.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AreaSize.cs rename to Adyen/Model/TerminalApi/AreaSize.cs diff --git a/Adyen/src/Model/TerminalApi/AuthenticatedData.cs b/Adyen/Model/TerminalApi/AuthenticatedData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AuthenticatedData.cs rename to Adyen/Model/TerminalApi/AuthenticatedData.cs diff --git a/Adyen/src/Model/TerminalApi/AuthenticationMethodType.cs b/Adyen/Model/TerminalApi/AuthenticationMethodType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AuthenticationMethodType.cs rename to Adyen/Model/TerminalApi/AuthenticationMethodType.cs diff --git a/Adyen/src/Model/TerminalApi/BalanceInquiryRequest.cs b/Adyen/Model/TerminalApi/BalanceInquiryRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/BalanceInquiryRequest.cs rename to Adyen/Model/TerminalApi/BalanceInquiryRequest.cs diff --git a/Adyen/src/Model/TerminalApi/BalanceInquiryResponse.cs b/Adyen/Model/TerminalApi/BalanceInquiryResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/BalanceInquiryResponse.cs rename to Adyen/Model/TerminalApi/BalanceInquiryResponse.cs diff --git a/Adyen/src/Model/TerminalApi/BarcodeType.cs b/Adyen/Model/TerminalApi/BarcodeType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/BarcodeType.cs rename to Adyen/Model/TerminalApi/BarcodeType.cs diff --git a/Adyen/src/Model/TerminalApi/BatchRequest.cs b/Adyen/Model/TerminalApi/BatchRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/BatchRequest.cs rename to Adyen/Model/TerminalApi/BatchRequest.cs diff --git a/Adyen/src/Model/TerminalApi/BatchResponse.cs b/Adyen/Model/TerminalApi/BatchResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/BatchResponse.cs rename to Adyen/Model/TerminalApi/BatchResponse.cs diff --git a/Adyen/src/Model/TerminalApi/CapturedSignature.cs b/Adyen/Model/TerminalApi/CapturedSignature.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CapturedSignature.cs rename to Adyen/Model/TerminalApi/CapturedSignature.cs diff --git a/Adyen/src/Model/TerminalApi/CardAcquisitionRequest.cs b/Adyen/Model/TerminalApi/CardAcquisitionRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardAcquisitionRequest.cs rename to Adyen/Model/TerminalApi/CardAcquisitionRequest.cs diff --git a/Adyen/src/Model/TerminalApi/CardAcquisitionResponse.cs b/Adyen/Model/TerminalApi/CardAcquisitionResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardAcquisitionResponse.cs rename to Adyen/Model/TerminalApi/CardAcquisitionResponse.cs diff --git a/Adyen/src/Model/TerminalApi/CardAcquisitionTransaction.cs b/Adyen/Model/TerminalApi/CardAcquisitionTransaction.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardAcquisitionTransaction.cs rename to Adyen/Model/TerminalApi/CardAcquisitionTransaction.cs diff --git a/Adyen/src/Model/TerminalApi/CardData.cs b/Adyen/Model/TerminalApi/CardData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardData.cs rename to Adyen/Model/TerminalApi/CardData.cs diff --git a/Adyen/src/Model/TerminalApi/CardReaderAPDURequest.cs b/Adyen/Model/TerminalApi/CardReaderAPDURequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardReaderAPDURequest.cs rename to Adyen/Model/TerminalApi/CardReaderAPDURequest.cs diff --git a/Adyen/src/Model/TerminalApi/CardReaderAPDUResponse.cs b/Adyen/Model/TerminalApi/CardReaderAPDUResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardReaderAPDUResponse.cs rename to Adyen/Model/TerminalApi/CardReaderAPDUResponse.cs diff --git a/Adyen/src/Model/TerminalApi/CardReaderInitRequest.cs b/Adyen/Model/TerminalApi/CardReaderInitRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardReaderInitRequest.cs rename to Adyen/Model/TerminalApi/CardReaderInitRequest.cs diff --git a/Adyen/src/Model/TerminalApi/CardReaderInitResponse.cs b/Adyen/Model/TerminalApi/CardReaderInitResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardReaderInitResponse.cs rename to Adyen/Model/TerminalApi/CardReaderInitResponse.cs diff --git a/Adyen/src/Model/TerminalApi/CardReaderPowerOffRequest.cs b/Adyen/Model/TerminalApi/CardReaderPowerOffRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardReaderPowerOffRequest.cs rename to Adyen/Model/TerminalApi/CardReaderPowerOffRequest.cs diff --git a/Adyen/src/Model/TerminalApi/CardReaderPowerOffResponse.cs b/Adyen/Model/TerminalApi/CardReaderPowerOffResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardReaderPowerOffResponse.cs rename to Adyen/Model/TerminalApi/CardReaderPowerOffResponse.cs diff --git a/Adyen/src/Model/TerminalApi/CardholderPIN.cs b/Adyen/Model/TerminalApi/CardholderPIN.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardholderPIN.cs rename to Adyen/Model/TerminalApi/CardholderPIN.cs diff --git a/Adyen/src/Model/TerminalApi/CashHandlingDevice.cs b/Adyen/Model/TerminalApi/CashHandlingDevice.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CashHandlingDevice.cs rename to Adyen/Model/TerminalApi/CashHandlingDevice.cs diff --git a/Adyen/src/Model/TerminalApi/CharacterHeightType.cs b/Adyen/Model/TerminalApi/CharacterHeightType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CharacterHeightType.cs rename to Adyen/Model/TerminalApi/CharacterHeightType.cs diff --git a/Adyen/src/Model/TerminalApi/CharacterStyleType.cs b/Adyen/Model/TerminalApi/CharacterStyleType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CharacterStyleType.cs rename to Adyen/Model/TerminalApi/CharacterStyleType.cs diff --git a/Adyen/src/Model/TerminalApi/CharacterWidthType.cs b/Adyen/Model/TerminalApi/CharacterWidthType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CharacterWidthType.cs rename to Adyen/Model/TerminalApi/CharacterWidthType.cs diff --git a/Adyen/src/Model/TerminalApi/CheckData.cs b/Adyen/Model/TerminalApi/CheckData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CheckData.cs rename to Adyen/Model/TerminalApi/CheckData.cs diff --git a/Adyen/src/Model/TerminalApi/CheckTypeCodeType.cs b/Adyen/Model/TerminalApi/CheckTypeCodeType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CheckTypeCodeType.cs rename to Adyen/Model/TerminalApi/CheckTypeCodeType.cs diff --git a/Adyen/src/Model/TerminalApi/CoinsOrBills.cs b/Adyen/Model/TerminalApi/CoinsOrBills.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CoinsOrBills.cs rename to Adyen/Model/TerminalApi/CoinsOrBills.cs diff --git a/Adyen/src/Model/TerminalApi/ColorType.cs b/Adyen/Model/TerminalApi/ColorType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ColorType.cs rename to Adyen/Model/TerminalApi/ColorType.cs diff --git a/Adyen/src/Model/TerminalApi/ContentInformation.cs b/Adyen/Model/TerminalApi/ContentInformation.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ContentInformation.cs rename to Adyen/Model/TerminalApi/ContentInformation.cs diff --git a/Adyen/src/Model/TerminalApi/ContentType.cs b/Adyen/Model/TerminalApi/ContentType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ContentType.cs rename to Adyen/Model/TerminalApi/ContentType.cs diff --git a/Adyen/src/Model/TerminalApi/CurrencyConversion.cs b/Adyen/Model/TerminalApi/CurrencyConversion.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CurrencyConversion.cs rename to Adyen/Model/TerminalApi/CurrencyConversion.cs diff --git a/Adyen/src/Model/TerminalApi/CustomerOrder.cs b/Adyen/Model/TerminalApi/CustomerOrder.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CustomerOrder.cs rename to Adyen/Model/TerminalApi/CustomerOrder.cs diff --git a/Adyen/src/Model/TerminalApi/CustomerOrderReqType.cs b/Adyen/Model/TerminalApi/CustomerOrderReqType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CustomerOrderReqType.cs rename to Adyen/Model/TerminalApi/CustomerOrderReqType.cs diff --git a/Adyen/src/Model/TerminalApi/DeviceType.cs b/Adyen/Model/TerminalApi/DeviceType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DeviceType.cs rename to Adyen/Model/TerminalApi/DeviceType.cs diff --git a/Adyen/src/Model/TerminalApi/DiagnosisRequest.cs b/Adyen/Model/TerminalApi/DiagnosisRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DiagnosisRequest.cs rename to Adyen/Model/TerminalApi/DiagnosisRequest.cs diff --git a/Adyen/src/Model/TerminalApi/DiagnosisResponse.cs b/Adyen/Model/TerminalApi/DiagnosisResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DiagnosisResponse.cs rename to Adyen/Model/TerminalApi/DiagnosisResponse.cs diff --git a/Adyen/src/Model/TerminalApi/DigestedData.cs b/Adyen/Model/TerminalApi/DigestedData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DigestedData.cs rename to Adyen/Model/TerminalApi/DigestedData.cs diff --git a/Adyen/src/Model/TerminalApi/DisplayOutput.cs b/Adyen/Model/TerminalApi/DisplayOutput.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DisplayOutput.cs rename to Adyen/Model/TerminalApi/DisplayOutput.cs diff --git a/Adyen/src/Model/TerminalApi/DisplayRequest.cs b/Adyen/Model/TerminalApi/DisplayRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DisplayRequest.cs rename to Adyen/Model/TerminalApi/DisplayRequest.cs diff --git a/Adyen/src/Model/TerminalApi/DisplayResponse.cs b/Adyen/Model/TerminalApi/DisplayResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DisplayResponse.cs rename to Adyen/Model/TerminalApi/DisplayResponse.cs diff --git a/Adyen/src/Model/TerminalApi/DocumentQualifierType.cs b/Adyen/Model/TerminalApi/DocumentQualifierType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DocumentQualifierType.cs rename to Adyen/Model/TerminalApi/DocumentQualifierType.cs diff --git a/Adyen/src/Model/TerminalApi/EnableServiceRequest.cs b/Adyen/Model/TerminalApi/EnableServiceRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EnableServiceRequest.cs rename to Adyen/Model/TerminalApi/EnableServiceRequest.cs diff --git a/Adyen/src/Model/TerminalApi/EnableServiceResponse.cs b/Adyen/Model/TerminalApi/EnableServiceResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EnableServiceResponse.cs rename to Adyen/Model/TerminalApi/EnableServiceResponse.cs diff --git a/Adyen/src/Model/TerminalApi/EncapsulatedContent.cs b/Adyen/Model/TerminalApi/EncapsulatedContent.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EncapsulatedContent.cs rename to Adyen/Model/TerminalApi/EncapsulatedContent.cs diff --git a/Adyen/src/Model/TerminalApi/EncryptedContent.cs b/Adyen/Model/TerminalApi/EncryptedContent.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EncryptedContent.cs rename to Adyen/Model/TerminalApi/EncryptedContent.cs diff --git a/Adyen/src/Model/TerminalApi/EntryModeType.cs b/Adyen/Model/TerminalApi/EntryModeType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EntryModeType.cs rename to Adyen/Model/TerminalApi/EntryModeType.cs diff --git a/Adyen/src/Model/TerminalApi/EnvelopedData.cs b/Adyen/Model/TerminalApi/EnvelopedData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EnvelopedData.cs rename to Adyen/Model/TerminalApi/EnvelopedData.cs diff --git a/Adyen/src/Model/TerminalApi/ErrorConditionType.cs b/Adyen/Model/TerminalApi/ErrorConditionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ErrorConditionType.cs rename to Adyen/Model/TerminalApi/ErrorConditionType.cs diff --git a/Adyen/src/Model/TerminalApi/EventNotification.cs b/Adyen/Model/TerminalApi/EventNotification.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EventNotification.cs rename to Adyen/Model/TerminalApi/EventNotification.cs diff --git a/Adyen/src/Model/TerminalApi/EventToNotifyType.cs b/Adyen/Model/TerminalApi/EventToNotifyType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EventToNotifyType.cs rename to Adyen/Model/TerminalApi/EventToNotifyType.cs diff --git a/Adyen/src/Model/TerminalApi/ForceTypeModeType.cs b/Adyen/Model/TerminalApi/ForceTypeModeType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ForceTypeModeType.cs rename to Adyen/Model/TerminalApi/ForceTypeModeType.cs diff --git a/Adyen/src/Model/TerminalApi/GenericProfileType.cs b/Adyen/Model/TerminalApi/GenericProfileType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/GenericProfileType.cs rename to Adyen/Model/TerminalApi/GenericProfileType.cs diff --git a/Adyen/src/Model/TerminalApi/GeographicCoordinates.cs b/Adyen/Model/TerminalApi/GeographicCoordinates.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/GeographicCoordinates.cs rename to Adyen/Model/TerminalApi/GeographicCoordinates.cs diff --git a/Adyen/src/Model/TerminalApi/Geolocation.cs b/Adyen/Model/TerminalApi/Geolocation.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Geolocation.cs rename to Adyen/Model/TerminalApi/Geolocation.cs diff --git a/Adyen/src/Model/TerminalApi/GetTotalsRequest.cs b/Adyen/Model/TerminalApi/GetTotalsRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/GetTotalsRequest.cs rename to Adyen/Model/TerminalApi/GetTotalsRequest.cs diff --git a/Adyen/src/Model/TerminalApi/GetTotalsResponse.cs b/Adyen/Model/TerminalApi/GetTotalsResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/GetTotalsResponse.cs rename to Adyen/Model/TerminalApi/GetTotalsResponse.cs diff --git a/Adyen/src/Model/TerminalApi/GlobalStatusType.cs b/Adyen/Model/TerminalApi/GlobalStatusType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/GlobalStatusType.cs rename to Adyen/Model/TerminalApi/GlobalStatusType.cs diff --git a/Adyen/src/Model/TerminalApi/HostStatus.cs b/Adyen/Model/TerminalApi/HostStatus.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/HostStatus.cs rename to Adyen/Model/TerminalApi/HostStatus.cs diff --git a/Adyen/src/Model/TerminalApi/ICCResetData.cs b/Adyen/Model/TerminalApi/ICCResetData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ICCResetData.cs rename to Adyen/Model/TerminalApi/ICCResetData.cs diff --git a/Adyen/src/Model/TerminalApi/IdentificationSupportType.cs b/Adyen/Model/TerminalApi/IdentificationSupportType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/IdentificationSupportType.cs rename to Adyen/Model/TerminalApi/IdentificationSupportType.cs diff --git a/Adyen/src/Model/TerminalApi/IdentificationType.cs b/Adyen/Model/TerminalApi/IdentificationType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/IdentificationType.cs rename to Adyen/Model/TerminalApi/IdentificationType.cs diff --git a/Adyen/src/Model/TerminalApi/InfoQualifyType.cs b/Adyen/Model/TerminalApi/InfoQualifyType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InfoQualifyType.cs rename to Adyen/Model/TerminalApi/InfoQualifyType.cs diff --git a/Adyen/src/Model/TerminalApi/Input.cs b/Adyen/Model/TerminalApi/Input.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Input.cs rename to Adyen/Model/TerminalApi/Input.cs diff --git a/Adyen/src/Model/TerminalApi/InputCommandType.cs b/Adyen/Model/TerminalApi/InputCommandType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InputCommandType.cs rename to Adyen/Model/TerminalApi/InputCommandType.cs diff --git a/Adyen/src/Model/TerminalApi/InputData.cs b/Adyen/Model/TerminalApi/InputData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InputData.cs rename to Adyen/Model/TerminalApi/InputData.cs diff --git a/Adyen/src/Model/TerminalApi/InputRequest.cs b/Adyen/Model/TerminalApi/InputRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InputRequest.cs rename to Adyen/Model/TerminalApi/InputRequest.cs diff --git a/Adyen/src/Model/TerminalApi/InputResponse.cs b/Adyen/Model/TerminalApi/InputResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InputResponse.cs rename to Adyen/Model/TerminalApi/InputResponse.cs diff --git a/Adyen/src/Model/TerminalApi/InputResult.cs b/Adyen/Model/TerminalApi/InputResult.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InputResult.cs rename to Adyen/Model/TerminalApi/InputResult.cs diff --git a/Adyen/src/Model/TerminalApi/InputUpdate.cs b/Adyen/Model/TerminalApi/InputUpdate.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InputUpdate.cs rename to Adyen/Model/TerminalApi/InputUpdate.cs diff --git a/Adyen/src/Model/TerminalApi/Instalment.cs b/Adyen/Model/TerminalApi/Instalment.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Instalment.cs rename to Adyen/Model/TerminalApi/Instalment.cs diff --git a/Adyen/src/Model/TerminalApi/IssuerAndSerialNumber.cs b/Adyen/Model/TerminalApi/IssuerAndSerialNumber.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/IssuerAndSerialNumber.cs rename to Adyen/Model/TerminalApi/IssuerAndSerialNumber.cs diff --git a/Adyen/src/Model/TerminalApi/KEK.cs b/Adyen/Model/TerminalApi/KEK.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/KEK.cs rename to Adyen/Model/TerminalApi/KEK.cs diff --git a/Adyen/src/Model/TerminalApi/KEKIdentifier.cs b/Adyen/Model/TerminalApi/KEKIdentifier.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/KEKIdentifier.cs rename to Adyen/Model/TerminalApi/KEKIdentifier.cs diff --git a/Adyen/src/Model/TerminalApi/KeyTransport.cs b/Adyen/Model/TerminalApi/KeyTransport.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/KeyTransport.cs rename to Adyen/Model/TerminalApi/KeyTransport.cs diff --git a/Adyen/src/Model/TerminalApi/LoginRequest.cs b/Adyen/Model/TerminalApi/LoginRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoginRequest.cs rename to Adyen/Model/TerminalApi/LoginRequest.cs diff --git a/Adyen/src/Model/TerminalApi/LoginResponse.cs b/Adyen/Model/TerminalApi/LoginResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoginResponse.cs rename to Adyen/Model/TerminalApi/LoginResponse.cs diff --git a/Adyen/src/Model/TerminalApi/LogoutRequest.cs b/Adyen/Model/TerminalApi/LogoutRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LogoutRequest.cs rename to Adyen/Model/TerminalApi/LogoutRequest.cs diff --git a/Adyen/src/Model/TerminalApi/LogoutResponse.cs b/Adyen/Model/TerminalApi/LogoutResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LogoutResponse.cs rename to Adyen/Model/TerminalApi/LogoutResponse.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyAccount.cs b/Adyen/Model/TerminalApi/LoyaltyAccount.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyAccount.cs rename to Adyen/Model/TerminalApi/LoyaltyAccount.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyAccountID.cs b/Adyen/Model/TerminalApi/LoyaltyAccountID.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyAccountID.cs rename to Adyen/Model/TerminalApi/LoyaltyAccountID.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyAccountReq.cs b/Adyen/Model/TerminalApi/LoyaltyAccountReq.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyAccountReq.cs rename to Adyen/Model/TerminalApi/LoyaltyAccountReq.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyAccountStatus.cs b/Adyen/Model/TerminalApi/LoyaltyAccountStatus.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyAccountStatus.cs rename to Adyen/Model/TerminalApi/LoyaltyAccountStatus.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyAcquirerData.cs b/Adyen/Model/TerminalApi/LoyaltyAcquirerData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyAcquirerData.cs rename to Adyen/Model/TerminalApi/LoyaltyAcquirerData.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyAmount.cs b/Adyen/Model/TerminalApi/LoyaltyAmount.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyAmount.cs rename to Adyen/Model/TerminalApi/LoyaltyAmount.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyData.cs b/Adyen/Model/TerminalApi/LoyaltyData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyData.cs rename to Adyen/Model/TerminalApi/LoyaltyData.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyHandlingType.cs b/Adyen/Model/TerminalApi/LoyaltyHandlingType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyHandlingType.cs rename to Adyen/Model/TerminalApi/LoyaltyHandlingType.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyRequest.cs b/Adyen/Model/TerminalApi/LoyaltyRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyRequest.cs rename to Adyen/Model/TerminalApi/LoyaltyRequest.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyResponse.cs b/Adyen/Model/TerminalApi/LoyaltyResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyResponse.cs rename to Adyen/Model/TerminalApi/LoyaltyResponse.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyResult.cs b/Adyen/Model/TerminalApi/LoyaltyResult.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyResult.cs rename to Adyen/Model/TerminalApi/LoyaltyResult.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyTotals.cs b/Adyen/Model/TerminalApi/LoyaltyTotals.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyTotals.cs rename to Adyen/Model/TerminalApi/LoyaltyTotals.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyTransaction.cs b/Adyen/Model/TerminalApi/LoyaltyTransaction.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyTransaction.cs rename to Adyen/Model/TerminalApi/LoyaltyTransaction.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyTransactionType.cs b/Adyen/Model/TerminalApi/LoyaltyTransactionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyTransactionType.cs rename to Adyen/Model/TerminalApi/LoyaltyTransactionType.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyUnitType.cs b/Adyen/Model/TerminalApi/LoyaltyUnitType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyUnitType.cs rename to Adyen/Model/TerminalApi/LoyaltyUnitType.cs diff --git a/Adyen/src/Model/TerminalApi/MenuEntry.cs b/Adyen/Model/TerminalApi/MenuEntry.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MenuEntry.cs rename to Adyen/Model/TerminalApi/MenuEntry.cs diff --git a/Adyen/src/Model/TerminalApi/MenuEntryTagType.cs b/Adyen/Model/TerminalApi/MenuEntryTagType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MenuEntryTagType.cs rename to Adyen/Model/TerminalApi/MenuEntryTagType.cs diff --git a/Adyen/src/Model/TerminalApi/Message/SaleToPOIRequest.cs b/Adyen/Model/TerminalApi/Message/SaleToPOIRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Message/SaleToPOIRequest.cs rename to Adyen/Model/TerminalApi/Message/SaleToPOIRequest.cs diff --git a/Adyen/src/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs b/Adyen/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs rename to Adyen/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs diff --git a/Adyen/src/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs b/Adyen/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs rename to Adyen/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs diff --git a/Adyen/src/Model/TerminalApi/MessageCategoryType.cs b/Adyen/Model/TerminalApi/MessageCategoryType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MessageCategoryType.cs rename to Adyen/Model/TerminalApi/MessageCategoryType.cs diff --git a/Adyen/src/Model/TerminalApi/MessageClassType.cs b/Adyen/Model/TerminalApi/MessageClassType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MessageClassType.cs rename to Adyen/Model/TerminalApi/MessageClassType.cs diff --git a/Adyen/src/Model/TerminalApi/MessageHeader.cs b/Adyen/Model/TerminalApi/MessageHeader.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MessageHeader.cs rename to Adyen/Model/TerminalApi/MessageHeader.cs diff --git a/Adyen/src/Model/TerminalApi/MessageReference.cs b/Adyen/Model/TerminalApi/MessageReference.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MessageReference.cs rename to Adyen/Model/TerminalApi/MessageReference.cs diff --git a/Adyen/src/Model/TerminalApi/MessageType.cs b/Adyen/Model/TerminalApi/MessageType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MessageType.cs rename to Adyen/Model/TerminalApi/MessageType.cs diff --git a/Adyen/src/Model/TerminalApi/MobileData.cs b/Adyen/Model/TerminalApi/MobileData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MobileData.cs rename to Adyen/Model/TerminalApi/MobileData.cs diff --git a/Adyen/src/Model/TerminalApi/NamedKeyEncryptedData.cs b/Adyen/Model/TerminalApi/NamedKeyEncryptedData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/NamedKeyEncryptedData.cs rename to Adyen/Model/TerminalApi/NamedKeyEncryptedData.cs diff --git a/Adyen/src/Model/TerminalApi/OriginalPOITransaction.cs b/Adyen/Model/TerminalApi/OriginalPOITransaction.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/OriginalPOITransaction.cs rename to Adyen/Model/TerminalApi/OriginalPOITransaction.cs diff --git a/Adyen/src/Model/TerminalApi/OutputBarcode.cs b/Adyen/Model/TerminalApi/OutputBarcode.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/OutputBarcode.cs rename to Adyen/Model/TerminalApi/OutputBarcode.cs diff --git a/Adyen/src/Model/TerminalApi/OutputContent.cs b/Adyen/Model/TerminalApi/OutputContent.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/OutputContent.cs rename to Adyen/Model/TerminalApi/OutputContent.cs diff --git a/Adyen/src/Model/TerminalApi/OutputFormatType.cs b/Adyen/Model/TerminalApi/OutputFormatType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/OutputFormatType.cs rename to Adyen/Model/TerminalApi/OutputFormatType.cs diff --git a/Adyen/src/Model/TerminalApi/OutputResult.cs b/Adyen/Model/TerminalApi/OutputResult.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/OutputResult.cs rename to Adyen/Model/TerminalApi/OutputResult.cs diff --git a/Adyen/src/Model/TerminalApi/OutputText.cs b/Adyen/Model/TerminalApi/OutputText.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/OutputText.cs rename to Adyen/Model/TerminalApi/OutputText.cs diff --git a/Adyen/src/Model/TerminalApi/PINFormatType.cs b/Adyen/Model/TerminalApi/PINFormatType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PINFormatType.cs rename to Adyen/Model/TerminalApi/PINFormatType.cs diff --git a/Adyen/src/Model/TerminalApi/PINRequest.cs b/Adyen/Model/TerminalApi/PINRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PINRequest.cs rename to Adyen/Model/TerminalApi/PINRequest.cs diff --git a/Adyen/src/Model/TerminalApi/PINRequestType.cs b/Adyen/Model/TerminalApi/PINRequestType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PINRequestType.cs rename to Adyen/Model/TerminalApi/PINRequestType.cs diff --git a/Adyen/src/Model/TerminalApi/PINResponse.cs b/Adyen/Model/TerminalApi/PINResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PINResponse.cs rename to Adyen/Model/TerminalApi/PINResponse.cs diff --git a/Adyen/src/Model/TerminalApi/POIData.cs b/Adyen/Model/TerminalApi/POIData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/POIData.cs rename to Adyen/Model/TerminalApi/POIData.cs diff --git a/Adyen/src/Model/TerminalApi/POIProfile.cs b/Adyen/Model/TerminalApi/POIProfile.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/POIProfile.cs rename to Adyen/Model/TerminalApi/POIProfile.cs diff --git a/Adyen/src/Model/TerminalApi/POISoftware.cs b/Adyen/Model/TerminalApi/POISoftware.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/POISoftware.cs rename to Adyen/Model/TerminalApi/POISoftware.cs diff --git a/Adyen/src/Model/TerminalApi/POIStatus.cs b/Adyen/Model/TerminalApi/POIStatus.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/POIStatus.cs rename to Adyen/Model/TerminalApi/POIStatus.cs diff --git a/Adyen/src/Model/TerminalApi/POISystemData.cs b/Adyen/Model/TerminalApi/POISystemData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/POISystemData.cs rename to Adyen/Model/TerminalApi/POISystemData.cs diff --git a/Adyen/src/Model/TerminalApi/POITerminalData.cs b/Adyen/Model/TerminalApi/POITerminalData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/POITerminalData.cs rename to Adyen/Model/TerminalApi/POITerminalData.cs diff --git a/Adyen/src/Model/TerminalApi/Parameter.cs b/Adyen/Model/TerminalApi/Parameter.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Parameter.cs rename to Adyen/Model/TerminalApi/Parameter.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentAccountReq.cs b/Adyen/Model/TerminalApi/PaymentAccountReq.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentAccountReq.cs rename to Adyen/Model/TerminalApi/PaymentAccountReq.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentAccountStatus.cs b/Adyen/Model/TerminalApi/PaymentAccountStatus.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentAccountStatus.cs rename to Adyen/Model/TerminalApi/PaymentAccountStatus.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentAcquirerData.cs b/Adyen/Model/TerminalApi/PaymentAcquirerData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentAcquirerData.cs rename to Adyen/Model/TerminalApi/PaymentAcquirerData.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentData.cs b/Adyen/Model/TerminalApi/PaymentData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentData.cs rename to Adyen/Model/TerminalApi/PaymentData.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentInstrumentData.cs b/Adyen/Model/TerminalApi/PaymentInstrumentData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentInstrumentData.cs rename to Adyen/Model/TerminalApi/PaymentInstrumentData.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentInstrumentType.cs b/Adyen/Model/TerminalApi/PaymentInstrumentType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentInstrumentType.cs rename to Adyen/Model/TerminalApi/PaymentInstrumentType.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentReceipt.cs b/Adyen/Model/TerminalApi/PaymentReceipt.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentReceipt.cs rename to Adyen/Model/TerminalApi/PaymentReceipt.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentRequest.cs b/Adyen/Model/TerminalApi/PaymentRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentRequest.cs rename to Adyen/Model/TerminalApi/PaymentRequest.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentResponse.cs b/Adyen/Model/TerminalApi/PaymentResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentResponse.cs rename to Adyen/Model/TerminalApi/PaymentResponse.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentResult.cs b/Adyen/Model/TerminalApi/PaymentResult.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentResult.cs rename to Adyen/Model/TerminalApi/PaymentResult.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentToken.cs b/Adyen/Model/TerminalApi/PaymentToken.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentToken.cs rename to Adyen/Model/TerminalApi/PaymentToken.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentTotals.cs b/Adyen/Model/TerminalApi/PaymentTotals.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentTotals.cs rename to Adyen/Model/TerminalApi/PaymentTotals.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentTransaction.cs b/Adyen/Model/TerminalApi/PaymentTransaction.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentTransaction.cs rename to Adyen/Model/TerminalApi/PaymentTransaction.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentType.cs b/Adyen/Model/TerminalApi/PaymentType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentType.cs rename to Adyen/Model/TerminalApi/PaymentType.cs diff --git a/Adyen/src/Model/TerminalApi/PerformedTransaction.cs b/Adyen/Model/TerminalApi/PerformedTransaction.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PerformedTransaction.cs rename to Adyen/Model/TerminalApi/PerformedTransaction.cs diff --git a/Adyen/src/Model/TerminalApi/PeriodUnitType.cs b/Adyen/Model/TerminalApi/PeriodUnitType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PeriodUnitType.cs rename to Adyen/Model/TerminalApi/PeriodUnitType.cs diff --git a/Adyen/src/Model/TerminalApi/PredefinedContent.cs b/Adyen/Model/TerminalApi/PredefinedContent.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PredefinedContent.cs rename to Adyen/Model/TerminalApi/PredefinedContent.cs diff --git a/Adyen/src/Model/TerminalApi/PrintOutput.cs b/Adyen/Model/TerminalApi/PrintOutput.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PrintOutput.cs rename to Adyen/Model/TerminalApi/PrintOutput.cs diff --git a/Adyen/src/Model/TerminalApi/PrintRequest.cs b/Adyen/Model/TerminalApi/PrintRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PrintRequest.cs rename to Adyen/Model/TerminalApi/PrintRequest.cs diff --git a/Adyen/src/Model/TerminalApi/PrintResponse.cs b/Adyen/Model/TerminalApi/PrintResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PrintResponse.cs rename to Adyen/Model/TerminalApi/PrintResponse.cs diff --git a/Adyen/src/Model/TerminalApi/PrinterStatusType.cs b/Adyen/Model/TerminalApi/PrinterStatusType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PrinterStatusType.cs rename to Adyen/Model/TerminalApi/PrinterStatusType.cs diff --git a/Adyen/src/Model/TerminalApi/Rebates.cs b/Adyen/Model/TerminalApi/Rebates.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Rebates.cs rename to Adyen/Model/TerminalApi/Rebates.cs diff --git a/Adyen/src/Model/TerminalApi/RecipientIdentifier.cs b/Adyen/Model/TerminalApi/RecipientIdentifier.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/RecipientIdentifier.cs rename to Adyen/Model/TerminalApi/RecipientIdentifier.cs diff --git a/Adyen/src/Model/TerminalApi/ReconciliationRequest.cs b/Adyen/Model/TerminalApi/ReconciliationRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ReconciliationRequest.cs rename to Adyen/Model/TerminalApi/ReconciliationRequest.cs diff --git a/Adyen/src/Model/TerminalApi/ReconciliationResponse.cs b/Adyen/Model/TerminalApi/ReconciliationResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ReconciliationResponse.cs rename to Adyen/Model/TerminalApi/ReconciliationResponse.cs diff --git a/Adyen/src/Model/TerminalApi/ReconciliationType.cs b/Adyen/Model/TerminalApi/ReconciliationType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ReconciliationType.cs rename to Adyen/Model/TerminalApi/ReconciliationType.cs diff --git a/Adyen/src/Model/TerminalApi/RelativeDistinguishedName.cs b/Adyen/Model/TerminalApi/RelativeDistinguishedName.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/RelativeDistinguishedName.cs rename to Adyen/Model/TerminalApi/RelativeDistinguishedName.cs diff --git a/Adyen/src/Model/TerminalApi/RepeatedMessageResponse.cs b/Adyen/Model/TerminalApi/RepeatedMessageResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/RepeatedMessageResponse.cs rename to Adyen/Model/TerminalApi/RepeatedMessageResponse.cs diff --git a/Adyen/src/Model/TerminalApi/RepeatedResponseMessageBody.cs b/Adyen/Model/TerminalApi/RepeatedResponseMessageBody.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/RepeatedResponseMessageBody.cs rename to Adyen/Model/TerminalApi/RepeatedResponseMessageBody.cs diff --git a/Adyen/src/Model/TerminalApi/Response.cs b/Adyen/Model/TerminalApi/Response.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Response.cs rename to Adyen/Model/TerminalApi/Response.cs diff --git a/Adyen/src/Model/TerminalApi/ResponseModeType.cs b/Adyen/Model/TerminalApi/ResponseModeType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ResponseModeType.cs rename to Adyen/Model/TerminalApi/ResponseModeType.cs diff --git a/Adyen/src/Model/TerminalApi/ResultType.cs b/Adyen/Model/TerminalApi/ResultType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ResultType.cs rename to Adyen/Model/TerminalApi/ResultType.cs diff --git a/Adyen/src/Model/TerminalApi/ReversalReasonType.cs b/Adyen/Model/TerminalApi/ReversalReasonType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ReversalReasonType.cs rename to Adyen/Model/TerminalApi/ReversalReasonType.cs diff --git a/Adyen/src/Model/TerminalApi/ReversalRequest.cs b/Adyen/Model/TerminalApi/ReversalRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ReversalRequest.cs rename to Adyen/Model/TerminalApi/ReversalRequest.cs diff --git a/Adyen/src/Model/TerminalApi/ReversalResponse.cs b/Adyen/Model/TerminalApi/ReversalResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ReversalResponse.cs rename to Adyen/Model/TerminalApi/ReversalResponse.cs diff --git a/Adyen/src/Model/TerminalApi/SaleData.cs b/Adyen/Model/TerminalApi/SaleData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleData.cs rename to Adyen/Model/TerminalApi/SaleData.cs diff --git a/Adyen/src/Model/TerminalApi/SaleItem.cs b/Adyen/Model/TerminalApi/SaleItem.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleItem.cs rename to Adyen/Model/TerminalApi/SaleItem.cs diff --git a/Adyen/src/Model/TerminalApi/SaleItemRebate.cs b/Adyen/Model/TerminalApi/SaleItemRebate.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleItemRebate.cs rename to Adyen/Model/TerminalApi/SaleItemRebate.cs diff --git a/Adyen/src/Model/TerminalApi/SaleProfile.cs b/Adyen/Model/TerminalApi/SaleProfile.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleProfile.cs rename to Adyen/Model/TerminalApi/SaleProfile.cs diff --git a/Adyen/src/Model/TerminalApi/SaleSoftware.cs b/Adyen/Model/TerminalApi/SaleSoftware.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleSoftware.cs rename to Adyen/Model/TerminalApi/SaleSoftware.cs diff --git a/Adyen/src/Model/TerminalApi/SaleTerminalData.cs b/Adyen/Model/TerminalApi/SaleTerminalData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleTerminalData.cs rename to Adyen/Model/TerminalApi/SaleTerminalData.cs diff --git a/Adyen/src/Model/TerminalApi/SaleToIssuerData.cs b/Adyen/Model/TerminalApi/SaleToIssuerData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleToIssuerData.cs rename to Adyen/Model/TerminalApi/SaleToIssuerData.cs diff --git a/Adyen/src/Model/TerminalApi/SaleToPOIMessage.cs b/Adyen/Model/TerminalApi/SaleToPOIMessage.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleToPOIMessage.cs rename to Adyen/Model/TerminalApi/SaleToPOIMessage.cs diff --git a/Adyen/src/Model/TerminalApi/SaleToPOIResponse.cs b/Adyen/Model/TerminalApi/SaleToPOIResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleToPOIResponse.cs rename to Adyen/Model/TerminalApi/SaleToPOIResponse.cs diff --git a/Adyen/src/Model/TerminalApi/SensitiveCardData.cs b/Adyen/Model/TerminalApi/SensitiveCardData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SensitiveCardData.cs rename to Adyen/Model/TerminalApi/SensitiveCardData.cs diff --git a/Adyen/src/Model/TerminalApi/SensitiveMobileData.cs b/Adyen/Model/TerminalApi/SensitiveMobileData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SensitiveMobileData.cs rename to Adyen/Model/TerminalApi/SensitiveMobileData.cs diff --git a/Adyen/src/Model/TerminalApi/SignaturePoint.cs b/Adyen/Model/TerminalApi/SignaturePoint.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SignaturePoint.cs rename to Adyen/Model/TerminalApi/SignaturePoint.cs diff --git a/Adyen/src/Model/TerminalApi/SignedData.cs b/Adyen/Model/TerminalApi/SignedData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SignedData.cs rename to Adyen/Model/TerminalApi/SignedData.cs diff --git a/Adyen/src/Model/TerminalApi/Signer.cs b/Adyen/Model/TerminalApi/Signer.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Signer.cs rename to Adyen/Model/TerminalApi/Signer.cs diff --git a/Adyen/src/Model/TerminalApi/SignerIdentifier.cs b/Adyen/Model/TerminalApi/SignerIdentifier.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SignerIdentifier.cs rename to Adyen/Model/TerminalApi/SignerIdentifier.cs diff --git a/Adyen/src/Model/TerminalApi/SoundActionType.cs b/Adyen/Model/TerminalApi/SoundActionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SoundActionType.cs rename to Adyen/Model/TerminalApi/SoundActionType.cs diff --git a/Adyen/src/Model/TerminalApi/SoundContent.cs b/Adyen/Model/TerminalApi/SoundContent.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SoundContent.cs rename to Adyen/Model/TerminalApi/SoundContent.cs diff --git a/Adyen/src/Model/TerminalApi/SoundFormatType.cs b/Adyen/Model/TerminalApi/SoundFormatType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SoundFormatType.cs rename to Adyen/Model/TerminalApi/SoundFormatType.cs diff --git a/Adyen/src/Model/TerminalApi/SoundRequest.cs b/Adyen/Model/TerminalApi/SoundRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SoundRequest.cs rename to Adyen/Model/TerminalApi/SoundRequest.cs diff --git a/Adyen/src/Model/TerminalApi/SoundResponse.cs b/Adyen/Model/TerminalApi/SoundResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SoundResponse.cs rename to Adyen/Model/TerminalApi/SoundResponse.cs diff --git a/Adyen/src/Model/TerminalApi/SponsoredMerchant.cs b/Adyen/Model/TerminalApi/SponsoredMerchant.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SponsoredMerchant.cs rename to Adyen/Model/TerminalApi/SponsoredMerchant.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueAccountID.cs b/Adyen/Model/TerminalApi/StoredValueAccountID.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueAccountID.cs rename to Adyen/Model/TerminalApi/StoredValueAccountID.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueAccountStatus.cs b/Adyen/Model/TerminalApi/StoredValueAccountStatus.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueAccountStatus.cs rename to Adyen/Model/TerminalApi/StoredValueAccountStatus.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueAccountType.cs b/Adyen/Model/TerminalApi/StoredValueAccountType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueAccountType.cs rename to Adyen/Model/TerminalApi/StoredValueAccountType.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueData.cs b/Adyen/Model/TerminalApi/StoredValueData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueData.cs rename to Adyen/Model/TerminalApi/StoredValueData.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueRequest.cs b/Adyen/Model/TerminalApi/StoredValueRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueRequest.cs rename to Adyen/Model/TerminalApi/StoredValueRequest.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueResponse.cs b/Adyen/Model/TerminalApi/StoredValueResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueResponse.cs rename to Adyen/Model/TerminalApi/StoredValueResponse.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueResult.cs b/Adyen/Model/TerminalApi/StoredValueResult.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueResult.cs rename to Adyen/Model/TerminalApi/StoredValueResult.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueTransactionType.cs b/Adyen/Model/TerminalApi/StoredValueTransactionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueTransactionType.cs rename to Adyen/Model/TerminalApi/StoredValueTransactionType.cs diff --git a/Adyen/src/Model/TerminalApi/TerminalEnvironmentType.cs b/Adyen/Model/TerminalApi/TerminalEnvironmentType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TerminalEnvironmentType.cs rename to Adyen/Model/TerminalApi/TerminalEnvironmentType.cs diff --git a/Adyen/src/Model/TerminalApi/TokenRequestedType.cs b/Adyen/Model/TerminalApi/TokenRequestedType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TokenRequestedType.cs rename to Adyen/Model/TerminalApi/TokenRequestedType.cs diff --git a/Adyen/src/Model/TerminalApi/TotalDetailsType.cs b/Adyen/Model/TerminalApi/TotalDetailsType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TotalDetailsType.cs rename to Adyen/Model/TerminalApi/TotalDetailsType.cs diff --git a/Adyen/src/Model/TerminalApi/TotalFilter.cs b/Adyen/Model/TerminalApi/TotalFilter.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TotalFilter.cs rename to Adyen/Model/TerminalApi/TotalFilter.cs diff --git a/Adyen/src/Model/TerminalApi/TrackData.cs b/Adyen/Model/TerminalApi/TrackData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TrackData.cs rename to Adyen/Model/TerminalApi/TrackData.cs diff --git a/Adyen/src/Model/TerminalApi/TrackFormatType.cs b/Adyen/Model/TerminalApi/TrackFormatType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TrackFormatType.cs rename to Adyen/Model/TerminalApi/TrackFormatType.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionActionType.cs b/Adyen/Model/TerminalApi/TransactionActionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionActionType.cs rename to Adyen/Model/TerminalApi/TransactionActionType.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionConditions.cs b/Adyen/Model/TerminalApi/TransactionConditions.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionConditions.cs rename to Adyen/Model/TerminalApi/TransactionConditions.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionIdentification.cs b/Adyen/Model/TerminalApi/TransactionIdentification.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionIdentification.cs rename to Adyen/Model/TerminalApi/TransactionIdentification.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionStatusRequest.cs b/Adyen/Model/TerminalApi/TransactionStatusRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionStatusRequest.cs rename to Adyen/Model/TerminalApi/TransactionStatusRequest.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionStatusResponse.cs b/Adyen/Model/TerminalApi/TransactionStatusResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionStatusResponse.cs rename to Adyen/Model/TerminalApi/TransactionStatusResponse.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionToPerform.cs b/Adyen/Model/TerminalApi/TransactionToPerform.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionToPerform.cs rename to Adyen/Model/TerminalApi/TransactionToPerform.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionTotals.cs b/Adyen/Model/TerminalApi/TransactionTotals.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionTotals.cs rename to Adyen/Model/TerminalApi/TransactionTotals.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionType.cs b/Adyen/Model/TerminalApi/TransactionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionType.cs rename to Adyen/Model/TerminalApi/TransactionType.cs diff --git a/Adyen/src/Model/TerminalApi/TransmitRequest.cs b/Adyen/Model/TerminalApi/TransmitRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransmitRequest.cs rename to Adyen/Model/TerminalApi/TransmitRequest.cs diff --git a/Adyen/src/Model/TerminalApi/TransmitResponse.cs b/Adyen/Model/TerminalApi/TransmitResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransmitResponse.cs rename to Adyen/Model/TerminalApi/TransmitResponse.cs diff --git a/Adyen/src/Model/TerminalApi/UTMCoordinates.cs b/Adyen/Model/TerminalApi/UTMCoordinates.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/UTMCoordinates.cs rename to Adyen/Model/TerminalApi/UTMCoordinates.cs diff --git a/Adyen/src/Model/TerminalApi/UnitOfMeasureType.cs b/Adyen/Model/TerminalApi/UnitOfMeasureType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/UnitOfMeasureType.cs rename to Adyen/Model/TerminalApi/UnitOfMeasureType.cs diff --git a/Adyen/src/Model/TerminalApi/VersionType.cs b/Adyen/Model/TerminalApi/VersionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/VersionType.cs rename to Adyen/Model/TerminalApi/VersionType.cs diff --git a/Adyen/src/Model/TransactionWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/TransactionWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/TransactionWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/TransactionWebhooks/Amount.cs b/Adyen/Model/TransactionWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/Amount.cs rename to Adyen/Model/TransactionWebhooks/Amount.cs diff --git a/Adyen/src/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/src/Model/TransactionWebhooks/BankCategoryData.cs b/Adyen/Model/TransactionWebhooks/BankCategoryData.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/BankCategoryData.cs rename to Adyen/Model/TransactionWebhooks/BankCategoryData.cs diff --git a/Adyen/src/Model/TransactionWebhooks/InternalCategoryData.cs b/Adyen/Model/TransactionWebhooks/InternalCategoryData.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/InternalCategoryData.cs rename to Adyen/Model/TransactionWebhooks/InternalCategoryData.cs diff --git a/Adyen/src/Model/TransactionWebhooks/IssuedCard.cs b/Adyen/Model/TransactionWebhooks/IssuedCard.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/IssuedCard.cs rename to Adyen/Model/TransactionWebhooks/IssuedCard.cs diff --git a/Adyen/src/Model/TransactionWebhooks/PaymentInstrument.cs b/Adyen/Model/TransactionWebhooks/PaymentInstrument.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/PaymentInstrument.cs rename to Adyen/Model/TransactionWebhooks/PaymentInstrument.cs diff --git a/Adyen/src/Model/TransactionWebhooks/PlatformPayment.cs b/Adyen/Model/TransactionWebhooks/PlatformPayment.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/PlatformPayment.cs rename to Adyen/Model/TransactionWebhooks/PlatformPayment.cs diff --git a/Adyen/src/Model/TransactionWebhooks/RelayedAuthorisationData.cs b/Adyen/Model/TransactionWebhooks/RelayedAuthorisationData.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/RelayedAuthorisationData.cs rename to Adyen/Model/TransactionWebhooks/RelayedAuthorisationData.cs diff --git a/Adyen/src/Model/TransactionWebhooks/Resource.cs b/Adyen/Model/TransactionWebhooks/Resource.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/Resource.cs rename to Adyen/Model/TransactionWebhooks/Resource.cs diff --git a/Adyen/src/Model/TransactionWebhooks/ResourceReference.cs b/Adyen/Model/TransactionWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/ResourceReference.cs rename to Adyen/Model/TransactionWebhooks/ResourceReference.cs diff --git a/Adyen/src/Model/TransactionWebhooks/ThreeDSecure.cs b/Adyen/Model/TransactionWebhooks/ThreeDSecure.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/ThreeDSecure.cs rename to Adyen/Model/TransactionWebhooks/ThreeDSecure.cs diff --git a/Adyen/src/Model/TransactionWebhooks/Transaction.cs b/Adyen/Model/TransactionWebhooks/Transaction.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/Transaction.cs rename to Adyen/Model/TransactionWebhooks/Transaction.cs diff --git a/Adyen/src/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs b/Adyen/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs rename to Adyen/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs diff --git a/Adyen/src/Model/TransactionWebhooks/TransferNotificationValidationFact.cs b/Adyen/Model/TransactionWebhooks/TransferNotificationValidationFact.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/TransferNotificationValidationFact.cs rename to Adyen/Model/TransactionWebhooks/TransferNotificationValidationFact.cs diff --git a/Adyen/src/Model/TransactionWebhooks/TransferView.cs b/Adyen/Model/TransactionWebhooks/TransferView.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/TransferView.cs rename to Adyen/Model/TransactionWebhooks/TransferView.cs diff --git a/Adyen/src/Model/TransactionWebhooks/TransferViewCategoryData.cs b/Adyen/Model/TransactionWebhooks/TransferViewCategoryData.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/TransferViewCategoryData.cs rename to Adyen/Model/TransactionWebhooks/TransferViewCategoryData.cs diff --git a/Adyen/src/Model/TransferWebhooks/AULocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/AULocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/AULocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/TransferWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/TransferWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/TransferWebhooks/AdditionalBankIdentification.cs b/Adyen/Model/TransferWebhooks/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/AdditionalBankIdentification.cs rename to Adyen/Model/TransferWebhooks/AdditionalBankIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/Address.cs b/Adyen/Model/TransferWebhooks/Address.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Address.cs rename to Adyen/Model/TransferWebhooks/Address.cs diff --git a/Adyen/src/Model/TransferWebhooks/Airline.cs b/Adyen/Model/TransferWebhooks/Airline.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Airline.cs rename to Adyen/Model/TransferWebhooks/Airline.cs diff --git a/Adyen/src/Model/TransferWebhooks/Amount.cs b/Adyen/Model/TransferWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Amount.cs rename to Adyen/Model/TransferWebhooks/Amount.cs diff --git a/Adyen/src/Model/TransferWebhooks/AmountAdjustment.cs b/Adyen/Model/TransferWebhooks/AmountAdjustment.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/AmountAdjustment.cs rename to Adyen/Model/TransferWebhooks/AmountAdjustment.cs diff --git a/Adyen/src/Model/TransferWebhooks/BRLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/BRLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/BalanceMutation.cs b/Adyen/Model/TransferWebhooks/BalanceMutation.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/BalanceMutation.cs rename to Adyen/Model/TransferWebhooks/BalanceMutation.cs diff --git a/Adyen/src/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/src/Model/TransferWebhooks/BankAccountV3.cs b/Adyen/Model/TransferWebhooks/BankAccountV3.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/BankAccountV3.cs rename to Adyen/Model/TransferWebhooks/BankAccountV3.cs diff --git a/Adyen/src/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs b/Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs rename to Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/BankCategoryData.cs b/Adyen/Model/TransferWebhooks/BankCategoryData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/BankCategoryData.cs rename to Adyen/Model/TransferWebhooks/BankCategoryData.cs diff --git a/Adyen/src/Model/TransferWebhooks/CALocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/CALocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/CALocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/CZLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/CZLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/Card.cs b/Adyen/Model/TransferWebhooks/Card.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Card.cs rename to Adyen/Model/TransferWebhooks/Card.cs diff --git a/Adyen/src/Model/TransferWebhooks/CardIdentification.cs b/Adyen/Model/TransferWebhooks/CardIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/CardIdentification.cs rename to Adyen/Model/TransferWebhooks/CardIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/ConfirmationTrackingData.cs b/Adyen/Model/TransferWebhooks/ConfirmationTrackingData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/ConfirmationTrackingData.cs rename to Adyen/Model/TransferWebhooks/ConfirmationTrackingData.cs diff --git a/Adyen/src/Model/TransferWebhooks/CounterpartyV3.cs b/Adyen/Model/TransferWebhooks/CounterpartyV3.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/CounterpartyV3.cs rename to Adyen/Model/TransferWebhooks/CounterpartyV3.cs diff --git a/Adyen/src/Model/TransferWebhooks/DKLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/DKLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/DirectDebitInformation.cs b/Adyen/Model/TransferWebhooks/DirectDebitInformation.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/DirectDebitInformation.cs rename to Adyen/Model/TransferWebhooks/DirectDebitInformation.cs diff --git a/Adyen/src/Model/TransferWebhooks/EstimationTrackingData.cs b/Adyen/Model/TransferWebhooks/EstimationTrackingData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/EstimationTrackingData.cs rename to Adyen/Model/TransferWebhooks/EstimationTrackingData.cs diff --git a/Adyen/src/Model/TransferWebhooks/ExternalReason.cs b/Adyen/Model/TransferWebhooks/ExternalReason.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/ExternalReason.cs rename to Adyen/Model/TransferWebhooks/ExternalReason.cs diff --git a/Adyen/src/Model/TransferWebhooks/HKLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/HKLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/HKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/HULocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/HULocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/HULocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/IbanAccountIdentification.cs b/Adyen/Model/TransferWebhooks/IbanAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/IbanAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/IbanAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/InternalCategoryData.cs b/Adyen/Model/TransferWebhooks/InternalCategoryData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/InternalCategoryData.cs rename to Adyen/Model/TransferWebhooks/InternalCategoryData.cs diff --git a/Adyen/src/Model/TransferWebhooks/InternalReviewTrackingData.cs b/Adyen/Model/TransferWebhooks/InternalReviewTrackingData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/InternalReviewTrackingData.cs rename to Adyen/Model/TransferWebhooks/InternalReviewTrackingData.cs diff --git a/Adyen/src/Model/TransferWebhooks/IssuedCard.cs b/Adyen/Model/TransferWebhooks/IssuedCard.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/IssuedCard.cs rename to Adyen/Model/TransferWebhooks/IssuedCard.cs diff --git a/Adyen/src/Model/TransferWebhooks/IssuingTransactionData.cs b/Adyen/Model/TransferWebhooks/IssuingTransactionData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/IssuingTransactionData.cs rename to Adyen/Model/TransferWebhooks/IssuingTransactionData.cs diff --git a/Adyen/src/Model/TransferWebhooks/Leg.cs b/Adyen/Model/TransferWebhooks/Leg.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Leg.cs rename to Adyen/Model/TransferWebhooks/Leg.cs diff --git a/Adyen/src/Model/TransferWebhooks/Lodging.cs b/Adyen/Model/TransferWebhooks/Lodging.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Lodging.cs rename to Adyen/Model/TransferWebhooks/Lodging.cs diff --git a/Adyen/src/Model/TransferWebhooks/MerchantData.cs b/Adyen/Model/TransferWebhooks/MerchantData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/MerchantData.cs rename to Adyen/Model/TransferWebhooks/MerchantData.cs diff --git a/Adyen/src/Model/TransferWebhooks/MerchantPurchaseData.cs b/Adyen/Model/TransferWebhooks/MerchantPurchaseData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/MerchantPurchaseData.cs rename to Adyen/Model/TransferWebhooks/MerchantPurchaseData.cs diff --git a/Adyen/src/Model/TransferWebhooks/Modification.cs b/Adyen/Model/TransferWebhooks/Modification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Modification.cs rename to Adyen/Model/TransferWebhooks/Modification.cs diff --git a/Adyen/src/Model/TransferWebhooks/NOLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/NOLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/NOLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/NZLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/NZLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/NameLocation.cs b/Adyen/Model/TransferWebhooks/NameLocation.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/NameLocation.cs rename to Adyen/Model/TransferWebhooks/NameLocation.cs diff --git a/Adyen/src/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs b/Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/PLLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/PLLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/PartyIdentification.cs b/Adyen/Model/TransferWebhooks/PartyIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/PartyIdentification.cs rename to Adyen/Model/TransferWebhooks/PartyIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/PaymentInstrument.cs b/Adyen/Model/TransferWebhooks/PaymentInstrument.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/PaymentInstrument.cs rename to Adyen/Model/TransferWebhooks/PaymentInstrument.cs diff --git a/Adyen/src/Model/TransferWebhooks/PlatformPayment.cs b/Adyen/Model/TransferWebhooks/PlatformPayment.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/PlatformPayment.cs rename to Adyen/Model/TransferWebhooks/PlatformPayment.cs diff --git a/Adyen/src/Model/TransferWebhooks/RelayedAuthorisationData.cs b/Adyen/Model/TransferWebhooks/RelayedAuthorisationData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/RelayedAuthorisationData.cs rename to Adyen/Model/TransferWebhooks/RelayedAuthorisationData.cs diff --git a/Adyen/src/Model/TransferWebhooks/Resource.cs b/Adyen/Model/TransferWebhooks/Resource.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Resource.cs rename to Adyen/Model/TransferWebhooks/Resource.cs diff --git a/Adyen/src/Model/TransferWebhooks/ResourceReference.cs b/Adyen/Model/TransferWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/ResourceReference.cs rename to Adyen/Model/TransferWebhooks/ResourceReference.cs diff --git a/Adyen/src/Model/TransferWebhooks/SELocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/SELocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/SELocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/SGLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/SGLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransactionEventViolation.cs b/Adyen/Model/TransferWebhooks/TransactionEventViolation.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransactionEventViolation.cs rename to Adyen/Model/TransferWebhooks/TransactionEventViolation.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransactionRuleReference.cs b/Adyen/Model/TransferWebhooks/TransactionRuleReference.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransactionRuleReference.cs rename to Adyen/Model/TransferWebhooks/TransactionRuleReference.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransactionRuleSource.cs b/Adyen/Model/TransferWebhooks/TransactionRuleSource.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransactionRuleSource.cs rename to Adyen/Model/TransferWebhooks/TransactionRuleSource.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransactionRulesResult.cs b/Adyen/Model/TransferWebhooks/TransactionRulesResult.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransactionRulesResult.cs rename to Adyen/Model/TransferWebhooks/TransactionRulesResult.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferData.cs b/Adyen/Model/TransferWebhooks/TransferData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferData.cs rename to Adyen/Model/TransferWebhooks/TransferData.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferDataCategoryData.cs b/Adyen/Model/TransferWebhooks/TransferDataCategoryData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferDataCategoryData.cs rename to Adyen/Model/TransferWebhooks/TransferDataCategoryData.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferDataTracking.cs b/Adyen/Model/TransferWebhooks/TransferDataTracking.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferDataTracking.cs rename to Adyen/Model/TransferWebhooks/TransferDataTracking.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferEvent.cs b/Adyen/Model/TransferWebhooks/TransferEvent.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferEvent.cs rename to Adyen/Model/TransferWebhooks/TransferEvent.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferEventEventsDataInner.cs b/Adyen/Model/TransferWebhooks/TransferEventEventsDataInner.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferEventEventsDataInner.cs rename to Adyen/Model/TransferWebhooks/TransferEventEventsDataInner.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferEventTrackingData.cs b/Adyen/Model/TransferWebhooks/TransferEventTrackingData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferEventTrackingData.cs rename to Adyen/Model/TransferWebhooks/TransferEventTrackingData.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferNotificationCounterParty.cs b/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferNotificationCounterParty.cs rename to Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferNotificationMerchantData.cs b/Adyen/Model/TransferWebhooks/TransferNotificationMerchantData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferNotificationMerchantData.cs rename to Adyen/Model/TransferWebhooks/TransferNotificationMerchantData.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferNotificationRequest.cs b/Adyen/Model/TransferWebhooks/TransferNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferNotificationRequest.cs rename to Adyen/Model/TransferWebhooks/TransferNotificationRequest.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferNotificationValidationFact.cs b/Adyen/Model/TransferWebhooks/TransferNotificationValidationFact.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferNotificationValidationFact.cs rename to Adyen/Model/TransferWebhooks/TransferNotificationValidationFact.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferReview.cs b/Adyen/Model/TransferWebhooks/TransferReview.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferReview.cs rename to Adyen/Model/TransferWebhooks/TransferReview.cs diff --git a/Adyen/src/Model/TransferWebhooks/UKLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/UKLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/USLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/USLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/USLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/AULocalAccountIdentification.cs b/Adyen/Model/Transfers/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/AULocalAccountIdentification.cs rename to Adyen/Model/Transfers/AULocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/AbstractOpenAPISchema.cs b/Adyen/Model/Transfers/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Transfers/AbstractOpenAPISchema.cs rename to Adyen/Model/Transfers/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Transfers/AdditionalBankIdentification.cs b/Adyen/Model/Transfers/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/AdditionalBankIdentification.cs rename to Adyen/Model/Transfers/AdditionalBankIdentification.cs diff --git a/Adyen/src/Model/Transfers/Address.cs b/Adyen/Model/Transfers/Address.cs similarity index 100% rename from Adyen/src/Model/Transfers/Address.cs rename to Adyen/Model/Transfers/Address.cs diff --git a/Adyen/src/Model/Transfers/Airline.cs b/Adyen/Model/Transfers/Airline.cs similarity index 100% rename from Adyen/src/Model/Transfers/Airline.cs rename to Adyen/Model/Transfers/Airline.cs diff --git a/Adyen/src/Model/Transfers/Amount.cs b/Adyen/Model/Transfers/Amount.cs similarity index 100% rename from Adyen/src/Model/Transfers/Amount.cs rename to Adyen/Model/Transfers/Amount.cs diff --git a/Adyen/src/Model/Transfers/AmountAdjustment.cs b/Adyen/Model/Transfers/AmountAdjustment.cs similarity index 100% rename from Adyen/src/Model/Transfers/AmountAdjustment.cs rename to Adyen/Model/Transfers/AmountAdjustment.cs diff --git a/Adyen/src/Model/Transfers/ApproveTransfersRequest.cs b/Adyen/Model/Transfers/ApproveTransfersRequest.cs similarity index 100% rename from Adyen/src/Model/Transfers/ApproveTransfersRequest.cs rename to Adyen/Model/Transfers/ApproveTransfersRequest.cs diff --git a/Adyen/src/Model/Transfers/BRLocalAccountIdentification.cs b/Adyen/Model/Transfers/BRLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/BRLocalAccountIdentification.cs rename to Adyen/Model/Transfers/BRLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/BalanceMutation.cs b/Adyen/Model/Transfers/BalanceMutation.cs similarity index 100% rename from Adyen/src/Model/Transfers/BalanceMutation.cs rename to Adyen/Model/Transfers/BalanceMutation.cs diff --git a/Adyen/src/Model/Transfers/BankAccountV3.cs b/Adyen/Model/Transfers/BankAccountV3.cs similarity index 100% rename from Adyen/src/Model/Transfers/BankAccountV3.cs rename to Adyen/Model/Transfers/BankAccountV3.cs diff --git a/Adyen/src/Model/Transfers/BankAccountV3AccountIdentification.cs b/Adyen/Model/Transfers/BankAccountV3AccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/BankAccountV3AccountIdentification.cs rename to Adyen/Model/Transfers/BankAccountV3AccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/BankCategoryData.cs b/Adyen/Model/Transfers/BankCategoryData.cs similarity index 100% rename from Adyen/src/Model/Transfers/BankCategoryData.cs rename to Adyen/Model/Transfers/BankCategoryData.cs diff --git a/Adyen/src/Model/Transfers/CALocalAccountIdentification.cs b/Adyen/Model/Transfers/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/CALocalAccountIdentification.cs rename to Adyen/Model/Transfers/CALocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/CZLocalAccountIdentification.cs b/Adyen/Model/Transfers/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/CZLocalAccountIdentification.cs rename to Adyen/Model/Transfers/CZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/CancelTransfersRequest.cs b/Adyen/Model/Transfers/CancelTransfersRequest.cs similarity index 100% rename from Adyen/src/Model/Transfers/CancelTransfersRequest.cs rename to Adyen/Model/Transfers/CancelTransfersRequest.cs diff --git a/Adyen/src/Model/Transfers/CapitalBalance.cs b/Adyen/Model/Transfers/CapitalBalance.cs similarity index 100% rename from Adyen/src/Model/Transfers/CapitalBalance.cs rename to Adyen/Model/Transfers/CapitalBalance.cs diff --git a/Adyen/src/Model/Transfers/CapitalGrant.cs b/Adyen/Model/Transfers/CapitalGrant.cs similarity index 100% rename from Adyen/src/Model/Transfers/CapitalGrant.cs rename to Adyen/Model/Transfers/CapitalGrant.cs diff --git a/Adyen/src/Model/Transfers/CapitalGrantInfo.cs b/Adyen/Model/Transfers/CapitalGrantInfo.cs similarity index 100% rename from Adyen/src/Model/Transfers/CapitalGrantInfo.cs rename to Adyen/Model/Transfers/CapitalGrantInfo.cs diff --git a/Adyen/src/Model/Transfers/CapitalGrants.cs b/Adyen/Model/Transfers/CapitalGrants.cs similarity index 100% rename from Adyen/src/Model/Transfers/CapitalGrants.cs rename to Adyen/Model/Transfers/CapitalGrants.cs diff --git a/Adyen/src/Model/Transfers/Card.cs b/Adyen/Model/Transfers/Card.cs similarity index 100% rename from Adyen/src/Model/Transfers/Card.cs rename to Adyen/Model/Transfers/Card.cs diff --git a/Adyen/src/Model/Transfers/CardIdentification.cs b/Adyen/Model/Transfers/CardIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/CardIdentification.cs rename to Adyen/Model/Transfers/CardIdentification.cs diff --git a/Adyen/src/Model/Transfers/ConfirmationTrackingData.cs b/Adyen/Model/Transfers/ConfirmationTrackingData.cs similarity index 100% rename from Adyen/src/Model/Transfers/ConfirmationTrackingData.cs rename to Adyen/Model/Transfers/ConfirmationTrackingData.cs diff --git a/Adyen/src/Model/Transfers/Counterparty.cs b/Adyen/Model/Transfers/Counterparty.cs similarity index 100% rename from Adyen/src/Model/Transfers/Counterparty.cs rename to Adyen/Model/Transfers/Counterparty.cs diff --git a/Adyen/src/Model/Transfers/CounterpartyInfoV3.cs b/Adyen/Model/Transfers/CounterpartyInfoV3.cs similarity index 100% rename from Adyen/src/Model/Transfers/CounterpartyInfoV3.cs rename to Adyen/Model/Transfers/CounterpartyInfoV3.cs diff --git a/Adyen/src/Model/Transfers/CounterpartyV3.cs b/Adyen/Model/Transfers/CounterpartyV3.cs similarity index 100% rename from Adyen/src/Model/Transfers/CounterpartyV3.cs rename to Adyen/Model/Transfers/CounterpartyV3.cs diff --git a/Adyen/src/Model/Transfers/DKLocalAccountIdentification.cs b/Adyen/Model/Transfers/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/DKLocalAccountIdentification.cs rename to Adyen/Model/Transfers/DKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/DirectDebitInformation.cs b/Adyen/Model/Transfers/DirectDebitInformation.cs similarity index 100% rename from Adyen/src/Model/Transfers/DirectDebitInformation.cs rename to Adyen/Model/Transfers/DirectDebitInformation.cs diff --git a/Adyen/src/Model/Transfers/EstimationTrackingData.cs b/Adyen/Model/Transfers/EstimationTrackingData.cs similarity index 100% rename from Adyen/src/Model/Transfers/EstimationTrackingData.cs rename to Adyen/Model/Transfers/EstimationTrackingData.cs diff --git a/Adyen/src/Model/Transfers/ExternalReason.cs b/Adyen/Model/Transfers/ExternalReason.cs similarity index 100% rename from Adyen/src/Model/Transfers/ExternalReason.cs rename to Adyen/Model/Transfers/ExternalReason.cs diff --git a/Adyen/src/Model/Transfers/Fee.cs b/Adyen/Model/Transfers/Fee.cs similarity index 100% rename from Adyen/src/Model/Transfers/Fee.cs rename to Adyen/Model/Transfers/Fee.cs diff --git a/Adyen/src/Model/Transfers/FindTransfersResponse.cs b/Adyen/Model/Transfers/FindTransfersResponse.cs similarity index 100% rename from Adyen/src/Model/Transfers/FindTransfersResponse.cs rename to Adyen/Model/Transfers/FindTransfersResponse.cs diff --git a/Adyen/src/Model/Transfers/HKLocalAccountIdentification.cs b/Adyen/Model/Transfers/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/HKLocalAccountIdentification.cs rename to Adyen/Model/Transfers/HKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/HULocalAccountIdentification.cs b/Adyen/Model/Transfers/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/HULocalAccountIdentification.cs rename to Adyen/Model/Transfers/HULocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/IbanAccountIdentification.cs b/Adyen/Model/Transfers/IbanAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/IbanAccountIdentification.cs rename to Adyen/Model/Transfers/IbanAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/InternalCategoryData.cs b/Adyen/Model/Transfers/InternalCategoryData.cs similarity index 100% rename from Adyen/src/Model/Transfers/InternalCategoryData.cs rename to Adyen/Model/Transfers/InternalCategoryData.cs diff --git a/Adyen/src/Model/Transfers/InternalReviewTrackingData.cs b/Adyen/Model/Transfers/InternalReviewTrackingData.cs similarity index 100% rename from Adyen/src/Model/Transfers/InternalReviewTrackingData.cs rename to Adyen/Model/Transfers/InternalReviewTrackingData.cs diff --git a/Adyen/src/Model/Transfers/InvalidField.cs b/Adyen/Model/Transfers/InvalidField.cs similarity index 100% rename from Adyen/src/Model/Transfers/InvalidField.cs rename to Adyen/Model/Transfers/InvalidField.cs diff --git a/Adyen/src/Model/Transfers/IssuedCard.cs b/Adyen/Model/Transfers/IssuedCard.cs similarity index 100% rename from Adyen/src/Model/Transfers/IssuedCard.cs rename to Adyen/Model/Transfers/IssuedCard.cs diff --git a/Adyen/src/Model/Transfers/IssuingTransactionData.cs b/Adyen/Model/Transfers/IssuingTransactionData.cs similarity index 100% rename from Adyen/src/Model/Transfers/IssuingTransactionData.cs rename to Adyen/Model/Transfers/IssuingTransactionData.cs diff --git a/Adyen/src/Model/Transfers/Leg.cs b/Adyen/Model/Transfers/Leg.cs similarity index 100% rename from Adyen/src/Model/Transfers/Leg.cs rename to Adyen/Model/Transfers/Leg.cs diff --git a/Adyen/src/Model/Transfers/Link.cs b/Adyen/Model/Transfers/Link.cs similarity index 100% rename from Adyen/src/Model/Transfers/Link.cs rename to Adyen/Model/Transfers/Link.cs diff --git a/Adyen/src/Model/Transfers/Links.cs b/Adyen/Model/Transfers/Links.cs similarity index 100% rename from Adyen/src/Model/Transfers/Links.cs rename to Adyen/Model/Transfers/Links.cs diff --git a/Adyen/src/Model/Transfers/Lodging.cs b/Adyen/Model/Transfers/Lodging.cs similarity index 100% rename from Adyen/src/Model/Transfers/Lodging.cs rename to Adyen/Model/Transfers/Lodging.cs diff --git a/Adyen/src/Model/Transfers/MerchantData.cs b/Adyen/Model/Transfers/MerchantData.cs similarity index 100% rename from Adyen/src/Model/Transfers/MerchantData.cs rename to Adyen/Model/Transfers/MerchantData.cs diff --git a/Adyen/src/Model/Transfers/MerchantPurchaseData.cs b/Adyen/Model/Transfers/MerchantPurchaseData.cs similarity index 100% rename from Adyen/src/Model/Transfers/MerchantPurchaseData.cs rename to Adyen/Model/Transfers/MerchantPurchaseData.cs diff --git a/Adyen/src/Model/Transfers/Modification.cs b/Adyen/Model/Transfers/Modification.cs similarity index 100% rename from Adyen/src/Model/Transfers/Modification.cs rename to Adyen/Model/Transfers/Modification.cs diff --git a/Adyen/src/Model/Transfers/NOLocalAccountIdentification.cs b/Adyen/Model/Transfers/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/NOLocalAccountIdentification.cs rename to Adyen/Model/Transfers/NOLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/NZLocalAccountIdentification.cs b/Adyen/Model/Transfers/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/NZLocalAccountIdentification.cs rename to Adyen/Model/Transfers/NZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/NameLocation.cs b/Adyen/Model/Transfers/NameLocation.cs similarity index 100% rename from Adyen/src/Model/Transfers/NameLocation.cs rename to Adyen/Model/Transfers/NameLocation.cs diff --git a/Adyen/src/Model/Transfers/NumberAndBicAccountIdentification.cs b/Adyen/Model/Transfers/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/NumberAndBicAccountIdentification.cs rename to Adyen/Model/Transfers/NumberAndBicAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/PLLocalAccountIdentification.cs b/Adyen/Model/Transfers/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/PLLocalAccountIdentification.cs rename to Adyen/Model/Transfers/PLLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/PartyIdentification.cs b/Adyen/Model/Transfers/PartyIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/PartyIdentification.cs rename to Adyen/Model/Transfers/PartyIdentification.cs diff --git a/Adyen/src/Model/Transfers/PaymentInstrument.cs b/Adyen/Model/Transfers/PaymentInstrument.cs similarity index 100% rename from Adyen/src/Model/Transfers/PaymentInstrument.cs rename to Adyen/Model/Transfers/PaymentInstrument.cs diff --git a/Adyen/src/Model/Transfers/PlatformPayment.cs b/Adyen/Model/Transfers/PlatformPayment.cs similarity index 100% rename from Adyen/src/Model/Transfers/PlatformPayment.cs rename to Adyen/Model/Transfers/PlatformPayment.cs diff --git a/Adyen/src/Model/Transfers/RelayedAuthorisationData.cs b/Adyen/Model/Transfers/RelayedAuthorisationData.cs similarity index 100% rename from Adyen/src/Model/Transfers/RelayedAuthorisationData.cs rename to Adyen/Model/Transfers/RelayedAuthorisationData.cs diff --git a/Adyen/src/Model/Transfers/Repayment.cs b/Adyen/Model/Transfers/Repayment.cs similarity index 100% rename from Adyen/src/Model/Transfers/Repayment.cs rename to Adyen/Model/Transfers/Repayment.cs diff --git a/Adyen/src/Model/Transfers/RepaymentTerm.cs b/Adyen/Model/Transfers/RepaymentTerm.cs similarity index 100% rename from Adyen/src/Model/Transfers/RepaymentTerm.cs rename to Adyen/Model/Transfers/RepaymentTerm.cs diff --git a/Adyen/src/Model/Transfers/ResourceReference.cs b/Adyen/Model/Transfers/ResourceReference.cs similarity index 100% rename from Adyen/src/Model/Transfers/ResourceReference.cs rename to Adyen/Model/Transfers/ResourceReference.cs diff --git a/Adyen/src/Model/Transfers/RestServiceError.cs b/Adyen/Model/Transfers/RestServiceError.cs similarity index 100% rename from Adyen/src/Model/Transfers/RestServiceError.cs rename to Adyen/Model/Transfers/RestServiceError.cs diff --git a/Adyen/src/Model/Transfers/ReturnTransferRequest.cs b/Adyen/Model/Transfers/ReturnTransferRequest.cs similarity index 100% rename from Adyen/src/Model/Transfers/ReturnTransferRequest.cs rename to Adyen/Model/Transfers/ReturnTransferRequest.cs diff --git a/Adyen/src/Model/Transfers/ReturnTransferResponse.cs b/Adyen/Model/Transfers/ReturnTransferResponse.cs similarity index 100% rename from Adyen/src/Model/Transfers/ReturnTransferResponse.cs rename to Adyen/Model/Transfers/ReturnTransferResponse.cs diff --git a/Adyen/src/Model/Transfers/RoutingDetails.cs b/Adyen/Model/Transfers/RoutingDetails.cs similarity index 100% rename from Adyen/src/Model/Transfers/RoutingDetails.cs rename to Adyen/Model/Transfers/RoutingDetails.cs diff --git a/Adyen/src/Model/Transfers/SELocalAccountIdentification.cs b/Adyen/Model/Transfers/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/SELocalAccountIdentification.cs rename to Adyen/Model/Transfers/SELocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/SGLocalAccountIdentification.cs b/Adyen/Model/Transfers/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/SGLocalAccountIdentification.cs rename to Adyen/Model/Transfers/SGLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/ServiceError.cs b/Adyen/Model/Transfers/ServiceError.cs similarity index 100% rename from Adyen/src/Model/Transfers/ServiceError.cs rename to Adyen/Model/Transfers/ServiceError.cs diff --git a/Adyen/src/Model/Transfers/ThresholdRepayment.cs b/Adyen/Model/Transfers/ThresholdRepayment.cs similarity index 100% rename from Adyen/src/Model/Transfers/ThresholdRepayment.cs rename to Adyen/Model/Transfers/ThresholdRepayment.cs diff --git a/Adyen/src/Model/Transfers/Transaction.cs b/Adyen/Model/Transfers/Transaction.cs similarity index 100% rename from Adyen/src/Model/Transfers/Transaction.cs rename to Adyen/Model/Transfers/Transaction.cs diff --git a/Adyen/src/Model/Transfers/TransactionEventViolation.cs b/Adyen/Model/Transfers/TransactionEventViolation.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransactionEventViolation.cs rename to Adyen/Model/Transfers/TransactionEventViolation.cs diff --git a/Adyen/src/Model/Transfers/TransactionRuleReference.cs b/Adyen/Model/Transfers/TransactionRuleReference.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransactionRuleReference.cs rename to Adyen/Model/Transfers/TransactionRuleReference.cs diff --git a/Adyen/src/Model/Transfers/TransactionRuleSource.cs b/Adyen/Model/Transfers/TransactionRuleSource.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransactionRuleSource.cs rename to Adyen/Model/Transfers/TransactionRuleSource.cs diff --git a/Adyen/src/Model/Transfers/TransactionRulesResult.cs b/Adyen/Model/Transfers/TransactionRulesResult.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransactionRulesResult.cs rename to Adyen/Model/Transfers/TransactionRulesResult.cs diff --git a/Adyen/src/Model/Transfers/TransactionSearchResponse.cs b/Adyen/Model/Transfers/TransactionSearchResponse.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransactionSearchResponse.cs rename to Adyen/Model/Transfers/TransactionSearchResponse.cs diff --git a/Adyen/src/Model/Transfers/Transfer.cs b/Adyen/Model/Transfers/Transfer.cs similarity index 100% rename from Adyen/src/Model/Transfers/Transfer.cs rename to Adyen/Model/Transfers/Transfer.cs diff --git a/Adyen/src/Model/Transfers/TransferCategoryData.cs b/Adyen/Model/Transfers/TransferCategoryData.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferCategoryData.cs rename to Adyen/Model/Transfers/TransferCategoryData.cs diff --git a/Adyen/src/Model/Transfers/TransferData.cs b/Adyen/Model/Transfers/TransferData.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferData.cs rename to Adyen/Model/Transfers/TransferData.cs diff --git a/Adyen/src/Model/Transfers/TransferDataTracking.cs b/Adyen/Model/Transfers/TransferDataTracking.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferDataTracking.cs rename to Adyen/Model/Transfers/TransferDataTracking.cs diff --git a/Adyen/src/Model/Transfers/TransferEvent.cs b/Adyen/Model/Transfers/TransferEvent.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferEvent.cs rename to Adyen/Model/Transfers/TransferEvent.cs diff --git a/Adyen/src/Model/Transfers/TransferEventEventsDataInner.cs b/Adyen/Model/Transfers/TransferEventEventsDataInner.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferEventEventsDataInner.cs rename to Adyen/Model/Transfers/TransferEventEventsDataInner.cs diff --git a/Adyen/src/Model/Transfers/TransferEventTrackingData.cs b/Adyen/Model/Transfers/TransferEventTrackingData.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferEventTrackingData.cs rename to Adyen/Model/Transfers/TransferEventTrackingData.cs diff --git a/Adyen/src/Model/Transfers/TransferInfo.cs b/Adyen/Model/Transfers/TransferInfo.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferInfo.cs rename to Adyen/Model/Transfers/TransferInfo.cs diff --git a/Adyen/src/Model/Transfers/TransferNotificationCounterParty.cs b/Adyen/Model/Transfers/TransferNotificationCounterParty.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferNotificationCounterParty.cs rename to Adyen/Model/Transfers/TransferNotificationCounterParty.cs diff --git a/Adyen/src/Model/Transfers/TransferNotificationMerchantData.cs b/Adyen/Model/Transfers/TransferNotificationMerchantData.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferNotificationMerchantData.cs rename to Adyen/Model/Transfers/TransferNotificationMerchantData.cs diff --git a/Adyen/src/Model/Transfers/TransferNotificationValidationFact.cs b/Adyen/Model/Transfers/TransferNotificationValidationFact.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferNotificationValidationFact.cs rename to Adyen/Model/Transfers/TransferNotificationValidationFact.cs diff --git a/Adyen/src/Model/Transfers/TransferRequestReview.cs b/Adyen/Model/Transfers/TransferRequestReview.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferRequestReview.cs rename to Adyen/Model/Transfers/TransferRequestReview.cs diff --git a/Adyen/src/Model/Transfers/TransferReview.cs b/Adyen/Model/Transfers/TransferReview.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferReview.cs rename to Adyen/Model/Transfers/TransferReview.cs diff --git a/Adyen/src/Model/Transfers/TransferServiceRestServiceError.cs b/Adyen/Model/Transfers/TransferServiceRestServiceError.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferServiceRestServiceError.cs rename to Adyen/Model/Transfers/TransferServiceRestServiceError.cs diff --git a/Adyen/src/Model/Transfers/TransferView.cs b/Adyen/Model/Transfers/TransferView.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferView.cs rename to Adyen/Model/Transfers/TransferView.cs diff --git a/Adyen/src/Model/Transfers/UKLocalAccountIdentification.cs b/Adyen/Model/Transfers/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/UKLocalAccountIdentification.cs rename to Adyen/Model/Transfers/UKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/USLocalAccountIdentification.cs b/Adyen/Model/Transfers/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/USLocalAccountIdentification.cs rename to Adyen/Model/Transfers/USLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/UltimatePartyIdentification.cs b/Adyen/Model/Transfers/UltimatePartyIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/UltimatePartyIdentification.cs rename to Adyen/Model/Transfers/UltimatePartyIdentification.cs diff --git a/Adyen/src/Security/AesEncryptor.cs b/Adyen/Security/AesEncryptor.cs similarity index 100% rename from Adyen/src/Security/AesEncryptor.cs rename to Adyen/Security/AesEncryptor.cs diff --git a/Adyen/src/Security/EncryptionCredentialDetails.cs b/Adyen/Security/EncryptionCredentialDetails.cs similarity index 100% rename from Adyen/src/Security/EncryptionCredentialDetails.cs rename to Adyen/Security/EncryptionCredentialDetails.cs diff --git a/Adyen/src/Security/EncryptionDerivedKey.cs b/Adyen/Security/EncryptionDerivedKey.cs similarity index 100% rename from Adyen/src/Security/EncryptionDerivedKey.cs rename to Adyen/Security/EncryptionDerivedKey.cs diff --git a/Adyen/src/Security/EncryptionDerivedKeyGenerator.cs b/Adyen/Security/EncryptionDerivedKeyGenerator.cs similarity index 100% rename from Adyen/src/Security/EncryptionDerivedKeyGenerator.cs rename to Adyen/Security/EncryptionDerivedKeyGenerator.cs diff --git a/Adyen/src/Security/Exceptions/NexoCryptoException.cs b/Adyen/Security/Exceptions/NexoCryptoException.cs similarity index 100% rename from Adyen/src/Security/Exceptions/NexoCryptoException.cs rename to Adyen/Security/Exceptions/NexoCryptoException.cs diff --git a/Adyen/src/Security/Extension/ArrayExtension.cs b/Adyen/Security/Extension/ArrayExtension.cs similarity index 100% rename from Adyen/src/Security/Extension/ArrayExtension.cs rename to Adyen/Security/Extension/ArrayExtension.cs diff --git a/Adyen/src/Security/HmacSha256Wrapper.cs b/Adyen/Security/HmacSha256Wrapper.cs similarity index 100% rename from Adyen/src/Security/HmacSha256Wrapper.cs rename to Adyen/Security/HmacSha256Wrapper.cs diff --git a/Adyen/src/Security/IvModGenerator.cs b/Adyen/Security/IvModGenerator.cs similarity index 100% rename from Adyen/src/Security/IvModGenerator.cs rename to Adyen/Security/IvModGenerator.cs diff --git a/Adyen/src/Security/SaleToPoiMessageSecured.cs b/Adyen/Security/SaleToPoiMessageSecured.cs similarity index 100% rename from Adyen/src/Security/SaleToPoiMessageSecured.cs rename to Adyen/Security/SaleToPoiMessageSecured.cs diff --git a/Adyen/src/Security/SaleToPoiMessageSecuredEncryptor.cs b/Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs similarity index 100% rename from Adyen/src/Security/SaleToPoiMessageSecuredEncryptor.cs rename to Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs diff --git a/Adyen/src/Security/SecurityTrailer.cs b/Adyen/Security/SecurityTrailer.cs similarity index 100% rename from Adyen/src/Security/SecurityTrailer.cs rename to Adyen/Security/SecurityTrailer.cs diff --git a/Adyen/src/Security/TerminalCommonNameValidator.cs b/Adyen/Security/TerminalCommonNameValidator.cs similarity index 100% rename from Adyen/src/Security/TerminalCommonNameValidator.cs rename to Adyen/Security/TerminalCommonNameValidator.cs diff --git a/Adyen/src/Service/AbstractService.cs b/Adyen/Service/AbstractService.cs similarity index 100% rename from Adyen/src/Service/AbstractService.cs rename to Adyen/Service/AbstractService.cs diff --git a/Adyen/src/Service/ApiException.cs b/Adyen/Service/ApiException.cs similarity index 100% rename from Adyen/src/Service/ApiException.cs rename to Adyen/Service/ApiException.cs diff --git a/Adyen/src/Service/BalanceControlService.cs b/Adyen/Service/BalanceControlService.cs similarity index 100% rename from Adyen/src/Service/BalanceControlService.cs rename to Adyen/Service/BalanceControlService.cs diff --git a/Adyen/src/Service/BalancePlatform/AccountHoldersService.cs b/Adyen/Service/BalancePlatform/AccountHoldersService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/AccountHoldersService.cs rename to Adyen/Service/BalancePlatform/AccountHoldersService.cs diff --git a/Adyen/src/Service/BalancePlatform/BalanceAccountsService.cs b/Adyen/Service/BalancePlatform/BalanceAccountsService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/BalanceAccountsService.cs rename to Adyen/Service/BalancePlatform/BalanceAccountsService.cs diff --git a/Adyen/src/Service/BalancePlatform/BankAccountValidationService.cs b/Adyen/Service/BalancePlatform/BankAccountValidationService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/BankAccountValidationService.cs rename to Adyen/Service/BalancePlatform/BankAccountValidationService.cs diff --git a/Adyen/src/Service/BalancePlatform/CardOrdersService.cs b/Adyen/Service/BalancePlatform/CardOrdersService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/CardOrdersService.cs rename to Adyen/Service/BalancePlatform/CardOrdersService.cs diff --git a/Adyen/src/Service/BalancePlatform/GrantAccountsService.cs b/Adyen/Service/BalancePlatform/GrantAccountsService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/GrantAccountsService.cs rename to Adyen/Service/BalancePlatform/GrantAccountsService.cs diff --git a/Adyen/src/Service/BalancePlatform/GrantOffersService.cs b/Adyen/Service/BalancePlatform/GrantOffersService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/GrantOffersService.cs rename to Adyen/Service/BalancePlatform/GrantOffersService.cs diff --git a/Adyen/src/Service/BalancePlatform/ManageCardPINService.cs b/Adyen/Service/BalancePlatform/ManageCardPINService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/ManageCardPINService.cs rename to Adyen/Service/BalancePlatform/ManageCardPINService.cs diff --git a/Adyen/src/Service/BalancePlatform/ManageSCADevicesService.cs b/Adyen/Service/BalancePlatform/ManageSCADevicesService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/ManageSCADevicesService.cs rename to Adyen/Service/BalancePlatform/ManageSCADevicesService.cs diff --git a/Adyen/src/Service/BalancePlatform/NetworkTokensService.cs b/Adyen/Service/BalancePlatform/NetworkTokensService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/NetworkTokensService.cs rename to Adyen/Service/BalancePlatform/NetworkTokensService.cs diff --git a/Adyen/src/Service/BalancePlatform/PaymentInstrumentGroupsService.cs b/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/PaymentInstrumentGroupsService.cs rename to Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs diff --git a/Adyen/src/Service/BalancePlatform/PaymentInstrumentsService.cs b/Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/PaymentInstrumentsService.cs rename to Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs diff --git a/Adyen/src/Service/BalancePlatform/PlatformService.cs b/Adyen/Service/BalancePlatform/PlatformService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/PlatformService.cs rename to Adyen/Service/BalancePlatform/PlatformService.cs diff --git a/Adyen/src/Service/BalancePlatform/TransactionRulesService.cs b/Adyen/Service/BalancePlatform/TransactionRulesService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/TransactionRulesService.cs rename to Adyen/Service/BalancePlatform/TransactionRulesService.cs diff --git a/Adyen/src/Service/BalancePlatform/TransferRoutesService.cs b/Adyen/Service/BalancePlatform/TransferRoutesService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/TransferRoutesService.cs rename to Adyen/Service/BalancePlatform/TransferRoutesService.cs diff --git a/Adyen/src/Service/BinLookupService.cs b/Adyen/Service/BinLookupService.cs similarity index 100% rename from Adyen/src/Service/BinLookupService.cs rename to Adyen/Service/BinLookupService.cs diff --git a/Adyen/src/Service/Checkout/DonationsService.cs b/Adyen/Service/Checkout/DonationsService.cs similarity index 100% rename from Adyen/src/Service/Checkout/DonationsService.cs rename to Adyen/Service/Checkout/DonationsService.cs diff --git a/Adyen/src/Service/Checkout/ModificationsService.cs b/Adyen/Service/Checkout/ModificationsService.cs similarity index 100% rename from Adyen/src/Service/Checkout/ModificationsService.cs rename to Adyen/Service/Checkout/ModificationsService.cs diff --git a/Adyen/src/Service/Checkout/OrdersService.cs b/Adyen/Service/Checkout/OrdersService.cs similarity index 100% rename from Adyen/src/Service/Checkout/OrdersService.cs rename to Adyen/Service/Checkout/OrdersService.cs diff --git a/Adyen/src/Service/Checkout/PaymentLinksService.cs b/Adyen/Service/Checkout/PaymentLinksService.cs similarity index 100% rename from Adyen/src/Service/Checkout/PaymentLinksService.cs rename to Adyen/Service/Checkout/PaymentLinksService.cs diff --git a/Adyen/src/Service/Checkout/PaymentsService.cs b/Adyen/Service/Checkout/PaymentsService.cs similarity index 100% rename from Adyen/src/Service/Checkout/PaymentsService.cs rename to Adyen/Service/Checkout/PaymentsService.cs diff --git a/Adyen/src/Service/Checkout/RecurringService.cs b/Adyen/Service/Checkout/RecurringService.cs similarity index 100% rename from Adyen/src/Service/Checkout/RecurringService.cs rename to Adyen/Service/Checkout/RecurringService.cs diff --git a/Adyen/src/Service/Checkout/UtilityService.cs b/Adyen/Service/Checkout/UtilityService.cs similarity index 100% rename from Adyen/src/Service/Checkout/UtilityService.cs rename to Adyen/Service/Checkout/UtilityService.cs diff --git a/Adyen/src/Service/DataProtectionService.cs b/Adyen/Service/DataProtectionService.cs similarity index 100% rename from Adyen/src/Service/DataProtectionService.cs rename to Adyen/Service/DataProtectionService.cs diff --git a/Adyen/src/Service/DisputesService.cs b/Adyen/Service/DisputesService.cs similarity index 100% rename from Adyen/src/Service/DisputesService.cs rename to Adyen/Service/DisputesService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/BusinessLinesService.cs b/Adyen/Service/LegalEntityManagement/BusinessLinesService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/BusinessLinesService.cs rename to Adyen/Service/LegalEntityManagement/BusinessLinesService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/DocumentsService.cs b/Adyen/Service/LegalEntityManagement/DocumentsService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/DocumentsService.cs rename to Adyen/Service/LegalEntityManagement/DocumentsService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/HostedOnboardingService.cs b/Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/HostedOnboardingService.cs rename to Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/LegalEntitiesService.cs b/Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/LegalEntitiesService.cs rename to Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/PCIQuestionnairesService.cs b/Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/PCIQuestionnairesService.cs rename to Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs b/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs rename to Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/TermsOfServiceService.cs b/Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/TermsOfServiceService.cs rename to Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/TransferInstrumentsService.cs b/Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/TransferInstrumentsService.cs rename to Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs diff --git a/Adyen/src/Service/Management/APICredentialsCompanyLevelService.cs b/Adyen/Service/Management/APICredentialsCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/APICredentialsCompanyLevelService.cs rename to Adyen/Service/Management/APICredentialsCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/APICredentialsMerchantLevelService.cs b/Adyen/Service/Management/APICredentialsMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/APICredentialsMerchantLevelService.cs rename to Adyen/Service/Management/APICredentialsMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/APIKeyCompanyLevelService.cs b/Adyen/Service/Management/APIKeyCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/APIKeyCompanyLevelService.cs rename to Adyen/Service/Management/APIKeyCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/APIKeyMerchantLevelService.cs b/Adyen/Service/Management/APIKeyMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/APIKeyMerchantLevelService.cs rename to Adyen/Service/Management/APIKeyMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/AccountCompanyLevelService.cs b/Adyen/Service/Management/AccountCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/AccountCompanyLevelService.cs rename to Adyen/Service/Management/AccountCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/AccountMerchantLevelService.cs b/Adyen/Service/Management/AccountMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/AccountMerchantLevelService.cs rename to Adyen/Service/Management/AccountMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/AccountStoreLevelService.cs b/Adyen/Service/Management/AccountStoreLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/AccountStoreLevelService.cs rename to Adyen/Service/Management/AccountStoreLevelService.cs diff --git a/Adyen/src/Service/Management/AllowedOriginsCompanyLevelService.cs b/Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/AllowedOriginsCompanyLevelService.cs rename to Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/AllowedOriginsMerchantLevelService.cs b/Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/AllowedOriginsMerchantLevelService.cs rename to Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/AndroidFilesCompanyLevelService.cs b/Adyen/Service/Management/AndroidFilesCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/AndroidFilesCompanyLevelService.cs rename to Adyen/Service/Management/AndroidFilesCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/ClientKeyCompanyLevelService.cs b/Adyen/Service/Management/ClientKeyCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/ClientKeyCompanyLevelService.cs rename to Adyen/Service/Management/ClientKeyCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/ClientKeyMerchantLevelService.cs b/Adyen/Service/Management/ClientKeyMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/ClientKeyMerchantLevelService.cs rename to Adyen/Service/Management/ClientKeyMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/MyAPICredentialService.cs b/Adyen/Service/Management/MyAPICredentialService.cs similarity index 100% rename from Adyen/src/Service/Management/MyAPICredentialService.cs rename to Adyen/Service/Management/MyAPICredentialService.cs diff --git a/Adyen/src/Service/Management/PaymentMethodsMerchantLevelService.cs b/Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/PaymentMethodsMerchantLevelService.cs rename to Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/PayoutSettingsMerchantLevelService.cs b/Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/PayoutSettingsMerchantLevelService.cs rename to Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/SplitConfigurationMerchantLevelService.cs b/Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/SplitConfigurationMerchantLevelService.cs rename to Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalActionsCompanyLevelService.cs b/Adyen/Service/Management/TerminalActionsCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalActionsCompanyLevelService.cs rename to Adyen/Service/Management/TerminalActionsCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalActionsTerminalLevelService.cs b/Adyen/Service/Management/TerminalActionsTerminalLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalActionsTerminalLevelService.cs rename to Adyen/Service/Management/TerminalActionsTerminalLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalOrdersCompanyLevelService.cs b/Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalOrdersCompanyLevelService.cs rename to Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalOrdersMerchantLevelService.cs b/Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalOrdersMerchantLevelService.cs rename to Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalSettingsCompanyLevelService.cs b/Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalSettingsCompanyLevelService.cs rename to Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalSettingsMerchantLevelService.cs b/Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalSettingsMerchantLevelService.cs rename to Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalSettingsStoreLevelService.cs b/Adyen/Service/Management/TerminalSettingsStoreLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalSettingsStoreLevelService.cs rename to Adyen/Service/Management/TerminalSettingsStoreLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalSettingsTerminalLevelService.cs b/Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalSettingsTerminalLevelService.cs rename to Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalsTerminalLevelService.cs b/Adyen/Service/Management/TerminalsTerminalLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalsTerminalLevelService.cs rename to Adyen/Service/Management/TerminalsTerminalLevelService.cs diff --git a/Adyen/src/Service/Management/UsersCompanyLevelService.cs b/Adyen/Service/Management/UsersCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/UsersCompanyLevelService.cs rename to Adyen/Service/Management/UsersCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/UsersMerchantLevelService.cs b/Adyen/Service/Management/UsersMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/UsersMerchantLevelService.cs rename to Adyen/Service/Management/UsersMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/WebhooksCompanyLevelService.cs b/Adyen/Service/Management/WebhooksCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/WebhooksCompanyLevelService.cs rename to Adyen/Service/Management/WebhooksCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/WebhooksMerchantLevelService.cs b/Adyen/Service/Management/WebhooksMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/WebhooksMerchantLevelService.cs rename to Adyen/Service/Management/WebhooksMerchantLevelService.cs diff --git a/Adyen/src/Service/PaymentService.cs b/Adyen/Service/PaymentService.cs similarity index 100% rename from Adyen/src/Service/PaymentService.cs rename to Adyen/Service/PaymentService.cs diff --git a/Adyen/src/Service/PaymentsAppService.cs b/Adyen/Service/PaymentsAppService.cs similarity index 100% rename from Adyen/src/Service/PaymentsAppService.cs rename to Adyen/Service/PaymentsAppService.cs diff --git a/Adyen/src/Service/Payout/InitializationService.cs b/Adyen/Service/Payout/InitializationService.cs similarity index 100% rename from Adyen/src/Service/Payout/InitializationService.cs rename to Adyen/Service/Payout/InitializationService.cs diff --git a/Adyen/src/Service/Payout/InstantPayoutsService.cs b/Adyen/Service/Payout/InstantPayoutsService.cs similarity index 100% rename from Adyen/src/Service/Payout/InstantPayoutsService.cs rename to Adyen/Service/Payout/InstantPayoutsService.cs diff --git a/Adyen/src/Service/Payout/ReviewingService.cs b/Adyen/Service/Payout/ReviewingService.cs similarity index 100% rename from Adyen/src/Service/Payout/ReviewingService.cs rename to Adyen/Service/Payout/ReviewingService.cs diff --git a/Adyen/src/Service/PlatformsAccount/AccountHoldersService.cs b/Adyen/Service/PlatformsAccount/AccountHoldersService.cs similarity index 100% rename from Adyen/src/Service/PlatformsAccount/AccountHoldersService.cs rename to Adyen/Service/PlatformsAccount/AccountHoldersService.cs diff --git a/Adyen/src/Service/PlatformsAccount/AccountsService.cs b/Adyen/Service/PlatformsAccount/AccountsService.cs similarity index 100% rename from Adyen/src/Service/PlatformsAccount/AccountsService.cs rename to Adyen/Service/PlatformsAccount/AccountsService.cs diff --git a/Adyen/src/Service/PlatformsAccount/VerificationService.cs b/Adyen/Service/PlatformsAccount/VerificationService.cs similarity index 100% rename from Adyen/src/Service/PlatformsAccount/VerificationService.cs rename to Adyen/Service/PlatformsAccount/VerificationService.cs diff --git a/Adyen/src/Service/PlatformsFundService.cs b/Adyen/Service/PlatformsFundService.cs similarity index 100% rename from Adyen/src/Service/PlatformsFundService.cs rename to Adyen/Service/PlatformsFundService.cs diff --git a/Adyen/src/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs b/Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs similarity index 100% rename from Adyen/src/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs rename to Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs diff --git a/Adyen/src/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs b/Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs similarity index 100% rename from Adyen/src/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs rename to Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs diff --git a/Adyen/src/Service/PlatformsNotificationConfigurationService.cs b/Adyen/Service/PlatformsNotificationConfigurationService.cs similarity index 100% rename from Adyen/src/Service/PlatformsNotificationConfigurationService.cs rename to Adyen/Service/PlatformsNotificationConfigurationService.cs diff --git a/Adyen/src/Service/PosMobileService.cs b/Adyen/Service/PosMobileService.cs similarity index 100% rename from Adyen/src/Service/PosMobileService.cs rename to Adyen/Service/PosMobileService.cs diff --git a/Adyen/src/Service/PosTerminalManagementService.cs b/Adyen/Service/PosTerminalManagementService.cs similarity index 100% rename from Adyen/src/Service/PosTerminalManagementService.cs rename to Adyen/Service/PosTerminalManagementService.cs diff --git a/Adyen/src/Service/RecurringService.cs b/Adyen/Service/RecurringService.cs similarity index 100% rename from Adyen/src/Service/RecurringService.cs rename to Adyen/Service/RecurringService.cs diff --git a/Adyen/src/Service/Resource/Terminal/TerminalApi.cs b/Adyen/Service/Resource/Terminal/TerminalApi.cs similarity index 100% rename from Adyen/src/Service/Resource/Terminal/TerminalApi.cs rename to Adyen/Service/Resource/Terminal/TerminalApi.cs diff --git a/Adyen/src/Service/Resource/Terminal/TerminalApiAsyncClient.cs b/Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs similarity index 100% rename from Adyen/src/Service/Resource/Terminal/TerminalApiAsyncClient.cs rename to Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs diff --git a/Adyen/src/Service/Resource/Terminal/TerminalApiLocal.cs b/Adyen/Service/Resource/Terminal/TerminalApiLocal.cs similarity index 100% rename from Adyen/src/Service/Resource/Terminal/TerminalApiLocal.cs rename to Adyen/Service/Resource/Terminal/TerminalApiLocal.cs diff --git a/Adyen/src/Service/Resource/Terminal/TerminalApiLocalClient.cs b/Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs similarity index 100% rename from Adyen/src/Service/Resource/Terminal/TerminalApiLocalClient.cs rename to Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs diff --git a/Adyen/src/Service/Resource/Terminal/TerminalApiSyncClient.cs b/Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs similarity index 100% rename from Adyen/src/Service/Resource/Terminal/TerminalApiSyncClient.cs rename to Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs diff --git a/Adyen/src/Service/ServiceResource.cs b/Adyen/Service/ServiceResource.cs similarity index 100% rename from Adyen/src/Service/ServiceResource.cs rename to Adyen/Service/ServiceResource.cs diff --git a/Adyen/src/Service/StoredValueService.cs b/Adyen/Service/StoredValueService.cs similarity index 100% rename from Adyen/src/Service/StoredValueService.cs rename to Adyen/Service/StoredValueService.cs diff --git a/Adyen/src/Service/TerminalApiAsyncService.cs b/Adyen/Service/TerminalApiAsyncService.cs similarity index 100% rename from Adyen/src/Service/TerminalApiAsyncService.cs rename to Adyen/Service/TerminalApiAsyncService.cs diff --git a/Adyen/src/Service/TerminalApiLocalService.cs b/Adyen/Service/TerminalApiLocalService.cs similarity index 100% rename from Adyen/src/Service/TerminalApiLocalService.cs rename to Adyen/Service/TerminalApiLocalService.cs diff --git a/Adyen/src/Service/TerminalApiSyncService.cs b/Adyen/Service/TerminalApiSyncService.cs similarity index 100% rename from Adyen/src/Service/TerminalApiSyncService.cs rename to Adyen/Service/TerminalApiSyncService.cs diff --git a/Adyen/src/Service/TerminalCloudApi.cs b/Adyen/Service/TerminalCloudApi.cs similarity index 100% rename from Adyen/src/Service/TerminalCloudApi.cs rename to Adyen/Service/TerminalCloudApi.cs diff --git a/Adyen/src/Service/TerminalLocalApi.cs b/Adyen/Service/TerminalLocalApi.cs similarity index 100% rename from Adyen/src/Service/TerminalLocalApi.cs rename to Adyen/Service/TerminalLocalApi.cs diff --git a/Adyen/src/Service/TerminalLocalApiUnencrypted.cs b/Adyen/Service/TerminalLocalApiUnencrypted.cs similarity index 100% rename from Adyen/src/Service/TerminalLocalApiUnencrypted.cs rename to Adyen/Service/TerminalLocalApiUnencrypted.cs diff --git a/Adyen/src/Service/Transfers/CapitalService.cs b/Adyen/Service/Transfers/CapitalService.cs similarity index 100% rename from Adyen/src/Service/Transfers/CapitalService.cs rename to Adyen/Service/Transfers/CapitalService.cs diff --git a/Adyen/src/Service/Transfers/TransactionsService.cs b/Adyen/Service/Transfers/TransactionsService.cs similarity index 100% rename from Adyen/src/Service/Transfers/TransactionsService.cs rename to Adyen/Service/Transfers/TransactionsService.cs diff --git a/Adyen/src/Service/Transfers/TransfersService.cs b/Adyen/Service/Transfers/TransfersService.cs similarity index 100% rename from Adyen/src/Service/Transfers/TransfersService.cs rename to Adyen/Service/Transfers/TransfersService.cs diff --git a/Adyen/src/Util/ByteArrayConverter.cs b/Adyen/Util/ByteArrayConverter.cs similarity index 100% rename from Adyen/src/Util/ByteArrayConverter.cs rename to Adyen/Util/ByteArrayConverter.cs diff --git a/Adyen/src/Util/HMACValidator.cs b/Adyen/Util/HMACValidator.cs similarity index 100% rename from Adyen/src/Util/HMACValidator.cs rename to Adyen/Util/HMACValidator.cs diff --git a/Adyen/src/Util/JsonOperation.cs b/Adyen/Util/JsonOperation.cs similarity index 100% rename from Adyen/src/Util/JsonOperation.cs rename to Adyen/Util/JsonOperation.cs diff --git a/Adyen/src/Util/TerminalApi/AdditionalResponse.cs b/Adyen/Util/TerminalApi/AdditionalResponse.cs similarity index 100% rename from Adyen/src/Util/TerminalApi/AdditionalResponse.cs rename to Adyen/Util/TerminalApi/AdditionalResponse.cs diff --git a/Adyen/src/Util/TerminalApi/CardAcquisitionUtil.cs b/Adyen/Util/TerminalApi/CardAcquisitionUtil.cs similarity index 100% rename from Adyen/src/Util/TerminalApi/CardAcquisitionUtil.cs rename to Adyen/Util/TerminalApi/CardAcquisitionUtil.cs diff --git a/Adyen/src/Util/Util.cs b/Adyen/Util/Util.cs similarity index 100% rename from Adyen/src/Util/Util.cs rename to Adyen/Util/Util.cs diff --git a/Adyen/src/Webhooks/BalancePlatformWebhookHandler.cs b/Adyen/Webhooks/BalancePlatformWebhookHandler.cs similarity index 100% rename from Adyen/src/Webhooks/BalancePlatformWebhookHandler.cs rename to Adyen/Webhooks/BalancePlatformWebhookHandler.cs diff --git a/Adyen/src/Webhooks/ClassicPlatformWebhookHandler.cs b/Adyen/Webhooks/ClassicPlatformWebhookHandler.cs similarity index 100% rename from Adyen/src/Webhooks/ClassicPlatformWebhookHandler.cs rename to Adyen/Webhooks/ClassicPlatformWebhookHandler.cs diff --git a/Adyen/src/Webhooks/ManagementWebhookHandler.cs b/Adyen/Webhooks/ManagementWebhookHandler.cs similarity index 100% rename from Adyen/src/Webhooks/ManagementWebhookHandler.cs rename to Adyen/Webhooks/ManagementWebhookHandler.cs diff --git a/Adyen/src/Webhooks/WebhookHandler.cs b/Adyen/Webhooks/WebhookHandler.cs similarity index 100% rename from Adyen/src/Webhooks/WebhookHandler.cs rename to Adyen/Webhooks/WebhookHandler.cs From c6274567613752a1b1f6f6de865e3448593a2e62 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 13 Oct 2025 22:01:16 +0200 Subject: [PATCH 034/126] Rename localVars --- Adyen/Core/Auth/ApiKeyToken.cs | 2 +- ...terOperationDefaultImplementation.mustache | 2 +- .../generichost/ApiKeyToken.mustache | 4 +- .../generichost/ClientUtils.mustache | 4 +- .../generichost/JsonConverter.mustache | 8 +- .../OnErrorDefaultImplementation.mustache | 4 +- .../csharp/libraries/generichost/api.mustache | 216 +++++++++--------- 7 files changed, 120 insertions(+), 120 deletions(-) diff --git a/Adyen/Core/Auth/ApiKeyToken.cs b/Adyen/Core/Auth/ApiKeyToken.cs index ddcc80dcb..3d1557d8d 100644 --- a/Adyen/Core/Auth/ApiKeyToken.cs +++ b/Adyen/Core/Auth/ApiKeyToken.cs @@ -22,7 +22,7 @@ public class ApiKeyToken : TokenBase /// /// /// - public ApiKeyToken(string value, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + public ApiKeyToken(string value, string prefix = "", TimeSpan? timeout = null) : base(timeout) { _apiKeyValue = $"{prefix}{value}"; } diff --git a/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache b/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache index 71f4e9380..b6d7d48fa 100644 --- a/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache +++ b/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache @@ -1,2 +1,2 @@ if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponse.DownloadedAt - apiResponse.RequestedAt).TotalSeconds, apiResponse.StatusCode, apiResponse.Path); diff --git a/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache b/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache index d3f1f5214..4c5486c78 100644 --- a/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache @@ -27,10 +27,10 @@ namespace {{packageName}}.{{clientPackage}} /// /// /// - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "", TimeSpan? timeout = null) : base(timeout) { Header = header; - _raw = $"{ prefix }{ value }"; + _raw = $"{prefix}{value}"; } /// diff --git a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache index 8c0923d75..0bfe317ab 100644 --- a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache +++ b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache @@ -320,10 +320,10 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - string{{nrt?}} localVarJsonPropertyName = utf8JsonReader.GetString(); + string{{nrt?}} jsonPropertyName = utf8JsonReader.GetString(); utf8JsonReader.Read(); - if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + if (jsonPropertyName != null && jsonPropertyName.Equals(discriminator)) return utf8JsonReader.GetString(); } } diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index d1fb749f7..2a69a86a1 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -78,9 +78,9 @@ if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) { - string{{nrt?}} localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + string{{nrt?}} jsonPropertyName = utf8JsonReaderDiscriminator.GetString(); utf8JsonReaderDiscriminator.Read(); - if (localVarJsonPropertyName{{nrt?}}.Equals("{{propertyBaseName}}"){{#nrt}} ?? false{{/nrt}}) + if (jsonPropertyName{{nrt?}}.Equals("{{propertyBaseName}}"){{#nrt}} ?? false{{/nrt}}) { string{{nrt?}} discriminator = utf8JsonReaderDiscriminator.GetString(); {{#mappedModels}} @@ -168,10 +168,10 @@ if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) { - string{{nrt?}} localVarJsonPropertyName = utf8JsonReader.GetString(); + string{{nrt?}} jsonPropertyName = utf8JsonReader.GetString(); utf8JsonReader.Read(); - switch (localVarJsonPropertyName) + switch (jsonPropertyName) { {{#allVars}} case "{{baseName}}": diff --git a/templates-v7/csharp/libraries/generichost/OnErrorDefaultImplementation.mustache b/templates-v7/csharp/libraries/generichost/OnErrorDefaultImplementation.mustache index a1a9fa976..7af8e0760 100644 --- a/templates-v7/csharp/libraries/generichost/OnErrorDefaultImplementation.mustache +++ b/templates-v7/csharp/libraries/generichost/OnErrorDefaultImplementation.mustache @@ -1,2 +1,2 @@ - if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); \ No newline at end of file + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 454ae4a7a..7db85aff7 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -259,14 +259,14 @@ namespace {{packageName}}.{{apiPackage}} /// /// Processes the server response /// - /// + /// {{#allParams}} /// {{/allParams}} - private void After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + private void After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponse {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) { bool suppressDefaultLog = false; - After{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + After{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog apiResponse {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); {{>AfterOperationDefaultImplementation}} } @@ -274,25 +274,25 @@ namespace {{packageName}}.{{apiPackage}} /// Processes the server response /// /// - /// + /// {{#allParams}} /// {{/allParams}} - partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponse {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); /// /// Logs exceptions that occur while retrieving the server response /// - /// - /// - /// + /// + /// + /// {{#allParams}} /// {{/allParams}} - private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exception string pathFormat string path {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) { - bool suppressDefaultLogLocalVar = false; - OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLogLocalVar exceptionLocalVar pathFormatLocalVar pathLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + bool suppressDefaultLog = false; + OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog exception pathFormat path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); {{>OnErrorDefaultImplementation}} } @@ -300,14 +300,14 @@ namespace {{packageName}}.{{apiPackage}} /// /// A partial method that gives developers a way to provide customized exception handling /// - /// - /// - /// - /// + /// + /// + /// + /// {{#allParams}} /// {{/allParams}} - partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLogLocalVar Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog Exception exception string pathFormat string path {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); /// /// {{summary}} {{notes}} @@ -321,7 +321,7 @@ namespace {{packageName}}.{{apiPackage}} public async Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}) { {{#lambda.trimLineBreaks}} - UriBuilder uriBuilderLocalVar = new UriBuilder(); + UriBuilder uriBuilder = new UriBuilder(); try { @@ -335,32 +335,32 @@ namespace {{packageName}}.{{apiPackage}} {{/-first}} {{/allParams}} - using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessage = new HttpRequestMessage()) { {{^servers}} - uriBuilderLocalVar.Host = HttpClient.BaseAddress{{nrt!}}.Host; - uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; - uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = HttpClient.BaseAddress.AbsolutePath == "/" + uriBuilder.Host = HttpClient.BaseAddress{{nrt!}}.Host; + uriBuilder.Port = HttpClient.BaseAddress.Port; + uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilder.Path = HttpClient.BaseAddress.AbsolutePath == "/" ? "{{{path}}}" : string.Concat(HttpClient.BaseAddress.AbsolutePath, "{{{path}}}"); {{/servers}} {{#servers}} {{#-first}} - Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("{{url}}"); - uriBuilderLocalVar.Host = urlLocalVar.Authority; - uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; - uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; + Uri url = httpRequestMessage.RequestUri = new Uri("{{url}}"); + uriBuilder.Host = url.Authority; + uriBuilder.Scheme = url.Scheme; + uriBuilder.Path = url.AbsolutePath; {{/-first}} {{/servers}} {{#constantParams}} {{#isPathParam}} // Set client side default value of Path Param "{{baseName}}". - uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString(ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}}))); // Constant path parameter + uriBuilder.Path = uriBuilder.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString(ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}}))); // Constant path parameter {{/isPathParam}} {{/constantParams}} {{#pathParams}} - uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString({{paramName}}.ToString())); + uriBuilder.Path = uriBuilder.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString({{paramName}}.ToString())); {{#-last}} {{/-last}} @@ -368,7 +368,7 @@ namespace {{packageName}}.{{apiPackage}} {{#queryParams}} {{#-first}} - System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); {{/-first}} {{/queryParams}} {{^queryParams}} @@ -376,7 +376,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isApiKey}} {{#isKeyInQuery}} - System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); {{/isKeyInQuery}} {{/isApiKey}} {{/authMethods}} @@ -386,138 +386,138 @@ namespace {{packageName}}.{{apiPackage}} {{#-first}} {{/-first}} - parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{paramName}}); + parseQueryString["{{baseName}}"] = ClientUtils.ParameterToString({{paramName}}); {{/required}} {{/queryParams}} {{#constantParams}} {{#isQueryParam}} // Set client side default value of Query Param "{{baseName}}". - parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}}); // Constant query parameter + parseQueryString["{{baseName}}"] = ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}}); // Constant query parameter {{/isQueryParam}} {{/constantParams}} {{#queryParams}} {{^required}} if ({{paramName}}.IsSet) - parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{paramName}}.Value); + parseQueryString["{{baseName}}"] = ClientUtils.ParameterToString({{paramName}}.Value); {{/required}} {{#-last}} - uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + uriBuilder.Query = parseQueryString.ToString(); {{/-last}} {{/queryParams}} {{#constantParams}} {{#isHeaderParam}} // Set client side default value of Header Param "{{baseName}}". - httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + httpRequestMessage.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter {{/isHeaderParam}} {{/constantParams}} {{#headerParams}} {{#required}} - httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}})); + httpRequestMessage.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}})); {{/required}} {{^required}} if ({{paramName}}.IsSet) - httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value)); + httpRequestMessage.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value)); {{/required}} {{/headerParams}} {{#formParams}} {{#-first}} - MultipartContent multipartContentLocalVar = new MultipartContent(); + MultipartContent multipartContent = new MultipartContent(); - httpRequestMessageLocalVar.Content = multipartContentLocalVar; + httpRequestMessage.Content = multipartContent; - List> formParameterLocalVars = new List>(); + List> formParameters = new List>(); - multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars));{{/-first}}{{^isFile}}{{#required}} + multipartContent.Add(new FormUrlEncodedContent(formParameters));{{/-first}}{{^isFile}}{{#required}} - formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}))); + formParameters.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}))); {{/required}} {{^required}} if ({{paramName}}.IsSet) - formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value))); + formParameters.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value))); {{/required}} {{/isFile}} {{#isFile}} {{#required}} - multipartContentLocalVar.Add(new StreamContent({{paramName}})); + multipartContent.Add(new StreamContent({{paramName}})); {{/required}} {{^required}} if ({{paramName}}.IsSet) - multipartContentLocalVar.Add(new StreamContent({{paramName}}.Value)); + multipartContent.Add(new StreamContent({{paramName}}.Value)); {{/required}} {{/isFile}} {{/formParams}} {{#bodyParam}} {{#required}} - httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); + httpRequestMessage.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream + ? httpRequestMessage.Content = new StreamContent(stream) + : httpRequestMessage.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); {{/required}} {{^required}} if ({{paramName}}.IsSet) - httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); + httpRequestMessage.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream + ? httpRequestMessage.Content = new StreamContent(stream) + : httpRequestMessage.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); {{/required}} {{/bodyParam}} {{#authMethods}} {{#-first}} - List tokenBaseLocalVars = new List(); + List tokenBases = new List(); {{/-first}} {{#isApiKey}} {{^isKeyInCookie}} - ApiKeyToken apiKeyTokenLocalVar{{-index}} = (ApiKeyToken) await ApiKeyProvider.GetAsync("{{keyParamName}}", cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(apiKeyTokenLocalVar{{-index}}); + ApiKeyToken apiKeyToken{{-index}} = (ApiKeyToken) await ApiKeyProvider.GetAsync("{{keyParamName}}", cancellationToken).ConfigureAwait(false); + tokenBases.Add(apiKeyToken{{-index}}); {{#isKeyInHeader}} - apiKeyTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar); + apiKeyToken{{-index}}.UseInHeader(httpRequestMessage); {{/isKeyInHeader}} {{/isKeyInCookie}} {{#isKeyInQuery}} - apiKeyTokenLocalVar{{-index}}.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar); + apiKeyToken{{-index}}.UseInQuery(httpRequestMessage, uriBuilder, parseQueryString); - uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + uriBuilder.Query = parseQueryString.ToString(); {{/isKeyInQuery}} {{/isApiKey}} {{/authMethods}} - httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessage.RequestUri = uriBuilder.Uri; {{#authMethods}} {{#isBasicBearer}} - BearerToken bearerTokenLocalVar{{-index}} = (BearerToken) await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + BearerToken bearerToken{{-index}} = (BearerToken) await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(bearerTokenLocalVar{{-index}}); + tokenBases.Add(bearerToken{{-index}}); - bearerTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + bearerToken{{-index}}.UseInHeader(httpRequestMessage, "{{keyParamName}}"); {{/isBasicBearer}} {{#isOAuth}} - OAuthToken oauthTokenLocalVar{{-index}} = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + OAuthToken oauthToken{{-index}} = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(oauthTokenLocalVar{{-index}}); + tokenBases.Add(oauthToken{{-index}}); - oauthTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + oauthToken{{-index}}.UseInHeader(httpRequestMessage, "{{keyParamName}}"); {{/isOAuth}} {{#isHttpSignature}} - HttpSignatureToken httpSignatureTokenLocalVar{{-index}} = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureToken{{-index}} = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - tokenBaseLocalVars.Add(httpSignatureTokenLocalVar{{-index}}); + tokenBases.Add(httpSignatureToken{{-index}}); - if (httpRequestMessageLocalVar.Content != null) { - string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); + if (httpRequestMessage.Content != null) { + string requestBody = await httpRequestMessage.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); - httpSignatureTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + httpSignatureToken{{-index}}.UseInHeader(httpRequestMessage, requestBody, cancellationToken); } {{/isHttpSignature}} {{/authMethods}} @@ -534,10 +534,10 @@ namespace {{packageName}}.{{apiPackage}} {{#consumes}} {{#-first}} - string{{nrt?}} contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + string{{nrt?}} contentType = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) - httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + if (contentType != null && httpRequestMessage.Content != null) + httpRequestMessage.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); {{/-first}} {{/consumes}} @@ -545,7 +545,7 @@ namespace {{packageName}}.{{apiPackage}} {{#-first}} {{=<% %>=}} - string[] acceptLocalVars = new string[] {<%/-first%> + string[] accepts = new string[] {<%/-first%> <%={{ }}=%> "{{{mediaType}}}"{{^-last}},{{/-last}}{{#-last}} }; @@ -554,28 +554,28 @@ namespace {{packageName}}.{{apiPackage}} {{#produces}} {{#-first}} - string{{nrt?}} acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + string{{nrt?}} accept = ClientUtils.SelectHeaderAccept(accepts); - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + if (accept != null) + httpRequestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); {{/-first}} {{/produces}} {{#net60OrLater}} - httpRequestMessageLocalVar.Method = HttpMethod.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}; + httpRequestMessage.Method = HttpMethod.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}; {{/net60OrLater}} {{^net60OrLater}} - httpRequestMessageLocalVar.Method = new HttpMethod("{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}"); + httpRequestMessage.Method = new HttpMethod("{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}"); {{/net60OrLater}} - DateTime requestedAtLocalVar = DateTime.UtcNow; + DateTime requestedAt = DateTime.UtcNow; - using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessage = await HttpClient.SendAsync(httpRequestMessage, cancellationToken).ConfigureAwait(false)) { - ILogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse> apiResponseLoggerLocalVar = LoggerFactory.CreateLogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse>(); - {{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse apiResponseLocalVar; + ILogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse> apiResponseLogger = LoggerFactory.CreateLogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse>(); + {{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse apiResponse; - switch ((int)httpResponseMessageLocalVar.StatusCode) { + switch ((int)httpResponseMessage.StatusCode) { {{#responses}} {{#isBinary}} case ({{code}}): @@ -585,9 +585,9 @@ namespace {{packageName}}.{{apiPackage}} {{#isBinary}} {{#-first}} { - byte[] responseBytesArrayLocalVar = await httpResponseMessageLocalVar.Content.ReadAsByteArrayAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); - System.IO.Stream responseContentStreamLocalVar = new System.IO.MemoryStream(responseBytesArrayLocalVar); - apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentStreamLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions); + byte[] responseBytesArray = await httpResponseMessage.Content.ReadAsByteArrayAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); + System.IO.Stream responseContentStream = new System.IO.MemoryStream(responseBytesArray); + apiResponse = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLogger, httpRequestMessage, httpResponseMessage, responseContentStream, "{{{path}}}", requestedAt, _jsonSerializerOptions); break; } @@ -595,51 +595,51 @@ namespace {{packageName}}.{{apiPackage}} {{/isBinary}} {{/responses}} default: { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); - apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions); + string responseContent = await httpResponseMessage.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); + apiResponse = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLogger, httpRequestMessage, httpResponseMessage, responseContent, "{{{path}}}", requestedAt, _jsonSerializerOptions); break; } } - After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponse {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); - Events.ExecuteOn{{operationId}}(apiResponseLocalVar); + Events.ExecuteOn{{operationId}}(apiResponse); {{#authMethods}} {{#-first}} - if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) - tokenBaseLocalVar.BeginRateLimit(); + if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBase in tokenBases) + tokenBase.BeginRateLimit(); {{/-first}} {{/authMethods}} {{#net80OrLater}} {{#responses}} {{#vendorExtensions.x-set-cookie}} - if (httpResponseMessageLocalVar.StatusCode == (HttpStatusCode) {{code}} && httpResponseMessageLocalVar.Headers.TryGetValues("Set-Cookie", out var cookieHeadersLocalVar)) + if (httpResponseMessage.StatusCode == (HttpStatusCode) {{code}} && httpResponseMessage.Headers.TryGetValues("Set-Cookie", out var cookieHeaders)) { - foreach(string cookieHeader in cookieHeadersLocalVar) + foreach(string cookieHeader in cookieHeaders) { - IList setCookieHeaderValuesLocalVar = Microsoft.Net.Http.Headers.SetCookieHeaderValue.ParseList(cookieHeadersLocalVar.ToArray()); + IList setCookieHeaderValues = Microsoft.Net.Http.Headers.SetCookieHeaderValue.ParseList(cookieHeaders.ToArray()); - foreach(Microsoft.Net.Http.Headers.SetCookieHeaderValue setCookieHeaderValueLocalVar in setCookieHeaderValuesLocalVar) + foreach(Microsoft.Net.Http.Headers.SetCookieHeaderValue setCookieHeaderValue in setCookieHeaderValues) { - Cookie cookieLocalVar = new Cookie(setCookieHeaderValueLocalVar.Name.ToString(), setCookieHeaderValueLocalVar.Value.ToString()) + Cookie cookie = new Cookie(setCookieHeaderValue.Name.ToString(), setCookieHeaderValue.Value.ToString()) { - HttpOnly = setCookieHeaderValueLocalVar.HttpOnly + HttpOnly = setCookieHeaderValue.HttpOnly }; - if (setCookieHeaderValueLocalVar.Expires.HasValue) - cookieLocalVar.Expires = setCookieHeaderValueLocalVar.Expires.Value.UtcDateTime; + if (setCookieHeaderValue.Expires.HasValue) + cookie.Expires = setCookieHeaderValue.Expires.Value.UtcDateTime; - if (setCookieHeaderValueLocalVar.Path.HasValue) - cookieLocalVar.Path = setCookieHeaderValueLocalVar.Path.Value; + if (setCookieHeaderValue.Path.HasValue) + cookie.Path = setCookieHeaderValue.Path.Value; - if (setCookieHeaderValueLocalVar.Domain.HasValue) - cookieLocalVar.Domain = setCookieHeaderValueLocalVar.Domain.Value; + if (setCookieHeaderValue.Domain.HasValue) + cookie.Domain = setCookieHeaderValue.Domain.Value; - CookieContainer.Value.Add(new Uri($"{uriBuilderLocalVar.Scheme}://{uriBuilderLocalVar.Host}"), cookieLocalVar); + CookieContainer.Value.Add(new Uri($"{uriBuilder.Scheme}://{uriBuilder.Host}"), cookie); } } } @@ -647,13 +647,13 @@ namespace {{packageName}}.{{apiPackage}} {{/vendorExtensions.x-set-cookie}} {{/responses}} {{/net80OrLater}} - return apiResponseLocalVar; + return apiResponse; } } } catch(Exception e) { - OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}e "{{{path}}}" uriBuilderLocalVar.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}e "{{{path}}}" uriBuilder.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); Events.ExecuteOnError{{operationId}}(e); throw; } From ebbc08ab4b94fa68ff08f317935f539d71a3d5b4 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 13 Oct 2025 22:06:42 +0200 Subject: [PATCH 035/126] Rename integration-test --- .../PaymentsServiceIntegrationTest.cs} | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) rename Adyen.IntegrationTest/{src/Checkout/CheckoutTest.cs => Checkout/PaymentsServiceIntegrationTest.cs} (97%) diff --git a/Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs similarity index 97% rename from Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs rename to Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index 536688b71..f03a509d0 100644 --- a/Adyen.IntegrationTest/src/Checkout/CheckoutTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -11,20 +11,18 @@ namespace Adyen.IntegrationTest.Checkout { [TestClass] - public class CheckoutTest + public class PaymentsServiceIntegrationTest { private readonly IPaymentsService _paymentsApiService; private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; - public CheckoutTest() + public PaymentsServiceIntegrationTest() { IHost host = Host.CreateDefaultBuilder() .ConfigureCheckout((context, services, config) => { var apiKey = new ApiKeyToken( - context.Configuration["ADYEN_API_KEY"], - "", - null + context.Configuration["ADYEN_API_KEY"] ); config.AddTokens(apiKey); }) From ca807eb252d236ac409d99779bf56959f9bf81ba Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 13 Oct 2025 22:43:16 +0200 Subject: [PATCH 036/126] Add newline on service-level --- templates-v7/csharp/libraries/generichost/api.mustache | 1 + 1 file changed, 1 insertion(+) diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 7db85aff7..a2bd2984f 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -67,6 +67,7 @@ namespace {{packageName}}.{{apiPackage}} [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/isDeprecated}} Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}); + {{/operation}} } {{#operation}} From 32ad1ed85280cecf98e433ca7b9d4aa71cc49437 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 13 Oct 2025 22:58:33 +0200 Subject: [PATCH 037/126] Add {{corePackageName}} in template to match folder structure --- templates-v7/csharp/libraries/generichost/ApiException.mustache | 2 +- templates-v7/csharp/libraries/generichost/ApiResponse.mustache | 2 +- .../csharp/libraries/generichost/ApiResponseEventArgs.mustache | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates-v7/csharp/libraries/generichost/ApiException.mustache b/templates-v7/csharp/libraries/generichost/ApiException.mustache index ffc90cf11..df9992b69 100644 --- a/templates-v7/csharp/libraries/generichost/ApiException.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiException.mustache @@ -7,7 +7,7 @@ {{/nrt}} using System; -namespace {{packageName}}.{{clientPackage}} +namespace {{packageName}}.{{corePackageName}}.{{clientPackage}} { /// /// API Exception diff --git a/templates-v7/csharp/libraries/generichost/ApiResponse.mustache b/templates-v7/csharp/libraries/generichost/ApiResponse.mustache index 3ac107fa7..0b0b074d2 100644 --- a/templates-v7/csharp/libraries/generichost/ApiResponse.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiResponse.mustache @@ -11,7 +11,7 @@ using System.Diagnostics.CodeAnalysis; {{/netStandard}} using System.Net; -namespace {{packageName}}.{{clientPackage}} +namespace {{packageName}}.{{corePackageName}}.{{clientPackage}} { /// /// Provides a non-generic contract for the ApiResponse wrapper. diff --git a/templates-v7/csharp/libraries/generichost/ApiResponseEventArgs.mustache b/templates-v7/csharp/libraries/generichost/ApiResponseEventArgs.mustache index aea35fae1..c7f5abf37 100644 --- a/templates-v7/csharp/libraries/generichost/ApiResponseEventArgs.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiResponseEventArgs.mustache @@ -1,6 +1,6 @@ using System; -namespace {{packageName}}.{{clientPackage}} +namespace {{packageName}}.{{corePackageName}}.{{clientPackage}} { /// /// Useful for tracking server health From c3293f51f26e409fb70461ee65ed1c6e7ace7fec Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 13 Oct 2025 22:59:06 +0200 Subject: [PATCH 038/126] Added utility function to support inQueryEmbedding for f.e. clientKeys --- Adyen/Core/Auth/ApiKeyToken.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Adyen/Core/Auth/ApiKeyToken.cs b/Adyen/Core/Auth/ApiKeyToken.cs index 3d1557d8d..5de989f7f 100644 --- a/Adyen/Core/Auth/ApiKeyToken.cs +++ b/Adyen/Core/Auth/ApiKeyToken.cs @@ -35,5 +35,16 @@ public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage reque { request.Headers.Add(Key, _apiKeyValue); } + + /// + /// Places the token in the query. + /// + /// + /// + /// + public virtual void UseInQuery(global::System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) + { + parseQueryString[Key] = Uri.EscapeDataString(_apiKeyValue); + } } } \ No newline at end of file From 954477a66e718a2fff68ab6a74755bb1a706407e Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 15 Oct 2025 16:13:11 +0200 Subject: [PATCH 039/126] Update mustache templates to support multifolder setups --- templates-v7/csharp/ClientUtils.mustache | 269 ------------------ .../generichost/ClientUtils.mustache | 9 +- .../generichost/HostConfiguration.mustache | 19 +- .../IServiceCollectionExtensions.mustache | 2 +- .../generichost/README.solution.mustache | 2 - .../webhooks/HostConfiguration.mustache | 0 6 files changed, 18 insertions(+), 283 deletions(-) delete mode 100644 templates-v7/csharp/ClientUtils.mustache delete mode 100644 templates-v7/csharp/libraries/generichost/README.solution.mustache create mode 100644 templates-v7/csharp/libraries/generichost/webhooks/HostConfiguration.mustache diff --git a/templates-v7/csharp/ClientUtils.mustache b/templates-v7/csharp/ClientUtils.mustache deleted file mode 100644 index f79c5f132..000000000 --- a/templates-v7/csharp/ClientUtils.mustache +++ /dev/null @@ -1,269 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -{{#useCompareNetObjects}} -using KellermanSoftware.CompareNetObjects; -{{/useCompareNetObjects}} - -namespace {{packageName}}.{{apiName}}.{{clientPackage}} -{ - /// - /// Utility functions providing some benefit to API client consumers. - /// - public static class ClientUtils - { - {{#useCompareNetObjects}} - /// - /// An instance of CompareLogic. - /// - public static CompareLogic compareLogic; - - /// - /// Static constructor to initialise compareLogic. - /// - static ClientUtils() - { - {{#equatable}} - ComparisonConfig comparisonConfig = new{{^net70OrLater}} ComparisonConfig{{/net70OrLater}}(); - comparisonConfig.UseHashCodeIdentifier = true; - {{/equatable}} - compareLogic = new{{^net70OrLater}} CompareLogic{{/net70OrLater}}({{#equatable}}comparisonConfig{{/equatable}}); - } - - {{/useCompareNetObjects}} - /// - /// Sanitize filename by removing the path - /// - /// Filename - /// Filename - public static string SanitizeFilename(string filename) - { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); - return match.Success ? match.Groups[1].Value : filename; - } - - /// - /// Convert params to key/value pairs. - /// Use collectionFormat to properly format lists and collections. - /// - /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi - /// Key name. - /// Value object. - /// A multimap of keys with 1..n associated values. - public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) - { - var parameters = new Multimap(); - - if (value is ICollection collection && collectionFormat == "multi") - { - foreach (var item in collection) - { - parameters.Add(name, ParameterToString(item)); - } - } - else if (value is IDictionary dictionary) - { - if(collectionFormat == "deepObject") { - foreach (DictionaryEntry entry in dictionary) - { - parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); - } - } - else { - foreach (DictionaryEntry entry in dictionary) - { - parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); - } - } - } - else - { - parameters.Add(name, ParameterToString(value)); - } - - return parameters; - } - - /// - /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. - /// If parameter is a list, join the list with ",". - /// Otherwise just return the string. - /// - /// The parameter (header, path, query, form). - /// An optional configuration instance, providing formatting options used in processing. - /// Formatted string. - public static string ParameterToString(object obj, IReadableConfiguration configuration = null) - { - if (obj is DateTime dateTime) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15T13:45:30.0000000 - return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); - if (obj is DateTimeOffset dateTimeOffset) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15T13:45:30.0000000 - return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); -{{#net60OrLater}} - if (obj is DateOnly dateOnly) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15 - return dateOnly.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); -{{/net60OrLater}} - if (obj is bool boolean) - return boolean ? "true" : "false"; - if (obj is ICollection collection) { - List entries = new List(); - foreach (var entry in collection) - entries.Add(ParameterToString(entry, configuration)); - return string.Join(",", entries); - } - if (obj is Enum && HasEnumMemberAttrValue(obj)) - return GetEnumMemberAttrValue(obj); - - return Convert.ToString(obj, CultureInfo.InvariantCulture); - } - - /// - /// Serializes the given object when not null. Otherwise return null. - /// - /// The object to serialize. - /// Serialized string. - public static string Serialize(object obj) - { - return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; - } - - /// - /// Encode string in base64 format. - /// - /// string to be encoded. - /// Encoded string. - public static string Base64Encode(string text) - { - return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); - } - - /// - /// Convert stream to byte array - /// - /// Input stream to be converted - /// Byte array - public static byte[] ReadAsBytes(Stream inputStream) - { - using (var ms = new MemoryStream()) - { - inputStream.CopyTo(ms); - return ms.ToArray(); - } - } - - /// - /// Select the Content-Type header's value from the given content-type array: - /// if JSON type exists in the given array, use it; - /// otherwise use the first one defined in 'consumes' - /// - /// The Content-Type array to select from. - /// The Content-Type header to use. - public static string SelectHeaderContentType(string[] contentTypes) - { - if (contentTypes.Length == 0) - return null; - - foreach (var contentType in contentTypes) - { - if (IsJsonMime(contentType)) - return contentType; - } - - return contentTypes[0]; // use the first content type specified in 'consumes' - } - - /// - /// Select the Accept header's value from the given accepts array: - /// if JSON exists in the given array, use it; - /// otherwise use all of them (joining into a string) - /// - /// The accepts array to select from. - /// The Accept header to use. - public static string SelectHeaderAccept(string[] accepts) - { - if (accepts.Length == 0) - return null; - - if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) - return "application/json"; - - return string.Join(",", accepts); - } - - /// - /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. - /// - public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); - - /// - /// Check if the given MIME is a JSON MIME. - /// JSON MIME examples: - /// application/json - /// application/json; charset=UTF8 - /// APPLICATION/JSON - /// application/vnd.company+json - /// - /// MIME - /// Returns True if MIME type is json. - public static bool IsJsonMime(string mime) - { - if (string.IsNullOrWhiteSpace(mime)) return false; - - return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); - } - - /// - /// Is the Enum decorated with EnumMember Attribute - /// - /// - /// true if found - private static bool HasEnumMemberAttrValue(object enumVal) - { - if (enumVal == null) - throw new ArgumentNullException(nameof(enumVal)); - var enumType = enumVal.GetType(); - var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); - var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); - if (attr != null) return true; - return false; - } - - /// - /// Get the EnumMember value - /// - /// - /// EnumMember value as string otherwise null - private static string GetEnumMemberAttrValue(object enumVal) - { - if (enumVal == null) - throw new ArgumentNullException(nameof(enumVal)); - var enumType = enumVal.GetType(); - var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); - var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); - if (attr != null) - { - return attr.Value; - } - return null; - } - } -} diff --git a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache index 0bfe317ab..69382b7cf 100644 --- a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache +++ b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache @@ -17,6 +17,7 @@ using KellermanSoftware.CompareNetObjects;{{/useCompareNetObjects}} using {{packageName}}.{{modelPackage}}; {{/-first}} {{/models}} +using Models = {{packageName}}.{{modelPackage}}; using System.Runtime.CompilerServices; namespace {{packageName}}.{{apiName}}.{{clientPackage}} @@ -131,7 +132,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} {{#models}} {{#model}} {{#isEnum}} - if (obj is {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}) + if (obj is Models.{{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}) {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} return {{classname}}ValueConverter.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; {{/isEnum}} @@ -140,7 +141,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} {{#items.isEnum}} {{#items}} {{^complexType}} - if (obj is {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) + if (obj is Models.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; {{/complexType}} @@ -148,9 +149,9 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} {{/items.isEnum}} {{#isEnum}} {{^complexType}} - if (obj is {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) + if (obj is Models.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} - return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + return Models.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; {{/complexType}} {{/isEnum}} {{/vars}} diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 335308a2c..d841bf9b7 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -14,12 +14,12 @@ using {{packageName}}.{{apiPackage}}; {{#models}} {{#-first}} using {{packageName}}.{{modelPackage}}; +{{/-first}} +{{/models}} using {{packageName}}.{{corePackageName}}; using {{packageName}}.{{corePackageName}}.Auth; using {{packageName}}.{{corePackageName}}.Client; using {{packageName}}.{{corePackageName}}.Converters; -{{/-first}} -{{/models}} namespace {{packageName}}.{{apiName}}.{{clientPackage}} { @@ -40,12 +40,17 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration(IServiceCollection services) { _services = services; - _jsonOptions.Converters.Add(new JsonStringEnumConverter()); - _jsonOptions.Converters.Add(new DateTimeJsonConverter()); - _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(JsonStringEnumConverter)) != null) + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateTimeJsonConverter)) != null) + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateTimeNullableJsonConverter)) != null) + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); {{#supportsDateOnly}} - _jsonOptions.Converters.Add(new DateOnlyJsonConverter()); - _jsonOptions.Converters.Add(new DateOnlyNullableJsonConverter()); + if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateOnlyJsonConverter)) != null) + _jsonOptions.Converters.Add(new DateOnlyJsonConverter()); + if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateOnlyNullableJsonConverter)) != null) + _jsonOptions.Converters.Add(new DateOnlyNullableJsonConverter()); {{/supportsDateOnly}} {{#models}} {{#model}} diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index 705e499f0..f0dc8a606 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -9,7 +9,7 @@ using Microsoft.Extensions.DependencyInjection; using {{packageName}}.{{apiName}}.{{clientPackage}}; using {{packageName}}.{{corePackageName}}.Auth; -namespace {{packageName}}.{{apiName}} +namespace {{packageName}}.{{apiName}}.Extensions { /// /// Extension methods for ServiceCollection diff --git a/templates-v7/csharp/libraries/generichost/README.solution.mustache b/templates-v7/csharp/libraries/generichost/README.solution.mustache deleted file mode 100644 index cfe8a2c98..000000000 --- a/templates-v7/csharp/libraries/generichost/README.solution.mustache +++ /dev/null @@ -1,2 +0,0 @@ -# Created with Openapi Generator -See the project's [REAMDE](src/{{packageName}}/README.md) \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/webhooks/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/webhooks/HostConfiguration.mustache new file mode 100644 index 000000000..e69de29bb From 18bce429dcfdfb6f23a36ad98eb5314828c3e44c Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 15 Oct 2025 16:27:34 +0200 Subject: [PATCH 040/126] Update check on adding JsonConverters --- .../libraries/generichost/HostConfiguration.mustache | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index d841bf9b7..61ad073b0 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -40,16 +40,16 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration(IServiceCollection services) { _services = services; - if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(JsonStringEnumConverter)) != null) + if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(JsonStringEnumConverter)) == null) _jsonOptions.Converters.Add(new JsonStringEnumConverter()); - if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateTimeJsonConverter)) != null) + if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateTimeJsonConverter)) == null) _jsonOptions.Converters.Add(new DateTimeJsonConverter()); - if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateTimeNullableJsonConverter)) != null) + if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateTimeNullableJsonConverter)) == null) _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); {{#supportsDateOnly}} - if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateOnlyJsonConverter)) != null) + if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateOnlyJsonConverter)) == null) _jsonOptions.Converters.Add(new DateOnlyJsonConverter()); - if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateOnlyNullableJsonConverter)) != null) + if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateOnlyNullableJsonConverter)) == null) _jsonOptions.Converters.Add(new DateOnlyNullableJsonConverter()); {{/supportsDateOnly}} {{#models}} From eaf74641b7227ed20ff7fea3c438b652e987356a Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 15 Oct 2025 17:15:31 +0200 Subject: [PATCH 041/126] Add support for JsonSerializerOptionsProvider per service --- .../csharp/libraries/generichost/HostConfiguration.mustache | 1 + .../generichost/JsonSerializerOptionsProvider.mustache | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 61ad073b0..aaa645252 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -11,6 +11,7 @@ using System.Text.Json.Serialization; using System.Net.Http; using Microsoft.Extensions.DependencyInjection; using {{packageName}}.{{apiPackage}}; +using {{packageName}}.{{apiName}}.{{clientPackage}}; {{#models}} {{#-first}} using {{packageName}}.{{modelPackage}}; diff --git a/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache b/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache index 93f805403..b5c30c6fe 100644 --- a/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache @@ -6,7 +6,7 @@ {{/nrt}} using System.Text.Json; -namespace {{packageName}}.{{clientPackage}} +namespace {{packageName}}.{{apiName}}.{{clientPackage}} { /// /// Provides the JsonSerializerOptions From e1e1d08460418fd204da75dde284cd01639c23df Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:53:44 +0200 Subject: [PATCH 042/126] Use TryDeserializeResponse Add documentation Remname BaseAddress to BASE_URL --- templates-v7/csharp/ApiClient.v790.mustache | 838 ------------------ .../csharp/Configuration.v790.mustache | 737 --------------- templates-v7/csharp/api_doc.mustache | 164 ---- .../generichost/ApiResponse.mustache | 10 +- .../generichost/ClientUtils.mustache | 25 +- .../generichost/HostConfiguration.mustache | 2 +- .../generichost/JsonConverter.mustache | 1 - .../csharp/libraries/generichost/api.mustache | 2 +- .../libraries/generichost/api_doc.mustache | 60 ++ 9 files changed, 73 insertions(+), 1766 deletions(-) delete mode 100644 templates-v7/csharp/ApiClient.v790.mustache delete mode 100644 templates-v7/csharp/Configuration.v790.mustache delete mode 100644 templates-v7/csharp/api_doc.mustache create mode 100644 templates-v7/csharp/libraries/generichost/api_doc.mustache diff --git a/templates-v7/csharp/ApiClient.v790.mustache b/templates-v7/csharp/ApiClient.v790.mustache deleted file mode 100644 index 682b76251..000000000 --- a/templates-v7/csharp/ApiClient.v790.mustache +++ /dev/null @@ -1,838 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Text; -using System.Threading; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -{{^net60OrLater}} -using System.Web; -{{/net60OrLater}} -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using RestSharp; -using RestSharp.Serializers; -using RestSharpMethod = RestSharp.Method; -using FileIO = System.IO.File; -{{#supportsRetry}} -using Polly; -{{/supportsRetry}} -{{#hasOAuthMethods}} -using {{packageName}}.Client.Auth; -{{/hasOAuthMethods}} -using {{packageName}}.{{modelPackage}}; - -namespace {{packageName}}.Client -{ - /// - /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. - /// - internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer - { - private readonly IReadableConfiguration _configuration; - private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - public CustomJsonCodec(IReadableConfiguration configuration) - { - _configuration = configuration; - } - - public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) - { - _serializerSettings = serializerSettings; - _configuration = configuration; - } - - /// - /// Serialize the object into a JSON string. - /// - /// Object to be serialized. - /// A JSON string. - public string Serialize(object obj) - { - if (obj != null && obj is AbstractOpenAPISchema) - { - // the object to be serialized is an oneOf/anyOf schema - return ((AbstractOpenAPISchema)obj).ToJson(); - } - else - { - return JsonConvert.SerializeObject(obj, _serializerSettings); - } - } - - public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); - - public T Deserialize(RestResponse response) - { - var result = (T)Deserialize(response, typeof(T)); - return result; - } - - /// - /// Deserialize the JSON string into a proper object. - /// - /// The HTTP response. - /// Object type. - /// Object representation of the JSON string. - internal object Deserialize(RestResponse response, Type type) - { - if (type == typeof(byte[])) // return byte array - { - return response.RawBytes; - } - - // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) - if (type == typeof(Stream)) - { - var bytes = response.RawBytes; - if (response.Headers != null) - { - var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? global::System.IO.Path.GetTempPath() - : _configuration.TempFolderPath; - var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); - foreach (var header in response.Headers) - { - var match = regex.Match(header.ToString()); - if (match.Success) - { - string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - FileIO.WriteAllBytes(fileName, bytes); - return new FileStream(fileName, FileMode.Open); - } - } - } - var stream = new MemoryStream(bytes); - return stream; - } - - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object - { - return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); - } - - if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type - { - return Convert.ChangeType(response.Content, type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); - } - catch (Exception e) - { - throw new ApiException(500, e.Message); - } - } - - public ISerializer Serializer => this; - public IDeserializer Deserializer => this; - - public string[] AcceptedContentTypes => ContentType.JsonAccept; - - public SupportsContentType SupportsContentType => contentType => - contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || - contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - - public ContentType ContentType { get; set; } = ContentType.Json; - - public DataFormat DataFormat => DataFormat.Json; - } - {{! NOTE: Any changes related to RestSharp should be done in this class. All other client classes are for extensibility by consumers.}} - /// - /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), - /// encapsulating general REST accessor use cases. - /// - {{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} - { - private readonly string _baseUrl; - - /// - /// Specifies the settings on a object. - /// These settings can be adjusted to accommodate custom serialization rules. - /// - public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Allows for extending request processing for generated code. - /// - /// The RestSharp request object - partial void InterceptRequest(RestRequest request); - - /// - /// Allows for extending response processing for generated code. - /// - /// The RestSharp request object - /// The RestSharp response object - partial void InterceptResponse(RestRequest request, RestResponse response); - - /// - /// Initializes a new instance of the , defaulting to the global configurations' base url. - /// - public ApiClient() - { - _baseUrl = GlobalConfiguration.Instance.BasePath; - } - - /// - /// Initializes a new instance of the - /// - /// The target service's base path in URL format. - /// - public ApiClient(string basePath) - { - if (string.IsNullOrEmpty(basePath)) - throw new ArgumentException("basePath cannot be empty"); - - _baseUrl = basePath; - } - - /// - /// Constructs the RestSharp version of an http method - /// - /// Swagger Client Custom HttpMethod - /// RestSharp's HttpMethod instance. - /// - private RestSharpMethod Method(HttpMethod method) - { - RestSharpMethod other; - switch (method) - { - case HttpMethod.Get: - other = RestSharpMethod.Get; - break; - case HttpMethod.Post: - other = RestSharpMethod.Post; - break; - case HttpMethod.Put: - other = RestSharpMethod.Put; - break; - case HttpMethod.Delete: - other = RestSharpMethod.Delete; - break; - case HttpMethod.Head: - other = RestSharpMethod.Head; - break; - case HttpMethod.Options: - other = RestSharpMethod.Options; - break; - case HttpMethod.Patch: - other = RestSharpMethod.Patch; - break; - default: - throw new ArgumentOutOfRangeException("method", method, null); - } - - return other; - } - - /// - /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. - /// Here, it is simply mapped into the RestSharp request. - /// - /// The http verb. - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. - /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. - /// [private] A new RestRequest instance. - /// - private RestRequest NewRequest( - HttpMethod method, - string path, - RequestOptions options, - IReadableConfiguration configuration) - { - if (path == null) throw new ArgumentNullException("path"); - if (options == null) throw new ArgumentNullException("options"); - if (configuration == null) throw new ArgumentNullException("configuration"); - - RestRequest request = new RestRequest(path, Method(method)); - - if (options.PathParameters != null) - { - foreach (var pathParam in options.PathParameters) - { - request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); - } - } - - if (options.QueryParameters != null) - { - foreach (var queryParam in options.QueryParameters) - { - foreach (var value in queryParam.Value) - { - request.AddQueryParameter(queryParam.Key, value); - } - } - } - - if (configuration.DefaultHeaders != null) - { - foreach (var headerParam in configuration.DefaultHeaders) - { - request.AddHeader(headerParam.Key, headerParam.Value); - } - } - - if (options.HeaderParameters != null) - { - foreach (var headerParam in options.HeaderParameters) - { - foreach (var value in headerParam.Value) - { - request.AddHeader(headerParam.Key, value); - } - } - } - - if (options.FormParameters != null) - { - foreach (var formParam in options.FormParameters) - { - request.AddParameter(formParam.Key, formParam.Value); - } - } - - if (options.Data != null) - { - if (options.Data is Stream stream) - { - var contentType = "application/octet-stream"; - if (options.HeaderParameters != null) - { - var contentTypes = options.HeaderParameters["Content-Type"]; - contentType = contentTypes[0]; - } - - var bytes = ClientUtils.ReadAsBytes(stream); - request.AddParameter(contentType, bytes, ParameterType.RequestBody); - } - else - { - if (options.HeaderParameters != null) - { - var contentTypes = options.HeaderParameters["Content-Type"]; - if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) - { - request.RequestFormat = DataFormat.Json; - } - else - { - // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. - } - } - else - { - // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. - request.RequestFormat = DataFormat.Json; - } - - request.AddJsonBody(options.Data); - } - } - - if (options.FileParameters != null) - { - foreach (var fileParam in options.FileParameters) - { - foreach (var file in fileParam.Value) - { - var bytes = ClientUtils.ReadAsBytes(file); - var fileStream = file as FileStream; - if (fileStream != null) - request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); - else - request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); - } - } - } - - return request; - } - - /// - /// Transforms a RestResponse instance into a new ApiResponse instance. - /// At this point, we have a concrete http response from the service. - /// Here, it is simply mapped into the [public] ApiResponse object. - /// - /// The RestSharp response object - /// A new ApiResponse instance. - private ApiResponse ToApiResponse(RestResponse response) - { - T result = response.Data; - string rawContent = response.Content; - - var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) - { - ErrorText = response.ErrorMessage, - Cookies = new List() - }; - - if (response.Headers != null) - { - foreach (var responseHeader in response.Headers) - { - transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - if (response.ContentHeaders != null) - { - foreach (var responseHeader in response.ContentHeaders) - { - transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - if (response.Cookies != null) - { - foreach (var responseCookies in response.Cookies.Cast()) - { - transformed.Cookies.Add( - new Cookie( - responseCookies.Name, - responseCookies.Value, - responseCookies.Path, - responseCookies.Domain) - ); - } - } - - return transformed; - } - - /// - /// Executes the HTTP request for the current service. - /// Based on functions received it can be async or sync. - /// - /// Local function that executes http request and returns http response. - /// Local function to specify options for the service. - /// The RestSharp request object - /// The RestSharp options object - /// A per-request configuration object. - /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. - /// A new ApiResponse instance. - private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) - { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var clientOptions = new RestClientOptions(baseUrl) - { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback - }; - setOptions(clientOptions); - - {{#hasOAuthMethods}} - if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(configuration.OAuthClientId) && - !string.IsNullOrEmpty(configuration.OAuthClientSecret) && - configuration.OAuthFlow != null) - { - clientOptions.Authenticator = new OAuthAuthenticator( - configuration.OAuthTokenUrl, - configuration.OAuthClientId, - configuration.OAuthClientSecret, - configuration.OAuthScope, - configuration.OAuthFlow, - SerializerSettings, - configuration); - } - - {{/hasOAuthMethods}} - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) - { - InterceptRequest(request); - - RestResponse response = await getResponse(client); - - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - try - { - response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - catch (Exception ex) - { - throw ex.InnerException != null ? ex.InnerException : ex; - } - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } - else if (typeof(T).Name == "String") // for string response - { - response.Data = (T)(object)response.Content; - } - - InterceptResponse(request, response); - - var result = ToApiResponse(response); - if (response.ErrorMessage != null) - { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) - { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); - } - } - return result; - } - } - - private async Task> DeserializeRestResponseFromPolicyAsync(RestClient client, RestRequest request, PolicyResult policyResult, CancellationToken cancellationToken = default) - { - if (policyResult.Outcome == OutcomeType.Successful) - { - return await client.Deserialize(policyResult.Result, cancellationToken); - } - else - { - return new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - } - - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) - { - Action setOptions = (clientOptions) => - { - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - clientOptions.CookieContainer = cookies; - }; - - Func>> getResponse = (client) => - { - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - return DeserializeRestResponseFromPolicyAsync(client, request, policyResult); - } - else - { - return Task.FromResult(client.Execute(request)); - } - }; - - return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); - } - - {{#supportsAsync}} - private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default) - { - Action setOptions = (clientOptions) => - { - //no extra options - }; - - Func>> getResponse = async (client) => - { - {{#supportsRetry}} - if (RetryConfiguration.AsyncRetryPolicy != null) - { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken); - } - else - { - {{/supportsRetry}} - return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); - {{#supportsRetry}} - } - {{/supportsRetry}} - }; - - return ExecClientAsync(getResponse, setOptions, request, options, configuration); - } - - #region IAsynchronousClient - /// - /// Make a HTTP GET request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP POST request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP PUT request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP DELETE request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP HEAD request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP OPTION request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP PATCH request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); - } - #endregion IAsynchronousClient - {{/supportsAsync}} - - #region ISynchronousClient - /// - /// Make a HTTP GET request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config); - } - - /// - /// Make a HTTP POST request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config); - } - - /// - /// Make a HTTP PUT request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config); - } - - /// - /// Make a HTTP DELETE request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config); - } - - /// - /// Make a HTTP HEAD request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config); - } - - /// - /// Make a HTTP OPTION request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config); - } - - /// - /// Make a HTTP PATCH request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config); - } - #endregion ISynchronousClient - } -} diff --git a/templates-v7/csharp/Configuration.v790.mustache b/templates-v7/csharp/Configuration.v790.mustache deleted file mode 100644 index 2753aafb3..000000000 --- a/templates-v7/csharp/Configuration.v790.mustache +++ /dev/null @@ -1,737 +0,0 @@ -{{>partial_header}} - -using System; -{{^net35}} -using System.Collections.Concurrent; -{{/net35}} -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Net.Http; -using System.Net.Security; -{{#useRestSharp}} -{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; -{{/hasOAuthMethods}} -{{/useRestSharp}} - -namespace {{packageName}}.Client -{ - /// - /// Represents a set of configuration settings - /// - {{>visibility}} class Configuration : IReadableConfiguration - { - #region Constants - - /// - /// Version of the package. - /// - /// Version of the package. - public const string Version = "{{packageVersion}}"; - - /// - /// Identifier for ISO 8601 DateTime Format - /// - /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. - // ReSharper disable once InconsistentNaming - public const string ISO8601_DATETIME_FORMAT = "o"; - - #endregion Constants - - #region Static Members - - /// - /// Default creation of exceptions for a given method name and response object - /// - public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => - { - var status = (int)response.StatusCode; - if (status >= 400) - { - return new ApiException(status, - string.Format("Error calling {0}: {1}", methodName, response.RawContent), - response.RawContent, response.Headers); - } - {{^netStandard}} - if (status == 0) - { - return new ApiException(status, - string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); - } - {{/netStandard}} - return null; - }; - - #endregion Static Members - - #region Private Members - - /// - /// Defines the base path of the target API server. - /// Example: http://localhost:3000/v1/ - /// - private string _basePath; - - private bool _useDefaultCredentials = false; - - /// - /// Gets or sets the API key based on the authentication name. - /// This is the key and value comprising the "secret" for accessing an API. - /// - /// The API key. - private IDictionary _apiKey; - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// The prefix of the API key. - private IDictionary _apiKeyPrefix; - - private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; - private string _tempFolderPath = Path.GetTempPath(); - {{#servers.0}} - - /// - /// Gets or sets the servers defined in the OpenAPI spec. - /// - /// The servers - private IList> _servers; - {{/servers.0}} - - /// - /// Gets or sets the operation servers defined in the OpenAPI spec. - /// - /// The operation servers - private IReadOnlyDictionary>> _operationServers; - - {{#hasHttpSignatureMethods}} - - /// - /// HttpSigning configuration - /// - private HttpSigningConfiguration _HttpSigningConfiguration = null; - {{/hasHttpSignatureMethods}} - #endregion Private Members - - #region Constructors - - /// - /// Initializes a new instance of the class - /// - [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] - public Configuration() - { - Proxy = null; - UserAgent = WebUtility.UrlEncode("{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"); - BasePath = "{{{basePath}}}"; - DefaultHeaders = new {{^net35}}Concurrent{{/net35}}Dictionary(); - ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); - ApiKeyPrefix = new {{^net35}}Concurrent{{/net35}}Dictionary(); - {{#servers}} - {{#-first}} - Servers = new List>() - { - {{/-first}} - { - new Dictionary { - {"url", "{{{url}}}"}, - {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, - {{#variables}} - {{#-first}} - { - "variables", new Dictionary { - {{/-first}} - { - "{{{name}}}", new Dictionary { - {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, - {"default_value", {{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}"{{{defaultValue}}}"}, - {{#enumValues}} - {{#-first}} - { - "enum_values", new List() { - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - } - } - {{/-last}} - {{/enumValues}} - } - }{{^-last}},{{/-last}} - {{#-last}} - } - } - {{/-last}} - {{/variables}} - } - }{{^-last}},{{/-last}} - {{#-last}} - }; - {{/-last}} - {{/servers}} - OperationServers = new Dictionary>>() - { - {{#apiInfo}} - {{#apis}} - {{#operations}} - {{#operation}} - {{#servers.0}} - { - "{{{classname}}}.{{{nickname}}}", new List> - { - {{#servers}} - { - new Dictionary - { - {"url", "{{{url}}}"}, - {"description", "{{{description}}}{{^description}}No description provided{{/description}}"} - } - }, - {{/servers}} - } - }, - {{/servers.0}} - {{/operation}} - {{/operations}} - {{/apis}} - {{/apiInfo}} - }; - - // Setting Timeout has side effects (forces ApiClient creation). - Timeout = 100000; - } - - /// - /// Initializes a new instance of the class - /// - [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] - public Configuration( - IDictionary defaultHeaders, - IDictionary apiKey, - IDictionary apiKeyPrefix, - string basePath = "{{{basePath}}}") : this() - { - if (string.{{^net35}}IsNullOrWhiteSpace{{/net35}}{{#net35}}IsNullOrEmpty{{/net35}}(basePath)) - throw new ArgumentException("The provided basePath is invalid.", "basePath"); - if (defaultHeaders == null) - throw new ArgumentNullException("defaultHeaders"); - if (apiKey == null) - throw new ArgumentNullException("apiKey"); - if (apiKeyPrefix == null) - throw new ArgumentNullException("apiKeyPrefix"); - - BasePath = basePath; - - foreach (var keyValuePair in defaultHeaders) - { - DefaultHeaders.Add(keyValuePair); - } - - foreach (var keyValuePair in apiKey) - { - ApiKey.Add(keyValuePair); - } - - foreach (var keyValuePair in apiKeyPrefix) - { - ApiKeyPrefix.Add(keyValuePair); - } - } - - #endregion Constructors - - #region Properties - - /// - /// Gets or sets the base path for API access. - /// - public virtual string BasePath - { - get { return _basePath; } - set { _basePath = value; } - } - - /// - /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. - /// - public virtual bool UseDefaultCredentials - { - get { return _useDefaultCredentials; } - set { _useDefaultCredentials = value; } - } - - /// - /// Gets or sets the default header. - /// - [Obsolete("Use DefaultHeaders instead.")] - public virtual IDictionary DefaultHeader - { - get - { - return DefaultHeaders; - } - set - { - DefaultHeaders = value; - } - } - - /// - /// Gets or sets the default headers. - /// - public virtual IDictionary DefaultHeaders { get; set; } - - /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. - /// - public virtual int Timeout { get; set; } - - /// - /// Gets or sets the proxy - /// - /// Proxy. - public virtual WebProxy Proxy { get; set; } - - /// - /// Gets or sets the HTTP user agent. - /// - /// Http user agent. - public virtual string UserAgent { get; set; } - - /// - /// Gets or sets the username (HTTP basic authentication). - /// - /// The username. - public virtual string Username { get; set; } - - /// - /// Gets or sets the password (HTTP basic authentication). - /// - /// The password. - public virtual string Password { get; set; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - public string GetApiKeyWithPrefix(string apiKeyIdentifier) - { - string apiKeyValue; - ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); - string apiKeyPrefix; - if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) - { - return apiKeyPrefix + " " + apiKeyValue; - } - - return apiKeyValue; - } - - /// - /// Gets or sets certificate collection to be sent with requests. - /// - /// X509 Certificate collection. - public X509CertificateCollection ClientCertificates { get; set; } - - /// - /// Gets or sets the access token for OAuth2 authentication. - /// - /// This helper property simplifies code generation. - /// - /// The access token. - public virtual string AccessToken { get; set; } - - {{#useRestSharp}} - {{#hasOAuthMethods}} - /// - /// Gets or sets the token URL for OAuth2 authentication. - /// - /// The OAuth Token URL. - public virtual string OAuthTokenUrl { get; set; } - - /// - /// Gets or sets the client ID for OAuth2 authentication. - /// - /// The OAuth Client ID. - public virtual string OAuthClientId { get; set; } - - /// - /// Gets or sets the client secret for OAuth2 authentication. - /// - /// The OAuth Client Secret. - public virtual string OAuthClientSecret { get; set; } - - /// - /// Gets or sets the client scope for OAuth2 authentication. - /// - /// The OAuth Client Scope. - public virtual string{{nrt?}} OAuthScope { get; set; } - - /// - /// Gets or sets the flow for OAuth2 authentication. - /// - /// The OAuth Flow. - public virtual OAuthFlow? OAuthFlow { get; set; } - - {{/hasOAuthMethods}} - {{/useRestSharp}} - /// - /// Gets or sets the temporary folder path to store the files downloaded from the server. - /// - /// Folder path. - public virtual string TempFolderPath - { - get { return _tempFolderPath; } - - set - { - if (string.IsNullOrEmpty(value)) - { - _tempFolderPath = Path.GetTempPath(); - return; - } - - // create the directory if it does not exist - if (!Directory.Exists(value)) - { - Directory.CreateDirectory(value); - } - - // check if the path contains directory separator at the end - if (value[value.Length - 1] == Path.DirectorySeparatorChar) - { - _tempFolderPath = value; - } - else - { - _tempFolderPath = value + Path.DirectorySeparatorChar; - } - } - } - - /// - /// Gets or sets the date time format used when serializing in the ApiClient - /// By default, it's set to ISO 8601 - "o", for others see: - /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx - /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx - /// No validation is done to ensure that the string you're providing is valid - /// - /// The DateTimeFormat string - public virtual string DateTimeFormat - { - get { return _dateTimeFormat; } - set - { - if (string.IsNullOrEmpty(value)) - { - // Never allow a blank or null string, go back to the default - _dateTimeFormat = ISO8601_DATETIME_FORMAT; - return; - } - - // Caution, no validation when you choose date time format other than ISO 8601 - // Take a look at the above links - _dateTimeFormat = value; - } - } - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// Whatever you set here will be prepended to the value defined in AddApiKey. - /// - /// An example invocation here might be: - /// - /// ApiKeyPrefix["Authorization"] = "Bearer"; - /// - /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. - /// - /// - /// OAuth2 workflows should set tokens via AccessToken. - /// - /// - /// The prefix of the API key. - public virtual IDictionary ApiKeyPrefix - { - get { return _apiKeyPrefix; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); - } - _apiKeyPrefix = value; - } - } - - /// - /// Gets or sets the API key based on the authentication name. - /// - /// The API key. - public virtual IDictionary ApiKey - { - get { return _apiKey; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKey collection may not be null."); - } - _apiKey = value; - } - } - {{#servers.0}} - - /// - /// Gets or sets the servers. - /// - /// The servers. - public virtual IList> Servers - { - get { return _servers; } - set - { - if (value == null) - { - throw new InvalidOperationException("Servers may not be null."); - } - _servers = value; - } - } - - /// - /// Gets or sets the operation servers. - /// - /// The operation servers. - public virtual IReadOnlyDictionary>> OperationServers - { - get { return _operationServers; } - set - { - if (value == null) - { - throw new InvalidOperationException("Operation servers may not be null."); - } - _operationServers = value; - } - } - - /// - /// Returns URL based on server settings without providing values - /// for the variables - /// - /// Array index of the server settings. - /// The server URL. - public string GetServerUrl(int index) - { - return GetServerUrl(Servers, index, null); - } - - /// - /// Returns URL based on server settings. - /// - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The server URL. - public string GetServerUrl(int index, Dictionary inputVariables) - { - return GetServerUrl(Servers, index, inputVariables); - } - - /// - /// Returns URL based on operation server settings. - /// - /// Operation associated with the request path. - /// Array index of the server settings. - /// The operation server URL. - public string GetOperationServerUrl(string operation, int index) - { - return GetOperationServerUrl(operation, index, null); - } - - /// - /// Returns URL based on operation server settings. - /// - /// Operation associated with the request path. - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The operation server URL. - public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) - { - if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) - { - return GetServerUrl(operationServer, index, inputVariables); - } - - return null; - } - - /// - /// Returns URL based on server settings. - /// - /// Dictionary of server settings. - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The server URL. - private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) - { - if (index < 0 || index >= servers.Count) - { - throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); - } - - if (inputVariables == null) - { - inputVariables = new Dictionary(); - } - - IReadOnlyDictionary server = servers[index]; - string url = (string)server["url"]; - - if (server.ContainsKey("variables")) - { - // go through each variable and assign a value - foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) - { - - IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); - - if (inputVariables.ContainsKey(variable.Key)) - { - if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) - { - url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); - } - else - { - throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); - } - } - else - { - // use default value - url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); - } - } - } - - return url; - } - {{/servers.0}} - {{#hasHttpSignatureMethods}} - - /// - /// Gets and Sets the HttpSigningConfiguration - /// - public HttpSigningConfiguration HttpSigningConfiguration - { - get { return _HttpSigningConfiguration; } - set { _HttpSigningConfiguration = value; } - } - {{/hasHttpSignatureMethods}} - - /// - /// Gets and Sets the RemoteCertificateValidationCallback - /// - public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } - - #endregion Properties - - #region Methods - - /// - /// Returns a string with essential information for debugging. - /// - public static string ToDebugReport() - { - string report = "C# SDK ({{{packageName}}}) Debug Report:\n"; - report += " OS: " + System.Environment.OSVersion + "\n"; - report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: {{{version}}}\n"; - report += " SDK Package Version: {{{packageVersion}}}\n"; - - return report; - } - - /// - /// Add Api Key Header. - /// - /// Api Key name. - /// Api Key value. - /// - public void AddApiKey(string key, string value) - { - ApiKey[key] = value; - } - - /// - /// Sets the API key prefix. - /// - /// Api Key name. - /// Api Key value. - public void AddApiKeyPrefix(string key, string value) - { - ApiKeyPrefix[key] = value; - } - - #endregion Methods - - #region Static Members - /// - /// Merge configurations. - /// - /// First configuration. - /// Second configuration. - /// Merged configuration. - public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) - { - if (second == null) return first ?? GlobalConfiguration.Instance; - - Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - - foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; - foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; - foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; - - var config = new Configuration - { - ApiKey = apiKey, - ApiKeyPrefix = apiKeyPrefix, - DefaultHeaders = defaultHeaders, - BasePath = second.BasePath ?? first.BasePath, - Timeout = second.Timeout, - Proxy = second.Proxy ?? first.Proxy, - UserAgent = second.UserAgent ?? first.UserAgent, - Username = second.Username ?? first.Username, - Password = second.Password ?? first.Password, - AccessToken = second.AccessToken ?? first.AccessToken, - {{#useRestSharp}} - {{#hasOAuthMethods}} - OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, - OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, - OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, - OAuthScope = second.OAuthScope ?? first.OAuthScope, - OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, - {{/hasOAuthMethods}} - {{/useRestSharp}} - {{#hasHttpSignatureMethods}} - HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, - {{/hasHttpSignatureMethods}} - TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, - DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, - ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, - UseDefaultCredentials = second.UseDefaultCredentials, - RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, - }; - return config; - } - #endregion Static Members - } -} diff --git a/templates-v7/csharp/api_doc.mustache b/templates-v7/csharp/api_doc.mustache deleted file mode 100644 index ca85bfa7f..000000000 --- a/templates-v7/csharp/api_doc.mustache +++ /dev/null @@ -1,164 +0,0 @@ -# {{packageName}}.{{apiPackage}}.{{classname}}{{#description}} -{{.}}{{/description}} - -All URIs are relative to *{{{basePath}}}* - -| Method | HTTP request | Description | -|--------|--------------|-------------| -{{#operations}} -{{#operation}} -| [**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} | -{{/operation}} -{{/operations}} - -{{#operations}} -{{#operation}} - -# **{{{operationId}}}** -> {{returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) - -{{{summary}}}{{#notes}} - -{{{.}}}{{/notes}} - -{{^useGenericHost}} -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -{{#useHttpClient}} -using System.Net.Http; -{{/useHttpClient}} -using {{packageName}}.{{apiPackage}}; -using {{packageName}}.Client; -using {{packageName}}.{{modelPackage}}; - -namespace Example -{ - public class {{operationId}}Example - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "{{{basePath}}}"; - {{#hasAuthMethods}} - {{#authMethods}} - {{#isBasicBasic}} - // Configure HTTP basic authorization: {{{name}}} - config.Username = "YOUR_USERNAME"; - config.Password = "YOUR_PASSWORD"; - {{/isBasicBasic}} - {{#isBasicBearer}} - // Configure Bearer token for authorization: {{{name}}} - config.AccessToken = "YOUR_BEARER_TOKEN"; - {{/isBasicBearer}} - {{#isApiKey}} - // Configure API key authorization: {{{name}}} - config.AddApiKey("{{{keyParamName}}}", "YOUR_API_KEY"); - // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed - // config.AddApiKeyPrefix("{{{keyParamName}}}", "Bearer"); - {{/isApiKey}} - {{#isOAuth}} - // Configure OAuth2 access token for authorization: {{{name}}} - config.AccessToken = "YOUR_ACCESS_TOKEN"; - {{/isOAuth}} - {{/authMethods}} - - {{/hasAuthMethods}} - {{#useHttpClient}} - // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes - HttpClient httpClient = new HttpClient(); - HttpClientHandler httpClientHandler = new HttpClientHandler(); - var apiInstance = new {{classname}}(httpClient, config, httpClientHandler); - {{/useHttpClient}} - {{^useHttpClient}} - var apiInstance = new {{classname}}(config); - {{/useHttpClient}} - {{#allParams}} - {{#isPrimitiveType}} - var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} - {{/isPrimitiveType}} - {{^isPrimitiveType}} - var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} - {{/isPrimitiveType}} - {{/allParams}} - - try - { - {{#summary}} - // {{{.}}} - {{/summary}} - {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - Debug.WriteLine(result);{{/returnType}} - } - catch (ApiException e) - { - Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the {{operationId}}WithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - {{#summary}} - // {{{.}}} - {{/summary}} - {{#returnType}}ApiResponse<{{{.}}}> response = {{/returnType}}apiInstance.{{{operationId}}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data);{{/returnType}} -} -catch (ApiException e) -{ - Debug.Print("Exception when calling {{classname}}.{{operationId}}WithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` -{{/useGenericHost}} - -### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -| Name | Type | Description | Notes | -|------|------|-------------|-------| -{{/-last}} -{{/allParams}} -{{#allParams}} -| **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | -{{/allParams}} - -### Return type - -{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} - -### Authorization - -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} - -### HTTP request headers - - - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} - -{{#responses.0}} - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -{{#responses}} -| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | -{{/responses}} -{{/responses.0}} - -[[Back to top]](#) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) - -{{/operation}} -{{/operations}} diff --git a/templates-v7/csharp/libraries/generichost/ApiResponse.mustache b/templates-v7/csharp/libraries/generichost/ApiResponse.mustache index 0b0b074d2..fee8659ff 100644 --- a/templates-v7/csharp/libraries/generichost/ApiResponse.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiResponse.mustache @@ -155,7 +155,7 @@ namespace {{packageName}}.{{corePackageName}}.{{clientPackage}} } /// - /// Construct the response using an HttpResponseMessage + /// Construct the response using an HttpResponseMessage. /// /// /// @@ -183,23 +183,23 @@ namespace {{packageName}}.{{corePackageName}}.{{clientPackage}} {{#x-http-statuses-with-return}} /// - /// An interface for responses of type {{TType}} + /// An interface for responses of type {{TType}}. /// /// {{>visibility}} interface I{{.}} : IApiResponse { /// - /// Deserializes the response if the response is {{.}} + /// Deserializes the response if the response is {{.}}. /// /// TType {{.}}(); /// - /// Returns true if the response is {{.}} and the deserialized response is not null + /// Returns true if the response is {{.}} and the deserialized response is not null. /// /// /// - bool Try{{.}}({{#net60OrLater}}[NotNullWhen(true)]{{/net60OrLater}}out TType{{nrt?}} result); + bool TryDeserialize{{.}}Response({{#net60OrLater}}[NotNullWhen(true)]{{/net60OrLater}}out TType{{nrt?}} result); } {{/x-http-statuses-with-return}} } diff --git a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache index 69382b7cf..013953bd4 100644 --- a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache +++ b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache @@ -45,7 +45,6 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} compareLogic = new{{^net70OrLater}} CompareLogic{{/net70OrLater}}({{#equatable}}comparisonConfig{{/equatable}}); } {{/useCompareNetObjects}} - /// /// A delegate for events. /// @@ -126,9 +125,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} return dateOnly.ToString(format); {{/net60OrLater}} if (obj is bool boolean) - return boolean - ? "true" - : "false"; + return boolean ? "true" : "false"; {{#models}} {{#model}} {{#isEnum}} @@ -333,27 +330,17 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} } /// - /// The base path of the API - /// - public const string BASE_ADDRESS = "{{{basePath}}}"; - - /// - /// The scheme of the API - /// - public const string SCHEME = "{{{scheme}}}"; - - /// - /// The context path of the API + /// The base path of the API, it includes the http(s)-scheme, the host domain name, and the base path. /// - public const string CONTEXT_PATH = "{{contextPath}}"; + public const string BASE_URL = "{{{basePath}}}"; /// - /// The host of the API + /// The relative path of the API after the `.com`. /// - public const string HOST = "{{{host}}}"; + public const string RELATIVE_URL = "{{contextPath}}"; /// - /// The format to use for DateTime serialization + /// The format to use for DateTime serialization. /// public const string ISO8601_DATETIME_FORMAT = "o"; } diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index aaa645252..fac860fe9 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -102,7 +102,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} client = null, Action{{nrt?}} builder = null) { if (client == null) - client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_URL); List builders = new List(); diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index 2a69a86a1..3c760069b 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -352,7 +352,6 @@ {{/discriminator}} {{! start | support oneOf without discriminator.mapping property - WriteProperties }} {{^model.discriminator}} - // Write oneOf mappings when no `discriminator.mapping` is provided {{#composedSchemas.oneOf}} if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index a2bd2984f..2034a1268 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -755,7 +755,7 @@ namespace {{packageName}}.{{apiPackage}} ///
/// /// - public bool Try{{vendorExtensions.x-http-status}}({{#net60OrLater}}[NotNullWhen(true)]{{/net60OrLater}}out {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} result) + public bool TryDeserialize{{vendorExtensions.x-http-status}}Response({{#net60OrLater}}[NotNullWhen(true)]{{/net60OrLater}}out {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} result) { result = null; diff --git a/templates-v7/csharp/libraries/generichost/api_doc.mustache b/templates-v7/csharp/libraries/generichost/api_doc.mustache new file mode 100644 index 000000000..fac055edf --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/api_doc.mustache @@ -0,0 +1,60 @@ +# {{packageName}}.{{apiPackage}}.{{classname}}{{#description}} +{{.}}{{/description}} + +### API Base-Path: **{{{basePath}}}** + +### Authorization: {{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +| Method | HTTP request | Description | +|--------|--------------|-------------| +{{#operations}} +{{#operation}} +| [**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} | +{{/operation}} +{{/operations}} + +{{#operations}} +{{#operation}} + +# **{{httpMethod}}** **{{{path}}}** + +{{{summary}}} + +```csharp +I{{returnType}}{{^returnType}}void{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) +``` + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +| Name | Type | Description | +|------|------|-------------| +{{/-last}} +{{/allParams}} +{{#allParams}} +| **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} + + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{#responses.0}} + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} + +[[Back to top]](#) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) + +{{/operation}} +{{/operations}} From 46ab0e669357988730d7a9bc402c4d9b95db85cb Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 17 Oct 2025 15:39:26 +0200 Subject: [PATCH 043/126] Move original library to /src for easier debugging and cleaning up --- Adyen/Adyen.csproj | 4 +++ Adyen/Core/JsonSerializerOptionsProvider.cs | 25 ------------------- .../Converter/JsonBase64Converter.cs | 0 .../JsonConvertDeserializerWrapper.cs | 0 .../Converter/JsonConvertSerializerWrapper.cs | 0 .../Converter/SaleToPoiMessageConverter.cs | 0 .../SaleToPoiMessageSecuredConverter.cs | 0 .../ApiSerialization/IMessagePayload.cs | 0 .../IMessagePayloadSerializer.cs | 0 .../MessageHeaderSerializer.cs | 0 .../MessagePayloadSerializer.cs | 0 .../MessagePayloadSerializerFactory.cs | 0 .../ApiSerialization/OpenAPIDateConverter.cs | 0 .../SaleToPoiMessageSecuredSerializer.cs | 0 .../SaleToPoiMessageSerializer.cs | 0 .../{ => src}/ApiSerialization/TypeHelper.cs | 0 Adyen/{ => src}/Constants/ApiConstants.cs | 0 Adyen/{ => src}/Constants/ClientConfig.cs | 0 Adyen/{ => src}/Constants/Region.cs | 0 .../Exceptions/DeserializationException.cs | 0 .../{ => src}/Exceptions/ExceptionMessages.cs | 0 .../HttpClient/HttpClientException.cs | 0 .../HttpClient/HttpClientExtension.cs | 0 .../{ => src}/HttpClient/HttpClientWrapper.cs | 0 .../HttpClient/Interfaces/IClient.cs | 0 .../AcsWebhooks/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/AcsWebhooks/Amount.cs | 0 .../AcsWebhooks/AuthenticationDecision.cs | 0 .../Model/AcsWebhooks/AuthenticationInfo.cs | 0 .../AuthenticationNotificationData.cs | 0 .../AuthenticationNotificationRequest.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../Model/AcsWebhooks/ChallengeInfo.cs | 0 Adyen/{ => src}/Model/AcsWebhooks/Purchase.cs | 0 .../Model/AcsWebhooks/PurchaseInfo.cs | 0 .../RelayedAuthenticationRequest.cs | 0 .../RelayedAuthenticationResponse.cs | 0 Adyen/{ => src}/Model/AcsWebhooks/Resource.cs | 0 .../Model/AcsWebhooks/ServiceError.cs | 0 Adyen/{ => src}/Model/ApiError.cs | 0 .../ApplicationInformation/ApplicationInfo.cs | 0 .../ApplicationInformation/CommonField.cs | 0 .../ExternalPlatform.cs | 0 .../ApplicationInformation/MerchantDevice.cs | 0 .../ShopperInteractionDevice.cs | 0 .../BalanceControl/AbstractOpenAPISchema.cs | 0 .../{ => src}/Model/BalanceControl/Amount.cs | 0 .../BalanceControl/BalanceTransferRequest.cs | 0 .../BalanceControl/BalanceTransferResponse.cs | 0 .../AULocalAccountIdentification.cs | 0 .../BalancePlatform/AbstractOpenAPISchema.cs | 0 .../Model/BalancePlatform/AccountHolder.cs | 0 .../AccountHolderCapability.cs | 0 .../BalancePlatform/AccountHolderInfo.cs | 0 .../AccountHolderUpdateRequest.cs | 0 .../AccountSupportingEntityCapability.cs | 0 .../ActiveNetworkTokensRestriction.cs | 0 .../AdditionalBankIdentification.cs | 0 .../Model/BalancePlatform/Address.cs | 0 .../BalancePlatform/AddressRequirement.cs | 0 .../{ => src}/Model/BalancePlatform/Amount.cs | 0 .../AmountMinMaxRequirement.cs | 0 .../AmountNonZeroDecimalsRequirement.cs | 0 .../AssociationDelegatedAuthenticationData.cs | 0 .../AssociationFinaliseRequest.cs | 0 .../AssociationFinaliseResponse.cs | 0 .../AssociationInitiateRequest.cs | 0 .../AssociationInitiateResponse.cs | 0 .../Model/BalancePlatform/Authentication.cs | 0 .../BRLocalAccountIdentification.cs | 0 .../Model/BalancePlatform/Balance.cs | 0 .../Model/BalancePlatform/BalanceAccount.cs | 0 .../BalancePlatform/BalanceAccountBase.cs | 0 .../BalancePlatform/BalanceAccountInfo.cs | 0 .../BalanceAccountUpdateRequest.cs | 0 .../Model/BalancePlatform/BalancePlatform.cs | 0 .../BalanceSweepConfigurationsResponse.cs | 0 .../Model/BalancePlatform/BankAccount.cs | 0 .../BankAccountAccountIdentification.cs | 0 .../BalancePlatform/BankAccountDetails.cs | 0 ...ankAccountIdentificationTypeRequirement.cs | 0 ...kAccountIdentificationValidationRequest.cs | 0 ...nValidationRequestAccountIdentification.cs | 0 .../Model/BalancePlatform/BankAccountModel.cs | 0 .../BalancePlatform/BankIdentification.cs | 0 .../BrandVariantsRestriction.cs | 0 .../Model/BalancePlatform/BulkAddress.cs | 0 .../CALocalAccountIdentification.cs | 0 .../CZLocalAccountIdentification.cs | 0 .../BalancePlatform/CapabilityProblem.cs | 0 .../CapabilityProblemEntity.cs | 0 .../CapabilityProblemEntityRecursive.cs | 0 .../BalancePlatform/CapabilitySettings.cs | 0 .../Model/BalancePlatform/CapitalBalance.cs | 0 .../BalancePlatform/CapitalGrantAccount.cs | 0 Adyen/{ => src}/Model/BalancePlatform/Card.cs | 0 .../BalancePlatform/CardConfiguration.cs | 0 .../Model/BalancePlatform/CardInfo.cs | 0 .../Model/BalancePlatform/CardOrder.cs | 0 .../Model/BalancePlatform/CardOrderItem.cs | 0 .../CardOrderItemDeliveryStatus.cs | 0 .../Model/BalancePlatform/ContactDetails.cs | 0 .../Model/BalancePlatform/Counterparty.cs | 0 .../CounterpartyBankRestriction.cs | 0 .../CounterpartyTypesRestriction.cs | 0 .../BalancePlatform/CountriesRestriction.cs | 0 .../CreateSweepConfigurationV2.cs | 0 .../DKLocalAccountIdentification.cs | 0 .../BalancePlatform/DayOfWeekRestriction.cs | 0 .../DelegatedAuthenticationData.cs | 0 .../Model/BalancePlatform/DeliveryAddress.cs | 0 .../Model/BalancePlatform/DeliveryContact.cs | 0 .../{ => src}/Model/BalancePlatform/Device.cs | 0 .../Model/BalancePlatform/DeviceInfo.cs | 0 .../DifferentCurrenciesRestriction.cs | 0 .../Model/BalancePlatform/Duration.cs | 0 .../BalancePlatform/EntryModesRestriction.cs | 0 .../{ => src}/Model/BalancePlatform/Expiry.cs | 0 Adyen/{ => src}/Model/BalancePlatform/Fee.cs | 0 .../GetNetworkTokenResponse.cs | 0 .../BalancePlatform/GetTaxFormResponse.cs | 0 .../Model/BalancePlatform/GrantLimit.cs | 0 .../Model/BalancePlatform/GrantOffer.cs | 0 .../Model/BalancePlatform/GrantOffers.cs | 0 .../HKLocalAccountIdentification.cs | 0 .../HULocalAccountIdentification.cs | 0 Adyen/{ => src}/Model/BalancePlatform/Href.cs | 0 .../IbanAccountIdentification.cs | 0 .../IbanAccountIdentificationRequirement.cs | 0 .../InternationalTransactionRestriction.cs | 0 .../Model/BalancePlatform/InvalidField.cs | 0 Adyen/{ => src}/Model/BalancePlatform/Link.cs | 0 .../ListNetworkTokensResponse.cs | 0 .../MatchingTransactionsRestriction.cs | 0 .../MatchingValuesRestriction.cs | 0 .../Model/BalancePlatform/MccsRestriction.cs | 0 .../BalancePlatform/MerchantAcquirerPair.cs | 0 .../MerchantNamesRestriction.cs | 0 .../BalancePlatform/MerchantsRestriction.cs | 0 .../NOLocalAccountIdentification.cs | 0 .../NZLocalAccountIdentification.cs | 0 Adyen/{ => src}/Model/BalancePlatform/Name.cs | 0 .../Model/BalancePlatform/NetworkToken.cs | 0 .../NumberAndBicAccountIdentification.cs | 0 .../PLLocalAccountIdentification.cs | 0 .../PaginatedAccountHoldersResponse.cs | 0 .../PaginatedBalanceAccountsResponse.cs | 0 .../PaginatedGetCardOrderItemResponse.cs | 0 .../PaginatedGetCardOrderResponse.cs | 0 .../PaginatedPaymentInstrumentsResponse.cs | 0 .../BalancePlatform/PaymentInstrument.cs | 0 ...ditionalBankAccountIdentificationsInner.cs | 0 .../BalancePlatform/PaymentInstrumentGroup.cs | 0 .../PaymentInstrumentGroupInfo.cs | 0 .../BalancePlatform/PaymentInstrumentInfo.cs | 0 .../PaymentInstrumentRequirement.cs | 0 .../PaymentInstrumentRevealInfo.cs | 0 .../PaymentInstrumentRevealRequest.cs | 0 .../PaymentInstrumentRevealResponse.cs | 0 .../PaymentInstrumentUpdateRequest.cs | 0 .../{ => src}/Model/BalancePlatform/Phone.cs | 0 .../Model/BalancePlatform/PhoneNumber.cs | 0 .../Model/BalancePlatform/PinChangeRequest.cs | 0 .../BalancePlatform/PinChangeResponse.cs | 0 .../PlatformPaymentConfiguration.cs | 0 .../ProcessingTypesRestriction.cs | 0 .../BalancePlatform/PublicKeyResponse.cs | 0 .../RegisterSCAFinalResponse.cs | 0 .../BalancePlatform/RegisterSCARequest.cs | 0 .../BalancePlatform/RegisterSCAResponse.cs | 0 .../BalancePlatform/RemediatingAction.cs | 0 .../Model/BalancePlatform/Repayment.cs | 0 .../Model/BalancePlatform/RepaymentTerm.cs | 0 .../Model/BalancePlatform/RestServiceError.cs | 0 .../Model/BalancePlatform/RevealPinRequest.cs | 0 .../BalancePlatform/RevealPinResponse.cs | 0 .../Model/BalancePlatform/RiskScores.cs | 0 .../BalancePlatform/RiskScoresRestriction.cs | 0 .../SELocalAccountIdentification.cs | 0 .../SGLocalAccountIdentification.cs | 0 .../BalancePlatform/SameAmountRestriction.cs | 0 .../SameCounterpartyRestriction.cs | 0 .../SearchRegisteredDevicesResponse.cs | 0 .../SourceAccountTypesRestriction.cs | 0 .../Model/BalancePlatform/StringMatch.cs | 0 .../BalancePlatform/SweepConfigurationV2.cs | 0 .../BalancePlatform/SweepCounterparty.cs | 0 .../Model/BalancePlatform/SweepSchedule.cs | 0 .../BalancePlatform/ThresholdRepayment.cs | 0 .../Model/BalancePlatform/TimeOfDay.cs | 0 .../BalancePlatform/TimeOfDayRestriction.cs | 0 .../TokenRequestorsRestriction.cs | 0 .../BalancePlatform/TotalAmountRestriction.cs | 0 .../Model/BalancePlatform/TransactionRule.cs | 0 .../TransactionRuleEntityKey.cs | 0 .../BalancePlatform/TransactionRuleInfo.cs | 0 .../TransactionRuleInterval.cs | 0 .../TransactionRuleResponse.cs | 0 .../TransactionRuleRestrictions.cs | 0 .../TransactionRulesResponse.cs | 0 .../Model/BalancePlatform/TransferRoute.cs | 0 .../BalancePlatform/TransferRouteRequest.cs | 0 .../TransferRouteRequirementsInner.cs | 0 .../BalancePlatform/TransferRouteResponse.cs | 0 .../UKLocalAccountIdentification.cs | 0 .../USInternationalAchAddressRequirement.cs | 0 .../USLocalAccountIdentification.cs | 0 .../UpdateNetworkTokenRequest.cs | 0 .../UpdatePaymentInstrument.cs | 0 .../UpdateSweepConfigurationV2.cs | 0 .../BalancePlatform/VerificationDeadline.cs | 0 .../BalancePlatform/VerificationError.cs | 0 .../VerificationErrorRecursive.cs | 0 .../Model/BinLookup/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/BinLookup/Amount.cs | 0 Adyen/{ => src}/Model/BinLookup/BinDetail.cs | 0 Adyen/{ => src}/Model/BinLookup/CardBin.cs | 0 .../BinLookup/CostEstimateAssumptions.cs | 0 .../Model/BinLookup/CostEstimateRequest.cs | 0 .../Model/BinLookup/CostEstimateResponse.cs | 0 .../Model/BinLookup/DSPublicKeyDetail.cs | 0 .../Model/BinLookup/MerchantDetails.cs | 0 Adyen/{ => src}/Model/BinLookup/Recurring.cs | 0 .../{ => src}/Model/BinLookup/ServiceError.cs | 0 .../BinLookup/ThreeDS2CardRangeDetail.cs | 0 .../BinLookup/ThreeDSAvailabilityRequest.cs | 0 .../BinLookup/ThreeDSAvailabilityResponse.cs | 0 .../Model/Checkout/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/Checkout/AccountInfo.cs | 0 Adyen/{ => src}/Model/Checkout/AcctInfo.cs | 0 Adyen/{ => src}/Model/Checkout/AchDetails.cs | 0 .../Model/Checkout/AdditionalData3DSecure.cs | 0 .../Model/Checkout/AdditionalDataAirline.cs | 0 .../Model/Checkout/AdditionalDataCarRental.cs | 0 .../Model/Checkout/AdditionalDataCommon.cs | 0 .../Model/Checkout/AdditionalDataLevel23.cs | 0 .../Model/Checkout/AdditionalDataLodging.cs | 0 .../Checkout/AdditionalDataOpenInvoice.cs | 0 .../Model/Checkout/AdditionalDataOpi.cs | 0 .../Model/Checkout/AdditionalDataRatepay.cs | 0 .../Model/Checkout/AdditionalDataRetry.cs | 0 .../Model/Checkout/AdditionalDataRisk.cs | 0 .../Checkout/AdditionalDataRiskStandalone.cs | 0 .../Checkout/AdditionalDataSubMerchant.cs | 0 .../AdditionalDataTemporaryServices.cs | 0 .../Model/Checkout/AdditionalDataWallets.cs | 0 Adyen/{ => src}/Model/Checkout/Address.cs | 0 .../{ => src}/Model/Checkout/AffirmDetails.cs | 0 .../Model/Checkout/AfterpayDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Agency.cs | 0 Adyen/{ => src}/Model/Checkout/Airline.cs | 0 .../Model/Checkout/AmazonPayDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Amount.cs | 0 Adyen/{ => src}/Model/Checkout/Amounts.cs | 0 Adyen/{ => src}/Model/Checkout/AncvDetails.cs | 0 .../Model/Checkout/AndroidPayDetails.cs | 0 .../Model/Checkout/ApplePayDetails.cs | 0 .../Model/Checkout/ApplePayDonations.cs | 0 .../Model/Checkout/ApplePaySessionRequest.cs | 0 .../Model/Checkout/ApplePaySessionResponse.cs | 0 .../Model/Checkout/ApplicationInfo.cs | 0 .../Model/Checkout/AuthenticationData.cs | 0 .../Model/Checkout/BacsDirectDebitDetails.cs | 0 .../Model/Checkout/BalanceCheckRequest.cs | 0 .../Model/Checkout/BalanceCheckResponse.cs | 0 .../Model/Checkout/BillDeskDetails.cs | 0 .../Model/Checkout/BillingAddress.cs | 0 Adyen/{ => src}/Model/Checkout/BlikDetails.cs | 0 Adyen/{ => src}/Model/Checkout/BrowserInfo.cs | 0 .../Model/Checkout/CancelOrderRequest.cs | 0 .../Model/Checkout/CancelOrderResponse.cs | 0 .../Model/Checkout/CardBrandDetails.cs | 0 Adyen/{ => src}/Model/Checkout/CardDetails.cs | 0 .../Model/Checkout/CardDetailsRequest.cs | 0 .../Model/Checkout/CardDetailsResponse.cs | 0 .../{ => src}/Model/Checkout/CardDonations.cs | 0 .../Model/Checkout/CashAppDetails.cs | 0 .../Model/Checkout/CellulantDetails.cs | 0 .../Model/Checkout/CheckoutAwaitAction.cs | 0 .../Model/Checkout/CheckoutBankAccount.cs | 0 .../Checkout/CheckoutBankTransferAction.cs | 0 .../CheckoutDelegatedAuthenticationAction.cs | 0 .../Checkout/CheckoutNativeRedirectAction.cs | 0 .../Model/Checkout/CheckoutOrderResponse.cs | 0 .../Model/Checkout/CheckoutPaymentMethod.cs | 0 .../Model/Checkout/CheckoutQrCodeAction.cs | 0 .../Model/Checkout/CheckoutRedirectAction.cs | 0 .../Model/Checkout/CheckoutSDKAction.cs | 0 .../CheckoutSessionInstallmentOption.cs | 0 .../CheckoutSessionThreeDS2RequestData.cs | 0 .../Model/Checkout/CheckoutThreeDS2Action.cs | 0 .../Model/Checkout/CheckoutVoucherAction.cs | 0 Adyen/{ => src}/Model/Checkout/CommonField.cs | 0 Adyen/{ => src}/Model/Checkout/Company.cs | 0 .../Checkout/CreateCheckoutSessionRequest.cs | 0 .../Checkout/CreateCheckoutSessionResponse.cs | 0 .../Model/Checkout/CreateOrderRequest.cs | 0 .../Model/Checkout/CreateOrderResponse.cs | 0 .../Model/Checkout/DeliveryAddress.cs | 0 .../Model/Checkout/DeliveryMethod.cs | 0 .../DetailsRequestAuthenticationData.cs | 0 .../Model/Checkout/DeviceRenderOptions.cs | 0 Adyen/{ => src}/Model/Checkout/DokuDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Donation.cs | 0 .../Model/Checkout/DonationCampaign.cs | 0 .../Checkout/DonationCampaignsRequest.cs | 0 .../Checkout/DonationCampaignsResponse.cs | 0 .../Model/Checkout/DonationPaymentMethod.cs | 0 .../Model/Checkout/DonationPaymentRequest.cs | 0 .../Model/Checkout/DonationPaymentResponse.cs | 0 .../Model/Checkout/DragonpayDetails.cs | 0 .../Model/Checkout/EBankingFinlandDetails.cs | 0 .../Model/Checkout/EcontextVoucherDetails.cs | 0 Adyen/{ => src}/Model/Checkout/EftDetails.cs | 0 .../Model/Checkout/EncryptedOrderData.cs | 0 .../Model/Checkout/EnhancedSchemeData.cs | 0 .../Model/Checkout/ExternalPlatform.cs | 0 .../Model/Checkout/FastlaneDetails.cs | 0 Adyen/{ => src}/Model/Checkout/ForexQuote.cs | 0 .../Model/Checkout/FraudCheckResult.cs | 0 Adyen/{ => src}/Model/Checkout/FraudResult.cs | 0 Adyen/{ => src}/Model/Checkout/FundOrigin.cs | 0 .../{ => src}/Model/Checkout/FundRecipient.cs | 0 .../GenericIssuerPaymentMethodDetails.cs | 0 .../Model/Checkout/GooglePayDetails.cs | 0 .../Model/Checkout/GooglePayDonations.cs | 0 .../{ => src}/Model/Checkout/IdealDetails.cs | 0 .../Model/Checkout/IdealDonations.cs | 0 Adyen/{ => src}/Model/Checkout/InputDetail.cs | 0 .../Model/Checkout/InstallmentOption.cs | 0 .../{ => src}/Model/Checkout/Installments.cs | 0 Adyen/{ => src}/Model/Checkout/Item.cs | 0 .../{ => src}/Model/Checkout/KlarnaDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Leg.cs | 0 Adyen/{ => src}/Model/Checkout/LineItem.cs | 0 .../ListStoredPaymentMethodsResponse.cs | 0 Adyen/{ => src}/Model/Checkout/Mandate.cs | 0 .../Model/Checkout/MasterpassDetails.cs | 0 .../{ => src}/Model/Checkout/MbwayDetails.cs | 0 .../Model/Checkout/MerchantDevice.cs | 0 .../Model/Checkout/MerchantRiskIndicator.cs | 0 .../Model/Checkout/MobilePayDetails.cs | 0 .../{ => src}/Model/Checkout/MolPayDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Name.cs | 0 .../Model/Checkout/OpenInvoiceDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Passenger.cs | 0 .../PayByBankAISDirectDebitDetails.cs | 0 .../Model/Checkout/PayByBankDetails.cs | 0 .../{ => src}/Model/Checkout/PayPalDetails.cs | 0 .../{ => src}/Model/Checkout/PayPayDetails.cs | 0 .../{ => src}/Model/Checkout/PayToDetails.cs | 0 .../Model/Checkout/PayUUpiDetails.cs | 0 .../Model/Checkout/PayWithGoogleDetails.cs | 0 .../Model/Checkout/PayWithGoogleDonations.cs | 0 Adyen/{ => src}/Model/Checkout/Payment.cs | 0 .../Checkout/PaymentAmountUpdateRequest.cs | 0 .../Checkout/PaymentAmountUpdateResponse.cs | 0 .../Model/Checkout/PaymentCancelRequest.cs | 0 .../Model/Checkout/PaymentCancelResponse.cs | 0 .../Model/Checkout/PaymentCaptureRequest.cs | 0 .../Model/Checkout/PaymentCaptureResponse.cs | 0 .../Checkout/PaymentCompletionDetails.cs | 0 .../Model/Checkout/PaymentDetails.cs | 0 .../Model/Checkout/PaymentDetailsRequest.cs | 0 .../Model/Checkout/PaymentDetailsResponse.cs | 0 .../Model/Checkout/PaymentLinkRequest.cs | 0 .../Model/Checkout/PaymentLinkResponse.cs | 0 .../{ => src}/Model/Checkout/PaymentMethod.cs | 0 .../Model/Checkout/PaymentMethodGroup.cs | 0 .../Model/Checkout/PaymentMethodIssuer.cs | 0 .../Model/Checkout/PaymentMethodToStore.cs | 0 .../Model/Checkout/PaymentMethodUPIApps.cs | 0 .../Model/Checkout/PaymentMethodsRequest.cs | 0 .../Model/Checkout/PaymentMethodsResponse.cs | 0 .../Model/Checkout/PaymentRefundRequest.cs | 0 .../Model/Checkout/PaymentRefundResponse.cs | 0 .../Model/Checkout/PaymentRequest.cs | 0 .../Model/Checkout/PaymentResponse.cs | 0 .../Model/Checkout/PaymentResponseAction.cs | 0 .../Model/Checkout/PaymentReversalRequest.cs | 0 .../Model/Checkout/PaymentReversalResponse.cs | 0 .../Checkout/PaypalUpdateOrderRequest.cs | 0 .../Checkout/PaypalUpdateOrderResponse.cs | 0 Adyen/{ => src}/Model/Checkout/Phone.cs | 0 Adyen/{ => src}/Model/Checkout/PixDetails.cs | 0 .../{ => src}/Model/Checkout/PixRecurring.cs | 0 .../Model/Checkout/PlatformChargebackLogic.cs | 0 Adyen/{ => src}/Model/Checkout/PseDetails.cs | 0 .../Model/Checkout/RakutenPayDetails.cs | 0 .../Model/Checkout/RatepayDetails.cs | 0 Adyen/{ => src}/Model/Checkout/Recurring.cs | 0 .../ResponseAdditionalData3DSecure.cs | 0 .../ResponseAdditionalDataBillingAddress.cs | 0 .../Checkout/ResponseAdditionalDataCard.cs | 0 .../Checkout/ResponseAdditionalDataCommon.cs | 0 .../ResponseAdditionalDataDomesticError.cs | 0 .../ResponseAdditionalDataInstallments.cs | 0 .../ResponseAdditionalDataNetworkTokens.cs | 0 .../Checkout/ResponseAdditionalDataOpi.cs | 0 .../Checkout/ResponseAdditionalDataSepa.cs | 0 .../Model/Checkout/ResponsePaymentMethod.cs | 0 Adyen/{ => src}/Model/Checkout/RiskData.cs | 0 .../Model/Checkout/RivertyDetails.cs | 0 .../Model/Checkout/SDKEphemPubKey.cs | 0 .../Model/Checkout/SamsungPayDetails.cs | 0 .../Model/Checkout/SepaDirectDebitDetails.cs | 0 .../{ => src}/Model/Checkout/ServiceError.cs | 0 .../Model/Checkout/SessionResultResponse.cs | 0 .../Checkout/ShopperInteractionDevice.cs | 0 Adyen/{ => src}/Model/Checkout/Split.cs | 0 Adyen/{ => src}/Model/Checkout/SplitAmount.cs | 0 .../StandalonePaymentCancelRequest.cs | 0 .../StandalonePaymentCancelResponse.cs | 0 .../Model/Checkout/StoredPaymentMethod.cs | 0 .../Checkout/StoredPaymentMethodDetails.cs | 0 .../Checkout/StoredPaymentMethodRequest.cs | 0 .../Checkout/StoredPaymentMethodResource.cs | 0 .../Model/Checkout/SubInputDetail.cs | 0 Adyen/{ => src}/Model/Checkout/SubMerchant.cs | 0 .../Model/Checkout/SubMerchantInfo.cs | 0 Adyen/{ => src}/Model/Checkout/Surcharge.cs | 0 Adyen/{ => src}/Model/Checkout/TaxTotal.cs | 0 .../Model/Checkout/ThreeDS2RequestData.cs | 0 .../Model/Checkout/ThreeDS2RequestFields.cs | 0 .../Model/Checkout/ThreeDS2ResponseData.cs | 0 .../Model/Checkout/ThreeDS2Result.cs | 0 .../Model/Checkout/ThreeDSRequestData.cs | 0 .../ThreeDSRequestorAuthenticationInfo.cs | 0 ...ThreeDSRequestorPriorAuthenticationInfo.cs | 0 .../Model/Checkout/ThreeDSecureData.cs | 0 Adyen/{ => src}/Model/Checkout/Ticket.cs | 0 .../{ => src}/Model/Checkout/TravelAgency.cs | 0 .../{ => src}/Model/Checkout/TwintDetails.cs | 0 .../Checkout/UpdatePaymentLinkRequest.cs | 0 .../Model/Checkout/UpiCollectDetails.cs | 0 .../Model/Checkout/UpiIntentDetails.cs | 0 .../Model/Checkout/UtilityRequest.cs | 0 .../Model/Checkout/UtilityResponse.cs | 0 .../{ => src}/Model/Checkout/VippsDetails.cs | 0 .../Model/Checkout/VisaCheckoutDetails.cs | 0 .../Model/Checkout/WeChatPayDetails.cs | 0 .../Checkout/WeChatPayMiniProgramDetails.cs | 0 Adyen/{ => src}/Model/Checkout/ZipDetails.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../ConfigurationWebhooks/AccountHolder.cs | 0 .../AccountHolderCapability.cs | 0 .../AccountHolderNotificationData.cs | 0 .../AccountHolderNotificationRequest.cs | 0 .../AccountSupportingEntityCapability.cs | 0 .../Model/ConfigurationWebhooks/Address.cs | 0 .../Model/ConfigurationWebhooks/Amount.cs | 0 .../ConfigurationWebhooks/Authentication.cs | 0 .../Model/ConfigurationWebhooks/Balance.cs | 0 .../ConfigurationWebhooks/BalanceAccount.cs | 0 .../BalanceAccountNotificationData.cs | 0 .../BalanceAccountNotificationRequest.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../BankAccountDetails.cs | 0 .../ConfigurationWebhooks/BulkAddress.cs | 0 .../CapabilityProblem.cs | 0 .../CapabilityProblemEntity.cs | 0 .../CapabilityProblemEntityRecursive.cs | 0 .../CapabilitySettings.cs | 0 .../Model/ConfigurationWebhooks/Card.cs | 0 .../CardConfiguration.cs | 0 .../ConfigurationWebhooks/CardOrderItem.cs | 0 .../CardOrderItemDeliveryStatus.cs | 0 .../CardOrderNotificationRequest.cs | 0 .../ConfigurationWebhooks/ContactDetails.cs | 0 .../ConfigurationWebhooks/DeliveryAddress.cs | 0 .../ConfigurationWebhooks/DeliveryContact.cs | 0 .../Model/ConfigurationWebhooks/Device.cs | 0 .../Model/ConfigurationWebhooks/Expiry.cs | 0 .../IbanAccountIdentification.cs | 0 .../Model/ConfigurationWebhooks/Name.cs | 0 .../NetworkTokenNotificationDataV2.cs | 0 .../NetworkTokenNotificationRequest.cs | 0 .../NetworkTokenRequestor.cs | 0 .../PaymentInstrument.cs | 0 ...ditionalBankAccountIdentificationsInner.cs | 0 .../PaymentInstrumentNotificationData.cs | 0 .../PaymentNotificationRequest.cs | 0 .../Model/ConfigurationWebhooks/Phone.cs | 0 .../ConfigurationWebhooks/PhoneNumber.cs | 0 .../PlatformPaymentConfiguration.cs | 0 .../RemediatingAction.cs | 0 .../Model/ConfigurationWebhooks/Resource.cs | 0 .../SweepConfigurationNotificationData.cs | 0 .../SweepConfigurationNotificationRequest.cs | 0 .../SweepConfigurationV2.cs | 0 .../SweepCounterparty.cs | 0 .../ConfigurationWebhooks/SweepSchedule.cs | 0 .../TokenAuthentication.cs | 0 .../ConfigurationWebhooks/ValidationFacts.cs | 0 .../VerificationDeadline.cs | 0 .../VerificationError.cs | 0 .../VerificationErrorRecursive.cs | 0 .../Model/ConfigurationWebhooks/Wallet.cs | 0 .../DataProtection/AbstractOpenAPISchema.cs | 0 .../Model/DataProtection/ServiceError.cs | 0 .../SubjectErasureByPspReferenceRequest.cs | 0 .../DataProtection/SubjectErasureResponse.cs | 0 .../DisputeWebhooks/AbstractOpenAPISchema.cs | 0 .../{ => src}/Model/DisputeWebhooks/Amount.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../DisputeEventNotification.cs | 0 .../DisputeNotificationRequest.cs | 0 .../Model/Disputes/AbstractOpenAPISchema.cs | 0 .../Model/Disputes/AcceptDisputeRequest.cs | 0 .../Model/Disputes/AcceptDisputeResponse.cs | 0 .../Model/Disputes/DefendDisputeRequest.cs | 0 .../Model/Disputes/DefendDisputeResponse.cs | 0 .../Model/Disputes/DefenseDocument.cs | 0 .../Model/Disputes/DefenseDocumentType.cs | 0 .../{ => src}/Model/Disputes/DefenseReason.cs | 0 .../Model/Disputes/DefenseReasonsRequest.cs | 0 .../Model/Disputes/DefenseReasonsResponse.cs | 0 .../Disputes/DeleteDefenseDocumentRequest.cs | 0 .../Disputes/DeleteDefenseDocumentResponse.cs | 0 .../Model/Disputes/DisputeServiceResult.cs | 0 .../{ => src}/Model/Disputes/ServiceError.cs | 0 .../Disputes/SupplyDefenseDocumentRequest.cs | 0 .../Disputes/SupplyDefenseDocumentResponse.cs | 0 Adyen/{ => src}/Model/Environment.cs | 0 .../AULocalAccountIdentification.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../AcceptTermsOfServiceRequest.cs | 0 .../AcceptTermsOfServiceResponse.cs | 0 .../AdditionalBankIdentification.cs | 0 .../Model/LegalEntityManagement/Address.cs | 0 .../Model/LegalEntityManagement/Amount.cs | 0 .../Model/LegalEntityManagement/Attachment.cs | 0 .../LegalEntityManagement/BankAccountInfo.cs | 0 .../BankAccountInfoAccountIdentification.cs | 0 .../Model/LegalEntityManagement/BirthData.cs | 0 .../LegalEntityManagement/BusinessLine.cs | 0 .../LegalEntityManagement/BusinessLineInfo.cs | 0 .../BusinessLineInfoUpdate.cs | 0 .../LegalEntityManagement/BusinessLines.cs | 0 .../CALocalAccountIdentification.cs | 0 .../CZLocalAccountIdentification.cs | 0 .../CalculatePciStatusRequest.cs | 0 .../CalculatePciStatusResponse.cs | 0 .../CalculateTermsOfServiceStatusResponse.cs | 0 .../CapabilityProblem.cs | 0 .../CapabilityProblemEntity.cs | 0 .../CapabilityProblemEntityRecursive.cs | 0 .../CapabilitySettings.cs | 0 ...eckTaxElectronicDeliveryConsentResponse.cs | 0 .../DKLocalAccountIdentification.cs | 0 .../DataReviewConfirmationResponse.cs | 0 .../Model/LegalEntityManagement/Document.cs | 0 .../LegalEntityManagement/DocumentPage.cs | 0 .../DocumentReference.cs | 0 .../LegalEntityManagement/EntityReference.cs | 0 .../LegalEntityManagement/FinancialReport.cs | 0 .../GeneratePciDescriptionRequest.cs | 0 .../GeneratePciDescriptionResponse.cs | 0 ...tAcceptedTermsOfServiceDocumentResponse.cs | 0 .../GetPciQuestionnaireInfosResponse.cs | 0 .../GetPciQuestionnaireResponse.cs | 0 ...etTermsOfServiceAcceptanceInfosResponse.cs | 0 .../GetTermsOfServiceDocumentRequest.cs | 0 .../GetTermsOfServiceDocumentResponse.cs | 0 .../HKLocalAccountIdentification.cs | 0 .../HULocalAccountIdentification.cs | 0 .../IbanAccountIdentification.cs | 0 .../IdentificationData.cs | 0 .../Model/LegalEntityManagement/Individual.cs | 0 .../LegalEntityManagement/LegalEntity.cs | 0 .../LegalEntityAssociation.cs | 0 .../LegalEntityCapability.cs | 0 .../LegalEntityManagement/LegalEntityInfo.cs | 0 .../LegalEntityInfoRequiredType.cs | 0 .../NOLocalAccountIdentification.cs | 0 .../NZLocalAccountIdentification.cs | 0 .../Model/LegalEntityManagement/Name.cs | 0 .../NumberAndBicAccountIdentification.cs | 0 .../LegalEntityManagement/OnboardingLink.cs | 0 .../OnboardingLinkInfo.cs | 0 .../OnboardingLinkSettings.cs | 0 .../LegalEntityManagement/OnboardingTheme.cs | 0 .../LegalEntityManagement/OnboardingThemes.cs | 0 .../LegalEntityManagement/Organization.cs | 0 .../LegalEntityManagement/OwnerEntity.cs | 0 .../PLLocalAccountIdentification.cs | 0 .../LegalEntityManagement/PciDocumentInfo.cs | 0 .../PciSigningRequest.cs | 0 .../PciSigningResponse.cs | 0 .../LegalEntityManagement/PhoneNumber.cs | 0 .../RemediatingAction.cs | 0 .../SELocalAccountIdentification.cs | 0 .../SGLocalAccountIdentification.cs | 0 .../LegalEntityManagement/ServiceError.cs | 0 .../SetTaxElectronicDeliveryConsentRequest.cs | 0 .../SoleProprietorship.cs | 0 .../LegalEntityManagement/SourceOfFunds.cs | 0 .../Model/LegalEntityManagement/StockData.cs | 0 .../SupportingEntityCapability.cs | 0 .../LegalEntityManagement/TaxInformation.cs | 0 .../TaxReportingClassification.cs | 0 .../TermsOfServiceAcceptanceInfo.cs | 0 .../TransferInstrument.cs | 0 .../TransferInstrumentInfo.cs | 0 .../TransferInstrumentReference.cs | 0 .../Model/LegalEntityManagement/Trust.cs | 0 .../UKLocalAccountIdentification.cs | 0 .../USLocalAccountIdentification.cs | 0 .../UndefinedBeneficiary.cs | 0 .../UnincorporatedPartnership.cs | 0 .../VerificationDeadline.cs | 0 .../VerificationError.cs | 0 .../VerificationErrorRecursive.cs | 0 .../VerificationErrors.cs | 0 .../Model/LegalEntityManagement/WebData.cs | 0 .../LegalEntityManagement/WebDataExemption.cs | 0 .../Model/Management/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/Management/AccelInfo.cs | 0 .../Model/Management/AdditionalCommission.cs | 0 .../Model/Management/AdditionalSettings.cs | 0 .../Management/AdditionalSettingsResponse.cs | 0 Adyen/{ => src}/Model/Management/Address.cs | 0 .../{ => src}/Model/Management/AffirmInfo.cs | 0 .../Model/Management/AfterpayTouchInfo.cs | 0 .../Model/Management/AllowedOrigin.cs | 0 .../Management/AllowedOriginsResponse.cs | 0 Adyen/{ => src}/Model/Management/AmexInfo.cs | 0 Adyen/{ => src}/Model/Management/Amount.cs | 0 .../{ => src}/Model/Management/AndroidApp.cs | 0 .../Model/Management/AndroidAppError.cs | 0 .../Model/Management/AndroidAppsResponse.cs | 0 .../Model/Management/AndroidCertificate.cs | 0 .../Management/AndroidCertificatesResponse.cs | 0 .../Model/Management/ApiCredential.cs | 0 .../Model/Management/ApiCredentialLinks.cs | 0 .../Model/Management/ApplePayInfo.cs | 0 Adyen/{ => src}/Model/Management/BcmcInfo.cs | 0 .../Management/BillingEntitiesResponse.cs | 0 .../Model/Management/BillingEntity.cs | 0 .../Model/Management/CardholderReceipt.cs | 0 .../Model/Management/CartesBancairesInfo.cs | 0 .../Model/Management/ClearpayInfo.cs | 0 .../{ => src}/Model/Management/Commission.cs | 0 Adyen/{ => src}/Model/Management/Company.cs | 0 .../Model/Management/CompanyApiCredential.cs | 0 .../Model/Management/CompanyLinks.cs | 0 .../{ => src}/Model/Management/CompanyUser.cs | 0 .../Model/Management/Connectivity.cs | 0 Adyen/{ => src}/Model/Management/Contact.cs | 0 .../Management/CreateAllowedOriginRequest.cs | 0 .../Management/CreateApiCredentialResponse.cs | 0 .../CreateCompanyApiCredentialRequest.cs | 0 .../CreateCompanyApiCredentialResponse.cs | 0 .../Management/CreateCompanyUserRequest.cs | 0 .../Management/CreateCompanyUserResponse.cs | 0 .../Management/CreateCompanyWebhookRequest.cs | 0 .../CreateMerchantApiCredentialRequest.cs | 0 .../Model/Management/CreateMerchantRequest.cs | 0 .../Management/CreateMerchantResponse.cs | 0 .../Management/CreateMerchantUserRequest.cs | 0 .../CreateMerchantWebhookRequest.cs | 0 .../Model/Management/CreateUserResponse.cs | 0 Adyen/{ => src}/Model/Management/Currency.cs | 0 .../Model/Management/CustomNotification.cs | 0 .../{ => src}/Model/Management/DataCenter.cs | 0 .../{ => src}/Model/Management/DinersInfo.cs | 0 Adyen/{ => src}/Model/Management/EventUrl.cs | 0 .../Management/ExternalTerminalAction.cs | 0 Adyen/{ => src}/Model/Management/File.cs | 0 .../Management/GenerateApiKeyResponse.cs | 0 .../Management/GenerateClientKeyResponse.cs | 0 .../Management/GenerateHmacKeyResponse.cs | 0 .../Model/Management/GenericPmWithTdiInfo.cs | 0 .../{ => src}/Model/Management/GiroPayInfo.cs | 0 .../Model/Management/GooglePayInfo.cs | 0 Adyen/{ => src}/Model/Management/Gratuity.cs | 0 Adyen/{ => src}/Model/Management/Hardware.cs | 0 Adyen/{ => src}/Model/Management/IdName.cs | 0 .../Management/InstallAndroidAppDetails.cs | 0 .../InstallAndroidCertificateDetails.cs | 0 .../Model/Management/InvalidField.cs | 0 Adyen/{ => src}/Model/Management/JCBInfo.cs | 0 Adyen/{ => src}/Model/Management/Key.cs | 0 .../{ => src}/Model/Management/KlarnaInfo.cs | 0 Adyen/{ => src}/Model/Management/Links.cs | 0 .../Model/Management/LinksElement.cs | 0 .../ListCompanyApiCredentialsResponse.cs | 0 .../Model/Management/ListCompanyResponse.cs | 0 .../Management/ListCompanyUsersResponse.cs | 0 .../ListExternalTerminalActionsResponse.cs | 0 .../ListMerchantApiCredentialsResponse.cs | 0 .../Model/Management/ListMerchantResponse.cs | 0 .../Management/ListMerchantUsersResponse.cs | 0 .../Model/Management/ListStoresResponse.cs | 0 .../Model/Management/ListTerminalsResponse.cs | 0 .../Model/Management/ListWebhooksResponse.cs | 0 .../Model/Management/Localization.cs | 0 Adyen/{ => src}/Model/Management/Logo.cs | 0 .../Model/Management/MeApiCredential.cs | 0 .../Model/Management/MealVoucherFRInfo.cs | 0 Adyen/{ => src}/Model/Management/Merchant.cs | 0 .../Model/Management/MerchantLinks.cs | 0 .../Management/MinorUnitsMonetaryValue.cs | 0 .../Model/Management/ModelConfiguration.cs | 0 Adyen/{ => src}/Model/Management/Name.cs | 0 Adyen/{ => src}/Model/Management/Name2.cs | 0 Adyen/{ => src}/Model/Management/Nexo.cs | 0 .../Model/Management/Notification.cs | 0 .../Model/Management/NotificationUrl.cs | 0 Adyen/{ => src}/Model/Management/NyceInfo.cs | 0 .../Model/Management/OfflineProcessing.cs | 0 Adyen/{ => src}/Model/Management/Opi.cs | 0 Adyen/{ => src}/Model/Management/OrderItem.cs | 0 .../Model/Management/PaginationLinks.cs | 0 Adyen/{ => src}/Model/Management/Passcodes.cs | 0 .../{ => src}/Model/Management/PayAtTable.cs | 0 Adyen/{ => src}/Model/Management/PayMeInfo.cs | 0 .../{ => src}/Model/Management/PayPalInfo.cs | 0 Adyen/{ => src}/Model/Management/PayToInfo.cs | 0 Adyen/{ => src}/Model/Management/Payment.cs | 0 .../Model/Management/PaymentMethod.cs | 0 .../Model/Management/PaymentMethodResponse.cs | 0 .../Management/PaymentMethodSetupInfo.cs | 0 .../Model/Management/PayoutSettings.cs | 0 .../Model/Management/PayoutSettingsRequest.cs | 0 .../Management/PayoutSettingsResponse.cs | 0 Adyen/{ => src}/Model/Management/Profile.cs | 0 Adyen/{ => src}/Model/Management/PulseInfo.cs | 0 .../Model/Management/ReceiptOptions.cs | 0 .../Model/Management/ReceiptPrinting.cs | 0 .../{ => src}/Model/Management/Referenced.cs | 0 Adyen/{ => src}/Model/Management/Refunds.cs | 0 .../Model/Management/ReleaseUpdateDetails.cs | 0 .../Management/ReprocessAndroidAppResponse.cs | 0 .../Management/RequestActivationResponse.cs | 0 .../Model/Management/RestServiceError.cs | 0 .../ScheduleTerminalActionsRequest.cs | 0 ...duleTerminalActionsRequestActionDetails.cs | 0 .../ScheduleTerminalActionsResponse.cs | 0 Adyen/{ => src}/Model/Management/Settings.cs | 0 .../Model/Management/ShippingLocation.cs | 0 .../Management/ShippingLocationsResponse.cs | 0 Adyen/{ => src}/Model/Management/Signature.cs | 0 .../{ => src}/Model/Management/SodexoInfo.cs | 0 .../{ => src}/Model/Management/SofortInfo.cs | 0 .../Model/Management/SplitConfiguration.cs | 0 .../Management/SplitConfigurationList.cs | 0 .../Management/SplitConfigurationLogic.cs | 0 .../Management/SplitConfigurationRule.cs | 0 .../{ => src}/Model/Management/Standalone.cs | 0 Adyen/{ => src}/Model/Management/StarInfo.cs | 0 Adyen/{ => src}/Model/Management/Store.cs | 0 .../Model/Management/StoreAndForward.cs | 0 .../Model/Management/StoreCreationRequest.cs | 0 .../StoreCreationWithMerchantCodeRequest.cs | 0 .../Model/Management/StoreLocation.cs | 0 .../Management/StoreSplitConfiguration.cs | 0 .../Model/Management/SupportedCardTypes.cs | 0 Adyen/{ => src}/Model/Management/Surcharge.cs | 0 Adyen/{ => src}/Model/Management/SwishInfo.cs | 0 Adyen/{ => src}/Model/Management/TapToPay.cs | 0 Adyen/{ => src}/Model/Management/Terminal.cs | 0 .../TerminalActionScheduleDetail.cs | 0 .../Model/Management/TerminalAssignment.cs | 0 .../Model/Management/TerminalConnectivity.cs | 0 .../TerminalConnectivityBluetooth.cs | 0 .../TerminalConnectivityCellular.cs | 0 .../TerminalConnectivityEthernet.cs | 0 .../Management/TerminalConnectivityWifi.cs | 0 .../Model/Management/TerminalInstructions.cs | 0 .../Management/TerminalModelsResponse.cs | 0 .../Model/Management/TerminalOrder.cs | 0 .../Model/Management/TerminalOrderRequest.cs | 0 .../Management/TerminalOrdersResponse.cs | 0 .../Model/Management/TerminalProduct.cs | 0 .../Model/Management/TerminalProductPrice.cs | 0 .../Management/TerminalProductsResponse.cs | 0 .../Management/TerminalReassignmentRequest.cs | 0 .../Management/TerminalReassignmentTarget.cs | 0 .../Model/Management/TerminalSettings.cs | 0 .../Management/TestCompanyWebhookRequest.cs | 0 .../{ => src}/Model/Management/TestOutput.cs | 0 .../Model/Management/TestWebhookRequest.cs | 0 .../Model/Management/TestWebhookResponse.cs | 0 .../{ => src}/Model/Management/TicketInfo.cs | 0 Adyen/{ => src}/Model/Management/Timeouts.cs | 0 .../Management/TransactionDescriptionInfo.cs | 0 Adyen/{ => src}/Model/Management/TwintInfo.cs | 0 .../Management/UninstallAndroidAppDetails.cs | 0 .../UninstallAndroidCertificateDetails.cs | 0 .../Model/Management/UpdatableAddress.cs | 0 .../UpdateCompanyApiCredentialRequest.cs | 0 .../Management/UpdateCompanyUserRequest.cs | 0 .../Management/UpdateCompanyWebhookRequest.cs | 0 .../UpdateMerchantApiCredentialRequest.cs | 0 .../Management/UpdateMerchantUserRequest.cs | 0 .../UpdateMerchantWebhookRequest.cs | 0 .../Management/UpdatePaymentMethodInfo.cs | 0 .../Management/UpdatePayoutSettingsRequest.cs | 0 .../UpdateSplitConfigurationLogicRequest.cs | 0 .../UpdateSplitConfigurationRequest.cs | 0 .../UpdateSplitConfigurationRuleRequest.cs | 0 .../Model/Management/UpdateStoreRequest.cs | 0 .../Management/UploadAndroidAppResponse.cs | 0 .../UploadAndroidCertificateResponse.cs | 0 Adyen/{ => src}/Model/Management/Url.cs | 0 Adyen/{ => src}/Model/Management/User.cs | 0 Adyen/{ => src}/Model/Management/VippsInfo.cs | 0 .../Model/Management/WeChatPayInfo.cs | 0 .../Model/Management/WeChatPayPosInfo.cs | 0 Adyen/{ => src}/Model/Management/Webhook.cs | 0 .../Model/Management/WebhookLinks.cs | 0 .../Model/Management/WifiProfiles.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../AccountCapabilityData.cs | 0 .../AccountCreateNotificationData.cs | 0 .../AccountNotificationResponse.cs | 0 .../AccountUpdateNotificationData.cs | 0 .../ManagementWebhooks/CapabilityProblem.cs | 0 .../CapabilityProblemEntity.cs | 0 .../CapabilityProblemEntityRecursive.cs | 0 .../MerchantCreatedNotificationRequest.cs | 0 .../MerchantUpdatedNotificationRequest.cs | 0 .../MidServiceNotificationData.cs | 0 ...PaymentMethodCreatedNotificationRequest.cs | 0 .../PaymentMethodNotificationResponse.cs | 0 ...MethodRequestRemovedNotificationRequest.cs | 0 ...dScheduledForRemovalNotificationRequest.cs | 0 .../ManagementWebhooks/RemediatingAction.cs | 0 .../TerminalAssignmentNotificationRequest.cs | 0 .../TerminalAssignmentNotificationResponse.cs | 0 .../TerminalBoardingData.cs | 0 .../TerminalBoardingNotificationRequest.cs | 0 .../TerminalBoardingNotificationResponse.cs | 0 .../TerminalSettingsData.cs | 0 .../TerminalSettingsNotificationRequest.cs | 0 .../TerminalSettingsNotificationResponse.cs | 0 .../ManagementWebhooks/VerificationError.cs | 0 .../VerificationErrorRecursive.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../NegativeBalanceWarningWebhooks/Amount.cs | 0 ...anceCompensationWarningNotificationData.cs | 0 ...eCompensationWarningNotificationRequest.cs | 0 .../Resource.cs | 0 .../ResourceReference.cs | 0 .../Model/Notification/NotificationRequest.cs | 0 .../Notification/NotificationRequestConst.cs | 0 .../Notification/NotificationRequestItem.cs | 0 .../NotificationRequestItemContainer.cs | 0 .../Model/Payment/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/Payment/AccountInfo.cs | 0 Adyen/{ => src}/Model/Payment/AcctInfo.cs | 0 .../Model/Payment/AdditionalData3DSecure.cs | 0 .../Model/Payment/AdditionalDataAirline.cs | 0 .../Model/Payment/AdditionalDataCarRental.cs | 0 .../Model/Payment/AdditionalDataCommon.cs | 0 .../Model/Payment/AdditionalDataLevel23.cs | 0 .../Model/Payment/AdditionalDataLodging.cs | 0 .../Payment/AdditionalDataModifications.cs | 0 .../Payment/AdditionalDataOpenInvoice.cs | 0 .../Model/Payment/AdditionalDataOpi.cs | 0 .../Model/Payment/AdditionalDataRatepay.cs | 0 .../Model/Payment/AdditionalDataRetry.cs | 0 .../Model/Payment/AdditionalDataRisk.cs | 0 .../Payment/AdditionalDataRiskStandalone.cs | 0 .../Payment/AdditionalDataSubMerchant.cs | 0 .../AdditionalDataTemporaryServices.cs | 0 .../Model/Payment/AdditionalDataWallets.cs | 0 Adyen/{ => src}/Model/Payment/Address.cs | 0 .../Payment/AdjustAuthorisationRequest.cs | 0 Adyen/{ => src}/Model/Payment/Amount.cs | 0 .../Model/Payment/ApplicationInfo.cs | 0 .../Payment/AuthenticationResultRequest.cs | 0 .../Payment/AuthenticationResultResponse.cs | 0 Adyen/{ => src}/Model/Payment/BankAccount.cs | 0 Adyen/{ => src}/Model/Payment/BrowserInfo.cs | 0 .../Model/Payment/CancelOrRefundRequest.cs | 0 .../{ => src}/Model/Payment/CancelRequest.cs | 0 .../{ => src}/Model/Payment/CaptureRequest.cs | 0 Adyen/{ => src}/Model/Payment/Card.cs | 0 Adyen/{ => src}/Model/Payment/CommonField.cs | 0 .../Model/Payment/DeviceRenderOptions.cs | 0 .../Model/Payment/DonationRequest.cs | 0 .../Model/Payment/ExternalPlatform.cs | 0 Adyen/{ => src}/Model/Payment/ForexQuote.cs | 0 .../Model/Payment/FraudCheckResult.cs | 0 .../Model/Payment/FraudCheckResultWrapper.cs | 0 Adyen/{ => src}/Model/Payment/FraudResult.cs | 0 .../Model/Payment/FundDestination.cs | 0 Adyen/{ => src}/Model/Payment/FundSource.cs | 0 Adyen/{ => src}/Model/Payment/Installments.cs | 0 Adyen/{ => src}/Model/Payment/Mandate.cs | 0 .../{ => src}/Model/Payment/MerchantDevice.cs | 0 .../Model/Payment/MerchantRiskIndicator.cs | 0 .../Model/Payment/ModificationResult.cs | 0 Adyen/{ => src}/Model/Payment/Name.cs | 0 .../{ => src}/Model/Payment/PaymentRequest.cs | 0 .../Model/Payment/PaymentRequest3d.cs | 0 .../Model/Payment/PaymentRequest3ds2.cs | 0 .../{ => src}/Model/Payment/PaymentResult.cs | 0 Adyen/{ => src}/Model/Payment/Phone.cs | 0 .../Model/Payment/PlatformChargebackLogic.cs | 0 Adyen/{ => src}/Model/Payment/Recurring.cs | 0 .../{ => src}/Model/Payment/RefundRequest.cs | 0 .../Payment/ResponseAdditionalData3DSecure.cs | 0 .../ResponseAdditionalDataBillingAddress.cs | 0 .../Payment/ResponseAdditionalDataCard.cs | 0 .../Payment/ResponseAdditionalDataCommon.cs | 0 .../ResponseAdditionalDataDomesticError.cs | 0 .../ResponseAdditionalDataInstallments.cs | 0 .../ResponseAdditionalDataNetworkTokens.cs | 0 .../Payment/ResponseAdditionalDataOpi.cs | 0 .../Payment/ResponseAdditionalDataSepa.cs | 0 .../{ => src}/Model/Payment/SDKEphemPubKey.cs | 0 .../SecureRemoteCommerceCheckoutData.cs | 0 Adyen/{ => src}/Model/Payment/ServiceError.cs | 0 .../Model/Payment/ShopperInteractionDevice.cs | 0 Adyen/{ => src}/Model/Payment/Split.cs | 0 Adyen/{ => src}/Model/Payment/SplitAmount.cs | 0 Adyen/{ => src}/Model/Payment/SubMerchant.cs | 0 .../Model/Payment/TechnicalCancelRequest.cs | 0 .../{ => src}/Model/Payment/ThreeDS1Result.cs | 0 .../Model/Payment/ThreeDS2RequestData.cs | 0 .../{ => src}/Model/Payment/ThreeDS2Result.cs | 0 .../Model/Payment/ThreeDS2ResultRequest.cs | 0 .../Model/Payment/ThreeDS2ResultResponse.cs | 0 .../ThreeDSRequestorAuthenticationInfo.cs | 0 ...ThreeDSRequestorPriorAuthenticationInfo.cs | 0 .../Model/Payment/ThreeDSecureData.cs | 0 .../Model/Payment/VoidPendingRefundRequest.cs | 0 .../PaymentsApp/AbstractOpenAPISchema.cs | 0 .../Model/PaymentsApp/BoardingTokenRequest.cs | 0 .../PaymentsApp/BoardingTokenResponse.cs | 0 .../PaymentsApp/DefaultErrorResponseEntity.cs | 0 .../Model/PaymentsApp/InvalidField.cs | 0 .../Model/PaymentsApp/PaymentsAppDto.cs | 0 .../Model/PaymentsApp/PaymentsAppResponse.cs | 0 .../Model/Payout/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/Payout/Address.cs | 0 Adyen/{ => src}/Model/Payout/Amount.cs | 0 Adyen/{ => src}/Model/Payout/BankAccount.cs | 0 Adyen/{ => src}/Model/Payout/Card.cs | 0 .../Model/Payout/FraudCheckResult.cs | 0 .../Model/Payout/FraudCheckResultWrapper.cs | 0 Adyen/{ => src}/Model/Payout/FraudResult.cs | 0 Adyen/{ => src}/Model/Payout/FundSource.cs | 0 Adyen/{ => src}/Model/Payout/ModifyRequest.cs | 0 .../{ => src}/Model/Payout/ModifyResponse.cs | 0 Adyen/{ => src}/Model/Payout/Name.cs | 0 Adyen/{ => src}/Model/Payout/PayoutRequest.cs | 0 .../{ => src}/Model/Payout/PayoutResponse.cs | 0 Adyen/{ => src}/Model/Payout/Recurring.cs | 0 .../Payout/ResponseAdditionalData3DSecure.cs | 0 .../ResponseAdditionalDataBillingAddress.cs | 0 .../Payout/ResponseAdditionalDataCard.cs | 0 .../Payout/ResponseAdditionalDataCommon.cs | 0 .../ResponseAdditionalDataDomesticError.cs | 0 .../ResponseAdditionalDataInstallments.cs | 0 .../ResponseAdditionalDataNetworkTokens.cs | 0 .../Model/Payout/ResponseAdditionalDataOpi.cs | 0 .../Payout/ResponseAdditionalDataSepa.cs | 0 Adyen/{ => src}/Model/Payout/ServiceError.cs | 0 .../Payout/StoreDetailAndSubmitRequest.cs | 0 .../Payout/StoreDetailAndSubmitResponse.cs | 0 .../Model/Payout/StoreDetailRequest.cs | 0 .../Model/Payout/StoreDetailResponse.cs | 0 Adyen/{ => src}/Model/Payout/SubmitRequest.cs | 0 .../{ => src}/Model/Payout/SubmitResponse.cs | 0 .../PlatformsAccount/AbstractOpenAPISchema.cs | 0 .../Model/PlatformsAccount/Account.cs | 0 .../Model/PlatformsAccount/AccountEvent.cs | 0 .../PlatformsAccount/AccountHolderDetails.cs | 0 .../PlatformsAccount/AccountHolderStatus.cs | 0 .../PlatformsAccount/AccountPayoutState.cs | 0 .../AccountProcessingState.cs | 0 .../Model/PlatformsAccount/Amount.cs | 0 .../PlatformsAccount/BankAccountDetail.cs | 0 .../Model/PlatformsAccount/BusinessDetails.cs | 0 .../CloseAccountHolderRequest.cs | 0 .../CloseAccountHolderResponse.cs | 0 .../PlatformsAccount/CloseAccountRequest.cs | 0 .../PlatformsAccount/CloseAccountResponse.cs | 0 .../PlatformsAccount/CloseStoresRequest.cs | 0 .../CreateAccountHolderRequest.cs | 0 .../CreateAccountHolderResponse.cs | 0 .../PlatformsAccount/CreateAccountRequest.cs | 0 .../PlatformsAccount/CreateAccountResponse.cs | 0 .../DeleteBankAccountRequest.cs | 0 .../DeleteLegalArrangementRequest.cs | 0 .../DeletePayoutMethodRequest.cs | 0 .../DeleteShareholderRequest.cs | 0 .../DeleteSignatoriesRequest.cs | 0 .../Model/PlatformsAccount/DocumentDetail.cs | 0 .../Model/PlatformsAccount/ErrorFieldType.cs | 0 .../Model/PlatformsAccount/FieldType.cs | 0 .../Model/PlatformsAccount/GenericResponse.cs | 0 .../GetAccountHolderRequest.cs | 0 .../GetAccountHolderResponse.cs | 0 .../GetAccountHolderStatusResponse.cs | 0 .../PlatformsAccount/GetTaxFormRequest.cs | 0 .../PlatformsAccount/GetTaxFormResponse.cs | 0 .../GetUploadedDocumentsRequest.cs | 0 .../GetUploadedDocumentsResponse.cs | 0 .../PlatformsAccount/IndividualDetails.cs | 0 .../Model/PlatformsAccount/KYCCheckResult.cs | 0 .../PlatformsAccount/KYCCheckStatusData.cs | 0 .../Model/PlatformsAccount/KYCCheckSummary.cs | 0 .../KYCLegalArrangementCheckResult.cs | 0 .../KYCLegalArrangementEntityCheckResult.cs | 0 .../KYCPayoutMethodCheckResult.cs | 0 .../KYCShareholderCheckResult.cs | 0 .../KYCSignatoryCheckResult.cs | 0 .../KYCUltimateParentCompanyCheckResult.cs | 0 .../PlatformsAccount/KYCVerificationResult.cs | 0 .../LegalArrangementDetail.cs | 0 .../LegalArrangementEntityDetail.cs | 0 .../LegalArrangementRequest.cs | 0 .../PlatformsAccount/MigratedAccounts.cs | 0 .../PlatformsAccount/MigratedShareholders.cs | 0 .../Model/PlatformsAccount/MigratedStores.cs | 0 .../Model/PlatformsAccount/MigrationData.cs | 0 .../Model/PlatformsAccount/PayoutMethod.cs | 0 .../PayoutScheduleResponse.cs | 0 .../PerformVerificationRequest.cs | 0 .../PlatformsAccount/PersonalDocumentData.cs | 0 .../Model/PlatformsAccount/ServiceError.cs | 0 .../PlatformsAccount/ShareholderContact.cs | 0 .../PlatformsAccount/SignatoryContact.cs | 0 .../Model/PlatformsAccount/StoreDetail.cs | 0 .../SuspendAccountHolderRequest.cs | 0 .../SuspendAccountHolderResponse.cs | 0 .../PlatformsAccount/UltimateParentCompany.cs | 0 .../UltimateParentCompanyBusinessDetails.cs | 0 .../UnSuspendAccountHolderRequest.cs | 0 .../UnSuspendAccountHolderResponse.cs | 0 .../UpdateAccountHolderRequest.cs | 0 .../UpdateAccountHolderResponse.cs | 0 .../UpdateAccountHolderStateRequest.cs | 0 .../PlatformsAccount/UpdateAccountRequest.cs | 0 .../PlatformsAccount/UpdateAccountResponse.cs | 0 .../UpdatePayoutScheduleRequest.cs | 0 .../PlatformsAccount/UploadDocumentRequest.cs | 0 .../Model/PlatformsAccount/ViasAddress.cs | 0 .../Model/PlatformsAccount/ViasName.cs | 0 .../PlatformsAccount/ViasPersonalData.cs | 0 .../Model/PlatformsAccount/ViasPhoneNumber.cs | 0 .../PlatformsFund/AbstractOpenAPISchema.cs | 0 .../PlatformsFund/AccountDetailBalance.cs | 0 .../AccountHolderBalanceRequest.cs | 0 .../AccountHolderBalanceResponse.cs | 0 .../AccountHolderTransactionListRequest.cs | 0 .../AccountHolderTransactionListResponse.cs | 0 .../PlatformsFund/AccountTransactionList.cs | 0 Adyen/{ => src}/Model/PlatformsFund/Amount.cs | 0 .../Model/PlatformsFund/BankAccountDetail.cs | 0 .../DebitAccountHolderRequest.cs | 0 .../DebitAccountHolderResponse.cs | 0 .../Model/PlatformsFund/DetailBalance.cs | 0 .../Model/PlatformsFund/ErrorFieldType.cs | 0 .../Model/PlatformsFund/FieldType.cs | 0 .../PayoutAccountHolderRequest.cs | 0 .../PayoutAccountHolderResponse.cs | 0 .../RefundFundsTransferRequest.cs | 0 .../RefundFundsTransferResponse.cs | 0 .../RefundNotPaidOutTransfersRequest.cs | 0 .../RefundNotPaidOutTransfersResponse.cs | 0 .../Model/PlatformsFund/ServiceError.cs | 0 .../PlatformsFund/SetupBeneficiaryRequest.cs | 0 .../PlatformsFund/SetupBeneficiaryResponse.cs | 0 Adyen/{ => src}/Model/PlatformsFund/Split.cs | 0 .../Model/PlatformsFund/SplitAmount.cs | 0 .../Model/PlatformsFund/Transaction.cs | 0 .../TransactionListForAccount.cs | 0 .../PlatformsFund/TransferFundsRequest.cs | 0 .../PlatformsFund/TransferFundsResponse.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../CollectInformation.cs | 0 .../ErrorFieldType.cs | 0 .../FieldType.cs | 0 .../GetOnboardingUrlRequest.cs | 0 .../GetOnboardingUrlResponse.cs | 0 .../GetPciUrlRequest.cs | 0 .../GetPciUrlResponse.cs | 0 .../ServiceError.cs | 0 .../ShowPages.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../CreateNotificationConfigurationRequest.cs | 0 .../DeleteNotificationConfigurationRequest.cs | 0 .../ErrorFieldType.cs | 0 .../ExchangeMessage.cs | 0 .../FieldType.cs | 0 .../GenericResponse.cs | 0 ...etNotificationConfigurationListResponse.cs | 0 .../GetNotificationConfigurationRequest.cs | 0 .../GetNotificationConfigurationResponse.cs | 0 .../NotificationConfigurationDetails.cs | 0 .../NotificationEventConfiguration.cs | 0 .../ServiceError.cs | 0 .../TestNotificationConfigurationRequest.cs | 0 .../TestNotificationConfigurationResponse.cs | 0 .../UpdateNotificationConfigurationRequest.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../AccountCloseNotification.cs | 0 .../AccountCreateNotification.cs | 0 .../Model/PlatformsWebhooks/AccountEvent.cs | 0 .../AccountFundsBelowThresholdNotification.cs | 0 ...tFundsBelowThresholdNotificationContent.cs | 0 .../AccountHolderCreateNotification.cs | 0 .../PlatformsWebhooks/AccountHolderDetails.cs | 0 .../AccountHolderPayoutNotification.cs | 0 .../AccountHolderPayoutNotificationContent.cs | 0 .../PlatformsWebhooks/AccountHolderStatus.cs | 0 .../AccountHolderStatusChangeNotification.cs | 0 ...ntHolderStatusChangeNotificationContent.cs | 0 ...ountHolderStoreStatusChangeNotification.cs | 0 ...derStoreStatusChangeNotificationContent.cs | 0 ...countHolderUpcomingDeadlineNotification.cs | 0 ...lderUpcomingDeadlineNotificationContent.cs | 0 .../AccountHolderUpdateNotification.cs | 0 .../AccountHolderVerificationNotification.cs | 0 ...ntHolderVerificationNotificationContent.cs | 0 .../PlatformsWebhooks/AccountPayoutState.cs | 0 .../AccountProcessingState.cs | 0 .../AccountUpdateNotification.cs | 0 .../Model/PlatformsWebhooks/Amount.cs | 0 .../PlatformsWebhooks/BankAccountDetail.cs | 0 .../BeneficiarySetupNotification.cs | 0 .../BeneficiarySetupNotificationContent.cs | 0 .../PlatformsWebhooks/BusinessDetails.cs | 0 .../PlatformsWebhooks/CloseAccountResponse.cs | 0 .../CompensateNegativeBalanceNotification.cs | 0 ...nsateNegativeBalanceNotificationContent.cs | 0 ...ensateNegativeBalanceNotificationRecord.cs | 0 .../CreateAccountHolderResponse.cs | 0 .../CreateAccountResponse.cs | 0 .../DirectDebitInitiatedNotification.cs | 0 ...DirectDebitInitiatedNotificationContent.cs | 0 .../Model/PlatformsWebhooks/ErrorFieldType.cs | 0 .../Model/PlatformsWebhooks/FieldType.cs | 0 .../PlatformsWebhooks/IndividualDetails.cs | 0 .../Model/PlatformsWebhooks/KYCCheckResult.cs | 0 .../PlatformsWebhooks/KYCCheckStatusData.cs | 0 .../PlatformsWebhooks/KYCCheckSummary.cs | 0 .../KYCLegalArrangementCheckResult.cs | 0 .../KYCLegalArrangementEntityCheckResult.cs | 0 .../KYCPayoutMethodCheckResult.cs | 0 .../KYCShareholderCheckResult.cs | 0 .../KYCSignatoryCheckResult.cs | 0 .../KYCUltimateParentCompanyCheckResult.cs | 0 .../KYCVerificationResult.cs | 0 .../LegalArrangementDetail.cs | 0 .../LegalArrangementEntityDetail.cs | 0 .../Model/PlatformsWebhooks/LocalDate.cs | 0 .../Model/PlatformsWebhooks/Message.cs | 0 .../NotificationErrorContainer.cs | 0 .../PlatformsWebhooks/NotificationResponse.cs | 0 .../PlatformsWebhooks/OperationStatus.cs | 0 .../PaymentFailureNotification.cs | 0 .../PaymentFailureNotificationContent.cs | 0 .../Model/PlatformsWebhooks/PayoutMethod.cs | 0 .../PayoutScheduleResponse.cs | 0 .../PlatformsWebhooks/PersonalDocumentData.cs | 0 .../RefundFundsTransferNotification.cs | 0 .../RefundFundsTransferNotificationContent.cs | 0 .../Model/PlatformsWebhooks/RefundResult.cs | 0 .../ReportAvailableNotification.cs | 0 .../ReportAvailableNotificationContent.cs | 0 .../ScheduledRefundsNotification.cs | 0 .../ScheduledRefundsNotificationContent.cs | 0 .../PlatformsWebhooks/ShareholderContact.cs | 0 .../PlatformsWebhooks/SignatoryContact.cs | 0 .../Model/PlatformsWebhooks/Split.cs | 0 .../Model/PlatformsWebhooks/SplitAmount.cs | 0 .../Model/PlatformsWebhooks/StoreDetail.cs | 0 .../Model/PlatformsWebhooks/Transaction.cs | 0 .../TransferFundsNotification.cs | 0 .../TransferFundsNotificationContent.cs | 0 .../UltimateParentCompany.cs | 0 .../UltimateParentCompanyBusinessDetails.cs | 0 .../UpdateAccountHolderResponse.cs | 0 .../UpdateAccountResponse.cs | 0 .../Model/PlatformsWebhooks/ViasAddress.cs | 0 .../Model/PlatformsWebhooks/ViasName.cs | 0 .../PlatformsWebhooks/ViasPersonalData.cs | 0 .../PlatformsWebhooks/ViasPhoneNumber.cs | 0 .../Model/PosMobile/AbstractOpenAPISchema.cs | 0 .../Model/PosMobile/CreateSessionRequest.cs | 0 .../Model/PosMobile/CreateSessionResponse.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../Model/PosTerminalManagement/Address.cs | 0 .../AssignTerminalsRequest.cs | 0 .../AssignTerminalsResponse.cs | 0 .../FindTerminalRequest.cs | 0 .../FindTerminalResponse.cs | 0 .../GetStoresUnderAccountRequest.cs | 0 .../GetStoresUnderAccountResponse.cs | 0 .../GetTerminalDetailsRequest.cs | 0 .../GetTerminalDetailsResponse.cs | 0 .../GetTerminalsUnderAccountRequest.cs | 0 .../GetTerminalsUnderAccountResponse.cs | 0 .../PosTerminalManagement/MerchantAccount.cs | 0 .../PosTerminalManagement/ServiceError.cs | 0 .../Model/PosTerminalManagement/Store.cs | 0 .../Model/Recurring/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/Recurring/Address.cs | 0 Adyen/{ => src}/Model/Recurring/Amount.cs | 0 .../{ => src}/Model/Recurring/BankAccount.cs | 0 Adyen/{ => src}/Model/Recurring/Card.cs | 0 .../Model/Recurring/CreatePermitRequest.cs | 0 .../Model/Recurring/CreatePermitResult.cs | 0 .../Model/Recurring/DisablePermitRequest.cs | 0 .../Model/Recurring/DisablePermitResult.cs | 0 .../Model/Recurring/DisableRequest.cs | 0 .../Model/Recurring/DisableResult.cs | 0 Adyen/{ => src}/Model/Recurring/Name.cs | 0 .../Model/Recurring/NotifyShopperRequest.cs | 0 .../Model/Recurring/NotifyShopperResult.cs | 0 Adyen/{ => src}/Model/Recurring/Permit.cs | 0 .../Model/Recurring/PermitRestriction.cs | 0 .../{ => src}/Model/Recurring/PermitResult.cs | 0 Adyen/{ => src}/Model/Recurring/Recurring.cs | 0 .../Model/Recurring/RecurringDetail.cs | 0 .../Model/Recurring/RecurringDetailWrapper.cs | 0 .../Recurring/RecurringDetailsRequest.cs | 0 .../Model/Recurring/RecurringDetailsResult.cs | 0 .../ScheduleAccountUpdaterRequest.cs | 0 .../Recurring/ScheduleAccountUpdaterResult.cs | 0 .../{ => src}/Model/Recurring/ServiceError.cs | 0 .../{ => src}/Model/Recurring/TokenDetails.cs | 0 .../ReportWebhooks/AbstractOpenAPISchema.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../ReportWebhooks/ReportNotificationData.cs | 0 .../ReportNotificationRequest.cs | 0 .../Model/ReportWebhooks/Resource.cs | 0 .../Model/ReportWebhooks/ResourceReference.cs | 0 Adyen/{ => src}/Model/RequestOptions.cs | 0 .../StoredValue/AbstractOpenAPISchema.cs | 0 Adyen/{ => src}/Model/StoredValue/Amount.cs | 0 .../Model/StoredValue/ServiceError.cs | 0 .../StoredValueBalanceCheckRequest.cs | 0 .../StoredValueBalanceCheckResponse.cs | 0 .../StoredValueBalanceMergeRequest.cs | 0 .../StoredValueBalanceMergeResponse.cs | 0 .../StoredValue/StoredValueIssueRequest.cs | 0 .../StoredValue/StoredValueIssueResponse.cs | 0 .../StoredValue/StoredValueLoadRequest.cs | 0 .../StoredValue/StoredValueLoadResponse.cs | 0 .../StoredValueStatusChangeRequest.cs | 0 .../StoredValueStatusChangeResponse.cs | 0 .../StoredValue/StoredValueVoidRequest.cs | 0 .../StoredValue/StoredValueVoidResponse.cs | 0 .../Model/Terminal/SaleToAcquirerData.cs | 0 Adyen/{ => src}/Model/Terminal/Split.cs | 0 Adyen/{ => src}/Model/Terminal/SplitItem.cs | 0 .../{ => src}/Model/Terminal/SplitItemType.cs | 0 .../Model/TerminalApi/AbortRequest.cs | 0 .../Model/TerminalApi/AccountType.cs | 0 .../Model/TerminalApi/AdminRequest.cs | 0 .../Model/TerminalApi/AdminResponse.cs | 0 .../Model/TerminalApi/AlgorithmIdentifier.cs | 0 .../Model/TerminalApi/AlgorithmType.cs | 0 .../Model/TerminalApi/AlignmentType.cs | 0 .../Model/TerminalApi/AllowedProduct.cs | 0 Adyen/{ => src}/Model/TerminalApi/Amount.cs | 0 .../{ => src}/Model/TerminalApi/AmountsReq.cs | 0 .../Model/TerminalApi/AmountsResp.cs | 0 Adyen/{ => src}/Model/TerminalApi/AreaSize.cs | 0 .../Model/TerminalApi/AuthenticatedData.cs | 0 .../TerminalApi/AuthenticationMethodType.cs | 0 .../TerminalApi/BalanceInquiryRequest.cs | 0 .../TerminalApi/BalanceInquiryResponse.cs | 0 .../Model/TerminalApi/BarcodeType.cs | 0 .../Model/TerminalApi/BatchRequest.cs | 0 .../Model/TerminalApi/BatchResponse.cs | 0 .../Model/TerminalApi/CapturedSignature.cs | 0 .../TerminalApi/CardAcquisitionRequest.cs | 0 .../TerminalApi/CardAcquisitionResponse.cs | 0 .../TerminalApi/CardAcquisitionTransaction.cs | 0 Adyen/{ => src}/Model/TerminalApi/CardData.cs | 0 .../TerminalApi/CardReaderAPDURequest.cs | 0 .../TerminalApi/CardReaderAPDUResponse.cs | 0 .../TerminalApi/CardReaderInitRequest.cs | 0 .../TerminalApi/CardReaderInitResponse.cs | 0 .../TerminalApi/CardReaderPowerOffRequest.cs | 0 .../TerminalApi/CardReaderPowerOffResponse.cs | 0 .../Model/TerminalApi/CardholderPIN.cs | 0 .../Model/TerminalApi/CashHandlingDevice.cs | 0 .../Model/TerminalApi/CharacterHeightType.cs | 0 .../Model/TerminalApi/CharacterStyleType.cs | 0 .../Model/TerminalApi/CharacterWidthType.cs | 0 .../{ => src}/Model/TerminalApi/CheckData.cs | 0 .../Model/TerminalApi/CheckTypeCodeType.cs | 0 .../Model/TerminalApi/CoinsOrBills.cs | 0 .../{ => src}/Model/TerminalApi/ColorType.cs | 0 .../Model/TerminalApi/ContentInformation.cs | 0 .../Model/TerminalApi/ContentType.cs | 0 .../Model/TerminalApi/CurrencyConversion.cs | 0 .../Model/TerminalApi/CustomerOrder.cs | 0 .../Model/TerminalApi/CustomerOrderReqType.cs | 0 .../{ => src}/Model/TerminalApi/DeviceType.cs | 0 .../Model/TerminalApi/DiagnosisRequest.cs | 0 .../Model/TerminalApi/DiagnosisResponse.cs | 0 .../Model/TerminalApi/DigestedData.cs | 0 .../Model/TerminalApi/DisplayOutput.cs | 0 .../Model/TerminalApi/DisplayRequest.cs | 0 .../Model/TerminalApi/DisplayResponse.cs | 0 .../TerminalApi/DocumentQualifierType.cs | 0 .../Model/TerminalApi/EnableServiceRequest.cs | 0 .../TerminalApi/EnableServiceResponse.cs | 0 .../Model/TerminalApi/EncapsulatedContent.cs | 0 .../Model/TerminalApi/EncryptedContent.cs | 0 .../Model/TerminalApi/EntryModeType.cs | 0 .../Model/TerminalApi/EnvelopedData.cs | 0 .../Model/TerminalApi/ErrorConditionType.cs | 0 .../Model/TerminalApi/EventNotification.cs | 0 .../Model/TerminalApi/EventToNotifyType.cs | 0 .../Model/TerminalApi/ForceTypeModeType.cs | 0 .../Model/TerminalApi/GenericProfileType.cs | 0 .../TerminalApi/GeographicCoordinates.cs | 0 .../Model/TerminalApi/Geolocation.cs | 0 .../Model/TerminalApi/GetTotalsRequest.cs | 0 .../Model/TerminalApi/GetTotalsResponse.cs | 0 .../Model/TerminalApi/GlobalStatusType.cs | 0 .../{ => src}/Model/TerminalApi/HostStatus.cs | 0 .../Model/TerminalApi/ICCResetData.cs | 0 .../TerminalApi/IdentificationSupportType.cs | 0 .../Model/TerminalApi/IdentificationType.cs | 0 .../Model/TerminalApi/InfoQualifyType.cs | 0 Adyen/{ => src}/Model/TerminalApi/Input.cs | 0 .../Model/TerminalApi/InputCommandType.cs | 0 .../{ => src}/Model/TerminalApi/InputData.cs | 0 .../Model/TerminalApi/InputRequest.cs | 0 .../Model/TerminalApi/InputResponse.cs | 0 .../Model/TerminalApi/InputResult.cs | 0 .../Model/TerminalApi/InputUpdate.cs | 0 .../{ => src}/Model/TerminalApi/Instalment.cs | 0 .../TerminalApi/IssuerAndSerialNumber.cs | 0 Adyen/{ => src}/Model/TerminalApi/KEK.cs | 0 .../Model/TerminalApi/KEKIdentifier.cs | 0 .../Model/TerminalApi/KeyTransport.cs | 0 .../Model/TerminalApi/LoginRequest.cs | 0 .../Model/TerminalApi/LoginResponse.cs | 0 .../Model/TerminalApi/LogoutRequest.cs | 0 .../Model/TerminalApi/LogoutResponse.cs | 0 .../Model/TerminalApi/LoyaltyAccount.cs | 0 .../Model/TerminalApi/LoyaltyAccountID.cs | 0 .../Model/TerminalApi/LoyaltyAccountReq.cs | 0 .../Model/TerminalApi/LoyaltyAccountStatus.cs | 0 .../Model/TerminalApi/LoyaltyAcquirerData.cs | 0 .../Model/TerminalApi/LoyaltyAmount.cs | 0 .../Model/TerminalApi/LoyaltyData.cs | 0 .../Model/TerminalApi/LoyaltyHandlingType.cs | 0 .../Model/TerminalApi/LoyaltyRequest.cs | 0 .../Model/TerminalApi/LoyaltyResponse.cs | 0 .../Model/TerminalApi/LoyaltyResult.cs | 0 .../Model/TerminalApi/LoyaltyTotals.cs | 0 .../Model/TerminalApi/LoyaltyTransaction.cs | 0 .../TerminalApi/LoyaltyTransactionType.cs | 0 .../Model/TerminalApi/LoyaltyUnitType.cs | 0 .../{ => src}/Model/TerminalApi/MenuEntry.cs | 0 .../Model/TerminalApi/MenuEntryTagType.cs | 0 .../TerminalApi/Message/SaleToPOIRequest.cs | 0 .../Message/SaleToPoiRequestSecured.cs | 0 .../Message/SaleToPoiResponseSecured.cs | 0 .../Model/TerminalApi/MessageCategoryType.cs | 0 .../Model/TerminalApi/MessageClassType.cs | 0 .../Model/TerminalApi/MessageHeader.cs | 0 .../Model/TerminalApi/MessageReference.cs | 0 .../Model/TerminalApi/MessageType.cs | 0 .../{ => src}/Model/TerminalApi/MobileData.cs | 0 .../TerminalApi/NamedKeyEncryptedData.cs | 0 .../TerminalApi/OriginalPOITransaction.cs | 0 .../Model/TerminalApi/OutputBarcode.cs | 0 .../Model/TerminalApi/OutputContent.cs | 0 .../Model/TerminalApi/OutputFormatType.cs | 0 .../Model/TerminalApi/OutputResult.cs | 0 .../{ => src}/Model/TerminalApi/OutputText.cs | 0 .../Model/TerminalApi/PINFormatType.cs | 0 .../{ => src}/Model/TerminalApi/PINRequest.cs | 0 .../Model/TerminalApi/PINRequestType.cs | 0 .../Model/TerminalApi/PINResponse.cs | 0 Adyen/{ => src}/Model/TerminalApi/POIData.cs | 0 .../{ => src}/Model/TerminalApi/POIProfile.cs | 0 .../Model/TerminalApi/POISoftware.cs | 0 .../{ => src}/Model/TerminalApi/POIStatus.cs | 0 .../Model/TerminalApi/POISystemData.cs | 0 .../Model/TerminalApi/POITerminalData.cs | 0 .../{ => src}/Model/TerminalApi/Parameter.cs | 0 .../Model/TerminalApi/PaymentAccountReq.cs | 0 .../Model/TerminalApi/PaymentAccountStatus.cs | 0 .../Model/TerminalApi/PaymentAcquirerData.cs | 0 .../Model/TerminalApi/PaymentData.cs | 0 .../TerminalApi/PaymentInstrumentData.cs | 0 .../TerminalApi/PaymentInstrumentType.cs | 0 .../Model/TerminalApi/PaymentReceipt.cs | 0 .../Model/TerminalApi/PaymentRequest.cs | 0 .../Model/TerminalApi/PaymentResponse.cs | 0 .../Model/TerminalApi/PaymentResult.cs | 0 .../Model/TerminalApi/PaymentToken.cs | 0 .../Model/TerminalApi/PaymentTotals.cs | 0 .../Model/TerminalApi/PaymentTransaction.cs | 0 .../Model/TerminalApi/PaymentType.cs | 0 .../Model/TerminalApi/PerformedTransaction.cs | 0 .../Model/TerminalApi/PeriodUnitType.cs | 0 .../Model/TerminalApi/PredefinedContent.cs | 0 .../Model/TerminalApi/PrintOutput.cs | 0 .../Model/TerminalApi/PrintRequest.cs | 0 .../Model/TerminalApi/PrintResponse.cs | 0 .../Model/TerminalApi/PrinterStatusType.cs | 0 Adyen/{ => src}/Model/TerminalApi/Rebates.cs | 0 .../Model/TerminalApi/RecipientIdentifier.cs | 0 .../TerminalApi/ReconciliationRequest.cs | 0 .../TerminalApi/ReconciliationResponse.cs | 0 .../Model/TerminalApi/ReconciliationType.cs | 0 .../TerminalApi/RelativeDistinguishedName.cs | 0 .../TerminalApi/RepeatedMessageResponse.cs | 0 .../RepeatedResponseMessageBody.cs | 0 Adyen/{ => src}/Model/TerminalApi/Response.cs | 0 .../Model/TerminalApi/ResponseModeType.cs | 0 .../{ => src}/Model/TerminalApi/ResultType.cs | 0 .../Model/TerminalApi/ReversalReasonType.cs | 0 .../Model/TerminalApi/ReversalRequest.cs | 0 .../Model/TerminalApi/ReversalResponse.cs | 0 Adyen/{ => src}/Model/TerminalApi/SaleData.cs | 0 Adyen/{ => src}/Model/TerminalApi/SaleItem.cs | 0 .../Model/TerminalApi/SaleItemRebate.cs | 0 .../Model/TerminalApi/SaleProfile.cs | 0 .../Model/TerminalApi/SaleSoftware.cs | 0 .../Model/TerminalApi/SaleTerminalData.cs | 0 .../Model/TerminalApi/SaleToIssuerData.cs | 0 .../Model/TerminalApi/SaleToPOIMessage.cs | 0 .../Model/TerminalApi/SaleToPOIResponse.cs | 0 .../Model/TerminalApi/SensitiveCardData.cs | 0 .../Model/TerminalApi/SensitiveMobileData.cs | 0 .../Model/TerminalApi/SignaturePoint.cs | 0 .../{ => src}/Model/TerminalApi/SignedData.cs | 0 Adyen/{ => src}/Model/TerminalApi/Signer.cs | 0 .../Model/TerminalApi/SignerIdentifier.cs | 0 .../Model/TerminalApi/SoundActionType.cs | 0 .../Model/TerminalApi/SoundContent.cs | 0 .../Model/TerminalApi/SoundFormatType.cs | 0 .../Model/TerminalApi/SoundRequest.cs | 0 .../Model/TerminalApi/SoundResponse.cs | 0 .../Model/TerminalApi/SponsoredMerchant.cs | 0 .../Model/TerminalApi/StoredValueAccountID.cs | 0 .../TerminalApi/StoredValueAccountStatus.cs | 0 .../TerminalApi/StoredValueAccountType.cs | 0 .../Model/TerminalApi/StoredValueData.cs | 0 .../Model/TerminalApi/StoredValueRequest.cs | 0 .../Model/TerminalApi/StoredValueResponse.cs | 0 .../Model/TerminalApi/StoredValueResult.cs | 0 .../TerminalApi/StoredValueTransactionType.cs | 0 .../TerminalApi/TerminalEnvironmentType.cs | 0 .../Model/TerminalApi/TokenRequestedType.cs | 0 .../Model/TerminalApi/TotalDetailsType.cs | 0 .../Model/TerminalApi/TotalFilter.cs | 0 .../{ => src}/Model/TerminalApi/TrackData.cs | 0 .../Model/TerminalApi/TrackFormatType.cs | 0 .../TerminalApi/TransactionActionType.cs | 0 .../TerminalApi/TransactionConditions.cs | 0 .../TerminalApi/TransactionIdentification.cs | 0 .../TerminalApi/TransactionStatusRequest.cs | 0 .../TerminalApi/TransactionStatusResponse.cs | 0 .../Model/TerminalApi/TransactionToPerform.cs | 0 .../Model/TerminalApi/TransactionTotals.cs | 0 .../Model/TerminalApi/TransactionType.cs | 0 .../Model/TerminalApi/TransmitRequest.cs | 0 .../Model/TerminalApi/TransmitResponse.cs | 0 .../Model/TerminalApi/UTMCoordinates.cs | 0 .../Model/TerminalApi/UnitOfMeasureType.cs | 0 .../Model/TerminalApi/VersionType.cs | 0 .../AbstractOpenAPISchema.cs | 0 .../Model/TransactionWebhooks/Amount.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../TransactionWebhooks/BankCategoryData.cs | 0 .../InternalCategoryData.cs | 0 .../Model/TransactionWebhooks/IssuedCard.cs | 0 .../TransactionWebhooks/PaymentInstrument.cs | 0 .../TransactionWebhooks/PlatformPayment.cs | 0 .../RelayedAuthorisationData.cs | 0 .../Model/TransactionWebhooks/Resource.cs | 0 .../TransactionWebhooks/ResourceReference.cs | 0 .../Model/TransactionWebhooks/ThreeDSecure.cs | 0 .../Model/TransactionWebhooks/Transaction.cs | 0 .../TransactionNotificationRequestV4.cs | 0 .../TransferNotificationValidationFact.cs | 0 .../Model/TransactionWebhooks/TransferView.cs | 0 .../TransferViewCategoryData.cs | 0 .../AULocalAccountIdentification.cs | 0 .../TransferWebhooks/AbstractOpenAPISchema.cs | 0 .../AdditionalBankIdentification.cs | 0 .../Model/TransferWebhooks/Address.cs | 0 .../Model/TransferWebhooks/Airline.cs | 0 .../Model/TransferWebhooks/Amount.cs | 0 .../TransferWebhooks/AmountAdjustment.cs | 0 .../BRLocalAccountIdentification.cs | 0 .../Model/TransferWebhooks/BalanceMutation.cs | 0 .../BalancePlatformNotificationResponse.cs | 0 .../Model/TransferWebhooks/BankAccountV3.cs | 0 .../BankAccountV3AccountIdentification.cs | 0 .../TransferWebhooks/BankCategoryData.cs | 0 .../CALocalAccountIdentification.cs | 0 .../CZLocalAccountIdentification.cs | 0 .../{ => src}/Model/TransferWebhooks/Card.cs | 0 .../TransferWebhooks/CardIdentification.cs | 0 .../ConfirmationTrackingData.cs | 0 .../Model/TransferWebhooks/CounterpartyV3.cs | 0 .../DKLocalAccountIdentification.cs | 0 .../DirectDebitInformation.cs | 0 .../EstimationTrackingData.cs | 0 .../Model/TransferWebhooks/ExternalReason.cs | 0 .../HKLocalAccountIdentification.cs | 0 .../HULocalAccountIdentification.cs | 0 .../IbanAccountIdentification.cs | 0 .../TransferWebhooks/InternalCategoryData.cs | 0 .../InternalReviewTrackingData.cs | 0 .../Model/TransferWebhooks/IssuedCard.cs | 0 .../IssuingTransactionData.cs | 0 Adyen/{ => src}/Model/TransferWebhooks/Leg.cs | 0 .../Model/TransferWebhooks/Lodging.cs | 0 .../Model/TransferWebhooks/MerchantData.cs | 0 .../TransferWebhooks/MerchantPurchaseData.cs | 0 .../Model/TransferWebhooks/Modification.cs | 0 .../NOLocalAccountIdentification.cs | 0 .../NZLocalAccountIdentification.cs | 0 .../Model/TransferWebhooks/NameLocation.cs | 0 .../NumberAndBicAccountIdentification.cs | 0 .../PLLocalAccountIdentification.cs | 0 .../TransferWebhooks/PartyIdentification.cs | 0 .../TransferWebhooks/PaymentInstrument.cs | 0 .../Model/TransferWebhooks/PlatformPayment.cs | 0 .../RelayedAuthorisationData.cs | 0 .../Model/TransferWebhooks/Resource.cs | 0 .../TransferWebhooks/ResourceReference.cs | 0 .../SELocalAccountIdentification.cs | 0 .../SGLocalAccountIdentification.cs | 0 .../TransactionEventViolation.cs | 0 .../TransactionRuleReference.cs | 0 .../TransferWebhooks/TransactionRuleSource.cs | 0 .../TransactionRulesResult.cs | 0 .../Model/TransferWebhooks/TransferData.cs | 0 .../TransferDataCategoryData.cs | 0 .../TransferWebhooks/TransferDataTracking.cs | 0 .../Model/TransferWebhooks/TransferEvent.cs | 0 .../TransferEventEventsDataInner.cs | 0 .../TransferEventTrackingData.cs | 0 .../TransferNotificationCounterParty.cs | 0 .../TransferNotificationMerchantData.cs | 0 .../TransferNotificationRequest.cs | 0 .../TransferNotificationValidationFact.cs | 0 .../Model/TransferWebhooks/TransferReview.cs | 0 .../UKLocalAccountIdentification.cs | 0 .../USLocalAccountIdentification.cs | 0 .../Transfers/AULocalAccountIdentification.cs | 0 .../Model/Transfers/AbstractOpenAPISchema.cs | 0 .../Transfers/AdditionalBankIdentification.cs | 0 Adyen/{ => src}/Model/Transfers/Address.cs | 0 Adyen/{ => src}/Model/Transfers/Airline.cs | 0 Adyen/{ => src}/Model/Transfers/Amount.cs | 0 .../Model/Transfers/AmountAdjustment.cs | 0 .../Transfers/ApproveTransfersRequest.cs | 0 .../Transfers/BRLocalAccountIdentification.cs | 0 .../Model/Transfers/BalanceMutation.cs | 0 .../Model/Transfers/BankAccountV3.cs | 0 .../BankAccountV3AccountIdentification.cs | 0 .../Model/Transfers/BankCategoryData.cs | 0 .../Transfers/CALocalAccountIdentification.cs | 0 .../Transfers/CZLocalAccountIdentification.cs | 0 .../Model/Transfers/CancelTransfersRequest.cs | 0 .../Model/Transfers/CapitalBalance.cs | 0 .../{ => src}/Model/Transfers/CapitalGrant.cs | 0 .../Model/Transfers/CapitalGrantInfo.cs | 0 .../Model/Transfers/CapitalGrants.cs | 0 Adyen/{ => src}/Model/Transfers/Card.cs | 0 .../Model/Transfers/CardIdentification.cs | 0 .../Transfers/ConfirmationTrackingData.cs | 0 .../{ => src}/Model/Transfers/Counterparty.cs | 0 .../Model/Transfers/CounterpartyInfoV3.cs | 0 .../Model/Transfers/CounterpartyV3.cs | 0 .../Transfers/DKLocalAccountIdentification.cs | 0 .../Model/Transfers/DirectDebitInformation.cs | 0 .../Model/Transfers/EstimationTrackingData.cs | 0 .../Model/Transfers/ExternalReason.cs | 0 Adyen/{ => src}/Model/Transfers/Fee.cs | 0 .../Model/Transfers/FindTransfersResponse.cs | 0 .../Transfers/HKLocalAccountIdentification.cs | 0 .../Transfers/HULocalAccountIdentification.cs | 0 .../Transfers/IbanAccountIdentification.cs | 0 .../Model/Transfers/InternalCategoryData.cs | 0 .../Transfers/InternalReviewTrackingData.cs | 0 .../{ => src}/Model/Transfers/InvalidField.cs | 0 Adyen/{ => src}/Model/Transfers/IssuedCard.cs | 0 .../Model/Transfers/IssuingTransactionData.cs | 0 Adyen/{ => src}/Model/Transfers/Leg.cs | 0 Adyen/{ => src}/Model/Transfers/Link.cs | 0 Adyen/{ => src}/Model/Transfers/Links.cs | 0 Adyen/{ => src}/Model/Transfers/Lodging.cs | 0 .../{ => src}/Model/Transfers/MerchantData.cs | 0 .../Model/Transfers/MerchantPurchaseData.cs | 0 .../{ => src}/Model/Transfers/Modification.cs | 0 .../Transfers/NOLocalAccountIdentification.cs | 0 .../Transfers/NZLocalAccountIdentification.cs | 0 .../{ => src}/Model/Transfers/NameLocation.cs | 0 .../NumberAndBicAccountIdentification.cs | 0 .../Transfers/PLLocalAccountIdentification.cs | 0 .../Model/Transfers/PartyIdentification.cs | 0 .../Model/Transfers/PaymentInstrument.cs | 0 .../Model/Transfers/PlatformPayment.cs | 0 .../Transfers/RelayedAuthorisationData.cs | 0 Adyen/{ => src}/Model/Transfers/Repayment.cs | 0 .../Model/Transfers/RepaymentTerm.cs | 0 .../Model/Transfers/ResourceReference.cs | 0 .../Model/Transfers/RestServiceError.cs | 0 .../Model/Transfers/ReturnTransferRequest.cs | 0 .../Model/Transfers/ReturnTransferResponse.cs | 0 .../Model/Transfers/RoutingDetails.cs | 0 .../Transfers/SELocalAccountIdentification.cs | 0 .../Transfers/SGLocalAccountIdentification.cs | 0 .../{ => src}/Model/Transfers/ServiceError.cs | 0 .../Model/Transfers/ThresholdRepayment.cs | 0 .../{ => src}/Model/Transfers/Transaction.cs | 0 .../Transfers/TransactionEventViolation.cs | 0 .../Transfers/TransactionRuleReference.cs | 0 .../Model/Transfers/TransactionRuleSource.cs | 0 .../Model/Transfers/TransactionRulesResult.cs | 0 .../Transfers/TransactionSearchResponse.cs | 0 Adyen/{ => src}/Model/Transfers/Transfer.cs | 0 .../Model/Transfers/TransferCategoryData.cs | 0 .../{ => src}/Model/Transfers/TransferData.cs | 0 .../Model/Transfers/TransferDataTracking.cs | 0 .../Model/Transfers/TransferEvent.cs | 0 .../Transfers/TransferEventEventsDataInner.cs | 0 .../Transfers/TransferEventTrackingData.cs | 0 .../{ => src}/Model/Transfers/TransferInfo.cs | 0 .../TransferNotificationCounterParty.cs | 0 .../TransferNotificationMerchantData.cs | 0 .../TransferNotificationValidationFact.cs | 0 .../Model/Transfers/TransferRequestReview.cs | 0 .../Model/Transfers/TransferReview.cs | 0 .../TransferServiceRestServiceError.cs | 0 .../{ => src}/Model/Transfers/TransferView.cs | 0 .../Transfers/UKLocalAccountIdentification.cs | 0 .../Transfers/USLocalAccountIdentification.cs | 0 .../Transfers/UltimatePartyIdentification.cs | 0 Adyen/{ => src}/Security/AesEncryptor.cs | 0 .../Security/EncryptionCredentialDetails.cs | 0 .../Security/EncryptionDerivedKey.cs | 0 .../Security/EncryptionDerivedKeyGenerator.cs | 0 .../Exceptions/NexoCryptoException.cs | 0 .../Security/Extension/ArrayExtension.cs | 0 Adyen/{ => src}/Security/HmacSha256Wrapper.cs | 0 Adyen/{ => src}/Security/IvModGenerator.cs | 0 .../Security/SaleToPoiMessageSecured.cs | 0 .../SaleToPoiMessageSecuredEncryptor.cs | 0 Adyen/{ => src}/Security/SecurityTrailer.cs | 0 .../Security/TerminalCommonNameValidator.cs | 0 Adyen/{ => src}/Service/AbstractService.cs | 0 Adyen/{ => src}/Service/ApiException.cs | 0 .../Service/BalanceControlService.cs | 0 .../BalancePlatform/AccountHoldersService.cs | 0 .../BalancePlatform/BalanceAccountsService.cs | 0 .../BankAccountValidationService.cs | 0 .../BalancePlatform/CardOrdersService.cs | 0 .../BalancePlatform/GrantAccountsService.cs | 0 .../BalancePlatform/GrantOffersService.cs | 0 .../BalancePlatform/ManageCardPINService.cs | 0 .../ManageSCADevicesService.cs | 0 .../BalancePlatform/NetworkTokensService.cs | 0 .../PaymentInstrumentGroupsService.cs | 0 .../PaymentInstrumentsService.cs | 0 .../BalancePlatform/PlatformService.cs | 0 .../TransactionRulesService.cs | 0 .../BalancePlatform/TransferRoutesService.cs | 0 Adyen/{ => src}/Service/BinLookupService.cs | 0 .../Service/Checkout/DonationsService.cs | 0 .../Service/Checkout/ModificationsService.cs | 0 .../Service/Checkout/OrdersService.cs | 0 .../Service/Checkout/PaymentLinksService.cs | 0 .../Service/Checkout/PaymentsService.cs | 0 .../Service/Checkout/RecurringService.cs | 0 .../Service/Checkout/UtilityService.cs | 0 .../Service/DataProtectionService.cs | 0 Adyen/{ => src}/Service/DisputesService.cs | 0 .../BusinessLinesService.cs | 0 .../LegalEntityManagement/DocumentsService.cs | 0 .../HostedOnboardingService.cs | 0 .../LegalEntitiesService.cs | 0 .../PCIQuestionnairesService.cs | 0 .../TaxEDeliveryConsentService.cs | 0 .../TermsOfServiceService.cs | 0 .../TransferInstrumentsService.cs | 0 .../APICredentialsCompanyLevelService.cs | 0 .../APICredentialsMerchantLevelService.cs | 0 .../Management/APIKeyCompanyLevelService.cs | 0 .../Management/APIKeyMerchantLevelService.cs | 0 .../Management/AccountCompanyLevelService.cs | 0 .../Management/AccountMerchantLevelService.cs | 0 .../Management/AccountStoreLevelService.cs | 0 .../AllowedOriginsCompanyLevelService.cs | 0 .../AllowedOriginsMerchantLevelService.cs | 0 .../AndroidFilesCompanyLevelService.cs | 0 .../ClientKeyCompanyLevelService.cs | 0 .../ClientKeyMerchantLevelService.cs | 0 .../Management/MyAPICredentialService.cs | 0 .../PaymentMethodsMerchantLevelService.cs | 0 .../PayoutSettingsMerchantLevelService.cs | 0 .../SplitConfigurationMerchantLevelService.cs | 0 .../TerminalActionsCompanyLevelService.cs | 0 .../TerminalActionsTerminalLevelService.cs | 0 .../TerminalOrdersCompanyLevelService.cs | 0 .../TerminalOrdersMerchantLevelService.cs | 0 .../TerminalSettingsCompanyLevelService.cs | 0 .../TerminalSettingsMerchantLevelService.cs | 0 .../TerminalSettingsStoreLevelService.cs | 0 .../TerminalSettingsTerminalLevelService.cs | 0 .../TerminalsTerminalLevelService.cs | 0 .../Management/UsersCompanyLevelService.cs | 0 .../Management/UsersMerchantLevelService.cs | 0 .../Management/WebhooksCompanyLevelService.cs | 0 .../WebhooksMerchantLevelService.cs | 0 Adyen/{ => src}/Service/PaymentService.cs | 0 Adyen/{ => src}/Service/PaymentsAppService.cs | 0 .../Service/Payout/InitializationService.cs | 0 .../Service/Payout/InstantPayoutsService.cs | 0 .../Service/Payout/ReviewingService.cs | 0 .../PlatformsAccount/AccountHoldersService.cs | 0 .../PlatformsAccount/AccountsService.cs | 0 .../PlatformsAccount/VerificationService.cs | 0 .../{ => src}/Service/PlatformsFundService.cs | 0 .../HostedOnboardingPageService.cs | 0 .../PCIComplianceQuestionnairePageService.cs | 0 ...atformsNotificationConfigurationService.cs | 0 Adyen/{ => src}/Service/PosMobileService.cs | 0 .../Service/PosTerminalManagementService.cs | 0 Adyen/{ => src}/Service/RecurringService.cs | 0 .../Service/Resource/Terminal/TerminalApi.cs | 0 .../Terminal/TerminalApiAsyncClient.cs | 0 .../Resource/Terminal/TerminalApiLocal.cs | 0 .../Terminal/TerminalApiLocalClient.cs | 0 .../Terminal/TerminalApiSyncClient.cs | 0 Adyen/{ => src}/Service/ServiceResource.cs | 0 Adyen/{ => src}/Service/StoredValueService.cs | 0 .../Service/TerminalApiAsyncService.cs | 0 .../Service/TerminalApiLocalService.cs | 0 .../Service/TerminalApiSyncService.cs | 0 Adyen/{ => src}/Service/TerminalCloudApi.cs | 0 Adyen/{ => src}/Service/TerminalLocalApi.cs | 0 .../Service/TerminalLocalApiUnencrypted.cs | 0 .../Service/Transfers/CapitalService.cs | 0 .../Service/Transfers/TransactionsService.cs | 0 .../Service/Transfers/TransfersService.cs | 0 Adyen/{ => src}/Util/ByteArrayConverter.cs | 0 Adyen/{ => src}/Util/HMACValidator.cs | 0 Adyen/{ => src}/Util/JsonOperation.cs | 0 .../Util/TerminalApi/AdditionalResponse.cs | 0 .../Util/TerminalApi/CardAcquisitionUtil.cs | 0 Adyen/{ => src}/Util/Util.cs | 0 .../Webhooks/BalancePlatformWebhookHandler.cs | 0 .../Webhooks/ClassicPlatformWebhookHandler.cs | 0 .../Webhooks/ManagementWebhookHandler.cs | 0 Adyen/{ => src}/Webhooks/WebhookHandler.cs | 0 1761 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 Adyen/Core/JsonSerializerOptionsProvider.cs rename Adyen/{ => src}/ApiSerialization/Converter/JsonBase64Converter.cs (100%) rename Adyen/{ => src}/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs (100%) rename Adyen/{ => src}/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs (100%) rename Adyen/{ => src}/ApiSerialization/Converter/SaleToPoiMessageConverter.cs (100%) rename Adyen/{ => src}/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs (100%) rename Adyen/{ => src}/ApiSerialization/IMessagePayload.cs (100%) rename Adyen/{ => src}/ApiSerialization/IMessagePayloadSerializer.cs (100%) rename Adyen/{ => src}/ApiSerialization/MessageHeaderSerializer.cs (100%) rename Adyen/{ => src}/ApiSerialization/MessagePayloadSerializer.cs (100%) rename Adyen/{ => src}/ApiSerialization/MessagePayloadSerializerFactory.cs (100%) rename Adyen/{ => src}/ApiSerialization/OpenAPIDateConverter.cs (100%) rename Adyen/{ => src}/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs (100%) rename Adyen/{ => src}/ApiSerialization/SaleToPoiMessageSerializer.cs (100%) rename Adyen/{ => src}/ApiSerialization/TypeHelper.cs (100%) rename Adyen/{ => src}/Constants/ApiConstants.cs (100%) rename Adyen/{ => src}/Constants/ClientConfig.cs (100%) rename Adyen/{ => src}/Constants/Region.cs (100%) rename Adyen/{ => src}/Exceptions/DeserializationException.cs (100%) rename Adyen/{ => src}/Exceptions/ExceptionMessages.cs (100%) rename Adyen/{ => src}/HttpClient/HttpClientException.cs (100%) rename Adyen/{ => src}/HttpClient/HttpClientExtension.cs (100%) rename Adyen/{ => src}/HttpClient/HttpClientWrapper.cs (100%) rename Adyen/{ => src}/HttpClient/Interfaces/IClient.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/AuthenticationDecision.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/AuthenticationInfo.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/AuthenticationNotificationData.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/AuthenticationNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/ChallengeInfo.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/Purchase.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/PurchaseInfo.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/RelayedAuthenticationRequest.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/RelayedAuthenticationResponse.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/Resource.cs (100%) rename Adyen/{ => src}/Model/AcsWebhooks/ServiceError.cs (100%) rename Adyen/{ => src}/Model/ApiError.cs (100%) rename Adyen/{ => src}/Model/ApplicationInformation/ApplicationInfo.cs (100%) rename Adyen/{ => src}/Model/ApplicationInformation/CommonField.cs (100%) rename Adyen/{ => src}/Model/ApplicationInformation/ExternalPlatform.cs (100%) rename Adyen/{ => src}/Model/ApplicationInformation/MerchantDevice.cs (100%) rename Adyen/{ => src}/Model/ApplicationInformation/ShopperInteractionDevice.cs (100%) rename Adyen/{ => src}/Model/BalanceControl/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/BalanceControl/Amount.cs (100%) rename Adyen/{ => src}/Model/BalanceControl/BalanceTransferRequest.cs (100%) rename Adyen/{ => src}/Model/BalanceControl/BalanceTransferResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AccountHolder.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AccountHolderCapability.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AccountHolderInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AccountHolderUpdateRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AccountSupportingEntityCapability.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AdditionalBankIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Address.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AddressRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Amount.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AmountMinMaxRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AssociationFinaliseRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AssociationFinaliseResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AssociationInitiateRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/AssociationInitiateResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Authentication.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BRLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Balance.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BalanceAccount.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BalanceAccountBase.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BalanceAccountInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BalanceAccountUpdateRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BalancePlatform.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccount.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccountAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccountDetails.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankAccountModel.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BankIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BrandVariantsRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/BulkAddress.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CALocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CapabilityProblem.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CapabilityProblemEntity.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CapabilitySettings.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CapitalBalance.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CapitalGrantAccount.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Card.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CardConfiguration.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CardInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CardOrder.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CardOrderItem.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/ContactDetails.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Counterparty.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CounterpartyBankRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CounterpartyTypesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CountriesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/CreateSweepConfigurationV2.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DayOfWeekRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DelegatedAuthenticationData.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DeliveryAddress.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DeliveryContact.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Device.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DeviceInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/DifferentCurrenciesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Duration.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/EntryModesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Expiry.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Fee.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/GetNetworkTokenResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/GetTaxFormResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/GrantLimit.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/GrantOffer.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/GrantOffers.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/HKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/HULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Href.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/IbanAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/InternationalTransactionRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/InvalidField.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Link.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/ListNetworkTokensResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/MatchingTransactionsRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/MatchingValuesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/MccsRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/MerchantAcquirerPair.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/MerchantNamesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/MerchantsRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/NOLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/NZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Name.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/NetworkToken.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PLLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrument.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentGroup.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Phone.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PhoneNumber.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PinChangeRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PinChangeResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PlatformPaymentConfiguration.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/ProcessingTypesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/PublicKeyResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RegisterSCAFinalResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RegisterSCARequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RegisterSCAResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RemediatingAction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/Repayment.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RepaymentTerm.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RestServiceError.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RevealPinRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RevealPinResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RiskScores.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/RiskScoresRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SELocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SGLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SameAmountRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SameCounterpartyRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SourceAccountTypesRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/StringMatch.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SweepConfigurationV2.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SweepCounterparty.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/SweepSchedule.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/ThresholdRepayment.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TimeOfDay.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TimeOfDayRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TokenRequestorsRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TotalAmountRestriction.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRule.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRuleEntityKey.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRuleInfo.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRuleInterval.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRuleResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRuleRestrictions.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransactionRulesResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransferRoute.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransferRouteRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransferRouteRequirementsInner.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/TransferRouteResponse.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/UKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/USInternationalAchAddressRequirement.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/USLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/UpdateNetworkTokenRequest.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/UpdatePaymentInstrument.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/UpdateSweepConfigurationV2.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/VerificationDeadline.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/VerificationError.cs (100%) rename Adyen/{ => src}/Model/BalancePlatform/VerificationErrorRecursive.cs (100%) rename Adyen/{ => src}/Model/BinLookup/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/BinLookup/Amount.cs (100%) rename Adyen/{ => src}/Model/BinLookup/BinDetail.cs (100%) rename Adyen/{ => src}/Model/BinLookup/CardBin.cs (100%) rename Adyen/{ => src}/Model/BinLookup/CostEstimateAssumptions.cs (100%) rename Adyen/{ => src}/Model/BinLookup/CostEstimateRequest.cs (100%) rename Adyen/{ => src}/Model/BinLookup/CostEstimateResponse.cs (100%) rename Adyen/{ => src}/Model/BinLookup/DSPublicKeyDetail.cs (100%) rename Adyen/{ => src}/Model/BinLookup/MerchantDetails.cs (100%) rename Adyen/{ => src}/Model/BinLookup/Recurring.cs (100%) rename Adyen/{ => src}/Model/BinLookup/ServiceError.cs (100%) rename Adyen/{ => src}/Model/BinLookup/ThreeDS2CardRangeDetail.cs (100%) rename Adyen/{ => src}/Model/BinLookup/ThreeDSAvailabilityRequest.cs (100%) rename Adyen/{ => src}/Model/BinLookup/ThreeDSAvailabilityResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Checkout/AccountInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/AcctInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/AchDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalData3DSecure.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataAirline.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataCarRental.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataCommon.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataLevel23.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataLodging.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataOpenInvoice.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataOpi.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataRatepay.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataRetry.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataRisk.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataRiskStandalone.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataSubMerchant.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataTemporaryServices.cs (100%) rename Adyen/{ => src}/Model/Checkout/AdditionalDataWallets.cs (100%) rename Adyen/{ => src}/Model/Checkout/Address.cs (100%) rename Adyen/{ => src}/Model/Checkout/AffirmDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/AfterpayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Agency.cs (100%) rename Adyen/{ => src}/Model/Checkout/Airline.cs (100%) rename Adyen/{ => src}/Model/Checkout/AmazonPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Amount.cs (100%) rename Adyen/{ => src}/Model/Checkout/Amounts.cs (100%) rename Adyen/{ => src}/Model/Checkout/AncvDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/AndroidPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/ApplePayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/ApplePayDonations.cs (100%) rename Adyen/{ => src}/Model/Checkout/ApplePaySessionRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/ApplePaySessionResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/ApplicationInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/AuthenticationData.cs (100%) rename Adyen/{ => src}/Model/Checkout/BacsDirectDebitDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/BalanceCheckRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/BalanceCheckResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/BillDeskDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/BillingAddress.cs (100%) rename Adyen/{ => src}/Model/Checkout/BlikDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/BrowserInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/CancelOrderRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/CancelOrderResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/CardBrandDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/CardDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/CardDetailsRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/CardDetailsResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/CardDonations.cs (100%) rename Adyen/{ => src}/Model/Checkout/CashAppDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/CellulantDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutAwaitAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutBankAccount.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutBankTransferAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutNativeRedirectAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutOrderResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutPaymentMethod.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutQrCodeAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutRedirectAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutSDKAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutSessionInstallmentOption.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutThreeDS2Action.cs (100%) rename Adyen/{ => src}/Model/Checkout/CheckoutVoucherAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/CommonField.cs (100%) rename Adyen/{ => src}/Model/Checkout/Company.cs (100%) rename Adyen/{ => src}/Model/Checkout/CreateCheckoutSessionRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/CreateCheckoutSessionResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/CreateOrderRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/CreateOrderResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/DeliveryAddress.cs (100%) rename Adyen/{ => src}/Model/Checkout/DeliveryMethod.cs (100%) rename Adyen/{ => src}/Model/Checkout/DetailsRequestAuthenticationData.cs (100%) rename Adyen/{ => src}/Model/Checkout/DeviceRenderOptions.cs (100%) rename Adyen/{ => src}/Model/Checkout/DokuDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Donation.cs (100%) rename Adyen/{ => src}/Model/Checkout/DonationCampaign.cs (100%) rename Adyen/{ => src}/Model/Checkout/DonationCampaignsRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/DonationCampaignsResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/DonationPaymentMethod.cs (100%) rename Adyen/{ => src}/Model/Checkout/DonationPaymentRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/DonationPaymentResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/DragonpayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/EBankingFinlandDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/EcontextVoucherDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/EftDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/EncryptedOrderData.cs (100%) rename Adyen/{ => src}/Model/Checkout/EnhancedSchemeData.cs (100%) rename Adyen/{ => src}/Model/Checkout/ExternalPlatform.cs (100%) rename Adyen/{ => src}/Model/Checkout/FastlaneDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/ForexQuote.cs (100%) rename Adyen/{ => src}/Model/Checkout/FraudCheckResult.cs (100%) rename Adyen/{ => src}/Model/Checkout/FraudResult.cs (100%) rename Adyen/{ => src}/Model/Checkout/FundOrigin.cs (100%) rename Adyen/{ => src}/Model/Checkout/FundRecipient.cs (100%) rename Adyen/{ => src}/Model/Checkout/GenericIssuerPaymentMethodDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/GooglePayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/GooglePayDonations.cs (100%) rename Adyen/{ => src}/Model/Checkout/IdealDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/IdealDonations.cs (100%) rename Adyen/{ => src}/Model/Checkout/InputDetail.cs (100%) rename Adyen/{ => src}/Model/Checkout/InstallmentOption.cs (100%) rename Adyen/{ => src}/Model/Checkout/Installments.cs (100%) rename Adyen/{ => src}/Model/Checkout/Item.cs (100%) rename Adyen/{ => src}/Model/Checkout/KlarnaDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Leg.cs (100%) rename Adyen/{ => src}/Model/Checkout/LineItem.cs (100%) rename Adyen/{ => src}/Model/Checkout/ListStoredPaymentMethodsResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/Mandate.cs (100%) rename Adyen/{ => src}/Model/Checkout/MasterpassDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/MbwayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/MerchantDevice.cs (100%) rename Adyen/{ => src}/Model/Checkout/MerchantRiskIndicator.cs (100%) rename Adyen/{ => src}/Model/Checkout/MobilePayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/MolPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Name.cs (100%) rename Adyen/{ => src}/Model/Checkout/OpenInvoiceDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Passenger.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayByBankAISDirectDebitDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayByBankDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayPalDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayToDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayUUpiDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayWithGoogleDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PayWithGoogleDonations.cs (100%) rename Adyen/{ => src}/Model/Checkout/Payment.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentAmountUpdateRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentAmountUpdateResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentCancelRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentCancelResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentCaptureRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentCaptureResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentCompletionDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentDetailsRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentDetailsResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentLinkRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentLinkResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethod.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethodGroup.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethodIssuer.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethodToStore.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethodUPIApps.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethodsRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentMethodsResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentRefundRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentRefundResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentResponseAction.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentReversalRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaymentReversalResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaypalUpdateOrderRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/PaypalUpdateOrderResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/Phone.cs (100%) rename Adyen/{ => src}/Model/Checkout/PixDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/PixRecurring.cs (100%) rename Adyen/{ => src}/Model/Checkout/PlatformChargebackLogic.cs (100%) rename Adyen/{ => src}/Model/Checkout/PseDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/RakutenPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/RatepayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/Recurring.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalData3DSecure.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataBillingAddress.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataCard.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataCommon.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataDomesticError.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataInstallments.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataOpi.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponseAdditionalDataSepa.cs (100%) rename Adyen/{ => src}/Model/Checkout/ResponsePaymentMethod.cs (100%) rename Adyen/{ => src}/Model/Checkout/RiskData.cs (100%) rename Adyen/{ => src}/Model/Checkout/RivertyDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/SDKEphemPubKey.cs (100%) rename Adyen/{ => src}/Model/Checkout/SamsungPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/SepaDirectDebitDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/ServiceError.cs (100%) rename Adyen/{ => src}/Model/Checkout/SessionResultResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/ShopperInteractionDevice.cs (100%) rename Adyen/{ => src}/Model/Checkout/Split.cs (100%) rename Adyen/{ => src}/Model/Checkout/SplitAmount.cs (100%) rename Adyen/{ => src}/Model/Checkout/StandalonePaymentCancelRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/StandalonePaymentCancelResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/StoredPaymentMethod.cs (100%) rename Adyen/{ => src}/Model/Checkout/StoredPaymentMethodDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/StoredPaymentMethodRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/StoredPaymentMethodResource.cs (100%) rename Adyen/{ => src}/Model/Checkout/SubInputDetail.cs (100%) rename Adyen/{ => src}/Model/Checkout/SubMerchant.cs (100%) rename Adyen/{ => src}/Model/Checkout/SubMerchantInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/Surcharge.cs (100%) rename Adyen/{ => src}/Model/Checkout/TaxTotal.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDS2RequestData.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDS2RequestFields.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDS2ResponseData.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDS2Result.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDSRequestData.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs (100%) rename Adyen/{ => src}/Model/Checkout/ThreeDSecureData.cs (100%) rename Adyen/{ => src}/Model/Checkout/Ticket.cs (100%) rename Adyen/{ => src}/Model/Checkout/TravelAgency.cs (100%) rename Adyen/{ => src}/Model/Checkout/TwintDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/UpdatePaymentLinkRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/UpiCollectDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/UpiIntentDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/UtilityRequest.cs (100%) rename Adyen/{ => src}/Model/Checkout/UtilityResponse.cs (100%) rename Adyen/{ => src}/Model/Checkout/VippsDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/VisaCheckoutDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/WeChatPayDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/WeChatPayMiniProgramDetails.cs (100%) rename Adyen/{ => src}/Model/Checkout/ZipDetails.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/AccountHolder.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/AccountHolderCapability.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Address.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Authentication.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Balance.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/BalanceAccount.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/BankAccountDetails.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/BulkAddress.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CapabilityProblem.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CapabilitySettings.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Card.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CardConfiguration.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CardOrderItem.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/ContactDetails.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/DeliveryAddress.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/DeliveryContact.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Device.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Expiry.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/IbanAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Name.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/PaymentInstrument.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Phone.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/PhoneNumber.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/RemediatingAction.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Resource.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/SweepConfigurationV2.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/SweepCounterparty.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/SweepSchedule.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/TokenAuthentication.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/ValidationFacts.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/VerificationDeadline.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/VerificationError.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs (100%) rename Adyen/{ => src}/Model/ConfigurationWebhooks/Wallet.cs (100%) rename Adyen/{ => src}/Model/DataProtection/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/DataProtection/ServiceError.cs (100%) rename Adyen/{ => src}/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs (100%) rename Adyen/{ => src}/Model/DataProtection/SubjectErasureResponse.cs (100%) rename Adyen/{ => src}/Model/DisputeWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/DisputeWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/DisputeWebhooks/DisputeEventNotification.cs (100%) rename Adyen/{ => src}/Model/DisputeWebhooks/DisputeNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/Disputes/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Disputes/AcceptDisputeRequest.cs (100%) rename Adyen/{ => src}/Model/Disputes/AcceptDisputeResponse.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefendDisputeRequest.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefendDisputeResponse.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefenseDocument.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefenseDocumentType.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefenseReason.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefenseReasonsRequest.cs (100%) rename Adyen/{ => src}/Model/Disputes/DefenseReasonsResponse.cs (100%) rename Adyen/{ => src}/Model/Disputes/DeleteDefenseDocumentRequest.cs (100%) rename Adyen/{ => src}/Model/Disputes/DeleteDefenseDocumentResponse.cs (100%) rename Adyen/{ => src}/Model/Disputes/DisputeServiceResult.cs (100%) rename Adyen/{ => src}/Model/Disputes/ServiceError.cs (100%) rename Adyen/{ => src}/Model/Disputes/SupplyDefenseDocumentRequest.cs (100%) rename Adyen/{ => src}/Model/Disputes/SupplyDefenseDocumentResponse.cs (100%) rename Adyen/{ => src}/Model/Environment.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/AULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/AdditionalBankIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Address.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Amount.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Attachment.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BankAccountInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BirthData.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BusinessLine.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BusinessLineInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/BusinessLines.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CALocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CalculatePciStatusRequest.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CalculatePciStatusResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CapabilityProblem.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CapabilityProblemEntity.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CapabilitySettings.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/DKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Document.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/DocumentPage.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/DocumentReference.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/EntityReference.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/FinancialReport.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/HKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/HULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/IbanAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/IdentificationData.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Individual.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/LegalEntity.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/LegalEntityAssociation.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/LegalEntityCapability.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/LegalEntityInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/NOLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/NZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Name.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/OnboardingLink.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/OnboardingLinkInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/OnboardingLinkSettings.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/OnboardingTheme.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/OnboardingThemes.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Organization.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/OwnerEntity.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/PLLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/PciDocumentInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/PciSigningRequest.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/PciSigningResponse.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/PhoneNumber.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/RemediatingAction.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/SELocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/SGLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/ServiceError.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/SoleProprietorship.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/SourceOfFunds.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/StockData.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/SupportingEntityCapability.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/TaxInformation.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/TaxReportingClassification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/TransferInstrument.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/TransferInstrumentInfo.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/TransferInstrumentReference.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/Trust.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/UKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/USLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/UndefinedBeneficiary.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/UnincorporatedPartnership.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/VerificationDeadline.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/VerificationError.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/VerificationErrorRecursive.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/VerificationErrors.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/WebData.cs (100%) rename Adyen/{ => src}/Model/LegalEntityManagement/WebDataExemption.cs (100%) rename Adyen/{ => src}/Model/Management/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Management/AccelInfo.cs (100%) rename Adyen/{ => src}/Model/Management/AdditionalCommission.cs (100%) rename Adyen/{ => src}/Model/Management/AdditionalSettings.cs (100%) rename Adyen/{ => src}/Model/Management/AdditionalSettingsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Address.cs (100%) rename Adyen/{ => src}/Model/Management/AffirmInfo.cs (100%) rename Adyen/{ => src}/Model/Management/AfterpayTouchInfo.cs (100%) rename Adyen/{ => src}/Model/Management/AllowedOrigin.cs (100%) rename Adyen/{ => src}/Model/Management/AllowedOriginsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/AmexInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Amount.cs (100%) rename Adyen/{ => src}/Model/Management/AndroidApp.cs (100%) rename Adyen/{ => src}/Model/Management/AndroidAppError.cs (100%) rename Adyen/{ => src}/Model/Management/AndroidAppsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/AndroidCertificate.cs (100%) rename Adyen/{ => src}/Model/Management/AndroidCertificatesResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ApiCredential.cs (100%) rename Adyen/{ => src}/Model/Management/ApiCredentialLinks.cs (100%) rename Adyen/{ => src}/Model/Management/ApplePayInfo.cs (100%) rename Adyen/{ => src}/Model/Management/BcmcInfo.cs (100%) rename Adyen/{ => src}/Model/Management/BillingEntitiesResponse.cs (100%) rename Adyen/{ => src}/Model/Management/BillingEntity.cs (100%) rename Adyen/{ => src}/Model/Management/CardholderReceipt.cs (100%) rename Adyen/{ => src}/Model/Management/CartesBancairesInfo.cs (100%) rename Adyen/{ => src}/Model/Management/ClearpayInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Commission.cs (100%) rename Adyen/{ => src}/Model/Management/Company.cs (100%) rename Adyen/{ => src}/Model/Management/CompanyApiCredential.cs (100%) rename Adyen/{ => src}/Model/Management/CompanyLinks.cs (100%) rename Adyen/{ => src}/Model/Management/CompanyUser.cs (100%) rename Adyen/{ => src}/Model/Management/Connectivity.cs (100%) rename Adyen/{ => src}/Model/Management/Contact.cs (100%) rename Adyen/{ => src}/Model/Management/CreateAllowedOriginRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateApiCredentialResponse.cs (100%) rename Adyen/{ => src}/Model/Management/CreateCompanyApiCredentialRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateCompanyApiCredentialResponse.cs (100%) rename Adyen/{ => src}/Model/Management/CreateCompanyUserRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateCompanyUserResponse.cs (100%) rename Adyen/{ => src}/Model/Management/CreateCompanyWebhookRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateMerchantApiCredentialRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateMerchantRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateMerchantResponse.cs (100%) rename Adyen/{ => src}/Model/Management/CreateMerchantUserRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateMerchantWebhookRequest.cs (100%) rename Adyen/{ => src}/Model/Management/CreateUserResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Currency.cs (100%) rename Adyen/{ => src}/Model/Management/CustomNotification.cs (100%) rename Adyen/{ => src}/Model/Management/DataCenter.cs (100%) rename Adyen/{ => src}/Model/Management/DinersInfo.cs (100%) rename Adyen/{ => src}/Model/Management/EventUrl.cs (100%) rename Adyen/{ => src}/Model/Management/ExternalTerminalAction.cs (100%) rename Adyen/{ => src}/Model/Management/File.cs (100%) rename Adyen/{ => src}/Model/Management/GenerateApiKeyResponse.cs (100%) rename Adyen/{ => src}/Model/Management/GenerateClientKeyResponse.cs (100%) rename Adyen/{ => src}/Model/Management/GenerateHmacKeyResponse.cs (100%) rename Adyen/{ => src}/Model/Management/GenericPmWithTdiInfo.cs (100%) rename Adyen/{ => src}/Model/Management/GiroPayInfo.cs (100%) rename Adyen/{ => src}/Model/Management/GooglePayInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Gratuity.cs (100%) rename Adyen/{ => src}/Model/Management/Hardware.cs (100%) rename Adyen/{ => src}/Model/Management/IdName.cs (100%) rename Adyen/{ => src}/Model/Management/InstallAndroidAppDetails.cs (100%) rename Adyen/{ => src}/Model/Management/InstallAndroidCertificateDetails.cs (100%) rename Adyen/{ => src}/Model/Management/InvalidField.cs (100%) rename Adyen/{ => src}/Model/Management/JCBInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Key.cs (100%) rename Adyen/{ => src}/Model/Management/KlarnaInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Links.cs (100%) rename Adyen/{ => src}/Model/Management/LinksElement.cs (100%) rename Adyen/{ => src}/Model/Management/ListCompanyApiCredentialsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListCompanyResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListCompanyUsersResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListExternalTerminalActionsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListMerchantApiCredentialsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListMerchantResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListMerchantUsersResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListStoresResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListTerminalsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/ListWebhooksResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Localization.cs (100%) rename Adyen/{ => src}/Model/Management/Logo.cs (100%) rename Adyen/{ => src}/Model/Management/MeApiCredential.cs (100%) rename Adyen/{ => src}/Model/Management/MealVoucherFRInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Merchant.cs (100%) rename Adyen/{ => src}/Model/Management/MerchantLinks.cs (100%) rename Adyen/{ => src}/Model/Management/MinorUnitsMonetaryValue.cs (100%) rename Adyen/{ => src}/Model/Management/ModelConfiguration.cs (100%) rename Adyen/{ => src}/Model/Management/Name.cs (100%) rename Adyen/{ => src}/Model/Management/Name2.cs (100%) rename Adyen/{ => src}/Model/Management/Nexo.cs (100%) rename Adyen/{ => src}/Model/Management/Notification.cs (100%) rename Adyen/{ => src}/Model/Management/NotificationUrl.cs (100%) rename Adyen/{ => src}/Model/Management/NyceInfo.cs (100%) rename Adyen/{ => src}/Model/Management/OfflineProcessing.cs (100%) rename Adyen/{ => src}/Model/Management/Opi.cs (100%) rename Adyen/{ => src}/Model/Management/OrderItem.cs (100%) rename Adyen/{ => src}/Model/Management/PaginationLinks.cs (100%) rename Adyen/{ => src}/Model/Management/Passcodes.cs (100%) rename Adyen/{ => src}/Model/Management/PayAtTable.cs (100%) rename Adyen/{ => src}/Model/Management/PayMeInfo.cs (100%) rename Adyen/{ => src}/Model/Management/PayPalInfo.cs (100%) rename Adyen/{ => src}/Model/Management/PayToInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Payment.cs (100%) rename Adyen/{ => src}/Model/Management/PaymentMethod.cs (100%) rename Adyen/{ => src}/Model/Management/PaymentMethodResponse.cs (100%) rename Adyen/{ => src}/Model/Management/PaymentMethodSetupInfo.cs (100%) rename Adyen/{ => src}/Model/Management/PayoutSettings.cs (100%) rename Adyen/{ => src}/Model/Management/PayoutSettingsRequest.cs (100%) rename Adyen/{ => src}/Model/Management/PayoutSettingsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Profile.cs (100%) rename Adyen/{ => src}/Model/Management/PulseInfo.cs (100%) rename Adyen/{ => src}/Model/Management/ReceiptOptions.cs (100%) rename Adyen/{ => src}/Model/Management/ReceiptPrinting.cs (100%) rename Adyen/{ => src}/Model/Management/Referenced.cs (100%) rename Adyen/{ => src}/Model/Management/Refunds.cs (100%) rename Adyen/{ => src}/Model/Management/ReleaseUpdateDetails.cs (100%) rename Adyen/{ => src}/Model/Management/ReprocessAndroidAppResponse.cs (100%) rename Adyen/{ => src}/Model/Management/RequestActivationResponse.cs (100%) rename Adyen/{ => src}/Model/Management/RestServiceError.cs (100%) rename Adyen/{ => src}/Model/Management/ScheduleTerminalActionsRequest.cs (100%) rename Adyen/{ => src}/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs (100%) rename Adyen/{ => src}/Model/Management/ScheduleTerminalActionsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Settings.cs (100%) rename Adyen/{ => src}/Model/Management/ShippingLocation.cs (100%) rename Adyen/{ => src}/Model/Management/ShippingLocationsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Signature.cs (100%) rename Adyen/{ => src}/Model/Management/SodexoInfo.cs (100%) rename Adyen/{ => src}/Model/Management/SofortInfo.cs (100%) rename Adyen/{ => src}/Model/Management/SplitConfiguration.cs (100%) rename Adyen/{ => src}/Model/Management/SplitConfigurationList.cs (100%) rename Adyen/{ => src}/Model/Management/SplitConfigurationLogic.cs (100%) rename Adyen/{ => src}/Model/Management/SplitConfigurationRule.cs (100%) rename Adyen/{ => src}/Model/Management/Standalone.cs (100%) rename Adyen/{ => src}/Model/Management/StarInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Store.cs (100%) rename Adyen/{ => src}/Model/Management/StoreAndForward.cs (100%) rename Adyen/{ => src}/Model/Management/StoreCreationRequest.cs (100%) rename Adyen/{ => src}/Model/Management/StoreCreationWithMerchantCodeRequest.cs (100%) rename Adyen/{ => src}/Model/Management/StoreLocation.cs (100%) rename Adyen/{ => src}/Model/Management/StoreSplitConfiguration.cs (100%) rename Adyen/{ => src}/Model/Management/SupportedCardTypes.cs (100%) rename Adyen/{ => src}/Model/Management/Surcharge.cs (100%) rename Adyen/{ => src}/Model/Management/SwishInfo.cs (100%) rename Adyen/{ => src}/Model/Management/TapToPay.cs (100%) rename Adyen/{ => src}/Model/Management/Terminal.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalActionScheduleDetail.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalAssignment.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalConnectivity.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalConnectivityBluetooth.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalConnectivityCellular.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalConnectivityEthernet.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalConnectivityWifi.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalInstructions.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalModelsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalOrder.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalOrderRequest.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalOrdersResponse.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalProduct.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalProductPrice.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalProductsResponse.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalReassignmentRequest.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalReassignmentTarget.cs (100%) rename Adyen/{ => src}/Model/Management/TerminalSettings.cs (100%) rename Adyen/{ => src}/Model/Management/TestCompanyWebhookRequest.cs (100%) rename Adyen/{ => src}/Model/Management/TestOutput.cs (100%) rename Adyen/{ => src}/Model/Management/TestWebhookRequest.cs (100%) rename Adyen/{ => src}/Model/Management/TestWebhookResponse.cs (100%) rename Adyen/{ => src}/Model/Management/TicketInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Timeouts.cs (100%) rename Adyen/{ => src}/Model/Management/TransactionDescriptionInfo.cs (100%) rename Adyen/{ => src}/Model/Management/TwintInfo.cs (100%) rename Adyen/{ => src}/Model/Management/UninstallAndroidAppDetails.cs (100%) rename Adyen/{ => src}/Model/Management/UninstallAndroidCertificateDetails.cs (100%) rename Adyen/{ => src}/Model/Management/UpdatableAddress.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateCompanyApiCredentialRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateCompanyUserRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateCompanyWebhookRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateMerchantApiCredentialRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateMerchantUserRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateMerchantWebhookRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdatePaymentMethodInfo.cs (100%) rename Adyen/{ => src}/Model/Management/UpdatePayoutSettingsRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateSplitConfigurationLogicRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateSplitConfigurationRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateSplitConfigurationRuleRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UpdateStoreRequest.cs (100%) rename Adyen/{ => src}/Model/Management/UploadAndroidAppResponse.cs (100%) rename Adyen/{ => src}/Model/Management/UploadAndroidCertificateResponse.cs (100%) rename Adyen/{ => src}/Model/Management/Url.cs (100%) rename Adyen/{ => src}/Model/Management/User.cs (100%) rename Adyen/{ => src}/Model/Management/VippsInfo.cs (100%) rename Adyen/{ => src}/Model/Management/WeChatPayInfo.cs (100%) rename Adyen/{ => src}/Model/Management/WeChatPayPosInfo.cs (100%) rename Adyen/{ => src}/Model/Management/Webhook.cs (100%) rename Adyen/{ => src}/Model/Management/WebhookLinks.cs (100%) rename Adyen/{ => src}/Model/Management/WifiProfiles.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/AccountCapabilityData.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/AccountCreateNotificationData.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/AccountNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/AccountUpdateNotificationData.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/CapabilityProblem.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/CapabilityProblemEntity.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/MidServiceNotificationData.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/RemediatingAction.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalBoardingData.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalSettingsData.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/VerificationError.cs (100%) rename Adyen/{ => src}/Model/ManagementWebhooks/VerificationErrorRecursive.cs (100%) rename Adyen/{ => src}/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/NegativeBalanceWarningWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs (100%) rename Adyen/{ => src}/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/NegativeBalanceWarningWebhooks/Resource.cs (100%) rename Adyen/{ => src}/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs (100%) rename Adyen/{ => src}/Model/Notification/NotificationRequest.cs (100%) rename Adyen/{ => src}/Model/Notification/NotificationRequestConst.cs (100%) rename Adyen/{ => src}/Model/Notification/NotificationRequestItem.cs (100%) rename Adyen/{ => src}/Model/Notification/NotificationRequestItemContainer.cs (100%) rename Adyen/{ => src}/Model/Payment/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Payment/AccountInfo.cs (100%) rename Adyen/{ => src}/Model/Payment/AcctInfo.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalData3DSecure.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataAirline.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataCarRental.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataCommon.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataLevel23.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataLodging.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataModifications.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataOpenInvoice.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataOpi.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataRatepay.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataRetry.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataRisk.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataRiskStandalone.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataSubMerchant.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataTemporaryServices.cs (100%) rename Adyen/{ => src}/Model/Payment/AdditionalDataWallets.cs (100%) rename Adyen/{ => src}/Model/Payment/Address.cs (100%) rename Adyen/{ => src}/Model/Payment/AdjustAuthorisationRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/Amount.cs (100%) rename Adyen/{ => src}/Model/Payment/ApplicationInfo.cs (100%) rename Adyen/{ => src}/Model/Payment/AuthenticationResultRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/AuthenticationResultResponse.cs (100%) rename Adyen/{ => src}/Model/Payment/BankAccount.cs (100%) rename Adyen/{ => src}/Model/Payment/BrowserInfo.cs (100%) rename Adyen/{ => src}/Model/Payment/CancelOrRefundRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/CancelRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/CaptureRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/Card.cs (100%) rename Adyen/{ => src}/Model/Payment/CommonField.cs (100%) rename Adyen/{ => src}/Model/Payment/DeviceRenderOptions.cs (100%) rename Adyen/{ => src}/Model/Payment/DonationRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/ExternalPlatform.cs (100%) rename Adyen/{ => src}/Model/Payment/ForexQuote.cs (100%) rename Adyen/{ => src}/Model/Payment/FraudCheckResult.cs (100%) rename Adyen/{ => src}/Model/Payment/FraudCheckResultWrapper.cs (100%) rename Adyen/{ => src}/Model/Payment/FraudResult.cs (100%) rename Adyen/{ => src}/Model/Payment/FundDestination.cs (100%) rename Adyen/{ => src}/Model/Payment/FundSource.cs (100%) rename Adyen/{ => src}/Model/Payment/Installments.cs (100%) rename Adyen/{ => src}/Model/Payment/Mandate.cs (100%) rename Adyen/{ => src}/Model/Payment/MerchantDevice.cs (100%) rename Adyen/{ => src}/Model/Payment/MerchantRiskIndicator.cs (100%) rename Adyen/{ => src}/Model/Payment/ModificationResult.cs (100%) rename Adyen/{ => src}/Model/Payment/Name.cs (100%) rename Adyen/{ => src}/Model/Payment/PaymentRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/PaymentRequest3d.cs (100%) rename Adyen/{ => src}/Model/Payment/PaymentRequest3ds2.cs (100%) rename Adyen/{ => src}/Model/Payment/PaymentResult.cs (100%) rename Adyen/{ => src}/Model/Payment/Phone.cs (100%) rename Adyen/{ => src}/Model/Payment/PlatformChargebackLogic.cs (100%) rename Adyen/{ => src}/Model/Payment/Recurring.cs (100%) rename Adyen/{ => src}/Model/Payment/RefundRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalData3DSecure.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataBillingAddress.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataCard.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataCommon.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataDomesticError.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataInstallments.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataNetworkTokens.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataOpi.cs (100%) rename Adyen/{ => src}/Model/Payment/ResponseAdditionalDataSepa.cs (100%) rename Adyen/{ => src}/Model/Payment/SDKEphemPubKey.cs (100%) rename Adyen/{ => src}/Model/Payment/SecureRemoteCommerceCheckoutData.cs (100%) rename Adyen/{ => src}/Model/Payment/ServiceError.cs (100%) rename Adyen/{ => src}/Model/Payment/ShopperInteractionDevice.cs (100%) rename Adyen/{ => src}/Model/Payment/Split.cs (100%) rename Adyen/{ => src}/Model/Payment/SplitAmount.cs (100%) rename Adyen/{ => src}/Model/Payment/SubMerchant.cs (100%) rename Adyen/{ => src}/Model/Payment/TechnicalCancelRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDS1Result.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDS2RequestData.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDS2Result.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDS2ResultRequest.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDS2ResultResponse.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs (100%) rename Adyen/{ => src}/Model/Payment/ThreeDSecureData.cs (100%) rename Adyen/{ => src}/Model/Payment/VoidPendingRefundRequest.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/BoardingTokenRequest.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/BoardingTokenResponse.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/DefaultErrorResponseEntity.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/InvalidField.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/PaymentsAppDto.cs (100%) rename Adyen/{ => src}/Model/PaymentsApp/PaymentsAppResponse.cs (100%) rename Adyen/{ => src}/Model/Payout/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Payout/Address.cs (100%) rename Adyen/{ => src}/Model/Payout/Amount.cs (100%) rename Adyen/{ => src}/Model/Payout/BankAccount.cs (100%) rename Adyen/{ => src}/Model/Payout/Card.cs (100%) rename Adyen/{ => src}/Model/Payout/FraudCheckResult.cs (100%) rename Adyen/{ => src}/Model/Payout/FraudCheckResultWrapper.cs (100%) rename Adyen/{ => src}/Model/Payout/FraudResult.cs (100%) rename Adyen/{ => src}/Model/Payout/FundSource.cs (100%) rename Adyen/{ => src}/Model/Payout/ModifyRequest.cs (100%) rename Adyen/{ => src}/Model/Payout/ModifyResponse.cs (100%) rename Adyen/{ => src}/Model/Payout/Name.cs (100%) rename Adyen/{ => src}/Model/Payout/PayoutRequest.cs (100%) rename Adyen/{ => src}/Model/Payout/PayoutResponse.cs (100%) rename Adyen/{ => src}/Model/Payout/Recurring.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalData3DSecure.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataBillingAddress.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataCard.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataCommon.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataDomesticError.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataInstallments.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataNetworkTokens.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataOpi.cs (100%) rename Adyen/{ => src}/Model/Payout/ResponseAdditionalDataSepa.cs (100%) rename Adyen/{ => src}/Model/Payout/ServiceError.cs (100%) rename Adyen/{ => src}/Model/Payout/StoreDetailAndSubmitRequest.cs (100%) rename Adyen/{ => src}/Model/Payout/StoreDetailAndSubmitResponse.cs (100%) rename Adyen/{ => src}/Model/Payout/StoreDetailRequest.cs (100%) rename Adyen/{ => src}/Model/Payout/StoreDetailResponse.cs (100%) rename Adyen/{ => src}/Model/Payout/SubmitRequest.cs (100%) rename Adyen/{ => src}/Model/Payout/SubmitResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/Account.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/AccountEvent.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/AccountHolderDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/AccountHolderStatus.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/AccountPayoutState.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/AccountProcessingState.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/Amount.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/BankAccountDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/BusinessDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CloseAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CloseAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CloseAccountRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CloseAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CloseStoresRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CreateAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CreateAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CreateAccountRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/CreateAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/DeleteBankAccountRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/DeletePayoutMethodRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/DeleteShareholderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/DeleteSignatoriesRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/DocumentDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ErrorFieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/FieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GenericResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetTaxFormRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetTaxFormResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/IndividualDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCCheckStatusData.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCCheckSummary.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCShareholderCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCSignatoryCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/KYCVerificationResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/LegalArrangementDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/LegalArrangementEntityDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/LegalArrangementRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/MigratedAccounts.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/MigratedShareholders.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/MigratedStores.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/MigrationData.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/PayoutMethod.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/PayoutScheduleResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/PerformVerificationRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/PersonalDocumentData.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ServiceError.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ShareholderContact.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/SignatoryContact.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/StoreDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/SuspendAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/SuspendAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UltimateParentCompany.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UpdateAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UpdateAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UpdateAccountRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UpdateAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/UploadDocumentRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ViasAddress.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ViasName.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ViasPersonalData.cs (100%) rename Adyen/{ => src}/Model/PlatformsAccount/ViasPhoneNumber.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AccountDetailBalance.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AccountHolderBalanceRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AccountHolderBalanceResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AccountHolderTransactionListRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AccountHolderTransactionListResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/AccountTransactionList.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/Amount.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/BankAccountDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/DebitAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/DebitAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/DetailBalance.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/ErrorFieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/FieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/PayoutAccountHolderRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/PayoutAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/RefundFundsTransferRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/RefundFundsTransferResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/ServiceError.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/SetupBeneficiaryRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/SetupBeneficiaryResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/Split.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/SplitAmount.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/Transaction.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/TransactionListForAccount.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/TransferFundsRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsFund/TransferFundsResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/CollectInformation.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/FieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/ServiceError.cs (100%) rename Adyen/{ => src}/Model/PlatformsHostedOnboardingPage/ShowPages.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/FieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/GenericResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/ServiceError.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountCloseNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountCreateNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountEvent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderStatus.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountPayoutState.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountProcessingState.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/AccountUpdateNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/BankAccountDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/BusinessDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/CloseAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/CreateAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ErrorFieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/FieldType.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/IndividualDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCCheckStatusData.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCCheckSummary.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/KYCVerificationResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/LegalArrangementDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/LocalDate.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/Message.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/NotificationErrorContainer.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/NotificationResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/OperationStatus.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/PaymentFailureNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/PayoutMethod.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/PayoutScheduleResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/PersonalDocumentData.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/RefundResult.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ReportAvailableNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ShareholderContact.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/SignatoryContact.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/Split.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/SplitAmount.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/StoreDetail.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/Transaction.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/TransferFundsNotification.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/UltimateParentCompany.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/UpdateAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ViasAddress.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ViasName.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ViasPersonalData.cs (100%) rename Adyen/{ => src}/Model/PlatformsWebhooks/ViasPhoneNumber.cs (100%) rename Adyen/{ => src}/Model/PosMobile/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PosMobile/CreateSessionRequest.cs (100%) rename Adyen/{ => src}/Model/PosMobile/CreateSessionResponse.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/Address.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/AssignTerminalsRequest.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/AssignTerminalsResponse.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/FindTerminalRequest.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/FindTerminalResponse.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/MerchantAccount.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/ServiceError.cs (100%) rename Adyen/{ => src}/Model/PosTerminalManagement/Store.cs (100%) rename Adyen/{ => src}/Model/Recurring/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Recurring/Address.cs (100%) rename Adyen/{ => src}/Model/Recurring/Amount.cs (100%) rename Adyen/{ => src}/Model/Recurring/BankAccount.cs (100%) rename Adyen/{ => src}/Model/Recurring/Card.cs (100%) rename Adyen/{ => src}/Model/Recurring/CreatePermitRequest.cs (100%) rename Adyen/{ => src}/Model/Recurring/CreatePermitResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/DisablePermitRequest.cs (100%) rename Adyen/{ => src}/Model/Recurring/DisablePermitResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/DisableRequest.cs (100%) rename Adyen/{ => src}/Model/Recurring/DisableResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/Name.cs (100%) rename Adyen/{ => src}/Model/Recurring/NotifyShopperRequest.cs (100%) rename Adyen/{ => src}/Model/Recurring/NotifyShopperResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/Permit.cs (100%) rename Adyen/{ => src}/Model/Recurring/PermitRestriction.cs (100%) rename Adyen/{ => src}/Model/Recurring/PermitResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/Recurring.cs (100%) rename Adyen/{ => src}/Model/Recurring/RecurringDetail.cs (100%) rename Adyen/{ => src}/Model/Recurring/RecurringDetailWrapper.cs (100%) rename Adyen/{ => src}/Model/Recurring/RecurringDetailsRequest.cs (100%) rename Adyen/{ => src}/Model/Recurring/RecurringDetailsResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/ScheduleAccountUpdaterRequest.cs (100%) rename Adyen/{ => src}/Model/Recurring/ScheduleAccountUpdaterResult.cs (100%) rename Adyen/{ => src}/Model/Recurring/ServiceError.cs (100%) rename Adyen/{ => src}/Model/Recurring/TokenDetails.cs (100%) rename Adyen/{ => src}/Model/ReportWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/ReportWebhooks/ReportNotificationData.cs (100%) rename Adyen/{ => src}/Model/ReportWebhooks/ReportNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/ReportWebhooks/Resource.cs (100%) rename Adyen/{ => src}/Model/ReportWebhooks/ResourceReference.cs (100%) rename Adyen/{ => src}/Model/RequestOptions.cs (100%) rename Adyen/{ => src}/Model/StoredValue/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/StoredValue/Amount.cs (100%) rename Adyen/{ => src}/Model/StoredValue/ServiceError.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueBalanceCheckRequest.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueBalanceCheckResponse.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueBalanceMergeRequest.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueBalanceMergeResponse.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueIssueRequest.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueIssueResponse.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueLoadRequest.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueLoadResponse.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueStatusChangeRequest.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueStatusChangeResponse.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueVoidRequest.cs (100%) rename Adyen/{ => src}/Model/StoredValue/StoredValueVoidResponse.cs (100%) rename Adyen/{ => src}/Model/Terminal/SaleToAcquirerData.cs (100%) rename Adyen/{ => src}/Model/Terminal/Split.cs (100%) rename Adyen/{ => src}/Model/Terminal/SplitItem.cs (100%) rename Adyen/{ => src}/Model/Terminal/SplitItemType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AbortRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AccountType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AdminRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AdminResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AlgorithmIdentifier.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AlgorithmType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AlignmentType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AllowedProduct.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Amount.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AmountsReq.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AmountsResp.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AreaSize.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AuthenticatedData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/AuthenticationMethodType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/BalanceInquiryRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/BalanceInquiryResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/BarcodeType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/BatchRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/BatchResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CapturedSignature.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardAcquisitionRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardAcquisitionResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardAcquisitionTransaction.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardReaderAPDURequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardReaderAPDUResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardReaderInitRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardReaderInitResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardReaderPowerOffRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardReaderPowerOffResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CardholderPIN.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CashHandlingDevice.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CharacterHeightType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CharacterStyleType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CharacterWidthType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CheckData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CheckTypeCodeType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CoinsOrBills.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ColorType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ContentInformation.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ContentType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CurrencyConversion.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CustomerOrder.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/CustomerOrderReqType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DeviceType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DiagnosisRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DiagnosisResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DigestedData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DisplayOutput.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DisplayRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DisplayResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/DocumentQualifierType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EnableServiceRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EnableServiceResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EncapsulatedContent.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EncryptedContent.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EntryModeType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EnvelopedData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ErrorConditionType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EventNotification.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/EventToNotifyType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ForceTypeModeType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/GenericProfileType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/GeographicCoordinates.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Geolocation.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/GetTotalsRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/GetTotalsResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/GlobalStatusType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/HostStatus.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ICCResetData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/IdentificationSupportType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/IdentificationType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InfoQualifyType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Input.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InputCommandType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InputData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InputRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InputResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InputResult.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/InputUpdate.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Instalment.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/IssuerAndSerialNumber.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/KEK.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/KEKIdentifier.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/KeyTransport.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoginRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoginResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LogoutRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LogoutResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyAccount.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyAccountID.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyAccountReq.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyAccountStatus.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyAcquirerData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyAmount.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyHandlingType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyResult.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyTotals.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyTransaction.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyTransactionType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/LoyaltyUnitType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MenuEntry.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MenuEntryTagType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Message/SaleToPOIRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MessageCategoryType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MessageClassType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MessageHeader.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MessageReference.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MessageType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/MobileData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/NamedKeyEncryptedData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/OriginalPOITransaction.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/OutputBarcode.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/OutputContent.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/OutputFormatType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/OutputResult.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/OutputText.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PINFormatType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PINRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PINRequestType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PINResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/POIData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/POIProfile.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/POISoftware.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/POIStatus.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/POISystemData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/POITerminalData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Parameter.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentAccountReq.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentAccountStatus.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentAcquirerData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentInstrumentData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentInstrumentType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentReceipt.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentResult.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentToken.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentTotals.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentTransaction.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PaymentType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PerformedTransaction.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PeriodUnitType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PredefinedContent.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PrintOutput.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PrintRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PrintResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/PrinterStatusType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Rebates.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/RecipientIdentifier.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ReconciliationRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ReconciliationResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ReconciliationType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/RelativeDistinguishedName.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/RepeatedMessageResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/RepeatedResponseMessageBody.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Response.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ResponseModeType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ResultType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ReversalReasonType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ReversalRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/ReversalResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleItem.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleItemRebate.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleProfile.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleSoftware.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleTerminalData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleToIssuerData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleToPOIMessage.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SaleToPOIResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SensitiveCardData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SensitiveMobileData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SignaturePoint.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SignedData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/Signer.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SignerIdentifier.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SoundActionType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SoundContent.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SoundFormatType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SoundRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SoundResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/SponsoredMerchant.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueAccountID.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueAccountStatus.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueAccountType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueResult.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/StoredValueTransactionType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TerminalEnvironmentType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TokenRequestedType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TotalDetailsType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TotalFilter.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TrackData.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TrackFormatType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionActionType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionConditions.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionIdentification.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionStatusRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionStatusResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionToPerform.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionTotals.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransactionType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransmitRequest.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/TransmitResponse.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/UTMCoordinates.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/UnitOfMeasureType.cs (100%) rename Adyen/{ => src}/Model/TerminalApi/VersionType.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/BankCategoryData.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/InternalCategoryData.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/IssuedCard.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/PaymentInstrument.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/PlatformPayment.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/RelayedAuthorisationData.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/Resource.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/ResourceReference.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/ThreeDSecure.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/Transaction.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/TransferNotificationValidationFact.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/TransferView.cs (100%) rename Adyen/{ => src}/Model/TransactionWebhooks/TransferViewCategoryData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/AULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/AdditionalBankIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Address.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Airline.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Amount.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/AmountAdjustment.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/BRLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/BalanceMutation.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/BankAccountV3.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/BankCategoryData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/CALocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/CZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Card.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/CardIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/ConfirmationTrackingData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/CounterpartyV3.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/DKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/DirectDebitInformation.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/EstimationTrackingData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/ExternalReason.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/HKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/HULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/IbanAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/InternalCategoryData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/InternalReviewTrackingData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/IssuedCard.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/IssuingTransactionData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Leg.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Lodging.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/MerchantData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/MerchantPurchaseData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Modification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/NOLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/NZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/NameLocation.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/PLLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/PartyIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/PaymentInstrument.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/PlatformPayment.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/RelayedAuthorisationData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/Resource.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/ResourceReference.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/SELocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/SGLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransactionEventViolation.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransactionRuleReference.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransactionRuleSource.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransactionRulesResult.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferDataCategoryData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferDataTracking.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferEvent.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferEventEventsDataInner.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferEventTrackingData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferNotificationCounterParty.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferNotificationMerchantData.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferNotificationRequest.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferNotificationValidationFact.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/TransferReview.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/UKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/TransferWebhooks/USLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/AULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/AbstractOpenAPISchema.cs (100%) rename Adyen/{ => src}/Model/Transfers/AdditionalBankIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/Address.cs (100%) rename Adyen/{ => src}/Model/Transfers/Airline.cs (100%) rename Adyen/{ => src}/Model/Transfers/Amount.cs (100%) rename Adyen/{ => src}/Model/Transfers/AmountAdjustment.cs (100%) rename Adyen/{ => src}/Model/Transfers/ApproveTransfersRequest.cs (100%) rename Adyen/{ => src}/Model/Transfers/BRLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/BalanceMutation.cs (100%) rename Adyen/{ => src}/Model/Transfers/BankAccountV3.cs (100%) rename Adyen/{ => src}/Model/Transfers/BankAccountV3AccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/BankCategoryData.cs (100%) rename Adyen/{ => src}/Model/Transfers/CALocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/CZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/CancelTransfersRequest.cs (100%) rename Adyen/{ => src}/Model/Transfers/CapitalBalance.cs (100%) rename Adyen/{ => src}/Model/Transfers/CapitalGrant.cs (100%) rename Adyen/{ => src}/Model/Transfers/CapitalGrantInfo.cs (100%) rename Adyen/{ => src}/Model/Transfers/CapitalGrants.cs (100%) rename Adyen/{ => src}/Model/Transfers/Card.cs (100%) rename Adyen/{ => src}/Model/Transfers/CardIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/ConfirmationTrackingData.cs (100%) rename Adyen/{ => src}/Model/Transfers/Counterparty.cs (100%) rename Adyen/{ => src}/Model/Transfers/CounterpartyInfoV3.cs (100%) rename Adyen/{ => src}/Model/Transfers/CounterpartyV3.cs (100%) rename Adyen/{ => src}/Model/Transfers/DKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/DirectDebitInformation.cs (100%) rename Adyen/{ => src}/Model/Transfers/EstimationTrackingData.cs (100%) rename Adyen/{ => src}/Model/Transfers/ExternalReason.cs (100%) rename Adyen/{ => src}/Model/Transfers/Fee.cs (100%) rename Adyen/{ => src}/Model/Transfers/FindTransfersResponse.cs (100%) rename Adyen/{ => src}/Model/Transfers/HKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/HULocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/IbanAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/InternalCategoryData.cs (100%) rename Adyen/{ => src}/Model/Transfers/InternalReviewTrackingData.cs (100%) rename Adyen/{ => src}/Model/Transfers/InvalidField.cs (100%) rename Adyen/{ => src}/Model/Transfers/IssuedCard.cs (100%) rename Adyen/{ => src}/Model/Transfers/IssuingTransactionData.cs (100%) rename Adyen/{ => src}/Model/Transfers/Leg.cs (100%) rename Adyen/{ => src}/Model/Transfers/Link.cs (100%) rename Adyen/{ => src}/Model/Transfers/Links.cs (100%) rename Adyen/{ => src}/Model/Transfers/Lodging.cs (100%) rename Adyen/{ => src}/Model/Transfers/MerchantData.cs (100%) rename Adyen/{ => src}/Model/Transfers/MerchantPurchaseData.cs (100%) rename Adyen/{ => src}/Model/Transfers/Modification.cs (100%) rename Adyen/{ => src}/Model/Transfers/NOLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/NZLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/NameLocation.cs (100%) rename Adyen/{ => src}/Model/Transfers/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/PLLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/PartyIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/PaymentInstrument.cs (100%) rename Adyen/{ => src}/Model/Transfers/PlatformPayment.cs (100%) rename Adyen/{ => src}/Model/Transfers/RelayedAuthorisationData.cs (100%) rename Adyen/{ => src}/Model/Transfers/Repayment.cs (100%) rename Adyen/{ => src}/Model/Transfers/RepaymentTerm.cs (100%) rename Adyen/{ => src}/Model/Transfers/ResourceReference.cs (100%) rename Adyen/{ => src}/Model/Transfers/RestServiceError.cs (100%) rename Adyen/{ => src}/Model/Transfers/ReturnTransferRequest.cs (100%) rename Adyen/{ => src}/Model/Transfers/ReturnTransferResponse.cs (100%) rename Adyen/{ => src}/Model/Transfers/RoutingDetails.cs (100%) rename Adyen/{ => src}/Model/Transfers/SELocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/SGLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/ServiceError.cs (100%) rename Adyen/{ => src}/Model/Transfers/ThresholdRepayment.cs (100%) rename Adyen/{ => src}/Model/Transfers/Transaction.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransactionEventViolation.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransactionRuleReference.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransactionRuleSource.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransactionRulesResult.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransactionSearchResponse.cs (100%) rename Adyen/{ => src}/Model/Transfers/Transfer.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferCategoryData.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferData.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferDataTracking.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferEvent.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferEventEventsDataInner.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferEventTrackingData.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferInfo.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferNotificationCounterParty.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferNotificationMerchantData.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferNotificationValidationFact.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferRequestReview.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferReview.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferServiceRestServiceError.cs (100%) rename Adyen/{ => src}/Model/Transfers/TransferView.cs (100%) rename Adyen/{ => src}/Model/Transfers/UKLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/USLocalAccountIdentification.cs (100%) rename Adyen/{ => src}/Model/Transfers/UltimatePartyIdentification.cs (100%) rename Adyen/{ => src}/Security/AesEncryptor.cs (100%) rename Adyen/{ => src}/Security/EncryptionCredentialDetails.cs (100%) rename Adyen/{ => src}/Security/EncryptionDerivedKey.cs (100%) rename Adyen/{ => src}/Security/EncryptionDerivedKeyGenerator.cs (100%) rename Adyen/{ => src}/Security/Exceptions/NexoCryptoException.cs (100%) rename Adyen/{ => src}/Security/Extension/ArrayExtension.cs (100%) rename Adyen/{ => src}/Security/HmacSha256Wrapper.cs (100%) rename Adyen/{ => src}/Security/IvModGenerator.cs (100%) rename Adyen/{ => src}/Security/SaleToPoiMessageSecured.cs (100%) rename Adyen/{ => src}/Security/SaleToPoiMessageSecuredEncryptor.cs (100%) rename Adyen/{ => src}/Security/SecurityTrailer.cs (100%) rename Adyen/{ => src}/Security/TerminalCommonNameValidator.cs (100%) rename Adyen/{ => src}/Service/AbstractService.cs (100%) rename Adyen/{ => src}/Service/ApiException.cs (100%) rename Adyen/{ => src}/Service/BalanceControlService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/AccountHoldersService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/BalanceAccountsService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/BankAccountValidationService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/CardOrdersService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/GrantAccountsService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/GrantOffersService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/ManageCardPINService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/ManageSCADevicesService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/NetworkTokensService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/PaymentInstrumentGroupsService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/PaymentInstrumentsService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/PlatformService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/TransactionRulesService.cs (100%) rename Adyen/{ => src}/Service/BalancePlatform/TransferRoutesService.cs (100%) rename Adyen/{ => src}/Service/BinLookupService.cs (100%) rename Adyen/{ => src}/Service/Checkout/DonationsService.cs (100%) rename Adyen/{ => src}/Service/Checkout/ModificationsService.cs (100%) rename Adyen/{ => src}/Service/Checkout/OrdersService.cs (100%) rename Adyen/{ => src}/Service/Checkout/PaymentLinksService.cs (100%) rename Adyen/{ => src}/Service/Checkout/PaymentsService.cs (100%) rename Adyen/{ => src}/Service/Checkout/RecurringService.cs (100%) rename Adyen/{ => src}/Service/Checkout/UtilityService.cs (100%) rename Adyen/{ => src}/Service/DataProtectionService.cs (100%) rename Adyen/{ => src}/Service/DisputesService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/BusinessLinesService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/DocumentsService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/HostedOnboardingService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/LegalEntitiesService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/PCIQuestionnairesService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/TermsOfServiceService.cs (100%) rename Adyen/{ => src}/Service/LegalEntityManagement/TransferInstrumentsService.cs (100%) rename Adyen/{ => src}/Service/Management/APICredentialsCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/APICredentialsMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/APIKeyCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/APIKeyMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/AccountCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/AccountMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/AccountStoreLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/AllowedOriginsCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/AllowedOriginsMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/AndroidFilesCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/ClientKeyCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/ClientKeyMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/MyAPICredentialService.cs (100%) rename Adyen/{ => src}/Service/Management/PaymentMethodsMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/PayoutSettingsMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/SplitConfigurationMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalActionsCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalActionsTerminalLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalOrdersCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalOrdersMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalSettingsCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalSettingsMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalSettingsStoreLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalSettingsTerminalLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/TerminalsTerminalLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/UsersCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/UsersMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/WebhooksCompanyLevelService.cs (100%) rename Adyen/{ => src}/Service/Management/WebhooksMerchantLevelService.cs (100%) rename Adyen/{ => src}/Service/PaymentService.cs (100%) rename Adyen/{ => src}/Service/PaymentsAppService.cs (100%) rename Adyen/{ => src}/Service/Payout/InitializationService.cs (100%) rename Adyen/{ => src}/Service/Payout/InstantPayoutsService.cs (100%) rename Adyen/{ => src}/Service/Payout/ReviewingService.cs (100%) rename Adyen/{ => src}/Service/PlatformsAccount/AccountHoldersService.cs (100%) rename Adyen/{ => src}/Service/PlatformsAccount/AccountsService.cs (100%) rename Adyen/{ => src}/Service/PlatformsAccount/VerificationService.cs (100%) rename Adyen/{ => src}/Service/PlatformsFundService.cs (100%) rename Adyen/{ => src}/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs (100%) rename Adyen/{ => src}/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs (100%) rename Adyen/{ => src}/Service/PlatformsNotificationConfigurationService.cs (100%) rename Adyen/{ => src}/Service/PosMobileService.cs (100%) rename Adyen/{ => src}/Service/PosTerminalManagementService.cs (100%) rename Adyen/{ => src}/Service/RecurringService.cs (100%) rename Adyen/{ => src}/Service/Resource/Terminal/TerminalApi.cs (100%) rename Adyen/{ => src}/Service/Resource/Terminal/TerminalApiAsyncClient.cs (100%) rename Adyen/{ => src}/Service/Resource/Terminal/TerminalApiLocal.cs (100%) rename Adyen/{ => src}/Service/Resource/Terminal/TerminalApiLocalClient.cs (100%) rename Adyen/{ => src}/Service/Resource/Terminal/TerminalApiSyncClient.cs (100%) rename Adyen/{ => src}/Service/ServiceResource.cs (100%) rename Adyen/{ => src}/Service/StoredValueService.cs (100%) rename Adyen/{ => src}/Service/TerminalApiAsyncService.cs (100%) rename Adyen/{ => src}/Service/TerminalApiLocalService.cs (100%) rename Adyen/{ => src}/Service/TerminalApiSyncService.cs (100%) rename Adyen/{ => src}/Service/TerminalCloudApi.cs (100%) rename Adyen/{ => src}/Service/TerminalLocalApi.cs (100%) rename Adyen/{ => src}/Service/TerminalLocalApiUnencrypted.cs (100%) rename Adyen/{ => src}/Service/Transfers/CapitalService.cs (100%) rename Adyen/{ => src}/Service/Transfers/TransactionsService.cs (100%) rename Adyen/{ => src}/Service/Transfers/TransfersService.cs (100%) rename Adyen/{ => src}/Util/ByteArrayConverter.cs (100%) rename Adyen/{ => src}/Util/HMACValidator.cs (100%) rename Adyen/{ => src}/Util/JsonOperation.cs (100%) rename Adyen/{ => src}/Util/TerminalApi/AdditionalResponse.cs (100%) rename Adyen/{ => src}/Util/TerminalApi/CardAcquisitionUtil.cs (100%) rename Adyen/{ => src}/Util/Util.cs (100%) rename Adyen/{ => src}/Webhooks/BalancePlatformWebhookHandler.cs (100%) rename Adyen/{ => src}/Webhooks/ClassicPlatformWebhookHandler.cs (100%) rename Adyen/{ => src}/Webhooks/ManagementWebhookHandler.cs (100%) rename Adyen/{ => src}/Webhooks/WebhookHandler.cs (100%) diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index 10619d977..f7f7a4088 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -56,4 +56,8 @@ + + + + diff --git a/Adyen/Core/JsonSerializerOptionsProvider.cs b/Adyen/Core/JsonSerializerOptionsProvider.cs deleted file mode 100644 index 5cc1a641e..000000000 --- a/Adyen/Core/JsonSerializerOptionsProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -#nullable enable - -using System.Text.Json; - -namespace Adyen.Core -{ - /// - /// Provides the . - /// - public class JsonSerializerOptionsProvider - { - /// - /// The . - /// - public JsonSerializerOptions Options { get; } - - /// - /// Instantiates a JsonSerializerOptionsProvider to access . - /// - public JsonSerializerOptionsProvider(JsonSerializerOptions options) - { - Options = options; - } - } -} \ No newline at end of file diff --git a/Adyen/ApiSerialization/Converter/JsonBase64Converter.cs b/Adyen/src/ApiSerialization/Converter/JsonBase64Converter.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/JsonBase64Converter.cs rename to Adyen/src/ApiSerialization/Converter/JsonBase64Converter.cs diff --git a/Adyen/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs b/Adyen/src/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs rename to Adyen/src/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs diff --git a/Adyen/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs b/Adyen/src/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs rename to Adyen/src/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs diff --git a/Adyen/ApiSerialization/Converter/SaleToPoiMessageConverter.cs b/Adyen/src/ApiSerialization/Converter/SaleToPoiMessageConverter.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/SaleToPoiMessageConverter.cs rename to Adyen/src/ApiSerialization/Converter/SaleToPoiMessageConverter.cs diff --git a/Adyen/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs b/Adyen/src/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs rename to Adyen/src/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs diff --git a/Adyen/ApiSerialization/IMessagePayload.cs b/Adyen/src/ApiSerialization/IMessagePayload.cs similarity index 100% rename from Adyen/ApiSerialization/IMessagePayload.cs rename to Adyen/src/ApiSerialization/IMessagePayload.cs diff --git a/Adyen/ApiSerialization/IMessagePayloadSerializer.cs b/Adyen/src/ApiSerialization/IMessagePayloadSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/IMessagePayloadSerializer.cs rename to Adyen/src/ApiSerialization/IMessagePayloadSerializer.cs diff --git a/Adyen/ApiSerialization/MessageHeaderSerializer.cs b/Adyen/src/ApiSerialization/MessageHeaderSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/MessageHeaderSerializer.cs rename to Adyen/src/ApiSerialization/MessageHeaderSerializer.cs diff --git a/Adyen/ApiSerialization/MessagePayloadSerializer.cs b/Adyen/src/ApiSerialization/MessagePayloadSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/MessagePayloadSerializer.cs rename to Adyen/src/ApiSerialization/MessagePayloadSerializer.cs diff --git a/Adyen/ApiSerialization/MessagePayloadSerializerFactory.cs b/Adyen/src/ApiSerialization/MessagePayloadSerializerFactory.cs similarity index 100% rename from Adyen/ApiSerialization/MessagePayloadSerializerFactory.cs rename to Adyen/src/ApiSerialization/MessagePayloadSerializerFactory.cs diff --git a/Adyen/ApiSerialization/OpenAPIDateConverter.cs b/Adyen/src/ApiSerialization/OpenAPIDateConverter.cs similarity index 100% rename from Adyen/ApiSerialization/OpenAPIDateConverter.cs rename to Adyen/src/ApiSerialization/OpenAPIDateConverter.cs diff --git a/Adyen/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs b/Adyen/src/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs rename to Adyen/src/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs diff --git a/Adyen/ApiSerialization/SaleToPoiMessageSerializer.cs b/Adyen/src/ApiSerialization/SaleToPoiMessageSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/SaleToPoiMessageSerializer.cs rename to Adyen/src/ApiSerialization/SaleToPoiMessageSerializer.cs diff --git a/Adyen/ApiSerialization/TypeHelper.cs b/Adyen/src/ApiSerialization/TypeHelper.cs similarity index 100% rename from Adyen/ApiSerialization/TypeHelper.cs rename to Adyen/src/ApiSerialization/TypeHelper.cs diff --git a/Adyen/Constants/ApiConstants.cs b/Adyen/src/Constants/ApiConstants.cs similarity index 100% rename from Adyen/Constants/ApiConstants.cs rename to Adyen/src/Constants/ApiConstants.cs diff --git a/Adyen/Constants/ClientConfig.cs b/Adyen/src/Constants/ClientConfig.cs similarity index 100% rename from Adyen/Constants/ClientConfig.cs rename to Adyen/src/Constants/ClientConfig.cs diff --git a/Adyen/Constants/Region.cs b/Adyen/src/Constants/Region.cs similarity index 100% rename from Adyen/Constants/Region.cs rename to Adyen/src/Constants/Region.cs diff --git a/Adyen/Exceptions/DeserializationException.cs b/Adyen/src/Exceptions/DeserializationException.cs similarity index 100% rename from Adyen/Exceptions/DeserializationException.cs rename to Adyen/src/Exceptions/DeserializationException.cs diff --git a/Adyen/Exceptions/ExceptionMessages.cs b/Adyen/src/Exceptions/ExceptionMessages.cs similarity index 100% rename from Adyen/Exceptions/ExceptionMessages.cs rename to Adyen/src/Exceptions/ExceptionMessages.cs diff --git a/Adyen/HttpClient/HttpClientException.cs b/Adyen/src/HttpClient/HttpClientException.cs similarity index 100% rename from Adyen/HttpClient/HttpClientException.cs rename to Adyen/src/HttpClient/HttpClientException.cs diff --git a/Adyen/HttpClient/HttpClientExtension.cs b/Adyen/src/HttpClient/HttpClientExtension.cs similarity index 100% rename from Adyen/HttpClient/HttpClientExtension.cs rename to Adyen/src/HttpClient/HttpClientExtension.cs diff --git a/Adyen/HttpClient/HttpClientWrapper.cs b/Adyen/src/HttpClient/HttpClientWrapper.cs similarity index 100% rename from Adyen/HttpClient/HttpClientWrapper.cs rename to Adyen/src/HttpClient/HttpClientWrapper.cs diff --git a/Adyen/HttpClient/Interfaces/IClient.cs b/Adyen/src/HttpClient/Interfaces/IClient.cs similarity index 100% rename from Adyen/HttpClient/Interfaces/IClient.cs rename to Adyen/src/HttpClient/Interfaces/IClient.cs diff --git a/Adyen/Model/AcsWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/AcsWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/AcsWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/AcsWebhooks/Amount.cs b/Adyen/src/Model/AcsWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/Amount.cs rename to Adyen/src/Model/AcsWebhooks/Amount.cs diff --git a/Adyen/Model/AcsWebhooks/AuthenticationDecision.cs b/Adyen/src/Model/AcsWebhooks/AuthenticationDecision.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/AuthenticationDecision.cs rename to Adyen/src/Model/AcsWebhooks/AuthenticationDecision.cs diff --git a/Adyen/Model/AcsWebhooks/AuthenticationInfo.cs b/Adyen/src/Model/AcsWebhooks/AuthenticationInfo.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/AuthenticationInfo.cs rename to Adyen/src/Model/AcsWebhooks/AuthenticationInfo.cs diff --git a/Adyen/Model/AcsWebhooks/AuthenticationNotificationData.cs b/Adyen/src/Model/AcsWebhooks/AuthenticationNotificationData.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/AuthenticationNotificationData.cs rename to Adyen/src/Model/AcsWebhooks/AuthenticationNotificationData.cs diff --git a/Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.cs b/Adyen/src/Model/AcsWebhooks/AuthenticationNotificationRequest.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.cs rename to Adyen/src/Model/AcsWebhooks/AuthenticationNotificationRequest.cs diff --git a/Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/src/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/src/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/Model/AcsWebhooks/ChallengeInfo.cs b/Adyen/src/Model/AcsWebhooks/ChallengeInfo.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/ChallengeInfo.cs rename to Adyen/src/Model/AcsWebhooks/ChallengeInfo.cs diff --git a/Adyen/Model/AcsWebhooks/Purchase.cs b/Adyen/src/Model/AcsWebhooks/Purchase.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/Purchase.cs rename to Adyen/src/Model/AcsWebhooks/Purchase.cs diff --git a/Adyen/Model/AcsWebhooks/PurchaseInfo.cs b/Adyen/src/Model/AcsWebhooks/PurchaseInfo.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/PurchaseInfo.cs rename to Adyen/src/Model/AcsWebhooks/PurchaseInfo.cs diff --git a/Adyen/Model/AcsWebhooks/RelayedAuthenticationRequest.cs b/Adyen/src/Model/AcsWebhooks/RelayedAuthenticationRequest.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/RelayedAuthenticationRequest.cs rename to Adyen/src/Model/AcsWebhooks/RelayedAuthenticationRequest.cs diff --git a/Adyen/Model/AcsWebhooks/RelayedAuthenticationResponse.cs b/Adyen/src/Model/AcsWebhooks/RelayedAuthenticationResponse.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/RelayedAuthenticationResponse.cs rename to Adyen/src/Model/AcsWebhooks/RelayedAuthenticationResponse.cs diff --git a/Adyen/Model/AcsWebhooks/Resource.cs b/Adyen/src/Model/AcsWebhooks/Resource.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/Resource.cs rename to Adyen/src/Model/AcsWebhooks/Resource.cs diff --git a/Adyen/Model/AcsWebhooks/ServiceError.cs b/Adyen/src/Model/AcsWebhooks/ServiceError.cs similarity index 100% rename from Adyen/Model/AcsWebhooks/ServiceError.cs rename to Adyen/src/Model/AcsWebhooks/ServiceError.cs diff --git a/Adyen/Model/ApiError.cs b/Adyen/src/Model/ApiError.cs similarity index 100% rename from Adyen/Model/ApiError.cs rename to Adyen/src/Model/ApiError.cs diff --git a/Adyen/Model/ApplicationInformation/ApplicationInfo.cs b/Adyen/src/Model/ApplicationInformation/ApplicationInfo.cs similarity index 100% rename from Adyen/Model/ApplicationInformation/ApplicationInfo.cs rename to Adyen/src/Model/ApplicationInformation/ApplicationInfo.cs diff --git a/Adyen/Model/ApplicationInformation/CommonField.cs b/Adyen/src/Model/ApplicationInformation/CommonField.cs similarity index 100% rename from Adyen/Model/ApplicationInformation/CommonField.cs rename to Adyen/src/Model/ApplicationInformation/CommonField.cs diff --git a/Adyen/Model/ApplicationInformation/ExternalPlatform.cs b/Adyen/src/Model/ApplicationInformation/ExternalPlatform.cs similarity index 100% rename from Adyen/Model/ApplicationInformation/ExternalPlatform.cs rename to Adyen/src/Model/ApplicationInformation/ExternalPlatform.cs diff --git a/Adyen/Model/ApplicationInformation/MerchantDevice.cs b/Adyen/src/Model/ApplicationInformation/MerchantDevice.cs similarity index 100% rename from Adyen/Model/ApplicationInformation/MerchantDevice.cs rename to Adyen/src/Model/ApplicationInformation/MerchantDevice.cs diff --git a/Adyen/Model/ApplicationInformation/ShopperInteractionDevice.cs b/Adyen/src/Model/ApplicationInformation/ShopperInteractionDevice.cs similarity index 100% rename from Adyen/Model/ApplicationInformation/ShopperInteractionDevice.cs rename to Adyen/src/Model/ApplicationInformation/ShopperInteractionDevice.cs diff --git a/Adyen/Model/BalanceControl/AbstractOpenAPISchema.cs b/Adyen/src/Model/BalanceControl/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/BalanceControl/AbstractOpenAPISchema.cs rename to Adyen/src/Model/BalanceControl/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/BalanceControl/Amount.cs b/Adyen/src/Model/BalanceControl/Amount.cs similarity index 100% rename from Adyen/Model/BalanceControl/Amount.cs rename to Adyen/src/Model/BalanceControl/Amount.cs diff --git a/Adyen/Model/BalanceControl/BalanceTransferRequest.cs b/Adyen/src/Model/BalanceControl/BalanceTransferRequest.cs similarity index 100% rename from Adyen/Model/BalanceControl/BalanceTransferRequest.cs rename to Adyen/src/Model/BalanceControl/BalanceTransferRequest.cs diff --git a/Adyen/Model/BalanceControl/BalanceTransferResponse.cs b/Adyen/src/Model/BalanceControl/BalanceTransferResponse.cs similarity index 100% rename from Adyen/Model/BalanceControl/BalanceTransferResponse.cs rename to Adyen/src/Model/BalanceControl/BalanceTransferResponse.cs diff --git a/Adyen/Model/BalancePlatform/AULocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AULocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/AULocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/AbstractOpenAPISchema.cs b/Adyen/src/Model/BalancePlatform/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AbstractOpenAPISchema.cs rename to Adyen/src/Model/BalancePlatform/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/BalancePlatform/AccountHolder.cs b/Adyen/src/Model/BalancePlatform/AccountHolder.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AccountHolder.cs rename to Adyen/src/Model/BalancePlatform/AccountHolder.cs diff --git a/Adyen/Model/BalancePlatform/AccountHolderCapability.cs b/Adyen/src/Model/BalancePlatform/AccountHolderCapability.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AccountHolderCapability.cs rename to Adyen/src/Model/BalancePlatform/AccountHolderCapability.cs diff --git a/Adyen/Model/BalancePlatform/AccountHolderInfo.cs b/Adyen/src/Model/BalancePlatform/AccountHolderInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AccountHolderInfo.cs rename to Adyen/src/Model/BalancePlatform/AccountHolderInfo.cs diff --git a/Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.cs b/Adyen/src/Model/BalancePlatform/AccountHolderUpdateRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.cs rename to Adyen/src/Model/BalancePlatform/AccountHolderUpdateRequest.cs diff --git a/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.cs b/Adyen/src/Model/BalancePlatform/AccountSupportingEntityCapability.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.cs rename to Adyen/src/Model/BalancePlatform/AccountSupportingEntityCapability.cs diff --git a/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs b/Adyen/src/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs rename to Adyen/src/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs diff --git a/Adyen/Model/BalancePlatform/AdditionalBankIdentification.cs b/Adyen/src/Model/BalancePlatform/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AdditionalBankIdentification.cs rename to Adyen/src/Model/BalancePlatform/AdditionalBankIdentification.cs diff --git a/Adyen/Model/BalancePlatform/Address.cs b/Adyen/src/Model/BalancePlatform/Address.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Address.cs rename to Adyen/src/Model/BalancePlatform/Address.cs diff --git a/Adyen/Model/BalancePlatform/AddressRequirement.cs b/Adyen/src/Model/BalancePlatform/AddressRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AddressRequirement.cs rename to Adyen/src/Model/BalancePlatform/AddressRequirement.cs diff --git a/Adyen/Model/BalancePlatform/Amount.cs b/Adyen/src/Model/BalancePlatform/Amount.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Amount.cs rename to Adyen/src/Model/BalancePlatform/Amount.cs diff --git a/Adyen/Model/BalancePlatform/AmountMinMaxRequirement.cs b/Adyen/src/Model/BalancePlatform/AmountMinMaxRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AmountMinMaxRequirement.cs rename to Adyen/src/Model/BalancePlatform/AmountMinMaxRequirement.cs diff --git a/Adyen/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs b/Adyen/src/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs rename to Adyen/src/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs diff --git a/Adyen/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs b/Adyen/src/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs rename to Adyen/src/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs diff --git a/Adyen/Model/BalancePlatform/AssociationFinaliseRequest.cs b/Adyen/src/Model/BalancePlatform/AssociationFinaliseRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AssociationFinaliseRequest.cs rename to Adyen/src/Model/BalancePlatform/AssociationFinaliseRequest.cs diff --git a/Adyen/Model/BalancePlatform/AssociationFinaliseResponse.cs b/Adyen/src/Model/BalancePlatform/AssociationFinaliseResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AssociationFinaliseResponse.cs rename to Adyen/src/Model/BalancePlatform/AssociationFinaliseResponse.cs diff --git a/Adyen/Model/BalancePlatform/AssociationInitiateRequest.cs b/Adyen/src/Model/BalancePlatform/AssociationInitiateRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AssociationInitiateRequest.cs rename to Adyen/src/Model/BalancePlatform/AssociationInitiateRequest.cs diff --git a/Adyen/Model/BalancePlatform/AssociationInitiateResponse.cs b/Adyen/src/Model/BalancePlatform/AssociationInitiateResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/AssociationInitiateResponse.cs rename to Adyen/src/Model/BalancePlatform/AssociationInitiateResponse.cs diff --git a/Adyen/Model/BalancePlatform/Authentication.cs b/Adyen/src/Model/BalancePlatform/Authentication.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Authentication.cs rename to Adyen/src/Model/BalancePlatform/Authentication.cs diff --git a/Adyen/Model/BalancePlatform/BRLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/BRLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BRLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/BRLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/Balance.cs b/Adyen/src/Model/BalancePlatform/Balance.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Balance.cs rename to Adyen/src/Model/BalancePlatform/Balance.cs diff --git a/Adyen/Model/BalancePlatform/BalanceAccount.cs b/Adyen/src/Model/BalancePlatform/BalanceAccount.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BalanceAccount.cs rename to Adyen/src/Model/BalancePlatform/BalanceAccount.cs diff --git a/Adyen/Model/BalancePlatform/BalanceAccountBase.cs b/Adyen/src/Model/BalancePlatform/BalanceAccountBase.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BalanceAccountBase.cs rename to Adyen/src/Model/BalancePlatform/BalanceAccountBase.cs diff --git a/Adyen/Model/BalancePlatform/BalanceAccountInfo.cs b/Adyen/src/Model/BalancePlatform/BalanceAccountInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BalanceAccountInfo.cs rename to Adyen/src/Model/BalancePlatform/BalanceAccountInfo.cs diff --git a/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.cs b/Adyen/src/Model/BalancePlatform/BalanceAccountUpdateRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.cs rename to Adyen/src/Model/BalancePlatform/BalanceAccountUpdateRequest.cs diff --git a/Adyen/Model/BalancePlatform/BalancePlatform.cs b/Adyen/src/Model/BalancePlatform/BalancePlatform.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BalancePlatform.cs rename to Adyen/src/Model/BalancePlatform/BalancePlatform.cs diff --git a/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs b/Adyen/src/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs rename to Adyen/src/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs diff --git a/Adyen/Model/BalancePlatform/BankAccount.cs b/Adyen/src/Model/BalancePlatform/BankAccount.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccount.cs rename to Adyen/src/Model/BalancePlatform/BankAccount.cs diff --git a/Adyen/Model/BalancePlatform/BankAccountAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/BankAccountAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccountAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/BankAccountAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/BankAccountDetails.cs b/Adyen/src/Model/BalancePlatform/BankAccountDetails.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccountDetails.cs rename to Adyen/src/Model/BalancePlatform/BankAccountDetails.cs diff --git a/Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs b/Adyen/src/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs rename to Adyen/src/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs diff --git a/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs b/Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs rename to Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs diff --git a/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/BankAccountModel.cs b/Adyen/src/Model/BalancePlatform/BankAccountModel.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankAccountModel.cs rename to Adyen/src/Model/BalancePlatform/BankAccountModel.cs diff --git a/Adyen/Model/BalancePlatform/BankIdentification.cs b/Adyen/src/Model/BalancePlatform/BankIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BankIdentification.cs rename to Adyen/src/Model/BalancePlatform/BankIdentification.cs diff --git a/Adyen/Model/BalancePlatform/BrandVariantsRestriction.cs b/Adyen/src/Model/BalancePlatform/BrandVariantsRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BrandVariantsRestriction.cs rename to Adyen/src/Model/BalancePlatform/BrandVariantsRestriction.cs diff --git a/Adyen/Model/BalancePlatform/BulkAddress.cs b/Adyen/src/Model/BalancePlatform/BulkAddress.cs similarity index 100% rename from Adyen/Model/BalancePlatform/BulkAddress.cs rename to Adyen/src/Model/BalancePlatform/BulkAddress.cs diff --git a/Adyen/Model/BalancePlatform/CALocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CALocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/CALocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CZLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/CZLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/CapabilityProblem.cs b/Adyen/src/Model/BalancePlatform/CapabilityProblem.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CapabilityProblem.cs rename to Adyen/src/Model/BalancePlatform/CapabilityProblem.cs diff --git a/Adyen/Model/BalancePlatform/CapabilityProblemEntity.cs b/Adyen/src/Model/BalancePlatform/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CapabilityProblemEntity.cs rename to Adyen/src/Model/BalancePlatform/CapabilityProblemEntity.cs diff --git a/Adyen/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs b/Adyen/src/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs rename to Adyen/src/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/Model/BalancePlatform/CapabilitySettings.cs b/Adyen/src/Model/BalancePlatform/CapabilitySettings.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CapabilitySettings.cs rename to Adyen/src/Model/BalancePlatform/CapabilitySettings.cs diff --git a/Adyen/Model/BalancePlatform/CapitalBalance.cs b/Adyen/src/Model/BalancePlatform/CapitalBalance.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CapitalBalance.cs rename to Adyen/src/Model/BalancePlatform/CapitalBalance.cs diff --git a/Adyen/Model/BalancePlatform/CapitalGrantAccount.cs b/Adyen/src/Model/BalancePlatform/CapitalGrantAccount.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CapitalGrantAccount.cs rename to Adyen/src/Model/BalancePlatform/CapitalGrantAccount.cs diff --git a/Adyen/Model/BalancePlatform/Card.cs b/Adyen/src/Model/BalancePlatform/Card.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Card.cs rename to Adyen/src/Model/BalancePlatform/Card.cs diff --git a/Adyen/Model/BalancePlatform/CardConfiguration.cs b/Adyen/src/Model/BalancePlatform/CardConfiguration.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CardConfiguration.cs rename to Adyen/src/Model/BalancePlatform/CardConfiguration.cs diff --git a/Adyen/Model/BalancePlatform/CardInfo.cs b/Adyen/src/Model/BalancePlatform/CardInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CardInfo.cs rename to Adyen/src/Model/BalancePlatform/CardInfo.cs diff --git a/Adyen/Model/BalancePlatform/CardOrder.cs b/Adyen/src/Model/BalancePlatform/CardOrder.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CardOrder.cs rename to Adyen/src/Model/BalancePlatform/CardOrder.cs diff --git a/Adyen/Model/BalancePlatform/CardOrderItem.cs b/Adyen/src/Model/BalancePlatform/CardOrderItem.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CardOrderItem.cs rename to Adyen/src/Model/BalancePlatform/CardOrderItem.cs diff --git a/Adyen/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs b/Adyen/src/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs rename to Adyen/src/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs diff --git a/Adyen/Model/BalancePlatform/ContactDetails.cs b/Adyen/src/Model/BalancePlatform/ContactDetails.cs similarity index 100% rename from Adyen/Model/BalancePlatform/ContactDetails.cs rename to Adyen/src/Model/BalancePlatform/ContactDetails.cs diff --git a/Adyen/Model/BalancePlatform/Counterparty.cs b/Adyen/src/Model/BalancePlatform/Counterparty.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Counterparty.cs rename to Adyen/src/Model/BalancePlatform/Counterparty.cs diff --git a/Adyen/Model/BalancePlatform/CounterpartyBankRestriction.cs b/Adyen/src/Model/BalancePlatform/CounterpartyBankRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CounterpartyBankRestriction.cs rename to Adyen/src/Model/BalancePlatform/CounterpartyBankRestriction.cs diff --git a/Adyen/Model/BalancePlatform/CounterpartyTypesRestriction.cs b/Adyen/src/Model/BalancePlatform/CounterpartyTypesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CounterpartyTypesRestriction.cs rename to Adyen/src/Model/BalancePlatform/CounterpartyTypesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/CountriesRestriction.cs b/Adyen/src/Model/BalancePlatform/CountriesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CountriesRestriction.cs rename to Adyen/src/Model/BalancePlatform/CountriesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.cs b/Adyen/src/Model/BalancePlatform/CreateSweepConfigurationV2.cs similarity index 100% rename from Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.cs rename to Adyen/src/Model/BalancePlatform/CreateSweepConfigurationV2.cs diff --git a/Adyen/Model/BalancePlatform/DKLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DKLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/DKLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/DayOfWeekRestriction.cs b/Adyen/src/Model/BalancePlatform/DayOfWeekRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DayOfWeekRestriction.cs rename to Adyen/src/Model/BalancePlatform/DayOfWeekRestriction.cs diff --git a/Adyen/Model/BalancePlatform/DelegatedAuthenticationData.cs b/Adyen/src/Model/BalancePlatform/DelegatedAuthenticationData.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DelegatedAuthenticationData.cs rename to Adyen/src/Model/BalancePlatform/DelegatedAuthenticationData.cs diff --git a/Adyen/Model/BalancePlatform/DeliveryAddress.cs b/Adyen/src/Model/BalancePlatform/DeliveryAddress.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DeliveryAddress.cs rename to Adyen/src/Model/BalancePlatform/DeliveryAddress.cs diff --git a/Adyen/Model/BalancePlatform/DeliveryContact.cs b/Adyen/src/Model/BalancePlatform/DeliveryContact.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DeliveryContact.cs rename to Adyen/src/Model/BalancePlatform/DeliveryContact.cs diff --git a/Adyen/Model/BalancePlatform/Device.cs b/Adyen/src/Model/BalancePlatform/Device.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Device.cs rename to Adyen/src/Model/BalancePlatform/Device.cs diff --git a/Adyen/Model/BalancePlatform/DeviceInfo.cs b/Adyen/src/Model/BalancePlatform/DeviceInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DeviceInfo.cs rename to Adyen/src/Model/BalancePlatform/DeviceInfo.cs diff --git a/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.cs b/Adyen/src/Model/BalancePlatform/DifferentCurrenciesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.cs rename to Adyen/src/Model/BalancePlatform/DifferentCurrenciesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/Duration.cs b/Adyen/src/Model/BalancePlatform/Duration.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Duration.cs rename to Adyen/src/Model/BalancePlatform/Duration.cs diff --git a/Adyen/Model/BalancePlatform/EntryModesRestriction.cs b/Adyen/src/Model/BalancePlatform/EntryModesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/EntryModesRestriction.cs rename to Adyen/src/Model/BalancePlatform/EntryModesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/Expiry.cs b/Adyen/src/Model/BalancePlatform/Expiry.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Expiry.cs rename to Adyen/src/Model/BalancePlatform/Expiry.cs diff --git a/Adyen/Model/BalancePlatform/Fee.cs b/Adyen/src/Model/BalancePlatform/Fee.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Fee.cs rename to Adyen/src/Model/BalancePlatform/Fee.cs diff --git a/Adyen/Model/BalancePlatform/GetNetworkTokenResponse.cs b/Adyen/src/Model/BalancePlatform/GetNetworkTokenResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/GetNetworkTokenResponse.cs rename to Adyen/src/Model/BalancePlatform/GetNetworkTokenResponse.cs diff --git a/Adyen/Model/BalancePlatform/GetTaxFormResponse.cs b/Adyen/src/Model/BalancePlatform/GetTaxFormResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/GetTaxFormResponse.cs rename to Adyen/src/Model/BalancePlatform/GetTaxFormResponse.cs diff --git a/Adyen/Model/BalancePlatform/GrantLimit.cs b/Adyen/src/Model/BalancePlatform/GrantLimit.cs similarity index 100% rename from Adyen/Model/BalancePlatform/GrantLimit.cs rename to Adyen/src/Model/BalancePlatform/GrantLimit.cs diff --git a/Adyen/Model/BalancePlatform/GrantOffer.cs b/Adyen/src/Model/BalancePlatform/GrantOffer.cs similarity index 100% rename from Adyen/Model/BalancePlatform/GrantOffer.cs rename to Adyen/src/Model/BalancePlatform/GrantOffer.cs diff --git a/Adyen/Model/BalancePlatform/GrantOffers.cs b/Adyen/src/Model/BalancePlatform/GrantOffers.cs similarity index 100% rename from Adyen/Model/BalancePlatform/GrantOffers.cs rename to Adyen/src/Model/BalancePlatform/GrantOffers.cs diff --git a/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/HKLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/HKLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/HULocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/HULocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/HULocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/Href.cs b/Adyen/src/Model/BalancePlatform/Href.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Href.cs rename to Adyen/src/Model/BalancePlatform/Href.cs diff --git a/Adyen/Model/BalancePlatform/IbanAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/IbanAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/IbanAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/IbanAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs b/Adyen/src/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs rename to Adyen/src/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs diff --git a/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.cs b/Adyen/src/Model/BalancePlatform/InternationalTransactionRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/InternationalTransactionRestriction.cs rename to Adyen/src/Model/BalancePlatform/InternationalTransactionRestriction.cs diff --git a/Adyen/Model/BalancePlatform/InvalidField.cs b/Adyen/src/Model/BalancePlatform/InvalidField.cs similarity index 100% rename from Adyen/Model/BalancePlatform/InvalidField.cs rename to Adyen/src/Model/BalancePlatform/InvalidField.cs diff --git a/Adyen/Model/BalancePlatform/Link.cs b/Adyen/src/Model/BalancePlatform/Link.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Link.cs rename to Adyen/src/Model/BalancePlatform/Link.cs diff --git a/Adyen/Model/BalancePlatform/ListNetworkTokensResponse.cs b/Adyen/src/Model/BalancePlatform/ListNetworkTokensResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/ListNetworkTokensResponse.cs rename to Adyen/src/Model/BalancePlatform/ListNetworkTokensResponse.cs diff --git a/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.cs b/Adyen/src/Model/BalancePlatform/MatchingTransactionsRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.cs rename to Adyen/src/Model/BalancePlatform/MatchingTransactionsRestriction.cs diff --git a/Adyen/Model/BalancePlatform/MatchingValuesRestriction.cs b/Adyen/src/Model/BalancePlatform/MatchingValuesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/MatchingValuesRestriction.cs rename to Adyen/src/Model/BalancePlatform/MatchingValuesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/MccsRestriction.cs b/Adyen/src/Model/BalancePlatform/MccsRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/MccsRestriction.cs rename to Adyen/src/Model/BalancePlatform/MccsRestriction.cs diff --git a/Adyen/Model/BalancePlatform/MerchantAcquirerPair.cs b/Adyen/src/Model/BalancePlatform/MerchantAcquirerPair.cs similarity index 100% rename from Adyen/Model/BalancePlatform/MerchantAcquirerPair.cs rename to Adyen/src/Model/BalancePlatform/MerchantAcquirerPair.cs diff --git a/Adyen/Model/BalancePlatform/MerchantNamesRestriction.cs b/Adyen/src/Model/BalancePlatform/MerchantNamesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/MerchantNamesRestriction.cs rename to Adyen/src/Model/BalancePlatform/MerchantNamesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/MerchantsRestriction.cs b/Adyen/src/Model/BalancePlatform/MerchantsRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/MerchantsRestriction.cs rename to Adyen/src/Model/BalancePlatform/MerchantsRestriction.cs diff --git a/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/NOLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/NOLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/NZLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/NZLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/NZLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/Name.cs b/Adyen/src/Model/BalancePlatform/Name.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Name.cs rename to Adyen/src/Model/BalancePlatform/Name.cs diff --git a/Adyen/Model/BalancePlatform/NetworkToken.cs b/Adyen/src/Model/BalancePlatform/NetworkToken.cs similarity index 100% rename from Adyen/Model/BalancePlatform/NetworkToken.cs rename to Adyen/src/Model/BalancePlatform/NetworkToken.cs diff --git a/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/NumberAndBicAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PLLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/PLLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs b/Adyen/src/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs rename to Adyen/src/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs diff --git a/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs b/Adyen/src/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs rename to Adyen/src/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs diff --git a/Adyen/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs b/Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs rename to Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs diff --git a/Adyen/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs b/Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs rename to Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs diff --git a/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs b/Adyen/src/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs rename to Adyen/src/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrument.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrument.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrument.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrument.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentGroup.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentGroup.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentGroup.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentInfo.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentInfo.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentRequirement.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentRequirement.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentRequirement.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs diff --git a/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs b/Adyen/src/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs rename to Adyen/src/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs diff --git a/Adyen/Model/BalancePlatform/Phone.cs b/Adyen/src/Model/BalancePlatform/Phone.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Phone.cs rename to Adyen/src/Model/BalancePlatform/Phone.cs diff --git a/Adyen/Model/BalancePlatform/PhoneNumber.cs b/Adyen/src/Model/BalancePlatform/PhoneNumber.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PhoneNumber.cs rename to Adyen/src/Model/BalancePlatform/PhoneNumber.cs diff --git a/Adyen/Model/BalancePlatform/PinChangeRequest.cs b/Adyen/src/Model/BalancePlatform/PinChangeRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PinChangeRequest.cs rename to Adyen/src/Model/BalancePlatform/PinChangeRequest.cs diff --git a/Adyen/Model/BalancePlatform/PinChangeResponse.cs b/Adyen/src/Model/BalancePlatform/PinChangeResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PinChangeResponse.cs rename to Adyen/src/Model/BalancePlatform/PinChangeResponse.cs diff --git a/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.cs b/Adyen/src/Model/BalancePlatform/PlatformPaymentConfiguration.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.cs rename to Adyen/src/Model/BalancePlatform/PlatformPaymentConfiguration.cs diff --git a/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.cs b/Adyen/src/Model/BalancePlatform/ProcessingTypesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/ProcessingTypesRestriction.cs rename to Adyen/src/Model/BalancePlatform/ProcessingTypesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/PublicKeyResponse.cs b/Adyen/src/Model/BalancePlatform/PublicKeyResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/PublicKeyResponse.cs rename to Adyen/src/Model/BalancePlatform/PublicKeyResponse.cs diff --git a/Adyen/Model/BalancePlatform/RegisterSCAFinalResponse.cs b/Adyen/src/Model/BalancePlatform/RegisterSCAFinalResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RegisterSCAFinalResponse.cs rename to Adyen/src/Model/BalancePlatform/RegisterSCAFinalResponse.cs diff --git a/Adyen/Model/BalancePlatform/RegisterSCARequest.cs b/Adyen/src/Model/BalancePlatform/RegisterSCARequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RegisterSCARequest.cs rename to Adyen/src/Model/BalancePlatform/RegisterSCARequest.cs diff --git a/Adyen/Model/BalancePlatform/RegisterSCAResponse.cs b/Adyen/src/Model/BalancePlatform/RegisterSCAResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RegisterSCAResponse.cs rename to Adyen/src/Model/BalancePlatform/RegisterSCAResponse.cs diff --git a/Adyen/Model/BalancePlatform/RemediatingAction.cs b/Adyen/src/Model/BalancePlatform/RemediatingAction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RemediatingAction.cs rename to Adyen/src/Model/BalancePlatform/RemediatingAction.cs diff --git a/Adyen/Model/BalancePlatform/Repayment.cs b/Adyen/src/Model/BalancePlatform/Repayment.cs similarity index 100% rename from Adyen/Model/BalancePlatform/Repayment.cs rename to Adyen/src/Model/BalancePlatform/Repayment.cs diff --git a/Adyen/Model/BalancePlatform/RepaymentTerm.cs b/Adyen/src/Model/BalancePlatform/RepaymentTerm.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RepaymentTerm.cs rename to Adyen/src/Model/BalancePlatform/RepaymentTerm.cs diff --git a/Adyen/Model/BalancePlatform/RestServiceError.cs b/Adyen/src/Model/BalancePlatform/RestServiceError.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RestServiceError.cs rename to Adyen/src/Model/BalancePlatform/RestServiceError.cs diff --git a/Adyen/Model/BalancePlatform/RevealPinRequest.cs b/Adyen/src/Model/BalancePlatform/RevealPinRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RevealPinRequest.cs rename to Adyen/src/Model/BalancePlatform/RevealPinRequest.cs diff --git a/Adyen/Model/BalancePlatform/RevealPinResponse.cs b/Adyen/src/Model/BalancePlatform/RevealPinResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RevealPinResponse.cs rename to Adyen/src/Model/BalancePlatform/RevealPinResponse.cs diff --git a/Adyen/Model/BalancePlatform/RiskScores.cs b/Adyen/src/Model/BalancePlatform/RiskScores.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RiskScores.cs rename to Adyen/src/Model/BalancePlatform/RiskScores.cs diff --git a/Adyen/Model/BalancePlatform/RiskScoresRestriction.cs b/Adyen/src/Model/BalancePlatform/RiskScoresRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/RiskScoresRestriction.cs rename to Adyen/src/Model/BalancePlatform/RiskScoresRestriction.cs diff --git a/Adyen/Model/BalancePlatform/SELocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SELocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/SELocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SGLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/SGLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/SameAmountRestriction.cs b/Adyen/src/Model/BalancePlatform/SameAmountRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SameAmountRestriction.cs rename to Adyen/src/Model/BalancePlatform/SameAmountRestriction.cs diff --git a/Adyen/Model/BalancePlatform/SameCounterpartyRestriction.cs b/Adyen/src/Model/BalancePlatform/SameCounterpartyRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SameCounterpartyRestriction.cs rename to Adyen/src/Model/BalancePlatform/SameCounterpartyRestriction.cs diff --git a/Adyen/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs b/Adyen/src/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs rename to Adyen/src/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs diff --git a/Adyen/Model/BalancePlatform/SourceAccountTypesRestriction.cs b/Adyen/src/Model/BalancePlatform/SourceAccountTypesRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SourceAccountTypesRestriction.cs rename to Adyen/src/Model/BalancePlatform/SourceAccountTypesRestriction.cs diff --git a/Adyen/Model/BalancePlatform/StringMatch.cs b/Adyen/src/Model/BalancePlatform/StringMatch.cs similarity index 100% rename from Adyen/Model/BalancePlatform/StringMatch.cs rename to Adyen/src/Model/BalancePlatform/StringMatch.cs diff --git a/Adyen/Model/BalancePlatform/SweepConfigurationV2.cs b/Adyen/src/Model/BalancePlatform/SweepConfigurationV2.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SweepConfigurationV2.cs rename to Adyen/src/Model/BalancePlatform/SweepConfigurationV2.cs diff --git a/Adyen/Model/BalancePlatform/SweepCounterparty.cs b/Adyen/src/Model/BalancePlatform/SweepCounterparty.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SweepCounterparty.cs rename to Adyen/src/Model/BalancePlatform/SweepCounterparty.cs diff --git a/Adyen/Model/BalancePlatform/SweepSchedule.cs b/Adyen/src/Model/BalancePlatform/SweepSchedule.cs similarity index 100% rename from Adyen/Model/BalancePlatform/SweepSchedule.cs rename to Adyen/src/Model/BalancePlatform/SweepSchedule.cs diff --git a/Adyen/Model/BalancePlatform/ThresholdRepayment.cs b/Adyen/src/Model/BalancePlatform/ThresholdRepayment.cs similarity index 100% rename from Adyen/Model/BalancePlatform/ThresholdRepayment.cs rename to Adyen/src/Model/BalancePlatform/ThresholdRepayment.cs diff --git a/Adyen/Model/BalancePlatform/TimeOfDay.cs b/Adyen/src/Model/BalancePlatform/TimeOfDay.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TimeOfDay.cs rename to Adyen/src/Model/BalancePlatform/TimeOfDay.cs diff --git a/Adyen/Model/BalancePlatform/TimeOfDayRestriction.cs b/Adyen/src/Model/BalancePlatform/TimeOfDayRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TimeOfDayRestriction.cs rename to Adyen/src/Model/BalancePlatform/TimeOfDayRestriction.cs diff --git a/Adyen/Model/BalancePlatform/TokenRequestorsRestriction.cs b/Adyen/src/Model/BalancePlatform/TokenRequestorsRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TokenRequestorsRestriction.cs rename to Adyen/src/Model/BalancePlatform/TokenRequestorsRestriction.cs diff --git a/Adyen/Model/BalancePlatform/TotalAmountRestriction.cs b/Adyen/src/Model/BalancePlatform/TotalAmountRestriction.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TotalAmountRestriction.cs rename to Adyen/src/Model/BalancePlatform/TotalAmountRestriction.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRule.cs b/Adyen/src/Model/BalancePlatform/TransactionRule.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRule.cs rename to Adyen/src/Model/BalancePlatform/TransactionRule.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.cs b/Adyen/src/Model/BalancePlatform/TransactionRuleEntityKey.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRuleEntityKey.cs rename to Adyen/src/Model/BalancePlatform/TransactionRuleEntityKey.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRuleInfo.cs b/Adyen/src/Model/BalancePlatform/TransactionRuleInfo.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRuleInfo.cs rename to Adyen/src/Model/BalancePlatform/TransactionRuleInfo.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRuleInterval.cs b/Adyen/src/Model/BalancePlatform/TransactionRuleInterval.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRuleInterval.cs rename to Adyen/src/Model/BalancePlatform/TransactionRuleInterval.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRuleResponse.cs b/Adyen/src/Model/BalancePlatform/TransactionRuleResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRuleResponse.cs rename to Adyen/src/Model/BalancePlatform/TransactionRuleResponse.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.cs b/Adyen/src/Model/BalancePlatform/TransactionRuleRestrictions.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRuleRestrictions.cs rename to Adyen/src/Model/BalancePlatform/TransactionRuleRestrictions.cs diff --git a/Adyen/Model/BalancePlatform/TransactionRulesResponse.cs b/Adyen/src/Model/BalancePlatform/TransactionRulesResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransactionRulesResponse.cs rename to Adyen/src/Model/BalancePlatform/TransactionRulesResponse.cs diff --git a/Adyen/Model/BalancePlatform/TransferRoute.cs b/Adyen/src/Model/BalancePlatform/TransferRoute.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransferRoute.cs rename to Adyen/src/Model/BalancePlatform/TransferRoute.cs diff --git a/Adyen/Model/BalancePlatform/TransferRouteRequest.cs b/Adyen/src/Model/BalancePlatform/TransferRouteRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransferRouteRequest.cs rename to Adyen/src/Model/BalancePlatform/TransferRouteRequest.cs diff --git a/Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.cs b/Adyen/src/Model/BalancePlatform/TransferRouteRequirementsInner.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.cs rename to Adyen/src/Model/BalancePlatform/TransferRouteRequirementsInner.cs diff --git a/Adyen/Model/BalancePlatform/TransferRouteResponse.cs b/Adyen/src/Model/BalancePlatform/TransferRouteResponse.cs similarity index 100% rename from Adyen/Model/BalancePlatform/TransferRouteResponse.cs rename to Adyen/src/Model/BalancePlatform/TransferRouteResponse.cs diff --git a/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/UKLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/UKLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/USInternationalAchAddressRequirement.cs b/Adyen/src/Model/BalancePlatform/USInternationalAchAddressRequirement.cs similarity index 100% rename from Adyen/Model/BalancePlatform/USInternationalAchAddressRequirement.cs rename to Adyen/src/Model/BalancePlatform/USInternationalAchAddressRequirement.cs diff --git a/Adyen/Model/BalancePlatform/USLocalAccountIdentification.cs b/Adyen/src/Model/BalancePlatform/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/BalancePlatform/USLocalAccountIdentification.cs rename to Adyen/src/Model/BalancePlatform/USLocalAccountIdentification.cs diff --git a/Adyen/Model/BalancePlatform/UpdateNetworkTokenRequest.cs b/Adyen/src/Model/BalancePlatform/UpdateNetworkTokenRequest.cs similarity index 100% rename from Adyen/Model/BalancePlatform/UpdateNetworkTokenRequest.cs rename to Adyen/src/Model/BalancePlatform/UpdateNetworkTokenRequest.cs diff --git a/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.cs b/Adyen/src/Model/BalancePlatform/UpdatePaymentInstrument.cs similarity index 100% rename from Adyen/Model/BalancePlatform/UpdatePaymentInstrument.cs rename to Adyen/src/Model/BalancePlatform/UpdatePaymentInstrument.cs diff --git a/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.cs b/Adyen/src/Model/BalancePlatform/UpdateSweepConfigurationV2.cs similarity index 100% rename from Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.cs rename to Adyen/src/Model/BalancePlatform/UpdateSweepConfigurationV2.cs diff --git a/Adyen/Model/BalancePlatform/VerificationDeadline.cs b/Adyen/src/Model/BalancePlatform/VerificationDeadline.cs similarity index 100% rename from Adyen/Model/BalancePlatform/VerificationDeadline.cs rename to Adyen/src/Model/BalancePlatform/VerificationDeadline.cs diff --git a/Adyen/Model/BalancePlatform/VerificationError.cs b/Adyen/src/Model/BalancePlatform/VerificationError.cs similarity index 100% rename from Adyen/Model/BalancePlatform/VerificationError.cs rename to Adyen/src/Model/BalancePlatform/VerificationError.cs diff --git a/Adyen/Model/BalancePlatform/VerificationErrorRecursive.cs b/Adyen/src/Model/BalancePlatform/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/Model/BalancePlatform/VerificationErrorRecursive.cs rename to Adyen/src/Model/BalancePlatform/VerificationErrorRecursive.cs diff --git a/Adyen/Model/BinLookup/AbstractOpenAPISchema.cs b/Adyen/src/Model/BinLookup/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/BinLookup/AbstractOpenAPISchema.cs rename to Adyen/src/Model/BinLookup/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/BinLookup/Amount.cs b/Adyen/src/Model/BinLookup/Amount.cs similarity index 100% rename from Adyen/Model/BinLookup/Amount.cs rename to Adyen/src/Model/BinLookup/Amount.cs diff --git a/Adyen/Model/BinLookup/BinDetail.cs b/Adyen/src/Model/BinLookup/BinDetail.cs similarity index 100% rename from Adyen/Model/BinLookup/BinDetail.cs rename to Adyen/src/Model/BinLookup/BinDetail.cs diff --git a/Adyen/Model/BinLookup/CardBin.cs b/Adyen/src/Model/BinLookup/CardBin.cs similarity index 100% rename from Adyen/Model/BinLookup/CardBin.cs rename to Adyen/src/Model/BinLookup/CardBin.cs diff --git a/Adyen/Model/BinLookup/CostEstimateAssumptions.cs b/Adyen/src/Model/BinLookup/CostEstimateAssumptions.cs similarity index 100% rename from Adyen/Model/BinLookup/CostEstimateAssumptions.cs rename to Adyen/src/Model/BinLookup/CostEstimateAssumptions.cs diff --git a/Adyen/Model/BinLookup/CostEstimateRequest.cs b/Adyen/src/Model/BinLookup/CostEstimateRequest.cs similarity index 100% rename from Adyen/Model/BinLookup/CostEstimateRequest.cs rename to Adyen/src/Model/BinLookup/CostEstimateRequest.cs diff --git a/Adyen/Model/BinLookup/CostEstimateResponse.cs b/Adyen/src/Model/BinLookup/CostEstimateResponse.cs similarity index 100% rename from Adyen/Model/BinLookup/CostEstimateResponse.cs rename to Adyen/src/Model/BinLookup/CostEstimateResponse.cs diff --git a/Adyen/Model/BinLookup/DSPublicKeyDetail.cs b/Adyen/src/Model/BinLookup/DSPublicKeyDetail.cs similarity index 100% rename from Adyen/Model/BinLookup/DSPublicKeyDetail.cs rename to Adyen/src/Model/BinLookup/DSPublicKeyDetail.cs diff --git a/Adyen/Model/BinLookup/MerchantDetails.cs b/Adyen/src/Model/BinLookup/MerchantDetails.cs similarity index 100% rename from Adyen/Model/BinLookup/MerchantDetails.cs rename to Adyen/src/Model/BinLookup/MerchantDetails.cs diff --git a/Adyen/Model/BinLookup/Recurring.cs b/Adyen/src/Model/BinLookup/Recurring.cs similarity index 100% rename from Adyen/Model/BinLookup/Recurring.cs rename to Adyen/src/Model/BinLookup/Recurring.cs diff --git a/Adyen/Model/BinLookup/ServiceError.cs b/Adyen/src/Model/BinLookup/ServiceError.cs similarity index 100% rename from Adyen/Model/BinLookup/ServiceError.cs rename to Adyen/src/Model/BinLookup/ServiceError.cs diff --git a/Adyen/Model/BinLookup/ThreeDS2CardRangeDetail.cs b/Adyen/src/Model/BinLookup/ThreeDS2CardRangeDetail.cs similarity index 100% rename from Adyen/Model/BinLookup/ThreeDS2CardRangeDetail.cs rename to Adyen/src/Model/BinLookup/ThreeDS2CardRangeDetail.cs diff --git a/Adyen/Model/BinLookup/ThreeDSAvailabilityRequest.cs b/Adyen/src/Model/BinLookup/ThreeDSAvailabilityRequest.cs similarity index 100% rename from Adyen/Model/BinLookup/ThreeDSAvailabilityRequest.cs rename to Adyen/src/Model/BinLookup/ThreeDSAvailabilityRequest.cs diff --git a/Adyen/Model/BinLookup/ThreeDSAvailabilityResponse.cs b/Adyen/src/Model/BinLookup/ThreeDSAvailabilityResponse.cs similarity index 100% rename from Adyen/Model/BinLookup/ThreeDSAvailabilityResponse.cs rename to Adyen/src/Model/BinLookup/ThreeDSAvailabilityResponse.cs diff --git a/Adyen/Model/Checkout/AbstractOpenAPISchema.cs b/Adyen/src/Model/Checkout/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Checkout/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Checkout/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Checkout/AccountInfo.cs b/Adyen/src/Model/Checkout/AccountInfo.cs similarity index 100% rename from Adyen/Model/Checkout/AccountInfo.cs rename to Adyen/src/Model/Checkout/AccountInfo.cs diff --git a/Adyen/Model/Checkout/AcctInfo.cs b/Adyen/src/Model/Checkout/AcctInfo.cs similarity index 100% rename from Adyen/Model/Checkout/AcctInfo.cs rename to Adyen/src/Model/Checkout/AcctInfo.cs diff --git a/Adyen/Model/Checkout/AchDetails.cs b/Adyen/src/Model/Checkout/AchDetails.cs similarity index 100% rename from Adyen/Model/Checkout/AchDetails.cs rename to Adyen/src/Model/Checkout/AchDetails.cs diff --git a/Adyen/Model/Checkout/AdditionalData3DSecure.cs b/Adyen/src/Model/Checkout/AdditionalData3DSecure.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalData3DSecure.cs rename to Adyen/src/Model/Checkout/AdditionalData3DSecure.cs diff --git a/Adyen/Model/Checkout/AdditionalDataAirline.cs b/Adyen/src/Model/Checkout/AdditionalDataAirline.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataAirline.cs rename to Adyen/src/Model/Checkout/AdditionalDataAirline.cs diff --git a/Adyen/Model/Checkout/AdditionalDataCarRental.cs b/Adyen/src/Model/Checkout/AdditionalDataCarRental.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataCarRental.cs rename to Adyen/src/Model/Checkout/AdditionalDataCarRental.cs diff --git a/Adyen/Model/Checkout/AdditionalDataCommon.cs b/Adyen/src/Model/Checkout/AdditionalDataCommon.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataCommon.cs rename to Adyen/src/Model/Checkout/AdditionalDataCommon.cs diff --git a/Adyen/Model/Checkout/AdditionalDataLevel23.cs b/Adyen/src/Model/Checkout/AdditionalDataLevel23.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataLevel23.cs rename to Adyen/src/Model/Checkout/AdditionalDataLevel23.cs diff --git a/Adyen/Model/Checkout/AdditionalDataLodging.cs b/Adyen/src/Model/Checkout/AdditionalDataLodging.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataLodging.cs rename to Adyen/src/Model/Checkout/AdditionalDataLodging.cs diff --git a/Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs b/Adyen/src/Model/Checkout/AdditionalDataOpenInvoice.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs rename to Adyen/src/Model/Checkout/AdditionalDataOpenInvoice.cs diff --git a/Adyen/Model/Checkout/AdditionalDataOpi.cs b/Adyen/src/Model/Checkout/AdditionalDataOpi.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataOpi.cs rename to Adyen/src/Model/Checkout/AdditionalDataOpi.cs diff --git a/Adyen/Model/Checkout/AdditionalDataRatepay.cs b/Adyen/src/Model/Checkout/AdditionalDataRatepay.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataRatepay.cs rename to Adyen/src/Model/Checkout/AdditionalDataRatepay.cs diff --git a/Adyen/Model/Checkout/AdditionalDataRetry.cs b/Adyen/src/Model/Checkout/AdditionalDataRetry.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataRetry.cs rename to Adyen/src/Model/Checkout/AdditionalDataRetry.cs diff --git a/Adyen/Model/Checkout/AdditionalDataRisk.cs b/Adyen/src/Model/Checkout/AdditionalDataRisk.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataRisk.cs rename to Adyen/src/Model/Checkout/AdditionalDataRisk.cs diff --git a/Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs b/Adyen/src/Model/Checkout/AdditionalDataRiskStandalone.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs rename to Adyen/src/Model/Checkout/AdditionalDataRiskStandalone.cs diff --git a/Adyen/Model/Checkout/AdditionalDataSubMerchant.cs b/Adyen/src/Model/Checkout/AdditionalDataSubMerchant.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataSubMerchant.cs rename to Adyen/src/Model/Checkout/AdditionalDataSubMerchant.cs diff --git a/Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs b/Adyen/src/Model/Checkout/AdditionalDataTemporaryServices.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs rename to Adyen/src/Model/Checkout/AdditionalDataTemporaryServices.cs diff --git a/Adyen/Model/Checkout/AdditionalDataWallets.cs b/Adyen/src/Model/Checkout/AdditionalDataWallets.cs similarity index 100% rename from Adyen/Model/Checkout/AdditionalDataWallets.cs rename to Adyen/src/Model/Checkout/AdditionalDataWallets.cs diff --git a/Adyen/Model/Checkout/Address.cs b/Adyen/src/Model/Checkout/Address.cs similarity index 100% rename from Adyen/Model/Checkout/Address.cs rename to Adyen/src/Model/Checkout/Address.cs diff --git a/Adyen/Model/Checkout/AffirmDetails.cs b/Adyen/src/Model/Checkout/AffirmDetails.cs similarity index 100% rename from Adyen/Model/Checkout/AffirmDetails.cs rename to Adyen/src/Model/Checkout/AffirmDetails.cs diff --git a/Adyen/Model/Checkout/AfterpayDetails.cs b/Adyen/src/Model/Checkout/AfterpayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/AfterpayDetails.cs rename to Adyen/src/Model/Checkout/AfterpayDetails.cs diff --git a/Adyen/Model/Checkout/Agency.cs b/Adyen/src/Model/Checkout/Agency.cs similarity index 100% rename from Adyen/Model/Checkout/Agency.cs rename to Adyen/src/Model/Checkout/Agency.cs diff --git a/Adyen/Model/Checkout/Airline.cs b/Adyen/src/Model/Checkout/Airline.cs similarity index 100% rename from Adyen/Model/Checkout/Airline.cs rename to Adyen/src/Model/Checkout/Airline.cs diff --git a/Adyen/Model/Checkout/AmazonPayDetails.cs b/Adyen/src/Model/Checkout/AmazonPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/AmazonPayDetails.cs rename to Adyen/src/Model/Checkout/AmazonPayDetails.cs diff --git a/Adyen/Model/Checkout/Amount.cs b/Adyen/src/Model/Checkout/Amount.cs similarity index 100% rename from Adyen/Model/Checkout/Amount.cs rename to Adyen/src/Model/Checkout/Amount.cs diff --git a/Adyen/Model/Checkout/Amounts.cs b/Adyen/src/Model/Checkout/Amounts.cs similarity index 100% rename from Adyen/Model/Checkout/Amounts.cs rename to Adyen/src/Model/Checkout/Amounts.cs diff --git a/Adyen/Model/Checkout/AncvDetails.cs b/Adyen/src/Model/Checkout/AncvDetails.cs similarity index 100% rename from Adyen/Model/Checkout/AncvDetails.cs rename to Adyen/src/Model/Checkout/AncvDetails.cs diff --git a/Adyen/Model/Checkout/AndroidPayDetails.cs b/Adyen/src/Model/Checkout/AndroidPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/AndroidPayDetails.cs rename to Adyen/src/Model/Checkout/AndroidPayDetails.cs diff --git a/Adyen/Model/Checkout/ApplePayDetails.cs b/Adyen/src/Model/Checkout/ApplePayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/ApplePayDetails.cs rename to Adyen/src/Model/Checkout/ApplePayDetails.cs diff --git a/Adyen/Model/Checkout/ApplePayDonations.cs b/Adyen/src/Model/Checkout/ApplePayDonations.cs similarity index 100% rename from Adyen/Model/Checkout/ApplePayDonations.cs rename to Adyen/src/Model/Checkout/ApplePayDonations.cs diff --git a/Adyen/Model/Checkout/ApplePaySessionRequest.cs b/Adyen/src/Model/Checkout/ApplePaySessionRequest.cs similarity index 100% rename from Adyen/Model/Checkout/ApplePaySessionRequest.cs rename to Adyen/src/Model/Checkout/ApplePaySessionRequest.cs diff --git a/Adyen/Model/Checkout/ApplePaySessionResponse.cs b/Adyen/src/Model/Checkout/ApplePaySessionResponse.cs similarity index 100% rename from Adyen/Model/Checkout/ApplePaySessionResponse.cs rename to Adyen/src/Model/Checkout/ApplePaySessionResponse.cs diff --git a/Adyen/Model/Checkout/ApplicationInfo.cs b/Adyen/src/Model/Checkout/ApplicationInfo.cs similarity index 100% rename from Adyen/Model/Checkout/ApplicationInfo.cs rename to Adyen/src/Model/Checkout/ApplicationInfo.cs diff --git a/Adyen/Model/Checkout/AuthenticationData.cs b/Adyen/src/Model/Checkout/AuthenticationData.cs similarity index 100% rename from Adyen/Model/Checkout/AuthenticationData.cs rename to Adyen/src/Model/Checkout/AuthenticationData.cs diff --git a/Adyen/Model/Checkout/BacsDirectDebitDetails.cs b/Adyen/src/Model/Checkout/BacsDirectDebitDetails.cs similarity index 100% rename from Adyen/Model/Checkout/BacsDirectDebitDetails.cs rename to Adyen/src/Model/Checkout/BacsDirectDebitDetails.cs diff --git a/Adyen/Model/Checkout/BalanceCheckRequest.cs b/Adyen/src/Model/Checkout/BalanceCheckRequest.cs similarity index 100% rename from Adyen/Model/Checkout/BalanceCheckRequest.cs rename to Adyen/src/Model/Checkout/BalanceCheckRequest.cs diff --git a/Adyen/Model/Checkout/BalanceCheckResponse.cs b/Adyen/src/Model/Checkout/BalanceCheckResponse.cs similarity index 100% rename from Adyen/Model/Checkout/BalanceCheckResponse.cs rename to Adyen/src/Model/Checkout/BalanceCheckResponse.cs diff --git a/Adyen/Model/Checkout/BillDeskDetails.cs b/Adyen/src/Model/Checkout/BillDeskDetails.cs similarity index 100% rename from Adyen/Model/Checkout/BillDeskDetails.cs rename to Adyen/src/Model/Checkout/BillDeskDetails.cs diff --git a/Adyen/Model/Checkout/BillingAddress.cs b/Adyen/src/Model/Checkout/BillingAddress.cs similarity index 100% rename from Adyen/Model/Checkout/BillingAddress.cs rename to Adyen/src/Model/Checkout/BillingAddress.cs diff --git a/Adyen/Model/Checkout/BlikDetails.cs b/Adyen/src/Model/Checkout/BlikDetails.cs similarity index 100% rename from Adyen/Model/Checkout/BlikDetails.cs rename to Adyen/src/Model/Checkout/BlikDetails.cs diff --git a/Adyen/Model/Checkout/BrowserInfo.cs b/Adyen/src/Model/Checkout/BrowserInfo.cs similarity index 100% rename from Adyen/Model/Checkout/BrowserInfo.cs rename to Adyen/src/Model/Checkout/BrowserInfo.cs diff --git a/Adyen/Model/Checkout/CancelOrderRequest.cs b/Adyen/src/Model/Checkout/CancelOrderRequest.cs similarity index 100% rename from Adyen/Model/Checkout/CancelOrderRequest.cs rename to Adyen/src/Model/Checkout/CancelOrderRequest.cs diff --git a/Adyen/Model/Checkout/CancelOrderResponse.cs b/Adyen/src/Model/Checkout/CancelOrderResponse.cs similarity index 100% rename from Adyen/Model/Checkout/CancelOrderResponse.cs rename to Adyen/src/Model/Checkout/CancelOrderResponse.cs diff --git a/Adyen/Model/Checkout/CardBrandDetails.cs b/Adyen/src/Model/Checkout/CardBrandDetails.cs similarity index 100% rename from Adyen/Model/Checkout/CardBrandDetails.cs rename to Adyen/src/Model/Checkout/CardBrandDetails.cs diff --git a/Adyen/Model/Checkout/CardDetails.cs b/Adyen/src/Model/Checkout/CardDetails.cs similarity index 100% rename from Adyen/Model/Checkout/CardDetails.cs rename to Adyen/src/Model/Checkout/CardDetails.cs diff --git a/Adyen/Model/Checkout/CardDetailsRequest.cs b/Adyen/src/Model/Checkout/CardDetailsRequest.cs similarity index 100% rename from Adyen/Model/Checkout/CardDetailsRequest.cs rename to Adyen/src/Model/Checkout/CardDetailsRequest.cs diff --git a/Adyen/Model/Checkout/CardDetailsResponse.cs b/Adyen/src/Model/Checkout/CardDetailsResponse.cs similarity index 100% rename from Adyen/Model/Checkout/CardDetailsResponse.cs rename to Adyen/src/Model/Checkout/CardDetailsResponse.cs diff --git a/Adyen/Model/Checkout/CardDonations.cs b/Adyen/src/Model/Checkout/CardDonations.cs similarity index 100% rename from Adyen/Model/Checkout/CardDonations.cs rename to Adyen/src/Model/Checkout/CardDonations.cs diff --git a/Adyen/Model/Checkout/CashAppDetails.cs b/Adyen/src/Model/Checkout/CashAppDetails.cs similarity index 100% rename from Adyen/Model/Checkout/CashAppDetails.cs rename to Adyen/src/Model/Checkout/CashAppDetails.cs diff --git a/Adyen/Model/Checkout/CellulantDetails.cs b/Adyen/src/Model/Checkout/CellulantDetails.cs similarity index 100% rename from Adyen/Model/Checkout/CellulantDetails.cs rename to Adyen/src/Model/Checkout/CellulantDetails.cs diff --git a/Adyen/Model/Checkout/CheckoutAwaitAction.cs b/Adyen/src/Model/Checkout/CheckoutAwaitAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutAwaitAction.cs rename to Adyen/src/Model/Checkout/CheckoutAwaitAction.cs diff --git a/Adyen/Model/Checkout/CheckoutBankAccount.cs b/Adyen/src/Model/Checkout/CheckoutBankAccount.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutBankAccount.cs rename to Adyen/src/Model/Checkout/CheckoutBankAccount.cs diff --git a/Adyen/Model/Checkout/CheckoutBankTransferAction.cs b/Adyen/src/Model/Checkout/CheckoutBankTransferAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutBankTransferAction.cs rename to Adyen/src/Model/Checkout/CheckoutBankTransferAction.cs diff --git a/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs b/Adyen/src/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs rename to Adyen/src/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs diff --git a/Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs b/Adyen/src/Model/Checkout/CheckoutNativeRedirectAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs rename to Adyen/src/Model/Checkout/CheckoutNativeRedirectAction.cs diff --git a/Adyen/Model/Checkout/CheckoutOrderResponse.cs b/Adyen/src/Model/Checkout/CheckoutOrderResponse.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutOrderResponse.cs rename to Adyen/src/Model/Checkout/CheckoutOrderResponse.cs diff --git a/Adyen/Model/Checkout/CheckoutPaymentMethod.cs b/Adyen/src/Model/Checkout/CheckoutPaymentMethod.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutPaymentMethod.cs rename to Adyen/src/Model/Checkout/CheckoutPaymentMethod.cs diff --git a/Adyen/Model/Checkout/CheckoutQrCodeAction.cs b/Adyen/src/Model/Checkout/CheckoutQrCodeAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutQrCodeAction.cs rename to Adyen/src/Model/Checkout/CheckoutQrCodeAction.cs diff --git a/Adyen/Model/Checkout/CheckoutRedirectAction.cs b/Adyen/src/Model/Checkout/CheckoutRedirectAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutRedirectAction.cs rename to Adyen/src/Model/Checkout/CheckoutRedirectAction.cs diff --git a/Adyen/Model/Checkout/CheckoutSDKAction.cs b/Adyen/src/Model/Checkout/CheckoutSDKAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutSDKAction.cs rename to Adyen/src/Model/Checkout/CheckoutSDKAction.cs diff --git a/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs b/Adyen/src/Model/Checkout/CheckoutSessionInstallmentOption.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs rename to Adyen/src/Model/Checkout/CheckoutSessionInstallmentOption.cs diff --git a/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs b/Adyen/src/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs rename to Adyen/src/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs diff --git a/Adyen/Model/Checkout/CheckoutThreeDS2Action.cs b/Adyen/src/Model/Checkout/CheckoutThreeDS2Action.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutThreeDS2Action.cs rename to Adyen/src/Model/Checkout/CheckoutThreeDS2Action.cs diff --git a/Adyen/Model/Checkout/CheckoutVoucherAction.cs b/Adyen/src/Model/Checkout/CheckoutVoucherAction.cs similarity index 100% rename from Adyen/Model/Checkout/CheckoutVoucherAction.cs rename to Adyen/src/Model/Checkout/CheckoutVoucherAction.cs diff --git a/Adyen/Model/Checkout/CommonField.cs b/Adyen/src/Model/Checkout/CommonField.cs similarity index 100% rename from Adyen/Model/Checkout/CommonField.cs rename to Adyen/src/Model/Checkout/CommonField.cs diff --git a/Adyen/Model/Checkout/Company.cs b/Adyen/src/Model/Checkout/Company.cs similarity index 100% rename from Adyen/Model/Checkout/Company.cs rename to Adyen/src/Model/Checkout/Company.cs diff --git a/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs b/Adyen/src/Model/Checkout/CreateCheckoutSessionRequest.cs similarity index 100% rename from Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs rename to Adyen/src/Model/Checkout/CreateCheckoutSessionRequest.cs diff --git a/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs b/Adyen/src/Model/Checkout/CreateCheckoutSessionResponse.cs similarity index 100% rename from Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs rename to Adyen/src/Model/Checkout/CreateCheckoutSessionResponse.cs diff --git a/Adyen/Model/Checkout/CreateOrderRequest.cs b/Adyen/src/Model/Checkout/CreateOrderRequest.cs similarity index 100% rename from Adyen/Model/Checkout/CreateOrderRequest.cs rename to Adyen/src/Model/Checkout/CreateOrderRequest.cs diff --git a/Adyen/Model/Checkout/CreateOrderResponse.cs b/Adyen/src/Model/Checkout/CreateOrderResponse.cs similarity index 100% rename from Adyen/Model/Checkout/CreateOrderResponse.cs rename to Adyen/src/Model/Checkout/CreateOrderResponse.cs diff --git a/Adyen/Model/Checkout/DeliveryAddress.cs b/Adyen/src/Model/Checkout/DeliveryAddress.cs similarity index 100% rename from Adyen/Model/Checkout/DeliveryAddress.cs rename to Adyen/src/Model/Checkout/DeliveryAddress.cs diff --git a/Adyen/Model/Checkout/DeliveryMethod.cs b/Adyen/src/Model/Checkout/DeliveryMethod.cs similarity index 100% rename from Adyen/Model/Checkout/DeliveryMethod.cs rename to Adyen/src/Model/Checkout/DeliveryMethod.cs diff --git a/Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs b/Adyen/src/Model/Checkout/DetailsRequestAuthenticationData.cs similarity index 100% rename from Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs rename to Adyen/src/Model/Checkout/DetailsRequestAuthenticationData.cs diff --git a/Adyen/Model/Checkout/DeviceRenderOptions.cs b/Adyen/src/Model/Checkout/DeviceRenderOptions.cs similarity index 100% rename from Adyen/Model/Checkout/DeviceRenderOptions.cs rename to Adyen/src/Model/Checkout/DeviceRenderOptions.cs diff --git a/Adyen/Model/Checkout/DokuDetails.cs b/Adyen/src/Model/Checkout/DokuDetails.cs similarity index 100% rename from Adyen/Model/Checkout/DokuDetails.cs rename to Adyen/src/Model/Checkout/DokuDetails.cs diff --git a/Adyen/Model/Checkout/Donation.cs b/Adyen/src/Model/Checkout/Donation.cs similarity index 100% rename from Adyen/Model/Checkout/Donation.cs rename to Adyen/src/Model/Checkout/Donation.cs diff --git a/Adyen/Model/Checkout/DonationCampaign.cs b/Adyen/src/Model/Checkout/DonationCampaign.cs similarity index 100% rename from Adyen/Model/Checkout/DonationCampaign.cs rename to Adyen/src/Model/Checkout/DonationCampaign.cs diff --git a/Adyen/Model/Checkout/DonationCampaignsRequest.cs b/Adyen/src/Model/Checkout/DonationCampaignsRequest.cs similarity index 100% rename from Adyen/Model/Checkout/DonationCampaignsRequest.cs rename to Adyen/src/Model/Checkout/DonationCampaignsRequest.cs diff --git a/Adyen/Model/Checkout/DonationCampaignsResponse.cs b/Adyen/src/Model/Checkout/DonationCampaignsResponse.cs similarity index 100% rename from Adyen/Model/Checkout/DonationCampaignsResponse.cs rename to Adyen/src/Model/Checkout/DonationCampaignsResponse.cs diff --git a/Adyen/Model/Checkout/DonationPaymentMethod.cs b/Adyen/src/Model/Checkout/DonationPaymentMethod.cs similarity index 100% rename from Adyen/Model/Checkout/DonationPaymentMethod.cs rename to Adyen/src/Model/Checkout/DonationPaymentMethod.cs diff --git a/Adyen/Model/Checkout/DonationPaymentRequest.cs b/Adyen/src/Model/Checkout/DonationPaymentRequest.cs similarity index 100% rename from Adyen/Model/Checkout/DonationPaymentRequest.cs rename to Adyen/src/Model/Checkout/DonationPaymentRequest.cs diff --git a/Adyen/Model/Checkout/DonationPaymentResponse.cs b/Adyen/src/Model/Checkout/DonationPaymentResponse.cs similarity index 100% rename from Adyen/Model/Checkout/DonationPaymentResponse.cs rename to Adyen/src/Model/Checkout/DonationPaymentResponse.cs diff --git a/Adyen/Model/Checkout/DragonpayDetails.cs b/Adyen/src/Model/Checkout/DragonpayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/DragonpayDetails.cs rename to Adyen/src/Model/Checkout/DragonpayDetails.cs diff --git a/Adyen/Model/Checkout/EBankingFinlandDetails.cs b/Adyen/src/Model/Checkout/EBankingFinlandDetails.cs similarity index 100% rename from Adyen/Model/Checkout/EBankingFinlandDetails.cs rename to Adyen/src/Model/Checkout/EBankingFinlandDetails.cs diff --git a/Adyen/Model/Checkout/EcontextVoucherDetails.cs b/Adyen/src/Model/Checkout/EcontextVoucherDetails.cs similarity index 100% rename from Adyen/Model/Checkout/EcontextVoucherDetails.cs rename to Adyen/src/Model/Checkout/EcontextVoucherDetails.cs diff --git a/Adyen/Model/Checkout/EftDetails.cs b/Adyen/src/Model/Checkout/EftDetails.cs similarity index 100% rename from Adyen/Model/Checkout/EftDetails.cs rename to Adyen/src/Model/Checkout/EftDetails.cs diff --git a/Adyen/Model/Checkout/EncryptedOrderData.cs b/Adyen/src/Model/Checkout/EncryptedOrderData.cs similarity index 100% rename from Adyen/Model/Checkout/EncryptedOrderData.cs rename to Adyen/src/Model/Checkout/EncryptedOrderData.cs diff --git a/Adyen/Model/Checkout/EnhancedSchemeData.cs b/Adyen/src/Model/Checkout/EnhancedSchemeData.cs similarity index 100% rename from Adyen/Model/Checkout/EnhancedSchemeData.cs rename to Adyen/src/Model/Checkout/EnhancedSchemeData.cs diff --git a/Adyen/Model/Checkout/ExternalPlatform.cs b/Adyen/src/Model/Checkout/ExternalPlatform.cs similarity index 100% rename from Adyen/Model/Checkout/ExternalPlatform.cs rename to Adyen/src/Model/Checkout/ExternalPlatform.cs diff --git a/Adyen/Model/Checkout/FastlaneDetails.cs b/Adyen/src/Model/Checkout/FastlaneDetails.cs similarity index 100% rename from Adyen/Model/Checkout/FastlaneDetails.cs rename to Adyen/src/Model/Checkout/FastlaneDetails.cs diff --git a/Adyen/Model/Checkout/ForexQuote.cs b/Adyen/src/Model/Checkout/ForexQuote.cs similarity index 100% rename from Adyen/Model/Checkout/ForexQuote.cs rename to Adyen/src/Model/Checkout/ForexQuote.cs diff --git a/Adyen/Model/Checkout/FraudCheckResult.cs b/Adyen/src/Model/Checkout/FraudCheckResult.cs similarity index 100% rename from Adyen/Model/Checkout/FraudCheckResult.cs rename to Adyen/src/Model/Checkout/FraudCheckResult.cs diff --git a/Adyen/Model/Checkout/FraudResult.cs b/Adyen/src/Model/Checkout/FraudResult.cs similarity index 100% rename from Adyen/Model/Checkout/FraudResult.cs rename to Adyen/src/Model/Checkout/FraudResult.cs diff --git a/Adyen/Model/Checkout/FundOrigin.cs b/Adyen/src/Model/Checkout/FundOrigin.cs similarity index 100% rename from Adyen/Model/Checkout/FundOrigin.cs rename to Adyen/src/Model/Checkout/FundOrigin.cs diff --git a/Adyen/Model/Checkout/FundRecipient.cs b/Adyen/src/Model/Checkout/FundRecipient.cs similarity index 100% rename from Adyen/Model/Checkout/FundRecipient.cs rename to Adyen/src/Model/Checkout/FundRecipient.cs diff --git a/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs b/Adyen/src/Model/Checkout/GenericIssuerPaymentMethodDetails.cs similarity index 100% rename from Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs rename to Adyen/src/Model/Checkout/GenericIssuerPaymentMethodDetails.cs diff --git a/Adyen/Model/Checkout/GooglePayDetails.cs b/Adyen/src/Model/Checkout/GooglePayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/GooglePayDetails.cs rename to Adyen/src/Model/Checkout/GooglePayDetails.cs diff --git a/Adyen/Model/Checkout/GooglePayDonations.cs b/Adyen/src/Model/Checkout/GooglePayDonations.cs similarity index 100% rename from Adyen/Model/Checkout/GooglePayDonations.cs rename to Adyen/src/Model/Checkout/GooglePayDonations.cs diff --git a/Adyen/Model/Checkout/IdealDetails.cs b/Adyen/src/Model/Checkout/IdealDetails.cs similarity index 100% rename from Adyen/Model/Checkout/IdealDetails.cs rename to Adyen/src/Model/Checkout/IdealDetails.cs diff --git a/Adyen/Model/Checkout/IdealDonations.cs b/Adyen/src/Model/Checkout/IdealDonations.cs similarity index 100% rename from Adyen/Model/Checkout/IdealDonations.cs rename to Adyen/src/Model/Checkout/IdealDonations.cs diff --git a/Adyen/Model/Checkout/InputDetail.cs b/Adyen/src/Model/Checkout/InputDetail.cs similarity index 100% rename from Adyen/Model/Checkout/InputDetail.cs rename to Adyen/src/Model/Checkout/InputDetail.cs diff --git a/Adyen/Model/Checkout/InstallmentOption.cs b/Adyen/src/Model/Checkout/InstallmentOption.cs similarity index 100% rename from Adyen/Model/Checkout/InstallmentOption.cs rename to Adyen/src/Model/Checkout/InstallmentOption.cs diff --git a/Adyen/Model/Checkout/Installments.cs b/Adyen/src/Model/Checkout/Installments.cs similarity index 100% rename from Adyen/Model/Checkout/Installments.cs rename to Adyen/src/Model/Checkout/Installments.cs diff --git a/Adyen/Model/Checkout/Item.cs b/Adyen/src/Model/Checkout/Item.cs similarity index 100% rename from Adyen/Model/Checkout/Item.cs rename to Adyen/src/Model/Checkout/Item.cs diff --git a/Adyen/Model/Checkout/KlarnaDetails.cs b/Adyen/src/Model/Checkout/KlarnaDetails.cs similarity index 100% rename from Adyen/Model/Checkout/KlarnaDetails.cs rename to Adyen/src/Model/Checkout/KlarnaDetails.cs diff --git a/Adyen/Model/Checkout/Leg.cs b/Adyen/src/Model/Checkout/Leg.cs similarity index 100% rename from Adyen/Model/Checkout/Leg.cs rename to Adyen/src/Model/Checkout/Leg.cs diff --git a/Adyen/Model/Checkout/LineItem.cs b/Adyen/src/Model/Checkout/LineItem.cs similarity index 100% rename from Adyen/Model/Checkout/LineItem.cs rename to Adyen/src/Model/Checkout/LineItem.cs diff --git a/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs b/Adyen/src/Model/Checkout/ListStoredPaymentMethodsResponse.cs similarity index 100% rename from Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs rename to Adyen/src/Model/Checkout/ListStoredPaymentMethodsResponse.cs diff --git a/Adyen/Model/Checkout/Mandate.cs b/Adyen/src/Model/Checkout/Mandate.cs similarity index 100% rename from Adyen/Model/Checkout/Mandate.cs rename to Adyen/src/Model/Checkout/Mandate.cs diff --git a/Adyen/Model/Checkout/MasterpassDetails.cs b/Adyen/src/Model/Checkout/MasterpassDetails.cs similarity index 100% rename from Adyen/Model/Checkout/MasterpassDetails.cs rename to Adyen/src/Model/Checkout/MasterpassDetails.cs diff --git a/Adyen/Model/Checkout/MbwayDetails.cs b/Adyen/src/Model/Checkout/MbwayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/MbwayDetails.cs rename to Adyen/src/Model/Checkout/MbwayDetails.cs diff --git a/Adyen/Model/Checkout/MerchantDevice.cs b/Adyen/src/Model/Checkout/MerchantDevice.cs similarity index 100% rename from Adyen/Model/Checkout/MerchantDevice.cs rename to Adyen/src/Model/Checkout/MerchantDevice.cs diff --git a/Adyen/Model/Checkout/MerchantRiskIndicator.cs b/Adyen/src/Model/Checkout/MerchantRiskIndicator.cs similarity index 100% rename from Adyen/Model/Checkout/MerchantRiskIndicator.cs rename to Adyen/src/Model/Checkout/MerchantRiskIndicator.cs diff --git a/Adyen/Model/Checkout/MobilePayDetails.cs b/Adyen/src/Model/Checkout/MobilePayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/MobilePayDetails.cs rename to Adyen/src/Model/Checkout/MobilePayDetails.cs diff --git a/Adyen/Model/Checkout/MolPayDetails.cs b/Adyen/src/Model/Checkout/MolPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/MolPayDetails.cs rename to Adyen/src/Model/Checkout/MolPayDetails.cs diff --git a/Adyen/Model/Checkout/Name.cs b/Adyen/src/Model/Checkout/Name.cs similarity index 100% rename from Adyen/Model/Checkout/Name.cs rename to Adyen/src/Model/Checkout/Name.cs diff --git a/Adyen/Model/Checkout/OpenInvoiceDetails.cs b/Adyen/src/Model/Checkout/OpenInvoiceDetails.cs similarity index 100% rename from Adyen/Model/Checkout/OpenInvoiceDetails.cs rename to Adyen/src/Model/Checkout/OpenInvoiceDetails.cs diff --git a/Adyen/Model/Checkout/Passenger.cs b/Adyen/src/Model/Checkout/Passenger.cs similarity index 100% rename from Adyen/Model/Checkout/Passenger.cs rename to Adyen/src/Model/Checkout/Passenger.cs diff --git a/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs b/Adyen/src/Model/Checkout/PayByBankAISDirectDebitDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs rename to Adyen/src/Model/Checkout/PayByBankAISDirectDebitDetails.cs diff --git a/Adyen/Model/Checkout/PayByBankDetails.cs b/Adyen/src/Model/Checkout/PayByBankDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayByBankDetails.cs rename to Adyen/src/Model/Checkout/PayByBankDetails.cs diff --git a/Adyen/Model/Checkout/PayPalDetails.cs b/Adyen/src/Model/Checkout/PayPalDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayPalDetails.cs rename to Adyen/src/Model/Checkout/PayPalDetails.cs diff --git a/Adyen/Model/Checkout/PayPayDetails.cs b/Adyen/src/Model/Checkout/PayPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayPayDetails.cs rename to Adyen/src/Model/Checkout/PayPayDetails.cs diff --git a/Adyen/Model/Checkout/PayToDetails.cs b/Adyen/src/Model/Checkout/PayToDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayToDetails.cs rename to Adyen/src/Model/Checkout/PayToDetails.cs diff --git a/Adyen/Model/Checkout/PayUUpiDetails.cs b/Adyen/src/Model/Checkout/PayUUpiDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayUUpiDetails.cs rename to Adyen/src/Model/Checkout/PayUUpiDetails.cs diff --git a/Adyen/Model/Checkout/PayWithGoogleDetails.cs b/Adyen/src/Model/Checkout/PayWithGoogleDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PayWithGoogleDetails.cs rename to Adyen/src/Model/Checkout/PayWithGoogleDetails.cs diff --git a/Adyen/Model/Checkout/PayWithGoogleDonations.cs b/Adyen/src/Model/Checkout/PayWithGoogleDonations.cs similarity index 100% rename from Adyen/Model/Checkout/PayWithGoogleDonations.cs rename to Adyen/src/Model/Checkout/PayWithGoogleDonations.cs diff --git a/Adyen/Model/Checkout/Payment.cs b/Adyen/src/Model/Checkout/Payment.cs similarity index 100% rename from Adyen/Model/Checkout/Payment.cs rename to Adyen/src/Model/Checkout/Payment.cs diff --git a/Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs b/Adyen/src/Model/Checkout/PaymentAmountUpdateRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs rename to Adyen/src/Model/Checkout/PaymentAmountUpdateRequest.cs diff --git a/Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs b/Adyen/src/Model/Checkout/PaymentAmountUpdateResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs rename to Adyen/src/Model/Checkout/PaymentAmountUpdateResponse.cs diff --git a/Adyen/Model/Checkout/PaymentCancelRequest.cs b/Adyen/src/Model/Checkout/PaymentCancelRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentCancelRequest.cs rename to Adyen/src/Model/Checkout/PaymentCancelRequest.cs diff --git a/Adyen/Model/Checkout/PaymentCancelResponse.cs b/Adyen/src/Model/Checkout/PaymentCancelResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentCancelResponse.cs rename to Adyen/src/Model/Checkout/PaymentCancelResponse.cs diff --git a/Adyen/Model/Checkout/PaymentCaptureRequest.cs b/Adyen/src/Model/Checkout/PaymentCaptureRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentCaptureRequest.cs rename to Adyen/src/Model/Checkout/PaymentCaptureRequest.cs diff --git a/Adyen/Model/Checkout/PaymentCaptureResponse.cs b/Adyen/src/Model/Checkout/PaymentCaptureResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentCaptureResponse.cs rename to Adyen/src/Model/Checkout/PaymentCaptureResponse.cs diff --git a/Adyen/Model/Checkout/PaymentCompletionDetails.cs b/Adyen/src/Model/Checkout/PaymentCompletionDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentCompletionDetails.cs rename to Adyen/src/Model/Checkout/PaymentCompletionDetails.cs diff --git a/Adyen/Model/Checkout/PaymentDetails.cs b/Adyen/src/Model/Checkout/PaymentDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentDetails.cs rename to Adyen/src/Model/Checkout/PaymentDetails.cs diff --git a/Adyen/Model/Checkout/PaymentDetailsRequest.cs b/Adyen/src/Model/Checkout/PaymentDetailsRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentDetailsRequest.cs rename to Adyen/src/Model/Checkout/PaymentDetailsRequest.cs diff --git a/Adyen/Model/Checkout/PaymentDetailsResponse.cs b/Adyen/src/Model/Checkout/PaymentDetailsResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentDetailsResponse.cs rename to Adyen/src/Model/Checkout/PaymentDetailsResponse.cs diff --git a/Adyen/Model/Checkout/PaymentLinkRequest.cs b/Adyen/src/Model/Checkout/PaymentLinkRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentLinkRequest.cs rename to Adyen/src/Model/Checkout/PaymentLinkRequest.cs diff --git a/Adyen/Model/Checkout/PaymentLinkResponse.cs b/Adyen/src/Model/Checkout/PaymentLinkResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentLinkResponse.cs rename to Adyen/src/Model/Checkout/PaymentLinkResponse.cs diff --git a/Adyen/Model/Checkout/PaymentMethod.cs b/Adyen/src/Model/Checkout/PaymentMethod.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethod.cs rename to Adyen/src/Model/Checkout/PaymentMethod.cs diff --git a/Adyen/Model/Checkout/PaymentMethodGroup.cs b/Adyen/src/Model/Checkout/PaymentMethodGroup.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethodGroup.cs rename to Adyen/src/Model/Checkout/PaymentMethodGroup.cs diff --git a/Adyen/Model/Checkout/PaymentMethodIssuer.cs b/Adyen/src/Model/Checkout/PaymentMethodIssuer.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethodIssuer.cs rename to Adyen/src/Model/Checkout/PaymentMethodIssuer.cs diff --git a/Adyen/Model/Checkout/PaymentMethodToStore.cs b/Adyen/src/Model/Checkout/PaymentMethodToStore.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethodToStore.cs rename to Adyen/src/Model/Checkout/PaymentMethodToStore.cs diff --git a/Adyen/Model/Checkout/PaymentMethodUPIApps.cs b/Adyen/src/Model/Checkout/PaymentMethodUPIApps.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethodUPIApps.cs rename to Adyen/src/Model/Checkout/PaymentMethodUPIApps.cs diff --git a/Adyen/Model/Checkout/PaymentMethodsRequest.cs b/Adyen/src/Model/Checkout/PaymentMethodsRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethodsRequest.cs rename to Adyen/src/Model/Checkout/PaymentMethodsRequest.cs diff --git a/Adyen/Model/Checkout/PaymentMethodsResponse.cs b/Adyen/src/Model/Checkout/PaymentMethodsResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentMethodsResponse.cs rename to Adyen/src/Model/Checkout/PaymentMethodsResponse.cs diff --git a/Adyen/Model/Checkout/PaymentRefundRequest.cs b/Adyen/src/Model/Checkout/PaymentRefundRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentRefundRequest.cs rename to Adyen/src/Model/Checkout/PaymentRefundRequest.cs diff --git a/Adyen/Model/Checkout/PaymentRefundResponse.cs b/Adyen/src/Model/Checkout/PaymentRefundResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentRefundResponse.cs rename to Adyen/src/Model/Checkout/PaymentRefundResponse.cs diff --git a/Adyen/Model/Checkout/PaymentRequest.cs b/Adyen/src/Model/Checkout/PaymentRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentRequest.cs rename to Adyen/src/Model/Checkout/PaymentRequest.cs diff --git a/Adyen/Model/Checkout/PaymentResponse.cs b/Adyen/src/Model/Checkout/PaymentResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentResponse.cs rename to Adyen/src/Model/Checkout/PaymentResponse.cs diff --git a/Adyen/Model/Checkout/PaymentResponseAction.cs b/Adyen/src/Model/Checkout/PaymentResponseAction.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentResponseAction.cs rename to Adyen/src/Model/Checkout/PaymentResponseAction.cs diff --git a/Adyen/Model/Checkout/PaymentReversalRequest.cs b/Adyen/src/Model/Checkout/PaymentReversalRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentReversalRequest.cs rename to Adyen/src/Model/Checkout/PaymentReversalRequest.cs diff --git a/Adyen/Model/Checkout/PaymentReversalResponse.cs b/Adyen/src/Model/Checkout/PaymentReversalResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaymentReversalResponse.cs rename to Adyen/src/Model/Checkout/PaymentReversalResponse.cs diff --git a/Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs b/Adyen/src/Model/Checkout/PaypalUpdateOrderRequest.cs similarity index 100% rename from Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs rename to Adyen/src/Model/Checkout/PaypalUpdateOrderRequest.cs diff --git a/Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs b/Adyen/src/Model/Checkout/PaypalUpdateOrderResponse.cs similarity index 100% rename from Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs rename to Adyen/src/Model/Checkout/PaypalUpdateOrderResponse.cs diff --git a/Adyen/Model/Checkout/Phone.cs b/Adyen/src/Model/Checkout/Phone.cs similarity index 100% rename from Adyen/Model/Checkout/Phone.cs rename to Adyen/src/Model/Checkout/Phone.cs diff --git a/Adyen/Model/Checkout/PixDetails.cs b/Adyen/src/Model/Checkout/PixDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PixDetails.cs rename to Adyen/src/Model/Checkout/PixDetails.cs diff --git a/Adyen/Model/Checkout/PixRecurring.cs b/Adyen/src/Model/Checkout/PixRecurring.cs similarity index 100% rename from Adyen/Model/Checkout/PixRecurring.cs rename to Adyen/src/Model/Checkout/PixRecurring.cs diff --git a/Adyen/Model/Checkout/PlatformChargebackLogic.cs b/Adyen/src/Model/Checkout/PlatformChargebackLogic.cs similarity index 100% rename from Adyen/Model/Checkout/PlatformChargebackLogic.cs rename to Adyen/src/Model/Checkout/PlatformChargebackLogic.cs diff --git a/Adyen/Model/Checkout/PseDetails.cs b/Adyen/src/Model/Checkout/PseDetails.cs similarity index 100% rename from Adyen/Model/Checkout/PseDetails.cs rename to Adyen/src/Model/Checkout/PseDetails.cs diff --git a/Adyen/Model/Checkout/RakutenPayDetails.cs b/Adyen/src/Model/Checkout/RakutenPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/RakutenPayDetails.cs rename to Adyen/src/Model/Checkout/RakutenPayDetails.cs diff --git a/Adyen/Model/Checkout/RatepayDetails.cs b/Adyen/src/Model/Checkout/RatepayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/RatepayDetails.cs rename to Adyen/src/Model/Checkout/RatepayDetails.cs diff --git a/Adyen/Model/Checkout/Recurring.cs b/Adyen/src/Model/Checkout/Recurring.cs similarity index 100% rename from Adyen/Model/Checkout/Recurring.cs rename to Adyen/src/Model/Checkout/Recurring.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs b/Adyen/src/Model/Checkout/ResponseAdditionalData3DSecure.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalData3DSecure.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataBillingAddress.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataBillingAddress.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataCard.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataCard.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataCard.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataCard.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataCommon.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataCommon.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataDomesticError.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataDomesticError.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataInstallments.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataInstallments.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataOpi.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataOpi.cs diff --git a/Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs b/Adyen/src/Model/Checkout/ResponseAdditionalDataSepa.cs similarity index 100% rename from Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs rename to Adyen/src/Model/Checkout/ResponseAdditionalDataSepa.cs diff --git a/Adyen/Model/Checkout/ResponsePaymentMethod.cs b/Adyen/src/Model/Checkout/ResponsePaymentMethod.cs similarity index 100% rename from Adyen/Model/Checkout/ResponsePaymentMethod.cs rename to Adyen/src/Model/Checkout/ResponsePaymentMethod.cs diff --git a/Adyen/Model/Checkout/RiskData.cs b/Adyen/src/Model/Checkout/RiskData.cs similarity index 100% rename from Adyen/Model/Checkout/RiskData.cs rename to Adyen/src/Model/Checkout/RiskData.cs diff --git a/Adyen/Model/Checkout/RivertyDetails.cs b/Adyen/src/Model/Checkout/RivertyDetails.cs similarity index 100% rename from Adyen/Model/Checkout/RivertyDetails.cs rename to Adyen/src/Model/Checkout/RivertyDetails.cs diff --git a/Adyen/Model/Checkout/SDKEphemPubKey.cs b/Adyen/src/Model/Checkout/SDKEphemPubKey.cs similarity index 100% rename from Adyen/Model/Checkout/SDKEphemPubKey.cs rename to Adyen/src/Model/Checkout/SDKEphemPubKey.cs diff --git a/Adyen/Model/Checkout/SamsungPayDetails.cs b/Adyen/src/Model/Checkout/SamsungPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/SamsungPayDetails.cs rename to Adyen/src/Model/Checkout/SamsungPayDetails.cs diff --git a/Adyen/Model/Checkout/SepaDirectDebitDetails.cs b/Adyen/src/Model/Checkout/SepaDirectDebitDetails.cs similarity index 100% rename from Adyen/Model/Checkout/SepaDirectDebitDetails.cs rename to Adyen/src/Model/Checkout/SepaDirectDebitDetails.cs diff --git a/Adyen/Model/Checkout/ServiceError.cs b/Adyen/src/Model/Checkout/ServiceError.cs similarity index 100% rename from Adyen/Model/Checkout/ServiceError.cs rename to Adyen/src/Model/Checkout/ServiceError.cs diff --git a/Adyen/Model/Checkout/SessionResultResponse.cs b/Adyen/src/Model/Checkout/SessionResultResponse.cs similarity index 100% rename from Adyen/Model/Checkout/SessionResultResponse.cs rename to Adyen/src/Model/Checkout/SessionResultResponse.cs diff --git a/Adyen/Model/Checkout/ShopperInteractionDevice.cs b/Adyen/src/Model/Checkout/ShopperInteractionDevice.cs similarity index 100% rename from Adyen/Model/Checkout/ShopperInteractionDevice.cs rename to Adyen/src/Model/Checkout/ShopperInteractionDevice.cs diff --git a/Adyen/Model/Checkout/Split.cs b/Adyen/src/Model/Checkout/Split.cs similarity index 100% rename from Adyen/Model/Checkout/Split.cs rename to Adyen/src/Model/Checkout/Split.cs diff --git a/Adyen/Model/Checkout/SplitAmount.cs b/Adyen/src/Model/Checkout/SplitAmount.cs similarity index 100% rename from Adyen/Model/Checkout/SplitAmount.cs rename to Adyen/src/Model/Checkout/SplitAmount.cs diff --git a/Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs b/Adyen/src/Model/Checkout/StandalonePaymentCancelRequest.cs similarity index 100% rename from Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs rename to Adyen/src/Model/Checkout/StandalonePaymentCancelRequest.cs diff --git a/Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs b/Adyen/src/Model/Checkout/StandalonePaymentCancelResponse.cs similarity index 100% rename from Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs rename to Adyen/src/Model/Checkout/StandalonePaymentCancelResponse.cs diff --git a/Adyen/Model/Checkout/StoredPaymentMethod.cs b/Adyen/src/Model/Checkout/StoredPaymentMethod.cs similarity index 100% rename from Adyen/Model/Checkout/StoredPaymentMethod.cs rename to Adyen/src/Model/Checkout/StoredPaymentMethod.cs diff --git a/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs b/Adyen/src/Model/Checkout/StoredPaymentMethodDetails.cs similarity index 100% rename from Adyen/Model/Checkout/StoredPaymentMethodDetails.cs rename to Adyen/src/Model/Checkout/StoredPaymentMethodDetails.cs diff --git a/Adyen/Model/Checkout/StoredPaymentMethodRequest.cs b/Adyen/src/Model/Checkout/StoredPaymentMethodRequest.cs similarity index 100% rename from Adyen/Model/Checkout/StoredPaymentMethodRequest.cs rename to Adyen/src/Model/Checkout/StoredPaymentMethodRequest.cs diff --git a/Adyen/Model/Checkout/StoredPaymentMethodResource.cs b/Adyen/src/Model/Checkout/StoredPaymentMethodResource.cs similarity index 100% rename from Adyen/Model/Checkout/StoredPaymentMethodResource.cs rename to Adyen/src/Model/Checkout/StoredPaymentMethodResource.cs diff --git a/Adyen/Model/Checkout/SubInputDetail.cs b/Adyen/src/Model/Checkout/SubInputDetail.cs similarity index 100% rename from Adyen/Model/Checkout/SubInputDetail.cs rename to Adyen/src/Model/Checkout/SubInputDetail.cs diff --git a/Adyen/Model/Checkout/SubMerchant.cs b/Adyen/src/Model/Checkout/SubMerchant.cs similarity index 100% rename from Adyen/Model/Checkout/SubMerchant.cs rename to Adyen/src/Model/Checkout/SubMerchant.cs diff --git a/Adyen/Model/Checkout/SubMerchantInfo.cs b/Adyen/src/Model/Checkout/SubMerchantInfo.cs similarity index 100% rename from Adyen/Model/Checkout/SubMerchantInfo.cs rename to Adyen/src/Model/Checkout/SubMerchantInfo.cs diff --git a/Adyen/Model/Checkout/Surcharge.cs b/Adyen/src/Model/Checkout/Surcharge.cs similarity index 100% rename from Adyen/Model/Checkout/Surcharge.cs rename to Adyen/src/Model/Checkout/Surcharge.cs diff --git a/Adyen/Model/Checkout/TaxTotal.cs b/Adyen/src/Model/Checkout/TaxTotal.cs similarity index 100% rename from Adyen/Model/Checkout/TaxTotal.cs rename to Adyen/src/Model/Checkout/TaxTotal.cs diff --git a/Adyen/Model/Checkout/ThreeDS2RequestData.cs b/Adyen/src/Model/Checkout/ThreeDS2RequestData.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDS2RequestData.cs rename to Adyen/src/Model/Checkout/ThreeDS2RequestData.cs diff --git a/Adyen/Model/Checkout/ThreeDS2RequestFields.cs b/Adyen/src/Model/Checkout/ThreeDS2RequestFields.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDS2RequestFields.cs rename to Adyen/src/Model/Checkout/ThreeDS2RequestFields.cs diff --git a/Adyen/Model/Checkout/ThreeDS2ResponseData.cs b/Adyen/src/Model/Checkout/ThreeDS2ResponseData.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDS2ResponseData.cs rename to Adyen/src/Model/Checkout/ThreeDS2ResponseData.cs diff --git a/Adyen/Model/Checkout/ThreeDS2Result.cs b/Adyen/src/Model/Checkout/ThreeDS2Result.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDS2Result.cs rename to Adyen/src/Model/Checkout/ThreeDS2Result.cs diff --git a/Adyen/Model/Checkout/ThreeDSRequestData.cs b/Adyen/src/Model/Checkout/ThreeDSRequestData.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDSRequestData.cs rename to Adyen/src/Model/Checkout/ThreeDSRequestData.cs diff --git a/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs b/Adyen/src/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs rename to Adyen/src/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs diff --git a/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs b/Adyen/src/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs rename to Adyen/src/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs diff --git a/Adyen/Model/Checkout/ThreeDSecureData.cs b/Adyen/src/Model/Checkout/ThreeDSecureData.cs similarity index 100% rename from Adyen/Model/Checkout/ThreeDSecureData.cs rename to Adyen/src/Model/Checkout/ThreeDSecureData.cs diff --git a/Adyen/Model/Checkout/Ticket.cs b/Adyen/src/Model/Checkout/Ticket.cs similarity index 100% rename from Adyen/Model/Checkout/Ticket.cs rename to Adyen/src/Model/Checkout/Ticket.cs diff --git a/Adyen/Model/Checkout/TravelAgency.cs b/Adyen/src/Model/Checkout/TravelAgency.cs similarity index 100% rename from Adyen/Model/Checkout/TravelAgency.cs rename to Adyen/src/Model/Checkout/TravelAgency.cs diff --git a/Adyen/Model/Checkout/TwintDetails.cs b/Adyen/src/Model/Checkout/TwintDetails.cs similarity index 100% rename from Adyen/Model/Checkout/TwintDetails.cs rename to Adyen/src/Model/Checkout/TwintDetails.cs diff --git a/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs b/Adyen/src/Model/Checkout/UpdatePaymentLinkRequest.cs similarity index 100% rename from Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs rename to Adyen/src/Model/Checkout/UpdatePaymentLinkRequest.cs diff --git a/Adyen/Model/Checkout/UpiCollectDetails.cs b/Adyen/src/Model/Checkout/UpiCollectDetails.cs similarity index 100% rename from Adyen/Model/Checkout/UpiCollectDetails.cs rename to Adyen/src/Model/Checkout/UpiCollectDetails.cs diff --git a/Adyen/Model/Checkout/UpiIntentDetails.cs b/Adyen/src/Model/Checkout/UpiIntentDetails.cs similarity index 100% rename from Adyen/Model/Checkout/UpiIntentDetails.cs rename to Adyen/src/Model/Checkout/UpiIntentDetails.cs diff --git a/Adyen/Model/Checkout/UtilityRequest.cs b/Adyen/src/Model/Checkout/UtilityRequest.cs similarity index 100% rename from Adyen/Model/Checkout/UtilityRequest.cs rename to Adyen/src/Model/Checkout/UtilityRequest.cs diff --git a/Adyen/Model/Checkout/UtilityResponse.cs b/Adyen/src/Model/Checkout/UtilityResponse.cs similarity index 100% rename from Adyen/Model/Checkout/UtilityResponse.cs rename to Adyen/src/Model/Checkout/UtilityResponse.cs diff --git a/Adyen/Model/Checkout/VippsDetails.cs b/Adyen/src/Model/Checkout/VippsDetails.cs similarity index 100% rename from Adyen/Model/Checkout/VippsDetails.cs rename to Adyen/src/Model/Checkout/VippsDetails.cs diff --git a/Adyen/Model/Checkout/VisaCheckoutDetails.cs b/Adyen/src/Model/Checkout/VisaCheckoutDetails.cs similarity index 100% rename from Adyen/Model/Checkout/VisaCheckoutDetails.cs rename to Adyen/src/Model/Checkout/VisaCheckoutDetails.cs diff --git a/Adyen/Model/Checkout/WeChatPayDetails.cs b/Adyen/src/Model/Checkout/WeChatPayDetails.cs similarity index 100% rename from Adyen/Model/Checkout/WeChatPayDetails.cs rename to Adyen/src/Model/Checkout/WeChatPayDetails.cs diff --git a/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs b/Adyen/src/Model/Checkout/WeChatPayMiniProgramDetails.cs similarity index 100% rename from Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs rename to Adyen/src/Model/Checkout/WeChatPayMiniProgramDetails.cs diff --git a/Adyen/Model/Checkout/ZipDetails.cs b/Adyen/src/Model/Checkout/ZipDetails.cs similarity index 100% rename from Adyen/Model/Checkout/ZipDetails.cs rename to Adyen/src/Model/Checkout/ZipDetails.cs diff --git a/Adyen/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/ConfigurationWebhooks/AccountHolder.cs b/Adyen/src/Model/ConfigurationWebhooks/AccountHolder.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/AccountHolder.cs rename to Adyen/src/Model/ConfigurationWebhooks/AccountHolder.cs diff --git a/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.cs b/Adyen/src/Model/ConfigurationWebhooks/AccountHolderCapability.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.cs rename to Adyen/src/Model/ConfigurationWebhooks/AccountHolderCapability.cs diff --git a/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs b/Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs rename to Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs diff --git a/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs b/Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs rename to Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs diff --git a/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs b/Adyen/src/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs rename to Adyen/src/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Address.cs b/Adyen/src/Model/ConfigurationWebhooks/Address.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Address.cs rename to Adyen/src/Model/ConfigurationWebhooks/Address.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Amount.cs b/Adyen/src/Model/ConfigurationWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Amount.cs rename to Adyen/src/Model/ConfigurationWebhooks/Amount.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Authentication.cs b/Adyen/src/Model/ConfigurationWebhooks/Authentication.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Authentication.cs rename to Adyen/src/Model/ConfigurationWebhooks/Authentication.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Balance.cs b/Adyen/src/Model/ConfigurationWebhooks/Balance.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Balance.cs rename to Adyen/src/Model/ConfigurationWebhooks/Balance.cs diff --git a/Adyen/Model/ConfigurationWebhooks/BalanceAccount.cs b/Adyen/src/Model/ConfigurationWebhooks/BalanceAccount.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/BalanceAccount.cs rename to Adyen/src/Model/ConfigurationWebhooks/BalanceAccount.cs diff --git a/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs b/Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs rename to Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs diff --git a/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs b/Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs rename to Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs diff --git a/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/src/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/src/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.cs b/Adyen/src/Model/ConfigurationWebhooks/BankAccountDetails.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/BankAccountDetails.cs rename to Adyen/src/Model/ConfigurationWebhooks/BankAccountDetails.cs diff --git a/Adyen/Model/ConfigurationWebhooks/BulkAddress.cs b/Adyen/src/Model/ConfigurationWebhooks/BulkAddress.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/BulkAddress.cs rename to Adyen/src/Model/ConfigurationWebhooks/BulkAddress.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CapabilityProblem.cs b/Adyen/src/Model/ConfigurationWebhooks/CapabilityProblem.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CapabilityProblem.cs rename to Adyen/src/Model/ConfigurationWebhooks/CapabilityProblem.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs b/Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs rename to Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs b/Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs rename to Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.cs b/Adyen/src/Model/ConfigurationWebhooks/CapabilitySettings.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CapabilitySettings.cs rename to Adyen/src/Model/ConfigurationWebhooks/CapabilitySettings.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Card.cs b/Adyen/src/Model/ConfigurationWebhooks/Card.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Card.cs rename to Adyen/src/Model/ConfigurationWebhooks/Card.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CardConfiguration.cs b/Adyen/src/Model/ConfigurationWebhooks/CardConfiguration.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CardConfiguration.cs rename to Adyen/src/Model/ConfigurationWebhooks/CardConfiguration.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CardOrderItem.cs b/Adyen/src/Model/ConfigurationWebhooks/CardOrderItem.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CardOrderItem.cs rename to Adyen/src/Model/ConfigurationWebhooks/CardOrderItem.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs b/Adyen/src/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs rename to Adyen/src/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs diff --git a/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs b/Adyen/src/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs rename to Adyen/src/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs diff --git a/Adyen/Model/ConfigurationWebhooks/ContactDetails.cs b/Adyen/src/Model/ConfigurationWebhooks/ContactDetails.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/ContactDetails.cs rename to Adyen/src/Model/ConfigurationWebhooks/ContactDetails.cs diff --git a/Adyen/Model/ConfigurationWebhooks/DeliveryAddress.cs b/Adyen/src/Model/ConfigurationWebhooks/DeliveryAddress.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/DeliveryAddress.cs rename to Adyen/src/Model/ConfigurationWebhooks/DeliveryAddress.cs diff --git a/Adyen/Model/ConfigurationWebhooks/DeliveryContact.cs b/Adyen/src/Model/ConfigurationWebhooks/DeliveryContact.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/DeliveryContact.cs rename to Adyen/src/Model/ConfigurationWebhooks/DeliveryContact.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Device.cs b/Adyen/src/Model/ConfigurationWebhooks/Device.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Device.cs rename to Adyen/src/Model/ConfigurationWebhooks/Device.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Expiry.cs b/Adyen/src/Model/ConfigurationWebhooks/Expiry.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Expiry.cs rename to Adyen/src/Model/ConfigurationWebhooks/Expiry.cs diff --git a/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.cs b/Adyen/src/Model/ConfigurationWebhooks/IbanAccountIdentification.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.cs rename to Adyen/src/Model/ConfigurationWebhooks/IbanAccountIdentification.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Name.cs b/Adyen/src/Model/ConfigurationWebhooks/Name.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Name.cs rename to Adyen/src/Model/ConfigurationWebhooks/Name.cs diff --git a/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs b/Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs rename to Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs diff --git a/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs b/Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs rename to Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs diff --git a/Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs b/Adyen/src/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs rename to Adyen/src/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs diff --git a/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.cs b/Adyen/src/Model/ConfigurationWebhooks/PaymentInstrument.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/PaymentInstrument.cs rename to Adyen/src/Model/ConfigurationWebhooks/PaymentInstrument.cs diff --git a/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs b/Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs rename to Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs diff --git a/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs b/Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs rename to Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs diff --git a/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs b/Adyen/src/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs rename to Adyen/src/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Phone.cs b/Adyen/src/Model/ConfigurationWebhooks/Phone.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Phone.cs rename to Adyen/src/Model/ConfigurationWebhooks/Phone.cs diff --git a/Adyen/Model/ConfigurationWebhooks/PhoneNumber.cs b/Adyen/src/Model/ConfigurationWebhooks/PhoneNumber.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/PhoneNumber.cs rename to Adyen/src/Model/ConfigurationWebhooks/PhoneNumber.cs diff --git a/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs b/Adyen/src/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs rename to Adyen/src/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs diff --git a/Adyen/Model/ConfigurationWebhooks/RemediatingAction.cs b/Adyen/src/Model/ConfigurationWebhooks/RemediatingAction.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/RemediatingAction.cs rename to Adyen/src/Model/ConfigurationWebhooks/RemediatingAction.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Resource.cs b/Adyen/src/Model/ConfigurationWebhooks/Resource.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Resource.cs rename to Adyen/src/Model/ConfigurationWebhooks/Resource.cs diff --git a/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs b/Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs rename to Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs diff --git a/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs b/Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs rename to Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs diff --git a/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.cs b/Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationV2.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.cs rename to Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationV2.cs diff --git a/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.cs b/Adyen/src/Model/ConfigurationWebhooks/SweepCounterparty.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/SweepCounterparty.cs rename to Adyen/src/Model/ConfigurationWebhooks/SweepCounterparty.cs diff --git a/Adyen/Model/ConfigurationWebhooks/SweepSchedule.cs b/Adyen/src/Model/ConfigurationWebhooks/SweepSchedule.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/SweepSchedule.cs rename to Adyen/src/Model/ConfigurationWebhooks/SweepSchedule.cs diff --git a/Adyen/Model/ConfigurationWebhooks/TokenAuthentication.cs b/Adyen/src/Model/ConfigurationWebhooks/TokenAuthentication.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/TokenAuthentication.cs rename to Adyen/src/Model/ConfigurationWebhooks/TokenAuthentication.cs diff --git a/Adyen/Model/ConfigurationWebhooks/ValidationFacts.cs b/Adyen/src/Model/ConfigurationWebhooks/ValidationFacts.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/ValidationFacts.cs rename to Adyen/src/Model/ConfigurationWebhooks/ValidationFacts.cs diff --git a/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.cs b/Adyen/src/Model/ConfigurationWebhooks/VerificationDeadline.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/VerificationDeadline.cs rename to Adyen/src/Model/ConfigurationWebhooks/VerificationDeadline.cs diff --git a/Adyen/Model/ConfigurationWebhooks/VerificationError.cs b/Adyen/src/Model/ConfigurationWebhooks/VerificationError.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/VerificationError.cs rename to Adyen/src/Model/ConfigurationWebhooks/VerificationError.cs diff --git a/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs b/Adyen/src/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs rename to Adyen/src/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs diff --git a/Adyen/Model/ConfigurationWebhooks/Wallet.cs b/Adyen/src/Model/ConfigurationWebhooks/Wallet.cs similarity index 100% rename from Adyen/Model/ConfigurationWebhooks/Wallet.cs rename to Adyen/src/Model/ConfigurationWebhooks/Wallet.cs diff --git a/Adyen/Model/DataProtection/AbstractOpenAPISchema.cs b/Adyen/src/Model/DataProtection/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/DataProtection/AbstractOpenAPISchema.cs rename to Adyen/src/Model/DataProtection/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/DataProtection/ServiceError.cs b/Adyen/src/Model/DataProtection/ServiceError.cs similarity index 100% rename from Adyen/Model/DataProtection/ServiceError.cs rename to Adyen/src/Model/DataProtection/ServiceError.cs diff --git a/Adyen/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs b/Adyen/src/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs similarity index 100% rename from Adyen/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs rename to Adyen/src/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs diff --git a/Adyen/Model/DataProtection/SubjectErasureResponse.cs b/Adyen/src/Model/DataProtection/SubjectErasureResponse.cs similarity index 100% rename from Adyen/Model/DataProtection/SubjectErasureResponse.cs rename to Adyen/src/Model/DataProtection/SubjectErasureResponse.cs diff --git a/Adyen/Model/DisputeWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/DisputeWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/DisputeWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/DisputeWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/DisputeWebhooks/Amount.cs b/Adyen/src/Model/DisputeWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/DisputeWebhooks/Amount.cs rename to Adyen/src/Model/DisputeWebhooks/Amount.cs diff --git a/Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/src/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/src/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/Model/DisputeWebhooks/DisputeEventNotification.cs b/Adyen/src/Model/DisputeWebhooks/DisputeEventNotification.cs similarity index 100% rename from Adyen/Model/DisputeWebhooks/DisputeEventNotification.cs rename to Adyen/src/Model/DisputeWebhooks/DisputeEventNotification.cs diff --git a/Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.cs b/Adyen/src/Model/DisputeWebhooks/DisputeNotificationRequest.cs similarity index 100% rename from Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.cs rename to Adyen/src/Model/DisputeWebhooks/DisputeNotificationRequest.cs diff --git a/Adyen/Model/Disputes/AbstractOpenAPISchema.cs b/Adyen/src/Model/Disputes/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Disputes/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Disputes/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Disputes/AcceptDisputeRequest.cs b/Adyen/src/Model/Disputes/AcceptDisputeRequest.cs similarity index 100% rename from Adyen/Model/Disputes/AcceptDisputeRequest.cs rename to Adyen/src/Model/Disputes/AcceptDisputeRequest.cs diff --git a/Adyen/Model/Disputes/AcceptDisputeResponse.cs b/Adyen/src/Model/Disputes/AcceptDisputeResponse.cs similarity index 100% rename from Adyen/Model/Disputes/AcceptDisputeResponse.cs rename to Adyen/src/Model/Disputes/AcceptDisputeResponse.cs diff --git a/Adyen/Model/Disputes/DefendDisputeRequest.cs b/Adyen/src/Model/Disputes/DefendDisputeRequest.cs similarity index 100% rename from Adyen/Model/Disputes/DefendDisputeRequest.cs rename to Adyen/src/Model/Disputes/DefendDisputeRequest.cs diff --git a/Adyen/Model/Disputes/DefendDisputeResponse.cs b/Adyen/src/Model/Disputes/DefendDisputeResponse.cs similarity index 100% rename from Adyen/Model/Disputes/DefendDisputeResponse.cs rename to Adyen/src/Model/Disputes/DefendDisputeResponse.cs diff --git a/Adyen/Model/Disputes/DefenseDocument.cs b/Adyen/src/Model/Disputes/DefenseDocument.cs similarity index 100% rename from Adyen/Model/Disputes/DefenseDocument.cs rename to Adyen/src/Model/Disputes/DefenseDocument.cs diff --git a/Adyen/Model/Disputes/DefenseDocumentType.cs b/Adyen/src/Model/Disputes/DefenseDocumentType.cs similarity index 100% rename from Adyen/Model/Disputes/DefenseDocumentType.cs rename to Adyen/src/Model/Disputes/DefenseDocumentType.cs diff --git a/Adyen/Model/Disputes/DefenseReason.cs b/Adyen/src/Model/Disputes/DefenseReason.cs similarity index 100% rename from Adyen/Model/Disputes/DefenseReason.cs rename to Adyen/src/Model/Disputes/DefenseReason.cs diff --git a/Adyen/Model/Disputes/DefenseReasonsRequest.cs b/Adyen/src/Model/Disputes/DefenseReasonsRequest.cs similarity index 100% rename from Adyen/Model/Disputes/DefenseReasonsRequest.cs rename to Adyen/src/Model/Disputes/DefenseReasonsRequest.cs diff --git a/Adyen/Model/Disputes/DefenseReasonsResponse.cs b/Adyen/src/Model/Disputes/DefenseReasonsResponse.cs similarity index 100% rename from Adyen/Model/Disputes/DefenseReasonsResponse.cs rename to Adyen/src/Model/Disputes/DefenseReasonsResponse.cs diff --git a/Adyen/Model/Disputes/DeleteDefenseDocumentRequest.cs b/Adyen/src/Model/Disputes/DeleteDefenseDocumentRequest.cs similarity index 100% rename from Adyen/Model/Disputes/DeleteDefenseDocumentRequest.cs rename to Adyen/src/Model/Disputes/DeleteDefenseDocumentRequest.cs diff --git a/Adyen/Model/Disputes/DeleteDefenseDocumentResponse.cs b/Adyen/src/Model/Disputes/DeleteDefenseDocumentResponse.cs similarity index 100% rename from Adyen/Model/Disputes/DeleteDefenseDocumentResponse.cs rename to Adyen/src/Model/Disputes/DeleteDefenseDocumentResponse.cs diff --git a/Adyen/Model/Disputes/DisputeServiceResult.cs b/Adyen/src/Model/Disputes/DisputeServiceResult.cs similarity index 100% rename from Adyen/Model/Disputes/DisputeServiceResult.cs rename to Adyen/src/Model/Disputes/DisputeServiceResult.cs diff --git a/Adyen/Model/Disputes/ServiceError.cs b/Adyen/src/Model/Disputes/ServiceError.cs similarity index 100% rename from Adyen/Model/Disputes/ServiceError.cs rename to Adyen/src/Model/Disputes/ServiceError.cs diff --git a/Adyen/Model/Disputes/SupplyDefenseDocumentRequest.cs b/Adyen/src/Model/Disputes/SupplyDefenseDocumentRequest.cs similarity index 100% rename from Adyen/Model/Disputes/SupplyDefenseDocumentRequest.cs rename to Adyen/src/Model/Disputes/SupplyDefenseDocumentRequest.cs diff --git a/Adyen/Model/Disputes/SupplyDefenseDocumentResponse.cs b/Adyen/src/Model/Disputes/SupplyDefenseDocumentResponse.cs similarity index 100% rename from Adyen/Model/Disputes/SupplyDefenseDocumentResponse.cs rename to Adyen/src/Model/Disputes/SupplyDefenseDocumentResponse.cs diff --git a/Adyen/Model/Environment.cs b/Adyen/src/Model/Environment.cs similarity index 100% rename from Adyen/Model/Environment.cs rename to Adyen/src/Model/Environment.cs diff --git a/Adyen/Model/LegalEntityManagement/AULocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/AULocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/AULocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/AbstractOpenAPISchema.cs b/Adyen/src/Model/LegalEntityManagement/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/AbstractOpenAPISchema.cs rename to Adyen/src/Model/LegalEntityManagement/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs b/Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs rename to Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs diff --git a/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs b/Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs rename to Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/AdditionalBankIdentification.cs b/Adyen/src/Model/LegalEntityManagement/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/AdditionalBankIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/AdditionalBankIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/Address.cs b/Adyen/src/Model/LegalEntityManagement/Address.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Address.cs rename to Adyen/src/Model/LegalEntityManagement/Address.cs diff --git a/Adyen/Model/LegalEntityManagement/Amount.cs b/Adyen/src/Model/LegalEntityManagement/Amount.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Amount.cs rename to Adyen/src/Model/LegalEntityManagement/Amount.cs diff --git a/Adyen/Model/LegalEntityManagement/Attachment.cs b/Adyen/src/Model/LegalEntityManagement/Attachment.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Attachment.cs rename to Adyen/src/Model/LegalEntityManagement/Attachment.cs diff --git a/Adyen/Model/LegalEntityManagement/BankAccountInfo.cs b/Adyen/src/Model/LegalEntityManagement/BankAccountInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BankAccountInfo.cs rename to Adyen/src/Model/LegalEntityManagement/BankAccountInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/BirthData.cs b/Adyen/src/Model/LegalEntityManagement/BirthData.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BirthData.cs rename to Adyen/src/Model/LegalEntityManagement/BirthData.cs diff --git a/Adyen/Model/LegalEntityManagement/BusinessLine.cs b/Adyen/src/Model/LegalEntityManagement/BusinessLine.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BusinessLine.cs rename to Adyen/src/Model/LegalEntityManagement/BusinessLine.cs diff --git a/Adyen/Model/LegalEntityManagement/BusinessLineInfo.cs b/Adyen/src/Model/LegalEntityManagement/BusinessLineInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BusinessLineInfo.cs rename to Adyen/src/Model/LegalEntityManagement/BusinessLineInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs b/Adyen/src/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs rename to Adyen/src/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs diff --git a/Adyen/Model/LegalEntityManagement/BusinessLines.cs b/Adyen/src/Model/LegalEntityManagement/BusinessLines.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/BusinessLines.cs rename to Adyen/src/Model/LegalEntityManagement/BusinessLines.cs diff --git a/Adyen/Model/LegalEntityManagement/CALocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CALocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/CALocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/CZLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CZLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/CZLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/CalculatePciStatusRequest.cs b/Adyen/src/Model/LegalEntityManagement/CalculatePciStatusRequest.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CalculatePciStatusRequest.cs rename to Adyen/src/Model/LegalEntityManagement/CalculatePciStatusRequest.cs diff --git a/Adyen/Model/LegalEntityManagement/CalculatePciStatusResponse.cs b/Adyen/src/Model/LegalEntityManagement/CalculatePciStatusResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CalculatePciStatusResponse.cs rename to Adyen/src/Model/LegalEntityManagement/CalculatePciStatusResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs b/Adyen/src/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs rename to Adyen/src/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/CapabilityProblem.cs b/Adyen/src/Model/LegalEntityManagement/CapabilityProblem.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CapabilityProblem.cs rename to Adyen/src/Model/LegalEntityManagement/CapabilityProblem.cs diff --git a/Adyen/Model/LegalEntityManagement/CapabilityProblemEntity.cs b/Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CapabilityProblemEntity.cs rename to Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntity.cs diff --git a/Adyen/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs b/Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs rename to Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/Model/LegalEntityManagement/CapabilitySettings.cs b/Adyen/src/Model/LegalEntityManagement/CapabilitySettings.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CapabilitySettings.cs rename to Adyen/src/Model/LegalEntityManagement/CapabilitySettings.cs diff --git a/Adyen/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs b/Adyen/src/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs rename to Adyen/src/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/DKLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/DKLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/DKLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs b/Adyen/src/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs rename to Adyen/src/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/Document.cs b/Adyen/src/Model/LegalEntityManagement/Document.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Document.cs rename to Adyen/src/Model/LegalEntityManagement/Document.cs diff --git a/Adyen/Model/LegalEntityManagement/DocumentPage.cs b/Adyen/src/Model/LegalEntityManagement/DocumentPage.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/DocumentPage.cs rename to Adyen/src/Model/LegalEntityManagement/DocumentPage.cs diff --git a/Adyen/Model/LegalEntityManagement/DocumentReference.cs b/Adyen/src/Model/LegalEntityManagement/DocumentReference.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/DocumentReference.cs rename to Adyen/src/Model/LegalEntityManagement/DocumentReference.cs diff --git a/Adyen/Model/LegalEntityManagement/EntityReference.cs b/Adyen/src/Model/LegalEntityManagement/EntityReference.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/EntityReference.cs rename to Adyen/src/Model/LegalEntityManagement/EntityReference.cs diff --git a/Adyen/Model/LegalEntityManagement/FinancialReport.cs b/Adyen/src/Model/LegalEntityManagement/FinancialReport.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/FinancialReport.cs rename to Adyen/src/Model/LegalEntityManagement/FinancialReport.cs diff --git a/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs b/Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs rename to Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs diff --git a/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs b/Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs rename to Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs b/Adyen/src/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs rename to Adyen/src/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs b/Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs rename to Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs b/Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs rename to Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs b/Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs rename to Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs b/Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs rename to Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs diff --git a/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs b/Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs rename to Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/HKLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/HKLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/HKLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/HULocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/HULocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/HULocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/IbanAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/IbanAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/IbanAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/IbanAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/IdentificationData.cs b/Adyen/src/Model/LegalEntityManagement/IdentificationData.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/IdentificationData.cs rename to Adyen/src/Model/LegalEntityManagement/IdentificationData.cs diff --git a/Adyen/Model/LegalEntityManagement/Individual.cs b/Adyen/src/Model/LegalEntityManagement/Individual.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Individual.cs rename to Adyen/src/Model/LegalEntityManagement/Individual.cs diff --git a/Adyen/Model/LegalEntityManagement/LegalEntity.cs b/Adyen/src/Model/LegalEntityManagement/LegalEntity.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/LegalEntity.cs rename to Adyen/src/Model/LegalEntityManagement/LegalEntity.cs diff --git a/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.cs b/Adyen/src/Model/LegalEntityManagement/LegalEntityAssociation.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/LegalEntityAssociation.cs rename to Adyen/src/Model/LegalEntityManagement/LegalEntityAssociation.cs diff --git a/Adyen/Model/LegalEntityManagement/LegalEntityCapability.cs b/Adyen/src/Model/LegalEntityManagement/LegalEntityCapability.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/LegalEntityCapability.cs rename to Adyen/src/Model/LegalEntityManagement/LegalEntityCapability.cs diff --git a/Adyen/Model/LegalEntityManagement/LegalEntityInfo.cs b/Adyen/src/Model/LegalEntityManagement/LegalEntityInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/LegalEntityInfo.cs rename to Adyen/src/Model/LegalEntityManagement/LegalEntityInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs b/Adyen/src/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs rename to Adyen/src/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs diff --git a/Adyen/Model/LegalEntityManagement/NOLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/NOLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/NOLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/NZLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/NZLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/NZLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/Name.cs b/Adyen/src/Model/LegalEntityManagement/Name.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Name.cs rename to Adyen/src/Model/LegalEntityManagement/Name.cs diff --git a/Adyen/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/OnboardingLink.cs b/Adyen/src/Model/LegalEntityManagement/OnboardingLink.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/OnboardingLink.cs rename to Adyen/src/Model/LegalEntityManagement/OnboardingLink.cs diff --git a/Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.cs b/Adyen/src/Model/LegalEntityManagement/OnboardingLinkInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.cs rename to Adyen/src/Model/LegalEntityManagement/OnboardingLinkInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.cs b/Adyen/src/Model/LegalEntityManagement/OnboardingLinkSettings.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.cs rename to Adyen/src/Model/LegalEntityManagement/OnboardingLinkSettings.cs diff --git a/Adyen/Model/LegalEntityManagement/OnboardingTheme.cs b/Adyen/src/Model/LegalEntityManagement/OnboardingTheme.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/OnboardingTheme.cs rename to Adyen/src/Model/LegalEntityManagement/OnboardingTheme.cs diff --git a/Adyen/Model/LegalEntityManagement/OnboardingThemes.cs b/Adyen/src/Model/LegalEntityManagement/OnboardingThemes.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/OnboardingThemes.cs rename to Adyen/src/Model/LegalEntityManagement/OnboardingThemes.cs diff --git a/Adyen/Model/LegalEntityManagement/Organization.cs b/Adyen/src/Model/LegalEntityManagement/Organization.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Organization.cs rename to Adyen/src/Model/LegalEntityManagement/Organization.cs diff --git a/Adyen/Model/LegalEntityManagement/OwnerEntity.cs b/Adyen/src/Model/LegalEntityManagement/OwnerEntity.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/OwnerEntity.cs rename to Adyen/src/Model/LegalEntityManagement/OwnerEntity.cs diff --git a/Adyen/Model/LegalEntityManagement/PLLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/PLLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/PLLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/PciDocumentInfo.cs b/Adyen/src/Model/LegalEntityManagement/PciDocumentInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/PciDocumentInfo.cs rename to Adyen/src/Model/LegalEntityManagement/PciDocumentInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/PciSigningRequest.cs b/Adyen/src/Model/LegalEntityManagement/PciSigningRequest.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/PciSigningRequest.cs rename to Adyen/src/Model/LegalEntityManagement/PciSigningRequest.cs diff --git a/Adyen/Model/LegalEntityManagement/PciSigningResponse.cs b/Adyen/src/Model/LegalEntityManagement/PciSigningResponse.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/PciSigningResponse.cs rename to Adyen/src/Model/LegalEntityManagement/PciSigningResponse.cs diff --git a/Adyen/Model/LegalEntityManagement/PhoneNumber.cs b/Adyen/src/Model/LegalEntityManagement/PhoneNumber.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/PhoneNumber.cs rename to Adyen/src/Model/LegalEntityManagement/PhoneNumber.cs diff --git a/Adyen/Model/LegalEntityManagement/RemediatingAction.cs b/Adyen/src/Model/LegalEntityManagement/RemediatingAction.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/RemediatingAction.cs rename to Adyen/src/Model/LegalEntityManagement/RemediatingAction.cs diff --git a/Adyen/Model/LegalEntityManagement/SELocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/SELocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/SELocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/SGLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/SGLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/SGLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/ServiceError.cs b/Adyen/src/Model/LegalEntityManagement/ServiceError.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/ServiceError.cs rename to Adyen/src/Model/LegalEntityManagement/ServiceError.cs diff --git a/Adyen/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs b/Adyen/src/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs rename to Adyen/src/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs diff --git a/Adyen/Model/LegalEntityManagement/SoleProprietorship.cs b/Adyen/src/Model/LegalEntityManagement/SoleProprietorship.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/SoleProprietorship.cs rename to Adyen/src/Model/LegalEntityManagement/SoleProprietorship.cs diff --git a/Adyen/Model/LegalEntityManagement/SourceOfFunds.cs b/Adyen/src/Model/LegalEntityManagement/SourceOfFunds.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/SourceOfFunds.cs rename to Adyen/src/Model/LegalEntityManagement/SourceOfFunds.cs diff --git a/Adyen/Model/LegalEntityManagement/StockData.cs b/Adyen/src/Model/LegalEntityManagement/StockData.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/StockData.cs rename to Adyen/src/Model/LegalEntityManagement/StockData.cs diff --git a/Adyen/Model/LegalEntityManagement/SupportingEntityCapability.cs b/Adyen/src/Model/LegalEntityManagement/SupportingEntityCapability.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/SupportingEntityCapability.cs rename to Adyen/src/Model/LegalEntityManagement/SupportingEntityCapability.cs diff --git a/Adyen/Model/LegalEntityManagement/TaxInformation.cs b/Adyen/src/Model/LegalEntityManagement/TaxInformation.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/TaxInformation.cs rename to Adyen/src/Model/LegalEntityManagement/TaxInformation.cs diff --git a/Adyen/Model/LegalEntityManagement/TaxReportingClassification.cs b/Adyen/src/Model/LegalEntityManagement/TaxReportingClassification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/TaxReportingClassification.cs rename to Adyen/src/Model/LegalEntityManagement/TaxReportingClassification.cs diff --git a/Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs b/Adyen/src/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs rename to Adyen/src/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/TransferInstrument.cs b/Adyen/src/Model/LegalEntityManagement/TransferInstrument.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/TransferInstrument.cs rename to Adyen/src/Model/LegalEntityManagement/TransferInstrument.cs diff --git a/Adyen/Model/LegalEntityManagement/TransferInstrumentInfo.cs b/Adyen/src/Model/LegalEntityManagement/TransferInstrumentInfo.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/TransferInstrumentInfo.cs rename to Adyen/src/Model/LegalEntityManagement/TransferInstrumentInfo.cs diff --git a/Adyen/Model/LegalEntityManagement/TransferInstrumentReference.cs b/Adyen/src/Model/LegalEntityManagement/TransferInstrumentReference.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/TransferInstrumentReference.cs rename to Adyen/src/Model/LegalEntityManagement/TransferInstrumentReference.cs diff --git a/Adyen/Model/LegalEntityManagement/Trust.cs b/Adyen/src/Model/LegalEntityManagement/Trust.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/Trust.cs rename to Adyen/src/Model/LegalEntityManagement/Trust.cs diff --git a/Adyen/Model/LegalEntityManagement/UKLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/UKLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/UKLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/USLocalAccountIdentification.cs b/Adyen/src/Model/LegalEntityManagement/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/USLocalAccountIdentification.cs rename to Adyen/src/Model/LegalEntityManagement/USLocalAccountIdentification.cs diff --git a/Adyen/Model/LegalEntityManagement/UndefinedBeneficiary.cs b/Adyen/src/Model/LegalEntityManagement/UndefinedBeneficiary.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/UndefinedBeneficiary.cs rename to Adyen/src/Model/LegalEntityManagement/UndefinedBeneficiary.cs diff --git a/Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.cs b/Adyen/src/Model/LegalEntityManagement/UnincorporatedPartnership.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.cs rename to Adyen/src/Model/LegalEntityManagement/UnincorporatedPartnership.cs diff --git a/Adyen/Model/LegalEntityManagement/VerificationDeadline.cs b/Adyen/src/Model/LegalEntityManagement/VerificationDeadline.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/VerificationDeadline.cs rename to Adyen/src/Model/LegalEntityManagement/VerificationDeadline.cs diff --git a/Adyen/Model/LegalEntityManagement/VerificationError.cs b/Adyen/src/Model/LegalEntityManagement/VerificationError.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/VerificationError.cs rename to Adyen/src/Model/LegalEntityManagement/VerificationError.cs diff --git a/Adyen/Model/LegalEntityManagement/VerificationErrorRecursive.cs b/Adyen/src/Model/LegalEntityManagement/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/VerificationErrorRecursive.cs rename to Adyen/src/Model/LegalEntityManagement/VerificationErrorRecursive.cs diff --git a/Adyen/Model/LegalEntityManagement/VerificationErrors.cs b/Adyen/src/Model/LegalEntityManagement/VerificationErrors.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/VerificationErrors.cs rename to Adyen/src/Model/LegalEntityManagement/VerificationErrors.cs diff --git a/Adyen/Model/LegalEntityManagement/WebData.cs b/Adyen/src/Model/LegalEntityManagement/WebData.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/WebData.cs rename to Adyen/src/Model/LegalEntityManagement/WebData.cs diff --git a/Adyen/Model/LegalEntityManagement/WebDataExemption.cs b/Adyen/src/Model/LegalEntityManagement/WebDataExemption.cs similarity index 100% rename from Adyen/Model/LegalEntityManagement/WebDataExemption.cs rename to Adyen/src/Model/LegalEntityManagement/WebDataExemption.cs diff --git a/Adyen/Model/Management/AbstractOpenAPISchema.cs b/Adyen/src/Model/Management/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Management/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Management/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Management/AccelInfo.cs b/Adyen/src/Model/Management/AccelInfo.cs similarity index 100% rename from Adyen/Model/Management/AccelInfo.cs rename to Adyen/src/Model/Management/AccelInfo.cs diff --git a/Adyen/Model/Management/AdditionalCommission.cs b/Adyen/src/Model/Management/AdditionalCommission.cs similarity index 100% rename from Adyen/Model/Management/AdditionalCommission.cs rename to Adyen/src/Model/Management/AdditionalCommission.cs diff --git a/Adyen/Model/Management/AdditionalSettings.cs b/Adyen/src/Model/Management/AdditionalSettings.cs similarity index 100% rename from Adyen/Model/Management/AdditionalSettings.cs rename to Adyen/src/Model/Management/AdditionalSettings.cs diff --git a/Adyen/Model/Management/AdditionalSettingsResponse.cs b/Adyen/src/Model/Management/AdditionalSettingsResponse.cs similarity index 100% rename from Adyen/Model/Management/AdditionalSettingsResponse.cs rename to Adyen/src/Model/Management/AdditionalSettingsResponse.cs diff --git a/Adyen/Model/Management/Address.cs b/Adyen/src/Model/Management/Address.cs similarity index 100% rename from Adyen/Model/Management/Address.cs rename to Adyen/src/Model/Management/Address.cs diff --git a/Adyen/Model/Management/AffirmInfo.cs b/Adyen/src/Model/Management/AffirmInfo.cs similarity index 100% rename from Adyen/Model/Management/AffirmInfo.cs rename to Adyen/src/Model/Management/AffirmInfo.cs diff --git a/Adyen/Model/Management/AfterpayTouchInfo.cs b/Adyen/src/Model/Management/AfterpayTouchInfo.cs similarity index 100% rename from Adyen/Model/Management/AfterpayTouchInfo.cs rename to Adyen/src/Model/Management/AfterpayTouchInfo.cs diff --git a/Adyen/Model/Management/AllowedOrigin.cs b/Adyen/src/Model/Management/AllowedOrigin.cs similarity index 100% rename from Adyen/Model/Management/AllowedOrigin.cs rename to Adyen/src/Model/Management/AllowedOrigin.cs diff --git a/Adyen/Model/Management/AllowedOriginsResponse.cs b/Adyen/src/Model/Management/AllowedOriginsResponse.cs similarity index 100% rename from Adyen/Model/Management/AllowedOriginsResponse.cs rename to Adyen/src/Model/Management/AllowedOriginsResponse.cs diff --git a/Adyen/Model/Management/AmexInfo.cs b/Adyen/src/Model/Management/AmexInfo.cs similarity index 100% rename from Adyen/Model/Management/AmexInfo.cs rename to Adyen/src/Model/Management/AmexInfo.cs diff --git a/Adyen/Model/Management/Amount.cs b/Adyen/src/Model/Management/Amount.cs similarity index 100% rename from Adyen/Model/Management/Amount.cs rename to Adyen/src/Model/Management/Amount.cs diff --git a/Adyen/Model/Management/AndroidApp.cs b/Adyen/src/Model/Management/AndroidApp.cs similarity index 100% rename from Adyen/Model/Management/AndroidApp.cs rename to Adyen/src/Model/Management/AndroidApp.cs diff --git a/Adyen/Model/Management/AndroidAppError.cs b/Adyen/src/Model/Management/AndroidAppError.cs similarity index 100% rename from Adyen/Model/Management/AndroidAppError.cs rename to Adyen/src/Model/Management/AndroidAppError.cs diff --git a/Adyen/Model/Management/AndroidAppsResponse.cs b/Adyen/src/Model/Management/AndroidAppsResponse.cs similarity index 100% rename from Adyen/Model/Management/AndroidAppsResponse.cs rename to Adyen/src/Model/Management/AndroidAppsResponse.cs diff --git a/Adyen/Model/Management/AndroidCertificate.cs b/Adyen/src/Model/Management/AndroidCertificate.cs similarity index 100% rename from Adyen/Model/Management/AndroidCertificate.cs rename to Adyen/src/Model/Management/AndroidCertificate.cs diff --git a/Adyen/Model/Management/AndroidCertificatesResponse.cs b/Adyen/src/Model/Management/AndroidCertificatesResponse.cs similarity index 100% rename from Adyen/Model/Management/AndroidCertificatesResponse.cs rename to Adyen/src/Model/Management/AndroidCertificatesResponse.cs diff --git a/Adyen/Model/Management/ApiCredential.cs b/Adyen/src/Model/Management/ApiCredential.cs similarity index 100% rename from Adyen/Model/Management/ApiCredential.cs rename to Adyen/src/Model/Management/ApiCredential.cs diff --git a/Adyen/Model/Management/ApiCredentialLinks.cs b/Adyen/src/Model/Management/ApiCredentialLinks.cs similarity index 100% rename from Adyen/Model/Management/ApiCredentialLinks.cs rename to Adyen/src/Model/Management/ApiCredentialLinks.cs diff --git a/Adyen/Model/Management/ApplePayInfo.cs b/Adyen/src/Model/Management/ApplePayInfo.cs similarity index 100% rename from Adyen/Model/Management/ApplePayInfo.cs rename to Adyen/src/Model/Management/ApplePayInfo.cs diff --git a/Adyen/Model/Management/BcmcInfo.cs b/Adyen/src/Model/Management/BcmcInfo.cs similarity index 100% rename from Adyen/Model/Management/BcmcInfo.cs rename to Adyen/src/Model/Management/BcmcInfo.cs diff --git a/Adyen/Model/Management/BillingEntitiesResponse.cs b/Adyen/src/Model/Management/BillingEntitiesResponse.cs similarity index 100% rename from Adyen/Model/Management/BillingEntitiesResponse.cs rename to Adyen/src/Model/Management/BillingEntitiesResponse.cs diff --git a/Adyen/Model/Management/BillingEntity.cs b/Adyen/src/Model/Management/BillingEntity.cs similarity index 100% rename from Adyen/Model/Management/BillingEntity.cs rename to Adyen/src/Model/Management/BillingEntity.cs diff --git a/Adyen/Model/Management/CardholderReceipt.cs b/Adyen/src/Model/Management/CardholderReceipt.cs similarity index 100% rename from Adyen/Model/Management/CardholderReceipt.cs rename to Adyen/src/Model/Management/CardholderReceipt.cs diff --git a/Adyen/Model/Management/CartesBancairesInfo.cs b/Adyen/src/Model/Management/CartesBancairesInfo.cs similarity index 100% rename from Adyen/Model/Management/CartesBancairesInfo.cs rename to Adyen/src/Model/Management/CartesBancairesInfo.cs diff --git a/Adyen/Model/Management/ClearpayInfo.cs b/Adyen/src/Model/Management/ClearpayInfo.cs similarity index 100% rename from Adyen/Model/Management/ClearpayInfo.cs rename to Adyen/src/Model/Management/ClearpayInfo.cs diff --git a/Adyen/Model/Management/Commission.cs b/Adyen/src/Model/Management/Commission.cs similarity index 100% rename from Adyen/Model/Management/Commission.cs rename to Adyen/src/Model/Management/Commission.cs diff --git a/Adyen/Model/Management/Company.cs b/Adyen/src/Model/Management/Company.cs similarity index 100% rename from Adyen/Model/Management/Company.cs rename to Adyen/src/Model/Management/Company.cs diff --git a/Adyen/Model/Management/CompanyApiCredential.cs b/Adyen/src/Model/Management/CompanyApiCredential.cs similarity index 100% rename from Adyen/Model/Management/CompanyApiCredential.cs rename to Adyen/src/Model/Management/CompanyApiCredential.cs diff --git a/Adyen/Model/Management/CompanyLinks.cs b/Adyen/src/Model/Management/CompanyLinks.cs similarity index 100% rename from Adyen/Model/Management/CompanyLinks.cs rename to Adyen/src/Model/Management/CompanyLinks.cs diff --git a/Adyen/Model/Management/CompanyUser.cs b/Adyen/src/Model/Management/CompanyUser.cs similarity index 100% rename from Adyen/Model/Management/CompanyUser.cs rename to Adyen/src/Model/Management/CompanyUser.cs diff --git a/Adyen/Model/Management/Connectivity.cs b/Adyen/src/Model/Management/Connectivity.cs similarity index 100% rename from Adyen/Model/Management/Connectivity.cs rename to Adyen/src/Model/Management/Connectivity.cs diff --git a/Adyen/Model/Management/Contact.cs b/Adyen/src/Model/Management/Contact.cs similarity index 100% rename from Adyen/Model/Management/Contact.cs rename to Adyen/src/Model/Management/Contact.cs diff --git a/Adyen/Model/Management/CreateAllowedOriginRequest.cs b/Adyen/src/Model/Management/CreateAllowedOriginRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateAllowedOriginRequest.cs rename to Adyen/src/Model/Management/CreateAllowedOriginRequest.cs diff --git a/Adyen/Model/Management/CreateApiCredentialResponse.cs b/Adyen/src/Model/Management/CreateApiCredentialResponse.cs similarity index 100% rename from Adyen/Model/Management/CreateApiCredentialResponse.cs rename to Adyen/src/Model/Management/CreateApiCredentialResponse.cs diff --git a/Adyen/Model/Management/CreateCompanyApiCredentialRequest.cs b/Adyen/src/Model/Management/CreateCompanyApiCredentialRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateCompanyApiCredentialRequest.cs rename to Adyen/src/Model/Management/CreateCompanyApiCredentialRequest.cs diff --git a/Adyen/Model/Management/CreateCompanyApiCredentialResponse.cs b/Adyen/src/Model/Management/CreateCompanyApiCredentialResponse.cs similarity index 100% rename from Adyen/Model/Management/CreateCompanyApiCredentialResponse.cs rename to Adyen/src/Model/Management/CreateCompanyApiCredentialResponse.cs diff --git a/Adyen/Model/Management/CreateCompanyUserRequest.cs b/Adyen/src/Model/Management/CreateCompanyUserRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateCompanyUserRequest.cs rename to Adyen/src/Model/Management/CreateCompanyUserRequest.cs diff --git a/Adyen/Model/Management/CreateCompanyUserResponse.cs b/Adyen/src/Model/Management/CreateCompanyUserResponse.cs similarity index 100% rename from Adyen/Model/Management/CreateCompanyUserResponse.cs rename to Adyen/src/Model/Management/CreateCompanyUserResponse.cs diff --git a/Adyen/Model/Management/CreateCompanyWebhookRequest.cs b/Adyen/src/Model/Management/CreateCompanyWebhookRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateCompanyWebhookRequest.cs rename to Adyen/src/Model/Management/CreateCompanyWebhookRequest.cs diff --git a/Adyen/Model/Management/CreateMerchantApiCredentialRequest.cs b/Adyen/src/Model/Management/CreateMerchantApiCredentialRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateMerchantApiCredentialRequest.cs rename to Adyen/src/Model/Management/CreateMerchantApiCredentialRequest.cs diff --git a/Adyen/Model/Management/CreateMerchantRequest.cs b/Adyen/src/Model/Management/CreateMerchantRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateMerchantRequest.cs rename to Adyen/src/Model/Management/CreateMerchantRequest.cs diff --git a/Adyen/Model/Management/CreateMerchantResponse.cs b/Adyen/src/Model/Management/CreateMerchantResponse.cs similarity index 100% rename from Adyen/Model/Management/CreateMerchantResponse.cs rename to Adyen/src/Model/Management/CreateMerchantResponse.cs diff --git a/Adyen/Model/Management/CreateMerchantUserRequest.cs b/Adyen/src/Model/Management/CreateMerchantUserRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateMerchantUserRequest.cs rename to Adyen/src/Model/Management/CreateMerchantUserRequest.cs diff --git a/Adyen/Model/Management/CreateMerchantWebhookRequest.cs b/Adyen/src/Model/Management/CreateMerchantWebhookRequest.cs similarity index 100% rename from Adyen/Model/Management/CreateMerchantWebhookRequest.cs rename to Adyen/src/Model/Management/CreateMerchantWebhookRequest.cs diff --git a/Adyen/Model/Management/CreateUserResponse.cs b/Adyen/src/Model/Management/CreateUserResponse.cs similarity index 100% rename from Adyen/Model/Management/CreateUserResponse.cs rename to Adyen/src/Model/Management/CreateUserResponse.cs diff --git a/Adyen/Model/Management/Currency.cs b/Adyen/src/Model/Management/Currency.cs similarity index 100% rename from Adyen/Model/Management/Currency.cs rename to Adyen/src/Model/Management/Currency.cs diff --git a/Adyen/Model/Management/CustomNotification.cs b/Adyen/src/Model/Management/CustomNotification.cs similarity index 100% rename from Adyen/Model/Management/CustomNotification.cs rename to Adyen/src/Model/Management/CustomNotification.cs diff --git a/Adyen/Model/Management/DataCenter.cs b/Adyen/src/Model/Management/DataCenter.cs similarity index 100% rename from Adyen/Model/Management/DataCenter.cs rename to Adyen/src/Model/Management/DataCenter.cs diff --git a/Adyen/Model/Management/DinersInfo.cs b/Adyen/src/Model/Management/DinersInfo.cs similarity index 100% rename from Adyen/Model/Management/DinersInfo.cs rename to Adyen/src/Model/Management/DinersInfo.cs diff --git a/Adyen/Model/Management/EventUrl.cs b/Adyen/src/Model/Management/EventUrl.cs similarity index 100% rename from Adyen/Model/Management/EventUrl.cs rename to Adyen/src/Model/Management/EventUrl.cs diff --git a/Adyen/Model/Management/ExternalTerminalAction.cs b/Adyen/src/Model/Management/ExternalTerminalAction.cs similarity index 100% rename from Adyen/Model/Management/ExternalTerminalAction.cs rename to Adyen/src/Model/Management/ExternalTerminalAction.cs diff --git a/Adyen/Model/Management/File.cs b/Adyen/src/Model/Management/File.cs similarity index 100% rename from Adyen/Model/Management/File.cs rename to Adyen/src/Model/Management/File.cs diff --git a/Adyen/Model/Management/GenerateApiKeyResponse.cs b/Adyen/src/Model/Management/GenerateApiKeyResponse.cs similarity index 100% rename from Adyen/Model/Management/GenerateApiKeyResponse.cs rename to Adyen/src/Model/Management/GenerateApiKeyResponse.cs diff --git a/Adyen/Model/Management/GenerateClientKeyResponse.cs b/Adyen/src/Model/Management/GenerateClientKeyResponse.cs similarity index 100% rename from Adyen/Model/Management/GenerateClientKeyResponse.cs rename to Adyen/src/Model/Management/GenerateClientKeyResponse.cs diff --git a/Adyen/Model/Management/GenerateHmacKeyResponse.cs b/Adyen/src/Model/Management/GenerateHmacKeyResponse.cs similarity index 100% rename from Adyen/Model/Management/GenerateHmacKeyResponse.cs rename to Adyen/src/Model/Management/GenerateHmacKeyResponse.cs diff --git a/Adyen/Model/Management/GenericPmWithTdiInfo.cs b/Adyen/src/Model/Management/GenericPmWithTdiInfo.cs similarity index 100% rename from Adyen/Model/Management/GenericPmWithTdiInfo.cs rename to Adyen/src/Model/Management/GenericPmWithTdiInfo.cs diff --git a/Adyen/Model/Management/GiroPayInfo.cs b/Adyen/src/Model/Management/GiroPayInfo.cs similarity index 100% rename from Adyen/Model/Management/GiroPayInfo.cs rename to Adyen/src/Model/Management/GiroPayInfo.cs diff --git a/Adyen/Model/Management/GooglePayInfo.cs b/Adyen/src/Model/Management/GooglePayInfo.cs similarity index 100% rename from Adyen/Model/Management/GooglePayInfo.cs rename to Adyen/src/Model/Management/GooglePayInfo.cs diff --git a/Adyen/Model/Management/Gratuity.cs b/Adyen/src/Model/Management/Gratuity.cs similarity index 100% rename from Adyen/Model/Management/Gratuity.cs rename to Adyen/src/Model/Management/Gratuity.cs diff --git a/Adyen/Model/Management/Hardware.cs b/Adyen/src/Model/Management/Hardware.cs similarity index 100% rename from Adyen/Model/Management/Hardware.cs rename to Adyen/src/Model/Management/Hardware.cs diff --git a/Adyen/Model/Management/IdName.cs b/Adyen/src/Model/Management/IdName.cs similarity index 100% rename from Adyen/Model/Management/IdName.cs rename to Adyen/src/Model/Management/IdName.cs diff --git a/Adyen/Model/Management/InstallAndroidAppDetails.cs b/Adyen/src/Model/Management/InstallAndroidAppDetails.cs similarity index 100% rename from Adyen/Model/Management/InstallAndroidAppDetails.cs rename to Adyen/src/Model/Management/InstallAndroidAppDetails.cs diff --git a/Adyen/Model/Management/InstallAndroidCertificateDetails.cs b/Adyen/src/Model/Management/InstallAndroidCertificateDetails.cs similarity index 100% rename from Adyen/Model/Management/InstallAndroidCertificateDetails.cs rename to Adyen/src/Model/Management/InstallAndroidCertificateDetails.cs diff --git a/Adyen/Model/Management/InvalidField.cs b/Adyen/src/Model/Management/InvalidField.cs similarity index 100% rename from Adyen/Model/Management/InvalidField.cs rename to Adyen/src/Model/Management/InvalidField.cs diff --git a/Adyen/Model/Management/JCBInfo.cs b/Adyen/src/Model/Management/JCBInfo.cs similarity index 100% rename from Adyen/Model/Management/JCBInfo.cs rename to Adyen/src/Model/Management/JCBInfo.cs diff --git a/Adyen/Model/Management/Key.cs b/Adyen/src/Model/Management/Key.cs similarity index 100% rename from Adyen/Model/Management/Key.cs rename to Adyen/src/Model/Management/Key.cs diff --git a/Adyen/Model/Management/KlarnaInfo.cs b/Adyen/src/Model/Management/KlarnaInfo.cs similarity index 100% rename from Adyen/Model/Management/KlarnaInfo.cs rename to Adyen/src/Model/Management/KlarnaInfo.cs diff --git a/Adyen/Model/Management/Links.cs b/Adyen/src/Model/Management/Links.cs similarity index 100% rename from Adyen/Model/Management/Links.cs rename to Adyen/src/Model/Management/Links.cs diff --git a/Adyen/Model/Management/LinksElement.cs b/Adyen/src/Model/Management/LinksElement.cs similarity index 100% rename from Adyen/Model/Management/LinksElement.cs rename to Adyen/src/Model/Management/LinksElement.cs diff --git a/Adyen/Model/Management/ListCompanyApiCredentialsResponse.cs b/Adyen/src/Model/Management/ListCompanyApiCredentialsResponse.cs similarity index 100% rename from Adyen/Model/Management/ListCompanyApiCredentialsResponse.cs rename to Adyen/src/Model/Management/ListCompanyApiCredentialsResponse.cs diff --git a/Adyen/Model/Management/ListCompanyResponse.cs b/Adyen/src/Model/Management/ListCompanyResponse.cs similarity index 100% rename from Adyen/Model/Management/ListCompanyResponse.cs rename to Adyen/src/Model/Management/ListCompanyResponse.cs diff --git a/Adyen/Model/Management/ListCompanyUsersResponse.cs b/Adyen/src/Model/Management/ListCompanyUsersResponse.cs similarity index 100% rename from Adyen/Model/Management/ListCompanyUsersResponse.cs rename to Adyen/src/Model/Management/ListCompanyUsersResponse.cs diff --git a/Adyen/Model/Management/ListExternalTerminalActionsResponse.cs b/Adyen/src/Model/Management/ListExternalTerminalActionsResponse.cs similarity index 100% rename from Adyen/Model/Management/ListExternalTerminalActionsResponse.cs rename to Adyen/src/Model/Management/ListExternalTerminalActionsResponse.cs diff --git a/Adyen/Model/Management/ListMerchantApiCredentialsResponse.cs b/Adyen/src/Model/Management/ListMerchantApiCredentialsResponse.cs similarity index 100% rename from Adyen/Model/Management/ListMerchantApiCredentialsResponse.cs rename to Adyen/src/Model/Management/ListMerchantApiCredentialsResponse.cs diff --git a/Adyen/Model/Management/ListMerchantResponse.cs b/Adyen/src/Model/Management/ListMerchantResponse.cs similarity index 100% rename from Adyen/Model/Management/ListMerchantResponse.cs rename to Adyen/src/Model/Management/ListMerchantResponse.cs diff --git a/Adyen/Model/Management/ListMerchantUsersResponse.cs b/Adyen/src/Model/Management/ListMerchantUsersResponse.cs similarity index 100% rename from Adyen/Model/Management/ListMerchantUsersResponse.cs rename to Adyen/src/Model/Management/ListMerchantUsersResponse.cs diff --git a/Adyen/Model/Management/ListStoresResponse.cs b/Adyen/src/Model/Management/ListStoresResponse.cs similarity index 100% rename from Adyen/Model/Management/ListStoresResponse.cs rename to Adyen/src/Model/Management/ListStoresResponse.cs diff --git a/Adyen/Model/Management/ListTerminalsResponse.cs b/Adyen/src/Model/Management/ListTerminalsResponse.cs similarity index 100% rename from Adyen/Model/Management/ListTerminalsResponse.cs rename to Adyen/src/Model/Management/ListTerminalsResponse.cs diff --git a/Adyen/Model/Management/ListWebhooksResponse.cs b/Adyen/src/Model/Management/ListWebhooksResponse.cs similarity index 100% rename from Adyen/Model/Management/ListWebhooksResponse.cs rename to Adyen/src/Model/Management/ListWebhooksResponse.cs diff --git a/Adyen/Model/Management/Localization.cs b/Adyen/src/Model/Management/Localization.cs similarity index 100% rename from Adyen/Model/Management/Localization.cs rename to Adyen/src/Model/Management/Localization.cs diff --git a/Adyen/Model/Management/Logo.cs b/Adyen/src/Model/Management/Logo.cs similarity index 100% rename from Adyen/Model/Management/Logo.cs rename to Adyen/src/Model/Management/Logo.cs diff --git a/Adyen/Model/Management/MeApiCredential.cs b/Adyen/src/Model/Management/MeApiCredential.cs similarity index 100% rename from Adyen/Model/Management/MeApiCredential.cs rename to Adyen/src/Model/Management/MeApiCredential.cs diff --git a/Adyen/Model/Management/MealVoucherFRInfo.cs b/Adyen/src/Model/Management/MealVoucherFRInfo.cs similarity index 100% rename from Adyen/Model/Management/MealVoucherFRInfo.cs rename to Adyen/src/Model/Management/MealVoucherFRInfo.cs diff --git a/Adyen/Model/Management/Merchant.cs b/Adyen/src/Model/Management/Merchant.cs similarity index 100% rename from Adyen/Model/Management/Merchant.cs rename to Adyen/src/Model/Management/Merchant.cs diff --git a/Adyen/Model/Management/MerchantLinks.cs b/Adyen/src/Model/Management/MerchantLinks.cs similarity index 100% rename from Adyen/Model/Management/MerchantLinks.cs rename to Adyen/src/Model/Management/MerchantLinks.cs diff --git a/Adyen/Model/Management/MinorUnitsMonetaryValue.cs b/Adyen/src/Model/Management/MinorUnitsMonetaryValue.cs similarity index 100% rename from Adyen/Model/Management/MinorUnitsMonetaryValue.cs rename to Adyen/src/Model/Management/MinorUnitsMonetaryValue.cs diff --git a/Adyen/Model/Management/ModelConfiguration.cs b/Adyen/src/Model/Management/ModelConfiguration.cs similarity index 100% rename from Adyen/Model/Management/ModelConfiguration.cs rename to Adyen/src/Model/Management/ModelConfiguration.cs diff --git a/Adyen/Model/Management/Name.cs b/Adyen/src/Model/Management/Name.cs similarity index 100% rename from Adyen/Model/Management/Name.cs rename to Adyen/src/Model/Management/Name.cs diff --git a/Adyen/Model/Management/Name2.cs b/Adyen/src/Model/Management/Name2.cs similarity index 100% rename from Adyen/Model/Management/Name2.cs rename to Adyen/src/Model/Management/Name2.cs diff --git a/Adyen/Model/Management/Nexo.cs b/Adyen/src/Model/Management/Nexo.cs similarity index 100% rename from Adyen/Model/Management/Nexo.cs rename to Adyen/src/Model/Management/Nexo.cs diff --git a/Adyen/Model/Management/Notification.cs b/Adyen/src/Model/Management/Notification.cs similarity index 100% rename from Adyen/Model/Management/Notification.cs rename to Adyen/src/Model/Management/Notification.cs diff --git a/Adyen/Model/Management/NotificationUrl.cs b/Adyen/src/Model/Management/NotificationUrl.cs similarity index 100% rename from Adyen/Model/Management/NotificationUrl.cs rename to Adyen/src/Model/Management/NotificationUrl.cs diff --git a/Adyen/Model/Management/NyceInfo.cs b/Adyen/src/Model/Management/NyceInfo.cs similarity index 100% rename from Adyen/Model/Management/NyceInfo.cs rename to Adyen/src/Model/Management/NyceInfo.cs diff --git a/Adyen/Model/Management/OfflineProcessing.cs b/Adyen/src/Model/Management/OfflineProcessing.cs similarity index 100% rename from Adyen/Model/Management/OfflineProcessing.cs rename to Adyen/src/Model/Management/OfflineProcessing.cs diff --git a/Adyen/Model/Management/Opi.cs b/Adyen/src/Model/Management/Opi.cs similarity index 100% rename from Adyen/Model/Management/Opi.cs rename to Adyen/src/Model/Management/Opi.cs diff --git a/Adyen/Model/Management/OrderItem.cs b/Adyen/src/Model/Management/OrderItem.cs similarity index 100% rename from Adyen/Model/Management/OrderItem.cs rename to Adyen/src/Model/Management/OrderItem.cs diff --git a/Adyen/Model/Management/PaginationLinks.cs b/Adyen/src/Model/Management/PaginationLinks.cs similarity index 100% rename from Adyen/Model/Management/PaginationLinks.cs rename to Adyen/src/Model/Management/PaginationLinks.cs diff --git a/Adyen/Model/Management/Passcodes.cs b/Adyen/src/Model/Management/Passcodes.cs similarity index 100% rename from Adyen/Model/Management/Passcodes.cs rename to Adyen/src/Model/Management/Passcodes.cs diff --git a/Adyen/Model/Management/PayAtTable.cs b/Adyen/src/Model/Management/PayAtTable.cs similarity index 100% rename from Adyen/Model/Management/PayAtTable.cs rename to Adyen/src/Model/Management/PayAtTable.cs diff --git a/Adyen/Model/Management/PayMeInfo.cs b/Adyen/src/Model/Management/PayMeInfo.cs similarity index 100% rename from Adyen/Model/Management/PayMeInfo.cs rename to Adyen/src/Model/Management/PayMeInfo.cs diff --git a/Adyen/Model/Management/PayPalInfo.cs b/Adyen/src/Model/Management/PayPalInfo.cs similarity index 100% rename from Adyen/Model/Management/PayPalInfo.cs rename to Adyen/src/Model/Management/PayPalInfo.cs diff --git a/Adyen/Model/Management/PayToInfo.cs b/Adyen/src/Model/Management/PayToInfo.cs similarity index 100% rename from Adyen/Model/Management/PayToInfo.cs rename to Adyen/src/Model/Management/PayToInfo.cs diff --git a/Adyen/Model/Management/Payment.cs b/Adyen/src/Model/Management/Payment.cs similarity index 100% rename from Adyen/Model/Management/Payment.cs rename to Adyen/src/Model/Management/Payment.cs diff --git a/Adyen/Model/Management/PaymentMethod.cs b/Adyen/src/Model/Management/PaymentMethod.cs similarity index 100% rename from Adyen/Model/Management/PaymentMethod.cs rename to Adyen/src/Model/Management/PaymentMethod.cs diff --git a/Adyen/Model/Management/PaymentMethodResponse.cs b/Adyen/src/Model/Management/PaymentMethodResponse.cs similarity index 100% rename from Adyen/Model/Management/PaymentMethodResponse.cs rename to Adyen/src/Model/Management/PaymentMethodResponse.cs diff --git a/Adyen/Model/Management/PaymentMethodSetupInfo.cs b/Adyen/src/Model/Management/PaymentMethodSetupInfo.cs similarity index 100% rename from Adyen/Model/Management/PaymentMethodSetupInfo.cs rename to Adyen/src/Model/Management/PaymentMethodSetupInfo.cs diff --git a/Adyen/Model/Management/PayoutSettings.cs b/Adyen/src/Model/Management/PayoutSettings.cs similarity index 100% rename from Adyen/Model/Management/PayoutSettings.cs rename to Adyen/src/Model/Management/PayoutSettings.cs diff --git a/Adyen/Model/Management/PayoutSettingsRequest.cs b/Adyen/src/Model/Management/PayoutSettingsRequest.cs similarity index 100% rename from Adyen/Model/Management/PayoutSettingsRequest.cs rename to Adyen/src/Model/Management/PayoutSettingsRequest.cs diff --git a/Adyen/Model/Management/PayoutSettingsResponse.cs b/Adyen/src/Model/Management/PayoutSettingsResponse.cs similarity index 100% rename from Adyen/Model/Management/PayoutSettingsResponse.cs rename to Adyen/src/Model/Management/PayoutSettingsResponse.cs diff --git a/Adyen/Model/Management/Profile.cs b/Adyen/src/Model/Management/Profile.cs similarity index 100% rename from Adyen/Model/Management/Profile.cs rename to Adyen/src/Model/Management/Profile.cs diff --git a/Adyen/Model/Management/PulseInfo.cs b/Adyen/src/Model/Management/PulseInfo.cs similarity index 100% rename from Adyen/Model/Management/PulseInfo.cs rename to Adyen/src/Model/Management/PulseInfo.cs diff --git a/Adyen/Model/Management/ReceiptOptions.cs b/Adyen/src/Model/Management/ReceiptOptions.cs similarity index 100% rename from Adyen/Model/Management/ReceiptOptions.cs rename to Adyen/src/Model/Management/ReceiptOptions.cs diff --git a/Adyen/Model/Management/ReceiptPrinting.cs b/Adyen/src/Model/Management/ReceiptPrinting.cs similarity index 100% rename from Adyen/Model/Management/ReceiptPrinting.cs rename to Adyen/src/Model/Management/ReceiptPrinting.cs diff --git a/Adyen/Model/Management/Referenced.cs b/Adyen/src/Model/Management/Referenced.cs similarity index 100% rename from Adyen/Model/Management/Referenced.cs rename to Adyen/src/Model/Management/Referenced.cs diff --git a/Adyen/Model/Management/Refunds.cs b/Adyen/src/Model/Management/Refunds.cs similarity index 100% rename from Adyen/Model/Management/Refunds.cs rename to Adyen/src/Model/Management/Refunds.cs diff --git a/Adyen/Model/Management/ReleaseUpdateDetails.cs b/Adyen/src/Model/Management/ReleaseUpdateDetails.cs similarity index 100% rename from Adyen/Model/Management/ReleaseUpdateDetails.cs rename to Adyen/src/Model/Management/ReleaseUpdateDetails.cs diff --git a/Adyen/Model/Management/ReprocessAndroidAppResponse.cs b/Adyen/src/Model/Management/ReprocessAndroidAppResponse.cs similarity index 100% rename from Adyen/Model/Management/ReprocessAndroidAppResponse.cs rename to Adyen/src/Model/Management/ReprocessAndroidAppResponse.cs diff --git a/Adyen/Model/Management/RequestActivationResponse.cs b/Adyen/src/Model/Management/RequestActivationResponse.cs similarity index 100% rename from Adyen/Model/Management/RequestActivationResponse.cs rename to Adyen/src/Model/Management/RequestActivationResponse.cs diff --git a/Adyen/Model/Management/RestServiceError.cs b/Adyen/src/Model/Management/RestServiceError.cs similarity index 100% rename from Adyen/Model/Management/RestServiceError.cs rename to Adyen/src/Model/Management/RestServiceError.cs diff --git a/Adyen/Model/Management/ScheduleTerminalActionsRequest.cs b/Adyen/src/Model/Management/ScheduleTerminalActionsRequest.cs similarity index 100% rename from Adyen/Model/Management/ScheduleTerminalActionsRequest.cs rename to Adyen/src/Model/Management/ScheduleTerminalActionsRequest.cs diff --git a/Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs b/Adyen/src/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs similarity index 100% rename from Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs rename to Adyen/src/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs diff --git a/Adyen/Model/Management/ScheduleTerminalActionsResponse.cs b/Adyen/src/Model/Management/ScheduleTerminalActionsResponse.cs similarity index 100% rename from Adyen/Model/Management/ScheduleTerminalActionsResponse.cs rename to Adyen/src/Model/Management/ScheduleTerminalActionsResponse.cs diff --git a/Adyen/Model/Management/Settings.cs b/Adyen/src/Model/Management/Settings.cs similarity index 100% rename from Adyen/Model/Management/Settings.cs rename to Adyen/src/Model/Management/Settings.cs diff --git a/Adyen/Model/Management/ShippingLocation.cs b/Adyen/src/Model/Management/ShippingLocation.cs similarity index 100% rename from Adyen/Model/Management/ShippingLocation.cs rename to Adyen/src/Model/Management/ShippingLocation.cs diff --git a/Adyen/Model/Management/ShippingLocationsResponse.cs b/Adyen/src/Model/Management/ShippingLocationsResponse.cs similarity index 100% rename from Adyen/Model/Management/ShippingLocationsResponse.cs rename to Adyen/src/Model/Management/ShippingLocationsResponse.cs diff --git a/Adyen/Model/Management/Signature.cs b/Adyen/src/Model/Management/Signature.cs similarity index 100% rename from Adyen/Model/Management/Signature.cs rename to Adyen/src/Model/Management/Signature.cs diff --git a/Adyen/Model/Management/SodexoInfo.cs b/Adyen/src/Model/Management/SodexoInfo.cs similarity index 100% rename from Adyen/Model/Management/SodexoInfo.cs rename to Adyen/src/Model/Management/SodexoInfo.cs diff --git a/Adyen/Model/Management/SofortInfo.cs b/Adyen/src/Model/Management/SofortInfo.cs similarity index 100% rename from Adyen/Model/Management/SofortInfo.cs rename to Adyen/src/Model/Management/SofortInfo.cs diff --git a/Adyen/Model/Management/SplitConfiguration.cs b/Adyen/src/Model/Management/SplitConfiguration.cs similarity index 100% rename from Adyen/Model/Management/SplitConfiguration.cs rename to Adyen/src/Model/Management/SplitConfiguration.cs diff --git a/Adyen/Model/Management/SplitConfigurationList.cs b/Adyen/src/Model/Management/SplitConfigurationList.cs similarity index 100% rename from Adyen/Model/Management/SplitConfigurationList.cs rename to Adyen/src/Model/Management/SplitConfigurationList.cs diff --git a/Adyen/Model/Management/SplitConfigurationLogic.cs b/Adyen/src/Model/Management/SplitConfigurationLogic.cs similarity index 100% rename from Adyen/Model/Management/SplitConfigurationLogic.cs rename to Adyen/src/Model/Management/SplitConfigurationLogic.cs diff --git a/Adyen/Model/Management/SplitConfigurationRule.cs b/Adyen/src/Model/Management/SplitConfigurationRule.cs similarity index 100% rename from Adyen/Model/Management/SplitConfigurationRule.cs rename to Adyen/src/Model/Management/SplitConfigurationRule.cs diff --git a/Adyen/Model/Management/Standalone.cs b/Adyen/src/Model/Management/Standalone.cs similarity index 100% rename from Adyen/Model/Management/Standalone.cs rename to Adyen/src/Model/Management/Standalone.cs diff --git a/Adyen/Model/Management/StarInfo.cs b/Adyen/src/Model/Management/StarInfo.cs similarity index 100% rename from Adyen/Model/Management/StarInfo.cs rename to Adyen/src/Model/Management/StarInfo.cs diff --git a/Adyen/Model/Management/Store.cs b/Adyen/src/Model/Management/Store.cs similarity index 100% rename from Adyen/Model/Management/Store.cs rename to Adyen/src/Model/Management/Store.cs diff --git a/Adyen/Model/Management/StoreAndForward.cs b/Adyen/src/Model/Management/StoreAndForward.cs similarity index 100% rename from Adyen/Model/Management/StoreAndForward.cs rename to Adyen/src/Model/Management/StoreAndForward.cs diff --git a/Adyen/Model/Management/StoreCreationRequest.cs b/Adyen/src/Model/Management/StoreCreationRequest.cs similarity index 100% rename from Adyen/Model/Management/StoreCreationRequest.cs rename to Adyen/src/Model/Management/StoreCreationRequest.cs diff --git a/Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.cs b/Adyen/src/Model/Management/StoreCreationWithMerchantCodeRequest.cs similarity index 100% rename from Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.cs rename to Adyen/src/Model/Management/StoreCreationWithMerchantCodeRequest.cs diff --git a/Adyen/Model/Management/StoreLocation.cs b/Adyen/src/Model/Management/StoreLocation.cs similarity index 100% rename from Adyen/Model/Management/StoreLocation.cs rename to Adyen/src/Model/Management/StoreLocation.cs diff --git a/Adyen/Model/Management/StoreSplitConfiguration.cs b/Adyen/src/Model/Management/StoreSplitConfiguration.cs similarity index 100% rename from Adyen/Model/Management/StoreSplitConfiguration.cs rename to Adyen/src/Model/Management/StoreSplitConfiguration.cs diff --git a/Adyen/Model/Management/SupportedCardTypes.cs b/Adyen/src/Model/Management/SupportedCardTypes.cs similarity index 100% rename from Adyen/Model/Management/SupportedCardTypes.cs rename to Adyen/src/Model/Management/SupportedCardTypes.cs diff --git a/Adyen/Model/Management/Surcharge.cs b/Adyen/src/Model/Management/Surcharge.cs similarity index 100% rename from Adyen/Model/Management/Surcharge.cs rename to Adyen/src/Model/Management/Surcharge.cs diff --git a/Adyen/Model/Management/SwishInfo.cs b/Adyen/src/Model/Management/SwishInfo.cs similarity index 100% rename from Adyen/Model/Management/SwishInfo.cs rename to Adyen/src/Model/Management/SwishInfo.cs diff --git a/Adyen/Model/Management/TapToPay.cs b/Adyen/src/Model/Management/TapToPay.cs similarity index 100% rename from Adyen/Model/Management/TapToPay.cs rename to Adyen/src/Model/Management/TapToPay.cs diff --git a/Adyen/Model/Management/Terminal.cs b/Adyen/src/Model/Management/Terminal.cs similarity index 100% rename from Adyen/Model/Management/Terminal.cs rename to Adyen/src/Model/Management/Terminal.cs diff --git a/Adyen/Model/Management/TerminalActionScheduleDetail.cs b/Adyen/src/Model/Management/TerminalActionScheduleDetail.cs similarity index 100% rename from Adyen/Model/Management/TerminalActionScheduleDetail.cs rename to Adyen/src/Model/Management/TerminalActionScheduleDetail.cs diff --git a/Adyen/Model/Management/TerminalAssignment.cs b/Adyen/src/Model/Management/TerminalAssignment.cs similarity index 100% rename from Adyen/Model/Management/TerminalAssignment.cs rename to Adyen/src/Model/Management/TerminalAssignment.cs diff --git a/Adyen/Model/Management/TerminalConnectivity.cs b/Adyen/src/Model/Management/TerminalConnectivity.cs similarity index 100% rename from Adyen/Model/Management/TerminalConnectivity.cs rename to Adyen/src/Model/Management/TerminalConnectivity.cs diff --git a/Adyen/Model/Management/TerminalConnectivityBluetooth.cs b/Adyen/src/Model/Management/TerminalConnectivityBluetooth.cs similarity index 100% rename from Adyen/Model/Management/TerminalConnectivityBluetooth.cs rename to Adyen/src/Model/Management/TerminalConnectivityBluetooth.cs diff --git a/Adyen/Model/Management/TerminalConnectivityCellular.cs b/Adyen/src/Model/Management/TerminalConnectivityCellular.cs similarity index 100% rename from Adyen/Model/Management/TerminalConnectivityCellular.cs rename to Adyen/src/Model/Management/TerminalConnectivityCellular.cs diff --git a/Adyen/Model/Management/TerminalConnectivityEthernet.cs b/Adyen/src/Model/Management/TerminalConnectivityEthernet.cs similarity index 100% rename from Adyen/Model/Management/TerminalConnectivityEthernet.cs rename to Adyen/src/Model/Management/TerminalConnectivityEthernet.cs diff --git a/Adyen/Model/Management/TerminalConnectivityWifi.cs b/Adyen/src/Model/Management/TerminalConnectivityWifi.cs similarity index 100% rename from Adyen/Model/Management/TerminalConnectivityWifi.cs rename to Adyen/src/Model/Management/TerminalConnectivityWifi.cs diff --git a/Adyen/Model/Management/TerminalInstructions.cs b/Adyen/src/Model/Management/TerminalInstructions.cs similarity index 100% rename from Adyen/Model/Management/TerminalInstructions.cs rename to Adyen/src/Model/Management/TerminalInstructions.cs diff --git a/Adyen/Model/Management/TerminalModelsResponse.cs b/Adyen/src/Model/Management/TerminalModelsResponse.cs similarity index 100% rename from Adyen/Model/Management/TerminalModelsResponse.cs rename to Adyen/src/Model/Management/TerminalModelsResponse.cs diff --git a/Adyen/Model/Management/TerminalOrder.cs b/Adyen/src/Model/Management/TerminalOrder.cs similarity index 100% rename from Adyen/Model/Management/TerminalOrder.cs rename to Adyen/src/Model/Management/TerminalOrder.cs diff --git a/Adyen/Model/Management/TerminalOrderRequest.cs b/Adyen/src/Model/Management/TerminalOrderRequest.cs similarity index 100% rename from Adyen/Model/Management/TerminalOrderRequest.cs rename to Adyen/src/Model/Management/TerminalOrderRequest.cs diff --git a/Adyen/Model/Management/TerminalOrdersResponse.cs b/Adyen/src/Model/Management/TerminalOrdersResponse.cs similarity index 100% rename from Adyen/Model/Management/TerminalOrdersResponse.cs rename to Adyen/src/Model/Management/TerminalOrdersResponse.cs diff --git a/Adyen/Model/Management/TerminalProduct.cs b/Adyen/src/Model/Management/TerminalProduct.cs similarity index 100% rename from Adyen/Model/Management/TerminalProduct.cs rename to Adyen/src/Model/Management/TerminalProduct.cs diff --git a/Adyen/Model/Management/TerminalProductPrice.cs b/Adyen/src/Model/Management/TerminalProductPrice.cs similarity index 100% rename from Adyen/Model/Management/TerminalProductPrice.cs rename to Adyen/src/Model/Management/TerminalProductPrice.cs diff --git a/Adyen/Model/Management/TerminalProductsResponse.cs b/Adyen/src/Model/Management/TerminalProductsResponse.cs similarity index 100% rename from Adyen/Model/Management/TerminalProductsResponse.cs rename to Adyen/src/Model/Management/TerminalProductsResponse.cs diff --git a/Adyen/Model/Management/TerminalReassignmentRequest.cs b/Adyen/src/Model/Management/TerminalReassignmentRequest.cs similarity index 100% rename from Adyen/Model/Management/TerminalReassignmentRequest.cs rename to Adyen/src/Model/Management/TerminalReassignmentRequest.cs diff --git a/Adyen/Model/Management/TerminalReassignmentTarget.cs b/Adyen/src/Model/Management/TerminalReassignmentTarget.cs similarity index 100% rename from Adyen/Model/Management/TerminalReassignmentTarget.cs rename to Adyen/src/Model/Management/TerminalReassignmentTarget.cs diff --git a/Adyen/Model/Management/TerminalSettings.cs b/Adyen/src/Model/Management/TerminalSettings.cs similarity index 100% rename from Adyen/Model/Management/TerminalSettings.cs rename to Adyen/src/Model/Management/TerminalSettings.cs diff --git a/Adyen/Model/Management/TestCompanyWebhookRequest.cs b/Adyen/src/Model/Management/TestCompanyWebhookRequest.cs similarity index 100% rename from Adyen/Model/Management/TestCompanyWebhookRequest.cs rename to Adyen/src/Model/Management/TestCompanyWebhookRequest.cs diff --git a/Adyen/Model/Management/TestOutput.cs b/Adyen/src/Model/Management/TestOutput.cs similarity index 100% rename from Adyen/Model/Management/TestOutput.cs rename to Adyen/src/Model/Management/TestOutput.cs diff --git a/Adyen/Model/Management/TestWebhookRequest.cs b/Adyen/src/Model/Management/TestWebhookRequest.cs similarity index 100% rename from Adyen/Model/Management/TestWebhookRequest.cs rename to Adyen/src/Model/Management/TestWebhookRequest.cs diff --git a/Adyen/Model/Management/TestWebhookResponse.cs b/Adyen/src/Model/Management/TestWebhookResponse.cs similarity index 100% rename from Adyen/Model/Management/TestWebhookResponse.cs rename to Adyen/src/Model/Management/TestWebhookResponse.cs diff --git a/Adyen/Model/Management/TicketInfo.cs b/Adyen/src/Model/Management/TicketInfo.cs similarity index 100% rename from Adyen/Model/Management/TicketInfo.cs rename to Adyen/src/Model/Management/TicketInfo.cs diff --git a/Adyen/Model/Management/Timeouts.cs b/Adyen/src/Model/Management/Timeouts.cs similarity index 100% rename from Adyen/Model/Management/Timeouts.cs rename to Adyen/src/Model/Management/Timeouts.cs diff --git a/Adyen/Model/Management/TransactionDescriptionInfo.cs b/Adyen/src/Model/Management/TransactionDescriptionInfo.cs similarity index 100% rename from Adyen/Model/Management/TransactionDescriptionInfo.cs rename to Adyen/src/Model/Management/TransactionDescriptionInfo.cs diff --git a/Adyen/Model/Management/TwintInfo.cs b/Adyen/src/Model/Management/TwintInfo.cs similarity index 100% rename from Adyen/Model/Management/TwintInfo.cs rename to Adyen/src/Model/Management/TwintInfo.cs diff --git a/Adyen/Model/Management/UninstallAndroidAppDetails.cs b/Adyen/src/Model/Management/UninstallAndroidAppDetails.cs similarity index 100% rename from Adyen/Model/Management/UninstallAndroidAppDetails.cs rename to Adyen/src/Model/Management/UninstallAndroidAppDetails.cs diff --git a/Adyen/Model/Management/UninstallAndroidCertificateDetails.cs b/Adyen/src/Model/Management/UninstallAndroidCertificateDetails.cs similarity index 100% rename from Adyen/Model/Management/UninstallAndroidCertificateDetails.cs rename to Adyen/src/Model/Management/UninstallAndroidCertificateDetails.cs diff --git a/Adyen/Model/Management/UpdatableAddress.cs b/Adyen/src/Model/Management/UpdatableAddress.cs similarity index 100% rename from Adyen/Model/Management/UpdatableAddress.cs rename to Adyen/src/Model/Management/UpdatableAddress.cs diff --git a/Adyen/Model/Management/UpdateCompanyApiCredentialRequest.cs b/Adyen/src/Model/Management/UpdateCompanyApiCredentialRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateCompanyApiCredentialRequest.cs rename to Adyen/src/Model/Management/UpdateCompanyApiCredentialRequest.cs diff --git a/Adyen/Model/Management/UpdateCompanyUserRequest.cs b/Adyen/src/Model/Management/UpdateCompanyUserRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateCompanyUserRequest.cs rename to Adyen/src/Model/Management/UpdateCompanyUserRequest.cs diff --git a/Adyen/Model/Management/UpdateCompanyWebhookRequest.cs b/Adyen/src/Model/Management/UpdateCompanyWebhookRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateCompanyWebhookRequest.cs rename to Adyen/src/Model/Management/UpdateCompanyWebhookRequest.cs diff --git a/Adyen/Model/Management/UpdateMerchantApiCredentialRequest.cs b/Adyen/src/Model/Management/UpdateMerchantApiCredentialRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateMerchantApiCredentialRequest.cs rename to Adyen/src/Model/Management/UpdateMerchantApiCredentialRequest.cs diff --git a/Adyen/Model/Management/UpdateMerchantUserRequest.cs b/Adyen/src/Model/Management/UpdateMerchantUserRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateMerchantUserRequest.cs rename to Adyen/src/Model/Management/UpdateMerchantUserRequest.cs diff --git a/Adyen/Model/Management/UpdateMerchantWebhookRequest.cs b/Adyen/src/Model/Management/UpdateMerchantWebhookRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateMerchantWebhookRequest.cs rename to Adyen/src/Model/Management/UpdateMerchantWebhookRequest.cs diff --git a/Adyen/Model/Management/UpdatePaymentMethodInfo.cs b/Adyen/src/Model/Management/UpdatePaymentMethodInfo.cs similarity index 100% rename from Adyen/Model/Management/UpdatePaymentMethodInfo.cs rename to Adyen/src/Model/Management/UpdatePaymentMethodInfo.cs diff --git a/Adyen/Model/Management/UpdatePayoutSettingsRequest.cs b/Adyen/src/Model/Management/UpdatePayoutSettingsRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdatePayoutSettingsRequest.cs rename to Adyen/src/Model/Management/UpdatePayoutSettingsRequest.cs diff --git a/Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.cs b/Adyen/src/Model/Management/UpdateSplitConfigurationLogicRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.cs rename to Adyen/src/Model/Management/UpdateSplitConfigurationLogicRequest.cs diff --git a/Adyen/Model/Management/UpdateSplitConfigurationRequest.cs b/Adyen/src/Model/Management/UpdateSplitConfigurationRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateSplitConfigurationRequest.cs rename to Adyen/src/Model/Management/UpdateSplitConfigurationRequest.cs diff --git a/Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.cs b/Adyen/src/Model/Management/UpdateSplitConfigurationRuleRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.cs rename to Adyen/src/Model/Management/UpdateSplitConfigurationRuleRequest.cs diff --git a/Adyen/Model/Management/UpdateStoreRequest.cs b/Adyen/src/Model/Management/UpdateStoreRequest.cs similarity index 100% rename from Adyen/Model/Management/UpdateStoreRequest.cs rename to Adyen/src/Model/Management/UpdateStoreRequest.cs diff --git a/Adyen/Model/Management/UploadAndroidAppResponse.cs b/Adyen/src/Model/Management/UploadAndroidAppResponse.cs similarity index 100% rename from Adyen/Model/Management/UploadAndroidAppResponse.cs rename to Adyen/src/Model/Management/UploadAndroidAppResponse.cs diff --git a/Adyen/Model/Management/UploadAndroidCertificateResponse.cs b/Adyen/src/Model/Management/UploadAndroidCertificateResponse.cs similarity index 100% rename from Adyen/Model/Management/UploadAndroidCertificateResponse.cs rename to Adyen/src/Model/Management/UploadAndroidCertificateResponse.cs diff --git a/Adyen/Model/Management/Url.cs b/Adyen/src/Model/Management/Url.cs similarity index 100% rename from Adyen/Model/Management/Url.cs rename to Adyen/src/Model/Management/Url.cs diff --git a/Adyen/Model/Management/User.cs b/Adyen/src/Model/Management/User.cs similarity index 100% rename from Adyen/Model/Management/User.cs rename to Adyen/src/Model/Management/User.cs diff --git a/Adyen/Model/Management/VippsInfo.cs b/Adyen/src/Model/Management/VippsInfo.cs similarity index 100% rename from Adyen/Model/Management/VippsInfo.cs rename to Adyen/src/Model/Management/VippsInfo.cs diff --git a/Adyen/Model/Management/WeChatPayInfo.cs b/Adyen/src/Model/Management/WeChatPayInfo.cs similarity index 100% rename from Adyen/Model/Management/WeChatPayInfo.cs rename to Adyen/src/Model/Management/WeChatPayInfo.cs diff --git a/Adyen/Model/Management/WeChatPayPosInfo.cs b/Adyen/src/Model/Management/WeChatPayPosInfo.cs similarity index 100% rename from Adyen/Model/Management/WeChatPayPosInfo.cs rename to Adyen/src/Model/Management/WeChatPayPosInfo.cs diff --git a/Adyen/Model/Management/Webhook.cs b/Adyen/src/Model/Management/Webhook.cs similarity index 100% rename from Adyen/Model/Management/Webhook.cs rename to Adyen/src/Model/Management/Webhook.cs diff --git a/Adyen/Model/Management/WebhookLinks.cs b/Adyen/src/Model/Management/WebhookLinks.cs similarity index 100% rename from Adyen/Model/Management/WebhookLinks.cs rename to Adyen/src/Model/Management/WebhookLinks.cs diff --git a/Adyen/Model/Management/WifiProfiles.cs b/Adyen/src/Model/Management/WifiProfiles.cs similarity index 100% rename from Adyen/Model/Management/WifiProfiles.cs rename to Adyen/src/Model/Management/WifiProfiles.cs diff --git a/Adyen/Model/ManagementWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/ManagementWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/ManagementWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/ManagementWebhooks/AccountCapabilityData.cs b/Adyen/src/Model/ManagementWebhooks/AccountCapabilityData.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/AccountCapabilityData.cs rename to Adyen/src/Model/ManagementWebhooks/AccountCapabilityData.cs diff --git a/Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.cs b/Adyen/src/Model/ManagementWebhooks/AccountCreateNotificationData.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.cs rename to Adyen/src/Model/ManagementWebhooks/AccountCreateNotificationData.cs diff --git a/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.cs b/Adyen/src/Model/ManagementWebhooks/AccountNotificationResponse.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/AccountNotificationResponse.cs rename to Adyen/src/Model/ManagementWebhooks/AccountNotificationResponse.cs diff --git a/Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.cs b/Adyen/src/Model/ManagementWebhooks/AccountUpdateNotificationData.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.cs rename to Adyen/src/Model/ManagementWebhooks/AccountUpdateNotificationData.cs diff --git a/Adyen/Model/ManagementWebhooks/CapabilityProblem.cs b/Adyen/src/Model/ManagementWebhooks/CapabilityProblem.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/CapabilityProblem.cs rename to Adyen/src/Model/ManagementWebhooks/CapabilityProblem.cs diff --git a/Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.cs b/Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.cs rename to Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntity.cs diff --git a/Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs b/Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs rename to Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/MidServiceNotificationData.cs b/Adyen/src/Model/ManagementWebhooks/MidServiceNotificationData.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/MidServiceNotificationData.cs rename to Adyen/src/Model/ManagementWebhooks/MidServiceNotificationData.cs diff --git a/Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs b/Adyen/src/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs rename to Adyen/src/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs diff --git a/Adyen/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/RemediatingAction.cs b/Adyen/src/Model/ManagementWebhooks/RemediatingAction.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/RemediatingAction.cs rename to Adyen/src/Model/ManagementWebhooks/RemediatingAction.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs b/Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalBoardingData.cs b/Adyen/src/Model/ManagementWebhooks/TerminalBoardingData.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalBoardingData.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalBoardingData.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs b/Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalSettingsData.cs b/Adyen/src/Model/ManagementWebhooks/TerminalSettingsData.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalSettingsData.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalSettingsData.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs b/Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs diff --git a/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs b/Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs rename to Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs diff --git a/Adyen/Model/ManagementWebhooks/VerificationError.cs b/Adyen/src/Model/ManagementWebhooks/VerificationError.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/VerificationError.cs rename to Adyen/src/Model/ManagementWebhooks/VerificationError.cs diff --git a/Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.cs b/Adyen/src/Model/ManagementWebhooks/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.cs rename to Adyen/src/Model/ManagementWebhooks/VerificationErrorRecursive.cs diff --git a/Adyen/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/NegativeBalanceWarningWebhooks/Amount.cs b/Adyen/src/Model/NegativeBalanceWarningWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/NegativeBalanceWarningWebhooks/Amount.cs rename to Adyen/src/Model/NegativeBalanceWarningWebhooks/Amount.cs diff --git a/Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs b/Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs similarity index 100% rename from Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs rename to Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs diff --git a/Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs b/Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs similarity index 100% rename from Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs rename to Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs diff --git a/Adyen/Model/NegativeBalanceWarningWebhooks/Resource.cs b/Adyen/src/Model/NegativeBalanceWarningWebhooks/Resource.cs similarity index 100% rename from Adyen/Model/NegativeBalanceWarningWebhooks/Resource.cs rename to Adyen/src/Model/NegativeBalanceWarningWebhooks/Resource.cs diff --git a/Adyen/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs b/Adyen/src/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs rename to Adyen/src/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs diff --git a/Adyen/Model/Notification/NotificationRequest.cs b/Adyen/src/Model/Notification/NotificationRequest.cs similarity index 100% rename from Adyen/Model/Notification/NotificationRequest.cs rename to Adyen/src/Model/Notification/NotificationRequest.cs diff --git a/Adyen/Model/Notification/NotificationRequestConst.cs b/Adyen/src/Model/Notification/NotificationRequestConst.cs similarity index 100% rename from Adyen/Model/Notification/NotificationRequestConst.cs rename to Adyen/src/Model/Notification/NotificationRequestConst.cs diff --git a/Adyen/Model/Notification/NotificationRequestItem.cs b/Adyen/src/Model/Notification/NotificationRequestItem.cs similarity index 100% rename from Adyen/Model/Notification/NotificationRequestItem.cs rename to Adyen/src/Model/Notification/NotificationRequestItem.cs diff --git a/Adyen/Model/Notification/NotificationRequestItemContainer.cs b/Adyen/src/Model/Notification/NotificationRequestItemContainer.cs similarity index 100% rename from Adyen/Model/Notification/NotificationRequestItemContainer.cs rename to Adyen/src/Model/Notification/NotificationRequestItemContainer.cs diff --git a/Adyen/Model/Payment/AbstractOpenAPISchema.cs b/Adyen/src/Model/Payment/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Payment/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Payment/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Payment/AccountInfo.cs b/Adyen/src/Model/Payment/AccountInfo.cs similarity index 100% rename from Adyen/Model/Payment/AccountInfo.cs rename to Adyen/src/Model/Payment/AccountInfo.cs diff --git a/Adyen/Model/Payment/AcctInfo.cs b/Adyen/src/Model/Payment/AcctInfo.cs similarity index 100% rename from Adyen/Model/Payment/AcctInfo.cs rename to Adyen/src/Model/Payment/AcctInfo.cs diff --git a/Adyen/Model/Payment/AdditionalData3DSecure.cs b/Adyen/src/Model/Payment/AdditionalData3DSecure.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalData3DSecure.cs rename to Adyen/src/Model/Payment/AdditionalData3DSecure.cs diff --git a/Adyen/Model/Payment/AdditionalDataAirline.cs b/Adyen/src/Model/Payment/AdditionalDataAirline.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataAirline.cs rename to Adyen/src/Model/Payment/AdditionalDataAirline.cs diff --git a/Adyen/Model/Payment/AdditionalDataCarRental.cs b/Adyen/src/Model/Payment/AdditionalDataCarRental.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataCarRental.cs rename to Adyen/src/Model/Payment/AdditionalDataCarRental.cs diff --git a/Adyen/Model/Payment/AdditionalDataCommon.cs b/Adyen/src/Model/Payment/AdditionalDataCommon.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataCommon.cs rename to Adyen/src/Model/Payment/AdditionalDataCommon.cs diff --git a/Adyen/Model/Payment/AdditionalDataLevel23.cs b/Adyen/src/Model/Payment/AdditionalDataLevel23.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataLevel23.cs rename to Adyen/src/Model/Payment/AdditionalDataLevel23.cs diff --git a/Adyen/Model/Payment/AdditionalDataLodging.cs b/Adyen/src/Model/Payment/AdditionalDataLodging.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataLodging.cs rename to Adyen/src/Model/Payment/AdditionalDataLodging.cs diff --git a/Adyen/Model/Payment/AdditionalDataModifications.cs b/Adyen/src/Model/Payment/AdditionalDataModifications.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataModifications.cs rename to Adyen/src/Model/Payment/AdditionalDataModifications.cs diff --git a/Adyen/Model/Payment/AdditionalDataOpenInvoice.cs b/Adyen/src/Model/Payment/AdditionalDataOpenInvoice.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataOpenInvoice.cs rename to Adyen/src/Model/Payment/AdditionalDataOpenInvoice.cs diff --git a/Adyen/Model/Payment/AdditionalDataOpi.cs b/Adyen/src/Model/Payment/AdditionalDataOpi.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataOpi.cs rename to Adyen/src/Model/Payment/AdditionalDataOpi.cs diff --git a/Adyen/Model/Payment/AdditionalDataRatepay.cs b/Adyen/src/Model/Payment/AdditionalDataRatepay.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataRatepay.cs rename to Adyen/src/Model/Payment/AdditionalDataRatepay.cs diff --git a/Adyen/Model/Payment/AdditionalDataRetry.cs b/Adyen/src/Model/Payment/AdditionalDataRetry.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataRetry.cs rename to Adyen/src/Model/Payment/AdditionalDataRetry.cs diff --git a/Adyen/Model/Payment/AdditionalDataRisk.cs b/Adyen/src/Model/Payment/AdditionalDataRisk.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataRisk.cs rename to Adyen/src/Model/Payment/AdditionalDataRisk.cs diff --git a/Adyen/Model/Payment/AdditionalDataRiskStandalone.cs b/Adyen/src/Model/Payment/AdditionalDataRiskStandalone.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataRiskStandalone.cs rename to Adyen/src/Model/Payment/AdditionalDataRiskStandalone.cs diff --git a/Adyen/Model/Payment/AdditionalDataSubMerchant.cs b/Adyen/src/Model/Payment/AdditionalDataSubMerchant.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataSubMerchant.cs rename to Adyen/src/Model/Payment/AdditionalDataSubMerchant.cs diff --git a/Adyen/Model/Payment/AdditionalDataTemporaryServices.cs b/Adyen/src/Model/Payment/AdditionalDataTemporaryServices.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataTemporaryServices.cs rename to Adyen/src/Model/Payment/AdditionalDataTemporaryServices.cs diff --git a/Adyen/Model/Payment/AdditionalDataWallets.cs b/Adyen/src/Model/Payment/AdditionalDataWallets.cs similarity index 100% rename from Adyen/Model/Payment/AdditionalDataWallets.cs rename to Adyen/src/Model/Payment/AdditionalDataWallets.cs diff --git a/Adyen/Model/Payment/Address.cs b/Adyen/src/Model/Payment/Address.cs similarity index 100% rename from Adyen/Model/Payment/Address.cs rename to Adyen/src/Model/Payment/Address.cs diff --git a/Adyen/Model/Payment/AdjustAuthorisationRequest.cs b/Adyen/src/Model/Payment/AdjustAuthorisationRequest.cs similarity index 100% rename from Adyen/Model/Payment/AdjustAuthorisationRequest.cs rename to Adyen/src/Model/Payment/AdjustAuthorisationRequest.cs diff --git a/Adyen/Model/Payment/Amount.cs b/Adyen/src/Model/Payment/Amount.cs similarity index 100% rename from Adyen/Model/Payment/Amount.cs rename to Adyen/src/Model/Payment/Amount.cs diff --git a/Adyen/Model/Payment/ApplicationInfo.cs b/Adyen/src/Model/Payment/ApplicationInfo.cs similarity index 100% rename from Adyen/Model/Payment/ApplicationInfo.cs rename to Adyen/src/Model/Payment/ApplicationInfo.cs diff --git a/Adyen/Model/Payment/AuthenticationResultRequest.cs b/Adyen/src/Model/Payment/AuthenticationResultRequest.cs similarity index 100% rename from Adyen/Model/Payment/AuthenticationResultRequest.cs rename to Adyen/src/Model/Payment/AuthenticationResultRequest.cs diff --git a/Adyen/Model/Payment/AuthenticationResultResponse.cs b/Adyen/src/Model/Payment/AuthenticationResultResponse.cs similarity index 100% rename from Adyen/Model/Payment/AuthenticationResultResponse.cs rename to Adyen/src/Model/Payment/AuthenticationResultResponse.cs diff --git a/Adyen/Model/Payment/BankAccount.cs b/Adyen/src/Model/Payment/BankAccount.cs similarity index 100% rename from Adyen/Model/Payment/BankAccount.cs rename to Adyen/src/Model/Payment/BankAccount.cs diff --git a/Adyen/Model/Payment/BrowserInfo.cs b/Adyen/src/Model/Payment/BrowserInfo.cs similarity index 100% rename from Adyen/Model/Payment/BrowserInfo.cs rename to Adyen/src/Model/Payment/BrowserInfo.cs diff --git a/Adyen/Model/Payment/CancelOrRefundRequest.cs b/Adyen/src/Model/Payment/CancelOrRefundRequest.cs similarity index 100% rename from Adyen/Model/Payment/CancelOrRefundRequest.cs rename to Adyen/src/Model/Payment/CancelOrRefundRequest.cs diff --git a/Adyen/Model/Payment/CancelRequest.cs b/Adyen/src/Model/Payment/CancelRequest.cs similarity index 100% rename from Adyen/Model/Payment/CancelRequest.cs rename to Adyen/src/Model/Payment/CancelRequest.cs diff --git a/Adyen/Model/Payment/CaptureRequest.cs b/Adyen/src/Model/Payment/CaptureRequest.cs similarity index 100% rename from Adyen/Model/Payment/CaptureRequest.cs rename to Adyen/src/Model/Payment/CaptureRequest.cs diff --git a/Adyen/Model/Payment/Card.cs b/Adyen/src/Model/Payment/Card.cs similarity index 100% rename from Adyen/Model/Payment/Card.cs rename to Adyen/src/Model/Payment/Card.cs diff --git a/Adyen/Model/Payment/CommonField.cs b/Adyen/src/Model/Payment/CommonField.cs similarity index 100% rename from Adyen/Model/Payment/CommonField.cs rename to Adyen/src/Model/Payment/CommonField.cs diff --git a/Adyen/Model/Payment/DeviceRenderOptions.cs b/Adyen/src/Model/Payment/DeviceRenderOptions.cs similarity index 100% rename from Adyen/Model/Payment/DeviceRenderOptions.cs rename to Adyen/src/Model/Payment/DeviceRenderOptions.cs diff --git a/Adyen/Model/Payment/DonationRequest.cs b/Adyen/src/Model/Payment/DonationRequest.cs similarity index 100% rename from Adyen/Model/Payment/DonationRequest.cs rename to Adyen/src/Model/Payment/DonationRequest.cs diff --git a/Adyen/Model/Payment/ExternalPlatform.cs b/Adyen/src/Model/Payment/ExternalPlatform.cs similarity index 100% rename from Adyen/Model/Payment/ExternalPlatform.cs rename to Adyen/src/Model/Payment/ExternalPlatform.cs diff --git a/Adyen/Model/Payment/ForexQuote.cs b/Adyen/src/Model/Payment/ForexQuote.cs similarity index 100% rename from Adyen/Model/Payment/ForexQuote.cs rename to Adyen/src/Model/Payment/ForexQuote.cs diff --git a/Adyen/Model/Payment/FraudCheckResult.cs b/Adyen/src/Model/Payment/FraudCheckResult.cs similarity index 100% rename from Adyen/Model/Payment/FraudCheckResult.cs rename to Adyen/src/Model/Payment/FraudCheckResult.cs diff --git a/Adyen/Model/Payment/FraudCheckResultWrapper.cs b/Adyen/src/Model/Payment/FraudCheckResultWrapper.cs similarity index 100% rename from Adyen/Model/Payment/FraudCheckResultWrapper.cs rename to Adyen/src/Model/Payment/FraudCheckResultWrapper.cs diff --git a/Adyen/Model/Payment/FraudResult.cs b/Adyen/src/Model/Payment/FraudResult.cs similarity index 100% rename from Adyen/Model/Payment/FraudResult.cs rename to Adyen/src/Model/Payment/FraudResult.cs diff --git a/Adyen/Model/Payment/FundDestination.cs b/Adyen/src/Model/Payment/FundDestination.cs similarity index 100% rename from Adyen/Model/Payment/FundDestination.cs rename to Adyen/src/Model/Payment/FundDestination.cs diff --git a/Adyen/Model/Payment/FundSource.cs b/Adyen/src/Model/Payment/FundSource.cs similarity index 100% rename from Adyen/Model/Payment/FundSource.cs rename to Adyen/src/Model/Payment/FundSource.cs diff --git a/Adyen/Model/Payment/Installments.cs b/Adyen/src/Model/Payment/Installments.cs similarity index 100% rename from Adyen/Model/Payment/Installments.cs rename to Adyen/src/Model/Payment/Installments.cs diff --git a/Adyen/Model/Payment/Mandate.cs b/Adyen/src/Model/Payment/Mandate.cs similarity index 100% rename from Adyen/Model/Payment/Mandate.cs rename to Adyen/src/Model/Payment/Mandate.cs diff --git a/Adyen/Model/Payment/MerchantDevice.cs b/Adyen/src/Model/Payment/MerchantDevice.cs similarity index 100% rename from Adyen/Model/Payment/MerchantDevice.cs rename to Adyen/src/Model/Payment/MerchantDevice.cs diff --git a/Adyen/Model/Payment/MerchantRiskIndicator.cs b/Adyen/src/Model/Payment/MerchantRiskIndicator.cs similarity index 100% rename from Adyen/Model/Payment/MerchantRiskIndicator.cs rename to Adyen/src/Model/Payment/MerchantRiskIndicator.cs diff --git a/Adyen/Model/Payment/ModificationResult.cs b/Adyen/src/Model/Payment/ModificationResult.cs similarity index 100% rename from Adyen/Model/Payment/ModificationResult.cs rename to Adyen/src/Model/Payment/ModificationResult.cs diff --git a/Adyen/Model/Payment/Name.cs b/Adyen/src/Model/Payment/Name.cs similarity index 100% rename from Adyen/Model/Payment/Name.cs rename to Adyen/src/Model/Payment/Name.cs diff --git a/Adyen/Model/Payment/PaymentRequest.cs b/Adyen/src/Model/Payment/PaymentRequest.cs similarity index 100% rename from Adyen/Model/Payment/PaymentRequest.cs rename to Adyen/src/Model/Payment/PaymentRequest.cs diff --git a/Adyen/Model/Payment/PaymentRequest3d.cs b/Adyen/src/Model/Payment/PaymentRequest3d.cs similarity index 100% rename from Adyen/Model/Payment/PaymentRequest3d.cs rename to Adyen/src/Model/Payment/PaymentRequest3d.cs diff --git a/Adyen/Model/Payment/PaymentRequest3ds2.cs b/Adyen/src/Model/Payment/PaymentRequest3ds2.cs similarity index 100% rename from Adyen/Model/Payment/PaymentRequest3ds2.cs rename to Adyen/src/Model/Payment/PaymentRequest3ds2.cs diff --git a/Adyen/Model/Payment/PaymentResult.cs b/Adyen/src/Model/Payment/PaymentResult.cs similarity index 100% rename from Adyen/Model/Payment/PaymentResult.cs rename to Adyen/src/Model/Payment/PaymentResult.cs diff --git a/Adyen/Model/Payment/Phone.cs b/Adyen/src/Model/Payment/Phone.cs similarity index 100% rename from Adyen/Model/Payment/Phone.cs rename to Adyen/src/Model/Payment/Phone.cs diff --git a/Adyen/Model/Payment/PlatformChargebackLogic.cs b/Adyen/src/Model/Payment/PlatformChargebackLogic.cs similarity index 100% rename from Adyen/Model/Payment/PlatformChargebackLogic.cs rename to Adyen/src/Model/Payment/PlatformChargebackLogic.cs diff --git a/Adyen/Model/Payment/Recurring.cs b/Adyen/src/Model/Payment/Recurring.cs similarity index 100% rename from Adyen/Model/Payment/Recurring.cs rename to Adyen/src/Model/Payment/Recurring.cs diff --git a/Adyen/Model/Payment/RefundRequest.cs b/Adyen/src/Model/Payment/RefundRequest.cs similarity index 100% rename from Adyen/Model/Payment/RefundRequest.cs rename to Adyen/src/Model/Payment/RefundRequest.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalData3DSecure.cs b/Adyen/src/Model/Payment/ResponseAdditionalData3DSecure.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalData3DSecure.cs rename to Adyen/src/Model/Payment/ResponseAdditionalData3DSecure.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataBillingAddress.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataBillingAddress.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataBillingAddress.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataBillingAddress.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataCard.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataCard.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataCard.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataCard.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataCommon.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataCommon.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataCommon.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataCommon.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataDomesticError.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataDomesticError.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataDomesticError.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataDomesticError.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataInstallments.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataInstallments.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataInstallments.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataInstallments.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataNetworkTokens.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataNetworkTokens.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataNetworkTokens.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataNetworkTokens.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataOpi.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataOpi.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataOpi.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataOpi.cs diff --git a/Adyen/Model/Payment/ResponseAdditionalDataSepa.cs b/Adyen/src/Model/Payment/ResponseAdditionalDataSepa.cs similarity index 100% rename from Adyen/Model/Payment/ResponseAdditionalDataSepa.cs rename to Adyen/src/Model/Payment/ResponseAdditionalDataSepa.cs diff --git a/Adyen/Model/Payment/SDKEphemPubKey.cs b/Adyen/src/Model/Payment/SDKEphemPubKey.cs similarity index 100% rename from Adyen/Model/Payment/SDKEphemPubKey.cs rename to Adyen/src/Model/Payment/SDKEphemPubKey.cs diff --git a/Adyen/Model/Payment/SecureRemoteCommerceCheckoutData.cs b/Adyen/src/Model/Payment/SecureRemoteCommerceCheckoutData.cs similarity index 100% rename from Adyen/Model/Payment/SecureRemoteCommerceCheckoutData.cs rename to Adyen/src/Model/Payment/SecureRemoteCommerceCheckoutData.cs diff --git a/Adyen/Model/Payment/ServiceError.cs b/Adyen/src/Model/Payment/ServiceError.cs similarity index 100% rename from Adyen/Model/Payment/ServiceError.cs rename to Adyen/src/Model/Payment/ServiceError.cs diff --git a/Adyen/Model/Payment/ShopperInteractionDevice.cs b/Adyen/src/Model/Payment/ShopperInteractionDevice.cs similarity index 100% rename from Adyen/Model/Payment/ShopperInteractionDevice.cs rename to Adyen/src/Model/Payment/ShopperInteractionDevice.cs diff --git a/Adyen/Model/Payment/Split.cs b/Adyen/src/Model/Payment/Split.cs similarity index 100% rename from Adyen/Model/Payment/Split.cs rename to Adyen/src/Model/Payment/Split.cs diff --git a/Adyen/Model/Payment/SplitAmount.cs b/Adyen/src/Model/Payment/SplitAmount.cs similarity index 100% rename from Adyen/Model/Payment/SplitAmount.cs rename to Adyen/src/Model/Payment/SplitAmount.cs diff --git a/Adyen/Model/Payment/SubMerchant.cs b/Adyen/src/Model/Payment/SubMerchant.cs similarity index 100% rename from Adyen/Model/Payment/SubMerchant.cs rename to Adyen/src/Model/Payment/SubMerchant.cs diff --git a/Adyen/Model/Payment/TechnicalCancelRequest.cs b/Adyen/src/Model/Payment/TechnicalCancelRequest.cs similarity index 100% rename from Adyen/Model/Payment/TechnicalCancelRequest.cs rename to Adyen/src/Model/Payment/TechnicalCancelRequest.cs diff --git a/Adyen/Model/Payment/ThreeDS1Result.cs b/Adyen/src/Model/Payment/ThreeDS1Result.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDS1Result.cs rename to Adyen/src/Model/Payment/ThreeDS1Result.cs diff --git a/Adyen/Model/Payment/ThreeDS2RequestData.cs b/Adyen/src/Model/Payment/ThreeDS2RequestData.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDS2RequestData.cs rename to Adyen/src/Model/Payment/ThreeDS2RequestData.cs diff --git a/Adyen/Model/Payment/ThreeDS2Result.cs b/Adyen/src/Model/Payment/ThreeDS2Result.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDS2Result.cs rename to Adyen/src/Model/Payment/ThreeDS2Result.cs diff --git a/Adyen/Model/Payment/ThreeDS2ResultRequest.cs b/Adyen/src/Model/Payment/ThreeDS2ResultRequest.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDS2ResultRequest.cs rename to Adyen/src/Model/Payment/ThreeDS2ResultRequest.cs diff --git a/Adyen/Model/Payment/ThreeDS2ResultResponse.cs b/Adyen/src/Model/Payment/ThreeDS2ResultResponse.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDS2ResultResponse.cs rename to Adyen/src/Model/Payment/ThreeDS2ResultResponse.cs diff --git a/Adyen/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs b/Adyen/src/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs rename to Adyen/src/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs diff --git a/Adyen/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs b/Adyen/src/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs rename to Adyen/src/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs diff --git a/Adyen/Model/Payment/ThreeDSecureData.cs b/Adyen/src/Model/Payment/ThreeDSecureData.cs similarity index 100% rename from Adyen/Model/Payment/ThreeDSecureData.cs rename to Adyen/src/Model/Payment/ThreeDSecureData.cs diff --git a/Adyen/Model/Payment/VoidPendingRefundRequest.cs b/Adyen/src/Model/Payment/VoidPendingRefundRequest.cs similarity index 100% rename from Adyen/Model/Payment/VoidPendingRefundRequest.cs rename to Adyen/src/Model/Payment/VoidPendingRefundRequest.cs diff --git a/Adyen/Model/PaymentsApp/AbstractOpenAPISchema.cs b/Adyen/src/Model/PaymentsApp/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PaymentsApp/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PaymentsApp/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PaymentsApp/BoardingTokenRequest.cs b/Adyen/src/Model/PaymentsApp/BoardingTokenRequest.cs similarity index 100% rename from Adyen/Model/PaymentsApp/BoardingTokenRequest.cs rename to Adyen/src/Model/PaymentsApp/BoardingTokenRequest.cs diff --git a/Adyen/Model/PaymentsApp/BoardingTokenResponse.cs b/Adyen/src/Model/PaymentsApp/BoardingTokenResponse.cs similarity index 100% rename from Adyen/Model/PaymentsApp/BoardingTokenResponse.cs rename to Adyen/src/Model/PaymentsApp/BoardingTokenResponse.cs diff --git a/Adyen/Model/PaymentsApp/DefaultErrorResponseEntity.cs b/Adyen/src/Model/PaymentsApp/DefaultErrorResponseEntity.cs similarity index 100% rename from Adyen/Model/PaymentsApp/DefaultErrorResponseEntity.cs rename to Adyen/src/Model/PaymentsApp/DefaultErrorResponseEntity.cs diff --git a/Adyen/Model/PaymentsApp/InvalidField.cs b/Adyen/src/Model/PaymentsApp/InvalidField.cs similarity index 100% rename from Adyen/Model/PaymentsApp/InvalidField.cs rename to Adyen/src/Model/PaymentsApp/InvalidField.cs diff --git a/Adyen/Model/PaymentsApp/PaymentsAppDto.cs b/Adyen/src/Model/PaymentsApp/PaymentsAppDto.cs similarity index 100% rename from Adyen/Model/PaymentsApp/PaymentsAppDto.cs rename to Adyen/src/Model/PaymentsApp/PaymentsAppDto.cs diff --git a/Adyen/Model/PaymentsApp/PaymentsAppResponse.cs b/Adyen/src/Model/PaymentsApp/PaymentsAppResponse.cs similarity index 100% rename from Adyen/Model/PaymentsApp/PaymentsAppResponse.cs rename to Adyen/src/Model/PaymentsApp/PaymentsAppResponse.cs diff --git a/Adyen/Model/Payout/AbstractOpenAPISchema.cs b/Adyen/src/Model/Payout/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Payout/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Payout/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Payout/Address.cs b/Adyen/src/Model/Payout/Address.cs similarity index 100% rename from Adyen/Model/Payout/Address.cs rename to Adyen/src/Model/Payout/Address.cs diff --git a/Adyen/Model/Payout/Amount.cs b/Adyen/src/Model/Payout/Amount.cs similarity index 100% rename from Adyen/Model/Payout/Amount.cs rename to Adyen/src/Model/Payout/Amount.cs diff --git a/Adyen/Model/Payout/BankAccount.cs b/Adyen/src/Model/Payout/BankAccount.cs similarity index 100% rename from Adyen/Model/Payout/BankAccount.cs rename to Adyen/src/Model/Payout/BankAccount.cs diff --git a/Adyen/Model/Payout/Card.cs b/Adyen/src/Model/Payout/Card.cs similarity index 100% rename from Adyen/Model/Payout/Card.cs rename to Adyen/src/Model/Payout/Card.cs diff --git a/Adyen/Model/Payout/FraudCheckResult.cs b/Adyen/src/Model/Payout/FraudCheckResult.cs similarity index 100% rename from Adyen/Model/Payout/FraudCheckResult.cs rename to Adyen/src/Model/Payout/FraudCheckResult.cs diff --git a/Adyen/Model/Payout/FraudCheckResultWrapper.cs b/Adyen/src/Model/Payout/FraudCheckResultWrapper.cs similarity index 100% rename from Adyen/Model/Payout/FraudCheckResultWrapper.cs rename to Adyen/src/Model/Payout/FraudCheckResultWrapper.cs diff --git a/Adyen/Model/Payout/FraudResult.cs b/Adyen/src/Model/Payout/FraudResult.cs similarity index 100% rename from Adyen/Model/Payout/FraudResult.cs rename to Adyen/src/Model/Payout/FraudResult.cs diff --git a/Adyen/Model/Payout/FundSource.cs b/Adyen/src/Model/Payout/FundSource.cs similarity index 100% rename from Adyen/Model/Payout/FundSource.cs rename to Adyen/src/Model/Payout/FundSource.cs diff --git a/Adyen/Model/Payout/ModifyRequest.cs b/Adyen/src/Model/Payout/ModifyRequest.cs similarity index 100% rename from Adyen/Model/Payout/ModifyRequest.cs rename to Adyen/src/Model/Payout/ModifyRequest.cs diff --git a/Adyen/Model/Payout/ModifyResponse.cs b/Adyen/src/Model/Payout/ModifyResponse.cs similarity index 100% rename from Adyen/Model/Payout/ModifyResponse.cs rename to Adyen/src/Model/Payout/ModifyResponse.cs diff --git a/Adyen/Model/Payout/Name.cs b/Adyen/src/Model/Payout/Name.cs similarity index 100% rename from Adyen/Model/Payout/Name.cs rename to Adyen/src/Model/Payout/Name.cs diff --git a/Adyen/Model/Payout/PayoutRequest.cs b/Adyen/src/Model/Payout/PayoutRequest.cs similarity index 100% rename from Adyen/Model/Payout/PayoutRequest.cs rename to Adyen/src/Model/Payout/PayoutRequest.cs diff --git a/Adyen/Model/Payout/PayoutResponse.cs b/Adyen/src/Model/Payout/PayoutResponse.cs similarity index 100% rename from Adyen/Model/Payout/PayoutResponse.cs rename to Adyen/src/Model/Payout/PayoutResponse.cs diff --git a/Adyen/Model/Payout/Recurring.cs b/Adyen/src/Model/Payout/Recurring.cs similarity index 100% rename from Adyen/Model/Payout/Recurring.cs rename to Adyen/src/Model/Payout/Recurring.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalData3DSecure.cs b/Adyen/src/Model/Payout/ResponseAdditionalData3DSecure.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalData3DSecure.cs rename to Adyen/src/Model/Payout/ResponseAdditionalData3DSecure.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataBillingAddress.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataBillingAddress.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataBillingAddress.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataBillingAddress.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataCard.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataCard.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataCard.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataCard.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataCommon.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataCommon.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataCommon.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataCommon.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataDomesticError.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataDomesticError.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataDomesticError.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataDomesticError.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataInstallments.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataInstallments.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataInstallments.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataInstallments.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataNetworkTokens.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataNetworkTokens.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataNetworkTokens.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataNetworkTokens.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataOpi.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataOpi.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataOpi.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataOpi.cs diff --git a/Adyen/Model/Payout/ResponseAdditionalDataSepa.cs b/Adyen/src/Model/Payout/ResponseAdditionalDataSepa.cs similarity index 100% rename from Adyen/Model/Payout/ResponseAdditionalDataSepa.cs rename to Adyen/src/Model/Payout/ResponseAdditionalDataSepa.cs diff --git a/Adyen/Model/Payout/ServiceError.cs b/Adyen/src/Model/Payout/ServiceError.cs similarity index 100% rename from Adyen/Model/Payout/ServiceError.cs rename to Adyen/src/Model/Payout/ServiceError.cs diff --git a/Adyen/Model/Payout/StoreDetailAndSubmitRequest.cs b/Adyen/src/Model/Payout/StoreDetailAndSubmitRequest.cs similarity index 100% rename from Adyen/Model/Payout/StoreDetailAndSubmitRequest.cs rename to Adyen/src/Model/Payout/StoreDetailAndSubmitRequest.cs diff --git a/Adyen/Model/Payout/StoreDetailAndSubmitResponse.cs b/Adyen/src/Model/Payout/StoreDetailAndSubmitResponse.cs similarity index 100% rename from Adyen/Model/Payout/StoreDetailAndSubmitResponse.cs rename to Adyen/src/Model/Payout/StoreDetailAndSubmitResponse.cs diff --git a/Adyen/Model/Payout/StoreDetailRequest.cs b/Adyen/src/Model/Payout/StoreDetailRequest.cs similarity index 100% rename from Adyen/Model/Payout/StoreDetailRequest.cs rename to Adyen/src/Model/Payout/StoreDetailRequest.cs diff --git a/Adyen/Model/Payout/StoreDetailResponse.cs b/Adyen/src/Model/Payout/StoreDetailResponse.cs similarity index 100% rename from Adyen/Model/Payout/StoreDetailResponse.cs rename to Adyen/src/Model/Payout/StoreDetailResponse.cs diff --git a/Adyen/Model/Payout/SubmitRequest.cs b/Adyen/src/Model/Payout/SubmitRequest.cs similarity index 100% rename from Adyen/Model/Payout/SubmitRequest.cs rename to Adyen/src/Model/Payout/SubmitRequest.cs diff --git a/Adyen/Model/Payout/SubmitResponse.cs b/Adyen/src/Model/Payout/SubmitResponse.cs similarity index 100% rename from Adyen/Model/Payout/SubmitResponse.cs rename to Adyen/src/Model/Payout/SubmitResponse.cs diff --git a/Adyen/Model/PlatformsAccount/AbstractOpenAPISchema.cs b/Adyen/src/Model/PlatformsAccount/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PlatformsAccount/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PlatformsAccount/Account.cs b/Adyen/src/Model/PlatformsAccount/Account.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/Account.cs rename to Adyen/src/Model/PlatformsAccount/Account.cs diff --git a/Adyen/Model/PlatformsAccount/AccountEvent.cs b/Adyen/src/Model/PlatformsAccount/AccountEvent.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/AccountEvent.cs rename to Adyen/src/Model/PlatformsAccount/AccountEvent.cs diff --git a/Adyen/Model/PlatformsAccount/AccountHolderDetails.cs b/Adyen/src/Model/PlatformsAccount/AccountHolderDetails.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/AccountHolderDetails.cs rename to Adyen/src/Model/PlatformsAccount/AccountHolderDetails.cs diff --git a/Adyen/Model/PlatformsAccount/AccountHolderStatus.cs b/Adyen/src/Model/PlatformsAccount/AccountHolderStatus.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/AccountHolderStatus.cs rename to Adyen/src/Model/PlatformsAccount/AccountHolderStatus.cs diff --git a/Adyen/Model/PlatformsAccount/AccountPayoutState.cs b/Adyen/src/Model/PlatformsAccount/AccountPayoutState.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/AccountPayoutState.cs rename to Adyen/src/Model/PlatformsAccount/AccountPayoutState.cs diff --git a/Adyen/Model/PlatformsAccount/AccountProcessingState.cs b/Adyen/src/Model/PlatformsAccount/AccountProcessingState.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/AccountProcessingState.cs rename to Adyen/src/Model/PlatformsAccount/AccountProcessingState.cs diff --git a/Adyen/Model/PlatformsAccount/Amount.cs b/Adyen/src/Model/PlatformsAccount/Amount.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/Amount.cs rename to Adyen/src/Model/PlatformsAccount/Amount.cs diff --git a/Adyen/Model/PlatformsAccount/BankAccountDetail.cs b/Adyen/src/Model/PlatformsAccount/BankAccountDetail.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/BankAccountDetail.cs rename to Adyen/src/Model/PlatformsAccount/BankAccountDetail.cs diff --git a/Adyen/Model/PlatformsAccount/BusinessDetails.cs b/Adyen/src/Model/PlatformsAccount/BusinessDetails.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/BusinessDetails.cs rename to Adyen/src/Model/PlatformsAccount/BusinessDetails.cs diff --git a/Adyen/Model/PlatformsAccount/CloseAccountHolderRequest.cs b/Adyen/src/Model/PlatformsAccount/CloseAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CloseAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsAccount/CloseAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/CloseAccountHolderResponse.cs b/Adyen/src/Model/PlatformsAccount/CloseAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CloseAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsAccount/CloseAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsAccount/CloseAccountRequest.cs b/Adyen/src/Model/PlatformsAccount/CloseAccountRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CloseAccountRequest.cs rename to Adyen/src/Model/PlatformsAccount/CloseAccountRequest.cs diff --git a/Adyen/Model/PlatformsAccount/CloseAccountResponse.cs b/Adyen/src/Model/PlatformsAccount/CloseAccountResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CloseAccountResponse.cs rename to Adyen/src/Model/PlatformsAccount/CloseAccountResponse.cs diff --git a/Adyen/Model/PlatformsAccount/CloseStoresRequest.cs b/Adyen/src/Model/PlatformsAccount/CloseStoresRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CloseStoresRequest.cs rename to Adyen/src/Model/PlatformsAccount/CloseStoresRequest.cs diff --git a/Adyen/Model/PlatformsAccount/CreateAccountHolderRequest.cs b/Adyen/src/Model/PlatformsAccount/CreateAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CreateAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsAccount/CreateAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/CreateAccountHolderResponse.cs b/Adyen/src/Model/PlatformsAccount/CreateAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CreateAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsAccount/CreateAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsAccount/CreateAccountRequest.cs b/Adyen/src/Model/PlatformsAccount/CreateAccountRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CreateAccountRequest.cs rename to Adyen/src/Model/PlatformsAccount/CreateAccountRequest.cs diff --git a/Adyen/Model/PlatformsAccount/CreateAccountResponse.cs b/Adyen/src/Model/PlatformsAccount/CreateAccountResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/CreateAccountResponse.cs rename to Adyen/src/Model/PlatformsAccount/CreateAccountResponse.cs diff --git a/Adyen/Model/PlatformsAccount/DeleteBankAccountRequest.cs b/Adyen/src/Model/PlatformsAccount/DeleteBankAccountRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/DeleteBankAccountRequest.cs rename to Adyen/src/Model/PlatformsAccount/DeleteBankAccountRequest.cs diff --git a/Adyen/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs b/Adyen/src/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs rename to Adyen/src/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs diff --git a/Adyen/Model/PlatformsAccount/DeletePayoutMethodRequest.cs b/Adyen/src/Model/PlatformsAccount/DeletePayoutMethodRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/DeletePayoutMethodRequest.cs rename to Adyen/src/Model/PlatformsAccount/DeletePayoutMethodRequest.cs diff --git a/Adyen/Model/PlatformsAccount/DeleteShareholderRequest.cs b/Adyen/src/Model/PlatformsAccount/DeleteShareholderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/DeleteShareholderRequest.cs rename to Adyen/src/Model/PlatformsAccount/DeleteShareholderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/DeleteSignatoriesRequest.cs b/Adyen/src/Model/PlatformsAccount/DeleteSignatoriesRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/DeleteSignatoriesRequest.cs rename to Adyen/src/Model/PlatformsAccount/DeleteSignatoriesRequest.cs diff --git a/Adyen/Model/PlatformsAccount/DocumentDetail.cs b/Adyen/src/Model/PlatformsAccount/DocumentDetail.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/DocumentDetail.cs rename to Adyen/src/Model/PlatformsAccount/DocumentDetail.cs diff --git a/Adyen/Model/PlatformsAccount/ErrorFieldType.cs b/Adyen/src/Model/PlatformsAccount/ErrorFieldType.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ErrorFieldType.cs rename to Adyen/src/Model/PlatformsAccount/ErrorFieldType.cs diff --git a/Adyen/Model/PlatformsAccount/FieldType.cs b/Adyen/src/Model/PlatformsAccount/FieldType.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/FieldType.cs rename to Adyen/src/Model/PlatformsAccount/FieldType.cs diff --git a/Adyen/Model/PlatformsAccount/GenericResponse.cs b/Adyen/src/Model/PlatformsAccount/GenericResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GenericResponse.cs rename to Adyen/src/Model/PlatformsAccount/GenericResponse.cs diff --git a/Adyen/Model/PlatformsAccount/GetAccountHolderRequest.cs b/Adyen/src/Model/PlatformsAccount/GetAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsAccount/GetAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/GetAccountHolderResponse.cs b/Adyen/src/Model/PlatformsAccount/GetAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsAccount/GetAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs b/Adyen/src/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs rename to Adyen/src/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs diff --git a/Adyen/Model/PlatformsAccount/GetTaxFormRequest.cs b/Adyen/src/Model/PlatformsAccount/GetTaxFormRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetTaxFormRequest.cs rename to Adyen/src/Model/PlatformsAccount/GetTaxFormRequest.cs diff --git a/Adyen/Model/PlatformsAccount/GetTaxFormResponse.cs b/Adyen/src/Model/PlatformsAccount/GetTaxFormResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetTaxFormResponse.cs rename to Adyen/src/Model/PlatformsAccount/GetTaxFormResponse.cs diff --git a/Adyen/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs b/Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs rename to Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs diff --git a/Adyen/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs b/Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs rename to Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs diff --git a/Adyen/Model/PlatformsAccount/IndividualDetails.cs b/Adyen/src/Model/PlatformsAccount/IndividualDetails.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/IndividualDetails.cs rename to Adyen/src/Model/PlatformsAccount/IndividualDetails.cs diff --git a/Adyen/Model/PlatformsAccount/KYCCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCCheckStatusData.cs b/Adyen/src/Model/PlatformsAccount/KYCCheckStatusData.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCCheckStatusData.cs rename to Adyen/src/Model/PlatformsAccount/KYCCheckStatusData.cs diff --git a/Adyen/Model/PlatformsAccount/KYCCheckSummary.cs b/Adyen/src/Model/PlatformsAccount/KYCCheckSummary.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCCheckSummary.cs rename to Adyen/src/Model/PlatformsAccount/KYCCheckSummary.cs diff --git a/Adyen/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCShareholderCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCShareholderCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCShareholderCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCShareholderCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCSignatoryCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCSignatoryCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCSignatoryCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCSignatoryCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs b/Adyen/src/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs diff --git a/Adyen/Model/PlatformsAccount/KYCVerificationResult.cs b/Adyen/src/Model/PlatformsAccount/KYCVerificationResult.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/KYCVerificationResult.cs rename to Adyen/src/Model/PlatformsAccount/KYCVerificationResult.cs diff --git a/Adyen/Model/PlatformsAccount/LegalArrangementDetail.cs b/Adyen/src/Model/PlatformsAccount/LegalArrangementDetail.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/LegalArrangementDetail.cs rename to Adyen/src/Model/PlatformsAccount/LegalArrangementDetail.cs diff --git a/Adyen/Model/PlatformsAccount/LegalArrangementEntityDetail.cs b/Adyen/src/Model/PlatformsAccount/LegalArrangementEntityDetail.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/LegalArrangementEntityDetail.cs rename to Adyen/src/Model/PlatformsAccount/LegalArrangementEntityDetail.cs diff --git a/Adyen/Model/PlatformsAccount/LegalArrangementRequest.cs b/Adyen/src/Model/PlatformsAccount/LegalArrangementRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/LegalArrangementRequest.cs rename to Adyen/src/Model/PlatformsAccount/LegalArrangementRequest.cs diff --git a/Adyen/Model/PlatformsAccount/MigratedAccounts.cs b/Adyen/src/Model/PlatformsAccount/MigratedAccounts.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/MigratedAccounts.cs rename to Adyen/src/Model/PlatformsAccount/MigratedAccounts.cs diff --git a/Adyen/Model/PlatformsAccount/MigratedShareholders.cs b/Adyen/src/Model/PlatformsAccount/MigratedShareholders.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/MigratedShareholders.cs rename to Adyen/src/Model/PlatformsAccount/MigratedShareholders.cs diff --git a/Adyen/Model/PlatformsAccount/MigratedStores.cs b/Adyen/src/Model/PlatformsAccount/MigratedStores.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/MigratedStores.cs rename to Adyen/src/Model/PlatformsAccount/MigratedStores.cs diff --git a/Adyen/Model/PlatformsAccount/MigrationData.cs b/Adyen/src/Model/PlatformsAccount/MigrationData.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/MigrationData.cs rename to Adyen/src/Model/PlatformsAccount/MigrationData.cs diff --git a/Adyen/Model/PlatformsAccount/PayoutMethod.cs b/Adyen/src/Model/PlatformsAccount/PayoutMethod.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/PayoutMethod.cs rename to Adyen/src/Model/PlatformsAccount/PayoutMethod.cs diff --git a/Adyen/Model/PlatformsAccount/PayoutScheduleResponse.cs b/Adyen/src/Model/PlatformsAccount/PayoutScheduleResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/PayoutScheduleResponse.cs rename to Adyen/src/Model/PlatformsAccount/PayoutScheduleResponse.cs diff --git a/Adyen/Model/PlatformsAccount/PerformVerificationRequest.cs b/Adyen/src/Model/PlatformsAccount/PerformVerificationRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/PerformVerificationRequest.cs rename to Adyen/src/Model/PlatformsAccount/PerformVerificationRequest.cs diff --git a/Adyen/Model/PlatformsAccount/PersonalDocumentData.cs b/Adyen/src/Model/PlatformsAccount/PersonalDocumentData.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/PersonalDocumentData.cs rename to Adyen/src/Model/PlatformsAccount/PersonalDocumentData.cs diff --git a/Adyen/Model/PlatformsAccount/ServiceError.cs b/Adyen/src/Model/PlatformsAccount/ServiceError.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ServiceError.cs rename to Adyen/src/Model/PlatformsAccount/ServiceError.cs diff --git a/Adyen/Model/PlatformsAccount/ShareholderContact.cs b/Adyen/src/Model/PlatformsAccount/ShareholderContact.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ShareholderContact.cs rename to Adyen/src/Model/PlatformsAccount/ShareholderContact.cs diff --git a/Adyen/Model/PlatformsAccount/SignatoryContact.cs b/Adyen/src/Model/PlatformsAccount/SignatoryContact.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/SignatoryContact.cs rename to Adyen/src/Model/PlatformsAccount/SignatoryContact.cs diff --git a/Adyen/Model/PlatformsAccount/StoreDetail.cs b/Adyen/src/Model/PlatformsAccount/StoreDetail.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/StoreDetail.cs rename to Adyen/src/Model/PlatformsAccount/StoreDetail.cs diff --git a/Adyen/Model/PlatformsAccount/SuspendAccountHolderRequest.cs b/Adyen/src/Model/PlatformsAccount/SuspendAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/SuspendAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsAccount/SuspendAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/SuspendAccountHolderResponse.cs b/Adyen/src/Model/PlatformsAccount/SuspendAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/SuspendAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsAccount/SuspendAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsAccount/UltimateParentCompany.cs b/Adyen/src/Model/PlatformsAccount/UltimateParentCompany.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UltimateParentCompany.cs rename to Adyen/src/Model/PlatformsAccount/UltimateParentCompany.cs diff --git a/Adyen/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs b/Adyen/src/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs rename to Adyen/src/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs diff --git a/Adyen/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs b/Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs b/Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsAccount/UpdateAccountHolderRequest.cs b/Adyen/src/Model/PlatformsAccount/UpdateAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UpdateAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsAccount/UpdateAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsAccount/UpdateAccountHolderResponse.cs b/Adyen/src/Model/PlatformsAccount/UpdateAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UpdateAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsAccount/UpdateAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs b/Adyen/src/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs rename to Adyen/src/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs diff --git a/Adyen/Model/PlatformsAccount/UpdateAccountRequest.cs b/Adyen/src/Model/PlatformsAccount/UpdateAccountRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UpdateAccountRequest.cs rename to Adyen/src/Model/PlatformsAccount/UpdateAccountRequest.cs diff --git a/Adyen/Model/PlatformsAccount/UpdateAccountResponse.cs b/Adyen/src/Model/PlatformsAccount/UpdateAccountResponse.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UpdateAccountResponse.cs rename to Adyen/src/Model/PlatformsAccount/UpdateAccountResponse.cs diff --git a/Adyen/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs b/Adyen/src/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs rename to Adyen/src/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs diff --git a/Adyen/Model/PlatformsAccount/UploadDocumentRequest.cs b/Adyen/src/Model/PlatformsAccount/UploadDocumentRequest.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/UploadDocumentRequest.cs rename to Adyen/src/Model/PlatformsAccount/UploadDocumentRequest.cs diff --git a/Adyen/Model/PlatformsAccount/ViasAddress.cs b/Adyen/src/Model/PlatformsAccount/ViasAddress.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ViasAddress.cs rename to Adyen/src/Model/PlatformsAccount/ViasAddress.cs diff --git a/Adyen/Model/PlatformsAccount/ViasName.cs b/Adyen/src/Model/PlatformsAccount/ViasName.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ViasName.cs rename to Adyen/src/Model/PlatformsAccount/ViasName.cs diff --git a/Adyen/Model/PlatformsAccount/ViasPersonalData.cs b/Adyen/src/Model/PlatformsAccount/ViasPersonalData.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ViasPersonalData.cs rename to Adyen/src/Model/PlatformsAccount/ViasPersonalData.cs diff --git a/Adyen/Model/PlatformsAccount/ViasPhoneNumber.cs b/Adyen/src/Model/PlatformsAccount/ViasPhoneNumber.cs similarity index 100% rename from Adyen/Model/PlatformsAccount/ViasPhoneNumber.cs rename to Adyen/src/Model/PlatformsAccount/ViasPhoneNumber.cs diff --git a/Adyen/Model/PlatformsFund/AbstractOpenAPISchema.cs b/Adyen/src/Model/PlatformsFund/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PlatformsFund/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PlatformsFund/AccountDetailBalance.cs b/Adyen/src/Model/PlatformsFund/AccountDetailBalance.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AccountDetailBalance.cs rename to Adyen/src/Model/PlatformsFund/AccountDetailBalance.cs diff --git a/Adyen/Model/PlatformsFund/AccountHolderBalanceRequest.cs b/Adyen/src/Model/PlatformsFund/AccountHolderBalanceRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AccountHolderBalanceRequest.cs rename to Adyen/src/Model/PlatformsFund/AccountHolderBalanceRequest.cs diff --git a/Adyen/Model/PlatformsFund/AccountHolderBalanceResponse.cs b/Adyen/src/Model/PlatformsFund/AccountHolderBalanceResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AccountHolderBalanceResponse.cs rename to Adyen/src/Model/PlatformsFund/AccountHolderBalanceResponse.cs diff --git a/Adyen/Model/PlatformsFund/AccountHolderTransactionListRequest.cs b/Adyen/src/Model/PlatformsFund/AccountHolderTransactionListRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AccountHolderTransactionListRequest.cs rename to Adyen/src/Model/PlatformsFund/AccountHolderTransactionListRequest.cs diff --git a/Adyen/Model/PlatformsFund/AccountHolderTransactionListResponse.cs b/Adyen/src/Model/PlatformsFund/AccountHolderTransactionListResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AccountHolderTransactionListResponse.cs rename to Adyen/src/Model/PlatformsFund/AccountHolderTransactionListResponse.cs diff --git a/Adyen/Model/PlatformsFund/AccountTransactionList.cs b/Adyen/src/Model/PlatformsFund/AccountTransactionList.cs similarity index 100% rename from Adyen/Model/PlatformsFund/AccountTransactionList.cs rename to Adyen/src/Model/PlatformsFund/AccountTransactionList.cs diff --git a/Adyen/Model/PlatformsFund/Amount.cs b/Adyen/src/Model/PlatformsFund/Amount.cs similarity index 100% rename from Adyen/Model/PlatformsFund/Amount.cs rename to Adyen/src/Model/PlatformsFund/Amount.cs diff --git a/Adyen/Model/PlatformsFund/BankAccountDetail.cs b/Adyen/src/Model/PlatformsFund/BankAccountDetail.cs similarity index 100% rename from Adyen/Model/PlatformsFund/BankAccountDetail.cs rename to Adyen/src/Model/PlatformsFund/BankAccountDetail.cs diff --git a/Adyen/Model/PlatformsFund/DebitAccountHolderRequest.cs b/Adyen/src/Model/PlatformsFund/DebitAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/DebitAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsFund/DebitAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsFund/DebitAccountHolderResponse.cs b/Adyen/src/Model/PlatformsFund/DebitAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/DebitAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsFund/DebitAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsFund/DetailBalance.cs b/Adyen/src/Model/PlatformsFund/DetailBalance.cs similarity index 100% rename from Adyen/Model/PlatformsFund/DetailBalance.cs rename to Adyen/src/Model/PlatformsFund/DetailBalance.cs diff --git a/Adyen/Model/PlatformsFund/ErrorFieldType.cs b/Adyen/src/Model/PlatformsFund/ErrorFieldType.cs similarity index 100% rename from Adyen/Model/PlatformsFund/ErrorFieldType.cs rename to Adyen/src/Model/PlatformsFund/ErrorFieldType.cs diff --git a/Adyen/Model/PlatformsFund/FieldType.cs b/Adyen/src/Model/PlatformsFund/FieldType.cs similarity index 100% rename from Adyen/Model/PlatformsFund/FieldType.cs rename to Adyen/src/Model/PlatformsFund/FieldType.cs diff --git a/Adyen/Model/PlatformsFund/PayoutAccountHolderRequest.cs b/Adyen/src/Model/PlatformsFund/PayoutAccountHolderRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/PayoutAccountHolderRequest.cs rename to Adyen/src/Model/PlatformsFund/PayoutAccountHolderRequest.cs diff --git a/Adyen/Model/PlatformsFund/PayoutAccountHolderResponse.cs b/Adyen/src/Model/PlatformsFund/PayoutAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/PayoutAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsFund/PayoutAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsFund/RefundFundsTransferRequest.cs b/Adyen/src/Model/PlatformsFund/RefundFundsTransferRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/RefundFundsTransferRequest.cs rename to Adyen/src/Model/PlatformsFund/RefundFundsTransferRequest.cs diff --git a/Adyen/Model/PlatformsFund/RefundFundsTransferResponse.cs b/Adyen/src/Model/PlatformsFund/RefundFundsTransferResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/RefundFundsTransferResponse.cs rename to Adyen/src/Model/PlatformsFund/RefundFundsTransferResponse.cs diff --git a/Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs b/Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs rename to Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs diff --git a/Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs b/Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs rename to Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs diff --git a/Adyen/Model/PlatformsFund/ServiceError.cs b/Adyen/src/Model/PlatformsFund/ServiceError.cs similarity index 100% rename from Adyen/Model/PlatformsFund/ServiceError.cs rename to Adyen/src/Model/PlatformsFund/ServiceError.cs diff --git a/Adyen/Model/PlatformsFund/SetupBeneficiaryRequest.cs b/Adyen/src/Model/PlatformsFund/SetupBeneficiaryRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/SetupBeneficiaryRequest.cs rename to Adyen/src/Model/PlatformsFund/SetupBeneficiaryRequest.cs diff --git a/Adyen/Model/PlatformsFund/SetupBeneficiaryResponse.cs b/Adyen/src/Model/PlatformsFund/SetupBeneficiaryResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/SetupBeneficiaryResponse.cs rename to Adyen/src/Model/PlatformsFund/SetupBeneficiaryResponse.cs diff --git a/Adyen/Model/PlatformsFund/Split.cs b/Adyen/src/Model/PlatformsFund/Split.cs similarity index 100% rename from Adyen/Model/PlatformsFund/Split.cs rename to Adyen/src/Model/PlatformsFund/Split.cs diff --git a/Adyen/Model/PlatformsFund/SplitAmount.cs b/Adyen/src/Model/PlatformsFund/SplitAmount.cs similarity index 100% rename from Adyen/Model/PlatformsFund/SplitAmount.cs rename to Adyen/src/Model/PlatformsFund/SplitAmount.cs diff --git a/Adyen/Model/PlatformsFund/Transaction.cs b/Adyen/src/Model/PlatformsFund/Transaction.cs similarity index 100% rename from Adyen/Model/PlatformsFund/Transaction.cs rename to Adyen/src/Model/PlatformsFund/Transaction.cs diff --git a/Adyen/Model/PlatformsFund/TransactionListForAccount.cs b/Adyen/src/Model/PlatformsFund/TransactionListForAccount.cs similarity index 100% rename from Adyen/Model/PlatformsFund/TransactionListForAccount.cs rename to Adyen/src/Model/PlatformsFund/TransactionListForAccount.cs diff --git a/Adyen/Model/PlatformsFund/TransferFundsRequest.cs b/Adyen/src/Model/PlatformsFund/TransferFundsRequest.cs similarity index 100% rename from Adyen/Model/PlatformsFund/TransferFundsRequest.cs rename to Adyen/src/Model/PlatformsFund/TransferFundsRequest.cs diff --git a/Adyen/Model/PlatformsFund/TransferFundsResponse.cs b/Adyen/src/Model/PlatformsFund/TransferFundsResponse.cs similarity index 100% rename from Adyen/Model/PlatformsFund/TransferFundsResponse.cs rename to Adyen/src/Model/PlatformsFund/TransferFundsResponse.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/CollectInformation.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/CollectInformation.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/CollectInformation.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/CollectInformation.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/FieldType.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/FieldType.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/FieldType.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/FieldType.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/ServiceError.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/ServiceError.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/ServiceError.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/ServiceError.cs diff --git a/Adyen/Model/PlatformsHostedOnboardingPage/ShowPages.cs b/Adyen/src/Model/PlatformsHostedOnboardingPage/ShowPages.cs similarity index 100% rename from Adyen/Model/PlatformsHostedOnboardingPage/ShowPages.cs rename to Adyen/src/Model/PlatformsHostedOnboardingPage/ShowPages.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/FieldType.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/FieldType.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/FieldType.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/FieldType.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/GenericResponse.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/GenericResponse.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/GenericResponse.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/GenericResponse.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/ServiceError.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/ServiceError.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/ServiceError.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/ServiceError.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs diff --git a/Adyen/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs b/Adyen/src/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs rename to Adyen/src/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs diff --git a/Adyen/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountCloseNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountCloseNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountCloseNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountCloseNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountCreateNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountCreateNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountCreateNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountCreateNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountEvent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountEvent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountEvent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountEvent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderDetails.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderDetails.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderDetails.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderDetails.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderStatus.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderStatus.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderStatus.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderStatus.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountPayoutState.cs b/Adyen/src/Model/PlatformsWebhooks/AccountPayoutState.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountPayoutState.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountPayoutState.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountProcessingState.cs b/Adyen/src/Model/PlatformsWebhooks/AccountProcessingState.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountProcessingState.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountProcessingState.cs diff --git a/Adyen/Model/PlatformsWebhooks/AccountUpdateNotification.cs b/Adyen/src/Model/PlatformsWebhooks/AccountUpdateNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/AccountUpdateNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/AccountUpdateNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/Amount.cs b/Adyen/src/Model/PlatformsWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/Amount.cs rename to Adyen/src/Model/PlatformsWebhooks/Amount.cs diff --git a/Adyen/Model/PlatformsWebhooks/BankAccountDetail.cs b/Adyen/src/Model/PlatformsWebhooks/BankAccountDetail.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/BankAccountDetail.cs rename to Adyen/src/Model/PlatformsWebhooks/BankAccountDetail.cs diff --git a/Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs b/Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/BusinessDetails.cs b/Adyen/src/Model/PlatformsWebhooks/BusinessDetails.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/BusinessDetails.cs rename to Adyen/src/Model/PlatformsWebhooks/BusinessDetails.cs diff --git a/Adyen/Model/PlatformsWebhooks/CloseAccountResponse.cs b/Adyen/src/Model/PlatformsWebhooks/CloseAccountResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/CloseAccountResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/CloseAccountResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs b/Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs b/Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs rename to Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs diff --git a/Adyen/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs b/Adyen/src/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/CreateAccountResponse.cs b/Adyen/src/Model/PlatformsWebhooks/CreateAccountResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/CreateAccountResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/CreateAccountResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs b/Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/ErrorFieldType.cs b/Adyen/src/Model/PlatformsWebhooks/ErrorFieldType.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ErrorFieldType.cs rename to Adyen/src/Model/PlatformsWebhooks/ErrorFieldType.cs diff --git a/Adyen/Model/PlatformsWebhooks/FieldType.cs b/Adyen/src/Model/PlatformsWebhooks/FieldType.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/FieldType.cs rename to Adyen/src/Model/PlatformsWebhooks/FieldType.cs diff --git a/Adyen/Model/PlatformsWebhooks/IndividualDetails.cs b/Adyen/src/Model/PlatformsWebhooks/IndividualDetails.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/IndividualDetails.cs rename to Adyen/src/Model/PlatformsWebhooks/IndividualDetails.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCCheckStatusData.cs b/Adyen/src/Model/PlatformsWebhooks/KYCCheckStatusData.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCCheckStatusData.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCCheckStatusData.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCCheckSummary.cs b/Adyen/src/Model/PlatformsWebhooks/KYCCheckSummary.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCCheckSummary.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCCheckSummary.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/KYCVerificationResult.cs b/Adyen/src/Model/PlatformsWebhooks/KYCVerificationResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/KYCVerificationResult.cs rename to Adyen/src/Model/PlatformsWebhooks/KYCVerificationResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/LegalArrangementDetail.cs b/Adyen/src/Model/PlatformsWebhooks/LegalArrangementDetail.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/LegalArrangementDetail.cs rename to Adyen/src/Model/PlatformsWebhooks/LegalArrangementDetail.cs diff --git a/Adyen/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs b/Adyen/src/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs rename to Adyen/src/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs diff --git a/Adyen/Model/PlatformsWebhooks/LocalDate.cs b/Adyen/src/Model/PlatformsWebhooks/LocalDate.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/LocalDate.cs rename to Adyen/src/Model/PlatformsWebhooks/LocalDate.cs diff --git a/Adyen/Model/PlatformsWebhooks/Message.cs b/Adyen/src/Model/PlatformsWebhooks/Message.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/Message.cs rename to Adyen/src/Model/PlatformsWebhooks/Message.cs diff --git a/Adyen/Model/PlatformsWebhooks/NotificationErrorContainer.cs b/Adyen/src/Model/PlatformsWebhooks/NotificationErrorContainer.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/NotificationErrorContainer.cs rename to Adyen/src/Model/PlatformsWebhooks/NotificationErrorContainer.cs diff --git a/Adyen/Model/PlatformsWebhooks/NotificationResponse.cs b/Adyen/src/Model/PlatformsWebhooks/NotificationResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/NotificationResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/NotificationResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/OperationStatus.cs b/Adyen/src/Model/PlatformsWebhooks/OperationStatus.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/OperationStatus.cs rename to Adyen/src/Model/PlatformsWebhooks/OperationStatus.cs diff --git a/Adyen/Model/PlatformsWebhooks/PaymentFailureNotification.cs b/Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/PaymentFailureNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/PayoutMethod.cs b/Adyen/src/Model/PlatformsWebhooks/PayoutMethod.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/PayoutMethod.cs rename to Adyen/src/Model/PlatformsWebhooks/PayoutMethod.cs diff --git a/Adyen/Model/PlatformsWebhooks/PayoutScheduleResponse.cs b/Adyen/src/Model/PlatformsWebhooks/PayoutScheduleResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/PayoutScheduleResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/PayoutScheduleResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/PersonalDocumentData.cs b/Adyen/src/Model/PlatformsWebhooks/PersonalDocumentData.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/PersonalDocumentData.cs rename to Adyen/src/Model/PlatformsWebhooks/PersonalDocumentData.cs diff --git a/Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs b/Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/RefundResult.cs b/Adyen/src/Model/PlatformsWebhooks/RefundResult.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/RefundResult.cs rename to Adyen/src/Model/PlatformsWebhooks/RefundResult.cs diff --git a/Adyen/Model/PlatformsWebhooks/ReportAvailableNotification.cs b/Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ReportAvailableNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs b/Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/ShareholderContact.cs b/Adyen/src/Model/PlatformsWebhooks/ShareholderContact.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ShareholderContact.cs rename to Adyen/src/Model/PlatformsWebhooks/ShareholderContact.cs diff --git a/Adyen/Model/PlatformsWebhooks/SignatoryContact.cs b/Adyen/src/Model/PlatformsWebhooks/SignatoryContact.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/SignatoryContact.cs rename to Adyen/src/Model/PlatformsWebhooks/SignatoryContact.cs diff --git a/Adyen/Model/PlatformsWebhooks/Split.cs b/Adyen/src/Model/PlatformsWebhooks/Split.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/Split.cs rename to Adyen/src/Model/PlatformsWebhooks/Split.cs diff --git a/Adyen/Model/PlatformsWebhooks/SplitAmount.cs b/Adyen/src/Model/PlatformsWebhooks/SplitAmount.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/SplitAmount.cs rename to Adyen/src/Model/PlatformsWebhooks/SplitAmount.cs diff --git a/Adyen/Model/PlatformsWebhooks/StoreDetail.cs b/Adyen/src/Model/PlatformsWebhooks/StoreDetail.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/StoreDetail.cs rename to Adyen/src/Model/PlatformsWebhooks/StoreDetail.cs diff --git a/Adyen/Model/PlatformsWebhooks/Transaction.cs b/Adyen/src/Model/PlatformsWebhooks/Transaction.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/Transaction.cs rename to Adyen/src/Model/PlatformsWebhooks/Transaction.cs diff --git a/Adyen/Model/PlatformsWebhooks/TransferFundsNotification.cs b/Adyen/src/Model/PlatformsWebhooks/TransferFundsNotification.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/TransferFundsNotification.cs rename to Adyen/src/Model/PlatformsWebhooks/TransferFundsNotification.cs diff --git a/Adyen/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs b/Adyen/src/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs rename to Adyen/src/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs diff --git a/Adyen/Model/PlatformsWebhooks/UltimateParentCompany.cs b/Adyen/src/Model/PlatformsWebhooks/UltimateParentCompany.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/UltimateParentCompany.cs rename to Adyen/src/Model/PlatformsWebhooks/UltimateParentCompany.cs diff --git a/Adyen/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs b/Adyen/src/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs rename to Adyen/src/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs diff --git a/Adyen/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs b/Adyen/src/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/UpdateAccountResponse.cs b/Adyen/src/Model/PlatformsWebhooks/UpdateAccountResponse.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/UpdateAccountResponse.cs rename to Adyen/src/Model/PlatformsWebhooks/UpdateAccountResponse.cs diff --git a/Adyen/Model/PlatformsWebhooks/ViasAddress.cs b/Adyen/src/Model/PlatformsWebhooks/ViasAddress.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ViasAddress.cs rename to Adyen/src/Model/PlatformsWebhooks/ViasAddress.cs diff --git a/Adyen/Model/PlatformsWebhooks/ViasName.cs b/Adyen/src/Model/PlatformsWebhooks/ViasName.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ViasName.cs rename to Adyen/src/Model/PlatformsWebhooks/ViasName.cs diff --git a/Adyen/Model/PlatformsWebhooks/ViasPersonalData.cs b/Adyen/src/Model/PlatformsWebhooks/ViasPersonalData.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ViasPersonalData.cs rename to Adyen/src/Model/PlatformsWebhooks/ViasPersonalData.cs diff --git a/Adyen/Model/PlatformsWebhooks/ViasPhoneNumber.cs b/Adyen/src/Model/PlatformsWebhooks/ViasPhoneNumber.cs similarity index 100% rename from Adyen/Model/PlatformsWebhooks/ViasPhoneNumber.cs rename to Adyen/src/Model/PlatformsWebhooks/ViasPhoneNumber.cs diff --git a/Adyen/Model/PosMobile/AbstractOpenAPISchema.cs b/Adyen/src/Model/PosMobile/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PosMobile/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PosMobile/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PosMobile/CreateSessionRequest.cs b/Adyen/src/Model/PosMobile/CreateSessionRequest.cs similarity index 100% rename from Adyen/Model/PosMobile/CreateSessionRequest.cs rename to Adyen/src/Model/PosMobile/CreateSessionRequest.cs diff --git a/Adyen/Model/PosMobile/CreateSessionResponse.cs b/Adyen/src/Model/PosMobile/CreateSessionResponse.cs similarity index 100% rename from Adyen/Model/PosMobile/CreateSessionResponse.cs rename to Adyen/src/Model/PosMobile/CreateSessionResponse.cs diff --git a/Adyen/Model/PosTerminalManagement/AbstractOpenAPISchema.cs b/Adyen/src/Model/PosTerminalManagement/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/AbstractOpenAPISchema.cs rename to Adyen/src/Model/PosTerminalManagement/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/PosTerminalManagement/Address.cs b/Adyen/src/Model/PosTerminalManagement/Address.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/Address.cs rename to Adyen/src/Model/PosTerminalManagement/Address.cs diff --git a/Adyen/Model/PosTerminalManagement/AssignTerminalsRequest.cs b/Adyen/src/Model/PosTerminalManagement/AssignTerminalsRequest.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/AssignTerminalsRequest.cs rename to Adyen/src/Model/PosTerminalManagement/AssignTerminalsRequest.cs diff --git a/Adyen/Model/PosTerminalManagement/AssignTerminalsResponse.cs b/Adyen/src/Model/PosTerminalManagement/AssignTerminalsResponse.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/AssignTerminalsResponse.cs rename to Adyen/src/Model/PosTerminalManagement/AssignTerminalsResponse.cs diff --git a/Adyen/Model/PosTerminalManagement/FindTerminalRequest.cs b/Adyen/src/Model/PosTerminalManagement/FindTerminalRequest.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/FindTerminalRequest.cs rename to Adyen/src/Model/PosTerminalManagement/FindTerminalRequest.cs diff --git a/Adyen/Model/PosTerminalManagement/FindTerminalResponse.cs b/Adyen/src/Model/PosTerminalManagement/FindTerminalResponse.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/FindTerminalResponse.cs rename to Adyen/src/Model/PosTerminalManagement/FindTerminalResponse.cs diff --git a/Adyen/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs b/Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs rename to Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs diff --git a/Adyen/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs b/Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs rename to Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs diff --git a/Adyen/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs b/Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs rename to Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs diff --git a/Adyen/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs b/Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs rename to Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs diff --git a/Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs b/Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs rename to Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs diff --git a/Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs b/Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs rename to Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs diff --git a/Adyen/Model/PosTerminalManagement/MerchantAccount.cs b/Adyen/src/Model/PosTerminalManagement/MerchantAccount.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/MerchantAccount.cs rename to Adyen/src/Model/PosTerminalManagement/MerchantAccount.cs diff --git a/Adyen/Model/PosTerminalManagement/ServiceError.cs b/Adyen/src/Model/PosTerminalManagement/ServiceError.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/ServiceError.cs rename to Adyen/src/Model/PosTerminalManagement/ServiceError.cs diff --git a/Adyen/Model/PosTerminalManagement/Store.cs b/Adyen/src/Model/PosTerminalManagement/Store.cs similarity index 100% rename from Adyen/Model/PosTerminalManagement/Store.cs rename to Adyen/src/Model/PosTerminalManagement/Store.cs diff --git a/Adyen/Model/Recurring/AbstractOpenAPISchema.cs b/Adyen/src/Model/Recurring/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Recurring/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Recurring/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Recurring/Address.cs b/Adyen/src/Model/Recurring/Address.cs similarity index 100% rename from Adyen/Model/Recurring/Address.cs rename to Adyen/src/Model/Recurring/Address.cs diff --git a/Adyen/Model/Recurring/Amount.cs b/Adyen/src/Model/Recurring/Amount.cs similarity index 100% rename from Adyen/Model/Recurring/Amount.cs rename to Adyen/src/Model/Recurring/Amount.cs diff --git a/Adyen/Model/Recurring/BankAccount.cs b/Adyen/src/Model/Recurring/BankAccount.cs similarity index 100% rename from Adyen/Model/Recurring/BankAccount.cs rename to Adyen/src/Model/Recurring/BankAccount.cs diff --git a/Adyen/Model/Recurring/Card.cs b/Adyen/src/Model/Recurring/Card.cs similarity index 100% rename from Adyen/Model/Recurring/Card.cs rename to Adyen/src/Model/Recurring/Card.cs diff --git a/Adyen/Model/Recurring/CreatePermitRequest.cs b/Adyen/src/Model/Recurring/CreatePermitRequest.cs similarity index 100% rename from Adyen/Model/Recurring/CreatePermitRequest.cs rename to Adyen/src/Model/Recurring/CreatePermitRequest.cs diff --git a/Adyen/Model/Recurring/CreatePermitResult.cs b/Adyen/src/Model/Recurring/CreatePermitResult.cs similarity index 100% rename from Adyen/Model/Recurring/CreatePermitResult.cs rename to Adyen/src/Model/Recurring/CreatePermitResult.cs diff --git a/Adyen/Model/Recurring/DisablePermitRequest.cs b/Adyen/src/Model/Recurring/DisablePermitRequest.cs similarity index 100% rename from Adyen/Model/Recurring/DisablePermitRequest.cs rename to Adyen/src/Model/Recurring/DisablePermitRequest.cs diff --git a/Adyen/Model/Recurring/DisablePermitResult.cs b/Adyen/src/Model/Recurring/DisablePermitResult.cs similarity index 100% rename from Adyen/Model/Recurring/DisablePermitResult.cs rename to Adyen/src/Model/Recurring/DisablePermitResult.cs diff --git a/Adyen/Model/Recurring/DisableRequest.cs b/Adyen/src/Model/Recurring/DisableRequest.cs similarity index 100% rename from Adyen/Model/Recurring/DisableRequest.cs rename to Adyen/src/Model/Recurring/DisableRequest.cs diff --git a/Adyen/Model/Recurring/DisableResult.cs b/Adyen/src/Model/Recurring/DisableResult.cs similarity index 100% rename from Adyen/Model/Recurring/DisableResult.cs rename to Adyen/src/Model/Recurring/DisableResult.cs diff --git a/Adyen/Model/Recurring/Name.cs b/Adyen/src/Model/Recurring/Name.cs similarity index 100% rename from Adyen/Model/Recurring/Name.cs rename to Adyen/src/Model/Recurring/Name.cs diff --git a/Adyen/Model/Recurring/NotifyShopperRequest.cs b/Adyen/src/Model/Recurring/NotifyShopperRequest.cs similarity index 100% rename from Adyen/Model/Recurring/NotifyShopperRequest.cs rename to Adyen/src/Model/Recurring/NotifyShopperRequest.cs diff --git a/Adyen/Model/Recurring/NotifyShopperResult.cs b/Adyen/src/Model/Recurring/NotifyShopperResult.cs similarity index 100% rename from Adyen/Model/Recurring/NotifyShopperResult.cs rename to Adyen/src/Model/Recurring/NotifyShopperResult.cs diff --git a/Adyen/Model/Recurring/Permit.cs b/Adyen/src/Model/Recurring/Permit.cs similarity index 100% rename from Adyen/Model/Recurring/Permit.cs rename to Adyen/src/Model/Recurring/Permit.cs diff --git a/Adyen/Model/Recurring/PermitRestriction.cs b/Adyen/src/Model/Recurring/PermitRestriction.cs similarity index 100% rename from Adyen/Model/Recurring/PermitRestriction.cs rename to Adyen/src/Model/Recurring/PermitRestriction.cs diff --git a/Adyen/Model/Recurring/PermitResult.cs b/Adyen/src/Model/Recurring/PermitResult.cs similarity index 100% rename from Adyen/Model/Recurring/PermitResult.cs rename to Adyen/src/Model/Recurring/PermitResult.cs diff --git a/Adyen/Model/Recurring/Recurring.cs b/Adyen/src/Model/Recurring/Recurring.cs similarity index 100% rename from Adyen/Model/Recurring/Recurring.cs rename to Adyen/src/Model/Recurring/Recurring.cs diff --git a/Adyen/Model/Recurring/RecurringDetail.cs b/Adyen/src/Model/Recurring/RecurringDetail.cs similarity index 100% rename from Adyen/Model/Recurring/RecurringDetail.cs rename to Adyen/src/Model/Recurring/RecurringDetail.cs diff --git a/Adyen/Model/Recurring/RecurringDetailWrapper.cs b/Adyen/src/Model/Recurring/RecurringDetailWrapper.cs similarity index 100% rename from Adyen/Model/Recurring/RecurringDetailWrapper.cs rename to Adyen/src/Model/Recurring/RecurringDetailWrapper.cs diff --git a/Adyen/Model/Recurring/RecurringDetailsRequest.cs b/Adyen/src/Model/Recurring/RecurringDetailsRequest.cs similarity index 100% rename from Adyen/Model/Recurring/RecurringDetailsRequest.cs rename to Adyen/src/Model/Recurring/RecurringDetailsRequest.cs diff --git a/Adyen/Model/Recurring/RecurringDetailsResult.cs b/Adyen/src/Model/Recurring/RecurringDetailsResult.cs similarity index 100% rename from Adyen/Model/Recurring/RecurringDetailsResult.cs rename to Adyen/src/Model/Recurring/RecurringDetailsResult.cs diff --git a/Adyen/Model/Recurring/ScheduleAccountUpdaterRequest.cs b/Adyen/src/Model/Recurring/ScheduleAccountUpdaterRequest.cs similarity index 100% rename from Adyen/Model/Recurring/ScheduleAccountUpdaterRequest.cs rename to Adyen/src/Model/Recurring/ScheduleAccountUpdaterRequest.cs diff --git a/Adyen/Model/Recurring/ScheduleAccountUpdaterResult.cs b/Adyen/src/Model/Recurring/ScheduleAccountUpdaterResult.cs similarity index 100% rename from Adyen/Model/Recurring/ScheduleAccountUpdaterResult.cs rename to Adyen/src/Model/Recurring/ScheduleAccountUpdaterResult.cs diff --git a/Adyen/Model/Recurring/ServiceError.cs b/Adyen/src/Model/Recurring/ServiceError.cs similarity index 100% rename from Adyen/Model/Recurring/ServiceError.cs rename to Adyen/src/Model/Recurring/ServiceError.cs diff --git a/Adyen/Model/Recurring/TokenDetails.cs b/Adyen/src/Model/Recurring/TokenDetails.cs similarity index 100% rename from Adyen/Model/Recurring/TokenDetails.cs rename to Adyen/src/Model/Recurring/TokenDetails.cs diff --git a/Adyen/Model/ReportWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/ReportWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/ReportWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/ReportWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/src/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/src/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/Model/ReportWebhooks/ReportNotificationData.cs b/Adyen/src/Model/ReportWebhooks/ReportNotificationData.cs similarity index 100% rename from Adyen/Model/ReportWebhooks/ReportNotificationData.cs rename to Adyen/src/Model/ReportWebhooks/ReportNotificationData.cs diff --git a/Adyen/Model/ReportWebhooks/ReportNotificationRequest.cs b/Adyen/src/Model/ReportWebhooks/ReportNotificationRequest.cs similarity index 100% rename from Adyen/Model/ReportWebhooks/ReportNotificationRequest.cs rename to Adyen/src/Model/ReportWebhooks/ReportNotificationRequest.cs diff --git a/Adyen/Model/ReportWebhooks/Resource.cs b/Adyen/src/Model/ReportWebhooks/Resource.cs similarity index 100% rename from Adyen/Model/ReportWebhooks/Resource.cs rename to Adyen/src/Model/ReportWebhooks/Resource.cs diff --git a/Adyen/Model/ReportWebhooks/ResourceReference.cs b/Adyen/src/Model/ReportWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/Model/ReportWebhooks/ResourceReference.cs rename to Adyen/src/Model/ReportWebhooks/ResourceReference.cs diff --git a/Adyen/Model/RequestOptions.cs b/Adyen/src/Model/RequestOptions.cs similarity index 100% rename from Adyen/Model/RequestOptions.cs rename to Adyen/src/Model/RequestOptions.cs diff --git a/Adyen/Model/StoredValue/AbstractOpenAPISchema.cs b/Adyen/src/Model/StoredValue/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/StoredValue/AbstractOpenAPISchema.cs rename to Adyen/src/Model/StoredValue/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/StoredValue/Amount.cs b/Adyen/src/Model/StoredValue/Amount.cs similarity index 100% rename from Adyen/Model/StoredValue/Amount.cs rename to Adyen/src/Model/StoredValue/Amount.cs diff --git a/Adyen/Model/StoredValue/ServiceError.cs b/Adyen/src/Model/StoredValue/ServiceError.cs similarity index 100% rename from Adyen/Model/StoredValue/ServiceError.cs rename to Adyen/src/Model/StoredValue/ServiceError.cs diff --git a/Adyen/Model/StoredValue/StoredValueBalanceCheckRequest.cs b/Adyen/src/Model/StoredValue/StoredValueBalanceCheckRequest.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueBalanceCheckRequest.cs rename to Adyen/src/Model/StoredValue/StoredValueBalanceCheckRequest.cs diff --git a/Adyen/Model/StoredValue/StoredValueBalanceCheckResponse.cs b/Adyen/src/Model/StoredValue/StoredValueBalanceCheckResponse.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueBalanceCheckResponse.cs rename to Adyen/src/Model/StoredValue/StoredValueBalanceCheckResponse.cs diff --git a/Adyen/Model/StoredValue/StoredValueBalanceMergeRequest.cs b/Adyen/src/Model/StoredValue/StoredValueBalanceMergeRequest.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueBalanceMergeRequest.cs rename to Adyen/src/Model/StoredValue/StoredValueBalanceMergeRequest.cs diff --git a/Adyen/Model/StoredValue/StoredValueBalanceMergeResponse.cs b/Adyen/src/Model/StoredValue/StoredValueBalanceMergeResponse.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueBalanceMergeResponse.cs rename to Adyen/src/Model/StoredValue/StoredValueBalanceMergeResponse.cs diff --git a/Adyen/Model/StoredValue/StoredValueIssueRequest.cs b/Adyen/src/Model/StoredValue/StoredValueIssueRequest.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueIssueRequest.cs rename to Adyen/src/Model/StoredValue/StoredValueIssueRequest.cs diff --git a/Adyen/Model/StoredValue/StoredValueIssueResponse.cs b/Adyen/src/Model/StoredValue/StoredValueIssueResponse.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueIssueResponse.cs rename to Adyen/src/Model/StoredValue/StoredValueIssueResponse.cs diff --git a/Adyen/Model/StoredValue/StoredValueLoadRequest.cs b/Adyen/src/Model/StoredValue/StoredValueLoadRequest.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueLoadRequest.cs rename to Adyen/src/Model/StoredValue/StoredValueLoadRequest.cs diff --git a/Adyen/Model/StoredValue/StoredValueLoadResponse.cs b/Adyen/src/Model/StoredValue/StoredValueLoadResponse.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueLoadResponse.cs rename to Adyen/src/Model/StoredValue/StoredValueLoadResponse.cs diff --git a/Adyen/Model/StoredValue/StoredValueStatusChangeRequest.cs b/Adyen/src/Model/StoredValue/StoredValueStatusChangeRequest.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueStatusChangeRequest.cs rename to Adyen/src/Model/StoredValue/StoredValueStatusChangeRequest.cs diff --git a/Adyen/Model/StoredValue/StoredValueStatusChangeResponse.cs b/Adyen/src/Model/StoredValue/StoredValueStatusChangeResponse.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueStatusChangeResponse.cs rename to Adyen/src/Model/StoredValue/StoredValueStatusChangeResponse.cs diff --git a/Adyen/Model/StoredValue/StoredValueVoidRequest.cs b/Adyen/src/Model/StoredValue/StoredValueVoidRequest.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueVoidRequest.cs rename to Adyen/src/Model/StoredValue/StoredValueVoidRequest.cs diff --git a/Adyen/Model/StoredValue/StoredValueVoidResponse.cs b/Adyen/src/Model/StoredValue/StoredValueVoidResponse.cs similarity index 100% rename from Adyen/Model/StoredValue/StoredValueVoidResponse.cs rename to Adyen/src/Model/StoredValue/StoredValueVoidResponse.cs diff --git a/Adyen/Model/Terminal/SaleToAcquirerData.cs b/Adyen/src/Model/Terminal/SaleToAcquirerData.cs similarity index 100% rename from Adyen/Model/Terminal/SaleToAcquirerData.cs rename to Adyen/src/Model/Terminal/SaleToAcquirerData.cs diff --git a/Adyen/Model/Terminal/Split.cs b/Adyen/src/Model/Terminal/Split.cs similarity index 100% rename from Adyen/Model/Terminal/Split.cs rename to Adyen/src/Model/Terminal/Split.cs diff --git a/Adyen/Model/Terminal/SplitItem.cs b/Adyen/src/Model/Terminal/SplitItem.cs similarity index 100% rename from Adyen/Model/Terminal/SplitItem.cs rename to Adyen/src/Model/Terminal/SplitItem.cs diff --git a/Adyen/Model/Terminal/SplitItemType.cs b/Adyen/src/Model/Terminal/SplitItemType.cs similarity index 100% rename from Adyen/Model/Terminal/SplitItemType.cs rename to Adyen/src/Model/Terminal/SplitItemType.cs diff --git a/Adyen/Model/TerminalApi/AbortRequest.cs b/Adyen/src/Model/TerminalApi/AbortRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/AbortRequest.cs rename to Adyen/src/Model/TerminalApi/AbortRequest.cs diff --git a/Adyen/Model/TerminalApi/AccountType.cs b/Adyen/src/Model/TerminalApi/AccountType.cs similarity index 100% rename from Adyen/Model/TerminalApi/AccountType.cs rename to Adyen/src/Model/TerminalApi/AccountType.cs diff --git a/Adyen/Model/TerminalApi/AdminRequest.cs b/Adyen/src/Model/TerminalApi/AdminRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/AdminRequest.cs rename to Adyen/src/Model/TerminalApi/AdminRequest.cs diff --git a/Adyen/Model/TerminalApi/AdminResponse.cs b/Adyen/src/Model/TerminalApi/AdminResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/AdminResponse.cs rename to Adyen/src/Model/TerminalApi/AdminResponse.cs diff --git a/Adyen/Model/TerminalApi/AlgorithmIdentifier.cs b/Adyen/src/Model/TerminalApi/AlgorithmIdentifier.cs similarity index 100% rename from Adyen/Model/TerminalApi/AlgorithmIdentifier.cs rename to Adyen/src/Model/TerminalApi/AlgorithmIdentifier.cs diff --git a/Adyen/Model/TerminalApi/AlgorithmType.cs b/Adyen/src/Model/TerminalApi/AlgorithmType.cs similarity index 100% rename from Adyen/Model/TerminalApi/AlgorithmType.cs rename to Adyen/src/Model/TerminalApi/AlgorithmType.cs diff --git a/Adyen/Model/TerminalApi/AlignmentType.cs b/Adyen/src/Model/TerminalApi/AlignmentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/AlignmentType.cs rename to Adyen/src/Model/TerminalApi/AlignmentType.cs diff --git a/Adyen/Model/TerminalApi/AllowedProduct.cs b/Adyen/src/Model/TerminalApi/AllowedProduct.cs similarity index 100% rename from Adyen/Model/TerminalApi/AllowedProduct.cs rename to Adyen/src/Model/TerminalApi/AllowedProduct.cs diff --git a/Adyen/Model/TerminalApi/Amount.cs b/Adyen/src/Model/TerminalApi/Amount.cs similarity index 100% rename from Adyen/Model/TerminalApi/Amount.cs rename to Adyen/src/Model/TerminalApi/Amount.cs diff --git a/Adyen/Model/TerminalApi/AmountsReq.cs b/Adyen/src/Model/TerminalApi/AmountsReq.cs similarity index 100% rename from Adyen/Model/TerminalApi/AmountsReq.cs rename to Adyen/src/Model/TerminalApi/AmountsReq.cs diff --git a/Adyen/Model/TerminalApi/AmountsResp.cs b/Adyen/src/Model/TerminalApi/AmountsResp.cs similarity index 100% rename from Adyen/Model/TerminalApi/AmountsResp.cs rename to Adyen/src/Model/TerminalApi/AmountsResp.cs diff --git a/Adyen/Model/TerminalApi/AreaSize.cs b/Adyen/src/Model/TerminalApi/AreaSize.cs similarity index 100% rename from Adyen/Model/TerminalApi/AreaSize.cs rename to Adyen/src/Model/TerminalApi/AreaSize.cs diff --git a/Adyen/Model/TerminalApi/AuthenticatedData.cs b/Adyen/src/Model/TerminalApi/AuthenticatedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/AuthenticatedData.cs rename to Adyen/src/Model/TerminalApi/AuthenticatedData.cs diff --git a/Adyen/Model/TerminalApi/AuthenticationMethodType.cs b/Adyen/src/Model/TerminalApi/AuthenticationMethodType.cs similarity index 100% rename from Adyen/Model/TerminalApi/AuthenticationMethodType.cs rename to Adyen/src/Model/TerminalApi/AuthenticationMethodType.cs diff --git a/Adyen/Model/TerminalApi/BalanceInquiryRequest.cs b/Adyen/src/Model/TerminalApi/BalanceInquiryRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/BalanceInquiryRequest.cs rename to Adyen/src/Model/TerminalApi/BalanceInquiryRequest.cs diff --git a/Adyen/Model/TerminalApi/BalanceInquiryResponse.cs b/Adyen/src/Model/TerminalApi/BalanceInquiryResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/BalanceInquiryResponse.cs rename to Adyen/src/Model/TerminalApi/BalanceInquiryResponse.cs diff --git a/Adyen/Model/TerminalApi/BarcodeType.cs b/Adyen/src/Model/TerminalApi/BarcodeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/BarcodeType.cs rename to Adyen/src/Model/TerminalApi/BarcodeType.cs diff --git a/Adyen/Model/TerminalApi/BatchRequest.cs b/Adyen/src/Model/TerminalApi/BatchRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/BatchRequest.cs rename to Adyen/src/Model/TerminalApi/BatchRequest.cs diff --git a/Adyen/Model/TerminalApi/BatchResponse.cs b/Adyen/src/Model/TerminalApi/BatchResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/BatchResponse.cs rename to Adyen/src/Model/TerminalApi/BatchResponse.cs diff --git a/Adyen/Model/TerminalApi/CapturedSignature.cs b/Adyen/src/Model/TerminalApi/CapturedSignature.cs similarity index 100% rename from Adyen/Model/TerminalApi/CapturedSignature.cs rename to Adyen/src/Model/TerminalApi/CapturedSignature.cs diff --git a/Adyen/Model/TerminalApi/CardAcquisitionRequest.cs b/Adyen/src/Model/TerminalApi/CardAcquisitionRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardAcquisitionRequest.cs rename to Adyen/src/Model/TerminalApi/CardAcquisitionRequest.cs diff --git a/Adyen/Model/TerminalApi/CardAcquisitionResponse.cs b/Adyen/src/Model/TerminalApi/CardAcquisitionResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardAcquisitionResponse.cs rename to Adyen/src/Model/TerminalApi/CardAcquisitionResponse.cs diff --git a/Adyen/Model/TerminalApi/CardAcquisitionTransaction.cs b/Adyen/src/Model/TerminalApi/CardAcquisitionTransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardAcquisitionTransaction.cs rename to Adyen/src/Model/TerminalApi/CardAcquisitionTransaction.cs diff --git a/Adyen/Model/TerminalApi/CardData.cs b/Adyen/src/Model/TerminalApi/CardData.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardData.cs rename to Adyen/src/Model/TerminalApi/CardData.cs diff --git a/Adyen/Model/TerminalApi/CardReaderAPDURequest.cs b/Adyen/src/Model/TerminalApi/CardReaderAPDURequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderAPDURequest.cs rename to Adyen/src/Model/TerminalApi/CardReaderAPDURequest.cs diff --git a/Adyen/Model/TerminalApi/CardReaderAPDUResponse.cs b/Adyen/src/Model/TerminalApi/CardReaderAPDUResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderAPDUResponse.cs rename to Adyen/src/Model/TerminalApi/CardReaderAPDUResponse.cs diff --git a/Adyen/Model/TerminalApi/CardReaderInitRequest.cs b/Adyen/src/Model/TerminalApi/CardReaderInitRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderInitRequest.cs rename to Adyen/src/Model/TerminalApi/CardReaderInitRequest.cs diff --git a/Adyen/Model/TerminalApi/CardReaderInitResponse.cs b/Adyen/src/Model/TerminalApi/CardReaderInitResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderInitResponse.cs rename to Adyen/src/Model/TerminalApi/CardReaderInitResponse.cs diff --git a/Adyen/Model/TerminalApi/CardReaderPowerOffRequest.cs b/Adyen/src/Model/TerminalApi/CardReaderPowerOffRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderPowerOffRequest.cs rename to Adyen/src/Model/TerminalApi/CardReaderPowerOffRequest.cs diff --git a/Adyen/Model/TerminalApi/CardReaderPowerOffResponse.cs b/Adyen/src/Model/TerminalApi/CardReaderPowerOffResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderPowerOffResponse.cs rename to Adyen/src/Model/TerminalApi/CardReaderPowerOffResponse.cs diff --git a/Adyen/Model/TerminalApi/CardholderPIN.cs b/Adyen/src/Model/TerminalApi/CardholderPIN.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardholderPIN.cs rename to Adyen/src/Model/TerminalApi/CardholderPIN.cs diff --git a/Adyen/Model/TerminalApi/CashHandlingDevice.cs b/Adyen/src/Model/TerminalApi/CashHandlingDevice.cs similarity index 100% rename from Adyen/Model/TerminalApi/CashHandlingDevice.cs rename to Adyen/src/Model/TerminalApi/CashHandlingDevice.cs diff --git a/Adyen/Model/TerminalApi/CharacterHeightType.cs b/Adyen/src/Model/TerminalApi/CharacterHeightType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CharacterHeightType.cs rename to Adyen/src/Model/TerminalApi/CharacterHeightType.cs diff --git a/Adyen/Model/TerminalApi/CharacterStyleType.cs b/Adyen/src/Model/TerminalApi/CharacterStyleType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CharacterStyleType.cs rename to Adyen/src/Model/TerminalApi/CharacterStyleType.cs diff --git a/Adyen/Model/TerminalApi/CharacterWidthType.cs b/Adyen/src/Model/TerminalApi/CharacterWidthType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CharacterWidthType.cs rename to Adyen/src/Model/TerminalApi/CharacterWidthType.cs diff --git a/Adyen/Model/TerminalApi/CheckData.cs b/Adyen/src/Model/TerminalApi/CheckData.cs similarity index 100% rename from Adyen/Model/TerminalApi/CheckData.cs rename to Adyen/src/Model/TerminalApi/CheckData.cs diff --git a/Adyen/Model/TerminalApi/CheckTypeCodeType.cs b/Adyen/src/Model/TerminalApi/CheckTypeCodeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CheckTypeCodeType.cs rename to Adyen/src/Model/TerminalApi/CheckTypeCodeType.cs diff --git a/Adyen/Model/TerminalApi/CoinsOrBills.cs b/Adyen/src/Model/TerminalApi/CoinsOrBills.cs similarity index 100% rename from Adyen/Model/TerminalApi/CoinsOrBills.cs rename to Adyen/src/Model/TerminalApi/CoinsOrBills.cs diff --git a/Adyen/Model/TerminalApi/ColorType.cs b/Adyen/src/Model/TerminalApi/ColorType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ColorType.cs rename to Adyen/src/Model/TerminalApi/ColorType.cs diff --git a/Adyen/Model/TerminalApi/ContentInformation.cs b/Adyen/src/Model/TerminalApi/ContentInformation.cs similarity index 100% rename from Adyen/Model/TerminalApi/ContentInformation.cs rename to Adyen/src/Model/TerminalApi/ContentInformation.cs diff --git a/Adyen/Model/TerminalApi/ContentType.cs b/Adyen/src/Model/TerminalApi/ContentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ContentType.cs rename to Adyen/src/Model/TerminalApi/ContentType.cs diff --git a/Adyen/Model/TerminalApi/CurrencyConversion.cs b/Adyen/src/Model/TerminalApi/CurrencyConversion.cs similarity index 100% rename from Adyen/Model/TerminalApi/CurrencyConversion.cs rename to Adyen/src/Model/TerminalApi/CurrencyConversion.cs diff --git a/Adyen/Model/TerminalApi/CustomerOrder.cs b/Adyen/src/Model/TerminalApi/CustomerOrder.cs similarity index 100% rename from Adyen/Model/TerminalApi/CustomerOrder.cs rename to Adyen/src/Model/TerminalApi/CustomerOrder.cs diff --git a/Adyen/Model/TerminalApi/CustomerOrderReqType.cs b/Adyen/src/Model/TerminalApi/CustomerOrderReqType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CustomerOrderReqType.cs rename to Adyen/src/Model/TerminalApi/CustomerOrderReqType.cs diff --git a/Adyen/Model/TerminalApi/DeviceType.cs b/Adyen/src/Model/TerminalApi/DeviceType.cs similarity index 100% rename from Adyen/Model/TerminalApi/DeviceType.cs rename to Adyen/src/Model/TerminalApi/DeviceType.cs diff --git a/Adyen/Model/TerminalApi/DiagnosisRequest.cs b/Adyen/src/Model/TerminalApi/DiagnosisRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/DiagnosisRequest.cs rename to Adyen/src/Model/TerminalApi/DiagnosisRequest.cs diff --git a/Adyen/Model/TerminalApi/DiagnosisResponse.cs b/Adyen/src/Model/TerminalApi/DiagnosisResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/DiagnosisResponse.cs rename to Adyen/src/Model/TerminalApi/DiagnosisResponse.cs diff --git a/Adyen/Model/TerminalApi/DigestedData.cs b/Adyen/src/Model/TerminalApi/DigestedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/DigestedData.cs rename to Adyen/src/Model/TerminalApi/DigestedData.cs diff --git a/Adyen/Model/TerminalApi/DisplayOutput.cs b/Adyen/src/Model/TerminalApi/DisplayOutput.cs similarity index 100% rename from Adyen/Model/TerminalApi/DisplayOutput.cs rename to Adyen/src/Model/TerminalApi/DisplayOutput.cs diff --git a/Adyen/Model/TerminalApi/DisplayRequest.cs b/Adyen/src/Model/TerminalApi/DisplayRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/DisplayRequest.cs rename to Adyen/src/Model/TerminalApi/DisplayRequest.cs diff --git a/Adyen/Model/TerminalApi/DisplayResponse.cs b/Adyen/src/Model/TerminalApi/DisplayResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/DisplayResponse.cs rename to Adyen/src/Model/TerminalApi/DisplayResponse.cs diff --git a/Adyen/Model/TerminalApi/DocumentQualifierType.cs b/Adyen/src/Model/TerminalApi/DocumentQualifierType.cs similarity index 100% rename from Adyen/Model/TerminalApi/DocumentQualifierType.cs rename to Adyen/src/Model/TerminalApi/DocumentQualifierType.cs diff --git a/Adyen/Model/TerminalApi/EnableServiceRequest.cs b/Adyen/src/Model/TerminalApi/EnableServiceRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/EnableServiceRequest.cs rename to Adyen/src/Model/TerminalApi/EnableServiceRequest.cs diff --git a/Adyen/Model/TerminalApi/EnableServiceResponse.cs b/Adyen/src/Model/TerminalApi/EnableServiceResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/EnableServiceResponse.cs rename to Adyen/src/Model/TerminalApi/EnableServiceResponse.cs diff --git a/Adyen/Model/TerminalApi/EncapsulatedContent.cs b/Adyen/src/Model/TerminalApi/EncapsulatedContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/EncapsulatedContent.cs rename to Adyen/src/Model/TerminalApi/EncapsulatedContent.cs diff --git a/Adyen/Model/TerminalApi/EncryptedContent.cs b/Adyen/src/Model/TerminalApi/EncryptedContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/EncryptedContent.cs rename to Adyen/src/Model/TerminalApi/EncryptedContent.cs diff --git a/Adyen/Model/TerminalApi/EntryModeType.cs b/Adyen/src/Model/TerminalApi/EntryModeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/EntryModeType.cs rename to Adyen/src/Model/TerminalApi/EntryModeType.cs diff --git a/Adyen/Model/TerminalApi/EnvelopedData.cs b/Adyen/src/Model/TerminalApi/EnvelopedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/EnvelopedData.cs rename to Adyen/src/Model/TerminalApi/EnvelopedData.cs diff --git a/Adyen/Model/TerminalApi/ErrorConditionType.cs b/Adyen/src/Model/TerminalApi/ErrorConditionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ErrorConditionType.cs rename to Adyen/src/Model/TerminalApi/ErrorConditionType.cs diff --git a/Adyen/Model/TerminalApi/EventNotification.cs b/Adyen/src/Model/TerminalApi/EventNotification.cs similarity index 100% rename from Adyen/Model/TerminalApi/EventNotification.cs rename to Adyen/src/Model/TerminalApi/EventNotification.cs diff --git a/Adyen/Model/TerminalApi/EventToNotifyType.cs b/Adyen/src/Model/TerminalApi/EventToNotifyType.cs similarity index 100% rename from Adyen/Model/TerminalApi/EventToNotifyType.cs rename to Adyen/src/Model/TerminalApi/EventToNotifyType.cs diff --git a/Adyen/Model/TerminalApi/ForceTypeModeType.cs b/Adyen/src/Model/TerminalApi/ForceTypeModeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ForceTypeModeType.cs rename to Adyen/src/Model/TerminalApi/ForceTypeModeType.cs diff --git a/Adyen/Model/TerminalApi/GenericProfileType.cs b/Adyen/src/Model/TerminalApi/GenericProfileType.cs similarity index 100% rename from Adyen/Model/TerminalApi/GenericProfileType.cs rename to Adyen/src/Model/TerminalApi/GenericProfileType.cs diff --git a/Adyen/Model/TerminalApi/GeographicCoordinates.cs b/Adyen/src/Model/TerminalApi/GeographicCoordinates.cs similarity index 100% rename from Adyen/Model/TerminalApi/GeographicCoordinates.cs rename to Adyen/src/Model/TerminalApi/GeographicCoordinates.cs diff --git a/Adyen/Model/TerminalApi/Geolocation.cs b/Adyen/src/Model/TerminalApi/Geolocation.cs similarity index 100% rename from Adyen/Model/TerminalApi/Geolocation.cs rename to Adyen/src/Model/TerminalApi/Geolocation.cs diff --git a/Adyen/Model/TerminalApi/GetTotalsRequest.cs b/Adyen/src/Model/TerminalApi/GetTotalsRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/GetTotalsRequest.cs rename to Adyen/src/Model/TerminalApi/GetTotalsRequest.cs diff --git a/Adyen/Model/TerminalApi/GetTotalsResponse.cs b/Adyen/src/Model/TerminalApi/GetTotalsResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/GetTotalsResponse.cs rename to Adyen/src/Model/TerminalApi/GetTotalsResponse.cs diff --git a/Adyen/Model/TerminalApi/GlobalStatusType.cs b/Adyen/src/Model/TerminalApi/GlobalStatusType.cs similarity index 100% rename from Adyen/Model/TerminalApi/GlobalStatusType.cs rename to Adyen/src/Model/TerminalApi/GlobalStatusType.cs diff --git a/Adyen/Model/TerminalApi/HostStatus.cs b/Adyen/src/Model/TerminalApi/HostStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/HostStatus.cs rename to Adyen/src/Model/TerminalApi/HostStatus.cs diff --git a/Adyen/Model/TerminalApi/ICCResetData.cs b/Adyen/src/Model/TerminalApi/ICCResetData.cs similarity index 100% rename from Adyen/Model/TerminalApi/ICCResetData.cs rename to Adyen/src/Model/TerminalApi/ICCResetData.cs diff --git a/Adyen/Model/TerminalApi/IdentificationSupportType.cs b/Adyen/src/Model/TerminalApi/IdentificationSupportType.cs similarity index 100% rename from Adyen/Model/TerminalApi/IdentificationSupportType.cs rename to Adyen/src/Model/TerminalApi/IdentificationSupportType.cs diff --git a/Adyen/Model/TerminalApi/IdentificationType.cs b/Adyen/src/Model/TerminalApi/IdentificationType.cs similarity index 100% rename from Adyen/Model/TerminalApi/IdentificationType.cs rename to Adyen/src/Model/TerminalApi/IdentificationType.cs diff --git a/Adyen/Model/TerminalApi/InfoQualifyType.cs b/Adyen/src/Model/TerminalApi/InfoQualifyType.cs similarity index 100% rename from Adyen/Model/TerminalApi/InfoQualifyType.cs rename to Adyen/src/Model/TerminalApi/InfoQualifyType.cs diff --git a/Adyen/Model/TerminalApi/Input.cs b/Adyen/src/Model/TerminalApi/Input.cs similarity index 100% rename from Adyen/Model/TerminalApi/Input.cs rename to Adyen/src/Model/TerminalApi/Input.cs diff --git a/Adyen/Model/TerminalApi/InputCommandType.cs b/Adyen/src/Model/TerminalApi/InputCommandType.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputCommandType.cs rename to Adyen/src/Model/TerminalApi/InputCommandType.cs diff --git a/Adyen/Model/TerminalApi/InputData.cs b/Adyen/src/Model/TerminalApi/InputData.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputData.cs rename to Adyen/src/Model/TerminalApi/InputData.cs diff --git a/Adyen/Model/TerminalApi/InputRequest.cs b/Adyen/src/Model/TerminalApi/InputRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputRequest.cs rename to Adyen/src/Model/TerminalApi/InputRequest.cs diff --git a/Adyen/Model/TerminalApi/InputResponse.cs b/Adyen/src/Model/TerminalApi/InputResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputResponse.cs rename to Adyen/src/Model/TerminalApi/InputResponse.cs diff --git a/Adyen/Model/TerminalApi/InputResult.cs b/Adyen/src/Model/TerminalApi/InputResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputResult.cs rename to Adyen/src/Model/TerminalApi/InputResult.cs diff --git a/Adyen/Model/TerminalApi/InputUpdate.cs b/Adyen/src/Model/TerminalApi/InputUpdate.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputUpdate.cs rename to Adyen/src/Model/TerminalApi/InputUpdate.cs diff --git a/Adyen/Model/TerminalApi/Instalment.cs b/Adyen/src/Model/TerminalApi/Instalment.cs similarity index 100% rename from Adyen/Model/TerminalApi/Instalment.cs rename to Adyen/src/Model/TerminalApi/Instalment.cs diff --git a/Adyen/Model/TerminalApi/IssuerAndSerialNumber.cs b/Adyen/src/Model/TerminalApi/IssuerAndSerialNumber.cs similarity index 100% rename from Adyen/Model/TerminalApi/IssuerAndSerialNumber.cs rename to Adyen/src/Model/TerminalApi/IssuerAndSerialNumber.cs diff --git a/Adyen/Model/TerminalApi/KEK.cs b/Adyen/src/Model/TerminalApi/KEK.cs similarity index 100% rename from Adyen/Model/TerminalApi/KEK.cs rename to Adyen/src/Model/TerminalApi/KEK.cs diff --git a/Adyen/Model/TerminalApi/KEKIdentifier.cs b/Adyen/src/Model/TerminalApi/KEKIdentifier.cs similarity index 100% rename from Adyen/Model/TerminalApi/KEKIdentifier.cs rename to Adyen/src/Model/TerminalApi/KEKIdentifier.cs diff --git a/Adyen/Model/TerminalApi/KeyTransport.cs b/Adyen/src/Model/TerminalApi/KeyTransport.cs similarity index 100% rename from Adyen/Model/TerminalApi/KeyTransport.cs rename to Adyen/src/Model/TerminalApi/KeyTransport.cs diff --git a/Adyen/Model/TerminalApi/LoginRequest.cs b/Adyen/src/Model/TerminalApi/LoginRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoginRequest.cs rename to Adyen/src/Model/TerminalApi/LoginRequest.cs diff --git a/Adyen/Model/TerminalApi/LoginResponse.cs b/Adyen/src/Model/TerminalApi/LoginResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoginResponse.cs rename to Adyen/src/Model/TerminalApi/LoginResponse.cs diff --git a/Adyen/Model/TerminalApi/LogoutRequest.cs b/Adyen/src/Model/TerminalApi/LogoutRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/LogoutRequest.cs rename to Adyen/src/Model/TerminalApi/LogoutRequest.cs diff --git a/Adyen/Model/TerminalApi/LogoutResponse.cs b/Adyen/src/Model/TerminalApi/LogoutResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/LogoutResponse.cs rename to Adyen/src/Model/TerminalApi/LogoutResponse.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAccount.cs b/Adyen/src/Model/TerminalApi/LoyaltyAccount.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAccount.cs rename to Adyen/src/Model/TerminalApi/LoyaltyAccount.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAccountID.cs b/Adyen/src/Model/TerminalApi/LoyaltyAccountID.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAccountID.cs rename to Adyen/src/Model/TerminalApi/LoyaltyAccountID.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAccountReq.cs b/Adyen/src/Model/TerminalApi/LoyaltyAccountReq.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAccountReq.cs rename to Adyen/src/Model/TerminalApi/LoyaltyAccountReq.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAccountStatus.cs b/Adyen/src/Model/TerminalApi/LoyaltyAccountStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAccountStatus.cs rename to Adyen/src/Model/TerminalApi/LoyaltyAccountStatus.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAcquirerData.cs b/Adyen/src/Model/TerminalApi/LoyaltyAcquirerData.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAcquirerData.cs rename to Adyen/src/Model/TerminalApi/LoyaltyAcquirerData.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAmount.cs b/Adyen/src/Model/TerminalApi/LoyaltyAmount.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAmount.cs rename to Adyen/src/Model/TerminalApi/LoyaltyAmount.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyData.cs b/Adyen/src/Model/TerminalApi/LoyaltyData.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyData.cs rename to Adyen/src/Model/TerminalApi/LoyaltyData.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyHandlingType.cs b/Adyen/src/Model/TerminalApi/LoyaltyHandlingType.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyHandlingType.cs rename to Adyen/src/Model/TerminalApi/LoyaltyHandlingType.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyRequest.cs b/Adyen/src/Model/TerminalApi/LoyaltyRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyRequest.cs rename to Adyen/src/Model/TerminalApi/LoyaltyRequest.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyResponse.cs b/Adyen/src/Model/TerminalApi/LoyaltyResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyResponse.cs rename to Adyen/src/Model/TerminalApi/LoyaltyResponse.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyResult.cs b/Adyen/src/Model/TerminalApi/LoyaltyResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyResult.cs rename to Adyen/src/Model/TerminalApi/LoyaltyResult.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyTotals.cs b/Adyen/src/Model/TerminalApi/LoyaltyTotals.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyTotals.cs rename to Adyen/src/Model/TerminalApi/LoyaltyTotals.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyTransaction.cs b/Adyen/src/Model/TerminalApi/LoyaltyTransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyTransaction.cs rename to Adyen/src/Model/TerminalApi/LoyaltyTransaction.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyTransactionType.cs b/Adyen/src/Model/TerminalApi/LoyaltyTransactionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyTransactionType.cs rename to Adyen/src/Model/TerminalApi/LoyaltyTransactionType.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyUnitType.cs b/Adyen/src/Model/TerminalApi/LoyaltyUnitType.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyUnitType.cs rename to Adyen/src/Model/TerminalApi/LoyaltyUnitType.cs diff --git a/Adyen/Model/TerminalApi/MenuEntry.cs b/Adyen/src/Model/TerminalApi/MenuEntry.cs similarity index 100% rename from Adyen/Model/TerminalApi/MenuEntry.cs rename to Adyen/src/Model/TerminalApi/MenuEntry.cs diff --git a/Adyen/Model/TerminalApi/MenuEntryTagType.cs b/Adyen/src/Model/TerminalApi/MenuEntryTagType.cs similarity index 100% rename from Adyen/Model/TerminalApi/MenuEntryTagType.cs rename to Adyen/src/Model/TerminalApi/MenuEntryTagType.cs diff --git a/Adyen/Model/TerminalApi/Message/SaleToPOIRequest.cs b/Adyen/src/Model/TerminalApi/Message/SaleToPOIRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/Message/SaleToPOIRequest.cs rename to Adyen/src/Model/TerminalApi/Message/SaleToPOIRequest.cs diff --git a/Adyen/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs b/Adyen/src/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs similarity index 100% rename from Adyen/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs rename to Adyen/src/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs diff --git a/Adyen/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs b/Adyen/src/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs similarity index 100% rename from Adyen/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs rename to Adyen/src/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs diff --git a/Adyen/Model/TerminalApi/MessageCategoryType.cs b/Adyen/src/Model/TerminalApi/MessageCategoryType.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageCategoryType.cs rename to Adyen/src/Model/TerminalApi/MessageCategoryType.cs diff --git a/Adyen/Model/TerminalApi/MessageClassType.cs b/Adyen/src/Model/TerminalApi/MessageClassType.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageClassType.cs rename to Adyen/src/Model/TerminalApi/MessageClassType.cs diff --git a/Adyen/Model/TerminalApi/MessageHeader.cs b/Adyen/src/Model/TerminalApi/MessageHeader.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageHeader.cs rename to Adyen/src/Model/TerminalApi/MessageHeader.cs diff --git a/Adyen/Model/TerminalApi/MessageReference.cs b/Adyen/src/Model/TerminalApi/MessageReference.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageReference.cs rename to Adyen/src/Model/TerminalApi/MessageReference.cs diff --git a/Adyen/Model/TerminalApi/MessageType.cs b/Adyen/src/Model/TerminalApi/MessageType.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageType.cs rename to Adyen/src/Model/TerminalApi/MessageType.cs diff --git a/Adyen/Model/TerminalApi/MobileData.cs b/Adyen/src/Model/TerminalApi/MobileData.cs similarity index 100% rename from Adyen/Model/TerminalApi/MobileData.cs rename to Adyen/src/Model/TerminalApi/MobileData.cs diff --git a/Adyen/Model/TerminalApi/NamedKeyEncryptedData.cs b/Adyen/src/Model/TerminalApi/NamedKeyEncryptedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/NamedKeyEncryptedData.cs rename to Adyen/src/Model/TerminalApi/NamedKeyEncryptedData.cs diff --git a/Adyen/Model/TerminalApi/OriginalPOITransaction.cs b/Adyen/src/Model/TerminalApi/OriginalPOITransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/OriginalPOITransaction.cs rename to Adyen/src/Model/TerminalApi/OriginalPOITransaction.cs diff --git a/Adyen/Model/TerminalApi/OutputBarcode.cs b/Adyen/src/Model/TerminalApi/OutputBarcode.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputBarcode.cs rename to Adyen/src/Model/TerminalApi/OutputBarcode.cs diff --git a/Adyen/Model/TerminalApi/OutputContent.cs b/Adyen/src/Model/TerminalApi/OutputContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputContent.cs rename to Adyen/src/Model/TerminalApi/OutputContent.cs diff --git a/Adyen/Model/TerminalApi/OutputFormatType.cs b/Adyen/src/Model/TerminalApi/OutputFormatType.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputFormatType.cs rename to Adyen/src/Model/TerminalApi/OutputFormatType.cs diff --git a/Adyen/Model/TerminalApi/OutputResult.cs b/Adyen/src/Model/TerminalApi/OutputResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputResult.cs rename to Adyen/src/Model/TerminalApi/OutputResult.cs diff --git a/Adyen/Model/TerminalApi/OutputText.cs b/Adyen/src/Model/TerminalApi/OutputText.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputText.cs rename to Adyen/src/Model/TerminalApi/OutputText.cs diff --git a/Adyen/Model/TerminalApi/PINFormatType.cs b/Adyen/src/Model/TerminalApi/PINFormatType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PINFormatType.cs rename to Adyen/src/Model/TerminalApi/PINFormatType.cs diff --git a/Adyen/Model/TerminalApi/PINRequest.cs b/Adyen/src/Model/TerminalApi/PINRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/PINRequest.cs rename to Adyen/src/Model/TerminalApi/PINRequest.cs diff --git a/Adyen/Model/TerminalApi/PINRequestType.cs b/Adyen/src/Model/TerminalApi/PINRequestType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PINRequestType.cs rename to Adyen/src/Model/TerminalApi/PINRequestType.cs diff --git a/Adyen/Model/TerminalApi/PINResponse.cs b/Adyen/src/Model/TerminalApi/PINResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/PINResponse.cs rename to Adyen/src/Model/TerminalApi/PINResponse.cs diff --git a/Adyen/Model/TerminalApi/POIData.cs b/Adyen/src/Model/TerminalApi/POIData.cs similarity index 100% rename from Adyen/Model/TerminalApi/POIData.cs rename to Adyen/src/Model/TerminalApi/POIData.cs diff --git a/Adyen/Model/TerminalApi/POIProfile.cs b/Adyen/src/Model/TerminalApi/POIProfile.cs similarity index 100% rename from Adyen/Model/TerminalApi/POIProfile.cs rename to Adyen/src/Model/TerminalApi/POIProfile.cs diff --git a/Adyen/Model/TerminalApi/POISoftware.cs b/Adyen/src/Model/TerminalApi/POISoftware.cs similarity index 100% rename from Adyen/Model/TerminalApi/POISoftware.cs rename to Adyen/src/Model/TerminalApi/POISoftware.cs diff --git a/Adyen/Model/TerminalApi/POIStatus.cs b/Adyen/src/Model/TerminalApi/POIStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/POIStatus.cs rename to Adyen/src/Model/TerminalApi/POIStatus.cs diff --git a/Adyen/Model/TerminalApi/POISystemData.cs b/Adyen/src/Model/TerminalApi/POISystemData.cs similarity index 100% rename from Adyen/Model/TerminalApi/POISystemData.cs rename to Adyen/src/Model/TerminalApi/POISystemData.cs diff --git a/Adyen/Model/TerminalApi/POITerminalData.cs b/Adyen/src/Model/TerminalApi/POITerminalData.cs similarity index 100% rename from Adyen/Model/TerminalApi/POITerminalData.cs rename to Adyen/src/Model/TerminalApi/POITerminalData.cs diff --git a/Adyen/Model/TerminalApi/Parameter.cs b/Adyen/src/Model/TerminalApi/Parameter.cs similarity index 100% rename from Adyen/Model/TerminalApi/Parameter.cs rename to Adyen/src/Model/TerminalApi/Parameter.cs diff --git a/Adyen/Model/TerminalApi/PaymentAccountReq.cs b/Adyen/src/Model/TerminalApi/PaymentAccountReq.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentAccountReq.cs rename to Adyen/src/Model/TerminalApi/PaymentAccountReq.cs diff --git a/Adyen/Model/TerminalApi/PaymentAccountStatus.cs b/Adyen/src/Model/TerminalApi/PaymentAccountStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentAccountStatus.cs rename to Adyen/src/Model/TerminalApi/PaymentAccountStatus.cs diff --git a/Adyen/Model/TerminalApi/PaymentAcquirerData.cs b/Adyen/src/Model/TerminalApi/PaymentAcquirerData.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentAcquirerData.cs rename to Adyen/src/Model/TerminalApi/PaymentAcquirerData.cs diff --git a/Adyen/Model/TerminalApi/PaymentData.cs b/Adyen/src/Model/TerminalApi/PaymentData.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentData.cs rename to Adyen/src/Model/TerminalApi/PaymentData.cs diff --git a/Adyen/Model/TerminalApi/PaymentInstrumentData.cs b/Adyen/src/Model/TerminalApi/PaymentInstrumentData.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentInstrumentData.cs rename to Adyen/src/Model/TerminalApi/PaymentInstrumentData.cs diff --git a/Adyen/Model/TerminalApi/PaymentInstrumentType.cs b/Adyen/src/Model/TerminalApi/PaymentInstrumentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentInstrumentType.cs rename to Adyen/src/Model/TerminalApi/PaymentInstrumentType.cs diff --git a/Adyen/Model/TerminalApi/PaymentReceipt.cs b/Adyen/src/Model/TerminalApi/PaymentReceipt.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentReceipt.cs rename to Adyen/src/Model/TerminalApi/PaymentReceipt.cs diff --git a/Adyen/Model/TerminalApi/PaymentRequest.cs b/Adyen/src/Model/TerminalApi/PaymentRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentRequest.cs rename to Adyen/src/Model/TerminalApi/PaymentRequest.cs diff --git a/Adyen/Model/TerminalApi/PaymentResponse.cs b/Adyen/src/Model/TerminalApi/PaymentResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentResponse.cs rename to Adyen/src/Model/TerminalApi/PaymentResponse.cs diff --git a/Adyen/Model/TerminalApi/PaymentResult.cs b/Adyen/src/Model/TerminalApi/PaymentResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentResult.cs rename to Adyen/src/Model/TerminalApi/PaymentResult.cs diff --git a/Adyen/Model/TerminalApi/PaymentToken.cs b/Adyen/src/Model/TerminalApi/PaymentToken.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentToken.cs rename to Adyen/src/Model/TerminalApi/PaymentToken.cs diff --git a/Adyen/Model/TerminalApi/PaymentTotals.cs b/Adyen/src/Model/TerminalApi/PaymentTotals.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentTotals.cs rename to Adyen/src/Model/TerminalApi/PaymentTotals.cs diff --git a/Adyen/Model/TerminalApi/PaymentTransaction.cs b/Adyen/src/Model/TerminalApi/PaymentTransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentTransaction.cs rename to Adyen/src/Model/TerminalApi/PaymentTransaction.cs diff --git a/Adyen/Model/TerminalApi/PaymentType.cs b/Adyen/src/Model/TerminalApi/PaymentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentType.cs rename to Adyen/src/Model/TerminalApi/PaymentType.cs diff --git a/Adyen/Model/TerminalApi/PerformedTransaction.cs b/Adyen/src/Model/TerminalApi/PerformedTransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/PerformedTransaction.cs rename to Adyen/src/Model/TerminalApi/PerformedTransaction.cs diff --git a/Adyen/Model/TerminalApi/PeriodUnitType.cs b/Adyen/src/Model/TerminalApi/PeriodUnitType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PeriodUnitType.cs rename to Adyen/src/Model/TerminalApi/PeriodUnitType.cs diff --git a/Adyen/Model/TerminalApi/PredefinedContent.cs b/Adyen/src/Model/TerminalApi/PredefinedContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/PredefinedContent.cs rename to Adyen/src/Model/TerminalApi/PredefinedContent.cs diff --git a/Adyen/Model/TerminalApi/PrintOutput.cs b/Adyen/src/Model/TerminalApi/PrintOutput.cs similarity index 100% rename from Adyen/Model/TerminalApi/PrintOutput.cs rename to Adyen/src/Model/TerminalApi/PrintOutput.cs diff --git a/Adyen/Model/TerminalApi/PrintRequest.cs b/Adyen/src/Model/TerminalApi/PrintRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/PrintRequest.cs rename to Adyen/src/Model/TerminalApi/PrintRequest.cs diff --git a/Adyen/Model/TerminalApi/PrintResponse.cs b/Adyen/src/Model/TerminalApi/PrintResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/PrintResponse.cs rename to Adyen/src/Model/TerminalApi/PrintResponse.cs diff --git a/Adyen/Model/TerminalApi/PrinterStatusType.cs b/Adyen/src/Model/TerminalApi/PrinterStatusType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PrinterStatusType.cs rename to Adyen/src/Model/TerminalApi/PrinterStatusType.cs diff --git a/Adyen/Model/TerminalApi/Rebates.cs b/Adyen/src/Model/TerminalApi/Rebates.cs similarity index 100% rename from Adyen/Model/TerminalApi/Rebates.cs rename to Adyen/src/Model/TerminalApi/Rebates.cs diff --git a/Adyen/Model/TerminalApi/RecipientIdentifier.cs b/Adyen/src/Model/TerminalApi/RecipientIdentifier.cs similarity index 100% rename from Adyen/Model/TerminalApi/RecipientIdentifier.cs rename to Adyen/src/Model/TerminalApi/RecipientIdentifier.cs diff --git a/Adyen/Model/TerminalApi/ReconciliationRequest.cs b/Adyen/src/Model/TerminalApi/ReconciliationRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReconciliationRequest.cs rename to Adyen/src/Model/TerminalApi/ReconciliationRequest.cs diff --git a/Adyen/Model/TerminalApi/ReconciliationResponse.cs b/Adyen/src/Model/TerminalApi/ReconciliationResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReconciliationResponse.cs rename to Adyen/src/Model/TerminalApi/ReconciliationResponse.cs diff --git a/Adyen/Model/TerminalApi/ReconciliationType.cs b/Adyen/src/Model/TerminalApi/ReconciliationType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReconciliationType.cs rename to Adyen/src/Model/TerminalApi/ReconciliationType.cs diff --git a/Adyen/Model/TerminalApi/RelativeDistinguishedName.cs b/Adyen/src/Model/TerminalApi/RelativeDistinguishedName.cs similarity index 100% rename from Adyen/Model/TerminalApi/RelativeDistinguishedName.cs rename to Adyen/src/Model/TerminalApi/RelativeDistinguishedName.cs diff --git a/Adyen/Model/TerminalApi/RepeatedMessageResponse.cs b/Adyen/src/Model/TerminalApi/RepeatedMessageResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/RepeatedMessageResponse.cs rename to Adyen/src/Model/TerminalApi/RepeatedMessageResponse.cs diff --git a/Adyen/Model/TerminalApi/RepeatedResponseMessageBody.cs b/Adyen/src/Model/TerminalApi/RepeatedResponseMessageBody.cs similarity index 100% rename from Adyen/Model/TerminalApi/RepeatedResponseMessageBody.cs rename to Adyen/src/Model/TerminalApi/RepeatedResponseMessageBody.cs diff --git a/Adyen/Model/TerminalApi/Response.cs b/Adyen/src/Model/TerminalApi/Response.cs similarity index 100% rename from Adyen/Model/TerminalApi/Response.cs rename to Adyen/src/Model/TerminalApi/Response.cs diff --git a/Adyen/Model/TerminalApi/ResponseModeType.cs b/Adyen/src/Model/TerminalApi/ResponseModeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ResponseModeType.cs rename to Adyen/src/Model/TerminalApi/ResponseModeType.cs diff --git a/Adyen/Model/TerminalApi/ResultType.cs b/Adyen/src/Model/TerminalApi/ResultType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ResultType.cs rename to Adyen/src/Model/TerminalApi/ResultType.cs diff --git a/Adyen/Model/TerminalApi/ReversalReasonType.cs b/Adyen/src/Model/TerminalApi/ReversalReasonType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReversalReasonType.cs rename to Adyen/src/Model/TerminalApi/ReversalReasonType.cs diff --git a/Adyen/Model/TerminalApi/ReversalRequest.cs b/Adyen/src/Model/TerminalApi/ReversalRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReversalRequest.cs rename to Adyen/src/Model/TerminalApi/ReversalRequest.cs diff --git a/Adyen/Model/TerminalApi/ReversalResponse.cs b/Adyen/src/Model/TerminalApi/ReversalResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReversalResponse.cs rename to Adyen/src/Model/TerminalApi/ReversalResponse.cs diff --git a/Adyen/Model/TerminalApi/SaleData.cs b/Adyen/src/Model/TerminalApi/SaleData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleData.cs rename to Adyen/src/Model/TerminalApi/SaleData.cs diff --git a/Adyen/Model/TerminalApi/SaleItem.cs b/Adyen/src/Model/TerminalApi/SaleItem.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleItem.cs rename to Adyen/src/Model/TerminalApi/SaleItem.cs diff --git a/Adyen/Model/TerminalApi/SaleItemRebate.cs b/Adyen/src/Model/TerminalApi/SaleItemRebate.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleItemRebate.cs rename to Adyen/src/Model/TerminalApi/SaleItemRebate.cs diff --git a/Adyen/Model/TerminalApi/SaleProfile.cs b/Adyen/src/Model/TerminalApi/SaleProfile.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleProfile.cs rename to Adyen/src/Model/TerminalApi/SaleProfile.cs diff --git a/Adyen/Model/TerminalApi/SaleSoftware.cs b/Adyen/src/Model/TerminalApi/SaleSoftware.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleSoftware.cs rename to Adyen/src/Model/TerminalApi/SaleSoftware.cs diff --git a/Adyen/Model/TerminalApi/SaleTerminalData.cs b/Adyen/src/Model/TerminalApi/SaleTerminalData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleTerminalData.cs rename to Adyen/src/Model/TerminalApi/SaleTerminalData.cs diff --git a/Adyen/Model/TerminalApi/SaleToIssuerData.cs b/Adyen/src/Model/TerminalApi/SaleToIssuerData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleToIssuerData.cs rename to Adyen/src/Model/TerminalApi/SaleToIssuerData.cs diff --git a/Adyen/Model/TerminalApi/SaleToPOIMessage.cs b/Adyen/src/Model/TerminalApi/SaleToPOIMessage.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleToPOIMessage.cs rename to Adyen/src/Model/TerminalApi/SaleToPOIMessage.cs diff --git a/Adyen/Model/TerminalApi/SaleToPOIResponse.cs b/Adyen/src/Model/TerminalApi/SaleToPOIResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleToPOIResponse.cs rename to Adyen/src/Model/TerminalApi/SaleToPOIResponse.cs diff --git a/Adyen/Model/TerminalApi/SensitiveCardData.cs b/Adyen/src/Model/TerminalApi/SensitiveCardData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SensitiveCardData.cs rename to Adyen/src/Model/TerminalApi/SensitiveCardData.cs diff --git a/Adyen/Model/TerminalApi/SensitiveMobileData.cs b/Adyen/src/Model/TerminalApi/SensitiveMobileData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SensitiveMobileData.cs rename to Adyen/src/Model/TerminalApi/SensitiveMobileData.cs diff --git a/Adyen/Model/TerminalApi/SignaturePoint.cs b/Adyen/src/Model/TerminalApi/SignaturePoint.cs similarity index 100% rename from Adyen/Model/TerminalApi/SignaturePoint.cs rename to Adyen/src/Model/TerminalApi/SignaturePoint.cs diff --git a/Adyen/Model/TerminalApi/SignedData.cs b/Adyen/src/Model/TerminalApi/SignedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SignedData.cs rename to Adyen/src/Model/TerminalApi/SignedData.cs diff --git a/Adyen/Model/TerminalApi/Signer.cs b/Adyen/src/Model/TerminalApi/Signer.cs similarity index 100% rename from Adyen/Model/TerminalApi/Signer.cs rename to Adyen/src/Model/TerminalApi/Signer.cs diff --git a/Adyen/Model/TerminalApi/SignerIdentifier.cs b/Adyen/src/Model/TerminalApi/SignerIdentifier.cs similarity index 100% rename from Adyen/Model/TerminalApi/SignerIdentifier.cs rename to Adyen/src/Model/TerminalApi/SignerIdentifier.cs diff --git a/Adyen/Model/TerminalApi/SoundActionType.cs b/Adyen/src/Model/TerminalApi/SoundActionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundActionType.cs rename to Adyen/src/Model/TerminalApi/SoundActionType.cs diff --git a/Adyen/Model/TerminalApi/SoundContent.cs b/Adyen/src/Model/TerminalApi/SoundContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundContent.cs rename to Adyen/src/Model/TerminalApi/SoundContent.cs diff --git a/Adyen/Model/TerminalApi/SoundFormatType.cs b/Adyen/src/Model/TerminalApi/SoundFormatType.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundFormatType.cs rename to Adyen/src/Model/TerminalApi/SoundFormatType.cs diff --git a/Adyen/Model/TerminalApi/SoundRequest.cs b/Adyen/src/Model/TerminalApi/SoundRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundRequest.cs rename to Adyen/src/Model/TerminalApi/SoundRequest.cs diff --git a/Adyen/Model/TerminalApi/SoundResponse.cs b/Adyen/src/Model/TerminalApi/SoundResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundResponse.cs rename to Adyen/src/Model/TerminalApi/SoundResponse.cs diff --git a/Adyen/Model/TerminalApi/SponsoredMerchant.cs b/Adyen/src/Model/TerminalApi/SponsoredMerchant.cs similarity index 100% rename from Adyen/Model/TerminalApi/SponsoredMerchant.cs rename to Adyen/src/Model/TerminalApi/SponsoredMerchant.cs diff --git a/Adyen/Model/TerminalApi/StoredValueAccountID.cs b/Adyen/src/Model/TerminalApi/StoredValueAccountID.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueAccountID.cs rename to Adyen/src/Model/TerminalApi/StoredValueAccountID.cs diff --git a/Adyen/Model/TerminalApi/StoredValueAccountStatus.cs b/Adyen/src/Model/TerminalApi/StoredValueAccountStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueAccountStatus.cs rename to Adyen/src/Model/TerminalApi/StoredValueAccountStatus.cs diff --git a/Adyen/Model/TerminalApi/StoredValueAccountType.cs b/Adyen/src/Model/TerminalApi/StoredValueAccountType.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueAccountType.cs rename to Adyen/src/Model/TerminalApi/StoredValueAccountType.cs diff --git a/Adyen/Model/TerminalApi/StoredValueData.cs b/Adyen/src/Model/TerminalApi/StoredValueData.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueData.cs rename to Adyen/src/Model/TerminalApi/StoredValueData.cs diff --git a/Adyen/Model/TerminalApi/StoredValueRequest.cs b/Adyen/src/Model/TerminalApi/StoredValueRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueRequest.cs rename to Adyen/src/Model/TerminalApi/StoredValueRequest.cs diff --git a/Adyen/Model/TerminalApi/StoredValueResponse.cs b/Adyen/src/Model/TerminalApi/StoredValueResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueResponse.cs rename to Adyen/src/Model/TerminalApi/StoredValueResponse.cs diff --git a/Adyen/Model/TerminalApi/StoredValueResult.cs b/Adyen/src/Model/TerminalApi/StoredValueResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueResult.cs rename to Adyen/src/Model/TerminalApi/StoredValueResult.cs diff --git a/Adyen/Model/TerminalApi/StoredValueTransactionType.cs b/Adyen/src/Model/TerminalApi/StoredValueTransactionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueTransactionType.cs rename to Adyen/src/Model/TerminalApi/StoredValueTransactionType.cs diff --git a/Adyen/Model/TerminalApi/TerminalEnvironmentType.cs b/Adyen/src/Model/TerminalApi/TerminalEnvironmentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TerminalEnvironmentType.cs rename to Adyen/src/Model/TerminalApi/TerminalEnvironmentType.cs diff --git a/Adyen/Model/TerminalApi/TokenRequestedType.cs b/Adyen/src/Model/TerminalApi/TokenRequestedType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TokenRequestedType.cs rename to Adyen/src/Model/TerminalApi/TokenRequestedType.cs diff --git a/Adyen/Model/TerminalApi/TotalDetailsType.cs b/Adyen/src/Model/TerminalApi/TotalDetailsType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TotalDetailsType.cs rename to Adyen/src/Model/TerminalApi/TotalDetailsType.cs diff --git a/Adyen/Model/TerminalApi/TotalFilter.cs b/Adyen/src/Model/TerminalApi/TotalFilter.cs similarity index 100% rename from Adyen/Model/TerminalApi/TotalFilter.cs rename to Adyen/src/Model/TerminalApi/TotalFilter.cs diff --git a/Adyen/Model/TerminalApi/TrackData.cs b/Adyen/src/Model/TerminalApi/TrackData.cs similarity index 100% rename from Adyen/Model/TerminalApi/TrackData.cs rename to Adyen/src/Model/TerminalApi/TrackData.cs diff --git a/Adyen/Model/TerminalApi/TrackFormatType.cs b/Adyen/src/Model/TerminalApi/TrackFormatType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TrackFormatType.cs rename to Adyen/src/Model/TerminalApi/TrackFormatType.cs diff --git a/Adyen/Model/TerminalApi/TransactionActionType.cs b/Adyen/src/Model/TerminalApi/TransactionActionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionActionType.cs rename to Adyen/src/Model/TerminalApi/TransactionActionType.cs diff --git a/Adyen/Model/TerminalApi/TransactionConditions.cs b/Adyen/src/Model/TerminalApi/TransactionConditions.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionConditions.cs rename to Adyen/src/Model/TerminalApi/TransactionConditions.cs diff --git a/Adyen/Model/TerminalApi/TransactionIdentification.cs b/Adyen/src/Model/TerminalApi/TransactionIdentification.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionIdentification.cs rename to Adyen/src/Model/TerminalApi/TransactionIdentification.cs diff --git a/Adyen/Model/TerminalApi/TransactionStatusRequest.cs b/Adyen/src/Model/TerminalApi/TransactionStatusRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionStatusRequest.cs rename to Adyen/src/Model/TerminalApi/TransactionStatusRequest.cs diff --git a/Adyen/Model/TerminalApi/TransactionStatusResponse.cs b/Adyen/src/Model/TerminalApi/TransactionStatusResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionStatusResponse.cs rename to Adyen/src/Model/TerminalApi/TransactionStatusResponse.cs diff --git a/Adyen/Model/TerminalApi/TransactionToPerform.cs b/Adyen/src/Model/TerminalApi/TransactionToPerform.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionToPerform.cs rename to Adyen/src/Model/TerminalApi/TransactionToPerform.cs diff --git a/Adyen/Model/TerminalApi/TransactionTotals.cs b/Adyen/src/Model/TerminalApi/TransactionTotals.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionTotals.cs rename to Adyen/src/Model/TerminalApi/TransactionTotals.cs diff --git a/Adyen/Model/TerminalApi/TransactionType.cs b/Adyen/src/Model/TerminalApi/TransactionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionType.cs rename to Adyen/src/Model/TerminalApi/TransactionType.cs diff --git a/Adyen/Model/TerminalApi/TransmitRequest.cs b/Adyen/src/Model/TerminalApi/TransmitRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransmitRequest.cs rename to Adyen/src/Model/TerminalApi/TransmitRequest.cs diff --git a/Adyen/Model/TerminalApi/TransmitResponse.cs b/Adyen/src/Model/TerminalApi/TransmitResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransmitResponse.cs rename to Adyen/src/Model/TerminalApi/TransmitResponse.cs diff --git a/Adyen/Model/TerminalApi/UTMCoordinates.cs b/Adyen/src/Model/TerminalApi/UTMCoordinates.cs similarity index 100% rename from Adyen/Model/TerminalApi/UTMCoordinates.cs rename to Adyen/src/Model/TerminalApi/UTMCoordinates.cs diff --git a/Adyen/Model/TerminalApi/UnitOfMeasureType.cs b/Adyen/src/Model/TerminalApi/UnitOfMeasureType.cs similarity index 100% rename from Adyen/Model/TerminalApi/UnitOfMeasureType.cs rename to Adyen/src/Model/TerminalApi/UnitOfMeasureType.cs diff --git a/Adyen/Model/TerminalApi/VersionType.cs b/Adyen/src/Model/TerminalApi/VersionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/VersionType.cs rename to Adyen/src/Model/TerminalApi/VersionType.cs diff --git a/Adyen/Model/TransactionWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/TransactionWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/TransactionWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/TransactionWebhooks/Amount.cs b/Adyen/src/Model/TransactionWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/Amount.cs rename to Adyen/src/Model/TransactionWebhooks/Amount.cs diff --git a/Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/src/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/src/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/Model/TransactionWebhooks/BankCategoryData.cs b/Adyen/src/Model/TransactionWebhooks/BankCategoryData.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/BankCategoryData.cs rename to Adyen/src/Model/TransactionWebhooks/BankCategoryData.cs diff --git a/Adyen/Model/TransactionWebhooks/InternalCategoryData.cs b/Adyen/src/Model/TransactionWebhooks/InternalCategoryData.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/InternalCategoryData.cs rename to Adyen/src/Model/TransactionWebhooks/InternalCategoryData.cs diff --git a/Adyen/Model/TransactionWebhooks/IssuedCard.cs b/Adyen/src/Model/TransactionWebhooks/IssuedCard.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/IssuedCard.cs rename to Adyen/src/Model/TransactionWebhooks/IssuedCard.cs diff --git a/Adyen/Model/TransactionWebhooks/PaymentInstrument.cs b/Adyen/src/Model/TransactionWebhooks/PaymentInstrument.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/PaymentInstrument.cs rename to Adyen/src/Model/TransactionWebhooks/PaymentInstrument.cs diff --git a/Adyen/Model/TransactionWebhooks/PlatformPayment.cs b/Adyen/src/Model/TransactionWebhooks/PlatformPayment.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/PlatformPayment.cs rename to Adyen/src/Model/TransactionWebhooks/PlatformPayment.cs diff --git a/Adyen/Model/TransactionWebhooks/RelayedAuthorisationData.cs b/Adyen/src/Model/TransactionWebhooks/RelayedAuthorisationData.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/RelayedAuthorisationData.cs rename to Adyen/src/Model/TransactionWebhooks/RelayedAuthorisationData.cs diff --git a/Adyen/Model/TransactionWebhooks/Resource.cs b/Adyen/src/Model/TransactionWebhooks/Resource.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/Resource.cs rename to Adyen/src/Model/TransactionWebhooks/Resource.cs diff --git a/Adyen/Model/TransactionWebhooks/ResourceReference.cs b/Adyen/src/Model/TransactionWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/ResourceReference.cs rename to Adyen/src/Model/TransactionWebhooks/ResourceReference.cs diff --git a/Adyen/Model/TransactionWebhooks/ThreeDSecure.cs b/Adyen/src/Model/TransactionWebhooks/ThreeDSecure.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/ThreeDSecure.cs rename to Adyen/src/Model/TransactionWebhooks/ThreeDSecure.cs diff --git a/Adyen/Model/TransactionWebhooks/Transaction.cs b/Adyen/src/Model/TransactionWebhooks/Transaction.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/Transaction.cs rename to Adyen/src/Model/TransactionWebhooks/Transaction.cs diff --git a/Adyen/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs b/Adyen/src/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs rename to Adyen/src/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs diff --git a/Adyen/Model/TransactionWebhooks/TransferNotificationValidationFact.cs b/Adyen/src/Model/TransactionWebhooks/TransferNotificationValidationFact.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/TransferNotificationValidationFact.cs rename to Adyen/src/Model/TransactionWebhooks/TransferNotificationValidationFact.cs diff --git a/Adyen/Model/TransactionWebhooks/TransferView.cs b/Adyen/src/Model/TransactionWebhooks/TransferView.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/TransferView.cs rename to Adyen/src/Model/TransactionWebhooks/TransferView.cs diff --git a/Adyen/Model/TransactionWebhooks/TransferViewCategoryData.cs b/Adyen/src/Model/TransactionWebhooks/TransferViewCategoryData.cs similarity index 100% rename from Adyen/Model/TransactionWebhooks/TransferViewCategoryData.cs rename to Adyen/src/Model/TransactionWebhooks/TransferViewCategoryData.cs diff --git a/Adyen/Model/TransferWebhooks/AULocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/AULocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/AULocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/AbstractOpenAPISchema.cs b/Adyen/src/Model/TransferWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/AbstractOpenAPISchema.cs rename to Adyen/src/Model/TransferWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/TransferWebhooks/AdditionalBankIdentification.cs b/Adyen/src/Model/TransferWebhooks/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/AdditionalBankIdentification.cs rename to Adyen/src/Model/TransferWebhooks/AdditionalBankIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/Address.cs b/Adyen/src/Model/TransferWebhooks/Address.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Address.cs rename to Adyen/src/Model/TransferWebhooks/Address.cs diff --git a/Adyen/Model/TransferWebhooks/Airline.cs b/Adyen/src/Model/TransferWebhooks/Airline.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Airline.cs rename to Adyen/src/Model/TransferWebhooks/Airline.cs diff --git a/Adyen/Model/TransferWebhooks/Amount.cs b/Adyen/src/Model/TransferWebhooks/Amount.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Amount.cs rename to Adyen/src/Model/TransferWebhooks/Amount.cs diff --git a/Adyen/Model/TransferWebhooks/AmountAdjustment.cs b/Adyen/src/Model/TransferWebhooks/AmountAdjustment.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/AmountAdjustment.cs rename to Adyen/src/Model/TransferWebhooks/AmountAdjustment.cs diff --git a/Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/BRLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/BRLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/BalanceMutation.cs b/Adyen/src/Model/TransferWebhooks/BalanceMutation.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/BalanceMutation.cs rename to Adyen/src/Model/TransferWebhooks/BalanceMutation.cs diff --git a/Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/src/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/src/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/Model/TransferWebhooks/BankAccountV3.cs b/Adyen/src/Model/TransferWebhooks/BankAccountV3.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/BankAccountV3.cs rename to Adyen/src/Model/TransferWebhooks/BankAccountV3.cs diff --git a/Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/BankCategoryData.cs b/Adyen/src/Model/TransferWebhooks/BankCategoryData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/BankCategoryData.cs rename to Adyen/src/Model/TransferWebhooks/BankCategoryData.cs diff --git a/Adyen/Model/TransferWebhooks/CALocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/CALocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/CALocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/CZLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/Card.cs b/Adyen/src/Model/TransferWebhooks/Card.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Card.cs rename to Adyen/src/Model/TransferWebhooks/Card.cs diff --git a/Adyen/Model/TransferWebhooks/CardIdentification.cs b/Adyen/src/Model/TransferWebhooks/CardIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/CardIdentification.cs rename to Adyen/src/Model/TransferWebhooks/CardIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/ConfirmationTrackingData.cs b/Adyen/src/Model/TransferWebhooks/ConfirmationTrackingData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/ConfirmationTrackingData.cs rename to Adyen/src/Model/TransferWebhooks/ConfirmationTrackingData.cs diff --git a/Adyen/Model/TransferWebhooks/CounterpartyV3.cs b/Adyen/src/Model/TransferWebhooks/CounterpartyV3.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/CounterpartyV3.cs rename to Adyen/src/Model/TransferWebhooks/CounterpartyV3.cs diff --git a/Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/DKLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/DirectDebitInformation.cs b/Adyen/src/Model/TransferWebhooks/DirectDebitInformation.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/DirectDebitInformation.cs rename to Adyen/src/Model/TransferWebhooks/DirectDebitInformation.cs diff --git a/Adyen/Model/TransferWebhooks/EstimationTrackingData.cs b/Adyen/src/Model/TransferWebhooks/EstimationTrackingData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/EstimationTrackingData.cs rename to Adyen/src/Model/TransferWebhooks/EstimationTrackingData.cs diff --git a/Adyen/Model/TransferWebhooks/ExternalReason.cs b/Adyen/src/Model/TransferWebhooks/ExternalReason.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/ExternalReason.cs rename to Adyen/src/Model/TransferWebhooks/ExternalReason.cs diff --git a/Adyen/Model/TransferWebhooks/HKLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/HKLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/HKLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/HULocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/HULocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/HULocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/IbanAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/IbanAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/IbanAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/IbanAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/InternalCategoryData.cs b/Adyen/src/Model/TransferWebhooks/InternalCategoryData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/InternalCategoryData.cs rename to Adyen/src/Model/TransferWebhooks/InternalCategoryData.cs diff --git a/Adyen/Model/TransferWebhooks/InternalReviewTrackingData.cs b/Adyen/src/Model/TransferWebhooks/InternalReviewTrackingData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/InternalReviewTrackingData.cs rename to Adyen/src/Model/TransferWebhooks/InternalReviewTrackingData.cs diff --git a/Adyen/Model/TransferWebhooks/IssuedCard.cs b/Adyen/src/Model/TransferWebhooks/IssuedCard.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/IssuedCard.cs rename to Adyen/src/Model/TransferWebhooks/IssuedCard.cs diff --git a/Adyen/Model/TransferWebhooks/IssuingTransactionData.cs b/Adyen/src/Model/TransferWebhooks/IssuingTransactionData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/IssuingTransactionData.cs rename to Adyen/src/Model/TransferWebhooks/IssuingTransactionData.cs diff --git a/Adyen/Model/TransferWebhooks/Leg.cs b/Adyen/src/Model/TransferWebhooks/Leg.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Leg.cs rename to Adyen/src/Model/TransferWebhooks/Leg.cs diff --git a/Adyen/Model/TransferWebhooks/Lodging.cs b/Adyen/src/Model/TransferWebhooks/Lodging.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Lodging.cs rename to Adyen/src/Model/TransferWebhooks/Lodging.cs diff --git a/Adyen/Model/TransferWebhooks/MerchantData.cs b/Adyen/src/Model/TransferWebhooks/MerchantData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/MerchantData.cs rename to Adyen/src/Model/TransferWebhooks/MerchantData.cs diff --git a/Adyen/Model/TransferWebhooks/MerchantPurchaseData.cs b/Adyen/src/Model/TransferWebhooks/MerchantPurchaseData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/MerchantPurchaseData.cs rename to Adyen/src/Model/TransferWebhooks/MerchantPurchaseData.cs diff --git a/Adyen/Model/TransferWebhooks/Modification.cs b/Adyen/src/Model/TransferWebhooks/Modification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Modification.cs rename to Adyen/src/Model/TransferWebhooks/Modification.cs diff --git a/Adyen/Model/TransferWebhooks/NOLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/NOLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/NOLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/NZLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/NameLocation.cs b/Adyen/src/Model/TransferWebhooks/NameLocation.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/NameLocation.cs rename to Adyen/src/Model/TransferWebhooks/NameLocation.cs diff --git a/Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/PLLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/PartyIdentification.cs b/Adyen/src/Model/TransferWebhooks/PartyIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/PartyIdentification.cs rename to Adyen/src/Model/TransferWebhooks/PartyIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/PaymentInstrument.cs b/Adyen/src/Model/TransferWebhooks/PaymentInstrument.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/PaymentInstrument.cs rename to Adyen/src/Model/TransferWebhooks/PaymentInstrument.cs diff --git a/Adyen/Model/TransferWebhooks/PlatformPayment.cs b/Adyen/src/Model/TransferWebhooks/PlatformPayment.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/PlatformPayment.cs rename to Adyen/src/Model/TransferWebhooks/PlatformPayment.cs diff --git a/Adyen/Model/TransferWebhooks/RelayedAuthorisationData.cs b/Adyen/src/Model/TransferWebhooks/RelayedAuthorisationData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/RelayedAuthorisationData.cs rename to Adyen/src/Model/TransferWebhooks/RelayedAuthorisationData.cs diff --git a/Adyen/Model/TransferWebhooks/Resource.cs b/Adyen/src/Model/TransferWebhooks/Resource.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/Resource.cs rename to Adyen/src/Model/TransferWebhooks/Resource.cs diff --git a/Adyen/Model/TransferWebhooks/ResourceReference.cs b/Adyen/src/Model/TransferWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/ResourceReference.cs rename to Adyen/src/Model/TransferWebhooks/ResourceReference.cs diff --git a/Adyen/Model/TransferWebhooks/SELocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/SELocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/SELocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/SGLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/TransactionEventViolation.cs b/Adyen/src/Model/TransferWebhooks/TransactionEventViolation.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransactionEventViolation.cs rename to Adyen/src/Model/TransferWebhooks/TransactionEventViolation.cs diff --git a/Adyen/Model/TransferWebhooks/TransactionRuleReference.cs b/Adyen/src/Model/TransferWebhooks/TransactionRuleReference.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransactionRuleReference.cs rename to Adyen/src/Model/TransferWebhooks/TransactionRuleReference.cs diff --git a/Adyen/Model/TransferWebhooks/TransactionRuleSource.cs b/Adyen/src/Model/TransferWebhooks/TransactionRuleSource.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransactionRuleSource.cs rename to Adyen/src/Model/TransferWebhooks/TransactionRuleSource.cs diff --git a/Adyen/Model/TransferWebhooks/TransactionRulesResult.cs b/Adyen/src/Model/TransferWebhooks/TransactionRulesResult.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransactionRulesResult.cs rename to Adyen/src/Model/TransferWebhooks/TransactionRulesResult.cs diff --git a/Adyen/Model/TransferWebhooks/TransferData.cs b/Adyen/src/Model/TransferWebhooks/TransferData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferData.cs rename to Adyen/src/Model/TransferWebhooks/TransferData.cs diff --git a/Adyen/Model/TransferWebhooks/TransferDataCategoryData.cs b/Adyen/src/Model/TransferWebhooks/TransferDataCategoryData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferDataCategoryData.cs rename to Adyen/src/Model/TransferWebhooks/TransferDataCategoryData.cs diff --git a/Adyen/Model/TransferWebhooks/TransferDataTracking.cs b/Adyen/src/Model/TransferWebhooks/TransferDataTracking.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferDataTracking.cs rename to Adyen/src/Model/TransferWebhooks/TransferDataTracking.cs diff --git a/Adyen/Model/TransferWebhooks/TransferEvent.cs b/Adyen/src/Model/TransferWebhooks/TransferEvent.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferEvent.cs rename to Adyen/src/Model/TransferWebhooks/TransferEvent.cs diff --git a/Adyen/Model/TransferWebhooks/TransferEventEventsDataInner.cs b/Adyen/src/Model/TransferWebhooks/TransferEventEventsDataInner.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferEventEventsDataInner.cs rename to Adyen/src/Model/TransferWebhooks/TransferEventEventsDataInner.cs diff --git a/Adyen/Model/TransferWebhooks/TransferEventTrackingData.cs b/Adyen/src/Model/TransferWebhooks/TransferEventTrackingData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferEventTrackingData.cs rename to Adyen/src/Model/TransferWebhooks/TransferEventTrackingData.cs diff --git a/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.cs b/Adyen/src/Model/TransferWebhooks/TransferNotificationCounterParty.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.cs rename to Adyen/src/Model/TransferWebhooks/TransferNotificationCounterParty.cs diff --git a/Adyen/Model/TransferWebhooks/TransferNotificationMerchantData.cs b/Adyen/src/Model/TransferWebhooks/TransferNotificationMerchantData.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferNotificationMerchantData.cs rename to Adyen/src/Model/TransferWebhooks/TransferNotificationMerchantData.cs diff --git a/Adyen/Model/TransferWebhooks/TransferNotificationRequest.cs b/Adyen/src/Model/TransferWebhooks/TransferNotificationRequest.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferNotificationRequest.cs rename to Adyen/src/Model/TransferWebhooks/TransferNotificationRequest.cs diff --git a/Adyen/Model/TransferWebhooks/TransferNotificationValidationFact.cs b/Adyen/src/Model/TransferWebhooks/TransferNotificationValidationFact.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferNotificationValidationFact.cs rename to Adyen/src/Model/TransferWebhooks/TransferNotificationValidationFact.cs diff --git a/Adyen/Model/TransferWebhooks/TransferReview.cs b/Adyen/src/Model/TransferWebhooks/TransferReview.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/TransferReview.cs rename to Adyen/src/Model/TransferWebhooks/TransferReview.cs diff --git a/Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/UKLocalAccountIdentification.cs diff --git a/Adyen/Model/TransferWebhooks/USLocalAccountIdentification.cs b/Adyen/src/Model/TransferWebhooks/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/TransferWebhooks/USLocalAccountIdentification.cs rename to Adyen/src/Model/TransferWebhooks/USLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/AULocalAccountIdentification.cs b/Adyen/src/Model/Transfers/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/AULocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/AULocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/AbstractOpenAPISchema.cs b/Adyen/src/Model/Transfers/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/Model/Transfers/AbstractOpenAPISchema.cs rename to Adyen/src/Model/Transfers/AbstractOpenAPISchema.cs diff --git a/Adyen/Model/Transfers/AdditionalBankIdentification.cs b/Adyen/src/Model/Transfers/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/AdditionalBankIdentification.cs rename to Adyen/src/Model/Transfers/AdditionalBankIdentification.cs diff --git a/Adyen/Model/Transfers/Address.cs b/Adyen/src/Model/Transfers/Address.cs similarity index 100% rename from Adyen/Model/Transfers/Address.cs rename to Adyen/src/Model/Transfers/Address.cs diff --git a/Adyen/Model/Transfers/Airline.cs b/Adyen/src/Model/Transfers/Airline.cs similarity index 100% rename from Adyen/Model/Transfers/Airline.cs rename to Adyen/src/Model/Transfers/Airline.cs diff --git a/Adyen/Model/Transfers/Amount.cs b/Adyen/src/Model/Transfers/Amount.cs similarity index 100% rename from Adyen/Model/Transfers/Amount.cs rename to Adyen/src/Model/Transfers/Amount.cs diff --git a/Adyen/Model/Transfers/AmountAdjustment.cs b/Adyen/src/Model/Transfers/AmountAdjustment.cs similarity index 100% rename from Adyen/Model/Transfers/AmountAdjustment.cs rename to Adyen/src/Model/Transfers/AmountAdjustment.cs diff --git a/Adyen/Model/Transfers/ApproveTransfersRequest.cs b/Adyen/src/Model/Transfers/ApproveTransfersRequest.cs similarity index 100% rename from Adyen/Model/Transfers/ApproveTransfersRequest.cs rename to Adyen/src/Model/Transfers/ApproveTransfersRequest.cs diff --git a/Adyen/Model/Transfers/BRLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/BRLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/BRLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/BRLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/BalanceMutation.cs b/Adyen/src/Model/Transfers/BalanceMutation.cs similarity index 100% rename from Adyen/Model/Transfers/BalanceMutation.cs rename to Adyen/src/Model/Transfers/BalanceMutation.cs diff --git a/Adyen/Model/Transfers/BankAccountV3.cs b/Adyen/src/Model/Transfers/BankAccountV3.cs similarity index 100% rename from Adyen/Model/Transfers/BankAccountV3.cs rename to Adyen/src/Model/Transfers/BankAccountV3.cs diff --git a/Adyen/Model/Transfers/BankAccountV3AccountIdentification.cs b/Adyen/src/Model/Transfers/BankAccountV3AccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/BankAccountV3AccountIdentification.cs rename to Adyen/src/Model/Transfers/BankAccountV3AccountIdentification.cs diff --git a/Adyen/Model/Transfers/BankCategoryData.cs b/Adyen/src/Model/Transfers/BankCategoryData.cs similarity index 100% rename from Adyen/Model/Transfers/BankCategoryData.cs rename to Adyen/src/Model/Transfers/BankCategoryData.cs diff --git a/Adyen/Model/Transfers/CALocalAccountIdentification.cs b/Adyen/src/Model/Transfers/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/CALocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/CALocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/CZLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/CZLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/CZLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/CancelTransfersRequest.cs b/Adyen/src/Model/Transfers/CancelTransfersRequest.cs similarity index 100% rename from Adyen/Model/Transfers/CancelTransfersRequest.cs rename to Adyen/src/Model/Transfers/CancelTransfersRequest.cs diff --git a/Adyen/Model/Transfers/CapitalBalance.cs b/Adyen/src/Model/Transfers/CapitalBalance.cs similarity index 100% rename from Adyen/Model/Transfers/CapitalBalance.cs rename to Adyen/src/Model/Transfers/CapitalBalance.cs diff --git a/Adyen/Model/Transfers/CapitalGrant.cs b/Adyen/src/Model/Transfers/CapitalGrant.cs similarity index 100% rename from Adyen/Model/Transfers/CapitalGrant.cs rename to Adyen/src/Model/Transfers/CapitalGrant.cs diff --git a/Adyen/Model/Transfers/CapitalGrantInfo.cs b/Adyen/src/Model/Transfers/CapitalGrantInfo.cs similarity index 100% rename from Adyen/Model/Transfers/CapitalGrantInfo.cs rename to Adyen/src/Model/Transfers/CapitalGrantInfo.cs diff --git a/Adyen/Model/Transfers/CapitalGrants.cs b/Adyen/src/Model/Transfers/CapitalGrants.cs similarity index 100% rename from Adyen/Model/Transfers/CapitalGrants.cs rename to Adyen/src/Model/Transfers/CapitalGrants.cs diff --git a/Adyen/Model/Transfers/Card.cs b/Adyen/src/Model/Transfers/Card.cs similarity index 100% rename from Adyen/Model/Transfers/Card.cs rename to Adyen/src/Model/Transfers/Card.cs diff --git a/Adyen/Model/Transfers/CardIdentification.cs b/Adyen/src/Model/Transfers/CardIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/CardIdentification.cs rename to Adyen/src/Model/Transfers/CardIdentification.cs diff --git a/Adyen/Model/Transfers/ConfirmationTrackingData.cs b/Adyen/src/Model/Transfers/ConfirmationTrackingData.cs similarity index 100% rename from Adyen/Model/Transfers/ConfirmationTrackingData.cs rename to Adyen/src/Model/Transfers/ConfirmationTrackingData.cs diff --git a/Adyen/Model/Transfers/Counterparty.cs b/Adyen/src/Model/Transfers/Counterparty.cs similarity index 100% rename from Adyen/Model/Transfers/Counterparty.cs rename to Adyen/src/Model/Transfers/Counterparty.cs diff --git a/Adyen/Model/Transfers/CounterpartyInfoV3.cs b/Adyen/src/Model/Transfers/CounterpartyInfoV3.cs similarity index 100% rename from Adyen/Model/Transfers/CounterpartyInfoV3.cs rename to Adyen/src/Model/Transfers/CounterpartyInfoV3.cs diff --git a/Adyen/Model/Transfers/CounterpartyV3.cs b/Adyen/src/Model/Transfers/CounterpartyV3.cs similarity index 100% rename from Adyen/Model/Transfers/CounterpartyV3.cs rename to Adyen/src/Model/Transfers/CounterpartyV3.cs diff --git a/Adyen/Model/Transfers/DKLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/DKLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/DKLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/DirectDebitInformation.cs b/Adyen/src/Model/Transfers/DirectDebitInformation.cs similarity index 100% rename from Adyen/Model/Transfers/DirectDebitInformation.cs rename to Adyen/src/Model/Transfers/DirectDebitInformation.cs diff --git a/Adyen/Model/Transfers/EstimationTrackingData.cs b/Adyen/src/Model/Transfers/EstimationTrackingData.cs similarity index 100% rename from Adyen/Model/Transfers/EstimationTrackingData.cs rename to Adyen/src/Model/Transfers/EstimationTrackingData.cs diff --git a/Adyen/Model/Transfers/ExternalReason.cs b/Adyen/src/Model/Transfers/ExternalReason.cs similarity index 100% rename from Adyen/Model/Transfers/ExternalReason.cs rename to Adyen/src/Model/Transfers/ExternalReason.cs diff --git a/Adyen/Model/Transfers/Fee.cs b/Adyen/src/Model/Transfers/Fee.cs similarity index 100% rename from Adyen/Model/Transfers/Fee.cs rename to Adyen/src/Model/Transfers/Fee.cs diff --git a/Adyen/Model/Transfers/FindTransfersResponse.cs b/Adyen/src/Model/Transfers/FindTransfersResponse.cs similarity index 100% rename from Adyen/Model/Transfers/FindTransfersResponse.cs rename to Adyen/src/Model/Transfers/FindTransfersResponse.cs diff --git a/Adyen/Model/Transfers/HKLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/HKLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/HKLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/HULocalAccountIdentification.cs b/Adyen/src/Model/Transfers/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/HULocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/HULocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/IbanAccountIdentification.cs b/Adyen/src/Model/Transfers/IbanAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/IbanAccountIdentification.cs rename to Adyen/src/Model/Transfers/IbanAccountIdentification.cs diff --git a/Adyen/Model/Transfers/InternalCategoryData.cs b/Adyen/src/Model/Transfers/InternalCategoryData.cs similarity index 100% rename from Adyen/Model/Transfers/InternalCategoryData.cs rename to Adyen/src/Model/Transfers/InternalCategoryData.cs diff --git a/Adyen/Model/Transfers/InternalReviewTrackingData.cs b/Adyen/src/Model/Transfers/InternalReviewTrackingData.cs similarity index 100% rename from Adyen/Model/Transfers/InternalReviewTrackingData.cs rename to Adyen/src/Model/Transfers/InternalReviewTrackingData.cs diff --git a/Adyen/Model/Transfers/InvalidField.cs b/Adyen/src/Model/Transfers/InvalidField.cs similarity index 100% rename from Adyen/Model/Transfers/InvalidField.cs rename to Adyen/src/Model/Transfers/InvalidField.cs diff --git a/Adyen/Model/Transfers/IssuedCard.cs b/Adyen/src/Model/Transfers/IssuedCard.cs similarity index 100% rename from Adyen/Model/Transfers/IssuedCard.cs rename to Adyen/src/Model/Transfers/IssuedCard.cs diff --git a/Adyen/Model/Transfers/IssuingTransactionData.cs b/Adyen/src/Model/Transfers/IssuingTransactionData.cs similarity index 100% rename from Adyen/Model/Transfers/IssuingTransactionData.cs rename to Adyen/src/Model/Transfers/IssuingTransactionData.cs diff --git a/Adyen/Model/Transfers/Leg.cs b/Adyen/src/Model/Transfers/Leg.cs similarity index 100% rename from Adyen/Model/Transfers/Leg.cs rename to Adyen/src/Model/Transfers/Leg.cs diff --git a/Adyen/Model/Transfers/Link.cs b/Adyen/src/Model/Transfers/Link.cs similarity index 100% rename from Adyen/Model/Transfers/Link.cs rename to Adyen/src/Model/Transfers/Link.cs diff --git a/Adyen/Model/Transfers/Links.cs b/Adyen/src/Model/Transfers/Links.cs similarity index 100% rename from Adyen/Model/Transfers/Links.cs rename to Adyen/src/Model/Transfers/Links.cs diff --git a/Adyen/Model/Transfers/Lodging.cs b/Adyen/src/Model/Transfers/Lodging.cs similarity index 100% rename from Adyen/Model/Transfers/Lodging.cs rename to Adyen/src/Model/Transfers/Lodging.cs diff --git a/Adyen/Model/Transfers/MerchantData.cs b/Adyen/src/Model/Transfers/MerchantData.cs similarity index 100% rename from Adyen/Model/Transfers/MerchantData.cs rename to Adyen/src/Model/Transfers/MerchantData.cs diff --git a/Adyen/Model/Transfers/MerchantPurchaseData.cs b/Adyen/src/Model/Transfers/MerchantPurchaseData.cs similarity index 100% rename from Adyen/Model/Transfers/MerchantPurchaseData.cs rename to Adyen/src/Model/Transfers/MerchantPurchaseData.cs diff --git a/Adyen/Model/Transfers/Modification.cs b/Adyen/src/Model/Transfers/Modification.cs similarity index 100% rename from Adyen/Model/Transfers/Modification.cs rename to Adyen/src/Model/Transfers/Modification.cs diff --git a/Adyen/Model/Transfers/NOLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/NOLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/NOLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/NZLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/NZLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/NZLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/NameLocation.cs b/Adyen/src/Model/Transfers/NameLocation.cs similarity index 100% rename from Adyen/Model/Transfers/NameLocation.cs rename to Adyen/src/Model/Transfers/NameLocation.cs diff --git a/Adyen/Model/Transfers/NumberAndBicAccountIdentification.cs b/Adyen/src/Model/Transfers/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/NumberAndBicAccountIdentification.cs rename to Adyen/src/Model/Transfers/NumberAndBicAccountIdentification.cs diff --git a/Adyen/Model/Transfers/PLLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/PLLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/PLLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/PartyIdentification.cs b/Adyen/src/Model/Transfers/PartyIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/PartyIdentification.cs rename to Adyen/src/Model/Transfers/PartyIdentification.cs diff --git a/Adyen/Model/Transfers/PaymentInstrument.cs b/Adyen/src/Model/Transfers/PaymentInstrument.cs similarity index 100% rename from Adyen/Model/Transfers/PaymentInstrument.cs rename to Adyen/src/Model/Transfers/PaymentInstrument.cs diff --git a/Adyen/Model/Transfers/PlatformPayment.cs b/Adyen/src/Model/Transfers/PlatformPayment.cs similarity index 100% rename from Adyen/Model/Transfers/PlatformPayment.cs rename to Adyen/src/Model/Transfers/PlatformPayment.cs diff --git a/Adyen/Model/Transfers/RelayedAuthorisationData.cs b/Adyen/src/Model/Transfers/RelayedAuthorisationData.cs similarity index 100% rename from Adyen/Model/Transfers/RelayedAuthorisationData.cs rename to Adyen/src/Model/Transfers/RelayedAuthorisationData.cs diff --git a/Adyen/Model/Transfers/Repayment.cs b/Adyen/src/Model/Transfers/Repayment.cs similarity index 100% rename from Adyen/Model/Transfers/Repayment.cs rename to Adyen/src/Model/Transfers/Repayment.cs diff --git a/Adyen/Model/Transfers/RepaymentTerm.cs b/Adyen/src/Model/Transfers/RepaymentTerm.cs similarity index 100% rename from Adyen/Model/Transfers/RepaymentTerm.cs rename to Adyen/src/Model/Transfers/RepaymentTerm.cs diff --git a/Adyen/Model/Transfers/ResourceReference.cs b/Adyen/src/Model/Transfers/ResourceReference.cs similarity index 100% rename from Adyen/Model/Transfers/ResourceReference.cs rename to Adyen/src/Model/Transfers/ResourceReference.cs diff --git a/Adyen/Model/Transfers/RestServiceError.cs b/Adyen/src/Model/Transfers/RestServiceError.cs similarity index 100% rename from Adyen/Model/Transfers/RestServiceError.cs rename to Adyen/src/Model/Transfers/RestServiceError.cs diff --git a/Adyen/Model/Transfers/ReturnTransferRequest.cs b/Adyen/src/Model/Transfers/ReturnTransferRequest.cs similarity index 100% rename from Adyen/Model/Transfers/ReturnTransferRequest.cs rename to Adyen/src/Model/Transfers/ReturnTransferRequest.cs diff --git a/Adyen/Model/Transfers/ReturnTransferResponse.cs b/Adyen/src/Model/Transfers/ReturnTransferResponse.cs similarity index 100% rename from Adyen/Model/Transfers/ReturnTransferResponse.cs rename to Adyen/src/Model/Transfers/ReturnTransferResponse.cs diff --git a/Adyen/Model/Transfers/RoutingDetails.cs b/Adyen/src/Model/Transfers/RoutingDetails.cs similarity index 100% rename from Adyen/Model/Transfers/RoutingDetails.cs rename to Adyen/src/Model/Transfers/RoutingDetails.cs diff --git a/Adyen/Model/Transfers/SELocalAccountIdentification.cs b/Adyen/src/Model/Transfers/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/SELocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/SELocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/SGLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/SGLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/SGLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/ServiceError.cs b/Adyen/src/Model/Transfers/ServiceError.cs similarity index 100% rename from Adyen/Model/Transfers/ServiceError.cs rename to Adyen/src/Model/Transfers/ServiceError.cs diff --git a/Adyen/Model/Transfers/ThresholdRepayment.cs b/Adyen/src/Model/Transfers/ThresholdRepayment.cs similarity index 100% rename from Adyen/Model/Transfers/ThresholdRepayment.cs rename to Adyen/src/Model/Transfers/ThresholdRepayment.cs diff --git a/Adyen/Model/Transfers/Transaction.cs b/Adyen/src/Model/Transfers/Transaction.cs similarity index 100% rename from Adyen/Model/Transfers/Transaction.cs rename to Adyen/src/Model/Transfers/Transaction.cs diff --git a/Adyen/Model/Transfers/TransactionEventViolation.cs b/Adyen/src/Model/Transfers/TransactionEventViolation.cs similarity index 100% rename from Adyen/Model/Transfers/TransactionEventViolation.cs rename to Adyen/src/Model/Transfers/TransactionEventViolation.cs diff --git a/Adyen/Model/Transfers/TransactionRuleReference.cs b/Adyen/src/Model/Transfers/TransactionRuleReference.cs similarity index 100% rename from Adyen/Model/Transfers/TransactionRuleReference.cs rename to Adyen/src/Model/Transfers/TransactionRuleReference.cs diff --git a/Adyen/Model/Transfers/TransactionRuleSource.cs b/Adyen/src/Model/Transfers/TransactionRuleSource.cs similarity index 100% rename from Adyen/Model/Transfers/TransactionRuleSource.cs rename to Adyen/src/Model/Transfers/TransactionRuleSource.cs diff --git a/Adyen/Model/Transfers/TransactionRulesResult.cs b/Adyen/src/Model/Transfers/TransactionRulesResult.cs similarity index 100% rename from Adyen/Model/Transfers/TransactionRulesResult.cs rename to Adyen/src/Model/Transfers/TransactionRulesResult.cs diff --git a/Adyen/Model/Transfers/TransactionSearchResponse.cs b/Adyen/src/Model/Transfers/TransactionSearchResponse.cs similarity index 100% rename from Adyen/Model/Transfers/TransactionSearchResponse.cs rename to Adyen/src/Model/Transfers/TransactionSearchResponse.cs diff --git a/Adyen/Model/Transfers/Transfer.cs b/Adyen/src/Model/Transfers/Transfer.cs similarity index 100% rename from Adyen/Model/Transfers/Transfer.cs rename to Adyen/src/Model/Transfers/Transfer.cs diff --git a/Adyen/Model/Transfers/TransferCategoryData.cs b/Adyen/src/Model/Transfers/TransferCategoryData.cs similarity index 100% rename from Adyen/Model/Transfers/TransferCategoryData.cs rename to Adyen/src/Model/Transfers/TransferCategoryData.cs diff --git a/Adyen/Model/Transfers/TransferData.cs b/Adyen/src/Model/Transfers/TransferData.cs similarity index 100% rename from Adyen/Model/Transfers/TransferData.cs rename to Adyen/src/Model/Transfers/TransferData.cs diff --git a/Adyen/Model/Transfers/TransferDataTracking.cs b/Adyen/src/Model/Transfers/TransferDataTracking.cs similarity index 100% rename from Adyen/Model/Transfers/TransferDataTracking.cs rename to Adyen/src/Model/Transfers/TransferDataTracking.cs diff --git a/Adyen/Model/Transfers/TransferEvent.cs b/Adyen/src/Model/Transfers/TransferEvent.cs similarity index 100% rename from Adyen/Model/Transfers/TransferEvent.cs rename to Adyen/src/Model/Transfers/TransferEvent.cs diff --git a/Adyen/Model/Transfers/TransferEventEventsDataInner.cs b/Adyen/src/Model/Transfers/TransferEventEventsDataInner.cs similarity index 100% rename from Adyen/Model/Transfers/TransferEventEventsDataInner.cs rename to Adyen/src/Model/Transfers/TransferEventEventsDataInner.cs diff --git a/Adyen/Model/Transfers/TransferEventTrackingData.cs b/Adyen/src/Model/Transfers/TransferEventTrackingData.cs similarity index 100% rename from Adyen/Model/Transfers/TransferEventTrackingData.cs rename to Adyen/src/Model/Transfers/TransferEventTrackingData.cs diff --git a/Adyen/Model/Transfers/TransferInfo.cs b/Adyen/src/Model/Transfers/TransferInfo.cs similarity index 100% rename from Adyen/Model/Transfers/TransferInfo.cs rename to Adyen/src/Model/Transfers/TransferInfo.cs diff --git a/Adyen/Model/Transfers/TransferNotificationCounterParty.cs b/Adyen/src/Model/Transfers/TransferNotificationCounterParty.cs similarity index 100% rename from Adyen/Model/Transfers/TransferNotificationCounterParty.cs rename to Adyen/src/Model/Transfers/TransferNotificationCounterParty.cs diff --git a/Adyen/Model/Transfers/TransferNotificationMerchantData.cs b/Adyen/src/Model/Transfers/TransferNotificationMerchantData.cs similarity index 100% rename from Adyen/Model/Transfers/TransferNotificationMerchantData.cs rename to Adyen/src/Model/Transfers/TransferNotificationMerchantData.cs diff --git a/Adyen/Model/Transfers/TransferNotificationValidationFact.cs b/Adyen/src/Model/Transfers/TransferNotificationValidationFact.cs similarity index 100% rename from Adyen/Model/Transfers/TransferNotificationValidationFact.cs rename to Adyen/src/Model/Transfers/TransferNotificationValidationFact.cs diff --git a/Adyen/Model/Transfers/TransferRequestReview.cs b/Adyen/src/Model/Transfers/TransferRequestReview.cs similarity index 100% rename from Adyen/Model/Transfers/TransferRequestReview.cs rename to Adyen/src/Model/Transfers/TransferRequestReview.cs diff --git a/Adyen/Model/Transfers/TransferReview.cs b/Adyen/src/Model/Transfers/TransferReview.cs similarity index 100% rename from Adyen/Model/Transfers/TransferReview.cs rename to Adyen/src/Model/Transfers/TransferReview.cs diff --git a/Adyen/Model/Transfers/TransferServiceRestServiceError.cs b/Adyen/src/Model/Transfers/TransferServiceRestServiceError.cs similarity index 100% rename from Adyen/Model/Transfers/TransferServiceRestServiceError.cs rename to Adyen/src/Model/Transfers/TransferServiceRestServiceError.cs diff --git a/Adyen/Model/Transfers/TransferView.cs b/Adyen/src/Model/Transfers/TransferView.cs similarity index 100% rename from Adyen/Model/Transfers/TransferView.cs rename to Adyen/src/Model/Transfers/TransferView.cs diff --git a/Adyen/Model/Transfers/UKLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/UKLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/UKLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/USLocalAccountIdentification.cs b/Adyen/src/Model/Transfers/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/USLocalAccountIdentification.cs rename to Adyen/src/Model/Transfers/USLocalAccountIdentification.cs diff --git a/Adyen/Model/Transfers/UltimatePartyIdentification.cs b/Adyen/src/Model/Transfers/UltimatePartyIdentification.cs similarity index 100% rename from Adyen/Model/Transfers/UltimatePartyIdentification.cs rename to Adyen/src/Model/Transfers/UltimatePartyIdentification.cs diff --git a/Adyen/Security/AesEncryptor.cs b/Adyen/src/Security/AesEncryptor.cs similarity index 100% rename from Adyen/Security/AesEncryptor.cs rename to Adyen/src/Security/AesEncryptor.cs diff --git a/Adyen/Security/EncryptionCredentialDetails.cs b/Adyen/src/Security/EncryptionCredentialDetails.cs similarity index 100% rename from Adyen/Security/EncryptionCredentialDetails.cs rename to Adyen/src/Security/EncryptionCredentialDetails.cs diff --git a/Adyen/Security/EncryptionDerivedKey.cs b/Adyen/src/Security/EncryptionDerivedKey.cs similarity index 100% rename from Adyen/Security/EncryptionDerivedKey.cs rename to Adyen/src/Security/EncryptionDerivedKey.cs diff --git a/Adyen/Security/EncryptionDerivedKeyGenerator.cs b/Adyen/src/Security/EncryptionDerivedKeyGenerator.cs similarity index 100% rename from Adyen/Security/EncryptionDerivedKeyGenerator.cs rename to Adyen/src/Security/EncryptionDerivedKeyGenerator.cs diff --git a/Adyen/Security/Exceptions/NexoCryptoException.cs b/Adyen/src/Security/Exceptions/NexoCryptoException.cs similarity index 100% rename from Adyen/Security/Exceptions/NexoCryptoException.cs rename to Adyen/src/Security/Exceptions/NexoCryptoException.cs diff --git a/Adyen/Security/Extension/ArrayExtension.cs b/Adyen/src/Security/Extension/ArrayExtension.cs similarity index 100% rename from Adyen/Security/Extension/ArrayExtension.cs rename to Adyen/src/Security/Extension/ArrayExtension.cs diff --git a/Adyen/Security/HmacSha256Wrapper.cs b/Adyen/src/Security/HmacSha256Wrapper.cs similarity index 100% rename from Adyen/Security/HmacSha256Wrapper.cs rename to Adyen/src/Security/HmacSha256Wrapper.cs diff --git a/Adyen/Security/IvModGenerator.cs b/Adyen/src/Security/IvModGenerator.cs similarity index 100% rename from Adyen/Security/IvModGenerator.cs rename to Adyen/src/Security/IvModGenerator.cs diff --git a/Adyen/Security/SaleToPoiMessageSecured.cs b/Adyen/src/Security/SaleToPoiMessageSecured.cs similarity index 100% rename from Adyen/Security/SaleToPoiMessageSecured.cs rename to Adyen/src/Security/SaleToPoiMessageSecured.cs diff --git a/Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs b/Adyen/src/Security/SaleToPoiMessageSecuredEncryptor.cs similarity index 100% rename from Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs rename to Adyen/src/Security/SaleToPoiMessageSecuredEncryptor.cs diff --git a/Adyen/Security/SecurityTrailer.cs b/Adyen/src/Security/SecurityTrailer.cs similarity index 100% rename from Adyen/Security/SecurityTrailer.cs rename to Adyen/src/Security/SecurityTrailer.cs diff --git a/Adyen/Security/TerminalCommonNameValidator.cs b/Adyen/src/Security/TerminalCommonNameValidator.cs similarity index 100% rename from Adyen/Security/TerminalCommonNameValidator.cs rename to Adyen/src/Security/TerminalCommonNameValidator.cs diff --git a/Adyen/Service/AbstractService.cs b/Adyen/src/Service/AbstractService.cs similarity index 100% rename from Adyen/Service/AbstractService.cs rename to Adyen/src/Service/AbstractService.cs diff --git a/Adyen/Service/ApiException.cs b/Adyen/src/Service/ApiException.cs similarity index 100% rename from Adyen/Service/ApiException.cs rename to Adyen/src/Service/ApiException.cs diff --git a/Adyen/Service/BalanceControlService.cs b/Adyen/src/Service/BalanceControlService.cs similarity index 100% rename from Adyen/Service/BalanceControlService.cs rename to Adyen/src/Service/BalanceControlService.cs diff --git a/Adyen/Service/BalancePlatform/AccountHoldersService.cs b/Adyen/src/Service/BalancePlatform/AccountHoldersService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/AccountHoldersService.cs rename to Adyen/src/Service/BalancePlatform/AccountHoldersService.cs diff --git a/Adyen/Service/BalancePlatform/BalanceAccountsService.cs b/Adyen/src/Service/BalancePlatform/BalanceAccountsService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/BalanceAccountsService.cs rename to Adyen/src/Service/BalancePlatform/BalanceAccountsService.cs diff --git a/Adyen/Service/BalancePlatform/BankAccountValidationService.cs b/Adyen/src/Service/BalancePlatform/BankAccountValidationService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/BankAccountValidationService.cs rename to Adyen/src/Service/BalancePlatform/BankAccountValidationService.cs diff --git a/Adyen/Service/BalancePlatform/CardOrdersService.cs b/Adyen/src/Service/BalancePlatform/CardOrdersService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/CardOrdersService.cs rename to Adyen/src/Service/BalancePlatform/CardOrdersService.cs diff --git a/Adyen/Service/BalancePlatform/GrantAccountsService.cs b/Adyen/src/Service/BalancePlatform/GrantAccountsService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/GrantAccountsService.cs rename to Adyen/src/Service/BalancePlatform/GrantAccountsService.cs diff --git a/Adyen/Service/BalancePlatform/GrantOffersService.cs b/Adyen/src/Service/BalancePlatform/GrantOffersService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/GrantOffersService.cs rename to Adyen/src/Service/BalancePlatform/GrantOffersService.cs diff --git a/Adyen/Service/BalancePlatform/ManageCardPINService.cs b/Adyen/src/Service/BalancePlatform/ManageCardPINService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/ManageCardPINService.cs rename to Adyen/src/Service/BalancePlatform/ManageCardPINService.cs diff --git a/Adyen/Service/BalancePlatform/ManageSCADevicesService.cs b/Adyen/src/Service/BalancePlatform/ManageSCADevicesService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/ManageSCADevicesService.cs rename to Adyen/src/Service/BalancePlatform/ManageSCADevicesService.cs diff --git a/Adyen/Service/BalancePlatform/NetworkTokensService.cs b/Adyen/src/Service/BalancePlatform/NetworkTokensService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/NetworkTokensService.cs rename to Adyen/src/Service/BalancePlatform/NetworkTokensService.cs diff --git a/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs b/Adyen/src/Service/BalancePlatform/PaymentInstrumentGroupsService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs rename to Adyen/src/Service/BalancePlatform/PaymentInstrumentGroupsService.cs diff --git a/Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs b/Adyen/src/Service/BalancePlatform/PaymentInstrumentsService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs rename to Adyen/src/Service/BalancePlatform/PaymentInstrumentsService.cs diff --git a/Adyen/Service/BalancePlatform/PlatformService.cs b/Adyen/src/Service/BalancePlatform/PlatformService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/PlatformService.cs rename to Adyen/src/Service/BalancePlatform/PlatformService.cs diff --git a/Adyen/Service/BalancePlatform/TransactionRulesService.cs b/Adyen/src/Service/BalancePlatform/TransactionRulesService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/TransactionRulesService.cs rename to Adyen/src/Service/BalancePlatform/TransactionRulesService.cs diff --git a/Adyen/Service/BalancePlatform/TransferRoutesService.cs b/Adyen/src/Service/BalancePlatform/TransferRoutesService.cs similarity index 100% rename from Adyen/Service/BalancePlatform/TransferRoutesService.cs rename to Adyen/src/Service/BalancePlatform/TransferRoutesService.cs diff --git a/Adyen/Service/BinLookupService.cs b/Adyen/src/Service/BinLookupService.cs similarity index 100% rename from Adyen/Service/BinLookupService.cs rename to Adyen/src/Service/BinLookupService.cs diff --git a/Adyen/Service/Checkout/DonationsService.cs b/Adyen/src/Service/Checkout/DonationsService.cs similarity index 100% rename from Adyen/Service/Checkout/DonationsService.cs rename to Adyen/src/Service/Checkout/DonationsService.cs diff --git a/Adyen/Service/Checkout/ModificationsService.cs b/Adyen/src/Service/Checkout/ModificationsService.cs similarity index 100% rename from Adyen/Service/Checkout/ModificationsService.cs rename to Adyen/src/Service/Checkout/ModificationsService.cs diff --git a/Adyen/Service/Checkout/OrdersService.cs b/Adyen/src/Service/Checkout/OrdersService.cs similarity index 100% rename from Adyen/Service/Checkout/OrdersService.cs rename to Adyen/src/Service/Checkout/OrdersService.cs diff --git a/Adyen/Service/Checkout/PaymentLinksService.cs b/Adyen/src/Service/Checkout/PaymentLinksService.cs similarity index 100% rename from Adyen/Service/Checkout/PaymentLinksService.cs rename to Adyen/src/Service/Checkout/PaymentLinksService.cs diff --git a/Adyen/Service/Checkout/PaymentsService.cs b/Adyen/src/Service/Checkout/PaymentsService.cs similarity index 100% rename from Adyen/Service/Checkout/PaymentsService.cs rename to Adyen/src/Service/Checkout/PaymentsService.cs diff --git a/Adyen/Service/Checkout/RecurringService.cs b/Adyen/src/Service/Checkout/RecurringService.cs similarity index 100% rename from Adyen/Service/Checkout/RecurringService.cs rename to Adyen/src/Service/Checkout/RecurringService.cs diff --git a/Adyen/Service/Checkout/UtilityService.cs b/Adyen/src/Service/Checkout/UtilityService.cs similarity index 100% rename from Adyen/Service/Checkout/UtilityService.cs rename to Adyen/src/Service/Checkout/UtilityService.cs diff --git a/Adyen/Service/DataProtectionService.cs b/Adyen/src/Service/DataProtectionService.cs similarity index 100% rename from Adyen/Service/DataProtectionService.cs rename to Adyen/src/Service/DataProtectionService.cs diff --git a/Adyen/Service/DisputesService.cs b/Adyen/src/Service/DisputesService.cs similarity index 100% rename from Adyen/Service/DisputesService.cs rename to Adyen/src/Service/DisputesService.cs diff --git a/Adyen/Service/LegalEntityManagement/BusinessLinesService.cs b/Adyen/src/Service/LegalEntityManagement/BusinessLinesService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/BusinessLinesService.cs rename to Adyen/src/Service/LegalEntityManagement/BusinessLinesService.cs diff --git a/Adyen/Service/LegalEntityManagement/DocumentsService.cs b/Adyen/src/Service/LegalEntityManagement/DocumentsService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/DocumentsService.cs rename to Adyen/src/Service/LegalEntityManagement/DocumentsService.cs diff --git a/Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs b/Adyen/src/Service/LegalEntityManagement/HostedOnboardingService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs rename to Adyen/src/Service/LegalEntityManagement/HostedOnboardingService.cs diff --git a/Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs b/Adyen/src/Service/LegalEntityManagement/LegalEntitiesService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs rename to Adyen/src/Service/LegalEntityManagement/LegalEntitiesService.cs diff --git a/Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs b/Adyen/src/Service/LegalEntityManagement/PCIQuestionnairesService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs rename to Adyen/src/Service/LegalEntityManagement/PCIQuestionnairesService.cs diff --git a/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs b/Adyen/src/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs rename to Adyen/src/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs diff --git a/Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs b/Adyen/src/Service/LegalEntityManagement/TermsOfServiceService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs rename to Adyen/src/Service/LegalEntityManagement/TermsOfServiceService.cs diff --git a/Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs b/Adyen/src/Service/LegalEntityManagement/TransferInstrumentsService.cs similarity index 100% rename from Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs rename to Adyen/src/Service/LegalEntityManagement/TransferInstrumentsService.cs diff --git a/Adyen/Service/Management/APICredentialsCompanyLevelService.cs b/Adyen/src/Service/Management/APICredentialsCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/APICredentialsCompanyLevelService.cs rename to Adyen/src/Service/Management/APICredentialsCompanyLevelService.cs diff --git a/Adyen/Service/Management/APICredentialsMerchantLevelService.cs b/Adyen/src/Service/Management/APICredentialsMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/APICredentialsMerchantLevelService.cs rename to Adyen/src/Service/Management/APICredentialsMerchantLevelService.cs diff --git a/Adyen/Service/Management/APIKeyCompanyLevelService.cs b/Adyen/src/Service/Management/APIKeyCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/APIKeyCompanyLevelService.cs rename to Adyen/src/Service/Management/APIKeyCompanyLevelService.cs diff --git a/Adyen/Service/Management/APIKeyMerchantLevelService.cs b/Adyen/src/Service/Management/APIKeyMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/APIKeyMerchantLevelService.cs rename to Adyen/src/Service/Management/APIKeyMerchantLevelService.cs diff --git a/Adyen/Service/Management/AccountCompanyLevelService.cs b/Adyen/src/Service/Management/AccountCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/AccountCompanyLevelService.cs rename to Adyen/src/Service/Management/AccountCompanyLevelService.cs diff --git a/Adyen/Service/Management/AccountMerchantLevelService.cs b/Adyen/src/Service/Management/AccountMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/AccountMerchantLevelService.cs rename to Adyen/src/Service/Management/AccountMerchantLevelService.cs diff --git a/Adyen/Service/Management/AccountStoreLevelService.cs b/Adyen/src/Service/Management/AccountStoreLevelService.cs similarity index 100% rename from Adyen/Service/Management/AccountStoreLevelService.cs rename to Adyen/src/Service/Management/AccountStoreLevelService.cs diff --git a/Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs b/Adyen/src/Service/Management/AllowedOriginsCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs rename to Adyen/src/Service/Management/AllowedOriginsCompanyLevelService.cs diff --git a/Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs b/Adyen/src/Service/Management/AllowedOriginsMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs rename to Adyen/src/Service/Management/AllowedOriginsMerchantLevelService.cs diff --git a/Adyen/Service/Management/AndroidFilesCompanyLevelService.cs b/Adyen/src/Service/Management/AndroidFilesCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/AndroidFilesCompanyLevelService.cs rename to Adyen/src/Service/Management/AndroidFilesCompanyLevelService.cs diff --git a/Adyen/Service/Management/ClientKeyCompanyLevelService.cs b/Adyen/src/Service/Management/ClientKeyCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/ClientKeyCompanyLevelService.cs rename to Adyen/src/Service/Management/ClientKeyCompanyLevelService.cs diff --git a/Adyen/Service/Management/ClientKeyMerchantLevelService.cs b/Adyen/src/Service/Management/ClientKeyMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/ClientKeyMerchantLevelService.cs rename to Adyen/src/Service/Management/ClientKeyMerchantLevelService.cs diff --git a/Adyen/Service/Management/MyAPICredentialService.cs b/Adyen/src/Service/Management/MyAPICredentialService.cs similarity index 100% rename from Adyen/Service/Management/MyAPICredentialService.cs rename to Adyen/src/Service/Management/MyAPICredentialService.cs diff --git a/Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs b/Adyen/src/Service/Management/PaymentMethodsMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs rename to Adyen/src/Service/Management/PaymentMethodsMerchantLevelService.cs diff --git a/Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs b/Adyen/src/Service/Management/PayoutSettingsMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs rename to Adyen/src/Service/Management/PayoutSettingsMerchantLevelService.cs diff --git a/Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs b/Adyen/src/Service/Management/SplitConfigurationMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs rename to Adyen/src/Service/Management/SplitConfigurationMerchantLevelService.cs diff --git a/Adyen/Service/Management/TerminalActionsCompanyLevelService.cs b/Adyen/src/Service/Management/TerminalActionsCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalActionsCompanyLevelService.cs rename to Adyen/src/Service/Management/TerminalActionsCompanyLevelService.cs diff --git a/Adyen/Service/Management/TerminalActionsTerminalLevelService.cs b/Adyen/src/Service/Management/TerminalActionsTerminalLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalActionsTerminalLevelService.cs rename to Adyen/src/Service/Management/TerminalActionsTerminalLevelService.cs diff --git a/Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs b/Adyen/src/Service/Management/TerminalOrdersCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs rename to Adyen/src/Service/Management/TerminalOrdersCompanyLevelService.cs diff --git a/Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs b/Adyen/src/Service/Management/TerminalOrdersMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs rename to Adyen/src/Service/Management/TerminalOrdersMerchantLevelService.cs diff --git a/Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs b/Adyen/src/Service/Management/TerminalSettingsCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs rename to Adyen/src/Service/Management/TerminalSettingsCompanyLevelService.cs diff --git a/Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs b/Adyen/src/Service/Management/TerminalSettingsMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs rename to Adyen/src/Service/Management/TerminalSettingsMerchantLevelService.cs diff --git a/Adyen/Service/Management/TerminalSettingsStoreLevelService.cs b/Adyen/src/Service/Management/TerminalSettingsStoreLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalSettingsStoreLevelService.cs rename to Adyen/src/Service/Management/TerminalSettingsStoreLevelService.cs diff --git a/Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs b/Adyen/src/Service/Management/TerminalSettingsTerminalLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs rename to Adyen/src/Service/Management/TerminalSettingsTerminalLevelService.cs diff --git a/Adyen/Service/Management/TerminalsTerminalLevelService.cs b/Adyen/src/Service/Management/TerminalsTerminalLevelService.cs similarity index 100% rename from Adyen/Service/Management/TerminalsTerminalLevelService.cs rename to Adyen/src/Service/Management/TerminalsTerminalLevelService.cs diff --git a/Adyen/Service/Management/UsersCompanyLevelService.cs b/Adyen/src/Service/Management/UsersCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/UsersCompanyLevelService.cs rename to Adyen/src/Service/Management/UsersCompanyLevelService.cs diff --git a/Adyen/Service/Management/UsersMerchantLevelService.cs b/Adyen/src/Service/Management/UsersMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/UsersMerchantLevelService.cs rename to Adyen/src/Service/Management/UsersMerchantLevelService.cs diff --git a/Adyen/Service/Management/WebhooksCompanyLevelService.cs b/Adyen/src/Service/Management/WebhooksCompanyLevelService.cs similarity index 100% rename from Adyen/Service/Management/WebhooksCompanyLevelService.cs rename to Adyen/src/Service/Management/WebhooksCompanyLevelService.cs diff --git a/Adyen/Service/Management/WebhooksMerchantLevelService.cs b/Adyen/src/Service/Management/WebhooksMerchantLevelService.cs similarity index 100% rename from Adyen/Service/Management/WebhooksMerchantLevelService.cs rename to Adyen/src/Service/Management/WebhooksMerchantLevelService.cs diff --git a/Adyen/Service/PaymentService.cs b/Adyen/src/Service/PaymentService.cs similarity index 100% rename from Adyen/Service/PaymentService.cs rename to Adyen/src/Service/PaymentService.cs diff --git a/Adyen/Service/PaymentsAppService.cs b/Adyen/src/Service/PaymentsAppService.cs similarity index 100% rename from Adyen/Service/PaymentsAppService.cs rename to Adyen/src/Service/PaymentsAppService.cs diff --git a/Adyen/Service/Payout/InitializationService.cs b/Adyen/src/Service/Payout/InitializationService.cs similarity index 100% rename from Adyen/Service/Payout/InitializationService.cs rename to Adyen/src/Service/Payout/InitializationService.cs diff --git a/Adyen/Service/Payout/InstantPayoutsService.cs b/Adyen/src/Service/Payout/InstantPayoutsService.cs similarity index 100% rename from Adyen/Service/Payout/InstantPayoutsService.cs rename to Adyen/src/Service/Payout/InstantPayoutsService.cs diff --git a/Adyen/Service/Payout/ReviewingService.cs b/Adyen/src/Service/Payout/ReviewingService.cs similarity index 100% rename from Adyen/Service/Payout/ReviewingService.cs rename to Adyen/src/Service/Payout/ReviewingService.cs diff --git a/Adyen/Service/PlatformsAccount/AccountHoldersService.cs b/Adyen/src/Service/PlatformsAccount/AccountHoldersService.cs similarity index 100% rename from Adyen/Service/PlatformsAccount/AccountHoldersService.cs rename to Adyen/src/Service/PlatformsAccount/AccountHoldersService.cs diff --git a/Adyen/Service/PlatformsAccount/AccountsService.cs b/Adyen/src/Service/PlatformsAccount/AccountsService.cs similarity index 100% rename from Adyen/Service/PlatformsAccount/AccountsService.cs rename to Adyen/src/Service/PlatformsAccount/AccountsService.cs diff --git a/Adyen/Service/PlatformsAccount/VerificationService.cs b/Adyen/src/Service/PlatformsAccount/VerificationService.cs similarity index 100% rename from Adyen/Service/PlatformsAccount/VerificationService.cs rename to Adyen/src/Service/PlatformsAccount/VerificationService.cs diff --git a/Adyen/Service/PlatformsFundService.cs b/Adyen/src/Service/PlatformsFundService.cs similarity index 100% rename from Adyen/Service/PlatformsFundService.cs rename to Adyen/src/Service/PlatformsFundService.cs diff --git a/Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs b/Adyen/src/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs similarity index 100% rename from Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs rename to Adyen/src/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs diff --git a/Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs b/Adyen/src/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs similarity index 100% rename from Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs rename to Adyen/src/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs diff --git a/Adyen/Service/PlatformsNotificationConfigurationService.cs b/Adyen/src/Service/PlatformsNotificationConfigurationService.cs similarity index 100% rename from Adyen/Service/PlatformsNotificationConfigurationService.cs rename to Adyen/src/Service/PlatformsNotificationConfigurationService.cs diff --git a/Adyen/Service/PosMobileService.cs b/Adyen/src/Service/PosMobileService.cs similarity index 100% rename from Adyen/Service/PosMobileService.cs rename to Adyen/src/Service/PosMobileService.cs diff --git a/Adyen/Service/PosTerminalManagementService.cs b/Adyen/src/Service/PosTerminalManagementService.cs similarity index 100% rename from Adyen/Service/PosTerminalManagementService.cs rename to Adyen/src/Service/PosTerminalManagementService.cs diff --git a/Adyen/Service/RecurringService.cs b/Adyen/src/Service/RecurringService.cs similarity index 100% rename from Adyen/Service/RecurringService.cs rename to Adyen/src/Service/RecurringService.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApi.cs b/Adyen/src/Service/Resource/Terminal/TerminalApi.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApi.cs rename to Adyen/src/Service/Resource/Terminal/TerminalApi.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs b/Adyen/src/Service/Resource/Terminal/TerminalApiAsyncClient.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs rename to Adyen/src/Service/Resource/Terminal/TerminalApiAsyncClient.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApiLocal.cs b/Adyen/src/Service/Resource/Terminal/TerminalApiLocal.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApiLocal.cs rename to Adyen/src/Service/Resource/Terminal/TerminalApiLocal.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs b/Adyen/src/Service/Resource/Terminal/TerminalApiLocalClient.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs rename to Adyen/src/Service/Resource/Terminal/TerminalApiLocalClient.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs b/Adyen/src/Service/Resource/Terminal/TerminalApiSyncClient.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs rename to Adyen/src/Service/Resource/Terminal/TerminalApiSyncClient.cs diff --git a/Adyen/Service/ServiceResource.cs b/Adyen/src/Service/ServiceResource.cs similarity index 100% rename from Adyen/Service/ServiceResource.cs rename to Adyen/src/Service/ServiceResource.cs diff --git a/Adyen/Service/StoredValueService.cs b/Adyen/src/Service/StoredValueService.cs similarity index 100% rename from Adyen/Service/StoredValueService.cs rename to Adyen/src/Service/StoredValueService.cs diff --git a/Adyen/Service/TerminalApiAsyncService.cs b/Adyen/src/Service/TerminalApiAsyncService.cs similarity index 100% rename from Adyen/Service/TerminalApiAsyncService.cs rename to Adyen/src/Service/TerminalApiAsyncService.cs diff --git a/Adyen/Service/TerminalApiLocalService.cs b/Adyen/src/Service/TerminalApiLocalService.cs similarity index 100% rename from Adyen/Service/TerminalApiLocalService.cs rename to Adyen/src/Service/TerminalApiLocalService.cs diff --git a/Adyen/Service/TerminalApiSyncService.cs b/Adyen/src/Service/TerminalApiSyncService.cs similarity index 100% rename from Adyen/Service/TerminalApiSyncService.cs rename to Adyen/src/Service/TerminalApiSyncService.cs diff --git a/Adyen/Service/TerminalCloudApi.cs b/Adyen/src/Service/TerminalCloudApi.cs similarity index 100% rename from Adyen/Service/TerminalCloudApi.cs rename to Adyen/src/Service/TerminalCloudApi.cs diff --git a/Adyen/Service/TerminalLocalApi.cs b/Adyen/src/Service/TerminalLocalApi.cs similarity index 100% rename from Adyen/Service/TerminalLocalApi.cs rename to Adyen/src/Service/TerminalLocalApi.cs diff --git a/Adyen/Service/TerminalLocalApiUnencrypted.cs b/Adyen/src/Service/TerminalLocalApiUnencrypted.cs similarity index 100% rename from Adyen/Service/TerminalLocalApiUnencrypted.cs rename to Adyen/src/Service/TerminalLocalApiUnencrypted.cs diff --git a/Adyen/Service/Transfers/CapitalService.cs b/Adyen/src/Service/Transfers/CapitalService.cs similarity index 100% rename from Adyen/Service/Transfers/CapitalService.cs rename to Adyen/src/Service/Transfers/CapitalService.cs diff --git a/Adyen/Service/Transfers/TransactionsService.cs b/Adyen/src/Service/Transfers/TransactionsService.cs similarity index 100% rename from Adyen/Service/Transfers/TransactionsService.cs rename to Adyen/src/Service/Transfers/TransactionsService.cs diff --git a/Adyen/Service/Transfers/TransfersService.cs b/Adyen/src/Service/Transfers/TransfersService.cs similarity index 100% rename from Adyen/Service/Transfers/TransfersService.cs rename to Adyen/src/Service/Transfers/TransfersService.cs diff --git a/Adyen/Util/ByteArrayConverter.cs b/Adyen/src/Util/ByteArrayConverter.cs similarity index 100% rename from Adyen/Util/ByteArrayConverter.cs rename to Adyen/src/Util/ByteArrayConverter.cs diff --git a/Adyen/Util/HMACValidator.cs b/Adyen/src/Util/HMACValidator.cs similarity index 100% rename from Adyen/Util/HMACValidator.cs rename to Adyen/src/Util/HMACValidator.cs diff --git a/Adyen/Util/JsonOperation.cs b/Adyen/src/Util/JsonOperation.cs similarity index 100% rename from Adyen/Util/JsonOperation.cs rename to Adyen/src/Util/JsonOperation.cs diff --git a/Adyen/Util/TerminalApi/AdditionalResponse.cs b/Adyen/src/Util/TerminalApi/AdditionalResponse.cs similarity index 100% rename from Adyen/Util/TerminalApi/AdditionalResponse.cs rename to Adyen/src/Util/TerminalApi/AdditionalResponse.cs diff --git a/Adyen/Util/TerminalApi/CardAcquisitionUtil.cs b/Adyen/src/Util/TerminalApi/CardAcquisitionUtil.cs similarity index 100% rename from Adyen/Util/TerminalApi/CardAcquisitionUtil.cs rename to Adyen/src/Util/TerminalApi/CardAcquisitionUtil.cs diff --git a/Adyen/Util/Util.cs b/Adyen/src/Util/Util.cs similarity index 100% rename from Adyen/Util/Util.cs rename to Adyen/src/Util/Util.cs diff --git a/Adyen/Webhooks/BalancePlatformWebhookHandler.cs b/Adyen/src/Webhooks/BalancePlatformWebhookHandler.cs similarity index 100% rename from Adyen/Webhooks/BalancePlatformWebhookHandler.cs rename to Adyen/src/Webhooks/BalancePlatformWebhookHandler.cs diff --git a/Adyen/Webhooks/ClassicPlatformWebhookHandler.cs b/Adyen/src/Webhooks/ClassicPlatformWebhookHandler.cs similarity index 100% rename from Adyen/Webhooks/ClassicPlatformWebhookHandler.cs rename to Adyen/src/Webhooks/ClassicPlatformWebhookHandler.cs diff --git a/Adyen/Webhooks/ManagementWebhookHandler.cs b/Adyen/src/Webhooks/ManagementWebhookHandler.cs similarity index 100% rename from Adyen/Webhooks/ManagementWebhookHandler.cs rename to Adyen/src/Webhooks/ManagementWebhookHandler.cs diff --git a/Adyen/Webhooks/WebhookHandler.cs b/Adyen/src/Webhooks/WebhookHandler.cs similarity index 100% rename from Adyen/Webhooks/WebhookHandler.cs rename to Adyen/src/Webhooks/WebhookHandler.cs From 83ae1674a7df6b87b26b87b9fcc8b87c4b1ea4af Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 17 Oct 2025 15:56:36 +0200 Subject: [PATCH 044/126] Use TryDeserializeHttpResponse name --- Adyen/Core/Client/ApiResponse.cs | 14 +- templates-v7/csharp/ApiResponse.mustache | 158 ----------------------- 2 files changed, 7 insertions(+), 165 deletions(-) delete mode 100644 templates-v7/csharp/ApiResponse.mustache diff --git a/Adyen/Core/Client/ApiResponse.cs b/Adyen/Core/Client/ApiResponse.cs index 83cfff10b..4446aec49 100644 --- a/Adyen/Core/Client/ApiResponse.cs +++ b/Adyen/Core/Client/ApiResponse.cs @@ -191,7 +191,7 @@ public interface IBadRequest : IApiResponse ///
/// /// - bool TryBadRequest([NotNullWhen(true)]out TType? result); + bool TryDeserializeBadRequestResponse([NotNullWhen(true)]out TType? result); } /// @@ -211,7 +211,7 @@ public interface IUnauthorized : IApiResponse /// /// /// - bool TryUnauthorized([NotNullWhen(true)]out TType? result); + bool TryDeserializeUnauthorizedResponse([NotNullWhen(true)]out TType? result); } /// @@ -231,7 +231,7 @@ public interface IForbidden : IApiResponse /// /// /// - bool TryForbidden([NotNullWhen(true)]out TType? result); + bool TryDeserializeForbiddenResponse([NotNullWhen(true)]out TType? result); } /// @@ -251,7 +251,7 @@ public interface IOk : IApiResponse /// /// /// - bool TryOk([NotNullWhen(true)]out TType? result); + bool TryDeserializeOkResponse([NotNullWhen(true)]out TType? result); } /// @@ -271,7 +271,7 @@ public interface IUnprocessableContent : IApiResponse /// /// /// - bool TryUnprocessableContent([NotNullWhen(true)]out TType? result); + bool TryDeserializeUnprocessableContentResponse([NotNullWhen(true)]out TType? result); } /// @@ -291,7 +291,7 @@ public interface IInternalServerError : IApiResponse /// /// /// - bool TryInternalServerError([NotNullWhen(true)]out TType? result); + bool TryDeserializeInternalServerErrorResponse([NotNullWhen(true)]out TType? result); } /// @@ -311,6 +311,6 @@ public interface ICreated : IApiResponse /// /// /// - bool TryCreated([NotNullWhen(true)]out TType? result); + bool TryDeserializeCreatedResponse([NotNullWhen(true)]out TType? result); } } diff --git a/templates-v7/csharp/ApiResponse.mustache b/templates-v7/csharp/ApiResponse.mustache deleted file mode 100644 index 161c2acd1..000000000 --- a/templates-v7/csharp/ApiResponse.mustache +++ /dev/null @@ -1,158 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.Net; - -namespace {{packageName}}.Client -{ - /// - /// Provides a non-generic contract for the ApiResponse wrapper. - /// - public interface IApiResponse - { - /// - /// The data type of - /// - Type ResponseType { get; } - - /// - /// The content of this response - /// - Object Content { get; } - - /// - /// Gets or sets the status code (HTTP status code) - /// - /// The status code. - HttpStatusCode StatusCode { get; } - - /// - /// Gets or sets the HTTP headers - /// - /// HTTP headers - Multimap Headers { get; } - - /// - /// Gets or sets any error text defined by the calling client. - /// - string ErrorText { get; set; } - - /// - /// Gets or sets any cookies passed along on the response. - /// - List Cookies { get; set; } - - /// - /// The raw content of this response - /// - string RawContent { get; } - } - - /// - /// API Response - /// - public class ApiResponse : IApiResponse - { - #region Properties - - /// - /// Gets or sets the status code (HTTP status code) - /// - /// The status code. - public HttpStatusCode StatusCode { get; } - - /// - /// Gets or sets the HTTP headers - /// - /// HTTP headers - public Multimap Headers { get; } - - /// - /// Gets or sets the data (parsed HTTP body) - /// - /// The data. - public T Data { get; } - - /// - /// Gets or sets any error text defined by the calling client. - /// - public string ErrorText { get; set; } - - /// - /// Gets or sets any cookies passed along on the response. - /// - public List Cookies { get; set; } - - /// - /// The content of this response - /// - public Type ResponseType - { - get { return typeof(T); } - } - - /// - /// The data type of - /// - public object Content - { - get { return Data; } - } - - /// - /// The raw content - /// - public string RawContent { get; } - - #endregion Properties - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// HTTP headers. - /// Data (parsed HTTP body) - /// Raw content. - public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) - { - StatusCode = statusCode; - Headers = headers; - Data = data; - RawContent = rawContent; - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// HTTP headers. - /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Data (parsed HTTP body) - /// Raw content. - public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) - { - } - - #endregion Constructors - } -} From 0af5803731dd9f34242bc9ec8c8e094c4fbb8eee Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:13:52 +0200 Subject: [PATCH 045/126] Add NotFound and Accepted responses --- .../PaymentsServiceIntegrationTest.cs | 9 +- Adyen/Core/Client/ApiResponse.cs | 105 +++++++++--- templates-v7/csharp/ApiResponse.mustache | 158 ++++++++++++++++++ ...sponse.mustache => ApiResponse`1.mustache} | 3 - 4 files changed, 245 insertions(+), 30 deletions(-) create mode 100644 templates-v7/csharp/ApiResponse.mustache rename templates-v7/csharp/libraries/generichost/{ApiResponse.mustache => ApiResponse`1.mustache} (99%) diff --git a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index f03a509d0..ae60b95b3 100644 --- a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -1,7 +1,7 @@ using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; -using Adyen.Core; +using Adyen.Checkout.Client; using Adyen.Core.Auth; using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -39,7 +39,7 @@ public async Task Given_Payments_When_CardDetails_Provided_Returns_OK() var request = new PaymentRequest( amount: new Amount("EUR", 1999), merchantAccount: "HeapUnderflowECOM", - reference: "Your order number4", + reference: "reference", returnUrl: "https://adyen.com/", paymentMethod: new CheckoutPaymentMethod( new CardDetails( @@ -52,9 +52,10 @@ public async Task Given_Payments_When_CardDetails_Provided_Returns_OK() ) ) ); - var result = await _paymentsApiService.PaymentsAsync(Guid.NewGuid().ToString(), request); + IPaymentsApiResponse response = await _paymentsApiService.PaymentsAsync(Guid.NewGuid().ToString(), request); - Assert.IsTrue(result.IsOk); + response.TryDeserializeOkResponse(out var result); + Assert.AreEqual(result?.MerchantReference, "reference"); } [TestMethod] diff --git a/Adyen/Core/Client/ApiResponse.cs b/Adyen/Core/Client/ApiResponse.cs index 4446aec49..a96e6c014 100644 --- a/Adyen/Core/Client/ApiResponse.cs +++ b/Adyen/Core/Client/ApiResponse.cs @@ -1,5 +1,4 @@ #nullable enable - using System; using System.Diagnostics.CodeAnalysis; using System.Net; @@ -148,7 +147,7 @@ public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage } /// - /// Construct the response using an HttpResponseMessage + /// Construct the response using an HttpResponseMessage. /// /// /// @@ -175,39 +174,59 @@ public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage } /// - /// An interface for responses of type + /// An interface for responses of type BadRequest. /// /// public interface IBadRequest : IApiResponse { /// - /// Deserializes the response if the response is BadRequest + /// Deserializes the response if the response is BadRequest. /// /// TType BadRequest(); /// - /// Returns true if the response is BadRequest and the deserialized response is not null + /// Returns true if the response is BadRequest and the deserialized response is not null. /// /// /// bool TryDeserializeBadRequestResponse([NotNullWhen(true)]out TType? result); } + + /// + /// An interface for responses of type TooManyRequests. + /// + /// + public interface ITooManyRequests : IApiResponse + { + /// + /// Deserializes the response if the response is TooManyRequests. + /// + /// + TType TooManyRequests(); + /// + /// Returns true if the response is TooManyRequests and the deserialized response is not null. + /// + /// + /// + bool TryDeserializeTooManyRequestsResponse([NotNullWhen(true)]out TType? result); + } + /// - /// An interface for responses of type + /// An interface for responses of type Unauthorized. /// /// public interface IUnauthorized : IApiResponse { /// - /// Deserializes the response if the response is Unauthorized + /// Deserializes the response if the response is Unauthorized. /// /// TType Unauthorized(); /// - /// Returns true if the response is Unauthorized and the deserialized response is not null + /// Returns true if the response is Unauthorized and the deserialized response is not null. /// /// /// @@ -215,19 +234,19 @@ public interface IUnauthorized : IApiResponse } /// - /// An interface for responses of type + /// An interface for responses of type Forbidden. /// /// public interface IForbidden : IApiResponse { /// - /// Deserializes the response if the response is Forbidden + /// Deserializes the response if the response is Forbidden. /// /// TType Forbidden(); /// - /// Returns true if the response is Forbidden and the deserialized response is not null + /// Returns true if the response is Forbidden and the deserialized response is not null. /// /// /// @@ -235,19 +254,19 @@ public interface IForbidden : IApiResponse } /// - /// An interface for responses of type + /// An interface for responses of type Ok. /// /// public interface IOk : IApiResponse { /// - /// Deserializes the response if the response is Ok + /// Deserializes the response if the response is Ok. /// /// TType Ok(); /// - /// Returns true if the response is Ok and the deserialized response is not null + /// Returns true if the response is Ok and the deserialized response is not null. /// /// /// @@ -255,19 +274,19 @@ public interface IOk : IApiResponse } /// - /// An interface for responses of type + /// An interface for responses of type UnprocessableContent. /// /// public interface IUnprocessableContent : IApiResponse { /// - /// Deserializes the response if the response is UnprocessableContent + /// Deserializes the response if the response is UnprocessableContent. /// /// TType UnprocessableContent(); /// - /// Returns true if the response is UnprocessableContent and the deserialized response is not null + /// Returns true if the response is UnprocessableContent and the deserialized response is not null. /// /// /// @@ -275,19 +294,19 @@ public interface IUnprocessableContent : IApiResponse } /// - /// An interface for responses of type + /// An interface for responses of type InternalServerError. /// /// public interface IInternalServerError : IApiResponse { /// - /// Deserializes the response if the response is InternalServerError + /// Deserializes the response if the response is InternalServerError. /// /// TType InternalServerError(); /// - /// Returns true if the response is InternalServerError and the deserialized response is not null + /// Returns true if the response is InternalServerError and the deserialized response is not null. /// /// /// @@ -295,22 +314,62 @@ public interface IInternalServerError : IApiResponse } /// - /// An interface for responses of type + /// An interface for responses of type Created. /// /// public interface ICreated : IApiResponse { /// - /// Deserializes the response if the response is Created + /// Deserializes the response if the response is Created. /// /// TType Created(); /// - /// Returns true if the response is Created and the deserialized response is not null + /// Returns true if the response is Created and the deserialized response is not null. /// /// /// bool TryDeserializeCreatedResponse([NotNullWhen(true)]out TType? result); } + + /// + /// An interface for responses of type Accepted. + /// + /// + public interface IAccepted : IApiResponse + { + /// + /// Deserializes the response if the response is Accepted. + /// + /// + TType Accepted(); + + /// + /// Returns true if the response is Accepted and the deserialized response is not null. + /// + /// + /// + bool TryDeserializeAcceptedResponse([NotNullWhen(true)]out TType? result); + } + + /// + /// An interface for responses of type NotFound. + /// + /// + public interface INotFound : IApiResponse + { + /// + /// Deserializes the response if the response is NotFound. + /// + /// + TType NotFound(); + + /// + /// Returns true if the response is NotFound and the deserialized response is not null. + /// + /// + /// + bool TryDeserializeNotFoundResponse([NotNullWhen(true)]out TType? result); + } } diff --git a/templates-v7/csharp/ApiResponse.mustache b/templates-v7/csharp/ApiResponse.mustache new file mode 100644 index 000000000..130626f5b --- /dev/null +++ b/templates-v7/csharp/ApiResponse.mustache @@ -0,0 +1,158 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Net; + +namespace {{packageName}}.{{corePackageName}}.{{clientPackage}} +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// The content of this response + /// + Object Content { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + Multimap Headers { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public class ApiResponse : IApiResponse + { + #region Properties + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + public string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + public List Cookies { get; set; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The data type of + /// + public object Content + { + get { return Data; } + } + + /// + /// The raw content + /// + public string RawContent { get; } + + #endregion Properties + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) + { + StatusCode = statusCode; + Headers = headers; + Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) + { + } + + #endregion Constructors + } +} diff --git a/templates-v7/csharp/libraries/generichost/ApiResponse.mustache b/templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache similarity index 99% rename from templates-v7/csharp/libraries/generichost/ApiResponse.mustache rename to templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache index fee8659ff..8d716c0f9 100644 --- a/templates-v7/csharp/libraries/generichost/ApiResponse.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiResponse`1.mustache @@ -1,9 +1,6 @@ // -{{>partial_header}} - {{#nrt}} #nullable enable - {{/nrt}} using System; {{^netStandard}} From 99c84ea7c25e137b0e112f771485061aa0f7cc76 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:20:38 +0200 Subject: [PATCH 046/126] Fix recurring tests --- Adyen.IntegrationTest/BaseTest.cs | 11 ++++------- Adyen.IntegrationTest/ErrorTest.cs | 4 ++-- Adyen.IntegrationTest/RecurringTest.cs | 2 +- Adyen.Test/RecurringTest.cs | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Adyen.IntegrationTest/BaseTest.cs b/Adyen.IntegrationTest/BaseTest.cs index 6de13b46f..341c64bf0 100644 --- a/Adyen.IntegrationTest/BaseTest.cs +++ b/Adyen.IntegrationTest/BaseTest.cs @@ -3,12 +3,9 @@ using System.Threading.Tasks; using Adyen.Model; -using Adyen.Model.BinLookup; using Adyen.Model.Checkout; using Adyen.Model.Payment; using Adyen.Service; -using Adyen.Service.Checkout; -using Amount = Adyen.Model.Checkout; using PaymentRequest = Adyen.Model.Payment.PaymentRequest; using PaymentResult = Adyen.Model.Payment.PaymentResult; using Environment = Adyen.Model.Environment; @@ -59,7 +56,7 @@ public PaymentResult CreatePaymentResultWithIdempotency(string idempotency) return paymentResult; } - public PaymentResult CreatePaymentResultWithRecurring(Recurring.ContractEnum contract) + public PaymentResult CreatePaymentResultWithRecurring(Model.Payment.Recurring.ContractEnum contract) { var client = CreateApiKeyTestClient(); var payment = new PaymentService(client); @@ -178,9 +175,9 @@ private PaymentRequest CreateFullPaymentRequest() return paymentRequest; } - private PaymentRequest CreateFullPaymentRequestWithRecurring(Recurring.ContractEnum contract) + private Model.Payment.PaymentRequest CreateFullPaymentRequestWithRecurring(Model.Payment.Recurring.ContractEnum contract) { - var paymentRequest = new PaymentRequest + var paymentRequest = new Model.Payment.PaymentRequest { MerchantAccount = ClientConstants.MerchantAccount, Amount = new Model.Payment.Amount("EUR", 1500), @@ -188,7 +185,7 @@ private PaymentRequest CreateFullPaymentRequestWithRecurring(Recurring.ContractE Reference = "payment - " + DateTime.Now.ToString("yyyyMMdd"), ShopperReference = "test-1234", AdditionalData = CreateAdditionalData(), - Recurring = new Recurring { Contract = contract }, + Recurring = new Model.Payment.Recurring() { Contract = contract }, ApplicationInfo = new Model.Payment.ApplicationInfo() { ExternalPlatform = new Model.Payment.ExternalPlatform() diff --git a/Adyen.IntegrationTest/ErrorTest.cs b/Adyen.IntegrationTest/ErrorTest.cs index 2143e9428..12d3d5bbb 100644 --- a/Adyen.IntegrationTest/ErrorTest.cs +++ b/Adyen.IntegrationTest/ErrorTest.cs @@ -49,9 +49,9 @@ public void TestClassicPaymentErrorHandling() ShopperEmail = "s.hopper@test.com", ShopperIP = "61.294.12.12", ShopperReference = "test-1234", - Recurring = new Recurring() + Recurring = new Model.Payment.Recurring() { - Contract = Recurring.ContractEnum.RECURRING + Contract = Model.Payment.Recurring.ContractEnum.RECURRING }, ShopperInteraction = PaymentRequest.ShopperInteractionEnum.Ecommerce, MerchantAccount = MerchantAccount diff --git a/Adyen.IntegrationTest/RecurringTest.cs b/Adyen.IntegrationTest/RecurringTest.cs index 42726c666..1eb082ef4 100644 --- a/Adyen.IntegrationTest/RecurringTest.cs +++ b/Adyen.IntegrationTest/RecurringTest.cs @@ -40,7 +40,7 @@ private RecurringDetailsRequest CreateRecurringDetailsRequest() { ShopperReference = "test-1234", MerchantAccount = ClientConstants.MerchantAccount, - Recurring = new Recurring { Contract = ContractEnum.RECURRING } + Recurring = new Model.Recurring.Recurring { Contract = ContractEnum.RECURRING } }; return request; } diff --git a/Adyen.Test/RecurringTest.cs b/Adyen.Test/RecurringTest.cs index 9d5899529..d133952af 100644 --- a/Adyen.Test/RecurringTest.cs +++ b/Adyen.Test/RecurringTest.cs @@ -112,7 +112,7 @@ private RecurringDetailsRequest CreateRecurringDetailsRequest() { ShopperReference = "test-123", MerchantAccount = "DotNetAlexandros", - Recurring = new Recurring(Recurring.ContractEnum.RECURRING) + Recurring = new Model.Recurring.Recurring(Model.Recurring.Recurring.ContractEnum.RECURRING) }; return request; } From 568468132b8b6a522fc842a3af6160ed765cdc33 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 17 Oct 2025 18:00:21 +0200 Subject: [PATCH 047/126] Add AcsWebhooksTest --- Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs | 115 ++++++++++++++++++ .../generichost/JsonConverter.mustache | 3 + 2 files changed, 118 insertions(+) create mode 100644 Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs diff --git a/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs b/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs new file mode 100644 index 000000000..2aa042597 --- /dev/null +++ b/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs @@ -0,0 +1,115 @@ +using Adyen.AcsWebhooks.Extensions; +using Adyen.AcsWebhooks.Models; +using Adyen.AcsWebhooks.Services; +using Adyen.AcsWebhooks.Client; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.Extensions.Hosting; + +namespace Adyen.IntegrationTest.AcsWebhooks +{ + [TestClass] + public class AcsWebhooksTest + { + private readonly AcsWebhooksService _acsWebhooksService; + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public AcsWebhooksTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureAcsWebhooks((context, services, config) => + { + services.AddSingleton(); + }) + .Build(); + + _acsWebhooksService = host.Services.GetRequiredService(); + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public async Task Deserialize_Authentication_Webhook_OOB_TRIGGER_FL_Returns_Object() + { + // Arrange + string json = @" +{ + ""data"": { + ""authentication"": { + ""acsTransId"": ""6a4c1709-a42e-4c7f-96c7-1043adacfc97"", + ""challenge"": { + ""flow"": ""OOB_TRIGGER_FL"", + ""lastInteraction"": ""2022-12-22T15:49:03+01:00"" + }, + ""challengeIndicator"": ""01"", + ""createdAt"": ""2022-12-22T15:45:03+01:00"", + ""deviceChannel"": ""app"", + ""dsTransID"": ""a3b86754-444d-46ca-95a2-ada351d3f42c"", + ""exemptionIndicator"": ""lowValue"", + ""inPSD2Scope"": true, + ""messageCategory"": ""payment"", + ""messageVersion"": ""2.2.0"", + ""riskScore"": 0, + ""threeDSServerTransID"": ""6edcc246-23ee-4e94-ac5d-8ae620bea7d9"", + ""transStatus"": ""Y"", + ""type"": ""challenge"" + }, + ""balancePlatform"": ""YOUR_BALANCE_PLATFORM"", + ""id"": ""497f6eca-6276-4993-bfeb-53cbbbba6f08"", + ""paymentInstrumentId"": ""PI3227C223222B5BPCMFXD2XG"", + ""purchase"": { + ""date"": ""2022-12-22T15:49:03+01:00"", + ""merchantName"": ""MyShop"", + ""originalAmount"": { + ""currency"": ""EUR"", + ""value"": 1000 + } + }, + ""status"": ""authenticated"" + }, + ""environment"": ""test"", + ""timestamp"": ""2022-12-22T15:42:03+01:00"", + ""type"": ""balancePlatform.authentication.created"" +} +"; + // Act + AuthenticationNotificationRequest r = _acsWebhooksService.DeserializeAuthenticationNotificationRequest(json); + + // Assert + Assert.IsNotNull(r); + Assert.AreEqual(AuthenticationNotificationRequest.TypeEnum.BalancePlatformAuthenticationCreated, r.Type); + Assert.AreEqual("test", r.VarEnvironment); + Assert.AreEqual(DateTime.Parse("2022-12-22T15:42:03+01:00"), r.Timestamp); + + Assert.IsNotNull(r.Data); + Assert.AreEqual("497f6eca-6276-4993-bfeb-53cbbbba6f08", r.Data.Id); + Assert.AreEqual("YOUR_BALANCE_PLATFORM", r.Data.BalancePlatform); + Assert.AreEqual("PI3227C223222B5BPCMFXD2XG", r.Data.PaymentInstrumentId); + Assert.AreEqual(AuthenticationNotificationData.StatusEnum.Authenticated, r.Data.Status); + + Assert.IsNotNull(r.Data.Purchase); + Assert.AreEqual("2022-12-22T15:49:03+01:00", r.Data.Purchase.Date); + Assert.AreEqual("MyShop", r.Data.Purchase.MerchantName); + Assert.AreEqual("EUR", r.Data.Purchase.OriginalAmount.Currency); + Assert.AreEqual(1000, r.Data.Purchase.OriginalAmount.Value); + + Assert.IsNotNull(r.Data.Authentication); + Assert.AreEqual("6a4c1709-a42e-4c7f-96c7-1043adacfc97", r.Data.Authentication.AcsTransId); + Assert.AreEqual(AuthenticationInfo.ChallengeIndicatorEnum._01, r.Data.Authentication.ChallengeIndicator); + Assert.AreEqual(DateTime.Parse("2022-12-22T15:45:03+01:00"), r.Data.Authentication.CreatedAt); + Assert.AreEqual(AuthenticationInfo.DeviceChannelEnum.App, r.Data.Authentication.DeviceChannel); + Assert.AreEqual("a3b86754-444d-46ca-95a2-ada351d3f42c", r.Data.Authentication.DsTransID); + Assert.AreEqual(AuthenticationInfo.ExemptionIndicatorEnum.LowValue, r.Data.Authentication.ExemptionIndicator); + Assert.IsTrue(r.Data.Authentication.InPSD2Scope); + Assert.AreEqual(AuthenticationInfo.MessageCategoryEnum.Payment, r.Data.Authentication.MessageCategory); + Assert.AreEqual("2.2.0", r.Data.Authentication.MessageVersion); + Assert.AreEqual(0, r.Data.Authentication.RiskScore); + Assert.AreEqual("6edcc246-23ee-4e94-ac5d-8ae620bea7d9", r.Data.Authentication.ThreeDSServerTransID); + Assert.AreEqual(AuthenticationInfo.TransStatusEnum.Y, r.Data.Authentication.TransStatus); + Assert.AreEqual(AuthenticationInfo.TypeEnum.Challenge, r.Data.Authentication.Type); + + Assert.IsNotNull(r.Data.Authentication.Challenge); + Assert.AreEqual(ChallengeInfo.FlowEnum.OOBTRIGGERFL, r.Data.Authentication.Challenge.Flow); + Assert.AreEqual(DateTime.Parse("2022-12-22T15:49:03+01:00"), r.Data.Authentication.Challenge.LastInteraction); + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index 3c760069b..3dcfd17fb 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -267,6 +267,8 @@ } } + /* + {{! Removed checks for required fields }} {{#allVars}} {{#required}} if (!{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.IsSet) @@ -281,6 +283,7 @@ {{/isNullable}} {{/allVars}} + */ {{^vendorExtensions.x-duplicated-data-type}} {{#model.discriminator}} {{#model.hasDiscriminatorWithNonEmptyMapping}} From 4a0ba612797735ec66c8ea872a895c3cb2af960b Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 23 Oct 2025 21:38:19 +0200 Subject: [PATCH 048/126] Added support for Test and Live configuration --- Adyen/Core/Auth/ApiKeyToken.cs | 15 ++------------- Adyen/Core/Auth/BasicToken.cs | 9 +++++---- Adyen/Core/Auth/CookieContainer.cs | 18 ------------------ Adyen/Core/Options/AdyenEnvironment.cs | 12 ++++++++++++ Adyen/Core/Options/AdyenOptions.cs | 18 ++++++++++++++++++ 5 files changed, 37 insertions(+), 35 deletions(-) delete mode 100644 Adyen/Core/Auth/CookieContainer.cs create mode 100644 Adyen/Core/Options/AdyenEnvironment.cs create mode 100644 Adyen/Core/Options/AdyenOptions.cs diff --git a/Adyen/Core/Auth/ApiKeyToken.cs b/Adyen/Core/Auth/ApiKeyToken.cs index 5de989f7f..c5cd5d906 100644 --- a/Adyen/Core/Auth/ApiKeyToken.cs +++ b/Adyen/Core/Auth/ApiKeyToken.cs @@ -9,12 +9,12 @@ namespace Adyen.Core.Auth ///
public class ApiKeyToken : TokenBase { - private string _apiKeyValue; + private readonly string _apiKeyValue; /// /// The key of the header for your API Key. /// - public string Key { get; } = "X-API-Key"; + public string Key { get; set; } = "X-API-Key"; /// /// Constructs an ApiKeyToken object. @@ -35,16 +35,5 @@ public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage reque { request.Headers.Add(Key, _apiKeyValue); } - - /// - /// Places the token in the query. - /// - /// - /// - /// - public virtual void UseInQuery(global::System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) - { - parseQueryString[Key] = Uri.EscapeDataString(_apiKeyValue); - } } } \ No newline at end of file diff --git a/Adyen/Core/Auth/BasicToken.cs b/Adyen/Core/Auth/BasicToken.cs index 77c78da9b..25df500ae 100644 --- a/Adyen/Core/Auth/BasicToken.cs +++ b/Adyen/Core/Auth/BasicToken.cs @@ -1,6 +1,7 @@ #nullable enable using System; +using System.Net.Http.Headers; namespace Adyen.Core.Auth { @@ -9,14 +10,14 @@ namespace Adyen.Core.Auth /// public class BasicToken : TokenBase { - private string _username; + private readonly string _username; - private string _password; + private readonly string _password; /// /// The key of the header for basic authentication. /// - public string Key { get; } = "Basic"; + public string Key { get; set; } = "Basic"; /// /// Constructs a BasicToken object. @@ -36,7 +37,7 @@ public BasicToken(string username, string password, TimeSpan? timeout = null) : /// public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) { - request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(Key, Base64Encode(_username + ":" + _password)); + request.Headers.Authorization = new AuthenticationHeaderValue(Key, Base64Encode(_username + ":" + _password)); } /// diff --git a/Adyen/Core/Auth/CookieContainer.cs b/Adyen/Core/Auth/CookieContainer.cs deleted file mode 100644 index 3406885e7..000000000 --- a/Adyen/Core/Auth/CookieContainer.cs +++ /dev/null @@ -1,18 +0,0 @@ -#nullable enable - -using System.Linq; -using System.Collections.Generic; - -namespace Adyen.Core.Auth -{ - /// - /// A class containing a CookieContainer - /// - public sealed class CookieContainer - { - /// - /// The collection of tokens - /// - public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); - } -} \ No newline at end of file diff --git a/Adyen/Core/Options/AdyenEnvironment.cs b/Adyen/Core/Options/AdyenEnvironment.cs new file mode 100644 index 000000000..6d98e4fe0 --- /dev/null +++ b/Adyen/Core/Options/AdyenEnvironment.cs @@ -0,0 +1,12 @@ +namespace Adyen.Core.Options +{ + /// + /// The Adyen Environment. + /// Changing this value affects the ClientUtils.BASE_URL where your API requests are sent. + /// + public enum AdyenEnvironment + { + Test, + Live + } +} \ No newline at end of file diff --git a/Adyen/Core/Options/AdyenOptions.cs b/Adyen/Core/Options/AdyenOptions.cs new file mode 100644 index 000000000..ea770619f --- /dev/null +++ b/Adyen/Core/Options/AdyenOptions.cs @@ -0,0 +1,18 @@ +namespace Adyen.Core.Options +{ + public class AdyenOptions + { + /// + /// The Adyen Environment. + /// + public AdyenEnvironment Environment { get; set; } = AdyenEnvironment.Test; + + /// + /// Used in the LIVE environment only. + /// Default value: empty string. + /// This prefix is appended to HttpClient.BaseAddress when is set to `AdyenEnvironment.Live` + /// See: https://docs.adyen.com/development-resources/live-endpoints/ + /// + public string LiveEndpointUrlPrefix { get; set; } = string.Empty; + } +} \ No newline at end of file From fde69913cfb5a325eb0b1f33e2cc01099f2bc8b5 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 23 Oct 2025 21:47:16 +0200 Subject: [PATCH 049/126] Update templates --- .../csharp/AbstractOpenAPISchema.mustache | 68 -- .../generichost/BearerToken.mustache | 2 +- .../generichost/ClientUtils.mustache | 74 +- .../generichost/HostConfiguration.mustache | 30 +- .../IServiceCollectionExtensions.mustache | 25 +- .../generichost/JsonConverter.mustache | 9 +- .../csharp/libraries/generichost/api.mustache | 16 +- .../webhooks/HostConfiguration.mustache | 0 .../libraries/httpclient/ApiClient.mustache | 792 ------------------ .../httpclient/FileParameter.mustache | 72 -- .../httpclient/RequestOptions.mustache | 66 -- 11 files changed, 116 insertions(+), 1038 deletions(-) delete mode 100644 templates-v7/csharp/AbstractOpenAPISchema.mustache delete mode 100644 templates-v7/csharp/libraries/generichost/webhooks/HostConfiguration.mustache delete mode 100644 templates-v7/csharp/libraries/httpclient/ApiClient.mustache delete mode 100644 templates-v7/csharp/libraries/httpclient/FileParameter.mustache delete mode 100644 templates-v7/csharp/libraries/httpclient/RequestOptions.mustache diff --git a/templates-v7/csharp/AbstractOpenAPISchema.mustache b/templates-v7/csharp/AbstractOpenAPISchema.mustache deleted file mode 100644 index 05e782049..000000000 --- a/templates-v7/csharp/AbstractOpenAPISchema.mustache +++ /dev/null @@ -1,68 +0,0 @@ -{{>partial_header}} - -using System; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; - -namespace {{packageName}}.{{modelPackage}} -{ - /// - /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification - /// - {{>visibility}} abstract partial class AbstractOpenAPISchema - { - /// - /// Custom JSON serializer - /// - static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - MissingMemberHandling = MissingMemberHandling.Error, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Custom JSON serializer for objects with additional properties - /// - static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - MissingMemberHandling = MissingMemberHandling.Ignore, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Gets or Sets the actual instance - /// - public abstract Object ActualInstance { get; set; } - - /// - /// Gets or Sets IsNullable to indicate whether the instance is nullable - /// - public bool IsNullable { get; protected set; } - - /// - /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` - /// - public string SchemaType { get; protected set; } - - /// - /// Converts the instance into JSON string. - /// - public abstract string ToJson(); - } -} diff --git a/templates-v7/csharp/libraries/generichost/BearerToken.mustache b/templates-v7/csharp/libraries/generichost/BearerToken.mustache index 761f598d8..1dd463bcd 100644 --- a/templates-v7/csharp/libraries/generichost/BearerToken.mustache +++ b/templates-v7/csharp/libraries/generichost/BearerToken.mustache @@ -1,4 +1,4 @@ -// +\// {{partial_header}} {{#nrt}} #nullable enable diff --git a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache index 013953bd4..be8977f00 100644 --- a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache +++ b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache @@ -12,6 +12,8 @@ using System.Text; using System.Text.Json; using System.Text.RegularExpressions;{{#useCompareNetObjects}} using KellermanSoftware.CompareNetObjects;{{/useCompareNetObjects}} +using {{packageName}}; +using {{packageName}}.{{corePackageName}}.Options; {{#models}} {{#-first}} using {{packageName}}.{{modelPackage}}; @@ -328,16 +330,84 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} throw new JsonException("The specified discriminator was not found."); } + +#region Functionality that dynamically determines the Host URL of the HttpClient + /// + /// Constructs the Host URL based on the selected , used to populate the `HttpClient.BaseAddress`. + /// + /// . + /// String with the Host URL. + /// + public static string GetHostUrl(AdyenOptions adyenOptions) + { + if (adyenOptions.Environment == {{packageName}}Environment.Live) + return ConstructLiveUrl(adyenOptions.LiveEndpointUrlPrefix, BASE_URL); + + // Some Adyen OpenApi Specifications use the live-url, instead of the test-url, this line replaces "-live" with "-test". + // If you need to override this URL, you can do so by replacing the BASE_URL in ClientUtils.cs. + if (adyenOptions.Environment == {{packageName}}Environment.Test) + return BASE_URL.Replace("-live", "-test"); + + throw new ArgumentOutOfRangeException(adyenOptions.Environment.ToString()); + } + + /// + /// Construct LIVE BaseUrl, add the liveEndpointUrlPrefix it's the Checkout API or the Classic Payment API. + /// This helper function can be removed when all URLs (test & live) are included in the Adyen OpenApi Specifications: https://github.com/Adyen/adyen-openapi. + /// + /// The Live EndpointUrlPrefix. + /// The Base URL . + /// baseUrl + /// + private static string ConstructLiveUrl(string liveEndpointUrlPrefix, string url) + { + // Change base url for Live environment + if (url.Contains("pal-")) // Payment API prefix + { + if (liveEndpointUrlPrefix == null) + { + throw new InvalidOperationException("Missing liveEndpointUrlPrefix for endpoint generation"); + } + + url = url.Replace("https://pal-test.adyen.com/pal/servlet/", + "https://" + liveEndpointUrlPrefix + "-pal-live.adyenpayments.com/pal/servlet/"); + } + else if (url.Contains("checkout-")) // Checkout API prefix + { + if (liveEndpointUrlPrefix == null) + { + throw new InvalidOperationException("Missing liveEndpointUrlPrefix for endpoint generation"); + } + + if (url.Contains("possdk")) + { + url = url.Replace("https://checkout-test.adyen.com/", + "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/"); + } + else + { + url = url.Replace("https://checkout-test.adyen.com/", + "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/"); + } + } + + // If no prefix is required, we replace "test" -> "live" + url = url.Replace("-test", "-live"); + return url; + } + +#endregion + /// /// The base path of the API, it includes the http(s)-scheme, the host domain name, and the base path. /// - public const string BASE_URL = "{{{basePath}}}"; + public static string BASE_URL = "{{{basePath}}}"; /// /// The relative path of the API after the `.com`. /// - public const string RELATIVE_URL = "{{contextPath}}"; + public static string RELATIVE_URL = "{{contextPath}}"; /// /// The format to use for DateTime serialization. diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index fac860fe9..dff60a141 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -20,6 +20,7 @@ using {{packageName}}.{{modelPackage}}; using {{packageName}}.{{corePackageName}}; using {{packageName}}.{{corePackageName}}.Auth; using {{packageName}}.{{corePackageName}}.Client; +using {{packageName}}.{{corePackageName}}.Options; using {{packageName}}.{{corePackageName}}.Converters; namespace {{packageName}}.{{apiName}}.{{clientPackage}} @@ -31,6 +32,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} { private readonly IServiceCollection _services; private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + private readonly AdyenOptions _adyenOptions = new AdyenOptions(); internal bool HttpClientsAdded { get; private set; } @@ -99,18 +101,18 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} /// /// /// - public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} client = null, Action{{nrt?}} builder = null) + public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} clientAction = null, Action{{nrt?}} builderAction = null) { - if (client == null) - client = c => c.BaseAddress = new Uri(ClientUtils.BASE_URL); + if (clientAction == null) + clientAction = httpClient => httpClient.BaseAddress = new Uri(ClientUtils.GetHostUrl(_adyenOptions)); List builders = new List(); - {{#apiInfo}}{{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, {{classname}}>(client)); + {{#apiInfo}}{{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, {{classname}}>(clientAction)); {{/apis}}{{/apiInfo}} - if (builder != null) + if (builderAction != null) foreach (IHttpClientBuilder instance in builders) - builder(instance); + builderAction(instance); HttpClientsAdded = true; @@ -122,13 +124,25 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} /// /// /// - public HostConfiguration ConfigureJsonOptions(Action options) + public HostConfiguration ConfigureJsonOptions(Action optionsAction) { - options(_jsonOptions); + optionsAction(_jsonOptions); return this; } + /// + /// Configures the Adyen Settings, e.g. Environment, LiveEndpointPrefix and more. + /// + /// + /// + public HostConfiguration ConfigureAdyenOptions(Action optionsAction) + { + optionsAction(_adyenOptions); + + return this; + } + /// /// Adds tokens to your IServiceCollection /// diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index f0dc8a606..f47a66097 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -28,6 +28,7 @@ namespace {{packageName}}.{{apiName}}.Extensions } {{/hasAuthMethods}} + /// /// Add the {{packageName}} {{apiName}} API services to your host builder. /// @@ -44,21 +45,21 @@ namespace {{packageName}}.{{apiName}}.Extensions { if (!host.HttpClientsAdded) host.Add{{apiName}}HttpClients(); - + + {{#vendorExtensions.x-set-cookie}} services.AddSingleton(); - - // ensure that a token provider was provided for this token type - // if not, default to RateLimitProvider - var containerServices = services.Where(s => s.ServiceType.IsGenericType && - s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); - + {{/vendorExtensions.x-set-cookie}} + // Ensure that a token provider was provided for this token type, if not default to RateLimitProvider + var containerServices = services.Where(s => + s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))) + .ToArray(); + foreach(var containerService in containerServices) { - var tokenType = containerService.ServiceType.GenericTypeArguments[0]; - - var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); - - if (provider == null) + Type tokenType = containerService.ServiceType.GenericTypeArguments[0]; + var serviceDescriptor = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + if (serviceDescriptor == null) { services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index 3dcfd17fb..bf4fb0cb1 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -221,7 +221,8 @@ {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{#supportsDateOnly}}DateOnly{{/supportsDateOnly}}{{^supportsDateOnly}}DateTime{{/supportsDateOnly}}{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions)); {{/isDate}} {{#isDateTime}} - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + {{! Fix: Added support for DateTimeOffset, when `useDateTimeOffset=true` }} + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); {{/isDateTime}} {{#isEnum}} {{^isMap}} @@ -444,7 +445,8 @@ { {{#lambda.trimTrailingWithNewLine}} {{#lambda.trimLineBreaks}} - /* // TODO: Remove guards (null-checks) for required-properties in our open-api-specs. + /* + {{! Removed guard checks for required properties }} {{#allVars}} {{^isDiscriminator}} {{^isNullable}} @@ -462,7 +464,8 @@ {{#isDiscriminator}} {{^model.composedSchemas.anyOf}} {{^model.composedSchemas.oneOf}} - writer.WriteString("{{baseName}}", {{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{/isEnum}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}.Value{{/required}}){{/isEnum}}); + + writer.WriteString("{{baseName}}", {{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{/isEnum}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}{{/required}}){{/isEnum}}); {{/model.composedSchemas.oneOf}} {{/model.composedSchemas.anyOf}} diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 2034a1268..92a921845 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -475,38 +475,26 @@ namespace {{packageName}}.{{apiPackage}} List tokenBases = new List(); {{/-first}} {{#isApiKey}} + {{! Only use API Keys that are appended to the HTTP-headers }} {{^isKeyInCookie}} + {{#isKeyInHeader}} ApiKeyToken apiKeyToken{{-index}} = (ApiKeyToken) await ApiKeyProvider.GetAsync("{{keyParamName}}", cancellationToken).ConfigureAwait(false); tokenBases.Add(apiKeyToken{{-index}}); - {{#isKeyInHeader}} apiKeyToken{{-index}}.UseInHeader(httpRequestMessage); - {{/isKeyInHeader}} {{/isKeyInCookie}} - {{#isKeyInQuery}} - - apiKeyToken{{-index}}.UseInQuery(httpRequestMessage, uriBuilder, parseQueryString); - - uriBuilder.Query = parseQueryString.ToString(); - {{/isKeyInQuery}} {{/isApiKey}} {{/authMethods}} httpRequestMessage.RequestUri = uriBuilder.Uri; {{#authMethods}} {{#isBasicBearer}} - BearerToken bearerToken{{-index}} = (BearerToken) await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - tokenBases.Add(bearerToken{{-index}}); - bearerToken{{-index}}.UseInHeader(httpRequestMessage, "{{keyParamName}}"); {{/isBasicBearer}} {{#isOAuth}} - OAuthToken oauthToken{{-index}} = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - tokenBases.Add(oauthToken{{-index}}); - oauthToken{{-index}}.UseInHeader(httpRequestMessage, "{{keyParamName}}"); {{/isOAuth}} {{#isHttpSignature}} diff --git a/templates-v7/csharp/libraries/generichost/webhooks/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/webhooks/HostConfiguration.mustache deleted file mode 100644 index e69de29bb..000000000 diff --git a/templates-v7/csharp/libraries/httpclient/ApiClient.mustache b/templates-v7/csharp/libraries/httpclient/ApiClient.mustache deleted file mode 100644 index 1cf7b5d7c..000000000 --- a/templates-v7/csharp/libraries/httpclient/ApiClient.mustache +++ /dev/null @@ -1,792 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Text; -using System.Threading; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -{{^netStandard}} -using System.Web; -{{/netStandard}} -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; -using System.Net.Http; -using System.Net.Http.Headers; -{{#supportsRetry}} -using Polly; -{{/supportsRetry}} - -namespace {{packageName}}.Client -{ - /// - /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. - /// - internal class CustomJsonCodec - { - private readonly IReadableConfiguration _configuration; - private static readonly string _contentType = "application/json"; - private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - public CustomJsonCodec(IReadableConfiguration configuration) - { - _configuration = configuration; - } - - public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) - { - _serializerSettings = serializerSettings; - _configuration = configuration; - } - - /// - /// Serialize the object into a JSON string. - /// - /// Object to be serialized. - /// A JSON string. - public string Serialize(object obj) - { - if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) - { - // the object to be serialized is an oneOf/anyOf schema - return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); - } - else - { - return JsonConvert.SerializeObject(obj, _serializerSettings); - } - } - - public async Task Deserialize(HttpResponseMessage response) - { - var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); - return result; - } - - /// - /// Deserialize the JSON string into a proper object. - /// - /// The HTTP response. - /// Object type. - /// Object representation of the JSON string. - internal async Task Deserialize(HttpResponseMessage response, Type type) - { - IList headers = new List(); - // process response headers, e.g. Access-Control-Allow-Methods - foreach (var responseHeader in response.Headers) - { - headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); - } - - // process response content headers, e.g. Content-Type - foreach (var responseHeader in response.Content.Headers) - { - headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); - } - - // RFC 2183 & RFC 2616 - var fileNameRegex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$", RegexOptions.IgnoreCase); - if (type == typeof(byte[])) // return byte array - { - return await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); - } - else if (type == typeof(FileParameter)) - { - if (headers != null) { - foreach (var header in headers) - { - var match = fileNameRegex.Match(header.ToString()); - if (match.Success) - { - string fileName = ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - return new FileParameter(fileName, await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); - } - } - } - return new FileParameter(await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); - } - - // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) - if (type == typeof(Stream)) - { - var bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); - if (headers != null) - { - var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() - : _configuration.TempFolderPath; - - foreach (var header in headers) - { - var match = fileNameRegex.Match(header.ToString()); - if (match.Success) - { - string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); - return new FileStream(fileName, FileMode.Open); - } - } - } - var stream = new MemoryStream(bytes); - return stream; - } - - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object - { - return DateTime.Parse(await response.Content.ReadAsStringAsync().ConfigureAwait(false), null, System.Globalization.DateTimeStyles.RoundtripKind); - } - - if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type - { - return Convert.ChangeType(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type, _serializerSettings); - } - catch (Exception e) - { - throw new ApiException(500, e.Message); - } - } - - public string RootElement { get; set; } - public string Namespace { get; set; } - public string DateFormat { get; set; } - - public string ContentType - { - get { return _contentType; } - set { throw new InvalidOperationException("Not allowed to set content type."); } - } - } - /// - /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), - /// encapsulating general REST accessor use cases. - /// - /// - /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. - /// - {{>visibility}} partial class ApiClient : IDisposable, ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} - { - private readonly string _baseUrl; - - private readonly HttpClientHandler _httpClientHandler; - private readonly System.Net.Http.HttpClient _httpClient; - private readonly bool _disposeClient; - - /// - /// Specifies the settings on a object. - /// These settings can be adjusted to accommodate custom serialization rules. - /// - public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Initializes a new instance of the , defaulting to the global configurations' base url. - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - public ApiClient() : - this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) - { - } - - /// - /// Initializes a new instance of the . - /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. - /// It's better to reuse the HttpClient and HttpClientHandler. - /// - /// The target service's base path in URL format. - /// - public ApiClient(string basePath) - { - if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); - - _httpClientHandler = new HttpClientHandler(); - _httpClient = new System.Net.Http.HttpClient(_httpClientHandler, true); - _disposeClient = true; - _baseUrl = basePath; - } - - /// - /// Initializes a new instance of the , defaulting to the global configurations' base url. - /// - /// An instance of HttpClient. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public ApiClient(System.Net.Http.HttpClient client, HttpClientHandler handler = null) : - this(client, {{packageName}}.Client.GlobalConfiguration.Instance.BasePath, handler) - { - } - - /// - /// Initializes a new instance of the . - /// - /// An instance of HttpClient. - /// The target service's base path in URL format. - /// An optional instance of HttpClientHandler that is used by HttpClient. - /// - /// - /// - /// Some configuration settings will not be applied without passing an HttpClientHandler. - /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. - /// - public ApiClient(System.Net.Http.HttpClient client, string basePath, HttpClientHandler handler = null) - { - if (client == null) throw new ArgumentNullException("client cannot be null"); - if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); - - _httpClientHandler = handler; - _httpClient = client; - _baseUrl = basePath; - } - - /// - /// Disposes resources if they were created by us - /// - public void Dispose() - { - if(_disposeClient) { - _httpClient.Dispose(); - } - } - - /// Prepares multipart/form-data content - {{! TODO: Add handling of improper usage }} - HttpContent PrepareMultipartFormDataContent(RequestOptions options) - { - string boundary = "---------" + Guid.NewGuid().ToString().ToUpperInvariant(); - var multipartContent = new MultipartFormDataContent(boundary); - foreach (var formParameter in options.FormParameters) - { - multipartContent.Add(new StringContent(formParameter.Value), formParameter.Key); - } - - if (options.FileParameters != null && options.FileParameters.Count > 0) - { - foreach (var fileParam in options.FileParameters) - { - foreach (var file in fileParam.Value) - { - var content = new StreamContent(file.Content); - content.Headers.ContentType = new MediaTypeHeaderValue(file.ContentType); - multipartContent.Add(content, fileParam.Key, file.Name); - } - } - } - return multipartContent; - } - - /// - /// Provides all logic for constructing a new HttpRequestMessage. - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the a HttpRequestMessage. - /// - /// The http verb. - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// [private] A new HttpRequestMessage instance. - /// - private HttpRequestMessage NewRequest( - HttpMethod method, - string path, - RequestOptions options, - IReadableConfiguration configuration) - { - if (path == null) throw new ArgumentNullException("path"); - if (options == null) throw new ArgumentNullException("options"); - if (configuration == null) throw new ArgumentNullException("configuration"); - - WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); - - builder.AddPathParameters(options.PathParameters); - - builder.AddQueryParameters(options.QueryParameters); - - HttpRequestMessage request = new HttpRequestMessage(method, builder.GetFullUri()); - - if (configuration.UserAgent != null) - { - request.Headers.TryAddWithoutValidation("User-Agent", configuration.UserAgent); - } - - if (configuration.DefaultHeaders != null) - { - foreach (var headerParam in configuration.DefaultHeaders) - { - request.Headers.Add(headerParam.Key, headerParam.Value); - } - } - - if (options.HeaderParameters != null) - { - foreach (var headerParam in options.HeaderParameters) - { - foreach (var value in headerParam.Value) - { - // Todo make content headers actually content headers - request.Headers.TryAddWithoutValidation(headerParam.Key, value); - } - } - } - - List> contentList = new List>(); - - string contentType = null; - if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) - { - var contentTypes = options.HeaderParameters["Content-Type"]; - contentType = contentTypes.FirstOrDefault(); - } - - {{!// TODO Add error handling in case of improper usage}} - if (contentType == "multipart/form-data") - { - request.Content = PrepareMultipartFormDataContent(options); - } - else if (contentType == "application/x-www-form-urlencoded") - { - request.Content = new FormUrlEncodedContent(options.FormParameters); - } - else - { - if (options.Data != null) - { - if (options.Data is FileParameter fp) - { - contentType = contentType ?? "application/octet-stream"; - - var streamContent = new StreamContent(fp.Content); - streamContent.Headers.ContentType = new MediaTypeHeaderValue(contentType); - request.Content = streamContent; - } - else - { - var serializer = new CustomJsonCodec(SerializerSettings, configuration); - request.Content = new StringContent(serializer.Serialize(options.Data), new UTF8Encoding(), - "application/json"); - } - } - } - - - - // TODO provide an alternative that allows cookies per request instead of per API client - if (options.Cookies != null && options.Cookies.Count > 0) - { - request.Properties["CookieContainer"] = options.Cookies; - } - - return request; - } - - {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptRequest(HttpRequestMessage req){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} - {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} - - private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) - { - T result = (T) responseData; - string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - - var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) - { - ErrorText = response.ReasonPhrase, - Cookies = new List() - }; - - // process response headers, e.g. Access-Control-Allow-Methods - if (response.Headers != null) - { - foreach (var responseHeader in response.Headers) - { - transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - // process response content headers, e.g. Content-Type - if (response.Content.Headers != null) - { - foreach (var responseHeader in response.Content.Headers) - { - transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - if (_httpClientHandler != null && response != null) - { - try { - foreach (Cookie cookie in _httpClientHandler.CookieContainer.GetCookies(uri)) - { - transformed.Cookies.Add(cookie); - } - } - catch (PlatformNotSupportedException) {} - } - - return transformed; - } - - private ApiResponse Exec(HttpRequestMessage req, IReadableConfiguration configuration) - { - return ExecAsync(req, configuration).GetAwaiter().GetResult(); - } - - private async Task> ExecAsync(HttpRequestMessage req, - IReadableConfiguration configuration, - System.Threading.CancellationToken cancellationToken = default) - { - CancellationTokenSource timeoutTokenSource = null; - CancellationTokenSource finalTokenSource = null; - var deserializer = new CustomJsonCodec(SerializerSettings, configuration); - var finalToken = cancellationToken; - - try - { - if (configuration.Timeout > TimeSpan.Zero) - { - timeoutTokenSource = new CancellationTokenSource(configuration.Timeout); - finalTokenSource = CancellationTokenSource.CreateLinkedTokenSource(finalToken, timeoutTokenSource.Token); - finalToken = finalTokenSource.Token; - } - - if (configuration.Proxy != null) - { - if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `Proxy` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); - _httpClientHandler.Proxy = configuration.Proxy; - } - - if (configuration.ClientCertificates != null) - { - if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); - _httpClientHandler.ClientCertificates.AddRange(configuration.ClientCertificates); - } - - var cookieContainer = req.Properties.ContainsKey("CookieContainer") ? req.Properties["CookieContainer"] as List : null; - - if (cookieContainer != null) - { - if(_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); - foreach (var cookie in cookieContainer) - { - _httpClientHandler.CookieContainer.Add(cookie); - } - } - - InterceptRequest(req); - - HttpResponseMessage response; - {{#supportsRetry}} - if (RetryConfiguration.AsyncRetryPolicy != null) - { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy - .ExecuteAndCaptureAsync(() => _httpClient.SendAsync(req, finalToken)) - .ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? - policyResult.Result : new HttpResponseMessage() - { - ReasonPhrase = policyResult.FinalException.ToString(), - RequestMessage = req - }; - } - else - { - {{/supportsRetry}} - response = await _httpClient.SendAsync(req, finalToken).ConfigureAwait(false); - {{#supportsRetry}} - } - {{/supportsRetry}} - - if (!response.IsSuccessStatusCode) - { - return await ToApiResponse(response, default, req.RequestUri).ConfigureAwait(false); - } - - object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); - - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); - } - - InterceptResponse(req, response); - - return await ToApiResponse(response, responseData, req.RequestUri).ConfigureAwait(false); - } - catch (OperationCanceledException original) - { - if (timeoutTokenSource != null && timeoutTokenSource.IsCancellationRequested) - { - throw new TaskCanceledException($"[{req.Method}] {req.RequestUri} was timeout.", - new TimeoutException(original.Message, original)); - } - throw; - } - finally - { - if (timeoutTokenSource != null) - { - timeoutTokenSource.Dispose(); - } - - if (finalTokenSource != null) - { - finalTokenSource.Dispose(); - } - } - } - - {{#supportsAsync}} - #region IAsynchronousClient - /// - /// Make a HTTP GET request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP POST request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP PUT request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP DELETE request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP HEAD request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP OPTION request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); - } - - /// - /// Make a HTTP PATCH request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); - } - #endregion IAsynchronousClient - {{/supportsAsync}} - - #region ISynchronousClient - /// - /// Make a HTTP GET request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Get, path, options, config), config); - } - - /// - /// Make a HTTP POST request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Post, path, options, config), config); - } - - /// - /// Make a HTTP PUT request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Put, path, options, config), config); - } - - /// - /// Make a HTTP DELETE request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); - } - - /// - /// Make a HTTP HEAD request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Head, path, options, config), config); - } - - /// - /// Make a HTTP OPTION request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Options, path, options, config), config); - } - - /// - /// Make a HTTP PATCH request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(new HttpMethod("PATCH"), path, options, config), config); - } - #endregion ISynchronousClient - } -} diff --git a/templates-v7/csharp/libraries/httpclient/FileParameter.mustache b/templates-v7/csharp/libraries/httpclient/FileParameter.mustache deleted file mode 100644 index 87e5fcdc9..000000000 --- a/templates-v7/csharp/libraries/httpclient/FileParameter.mustache +++ /dev/null @@ -1,72 +0,0 @@ -{{>partial_header}} - -using System.IO; - -namespace {{packageName}}.Client -{ - - /// - /// Represents a File passed to the API as a Parameter, allows using different backends for files - /// - public class FileParameter - { - /// - /// The filename - /// - public string Name { get; set; } = "no_name_provided"; - - /// - /// The content type of the file - /// - public string ContentType { get; set; } = "application/octet-stream"; - - /// - /// The content of the file - /// - public Stream Content { get; set; } - - /// - /// Construct a FileParameter just from the contents, will extract the filename from a filestream - /// - /// The file content - public FileParameter(Stream content) - { - if (content is FileStream fs) - { - Name = fs.Name; - } - Content = content; - } - - /// - /// Construct a FileParameter from name and content - /// - /// The filename - /// The file content - public FileParameter(string filename, Stream content) - { - Name = filename; - Content = content; - } - - /// - /// Construct a FileParameter from name and content - /// - /// The filename - /// The content type of the file - /// The file content - public FileParameter(string filename, string contentType, Stream content) - { - Name = filename; - ContentType = contentType; - Content = content; - } - - /// - /// Implicit conversion of stream to file parameter. Useful for backwards compatibility. - /// - /// Stream to convert - /// FileParameter - public static implicit operator FileParameter(Stream s) => new FileParameter(s); - } -} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache b/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache deleted file mode 100644 index 25e76d03d..000000000 --- a/templates-v7/csharp/libraries/httpclient/RequestOptions.mustache +++ /dev/null @@ -1,66 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.IO; -using System.Net; - -namespace {{packageName}}.Client -{ - /// - /// A container for generalized request inputs. This type allows consumers to extend the request functionality - /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). - /// - public class RequestOptions - { - /// - /// Parameters to be bound to path parts of the Request's URL - /// - public Dictionary PathParameters { get; set; } - - /// - /// Query parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap QueryParameters { get; set; } - - /// - /// Header parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap HeaderParameters { get; set; } - - /// - /// Form parameters to be sent along with the request. - /// - public Dictionary FormParameters { get; set; } - - /// - /// File parameters to be sent along with the request. - /// - public Multimap FileParameters { get; set; } - - /// - /// Cookies to be sent along with the request. - /// - public List Cookies { get; set; } - - /// - /// Any data associated with a request body. - /// - public Object Data { get; set; } - - /// - /// Constructs a new instance of - /// - public RequestOptions() - { - PathParameters = new Dictionary(); - QueryParameters = new Multimap(); - HeaderParameters = new Multimap(); - FormParameters = new Dictionary(); - FileParameters = new Multimap(); - Cookies = new List(); - } - } -} From 1ad8638933812248915e95fb62d21d84a0d44468 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 23 Oct 2025 22:29:48 +0200 Subject: [PATCH 050/126] Remove rate-limiting functionality --- Adyen/Core/Auth/ApiKeyToken.cs | 2 +- Adyen/Core/Auth/BasicToken.cs | 2 +- Adyen/Core/Auth/RateLimitProvider.cs | 74 ------------------- Adyen/Core/Auth/TokenBase.cs | 56 +------------- Adyen/Core/Auth/TokenProvider.cs | 2 +- .../IServiceCollectionExtensions.mustache | 9 +-- .../csharp/libraries/generichost/api.mustache | 10 +-- 7 files changed, 10 insertions(+), 145 deletions(-) delete mode 100644 Adyen/Core/Auth/RateLimitProvider.cs diff --git a/Adyen/Core/Auth/ApiKeyToken.cs b/Adyen/Core/Auth/ApiKeyToken.cs index c5cd5d906..271fedf58 100644 --- a/Adyen/Core/Auth/ApiKeyToken.cs +++ b/Adyen/Core/Auth/ApiKeyToken.cs @@ -22,7 +22,7 @@ public class ApiKeyToken : TokenBase /// /// /// - public ApiKeyToken(string value, string prefix = "", TimeSpan? timeout = null) : base(timeout) + public ApiKeyToken(string value, string prefix = "", TimeSpan? timeout = null) { _apiKeyValue = $"{prefix}{value}"; } diff --git a/Adyen/Core/Auth/BasicToken.cs b/Adyen/Core/Auth/BasicToken.cs index 25df500ae..278181841 100644 --- a/Adyen/Core/Auth/BasicToken.cs +++ b/Adyen/Core/Auth/BasicToken.cs @@ -25,7 +25,7 @@ public class BasicToken : TokenBase /// /// /// - public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) + public BasicToken(string username, string password, TimeSpan? timeout = null) : base() { _username = username; _password = password; diff --git a/Adyen/Core/Auth/RateLimitProvider.cs b/Adyen/Core/Auth/RateLimitProvider.cs deleted file mode 100644 index f593f0254..000000000 --- a/Adyen/Core/Auth/RateLimitProvider.cs +++ /dev/null @@ -1,74 +0,0 @@ -#nullable enable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Adyen.Core.Auth -{ - /// - /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. - /// - /// - public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase - { - internal Dictionary> AvailableTokens { get; } = new(); - - /// - /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. - /// - /// - public RateLimitProvider(TokenContainer container) : base(container.Tokens) - { - foreach(TTokenBase token in _tokens) - token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); - - if (container is TokenContainer apiKeyTokenContainer) - { - string[] headers = apiKeyTokenContainer.Tokens.Select(t => t.Key).Distinct().ToArray(); - - foreach (string header in headers) - { - global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => t.Key.Equals(header))) - { - FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite - }; - - AvailableTokens.Add(header, global::System.Threading.Channels.Channel.CreateBounded(options)); - } - } - else - { - global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length) - { - FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite - }; - - AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded(options)); - } - - foreach (var availableToken in AvailableTokens) - foreach(TTokenBase token in _tokens) - { - if (token is ApiKeyToken apiKeyToken) - { - if (apiKeyToken.Key == availableToken.Key) - { - token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); - } - } else - { - token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); - } - } - } - - internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) - { - if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) - throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); - - return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); - } - } -} diff --git a/Adyen/Core/Auth/TokenBase.cs b/Adyen/Core/Auth/TokenBase.cs index b73db7cd8..347c174e4 100644 --- a/Adyen/Core/Auth/TokenBase.cs +++ b/Adyen/Core/Auth/TokenBase.cs @@ -5,64 +5,16 @@ namespace Adyen.Core.Auth { /// - /// The base for all tokens. + /// The base class for all tokens. /// public abstract class TokenBase { - private DateTime _nextAvailable = DateTime.UtcNow; - private object _nextAvailableLock = new object(); - private readonly System.Timers.Timer _timer = new System.Timers.Timer(); - - - internal TimeSpan? Timeout { get; set; } - internal delegate void TokenBecameAvailableEventHandler(object sender); - internal event TokenBecameAvailableEventHandler? TokenBecameAvailable; - - - /// - /// Initialize a TokenBase object. - /// - /// - internal TokenBase(TimeSpan? timeout = null) - { - Timeout = timeout; - - if (Timeout != null) - StartTimer(Timeout.Value); - } - - /// - /// Starts the token's timer. - /// - /// - internal void StartTimer(TimeSpan timeout) - { - Timeout = timeout; - _timer.Interval = Timeout.Value.TotalMilliseconds; - _timer.Elapsed += OnTimer; - _timer.AutoReset = true; - _timer.Start(); - } - - /// - /// Returns true while the token is rate limited. - /// - public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; - /// - /// Triggered when the server returns status code TooManyRequests. - /// Once triggered the local timeout will be extended an arbitrary length of time. + /// The constructor for the parent TokenBase object. + /// Example usages: or . /// - public void BeginRateLimit() - { - lock(_nextAvailableLock) - _nextAvailable = DateTime.UtcNow.AddSeconds(5); - } - - private void OnTimer(object? sender, System.Timers.ElapsedEventArgs e) + internal TokenBase() { - if (TokenBecameAvailable != null && !IsRateLimited) - TokenBecameAvailable.Invoke(this); } } } \ No newline at end of file diff --git a/Adyen/Core/Auth/TokenProvider.cs b/Adyen/Core/Auth/TokenProvider.cs index fb641f8e0..9b63d3286 100644 --- a/Adyen/Core/Auth/TokenProvider.cs +++ b/Adyen/Core/Auth/TokenProvider.cs @@ -37,7 +37,7 @@ public TokenProvider(IEnumerable tokens) _tokens = tokens.ToArray(); if (_tokens.Length == 0) - throw new ArgumentException("You did not provide any tokens."); + throw new ArgumentException("You did not provide any tokens (e.g. API Keys), see also: ApiKeyToken class."); } } } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index f47a66097..ce4ddff92 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -46,10 +46,7 @@ namespace {{packageName}}.{{apiName}}.Extensions if (!host.HttpClientsAdded) host.Add{{apiName}}HttpClients(); - {{#vendorExtensions.x-set-cookie}} - services.AddSingleton(); - {{/vendorExtensions.x-set-cookie}} - // Ensure that a token provider was provided for this token type, if not default to RateLimitProvider + // Ensure that a token provider was provided for this token type. var containerServices = services.Where(s => s.ServiceType.IsGenericType && s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))) @@ -61,9 +58,7 @@ namespace {{packageName}}.{{apiName}}.Extensions var serviceDescriptor = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); if (serviceDescriptor == null) { - services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); - services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), - s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType)); } } } diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 92a921845..d8fc6cce4 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -594,15 +594,7 @@ namespace {{packageName}}.{{apiPackage}} After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponse {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); Events.ExecuteOn{{operationId}}(apiResponse); - - {{#authMethods}} - {{#-first}} - if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase tokenBase in tokenBases) - tokenBase.BeginRateLimit(); - - {{/-first}} - {{/authMethods}} + {{#net80OrLater}} {{#responses}} {{#vendorExtensions.x-set-cookie}} From c47fcee6c1e74b0a401928fb58b7ffa32d67dc7e Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 23 Oct 2025 22:58:39 +0200 Subject: [PATCH 051/126] Remove RateLimiting --- Adyen/Core/Auth/ApiKeyToken.cs | 9 ++-- Adyen/Core/Auth/BasicToken.cs | 5 +- .../generichost/HostConfiguration.mustache | 49 +++++++------------ .../csharp/libraries/generichost/api.mustache | 5 +- 4 files changed, 27 insertions(+), 41 deletions(-) diff --git a/Adyen/Core/Auth/ApiKeyToken.cs b/Adyen/Core/Auth/ApiKeyToken.cs index 271fedf58..837c78e2f 100644 --- a/Adyen/Core/Auth/ApiKeyToken.cs +++ b/Adyen/Core/Auth/ApiKeyToken.cs @@ -5,7 +5,11 @@ namespace Adyen.Core.Auth { /// - /// A token constructed from an apiKey. + /// A token constructed from an ApiKey. + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. Most common use-case for Digital (ECOM) & In-Person payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. /// public class ApiKeyToken : TokenBase { @@ -21,8 +25,7 @@ public class ApiKeyToken : TokenBase /// /// /// - /// - public ApiKeyToken(string value, string prefix = "", TimeSpan? timeout = null) + public ApiKeyToken(string value, string prefix = "") { _apiKeyValue = $"{prefix}{value}"; } diff --git a/Adyen/Core/Auth/BasicToken.cs b/Adyen/Core/Auth/BasicToken.cs index 278181841..bba61e967 100644 --- a/Adyen/Core/Auth/BasicToken.cs +++ b/Adyen/Core/Auth/BasicToken.cs @@ -7,6 +7,7 @@ namespace Adyen.Core.Auth { /// /// A token constructed from a username and password. + /// Adyen recommends using the instead. /// public class BasicToken : TokenBase { @@ -21,11 +22,11 @@ public class BasicToken : TokenBase /// /// Constructs a BasicToken object. + /// Adyen recommends using the instead. /// /// /// - /// - public BasicToken(string username, string password, TimeSpan? timeout = null) : base() + public BasicToken(string username, string password) : base() { _username = username; _password = password; diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index dff60a141..1cbc828e3 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -37,9 +37,9 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} internal bool HttpClientsAdded { get; private set; } /// - /// Instantiates the class + /// Instantiates the HostConfiguration (custom JsonConverters, Events, HttpClient) with the necessary dependencies to communicate with the API. /// - /// + /// public HostConfiguration(IServiceCollection services) { _services = services; @@ -98,9 +98,9 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} /// /// Configures the HttpClients. /// - /// - /// - /// + /// + /// + /// public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} clientAction = null, Action{{nrt?}} builderAction = null) { if (clientAction == null) @@ -122,65 +122,50 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} /// /// Configures the JsonSerializerSettings /// - /// - /// + /// + /// public HostConfiguration ConfigureJsonOptions(Action optionsAction) { optionsAction(_jsonOptions); - return this; } /// /// Configures the Adyen Settings, e.g. Environment, LiveEndpointPrefix and more. /// - /// + /// /// public HostConfiguration ConfigureAdyenOptions(Action optionsAction) { optionsAction(_adyenOptions); - return this; } /// /// Adds tokens to your IServiceCollection /// - /// - /// - /// + /// + /// + /// public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase - { - return AddTokens(new TTokenBase[]{ token }); - } - - /// - /// Adds tokens to your IServiceCollection - /// - /// - /// - /// - public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase - { - TokenContainer container = new TokenContainer(tokens); - _services.AddSingleton(services => container); - + { + TokenContainer container = new TokenContainer(new TTokenBase[]{ token }); + _services.AddSingleton(container); return this; } /// /// Adds a token provider to your IServiceCollection /// - /// - /// - /// + /// + /// + /// public HostConfiguration UseProvider() where TTokenProvider : TokenProvider where TTokenBase : TokenBase { _services.AddSingleton(); _services.AddSingleton>(services => services.GetRequiredService()); - return this; } } diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index d8fc6cce4..d15eff8e0 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -471,15 +471,12 @@ namespace {{packageName}}.{{apiPackage}} {{/bodyParam}} {{#authMethods}} - {{#-first}} - List tokenBases = new List(); - {{/-first}} + {{#isApiKey}} {{! Only use API Keys that are appended to the HTTP-headers }} {{^isKeyInCookie}} {{#isKeyInHeader}} ApiKeyToken apiKeyToken{{-index}} = (ApiKeyToken) await ApiKeyProvider.GetAsync("{{keyParamName}}", cancellationToken).ConfigureAwait(false); - tokenBases.Add(apiKeyToken{{-index}}); apiKeyToken{{-index}}.UseInHeader(httpRequestMessage); {{/isKeyInHeader}} {{/isKeyInCookie}} From 8c2fee763786e553ea4f8c364b3977bfee080f27 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 24 Oct 2025 00:29:24 +0200 Subject: [PATCH 052/126] Remove unused templates --- Adyen/Core/Auth/TokenProvider.cs | 2 +- templates-v7/csharp/ApiClient.mustache | 846 ------------------ templates-v7/csharp/ApiException.mustache | 60 -- templates-v7/csharp/ApiResponse.mustache | 158 ---- templates-v7/csharp/Configuration.mustache | 737 --------------- templates-v7/csharp/ExceptionFactory.mustache | 14 - .../csharp/GlobalConfiguration.mustache | 59 -- templates-v7/csharp/HttpMethod.mustache | 25 - .../csharp/HttpSigningConfiguration.mustache | 805 ----------------- templates-v7/csharp/IApiAccessor.mustache | 29 - .../csharp/IAsynchronousClient.mustache | 92 -- .../csharp/IReadableConfiguration.mustache | 178 ---- .../IReadableConfiguration.v790.mustache | 178 ---- .../csharp/ISynchronousClient.mustache | 85 -- .../csharp/JsonSubTypesTests.mustache | 125 --- templates-v7/csharp/Multimap.mustache | 287 ------ templates-v7/csharp/README.mustache | 267 ------ .../csharp/ReadOnlyDictionary.mustache | 137 --- templates-v7/csharp/RequestOptions.mustache | 87 -- .../csharp/RetryConfiguration.mustache | 41 - .../csharp/WebRequestPathBuilder.mustache | 45 - templates-v7/csharp/api.mustache | 799 ----------------- templates-v7/csharp/appveyor.mustache | 9 - .../generichost/HostConfiguration.mustache | 20 +- .../csharp/libraries/generichost/api.mustache | 72 +- templates-v7/csharp/model.mustache | 50 -- templates-v7/csharp/modelAnyOf.mustache | 275 ------ templates-v7/csharp/modelEnum.mustache | 185 ---- templates-v7/csharp/modelGeneric.mustache | 435 --------- templates-v7/csharp/modelInnerEnum.mustache | 99 -- templates-v7/csharp/modelOneOf.mustache | 320 ------- templates-v7/csharp/model_doc.mustache | 22 - templates-v7/csharp/model_test.mustache | 87 -- templates-v7/csharp/openapi.mustache | 1 - templates-v7/csharp/partial_header.mustache | 3 +- 35 files changed, 52 insertions(+), 6582 deletions(-) delete mode 100644 templates-v7/csharp/ApiClient.mustache delete mode 100644 templates-v7/csharp/ApiException.mustache delete mode 100644 templates-v7/csharp/ApiResponse.mustache delete mode 100644 templates-v7/csharp/Configuration.mustache delete mode 100644 templates-v7/csharp/ExceptionFactory.mustache delete mode 100644 templates-v7/csharp/GlobalConfiguration.mustache delete mode 100644 templates-v7/csharp/HttpMethod.mustache delete mode 100644 templates-v7/csharp/HttpSigningConfiguration.mustache delete mode 100644 templates-v7/csharp/IApiAccessor.mustache delete mode 100644 templates-v7/csharp/IAsynchronousClient.mustache delete mode 100644 templates-v7/csharp/IReadableConfiguration.mustache delete mode 100644 templates-v7/csharp/IReadableConfiguration.v790.mustache delete mode 100644 templates-v7/csharp/ISynchronousClient.mustache delete mode 100644 templates-v7/csharp/JsonSubTypesTests.mustache delete mode 100644 templates-v7/csharp/Multimap.mustache delete mode 100644 templates-v7/csharp/README.mustache delete mode 100644 templates-v7/csharp/ReadOnlyDictionary.mustache delete mode 100644 templates-v7/csharp/RequestOptions.mustache delete mode 100644 templates-v7/csharp/RetryConfiguration.mustache delete mode 100644 templates-v7/csharp/WebRequestPathBuilder.mustache delete mode 100644 templates-v7/csharp/api.mustache delete mode 100644 templates-v7/csharp/appveyor.mustache delete mode 100644 templates-v7/csharp/model.mustache delete mode 100644 templates-v7/csharp/modelAnyOf.mustache delete mode 100644 templates-v7/csharp/modelEnum.mustache delete mode 100644 templates-v7/csharp/modelGeneric.mustache delete mode 100644 templates-v7/csharp/modelInnerEnum.mustache delete mode 100644 templates-v7/csharp/modelOneOf.mustache delete mode 100644 templates-v7/csharp/model_doc.mustache delete mode 100644 templates-v7/csharp/model_test.mustache delete mode 100644 templates-v7/csharp/openapi.mustache diff --git a/Adyen/Core/Auth/TokenProvider.cs b/Adyen/Core/Auth/TokenProvider.cs index 9b63d3286..47f741657 100644 --- a/Adyen/Core/Auth/TokenProvider.cs +++ b/Adyen/Core/Auth/TokenProvider.cs @@ -26,7 +26,7 @@ public abstract class TokenProvider where TTokenBase : TokenBase /// protected TTokenBase[] _tokens; - internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + internal abstract TTokenBase Get(string header = ""); /// /// Instantiates a TokenProvider. diff --git a/templates-v7/csharp/ApiClient.mustache b/templates-v7/csharp/ApiClient.mustache deleted file mode 100644 index 3e7746753..000000000 --- a/templates-v7/csharp/ApiClient.mustache +++ /dev/null @@ -1,846 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters; -using System.Text; -using System.Threading; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -{{^net60OrLater}} -using System.Web; -{{/net60OrLater}} -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using RestSharp; -using RestSharp.Serializers; -using RestSharpMethod = RestSharp.Method; -using FileIO = System.IO.File; -{{#supportsRetry}} -using Polly; -{{/supportsRetry}} -{{#hasOAuthMethods}} -using {{packageName}}.Client.Auth; -{{/hasOAuthMethods}} -using {{packageName}}.{{modelPackage}}; - -namespace {{packageName}}.Client -{ - /// - /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. - /// - internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer - { - private readonly IReadableConfiguration _configuration; - private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - public CustomJsonCodec(IReadableConfiguration configuration) - { - _configuration = configuration; - } - - public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) - { - _serializerSettings = serializerSettings; - _configuration = configuration; - } - - /// - /// Serialize the object into a JSON string. - /// - /// Object to be serialized. - /// A JSON string. - public string Serialize(object obj) - { - if (obj != null && obj is AbstractOpenAPISchema) - { - // the object to be serialized is an oneOf/anyOf schema - return ((AbstractOpenAPISchema)obj).ToJson(); - } - else - { - return JsonConvert.SerializeObject(obj, _serializerSettings); - } - } - - public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); - - public T Deserialize(RestResponse response) - { - var result = (T)Deserialize(response, typeof(T)); - return result; - } - - /// - /// Deserialize the JSON string into a proper object. - /// - /// The HTTP response. - /// Object type. - /// Object representation of the JSON string. - internal object Deserialize(RestResponse response, Type type) - { - if (type == typeof(byte[])) // return byte array - { - return response.RawBytes; - } - - // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) - if (type == typeof(Stream)) - { - var bytes = response.RawBytes; - if (response.Headers != null) - { - var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? global::System.IO.Path.GetTempPath() - : _configuration.TempFolderPath; - var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); - foreach (var header in response.Headers) - { - var match = regex.Match(header.ToString()); - if (match.Success) - { - string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - FileIO.WriteAllBytes(fileName, bytes); - return new FileStream(fileName, FileMode.Open); - } - } - } - var stream = new MemoryStream(bytes); - return stream; - } - - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object - { - return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); - } - - if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type - { - return Convert.ChangeType(response.Content, type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); - } - catch (Exception e) - { - throw new ApiException(500, e.Message); - } - } - - public ISerializer Serializer => this; - public IDeserializer Deserializer => this; - - public string[] AcceptedContentTypes => ContentType.JsonAccept; - - public SupportsContentType SupportsContentType => contentType => - contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || - contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - - public ContentType ContentType { get; set; } = ContentType.Json; - - public DataFormat DataFormat => DataFormat.Json; - } - {{! NOTE: Any changes related to RestSharp should be done in this class. All other client classes are for extensibility by consumers.}} - /// - /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), - /// encapsulating general REST accessor use cases. - /// - {{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} - { - private readonly string _baseUrl; - - /// - /// Specifies the settings on a object. - /// These settings can be adjusted to accommodate custom serialization rules. - /// - public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings - { - // OpenAPI generated types generally hide default constructors. - ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy - { - OverrideSpecifiedNames = false - } - } - }; - - /// - /// Allows for extending request processing for generated code. - /// - /// The RestSharp request object - {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptRequest(RestRequest request){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} - - /// - /// Allows for extending response processing for generated code. - /// - /// The RestSharp request object - /// The RestSharp response object - {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptResponse(RestRequest request, RestResponse response){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} - - /// - /// Initializes a new instance of the , defaulting to the global configurations' base url. - /// - public ApiClient() - { - _baseUrl = GlobalConfiguration.Instance.BasePath; - } - - /// - /// Initializes a new instance of the - /// - /// The target service's base path in URL format. - /// - public ApiClient(string basePath) - { - if (string.IsNullOrEmpty(basePath)) - throw new ArgumentException("basePath cannot be empty"); - - _baseUrl = basePath; - } - - /// - /// Constructs the RestSharp version of an http method - /// - /// Swagger Client Custom HttpMethod - /// RestSharp's HttpMethod instance. - /// - private RestSharpMethod Method(HttpMethod method) - { - RestSharpMethod other; - switch (method) - { - case HttpMethod.Get: - other = RestSharpMethod.Get; - break; - case HttpMethod.Post: - other = RestSharpMethod.Post; - break; - case HttpMethod.Put: - other = RestSharpMethod.Put; - break; - case HttpMethod.Delete: - other = RestSharpMethod.Delete; - break; - case HttpMethod.Head: - other = RestSharpMethod.Head; - break; - case HttpMethod.Options: - other = RestSharpMethod.Options; - break; - case HttpMethod.Patch: - other = RestSharpMethod.Patch; - break; - default: - throw new ArgumentOutOfRangeException("method", method, null); - } - - return other; - } - - /// - /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. - /// Here, it is simply mapped into the RestSharp request. - /// - /// The http verb. - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. - /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. - /// [private] A new RestRequest instance. - /// - private RestRequest NewRequest( - HttpMethod method, - string path, - RequestOptions options, - IReadableConfiguration configuration) - { - if (path == null) throw new ArgumentNullException("path"); - if (options == null) throw new ArgumentNullException("options"); - if (configuration == null) throw new ArgumentNullException("configuration"); - - RestRequest request = new RestRequest(path, Method(method)); - - if (options.PathParameters != null) - { - foreach (var pathParam in options.PathParameters) - { - request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); - } - } - - if (options.QueryParameters != null) - { - foreach (var queryParam in options.QueryParameters) - { - foreach (var value in queryParam.Value) - { - request.AddQueryParameter(queryParam.Key, value); - } - } - } - - if (configuration.DefaultHeaders != null) - { - foreach (var headerParam in configuration.DefaultHeaders) - { - request.AddHeader(headerParam.Key, headerParam.Value); - } - } - - if (options.HeaderParameters != null) - { - foreach (var headerParam in options.HeaderParameters) - { - foreach (var value in headerParam.Value) - { - request.AddOrUpdateHeader(headerParam.Key, value); - } - } - } - - if (options.FormParameters != null) - { - foreach (var formParam in options.FormParameters) - { - request.AddParameter(formParam.Key, formParam.Value); - } - } - - if (options.Data != null) - { - if (options.Data is Stream stream) - { - var contentType = "application/octet-stream"; - if (options.HeaderParameters != null) - { - var contentTypes = options.HeaderParameters["Content-Type"]; - contentType = contentTypes[0]; - } - - var bytes = ClientUtils.ReadAsBytes(stream); - request.AddParameter(contentType, bytes, ParameterType.RequestBody); - } - else - { - if (options.HeaderParameters != null) - { - var contentTypes = options.HeaderParameters["Content-Type"]; - if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) - { - request.RequestFormat = DataFormat.Json; - } - else - { - // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. - } - } - else - { - // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. - request.RequestFormat = DataFormat.Json; - } - - request.AddJsonBody(options.Data); - } - } - - if (options.FileParameters != null) - { - foreach (var fileParam in options.FileParameters) - { - foreach (var file in fileParam.Value) - { - var bytes = ClientUtils.ReadAsBytes(file); - var fileStream = file as FileStream; - if (fileStream != null) - request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); - else - request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); - } - } - } - - if (options.HeaderParameters != null) - { - if (options.HeaderParameters.TryGetValue("Content-Type", out var contentTypes) && contentTypes.Any(header => header.Contains("multipart/form-data"))) - { - request.AlwaysMultipartFormData = true; - } - } - - return request; - } - - /// - /// Transforms a RestResponse instance into a new ApiResponse instance. - /// At this point, we have a concrete http response from the service. - /// Here, it is simply mapped into the [public] ApiResponse object. - /// - /// The RestSharp response object - /// A new ApiResponse instance. - private ApiResponse ToApiResponse(RestResponse response) - { - T result = response.Data; - string rawContent = response.Content; - - var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) - { - ErrorText = response.ErrorMessage, - Cookies = new List() - }; - - if (response.Headers != null) - { - foreach (var responseHeader in response.Headers) - { - transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - if (response.ContentHeaders != null) - { - foreach (var responseHeader in response.ContentHeaders) - { - transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); - } - } - - if (response.Cookies != null) - { - foreach (var responseCookies in response.Cookies.Cast()) - { - transformed.Cookies.Add( - new Cookie( - responseCookies.Name, - responseCookies.Value, - responseCookies.Path, - responseCookies.Domain) - ); - } - } - - return transformed; - } - - /// - /// Executes the HTTP request for the current service. - /// Based on functions received it can be async or sync. - /// - /// Local function that executes http request and returns http response. - /// Local function to specify options for the service. - /// The RestSharp request object - /// The RestSharp options object - /// A per-request configuration object. - /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. - /// A new ApiResponse instance. - private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) - { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var clientOptions = new RestClientOptions(baseUrl) - { - ClientCertificates = configuration.ClientCertificates, - Timeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback - }; - setOptions(clientOptions); - - {{#hasOAuthMethods}} - if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(configuration.OAuthClientId) && - !string.IsNullOrEmpty(configuration.OAuthClientSecret) && - configuration.OAuthFlow != null) - { - clientOptions.Authenticator = new OAuthAuthenticator( - configuration.OAuthTokenUrl, - configuration.OAuthClientId, - configuration.OAuthClientSecret, - configuration.OAuthScope, - configuration.OAuthFlow, - SerializerSettings, - configuration); - } - - {{/hasOAuthMethods}} - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) - { - InterceptRequest(request); - - RestResponse response = await getResponse(client).ConfigureAwait(false); - - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - try - { - response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - catch (Exception ex) - { - throw ex.InnerException != null ? ex.InnerException : ex; - } - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } - else if (typeof(T).Name == "String") // for string response - { - response.Data = (T)(object)response.Content; - } - - InterceptResponse(request, response); - - var result = ToApiResponse(response); - if (response.ErrorMessage != null) - { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) - { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); - } - } - return result; - } - } - - private async Task> DeserializeRestResponseFromPolicyAsync(RestClient client, RestRequest request, PolicyResult policyResult, CancellationToken cancellationToken = default) - { - if (policyResult.Outcome == OutcomeType.Successful) - { - return await client.Deserialize(policyResult.Result, cancellationToken).ConfigureAwait(false); - } - else - { - return new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - } - - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) - { - Action setOptions = (clientOptions) => - { - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - clientOptions.CookieContainer = cookies; - }; - - Func>> getResponse = (client) => - { - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - return DeserializeRestResponseFromPolicyAsync(client, request, policyResult); - } - else - { - return Task.FromResult(client.Execute(request)); - } - }; - - return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); - } - - {{#supportsAsync}} - private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default) - { - Action setOptions = (clientOptions) => - { - //no extra options - }; - - Func>> getResponse = async (client) => - { - {{#supportsRetry}} - if (RetryConfiguration.AsyncRetryPolicy != null) - { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken).ConfigureAwait(false); - } - else - { - {{/supportsRetry}} - return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); - {{#supportsRetry}} - } - {{/supportsRetry}} - }; - - return ExecClientAsync(getResponse, setOptions, request, options, configuration); - } - - #region IAsynchronousClient - /// - /// Make a HTTP GET request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP POST request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP PUT request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP DELETE request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP HEAD request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP OPTION request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); - } - - /// - /// Make a HTTP PATCH request (async). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// Token that enables callers to cancel the request. - /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) - { - var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); - } - #endregion IAsynchronousClient - {{/supportsAsync}} - - #region ISynchronousClient - /// - /// Make a HTTP GET request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config); - } - - /// - /// Make a HTTP POST request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config); - } - - /// - /// Make a HTTP PUT request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config); - } - - /// - /// Make a HTTP DELETE request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config); - } - - /// - /// Make a HTTP HEAD request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config); - } - - /// - /// Make a HTTP OPTION request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config); - } - - /// - /// Make a HTTP PATCH request (synchronous). - /// - /// The target path (or resource). - /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. - /// A Task containing ApiResponse - public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) - { - var config = configuration ?? GlobalConfiguration.Instance; - return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config); - } - #endregion ISynchronousClient - } -} diff --git a/templates-v7/csharp/ApiException.mustache b/templates-v7/csharp/ApiException.mustache deleted file mode 100644 index f7dadc557..000000000 --- a/templates-v7/csharp/ApiException.mustache +++ /dev/null @@ -1,60 +0,0 @@ -{{>partial_header}} - -using System; - -namespace {{packageName}}.Client -{ - /// - /// API Exception - /// - {{>visibility}} class ApiException : Exception - { - /// - /// Gets or sets the error code (HTTP status code) - /// - /// The error code (HTTP status code). - public int ErrorCode { get; set; } - - /// - /// Gets or sets the error content (body json object) - /// - /// The error content (Http response body). - public object ErrorContent { get; private set; } - - /// - /// Gets or sets the HTTP headers - /// - /// HTTP headers - public Multimap Headers { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - public ApiException() { } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error message. - public ApiException(int errorCode, string message) : base(message) - { - this.ErrorCode = errorCode; - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error message. - /// Error content. - /// HTTP Headers. - public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) - { - this.ErrorCode = errorCode; - this.ErrorContent = errorContent; - this.Headers = headers; - } - } - -} diff --git a/templates-v7/csharp/ApiResponse.mustache b/templates-v7/csharp/ApiResponse.mustache deleted file mode 100644 index 130626f5b..000000000 --- a/templates-v7/csharp/ApiResponse.mustache +++ /dev/null @@ -1,158 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.Net; - -namespace {{packageName}}.{{corePackageName}}.{{clientPackage}} -{ - /// - /// Provides a non-generic contract for the ApiResponse wrapper. - /// - public interface IApiResponse - { - /// - /// The data type of - /// - Type ResponseType { get; } - - /// - /// The content of this response - /// - Object Content { get; } - - /// - /// Gets or sets the status code (HTTP status code) - /// - /// The status code. - HttpStatusCode StatusCode { get; } - - /// - /// Gets or sets the HTTP headers - /// - /// HTTP headers - Multimap Headers { get; } - - /// - /// Gets or sets any error text defined by the calling client. - /// - string ErrorText { get; set; } - - /// - /// Gets or sets any cookies passed along on the response. - /// - List Cookies { get; set; } - - /// - /// The raw content of this response - /// - string RawContent { get; } - } - - /// - /// API Response - /// - public class ApiResponse : IApiResponse - { - #region Properties - - /// - /// Gets or sets the status code (HTTP status code) - /// - /// The status code. - public HttpStatusCode StatusCode { get; } - - /// - /// Gets or sets the HTTP headers - /// - /// HTTP headers - public Multimap Headers { get; } - - /// - /// Gets or sets the data (parsed HTTP body) - /// - /// The data. - public T Data { get; } - - /// - /// Gets or sets any error text defined by the calling client. - /// - public string ErrorText { get; set; } - - /// - /// Gets or sets any cookies passed along on the response. - /// - public List Cookies { get; set; } - - /// - /// The content of this response - /// - public Type ResponseType - { - get { return typeof(T); } - } - - /// - /// The data type of - /// - public object Content - { - get { return Data; } - } - - /// - /// The raw content - /// - public string RawContent { get; } - - #endregion Properties - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// HTTP headers. - /// Data (parsed HTTP body) - /// Raw content. - public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) - { - StatusCode = statusCode; - Headers = headers; - Data = data; - RawContent = rawContent; - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// HTTP headers. - /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Data (parsed HTTP body) - /// Raw content. - public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Data (parsed HTTP body) - public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) - { - } - - #endregion Constructors - } -} diff --git a/templates-v7/csharp/Configuration.mustache b/templates-v7/csharp/Configuration.mustache deleted file mode 100644 index 39dbd9c03..000000000 --- a/templates-v7/csharp/Configuration.mustache +++ /dev/null @@ -1,737 +0,0 @@ -{{>partial_header}} - -using System; -{{^net35}} -using System.Collections.Concurrent; -{{/net35}} -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Net.Http; -using System.Net.Security; -{{#useRestSharp}} -{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; -{{/hasOAuthMethods}} -{{/useRestSharp}} - -namespace {{packageName}}.Client -{ - /// - /// Represents a set of configuration settings - /// - {{>visibility}} class Configuration : IReadableConfiguration - { - #region Constants - - /// - /// Version of the package. - /// - /// Version of the package. - public const string Version = "{{packageVersion}}"; - - /// - /// Identifier for ISO 8601 DateTime Format - /// - /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. - // ReSharper disable once InconsistentNaming - public const string ISO8601_DATETIME_FORMAT = "o"; - - #endregion Constants - - #region Static Members - - /// - /// Default creation of exceptions for a given method name and response object - /// - public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => - { - var status = (int)response.StatusCode; - if (status >= 400) - { - return new ApiException(status, - string.Format("Error calling {0}: {1}", methodName, response.RawContent), - response.RawContent, response.Headers); - } - {{^netStandard}} - if (status == 0) - { - return new ApiException(status, - string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); - } - {{/netStandard}} - return null; - }; - - #endregion Static Members - - #region Private Members - - /// - /// Defines the base path of the target API server. - /// Example: http://localhost:3000/v1/ - /// - private string _basePath; - - private bool _useDefaultCredentials = false; - - /// - /// Gets or sets the API key based on the authentication name. - /// This is the key and value comprising the "secret" for accessing an API. - /// - /// The API key. - private IDictionary _apiKey; - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// The prefix of the API key. - private IDictionary _apiKeyPrefix; - - private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; - private string _tempFolderPath = Path.GetTempPath(); - {{#servers.0}} - - /// - /// Gets or sets the servers defined in the OpenAPI spec. - /// - /// The servers - private IList> _servers; - {{/servers.0}} - - /// - /// Gets or sets the operation servers defined in the OpenAPI spec. - /// - /// The operation servers - private IReadOnlyDictionary>> _operationServers; - - {{#hasHttpSignatureMethods}} - - /// - /// HttpSigning configuration - /// - private HttpSigningConfiguration _HttpSigningConfiguration = null; - {{/hasHttpSignatureMethods}} - #endregion Private Members - - #region Constructors - - /// - /// Initializes a new instance of the class - /// - [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] - public Configuration() - { - Proxy = null; - UserAgent = WebUtility.UrlEncode("{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"); - BasePath = "{{{basePath}}}"; - DefaultHeaders = new {{^net35}}Concurrent{{/net35}}Dictionary(); - ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); - ApiKeyPrefix = new {{^net35}}Concurrent{{/net35}}Dictionary(); - {{#servers}} - {{#-first}} - Servers = new List>() - { - {{/-first}} - { - new Dictionary { - {"url", "{{{url}}}"}, - {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, - {{#variables}} - {{#-first}} - { - "variables", new Dictionary { - {{/-first}} - { - "{{{name}}}", new Dictionary { - {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, - {"default_value", {{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}"{{{defaultValue}}}"}, - {{#enumValues}} - {{#-first}} - { - "enum_values", new List() { - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - } - } - {{/-last}} - {{/enumValues}} - } - }{{^-last}},{{/-last}} - {{#-last}} - } - } - {{/-last}} - {{/variables}} - } - }{{^-last}},{{/-last}} - {{#-last}} - }; - {{/-last}} - {{/servers}} - OperationServers = new Dictionary>>() - { - {{#apiInfo}} - {{#apis}} - {{#operations}} - {{#operation}} - {{#servers.0}} - { - "{{{classname}}}.{{{nickname}}}", new List> - { - {{#servers}} - { - new Dictionary - { - {"url", "{{{url}}}"}, - {"description", "{{{description}}}{{^description}}No description provided{{/description}}"} - } - }, - {{/servers}} - } - }, - {{/servers.0}} - {{/operation}} - {{/operations}} - {{/apis}} - {{/apiInfo}} - }; - - // Setting Timeout has side effects (forces ApiClient creation). - Timeout = TimeSpan.FromSeconds(100); - } - - /// - /// Initializes a new instance of the class - /// - [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] - public Configuration( - IDictionary defaultHeaders, - IDictionary apiKey, - IDictionary apiKeyPrefix, - string basePath = "{{{basePath}}}") : this() - { - if (string.{{^net35}}IsNullOrWhiteSpace{{/net35}}{{#net35}}IsNullOrEmpty{{/net35}}(basePath)) - throw new ArgumentException("The provided basePath is invalid.", "basePath"); - if (defaultHeaders == null) - throw new ArgumentNullException("defaultHeaders"); - if (apiKey == null) - throw new ArgumentNullException("apiKey"); - if (apiKeyPrefix == null) - throw new ArgumentNullException("apiKeyPrefix"); - - BasePath = basePath; - - foreach (var keyValuePair in defaultHeaders) - { - DefaultHeaders.Add(keyValuePair); - } - - foreach (var keyValuePair in apiKey) - { - ApiKey.Add(keyValuePair); - } - - foreach (var keyValuePair in apiKeyPrefix) - { - ApiKeyPrefix.Add(keyValuePair); - } - } - - #endregion Constructors - - #region Properties - - /// - /// Gets or sets the base path for API access. - /// - public virtual string BasePath - { - get { return _basePath; } - set { _basePath = value; } - } - - /// - /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. - /// - public virtual bool UseDefaultCredentials - { - get { return _useDefaultCredentials; } - set { _useDefaultCredentials = value; } - } - - /// - /// Gets or sets the default header. - /// - [Obsolete("Use DefaultHeaders instead.")] - public virtual IDictionary DefaultHeader - { - get - { - return DefaultHeaders; - } - set - { - DefaultHeaders = value; - } - } - - /// - /// Gets or sets the default headers. - /// - public virtual IDictionary DefaultHeaders { get; set; } - - /// - /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. - /// - public virtual TimeSpan Timeout { get; set; } - - /// - /// Gets or sets the proxy - /// - /// Proxy. - public virtual WebProxy Proxy { get; set; } - - /// - /// Gets or sets the HTTP user agent. - /// - /// Http user agent. - public virtual string UserAgent { get; set; } - - /// - /// Gets or sets the username (HTTP basic authentication). - /// - /// The username. - public virtual string Username { get; set; } - - /// - /// Gets or sets the password (HTTP basic authentication). - /// - /// The password. - public virtual string Password { get; set; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - public string GetApiKeyWithPrefix(string apiKeyIdentifier) - { - string apiKeyValue; - ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); - string apiKeyPrefix; - if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) - { - return apiKeyPrefix + " " + apiKeyValue; - } - - return apiKeyValue; - } - - /// - /// Gets or sets certificate collection to be sent with requests. - /// - /// X509 Certificate collection. - public X509CertificateCollection ClientCertificates { get; set; } - - /// - /// Gets or sets the access token for OAuth2 authentication. - /// - /// This helper property simplifies code generation. - /// - /// The access token. - public virtual string AccessToken { get; set; } - - {{#useRestSharp}} - {{#hasOAuthMethods}} - /// - /// Gets or sets the token URL for OAuth2 authentication. - /// - /// The OAuth Token URL. - public virtual string OAuthTokenUrl { get; set; } - - /// - /// Gets or sets the client ID for OAuth2 authentication. - /// - /// The OAuth Client ID. - public virtual string OAuthClientId { get; set; } - - /// - /// Gets or sets the client secret for OAuth2 authentication. - /// - /// The OAuth Client Secret. - public virtual string OAuthClientSecret { get; set; } - - /// - /// Gets or sets the client scope for OAuth2 authentication. - /// - /// The OAuth Client Scope. - public virtual string{{nrt?}} OAuthScope { get; set; } - - /// - /// Gets or sets the flow for OAuth2 authentication. - /// - /// The OAuth Flow. - public virtual OAuthFlow? OAuthFlow { get; set; } - - {{/hasOAuthMethods}} - {{/useRestSharp}} - /// - /// Gets or sets the temporary folder path to store the files downloaded from the server. - /// - /// Folder path. - public virtual string TempFolderPath - { - get { return _tempFolderPath; } - - set - { - if (string.IsNullOrEmpty(value)) - { - _tempFolderPath = Path.GetTempPath(); - return; - } - - // create the directory if it does not exist - if (!Directory.Exists(value)) - { - Directory.CreateDirectory(value); - } - - // check if the path contains directory separator at the end - if (value[value.Length - 1] == Path.DirectorySeparatorChar) - { - _tempFolderPath = value; - } - else - { - _tempFolderPath = value + Path.DirectorySeparatorChar; - } - } - } - - /// - /// Gets or sets the date time format used when serializing in the ApiClient - /// By default, it's set to ISO 8601 - "o", for others see: - /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx - /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx - /// No validation is done to ensure that the string you're providing is valid - /// - /// The DateTimeFormat string - public virtual string DateTimeFormat - { - get { return _dateTimeFormat; } - set - { - if (string.IsNullOrEmpty(value)) - { - // Never allow a blank or null string, go back to the default - _dateTimeFormat = ISO8601_DATETIME_FORMAT; - return; - } - - // Caution, no validation when you choose date time format other than ISO 8601 - // Take a look at the above links - _dateTimeFormat = value; - } - } - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// Whatever you set here will be prepended to the value defined in AddApiKey. - /// - /// An example invocation here might be: - /// - /// ApiKeyPrefix["Authorization"] = "Bearer"; - /// - /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. - /// - /// - /// OAuth2 workflows should set tokens via AccessToken. - /// - /// - /// The prefix of the API key. - public virtual IDictionary ApiKeyPrefix - { - get { return _apiKeyPrefix; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); - } - _apiKeyPrefix = value; - } - } - - /// - /// Gets or sets the API key based on the authentication name. - /// - /// The API key. - public virtual IDictionary ApiKey - { - get { return _apiKey; } - set - { - if (value == null) - { - throw new InvalidOperationException("ApiKey collection may not be null."); - } - _apiKey = value; - } - } - {{#servers.0}} - - /// - /// Gets or sets the servers. - /// - /// The servers. - public virtual IList> Servers - { - get { return _servers; } - set - { - if (value == null) - { - throw new InvalidOperationException("Servers may not be null."); - } - _servers = value; - } - } - - /// - /// Gets or sets the operation servers. - /// - /// The operation servers. - public virtual IReadOnlyDictionary>> OperationServers - { - get { return _operationServers; } - set - { - if (value == null) - { - throw new InvalidOperationException("Operation servers may not be null."); - } - _operationServers = value; - } - } - - /// - /// Returns URL based on server settings without providing values - /// for the variables - /// - /// Array index of the server settings. - /// The server URL. - public string GetServerUrl(int index) - { - return GetServerUrl(Servers, index, null); - } - - /// - /// Returns URL based on server settings. - /// - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The server URL. - public string GetServerUrl(int index, Dictionary inputVariables) - { - return GetServerUrl(Servers, index, inputVariables); - } - - /// - /// Returns URL based on operation server settings. - /// - /// Operation associated with the request path. - /// Array index of the server settings. - /// The operation server URL. - public string GetOperationServerUrl(string operation, int index) - { - return GetOperationServerUrl(operation, index, null); - } - - /// - /// Returns URL based on operation server settings. - /// - /// Operation associated with the request path. - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The operation server URL. - public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) - { - if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) - { - return GetServerUrl(operationServer, index, inputVariables); - } - - return null; - } - - /// - /// Returns URL based on server settings. - /// - /// Dictionary of server settings. - /// Array index of the server settings. - /// Dictionary of the variables and the corresponding values. - /// The server URL. - private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) - { - if (index < 0 || index >= servers.Count) - { - throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); - } - - if (inputVariables == null) - { - inputVariables = new Dictionary(); - } - - IReadOnlyDictionary server = servers[index]; - string url = (string)server["url"]; - - if (server.ContainsKey("variables")) - { - // go through each variable and assign a value - foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) - { - - IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); - - if (inputVariables.ContainsKey(variable.Key)) - { - if (!serverVariables.ContainsKey("enum_values") || ((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) - { - url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); - } - else - { - throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); - } - } - else - { - // use default value - url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); - } - } - } - - return url; - } - {{/servers.0}} - {{#hasHttpSignatureMethods}} - - /// - /// Gets and Sets the HttpSigningConfiguration - /// - public HttpSigningConfiguration HttpSigningConfiguration - { - get { return _HttpSigningConfiguration; } - set { _HttpSigningConfiguration = value; } - } - {{/hasHttpSignatureMethods}} - - /// - /// Gets and Sets the RemoteCertificateValidationCallback - /// - public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } - - #endregion Properties - - #region Methods - - /// - /// Returns a string with essential information for debugging. - /// - public static string ToDebugReport() - { - string report = "C# SDK ({{{packageName}}}) Debug Report:\n"; - report += " OS: " + System.Environment.OSVersion + "\n"; - report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: {{{version}}}\n"; - report += " SDK Package Version: {{{packageVersion}}}\n"; - - return report; - } - - /// - /// Add Api Key Header. - /// - /// Api Key name. - /// Api Key value. - /// - public void AddApiKey(string key, string value) - { - ApiKey[key] = value; - } - - /// - /// Sets the API key prefix. - /// - /// Api Key name. - /// Api Key value. - public void AddApiKeyPrefix(string key, string value) - { - ApiKeyPrefix[key] = value; - } - - #endregion Methods - - #region Static Members - /// - /// Merge configurations. - /// - /// First configuration. - /// Second configuration. - /// Merged configuration. - public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) - { - if (second == null) return first ?? GlobalConfiguration.Instance; - - Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - - foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; - foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; - foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; - - var config = new Configuration - { - ApiKey = apiKey, - ApiKeyPrefix = apiKeyPrefix, - DefaultHeaders = defaultHeaders, - BasePath = second.BasePath ?? first.BasePath, - Timeout = second.Timeout, - Proxy = second.Proxy ?? first.Proxy, - UserAgent = second.UserAgent ?? first.UserAgent, - Username = second.Username ?? first.Username, - Password = second.Password ?? first.Password, - AccessToken = second.AccessToken ?? first.AccessToken, - {{#useRestSharp}} - {{#hasOAuthMethods}} - OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, - OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, - OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, - OAuthScope = second.OAuthScope ?? first.OAuthScope, - OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, - {{/hasOAuthMethods}} - {{/useRestSharp}} - {{#hasHttpSignatureMethods}} - HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, - {{/hasHttpSignatureMethods}} - TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, - DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, - ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, - UseDefaultCredentials = second.UseDefaultCredentials, - RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, - }; - return config; - } - #endregion Static Members - } -} diff --git a/templates-v7/csharp/ExceptionFactory.mustache b/templates-v7/csharp/ExceptionFactory.mustache deleted file mode 100644 index 4a141f6f1..000000000 --- a/templates-v7/csharp/ExceptionFactory.mustache +++ /dev/null @@ -1,14 +0,0 @@ -{{>partial_header}} - -using System; - -namespace {{packageName}}.Client -{ - /// - /// A delegate to ExceptionFactory method - /// - /// Method name - /// Response - /// Exceptions - {{>visibility}} delegate Exception ExceptionFactory(string methodName, IApiResponse response); -} diff --git a/templates-v7/csharp/GlobalConfiguration.mustache b/templates-v7/csharp/GlobalConfiguration.mustache deleted file mode 100644 index 93a9ab8aa..000000000 --- a/templates-v7/csharp/GlobalConfiguration.mustache +++ /dev/null @@ -1,59 +0,0 @@ -{{>partial_header}} - -using System.Collections.Generic; - -namespace {{packageName}}.Client -{ - /// - /// provides a compile-time extension point for globally configuring - /// API Clients. - /// - /// - /// A customized implementation via partial class may reside in another file and may - /// be excluded from automatic generation via a .openapi-generator-ignore file. - /// - {{>visibility}} partial class GlobalConfiguration : Configuration - { - #region Private Members - - private static readonly object GlobalConfigSync = new { }; - private static IReadableConfiguration _globalConfiguration; - - #endregion Private Members - - #region Constructors - - /// - private GlobalConfiguration() - { - } - - /// - public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) - { - } - - static GlobalConfiguration() - { - Instance = new GlobalConfiguration(); - } - - #endregion Constructors - - /// - /// Gets or sets the default Configuration. - /// - /// Configuration. - public static IReadableConfiguration Instance - { - get { return _globalConfiguration; } - set - { - lock (GlobalConfigSync) - { - _globalConfiguration = value; - } - } - } - } -} diff --git a/templates-v7/csharp/HttpMethod.mustache b/templates-v7/csharp/HttpMethod.mustache deleted file mode 100644 index 904a042a9..000000000 --- a/templates-v7/csharp/HttpMethod.mustache +++ /dev/null @@ -1,25 +0,0 @@ -{{>partial_header}} - -namespace {{packageName}}.Client -{ - /// - /// Http methods supported by swagger - /// - public enum HttpMethod - { - /// HTTP GET request. - Get, - /// HTTP POST request. - Post, - /// HTTP PUT request. - Put, - /// HTTP DELETE request. - Delete, - /// HTTP HEAD request. - Head, - /// HTTP OPTIONS request. - Options, - /// HTTP PATCH request. - Patch - } -} diff --git a/templates-v7/csharp/HttpSigningConfiguration.mustache b/templates-v7/csharp/HttpSigningConfiguration.mustache deleted file mode 100644 index 2d56fde4a..000000000 --- a/templates-v7/csharp/HttpSigningConfiguration.mustache +++ /dev/null @@ -1,805 +0,0 @@ -{{>partial_header}} - -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using System; -using System.Collections.Generic; -using System.IO; -using System.Runtime.InteropServices; -using System.Security; -using System.Security.Cryptography; -using System.Text; -using System.Web; - -namespace {{packageName}}.Client -{ - /// - /// Class for HttpSigning auth related parameter and methods - /// - public class HttpSigningConfiguration - { - /// - /// Initialize the HashAlgorithm and SigningAlgorithm to default value - /// - public HttpSigningConfiguration() - { - HashAlgorithm = HashAlgorithmName.SHA256; - SigningAlgorithm = "PKCS1-v15"; - } - - /// - ///Gets the Api keyId - /// - public string KeyId { get; set; } - - /// - /// Gets the Key file path - /// - public string KeyFilePath { get; set; } - - /// - /// Specify the API key in the form of a string, either configure the KeyString property or configure the KeyFilePath property. - /// - public string KeyString { get; set; } - - /// - /// Gets the key pass phrase for password protected key - /// - public SecureString KeyPassPhrase { get; set; } - - /// - /// Gets the HTTP signing header - /// - public List HttpSigningHeader { get; set; } - - /// - /// Gets the hash algorithm sha256 or sha512 - /// - public HashAlgorithmName HashAlgorithm { get; set; } - - /// - /// Gets the signing algorithm - /// - public string SigningAlgorithm { get; set; } - - /// - /// Gets the Signature validity period in seconds - /// - public int SignatureValidityPeriod { get; set; } - - private enum PrivateKeyType - { - None = 0, - RSA = 1, - ECDSA = 2, - } - - /// - /// Gets the Headers for HttpSigning - /// - /// Base path - /// HTTP method - /// Path - /// Request options - /// Http signed headers - public Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) - { - const string HEADER_REQUEST_TARGET = "(request-target)"; - //The time when the HTTP signature expires. The API server should reject HTTP requests - //that have expired. - const string HEADER_EXPIRES = "(expires)"; - //The 'Date' header. - const string HEADER_DATE = "Date"; - //The 'Host' header. - const string HEADER_HOST = "Host"; - //The time when the HTTP signature was generated. - const string HEADER_CREATED = "(created)"; - //When the 'Digest' header is included in the HTTP signature, the client automatically - //computes the digest of the HTTP request body, per RFC 3230. - const string HEADER_DIGEST = "Digest"; - //The 'Authorization' header is automatically generated by the client. It includes - //the list of signed headers and a base64-encoded signature. - const string HEADER_AUTHORIZATION = "Authorization"; - - //Read the api key from the file - if(File.Exists(KeyFilePath)) - { - this.KeyString = ReadApiKeyFromFile(KeyFilePath); - } - else if(string.IsNullOrEmpty(KeyString)) - { - throw new Exception("No API key has been provided. Supply it using either KeyFilePath or KeyString"); - } - - //Hash table to store singed headers - var HttpSignedRequestHeader = new Dictionary(); - var HttpSignatureHeader = new Dictionary(); - - if (HttpSigningHeader.Count == 0) - { - HttpSigningHeader.Add("(created)"); - } - - if (requestOptions.PathParameters != null) - { - foreach (var pathParam in requestOptions.PathParameters) - { - var tempPath = path.Replace(pathParam.Key, "0"); - path = string.Format(tempPath, pathParam.Value); - } - } - - var httpValues = HttpUtility.ParseQueryString(string.Empty); - foreach (var parameter in requestOptions.QueryParameters) - { -#if (NETCOREAPP) - string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9") ? parameter.Key : {{#net90OrLater}}HttpUtility.UrlEncode({{/net90OrLater}}parameter.Key{{#net90OrLater}}){{/net90OrLater}}; - if (parameter.Value.Count > 1) - { // array - foreach (var value in parameter.Value) - { - httpValues.Add(key + "[]", value); - } - } - else - { - httpValues.Add(key, parameter.Value[0]); - } -#else - if (parameter.Value.Count > 1) - { // array - foreach (var value in parameter.Value) - { - httpValues.Add(parameter.Key + "[]", value); - } - } - else - { - httpValues.Add(parameter.Key, parameter.Value[0]); - } -#endif - } - var uriBuilder = new UriBuilder(string.Concat(basePath, path)); - uriBuilder.Query = httpValues.ToString().Replace("+", "%20"); - - var dateTime = DateTime.Now; - string Digest = string.Empty; - - //get the body - string requestBody = string.Empty; - if (requestOptions.Data != null) - { - var serializerSettings = new JsonSerializerSettings(); - requestBody = JsonConvert.SerializeObject(requestOptions.Data, serializerSettings); - } - - if (HashAlgorithm == HashAlgorithmName.SHA256) - { - var bodyDigest = GetStringHash(HashAlgorithm, requestBody); - Digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); - } - else if (HashAlgorithm == HashAlgorithmName.SHA512) - { - var bodyDigest = GetStringHash(HashAlgorithm, requestBody); - Digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); - } - else - { - throw new Exception(string.Format("{0} not supported", HashAlgorithm)); - } - - foreach (var header in HttpSigningHeader) - { - if (header.Equals(HEADER_REQUEST_TARGET)) - { - var targetUrl = string.Format("{0} {1}{2}", method.ToLower(), uriBuilder.Path, uriBuilder.Query); - HttpSignatureHeader.Add(header.ToLower(), targetUrl); - } - else if (header.Equals(HEADER_EXPIRES)) - { - var expireDateTime = dateTime.AddSeconds(SignatureValidityPeriod); - HttpSignatureHeader.Add(header.ToLower(), GetUnixTime(expireDateTime).ToString()); - } - else if (header.Equals(HEADER_DATE)) - { - var utcDateTime = dateTime.ToUniversalTime().ToString("r"); - HttpSignatureHeader.Add(header.ToLower(), utcDateTime); - HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); - } - else if (header.Equals(HEADER_HOST)) - { - HttpSignatureHeader.Add(header.ToLower(), uriBuilder.Host); - HttpSignedRequestHeader.Add(HEADER_HOST, uriBuilder.Host); - } - else if (header.Equals(HEADER_CREATED)) - { - HttpSignatureHeader.Add(header.ToLower(), GetUnixTime(dateTime).ToString()); - } - else if (header.Equals(HEADER_DIGEST)) - { - HttpSignedRequestHeader.Add(HEADER_DIGEST, Digest); - HttpSignatureHeader.Add(header.ToLower(), Digest); - } - else - { - bool isHeaderFound = false; - foreach (var item in requestOptions.HeaderParameters) - { - if (string.Equals(item.Key, header, StringComparison.OrdinalIgnoreCase)) - { - HttpSignatureHeader.Add(header.ToLower(), item.Value.ToString()); - isHeaderFound = true; - break; - } - } - if (!isHeaderFound) - { - throw new Exception(string.Format("Cannot sign HTTP request.Request does not contain the {0} header.",header)); - } - } - - } - var headersKeysString = string.Join(" ", HttpSignatureHeader.Keys); - var headerValuesList = new List(); - - foreach (var keyVal in HttpSignatureHeader) - { - headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); - } - //Concatenate headers value separated by new line - var headerValuesString = string.Join("\n", headerValuesList); - var signatureStringHash = GetStringHash(HashAlgorithm, headerValuesString); - string headerSignatureStr = null; - var keyType = GetKeyType(KeyString); - - if (keyType == PrivateKeyType.RSA) - { - headerSignatureStr = GetRSASignature(signatureStringHash); - } - else if (keyType == PrivateKeyType.ECDSA) - { - headerSignatureStr = GetECDSASignature(signatureStringHash); - } - else - { - throw new Exception(string.Format("Private key type {0} not supported", keyType)); - } - const string cryptographicScheme = "hs2019"; - var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", - KeyId, cryptographicScheme); - - if (HttpSignatureHeader.ContainsKey(HEADER_CREATED)) - { - authorizationHeaderValue += string.Format(",created={0}", HttpSignatureHeader[HEADER_CREATED]); - } - - if (HttpSignatureHeader.ContainsKey(HEADER_EXPIRES)) - { - authorizationHeaderValue += string.Format(",expires={0}", HttpSignatureHeader[HEADER_EXPIRES]); - } - - authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", - headersKeysString, headerSignatureStr); - HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); - return HttpSignedRequestHeader; - } - - private byte[] GetStringHash(HashAlgorithmName hashAlgorithmName, string stringToBeHashed) - { - HashAlgorithm{{nrt?}} hashAlgorithm = null; - - if (hashAlgorithmName == HashAlgorithmName.SHA1) - hashAlgorithm = SHA1.Create(); - - if (hashAlgorithmName == HashAlgorithmName.SHA256) - hashAlgorithm = SHA256.Create(); - - if (hashAlgorithmName == HashAlgorithmName.SHA512) - hashAlgorithm = SHA512.Create(); - - if (hashAlgorithmName == HashAlgorithmName.MD5) - hashAlgorithm = MD5.Create(); - - if (hashAlgorithm == null) - throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); - - byte[] bytes = Encoding.UTF8.GetBytes(stringToBeHashed); - byte[] stringHash = hashAlgorithm.ComputeHash(bytes); - return stringHash; - } - - private int GetUnixTime(DateTime date2) - { - DateTime date1 = new DateTime(1970, 01, 01); - TimeSpan timeSpan = date2 - date1; - return (int)timeSpan.TotalSeconds; - } - - private string GetRSASignature(byte[] stringToSign) - { - if (string.IsNullOrEmpty(KeyString)) - { - throw new Exception("No API key has been provided."); - } - RSA rsa = GetRSAProviderFromPemFile(KeyString, KeyPassPhrase); - if (SigningAlgorithm == "RSASSA-PSS") - { - var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); - return Convert.ToBase64String(signedbytes); - } - else if (SigningAlgorithm == "PKCS1-v15") - { - var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); - return Convert.ToBase64String(signedbytes); - } - else - { - return string.Empty; - } - } - - /// - /// Gets the ECDSA signature - /// - /// - /// ECDSA signature - private string GetECDSASignature(byte[] dataToSign) - { - {{#net60OrLater}} - if (!File.Exists(KeyFilePath) && string.IsNullOrEmpty(KeyString)) - { - throw new Exception("No API key has been provided."); - } - - var keyStr = KeyString; - const string ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; - const string ecKeyFooter = "-----END EC PRIVATE KEY-----"; - var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); - var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); - var ecdsa = ECDsa.Create(); - - var byteCount = 0; - if (KeyPassPhrase != null) - { - IntPtr unmanagedString = IntPtr.Zero; - try - { - // convert secure string to byte array - unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(KeyPassPhrase); - ecdsa.ImportEncryptedPkcs8PrivateKey(Encoding.UTF8.GetBytes(Marshal.PtrToStringUni(unmanagedString)), keyBytes, out byteCount); - } - finally - { - if (unmanagedString != IntPtr.Zero) - { - Marshal.ZeroFreeBSTR(unmanagedString); - } - } - } - else - ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); - - var derBytes = ecdsa.SignHash(dataToSign, DSASignatureFormat.Rfc3279DerSequence); - var signedString = System.Convert.ToBase64String(derBytes); - - return signedString; - {{/net60OrLater}} - {{^net60OrLater}} - throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); - {{/net60OrLater}} - } - - /// - /// Convert ANS1 format to DER format. Not recommended to use because it generate invalid signature occasionally. - /// - /// - /// - private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) - { - var derBytes = new List(); - byte derLength = 68; //default length for ECDSA code signing bit 0x44 - byte rbytesLength = 32; //R length 0x20 - byte sbytesLength = 32; //S length 0x20 - var rBytes = new List(); - var sBytes = new List(); - for (int i = 0; i < 32; i++) - { - rBytes.Add(signedBytes[i]); - } - for (int i = 32; i < 64; i++) - { - sBytes.Add(signedBytes[i]); - } - - if (rBytes[0] > 0x7F) - { - derLength++; - rbytesLength++; - var tempBytes = new List(); - tempBytes.AddRange(rBytes); - rBytes.Clear(); - rBytes.Add(0x00); - rBytes.AddRange(tempBytes); - } - - if (sBytes[0] > 0x7F) - { - derLength++; - sbytesLength++; - var tempBytes = new List(); - tempBytes.AddRange(sBytes); - sBytes.Clear(); - sBytes.Add(0x00); - sBytes.AddRange(tempBytes); - - } - - derBytes.Add(48); //start of the sequence 0x30 - derBytes.Add(derLength); //total length r length, type and r bytes - - derBytes.Add(2); //tag for integer - derBytes.Add(rbytesLength); //length of r - derBytes.AddRange(rBytes); - - derBytes.Add(2); //tag for integer - derBytes.Add(sbytesLength); //length of s - derBytes.AddRange(sBytes); - return derBytes.ToArray(); - } - - private RSACryptoServiceProvider GetRSAProviderFromPemFile(string keyString, SecureString keyPassPhrase = null) - { - if (string.IsNullOrEmpty(KeyString)) - { - throw new Exception("No API key has been provided."); - } - - const string pempubheader = "-----BEGIN PUBLIC KEY-----"; - const string pempubfooter = "-----END PUBLIC KEY-----"; - bool isPrivateKeyFile = true; - byte[] pemkey = null; - string pemstr = keyString; - - if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) - { - isPrivateKeyFile = false; - } - - if (isPrivateKeyFile) - { - pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase); - if (pemkey == null) - { - return null; - } - return DecodeRSAPrivateKey(pemkey); - } - return null; - } - - private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase = null) - { - const string pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; - const string pemprivfooter = "-----END RSA PRIVATE KEY-----"; - string pemstr = instr.Trim(); - byte[] binkey; - - if (!pemstr.StartsWith(pemprivheader) || !pemstr.EndsWith(pemprivfooter)) - { - return null; - } - - StringBuilder sb = new StringBuilder(pemstr); - sb.Replace(pemprivheader, ""); - sb.Replace(pemprivfooter, ""); - string pvkstr = sb.ToString().Trim(); - - try - { // if there are no PEM encryption info lines, this is an UNencrypted PEM private key - binkey = Convert.FromBase64String(pvkstr); - return binkey; - } - catch (global::System.FormatException) - { - StringReader str = new StringReader(pvkstr); - - //-------- read PEM encryption info. lines and extract salt ----- - if (!str.ReadLine().StartsWith("Proc-Type: 4,ENCRYPTED")) - { - return null; - } - string saltline = str.ReadLine(); - if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) - { - return null; - } - string saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); - byte[] salt = new byte[saltstr.Length / 2]; - for (int i = 0; i < salt.Length; i++) - salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); - if (str.ReadLine() != "") - { - return null; - } - - //------ remaining b64 data is encrypted RSA key ---- - string encryptedstr = str.ReadToEnd(); - - try - { //should have b64 encrypted RSA key now - binkey = Convert.FromBase64String(encryptedstr); - } - catch (global::System.FormatException) - { //data is not in base64 format - return null; - } - - byte[] deskey = GetEncryptedKey(salt, keyPassPhrase, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes - if (deskey == null) - { - return null; - } - - //------ Decrypt the encrypted 3des-encrypted RSA private key ------ - byte[] rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV - return rsakey; - } - } - - private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) - { - byte[] bytesModulus, bytesE, bytesD, bytesP, bytesQ, bytesDP, bytesDQ, bytesIQ; - - // --------- Set up stream to decode the asn.1 encoded RSA private key ------ - MemoryStream mem = new MemoryStream(privkey); - BinaryReader binr = new BinaryReader(mem); //wrap Memory Stream with BinaryReader for easy reading - byte bt = 0; - ushort twobytes = 0; - int elems = 0; - try - { - twobytes = binr.ReadUInt16(); - if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) - { - binr.ReadByte(); //advance 1 byte - } - else if (twobytes == 0x8230) - { - binr.ReadInt16(); //advance 2 bytes - } - else - { - return null; - } - - twobytes = binr.ReadUInt16(); - if (twobytes != 0x0102) //version number - { - return null; - } - bt = binr.ReadByte(); - if (bt != 0x00) - { - return null; - } - - //------ all private key components are Integer sequences ---- - elems = GetIntegerSize(binr); - bytesModulus = binr.ReadBytes(elems); - - elems = GetIntegerSize(binr); - bytesE = binr.ReadBytes(elems); - - elems = GetIntegerSize(binr); - bytesD = binr.ReadBytes(elems); - - elems = GetIntegerSize(binr); - bytesP = binr.ReadBytes(elems); - - elems = GetIntegerSize(binr); - bytesQ = binr.ReadBytes(elems); - - elems = GetIntegerSize(binr); - bytesDP = binr.ReadBytes(elems); - - elems = GetIntegerSize(binr); - bytesDQ = binr.ReadBytes(elems); - - elems = GetIntegerSize(binr); - bytesIQ = binr.ReadBytes(elems); - - // ------- create RSACryptoServiceProvider instance and initialize with public key ----- - RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); - RSAParameters RSAparams = new RSAParameters(); - RSAparams.Modulus = bytesModulus; - RSAparams.Exponent = bytesE; - RSAparams.D = bytesD; - RSAparams.P = bytesP; - RSAparams.Q = bytesQ; - RSAparams.DP = bytesDP; - RSAparams.DQ = bytesDQ; - RSAparams.InverseQ = bytesIQ; - RSA.ImportParameters(RSAparams); - return RSA; - } - catch (Exception) - { - return null; - } - finally - { - binr.Close(); - } - } - - private int GetIntegerSize(BinaryReader binr) - { - byte bt = 0; - byte lowbyte = 0x00; - byte highbyte = 0x00; - int count = 0; - bt = binr.ReadByte(); - if (bt != 0x02) //expect integer - { - return 0; - } - bt = binr.ReadByte(); - - if (bt == 0x81) - { - count = binr.ReadByte(); // data size in next byte - } - else if (bt == 0x82) - { - highbyte = binr.ReadByte(); // data size in next 2 bytes - lowbyte = binr.ReadByte(); - byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; - count = BitConverter.ToInt32(modint, 0); - } - else - { - count = bt; // we already have the data size - } - while (binr.ReadByte() == 0x00) - { - //remove high order zeros in data - count -= 1; - } - binr.BaseStream.Seek(-1, SeekOrigin.Current); - //last ReadByte wasn't a removed zero, so back up a byte - return count; - } - - private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) - { - IntPtr unmanagedPswd = IntPtr.Zero; - const int HASHLENGTH = 16; //MD5 bytes - byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results - - byte[] psbytes = new byte[secpswd.Length]; - unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd); - Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length); - Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd); - - // --- concatenate salt and pswd bytes into fixed data array --- - byte[] data00 = new byte[psbytes.Length + salt.Length]; - Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes - Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes - - // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- - MD5 md5 = MD5.Create(); - byte[] result = null; - byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget - - for (int j = 0; j < miter; j++) - { - // ---- Now hash consecutively for count times ------ - if (j == 0) - { - result = data00; //initialize - } - else - { - Array.Copy(result, hashtarget, result.Length); - Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); - result = hashtarget; - } - - for (int i = 0; i < count; i++) - { - result = md5.ComputeHash(result); - } - Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial - } - byte[] deskey = new byte[24]; - Array.Copy(keymaterial, deskey, deskey.Length); - - Array.Clear(psbytes, 0, psbytes.Length); - Array.Clear(data00, 0, data00.Length); - Array.Clear(result, 0, result.Length); - Array.Clear(hashtarget, 0, hashtarget.Length); - Array.Clear(keymaterial, 0, keymaterial.Length); - return deskey; - } - - private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) - { - MemoryStream memst = new MemoryStream(); - TripleDES alg = TripleDES.Create(); - alg.Key = desKey; - alg.IV = IV; - try - { - CryptoStream cs = new CryptoStream(memst, alg.CreateDecryptor(), CryptoStreamMode.Write); - cs.Write(cipherData, 0, cipherData.Length); - cs.Close(); - } - catch (Exception) - { - return null; - } - byte[] decryptedData = memst.ToArray(); - return decryptedData; - } - - /// - /// Detect the key type from the pem file. - /// - /// api key in string format - /// Private Key Type - private PrivateKeyType GetKeyType(string keyString) - { - string[] key = null; - - if (string.IsNullOrEmpty(keyString)) - { - throw new Exception("No API key has been provided."); - } - - const string ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; - const string ecPrivateKeyFooter = "END EC PRIVATE KEY"; - const string rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; - const string rsaPrivateFooter = "END RSA PRIVATE KEY"; - //var pkcs8Header = "BEGIN PRIVATE KEY"; - //var pkcs8Footer = "END PRIVATE KEY"; - PrivateKeyType keyType; - key = KeyString.TrimEnd().Split('\n'); - - if (key[0].Contains(rsaPrivateKeyHeader) && - key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) - { - keyType = PrivateKeyType.RSA; - } - else if (key[0].Contains(ecPrivateKeyHeader) && - key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) - { - keyType = PrivateKeyType.ECDSA; - } - else - { - throw new Exception("The key file path does not exist or key is invalid or key is not supported"); - } - return keyType; - } - - /// - /// Read the api key form the api key file path and stored it in KeyString property. - /// - /// api key file path - private string ReadApiKeyFromFile(string apiKeyFilePath) - { - string apiKeyString = null; - - if(File.Exists(apiKeyFilePath)) - { - apiKeyString = File.ReadAllText(apiKeyFilePath); - } - else - { - throw new Exception("Provided API key file path does not exists."); - } - return apiKeyString; - } - } -} diff --git a/templates-v7/csharp/IApiAccessor.mustache b/templates-v7/csharp/IApiAccessor.mustache deleted file mode 100644 index a269f56e9..000000000 --- a/templates-v7/csharp/IApiAccessor.mustache +++ /dev/null @@ -1,29 +0,0 @@ -{{>partial_header}} - -using System; - -namespace {{packageName}}.Client -{ - /// - /// Represents configuration aspects required to interact with the API endpoints. - /// - {{>visibility}} interface IApiAccessor - { - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - IReadableConfiguration Configuration { get; set; } - - /// - /// Gets the base path of the API client. - /// - /// The base path - string GetBasePath(); - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - ExceptionFactory ExceptionFactory { get; set; } - } -} diff --git a/templates-v7/csharp/IAsynchronousClient.mustache b/templates-v7/csharp/IAsynchronousClient.mustache deleted file mode 100644 index d68e87bb9..000000000 --- a/templates-v7/csharp/IAsynchronousClient.mustache +++ /dev/null @@ -1,92 +0,0 @@ -{{>partial_header}} - -using System; -using System.Threading.Tasks; - -namespace {{packageName}}.Client -{ - /// - /// Contract for Asynchronous RESTful API interactions. - /// - /// This interface allows consumers to provide a custom API accessor client. - /// - public interface IAsynchronousClient - { - /// - /// Executes a non-blocking call to some using the GET http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Executes a non-blocking call to some using the POST http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Executes a non-blocking call to some using the PUT http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Executes a non-blocking call to some using the DELETE http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Executes a non-blocking call to some using the HEAD http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Executes a non-blocking call to some using the OPTIONS http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - - /// - /// Executes a non-blocking call to some using the PATCH http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// Cancellation Token to cancel the request. - /// The return type. - /// A task eventually representing the response data, decorated with - Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); - } -} diff --git a/templates-v7/csharp/IReadableConfiguration.mustache b/templates-v7/csharp/IReadableConfiguration.mustache deleted file mode 100644 index 6712aa632..000000000 --- a/templates-v7/csharp/IReadableConfiguration.mustache +++ /dev/null @@ -1,178 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Security; -using System.Security.Cryptography.X509Certificates; -{{#useRestSharp}} -{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; -{{/hasOAuthMethods}} -{{/useRestSharp}} - -namespace {{packageName}}.Client -{ - /// - /// Represents a readable-only configuration contract. - /// - public interface IReadableConfiguration - { - /// - /// Gets the access token. - /// - /// Access token. - string AccessToken { get; } - - {{#useRestSharp}} - {{#hasOAuthMethods}} - /// - /// Gets the OAuth token URL. - /// - /// OAuth Token URL. - string OAuthTokenUrl { get; } - - /// - /// Gets the OAuth client ID. - /// - /// OAuth Client ID. - string OAuthClientId { get; } - - /// - /// Gets the OAuth client secret. - /// - /// OAuth Client Secret. - string OAuthClientSecret { get; } - - /// - /// Gets the OAuth token scope. - /// - /// OAuth Token scope. - string{{nrt?}} OAuthScope { get; } - - /// - /// Gets the OAuth flow. - /// - /// OAuth Flow. - OAuthFlow? OAuthFlow { get; } - - {{/hasOAuthMethods}} - {{/useRestSharp}} - /// - /// Gets the API key. - /// - /// API key. - IDictionary ApiKey { get; } - - /// - /// Gets the API key prefix. - /// - /// API key prefix. - IDictionary ApiKeyPrefix { get; } - - /// - /// Gets the base path. - /// - /// Base path. - string BasePath { get; } - - /// - /// Gets the date time format. - /// - /// Date time format. - string DateTimeFormat { get; } - - /// - /// Gets the default header. - /// - /// Default header. - [Obsolete("Use DefaultHeaders instead.")] - IDictionary DefaultHeader { get; } - - /// - /// Gets the default headers. - /// - /// Default headers. - IDictionary DefaultHeaders { get; } - - /// - /// Gets the temp folder path. - /// - /// Temp folder path. - string TempFolderPath { get; } - - /// - /// Gets the HTTP connection timeout. - /// - /// HTTP connection timeout. - TimeSpan Timeout { get; } - - /// - /// Gets the proxy. - /// - /// Proxy. - WebProxy Proxy { get; } - - /// - /// Gets the user agent. - /// - /// User agent. - string UserAgent { get; } - - /// - /// Gets the username. - /// - /// Username. - string Username { get; } - - /// - /// Gets the password. - /// - /// Password. - string Password { get; } - - /// - /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. - /// - bool UseDefaultCredentials { get; } - - /// - /// Get the servers associated with the operation. - /// - /// Operation servers. - IReadOnlyDictionary>> OperationServers { get; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - string GetApiKeyWithPrefix(string apiKeyIdentifier); - - /// - /// Gets the Operation server url at the provided index. - /// - /// Operation server name. - /// Index of the operation server settings. - /// - string GetOperationServerUrl(string operation, int index); - - /// - /// Gets certificate collection to be sent with requests. - /// - /// X509 Certificate collection. - X509CertificateCollection ClientCertificates { get; } - {{#hasHttpSignatureMethods}} - - /// - /// Gets the HttpSigning configuration - /// - HttpSigningConfiguration HttpSigningConfiguration { get; } - {{/hasHttpSignatureMethods}} - - /// - /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and - /// overriding certificate errors in the scope of a request. - /// - RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } - } -} diff --git a/templates-v7/csharp/IReadableConfiguration.v790.mustache b/templates-v7/csharp/IReadableConfiguration.v790.mustache deleted file mode 100644 index 5981728b4..000000000 --- a/templates-v7/csharp/IReadableConfiguration.v790.mustache +++ /dev/null @@ -1,178 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Security; -using System.Security.Cryptography.X509Certificates; -{{#useRestSharp}} -{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; -{{/hasOAuthMethods}} -{{/useRestSharp}} - -namespace {{packageName}}.Client -{ - /// - /// Represents a readable-only configuration contract. - /// - public interface IReadableConfiguration - { - /// - /// Gets the access token. - /// - /// Access token. - string AccessToken { get; } - - {{#useRestSharp}} - {{#hasOAuthMethods}} - /// - /// Gets the OAuth token URL. - /// - /// OAuth Token URL. - string OAuthTokenUrl { get; } - - /// - /// Gets the OAuth client ID. - /// - /// OAuth Client ID. - string OAuthClientId { get; } - - /// - /// Gets the OAuth client secret. - /// - /// OAuth Client Secret. - string OAuthClientSecret { get; } - - /// - /// Gets the OAuth token scope. - /// - /// OAuth Token scope. - string{{nrt?}} OAuthScope { get; } - - /// - /// Gets the OAuth flow. - /// - /// OAuth Flow. - OAuthFlow? OAuthFlow { get; } - - {{/hasOAuthMethods}} - {{/useRestSharp}} - /// - /// Gets the API key. - /// - /// API key. - IDictionary ApiKey { get; } - - /// - /// Gets the API key prefix. - /// - /// API key prefix. - IDictionary ApiKeyPrefix { get; } - - /// - /// Gets the base path. - /// - /// Base path. - string BasePath { get; } - - /// - /// Gets the date time format. - /// - /// Date time format. - string DateTimeFormat { get; } - - /// - /// Gets the default header. - /// - /// Default header. - [Obsolete("Use DefaultHeaders instead.")] - IDictionary DefaultHeader { get; } - - /// - /// Gets the default headers. - /// - /// Default headers. - IDictionary DefaultHeaders { get; } - - /// - /// Gets the temp folder path. - /// - /// Temp folder path. - string TempFolderPath { get; } - - /// - /// Gets the HTTP connection timeout (in milliseconds) - /// - /// HTTP connection timeout. - int Timeout { get; } - - /// - /// Gets the proxy. - /// - /// Proxy. - WebProxy Proxy { get; } - - /// - /// Gets the user agent. - /// - /// User agent. - string UserAgent { get; } - - /// - /// Gets the username. - /// - /// Username. - string Username { get; } - - /// - /// Gets the password. - /// - /// Password. - string Password { get; } - - /// - /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. - /// - bool UseDefaultCredentials { get; } - - /// - /// Get the servers associated with the operation. - /// - /// Operation servers. - IReadOnlyDictionary>> OperationServers { get; } - - /// - /// Gets the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - string GetApiKeyWithPrefix(string apiKeyIdentifier); - - /// - /// Gets the Operation server url at the provided index. - /// - /// Operation server name. - /// Index of the operation server settings. - /// - string GetOperationServerUrl(string operation, int index); - - /// - /// Gets certificate collection to be sent with requests. - /// - /// X509 Certificate collection. - X509CertificateCollection ClientCertificates { get; } - {{#hasHttpSignatureMethods}} - - /// - /// Gets the HttpSigning configuration - /// - HttpSigningConfiguration HttpSigningConfiguration { get; } - {{/hasHttpSignatureMethods}} - - /// - /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and - /// overriding certificate errors in the scope of a request. - /// - RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } - } -} diff --git a/templates-v7/csharp/ISynchronousClient.mustache b/templates-v7/csharp/ISynchronousClient.mustache deleted file mode 100644 index c09bfbfed..000000000 --- a/templates-v7/csharp/ISynchronousClient.mustache +++ /dev/null @@ -1,85 +0,0 @@ -{{>partial_header}} - -using System; -using System.IO; - -namespace {{packageName}}.Client -{ - /// - /// Contract for Synchronous RESTful API interactions. - /// - /// This interface allows consumers to provide a custom API accessor client. - /// - public interface ISynchronousClient - { - /// - /// Executes a blocking call to some using the GET http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the POST http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the PUT http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the DELETE http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the HEAD http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the OPTIONS http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); - - /// - /// Executes a blocking call to some using the PATCH http verb. - /// - /// The relative path to invoke. - /// The request parameters to pass along to the client. - /// Per-request configurable settings. - /// The return type. - /// The response data, decorated with - ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); - } -} diff --git a/templates-v7/csharp/JsonSubTypesTests.mustache b/templates-v7/csharp/JsonSubTypesTests.mustache deleted file mode 100644 index 55b1d5183..000000000 --- a/templates-v7/csharp/JsonSubTypesTests.mustache +++ /dev/null @@ -1,125 +0,0 @@ -{{>partial_header}} - -using System.Collections.Generic; -using System.Linq; -using JsonSubTypes; -using Newtonsoft.Json; -using NUnit.Framework; - -using {{packageName}}.{{apiPackage}}; -using {{packageName}}.{{modelPackage}}; -using {{packageName}}.Client; - -namespace {{packageName}}.Test.Client -{ - public class JsonSubTypesTests - { - [Test] - public void TestSimpleJsonSubTypesExample() - { - var animal = - JsonConvert.DeserializeObject("{\"Kind\":\"Dog\",\"Breed\":\"Jack Russell Terrier\"}"); - Assert.AreEqual("Jack Russell Terrier", (animal as Dog)?.Breed); - } - - [Test] - public void DeserializeObjectWithCustomMapping() - { - var animal = - JsonConvert.DeserializeObject("{\"Sound\":\"Bark\",\"Breed\":\"Jack Russell Terrier\"}"); - Assert.AreEqual("Jack Russell Terrier", (animal as Dog2)?.Breed); - } - - [Test] - public void DeserializeObjectMappingByPropertyPresence() - { - string json = - "[{\"Department\":\"Department1\",\"JobTitle\":\"JobTitle1\",\"FirstName\":\"FirstName1\",\"LastName\":\"LastName1\"}," + - "{\"Department\":\"Department1\",\"JobTitle\":\"JobTitle1\",\"FirstName\":\"FirstName1\",\"LastName\":\"LastName1\"}," + - "{\"Skill\":\"Painter\",\"FirstName\":\"FirstName1\",\"LastName\":\"LastName1\"}]"; - - - var persons = JsonConvert.DeserializeObject>(json); - Assert.AreEqual("Painter", (persons.Last() as Artist)?.Skill); - } - } - - [JsonConverter(typeof(JsonSubtypes), "Kind")] - public interface IAnimal - { - string Kind { get; } - } - - public class Dog : IAnimal - { - public Dog() - { - Kind = "Dog"; - } - - public string Kind { get; } - public string Breed { get; set; } - } - - class Cat : IAnimal - { - public Cat() - { - Kind = "Cat"; - } - - public string Kind { get; } - bool Declawed { get; set; } - } - - [JsonConverter(typeof(JsonSubtypes), "Sound")] - [JsonSubtypes.KnownSubType(typeof(Dog2), "Bark")] - [JsonSubtypes.KnownSubType(typeof(Cat2), "Meow")] - public class Animal2 - { - public virtual string Sound { get; } - public string Color { get; set; } - } - - public class Dog2 : Animal2 - { - public Dog2() - { - Sound = "Bark"; - } - - public override string Sound { get; } - public string Breed { get; set; } - } - - public class Cat2 : Animal2 - { - public Cat2() - { - Sound = "Meow"; - } - - public override string Sound { get; } - public bool Declawed { get; set; } - } - - [JsonConverter(typeof(JsonSubtypes))] - [JsonSubtypes.KnownSubTypeWithProperty(typeof(Employee), "JobTitle")] - [JsonSubtypes.KnownSubTypeWithProperty(typeof(Artist), "Skill")] - public class Person - { - public string FirstName { get; set; } - public string LastName { get; set; } - } - - public class Employee : Person - { - public string Department { get; set; } - public string JobTitle { get; set; } - } - - public class Artist : Person - { - public string Skill { get; set; } - } -} diff --git a/templates-v7/csharp/Multimap.mustache b/templates-v7/csharp/Multimap.mustache deleted file mode 100644 index 8624af009..000000000 --- a/templates-v7/csharp/Multimap.mustache +++ /dev/null @@ -1,287 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections; -using System.Collections.Generic; - -namespace {{packageName}}.Client -{ - /// - /// A dictionary in which one key has many associated values. - /// - /// The type of the key - /// The type of the value associated with the key. - public class Multimap : IDictionary> - { - #region Private Fields - - private readonly Dictionary> _dictionary; - - #endregion Private Fields - - #region Constructors - - /// - /// Empty Constructor. - /// - public Multimap() - { - _dictionary = new Dictionary>(); - } - - /// - /// Constructor with comparer. - /// - /// - public Multimap(IEqualityComparer comparer) - { - _dictionary = new Dictionary>(comparer); - } - - #endregion Constructors - - #region Enumerators - - /// - /// To get the enumerator. - /// - /// Enumerator - public IEnumerator>> GetEnumerator() - { - return _dictionary.GetEnumerator(); - } - - /// - /// To get the enumerator. - /// - /// Enumerator - IEnumerator IEnumerable.GetEnumerator() - { - return _dictionary.GetEnumerator(); - } - - #endregion Enumerators - - #region Public Members - /// - /// Add values to Multimap - /// - /// Key value pair - public void Add(KeyValuePair> item) - { - if (!TryAdd(item.Key, item.Value)) - throw new InvalidOperationException("Could not add values to Multimap."); - } - - /// - /// Add Multimap to Multimap - /// - /// Multimap - public void Add(Multimap multimap) - { - foreach (var item in multimap) - { - if (!TryAdd(item.Key, item.Value)) - throw new InvalidOperationException("Could not add values to Multimap."); - } - } - - /// - /// Clear Multimap - /// - public void Clear() - { - _dictionary.Clear(); - } - - /// - /// Determines whether Multimap contains the specified item. - /// - /// Key value pair - /// Method needs to be implemented - /// true if the Multimap contains the item; otherwise, false. - public bool Contains(KeyValuePair> item) - { - throw new NotImplementedException(); - } - - /// - /// Copy items of the Multimap to an array, - /// starting at a particular array index. - /// - /// The array that is the destination of the items copied - /// from Multimap. The array must have zero-based indexing. - /// The zero-based index in array at which copying begins. - /// Method needs to be implemented - public void CopyTo(KeyValuePair>[] array, int arrayIndex) - { - throw new NotImplementedException(); - } - - /// - /// Removes the specified item from the Multimap. - /// - /// Key value pair - /// true if the item is successfully removed; otherwise, false. - /// Method needs to be implemented - public bool Remove(KeyValuePair> item) - { - throw new NotImplementedException(); - } - - /// - /// Gets the number of items contained in the Multimap. - /// - public int Count => _dictionary.Count; - - /// - /// Gets a value indicating whether the Multimap is read-only. - /// - public bool IsReadOnly => false; - - /// - /// Adds an item with the provided key and value to the Multimap. - /// - /// The object to use as the key of the item to add. - /// The object to use as the value of the item to add. - /// Thrown when couldn't add the value to Multimap. - public void Add(TKey key, IList value) - { - if (value != null && value.Count > 0) - { - if (_dictionary.TryGetValue(key, out var list)) - { - foreach (var k in value) list.Add(k); - } - else - { - list = new List(value); - if (!TryAdd(key, list)) - throw new InvalidOperationException("Could not add values to Multimap."); - } - } - } - - /// - /// Determines whether the Multimap contains an item with the specified key. - /// - /// The key to locate in the Multimap. - /// true if the Multimap contains an item with - /// the key; otherwise, false. - public bool ContainsKey(TKey key) - { - return _dictionary.ContainsKey(key); - } - - /// - /// Removes item with the specified key from the Multimap. - /// - /// The key to locate in the Multimap. - /// true if the item is successfully removed; otherwise, false. - public bool Remove(TKey key) - { - return TryRemove(key, out var _); - } - - /// - /// Gets the value associated with the specified key. - /// - /// The key whose value to get. - /// When this method returns, the value associated with the specified key, if the - /// key is found; otherwise, the default value for the type of the value parameter. - /// This parameter is passed uninitialized. - /// true if the object that implements Multimap contains - /// an item with the specified key; otherwise, false. - public bool TryGetValue(TKey key, out IList value) - { - return _dictionary.TryGetValue(key, out value); - } - - /// - /// Gets or sets the item with the specified key. - /// - /// The key of the item to get or set. - /// The value of the specified key. - public IList this[TKey key] - { - get => _dictionary[key]; - set => _dictionary[key] = value; - } - - /// - /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. - /// - public ICollection Keys => _dictionary.Keys; - - /// - /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. - /// - public ICollection> Values => _dictionary.Values; - - /// - /// Copy the items of the Multimap to an System.Array, - /// starting at a particular System.Array index. - /// - /// The one-dimensional System.Array that is the destination of the items copied - /// from Multimap. The System.Array must have zero-based indexing. - /// The zero-based index in array at which copying begins. - public void CopyTo(Array array, int index) - { - ((ICollection)_dictionary).CopyTo(array, index); - } - - /// - /// Adds an item with the provided key and value to the Multimap. - /// - /// The object to use as the key of the item to add. - /// The object to use as the value of the item to add. - /// Thrown when couldn't add value to Multimap. - public void Add(TKey key, TValue value) - { - if (value != null) - { - if (_dictionary.TryGetValue(key, out var list)) - { - list.Add(value); - } - else - { - list = new List { value }; - if (!TryAdd(key, list)) - throw new InvalidOperationException("Could not add value to Multimap."); - } - } - } - - #endregion Public Members - - #region Private Members - - /** - * Helper method to encapsulate generator differences between dictionary types. - */ - private bool TryRemove(TKey key, out IList value) - { - _dictionary.TryGetValue(key, out value); - return _dictionary.Remove(key); - } - - /** - * Helper method to encapsulate generator differences between dictionary types. - */ - private bool TryAdd(TKey key, IList value) - { - try - { - _dictionary.Add(key, value); - } - catch (ArgumentException) - { - return false; - } - - return true; - } - #endregion Private Members - } -} diff --git a/templates-v7/csharp/README.mustache b/templates-v7/csharp/README.mustache deleted file mode 100644 index 0ef94566a..000000000 --- a/templates-v7/csharp/README.mustache +++ /dev/null @@ -1,267 +0,0 @@ -# {{packageName}} - the C# library for the {{appName}} - -{{#appDescriptionWithNewLines}} -{{{.}}} -{{/appDescriptionWithNewLines}} - -This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: {{appVersion}} -- SDK version: {{packageVersion}} -{{^hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Generator version: {{generatorVersion}} -- Build package: {{generatorClass}} -{{#infoUrl}} - For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - - -## Frameworks supported -{{#netStandard}} -- .NET Core >=1.0 -- .NET Framework >=4.6 -- Mono/Xamarin >=vNext -{{/netStandard}} - - -## Dependencies - -{{#useRestSharp}} -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 112.0.0 or later -{{/useRestSharp}} -- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later -- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later -{{#useCompareNetObjects}} -- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later -{{/useCompareNetObjects}} -{{#validatable}} -- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later -{{/validatable}} - -The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: -``` -{{#useRestSharp}} -Install-Package RestSharp -{{/useRestSharp}} -Install-Package Newtonsoft.Json -Install-Package JsonSubTypes -{{#validatable}} -Install-Package System.ComponentModel.Annotations -{{/validatable}} -{{#useCompareNetObjects}} -Install-Package CompareNETObjects -{{/useCompareNetObjects}} -``` -{{#useRestSharp}} - -NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742). -NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406). - -{{/useRestSharp}} - -## Installation -{{#netStandard}} -Generate the DLL using your preferred tool (e.g. `dotnet build`) -{{/netStandard}} -{{^netStandard}} -Run the following command to generate the DLL -- [Mac/Linux] `/bin/sh build.sh` -- [Windows] `build.bat` -{{/netStandard}} - -Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: -```csharp -using {{packageName}}.{{apiPackage}}; -using {{packageName}}.Client; -using {{packageName}}.{{modelPackage}}; -``` -{{^netStandard}} - -## Packaging - -A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. - -This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly: - -``` -nuget pack -Build -OutputDirectory out {{packageName}}.csproj -``` - -Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. - -{{/netStandard}} - -## Usage - -To use the API client with a HTTP proxy, setup a `System.Net.WebProxy` -```csharp -Configuration c = new Configuration(); -System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/"); -webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; -c.Proxy = webProxy; -``` -{{#useHttpClient}} - -### Connections -Each ApiClass (properly the ApiClient inside it) will create an instance of HttpClient. It will use that for the entire lifecycle and dispose it when called the Dispose method. - -To better manager the connections it's a common practice to reuse the HttpClient and HttpClientHandler (see [here](https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net) for details). To use your own HttpClient instance just pass it to the ApiClass constructor. - -```csharp -HttpClientHandler yourHandler = new HttpClientHandler(); -HttpClient yourHttpClient = new HttpClient(yourHandler); -var api = new YourApiClass(yourHttpClient, yourHandler); -``` - -If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory. - -```csharp -HttpClient yourHttpClient = new HttpClient(); -var api = new YourApiClass(yourHttpClient); -``` -You'll loose some configuration settings, the features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. You need to either manually handle those in your setup of the HttpClient or they won't be available. - -Here an example of DI setup in a sample web project: - -```csharp -services.AddHttpClient(httpClient => - new PetApi(httpClient)); -``` - -{{/useHttpClient}} - - -## Getting Started - -```csharp -using System.Collections.Generic; -using System.Diagnostics; -{{#useHttpClient}} -using System.Net.Http; -{{/useHttpClient}} -using {{packageName}}.{{apiPackage}}; -using {{packageName}}.Client; -using {{packageName}}.{{modelPackage}}; - -namespace Example -{ - public class {{operationId}}Example - { - public static void Main() - { -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} - Configuration config = new Configuration(); - config.BasePath = "{{{basePath}}}"; - {{#hasAuthMethods}} - {{#authMethods}} - {{#isBasicBasic}} - // Configure HTTP basic authorization: {{{name}}} - config.Username = "YOUR_USERNAME"; - config.Password = "YOUR_PASSWORD"; - {{/isBasicBasic}} - {{#isBasicBearer}} - // Configure Bearer token for authorization: {{{name}}} - config.AccessToken = "YOUR_BEARER_TOKEN"; - {{/isBasicBearer}} - {{#isApiKey}} - // Configure API key authorization: {{{name}}} - config.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); - // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed - // config.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer"); - {{/isApiKey}} - {{#isOAuth}} - // Configure OAuth2 access token for authorization: {{{name}}} - config.AccessToken = "YOUR_ACCESS_TOKEN"; - {{/isOAuth}} - {{/authMethods}} - - {{/hasAuthMethods}} - {{#useHttpClient}} - // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes - HttpClient httpClient = new HttpClient(); - HttpClientHandler httpClientHandler = new HttpClientHandler(); - var apiInstance = new {{classname}}(httpClient, config, httpClientHandler); - {{/useHttpClient}} - {{^useHttpClient}} - var apiInstance = new {{classname}}(config); - {{/useHttpClient}} - {{#allParams}} - {{#isPrimitiveType}} - var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} - {{/isPrimitiveType}} - {{^isPrimitiveType}} - var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} - {{/isPrimitiveType}} - {{/allParams}} - - try - { - {{#summary}} - // {{{.}}} - {{/summary}} - {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - Debug.WriteLine(result);{{/returnType}} - } - catch (ApiException e) - { - Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); - Debug.Print("Status Code: "+ e.ErrorCode); - Debug.Print(e.StackTrace); - } -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} - } - } -} -``` - - -## Documentation for API Endpoints - -All URIs are relative to *{{{basePath}}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - - -## Documentation for Models - -{{#modelPackage}} -{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) -{{/model}}{{/models}} -{{/modelPackage}} -{{^modelPackage}} -No model defined in this package -{{/modelPackage}} - - -## Documentation for Authorization - -{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} -{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} -{{#authMethods}} - -### {{name}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{keyParamName}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasicBasic}}- **Type**: HTTP basic authentication -{{/isBasicBasic}} -{{#isBasicBearer}}- **Type**: Bearer Authentication -{{/isBasicBearer}} -{{#isHttpSignature}}- **Type**: HTTP signature authentication -{{/isHttpSignature}} -{{#isOAuth}}- **Type**: OAuth -- **Flow**: {{flow}} -- **Authorization URL**: {{authorizationUrl}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - {{scope}}: {{description}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} diff --git a/templates-v7/csharp/ReadOnlyDictionary.mustache b/templates-v7/csharp/ReadOnlyDictionary.mustache deleted file mode 100644 index 1299b2436..000000000 --- a/templates-v7/csharp/ReadOnlyDictionary.mustache +++ /dev/null @@ -1,137 +0,0 @@ -{{>partial_header}} -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace {{packageName}}.Client -{ - public class ReadOnlyDictionary : IDictionary - { - private IDictionary _dictionaryImplementation; - public IEnumerator> GetEnumerator() - { - return _dictionaryImplementation.GetEnumerator(); - } - - public ReadOnlyDictionary() - { - _dictionaryImplementation = new Dictionary(); - } - - public ReadOnlyDictionary(IDictionary dictionaryImplementation) - { - if (dictionaryImplementation == null) throw new ArgumentNullException("dictionaryImplementation"); - _dictionaryImplementation = dictionaryImplementation; - } - - IEnumerator IEnumerable.GetEnumerator() - { - return ((IEnumerable) _dictionaryImplementation).GetEnumerator(); - } - - public void Add(KeyValuePair item) - { - throw new ReadonlyOperationException("This instance is readonly."); - } - - public void Clear() - { - throw new ReadonlyOperationException("This instance is readonly."); - } - - public bool Contains(KeyValuePair item) - { - return _dictionaryImplementation.Contains(item); - } - - public void CopyTo(KeyValuePair[] array, int arrayIndex) - { - _dictionaryImplementation.CopyTo(array, arrayIndex); - } - - public bool Remove(KeyValuePair item) - { - throw new ReadonlyOperationException("This instance is readonly."); - } - - public int Count - { - get { return _dictionaryImplementation.Count; } - } - - public bool IsReadOnly - { - get { return true; } - } - - public void Add(T key, K value) - { - throw new ReadonlyOperationException("This instance is readonly."); - } - - public bool ContainsKey(T key) - { - return _dictionaryImplementation.ContainsKey(key); - } - - public bool Remove(T key) - { - throw new ReadonlyOperationException("This instance is readonly."); - } - - public bool TryGetValue(T key, out K value) - { - return _dictionaryImplementation.TryGetValue(key, out value); - } - - public K this[T key] - { - get { return _dictionaryImplementation[key]; } - set - { - throw new ReadonlyOperationException("This instance is readonly."); - - } - } - - public ICollection Keys - { - get { return _dictionaryImplementation.Keys; } - } - - public ICollection Values - { - get { return _dictionaryImplementation.Values; } - } - } - - [Serializable] - public class ReadonlyOperationException : Exception - { - // - // For guidelines regarding the creation of new exception types, see - // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp - // and - // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp - // - - public ReadonlyOperationException() - { - } - - public ReadonlyOperationException(string message) : base(message) - { - } - - public ReadonlyOperationException(string message, Exception inner) : base(message, inner) - { - } - - protected ReadonlyOperationException( - SerializationInfo info, - StreamingContext context) : base(info, context) - { - } - } -} diff --git a/templates-v7/csharp/RequestOptions.mustache b/templates-v7/csharp/RequestOptions.mustache deleted file mode 100644 index cfc146925..000000000 --- a/templates-v7/csharp/RequestOptions.mustache +++ /dev/null @@ -1,87 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.IO; -using System.Net; - -namespace {{packageName}}.Client -{ - /// - /// A container for generalized request inputs. This type allows consumers to extend the request functionality - /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). - /// - public class RequestOptions - { - /// - /// Parameters to be bound to path parts of the Request's URL - /// - public Dictionary PathParameters { get; set; } - - /// - /// Query parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap QueryParameters { get; set; } - - /// - /// Header parameters to be applied to the request. - /// Keys may have 1 or more values associated. - /// - public Multimap HeaderParameters { get; set; } - - /// - /// Form parameters to be sent along with the request. - /// - public Dictionary FormParameters { get; set; } - - {{#supportsFileParameters}} - /// - /// File parameters to be sent along with the request. - /// - public Multimap FileParameters { get; set; } - {{/supportsFileParameters}} - - /// - /// Cookies to be sent along with the request. - /// - public List Cookies { get; set; } - - /// - /// Operation associated with the request path. - /// - public string Operation { get; set; } - - /// - /// Index associated with the operation. - /// - public int OperationIndex { get; set; } - - /// - /// Any data associated with a request body. - /// - public Object Data { get; set; } - - {{#hasOAuthMethods}} - /// - /// If request should be authenticated with OAuth. - /// - public bool OAuth { get; set; } - - {{/hasOAuthMethods}} - /// - /// Constructs a new instance of - /// - public RequestOptions() - { - PathParameters = new Dictionary(); - QueryParameters = new Multimap(); - HeaderParameters = new Multimap(); - FormParameters = new Dictionary(); - {{#supportsFileParameters}} - FileParameters = new Multimap(); - {{/supportsFileParameters}} - Cookies = new List(); - } - } -} diff --git a/templates-v7/csharp/RetryConfiguration.mustache b/templates-v7/csharp/RetryConfiguration.mustache deleted file mode 100644 index 78f45b572..000000000 --- a/templates-v7/csharp/RetryConfiguration.mustache +++ /dev/null @@ -1,41 +0,0 @@ -{{>partial_header}} - -using Polly; -{{#useRestSharp}} -using RestSharp; -{{/useRestSharp}} -{{#useHttpClient}} -using System.Net.Http; -{{/useHttpClient}} - -namespace {{packageName}}.Client -{ - /// - /// Configuration class to set the polly retry policies to be applied to the requests. - /// - public static class RetryConfiguration - { -{{#useRestSharp}} - /// - /// Retry policy - /// - public static ISyncPolicy RetryPolicy { get; set; } - - /// - /// Async retry policy - /// - public static IAsyncPolicy AsyncRetryPolicy { get; set; } -{{/useRestSharp}} -{{#useHttpClient}} - /// - /// Retry policy - /// - public static ISyncPolicy RetryPolicy { get; set; } - - /// - /// Async retry policy - /// - public static IAsyncPolicy AsyncRetryPolicy { get; set; } -{{/useHttpClient}} - } -} diff --git a/templates-v7/csharp/WebRequestPathBuilder.mustache b/templates-v7/csharp/WebRequestPathBuilder.mustache deleted file mode 100644 index cc811ae4f..000000000 --- a/templates-v7/csharp/WebRequestPathBuilder.mustache +++ /dev/null @@ -1,45 +0,0 @@ -{{>partial_header}} -using System; -using System.Collections.Generic; - -namespace {{packageName}}.Client -{ - /// - /// A URI builder - /// - class WebRequestPathBuilder - { - private string _baseUrl; - private string _path; - private string _query = "?"; - public WebRequestPathBuilder(string baseUrl, string path) - { - _baseUrl = baseUrl; - _path = path; - } - - public void AddPathParameters(Dictionary parameters) - { - foreach (var parameter in parameters) - { - _path = _path.Replace("{" + parameter.Key + "}", Uri.EscapeDataString(parameter.Value)); - } - } - - public void AddQueryParameters(Multimap parameters) - { - foreach (var parameter in parameters) - { - foreach (var value in parameter.Value) - { - _query = _query + parameter.Key + "=" + Uri.EscapeDataString(value) + "&"; - } - } - } - - public string GetFullUri() - { - return _baseUrl + _path + _query.Substring(0, _query.Length - 1); - } - } -} diff --git a/templates-v7/csharp/api.mustache b/templates-v7/csharp/api.mustache deleted file mode 100644 index 84cc5d2a0..000000000 --- a/templates-v7/csharp/api.mustache +++ /dev/null @@ -1,799 +0,0 @@ -{{>partial_header}} - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Net; -using System.Net.Mime; -using {{packageName}}.{{clientPackage}}; -{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; -{{/hasOAuthMethods}} -{{#hasImport}}using {{packageName}}.{{modelPackage}}; -{{/hasImport}} - -namespace {{packageName}}.{{apiPackage}} -{ - {{#operations}} - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor - { - #region Synchronous Operations - {{#operation}} - /// - /// {{summary}} - /// - {{#notes}} - /// - /// {{.}} - /// - {{/notes}} - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// Index associated with the operation. - /// {{returnType}} - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); - - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// Index associated with the operation. - /// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} - {{#isDeprecated}} - [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] - {{/isDeprecated}} - ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); - {{/operation}} - #endregion Synchronous Operations - } - - {{#supportsAsync}} - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor - { - #region Asynchronous Operations - {{#operation}} - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of {{returnType}}{{^returnType}}void{{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); - - /// - /// {{summary}} - /// - /// - /// {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); - {{/operation}} - #endregion Asynchronous Operations - } - {{/supportsAsync}} - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} - { - - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - {{>visibility}} partial class {{classname}} : {{interfacePrefix}}{{classname}} - { - private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public {{classname}}() : this((string)null) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// - public {{classname}}(string basePath) - { - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - new {{packageName}}.Client.Configuration { BasePath = basePath } - ); - this.Client = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - {{#supportsAsync}} - this.AsynchronousClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - {{/supportsAsync}} - this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public {{classname}}({{packageName}}.Client.Configuration configuration) - { - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( - {{packageName}}.Client.GlobalConfiguration.Instance, - configuration - ); - this.Client = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - {{#supportsAsync}} - this.AsynchronousClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); - {{/supportsAsync}} - ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using a Configuration object and client instance. - /// - /// The client interface for synchronous API access.{{#supportsAsync}} - /// The client interface for asynchronous API access.{{/supportsAsync}} - /// The configuration object. - public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) - { - if (client == null) throw new ArgumentNullException("client"); - {{#supportsAsync}} - if (asyncClient == null) throw new ArgumentNullException("asyncClient"); - {{/supportsAsync}} - if (configuration == null) throw new ArgumentNullException("configuration"); - - this.Client = client; - {{#supportsAsync}} - this.AsynchronousClient = asyncClient; - {{/supportsAsync}} - this.Configuration = configuration; - this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; - } - - {{#supportsAsync}} - /// - /// The client for accessing this underlying API asynchronously. - /// - public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } - {{/supportsAsync}} - - /// - /// The client for accessing this underlying API synchronously. - /// - public {{packageName}}.Client.ISynchronousClient Client { get; set; } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public string GetBasePath() - { - return this.Configuration.BasePath; - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public {{packageName}}.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - {{#operation}} - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// Index associated with the operation. - /// {{returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) - { - {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} - } - - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// Index associated with the operation. - /// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) - { - {{#allParams}} - {{#required}} - {{^vendorExtensions.x-csharp-value-type}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) - { - throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); - } - - {{/vendorExtensions.x-csharp-value-type}} - {{/required}} - {{/allParams}} - {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - {{#consumes}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/consumes}} - }; - - // to determine the Accept header - string[] _accepts = new string[] { - {{#produces}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/produces}} - }; - - var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - var localVarMultipartFormData = localVarContentType == "multipart/form-data"; - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - {{#pathParams}} - {{#required}} - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - } - {{/required}} - {{/pathParams}} - {{#queryParams}} - {{#required}} - {{#isDeepObject}} - {{#items.vars}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isDeepObject}} - {{#items.vars}} - if ({{paramName}}.{{name}} != null) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{paramName}}[{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}]", {{paramName}}.{{name}})); - } - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - } - {{/required}} - {{/queryParams}} - {{#headerParams}} - {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - } - {{/required}} - {{/headerParams}} - {{#formParams}} - {{#required}} - {{#isFile}} - {{#isArray}} - {{#supportsFileParameters}} - foreach (var file in {{paramName}}) - { - localVarRequestOptions.FileParameters.Add("{{baseName}}", file); - } - {{/supportsFileParameters}} - {{/isArray}} - {{^isArray}} - {{#supportsFileParameters}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/supportsFileParameters}} - {{/isArray}} - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{#isPrimitiveType}}{{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}){{/isPrimitiveType}}{{^isPrimitiveType}}localVarMultipartFormData ? {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}) : {{packageName}}.Client.ClientUtils.Serialize({{paramName}}){{/isPrimitiveType}}); // form parameter - {{/isFile}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isFile}} - {{#isArray}} - {{#supportsFileParameters}} - foreach (var file in {{paramName}}) - { - localVarRequestOptions.FileParameters.Add("{{baseName}}", file); - } - {{/supportsFileParameters}} - {{/isArray}} - {{^isArray}} - {{#supportsFileParameters}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/supportsFileParameters}} - {{/isArray}} - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{#isPrimitiveType}}{{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}){{/isPrimitiveType}}{{^isPrimitiveType}}localVarMultipartFormData ? {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}) : {{packageName}}.Client.ClientUtils.Serialize({{paramName}}){{/isPrimitiveType}}); // form parameter - {{/isFile}} - } - {{/required}} - {{/formParams}} - {{#bodyParam}} - localVarRequestOptions.Data = {{paramName}}; - {{/bodyParam}} - - localVarRequestOptions.Operation = "{{classname}}.{{operationId}}"; - localVarRequestOptions.OperationIndex = operationIndex; - - {{#authMethods}} - // authentication ({{name}}) required - {{#isApiKey}} - {{#isKeyInCookie}} - // cookie parameter support - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInCookie}} - {{#isKeyInHeader}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); - } - {{/isKeyInHeader}} - {{#isKeyInQuery}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInQuery}} - {{/isApiKey}} - {{#isBasicBasic}} - // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); - } - {{/isBasicBasic}} - {{#isBasicBearer}} - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isBasicBearer}} - {{#isOAuth}} - // oauth required - if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{#hasOAuthMethods}} - else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && - !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && - this.Configuration.OAuthFlow != null) - { - localVarRequestOptions.OAuth = true; - } - {{/hasOAuthMethods}} - } - {{/isOAuth}} - {{#isHttpSignature}} - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } - {{/isHttpSignature}} - {{/authMethods}} - - // make the HTTP request - var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - {{#supportsAsync}} - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of {{returnType}}{{^returnType}}void{{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) - { - {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false);{{/returnType}} - } - - /// - /// {{summary}} {{notes}} - /// - /// Thrown when fails to make API call - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}} - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} - {{#isDeprecated}} - [Obsolete] - {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) - { - {{#allParams}} - {{#required}} - {{^vendorExtensions.x-csharp-value-type}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) - { - throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); - } - - {{/vendorExtensions.x-csharp-value-type}} - {{/required}} - {{/allParams}} - - {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - {{#consumes}} - "{{{mediaType}}}"{{^-last}}, {{/-last}} - {{/consumes}} - }; - - // to determine the Accept header - string[] _accepts = new string[] { - {{#produces}} - "{{{mediaType}}}"{{^-last}},{{/-last}} - {{/produces}} - }; - - var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - {{#constantParams}} - {{#isPathParam}} - // Set client side default value of Path Param "{{baseName}}". - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant path parameter - {{/isPathParam}} - {{/constantParams}} - {{#pathParams}} - {{#required}} - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter - } - {{/required}} - {{/pathParams}} - {{#constantParams}} - {{#isQueryParam}} - // Set client side default value of Query Param "{{baseName}}". - localVarRequestOptions.QueryParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant query parameter - {{/isQueryParam}} - {{/constantParams}} - {{#queryParams}} - {{#required}} - {{#isDeepObject}} - {{#items.vars}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isDeepObject}} - {{#items.vars}} - if ({{paramName}}.{{name}} != null) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{paramName}}[{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}]", {{paramName}}.{{name}})); - } - {{/items.vars}} - {{^items}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); - {{/items}} - {{/isDeepObject}} - {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); - {{/isDeepObject}} - } - {{/required}} - {{/queryParams}} - {{#constantParams}} - {{#isHeaderParam}} - // Set client side default value of Header Param "{{baseName}}". - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter - {{/isHeaderParam}} - {{/constantParams}} - {{#headerParams}} - {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter - } - {{/required}} - {{/headerParams}} - {{#formParams}} - {{#required}} - {{#isFile}} - {{#isArray}} - {{#supportsFileParameters}} - foreach (var file in {{paramName}}) - { - localVarRequestOptions.FileParameters.Add("{{baseName}}", file); - } - {{/supportsFileParameters}} - {{/isArray}} - {{^isArray}} - {{#supportsFileParameters}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/supportsFileParameters}} - {{/isArray}} - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter - {{/isFile}} - {{/required}} - {{^required}} - if ({{paramName}} != null) - { - {{#isFile}} - {{#isArray}} - {{#supportsFileParameters}} - foreach (var file in {{paramName}}) - { - localVarRequestOptions.FileParameters.Add("{{baseName}}", file); - } - {{/supportsFileParameters}} - {{/isArray}} - {{^isArray}} - {{#supportsFileParameters}} - localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); - {{/supportsFileParameters}} - {{/isArray}} - {{/isFile}} - {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter - {{/isFile}} - } - {{/required}} - {{/formParams}} - {{#bodyParam}} - localVarRequestOptions.Data = {{paramName}}; - {{/bodyParam}} - - localVarRequestOptions.Operation = "{{classname}}.{{operationId}}"; - localVarRequestOptions.OperationIndex = operationIndex; - - {{#authMethods}} - // authentication ({{name}}) required - {{#isApiKey}} - {{#isKeyInCookie}} - // cookie parameter support - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInCookie}} - {{#isKeyInHeader}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); - } - {{/isKeyInHeader}} - {{#isKeyInQuery}} - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); - } - {{/isKeyInQuery}} - {{/isApiKey}} - {{#isBasic}} - {{#isBasicBasic}} - // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); - } - {{/isBasicBasic}} - {{#isBasicBearer}} - // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{/isBasicBearer}} - {{/isBasic}} - {{#isOAuth}} - // oauth required - if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - {{#hasOAuthMethods}} - else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && - !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && - this.Configuration.OAuthFlow != null) - { - localVarRequestOptions.OAuth = true; - } - {{/hasOAuthMethods}} - } - {{/isOAuth}} - {{#isHttpSignature}} - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } - {{/isHttpSignature}} - {{/authMethods}} - - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - {{/supportsAsync}} - {{/operation}} - } - {{/operations}} -} diff --git a/templates-v7/csharp/appveyor.mustache b/templates-v7/csharp/appveyor.mustache deleted file mode 100644 index eb85fc2a8..000000000 --- a/templates-v7/csharp/appveyor.mustache +++ /dev/null @@ -1,9 +0,0 @@ -# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) -# -image: Visual Studio 2019 -clone_depth: 1 -build_script: -- dotnet build -c Release -- dotnet test -c Release -after_build: -- dotnet pack .\src\{{{packageName}}}\{{{packageName}}}.csproj -o ../../output -c Release --no-build diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 1cbc828e3..27d7a8f42 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -99,7 +99,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} /// Configures the HttpClients. /// /// - /// + /// /// public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} clientAction = null, Action{{nrt?}} builderAction = null) { @@ -120,7 +120,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} } /// - /// Configures the JsonSerializerSettings + /// Configures the . /// /// /// @@ -142,7 +142,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} } /// - /// Adds tokens to your IServiceCollection + /// Adds tokens to the . /// /// /// @@ -153,9 +153,19 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} _services.AddSingleton(container); return this; } - + + /// + /// Adds the to the . + /// + /// + /// + public HostConfiguration AddApiKey(ApiKeyToken apiKey) + { + return AddTokens(apiKey); + } + /// - /// Adds a token provider to your IServiceCollection + /// Adds the to the , used to retrieve the . /// /// /// diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index d15eff8e0..7463eb626 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -40,13 +40,13 @@ namespace {{packageName}}.{{apiPackage}} { {{#operations}} /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the API endpoints. /// This class is registered as transient. /// {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{packageName}}ApiService { /// - /// The class containing the events + /// The class containing the events. /// {{classname}}Events Events { get; } @@ -57,7 +57,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// {{notes}} /// - /// Thrown when fails to make API call + /// Thrown when fails to make API call. {{#allParams}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} @@ -76,21 +76,21 @@ namespace {{packageName}}.{{apiPackage}} {{#-first}} /// - /// The + /// The . /// {{>visibility}} interface {{interfacePrefix}}{{operationId}}ApiResponse : {{#lambda.joinWithComma}}{{packageName}}.{{corePackageName}}.{{clientPackage}}.{{interfacePrefix}}ApiResponse {{#responses}}{{#dataType}}{{interfacePrefix}}{{vendorExtensions.x-http-status}}<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{/dataType}}{{/responses}}{{/lambda.joinWithComma}} { {{#responses}} {{#vendorExtensions.x-http-status-is-default}} /// - /// Returns true if the response is the default response type + /// Returns true if the response is the default response type. /// /// bool Is{{vendorExtensions.x-http-status}} { get; } {{/vendorExtensions.x-http-status-is-default}} {{^vendorExtensions.x-http-status-is-default}} /// - /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}}. /// /// bool Is{{vendorExtensions.x-http-status}} { get; } @@ -106,19 +106,19 @@ namespace {{packageName}}.{{apiPackage}} {{/operation}} /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the API endpoints. /// {{>visibility}} class {{classname}}Events { {{#lambda.trimTrailingWithNewLine}} {{#operation}} /// - /// The event raised after the server response + /// The event raised after the server response. /// public event EventHandler{{nrt?}} On{{operationId}}; /// - /// The event raised after an error querying the server + /// The event raised after an error querying the server. /// public event EventHandler{{nrt?}} OnError{{operationId}}; @@ -137,49 +137,49 @@ namespace {{packageName}}.{{apiPackage}} } /// - /// Represents a collection of functions to interact with the API endpoints + /// Represents a collection of functions to interact with the API endpoints. /// {{>visibility}} sealed partial class {{classname}} : {{interfacePrefix}}{{classname}} { private JsonSerializerOptions _jsonSerializerOptions; /// - /// The logger factory + /// The logger factory. /// public ILoggerFactory LoggerFactory { get; } /// - /// The logger + /// The logger. /// public ILogger<{{classname}}> Logger { get; } /// - /// The HttpClient + /// The HttpClient. /// public System.Net.Http.HttpClient HttpClient { get; } /// - /// The class containing the events + /// The class containing the events. /// public {{classname}}Events Events { get; }{{#hasApiKeyMethods}} /// - /// A token provider of type + /// A token provider of type . /// public TokenProvider ApiKeyProvider { get; }{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} /// - /// A token provider of type + /// A token provider of type . /// public TokenProvider BearerTokenProvider { get; }{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}} /// - /// A token provider of type + /// A token provider of type . /// public TokenProvider HttpSignatureTokenProvider { get; }{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} /// - /// A token provider of type + /// A token provider of type . /// public TokenProvider OauthTokenProvider { get; }{{/hasOAuthMethods}} @@ -188,7 +188,7 @@ namespace {{packageName}}.{{apiPackage}} {{#operation}} {{#vendorExtensions.x-set-cookie}} /// - /// The token cookie container + /// The token cookie container. /// public {{packageName}}.{{corePackageName}}.Auth.CookieContainer CookieContainer { get; } @@ -228,7 +228,7 @@ namespace {{packageName}}.{{apiPackage}} {{/allParams}} {{#vendorExtensions.x-has-not-nullable-reference-types}} /// - /// Validates the request parameters + /// Validates the request parameters. /// {{#vendorExtensions.x-not-nullable-reference-types}} /// @@ -258,7 +258,7 @@ namespace {{packageName}}.{{apiPackage}} {{/vendorExtensions.x-has-not-nullable-reference-types}} /// - /// Processes the server response + /// Processes the server response. /// /// {{#allParams}} @@ -272,7 +272,7 @@ namespace {{packageName}}.{{apiPackage}} } /// - /// Processes the server response + /// Processes the server response. /// /// /// @@ -282,7 +282,7 @@ namespace {{packageName}}.{{apiPackage}} partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponse {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); /// - /// Logs exceptions that occur while retrieving the server response + /// Logs exceptions that occur while retrieving the server response. /// /// /// @@ -299,7 +299,7 @@ namespace {{packageName}}.{{apiPackage}} } /// - /// A partial method that gives developers a way to provide customized exception handling + /// A partial method that gives developers a way to provide customized exception handling. /// /// /// @@ -313,7 +313,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// {{summary}} {{notes}} /// - /// Thrown when fails to make API call + /// Thrown when fails to make API call. {{#allParams}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} @@ -476,7 +476,7 @@ namespace {{packageName}}.{{apiPackage}} {{! Only use API Keys that are appended to the HTTP-headers }} {{^isKeyInCookie}} {{#isKeyInHeader}} - ApiKeyToken apiKeyToken{{-index}} = (ApiKeyToken) await ApiKeyProvider.GetAsync("{{keyParamName}}", cancellationToken).ConfigureAwait(false); + ApiKeyToken apiKeyToken{{-index}} = (ApiKeyToken) ApiKeyProvider.Get("{{keyParamName}}"); apiKeyToken{{-index}}.UseInHeader(httpRequestMessage); {{/isKeyInHeader}} {{/isKeyInCookie}} @@ -486,20 +486,16 @@ namespace {{packageName}}.{{apiPackage}} {{#authMethods}} {{#isBasicBearer}} BearerToken bearerToken{{-index}} = (BearerToken) await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - tokenBases.Add(bearerToken{{-index}}); bearerToken{{-index}}.UseInHeader(httpRequestMessage, "{{keyParamName}}"); {{/isBasicBearer}} {{#isOAuth}} OAuthToken oauthToken{{-index}} = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - tokenBases.Add(oauthToken{{-index}}); oauthToken{{-index}}.UseInHeader(httpRequestMessage, "{{keyParamName}}"); {{/isOAuth}} {{#isHttpSignature}} HttpSignatureToken httpSignatureToken{{-index}} = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - tokenBases.Add(httpSignatureToken{{-index}}); - if (httpRequestMessage.Content != null) { string requestBody = await httpRequestMessage.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); @@ -642,17 +638,17 @@ namespace {{packageName}}.{{apiPackage}} {{#-first}} /// - /// The + /// The . /// {{>visibility}} partial class {{operationId}}ApiResponse : {{packageName}}.{{corePackageName}}.{{clientPackage}}.ApiResponse, {{interfacePrefix}}{{operationId}}ApiResponse { /// - /// The logger + /// The logger for . /// public ILogger<{{operationId}}ApiResponse> Logger { get; } /// - /// The + /// The . /// /// /// @@ -668,7 +664,7 @@ namespace {{packageName}}.{{apiPackage}} } /// - /// The + /// The . /// /// /// @@ -688,14 +684,14 @@ namespace {{packageName}}.{{apiPackage}} {{#vendorExtensions.x-http-status-is-default}} /// - /// Returns true if the response is the default response type + /// Returns true if the response is the default response type. /// /// public bool Is{{vendorExtensions.x-http-status}} => {{#vendorExtensions.x-only-default}}true{{/vendorExtensions.x-only-default}}{{^vendorExtensions.x-only-default}}{{#lambda.joinConditions}}{{#responses}}{{^vendorExtensions.x-http-status-is-default}}!Is{{vendorExtensions.x-http-status}} {{/vendorExtensions.x-http-status-is-default}}{{/responses}}{{/lambda.joinConditions}}{{/vendorExtensions.x-only-default}}; {{/vendorExtensions.x-http-status-is-default}} {{^vendorExtensions.x-http-status-is-default}} /// - /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}}. /// /// {{#vendorExtensions.x-http-status-range}} @@ -715,7 +711,7 @@ namespace {{packageName}}.{{apiPackage}} {{#dataType}} /// - /// Deserializes the response if the response is {{code}} {{vendorExtensions.x-http-status}} + /// Deserializes the response if the response is {{code}} {{vendorExtensions.x-http-status}}. /// /// public {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{vendorExtensions.x-http-status}}() @@ -728,7 +724,7 @@ namespace {{packageName}}.{{apiPackage}} } /// - /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} and the deserialized response is not null + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} and the deserialized response is not null. /// /// /// diff --git a/templates-v7/csharp/model.mustache b/templates-v7/csharp/model.mustache deleted file mode 100644 index 0d0c0b683..000000000 --- a/templates-v7/csharp/model.mustache +++ /dev/null @@ -1,50 +0,0 @@ -{{>partial_header}} - -{{#models}} -{{#model}} -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.IO; -{{#vendorExtensions.x-com-visible}} -using System.Runtime.InteropServices; -{{/vendorExtensions.x-com-visible}} -using System.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -{{#discriminator}} -using JsonSubTypes; -{{/discriminator}} -{{/model}} -{{/models}} -{{#validatable}} -using System.ComponentModel.DataAnnotations; -{{/validatable}} -using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; -{{#useCompareNetObjects}} -using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; -{{/useCompareNetObjects}} -{{#models}} -{{#model}} -{{#oneOf}} -{{#-first}} -using System.Reflection; -{{/-first}} -{{/oneOf}} -{{#anyOf}} -{{#-first}} -using System.Reflection; -{{/-first}} -{{/anyOf}} - -namespace {{packageName}}.{{modelPackage}} -{ -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} -{{/model}} -{{/models}} -} diff --git a/templates-v7/csharp/modelAnyOf.mustache b/templates-v7/csharp/modelAnyOf.mustache deleted file mode 100644 index f3eac973d..000000000 --- a/templates-v7/csharp/modelAnyOf.mustache +++ /dev/null @@ -1,275 +0,0 @@ -{{#model}} - /// - /// {{description}}{{^description}}{{classname}}{{/description}} - /// - {{#vendorExtensions.x-cls-compliant}} - [CLSCompliant({{{.}}})] - {{/vendorExtensions.x-cls-compliant}} - {{#vendorExtensions.x-com-visible}} - [ComVisible({{{.}}})] - {{/vendorExtensions.x-com-visible}} - [JsonConverter(typeof({{classname}}JsonConverter))] - [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} - { - {{#isNullable}} - /// - /// Initializes a new instance of the class. - /// - public {{classname}}() - { - IsNullable = true; - SchemaType= "anyOf"; - } - - {{/isNullable}} - {{#composedSchemas.anyOf}} - {{^vendorExtensions.x-duplicated-data-type}} - {{^isNull}} - /// - /// Initializes a new instance of the class - /// with the class - /// - /// An instance of {{dataType}}. - public {{classname}}({{{dataType}}} actualInstance) - { - IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; - SchemaType= "anyOf"; - ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; - } - - {{/isNull}} - {{/vendorExtensions.x-duplicated-data-type}} - {{/composedSchemas.anyOf}} - - private Object _actualInstance; - - /// - /// Gets or Sets ActualInstance - /// - public override Object ActualInstance - { - get - { - return _actualInstance; - } - set - { - {{#anyOf}} - {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) - { - _actualInstance = value; - } - {{/anyOf}} - else - { - throw new ArgumentException("Invalid instance found. Must be the following types:{{#anyOf}} {{{.}}}{{^-last}},{{/-last}}{{/anyOf}}"); - } - } - } - {{#composedSchemas.anyOf}} - {{^vendorExtensions.x-duplicated-data-type}} - {{^isNull}} - - /// - /// Get the actual instance of `{{dataType}}`. If the actual instance is not `{{dataType}}`, - /// the InvalidClassException will be thrown - /// - /// An instance of {{dataType}} - public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}() - { - return ({{{dataType}}})ActualInstance; - } - {{/isNull}} - {{/vendorExtensions.x-duplicated-data-type}} - {{/composedSchemas.anyOf}} - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class {{classname}} {\n"); - sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public override string ToJson() - { - return JsonConvert.SerializeObject(ActualInstance, {{classname}}.SerializerSettings); - } - - /// - /// Converts the JSON string into an instance of {{classname}} - /// - /// JSON string - /// An instance of {{classname}} - public static {{classname}} FromJson(string jsonString) - { - {{classname}} new{{classname}} = null; - - if (string.IsNullOrEmpty(jsonString)) - { - return new{{classname}}; - } - {{#anyOf}} - - try - { - new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.SerializerSettings)); - // deserialization is considered successful at this point if no exception has been thrown. - return new{{classname}}; - } - catch (Exception exception) - { - // deserialization failed, try the next one - System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into {{{.}}}: {1}", jsonString, exception.ToString())); - } - {{/anyOf}} - - // no match found, throw an exception - throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); - } - {{#equatable}} - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - return Equals(input as {{classname}}); - {{/useCompareNetObjects}} - } - - /// - /// Returns true if {{classname}} instances are equal - /// - /// Instance of {{classname}} to be compared - /// Boolean - public bool Equals({{classname}} input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - if (input == null) - return false; - - return ActualInstance.Equals(input.ActualInstance); - {{/useCompareNetObjects}} - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (ActualInstance != null) - hashCode = hashCode * 59 + ActualInstance.GetHashCode(); - return hashCode; - } - } - {{/equatable}} - - {{#validatable}} - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - {{/validatable}} - } - - /// - /// Custom JSON converter for {{classname}} - /// - public class {{classname}}JsonConverter : JsonConverter - { - /// - /// To write the JSON string - /// - /// JSON writer - /// Object to be converted into a JSON string - /// JSON Serializer - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - writer.WriteRawValue((string)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); - } - - /// - /// To convert a JSON string into an object - /// - /// JSON reader - /// Object type - /// Existing value - /// JSON Serializer - /// The object converted from the JSON string - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - switch(reader.TokenType) - { - {{#composedSchemas.anyOf}} - {{^vendorExtensions.x-duplicated-data-type}} - {{#isInteger}} - case JsonToken.Integer: - return new {{classname}}(Convert.ToInt32(reader.Value)); - {{/isInteger}} - {{#isNumber}} - case JsonToken.Float: - return new {{classname}}(Convert.ToDecimal(reader.Value)); - {{/isNumber}} - {{#isString}} - case JsonToken.String: - return new {{classname}}(Convert.ToString(reader.Value)); - {{/isString}} - {{#isBoolean}} - case JsonToken.Boolean: - return new {{classname}}(Convert.ToBoolean(reader.Value)); - {{/isBoolean}} - {{#isDate}} - case JsonToken.Date: - return new {{classname}}(Convert.ToDateTime(reader.Value)); - {{/isDate}} - {{/vendorExtensions.x-duplicated-data-type}} - {{/composedSchemas.anyOf}} - case JsonToken.StartObject: - return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); - case JsonToken.StartArray: - return {{classname}}.FromJson(JArray.Load(reader).ToString(Formatting.None)); - default: - return null; - } - } - - /// - /// Check if the object can be converted - /// - /// Object type - /// True if the object can be converted - public override bool CanConvert(Type objectType) - { - return false; - } - } -{{/model}} \ No newline at end of file diff --git a/templates-v7/csharp/modelEnum.mustache b/templates-v7/csharp/modelEnum.mustache deleted file mode 100644 index 7b779b3fa..000000000 --- a/templates-v7/csharp/modelEnum.mustache +++ /dev/null @@ -1,185 +0,0 @@ - /// - /// {{description}}{{^description}}Defines {{{name}}}{{/description}} - /// - {{#description}} - /// {{.}} - {{/description}} - {{#vendorExtensions.x-cls-compliant}} - [CLSCompliant({{{.}}})] - {{/vendorExtensions.x-cls-compliant}} - {{#vendorExtensions.x-com-visible}} - [ComVisible({{{.}}})] - {{/vendorExtensions.x-com-visible}} - {{#allowableValues}} - {{#enumVars}} - {{#-first}} - {{#isString}} - {{^useGenericHost}} - [JsonConverter(typeof(StringEnumConverter))] - {{/useGenericHost}} - {{/isString}} - {{/-first}} - {{/enumVars}} - {{/allowableValues}} - {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} - { - {{#allowableValues}} - {{#enumVars}} - /// - /// Enum {{name}} for value: {{value}} - /// - {{#isString}} - {{^useGenericHost}} - {{! EnumMember not currently supported in System.Text.Json, use a converter instead }} - [EnumMember(Value = "{{{value}}}")] - {{/useGenericHost}} - {{/isString}} - {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}}{{^vendorExtensions.x-zero-based-enum}} = {{-index}}{{/vendorExtensions.x-zero-based-enum}}{{/isString}}{{^-last}},{{/-last}} - {{^-last}} - - {{/-last}} - {{/enumVars}} - {{/allowableValues}} - } - {{#useGenericHost}} - - /// - /// Converts to and from the JSON value - /// - {{>visibility}} static class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter - { - /// - /// Parses a given value to - /// - /// - /// - {{>visibility}} static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} FromString(string value) - { - {{#allowableValues}} - {{#enumVars}} - if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) - return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; - - {{/enumVars}} - {{/allowableValues}} - throw new NotImplementedException($"Could not convert value to type {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}: '{value}'"); - } - - /// - /// Parses a given value to - /// - /// - /// - {{>visibility}} static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? FromStringOrDefault(string value) - { - {{#allowableValues}} - {{#enumVars}} - if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) - return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; - - {{/enumVars}} - {{/allowableValues}} - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - {{>visibility}} static {{>EnumValueDataType}} ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} value) - { - {{^isString}} - return ({{>EnumValueDataType}}) value; - {{/isString}} - {{#isString}} - {{#allowableValues}} - {{#enumVars}} - if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) - return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; - - {{/enumVars}} - {{/allowableValues}} - throw new NotImplementedException($"Value could not be handled: '{value}'"); - {{/isString}} - } - } - - /// - /// A Json converter for type - /// - /// - {{>visibility}} class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> - { - /// - /// Returns a {{datatypeWithEnum}} from the Json object - /// - /// - /// - /// - /// - public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - string{{nrt?}} rawValue = reader.GetString(); - - {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null - ? null - : {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); - - if (result != null) - return result.Value; - - throw new JsonException(); - } - - /// - /// Writes the {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} to the json writer - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) - { - writer.WriteStringValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}).ToString()); - } - } - - /// - /// A Json converter for type - /// - {{>visibility}} class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}?> - { - /// - /// Returns a {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} from the Json object - /// - /// - /// - /// - /// - public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - string{{nrt?}} rawValue = reader.GetString(); - - {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null - ? null - : {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); - - if (result != null) - return result.Value; - - throw new JsonException(); - } - - /// - /// Writes the {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} to the json writer - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) - { - writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.HasValue ? {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.Value).ToString() : "null"); - } - } - {{/useGenericHost}} diff --git a/templates-v7/csharp/modelGeneric.mustache b/templates-v7/csharp/modelGeneric.mustache deleted file mode 100644 index 5a95adaa1..000000000 --- a/templates-v7/csharp/modelGeneric.mustache +++ /dev/null @@ -1,435 +0,0 @@ - /// - /// {{description}}{{^description}}{{classname}}{{/description}} - /// - {{#vendorExtensions.x-cls-compliant}} - [CLSCompliant({{{vendorExtensions.x-cls-compliant}}})] - {{/vendorExtensions.x-cls-compliant}} - {{#vendorExtensions.x-com-visible}} - [ComVisible({{{vendorExtensions.x-com-visible}}})] - {{/vendorExtensions.x-com-visible}} - [DataContract(Name = "{{{name}}}")] - {{^useUnityWebRequest}} - {{#discriminator}} - {{#mappedModels.size}} - [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")] - {{/mappedModels.size}} - {{#mappedModels}} - [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] - {{/mappedModels}} - {{/discriminator}} - {{/useUnityWebRequest}} - {{>visibility}} partial class {{classname}}{{#lambda.firstDot}}{{#parent}} : .{{/parent}}{{#validatable}} : .{{/validatable}}{{#equatable}} : .{{/equatable}}{{/lambda.firstDot}}{{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} - { - {{#vars}} - {{#items.isEnum}} - {{#items}} - {{^complexType}} -{{>modelInnerEnum}} - - {{/complexType}} - {{/items}} - {{/items.isEnum}} - {{#isEnum}} - {{^complexType}} -{{>modelInnerEnum}} - - {{/complexType}} - {{/isEnum}} - {{#isEnum}} - - /// - /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} - /// - {{#description}} - /// {{.}} - {{/description}} - {{#example}} - /* - {{.}} - */ - {{/example}} - {{^conditionalSerialization}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#deprecated}} - [Obsolete] - {{/deprecated}} - public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } - {{#isReadOnly}} - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return false; - } - {{/isReadOnly}} - {{/conditionalSerialization}} - {{#conditionalSerialization}} - {{#isReadOnly}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#deprecated}} - [Obsolete] - {{/deprecated}} - public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } - - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return false; - } - {{/isReadOnly}} - - {{^isReadOnly}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#deprecated}} - [Obsolete] - {{/deprecated}} - public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} - { - get{ return _{{name}};} - set - { - _{{name}} = value; - _flag{{name}} = true; - } - } - private {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} _{{name}}; - private bool _flag{{name}}; - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return _flag{{name}}; - } - {{/isReadOnly}} - {{/conditionalSerialization}} - {{/isEnum}} - {{/vars}} - {{#hasRequired}} - {{^hasOnlyReadOnly}} - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - {{^isAdditionalPropertiesTrue}} - protected {{classname}}() { } - {{/isAdditionalPropertiesTrue}} - {{#isAdditionalPropertiesTrue}} - protected {{classname}}() - { - this.AdditionalProperties = new Dictionary(); - } - {{/isAdditionalPropertiesTrue}} - {{/hasOnlyReadOnly}} - {{/hasRequired}} - /// - /// Initializes a new instance of the class. - /// - {{#readWriteVars}} - /// {{description}}{{^description}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. - {{/readWriteVars}} - {{#hasOnlyReadOnly}} - [JsonConstructorAttribute] - {{/hasOnlyReadOnly}} - public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default{{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} - { - {{#vars}} - {{^isInherited}} - {{^isReadOnly}} - {{#required}} - {{^conditionalSerialization}} - {{^vendorExtensions.x-csharp-value-type}} - // to ensure "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" is required (not null) - if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null) - { - throw new ArgumentNullException("{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} is a required property for {{classname}} and cannot be null"); - } - this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{#vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{/conditionalSerialization}} - {{#conditionalSerialization}} - {{^vendorExtensions.x-csharp-value-type}} - // to ensure "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" is required (not null) - if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null) - { - throw new ArgumentNullException("{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} is a required property for {{classname}} and cannot be null"); - } - this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{#vendorExtensions.x-csharp-value-type}} - this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{/conditionalSerialization}} - {{/required}} - {{/isReadOnly}} - {{/isInherited}} - {{/vars}} - {{#vars}} - {{^isInherited}} - {{^isReadOnly}} - {{^required}} - {{#defaultValue}} - {{^conditionalSerialization}} - {{^vendorExtensions.x-csharp-value-type}} - // use default value if no "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" provided - this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} ?? {{#isString}}@{{/isString}}{{{defaultValue}}}; - {{/vendorExtensions.x-csharp-value-type}} - {{#vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - {{/vendorExtensions.x-csharp-value-type}} - {{/conditionalSerialization}} - {{/defaultValue}} - {{^defaultValue}} - {{^conditionalSerialization}} - this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - {{/conditionalSerialization}} - {{#conditionalSerialization}} - this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; - if (this.{{name}} != null) - { - this._flag{{name}} = true; - } - {{/conditionalSerialization}} - {{/defaultValue}} - {{/required}} - {{/isReadOnly}} - {{/isInherited}} - {{/vars}} - {{#isAdditionalPropertiesTrue}} - this.AdditionalProperties = new Dictionary(); - {{/isAdditionalPropertiesTrue}} - } - - {{#vars}} - {{^isInherited}} - {{^isEnum}} - /// - /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} - /// {{#description}} - /// {{.}}{{/description}} - {{#example}} - /* - {{.}} - */ - {{/example}} - {{^conditionalSerialization}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#isDate}} - {{^supportsDateOnly}} - [JsonConverter(typeof(OpenAPIDateConverter))] - {{/supportsDateOnly}} - {{/isDate}} - {{#deprecated}} - [Obsolete] - {{/deprecated}} - public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } - - {{#isReadOnly}} - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return false; - } - {{/isReadOnly}} - {{/conditionalSerialization}} - {{#conditionalSerialization}} - {{#isReadOnly}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#isDate}} - [JsonConverter(typeof(OpenAPIDateConverter))] - {{/isDate}} - {{#deprecated}} - [Obsolete] - {{/deprecated}} - public {{{dataType}}} {{name}} { get; private set; } - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return false; - } - {{/isReadOnly}} - {{^isReadOnly}} - {{#isDate}} - [JsonConverter(typeof(OpenAPIDateConverter))] - {{/isDate}} - [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] - {{#deprecated}} - [Obsolete] - {{/deprecated}} - public {{{dataType}}} {{name}} - { - get{ return _{{name}};} - set - { - _{{name}} = value; - _flag{{name}} = true; - } - } - private {{{dataType}}} _{{name}}; - private bool _flag{{name}}; - - /// - /// Returns false as {{name}} should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerialize{{name}}() - { - return _flag{{name}}; - } - {{/isReadOnly}} - {{/conditionalSerialization}} - {{/isEnum}} - {{/isInherited}} - {{/vars}} - {{#isAdditionalPropertiesTrue}} - /// - /// Gets or Sets additional properties - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { get; set; } - - {{/isAdditionalPropertiesTrue}} - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - StringBuilder sb = new StringBuilder(); - sb.Append("class {{classname}} {\n"); - {{#parent}} - sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - {{/parent}} - {{#vars}} - sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); - {{/vars}} - {{#isAdditionalPropertiesTrue}} - sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); - {{/isAdditionalPropertiesTrue}} - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public {{#parent}}{{^isArray}}{{^isMap}}override {{/isMap}}{{/isArray}}{{/parent}}{{^parent}}virtual {{/parent}}string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - {{#equatable}} - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - return this.Equals(input as {{classname}}); - {{/useCompareNetObjects}} - } - - /// - /// Returns true if {{classname}} instances are equal - /// - /// Instance of {{classname}} to be compared - /// Boolean - public bool Equals({{classname}} input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - if (input == null) - { - return false; - } - return {{#vars}}{{#parent}}base.Equals(input) && {{/parent}}{{^isContainer}} - ( - this.{{name}} == input.{{name}} || - {{^vendorExtensions.x-is-value-type}} - (this.{{name}} != null && - this.{{name}}.Equals(input.{{name}})) - {{/vendorExtensions.x-is-value-type}} - {{#vendorExtensions.x-is-value-type}} - this.{{name}}.Equals(input.{{name}}) - {{/vendorExtensions.x-is-value-type}} - ){{^-last}} && {{/-last}}{{/isContainer}}{{#isContainer}} - ( - this.{{name}} == input.{{name}} || - {{^vendorExtensions.x-is-value-type}}this.{{name}} != null && - input.{{name}} != null && - {{/vendorExtensions.x-is-value-type}}this.{{name}}.SequenceEqual(input.{{name}}) - ){{^-last}} && {{/-last}}{{/isContainer}}{{/vars}}{{^vars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/vars}}{{^isAdditionalPropertiesTrue}};{{/isAdditionalPropertiesTrue}} - {{#isAdditionalPropertiesTrue}} - && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); - {{/isAdditionalPropertiesTrue}} - {{/useCompareNetObjects}} - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - {{#parent}} - int hashCode = base.GetHashCode(); - {{/parent}} - {{^parent}} - int hashCode = 41; - {{/parent}} - {{#vars}} - {{^vendorExtensions.x-is-value-type}} - if (this.{{name}} != null) - { - hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); - } - {{/vendorExtensions.x-is-value-type}} - {{#vendorExtensions.x-is-value-type}} - hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); - {{/vendorExtensions.x-is-value-type}} - {{/vars}} - {{#isAdditionalPropertiesTrue}} - if (this.AdditionalProperties != null) - { - hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); - } - {{/isAdditionalPropertiesTrue}} - return hashCode; - } - } - {{/equatable}} - -{{#validatable}} -{{>validatable}} - -{{/validatable}} - } diff --git a/templates-v7/csharp/modelInnerEnum.mustache b/templates-v7/csharp/modelInnerEnum.mustache deleted file mode 100644 index 462ded84d..000000000 --- a/templates-v7/csharp/modelInnerEnum.mustache +++ /dev/null @@ -1,99 +0,0 @@ - {{^isContainer}} - /// - /// {{description}}{{^description}}Defines {{{name}}}{{/description}} - /// - {{#description}} - /// {{.}} - {{/description}} - {{#isString}} - {{^useGenericHost}} - [JsonConverter(typeof(StringEnumConverter))] - {{/useGenericHost}} - {{/isString}} - {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} - { - {{#allowableValues}} - {{#enumVars}} - /// - /// Enum {{name}} for value: {{value}} - /// - {{^useGenericHost}} - {{#isString}} - [EnumMember(Value = "{{{value}}}")] - {{/isString}} - {{/useGenericHost}} - {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}}{{^vendorExtensions.x-zero-based-enum}} = {{-index}}{{/vendorExtensions.x-zero-based-enum}}{{/isString}}{{^-last}},{{/-last}} - {{^-last}} - - {{/-last}} - {{/enumVars}} - {{/allowableValues}} - } - {{#useGenericHost}} - - /// - /// Returns a - /// - /// - /// - /// - public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}FromString(string value) - { - {{#allowableValues}} - {{#enumVars}} - if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) - return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; - - {{/enumVars}} - {{/allowableValues}} - throw new NotImplementedException($"Could not convert value to type {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}FromStringOrDefault(string value) - { - {{#allowableValues}} - {{#enumVars}} - if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) - return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; - - {{/enumVars}} - {{/allowableValues}} - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - {{#isString}} - /// - {{/isString}} - public static {{>EnumValueDataType}}{{#lambda.first}}{{#nrt}}{{#isString}}{{#isNullable}}{{nrt?}} {{^nrt}}{{#vendorExtensions.x-is-value-type}}? {{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}}{{/isString}}{{/nrt}}{{/lambda.first}} {{datatypeWithEnum}}ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#isString}}{{>NullConditionalProperty}}{{/isString}} value) - { - {{^isString}} - return ({{>EnumValueDataType}}) value; - {{/isString}} - {{#isString}} - {{#isNullable}} - if (value == null) - return null; - - {{/isNullable}} - {{#allowableValues}} - {{#enumVars}} - if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) - return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; - - {{/enumVars}} - {{/allowableValues}} - throw new NotImplementedException($"Value could not be handled: '{value}'"); - {{/isString}} - } - {{/useGenericHost}} - {{/isContainer}} \ No newline at end of file diff --git a/templates-v7/csharp/modelOneOf.mustache b/templates-v7/csharp/modelOneOf.mustache deleted file mode 100644 index ab42e4eef..000000000 --- a/templates-v7/csharp/modelOneOf.mustache +++ /dev/null @@ -1,320 +0,0 @@ -{{#model}} - /// - /// {{description}}{{^description}}{{classname}}{{/description}} - /// - {{#vendorExtensions.x-cls-compliant}} - [CLSCompliant({{{.}}})] - {{/vendorExtensions.x-cls-compliant}} - {{#vendorExtensions.x-com-visible}} - [ComVisible({{{.}}})] - {{/vendorExtensions.x-com-visible}} - [JsonConverter(typeof({{classname}}JsonConverter))] - [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : {{#lambda.joinWithComma}}AbstractOpenAPISchema {{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} - { - {{#isNullable}} - /// - /// Initializes a new instance of the class. - /// - public {{classname}}() - { - this.IsNullable = true; - this.SchemaType= "oneOf"; - } - - {{/isNullable}} - {{#composedSchemas.oneOf}} - {{^vendorExtensions.x-duplicated-data-type}} - {{^isNull}} - /// - /// Initializes a new instance of the class - /// with the class - /// - /// An instance of {{dataType}}. - public {{classname}}({{{dataType}}} actualInstance) - { - this.IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; - this.SchemaType= "oneOf"; - this.ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; - } - - {{/isNull}} - {{/vendorExtensions.x-duplicated-data-type}} - {{/composedSchemas.oneOf}} - - private Object _actualInstance; - - /// - /// Gets or Sets ActualInstance - /// - public override Object ActualInstance - { - get - { - return _actualInstance; - } - set - { - {{#oneOf}} - {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}}) || value is {{{.}}}) - { - this._actualInstance = value; - } - {{/oneOf}} - else - { - throw new ArgumentException("Invalid instance found. Must be the following types:{{#oneOf}} {{{.}}}{{^-last}},{{/-last}}{{/oneOf}}"); - } - } - } - {{#composedSchemas.oneOf}} - {{^vendorExtensions.x-duplicated-data-type}} - {{^isNull}} - - /// - /// Get the actual instance of `{{dataType}}`. If the actual instance is not `{{dataType}}`, - /// the InvalidClassException will be thrown - /// - /// An instance of {{dataType}} - public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}() - { - return ({{{dataType}}})this.ActualInstance; - } - {{/isNull}} - {{/vendorExtensions.x-duplicated-data-type}} - {{/composedSchemas.oneOf}} - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class {{classname}} {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public override string ToJson() - { - return JsonConvert.SerializeObject(this.ActualInstance, {{classname}}.SerializerSettings); - } - - /// - /// Converts the JSON string into an instance of {{classname}} - /// - /// JSON string - /// An instance of {{classname}} - public static {{classname}} FromJson(string jsonString) - { - {{classname}} new{{classname}} = null; - - if (string.IsNullOrEmpty(jsonString)) - { - return new{{classname}}; - } - {{#useOneOfDiscriminatorLookup}} - {{#discriminator}} - - try - { - var discriminatorObj = JObject.Parse(jsonString)["{{{propertyBaseName}}}"]; - string discriminatorValue = discriminatorObj == null ?string.Empty :discriminatorObj.ToString(); - switch (discriminatorValue) - { - {{#mappedModels}} - case "{{{mappingName}}}": - new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{modelName}}}>(jsonString, {{classname}}.AdditionalPropertiesSerializerSettings)); - return new{{classname}}; - {{/mappedModels}} - default: - System.Diagnostics.Debug.WriteLine(string.Format("Failed to lookup discriminator value `{0}` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); - break; - } - } - catch (Exception ex) - { - System.Diagnostics.Debug.WriteLine(string.Format("Failed to parse the json data : `{0}` {1}", jsonString, ex.ToString())); - } - - {{/discriminator}} - {{/useOneOfDiscriminatorLookup}} - int match = 0; - List matchedTypes = new List(); - {{#oneOf}} - - try - { - // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize - if (typeof({{{.}}}).GetProperty("AdditionalProperties") == null) - { - new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.SerializerSettings)); - } - else - { - new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.AdditionalPropertiesSerializerSettings)); - } - matchedTypes.Add("{{{.}}}"); - match++; - } - catch (Exception exception) - { - // deserialization failed, try the next one - System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into {{{.}}}: {1}", jsonString, exception.ToString())); - } - {{/oneOf}} - - if (match == 0) - { - throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); - } - else if (match > 1) - { - throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + String.Join(",", matchedTypes)); - } - - // deserialization is considered successful at this point if no exception has been thrown. - return new{{classname}}; - } - - {{#equatable}} - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - return this.Equals(input as {{classname}}); - {{/useCompareNetObjects}} - } - - /// - /// Returns true if {{classname}} instances are equal - /// - /// Instance of {{classname}} to be compared - /// Boolean - public bool Equals({{classname}} input) - { - {{#useCompareNetObjects}} - return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; - {{/useCompareNetObjects}} - {{^useCompareNetObjects}} - if (input == null) - return false; - - return this.ActualInstance.Equals(input.ActualInstance); - {{/useCompareNetObjects}} - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); - return hashCode; - } - } - {{/equatable}} - {{#validatable}} - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - {{/validatable}} - } - - /// - /// Custom JSON converter for {{classname}} - /// - public class {{classname}}JsonConverter : JsonConverter - { - /// - /// To write the JSON string - /// - /// JSON writer - /// Object to be converted into a JSON string - /// JSON Serializer - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - writer.WriteRawValue((string)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); - } - - /// - /// To convert a JSON string into an object - /// - /// JSON reader - /// Object type - /// Existing value - /// JSON Serializer - /// The object converted from the JSON string - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - switch(reader.TokenType) - { - {{#composedSchemas.oneOf}} - {{^vendorExtensions.x-duplicated-data-type}} - {{#isInteger}} - case JsonToken.Integer: - return new {{classname}}(Convert.ToInt32(reader.Value)); - {{/isInteger}} - {{#isNumber}} - case JsonToken.Float: - return new {{classname}}(Convert.ToDecimal(reader.Value)); - {{/isNumber}} - {{#isString}} - case JsonToken.String: - return new {{classname}}(Convert.ToString(reader.Value)); - {{/isString}} - {{#isBoolean}} - case JsonToken.Boolean: - return new {{classname}}(Convert.ToBoolean(reader.Value)); - {{/isBoolean}} - {{#isDate}} - case JsonToken.Date: - return new {{classname}}(Convert.ToDateTime(reader.Value)); - {{/isDate}} - {{/vendorExtensions.x-duplicated-data-type}} - {{/composedSchemas.oneOf}} - case JsonToken.StartObject: - return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); - case JsonToken.StartArray: - return {{classname}}.FromJson(JArray.Load(reader).ToString(Formatting.None)); - default: - return null; - } - } - - /// - /// Check if the object can be converted - /// - /// Object type - /// True if the object can be converted - public override bool CanConvert(Type objectType) - { - return false; - } - } -{{/model}} diff --git a/templates-v7/csharp/model_doc.mustache b/templates-v7/csharp/model_doc.mustache deleted file mode 100644 index 3c7f8b2db..000000000 --- a/templates-v7/csharp/model_doc.mustache +++ /dev/null @@ -1,22 +0,0 @@ -{{#models}} -{{#model}} -# {{{packageName}}}.{{modelPackage}}.{{{classname}}} -{{#description}}{{&description}} -{{/description}} - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -{{#parent}} -{{#parentVars}} -**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} -{{/parentVars}} -{{/parent}} -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} -{{/vars}} - -[[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) - -{{/model}} -{{/models}} diff --git a/templates-v7/csharp/model_test.mustache b/templates-v7/csharp/model_test.mustache deleted file mode 100644 index 1feaeb9d8..000000000 --- a/templates-v7/csharp/model_test.mustache +++ /dev/null @@ -1,87 +0,0 @@ -{{>partial_header}} - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using {{packageName}}.{{modelPackage}}; -using {{packageName}}.{{clientPackage}}; -using System.Reflection; -{{^useGenericHost}} -using Newtonsoft.Json; -{{/useGenericHost}} - -{{#models}} -{{#model}} -namespace {{packageName}}.Test.Model -{ - /// - /// Class for testing {{classname}} - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class {{classname}}Tests : IDisposable - { - // TODO uncomment below to declare an instance variable for {{classname}} - //private {{classname}} instance; - - public {{classname}}Tests() - { - // TODO uncomment below to create an instance of {{classname}} - //instance = new {{classname}}(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - {{#lambda.trimTrailingWithNewLine}} - {{#lambda.trimLineBreaks}} - /// - /// Test an instance of {{classname}} - /// - [Fact] - public void {{classname}}InstanceTest() - { - // TODO uncomment below to test "IsType" {{classname}} - //Assert.IsType<{{classname}}>(instance); - } - - {{#discriminator}} - {{#children}} - - /// - /// Test deserialize a {{classname}} from type {{parent}} - /// - [Fact] - public void {{classname}}DeserializeFrom{{parent}}Test() - { - // TODO uncomment below to test deserialize a {{classname}} from type {{parent}} - //Assert.IsType<{{parent}}>(JsonConvert.DeserializeObject<{{parent}}>(new {{classname}}().ToJson())); - } - - {{/children}} - {{/discriminator}} - {{#vars}} - - - /// - /// Test the property '{{name}}' - /// - [Fact] - public void {{name}}Test() - { - // TODO unit test for the property '{{name}}' - } - {{/vars}} - {{/lambda.trimLineBreaks}} - {{/lambda.trimTrailingWithNewLine}} - } -} -{{/model}} -{{/models}} diff --git a/templates-v7/csharp/openapi.mustache b/templates-v7/csharp/openapi.mustache deleted file mode 100644 index 34fbb53f3..000000000 --- a/templates-v7/csharp/openapi.mustache +++ /dev/null @@ -1 +0,0 @@ -{{{openapi-yaml}}} diff --git a/templates-v7/csharp/partial_header.mustache b/templates-v7/csharp/partial_header.mustache index 1562058ad..ff9c854e2 100644 --- a/templates-v7/csharp/partial_header.mustache +++ b/templates-v7/csharp/partial_header.mustache @@ -13,5 +13,6 @@ {{#infoEmail}} * Contact: {{{.}}} {{/infoEmail}} - * Generated by: https://github.com/openapitools/openapi-generator.git + * NOTE: This class is auto-generated using a modified version (https://github.com/Adyen/adyen-sdk-automation) of the OpenAPI Generator: https://github.com/openapitools/openapi-generator.git. + * Do not edit the class manually. */ From 195891281d8a68f43e13644d503d3a02c69e1922 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 24 Oct 2025 00:34:51 +0200 Subject: [PATCH 053/126] Update partial_header.mustache --- templates-v7/csharp/partial_header.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates-v7/csharp/partial_header.mustache b/templates-v7/csharp/partial_header.mustache index ff9c854e2..377ccfabb 100644 --- a/templates-v7/csharp/partial_header.mustache +++ b/templates-v7/csharp/partial_header.mustache @@ -14,5 +14,5 @@ * Contact: {{{.}}} {{/infoEmail}} * NOTE: This class is auto-generated using a modified version (https://github.com/Adyen/adyen-sdk-automation) of the OpenAPI Generator: https://github.com/openapitools/openapi-generator.git. - * Do not edit the class manually. + * Do not edit this class manually. */ From 5614205951e7efddeb0e927d71d1541bf57c25a9 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 24 Oct 2025 23:18:08 +0200 Subject: [PATCH 054/126] Added 1-line configuration support for configuration an environment, adyen-api-key and liveprefix Added simplified TokenProvider support --- .../PaymentsServiceIntegrationTest.cs | 24 ++-- .../BalanceControl/BalanceControlTest.cs | 53 +++++++++ Adyen.Test/Utilities/TestUtilities.cs | 13 +++ Adyen/BalanceControl/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/BalancePlatform/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/BalanceWebhooks/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/BinLookup/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Checkout/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Core/Auth/ApiKeyToken.cs | 42 ------- Adyen/Core/Auth/BasicToken.cs | 54 --------- Adyen/Core/Auth/TokenBase.cs | 5 +- Adyen/Core/Auth/TokenContainer.cs | 32 ------ Adyen/Core/Auth/TokenProvider.cs | 59 +++++----- Adyen/Core/Options/AdyenOptions.cs | 10 +- Adyen/Disputes/Client/ApiKeyToken.cs | 48 ++++++++ .../Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Management/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Payment/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/PaymentsApp/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Payout/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/PosMobile/Client/ApiKeyToken.cs | 48 ++++++++ .../Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Recurring/Client/ApiKeyToken.cs | 48 ++++++++ .../Client/ApiKeyToken.cs | 48 ++++++++ Adyen/StoredValue/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Transfers/Client/ApiKeyToken.cs | 48 ++++++++ .../generichost/ApiKeyToken.mustache | 44 +++---- .../generichost/ClientUtils.mustache | 108 ++++++------------ .../generichost/HostConfiguration.mustache | 98 +++++++++++----- .../IServiceCollectionExtensions.mustache | 17 --- .../JsonSerializerOptionsProvider.mustache | 6 +- .../csharp/libraries/generichost/api.mustache | 20 ++-- 32 files changed, 1073 insertions(+), 328 deletions(-) create mode 100644 Adyen.Test/BalanceControl/BalanceControlTest.cs create mode 100644 Adyen.Test/Utilities/TestUtilities.cs create mode 100644 Adyen/BalanceControl/Client/ApiKeyToken.cs create mode 100644 Adyen/BalancePlatform/Client/ApiKeyToken.cs create mode 100644 Adyen/BalanceWebhooks/Client/ApiKeyToken.cs create mode 100644 Adyen/BinLookup/Client/ApiKeyToken.cs create mode 100644 Adyen/Checkout/Client/ApiKeyToken.cs delete mode 100644 Adyen/Core/Auth/ApiKeyToken.cs delete mode 100644 Adyen/Core/Auth/BasicToken.cs delete mode 100644 Adyen/Core/Auth/TokenContainer.cs create mode 100644 Adyen/Disputes/Client/ApiKeyToken.cs create mode 100644 Adyen/LegalEntityManagement/Client/ApiKeyToken.cs create mode 100644 Adyen/Management/Client/ApiKeyToken.cs create mode 100644 Adyen/Payment/Client/ApiKeyToken.cs create mode 100644 Adyen/PaymentsApp/Client/ApiKeyToken.cs create mode 100644 Adyen/Payout/Client/ApiKeyToken.cs create mode 100644 Adyen/PosMobile/Client/ApiKeyToken.cs create mode 100644 Adyen/PosTerminalManagement/Client/ApiKeyToken.cs create mode 100644 Adyen/Recurring/Client/ApiKeyToken.cs create mode 100644 Adyen/SessionAuthentication/Client/ApiKeyToken.cs create mode 100644 Adyen/StoredValue/Client/ApiKeyToken.cs create mode 100644 Adyen/Transfers/Client/ApiKeyToken.cs diff --git a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index ae60b95b3..0818d4e6f 100644 --- a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -7,6 +7,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; using System.Text.Json; +using Adyen.Core.Options; namespace Adyen.IntegrationTest.Checkout { @@ -18,18 +19,19 @@ public class PaymentsServiceIntegrationTest public PaymentsServiceIntegrationTest() { - IHost host = Host.CreateDefaultBuilder() - .ConfigureCheckout((context, services, config) => - { - var apiKey = new ApiKeyToken( - context.Configuration["ADYEN_API_KEY"] - ); - config.AddTokens(apiKey); - }) - .Build(); + IHost host = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); - _paymentsApiService = host.Services.GetRequiredService(); - _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + _paymentsApiService = host.Services.GetRequiredService(); + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); } [TestMethod] diff --git a/Adyen.Test/BalanceControl/BalanceControlTest.cs b/Adyen.Test/BalanceControl/BalanceControlTest.cs new file mode 100644 index 000000000..6e0a00ab3 --- /dev/null +++ b/Adyen.Test/BalanceControl/BalanceControlTest.cs @@ -0,0 +1,53 @@ +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Adyen.BalanceControl.Client; +using Adyen.BalanceControl.Extensions; +using Adyen.BalanceControl.Models; +using Adyen.BalanceControl.Services; +using Adyen.Core.Auth; +using Adyen.Core.Options; +using Adyen.Test.Utilities; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.BalanceControl +{ + [TestClass] + public class BalanceControlTest + { + private readonly IBalanceControlService _balanceControlService; + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public BalanceControlTest() + { IHost host = Host.CreateDefaultBuilder() + .ConfigureBalanceControl((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _balanceControlService = host.Services.GetRequiredService(); + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public async Task DeserializeBalanceControlTest() + { + // Arrange + var json = TestUtilities.GetTestFileContent("mocks/balance-control-transfer.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.CreatedAt, new DateTime(2022,01, 24)); + Assert.AreEqual(response.Status, BalanceTransferResponse.StatusEnum.Transferred); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Utilities/TestUtilities.cs b/Adyen.Test/Utilities/TestUtilities.cs new file mode 100644 index 000000000..39b052bdc --- /dev/null +++ b/Adyen.Test/Utilities/TestUtilities.cs @@ -0,0 +1,13 @@ +namespace Adyen.Test.Utilities +{ + public class TestUtilities + { + public static string GetTestFileContent(string relativePath) + { + string rootPath = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "../../../")); + string absolutePath = Path.Combine(rootPath, relativePath); + + return File.ReadAllText(absolutePath); + } + } +} \ No newline at end of file diff --git a/Adyen/BalanceControl/Client/ApiKeyToken.cs b/Adyen/BalanceControl/Client/ApiKeyToken.cs new file mode 100644 index 000000000..d300697c6 --- /dev/null +++ b/Adyen/BalanceControl/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.BalanceControl.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/BalancePlatform/Client/ApiKeyToken.cs b/Adyen/BalancePlatform/Client/ApiKeyToken.cs new file mode 100644 index 000000000..716617ad4 --- /dev/null +++ b/Adyen/BalancePlatform/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.BalancePlatform.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/BalanceWebhooks/Client/ApiKeyToken.cs b/Adyen/BalanceWebhooks/Client/ApiKeyToken.cs new file mode 100644 index 000000000..29d9c8235 --- /dev/null +++ b/Adyen/BalanceWebhooks/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.BalanceWebhooks.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/BinLookup/Client/ApiKeyToken.cs b/Adyen/BinLookup/Client/ApiKeyToken.cs new file mode 100644 index 000000000..c7129035a --- /dev/null +++ b/Adyen/BinLookup/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.BinLookup.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Checkout/Client/ApiKeyToken.cs b/Adyen/Checkout/Client/ApiKeyToken.cs new file mode 100644 index 000000000..755581356 --- /dev/null +++ b/Adyen/Checkout/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Checkout.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Core/Auth/ApiKeyToken.cs b/Adyen/Core/Auth/ApiKeyToken.cs deleted file mode 100644 index 837c78e2f..000000000 --- a/Adyen/Core/Auth/ApiKeyToken.cs +++ /dev/null @@ -1,42 +0,0 @@ -#nullable enable - -using System; - -namespace Adyen.Core.Auth -{ - /// - /// A token constructed from an ApiKey. - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. Most common use-case for Digital (ECOM) & In-Person payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The key of the header for your API Key. - /// - public string Key { get; set; } = "X-API-Key"; - - /// - /// Constructs an ApiKeyToken object. - /// - /// - /// - public ApiKeyToken(string value, string prefix = "") - { - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(Key, _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Core/Auth/BasicToken.cs b/Adyen/Core/Auth/BasicToken.cs deleted file mode 100644 index bba61e967..000000000 --- a/Adyen/Core/Auth/BasicToken.cs +++ /dev/null @@ -1,54 +0,0 @@ -#nullable enable - -using System; -using System.Net.Http.Headers; - -namespace Adyen.Core.Auth -{ - /// - /// A token constructed from a username and password. - /// Adyen recommends using the instead. - /// - public class BasicToken : TokenBase - { - private readonly string _username; - - private readonly string _password; - - /// - /// The key of the header for basic authentication. - /// - public string Key { get; set; } = "Basic"; - - /// - /// Constructs a BasicToken object. - /// Adyen recommends using the instead. - /// - /// - /// - public BasicToken(string username, string password) : base() - { - _username = username; - _password = password; - } - - /// - /// Places the username/password token in the header. - /// - /// - public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Authorization = new AuthenticationHeaderValue(Key, Base64Encode(_username + ":" + _password)); - } - - /// - /// Encodes to a Base64-string. - /// - /// The string to encode. - /// Base64-encoded string. - private static string Base64Encode(string value) - { - return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(value)); - } - } -} \ No newline at end of file diff --git a/Adyen/Core/Auth/TokenBase.cs b/Adyen/Core/Auth/TokenBase.cs index 347c174e4..64522ca9f 100644 --- a/Adyen/Core/Auth/TokenBase.cs +++ b/Adyen/Core/Auth/TokenBase.cs @@ -5,13 +5,12 @@ namespace Adyen.Core.Auth { /// - /// The base class for all tokens. + /// The base class for all auth tokens. /// public abstract class TokenBase { /// - /// The constructor for the parent TokenBase object. - /// Example usages: or . + /// The constructor for the TokenBase object, used by . /// internal TokenBase() { diff --git a/Adyen/Core/Auth/TokenContainer.cs b/Adyen/Core/Auth/TokenContainer.cs deleted file mode 100644 index 0f1215ef8..000000000 --- a/Adyen/Core/Auth/TokenContainer.cs +++ /dev/null @@ -1,32 +0,0 @@ -#nullable enable - -namespace Adyen.Core.Auth -{ - /// - /// A container for a collection of tokens. - /// - /// - public sealed class TokenContainer where TTokenBase : TokenBase - { - /// - /// The collection of tokens - /// - public List Tokens { get; } = new List(); - - /// - /// Instantiates a TokenContainer - /// - public TokenContainer() - { - } - - /// - /// Instantiates a TokenContainer - /// - /// List of tokens. - public TokenContainer(IEnumerable tokens) - { - Tokens = tokens.ToList(); - } - } -} \ No newline at end of file diff --git a/Adyen/Core/Auth/TokenProvider.cs b/Adyen/Core/Auth/TokenProvider.cs index 47f741657..745cca691 100644 --- a/Adyen/Core/Auth/TokenProvider.cs +++ b/Adyen/Core/Auth/TokenProvider.cs @@ -1,43 +1,42 @@ -// -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -#nullable enable - -using System; -using System.Linq; -using System.Collections.Generic; - namespace Adyen.Core.Auth -{ +{ /// - /// A class which will provide tokens. + /// An interface for providing tokens in a generic way. /// - public abstract class TokenProvider where TTokenBase : TokenBase + /// + public interface ITokenProvider where TTokenBase : TokenBase { /// - /// The array of tokens. + /// Retrieves the stored token. /// - protected TTokenBase[] _tokens; - - internal abstract TTokenBase Get(string header = ""); + /// + TTokenBase Get(); + } + + /// + /// A class which will provide tokens from type . + /// + /// + public class TokenProvider : ITokenProvider where TTokenBase : TokenBase + { + private readonly TTokenBase _token; /// - /// Instantiates a TokenProvider. + /// Initializes a token with type . /// - /// - public TokenProvider(IEnumerable tokens) + /// + public TokenProvider(TTokenBase token) { - _tokens = tokens.ToArray(); - - if (_tokens.Length == 0) - throw new ArgumentException("You did not provide any tokens (e.g. API Keys), see also: ApiKeyToken class."); + _token = token; + } + + /// + /// Retrieves the stored token. + /// + /// + public TTokenBase Get() + { + return _token; } } } \ No newline at end of file diff --git a/Adyen/Core/Options/AdyenOptions.cs b/Adyen/Core/Options/AdyenOptions.cs index ea770619f..d07bd02d0 100644 --- a/Adyen/Core/Options/AdyenOptions.cs +++ b/Adyen/Core/Options/AdyenOptions.cs @@ -6,7 +6,7 @@ public class AdyenOptions /// The Adyen Environment. /// public AdyenEnvironment Environment { get; set; } = AdyenEnvironment.Test; - + /// /// Used in the LIVE environment only. /// Default value: empty string. @@ -14,5 +14,13 @@ public class AdyenOptions /// See: https://docs.adyen.com/development-resources/live-endpoints/ /// public string LiveEndpointUrlPrefix { get; set; } = string.Empty; + + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public string AdyenApiKey { get; set; } } } \ No newline at end of file diff --git a/Adyen/Disputes/Client/ApiKeyToken.cs b/Adyen/Disputes/Client/ApiKeyToken.cs new file mode 100644 index 000000000..8835067c6 --- /dev/null +++ b/Adyen/Disputes/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Disputes.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/LegalEntityManagement/Client/ApiKeyToken.cs b/Adyen/LegalEntityManagement/Client/ApiKeyToken.cs new file mode 100644 index 000000000..2fc889d48 --- /dev/null +++ b/Adyen/LegalEntityManagement/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.LegalEntityManagement.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Management/Client/ApiKeyToken.cs b/Adyen/Management/Client/ApiKeyToken.cs new file mode 100644 index 000000000..d70433675 --- /dev/null +++ b/Adyen/Management/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Management.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Payment/Client/ApiKeyToken.cs b/Adyen/Payment/Client/ApiKeyToken.cs new file mode 100644 index 000000000..e5170c605 --- /dev/null +++ b/Adyen/Payment/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Payment.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/PaymentsApp/Client/ApiKeyToken.cs b/Adyen/PaymentsApp/Client/ApiKeyToken.cs new file mode 100644 index 000000000..c96a4a409 --- /dev/null +++ b/Adyen/PaymentsApp/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.PaymentsApp.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Payout/Client/ApiKeyToken.cs b/Adyen/Payout/Client/ApiKeyToken.cs new file mode 100644 index 000000000..354b38522 --- /dev/null +++ b/Adyen/Payout/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Payout.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/PosMobile/Client/ApiKeyToken.cs b/Adyen/PosMobile/Client/ApiKeyToken.cs new file mode 100644 index 000000000..7458ddbe8 --- /dev/null +++ b/Adyen/PosMobile/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.PosMobile.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/PosTerminalManagement/Client/ApiKeyToken.cs b/Adyen/PosTerminalManagement/Client/ApiKeyToken.cs new file mode 100644 index 000000000..c73dee5ec --- /dev/null +++ b/Adyen/PosTerminalManagement/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.PosTerminalManagement.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Recurring/Client/ApiKeyToken.cs b/Adyen/Recurring/Client/ApiKeyToken.cs new file mode 100644 index 000000000..0e4be8e35 --- /dev/null +++ b/Adyen/Recurring/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Recurring.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/SessionAuthentication/Client/ApiKeyToken.cs b/Adyen/SessionAuthentication/Client/ApiKeyToken.cs new file mode 100644 index 000000000..66a98a0df --- /dev/null +++ b/Adyen/SessionAuthentication/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.SessionAuthentication.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/StoredValue/Client/ApiKeyToken.cs b/Adyen/StoredValue/Client/ApiKeyToken.cs new file mode 100644 index 000000000..6c3ae9437 --- /dev/null +++ b/Adyen/StoredValue/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.StoredValue.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Transfers/Client/ApiKeyToken.cs b/Adyen/Transfers/Client/ApiKeyToken.cs new file mode 100644 index 000000000..a4c35ee44 --- /dev/null +++ b/Adyen/Transfers/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Transfers.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache b/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache index 4c5486c78..dbea2b22d 100644 --- a/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache @@ -5,52 +5,46 @@ {{/nrt}} using System; - -namespace {{packageName}}.{{clientPackage}} +using {{packageName}}.{{corePackageName}}.Auth; +using {{packageName}}.{{corePackageName}}.{{clientPackage}}; + +namespace {{packageName}}.{{apiName}}.{{clientPackage}} { /// - /// A token constructed from an apiKey. + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. /// {{>visibility}} class ApiKeyToken : TokenBase { - private string _raw; + private readonly string _apiKeyValue; /// - /// The header that this token will be used with. + /// The name of the header. /// public ClientUtils.ApiKeyHeader Header { get; } /// - /// Constructs an ApiKeyToken object. + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. /// - /// - /// - /// - /// - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "", TimeSpan? timeout = null) : base(timeout) + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() { Header = header; - _raw = $"{prefix}{value}"; + _apiKeyValue = $"{prefix}{value}"; } /// /// Places the token in the header. /// /// - public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); - } - - /// - /// Places the token in the query. - /// - /// - /// - /// - public virtual void UseInQuery(global::System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) { - parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(){{nrt!}}; + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); } } } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache index be8977f00..65f3dfe41 100644 --- a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache +++ b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache @@ -100,6 +100,11 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} } } + /// + /// The format to use for DateTime serialization. + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + /// /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. /// If parameter is a list, join the list with ",". @@ -331,87 +336,50 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} throw new JsonException("The specified discriminator was not found."); } -#region Functionality that dynamically determines the Host URL of the HttpClient - + {{#hasApiKeyMethods}} /// - /// Constructs the Host URL based on the selected , used to populate the `HttpClient.BaseAddress`. + /// An enum of headers. /// - /// . - /// String with the Host URL. - /// - public static string GetHostUrl(AdyenOptions adyenOptions) + public enum ApiKeyHeader { - if (adyenOptions.Environment == {{packageName}}Environment.Live) - return ConstructLiveUrl(adyenOptions.LiveEndpointUrlPrefix, BASE_URL); - - // Some Adyen OpenApi Specifications use the live-url, instead of the test-url, this line replaces "-live" with "-test". - // If you need to override this URL, you can do so by replacing the BASE_URL in ClientUtils.cs. - if (adyenOptions.Environment == {{packageName}}Environment.Test) - return BASE_URL.Replace("-live", "-test"); - - throw new ArgumentOutOfRangeException(adyenOptions.Environment.ToString()); + {{#apiKeyMethods}} + /// + /// The {{keyParamName}} header. + /// + {{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}{{^-last}},{{/-last}} + {{/apiKeyMethods}} } - + /// - /// Construct LIVE BaseUrl, add the liveEndpointUrlPrefix it's the Checkout API or the Classic Payment API. - /// This helper function can be removed when all URLs (test & live) are included in the Adyen OpenApi Specifications: https://github.com/Adyen/adyen-openapi. + /// Converts an ApiKeyHeader to a string. /// - /// The Live EndpointUrlPrefix. - /// The Base URL . - /// baseUrl - /// - private static string ConstructLiveUrl(string liveEndpointUrlPrefix, string url) + /// + /// as a string value. + /// + {{>visibility}} static string ApiKeyHeaderToString(ApiKeyHeader value) { - // Change base url for Live environment - if (url.Contains("pal-")) // Payment API prefix + {{#net80OrLater}} + return value switch { - if (liveEndpointUrlPrefix == null) - { - throw new InvalidOperationException("Missing liveEndpointUrlPrefix for endpoint generation"); - } - - url = url.Replace("https://pal-test.adyen.com/pal/servlet/", - "https://" + liveEndpointUrlPrefix + "-pal-live.adyenpayments.com/pal/servlet/"); - } - else if (url.Contains("checkout-")) // Checkout API prefix + {{#apiKeyMethods}} + ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}} => "{{keyParamName}}", + {{/apiKeyMethods}} + _ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)), + }; + {{/net80OrLater}} + {{^net80OrLater}} + switch(value) { - if (liveEndpointUrlPrefix == null) - { - throw new InvalidOperationException("Missing liveEndpointUrlPrefix for endpoint generation"); - } - - if (url.Contains("possdk")) - { - url = url.Replace("https://checkout-test.adyen.com/", - "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/"); - } - else - { - url = url.Replace("https://checkout-test.adyen.com/", - "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/"); - } + {{#apiKeyMethods}} + case ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}: + return "{{keyParamName}}"; + {{/apiKeyMethods}} + default: + throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); } - - // If no prefix is required, we replace "test" -> "live" - url = url.Replace("-test", "-live"); - return url; + {{/net80OrLater}} } - -#endregion - - /// - /// The base path of the API, it includes the http(s)-scheme, the host domain name, and the base path. - /// - public static string BASE_URL = "{{{basePath}}}"; - /// - /// The relative path of the API after the `.com`. - /// - public static string RELATIVE_URL = "{{contextPath}}"; - - /// - /// The format to use for DateTime serialization. - /// - public const string ISO8601_DATETIME_FORMAT = "o"; + {{/hasApiKeyMethods}} } } diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 27d7a8f42..6d0e9cfeb 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -35,7 +35,18 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} private readonly AdyenOptions _adyenOptions = new AdyenOptions(); internal bool HttpClientsAdded { get; private set; } + + /// + /// The base path of the API, it includes the http(s)-scheme, the host domain name, and the base path. + /// This value can change when `ConfigureAdyenOptions` is called in ). The new value will be based on the .. + /// + public static string BASE_URL = "{{{basePath}}}"; + /// + /// The relative path of the API after the `.com`. + /// + public static string RELATIVE_URL = "{{contextPath}}"; + /// /// Instantiates the HostConfiguration (custom JsonConverters, Events, HttpClient) with the necessary dependencies to communicate with the API. /// @@ -104,7 +115,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} clientAction = null, Action{{nrt?}} builderAction = null) { if (clientAction == null) - clientAction = httpClient => httpClient.BaseAddress = new Uri(ClientUtils.GetHostUrl(_adyenOptions)); + clientAction = httpClient => httpClient.BaseAddress = new Uri(BASE_URL); List builders = new List(); @@ -127,6 +138,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration ConfigureJsonOptions(Action optionsAction) { optionsAction(_jsonOptions); + return this; } @@ -138,45 +150,71 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration ConfigureAdyenOptions(Action optionsAction) { optionsAction(_adyenOptions); + return this; } - - /// - /// Adds tokens to the . - /// - /// - /// - /// - public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase - { - TokenContainer container = new TokenContainer(new TTokenBase[]{ token }); - _services.AddSingleton(container); - return this; - } - + /// - /// Adds the to the . + /// Constructs the Host URL based on the selected , used to populate the `HttpClient.BaseAddress`. /// - /// - /// - public HostConfiguration AddApiKey(ApiKeyToken apiKey) + /// String with the Host URL. + /// + private string ConstructHostUrl() { - return AddTokens(apiKey); + if (_adyenOptions.Environment == {{packageName}}Environment.Live) + return ConstructLiveUrl(_adyenOptions.LiveEndpointUrlPrefix, BASE_URL); + + // Some Adyen OpenApi Specifications use the live-url, instead of the test-url, this line replaces "-live" with "-test". + // If you need to override this URL, you can do so by replacing the BASE_URL in ClientUtils.cs. + if (_adyenOptions.Environment == {{packageName}}Environment.Test) + return BASE_URL.Replace("-live", "-test"); + + throw new ArgumentOutOfRangeException(_adyenOptions.Environment.ToString()); } /// - /// Adds the to the , used to retrieve the . + /// Construct LIVE BaseUrl, add the liveEndpointUrlPrefix it's the Checkout API or the Classic Payment API. + /// This helper function can be removed when all URLs (test & live) are included in the Adyen OpenApi Specifications: https://github.com/Adyen/adyen-openapi. /// - /// - /// - /// - public HostConfiguration UseProvider() - where TTokenProvider : TokenProvider - where TTokenBase : TokenBase + /// The Live EndpointUrlPrefix. + /// The Base URL . + /// baseUrl + /// + private string ConstructLiveUrl(string liveEndpointUrlPrefix, string url) { - _services.AddSingleton(); - _services.AddSingleton>(services => services.GetRequiredService()); - return this; + // Change base url for Live environment + if (url.Contains("pal-")) // Payment API prefix + { + if (liveEndpointUrlPrefix == null) + { + throw new InvalidOperationException("LiveEndpointUrlPrefix is null - please configure your AdyenOptions.LiveEndpointUrlPrefix"); + } + + url = url.Replace("https://pal-test.adyen.com/pal/servlet/", + "https://" + liveEndpointUrlPrefix + "-pal-live.adyenpayments.com/pal/servlet/"); + } + else if (url.Contains("checkout-")) // Checkout API prefix + { + if (liveEndpointUrlPrefix == null) + { + throw new InvalidOperationException("LiveEndpointUrlPrefix is null - please configure your AdyenOptions.LiveEndpointUrlPrefix"); + } + + if (url.Contains("possdk")) + { + url = url.Replace("https://checkout-test.adyen.com/", + "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/"); + } + else + { + url = url.Replace("https://checkout-test.adyen.com/", + "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/"); + } + } + + // If no prefix is required, we replace "test" -> "live" + url = url.Replace("-test", "-live"); + return url; } } } diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index ce4ddff92..790c48655 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -7,7 +7,6 @@ using System; using System.Linq; using Microsoft.Extensions.DependencyInjection; using {{packageName}}.{{apiName}}.{{clientPackage}}; -using {{packageName}}.{{corePackageName}}.Auth; namespace {{packageName}}.{{apiName}}.Extensions { @@ -45,22 +44,6 @@ namespace {{packageName}}.{{apiName}}.Extensions { if (!host.HttpClientsAdded) host.Add{{apiName}}HttpClients(); - - // Ensure that a token provider was provided for this token type. - var containerServices = services.Where(s => - s.ServiceType.IsGenericType && - s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))) - .ToArray(); - - foreach(var containerService in containerServices) - { - Type tokenType = containerService.ServiceType.GenericTypeArguments[0]; - var serviceDescriptor = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); - if (serviceDescriptor == null) - { - services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType)); - } - } } } } diff --git a/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache b/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache index b5c30c6fe..7e5cf9cb8 100644 --- a/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache @@ -9,17 +9,17 @@ using System.Text.Json; namespace {{packageName}}.{{apiName}}.{{clientPackage}} { /// - /// Provides the JsonSerializerOptions + /// Provides the JsonSerializerOptions. /// {{>visibility}} class JsonSerializerOptionsProvider { /// - /// the JsonSerializerOptions + /// The JsonSerializerOptions. /// public JsonSerializerOptions Options { get; } /// - /// Instantiates a JsonSerializerOptionsProvider + /// Instantiates a JsonSerializerOptionsProvider to access the JsonSerializerOptions. /// public JsonSerializerOptionsProvider(JsonSerializerOptions options) { diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 7463eb626..53c41c84d 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -166,22 +166,22 @@ namespace {{packageName}}.{{apiPackage}} /// /// A token provider of type . /// - public TokenProvider ApiKeyProvider { get; }{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + public ITokenProvider ApiKeyProvider { get; }{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} /// /// A token provider of type . /// - public TokenProvider BearerTokenProvider { get; }{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}} + public ITokenProvider BearerTokenProvider { get; }{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}} /// /// A token provider of type . /// - public TokenProvider HttpSignatureTokenProvider { get; }{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + public ITokenProvider HttpSignatureTokenProvider { get; }{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} /// /// A token provider of type . /// - public TokenProvider OauthTokenProvider { get; }{{/hasOAuthMethods}} + public ITokenProvider OauthTokenProvider { get; }{{/hasOAuthMethods}} {{#net80OrLater}} {{#lambda.unique}} @@ -201,10 +201,10 @@ namespace {{packageName}}.{{apiPackage}} /// /// public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, - TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, - TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}}, - TokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, - TokenProvider oauthTokenProvider{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}}, + ITokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, + ITokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}}, + ITokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, + ITokenProvider oauthTokenProvider{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}}, {{packageName}}.{{clientPackage}}.CookieContainer cookieContainer{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}}) { _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; @@ -476,8 +476,8 @@ namespace {{packageName}}.{{apiPackage}} {{! Only use API Keys that are appended to the HTTP-headers }} {{^isKeyInCookie}} {{#isKeyInHeader}} - ApiKeyToken apiKeyToken{{-index}} = (ApiKeyToken) ApiKeyProvider.Get("{{keyParamName}}"); - apiKeyToken{{-index}}.UseInHeader(httpRequestMessage); + ApiKeyToken apiKeyToken{{-index}} = (ApiKeyToken) ApiKeyProvider.Get(); + apiKeyToken{{-index}}.AddTokenToHttpRequestMessageHeader(httpRequestMessage); {{/isKeyInHeader}} {{/isKeyInCookie}} {{/isApiKey}} From 3cd02b53e1495f105a3bcd605c5469d59f31df55 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 24 Oct 2025 23:19:47 +0200 Subject: [PATCH 055/126] Revert "Added 1-line configuration support for configuration an environment, adyen-api-key and liveprefix" This reverts commit 5614205951e7efddeb0e927d71d1541bf57c25a9. --- .../PaymentsServiceIntegrationTest.cs | 24 ++-- .../BalanceControl/BalanceControlTest.cs | 53 --------- Adyen.Test/Utilities/TestUtilities.cs | 13 --- Adyen/BalanceControl/Client/ApiKeyToken.cs | 48 -------- Adyen/BalancePlatform/Client/ApiKeyToken.cs | 48 -------- Adyen/BalanceWebhooks/Client/ApiKeyToken.cs | 48 -------- Adyen/BinLookup/Client/ApiKeyToken.cs | 48 -------- Adyen/Checkout/Client/ApiKeyToken.cs | 48 -------- Adyen/Core/Auth/ApiKeyToken.cs | 42 +++++++ Adyen/Core/Auth/BasicToken.cs | 54 +++++++++ Adyen/Core/Auth/TokenBase.cs | 5 +- Adyen/Core/Auth/TokenContainer.cs | 32 ++++++ Adyen/Core/Auth/TokenProvider.cs | 59 +++++----- Adyen/Core/Options/AdyenOptions.cs | 10 +- Adyen/Disputes/Client/ApiKeyToken.cs | 48 -------- .../Client/ApiKeyToken.cs | 48 -------- Adyen/Management/Client/ApiKeyToken.cs | 48 -------- Adyen/Payment/Client/ApiKeyToken.cs | 48 -------- Adyen/PaymentsApp/Client/ApiKeyToken.cs | 48 -------- Adyen/Payout/Client/ApiKeyToken.cs | 48 -------- Adyen/PosMobile/Client/ApiKeyToken.cs | 48 -------- .../Client/ApiKeyToken.cs | 48 -------- Adyen/Recurring/Client/ApiKeyToken.cs | 48 -------- .../Client/ApiKeyToken.cs | 48 -------- Adyen/StoredValue/Client/ApiKeyToken.cs | 48 -------- Adyen/Transfers/Client/ApiKeyToken.cs | 48 -------- .../generichost/ApiKeyToken.mustache | 44 ++++--- .../generichost/ClientUtils.mustache | 108 ++++++++++++------ .../generichost/HostConfiguration.mustache | 98 +++++----------- .../IServiceCollectionExtensions.mustache | 17 +++ .../JsonSerializerOptionsProvider.mustache | 6 +- .../csharp/libraries/generichost/api.mustache | 20 ++-- 32 files changed, 328 insertions(+), 1073 deletions(-) delete mode 100644 Adyen.Test/BalanceControl/BalanceControlTest.cs delete mode 100644 Adyen.Test/Utilities/TestUtilities.cs delete mode 100644 Adyen/BalanceControl/Client/ApiKeyToken.cs delete mode 100644 Adyen/BalancePlatform/Client/ApiKeyToken.cs delete mode 100644 Adyen/BalanceWebhooks/Client/ApiKeyToken.cs delete mode 100644 Adyen/BinLookup/Client/ApiKeyToken.cs delete mode 100644 Adyen/Checkout/Client/ApiKeyToken.cs create mode 100644 Adyen/Core/Auth/ApiKeyToken.cs create mode 100644 Adyen/Core/Auth/BasicToken.cs create mode 100644 Adyen/Core/Auth/TokenContainer.cs delete mode 100644 Adyen/Disputes/Client/ApiKeyToken.cs delete mode 100644 Adyen/LegalEntityManagement/Client/ApiKeyToken.cs delete mode 100644 Adyen/Management/Client/ApiKeyToken.cs delete mode 100644 Adyen/Payment/Client/ApiKeyToken.cs delete mode 100644 Adyen/PaymentsApp/Client/ApiKeyToken.cs delete mode 100644 Adyen/Payout/Client/ApiKeyToken.cs delete mode 100644 Adyen/PosMobile/Client/ApiKeyToken.cs delete mode 100644 Adyen/PosTerminalManagement/Client/ApiKeyToken.cs delete mode 100644 Adyen/Recurring/Client/ApiKeyToken.cs delete mode 100644 Adyen/SessionAuthentication/Client/ApiKeyToken.cs delete mode 100644 Adyen/StoredValue/Client/ApiKeyToken.cs delete mode 100644 Adyen/Transfers/Client/ApiKeyToken.cs diff --git a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index 0818d4e6f..ae60b95b3 100644 --- a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -7,7 +7,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; using System.Text.Json; -using Adyen.Core.Options; namespace Adyen.IntegrationTest.Checkout { @@ -19,19 +18,18 @@ public class PaymentsServiceIntegrationTest public PaymentsServiceIntegrationTest() { - IHost host = Host.CreateDefaultBuilder() - .ConfigureCheckout((context, services, config) => - { - config.ConfigureAdyenOptions(options => - { - options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; - options.Environment = AdyenEnvironment.Test; - }); - }) - .Build(); + IHost host = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + var apiKey = new ApiKeyToken( + context.Configuration["ADYEN_API_KEY"] + ); + config.AddTokens(apiKey); + }) + .Build(); - _paymentsApiService = host.Services.GetRequiredService(); - _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + _paymentsApiService = host.Services.GetRequiredService(); + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); } [TestMethod] diff --git a/Adyen.Test/BalanceControl/BalanceControlTest.cs b/Adyen.Test/BalanceControl/BalanceControlTest.cs deleted file mode 100644 index 6e0a00ab3..000000000 --- a/Adyen.Test/BalanceControl/BalanceControlTest.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Text.Json; -using System.Text.Json.Serialization; -using Adyen.BalanceControl.Client; -using Adyen.BalanceControl.Extensions; -using Adyen.BalanceControl.Models; -using Adyen.BalanceControl.Services; -using Adyen.Core.Auth; -using Adyen.Core.Options; -using Adyen.Test.Utilities; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test.BalanceControl -{ - [TestClass] - public class BalanceControlTest - { - private readonly IBalanceControlService _balanceControlService; - private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; - - public BalanceControlTest() - { IHost host = Host.CreateDefaultBuilder() - .ConfigureBalanceControl((context, services, config) => - { - config.ConfigureAdyenOptions(options => - { - options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; - options.Environment = AdyenEnvironment.Test; - }); - }) - .Build(); - - _balanceControlService = host.Services.GetRequiredService(); - _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); - } - - [TestMethod] - public async Task DeserializeBalanceControlTest() - { - // Arrange - var json = TestUtilities.GetTestFileContent("mocks/balance-control-transfer.json"); - - // Act - var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); - - // Assert - Assert.AreEqual(response.CreatedAt, new DateTime(2022,01, 24)); - Assert.AreEqual(response.Status, BalanceTransferResponse.StatusEnum.Transferred); - } - } -} \ No newline at end of file diff --git a/Adyen.Test/Utilities/TestUtilities.cs b/Adyen.Test/Utilities/TestUtilities.cs deleted file mode 100644 index 39b052bdc..000000000 --- a/Adyen.Test/Utilities/TestUtilities.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Adyen.Test.Utilities -{ - public class TestUtilities - { - public static string GetTestFileContent(string relativePath) - { - string rootPath = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "../../../")); - string absolutePath = Path.Combine(rootPath, relativePath); - - return File.ReadAllText(absolutePath); - } - } -} \ No newline at end of file diff --git a/Adyen/BalanceControl/Client/ApiKeyToken.cs b/Adyen/BalanceControl/Client/ApiKeyToken.cs deleted file mode 100644 index d300697c6..000000000 --- a/Adyen/BalanceControl/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.BalanceControl.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/BalancePlatform/Client/ApiKeyToken.cs b/Adyen/BalancePlatform/Client/ApiKeyToken.cs deleted file mode 100644 index 716617ad4..000000000 --- a/Adyen/BalancePlatform/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.BalancePlatform.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/BalanceWebhooks/Client/ApiKeyToken.cs b/Adyen/BalanceWebhooks/Client/ApiKeyToken.cs deleted file mode 100644 index 29d9c8235..000000000 --- a/Adyen/BalanceWebhooks/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.BalanceWebhooks.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/BinLookup/Client/ApiKeyToken.cs b/Adyen/BinLookup/Client/ApiKeyToken.cs deleted file mode 100644 index c7129035a..000000000 --- a/Adyen/BinLookup/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.BinLookup.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Checkout/Client/ApiKeyToken.cs b/Adyen/Checkout/Client/ApiKeyToken.cs deleted file mode 100644 index 755581356..000000000 --- a/Adyen/Checkout/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Checkout.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Core/Auth/ApiKeyToken.cs b/Adyen/Core/Auth/ApiKeyToken.cs new file mode 100644 index 000000000..837c78e2f --- /dev/null +++ b/Adyen/Core/Auth/ApiKeyToken.cs @@ -0,0 +1,42 @@ +#nullable enable + +using System; + +namespace Adyen.Core.Auth +{ + /// + /// A token constructed from an ApiKey. + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. Most common use-case for Digital (ECOM) & In-Person payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The key of the header for your API Key. + /// + public string Key { get; set; } = "X-API-Key"; + + /// + /// Constructs an ApiKeyToken object. + /// + /// + /// + public ApiKeyToken(string value, string prefix = "") + { + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(Key, _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Core/Auth/BasicToken.cs b/Adyen/Core/Auth/BasicToken.cs new file mode 100644 index 000000000..bba61e967 --- /dev/null +++ b/Adyen/Core/Auth/BasicToken.cs @@ -0,0 +1,54 @@ +#nullable enable + +using System; +using System.Net.Http.Headers; + +namespace Adyen.Core.Auth +{ + /// + /// A token constructed from a username and password. + /// Adyen recommends using the instead. + /// + public class BasicToken : TokenBase + { + private readonly string _username; + + private readonly string _password; + + /// + /// The key of the header for basic authentication. + /// + public string Key { get; set; } = "Basic"; + + /// + /// Constructs a BasicToken object. + /// Adyen recommends using the instead. + /// + /// + /// + public BasicToken(string username, string password) : base() + { + _username = username; + _password = password; + } + + /// + /// Places the username/password token in the header. + /// + /// + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Authorization = new AuthenticationHeaderValue(Key, Base64Encode(_username + ":" + _password)); + } + + /// + /// Encodes to a Base64-string. + /// + /// The string to encode. + /// Base64-encoded string. + private static string Base64Encode(string value) + { + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(value)); + } + } +} \ No newline at end of file diff --git a/Adyen/Core/Auth/TokenBase.cs b/Adyen/Core/Auth/TokenBase.cs index 64522ca9f..347c174e4 100644 --- a/Adyen/Core/Auth/TokenBase.cs +++ b/Adyen/Core/Auth/TokenBase.cs @@ -5,12 +5,13 @@ namespace Adyen.Core.Auth { /// - /// The base class for all auth tokens. + /// The base class for all tokens. /// public abstract class TokenBase { /// - /// The constructor for the TokenBase object, used by . + /// The constructor for the parent TokenBase object. + /// Example usages: or . /// internal TokenBase() { diff --git a/Adyen/Core/Auth/TokenContainer.cs b/Adyen/Core/Auth/TokenContainer.cs new file mode 100644 index 000000000..0f1215ef8 --- /dev/null +++ b/Adyen/Core/Auth/TokenContainer.cs @@ -0,0 +1,32 @@ +#nullable enable + +namespace Adyen.Core.Auth +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// List of tokens. + public TokenContainer(IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/Adyen/Core/Auth/TokenProvider.cs b/Adyen/Core/Auth/TokenProvider.cs index 745cca691..47f741657 100644 --- a/Adyen/Core/Auth/TokenProvider.cs +++ b/Adyen/Core/Auth/TokenProvider.cs @@ -1,42 +1,43 @@ +// +/* + * Adyen Checkout API + * + * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! + * + * The version of the OpenAPI document: 71 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Linq; +using System.Collections.Generic; + namespace Adyen.Core.Auth -{ +{ /// - /// An interface for providing tokens in a generic way. + /// A class which will provide tokens. /// - /// - public interface ITokenProvider where TTokenBase : TokenBase + public abstract class TokenProvider where TTokenBase : TokenBase { /// - /// Retrieves the stored token. + /// The array of tokens. /// - /// - TTokenBase Get(); - } - - /// - /// A class which will provide tokens from type . - /// - /// - public class TokenProvider : ITokenProvider where TTokenBase : TokenBase - { - private readonly TTokenBase _token; + protected TTokenBase[] _tokens; + + internal abstract TTokenBase Get(string header = ""); /// - /// Initializes a token with type . - /// - /// - public TokenProvider(TTokenBase token) - { - _token = token; - } - - /// - /// Retrieves the stored token. + /// Instantiates a TokenProvider. /// - /// - public TTokenBase Get() + /// + public TokenProvider(IEnumerable tokens) { - return _token; + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens (e.g. API Keys), see also: ApiKeyToken class."); } } } \ No newline at end of file diff --git a/Adyen/Core/Options/AdyenOptions.cs b/Adyen/Core/Options/AdyenOptions.cs index d07bd02d0..ea770619f 100644 --- a/Adyen/Core/Options/AdyenOptions.cs +++ b/Adyen/Core/Options/AdyenOptions.cs @@ -6,7 +6,7 @@ public class AdyenOptions /// The Adyen Environment. /// public AdyenEnvironment Environment { get; set; } = AdyenEnvironment.Test; - + /// /// Used in the LIVE environment only. /// Default value: empty string. @@ -14,13 +14,5 @@ public class AdyenOptions /// See: https://docs.adyen.com/development-resources/live-endpoints/ /// public string LiveEndpointUrlPrefix { get; set; } = string.Empty; - - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public string AdyenApiKey { get; set; } } } \ No newline at end of file diff --git a/Adyen/Disputes/Client/ApiKeyToken.cs b/Adyen/Disputes/Client/ApiKeyToken.cs deleted file mode 100644 index 8835067c6..000000000 --- a/Adyen/Disputes/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Disputes.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/LegalEntityManagement/Client/ApiKeyToken.cs b/Adyen/LegalEntityManagement/Client/ApiKeyToken.cs deleted file mode 100644 index 2fc889d48..000000000 --- a/Adyen/LegalEntityManagement/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.LegalEntityManagement.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Management/Client/ApiKeyToken.cs b/Adyen/Management/Client/ApiKeyToken.cs deleted file mode 100644 index d70433675..000000000 --- a/Adyen/Management/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Management.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Payment/Client/ApiKeyToken.cs b/Adyen/Payment/Client/ApiKeyToken.cs deleted file mode 100644 index e5170c605..000000000 --- a/Adyen/Payment/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Payment.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/PaymentsApp/Client/ApiKeyToken.cs b/Adyen/PaymentsApp/Client/ApiKeyToken.cs deleted file mode 100644 index c96a4a409..000000000 --- a/Adyen/PaymentsApp/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.PaymentsApp.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Payout/Client/ApiKeyToken.cs b/Adyen/Payout/Client/ApiKeyToken.cs deleted file mode 100644 index 354b38522..000000000 --- a/Adyen/Payout/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Payout.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/PosMobile/Client/ApiKeyToken.cs b/Adyen/PosMobile/Client/ApiKeyToken.cs deleted file mode 100644 index 7458ddbe8..000000000 --- a/Adyen/PosMobile/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.PosMobile.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/PosTerminalManagement/Client/ApiKeyToken.cs b/Adyen/PosTerminalManagement/Client/ApiKeyToken.cs deleted file mode 100644 index c73dee5ec..000000000 --- a/Adyen/PosTerminalManagement/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.PosTerminalManagement.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Recurring/Client/ApiKeyToken.cs b/Adyen/Recurring/Client/ApiKeyToken.cs deleted file mode 100644 index 0e4be8e35..000000000 --- a/Adyen/Recurring/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Recurring.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/SessionAuthentication/Client/ApiKeyToken.cs b/Adyen/SessionAuthentication/Client/ApiKeyToken.cs deleted file mode 100644 index 66a98a0df..000000000 --- a/Adyen/SessionAuthentication/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.SessionAuthentication.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/StoredValue/Client/ApiKeyToken.cs b/Adyen/StoredValue/Client/ApiKeyToken.cs deleted file mode 100644 index 6c3ae9437..000000000 --- a/Adyen/StoredValue/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.StoredValue.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Transfers/Client/ApiKeyToken.cs b/Adyen/Transfers/Client/ApiKeyToken.cs deleted file mode 100644 index a4c35ee44..000000000 --- a/Adyen/Transfers/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Transfers.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache b/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache index dbea2b22d..4c5486c78 100644 --- a/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache @@ -5,46 +5,52 @@ {{/nrt}} using System; -using {{packageName}}.{{corePackageName}}.Auth; -using {{packageName}}.{{corePackageName}}.{{clientPackage}}; - -namespace {{packageName}}.{{apiName}}.{{clientPackage}} + +namespace {{packageName}}.{{clientPackage}} { /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// A token constructed from an apiKey. /// {{>visibility}} class ApiKeyToken : TokenBase { - private readonly string _apiKeyValue; + private string _raw; /// - /// The name of the header. + /// The header that this token will be used with. /// public ClientUtils.ApiKeyHeader Header { get; } /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. + /// Constructs an ApiKeyToken object. /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + /// + /// + /// + /// + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "", TimeSpan? timeout = null) : base(timeout) { Header = header; - _apiKeyValue = $"{prefix}{value}"; + _raw = $"{prefix}{value}"; } /// /// Places the token in the header. /// /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); + } + + /// + /// Places the token in the query. + /// + /// + /// + /// + public virtual void UseInQuery(global::System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(){{nrt!}}; } } } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache index 65f3dfe41..be8977f00 100644 --- a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache +++ b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache @@ -100,11 +100,6 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} } } - /// - /// The format to use for DateTime serialization. - /// - public const string ISO8601_DATETIME_FORMAT = "o"; - /// /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. /// If parameter is a list, join the list with ",". @@ -336,50 +331,87 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} throw new JsonException("The specified discriminator was not found."); } - {{#hasApiKeyMethods}} +#region Functionality that dynamically determines the Host URL of the HttpClient + /// - /// An enum of headers. + /// Constructs the Host URL based on the selected , used to populate the `HttpClient.BaseAddress`. /// - public enum ApiKeyHeader + /// . + /// String with the Host URL. + /// + public static string GetHostUrl(AdyenOptions adyenOptions) { - {{#apiKeyMethods}} - /// - /// The {{keyParamName}} header. - /// - {{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}{{^-last}},{{/-last}} - {{/apiKeyMethods}} + if (adyenOptions.Environment == {{packageName}}Environment.Live) + return ConstructLiveUrl(adyenOptions.LiveEndpointUrlPrefix, BASE_URL); + + // Some Adyen OpenApi Specifications use the live-url, instead of the test-url, this line replaces "-live" with "-test". + // If you need to override this URL, you can do so by replacing the BASE_URL in ClientUtils.cs. + if (adyenOptions.Environment == {{packageName}}Environment.Test) + return BASE_URL.Replace("-live", "-test"); + + throw new ArgumentOutOfRangeException(adyenOptions.Environment.ToString()); } - + /// - /// Converts an ApiKeyHeader to a string. + /// Construct LIVE BaseUrl, add the liveEndpointUrlPrefix it's the Checkout API or the Classic Payment API. + /// This helper function can be removed when all URLs (test & live) are included in the Adyen OpenApi Specifications: https://github.com/Adyen/adyen-openapi. /// - /// - /// as a string value. - /// - {{>visibility}} static string ApiKeyHeaderToString(ApiKeyHeader value) + /// The Live EndpointUrlPrefix. + /// The Base URL . + /// baseUrl + /// + private static string ConstructLiveUrl(string liveEndpointUrlPrefix, string url) { - {{#net80OrLater}} - return value switch + // Change base url for Live environment + if (url.Contains("pal-")) // Payment API prefix { - {{#apiKeyMethods}} - ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}} => "{{keyParamName}}", - {{/apiKeyMethods}} - _ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)), - }; - {{/net80OrLater}} - {{^net80OrLater}} - switch(value) + if (liveEndpointUrlPrefix == null) + { + throw new InvalidOperationException("Missing liveEndpointUrlPrefix for endpoint generation"); + } + + url = url.Replace("https://pal-test.adyen.com/pal/servlet/", + "https://" + liveEndpointUrlPrefix + "-pal-live.adyenpayments.com/pal/servlet/"); + } + else if (url.Contains("checkout-")) // Checkout API prefix { - {{#apiKeyMethods}} - case ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}: - return "{{keyParamName}}"; - {{/apiKeyMethods}} - default: - throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); + if (liveEndpointUrlPrefix == null) + { + throw new InvalidOperationException("Missing liveEndpointUrlPrefix for endpoint generation"); + } + + if (url.Contains("possdk")) + { + url = url.Replace("https://checkout-test.adyen.com/", + "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/"); + } + else + { + url = url.Replace("https://checkout-test.adyen.com/", + "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/"); + } } - {{/net80OrLater}} + + // If no prefix is required, we replace "test" -> "live" + url = url.Replace("-test", "-live"); + return url; } + +#endregion + + /// + /// The base path of the API, it includes the http(s)-scheme, the host domain name, and the base path. + /// + public static string BASE_URL = "{{{basePath}}}"; - {{/hasApiKeyMethods}} + /// + /// The relative path of the API after the `.com`. + /// + public static string RELATIVE_URL = "{{contextPath}}"; + + /// + /// The format to use for DateTime serialization. + /// + public const string ISO8601_DATETIME_FORMAT = "o"; } } diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 6d0e9cfeb..27d7a8f42 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -35,18 +35,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} private readonly AdyenOptions _adyenOptions = new AdyenOptions(); internal bool HttpClientsAdded { get; private set; } - - /// - /// The base path of the API, it includes the http(s)-scheme, the host domain name, and the base path. - /// This value can change when `ConfigureAdyenOptions` is called in ). The new value will be based on the .. - /// - public static string BASE_URL = "{{{basePath}}}"; - /// - /// The relative path of the API after the `.com`. - /// - public static string RELATIVE_URL = "{{contextPath}}"; - /// /// Instantiates the HostConfiguration (custom JsonConverters, Events, HttpClient) with the necessary dependencies to communicate with the API. /// @@ -115,7 +104,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} clientAction = null, Action{{nrt?}} builderAction = null) { if (clientAction == null) - clientAction = httpClient => httpClient.BaseAddress = new Uri(BASE_URL); + clientAction = httpClient => httpClient.BaseAddress = new Uri(ClientUtils.GetHostUrl(_adyenOptions)); List builders = new List(); @@ -138,7 +127,6 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration ConfigureJsonOptions(Action optionsAction) { optionsAction(_jsonOptions); - return this; } @@ -150,71 +138,45 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration ConfigureAdyenOptions(Action optionsAction) { optionsAction(_adyenOptions); - return this; } - + + /// + /// Adds tokens to the . + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(new TTokenBase[]{ token }); + _services.AddSingleton(container); + return this; + } + /// - /// Constructs the Host URL based on the selected , used to populate the `HttpClient.BaseAddress`. + /// Adds the to the . /// - /// String with the Host URL. - /// - private string ConstructHostUrl() + /// + /// + public HostConfiguration AddApiKey(ApiKeyToken apiKey) { - if (_adyenOptions.Environment == {{packageName}}Environment.Live) - return ConstructLiveUrl(_adyenOptions.LiveEndpointUrlPrefix, BASE_URL); - - // Some Adyen OpenApi Specifications use the live-url, instead of the test-url, this line replaces "-live" with "-test". - // If you need to override this URL, you can do so by replacing the BASE_URL in ClientUtils.cs. - if (_adyenOptions.Environment == {{packageName}}Environment.Test) - return BASE_URL.Replace("-live", "-test"); - - throw new ArgumentOutOfRangeException(_adyenOptions.Environment.ToString()); + return AddTokens(apiKey); } /// - /// Construct LIVE BaseUrl, add the liveEndpointUrlPrefix it's the Checkout API or the Classic Payment API. - /// This helper function can be removed when all URLs (test & live) are included in the Adyen OpenApi Specifications: https://github.com/Adyen/adyen-openapi. + /// Adds the to the , used to retrieve the . /// - /// The Live EndpointUrlPrefix. - /// The Base URL . - /// baseUrl - /// - private string ConstructLiveUrl(string liveEndpointUrlPrefix, string url) + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase { - // Change base url for Live environment - if (url.Contains("pal-")) // Payment API prefix - { - if (liveEndpointUrlPrefix == null) - { - throw new InvalidOperationException("LiveEndpointUrlPrefix is null - please configure your AdyenOptions.LiveEndpointUrlPrefix"); - } - - url = url.Replace("https://pal-test.adyen.com/pal/servlet/", - "https://" + liveEndpointUrlPrefix + "-pal-live.adyenpayments.com/pal/servlet/"); - } - else if (url.Contains("checkout-")) // Checkout API prefix - { - if (liveEndpointUrlPrefix == null) - { - throw new InvalidOperationException("LiveEndpointUrlPrefix is null - please configure your AdyenOptions.LiveEndpointUrlPrefix"); - } - - if (url.Contains("possdk")) - { - url = url.Replace("https://checkout-test.adyen.com/", - "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/"); - } - else - { - url = url.Replace("https://checkout-test.adyen.com/", - "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/"); - } - } - - // If no prefix is required, we replace "test" -> "live" - url = url.Replace("-test", "-live"); - return url; + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + return this; } } } diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index 790c48655..ce4ddff92 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -7,6 +7,7 @@ using System; using System.Linq; using Microsoft.Extensions.DependencyInjection; using {{packageName}}.{{apiName}}.{{clientPackage}}; +using {{packageName}}.{{corePackageName}}.Auth; namespace {{packageName}}.{{apiName}}.Extensions { @@ -44,6 +45,22 @@ namespace {{packageName}}.{{apiName}}.Extensions { if (!host.HttpClientsAdded) host.Add{{apiName}}HttpClients(); + + // Ensure that a token provider was provided for this token type. + var containerServices = services.Where(s => + s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))) + .ToArray(); + + foreach(var containerService in containerServices) + { + Type tokenType = containerService.ServiceType.GenericTypeArguments[0]; + var serviceDescriptor = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + if (serviceDescriptor == null) + { + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType)); + } + } } } } diff --git a/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache b/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache index 7e5cf9cb8..b5c30c6fe 100644 --- a/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache @@ -9,17 +9,17 @@ using System.Text.Json; namespace {{packageName}}.{{apiName}}.{{clientPackage}} { /// - /// Provides the JsonSerializerOptions. + /// Provides the JsonSerializerOptions /// {{>visibility}} class JsonSerializerOptionsProvider { /// - /// The JsonSerializerOptions. + /// the JsonSerializerOptions /// public JsonSerializerOptions Options { get; } /// - /// Instantiates a JsonSerializerOptionsProvider to access the JsonSerializerOptions. + /// Instantiates a JsonSerializerOptionsProvider /// public JsonSerializerOptionsProvider(JsonSerializerOptions options) { diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 53c41c84d..7463eb626 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -166,22 +166,22 @@ namespace {{packageName}}.{{apiPackage}} /// /// A token provider of type . /// - public ITokenProvider ApiKeyProvider { get; }{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + public TokenProvider ApiKeyProvider { get; }{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} /// /// A token provider of type . /// - public ITokenProvider BearerTokenProvider { get; }{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}} + public TokenProvider BearerTokenProvider { get; }{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}} /// /// A token provider of type . /// - public ITokenProvider HttpSignatureTokenProvider { get; }{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + public TokenProvider HttpSignatureTokenProvider { get; }{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} /// /// A token provider of type . /// - public ITokenProvider OauthTokenProvider { get; }{{/hasOAuthMethods}} + public TokenProvider OauthTokenProvider { get; }{{/hasOAuthMethods}} {{#net80OrLater}} {{#lambda.unique}} @@ -201,10 +201,10 @@ namespace {{packageName}}.{{apiPackage}} /// /// public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, - ITokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, - ITokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}}, - ITokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, - ITokenProvider oauthTokenProvider{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}}, + TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, + TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}}, + TokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, + TokenProvider oauthTokenProvider{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}}, {{packageName}}.{{clientPackage}}.CookieContainer cookieContainer{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}}) { _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; @@ -476,8 +476,8 @@ namespace {{packageName}}.{{apiPackage}} {{! Only use API Keys that are appended to the HTTP-headers }} {{^isKeyInCookie}} {{#isKeyInHeader}} - ApiKeyToken apiKeyToken{{-index}} = (ApiKeyToken) ApiKeyProvider.Get(); - apiKeyToken{{-index}}.AddTokenToHttpRequestMessageHeader(httpRequestMessage); + ApiKeyToken apiKeyToken{{-index}} = (ApiKeyToken) ApiKeyProvider.Get("{{keyParamName}}"); + apiKeyToken{{-index}}.UseInHeader(httpRequestMessage); {{/isKeyInHeader}} {{/isKeyInCookie}} {{/isApiKey}} From 1129c30c524a0cf06807ecc4b0c82ec8cb3eda6a Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 24 Oct 2025 23:20:44 +0200 Subject: [PATCH 056/126] Reapply "Added 1-line configuration support for configuration an environment, adyen-api-key and liveprefix" This reverts commit 3cd02b53e1495f105a3bcd605c5469d59f31df55. --- .../PaymentsServiceIntegrationTest.cs | 24 ++-- .../BalanceControl/BalanceControlTest.cs | 53 +++++++++ Adyen.Test/Utilities/TestUtilities.cs | 13 +++ Adyen/BalanceControl/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/BalancePlatform/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/BalanceWebhooks/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/BinLookup/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Checkout/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Core/Auth/ApiKeyToken.cs | 42 ------- Adyen/Core/Auth/BasicToken.cs | 54 --------- Adyen/Core/Auth/TokenBase.cs | 5 +- Adyen/Core/Auth/TokenContainer.cs | 32 ------ Adyen/Core/Auth/TokenProvider.cs | 59 +++++----- Adyen/Core/Options/AdyenOptions.cs | 10 +- Adyen/Disputes/Client/ApiKeyToken.cs | 48 ++++++++ .../Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Management/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Payment/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/PaymentsApp/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Payout/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/PosMobile/Client/ApiKeyToken.cs | 48 ++++++++ .../Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Recurring/Client/ApiKeyToken.cs | 48 ++++++++ .../Client/ApiKeyToken.cs | 48 ++++++++ Adyen/StoredValue/Client/ApiKeyToken.cs | 48 ++++++++ Adyen/Transfers/Client/ApiKeyToken.cs | 48 ++++++++ .../generichost/ApiKeyToken.mustache | 44 +++---- .../generichost/ClientUtils.mustache | 108 ++++++------------ .../generichost/HostConfiguration.mustache | 98 +++++++++++----- .../IServiceCollectionExtensions.mustache | 17 --- .../JsonSerializerOptionsProvider.mustache | 6 +- .../csharp/libraries/generichost/api.mustache | 20 ++-- 32 files changed, 1073 insertions(+), 328 deletions(-) create mode 100644 Adyen.Test/BalanceControl/BalanceControlTest.cs create mode 100644 Adyen.Test/Utilities/TestUtilities.cs create mode 100644 Adyen/BalanceControl/Client/ApiKeyToken.cs create mode 100644 Adyen/BalancePlatform/Client/ApiKeyToken.cs create mode 100644 Adyen/BalanceWebhooks/Client/ApiKeyToken.cs create mode 100644 Adyen/BinLookup/Client/ApiKeyToken.cs create mode 100644 Adyen/Checkout/Client/ApiKeyToken.cs delete mode 100644 Adyen/Core/Auth/ApiKeyToken.cs delete mode 100644 Adyen/Core/Auth/BasicToken.cs delete mode 100644 Adyen/Core/Auth/TokenContainer.cs create mode 100644 Adyen/Disputes/Client/ApiKeyToken.cs create mode 100644 Adyen/LegalEntityManagement/Client/ApiKeyToken.cs create mode 100644 Adyen/Management/Client/ApiKeyToken.cs create mode 100644 Adyen/Payment/Client/ApiKeyToken.cs create mode 100644 Adyen/PaymentsApp/Client/ApiKeyToken.cs create mode 100644 Adyen/Payout/Client/ApiKeyToken.cs create mode 100644 Adyen/PosMobile/Client/ApiKeyToken.cs create mode 100644 Adyen/PosTerminalManagement/Client/ApiKeyToken.cs create mode 100644 Adyen/Recurring/Client/ApiKeyToken.cs create mode 100644 Adyen/SessionAuthentication/Client/ApiKeyToken.cs create mode 100644 Adyen/StoredValue/Client/ApiKeyToken.cs create mode 100644 Adyen/Transfers/Client/ApiKeyToken.cs diff --git a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index ae60b95b3..0818d4e6f 100644 --- a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -7,6 +7,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; using System.Text.Json; +using Adyen.Core.Options; namespace Adyen.IntegrationTest.Checkout { @@ -18,18 +19,19 @@ public class PaymentsServiceIntegrationTest public PaymentsServiceIntegrationTest() { - IHost host = Host.CreateDefaultBuilder() - .ConfigureCheckout((context, services, config) => - { - var apiKey = new ApiKeyToken( - context.Configuration["ADYEN_API_KEY"] - ); - config.AddTokens(apiKey); - }) - .Build(); + IHost host = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); - _paymentsApiService = host.Services.GetRequiredService(); - _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + _paymentsApiService = host.Services.GetRequiredService(); + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); } [TestMethod] diff --git a/Adyen.Test/BalanceControl/BalanceControlTest.cs b/Adyen.Test/BalanceControl/BalanceControlTest.cs new file mode 100644 index 000000000..6e0a00ab3 --- /dev/null +++ b/Adyen.Test/BalanceControl/BalanceControlTest.cs @@ -0,0 +1,53 @@ +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Adyen.BalanceControl.Client; +using Adyen.BalanceControl.Extensions; +using Adyen.BalanceControl.Models; +using Adyen.BalanceControl.Services; +using Adyen.Core.Auth; +using Adyen.Core.Options; +using Adyen.Test.Utilities; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.BalanceControl +{ + [TestClass] + public class BalanceControlTest + { + private readonly IBalanceControlService _balanceControlService; + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public BalanceControlTest() + { IHost host = Host.CreateDefaultBuilder() + .ConfigureBalanceControl((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _balanceControlService = host.Services.GetRequiredService(); + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public async Task DeserializeBalanceControlTest() + { + // Arrange + var json = TestUtilities.GetTestFileContent("mocks/balance-control-transfer.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.CreatedAt, new DateTime(2022,01, 24)); + Assert.AreEqual(response.Status, BalanceTransferResponse.StatusEnum.Transferred); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Utilities/TestUtilities.cs b/Adyen.Test/Utilities/TestUtilities.cs new file mode 100644 index 000000000..39b052bdc --- /dev/null +++ b/Adyen.Test/Utilities/TestUtilities.cs @@ -0,0 +1,13 @@ +namespace Adyen.Test.Utilities +{ + public class TestUtilities + { + public static string GetTestFileContent(string relativePath) + { + string rootPath = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "../../../")); + string absolutePath = Path.Combine(rootPath, relativePath); + + return File.ReadAllText(absolutePath); + } + } +} \ No newline at end of file diff --git a/Adyen/BalanceControl/Client/ApiKeyToken.cs b/Adyen/BalanceControl/Client/ApiKeyToken.cs new file mode 100644 index 000000000..d300697c6 --- /dev/null +++ b/Adyen/BalanceControl/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.BalanceControl.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/BalancePlatform/Client/ApiKeyToken.cs b/Adyen/BalancePlatform/Client/ApiKeyToken.cs new file mode 100644 index 000000000..716617ad4 --- /dev/null +++ b/Adyen/BalancePlatform/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.BalancePlatform.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/BalanceWebhooks/Client/ApiKeyToken.cs b/Adyen/BalanceWebhooks/Client/ApiKeyToken.cs new file mode 100644 index 000000000..29d9c8235 --- /dev/null +++ b/Adyen/BalanceWebhooks/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.BalanceWebhooks.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/BinLookup/Client/ApiKeyToken.cs b/Adyen/BinLookup/Client/ApiKeyToken.cs new file mode 100644 index 000000000..c7129035a --- /dev/null +++ b/Adyen/BinLookup/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.BinLookup.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Checkout/Client/ApiKeyToken.cs b/Adyen/Checkout/Client/ApiKeyToken.cs new file mode 100644 index 000000000..755581356 --- /dev/null +++ b/Adyen/Checkout/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Checkout.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Core/Auth/ApiKeyToken.cs b/Adyen/Core/Auth/ApiKeyToken.cs deleted file mode 100644 index 837c78e2f..000000000 --- a/Adyen/Core/Auth/ApiKeyToken.cs +++ /dev/null @@ -1,42 +0,0 @@ -#nullable enable - -using System; - -namespace Adyen.Core.Auth -{ - /// - /// A token constructed from an ApiKey. - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. Most common use-case for Digital (ECOM) & In-Person payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The key of the header for your API Key. - /// - public string Key { get; set; } = "X-API-Key"; - - /// - /// Constructs an ApiKeyToken object. - /// - /// - /// - public ApiKeyToken(string value, string prefix = "") - { - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(Key, _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Core/Auth/BasicToken.cs b/Adyen/Core/Auth/BasicToken.cs deleted file mode 100644 index bba61e967..000000000 --- a/Adyen/Core/Auth/BasicToken.cs +++ /dev/null @@ -1,54 +0,0 @@ -#nullable enable - -using System; -using System.Net.Http.Headers; - -namespace Adyen.Core.Auth -{ - /// - /// A token constructed from a username and password. - /// Adyen recommends using the instead. - /// - public class BasicToken : TokenBase - { - private readonly string _username; - - private readonly string _password; - - /// - /// The key of the header for basic authentication. - /// - public string Key { get; set; } = "Basic"; - - /// - /// Constructs a BasicToken object. - /// Adyen recommends using the instead. - /// - /// - /// - public BasicToken(string username, string password) : base() - { - _username = username; - _password = password; - } - - /// - /// Places the username/password token in the header. - /// - /// - public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Authorization = new AuthenticationHeaderValue(Key, Base64Encode(_username + ":" + _password)); - } - - /// - /// Encodes to a Base64-string. - /// - /// The string to encode. - /// Base64-encoded string. - private static string Base64Encode(string value) - { - return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(value)); - } - } -} \ No newline at end of file diff --git a/Adyen/Core/Auth/TokenBase.cs b/Adyen/Core/Auth/TokenBase.cs index 347c174e4..64522ca9f 100644 --- a/Adyen/Core/Auth/TokenBase.cs +++ b/Adyen/Core/Auth/TokenBase.cs @@ -5,13 +5,12 @@ namespace Adyen.Core.Auth { /// - /// The base class for all tokens. + /// The base class for all auth tokens. /// public abstract class TokenBase { /// - /// The constructor for the parent TokenBase object. - /// Example usages: or . + /// The constructor for the TokenBase object, used by . /// internal TokenBase() { diff --git a/Adyen/Core/Auth/TokenContainer.cs b/Adyen/Core/Auth/TokenContainer.cs deleted file mode 100644 index 0f1215ef8..000000000 --- a/Adyen/Core/Auth/TokenContainer.cs +++ /dev/null @@ -1,32 +0,0 @@ -#nullable enable - -namespace Adyen.Core.Auth -{ - /// - /// A container for a collection of tokens. - /// - /// - public sealed class TokenContainer where TTokenBase : TokenBase - { - /// - /// The collection of tokens - /// - public List Tokens { get; } = new List(); - - /// - /// Instantiates a TokenContainer - /// - public TokenContainer() - { - } - - /// - /// Instantiates a TokenContainer - /// - /// List of tokens. - public TokenContainer(IEnumerable tokens) - { - Tokens = tokens.ToList(); - } - } -} \ No newline at end of file diff --git a/Adyen/Core/Auth/TokenProvider.cs b/Adyen/Core/Auth/TokenProvider.cs index 47f741657..745cca691 100644 --- a/Adyen/Core/Auth/TokenProvider.cs +++ b/Adyen/Core/Auth/TokenProvider.cs @@ -1,43 +1,42 @@ -// -/* - * Adyen Checkout API - * - * Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v71/payments ``` ## Server-side API libraries We provide open-source [server-side API libraries](https://docs.adyen.com/development-resources/libraries/) in several languages: - PHP - Java - Node.js - .NET - Go - Python - Ruby - Apex (beta) See our [integration examples](https://github.com/adyen-examples#%EF%B8%8F-official-integration-examples) for example uses of the libraries. ## Developer resources Checkout API is available through a Postman collection. Click the button below to create a fork, then set the environment variables at **Environments** > **Adyen APIs**. [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5%26entityType%3Dcollection%26workspaceId%3Da8d63f9f-cfc7-4810-90c5-9e0c60030d3e#?env%5BAdyen%20APIs%5D=W3sia2V5IjoiWC1BUEktS2V5IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoic2VjcmV0In0seyJrZXkiOiJZT1VSX01FUkNIQU5UX0FDQ09VTlQiLCJ2YWx1ZSI6IiIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0In0seyJrZXkiOiJZT1VSX0NPTVBBTllfQUNDT1VOVCIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifSx7ImtleSI6IllPVVJfQkFMQU5DRV9QTEFURk9STSIsInZhbHVlIjoiIiwiZW5hYmxlZCI6dHJ1ZSwidHlwZSI6ImRlZmF1bHQifV0=) ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v71/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=71) to find out what changed in this version! - * - * The version of the OpenAPI document: 71 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -#nullable enable - -using System; -using System.Linq; -using System.Collections.Generic; - namespace Adyen.Core.Auth -{ +{ /// - /// A class which will provide tokens. + /// An interface for providing tokens in a generic way. /// - public abstract class TokenProvider where TTokenBase : TokenBase + /// + public interface ITokenProvider where TTokenBase : TokenBase { /// - /// The array of tokens. + /// Retrieves the stored token. /// - protected TTokenBase[] _tokens; - - internal abstract TTokenBase Get(string header = ""); + /// + TTokenBase Get(); + } + + /// + /// A class which will provide tokens from type . + /// + /// + public class TokenProvider : ITokenProvider where TTokenBase : TokenBase + { + private readonly TTokenBase _token; /// - /// Instantiates a TokenProvider. + /// Initializes a token with type . /// - /// - public TokenProvider(IEnumerable tokens) + /// + public TokenProvider(TTokenBase token) { - _tokens = tokens.ToArray(); - - if (_tokens.Length == 0) - throw new ArgumentException("You did not provide any tokens (e.g. API Keys), see also: ApiKeyToken class."); + _token = token; + } + + /// + /// Retrieves the stored token. + /// + /// + public TTokenBase Get() + { + return _token; } } } \ No newline at end of file diff --git a/Adyen/Core/Options/AdyenOptions.cs b/Adyen/Core/Options/AdyenOptions.cs index ea770619f..d07bd02d0 100644 --- a/Adyen/Core/Options/AdyenOptions.cs +++ b/Adyen/Core/Options/AdyenOptions.cs @@ -6,7 +6,7 @@ public class AdyenOptions /// The Adyen Environment. /// public AdyenEnvironment Environment { get; set; } = AdyenEnvironment.Test; - + /// /// Used in the LIVE environment only. /// Default value: empty string. @@ -14,5 +14,13 @@ public class AdyenOptions /// See: https://docs.adyen.com/development-resources/live-endpoints/ /// public string LiveEndpointUrlPrefix { get; set; } = string.Empty; + + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public string AdyenApiKey { get; set; } } } \ No newline at end of file diff --git a/Adyen/Disputes/Client/ApiKeyToken.cs b/Adyen/Disputes/Client/ApiKeyToken.cs new file mode 100644 index 000000000..8835067c6 --- /dev/null +++ b/Adyen/Disputes/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Disputes.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/LegalEntityManagement/Client/ApiKeyToken.cs b/Adyen/LegalEntityManagement/Client/ApiKeyToken.cs new file mode 100644 index 000000000..2fc889d48 --- /dev/null +++ b/Adyen/LegalEntityManagement/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.LegalEntityManagement.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Management/Client/ApiKeyToken.cs b/Adyen/Management/Client/ApiKeyToken.cs new file mode 100644 index 000000000..d70433675 --- /dev/null +++ b/Adyen/Management/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Management.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Payment/Client/ApiKeyToken.cs b/Adyen/Payment/Client/ApiKeyToken.cs new file mode 100644 index 000000000..e5170c605 --- /dev/null +++ b/Adyen/Payment/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Payment.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/PaymentsApp/Client/ApiKeyToken.cs b/Adyen/PaymentsApp/Client/ApiKeyToken.cs new file mode 100644 index 000000000..c96a4a409 --- /dev/null +++ b/Adyen/PaymentsApp/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.PaymentsApp.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Payout/Client/ApiKeyToken.cs b/Adyen/Payout/Client/ApiKeyToken.cs new file mode 100644 index 000000000..354b38522 --- /dev/null +++ b/Adyen/Payout/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Payout.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/PosMobile/Client/ApiKeyToken.cs b/Adyen/PosMobile/Client/ApiKeyToken.cs new file mode 100644 index 000000000..7458ddbe8 --- /dev/null +++ b/Adyen/PosMobile/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.PosMobile.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/PosTerminalManagement/Client/ApiKeyToken.cs b/Adyen/PosTerminalManagement/Client/ApiKeyToken.cs new file mode 100644 index 000000000..c73dee5ec --- /dev/null +++ b/Adyen/PosTerminalManagement/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.PosTerminalManagement.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Recurring/Client/ApiKeyToken.cs b/Adyen/Recurring/Client/ApiKeyToken.cs new file mode 100644 index 000000000..0e4be8e35 --- /dev/null +++ b/Adyen/Recurring/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Recurring.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/SessionAuthentication/Client/ApiKeyToken.cs b/Adyen/SessionAuthentication/Client/ApiKeyToken.cs new file mode 100644 index 000000000..66a98a0df --- /dev/null +++ b/Adyen/SessionAuthentication/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.SessionAuthentication.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/StoredValue/Client/ApiKeyToken.cs b/Adyen/StoredValue/Client/ApiKeyToken.cs new file mode 100644 index 000000000..6c3ae9437 --- /dev/null +++ b/Adyen/StoredValue/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.StoredValue.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/Adyen/Transfers/Client/ApiKeyToken.cs b/Adyen/Transfers/Client/ApiKeyToken.cs new file mode 100644 index 000000000..a4c35ee44 --- /dev/null +++ b/Adyen/Transfers/Client/ApiKeyToken.cs @@ -0,0 +1,48 @@ +// + +#nullable enable + +using System; +using Adyen.Core.Auth; +using Adyen.Core.Client; + +namespace Adyen.Transfers.Client +{ + /// + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. + /// + public class ApiKeyToken : TokenBase + { + private readonly string _apiKeyValue; + + /// + /// The name of the header. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. + /// + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() + { + Header = header; + _apiKeyValue = $"{prefix}{value}"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache b/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache index 4c5486c78..dbea2b22d 100644 --- a/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache +++ b/templates-v7/csharp/libraries/generichost/ApiKeyToken.mustache @@ -5,52 +5,46 @@ {{/nrt}} using System; - -namespace {{packageName}}.{{clientPackage}} +using {{packageName}}.{{corePackageName}}.Auth; +using {{packageName}}.{{corePackageName}}.{{clientPackage}}; + +namespace {{packageName}}.{{apiName}}.{{clientPackage}} { /// - /// A token constructed from an apiKey. + /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. + /// Guide on how to obtain the `ADYEN_API_KEY` + /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. + /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. /// {{>visibility}} class ApiKeyToken : TokenBase { - private string _raw; + private readonly string _apiKeyValue; /// - /// The header that this token will be used with. + /// The name of the header. /// public ClientUtils.ApiKeyHeader Header { get; } /// - /// Constructs an ApiKeyToken object. + /// Constructs the ApiKeyToken object with the API key value provided. + /// This can then be accessed using ITokenProvider``. /// - /// - /// - /// - /// - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "", TimeSpan? timeout = null) : base(timeout) + /// Your Adyen API Key value. + /// The header name, retrieved from + /// Your prefix, default: empty. + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() { Header = header; - _raw = $"{prefix}{value}"; + _apiKeyValue = $"{prefix}{value}"; } /// /// Places the token in the header. /// /// - public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); - } - - /// - /// Places the token in the query. - /// - /// - /// - /// - public virtual void UseInQuery(global::System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) + public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) { - parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(){{nrt!}}; + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); } } } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache index be8977f00..65f3dfe41 100644 --- a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache +++ b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache @@ -100,6 +100,11 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} } } + /// + /// The format to use for DateTime serialization. + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + /// /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. /// If parameter is a list, join the list with ",". @@ -331,87 +336,50 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} throw new JsonException("The specified discriminator was not found."); } -#region Functionality that dynamically determines the Host URL of the HttpClient - + {{#hasApiKeyMethods}} /// - /// Constructs the Host URL based on the selected , used to populate the `HttpClient.BaseAddress`. + /// An enum of headers. /// - /// . - /// String with the Host URL. - /// - public static string GetHostUrl(AdyenOptions adyenOptions) + public enum ApiKeyHeader { - if (adyenOptions.Environment == {{packageName}}Environment.Live) - return ConstructLiveUrl(adyenOptions.LiveEndpointUrlPrefix, BASE_URL); - - // Some Adyen OpenApi Specifications use the live-url, instead of the test-url, this line replaces "-live" with "-test". - // If you need to override this URL, you can do so by replacing the BASE_URL in ClientUtils.cs. - if (adyenOptions.Environment == {{packageName}}Environment.Test) - return BASE_URL.Replace("-live", "-test"); - - throw new ArgumentOutOfRangeException(adyenOptions.Environment.ToString()); + {{#apiKeyMethods}} + /// + /// The {{keyParamName}} header. + /// + {{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}{{^-last}},{{/-last}} + {{/apiKeyMethods}} } - + /// - /// Construct LIVE BaseUrl, add the liveEndpointUrlPrefix it's the Checkout API or the Classic Payment API. - /// This helper function can be removed when all URLs (test & live) are included in the Adyen OpenApi Specifications: https://github.com/Adyen/adyen-openapi. + /// Converts an ApiKeyHeader to a string. /// - /// The Live EndpointUrlPrefix. - /// The Base URL . - /// baseUrl - /// - private static string ConstructLiveUrl(string liveEndpointUrlPrefix, string url) + /// + /// as a string value. + /// + {{>visibility}} static string ApiKeyHeaderToString(ApiKeyHeader value) { - // Change base url for Live environment - if (url.Contains("pal-")) // Payment API prefix + {{#net80OrLater}} + return value switch { - if (liveEndpointUrlPrefix == null) - { - throw new InvalidOperationException("Missing liveEndpointUrlPrefix for endpoint generation"); - } - - url = url.Replace("https://pal-test.adyen.com/pal/servlet/", - "https://" + liveEndpointUrlPrefix + "-pal-live.adyenpayments.com/pal/servlet/"); - } - else if (url.Contains("checkout-")) // Checkout API prefix + {{#apiKeyMethods}} + ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}} => "{{keyParamName}}", + {{/apiKeyMethods}} + _ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)), + }; + {{/net80OrLater}} + {{^net80OrLater}} + switch(value) { - if (liveEndpointUrlPrefix == null) - { - throw new InvalidOperationException("Missing liveEndpointUrlPrefix for endpoint generation"); - } - - if (url.Contains("possdk")) - { - url = url.Replace("https://checkout-test.adyen.com/", - "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/"); - } - else - { - url = url.Replace("https://checkout-test.adyen.com/", - "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/"); - } + {{#apiKeyMethods}} + case ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}: + return "{{keyParamName}}"; + {{/apiKeyMethods}} + default: + throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); } - - // If no prefix is required, we replace "test" -> "live" - url = url.Replace("-test", "-live"); - return url; + {{/net80OrLater}} } - -#endregion - - /// - /// The base path of the API, it includes the http(s)-scheme, the host domain name, and the base path. - /// - public static string BASE_URL = "{{{basePath}}}"; - /// - /// The relative path of the API after the `.com`. - /// - public static string RELATIVE_URL = "{{contextPath}}"; - - /// - /// The format to use for DateTime serialization. - /// - public const string ISO8601_DATETIME_FORMAT = "o"; + {{/hasApiKeyMethods}} } } diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 27d7a8f42..6d0e9cfeb 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -35,7 +35,18 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} private readonly AdyenOptions _adyenOptions = new AdyenOptions(); internal bool HttpClientsAdded { get; private set; } + + /// + /// The base path of the API, it includes the http(s)-scheme, the host domain name, and the base path. + /// This value can change when `ConfigureAdyenOptions` is called in ). The new value will be based on the .. + /// + public static string BASE_URL = "{{{basePath}}}"; + /// + /// The relative path of the API after the `.com`. + /// + public static string RELATIVE_URL = "{{contextPath}}"; + /// /// Instantiates the HostConfiguration (custom JsonConverters, Events, HttpClient) with the necessary dependencies to communicate with the API. /// @@ -104,7 +115,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} clientAction = null, Action{{nrt?}} builderAction = null) { if (clientAction == null) - clientAction = httpClient => httpClient.BaseAddress = new Uri(ClientUtils.GetHostUrl(_adyenOptions)); + clientAction = httpClient => httpClient.BaseAddress = new Uri(BASE_URL); List builders = new List(); @@ -127,6 +138,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration ConfigureJsonOptions(Action optionsAction) { optionsAction(_jsonOptions); + return this; } @@ -138,45 +150,71 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration ConfigureAdyenOptions(Action optionsAction) { optionsAction(_adyenOptions); + return this; } - - /// - /// Adds tokens to the . - /// - /// - /// - /// - public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase - { - TokenContainer container = new TokenContainer(new TTokenBase[]{ token }); - _services.AddSingleton(container); - return this; - } - + /// - /// Adds the to the . + /// Constructs the Host URL based on the selected , used to populate the `HttpClient.BaseAddress`. /// - /// - /// - public HostConfiguration AddApiKey(ApiKeyToken apiKey) + /// String with the Host URL. + /// + private string ConstructHostUrl() { - return AddTokens(apiKey); + if (_adyenOptions.Environment == {{packageName}}Environment.Live) + return ConstructLiveUrl(_adyenOptions.LiveEndpointUrlPrefix, BASE_URL); + + // Some Adyen OpenApi Specifications use the live-url, instead of the test-url, this line replaces "-live" with "-test". + // If you need to override this URL, you can do so by replacing the BASE_URL in ClientUtils.cs. + if (_adyenOptions.Environment == {{packageName}}Environment.Test) + return BASE_URL.Replace("-live", "-test"); + + throw new ArgumentOutOfRangeException(_adyenOptions.Environment.ToString()); } /// - /// Adds the to the , used to retrieve the . + /// Construct LIVE BaseUrl, add the liveEndpointUrlPrefix it's the Checkout API or the Classic Payment API. + /// This helper function can be removed when all URLs (test & live) are included in the Adyen OpenApi Specifications: https://github.com/Adyen/adyen-openapi. /// - /// - /// - /// - public HostConfiguration UseProvider() - where TTokenProvider : TokenProvider - where TTokenBase : TokenBase + /// The Live EndpointUrlPrefix. + /// The Base URL . + /// baseUrl + /// + private string ConstructLiveUrl(string liveEndpointUrlPrefix, string url) { - _services.AddSingleton(); - _services.AddSingleton>(services => services.GetRequiredService()); - return this; + // Change base url for Live environment + if (url.Contains("pal-")) // Payment API prefix + { + if (liveEndpointUrlPrefix == null) + { + throw new InvalidOperationException("LiveEndpointUrlPrefix is null - please configure your AdyenOptions.LiveEndpointUrlPrefix"); + } + + url = url.Replace("https://pal-test.adyen.com/pal/servlet/", + "https://" + liveEndpointUrlPrefix + "-pal-live.adyenpayments.com/pal/servlet/"); + } + else if (url.Contains("checkout-")) // Checkout API prefix + { + if (liveEndpointUrlPrefix == null) + { + throw new InvalidOperationException("LiveEndpointUrlPrefix is null - please configure your AdyenOptions.LiveEndpointUrlPrefix"); + } + + if (url.Contains("possdk")) + { + url = url.Replace("https://checkout-test.adyen.com/", + "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/"); + } + else + { + url = url.Replace("https://checkout-test.adyen.com/", + "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/"); + } + } + + // If no prefix is required, we replace "test" -> "live" + url = url.Replace("-test", "-live"); + return url; } } } diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index ce4ddff92..790c48655 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -7,7 +7,6 @@ using System; using System.Linq; using Microsoft.Extensions.DependencyInjection; using {{packageName}}.{{apiName}}.{{clientPackage}}; -using {{packageName}}.{{corePackageName}}.Auth; namespace {{packageName}}.{{apiName}}.Extensions { @@ -45,22 +44,6 @@ namespace {{packageName}}.{{apiName}}.Extensions { if (!host.HttpClientsAdded) host.Add{{apiName}}HttpClients(); - - // Ensure that a token provider was provided for this token type. - var containerServices = services.Where(s => - s.ServiceType.IsGenericType && - s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))) - .ToArray(); - - foreach(var containerService in containerServices) - { - Type tokenType = containerService.ServiceType.GenericTypeArguments[0]; - var serviceDescriptor = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); - if (serviceDescriptor == null) - { - services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType)); - } - } } } } diff --git a/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache b/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache index b5c30c6fe..7e5cf9cb8 100644 --- a/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonSerializerOptionsProvider.mustache @@ -9,17 +9,17 @@ using System.Text.Json; namespace {{packageName}}.{{apiName}}.{{clientPackage}} { /// - /// Provides the JsonSerializerOptions + /// Provides the JsonSerializerOptions. /// {{>visibility}} class JsonSerializerOptionsProvider { /// - /// the JsonSerializerOptions + /// The JsonSerializerOptions. /// public JsonSerializerOptions Options { get; } /// - /// Instantiates a JsonSerializerOptionsProvider + /// Instantiates a JsonSerializerOptionsProvider to access the JsonSerializerOptions. /// public JsonSerializerOptionsProvider(JsonSerializerOptions options) { diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 7463eb626..53c41c84d 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -166,22 +166,22 @@ namespace {{packageName}}.{{apiPackage}} /// /// A token provider of type . /// - public TokenProvider ApiKeyProvider { get; }{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + public ITokenProvider ApiKeyProvider { get; }{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} /// /// A token provider of type . /// - public TokenProvider BearerTokenProvider { get; }{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}} + public ITokenProvider BearerTokenProvider { get; }{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}} /// /// A token provider of type . /// - public TokenProvider HttpSignatureTokenProvider { get; }{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + public ITokenProvider HttpSignatureTokenProvider { get; }{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} /// /// A token provider of type . /// - public TokenProvider OauthTokenProvider { get; }{{/hasOAuthMethods}} + public ITokenProvider OauthTokenProvider { get; }{{/hasOAuthMethods}} {{#net80OrLater}} {{#lambda.unique}} @@ -201,10 +201,10 @@ namespace {{packageName}}.{{apiPackage}} /// /// public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, - TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, - TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}}, - TokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, - TokenProvider oauthTokenProvider{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}}, + ITokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, + ITokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}}, + ITokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, + ITokenProvider oauthTokenProvider{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}}, {{packageName}}.{{clientPackage}}.CookieContainer cookieContainer{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}}) { _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; @@ -476,8 +476,8 @@ namespace {{packageName}}.{{apiPackage}} {{! Only use API Keys that are appended to the HTTP-headers }} {{^isKeyInCookie}} {{#isKeyInHeader}} - ApiKeyToken apiKeyToken{{-index}} = (ApiKeyToken) ApiKeyProvider.Get("{{keyParamName}}"); - apiKeyToken{{-index}}.UseInHeader(httpRequestMessage); + ApiKeyToken apiKeyToken{{-index}} = (ApiKeyToken) ApiKeyProvider.Get(); + apiKeyToken{{-index}}.AddTokenToHttpRequestMessageHeader(httpRequestMessage); {{/isKeyInHeader}} {{/isKeyInCookie}} {{/isApiKey}} From 8cb67327b7d54326f308b6272bba249035a57fdb Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 24 Oct 2025 23:29:19 +0200 Subject: [PATCH 057/126] Added 1-line configuration support for configuration an environment, adyen-api-key and liveprefix Added simplified TokenProvider support --- Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs | 2 +- .../libraries/generichost/IServiceCollectionExtensions.mustache | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs b/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs index 2aa042597..c982a481e 100644 --- a/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs +++ b/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs @@ -19,7 +19,7 @@ public AcsWebhooksTest() IHost host = Host.CreateDefaultBuilder() .ConfigureAcsWebhooks((context, services, config) => { - services.AddSingleton(); + services.AddSingleton(); }) .Build(); diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index 790c48655..7ae0219c2 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -44,6 +44,8 @@ namespace {{packageName}}.{{apiName}}.Extensions { if (!host.HttpClientsAdded) host.Add{{apiName}}HttpClients(); + + services.AddSingleton(typeof(ITokenProvider<>), typeof(TokenProvider<>)); } } } From 6e2e6c9d30339420de56a87b62818426afd7cb84 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 24 Oct 2025 23:33:00 +0200 Subject: [PATCH 058/126] Remove ApiKeyToken as these are generated --- Adyen/BalanceControl/Client/ApiKeyToken.cs | 48 ------------------- Adyen/BalancePlatform/Client/ApiKeyToken.cs | 48 ------------------- Adyen/BalanceWebhooks/Client/ApiKeyToken.cs | 48 ------------------- Adyen/BinLookup/Client/ApiKeyToken.cs | 48 ------------------- Adyen/Checkout/Client/ApiKeyToken.cs | 48 ------------------- Adyen/Disputes/Client/ApiKeyToken.cs | 48 ------------------- .../Client/ApiKeyToken.cs | 48 ------------------- Adyen/Management/Client/ApiKeyToken.cs | 48 ------------------- Adyen/Payment/Client/ApiKeyToken.cs | 48 ------------------- Adyen/PaymentsApp/Client/ApiKeyToken.cs | 48 ------------------- Adyen/Payout/Client/ApiKeyToken.cs | 48 ------------------- Adyen/PosMobile/Client/ApiKeyToken.cs | 48 ------------------- .../Client/ApiKeyToken.cs | 48 ------------------- Adyen/Recurring/Client/ApiKeyToken.cs | 48 ------------------- .../Client/ApiKeyToken.cs | 48 ------------------- Adyen/StoredValue/Client/ApiKeyToken.cs | 48 ------------------- Adyen/Transfers/Client/ApiKeyToken.cs | 48 ------------------- 17 files changed, 816 deletions(-) delete mode 100644 Adyen/BalanceControl/Client/ApiKeyToken.cs delete mode 100644 Adyen/BalancePlatform/Client/ApiKeyToken.cs delete mode 100644 Adyen/BalanceWebhooks/Client/ApiKeyToken.cs delete mode 100644 Adyen/BinLookup/Client/ApiKeyToken.cs delete mode 100644 Adyen/Checkout/Client/ApiKeyToken.cs delete mode 100644 Adyen/Disputes/Client/ApiKeyToken.cs delete mode 100644 Adyen/LegalEntityManagement/Client/ApiKeyToken.cs delete mode 100644 Adyen/Management/Client/ApiKeyToken.cs delete mode 100644 Adyen/Payment/Client/ApiKeyToken.cs delete mode 100644 Adyen/PaymentsApp/Client/ApiKeyToken.cs delete mode 100644 Adyen/Payout/Client/ApiKeyToken.cs delete mode 100644 Adyen/PosMobile/Client/ApiKeyToken.cs delete mode 100644 Adyen/PosTerminalManagement/Client/ApiKeyToken.cs delete mode 100644 Adyen/Recurring/Client/ApiKeyToken.cs delete mode 100644 Adyen/SessionAuthentication/Client/ApiKeyToken.cs delete mode 100644 Adyen/StoredValue/Client/ApiKeyToken.cs delete mode 100644 Adyen/Transfers/Client/ApiKeyToken.cs diff --git a/Adyen/BalanceControl/Client/ApiKeyToken.cs b/Adyen/BalanceControl/Client/ApiKeyToken.cs deleted file mode 100644 index d300697c6..000000000 --- a/Adyen/BalanceControl/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.BalanceControl.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/BalancePlatform/Client/ApiKeyToken.cs b/Adyen/BalancePlatform/Client/ApiKeyToken.cs deleted file mode 100644 index 716617ad4..000000000 --- a/Adyen/BalancePlatform/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.BalancePlatform.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/BalanceWebhooks/Client/ApiKeyToken.cs b/Adyen/BalanceWebhooks/Client/ApiKeyToken.cs deleted file mode 100644 index 29d9c8235..000000000 --- a/Adyen/BalanceWebhooks/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.BalanceWebhooks.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/BinLookup/Client/ApiKeyToken.cs b/Adyen/BinLookup/Client/ApiKeyToken.cs deleted file mode 100644 index c7129035a..000000000 --- a/Adyen/BinLookup/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.BinLookup.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Checkout/Client/ApiKeyToken.cs b/Adyen/Checkout/Client/ApiKeyToken.cs deleted file mode 100644 index 755581356..000000000 --- a/Adyen/Checkout/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Checkout.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Disputes/Client/ApiKeyToken.cs b/Adyen/Disputes/Client/ApiKeyToken.cs deleted file mode 100644 index 8835067c6..000000000 --- a/Adyen/Disputes/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Disputes.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/LegalEntityManagement/Client/ApiKeyToken.cs b/Adyen/LegalEntityManagement/Client/ApiKeyToken.cs deleted file mode 100644 index 2fc889d48..000000000 --- a/Adyen/LegalEntityManagement/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.LegalEntityManagement.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Management/Client/ApiKeyToken.cs b/Adyen/Management/Client/ApiKeyToken.cs deleted file mode 100644 index d70433675..000000000 --- a/Adyen/Management/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Management.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Payment/Client/ApiKeyToken.cs b/Adyen/Payment/Client/ApiKeyToken.cs deleted file mode 100644 index e5170c605..000000000 --- a/Adyen/Payment/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Payment.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/PaymentsApp/Client/ApiKeyToken.cs b/Adyen/PaymentsApp/Client/ApiKeyToken.cs deleted file mode 100644 index c96a4a409..000000000 --- a/Adyen/PaymentsApp/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.PaymentsApp.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Payout/Client/ApiKeyToken.cs b/Adyen/Payout/Client/ApiKeyToken.cs deleted file mode 100644 index 354b38522..000000000 --- a/Adyen/Payout/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Payout.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/PosMobile/Client/ApiKeyToken.cs b/Adyen/PosMobile/Client/ApiKeyToken.cs deleted file mode 100644 index 7458ddbe8..000000000 --- a/Adyen/PosMobile/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.PosMobile.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/PosTerminalManagement/Client/ApiKeyToken.cs b/Adyen/PosTerminalManagement/Client/ApiKeyToken.cs deleted file mode 100644 index c73dee5ec..000000000 --- a/Adyen/PosTerminalManagement/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.PosTerminalManagement.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Recurring/Client/ApiKeyToken.cs b/Adyen/Recurring/Client/ApiKeyToken.cs deleted file mode 100644 index 0e4be8e35..000000000 --- a/Adyen/Recurring/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Recurring.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/SessionAuthentication/Client/ApiKeyToken.cs b/Adyen/SessionAuthentication/Client/ApiKeyToken.cs deleted file mode 100644 index 66a98a0df..000000000 --- a/Adyen/SessionAuthentication/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.SessionAuthentication.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/StoredValue/Client/ApiKeyToken.cs b/Adyen/StoredValue/Client/ApiKeyToken.cs deleted file mode 100644 index 6c3ae9437..000000000 --- a/Adyen/StoredValue/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.StoredValue.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file diff --git a/Adyen/Transfers/Client/ApiKeyToken.cs b/Adyen/Transfers/Client/ApiKeyToken.cs deleted file mode 100644 index a4c35ee44..000000000 --- a/Adyen/Transfers/Client/ApiKeyToken.cs +++ /dev/null @@ -1,48 +0,0 @@ -// - -#nullable enable - -using System; -using Adyen.Core.Auth; -using Adyen.Core.Client; - -namespace Adyen.Transfers.Client -{ - /// - /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. - /// Guide on how to obtain the `ADYEN_API_KEY` - /// 1. For Digital/ECOM & In-Person Payments, visit: https://docs.adyen.com/development-resources/api-credentials/#generate-api-key to get your API Key. - /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. - /// - public class ApiKeyToken : TokenBase - { - private readonly string _apiKeyValue; - - /// - /// The name of the header. - /// - public ClientUtils.ApiKeyHeader Header { get; } - - /// - /// Constructs the ApiKeyToken object with the API key value provided. - /// This can then be accessed using ITokenProvider``. - /// - /// Your Adyen API Key value. - /// The header name, retrieved from - /// Your prefix, default: empty. - public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "") : base() - { - Header = header; - _apiKeyValue = $"{prefix}{value}"; - } - - /// - /// Places the token in the header. - /// - /// - public virtual void AddTokenToHttpRequestMessageHeader(global::System.Net.Http.HttpRequestMessage request) - { - request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _apiKeyValue); - } - } -} \ No newline at end of file From 4372809455d396d31557a07407561765659fe0dd Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 24 Oct 2025 23:36:14 +0200 Subject: [PATCH 059/126] Update mustache template with the Adyen.Core.Auth package namespace --- .../libraries/generichost/IServiceCollectionExtensions.mustache | 1 + 1 file changed, 1 insertion(+) diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index 7ae0219c2..a6fd1b884 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -6,6 +6,7 @@ using System; using System.Linq; using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{corepackageName}}.Auth; using {{packageName}}.{{apiName}}.{{clientPackage}}; namespace {{packageName}}.{{apiName}}.Extensions From 225c9d360f8e2a977f3d92fbdc4ee802d6f5a745 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 24 Oct 2025 23:36:42 +0200 Subject: [PATCH 060/126] Use Core package --- .../libraries/generichost/IServiceCollectionExtensions.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index a6fd1b884..d5c9b1e24 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -6,7 +6,7 @@ using System; using System.Linq; using Microsoft.Extensions.DependencyInjection; -using {{packageName}}.{{corepackageName}}.Auth; +using {{packageName}}.{{corePackageName}}.Auth; using {{packageName}}.{{apiName}}.{{clientPackage}}; namespace {{packageName}}.{{apiName}}.Extensions From 3d7fe8081e213e87a97661614d326ef6bc8ce060 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 24 Oct 2025 23:43:57 +0200 Subject: [PATCH 061/126] Fix DI for TokenProvider --- .../libraries/generichost/HostConfiguration.mustache | 8 +++++++- .../generichost/IServiceCollectionExtensions.mustache | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 6d0e9cfeb..a53bfe4c9 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -150,7 +150,13 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration ConfigureAdyenOptions(Action optionsAction) { optionsAction(_adyenOptions); - + {{#hasApiKeyMethods}} + _services.AddSingleton>( + new TokenProvider( + new ApiKeyToken(_adyenOptions.AdyenApiKey, ClientUtils.ApiKeyHeader.X_API_Key, "") + ) + ); + {{/hasApiKeyMethods}} return this; } diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index d5c9b1e24..79d78a94c 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -45,8 +45,6 @@ namespace {{packageName}}.{{apiName}}.Extensions { if (!host.HttpClientsAdded) host.Add{{apiName}}HttpClients(); - - services.AddSingleton(typeof(ITokenProvider<>), typeof(TokenProvider<>)); } } } From c32ae570936a447acd46ee53552270cf8c484815 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 25 Oct 2025 01:01:53 +0200 Subject: [PATCH 062/126] Move all core tests from other branch --- Adyen.Test/Core/Auth/TokenProviderTest.cs | 49 +++++ Adyen.Test/Core/Client/ApiResponseTest.cs | 173 ++++++++++++++++++ .../Converters/DateOnlyJsonConverterTest.cs | 105 +++++++++++ .../DateOnlyNullableJsonConverterTest.cs | 106 +++++++++++ .../Converters/DateTimeJsonConverterTest.cs | 76 ++++++++ .../DateTimeNullableJsonConverterTest.cs | 111 +++++++++++ Adyen/Core/Auth/TokenBase.cs | 3 +- .../Core/Converters/DateOnlyJsonConverter.cs | 2 +- .../DateOnlyNullableJsonConverter.cs | 2 +- 9 files changed, 624 insertions(+), 3 deletions(-) create mode 100644 Adyen.Test/Core/Auth/TokenProviderTest.cs create mode 100644 Adyen.Test/Core/Client/ApiResponseTest.cs create mode 100644 Adyen.Test/Core/Converters/DateOnlyJsonConverterTest.cs create mode 100644 Adyen.Test/Core/Converters/DateOnlyNullableJsonConverterTest.cs create mode 100644 Adyen.Test/Core/Converters/DateTimeJsonConverterTest.cs create mode 100644 Adyen.Test/Core/Converters/DateTimeNullableJsonConverterTest.cs diff --git a/Adyen.Test/Core/Auth/TokenProviderTest.cs b/Adyen.Test/Core/Auth/TokenProviderTest.cs new file mode 100644 index 000000000..8c03f7eee --- /dev/null +++ b/Adyen.Test/Core/Auth/TokenProviderTest.cs @@ -0,0 +1,49 @@ +using Adyen.Core.Auth; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.Core.Auth +{ + [TestClass] + public class TokenProviderTest + { + internal sealed class TestToken : TokenBase + { + public string Value { get; } + + internal TestToken(string value) + { + Value = value; + } + } + + [TestMethod] + public void Given_TokenProviderWithToken_When_GetCalled_Then_SameInstanceAndValueAreReturned() + { + // Arrange + var token = new TestToken("apikey"); + var provider = new TokenProvider(token); + + // Act + var result = provider.Get(); + + // Assert + Assert.AreSame(token, result); + Assert.AreEqual("apikey", result.Value); + } + + [TestMethod] + public void Given_TokenProvider_When_GetCalledMultipleTimes_Then_SameInstanceReturnedEachTime() + { + // Arrange + var token = new TestToken("apikey"); + var provider = new TokenProvider(token); + + // Act + var first = provider.Get(); + var second = provider.Get(); + + // Assert + Assert.AreSame(first, second); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Core/Client/ApiResponseTest.cs b/Adyen.Test/Core/Client/ApiResponseTest.cs new file mode 100644 index 000000000..209dd429a --- /dev/null +++ b/Adyen.Test/Core/Client/ApiResponseTest.cs @@ -0,0 +1,173 @@ +using System; +using System.IO; +using System.Net; +using System.Net.Http; +using System.Text.Json; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Adyen.Core.Client; + +namespace Adyen.Core.Tests +{ + [TestClass] + public class ApiResponseTests + { + private HttpRequestMessage CreateRequest(string? uri = "https://adyen.com") + => new HttpRequestMessage(HttpMethod.Get, uri); + + private HttpResponseMessage CreateResponse(HttpStatusCode statusCode, string reasonPhrase = "") + => new HttpResponseMessage(statusCode) + { + ReasonPhrase = reasonPhrase + }; + + [TestMethod] + [DataRow(HttpStatusCode.OK, true)] + [DataRow(HttpStatusCode.Created, true)] + [DataRow(HttpStatusCode.Accepted, true)] + [DataRow(HttpStatusCode.BadRequest, false)] + [DataRow(HttpStatusCode.Unauthorized, false)] + [DataRow(HttpStatusCode.Forbidden, false)] + [DataRow(HttpStatusCode.NotFound, false)] + [DataRow(HttpStatusCode.TooManyRequests, false)] + [DataRow(HttpStatusCode.UnprocessableEntity, false)] + [DataRow(HttpStatusCode.InternalServerError, false)] + public void Given_ApiResponse_When_SuccessStatusCode_Then_Result_ShouldMatchHttpResponseMessage(HttpStatusCode code, bool expected) + { + // Arrange + // Act + var response = new ApiResponse(CreateRequest(), CreateResponse(code), "", "/", DateTime.UtcNow, new JsonSerializerOptions()); + // Assert + Assert.AreEqual(expected, response.IsSuccessStatusCode); + } + + [TestMethod] + public void Given_ApiResponse_When_Properties_Are_Set_Then_Object_Should_Return_Correct_Values() + { + // Arrange + var request = CreateRequest("https://adyen.com/"); + + // Act + var responseMessage = CreateResponse(HttpStatusCode.Accepted, "Accepted"); + var apiResponse = new ApiResponse(request, responseMessage, "{\"key\":\"value\"}", "/path", DateTime.UtcNow, new JsonSerializerOptions()); + + // Assert + Assert.AreEqual(responseMessage.StatusCode, apiResponse.StatusCode); + Assert.AreEqual(responseMessage.ReasonPhrase, apiResponse.ReasonPhrase); + Assert.AreEqual(request.RequestUri, apiResponse.RequestUri); + Assert.AreEqual("/path", apiResponse.Path); + Assert.IsNotNull(apiResponse.Headers); + Assert.AreEqual("{\"key\":\"value\"}", apiResponse.RawContent); + Assert.IsNull(apiResponse.ContentStream); + } + + [TestMethod] + public void Given_ApiResponse_When_ContentStream_Is_Set_Then_Return_ContentStream_And_Empty_RawContent() + { + // Arrange + var request = CreateRequest(); + var responseMessage = CreateResponse(HttpStatusCode.OK); + + // Act + var stream = new MemoryStream(new byte[] { 1, 2, 3 }); + var apiResponse = new ApiResponse(request, responseMessage, stream, "/stream", DateTime.UtcNow, new JsonSerializerOptions()); + + // Assert + Assert.AreEqual(stream, apiResponse.ContentStream); + Assert.AreEqual(string.Empty, apiResponse.RawContent); + } + + private class ExampleApiResponse : ApiResponse, + IOk, ICreated, IAccepted, + IBadRequest, IUnauthorized, IForbidden, ITooManyRequests, INotFound, IUnprocessableContent, IInternalServerError + { + public ExampleApiResponse(HttpRequestMessage message, HttpResponseMessage response, string raw, string path, DateTime requested, JsonSerializerOptions opts) + : base(message, response, raw, path, requested, opts) { } + + private T DeserializeRaw() => JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions)!; + + public T Ok() => DeserializeRaw(); + public bool TryDeserializeOkResponse(out T? result) { result = string.IsNullOrEmpty(RawContent) ? default : DeserializeRaw(); return result != null; } + + public T Created() => DeserializeRaw(); + public bool TryDeserializeCreatedResponse(out T? result) { result = string.IsNullOrEmpty(RawContent) ? default : DeserializeRaw(); return result != null; } + + public T Accepted() => DeserializeRaw(); + public bool TryDeserializeAcceptedResponse(out T? result) { result = string.IsNullOrEmpty(RawContent) ? default : DeserializeRaw(); return result != null; } + + public T BadRequest() => DeserializeRaw(); + public bool TryDeserializeBadRequestResponse(out T? result) { result = string.IsNullOrEmpty(RawContent) ? default : DeserializeRaw(); return result != null; } + + public T Unauthorized() => DeserializeRaw(); + public bool TryDeserializeUnauthorizedResponse(out T? result) { result = string.IsNullOrEmpty(RawContent) ? default : DeserializeRaw(); return result != null; } + + public T Forbidden() => DeserializeRaw(); + public bool TryDeserializeForbiddenResponse(out T? result) { result = string.IsNullOrEmpty(RawContent) ? default : DeserializeRaw(); return result != null; } + + public T TooManyRequests() => DeserializeRaw(); + public bool TryDeserializeTooManyRequestsResponse(out T? result) { result = string.IsNullOrEmpty(RawContent) ? default : DeserializeRaw(); return result != null; } + + public T NotFound() => DeserializeRaw(); + public bool TryDeserializeNotFoundResponse(out T? result) { result = string.IsNullOrEmpty(RawContent) ? default : DeserializeRaw(); return result != null; } + + public T UnprocessableContent() => DeserializeRaw(); + public bool TryDeserializeUnprocessableContentResponse(out T? result) { result = string.IsNullOrEmpty(RawContent) ? default : DeserializeRaw(); return result != null; } + + public T InternalServerError() => DeserializeRaw(); + public bool TryDeserializeInternalServerErrorResponse(out T? result) { result = string.IsNullOrEmpty(RawContent) ? default : DeserializeRaw(); return result != null; } + } + + private record TestModel(string Foo); + + [TestMethod] + public void Given_ApiResponse_When_TypedResponses_Then_Deserialize_Correctly() + { + // Arrange + var model = new TestModel("adyen"); + + // Act + string json = JsonSerializer.Serialize(model, new JsonSerializerOptions()); + var response = new ExampleApiResponse(CreateRequest(), CreateResponse(HttpStatusCode.OK), json, "/path", DateTime.UtcNow, new JsonSerializerOptions()); + + // Assert + Assert.AreEqual(model, response.Ok()); + Assert.IsTrue(response.TryDeserializeOkResponse(out var okResult)); + Assert.AreEqual(model, okResult); + + Assert.AreEqual(model, response.Created()); + Assert.IsTrue(response.TryDeserializeCreatedResponse(out var createdResult)); + Assert.AreEqual(model, createdResult); + + Assert.AreEqual(model, response.Accepted()); + Assert.IsTrue(response.TryDeserializeAcceptedResponse(out var acceptedResult)); + Assert.AreEqual(model, acceptedResult); + + Assert.AreEqual(model, response.BadRequest()); + Assert.IsTrue(response.TryDeserializeBadRequestResponse(out var badResult)); + Assert.AreEqual(model, badResult); + + Assert.AreEqual(model, response.Unauthorized()); + Assert.IsTrue(response.TryDeserializeUnauthorizedResponse(out var unAuthResult)); + Assert.AreEqual(model, unAuthResult); + + Assert.AreEqual(model, response.Forbidden()); + Assert.IsTrue(response.TryDeserializeForbiddenResponse(out var forbiddenResult)); + Assert.AreEqual(model, forbiddenResult); + + Assert.AreEqual(model, response.TooManyRequests()); + Assert.IsTrue(response.TryDeserializeTooManyRequestsResponse(out var tooManyResult)); + Assert.AreEqual(model, tooManyResult); + + Assert.AreEqual(model, response.NotFound()); + Assert.IsTrue(response.TryDeserializeNotFoundResponse(out var notFoundResult)); + Assert.AreEqual(model, notFoundResult); + + Assert.AreEqual(model, response.UnprocessableContent()); + Assert.IsTrue(response.TryDeserializeUnprocessableContentResponse(out var unprocessableResult)); + Assert.AreEqual(model, unprocessableResult); + + Assert.AreEqual(model, response.InternalServerError()); + Assert.IsTrue(response.TryDeserializeInternalServerErrorResponse(out var internalResult)); + Assert.AreEqual(model, internalResult); + } + } +} diff --git a/Adyen.Test/Core/Converters/DateOnlyJsonConverterTest.cs b/Adyen.Test/Core/Converters/DateOnlyJsonConverterTest.cs new file mode 100644 index 000000000..1c7013897 --- /dev/null +++ b/Adyen.Test/Core/Converters/DateOnlyJsonConverterTest.cs @@ -0,0 +1,105 @@ +using System.Text.Json; +using Adyen.Core.Converters; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.Core.Converters +{ + [TestClass] + public class DateOnlyJsonConverterTests + { + private readonly DateOnlyJsonConverter _converter = new DateOnlyJsonConverter(); + + [TestMethod] + public void Given_DateWithDashes_yyyy_MM_dd_When_Read_Then_ReturnsCorrectDate() + { + // Arrange + string json = "\"2025-12-25\""; + var reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + + // Act + reader.Read(); + var result = _converter.Read(ref reader, typeof(DateOnly), new JsonSerializerOptions()); + + // Assert + Assert.AreEqual(new DateOnly(2025, 12, 25), result); + } + + [TestMethod] + public void Given_Date_yyyyMMdd_When_Read_Then_ReturnsCorrectDate() + { + // Arrange + string json = "\"20251225\""; + var reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + + // Act + reader.Read(); + var result = _converter.Read(ref reader, typeof(DateOnly), new JsonSerializerOptions()); + + // Assert + Assert.AreEqual(new DateOnly(2025, 12, 25), result); + } + + [TestMethod] + public void Given_WrongFormatDateOnlyString_When_Read_Then_ThrowsNotSupportedException() + { + // Arrange + string json = "\"25-12-2025\""; // Incorrect format dd-MM-yyyy + + // Act + // Assert + Assert.ThrowsException(() => + { + var reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + reader.Read(); + _converter.Read(ref reader, typeof(DateOnly), new JsonSerializerOptions()); + }); + } + [TestMethod] + public void Given_InvalidDateOnlyString_When_Read_Then_ThrowsJsonException() + { + // Arrange + string json = "invalid-date"; + + // Act + // Assert + Assert.Throws(() => + { + var reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + reader.Read(); + _converter.Read(ref reader, typeof(DateOnly), new JsonSerializerOptions()); + }); + } + + [TestMethod] + public void Given_NullToken_When_Read_Then_ThrowsNotSupportedException() + { + // Arrange + string json = "null"; + + // Act + // Assert + Assert.ThrowsException(() => { + Utf8JsonReader reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + reader.Read(); + _converter.Read(ref reader, typeof(DateOnly), new JsonSerializerOptions()); + }); + } + + [TestMethod] + public void Given_DateOnlyValue_When_Write_Then_WritesCorrectDateOnlyValue() + { + // Arrange + var date = new DateOnly(2025, 12, 25); + using var stream = new MemoryStream(); + using var writer = new Utf8JsonWriter(stream); + + // Act + _converter.Write(writer, date, new JsonSerializerOptions()); + writer.Flush(); + string json = System.Text.Encoding.UTF8.GetString(stream.ToArray()); + + // Assert + Assert.AreEqual("\"2025-12-25\"", json); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Core/Converters/DateOnlyNullableJsonConverterTest.cs b/Adyen.Test/Core/Converters/DateOnlyNullableJsonConverterTest.cs new file mode 100644 index 000000000..8f75f6470 --- /dev/null +++ b/Adyen.Test/Core/Converters/DateOnlyNullableJsonConverterTest.cs @@ -0,0 +1,106 @@ +using System.Text.Json; +using Adyen.Core.Converters; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.Core.Converters +{ + [TestClass] + public class DateOnlyNullableJsonConverterTest + { + private readonly DateOnlyNullableJsonConverter _converter = new DateOnlyNullableJsonConverter(); + + [TestMethod] + public void Given_DateWithDashes_yyyy_MM_dd_When_Read_Then_ReturnsCorrectDate() + { + // Arrange + string json = "\"2025-12-25\""; + var reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + + // Act + reader.Read(); + var result = _converter.Read(ref reader, typeof(DateOnly), new JsonSerializerOptions()); + + // Assert + Assert.AreEqual(new DateOnly(2025, 12, 25), result); + } + + [TestMethod] + public void Given_Date_yyyyMMdd_When_Read_Then_ReturnsCorrectDate() + { + // Arrange + string json = "\"20251225\""; + var reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + + // Act + reader.Read(); + var result = _converter.Read(ref reader, typeof(DateOnly), new JsonSerializerOptions()); + + // Assert + Assert.AreEqual(new DateOnly(2025, 12, 25), result); + } + + [TestMethod] + public void Given_WrongFormatDateOnlyString_When_Read_Then_ThrowsNotSupportedException() + { + // Arrange + string json = "\"25-12-2025\""; // Incorrect format dd-MM-yyyy + + // Act + // Assert + Assert.ThrowsException(() => + { + var reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + reader.Read(); + _converter.Read(ref reader, typeof(DateOnly), new JsonSerializerOptions()); + }); + } + + [TestMethod] + public void Given_InvalidDateOnlyString_When_Read_Then_ThrowsJsonException() + { + // Arrange + string json = "invalid-date"; + + // Act + // Assert + Assert.Throws(() => + { + var reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + reader.Read(); + _converter.Read(ref reader, typeof(DateOnly), new JsonSerializerOptions()); + }); + } + + [TestMethod] + public void Given_NullToken_When_Read_Then_ThrowsNotSupportedException() + { + // Arrange + string json = "null"; + + // Act + Utf8JsonReader reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + reader.Read(); + var result = _converter.Read(ref reader, typeof(DateOnly), new JsonSerializerOptions()); + + // Assert + Assert.IsNull(result); + } + + [TestMethod] + public void Given_DateOnlyValue_When_Write_Then_WritesCorrectDateOnlyValue() + { + // Arrange + DateOnly? dateOnly = null; + using var stream = new MemoryStream(); + using var writer = new Utf8JsonWriter(stream); + + // Act + _converter.Write(writer, dateOnly, new JsonSerializerOptions()); + writer.Flush(); + string json = System.Text.Encoding.UTF8.GetString(stream.ToArray()); + + // Assert + Assert.AreEqual("null", json); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Core/Converters/DateTimeJsonConverterTest.cs b/Adyen.Test/Core/Converters/DateTimeJsonConverterTest.cs new file mode 100644 index 000000000..68938e00c --- /dev/null +++ b/Adyen.Test/Core/Converters/DateTimeJsonConverterTest.cs @@ -0,0 +1,76 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Text.Json; +using Adyen.Core.Converters; + +namespace Adyen.Test.Core.Converters +{ + [TestClass] + public class DateTimeJsonConverterTest + { + private readonly DateTimeJsonConverter _converter = new DateTimeJsonConverter(); + + [TestMethod] + public void Given_ValidDateTimeWithFraction_When_Read_Then_ReturnsCorrectDateTime() + { + // Arrange + string json = "\"2025-12-25T14:30:15.1234567Z\""; + var reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + + // Act + reader.Read(); + var result = _converter.Read(ref reader, typeof(DateTime), new JsonSerializerOptions()); + + // Assert + Assert.AreEqual(DateTime.Parse("2025-12-25T14:30:15.1234567Z").ToUniversalTime(), result); + } + + [TestMethod] + public void Given_ValidDateTimeWithoutFraction_When_Read_Then_ReturnsCorrectDateTime() + { + // Arrange + string json = "\"2025-12-25T14:30:15Z\""; + var reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + + // Act + reader.Read(); + var result = _converter.Read(ref reader, typeof(DateTime), new JsonSerializerOptions()); + + // Assert + Assert.AreEqual(DateTime.Parse("2025-12-25T14:30:15Z").ToUniversalTime(), result); + } + + [TestMethod] + public void Given_InvalidDateTime_When_Read_Then_ThrowsNotSupportedException() + { + // Arrange + string json = "\"invalid-datetime\""; + + // Act + // Assert + Assert.ThrowsException(() => + { + var reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + reader.Read(); + _converter.Read(ref reader, typeof(DateTime), new JsonSerializerOptions()); + }); + } + + [TestMethod] + public void Given_DateTimeValue_When_Write_Then_WritesCorrectJson() + { + // Arrange + var dateTime = new DateTime(2025, 12, 25, 14, 30, 15, 123, DateTimeKind.Utc).AddTicks(4567); + + // Act + using var stream = new MemoryStream(); + using var writer = new Utf8JsonWriter(stream); + _converter.Write(writer, dateTime, new JsonSerializerOptions()); + writer.Flush(); + string json = System.Text.Encoding.UTF8.GetString(stream.ToArray()); + + // Assert + Assert.AreEqual($"\"{dateTime.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", System.Globalization.CultureInfo.InvariantCulture)}\"", json); + } + } +} diff --git a/Adyen.Test/Core/Converters/DateTimeNullableJsonConverterTest.cs b/Adyen.Test/Core/Converters/DateTimeNullableJsonConverterTest.cs new file mode 100644 index 000000000..75c337bae --- /dev/null +++ b/Adyen.Test/Core/Converters/DateTimeNullableJsonConverterTest.cs @@ -0,0 +1,111 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Globalization; +using System.Text; +using System.Text.Json; +using Adyen.Core.Converters; + +namespace Adyen.Core.Tests.Converters +{ + [TestClass] + public class DateTimeNullableJsonConverterTests + { + private readonly DateTimeNullableJsonConverter _converter = new(); + + [TestMethod] + public void Given_ValidDateTimeWithFraction_When_Read_Then_ReturnsCorrectDateTime() + { + // Arrange + string json = "\"2025-12-25T14:30:15.1234567Z\""; + + // Act + var reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + reader.Read(); + var result = _converter.Read(ref reader, typeof(DateTime?), new JsonSerializerOptions()); + + // Assert + Assert.AreEqual(DateTime.Parse("2025-12-25T14:30:15.1234567Z").ToUniversalTime(), result); + } + + [TestMethod] + public void Given_ValidDateTimeWithoutFraction_When_Read_Then_ReturnsCorrectDateTime() + { + // Arrange + string json = "\"2025-12-25T14:30:15Z\""; + + // Act + var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); + reader.Read(); + var result = _converter.Read(ref reader, typeof(DateTime?), new JsonSerializerOptions()); + + // Assert + Assert.AreEqual(DateTime.Parse("2025-12-25T14:30:15Z").ToUniversalTime(), result); + } + + [TestMethod] + public void Given_NullJson_When_Read_Then_ReturnsNull() + { + // Arrange + string json = "null"; + + // Act + var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); + reader.Read(); + var result = _converter.Read(ref reader, typeof(DateTime?), new JsonSerializerOptions()); + + // Assert + Assert.IsNull(result); + } + + [TestMethod] + public void Given_InvalidDateTime_When_Read_Then_ReturnsNull() + { + // Arrange + string json = "\"invalid-datetime\""; + + // Act + var reader = new Utf8JsonReader(System.Text.Encoding.UTF8.GetBytes(json)); + reader.Read(); + var result = _converter.Read(ref reader, typeof(DateTime?), new JsonSerializerOptions()); + + // Assert + Assert.IsNull(result); + } + + [TestMethod] + public void Given_DateTimeValue_When_Write_Then_WritesCorrectJson() + { + // Arrange + var dateTime = new DateTime(2025, 12, 25, 14, 30, 15, 123, DateTimeKind.Utc).AddTicks(4567); + + // Act + using var stream = new System.IO.MemoryStream(); + using var writer = new Utf8JsonWriter(stream); + + _converter.Write(writer, dateTime, new JsonSerializerOptions()); + writer.Flush(); + string json = Encoding.UTF8.GetString(stream.ToArray()); + + // Assert + Assert.AreEqual($"\"{dateTime.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)}\"", json); + } + + [TestMethod] + public void Given_NullDateTime_When_Write_Then_WritesNullJson() + { + // Arrange + DateTime? dateTime = null; + + // Act + using var stream = new System.IO.MemoryStream(); + using var writer = new Utf8JsonWriter(stream); + + _converter.Write(writer, dateTime, new JsonSerializerOptions()); + writer.Flush(); + string json = Encoding.UTF8.GetString(stream.ToArray()); + + // Assert + Assert.AreEqual("null", json); + } + } +} diff --git a/Adyen/Core/Auth/TokenBase.cs b/Adyen/Core/Auth/TokenBase.cs index 64522ca9f..a0afd072c 100644 --- a/Adyen/Core/Auth/TokenBase.cs +++ b/Adyen/Core/Auth/TokenBase.cs @@ -12,8 +12,9 @@ public abstract class TokenBase /// /// The constructor for the TokenBase object, used by . /// - internal TokenBase() + protected TokenBase() { + } } } \ No newline at end of file diff --git a/Adyen/Core/Converters/DateOnlyJsonConverter.cs b/Adyen/Core/Converters/DateOnlyJsonConverter.cs index 01c166216..80c34bd8d 100644 --- a/Adyen/Core/Converters/DateOnlyJsonConverter.cs +++ b/Adyen/Core/Converters/DateOnlyJsonConverter.cs @@ -34,7 +34,7 @@ public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, Jso string value = reader.GetString()!; foreach(string format in Formats) - if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateOnly result)) return result; throw new NotSupportedException(); diff --git a/Adyen/Core/Converters/DateOnlyNullableJsonConverter.cs b/Adyen/Core/Converters/DateOnlyNullableJsonConverter.cs index 199d8796a..c0e1f236a 100644 --- a/Adyen/Core/Converters/DateOnlyNullableJsonConverter.cs +++ b/Adyen/Core/Converters/DateOnlyNullableJsonConverter.cs @@ -34,7 +34,7 @@ public class DateOnlyNullableJsonConverter : JsonConverter string value = reader.GetString()!; foreach(string format in Formats) - if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateOnly result)) return result; throw new NotSupportedException(); From a16f88b81ea5d4eb9d231fc5eac0cfff2f7cf553 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 25 Oct 2025 13:34:37 +0200 Subject: [PATCH 063/126] Modified mustache templates to use _underscore for Option<> params This allows developers to only see the member variables that don't start with underscore --- Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs | 4 +- Adyen.Test/Checkout/PaymentsServiceTest.cs | 202 ++++++++++++++++++ .../generichost/JsonConverter.mustache | 46 ++-- .../generichost/WriteProperty.mustache | 2 +- .../generichost/WritePropertyHelper.mustache | 2 +- .../generichost/modelGeneric.mustache | 26 +-- 6 files changed, 242 insertions(+), 40 deletions(-) create mode 100644 Adyen.Test/Checkout/PaymentsServiceTest.cs diff --git a/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs b/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs index c982a481e..66e31dfa6 100644 --- a/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs +++ b/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs @@ -19,7 +19,7 @@ public AcsWebhooksTest() IHost host = Host.CreateDefaultBuilder() .ConfigureAcsWebhooks((context, services, config) => { - services.AddSingleton(); + services.AddSingleton(); // TODO }) .Build(); @@ -77,7 +77,7 @@ public async Task Deserialize_Authentication_Webhook_OOB_TRIGGER_FL_Returns_Obje // Assert Assert.IsNotNull(r); Assert.AreEqual(AuthenticationNotificationRequest.TypeEnum.BalancePlatformAuthenticationCreated, r.Type); - Assert.AreEqual("test", r.VarEnvironment); + Assert.AreEqual("test", r.Environment); Assert.AreEqual(DateTime.Parse("2022-12-22T15:42:03+01:00"), r.Timestamp); Assert.IsNotNull(r.Data); diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs new file mode 100644 index 000000000..68c7a8daa --- /dev/null +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -0,0 +1,202 @@ +using Adyen.Checkout.Extensions; +using Adyen.Checkout.Models; +using Adyen.Checkout.Services; +using Adyen.Checkout.Client; +using Adyen.Core.Auth; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.Extensions.Hosting; +using System.Text.Json; +using Adyen.Core.Options; + +namespace Adyen.Test.Checkout +{ + [TestClass] + public class PaymentsServiceTest + { + private readonly IPaymentsService _paymentsApiService; + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public PaymentsServiceTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _paymentsApiService = host.Services.GetRequiredService(); + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public async Task DeserializePaymentMethodsTest() + { + string json = @" +{ + ""paymentMethods"": [ + { + ""name"": ""AliPay"", + ""type"": ""alipay"" + }, + { + ""brands"": [ + ""cartebancaire"", + ""amex"", + ""mc"", + ""visa"" + ], + ""configuration"": { + ""mcDpaId"": ""6d41d4d6-45b1-42c3-a5d0-a28c0e69d4b1_dpa2"", + ""visaSrcInitiatorId"": ""B9SECVKIQX2SOBQ6J9X721dVBBKHhJJl1nxxVbemHGn5oB6S8"", + ""mcSrcClientId"": ""6d41d4d6-45b1-42c3-a5d0-a28c0e69d4b1"", + ""visaSrciDpaId"": ""8e6e347c-254e-863f-0e6a-196bf2d9df02"" + }, + ""name"": ""Cards"", + ""type"": ""scheme"" + }, + { + ""configuration"": { + ""merchantId"": ""000000000202326"", + ""merchantName"": ""TestMerchantAccount"" + }, + ""name"": ""Apple Pay"", + ""type"": ""applepay"" + }, + { + ""name"": ""Payconiq by Bancontact"", + ""type"": ""bcmc_mobile"" + }, + { + ""name"": ""Boleto Bancario"", + ""type"": ""boletobancario"" + }, + { + ""name"": ""Online bank transfer."", + ""type"": ""directEbanking"" + }, + { + ""name"": ""DOKU"", + ""type"": ""doku"" + }, + { + ""name"": ""DOKU wallet"", + ""type"": ""doku_wallet"" + }, + { + ""brand"": ""***************"", + ""name"": ""Generic GiftCard"", + ""type"": ""giftcard"" + }, + { + ""brand"": ""*****"", + ""name"": ""Givex"", + ""type"": ""giftcard"" + }, + { + ""name"": ""GoPay Wallet"", + ""type"": ""gopay_wallet"" + }, + { + ""name"": ""GrabPay"", + ""type"": ""grabpay_SG"" + }, + { + ""issuers"": [ + { + ""id"": ""************"", + ""name"": ""*****"" + } + ], + ""name"": ""iDEAL"", + ""type"": ""ideal"" + }, + { + ""name"": ""Korea–issued cards"", + ""type"": ""kcp_creditcard"" + }, + { + ""name"": ""Pay later with Klarna."", + ""type"": ""klarna"" + }, + { + ""name"": ""Pay over time with Klarna."", + ""type"": ""klarna_account"" + }, + { + ""name"": ""Pay now with Klarna."", + ""type"": ""klarna_paynow"" + }, + { + ""name"": ""MB WAY"", + ""type"": ""mbway"" + }, + { + ""name"": ""MobilePay"", + ""type"": ""mobilepay"" + }, + { + ""configuration"": { + ""merchantId"": ""50"", + ""gatewayMerchantId"": ""TestMerchantAccount"" + }, + ""name"": ""Google Pay"", + ""type"": ""paywithgoogle"" + }, + { + ""name"": ""pix"", + ""type"": ""pix"" + }, + { + ""name"": ""SEPA Direct Debit"", + ""type"": ""sepadirectdebit"" + }, + { + ""brand"": ""***"", + ""name"": ""SVS"", + ""type"": ""giftcard"" + }, + { + ""name"": ""UPI Collect"", + ""type"": ""upi_collect"" + }, + { + ""name"": ""UPI Intent"", + ""type"": ""upi_intent"" + }, + { + ""name"": ""UPI QR"", + ""type"": ""upi_qr"" + }, + { + ""brand"": ""*********"", + ""name"": ""Valuelink"", + ""type"": ""giftcard"" + }, + { + ""name"": ""Vipps"", + ""type"": ""vipps"" + }, + { + ""brand"": ""***********"", + ""name"": ""VVV Giftcard"", + ""type"": ""giftcard"" + } + ] +} +"; + + // Act + var result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNotNull(result.PaymentMethods); + Assert.IsNull(result.StoredPaymentMethods); + Assert.AreEqual(29, result.PaymentMethods.Count); + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index bf4fb0cb1..329a9d677 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -20,12 +20,12 @@ {{/isDate}} {{/allVars}} /// - /// Deserializes json to + /// Deserializes json to . /// - /// - /// - /// - /// + /// + /// + /// The , initialized from . + /// /// public override {{classname}} Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { @@ -335,9 +335,9 @@ /// /// Serializes a /// - /// + /// /// - /// + /// /// public override void Write(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) { @@ -446,12 +446,12 @@ {{#lambda.trimTrailingWithNewLine}} {{#lambda.trimLineBreaks}} /* - {{! Removed guard checks for required properties }} + {{! TODO: Removed guard checks for required properties I've commented this out}} {{#allVars}} {{^isDiscriminator}} {{^isNullable}} {{#vendorExtensions.x-is-reference-type}} - if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) + if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}._{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) throw new ArgumentNullException(nameof({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}), "Property is required for class {{classname}}."); {{/vendorExtensions.x-is-reference-type}} @@ -492,7 +492,7 @@ {{/isString}} {{#isBoolean}} {{#lambda.copyText}} - writer.WriteBoolean("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); + writer.WriteBoolean("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}}{{! prevent indent}} @@ -501,7 +501,7 @@ {{^isEnum}} {{#isNumeric}} {{#lambda.copyText}} - writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); + writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}}{{! prevent indent}} @@ -510,7 +510,7 @@ {{/isEnum}} {{#isDate}} {{#lambda.copyText}} - writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}}{{! prevent indent}} @@ -518,7 +518,7 @@ {{/isDate}} {{#isDateTime}} {{#lambda.copyText}} - writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}}{{! prevent indent}} @@ -527,7 +527,7 @@ {{#isEnum}} {{#isNumeric}} {{#lambda.copyText}} - writer.WriteNumber("{{baseName}}", {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}})); + writer.WriteNumber("{{baseName}}", {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}})); {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}}{{! prevent indent}} @@ -537,7 +537,7 @@ {{^isNumeric}} {{#isInnerEnum}} {{#isNullable}} - var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); else @@ -545,9 +545,9 @@ {{/isNullable}} {{^isNullable}} - if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) {{! - }} + if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}._{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) {{! - }} { - var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); } @@ -599,11 +599,11 @@ {{/required}} {{^required}} - if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}._{{name}}Option.IsSet) {{#isNullable}} - if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option{{nrt!}}.Value != null) + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}._{{name}}Option{{nrt!}}.Value != null) { - var {{#lambda.paste}}{{/lambda.paste}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value{{nrt!}}.Value); + var {{#lambda.paste}}{{/lambda.paste}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}._{{name}}Option.Value{{nrt!}}.Value); writer.{{#lambda.first}}{{#allowableValues}}{{#enumVars}}{{^isNumeric}}WriteString {{/isNumeric}}{{#isNumeric}}WriteNumber {{/isNumeric}}{{/enumVars}}{{/allowableValues}}{{/lambda.first}}("{{baseName}}", {{#lambda.paste}}{{/lambda.paste}}RawValue); } else @@ -622,7 +622,7 @@ {{/isEnum}} {{#isUuid}} {{#lambda.copyText}} - writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}}{{! prevent indent}} @@ -651,9 +651,9 @@ {{/isNullable}} {{/required}} {{^required}} - if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}._{{name}}Option.IsSet) {{#isNullable}} - if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value != null) + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}._{{name}}Option.Value != null) { writer.WritePropertyName("{{baseName}}"); JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); diff --git a/templates-v7/csharp/libraries/generichost/WriteProperty.mustache b/templates-v7/csharp/libraries/generichost/WriteProperty.mustache index 03b036f9a..8fe669906 100644 --- a/templates-v7/csharp/libraries/generichost/WriteProperty.mustache +++ b/templates-v7/csharp/libraries/generichost/WriteProperty.mustache @@ -3,7 +3,7 @@ {{/required}} {{^required}} -if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) +if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}._{{name}}Option.IsSet) {{#lambda.indent1}} {{>WritePropertyHelper}}{{! prevent indent}} {{/lambda.indent1}} diff --git a/templates-v7/csharp/libraries/generichost/WritePropertyHelper.mustache b/templates-v7/csharp/libraries/generichost/WritePropertyHelper.mustache index 616993bce..04270093a 100644 --- a/templates-v7/csharp/libraries/generichost/WritePropertyHelper.mustache +++ b/templates-v7/csharp/libraries/generichost/WritePropertyHelper.mustache @@ -1,5 +1,5 @@ {{#isNullable}} -if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}} != null) +if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{/required}} != null) {{#lambda.paste}}{{/lambda.paste}} else writer.WriteNull("{{baseName}}"); diff --git a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache index dac6dc069..622579401 100644 --- a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache +++ b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache @@ -1,5 +1,5 @@ /// - /// {{description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}}. /// {{>visibility}} partial class {{classname}}{{#lambda.firstDot}}{{#parent}} : .{{/parent}}{{#validatable}} : .{{/validatable}}{{#equatable}}{{#readOnlyVars}}{{#-first}} : .{{/-first}}{{/readOnlyVars}}{{/equatable}}{{/lambda.firstDot}}{{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{>ImplementsIEquatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} { @@ -70,11 +70,11 @@ {{#allVars}} {{^isDiscriminator}} {{^isInherited}} - {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{^required}}_{{/required}}{{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/isInherited}} {{#isInherited}} {{#isNew}} - {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{^required}}_{{/required}}{{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/isNew}} {{/isInherited}} {{/isDiscriminator}} @@ -115,7 +115,7 @@ /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> _{{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} {{/required}} /// @@ -131,7 +131,7 @@ {{#deprecated}} [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/deprecated}} - public {{#isNew}}new {{/isNew}}{{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + public {{#isNew}}new {{/isNew}}{{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this._{{name}}Option; } {{^isReadOnly}}set { this._{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} {{/isEnum}} {{/isDiscriminator}} @@ -140,11 +140,11 @@ {{^vendorExtensions.x-duplicated-data-type}} {{^required}} /// - /// Used to track the state of {{{name}}} + /// Used to track the state of {{{name}}}. /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> _{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} {{/required}} /// @@ -157,14 +157,14 @@ {{#deprecated}} [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/deprecated}} - public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option; } {{^isReadOnly}}set { this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this._{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option; } {{^isReadOnly}}set { this._{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.anyOf}} {{#composedSchemas.oneOf}} {{^vendorExtensions.x-duplicated-data-type}} /// - /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{/description}}. /// {{#description}} /// {{.}}{{/description}} {{#example}} @@ -201,7 +201,7 @@ /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public new Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + public new Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> _{{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} {{/required}} /// @@ -215,7 +215,7 @@ {{#deprecated}} [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/deprecated}} - public new {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + public new {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this._{{name}}Option } {{^isReadOnly}}set { this._{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} {{/isNew}} {{/isInherited}} @@ -226,7 +226,7 @@ /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + public Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> _{{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} {{/required}} /// @@ -240,7 +240,7 @@ {{#deprecated}} [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/deprecated}} - public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this._{{name}}Option; } {{^isReadOnly}}set { this._{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} {{/isInherited}} {{/isEnum}} From 07a244cb41c80622e1514b2a55e18bb6417424e1 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 25 Oct 2025 14:26:46 +0200 Subject: [PATCH 064/126] Rename/move tests namespaces Update mustache template to ConstructHostUrl in HostConfiguration --- .../PaymentsServiceIntegrationTest.cs | 164 ------------------ Adyen.Test/Checkout/PaymentsServiceTest.cs | 107 +++++++++--- Adyen.Test/Core/Client/ApiResponseTest.cs | 8 +- .../DateTimeNullableJsonConverterTest.cs | 2 +- .../generichost/HostConfiguration.mustache | 2 +- 5 files changed, 89 insertions(+), 194 deletions(-) diff --git a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index 0818d4e6f..0d014e4eb 100644 --- a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -59,169 +59,5 @@ public async Task Given_Payments_When_CardDetails_Provided_Returns_OK() response.TryDeserializeOkResponse(out var result); Assert.AreEqual(result?.MerchantReference, "reference"); } - - [TestMethod] - public async Task DeserializePaymentMethodsTest() - { - string json = @" -{ - ""paymentMethods"": [ - { - ""name"": ""AliPay"", - ""type"": ""alipay"" - }, - { - ""brands"": [ - ""cartebancaire"", - ""amex"", - ""mc"", - ""visa"" - ], - ""configuration"": { - ""mcDpaId"": ""6d41d4d6-45b1-42c3-a5d0-a28c0e69d4b1_dpa2"", - ""visaSrcInitiatorId"": ""B9SECVKIQX2SOBQ6J9X721dVBBKHhJJl1nxxVbemHGn5oB6S8"", - ""mcSrcClientId"": ""6d41d4d6-45b1-42c3-a5d0-a28c0e69d4b1"", - ""visaSrciDpaId"": ""8e6e347c-254e-863f-0e6a-196bf2d9df02"" - }, - ""name"": ""Cards"", - ""type"": ""scheme"" - }, - { - ""configuration"": { - ""merchantId"": ""000000000202326"", - ""merchantName"": ""TestMerchantAccount"" - }, - ""name"": ""Apple Pay"", - ""type"": ""applepay"" - }, - { - ""name"": ""Payconiq by Bancontact"", - ""type"": ""bcmc_mobile"" - }, - { - ""name"": ""Boleto Bancario"", - ""type"": ""boletobancario"" - }, - { - ""name"": ""Online bank transfer."", - ""type"": ""directEbanking"" - }, - { - ""name"": ""DOKU"", - ""type"": ""doku"" - }, - { - ""name"": ""DOKU wallet"", - ""type"": ""doku_wallet"" - }, - { - ""brand"": ""***************"", - ""name"": ""Generic GiftCard"", - ""type"": ""giftcard"" - }, - { - ""brand"": ""*****"", - ""name"": ""Givex"", - ""type"": ""giftcard"" - }, - { - ""name"": ""GoPay Wallet"", - ""type"": ""gopay_wallet"" - }, - { - ""name"": ""GrabPay"", - ""type"": ""grabpay_SG"" - }, - { - ""issuers"": [ - { - ""id"": ""************"", - ""name"": ""*****"" - } - ], - ""name"": ""iDEAL"", - ""type"": ""ideal"" - }, - { - ""name"": ""Korea–issued cards"", - ""type"": ""kcp_creditcard"" - }, - { - ""name"": ""Pay later with Klarna."", - ""type"": ""klarna"" - }, - { - ""name"": ""Pay over time with Klarna."", - ""type"": ""klarna_account"" - }, - { - ""name"": ""Pay now with Klarna."", - ""type"": ""klarna_paynow"" - }, - { - ""name"": ""MB WAY"", - ""type"": ""mbway"" - }, - { - ""name"": ""MobilePay"", - ""type"": ""mobilepay"" - }, - { - ""configuration"": { - ""merchantId"": ""50"", - ""gatewayMerchantId"": ""TestMerchantAccount"" - }, - ""name"": ""Google Pay"", - ""type"": ""paywithgoogle"" - }, - { - ""name"": ""pix"", - ""type"": ""pix"" - }, - { - ""name"": ""SEPA Direct Debit"", - ""type"": ""sepadirectdebit"" - }, - { - ""brand"": ""***"", - ""name"": ""SVS"", - ""type"": ""giftcard"" - }, - { - ""name"": ""UPI Collect"", - ""type"": ""upi_collect"" - }, - { - ""name"": ""UPI Intent"", - ""type"": ""upi_intent"" - }, - { - ""name"": ""UPI QR"", - ""type"": ""upi_qr"" - }, - { - ""brand"": ""*********"", - ""name"": ""Valuelink"", - ""type"": ""giftcard"" - }, - { - ""name"": ""Vipps"", - ""type"": ""vipps"" - }, - { - ""brand"": ""***********"", - ""name"": ""VVV Giftcard"", - ""type"": ""giftcard"" - } - ] -} -"; - - // Act - var r = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); - - // Assert - Assert.IsNotNull(r); - } } } \ No newline at end of file diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index 68c7a8daa..ed9ed8bf7 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -2,7 +2,6 @@ using Adyen.Checkout.Models; using Adyen.Checkout.Services; using Adyen.Checkout.Client; -using Adyen.Core.Auth; using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; @@ -14,28 +13,20 @@ namespace Adyen.Test.Checkout [TestClass] public class PaymentsServiceTest { - private readonly IPaymentsService _paymentsApiService; - private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; - - public PaymentsServiceTest() - { - IHost host = Host.CreateDefaultBuilder() - .ConfigureCheckout((context, services, config) => - { - config.ConfigureAdyenOptions(options => - { - options.Environment = AdyenEnvironment.Test; - }); - }) - .Build(); - - _paymentsApiService = host.Services.GetRequiredService(); - _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); - } - [TestMethod] - public async Task DeserializePaymentMethodsTest() + public async Task Given_PaymentMethodsResponse_When_Deserialized_Then_Result_Is_Not_Null() { + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + var jsonSerializerOptionsProvider = testHost.Services.GetRequiredService(); string json = @" { ""paymentMethods"": [ @@ -189,14 +180,82 @@ public async Task DeserializePaymentMethodsTest() ] } "; - + // Act - var result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); - + var result = JsonSerializer.Deserialize(json, jsonSerializerOptionsProvider.Options); + // Assert Assert.IsNotNull(result.PaymentMethods); Assert.IsNull(result.StoredPaymentMethods); Assert.AreEqual(29, result.PaymentMethods.Count); } + + [TestMethod] + public async Task Given_ConfigureCheckout_When_Environment_Is_Live_Then_HttpClient_BaseUrl_Is_Correct() + { + // Arrange + IHost liveHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Live; + options.LiveEndpointUrlPrefix = "prefix"; + }); + }) + .Build(); + + // Act + var paymentsApiService = liveHost.Services.GetRequiredService(); + string baseAddress = paymentsApiService.HttpClient.BaseAddress!.ToString(); + + // Assert + Assert.IsTrue(baseAddress.Contains("live")); + Assert.IsTrue(baseAddress.Contains("prefix")); + } + + [TestMethod] + public async Task Given_ConfigureCheckout_When_Environment_Is_Test_And_Prefix_Given_Then_HttpClient_BaseUrl_Does_Not_Contain_Prefix() + { + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + options.LiveEndpointUrlPrefix = "prefix"; + }); + }) + .Build(); + + // Act + var paymentsApiService = testHost.Services.GetRequiredService(); + string baseAddress = paymentsApiService.HttpClient.BaseAddress!.ToString(); + + // Assert + Assert.IsTrue(baseAddress.Contains("test")); + Assert.IsFalse(baseAddress.Contains("prefix")); + } + + + [TestMethod] + public async Task Given_ConfigureCheckout_When_No_Options_Provided_Then_HttpClient_Should_Contain_Test_Url_And_No_Prefix() + { + // Arrange + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + // Empty + }) + .Build(); + + // Act + // Assert + Assert.Throws(() => + { + // No ApiKey provided, cannot instantiate the ApiKeyToken object + testHost.Services.GetRequiredService(); + }); + } } } \ No newline at end of file diff --git a/Adyen.Test/Core/Client/ApiResponseTest.cs b/Adyen.Test/Core/Client/ApiResponseTest.cs index 209dd429a..5d2f37d41 100644 --- a/Adyen.Test/Core/Client/ApiResponseTest.cs +++ b/Adyen.Test/Core/Client/ApiResponseTest.cs @@ -6,7 +6,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Adyen.Core.Client; -namespace Adyen.Core.Tests +namespace Adyen.Test.Core.Client { [TestClass] public class ApiResponseTests @@ -76,11 +76,11 @@ public void Given_ApiResponse_When_ContentStream_Is_Set_Then_Return_ContentStrea Assert.AreEqual(string.Empty, apiResponse.RawContent); } - private class ExampleApiResponse : ApiResponse, + private class TestApiResponse : ApiResponse, IOk, ICreated, IAccepted, IBadRequest, IUnauthorized, IForbidden, ITooManyRequests, INotFound, IUnprocessableContent, IInternalServerError { - public ExampleApiResponse(HttpRequestMessage message, HttpResponseMessage response, string raw, string path, DateTime requested, JsonSerializerOptions opts) + public TestApiResponse(HttpRequestMessage message, HttpResponseMessage response, string raw, string path, DateTime requested, JsonSerializerOptions opts) : base(message, response, raw, path, requested, opts) { } private T DeserializeRaw() => JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions)!; @@ -126,7 +126,7 @@ public void Given_ApiResponse_When_TypedResponses_Then_Deserialize_Correctly() // Act string json = JsonSerializer.Serialize(model, new JsonSerializerOptions()); - var response = new ExampleApiResponse(CreateRequest(), CreateResponse(HttpStatusCode.OK), json, "/path", DateTime.UtcNow, new JsonSerializerOptions()); + var response = new TestApiResponse(CreateRequest(), CreateResponse(HttpStatusCode.OK), json, "/path", DateTime.UtcNow, new JsonSerializerOptions()); // Assert Assert.AreEqual(model, response.Ok()); diff --git a/Adyen.Test/Core/Converters/DateTimeNullableJsonConverterTest.cs b/Adyen.Test/Core/Converters/DateTimeNullableJsonConverterTest.cs index 75c337bae..dc528d0a2 100644 --- a/Adyen.Test/Core/Converters/DateTimeNullableJsonConverterTest.cs +++ b/Adyen.Test/Core/Converters/DateTimeNullableJsonConverterTest.cs @@ -5,7 +5,7 @@ using System.Text.Json; using Adyen.Core.Converters; -namespace Adyen.Core.Tests.Converters +namespace Adyen.Test.Core.Converters { [TestClass] public class DateTimeNullableJsonConverterTests diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index a53bfe4c9..53be59a17 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -115,7 +115,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} clientAction = null, Action{{nrt?}} builderAction = null) { if (clientAction == null) - clientAction = httpClient => httpClient.BaseAddress = new Uri(BASE_URL); + clientAction = httpClient => httpClient.BaseAddress = new Uri(ConstructHostUrl()); List builders = new List(); From f497990a3f5acf06a0999f892f9ee41f0a63f379 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 25 Oct 2025 14:54:43 +0200 Subject: [PATCH 065/126] Add ApiToken Test for multiple services --- Adyen.Test/Checkout/PaymentsServiceTest.cs | 39 ++++++++-------- Adyen.Test/Core/Auth/ApiTokenTest.cs | 53 ++++++++++++++++++++++ 2 files changed, 72 insertions(+), 20 deletions(-) create mode 100644 Adyen.Test/Core/Auth/ApiTokenTest.cs diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index ed9ed8bf7..c3e97c4dd 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -237,25 +237,24 @@ public async Task Given_ConfigureCheckout_When_Environment_Is_Test_And_Prefix_Gi Assert.IsFalse(baseAddress.Contains("prefix")); } - - [TestMethod] - public async Task Given_ConfigureCheckout_When_No_Options_Provided_Then_HttpClient_Should_Contain_Test_Url_And_No_Prefix() - { - // Arrange - IHost testHost = Host.CreateDefaultBuilder() - .ConfigureCheckout((context, services, config) => - { - // Empty - }) - .Build(); - - // Act - // Assert - Assert.Throws(() => - { - // No ApiKey provided, cannot instantiate the ApiKeyToken object - testHost.Services.GetRequiredService(); - }); - } + [TestMethod] + public async Task Given_ConfigureCheckout_When_No_Options_Provided_Then_HttpClient_Should_Contain_Test_Url_And_No_Prefix() + { + // Arrange + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + // Empty + }) + .Build(); + + // Act + // Assert + Assert.Throws(() => + { + // No ApiKey provided, cannot instantiate the ApiKeyToken object + testHost.Services.GetRequiredService(); + }); + } } } \ No newline at end of file diff --git a/Adyen.Test/Core/Auth/ApiTokenTest.cs b/Adyen.Test/Core/Auth/ApiTokenTest.cs new file mode 100644 index 000000000..62651ad7d --- /dev/null +++ b/Adyen.Test/Core/Auth/ApiTokenTest.cs @@ -0,0 +1,53 @@ +using Adyen.Checkout.Extensions; +using Adyen.BalancePlatform.Extensions; +using Adyen.Core.Auth; +using Adyen.Core.Options; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.Core.Auth +{ + [TestClass] + public class ApiKeyTokenTest + { + [TestMethod] + public async Task Given_Multiple_Api_Tokens_When_Injected_Then_Correct_TokenProvider_Is_Used_To_Provide_Correct_ApiKeyToken() + { + // Arrange + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = "adyen-api-key"; + options.Environment = AdyenEnvironment.Test; + }); + }) + .ConfigureBalancePlatform((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = "balanceplatform-adyen-api-key"; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + // Act + ITokenProvider balancePlatformApiKey = testHost.Services.GetRequiredService>(); + ITokenProvider checkoutApiKey = testHost.Services.GetRequiredService>(); + + using var balancePlatformMessage = new HttpRequestMessage(HttpMethod.Get, "/dummy/endpoint"); + balancePlatformApiKey.Get().AddTokenToHttpRequestMessageHeader(balancePlatformMessage); + + using var checkoutMessage = new HttpRequestMessage(HttpMethod.Get, "/dummy/endpoint"); + checkoutApiKey.Get().AddTokenToHttpRequestMessageHeader(checkoutMessage); + + // Assert + Assert.AreEqual(balancePlatformMessage.Headers.First().Value.First(), "balanceplatform-adyen-api-key"); + Assert.AreEqual(checkoutMessage.Headers.First().Value.First(), "adyen-api-key"); + } + + } +} \ No newline at end of file From 9bfff8e173f5254e9fd0a583931146a59cdae9e7 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 25 Oct 2025 15:44:26 +0200 Subject: [PATCH 066/126] Rename/move Tests from other branch --- .../Checkout/PaymentsServiceIntegrationTest.cs | 5 ----- Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs | 8 +++----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index 0d014e4eb..de1b76f2f 100644 --- a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -1,12 +1,9 @@ using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; -using Adyen.Checkout.Client; -using Adyen.Core.Auth; using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; -using System.Text.Json; using Adyen.Core.Options; namespace Adyen.IntegrationTest.Checkout @@ -15,7 +12,6 @@ namespace Adyen.IntegrationTest.Checkout public class PaymentsServiceIntegrationTest { private readonly IPaymentsService _paymentsApiService; - private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; public PaymentsServiceIntegrationTest() { @@ -31,7 +27,6 @@ public PaymentsServiceIntegrationTest() .Build(); _paymentsApiService = host.Services.GetRequiredService(); - _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); } [TestMethod] diff --git a/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs b/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs index 66e31dfa6..d26ebad14 100644 --- a/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs +++ b/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs @@ -5,13 +5,13 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; +using System.Text.Json; -namespace Adyen.IntegrationTest.AcsWebhooks +namespace Adyen.Test.AcsWebhooks { [TestClass] public class AcsWebhooksTest { - private readonly AcsWebhooksService _acsWebhooksService; private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; public AcsWebhooksTest() @@ -19,11 +19,9 @@ public AcsWebhooksTest() IHost host = Host.CreateDefaultBuilder() .ConfigureAcsWebhooks((context, services, config) => { - services.AddSingleton(); // TODO }) .Build(); - _acsWebhooksService = host.Services.GetRequiredService(); _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); } @@ -72,7 +70,7 @@ public async Task Deserialize_Authentication_Webhook_OOB_TRIGGER_FL_Returns_Obje } "; // Act - AuthenticationNotificationRequest r = _acsWebhooksService.DeserializeAuthenticationNotificationRequest(json); + AuthenticationNotificationRequest r = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); // Assert Assert.IsNotNull(r); From f4a5d1feadc51eb075b6767d06a3d2cf399d3fe0 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 25 Oct 2025 16:20:38 +0200 Subject: [PATCH 067/126] Add TransferWebhook test Modified mustache template to do required-fields check before JsonSerializer.Read(..) --- .../TransferWebhooks/TransferWebhooksTest.cs | 178 ++++++++++++++++++ .../generichost/JsonConverter.mustache | 6 +- 2 files changed, 180 insertions(+), 4 deletions(-) create mode 100644 Adyen.Test/TransferWebhooks/TransferWebhooksTest.cs diff --git a/Adyen.Test/TransferWebhooks/TransferWebhooksTest.cs b/Adyen.Test/TransferWebhooks/TransferWebhooksTest.cs new file mode 100644 index 000000000..4a2b7922d --- /dev/null +++ b/Adyen.Test/TransferWebhooks/TransferWebhooksTest.cs @@ -0,0 +1,178 @@ + +using System.Text.Json; +using Adyen.Transfers.Models; +using Adyen.TransferWebhooks.Client; +using Adyen.TransferWebhooks.Extensions; +using Adyen.TransferWebhooks.Models; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.Extensions.Hosting; +using PlatformPayment = Adyen.TransferWebhooks.Models.PlatformPayment; +using TransferData = Adyen.TransferWebhooks.Models.TransferData; +using TransferEvent = Adyen.TransferWebhooks.Models.TransferEvent; + +namespace Adyen.Test.TransferWebhooks +{ + [TestClass] + public class TransferWebhooksTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public TransferWebhooksTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureTransferWebhooks((context, services, config) => + { + + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public async Task Deserialize_Transfer_Webhook_Notification_Of_Chargeback_Returns_Not_Null() + { + // Arrange + string json = @" +{ + ""data"": { + ""balancePlatform"": ""YOUR_BALANCE_PLATFORM"", + ""creationDate"": ""2025-06-02T13:46:27+02:00"", + ""id"": ""01234"", + ""accountHolder"": { + ""description"": ""The Account Holder"", + ""id"": ""AH1234567890"" + }, + ""amount"": { + ""currency"": ""EUR"", + ""value"": 22700 + }, + ""balanceAccount"": { + ""description"": ""The Liable Balance Account"", + ""id"": ""BA1234567890"" + }, + ""category"": ""platformPayment"", + ""categoryData"": { + ""modificationMerchantReference"": """", + ""modificationPspReference"": ""ZX1234567890"", + ""paymentMerchantReference"": ""pv-test"", + ""platformPaymentType"": ""Remainder"", + ""pspPaymentReference"": ""PSP01234"", + ""type"": ""platformPayment"" + }, + ""description"": ""Remainder Fee for pv-test"", + ""direction"": ""incoming"", + ""reason"": ""approved"", + ""reference"": """", + ""status"": ""authorised"", + ""type"": ""capture"", + ""balances"": [ + { + ""currency"": ""EUR"", + ""received"": 0, + ""reserved"": 22700 + } + ], + ""eventId"": ""EV1234567890"", + ""events"": [ + { + ""bookingDate"": ""2025-06-02T13:46:27+02:00"", + ""id"": ""EV1234567890"", + ""mutations"": [ + { + ""currency"": ""EUR"", + ""received"": 22700 + } + ], + ""status"": ""received"", + ""type"": ""accounting"" + }, + { + ""bookingDate"": ""2025-06-02T13:46:27+02:00"", + ""id"": ""EV1234567890-2"", + ""mutations"": [ + { + ""currency"": ""EUR"", + ""received"": -22700, + ""reserved"": 22700 + } + ], + ""status"": ""authorised"", + ""type"": ""accounting"" + } + ], + ""sequenceNumber"": 2 + }, + ""environment"": ""test"", + ""timestamp"": ""2025-06-02T11:46:28.635Z"", + ""type"": ""balancePlatform.transfer.updated"" +} +"; + // Act + TransferNotificationRequest r = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNotNull(r); + Assert.AreEqual("test", r.Environment); + Assert.AreEqual(TransferNotificationRequest.TypeEnum.BalancePlatformTransferUpdated, r.Type); + + Assert.AreEqual("YOUR_BALANCE_PLATFORM", r.Data.BalancePlatform); + Assert.AreEqual(DateTimeOffset.Parse("2025-06-02T13:46:27+02:00"), r.Data.CreationDate); + Assert.AreEqual("01234", r.Data.Id); + + Assert.AreEqual("The Account Holder", r.Data.AccountHolder.Description); + Assert.AreEqual("AH1234567890", r.Data.AccountHolder.Id); + + Assert.AreEqual("EUR", r.Data.Amount.Currency); + Assert.AreEqual(22700, r.Data.Amount.Value); + Assert.IsNotNull(r.Data.BalanceAccount); + Assert.AreEqual("The Liable Balance Account", r.Data.BalanceAccount.Description); + Assert.AreEqual("BA1234567890", r.Data.BalanceAccount.Id); + Assert.AreEqual(TransferData.CategoryEnum.PlatformPayment, r.Data.Category); + + Assert.AreEqual("", r.Data.CategoryData.PlatformPayment.ModificationMerchantReference); + Assert.AreEqual("ZX1234567890", r.Data.CategoryData.PlatformPayment.ModificationPspReference); + Assert.AreEqual("pv-test", r.Data.CategoryData.PlatformPayment.PaymentMerchantReference); + Assert.AreEqual(PlatformPayment.PlatformPaymentTypeEnum.Remainder, r.Data.CategoryData.PlatformPayment.PlatformPaymentType); + Assert.AreEqual("PSP01234", r.Data.CategoryData.PlatformPayment.PspPaymentReference); + Assert.AreEqual("Remainder Fee for pv-test", r.Data.Description); + Assert.AreEqual(TransferData.DirectionEnum.Incoming, r.Data.Direction); + Assert.AreEqual(TransferData.ReasonEnum.Approved, r.Data.Reason); + Assert.AreEqual("", r.Data.Reference); + Assert.AreEqual(TransferData.StatusEnum.Authorised, r.Data.Status); + Assert.AreEqual(TransferData.TypeEnum.Capture, r.Data.Type); + + Assert.AreEqual(1, r.Data.Balances.Count); + Assert.AreEqual("EUR", r.Data.Balances[0].Currency); + Assert.AreEqual(0, r.Data.Balances[0].Received); + Assert.AreEqual(22700, r.Data.Balances[0].Reserved); + Assert.AreEqual("EV1234567890", r.Data.EventId); + + Assert.AreEqual(2, r.Data.Events.Count); + + Assert.AreEqual(DateTimeOffset.Parse("2025-06-02T13:46:27+02:00"), r.Data.Events[0].BookingDate); + Assert.AreEqual("EV1234567890", r.Data.Events[0].Id); + Assert.AreEqual(TransferEvent.StatusEnum.Received, r.Data.Events[0].Status); + Assert.AreEqual(TransferEvent.TypeEnum.Accounting, r.Data.Events[0].Type); + + Assert.AreEqual(1, r.Data.Events[0].Mutations.Count); + Assert.AreEqual("EUR", r.Data.Events[0].Mutations[0].Currency); + Assert.AreEqual(22700, r.Data.Events[0].Mutations[0].Received); + + Assert.AreEqual(DateTimeOffset.Parse("2025-06-02T13:46:27+02:00"), r.Data.Events[1].BookingDate); + Assert.AreEqual("EV1234567890-2", r.Data.Events[1].Id); + Assert.AreEqual(TransferEvent.StatusEnum.Authorised, r.Data.Events[1].Status); + Assert.AreEqual(TransferEvent.TypeEnum.Accounting, r.Data.Events[1].Type); + + Assert.IsNotNull(r.Data.Events[1].Mutations); + Assert.AreEqual(1, r.Data.Events[1].Mutations.Count); + Assert.AreEqual("EUR", r.Data.Events[1].Mutations[0].Currency); + Assert.AreEqual(-22700, r.Data.Events[1].Mutations[0].Received); + Assert.AreEqual(22700, r.Data.Events[1].Mutations[0].Reserved); + + Assert.AreEqual(2, r.Data.SequenceNumber); + Assert.AreEqual(DateTimeOffset.Parse("2025-06-02T11:46:28.635Z"), r.Timestamp); + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index 329a9d677..0a525bd5b 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -267,9 +267,8 @@ } } } - - /* - {{! Removed checks for required fields }} + + {{! Required fields }} {{#allVars}} {{#required}} if (!{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.IsSet) @@ -284,7 +283,6 @@ {{/isNullable}} {{/allVars}} - */ {{^vendorExtensions.x-duplicated-data-type}} {{#model.discriminator}} {{#model.hasDiscriminatorWithNonEmptyMapping}} From 4d1195b226de9fa942b043d5a09e7aa8f8400304 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 25 Oct 2025 16:38:57 +0200 Subject: [PATCH 068/126] Remove HttpResponse and headers from mustache template Reason: Useless information --- .../libraries/generichost/api_doc.mustache | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/templates-v7/csharp/libraries/generichost/api_doc.mustache b/templates-v7/csharp/libraries/generichost/api_doc.mustache index fac055edf..ebd243414 100644 --- a/templates-v7/csharp/libraries/generichost/api_doc.mustache +++ b/templates-v7/csharp/libraries/generichost/api_doc.mustache @@ -38,23 +38,5 @@ I{{returnType}}{{^returnType}}void{{/returnType}} {{operationId}}Async({{#allPar {{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} - -### HTTP request headers - - - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} - -{{#responses.0}} - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -{{#responses}} -| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | -{{/responses}} -{{/responses.0}} - -[[Back to top]](#) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) - {{/operation}} {{/operations}} From 351a666ee1e93b11f98cb058d2e4743a5a124847 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 25 Oct 2025 19:57:32 +0200 Subject: [PATCH 069/126] Add WebhookHandler/Service mustache templates --- .../IServiceCollectionExtensions.mustache | 9 +++ .../generichost/WebhookHandler.mustache | 65 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 templates-v7/csharp/libraries/generichost/WebhookHandler.mustache diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index 79d78a94c..030090d01 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -45,6 +45,15 @@ namespace {{packageName}}.{{apiName}}.Extensions { if (!host.HttpClientsAdded) host.Add{{apiName}}HttpClients(); + + {{#models}} + {{#-first}} + {{#model.vendorExtensions.x-webhook-root}} + // Adds service for deserializing webhooks. + services.AddSingleton<{{packageName}}.{{apiName}}.Services.{{interfacePrefix}}{{apiName}}Service, {{packageName}}.{{apiName}}.Services.{{apiName}}Service>(); + {{/model.vendorExtensions.x-webhook-root}} + {{/-first}} + {{/models}} } } } diff --git a/templates-v7/csharp/libraries/generichost/WebhookHandler.mustache b/templates-v7/csharp/libraries/generichost/WebhookHandler.mustache new file mode 100644 index 000000000..57ff2384e --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/WebhookHandler.mustache @@ -0,0 +1,65 @@ +{{#lambda.trimLineBreaks}} +// +{{>partial_header}} + +{{#nrt}} +#nullable enable + +{{/nrt}} +using Microsoft.Extensions.Logging; +using System.Text.Json; +using {{packageName}}.{{modelPackage}}; + +namespace {{packageName}}.{{apiPackage}} +{ + /// + /// Interface for deserializing webhooks. + /// + {{>visibility}} interface {{interfacePrefix}}{{apiName}}Service + { + /// + /// Returns the to deserialize the json payload from the webhook. + /// + {{packageName}}.{{apiName}}.{{clientPackage}}.JsonSerializerOptionsProvider JsonSerializerOptionsProvider { get; } + + {{#models}} + {{#model.vendorExtensions.x-webhook-root}} + /// + /// Uses to attempt to deserialize . + /// + /// + {{model.name}} Deserialize{{model.name}}(string json); + + {{/model.vendorExtensions.x-webhook-root}} + {{/models}} + } + + /// + /// Service used to deserialize {{apiName}}. + /// + {{>visibility}} partial class {{apiName}}Service : {{interfacePrefix}}{{apiName}}Service + { + /// + public {{packageName}}.{{apiName}}.{{clientPackage}}.JsonSerializerOptionsProvider JsonSerializerOptionsProvider { get; } + + /// + /// Initializes the service for deserializing {{apiName}}. + /// + public {{apiName}}Service({{packageName}}.{{apiName}}.{{clientPackage}}.JsonSerializerOptionsProvider jsonSerializerOptionsProvider) + { + JsonSerializerOptionsProvider = jsonSerializerOptionsProvider; + } + + {{#models}} + {{#model.vendorExtensions.x-webhook-root}} + /// + public {{model.name}} Deserialize{{model.name}}(string json) + { + return JsonSerializer.Deserialize<{{model.name}}>(json, JsonSerializerOptionsProvider.Options); + } + + {{/model.vendorExtensions.x-webhook-root}} + {{/models}} + } +} +{{/lambda.trimLineBreaks}} From 1ae4b2ad1c08201b6a60da21a84cdb386e7884c7 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 27 Oct 2025 11:36:45 +0100 Subject: [PATCH 070/126] Allow nullable ServiceWebhookHandler --- .../csharp/libraries/generichost/WebhookHandler.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates-v7/csharp/libraries/generichost/WebhookHandler.mustache b/templates-v7/csharp/libraries/generichost/WebhookHandler.mustache index 57ff2384e..88ffa26ec 100644 --- a/templates-v7/csharp/libraries/generichost/WebhookHandler.mustache +++ b/templates-v7/csharp/libraries/generichost/WebhookHandler.mustache @@ -28,7 +28,7 @@ namespace {{packageName}}.{{apiPackage}} /// Uses to attempt to deserialize . ///
/// - {{model.name}} Deserialize{{model.name}}(string json); + {{model.name}}? Deserialize{{model.name}}(string json); {{/model.vendorExtensions.x-webhook-root}} {{/models}} @@ -53,7 +53,7 @@ namespace {{packageName}}.{{apiPackage}} {{#models}} {{#model.vendorExtensions.x-webhook-root}} /// - public {{model.name}} Deserialize{{model.name}}(string json) + public {{model.name}}? Deserialize{{model.name}}(string json) { return JsonSerializer.Deserialize<{{model.name}}>(json, JsonSerializerOptionsProvider.Options); } From bba81eac8f2342642c015cc4010814ea0ee7ccc3 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 27 Oct 2025 18:21:25 +0100 Subject: [PATCH 071/126] Moved mock tests for BalancePlatform Updated mocks to use latest OpenAPI specs data & new ids --- Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs | 1 - .../BalanceControl/BalanceControlTest.cs | 1 - .../AccountHolders/AccountHolderTest.cs | 63 ++++++++++ .../BalanceAccounts/BalanceAccountTest.cs | 108 ++++++++++++++++++ .../BalancePlatform/BalancePlatformTest.cs | 61 ++++++++++ .../PaymentInstrumentGroupTest.cs | 63 ++++++++++ .../PaymentInstrumentTest.cs | 49 ++++++++ .../TransactionRules/TransactionRuleTest.cs | 64 +++++++++++ Adyen.Test/BalancePlatformTest.cs | 22 ++-- Adyen.Test/Utilities/TestUtilities.cs | 4 +- .../mocks/balanceplatform/AccountHolder.json | 3 +- .../mocks/balanceplatform/BalanceAccount.json | 8 +- .../PaginatedAccountHoldersResponse.json | 45 +++----- .../PaginatedBalanceAccountsResponse.json | 27 +++-- .../PaginatedPaymentInstrumentsResponse.json | 10 +- .../balanceplatform/PaymentInstrument.json | 11 +- .../balanceplatform/SweepConfiguration.json | 1 + .../TransactionRuleResponse.json | 29 +++-- .../TransactionRulesResponse.json | 69 ++++++++--- .../IServiceCollectionExtensions.mustache | 8 +- .../generichost/WebhookHandler.mustache | 15 ++- 21 files changed, 564 insertions(+), 98 deletions(-) create mode 100644 Adyen.Test/BalancePlatform/AccountHolders/AccountHolderTest.cs create mode 100644 Adyen.Test/BalancePlatform/BalanceAccounts/BalanceAccountTest.cs create mode 100644 Adyen.Test/BalancePlatform/BalancePlatformTest.cs create mode 100644 Adyen.Test/BalancePlatform/PaymentInstrumentGroups/PaymentInstrumentGroupTest.cs create mode 100644 Adyen.Test/BalancePlatform/PaymentInstruments/PaymentInstrumentTest.cs create mode 100644 Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs diff --git a/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs b/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs index d26ebad14..6fa6fa0e3 100644 --- a/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs +++ b/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs @@ -1,6 +1,5 @@ using Adyen.AcsWebhooks.Extensions; using Adyen.AcsWebhooks.Models; -using Adyen.AcsWebhooks.Services; using Adyen.AcsWebhooks.Client; using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/Adyen.Test/BalanceControl/BalanceControlTest.cs b/Adyen.Test/BalanceControl/BalanceControlTest.cs index 6e0a00ab3..65b3bf4db 100644 --- a/Adyen.Test/BalanceControl/BalanceControlTest.cs +++ b/Adyen.Test/BalanceControl/BalanceControlTest.cs @@ -7,7 +7,6 @@ using Adyen.BalanceControl.Services; using Adyen.Core.Auth; using Adyen.Core.Options; -using Adyen.Test.Utilities; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/Adyen.Test/BalancePlatform/AccountHolders/AccountHolderTest.cs b/Adyen.Test/BalancePlatform/AccountHolders/AccountHolderTest.cs new file mode 100644 index 000000000..b2155a77e --- /dev/null +++ b/Adyen.Test/BalancePlatform/AccountHolders/AccountHolderTest.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using Adyen.BalancePlatform.Client; +using Adyen.BalancePlatform.Extensions; +using Adyen.BalancePlatform.Models; +using Adyen.BalancePlatform.Services; +using Adyen.Core.Options; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; + +namespace Adyen.Test.BalancePlatform.AccountHolders +{ + [TestClass] + public class AccountHolderTest : BaseTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public AccountHolderTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureBalancePlatform((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public async Task Given_AccountHolder_Deserialize_Correctly() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/AccountHolder.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Status, AccountHolder.StatusEnum.Active); + Assert.AreEqual(response.Id, "AH32272223222B5CM4MWJ892H"); + } + + [TestMethod] + public async Task Given_PaginatedBalanceAccountsResponse_Deserialize_Correctly() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/PaginatedAccountHoldersResponse.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Arrange + Assert.AreEqual(response.AccountHolders[0].Id, "AH32272223222B5GFSNSXFFL9"); + Assert.AreEqual(response.AccountHolders[0].Status, AccountHolder.StatusEnum.Active); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/BalancePlatform/BalanceAccounts/BalanceAccountTest.cs b/Adyen.Test/BalancePlatform/BalanceAccounts/BalanceAccountTest.cs new file mode 100644 index 000000000..8af1ae251 --- /dev/null +++ b/Adyen.Test/BalancePlatform/BalanceAccounts/BalanceAccountTest.cs @@ -0,0 +1,108 @@ +using System.Text.Json; +using Adyen.BalancePlatform.Client; +using Adyen.BalancePlatform.Extensions; +using Adyen.BalancePlatform.Models; +using Adyen.BalancePlatform.Services; +using Adyen.Core.Options; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; + +namespace Adyen.Test.BalancePlatform.BalanceAccounts +{ + [TestClass] + public class BalanceAccountTest : BaseTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public BalanceAccountTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureBalancePlatform((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public async Task Given_BalanceAccounts_Deserialize_Correctly() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/BalanceAccount.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Status, BalanceAccount.StatusEnum.Active); + Assert.AreEqual(response.Id, "BA3227C223222H5J4DCGQ9V9L"); + } + + [TestMethod] + public void Given_SweepConfigurationV2_Deserialize_Correctly() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/SweepConfiguration.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Status, SweepConfigurationV2.StatusEnum.Active); + Assert.AreEqual(response.Type, SweepConfigurationV2.TypeEnum.Pull); + Assert.AreEqual(response.Id, "SWPC4227C224555B5FTD2NT2JV4WN5"); + } + + [TestMethod] + public void Given_BalanceSweepConfigurationsResponse_Deserialize_Correctly() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/BalanceSweepConfigurationsResponse.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Sweeps[0].Status, SweepConfigurationV2.StatusEnum.Active); + Assert.AreEqual(response.Sweeps[0].Id, "SWPC4227C224555B5FTD2NT2JV4WN5"); + Assert.AreEqual(response.Sweeps[0].Schedule.Type, SweepSchedule.TypeEnum.Daily); + } + + [TestMethod] + public void Given_UpdateSweepConfigurationV2_Deserialize_Correctly() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/SweepConfiguration.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Status, SweepConfigurationV2.StatusEnum.Active); + Assert.AreEqual(response.Type, SweepConfigurationV2.TypeEnum.Pull); + Assert.AreEqual(response.Id, "SWPC4227C224555B5FTD2NT2JV4WN5"); + } + + [TestMethod] + public void GetBalanceAccountsIdPaymentInstrumentsTest() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/PaginatedPaymentInstrumentsResponse.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.PaymentInstruments[0].Status, PaymentInstrument.StatusEnum.Active); + Assert.AreEqual(response.PaymentInstruments[0].Id, "PI32272223222B59M5TM658DT"); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/BalancePlatform/BalancePlatformTest.cs b/Adyen.Test/BalancePlatform/BalancePlatformTest.cs new file mode 100644 index 000000000..491bca82c --- /dev/null +++ b/Adyen.Test/BalancePlatform/BalancePlatformTest.cs @@ -0,0 +1,61 @@ +using System.Text.Json; +using Adyen.BalancePlatform.Client; +using Adyen.BalancePlatform.Extensions; +using Adyen.BalancePlatform.Models; +using Adyen.Core.Options; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.BalancePlatform +{ + [TestClass] + public class BalancePlatformTest : BaseTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public BalancePlatformTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureBalancePlatform((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_BalancePlatform_Deserialize_Correctly() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/BalancePlatform.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Status, "Active"); + Assert.AreEqual(response.Id, "YOUR_BALANCE_PLATFORM"); + } + + [TestMethod] + public void Given_PaginatedAccountHoldersResponse_Deserialize_Correctly() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/PaginatedBalanceAccountsResponse.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("BA32272223222B5CTDNB66W2Z", response.BalanceAccounts[0].Id); + Assert.AreEqual(BalanceAccountBase.StatusEnum.Active, response.BalanceAccounts[1].Status); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/BalancePlatform/PaymentInstrumentGroups/PaymentInstrumentGroupTest.cs b/Adyen.Test/BalancePlatform/PaymentInstrumentGroups/PaymentInstrumentGroupTest.cs new file mode 100644 index 000000000..5ce4454c1 --- /dev/null +++ b/Adyen.Test/BalancePlatform/PaymentInstrumentGroups/PaymentInstrumentGroupTest.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using Adyen.BalancePlatform.Client; +using Adyen.BalancePlatform.Extensions; +using Adyen.BalancePlatform.Models; +using Adyen.BalancePlatform.Services; +using Adyen.Core.Options; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; + +namespace Adyen.Test.BalancePlatform.PaymentInstrumentGroups +{ + [TestClass] + public class PaymentInstrumentGroupTest : BaseTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public PaymentInstrumentGroupTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureBalancePlatform((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_PaymentInstrumentGroup_Deserialize_Correctly() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/PaymentInstrumentGroup.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Id, "PG3227C223222B5CMD3FJFKGZ"); + Assert.AreEqual(response.BalancePlatform, "YOUR_BALANCE_PLATFORM"); + } + + [TestMethod] + public void Given_TransactionRulesResponse_Deserialize_Correctly() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/TransactionRulesResponse.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Arrange + Assert.AreEqual(response.TransactionRules[0].Type, TransactionRule.TypeEnum.Velocity); + Assert.AreEqual(response.TransactionRules[0].Id, "TR3227C223222C5GXR3XP596N"); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/BalancePlatform/PaymentInstruments/PaymentInstrumentTest.cs b/Adyen.Test/BalancePlatform/PaymentInstruments/PaymentInstrumentTest.cs new file mode 100644 index 000000000..304744f6e --- /dev/null +++ b/Adyen.Test/BalancePlatform/PaymentInstruments/PaymentInstrumentTest.cs @@ -0,0 +1,49 @@ +using System.Text.Json; +using Adyen.BalancePlatform.Client; +using Adyen.BalancePlatform.Extensions; +using Adyen.BalancePlatform.Models; +using Adyen.BalancePlatform.Services; +using Adyen.Core.Options; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; + +namespace Adyen.Test.BalancePlatform.PaymentInstruments +{ + [TestClass] + public class PaymentInstrumentTest : BaseTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public PaymentInstrumentTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureBalancePlatform((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_PaymentInstrument_Deserialize_Correctly() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/PaymentInstrument.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.BalanceAccountId, "BA3227C223222B5CTBLR8BWJB"); + Assert.AreEqual(response.Type, PaymentInstrument.TypeEnum.BankAccount); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs b/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs new file mode 100644 index 000000000..bcb563e54 --- /dev/null +++ b/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using Adyen.BalancePlatform.Client; +using Adyen.BalancePlatform.Extensions; +using Adyen.BalancePlatform.Models; +using Adyen.BalancePlatform.Services; +using Adyen.Core.Options; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; + +namespace Adyen.Test.BalancePlatform.TransactionRules +{ + [TestClass] + public class TransactionRuleTest : BaseTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public TransactionRuleTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureBalancePlatform((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_TransactionRule_Deserialize_Correctly() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/TransactionRule.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.EntityKey.EntityReference, "PI3227C223222B5BPCMFXD2XG"); + Assert.AreEqual(response.EntityKey.EntityType, "paymentInstrument"); + Assert.AreEqual(response.Interval.Type, TransactionRuleInterval.TypeEnum.PerTransaction); + } + + [TestMethod] + public void Given_TransactionRuleResponse_Deserialize_Correctly() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/TransactionRuleResponse.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.TransactionRule.Id, "TR32272223222B5GFSGFLFCHM"); + Assert.AreEqual(response.TransactionRule.Interval.Type, TransactionRuleInterval.TypeEnum.PerTransaction); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/BalancePlatformTest.cs b/Adyen.Test/BalancePlatformTest.cs index 81e489e9f..80f29789b 100644 --- a/Adyen.Test/BalancePlatformTest.cs +++ b/Adyen.Test/BalancePlatformTest.cs @@ -71,8 +71,8 @@ public void GetAccountHoldersIdBalanceAccountsAsyncTest() var service = new AccountHoldersService(client); var response = service.GetAllBalanceAccountsOfAccountHolderAsync("id", offset: 1, limit: 3).Result; - Assert.AreEqual("BA32272223222B59K6ZXHBFN6", response.BalanceAccounts[0].Id); - Assert.AreEqual(BalanceAccountBase.StatusEnum.Closed, response.BalanceAccounts[1].Status); + Assert.AreEqual("BA32272223222B5CTDNB66W2Z", response.BalanceAccounts[0].Id); + Assert.AreEqual(BalanceAccountBase.StatusEnum.Active, response.BalanceAccounts[1].Status); ClientInterfaceSubstitute.Received() .RequestAsync( "https://balanceplatform-api-test.adyen.com/bcl/v2/accountHolders/id/balanceAccounts?offset=1&limit=3", @@ -94,7 +94,7 @@ public void GetBalanceAccountsIdTest() var response = service.GetBalanceAccount("AH32272223222B5CM4MWJ892H"); Assert.AreEqual(response.Status, BalanceAccount.StatusEnum.Active); - Assert.AreEqual(response.Id, "BA3227C223222B5BLP6JQC3FD"); + Assert.AreEqual(response.Id, "BA3227C223222H5J4DCGQ9V9L"); } /// @@ -111,7 +111,7 @@ public void PostBalanceAccountsTest() }; var response = service.CreateBalanceAccount(balanceAccountInfo); Assert.AreEqual(response.Status, BalanceAccount.StatusEnum.Active); - Assert.AreEqual(response.Id, "BA3227C223222B5BLP6JQC3FD"); + Assert.AreEqual(response.Id, "BA3227C223222H5J4DCGQ9V9L"); } /// @@ -122,9 +122,9 @@ public void PatchBalanceAccountsIdAsyncTest() { var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/BalanceAccount.json"); var service = new BalanceAccountsService(client); - var response = service.UpdateBalanceAccountAsync("BA3227C223222B5BLP6JQC3FD", new BalanceAccountUpdateRequest()).Result; + var response = service.UpdateBalanceAccountAsync("BA3227C223222H5J4DCGQ9V9L", new BalanceAccountUpdateRequest()).Result; Assert.AreEqual(response.Status, BalanceAccount.StatusEnum.Active); - Assert.AreEqual(response.Id, "BA3227C223222B5BLP6JQC3FD"); + Assert.AreEqual(response.Id, "BA3227C223222H5J4DCGQ9V9L"); } /// @@ -227,7 +227,7 @@ public void GetBalancePlatformsIdAccountHoldersTest() var service = new PlatformService(client); var response = service.GetAllAccountHoldersUnderBalancePlatform("uniqueIdentifier"); - Assert.AreEqual(response.AccountHolders[0].Id, "AH32272223222B59DDWSCCMP7"); + Assert.AreEqual(response.AccountHolders[0].Id, "AH32272223222B5GFSNSXFFL9"); Assert.AreEqual(response.AccountHolders[0].Status, AccountHolder.StatusEnum.Active); } @@ -274,7 +274,7 @@ public void GetPaymentInstrumentGroupsIdTransactionRulesTest() var response = service.GetAllTransactionRulesForPaymentInstrumentGroup("id"); Assert.AreEqual(response.TransactionRules[0].Type, TransactionRule.TypeEnum.Velocity); - Assert.AreEqual(response.TransactionRules[0].Id, "TR32272223222B5CMDGMC9F4F"); + Assert.AreEqual(response.TransactionRules[0].Id, "TR3227C223222C5GXR3XP596N"); } #endregion @@ -333,7 +333,7 @@ public void GetPaymentInstrumentsIdTransactionRulesTest() var service = new PaymentInstrumentsService(client); var response = service.GetAllTransactionRulesForPaymentInstrument("id"); - Assert.AreEqual(response.TransactionRules[0].Id, "TR32272223222B5CMDGMC9F4F"); + Assert.AreEqual(response.TransactionRules[0].Id, "TR3227C223222C5GXR3XP596N"); Assert.AreEqual(response.TransactionRules[0].Type, TransactionRule.TypeEnum.Velocity); } @@ -381,8 +381,8 @@ public void GetTransactionRulesTransactionRuleIdTest() var service = new TransactionRulesService(client); var response = service.GetTransactionRule("transactionRuleId"); - Assert.AreEqual(response.TransactionRule.Id, "TR32272223222B5CMD3V73HXG"); - Assert.AreEqual(response.TransactionRule.Interval.Type, TransactionRuleInterval.TypeEnum.Monthly); + Assert.AreEqual(response.TransactionRule.Id, "TR32272223222B5GFSGFLFCHM"); + Assert.AreEqual(response.TransactionRule.Interval.Type, TransactionRuleInterval.TypeEnum.PerTransaction); } /// diff --git a/Adyen.Test/Utilities/TestUtilities.cs b/Adyen.Test/Utilities/TestUtilities.cs index 39b052bdc..15694e0d7 100644 --- a/Adyen.Test/Utilities/TestUtilities.cs +++ b/Adyen.Test/Utilities/TestUtilities.cs @@ -1,6 +1,6 @@ -namespace Adyen.Test.Utilities +namespace Adyen.Test { - public class TestUtilities + internal static class TestUtilities { public static string GetTestFileContent(string relativePath) { diff --git a/Adyen.Test/mocks/balanceplatform/AccountHolder.json b/Adyen.Test/mocks/balanceplatform/AccountHolder.json index 8c75be5a9..4f8c64960 100644 --- a/Adyen.Test/mocks/balanceplatform/AccountHolder.json +++ b/Adyen.Test/mocks/balanceplatform/AccountHolder.json @@ -11,9 +11,10 @@ "email": "s.hopper@example.com", "phone": { "number": "+315551231234", - "type": "Mobile" + "type": "mobile" } }, + "legalEntityId": "LE322JV223222D5GG42KN6869", "description": "S.Hopper - Staff 123", "id": "AH32272223222B5CM4MWJ892H", "status": "active" diff --git a/Adyen.Test/mocks/balanceplatform/BalanceAccount.json b/Adyen.Test/mocks/balanceplatform/BalanceAccount.json index 5e7d9ba9e..f36f0a1bb 100644 --- a/Adyen.Test/mocks/balanceplatform/BalanceAccount.json +++ b/Adyen.Test/mocks/balanceplatform/BalanceAccount.json @@ -1,6 +1,8 @@ { - "accountHolderId": "AH32272223222B59K6RTQBFNZ", + "accountHolderId": "AH32272223222C5GXTD343TKP", "defaultCurrencyCode": "EUR", + "description": "S.Hopper - Main balance account", + "timeZone": "Europe/Amsterdam", "balances": [ { "available": 0, @@ -9,6 +11,6 @@ "reserved": 0 } ], - "id": "BA3227C223222B5BLP6JQC3FD", - "status": "Active" + "id": "BA3227C223222H5J4DCGQ9V9L", + "status": "active" } \ No newline at end of file diff --git a/Adyen.Test/mocks/balanceplatform/PaginatedAccountHoldersResponse.json b/Adyen.Test/mocks/balanceplatform/PaginatedAccountHoldersResponse.json index 4b65c66f5..be1201a7c 100644 --- a/Adyen.Test/mocks/balanceplatform/PaginatedAccountHoldersResponse.json +++ b/Adyen.Test/mocks/balanceplatform/PaginatedAccountHoldersResponse.json @@ -1,34 +1,27 @@ { "accountHolders": [ { - "contactDetails": { - "address": { - "city": "Amsterdam", - "country": "NL", - "houseNumberOrName": "6", - "postalCode": "12336750", - "street": "Simon Carmiggeltstraat" - } - }, - "description": "J. Doe", - "id": "AH32272223222B59DDWSCCMP7", - "status": "Active" + "description": "Test-305", + "legalEntityId": "LE3227C223222D5D8S5S33M4M", + "reference": "LegalEntity internal error test", + "id": "AH32272223222B5GFSNSXFFL9", + "status": "active" }, { - "contactDetails": { - "address": { - "city": "Amsterdam", - "country": "NL", - "houseNumberOrName": "11", - "postalCode": "12336750", - "street": "Simon Carmiggeltstraat" - } - }, - "description": "S. Hopper", - "id": "AH32272223222B59DJ7QBCMPN", - "status": "Active" + "description": "Test-751", + "legalEntityId": "LE3227C223222D5D8S5TT3SRX", + "reference": "LegalEntity internal error test", + "id": "AH32272223222B5GFSNVGFFM7", + "status": "active" + }, + { + "description": "Explorer Holder", + "legalEntityId": "LE3227C223222D5D8S5TT3SRX", + "reference": "Account from the Explorer Holder", + "id": "AH32272223222B5GFWNRFFVR6", + "status": "active" } ], - "hasNext": "true", - "hasPrevious": "false" + "hasNext": true, + "hasPrevious": true } \ No newline at end of file diff --git a/Adyen.Test/mocks/balanceplatform/PaginatedBalanceAccountsResponse.json b/Adyen.Test/mocks/balanceplatform/PaginatedBalanceAccountsResponse.json index 58706682f..fb1bc8842 100644 --- a/Adyen.Test/mocks/balanceplatform/PaginatedBalanceAccountsResponse.json +++ b/Adyen.Test/mocks/balanceplatform/PaginatedBalanceAccountsResponse.json @@ -1,22 +1,31 @@ { "balanceAccounts": [ { - "accountHolderId": "AH32272223222B59K6ZKBBFNQ", + "accountHolderId": "AH32272223222B5CTBMZT6W2V", "defaultCurrencyCode": "EUR", - "id": "BA32272223222B59K6ZXHBFN6", - "status": "Active" + "description": "S. Hopper - Main Account", + "reference": "YOUR_REFERENCE-X173L", + "timeZone": "Europe/Amsterdam", + "id": "BA32272223222B5CTDNB66W2Z", + "status": "active" }, { - "accountHolderId": "AH32272223222B59K6ZKBBFNQ", + "accountHolderId": "AH32272223222B5CTBMZT6W2V", "defaultCurrencyCode": "EUR", - "id": "BA32272223222B59K72CKBFNJ", - "status": "closed" + "description": "S. Hopper - Main Account", + "reference": "YOUR_REFERENCE-X173L", + "timeZone": "Europe/Amsterdam", + "id": "BA32272223222B5CTDQPM6W2H", + "status": "active" }, { - "accountHolderId": "AH32272223222B59K6ZKBBFNQ", + "accountHolderId": "AH32272223222B5CTBMZT6W2V", "defaultCurrencyCode": "EUR", - "id": "BA32272223222B5BRR27B2M7G", - "status": "Active" + "description": "S. Hopper - Main Account", + "reference": "YOUR_REFERENCE-X173L", + "timeZone": "Europe/Amsterdam", + "id": "BA32272223222B5CVF5J63LMW", + "status": "active" } ], "hasNext": true, diff --git a/Adyen.Test/mocks/balanceplatform/PaginatedPaymentInstrumentsResponse.json b/Adyen.Test/mocks/balanceplatform/PaginatedPaymentInstrumentsResponse.json index 23bf0add2..585cfdc6d 100644 --- a/Adyen.Test/mocks/balanceplatform/PaginatedPaymentInstrumentsResponse.json +++ b/Adyen.Test/mocks/balanceplatform/PaginatedPaymentInstrumentsResponse.json @@ -1,13 +1,14 @@ { - "hasNext": "true", - "hasPrevious": "false", + "hasNext": true, + "hasPrevious": false, "paymentInstruments": [ { "balanceAccountId": "BA32272223222B59CZ3T52DKZ", "issuingCountryCode": "GB", - "status": "Active", + "status": "active", "type": "card", "card": { + "brand": "mc", "brandVariant": "mc", "cardholderName": "name", "formFactor": "virtual", @@ -24,9 +25,10 @@ { "balanceAccountId": "BA32272223222B59CZ3T52DKZ", "issuingCountryCode": "GB", - "status": "Active", + "status": "active", "type": "card", "card": { + "brand": "mc", "brandVariant": "mc", "cardholderName": "name", "formFactor": "virtual", diff --git a/Adyen.Test/mocks/balanceplatform/PaymentInstrument.json b/Adyen.Test/mocks/balanceplatform/PaymentInstrument.json index ab6c7493e..48984ca79 100644 --- a/Adyen.Test/mocks/balanceplatform/PaymentInstrument.json +++ b/Adyen.Test/mocks/balanceplatform/PaymentInstrument.json @@ -1,6 +1,13 @@ { + "balanceAccountId": "BA3227C223222B5CTBLR8BWJB", + "issuingCountryCode": "NL", + "status": "active", "type": "bankAccount", "description": "YOUR_DESCRIPTION", - "balanceAccountId": "BA3227C223222B5CTBLR8BWJB", - "issuingCountryCode": "NL" + "bankAccount": { + "formFactor": "physical", + "type": "iban", + "iban": "NL20ADYB2017000035" + }, + "id": "PI322LJ223222B5DJS7CD9LWL" } \ No newline at end of file diff --git a/Adyen.Test/mocks/balanceplatform/SweepConfiguration.json b/Adyen.Test/mocks/balanceplatform/SweepConfiguration.json index 719d05edc..f27b44936 100644 --- a/Adyen.Test/mocks/balanceplatform/SweepConfiguration.json +++ b/Adyen.Test/mocks/balanceplatform/SweepConfiguration.json @@ -1,4 +1,5 @@ { + "id": "SWPC4227C224555B5FTD2NT2JV4WN5", "counterparty": { "merchantAccount": "YOUR_MERCHANT_ACCOUNT" }, diff --git a/Adyen.Test/mocks/balanceplatform/TransactionRuleResponse.json b/Adyen.Test/mocks/balanceplatform/TransactionRuleResponse.json index 8477e3717..fa6007f21 100644 --- a/Adyen.Test/mocks/balanceplatform/TransactionRuleResponse.json +++ b/Adyen.Test/mocks/balanceplatform/TransactionRuleResponse.json @@ -1,15 +1,28 @@ { "transactionRule": { - "description": "Allow 5 transactions per month", + "description": "Only allow point-of-sale transactions", + "entityKey": { + "entityReference": "PI3227C223222B5FN65FN5NS9", + "entityType": "paymentInstrument" + }, "interval": { - "type": "monthly" + "timeZone": "UTC", + "type": "perTransaction" + }, + "outcomeType": "hardBlock", + "reference": "YOUR_REFERENCE_4F7346", + "requestType": "authorization", + "ruleRestrictions": { + "processingTypes": { + "operation": "noneMatch", + "value": [ + "pos" + ] + } }, - "maxTransactions": 5, - "paymentInstrumentId": "PI3227C223222B59KGTXP884R", - "reference": "myRule12345", - "startDate": "2021-01-25T12:46:35", + "startDate": "2022-08-02T16:07:00.851374+02:00", "status": "active", - "type": "velocity", - "id": "TR32272223222B5CMD3V73HXG" + "type": "blockList", + "id": "TR32272223222B5GFSGFLFCHM" } } \ No newline at end of file diff --git a/Adyen.Test/mocks/balanceplatform/TransactionRulesResponse.json b/Adyen.Test/mocks/balanceplatform/TransactionRulesResponse.json index 89b977c5f..57b77005a 100644 --- a/Adyen.Test/mocks/balanceplatform/TransactionRulesResponse.json +++ b/Adyen.Test/mocks/balanceplatform/TransactionRulesResponse.json @@ -1,33 +1,66 @@ { "transactionRules": [ { - "description": "Allow 5 transactions per month", + "aggregationLevel": "paymentInstrument", + "description": "Up to 1000 EUR per card for the last 12 hours", + "entityKey": { + "entityReference": "PG3227C223222C5GXR3M5592Q", + "entityType": "paymentInstrumentGroup" + }, "interval": { - "type": "monthly" + "duration": { + "unit": "hours", + "value": 12 + }, + "timeZone": "UTC", + "type": "sliding" }, - "maxTransactions": 5, - "paymentInstrumentGroupId": "PG3227C223222B5CMD3FJFKGZ", - "reference": "myRule12345", - "startDate": "2021-01-25T12:46:35", - "status": "active", + "outcomeType": "hardBlock", + "reference": "YOUR_REFERENCE_2918A", + "requestType": "authorization", + "ruleRestrictions": { + "totalAmount": { + "operation": "greaterThan", + "value": { + "currency": "EUR", + "value": 100000 + } + } + }, + "status": "inactive", "type": "velocity", - "id": "TR32272223222B5CMDGMC9F4F" + "id": "TR3227C223222C5GXR3XP596N" }, { - "amount": { - "currency": "EUR", - "value": 10000 + "aggregationLevel": "paymentInstrument", + "description": "NL only", + "entityKey": { + "entityReference": "PG3227C223222C5GXR3M5592Q", + "entityType": "paymentInstrumentGroup" }, - "description": "Allow up to 100 EUR per month", "interval": { - "type": "monthly" + "duration": { + "unit": "hours", + "value": 12 + }, + "timeZone": "UTC", + "type": "sliding" + }, + "outcomeType": "hardBlock", + "reference": "myRule12345", + "requestType": "authorization", + "ruleRestrictions": { + "totalAmount": { + "operation": "greaterThan", + "value": { + "currency": "EUR", + "value": 100000 + } + } }, - "paymentInstrumentGroupId": "PG3227C223222B5CMD3FJFKGZ", - "reference": "myRule16378", - "startDate": "2021-01-25T12:46:35", - "status": "active", + "status": "inactive", "type": "velocity", - "id": "TR32272223222B5CMDGT89F4F" + "id": "TR3227C223222C5GXR3WC595H" } ] } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index 030090d01..1123be43c 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -47,12 +47,12 @@ namespace {{packageName}}.{{apiName}}.Extensions host.Add{{apiName}}HttpClients(); {{#models}} - {{#-first}} {{#model.vendorExtensions.x-webhook-root}} - // Adds service for deserializing webhooks. - services.AddSingleton<{{packageName}}.{{apiName}}.Services.{{interfacePrefix}}{{apiName}}Service, {{packageName}}.{{apiName}}.Services.{{apiName}}Service>(); + {{#first}} + // Adds utility handler for deserializing webhooks. + services.AddSingleton<{{packageName}}.{{apiName}}.Handlers.{{interfacePrefix}}{{apiName}}Handler, {{packageName}}.{{apiName}}.Handlers.{{apiName}}Handler>(); + {{/first}} {{/model.vendorExtensions.x-webhook-root}} - {{/-first}} {{/models}} } } diff --git a/templates-v7/csharp/libraries/generichost/WebhookHandler.mustache b/templates-v7/csharp/libraries/generichost/WebhookHandler.mustache index 88ffa26ec..19006ee83 100644 --- a/templates-v7/csharp/libraries/generichost/WebhookHandler.mustache +++ b/templates-v7/csharp/libraries/generichost/WebhookHandler.mustache @@ -10,42 +10,41 @@ using Microsoft.Extensions.Logging; using System.Text.Json; using {{packageName}}.{{modelPackage}}; -namespace {{packageName}}.{{apiPackage}} +namespace {{packageName}}.{{apiName}}.Handlers { /// /// Interface for deserializing webhooks. /// - {{>visibility}} interface {{interfacePrefix}}{{apiName}}Service + {{>visibility}} interface {{interfacePrefix}}{{apiName}}Handler { /// /// Returns the to deserialize the json payload from the webhook. /// {{packageName}}.{{apiName}}.{{clientPackage}}.JsonSerializerOptionsProvider JsonSerializerOptionsProvider { get; } - {{#models}} {{#model.vendorExtensions.x-webhook-root}} + /// /// Uses to attempt to deserialize . /// /// {{model.name}}? Deserialize{{model.name}}(string json); - {{/model.vendorExtensions.x-webhook-root}} {{/models}} } /// - /// Service used to deserialize {{apiName}}. + /// Handler utility function used to deserialize {{apiName}}. /// - {{>visibility}} partial class {{apiName}}Service : {{interfacePrefix}}{{apiName}}Service + {{>visibility}} partial class {{apiName}}Handler : {{interfacePrefix}}{{apiName}}Handler { /// public {{packageName}}.{{apiName}}.{{clientPackage}}.JsonSerializerOptionsProvider JsonSerializerOptionsProvider { get; } /// - /// Initializes the service for deserializing {{apiName}}. + /// Initializes the handler utility for deserializing {{apiName}}. /// - public {{apiName}}Service({{packageName}}.{{apiName}}.{{clientPackage}}.JsonSerializerOptionsProvider jsonSerializerOptionsProvider) + public {{apiName}}Handler({{packageName}}.{{apiName}}.{{clientPackage}}.JsonSerializerOptionsProvider jsonSerializerOptionsProvider) { JsonSerializerOptionsProvider = jsonSerializerOptionsProvider; } From 12cce6c47d6516fce053311dc038f7a0b424e757 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 27 Oct 2025 20:24:51 +0100 Subject: [PATCH 072/126] Move TerminalApi Tests --- Adyen.Test/BinLookup/BinLookupTest.cs | 67 +++++++++++++++++++ Adyen.Test/Checkout/PaymentsServiceTest.cs | 64 +++++++++++++++++- Adyen.Test/ReadmeTest.cs | 43 ------------ .../{ => TerminalApi}/MockPosApiRequest.cs | 0 Adyen.Test/{ => TerminalApi}/RegionTest.cs | 0 .../TerminalApiAsyncServiceTest.cs | 0 .../TerminalApiCloudRequestTest.cs | 0 .../{ => TerminalApi}/TerminalApiInputTest.cs | 0 .../TerminalApiLocalServiceTest.cs | 0 .../TerminalApiPosRequestTest.cs | 0 .../TerminalApiPosSecurityTest.cs | 0 .../TerminalApiSerializerTest.cs} | 62 ----------------- .../TerminalApiSyncServiceTest.cs | 0 .../TerminalCommonNameValidatorTest.cs | 0 14 files changed, 130 insertions(+), 106 deletions(-) create mode 100644 Adyen.Test/BinLookup/BinLookupTest.cs delete mode 100644 Adyen.Test/ReadmeTest.cs rename Adyen.Test/{ => TerminalApi}/MockPosApiRequest.cs (100%) rename Adyen.Test/{ => TerminalApi}/RegionTest.cs (100%) rename Adyen.Test/{ => TerminalApi}/TerminalApiAsyncServiceTest.cs (100%) rename Adyen.Test/{ => TerminalApi}/TerminalApiCloudRequestTest.cs (100%) rename Adyen.Test/{ => TerminalApi}/TerminalApiInputTest.cs (100%) rename Adyen.Test/{ => TerminalApi}/TerminalApiLocalServiceTest.cs (100%) rename Adyen.Test/{ => TerminalApi}/TerminalApiPosRequestTest.cs (100%) rename Adyen.Test/{ => TerminalApi}/TerminalApiPosSecurityTest.cs (100%) rename Adyen.Test/{SerializerTest.cs => TerminalApi/TerminalApiSerializerTest.cs} (66%) rename Adyen.Test/{ => TerminalApi}/TerminalApiSyncServiceTest.cs (100%) rename Adyen.Test/{ => TerminalApi}/TerminalCommonNameValidatorTest.cs (100%) diff --git a/Adyen.Test/BinLookup/BinLookupTest.cs b/Adyen.Test/BinLookup/BinLookupTest.cs new file mode 100644 index 000000000..51c7613f1 --- /dev/null +++ b/Adyen.Test/BinLookup/BinLookupTest.cs @@ -0,0 +1,67 @@ +using System.Text.Json; +using Adyen.BinLookup.Client; +using Adyen.BinLookup.Extensions; +using Adyen.BinLookup.Models; +using Adyen.Core.Options; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.BinLookup +{ + [TestClass] + public class BinLookupTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public BinLookupTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureBinLookup((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public void Get3dsAvailabilitySuccessMockedTest() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/binlookup/get3dsavailability-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("F013371337", response.DsPublicKeys[0].DirectoryServerId); + Assert.AreEqual("visa", response.DsPublicKeys[0].Brand); + Assert.AreEqual("411111111111", response.ThreeDS2CardRangeDetails[0].StartRange); + Assert.AreEqual("411111111111", response.ThreeDS2CardRangeDetails[0].EndRange); + Assert.AreEqual("2.1.0", response.ThreeDS2CardRangeDetails[0].ThreeDS2Versions.FirstOrDefault()); + Assert.AreEqual("https://pal-test.adyen.com/threeds2simulator/acs/startMethod.shtml", response.ThreeDS2CardRangeDetails[0].ThreeDSMethodURL); + Assert.AreEqual(true, response.ThreeDS1Supported); + Assert.AreEqual(true, response.ThreeDS2supported); + } + + [TestMethod] + public void GetCostEstimateSuccessMockedTest() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/binlookup/getcostestimate-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("1111", response.CardBin.Summary); + Assert.AreEqual("Unsupported", response.ResultCode); + } + } +} diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index c3e97c4dd..34275c68b 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -1,3 +1,4 @@ +using System.Text; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; @@ -5,8 +6,9 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; -using System.Text.Json; using Adyen.Core.Options; +using Newtonsoft.Json; +using JsonSerializer = System.Text.Json.JsonSerializer; namespace Adyen.Test.Checkout { @@ -256,5 +258,65 @@ public async Task Given_ConfigureCheckout_When_No_Options_Provided_Then_HttpClie testHost.Services.GetRequiredService(); }); } + + // [TestMethod] + // public void Given_CreateCheckoutSessionRequest_When_Serialize_Result_Contains_Zeros() + // { + // var checkoutSessionRequest = new CreateCheckoutSessionRequest( + // amount: new Amount("EUR", 10000L), + // merchantAccount: "merchantAccount", + // reference: "TestReference", + // returnUrl: "http://test-url.com", + // channel: CreateCheckoutSessionRequest.ChannelEnum.Web, + // countryCode: "NL", + // lineItems: new List() { + // new LineItem(quantity: 1, amountIncludingTax: 5000, description: "description1", amountExcludingTax: 0), + // new LineItem(quantity: 1, amountIncludingTax: 5000, description: "description2", taxAmount: 0) + // } + // ); + // string result = JsonSerializer.Serialize(checkoutSessionRequest); + // + // // Assert that Long parameters set to zero are actually serialised (just like Int) + // Assert.IsTrue(result.Contains("amountExcludingTax\": 0,")); + // Assert.IsTrue(result.Contains("taxAmount\": 0")); + // } + + // [TestMethod] + // public void Given_CreateCheckoutSessionResponse_When_Deserialize_Returns_Correctly() + // { + // string json = @"{""mode"": ""embedded"",""amount"": {""currency"": ""EUR"",""value"": 10000},""expiresAt"": ""2023-04-06T17:11:15+02:00"",""id"": ""CS0068299CB8DA273A"",""merchantAccount"": ""TestMerchantAccount"",""reference"": ""TestReference"",""returnUrl"": ""http://test-url.com"",""sessionData"": ""Ab02b4c0!BQABAgBoacRJuRbNM/typUKATopkZ3V+cINm0WTAvwl9uQJ2e8I00P2KFemlwp4nb1bOqqYh1zx48gDAHt0QDs2JTiQIqDQRizqopLFRk/wAJHFoCuam/GvOHflg9vwS3caHbkBToIolxcYcJoJheIN9o1fGmNIHZb9VrWfiKsXMgmYsSUifenayS2tkKCTquF7vguaAwk7q5ES1GDwzP/J2mChJGH04jGrVL4szPHGmznr897wIcFQyBSZe4Uifqoe0fpiIxZLNWadLMya6SnvQYNAQL1V6ti+7F4wHHyLwHWTCua993sttue70TE4918EV80HcAWx0LE1+uW6J5KBHCKdYNi9ESlGSZreRwLCpdNbmumB6MlyHZlz2umLiw0ZZJAEpdrwXA2NiyHzJDKDKfbAhd8uoTSACrbgwbrAXI1cvb1WjiOQjLn9MVW++fuJCq6vIeX+rUKMeltBAHMeBZyC54ndAucw9nS03uyckjphunE4tl4WTT475VkfUiyJCTT3S2IOVYS9V9M8pMQ1/GlDVNCLBJJfrYlVXoC8VX68QW1HERkhNYQbTgLQ9kI3cDeMP5d4TuUL3XR2Q6sNiOMdIPGDYQ9QFKFdOE3OQ5X9wxUYbX6j88wR2gRGJcS5agqFHOR1ZTNrjumOYrEkjL8ehFXEs/KluhURllfi0POUPGAwlUWBjDCZcKaeeR0kASnsia2V5IjoiQUYwQUFBMTAzQ0E1MzdFQUVEODdDMjRERDUzOTA5QjgwQTc4QTkyM0UzODIzRDY4REFDQzk0QjlGRjgzMDVEQyJ9E0Gs1T0RaO7NluuXP59fegcW6SQKq4BhC3ZzEKPm1vJuwAJ2gZUaicaXbRPW3IyadavKRlfGdFeAYt2B3ik8fGiK3ZkKU0CrZ0qL0IO5rrWrOg74HMnpxRAn1RhAHRHfGEk67FFPNjr0aLBJXSia7xZWiyKA+i4QU63roY2sxMI/q41mvJjRUz0rPKT3SbVDt1Of7K7BP8cmiboBkWexFBD/mkJyMOpYAOoFp/tKOUHTWZYcc1GpbyV1jInXVfEUhHROYCtS4p/xwF6DdT3bI0+HRU35/xNBTZH2yJN55u9i42Vb0ddCyhzOLZYQ3JVgglty6hLgVeQzuN4b2MoalhfTl11HsElJT1kB0mznVX8CL7UMTUp/2uSgL8DN6kB4owEZ45nWRxIR/2sCidMJ1tnSI1uSqkeqXRf1vat5qPq+BzpYE0Urn2ZZEmgJyb2u0ZLn2x1tfJyPtv+hqBoT7iqJ224dSbuB4HMT49YtcheUtR0jnrImJXm+M1TeIjWB3XWOScrNV8sWEJMAiIU="",""shopperLocale"": ""en-US""}"; + // + // var response = JsonConvert.DeserializeObject(json); + // Assert.IsNotNull(response.Id); + // } + + + // [TestMethod] + // public void SerializeByteArrayTest() + // { + // byte[] plainTextBytes = Encoding.ASCII.GetBytes("Bytes-To-Be-Encoded"); + // string base64String = System.Convert.ToBase64String(plainTextBytes); + // var base64Bytes = Encoding.ASCII.GetBytes(base64String); + // var threeDSecure = new ThreeDSecureData + // { + // Cavv = base64Bytes, + // Xid = base64Bytes + // }; + // string jsonRequest = Util.JsonOperation.SerializeRequest(threeDSecure); + // string json = "{\"cavv\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\",\"xid\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\"}"; + // Assert.AreEqual(json, jsonRequest); + // } + + // [TestMethod] + // public void DeserializeByteArrayTest() + // { + // string json = "{\"cavv\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\",\"xid\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\"}"; + // ThreeDSecureData jsonRequest = Util.JsonOperation.Deserialize(json); + // string xid = Encoding.ASCII.GetString(jsonRequest.Xid); + // string cavv = Encoding.ASCII.GetString(jsonRequest.Cavv); + // string jsonElementBase64 = "Qnl0ZXMtVG8tQmUtRW5jb2RlZA=="; + // Assert.AreEqual(jsonElementBase64, xid); + // Assert.AreEqual(jsonElementBase64, cavv); + // } } } \ No newline at end of file diff --git a/Adyen.Test/ReadmeTest.cs b/Adyen.Test/ReadmeTest.cs deleted file mode 100644 index b9e177d61..000000000 --- a/Adyen.Test/ReadmeTest.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Adyen; -using Adyen.Model.Checkout; -using Adyen.Service.Checkout; -using Environment = Adyen.Model.Environment; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - [TestClass] - public class ReadmeTest - { - //Only test if compiles properly. It is not an integration test - [TestMethod] - public void PaymentTest() - { - var config = new Config() - { - XApiKey = "your-api-key", - Environment = Environment.Test - }; - var client = new AdyenClient(config); - var paymentsService = new PaymentsService(client); - var amount = new Model.Checkout.Amount("USD", 1000); - var cardDetails = new CardDetails - { - EncryptedCardNumber = "test_4111111111111111", - EncryptedSecurityCode = "test_737", - EncryptedExpiryMonth = "test_03", - EncryptedExpiryYear = "test_2030", - HolderName = "John Smith", - Type = CardDetails.TypeEnum.Card - }; - var paymentsRequest = new Model.Checkout.PaymentRequest - { - Reference = "Your order number ", - ReturnUrl = @"https://your-company.com/...", - MerchantAccount = "your-merchant-account", - Amount = amount, - PaymentMethod = new CheckoutPaymentMethod(cardDetails) - }; - } - } -} \ No newline at end of file diff --git a/Adyen.Test/MockPosApiRequest.cs b/Adyen.Test/TerminalApi/MockPosApiRequest.cs similarity index 100% rename from Adyen.Test/MockPosApiRequest.cs rename to Adyen.Test/TerminalApi/MockPosApiRequest.cs diff --git a/Adyen.Test/RegionTest.cs b/Adyen.Test/TerminalApi/RegionTest.cs similarity index 100% rename from Adyen.Test/RegionTest.cs rename to Adyen.Test/TerminalApi/RegionTest.cs diff --git a/Adyen.Test/TerminalApiAsyncServiceTest.cs b/Adyen.Test/TerminalApi/TerminalApiAsyncServiceTest.cs similarity index 100% rename from Adyen.Test/TerminalApiAsyncServiceTest.cs rename to Adyen.Test/TerminalApi/TerminalApiAsyncServiceTest.cs diff --git a/Adyen.Test/TerminalApiCloudRequestTest.cs b/Adyen.Test/TerminalApi/TerminalApiCloudRequestTest.cs similarity index 100% rename from Adyen.Test/TerminalApiCloudRequestTest.cs rename to Adyen.Test/TerminalApi/TerminalApiCloudRequestTest.cs diff --git a/Adyen.Test/TerminalApiInputTest.cs b/Adyen.Test/TerminalApi/TerminalApiInputTest.cs similarity index 100% rename from Adyen.Test/TerminalApiInputTest.cs rename to Adyen.Test/TerminalApi/TerminalApiInputTest.cs diff --git a/Adyen.Test/TerminalApiLocalServiceTest.cs b/Adyen.Test/TerminalApi/TerminalApiLocalServiceTest.cs similarity index 100% rename from Adyen.Test/TerminalApiLocalServiceTest.cs rename to Adyen.Test/TerminalApi/TerminalApiLocalServiceTest.cs diff --git a/Adyen.Test/TerminalApiPosRequestTest.cs b/Adyen.Test/TerminalApi/TerminalApiPosRequestTest.cs similarity index 100% rename from Adyen.Test/TerminalApiPosRequestTest.cs rename to Adyen.Test/TerminalApi/TerminalApiPosRequestTest.cs diff --git a/Adyen.Test/TerminalApiPosSecurityTest.cs b/Adyen.Test/TerminalApi/TerminalApiPosSecurityTest.cs similarity index 100% rename from Adyen.Test/TerminalApiPosSecurityTest.cs rename to Adyen.Test/TerminalApi/TerminalApiPosSecurityTest.cs diff --git a/Adyen.Test/SerializerTest.cs b/Adyen.Test/TerminalApi/TerminalApiSerializerTest.cs similarity index 66% rename from Adyen.Test/SerializerTest.cs rename to Adyen.Test/TerminalApi/TerminalApiSerializerTest.cs index 26819b1c5..86e9264d7 100644 --- a/Adyen.Test/SerializerTest.cs +++ b/Adyen.Test/TerminalApi/TerminalApiSerializerTest.cs @@ -3,7 +3,6 @@ using System.Text; using Adyen.ApiSerialization; using Adyen.Constants; -using Adyen.Model.Checkout; using Adyen.Model.Terminal; using Adyen.Model.TerminalApi; using Adyen.Model.TerminalApi.Message; @@ -21,34 +20,6 @@ namespace Adyen.Test [TestClass] public class SerializerTest { - [TestMethod] - public void SerializeByteArrayTest() - { - var plainTextBytes = Encoding.ASCII.GetBytes("Bytes-To-Be-Encoded"); - string base64String = System.Convert.ToBase64String(plainTextBytes); - var base64Bytes = Encoding.ASCII.GetBytes(base64String); - var threeDSecure = new ThreeDSecureData - { - Cavv = base64Bytes, - Xid = base64Bytes - }; - var jsonRequest = Util.JsonOperation.SerializeRequest(threeDSecure); - var json = "{\"cavv\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\",\"xid\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\"}"; - Assert.AreEqual(json, jsonRequest); - } - - [TestMethod] - public void DeserializeByteArrayTest() - { - var json = "{\"cavv\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\",\"xid\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\"}"; - var jsonRequest = Util.JsonOperation.Deserialize(json); - var xid = Encoding.ASCII.GetString(jsonRequest.Xid); - var cavv = Encoding.ASCII.GetString(jsonRequest.Cavv); - var jsonElementBase64 = "Qnl0ZXMtVG8tQmUtRW5jb2RlZA=="; - Assert.AreEqual(jsonElementBase64, xid); - Assert.AreEqual(jsonElementBase64, cavv); - } - [TestMethod] public void EnumSerializerTest() { @@ -60,40 +31,7 @@ public void EnumSerializerTest() Assert.AreEqual(paymentResponseOnline.PaymentResult.AuthenticationMethod[0], AuthenticationMethodType.OnLinePIN); Assert.AreEqual(paymentResponseOnLine.PaymentResult.AuthenticationMethod[0], AuthenticationMethodType.OnLinePIN); } - - [TestMethod] - public void CheckoutLongSerializationTest() - { - var checkoutSessionRequest = new CreateCheckoutSessionRequest - { - MerchantAccount = "merchantAccount", - Reference = "TestReference", - ReturnUrl = "http://test-url.com", - Amount = new Model.Checkout.Amount("EUR", 10000L), - Channel = CreateCheckoutSessionRequest.ChannelEnum.Web, - CountryCode = "NL", - LineItems = new List() - { - new LineItem(quantity: 1, amountIncludingTax: 5000, description: "description1", - amountExcludingTax: 0), - new LineItem(quantity: 1, amountIncludingTax: 5000, description: "description2", taxAmount: 0) - } - }.ToJson(); - // Assert that Long parameters set to zero are actually serialised (just like Int) - Assert.IsTrue(checkoutSessionRequest.Contains("amountExcludingTax\": 0,")); - Assert.IsTrue(checkoutSessionRequest.Contains("taxAmount\": 0")); - } - [TestMethod] - public void CheckoutSessionResponseCheckForIdTest() - { - var sessionResponse = @"{""mode"": ""embedded"",""amount"": {""currency"": ""EUR"",""value"": 10000},""expiresAt"": ""2023-04-06T17:11:15+02:00"",""id"": ""CS0068299CB8DA273A"",""merchantAccount"": ""TestMerchantAccount"",""reference"": ""TestReference"",""returnUrl"": ""http://test-url.com"",""sessionData"": ""Ab02b4c0!BQABAgBoacRJuRbNM/typUKATopkZ3V+cINm0WTAvwl9uQJ2e8I00P2KFemlwp4nb1bOqqYh1zx48gDAHt0QDs2JTiQIqDQRizqopLFRk/wAJHFoCuam/GvOHflg9vwS3caHbkBToIolxcYcJoJheIN9o1fGmNIHZb9VrWfiKsXMgmYsSUifenayS2tkKCTquF7vguaAwk7q5ES1GDwzP/J2mChJGH04jGrVL4szPHGmznr897wIcFQyBSZe4Uifqoe0fpiIxZLNWadLMya6SnvQYNAQL1V6ti+7F4wHHyLwHWTCua993sttue70TE4918EV80HcAWx0LE1+uW6J5KBHCKdYNi9ESlGSZreRwLCpdNbmumB6MlyHZlz2umLiw0ZZJAEpdrwXA2NiyHzJDKDKfbAhd8uoTSACrbgwbrAXI1cvb1WjiOQjLn9MVW++fuJCq6vIeX+rUKMeltBAHMeBZyC54ndAucw9nS03uyckjphunE4tl4WTT475VkfUiyJCTT3S2IOVYS9V9M8pMQ1/GlDVNCLBJJfrYlVXoC8VX68QW1HERkhNYQbTgLQ9kI3cDeMP5d4TuUL3XR2Q6sNiOMdIPGDYQ9QFKFdOE3OQ5X9wxUYbX6j88wR2gRGJcS5agqFHOR1ZTNrjumOYrEkjL8ehFXEs/KluhURllfi0POUPGAwlUWBjDCZcKaeeR0kASnsia2V5IjoiQUYwQUFBMTAzQ0E1MzdFQUVEODdDMjRERDUzOTA5QjgwQTc4QTkyM0UzODIzRDY4REFDQzk0QjlGRjgzMDVEQyJ9E0Gs1T0RaO7NluuXP59fegcW6SQKq4BhC3ZzEKPm1vJuwAJ2gZUaicaXbRPW3IyadavKRlfGdFeAYt2B3ik8fGiK3ZkKU0CrZ0qL0IO5rrWrOg74HMnpxRAn1RhAHRHfGEk67FFPNjr0aLBJXSia7xZWiyKA+i4QU63roY2sxMI/q41mvJjRUz0rPKT3SbVDt1Of7K7BP8cmiboBkWexFBD/mkJyMOpYAOoFp/tKOUHTWZYcc1GpbyV1jInXVfEUhHROYCtS4p/xwF6DdT3bI0+HRU35/xNBTZH2yJN55u9i42Vb0ddCyhzOLZYQ3JVgglty6hLgVeQzuN4b2MoalhfTl11HsElJT1kB0mznVX8CL7UMTUp/2uSgL8DN6kB4owEZ45nWRxIR/2sCidMJ1tnSI1uSqkeqXRf1vat5qPq+BzpYE0Urn2ZZEmgJyb2u0ZLn2x1tfJyPtv+hqBoT7iqJ224dSbuB4HMT49YtcheUtR0jnrImJXm+M1TeIjWB3XWOScrNV8sWEJMAiIU="",""shopperLocale"": ""en-US""}"; - // Assert that readonly parameters like ID are actually deserialised and can be serialised again. - var deserializedResponse = JsonConvert.DeserializeObject(sessionResponse); - Assert.IsNotNull(deserializedResponse.Id); - Assert.IsTrue(deserializedResponse.ToJson().Contains("\"id\": \"CS0068299CB8DA273A\",")); - } - [TestMethod] public void SaleToPoiMessageSerializationTest() { diff --git a/Adyen.Test/TerminalApiSyncServiceTest.cs b/Adyen.Test/TerminalApi/TerminalApiSyncServiceTest.cs similarity index 100% rename from Adyen.Test/TerminalApiSyncServiceTest.cs rename to Adyen.Test/TerminalApi/TerminalApiSyncServiceTest.cs diff --git a/Adyen.Test/TerminalCommonNameValidatorTest.cs b/Adyen.Test/TerminalApi/TerminalCommonNameValidatorTest.cs similarity index 100% rename from Adyen.Test/TerminalCommonNameValidatorTest.cs rename to Adyen.Test/TerminalApi/TerminalCommonNameValidatorTest.cs From f7cc53e940cfdf550f41564b1cfde53a668f9e23 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 27 Oct 2025 20:33:44 +0100 Subject: [PATCH 073/126] Fix typo buildeAction -> builderAction --- .../csharp/libraries/generichost/HostConfiguration.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 53be59a17..786ee7550 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -110,7 +110,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} /// Configures the HttpClients. /// /// - /// + /// /// public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} clientAction = null, Action{{nrt?}} builderAction = null) { From 5f4c61e17f56dc28ae44efe66047e0b34758264a Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 27 Oct 2025 20:45:14 +0100 Subject: [PATCH 074/126] Modify IServiceCollection to iterate over the entire list of webhooks --- .../libraries/generichost/IServiceCollectionExtensions.mustache | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index 1123be43c..665d2fe6c 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -48,10 +48,8 @@ namespace {{packageName}}.{{apiName}}.Extensions {{#models}} {{#model.vendorExtensions.x-webhook-root}} - {{#first}} // Adds utility handler for deserializing webhooks. services.AddSingleton<{{packageName}}.{{apiName}}.Handlers.{{interfacePrefix}}{{apiName}}Handler, {{packageName}}.{{apiName}}.Handlers.{{apiName}}Handler>(); - {{/first}} {{/model.vendorExtensions.x-webhook-root}} {{/models}} } From 6e6a8b32f8a5175712238529c27f820d335a5b57 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Tue, 28 Oct 2025 17:21:01 +0100 Subject: [PATCH 075/126] Added support for String Enums using the IEnum interface and deserializations Removed old enums and copied the mustache template from my local branch to support generation of these stringEnum : IEnum --- Adyen.Test/Core/IEnumTest.cs | 229 ++++++++++++++++++ Adyen/Core/IEnum.cs | 11 + Adyen/Core/Option.cs | 9 +- .../generichost/ClientUtils.mustache | 6 +- .../generichost/JsonConverter.mustache | 23 +- .../generichost/ModelSignature.mustache | 2 +- .../generichost/modelGeneric.mustache | 2 +- .../generichost/modelInnerEnum.mustache | 116 +++++++++ 8 files changed, 379 insertions(+), 19 deletions(-) create mode 100644 Adyen.Test/Core/IEnumTest.cs create mode 100644 Adyen/Core/IEnum.cs create mode 100644 templates-v7/csharp/libraries/generichost/modelInnerEnum.mustache diff --git a/Adyen.Test/Core/IEnumTest.cs b/Adyen.Test/Core/IEnumTest.cs new file mode 100644 index 000000000..84957e3a7 --- /dev/null +++ b/Adyen.Test/Core/IEnumTest.cs @@ -0,0 +1,229 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Adyen.Core; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.Core +{ + public class IEnumTest + { + [TestClass] + public class IEnumTestTests + { + [TestMethod] + public void Given_ImplicitConversion_When_Initialized_Then_Returns_Correct_Values() + { + ExampleEnum? resultA = "a"; + ExampleEnum? resultB = "b"; + Assert.AreEqual(ExampleEnum.A, resultA); + Assert.AreEqual(ExampleEnum.B, resultB); + } + + [TestMethod] + public void Given_ImplicitConversion_When_Null_Then_Returns_Null() + { + ExampleEnum? input = null; + string? result = input; + Assert.IsNull(result); + } + + [TestMethod] + public void Given_ToString_When_Called_Then_Returns_Correct_Value() + { + Assert.AreEqual("a", ExampleEnum.A.ToString()); + Assert.AreEqual("b", ExampleEnum.B.ToString()); + } + + [TestMethod] + public void Given_ToString_When_Null_Then_Returns_Empty_String() + { + ExampleEnum result = new ExampleEnum(null); + Assert.AreEqual(string.Empty, result.ToString()); + } + + [TestMethod] + public void Given_Equals_When_ComparingCaseInsensitive_Then_Returns_True() + { + ExampleEnum result = new ExampleEnum("A"); + Assert.IsTrue(result.Equals(ExampleEnum.A)); + Assert.IsFalse(result.Equals(ExampleEnum.B)); + } + + [TestMethod] + public void Given_GetHashCode_When_Set_Then_Result_Matches_HashCodes() + { + ExampleEnum result = new ExampleEnum("a"); + Assert.AreEqual("a".GetHashCode(), result.GetHashCode()); + ExampleEnum nullEnum = new ExampleEnum(null); + Assert.AreEqual(0, nullEnum.GetHashCode()); + } + + [TestMethod] + public void Given_EqualityOperator_When_ComparingValues_Then_Returns_Correct_Values() + { + ExampleEnum target = new ExampleEnum("a"); + ExampleEnum otherA = ExampleEnum.A; + ExampleEnum otherB = ExampleEnum.B; + + Assert.IsTrue(target == otherA); + Assert.IsFalse(target == otherB); + Assert.IsTrue(target != otherB); + Assert.IsFalse(target != otherA); + } + + [TestMethod] + public void Given_FromStringOrDefault_When_ValidStrings_Then_Returns_Correct_Enum() + { + Assert.AreEqual(ExampleEnum.A, ExampleEnum.FromStringOrDefault("a")); + Assert.AreEqual(ExampleEnum.B, ExampleEnum.FromStringOrDefault("b")); + } + + [TestMethod] + public void Given_FromStringOrDefault_When_InvalidString_Then_Returns_Null() + { + Assert.IsNull(ExampleEnum.FromStringOrDefault("c")); + } + + [TestMethod] + public void Given_ToJsonValue_When_KnownEnum_Then_Returns_String() + { + Assert.AreEqual("a", ExampleEnum.ToJsonValue(ExampleEnum.A)); + Assert.AreEqual("b", ExampleEnum.ToJsonValue(ExampleEnum.B)); + } + + [TestMethod] + public void Given_ToJsonValue_When_Null_Then_Returns_Null() + { + Assert.IsNull(ExampleEnum.ToJsonValue(null)); + } + + [TestMethod] + public void Given_ToJsonValue_When_CustomEnum_Then_Returns_Null() + { + var custom = new ExampleEnum("custom"); + Assert.IsNull(ExampleEnum.ToJsonValue(custom)); + } + + [TestMethod] + public void Given_JsonSerialization_When_KnownEnum_Then_Serialize_and_Deserialize_Correctly() + { + JsonSerializerOptions options = new JsonSerializerOptions(); + options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); + + string serializedA = JsonSerializer.Serialize(ExampleEnum.A, options); + string serializedB = JsonSerializer.Serialize(ExampleEnum.B, options); + + Assert.AreEqual("\"a\"", serializedA); + Assert.AreEqual("\"b\"", serializedB); + + ExampleEnum? deserializedA = JsonSerializer.Deserialize(serializedA, options); + ExampleEnum? deserializedB = JsonSerializer.Deserialize(serializedB, options); + + Assert.AreEqual(ExampleEnum.A, deserializedA); + Assert.AreEqual(ExampleEnum.B, deserializedB); + } + + [TestMethod] + public void Given_JsonSerialization_When_EnumNotInList_Then_Returns_Null() + { + var options = new JsonSerializerOptions(); + options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); + + ExampleEnum? value = new ExampleEnum("not-in-list"); + string serialized = JsonSerializer.Serialize(value, options); + Assert.AreEqual("null", serialized); + + ExampleEnum? deserialized = JsonSerializer.Deserialize(serialized, options); + Assert.AreEqual(null, deserialized); + } + + [TestMethod] + public void Given_JsonSerialization_When_Null_Value_Then_Serialize_And_Deserialize_Correctly() + { + var options = new JsonSerializerOptions(); + options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); + + ExampleEnum? value = null; + string serialized = JsonSerializer.Serialize(value, options); + Assert.AreEqual("null", serialized); + + ExampleEnum? deserialized = JsonSerializer.Deserialize("null", options); + Assert.IsNull(deserialized); + } + } + } + + [JsonConverter(typeof(ExampleJsonConverter))] + internal class ExampleEnum : IEnum + { + public string? Value { get; set; } + + /// + /// ExampleEnum.A: a + /// + public static readonly ExampleEnum A = new("a"); + + /// + /// ExampleEnum.B: b + /// + public static readonly ExampleEnum B = new("b"); + + internal ExampleEnum(string? value) + { + Value = value; + } + + public static implicit operator ExampleEnum?(string? value) => value == null ? null : new ExampleEnum(value); + + public static implicit operator string?(ExampleEnum? option) => option?.Value; + + public override string ToString() => Value ?? string.Empty; + + public override bool Equals(object? obj) => obj is ExampleEnum other && string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + + public static bool operator ==(ExampleEnum? left, ExampleEnum? right) => + string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + + public static bool operator !=(ExampleEnum? left, ExampleEnum? right) => + !string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + + public static ExampleEnum? FromStringOrDefault(string value) + { + return value switch { + "a" => ExampleEnum.A, + "b" => ExampleEnum.B, + _ => null, + }; + } + + public static string? ToJsonValue(ExampleEnum? value) + { + if (value == null) + return null; + + if (value == ExampleEnum.A) + return "a"; + + if (value == ExampleEnum.B) + return "b"; + + return null; + } + + public class ExampleJsonConverter : JsonConverter + { + public override ExampleEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions jsonOptions) + { + string str = reader.GetString(); + return str == null ? null : ExampleEnum.FromStringOrDefault(str) ?? new ExampleEnum(str); + } + + public override void Write(Utf8JsonWriter writer, ExampleEnum value, JsonSerializerOptions jsonOptions) + { + writer.WriteStringValue(ExampleEnum.ToJsonValue(value)); + } + } + } +} \ No newline at end of file diff --git a/Adyen/Core/IEnum.cs b/Adyen/Core/IEnum.cs new file mode 100644 index 000000000..11055cb53 --- /dev/null +++ b/Adyen/Core/IEnum.cs @@ -0,0 +1,11 @@ +namespace Adyen.Core +{ + /// + /// Interface for defining enums. + /// This interface is used to make enums forward-compatible. + /// + public interface IEnum + { + string? Value { get; set; } + } +} \ No newline at end of file diff --git a/Adyen/Core/Option.cs b/Adyen/Core/Option.cs index 60bd77ce7..407cd4532 100644 --- a/Adyen/Core/Option.cs +++ b/Adyen/Core/Option.cs @@ -31,13 +31,18 @@ public Option(TType value) /// /// Implicitly converts this option to the contained type. /// - /// + /// + /// + /// . public static implicit operator TType(Option option) => option.Value; /// /// Implicitly converts the provided value to an Option. /// - /// + /// . + /// + /// Option of . public static implicit operator Option(TType value) => new Option(value); + } } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache index 65f3dfe41..c11ae8da7 100644 --- a/templates-v7/csharp/libraries/generichost/ClientUtils.mustache +++ b/templates-v7/csharp/libraries/generichost/ClientUtils.mustache @@ -138,7 +138,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} {{#isEnum}} if (obj is Models.{{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}) {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} - return {{classname}}ValueConverter.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + return {{classname}}ValueConverter{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; {{/isEnum}} {{^isEnum}} {{#vars}} @@ -147,7 +147,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} {{^complexType}} if (obj is Models.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} - return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; {{/complexType}} {{/items}} {{/items.isEnum}} @@ -155,7 +155,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} {{^complexType}} if (obj is Models.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} - return Models.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + return Models.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; {{/complexType}} {{/isEnum}} {{/vars}} diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index 0a525bd5b..fbf7b5513 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -6,14 +6,14 @@ {{#allVars}} {{#isDateTime}} /// - /// The format to use to serialize {{name}} + /// The format to use to serialize {{name}}. /// public static string {{name}}Format { get; set; } = "{{{dateTimeFormat}}}"; {{/isDateTime}} {{#isDate}} /// - /// The format to use to serialize {{name}} + /// The format to use to serialize {{name}}. /// public static string {{name}}Format { get; set; } = "{{{dateFormat}}}"; @@ -236,8 +236,7 @@ {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}{{{datatypeWithEnum}}}ValueConverter.FromStringOrDefault({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue)); {{/isInnerEnum}} {{#isInnerEnum}} - if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}{{classname}}.{{{datatypeWithEnum}}}FromStringOrDefault({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue)); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}{{classname}}.{{{datatypeWithEnum}}}.FromStringOrDefault({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue)); {{/isInnerEnum}} {{/isNumeric}} {{/isMap}} @@ -331,7 +330,7 @@ } /// - /// Serializes a + /// Serializes a . /// /// /// @@ -433,11 +432,11 @@ } /// - /// Serializes the properties of + /// Serializes the properties of . /// - /// + /// /// - /// + /// /// public void WriteProperties(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) { @@ -463,7 +462,7 @@ {{^model.composedSchemas.anyOf}} {{^model.composedSchemas.oneOf}} - writer.WriteString("{{baseName}}", {{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{/isEnum}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}{{/required}}){{/isEnum}}); + writer.WriteString("{{baseName}}", {{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{/isEnum}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}.ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}{{/required}}){{/isEnum}}); {{/model.composedSchemas.oneOf}} {{/model.composedSchemas.anyOf}} @@ -525,7 +524,7 @@ {{#isEnum}} {{#isNumeric}} {{#lambda.copyText}} - writer.WriteNumber("{{baseName}}", {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}})); + writer.WriteNumber("{{baseName}}", {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}})); {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}}{{! prevent indent}} @@ -535,7 +534,7 @@ {{^isNumeric}} {{#isInnerEnum}} {{#isNullable}} - var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); else @@ -545,7 +544,7 @@ {{^isNullable}} if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}._{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) {{! - }} { - var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); + string? {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{^required}}_{{/required}}{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); } diff --git a/templates-v7/csharp/libraries/generichost/ModelSignature.mustache b/templates-v7/csharp/libraries/generichost/ModelSignature.mustache index 39aa11f82..09a41b278 100644 --- a/templates-v7/csharp/libraries/generichost/ModelSignature.mustache +++ b/templates-v7/csharp/libraries/generichost/ModelSignature.mustache @@ -1 +1 @@ -{{#model.allVars}}{{^isDiscriminator}}{{^required}}Option<{{/required}}{{{datatypeWithEnum}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}{{#defaultValue}} = {{^required}}default{{/required}}{{#required}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{.}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/required}}{{/defaultValue}}{{^defaultValue}}{{#lambda.first}}{{#isNullable}} = default {{/isNullable}}{{^required}} = default {{/required}}{{/lambda.first}}{{/defaultValue}} {{/isDiscriminator}}{{/model.allVars}} +{{#model.allVars}}{{^isDiscriminator}}{{^required}}Option<{{/required}}{{{datatypeWithEnum}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}{{#defaultValue}}{{^isEnum}} = {{^required}}default{{/required}}{{#required}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{.}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/required}}{{/isEnum}}{{#isEnum}} = default{{/isEnum}}{{/defaultValue}}{{^defaultValue}}{{#lambda.first}}{{#isNullable}} = default {{/isNullable}}{{^required}} = default {{/required}}{{/lambda.first}}{{/defaultValue}} {{/isDiscriminator}}{{/model.allVars}} diff --git a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache index 622579401..5f78eb722 100644 --- a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache +++ b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache @@ -111,7 +111,7 @@ {{#isEnum}} {{^required}} /// - /// Used to track the state of {{{name}}} + /// Used to track whether {{{name}}} is set or not. /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] diff --git a/templates-v7/csharp/libraries/generichost/modelInnerEnum.mustache b/templates-v7/csharp/libraries/generichost/modelInnerEnum.mustache new file mode 100644 index 000000000..fba690e47 --- /dev/null +++ b/templates-v7/csharp/libraries/generichost/modelInnerEnum.mustache @@ -0,0 +1,116 @@ + {{^isContainer}} + /// + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} + /// + {{#description}} + /// {{.}} + {{/description}} + {{#isString}} + {{#useGenericHost}} + [JsonConverter(typeof({{datatypeWithEnum}}JsonConverter))] + {{/useGenericHost}} + {{/isString}} + {{>visibility}} class {{datatypeWithEnum}}: IEnum + { + /// + /// Returns the value of the {{datatypeWithEnum}}. + /// + public string? Value { get; set; } + + {{#allowableValues}} + {{#enumVars}} + /// + /// {{datatypeWithEnum}}.{{name}} - {{value}} + /// + public static readonly {{datatypeWithEnum}} {{name}} = new("{{value}}"); + {{^-last}} + + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + + private {{datatypeWithEnum}}(string? value) + { + Value = value; + } + + /// + /// Converts a string to a implicitly. + /// + /// The string value to convert. Defaults to null. + /// A new instance initialized with the string value. + public static implicit operator {{datatypeWithEnum}}?(string? value) => value == null ? null : new {{datatypeWithEnum}}(value); + + /// + /// Converts a instance to a string implicitly. + /// + /// The instance. Default to null. + /// String value of the instance./// + public static implicit operator string?({{datatypeWithEnum}}? option) => option?.Value; + + public static bool operator ==({{datatypeWithEnum}}? left, {{datatypeWithEnum}}? right) => string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + + public static bool operator !=({{datatypeWithEnum}}? left, {{datatypeWithEnum}}? right) => !string.Equals(left?.Value, right?.Value, StringComparison.OrdinalIgnoreCase); + + public override bool Equals(object? obj) => obj is {{datatypeWithEnum}} other && string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + public override int GetHashCode() => Value?.GetHashCode() ?? 0; + + public override string ToString() => Value ?? string.Empty; + + {{#useGenericHost}} + /// + /// Returns a . + /// + /// + /// or null. + public static {{datatypeWithEnum}}? FromStringOrDefault(string value) + { + return value switch { + {{#allowableValues}}{{#enumVars}}{{#isString}}"{{{value}}}"{{/isString}} => {{datatypeWithEnum}}.{{name}}, + {{/enumVars}}{{/allowableValues}}_ => null, + }; + } + + /// + /// Converts the to the json value. + /// + /// + /// String value of the enum. + {{#isString}} + /// + {{/isString}} + public static {{>EnumValueDataType}}?{{#lambda.first}}{{#nrt}}{{/nrt}}{{/lambda.first}} ToJsonValue({{datatypeWithEnum}}? value) + { + if (value == null) + return null; + + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}.{{name}}) + return {{#isString}}"{{{value}}}"{{/isString}}; + + {{/enumVars}} + {{/allowableValues}} + return null; + } + + /// + /// JsonConverter for writing {{datatypeWithEnum}}. + /// + public class {{datatypeWithEnum}}JsonConverter : JsonConverter<{{datatypeWithEnum}}> + { + public override {{datatypeWithEnum}}? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions jsonOptions) + { + string value = reader.GetString(); + return value == null ? null : {{datatypeWithEnum}}.FromStringOrDefault(value) ?? new {{datatypeWithEnum}}(value); + } + + public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}} value, JsonSerializerOptions jsonOptions) + { + writer.WriteStringValue({{datatypeWithEnum}}.ToJsonValue(value)); + } + } + {{/useGenericHost}} + } + {{/isContainer}} \ No newline at end of file From b4a7c246a6ef93cfa083c09abca7e5b671ea980b Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Tue, 28 Oct 2025 17:21:26 +0100 Subject: [PATCH 076/126] Added TransactionRule Deserialization and Serialization tests --- .../TransactionRules/TransactionRuleTest.cs | 53 ++++++++++++++++++- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs b/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs index bcb563e54..54ddbfbca 100644 --- a/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs +++ b/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs @@ -2,12 +2,10 @@ using Adyen.BalancePlatform.Client; using Adyen.BalancePlatform.Extensions; using Adyen.BalancePlatform.Models; -using Adyen.BalancePlatform.Services; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.VisualStudio.TestTools.UnitTesting; -using NSubstitute; namespace Adyen.Test.BalancePlatform.TransactionRules { @@ -32,6 +30,55 @@ public TransactionRuleTest() _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); } + [TestMethod] + public void Given_TransactionRule_Serialize_Correctly() + { + // Arrange + var target = new TransactionRule( + description: "Allow only point-of-sale transactions", + reference: "YOUR_REFERENCE_4F7346", + entityKey: new TransactionRuleEntityKey(entityType: "paymentInstrument", entityReference: "PI3227C223222B5BPCMFXD2XG"), + status: TransactionRule.StatusEnum.Active, + interval: new TransactionRuleInterval("perTransaction"), + ruleRestrictions: new TransactionRuleRestrictions( + processingTypes: new ProcessingTypesRestriction( + operation: "noneMatch", + value: new List + { + ProcessingTypesRestriction.ValueEnum.Pos, + ProcessingTypesRestriction.ValueEnum.Ecommerce + }) + ), + type: "blockList" + ); + + // Act + string result = JsonSerializer.Serialize(target, _jsonSerializerOptionsProvider.Options); + + // Assert + JsonDocument jsonDoc = JsonDocument.Parse(result); + + JsonElement root = jsonDoc.RootElement; + Assert.AreEqual("Allow only point-of-sale transactions", root.GetProperty("description").GetString()); + Assert.AreEqual("YOUR_REFERENCE_4F7346", root.GetProperty("reference").GetString()); + + JsonElement entityKey = root.GetProperty("entityKey"); + Assert.AreEqual("paymentInstrument", entityKey.GetProperty("entityType").GetString()); + Assert.AreEqual("PI3227C223222B5BPCMFXD2XG", entityKey.GetProperty("entityReference").GetString()); + Assert.AreEqual("active", root.GetProperty("status").GetString()); + + JsonElement interval = root.GetProperty("interval"); + Assert.AreEqual("perTransaction", interval.GetProperty("type").GetString()); + + JsonElement processingTypes = root.GetProperty("ruleRestrictions").GetProperty("processingTypes"); + Assert.AreEqual("noneMatch", processingTypes.GetProperty("operation").GetString()); + + JsonElement.ArrayEnumerator values = processingTypes.GetProperty("value").EnumerateArray(); + Assert.IsTrue(values.Any(v => v.GetString() == "pos") && values.Any(v => v.GetString() == "ecommerce")); + + Assert.AreEqual("blockList", root.GetProperty("type").GetString()); + } + [TestMethod] public void Given_TransactionRule_Deserialize_Correctly() { @@ -45,6 +92,7 @@ public void Given_TransactionRule_Deserialize_Correctly() Assert.AreEqual(response.EntityKey.EntityReference, "PI3227C223222B5BPCMFXD2XG"); Assert.AreEqual(response.EntityKey.EntityType, "paymentInstrument"); Assert.AreEqual(response.Interval.Type, TransactionRuleInterval.TypeEnum.PerTransaction); + Assert.AreEqual(response.RuleRestrictions.ProcessingTypes.Operation, "noneMatch"); } [TestMethod] @@ -59,6 +107,7 @@ public void Given_TransactionRuleResponse_Deserialize_Correctly() // Assert Assert.AreEqual(response.TransactionRule.Id, "TR32272223222B5GFSGFLFCHM"); Assert.AreEqual(response.TransactionRule.Interval.Type, TransactionRuleInterval.TypeEnum.PerTransaction); + Assert.AreEqual(response.TransactionRule.RuleRestrictions.ProcessingTypes.Operation, "noneMatch"); } } } \ No newline at end of file From 96e5760bd9a172c61f957893749c733bb96798c3 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 29 Oct 2025 13:31:49 +0100 Subject: [PATCH 077/126] Move /src back to the original folder structure --- Adyen/{src => }/ApiSerialization/Converter/JsonBase64Converter.cs | 0 .../ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs | 0 .../ApiSerialization/Converter/JsonConvertSerializerWrapper.cs | 0 .../ApiSerialization/Converter/SaleToPoiMessageConverter.cs | 0 .../Converter/SaleToPoiMessageSecuredConverter.cs | 0 Adyen/{src => }/ApiSerialization/IMessagePayload.cs | 0 Adyen/{src => }/ApiSerialization/IMessagePayloadSerializer.cs | 0 Adyen/{src => }/ApiSerialization/MessageHeaderSerializer.cs | 0 Adyen/{src => }/ApiSerialization/MessagePayloadSerializer.cs | 0 .../{src => }/ApiSerialization/MessagePayloadSerializerFactory.cs | 0 Adyen/{src => }/ApiSerialization/OpenAPIDateConverter.cs | 0 .../ApiSerialization/SaleToPoiMessageSecuredSerializer.cs | 0 Adyen/{src => }/ApiSerialization/SaleToPoiMessageSerializer.cs | 0 Adyen/{src => }/ApiSerialization/TypeHelper.cs | 0 Adyen/{src => }/Constants/ApiConstants.cs | 0 Adyen/{src => }/Constants/ClientConfig.cs | 0 Adyen/{src => }/Constants/Region.cs | 0 Adyen/{src => }/Exceptions/DeserializationException.cs | 0 Adyen/{src => }/Exceptions/ExceptionMessages.cs | 0 Adyen/{src => }/HttpClient/HttpClientException.cs | 0 Adyen/{src => }/HttpClient/HttpClientExtension.cs | 0 Adyen/{src => }/HttpClient/HttpClientWrapper.cs | 0 Adyen/{src => }/HttpClient/Interfaces/IClient.cs | 0 Adyen/{src => }/Model/AcsWebhooks/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/AcsWebhooks/Amount.cs | 0 Adyen/{src => }/Model/AcsWebhooks/AuthenticationDecision.cs | 0 Adyen/{src => }/Model/AcsWebhooks/AuthenticationInfo.cs | 0 .../{src => }/Model/AcsWebhooks/AuthenticationNotificationData.cs | 0 .../Model/AcsWebhooks/AuthenticationNotificationRequest.cs | 0 .../Model/AcsWebhooks/BalancePlatformNotificationResponse.cs | 0 Adyen/{src => }/Model/AcsWebhooks/ChallengeInfo.cs | 0 Adyen/{src => }/Model/AcsWebhooks/Purchase.cs | 0 Adyen/{src => }/Model/AcsWebhooks/PurchaseInfo.cs | 0 Adyen/{src => }/Model/AcsWebhooks/RelayedAuthenticationRequest.cs | 0 .../{src => }/Model/AcsWebhooks/RelayedAuthenticationResponse.cs | 0 Adyen/{src => }/Model/AcsWebhooks/Resource.cs | 0 Adyen/{src => }/Model/AcsWebhooks/ServiceError.cs | 0 Adyen/{src => }/Model/ApiError.cs | 0 Adyen/{src => }/Model/ApplicationInformation/ApplicationInfo.cs | 0 Adyen/{src => }/Model/ApplicationInformation/CommonField.cs | 0 Adyen/{src => }/Model/ApplicationInformation/ExternalPlatform.cs | 0 Adyen/{src => }/Model/ApplicationInformation/MerchantDevice.cs | 0 .../Model/ApplicationInformation/ShopperInteractionDevice.cs | 0 Adyen/{src => }/Model/BalanceControl/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/BalanceControl/Amount.cs | 0 Adyen/{src => }/Model/BalanceControl/BalanceTransferRequest.cs | 0 Adyen/{src => }/Model/BalanceControl/BalanceTransferResponse.cs | 0 .../Model/BalancePlatform/AULocalAccountIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/BalancePlatform/AccountHolder.cs | 0 Adyen/{src => }/Model/BalancePlatform/AccountHolderCapability.cs | 0 Adyen/{src => }/Model/BalancePlatform/AccountHolderInfo.cs | 0 .../{src => }/Model/BalancePlatform/AccountHolderUpdateRequest.cs | 0 .../Model/BalancePlatform/AccountSupportingEntityCapability.cs | 0 .../Model/BalancePlatform/ActiveNetworkTokensRestriction.cs | 0 .../Model/BalancePlatform/AdditionalBankIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/Address.cs | 0 Adyen/{src => }/Model/BalancePlatform/AddressRequirement.cs | 0 Adyen/{src => }/Model/BalancePlatform/Amount.cs | 0 Adyen/{src => }/Model/BalancePlatform/AmountMinMaxRequirement.cs | 0 .../Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs | 0 .../BalancePlatform/AssociationDelegatedAuthenticationData.cs | 0 .../{src => }/Model/BalancePlatform/AssociationFinaliseRequest.cs | 0 .../Model/BalancePlatform/AssociationFinaliseResponse.cs | 0 .../{src => }/Model/BalancePlatform/AssociationInitiateRequest.cs | 0 .../Model/BalancePlatform/AssociationInitiateResponse.cs | 0 Adyen/{src => }/Model/BalancePlatform/Authentication.cs | 0 .../Model/BalancePlatform/BRLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/Balance.cs | 0 Adyen/{src => }/Model/BalancePlatform/BalanceAccount.cs | 0 Adyen/{src => }/Model/BalancePlatform/BalanceAccountBase.cs | 0 Adyen/{src => }/Model/BalancePlatform/BalanceAccountInfo.cs | 0 .../Model/BalancePlatform/BalanceAccountUpdateRequest.cs | 0 Adyen/{src => }/Model/BalancePlatform/BalancePlatform.cs | 0 .../Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs | 0 Adyen/{src => }/Model/BalancePlatform/BankAccount.cs | 0 .../Model/BalancePlatform/BankAccountAccountIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/BankAccountDetails.cs | 0 .../BalancePlatform/BankAccountIdentificationTypeRequirement.cs | 0 .../BalancePlatform/BankAccountIdentificationValidationRequest.cs | 0 ...AccountIdentificationValidationRequestAccountIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/BankAccountModel.cs | 0 Adyen/{src => }/Model/BalancePlatform/BankIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/BrandVariantsRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/BulkAddress.cs | 0 .../Model/BalancePlatform/CALocalAccountIdentification.cs | 0 .../Model/BalancePlatform/CZLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/CapabilityProblem.cs | 0 Adyen/{src => }/Model/BalancePlatform/CapabilityProblemEntity.cs | 0 .../Model/BalancePlatform/CapabilityProblemEntityRecursive.cs | 0 Adyen/{src => }/Model/BalancePlatform/CapabilitySettings.cs | 0 Adyen/{src => }/Model/BalancePlatform/CapitalBalance.cs | 0 Adyen/{src => }/Model/BalancePlatform/CapitalGrantAccount.cs | 0 Adyen/{src => }/Model/BalancePlatform/Card.cs | 0 Adyen/{src => }/Model/BalancePlatform/CardConfiguration.cs | 0 Adyen/{src => }/Model/BalancePlatform/CardInfo.cs | 0 Adyen/{src => }/Model/BalancePlatform/CardOrder.cs | 0 Adyen/{src => }/Model/BalancePlatform/CardOrderItem.cs | 0 .../Model/BalancePlatform/CardOrderItemDeliveryStatus.cs | 0 Adyen/{src => }/Model/BalancePlatform/ContactDetails.cs | 0 Adyen/{src => }/Model/BalancePlatform/Counterparty.cs | 0 .../Model/BalancePlatform/CounterpartyBankRestriction.cs | 0 .../Model/BalancePlatform/CounterpartyTypesRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/CountriesRestriction.cs | 0 .../{src => }/Model/BalancePlatform/CreateSweepConfigurationV2.cs | 0 .../Model/BalancePlatform/DKLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/DayOfWeekRestriction.cs | 0 .../Model/BalancePlatform/DelegatedAuthenticationData.cs | 0 Adyen/{src => }/Model/BalancePlatform/DeliveryAddress.cs | 0 Adyen/{src => }/Model/BalancePlatform/DeliveryContact.cs | 0 Adyen/{src => }/Model/BalancePlatform/Device.cs | 0 Adyen/{src => }/Model/BalancePlatform/DeviceInfo.cs | 0 .../Model/BalancePlatform/DifferentCurrenciesRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/Duration.cs | 0 Adyen/{src => }/Model/BalancePlatform/EntryModesRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/Expiry.cs | 0 Adyen/{src => }/Model/BalancePlatform/Fee.cs | 0 Adyen/{src => }/Model/BalancePlatform/GetNetworkTokenResponse.cs | 0 Adyen/{src => }/Model/BalancePlatform/GetTaxFormResponse.cs | 0 Adyen/{src => }/Model/BalancePlatform/GrantLimit.cs | 0 Adyen/{src => }/Model/BalancePlatform/GrantOffer.cs | 0 Adyen/{src => }/Model/BalancePlatform/GrantOffers.cs | 0 .../Model/BalancePlatform/HKLocalAccountIdentification.cs | 0 .../Model/BalancePlatform/HULocalAccountIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/Href.cs | 0 .../{src => }/Model/BalancePlatform/IbanAccountIdentification.cs | 0 .../Model/BalancePlatform/IbanAccountIdentificationRequirement.cs | 0 .../Model/BalancePlatform/InternationalTransactionRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/InvalidField.cs | 0 Adyen/{src => }/Model/BalancePlatform/Link.cs | 0 .../{src => }/Model/BalancePlatform/ListNetworkTokensResponse.cs | 0 .../Model/BalancePlatform/MatchingTransactionsRestriction.cs | 0 .../{src => }/Model/BalancePlatform/MatchingValuesRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/MccsRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/MerchantAcquirerPair.cs | 0 Adyen/{src => }/Model/BalancePlatform/MerchantNamesRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/MerchantsRestriction.cs | 0 .../Model/BalancePlatform/NOLocalAccountIdentification.cs | 0 .../Model/BalancePlatform/NZLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/Name.cs | 0 Adyen/{src => }/Model/BalancePlatform/NetworkToken.cs | 0 .../Model/BalancePlatform/NumberAndBicAccountIdentification.cs | 0 .../Model/BalancePlatform/PLLocalAccountIdentification.cs | 0 .../Model/BalancePlatform/PaginatedAccountHoldersResponse.cs | 0 .../Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs | 0 .../Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs | 0 .../Model/BalancePlatform/PaginatedGetCardOrderResponse.cs | 0 .../Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs | 0 Adyen/{src => }/Model/BalancePlatform/PaymentInstrument.cs | 0 .../PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs | 0 Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentGroup.cs | 0 .../{src => }/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs | 0 Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentInfo.cs | 0 .../Model/BalancePlatform/PaymentInstrumentRequirement.cs | 0 .../Model/BalancePlatform/PaymentInstrumentRevealInfo.cs | 0 .../Model/BalancePlatform/PaymentInstrumentRevealRequest.cs | 0 .../Model/BalancePlatform/PaymentInstrumentRevealResponse.cs | 0 .../Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs | 0 Adyen/{src => }/Model/BalancePlatform/Phone.cs | 0 Adyen/{src => }/Model/BalancePlatform/PhoneNumber.cs | 0 Adyen/{src => }/Model/BalancePlatform/PinChangeRequest.cs | 0 Adyen/{src => }/Model/BalancePlatform/PinChangeResponse.cs | 0 .../Model/BalancePlatform/PlatformPaymentConfiguration.cs | 0 .../{src => }/Model/BalancePlatform/ProcessingTypesRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/PublicKeyResponse.cs | 0 Adyen/{src => }/Model/BalancePlatform/RegisterSCAFinalResponse.cs | 0 Adyen/{src => }/Model/BalancePlatform/RegisterSCARequest.cs | 0 Adyen/{src => }/Model/BalancePlatform/RegisterSCAResponse.cs | 0 Adyen/{src => }/Model/BalancePlatform/RemediatingAction.cs | 0 Adyen/{src => }/Model/BalancePlatform/Repayment.cs | 0 Adyen/{src => }/Model/BalancePlatform/RepaymentTerm.cs | 0 Adyen/{src => }/Model/BalancePlatform/RestServiceError.cs | 0 Adyen/{src => }/Model/BalancePlatform/RevealPinRequest.cs | 0 Adyen/{src => }/Model/BalancePlatform/RevealPinResponse.cs | 0 Adyen/{src => }/Model/BalancePlatform/RiskScores.cs | 0 Adyen/{src => }/Model/BalancePlatform/RiskScoresRestriction.cs | 0 .../Model/BalancePlatform/SELocalAccountIdentification.cs | 0 .../Model/BalancePlatform/SGLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/BalancePlatform/SameAmountRestriction.cs | 0 .../Model/BalancePlatform/SameCounterpartyRestriction.cs | 0 .../Model/BalancePlatform/SearchRegisteredDevicesResponse.cs | 0 .../Model/BalancePlatform/SourceAccountTypesRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/StringMatch.cs | 0 Adyen/{src => }/Model/BalancePlatform/SweepConfigurationV2.cs | 0 Adyen/{src => }/Model/BalancePlatform/SweepCounterparty.cs | 0 Adyen/{src => }/Model/BalancePlatform/SweepSchedule.cs | 0 Adyen/{src => }/Model/BalancePlatform/ThresholdRepayment.cs | 0 Adyen/{src => }/Model/BalancePlatform/TimeOfDay.cs | 0 Adyen/{src => }/Model/BalancePlatform/TimeOfDayRestriction.cs | 0 .../{src => }/Model/BalancePlatform/TokenRequestorsRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/TotalAmountRestriction.cs | 0 Adyen/{src => }/Model/BalancePlatform/TransactionRule.cs | 0 Adyen/{src => }/Model/BalancePlatform/TransactionRuleEntityKey.cs | 0 Adyen/{src => }/Model/BalancePlatform/TransactionRuleInfo.cs | 0 Adyen/{src => }/Model/BalancePlatform/TransactionRuleInterval.cs | 0 Adyen/{src => }/Model/BalancePlatform/TransactionRuleResponse.cs | 0 .../Model/BalancePlatform/TransactionRuleRestrictions.cs | 0 Adyen/{src => }/Model/BalancePlatform/TransactionRulesResponse.cs | 0 Adyen/{src => }/Model/BalancePlatform/TransferRoute.cs | 0 Adyen/{src => }/Model/BalancePlatform/TransferRouteRequest.cs | 0 .../Model/BalancePlatform/TransferRouteRequirementsInner.cs | 0 Adyen/{src => }/Model/BalancePlatform/TransferRouteResponse.cs | 0 .../Model/BalancePlatform/UKLocalAccountIdentification.cs | 0 .../Model/BalancePlatform/USInternationalAchAddressRequirement.cs | 0 .../Model/BalancePlatform/USLocalAccountIdentification.cs | 0 .../{src => }/Model/BalancePlatform/UpdateNetworkTokenRequest.cs | 0 Adyen/{src => }/Model/BalancePlatform/UpdatePaymentInstrument.cs | 0 .../{src => }/Model/BalancePlatform/UpdateSweepConfigurationV2.cs | 0 Adyen/{src => }/Model/BalancePlatform/VerificationDeadline.cs | 0 Adyen/{src => }/Model/BalancePlatform/VerificationError.cs | 0 .../{src => }/Model/BalancePlatform/VerificationErrorRecursive.cs | 0 Adyen/{src => }/Model/BinLookup/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/BinLookup/Amount.cs | 0 Adyen/{src => }/Model/BinLookup/BinDetail.cs | 0 Adyen/{src => }/Model/BinLookup/CardBin.cs | 0 Adyen/{src => }/Model/BinLookup/CostEstimateAssumptions.cs | 0 Adyen/{src => }/Model/BinLookup/CostEstimateRequest.cs | 0 Adyen/{src => }/Model/BinLookup/CostEstimateResponse.cs | 0 Adyen/{src => }/Model/BinLookup/DSPublicKeyDetail.cs | 0 Adyen/{src => }/Model/BinLookup/MerchantDetails.cs | 0 Adyen/{src => }/Model/BinLookup/Recurring.cs | 0 Adyen/{src => }/Model/BinLookup/ServiceError.cs | 0 Adyen/{src => }/Model/BinLookup/ThreeDS2CardRangeDetail.cs | 0 Adyen/{src => }/Model/BinLookup/ThreeDSAvailabilityRequest.cs | 0 Adyen/{src => }/Model/BinLookup/ThreeDSAvailabilityResponse.cs | 0 Adyen/{src => }/Model/Checkout/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/Checkout/AccountInfo.cs | 0 Adyen/{src => }/Model/Checkout/AcctInfo.cs | 0 Adyen/{src => }/Model/Checkout/AchDetails.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalData3DSecure.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataAirline.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataCarRental.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataCommon.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataLevel23.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataLodging.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataOpenInvoice.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataOpi.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataRatepay.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataRetry.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataRisk.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataRiskStandalone.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataSubMerchant.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataTemporaryServices.cs | 0 Adyen/{src => }/Model/Checkout/AdditionalDataWallets.cs | 0 Adyen/{src => }/Model/Checkout/Address.cs | 0 Adyen/{src => }/Model/Checkout/AffirmDetails.cs | 0 Adyen/{src => }/Model/Checkout/AfterpayDetails.cs | 0 Adyen/{src => }/Model/Checkout/Agency.cs | 0 Adyen/{src => }/Model/Checkout/Airline.cs | 0 Adyen/{src => }/Model/Checkout/AmazonPayDetails.cs | 0 Adyen/{src => }/Model/Checkout/Amount.cs | 0 Adyen/{src => }/Model/Checkout/Amounts.cs | 0 Adyen/{src => }/Model/Checkout/AncvDetails.cs | 0 Adyen/{src => }/Model/Checkout/AndroidPayDetails.cs | 0 Adyen/{src => }/Model/Checkout/ApplePayDetails.cs | 0 Adyen/{src => }/Model/Checkout/ApplePayDonations.cs | 0 Adyen/{src => }/Model/Checkout/ApplePaySessionRequest.cs | 0 Adyen/{src => }/Model/Checkout/ApplePaySessionResponse.cs | 0 Adyen/{src => }/Model/Checkout/ApplicationInfo.cs | 0 Adyen/{src => }/Model/Checkout/AuthenticationData.cs | 0 Adyen/{src => }/Model/Checkout/BacsDirectDebitDetails.cs | 0 Adyen/{src => }/Model/Checkout/BalanceCheckRequest.cs | 0 Adyen/{src => }/Model/Checkout/BalanceCheckResponse.cs | 0 Adyen/{src => }/Model/Checkout/BillDeskDetails.cs | 0 Adyen/{src => }/Model/Checkout/BillingAddress.cs | 0 Adyen/{src => }/Model/Checkout/BlikDetails.cs | 0 Adyen/{src => }/Model/Checkout/BrowserInfo.cs | 0 Adyen/{src => }/Model/Checkout/CancelOrderRequest.cs | 0 Adyen/{src => }/Model/Checkout/CancelOrderResponse.cs | 0 Adyen/{src => }/Model/Checkout/CardBrandDetails.cs | 0 Adyen/{src => }/Model/Checkout/CardDetails.cs | 0 Adyen/{src => }/Model/Checkout/CardDetailsRequest.cs | 0 Adyen/{src => }/Model/Checkout/CardDetailsResponse.cs | 0 Adyen/{src => }/Model/Checkout/CardDonations.cs | 0 Adyen/{src => }/Model/Checkout/CashAppDetails.cs | 0 Adyen/{src => }/Model/Checkout/CellulantDetails.cs | 0 Adyen/{src => }/Model/Checkout/CheckoutAwaitAction.cs | 0 Adyen/{src => }/Model/Checkout/CheckoutBankAccount.cs | 0 Adyen/{src => }/Model/Checkout/CheckoutBankTransferAction.cs | 0 .../Model/Checkout/CheckoutDelegatedAuthenticationAction.cs | 0 Adyen/{src => }/Model/Checkout/CheckoutNativeRedirectAction.cs | 0 Adyen/{src => }/Model/Checkout/CheckoutOrderResponse.cs | 0 Adyen/{src => }/Model/Checkout/CheckoutPaymentMethod.cs | 0 Adyen/{src => }/Model/Checkout/CheckoutQrCodeAction.cs | 0 Adyen/{src => }/Model/Checkout/CheckoutRedirectAction.cs | 0 Adyen/{src => }/Model/Checkout/CheckoutSDKAction.cs | 0 .../{src => }/Model/Checkout/CheckoutSessionInstallmentOption.cs | 0 .../Model/Checkout/CheckoutSessionThreeDS2RequestData.cs | 0 Adyen/{src => }/Model/Checkout/CheckoutThreeDS2Action.cs | 0 Adyen/{src => }/Model/Checkout/CheckoutVoucherAction.cs | 0 Adyen/{src => }/Model/Checkout/CommonField.cs | 0 Adyen/{src => }/Model/Checkout/Company.cs | 0 Adyen/{src => }/Model/Checkout/CreateCheckoutSessionRequest.cs | 0 Adyen/{src => }/Model/Checkout/CreateCheckoutSessionResponse.cs | 0 Adyen/{src => }/Model/Checkout/CreateOrderRequest.cs | 0 Adyen/{src => }/Model/Checkout/CreateOrderResponse.cs | 0 Adyen/{src => }/Model/Checkout/DeliveryAddress.cs | 0 Adyen/{src => }/Model/Checkout/DeliveryMethod.cs | 0 .../{src => }/Model/Checkout/DetailsRequestAuthenticationData.cs | 0 Adyen/{src => }/Model/Checkout/DeviceRenderOptions.cs | 0 Adyen/{src => }/Model/Checkout/DokuDetails.cs | 0 Adyen/{src => }/Model/Checkout/Donation.cs | 0 Adyen/{src => }/Model/Checkout/DonationCampaign.cs | 0 Adyen/{src => }/Model/Checkout/DonationCampaignsRequest.cs | 0 Adyen/{src => }/Model/Checkout/DonationCampaignsResponse.cs | 0 Adyen/{src => }/Model/Checkout/DonationPaymentMethod.cs | 0 Adyen/{src => }/Model/Checkout/DonationPaymentRequest.cs | 0 Adyen/{src => }/Model/Checkout/DonationPaymentResponse.cs | 0 Adyen/{src => }/Model/Checkout/DragonpayDetails.cs | 0 Adyen/{src => }/Model/Checkout/EBankingFinlandDetails.cs | 0 Adyen/{src => }/Model/Checkout/EcontextVoucherDetails.cs | 0 Adyen/{src => }/Model/Checkout/EftDetails.cs | 0 Adyen/{src => }/Model/Checkout/EncryptedOrderData.cs | 0 Adyen/{src => }/Model/Checkout/EnhancedSchemeData.cs | 0 Adyen/{src => }/Model/Checkout/ExternalPlatform.cs | 0 Adyen/{src => }/Model/Checkout/FastlaneDetails.cs | 0 Adyen/{src => }/Model/Checkout/ForexQuote.cs | 0 Adyen/{src => }/Model/Checkout/FraudCheckResult.cs | 0 Adyen/{src => }/Model/Checkout/FraudResult.cs | 0 Adyen/{src => }/Model/Checkout/FundOrigin.cs | 0 Adyen/{src => }/Model/Checkout/FundRecipient.cs | 0 .../{src => }/Model/Checkout/GenericIssuerPaymentMethodDetails.cs | 0 Adyen/{src => }/Model/Checkout/GooglePayDetails.cs | 0 Adyen/{src => }/Model/Checkout/GooglePayDonations.cs | 0 Adyen/{src => }/Model/Checkout/IdealDetails.cs | 0 Adyen/{src => }/Model/Checkout/IdealDonations.cs | 0 Adyen/{src => }/Model/Checkout/InputDetail.cs | 0 Adyen/{src => }/Model/Checkout/InstallmentOption.cs | 0 Adyen/{src => }/Model/Checkout/Installments.cs | 0 Adyen/{src => }/Model/Checkout/Item.cs | 0 Adyen/{src => }/Model/Checkout/KlarnaDetails.cs | 0 Adyen/{src => }/Model/Checkout/Leg.cs | 0 Adyen/{src => }/Model/Checkout/LineItem.cs | 0 .../{src => }/Model/Checkout/ListStoredPaymentMethodsResponse.cs | 0 Adyen/{src => }/Model/Checkout/Mandate.cs | 0 Adyen/{src => }/Model/Checkout/MasterpassDetails.cs | 0 Adyen/{src => }/Model/Checkout/MbwayDetails.cs | 0 Adyen/{src => }/Model/Checkout/MerchantDevice.cs | 0 Adyen/{src => }/Model/Checkout/MerchantRiskIndicator.cs | 0 Adyen/{src => }/Model/Checkout/MobilePayDetails.cs | 0 Adyen/{src => }/Model/Checkout/MolPayDetails.cs | 0 Adyen/{src => }/Model/Checkout/Name.cs | 0 Adyen/{src => }/Model/Checkout/OpenInvoiceDetails.cs | 0 Adyen/{src => }/Model/Checkout/Passenger.cs | 0 Adyen/{src => }/Model/Checkout/PayByBankAISDirectDebitDetails.cs | 0 Adyen/{src => }/Model/Checkout/PayByBankDetails.cs | 0 Adyen/{src => }/Model/Checkout/PayPalDetails.cs | 0 Adyen/{src => }/Model/Checkout/PayPayDetails.cs | 0 Adyen/{src => }/Model/Checkout/PayToDetails.cs | 0 Adyen/{src => }/Model/Checkout/PayUUpiDetails.cs | 0 Adyen/{src => }/Model/Checkout/PayWithGoogleDetails.cs | 0 Adyen/{src => }/Model/Checkout/PayWithGoogleDonations.cs | 0 Adyen/{src => }/Model/Checkout/Payment.cs | 0 Adyen/{src => }/Model/Checkout/PaymentAmountUpdateRequest.cs | 0 Adyen/{src => }/Model/Checkout/PaymentAmountUpdateResponse.cs | 0 Adyen/{src => }/Model/Checkout/PaymentCancelRequest.cs | 0 Adyen/{src => }/Model/Checkout/PaymentCancelResponse.cs | 0 Adyen/{src => }/Model/Checkout/PaymentCaptureRequest.cs | 0 Adyen/{src => }/Model/Checkout/PaymentCaptureResponse.cs | 0 Adyen/{src => }/Model/Checkout/PaymentCompletionDetails.cs | 0 Adyen/{src => }/Model/Checkout/PaymentDetails.cs | 0 Adyen/{src => }/Model/Checkout/PaymentDetailsRequest.cs | 0 Adyen/{src => }/Model/Checkout/PaymentDetailsResponse.cs | 0 Adyen/{src => }/Model/Checkout/PaymentLinkRequest.cs | 0 Adyen/{src => }/Model/Checkout/PaymentLinkResponse.cs | 0 Adyen/{src => }/Model/Checkout/PaymentMethod.cs | 0 Adyen/{src => }/Model/Checkout/PaymentMethodGroup.cs | 0 Adyen/{src => }/Model/Checkout/PaymentMethodIssuer.cs | 0 Adyen/{src => }/Model/Checkout/PaymentMethodToStore.cs | 0 Adyen/{src => }/Model/Checkout/PaymentMethodUPIApps.cs | 0 Adyen/{src => }/Model/Checkout/PaymentMethodsRequest.cs | 0 Adyen/{src => }/Model/Checkout/PaymentMethodsResponse.cs | 0 Adyen/{src => }/Model/Checkout/PaymentRefundRequest.cs | 0 Adyen/{src => }/Model/Checkout/PaymentRefundResponse.cs | 0 Adyen/{src => }/Model/Checkout/PaymentRequest.cs | 0 Adyen/{src => }/Model/Checkout/PaymentResponse.cs | 0 Adyen/{src => }/Model/Checkout/PaymentResponseAction.cs | 0 Adyen/{src => }/Model/Checkout/PaymentReversalRequest.cs | 0 Adyen/{src => }/Model/Checkout/PaymentReversalResponse.cs | 0 Adyen/{src => }/Model/Checkout/PaypalUpdateOrderRequest.cs | 0 Adyen/{src => }/Model/Checkout/PaypalUpdateOrderResponse.cs | 0 Adyen/{src => }/Model/Checkout/Phone.cs | 0 Adyen/{src => }/Model/Checkout/PixDetails.cs | 0 Adyen/{src => }/Model/Checkout/PixRecurring.cs | 0 Adyen/{src => }/Model/Checkout/PlatformChargebackLogic.cs | 0 Adyen/{src => }/Model/Checkout/PseDetails.cs | 0 Adyen/{src => }/Model/Checkout/RakutenPayDetails.cs | 0 Adyen/{src => }/Model/Checkout/RatepayDetails.cs | 0 Adyen/{src => }/Model/Checkout/Recurring.cs | 0 Adyen/{src => }/Model/Checkout/ResponseAdditionalData3DSecure.cs | 0 .../Model/Checkout/ResponseAdditionalDataBillingAddress.cs | 0 Adyen/{src => }/Model/Checkout/ResponseAdditionalDataCard.cs | 0 Adyen/{src => }/Model/Checkout/ResponseAdditionalDataCommon.cs | 0 .../Model/Checkout/ResponseAdditionalDataDomesticError.cs | 0 .../Model/Checkout/ResponseAdditionalDataInstallments.cs | 0 .../Model/Checkout/ResponseAdditionalDataNetworkTokens.cs | 0 Adyen/{src => }/Model/Checkout/ResponseAdditionalDataOpi.cs | 0 Adyen/{src => }/Model/Checkout/ResponseAdditionalDataSepa.cs | 0 Adyen/{src => }/Model/Checkout/ResponsePaymentMethod.cs | 0 Adyen/{src => }/Model/Checkout/RiskData.cs | 0 Adyen/{src => }/Model/Checkout/RivertyDetails.cs | 0 Adyen/{src => }/Model/Checkout/SDKEphemPubKey.cs | 0 Adyen/{src => }/Model/Checkout/SamsungPayDetails.cs | 0 Adyen/{src => }/Model/Checkout/SepaDirectDebitDetails.cs | 0 Adyen/{src => }/Model/Checkout/ServiceError.cs | 0 Adyen/{src => }/Model/Checkout/SessionResultResponse.cs | 0 Adyen/{src => }/Model/Checkout/ShopperInteractionDevice.cs | 0 Adyen/{src => }/Model/Checkout/Split.cs | 0 Adyen/{src => }/Model/Checkout/SplitAmount.cs | 0 Adyen/{src => }/Model/Checkout/StandalonePaymentCancelRequest.cs | 0 Adyen/{src => }/Model/Checkout/StandalonePaymentCancelResponse.cs | 0 Adyen/{src => }/Model/Checkout/StoredPaymentMethod.cs | 0 Adyen/{src => }/Model/Checkout/StoredPaymentMethodDetails.cs | 0 Adyen/{src => }/Model/Checkout/StoredPaymentMethodRequest.cs | 0 Adyen/{src => }/Model/Checkout/StoredPaymentMethodResource.cs | 0 Adyen/{src => }/Model/Checkout/SubInputDetail.cs | 0 Adyen/{src => }/Model/Checkout/SubMerchant.cs | 0 Adyen/{src => }/Model/Checkout/SubMerchantInfo.cs | 0 Adyen/{src => }/Model/Checkout/Surcharge.cs | 0 Adyen/{src => }/Model/Checkout/TaxTotal.cs | 0 Adyen/{src => }/Model/Checkout/ThreeDS2RequestData.cs | 0 Adyen/{src => }/Model/Checkout/ThreeDS2RequestFields.cs | 0 Adyen/{src => }/Model/Checkout/ThreeDS2ResponseData.cs | 0 Adyen/{src => }/Model/Checkout/ThreeDS2Result.cs | 0 Adyen/{src => }/Model/Checkout/ThreeDSRequestData.cs | 0 .../Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs | 0 .../Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs | 0 Adyen/{src => }/Model/Checkout/ThreeDSecureData.cs | 0 Adyen/{src => }/Model/Checkout/Ticket.cs | 0 Adyen/{src => }/Model/Checkout/TravelAgency.cs | 0 Adyen/{src => }/Model/Checkout/TwintDetails.cs | 0 Adyen/{src => }/Model/Checkout/UpdatePaymentLinkRequest.cs | 0 Adyen/{src => }/Model/Checkout/UpiCollectDetails.cs | 0 Adyen/{src => }/Model/Checkout/UpiIntentDetails.cs | 0 Adyen/{src => }/Model/Checkout/UtilityRequest.cs | 0 Adyen/{src => }/Model/Checkout/UtilityResponse.cs | 0 Adyen/{src => }/Model/Checkout/VippsDetails.cs | 0 Adyen/{src => }/Model/Checkout/VisaCheckoutDetails.cs | 0 Adyen/{src => }/Model/Checkout/WeChatPayDetails.cs | 0 Adyen/{src => }/Model/Checkout/WeChatPayMiniProgramDetails.cs | 0 Adyen/{src => }/Model/Checkout/ZipDetails.cs | 0 .../Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/AccountHolder.cs | 0 .../Model/ConfigurationWebhooks/AccountHolderCapability.cs | 0 .../Model/ConfigurationWebhooks/AccountHolderNotificationData.cs | 0 .../ConfigurationWebhooks/AccountHolderNotificationRequest.cs | 0 .../ConfigurationWebhooks/AccountSupportingEntityCapability.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Address.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Amount.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Authentication.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Balance.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/BalanceAccount.cs | 0 .../Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs | 0 .../ConfigurationWebhooks/BalanceAccountNotificationRequest.cs | 0 .../ConfigurationWebhooks/BalancePlatformNotificationResponse.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/BankAccountDetails.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/BulkAddress.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/CapabilityProblem.cs | 0 .../Model/ConfigurationWebhooks/CapabilityProblemEntity.cs | 0 .../ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/CapabilitySettings.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Card.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/CardConfiguration.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/CardOrderItem.cs | 0 .../Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs | 0 .../Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/ContactDetails.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/DeliveryAddress.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/DeliveryContact.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Device.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Expiry.cs | 0 .../Model/ConfigurationWebhooks/IbanAccountIdentification.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Name.cs | 0 .../Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs | 0 .../ConfigurationWebhooks/NetworkTokenNotificationRequest.cs | 0 .../Model/ConfigurationWebhooks/NetworkTokenRequestor.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/PaymentInstrument.cs | 0 .../PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs | 0 .../ConfigurationWebhooks/PaymentInstrumentNotificationData.cs | 0 .../Model/ConfigurationWebhooks/PaymentNotificationRequest.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Phone.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/PhoneNumber.cs | 0 .../Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/RemediatingAction.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Resource.cs | 0 .../ConfigurationWebhooks/SweepConfigurationNotificationData.cs | 0 .../SweepConfigurationNotificationRequest.cs | 0 .../{src => }/Model/ConfigurationWebhooks/SweepConfigurationV2.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/SweepCounterparty.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/SweepSchedule.cs | 0 .../{src => }/Model/ConfigurationWebhooks/TokenAuthentication.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/ValidationFacts.cs | 0 .../{src => }/Model/ConfigurationWebhooks/VerificationDeadline.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/VerificationError.cs | 0 .../Model/ConfigurationWebhooks/VerificationErrorRecursive.cs | 0 Adyen/{src => }/Model/ConfigurationWebhooks/Wallet.cs | 0 Adyen/{src => }/Model/DataProtection/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/DataProtection/ServiceError.cs | 0 .../Model/DataProtection/SubjectErasureByPspReferenceRequest.cs | 0 Adyen/{src => }/Model/DataProtection/SubjectErasureResponse.cs | 0 Adyen/{src => }/Model/DisputeWebhooks/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/DisputeWebhooks/Amount.cs | 0 .../Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs | 0 Adyen/{src => }/Model/DisputeWebhooks/DisputeEventNotification.cs | 0 .../{src => }/Model/DisputeWebhooks/DisputeNotificationRequest.cs | 0 Adyen/{src => }/Model/Disputes/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/Disputes/AcceptDisputeRequest.cs | 0 Adyen/{src => }/Model/Disputes/AcceptDisputeResponse.cs | 0 Adyen/{src => }/Model/Disputes/DefendDisputeRequest.cs | 0 Adyen/{src => }/Model/Disputes/DefendDisputeResponse.cs | 0 Adyen/{src => }/Model/Disputes/DefenseDocument.cs | 0 Adyen/{src => }/Model/Disputes/DefenseDocumentType.cs | 0 Adyen/{src => }/Model/Disputes/DefenseReason.cs | 0 Adyen/{src => }/Model/Disputes/DefenseReasonsRequest.cs | 0 Adyen/{src => }/Model/Disputes/DefenseReasonsResponse.cs | 0 Adyen/{src => }/Model/Disputes/DeleteDefenseDocumentRequest.cs | 0 Adyen/{src => }/Model/Disputes/DeleteDefenseDocumentResponse.cs | 0 Adyen/{src => }/Model/Disputes/DisputeServiceResult.cs | 0 Adyen/{src => }/Model/Disputes/ServiceError.cs | 0 Adyen/{src => }/Model/Disputes/SupplyDefenseDocumentRequest.cs | 0 Adyen/{src => }/Model/Disputes/SupplyDefenseDocumentResponse.cs | 0 Adyen/{src => }/Model/Environment.cs | 0 .../Model/LegalEntityManagement/AULocalAccountIdentification.cs | 0 .../Model/LegalEntityManagement/AbstractOpenAPISchema.cs | 0 .../Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs | 0 .../Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs | 0 .../Model/LegalEntityManagement/AdditionalBankIdentification.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/Address.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/Amount.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/Attachment.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/BankAccountInfo.cs | 0 .../LegalEntityManagement/BankAccountInfoAccountIdentification.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/BirthData.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/BusinessLine.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/BusinessLineInfo.cs | 0 .../Model/LegalEntityManagement/BusinessLineInfoUpdate.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/BusinessLines.cs | 0 .../Model/LegalEntityManagement/CALocalAccountIdentification.cs | 0 .../Model/LegalEntityManagement/CZLocalAccountIdentification.cs | 0 .../Model/LegalEntityManagement/CalculatePciStatusRequest.cs | 0 .../Model/LegalEntityManagement/CalculatePciStatusResponse.cs | 0 .../CalculateTermsOfServiceStatusResponse.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/CapabilityProblem.cs | 0 .../Model/LegalEntityManagement/CapabilityProblemEntity.cs | 0 .../LegalEntityManagement/CapabilityProblemEntityRecursive.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/CapabilitySettings.cs | 0 .../CheckTaxElectronicDeliveryConsentResponse.cs | 0 .../Model/LegalEntityManagement/DKLocalAccountIdentification.cs | 0 .../Model/LegalEntityManagement/DataReviewConfirmationResponse.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/Document.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/DocumentPage.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/DocumentReference.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/EntityReference.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/FinancialReport.cs | 0 .../Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs | 0 .../Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs | 0 .../GetAcceptedTermsOfServiceDocumentResponse.cs | 0 .../LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs | 0 .../Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs | 0 .../GetTermsOfServiceAcceptanceInfosResponse.cs | 0 .../LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs | 0 .../LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs | 0 .../Model/LegalEntityManagement/HKLocalAccountIdentification.cs | 0 .../Model/LegalEntityManagement/HULocalAccountIdentification.cs | 0 .../Model/LegalEntityManagement/IbanAccountIdentification.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/IdentificationData.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/Individual.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/LegalEntity.cs | 0 .../Model/LegalEntityManagement/LegalEntityAssociation.cs | 0 .../Model/LegalEntityManagement/LegalEntityCapability.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/LegalEntityInfo.cs | 0 .../Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs | 0 .../Model/LegalEntityManagement/NOLocalAccountIdentification.cs | 0 .../Model/LegalEntityManagement/NZLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/Name.cs | 0 .../LegalEntityManagement/NumberAndBicAccountIdentification.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/OnboardingLink.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/OnboardingLinkInfo.cs | 0 .../Model/LegalEntityManagement/OnboardingLinkSettings.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/OnboardingTheme.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/OnboardingThemes.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/Organization.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/OwnerEntity.cs | 0 .../Model/LegalEntityManagement/PLLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/PciDocumentInfo.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/PciSigningRequest.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/PciSigningResponse.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/PhoneNumber.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/RemediatingAction.cs | 0 .../Model/LegalEntityManagement/SELocalAccountIdentification.cs | 0 .../Model/LegalEntityManagement/SGLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/ServiceError.cs | 0 .../SetTaxElectronicDeliveryConsentRequest.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/SoleProprietorship.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/SourceOfFunds.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/StockData.cs | 0 .../Model/LegalEntityManagement/SupportingEntityCapability.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/TaxInformation.cs | 0 .../Model/LegalEntityManagement/TaxReportingClassification.cs | 0 .../Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/TransferInstrument.cs | 0 .../Model/LegalEntityManagement/TransferInstrumentInfo.cs | 0 .../Model/LegalEntityManagement/TransferInstrumentReference.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/Trust.cs | 0 .../Model/LegalEntityManagement/UKLocalAccountIdentification.cs | 0 .../Model/LegalEntityManagement/USLocalAccountIdentification.cs | 0 .../{src => }/Model/LegalEntityManagement/UndefinedBeneficiary.cs | 0 .../Model/LegalEntityManagement/UnincorporatedPartnership.cs | 0 .../{src => }/Model/LegalEntityManagement/VerificationDeadline.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/VerificationError.cs | 0 .../Model/LegalEntityManagement/VerificationErrorRecursive.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/VerificationErrors.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/WebData.cs | 0 Adyen/{src => }/Model/LegalEntityManagement/WebDataExemption.cs | 0 Adyen/{src => }/Model/Management/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/Management/AccelInfo.cs | 0 Adyen/{src => }/Model/Management/AdditionalCommission.cs | 0 Adyen/{src => }/Model/Management/AdditionalSettings.cs | 0 Adyen/{src => }/Model/Management/AdditionalSettingsResponse.cs | 0 Adyen/{src => }/Model/Management/Address.cs | 0 Adyen/{src => }/Model/Management/AffirmInfo.cs | 0 Adyen/{src => }/Model/Management/AfterpayTouchInfo.cs | 0 Adyen/{src => }/Model/Management/AllowedOrigin.cs | 0 Adyen/{src => }/Model/Management/AllowedOriginsResponse.cs | 0 Adyen/{src => }/Model/Management/AmexInfo.cs | 0 Adyen/{src => }/Model/Management/Amount.cs | 0 Adyen/{src => }/Model/Management/AndroidApp.cs | 0 Adyen/{src => }/Model/Management/AndroidAppError.cs | 0 Adyen/{src => }/Model/Management/AndroidAppsResponse.cs | 0 Adyen/{src => }/Model/Management/AndroidCertificate.cs | 0 Adyen/{src => }/Model/Management/AndroidCertificatesResponse.cs | 0 Adyen/{src => }/Model/Management/ApiCredential.cs | 0 Adyen/{src => }/Model/Management/ApiCredentialLinks.cs | 0 Adyen/{src => }/Model/Management/ApplePayInfo.cs | 0 Adyen/{src => }/Model/Management/BcmcInfo.cs | 0 Adyen/{src => }/Model/Management/BillingEntitiesResponse.cs | 0 Adyen/{src => }/Model/Management/BillingEntity.cs | 0 Adyen/{src => }/Model/Management/CardholderReceipt.cs | 0 Adyen/{src => }/Model/Management/CartesBancairesInfo.cs | 0 Adyen/{src => }/Model/Management/ClearpayInfo.cs | 0 Adyen/{src => }/Model/Management/Commission.cs | 0 Adyen/{src => }/Model/Management/Company.cs | 0 Adyen/{src => }/Model/Management/CompanyApiCredential.cs | 0 Adyen/{src => }/Model/Management/CompanyLinks.cs | 0 Adyen/{src => }/Model/Management/CompanyUser.cs | 0 Adyen/{src => }/Model/Management/Connectivity.cs | 0 Adyen/{src => }/Model/Management/Contact.cs | 0 Adyen/{src => }/Model/Management/CreateAllowedOriginRequest.cs | 0 Adyen/{src => }/Model/Management/CreateApiCredentialResponse.cs | 0 .../Model/Management/CreateCompanyApiCredentialRequest.cs | 0 .../Model/Management/CreateCompanyApiCredentialResponse.cs | 0 Adyen/{src => }/Model/Management/CreateCompanyUserRequest.cs | 0 Adyen/{src => }/Model/Management/CreateCompanyUserResponse.cs | 0 Adyen/{src => }/Model/Management/CreateCompanyWebhookRequest.cs | 0 .../Model/Management/CreateMerchantApiCredentialRequest.cs | 0 Adyen/{src => }/Model/Management/CreateMerchantRequest.cs | 0 Adyen/{src => }/Model/Management/CreateMerchantResponse.cs | 0 Adyen/{src => }/Model/Management/CreateMerchantUserRequest.cs | 0 Adyen/{src => }/Model/Management/CreateMerchantWebhookRequest.cs | 0 Adyen/{src => }/Model/Management/CreateUserResponse.cs | 0 Adyen/{src => }/Model/Management/Currency.cs | 0 Adyen/{src => }/Model/Management/CustomNotification.cs | 0 Adyen/{src => }/Model/Management/DataCenter.cs | 0 Adyen/{src => }/Model/Management/DinersInfo.cs | 0 Adyen/{src => }/Model/Management/EventUrl.cs | 0 Adyen/{src => }/Model/Management/ExternalTerminalAction.cs | 0 Adyen/{src => }/Model/Management/File.cs | 0 Adyen/{src => }/Model/Management/GenerateApiKeyResponse.cs | 0 Adyen/{src => }/Model/Management/GenerateClientKeyResponse.cs | 0 Adyen/{src => }/Model/Management/GenerateHmacKeyResponse.cs | 0 Adyen/{src => }/Model/Management/GenericPmWithTdiInfo.cs | 0 Adyen/{src => }/Model/Management/GiroPayInfo.cs | 0 Adyen/{src => }/Model/Management/GooglePayInfo.cs | 0 Adyen/{src => }/Model/Management/Gratuity.cs | 0 Adyen/{src => }/Model/Management/Hardware.cs | 0 Adyen/{src => }/Model/Management/IdName.cs | 0 Adyen/{src => }/Model/Management/InstallAndroidAppDetails.cs | 0 .../Model/Management/InstallAndroidCertificateDetails.cs | 0 Adyen/{src => }/Model/Management/InvalidField.cs | 0 Adyen/{src => }/Model/Management/JCBInfo.cs | 0 Adyen/{src => }/Model/Management/Key.cs | 0 Adyen/{src => }/Model/Management/KlarnaInfo.cs | 0 Adyen/{src => }/Model/Management/Links.cs | 0 Adyen/{src => }/Model/Management/LinksElement.cs | 0 .../Model/Management/ListCompanyApiCredentialsResponse.cs | 0 Adyen/{src => }/Model/Management/ListCompanyResponse.cs | 0 Adyen/{src => }/Model/Management/ListCompanyUsersResponse.cs | 0 .../Model/Management/ListExternalTerminalActionsResponse.cs | 0 .../Model/Management/ListMerchantApiCredentialsResponse.cs | 0 Adyen/{src => }/Model/Management/ListMerchantResponse.cs | 0 Adyen/{src => }/Model/Management/ListMerchantUsersResponse.cs | 0 Adyen/{src => }/Model/Management/ListStoresResponse.cs | 0 Adyen/{src => }/Model/Management/ListTerminalsResponse.cs | 0 Adyen/{src => }/Model/Management/ListWebhooksResponse.cs | 0 Adyen/{src => }/Model/Management/Localization.cs | 0 Adyen/{src => }/Model/Management/Logo.cs | 0 Adyen/{src => }/Model/Management/MeApiCredential.cs | 0 Adyen/{src => }/Model/Management/MealVoucherFRInfo.cs | 0 Adyen/{src => }/Model/Management/Merchant.cs | 0 Adyen/{src => }/Model/Management/MerchantLinks.cs | 0 Adyen/{src => }/Model/Management/MinorUnitsMonetaryValue.cs | 0 Adyen/{src => }/Model/Management/ModelConfiguration.cs | 0 Adyen/{src => }/Model/Management/Name.cs | 0 Adyen/{src => }/Model/Management/Name2.cs | 0 Adyen/{src => }/Model/Management/Nexo.cs | 0 Adyen/{src => }/Model/Management/Notification.cs | 0 Adyen/{src => }/Model/Management/NotificationUrl.cs | 0 Adyen/{src => }/Model/Management/NyceInfo.cs | 0 Adyen/{src => }/Model/Management/OfflineProcessing.cs | 0 Adyen/{src => }/Model/Management/Opi.cs | 0 Adyen/{src => }/Model/Management/OrderItem.cs | 0 Adyen/{src => }/Model/Management/PaginationLinks.cs | 0 Adyen/{src => }/Model/Management/Passcodes.cs | 0 Adyen/{src => }/Model/Management/PayAtTable.cs | 0 Adyen/{src => }/Model/Management/PayMeInfo.cs | 0 Adyen/{src => }/Model/Management/PayPalInfo.cs | 0 Adyen/{src => }/Model/Management/PayToInfo.cs | 0 Adyen/{src => }/Model/Management/Payment.cs | 0 Adyen/{src => }/Model/Management/PaymentMethod.cs | 0 Adyen/{src => }/Model/Management/PaymentMethodResponse.cs | 0 Adyen/{src => }/Model/Management/PaymentMethodSetupInfo.cs | 0 Adyen/{src => }/Model/Management/PayoutSettings.cs | 0 Adyen/{src => }/Model/Management/PayoutSettingsRequest.cs | 0 Adyen/{src => }/Model/Management/PayoutSettingsResponse.cs | 0 Adyen/{src => }/Model/Management/Profile.cs | 0 Adyen/{src => }/Model/Management/PulseInfo.cs | 0 Adyen/{src => }/Model/Management/ReceiptOptions.cs | 0 Adyen/{src => }/Model/Management/ReceiptPrinting.cs | 0 Adyen/{src => }/Model/Management/Referenced.cs | 0 Adyen/{src => }/Model/Management/Refunds.cs | 0 Adyen/{src => }/Model/Management/ReleaseUpdateDetails.cs | 0 Adyen/{src => }/Model/Management/ReprocessAndroidAppResponse.cs | 0 Adyen/{src => }/Model/Management/RequestActivationResponse.cs | 0 Adyen/{src => }/Model/Management/RestServiceError.cs | 0 .../{src => }/Model/Management/ScheduleTerminalActionsRequest.cs | 0 .../Management/ScheduleTerminalActionsRequestActionDetails.cs | 0 .../{src => }/Model/Management/ScheduleTerminalActionsResponse.cs | 0 Adyen/{src => }/Model/Management/Settings.cs | 0 Adyen/{src => }/Model/Management/ShippingLocation.cs | 0 Adyen/{src => }/Model/Management/ShippingLocationsResponse.cs | 0 Adyen/{src => }/Model/Management/Signature.cs | 0 Adyen/{src => }/Model/Management/SodexoInfo.cs | 0 Adyen/{src => }/Model/Management/SofortInfo.cs | 0 Adyen/{src => }/Model/Management/SplitConfiguration.cs | 0 Adyen/{src => }/Model/Management/SplitConfigurationList.cs | 0 Adyen/{src => }/Model/Management/SplitConfigurationLogic.cs | 0 Adyen/{src => }/Model/Management/SplitConfigurationRule.cs | 0 Adyen/{src => }/Model/Management/Standalone.cs | 0 Adyen/{src => }/Model/Management/StarInfo.cs | 0 Adyen/{src => }/Model/Management/Store.cs | 0 Adyen/{src => }/Model/Management/StoreAndForward.cs | 0 Adyen/{src => }/Model/Management/StoreCreationRequest.cs | 0 .../Model/Management/StoreCreationWithMerchantCodeRequest.cs | 0 Adyen/{src => }/Model/Management/StoreLocation.cs | 0 Adyen/{src => }/Model/Management/StoreSplitConfiguration.cs | 0 Adyen/{src => }/Model/Management/SupportedCardTypes.cs | 0 Adyen/{src => }/Model/Management/Surcharge.cs | 0 Adyen/{src => }/Model/Management/SwishInfo.cs | 0 Adyen/{src => }/Model/Management/TapToPay.cs | 0 Adyen/{src => }/Model/Management/Terminal.cs | 0 Adyen/{src => }/Model/Management/TerminalActionScheduleDetail.cs | 0 Adyen/{src => }/Model/Management/TerminalAssignment.cs | 0 Adyen/{src => }/Model/Management/TerminalConnectivity.cs | 0 Adyen/{src => }/Model/Management/TerminalConnectivityBluetooth.cs | 0 Adyen/{src => }/Model/Management/TerminalConnectivityCellular.cs | 0 Adyen/{src => }/Model/Management/TerminalConnectivityEthernet.cs | 0 Adyen/{src => }/Model/Management/TerminalConnectivityWifi.cs | 0 Adyen/{src => }/Model/Management/TerminalInstructions.cs | 0 Adyen/{src => }/Model/Management/TerminalModelsResponse.cs | 0 Adyen/{src => }/Model/Management/TerminalOrder.cs | 0 Adyen/{src => }/Model/Management/TerminalOrderRequest.cs | 0 Adyen/{src => }/Model/Management/TerminalOrdersResponse.cs | 0 Adyen/{src => }/Model/Management/TerminalProduct.cs | 0 Adyen/{src => }/Model/Management/TerminalProductPrice.cs | 0 Adyen/{src => }/Model/Management/TerminalProductsResponse.cs | 0 Adyen/{src => }/Model/Management/TerminalReassignmentRequest.cs | 0 Adyen/{src => }/Model/Management/TerminalReassignmentTarget.cs | 0 Adyen/{src => }/Model/Management/TerminalSettings.cs | 0 Adyen/{src => }/Model/Management/TestCompanyWebhookRequest.cs | 0 Adyen/{src => }/Model/Management/TestOutput.cs | 0 Adyen/{src => }/Model/Management/TestWebhookRequest.cs | 0 Adyen/{src => }/Model/Management/TestWebhookResponse.cs | 0 Adyen/{src => }/Model/Management/TicketInfo.cs | 0 Adyen/{src => }/Model/Management/Timeouts.cs | 0 Adyen/{src => }/Model/Management/TransactionDescriptionInfo.cs | 0 Adyen/{src => }/Model/Management/TwintInfo.cs | 0 Adyen/{src => }/Model/Management/UninstallAndroidAppDetails.cs | 0 .../Model/Management/UninstallAndroidCertificateDetails.cs | 0 Adyen/{src => }/Model/Management/UpdatableAddress.cs | 0 .../Model/Management/UpdateCompanyApiCredentialRequest.cs | 0 Adyen/{src => }/Model/Management/UpdateCompanyUserRequest.cs | 0 Adyen/{src => }/Model/Management/UpdateCompanyWebhookRequest.cs | 0 .../Model/Management/UpdateMerchantApiCredentialRequest.cs | 0 Adyen/{src => }/Model/Management/UpdateMerchantUserRequest.cs | 0 Adyen/{src => }/Model/Management/UpdateMerchantWebhookRequest.cs | 0 Adyen/{src => }/Model/Management/UpdatePaymentMethodInfo.cs | 0 Adyen/{src => }/Model/Management/UpdatePayoutSettingsRequest.cs | 0 .../Model/Management/UpdateSplitConfigurationLogicRequest.cs | 0 .../{src => }/Model/Management/UpdateSplitConfigurationRequest.cs | 0 .../Model/Management/UpdateSplitConfigurationRuleRequest.cs | 0 Adyen/{src => }/Model/Management/UpdateStoreRequest.cs | 0 Adyen/{src => }/Model/Management/UploadAndroidAppResponse.cs | 0 .../Model/Management/UploadAndroidCertificateResponse.cs | 0 Adyen/{src => }/Model/Management/Url.cs | 0 Adyen/{src => }/Model/Management/User.cs | 0 Adyen/{src => }/Model/Management/VippsInfo.cs | 0 Adyen/{src => }/Model/Management/WeChatPayInfo.cs | 0 Adyen/{src => }/Model/Management/WeChatPayPosInfo.cs | 0 Adyen/{src => }/Model/Management/Webhook.cs | 0 Adyen/{src => }/Model/Management/WebhookLinks.cs | 0 Adyen/{src => }/Model/Management/WifiProfiles.cs | 0 Adyen/{src => }/Model/ManagementWebhooks/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/ManagementWebhooks/AccountCapabilityData.cs | 0 .../Model/ManagementWebhooks/AccountCreateNotificationData.cs | 0 .../Model/ManagementWebhooks/AccountNotificationResponse.cs | 0 .../Model/ManagementWebhooks/AccountUpdateNotificationData.cs | 0 Adyen/{src => }/Model/ManagementWebhooks/CapabilityProblem.cs | 0 .../{src => }/Model/ManagementWebhooks/CapabilityProblemEntity.cs | 0 .../Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs | 0 .../ManagementWebhooks/MerchantCreatedNotificationRequest.cs | 0 .../ManagementWebhooks/MerchantUpdatedNotificationRequest.cs | 0 .../Model/ManagementWebhooks/MidServiceNotificationData.cs | 0 .../ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs | 0 .../Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs | 0 .../PaymentMethodRequestRemovedNotificationRequest.cs | 0 .../PaymentMethodScheduledForRemovalNotificationRequest.cs | 0 Adyen/{src => }/Model/ManagementWebhooks/RemediatingAction.cs | 0 .../ManagementWebhooks/TerminalAssignmentNotificationRequest.cs | 0 .../ManagementWebhooks/TerminalAssignmentNotificationResponse.cs | 0 Adyen/{src => }/Model/ManagementWebhooks/TerminalBoardingData.cs | 0 .../ManagementWebhooks/TerminalBoardingNotificationRequest.cs | 0 .../ManagementWebhooks/TerminalBoardingNotificationResponse.cs | 0 Adyen/{src => }/Model/ManagementWebhooks/TerminalSettingsData.cs | 0 .../ManagementWebhooks/TerminalSettingsNotificationRequest.cs | 0 .../ManagementWebhooks/TerminalSettingsNotificationResponse.cs | 0 Adyen/{src => }/Model/ManagementWebhooks/VerificationError.cs | 0 .../Model/ManagementWebhooks/VerificationErrorRecursive.cs | 0 .../Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/Amount.cs | 0 .../NegativeBalanceCompensationWarningNotificationData.cs | 0 .../NegativeBalanceCompensationWarningNotificationRequest.cs | 0 Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/Resource.cs | 0 .../Model/NegativeBalanceWarningWebhooks/ResourceReference.cs | 0 Adyen/{src => }/Model/Notification/NotificationRequest.cs | 0 Adyen/{src => }/Model/Notification/NotificationRequestConst.cs | 0 Adyen/{src => }/Model/Notification/NotificationRequestItem.cs | 0 .../Model/Notification/NotificationRequestItemContainer.cs | 0 Adyen/{src => }/Model/Payment/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/Payment/AccountInfo.cs | 0 Adyen/{src => }/Model/Payment/AcctInfo.cs | 0 Adyen/{src => }/Model/Payment/AdditionalData3DSecure.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataAirline.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataCarRental.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataCommon.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataLevel23.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataLodging.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataModifications.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataOpenInvoice.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataOpi.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataRatepay.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataRetry.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataRisk.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataRiskStandalone.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataSubMerchant.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataTemporaryServices.cs | 0 Adyen/{src => }/Model/Payment/AdditionalDataWallets.cs | 0 Adyen/{src => }/Model/Payment/Address.cs | 0 Adyen/{src => }/Model/Payment/AdjustAuthorisationRequest.cs | 0 Adyen/{src => }/Model/Payment/Amount.cs | 0 Adyen/{src => }/Model/Payment/ApplicationInfo.cs | 0 Adyen/{src => }/Model/Payment/AuthenticationResultRequest.cs | 0 Adyen/{src => }/Model/Payment/AuthenticationResultResponse.cs | 0 Adyen/{src => }/Model/Payment/BankAccount.cs | 0 Adyen/{src => }/Model/Payment/BrowserInfo.cs | 0 Adyen/{src => }/Model/Payment/CancelOrRefundRequest.cs | 0 Adyen/{src => }/Model/Payment/CancelRequest.cs | 0 Adyen/{src => }/Model/Payment/CaptureRequest.cs | 0 Adyen/{src => }/Model/Payment/Card.cs | 0 Adyen/{src => }/Model/Payment/CommonField.cs | 0 Adyen/{src => }/Model/Payment/DeviceRenderOptions.cs | 0 Adyen/{src => }/Model/Payment/DonationRequest.cs | 0 Adyen/{src => }/Model/Payment/ExternalPlatform.cs | 0 Adyen/{src => }/Model/Payment/ForexQuote.cs | 0 Adyen/{src => }/Model/Payment/FraudCheckResult.cs | 0 Adyen/{src => }/Model/Payment/FraudCheckResultWrapper.cs | 0 Adyen/{src => }/Model/Payment/FraudResult.cs | 0 Adyen/{src => }/Model/Payment/FundDestination.cs | 0 Adyen/{src => }/Model/Payment/FundSource.cs | 0 Adyen/{src => }/Model/Payment/Installments.cs | 0 Adyen/{src => }/Model/Payment/Mandate.cs | 0 Adyen/{src => }/Model/Payment/MerchantDevice.cs | 0 Adyen/{src => }/Model/Payment/MerchantRiskIndicator.cs | 0 Adyen/{src => }/Model/Payment/ModificationResult.cs | 0 Adyen/{src => }/Model/Payment/Name.cs | 0 Adyen/{src => }/Model/Payment/PaymentRequest.cs | 0 Adyen/{src => }/Model/Payment/PaymentRequest3d.cs | 0 Adyen/{src => }/Model/Payment/PaymentRequest3ds2.cs | 0 Adyen/{src => }/Model/Payment/PaymentResult.cs | 0 Adyen/{src => }/Model/Payment/Phone.cs | 0 Adyen/{src => }/Model/Payment/PlatformChargebackLogic.cs | 0 Adyen/{src => }/Model/Payment/Recurring.cs | 0 Adyen/{src => }/Model/Payment/RefundRequest.cs | 0 Adyen/{src => }/Model/Payment/ResponseAdditionalData3DSecure.cs | 0 .../Model/Payment/ResponseAdditionalDataBillingAddress.cs | 0 Adyen/{src => }/Model/Payment/ResponseAdditionalDataCard.cs | 0 Adyen/{src => }/Model/Payment/ResponseAdditionalDataCommon.cs | 0 .../Model/Payment/ResponseAdditionalDataDomesticError.cs | 0 .../{src => }/Model/Payment/ResponseAdditionalDataInstallments.cs | 0 .../Model/Payment/ResponseAdditionalDataNetworkTokens.cs | 0 Adyen/{src => }/Model/Payment/ResponseAdditionalDataOpi.cs | 0 Adyen/{src => }/Model/Payment/ResponseAdditionalDataSepa.cs | 0 Adyen/{src => }/Model/Payment/SDKEphemPubKey.cs | 0 Adyen/{src => }/Model/Payment/SecureRemoteCommerceCheckoutData.cs | 0 Adyen/{src => }/Model/Payment/ServiceError.cs | 0 Adyen/{src => }/Model/Payment/ShopperInteractionDevice.cs | 0 Adyen/{src => }/Model/Payment/Split.cs | 0 Adyen/{src => }/Model/Payment/SplitAmount.cs | 0 Adyen/{src => }/Model/Payment/SubMerchant.cs | 0 Adyen/{src => }/Model/Payment/TechnicalCancelRequest.cs | 0 Adyen/{src => }/Model/Payment/ThreeDS1Result.cs | 0 Adyen/{src => }/Model/Payment/ThreeDS2RequestData.cs | 0 Adyen/{src => }/Model/Payment/ThreeDS2Result.cs | 0 Adyen/{src => }/Model/Payment/ThreeDS2ResultRequest.cs | 0 Adyen/{src => }/Model/Payment/ThreeDS2ResultResponse.cs | 0 .../{src => }/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs | 0 .../Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs | 0 Adyen/{src => }/Model/Payment/ThreeDSecureData.cs | 0 Adyen/{src => }/Model/Payment/VoidPendingRefundRequest.cs | 0 Adyen/{src => }/Model/PaymentsApp/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/PaymentsApp/BoardingTokenRequest.cs | 0 Adyen/{src => }/Model/PaymentsApp/BoardingTokenResponse.cs | 0 Adyen/{src => }/Model/PaymentsApp/DefaultErrorResponseEntity.cs | 0 Adyen/{src => }/Model/PaymentsApp/InvalidField.cs | 0 Adyen/{src => }/Model/PaymentsApp/PaymentsAppDto.cs | 0 Adyen/{src => }/Model/PaymentsApp/PaymentsAppResponse.cs | 0 Adyen/{src => }/Model/Payout/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/Payout/Address.cs | 0 Adyen/{src => }/Model/Payout/Amount.cs | 0 Adyen/{src => }/Model/Payout/BankAccount.cs | 0 Adyen/{src => }/Model/Payout/Card.cs | 0 Adyen/{src => }/Model/Payout/FraudCheckResult.cs | 0 Adyen/{src => }/Model/Payout/FraudCheckResultWrapper.cs | 0 Adyen/{src => }/Model/Payout/FraudResult.cs | 0 Adyen/{src => }/Model/Payout/FundSource.cs | 0 Adyen/{src => }/Model/Payout/ModifyRequest.cs | 0 Adyen/{src => }/Model/Payout/ModifyResponse.cs | 0 Adyen/{src => }/Model/Payout/Name.cs | 0 Adyen/{src => }/Model/Payout/PayoutRequest.cs | 0 Adyen/{src => }/Model/Payout/PayoutResponse.cs | 0 Adyen/{src => }/Model/Payout/Recurring.cs | 0 Adyen/{src => }/Model/Payout/ResponseAdditionalData3DSecure.cs | 0 .../Model/Payout/ResponseAdditionalDataBillingAddress.cs | 0 Adyen/{src => }/Model/Payout/ResponseAdditionalDataCard.cs | 0 Adyen/{src => }/Model/Payout/ResponseAdditionalDataCommon.cs | 0 .../{src => }/Model/Payout/ResponseAdditionalDataDomesticError.cs | 0 .../{src => }/Model/Payout/ResponseAdditionalDataInstallments.cs | 0 .../{src => }/Model/Payout/ResponseAdditionalDataNetworkTokens.cs | 0 Adyen/{src => }/Model/Payout/ResponseAdditionalDataOpi.cs | 0 Adyen/{src => }/Model/Payout/ResponseAdditionalDataSepa.cs | 0 Adyen/{src => }/Model/Payout/ServiceError.cs | 0 Adyen/{src => }/Model/Payout/StoreDetailAndSubmitRequest.cs | 0 Adyen/{src => }/Model/Payout/StoreDetailAndSubmitResponse.cs | 0 Adyen/{src => }/Model/Payout/StoreDetailRequest.cs | 0 Adyen/{src => }/Model/Payout/StoreDetailResponse.cs | 0 Adyen/{src => }/Model/Payout/SubmitRequest.cs | 0 Adyen/{src => }/Model/Payout/SubmitResponse.cs | 0 Adyen/{src => }/Model/PlatformsAccount/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/PlatformsAccount/Account.cs | 0 Adyen/{src => }/Model/PlatformsAccount/AccountEvent.cs | 0 Adyen/{src => }/Model/PlatformsAccount/AccountHolderDetails.cs | 0 Adyen/{src => }/Model/PlatformsAccount/AccountHolderStatus.cs | 0 Adyen/{src => }/Model/PlatformsAccount/AccountPayoutState.cs | 0 Adyen/{src => }/Model/PlatformsAccount/AccountProcessingState.cs | 0 Adyen/{src => }/Model/PlatformsAccount/Amount.cs | 0 Adyen/{src => }/Model/PlatformsAccount/BankAccountDetail.cs | 0 Adyen/{src => }/Model/PlatformsAccount/BusinessDetails.cs | 0 .../{src => }/Model/PlatformsAccount/CloseAccountHolderRequest.cs | 0 .../Model/PlatformsAccount/CloseAccountHolderResponse.cs | 0 Adyen/{src => }/Model/PlatformsAccount/CloseAccountRequest.cs | 0 Adyen/{src => }/Model/PlatformsAccount/CloseAccountResponse.cs | 0 Adyen/{src => }/Model/PlatformsAccount/CloseStoresRequest.cs | 0 .../Model/PlatformsAccount/CreateAccountHolderRequest.cs | 0 .../Model/PlatformsAccount/CreateAccountHolderResponse.cs | 0 Adyen/{src => }/Model/PlatformsAccount/CreateAccountRequest.cs | 0 Adyen/{src => }/Model/PlatformsAccount/CreateAccountResponse.cs | 0 .../{src => }/Model/PlatformsAccount/DeleteBankAccountRequest.cs | 0 .../Model/PlatformsAccount/DeleteLegalArrangementRequest.cs | 0 .../{src => }/Model/PlatformsAccount/DeletePayoutMethodRequest.cs | 0 .../{src => }/Model/PlatformsAccount/DeleteShareholderRequest.cs | 0 .../{src => }/Model/PlatformsAccount/DeleteSignatoriesRequest.cs | 0 Adyen/{src => }/Model/PlatformsAccount/DocumentDetail.cs | 0 Adyen/{src => }/Model/PlatformsAccount/ErrorFieldType.cs | 0 Adyen/{src => }/Model/PlatformsAccount/FieldType.cs | 0 Adyen/{src => }/Model/PlatformsAccount/GenericResponse.cs | 0 Adyen/{src => }/Model/PlatformsAccount/GetAccountHolderRequest.cs | 0 .../{src => }/Model/PlatformsAccount/GetAccountHolderResponse.cs | 0 .../Model/PlatformsAccount/GetAccountHolderStatusResponse.cs | 0 Adyen/{src => }/Model/PlatformsAccount/GetTaxFormRequest.cs | 0 Adyen/{src => }/Model/PlatformsAccount/GetTaxFormResponse.cs | 0 .../Model/PlatformsAccount/GetUploadedDocumentsRequest.cs | 0 .../Model/PlatformsAccount/GetUploadedDocumentsResponse.cs | 0 Adyen/{src => }/Model/PlatformsAccount/IndividualDetails.cs | 0 Adyen/{src => }/Model/PlatformsAccount/KYCCheckResult.cs | 0 Adyen/{src => }/Model/PlatformsAccount/KYCCheckStatusData.cs | 0 Adyen/{src => }/Model/PlatformsAccount/KYCCheckSummary.cs | 0 .../Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs | 0 .../PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs | 0 .../Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs | 0 .../{src => }/Model/PlatformsAccount/KYCShareholderCheckResult.cs | 0 Adyen/{src => }/Model/PlatformsAccount/KYCSignatoryCheckResult.cs | 0 .../Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs | 0 Adyen/{src => }/Model/PlatformsAccount/KYCVerificationResult.cs | 0 Adyen/{src => }/Model/PlatformsAccount/LegalArrangementDetail.cs | 0 .../Model/PlatformsAccount/LegalArrangementEntityDetail.cs | 0 Adyen/{src => }/Model/PlatformsAccount/LegalArrangementRequest.cs | 0 Adyen/{src => }/Model/PlatformsAccount/MigratedAccounts.cs | 0 Adyen/{src => }/Model/PlatformsAccount/MigratedShareholders.cs | 0 Adyen/{src => }/Model/PlatformsAccount/MigratedStores.cs | 0 Adyen/{src => }/Model/PlatformsAccount/MigrationData.cs | 0 Adyen/{src => }/Model/PlatformsAccount/PayoutMethod.cs | 0 Adyen/{src => }/Model/PlatformsAccount/PayoutScheduleResponse.cs | 0 .../Model/PlatformsAccount/PerformVerificationRequest.cs | 0 Adyen/{src => }/Model/PlatformsAccount/PersonalDocumentData.cs | 0 Adyen/{src => }/Model/PlatformsAccount/ServiceError.cs | 0 Adyen/{src => }/Model/PlatformsAccount/ShareholderContact.cs | 0 Adyen/{src => }/Model/PlatformsAccount/SignatoryContact.cs | 0 Adyen/{src => }/Model/PlatformsAccount/StoreDetail.cs | 0 .../Model/PlatformsAccount/SuspendAccountHolderRequest.cs | 0 .../Model/PlatformsAccount/SuspendAccountHolderResponse.cs | 0 Adyen/{src => }/Model/PlatformsAccount/UltimateParentCompany.cs | 0 .../PlatformsAccount/UltimateParentCompanyBusinessDetails.cs | 0 .../Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs | 0 .../Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs | 0 .../Model/PlatformsAccount/UpdateAccountHolderRequest.cs | 0 .../Model/PlatformsAccount/UpdateAccountHolderResponse.cs | 0 .../Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs | 0 Adyen/{src => }/Model/PlatformsAccount/UpdateAccountRequest.cs | 0 Adyen/{src => }/Model/PlatformsAccount/UpdateAccountResponse.cs | 0 .../Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs | 0 Adyen/{src => }/Model/PlatformsAccount/UploadDocumentRequest.cs | 0 Adyen/{src => }/Model/PlatformsAccount/ViasAddress.cs | 0 Adyen/{src => }/Model/PlatformsAccount/ViasName.cs | 0 Adyen/{src => }/Model/PlatformsAccount/ViasPersonalData.cs | 0 Adyen/{src => }/Model/PlatformsAccount/ViasPhoneNumber.cs | 0 Adyen/{src => }/Model/PlatformsFund/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/PlatformsFund/AccountDetailBalance.cs | 0 .../{src => }/Model/PlatformsFund/AccountHolderBalanceRequest.cs | 0 .../{src => }/Model/PlatformsFund/AccountHolderBalanceResponse.cs | 0 .../Model/PlatformsFund/AccountHolderTransactionListRequest.cs | 0 .../Model/PlatformsFund/AccountHolderTransactionListResponse.cs | 0 Adyen/{src => }/Model/PlatformsFund/AccountTransactionList.cs | 0 Adyen/{src => }/Model/PlatformsFund/Amount.cs | 0 Adyen/{src => }/Model/PlatformsFund/BankAccountDetail.cs | 0 Adyen/{src => }/Model/PlatformsFund/DebitAccountHolderRequest.cs | 0 Adyen/{src => }/Model/PlatformsFund/DebitAccountHolderResponse.cs | 0 Adyen/{src => }/Model/PlatformsFund/DetailBalance.cs | 0 Adyen/{src => }/Model/PlatformsFund/ErrorFieldType.cs | 0 Adyen/{src => }/Model/PlatformsFund/FieldType.cs | 0 Adyen/{src => }/Model/PlatformsFund/PayoutAccountHolderRequest.cs | 0 .../{src => }/Model/PlatformsFund/PayoutAccountHolderResponse.cs | 0 Adyen/{src => }/Model/PlatformsFund/RefundFundsTransferRequest.cs | 0 .../{src => }/Model/PlatformsFund/RefundFundsTransferResponse.cs | 0 .../Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs | 0 .../Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs | 0 Adyen/{src => }/Model/PlatformsFund/ServiceError.cs | 0 Adyen/{src => }/Model/PlatformsFund/SetupBeneficiaryRequest.cs | 0 Adyen/{src => }/Model/PlatformsFund/SetupBeneficiaryResponse.cs | 0 Adyen/{src => }/Model/PlatformsFund/Split.cs | 0 Adyen/{src => }/Model/PlatformsFund/SplitAmount.cs | 0 Adyen/{src => }/Model/PlatformsFund/Transaction.cs | 0 Adyen/{src => }/Model/PlatformsFund/TransactionListForAccount.cs | 0 Adyen/{src => }/Model/PlatformsFund/TransferFundsRequest.cs | 0 Adyen/{src => }/Model/PlatformsFund/TransferFundsResponse.cs | 0 .../Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs | 0 .../Model/PlatformsHostedOnboardingPage/CollectInformation.cs | 0 .../Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs | 0 Adyen/{src => }/Model/PlatformsHostedOnboardingPage/FieldType.cs | 0 .../PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs | 0 .../PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs | 0 .../Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs | 0 .../Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs | 0 .../{src => }/Model/PlatformsHostedOnboardingPage/ServiceError.cs | 0 Adyen/{src => }/Model/PlatformsHostedOnboardingPage/ShowPages.cs | 0 .../PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs | 0 .../CreateNotificationConfigurationRequest.cs | 0 .../DeleteNotificationConfigurationRequest.cs | 0 .../Model/PlatformsNotificationConfiguration/ErrorFieldType.cs | 0 .../Model/PlatformsNotificationConfiguration/ExchangeMessage.cs | 0 .../Model/PlatformsNotificationConfiguration/FieldType.cs | 0 .../Model/PlatformsNotificationConfiguration/GenericResponse.cs | 0 .../GetNotificationConfigurationListResponse.cs | 0 .../GetNotificationConfigurationRequest.cs | 0 .../GetNotificationConfigurationResponse.cs | 0 .../NotificationConfigurationDetails.cs | 0 .../NotificationEventConfiguration.cs | 0 .../Model/PlatformsNotificationConfiguration/ServiceError.cs | 0 .../TestNotificationConfigurationRequest.cs | 0 .../TestNotificationConfigurationResponse.cs | 0 .../UpdateNotificationConfigurationRequest.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs | 0 .../{src => }/Model/PlatformsWebhooks/AccountCloseNotification.cs | 0 .../Model/PlatformsWebhooks/AccountCreateNotification.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/AccountEvent.cs | 0 .../PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs | 0 .../AccountFundsBelowThresholdNotificationContent.cs | 0 .../Model/PlatformsWebhooks/AccountHolderCreateNotification.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderDetails.cs | 0 .../Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs | 0 .../PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderStatus.cs | 0 .../PlatformsWebhooks/AccountHolderStatusChangeNotification.cs | 0 .../AccountHolderStatusChangeNotificationContent.cs | 0 .../AccountHolderStoreStatusChangeNotification.cs | 0 .../AccountHolderStoreStatusChangeNotificationContent.cs | 0 .../AccountHolderUpcomingDeadlineNotification.cs | 0 .../AccountHolderUpcomingDeadlineNotificationContent.cs | 0 .../Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs | 0 .../PlatformsWebhooks/AccountHolderVerificationNotification.cs | 0 .../AccountHolderVerificationNotificationContent.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/AccountPayoutState.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/AccountProcessingState.cs | 0 .../Model/PlatformsWebhooks/AccountUpdateNotification.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/Amount.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/BankAccountDetail.cs | 0 .../Model/PlatformsWebhooks/BeneficiarySetupNotification.cs | 0 .../PlatformsWebhooks/BeneficiarySetupNotificationContent.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/BusinessDetails.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/CloseAccountResponse.cs | 0 .../PlatformsWebhooks/CompensateNegativeBalanceNotification.cs | 0 .../CompensateNegativeBalanceNotificationContent.cs | 0 .../CompensateNegativeBalanceNotificationRecord.cs | 0 .../Model/PlatformsWebhooks/CreateAccountHolderResponse.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/CreateAccountResponse.cs | 0 .../Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs | 0 .../PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/ErrorFieldType.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/FieldType.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/IndividualDetails.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/KYCCheckResult.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/KYCCheckStatusData.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/KYCCheckSummary.cs | 0 .../Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs | 0 .../PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs | 0 .../Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs | 0 .../Model/PlatformsWebhooks/KYCShareholderCheckResult.cs | 0 .../{src => }/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs | 0 .../PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/KYCVerificationResult.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/LegalArrangementDetail.cs | 0 .../Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/LocalDate.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/Message.cs | 0 .../Model/PlatformsWebhooks/NotificationErrorContainer.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/NotificationResponse.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/OperationStatus.cs | 0 .../Model/PlatformsWebhooks/PaymentFailureNotification.cs | 0 .../Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/PayoutMethod.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/PayoutScheduleResponse.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/PersonalDocumentData.cs | 0 .../Model/PlatformsWebhooks/RefundFundsTransferNotification.cs | 0 .../PlatformsWebhooks/RefundFundsTransferNotificationContent.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/RefundResult.cs | 0 .../Model/PlatformsWebhooks/ReportAvailableNotification.cs | 0 .../Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs | 0 .../Model/PlatformsWebhooks/ScheduledRefundsNotification.cs | 0 .../PlatformsWebhooks/ScheduledRefundsNotificationContent.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/ShareholderContact.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/SignatoryContact.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/Split.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/SplitAmount.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/StoreDetail.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/Transaction.cs | 0 .../Model/PlatformsWebhooks/TransferFundsNotification.cs | 0 .../Model/PlatformsWebhooks/TransferFundsNotificationContent.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/UltimateParentCompany.cs | 0 .../PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs | 0 .../Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/UpdateAccountResponse.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/ViasAddress.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/ViasName.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/ViasPersonalData.cs | 0 Adyen/{src => }/Model/PlatformsWebhooks/ViasPhoneNumber.cs | 0 Adyen/{src => }/Model/PosMobile/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/PosMobile/CreateSessionRequest.cs | 0 Adyen/{src => }/Model/PosMobile/CreateSessionResponse.cs | 0 .../Model/PosTerminalManagement/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/PosTerminalManagement/Address.cs | 0 .../Model/PosTerminalManagement/AssignTerminalsRequest.cs | 0 .../Model/PosTerminalManagement/AssignTerminalsResponse.cs | 0 .../{src => }/Model/PosTerminalManagement/FindTerminalRequest.cs | 0 .../{src => }/Model/PosTerminalManagement/FindTerminalResponse.cs | 0 .../Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs | 0 .../Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs | 0 .../Model/PosTerminalManagement/GetTerminalDetailsRequest.cs | 0 .../Model/PosTerminalManagement/GetTerminalDetailsResponse.cs | 0 .../PosTerminalManagement/GetTerminalsUnderAccountRequest.cs | 0 .../PosTerminalManagement/GetTerminalsUnderAccountResponse.cs | 0 Adyen/{src => }/Model/PosTerminalManagement/MerchantAccount.cs | 0 Adyen/{src => }/Model/PosTerminalManagement/ServiceError.cs | 0 Adyen/{src => }/Model/PosTerminalManagement/Store.cs | 0 Adyen/{src => }/Model/Recurring/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/Recurring/Address.cs | 0 Adyen/{src => }/Model/Recurring/Amount.cs | 0 Adyen/{src => }/Model/Recurring/BankAccount.cs | 0 Adyen/{src => }/Model/Recurring/Card.cs | 0 Adyen/{src => }/Model/Recurring/CreatePermitRequest.cs | 0 Adyen/{src => }/Model/Recurring/CreatePermitResult.cs | 0 Adyen/{src => }/Model/Recurring/DisablePermitRequest.cs | 0 Adyen/{src => }/Model/Recurring/DisablePermitResult.cs | 0 Adyen/{src => }/Model/Recurring/DisableRequest.cs | 0 Adyen/{src => }/Model/Recurring/DisableResult.cs | 0 Adyen/{src => }/Model/Recurring/Name.cs | 0 Adyen/{src => }/Model/Recurring/NotifyShopperRequest.cs | 0 Adyen/{src => }/Model/Recurring/NotifyShopperResult.cs | 0 Adyen/{src => }/Model/Recurring/Permit.cs | 0 Adyen/{src => }/Model/Recurring/PermitRestriction.cs | 0 Adyen/{src => }/Model/Recurring/PermitResult.cs | 0 Adyen/{src => }/Model/Recurring/Recurring.cs | 0 Adyen/{src => }/Model/Recurring/RecurringDetail.cs | 0 Adyen/{src => }/Model/Recurring/RecurringDetailWrapper.cs | 0 Adyen/{src => }/Model/Recurring/RecurringDetailsRequest.cs | 0 Adyen/{src => }/Model/Recurring/RecurringDetailsResult.cs | 0 Adyen/{src => }/Model/Recurring/ScheduleAccountUpdaterRequest.cs | 0 Adyen/{src => }/Model/Recurring/ScheduleAccountUpdaterResult.cs | 0 Adyen/{src => }/Model/Recurring/ServiceError.cs | 0 Adyen/{src => }/Model/Recurring/TokenDetails.cs | 0 Adyen/{src => }/Model/ReportWebhooks/AbstractOpenAPISchema.cs | 0 .../Model/ReportWebhooks/BalancePlatformNotificationResponse.cs | 0 Adyen/{src => }/Model/ReportWebhooks/ReportNotificationData.cs | 0 Adyen/{src => }/Model/ReportWebhooks/ReportNotificationRequest.cs | 0 Adyen/{src => }/Model/ReportWebhooks/Resource.cs | 0 Adyen/{src => }/Model/ReportWebhooks/ResourceReference.cs | 0 Adyen/{src => }/Model/RequestOptions.cs | 0 Adyen/{src => }/Model/StoredValue/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/StoredValue/Amount.cs | 0 Adyen/{src => }/Model/StoredValue/ServiceError.cs | 0 .../{src => }/Model/StoredValue/StoredValueBalanceCheckRequest.cs | 0 .../Model/StoredValue/StoredValueBalanceCheckResponse.cs | 0 .../{src => }/Model/StoredValue/StoredValueBalanceMergeRequest.cs | 0 .../Model/StoredValue/StoredValueBalanceMergeResponse.cs | 0 Adyen/{src => }/Model/StoredValue/StoredValueIssueRequest.cs | 0 Adyen/{src => }/Model/StoredValue/StoredValueIssueResponse.cs | 0 Adyen/{src => }/Model/StoredValue/StoredValueLoadRequest.cs | 0 Adyen/{src => }/Model/StoredValue/StoredValueLoadResponse.cs | 0 .../{src => }/Model/StoredValue/StoredValueStatusChangeRequest.cs | 0 .../Model/StoredValue/StoredValueStatusChangeResponse.cs | 0 Adyen/{src => }/Model/StoredValue/StoredValueVoidRequest.cs | 0 Adyen/{src => }/Model/StoredValue/StoredValueVoidResponse.cs | 0 Adyen/{src => }/Model/Terminal/SaleToAcquirerData.cs | 0 Adyen/{src => }/Model/Terminal/Split.cs | 0 Adyen/{src => }/Model/Terminal/SplitItem.cs | 0 Adyen/{src => }/Model/Terminal/SplitItemType.cs | 0 Adyen/{src => }/Model/TerminalApi/AbortRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/AccountType.cs | 0 Adyen/{src => }/Model/TerminalApi/AdminRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/AdminResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/AlgorithmIdentifier.cs | 0 Adyen/{src => }/Model/TerminalApi/AlgorithmType.cs | 0 Adyen/{src => }/Model/TerminalApi/AlignmentType.cs | 0 Adyen/{src => }/Model/TerminalApi/AllowedProduct.cs | 0 Adyen/{src => }/Model/TerminalApi/Amount.cs | 0 Adyen/{src => }/Model/TerminalApi/AmountsReq.cs | 0 Adyen/{src => }/Model/TerminalApi/AmountsResp.cs | 0 Adyen/{src => }/Model/TerminalApi/AreaSize.cs | 0 Adyen/{src => }/Model/TerminalApi/AuthenticatedData.cs | 0 Adyen/{src => }/Model/TerminalApi/AuthenticationMethodType.cs | 0 Adyen/{src => }/Model/TerminalApi/BalanceInquiryRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/BalanceInquiryResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/BarcodeType.cs | 0 Adyen/{src => }/Model/TerminalApi/BatchRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/BatchResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/CapturedSignature.cs | 0 Adyen/{src => }/Model/TerminalApi/CardAcquisitionRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/CardAcquisitionResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/CardAcquisitionTransaction.cs | 0 Adyen/{src => }/Model/TerminalApi/CardData.cs | 0 Adyen/{src => }/Model/TerminalApi/CardReaderAPDURequest.cs | 0 Adyen/{src => }/Model/TerminalApi/CardReaderAPDUResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/CardReaderInitRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/CardReaderInitResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/CardReaderPowerOffRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/CardReaderPowerOffResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/CardholderPIN.cs | 0 Adyen/{src => }/Model/TerminalApi/CashHandlingDevice.cs | 0 Adyen/{src => }/Model/TerminalApi/CharacterHeightType.cs | 0 Adyen/{src => }/Model/TerminalApi/CharacterStyleType.cs | 0 Adyen/{src => }/Model/TerminalApi/CharacterWidthType.cs | 0 Adyen/{src => }/Model/TerminalApi/CheckData.cs | 0 Adyen/{src => }/Model/TerminalApi/CheckTypeCodeType.cs | 0 Adyen/{src => }/Model/TerminalApi/CoinsOrBills.cs | 0 Adyen/{src => }/Model/TerminalApi/ColorType.cs | 0 Adyen/{src => }/Model/TerminalApi/ContentInformation.cs | 0 Adyen/{src => }/Model/TerminalApi/ContentType.cs | 0 Adyen/{src => }/Model/TerminalApi/CurrencyConversion.cs | 0 Adyen/{src => }/Model/TerminalApi/CustomerOrder.cs | 0 Adyen/{src => }/Model/TerminalApi/CustomerOrderReqType.cs | 0 Adyen/{src => }/Model/TerminalApi/DeviceType.cs | 0 Adyen/{src => }/Model/TerminalApi/DiagnosisRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/DiagnosisResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/DigestedData.cs | 0 Adyen/{src => }/Model/TerminalApi/DisplayOutput.cs | 0 Adyen/{src => }/Model/TerminalApi/DisplayRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/DisplayResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/DocumentQualifierType.cs | 0 Adyen/{src => }/Model/TerminalApi/EnableServiceRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/EnableServiceResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/EncapsulatedContent.cs | 0 Adyen/{src => }/Model/TerminalApi/EncryptedContent.cs | 0 Adyen/{src => }/Model/TerminalApi/EntryModeType.cs | 0 Adyen/{src => }/Model/TerminalApi/EnvelopedData.cs | 0 Adyen/{src => }/Model/TerminalApi/ErrorConditionType.cs | 0 Adyen/{src => }/Model/TerminalApi/EventNotification.cs | 0 Adyen/{src => }/Model/TerminalApi/EventToNotifyType.cs | 0 Adyen/{src => }/Model/TerminalApi/ForceTypeModeType.cs | 0 Adyen/{src => }/Model/TerminalApi/GenericProfileType.cs | 0 Adyen/{src => }/Model/TerminalApi/GeographicCoordinates.cs | 0 Adyen/{src => }/Model/TerminalApi/Geolocation.cs | 0 Adyen/{src => }/Model/TerminalApi/GetTotalsRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/GetTotalsResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/GlobalStatusType.cs | 0 Adyen/{src => }/Model/TerminalApi/HostStatus.cs | 0 Adyen/{src => }/Model/TerminalApi/ICCResetData.cs | 0 Adyen/{src => }/Model/TerminalApi/IdentificationSupportType.cs | 0 Adyen/{src => }/Model/TerminalApi/IdentificationType.cs | 0 Adyen/{src => }/Model/TerminalApi/InfoQualifyType.cs | 0 Adyen/{src => }/Model/TerminalApi/Input.cs | 0 Adyen/{src => }/Model/TerminalApi/InputCommandType.cs | 0 Adyen/{src => }/Model/TerminalApi/InputData.cs | 0 Adyen/{src => }/Model/TerminalApi/InputRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/InputResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/InputResult.cs | 0 Adyen/{src => }/Model/TerminalApi/InputUpdate.cs | 0 Adyen/{src => }/Model/TerminalApi/Instalment.cs | 0 Adyen/{src => }/Model/TerminalApi/IssuerAndSerialNumber.cs | 0 Adyen/{src => }/Model/TerminalApi/KEK.cs | 0 Adyen/{src => }/Model/TerminalApi/KEKIdentifier.cs | 0 Adyen/{src => }/Model/TerminalApi/KeyTransport.cs | 0 Adyen/{src => }/Model/TerminalApi/LoginRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/LoginResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/LogoutRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/LogoutResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyAccount.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyAccountID.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyAccountReq.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyAccountStatus.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyAcquirerData.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyAmount.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyData.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyHandlingType.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyResult.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyTotals.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyTransaction.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyTransactionType.cs | 0 Adyen/{src => }/Model/TerminalApi/LoyaltyUnitType.cs | 0 Adyen/{src => }/Model/TerminalApi/MenuEntry.cs | 0 Adyen/{src => }/Model/TerminalApi/MenuEntryTagType.cs | 0 Adyen/{src => }/Model/TerminalApi/Message/SaleToPOIRequest.cs | 0 .../Model/TerminalApi/Message/SaleToPoiRequestSecured.cs | 0 .../Model/TerminalApi/Message/SaleToPoiResponseSecured.cs | 0 Adyen/{src => }/Model/TerminalApi/MessageCategoryType.cs | 0 Adyen/{src => }/Model/TerminalApi/MessageClassType.cs | 0 Adyen/{src => }/Model/TerminalApi/MessageHeader.cs | 0 Adyen/{src => }/Model/TerminalApi/MessageReference.cs | 0 Adyen/{src => }/Model/TerminalApi/MessageType.cs | 0 Adyen/{src => }/Model/TerminalApi/MobileData.cs | 0 Adyen/{src => }/Model/TerminalApi/NamedKeyEncryptedData.cs | 0 Adyen/{src => }/Model/TerminalApi/OriginalPOITransaction.cs | 0 Adyen/{src => }/Model/TerminalApi/OutputBarcode.cs | 0 Adyen/{src => }/Model/TerminalApi/OutputContent.cs | 0 Adyen/{src => }/Model/TerminalApi/OutputFormatType.cs | 0 Adyen/{src => }/Model/TerminalApi/OutputResult.cs | 0 Adyen/{src => }/Model/TerminalApi/OutputText.cs | 0 Adyen/{src => }/Model/TerminalApi/PINFormatType.cs | 0 Adyen/{src => }/Model/TerminalApi/PINRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/PINRequestType.cs | 0 Adyen/{src => }/Model/TerminalApi/PINResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/POIData.cs | 0 Adyen/{src => }/Model/TerminalApi/POIProfile.cs | 0 Adyen/{src => }/Model/TerminalApi/POISoftware.cs | 0 Adyen/{src => }/Model/TerminalApi/POIStatus.cs | 0 Adyen/{src => }/Model/TerminalApi/POISystemData.cs | 0 Adyen/{src => }/Model/TerminalApi/POITerminalData.cs | 0 Adyen/{src => }/Model/TerminalApi/Parameter.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentAccountReq.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentAccountStatus.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentAcquirerData.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentData.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentInstrumentData.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentInstrumentType.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentReceipt.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentResult.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentToken.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentTotals.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentTransaction.cs | 0 Adyen/{src => }/Model/TerminalApi/PaymentType.cs | 0 Adyen/{src => }/Model/TerminalApi/PerformedTransaction.cs | 0 Adyen/{src => }/Model/TerminalApi/PeriodUnitType.cs | 0 Adyen/{src => }/Model/TerminalApi/PredefinedContent.cs | 0 Adyen/{src => }/Model/TerminalApi/PrintOutput.cs | 0 Adyen/{src => }/Model/TerminalApi/PrintRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/PrintResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/PrinterStatusType.cs | 0 Adyen/{src => }/Model/TerminalApi/Rebates.cs | 0 Adyen/{src => }/Model/TerminalApi/RecipientIdentifier.cs | 0 Adyen/{src => }/Model/TerminalApi/ReconciliationRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/ReconciliationResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/ReconciliationType.cs | 0 Adyen/{src => }/Model/TerminalApi/RelativeDistinguishedName.cs | 0 Adyen/{src => }/Model/TerminalApi/RepeatedMessageResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/RepeatedResponseMessageBody.cs | 0 Adyen/{src => }/Model/TerminalApi/Response.cs | 0 Adyen/{src => }/Model/TerminalApi/ResponseModeType.cs | 0 Adyen/{src => }/Model/TerminalApi/ResultType.cs | 0 Adyen/{src => }/Model/TerminalApi/ReversalReasonType.cs | 0 Adyen/{src => }/Model/TerminalApi/ReversalRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/ReversalResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleData.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleItem.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleItemRebate.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleProfile.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleSoftware.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleTerminalData.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleToIssuerData.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleToPOIMessage.cs | 0 Adyen/{src => }/Model/TerminalApi/SaleToPOIResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/SensitiveCardData.cs | 0 Adyen/{src => }/Model/TerminalApi/SensitiveMobileData.cs | 0 Adyen/{src => }/Model/TerminalApi/SignaturePoint.cs | 0 Adyen/{src => }/Model/TerminalApi/SignedData.cs | 0 Adyen/{src => }/Model/TerminalApi/Signer.cs | 0 Adyen/{src => }/Model/TerminalApi/SignerIdentifier.cs | 0 Adyen/{src => }/Model/TerminalApi/SoundActionType.cs | 0 Adyen/{src => }/Model/TerminalApi/SoundContent.cs | 0 Adyen/{src => }/Model/TerminalApi/SoundFormatType.cs | 0 Adyen/{src => }/Model/TerminalApi/SoundRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/SoundResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/SponsoredMerchant.cs | 0 Adyen/{src => }/Model/TerminalApi/StoredValueAccountID.cs | 0 Adyen/{src => }/Model/TerminalApi/StoredValueAccountStatus.cs | 0 Adyen/{src => }/Model/TerminalApi/StoredValueAccountType.cs | 0 Adyen/{src => }/Model/TerminalApi/StoredValueData.cs | 0 Adyen/{src => }/Model/TerminalApi/StoredValueRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/StoredValueResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/StoredValueResult.cs | 0 Adyen/{src => }/Model/TerminalApi/StoredValueTransactionType.cs | 0 Adyen/{src => }/Model/TerminalApi/TerminalEnvironmentType.cs | 0 Adyen/{src => }/Model/TerminalApi/TokenRequestedType.cs | 0 Adyen/{src => }/Model/TerminalApi/TotalDetailsType.cs | 0 Adyen/{src => }/Model/TerminalApi/TotalFilter.cs | 0 Adyen/{src => }/Model/TerminalApi/TrackData.cs | 0 Adyen/{src => }/Model/TerminalApi/TrackFormatType.cs | 0 Adyen/{src => }/Model/TerminalApi/TransactionActionType.cs | 0 Adyen/{src => }/Model/TerminalApi/TransactionConditions.cs | 0 Adyen/{src => }/Model/TerminalApi/TransactionIdentification.cs | 0 Adyen/{src => }/Model/TerminalApi/TransactionStatusRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/TransactionStatusResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/TransactionToPerform.cs | 0 Adyen/{src => }/Model/TerminalApi/TransactionTotals.cs | 0 Adyen/{src => }/Model/TerminalApi/TransactionType.cs | 0 Adyen/{src => }/Model/TerminalApi/TransmitRequest.cs | 0 Adyen/{src => }/Model/TerminalApi/TransmitResponse.cs | 0 Adyen/{src => }/Model/TerminalApi/UTMCoordinates.cs | 0 Adyen/{src => }/Model/TerminalApi/UnitOfMeasureType.cs | 0 Adyen/{src => }/Model/TerminalApi/VersionType.cs | 0 .../{src => }/Model/TransactionWebhooks/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/TransactionWebhooks/Amount.cs | 0 .../TransactionWebhooks/BalancePlatformNotificationResponse.cs | 0 Adyen/{src => }/Model/TransactionWebhooks/BankCategoryData.cs | 0 Adyen/{src => }/Model/TransactionWebhooks/InternalCategoryData.cs | 0 Adyen/{src => }/Model/TransactionWebhooks/IssuedCard.cs | 0 Adyen/{src => }/Model/TransactionWebhooks/PaymentInstrument.cs | 0 Adyen/{src => }/Model/TransactionWebhooks/PlatformPayment.cs | 0 .../Model/TransactionWebhooks/RelayedAuthorisationData.cs | 0 Adyen/{src => }/Model/TransactionWebhooks/Resource.cs | 0 Adyen/{src => }/Model/TransactionWebhooks/ResourceReference.cs | 0 Adyen/{src => }/Model/TransactionWebhooks/ThreeDSecure.cs | 0 Adyen/{src => }/Model/TransactionWebhooks/Transaction.cs | 0 .../Model/TransactionWebhooks/TransactionNotificationRequestV4.cs | 0 .../TransactionWebhooks/TransferNotificationValidationFact.cs | 0 Adyen/{src => }/Model/TransactionWebhooks/TransferView.cs | 0 .../Model/TransactionWebhooks/TransferViewCategoryData.cs | 0 .../Model/TransferWebhooks/AULocalAccountIdentification.cs | 0 Adyen/{src => }/Model/TransferWebhooks/AbstractOpenAPISchema.cs | 0 .../Model/TransferWebhooks/AdditionalBankIdentification.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Address.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Airline.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Amount.cs | 0 Adyen/{src => }/Model/TransferWebhooks/AmountAdjustment.cs | 0 .../Model/TransferWebhooks/BRLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/TransferWebhooks/BalanceMutation.cs | 0 .../Model/TransferWebhooks/BalancePlatformNotificationResponse.cs | 0 Adyen/{src => }/Model/TransferWebhooks/BankAccountV3.cs | 0 .../Model/TransferWebhooks/BankAccountV3AccountIdentification.cs | 0 Adyen/{src => }/Model/TransferWebhooks/BankCategoryData.cs | 0 .../Model/TransferWebhooks/CALocalAccountIdentification.cs | 0 .../Model/TransferWebhooks/CZLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Card.cs | 0 Adyen/{src => }/Model/TransferWebhooks/CardIdentification.cs | 0 .../{src => }/Model/TransferWebhooks/ConfirmationTrackingData.cs | 0 Adyen/{src => }/Model/TransferWebhooks/CounterpartyV3.cs | 0 .../Model/TransferWebhooks/DKLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/TransferWebhooks/DirectDebitInformation.cs | 0 Adyen/{src => }/Model/TransferWebhooks/EstimationTrackingData.cs | 0 Adyen/{src => }/Model/TransferWebhooks/ExternalReason.cs | 0 .../Model/TransferWebhooks/HKLocalAccountIdentification.cs | 0 .../Model/TransferWebhooks/HULocalAccountIdentification.cs | 0 .../{src => }/Model/TransferWebhooks/IbanAccountIdentification.cs | 0 Adyen/{src => }/Model/TransferWebhooks/InternalCategoryData.cs | 0 .../Model/TransferWebhooks/InternalReviewTrackingData.cs | 0 Adyen/{src => }/Model/TransferWebhooks/IssuedCard.cs | 0 Adyen/{src => }/Model/TransferWebhooks/IssuingTransactionData.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Leg.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Lodging.cs | 0 Adyen/{src => }/Model/TransferWebhooks/MerchantData.cs | 0 Adyen/{src => }/Model/TransferWebhooks/MerchantPurchaseData.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Modification.cs | 0 .../Model/TransferWebhooks/NOLocalAccountIdentification.cs | 0 .../Model/TransferWebhooks/NZLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/TransferWebhooks/NameLocation.cs | 0 .../Model/TransferWebhooks/NumberAndBicAccountIdentification.cs | 0 .../Model/TransferWebhooks/PLLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/TransferWebhooks/PartyIdentification.cs | 0 Adyen/{src => }/Model/TransferWebhooks/PaymentInstrument.cs | 0 Adyen/{src => }/Model/TransferWebhooks/PlatformPayment.cs | 0 .../{src => }/Model/TransferWebhooks/RelayedAuthorisationData.cs | 0 Adyen/{src => }/Model/TransferWebhooks/Resource.cs | 0 Adyen/{src => }/Model/TransferWebhooks/ResourceReference.cs | 0 .../Model/TransferWebhooks/SELocalAccountIdentification.cs | 0 .../Model/TransferWebhooks/SGLocalAccountIdentification.cs | 0 .../{src => }/Model/TransferWebhooks/TransactionEventViolation.cs | 0 .../{src => }/Model/TransferWebhooks/TransactionRuleReference.cs | 0 Adyen/{src => }/Model/TransferWebhooks/TransactionRuleSource.cs | 0 Adyen/{src => }/Model/TransferWebhooks/TransactionRulesResult.cs | 0 Adyen/{src => }/Model/TransferWebhooks/TransferData.cs | 0 .../{src => }/Model/TransferWebhooks/TransferDataCategoryData.cs | 0 Adyen/{src => }/Model/TransferWebhooks/TransferDataTracking.cs | 0 Adyen/{src => }/Model/TransferWebhooks/TransferEvent.cs | 0 .../Model/TransferWebhooks/TransferEventEventsDataInner.cs | 0 .../{src => }/Model/TransferWebhooks/TransferEventTrackingData.cs | 0 .../Model/TransferWebhooks/TransferNotificationCounterParty.cs | 0 .../Model/TransferWebhooks/TransferNotificationMerchantData.cs | 0 .../Model/TransferWebhooks/TransferNotificationRequest.cs | 0 .../Model/TransferWebhooks/TransferNotificationValidationFact.cs | 0 Adyen/{src => }/Model/TransferWebhooks/TransferReview.cs | 0 .../Model/TransferWebhooks/UKLocalAccountIdentification.cs | 0 .../Model/TransferWebhooks/USLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/AULocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/AbstractOpenAPISchema.cs | 0 Adyen/{src => }/Model/Transfers/AdditionalBankIdentification.cs | 0 Adyen/{src => }/Model/Transfers/Address.cs | 0 Adyen/{src => }/Model/Transfers/Airline.cs | 0 Adyen/{src => }/Model/Transfers/Amount.cs | 0 Adyen/{src => }/Model/Transfers/AmountAdjustment.cs | 0 Adyen/{src => }/Model/Transfers/ApproveTransfersRequest.cs | 0 Adyen/{src => }/Model/Transfers/BRLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/BalanceMutation.cs | 0 Adyen/{src => }/Model/Transfers/BankAccountV3.cs | 0 .../Model/Transfers/BankAccountV3AccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/BankCategoryData.cs | 0 Adyen/{src => }/Model/Transfers/CALocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/CZLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/CancelTransfersRequest.cs | 0 Adyen/{src => }/Model/Transfers/CapitalBalance.cs | 0 Adyen/{src => }/Model/Transfers/CapitalGrant.cs | 0 Adyen/{src => }/Model/Transfers/CapitalGrantInfo.cs | 0 Adyen/{src => }/Model/Transfers/CapitalGrants.cs | 0 Adyen/{src => }/Model/Transfers/Card.cs | 0 Adyen/{src => }/Model/Transfers/CardIdentification.cs | 0 Adyen/{src => }/Model/Transfers/ConfirmationTrackingData.cs | 0 Adyen/{src => }/Model/Transfers/Counterparty.cs | 0 Adyen/{src => }/Model/Transfers/CounterpartyInfoV3.cs | 0 Adyen/{src => }/Model/Transfers/CounterpartyV3.cs | 0 Adyen/{src => }/Model/Transfers/DKLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/DirectDebitInformation.cs | 0 Adyen/{src => }/Model/Transfers/EstimationTrackingData.cs | 0 Adyen/{src => }/Model/Transfers/ExternalReason.cs | 0 Adyen/{src => }/Model/Transfers/Fee.cs | 0 Adyen/{src => }/Model/Transfers/FindTransfersResponse.cs | 0 Adyen/{src => }/Model/Transfers/HKLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/HULocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/IbanAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/InternalCategoryData.cs | 0 Adyen/{src => }/Model/Transfers/InternalReviewTrackingData.cs | 0 Adyen/{src => }/Model/Transfers/InvalidField.cs | 0 Adyen/{src => }/Model/Transfers/IssuedCard.cs | 0 Adyen/{src => }/Model/Transfers/IssuingTransactionData.cs | 0 Adyen/{src => }/Model/Transfers/Leg.cs | 0 Adyen/{src => }/Model/Transfers/Link.cs | 0 Adyen/{src => }/Model/Transfers/Links.cs | 0 Adyen/{src => }/Model/Transfers/Lodging.cs | 0 Adyen/{src => }/Model/Transfers/MerchantData.cs | 0 Adyen/{src => }/Model/Transfers/MerchantPurchaseData.cs | 0 Adyen/{src => }/Model/Transfers/Modification.cs | 0 Adyen/{src => }/Model/Transfers/NOLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/NZLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/NameLocation.cs | 0 .../Model/Transfers/NumberAndBicAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/PLLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/PartyIdentification.cs | 0 Adyen/{src => }/Model/Transfers/PaymentInstrument.cs | 0 Adyen/{src => }/Model/Transfers/PlatformPayment.cs | 0 Adyen/{src => }/Model/Transfers/RelayedAuthorisationData.cs | 0 Adyen/{src => }/Model/Transfers/Repayment.cs | 0 Adyen/{src => }/Model/Transfers/RepaymentTerm.cs | 0 Adyen/{src => }/Model/Transfers/ResourceReference.cs | 0 Adyen/{src => }/Model/Transfers/RestServiceError.cs | 0 Adyen/{src => }/Model/Transfers/ReturnTransferRequest.cs | 0 Adyen/{src => }/Model/Transfers/ReturnTransferResponse.cs | 0 Adyen/{src => }/Model/Transfers/RoutingDetails.cs | 0 Adyen/{src => }/Model/Transfers/SELocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/SGLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/ServiceError.cs | 0 Adyen/{src => }/Model/Transfers/ThresholdRepayment.cs | 0 Adyen/{src => }/Model/Transfers/Transaction.cs | 0 Adyen/{src => }/Model/Transfers/TransactionEventViolation.cs | 0 Adyen/{src => }/Model/Transfers/TransactionRuleReference.cs | 0 Adyen/{src => }/Model/Transfers/TransactionRuleSource.cs | 0 Adyen/{src => }/Model/Transfers/TransactionRulesResult.cs | 0 Adyen/{src => }/Model/Transfers/TransactionSearchResponse.cs | 0 Adyen/{src => }/Model/Transfers/Transfer.cs | 0 Adyen/{src => }/Model/Transfers/TransferCategoryData.cs | 0 Adyen/{src => }/Model/Transfers/TransferData.cs | 0 Adyen/{src => }/Model/Transfers/TransferDataTracking.cs | 0 Adyen/{src => }/Model/Transfers/TransferEvent.cs | 0 Adyen/{src => }/Model/Transfers/TransferEventEventsDataInner.cs | 0 Adyen/{src => }/Model/Transfers/TransferEventTrackingData.cs | 0 Adyen/{src => }/Model/Transfers/TransferInfo.cs | 0 .../{src => }/Model/Transfers/TransferNotificationCounterParty.cs | 0 .../{src => }/Model/Transfers/TransferNotificationMerchantData.cs | 0 .../Model/Transfers/TransferNotificationValidationFact.cs | 0 Adyen/{src => }/Model/Transfers/TransferRequestReview.cs | 0 Adyen/{src => }/Model/Transfers/TransferReview.cs | 0 .../{src => }/Model/Transfers/TransferServiceRestServiceError.cs | 0 Adyen/{src => }/Model/Transfers/TransferView.cs | 0 Adyen/{src => }/Model/Transfers/UKLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/USLocalAccountIdentification.cs | 0 Adyen/{src => }/Model/Transfers/UltimatePartyIdentification.cs | 0 Adyen/{src => }/Security/AesEncryptor.cs | 0 Adyen/{src => }/Security/EncryptionCredentialDetails.cs | 0 Adyen/{src => }/Security/EncryptionDerivedKey.cs | 0 Adyen/{src => }/Security/EncryptionDerivedKeyGenerator.cs | 0 Adyen/{src => }/Security/Exceptions/NexoCryptoException.cs | 0 Adyen/{src => }/Security/Extension/ArrayExtension.cs | 0 Adyen/{src => }/Security/HmacSha256Wrapper.cs | 0 Adyen/{src => }/Security/IvModGenerator.cs | 0 Adyen/{src => }/Security/SaleToPoiMessageSecured.cs | 0 Adyen/{src => }/Security/SaleToPoiMessageSecuredEncryptor.cs | 0 Adyen/{src => }/Security/SecurityTrailer.cs | 0 Adyen/{src => }/Security/TerminalCommonNameValidator.cs | 0 Adyen/{src => }/Service/AbstractService.cs | 0 Adyen/{src => }/Service/ApiException.cs | 0 Adyen/{src => }/Service/BalanceControlService.cs | 0 Adyen/{src => }/Service/BalancePlatform/AccountHoldersService.cs | 0 Adyen/{src => }/Service/BalancePlatform/BalanceAccountsService.cs | 0 .../Service/BalancePlatform/BankAccountValidationService.cs | 0 Adyen/{src => }/Service/BalancePlatform/CardOrdersService.cs | 0 Adyen/{src => }/Service/BalancePlatform/GrantAccountsService.cs | 0 Adyen/{src => }/Service/BalancePlatform/GrantOffersService.cs | 0 Adyen/{src => }/Service/BalancePlatform/ManageCardPINService.cs | 0 .../{src => }/Service/BalancePlatform/ManageSCADevicesService.cs | 0 Adyen/{src => }/Service/BalancePlatform/NetworkTokensService.cs | 0 .../Service/BalancePlatform/PaymentInstrumentGroupsService.cs | 0 .../Service/BalancePlatform/PaymentInstrumentsService.cs | 0 Adyen/{src => }/Service/BalancePlatform/PlatformService.cs | 0 .../{src => }/Service/BalancePlatform/TransactionRulesService.cs | 0 Adyen/{src => }/Service/BalancePlatform/TransferRoutesService.cs | 0 Adyen/{src => }/Service/BinLookupService.cs | 0 Adyen/{src => }/Service/Checkout/DonationsService.cs | 0 Adyen/{src => }/Service/Checkout/ModificationsService.cs | 0 Adyen/{src => }/Service/Checkout/OrdersService.cs | 0 Adyen/{src => }/Service/Checkout/PaymentLinksService.cs | 0 Adyen/{src => }/Service/Checkout/PaymentsService.cs | 0 Adyen/{src => }/Service/Checkout/RecurringService.cs | 0 Adyen/{src => }/Service/Checkout/UtilityService.cs | 0 Adyen/{src => }/Service/DataProtectionService.cs | 0 Adyen/{src => }/Service/DisputesService.cs | 0 .../Service/LegalEntityManagement/BusinessLinesService.cs | 0 Adyen/{src => }/Service/LegalEntityManagement/DocumentsService.cs | 0 .../Service/LegalEntityManagement/HostedOnboardingService.cs | 0 .../Service/LegalEntityManagement/LegalEntitiesService.cs | 0 .../Service/LegalEntityManagement/PCIQuestionnairesService.cs | 0 .../Service/LegalEntityManagement/TaxEDeliveryConsentService.cs | 0 .../Service/LegalEntityManagement/TermsOfServiceService.cs | 0 .../Service/LegalEntityManagement/TransferInstrumentsService.cs | 0 .../Service/Management/APICredentialsCompanyLevelService.cs | 0 .../Service/Management/APICredentialsMerchantLevelService.cs | 0 Adyen/{src => }/Service/Management/APIKeyCompanyLevelService.cs | 0 Adyen/{src => }/Service/Management/APIKeyMerchantLevelService.cs | 0 Adyen/{src => }/Service/Management/AccountCompanyLevelService.cs | 0 Adyen/{src => }/Service/Management/AccountMerchantLevelService.cs | 0 Adyen/{src => }/Service/Management/AccountStoreLevelService.cs | 0 .../Service/Management/AllowedOriginsCompanyLevelService.cs | 0 .../Service/Management/AllowedOriginsMerchantLevelService.cs | 0 .../Service/Management/AndroidFilesCompanyLevelService.cs | 0 .../{src => }/Service/Management/ClientKeyCompanyLevelService.cs | 0 .../{src => }/Service/Management/ClientKeyMerchantLevelService.cs | 0 Adyen/{src => }/Service/Management/MyAPICredentialService.cs | 0 .../Service/Management/PaymentMethodsMerchantLevelService.cs | 0 .../Service/Management/PayoutSettingsMerchantLevelService.cs | 0 .../Service/Management/SplitConfigurationMerchantLevelService.cs | 0 .../Service/Management/TerminalActionsCompanyLevelService.cs | 0 .../Service/Management/TerminalActionsTerminalLevelService.cs | 0 .../Service/Management/TerminalOrdersCompanyLevelService.cs | 0 .../Service/Management/TerminalOrdersMerchantLevelService.cs | 0 .../Service/Management/TerminalSettingsCompanyLevelService.cs | 0 .../Service/Management/TerminalSettingsMerchantLevelService.cs | 0 .../Service/Management/TerminalSettingsStoreLevelService.cs | 0 .../Service/Management/TerminalSettingsTerminalLevelService.cs | 0 .../{src => }/Service/Management/TerminalsTerminalLevelService.cs | 0 Adyen/{src => }/Service/Management/UsersCompanyLevelService.cs | 0 Adyen/{src => }/Service/Management/UsersMerchantLevelService.cs | 0 Adyen/{src => }/Service/Management/WebhooksCompanyLevelService.cs | 0 .../{src => }/Service/Management/WebhooksMerchantLevelService.cs | 0 Adyen/{src => }/Service/PaymentService.cs | 0 Adyen/{src => }/Service/PaymentsAppService.cs | 0 Adyen/{src => }/Service/Payout/InitializationService.cs | 0 Adyen/{src => }/Service/Payout/InstantPayoutsService.cs | 0 Adyen/{src => }/Service/Payout/ReviewingService.cs | 0 Adyen/{src => }/Service/PlatformsAccount/AccountHoldersService.cs | 0 Adyen/{src => }/Service/PlatformsAccount/AccountsService.cs | 0 Adyen/{src => }/Service/PlatformsAccount/VerificationService.cs | 0 Adyen/{src => }/Service/PlatformsFundService.cs | 0 .../PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs | 0 .../PCIComplianceQuestionnairePageService.cs | 0 .../Service/PlatformsNotificationConfigurationService.cs | 0 Adyen/{src => }/Service/PosMobileService.cs | 0 Adyen/{src => }/Service/PosTerminalManagementService.cs | 0 Adyen/{src => }/Service/RecurringService.cs | 0 Adyen/{src => }/Service/Resource/Terminal/TerminalApi.cs | 0 .../{src => }/Service/Resource/Terminal/TerminalApiAsyncClient.cs | 0 Adyen/{src => }/Service/Resource/Terminal/TerminalApiLocal.cs | 0 .../{src => }/Service/Resource/Terminal/TerminalApiLocalClient.cs | 0 .../{src => }/Service/Resource/Terminal/TerminalApiSyncClient.cs | 0 Adyen/{src => }/Service/ServiceResource.cs | 0 Adyen/{src => }/Service/StoredValueService.cs | 0 Adyen/{src => }/Service/TerminalApiAsyncService.cs | 0 Adyen/{src => }/Service/TerminalApiLocalService.cs | 0 Adyen/{src => }/Service/TerminalApiSyncService.cs | 0 Adyen/{src => }/Service/TerminalCloudApi.cs | 0 Adyen/{src => }/Service/TerminalLocalApi.cs | 0 Adyen/{src => }/Service/TerminalLocalApiUnencrypted.cs | 0 Adyen/{src => }/Service/Transfers/CapitalService.cs | 0 Adyen/{src => }/Service/Transfers/TransactionsService.cs | 0 Adyen/{src => }/Service/Transfers/TransfersService.cs | 0 Adyen/{src => }/Util/ByteArrayConverter.cs | 0 Adyen/{src => }/Util/HMACValidator.cs | 0 Adyen/{src => }/Util/JsonOperation.cs | 0 Adyen/{src => }/Util/TerminalApi/AdditionalResponse.cs | 0 Adyen/{src => }/Util/TerminalApi/CardAcquisitionUtil.cs | 0 Adyen/{src => }/Util/Util.cs | 0 Adyen/{src => }/Webhooks/BalancePlatformWebhookHandler.cs | 0 Adyen/{src => }/Webhooks/ClassicPlatformWebhookHandler.cs | 0 Adyen/{src => }/Webhooks/ManagementWebhookHandler.cs | 0 Adyen/{src => }/Webhooks/WebhookHandler.cs | 0 1759 files changed, 0 insertions(+), 0 deletions(-) rename Adyen/{src => }/ApiSerialization/Converter/JsonBase64Converter.cs (100%) rename Adyen/{src => }/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs (100%) rename Adyen/{src => }/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs (100%) rename Adyen/{src => }/ApiSerialization/Converter/SaleToPoiMessageConverter.cs (100%) rename Adyen/{src => }/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs (100%) rename Adyen/{src => }/ApiSerialization/IMessagePayload.cs (100%) rename Adyen/{src => }/ApiSerialization/IMessagePayloadSerializer.cs (100%) rename Adyen/{src => }/ApiSerialization/MessageHeaderSerializer.cs (100%) rename Adyen/{src => }/ApiSerialization/MessagePayloadSerializer.cs (100%) rename Adyen/{src => }/ApiSerialization/MessagePayloadSerializerFactory.cs (100%) rename Adyen/{src => }/ApiSerialization/OpenAPIDateConverter.cs (100%) rename Adyen/{src => }/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs (100%) rename Adyen/{src => }/ApiSerialization/SaleToPoiMessageSerializer.cs (100%) rename Adyen/{src => }/ApiSerialization/TypeHelper.cs (100%) rename Adyen/{src => }/Constants/ApiConstants.cs (100%) rename Adyen/{src => }/Constants/ClientConfig.cs (100%) rename Adyen/{src => }/Constants/Region.cs (100%) rename Adyen/{src => }/Exceptions/DeserializationException.cs (100%) rename Adyen/{src => }/Exceptions/ExceptionMessages.cs (100%) rename Adyen/{src => }/HttpClient/HttpClientException.cs (100%) rename Adyen/{src => }/HttpClient/HttpClientExtension.cs (100%) rename Adyen/{src => }/HttpClient/HttpClientWrapper.cs (100%) rename Adyen/{src => }/HttpClient/Interfaces/IClient.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/AuthenticationDecision.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/AuthenticationInfo.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/AuthenticationNotificationData.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/AuthenticationNotificationRequest.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/ChallengeInfo.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/Purchase.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/PurchaseInfo.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/RelayedAuthenticationRequest.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/RelayedAuthenticationResponse.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/Resource.cs (100%) rename Adyen/{src => }/Model/AcsWebhooks/ServiceError.cs (100%) rename Adyen/{src => }/Model/ApiError.cs (100%) rename Adyen/{src => }/Model/ApplicationInformation/ApplicationInfo.cs (100%) rename Adyen/{src => }/Model/ApplicationInformation/CommonField.cs (100%) rename Adyen/{src => }/Model/ApplicationInformation/ExternalPlatform.cs (100%) rename Adyen/{src => }/Model/ApplicationInformation/MerchantDevice.cs (100%) rename Adyen/{src => }/Model/ApplicationInformation/ShopperInteractionDevice.cs (100%) rename Adyen/{src => }/Model/BalanceControl/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/BalanceControl/Amount.cs (100%) rename Adyen/{src => }/Model/BalanceControl/BalanceTransferRequest.cs (100%) rename Adyen/{src => }/Model/BalanceControl/BalanceTransferResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AccountHolder.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AccountHolderCapability.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AccountHolderInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AccountHolderUpdateRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AccountSupportingEntityCapability.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AdditionalBankIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Address.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AddressRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Amount.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AmountMinMaxRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AssociationFinaliseRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AssociationFinaliseResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AssociationInitiateRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/AssociationInitiateResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Authentication.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BRLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Balance.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BalanceAccount.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BalanceAccountBase.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BalanceAccountInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BalanceAccountUpdateRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BalancePlatform.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccount.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccountAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccountDetails.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankAccountModel.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BankIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BrandVariantsRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/BulkAddress.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CALocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CapabilityProblem.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CapabilityProblemEntity.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CapabilitySettings.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CapitalBalance.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CapitalGrantAccount.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Card.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CardConfiguration.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CardInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CardOrder.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CardOrderItem.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/ContactDetails.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Counterparty.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CounterpartyBankRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CounterpartyTypesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CountriesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/CreateSweepConfigurationV2.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DayOfWeekRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DelegatedAuthenticationData.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DeliveryAddress.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DeliveryContact.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Device.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DeviceInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/DifferentCurrenciesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Duration.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/EntryModesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Expiry.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Fee.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/GetNetworkTokenResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/GetTaxFormResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/GrantLimit.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/GrantOffer.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/GrantOffers.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/HKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/HULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Href.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/IbanAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/InternationalTransactionRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/InvalidField.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Link.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/ListNetworkTokensResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/MatchingTransactionsRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/MatchingValuesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/MccsRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/MerchantAcquirerPair.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/MerchantNamesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/MerchantsRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/NOLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/NZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Name.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/NetworkToken.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PLLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrument.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentGroup.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Phone.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PhoneNumber.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PinChangeRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PinChangeResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PlatformPaymentConfiguration.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/ProcessingTypesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/PublicKeyResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RegisterSCAFinalResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RegisterSCARequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RegisterSCAResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RemediatingAction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/Repayment.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RepaymentTerm.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RestServiceError.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RevealPinRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RevealPinResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RiskScores.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/RiskScoresRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SELocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SGLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SameAmountRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SameCounterpartyRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SourceAccountTypesRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/StringMatch.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SweepConfigurationV2.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SweepCounterparty.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/SweepSchedule.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/ThresholdRepayment.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TimeOfDay.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TimeOfDayRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TokenRequestorsRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TotalAmountRestriction.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRule.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRuleEntityKey.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRuleInfo.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRuleInterval.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRuleResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRuleRestrictions.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransactionRulesResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransferRoute.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransferRouteRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransferRouteRequirementsInner.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/TransferRouteResponse.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/UKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/USInternationalAchAddressRequirement.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/USLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/UpdateNetworkTokenRequest.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/UpdatePaymentInstrument.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/UpdateSweepConfigurationV2.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/VerificationDeadline.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/VerificationError.cs (100%) rename Adyen/{src => }/Model/BalancePlatform/VerificationErrorRecursive.cs (100%) rename Adyen/{src => }/Model/BinLookup/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/BinLookup/Amount.cs (100%) rename Adyen/{src => }/Model/BinLookup/BinDetail.cs (100%) rename Adyen/{src => }/Model/BinLookup/CardBin.cs (100%) rename Adyen/{src => }/Model/BinLookup/CostEstimateAssumptions.cs (100%) rename Adyen/{src => }/Model/BinLookup/CostEstimateRequest.cs (100%) rename Adyen/{src => }/Model/BinLookup/CostEstimateResponse.cs (100%) rename Adyen/{src => }/Model/BinLookup/DSPublicKeyDetail.cs (100%) rename Adyen/{src => }/Model/BinLookup/MerchantDetails.cs (100%) rename Adyen/{src => }/Model/BinLookup/Recurring.cs (100%) rename Adyen/{src => }/Model/BinLookup/ServiceError.cs (100%) rename Adyen/{src => }/Model/BinLookup/ThreeDS2CardRangeDetail.cs (100%) rename Adyen/{src => }/Model/BinLookup/ThreeDSAvailabilityRequest.cs (100%) rename Adyen/{src => }/Model/BinLookup/ThreeDSAvailabilityResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Checkout/AccountInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/AcctInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/AchDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalData3DSecure.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataAirline.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataCarRental.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataCommon.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataLevel23.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataLodging.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataOpenInvoice.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataOpi.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataRatepay.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataRetry.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataRisk.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataRiskStandalone.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataSubMerchant.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataTemporaryServices.cs (100%) rename Adyen/{src => }/Model/Checkout/AdditionalDataWallets.cs (100%) rename Adyen/{src => }/Model/Checkout/Address.cs (100%) rename Adyen/{src => }/Model/Checkout/AffirmDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/AfterpayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Agency.cs (100%) rename Adyen/{src => }/Model/Checkout/Airline.cs (100%) rename Adyen/{src => }/Model/Checkout/AmazonPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Amount.cs (100%) rename Adyen/{src => }/Model/Checkout/Amounts.cs (100%) rename Adyen/{src => }/Model/Checkout/AncvDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/AndroidPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/ApplePayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/ApplePayDonations.cs (100%) rename Adyen/{src => }/Model/Checkout/ApplePaySessionRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/ApplePaySessionResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/ApplicationInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/AuthenticationData.cs (100%) rename Adyen/{src => }/Model/Checkout/BacsDirectDebitDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/BalanceCheckRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/BalanceCheckResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/BillDeskDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/BillingAddress.cs (100%) rename Adyen/{src => }/Model/Checkout/BlikDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/BrowserInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/CancelOrderRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/CancelOrderResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/CardBrandDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/CardDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/CardDetailsRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/CardDetailsResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/CardDonations.cs (100%) rename Adyen/{src => }/Model/Checkout/CashAppDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/CellulantDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutAwaitAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutBankAccount.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutBankTransferAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutNativeRedirectAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutOrderResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutPaymentMethod.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutQrCodeAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutRedirectAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutSDKAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutSessionInstallmentOption.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutThreeDS2Action.cs (100%) rename Adyen/{src => }/Model/Checkout/CheckoutVoucherAction.cs (100%) rename Adyen/{src => }/Model/Checkout/CommonField.cs (100%) rename Adyen/{src => }/Model/Checkout/Company.cs (100%) rename Adyen/{src => }/Model/Checkout/CreateCheckoutSessionRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/CreateCheckoutSessionResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/CreateOrderRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/CreateOrderResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/DeliveryAddress.cs (100%) rename Adyen/{src => }/Model/Checkout/DeliveryMethod.cs (100%) rename Adyen/{src => }/Model/Checkout/DetailsRequestAuthenticationData.cs (100%) rename Adyen/{src => }/Model/Checkout/DeviceRenderOptions.cs (100%) rename Adyen/{src => }/Model/Checkout/DokuDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Donation.cs (100%) rename Adyen/{src => }/Model/Checkout/DonationCampaign.cs (100%) rename Adyen/{src => }/Model/Checkout/DonationCampaignsRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/DonationCampaignsResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/DonationPaymentMethod.cs (100%) rename Adyen/{src => }/Model/Checkout/DonationPaymentRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/DonationPaymentResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/DragonpayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/EBankingFinlandDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/EcontextVoucherDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/EftDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/EncryptedOrderData.cs (100%) rename Adyen/{src => }/Model/Checkout/EnhancedSchemeData.cs (100%) rename Adyen/{src => }/Model/Checkout/ExternalPlatform.cs (100%) rename Adyen/{src => }/Model/Checkout/FastlaneDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/ForexQuote.cs (100%) rename Adyen/{src => }/Model/Checkout/FraudCheckResult.cs (100%) rename Adyen/{src => }/Model/Checkout/FraudResult.cs (100%) rename Adyen/{src => }/Model/Checkout/FundOrigin.cs (100%) rename Adyen/{src => }/Model/Checkout/FundRecipient.cs (100%) rename Adyen/{src => }/Model/Checkout/GenericIssuerPaymentMethodDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/GooglePayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/GooglePayDonations.cs (100%) rename Adyen/{src => }/Model/Checkout/IdealDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/IdealDonations.cs (100%) rename Adyen/{src => }/Model/Checkout/InputDetail.cs (100%) rename Adyen/{src => }/Model/Checkout/InstallmentOption.cs (100%) rename Adyen/{src => }/Model/Checkout/Installments.cs (100%) rename Adyen/{src => }/Model/Checkout/Item.cs (100%) rename Adyen/{src => }/Model/Checkout/KlarnaDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Leg.cs (100%) rename Adyen/{src => }/Model/Checkout/LineItem.cs (100%) rename Adyen/{src => }/Model/Checkout/ListStoredPaymentMethodsResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/Mandate.cs (100%) rename Adyen/{src => }/Model/Checkout/MasterpassDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/MbwayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/MerchantDevice.cs (100%) rename Adyen/{src => }/Model/Checkout/MerchantRiskIndicator.cs (100%) rename Adyen/{src => }/Model/Checkout/MobilePayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/MolPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Name.cs (100%) rename Adyen/{src => }/Model/Checkout/OpenInvoiceDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Passenger.cs (100%) rename Adyen/{src => }/Model/Checkout/PayByBankAISDirectDebitDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayByBankDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayPalDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayToDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayUUpiDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayWithGoogleDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PayWithGoogleDonations.cs (100%) rename Adyen/{src => }/Model/Checkout/Payment.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentAmountUpdateRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentAmountUpdateResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentCancelRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentCancelResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentCaptureRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentCaptureResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentCompletionDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentDetailsRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentDetailsResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentLinkRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentLinkResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethod.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethodGroup.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethodIssuer.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethodToStore.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethodUPIApps.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethodsRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentMethodsResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentRefundRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentRefundResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentResponseAction.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentReversalRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaymentReversalResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/PaypalUpdateOrderRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/PaypalUpdateOrderResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/Phone.cs (100%) rename Adyen/{src => }/Model/Checkout/PixDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/PixRecurring.cs (100%) rename Adyen/{src => }/Model/Checkout/PlatformChargebackLogic.cs (100%) rename Adyen/{src => }/Model/Checkout/PseDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/RakutenPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/RatepayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/Recurring.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalData3DSecure.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataBillingAddress.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataCard.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataCommon.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataDomesticError.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataInstallments.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataOpi.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponseAdditionalDataSepa.cs (100%) rename Adyen/{src => }/Model/Checkout/ResponsePaymentMethod.cs (100%) rename Adyen/{src => }/Model/Checkout/RiskData.cs (100%) rename Adyen/{src => }/Model/Checkout/RivertyDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/SDKEphemPubKey.cs (100%) rename Adyen/{src => }/Model/Checkout/SamsungPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/SepaDirectDebitDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/ServiceError.cs (100%) rename Adyen/{src => }/Model/Checkout/SessionResultResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/ShopperInteractionDevice.cs (100%) rename Adyen/{src => }/Model/Checkout/Split.cs (100%) rename Adyen/{src => }/Model/Checkout/SplitAmount.cs (100%) rename Adyen/{src => }/Model/Checkout/StandalonePaymentCancelRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/StandalonePaymentCancelResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/StoredPaymentMethod.cs (100%) rename Adyen/{src => }/Model/Checkout/StoredPaymentMethodDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/StoredPaymentMethodRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/StoredPaymentMethodResource.cs (100%) rename Adyen/{src => }/Model/Checkout/SubInputDetail.cs (100%) rename Adyen/{src => }/Model/Checkout/SubMerchant.cs (100%) rename Adyen/{src => }/Model/Checkout/SubMerchantInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/Surcharge.cs (100%) rename Adyen/{src => }/Model/Checkout/TaxTotal.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDS2RequestData.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDS2RequestFields.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDS2ResponseData.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDS2Result.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDSRequestData.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs (100%) rename Adyen/{src => }/Model/Checkout/ThreeDSecureData.cs (100%) rename Adyen/{src => }/Model/Checkout/Ticket.cs (100%) rename Adyen/{src => }/Model/Checkout/TravelAgency.cs (100%) rename Adyen/{src => }/Model/Checkout/TwintDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/UpdatePaymentLinkRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/UpiCollectDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/UpiIntentDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/UtilityRequest.cs (100%) rename Adyen/{src => }/Model/Checkout/UtilityResponse.cs (100%) rename Adyen/{src => }/Model/Checkout/VippsDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/VisaCheckoutDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/WeChatPayDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/WeChatPayMiniProgramDetails.cs (100%) rename Adyen/{src => }/Model/Checkout/ZipDetails.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/AccountHolder.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/AccountHolderCapability.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Address.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Authentication.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Balance.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/BalanceAccount.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/BankAccountDetails.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/BulkAddress.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CapabilityProblem.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CapabilitySettings.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Card.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CardConfiguration.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CardOrderItem.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/ContactDetails.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/DeliveryAddress.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/DeliveryContact.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Device.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Expiry.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/IbanAccountIdentification.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Name.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/PaymentInstrument.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Phone.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/PhoneNumber.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/RemediatingAction.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Resource.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/SweepConfigurationV2.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/SweepCounterparty.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/SweepSchedule.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/TokenAuthentication.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/ValidationFacts.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/VerificationDeadline.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/VerificationError.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs (100%) rename Adyen/{src => }/Model/ConfigurationWebhooks/Wallet.cs (100%) rename Adyen/{src => }/Model/DataProtection/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/DataProtection/ServiceError.cs (100%) rename Adyen/{src => }/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs (100%) rename Adyen/{src => }/Model/DataProtection/SubjectErasureResponse.cs (100%) rename Adyen/{src => }/Model/DisputeWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/DisputeWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{src => }/Model/DisputeWebhooks/DisputeEventNotification.cs (100%) rename Adyen/{src => }/Model/DisputeWebhooks/DisputeNotificationRequest.cs (100%) rename Adyen/{src => }/Model/Disputes/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Disputes/AcceptDisputeRequest.cs (100%) rename Adyen/{src => }/Model/Disputes/AcceptDisputeResponse.cs (100%) rename Adyen/{src => }/Model/Disputes/DefendDisputeRequest.cs (100%) rename Adyen/{src => }/Model/Disputes/DefendDisputeResponse.cs (100%) rename Adyen/{src => }/Model/Disputes/DefenseDocument.cs (100%) rename Adyen/{src => }/Model/Disputes/DefenseDocumentType.cs (100%) rename Adyen/{src => }/Model/Disputes/DefenseReason.cs (100%) rename Adyen/{src => }/Model/Disputes/DefenseReasonsRequest.cs (100%) rename Adyen/{src => }/Model/Disputes/DefenseReasonsResponse.cs (100%) rename Adyen/{src => }/Model/Disputes/DeleteDefenseDocumentRequest.cs (100%) rename Adyen/{src => }/Model/Disputes/DeleteDefenseDocumentResponse.cs (100%) rename Adyen/{src => }/Model/Disputes/DisputeServiceResult.cs (100%) rename Adyen/{src => }/Model/Disputes/ServiceError.cs (100%) rename Adyen/{src => }/Model/Disputes/SupplyDefenseDocumentRequest.cs (100%) rename Adyen/{src => }/Model/Disputes/SupplyDefenseDocumentResponse.cs (100%) rename Adyen/{src => }/Model/Environment.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/AULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/AdditionalBankIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Address.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Amount.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Attachment.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BankAccountInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BirthData.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BusinessLine.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BusinessLineInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/BusinessLines.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CALocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CalculatePciStatusRequest.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CalculatePciStatusResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CapabilityProblem.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CapabilityProblemEntity.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CapabilitySettings.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/DKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Document.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/DocumentPage.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/DocumentReference.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/EntityReference.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/FinancialReport.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/HKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/HULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/IbanAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/IdentificationData.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Individual.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/LegalEntity.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/LegalEntityAssociation.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/LegalEntityCapability.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/LegalEntityInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/NOLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/NZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Name.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/OnboardingLink.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/OnboardingLinkInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/OnboardingLinkSettings.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/OnboardingTheme.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/OnboardingThemes.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Organization.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/OwnerEntity.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/PLLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/PciDocumentInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/PciSigningRequest.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/PciSigningResponse.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/PhoneNumber.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/RemediatingAction.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/SELocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/SGLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/ServiceError.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/SoleProprietorship.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/SourceOfFunds.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/StockData.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/SupportingEntityCapability.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/TaxInformation.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/TaxReportingClassification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/TransferInstrument.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/TransferInstrumentInfo.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/TransferInstrumentReference.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/Trust.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/UKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/USLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/UndefinedBeneficiary.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/UnincorporatedPartnership.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/VerificationDeadline.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/VerificationError.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/VerificationErrorRecursive.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/VerificationErrors.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/WebData.cs (100%) rename Adyen/{src => }/Model/LegalEntityManagement/WebDataExemption.cs (100%) rename Adyen/{src => }/Model/Management/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Management/AccelInfo.cs (100%) rename Adyen/{src => }/Model/Management/AdditionalCommission.cs (100%) rename Adyen/{src => }/Model/Management/AdditionalSettings.cs (100%) rename Adyen/{src => }/Model/Management/AdditionalSettingsResponse.cs (100%) rename Adyen/{src => }/Model/Management/Address.cs (100%) rename Adyen/{src => }/Model/Management/AffirmInfo.cs (100%) rename Adyen/{src => }/Model/Management/AfterpayTouchInfo.cs (100%) rename Adyen/{src => }/Model/Management/AllowedOrigin.cs (100%) rename Adyen/{src => }/Model/Management/AllowedOriginsResponse.cs (100%) rename Adyen/{src => }/Model/Management/AmexInfo.cs (100%) rename Adyen/{src => }/Model/Management/Amount.cs (100%) rename Adyen/{src => }/Model/Management/AndroidApp.cs (100%) rename Adyen/{src => }/Model/Management/AndroidAppError.cs (100%) rename Adyen/{src => }/Model/Management/AndroidAppsResponse.cs (100%) rename Adyen/{src => }/Model/Management/AndroidCertificate.cs (100%) rename Adyen/{src => }/Model/Management/AndroidCertificatesResponse.cs (100%) rename Adyen/{src => }/Model/Management/ApiCredential.cs (100%) rename Adyen/{src => }/Model/Management/ApiCredentialLinks.cs (100%) rename Adyen/{src => }/Model/Management/ApplePayInfo.cs (100%) rename Adyen/{src => }/Model/Management/BcmcInfo.cs (100%) rename Adyen/{src => }/Model/Management/BillingEntitiesResponse.cs (100%) rename Adyen/{src => }/Model/Management/BillingEntity.cs (100%) rename Adyen/{src => }/Model/Management/CardholderReceipt.cs (100%) rename Adyen/{src => }/Model/Management/CartesBancairesInfo.cs (100%) rename Adyen/{src => }/Model/Management/ClearpayInfo.cs (100%) rename Adyen/{src => }/Model/Management/Commission.cs (100%) rename Adyen/{src => }/Model/Management/Company.cs (100%) rename Adyen/{src => }/Model/Management/CompanyApiCredential.cs (100%) rename Adyen/{src => }/Model/Management/CompanyLinks.cs (100%) rename Adyen/{src => }/Model/Management/CompanyUser.cs (100%) rename Adyen/{src => }/Model/Management/Connectivity.cs (100%) rename Adyen/{src => }/Model/Management/Contact.cs (100%) rename Adyen/{src => }/Model/Management/CreateAllowedOriginRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateApiCredentialResponse.cs (100%) rename Adyen/{src => }/Model/Management/CreateCompanyApiCredentialRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateCompanyApiCredentialResponse.cs (100%) rename Adyen/{src => }/Model/Management/CreateCompanyUserRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateCompanyUserResponse.cs (100%) rename Adyen/{src => }/Model/Management/CreateCompanyWebhookRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateMerchantApiCredentialRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateMerchantRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateMerchantResponse.cs (100%) rename Adyen/{src => }/Model/Management/CreateMerchantUserRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateMerchantWebhookRequest.cs (100%) rename Adyen/{src => }/Model/Management/CreateUserResponse.cs (100%) rename Adyen/{src => }/Model/Management/Currency.cs (100%) rename Adyen/{src => }/Model/Management/CustomNotification.cs (100%) rename Adyen/{src => }/Model/Management/DataCenter.cs (100%) rename Adyen/{src => }/Model/Management/DinersInfo.cs (100%) rename Adyen/{src => }/Model/Management/EventUrl.cs (100%) rename Adyen/{src => }/Model/Management/ExternalTerminalAction.cs (100%) rename Adyen/{src => }/Model/Management/File.cs (100%) rename Adyen/{src => }/Model/Management/GenerateApiKeyResponse.cs (100%) rename Adyen/{src => }/Model/Management/GenerateClientKeyResponse.cs (100%) rename Adyen/{src => }/Model/Management/GenerateHmacKeyResponse.cs (100%) rename Adyen/{src => }/Model/Management/GenericPmWithTdiInfo.cs (100%) rename Adyen/{src => }/Model/Management/GiroPayInfo.cs (100%) rename Adyen/{src => }/Model/Management/GooglePayInfo.cs (100%) rename Adyen/{src => }/Model/Management/Gratuity.cs (100%) rename Adyen/{src => }/Model/Management/Hardware.cs (100%) rename Adyen/{src => }/Model/Management/IdName.cs (100%) rename Adyen/{src => }/Model/Management/InstallAndroidAppDetails.cs (100%) rename Adyen/{src => }/Model/Management/InstallAndroidCertificateDetails.cs (100%) rename Adyen/{src => }/Model/Management/InvalidField.cs (100%) rename Adyen/{src => }/Model/Management/JCBInfo.cs (100%) rename Adyen/{src => }/Model/Management/Key.cs (100%) rename Adyen/{src => }/Model/Management/KlarnaInfo.cs (100%) rename Adyen/{src => }/Model/Management/Links.cs (100%) rename Adyen/{src => }/Model/Management/LinksElement.cs (100%) rename Adyen/{src => }/Model/Management/ListCompanyApiCredentialsResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListCompanyResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListCompanyUsersResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListExternalTerminalActionsResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListMerchantApiCredentialsResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListMerchantResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListMerchantUsersResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListStoresResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListTerminalsResponse.cs (100%) rename Adyen/{src => }/Model/Management/ListWebhooksResponse.cs (100%) rename Adyen/{src => }/Model/Management/Localization.cs (100%) rename Adyen/{src => }/Model/Management/Logo.cs (100%) rename Adyen/{src => }/Model/Management/MeApiCredential.cs (100%) rename Adyen/{src => }/Model/Management/MealVoucherFRInfo.cs (100%) rename Adyen/{src => }/Model/Management/Merchant.cs (100%) rename Adyen/{src => }/Model/Management/MerchantLinks.cs (100%) rename Adyen/{src => }/Model/Management/MinorUnitsMonetaryValue.cs (100%) rename Adyen/{src => }/Model/Management/ModelConfiguration.cs (100%) rename Adyen/{src => }/Model/Management/Name.cs (100%) rename Adyen/{src => }/Model/Management/Name2.cs (100%) rename Adyen/{src => }/Model/Management/Nexo.cs (100%) rename Adyen/{src => }/Model/Management/Notification.cs (100%) rename Adyen/{src => }/Model/Management/NotificationUrl.cs (100%) rename Adyen/{src => }/Model/Management/NyceInfo.cs (100%) rename Adyen/{src => }/Model/Management/OfflineProcessing.cs (100%) rename Adyen/{src => }/Model/Management/Opi.cs (100%) rename Adyen/{src => }/Model/Management/OrderItem.cs (100%) rename Adyen/{src => }/Model/Management/PaginationLinks.cs (100%) rename Adyen/{src => }/Model/Management/Passcodes.cs (100%) rename Adyen/{src => }/Model/Management/PayAtTable.cs (100%) rename Adyen/{src => }/Model/Management/PayMeInfo.cs (100%) rename Adyen/{src => }/Model/Management/PayPalInfo.cs (100%) rename Adyen/{src => }/Model/Management/PayToInfo.cs (100%) rename Adyen/{src => }/Model/Management/Payment.cs (100%) rename Adyen/{src => }/Model/Management/PaymentMethod.cs (100%) rename Adyen/{src => }/Model/Management/PaymentMethodResponse.cs (100%) rename Adyen/{src => }/Model/Management/PaymentMethodSetupInfo.cs (100%) rename Adyen/{src => }/Model/Management/PayoutSettings.cs (100%) rename Adyen/{src => }/Model/Management/PayoutSettingsRequest.cs (100%) rename Adyen/{src => }/Model/Management/PayoutSettingsResponse.cs (100%) rename Adyen/{src => }/Model/Management/Profile.cs (100%) rename Adyen/{src => }/Model/Management/PulseInfo.cs (100%) rename Adyen/{src => }/Model/Management/ReceiptOptions.cs (100%) rename Adyen/{src => }/Model/Management/ReceiptPrinting.cs (100%) rename Adyen/{src => }/Model/Management/Referenced.cs (100%) rename Adyen/{src => }/Model/Management/Refunds.cs (100%) rename Adyen/{src => }/Model/Management/ReleaseUpdateDetails.cs (100%) rename Adyen/{src => }/Model/Management/ReprocessAndroidAppResponse.cs (100%) rename Adyen/{src => }/Model/Management/RequestActivationResponse.cs (100%) rename Adyen/{src => }/Model/Management/RestServiceError.cs (100%) rename Adyen/{src => }/Model/Management/ScheduleTerminalActionsRequest.cs (100%) rename Adyen/{src => }/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs (100%) rename Adyen/{src => }/Model/Management/ScheduleTerminalActionsResponse.cs (100%) rename Adyen/{src => }/Model/Management/Settings.cs (100%) rename Adyen/{src => }/Model/Management/ShippingLocation.cs (100%) rename Adyen/{src => }/Model/Management/ShippingLocationsResponse.cs (100%) rename Adyen/{src => }/Model/Management/Signature.cs (100%) rename Adyen/{src => }/Model/Management/SodexoInfo.cs (100%) rename Adyen/{src => }/Model/Management/SofortInfo.cs (100%) rename Adyen/{src => }/Model/Management/SplitConfiguration.cs (100%) rename Adyen/{src => }/Model/Management/SplitConfigurationList.cs (100%) rename Adyen/{src => }/Model/Management/SplitConfigurationLogic.cs (100%) rename Adyen/{src => }/Model/Management/SplitConfigurationRule.cs (100%) rename Adyen/{src => }/Model/Management/Standalone.cs (100%) rename Adyen/{src => }/Model/Management/StarInfo.cs (100%) rename Adyen/{src => }/Model/Management/Store.cs (100%) rename Adyen/{src => }/Model/Management/StoreAndForward.cs (100%) rename Adyen/{src => }/Model/Management/StoreCreationRequest.cs (100%) rename Adyen/{src => }/Model/Management/StoreCreationWithMerchantCodeRequest.cs (100%) rename Adyen/{src => }/Model/Management/StoreLocation.cs (100%) rename Adyen/{src => }/Model/Management/StoreSplitConfiguration.cs (100%) rename Adyen/{src => }/Model/Management/SupportedCardTypes.cs (100%) rename Adyen/{src => }/Model/Management/Surcharge.cs (100%) rename Adyen/{src => }/Model/Management/SwishInfo.cs (100%) rename Adyen/{src => }/Model/Management/TapToPay.cs (100%) rename Adyen/{src => }/Model/Management/Terminal.cs (100%) rename Adyen/{src => }/Model/Management/TerminalActionScheduleDetail.cs (100%) rename Adyen/{src => }/Model/Management/TerminalAssignment.cs (100%) rename Adyen/{src => }/Model/Management/TerminalConnectivity.cs (100%) rename Adyen/{src => }/Model/Management/TerminalConnectivityBluetooth.cs (100%) rename Adyen/{src => }/Model/Management/TerminalConnectivityCellular.cs (100%) rename Adyen/{src => }/Model/Management/TerminalConnectivityEthernet.cs (100%) rename Adyen/{src => }/Model/Management/TerminalConnectivityWifi.cs (100%) rename Adyen/{src => }/Model/Management/TerminalInstructions.cs (100%) rename Adyen/{src => }/Model/Management/TerminalModelsResponse.cs (100%) rename Adyen/{src => }/Model/Management/TerminalOrder.cs (100%) rename Adyen/{src => }/Model/Management/TerminalOrderRequest.cs (100%) rename Adyen/{src => }/Model/Management/TerminalOrdersResponse.cs (100%) rename Adyen/{src => }/Model/Management/TerminalProduct.cs (100%) rename Adyen/{src => }/Model/Management/TerminalProductPrice.cs (100%) rename Adyen/{src => }/Model/Management/TerminalProductsResponse.cs (100%) rename Adyen/{src => }/Model/Management/TerminalReassignmentRequest.cs (100%) rename Adyen/{src => }/Model/Management/TerminalReassignmentTarget.cs (100%) rename Adyen/{src => }/Model/Management/TerminalSettings.cs (100%) rename Adyen/{src => }/Model/Management/TestCompanyWebhookRequest.cs (100%) rename Adyen/{src => }/Model/Management/TestOutput.cs (100%) rename Adyen/{src => }/Model/Management/TestWebhookRequest.cs (100%) rename Adyen/{src => }/Model/Management/TestWebhookResponse.cs (100%) rename Adyen/{src => }/Model/Management/TicketInfo.cs (100%) rename Adyen/{src => }/Model/Management/Timeouts.cs (100%) rename Adyen/{src => }/Model/Management/TransactionDescriptionInfo.cs (100%) rename Adyen/{src => }/Model/Management/TwintInfo.cs (100%) rename Adyen/{src => }/Model/Management/UninstallAndroidAppDetails.cs (100%) rename Adyen/{src => }/Model/Management/UninstallAndroidCertificateDetails.cs (100%) rename Adyen/{src => }/Model/Management/UpdatableAddress.cs (100%) rename Adyen/{src => }/Model/Management/UpdateCompanyApiCredentialRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateCompanyUserRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateCompanyWebhookRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateMerchantApiCredentialRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateMerchantUserRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateMerchantWebhookRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdatePaymentMethodInfo.cs (100%) rename Adyen/{src => }/Model/Management/UpdatePayoutSettingsRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateSplitConfigurationLogicRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateSplitConfigurationRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateSplitConfigurationRuleRequest.cs (100%) rename Adyen/{src => }/Model/Management/UpdateStoreRequest.cs (100%) rename Adyen/{src => }/Model/Management/UploadAndroidAppResponse.cs (100%) rename Adyen/{src => }/Model/Management/UploadAndroidCertificateResponse.cs (100%) rename Adyen/{src => }/Model/Management/Url.cs (100%) rename Adyen/{src => }/Model/Management/User.cs (100%) rename Adyen/{src => }/Model/Management/VippsInfo.cs (100%) rename Adyen/{src => }/Model/Management/WeChatPayInfo.cs (100%) rename Adyen/{src => }/Model/Management/WeChatPayPosInfo.cs (100%) rename Adyen/{src => }/Model/Management/Webhook.cs (100%) rename Adyen/{src => }/Model/Management/WebhookLinks.cs (100%) rename Adyen/{src => }/Model/Management/WifiProfiles.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/AccountCapabilityData.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/AccountCreateNotificationData.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/AccountNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/AccountUpdateNotificationData.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/CapabilityProblem.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/CapabilityProblemEntity.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/MidServiceNotificationData.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/RemediatingAction.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalBoardingData.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalSettingsData.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/VerificationError.cs (100%) rename Adyen/{src => }/Model/ManagementWebhooks/VerificationErrorRecursive.cs (100%) rename Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs (100%) rename Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs (100%) rename Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/Resource.cs (100%) rename Adyen/{src => }/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs (100%) rename Adyen/{src => }/Model/Notification/NotificationRequest.cs (100%) rename Adyen/{src => }/Model/Notification/NotificationRequestConst.cs (100%) rename Adyen/{src => }/Model/Notification/NotificationRequestItem.cs (100%) rename Adyen/{src => }/Model/Notification/NotificationRequestItemContainer.cs (100%) rename Adyen/{src => }/Model/Payment/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Payment/AccountInfo.cs (100%) rename Adyen/{src => }/Model/Payment/AcctInfo.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalData3DSecure.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataAirline.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataCarRental.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataCommon.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataLevel23.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataLodging.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataModifications.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataOpenInvoice.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataOpi.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataRatepay.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataRetry.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataRisk.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataRiskStandalone.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataSubMerchant.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataTemporaryServices.cs (100%) rename Adyen/{src => }/Model/Payment/AdditionalDataWallets.cs (100%) rename Adyen/{src => }/Model/Payment/Address.cs (100%) rename Adyen/{src => }/Model/Payment/AdjustAuthorisationRequest.cs (100%) rename Adyen/{src => }/Model/Payment/Amount.cs (100%) rename Adyen/{src => }/Model/Payment/ApplicationInfo.cs (100%) rename Adyen/{src => }/Model/Payment/AuthenticationResultRequest.cs (100%) rename Adyen/{src => }/Model/Payment/AuthenticationResultResponse.cs (100%) rename Adyen/{src => }/Model/Payment/BankAccount.cs (100%) rename Adyen/{src => }/Model/Payment/BrowserInfo.cs (100%) rename Adyen/{src => }/Model/Payment/CancelOrRefundRequest.cs (100%) rename Adyen/{src => }/Model/Payment/CancelRequest.cs (100%) rename Adyen/{src => }/Model/Payment/CaptureRequest.cs (100%) rename Adyen/{src => }/Model/Payment/Card.cs (100%) rename Adyen/{src => }/Model/Payment/CommonField.cs (100%) rename Adyen/{src => }/Model/Payment/DeviceRenderOptions.cs (100%) rename Adyen/{src => }/Model/Payment/DonationRequest.cs (100%) rename Adyen/{src => }/Model/Payment/ExternalPlatform.cs (100%) rename Adyen/{src => }/Model/Payment/ForexQuote.cs (100%) rename Adyen/{src => }/Model/Payment/FraudCheckResult.cs (100%) rename Adyen/{src => }/Model/Payment/FraudCheckResultWrapper.cs (100%) rename Adyen/{src => }/Model/Payment/FraudResult.cs (100%) rename Adyen/{src => }/Model/Payment/FundDestination.cs (100%) rename Adyen/{src => }/Model/Payment/FundSource.cs (100%) rename Adyen/{src => }/Model/Payment/Installments.cs (100%) rename Adyen/{src => }/Model/Payment/Mandate.cs (100%) rename Adyen/{src => }/Model/Payment/MerchantDevice.cs (100%) rename Adyen/{src => }/Model/Payment/MerchantRiskIndicator.cs (100%) rename Adyen/{src => }/Model/Payment/ModificationResult.cs (100%) rename Adyen/{src => }/Model/Payment/Name.cs (100%) rename Adyen/{src => }/Model/Payment/PaymentRequest.cs (100%) rename Adyen/{src => }/Model/Payment/PaymentRequest3d.cs (100%) rename Adyen/{src => }/Model/Payment/PaymentRequest3ds2.cs (100%) rename Adyen/{src => }/Model/Payment/PaymentResult.cs (100%) rename Adyen/{src => }/Model/Payment/Phone.cs (100%) rename Adyen/{src => }/Model/Payment/PlatformChargebackLogic.cs (100%) rename Adyen/{src => }/Model/Payment/Recurring.cs (100%) rename Adyen/{src => }/Model/Payment/RefundRequest.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalData3DSecure.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataBillingAddress.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataCard.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataCommon.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataDomesticError.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataInstallments.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataNetworkTokens.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataOpi.cs (100%) rename Adyen/{src => }/Model/Payment/ResponseAdditionalDataSepa.cs (100%) rename Adyen/{src => }/Model/Payment/SDKEphemPubKey.cs (100%) rename Adyen/{src => }/Model/Payment/SecureRemoteCommerceCheckoutData.cs (100%) rename Adyen/{src => }/Model/Payment/ServiceError.cs (100%) rename Adyen/{src => }/Model/Payment/ShopperInteractionDevice.cs (100%) rename Adyen/{src => }/Model/Payment/Split.cs (100%) rename Adyen/{src => }/Model/Payment/SplitAmount.cs (100%) rename Adyen/{src => }/Model/Payment/SubMerchant.cs (100%) rename Adyen/{src => }/Model/Payment/TechnicalCancelRequest.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDS1Result.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDS2RequestData.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDS2Result.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDS2ResultRequest.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDS2ResultResponse.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs (100%) rename Adyen/{src => }/Model/Payment/ThreeDSecureData.cs (100%) rename Adyen/{src => }/Model/Payment/VoidPendingRefundRequest.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/BoardingTokenRequest.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/BoardingTokenResponse.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/DefaultErrorResponseEntity.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/InvalidField.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/PaymentsAppDto.cs (100%) rename Adyen/{src => }/Model/PaymentsApp/PaymentsAppResponse.cs (100%) rename Adyen/{src => }/Model/Payout/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Payout/Address.cs (100%) rename Adyen/{src => }/Model/Payout/Amount.cs (100%) rename Adyen/{src => }/Model/Payout/BankAccount.cs (100%) rename Adyen/{src => }/Model/Payout/Card.cs (100%) rename Adyen/{src => }/Model/Payout/FraudCheckResult.cs (100%) rename Adyen/{src => }/Model/Payout/FraudCheckResultWrapper.cs (100%) rename Adyen/{src => }/Model/Payout/FraudResult.cs (100%) rename Adyen/{src => }/Model/Payout/FundSource.cs (100%) rename Adyen/{src => }/Model/Payout/ModifyRequest.cs (100%) rename Adyen/{src => }/Model/Payout/ModifyResponse.cs (100%) rename Adyen/{src => }/Model/Payout/Name.cs (100%) rename Adyen/{src => }/Model/Payout/PayoutRequest.cs (100%) rename Adyen/{src => }/Model/Payout/PayoutResponse.cs (100%) rename Adyen/{src => }/Model/Payout/Recurring.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalData3DSecure.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataBillingAddress.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataCard.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataCommon.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataDomesticError.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataInstallments.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataNetworkTokens.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataOpi.cs (100%) rename Adyen/{src => }/Model/Payout/ResponseAdditionalDataSepa.cs (100%) rename Adyen/{src => }/Model/Payout/ServiceError.cs (100%) rename Adyen/{src => }/Model/Payout/StoreDetailAndSubmitRequest.cs (100%) rename Adyen/{src => }/Model/Payout/StoreDetailAndSubmitResponse.cs (100%) rename Adyen/{src => }/Model/Payout/StoreDetailRequest.cs (100%) rename Adyen/{src => }/Model/Payout/StoreDetailResponse.cs (100%) rename Adyen/{src => }/Model/Payout/SubmitRequest.cs (100%) rename Adyen/{src => }/Model/Payout/SubmitResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/Account.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/AccountEvent.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/AccountHolderDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/AccountHolderStatus.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/AccountPayoutState.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/AccountProcessingState.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/Amount.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/BankAccountDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/BusinessDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CloseAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CloseAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CloseAccountRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CloseAccountResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CloseStoresRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CreateAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CreateAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CreateAccountRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/CreateAccountResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/DeleteBankAccountRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/DeletePayoutMethodRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/DeleteShareholderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/DeleteSignatoriesRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/DocumentDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ErrorFieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/FieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GenericResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetTaxFormRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetTaxFormResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/IndividualDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCCheckStatusData.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCCheckSummary.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCShareholderCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCSignatoryCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/KYCVerificationResult.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/LegalArrangementDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/LegalArrangementEntityDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/LegalArrangementRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/MigratedAccounts.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/MigratedShareholders.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/MigratedStores.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/MigrationData.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/PayoutMethod.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/PayoutScheduleResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/PerformVerificationRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/PersonalDocumentData.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ServiceError.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ShareholderContact.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/SignatoryContact.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/StoreDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/SuspendAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/SuspendAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UltimateParentCompany.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UpdateAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UpdateAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UpdateAccountRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UpdateAccountResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/UploadDocumentRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ViasAddress.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ViasName.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ViasPersonalData.cs (100%) rename Adyen/{src => }/Model/PlatformsAccount/ViasPhoneNumber.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AccountDetailBalance.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AccountHolderBalanceRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AccountHolderBalanceResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AccountHolderTransactionListRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AccountHolderTransactionListResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/AccountTransactionList.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/Amount.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/BankAccountDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/DebitAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/DebitAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/DetailBalance.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/ErrorFieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/FieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/PayoutAccountHolderRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/PayoutAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/RefundFundsTransferRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/RefundFundsTransferResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/ServiceError.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/SetupBeneficiaryRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/SetupBeneficiaryResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/Split.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/SplitAmount.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/Transaction.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/TransactionListForAccount.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/TransferFundsRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsFund/TransferFundsResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/CollectInformation.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/FieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/ServiceError.cs (100%) rename Adyen/{src => }/Model/PlatformsHostedOnboardingPage/ShowPages.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/FieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/GenericResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/ServiceError.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountCloseNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountCreateNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountEvent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderStatus.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountPayoutState.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountProcessingState.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/AccountUpdateNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/BankAccountDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/BusinessDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/CloseAccountResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/CreateAccountResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ErrorFieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/FieldType.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/IndividualDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCCheckStatusData.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCCheckSummary.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/KYCVerificationResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/LegalArrangementDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/LocalDate.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/Message.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/NotificationErrorContainer.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/NotificationResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/OperationStatus.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/PaymentFailureNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/PayoutMethod.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/PayoutScheduleResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/PersonalDocumentData.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/RefundResult.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ReportAvailableNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ShareholderContact.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/SignatoryContact.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/Split.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/SplitAmount.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/StoreDetail.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/Transaction.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/TransferFundsNotification.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/UltimateParentCompany.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/UpdateAccountResponse.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ViasAddress.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ViasName.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ViasPersonalData.cs (100%) rename Adyen/{src => }/Model/PlatformsWebhooks/ViasPhoneNumber.cs (100%) rename Adyen/{src => }/Model/PosMobile/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PosMobile/CreateSessionRequest.cs (100%) rename Adyen/{src => }/Model/PosMobile/CreateSessionResponse.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/Address.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/AssignTerminalsRequest.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/AssignTerminalsResponse.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/FindTerminalRequest.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/FindTerminalResponse.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/MerchantAccount.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/ServiceError.cs (100%) rename Adyen/{src => }/Model/PosTerminalManagement/Store.cs (100%) rename Adyen/{src => }/Model/Recurring/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Recurring/Address.cs (100%) rename Adyen/{src => }/Model/Recurring/Amount.cs (100%) rename Adyen/{src => }/Model/Recurring/BankAccount.cs (100%) rename Adyen/{src => }/Model/Recurring/Card.cs (100%) rename Adyen/{src => }/Model/Recurring/CreatePermitRequest.cs (100%) rename Adyen/{src => }/Model/Recurring/CreatePermitResult.cs (100%) rename Adyen/{src => }/Model/Recurring/DisablePermitRequest.cs (100%) rename Adyen/{src => }/Model/Recurring/DisablePermitResult.cs (100%) rename Adyen/{src => }/Model/Recurring/DisableRequest.cs (100%) rename Adyen/{src => }/Model/Recurring/DisableResult.cs (100%) rename Adyen/{src => }/Model/Recurring/Name.cs (100%) rename Adyen/{src => }/Model/Recurring/NotifyShopperRequest.cs (100%) rename Adyen/{src => }/Model/Recurring/NotifyShopperResult.cs (100%) rename Adyen/{src => }/Model/Recurring/Permit.cs (100%) rename Adyen/{src => }/Model/Recurring/PermitRestriction.cs (100%) rename Adyen/{src => }/Model/Recurring/PermitResult.cs (100%) rename Adyen/{src => }/Model/Recurring/Recurring.cs (100%) rename Adyen/{src => }/Model/Recurring/RecurringDetail.cs (100%) rename Adyen/{src => }/Model/Recurring/RecurringDetailWrapper.cs (100%) rename Adyen/{src => }/Model/Recurring/RecurringDetailsRequest.cs (100%) rename Adyen/{src => }/Model/Recurring/RecurringDetailsResult.cs (100%) rename Adyen/{src => }/Model/Recurring/ScheduleAccountUpdaterRequest.cs (100%) rename Adyen/{src => }/Model/Recurring/ScheduleAccountUpdaterResult.cs (100%) rename Adyen/{src => }/Model/Recurring/ServiceError.cs (100%) rename Adyen/{src => }/Model/Recurring/TokenDetails.cs (100%) rename Adyen/{src => }/Model/ReportWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{src => }/Model/ReportWebhooks/ReportNotificationData.cs (100%) rename Adyen/{src => }/Model/ReportWebhooks/ReportNotificationRequest.cs (100%) rename Adyen/{src => }/Model/ReportWebhooks/Resource.cs (100%) rename Adyen/{src => }/Model/ReportWebhooks/ResourceReference.cs (100%) rename Adyen/{src => }/Model/RequestOptions.cs (100%) rename Adyen/{src => }/Model/StoredValue/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/StoredValue/Amount.cs (100%) rename Adyen/{src => }/Model/StoredValue/ServiceError.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueBalanceCheckRequest.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueBalanceCheckResponse.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueBalanceMergeRequest.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueBalanceMergeResponse.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueIssueRequest.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueIssueResponse.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueLoadRequest.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueLoadResponse.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueStatusChangeRequest.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueStatusChangeResponse.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueVoidRequest.cs (100%) rename Adyen/{src => }/Model/StoredValue/StoredValueVoidResponse.cs (100%) rename Adyen/{src => }/Model/Terminal/SaleToAcquirerData.cs (100%) rename Adyen/{src => }/Model/Terminal/Split.cs (100%) rename Adyen/{src => }/Model/Terminal/SplitItem.cs (100%) rename Adyen/{src => }/Model/Terminal/SplitItemType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AbortRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AccountType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AdminRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AdminResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AlgorithmIdentifier.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AlgorithmType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AlignmentType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AllowedProduct.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Amount.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AmountsReq.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AmountsResp.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AreaSize.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AuthenticatedData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/AuthenticationMethodType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/BalanceInquiryRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/BalanceInquiryResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/BarcodeType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/BatchRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/BatchResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CapturedSignature.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardAcquisitionRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardAcquisitionResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardAcquisitionTransaction.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardReaderAPDURequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardReaderAPDUResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardReaderInitRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardReaderInitResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardReaderPowerOffRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardReaderPowerOffResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CardholderPIN.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CashHandlingDevice.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CharacterHeightType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CharacterStyleType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CharacterWidthType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CheckData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CheckTypeCodeType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CoinsOrBills.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ColorType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ContentInformation.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ContentType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CurrencyConversion.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CustomerOrder.cs (100%) rename Adyen/{src => }/Model/TerminalApi/CustomerOrderReqType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DeviceType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DiagnosisRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DiagnosisResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DigestedData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DisplayOutput.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DisplayRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DisplayResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/DocumentQualifierType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EnableServiceRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EnableServiceResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EncapsulatedContent.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EncryptedContent.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EntryModeType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EnvelopedData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ErrorConditionType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EventNotification.cs (100%) rename Adyen/{src => }/Model/TerminalApi/EventToNotifyType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ForceTypeModeType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/GenericProfileType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/GeographicCoordinates.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Geolocation.cs (100%) rename Adyen/{src => }/Model/TerminalApi/GetTotalsRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/GetTotalsResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/GlobalStatusType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/HostStatus.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ICCResetData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/IdentificationSupportType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/IdentificationType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InfoQualifyType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Input.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InputCommandType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InputData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InputRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InputResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InputResult.cs (100%) rename Adyen/{src => }/Model/TerminalApi/InputUpdate.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Instalment.cs (100%) rename Adyen/{src => }/Model/TerminalApi/IssuerAndSerialNumber.cs (100%) rename Adyen/{src => }/Model/TerminalApi/KEK.cs (100%) rename Adyen/{src => }/Model/TerminalApi/KEKIdentifier.cs (100%) rename Adyen/{src => }/Model/TerminalApi/KeyTransport.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoginRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoginResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LogoutRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LogoutResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyAccount.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyAccountID.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyAccountReq.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyAccountStatus.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyAcquirerData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyAmount.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyHandlingType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyResult.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyTotals.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyTransaction.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyTransactionType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/LoyaltyUnitType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MenuEntry.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MenuEntryTagType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Message/SaleToPOIRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MessageCategoryType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MessageClassType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MessageHeader.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MessageReference.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MessageType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/MobileData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/NamedKeyEncryptedData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/OriginalPOITransaction.cs (100%) rename Adyen/{src => }/Model/TerminalApi/OutputBarcode.cs (100%) rename Adyen/{src => }/Model/TerminalApi/OutputContent.cs (100%) rename Adyen/{src => }/Model/TerminalApi/OutputFormatType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/OutputResult.cs (100%) rename Adyen/{src => }/Model/TerminalApi/OutputText.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PINFormatType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PINRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PINRequestType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PINResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/POIData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/POIProfile.cs (100%) rename Adyen/{src => }/Model/TerminalApi/POISoftware.cs (100%) rename Adyen/{src => }/Model/TerminalApi/POIStatus.cs (100%) rename Adyen/{src => }/Model/TerminalApi/POISystemData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/POITerminalData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Parameter.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentAccountReq.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentAccountStatus.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentAcquirerData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentInstrumentData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentInstrumentType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentReceipt.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentResult.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentToken.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentTotals.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentTransaction.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PaymentType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PerformedTransaction.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PeriodUnitType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PredefinedContent.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PrintOutput.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PrintRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PrintResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/PrinterStatusType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Rebates.cs (100%) rename Adyen/{src => }/Model/TerminalApi/RecipientIdentifier.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ReconciliationRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ReconciliationResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ReconciliationType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/RelativeDistinguishedName.cs (100%) rename Adyen/{src => }/Model/TerminalApi/RepeatedMessageResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/RepeatedResponseMessageBody.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Response.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ResponseModeType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ResultType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ReversalReasonType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ReversalRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/ReversalResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleItem.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleItemRebate.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleProfile.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleSoftware.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleTerminalData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleToIssuerData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleToPOIMessage.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SaleToPOIResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SensitiveCardData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SensitiveMobileData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SignaturePoint.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SignedData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/Signer.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SignerIdentifier.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SoundActionType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SoundContent.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SoundFormatType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SoundRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SoundResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/SponsoredMerchant.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueAccountID.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueAccountStatus.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueAccountType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueResult.cs (100%) rename Adyen/{src => }/Model/TerminalApi/StoredValueTransactionType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TerminalEnvironmentType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TokenRequestedType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TotalDetailsType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TotalFilter.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TrackData.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TrackFormatType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionActionType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionConditions.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionIdentification.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionStatusRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionStatusResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionToPerform.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionTotals.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransactionType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransmitRequest.cs (100%) rename Adyen/{src => }/Model/TerminalApi/TransmitResponse.cs (100%) rename Adyen/{src => }/Model/TerminalApi/UTMCoordinates.cs (100%) rename Adyen/{src => }/Model/TerminalApi/UnitOfMeasureType.cs (100%) rename Adyen/{src => }/Model/TerminalApi/VersionType.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/BankCategoryData.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/InternalCategoryData.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/IssuedCard.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/PaymentInstrument.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/PlatformPayment.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/RelayedAuthorisationData.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/Resource.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/ResourceReference.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/ThreeDSecure.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/Transaction.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/TransferNotificationValidationFact.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/TransferView.cs (100%) rename Adyen/{src => }/Model/TransactionWebhooks/TransferViewCategoryData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/AULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/AdditionalBankIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Address.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Airline.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Amount.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/AmountAdjustment.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/BRLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/BalanceMutation.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/BankAccountV3.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/BankCategoryData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/CALocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/CZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Card.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/CardIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/ConfirmationTrackingData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/CounterpartyV3.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/DKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/DirectDebitInformation.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/EstimationTrackingData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/ExternalReason.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/HKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/HULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/IbanAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/InternalCategoryData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/InternalReviewTrackingData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/IssuedCard.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/IssuingTransactionData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Leg.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Lodging.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/MerchantData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/MerchantPurchaseData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Modification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/NOLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/NZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/NameLocation.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/PLLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/PartyIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/PaymentInstrument.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/PlatformPayment.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/RelayedAuthorisationData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/Resource.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/ResourceReference.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/SELocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/SGLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransactionEventViolation.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransactionRuleReference.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransactionRuleSource.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransactionRulesResult.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferDataCategoryData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferDataTracking.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferEvent.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferEventEventsDataInner.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferEventTrackingData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferNotificationCounterParty.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferNotificationMerchantData.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferNotificationRequest.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferNotificationValidationFact.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/TransferReview.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/UKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/TransferWebhooks/USLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/AULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/AbstractOpenAPISchema.cs (100%) rename Adyen/{src => }/Model/Transfers/AdditionalBankIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/Address.cs (100%) rename Adyen/{src => }/Model/Transfers/Airline.cs (100%) rename Adyen/{src => }/Model/Transfers/Amount.cs (100%) rename Adyen/{src => }/Model/Transfers/AmountAdjustment.cs (100%) rename Adyen/{src => }/Model/Transfers/ApproveTransfersRequest.cs (100%) rename Adyen/{src => }/Model/Transfers/BRLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/BalanceMutation.cs (100%) rename Adyen/{src => }/Model/Transfers/BankAccountV3.cs (100%) rename Adyen/{src => }/Model/Transfers/BankAccountV3AccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/BankCategoryData.cs (100%) rename Adyen/{src => }/Model/Transfers/CALocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/CZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/CancelTransfersRequest.cs (100%) rename Adyen/{src => }/Model/Transfers/CapitalBalance.cs (100%) rename Adyen/{src => }/Model/Transfers/CapitalGrant.cs (100%) rename Adyen/{src => }/Model/Transfers/CapitalGrantInfo.cs (100%) rename Adyen/{src => }/Model/Transfers/CapitalGrants.cs (100%) rename Adyen/{src => }/Model/Transfers/Card.cs (100%) rename Adyen/{src => }/Model/Transfers/CardIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/ConfirmationTrackingData.cs (100%) rename Adyen/{src => }/Model/Transfers/Counterparty.cs (100%) rename Adyen/{src => }/Model/Transfers/CounterpartyInfoV3.cs (100%) rename Adyen/{src => }/Model/Transfers/CounterpartyV3.cs (100%) rename Adyen/{src => }/Model/Transfers/DKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/DirectDebitInformation.cs (100%) rename Adyen/{src => }/Model/Transfers/EstimationTrackingData.cs (100%) rename Adyen/{src => }/Model/Transfers/ExternalReason.cs (100%) rename Adyen/{src => }/Model/Transfers/Fee.cs (100%) rename Adyen/{src => }/Model/Transfers/FindTransfersResponse.cs (100%) rename Adyen/{src => }/Model/Transfers/HKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/HULocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/IbanAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/InternalCategoryData.cs (100%) rename Adyen/{src => }/Model/Transfers/InternalReviewTrackingData.cs (100%) rename Adyen/{src => }/Model/Transfers/InvalidField.cs (100%) rename Adyen/{src => }/Model/Transfers/IssuedCard.cs (100%) rename Adyen/{src => }/Model/Transfers/IssuingTransactionData.cs (100%) rename Adyen/{src => }/Model/Transfers/Leg.cs (100%) rename Adyen/{src => }/Model/Transfers/Link.cs (100%) rename Adyen/{src => }/Model/Transfers/Links.cs (100%) rename Adyen/{src => }/Model/Transfers/Lodging.cs (100%) rename Adyen/{src => }/Model/Transfers/MerchantData.cs (100%) rename Adyen/{src => }/Model/Transfers/MerchantPurchaseData.cs (100%) rename Adyen/{src => }/Model/Transfers/Modification.cs (100%) rename Adyen/{src => }/Model/Transfers/NOLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/NZLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/NameLocation.cs (100%) rename Adyen/{src => }/Model/Transfers/NumberAndBicAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/PLLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/PartyIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/PaymentInstrument.cs (100%) rename Adyen/{src => }/Model/Transfers/PlatformPayment.cs (100%) rename Adyen/{src => }/Model/Transfers/RelayedAuthorisationData.cs (100%) rename Adyen/{src => }/Model/Transfers/Repayment.cs (100%) rename Adyen/{src => }/Model/Transfers/RepaymentTerm.cs (100%) rename Adyen/{src => }/Model/Transfers/ResourceReference.cs (100%) rename Adyen/{src => }/Model/Transfers/RestServiceError.cs (100%) rename Adyen/{src => }/Model/Transfers/ReturnTransferRequest.cs (100%) rename Adyen/{src => }/Model/Transfers/ReturnTransferResponse.cs (100%) rename Adyen/{src => }/Model/Transfers/RoutingDetails.cs (100%) rename Adyen/{src => }/Model/Transfers/SELocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/SGLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/ServiceError.cs (100%) rename Adyen/{src => }/Model/Transfers/ThresholdRepayment.cs (100%) rename Adyen/{src => }/Model/Transfers/Transaction.cs (100%) rename Adyen/{src => }/Model/Transfers/TransactionEventViolation.cs (100%) rename Adyen/{src => }/Model/Transfers/TransactionRuleReference.cs (100%) rename Adyen/{src => }/Model/Transfers/TransactionRuleSource.cs (100%) rename Adyen/{src => }/Model/Transfers/TransactionRulesResult.cs (100%) rename Adyen/{src => }/Model/Transfers/TransactionSearchResponse.cs (100%) rename Adyen/{src => }/Model/Transfers/Transfer.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferCategoryData.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferData.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferDataTracking.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferEvent.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferEventEventsDataInner.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferEventTrackingData.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferInfo.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferNotificationCounterParty.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferNotificationMerchantData.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferNotificationValidationFact.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferRequestReview.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferReview.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferServiceRestServiceError.cs (100%) rename Adyen/{src => }/Model/Transfers/TransferView.cs (100%) rename Adyen/{src => }/Model/Transfers/UKLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/USLocalAccountIdentification.cs (100%) rename Adyen/{src => }/Model/Transfers/UltimatePartyIdentification.cs (100%) rename Adyen/{src => }/Security/AesEncryptor.cs (100%) rename Adyen/{src => }/Security/EncryptionCredentialDetails.cs (100%) rename Adyen/{src => }/Security/EncryptionDerivedKey.cs (100%) rename Adyen/{src => }/Security/EncryptionDerivedKeyGenerator.cs (100%) rename Adyen/{src => }/Security/Exceptions/NexoCryptoException.cs (100%) rename Adyen/{src => }/Security/Extension/ArrayExtension.cs (100%) rename Adyen/{src => }/Security/HmacSha256Wrapper.cs (100%) rename Adyen/{src => }/Security/IvModGenerator.cs (100%) rename Adyen/{src => }/Security/SaleToPoiMessageSecured.cs (100%) rename Adyen/{src => }/Security/SaleToPoiMessageSecuredEncryptor.cs (100%) rename Adyen/{src => }/Security/SecurityTrailer.cs (100%) rename Adyen/{src => }/Security/TerminalCommonNameValidator.cs (100%) rename Adyen/{src => }/Service/AbstractService.cs (100%) rename Adyen/{src => }/Service/ApiException.cs (100%) rename Adyen/{src => }/Service/BalanceControlService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/AccountHoldersService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/BalanceAccountsService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/BankAccountValidationService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/CardOrdersService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/GrantAccountsService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/GrantOffersService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/ManageCardPINService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/ManageSCADevicesService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/NetworkTokensService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/PaymentInstrumentGroupsService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/PaymentInstrumentsService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/PlatformService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/TransactionRulesService.cs (100%) rename Adyen/{src => }/Service/BalancePlatform/TransferRoutesService.cs (100%) rename Adyen/{src => }/Service/BinLookupService.cs (100%) rename Adyen/{src => }/Service/Checkout/DonationsService.cs (100%) rename Adyen/{src => }/Service/Checkout/ModificationsService.cs (100%) rename Adyen/{src => }/Service/Checkout/OrdersService.cs (100%) rename Adyen/{src => }/Service/Checkout/PaymentLinksService.cs (100%) rename Adyen/{src => }/Service/Checkout/PaymentsService.cs (100%) rename Adyen/{src => }/Service/Checkout/RecurringService.cs (100%) rename Adyen/{src => }/Service/Checkout/UtilityService.cs (100%) rename Adyen/{src => }/Service/DataProtectionService.cs (100%) rename Adyen/{src => }/Service/DisputesService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/BusinessLinesService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/DocumentsService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/HostedOnboardingService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/LegalEntitiesService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/PCIQuestionnairesService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/TermsOfServiceService.cs (100%) rename Adyen/{src => }/Service/LegalEntityManagement/TransferInstrumentsService.cs (100%) rename Adyen/{src => }/Service/Management/APICredentialsCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/APICredentialsMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/APIKeyCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/APIKeyMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/AccountCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/AccountMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/AccountStoreLevelService.cs (100%) rename Adyen/{src => }/Service/Management/AllowedOriginsCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/AllowedOriginsMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/AndroidFilesCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/ClientKeyCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/ClientKeyMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/MyAPICredentialService.cs (100%) rename Adyen/{src => }/Service/Management/PaymentMethodsMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/PayoutSettingsMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/SplitConfigurationMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalActionsCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalActionsTerminalLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalOrdersCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalOrdersMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalSettingsCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalSettingsMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalSettingsStoreLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalSettingsTerminalLevelService.cs (100%) rename Adyen/{src => }/Service/Management/TerminalsTerminalLevelService.cs (100%) rename Adyen/{src => }/Service/Management/UsersCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/UsersMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/Management/WebhooksCompanyLevelService.cs (100%) rename Adyen/{src => }/Service/Management/WebhooksMerchantLevelService.cs (100%) rename Adyen/{src => }/Service/PaymentService.cs (100%) rename Adyen/{src => }/Service/PaymentsAppService.cs (100%) rename Adyen/{src => }/Service/Payout/InitializationService.cs (100%) rename Adyen/{src => }/Service/Payout/InstantPayoutsService.cs (100%) rename Adyen/{src => }/Service/Payout/ReviewingService.cs (100%) rename Adyen/{src => }/Service/PlatformsAccount/AccountHoldersService.cs (100%) rename Adyen/{src => }/Service/PlatformsAccount/AccountsService.cs (100%) rename Adyen/{src => }/Service/PlatformsAccount/VerificationService.cs (100%) rename Adyen/{src => }/Service/PlatformsFundService.cs (100%) rename Adyen/{src => }/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs (100%) rename Adyen/{src => }/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs (100%) rename Adyen/{src => }/Service/PlatformsNotificationConfigurationService.cs (100%) rename Adyen/{src => }/Service/PosMobileService.cs (100%) rename Adyen/{src => }/Service/PosTerminalManagementService.cs (100%) rename Adyen/{src => }/Service/RecurringService.cs (100%) rename Adyen/{src => }/Service/Resource/Terminal/TerminalApi.cs (100%) rename Adyen/{src => }/Service/Resource/Terminal/TerminalApiAsyncClient.cs (100%) rename Adyen/{src => }/Service/Resource/Terminal/TerminalApiLocal.cs (100%) rename Adyen/{src => }/Service/Resource/Terminal/TerminalApiLocalClient.cs (100%) rename Adyen/{src => }/Service/Resource/Terminal/TerminalApiSyncClient.cs (100%) rename Adyen/{src => }/Service/ServiceResource.cs (100%) rename Adyen/{src => }/Service/StoredValueService.cs (100%) rename Adyen/{src => }/Service/TerminalApiAsyncService.cs (100%) rename Adyen/{src => }/Service/TerminalApiLocalService.cs (100%) rename Adyen/{src => }/Service/TerminalApiSyncService.cs (100%) rename Adyen/{src => }/Service/TerminalCloudApi.cs (100%) rename Adyen/{src => }/Service/TerminalLocalApi.cs (100%) rename Adyen/{src => }/Service/TerminalLocalApiUnencrypted.cs (100%) rename Adyen/{src => }/Service/Transfers/CapitalService.cs (100%) rename Adyen/{src => }/Service/Transfers/TransactionsService.cs (100%) rename Adyen/{src => }/Service/Transfers/TransfersService.cs (100%) rename Adyen/{src => }/Util/ByteArrayConverter.cs (100%) rename Adyen/{src => }/Util/HMACValidator.cs (100%) rename Adyen/{src => }/Util/JsonOperation.cs (100%) rename Adyen/{src => }/Util/TerminalApi/AdditionalResponse.cs (100%) rename Adyen/{src => }/Util/TerminalApi/CardAcquisitionUtil.cs (100%) rename Adyen/{src => }/Util/Util.cs (100%) rename Adyen/{src => }/Webhooks/BalancePlatformWebhookHandler.cs (100%) rename Adyen/{src => }/Webhooks/ClassicPlatformWebhookHandler.cs (100%) rename Adyen/{src => }/Webhooks/ManagementWebhookHandler.cs (100%) rename Adyen/{src => }/Webhooks/WebhookHandler.cs (100%) diff --git a/Adyen/src/ApiSerialization/Converter/JsonBase64Converter.cs b/Adyen/ApiSerialization/Converter/JsonBase64Converter.cs similarity index 100% rename from Adyen/src/ApiSerialization/Converter/JsonBase64Converter.cs rename to Adyen/ApiSerialization/Converter/JsonBase64Converter.cs diff --git a/Adyen/src/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs b/Adyen/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs similarity index 100% rename from Adyen/src/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs rename to Adyen/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs diff --git a/Adyen/src/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs b/Adyen/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs similarity index 100% rename from Adyen/src/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs rename to Adyen/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs diff --git a/Adyen/src/ApiSerialization/Converter/SaleToPoiMessageConverter.cs b/Adyen/ApiSerialization/Converter/SaleToPoiMessageConverter.cs similarity index 100% rename from Adyen/src/ApiSerialization/Converter/SaleToPoiMessageConverter.cs rename to Adyen/ApiSerialization/Converter/SaleToPoiMessageConverter.cs diff --git a/Adyen/src/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs b/Adyen/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs similarity index 100% rename from Adyen/src/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs rename to Adyen/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs diff --git a/Adyen/src/ApiSerialization/IMessagePayload.cs b/Adyen/ApiSerialization/IMessagePayload.cs similarity index 100% rename from Adyen/src/ApiSerialization/IMessagePayload.cs rename to Adyen/ApiSerialization/IMessagePayload.cs diff --git a/Adyen/src/ApiSerialization/IMessagePayloadSerializer.cs b/Adyen/ApiSerialization/IMessagePayloadSerializer.cs similarity index 100% rename from Adyen/src/ApiSerialization/IMessagePayloadSerializer.cs rename to Adyen/ApiSerialization/IMessagePayloadSerializer.cs diff --git a/Adyen/src/ApiSerialization/MessageHeaderSerializer.cs b/Adyen/ApiSerialization/MessageHeaderSerializer.cs similarity index 100% rename from Adyen/src/ApiSerialization/MessageHeaderSerializer.cs rename to Adyen/ApiSerialization/MessageHeaderSerializer.cs diff --git a/Adyen/src/ApiSerialization/MessagePayloadSerializer.cs b/Adyen/ApiSerialization/MessagePayloadSerializer.cs similarity index 100% rename from Adyen/src/ApiSerialization/MessagePayloadSerializer.cs rename to Adyen/ApiSerialization/MessagePayloadSerializer.cs diff --git a/Adyen/src/ApiSerialization/MessagePayloadSerializerFactory.cs b/Adyen/ApiSerialization/MessagePayloadSerializerFactory.cs similarity index 100% rename from Adyen/src/ApiSerialization/MessagePayloadSerializerFactory.cs rename to Adyen/ApiSerialization/MessagePayloadSerializerFactory.cs diff --git a/Adyen/src/ApiSerialization/OpenAPIDateConverter.cs b/Adyen/ApiSerialization/OpenAPIDateConverter.cs similarity index 100% rename from Adyen/src/ApiSerialization/OpenAPIDateConverter.cs rename to Adyen/ApiSerialization/OpenAPIDateConverter.cs diff --git a/Adyen/src/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs b/Adyen/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs similarity index 100% rename from Adyen/src/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs rename to Adyen/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs diff --git a/Adyen/src/ApiSerialization/SaleToPoiMessageSerializer.cs b/Adyen/ApiSerialization/SaleToPoiMessageSerializer.cs similarity index 100% rename from Adyen/src/ApiSerialization/SaleToPoiMessageSerializer.cs rename to Adyen/ApiSerialization/SaleToPoiMessageSerializer.cs diff --git a/Adyen/src/ApiSerialization/TypeHelper.cs b/Adyen/ApiSerialization/TypeHelper.cs similarity index 100% rename from Adyen/src/ApiSerialization/TypeHelper.cs rename to Adyen/ApiSerialization/TypeHelper.cs diff --git a/Adyen/src/Constants/ApiConstants.cs b/Adyen/Constants/ApiConstants.cs similarity index 100% rename from Adyen/src/Constants/ApiConstants.cs rename to Adyen/Constants/ApiConstants.cs diff --git a/Adyen/src/Constants/ClientConfig.cs b/Adyen/Constants/ClientConfig.cs similarity index 100% rename from Adyen/src/Constants/ClientConfig.cs rename to Adyen/Constants/ClientConfig.cs diff --git a/Adyen/src/Constants/Region.cs b/Adyen/Constants/Region.cs similarity index 100% rename from Adyen/src/Constants/Region.cs rename to Adyen/Constants/Region.cs diff --git a/Adyen/src/Exceptions/DeserializationException.cs b/Adyen/Exceptions/DeserializationException.cs similarity index 100% rename from Adyen/src/Exceptions/DeserializationException.cs rename to Adyen/Exceptions/DeserializationException.cs diff --git a/Adyen/src/Exceptions/ExceptionMessages.cs b/Adyen/Exceptions/ExceptionMessages.cs similarity index 100% rename from Adyen/src/Exceptions/ExceptionMessages.cs rename to Adyen/Exceptions/ExceptionMessages.cs diff --git a/Adyen/src/HttpClient/HttpClientException.cs b/Adyen/HttpClient/HttpClientException.cs similarity index 100% rename from Adyen/src/HttpClient/HttpClientException.cs rename to Adyen/HttpClient/HttpClientException.cs diff --git a/Adyen/src/HttpClient/HttpClientExtension.cs b/Adyen/HttpClient/HttpClientExtension.cs similarity index 100% rename from Adyen/src/HttpClient/HttpClientExtension.cs rename to Adyen/HttpClient/HttpClientExtension.cs diff --git a/Adyen/src/HttpClient/HttpClientWrapper.cs b/Adyen/HttpClient/HttpClientWrapper.cs similarity index 100% rename from Adyen/src/HttpClient/HttpClientWrapper.cs rename to Adyen/HttpClient/HttpClientWrapper.cs diff --git a/Adyen/src/HttpClient/Interfaces/IClient.cs b/Adyen/HttpClient/Interfaces/IClient.cs similarity index 100% rename from Adyen/src/HttpClient/Interfaces/IClient.cs rename to Adyen/HttpClient/Interfaces/IClient.cs diff --git a/Adyen/src/Model/AcsWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/AcsWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/AcsWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/AcsWebhooks/Amount.cs b/Adyen/Model/AcsWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/Amount.cs rename to Adyen/Model/AcsWebhooks/Amount.cs diff --git a/Adyen/src/Model/AcsWebhooks/AuthenticationDecision.cs b/Adyen/Model/AcsWebhooks/AuthenticationDecision.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/AuthenticationDecision.cs rename to Adyen/Model/AcsWebhooks/AuthenticationDecision.cs diff --git a/Adyen/src/Model/AcsWebhooks/AuthenticationInfo.cs b/Adyen/Model/AcsWebhooks/AuthenticationInfo.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/AuthenticationInfo.cs rename to Adyen/Model/AcsWebhooks/AuthenticationInfo.cs diff --git a/Adyen/src/Model/AcsWebhooks/AuthenticationNotificationData.cs b/Adyen/Model/AcsWebhooks/AuthenticationNotificationData.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/AuthenticationNotificationData.cs rename to Adyen/Model/AcsWebhooks/AuthenticationNotificationData.cs diff --git a/Adyen/src/Model/AcsWebhooks/AuthenticationNotificationRequest.cs b/Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/AuthenticationNotificationRequest.cs rename to Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.cs diff --git a/Adyen/src/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/Model/AcsWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/src/Model/AcsWebhooks/ChallengeInfo.cs b/Adyen/Model/AcsWebhooks/ChallengeInfo.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/ChallengeInfo.cs rename to Adyen/Model/AcsWebhooks/ChallengeInfo.cs diff --git a/Adyen/src/Model/AcsWebhooks/Purchase.cs b/Adyen/Model/AcsWebhooks/Purchase.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/Purchase.cs rename to Adyen/Model/AcsWebhooks/Purchase.cs diff --git a/Adyen/src/Model/AcsWebhooks/PurchaseInfo.cs b/Adyen/Model/AcsWebhooks/PurchaseInfo.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/PurchaseInfo.cs rename to Adyen/Model/AcsWebhooks/PurchaseInfo.cs diff --git a/Adyen/src/Model/AcsWebhooks/RelayedAuthenticationRequest.cs b/Adyen/Model/AcsWebhooks/RelayedAuthenticationRequest.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/RelayedAuthenticationRequest.cs rename to Adyen/Model/AcsWebhooks/RelayedAuthenticationRequest.cs diff --git a/Adyen/src/Model/AcsWebhooks/RelayedAuthenticationResponse.cs b/Adyen/Model/AcsWebhooks/RelayedAuthenticationResponse.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/RelayedAuthenticationResponse.cs rename to Adyen/Model/AcsWebhooks/RelayedAuthenticationResponse.cs diff --git a/Adyen/src/Model/AcsWebhooks/Resource.cs b/Adyen/Model/AcsWebhooks/Resource.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/Resource.cs rename to Adyen/Model/AcsWebhooks/Resource.cs diff --git a/Adyen/src/Model/AcsWebhooks/ServiceError.cs b/Adyen/Model/AcsWebhooks/ServiceError.cs similarity index 100% rename from Adyen/src/Model/AcsWebhooks/ServiceError.cs rename to Adyen/Model/AcsWebhooks/ServiceError.cs diff --git a/Adyen/src/Model/ApiError.cs b/Adyen/Model/ApiError.cs similarity index 100% rename from Adyen/src/Model/ApiError.cs rename to Adyen/Model/ApiError.cs diff --git a/Adyen/src/Model/ApplicationInformation/ApplicationInfo.cs b/Adyen/Model/ApplicationInformation/ApplicationInfo.cs similarity index 100% rename from Adyen/src/Model/ApplicationInformation/ApplicationInfo.cs rename to Adyen/Model/ApplicationInformation/ApplicationInfo.cs diff --git a/Adyen/src/Model/ApplicationInformation/CommonField.cs b/Adyen/Model/ApplicationInformation/CommonField.cs similarity index 100% rename from Adyen/src/Model/ApplicationInformation/CommonField.cs rename to Adyen/Model/ApplicationInformation/CommonField.cs diff --git a/Adyen/src/Model/ApplicationInformation/ExternalPlatform.cs b/Adyen/Model/ApplicationInformation/ExternalPlatform.cs similarity index 100% rename from Adyen/src/Model/ApplicationInformation/ExternalPlatform.cs rename to Adyen/Model/ApplicationInformation/ExternalPlatform.cs diff --git a/Adyen/src/Model/ApplicationInformation/MerchantDevice.cs b/Adyen/Model/ApplicationInformation/MerchantDevice.cs similarity index 100% rename from Adyen/src/Model/ApplicationInformation/MerchantDevice.cs rename to Adyen/Model/ApplicationInformation/MerchantDevice.cs diff --git a/Adyen/src/Model/ApplicationInformation/ShopperInteractionDevice.cs b/Adyen/Model/ApplicationInformation/ShopperInteractionDevice.cs similarity index 100% rename from Adyen/src/Model/ApplicationInformation/ShopperInteractionDevice.cs rename to Adyen/Model/ApplicationInformation/ShopperInteractionDevice.cs diff --git a/Adyen/src/Model/BalanceControl/AbstractOpenAPISchema.cs b/Adyen/Model/BalanceControl/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/BalanceControl/AbstractOpenAPISchema.cs rename to Adyen/Model/BalanceControl/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/BalanceControl/Amount.cs b/Adyen/Model/BalanceControl/Amount.cs similarity index 100% rename from Adyen/src/Model/BalanceControl/Amount.cs rename to Adyen/Model/BalanceControl/Amount.cs diff --git a/Adyen/src/Model/BalanceControl/BalanceTransferRequest.cs b/Adyen/Model/BalanceControl/BalanceTransferRequest.cs similarity index 100% rename from Adyen/src/Model/BalanceControl/BalanceTransferRequest.cs rename to Adyen/Model/BalanceControl/BalanceTransferRequest.cs diff --git a/Adyen/src/Model/BalanceControl/BalanceTransferResponse.cs b/Adyen/Model/BalanceControl/BalanceTransferResponse.cs similarity index 100% rename from Adyen/src/Model/BalanceControl/BalanceTransferResponse.cs rename to Adyen/Model/BalanceControl/BalanceTransferResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/AULocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AULocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/AULocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/AbstractOpenAPISchema.cs b/Adyen/Model/BalancePlatform/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AbstractOpenAPISchema.cs rename to Adyen/Model/BalancePlatform/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/BalancePlatform/AccountHolder.cs b/Adyen/Model/BalancePlatform/AccountHolder.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AccountHolder.cs rename to Adyen/Model/BalancePlatform/AccountHolder.cs diff --git a/Adyen/src/Model/BalancePlatform/AccountHolderCapability.cs b/Adyen/Model/BalancePlatform/AccountHolderCapability.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AccountHolderCapability.cs rename to Adyen/Model/BalancePlatform/AccountHolderCapability.cs diff --git a/Adyen/src/Model/BalancePlatform/AccountHolderInfo.cs b/Adyen/Model/BalancePlatform/AccountHolderInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AccountHolderInfo.cs rename to Adyen/Model/BalancePlatform/AccountHolderInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/AccountHolderUpdateRequest.cs b/Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AccountHolderUpdateRequest.cs rename to Adyen/Model/BalancePlatform/AccountHolderUpdateRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/AccountSupportingEntityCapability.cs b/Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AccountSupportingEntityCapability.cs rename to Adyen/Model/BalancePlatform/AccountSupportingEntityCapability.cs diff --git a/Adyen/src/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs b/Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs rename to Adyen/Model/BalancePlatform/ActiveNetworkTokensRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/AdditionalBankIdentification.cs b/Adyen/Model/BalancePlatform/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AdditionalBankIdentification.cs rename to Adyen/Model/BalancePlatform/AdditionalBankIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/Address.cs b/Adyen/Model/BalancePlatform/Address.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Address.cs rename to Adyen/Model/BalancePlatform/Address.cs diff --git a/Adyen/src/Model/BalancePlatform/AddressRequirement.cs b/Adyen/Model/BalancePlatform/AddressRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AddressRequirement.cs rename to Adyen/Model/BalancePlatform/AddressRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/Amount.cs b/Adyen/Model/BalancePlatform/Amount.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Amount.cs rename to Adyen/Model/BalancePlatform/Amount.cs diff --git a/Adyen/src/Model/BalancePlatform/AmountMinMaxRequirement.cs b/Adyen/Model/BalancePlatform/AmountMinMaxRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AmountMinMaxRequirement.cs rename to Adyen/Model/BalancePlatform/AmountMinMaxRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs b/Adyen/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs rename to Adyen/Model/BalancePlatform/AmountNonZeroDecimalsRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs b/Adyen/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs rename to Adyen/Model/BalancePlatform/AssociationDelegatedAuthenticationData.cs diff --git a/Adyen/src/Model/BalancePlatform/AssociationFinaliseRequest.cs b/Adyen/Model/BalancePlatform/AssociationFinaliseRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AssociationFinaliseRequest.cs rename to Adyen/Model/BalancePlatform/AssociationFinaliseRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/AssociationFinaliseResponse.cs b/Adyen/Model/BalancePlatform/AssociationFinaliseResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AssociationFinaliseResponse.cs rename to Adyen/Model/BalancePlatform/AssociationFinaliseResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/AssociationInitiateRequest.cs b/Adyen/Model/BalancePlatform/AssociationInitiateRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AssociationInitiateRequest.cs rename to Adyen/Model/BalancePlatform/AssociationInitiateRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/AssociationInitiateResponse.cs b/Adyen/Model/BalancePlatform/AssociationInitiateResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/AssociationInitiateResponse.cs rename to Adyen/Model/BalancePlatform/AssociationInitiateResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/Authentication.cs b/Adyen/Model/BalancePlatform/Authentication.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Authentication.cs rename to Adyen/Model/BalancePlatform/Authentication.cs diff --git a/Adyen/src/Model/BalancePlatform/BRLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/BRLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BRLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/BRLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/Balance.cs b/Adyen/Model/BalancePlatform/Balance.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Balance.cs rename to Adyen/Model/BalancePlatform/Balance.cs diff --git a/Adyen/src/Model/BalancePlatform/BalanceAccount.cs b/Adyen/Model/BalancePlatform/BalanceAccount.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BalanceAccount.cs rename to Adyen/Model/BalancePlatform/BalanceAccount.cs diff --git a/Adyen/src/Model/BalancePlatform/BalanceAccountBase.cs b/Adyen/Model/BalancePlatform/BalanceAccountBase.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BalanceAccountBase.cs rename to Adyen/Model/BalancePlatform/BalanceAccountBase.cs diff --git a/Adyen/src/Model/BalancePlatform/BalanceAccountInfo.cs b/Adyen/Model/BalancePlatform/BalanceAccountInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BalanceAccountInfo.cs rename to Adyen/Model/BalancePlatform/BalanceAccountInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/BalanceAccountUpdateRequest.cs b/Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BalanceAccountUpdateRequest.cs rename to Adyen/Model/BalancePlatform/BalanceAccountUpdateRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/BalancePlatform.cs b/Adyen/Model/BalancePlatform/BalancePlatform.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BalancePlatform.cs rename to Adyen/Model/BalancePlatform/BalancePlatform.cs diff --git a/Adyen/src/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs b/Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs rename to Adyen/Model/BalancePlatform/BalanceSweepConfigurationsResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccount.cs b/Adyen/Model/BalancePlatform/BankAccount.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccount.cs rename to Adyen/Model/BalancePlatform/BankAccount.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccountAccountIdentification.cs b/Adyen/Model/BalancePlatform/BankAccountAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccountAccountIdentification.cs rename to Adyen/Model/BalancePlatform/BankAccountAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccountDetails.cs b/Adyen/Model/BalancePlatform/BankAccountDetails.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccountDetails.cs rename to Adyen/Model/BalancePlatform/BankAccountDetails.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs b/Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs rename to Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs b/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs rename to Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs b/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs rename to Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/BankAccountModel.cs b/Adyen/Model/BalancePlatform/BankAccountModel.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankAccountModel.cs rename to Adyen/Model/BalancePlatform/BankAccountModel.cs diff --git a/Adyen/src/Model/BalancePlatform/BankIdentification.cs b/Adyen/Model/BalancePlatform/BankIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BankIdentification.cs rename to Adyen/Model/BalancePlatform/BankIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/BrandVariantsRestriction.cs b/Adyen/Model/BalancePlatform/BrandVariantsRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BrandVariantsRestriction.cs rename to Adyen/Model/BalancePlatform/BrandVariantsRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/BulkAddress.cs b/Adyen/Model/BalancePlatform/BulkAddress.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/BulkAddress.cs rename to Adyen/Model/BalancePlatform/BulkAddress.cs diff --git a/Adyen/src/Model/BalancePlatform/CALocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CALocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/CALocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/CZLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CZLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/CZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/CapabilityProblem.cs b/Adyen/Model/BalancePlatform/CapabilityProblem.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CapabilityProblem.cs rename to Adyen/Model/BalancePlatform/CapabilityProblem.cs diff --git a/Adyen/src/Model/BalancePlatform/CapabilityProblemEntity.cs b/Adyen/Model/BalancePlatform/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CapabilityProblemEntity.cs rename to Adyen/Model/BalancePlatform/CapabilityProblemEntity.cs diff --git a/Adyen/src/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs b/Adyen/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs rename to Adyen/Model/BalancePlatform/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/src/Model/BalancePlatform/CapabilitySettings.cs b/Adyen/Model/BalancePlatform/CapabilitySettings.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CapabilitySettings.cs rename to Adyen/Model/BalancePlatform/CapabilitySettings.cs diff --git a/Adyen/src/Model/BalancePlatform/CapitalBalance.cs b/Adyen/Model/BalancePlatform/CapitalBalance.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CapitalBalance.cs rename to Adyen/Model/BalancePlatform/CapitalBalance.cs diff --git a/Adyen/src/Model/BalancePlatform/CapitalGrantAccount.cs b/Adyen/Model/BalancePlatform/CapitalGrantAccount.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CapitalGrantAccount.cs rename to Adyen/Model/BalancePlatform/CapitalGrantAccount.cs diff --git a/Adyen/src/Model/BalancePlatform/Card.cs b/Adyen/Model/BalancePlatform/Card.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Card.cs rename to Adyen/Model/BalancePlatform/Card.cs diff --git a/Adyen/src/Model/BalancePlatform/CardConfiguration.cs b/Adyen/Model/BalancePlatform/CardConfiguration.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CardConfiguration.cs rename to Adyen/Model/BalancePlatform/CardConfiguration.cs diff --git a/Adyen/src/Model/BalancePlatform/CardInfo.cs b/Adyen/Model/BalancePlatform/CardInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CardInfo.cs rename to Adyen/Model/BalancePlatform/CardInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/CardOrder.cs b/Adyen/Model/BalancePlatform/CardOrder.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CardOrder.cs rename to Adyen/Model/BalancePlatform/CardOrder.cs diff --git a/Adyen/src/Model/BalancePlatform/CardOrderItem.cs b/Adyen/Model/BalancePlatform/CardOrderItem.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CardOrderItem.cs rename to Adyen/Model/BalancePlatform/CardOrderItem.cs diff --git a/Adyen/src/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs b/Adyen/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs rename to Adyen/Model/BalancePlatform/CardOrderItemDeliveryStatus.cs diff --git a/Adyen/src/Model/BalancePlatform/ContactDetails.cs b/Adyen/Model/BalancePlatform/ContactDetails.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/ContactDetails.cs rename to Adyen/Model/BalancePlatform/ContactDetails.cs diff --git a/Adyen/src/Model/BalancePlatform/Counterparty.cs b/Adyen/Model/BalancePlatform/Counterparty.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Counterparty.cs rename to Adyen/Model/BalancePlatform/Counterparty.cs diff --git a/Adyen/src/Model/BalancePlatform/CounterpartyBankRestriction.cs b/Adyen/Model/BalancePlatform/CounterpartyBankRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CounterpartyBankRestriction.cs rename to Adyen/Model/BalancePlatform/CounterpartyBankRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/CounterpartyTypesRestriction.cs b/Adyen/Model/BalancePlatform/CounterpartyTypesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CounterpartyTypesRestriction.cs rename to Adyen/Model/BalancePlatform/CounterpartyTypesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/CountriesRestriction.cs b/Adyen/Model/BalancePlatform/CountriesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CountriesRestriction.cs rename to Adyen/Model/BalancePlatform/CountriesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/CreateSweepConfigurationV2.cs b/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/CreateSweepConfigurationV2.cs rename to Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.cs diff --git a/Adyen/src/Model/BalancePlatform/DKLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DKLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/DKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/DayOfWeekRestriction.cs b/Adyen/Model/BalancePlatform/DayOfWeekRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DayOfWeekRestriction.cs rename to Adyen/Model/BalancePlatform/DayOfWeekRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/DelegatedAuthenticationData.cs b/Adyen/Model/BalancePlatform/DelegatedAuthenticationData.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DelegatedAuthenticationData.cs rename to Adyen/Model/BalancePlatform/DelegatedAuthenticationData.cs diff --git a/Adyen/src/Model/BalancePlatform/DeliveryAddress.cs b/Adyen/Model/BalancePlatform/DeliveryAddress.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DeliveryAddress.cs rename to Adyen/Model/BalancePlatform/DeliveryAddress.cs diff --git a/Adyen/src/Model/BalancePlatform/DeliveryContact.cs b/Adyen/Model/BalancePlatform/DeliveryContact.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DeliveryContact.cs rename to Adyen/Model/BalancePlatform/DeliveryContact.cs diff --git a/Adyen/src/Model/BalancePlatform/Device.cs b/Adyen/Model/BalancePlatform/Device.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Device.cs rename to Adyen/Model/BalancePlatform/Device.cs diff --git a/Adyen/src/Model/BalancePlatform/DeviceInfo.cs b/Adyen/Model/BalancePlatform/DeviceInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DeviceInfo.cs rename to Adyen/Model/BalancePlatform/DeviceInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/DifferentCurrenciesRestriction.cs b/Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/DifferentCurrenciesRestriction.cs rename to Adyen/Model/BalancePlatform/DifferentCurrenciesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/Duration.cs b/Adyen/Model/BalancePlatform/Duration.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Duration.cs rename to Adyen/Model/BalancePlatform/Duration.cs diff --git a/Adyen/src/Model/BalancePlatform/EntryModesRestriction.cs b/Adyen/Model/BalancePlatform/EntryModesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/EntryModesRestriction.cs rename to Adyen/Model/BalancePlatform/EntryModesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/Expiry.cs b/Adyen/Model/BalancePlatform/Expiry.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Expiry.cs rename to Adyen/Model/BalancePlatform/Expiry.cs diff --git a/Adyen/src/Model/BalancePlatform/Fee.cs b/Adyen/Model/BalancePlatform/Fee.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Fee.cs rename to Adyen/Model/BalancePlatform/Fee.cs diff --git a/Adyen/src/Model/BalancePlatform/GetNetworkTokenResponse.cs b/Adyen/Model/BalancePlatform/GetNetworkTokenResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/GetNetworkTokenResponse.cs rename to Adyen/Model/BalancePlatform/GetNetworkTokenResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/GetTaxFormResponse.cs b/Adyen/Model/BalancePlatform/GetTaxFormResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/GetTaxFormResponse.cs rename to Adyen/Model/BalancePlatform/GetTaxFormResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/GrantLimit.cs b/Adyen/Model/BalancePlatform/GrantLimit.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/GrantLimit.cs rename to Adyen/Model/BalancePlatform/GrantLimit.cs diff --git a/Adyen/src/Model/BalancePlatform/GrantOffer.cs b/Adyen/Model/BalancePlatform/GrantOffer.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/GrantOffer.cs rename to Adyen/Model/BalancePlatform/GrantOffer.cs diff --git a/Adyen/src/Model/BalancePlatform/GrantOffers.cs b/Adyen/Model/BalancePlatform/GrantOffers.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/GrantOffers.cs rename to Adyen/Model/BalancePlatform/GrantOffers.cs diff --git a/Adyen/src/Model/BalancePlatform/HKLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/HKLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/HKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/HULocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/HULocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/HULocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/Href.cs b/Adyen/Model/BalancePlatform/Href.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Href.cs rename to Adyen/Model/BalancePlatform/Href.cs diff --git a/Adyen/src/Model/BalancePlatform/IbanAccountIdentification.cs b/Adyen/Model/BalancePlatform/IbanAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/IbanAccountIdentification.cs rename to Adyen/Model/BalancePlatform/IbanAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs b/Adyen/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs rename to Adyen/Model/BalancePlatform/IbanAccountIdentificationRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/InternationalTransactionRestriction.cs b/Adyen/Model/BalancePlatform/InternationalTransactionRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/InternationalTransactionRestriction.cs rename to Adyen/Model/BalancePlatform/InternationalTransactionRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/InvalidField.cs b/Adyen/Model/BalancePlatform/InvalidField.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/InvalidField.cs rename to Adyen/Model/BalancePlatform/InvalidField.cs diff --git a/Adyen/src/Model/BalancePlatform/Link.cs b/Adyen/Model/BalancePlatform/Link.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Link.cs rename to Adyen/Model/BalancePlatform/Link.cs diff --git a/Adyen/src/Model/BalancePlatform/ListNetworkTokensResponse.cs b/Adyen/Model/BalancePlatform/ListNetworkTokensResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/ListNetworkTokensResponse.cs rename to Adyen/Model/BalancePlatform/ListNetworkTokensResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/MatchingTransactionsRestriction.cs b/Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/MatchingTransactionsRestriction.cs rename to Adyen/Model/BalancePlatform/MatchingTransactionsRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/MatchingValuesRestriction.cs b/Adyen/Model/BalancePlatform/MatchingValuesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/MatchingValuesRestriction.cs rename to Adyen/Model/BalancePlatform/MatchingValuesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/MccsRestriction.cs b/Adyen/Model/BalancePlatform/MccsRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/MccsRestriction.cs rename to Adyen/Model/BalancePlatform/MccsRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/MerchantAcquirerPair.cs b/Adyen/Model/BalancePlatform/MerchantAcquirerPair.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/MerchantAcquirerPair.cs rename to Adyen/Model/BalancePlatform/MerchantAcquirerPair.cs diff --git a/Adyen/src/Model/BalancePlatform/MerchantNamesRestriction.cs b/Adyen/Model/BalancePlatform/MerchantNamesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/MerchantNamesRestriction.cs rename to Adyen/Model/BalancePlatform/MerchantNamesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/MerchantsRestriction.cs b/Adyen/Model/BalancePlatform/MerchantsRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/MerchantsRestriction.cs rename to Adyen/Model/BalancePlatform/MerchantsRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/NOLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/NOLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/NOLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/NZLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/NZLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/NZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/Name.cs b/Adyen/Model/BalancePlatform/Name.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Name.cs rename to Adyen/Model/BalancePlatform/Name.cs diff --git a/Adyen/src/Model/BalancePlatform/NetworkToken.cs b/Adyen/Model/BalancePlatform/NetworkToken.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/NetworkToken.cs rename to Adyen/Model/BalancePlatform/NetworkToken.cs diff --git a/Adyen/src/Model/BalancePlatform/NumberAndBicAccountIdentification.cs b/Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/NumberAndBicAccountIdentification.cs rename to Adyen/Model/BalancePlatform/NumberAndBicAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/PLLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PLLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/PLLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs b/Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs rename to Adyen/Model/BalancePlatform/PaginatedAccountHoldersResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs b/Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs rename to Adyen/Model/BalancePlatform/PaginatedBalanceAccountsResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs b/Adyen/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs rename to Adyen/Model/BalancePlatform/PaginatedGetCardOrderItemResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs b/Adyen/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs rename to Adyen/Model/BalancePlatform/PaginatedGetCardOrderResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs b/Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs rename to Adyen/Model/BalancePlatform/PaginatedPaymentInstrumentsResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrument.cs b/Adyen/Model/BalancePlatform/PaymentInstrument.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrument.cs rename to Adyen/Model/BalancePlatform/PaymentInstrument.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentGroup.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentGroup.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentGroup.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentGroup.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentGroupInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentInfo.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentInfo.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentRequirement.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentRequirement.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentRevealInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentRevealRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentRevealResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs b/Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs rename to Adyen/Model/BalancePlatform/PaymentInstrumentUpdateRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/Phone.cs b/Adyen/Model/BalancePlatform/Phone.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Phone.cs rename to Adyen/Model/BalancePlatform/Phone.cs diff --git a/Adyen/src/Model/BalancePlatform/PhoneNumber.cs b/Adyen/Model/BalancePlatform/PhoneNumber.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PhoneNumber.cs rename to Adyen/Model/BalancePlatform/PhoneNumber.cs diff --git a/Adyen/src/Model/BalancePlatform/PinChangeRequest.cs b/Adyen/Model/BalancePlatform/PinChangeRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PinChangeRequest.cs rename to Adyen/Model/BalancePlatform/PinChangeRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/PinChangeResponse.cs b/Adyen/Model/BalancePlatform/PinChangeResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PinChangeResponse.cs rename to Adyen/Model/BalancePlatform/PinChangeResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/PlatformPaymentConfiguration.cs b/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PlatformPaymentConfiguration.cs rename to Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.cs diff --git a/Adyen/src/Model/BalancePlatform/ProcessingTypesRestriction.cs b/Adyen/Model/BalancePlatform/ProcessingTypesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/ProcessingTypesRestriction.cs rename to Adyen/Model/BalancePlatform/ProcessingTypesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/PublicKeyResponse.cs b/Adyen/Model/BalancePlatform/PublicKeyResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/PublicKeyResponse.cs rename to Adyen/Model/BalancePlatform/PublicKeyResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/RegisterSCAFinalResponse.cs b/Adyen/Model/BalancePlatform/RegisterSCAFinalResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RegisterSCAFinalResponse.cs rename to Adyen/Model/BalancePlatform/RegisterSCAFinalResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/RegisterSCARequest.cs b/Adyen/Model/BalancePlatform/RegisterSCARequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RegisterSCARequest.cs rename to Adyen/Model/BalancePlatform/RegisterSCARequest.cs diff --git a/Adyen/src/Model/BalancePlatform/RegisterSCAResponse.cs b/Adyen/Model/BalancePlatform/RegisterSCAResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RegisterSCAResponse.cs rename to Adyen/Model/BalancePlatform/RegisterSCAResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/RemediatingAction.cs b/Adyen/Model/BalancePlatform/RemediatingAction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RemediatingAction.cs rename to Adyen/Model/BalancePlatform/RemediatingAction.cs diff --git a/Adyen/src/Model/BalancePlatform/Repayment.cs b/Adyen/Model/BalancePlatform/Repayment.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/Repayment.cs rename to Adyen/Model/BalancePlatform/Repayment.cs diff --git a/Adyen/src/Model/BalancePlatform/RepaymentTerm.cs b/Adyen/Model/BalancePlatform/RepaymentTerm.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RepaymentTerm.cs rename to Adyen/Model/BalancePlatform/RepaymentTerm.cs diff --git a/Adyen/src/Model/BalancePlatform/RestServiceError.cs b/Adyen/Model/BalancePlatform/RestServiceError.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RestServiceError.cs rename to Adyen/Model/BalancePlatform/RestServiceError.cs diff --git a/Adyen/src/Model/BalancePlatform/RevealPinRequest.cs b/Adyen/Model/BalancePlatform/RevealPinRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RevealPinRequest.cs rename to Adyen/Model/BalancePlatform/RevealPinRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/RevealPinResponse.cs b/Adyen/Model/BalancePlatform/RevealPinResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RevealPinResponse.cs rename to Adyen/Model/BalancePlatform/RevealPinResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/RiskScores.cs b/Adyen/Model/BalancePlatform/RiskScores.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RiskScores.cs rename to Adyen/Model/BalancePlatform/RiskScores.cs diff --git a/Adyen/src/Model/BalancePlatform/RiskScoresRestriction.cs b/Adyen/Model/BalancePlatform/RiskScoresRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/RiskScoresRestriction.cs rename to Adyen/Model/BalancePlatform/RiskScoresRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/SELocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SELocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/SELocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/SGLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SGLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/SGLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/SameAmountRestriction.cs b/Adyen/Model/BalancePlatform/SameAmountRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SameAmountRestriction.cs rename to Adyen/Model/BalancePlatform/SameAmountRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/SameCounterpartyRestriction.cs b/Adyen/Model/BalancePlatform/SameCounterpartyRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SameCounterpartyRestriction.cs rename to Adyen/Model/BalancePlatform/SameCounterpartyRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs b/Adyen/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs rename to Adyen/Model/BalancePlatform/SearchRegisteredDevicesResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/SourceAccountTypesRestriction.cs b/Adyen/Model/BalancePlatform/SourceAccountTypesRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SourceAccountTypesRestriction.cs rename to Adyen/Model/BalancePlatform/SourceAccountTypesRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/StringMatch.cs b/Adyen/Model/BalancePlatform/StringMatch.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/StringMatch.cs rename to Adyen/Model/BalancePlatform/StringMatch.cs diff --git a/Adyen/src/Model/BalancePlatform/SweepConfigurationV2.cs b/Adyen/Model/BalancePlatform/SweepConfigurationV2.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SweepConfigurationV2.cs rename to Adyen/Model/BalancePlatform/SweepConfigurationV2.cs diff --git a/Adyen/src/Model/BalancePlatform/SweepCounterparty.cs b/Adyen/Model/BalancePlatform/SweepCounterparty.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SweepCounterparty.cs rename to Adyen/Model/BalancePlatform/SweepCounterparty.cs diff --git a/Adyen/src/Model/BalancePlatform/SweepSchedule.cs b/Adyen/Model/BalancePlatform/SweepSchedule.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/SweepSchedule.cs rename to Adyen/Model/BalancePlatform/SweepSchedule.cs diff --git a/Adyen/src/Model/BalancePlatform/ThresholdRepayment.cs b/Adyen/Model/BalancePlatform/ThresholdRepayment.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/ThresholdRepayment.cs rename to Adyen/Model/BalancePlatform/ThresholdRepayment.cs diff --git a/Adyen/src/Model/BalancePlatform/TimeOfDay.cs b/Adyen/Model/BalancePlatform/TimeOfDay.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TimeOfDay.cs rename to Adyen/Model/BalancePlatform/TimeOfDay.cs diff --git a/Adyen/src/Model/BalancePlatform/TimeOfDayRestriction.cs b/Adyen/Model/BalancePlatform/TimeOfDayRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TimeOfDayRestriction.cs rename to Adyen/Model/BalancePlatform/TimeOfDayRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/TokenRequestorsRestriction.cs b/Adyen/Model/BalancePlatform/TokenRequestorsRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TokenRequestorsRestriction.cs rename to Adyen/Model/BalancePlatform/TokenRequestorsRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/TotalAmountRestriction.cs b/Adyen/Model/BalancePlatform/TotalAmountRestriction.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TotalAmountRestriction.cs rename to Adyen/Model/BalancePlatform/TotalAmountRestriction.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRule.cs b/Adyen/Model/BalancePlatform/TransactionRule.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRule.cs rename to Adyen/Model/BalancePlatform/TransactionRule.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRuleEntityKey.cs b/Adyen/Model/BalancePlatform/TransactionRuleEntityKey.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRuleEntityKey.cs rename to Adyen/Model/BalancePlatform/TransactionRuleEntityKey.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRuleInfo.cs b/Adyen/Model/BalancePlatform/TransactionRuleInfo.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRuleInfo.cs rename to Adyen/Model/BalancePlatform/TransactionRuleInfo.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRuleInterval.cs b/Adyen/Model/BalancePlatform/TransactionRuleInterval.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRuleInterval.cs rename to Adyen/Model/BalancePlatform/TransactionRuleInterval.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRuleResponse.cs b/Adyen/Model/BalancePlatform/TransactionRuleResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRuleResponse.cs rename to Adyen/Model/BalancePlatform/TransactionRuleResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRuleRestrictions.cs b/Adyen/Model/BalancePlatform/TransactionRuleRestrictions.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRuleRestrictions.cs rename to Adyen/Model/BalancePlatform/TransactionRuleRestrictions.cs diff --git a/Adyen/src/Model/BalancePlatform/TransactionRulesResponse.cs b/Adyen/Model/BalancePlatform/TransactionRulesResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransactionRulesResponse.cs rename to Adyen/Model/BalancePlatform/TransactionRulesResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/TransferRoute.cs b/Adyen/Model/BalancePlatform/TransferRoute.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransferRoute.cs rename to Adyen/Model/BalancePlatform/TransferRoute.cs diff --git a/Adyen/src/Model/BalancePlatform/TransferRouteRequest.cs b/Adyen/Model/BalancePlatform/TransferRouteRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransferRouteRequest.cs rename to Adyen/Model/BalancePlatform/TransferRouteRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/TransferRouteRequirementsInner.cs b/Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransferRouteRequirementsInner.cs rename to Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.cs diff --git a/Adyen/src/Model/BalancePlatform/TransferRouteResponse.cs b/Adyen/Model/BalancePlatform/TransferRouteResponse.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/TransferRouteResponse.cs rename to Adyen/Model/BalancePlatform/TransferRouteResponse.cs diff --git a/Adyen/src/Model/BalancePlatform/UKLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/UKLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/UKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/USInternationalAchAddressRequirement.cs b/Adyen/Model/BalancePlatform/USInternationalAchAddressRequirement.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/USInternationalAchAddressRequirement.cs rename to Adyen/Model/BalancePlatform/USInternationalAchAddressRequirement.cs diff --git a/Adyen/src/Model/BalancePlatform/USLocalAccountIdentification.cs b/Adyen/Model/BalancePlatform/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/USLocalAccountIdentification.cs rename to Adyen/Model/BalancePlatform/USLocalAccountIdentification.cs diff --git a/Adyen/src/Model/BalancePlatform/UpdateNetworkTokenRequest.cs b/Adyen/Model/BalancePlatform/UpdateNetworkTokenRequest.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/UpdateNetworkTokenRequest.cs rename to Adyen/Model/BalancePlatform/UpdateNetworkTokenRequest.cs diff --git a/Adyen/src/Model/BalancePlatform/UpdatePaymentInstrument.cs b/Adyen/Model/BalancePlatform/UpdatePaymentInstrument.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/UpdatePaymentInstrument.cs rename to Adyen/Model/BalancePlatform/UpdatePaymentInstrument.cs diff --git a/Adyen/src/Model/BalancePlatform/UpdateSweepConfigurationV2.cs b/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/UpdateSweepConfigurationV2.cs rename to Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.cs diff --git a/Adyen/src/Model/BalancePlatform/VerificationDeadline.cs b/Adyen/Model/BalancePlatform/VerificationDeadline.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/VerificationDeadline.cs rename to Adyen/Model/BalancePlatform/VerificationDeadline.cs diff --git a/Adyen/src/Model/BalancePlatform/VerificationError.cs b/Adyen/Model/BalancePlatform/VerificationError.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/VerificationError.cs rename to Adyen/Model/BalancePlatform/VerificationError.cs diff --git a/Adyen/src/Model/BalancePlatform/VerificationErrorRecursive.cs b/Adyen/Model/BalancePlatform/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/src/Model/BalancePlatform/VerificationErrorRecursive.cs rename to Adyen/Model/BalancePlatform/VerificationErrorRecursive.cs diff --git a/Adyen/src/Model/BinLookup/AbstractOpenAPISchema.cs b/Adyen/Model/BinLookup/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/BinLookup/AbstractOpenAPISchema.cs rename to Adyen/Model/BinLookup/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/BinLookup/Amount.cs b/Adyen/Model/BinLookup/Amount.cs similarity index 100% rename from Adyen/src/Model/BinLookup/Amount.cs rename to Adyen/Model/BinLookup/Amount.cs diff --git a/Adyen/src/Model/BinLookup/BinDetail.cs b/Adyen/Model/BinLookup/BinDetail.cs similarity index 100% rename from Adyen/src/Model/BinLookup/BinDetail.cs rename to Adyen/Model/BinLookup/BinDetail.cs diff --git a/Adyen/src/Model/BinLookup/CardBin.cs b/Adyen/Model/BinLookup/CardBin.cs similarity index 100% rename from Adyen/src/Model/BinLookup/CardBin.cs rename to Adyen/Model/BinLookup/CardBin.cs diff --git a/Adyen/src/Model/BinLookup/CostEstimateAssumptions.cs b/Adyen/Model/BinLookup/CostEstimateAssumptions.cs similarity index 100% rename from Adyen/src/Model/BinLookup/CostEstimateAssumptions.cs rename to Adyen/Model/BinLookup/CostEstimateAssumptions.cs diff --git a/Adyen/src/Model/BinLookup/CostEstimateRequest.cs b/Adyen/Model/BinLookup/CostEstimateRequest.cs similarity index 100% rename from Adyen/src/Model/BinLookup/CostEstimateRequest.cs rename to Adyen/Model/BinLookup/CostEstimateRequest.cs diff --git a/Adyen/src/Model/BinLookup/CostEstimateResponse.cs b/Adyen/Model/BinLookup/CostEstimateResponse.cs similarity index 100% rename from Adyen/src/Model/BinLookup/CostEstimateResponse.cs rename to Adyen/Model/BinLookup/CostEstimateResponse.cs diff --git a/Adyen/src/Model/BinLookup/DSPublicKeyDetail.cs b/Adyen/Model/BinLookup/DSPublicKeyDetail.cs similarity index 100% rename from Adyen/src/Model/BinLookup/DSPublicKeyDetail.cs rename to Adyen/Model/BinLookup/DSPublicKeyDetail.cs diff --git a/Adyen/src/Model/BinLookup/MerchantDetails.cs b/Adyen/Model/BinLookup/MerchantDetails.cs similarity index 100% rename from Adyen/src/Model/BinLookup/MerchantDetails.cs rename to Adyen/Model/BinLookup/MerchantDetails.cs diff --git a/Adyen/src/Model/BinLookup/Recurring.cs b/Adyen/Model/BinLookup/Recurring.cs similarity index 100% rename from Adyen/src/Model/BinLookup/Recurring.cs rename to Adyen/Model/BinLookup/Recurring.cs diff --git a/Adyen/src/Model/BinLookup/ServiceError.cs b/Adyen/Model/BinLookup/ServiceError.cs similarity index 100% rename from Adyen/src/Model/BinLookup/ServiceError.cs rename to Adyen/Model/BinLookup/ServiceError.cs diff --git a/Adyen/src/Model/BinLookup/ThreeDS2CardRangeDetail.cs b/Adyen/Model/BinLookup/ThreeDS2CardRangeDetail.cs similarity index 100% rename from Adyen/src/Model/BinLookup/ThreeDS2CardRangeDetail.cs rename to Adyen/Model/BinLookup/ThreeDS2CardRangeDetail.cs diff --git a/Adyen/src/Model/BinLookup/ThreeDSAvailabilityRequest.cs b/Adyen/Model/BinLookup/ThreeDSAvailabilityRequest.cs similarity index 100% rename from Adyen/src/Model/BinLookup/ThreeDSAvailabilityRequest.cs rename to Adyen/Model/BinLookup/ThreeDSAvailabilityRequest.cs diff --git a/Adyen/src/Model/BinLookup/ThreeDSAvailabilityResponse.cs b/Adyen/Model/BinLookup/ThreeDSAvailabilityResponse.cs similarity index 100% rename from Adyen/src/Model/BinLookup/ThreeDSAvailabilityResponse.cs rename to Adyen/Model/BinLookup/ThreeDSAvailabilityResponse.cs diff --git a/Adyen/src/Model/Checkout/AbstractOpenAPISchema.cs b/Adyen/Model/Checkout/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Checkout/AbstractOpenAPISchema.cs rename to Adyen/Model/Checkout/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Checkout/AccountInfo.cs b/Adyen/Model/Checkout/AccountInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/AccountInfo.cs rename to Adyen/Model/Checkout/AccountInfo.cs diff --git a/Adyen/src/Model/Checkout/AcctInfo.cs b/Adyen/Model/Checkout/AcctInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/AcctInfo.cs rename to Adyen/Model/Checkout/AcctInfo.cs diff --git a/Adyen/src/Model/Checkout/AchDetails.cs b/Adyen/Model/Checkout/AchDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/AchDetails.cs rename to Adyen/Model/Checkout/AchDetails.cs diff --git a/Adyen/src/Model/Checkout/AdditionalData3DSecure.cs b/Adyen/Model/Checkout/AdditionalData3DSecure.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalData3DSecure.cs rename to Adyen/Model/Checkout/AdditionalData3DSecure.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataAirline.cs b/Adyen/Model/Checkout/AdditionalDataAirline.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataAirline.cs rename to Adyen/Model/Checkout/AdditionalDataAirline.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataCarRental.cs b/Adyen/Model/Checkout/AdditionalDataCarRental.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataCarRental.cs rename to Adyen/Model/Checkout/AdditionalDataCarRental.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataCommon.cs b/Adyen/Model/Checkout/AdditionalDataCommon.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataCommon.cs rename to Adyen/Model/Checkout/AdditionalDataCommon.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataLevel23.cs b/Adyen/Model/Checkout/AdditionalDataLevel23.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataLevel23.cs rename to Adyen/Model/Checkout/AdditionalDataLevel23.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataLodging.cs b/Adyen/Model/Checkout/AdditionalDataLodging.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataLodging.cs rename to Adyen/Model/Checkout/AdditionalDataLodging.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataOpenInvoice.cs b/Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataOpenInvoice.cs rename to Adyen/Model/Checkout/AdditionalDataOpenInvoice.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataOpi.cs b/Adyen/Model/Checkout/AdditionalDataOpi.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataOpi.cs rename to Adyen/Model/Checkout/AdditionalDataOpi.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataRatepay.cs b/Adyen/Model/Checkout/AdditionalDataRatepay.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataRatepay.cs rename to Adyen/Model/Checkout/AdditionalDataRatepay.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataRetry.cs b/Adyen/Model/Checkout/AdditionalDataRetry.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataRetry.cs rename to Adyen/Model/Checkout/AdditionalDataRetry.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataRisk.cs b/Adyen/Model/Checkout/AdditionalDataRisk.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataRisk.cs rename to Adyen/Model/Checkout/AdditionalDataRisk.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataRiskStandalone.cs b/Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataRiskStandalone.cs rename to Adyen/Model/Checkout/AdditionalDataRiskStandalone.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataSubMerchant.cs b/Adyen/Model/Checkout/AdditionalDataSubMerchant.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataSubMerchant.cs rename to Adyen/Model/Checkout/AdditionalDataSubMerchant.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataTemporaryServices.cs b/Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataTemporaryServices.cs rename to Adyen/Model/Checkout/AdditionalDataTemporaryServices.cs diff --git a/Adyen/src/Model/Checkout/AdditionalDataWallets.cs b/Adyen/Model/Checkout/AdditionalDataWallets.cs similarity index 100% rename from Adyen/src/Model/Checkout/AdditionalDataWallets.cs rename to Adyen/Model/Checkout/AdditionalDataWallets.cs diff --git a/Adyen/src/Model/Checkout/Address.cs b/Adyen/Model/Checkout/Address.cs similarity index 100% rename from Adyen/src/Model/Checkout/Address.cs rename to Adyen/Model/Checkout/Address.cs diff --git a/Adyen/src/Model/Checkout/AffirmDetails.cs b/Adyen/Model/Checkout/AffirmDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/AffirmDetails.cs rename to Adyen/Model/Checkout/AffirmDetails.cs diff --git a/Adyen/src/Model/Checkout/AfterpayDetails.cs b/Adyen/Model/Checkout/AfterpayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/AfterpayDetails.cs rename to Adyen/Model/Checkout/AfterpayDetails.cs diff --git a/Adyen/src/Model/Checkout/Agency.cs b/Adyen/Model/Checkout/Agency.cs similarity index 100% rename from Adyen/src/Model/Checkout/Agency.cs rename to Adyen/Model/Checkout/Agency.cs diff --git a/Adyen/src/Model/Checkout/Airline.cs b/Adyen/Model/Checkout/Airline.cs similarity index 100% rename from Adyen/src/Model/Checkout/Airline.cs rename to Adyen/Model/Checkout/Airline.cs diff --git a/Adyen/src/Model/Checkout/AmazonPayDetails.cs b/Adyen/Model/Checkout/AmazonPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/AmazonPayDetails.cs rename to Adyen/Model/Checkout/AmazonPayDetails.cs diff --git a/Adyen/src/Model/Checkout/Amount.cs b/Adyen/Model/Checkout/Amount.cs similarity index 100% rename from Adyen/src/Model/Checkout/Amount.cs rename to Adyen/Model/Checkout/Amount.cs diff --git a/Adyen/src/Model/Checkout/Amounts.cs b/Adyen/Model/Checkout/Amounts.cs similarity index 100% rename from Adyen/src/Model/Checkout/Amounts.cs rename to Adyen/Model/Checkout/Amounts.cs diff --git a/Adyen/src/Model/Checkout/AncvDetails.cs b/Adyen/Model/Checkout/AncvDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/AncvDetails.cs rename to Adyen/Model/Checkout/AncvDetails.cs diff --git a/Adyen/src/Model/Checkout/AndroidPayDetails.cs b/Adyen/Model/Checkout/AndroidPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/AndroidPayDetails.cs rename to Adyen/Model/Checkout/AndroidPayDetails.cs diff --git a/Adyen/src/Model/Checkout/ApplePayDetails.cs b/Adyen/Model/Checkout/ApplePayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/ApplePayDetails.cs rename to Adyen/Model/Checkout/ApplePayDetails.cs diff --git a/Adyen/src/Model/Checkout/ApplePayDonations.cs b/Adyen/Model/Checkout/ApplePayDonations.cs similarity index 100% rename from Adyen/src/Model/Checkout/ApplePayDonations.cs rename to Adyen/Model/Checkout/ApplePayDonations.cs diff --git a/Adyen/src/Model/Checkout/ApplePaySessionRequest.cs b/Adyen/Model/Checkout/ApplePaySessionRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/ApplePaySessionRequest.cs rename to Adyen/Model/Checkout/ApplePaySessionRequest.cs diff --git a/Adyen/src/Model/Checkout/ApplePaySessionResponse.cs b/Adyen/Model/Checkout/ApplePaySessionResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/ApplePaySessionResponse.cs rename to Adyen/Model/Checkout/ApplePaySessionResponse.cs diff --git a/Adyen/src/Model/Checkout/ApplicationInfo.cs b/Adyen/Model/Checkout/ApplicationInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/ApplicationInfo.cs rename to Adyen/Model/Checkout/ApplicationInfo.cs diff --git a/Adyen/src/Model/Checkout/AuthenticationData.cs b/Adyen/Model/Checkout/AuthenticationData.cs similarity index 100% rename from Adyen/src/Model/Checkout/AuthenticationData.cs rename to Adyen/Model/Checkout/AuthenticationData.cs diff --git a/Adyen/src/Model/Checkout/BacsDirectDebitDetails.cs b/Adyen/Model/Checkout/BacsDirectDebitDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/BacsDirectDebitDetails.cs rename to Adyen/Model/Checkout/BacsDirectDebitDetails.cs diff --git a/Adyen/src/Model/Checkout/BalanceCheckRequest.cs b/Adyen/Model/Checkout/BalanceCheckRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/BalanceCheckRequest.cs rename to Adyen/Model/Checkout/BalanceCheckRequest.cs diff --git a/Adyen/src/Model/Checkout/BalanceCheckResponse.cs b/Adyen/Model/Checkout/BalanceCheckResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/BalanceCheckResponse.cs rename to Adyen/Model/Checkout/BalanceCheckResponse.cs diff --git a/Adyen/src/Model/Checkout/BillDeskDetails.cs b/Adyen/Model/Checkout/BillDeskDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/BillDeskDetails.cs rename to Adyen/Model/Checkout/BillDeskDetails.cs diff --git a/Adyen/src/Model/Checkout/BillingAddress.cs b/Adyen/Model/Checkout/BillingAddress.cs similarity index 100% rename from Adyen/src/Model/Checkout/BillingAddress.cs rename to Adyen/Model/Checkout/BillingAddress.cs diff --git a/Adyen/src/Model/Checkout/BlikDetails.cs b/Adyen/Model/Checkout/BlikDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/BlikDetails.cs rename to Adyen/Model/Checkout/BlikDetails.cs diff --git a/Adyen/src/Model/Checkout/BrowserInfo.cs b/Adyen/Model/Checkout/BrowserInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/BrowserInfo.cs rename to Adyen/Model/Checkout/BrowserInfo.cs diff --git a/Adyen/src/Model/Checkout/CancelOrderRequest.cs b/Adyen/Model/Checkout/CancelOrderRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/CancelOrderRequest.cs rename to Adyen/Model/Checkout/CancelOrderRequest.cs diff --git a/Adyen/src/Model/Checkout/CancelOrderResponse.cs b/Adyen/Model/Checkout/CancelOrderResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/CancelOrderResponse.cs rename to Adyen/Model/Checkout/CancelOrderResponse.cs diff --git a/Adyen/src/Model/Checkout/CardBrandDetails.cs b/Adyen/Model/Checkout/CardBrandDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/CardBrandDetails.cs rename to Adyen/Model/Checkout/CardBrandDetails.cs diff --git a/Adyen/src/Model/Checkout/CardDetails.cs b/Adyen/Model/Checkout/CardDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/CardDetails.cs rename to Adyen/Model/Checkout/CardDetails.cs diff --git a/Adyen/src/Model/Checkout/CardDetailsRequest.cs b/Adyen/Model/Checkout/CardDetailsRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/CardDetailsRequest.cs rename to Adyen/Model/Checkout/CardDetailsRequest.cs diff --git a/Adyen/src/Model/Checkout/CardDetailsResponse.cs b/Adyen/Model/Checkout/CardDetailsResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/CardDetailsResponse.cs rename to Adyen/Model/Checkout/CardDetailsResponse.cs diff --git a/Adyen/src/Model/Checkout/CardDonations.cs b/Adyen/Model/Checkout/CardDonations.cs similarity index 100% rename from Adyen/src/Model/Checkout/CardDonations.cs rename to Adyen/Model/Checkout/CardDonations.cs diff --git a/Adyen/src/Model/Checkout/CashAppDetails.cs b/Adyen/Model/Checkout/CashAppDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/CashAppDetails.cs rename to Adyen/Model/Checkout/CashAppDetails.cs diff --git a/Adyen/src/Model/Checkout/CellulantDetails.cs b/Adyen/Model/Checkout/CellulantDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/CellulantDetails.cs rename to Adyen/Model/Checkout/CellulantDetails.cs diff --git a/Adyen/src/Model/Checkout/CheckoutAwaitAction.cs b/Adyen/Model/Checkout/CheckoutAwaitAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutAwaitAction.cs rename to Adyen/Model/Checkout/CheckoutAwaitAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutBankAccount.cs b/Adyen/Model/Checkout/CheckoutBankAccount.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutBankAccount.cs rename to Adyen/Model/Checkout/CheckoutBankAccount.cs diff --git a/Adyen/src/Model/Checkout/CheckoutBankTransferAction.cs b/Adyen/Model/Checkout/CheckoutBankTransferAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutBankTransferAction.cs rename to Adyen/Model/Checkout/CheckoutBankTransferAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs b/Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs rename to Adyen/Model/Checkout/CheckoutDelegatedAuthenticationAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutNativeRedirectAction.cs b/Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutNativeRedirectAction.cs rename to Adyen/Model/Checkout/CheckoutNativeRedirectAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutOrderResponse.cs b/Adyen/Model/Checkout/CheckoutOrderResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutOrderResponse.cs rename to Adyen/Model/Checkout/CheckoutOrderResponse.cs diff --git a/Adyen/src/Model/Checkout/CheckoutPaymentMethod.cs b/Adyen/Model/Checkout/CheckoutPaymentMethod.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutPaymentMethod.cs rename to Adyen/Model/Checkout/CheckoutPaymentMethod.cs diff --git a/Adyen/src/Model/Checkout/CheckoutQrCodeAction.cs b/Adyen/Model/Checkout/CheckoutQrCodeAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutQrCodeAction.cs rename to Adyen/Model/Checkout/CheckoutQrCodeAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutRedirectAction.cs b/Adyen/Model/Checkout/CheckoutRedirectAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutRedirectAction.cs rename to Adyen/Model/Checkout/CheckoutRedirectAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutSDKAction.cs b/Adyen/Model/Checkout/CheckoutSDKAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutSDKAction.cs rename to Adyen/Model/Checkout/CheckoutSDKAction.cs diff --git a/Adyen/src/Model/Checkout/CheckoutSessionInstallmentOption.cs b/Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutSessionInstallmentOption.cs rename to Adyen/Model/Checkout/CheckoutSessionInstallmentOption.cs diff --git a/Adyen/src/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs b/Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs rename to Adyen/Model/Checkout/CheckoutSessionThreeDS2RequestData.cs diff --git a/Adyen/src/Model/Checkout/CheckoutThreeDS2Action.cs b/Adyen/Model/Checkout/CheckoutThreeDS2Action.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutThreeDS2Action.cs rename to Adyen/Model/Checkout/CheckoutThreeDS2Action.cs diff --git a/Adyen/src/Model/Checkout/CheckoutVoucherAction.cs b/Adyen/Model/Checkout/CheckoutVoucherAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/CheckoutVoucherAction.cs rename to Adyen/Model/Checkout/CheckoutVoucherAction.cs diff --git a/Adyen/src/Model/Checkout/CommonField.cs b/Adyen/Model/Checkout/CommonField.cs similarity index 100% rename from Adyen/src/Model/Checkout/CommonField.cs rename to Adyen/Model/Checkout/CommonField.cs diff --git a/Adyen/src/Model/Checkout/Company.cs b/Adyen/Model/Checkout/Company.cs similarity index 100% rename from Adyen/src/Model/Checkout/Company.cs rename to Adyen/Model/Checkout/Company.cs diff --git a/Adyen/src/Model/Checkout/CreateCheckoutSessionRequest.cs b/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/CreateCheckoutSessionRequest.cs rename to Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs diff --git a/Adyen/src/Model/Checkout/CreateCheckoutSessionResponse.cs b/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/CreateCheckoutSessionResponse.cs rename to Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs diff --git a/Adyen/src/Model/Checkout/CreateOrderRequest.cs b/Adyen/Model/Checkout/CreateOrderRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/CreateOrderRequest.cs rename to Adyen/Model/Checkout/CreateOrderRequest.cs diff --git a/Adyen/src/Model/Checkout/CreateOrderResponse.cs b/Adyen/Model/Checkout/CreateOrderResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/CreateOrderResponse.cs rename to Adyen/Model/Checkout/CreateOrderResponse.cs diff --git a/Adyen/src/Model/Checkout/DeliveryAddress.cs b/Adyen/Model/Checkout/DeliveryAddress.cs similarity index 100% rename from Adyen/src/Model/Checkout/DeliveryAddress.cs rename to Adyen/Model/Checkout/DeliveryAddress.cs diff --git a/Adyen/src/Model/Checkout/DeliveryMethod.cs b/Adyen/Model/Checkout/DeliveryMethod.cs similarity index 100% rename from Adyen/src/Model/Checkout/DeliveryMethod.cs rename to Adyen/Model/Checkout/DeliveryMethod.cs diff --git a/Adyen/src/Model/Checkout/DetailsRequestAuthenticationData.cs b/Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs similarity index 100% rename from Adyen/src/Model/Checkout/DetailsRequestAuthenticationData.cs rename to Adyen/Model/Checkout/DetailsRequestAuthenticationData.cs diff --git a/Adyen/src/Model/Checkout/DeviceRenderOptions.cs b/Adyen/Model/Checkout/DeviceRenderOptions.cs similarity index 100% rename from Adyen/src/Model/Checkout/DeviceRenderOptions.cs rename to Adyen/Model/Checkout/DeviceRenderOptions.cs diff --git a/Adyen/src/Model/Checkout/DokuDetails.cs b/Adyen/Model/Checkout/DokuDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/DokuDetails.cs rename to Adyen/Model/Checkout/DokuDetails.cs diff --git a/Adyen/src/Model/Checkout/Donation.cs b/Adyen/Model/Checkout/Donation.cs similarity index 100% rename from Adyen/src/Model/Checkout/Donation.cs rename to Adyen/Model/Checkout/Donation.cs diff --git a/Adyen/src/Model/Checkout/DonationCampaign.cs b/Adyen/Model/Checkout/DonationCampaign.cs similarity index 100% rename from Adyen/src/Model/Checkout/DonationCampaign.cs rename to Adyen/Model/Checkout/DonationCampaign.cs diff --git a/Adyen/src/Model/Checkout/DonationCampaignsRequest.cs b/Adyen/Model/Checkout/DonationCampaignsRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/DonationCampaignsRequest.cs rename to Adyen/Model/Checkout/DonationCampaignsRequest.cs diff --git a/Adyen/src/Model/Checkout/DonationCampaignsResponse.cs b/Adyen/Model/Checkout/DonationCampaignsResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/DonationCampaignsResponse.cs rename to Adyen/Model/Checkout/DonationCampaignsResponse.cs diff --git a/Adyen/src/Model/Checkout/DonationPaymentMethod.cs b/Adyen/Model/Checkout/DonationPaymentMethod.cs similarity index 100% rename from Adyen/src/Model/Checkout/DonationPaymentMethod.cs rename to Adyen/Model/Checkout/DonationPaymentMethod.cs diff --git a/Adyen/src/Model/Checkout/DonationPaymentRequest.cs b/Adyen/Model/Checkout/DonationPaymentRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/DonationPaymentRequest.cs rename to Adyen/Model/Checkout/DonationPaymentRequest.cs diff --git a/Adyen/src/Model/Checkout/DonationPaymentResponse.cs b/Adyen/Model/Checkout/DonationPaymentResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/DonationPaymentResponse.cs rename to Adyen/Model/Checkout/DonationPaymentResponse.cs diff --git a/Adyen/src/Model/Checkout/DragonpayDetails.cs b/Adyen/Model/Checkout/DragonpayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/DragonpayDetails.cs rename to Adyen/Model/Checkout/DragonpayDetails.cs diff --git a/Adyen/src/Model/Checkout/EBankingFinlandDetails.cs b/Adyen/Model/Checkout/EBankingFinlandDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/EBankingFinlandDetails.cs rename to Adyen/Model/Checkout/EBankingFinlandDetails.cs diff --git a/Adyen/src/Model/Checkout/EcontextVoucherDetails.cs b/Adyen/Model/Checkout/EcontextVoucherDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/EcontextVoucherDetails.cs rename to Adyen/Model/Checkout/EcontextVoucherDetails.cs diff --git a/Adyen/src/Model/Checkout/EftDetails.cs b/Adyen/Model/Checkout/EftDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/EftDetails.cs rename to Adyen/Model/Checkout/EftDetails.cs diff --git a/Adyen/src/Model/Checkout/EncryptedOrderData.cs b/Adyen/Model/Checkout/EncryptedOrderData.cs similarity index 100% rename from Adyen/src/Model/Checkout/EncryptedOrderData.cs rename to Adyen/Model/Checkout/EncryptedOrderData.cs diff --git a/Adyen/src/Model/Checkout/EnhancedSchemeData.cs b/Adyen/Model/Checkout/EnhancedSchemeData.cs similarity index 100% rename from Adyen/src/Model/Checkout/EnhancedSchemeData.cs rename to Adyen/Model/Checkout/EnhancedSchemeData.cs diff --git a/Adyen/src/Model/Checkout/ExternalPlatform.cs b/Adyen/Model/Checkout/ExternalPlatform.cs similarity index 100% rename from Adyen/src/Model/Checkout/ExternalPlatform.cs rename to Adyen/Model/Checkout/ExternalPlatform.cs diff --git a/Adyen/src/Model/Checkout/FastlaneDetails.cs b/Adyen/Model/Checkout/FastlaneDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/FastlaneDetails.cs rename to Adyen/Model/Checkout/FastlaneDetails.cs diff --git a/Adyen/src/Model/Checkout/ForexQuote.cs b/Adyen/Model/Checkout/ForexQuote.cs similarity index 100% rename from Adyen/src/Model/Checkout/ForexQuote.cs rename to Adyen/Model/Checkout/ForexQuote.cs diff --git a/Adyen/src/Model/Checkout/FraudCheckResult.cs b/Adyen/Model/Checkout/FraudCheckResult.cs similarity index 100% rename from Adyen/src/Model/Checkout/FraudCheckResult.cs rename to Adyen/Model/Checkout/FraudCheckResult.cs diff --git a/Adyen/src/Model/Checkout/FraudResult.cs b/Adyen/Model/Checkout/FraudResult.cs similarity index 100% rename from Adyen/src/Model/Checkout/FraudResult.cs rename to Adyen/Model/Checkout/FraudResult.cs diff --git a/Adyen/src/Model/Checkout/FundOrigin.cs b/Adyen/Model/Checkout/FundOrigin.cs similarity index 100% rename from Adyen/src/Model/Checkout/FundOrigin.cs rename to Adyen/Model/Checkout/FundOrigin.cs diff --git a/Adyen/src/Model/Checkout/FundRecipient.cs b/Adyen/Model/Checkout/FundRecipient.cs similarity index 100% rename from Adyen/src/Model/Checkout/FundRecipient.cs rename to Adyen/Model/Checkout/FundRecipient.cs diff --git a/Adyen/src/Model/Checkout/GenericIssuerPaymentMethodDetails.cs b/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/GenericIssuerPaymentMethodDetails.cs rename to Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs diff --git a/Adyen/src/Model/Checkout/GooglePayDetails.cs b/Adyen/Model/Checkout/GooglePayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/GooglePayDetails.cs rename to Adyen/Model/Checkout/GooglePayDetails.cs diff --git a/Adyen/src/Model/Checkout/GooglePayDonations.cs b/Adyen/Model/Checkout/GooglePayDonations.cs similarity index 100% rename from Adyen/src/Model/Checkout/GooglePayDonations.cs rename to Adyen/Model/Checkout/GooglePayDonations.cs diff --git a/Adyen/src/Model/Checkout/IdealDetails.cs b/Adyen/Model/Checkout/IdealDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/IdealDetails.cs rename to Adyen/Model/Checkout/IdealDetails.cs diff --git a/Adyen/src/Model/Checkout/IdealDonations.cs b/Adyen/Model/Checkout/IdealDonations.cs similarity index 100% rename from Adyen/src/Model/Checkout/IdealDonations.cs rename to Adyen/Model/Checkout/IdealDonations.cs diff --git a/Adyen/src/Model/Checkout/InputDetail.cs b/Adyen/Model/Checkout/InputDetail.cs similarity index 100% rename from Adyen/src/Model/Checkout/InputDetail.cs rename to Adyen/Model/Checkout/InputDetail.cs diff --git a/Adyen/src/Model/Checkout/InstallmentOption.cs b/Adyen/Model/Checkout/InstallmentOption.cs similarity index 100% rename from Adyen/src/Model/Checkout/InstallmentOption.cs rename to Adyen/Model/Checkout/InstallmentOption.cs diff --git a/Adyen/src/Model/Checkout/Installments.cs b/Adyen/Model/Checkout/Installments.cs similarity index 100% rename from Adyen/src/Model/Checkout/Installments.cs rename to Adyen/Model/Checkout/Installments.cs diff --git a/Adyen/src/Model/Checkout/Item.cs b/Adyen/Model/Checkout/Item.cs similarity index 100% rename from Adyen/src/Model/Checkout/Item.cs rename to Adyen/Model/Checkout/Item.cs diff --git a/Adyen/src/Model/Checkout/KlarnaDetails.cs b/Adyen/Model/Checkout/KlarnaDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/KlarnaDetails.cs rename to Adyen/Model/Checkout/KlarnaDetails.cs diff --git a/Adyen/src/Model/Checkout/Leg.cs b/Adyen/Model/Checkout/Leg.cs similarity index 100% rename from Adyen/src/Model/Checkout/Leg.cs rename to Adyen/Model/Checkout/Leg.cs diff --git a/Adyen/src/Model/Checkout/LineItem.cs b/Adyen/Model/Checkout/LineItem.cs similarity index 100% rename from Adyen/src/Model/Checkout/LineItem.cs rename to Adyen/Model/Checkout/LineItem.cs diff --git a/Adyen/src/Model/Checkout/ListStoredPaymentMethodsResponse.cs b/Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/ListStoredPaymentMethodsResponse.cs rename to Adyen/Model/Checkout/ListStoredPaymentMethodsResponse.cs diff --git a/Adyen/src/Model/Checkout/Mandate.cs b/Adyen/Model/Checkout/Mandate.cs similarity index 100% rename from Adyen/src/Model/Checkout/Mandate.cs rename to Adyen/Model/Checkout/Mandate.cs diff --git a/Adyen/src/Model/Checkout/MasterpassDetails.cs b/Adyen/Model/Checkout/MasterpassDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/MasterpassDetails.cs rename to Adyen/Model/Checkout/MasterpassDetails.cs diff --git a/Adyen/src/Model/Checkout/MbwayDetails.cs b/Adyen/Model/Checkout/MbwayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/MbwayDetails.cs rename to Adyen/Model/Checkout/MbwayDetails.cs diff --git a/Adyen/src/Model/Checkout/MerchantDevice.cs b/Adyen/Model/Checkout/MerchantDevice.cs similarity index 100% rename from Adyen/src/Model/Checkout/MerchantDevice.cs rename to Adyen/Model/Checkout/MerchantDevice.cs diff --git a/Adyen/src/Model/Checkout/MerchantRiskIndicator.cs b/Adyen/Model/Checkout/MerchantRiskIndicator.cs similarity index 100% rename from Adyen/src/Model/Checkout/MerchantRiskIndicator.cs rename to Adyen/Model/Checkout/MerchantRiskIndicator.cs diff --git a/Adyen/src/Model/Checkout/MobilePayDetails.cs b/Adyen/Model/Checkout/MobilePayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/MobilePayDetails.cs rename to Adyen/Model/Checkout/MobilePayDetails.cs diff --git a/Adyen/src/Model/Checkout/MolPayDetails.cs b/Adyen/Model/Checkout/MolPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/MolPayDetails.cs rename to Adyen/Model/Checkout/MolPayDetails.cs diff --git a/Adyen/src/Model/Checkout/Name.cs b/Adyen/Model/Checkout/Name.cs similarity index 100% rename from Adyen/src/Model/Checkout/Name.cs rename to Adyen/Model/Checkout/Name.cs diff --git a/Adyen/src/Model/Checkout/OpenInvoiceDetails.cs b/Adyen/Model/Checkout/OpenInvoiceDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/OpenInvoiceDetails.cs rename to Adyen/Model/Checkout/OpenInvoiceDetails.cs diff --git a/Adyen/src/Model/Checkout/Passenger.cs b/Adyen/Model/Checkout/Passenger.cs similarity index 100% rename from Adyen/src/Model/Checkout/Passenger.cs rename to Adyen/Model/Checkout/Passenger.cs diff --git a/Adyen/src/Model/Checkout/PayByBankAISDirectDebitDetails.cs b/Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayByBankAISDirectDebitDetails.cs rename to Adyen/Model/Checkout/PayByBankAISDirectDebitDetails.cs diff --git a/Adyen/src/Model/Checkout/PayByBankDetails.cs b/Adyen/Model/Checkout/PayByBankDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayByBankDetails.cs rename to Adyen/Model/Checkout/PayByBankDetails.cs diff --git a/Adyen/src/Model/Checkout/PayPalDetails.cs b/Adyen/Model/Checkout/PayPalDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayPalDetails.cs rename to Adyen/Model/Checkout/PayPalDetails.cs diff --git a/Adyen/src/Model/Checkout/PayPayDetails.cs b/Adyen/Model/Checkout/PayPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayPayDetails.cs rename to Adyen/Model/Checkout/PayPayDetails.cs diff --git a/Adyen/src/Model/Checkout/PayToDetails.cs b/Adyen/Model/Checkout/PayToDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayToDetails.cs rename to Adyen/Model/Checkout/PayToDetails.cs diff --git a/Adyen/src/Model/Checkout/PayUUpiDetails.cs b/Adyen/Model/Checkout/PayUUpiDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayUUpiDetails.cs rename to Adyen/Model/Checkout/PayUUpiDetails.cs diff --git a/Adyen/src/Model/Checkout/PayWithGoogleDetails.cs b/Adyen/Model/Checkout/PayWithGoogleDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayWithGoogleDetails.cs rename to Adyen/Model/Checkout/PayWithGoogleDetails.cs diff --git a/Adyen/src/Model/Checkout/PayWithGoogleDonations.cs b/Adyen/Model/Checkout/PayWithGoogleDonations.cs similarity index 100% rename from Adyen/src/Model/Checkout/PayWithGoogleDonations.cs rename to Adyen/Model/Checkout/PayWithGoogleDonations.cs diff --git a/Adyen/src/Model/Checkout/Payment.cs b/Adyen/Model/Checkout/Payment.cs similarity index 100% rename from Adyen/src/Model/Checkout/Payment.cs rename to Adyen/Model/Checkout/Payment.cs diff --git a/Adyen/src/Model/Checkout/PaymentAmountUpdateRequest.cs b/Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentAmountUpdateRequest.cs rename to Adyen/Model/Checkout/PaymentAmountUpdateRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentAmountUpdateResponse.cs b/Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentAmountUpdateResponse.cs rename to Adyen/Model/Checkout/PaymentAmountUpdateResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentCancelRequest.cs b/Adyen/Model/Checkout/PaymentCancelRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentCancelRequest.cs rename to Adyen/Model/Checkout/PaymentCancelRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentCancelResponse.cs b/Adyen/Model/Checkout/PaymentCancelResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentCancelResponse.cs rename to Adyen/Model/Checkout/PaymentCancelResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentCaptureRequest.cs b/Adyen/Model/Checkout/PaymentCaptureRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentCaptureRequest.cs rename to Adyen/Model/Checkout/PaymentCaptureRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentCaptureResponse.cs b/Adyen/Model/Checkout/PaymentCaptureResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentCaptureResponse.cs rename to Adyen/Model/Checkout/PaymentCaptureResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentCompletionDetails.cs b/Adyen/Model/Checkout/PaymentCompletionDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentCompletionDetails.cs rename to Adyen/Model/Checkout/PaymentCompletionDetails.cs diff --git a/Adyen/src/Model/Checkout/PaymentDetails.cs b/Adyen/Model/Checkout/PaymentDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentDetails.cs rename to Adyen/Model/Checkout/PaymentDetails.cs diff --git a/Adyen/src/Model/Checkout/PaymentDetailsRequest.cs b/Adyen/Model/Checkout/PaymentDetailsRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentDetailsRequest.cs rename to Adyen/Model/Checkout/PaymentDetailsRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentDetailsResponse.cs b/Adyen/Model/Checkout/PaymentDetailsResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentDetailsResponse.cs rename to Adyen/Model/Checkout/PaymentDetailsResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentLinkRequest.cs b/Adyen/Model/Checkout/PaymentLinkRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentLinkRequest.cs rename to Adyen/Model/Checkout/PaymentLinkRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentLinkResponse.cs b/Adyen/Model/Checkout/PaymentLinkResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentLinkResponse.cs rename to Adyen/Model/Checkout/PaymentLinkResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethod.cs b/Adyen/Model/Checkout/PaymentMethod.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethod.cs rename to Adyen/Model/Checkout/PaymentMethod.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethodGroup.cs b/Adyen/Model/Checkout/PaymentMethodGroup.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethodGroup.cs rename to Adyen/Model/Checkout/PaymentMethodGroup.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethodIssuer.cs b/Adyen/Model/Checkout/PaymentMethodIssuer.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethodIssuer.cs rename to Adyen/Model/Checkout/PaymentMethodIssuer.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethodToStore.cs b/Adyen/Model/Checkout/PaymentMethodToStore.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethodToStore.cs rename to Adyen/Model/Checkout/PaymentMethodToStore.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethodUPIApps.cs b/Adyen/Model/Checkout/PaymentMethodUPIApps.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethodUPIApps.cs rename to Adyen/Model/Checkout/PaymentMethodUPIApps.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethodsRequest.cs b/Adyen/Model/Checkout/PaymentMethodsRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethodsRequest.cs rename to Adyen/Model/Checkout/PaymentMethodsRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentMethodsResponse.cs b/Adyen/Model/Checkout/PaymentMethodsResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentMethodsResponse.cs rename to Adyen/Model/Checkout/PaymentMethodsResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentRefundRequest.cs b/Adyen/Model/Checkout/PaymentRefundRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentRefundRequest.cs rename to Adyen/Model/Checkout/PaymentRefundRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentRefundResponse.cs b/Adyen/Model/Checkout/PaymentRefundResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentRefundResponse.cs rename to Adyen/Model/Checkout/PaymentRefundResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentRequest.cs b/Adyen/Model/Checkout/PaymentRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentRequest.cs rename to Adyen/Model/Checkout/PaymentRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentResponse.cs b/Adyen/Model/Checkout/PaymentResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentResponse.cs rename to Adyen/Model/Checkout/PaymentResponse.cs diff --git a/Adyen/src/Model/Checkout/PaymentResponseAction.cs b/Adyen/Model/Checkout/PaymentResponseAction.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentResponseAction.cs rename to Adyen/Model/Checkout/PaymentResponseAction.cs diff --git a/Adyen/src/Model/Checkout/PaymentReversalRequest.cs b/Adyen/Model/Checkout/PaymentReversalRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentReversalRequest.cs rename to Adyen/Model/Checkout/PaymentReversalRequest.cs diff --git a/Adyen/src/Model/Checkout/PaymentReversalResponse.cs b/Adyen/Model/Checkout/PaymentReversalResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaymentReversalResponse.cs rename to Adyen/Model/Checkout/PaymentReversalResponse.cs diff --git a/Adyen/src/Model/Checkout/PaypalUpdateOrderRequest.cs b/Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaypalUpdateOrderRequest.cs rename to Adyen/Model/Checkout/PaypalUpdateOrderRequest.cs diff --git a/Adyen/src/Model/Checkout/PaypalUpdateOrderResponse.cs b/Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/PaypalUpdateOrderResponse.cs rename to Adyen/Model/Checkout/PaypalUpdateOrderResponse.cs diff --git a/Adyen/src/Model/Checkout/Phone.cs b/Adyen/Model/Checkout/Phone.cs similarity index 100% rename from Adyen/src/Model/Checkout/Phone.cs rename to Adyen/Model/Checkout/Phone.cs diff --git a/Adyen/src/Model/Checkout/PixDetails.cs b/Adyen/Model/Checkout/PixDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PixDetails.cs rename to Adyen/Model/Checkout/PixDetails.cs diff --git a/Adyen/src/Model/Checkout/PixRecurring.cs b/Adyen/Model/Checkout/PixRecurring.cs similarity index 100% rename from Adyen/src/Model/Checkout/PixRecurring.cs rename to Adyen/Model/Checkout/PixRecurring.cs diff --git a/Adyen/src/Model/Checkout/PlatformChargebackLogic.cs b/Adyen/Model/Checkout/PlatformChargebackLogic.cs similarity index 100% rename from Adyen/src/Model/Checkout/PlatformChargebackLogic.cs rename to Adyen/Model/Checkout/PlatformChargebackLogic.cs diff --git a/Adyen/src/Model/Checkout/PseDetails.cs b/Adyen/Model/Checkout/PseDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/PseDetails.cs rename to Adyen/Model/Checkout/PseDetails.cs diff --git a/Adyen/src/Model/Checkout/RakutenPayDetails.cs b/Adyen/Model/Checkout/RakutenPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/RakutenPayDetails.cs rename to Adyen/Model/Checkout/RakutenPayDetails.cs diff --git a/Adyen/src/Model/Checkout/RatepayDetails.cs b/Adyen/Model/Checkout/RatepayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/RatepayDetails.cs rename to Adyen/Model/Checkout/RatepayDetails.cs diff --git a/Adyen/src/Model/Checkout/Recurring.cs b/Adyen/Model/Checkout/Recurring.cs similarity index 100% rename from Adyen/src/Model/Checkout/Recurring.cs rename to Adyen/Model/Checkout/Recurring.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalData3DSecure.cs b/Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalData3DSecure.cs rename to Adyen/Model/Checkout/ResponseAdditionalData3DSecure.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataBillingAddress.cs b/Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataBillingAddress.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataBillingAddress.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataCard.cs b/Adyen/Model/Checkout/ResponseAdditionalDataCard.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataCard.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataCard.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataCommon.cs b/Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataCommon.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataCommon.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataDomesticError.cs b/Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataDomesticError.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataDomesticError.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataInstallments.cs b/Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataInstallments.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataInstallments.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs b/Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataNetworkTokens.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataOpi.cs b/Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataOpi.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataOpi.cs diff --git a/Adyen/src/Model/Checkout/ResponseAdditionalDataSepa.cs b/Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponseAdditionalDataSepa.cs rename to Adyen/Model/Checkout/ResponseAdditionalDataSepa.cs diff --git a/Adyen/src/Model/Checkout/ResponsePaymentMethod.cs b/Adyen/Model/Checkout/ResponsePaymentMethod.cs similarity index 100% rename from Adyen/src/Model/Checkout/ResponsePaymentMethod.cs rename to Adyen/Model/Checkout/ResponsePaymentMethod.cs diff --git a/Adyen/src/Model/Checkout/RiskData.cs b/Adyen/Model/Checkout/RiskData.cs similarity index 100% rename from Adyen/src/Model/Checkout/RiskData.cs rename to Adyen/Model/Checkout/RiskData.cs diff --git a/Adyen/src/Model/Checkout/RivertyDetails.cs b/Adyen/Model/Checkout/RivertyDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/RivertyDetails.cs rename to Adyen/Model/Checkout/RivertyDetails.cs diff --git a/Adyen/src/Model/Checkout/SDKEphemPubKey.cs b/Adyen/Model/Checkout/SDKEphemPubKey.cs similarity index 100% rename from Adyen/src/Model/Checkout/SDKEphemPubKey.cs rename to Adyen/Model/Checkout/SDKEphemPubKey.cs diff --git a/Adyen/src/Model/Checkout/SamsungPayDetails.cs b/Adyen/Model/Checkout/SamsungPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/SamsungPayDetails.cs rename to Adyen/Model/Checkout/SamsungPayDetails.cs diff --git a/Adyen/src/Model/Checkout/SepaDirectDebitDetails.cs b/Adyen/Model/Checkout/SepaDirectDebitDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/SepaDirectDebitDetails.cs rename to Adyen/Model/Checkout/SepaDirectDebitDetails.cs diff --git a/Adyen/src/Model/Checkout/ServiceError.cs b/Adyen/Model/Checkout/ServiceError.cs similarity index 100% rename from Adyen/src/Model/Checkout/ServiceError.cs rename to Adyen/Model/Checkout/ServiceError.cs diff --git a/Adyen/src/Model/Checkout/SessionResultResponse.cs b/Adyen/Model/Checkout/SessionResultResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/SessionResultResponse.cs rename to Adyen/Model/Checkout/SessionResultResponse.cs diff --git a/Adyen/src/Model/Checkout/ShopperInteractionDevice.cs b/Adyen/Model/Checkout/ShopperInteractionDevice.cs similarity index 100% rename from Adyen/src/Model/Checkout/ShopperInteractionDevice.cs rename to Adyen/Model/Checkout/ShopperInteractionDevice.cs diff --git a/Adyen/src/Model/Checkout/Split.cs b/Adyen/Model/Checkout/Split.cs similarity index 100% rename from Adyen/src/Model/Checkout/Split.cs rename to Adyen/Model/Checkout/Split.cs diff --git a/Adyen/src/Model/Checkout/SplitAmount.cs b/Adyen/Model/Checkout/SplitAmount.cs similarity index 100% rename from Adyen/src/Model/Checkout/SplitAmount.cs rename to Adyen/Model/Checkout/SplitAmount.cs diff --git a/Adyen/src/Model/Checkout/StandalonePaymentCancelRequest.cs b/Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/StandalonePaymentCancelRequest.cs rename to Adyen/Model/Checkout/StandalonePaymentCancelRequest.cs diff --git a/Adyen/src/Model/Checkout/StandalonePaymentCancelResponse.cs b/Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/StandalonePaymentCancelResponse.cs rename to Adyen/Model/Checkout/StandalonePaymentCancelResponse.cs diff --git a/Adyen/src/Model/Checkout/StoredPaymentMethod.cs b/Adyen/Model/Checkout/StoredPaymentMethod.cs similarity index 100% rename from Adyen/src/Model/Checkout/StoredPaymentMethod.cs rename to Adyen/Model/Checkout/StoredPaymentMethod.cs diff --git a/Adyen/src/Model/Checkout/StoredPaymentMethodDetails.cs b/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/StoredPaymentMethodDetails.cs rename to Adyen/Model/Checkout/StoredPaymentMethodDetails.cs diff --git a/Adyen/src/Model/Checkout/StoredPaymentMethodRequest.cs b/Adyen/Model/Checkout/StoredPaymentMethodRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/StoredPaymentMethodRequest.cs rename to Adyen/Model/Checkout/StoredPaymentMethodRequest.cs diff --git a/Adyen/src/Model/Checkout/StoredPaymentMethodResource.cs b/Adyen/Model/Checkout/StoredPaymentMethodResource.cs similarity index 100% rename from Adyen/src/Model/Checkout/StoredPaymentMethodResource.cs rename to Adyen/Model/Checkout/StoredPaymentMethodResource.cs diff --git a/Adyen/src/Model/Checkout/SubInputDetail.cs b/Adyen/Model/Checkout/SubInputDetail.cs similarity index 100% rename from Adyen/src/Model/Checkout/SubInputDetail.cs rename to Adyen/Model/Checkout/SubInputDetail.cs diff --git a/Adyen/src/Model/Checkout/SubMerchant.cs b/Adyen/Model/Checkout/SubMerchant.cs similarity index 100% rename from Adyen/src/Model/Checkout/SubMerchant.cs rename to Adyen/Model/Checkout/SubMerchant.cs diff --git a/Adyen/src/Model/Checkout/SubMerchantInfo.cs b/Adyen/Model/Checkout/SubMerchantInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/SubMerchantInfo.cs rename to Adyen/Model/Checkout/SubMerchantInfo.cs diff --git a/Adyen/src/Model/Checkout/Surcharge.cs b/Adyen/Model/Checkout/Surcharge.cs similarity index 100% rename from Adyen/src/Model/Checkout/Surcharge.cs rename to Adyen/Model/Checkout/Surcharge.cs diff --git a/Adyen/src/Model/Checkout/TaxTotal.cs b/Adyen/Model/Checkout/TaxTotal.cs similarity index 100% rename from Adyen/src/Model/Checkout/TaxTotal.cs rename to Adyen/Model/Checkout/TaxTotal.cs diff --git a/Adyen/src/Model/Checkout/ThreeDS2RequestData.cs b/Adyen/Model/Checkout/ThreeDS2RequestData.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDS2RequestData.cs rename to Adyen/Model/Checkout/ThreeDS2RequestData.cs diff --git a/Adyen/src/Model/Checkout/ThreeDS2RequestFields.cs b/Adyen/Model/Checkout/ThreeDS2RequestFields.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDS2RequestFields.cs rename to Adyen/Model/Checkout/ThreeDS2RequestFields.cs diff --git a/Adyen/src/Model/Checkout/ThreeDS2ResponseData.cs b/Adyen/Model/Checkout/ThreeDS2ResponseData.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDS2ResponseData.cs rename to Adyen/Model/Checkout/ThreeDS2ResponseData.cs diff --git a/Adyen/src/Model/Checkout/ThreeDS2Result.cs b/Adyen/Model/Checkout/ThreeDS2Result.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDS2Result.cs rename to Adyen/Model/Checkout/ThreeDS2Result.cs diff --git a/Adyen/src/Model/Checkout/ThreeDSRequestData.cs b/Adyen/Model/Checkout/ThreeDSRequestData.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDSRequestData.cs rename to Adyen/Model/Checkout/ThreeDSRequestData.cs diff --git a/Adyen/src/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs b/Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs rename to Adyen/Model/Checkout/ThreeDSRequestorAuthenticationInfo.cs diff --git a/Adyen/src/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs b/Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs rename to Adyen/Model/Checkout/ThreeDSRequestorPriorAuthenticationInfo.cs diff --git a/Adyen/src/Model/Checkout/ThreeDSecureData.cs b/Adyen/Model/Checkout/ThreeDSecureData.cs similarity index 100% rename from Adyen/src/Model/Checkout/ThreeDSecureData.cs rename to Adyen/Model/Checkout/ThreeDSecureData.cs diff --git a/Adyen/src/Model/Checkout/Ticket.cs b/Adyen/Model/Checkout/Ticket.cs similarity index 100% rename from Adyen/src/Model/Checkout/Ticket.cs rename to Adyen/Model/Checkout/Ticket.cs diff --git a/Adyen/src/Model/Checkout/TravelAgency.cs b/Adyen/Model/Checkout/TravelAgency.cs similarity index 100% rename from Adyen/src/Model/Checkout/TravelAgency.cs rename to Adyen/Model/Checkout/TravelAgency.cs diff --git a/Adyen/src/Model/Checkout/TwintDetails.cs b/Adyen/Model/Checkout/TwintDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/TwintDetails.cs rename to Adyen/Model/Checkout/TwintDetails.cs diff --git a/Adyen/src/Model/Checkout/UpdatePaymentLinkRequest.cs b/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/UpdatePaymentLinkRequest.cs rename to Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs diff --git a/Adyen/src/Model/Checkout/UpiCollectDetails.cs b/Adyen/Model/Checkout/UpiCollectDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/UpiCollectDetails.cs rename to Adyen/Model/Checkout/UpiCollectDetails.cs diff --git a/Adyen/src/Model/Checkout/UpiIntentDetails.cs b/Adyen/Model/Checkout/UpiIntentDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/UpiIntentDetails.cs rename to Adyen/Model/Checkout/UpiIntentDetails.cs diff --git a/Adyen/src/Model/Checkout/UtilityRequest.cs b/Adyen/Model/Checkout/UtilityRequest.cs similarity index 100% rename from Adyen/src/Model/Checkout/UtilityRequest.cs rename to Adyen/Model/Checkout/UtilityRequest.cs diff --git a/Adyen/src/Model/Checkout/UtilityResponse.cs b/Adyen/Model/Checkout/UtilityResponse.cs similarity index 100% rename from Adyen/src/Model/Checkout/UtilityResponse.cs rename to Adyen/Model/Checkout/UtilityResponse.cs diff --git a/Adyen/src/Model/Checkout/VippsDetails.cs b/Adyen/Model/Checkout/VippsDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/VippsDetails.cs rename to Adyen/Model/Checkout/VippsDetails.cs diff --git a/Adyen/src/Model/Checkout/VisaCheckoutDetails.cs b/Adyen/Model/Checkout/VisaCheckoutDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/VisaCheckoutDetails.cs rename to Adyen/Model/Checkout/VisaCheckoutDetails.cs diff --git a/Adyen/src/Model/Checkout/WeChatPayDetails.cs b/Adyen/Model/Checkout/WeChatPayDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/WeChatPayDetails.cs rename to Adyen/Model/Checkout/WeChatPayDetails.cs diff --git a/Adyen/src/Model/Checkout/WeChatPayMiniProgramDetails.cs b/Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/WeChatPayMiniProgramDetails.cs rename to Adyen/Model/Checkout/WeChatPayMiniProgramDetails.cs diff --git a/Adyen/src/Model/Checkout/ZipDetails.cs b/Adyen/Model/Checkout/ZipDetails.cs similarity index 100% rename from Adyen/src/Model/Checkout/ZipDetails.cs rename to Adyen/Model/Checkout/ZipDetails.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/ConfigurationWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/AccountHolder.cs b/Adyen/Model/ConfigurationWebhooks/AccountHolder.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/AccountHolder.cs rename to Adyen/Model/ConfigurationWebhooks/AccountHolder.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/AccountHolderCapability.cs b/Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/AccountHolderCapability.cs rename to Adyen/Model/ConfigurationWebhooks/AccountHolderCapability.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs b/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs rename to Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationData.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs b/Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs rename to Adyen/Model/ConfigurationWebhooks/AccountHolderNotificationRequest.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs b/Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs rename to Adyen/Model/ConfigurationWebhooks/AccountSupportingEntityCapability.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Address.cs b/Adyen/Model/ConfigurationWebhooks/Address.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Address.cs rename to Adyen/Model/ConfigurationWebhooks/Address.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Amount.cs b/Adyen/Model/ConfigurationWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Amount.cs rename to Adyen/Model/ConfigurationWebhooks/Amount.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Authentication.cs b/Adyen/Model/ConfigurationWebhooks/Authentication.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Authentication.cs rename to Adyen/Model/ConfigurationWebhooks/Authentication.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Balance.cs b/Adyen/Model/ConfigurationWebhooks/Balance.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Balance.cs rename to Adyen/Model/ConfigurationWebhooks/Balance.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/BalanceAccount.cs b/Adyen/Model/ConfigurationWebhooks/BalanceAccount.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/BalanceAccount.cs rename to Adyen/Model/ConfigurationWebhooks/BalanceAccount.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs b/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs rename to Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationData.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs b/Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs rename to Adyen/Model/ConfigurationWebhooks/BalanceAccountNotificationRequest.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/Model/ConfigurationWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/BankAccountDetails.cs b/Adyen/Model/ConfigurationWebhooks/BankAccountDetails.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/BankAccountDetails.cs rename to Adyen/Model/ConfigurationWebhooks/BankAccountDetails.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/BulkAddress.cs b/Adyen/Model/ConfigurationWebhooks/BulkAddress.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/BulkAddress.cs rename to Adyen/Model/ConfigurationWebhooks/BulkAddress.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CapabilityProblem.cs b/Adyen/Model/ConfigurationWebhooks/CapabilityProblem.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CapabilityProblem.cs rename to Adyen/Model/ConfigurationWebhooks/CapabilityProblem.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs b/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs rename to Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntity.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs b/Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs rename to Adyen/Model/ConfigurationWebhooks/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CapabilitySettings.cs b/Adyen/Model/ConfigurationWebhooks/CapabilitySettings.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CapabilitySettings.cs rename to Adyen/Model/ConfigurationWebhooks/CapabilitySettings.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Card.cs b/Adyen/Model/ConfigurationWebhooks/Card.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Card.cs rename to Adyen/Model/ConfigurationWebhooks/Card.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CardConfiguration.cs b/Adyen/Model/ConfigurationWebhooks/CardConfiguration.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CardConfiguration.cs rename to Adyen/Model/ConfigurationWebhooks/CardConfiguration.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CardOrderItem.cs b/Adyen/Model/ConfigurationWebhooks/CardOrderItem.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CardOrderItem.cs rename to Adyen/Model/ConfigurationWebhooks/CardOrderItem.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs b/Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs rename to Adyen/Model/ConfigurationWebhooks/CardOrderItemDeliveryStatus.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs b/Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs rename to Adyen/Model/ConfigurationWebhooks/CardOrderNotificationRequest.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/ContactDetails.cs b/Adyen/Model/ConfigurationWebhooks/ContactDetails.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/ContactDetails.cs rename to Adyen/Model/ConfigurationWebhooks/ContactDetails.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/DeliveryAddress.cs b/Adyen/Model/ConfigurationWebhooks/DeliveryAddress.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/DeliveryAddress.cs rename to Adyen/Model/ConfigurationWebhooks/DeliveryAddress.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/DeliveryContact.cs b/Adyen/Model/ConfigurationWebhooks/DeliveryContact.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/DeliveryContact.cs rename to Adyen/Model/ConfigurationWebhooks/DeliveryContact.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Device.cs b/Adyen/Model/ConfigurationWebhooks/Device.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Device.cs rename to Adyen/Model/ConfigurationWebhooks/Device.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Expiry.cs b/Adyen/Model/ConfigurationWebhooks/Expiry.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Expiry.cs rename to Adyen/Model/ConfigurationWebhooks/Expiry.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/IbanAccountIdentification.cs b/Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/IbanAccountIdentification.cs rename to Adyen/Model/ConfigurationWebhooks/IbanAccountIdentification.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Name.cs b/Adyen/Model/ConfigurationWebhooks/Name.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Name.cs rename to Adyen/Model/ConfigurationWebhooks/Name.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs b/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs rename to Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationDataV2.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs b/Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs rename to Adyen/Model/ConfigurationWebhooks/NetworkTokenNotificationRequest.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs b/Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs rename to Adyen/Model/ConfigurationWebhooks/NetworkTokenRequestor.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/PaymentInstrument.cs b/Adyen/Model/ConfigurationWebhooks/PaymentInstrument.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/PaymentInstrument.cs rename to Adyen/Model/ConfigurationWebhooks/PaymentInstrument.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs b/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs rename to Adyen/Model/ConfigurationWebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs b/Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs rename to Adyen/Model/ConfigurationWebhooks/PaymentInstrumentNotificationData.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs b/Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs rename to Adyen/Model/ConfigurationWebhooks/PaymentNotificationRequest.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Phone.cs b/Adyen/Model/ConfigurationWebhooks/Phone.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Phone.cs rename to Adyen/Model/ConfigurationWebhooks/Phone.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/PhoneNumber.cs b/Adyen/Model/ConfigurationWebhooks/PhoneNumber.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/PhoneNumber.cs rename to Adyen/Model/ConfigurationWebhooks/PhoneNumber.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs b/Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs rename to Adyen/Model/ConfigurationWebhooks/PlatformPaymentConfiguration.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/RemediatingAction.cs b/Adyen/Model/ConfigurationWebhooks/RemediatingAction.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/RemediatingAction.cs rename to Adyen/Model/ConfigurationWebhooks/RemediatingAction.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Resource.cs b/Adyen/Model/ConfigurationWebhooks/Resource.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Resource.cs rename to Adyen/Model/ConfigurationWebhooks/Resource.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs b/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs rename to Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationData.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs b/Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs rename to Adyen/Model/ConfigurationWebhooks/SweepConfigurationNotificationRequest.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationV2.cs b/Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/SweepConfigurationV2.cs rename to Adyen/Model/ConfigurationWebhooks/SweepConfigurationV2.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/SweepCounterparty.cs b/Adyen/Model/ConfigurationWebhooks/SweepCounterparty.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/SweepCounterparty.cs rename to Adyen/Model/ConfigurationWebhooks/SweepCounterparty.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/SweepSchedule.cs b/Adyen/Model/ConfigurationWebhooks/SweepSchedule.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/SweepSchedule.cs rename to Adyen/Model/ConfigurationWebhooks/SweepSchedule.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/TokenAuthentication.cs b/Adyen/Model/ConfigurationWebhooks/TokenAuthentication.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/TokenAuthentication.cs rename to Adyen/Model/ConfigurationWebhooks/TokenAuthentication.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/ValidationFacts.cs b/Adyen/Model/ConfigurationWebhooks/ValidationFacts.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/ValidationFacts.cs rename to Adyen/Model/ConfigurationWebhooks/ValidationFacts.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/VerificationDeadline.cs b/Adyen/Model/ConfigurationWebhooks/VerificationDeadline.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/VerificationDeadline.cs rename to Adyen/Model/ConfigurationWebhooks/VerificationDeadline.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/VerificationError.cs b/Adyen/Model/ConfigurationWebhooks/VerificationError.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/VerificationError.cs rename to Adyen/Model/ConfigurationWebhooks/VerificationError.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs b/Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs rename to Adyen/Model/ConfigurationWebhooks/VerificationErrorRecursive.cs diff --git a/Adyen/src/Model/ConfigurationWebhooks/Wallet.cs b/Adyen/Model/ConfigurationWebhooks/Wallet.cs similarity index 100% rename from Adyen/src/Model/ConfigurationWebhooks/Wallet.cs rename to Adyen/Model/ConfigurationWebhooks/Wallet.cs diff --git a/Adyen/src/Model/DataProtection/AbstractOpenAPISchema.cs b/Adyen/Model/DataProtection/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/DataProtection/AbstractOpenAPISchema.cs rename to Adyen/Model/DataProtection/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/DataProtection/ServiceError.cs b/Adyen/Model/DataProtection/ServiceError.cs similarity index 100% rename from Adyen/src/Model/DataProtection/ServiceError.cs rename to Adyen/Model/DataProtection/ServiceError.cs diff --git a/Adyen/src/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs b/Adyen/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs similarity index 100% rename from Adyen/src/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs rename to Adyen/Model/DataProtection/SubjectErasureByPspReferenceRequest.cs diff --git a/Adyen/src/Model/DataProtection/SubjectErasureResponse.cs b/Adyen/Model/DataProtection/SubjectErasureResponse.cs similarity index 100% rename from Adyen/src/Model/DataProtection/SubjectErasureResponse.cs rename to Adyen/Model/DataProtection/SubjectErasureResponse.cs diff --git a/Adyen/src/Model/DisputeWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/DisputeWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/DisputeWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/DisputeWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/DisputeWebhooks/Amount.cs b/Adyen/Model/DisputeWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/DisputeWebhooks/Amount.cs rename to Adyen/Model/DisputeWebhooks/Amount.cs diff --git a/Adyen/src/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/Model/DisputeWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/src/Model/DisputeWebhooks/DisputeEventNotification.cs b/Adyen/Model/DisputeWebhooks/DisputeEventNotification.cs similarity index 100% rename from Adyen/src/Model/DisputeWebhooks/DisputeEventNotification.cs rename to Adyen/Model/DisputeWebhooks/DisputeEventNotification.cs diff --git a/Adyen/src/Model/DisputeWebhooks/DisputeNotificationRequest.cs b/Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/DisputeWebhooks/DisputeNotificationRequest.cs rename to Adyen/Model/DisputeWebhooks/DisputeNotificationRequest.cs diff --git a/Adyen/src/Model/Disputes/AbstractOpenAPISchema.cs b/Adyen/Model/Disputes/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Disputes/AbstractOpenAPISchema.cs rename to Adyen/Model/Disputes/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Disputes/AcceptDisputeRequest.cs b/Adyen/Model/Disputes/AcceptDisputeRequest.cs similarity index 100% rename from Adyen/src/Model/Disputes/AcceptDisputeRequest.cs rename to Adyen/Model/Disputes/AcceptDisputeRequest.cs diff --git a/Adyen/src/Model/Disputes/AcceptDisputeResponse.cs b/Adyen/Model/Disputes/AcceptDisputeResponse.cs similarity index 100% rename from Adyen/src/Model/Disputes/AcceptDisputeResponse.cs rename to Adyen/Model/Disputes/AcceptDisputeResponse.cs diff --git a/Adyen/src/Model/Disputes/DefendDisputeRequest.cs b/Adyen/Model/Disputes/DefendDisputeRequest.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefendDisputeRequest.cs rename to Adyen/Model/Disputes/DefendDisputeRequest.cs diff --git a/Adyen/src/Model/Disputes/DefendDisputeResponse.cs b/Adyen/Model/Disputes/DefendDisputeResponse.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefendDisputeResponse.cs rename to Adyen/Model/Disputes/DefendDisputeResponse.cs diff --git a/Adyen/src/Model/Disputes/DefenseDocument.cs b/Adyen/Model/Disputes/DefenseDocument.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefenseDocument.cs rename to Adyen/Model/Disputes/DefenseDocument.cs diff --git a/Adyen/src/Model/Disputes/DefenseDocumentType.cs b/Adyen/Model/Disputes/DefenseDocumentType.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefenseDocumentType.cs rename to Adyen/Model/Disputes/DefenseDocumentType.cs diff --git a/Adyen/src/Model/Disputes/DefenseReason.cs b/Adyen/Model/Disputes/DefenseReason.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefenseReason.cs rename to Adyen/Model/Disputes/DefenseReason.cs diff --git a/Adyen/src/Model/Disputes/DefenseReasonsRequest.cs b/Adyen/Model/Disputes/DefenseReasonsRequest.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefenseReasonsRequest.cs rename to Adyen/Model/Disputes/DefenseReasonsRequest.cs diff --git a/Adyen/src/Model/Disputes/DefenseReasonsResponse.cs b/Adyen/Model/Disputes/DefenseReasonsResponse.cs similarity index 100% rename from Adyen/src/Model/Disputes/DefenseReasonsResponse.cs rename to Adyen/Model/Disputes/DefenseReasonsResponse.cs diff --git a/Adyen/src/Model/Disputes/DeleteDefenseDocumentRequest.cs b/Adyen/Model/Disputes/DeleteDefenseDocumentRequest.cs similarity index 100% rename from Adyen/src/Model/Disputes/DeleteDefenseDocumentRequest.cs rename to Adyen/Model/Disputes/DeleteDefenseDocumentRequest.cs diff --git a/Adyen/src/Model/Disputes/DeleteDefenseDocumentResponse.cs b/Adyen/Model/Disputes/DeleteDefenseDocumentResponse.cs similarity index 100% rename from Adyen/src/Model/Disputes/DeleteDefenseDocumentResponse.cs rename to Adyen/Model/Disputes/DeleteDefenseDocumentResponse.cs diff --git a/Adyen/src/Model/Disputes/DisputeServiceResult.cs b/Adyen/Model/Disputes/DisputeServiceResult.cs similarity index 100% rename from Adyen/src/Model/Disputes/DisputeServiceResult.cs rename to Adyen/Model/Disputes/DisputeServiceResult.cs diff --git a/Adyen/src/Model/Disputes/ServiceError.cs b/Adyen/Model/Disputes/ServiceError.cs similarity index 100% rename from Adyen/src/Model/Disputes/ServiceError.cs rename to Adyen/Model/Disputes/ServiceError.cs diff --git a/Adyen/src/Model/Disputes/SupplyDefenseDocumentRequest.cs b/Adyen/Model/Disputes/SupplyDefenseDocumentRequest.cs similarity index 100% rename from Adyen/src/Model/Disputes/SupplyDefenseDocumentRequest.cs rename to Adyen/Model/Disputes/SupplyDefenseDocumentRequest.cs diff --git a/Adyen/src/Model/Disputes/SupplyDefenseDocumentResponse.cs b/Adyen/Model/Disputes/SupplyDefenseDocumentResponse.cs similarity index 100% rename from Adyen/src/Model/Disputes/SupplyDefenseDocumentResponse.cs rename to Adyen/Model/Disputes/SupplyDefenseDocumentResponse.cs diff --git a/Adyen/src/Model/Environment.cs b/Adyen/Model/Environment.cs similarity index 100% rename from Adyen/src/Model/Environment.cs rename to Adyen/Model/Environment.cs diff --git a/Adyen/src/Model/LegalEntityManagement/AULocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/AULocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/AULocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/AbstractOpenAPISchema.cs b/Adyen/Model/LegalEntityManagement/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/AbstractOpenAPISchema.cs rename to Adyen/Model/LegalEntityManagement/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs b/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs rename to Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.cs diff --git a/Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs b/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs rename to Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/AdditionalBankIdentification.cs b/Adyen/Model/LegalEntityManagement/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/AdditionalBankIdentification.cs rename to Adyen/Model/LegalEntityManagement/AdditionalBankIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Address.cs b/Adyen/Model/LegalEntityManagement/Address.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Address.cs rename to Adyen/Model/LegalEntityManagement/Address.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Amount.cs b/Adyen/Model/LegalEntityManagement/Amount.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Amount.cs rename to Adyen/Model/LegalEntityManagement/Amount.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Attachment.cs b/Adyen/Model/LegalEntityManagement/Attachment.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Attachment.cs rename to Adyen/Model/LegalEntityManagement/Attachment.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BankAccountInfo.cs b/Adyen/Model/LegalEntityManagement/BankAccountInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BankAccountInfo.cs rename to Adyen/Model/LegalEntityManagement/BankAccountInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/BankAccountInfoAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BirthData.cs b/Adyen/Model/LegalEntityManagement/BirthData.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BirthData.cs rename to Adyen/Model/LegalEntityManagement/BirthData.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BusinessLine.cs b/Adyen/Model/LegalEntityManagement/BusinessLine.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BusinessLine.cs rename to Adyen/Model/LegalEntityManagement/BusinessLine.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BusinessLineInfo.cs b/Adyen/Model/LegalEntityManagement/BusinessLineInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BusinessLineInfo.cs rename to Adyen/Model/LegalEntityManagement/BusinessLineInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs b/Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs rename to Adyen/Model/LegalEntityManagement/BusinessLineInfoUpdate.cs diff --git a/Adyen/src/Model/LegalEntityManagement/BusinessLines.cs b/Adyen/Model/LegalEntityManagement/BusinessLines.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/BusinessLines.cs rename to Adyen/Model/LegalEntityManagement/BusinessLines.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CALocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CALocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/CALocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CZLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CZLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/CZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CalculatePciStatusRequest.cs b/Adyen/Model/LegalEntityManagement/CalculatePciStatusRequest.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CalculatePciStatusRequest.cs rename to Adyen/Model/LegalEntityManagement/CalculatePciStatusRequest.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CalculatePciStatusResponse.cs b/Adyen/Model/LegalEntityManagement/CalculatePciStatusResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CalculatePciStatusResponse.cs rename to Adyen/Model/LegalEntityManagement/CalculatePciStatusResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs b/Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs rename to Adyen/Model/LegalEntityManagement/CalculateTermsOfServiceStatusResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CapabilityProblem.cs b/Adyen/Model/LegalEntityManagement/CapabilityProblem.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CapabilityProblem.cs rename to Adyen/Model/LegalEntityManagement/CapabilityProblem.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntity.cs b/Adyen/Model/LegalEntityManagement/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntity.cs rename to Adyen/Model/LegalEntityManagement/CapabilityProblemEntity.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs b/Adyen/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs rename to Adyen/Model/LegalEntityManagement/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CapabilitySettings.cs b/Adyen/Model/LegalEntityManagement/CapabilitySettings.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CapabilitySettings.cs rename to Adyen/Model/LegalEntityManagement/CapabilitySettings.cs diff --git a/Adyen/src/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs b/Adyen/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs rename to Adyen/Model/LegalEntityManagement/CheckTaxElectronicDeliveryConsentResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/DKLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/DKLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/DKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs b/Adyen/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs rename to Adyen/Model/LegalEntityManagement/DataReviewConfirmationResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Document.cs b/Adyen/Model/LegalEntityManagement/Document.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Document.cs rename to Adyen/Model/LegalEntityManagement/Document.cs diff --git a/Adyen/src/Model/LegalEntityManagement/DocumentPage.cs b/Adyen/Model/LegalEntityManagement/DocumentPage.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/DocumentPage.cs rename to Adyen/Model/LegalEntityManagement/DocumentPage.cs diff --git a/Adyen/src/Model/LegalEntityManagement/DocumentReference.cs b/Adyen/Model/LegalEntityManagement/DocumentReference.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/DocumentReference.cs rename to Adyen/Model/LegalEntityManagement/DocumentReference.cs diff --git a/Adyen/src/Model/LegalEntityManagement/EntityReference.cs b/Adyen/Model/LegalEntityManagement/EntityReference.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/EntityReference.cs rename to Adyen/Model/LegalEntityManagement/EntityReference.cs diff --git a/Adyen/src/Model/LegalEntityManagement/FinancialReport.cs b/Adyen/Model/LegalEntityManagement/FinancialReport.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/FinancialReport.cs rename to Adyen/Model/LegalEntityManagement/FinancialReport.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs b/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs rename to Adyen/Model/LegalEntityManagement/GeneratePciDescriptionRequest.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs b/Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs rename to Adyen/Model/LegalEntityManagement/GeneratePciDescriptionResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs b/Adyen/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs rename to Adyen/Model/LegalEntityManagement/GetAcceptedTermsOfServiceDocumentResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs b/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs rename to Adyen/Model/LegalEntityManagement/GetPciQuestionnaireInfosResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs b/Adyen/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs rename to Adyen/Model/LegalEntityManagement/GetPciQuestionnaireResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs b/Adyen/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs rename to Adyen/Model/LegalEntityManagement/GetTermsOfServiceAcceptanceInfosResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs b/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs rename to Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.cs diff --git a/Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs b/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs rename to Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/HKLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/HKLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/HKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/HULocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/HULocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/HULocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/IbanAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/IbanAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/IbanAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/IbanAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/IdentificationData.cs b/Adyen/Model/LegalEntityManagement/IdentificationData.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/IdentificationData.cs rename to Adyen/Model/LegalEntityManagement/IdentificationData.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Individual.cs b/Adyen/Model/LegalEntityManagement/Individual.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Individual.cs rename to Adyen/Model/LegalEntityManagement/Individual.cs diff --git a/Adyen/src/Model/LegalEntityManagement/LegalEntity.cs b/Adyen/Model/LegalEntityManagement/LegalEntity.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/LegalEntity.cs rename to Adyen/Model/LegalEntityManagement/LegalEntity.cs diff --git a/Adyen/src/Model/LegalEntityManagement/LegalEntityAssociation.cs b/Adyen/Model/LegalEntityManagement/LegalEntityAssociation.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/LegalEntityAssociation.cs rename to Adyen/Model/LegalEntityManagement/LegalEntityAssociation.cs diff --git a/Adyen/src/Model/LegalEntityManagement/LegalEntityCapability.cs b/Adyen/Model/LegalEntityManagement/LegalEntityCapability.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/LegalEntityCapability.cs rename to Adyen/Model/LegalEntityManagement/LegalEntityCapability.cs diff --git a/Adyen/src/Model/LegalEntityManagement/LegalEntityInfo.cs b/Adyen/Model/LegalEntityManagement/LegalEntityInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/LegalEntityInfo.cs rename to Adyen/Model/LegalEntityManagement/LegalEntityInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs b/Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs rename to Adyen/Model/LegalEntityManagement/LegalEntityInfoRequiredType.cs diff --git a/Adyen/src/Model/LegalEntityManagement/NOLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/NOLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/NOLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/NZLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/NZLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/NZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Name.cs b/Adyen/Model/LegalEntityManagement/Name.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Name.cs rename to Adyen/Model/LegalEntityManagement/Name.cs diff --git a/Adyen/src/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/NumberAndBicAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/OnboardingLink.cs b/Adyen/Model/LegalEntityManagement/OnboardingLink.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/OnboardingLink.cs rename to Adyen/Model/LegalEntityManagement/OnboardingLink.cs diff --git a/Adyen/src/Model/LegalEntityManagement/OnboardingLinkInfo.cs b/Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/OnboardingLinkInfo.cs rename to Adyen/Model/LegalEntityManagement/OnboardingLinkInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/OnboardingLinkSettings.cs b/Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/OnboardingLinkSettings.cs rename to Adyen/Model/LegalEntityManagement/OnboardingLinkSettings.cs diff --git a/Adyen/src/Model/LegalEntityManagement/OnboardingTheme.cs b/Adyen/Model/LegalEntityManagement/OnboardingTheme.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/OnboardingTheme.cs rename to Adyen/Model/LegalEntityManagement/OnboardingTheme.cs diff --git a/Adyen/src/Model/LegalEntityManagement/OnboardingThemes.cs b/Adyen/Model/LegalEntityManagement/OnboardingThemes.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/OnboardingThemes.cs rename to Adyen/Model/LegalEntityManagement/OnboardingThemes.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Organization.cs b/Adyen/Model/LegalEntityManagement/Organization.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Organization.cs rename to Adyen/Model/LegalEntityManagement/Organization.cs diff --git a/Adyen/src/Model/LegalEntityManagement/OwnerEntity.cs b/Adyen/Model/LegalEntityManagement/OwnerEntity.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/OwnerEntity.cs rename to Adyen/Model/LegalEntityManagement/OwnerEntity.cs diff --git a/Adyen/src/Model/LegalEntityManagement/PLLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/PLLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/PLLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/PciDocumentInfo.cs b/Adyen/Model/LegalEntityManagement/PciDocumentInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/PciDocumentInfo.cs rename to Adyen/Model/LegalEntityManagement/PciDocumentInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/PciSigningRequest.cs b/Adyen/Model/LegalEntityManagement/PciSigningRequest.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/PciSigningRequest.cs rename to Adyen/Model/LegalEntityManagement/PciSigningRequest.cs diff --git a/Adyen/src/Model/LegalEntityManagement/PciSigningResponse.cs b/Adyen/Model/LegalEntityManagement/PciSigningResponse.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/PciSigningResponse.cs rename to Adyen/Model/LegalEntityManagement/PciSigningResponse.cs diff --git a/Adyen/src/Model/LegalEntityManagement/PhoneNumber.cs b/Adyen/Model/LegalEntityManagement/PhoneNumber.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/PhoneNumber.cs rename to Adyen/Model/LegalEntityManagement/PhoneNumber.cs diff --git a/Adyen/src/Model/LegalEntityManagement/RemediatingAction.cs b/Adyen/Model/LegalEntityManagement/RemediatingAction.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/RemediatingAction.cs rename to Adyen/Model/LegalEntityManagement/RemediatingAction.cs diff --git a/Adyen/src/Model/LegalEntityManagement/SELocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/SELocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/SELocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/SGLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/SGLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/SGLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/ServiceError.cs b/Adyen/Model/LegalEntityManagement/ServiceError.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/ServiceError.cs rename to Adyen/Model/LegalEntityManagement/ServiceError.cs diff --git a/Adyen/src/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs b/Adyen/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs rename to Adyen/Model/LegalEntityManagement/SetTaxElectronicDeliveryConsentRequest.cs diff --git a/Adyen/src/Model/LegalEntityManagement/SoleProprietorship.cs b/Adyen/Model/LegalEntityManagement/SoleProprietorship.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/SoleProprietorship.cs rename to Adyen/Model/LegalEntityManagement/SoleProprietorship.cs diff --git a/Adyen/src/Model/LegalEntityManagement/SourceOfFunds.cs b/Adyen/Model/LegalEntityManagement/SourceOfFunds.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/SourceOfFunds.cs rename to Adyen/Model/LegalEntityManagement/SourceOfFunds.cs diff --git a/Adyen/src/Model/LegalEntityManagement/StockData.cs b/Adyen/Model/LegalEntityManagement/StockData.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/StockData.cs rename to Adyen/Model/LegalEntityManagement/StockData.cs diff --git a/Adyen/src/Model/LegalEntityManagement/SupportingEntityCapability.cs b/Adyen/Model/LegalEntityManagement/SupportingEntityCapability.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/SupportingEntityCapability.cs rename to Adyen/Model/LegalEntityManagement/SupportingEntityCapability.cs diff --git a/Adyen/src/Model/LegalEntityManagement/TaxInformation.cs b/Adyen/Model/LegalEntityManagement/TaxInformation.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/TaxInformation.cs rename to Adyen/Model/LegalEntityManagement/TaxInformation.cs diff --git a/Adyen/src/Model/LegalEntityManagement/TaxReportingClassification.cs b/Adyen/Model/LegalEntityManagement/TaxReportingClassification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/TaxReportingClassification.cs rename to Adyen/Model/LegalEntityManagement/TaxReportingClassification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs b/Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs rename to Adyen/Model/LegalEntityManagement/TermsOfServiceAcceptanceInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/TransferInstrument.cs b/Adyen/Model/LegalEntityManagement/TransferInstrument.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/TransferInstrument.cs rename to Adyen/Model/LegalEntityManagement/TransferInstrument.cs diff --git a/Adyen/src/Model/LegalEntityManagement/TransferInstrumentInfo.cs b/Adyen/Model/LegalEntityManagement/TransferInstrumentInfo.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/TransferInstrumentInfo.cs rename to Adyen/Model/LegalEntityManagement/TransferInstrumentInfo.cs diff --git a/Adyen/src/Model/LegalEntityManagement/TransferInstrumentReference.cs b/Adyen/Model/LegalEntityManagement/TransferInstrumentReference.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/TransferInstrumentReference.cs rename to Adyen/Model/LegalEntityManagement/TransferInstrumentReference.cs diff --git a/Adyen/src/Model/LegalEntityManagement/Trust.cs b/Adyen/Model/LegalEntityManagement/Trust.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/Trust.cs rename to Adyen/Model/LegalEntityManagement/Trust.cs diff --git a/Adyen/src/Model/LegalEntityManagement/UKLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/UKLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/UKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/USLocalAccountIdentification.cs b/Adyen/Model/LegalEntityManagement/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/USLocalAccountIdentification.cs rename to Adyen/Model/LegalEntityManagement/USLocalAccountIdentification.cs diff --git a/Adyen/src/Model/LegalEntityManagement/UndefinedBeneficiary.cs b/Adyen/Model/LegalEntityManagement/UndefinedBeneficiary.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/UndefinedBeneficiary.cs rename to Adyen/Model/LegalEntityManagement/UndefinedBeneficiary.cs diff --git a/Adyen/src/Model/LegalEntityManagement/UnincorporatedPartnership.cs b/Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/UnincorporatedPartnership.cs rename to Adyen/Model/LegalEntityManagement/UnincorporatedPartnership.cs diff --git a/Adyen/src/Model/LegalEntityManagement/VerificationDeadline.cs b/Adyen/Model/LegalEntityManagement/VerificationDeadline.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/VerificationDeadline.cs rename to Adyen/Model/LegalEntityManagement/VerificationDeadline.cs diff --git a/Adyen/src/Model/LegalEntityManagement/VerificationError.cs b/Adyen/Model/LegalEntityManagement/VerificationError.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/VerificationError.cs rename to Adyen/Model/LegalEntityManagement/VerificationError.cs diff --git a/Adyen/src/Model/LegalEntityManagement/VerificationErrorRecursive.cs b/Adyen/Model/LegalEntityManagement/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/VerificationErrorRecursive.cs rename to Adyen/Model/LegalEntityManagement/VerificationErrorRecursive.cs diff --git a/Adyen/src/Model/LegalEntityManagement/VerificationErrors.cs b/Adyen/Model/LegalEntityManagement/VerificationErrors.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/VerificationErrors.cs rename to Adyen/Model/LegalEntityManagement/VerificationErrors.cs diff --git a/Adyen/src/Model/LegalEntityManagement/WebData.cs b/Adyen/Model/LegalEntityManagement/WebData.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/WebData.cs rename to Adyen/Model/LegalEntityManagement/WebData.cs diff --git a/Adyen/src/Model/LegalEntityManagement/WebDataExemption.cs b/Adyen/Model/LegalEntityManagement/WebDataExemption.cs similarity index 100% rename from Adyen/src/Model/LegalEntityManagement/WebDataExemption.cs rename to Adyen/Model/LegalEntityManagement/WebDataExemption.cs diff --git a/Adyen/src/Model/Management/AbstractOpenAPISchema.cs b/Adyen/Model/Management/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Management/AbstractOpenAPISchema.cs rename to Adyen/Model/Management/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Management/AccelInfo.cs b/Adyen/Model/Management/AccelInfo.cs similarity index 100% rename from Adyen/src/Model/Management/AccelInfo.cs rename to Adyen/Model/Management/AccelInfo.cs diff --git a/Adyen/src/Model/Management/AdditionalCommission.cs b/Adyen/Model/Management/AdditionalCommission.cs similarity index 100% rename from Adyen/src/Model/Management/AdditionalCommission.cs rename to Adyen/Model/Management/AdditionalCommission.cs diff --git a/Adyen/src/Model/Management/AdditionalSettings.cs b/Adyen/Model/Management/AdditionalSettings.cs similarity index 100% rename from Adyen/src/Model/Management/AdditionalSettings.cs rename to Adyen/Model/Management/AdditionalSettings.cs diff --git a/Adyen/src/Model/Management/AdditionalSettingsResponse.cs b/Adyen/Model/Management/AdditionalSettingsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/AdditionalSettingsResponse.cs rename to Adyen/Model/Management/AdditionalSettingsResponse.cs diff --git a/Adyen/src/Model/Management/Address.cs b/Adyen/Model/Management/Address.cs similarity index 100% rename from Adyen/src/Model/Management/Address.cs rename to Adyen/Model/Management/Address.cs diff --git a/Adyen/src/Model/Management/AffirmInfo.cs b/Adyen/Model/Management/AffirmInfo.cs similarity index 100% rename from Adyen/src/Model/Management/AffirmInfo.cs rename to Adyen/Model/Management/AffirmInfo.cs diff --git a/Adyen/src/Model/Management/AfterpayTouchInfo.cs b/Adyen/Model/Management/AfterpayTouchInfo.cs similarity index 100% rename from Adyen/src/Model/Management/AfterpayTouchInfo.cs rename to Adyen/Model/Management/AfterpayTouchInfo.cs diff --git a/Adyen/src/Model/Management/AllowedOrigin.cs b/Adyen/Model/Management/AllowedOrigin.cs similarity index 100% rename from Adyen/src/Model/Management/AllowedOrigin.cs rename to Adyen/Model/Management/AllowedOrigin.cs diff --git a/Adyen/src/Model/Management/AllowedOriginsResponse.cs b/Adyen/Model/Management/AllowedOriginsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/AllowedOriginsResponse.cs rename to Adyen/Model/Management/AllowedOriginsResponse.cs diff --git a/Adyen/src/Model/Management/AmexInfo.cs b/Adyen/Model/Management/AmexInfo.cs similarity index 100% rename from Adyen/src/Model/Management/AmexInfo.cs rename to Adyen/Model/Management/AmexInfo.cs diff --git a/Adyen/src/Model/Management/Amount.cs b/Adyen/Model/Management/Amount.cs similarity index 100% rename from Adyen/src/Model/Management/Amount.cs rename to Adyen/Model/Management/Amount.cs diff --git a/Adyen/src/Model/Management/AndroidApp.cs b/Adyen/Model/Management/AndroidApp.cs similarity index 100% rename from Adyen/src/Model/Management/AndroidApp.cs rename to Adyen/Model/Management/AndroidApp.cs diff --git a/Adyen/src/Model/Management/AndroidAppError.cs b/Adyen/Model/Management/AndroidAppError.cs similarity index 100% rename from Adyen/src/Model/Management/AndroidAppError.cs rename to Adyen/Model/Management/AndroidAppError.cs diff --git a/Adyen/src/Model/Management/AndroidAppsResponse.cs b/Adyen/Model/Management/AndroidAppsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/AndroidAppsResponse.cs rename to Adyen/Model/Management/AndroidAppsResponse.cs diff --git a/Adyen/src/Model/Management/AndroidCertificate.cs b/Adyen/Model/Management/AndroidCertificate.cs similarity index 100% rename from Adyen/src/Model/Management/AndroidCertificate.cs rename to Adyen/Model/Management/AndroidCertificate.cs diff --git a/Adyen/src/Model/Management/AndroidCertificatesResponse.cs b/Adyen/Model/Management/AndroidCertificatesResponse.cs similarity index 100% rename from Adyen/src/Model/Management/AndroidCertificatesResponse.cs rename to Adyen/Model/Management/AndroidCertificatesResponse.cs diff --git a/Adyen/src/Model/Management/ApiCredential.cs b/Adyen/Model/Management/ApiCredential.cs similarity index 100% rename from Adyen/src/Model/Management/ApiCredential.cs rename to Adyen/Model/Management/ApiCredential.cs diff --git a/Adyen/src/Model/Management/ApiCredentialLinks.cs b/Adyen/Model/Management/ApiCredentialLinks.cs similarity index 100% rename from Adyen/src/Model/Management/ApiCredentialLinks.cs rename to Adyen/Model/Management/ApiCredentialLinks.cs diff --git a/Adyen/src/Model/Management/ApplePayInfo.cs b/Adyen/Model/Management/ApplePayInfo.cs similarity index 100% rename from Adyen/src/Model/Management/ApplePayInfo.cs rename to Adyen/Model/Management/ApplePayInfo.cs diff --git a/Adyen/src/Model/Management/BcmcInfo.cs b/Adyen/Model/Management/BcmcInfo.cs similarity index 100% rename from Adyen/src/Model/Management/BcmcInfo.cs rename to Adyen/Model/Management/BcmcInfo.cs diff --git a/Adyen/src/Model/Management/BillingEntitiesResponse.cs b/Adyen/Model/Management/BillingEntitiesResponse.cs similarity index 100% rename from Adyen/src/Model/Management/BillingEntitiesResponse.cs rename to Adyen/Model/Management/BillingEntitiesResponse.cs diff --git a/Adyen/src/Model/Management/BillingEntity.cs b/Adyen/Model/Management/BillingEntity.cs similarity index 100% rename from Adyen/src/Model/Management/BillingEntity.cs rename to Adyen/Model/Management/BillingEntity.cs diff --git a/Adyen/src/Model/Management/CardholderReceipt.cs b/Adyen/Model/Management/CardholderReceipt.cs similarity index 100% rename from Adyen/src/Model/Management/CardholderReceipt.cs rename to Adyen/Model/Management/CardholderReceipt.cs diff --git a/Adyen/src/Model/Management/CartesBancairesInfo.cs b/Adyen/Model/Management/CartesBancairesInfo.cs similarity index 100% rename from Adyen/src/Model/Management/CartesBancairesInfo.cs rename to Adyen/Model/Management/CartesBancairesInfo.cs diff --git a/Adyen/src/Model/Management/ClearpayInfo.cs b/Adyen/Model/Management/ClearpayInfo.cs similarity index 100% rename from Adyen/src/Model/Management/ClearpayInfo.cs rename to Adyen/Model/Management/ClearpayInfo.cs diff --git a/Adyen/src/Model/Management/Commission.cs b/Adyen/Model/Management/Commission.cs similarity index 100% rename from Adyen/src/Model/Management/Commission.cs rename to Adyen/Model/Management/Commission.cs diff --git a/Adyen/src/Model/Management/Company.cs b/Adyen/Model/Management/Company.cs similarity index 100% rename from Adyen/src/Model/Management/Company.cs rename to Adyen/Model/Management/Company.cs diff --git a/Adyen/src/Model/Management/CompanyApiCredential.cs b/Adyen/Model/Management/CompanyApiCredential.cs similarity index 100% rename from Adyen/src/Model/Management/CompanyApiCredential.cs rename to Adyen/Model/Management/CompanyApiCredential.cs diff --git a/Adyen/src/Model/Management/CompanyLinks.cs b/Adyen/Model/Management/CompanyLinks.cs similarity index 100% rename from Adyen/src/Model/Management/CompanyLinks.cs rename to Adyen/Model/Management/CompanyLinks.cs diff --git a/Adyen/src/Model/Management/CompanyUser.cs b/Adyen/Model/Management/CompanyUser.cs similarity index 100% rename from Adyen/src/Model/Management/CompanyUser.cs rename to Adyen/Model/Management/CompanyUser.cs diff --git a/Adyen/src/Model/Management/Connectivity.cs b/Adyen/Model/Management/Connectivity.cs similarity index 100% rename from Adyen/src/Model/Management/Connectivity.cs rename to Adyen/Model/Management/Connectivity.cs diff --git a/Adyen/src/Model/Management/Contact.cs b/Adyen/Model/Management/Contact.cs similarity index 100% rename from Adyen/src/Model/Management/Contact.cs rename to Adyen/Model/Management/Contact.cs diff --git a/Adyen/src/Model/Management/CreateAllowedOriginRequest.cs b/Adyen/Model/Management/CreateAllowedOriginRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateAllowedOriginRequest.cs rename to Adyen/Model/Management/CreateAllowedOriginRequest.cs diff --git a/Adyen/src/Model/Management/CreateApiCredentialResponse.cs b/Adyen/Model/Management/CreateApiCredentialResponse.cs similarity index 100% rename from Adyen/src/Model/Management/CreateApiCredentialResponse.cs rename to Adyen/Model/Management/CreateApiCredentialResponse.cs diff --git a/Adyen/src/Model/Management/CreateCompanyApiCredentialRequest.cs b/Adyen/Model/Management/CreateCompanyApiCredentialRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateCompanyApiCredentialRequest.cs rename to Adyen/Model/Management/CreateCompanyApiCredentialRequest.cs diff --git a/Adyen/src/Model/Management/CreateCompanyApiCredentialResponse.cs b/Adyen/Model/Management/CreateCompanyApiCredentialResponse.cs similarity index 100% rename from Adyen/src/Model/Management/CreateCompanyApiCredentialResponse.cs rename to Adyen/Model/Management/CreateCompanyApiCredentialResponse.cs diff --git a/Adyen/src/Model/Management/CreateCompanyUserRequest.cs b/Adyen/Model/Management/CreateCompanyUserRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateCompanyUserRequest.cs rename to Adyen/Model/Management/CreateCompanyUserRequest.cs diff --git a/Adyen/src/Model/Management/CreateCompanyUserResponse.cs b/Adyen/Model/Management/CreateCompanyUserResponse.cs similarity index 100% rename from Adyen/src/Model/Management/CreateCompanyUserResponse.cs rename to Adyen/Model/Management/CreateCompanyUserResponse.cs diff --git a/Adyen/src/Model/Management/CreateCompanyWebhookRequest.cs b/Adyen/Model/Management/CreateCompanyWebhookRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateCompanyWebhookRequest.cs rename to Adyen/Model/Management/CreateCompanyWebhookRequest.cs diff --git a/Adyen/src/Model/Management/CreateMerchantApiCredentialRequest.cs b/Adyen/Model/Management/CreateMerchantApiCredentialRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateMerchantApiCredentialRequest.cs rename to Adyen/Model/Management/CreateMerchantApiCredentialRequest.cs diff --git a/Adyen/src/Model/Management/CreateMerchantRequest.cs b/Adyen/Model/Management/CreateMerchantRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateMerchantRequest.cs rename to Adyen/Model/Management/CreateMerchantRequest.cs diff --git a/Adyen/src/Model/Management/CreateMerchantResponse.cs b/Adyen/Model/Management/CreateMerchantResponse.cs similarity index 100% rename from Adyen/src/Model/Management/CreateMerchantResponse.cs rename to Adyen/Model/Management/CreateMerchantResponse.cs diff --git a/Adyen/src/Model/Management/CreateMerchantUserRequest.cs b/Adyen/Model/Management/CreateMerchantUserRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateMerchantUserRequest.cs rename to Adyen/Model/Management/CreateMerchantUserRequest.cs diff --git a/Adyen/src/Model/Management/CreateMerchantWebhookRequest.cs b/Adyen/Model/Management/CreateMerchantWebhookRequest.cs similarity index 100% rename from Adyen/src/Model/Management/CreateMerchantWebhookRequest.cs rename to Adyen/Model/Management/CreateMerchantWebhookRequest.cs diff --git a/Adyen/src/Model/Management/CreateUserResponse.cs b/Adyen/Model/Management/CreateUserResponse.cs similarity index 100% rename from Adyen/src/Model/Management/CreateUserResponse.cs rename to Adyen/Model/Management/CreateUserResponse.cs diff --git a/Adyen/src/Model/Management/Currency.cs b/Adyen/Model/Management/Currency.cs similarity index 100% rename from Adyen/src/Model/Management/Currency.cs rename to Adyen/Model/Management/Currency.cs diff --git a/Adyen/src/Model/Management/CustomNotification.cs b/Adyen/Model/Management/CustomNotification.cs similarity index 100% rename from Adyen/src/Model/Management/CustomNotification.cs rename to Adyen/Model/Management/CustomNotification.cs diff --git a/Adyen/src/Model/Management/DataCenter.cs b/Adyen/Model/Management/DataCenter.cs similarity index 100% rename from Adyen/src/Model/Management/DataCenter.cs rename to Adyen/Model/Management/DataCenter.cs diff --git a/Adyen/src/Model/Management/DinersInfo.cs b/Adyen/Model/Management/DinersInfo.cs similarity index 100% rename from Adyen/src/Model/Management/DinersInfo.cs rename to Adyen/Model/Management/DinersInfo.cs diff --git a/Adyen/src/Model/Management/EventUrl.cs b/Adyen/Model/Management/EventUrl.cs similarity index 100% rename from Adyen/src/Model/Management/EventUrl.cs rename to Adyen/Model/Management/EventUrl.cs diff --git a/Adyen/src/Model/Management/ExternalTerminalAction.cs b/Adyen/Model/Management/ExternalTerminalAction.cs similarity index 100% rename from Adyen/src/Model/Management/ExternalTerminalAction.cs rename to Adyen/Model/Management/ExternalTerminalAction.cs diff --git a/Adyen/src/Model/Management/File.cs b/Adyen/Model/Management/File.cs similarity index 100% rename from Adyen/src/Model/Management/File.cs rename to Adyen/Model/Management/File.cs diff --git a/Adyen/src/Model/Management/GenerateApiKeyResponse.cs b/Adyen/Model/Management/GenerateApiKeyResponse.cs similarity index 100% rename from Adyen/src/Model/Management/GenerateApiKeyResponse.cs rename to Adyen/Model/Management/GenerateApiKeyResponse.cs diff --git a/Adyen/src/Model/Management/GenerateClientKeyResponse.cs b/Adyen/Model/Management/GenerateClientKeyResponse.cs similarity index 100% rename from Adyen/src/Model/Management/GenerateClientKeyResponse.cs rename to Adyen/Model/Management/GenerateClientKeyResponse.cs diff --git a/Adyen/src/Model/Management/GenerateHmacKeyResponse.cs b/Adyen/Model/Management/GenerateHmacKeyResponse.cs similarity index 100% rename from Adyen/src/Model/Management/GenerateHmacKeyResponse.cs rename to Adyen/Model/Management/GenerateHmacKeyResponse.cs diff --git a/Adyen/src/Model/Management/GenericPmWithTdiInfo.cs b/Adyen/Model/Management/GenericPmWithTdiInfo.cs similarity index 100% rename from Adyen/src/Model/Management/GenericPmWithTdiInfo.cs rename to Adyen/Model/Management/GenericPmWithTdiInfo.cs diff --git a/Adyen/src/Model/Management/GiroPayInfo.cs b/Adyen/Model/Management/GiroPayInfo.cs similarity index 100% rename from Adyen/src/Model/Management/GiroPayInfo.cs rename to Adyen/Model/Management/GiroPayInfo.cs diff --git a/Adyen/src/Model/Management/GooglePayInfo.cs b/Adyen/Model/Management/GooglePayInfo.cs similarity index 100% rename from Adyen/src/Model/Management/GooglePayInfo.cs rename to Adyen/Model/Management/GooglePayInfo.cs diff --git a/Adyen/src/Model/Management/Gratuity.cs b/Adyen/Model/Management/Gratuity.cs similarity index 100% rename from Adyen/src/Model/Management/Gratuity.cs rename to Adyen/Model/Management/Gratuity.cs diff --git a/Adyen/src/Model/Management/Hardware.cs b/Adyen/Model/Management/Hardware.cs similarity index 100% rename from Adyen/src/Model/Management/Hardware.cs rename to Adyen/Model/Management/Hardware.cs diff --git a/Adyen/src/Model/Management/IdName.cs b/Adyen/Model/Management/IdName.cs similarity index 100% rename from Adyen/src/Model/Management/IdName.cs rename to Adyen/Model/Management/IdName.cs diff --git a/Adyen/src/Model/Management/InstallAndroidAppDetails.cs b/Adyen/Model/Management/InstallAndroidAppDetails.cs similarity index 100% rename from Adyen/src/Model/Management/InstallAndroidAppDetails.cs rename to Adyen/Model/Management/InstallAndroidAppDetails.cs diff --git a/Adyen/src/Model/Management/InstallAndroidCertificateDetails.cs b/Adyen/Model/Management/InstallAndroidCertificateDetails.cs similarity index 100% rename from Adyen/src/Model/Management/InstallAndroidCertificateDetails.cs rename to Adyen/Model/Management/InstallAndroidCertificateDetails.cs diff --git a/Adyen/src/Model/Management/InvalidField.cs b/Adyen/Model/Management/InvalidField.cs similarity index 100% rename from Adyen/src/Model/Management/InvalidField.cs rename to Adyen/Model/Management/InvalidField.cs diff --git a/Adyen/src/Model/Management/JCBInfo.cs b/Adyen/Model/Management/JCBInfo.cs similarity index 100% rename from Adyen/src/Model/Management/JCBInfo.cs rename to Adyen/Model/Management/JCBInfo.cs diff --git a/Adyen/src/Model/Management/Key.cs b/Adyen/Model/Management/Key.cs similarity index 100% rename from Adyen/src/Model/Management/Key.cs rename to Adyen/Model/Management/Key.cs diff --git a/Adyen/src/Model/Management/KlarnaInfo.cs b/Adyen/Model/Management/KlarnaInfo.cs similarity index 100% rename from Adyen/src/Model/Management/KlarnaInfo.cs rename to Adyen/Model/Management/KlarnaInfo.cs diff --git a/Adyen/src/Model/Management/Links.cs b/Adyen/Model/Management/Links.cs similarity index 100% rename from Adyen/src/Model/Management/Links.cs rename to Adyen/Model/Management/Links.cs diff --git a/Adyen/src/Model/Management/LinksElement.cs b/Adyen/Model/Management/LinksElement.cs similarity index 100% rename from Adyen/src/Model/Management/LinksElement.cs rename to Adyen/Model/Management/LinksElement.cs diff --git a/Adyen/src/Model/Management/ListCompanyApiCredentialsResponse.cs b/Adyen/Model/Management/ListCompanyApiCredentialsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListCompanyApiCredentialsResponse.cs rename to Adyen/Model/Management/ListCompanyApiCredentialsResponse.cs diff --git a/Adyen/src/Model/Management/ListCompanyResponse.cs b/Adyen/Model/Management/ListCompanyResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListCompanyResponse.cs rename to Adyen/Model/Management/ListCompanyResponse.cs diff --git a/Adyen/src/Model/Management/ListCompanyUsersResponse.cs b/Adyen/Model/Management/ListCompanyUsersResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListCompanyUsersResponse.cs rename to Adyen/Model/Management/ListCompanyUsersResponse.cs diff --git a/Adyen/src/Model/Management/ListExternalTerminalActionsResponse.cs b/Adyen/Model/Management/ListExternalTerminalActionsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListExternalTerminalActionsResponse.cs rename to Adyen/Model/Management/ListExternalTerminalActionsResponse.cs diff --git a/Adyen/src/Model/Management/ListMerchantApiCredentialsResponse.cs b/Adyen/Model/Management/ListMerchantApiCredentialsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListMerchantApiCredentialsResponse.cs rename to Adyen/Model/Management/ListMerchantApiCredentialsResponse.cs diff --git a/Adyen/src/Model/Management/ListMerchantResponse.cs b/Adyen/Model/Management/ListMerchantResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListMerchantResponse.cs rename to Adyen/Model/Management/ListMerchantResponse.cs diff --git a/Adyen/src/Model/Management/ListMerchantUsersResponse.cs b/Adyen/Model/Management/ListMerchantUsersResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListMerchantUsersResponse.cs rename to Adyen/Model/Management/ListMerchantUsersResponse.cs diff --git a/Adyen/src/Model/Management/ListStoresResponse.cs b/Adyen/Model/Management/ListStoresResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListStoresResponse.cs rename to Adyen/Model/Management/ListStoresResponse.cs diff --git a/Adyen/src/Model/Management/ListTerminalsResponse.cs b/Adyen/Model/Management/ListTerminalsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListTerminalsResponse.cs rename to Adyen/Model/Management/ListTerminalsResponse.cs diff --git a/Adyen/src/Model/Management/ListWebhooksResponse.cs b/Adyen/Model/Management/ListWebhooksResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ListWebhooksResponse.cs rename to Adyen/Model/Management/ListWebhooksResponse.cs diff --git a/Adyen/src/Model/Management/Localization.cs b/Adyen/Model/Management/Localization.cs similarity index 100% rename from Adyen/src/Model/Management/Localization.cs rename to Adyen/Model/Management/Localization.cs diff --git a/Adyen/src/Model/Management/Logo.cs b/Adyen/Model/Management/Logo.cs similarity index 100% rename from Adyen/src/Model/Management/Logo.cs rename to Adyen/Model/Management/Logo.cs diff --git a/Adyen/src/Model/Management/MeApiCredential.cs b/Adyen/Model/Management/MeApiCredential.cs similarity index 100% rename from Adyen/src/Model/Management/MeApiCredential.cs rename to Adyen/Model/Management/MeApiCredential.cs diff --git a/Adyen/src/Model/Management/MealVoucherFRInfo.cs b/Adyen/Model/Management/MealVoucherFRInfo.cs similarity index 100% rename from Adyen/src/Model/Management/MealVoucherFRInfo.cs rename to Adyen/Model/Management/MealVoucherFRInfo.cs diff --git a/Adyen/src/Model/Management/Merchant.cs b/Adyen/Model/Management/Merchant.cs similarity index 100% rename from Adyen/src/Model/Management/Merchant.cs rename to Adyen/Model/Management/Merchant.cs diff --git a/Adyen/src/Model/Management/MerchantLinks.cs b/Adyen/Model/Management/MerchantLinks.cs similarity index 100% rename from Adyen/src/Model/Management/MerchantLinks.cs rename to Adyen/Model/Management/MerchantLinks.cs diff --git a/Adyen/src/Model/Management/MinorUnitsMonetaryValue.cs b/Adyen/Model/Management/MinorUnitsMonetaryValue.cs similarity index 100% rename from Adyen/src/Model/Management/MinorUnitsMonetaryValue.cs rename to Adyen/Model/Management/MinorUnitsMonetaryValue.cs diff --git a/Adyen/src/Model/Management/ModelConfiguration.cs b/Adyen/Model/Management/ModelConfiguration.cs similarity index 100% rename from Adyen/src/Model/Management/ModelConfiguration.cs rename to Adyen/Model/Management/ModelConfiguration.cs diff --git a/Adyen/src/Model/Management/Name.cs b/Adyen/Model/Management/Name.cs similarity index 100% rename from Adyen/src/Model/Management/Name.cs rename to Adyen/Model/Management/Name.cs diff --git a/Adyen/src/Model/Management/Name2.cs b/Adyen/Model/Management/Name2.cs similarity index 100% rename from Adyen/src/Model/Management/Name2.cs rename to Adyen/Model/Management/Name2.cs diff --git a/Adyen/src/Model/Management/Nexo.cs b/Adyen/Model/Management/Nexo.cs similarity index 100% rename from Adyen/src/Model/Management/Nexo.cs rename to Adyen/Model/Management/Nexo.cs diff --git a/Adyen/src/Model/Management/Notification.cs b/Adyen/Model/Management/Notification.cs similarity index 100% rename from Adyen/src/Model/Management/Notification.cs rename to Adyen/Model/Management/Notification.cs diff --git a/Adyen/src/Model/Management/NotificationUrl.cs b/Adyen/Model/Management/NotificationUrl.cs similarity index 100% rename from Adyen/src/Model/Management/NotificationUrl.cs rename to Adyen/Model/Management/NotificationUrl.cs diff --git a/Adyen/src/Model/Management/NyceInfo.cs b/Adyen/Model/Management/NyceInfo.cs similarity index 100% rename from Adyen/src/Model/Management/NyceInfo.cs rename to Adyen/Model/Management/NyceInfo.cs diff --git a/Adyen/src/Model/Management/OfflineProcessing.cs b/Adyen/Model/Management/OfflineProcessing.cs similarity index 100% rename from Adyen/src/Model/Management/OfflineProcessing.cs rename to Adyen/Model/Management/OfflineProcessing.cs diff --git a/Adyen/src/Model/Management/Opi.cs b/Adyen/Model/Management/Opi.cs similarity index 100% rename from Adyen/src/Model/Management/Opi.cs rename to Adyen/Model/Management/Opi.cs diff --git a/Adyen/src/Model/Management/OrderItem.cs b/Adyen/Model/Management/OrderItem.cs similarity index 100% rename from Adyen/src/Model/Management/OrderItem.cs rename to Adyen/Model/Management/OrderItem.cs diff --git a/Adyen/src/Model/Management/PaginationLinks.cs b/Adyen/Model/Management/PaginationLinks.cs similarity index 100% rename from Adyen/src/Model/Management/PaginationLinks.cs rename to Adyen/Model/Management/PaginationLinks.cs diff --git a/Adyen/src/Model/Management/Passcodes.cs b/Adyen/Model/Management/Passcodes.cs similarity index 100% rename from Adyen/src/Model/Management/Passcodes.cs rename to Adyen/Model/Management/Passcodes.cs diff --git a/Adyen/src/Model/Management/PayAtTable.cs b/Adyen/Model/Management/PayAtTable.cs similarity index 100% rename from Adyen/src/Model/Management/PayAtTable.cs rename to Adyen/Model/Management/PayAtTable.cs diff --git a/Adyen/src/Model/Management/PayMeInfo.cs b/Adyen/Model/Management/PayMeInfo.cs similarity index 100% rename from Adyen/src/Model/Management/PayMeInfo.cs rename to Adyen/Model/Management/PayMeInfo.cs diff --git a/Adyen/src/Model/Management/PayPalInfo.cs b/Adyen/Model/Management/PayPalInfo.cs similarity index 100% rename from Adyen/src/Model/Management/PayPalInfo.cs rename to Adyen/Model/Management/PayPalInfo.cs diff --git a/Adyen/src/Model/Management/PayToInfo.cs b/Adyen/Model/Management/PayToInfo.cs similarity index 100% rename from Adyen/src/Model/Management/PayToInfo.cs rename to Adyen/Model/Management/PayToInfo.cs diff --git a/Adyen/src/Model/Management/Payment.cs b/Adyen/Model/Management/Payment.cs similarity index 100% rename from Adyen/src/Model/Management/Payment.cs rename to Adyen/Model/Management/Payment.cs diff --git a/Adyen/src/Model/Management/PaymentMethod.cs b/Adyen/Model/Management/PaymentMethod.cs similarity index 100% rename from Adyen/src/Model/Management/PaymentMethod.cs rename to Adyen/Model/Management/PaymentMethod.cs diff --git a/Adyen/src/Model/Management/PaymentMethodResponse.cs b/Adyen/Model/Management/PaymentMethodResponse.cs similarity index 100% rename from Adyen/src/Model/Management/PaymentMethodResponse.cs rename to Adyen/Model/Management/PaymentMethodResponse.cs diff --git a/Adyen/src/Model/Management/PaymentMethodSetupInfo.cs b/Adyen/Model/Management/PaymentMethodSetupInfo.cs similarity index 100% rename from Adyen/src/Model/Management/PaymentMethodSetupInfo.cs rename to Adyen/Model/Management/PaymentMethodSetupInfo.cs diff --git a/Adyen/src/Model/Management/PayoutSettings.cs b/Adyen/Model/Management/PayoutSettings.cs similarity index 100% rename from Adyen/src/Model/Management/PayoutSettings.cs rename to Adyen/Model/Management/PayoutSettings.cs diff --git a/Adyen/src/Model/Management/PayoutSettingsRequest.cs b/Adyen/Model/Management/PayoutSettingsRequest.cs similarity index 100% rename from Adyen/src/Model/Management/PayoutSettingsRequest.cs rename to Adyen/Model/Management/PayoutSettingsRequest.cs diff --git a/Adyen/src/Model/Management/PayoutSettingsResponse.cs b/Adyen/Model/Management/PayoutSettingsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/PayoutSettingsResponse.cs rename to Adyen/Model/Management/PayoutSettingsResponse.cs diff --git a/Adyen/src/Model/Management/Profile.cs b/Adyen/Model/Management/Profile.cs similarity index 100% rename from Adyen/src/Model/Management/Profile.cs rename to Adyen/Model/Management/Profile.cs diff --git a/Adyen/src/Model/Management/PulseInfo.cs b/Adyen/Model/Management/PulseInfo.cs similarity index 100% rename from Adyen/src/Model/Management/PulseInfo.cs rename to Adyen/Model/Management/PulseInfo.cs diff --git a/Adyen/src/Model/Management/ReceiptOptions.cs b/Adyen/Model/Management/ReceiptOptions.cs similarity index 100% rename from Adyen/src/Model/Management/ReceiptOptions.cs rename to Adyen/Model/Management/ReceiptOptions.cs diff --git a/Adyen/src/Model/Management/ReceiptPrinting.cs b/Adyen/Model/Management/ReceiptPrinting.cs similarity index 100% rename from Adyen/src/Model/Management/ReceiptPrinting.cs rename to Adyen/Model/Management/ReceiptPrinting.cs diff --git a/Adyen/src/Model/Management/Referenced.cs b/Adyen/Model/Management/Referenced.cs similarity index 100% rename from Adyen/src/Model/Management/Referenced.cs rename to Adyen/Model/Management/Referenced.cs diff --git a/Adyen/src/Model/Management/Refunds.cs b/Adyen/Model/Management/Refunds.cs similarity index 100% rename from Adyen/src/Model/Management/Refunds.cs rename to Adyen/Model/Management/Refunds.cs diff --git a/Adyen/src/Model/Management/ReleaseUpdateDetails.cs b/Adyen/Model/Management/ReleaseUpdateDetails.cs similarity index 100% rename from Adyen/src/Model/Management/ReleaseUpdateDetails.cs rename to Adyen/Model/Management/ReleaseUpdateDetails.cs diff --git a/Adyen/src/Model/Management/ReprocessAndroidAppResponse.cs b/Adyen/Model/Management/ReprocessAndroidAppResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ReprocessAndroidAppResponse.cs rename to Adyen/Model/Management/ReprocessAndroidAppResponse.cs diff --git a/Adyen/src/Model/Management/RequestActivationResponse.cs b/Adyen/Model/Management/RequestActivationResponse.cs similarity index 100% rename from Adyen/src/Model/Management/RequestActivationResponse.cs rename to Adyen/Model/Management/RequestActivationResponse.cs diff --git a/Adyen/src/Model/Management/RestServiceError.cs b/Adyen/Model/Management/RestServiceError.cs similarity index 100% rename from Adyen/src/Model/Management/RestServiceError.cs rename to Adyen/Model/Management/RestServiceError.cs diff --git a/Adyen/src/Model/Management/ScheduleTerminalActionsRequest.cs b/Adyen/Model/Management/ScheduleTerminalActionsRequest.cs similarity index 100% rename from Adyen/src/Model/Management/ScheduleTerminalActionsRequest.cs rename to Adyen/Model/Management/ScheduleTerminalActionsRequest.cs diff --git a/Adyen/src/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs b/Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs similarity index 100% rename from Adyen/src/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs rename to Adyen/Model/Management/ScheduleTerminalActionsRequestActionDetails.cs diff --git a/Adyen/src/Model/Management/ScheduleTerminalActionsResponse.cs b/Adyen/Model/Management/ScheduleTerminalActionsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ScheduleTerminalActionsResponse.cs rename to Adyen/Model/Management/ScheduleTerminalActionsResponse.cs diff --git a/Adyen/src/Model/Management/Settings.cs b/Adyen/Model/Management/Settings.cs similarity index 100% rename from Adyen/src/Model/Management/Settings.cs rename to Adyen/Model/Management/Settings.cs diff --git a/Adyen/src/Model/Management/ShippingLocation.cs b/Adyen/Model/Management/ShippingLocation.cs similarity index 100% rename from Adyen/src/Model/Management/ShippingLocation.cs rename to Adyen/Model/Management/ShippingLocation.cs diff --git a/Adyen/src/Model/Management/ShippingLocationsResponse.cs b/Adyen/Model/Management/ShippingLocationsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/ShippingLocationsResponse.cs rename to Adyen/Model/Management/ShippingLocationsResponse.cs diff --git a/Adyen/src/Model/Management/Signature.cs b/Adyen/Model/Management/Signature.cs similarity index 100% rename from Adyen/src/Model/Management/Signature.cs rename to Adyen/Model/Management/Signature.cs diff --git a/Adyen/src/Model/Management/SodexoInfo.cs b/Adyen/Model/Management/SodexoInfo.cs similarity index 100% rename from Adyen/src/Model/Management/SodexoInfo.cs rename to Adyen/Model/Management/SodexoInfo.cs diff --git a/Adyen/src/Model/Management/SofortInfo.cs b/Adyen/Model/Management/SofortInfo.cs similarity index 100% rename from Adyen/src/Model/Management/SofortInfo.cs rename to Adyen/Model/Management/SofortInfo.cs diff --git a/Adyen/src/Model/Management/SplitConfiguration.cs b/Adyen/Model/Management/SplitConfiguration.cs similarity index 100% rename from Adyen/src/Model/Management/SplitConfiguration.cs rename to Adyen/Model/Management/SplitConfiguration.cs diff --git a/Adyen/src/Model/Management/SplitConfigurationList.cs b/Adyen/Model/Management/SplitConfigurationList.cs similarity index 100% rename from Adyen/src/Model/Management/SplitConfigurationList.cs rename to Adyen/Model/Management/SplitConfigurationList.cs diff --git a/Adyen/src/Model/Management/SplitConfigurationLogic.cs b/Adyen/Model/Management/SplitConfigurationLogic.cs similarity index 100% rename from Adyen/src/Model/Management/SplitConfigurationLogic.cs rename to Adyen/Model/Management/SplitConfigurationLogic.cs diff --git a/Adyen/src/Model/Management/SplitConfigurationRule.cs b/Adyen/Model/Management/SplitConfigurationRule.cs similarity index 100% rename from Adyen/src/Model/Management/SplitConfigurationRule.cs rename to Adyen/Model/Management/SplitConfigurationRule.cs diff --git a/Adyen/src/Model/Management/Standalone.cs b/Adyen/Model/Management/Standalone.cs similarity index 100% rename from Adyen/src/Model/Management/Standalone.cs rename to Adyen/Model/Management/Standalone.cs diff --git a/Adyen/src/Model/Management/StarInfo.cs b/Adyen/Model/Management/StarInfo.cs similarity index 100% rename from Adyen/src/Model/Management/StarInfo.cs rename to Adyen/Model/Management/StarInfo.cs diff --git a/Adyen/src/Model/Management/Store.cs b/Adyen/Model/Management/Store.cs similarity index 100% rename from Adyen/src/Model/Management/Store.cs rename to Adyen/Model/Management/Store.cs diff --git a/Adyen/src/Model/Management/StoreAndForward.cs b/Adyen/Model/Management/StoreAndForward.cs similarity index 100% rename from Adyen/src/Model/Management/StoreAndForward.cs rename to Adyen/Model/Management/StoreAndForward.cs diff --git a/Adyen/src/Model/Management/StoreCreationRequest.cs b/Adyen/Model/Management/StoreCreationRequest.cs similarity index 100% rename from Adyen/src/Model/Management/StoreCreationRequest.cs rename to Adyen/Model/Management/StoreCreationRequest.cs diff --git a/Adyen/src/Model/Management/StoreCreationWithMerchantCodeRequest.cs b/Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.cs similarity index 100% rename from Adyen/src/Model/Management/StoreCreationWithMerchantCodeRequest.cs rename to Adyen/Model/Management/StoreCreationWithMerchantCodeRequest.cs diff --git a/Adyen/src/Model/Management/StoreLocation.cs b/Adyen/Model/Management/StoreLocation.cs similarity index 100% rename from Adyen/src/Model/Management/StoreLocation.cs rename to Adyen/Model/Management/StoreLocation.cs diff --git a/Adyen/src/Model/Management/StoreSplitConfiguration.cs b/Adyen/Model/Management/StoreSplitConfiguration.cs similarity index 100% rename from Adyen/src/Model/Management/StoreSplitConfiguration.cs rename to Adyen/Model/Management/StoreSplitConfiguration.cs diff --git a/Adyen/src/Model/Management/SupportedCardTypes.cs b/Adyen/Model/Management/SupportedCardTypes.cs similarity index 100% rename from Adyen/src/Model/Management/SupportedCardTypes.cs rename to Adyen/Model/Management/SupportedCardTypes.cs diff --git a/Adyen/src/Model/Management/Surcharge.cs b/Adyen/Model/Management/Surcharge.cs similarity index 100% rename from Adyen/src/Model/Management/Surcharge.cs rename to Adyen/Model/Management/Surcharge.cs diff --git a/Adyen/src/Model/Management/SwishInfo.cs b/Adyen/Model/Management/SwishInfo.cs similarity index 100% rename from Adyen/src/Model/Management/SwishInfo.cs rename to Adyen/Model/Management/SwishInfo.cs diff --git a/Adyen/src/Model/Management/TapToPay.cs b/Adyen/Model/Management/TapToPay.cs similarity index 100% rename from Adyen/src/Model/Management/TapToPay.cs rename to Adyen/Model/Management/TapToPay.cs diff --git a/Adyen/src/Model/Management/Terminal.cs b/Adyen/Model/Management/Terminal.cs similarity index 100% rename from Adyen/src/Model/Management/Terminal.cs rename to Adyen/Model/Management/Terminal.cs diff --git a/Adyen/src/Model/Management/TerminalActionScheduleDetail.cs b/Adyen/Model/Management/TerminalActionScheduleDetail.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalActionScheduleDetail.cs rename to Adyen/Model/Management/TerminalActionScheduleDetail.cs diff --git a/Adyen/src/Model/Management/TerminalAssignment.cs b/Adyen/Model/Management/TerminalAssignment.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalAssignment.cs rename to Adyen/Model/Management/TerminalAssignment.cs diff --git a/Adyen/src/Model/Management/TerminalConnectivity.cs b/Adyen/Model/Management/TerminalConnectivity.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalConnectivity.cs rename to Adyen/Model/Management/TerminalConnectivity.cs diff --git a/Adyen/src/Model/Management/TerminalConnectivityBluetooth.cs b/Adyen/Model/Management/TerminalConnectivityBluetooth.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalConnectivityBluetooth.cs rename to Adyen/Model/Management/TerminalConnectivityBluetooth.cs diff --git a/Adyen/src/Model/Management/TerminalConnectivityCellular.cs b/Adyen/Model/Management/TerminalConnectivityCellular.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalConnectivityCellular.cs rename to Adyen/Model/Management/TerminalConnectivityCellular.cs diff --git a/Adyen/src/Model/Management/TerminalConnectivityEthernet.cs b/Adyen/Model/Management/TerminalConnectivityEthernet.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalConnectivityEthernet.cs rename to Adyen/Model/Management/TerminalConnectivityEthernet.cs diff --git a/Adyen/src/Model/Management/TerminalConnectivityWifi.cs b/Adyen/Model/Management/TerminalConnectivityWifi.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalConnectivityWifi.cs rename to Adyen/Model/Management/TerminalConnectivityWifi.cs diff --git a/Adyen/src/Model/Management/TerminalInstructions.cs b/Adyen/Model/Management/TerminalInstructions.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalInstructions.cs rename to Adyen/Model/Management/TerminalInstructions.cs diff --git a/Adyen/src/Model/Management/TerminalModelsResponse.cs b/Adyen/Model/Management/TerminalModelsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalModelsResponse.cs rename to Adyen/Model/Management/TerminalModelsResponse.cs diff --git a/Adyen/src/Model/Management/TerminalOrder.cs b/Adyen/Model/Management/TerminalOrder.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalOrder.cs rename to Adyen/Model/Management/TerminalOrder.cs diff --git a/Adyen/src/Model/Management/TerminalOrderRequest.cs b/Adyen/Model/Management/TerminalOrderRequest.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalOrderRequest.cs rename to Adyen/Model/Management/TerminalOrderRequest.cs diff --git a/Adyen/src/Model/Management/TerminalOrdersResponse.cs b/Adyen/Model/Management/TerminalOrdersResponse.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalOrdersResponse.cs rename to Adyen/Model/Management/TerminalOrdersResponse.cs diff --git a/Adyen/src/Model/Management/TerminalProduct.cs b/Adyen/Model/Management/TerminalProduct.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalProduct.cs rename to Adyen/Model/Management/TerminalProduct.cs diff --git a/Adyen/src/Model/Management/TerminalProductPrice.cs b/Adyen/Model/Management/TerminalProductPrice.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalProductPrice.cs rename to Adyen/Model/Management/TerminalProductPrice.cs diff --git a/Adyen/src/Model/Management/TerminalProductsResponse.cs b/Adyen/Model/Management/TerminalProductsResponse.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalProductsResponse.cs rename to Adyen/Model/Management/TerminalProductsResponse.cs diff --git a/Adyen/src/Model/Management/TerminalReassignmentRequest.cs b/Adyen/Model/Management/TerminalReassignmentRequest.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalReassignmentRequest.cs rename to Adyen/Model/Management/TerminalReassignmentRequest.cs diff --git a/Adyen/src/Model/Management/TerminalReassignmentTarget.cs b/Adyen/Model/Management/TerminalReassignmentTarget.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalReassignmentTarget.cs rename to Adyen/Model/Management/TerminalReassignmentTarget.cs diff --git a/Adyen/src/Model/Management/TerminalSettings.cs b/Adyen/Model/Management/TerminalSettings.cs similarity index 100% rename from Adyen/src/Model/Management/TerminalSettings.cs rename to Adyen/Model/Management/TerminalSettings.cs diff --git a/Adyen/src/Model/Management/TestCompanyWebhookRequest.cs b/Adyen/Model/Management/TestCompanyWebhookRequest.cs similarity index 100% rename from Adyen/src/Model/Management/TestCompanyWebhookRequest.cs rename to Adyen/Model/Management/TestCompanyWebhookRequest.cs diff --git a/Adyen/src/Model/Management/TestOutput.cs b/Adyen/Model/Management/TestOutput.cs similarity index 100% rename from Adyen/src/Model/Management/TestOutput.cs rename to Adyen/Model/Management/TestOutput.cs diff --git a/Adyen/src/Model/Management/TestWebhookRequest.cs b/Adyen/Model/Management/TestWebhookRequest.cs similarity index 100% rename from Adyen/src/Model/Management/TestWebhookRequest.cs rename to Adyen/Model/Management/TestWebhookRequest.cs diff --git a/Adyen/src/Model/Management/TestWebhookResponse.cs b/Adyen/Model/Management/TestWebhookResponse.cs similarity index 100% rename from Adyen/src/Model/Management/TestWebhookResponse.cs rename to Adyen/Model/Management/TestWebhookResponse.cs diff --git a/Adyen/src/Model/Management/TicketInfo.cs b/Adyen/Model/Management/TicketInfo.cs similarity index 100% rename from Adyen/src/Model/Management/TicketInfo.cs rename to Adyen/Model/Management/TicketInfo.cs diff --git a/Adyen/src/Model/Management/Timeouts.cs b/Adyen/Model/Management/Timeouts.cs similarity index 100% rename from Adyen/src/Model/Management/Timeouts.cs rename to Adyen/Model/Management/Timeouts.cs diff --git a/Adyen/src/Model/Management/TransactionDescriptionInfo.cs b/Adyen/Model/Management/TransactionDescriptionInfo.cs similarity index 100% rename from Adyen/src/Model/Management/TransactionDescriptionInfo.cs rename to Adyen/Model/Management/TransactionDescriptionInfo.cs diff --git a/Adyen/src/Model/Management/TwintInfo.cs b/Adyen/Model/Management/TwintInfo.cs similarity index 100% rename from Adyen/src/Model/Management/TwintInfo.cs rename to Adyen/Model/Management/TwintInfo.cs diff --git a/Adyen/src/Model/Management/UninstallAndroidAppDetails.cs b/Adyen/Model/Management/UninstallAndroidAppDetails.cs similarity index 100% rename from Adyen/src/Model/Management/UninstallAndroidAppDetails.cs rename to Adyen/Model/Management/UninstallAndroidAppDetails.cs diff --git a/Adyen/src/Model/Management/UninstallAndroidCertificateDetails.cs b/Adyen/Model/Management/UninstallAndroidCertificateDetails.cs similarity index 100% rename from Adyen/src/Model/Management/UninstallAndroidCertificateDetails.cs rename to Adyen/Model/Management/UninstallAndroidCertificateDetails.cs diff --git a/Adyen/src/Model/Management/UpdatableAddress.cs b/Adyen/Model/Management/UpdatableAddress.cs similarity index 100% rename from Adyen/src/Model/Management/UpdatableAddress.cs rename to Adyen/Model/Management/UpdatableAddress.cs diff --git a/Adyen/src/Model/Management/UpdateCompanyApiCredentialRequest.cs b/Adyen/Model/Management/UpdateCompanyApiCredentialRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateCompanyApiCredentialRequest.cs rename to Adyen/Model/Management/UpdateCompanyApiCredentialRequest.cs diff --git a/Adyen/src/Model/Management/UpdateCompanyUserRequest.cs b/Adyen/Model/Management/UpdateCompanyUserRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateCompanyUserRequest.cs rename to Adyen/Model/Management/UpdateCompanyUserRequest.cs diff --git a/Adyen/src/Model/Management/UpdateCompanyWebhookRequest.cs b/Adyen/Model/Management/UpdateCompanyWebhookRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateCompanyWebhookRequest.cs rename to Adyen/Model/Management/UpdateCompanyWebhookRequest.cs diff --git a/Adyen/src/Model/Management/UpdateMerchantApiCredentialRequest.cs b/Adyen/Model/Management/UpdateMerchantApiCredentialRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateMerchantApiCredentialRequest.cs rename to Adyen/Model/Management/UpdateMerchantApiCredentialRequest.cs diff --git a/Adyen/src/Model/Management/UpdateMerchantUserRequest.cs b/Adyen/Model/Management/UpdateMerchantUserRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateMerchantUserRequest.cs rename to Adyen/Model/Management/UpdateMerchantUserRequest.cs diff --git a/Adyen/src/Model/Management/UpdateMerchantWebhookRequest.cs b/Adyen/Model/Management/UpdateMerchantWebhookRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateMerchantWebhookRequest.cs rename to Adyen/Model/Management/UpdateMerchantWebhookRequest.cs diff --git a/Adyen/src/Model/Management/UpdatePaymentMethodInfo.cs b/Adyen/Model/Management/UpdatePaymentMethodInfo.cs similarity index 100% rename from Adyen/src/Model/Management/UpdatePaymentMethodInfo.cs rename to Adyen/Model/Management/UpdatePaymentMethodInfo.cs diff --git a/Adyen/src/Model/Management/UpdatePayoutSettingsRequest.cs b/Adyen/Model/Management/UpdatePayoutSettingsRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdatePayoutSettingsRequest.cs rename to Adyen/Model/Management/UpdatePayoutSettingsRequest.cs diff --git a/Adyen/src/Model/Management/UpdateSplitConfigurationLogicRequest.cs b/Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateSplitConfigurationLogicRequest.cs rename to Adyen/Model/Management/UpdateSplitConfigurationLogicRequest.cs diff --git a/Adyen/src/Model/Management/UpdateSplitConfigurationRequest.cs b/Adyen/Model/Management/UpdateSplitConfigurationRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateSplitConfigurationRequest.cs rename to Adyen/Model/Management/UpdateSplitConfigurationRequest.cs diff --git a/Adyen/src/Model/Management/UpdateSplitConfigurationRuleRequest.cs b/Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateSplitConfigurationRuleRequest.cs rename to Adyen/Model/Management/UpdateSplitConfigurationRuleRequest.cs diff --git a/Adyen/src/Model/Management/UpdateStoreRequest.cs b/Adyen/Model/Management/UpdateStoreRequest.cs similarity index 100% rename from Adyen/src/Model/Management/UpdateStoreRequest.cs rename to Adyen/Model/Management/UpdateStoreRequest.cs diff --git a/Adyen/src/Model/Management/UploadAndroidAppResponse.cs b/Adyen/Model/Management/UploadAndroidAppResponse.cs similarity index 100% rename from Adyen/src/Model/Management/UploadAndroidAppResponse.cs rename to Adyen/Model/Management/UploadAndroidAppResponse.cs diff --git a/Adyen/src/Model/Management/UploadAndroidCertificateResponse.cs b/Adyen/Model/Management/UploadAndroidCertificateResponse.cs similarity index 100% rename from Adyen/src/Model/Management/UploadAndroidCertificateResponse.cs rename to Adyen/Model/Management/UploadAndroidCertificateResponse.cs diff --git a/Adyen/src/Model/Management/Url.cs b/Adyen/Model/Management/Url.cs similarity index 100% rename from Adyen/src/Model/Management/Url.cs rename to Adyen/Model/Management/Url.cs diff --git a/Adyen/src/Model/Management/User.cs b/Adyen/Model/Management/User.cs similarity index 100% rename from Adyen/src/Model/Management/User.cs rename to Adyen/Model/Management/User.cs diff --git a/Adyen/src/Model/Management/VippsInfo.cs b/Adyen/Model/Management/VippsInfo.cs similarity index 100% rename from Adyen/src/Model/Management/VippsInfo.cs rename to Adyen/Model/Management/VippsInfo.cs diff --git a/Adyen/src/Model/Management/WeChatPayInfo.cs b/Adyen/Model/Management/WeChatPayInfo.cs similarity index 100% rename from Adyen/src/Model/Management/WeChatPayInfo.cs rename to Adyen/Model/Management/WeChatPayInfo.cs diff --git a/Adyen/src/Model/Management/WeChatPayPosInfo.cs b/Adyen/Model/Management/WeChatPayPosInfo.cs similarity index 100% rename from Adyen/src/Model/Management/WeChatPayPosInfo.cs rename to Adyen/Model/Management/WeChatPayPosInfo.cs diff --git a/Adyen/src/Model/Management/Webhook.cs b/Adyen/Model/Management/Webhook.cs similarity index 100% rename from Adyen/src/Model/Management/Webhook.cs rename to Adyen/Model/Management/Webhook.cs diff --git a/Adyen/src/Model/Management/WebhookLinks.cs b/Adyen/Model/Management/WebhookLinks.cs similarity index 100% rename from Adyen/src/Model/Management/WebhookLinks.cs rename to Adyen/Model/Management/WebhookLinks.cs diff --git a/Adyen/src/Model/Management/WifiProfiles.cs b/Adyen/Model/Management/WifiProfiles.cs similarity index 100% rename from Adyen/src/Model/Management/WifiProfiles.cs rename to Adyen/Model/Management/WifiProfiles.cs diff --git a/Adyen/src/Model/ManagementWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/ManagementWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/ManagementWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/ManagementWebhooks/AccountCapabilityData.cs b/Adyen/Model/ManagementWebhooks/AccountCapabilityData.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/AccountCapabilityData.cs rename to Adyen/Model/ManagementWebhooks/AccountCapabilityData.cs diff --git a/Adyen/src/Model/ManagementWebhooks/AccountCreateNotificationData.cs b/Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/AccountCreateNotificationData.cs rename to Adyen/Model/ManagementWebhooks/AccountCreateNotificationData.cs diff --git a/Adyen/src/Model/ManagementWebhooks/AccountNotificationResponse.cs b/Adyen/Model/ManagementWebhooks/AccountNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/AccountNotificationResponse.cs rename to Adyen/Model/ManagementWebhooks/AccountNotificationResponse.cs diff --git a/Adyen/src/Model/ManagementWebhooks/AccountUpdateNotificationData.cs b/Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/AccountUpdateNotificationData.cs rename to Adyen/Model/ManagementWebhooks/AccountUpdateNotificationData.cs diff --git a/Adyen/src/Model/ManagementWebhooks/CapabilityProblem.cs b/Adyen/Model/ManagementWebhooks/CapabilityProblem.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/CapabilityProblem.cs rename to Adyen/Model/ManagementWebhooks/CapabilityProblem.cs diff --git a/Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntity.cs b/Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntity.cs rename to Adyen/Model/ManagementWebhooks/CapabilityProblemEntity.cs diff --git a/Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs b/Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs rename to Adyen/Model/ManagementWebhooks/CapabilityProblemEntityRecursive.cs diff --git a/Adyen/src/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/MerchantCreatedNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/MerchantUpdatedNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/MidServiceNotificationData.cs b/Adyen/Model/ManagementWebhooks/MidServiceNotificationData.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/MidServiceNotificationData.cs rename to Adyen/Model/ManagementWebhooks/MidServiceNotificationData.cs diff --git a/Adyen/src/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/PaymentMethodCreatedNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs b/Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs rename to Adyen/Model/ManagementWebhooks/PaymentMethodNotificationResponse.cs diff --git a/Adyen/src/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/PaymentMethodRequestRemovedNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/PaymentMethodScheduledForRemovalNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/RemediatingAction.cs b/Adyen/Model/ManagementWebhooks/RemediatingAction.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/RemediatingAction.cs rename to Adyen/Model/ManagementWebhooks/RemediatingAction.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs b/Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs rename to Adyen/Model/ManagementWebhooks/TerminalAssignmentNotificationResponse.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalBoardingData.cs b/Adyen/Model/ManagementWebhooks/TerminalBoardingData.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalBoardingData.cs rename to Adyen/Model/ManagementWebhooks/TerminalBoardingData.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs b/Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs rename to Adyen/Model/ManagementWebhooks/TerminalBoardingNotificationResponse.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalSettingsData.cs b/Adyen/Model/ManagementWebhooks/TerminalSettingsData.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalSettingsData.cs rename to Adyen/Model/ManagementWebhooks/TerminalSettingsData.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs b/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs rename to Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationRequest.cs diff --git a/Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs b/Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs rename to Adyen/Model/ManagementWebhooks/TerminalSettingsNotificationResponse.cs diff --git a/Adyen/src/Model/ManagementWebhooks/VerificationError.cs b/Adyen/Model/ManagementWebhooks/VerificationError.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/VerificationError.cs rename to Adyen/Model/ManagementWebhooks/VerificationError.cs diff --git a/Adyen/src/Model/ManagementWebhooks/VerificationErrorRecursive.cs b/Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.cs similarity index 100% rename from Adyen/src/Model/ManagementWebhooks/VerificationErrorRecursive.cs rename to Adyen/Model/ManagementWebhooks/VerificationErrorRecursive.cs diff --git a/Adyen/src/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/NegativeBalanceWarningWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/NegativeBalanceWarningWebhooks/Amount.cs b/Adyen/Model/NegativeBalanceWarningWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/NegativeBalanceWarningWebhooks/Amount.cs rename to Adyen/Model/NegativeBalanceWarningWebhooks/Amount.cs diff --git a/Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs b/Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs similarity index 100% rename from Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs rename to Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationData.cs diff --git a/Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs b/Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs rename to Adyen/Model/NegativeBalanceWarningWebhooks/NegativeBalanceCompensationWarningNotificationRequest.cs diff --git a/Adyen/src/Model/NegativeBalanceWarningWebhooks/Resource.cs b/Adyen/Model/NegativeBalanceWarningWebhooks/Resource.cs similarity index 100% rename from Adyen/src/Model/NegativeBalanceWarningWebhooks/Resource.cs rename to Adyen/Model/NegativeBalanceWarningWebhooks/Resource.cs diff --git a/Adyen/src/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs b/Adyen/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/src/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs rename to Adyen/Model/NegativeBalanceWarningWebhooks/ResourceReference.cs diff --git a/Adyen/src/Model/Notification/NotificationRequest.cs b/Adyen/Model/Notification/NotificationRequest.cs similarity index 100% rename from Adyen/src/Model/Notification/NotificationRequest.cs rename to Adyen/Model/Notification/NotificationRequest.cs diff --git a/Adyen/src/Model/Notification/NotificationRequestConst.cs b/Adyen/Model/Notification/NotificationRequestConst.cs similarity index 100% rename from Adyen/src/Model/Notification/NotificationRequestConst.cs rename to Adyen/Model/Notification/NotificationRequestConst.cs diff --git a/Adyen/src/Model/Notification/NotificationRequestItem.cs b/Adyen/Model/Notification/NotificationRequestItem.cs similarity index 100% rename from Adyen/src/Model/Notification/NotificationRequestItem.cs rename to Adyen/Model/Notification/NotificationRequestItem.cs diff --git a/Adyen/src/Model/Notification/NotificationRequestItemContainer.cs b/Adyen/Model/Notification/NotificationRequestItemContainer.cs similarity index 100% rename from Adyen/src/Model/Notification/NotificationRequestItemContainer.cs rename to Adyen/Model/Notification/NotificationRequestItemContainer.cs diff --git a/Adyen/src/Model/Payment/AbstractOpenAPISchema.cs b/Adyen/Model/Payment/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Payment/AbstractOpenAPISchema.cs rename to Adyen/Model/Payment/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Payment/AccountInfo.cs b/Adyen/Model/Payment/AccountInfo.cs similarity index 100% rename from Adyen/src/Model/Payment/AccountInfo.cs rename to Adyen/Model/Payment/AccountInfo.cs diff --git a/Adyen/src/Model/Payment/AcctInfo.cs b/Adyen/Model/Payment/AcctInfo.cs similarity index 100% rename from Adyen/src/Model/Payment/AcctInfo.cs rename to Adyen/Model/Payment/AcctInfo.cs diff --git a/Adyen/src/Model/Payment/AdditionalData3DSecure.cs b/Adyen/Model/Payment/AdditionalData3DSecure.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalData3DSecure.cs rename to Adyen/Model/Payment/AdditionalData3DSecure.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataAirline.cs b/Adyen/Model/Payment/AdditionalDataAirline.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataAirline.cs rename to Adyen/Model/Payment/AdditionalDataAirline.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataCarRental.cs b/Adyen/Model/Payment/AdditionalDataCarRental.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataCarRental.cs rename to Adyen/Model/Payment/AdditionalDataCarRental.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataCommon.cs b/Adyen/Model/Payment/AdditionalDataCommon.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataCommon.cs rename to Adyen/Model/Payment/AdditionalDataCommon.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataLevel23.cs b/Adyen/Model/Payment/AdditionalDataLevel23.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataLevel23.cs rename to Adyen/Model/Payment/AdditionalDataLevel23.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataLodging.cs b/Adyen/Model/Payment/AdditionalDataLodging.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataLodging.cs rename to Adyen/Model/Payment/AdditionalDataLodging.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataModifications.cs b/Adyen/Model/Payment/AdditionalDataModifications.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataModifications.cs rename to Adyen/Model/Payment/AdditionalDataModifications.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataOpenInvoice.cs b/Adyen/Model/Payment/AdditionalDataOpenInvoice.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataOpenInvoice.cs rename to Adyen/Model/Payment/AdditionalDataOpenInvoice.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataOpi.cs b/Adyen/Model/Payment/AdditionalDataOpi.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataOpi.cs rename to Adyen/Model/Payment/AdditionalDataOpi.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataRatepay.cs b/Adyen/Model/Payment/AdditionalDataRatepay.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataRatepay.cs rename to Adyen/Model/Payment/AdditionalDataRatepay.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataRetry.cs b/Adyen/Model/Payment/AdditionalDataRetry.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataRetry.cs rename to Adyen/Model/Payment/AdditionalDataRetry.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataRisk.cs b/Adyen/Model/Payment/AdditionalDataRisk.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataRisk.cs rename to Adyen/Model/Payment/AdditionalDataRisk.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataRiskStandalone.cs b/Adyen/Model/Payment/AdditionalDataRiskStandalone.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataRiskStandalone.cs rename to Adyen/Model/Payment/AdditionalDataRiskStandalone.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataSubMerchant.cs b/Adyen/Model/Payment/AdditionalDataSubMerchant.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataSubMerchant.cs rename to Adyen/Model/Payment/AdditionalDataSubMerchant.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataTemporaryServices.cs b/Adyen/Model/Payment/AdditionalDataTemporaryServices.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataTemporaryServices.cs rename to Adyen/Model/Payment/AdditionalDataTemporaryServices.cs diff --git a/Adyen/src/Model/Payment/AdditionalDataWallets.cs b/Adyen/Model/Payment/AdditionalDataWallets.cs similarity index 100% rename from Adyen/src/Model/Payment/AdditionalDataWallets.cs rename to Adyen/Model/Payment/AdditionalDataWallets.cs diff --git a/Adyen/src/Model/Payment/Address.cs b/Adyen/Model/Payment/Address.cs similarity index 100% rename from Adyen/src/Model/Payment/Address.cs rename to Adyen/Model/Payment/Address.cs diff --git a/Adyen/src/Model/Payment/AdjustAuthorisationRequest.cs b/Adyen/Model/Payment/AdjustAuthorisationRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/AdjustAuthorisationRequest.cs rename to Adyen/Model/Payment/AdjustAuthorisationRequest.cs diff --git a/Adyen/src/Model/Payment/Amount.cs b/Adyen/Model/Payment/Amount.cs similarity index 100% rename from Adyen/src/Model/Payment/Amount.cs rename to Adyen/Model/Payment/Amount.cs diff --git a/Adyen/src/Model/Payment/ApplicationInfo.cs b/Adyen/Model/Payment/ApplicationInfo.cs similarity index 100% rename from Adyen/src/Model/Payment/ApplicationInfo.cs rename to Adyen/Model/Payment/ApplicationInfo.cs diff --git a/Adyen/src/Model/Payment/AuthenticationResultRequest.cs b/Adyen/Model/Payment/AuthenticationResultRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/AuthenticationResultRequest.cs rename to Adyen/Model/Payment/AuthenticationResultRequest.cs diff --git a/Adyen/src/Model/Payment/AuthenticationResultResponse.cs b/Adyen/Model/Payment/AuthenticationResultResponse.cs similarity index 100% rename from Adyen/src/Model/Payment/AuthenticationResultResponse.cs rename to Adyen/Model/Payment/AuthenticationResultResponse.cs diff --git a/Adyen/src/Model/Payment/BankAccount.cs b/Adyen/Model/Payment/BankAccount.cs similarity index 100% rename from Adyen/src/Model/Payment/BankAccount.cs rename to Adyen/Model/Payment/BankAccount.cs diff --git a/Adyen/src/Model/Payment/BrowserInfo.cs b/Adyen/Model/Payment/BrowserInfo.cs similarity index 100% rename from Adyen/src/Model/Payment/BrowserInfo.cs rename to Adyen/Model/Payment/BrowserInfo.cs diff --git a/Adyen/src/Model/Payment/CancelOrRefundRequest.cs b/Adyen/Model/Payment/CancelOrRefundRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/CancelOrRefundRequest.cs rename to Adyen/Model/Payment/CancelOrRefundRequest.cs diff --git a/Adyen/src/Model/Payment/CancelRequest.cs b/Adyen/Model/Payment/CancelRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/CancelRequest.cs rename to Adyen/Model/Payment/CancelRequest.cs diff --git a/Adyen/src/Model/Payment/CaptureRequest.cs b/Adyen/Model/Payment/CaptureRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/CaptureRequest.cs rename to Adyen/Model/Payment/CaptureRequest.cs diff --git a/Adyen/src/Model/Payment/Card.cs b/Adyen/Model/Payment/Card.cs similarity index 100% rename from Adyen/src/Model/Payment/Card.cs rename to Adyen/Model/Payment/Card.cs diff --git a/Adyen/src/Model/Payment/CommonField.cs b/Adyen/Model/Payment/CommonField.cs similarity index 100% rename from Adyen/src/Model/Payment/CommonField.cs rename to Adyen/Model/Payment/CommonField.cs diff --git a/Adyen/src/Model/Payment/DeviceRenderOptions.cs b/Adyen/Model/Payment/DeviceRenderOptions.cs similarity index 100% rename from Adyen/src/Model/Payment/DeviceRenderOptions.cs rename to Adyen/Model/Payment/DeviceRenderOptions.cs diff --git a/Adyen/src/Model/Payment/DonationRequest.cs b/Adyen/Model/Payment/DonationRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/DonationRequest.cs rename to Adyen/Model/Payment/DonationRequest.cs diff --git a/Adyen/src/Model/Payment/ExternalPlatform.cs b/Adyen/Model/Payment/ExternalPlatform.cs similarity index 100% rename from Adyen/src/Model/Payment/ExternalPlatform.cs rename to Adyen/Model/Payment/ExternalPlatform.cs diff --git a/Adyen/src/Model/Payment/ForexQuote.cs b/Adyen/Model/Payment/ForexQuote.cs similarity index 100% rename from Adyen/src/Model/Payment/ForexQuote.cs rename to Adyen/Model/Payment/ForexQuote.cs diff --git a/Adyen/src/Model/Payment/FraudCheckResult.cs b/Adyen/Model/Payment/FraudCheckResult.cs similarity index 100% rename from Adyen/src/Model/Payment/FraudCheckResult.cs rename to Adyen/Model/Payment/FraudCheckResult.cs diff --git a/Adyen/src/Model/Payment/FraudCheckResultWrapper.cs b/Adyen/Model/Payment/FraudCheckResultWrapper.cs similarity index 100% rename from Adyen/src/Model/Payment/FraudCheckResultWrapper.cs rename to Adyen/Model/Payment/FraudCheckResultWrapper.cs diff --git a/Adyen/src/Model/Payment/FraudResult.cs b/Adyen/Model/Payment/FraudResult.cs similarity index 100% rename from Adyen/src/Model/Payment/FraudResult.cs rename to Adyen/Model/Payment/FraudResult.cs diff --git a/Adyen/src/Model/Payment/FundDestination.cs b/Adyen/Model/Payment/FundDestination.cs similarity index 100% rename from Adyen/src/Model/Payment/FundDestination.cs rename to Adyen/Model/Payment/FundDestination.cs diff --git a/Adyen/src/Model/Payment/FundSource.cs b/Adyen/Model/Payment/FundSource.cs similarity index 100% rename from Adyen/src/Model/Payment/FundSource.cs rename to Adyen/Model/Payment/FundSource.cs diff --git a/Adyen/src/Model/Payment/Installments.cs b/Adyen/Model/Payment/Installments.cs similarity index 100% rename from Adyen/src/Model/Payment/Installments.cs rename to Adyen/Model/Payment/Installments.cs diff --git a/Adyen/src/Model/Payment/Mandate.cs b/Adyen/Model/Payment/Mandate.cs similarity index 100% rename from Adyen/src/Model/Payment/Mandate.cs rename to Adyen/Model/Payment/Mandate.cs diff --git a/Adyen/src/Model/Payment/MerchantDevice.cs b/Adyen/Model/Payment/MerchantDevice.cs similarity index 100% rename from Adyen/src/Model/Payment/MerchantDevice.cs rename to Adyen/Model/Payment/MerchantDevice.cs diff --git a/Adyen/src/Model/Payment/MerchantRiskIndicator.cs b/Adyen/Model/Payment/MerchantRiskIndicator.cs similarity index 100% rename from Adyen/src/Model/Payment/MerchantRiskIndicator.cs rename to Adyen/Model/Payment/MerchantRiskIndicator.cs diff --git a/Adyen/src/Model/Payment/ModificationResult.cs b/Adyen/Model/Payment/ModificationResult.cs similarity index 100% rename from Adyen/src/Model/Payment/ModificationResult.cs rename to Adyen/Model/Payment/ModificationResult.cs diff --git a/Adyen/src/Model/Payment/Name.cs b/Adyen/Model/Payment/Name.cs similarity index 100% rename from Adyen/src/Model/Payment/Name.cs rename to Adyen/Model/Payment/Name.cs diff --git a/Adyen/src/Model/Payment/PaymentRequest.cs b/Adyen/Model/Payment/PaymentRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/PaymentRequest.cs rename to Adyen/Model/Payment/PaymentRequest.cs diff --git a/Adyen/src/Model/Payment/PaymentRequest3d.cs b/Adyen/Model/Payment/PaymentRequest3d.cs similarity index 100% rename from Adyen/src/Model/Payment/PaymentRequest3d.cs rename to Adyen/Model/Payment/PaymentRequest3d.cs diff --git a/Adyen/src/Model/Payment/PaymentRequest3ds2.cs b/Adyen/Model/Payment/PaymentRequest3ds2.cs similarity index 100% rename from Adyen/src/Model/Payment/PaymentRequest3ds2.cs rename to Adyen/Model/Payment/PaymentRequest3ds2.cs diff --git a/Adyen/src/Model/Payment/PaymentResult.cs b/Adyen/Model/Payment/PaymentResult.cs similarity index 100% rename from Adyen/src/Model/Payment/PaymentResult.cs rename to Adyen/Model/Payment/PaymentResult.cs diff --git a/Adyen/src/Model/Payment/Phone.cs b/Adyen/Model/Payment/Phone.cs similarity index 100% rename from Adyen/src/Model/Payment/Phone.cs rename to Adyen/Model/Payment/Phone.cs diff --git a/Adyen/src/Model/Payment/PlatformChargebackLogic.cs b/Adyen/Model/Payment/PlatformChargebackLogic.cs similarity index 100% rename from Adyen/src/Model/Payment/PlatformChargebackLogic.cs rename to Adyen/Model/Payment/PlatformChargebackLogic.cs diff --git a/Adyen/src/Model/Payment/Recurring.cs b/Adyen/Model/Payment/Recurring.cs similarity index 100% rename from Adyen/src/Model/Payment/Recurring.cs rename to Adyen/Model/Payment/Recurring.cs diff --git a/Adyen/src/Model/Payment/RefundRequest.cs b/Adyen/Model/Payment/RefundRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/RefundRequest.cs rename to Adyen/Model/Payment/RefundRequest.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalData3DSecure.cs b/Adyen/Model/Payment/ResponseAdditionalData3DSecure.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalData3DSecure.cs rename to Adyen/Model/Payment/ResponseAdditionalData3DSecure.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataBillingAddress.cs b/Adyen/Model/Payment/ResponseAdditionalDataBillingAddress.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataBillingAddress.cs rename to Adyen/Model/Payment/ResponseAdditionalDataBillingAddress.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataCard.cs b/Adyen/Model/Payment/ResponseAdditionalDataCard.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataCard.cs rename to Adyen/Model/Payment/ResponseAdditionalDataCard.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataCommon.cs b/Adyen/Model/Payment/ResponseAdditionalDataCommon.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataCommon.cs rename to Adyen/Model/Payment/ResponseAdditionalDataCommon.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataDomesticError.cs b/Adyen/Model/Payment/ResponseAdditionalDataDomesticError.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataDomesticError.cs rename to Adyen/Model/Payment/ResponseAdditionalDataDomesticError.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataInstallments.cs b/Adyen/Model/Payment/ResponseAdditionalDataInstallments.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataInstallments.cs rename to Adyen/Model/Payment/ResponseAdditionalDataInstallments.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataNetworkTokens.cs b/Adyen/Model/Payment/ResponseAdditionalDataNetworkTokens.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataNetworkTokens.cs rename to Adyen/Model/Payment/ResponseAdditionalDataNetworkTokens.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataOpi.cs b/Adyen/Model/Payment/ResponseAdditionalDataOpi.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataOpi.cs rename to Adyen/Model/Payment/ResponseAdditionalDataOpi.cs diff --git a/Adyen/src/Model/Payment/ResponseAdditionalDataSepa.cs b/Adyen/Model/Payment/ResponseAdditionalDataSepa.cs similarity index 100% rename from Adyen/src/Model/Payment/ResponseAdditionalDataSepa.cs rename to Adyen/Model/Payment/ResponseAdditionalDataSepa.cs diff --git a/Adyen/src/Model/Payment/SDKEphemPubKey.cs b/Adyen/Model/Payment/SDKEphemPubKey.cs similarity index 100% rename from Adyen/src/Model/Payment/SDKEphemPubKey.cs rename to Adyen/Model/Payment/SDKEphemPubKey.cs diff --git a/Adyen/src/Model/Payment/SecureRemoteCommerceCheckoutData.cs b/Adyen/Model/Payment/SecureRemoteCommerceCheckoutData.cs similarity index 100% rename from Adyen/src/Model/Payment/SecureRemoteCommerceCheckoutData.cs rename to Adyen/Model/Payment/SecureRemoteCommerceCheckoutData.cs diff --git a/Adyen/src/Model/Payment/ServiceError.cs b/Adyen/Model/Payment/ServiceError.cs similarity index 100% rename from Adyen/src/Model/Payment/ServiceError.cs rename to Adyen/Model/Payment/ServiceError.cs diff --git a/Adyen/src/Model/Payment/ShopperInteractionDevice.cs b/Adyen/Model/Payment/ShopperInteractionDevice.cs similarity index 100% rename from Adyen/src/Model/Payment/ShopperInteractionDevice.cs rename to Adyen/Model/Payment/ShopperInteractionDevice.cs diff --git a/Adyen/src/Model/Payment/Split.cs b/Adyen/Model/Payment/Split.cs similarity index 100% rename from Adyen/src/Model/Payment/Split.cs rename to Adyen/Model/Payment/Split.cs diff --git a/Adyen/src/Model/Payment/SplitAmount.cs b/Adyen/Model/Payment/SplitAmount.cs similarity index 100% rename from Adyen/src/Model/Payment/SplitAmount.cs rename to Adyen/Model/Payment/SplitAmount.cs diff --git a/Adyen/src/Model/Payment/SubMerchant.cs b/Adyen/Model/Payment/SubMerchant.cs similarity index 100% rename from Adyen/src/Model/Payment/SubMerchant.cs rename to Adyen/Model/Payment/SubMerchant.cs diff --git a/Adyen/src/Model/Payment/TechnicalCancelRequest.cs b/Adyen/Model/Payment/TechnicalCancelRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/TechnicalCancelRequest.cs rename to Adyen/Model/Payment/TechnicalCancelRequest.cs diff --git a/Adyen/src/Model/Payment/ThreeDS1Result.cs b/Adyen/Model/Payment/ThreeDS1Result.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDS1Result.cs rename to Adyen/Model/Payment/ThreeDS1Result.cs diff --git a/Adyen/src/Model/Payment/ThreeDS2RequestData.cs b/Adyen/Model/Payment/ThreeDS2RequestData.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDS2RequestData.cs rename to Adyen/Model/Payment/ThreeDS2RequestData.cs diff --git a/Adyen/src/Model/Payment/ThreeDS2Result.cs b/Adyen/Model/Payment/ThreeDS2Result.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDS2Result.cs rename to Adyen/Model/Payment/ThreeDS2Result.cs diff --git a/Adyen/src/Model/Payment/ThreeDS2ResultRequest.cs b/Adyen/Model/Payment/ThreeDS2ResultRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDS2ResultRequest.cs rename to Adyen/Model/Payment/ThreeDS2ResultRequest.cs diff --git a/Adyen/src/Model/Payment/ThreeDS2ResultResponse.cs b/Adyen/Model/Payment/ThreeDS2ResultResponse.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDS2ResultResponse.cs rename to Adyen/Model/Payment/ThreeDS2ResultResponse.cs diff --git a/Adyen/src/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs b/Adyen/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs rename to Adyen/Model/Payment/ThreeDSRequestorAuthenticationInfo.cs diff --git a/Adyen/src/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs b/Adyen/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs rename to Adyen/Model/Payment/ThreeDSRequestorPriorAuthenticationInfo.cs diff --git a/Adyen/src/Model/Payment/ThreeDSecureData.cs b/Adyen/Model/Payment/ThreeDSecureData.cs similarity index 100% rename from Adyen/src/Model/Payment/ThreeDSecureData.cs rename to Adyen/Model/Payment/ThreeDSecureData.cs diff --git a/Adyen/src/Model/Payment/VoidPendingRefundRequest.cs b/Adyen/Model/Payment/VoidPendingRefundRequest.cs similarity index 100% rename from Adyen/src/Model/Payment/VoidPendingRefundRequest.cs rename to Adyen/Model/Payment/VoidPendingRefundRequest.cs diff --git a/Adyen/src/Model/PaymentsApp/AbstractOpenAPISchema.cs b/Adyen/Model/PaymentsApp/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/AbstractOpenAPISchema.cs rename to Adyen/Model/PaymentsApp/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PaymentsApp/BoardingTokenRequest.cs b/Adyen/Model/PaymentsApp/BoardingTokenRequest.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/BoardingTokenRequest.cs rename to Adyen/Model/PaymentsApp/BoardingTokenRequest.cs diff --git a/Adyen/src/Model/PaymentsApp/BoardingTokenResponse.cs b/Adyen/Model/PaymentsApp/BoardingTokenResponse.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/BoardingTokenResponse.cs rename to Adyen/Model/PaymentsApp/BoardingTokenResponse.cs diff --git a/Adyen/src/Model/PaymentsApp/DefaultErrorResponseEntity.cs b/Adyen/Model/PaymentsApp/DefaultErrorResponseEntity.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/DefaultErrorResponseEntity.cs rename to Adyen/Model/PaymentsApp/DefaultErrorResponseEntity.cs diff --git a/Adyen/src/Model/PaymentsApp/InvalidField.cs b/Adyen/Model/PaymentsApp/InvalidField.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/InvalidField.cs rename to Adyen/Model/PaymentsApp/InvalidField.cs diff --git a/Adyen/src/Model/PaymentsApp/PaymentsAppDto.cs b/Adyen/Model/PaymentsApp/PaymentsAppDto.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/PaymentsAppDto.cs rename to Adyen/Model/PaymentsApp/PaymentsAppDto.cs diff --git a/Adyen/src/Model/PaymentsApp/PaymentsAppResponse.cs b/Adyen/Model/PaymentsApp/PaymentsAppResponse.cs similarity index 100% rename from Adyen/src/Model/PaymentsApp/PaymentsAppResponse.cs rename to Adyen/Model/PaymentsApp/PaymentsAppResponse.cs diff --git a/Adyen/src/Model/Payout/AbstractOpenAPISchema.cs b/Adyen/Model/Payout/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Payout/AbstractOpenAPISchema.cs rename to Adyen/Model/Payout/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Payout/Address.cs b/Adyen/Model/Payout/Address.cs similarity index 100% rename from Adyen/src/Model/Payout/Address.cs rename to Adyen/Model/Payout/Address.cs diff --git a/Adyen/src/Model/Payout/Amount.cs b/Adyen/Model/Payout/Amount.cs similarity index 100% rename from Adyen/src/Model/Payout/Amount.cs rename to Adyen/Model/Payout/Amount.cs diff --git a/Adyen/src/Model/Payout/BankAccount.cs b/Adyen/Model/Payout/BankAccount.cs similarity index 100% rename from Adyen/src/Model/Payout/BankAccount.cs rename to Adyen/Model/Payout/BankAccount.cs diff --git a/Adyen/src/Model/Payout/Card.cs b/Adyen/Model/Payout/Card.cs similarity index 100% rename from Adyen/src/Model/Payout/Card.cs rename to Adyen/Model/Payout/Card.cs diff --git a/Adyen/src/Model/Payout/FraudCheckResult.cs b/Adyen/Model/Payout/FraudCheckResult.cs similarity index 100% rename from Adyen/src/Model/Payout/FraudCheckResult.cs rename to Adyen/Model/Payout/FraudCheckResult.cs diff --git a/Adyen/src/Model/Payout/FraudCheckResultWrapper.cs b/Adyen/Model/Payout/FraudCheckResultWrapper.cs similarity index 100% rename from Adyen/src/Model/Payout/FraudCheckResultWrapper.cs rename to Adyen/Model/Payout/FraudCheckResultWrapper.cs diff --git a/Adyen/src/Model/Payout/FraudResult.cs b/Adyen/Model/Payout/FraudResult.cs similarity index 100% rename from Adyen/src/Model/Payout/FraudResult.cs rename to Adyen/Model/Payout/FraudResult.cs diff --git a/Adyen/src/Model/Payout/FundSource.cs b/Adyen/Model/Payout/FundSource.cs similarity index 100% rename from Adyen/src/Model/Payout/FundSource.cs rename to Adyen/Model/Payout/FundSource.cs diff --git a/Adyen/src/Model/Payout/ModifyRequest.cs b/Adyen/Model/Payout/ModifyRequest.cs similarity index 100% rename from Adyen/src/Model/Payout/ModifyRequest.cs rename to Adyen/Model/Payout/ModifyRequest.cs diff --git a/Adyen/src/Model/Payout/ModifyResponse.cs b/Adyen/Model/Payout/ModifyResponse.cs similarity index 100% rename from Adyen/src/Model/Payout/ModifyResponse.cs rename to Adyen/Model/Payout/ModifyResponse.cs diff --git a/Adyen/src/Model/Payout/Name.cs b/Adyen/Model/Payout/Name.cs similarity index 100% rename from Adyen/src/Model/Payout/Name.cs rename to Adyen/Model/Payout/Name.cs diff --git a/Adyen/src/Model/Payout/PayoutRequest.cs b/Adyen/Model/Payout/PayoutRequest.cs similarity index 100% rename from Adyen/src/Model/Payout/PayoutRequest.cs rename to Adyen/Model/Payout/PayoutRequest.cs diff --git a/Adyen/src/Model/Payout/PayoutResponse.cs b/Adyen/Model/Payout/PayoutResponse.cs similarity index 100% rename from Adyen/src/Model/Payout/PayoutResponse.cs rename to Adyen/Model/Payout/PayoutResponse.cs diff --git a/Adyen/src/Model/Payout/Recurring.cs b/Adyen/Model/Payout/Recurring.cs similarity index 100% rename from Adyen/src/Model/Payout/Recurring.cs rename to Adyen/Model/Payout/Recurring.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalData3DSecure.cs b/Adyen/Model/Payout/ResponseAdditionalData3DSecure.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalData3DSecure.cs rename to Adyen/Model/Payout/ResponseAdditionalData3DSecure.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataBillingAddress.cs b/Adyen/Model/Payout/ResponseAdditionalDataBillingAddress.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataBillingAddress.cs rename to Adyen/Model/Payout/ResponseAdditionalDataBillingAddress.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataCard.cs b/Adyen/Model/Payout/ResponseAdditionalDataCard.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataCard.cs rename to Adyen/Model/Payout/ResponseAdditionalDataCard.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataCommon.cs b/Adyen/Model/Payout/ResponseAdditionalDataCommon.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataCommon.cs rename to Adyen/Model/Payout/ResponseAdditionalDataCommon.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataDomesticError.cs b/Adyen/Model/Payout/ResponseAdditionalDataDomesticError.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataDomesticError.cs rename to Adyen/Model/Payout/ResponseAdditionalDataDomesticError.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataInstallments.cs b/Adyen/Model/Payout/ResponseAdditionalDataInstallments.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataInstallments.cs rename to Adyen/Model/Payout/ResponseAdditionalDataInstallments.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataNetworkTokens.cs b/Adyen/Model/Payout/ResponseAdditionalDataNetworkTokens.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataNetworkTokens.cs rename to Adyen/Model/Payout/ResponseAdditionalDataNetworkTokens.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataOpi.cs b/Adyen/Model/Payout/ResponseAdditionalDataOpi.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataOpi.cs rename to Adyen/Model/Payout/ResponseAdditionalDataOpi.cs diff --git a/Adyen/src/Model/Payout/ResponseAdditionalDataSepa.cs b/Adyen/Model/Payout/ResponseAdditionalDataSepa.cs similarity index 100% rename from Adyen/src/Model/Payout/ResponseAdditionalDataSepa.cs rename to Adyen/Model/Payout/ResponseAdditionalDataSepa.cs diff --git a/Adyen/src/Model/Payout/ServiceError.cs b/Adyen/Model/Payout/ServiceError.cs similarity index 100% rename from Adyen/src/Model/Payout/ServiceError.cs rename to Adyen/Model/Payout/ServiceError.cs diff --git a/Adyen/src/Model/Payout/StoreDetailAndSubmitRequest.cs b/Adyen/Model/Payout/StoreDetailAndSubmitRequest.cs similarity index 100% rename from Adyen/src/Model/Payout/StoreDetailAndSubmitRequest.cs rename to Adyen/Model/Payout/StoreDetailAndSubmitRequest.cs diff --git a/Adyen/src/Model/Payout/StoreDetailAndSubmitResponse.cs b/Adyen/Model/Payout/StoreDetailAndSubmitResponse.cs similarity index 100% rename from Adyen/src/Model/Payout/StoreDetailAndSubmitResponse.cs rename to Adyen/Model/Payout/StoreDetailAndSubmitResponse.cs diff --git a/Adyen/src/Model/Payout/StoreDetailRequest.cs b/Adyen/Model/Payout/StoreDetailRequest.cs similarity index 100% rename from Adyen/src/Model/Payout/StoreDetailRequest.cs rename to Adyen/Model/Payout/StoreDetailRequest.cs diff --git a/Adyen/src/Model/Payout/StoreDetailResponse.cs b/Adyen/Model/Payout/StoreDetailResponse.cs similarity index 100% rename from Adyen/src/Model/Payout/StoreDetailResponse.cs rename to Adyen/Model/Payout/StoreDetailResponse.cs diff --git a/Adyen/src/Model/Payout/SubmitRequest.cs b/Adyen/Model/Payout/SubmitRequest.cs similarity index 100% rename from Adyen/src/Model/Payout/SubmitRequest.cs rename to Adyen/Model/Payout/SubmitRequest.cs diff --git a/Adyen/src/Model/Payout/SubmitResponse.cs b/Adyen/Model/Payout/SubmitResponse.cs similarity index 100% rename from Adyen/src/Model/Payout/SubmitResponse.cs rename to Adyen/Model/Payout/SubmitResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/AbstractOpenAPISchema.cs b/Adyen/Model/PlatformsAccount/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/AbstractOpenAPISchema.cs rename to Adyen/Model/PlatformsAccount/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PlatformsAccount/Account.cs b/Adyen/Model/PlatformsAccount/Account.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/Account.cs rename to Adyen/Model/PlatformsAccount/Account.cs diff --git a/Adyen/src/Model/PlatformsAccount/AccountEvent.cs b/Adyen/Model/PlatformsAccount/AccountEvent.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/AccountEvent.cs rename to Adyen/Model/PlatformsAccount/AccountEvent.cs diff --git a/Adyen/src/Model/PlatformsAccount/AccountHolderDetails.cs b/Adyen/Model/PlatformsAccount/AccountHolderDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/AccountHolderDetails.cs rename to Adyen/Model/PlatformsAccount/AccountHolderDetails.cs diff --git a/Adyen/src/Model/PlatformsAccount/AccountHolderStatus.cs b/Adyen/Model/PlatformsAccount/AccountHolderStatus.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/AccountHolderStatus.cs rename to Adyen/Model/PlatformsAccount/AccountHolderStatus.cs diff --git a/Adyen/src/Model/PlatformsAccount/AccountPayoutState.cs b/Adyen/Model/PlatformsAccount/AccountPayoutState.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/AccountPayoutState.cs rename to Adyen/Model/PlatformsAccount/AccountPayoutState.cs diff --git a/Adyen/src/Model/PlatformsAccount/AccountProcessingState.cs b/Adyen/Model/PlatformsAccount/AccountProcessingState.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/AccountProcessingState.cs rename to Adyen/Model/PlatformsAccount/AccountProcessingState.cs diff --git a/Adyen/src/Model/PlatformsAccount/Amount.cs b/Adyen/Model/PlatformsAccount/Amount.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/Amount.cs rename to Adyen/Model/PlatformsAccount/Amount.cs diff --git a/Adyen/src/Model/PlatformsAccount/BankAccountDetail.cs b/Adyen/Model/PlatformsAccount/BankAccountDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/BankAccountDetail.cs rename to Adyen/Model/PlatformsAccount/BankAccountDetail.cs diff --git a/Adyen/src/Model/PlatformsAccount/BusinessDetails.cs b/Adyen/Model/PlatformsAccount/BusinessDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/BusinessDetails.cs rename to Adyen/Model/PlatformsAccount/BusinessDetails.cs diff --git a/Adyen/src/Model/PlatformsAccount/CloseAccountHolderRequest.cs b/Adyen/Model/PlatformsAccount/CloseAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CloseAccountHolderRequest.cs rename to Adyen/Model/PlatformsAccount/CloseAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/CloseAccountHolderResponse.cs b/Adyen/Model/PlatformsAccount/CloseAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CloseAccountHolderResponse.cs rename to Adyen/Model/PlatformsAccount/CloseAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/CloseAccountRequest.cs b/Adyen/Model/PlatformsAccount/CloseAccountRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CloseAccountRequest.cs rename to Adyen/Model/PlatformsAccount/CloseAccountRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/CloseAccountResponse.cs b/Adyen/Model/PlatformsAccount/CloseAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CloseAccountResponse.cs rename to Adyen/Model/PlatformsAccount/CloseAccountResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/CloseStoresRequest.cs b/Adyen/Model/PlatformsAccount/CloseStoresRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CloseStoresRequest.cs rename to Adyen/Model/PlatformsAccount/CloseStoresRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/CreateAccountHolderRequest.cs b/Adyen/Model/PlatformsAccount/CreateAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CreateAccountHolderRequest.cs rename to Adyen/Model/PlatformsAccount/CreateAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/CreateAccountHolderResponse.cs b/Adyen/Model/PlatformsAccount/CreateAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CreateAccountHolderResponse.cs rename to Adyen/Model/PlatformsAccount/CreateAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/CreateAccountRequest.cs b/Adyen/Model/PlatformsAccount/CreateAccountRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CreateAccountRequest.cs rename to Adyen/Model/PlatformsAccount/CreateAccountRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/CreateAccountResponse.cs b/Adyen/Model/PlatformsAccount/CreateAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/CreateAccountResponse.cs rename to Adyen/Model/PlatformsAccount/CreateAccountResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/DeleteBankAccountRequest.cs b/Adyen/Model/PlatformsAccount/DeleteBankAccountRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/DeleteBankAccountRequest.cs rename to Adyen/Model/PlatformsAccount/DeleteBankAccountRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs b/Adyen/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs rename to Adyen/Model/PlatformsAccount/DeleteLegalArrangementRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/DeletePayoutMethodRequest.cs b/Adyen/Model/PlatformsAccount/DeletePayoutMethodRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/DeletePayoutMethodRequest.cs rename to Adyen/Model/PlatformsAccount/DeletePayoutMethodRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/DeleteShareholderRequest.cs b/Adyen/Model/PlatformsAccount/DeleteShareholderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/DeleteShareholderRequest.cs rename to Adyen/Model/PlatformsAccount/DeleteShareholderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/DeleteSignatoriesRequest.cs b/Adyen/Model/PlatformsAccount/DeleteSignatoriesRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/DeleteSignatoriesRequest.cs rename to Adyen/Model/PlatformsAccount/DeleteSignatoriesRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/DocumentDetail.cs b/Adyen/Model/PlatformsAccount/DocumentDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/DocumentDetail.cs rename to Adyen/Model/PlatformsAccount/DocumentDetail.cs diff --git a/Adyen/src/Model/PlatformsAccount/ErrorFieldType.cs b/Adyen/Model/PlatformsAccount/ErrorFieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ErrorFieldType.cs rename to Adyen/Model/PlatformsAccount/ErrorFieldType.cs diff --git a/Adyen/src/Model/PlatformsAccount/FieldType.cs b/Adyen/Model/PlatformsAccount/FieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/FieldType.cs rename to Adyen/Model/PlatformsAccount/FieldType.cs diff --git a/Adyen/src/Model/PlatformsAccount/GenericResponse.cs b/Adyen/Model/PlatformsAccount/GenericResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GenericResponse.cs rename to Adyen/Model/PlatformsAccount/GenericResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetAccountHolderRequest.cs b/Adyen/Model/PlatformsAccount/GetAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetAccountHolderRequest.cs rename to Adyen/Model/PlatformsAccount/GetAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetAccountHolderResponse.cs b/Adyen/Model/PlatformsAccount/GetAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetAccountHolderResponse.cs rename to Adyen/Model/PlatformsAccount/GetAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs b/Adyen/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs rename to Adyen/Model/PlatformsAccount/GetAccountHolderStatusResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetTaxFormRequest.cs b/Adyen/Model/PlatformsAccount/GetTaxFormRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetTaxFormRequest.cs rename to Adyen/Model/PlatformsAccount/GetTaxFormRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetTaxFormResponse.cs b/Adyen/Model/PlatformsAccount/GetTaxFormResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetTaxFormResponse.cs rename to Adyen/Model/PlatformsAccount/GetTaxFormResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs b/Adyen/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs rename to Adyen/Model/PlatformsAccount/GetUploadedDocumentsRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs b/Adyen/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs rename to Adyen/Model/PlatformsAccount/GetUploadedDocumentsResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/IndividualDetails.cs b/Adyen/Model/PlatformsAccount/IndividualDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/IndividualDetails.cs rename to Adyen/Model/PlatformsAccount/IndividualDetails.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCCheckStatusData.cs b/Adyen/Model/PlatformsAccount/KYCCheckStatusData.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCCheckStatusData.cs rename to Adyen/Model/PlatformsAccount/KYCCheckStatusData.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCCheckSummary.cs b/Adyen/Model/PlatformsAccount/KYCCheckSummary.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCCheckSummary.cs rename to Adyen/Model/PlatformsAccount/KYCCheckSummary.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCLegalArrangementCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCLegalArrangementEntityCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCPayoutMethodCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCShareholderCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCShareholderCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCShareholderCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCShareholderCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCSignatoryCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCSignatoryCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCSignatoryCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCSignatoryCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs b/Adyen/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs rename to Adyen/Model/PlatformsAccount/KYCUltimateParentCompanyCheckResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/KYCVerificationResult.cs b/Adyen/Model/PlatformsAccount/KYCVerificationResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/KYCVerificationResult.cs rename to Adyen/Model/PlatformsAccount/KYCVerificationResult.cs diff --git a/Adyen/src/Model/PlatformsAccount/LegalArrangementDetail.cs b/Adyen/Model/PlatformsAccount/LegalArrangementDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/LegalArrangementDetail.cs rename to Adyen/Model/PlatformsAccount/LegalArrangementDetail.cs diff --git a/Adyen/src/Model/PlatformsAccount/LegalArrangementEntityDetail.cs b/Adyen/Model/PlatformsAccount/LegalArrangementEntityDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/LegalArrangementEntityDetail.cs rename to Adyen/Model/PlatformsAccount/LegalArrangementEntityDetail.cs diff --git a/Adyen/src/Model/PlatformsAccount/LegalArrangementRequest.cs b/Adyen/Model/PlatformsAccount/LegalArrangementRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/LegalArrangementRequest.cs rename to Adyen/Model/PlatformsAccount/LegalArrangementRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/MigratedAccounts.cs b/Adyen/Model/PlatformsAccount/MigratedAccounts.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/MigratedAccounts.cs rename to Adyen/Model/PlatformsAccount/MigratedAccounts.cs diff --git a/Adyen/src/Model/PlatformsAccount/MigratedShareholders.cs b/Adyen/Model/PlatformsAccount/MigratedShareholders.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/MigratedShareholders.cs rename to Adyen/Model/PlatformsAccount/MigratedShareholders.cs diff --git a/Adyen/src/Model/PlatformsAccount/MigratedStores.cs b/Adyen/Model/PlatformsAccount/MigratedStores.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/MigratedStores.cs rename to Adyen/Model/PlatformsAccount/MigratedStores.cs diff --git a/Adyen/src/Model/PlatformsAccount/MigrationData.cs b/Adyen/Model/PlatformsAccount/MigrationData.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/MigrationData.cs rename to Adyen/Model/PlatformsAccount/MigrationData.cs diff --git a/Adyen/src/Model/PlatformsAccount/PayoutMethod.cs b/Adyen/Model/PlatformsAccount/PayoutMethod.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/PayoutMethod.cs rename to Adyen/Model/PlatformsAccount/PayoutMethod.cs diff --git a/Adyen/src/Model/PlatformsAccount/PayoutScheduleResponse.cs b/Adyen/Model/PlatformsAccount/PayoutScheduleResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/PayoutScheduleResponse.cs rename to Adyen/Model/PlatformsAccount/PayoutScheduleResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/PerformVerificationRequest.cs b/Adyen/Model/PlatformsAccount/PerformVerificationRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/PerformVerificationRequest.cs rename to Adyen/Model/PlatformsAccount/PerformVerificationRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/PersonalDocumentData.cs b/Adyen/Model/PlatformsAccount/PersonalDocumentData.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/PersonalDocumentData.cs rename to Adyen/Model/PlatformsAccount/PersonalDocumentData.cs diff --git a/Adyen/src/Model/PlatformsAccount/ServiceError.cs b/Adyen/Model/PlatformsAccount/ServiceError.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ServiceError.cs rename to Adyen/Model/PlatformsAccount/ServiceError.cs diff --git a/Adyen/src/Model/PlatformsAccount/ShareholderContact.cs b/Adyen/Model/PlatformsAccount/ShareholderContact.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ShareholderContact.cs rename to Adyen/Model/PlatformsAccount/ShareholderContact.cs diff --git a/Adyen/src/Model/PlatformsAccount/SignatoryContact.cs b/Adyen/Model/PlatformsAccount/SignatoryContact.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/SignatoryContact.cs rename to Adyen/Model/PlatformsAccount/SignatoryContact.cs diff --git a/Adyen/src/Model/PlatformsAccount/StoreDetail.cs b/Adyen/Model/PlatformsAccount/StoreDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/StoreDetail.cs rename to Adyen/Model/PlatformsAccount/StoreDetail.cs diff --git a/Adyen/src/Model/PlatformsAccount/SuspendAccountHolderRequest.cs b/Adyen/Model/PlatformsAccount/SuspendAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/SuspendAccountHolderRequest.cs rename to Adyen/Model/PlatformsAccount/SuspendAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/SuspendAccountHolderResponse.cs b/Adyen/Model/PlatformsAccount/SuspendAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/SuspendAccountHolderResponse.cs rename to Adyen/Model/PlatformsAccount/SuspendAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/UltimateParentCompany.cs b/Adyen/Model/PlatformsAccount/UltimateParentCompany.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UltimateParentCompany.cs rename to Adyen/Model/PlatformsAccount/UltimateParentCompany.cs diff --git a/Adyen/src/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs b/Adyen/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs rename to Adyen/Model/PlatformsAccount/UltimateParentCompanyBusinessDetails.cs diff --git a/Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs b/Adyen/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs rename to Adyen/Model/PlatformsAccount/UnSuspendAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs b/Adyen/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs rename to Adyen/Model/PlatformsAccount/UnSuspendAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/UpdateAccountHolderRequest.cs b/Adyen/Model/PlatformsAccount/UpdateAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UpdateAccountHolderRequest.cs rename to Adyen/Model/PlatformsAccount/UpdateAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/UpdateAccountHolderResponse.cs b/Adyen/Model/PlatformsAccount/UpdateAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UpdateAccountHolderResponse.cs rename to Adyen/Model/PlatformsAccount/UpdateAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs b/Adyen/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs rename to Adyen/Model/PlatformsAccount/UpdateAccountHolderStateRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/UpdateAccountRequest.cs b/Adyen/Model/PlatformsAccount/UpdateAccountRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UpdateAccountRequest.cs rename to Adyen/Model/PlatformsAccount/UpdateAccountRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/UpdateAccountResponse.cs b/Adyen/Model/PlatformsAccount/UpdateAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UpdateAccountResponse.cs rename to Adyen/Model/PlatformsAccount/UpdateAccountResponse.cs diff --git a/Adyen/src/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs b/Adyen/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs rename to Adyen/Model/PlatformsAccount/UpdatePayoutScheduleRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/UploadDocumentRequest.cs b/Adyen/Model/PlatformsAccount/UploadDocumentRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/UploadDocumentRequest.cs rename to Adyen/Model/PlatformsAccount/UploadDocumentRequest.cs diff --git a/Adyen/src/Model/PlatformsAccount/ViasAddress.cs b/Adyen/Model/PlatformsAccount/ViasAddress.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ViasAddress.cs rename to Adyen/Model/PlatformsAccount/ViasAddress.cs diff --git a/Adyen/src/Model/PlatformsAccount/ViasName.cs b/Adyen/Model/PlatformsAccount/ViasName.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ViasName.cs rename to Adyen/Model/PlatformsAccount/ViasName.cs diff --git a/Adyen/src/Model/PlatformsAccount/ViasPersonalData.cs b/Adyen/Model/PlatformsAccount/ViasPersonalData.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ViasPersonalData.cs rename to Adyen/Model/PlatformsAccount/ViasPersonalData.cs diff --git a/Adyen/src/Model/PlatformsAccount/ViasPhoneNumber.cs b/Adyen/Model/PlatformsAccount/ViasPhoneNumber.cs similarity index 100% rename from Adyen/src/Model/PlatformsAccount/ViasPhoneNumber.cs rename to Adyen/Model/PlatformsAccount/ViasPhoneNumber.cs diff --git a/Adyen/src/Model/PlatformsFund/AbstractOpenAPISchema.cs b/Adyen/Model/PlatformsFund/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AbstractOpenAPISchema.cs rename to Adyen/Model/PlatformsFund/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PlatformsFund/AccountDetailBalance.cs b/Adyen/Model/PlatformsFund/AccountDetailBalance.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AccountDetailBalance.cs rename to Adyen/Model/PlatformsFund/AccountDetailBalance.cs diff --git a/Adyen/src/Model/PlatformsFund/AccountHolderBalanceRequest.cs b/Adyen/Model/PlatformsFund/AccountHolderBalanceRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AccountHolderBalanceRequest.cs rename to Adyen/Model/PlatformsFund/AccountHolderBalanceRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/AccountHolderBalanceResponse.cs b/Adyen/Model/PlatformsFund/AccountHolderBalanceResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AccountHolderBalanceResponse.cs rename to Adyen/Model/PlatformsFund/AccountHolderBalanceResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/AccountHolderTransactionListRequest.cs b/Adyen/Model/PlatformsFund/AccountHolderTransactionListRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AccountHolderTransactionListRequest.cs rename to Adyen/Model/PlatformsFund/AccountHolderTransactionListRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/AccountHolderTransactionListResponse.cs b/Adyen/Model/PlatformsFund/AccountHolderTransactionListResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AccountHolderTransactionListResponse.cs rename to Adyen/Model/PlatformsFund/AccountHolderTransactionListResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/AccountTransactionList.cs b/Adyen/Model/PlatformsFund/AccountTransactionList.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/AccountTransactionList.cs rename to Adyen/Model/PlatformsFund/AccountTransactionList.cs diff --git a/Adyen/src/Model/PlatformsFund/Amount.cs b/Adyen/Model/PlatformsFund/Amount.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/Amount.cs rename to Adyen/Model/PlatformsFund/Amount.cs diff --git a/Adyen/src/Model/PlatformsFund/BankAccountDetail.cs b/Adyen/Model/PlatformsFund/BankAccountDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/BankAccountDetail.cs rename to Adyen/Model/PlatformsFund/BankAccountDetail.cs diff --git a/Adyen/src/Model/PlatformsFund/DebitAccountHolderRequest.cs b/Adyen/Model/PlatformsFund/DebitAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/DebitAccountHolderRequest.cs rename to Adyen/Model/PlatformsFund/DebitAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/DebitAccountHolderResponse.cs b/Adyen/Model/PlatformsFund/DebitAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/DebitAccountHolderResponse.cs rename to Adyen/Model/PlatformsFund/DebitAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/DetailBalance.cs b/Adyen/Model/PlatformsFund/DetailBalance.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/DetailBalance.cs rename to Adyen/Model/PlatformsFund/DetailBalance.cs diff --git a/Adyen/src/Model/PlatformsFund/ErrorFieldType.cs b/Adyen/Model/PlatformsFund/ErrorFieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/ErrorFieldType.cs rename to Adyen/Model/PlatformsFund/ErrorFieldType.cs diff --git a/Adyen/src/Model/PlatformsFund/FieldType.cs b/Adyen/Model/PlatformsFund/FieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/FieldType.cs rename to Adyen/Model/PlatformsFund/FieldType.cs diff --git a/Adyen/src/Model/PlatformsFund/PayoutAccountHolderRequest.cs b/Adyen/Model/PlatformsFund/PayoutAccountHolderRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/PayoutAccountHolderRequest.cs rename to Adyen/Model/PlatformsFund/PayoutAccountHolderRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/PayoutAccountHolderResponse.cs b/Adyen/Model/PlatformsFund/PayoutAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/PayoutAccountHolderResponse.cs rename to Adyen/Model/PlatformsFund/PayoutAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/RefundFundsTransferRequest.cs b/Adyen/Model/PlatformsFund/RefundFundsTransferRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/RefundFundsTransferRequest.cs rename to Adyen/Model/PlatformsFund/RefundFundsTransferRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/RefundFundsTransferResponse.cs b/Adyen/Model/PlatformsFund/RefundFundsTransferResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/RefundFundsTransferResponse.cs rename to Adyen/Model/PlatformsFund/RefundFundsTransferResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs b/Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs rename to Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs b/Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs rename to Adyen/Model/PlatformsFund/RefundNotPaidOutTransfersResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/ServiceError.cs b/Adyen/Model/PlatformsFund/ServiceError.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/ServiceError.cs rename to Adyen/Model/PlatformsFund/ServiceError.cs diff --git a/Adyen/src/Model/PlatformsFund/SetupBeneficiaryRequest.cs b/Adyen/Model/PlatformsFund/SetupBeneficiaryRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/SetupBeneficiaryRequest.cs rename to Adyen/Model/PlatformsFund/SetupBeneficiaryRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/SetupBeneficiaryResponse.cs b/Adyen/Model/PlatformsFund/SetupBeneficiaryResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/SetupBeneficiaryResponse.cs rename to Adyen/Model/PlatformsFund/SetupBeneficiaryResponse.cs diff --git a/Adyen/src/Model/PlatformsFund/Split.cs b/Adyen/Model/PlatformsFund/Split.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/Split.cs rename to Adyen/Model/PlatformsFund/Split.cs diff --git a/Adyen/src/Model/PlatformsFund/SplitAmount.cs b/Adyen/Model/PlatformsFund/SplitAmount.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/SplitAmount.cs rename to Adyen/Model/PlatformsFund/SplitAmount.cs diff --git a/Adyen/src/Model/PlatformsFund/Transaction.cs b/Adyen/Model/PlatformsFund/Transaction.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/Transaction.cs rename to Adyen/Model/PlatformsFund/Transaction.cs diff --git a/Adyen/src/Model/PlatformsFund/TransactionListForAccount.cs b/Adyen/Model/PlatformsFund/TransactionListForAccount.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/TransactionListForAccount.cs rename to Adyen/Model/PlatformsFund/TransactionListForAccount.cs diff --git a/Adyen/src/Model/PlatformsFund/TransferFundsRequest.cs b/Adyen/Model/PlatformsFund/TransferFundsRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/TransferFundsRequest.cs rename to Adyen/Model/PlatformsFund/TransferFundsRequest.cs diff --git a/Adyen/src/Model/PlatformsFund/TransferFundsResponse.cs b/Adyen/Model/PlatformsFund/TransferFundsResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsFund/TransferFundsResponse.cs rename to Adyen/Model/PlatformsFund/TransferFundsResponse.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs b/Adyen/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/CollectInformation.cs b/Adyen/Model/PlatformsHostedOnboardingPage/CollectInformation.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/CollectInformation.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/CollectInformation.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs b/Adyen/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/ErrorFieldType.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/FieldType.cs b/Adyen/Model/PlatformsHostedOnboardingPage/FieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/FieldType.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/FieldType.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs b/Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlRequest.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs b/Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/GetOnboardingUrlResponse.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs b/Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlRequest.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs b/Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/GetPciUrlResponse.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/ServiceError.cs b/Adyen/Model/PlatformsHostedOnboardingPage/ServiceError.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/ServiceError.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/ServiceError.cs diff --git a/Adyen/src/Model/PlatformsHostedOnboardingPage/ShowPages.cs b/Adyen/Model/PlatformsHostedOnboardingPage/ShowPages.cs similarity index 100% rename from Adyen/src/Model/PlatformsHostedOnboardingPage/ShowPages.cs rename to Adyen/Model/PlatformsHostedOnboardingPage/ShowPages.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs b/Adyen/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs rename to Adyen/Model/PlatformsNotificationConfiguration/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs b/Adyen/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs rename to Adyen/Model/PlatformsNotificationConfiguration/CreateNotificationConfigurationRequest.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs b/Adyen/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs rename to Adyen/Model/PlatformsNotificationConfiguration/DeleteNotificationConfigurationRequest.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs b/Adyen/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs rename to Adyen/Model/PlatformsNotificationConfiguration/ErrorFieldType.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs b/Adyen/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs rename to Adyen/Model/PlatformsNotificationConfiguration/ExchangeMessage.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/FieldType.cs b/Adyen/Model/PlatformsNotificationConfiguration/FieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/FieldType.cs rename to Adyen/Model/PlatformsNotificationConfiguration/FieldType.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/GenericResponse.cs b/Adyen/Model/PlatformsNotificationConfiguration/GenericResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/GenericResponse.cs rename to Adyen/Model/PlatformsNotificationConfiguration/GenericResponse.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs b/Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs rename to Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationListResponse.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs b/Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs rename to Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationRequest.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs b/Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs rename to Adyen/Model/PlatformsNotificationConfiguration/GetNotificationConfigurationResponse.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs b/Adyen/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs rename to Adyen/Model/PlatformsNotificationConfiguration/NotificationConfigurationDetails.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs b/Adyen/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs rename to Adyen/Model/PlatformsNotificationConfiguration/NotificationEventConfiguration.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/ServiceError.cs b/Adyen/Model/PlatformsNotificationConfiguration/ServiceError.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/ServiceError.cs rename to Adyen/Model/PlatformsNotificationConfiguration/ServiceError.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs b/Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs rename to Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationRequest.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs b/Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs rename to Adyen/Model/PlatformsNotificationConfiguration/TestNotificationConfigurationResponse.cs diff --git a/Adyen/src/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs b/Adyen/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs similarity index 100% rename from Adyen/src/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs rename to Adyen/Model/PlatformsNotificationConfiguration/UpdateNotificationConfigurationRequest.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/PlatformsWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountCloseNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountCloseNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountCloseNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountCloseNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountCreateNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountCreateNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountCreateNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountCreateNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountEvent.cs b/Adyen/Model/PlatformsWebhooks/AccountEvent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountEvent.cs rename to Adyen/Model/PlatformsWebhooks/AccountEvent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/AccountFundsBelowThresholdNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderCreateNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderDetails.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderDetails.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderDetails.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderPayoutNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderStatus.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderStatus.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderStatus.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderStatus.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderStatusChangeNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderStoreStatusChangeNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderUpcomingDeadlineNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderUpdateNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/AccountHolderVerificationNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountPayoutState.cs b/Adyen/Model/PlatformsWebhooks/AccountPayoutState.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountPayoutState.cs rename to Adyen/Model/PlatformsWebhooks/AccountPayoutState.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountProcessingState.cs b/Adyen/Model/PlatformsWebhooks/AccountProcessingState.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountProcessingState.cs rename to Adyen/Model/PlatformsWebhooks/AccountProcessingState.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/AccountUpdateNotification.cs b/Adyen/Model/PlatformsWebhooks/AccountUpdateNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/AccountUpdateNotification.cs rename to Adyen/Model/PlatformsWebhooks/AccountUpdateNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/Amount.cs b/Adyen/Model/PlatformsWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/Amount.cs rename to Adyen/Model/PlatformsWebhooks/Amount.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/BankAccountDetail.cs b/Adyen/Model/PlatformsWebhooks/BankAccountDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/BankAccountDetail.cs rename to Adyen/Model/PlatformsWebhooks/BankAccountDetail.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs b/Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs rename to Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/BeneficiarySetupNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/BusinessDetails.cs b/Adyen/Model/PlatformsWebhooks/BusinessDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/BusinessDetails.cs rename to Adyen/Model/PlatformsWebhooks/BusinessDetails.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/CloseAccountResponse.cs b/Adyen/Model/PlatformsWebhooks/CloseAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/CloseAccountResponse.cs rename to Adyen/Model/PlatformsWebhooks/CloseAccountResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs b/Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs rename to Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs b/Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs rename to Adyen/Model/PlatformsWebhooks/CompensateNegativeBalanceNotificationRecord.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs b/Adyen/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs rename to Adyen/Model/PlatformsWebhooks/CreateAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/CreateAccountResponse.cs b/Adyen/Model/PlatformsWebhooks/CreateAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/CreateAccountResponse.cs rename to Adyen/Model/PlatformsWebhooks/CreateAccountResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs b/Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs rename to Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/DirectDebitInitiatedNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ErrorFieldType.cs b/Adyen/Model/PlatformsWebhooks/ErrorFieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ErrorFieldType.cs rename to Adyen/Model/PlatformsWebhooks/ErrorFieldType.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/FieldType.cs b/Adyen/Model/PlatformsWebhooks/FieldType.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/FieldType.cs rename to Adyen/Model/PlatformsWebhooks/FieldType.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/IndividualDetails.cs b/Adyen/Model/PlatformsWebhooks/IndividualDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/IndividualDetails.cs rename to Adyen/Model/PlatformsWebhooks/IndividualDetails.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCCheckStatusData.cs b/Adyen/Model/PlatformsWebhooks/KYCCheckStatusData.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCCheckStatusData.cs rename to Adyen/Model/PlatformsWebhooks/KYCCheckStatusData.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCCheckSummary.cs b/Adyen/Model/PlatformsWebhooks/KYCCheckSummary.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCCheckSummary.cs rename to Adyen/Model/PlatformsWebhooks/KYCCheckSummary.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCLegalArrangementCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCLegalArrangementEntityCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCPayoutMethodCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCShareholderCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCSignatoryCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs b/Adyen/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCUltimateParentCompanyCheckResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/KYCVerificationResult.cs b/Adyen/Model/PlatformsWebhooks/KYCVerificationResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/KYCVerificationResult.cs rename to Adyen/Model/PlatformsWebhooks/KYCVerificationResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/LegalArrangementDetail.cs b/Adyen/Model/PlatformsWebhooks/LegalArrangementDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/LegalArrangementDetail.cs rename to Adyen/Model/PlatformsWebhooks/LegalArrangementDetail.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs b/Adyen/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs rename to Adyen/Model/PlatformsWebhooks/LegalArrangementEntityDetail.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/LocalDate.cs b/Adyen/Model/PlatformsWebhooks/LocalDate.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/LocalDate.cs rename to Adyen/Model/PlatformsWebhooks/LocalDate.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/Message.cs b/Adyen/Model/PlatformsWebhooks/Message.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/Message.cs rename to Adyen/Model/PlatformsWebhooks/Message.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/NotificationErrorContainer.cs b/Adyen/Model/PlatformsWebhooks/NotificationErrorContainer.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/NotificationErrorContainer.cs rename to Adyen/Model/PlatformsWebhooks/NotificationErrorContainer.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/NotificationResponse.cs b/Adyen/Model/PlatformsWebhooks/NotificationResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/NotificationResponse.cs rename to Adyen/Model/PlatformsWebhooks/NotificationResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/OperationStatus.cs b/Adyen/Model/PlatformsWebhooks/OperationStatus.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/OperationStatus.cs rename to Adyen/Model/PlatformsWebhooks/OperationStatus.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotification.cs b/Adyen/Model/PlatformsWebhooks/PaymentFailureNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotification.cs rename to Adyen/Model/PlatformsWebhooks/PaymentFailureNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/PaymentFailureNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/PayoutMethod.cs b/Adyen/Model/PlatformsWebhooks/PayoutMethod.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/PayoutMethod.cs rename to Adyen/Model/PlatformsWebhooks/PayoutMethod.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/PayoutScheduleResponse.cs b/Adyen/Model/PlatformsWebhooks/PayoutScheduleResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/PayoutScheduleResponse.cs rename to Adyen/Model/PlatformsWebhooks/PayoutScheduleResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/PersonalDocumentData.cs b/Adyen/Model/PlatformsWebhooks/PersonalDocumentData.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/PersonalDocumentData.cs rename to Adyen/Model/PlatformsWebhooks/PersonalDocumentData.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs b/Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs rename to Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/RefundFundsTransferNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/RefundResult.cs b/Adyen/Model/PlatformsWebhooks/RefundResult.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/RefundResult.cs rename to Adyen/Model/PlatformsWebhooks/RefundResult.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotification.cs b/Adyen/Model/PlatformsWebhooks/ReportAvailableNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotification.cs rename to Adyen/Model/PlatformsWebhooks/ReportAvailableNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/ReportAvailableNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs b/Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs rename to Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/ScheduledRefundsNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ShareholderContact.cs b/Adyen/Model/PlatformsWebhooks/ShareholderContact.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ShareholderContact.cs rename to Adyen/Model/PlatformsWebhooks/ShareholderContact.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/SignatoryContact.cs b/Adyen/Model/PlatformsWebhooks/SignatoryContact.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/SignatoryContact.cs rename to Adyen/Model/PlatformsWebhooks/SignatoryContact.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/Split.cs b/Adyen/Model/PlatformsWebhooks/Split.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/Split.cs rename to Adyen/Model/PlatformsWebhooks/Split.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/SplitAmount.cs b/Adyen/Model/PlatformsWebhooks/SplitAmount.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/SplitAmount.cs rename to Adyen/Model/PlatformsWebhooks/SplitAmount.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/StoreDetail.cs b/Adyen/Model/PlatformsWebhooks/StoreDetail.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/StoreDetail.cs rename to Adyen/Model/PlatformsWebhooks/StoreDetail.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/Transaction.cs b/Adyen/Model/PlatformsWebhooks/Transaction.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/Transaction.cs rename to Adyen/Model/PlatformsWebhooks/Transaction.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/TransferFundsNotification.cs b/Adyen/Model/PlatformsWebhooks/TransferFundsNotification.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/TransferFundsNotification.cs rename to Adyen/Model/PlatformsWebhooks/TransferFundsNotification.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs b/Adyen/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs rename to Adyen/Model/PlatformsWebhooks/TransferFundsNotificationContent.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/UltimateParentCompany.cs b/Adyen/Model/PlatformsWebhooks/UltimateParentCompany.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/UltimateParentCompany.cs rename to Adyen/Model/PlatformsWebhooks/UltimateParentCompany.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs b/Adyen/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs rename to Adyen/Model/PlatformsWebhooks/UltimateParentCompanyBusinessDetails.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs b/Adyen/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs rename to Adyen/Model/PlatformsWebhooks/UpdateAccountHolderResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/UpdateAccountResponse.cs b/Adyen/Model/PlatformsWebhooks/UpdateAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/UpdateAccountResponse.cs rename to Adyen/Model/PlatformsWebhooks/UpdateAccountResponse.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ViasAddress.cs b/Adyen/Model/PlatformsWebhooks/ViasAddress.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ViasAddress.cs rename to Adyen/Model/PlatformsWebhooks/ViasAddress.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ViasName.cs b/Adyen/Model/PlatformsWebhooks/ViasName.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ViasName.cs rename to Adyen/Model/PlatformsWebhooks/ViasName.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ViasPersonalData.cs b/Adyen/Model/PlatformsWebhooks/ViasPersonalData.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ViasPersonalData.cs rename to Adyen/Model/PlatformsWebhooks/ViasPersonalData.cs diff --git a/Adyen/src/Model/PlatformsWebhooks/ViasPhoneNumber.cs b/Adyen/Model/PlatformsWebhooks/ViasPhoneNumber.cs similarity index 100% rename from Adyen/src/Model/PlatformsWebhooks/ViasPhoneNumber.cs rename to Adyen/Model/PlatformsWebhooks/ViasPhoneNumber.cs diff --git a/Adyen/src/Model/PosMobile/AbstractOpenAPISchema.cs b/Adyen/Model/PosMobile/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PosMobile/AbstractOpenAPISchema.cs rename to Adyen/Model/PosMobile/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PosMobile/CreateSessionRequest.cs b/Adyen/Model/PosMobile/CreateSessionRequest.cs similarity index 100% rename from Adyen/src/Model/PosMobile/CreateSessionRequest.cs rename to Adyen/Model/PosMobile/CreateSessionRequest.cs diff --git a/Adyen/src/Model/PosMobile/CreateSessionResponse.cs b/Adyen/Model/PosMobile/CreateSessionResponse.cs similarity index 100% rename from Adyen/src/Model/PosMobile/CreateSessionResponse.cs rename to Adyen/Model/PosMobile/CreateSessionResponse.cs diff --git a/Adyen/src/Model/PosTerminalManagement/AbstractOpenAPISchema.cs b/Adyen/Model/PosTerminalManagement/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/AbstractOpenAPISchema.cs rename to Adyen/Model/PosTerminalManagement/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/PosTerminalManagement/Address.cs b/Adyen/Model/PosTerminalManagement/Address.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/Address.cs rename to Adyen/Model/PosTerminalManagement/Address.cs diff --git a/Adyen/src/Model/PosTerminalManagement/AssignTerminalsRequest.cs b/Adyen/Model/PosTerminalManagement/AssignTerminalsRequest.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/AssignTerminalsRequest.cs rename to Adyen/Model/PosTerminalManagement/AssignTerminalsRequest.cs diff --git a/Adyen/src/Model/PosTerminalManagement/AssignTerminalsResponse.cs b/Adyen/Model/PosTerminalManagement/AssignTerminalsResponse.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/AssignTerminalsResponse.cs rename to Adyen/Model/PosTerminalManagement/AssignTerminalsResponse.cs diff --git a/Adyen/src/Model/PosTerminalManagement/FindTerminalRequest.cs b/Adyen/Model/PosTerminalManagement/FindTerminalRequest.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/FindTerminalRequest.cs rename to Adyen/Model/PosTerminalManagement/FindTerminalRequest.cs diff --git a/Adyen/src/Model/PosTerminalManagement/FindTerminalResponse.cs b/Adyen/Model/PosTerminalManagement/FindTerminalResponse.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/FindTerminalResponse.cs rename to Adyen/Model/PosTerminalManagement/FindTerminalResponse.cs diff --git a/Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs b/Adyen/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs rename to Adyen/Model/PosTerminalManagement/GetStoresUnderAccountRequest.cs diff --git a/Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs b/Adyen/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs rename to Adyen/Model/PosTerminalManagement/GetStoresUnderAccountResponse.cs diff --git a/Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs b/Adyen/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs rename to Adyen/Model/PosTerminalManagement/GetTerminalDetailsRequest.cs diff --git a/Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs b/Adyen/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs rename to Adyen/Model/PosTerminalManagement/GetTerminalDetailsResponse.cs diff --git a/Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs b/Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs rename to Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountRequest.cs diff --git a/Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs b/Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs rename to Adyen/Model/PosTerminalManagement/GetTerminalsUnderAccountResponse.cs diff --git a/Adyen/src/Model/PosTerminalManagement/MerchantAccount.cs b/Adyen/Model/PosTerminalManagement/MerchantAccount.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/MerchantAccount.cs rename to Adyen/Model/PosTerminalManagement/MerchantAccount.cs diff --git a/Adyen/src/Model/PosTerminalManagement/ServiceError.cs b/Adyen/Model/PosTerminalManagement/ServiceError.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/ServiceError.cs rename to Adyen/Model/PosTerminalManagement/ServiceError.cs diff --git a/Adyen/src/Model/PosTerminalManagement/Store.cs b/Adyen/Model/PosTerminalManagement/Store.cs similarity index 100% rename from Adyen/src/Model/PosTerminalManagement/Store.cs rename to Adyen/Model/PosTerminalManagement/Store.cs diff --git a/Adyen/src/Model/Recurring/AbstractOpenAPISchema.cs b/Adyen/Model/Recurring/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Recurring/AbstractOpenAPISchema.cs rename to Adyen/Model/Recurring/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Recurring/Address.cs b/Adyen/Model/Recurring/Address.cs similarity index 100% rename from Adyen/src/Model/Recurring/Address.cs rename to Adyen/Model/Recurring/Address.cs diff --git a/Adyen/src/Model/Recurring/Amount.cs b/Adyen/Model/Recurring/Amount.cs similarity index 100% rename from Adyen/src/Model/Recurring/Amount.cs rename to Adyen/Model/Recurring/Amount.cs diff --git a/Adyen/src/Model/Recurring/BankAccount.cs b/Adyen/Model/Recurring/BankAccount.cs similarity index 100% rename from Adyen/src/Model/Recurring/BankAccount.cs rename to Adyen/Model/Recurring/BankAccount.cs diff --git a/Adyen/src/Model/Recurring/Card.cs b/Adyen/Model/Recurring/Card.cs similarity index 100% rename from Adyen/src/Model/Recurring/Card.cs rename to Adyen/Model/Recurring/Card.cs diff --git a/Adyen/src/Model/Recurring/CreatePermitRequest.cs b/Adyen/Model/Recurring/CreatePermitRequest.cs similarity index 100% rename from Adyen/src/Model/Recurring/CreatePermitRequest.cs rename to Adyen/Model/Recurring/CreatePermitRequest.cs diff --git a/Adyen/src/Model/Recurring/CreatePermitResult.cs b/Adyen/Model/Recurring/CreatePermitResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/CreatePermitResult.cs rename to Adyen/Model/Recurring/CreatePermitResult.cs diff --git a/Adyen/src/Model/Recurring/DisablePermitRequest.cs b/Adyen/Model/Recurring/DisablePermitRequest.cs similarity index 100% rename from Adyen/src/Model/Recurring/DisablePermitRequest.cs rename to Adyen/Model/Recurring/DisablePermitRequest.cs diff --git a/Adyen/src/Model/Recurring/DisablePermitResult.cs b/Adyen/Model/Recurring/DisablePermitResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/DisablePermitResult.cs rename to Adyen/Model/Recurring/DisablePermitResult.cs diff --git a/Adyen/src/Model/Recurring/DisableRequest.cs b/Adyen/Model/Recurring/DisableRequest.cs similarity index 100% rename from Adyen/src/Model/Recurring/DisableRequest.cs rename to Adyen/Model/Recurring/DisableRequest.cs diff --git a/Adyen/src/Model/Recurring/DisableResult.cs b/Adyen/Model/Recurring/DisableResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/DisableResult.cs rename to Adyen/Model/Recurring/DisableResult.cs diff --git a/Adyen/src/Model/Recurring/Name.cs b/Adyen/Model/Recurring/Name.cs similarity index 100% rename from Adyen/src/Model/Recurring/Name.cs rename to Adyen/Model/Recurring/Name.cs diff --git a/Adyen/src/Model/Recurring/NotifyShopperRequest.cs b/Adyen/Model/Recurring/NotifyShopperRequest.cs similarity index 100% rename from Adyen/src/Model/Recurring/NotifyShopperRequest.cs rename to Adyen/Model/Recurring/NotifyShopperRequest.cs diff --git a/Adyen/src/Model/Recurring/NotifyShopperResult.cs b/Adyen/Model/Recurring/NotifyShopperResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/NotifyShopperResult.cs rename to Adyen/Model/Recurring/NotifyShopperResult.cs diff --git a/Adyen/src/Model/Recurring/Permit.cs b/Adyen/Model/Recurring/Permit.cs similarity index 100% rename from Adyen/src/Model/Recurring/Permit.cs rename to Adyen/Model/Recurring/Permit.cs diff --git a/Adyen/src/Model/Recurring/PermitRestriction.cs b/Adyen/Model/Recurring/PermitRestriction.cs similarity index 100% rename from Adyen/src/Model/Recurring/PermitRestriction.cs rename to Adyen/Model/Recurring/PermitRestriction.cs diff --git a/Adyen/src/Model/Recurring/PermitResult.cs b/Adyen/Model/Recurring/PermitResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/PermitResult.cs rename to Adyen/Model/Recurring/PermitResult.cs diff --git a/Adyen/src/Model/Recurring/Recurring.cs b/Adyen/Model/Recurring/Recurring.cs similarity index 100% rename from Adyen/src/Model/Recurring/Recurring.cs rename to Adyen/Model/Recurring/Recurring.cs diff --git a/Adyen/src/Model/Recurring/RecurringDetail.cs b/Adyen/Model/Recurring/RecurringDetail.cs similarity index 100% rename from Adyen/src/Model/Recurring/RecurringDetail.cs rename to Adyen/Model/Recurring/RecurringDetail.cs diff --git a/Adyen/src/Model/Recurring/RecurringDetailWrapper.cs b/Adyen/Model/Recurring/RecurringDetailWrapper.cs similarity index 100% rename from Adyen/src/Model/Recurring/RecurringDetailWrapper.cs rename to Adyen/Model/Recurring/RecurringDetailWrapper.cs diff --git a/Adyen/src/Model/Recurring/RecurringDetailsRequest.cs b/Adyen/Model/Recurring/RecurringDetailsRequest.cs similarity index 100% rename from Adyen/src/Model/Recurring/RecurringDetailsRequest.cs rename to Adyen/Model/Recurring/RecurringDetailsRequest.cs diff --git a/Adyen/src/Model/Recurring/RecurringDetailsResult.cs b/Adyen/Model/Recurring/RecurringDetailsResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/RecurringDetailsResult.cs rename to Adyen/Model/Recurring/RecurringDetailsResult.cs diff --git a/Adyen/src/Model/Recurring/ScheduleAccountUpdaterRequest.cs b/Adyen/Model/Recurring/ScheduleAccountUpdaterRequest.cs similarity index 100% rename from Adyen/src/Model/Recurring/ScheduleAccountUpdaterRequest.cs rename to Adyen/Model/Recurring/ScheduleAccountUpdaterRequest.cs diff --git a/Adyen/src/Model/Recurring/ScheduleAccountUpdaterResult.cs b/Adyen/Model/Recurring/ScheduleAccountUpdaterResult.cs similarity index 100% rename from Adyen/src/Model/Recurring/ScheduleAccountUpdaterResult.cs rename to Adyen/Model/Recurring/ScheduleAccountUpdaterResult.cs diff --git a/Adyen/src/Model/Recurring/ServiceError.cs b/Adyen/Model/Recurring/ServiceError.cs similarity index 100% rename from Adyen/src/Model/Recurring/ServiceError.cs rename to Adyen/Model/Recurring/ServiceError.cs diff --git a/Adyen/src/Model/Recurring/TokenDetails.cs b/Adyen/Model/Recurring/TokenDetails.cs similarity index 100% rename from Adyen/src/Model/Recurring/TokenDetails.cs rename to Adyen/Model/Recurring/TokenDetails.cs diff --git a/Adyen/src/Model/ReportWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/ReportWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/ReportWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/ReportWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/Model/ReportWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/src/Model/ReportWebhooks/ReportNotificationData.cs b/Adyen/Model/ReportWebhooks/ReportNotificationData.cs similarity index 100% rename from Adyen/src/Model/ReportWebhooks/ReportNotificationData.cs rename to Adyen/Model/ReportWebhooks/ReportNotificationData.cs diff --git a/Adyen/src/Model/ReportWebhooks/ReportNotificationRequest.cs b/Adyen/Model/ReportWebhooks/ReportNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/ReportWebhooks/ReportNotificationRequest.cs rename to Adyen/Model/ReportWebhooks/ReportNotificationRequest.cs diff --git a/Adyen/src/Model/ReportWebhooks/Resource.cs b/Adyen/Model/ReportWebhooks/Resource.cs similarity index 100% rename from Adyen/src/Model/ReportWebhooks/Resource.cs rename to Adyen/Model/ReportWebhooks/Resource.cs diff --git a/Adyen/src/Model/ReportWebhooks/ResourceReference.cs b/Adyen/Model/ReportWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/src/Model/ReportWebhooks/ResourceReference.cs rename to Adyen/Model/ReportWebhooks/ResourceReference.cs diff --git a/Adyen/src/Model/RequestOptions.cs b/Adyen/Model/RequestOptions.cs similarity index 100% rename from Adyen/src/Model/RequestOptions.cs rename to Adyen/Model/RequestOptions.cs diff --git a/Adyen/src/Model/StoredValue/AbstractOpenAPISchema.cs b/Adyen/Model/StoredValue/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/StoredValue/AbstractOpenAPISchema.cs rename to Adyen/Model/StoredValue/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/StoredValue/Amount.cs b/Adyen/Model/StoredValue/Amount.cs similarity index 100% rename from Adyen/src/Model/StoredValue/Amount.cs rename to Adyen/Model/StoredValue/Amount.cs diff --git a/Adyen/src/Model/StoredValue/ServiceError.cs b/Adyen/Model/StoredValue/ServiceError.cs similarity index 100% rename from Adyen/src/Model/StoredValue/ServiceError.cs rename to Adyen/Model/StoredValue/ServiceError.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueBalanceCheckRequest.cs b/Adyen/Model/StoredValue/StoredValueBalanceCheckRequest.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueBalanceCheckRequest.cs rename to Adyen/Model/StoredValue/StoredValueBalanceCheckRequest.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueBalanceCheckResponse.cs b/Adyen/Model/StoredValue/StoredValueBalanceCheckResponse.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueBalanceCheckResponse.cs rename to Adyen/Model/StoredValue/StoredValueBalanceCheckResponse.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueBalanceMergeRequest.cs b/Adyen/Model/StoredValue/StoredValueBalanceMergeRequest.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueBalanceMergeRequest.cs rename to Adyen/Model/StoredValue/StoredValueBalanceMergeRequest.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueBalanceMergeResponse.cs b/Adyen/Model/StoredValue/StoredValueBalanceMergeResponse.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueBalanceMergeResponse.cs rename to Adyen/Model/StoredValue/StoredValueBalanceMergeResponse.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueIssueRequest.cs b/Adyen/Model/StoredValue/StoredValueIssueRequest.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueIssueRequest.cs rename to Adyen/Model/StoredValue/StoredValueIssueRequest.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueIssueResponse.cs b/Adyen/Model/StoredValue/StoredValueIssueResponse.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueIssueResponse.cs rename to Adyen/Model/StoredValue/StoredValueIssueResponse.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueLoadRequest.cs b/Adyen/Model/StoredValue/StoredValueLoadRequest.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueLoadRequest.cs rename to Adyen/Model/StoredValue/StoredValueLoadRequest.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueLoadResponse.cs b/Adyen/Model/StoredValue/StoredValueLoadResponse.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueLoadResponse.cs rename to Adyen/Model/StoredValue/StoredValueLoadResponse.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueStatusChangeRequest.cs b/Adyen/Model/StoredValue/StoredValueStatusChangeRequest.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueStatusChangeRequest.cs rename to Adyen/Model/StoredValue/StoredValueStatusChangeRequest.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueStatusChangeResponse.cs b/Adyen/Model/StoredValue/StoredValueStatusChangeResponse.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueStatusChangeResponse.cs rename to Adyen/Model/StoredValue/StoredValueStatusChangeResponse.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueVoidRequest.cs b/Adyen/Model/StoredValue/StoredValueVoidRequest.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueVoidRequest.cs rename to Adyen/Model/StoredValue/StoredValueVoidRequest.cs diff --git a/Adyen/src/Model/StoredValue/StoredValueVoidResponse.cs b/Adyen/Model/StoredValue/StoredValueVoidResponse.cs similarity index 100% rename from Adyen/src/Model/StoredValue/StoredValueVoidResponse.cs rename to Adyen/Model/StoredValue/StoredValueVoidResponse.cs diff --git a/Adyen/src/Model/Terminal/SaleToAcquirerData.cs b/Adyen/Model/Terminal/SaleToAcquirerData.cs similarity index 100% rename from Adyen/src/Model/Terminal/SaleToAcquirerData.cs rename to Adyen/Model/Terminal/SaleToAcquirerData.cs diff --git a/Adyen/src/Model/Terminal/Split.cs b/Adyen/Model/Terminal/Split.cs similarity index 100% rename from Adyen/src/Model/Terminal/Split.cs rename to Adyen/Model/Terminal/Split.cs diff --git a/Adyen/src/Model/Terminal/SplitItem.cs b/Adyen/Model/Terminal/SplitItem.cs similarity index 100% rename from Adyen/src/Model/Terminal/SplitItem.cs rename to Adyen/Model/Terminal/SplitItem.cs diff --git a/Adyen/src/Model/Terminal/SplitItemType.cs b/Adyen/Model/Terminal/SplitItemType.cs similarity index 100% rename from Adyen/src/Model/Terminal/SplitItemType.cs rename to Adyen/Model/Terminal/SplitItemType.cs diff --git a/Adyen/src/Model/TerminalApi/AbortRequest.cs b/Adyen/Model/TerminalApi/AbortRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AbortRequest.cs rename to Adyen/Model/TerminalApi/AbortRequest.cs diff --git a/Adyen/src/Model/TerminalApi/AccountType.cs b/Adyen/Model/TerminalApi/AccountType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AccountType.cs rename to Adyen/Model/TerminalApi/AccountType.cs diff --git a/Adyen/src/Model/TerminalApi/AdminRequest.cs b/Adyen/Model/TerminalApi/AdminRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AdminRequest.cs rename to Adyen/Model/TerminalApi/AdminRequest.cs diff --git a/Adyen/src/Model/TerminalApi/AdminResponse.cs b/Adyen/Model/TerminalApi/AdminResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AdminResponse.cs rename to Adyen/Model/TerminalApi/AdminResponse.cs diff --git a/Adyen/src/Model/TerminalApi/AlgorithmIdentifier.cs b/Adyen/Model/TerminalApi/AlgorithmIdentifier.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AlgorithmIdentifier.cs rename to Adyen/Model/TerminalApi/AlgorithmIdentifier.cs diff --git a/Adyen/src/Model/TerminalApi/AlgorithmType.cs b/Adyen/Model/TerminalApi/AlgorithmType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AlgorithmType.cs rename to Adyen/Model/TerminalApi/AlgorithmType.cs diff --git a/Adyen/src/Model/TerminalApi/AlignmentType.cs b/Adyen/Model/TerminalApi/AlignmentType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AlignmentType.cs rename to Adyen/Model/TerminalApi/AlignmentType.cs diff --git a/Adyen/src/Model/TerminalApi/AllowedProduct.cs b/Adyen/Model/TerminalApi/AllowedProduct.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AllowedProduct.cs rename to Adyen/Model/TerminalApi/AllowedProduct.cs diff --git a/Adyen/src/Model/TerminalApi/Amount.cs b/Adyen/Model/TerminalApi/Amount.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Amount.cs rename to Adyen/Model/TerminalApi/Amount.cs diff --git a/Adyen/src/Model/TerminalApi/AmountsReq.cs b/Adyen/Model/TerminalApi/AmountsReq.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AmountsReq.cs rename to Adyen/Model/TerminalApi/AmountsReq.cs diff --git a/Adyen/src/Model/TerminalApi/AmountsResp.cs b/Adyen/Model/TerminalApi/AmountsResp.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AmountsResp.cs rename to Adyen/Model/TerminalApi/AmountsResp.cs diff --git a/Adyen/src/Model/TerminalApi/AreaSize.cs b/Adyen/Model/TerminalApi/AreaSize.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AreaSize.cs rename to Adyen/Model/TerminalApi/AreaSize.cs diff --git a/Adyen/src/Model/TerminalApi/AuthenticatedData.cs b/Adyen/Model/TerminalApi/AuthenticatedData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AuthenticatedData.cs rename to Adyen/Model/TerminalApi/AuthenticatedData.cs diff --git a/Adyen/src/Model/TerminalApi/AuthenticationMethodType.cs b/Adyen/Model/TerminalApi/AuthenticationMethodType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/AuthenticationMethodType.cs rename to Adyen/Model/TerminalApi/AuthenticationMethodType.cs diff --git a/Adyen/src/Model/TerminalApi/BalanceInquiryRequest.cs b/Adyen/Model/TerminalApi/BalanceInquiryRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/BalanceInquiryRequest.cs rename to Adyen/Model/TerminalApi/BalanceInquiryRequest.cs diff --git a/Adyen/src/Model/TerminalApi/BalanceInquiryResponse.cs b/Adyen/Model/TerminalApi/BalanceInquiryResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/BalanceInquiryResponse.cs rename to Adyen/Model/TerminalApi/BalanceInquiryResponse.cs diff --git a/Adyen/src/Model/TerminalApi/BarcodeType.cs b/Adyen/Model/TerminalApi/BarcodeType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/BarcodeType.cs rename to Adyen/Model/TerminalApi/BarcodeType.cs diff --git a/Adyen/src/Model/TerminalApi/BatchRequest.cs b/Adyen/Model/TerminalApi/BatchRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/BatchRequest.cs rename to Adyen/Model/TerminalApi/BatchRequest.cs diff --git a/Adyen/src/Model/TerminalApi/BatchResponse.cs b/Adyen/Model/TerminalApi/BatchResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/BatchResponse.cs rename to Adyen/Model/TerminalApi/BatchResponse.cs diff --git a/Adyen/src/Model/TerminalApi/CapturedSignature.cs b/Adyen/Model/TerminalApi/CapturedSignature.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CapturedSignature.cs rename to Adyen/Model/TerminalApi/CapturedSignature.cs diff --git a/Adyen/src/Model/TerminalApi/CardAcquisitionRequest.cs b/Adyen/Model/TerminalApi/CardAcquisitionRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardAcquisitionRequest.cs rename to Adyen/Model/TerminalApi/CardAcquisitionRequest.cs diff --git a/Adyen/src/Model/TerminalApi/CardAcquisitionResponse.cs b/Adyen/Model/TerminalApi/CardAcquisitionResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardAcquisitionResponse.cs rename to Adyen/Model/TerminalApi/CardAcquisitionResponse.cs diff --git a/Adyen/src/Model/TerminalApi/CardAcquisitionTransaction.cs b/Adyen/Model/TerminalApi/CardAcquisitionTransaction.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardAcquisitionTransaction.cs rename to Adyen/Model/TerminalApi/CardAcquisitionTransaction.cs diff --git a/Adyen/src/Model/TerminalApi/CardData.cs b/Adyen/Model/TerminalApi/CardData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardData.cs rename to Adyen/Model/TerminalApi/CardData.cs diff --git a/Adyen/src/Model/TerminalApi/CardReaderAPDURequest.cs b/Adyen/Model/TerminalApi/CardReaderAPDURequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardReaderAPDURequest.cs rename to Adyen/Model/TerminalApi/CardReaderAPDURequest.cs diff --git a/Adyen/src/Model/TerminalApi/CardReaderAPDUResponse.cs b/Adyen/Model/TerminalApi/CardReaderAPDUResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardReaderAPDUResponse.cs rename to Adyen/Model/TerminalApi/CardReaderAPDUResponse.cs diff --git a/Adyen/src/Model/TerminalApi/CardReaderInitRequest.cs b/Adyen/Model/TerminalApi/CardReaderInitRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardReaderInitRequest.cs rename to Adyen/Model/TerminalApi/CardReaderInitRequest.cs diff --git a/Adyen/src/Model/TerminalApi/CardReaderInitResponse.cs b/Adyen/Model/TerminalApi/CardReaderInitResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardReaderInitResponse.cs rename to Adyen/Model/TerminalApi/CardReaderInitResponse.cs diff --git a/Adyen/src/Model/TerminalApi/CardReaderPowerOffRequest.cs b/Adyen/Model/TerminalApi/CardReaderPowerOffRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardReaderPowerOffRequest.cs rename to Adyen/Model/TerminalApi/CardReaderPowerOffRequest.cs diff --git a/Adyen/src/Model/TerminalApi/CardReaderPowerOffResponse.cs b/Adyen/Model/TerminalApi/CardReaderPowerOffResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardReaderPowerOffResponse.cs rename to Adyen/Model/TerminalApi/CardReaderPowerOffResponse.cs diff --git a/Adyen/src/Model/TerminalApi/CardholderPIN.cs b/Adyen/Model/TerminalApi/CardholderPIN.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CardholderPIN.cs rename to Adyen/Model/TerminalApi/CardholderPIN.cs diff --git a/Adyen/src/Model/TerminalApi/CashHandlingDevice.cs b/Adyen/Model/TerminalApi/CashHandlingDevice.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CashHandlingDevice.cs rename to Adyen/Model/TerminalApi/CashHandlingDevice.cs diff --git a/Adyen/src/Model/TerminalApi/CharacterHeightType.cs b/Adyen/Model/TerminalApi/CharacterHeightType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CharacterHeightType.cs rename to Adyen/Model/TerminalApi/CharacterHeightType.cs diff --git a/Adyen/src/Model/TerminalApi/CharacterStyleType.cs b/Adyen/Model/TerminalApi/CharacterStyleType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CharacterStyleType.cs rename to Adyen/Model/TerminalApi/CharacterStyleType.cs diff --git a/Adyen/src/Model/TerminalApi/CharacterWidthType.cs b/Adyen/Model/TerminalApi/CharacterWidthType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CharacterWidthType.cs rename to Adyen/Model/TerminalApi/CharacterWidthType.cs diff --git a/Adyen/src/Model/TerminalApi/CheckData.cs b/Adyen/Model/TerminalApi/CheckData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CheckData.cs rename to Adyen/Model/TerminalApi/CheckData.cs diff --git a/Adyen/src/Model/TerminalApi/CheckTypeCodeType.cs b/Adyen/Model/TerminalApi/CheckTypeCodeType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CheckTypeCodeType.cs rename to Adyen/Model/TerminalApi/CheckTypeCodeType.cs diff --git a/Adyen/src/Model/TerminalApi/CoinsOrBills.cs b/Adyen/Model/TerminalApi/CoinsOrBills.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CoinsOrBills.cs rename to Adyen/Model/TerminalApi/CoinsOrBills.cs diff --git a/Adyen/src/Model/TerminalApi/ColorType.cs b/Adyen/Model/TerminalApi/ColorType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ColorType.cs rename to Adyen/Model/TerminalApi/ColorType.cs diff --git a/Adyen/src/Model/TerminalApi/ContentInformation.cs b/Adyen/Model/TerminalApi/ContentInformation.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ContentInformation.cs rename to Adyen/Model/TerminalApi/ContentInformation.cs diff --git a/Adyen/src/Model/TerminalApi/ContentType.cs b/Adyen/Model/TerminalApi/ContentType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ContentType.cs rename to Adyen/Model/TerminalApi/ContentType.cs diff --git a/Adyen/src/Model/TerminalApi/CurrencyConversion.cs b/Adyen/Model/TerminalApi/CurrencyConversion.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CurrencyConversion.cs rename to Adyen/Model/TerminalApi/CurrencyConversion.cs diff --git a/Adyen/src/Model/TerminalApi/CustomerOrder.cs b/Adyen/Model/TerminalApi/CustomerOrder.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CustomerOrder.cs rename to Adyen/Model/TerminalApi/CustomerOrder.cs diff --git a/Adyen/src/Model/TerminalApi/CustomerOrderReqType.cs b/Adyen/Model/TerminalApi/CustomerOrderReqType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/CustomerOrderReqType.cs rename to Adyen/Model/TerminalApi/CustomerOrderReqType.cs diff --git a/Adyen/src/Model/TerminalApi/DeviceType.cs b/Adyen/Model/TerminalApi/DeviceType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DeviceType.cs rename to Adyen/Model/TerminalApi/DeviceType.cs diff --git a/Adyen/src/Model/TerminalApi/DiagnosisRequest.cs b/Adyen/Model/TerminalApi/DiagnosisRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DiagnosisRequest.cs rename to Adyen/Model/TerminalApi/DiagnosisRequest.cs diff --git a/Adyen/src/Model/TerminalApi/DiagnosisResponse.cs b/Adyen/Model/TerminalApi/DiagnosisResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DiagnosisResponse.cs rename to Adyen/Model/TerminalApi/DiagnosisResponse.cs diff --git a/Adyen/src/Model/TerminalApi/DigestedData.cs b/Adyen/Model/TerminalApi/DigestedData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DigestedData.cs rename to Adyen/Model/TerminalApi/DigestedData.cs diff --git a/Adyen/src/Model/TerminalApi/DisplayOutput.cs b/Adyen/Model/TerminalApi/DisplayOutput.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DisplayOutput.cs rename to Adyen/Model/TerminalApi/DisplayOutput.cs diff --git a/Adyen/src/Model/TerminalApi/DisplayRequest.cs b/Adyen/Model/TerminalApi/DisplayRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DisplayRequest.cs rename to Adyen/Model/TerminalApi/DisplayRequest.cs diff --git a/Adyen/src/Model/TerminalApi/DisplayResponse.cs b/Adyen/Model/TerminalApi/DisplayResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DisplayResponse.cs rename to Adyen/Model/TerminalApi/DisplayResponse.cs diff --git a/Adyen/src/Model/TerminalApi/DocumentQualifierType.cs b/Adyen/Model/TerminalApi/DocumentQualifierType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/DocumentQualifierType.cs rename to Adyen/Model/TerminalApi/DocumentQualifierType.cs diff --git a/Adyen/src/Model/TerminalApi/EnableServiceRequest.cs b/Adyen/Model/TerminalApi/EnableServiceRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EnableServiceRequest.cs rename to Adyen/Model/TerminalApi/EnableServiceRequest.cs diff --git a/Adyen/src/Model/TerminalApi/EnableServiceResponse.cs b/Adyen/Model/TerminalApi/EnableServiceResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EnableServiceResponse.cs rename to Adyen/Model/TerminalApi/EnableServiceResponse.cs diff --git a/Adyen/src/Model/TerminalApi/EncapsulatedContent.cs b/Adyen/Model/TerminalApi/EncapsulatedContent.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EncapsulatedContent.cs rename to Adyen/Model/TerminalApi/EncapsulatedContent.cs diff --git a/Adyen/src/Model/TerminalApi/EncryptedContent.cs b/Adyen/Model/TerminalApi/EncryptedContent.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EncryptedContent.cs rename to Adyen/Model/TerminalApi/EncryptedContent.cs diff --git a/Adyen/src/Model/TerminalApi/EntryModeType.cs b/Adyen/Model/TerminalApi/EntryModeType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EntryModeType.cs rename to Adyen/Model/TerminalApi/EntryModeType.cs diff --git a/Adyen/src/Model/TerminalApi/EnvelopedData.cs b/Adyen/Model/TerminalApi/EnvelopedData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EnvelopedData.cs rename to Adyen/Model/TerminalApi/EnvelopedData.cs diff --git a/Adyen/src/Model/TerminalApi/ErrorConditionType.cs b/Adyen/Model/TerminalApi/ErrorConditionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ErrorConditionType.cs rename to Adyen/Model/TerminalApi/ErrorConditionType.cs diff --git a/Adyen/src/Model/TerminalApi/EventNotification.cs b/Adyen/Model/TerminalApi/EventNotification.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EventNotification.cs rename to Adyen/Model/TerminalApi/EventNotification.cs diff --git a/Adyen/src/Model/TerminalApi/EventToNotifyType.cs b/Adyen/Model/TerminalApi/EventToNotifyType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/EventToNotifyType.cs rename to Adyen/Model/TerminalApi/EventToNotifyType.cs diff --git a/Adyen/src/Model/TerminalApi/ForceTypeModeType.cs b/Adyen/Model/TerminalApi/ForceTypeModeType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ForceTypeModeType.cs rename to Adyen/Model/TerminalApi/ForceTypeModeType.cs diff --git a/Adyen/src/Model/TerminalApi/GenericProfileType.cs b/Adyen/Model/TerminalApi/GenericProfileType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/GenericProfileType.cs rename to Adyen/Model/TerminalApi/GenericProfileType.cs diff --git a/Adyen/src/Model/TerminalApi/GeographicCoordinates.cs b/Adyen/Model/TerminalApi/GeographicCoordinates.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/GeographicCoordinates.cs rename to Adyen/Model/TerminalApi/GeographicCoordinates.cs diff --git a/Adyen/src/Model/TerminalApi/Geolocation.cs b/Adyen/Model/TerminalApi/Geolocation.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Geolocation.cs rename to Adyen/Model/TerminalApi/Geolocation.cs diff --git a/Adyen/src/Model/TerminalApi/GetTotalsRequest.cs b/Adyen/Model/TerminalApi/GetTotalsRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/GetTotalsRequest.cs rename to Adyen/Model/TerminalApi/GetTotalsRequest.cs diff --git a/Adyen/src/Model/TerminalApi/GetTotalsResponse.cs b/Adyen/Model/TerminalApi/GetTotalsResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/GetTotalsResponse.cs rename to Adyen/Model/TerminalApi/GetTotalsResponse.cs diff --git a/Adyen/src/Model/TerminalApi/GlobalStatusType.cs b/Adyen/Model/TerminalApi/GlobalStatusType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/GlobalStatusType.cs rename to Adyen/Model/TerminalApi/GlobalStatusType.cs diff --git a/Adyen/src/Model/TerminalApi/HostStatus.cs b/Adyen/Model/TerminalApi/HostStatus.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/HostStatus.cs rename to Adyen/Model/TerminalApi/HostStatus.cs diff --git a/Adyen/src/Model/TerminalApi/ICCResetData.cs b/Adyen/Model/TerminalApi/ICCResetData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ICCResetData.cs rename to Adyen/Model/TerminalApi/ICCResetData.cs diff --git a/Adyen/src/Model/TerminalApi/IdentificationSupportType.cs b/Adyen/Model/TerminalApi/IdentificationSupportType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/IdentificationSupportType.cs rename to Adyen/Model/TerminalApi/IdentificationSupportType.cs diff --git a/Adyen/src/Model/TerminalApi/IdentificationType.cs b/Adyen/Model/TerminalApi/IdentificationType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/IdentificationType.cs rename to Adyen/Model/TerminalApi/IdentificationType.cs diff --git a/Adyen/src/Model/TerminalApi/InfoQualifyType.cs b/Adyen/Model/TerminalApi/InfoQualifyType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InfoQualifyType.cs rename to Adyen/Model/TerminalApi/InfoQualifyType.cs diff --git a/Adyen/src/Model/TerminalApi/Input.cs b/Adyen/Model/TerminalApi/Input.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Input.cs rename to Adyen/Model/TerminalApi/Input.cs diff --git a/Adyen/src/Model/TerminalApi/InputCommandType.cs b/Adyen/Model/TerminalApi/InputCommandType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InputCommandType.cs rename to Adyen/Model/TerminalApi/InputCommandType.cs diff --git a/Adyen/src/Model/TerminalApi/InputData.cs b/Adyen/Model/TerminalApi/InputData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InputData.cs rename to Adyen/Model/TerminalApi/InputData.cs diff --git a/Adyen/src/Model/TerminalApi/InputRequest.cs b/Adyen/Model/TerminalApi/InputRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InputRequest.cs rename to Adyen/Model/TerminalApi/InputRequest.cs diff --git a/Adyen/src/Model/TerminalApi/InputResponse.cs b/Adyen/Model/TerminalApi/InputResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InputResponse.cs rename to Adyen/Model/TerminalApi/InputResponse.cs diff --git a/Adyen/src/Model/TerminalApi/InputResult.cs b/Adyen/Model/TerminalApi/InputResult.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InputResult.cs rename to Adyen/Model/TerminalApi/InputResult.cs diff --git a/Adyen/src/Model/TerminalApi/InputUpdate.cs b/Adyen/Model/TerminalApi/InputUpdate.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/InputUpdate.cs rename to Adyen/Model/TerminalApi/InputUpdate.cs diff --git a/Adyen/src/Model/TerminalApi/Instalment.cs b/Adyen/Model/TerminalApi/Instalment.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Instalment.cs rename to Adyen/Model/TerminalApi/Instalment.cs diff --git a/Adyen/src/Model/TerminalApi/IssuerAndSerialNumber.cs b/Adyen/Model/TerminalApi/IssuerAndSerialNumber.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/IssuerAndSerialNumber.cs rename to Adyen/Model/TerminalApi/IssuerAndSerialNumber.cs diff --git a/Adyen/src/Model/TerminalApi/KEK.cs b/Adyen/Model/TerminalApi/KEK.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/KEK.cs rename to Adyen/Model/TerminalApi/KEK.cs diff --git a/Adyen/src/Model/TerminalApi/KEKIdentifier.cs b/Adyen/Model/TerminalApi/KEKIdentifier.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/KEKIdentifier.cs rename to Adyen/Model/TerminalApi/KEKIdentifier.cs diff --git a/Adyen/src/Model/TerminalApi/KeyTransport.cs b/Adyen/Model/TerminalApi/KeyTransport.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/KeyTransport.cs rename to Adyen/Model/TerminalApi/KeyTransport.cs diff --git a/Adyen/src/Model/TerminalApi/LoginRequest.cs b/Adyen/Model/TerminalApi/LoginRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoginRequest.cs rename to Adyen/Model/TerminalApi/LoginRequest.cs diff --git a/Adyen/src/Model/TerminalApi/LoginResponse.cs b/Adyen/Model/TerminalApi/LoginResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoginResponse.cs rename to Adyen/Model/TerminalApi/LoginResponse.cs diff --git a/Adyen/src/Model/TerminalApi/LogoutRequest.cs b/Adyen/Model/TerminalApi/LogoutRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LogoutRequest.cs rename to Adyen/Model/TerminalApi/LogoutRequest.cs diff --git a/Adyen/src/Model/TerminalApi/LogoutResponse.cs b/Adyen/Model/TerminalApi/LogoutResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LogoutResponse.cs rename to Adyen/Model/TerminalApi/LogoutResponse.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyAccount.cs b/Adyen/Model/TerminalApi/LoyaltyAccount.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyAccount.cs rename to Adyen/Model/TerminalApi/LoyaltyAccount.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyAccountID.cs b/Adyen/Model/TerminalApi/LoyaltyAccountID.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyAccountID.cs rename to Adyen/Model/TerminalApi/LoyaltyAccountID.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyAccountReq.cs b/Adyen/Model/TerminalApi/LoyaltyAccountReq.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyAccountReq.cs rename to Adyen/Model/TerminalApi/LoyaltyAccountReq.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyAccountStatus.cs b/Adyen/Model/TerminalApi/LoyaltyAccountStatus.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyAccountStatus.cs rename to Adyen/Model/TerminalApi/LoyaltyAccountStatus.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyAcquirerData.cs b/Adyen/Model/TerminalApi/LoyaltyAcquirerData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyAcquirerData.cs rename to Adyen/Model/TerminalApi/LoyaltyAcquirerData.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyAmount.cs b/Adyen/Model/TerminalApi/LoyaltyAmount.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyAmount.cs rename to Adyen/Model/TerminalApi/LoyaltyAmount.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyData.cs b/Adyen/Model/TerminalApi/LoyaltyData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyData.cs rename to Adyen/Model/TerminalApi/LoyaltyData.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyHandlingType.cs b/Adyen/Model/TerminalApi/LoyaltyHandlingType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyHandlingType.cs rename to Adyen/Model/TerminalApi/LoyaltyHandlingType.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyRequest.cs b/Adyen/Model/TerminalApi/LoyaltyRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyRequest.cs rename to Adyen/Model/TerminalApi/LoyaltyRequest.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyResponse.cs b/Adyen/Model/TerminalApi/LoyaltyResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyResponse.cs rename to Adyen/Model/TerminalApi/LoyaltyResponse.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyResult.cs b/Adyen/Model/TerminalApi/LoyaltyResult.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyResult.cs rename to Adyen/Model/TerminalApi/LoyaltyResult.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyTotals.cs b/Adyen/Model/TerminalApi/LoyaltyTotals.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyTotals.cs rename to Adyen/Model/TerminalApi/LoyaltyTotals.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyTransaction.cs b/Adyen/Model/TerminalApi/LoyaltyTransaction.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyTransaction.cs rename to Adyen/Model/TerminalApi/LoyaltyTransaction.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyTransactionType.cs b/Adyen/Model/TerminalApi/LoyaltyTransactionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyTransactionType.cs rename to Adyen/Model/TerminalApi/LoyaltyTransactionType.cs diff --git a/Adyen/src/Model/TerminalApi/LoyaltyUnitType.cs b/Adyen/Model/TerminalApi/LoyaltyUnitType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/LoyaltyUnitType.cs rename to Adyen/Model/TerminalApi/LoyaltyUnitType.cs diff --git a/Adyen/src/Model/TerminalApi/MenuEntry.cs b/Adyen/Model/TerminalApi/MenuEntry.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MenuEntry.cs rename to Adyen/Model/TerminalApi/MenuEntry.cs diff --git a/Adyen/src/Model/TerminalApi/MenuEntryTagType.cs b/Adyen/Model/TerminalApi/MenuEntryTagType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MenuEntryTagType.cs rename to Adyen/Model/TerminalApi/MenuEntryTagType.cs diff --git a/Adyen/src/Model/TerminalApi/Message/SaleToPOIRequest.cs b/Adyen/Model/TerminalApi/Message/SaleToPOIRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Message/SaleToPOIRequest.cs rename to Adyen/Model/TerminalApi/Message/SaleToPOIRequest.cs diff --git a/Adyen/src/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs b/Adyen/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs rename to Adyen/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs diff --git a/Adyen/src/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs b/Adyen/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs rename to Adyen/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs diff --git a/Adyen/src/Model/TerminalApi/MessageCategoryType.cs b/Adyen/Model/TerminalApi/MessageCategoryType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MessageCategoryType.cs rename to Adyen/Model/TerminalApi/MessageCategoryType.cs diff --git a/Adyen/src/Model/TerminalApi/MessageClassType.cs b/Adyen/Model/TerminalApi/MessageClassType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MessageClassType.cs rename to Adyen/Model/TerminalApi/MessageClassType.cs diff --git a/Adyen/src/Model/TerminalApi/MessageHeader.cs b/Adyen/Model/TerminalApi/MessageHeader.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MessageHeader.cs rename to Adyen/Model/TerminalApi/MessageHeader.cs diff --git a/Adyen/src/Model/TerminalApi/MessageReference.cs b/Adyen/Model/TerminalApi/MessageReference.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MessageReference.cs rename to Adyen/Model/TerminalApi/MessageReference.cs diff --git a/Adyen/src/Model/TerminalApi/MessageType.cs b/Adyen/Model/TerminalApi/MessageType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MessageType.cs rename to Adyen/Model/TerminalApi/MessageType.cs diff --git a/Adyen/src/Model/TerminalApi/MobileData.cs b/Adyen/Model/TerminalApi/MobileData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/MobileData.cs rename to Adyen/Model/TerminalApi/MobileData.cs diff --git a/Adyen/src/Model/TerminalApi/NamedKeyEncryptedData.cs b/Adyen/Model/TerminalApi/NamedKeyEncryptedData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/NamedKeyEncryptedData.cs rename to Adyen/Model/TerminalApi/NamedKeyEncryptedData.cs diff --git a/Adyen/src/Model/TerminalApi/OriginalPOITransaction.cs b/Adyen/Model/TerminalApi/OriginalPOITransaction.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/OriginalPOITransaction.cs rename to Adyen/Model/TerminalApi/OriginalPOITransaction.cs diff --git a/Adyen/src/Model/TerminalApi/OutputBarcode.cs b/Adyen/Model/TerminalApi/OutputBarcode.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/OutputBarcode.cs rename to Adyen/Model/TerminalApi/OutputBarcode.cs diff --git a/Adyen/src/Model/TerminalApi/OutputContent.cs b/Adyen/Model/TerminalApi/OutputContent.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/OutputContent.cs rename to Adyen/Model/TerminalApi/OutputContent.cs diff --git a/Adyen/src/Model/TerminalApi/OutputFormatType.cs b/Adyen/Model/TerminalApi/OutputFormatType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/OutputFormatType.cs rename to Adyen/Model/TerminalApi/OutputFormatType.cs diff --git a/Adyen/src/Model/TerminalApi/OutputResult.cs b/Adyen/Model/TerminalApi/OutputResult.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/OutputResult.cs rename to Adyen/Model/TerminalApi/OutputResult.cs diff --git a/Adyen/src/Model/TerminalApi/OutputText.cs b/Adyen/Model/TerminalApi/OutputText.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/OutputText.cs rename to Adyen/Model/TerminalApi/OutputText.cs diff --git a/Adyen/src/Model/TerminalApi/PINFormatType.cs b/Adyen/Model/TerminalApi/PINFormatType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PINFormatType.cs rename to Adyen/Model/TerminalApi/PINFormatType.cs diff --git a/Adyen/src/Model/TerminalApi/PINRequest.cs b/Adyen/Model/TerminalApi/PINRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PINRequest.cs rename to Adyen/Model/TerminalApi/PINRequest.cs diff --git a/Adyen/src/Model/TerminalApi/PINRequestType.cs b/Adyen/Model/TerminalApi/PINRequestType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PINRequestType.cs rename to Adyen/Model/TerminalApi/PINRequestType.cs diff --git a/Adyen/src/Model/TerminalApi/PINResponse.cs b/Adyen/Model/TerminalApi/PINResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PINResponse.cs rename to Adyen/Model/TerminalApi/PINResponse.cs diff --git a/Adyen/src/Model/TerminalApi/POIData.cs b/Adyen/Model/TerminalApi/POIData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/POIData.cs rename to Adyen/Model/TerminalApi/POIData.cs diff --git a/Adyen/src/Model/TerminalApi/POIProfile.cs b/Adyen/Model/TerminalApi/POIProfile.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/POIProfile.cs rename to Adyen/Model/TerminalApi/POIProfile.cs diff --git a/Adyen/src/Model/TerminalApi/POISoftware.cs b/Adyen/Model/TerminalApi/POISoftware.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/POISoftware.cs rename to Adyen/Model/TerminalApi/POISoftware.cs diff --git a/Adyen/src/Model/TerminalApi/POIStatus.cs b/Adyen/Model/TerminalApi/POIStatus.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/POIStatus.cs rename to Adyen/Model/TerminalApi/POIStatus.cs diff --git a/Adyen/src/Model/TerminalApi/POISystemData.cs b/Adyen/Model/TerminalApi/POISystemData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/POISystemData.cs rename to Adyen/Model/TerminalApi/POISystemData.cs diff --git a/Adyen/src/Model/TerminalApi/POITerminalData.cs b/Adyen/Model/TerminalApi/POITerminalData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/POITerminalData.cs rename to Adyen/Model/TerminalApi/POITerminalData.cs diff --git a/Adyen/src/Model/TerminalApi/Parameter.cs b/Adyen/Model/TerminalApi/Parameter.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Parameter.cs rename to Adyen/Model/TerminalApi/Parameter.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentAccountReq.cs b/Adyen/Model/TerminalApi/PaymentAccountReq.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentAccountReq.cs rename to Adyen/Model/TerminalApi/PaymentAccountReq.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentAccountStatus.cs b/Adyen/Model/TerminalApi/PaymentAccountStatus.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentAccountStatus.cs rename to Adyen/Model/TerminalApi/PaymentAccountStatus.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentAcquirerData.cs b/Adyen/Model/TerminalApi/PaymentAcquirerData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentAcquirerData.cs rename to Adyen/Model/TerminalApi/PaymentAcquirerData.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentData.cs b/Adyen/Model/TerminalApi/PaymentData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentData.cs rename to Adyen/Model/TerminalApi/PaymentData.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentInstrumentData.cs b/Adyen/Model/TerminalApi/PaymentInstrumentData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentInstrumentData.cs rename to Adyen/Model/TerminalApi/PaymentInstrumentData.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentInstrumentType.cs b/Adyen/Model/TerminalApi/PaymentInstrumentType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentInstrumentType.cs rename to Adyen/Model/TerminalApi/PaymentInstrumentType.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentReceipt.cs b/Adyen/Model/TerminalApi/PaymentReceipt.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentReceipt.cs rename to Adyen/Model/TerminalApi/PaymentReceipt.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentRequest.cs b/Adyen/Model/TerminalApi/PaymentRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentRequest.cs rename to Adyen/Model/TerminalApi/PaymentRequest.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentResponse.cs b/Adyen/Model/TerminalApi/PaymentResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentResponse.cs rename to Adyen/Model/TerminalApi/PaymentResponse.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentResult.cs b/Adyen/Model/TerminalApi/PaymentResult.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentResult.cs rename to Adyen/Model/TerminalApi/PaymentResult.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentToken.cs b/Adyen/Model/TerminalApi/PaymentToken.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentToken.cs rename to Adyen/Model/TerminalApi/PaymentToken.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentTotals.cs b/Adyen/Model/TerminalApi/PaymentTotals.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentTotals.cs rename to Adyen/Model/TerminalApi/PaymentTotals.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentTransaction.cs b/Adyen/Model/TerminalApi/PaymentTransaction.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentTransaction.cs rename to Adyen/Model/TerminalApi/PaymentTransaction.cs diff --git a/Adyen/src/Model/TerminalApi/PaymentType.cs b/Adyen/Model/TerminalApi/PaymentType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PaymentType.cs rename to Adyen/Model/TerminalApi/PaymentType.cs diff --git a/Adyen/src/Model/TerminalApi/PerformedTransaction.cs b/Adyen/Model/TerminalApi/PerformedTransaction.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PerformedTransaction.cs rename to Adyen/Model/TerminalApi/PerformedTransaction.cs diff --git a/Adyen/src/Model/TerminalApi/PeriodUnitType.cs b/Adyen/Model/TerminalApi/PeriodUnitType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PeriodUnitType.cs rename to Adyen/Model/TerminalApi/PeriodUnitType.cs diff --git a/Adyen/src/Model/TerminalApi/PredefinedContent.cs b/Adyen/Model/TerminalApi/PredefinedContent.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PredefinedContent.cs rename to Adyen/Model/TerminalApi/PredefinedContent.cs diff --git a/Adyen/src/Model/TerminalApi/PrintOutput.cs b/Adyen/Model/TerminalApi/PrintOutput.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PrintOutput.cs rename to Adyen/Model/TerminalApi/PrintOutput.cs diff --git a/Adyen/src/Model/TerminalApi/PrintRequest.cs b/Adyen/Model/TerminalApi/PrintRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PrintRequest.cs rename to Adyen/Model/TerminalApi/PrintRequest.cs diff --git a/Adyen/src/Model/TerminalApi/PrintResponse.cs b/Adyen/Model/TerminalApi/PrintResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PrintResponse.cs rename to Adyen/Model/TerminalApi/PrintResponse.cs diff --git a/Adyen/src/Model/TerminalApi/PrinterStatusType.cs b/Adyen/Model/TerminalApi/PrinterStatusType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/PrinterStatusType.cs rename to Adyen/Model/TerminalApi/PrinterStatusType.cs diff --git a/Adyen/src/Model/TerminalApi/Rebates.cs b/Adyen/Model/TerminalApi/Rebates.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Rebates.cs rename to Adyen/Model/TerminalApi/Rebates.cs diff --git a/Adyen/src/Model/TerminalApi/RecipientIdentifier.cs b/Adyen/Model/TerminalApi/RecipientIdentifier.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/RecipientIdentifier.cs rename to Adyen/Model/TerminalApi/RecipientIdentifier.cs diff --git a/Adyen/src/Model/TerminalApi/ReconciliationRequest.cs b/Adyen/Model/TerminalApi/ReconciliationRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ReconciliationRequest.cs rename to Adyen/Model/TerminalApi/ReconciliationRequest.cs diff --git a/Adyen/src/Model/TerminalApi/ReconciliationResponse.cs b/Adyen/Model/TerminalApi/ReconciliationResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ReconciliationResponse.cs rename to Adyen/Model/TerminalApi/ReconciliationResponse.cs diff --git a/Adyen/src/Model/TerminalApi/ReconciliationType.cs b/Adyen/Model/TerminalApi/ReconciliationType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ReconciliationType.cs rename to Adyen/Model/TerminalApi/ReconciliationType.cs diff --git a/Adyen/src/Model/TerminalApi/RelativeDistinguishedName.cs b/Adyen/Model/TerminalApi/RelativeDistinguishedName.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/RelativeDistinguishedName.cs rename to Adyen/Model/TerminalApi/RelativeDistinguishedName.cs diff --git a/Adyen/src/Model/TerminalApi/RepeatedMessageResponse.cs b/Adyen/Model/TerminalApi/RepeatedMessageResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/RepeatedMessageResponse.cs rename to Adyen/Model/TerminalApi/RepeatedMessageResponse.cs diff --git a/Adyen/src/Model/TerminalApi/RepeatedResponseMessageBody.cs b/Adyen/Model/TerminalApi/RepeatedResponseMessageBody.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/RepeatedResponseMessageBody.cs rename to Adyen/Model/TerminalApi/RepeatedResponseMessageBody.cs diff --git a/Adyen/src/Model/TerminalApi/Response.cs b/Adyen/Model/TerminalApi/Response.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Response.cs rename to Adyen/Model/TerminalApi/Response.cs diff --git a/Adyen/src/Model/TerminalApi/ResponseModeType.cs b/Adyen/Model/TerminalApi/ResponseModeType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ResponseModeType.cs rename to Adyen/Model/TerminalApi/ResponseModeType.cs diff --git a/Adyen/src/Model/TerminalApi/ResultType.cs b/Adyen/Model/TerminalApi/ResultType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ResultType.cs rename to Adyen/Model/TerminalApi/ResultType.cs diff --git a/Adyen/src/Model/TerminalApi/ReversalReasonType.cs b/Adyen/Model/TerminalApi/ReversalReasonType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ReversalReasonType.cs rename to Adyen/Model/TerminalApi/ReversalReasonType.cs diff --git a/Adyen/src/Model/TerminalApi/ReversalRequest.cs b/Adyen/Model/TerminalApi/ReversalRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ReversalRequest.cs rename to Adyen/Model/TerminalApi/ReversalRequest.cs diff --git a/Adyen/src/Model/TerminalApi/ReversalResponse.cs b/Adyen/Model/TerminalApi/ReversalResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/ReversalResponse.cs rename to Adyen/Model/TerminalApi/ReversalResponse.cs diff --git a/Adyen/src/Model/TerminalApi/SaleData.cs b/Adyen/Model/TerminalApi/SaleData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleData.cs rename to Adyen/Model/TerminalApi/SaleData.cs diff --git a/Adyen/src/Model/TerminalApi/SaleItem.cs b/Adyen/Model/TerminalApi/SaleItem.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleItem.cs rename to Adyen/Model/TerminalApi/SaleItem.cs diff --git a/Adyen/src/Model/TerminalApi/SaleItemRebate.cs b/Adyen/Model/TerminalApi/SaleItemRebate.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleItemRebate.cs rename to Adyen/Model/TerminalApi/SaleItemRebate.cs diff --git a/Adyen/src/Model/TerminalApi/SaleProfile.cs b/Adyen/Model/TerminalApi/SaleProfile.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleProfile.cs rename to Adyen/Model/TerminalApi/SaleProfile.cs diff --git a/Adyen/src/Model/TerminalApi/SaleSoftware.cs b/Adyen/Model/TerminalApi/SaleSoftware.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleSoftware.cs rename to Adyen/Model/TerminalApi/SaleSoftware.cs diff --git a/Adyen/src/Model/TerminalApi/SaleTerminalData.cs b/Adyen/Model/TerminalApi/SaleTerminalData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleTerminalData.cs rename to Adyen/Model/TerminalApi/SaleTerminalData.cs diff --git a/Adyen/src/Model/TerminalApi/SaleToIssuerData.cs b/Adyen/Model/TerminalApi/SaleToIssuerData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleToIssuerData.cs rename to Adyen/Model/TerminalApi/SaleToIssuerData.cs diff --git a/Adyen/src/Model/TerminalApi/SaleToPOIMessage.cs b/Adyen/Model/TerminalApi/SaleToPOIMessage.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleToPOIMessage.cs rename to Adyen/Model/TerminalApi/SaleToPOIMessage.cs diff --git a/Adyen/src/Model/TerminalApi/SaleToPOIResponse.cs b/Adyen/Model/TerminalApi/SaleToPOIResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SaleToPOIResponse.cs rename to Adyen/Model/TerminalApi/SaleToPOIResponse.cs diff --git a/Adyen/src/Model/TerminalApi/SensitiveCardData.cs b/Adyen/Model/TerminalApi/SensitiveCardData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SensitiveCardData.cs rename to Adyen/Model/TerminalApi/SensitiveCardData.cs diff --git a/Adyen/src/Model/TerminalApi/SensitiveMobileData.cs b/Adyen/Model/TerminalApi/SensitiveMobileData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SensitiveMobileData.cs rename to Adyen/Model/TerminalApi/SensitiveMobileData.cs diff --git a/Adyen/src/Model/TerminalApi/SignaturePoint.cs b/Adyen/Model/TerminalApi/SignaturePoint.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SignaturePoint.cs rename to Adyen/Model/TerminalApi/SignaturePoint.cs diff --git a/Adyen/src/Model/TerminalApi/SignedData.cs b/Adyen/Model/TerminalApi/SignedData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SignedData.cs rename to Adyen/Model/TerminalApi/SignedData.cs diff --git a/Adyen/src/Model/TerminalApi/Signer.cs b/Adyen/Model/TerminalApi/Signer.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/Signer.cs rename to Adyen/Model/TerminalApi/Signer.cs diff --git a/Adyen/src/Model/TerminalApi/SignerIdentifier.cs b/Adyen/Model/TerminalApi/SignerIdentifier.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SignerIdentifier.cs rename to Adyen/Model/TerminalApi/SignerIdentifier.cs diff --git a/Adyen/src/Model/TerminalApi/SoundActionType.cs b/Adyen/Model/TerminalApi/SoundActionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SoundActionType.cs rename to Adyen/Model/TerminalApi/SoundActionType.cs diff --git a/Adyen/src/Model/TerminalApi/SoundContent.cs b/Adyen/Model/TerminalApi/SoundContent.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SoundContent.cs rename to Adyen/Model/TerminalApi/SoundContent.cs diff --git a/Adyen/src/Model/TerminalApi/SoundFormatType.cs b/Adyen/Model/TerminalApi/SoundFormatType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SoundFormatType.cs rename to Adyen/Model/TerminalApi/SoundFormatType.cs diff --git a/Adyen/src/Model/TerminalApi/SoundRequest.cs b/Adyen/Model/TerminalApi/SoundRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SoundRequest.cs rename to Adyen/Model/TerminalApi/SoundRequest.cs diff --git a/Adyen/src/Model/TerminalApi/SoundResponse.cs b/Adyen/Model/TerminalApi/SoundResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SoundResponse.cs rename to Adyen/Model/TerminalApi/SoundResponse.cs diff --git a/Adyen/src/Model/TerminalApi/SponsoredMerchant.cs b/Adyen/Model/TerminalApi/SponsoredMerchant.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/SponsoredMerchant.cs rename to Adyen/Model/TerminalApi/SponsoredMerchant.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueAccountID.cs b/Adyen/Model/TerminalApi/StoredValueAccountID.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueAccountID.cs rename to Adyen/Model/TerminalApi/StoredValueAccountID.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueAccountStatus.cs b/Adyen/Model/TerminalApi/StoredValueAccountStatus.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueAccountStatus.cs rename to Adyen/Model/TerminalApi/StoredValueAccountStatus.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueAccountType.cs b/Adyen/Model/TerminalApi/StoredValueAccountType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueAccountType.cs rename to Adyen/Model/TerminalApi/StoredValueAccountType.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueData.cs b/Adyen/Model/TerminalApi/StoredValueData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueData.cs rename to Adyen/Model/TerminalApi/StoredValueData.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueRequest.cs b/Adyen/Model/TerminalApi/StoredValueRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueRequest.cs rename to Adyen/Model/TerminalApi/StoredValueRequest.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueResponse.cs b/Adyen/Model/TerminalApi/StoredValueResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueResponse.cs rename to Adyen/Model/TerminalApi/StoredValueResponse.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueResult.cs b/Adyen/Model/TerminalApi/StoredValueResult.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueResult.cs rename to Adyen/Model/TerminalApi/StoredValueResult.cs diff --git a/Adyen/src/Model/TerminalApi/StoredValueTransactionType.cs b/Adyen/Model/TerminalApi/StoredValueTransactionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/StoredValueTransactionType.cs rename to Adyen/Model/TerminalApi/StoredValueTransactionType.cs diff --git a/Adyen/src/Model/TerminalApi/TerminalEnvironmentType.cs b/Adyen/Model/TerminalApi/TerminalEnvironmentType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TerminalEnvironmentType.cs rename to Adyen/Model/TerminalApi/TerminalEnvironmentType.cs diff --git a/Adyen/src/Model/TerminalApi/TokenRequestedType.cs b/Adyen/Model/TerminalApi/TokenRequestedType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TokenRequestedType.cs rename to Adyen/Model/TerminalApi/TokenRequestedType.cs diff --git a/Adyen/src/Model/TerminalApi/TotalDetailsType.cs b/Adyen/Model/TerminalApi/TotalDetailsType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TotalDetailsType.cs rename to Adyen/Model/TerminalApi/TotalDetailsType.cs diff --git a/Adyen/src/Model/TerminalApi/TotalFilter.cs b/Adyen/Model/TerminalApi/TotalFilter.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TotalFilter.cs rename to Adyen/Model/TerminalApi/TotalFilter.cs diff --git a/Adyen/src/Model/TerminalApi/TrackData.cs b/Adyen/Model/TerminalApi/TrackData.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TrackData.cs rename to Adyen/Model/TerminalApi/TrackData.cs diff --git a/Adyen/src/Model/TerminalApi/TrackFormatType.cs b/Adyen/Model/TerminalApi/TrackFormatType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TrackFormatType.cs rename to Adyen/Model/TerminalApi/TrackFormatType.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionActionType.cs b/Adyen/Model/TerminalApi/TransactionActionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionActionType.cs rename to Adyen/Model/TerminalApi/TransactionActionType.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionConditions.cs b/Adyen/Model/TerminalApi/TransactionConditions.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionConditions.cs rename to Adyen/Model/TerminalApi/TransactionConditions.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionIdentification.cs b/Adyen/Model/TerminalApi/TransactionIdentification.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionIdentification.cs rename to Adyen/Model/TerminalApi/TransactionIdentification.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionStatusRequest.cs b/Adyen/Model/TerminalApi/TransactionStatusRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionStatusRequest.cs rename to Adyen/Model/TerminalApi/TransactionStatusRequest.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionStatusResponse.cs b/Adyen/Model/TerminalApi/TransactionStatusResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionStatusResponse.cs rename to Adyen/Model/TerminalApi/TransactionStatusResponse.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionToPerform.cs b/Adyen/Model/TerminalApi/TransactionToPerform.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionToPerform.cs rename to Adyen/Model/TerminalApi/TransactionToPerform.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionTotals.cs b/Adyen/Model/TerminalApi/TransactionTotals.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionTotals.cs rename to Adyen/Model/TerminalApi/TransactionTotals.cs diff --git a/Adyen/src/Model/TerminalApi/TransactionType.cs b/Adyen/Model/TerminalApi/TransactionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransactionType.cs rename to Adyen/Model/TerminalApi/TransactionType.cs diff --git a/Adyen/src/Model/TerminalApi/TransmitRequest.cs b/Adyen/Model/TerminalApi/TransmitRequest.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransmitRequest.cs rename to Adyen/Model/TerminalApi/TransmitRequest.cs diff --git a/Adyen/src/Model/TerminalApi/TransmitResponse.cs b/Adyen/Model/TerminalApi/TransmitResponse.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/TransmitResponse.cs rename to Adyen/Model/TerminalApi/TransmitResponse.cs diff --git a/Adyen/src/Model/TerminalApi/UTMCoordinates.cs b/Adyen/Model/TerminalApi/UTMCoordinates.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/UTMCoordinates.cs rename to Adyen/Model/TerminalApi/UTMCoordinates.cs diff --git a/Adyen/src/Model/TerminalApi/UnitOfMeasureType.cs b/Adyen/Model/TerminalApi/UnitOfMeasureType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/UnitOfMeasureType.cs rename to Adyen/Model/TerminalApi/UnitOfMeasureType.cs diff --git a/Adyen/src/Model/TerminalApi/VersionType.cs b/Adyen/Model/TerminalApi/VersionType.cs similarity index 100% rename from Adyen/src/Model/TerminalApi/VersionType.cs rename to Adyen/Model/TerminalApi/VersionType.cs diff --git a/Adyen/src/Model/TransactionWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/TransactionWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/TransactionWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/TransactionWebhooks/Amount.cs b/Adyen/Model/TransactionWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/Amount.cs rename to Adyen/Model/TransactionWebhooks/Amount.cs diff --git a/Adyen/src/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/Model/TransactionWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/src/Model/TransactionWebhooks/BankCategoryData.cs b/Adyen/Model/TransactionWebhooks/BankCategoryData.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/BankCategoryData.cs rename to Adyen/Model/TransactionWebhooks/BankCategoryData.cs diff --git a/Adyen/src/Model/TransactionWebhooks/InternalCategoryData.cs b/Adyen/Model/TransactionWebhooks/InternalCategoryData.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/InternalCategoryData.cs rename to Adyen/Model/TransactionWebhooks/InternalCategoryData.cs diff --git a/Adyen/src/Model/TransactionWebhooks/IssuedCard.cs b/Adyen/Model/TransactionWebhooks/IssuedCard.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/IssuedCard.cs rename to Adyen/Model/TransactionWebhooks/IssuedCard.cs diff --git a/Adyen/src/Model/TransactionWebhooks/PaymentInstrument.cs b/Adyen/Model/TransactionWebhooks/PaymentInstrument.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/PaymentInstrument.cs rename to Adyen/Model/TransactionWebhooks/PaymentInstrument.cs diff --git a/Adyen/src/Model/TransactionWebhooks/PlatformPayment.cs b/Adyen/Model/TransactionWebhooks/PlatformPayment.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/PlatformPayment.cs rename to Adyen/Model/TransactionWebhooks/PlatformPayment.cs diff --git a/Adyen/src/Model/TransactionWebhooks/RelayedAuthorisationData.cs b/Adyen/Model/TransactionWebhooks/RelayedAuthorisationData.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/RelayedAuthorisationData.cs rename to Adyen/Model/TransactionWebhooks/RelayedAuthorisationData.cs diff --git a/Adyen/src/Model/TransactionWebhooks/Resource.cs b/Adyen/Model/TransactionWebhooks/Resource.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/Resource.cs rename to Adyen/Model/TransactionWebhooks/Resource.cs diff --git a/Adyen/src/Model/TransactionWebhooks/ResourceReference.cs b/Adyen/Model/TransactionWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/ResourceReference.cs rename to Adyen/Model/TransactionWebhooks/ResourceReference.cs diff --git a/Adyen/src/Model/TransactionWebhooks/ThreeDSecure.cs b/Adyen/Model/TransactionWebhooks/ThreeDSecure.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/ThreeDSecure.cs rename to Adyen/Model/TransactionWebhooks/ThreeDSecure.cs diff --git a/Adyen/src/Model/TransactionWebhooks/Transaction.cs b/Adyen/Model/TransactionWebhooks/Transaction.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/Transaction.cs rename to Adyen/Model/TransactionWebhooks/Transaction.cs diff --git a/Adyen/src/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs b/Adyen/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs rename to Adyen/Model/TransactionWebhooks/TransactionNotificationRequestV4.cs diff --git a/Adyen/src/Model/TransactionWebhooks/TransferNotificationValidationFact.cs b/Adyen/Model/TransactionWebhooks/TransferNotificationValidationFact.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/TransferNotificationValidationFact.cs rename to Adyen/Model/TransactionWebhooks/TransferNotificationValidationFact.cs diff --git a/Adyen/src/Model/TransactionWebhooks/TransferView.cs b/Adyen/Model/TransactionWebhooks/TransferView.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/TransferView.cs rename to Adyen/Model/TransactionWebhooks/TransferView.cs diff --git a/Adyen/src/Model/TransactionWebhooks/TransferViewCategoryData.cs b/Adyen/Model/TransactionWebhooks/TransferViewCategoryData.cs similarity index 100% rename from Adyen/src/Model/TransactionWebhooks/TransferViewCategoryData.cs rename to Adyen/Model/TransactionWebhooks/TransferViewCategoryData.cs diff --git a/Adyen/src/Model/TransferWebhooks/AULocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/AULocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/AULocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/AbstractOpenAPISchema.cs b/Adyen/Model/TransferWebhooks/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/AbstractOpenAPISchema.cs rename to Adyen/Model/TransferWebhooks/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/TransferWebhooks/AdditionalBankIdentification.cs b/Adyen/Model/TransferWebhooks/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/AdditionalBankIdentification.cs rename to Adyen/Model/TransferWebhooks/AdditionalBankIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/Address.cs b/Adyen/Model/TransferWebhooks/Address.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Address.cs rename to Adyen/Model/TransferWebhooks/Address.cs diff --git a/Adyen/src/Model/TransferWebhooks/Airline.cs b/Adyen/Model/TransferWebhooks/Airline.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Airline.cs rename to Adyen/Model/TransferWebhooks/Airline.cs diff --git a/Adyen/src/Model/TransferWebhooks/Amount.cs b/Adyen/Model/TransferWebhooks/Amount.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Amount.cs rename to Adyen/Model/TransferWebhooks/Amount.cs diff --git a/Adyen/src/Model/TransferWebhooks/AmountAdjustment.cs b/Adyen/Model/TransferWebhooks/AmountAdjustment.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/AmountAdjustment.cs rename to Adyen/Model/TransferWebhooks/AmountAdjustment.cs diff --git a/Adyen/src/Model/TransferWebhooks/BRLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/BRLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/BRLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/BalanceMutation.cs b/Adyen/Model/TransferWebhooks/BalanceMutation.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/BalanceMutation.cs rename to Adyen/Model/TransferWebhooks/BalanceMutation.cs diff --git a/Adyen/src/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs b/Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs rename to Adyen/Model/TransferWebhooks/BalancePlatformNotificationResponse.cs diff --git a/Adyen/src/Model/TransferWebhooks/BankAccountV3.cs b/Adyen/Model/TransferWebhooks/BankAccountV3.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/BankAccountV3.cs rename to Adyen/Model/TransferWebhooks/BankAccountV3.cs diff --git a/Adyen/src/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs b/Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs rename to Adyen/Model/TransferWebhooks/BankAccountV3AccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/BankCategoryData.cs b/Adyen/Model/TransferWebhooks/BankCategoryData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/BankCategoryData.cs rename to Adyen/Model/TransferWebhooks/BankCategoryData.cs diff --git a/Adyen/src/Model/TransferWebhooks/CALocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/CALocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/CALocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/CZLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/CZLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/CZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/Card.cs b/Adyen/Model/TransferWebhooks/Card.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Card.cs rename to Adyen/Model/TransferWebhooks/Card.cs diff --git a/Adyen/src/Model/TransferWebhooks/CardIdentification.cs b/Adyen/Model/TransferWebhooks/CardIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/CardIdentification.cs rename to Adyen/Model/TransferWebhooks/CardIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/ConfirmationTrackingData.cs b/Adyen/Model/TransferWebhooks/ConfirmationTrackingData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/ConfirmationTrackingData.cs rename to Adyen/Model/TransferWebhooks/ConfirmationTrackingData.cs diff --git a/Adyen/src/Model/TransferWebhooks/CounterpartyV3.cs b/Adyen/Model/TransferWebhooks/CounterpartyV3.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/CounterpartyV3.cs rename to Adyen/Model/TransferWebhooks/CounterpartyV3.cs diff --git a/Adyen/src/Model/TransferWebhooks/DKLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/DKLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/DKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/DirectDebitInformation.cs b/Adyen/Model/TransferWebhooks/DirectDebitInformation.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/DirectDebitInformation.cs rename to Adyen/Model/TransferWebhooks/DirectDebitInformation.cs diff --git a/Adyen/src/Model/TransferWebhooks/EstimationTrackingData.cs b/Adyen/Model/TransferWebhooks/EstimationTrackingData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/EstimationTrackingData.cs rename to Adyen/Model/TransferWebhooks/EstimationTrackingData.cs diff --git a/Adyen/src/Model/TransferWebhooks/ExternalReason.cs b/Adyen/Model/TransferWebhooks/ExternalReason.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/ExternalReason.cs rename to Adyen/Model/TransferWebhooks/ExternalReason.cs diff --git a/Adyen/src/Model/TransferWebhooks/HKLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/HKLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/HKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/HULocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/HULocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/HULocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/IbanAccountIdentification.cs b/Adyen/Model/TransferWebhooks/IbanAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/IbanAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/IbanAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/InternalCategoryData.cs b/Adyen/Model/TransferWebhooks/InternalCategoryData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/InternalCategoryData.cs rename to Adyen/Model/TransferWebhooks/InternalCategoryData.cs diff --git a/Adyen/src/Model/TransferWebhooks/InternalReviewTrackingData.cs b/Adyen/Model/TransferWebhooks/InternalReviewTrackingData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/InternalReviewTrackingData.cs rename to Adyen/Model/TransferWebhooks/InternalReviewTrackingData.cs diff --git a/Adyen/src/Model/TransferWebhooks/IssuedCard.cs b/Adyen/Model/TransferWebhooks/IssuedCard.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/IssuedCard.cs rename to Adyen/Model/TransferWebhooks/IssuedCard.cs diff --git a/Adyen/src/Model/TransferWebhooks/IssuingTransactionData.cs b/Adyen/Model/TransferWebhooks/IssuingTransactionData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/IssuingTransactionData.cs rename to Adyen/Model/TransferWebhooks/IssuingTransactionData.cs diff --git a/Adyen/src/Model/TransferWebhooks/Leg.cs b/Adyen/Model/TransferWebhooks/Leg.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Leg.cs rename to Adyen/Model/TransferWebhooks/Leg.cs diff --git a/Adyen/src/Model/TransferWebhooks/Lodging.cs b/Adyen/Model/TransferWebhooks/Lodging.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Lodging.cs rename to Adyen/Model/TransferWebhooks/Lodging.cs diff --git a/Adyen/src/Model/TransferWebhooks/MerchantData.cs b/Adyen/Model/TransferWebhooks/MerchantData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/MerchantData.cs rename to Adyen/Model/TransferWebhooks/MerchantData.cs diff --git a/Adyen/src/Model/TransferWebhooks/MerchantPurchaseData.cs b/Adyen/Model/TransferWebhooks/MerchantPurchaseData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/MerchantPurchaseData.cs rename to Adyen/Model/TransferWebhooks/MerchantPurchaseData.cs diff --git a/Adyen/src/Model/TransferWebhooks/Modification.cs b/Adyen/Model/TransferWebhooks/Modification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Modification.cs rename to Adyen/Model/TransferWebhooks/Modification.cs diff --git a/Adyen/src/Model/TransferWebhooks/NOLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/NOLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/NOLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/NZLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/NZLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/NZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/NameLocation.cs b/Adyen/Model/TransferWebhooks/NameLocation.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/NameLocation.cs rename to Adyen/Model/TransferWebhooks/NameLocation.cs diff --git a/Adyen/src/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs b/Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/NumberAndBicAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/PLLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/PLLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/PLLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/PartyIdentification.cs b/Adyen/Model/TransferWebhooks/PartyIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/PartyIdentification.cs rename to Adyen/Model/TransferWebhooks/PartyIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/PaymentInstrument.cs b/Adyen/Model/TransferWebhooks/PaymentInstrument.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/PaymentInstrument.cs rename to Adyen/Model/TransferWebhooks/PaymentInstrument.cs diff --git a/Adyen/src/Model/TransferWebhooks/PlatformPayment.cs b/Adyen/Model/TransferWebhooks/PlatformPayment.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/PlatformPayment.cs rename to Adyen/Model/TransferWebhooks/PlatformPayment.cs diff --git a/Adyen/src/Model/TransferWebhooks/RelayedAuthorisationData.cs b/Adyen/Model/TransferWebhooks/RelayedAuthorisationData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/RelayedAuthorisationData.cs rename to Adyen/Model/TransferWebhooks/RelayedAuthorisationData.cs diff --git a/Adyen/src/Model/TransferWebhooks/Resource.cs b/Adyen/Model/TransferWebhooks/Resource.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/Resource.cs rename to Adyen/Model/TransferWebhooks/Resource.cs diff --git a/Adyen/src/Model/TransferWebhooks/ResourceReference.cs b/Adyen/Model/TransferWebhooks/ResourceReference.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/ResourceReference.cs rename to Adyen/Model/TransferWebhooks/ResourceReference.cs diff --git a/Adyen/src/Model/TransferWebhooks/SELocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/SELocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/SELocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/SGLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/SGLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/SGLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransactionEventViolation.cs b/Adyen/Model/TransferWebhooks/TransactionEventViolation.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransactionEventViolation.cs rename to Adyen/Model/TransferWebhooks/TransactionEventViolation.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransactionRuleReference.cs b/Adyen/Model/TransferWebhooks/TransactionRuleReference.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransactionRuleReference.cs rename to Adyen/Model/TransferWebhooks/TransactionRuleReference.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransactionRuleSource.cs b/Adyen/Model/TransferWebhooks/TransactionRuleSource.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransactionRuleSource.cs rename to Adyen/Model/TransferWebhooks/TransactionRuleSource.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransactionRulesResult.cs b/Adyen/Model/TransferWebhooks/TransactionRulesResult.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransactionRulesResult.cs rename to Adyen/Model/TransferWebhooks/TransactionRulesResult.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferData.cs b/Adyen/Model/TransferWebhooks/TransferData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferData.cs rename to Adyen/Model/TransferWebhooks/TransferData.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferDataCategoryData.cs b/Adyen/Model/TransferWebhooks/TransferDataCategoryData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferDataCategoryData.cs rename to Adyen/Model/TransferWebhooks/TransferDataCategoryData.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferDataTracking.cs b/Adyen/Model/TransferWebhooks/TransferDataTracking.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferDataTracking.cs rename to Adyen/Model/TransferWebhooks/TransferDataTracking.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferEvent.cs b/Adyen/Model/TransferWebhooks/TransferEvent.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferEvent.cs rename to Adyen/Model/TransferWebhooks/TransferEvent.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferEventEventsDataInner.cs b/Adyen/Model/TransferWebhooks/TransferEventEventsDataInner.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferEventEventsDataInner.cs rename to Adyen/Model/TransferWebhooks/TransferEventEventsDataInner.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferEventTrackingData.cs b/Adyen/Model/TransferWebhooks/TransferEventTrackingData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferEventTrackingData.cs rename to Adyen/Model/TransferWebhooks/TransferEventTrackingData.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferNotificationCounterParty.cs b/Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferNotificationCounterParty.cs rename to Adyen/Model/TransferWebhooks/TransferNotificationCounterParty.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferNotificationMerchantData.cs b/Adyen/Model/TransferWebhooks/TransferNotificationMerchantData.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferNotificationMerchantData.cs rename to Adyen/Model/TransferWebhooks/TransferNotificationMerchantData.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferNotificationRequest.cs b/Adyen/Model/TransferWebhooks/TransferNotificationRequest.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferNotificationRequest.cs rename to Adyen/Model/TransferWebhooks/TransferNotificationRequest.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferNotificationValidationFact.cs b/Adyen/Model/TransferWebhooks/TransferNotificationValidationFact.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferNotificationValidationFact.cs rename to Adyen/Model/TransferWebhooks/TransferNotificationValidationFact.cs diff --git a/Adyen/src/Model/TransferWebhooks/TransferReview.cs b/Adyen/Model/TransferWebhooks/TransferReview.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/TransferReview.cs rename to Adyen/Model/TransferWebhooks/TransferReview.cs diff --git a/Adyen/src/Model/TransferWebhooks/UKLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/UKLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/UKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/TransferWebhooks/USLocalAccountIdentification.cs b/Adyen/Model/TransferWebhooks/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/TransferWebhooks/USLocalAccountIdentification.cs rename to Adyen/Model/TransferWebhooks/USLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/AULocalAccountIdentification.cs b/Adyen/Model/Transfers/AULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/AULocalAccountIdentification.cs rename to Adyen/Model/Transfers/AULocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/AbstractOpenAPISchema.cs b/Adyen/Model/Transfers/AbstractOpenAPISchema.cs similarity index 100% rename from Adyen/src/Model/Transfers/AbstractOpenAPISchema.cs rename to Adyen/Model/Transfers/AbstractOpenAPISchema.cs diff --git a/Adyen/src/Model/Transfers/AdditionalBankIdentification.cs b/Adyen/Model/Transfers/AdditionalBankIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/AdditionalBankIdentification.cs rename to Adyen/Model/Transfers/AdditionalBankIdentification.cs diff --git a/Adyen/src/Model/Transfers/Address.cs b/Adyen/Model/Transfers/Address.cs similarity index 100% rename from Adyen/src/Model/Transfers/Address.cs rename to Adyen/Model/Transfers/Address.cs diff --git a/Adyen/src/Model/Transfers/Airline.cs b/Adyen/Model/Transfers/Airline.cs similarity index 100% rename from Adyen/src/Model/Transfers/Airline.cs rename to Adyen/Model/Transfers/Airline.cs diff --git a/Adyen/src/Model/Transfers/Amount.cs b/Adyen/Model/Transfers/Amount.cs similarity index 100% rename from Adyen/src/Model/Transfers/Amount.cs rename to Adyen/Model/Transfers/Amount.cs diff --git a/Adyen/src/Model/Transfers/AmountAdjustment.cs b/Adyen/Model/Transfers/AmountAdjustment.cs similarity index 100% rename from Adyen/src/Model/Transfers/AmountAdjustment.cs rename to Adyen/Model/Transfers/AmountAdjustment.cs diff --git a/Adyen/src/Model/Transfers/ApproveTransfersRequest.cs b/Adyen/Model/Transfers/ApproveTransfersRequest.cs similarity index 100% rename from Adyen/src/Model/Transfers/ApproveTransfersRequest.cs rename to Adyen/Model/Transfers/ApproveTransfersRequest.cs diff --git a/Adyen/src/Model/Transfers/BRLocalAccountIdentification.cs b/Adyen/Model/Transfers/BRLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/BRLocalAccountIdentification.cs rename to Adyen/Model/Transfers/BRLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/BalanceMutation.cs b/Adyen/Model/Transfers/BalanceMutation.cs similarity index 100% rename from Adyen/src/Model/Transfers/BalanceMutation.cs rename to Adyen/Model/Transfers/BalanceMutation.cs diff --git a/Adyen/src/Model/Transfers/BankAccountV3.cs b/Adyen/Model/Transfers/BankAccountV3.cs similarity index 100% rename from Adyen/src/Model/Transfers/BankAccountV3.cs rename to Adyen/Model/Transfers/BankAccountV3.cs diff --git a/Adyen/src/Model/Transfers/BankAccountV3AccountIdentification.cs b/Adyen/Model/Transfers/BankAccountV3AccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/BankAccountV3AccountIdentification.cs rename to Adyen/Model/Transfers/BankAccountV3AccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/BankCategoryData.cs b/Adyen/Model/Transfers/BankCategoryData.cs similarity index 100% rename from Adyen/src/Model/Transfers/BankCategoryData.cs rename to Adyen/Model/Transfers/BankCategoryData.cs diff --git a/Adyen/src/Model/Transfers/CALocalAccountIdentification.cs b/Adyen/Model/Transfers/CALocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/CALocalAccountIdentification.cs rename to Adyen/Model/Transfers/CALocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/CZLocalAccountIdentification.cs b/Adyen/Model/Transfers/CZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/CZLocalAccountIdentification.cs rename to Adyen/Model/Transfers/CZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/CancelTransfersRequest.cs b/Adyen/Model/Transfers/CancelTransfersRequest.cs similarity index 100% rename from Adyen/src/Model/Transfers/CancelTransfersRequest.cs rename to Adyen/Model/Transfers/CancelTransfersRequest.cs diff --git a/Adyen/src/Model/Transfers/CapitalBalance.cs b/Adyen/Model/Transfers/CapitalBalance.cs similarity index 100% rename from Adyen/src/Model/Transfers/CapitalBalance.cs rename to Adyen/Model/Transfers/CapitalBalance.cs diff --git a/Adyen/src/Model/Transfers/CapitalGrant.cs b/Adyen/Model/Transfers/CapitalGrant.cs similarity index 100% rename from Adyen/src/Model/Transfers/CapitalGrant.cs rename to Adyen/Model/Transfers/CapitalGrant.cs diff --git a/Adyen/src/Model/Transfers/CapitalGrantInfo.cs b/Adyen/Model/Transfers/CapitalGrantInfo.cs similarity index 100% rename from Adyen/src/Model/Transfers/CapitalGrantInfo.cs rename to Adyen/Model/Transfers/CapitalGrantInfo.cs diff --git a/Adyen/src/Model/Transfers/CapitalGrants.cs b/Adyen/Model/Transfers/CapitalGrants.cs similarity index 100% rename from Adyen/src/Model/Transfers/CapitalGrants.cs rename to Adyen/Model/Transfers/CapitalGrants.cs diff --git a/Adyen/src/Model/Transfers/Card.cs b/Adyen/Model/Transfers/Card.cs similarity index 100% rename from Adyen/src/Model/Transfers/Card.cs rename to Adyen/Model/Transfers/Card.cs diff --git a/Adyen/src/Model/Transfers/CardIdentification.cs b/Adyen/Model/Transfers/CardIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/CardIdentification.cs rename to Adyen/Model/Transfers/CardIdentification.cs diff --git a/Adyen/src/Model/Transfers/ConfirmationTrackingData.cs b/Adyen/Model/Transfers/ConfirmationTrackingData.cs similarity index 100% rename from Adyen/src/Model/Transfers/ConfirmationTrackingData.cs rename to Adyen/Model/Transfers/ConfirmationTrackingData.cs diff --git a/Adyen/src/Model/Transfers/Counterparty.cs b/Adyen/Model/Transfers/Counterparty.cs similarity index 100% rename from Adyen/src/Model/Transfers/Counterparty.cs rename to Adyen/Model/Transfers/Counterparty.cs diff --git a/Adyen/src/Model/Transfers/CounterpartyInfoV3.cs b/Adyen/Model/Transfers/CounterpartyInfoV3.cs similarity index 100% rename from Adyen/src/Model/Transfers/CounterpartyInfoV3.cs rename to Adyen/Model/Transfers/CounterpartyInfoV3.cs diff --git a/Adyen/src/Model/Transfers/CounterpartyV3.cs b/Adyen/Model/Transfers/CounterpartyV3.cs similarity index 100% rename from Adyen/src/Model/Transfers/CounterpartyV3.cs rename to Adyen/Model/Transfers/CounterpartyV3.cs diff --git a/Adyen/src/Model/Transfers/DKLocalAccountIdentification.cs b/Adyen/Model/Transfers/DKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/DKLocalAccountIdentification.cs rename to Adyen/Model/Transfers/DKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/DirectDebitInformation.cs b/Adyen/Model/Transfers/DirectDebitInformation.cs similarity index 100% rename from Adyen/src/Model/Transfers/DirectDebitInformation.cs rename to Adyen/Model/Transfers/DirectDebitInformation.cs diff --git a/Adyen/src/Model/Transfers/EstimationTrackingData.cs b/Adyen/Model/Transfers/EstimationTrackingData.cs similarity index 100% rename from Adyen/src/Model/Transfers/EstimationTrackingData.cs rename to Adyen/Model/Transfers/EstimationTrackingData.cs diff --git a/Adyen/src/Model/Transfers/ExternalReason.cs b/Adyen/Model/Transfers/ExternalReason.cs similarity index 100% rename from Adyen/src/Model/Transfers/ExternalReason.cs rename to Adyen/Model/Transfers/ExternalReason.cs diff --git a/Adyen/src/Model/Transfers/Fee.cs b/Adyen/Model/Transfers/Fee.cs similarity index 100% rename from Adyen/src/Model/Transfers/Fee.cs rename to Adyen/Model/Transfers/Fee.cs diff --git a/Adyen/src/Model/Transfers/FindTransfersResponse.cs b/Adyen/Model/Transfers/FindTransfersResponse.cs similarity index 100% rename from Adyen/src/Model/Transfers/FindTransfersResponse.cs rename to Adyen/Model/Transfers/FindTransfersResponse.cs diff --git a/Adyen/src/Model/Transfers/HKLocalAccountIdentification.cs b/Adyen/Model/Transfers/HKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/HKLocalAccountIdentification.cs rename to Adyen/Model/Transfers/HKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/HULocalAccountIdentification.cs b/Adyen/Model/Transfers/HULocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/HULocalAccountIdentification.cs rename to Adyen/Model/Transfers/HULocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/IbanAccountIdentification.cs b/Adyen/Model/Transfers/IbanAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/IbanAccountIdentification.cs rename to Adyen/Model/Transfers/IbanAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/InternalCategoryData.cs b/Adyen/Model/Transfers/InternalCategoryData.cs similarity index 100% rename from Adyen/src/Model/Transfers/InternalCategoryData.cs rename to Adyen/Model/Transfers/InternalCategoryData.cs diff --git a/Adyen/src/Model/Transfers/InternalReviewTrackingData.cs b/Adyen/Model/Transfers/InternalReviewTrackingData.cs similarity index 100% rename from Adyen/src/Model/Transfers/InternalReviewTrackingData.cs rename to Adyen/Model/Transfers/InternalReviewTrackingData.cs diff --git a/Adyen/src/Model/Transfers/InvalidField.cs b/Adyen/Model/Transfers/InvalidField.cs similarity index 100% rename from Adyen/src/Model/Transfers/InvalidField.cs rename to Adyen/Model/Transfers/InvalidField.cs diff --git a/Adyen/src/Model/Transfers/IssuedCard.cs b/Adyen/Model/Transfers/IssuedCard.cs similarity index 100% rename from Adyen/src/Model/Transfers/IssuedCard.cs rename to Adyen/Model/Transfers/IssuedCard.cs diff --git a/Adyen/src/Model/Transfers/IssuingTransactionData.cs b/Adyen/Model/Transfers/IssuingTransactionData.cs similarity index 100% rename from Adyen/src/Model/Transfers/IssuingTransactionData.cs rename to Adyen/Model/Transfers/IssuingTransactionData.cs diff --git a/Adyen/src/Model/Transfers/Leg.cs b/Adyen/Model/Transfers/Leg.cs similarity index 100% rename from Adyen/src/Model/Transfers/Leg.cs rename to Adyen/Model/Transfers/Leg.cs diff --git a/Adyen/src/Model/Transfers/Link.cs b/Adyen/Model/Transfers/Link.cs similarity index 100% rename from Adyen/src/Model/Transfers/Link.cs rename to Adyen/Model/Transfers/Link.cs diff --git a/Adyen/src/Model/Transfers/Links.cs b/Adyen/Model/Transfers/Links.cs similarity index 100% rename from Adyen/src/Model/Transfers/Links.cs rename to Adyen/Model/Transfers/Links.cs diff --git a/Adyen/src/Model/Transfers/Lodging.cs b/Adyen/Model/Transfers/Lodging.cs similarity index 100% rename from Adyen/src/Model/Transfers/Lodging.cs rename to Adyen/Model/Transfers/Lodging.cs diff --git a/Adyen/src/Model/Transfers/MerchantData.cs b/Adyen/Model/Transfers/MerchantData.cs similarity index 100% rename from Adyen/src/Model/Transfers/MerchantData.cs rename to Adyen/Model/Transfers/MerchantData.cs diff --git a/Adyen/src/Model/Transfers/MerchantPurchaseData.cs b/Adyen/Model/Transfers/MerchantPurchaseData.cs similarity index 100% rename from Adyen/src/Model/Transfers/MerchantPurchaseData.cs rename to Adyen/Model/Transfers/MerchantPurchaseData.cs diff --git a/Adyen/src/Model/Transfers/Modification.cs b/Adyen/Model/Transfers/Modification.cs similarity index 100% rename from Adyen/src/Model/Transfers/Modification.cs rename to Adyen/Model/Transfers/Modification.cs diff --git a/Adyen/src/Model/Transfers/NOLocalAccountIdentification.cs b/Adyen/Model/Transfers/NOLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/NOLocalAccountIdentification.cs rename to Adyen/Model/Transfers/NOLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/NZLocalAccountIdentification.cs b/Adyen/Model/Transfers/NZLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/NZLocalAccountIdentification.cs rename to Adyen/Model/Transfers/NZLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/NameLocation.cs b/Adyen/Model/Transfers/NameLocation.cs similarity index 100% rename from Adyen/src/Model/Transfers/NameLocation.cs rename to Adyen/Model/Transfers/NameLocation.cs diff --git a/Adyen/src/Model/Transfers/NumberAndBicAccountIdentification.cs b/Adyen/Model/Transfers/NumberAndBicAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/NumberAndBicAccountIdentification.cs rename to Adyen/Model/Transfers/NumberAndBicAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/PLLocalAccountIdentification.cs b/Adyen/Model/Transfers/PLLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/PLLocalAccountIdentification.cs rename to Adyen/Model/Transfers/PLLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/PartyIdentification.cs b/Adyen/Model/Transfers/PartyIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/PartyIdentification.cs rename to Adyen/Model/Transfers/PartyIdentification.cs diff --git a/Adyen/src/Model/Transfers/PaymentInstrument.cs b/Adyen/Model/Transfers/PaymentInstrument.cs similarity index 100% rename from Adyen/src/Model/Transfers/PaymentInstrument.cs rename to Adyen/Model/Transfers/PaymentInstrument.cs diff --git a/Adyen/src/Model/Transfers/PlatformPayment.cs b/Adyen/Model/Transfers/PlatformPayment.cs similarity index 100% rename from Adyen/src/Model/Transfers/PlatformPayment.cs rename to Adyen/Model/Transfers/PlatformPayment.cs diff --git a/Adyen/src/Model/Transfers/RelayedAuthorisationData.cs b/Adyen/Model/Transfers/RelayedAuthorisationData.cs similarity index 100% rename from Adyen/src/Model/Transfers/RelayedAuthorisationData.cs rename to Adyen/Model/Transfers/RelayedAuthorisationData.cs diff --git a/Adyen/src/Model/Transfers/Repayment.cs b/Adyen/Model/Transfers/Repayment.cs similarity index 100% rename from Adyen/src/Model/Transfers/Repayment.cs rename to Adyen/Model/Transfers/Repayment.cs diff --git a/Adyen/src/Model/Transfers/RepaymentTerm.cs b/Adyen/Model/Transfers/RepaymentTerm.cs similarity index 100% rename from Adyen/src/Model/Transfers/RepaymentTerm.cs rename to Adyen/Model/Transfers/RepaymentTerm.cs diff --git a/Adyen/src/Model/Transfers/ResourceReference.cs b/Adyen/Model/Transfers/ResourceReference.cs similarity index 100% rename from Adyen/src/Model/Transfers/ResourceReference.cs rename to Adyen/Model/Transfers/ResourceReference.cs diff --git a/Adyen/src/Model/Transfers/RestServiceError.cs b/Adyen/Model/Transfers/RestServiceError.cs similarity index 100% rename from Adyen/src/Model/Transfers/RestServiceError.cs rename to Adyen/Model/Transfers/RestServiceError.cs diff --git a/Adyen/src/Model/Transfers/ReturnTransferRequest.cs b/Adyen/Model/Transfers/ReturnTransferRequest.cs similarity index 100% rename from Adyen/src/Model/Transfers/ReturnTransferRequest.cs rename to Adyen/Model/Transfers/ReturnTransferRequest.cs diff --git a/Adyen/src/Model/Transfers/ReturnTransferResponse.cs b/Adyen/Model/Transfers/ReturnTransferResponse.cs similarity index 100% rename from Adyen/src/Model/Transfers/ReturnTransferResponse.cs rename to Adyen/Model/Transfers/ReturnTransferResponse.cs diff --git a/Adyen/src/Model/Transfers/RoutingDetails.cs b/Adyen/Model/Transfers/RoutingDetails.cs similarity index 100% rename from Adyen/src/Model/Transfers/RoutingDetails.cs rename to Adyen/Model/Transfers/RoutingDetails.cs diff --git a/Adyen/src/Model/Transfers/SELocalAccountIdentification.cs b/Adyen/Model/Transfers/SELocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/SELocalAccountIdentification.cs rename to Adyen/Model/Transfers/SELocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/SGLocalAccountIdentification.cs b/Adyen/Model/Transfers/SGLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/SGLocalAccountIdentification.cs rename to Adyen/Model/Transfers/SGLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/ServiceError.cs b/Adyen/Model/Transfers/ServiceError.cs similarity index 100% rename from Adyen/src/Model/Transfers/ServiceError.cs rename to Adyen/Model/Transfers/ServiceError.cs diff --git a/Adyen/src/Model/Transfers/ThresholdRepayment.cs b/Adyen/Model/Transfers/ThresholdRepayment.cs similarity index 100% rename from Adyen/src/Model/Transfers/ThresholdRepayment.cs rename to Adyen/Model/Transfers/ThresholdRepayment.cs diff --git a/Adyen/src/Model/Transfers/Transaction.cs b/Adyen/Model/Transfers/Transaction.cs similarity index 100% rename from Adyen/src/Model/Transfers/Transaction.cs rename to Adyen/Model/Transfers/Transaction.cs diff --git a/Adyen/src/Model/Transfers/TransactionEventViolation.cs b/Adyen/Model/Transfers/TransactionEventViolation.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransactionEventViolation.cs rename to Adyen/Model/Transfers/TransactionEventViolation.cs diff --git a/Adyen/src/Model/Transfers/TransactionRuleReference.cs b/Adyen/Model/Transfers/TransactionRuleReference.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransactionRuleReference.cs rename to Adyen/Model/Transfers/TransactionRuleReference.cs diff --git a/Adyen/src/Model/Transfers/TransactionRuleSource.cs b/Adyen/Model/Transfers/TransactionRuleSource.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransactionRuleSource.cs rename to Adyen/Model/Transfers/TransactionRuleSource.cs diff --git a/Adyen/src/Model/Transfers/TransactionRulesResult.cs b/Adyen/Model/Transfers/TransactionRulesResult.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransactionRulesResult.cs rename to Adyen/Model/Transfers/TransactionRulesResult.cs diff --git a/Adyen/src/Model/Transfers/TransactionSearchResponse.cs b/Adyen/Model/Transfers/TransactionSearchResponse.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransactionSearchResponse.cs rename to Adyen/Model/Transfers/TransactionSearchResponse.cs diff --git a/Adyen/src/Model/Transfers/Transfer.cs b/Adyen/Model/Transfers/Transfer.cs similarity index 100% rename from Adyen/src/Model/Transfers/Transfer.cs rename to Adyen/Model/Transfers/Transfer.cs diff --git a/Adyen/src/Model/Transfers/TransferCategoryData.cs b/Adyen/Model/Transfers/TransferCategoryData.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferCategoryData.cs rename to Adyen/Model/Transfers/TransferCategoryData.cs diff --git a/Adyen/src/Model/Transfers/TransferData.cs b/Adyen/Model/Transfers/TransferData.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferData.cs rename to Adyen/Model/Transfers/TransferData.cs diff --git a/Adyen/src/Model/Transfers/TransferDataTracking.cs b/Adyen/Model/Transfers/TransferDataTracking.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferDataTracking.cs rename to Adyen/Model/Transfers/TransferDataTracking.cs diff --git a/Adyen/src/Model/Transfers/TransferEvent.cs b/Adyen/Model/Transfers/TransferEvent.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferEvent.cs rename to Adyen/Model/Transfers/TransferEvent.cs diff --git a/Adyen/src/Model/Transfers/TransferEventEventsDataInner.cs b/Adyen/Model/Transfers/TransferEventEventsDataInner.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferEventEventsDataInner.cs rename to Adyen/Model/Transfers/TransferEventEventsDataInner.cs diff --git a/Adyen/src/Model/Transfers/TransferEventTrackingData.cs b/Adyen/Model/Transfers/TransferEventTrackingData.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferEventTrackingData.cs rename to Adyen/Model/Transfers/TransferEventTrackingData.cs diff --git a/Adyen/src/Model/Transfers/TransferInfo.cs b/Adyen/Model/Transfers/TransferInfo.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferInfo.cs rename to Adyen/Model/Transfers/TransferInfo.cs diff --git a/Adyen/src/Model/Transfers/TransferNotificationCounterParty.cs b/Adyen/Model/Transfers/TransferNotificationCounterParty.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferNotificationCounterParty.cs rename to Adyen/Model/Transfers/TransferNotificationCounterParty.cs diff --git a/Adyen/src/Model/Transfers/TransferNotificationMerchantData.cs b/Adyen/Model/Transfers/TransferNotificationMerchantData.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferNotificationMerchantData.cs rename to Adyen/Model/Transfers/TransferNotificationMerchantData.cs diff --git a/Adyen/src/Model/Transfers/TransferNotificationValidationFact.cs b/Adyen/Model/Transfers/TransferNotificationValidationFact.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferNotificationValidationFact.cs rename to Adyen/Model/Transfers/TransferNotificationValidationFact.cs diff --git a/Adyen/src/Model/Transfers/TransferRequestReview.cs b/Adyen/Model/Transfers/TransferRequestReview.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferRequestReview.cs rename to Adyen/Model/Transfers/TransferRequestReview.cs diff --git a/Adyen/src/Model/Transfers/TransferReview.cs b/Adyen/Model/Transfers/TransferReview.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferReview.cs rename to Adyen/Model/Transfers/TransferReview.cs diff --git a/Adyen/src/Model/Transfers/TransferServiceRestServiceError.cs b/Adyen/Model/Transfers/TransferServiceRestServiceError.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferServiceRestServiceError.cs rename to Adyen/Model/Transfers/TransferServiceRestServiceError.cs diff --git a/Adyen/src/Model/Transfers/TransferView.cs b/Adyen/Model/Transfers/TransferView.cs similarity index 100% rename from Adyen/src/Model/Transfers/TransferView.cs rename to Adyen/Model/Transfers/TransferView.cs diff --git a/Adyen/src/Model/Transfers/UKLocalAccountIdentification.cs b/Adyen/Model/Transfers/UKLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/UKLocalAccountIdentification.cs rename to Adyen/Model/Transfers/UKLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/USLocalAccountIdentification.cs b/Adyen/Model/Transfers/USLocalAccountIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/USLocalAccountIdentification.cs rename to Adyen/Model/Transfers/USLocalAccountIdentification.cs diff --git a/Adyen/src/Model/Transfers/UltimatePartyIdentification.cs b/Adyen/Model/Transfers/UltimatePartyIdentification.cs similarity index 100% rename from Adyen/src/Model/Transfers/UltimatePartyIdentification.cs rename to Adyen/Model/Transfers/UltimatePartyIdentification.cs diff --git a/Adyen/src/Security/AesEncryptor.cs b/Adyen/Security/AesEncryptor.cs similarity index 100% rename from Adyen/src/Security/AesEncryptor.cs rename to Adyen/Security/AesEncryptor.cs diff --git a/Adyen/src/Security/EncryptionCredentialDetails.cs b/Adyen/Security/EncryptionCredentialDetails.cs similarity index 100% rename from Adyen/src/Security/EncryptionCredentialDetails.cs rename to Adyen/Security/EncryptionCredentialDetails.cs diff --git a/Adyen/src/Security/EncryptionDerivedKey.cs b/Adyen/Security/EncryptionDerivedKey.cs similarity index 100% rename from Adyen/src/Security/EncryptionDerivedKey.cs rename to Adyen/Security/EncryptionDerivedKey.cs diff --git a/Adyen/src/Security/EncryptionDerivedKeyGenerator.cs b/Adyen/Security/EncryptionDerivedKeyGenerator.cs similarity index 100% rename from Adyen/src/Security/EncryptionDerivedKeyGenerator.cs rename to Adyen/Security/EncryptionDerivedKeyGenerator.cs diff --git a/Adyen/src/Security/Exceptions/NexoCryptoException.cs b/Adyen/Security/Exceptions/NexoCryptoException.cs similarity index 100% rename from Adyen/src/Security/Exceptions/NexoCryptoException.cs rename to Adyen/Security/Exceptions/NexoCryptoException.cs diff --git a/Adyen/src/Security/Extension/ArrayExtension.cs b/Adyen/Security/Extension/ArrayExtension.cs similarity index 100% rename from Adyen/src/Security/Extension/ArrayExtension.cs rename to Adyen/Security/Extension/ArrayExtension.cs diff --git a/Adyen/src/Security/HmacSha256Wrapper.cs b/Adyen/Security/HmacSha256Wrapper.cs similarity index 100% rename from Adyen/src/Security/HmacSha256Wrapper.cs rename to Adyen/Security/HmacSha256Wrapper.cs diff --git a/Adyen/src/Security/IvModGenerator.cs b/Adyen/Security/IvModGenerator.cs similarity index 100% rename from Adyen/src/Security/IvModGenerator.cs rename to Adyen/Security/IvModGenerator.cs diff --git a/Adyen/src/Security/SaleToPoiMessageSecured.cs b/Adyen/Security/SaleToPoiMessageSecured.cs similarity index 100% rename from Adyen/src/Security/SaleToPoiMessageSecured.cs rename to Adyen/Security/SaleToPoiMessageSecured.cs diff --git a/Adyen/src/Security/SaleToPoiMessageSecuredEncryptor.cs b/Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs similarity index 100% rename from Adyen/src/Security/SaleToPoiMessageSecuredEncryptor.cs rename to Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs diff --git a/Adyen/src/Security/SecurityTrailer.cs b/Adyen/Security/SecurityTrailer.cs similarity index 100% rename from Adyen/src/Security/SecurityTrailer.cs rename to Adyen/Security/SecurityTrailer.cs diff --git a/Adyen/src/Security/TerminalCommonNameValidator.cs b/Adyen/Security/TerminalCommonNameValidator.cs similarity index 100% rename from Adyen/src/Security/TerminalCommonNameValidator.cs rename to Adyen/Security/TerminalCommonNameValidator.cs diff --git a/Adyen/src/Service/AbstractService.cs b/Adyen/Service/AbstractService.cs similarity index 100% rename from Adyen/src/Service/AbstractService.cs rename to Adyen/Service/AbstractService.cs diff --git a/Adyen/src/Service/ApiException.cs b/Adyen/Service/ApiException.cs similarity index 100% rename from Adyen/src/Service/ApiException.cs rename to Adyen/Service/ApiException.cs diff --git a/Adyen/src/Service/BalanceControlService.cs b/Adyen/Service/BalanceControlService.cs similarity index 100% rename from Adyen/src/Service/BalanceControlService.cs rename to Adyen/Service/BalanceControlService.cs diff --git a/Adyen/src/Service/BalancePlatform/AccountHoldersService.cs b/Adyen/Service/BalancePlatform/AccountHoldersService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/AccountHoldersService.cs rename to Adyen/Service/BalancePlatform/AccountHoldersService.cs diff --git a/Adyen/src/Service/BalancePlatform/BalanceAccountsService.cs b/Adyen/Service/BalancePlatform/BalanceAccountsService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/BalanceAccountsService.cs rename to Adyen/Service/BalancePlatform/BalanceAccountsService.cs diff --git a/Adyen/src/Service/BalancePlatform/BankAccountValidationService.cs b/Adyen/Service/BalancePlatform/BankAccountValidationService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/BankAccountValidationService.cs rename to Adyen/Service/BalancePlatform/BankAccountValidationService.cs diff --git a/Adyen/src/Service/BalancePlatform/CardOrdersService.cs b/Adyen/Service/BalancePlatform/CardOrdersService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/CardOrdersService.cs rename to Adyen/Service/BalancePlatform/CardOrdersService.cs diff --git a/Adyen/src/Service/BalancePlatform/GrantAccountsService.cs b/Adyen/Service/BalancePlatform/GrantAccountsService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/GrantAccountsService.cs rename to Adyen/Service/BalancePlatform/GrantAccountsService.cs diff --git a/Adyen/src/Service/BalancePlatform/GrantOffersService.cs b/Adyen/Service/BalancePlatform/GrantOffersService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/GrantOffersService.cs rename to Adyen/Service/BalancePlatform/GrantOffersService.cs diff --git a/Adyen/src/Service/BalancePlatform/ManageCardPINService.cs b/Adyen/Service/BalancePlatform/ManageCardPINService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/ManageCardPINService.cs rename to Adyen/Service/BalancePlatform/ManageCardPINService.cs diff --git a/Adyen/src/Service/BalancePlatform/ManageSCADevicesService.cs b/Adyen/Service/BalancePlatform/ManageSCADevicesService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/ManageSCADevicesService.cs rename to Adyen/Service/BalancePlatform/ManageSCADevicesService.cs diff --git a/Adyen/src/Service/BalancePlatform/NetworkTokensService.cs b/Adyen/Service/BalancePlatform/NetworkTokensService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/NetworkTokensService.cs rename to Adyen/Service/BalancePlatform/NetworkTokensService.cs diff --git a/Adyen/src/Service/BalancePlatform/PaymentInstrumentGroupsService.cs b/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/PaymentInstrumentGroupsService.cs rename to Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs diff --git a/Adyen/src/Service/BalancePlatform/PaymentInstrumentsService.cs b/Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/PaymentInstrumentsService.cs rename to Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs diff --git a/Adyen/src/Service/BalancePlatform/PlatformService.cs b/Adyen/Service/BalancePlatform/PlatformService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/PlatformService.cs rename to Adyen/Service/BalancePlatform/PlatformService.cs diff --git a/Adyen/src/Service/BalancePlatform/TransactionRulesService.cs b/Adyen/Service/BalancePlatform/TransactionRulesService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/TransactionRulesService.cs rename to Adyen/Service/BalancePlatform/TransactionRulesService.cs diff --git a/Adyen/src/Service/BalancePlatform/TransferRoutesService.cs b/Adyen/Service/BalancePlatform/TransferRoutesService.cs similarity index 100% rename from Adyen/src/Service/BalancePlatform/TransferRoutesService.cs rename to Adyen/Service/BalancePlatform/TransferRoutesService.cs diff --git a/Adyen/src/Service/BinLookupService.cs b/Adyen/Service/BinLookupService.cs similarity index 100% rename from Adyen/src/Service/BinLookupService.cs rename to Adyen/Service/BinLookupService.cs diff --git a/Adyen/src/Service/Checkout/DonationsService.cs b/Adyen/Service/Checkout/DonationsService.cs similarity index 100% rename from Adyen/src/Service/Checkout/DonationsService.cs rename to Adyen/Service/Checkout/DonationsService.cs diff --git a/Adyen/src/Service/Checkout/ModificationsService.cs b/Adyen/Service/Checkout/ModificationsService.cs similarity index 100% rename from Adyen/src/Service/Checkout/ModificationsService.cs rename to Adyen/Service/Checkout/ModificationsService.cs diff --git a/Adyen/src/Service/Checkout/OrdersService.cs b/Adyen/Service/Checkout/OrdersService.cs similarity index 100% rename from Adyen/src/Service/Checkout/OrdersService.cs rename to Adyen/Service/Checkout/OrdersService.cs diff --git a/Adyen/src/Service/Checkout/PaymentLinksService.cs b/Adyen/Service/Checkout/PaymentLinksService.cs similarity index 100% rename from Adyen/src/Service/Checkout/PaymentLinksService.cs rename to Adyen/Service/Checkout/PaymentLinksService.cs diff --git a/Adyen/src/Service/Checkout/PaymentsService.cs b/Adyen/Service/Checkout/PaymentsService.cs similarity index 100% rename from Adyen/src/Service/Checkout/PaymentsService.cs rename to Adyen/Service/Checkout/PaymentsService.cs diff --git a/Adyen/src/Service/Checkout/RecurringService.cs b/Adyen/Service/Checkout/RecurringService.cs similarity index 100% rename from Adyen/src/Service/Checkout/RecurringService.cs rename to Adyen/Service/Checkout/RecurringService.cs diff --git a/Adyen/src/Service/Checkout/UtilityService.cs b/Adyen/Service/Checkout/UtilityService.cs similarity index 100% rename from Adyen/src/Service/Checkout/UtilityService.cs rename to Adyen/Service/Checkout/UtilityService.cs diff --git a/Adyen/src/Service/DataProtectionService.cs b/Adyen/Service/DataProtectionService.cs similarity index 100% rename from Adyen/src/Service/DataProtectionService.cs rename to Adyen/Service/DataProtectionService.cs diff --git a/Adyen/src/Service/DisputesService.cs b/Adyen/Service/DisputesService.cs similarity index 100% rename from Adyen/src/Service/DisputesService.cs rename to Adyen/Service/DisputesService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/BusinessLinesService.cs b/Adyen/Service/LegalEntityManagement/BusinessLinesService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/BusinessLinesService.cs rename to Adyen/Service/LegalEntityManagement/BusinessLinesService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/DocumentsService.cs b/Adyen/Service/LegalEntityManagement/DocumentsService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/DocumentsService.cs rename to Adyen/Service/LegalEntityManagement/DocumentsService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/HostedOnboardingService.cs b/Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/HostedOnboardingService.cs rename to Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/LegalEntitiesService.cs b/Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/LegalEntitiesService.cs rename to Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/PCIQuestionnairesService.cs b/Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/PCIQuestionnairesService.cs rename to Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs b/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs rename to Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/TermsOfServiceService.cs b/Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/TermsOfServiceService.cs rename to Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs diff --git a/Adyen/src/Service/LegalEntityManagement/TransferInstrumentsService.cs b/Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs similarity index 100% rename from Adyen/src/Service/LegalEntityManagement/TransferInstrumentsService.cs rename to Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs diff --git a/Adyen/src/Service/Management/APICredentialsCompanyLevelService.cs b/Adyen/Service/Management/APICredentialsCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/APICredentialsCompanyLevelService.cs rename to Adyen/Service/Management/APICredentialsCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/APICredentialsMerchantLevelService.cs b/Adyen/Service/Management/APICredentialsMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/APICredentialsMerchantLevelService.cs rename to Adyen/Service/Management/APICredentialsMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/APIKeyCompanyLevelService.cs b/Adyen/Service/Management/APIKeyCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/APIKeyCompanyLevelService.cs rename to Adyen/Service/Management/APIKeyCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/APIKeyMerchantLevelService.cs b/Adyen/Service/Management/APIKeyMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/APIKeyMerchantLevelService.cs rename to Adyen/Service/Management/APIKeyMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/AccountCompanyLevelService.cs b/Adyen/Service/Management/AccountCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/AccountCompanyLevelService.cs rename to Adyen/Service/Management/AccountCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/AccountMerchantLevelService.cs b/Adyen/Service/Management/AccountMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/AccountMerchantLevelService.cs rename to Adyen/Service/Management/AccountMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/AccountStoreLevelService.cs b/Adyen/Service/Management/AccountStoreLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/AccountStoreLevelService.cs rename to Adyen/Service/Management/AccountStoreLevelService.cs diff --git a/Adyen/src/Service/Management/AllowedOriginsCompanyLevelService.cs b/Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/AllowedOriginsCompanyLevelService.cs rename to Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/AllowedOriginsMerchantLevelService.cs b/Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/AllowedOriginsMerchantLevelService.cs rename to Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/AndroidFilesCompanyLevelService.cs b/Adyen/Service/Management/AndroidFilesCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/AndroidFilesCompanyLevelService.cs rename to Adyen/Service/Management/AndroidFilesCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/ClientKeyCompanyLevelService.cs b/Adyen/Service/Management/ClientKeyCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/ClientKeyCompanyLevelService.cs rename to Adyen/Service/Management/ClientKeyCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/ClientKeyMerchantLevelService.cs b/Adyen/Service/Management/ClientKeyMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/ClientKeyMerchantLevelService.cs rename to Adyen/Service/Management/ClientKeyMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/MyAPICredentialService.cs b/Adyen/Service/Management/MyAPICredentialService.cs similarity index 100% rename from Adyen/src/Service/Management/MyAPICredentialService.cs rename to Adyen/Service/Management/MyAPICredentialService.cs diff --git a/Adyen/src/Service/Management/PaymentMethodsMerchantLevelService.cs b/Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/PaymentMethodsMerchantLevelService.cs rename to Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/PayoutSettingsMerchantLevelService.cs b/Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/PayoutSettingsMerchantLevelService.cs rename to Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/SplitConfigurationMerchantLevelService.cs b/Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/SplitConfigurationMerchantLevelService.cs rename to Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalActionsCompanyLevelService.cs b/Adyen/Service/Management/TerminalActionsCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalActionsCompanyLevelService.cs rename to Adyen/Service/Management/TerminalActionsCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalActionsTerminalLevelService.cs b/Adyen/Service/Management/TerminalActionsTerminalLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalActionsTerminalLevelService.cs rename to Adyen/Service/Management/TerminalActionsTerminalLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalOrdersCompanyLevelService.cs b/Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalOrdersCompanyLevelService.cs rename to Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalOrdersMerchantLevelService.cs b/Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalOrdersMerchantLevelService.cs rename to Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalSettingsCompanyLevelService.cs b/Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalSettingsCompanyLevelService.cs rename to Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalSettingsMerchantLevelService.cs b/Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalSettingsMerchantLevelService.cs rename to Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalSettingsStoreLevelService.cs b/Adyen/Service/Management/TerminalSettingsStoreLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalSettingsStoreLevelService.cs rename to Adyen/Service/Management/TerminalSettingsStoreLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalSettingsTerminalLevelService.cs b/Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalSettingsTerminalLevelService.cs rename to Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs diff --git a/Adyen/src/Service/Management/TerminalsTerminalLevelService.cs b/Adyen/Service/Management/TerminalsTerminalLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/TerminalsTerminalLevelService.cs rename to Adyen/Service/Management/TerminalsTerminalLevelService.cs diff --git a/Adyen/src/Service/Management/UsersCompanyLevelService.cs b/Adyen/Service/Management/UsersCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/UsersCompanyLevelService.cs rename to Adyen/Service/Management/UsersCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/UsersMerchantLevelService.cs b/Adyen/Service/Management/UsersMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/UsersMerchantLevelService.cs rename to Adyen/Service/Management/UsersMerchantLevelService.cs diff --git a/Adyen/src/Service/Management/WebhooksCompanyLevelService.cs b/Adyen/Service/Management/WebhooksCompanyLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/WebhooksCompanyLevelService.cs rename to Adyen/Service/Management/WebhooksCompanyLevelService.cs diff --git a/Adyen/src/Service/Management/WebhooksMerchantLevelService.cs b/Adyen/Service/Management/WebhooksMerchantLevelService.cs similarity index 100% rename from Adyen/src/Service/Management/WebhooksMerchantLevelService.cs rename to Adyen/Service/Management/WebhooksMerchantLevelService.cs diff --git a/Adyen/src/Service/PaymentService.cs b/Adyen/Service/PaymentService.cs similarity index 100% rename from Adyen/src/Service/PaymentService.cs rename to Adyen/Service/PaymentService.cs diff --git a/Adyen/src/Service/PaymentsAppService.cs b/Adyen/Service/PaymentsAppService.cs similarity index 100% rename from Adyen/src/Service/PaymentsAppService.cs rename to Adyen/Service/PaymentsAppService.cs diff --git a/Adyen/src/Service/Payout/InitializationService.cs b/Adyen/Service/Payout/InitializationService.cs similarity index 100% rename from Adyen/src/Service/Payout/InitializationService.cs rename to Adyen/Service/Payout/InitializationService.cs diff --git a/Adyen/src/Service/Payout/InstantPayoutsService.cs b/Adyen/Service/Payout/InstantPayoutsService.cs similarity index 100% rename from Adyen/src/Service/Payout/InstantPayoutsService.cs rename to Adyen/Service/Payout/InstantPayoutsService.cs diff --git a/Adyen/src/Service/Payout/ReviewingService.cs b/Adyen/Service/Payout/ReviewingService.cs similarity index 100% rename from Adyen/src/Service/Payout/ReviewingService.cs rename to Adyen/Service/Payout/ReviewingService.cs diff --git a/Adyen/src/Service/PlatformsAccount/AccountHoldersService.cs b/Adyen/Service/PlatformsAccount/AccountHoldersService.cs similarity index 100% rename from Adyen/src/Service/PlatformsAccount/AccountHoldersService.cs rename to Adyen/Service/PlatformsAccount/AccountHoldersService.cs diff --git a/Adyen/src/Service/PlatformsAccount/AccountsService.cs b/Adyen/Service/PlatformsAccount/AccountsService.cs similarity index 100% rename from Adyen/src/Service/PlatformsAccount/AccountsService.cs rename to Adyen/Service/PlatformsAccount/AccountsService.cs diff --git a/Adyen/src/Service/PlatformsAccount/VerificationService.cs b/Adyen/Service/PlatformsAccount/VerificationService.cs similarity index 100% rename from Adyen/src/Service/PlatformsAccount/VerificationService.cs rename to Adyen/Service/PlatformsAccount/VerificationService.cs diff --git a/Adyen/src/Service/PlatformsFundService.cs b/Adyen/Service/PlatformsFundService.cs similarity index 100% rename from Adyen/src/Service/PlatformsFundService.cs rename to Adyen/Service/PlatformsFundService.cs diff --git a/Adyen/src/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs b/Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs similarity index 100% rename from Adyen/src/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs rename to Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs diff --git a/Adyen/src/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs b/Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs similarity index 100% rename from Adyen/src/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs rename to Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs diff --git a/Adyen/src/Service/PlatformsNotificationConfigurationService.cs b/Adyen/Service/PlatformsNotificationConfigurationService.cs similarity index 100% rename from Adyen/src/Service/PlatformsNotificationConfigurationService.cs rename to Adyen/Service/PlatformsNotificationConfigurationService.cs diff --git a/Adyen/src/Service/PosMobileService.cs b/Adyen/Service/PosMobileService.cs similarity index 100% rename from Adyen/src/Service/PosMobileService.cs rename to Adyen/Service/PosMobileService.cs diff --git a/Adyen/src/Service/PosTerminalManagementService.cs b/Adyen/Service/PosTerminalManagementService.cs similarity index 100% rename from Adyen/src/Service/PosTerminalManagementService.cs rename to Adyen/Service/PosTerminalManagementService.cs diff --git a/Adyen/src/Service/RecurringService.cs b/Adyen/Service/RecurringService.cs similarity index 100% rename from Adyen/src/Service/RecurringService.cs rename to Adyen/Service/RecurringService.cs diff --git a/Adyen/src/Service/Resource/Terminal/TerminalApi.cs b/Adyen/Service/Resource/Terminal/TerminalApi.cs similarity index 100% rename from Adyen/src/Service/Resource/Terminal/TerminalApi.cs rename to Adyen/Service/Resource/Terminal/TerminalApi.cs diff --git a/Adyen/src/Service/Resource/Terminal/TerminalApiAsyncClient.cs b/Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs similarity index 100% rename from Adyen/src/Service/Resource/Terminal/TerminalApiAsyncClient.cs rename to Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs diff --git a/Adyen/src/Service/Resource/Terminal/TerminalApiLocal.cs b/Adyen/Service/Resource/Terminal/TerminalApiLocal.cs similarity index 100% rename from Adyen/src/Service/Resource/Terminal/TerminalApiLocal.cs rename to Adyen/Service/Resource/Terminal/TerminalApiLocal.cs diff --git a/Adyen/src/Service/Resource/Terminal/TerminalApiLocalClient.cs b/Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs similarity index 100% rename from Adyen/src/Service/Resource/Terminal/TerminalApiLocalClient.cs rename to Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs diff --git a/Adyen/src/Service/Resource/Terminal/TerminalApiSyncClient.cs b/Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs similarity index 100% rename from Adyen/src/Service/Resource/Terminal/TerminalApiSyncClient.cs rename to Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs diff --git a/Adyen/src/Service/ServiceResource.cs b/Adyen/Service/ServiceResource.cs similarity index 100% rename from Adyen/src/Service/ServiceResource.cs rename to Adyen/Service/ServiceResource.cs diff --git a/Adyen/src/Service/StoredValueService.cs b/Adyen/Service/StoredValueService.cs similarity index 100% rename from Adyen/src/Service/StoredValueService.cs rename to Adyen/Service/StoredValueService.cs diff --git a/Adyen/src/Service/TerminalApiAsyncService.cs b/Adyen/Service/TerminalApiAsyncService.cs similarity index 100% rename from Adyen/src/Service/TerminalApiAsyncService.cs rename to Adyen/Service/TerminalApiAsyncService.cs diff --git a/Adyen/src/Service/TerminalApiLocalService.cs b/Adyen/Service/TerminalApiLocalService.cs similarity index 100% rename from Adyen/src/Service/TerminalApiLocalService.cs rename to Adyen/Service/TerminalApiLocalService.cs diff --git a/Adyen/src/Service/TerminalApiSyncService.cs b/Adyen/Service/TerminalApiSyncService.cs similarity index 100% rename from Adyen/src/Service/TerminalApiSyncService.cs rename to Adyen/Service/TerminalApiSyncService.cs diff --git a/Adyen/src/Service/TerminalCloudApi.cs b/Adyen/Service/TerminalCloudApi.cs similarity index 100% rename from Adyen/src/Service/TerminalCloudApi.cs rename to Adyen/Service/TerminalCloudApi.cs diff --git a/Adyen/src/Service/TerminalLocalApi.cs b/Adyen/Service/TerminalLocalApi.cs similarity index 100% rename from Adyen/src/Service/TerminalLocalApi.cs rename to Adyen/Service/TerminalLocalApi.cs diff --git a/Adyen/src/Service/TerminalLocalApiUnencrypted.cs b/Adyen/Service/TerminalLocalApiUnencrypted.cs similarity index 100% rename from Adyen/src/Service/TerminalLocalApiUnencrypted.cs rename to Adyen/Service/TerminalLocalApiUnencrypted.cs diff --git a/Adyen/src/Service/Transfers/CapitalService.cs b/Adyen/Service/Transfers/CapitalService.cs similarity index 100% rename from Adyen/src/Service/Transfers/CapitalService.cs rename to Adyen/Service/Transfers/CapitalService.cs diff --git a/Adyen/src/Service/Transfers/TransactionsService.cs b/Adyen/Service/Transfers/TransactionsService.cs similarity index 100% rename from Adyen/src/Service/Transfers/TransactionsService.cs rename to Adyen/Service/Transfers/TransactionsService.cs diff --git a/Adyen/src/Service/Transfers/TransfersService.cs b/Adyen/Service/Transfers/TransfersService.cs similarity index 100% rename from Adyen/src/Service/Transfers/TransfersService.cs rename to Adyen/Service/Transfers/TransfersService.cs diff --git a/Adyen/src/Util/ByteArrayConverter.cs b/Adyen/Util/ByteArrayConverter.cs similarity index 100% rename from Adyen/src/Util/ByteArrayConverter.cs rename to Adyen/Util/ByteArrayConverter.cs diff --git a/Adyen/src/Util/HMACValidator.cs b/Adyen/Util/HMACValidator.cs similarity index 100% rename from Adyen/src/Util/HMACValidator.cs rename to Adyen/Util/HMACValidator.cs diff --git a/Adyen/src/Util/JsonOperation.cs b/Adyen/Util/JsonOperation.cs similarity index 100% rename from Adyen/src/Util/JsonOperation.cs rename to Adyen/Util/JsonOperation.cs diff --git a/Adyen/src/Util/TerminalApi/AdditionalResponse.cs b/Adyen/Util/TerminalApi/AdditionalResponse.cs similarity index 100% rename from Adyen/src/Util/TerminalApi/AdditionalResponse.cs rename to Adyen/Util/TerminalApi/AdditionalResponse.cs diff --git a/Adyen/src/Util/TerminalApi/CardAcquisitionUtil.cs b/Adyen/Util/TerminalApi/CardAcquisitionUtil.cs similarity index 100% rename from Adyen/src/Util/TerminalApi/CardAcquisitionUtil.cs rename to Adyen/Util/TerminalApi/CardAcquisitionUtil.cs diff --git a/Adyen/src/Util/Util.cs b/Adyen/Util/Util.cs similarity index 100% rename from Adyen/src/Util/Util.cs rename to Adyen/Util/Util.cs diff --git a/Adyen/src/Webhooks/BalancePlatformWebhookHandler.cs b/Adyen/Webhooks/BalancePlatformWebhookHandler.cs similarity index 100% rename from Adyen/src/Webhooks/BalancePlatformWebhookHandler.cs rename to Adyen/Webhooks/BalancePlatformWebhookHandler.cs diff --git a/Adyen/src/Webhooks/ClassicPlatformWebhookHandler.cs b/Adyen/Webhooks/ClassicPlatformWebhookHandler.cs similarity index 100% rename from Adyen/src/Webhooks/ClassicPlatformWebhookHandler.cs rename to Adyen/Webhooks/ClassicPlatformWebhookHandler.cs diff --git a/Adyen/src/Webhooks/ManagementWebhookHandler.cs b/Adyen/Webhooks/ManagementWebhookHandler.cs similarity index 100% rename from Adyen/src/Webhooks/ManagementWebhookHandler.cs rename to Adyen/Webhooks/ManagementWebhookHandler.cs diff --git a/Adyen/src/Webhooks/WebhookHandler.cs b/Adyen/Webhooks/WebhookHandler.cs similarity index 100% rename from Adyen/src/Webhooks/WebhookHandler.cs rename to Adyen/Webhooks/WebhookHandler.cs From 4d7eeeb35b2223a17f70a7c0f49f4a1240211e2a Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 29 Oct 2025 13:48:10 +0100 Subject: [PATCH 078/126] Move TerminalApi classes into its own folder /TerminalApi Rename Webhooks-folder to WebhookHandlers for consistency --- .../ApiSerialization/Converter/JsonBase64Converter.cs | 0 .../ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs | 0 .../ApiSerialization/Converter/JsonConvertSerializerWrapper.cs | 0 .../ApiSerialization/Converter/SaleToPoiMessageConverter.cs | 0 .../Converter/SaleToPoiMessageSecuredConverter.cs | 0 Adyen/{ => TerminalApi}/ApiSerialization/IMessagePayload.cs | 0 .../ApiSerialization/IMessagePayloadSerializer.cs | 0 .../{ => TerminalApi}/ApiSerialization/MessageHeaderSerializer.cs | 0 .../ApiSerialization/MessagePayloadSerializer.cs | 0 .../ApiSerialization/MessagePayloadSerializerFactory.cs | 0 Adyen/{ => TerminalApi}/ApiSerialization/OpenAPIDateConverter.cs | 0 .../ApiSerialization/SaleToPoiMessageSecuredSerializer.cs | 0 .../ApiSerialization/SaleToPoiMessageSerializer.cs | 0 Adyen/{ => TerminalApi}/ApiSerialization/TypeHelper.cs | 0 .../Resource/Terminal => TerminalApi/Clients}/TerminalApi.cs | 0 .../Terminal => TerminalApi/Clients}/TerminalApiAsyncClient.cs | 0 .../Resource/Terminal => TerminalApi/Clients}/TerminalApiLocal.cs | 0 .../Terminal => TerminalApi/Clients}/TerminalApiLocalClient.cs | 0 .../Terminal => TerminalApi/Clients}/TerminalApiSyncClient.cs | 0 Adyen/{ => TerminalApi}/Constants/ApiConstants.cs | 0 Adyen/{ => TerminalApi}/Constants/ClientConfig.cs | 0 Adyen/{ => TerminalApi}/Constants/Region.cs | 0 Adyen/{ => TerminalApi}/Exceptions/DeserializationException.cs | 0 Adyen/{ => TerminalApi}/Exceptions/ExceptionMessages.cs | 0 Adyen/{ => TerminalApi}/HttpClient/HttpClientException.cs | 0 Adyen/{ => TerminalApi}/HttpClient/HttpClientExtension.cs | 0 Adyen/{ => TerminalApi}/HttpClient/HttpClientWrapper.cs | 0 Adyen/{ => TerminalApi}/HttpClient/Interfaces/IClient.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/AbortRequest.cs | 0 Adyen/{Service => TerminalApi/Models}/AbstractService.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/AccountType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/AdminRequest.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/AdminResponse.cs | 0 .../TerminalApi => TerminalApi/Models}/AlgorithmIdentifier.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/AlgorithmType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/AlignmentType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/AllowedProduct.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/Amount.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/AmountsReq.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/AmountsResp.cs | 0 Adyen/{Service => TerminalApi/Models}/ApiException.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/AreaSize.cs | 0 .../TerminalApi => TerminalApi/Models}/AuthenticatedData.cs | 0 .../Models}/AuthenticationMethodType.cs | 0 .../TerminalApi => TerminalApi/Models}/BalanceInquiryRequest.cs | 0 .../TerminalApi => TerminalApi/Models}/BalanceInquiryResponse.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/BarcodeType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/BatchRequest.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/BatchResponse.cs | 0 .../TerminalApi => TerminalApi/Models}/CapturedSignature.cs | 0 .../TerminalApi => TerminalApi/Models}/CardAcquisitionRequest.cs | 0 .../TerminalApi => TerminalApi/Models}/CardAcquisitionResponse.cs | 0 .../Models}/CardAcquisitionTransaction.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/CardData.cs | 0 .../TerminalApi => TerminalApi/Models}/CardReaderAPDURequest.cs | 0 .../TerminalApi => TerminalApi/Models}/CardReaderAPDUResponse.cs | 0 .../TerminalApi => TerminalApi/Models}/CardReaderInitRequest.cs | 0 .../TerminalApi => TerminalApi/Models}/CardReaderInitResponse.cs | 0 .../Models}/CardReaderPowerOffRequest.cs | 0 .../Models}/CardReaderPowerOffResponse.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/CardholderPIN.cs | 0 .../TerminalApi => TerminalApi/Models}/CashHandlingDevice.cs | 0 .../TerminalApi => TerminalApi/Models}/CharacterHeightType.cs | 0 .../TerminalApi => TerminalApi/Models}/CharacterStyleType.cs | 0 .../TerminalApi => TerminalApi/Models}/CharacterWidthType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/CheckData.cs | 0 .../TerminalApi => TerminalApi/Models}/CheckTypeCodeType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/CoinsOrBills.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/ColorType.cs | 0 .../TerminalApi => TerminalApi/Models}/ContentInformation.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/ContentType.cs | 0 .../TerminalApi => TerminalApi/Models}/CurrencyConversion.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/CustomerOrder.cs | 0 .../TerminalApi => TerminalApi/Models}/CustomerOrderReqType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/DeviceType.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/DiagnosisRequest.cs | 0 .../TerminalApi => TerminalApi/Models}/DiagnosisResponse.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/DigestedData.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/DisplayOutput.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/DisplayRequest.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/DisplayResponse.cs | 0 .../TerminalApi => TerminalApi/Models}/DocumentQualifierType.cs | 0 .../TerminalApi => TerminalApi/Models}/EnableServiceRequest.cs | 0 .../TerminalApi => TerminalApi/Models}/EnableServiceResponse.cs | 0 .../TerminalApi => TerminalApi/Models}/EncapsulatedContent.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/EncryptedContent.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/EntryModeType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/EnvelopedData.cs | 0 .../TerminalApi => TerminalApi/Models}/ErrorConditionType.cs | 0 .../TerminalApi => TerminalApi/Models}/EventNotification.cs | 0 .../TerminalApi => TerminalApi/Models}/EventToNotifyType.cs | 0 .../TerminalApi => TerminalApi/Models}/ForceTypeModeType.cs | 0 .../TerminalApi => TerminalApi/Models}/GenericProfileType.cs | 0 .../TerminalApi => TerminalApi/Models}/GeographicCoordinates.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/Geolocation.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/GetTotalsRequest.cs | 0 .../TerminalApi => TerminalApi/Models}/GetTotalsResponse.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/GlobalStatusType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/HostStatus.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/ICCResetData.cs | 0 .../Models}/IdentificationSupportType.cs | 0 .../TerminalApi => TerminalApi/Models}/IdentificationType.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/InfoQualifyType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/Input.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/InputCommandType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/InputData.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/InputRequest.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/InputResponse.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/InputResult.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/InputUpdate.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/Instalment.cs | 0 .../TerminalApi => TerminalApi/Models}/IssuerAndSerialNumber.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/KEK.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/KEKIdentifier.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/KeyTransport.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/LoginRequest.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/LoginResponse.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/LogoutRequest.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/LogoutResponse.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyAccount.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/LoyaltyAccountID.cs | 0 .../TerminalApi => TerminalApi/Models}/LoyaltyAccountReq.cs | 0 .../TerminalApi => TerminalApi/Models}/LoyaltyAccountStatus.cs | 0 .../TerminalApi => TerminalApi/Models}/LoyaltyAcquirerData.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyAmount.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyData.cs | 0 .../TerminalApi => TerminalApi/Models}/LoyaltyHandlingType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyRequest.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/LoyaltyResponse.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyResult.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyTotals.cs | 0 .../TerminalApi => TerminalApi/Models}/LoyaltyTransaction.cs | 0 .../TerminalApi => TerminalApi/Models}/LoyaltyTransactionType.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/LoyaltyUnitType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/MenuEntry.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/MenuEntryTagType.cs | 0 .../TerminalApi => TerminalApi/Models}/MessageCategoryType.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/MessageClassType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/MessageHeader.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/MessageReference.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/MessageType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/MobileData.cs | 0 .../TerminalApi => TerminalApi/Models}/NamedKeyEncryptedData.cs | 0 .../TerminalApi => TerminalApi/Models}/OriginalPOITransaction.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/OutputBarcode.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/OutputContent.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/OutputFormatType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/OutputResult.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/OutputText.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PINFormatType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PINRequest.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PINRequestType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PINResponse.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/POIData.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/POIProfile.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/POISoftware.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/POIStatus.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/POISystemData.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/POITerminalData.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/Parameter.cs | 0 .../TerminalApi => TerminalApi/Models}/PaymentAccountReq.cs | 0 .../TerminalApi => TerminalApi/Models}/PaymentAccountStatus.cs | 0 .../TerminalApi => TerminalApi/Models}/PaymentAcquirerData.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentData.cs | 0 .../TerminalApi => TerminalApi/Models}/PaymentInstrumentData.cs | 0 .../TerminalApi => TerminalApi/Models}/PaymentInstrumentType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentReceipt.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentRequest.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/PaymentResponse.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentResult.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentToken.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentTotals.cs | 0 .../TerminalApi => TerminalApi/Models}/PaymentTransaction.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentType.cs | 0 .../TerminalApi => TerminalApi/Models}/PerformedTransaction.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PeriodUnitType.cs | 0 .../TerminalApi => TerminalApi/Models}/PredefinedContent.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PrintOutput.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PrintRequest.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/PrintResponse.cs | 0 .../TerminalApi => TerminalApi/Models}/PrinterStatusType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/Rebates.cs | 0 .../TerminalApi => TerminalApi/Models}/RecipientIdentifier.cs | 0 .../TerminalApi => TerminalApi/Models}/ReconciliationRequest.cs | 0 .../TerminalApi => TerminalApi/Models}/ReconciliationResponse.cs | 0 .../TerminalApi => TerminalApi/Models}/ReconciliationType.cs | 0 .../Models}/RelativeDistinguishedName.cs | 0 .../TerminalApi => TerminalApi/Models}/RepeatedMessageResponse.cs | 0 .../Models}/RepeatedResponseMessageBody.cs | 0 .../Message => TerminalApi/Models/Requests}/SaleToPOIRequest.cs | 0 .../Models/Requests}/SaleToPoiRequestSecured.cs | 0 .../Models/Requests}/SaleToPoiResponseSecured.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/Response.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/ResponseModeType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/ResultType.cs | 0 .../TerminalApi => TerminalApi/Models}/ReversalReasonType.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/ReversalRequest.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/ReversalResponse.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleData.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleItem.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleItemRebate.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleProfile.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleSoftware.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/SaleTerminalData.cs | 0 .../{Model/Terminal => TerminalApi/Models}/SaleToAcquirerData.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/SaleToIssuerData.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/SaleToPOIMessage.cs | 0 .../TerminalApi => TerminalApi/Models}/SaleToPOIResponse.cs | 0 .../TerminalApi => TerminalApi/Models}/SensitiveCardData.cs | 0 .../TerminalApi => TerminalApi/Models}/SensitiveMobileData.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/SignaturePoint.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/SignedData.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/Signer.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/SignerIdentifier.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/SoundActionType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/SoundContent.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/SoundFormatType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/SoundRequest.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/SoundResponse.cs | 0 Adyen/{Model/Terminal => TerminalApi/Models}/Split.cs | 0 Adyen/{Model/Terminal => TerminalApi/Models}/SplitItem.cs | 0 Adyen/{Model/Terminal => TerminalApi/Models}/SplitItemType.cs | 0 .../TerminalApi => TerminalApi/Models}/SponsoredMerchant.cs | 0 .../TerminalApi => TerminalApi/Models}/StoredValueAccountID.cs | 0 .../Models}/StoredValueAccountStatus.cs | 0 .../TerminalApi => TerminalApi/Models}/StoredValueAccountType.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/StoredValueData.cs | 0 .../TerminalApi => TerminalApi/Models}/StoredValueRequest.cs | 0 .../TerminalApi => TerminalApi/Models}/StoredValueResponse.cs | 0 .../TerminalApi => TerminalApi/Models}/StoredValueResult.cs | 0 .../Models}/StoredValueTransactionType.cs | 0 .../TerminalApi => TerminalApi/Models}/TerminalEnvironmentType.cs | 0 .../TerminalApi => TerminalApi/Models}/TokenRequestedType.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/TotalDetailsType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/TotalFilter.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/TrackData.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/TrackFormatType.cs | 0 .../TerminalApi => TerminalApi/Models}/TransactionActionType.cs | 0 .../TerminalApi => TerminalApi/Models}/TransactionConditions.cs | 0 .../Models}/TransactionIdentification.cs | 0 .../Models}/TransactionStatusRequest.cs | 0 .../Models}/TransactionStatusResponse.cs | 0 .../TerminalApi => TerminalApi/Models}/TransactionToPerform.cs | 0 .../TerminalApi => TerminalApi/Models}/TransactionTotals.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/TransactionType.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/TransmitRequest.cs | 0 .../{Model/TerminalApi => TerminalApi/Models}/TransmitResponse.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/UTMCoordinates.cs | 0 .../TerminalApi => TerminalApi/Models}/UnitOfMeasureType.cs | 0 Adyen/{Model/TerminalApi => TerminalApi/Models}/VersionType.cs | 0 Adyen/{ => TerminalApi}/Security/AesEncryptor.cs | 0 Adyen/{ => TerminalApi}/Security/EncryptionCredentialDetails.cs | 0 Adyen/{ => TerminalApi}/Security/EncryptionDerivedKey.cs | 0 Adyen/{ => TerminalApi}/Security/EncryptionDerivedKeyGenerator.cs | 0 .../{ => TerminalApi}/Security/Exceptions/NexoCryptoException.cs | 0 Adyen/{ => TerminalApi}/Security/Extension/ArrayExtension.cs | 0 Adyen/{ => TerminalApi}/Security/HmacSha256Wrapper.cs | 0 Adyen/{ => TerminalApi}/Security/IvModGenerator.cs | 0 Adyen/{ => TerminalApi}/Security/SaleToPoiMessageSecured.cs | 0 .../Security/SaleToPoiMessageSecuredEncryptor.cs | 0 Adyen/{ => TerminalApi}/Security/SecurityTrailer.cs | 0 Adyen/{ => TerminalApi}/Security/TerminalCommonNameValidator.cs | 0 .../{Service => TerminalApi/Services}/TerminalApiAsyncService.cs | 0 .../{Service => TerminalApi/Services}/TerminalApiLocalService.cs | 0 Adyen/{Service => TerminalApi/Services}/TerminalApiSyncService.cs | 0 Adyen/{Service => TerminalApi/Services}/TerminalCloudApi.cs | 0 Adyen/{Service => TerminalApi/Services}/TerminalLocalApi.cs | 0 .../Services}/TerminalLocalApiUnencrypted.cs | 0 .../TerminalApi => TerminalApi/Utilities}/AdditionalResponse.cs | 0 .../TerminalApi => TerminalApi/Utilities}/CardAcquisitionUtil.cs | 0 .../BalancePlatformWebhookHandler.cs | 0 .../ClassicPlatformWebhookHandler.cs | 0 Adyen/{Webhooks => WebhookHandlers}/ManagementWebhookHandler.cs | 0 Adyen/{Webhooks => WebhookHandlers}/WebhookHandler.cs | 0 274 files changed, 0 insertions(+), 0 deletions(-) rename Adyen/{ => TerminalApi}/ApiSerialization/Converter/JsonBase64Converter.cs (100%) rename Adyen/{ => TerminalApi}/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs (100%) rename Adyen/{ => TerminalApi}/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs (100%) rename Adyen/{ => TerminalApi}/ApiSerialization/Converter/SaleToPoiMessageConverter.cs (100%) rename Adyen/{ => TerminalApi}/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs (100%) rename Adyen/{ => TerminalApi}/ApiSerialization/IMessagePayload.cs (100%) rename Adyen/{ => TerminalApi}/ApiSerialization/IMessagePayloadSerializer.cs (100%) rename Adyen/{ => TerminalApi}/ApiSerialization/MessageHeaderSerializer.cs (100%) rename Adyen/{ => TerminalApi}/ApiSerialization/MessagePayloadSerializer.cs (100%) rename Adyen/{ => TerminalApi}/ApiSerialization/MessagePayloadSerializerFactory.cs (100%) rename Adyen/{ => TerminalApi}/ApiSerialization/OpenAPIDateConverter.cs (100%) rename Adyen/{ => TerminalApi}/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs (100%) rename Adyen/{ => TerminalApi}/ApiSerialization/SaleToPoiMessageSerializer.cs (100%) rename Adyen/{ => TerminalApi}/ApiSerialization/TypeHelper.cs (100%) rename Adyen/{Service/Resource/Terminal => TerminalApi/Clients}/TerminalApi.cs (100%) rename Adyen/{Service/Resource/Terminal => TerminalApi/Clients}/TerminalApiAsyncClient.cs (100%) rename Adyen/{Service/Resource/Terminal => TerminalApi/Clients}/TerminalApiLocal.cs (100%) rename Adyen/{Service/Resource/Terminal => TerminalApi/Clients}/TerminalApiLocalClient.cs (100%) rename Adyen/{Service/Resource/Terminal => TerminalApi/Clients}/TerminalApiSyncClient.cs (100%) rename Adyen/{ => TerminalApi}/Constants/ApiConstants.cs (100%) rename Adyen/{ => TerminalApi}/Constants/ClientConfig.cs (100%) rename Adyen/{ => TerminalApi}/Constants/Region.cs (100%) rename Adyen/{ => TerminalApi}/Exceptions/DeserializationException.cs (100%) rename Adyen/{ => TerminalApi}/Exceptions/ExceptionMessages.cs (100%) rename Adyen/{ => TerminalApi}/HttpClient/HttpClientException.cs (100%) rename Adyen/{ => TerminalApi}/HttpClient/HttpClientExtension.cs (100%) rename Adyen/{ => TerminalApi}/HttpClient/HttpClientWrapper.cs (100%) rename Adyen/{ => TerminalApi}/HttpClient/Interfaces/IClient.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/AbortRequest.cs (100%) rename Adyen/{Service => TerminalApi/Models}/AbstractService.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/AccountType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/AdminRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/AdminResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/AlgorithmIdentifier.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/AlgorithmType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/AlignmentType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/AllowedProduct.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/Amount.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/AmountsReq.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/AmountsResp.cs (100%) rename Adyen/{Service => TerminalApi/Models}/ApiException.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/AreaSize.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/AuthenticatedData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/AuthenticationMethodType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/BalanceInquiryRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/BalanceInquiryResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/BarcodeType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/BatchRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/BatchResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CapturedSignature.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CardAcquisitionRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CardAcquisitionResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CardAcquisitionTransaction.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CardData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CardReaderAPDURequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CardReaderAPDUResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CardReaderInitRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CardReaderInitResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CardReaderPowerOffRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CardReaderPowerOffResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CardholderPIN.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CashHandlingDevice.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CharacterHeightType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CharacterStyleType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CharacterWidthType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CheckData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CheckTypeCodeType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CoinsOrBills.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ColorType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ContentInformation.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ContentType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CurrencyConversion.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CustomerOrder.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/CustomerOrderReqType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/DeviceType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/DiagnosisRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/DiagnosisResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/DigestedData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/DisplayOutput.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/DisplayRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/DisplayResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/DocumentQualifierType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/EnableServiceRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/EnableServiceResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/EncapsulatedContent.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/EncryptedContent.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/EntryModeType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/EnvelopedData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ErrorConditionType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/EventNotification.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/EventToNotifyType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ForceTypeModeType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/GenericProfileType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/GeographicCoordinates.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/Geolocation.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/GetTotalsRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/GetTotalsResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/GlobalStatusType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/HostStatus.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ICCResetData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/IdentificationSupportType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/IdentificationType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/InfoQualifyType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/Input.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/InputCommandType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/InputData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/InputRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/InputResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/InputResult.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/InputUpdate.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/Instalment.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/IssuerAndSerialNumber.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/KEK.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/KEKIdentifier.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/KeyTransport.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoginRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoginResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LogoutRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LogoutResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyAccount.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyAccountID.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyAccountReq.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyAccountStatus.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyAcquirerData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyAmount.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyHandlingType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyResult.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyTotals.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyTransaction.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyTransactionType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/LoyaltyUnitType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/MenuEntry.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/MenuEntryTagType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/MessageCategoryType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/MessageClassType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/MessageHeader.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/MessageReference.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/MessageType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/MobileData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/NamedKeyEncryptedData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/OriginalPOITransaction.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/OutputBarcode.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/OutputContent.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/OutputFormatType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/OutputResult.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/OutputText.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PINFormatType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PINRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PINRequestType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PINResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/POIData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/POIProfile.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/POISoftware.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/POIStatus.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/POISystemData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/POITerminalData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/Parameter.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentAccountReq.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentAccountStatus.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentAcquirerData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentInstrumentData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentInstrumentType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentReceipt.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentResult.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentToken.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentTotals.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentTransaction.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PaymentType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PerformedTransaction.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PeriodUnitType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PredefinedContent.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PrintOutput.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PrintRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PrintResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/PrinterStatusType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/Rebates.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/RecipientIdentifier.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ReconciliationRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ReconciliationResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ReconciliationType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/RelativeDistinguishedName.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/RepeatedMessageResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/RepeatedResponseMessageBody.cs (100%) rename Adyen/{Model/TerminalApi/Message => TerminalApi/Models/Requests}/SaleToPOIRequest.cs (100%) rename Adyen/{Model/TerminalApi/Message => TerminalApi/Models/Requests}/SaleToPoiRequestSecured.cs (100%) rename Adyen/{Model/TerminalApi/Message => TerminalApi/Models/Requests}/SaleToPoiResponseSecured.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/Response.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ResponseModeType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ResultType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ReversalReasonType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ReversalRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/ReversalResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleItem.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleItemRebate.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleProfile.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleSoftware.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleTerminalData.cs (100%) rename Adyen/{Model/Terminal => TerminalApi/Models}/SaleToAcquirerData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleToIssuerData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleToPOIMessage.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SaleToPOIResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SensitiveCardData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SensitiveMobileData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SignaturePoint.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SignedData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/Signer.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SignerIdentifier.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SoundActionType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SoundContent.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SoundFormatType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SoundRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SoundResponse.cs (100%) rename Adyen/{Model/Terminal => TerminalApi/Models}/Split.cs (100%) rename Adyen/{Model/Terminal => TerminalApi/Models}/SplitItem.cs (100%) rename Adyen/{Model/Terminal => TerminalApi/Models}/SplitItemType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/SponsoredMerchant.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/StoredValueAccountID.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/StoredValueAccountStatus.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/StoredValueAccountType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/StoredValueData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/StoredValueRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/StoredValueResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/StoredValueResult.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/StoredValueTransactionType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TerminalEnvironmentType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TokenRequestedType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TotalDetailsType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TotalFilter.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TrackData.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TrackFormatType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TransactionActionType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TransactionConditions.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TransactionIdentification.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TransactionStatusRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TransactionStatusResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TransactionToPerform.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TransactionTotals.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TransactionType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TransmitRequest.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/TransmitResponse.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/UTMCoordinates.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/UnitOfMeasureType.cs (100%) rename Adyen/{Model/TerminalApi => TerminalApi/Models}/VersionType.cs (100%) rename Adyen/{ => TerminalApi}/Security/AesEncryptor.cs (100%) rename Adyen/{ => TerminalApi}/Security/EncryptionCredentialDetails.cs (100%) rename Adyen/{ => TerminalApi}/Security/EncryptionDerivedKey.cs (100%) rename Adyen/{ => TerminalApi}/Security/EncryptionDerivedKeyGenerator.cs (100%) rename Adyen/{ => TerminalApi}/Security/Exceptions/NexoCryptoException.cs (100%) rename Adyen/{ => TerminalApi}/Security/Extension/ArrayExtension.cs (100%) rename Adyen/{ => TerminalApi}/Security/HmacSha256Wrapper.cs (100%) rename Adyen/{ => TerminalApi}/Security/IvModGenerator.cs (100%) rename Adyen/{ => TerminalApi}/Security/SaleToPoiMessageSecured.cs (100%) rename Adyen/{ => TerminalApi}/Security/SaleToPoiMessageSecuredEncryptor.cs (100%) rename Adyen/{ => TerminalApi}/Security/SecurityTrailer.cs (100%) rename Adyen/{ => TerminalApi}/Security/TerminalCommonNameValidator.cs (100%) rename Adyen/{Service => TerminalApi/Services}/TerminalApiAsyncService.cs (100%) rename Adyen/{Service => TerminalApi/Services}/TerminalApiLocalService.cs (100%) rename Adyen/{Service => TerminalApi/Services}/TerminalApiSyncService.cs (100%) rename Adyen/{Service => TerminalApi/Services}/TerminalCloudApi.cs (100%) rename Adyen/{Service => TerminalApi/Services}/TerminalLocalApi.cs (100%) rename Adyen/{Service => TerminalApi/Services}/TerminalLocalApiUnencrypted.cs (100%) rename Adyen/{Util/TerminalApi => TerminalApi/Utilities}/AdditionalResponse.cs (100%) rename Adyen/{Util/TerminalApi => TerminalApi/Utilities}/CardAcquisitionUtil.cs (100%) rename Adyen/{Webhooks => WebhookHandlers}/BalancePlatformWebhookHandler.cs (100%) rename Adyen/{Webhooks => WebhookHandlers}/ClassicPlatformWebhookHandler.cs (100%) rename Adyen/{Webhooks => WebhookHandlers}/ManagementWebhookHandler.cs (100%) rename Adyen/{Webhooks => WebhookHandlers}/WebhookHandler.cs (100%) diff --git a/Adyen/ApiSerialization/Converter/JsonBase64Converter.cs b/Adyen/TerminalApi/ApiSerialization/Converter/JsonBase64Converter.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/JsonBase64Converter.cs rename to Adyen/TerminalApi/ApiSerialization/Converter/JsonBase64Converter.cs diff --git a/Adyen/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs b/Adyen/TerminalApi/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs rename to Adyen/TerminalApi/ApiSerialization/Converter/JsonConvertDeserializerWrapper.cs diff --git a/Adyen/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs b/Adyen/TerminalApi/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs rename to Adyen/TerminalApi/ApiSerialization/Converter/JsonConvertSerializerWrapper.cs diff --git a/Adyen/ApiSerialization/Converter/SaleToPoiMessageConverter.cs b/Adyen/TerminalApi/ApiSerialization/Converter/SaleToPoiMessageConverter.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/SaleToPoiMessageConverter.cs rename to Adyen/TerminalApi/ApiSerialization/Converter/SaleToPoiMessageConverter.cs diff --git a/Adyen/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs b/Adyen/TerminalApi/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs similarity index 100% rename from Adyen/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs rename to Adyen/TerminalApi/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs diff --git a/Adyen/ApiSerialization/IMessagePayload.cs b/Adyen/TerminalApi/ApiSerialization/IMessagePayload.cs similarity index 100% rename from Adyen/ApiSerialization/IMessagePayload.cs rename to Adyen/TerminalApi/ApiSerialization/IMessagePayload.cs diff --git a/Adyen/ApiSerialization/IMessagePayloadSerializer.cs b/Adyen/TerminalApi/ApiSerialization/IMessagePayloadSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/IMessagePayloadSerializer.cs rename to Adyen/TerminalApi/ApiSerialization/IMessagePayloadSerializer.cs diff --git a/Adyen/ApiSerialization/MessageHeaderSerializer.cs b/Adyen/TerminalApi/ApiSerialization/MessageHeaderSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/MessageHeaderSerializer.cs rename to Adyen/TerminalApi/ApiSerialization/MessageHeaderSerializer.cs diff --git a/Adyen/ApiSerialization/MessagePayloadSerializer.cs b/Adyen/TerminalApi/ApiSerialization/MessagePayloadSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/MessagePayloadSerializer.cs rename to Adyen/TerminalApi/ApiSerialization/MessagePayloadSerializer.cs diff --git a/Adyen/ApiSerialization/MessagePayloadSerializerFactory.cs b/Adyen/TerminalApi/ApiSerialization/MessagePayloadSerializerFactory.cs similarity index 100% rename from Adyen/ApiSerialization/MessagePayloadSerializerFactory.cs rename to Adyen/TerminalApi/ApiSerialization/MessagePayloadSerializerFactory.cs diff --git a/Adyen/ApiSerialization/OpenAPIDateConverter.cs b/Adyen/TerminalApi/ApiSerialization/OpenAPIDateConverter.cs similarity index 100% rename from Adyen/ApiSerialization/OpenAPIDateConverter.cs rename to Adyen/TerminalApi/ApiSerialization/OpenAPIDateConverter.cs diff --git a/Adyen/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs b/Adyen/TerminalApi/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs rename to Adyen/TerminalApi/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs diff --git a/Adyen/ApiSerialization/SaleToPoiMessageSerializer.cs b/Adyen/TerminalApi/ApiSerialization/SaleToPoiMessageSerializer.cs similarity index 100% rename from Adyen/ApiSerialization/SaleToPoiMessageSerializer.cs rename to Adyen/TerminalApi/ApiSerialization/SaleToPoiMessageSerializer.cs diff --git a/Adyen/ApiSerialization/TypeHelper.cs b/Adyen/TerminalApi/ApiSerialization/TypeHelper.cs similarity index 100% rename from Adyen/ApiSerialization/TypeHelper.cs rename to Adyen/TerminalApi/ApiSerialization/TypeHelper.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApi.cs b/Adyen/TerminalApi/Clients/TerminalApi.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApi.cs rename to Adyen/TerminalApi/Clients/TerminalApi.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs b/Adyen/TerminalApi/Clients/TerminalApiAsyncClient.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApiAsyncClient.cs rename to Adyen/TerminalApi/Clients/TerminalApiAsyncClient.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApiLocal.cs b/Adyen/TerminalApi/Clients/TerminalApiLocal.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApiLocal.cs rename to Adyen/TerminalApi/Clients/TerminalApiLocal.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs b/Adyen/TerminalApi/Clients/TerminalApiLocalClient.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApiLocalClient.cs rename to Adyen/TerminalApi/Clients/TerminalApiLocalClient.cs diff --git a/Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs b/Adyen/TerminalApi/Clients/TerminalApiSyncClient.cs similarity index 100% rename from Adyen/Service/Resource/Terminal/TerminalApiSyncClient.cs rename to Adyen/TerminalApi/Clients/TerminalApiSyncClient.cs diff --git a/Adyen/Constants/ApiConstants.cs b/Adyen/TerminalApi/Constants/ApiConstants.cs similarity index 100% rename from Adyen/Constants/ApiConstants.cs rename to Adyen/TerminalApi/Constants/ApiConstants.cs diff --git a/Adyen/Constants/ClientConfig.cs b/Adyen/TerminalApi/Constants/ClientConfig.cs similarity index 100% rename from Adyen/Constants/ClientConfig.cs rename to Adyen/TerminalApi/Constants/ClientConfig.cs diff --git a/Adyen/Constants/Region.cs b/Adyen/TerminalApi/Constants/Region.cs similarity index 100% rename from Adyen/Constants/Region.cs rename to Adyen/TerminalApi/Constants/Region.cs diff --git a/Adyen/Exceptions/DeserializationException.cs b/Adyen/TerminalApi/Exceptions/DeserializationException.cs similarity index 100% rename from Adyen/Exceptions/DeserializationException.cs rename to Adyen/TerminalApi/Exceptions/DeserializationException.cs diff --git a/Adyen/Exceptions/ExceptionMessages.cs b/Adyen/TerminalApi/Exceptions/ExceptionMessages.cs similarity index 100% rename from Adyen/Exceptions/ExceptionMessages.cs rename to Adyen/TerminalApi/Exceptions/ExceptionMessages.cs diff --git a/Adyen/HttpClient/HttpClientException.cs b/Adyen/TerminalApi/HttpClient/HttpClientException.cs similarity index 100% rename from Adyen/HttpClient/HttpClientException.cs rename to Adyen/TerminalApi/HttpClient/HttpClientException.cs diff --git a/Adyen/HttpClient/HttpClientExtension.cs b/Adyen/TerminalApi/HttpClient/HttpClientExtension.cs similarity index 100% rename from Adyen/HttpClient/HttpClientExtension.cs rename to Adyen/TerminalApi/HttpClient/HttpClientExtension.cs diff --git a/Adyen/HttpClient/HttpClientWrapper.cs b/Adyen/TerminalApi/HttpClient/HttpClientWrapper.cs similarity index 100% rename from Adyen/HttpClient/HttpClientWrapper.cs rename to Adyen/TerminalApi/HttpClient/HttpClientWrapper.cs diff --git a/Adyen/HttpClient/Interfaces/IClient.cs b/Adyen/TerminalApi/HttpClient/Interfaces/IClient.cs similarity index 100% rename from Adyen/HttpClient/Interfaces/IClient.cs rename to Adyen/TerminalApi/HttpClient/Interfaces/IClient.cs diff --git a/Adyen/Model/TerminalApi/AbortRequest.cs b/Adyen/TerminalApi/Models/AbortRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/AbortRequest.cs rename to Adyen/TerminalApi/Models/AbortRequest.cs diff --git a/Adyen/Service/AbstractService.cs b/Adyen/TerminalApi/Models/AbstractService.cs similarity index 100% rename from Adyen/Service/AbstractService.cs rename to Adyen/TerminalApi/Models/AbstractService.cs diff --git a/Adyen/Model/TerminalApi/AccountType.cs b/Adyen/TerminalApi/Models/AccountType.cs similarity index 100% rename from Adyen/Model/TerminalApi/AccountType.cs rename to Adyen/TerminalApi/Models/AccountType.cs diff --git a/Adyen/Model/TerminalApi/AdminRequest.cs b/Adyen/TerminalApi/Models/AdminRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/AdminRequest.cs rename to Adyen/TerminalApi/Models/AdminRequest.cs diff --git a/Adyen/Model/TerminalApi/AdminResponse.cs b/Adyen/TerminalApi/Models/AdminResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/AdminResponse.cs rename to Adyen/TerminalApi/Models/AdminResponse.cs diff --git a/Adyen/Model/TerminalApi/AlgorithmIdentifier.cs b/Adyen/TerminalApi/Models/AlgorithmIdentifier.cs similarity index 100% rename from Adyen/Model/TerminalApi/AlgorithmIdentifier.cs rename to Adyen/TerminalApi/Models/AlgorithmIdentifier.cs diff --git a/Adyen/Model/TerminalApi/AlgorithmType.cs b/Adyen/TerminalApi/Models/AlgorithmType.cs similarity index 100% rename from Adyen/Model/TerminalApi/AlgorithmType.cs rename to Adyen/TerminalApi/Models/AlgorithmType.cs diff --git a/Adyen/Model/TerminalApi/AlignmentType.cs b/Adyen/TerminalApi/Models/AlignmentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/AlignmentType.cs rename to Adyen/TerminalApi/Models/AlignmentType.cs diff --git a/Adyen/Model/TerminalApi/AllowedProduct.cs b/Adyen/TerminalApi/Models/AllowedProduct.cs similarity index 100% rename from Adyen/Model/TerminalApi/AllowedProduct.cs rename to Adyen/TerminalApi/Models/AllowedProduct.cs diff --git a/Adyen/Model/TerminalApi/Amount.cs b/Adyen/TerminalApi/Models/Amount.cs similarity index 100% rename from Adyen/Model/TerminalApi/Amount.cs rename to Adyen/TerminalApi/Models/Amount.cs diff --git a/Adyen/Model/TerminalApi/AmountsReq.cs b/Adyen/TerminalApi/Models/AmountsReq.cs similarity index 100% rename from Adyen/Model/TerminalApi/AmountsReq.cs rename to Adyen/TerminalApi/Models/AmountsReq.cs diff --git a/Adyen/Model/TerminalApi/AmountsResp.cs b/Adyen/TerminalApi/Models/AmountsResp.cs similarity index 100% rename from Adyen/Model/TerminalApi/AmountsResp.cs rename to Adyen/TerminalApi/Models/AmountsResp.cs diff --git a/Adyen/Service/ApiException.cs b/Adyen/TerminalApi/Models/ApiException.cs similarity index 100% rename from Adyen/Service/ApiException.cs rename to Adyen/TerminalApi/Models/ApiException.cs diff --git a/Adyen/Model/TerminalApi/AreaSize.cs b/Adyen/TerminalApi/Models/AreaSize.cs similarity index 100% rename from Adyen/Model/TerminalApi/AreaSize.cs rename to Adyen/TerminalApi/Models/AreaSize.cs diff --git a/Adyen/Model/TerminalApi/AuthenticatedData.cs b/Adyen/TerminalApi/Models/AuthenticatedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/AuthenticatedData.cs rename to Adyen/TerminalApi/Models/AuthenticatedData.cs diff --git a/Adyen/Model/TerminalApi/AuthenticationMethodType.cs b/Adyen/TerminalApi/Models/AuthenticationMethodType.cs similarity index 100% rename from Adyen/Model/TerminalApi/AuthenticationMethodType.cs rename to Adyen/TerminalApi/Models/AuthenticationMethodType.cs diff --git a/Adyen/Model/TerminalApi/BalanceInquiryRequest.cs b/Adyen/TerminalApi/Models/BalanceInquiryRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/BalanceInquiryRequest.cs rename to Adyen/TerminalApi/Models/BalanceInquiryRequest.cs diff --git a/Adyen/Model/TerminalApi/BalanceInquiryResponse.cs b/Adyen/TerminalApi/Models/BalanceInquiryResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/BalanceInquiryResponse.cs rename to Adyen/TerminalApi/Models/BalanceInquiryResponse.cs diff --git a/Adyen/Model/TerminalApi/BarcodeType.cs b/Adyen/TerminalApi/Models/BarcodeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/BarcodeType.cs rename to Adyen/TerminalApi/Models/BarcodeType.cs diff --git a/Adyen/Model/TerminalApi/BatchRequest.cs b/Adyen/TerminalApi/Models/BatchRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/BatchRequest.cs rename to Adyen/TerminalApi/Models/BatchRequest.cs diff --git a/Adyen/Model/TerminalApi/BatchResponse.cs b/Adyen/TerminalApi/Models/BatchResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/BatchResponse.cs rename to Adyen/TerminalApi/Models/BatchResponse.cs diff --git a/Adyen/Model/TerminalApi/CapturedSignature.cs b/Adyen/TerminalApi/Models/CapturedSignature.cs similarity index 100% rename from Adyen/Model/TerminalApi/CapturedSignature.cs rename to Adyen/TerminalApi/Models/CapturedSignature.cs diff --git a/Adyen/Model/TerminalApi/CardAcquisitionRequest.cs b/Adyen/TerminalApi/Models/CardAcquisitionRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardAcquisitionRequest.cs rename to Adyen/TerminalApi/Models/CardAcquisitionRequest.cs diff --git a/Adyen/Model/TerminalApi/CardAcquisitionResponse.cs b/Adyen/TerminalApi/Models/CardAcquisitionResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardAcquisitionResponse.cs rename to Adyen/TerminalApi/Models/CardAcquisitionResponse.cs diff --git a/Adyen/Model/TerminalApi/CardAcquisitionTransaction.cs b/Adyen/TerminalApi/Models/CardAcquisitionTransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardAcquisitionTransaction.cs rename to Adyen/TerminalApi/Models/CardAcquisitionTransaction.cs diff --git a/Adyen/Model/TerminalApi/CardData.cs b/Adyen/TerminalApi/Models/CardData.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardData.cs rename to Adyen/TerminalApi/Models/CardData.cs diff --git a/Adyen/Model/TerminalApi/CardReaderAPDURequest.cs b/Adyen/TerminalApi/Models/CardReaderAPDURequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderAPDURequest.cs rename to Adyen/TerminalApi/Models/CardReaderAPDURequest.cs diff --git a/Adyen/Model/TerminalApi/CardReaderAPDUResponse.cs b/Adyen/TerminalApi/Models/CardReaderAPDUResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderAPDUResponse.cs rename to Adyen/TerminalApi/Models/CardReaderAPDUResponse.cs diff --git a/Adyen/Model/TerminalApi/CardReaderInitRequest.cs b/Adyen/TerminalApi/Models/CardReaderInitRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderInitRequest.cs rename to Adyen/TerminalApi/Models/CardReaderInitRequest.cs diff --git a/Adyen/Model/TerminalApi/CardReaderInitResponse.cs b/Adyen/TerminalApi/Models/CardReaderInitResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderInitResponse.cs rename to Adyen/TerminalApi/Models/CardReaderInitResponse.cs diff --git a/Adyen/Model/TerminalApi/CardReaderPowerOffRequest.cs b/Adyen/TerminalApi/Models/CardReaderPowerOffRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderPowerOffRequest.cs rename to Adyen/TerminalApi/Models/CardReaderPowerOffRequest.cs diff --git a/Adyen/Model/TerminalApi/CardReaderPowerOffResponse.cs b/Adyen/TerminalApi/Models/CardReaderPowerOffResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardReaderPowerOffResponse.cs rename to Adyen/TerminalApi/Models/CardReaderPowerOffResponse.cs diff --git a/Adyen/Model/TerminalApi/CardholderPIN.cs b/Adyen/TerminalApi/Models/CardholderPIN.cs similarity index 100% rename from Adyen/Model/TerminalApi/CardholderPIN.cs rename to Adyen/TerminalApi/Models/CardholderPIN.cs diff --git a/Adyen/Model/TerminalApi/CashHandlingDevice.cs b/Adyen/TerminalApi/Models/CashHandlingDevice.cs similarity index 100% rename from Adyen/Model/TerminalApi/CashHandlingDevice.cs rename to Adyen/TerminalApi/Models/CashHandlingDevice.cs diff --git a/Adyen/Model/TerminalApi/CharacterHeightType.cs b/Adyen/TerminalApi/Models/CharacterHeightType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CharacterHeightType.cs rename to Adyen/TerminalApi/Models/CharacterHeightType.cs diff --git a/Adyen/Model/TerminalApi/CharacterStyleType.cs b/Adyen/TerminalApi/Models/CharacterStyleType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CharacterStyleType.cs rename to Adyen/TerminalApi/Models/CharacterStyleType.cs diff --git a/Adyen/Model/TerminalApi/CharacterWidthType.cs b/Adyen/TerminalApi/Models/CharacterWidthType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CharacterWidthType.cs rename to Adyen/TerminalApi/Models/CharacterWidthType.cs diff --git a/Adyen/Model/TerminalApi/CheckData.cs b/Adyen/TerminalApi/Models/CheckData.cs similarity index 100% rename from Adyen/Model/TerminalApi/CheckData.cs rename to Adyen/TerminalApi/Models/CheckData.cs diff --git a/Adyen/Model/TerminalApi/CheckTypeCodeType.cs b/Adyen/TerminalApi/Models/CheckTypeCodeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CheckTypeCodeType.cs rename to Adyen/TerminalApi/Models/CheckTypeCodeType.cs diff --git a/Adyen/Model/TerminalApi/CoinsOrBills.cs b/Adyen/TerminalApi/Models/CoinsOrBills.cs similarity index 100% rename from Adyen/Model/TerminalApi/CoinsOrBills.cs rename to Adyen/TerminalApi/Models/CoinsOrBills.cs diff --git a/Adyen/Model/TerminalApi/ColorType.cs b/Adyen/TerminalApi/Models/ColorType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ColorType.cs rename to Adyen/TerminalApi/Models/ColorType.cs diff --git a/Adyen/Model/TerminalApi/ContentInformation.cs b/Adyen/TerminalApi/Models/ContentInformation.cs similarity index 100% rename from Adyen/Model/TerminalApi/ContentInformation.cs rename to Adyen/TerminalApi/Models/ContentInformation.cs diff --git a/Adyen/Model/TerminalApi/ContentType.cs b/Adyen/TerminalApi/Models/ContentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ContentType.cs rename to Adyen/TerminalApi/Models/ContentType.cs diff --git a/Adyen/Model/TerminalApi/CurrencyConversion.cs b/Adyen/TerminalApi/Models/CurrencyConversion.cs similarity index 100% rename from Adyen/Model/TerminalApi/CurrencyConversion.cs rename to Adyen/TerminalApi/Models/CurrencyConversion.cs diff --git a/Adyen/Model/TerminalApi/CustomerOrder.cs b/Adyen/TerminalApi/Models/CustomerOrder.cs similarity index 100% rename from Adyen/Model/TerminalApi/CustomerOrder.cs rename to Adyen/TerminalApi/Models/CustomerOrder.cs diff --git a/Adyen/Model/TerminalApi/CustomerOrderReqType.cs b/Adyen/TerminalApi/Models/CustomerOrderReqType.cs similarity index 100% rename from Adyen/Model/TerminalApi/CustomerOrderReqType.cs rename to Adyen/TerminalApi/Models/CustomerOrderReqType.cs diff --git a/Adyen/Model/TerminalApi/DeviceType.cs b/Adyen/TerminalApi/Models/DeviceType.cs similarity index 100% rename from Adyen/Model/TerminalApi/DeviceType.cs rename to Adyen/TerminalApi/Models/DeviceType.cs diff --git a/Adyen/Model/TerminalApi/DiagnosisRequest.cs b/Adyen/TerminalApi/Models/DiagnosisRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/DiagnosisRequest.cs rename to Adyen/TerminalApi/Models/DiagnosisRequest.cs diff --git a/Adyen/Model/TerminalApi/DiagnosisResponse.cs b/Adyen/TerminalApi/Models/DiagnosisResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/DiagnosisResponse.cs rename to Adyen/TerminalApi/Models/DiagnosisResponse.cs diff --git a/Adyen/Model/TerminalApi/DigestedData.cs b/Adyen/TerminalApi/Models/DigestedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/DigestedData.cs rename to Adyen/TerminalApi/Models/DigestedData.cs diff --git a/Adyen/Model/TerminalApi/DisplayOutput.cs b/Adyen/TerminalApi/Models/DisplayOutput.cs similarity index 100% rename from Adyen/Model/TerminalApi/DisplayOutput.cs rename to Adyen/TerminalApi/Models/DisplayOutput.cs diff --git a/Adyen/Model/TerminalApi/DisplayRequest.cs b/Adyen/TerminalApi/Models/DisplayRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/DisplayRequest.cs rename to Adyen/TerminalApi/Models/DisplayRequest.cs diff --git a/Adyen/Model/TerminalApi/DisplayResponse.cs b/Adyen/TerminalApi/Models/DisplayResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/DisplayResponse.cs rename to Adyen/TerminalApi/Models/DisplayResponse.cs diff --git a/Adyen/Model/TerminalApi/DocumentQualifierType.cs b/Adyen/TerminalApi/Models/DocumentQualifierType.cs similarity index 100% rename from Adyen/Model/TerminalApi/DocumentQualifierType.cs rename to Adyen/TerminalApi/Models/DocumentQualifierType.cs diff --git a/Adyen/Model/TerminalApi/EnableServiceRequest.cs b/Adyen/TerminalApi/Models/EnableServiceRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/EnableServiceRequest.cs rename to Adyen/TerminalApi/Models/EnableServiceRequest.cs diff --git a/Adyen/Model/TerminalApi/EnableServiceResponse.cs b/Adyen/TerminalApi/Models/EnableServiceResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/EnableServiceResponse.cs rename to Adyen/TerminalApi/Models/EnableServiceResponse.cs diff --git a/Adyen/Model/TerminalApi/EncapsulatedContent.cs b/Adyen/TerminalApi/Models/EncapsulatedContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/EncapsulatedContent.cs rename to Adyen/TerminalApi/Models/EncapsulatedContent.cs diff --git a/Adyen/Model/TerminalApi/EncryptedContent.cs b/Adyen/TerminalApi/Models/EncryptedContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/EncryptedContent.cs rename to Adyen/TerminalApi/Models/EncryptedContent.cs diff --git a/Adyen/Model/TerminalApi/EntryModeType.cs b/Adyen/TerminalApi/Models/EntryModeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/EntryModeType.cs rename to Adyen/TerminalApi/Models/EntryModeType.cs diff --git a/Adyen/Model/TerminalApi/EnvelopedData.cs b/Adyen/TerminalApi/Models/EnvelopedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/EnvelopedData.cs rename to Adyen/TerminalApi/Models/EnvelopedData.cs diff --git a/Adyen/Model/TerminalApi/ErrorConditionType.cs b/Adyen/TerminalApi/Models/ErrorConditionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ErrorConditionType.cs rename to Adyen/TerminalApi/Models/ErrorConditionType.cs diff --git a/Adyen/Model/TerminalApi/EventNotification.cs b/Adyen/TerminalApi/Models/EventNotification.cs similarity index 100% rename from Adyen/Model/TerminalApi/EventNotification.cs rename to Adyen/TerminalApi/Models/EventNotification.cs diff --git a/Adyen/Model/TerminalApi/EventToNotifyType.cs b/Adyen/TerminalApi/Models/EventToNotifyType.cs similarity index 100% rename from Adyen/Model/TerminalApi/EventToNotifyType.cs rename to Adyen/TerminalApi/Models/EventToNotifyType.cs diff --git a/Adyen/Model/TerminalApi/ForceTypeModeType.cs b/Adyen/TerminalApi/Models/ForceTypeModeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ForceTypeModeType.cs rename to Adyen/TerminalApi/Models/ForceTypeModeType.cs diff --git a/Adyen/Model/TerminalApi/GenericProfileType.cs b/Adyen/TerminalApi/Models/GenericProfileType.cs similarity index 100% rename from Adyen/Model/TerminalApi/GenericProfileType.cs rename to Adyen/TerminalApi/Models/GenericProfileType.cs diff --git a/Adyen/Model/TerminalApi/GeographicCoordinates.cs b/Adyen/TerminalApi/Models/GeographicCoordinates.cs similarity index 100% rename from Adyen/Model/TerminalApi/GeographicCoordinates.cs rename to Adyen/TerminalApi/Models/GeographicCoordinates.cs diff --git a/Adyen/Model/TerminalApi/Geolocation.cs b/Adyen/TerminalApi/Models/Geolocation.cs similarity index 100% rename from Adyen/Model/TerminalApi/Geolocation.cs rename to Adyen/TerminalApi/Models/Geolocation.cs diff --git a/Adyen/Model/TerminalApi/GetTotalsRequest.cs b/Adyen/TerminalApi/Models/GetTotalsRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/GetTotalsRequest.cs rename to Adyen/TerminalApi/Models/GetTotalsRequest.cs diff --git a/Adyen/Model/TerminalApi/GetTotalsResponse.cs b/Adyen/TerminalApi/Models/GetTotalsResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/GetTotalsResponse.cs rename to Adyen/TerminalApi/Models/GetTotalsResponse.cs diff --git a/Adyen/Model/TerminalApi/GlobalStatusType.cs b/Adyen/TerminalApi/Models/GlobalStatusType.cs similarity index 100% rename from Adyen/Model/TerminalApi/GlobalStatusType.cs rename to Adyen/TerminalApi/Models/GlobalStatusType.cs diff --git a/Adyen/Model/TerminalApi/HostStatus.cs b/Adyen/TerminalApi/Models/HostStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/HostStatus.cs rename to Adyen/TerminalApi/Models/HostStatus.cs diff --git a/Adyen/Model/TerminalApi/ICCResetData.cs b/Adyen/TerminalApi/Models/ICCResetData.cs similarity index 100% rename from Adyen/Model/TerminalApi/ICCResetData.cs rename to Adyen/TerminalApi/Models/ICCResetData.cs diff --git a/Adyen/Model/TerminalApi/IdentificationSupportType.cs b/Adyen/TerminalApi/Models/IdentificationSupportType.cs similarity index 100% rename from Adyen/Model/TerminalApi/IdentificationSupportType.cs rename to Adyen/TerminalApi/Models/IdentificationSupportType.cs diff --git a/Adyen/Model/TerminalApi/IdentificationType.cs b/Adyen/TerminalApi/Models/IdentificationType.cs similarity index 100% rename from Adyen/Model/TerminalApi/IdentificationType.cs rename to Adyen/TerminalApi/Models/IdentificationType.cs diff --git a/Adyen/Model/TerminalApi/InfoQualifyType.cs b/Adyen/TerminalApi/Models/InfoQualifyType.cs similarity index 100% rename from Adyen/Model/TerminalApi/InfoQualifyType.cs rename to Adyen/TerminalApi/Models/InfoQualifyType.cs diff --git a/Adyen/Model/TerminalApi/Input.cs b/Adyen/TerminalApi/Models/Input.cs similarity index 100% rename from Adyen/Model/TerminalApi/Input.cs rename to Adyen/TerminalApi/Models/Input.cs diff --git a/Adyen/Model/TerminalApi/InputCommandType.cs b/Adyen/TerminalApi/Models/InputCommandType.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputCommandType.cs rename to Adyen/TerminalApi/Models/InputCommandType.cs diff --git a/Adyen/Model/TerminalApi/InputData.cs b/Adyen/TerminalApi/Models/InputData.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputData.cs rename to Adyen/TerminalApi/Models/InputData.cs diff --git a/Adyen/Model/TerminalApi/InputRequest.cs b/Adyen/TerminalApi/Models/InputRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputRequest.cs rename to Adyen/TerminalApi/Models/InputRequest.cs diff --git a/Adyen/Model/TerminalApi/InputResponse.cs b/Adyen/TerminalApi/Models/InputResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputResponse.cs rename to Adyen/TerminalApi/Models/InputResponse.cs diff --git a/Adyen/Model/TerminalApi/InputResult.cs b/Adyen/TerminalApi/Models/InputResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputResult.cs rename to Adyen/TerminalApi/Models/InputResult.cs diff --git a/Adyen/Model/TerminalApi/InputUpdate.cs b/Adyen/TerminalApi/Models/InputUpdate.cs similarity index 100% rename from Adyen/Model/TerminalApi/InputUpdate.cs rename to Adyen/TerminalApi/Models/InputUpdate.cs diff --git a/Adyen/Model/TerminalApi/Instalment.cs b/Adyen/TerminalApi/Models/Instalment.cs similarity index 100% rename from Adyen/Model/TerminalApi/Instalment.cs rename to Adyen/TerminalApi/Models/Instalment.cs diff --git a/Adyen/Model/TerminalApi/IssuerAndSerialNumber.cs b/Adyen/TerminalApi/Models/IssuerAndSerialNumber.cs similarity index 100% rename from Adyen/Model/TerminalApi/IssuerAndSerialNumber.cs rename to Adyen/TerminalApi/Models/IssuerAndSerialNumber.cs diff --git a/Adyen/Model/TerminalApi/KEK.cs b/Adyen/TerminalApi/Models/KEK.cs similarity index 100% rename from Adyen/Model/TerminalApi/KEK.cs rename to Adyen/TerminalApi/Models/KEK.cs diff --git a/Adyen/Model/TerminalApi/KEKIdentifier.cs b/Adyen/TerminalApi/Models/KEKIdentifier.cs similarity index 100% rename from Adyen/Model/TerminalApi/KEKIdentifier.cs rename to Adyen/TerminalApi/Models/KEKIdentifier.cs diff --git a/Adyen/Model/TerminalApi/KeyTransport.cs b/Adyen/TerminalApi/Models/KeyTransport.cs similarity index 100% rename from Adyen/Model/TerminalApi/KeyTransport.cs rename to Adyen/TerminalApi/Models/KeyTransport.cs diff --git a/Adyen/Model/TerminalApi/LoginRequest.cs b/Adyen/TerminalApi/Models/LoginRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoginRequest.cs rename to Adyen/TerminalApi/Models/LoginRequest.cs diff --git a/Adyen/Model/TerminalApi/LoginResponse.cs b/Adyen/TerminalApi/Models/LoginResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoginResponse.cs rename to Adyen/TerminalApi/Models/LoginResponse.cs diff --git a/Adyen/Model/TerminalApi/LogoutRequest.cs b/Adyen/TerminalApi/Models/LogoutRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/LogoutRequest.cs rename to Adyen/TerminalApi/Models/LogoutRequest.cs diff --git a/Adyen/Model/TerminalApi/LogoutResponse.cs b/Adyen/TerminalApi/Models/LogoutResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/LogoutResponse.cs rename to Adyen/TerminalApi/Models/LogoutResponse.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAccount.cs b/Adyen/TerminalApi/Models/LoyaltyAccount.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAccount.cs rename to Adyen/TerminalApi/Models/LoyaltyAccount.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAccountID.cs b/Adyen/TerminalApi/Models/LoyaltyAccountID.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAccountID.cs rename to Adyen/TerminalApi/Models/LoyaltyAccountID.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAccountReq.cs b/Adyen/TerminalApi/Models/LoyaltyAccountReq.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAccountReq.cs rename to Adyen/TerminalApi/Models/LoyaltyAccountReq.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAccountStatus.cs b/Adyen/TerminalApi/Models/LoyaltyAccountStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAccountStatus.cs rename to Adyen/TerminalApi/Models/LoyaltyAccountStatus.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAcquirerData.cs b/Adyen/TerminalApi/Models/LoyaltyAcquirerData.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAcquirerData.cs rename to Adyen/TerminalApi/Models/LoyaltyAcquirerData.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyAmount.cs b/Adyen/TerminalApi/Models/LoyaltyAmount.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyAmount.cs rename to Adyen/TerminalApi/Models/LoyaltyAmount.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyData.cs b/Adyen/TerminalApi/Models/LoyaltyData.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyData.cs rename to Adyen/TerminalApi/Models/LoyaltyData.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyHandlingType.cs b/Adyen/TerminalApi/Models/LoyaltyHandlingType.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyHandlingType.cs rename to Adyen/TerminalApi/Models/LoyaltyHandlingType.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyRequest.cs b/Adyen/TerminalApi/Models/LoyaltyRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyRequest.cs rename to Adyen/TerminalApi/Models/LoyaltyRequest.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyResponse.cs b/Adyen/TerminalApi/Models/LoyaltyResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyResponse.cs rename to Adyen/TerminalApi/Models/LoyaltyResponse.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyResult.cs b/Adyen/TerminalApi/Models/LoyaltyResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyResult.cs rename to Adyen/TerminalApi/Models/LoyaltyResult.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyTotals.cs b/Adyen/TerminalApi/Models/LoyaltyTotals.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyTotals.cs rename to Adyen/TerminalApi/Models/LoyaltyTotals.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyTransaction.cs b/Adyen/TerminalApi/Models/LoyaltyTransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyTransaction.cs rename to Adyen/TerminalApi/Models/LoyaltyTransaction.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyTransactionType.cs b/Adyen/TerminalApi/Models/LoyaltyTransactionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyTransactionType.cs rename to Adyen/TerminalApi/Models/LoyaltyTransactionType.cs diff --git a/Adyen/Model/TerminalApi/LoyaltyUnitType.cs b/Adyen/TerminalApi/Models/LoyaltyUnitType.cs similarity index 100% rename from Adyen/Model/TerminalApi/LoyaltyUnitType.cs rename to Adyen/TerminalApi/Models/LoyaltyUnitType.cs diff --git a/Adyen/Model/TerminalApi/MenuEntry.cs b/Adyen/TerminalApi/Models/MenuEntry.cs similarity index 100% rename from Adyen/Model/TerminalApi/MenuEntry.cs rename to Adyen/TerminalApi/Models/MenuEntry.cs diff --git a/Adyen/Model/TerminalApi/MenuEntryTagType.cs b/Adyen/TerminalApi/Models/MenuEntryTagType.cs similarity index 100% rename from Adyen/Model/TerminalApi/MenuEntryTagType.cs rename to Adyen/TerminalApi/Models/MenuEntryTagType.cs diff --git a/Adyen/Model/TerminalApi/MessageCategoryType.cs b/Adyen/TerminalApi/Models/MessageCategoryType.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageCategoryType.cs rename to Adyen/TerminalApi/Models/MessageCategoryType.cs diff --git a/Adyen/Model/TerminalApi/MessageClassType.cs b/Adyen/TerminalApi/Models/MessageClassType.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageClassType.cs rename to Adyen/TerminalApi/Models/MessageClassType.cs diff --git a/Adyen/Model/TerminalApi/MessageHeader.cs b/Adyen/TerminalApi/Models/MessageHeader.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageHeader.cs rename to Adyen/TerminalApi/Models/MessageHeader.cs diff --git a/Adyen/Model/TerminalApi/MessageReference.cs b/Adyen/TerminalApi/Models/MessageReference.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageReference.cs rename to Adyen/TerminalApi/Models/MessageReference.cs diff --git a/Adyen/Model/TerminalApi/MessageType.cs b/Adyen/TerminalApi/Models/MessageType.cs similarity index 100% rename from Adyen/Model/TerminalApi/MessageType.cs rename to Adyen/TerminalApi/Models/MessageType.cs diff --git a/Adyen/Model/TerminalApi/MobileData.cs b/Adyen/TerminalApi/Models/MobileData.cs similarity index 100% rename from Adyen/Model/TerminalApi/MobileData.cs rename to Adyen/TerminalApi/Models/MobileData.cs diff --git a/Adyen/Model/TerminalApi/NamedKeyEncryptedData.cs b/Adyen/TerminalApi/Models/NamedKeyEncryptedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/NamedKeyEncryptedData.cs rename to Adyen/TerminalApi/Models/NamedKeyEncryptedData.cs diff --git a/Adyen/Model/TerminalApi/OriginalPOITransaction.cs b/Adyen/TerminalApi/Models/OriginalPOITransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/OriginalPOITransaction.cs rename to Adyen/TerminalApi/Models/OriginalPOITransaction.cs diff --git a/Adyen/Model/TerminalApi/OutputBarcode.cs b/Adyen/TerminalApi/Models/OutputBarcode.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputBarcode.cs rename to Adyen/TerminalApi/Models/OutputBarcode.cs diff --git a/Adyen/Model/TerminalApi/OutputContent.cs b/Adyen/TerminalApi/Models/OutputContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputContent.cs rename to Adyen/TerminalApi/Models/OutputContent.cs diff --git a/Adyen/Model/TerminalApi/OutputFormatType.cs b/Adyen/TerminalApi/Models/OutputFormatType.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputFormatType.cs rename to Adyen/TerminalApi/Models/OutputFormatType.cs diff --git a/Adyen/Model/TerminalApi/OutputResult.cs b/Adyen/TerminalApi/Models/OutputResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputResult.cs rename to Adyen/TerminalApi/Models/OutputResult.cs diff --git a/Adyen/Model/TerminalApi/OutputText.cs b/Adyen/TerminalApi/Models/OutputText.cs similarity index 100% rename from Adyen/Model/TerminalApi/OutputText.cs rename to Adyen/TerminalApi/Models/OutputText.cs diff --git a/Adyen/Model/TerminalApi/PINFormatType.cs b/Adyen/TerminalApi/Models/PINFormatType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PINFormatType.cs rename to Adyen/TerminalApi/Models/PINFormatType.cs diff --git a/Adyen/Model/TerminalApi/PINRequest.cs b/Adyen/TerminalApi/Models/PINRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/PINRequest.cs rename to Adyen/TerminalApi/Models/PINRequest.cs diff --git a/Adyen/Model/TerminalApi/PINRequestType.cs b/Adyen/TerminalApi/Models/PINRequestType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PINRequestType.cs rename to Adyen/TerminalApi/Models/PINRequestType.cs diff --git a/Adyen/Model/TerminalApi/PINResponse.cs b/Adyen/TerminalApi/Models/PINResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/PINResponse.cs rename to Adyen/TerminalApi/Models/PINResponse.cs diff --git a/Adyen/Model/TerminalApi/POIData.cs b/Adyen/TerminalApi/Models/POIData.cs similarity index 100% rename from Adyen/Model/TerminalApi/POIData.cs rename to Adyen/TerminalApi/Models/POIData.cs diff --git a/Adyen/Model/TerminalApi/POIProfile.cs b/Adyen/TerminalApi/Models/POIProfile.cs similarity index 100% rename from Adyen/Model/TerminalApi/POIProfile.cs rename to Adyen/TerminalApi/Models/POIProfile.cs diff --git a/Adyen/Model/TerminalApi/POISoftware.cs b/Adyen/TerminalApi/Models/POISoftware.cs similarity index 100% rename from Adyen/Model/TerminalApi/POISoftware.cs rename to Adyen/TerminalApi/Models/POISoftware.cs diff --git a/Adyen/Model/TerminalApi/POIStatus.cs b/Adyen/TerminalApi/Models/POIStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/POIStatus.cs rename to Adyen/TerminalApi/Models/POIStatus.cs diff --git a/Adyen/Model/TerminalApi/POISystemData.cs b/Adyen/TerminalApi/Models/POISystemData.cs similarity index 100% rename from Adyen/Model/TerminalApi/POISystemData.cs rename to Adyen/TerminalApi/Models/POISystemData.cs diff --git a/Adyen/Model/TerminalApi/POITerminalData.cs b/Adyen/TerminalApi/Models/POITerminalData.cs similarity index 100% rename from Adyen/Model/TerminalApi/POITerminalData.cs rename to Adyen/TerminalApi/Models/POITerminalData.cs diff --git a/Adyen/Model/TerminalApi/Parameter.cs b/Adyen/TerminalApi/Models/Parameter.cs similarity index 100% rename from Adyen/Model/TerminalApi/Parameter.cs rename to Adyen/TerminalApi/Models/Parameter.cs diff --git a/Adyen/Model/TerminalApi/PaymentAccountReq.cs b/Adyen/TerminalApi/Models/PaymentAccountReq.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentAccountReq.cs rename to Adyen/TerminalApi/Models/PaymentAccountReq.cs diff --git a/Adyen/Model/TerminalApi/PaymentAccountStatus.cs b/Adyen/TerminalApi/Models/PaymentAccountStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentAccountStatus.cs rename to Adyen/TerminalApi/Models/PaymentAccountStatus.cs diff --git a/Adyen/Model/TerminalApi/PaymentAcquirerData.cs b/Adyen/TerminalApi/Models/PaymentAcquirerData.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentAcquirerData.cs rename to Adyen/TerminalApi/Models/PaymentAcquirerData.cs diff --git a/Adyen/Model/TerminalApi/PaymentData.cs b/Adyen/TerminalApi/Models/PaymentData.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentData.cs rename to Adyen/TerminalApi/Models/PaymentData.cs diff --git a/Adyen/Model/TerminalApi/PaymentInstrumentData.cs b/Adyen/TerminalApi/Models/PaymentInstrumentData.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentInstrumentData.cs rename to Adyen/TerminalApi/Models/PaymentInstrumentData.cs diff --git a/Adyen/Model/TerminalApi/PaymentInstrumentType.cs b/Adyen/TerminalApi/Models/PaymentInstrumentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentInstrumentType.cs rename to Adyen/TerminalApi/Models/PaymentInstrumentType.cs diff --git a/Adyen/Model/TerminalApi/PaymentReceipt.cs b/Adyen/TerminalApi/Models/PaymentReceipt.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentReceipt.cs rename to Adyen/TerminalApi/Models/PaymentReceipt.cs diff --git a/Adyen/Model/TerminalApi/PaymentRequest.cs b/Adyen/TerminalApi/Models/PaymentRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentRequest.cs rename to Adyen/TerminalApi/Models/PaymentRequest.cs diff --git a/Adyen/Model/TerminalApi/PaymentResponse.cs b/Adyen/TerminalApi/Models/PaymentResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentResponse.cs rename to Adyen/TerminalApi/Models/PaymentResponse.cs diff --git a/Adyen/Model/TerminalApi/PaymentResult.cs b/Adyen/TerminalApi/Models/PaymentResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentResult.cs rename to Adyen/TerminalApi/Models/PaymentResult.cs diff --git a/Adyen/Model/TerminalApi/PaymentToken.cs b/Adyen/TerminalApi/Models/PaymentToken.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentToken.cs rename to Adyen/TerminalApi/Models/PaymentToken.cs diff --git a/Adyen/Model/TerminalApi/PaymentTotals.cs b/Adyen/TerminalApi/Models/PaymentTotals.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentTotals.cs rename to Adyen/TerminalApi/Models/PaymentTotals.cs diff --git a/Adyen/Model/TerminalApi/PaymentTransaction.cs b/Adyen/TerminalApi/Models/PaymentTransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentTransaction.cs rename to Adyen/TerminalApi/Models/PaymentTransaction.cs diff --git a/Adyen/Model/TerminalApi/PaymentType.cs b/Adyen/TerminalApi/Models/PaymentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PaymentType.cs rename to Adyen/TerminalApi/Models/PaymentType.cs diff --git a/Adyen/Model/TerminalApi/PerformedTransaction.cs b/Adyen/TerminalApi/Models/PerformedTransaction.cs similarity index 100% rename from Adyen/Model/TerminalApi/PerformedTransaction.cs rename to Adyen/TerminalApi/Models/PerformedTransaction.cs diff --git a/Adyen/Model/TerminalApi/PeriodUnitType.cs b/Adyen/TerminalApi/Models/PeriodUnitType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PeriodUnitType.cs rename to Adyen/TerminalApi/Models/PeriodUnitType.cs diff --git a/Adyen/Model/TerminalApi/PredefinedContent.cs b/Adyen/TerminalApi/Models/PredefinedContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/PredefinedContent.cs rename to Adyen/TerminalApi/Models/PredefinedContent.cs diff --git a/Adyen/Model/TerminalApi/PrintOutput.cs b/Adyen/TerminalApi/Models/PrintOutput.cs similarity index 100% rename from Adyen/Model/TerminalApi/PrintOutput.cs rename to Adyen/TerminalApi/Models/PrintOutput.cs diff --git a/Adyen/Model/TerminalApi/PrintRequest.cs b/Adyen/TerminalApi/Models/PrintRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/PrintRequest.cs rename to Adyen/TerminalApi/Models/PrintRequest.cs diff --git a/Adyen/Model/TerminalApi/PrintResponse.cs b/Adyen/TerminalApi/Models/PrintResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/PrintResponse.cs rename to Adyen/TerminalApi/Models/PrintResponse.cs diff --git a/Adyen/Model/TerminalApi/PrinterStatusType.cs b/Adyen/TerminalApi/Models/PrinterStatusType.cs similarity index 100% rename from Adyen/Model/TerminalApi/PrinterStatusType.cs rename to Adyen/TerminalApi/Models/PrinterStatusType.cs diff --git a/Adyen/Model/TerminalApi/Rebates.cs b/Adyen/TerminalApi/Models/Rebates.cs similarity index 100% rename from Adyen/Model/TerminalApi/Rebates.cs rename to Adyen/TerminalApi/Models/Rebates.cs diff --git a/Adyen/Model/TerminalApi/RecipientIdentifier.cs b/Adyen/TerminalApi/Models/RecipientIdentifier.cs similarity index 100% rename from Adyen/Model/TerminalApi/RecipientIdentifier.cs rename to Adyen/TerminalApi/Models/RecipientIdentifier.cs diff --git a/Adyen/Model/TerminalApi/ReconciliationRequest.cs b/Adyen/TerminalApi/Models/ReconciliationRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReconciliationRequest.cs rename to Adyen/TerminalApi/Models/ReconciliationRequest.cs diff --git a/Adyen/Model/TerminalApi/ReconciliationResponse.cs b/Adyen/TerminalApi/Models/ReconciliationResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReconciliationResponse.cs rename to Adyen/TerminalApi/Models/ReconciliationResponse.cs diff --git a/Adyen/Model/TerminalApi/ReconciliationType.cs b/Adyen/TerminalApi/Models/ReconciliationType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReconciliationType.cs rename to Adyen/TerminalApi/Models/ReconciliationType.cs diff --git a/Adyen/Model/TerminalApi/RelativeDistinguishedName.cs b/Adyen/TerminalApi/Models/RelativeDistinguishedName.cs similarity index 100% rename from Adyen/Model/TerminalApi/RelativeDistinguishedName.cs rename to Adyen/TerminalApi/Models/RelativeDistinguishedName.cs diff --git a/Adyen/Model/TerminalApi/RepeatedMessageResponse.cs b/Adyen/TerminalApi/Models/RepeatedMessageResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/RepeatedMessageResponse.cs rename to Adyen/TerminalApi/Models/RepeatedMessageResponse.cs diff --git a/Adyen/Model/TerminalApi/RepeatedResponseMessageBody.cs b/Adyen/TerminalApi/Models/RepeatedResponseMessageBody.cs similarity index 100% rename from Adyen/Model/TerminalApi/RepeatedResponseMessageBody.cs rename to Adyen/TerminalApi/Models/RepeatedResponseMessageBody.cs diff --git a/Adyen/Model/TerminalApi/Message/SaleToPOIRequest.cs b/Adyen/TerminalApi/Models/Requests/SaleToPOIRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/Message/SaleToPOIRequest.cs rename to Adyen/TerminalApi/Models/Requests/SaleToPOIRequest.cs diff --git a/Adyen/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs b/Adyen/TerminalApi/Models/Requests/SaleToPoiRequestSecured.cs similarity index 100% rename from Adyen/Model/TerminalApi/Message/SaleToPoiRequestSecured.cs rename to Adyen/TerminalApi/Models/Requests/SaleToPoiRequestSecured.cs diff --git a/Adyen/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs b/Adyen/TerminalApi/Models/Requests/SaleToPoiResponseSecured.cs similarity index 100% rename from Adyen/Model/TerminalApi/Message/SaleToPoiResponseSecured.cs rename to Adyen/TerminalApi/Models/Requests/SaleToPoiResponseSecured.cs diff --git a/Adyen/Model/TerminalApi/Response.cs b/Adyen/TerminalApi/Models/Response.cs similarity index 100% rename from Adyen/Model/TerminalApi/Response.cs rename to Adyen/TerminalApi/Models/Response.cs diff --git a/Adyen/Model/TerminalApi/ResponseModeType.cs b/Adyen/TerminalApi/Models/ResponseModeType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ResponseModeType.cs rename to Adyen/TerminalApi/Models/ResponseModeType.cs diff --git a/Adyen/Model/TerminalApi/ResultType.cs b/Adyen/TerminalApi/Models/ResultType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ResultType.cs rename to Adyen/TerminalApi/Models/ResultType.cs diff --git a/Adyen/Model/TerminalApi/ReversalReasonType.cs b/Adyen/TerminalApi/Models/ReversalReasonType.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReversalReasonType.cs rename to Adyen/TerminalApi/Models/ReversalReasonType.cs diff --git a/Adyen/Model/TerminalApi/ReversalRequest.cs b/Adyen/TerminalApi/Models/ReversalRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReversalRequest.cs rename to Adyen/TerminalApi/Models/ReversalRequest.cs diff --git a/Adyen/Model/TerminalApi/ReversalResponse.cs b/Adyen/TerminalApi/Models/ReversalResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/ReversalResponse.cs rename to Adyen/TerminalApi/Models/ReversalResponse.cs diff --git a/Adyen/Model/TerminalApi/SaleData.cs b/Adyen/TerminalApi/Models/SaleData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleData.cs rename to Adyen/TerminalApi/Models/SaleData.cs diff --git a/Adyen/Model/TerminalApi/SaleItem.cs b/Adyen/TerminalApi/Models/SaleItem.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleItem.cs rename to Adyen/TerminalApi/Models/SaleItem.cs diff --git a/Adyen/Model/TerminalApi/SaleItemRebate.cs b/Adyen/TerminalApi/Models/SaleItemRebate.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleItemRebate.cs rename to Adyen/TerminalApi/Models/SaleItemRebate.cs diff --git a/Adyen/Model/TerminalApi/SaleProfile.cs b/Adyen/TerminalApi/Models/SaleProfile.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleProfile.cs rename to Adyen/TerminalApi/Models/SaleProfile.cs diff --git a/Adyen/Model/TerminalApi/SaleSoftware.cs b/Adyen/TerminalApi/Models/SaleSoftware.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleSoftware.cs rename to Adyen/TerminalApi/Models/SaleSoftware.cs diff --git a/Adyen/Model/TerminalApi/SaleTerminalData.cs b/Adyen/TerminalApi/Models/SaleTerminalData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleTerminalData.cs rename to Adyen/TerminalApi/Models/SaleTerminalData.cs diff --git a/Adyen/Model/Terminal/SaleToAcquirerData.cs b/Adyen/TerminalApi/Models/SaleToAcquirerData.cs similarity index 100% rename from Adyen/Model/Terminal/SaleToAcquirerData.cs rename to Adyen/TerminalApi/Models/SaleToAcquirerData.cs diff --git a/Adyen/Model/TerminalApi/SaleToIssuerData.cs b/Adyen/TerminalApi/Models/SaleToIssuerData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleToIssuerData.cs rename to Adyen/TerminalApi/Models/SaleToIssuerData.cs diff --git a/Adyen/Model/TerminalApi/SaleToPOIMessage.cs b/Adyen/TerminalApi/Models/SaleToPOIMessage.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleToPOIMessage.cs rename to Adyen/TerminalApi/Models/SaleToPOIMessage.cs diff --git a/Adyen/Model/TerminalApi/SaleToPOIResponse.cs b/Adyen/TerminalApi/Models/SaleToPOIResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/SaleToPOIResponse.cs rename to Adyen/TerminalApi/Models/SaleToPOIResponse.cs diff --git a/Adyen/Model/TerminalApi/SensitiveCardData.cs b/Adyen/TerminalApi/Models/SensitiveCardData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SensitiveCardData.cs rename to Adyen/TerminalApi/Models/SensitiveCardData.cs diff --git a/Adyen/Model/TerminalApi/SensitiveMobileData.cs b/Adyen/TerminalApi/Models/SensitiveMobileData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SensitiveMobileData.cs rename to Adyen/TerminalApi/Models/SensitiveMobileData.cs diff --git a/Adyen/Model/TerminalApi/SignaturePoint.cs b/Adyen/TerminalApi/Models/SignaturePoint.cs similarity index 100% rename from Adyen/Model/TerminalApi/SignaturePoint.cs rename to Adyen/TerminalApi/Models/SignaturePoint.cs diff --git a/Adyen/Model/TerminalApi/SignedData.cs b/Adyen/TerminalApi/Models/SignedData.cs similarity index 100% rename from Adyen/Model/TerminalApi/SignedData.cs rename to Adyen/TerminalApi/Models/SignedData.cs diff --git a/Adyen/Model/TerminalApi/Signer.cs b/Adyen/TerminalApi/Models/Signer.cs similarity index 100% rename from Adyen/Model/TerminalApi/Signer.cs rename to Adyen/TerminalApi/Models/Signer.cs diff --git a/Adyen/Model/TerminalApi/SignerIdentifier.cs b/Adyen/TerminalApi/Models/SignerIdentifier.cs similarity index 100% rename from Adyen/Model/TerminalApi/SignerIdentifier.cs rename to Adyen/TerminalApi/Models/SignerIdentifier.cs diff --git a/Adyen/Model/TerminalApi/SoundActionType.cs b/Adyen/TerminalApi/Models/SoundActionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundActionType.cs rename to Adyen/TerminalApi/Models/SoundActionType.cs diff --git a/Adyen/Model/TerminalApi/SoundContent.cs b/Adyen/TerminalApi/Models/SoundContent.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundContent.cs rename to Adyen/TerminalApi/Models/SoundContent.cs diff --git a/Adyen/Model/TerminalApi/SoundFormatType.cs b/Adyen/TerminalApi/Models/SoundFormatType.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundFormatType.cs rename to Adyen/TerminalApi/Models/SoundFormatType.cs diff --git a/Adyen/Model/TerminalApi/SoundRequest.cs b/Adyen/TerminalApi/Models/SoundRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundRequest.cs rename to Adyen/TerminalApi/Models/SoundRequest.cs diff --git a/Adyen/Model/TerminalApi/SoundResponse.cs b/Adyen/TerminalApi/Models/SoundResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/SoundResponse.cs rename to Adyen/TerminalApi/Models/SoundResponse.cs diff --git a/Adyen/Model/Terminal/Split.cs b/Adyen/TerminalApi/Models/Split.cs similarity index 100% rename from Adyen/Model/Terminal/Split.cs rename to Adyen/TerminalApi/Models/Split.cs diff --git a/Adyen/Model/Terminal/SplitItem.cs b/Adyen/TerminalApi/Models/SplitItem.cs similarity index 100% rename from Adyen/Model/Terminal/SplitItem.cs rename to Adyen/TerminalApi/Models/SplitItem.cs diff --git a/Adyen/Model/Terminal/SplitItemType.cs b/Adyen/TerminalApi/Models/SplitItemType.cs similarity index 100% rename from Adyen/Model/Terminal/SplitItemType.cs rename to Adyen/TerminalApi/Models/SplitItemType.cs diff --git a/Adyen/Model/TerminalApi/SponsoredMerchant.cs b/Adyen/TerminalApi/Models/SponsoredMerchant.cs similarity index 100% rename from Adyen/Model/TerminalApi/SponsoredMerchant.cs rename to Adyen/TerminalApi/Models/SponsoredMerchant.cs diff --git a/Adyen/Model/TerminalApi/StoredValueAccountID.cs b/Adyen/TerminalApi/Models/StoredValueAccountID.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueAccountID.cs rename to Adyen/TerminalApi/Models/StoredValueAccountID.cs diff --git a/Adyen/Model/TerminalApi/StoredValueAccountStatus.cs b/Adyen/TerminalApi/Models/StoredValueAccountStatus.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueAccountStatus.cs rename to Adyen/TerminalApi/Models/StoredValueAccountStatus.cs diff --git a/Adyen/Model/TerminalApi/StoredValueAccountType.cs b/Adyen/TerminalApi/Models/StoredValueAccountType.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueAccountType.cs rename to Adyen/TerminalApi/Models/StoredValueAccountType.cs diff --git a/Adyen/Model/TerminalApi/StoredValueData.cs b/Adyen/TerminalApi/Models/StoredValueData.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueData.cs rename to Adyen/TerminalApi/Models/StoredValueData.cs diff --git a/Adyen/Model/TerminalApi/StoredValueRequest.cs b/Adyen/TerminalApi/Models/StoredValueRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueRequest.cs rename to Adyen/TerminalApi/Models/StoredValueRequest.cs diff --git a/Adyen/Model/TerminalApi/StoredValueResponse.cs b/Adyen/TerminalApi/Models/StoredValueResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueResponse.cs rename to Adyen/TerminalApi/Models/StoredValueResponse.cs diff --git a/Adyen/Model/TerminalApi/StoredValueResult.cs b/Adyen/TerminalApi/Models/StoredValueResult.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueResult.cs rename to Adyen/TerminalApi/Models/StoredValueResult.cs diff --git a/Adyen/Model/TerminalApi/StoredValueTransactionType.cs b/Adyen/TerminalApi/Models/StoredValueTransactionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/StoredValueTransactionType.cs rename to Adyen/TerminalApi/Models/StoredValueTransactionType.cs diff --git a/Adyen/Model/TerminalApi/TerminalEnvironmentType.cs b/Adyen/TerminalApi/Models/TerminalEnvironmentType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TerminalEnvironmentType.cs rename to Adyen/TerminalApi/Models/TerminalEnvironmentType.cs diff --git a/Adyen/Model/TerminalApi/TokenRequestedType.cs b/Adyen/TerminalApi/Models/TokenRequestedType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TokenRequestedType.cs rename to Adyen/TerminalApi/Models/TokenRequestedType.cs diff --git a/Adyen/Model/TerminalApi/TotalDetailsType.cs b/Adyen/TerminalApi/Models/TotalDetailsType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TotalDetailsType.cs rename to Adyen/TerminalApi/Models/TotalDetailsType.cs diff --git a/Adyen/Model/TerminalApi/TotalFilter.cs b/Adyen/TerminalApi/Models/TotalFilter.cs similarity index 100% rename from Adyen/Model/TerminalApi/TotalFilter.cs rename to Adyen/TerminalApi/Models/TotalFilter.cs diff --git a/Adyen/Model/TerminalApi/TrackData.cs b/Adyen/TerminalApi/Models/TrackData.cs similarity index 100% rename from Adyen/Model/TerminalApi/TrackData.cs rename to Adyen/TerminalApi/Models/TrackData.cs diff --git a/Adyen/Model/TerminalApi/TrackFormatType.cs b/Adyen/TerminalApi/Models/TrackFormatType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TrackFormatType.cs rename to Adyen/TerminalApi/Models/TrackFormatType.cs diff --git a/Adyen/Model/TerminalApi/TransactionActionType.cs b/Adyen/TerminalApi/Models/TransactionActionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionActionType.cs rename to Adyen/TerminalApi/Models/TransactionActionType.cs diff --git a/Adyen/Model/TerminalApi/TransactionConditions.cs b/Adyen/TerminalApi/Models/TransactionConditions.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionConditions.cs rename to Adyen/TerminalApi/Models/TransactionConditions.cs diff --git a/Adyen/Model/TerminalApi/TransactionIdentification.cs b/Adyen/TerminalApi/Models/TransactionIdentification.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionIdentification.cs rename to Adyen/TerminalApi/Models/TransactionIdentification.cs diff --git a/Adyen/Model/TerminalApi/TransactionStatusRequest.cs b/Adyen/TerminalApi/Models/TransactionStatusRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionStatusRequest.cs rename to Adyen/TerminalApi/Models/TransactionStatusRequest.cs diff --git a/Adyen/Model/TerminalApi/TransactionStatusResponse.cs b/Adyen/TerminalApi/Models/TransactionStatusResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionStatusResponse.cs rename to Adyen/TerminalApi/Models/TransactionStatusResponse.cs diff --git a/Adyen/Model/TerminalApi/TransactionToPerform.cs b/Adyen/TerminalApi/Models/TransactionToPerform.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionToPerform.cs rename to Adyen/TerminalApi/Models/TransactionToPerform.cs diff --git a/Adyen/Model/TerminalApi/TransactionTotals.cs b/Adyen/TerminalApi/Models/TransactionTotals.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionTotals.cs rename to Adyen/TerminalApi/Models/TransactionTotals.cs diff --git a/Adyen/Model/TerminalApi/TransactionType.cs b/Adyen/TerminalApi/Models/TransactionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransactionType.cs rename to Adyen/TerminalApi/Models/TransactionType.cs diff --git a/Adyen/Model/TerminalApi/TransmitRequest.cs b/Adyen/TerminalApi/Models/TransmitRequest.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransmitRequest.cs rename to Adyen/TerminalApi/Models/TransmitRequest.cs diff --git a/Adyen/Model/TerminalApi/TransmitResponse.cs b/Adyen/TerminalApi/Models/TransmitResponse.cs similarity index 100% rename from Adyen/Model/TerminalApi/TransmitResponse.cs rename to Adyen/TerminalApi/Models/TransmitResponse.cs diff --git a/Adyen/Model/TerminalApi/UTMCoordinates.cs b/Adyen/TerminalApi/Models/UTMCoordinates.cs similarity index 100% rename from Adyen/Model/TerminalApi/UTMCoordinates.cs rename to Adyen/TerminalApi/Models/UTMCoordinates.cs diff --git a/Adyen/Model/TerminalApi/UnitOfMeasureType.cs b/Adyen/TerminalApi/Models/UnitOfMeasureType.cs similarity index 100% rename from Adyen/Model/TerminalApi/UnitOfMeasureType.cs rename to Adyen/TerminalApi/Models/UnitOfMeasureType.cs diff --git a/Adyen/Model/TerminalApi/VersionType.cs b/Adyen/TerminalApi/Models/VersionType.cs similarity index 100% rename from Adyen/Model/TerminalApi/VersionType.cs rename to Adyen/TerminalApi/Models/VersionType.cs diff --git a/Adyen/Security/AesEncryptor.cs b/Adyen/TerminalApi/Security/AesEncryptor.cs similarity index 100% rename from Adyen/Security/AesEncryptor.cs rename to Adyen/TerminalApi/Security/AesEncryptor.cs diff --git a/Adyen/Security/EncryptionCredentialDetails.cs b/Adyen/TerminalApi/Security/EncryptionCredentialDetails.cs similarity index 100% rename from Adyen/Security/EncryptionCredentialDetails.cs rename to Adyen/TerminalApi/Security/EncryptionCredentialDetails.cs diff --git a/Adyen/Security/EncryptionDerivedKey.cs b/Adyen/TerminalApi/Security/EncryptionDerivedKey.cs similarity index 100% rename from Adyen/Security/EncryptionDerivedKey.cs rename to Adyen/TerminalApi/Security/EncryptionDerivedKey.cs diff --git a/Adyen/Security/EncryptionDerivedKeyGenerator.cs b/Adyen/TerminalApi/Security/EncryptionDerivedKeyGenerator.cs similarity index 100% rename from Adyen/Security/EncryptionDerivedKeyGenerator.cs rename to Adyen/TerminalApi/Security/EncryptionDerivedKeyGenerator.cs diff --git a/Adyen/Security/Exceptions/NexoCryptoException.cs b/Adyen/TerminalApi/Security/Exceptions/NexoCryptoException.cs similarity index 100% rename from Adyen/Security/Exceptions/NexoCryptoException.cs rename to Adyen/TerminalApi/Security/Exceptions/NexoCryptoException.cs diff --git a/Adyen/Security/Extension/ArrayExtension.cs b/Adyen/TerminalApi/Security/Extension/ArrayExtension.cs similarity index 100% rename from Adyen/Security/Extension/ArrayExtension.cs rename to Adyen/TerminalApi/Security/Extension/ArrayExtension.cs diff --git a/Adyen/Security/HmacSha256Wrapper.cs b/Adyen/TerminalApi/Security/HmacSha256Wrapper.cs similarity index 100% rename from Adyen/Security/HmacSha256Wrapper.cs rename to Adyen/TerminalApi/Security/HmacSha256Wrapper.cs diff --git a/Adyen/Security/IvModGenerator.cs b/Adyen/TerminalApi/Security/IvModGenerator.cs similarity index 100% rename from Adyen/Security/IvModGenerator.cs rename to Adyen/TerminalApi/Security/IvModGenerator.cs diff --git a/Adyen/Security/SaleToPoiMessageSecured.cs b/Adyen/TerminalApi/Security/SaleToPoiMessageSecured.cs similarity index 100% rename from Adyen/Security/SaleToPoiMessageSecured.cs rename to Adyen/TerminalApi/Security/SaleToPoiMessageSecured.cs diff --git a/Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs b/Adyen/TerminalApi/Security/SaleToPoiMessageSecuredEncryptor.cs similarity index 100% rename from Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs rename to Adyen/TerminalApi/Security/SaleToPoiMessageSecuredEncryptor.cs diff --git a/Adyen/Security/SecurityTrailer.cs b/Adyen/TerminalApi/Security/SecurityTrailer.cs similarity index 100% rename from Adyen/Security/SecurityTrailer.cs rename to Adyen/TerminalApi/Security/SecurityTrailer.cs diff --git a/Adyen/Security/TerminalCommonNameValidator.cs b/Adyen/TerminalApi/Security/TerminalCommonNameValidator.cs similarity index 100% rename from Adyen/Security/TerminalCommonNameValidator.cs rename to Adyen/TerminalApi/Security/TerminalCommonNameValidator.cs diff --git a/Adyen/Service/TerminalApiAsyncService.cs b/Adyen/TerminalApi/Services/TerminalApiAsyncService.cs similarity index 100% rename from Adyen/Service/TerminalApiAsyncService.cs rename to Adyen/TerminalApi/Services/TerminalApiAsyncService.cs diff --git a/Adyen/Service/TerminalApiLocalService.cs b/Adyen/TerminalApi/Services/TerminalApiLocalService.cs similarity index 100% rename from Adyen/Service/TerminalApiLocalService.cs rename to Adyen/TerminalApi/Services/TerminalApiLocalService.cs diff --git a/Adyen/Service/TerminalApiSyncService.cs b/Adyen/TerminalApi/Services/TerminalApiSyncService.cs similarity index 100% rename from Adyen/Service/TerminalApiSyncService.cs rename to Adyen/TerminalApi/Services/TerminalApiSyncService.cs diff --git a/Adyen/Service/TerminalCloudApi.cs b/Adyen/TerminalApi/Services/TerminalCloudApi.cs similarity index 100% rename from Adyen/Service/TerminalCloudApi.cs rename to Adyen/TerminalApi/Services/TerminalCloudApi.cs diff --git a/Adyen/Service/TerminalLocalApi.cs b/Adyen/TerminalApi/Services/TerminalLocalApi.cs similarity index 100% rename from Adyen/Service/TerminalLocalApi.cs rename to Adyen/TerminalApi/Services/TerminalLocalApi.cs diff --git a/Adyen/Service/TerminalLocalApiUnencrypted.cs b/Adyen/TerminalApi/Services/TerminalLocalApiUnencrypted.cs similarity index 100% rename from Adyen/Service/TerminalLocalApiUnencrypted.cs rename to Adyen/TerminalApi/Services/TerminalLocalApiUnencrypted.cs diff --git a/Adyen/Util/TerminalApi/AdditionalResponse.cs b/Adyen/TerminalApi/Utilities/AdditionalResponse.cs similarity index 100% rename from Adyen/Util/TerminalApi/AdditionalResponse.cs rename to Adyen/TerminalApi/Utilities/AdditionalResponse.cs diff --git a/Adyen/Util/TerminalApi/CardAcquisitionUtil.cs b/Adyen/TerminalApi/Utilities/CardAcquisitionUtil.cs similarity index 100% rename from Adyen/Util/TerminalApi/CardAcquisitionUtil.cs rename to Adyen/TerminalApi/Utilities/CardAcquisitionUtil.cs diff --git a/Adyen/Webhooks/BalancePlatformWebhookHandler.cs b/Adyen/WebhookHandlers/BalancePlatformWebhookHandler.cs similarity index 100% rename from Adyen/Webhooks/BalancePlatformWebhookHandler.cs rename to Adyen/WebhookHandlers/BalancePlatformWebhookHandler.cs diff --git a/Adyen/Webhooks/ClassicPlatformWebhookHandler.cs b/Adyen/WebhookHandlers/ClassicPlatformWebhookHandler.cs similarity index 100% rename from Adyen/Webhooks/ClassicPlatformWebhookHandler.cs rename to Adyen/WebhookHandlers/ClassicPlatformWebhookHandler.cs diff --git a/Adyen/Webhooks/ManagementWebhookHandler.cs b/Adyen/WebhookHandlers/ManagementWebhookHandler.cs similarity index 100% rename from Adyen/Webhooks/ManagementWebhookHandler.cs rename to Adyen/WebhookHandlers/ManagementWebhookHandler.cs diff --git a/Adyen/Webhooks/WebhookHandler.cs b/Adyen/WebhookHandlers/WebhookHandler.cs similarity index 100% rename from Adyen/Webhooks/WebhookHandler.cs rename to Adyen/WebhookHandlers/WebhookHandler.cs From dd70d99d7df43e9aca507e90ed7cc5da56b56774 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 29 Oct 2025 17:40:15 +0100 Subject: [PATCH 079/126] Move ConstructHostUrl to /Core Remove unused RELATIVE_URL Remove strict null-checks for WriteProperties --- .../AccountHolders/AccountHolderTest.cs | 15 ++ Adyen.Test/Checkout/PaymentsServiceTest.cs | 1 - .../LegalEntityManagementTest.cs | 201 ++++++++++++++++++ .../AccountHolderWithUnknownEnum.json | 21 ++ Adyen/Core/Client/UrlBuilderExtension.cs | 75 +++++++ Adyen/{ => TerminalApi}/AdyenClient.cs | 0 Adyen/{Model => TerminalApi}/ApiError.cs | 0 Adyen/{ => TerminalApi}/BaseUrlConfig.cs | 0 Adyen/{ => TerminalApi}/Config.cs | 158 +++++++------- Adyen/{Model => TerminalApi}/Environment.cs | 0 .../{Model => TerminalApi}/RequestOptions.cs | 0 Adyen/Util/Util.cs | 15 -- .../Models}/NotificationRequest.cs | 0 .../Models}/NotificationRequestConst.cs | 0 .../Models}/NotificationRequestItem.cs | 0 .../NotificationRequestItemContainer.cs | 0 .../generichost/HostConfiguration.mustache | 70 +----- .../generichost/JsonConverter.mustache | 33 +-- 18 files changed, 399 insertions(+), 190 deletions(-) create mode 100644 Adyen.Test/LegalEntityManagement/LegalEntityManagementTest.cs create mode 100644 Adyen.Test/mocks/balanceplatform/AccountHolderWithUnknownEnum.json create mode 100644 Adyen/Core/Client/UrlBuilderExtension.cs rename Adyen/{ => TerminalApi}/AdyenClient.cs (100%) rename Adyen/{Model => TerminalApi}/ApiError.cs (100%) rename Adyen/{ => TerminalApi}/BaseUrlConfig.cs (100%) rename Adyen/{ => TerminalApi}/Config.cs (98%) rename Adyen/{Model => TerminalApi}/Environment.cs (100%) rename Adyen/{Model => TerminalApi}/RequestOptions.cs (100%) delete mode 100644 Adyen/Util/Util.cs rename Adyen/{Model/Notification => WebhookHandlers/Models}/NotificationRequest.cs (100%) rename Adyen/{Model/Notification => WebhookHandlers/Models}/NotificationRequestConst.cs (100%) rename Adyen/{Model/Notification => WebhookHandlers/Models}/NotificationRequestItem.cs (100%) rename Adyen/{Model/Notification => WebhookHandlers/Models}/NotificationRequestItemContainer.cs (100%) diff --git a/Adyen.Test/BalancePlatform/AccountHolders/AccountHolderTest.cs b/Adyen.Test/BalancePlatform/AccountHolders/AccountHolderTest.cs index b2155a77e..3631ced4e 100644 --- a/Adyen.Test/BalancePlatform/AccountHolders/AccountHolderTest.cs +++ b/Adyen.Test/BalancePlatform/AccountHolders/AccountHolderTest.cs @@ -32,6 +32,21 @@ public AccountHolderTest() _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); } + + [TestMethod] + public async Task Given_AccountHolder_When_Unknown_Enum_Then_Result_Deserialize_To_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/AccountHolderWithUnknownEnum.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNotNull(response); + Assert.IsNull(response.Status); + } + [TestMethod] public async Task Given_AccountHolder_Deserialize_Correctly() { diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index 34275c68b..95216880b 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -7,7 +7,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; using Adyen.Core.Options; -using Newtonsoft.Json; using JsonSerializer = System.Text.Json.JsonSerializer; namespace Adyen.Test.Checkout diff --git a/Adyen.Test/LegalEntityManagement/LegalEntityManagementTest.cs b/Adyen.Test/LegalEntityManagement/LegalEntityManagementTest.cs new file mode 100644 index 000000000..6dc6f03c6 --- /dev/null +++ b/Adyen.Test/LegalEntityManagement/LegalEntityManagementTest.cs @@ -0,0 +1,201 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Text; +using System.Text.Json; +using Adyen.Checkout.Extensions; + +using Adyen.Core.Options; +using Adyen.LegalEntityManagement.Extensions; +using Adyen.LegalEntityManagement.Models; +using Adyen.LegalEntityManagement.Services; +using Adyen.LegalEntityManagement.Client; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; + +namespace Adyen.Test.LegalEntityManagement +{ + [TestClass] + public class LegalEntityManagementTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public LegalEntityManagementTest() + { + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureLegalEntityManagement((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + _jsonSerializerOptionsProvider = testHost.Services.GetRequiredService(); + } + + /// + /// Test createDocument + /// + [TestMethod] + public void CreateDocument() + { + // Arrange + var json = TestUtilities.GetTestFileContent("mocks/legalentitymanagement/Document.json"); + + // Act + var result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNotNull(result); + } + // + // /// + // /// Test createDocument + // /// + // [TestMethod] + // public void UpdateDocument() + // { + // var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/legalentitymanagement/Document.json"); + // var service = new DocumentsService(client); + // var document = new Document + // { + // Attachment = new Attachment() + // }; + // var response = service.UpdateDocument("SE322KT223222D5FJ7TJN2986",document); + // Assert.AreEqual(Encoding.ASCII.GetString(response.Attachments[0].Content), "This is a string"); + // Assert.AreEqual(response.Id, "SE322KT223222D5FJ7TJN2986"); + // + // } + // + // /// + // /// Test deleteDocument + // /// + // [TestMethod] + // public void DeleteDocumentTest() + // { + // var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/legalentitymanagement/Document.json"); + // var service = new DocumentsService(client); + // service.DeleteDocument("SE322KT223222D5FJ7TJN2986"); + // + // } + // #endregion + // + // #region TransferInstruments + // /// + // /// Test createTransferInstruments + // /// + // [TestMethod] + // public void CreateTransferInstrumentsTest() + // { + // var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/legalentitymanagement/TransferInstrument.json"); + // var service = new TransferInstrumentsService(client); + // var transferInstrumentInfo = new TransferInstrumentInfo + // { + // LegalEntityId = "", + // Type = TransferInstrumentInfo.TypeEnum.BankAccount + // }; + // var response = service.CreateTransferInstrument(transferInstrumentInfo); + // Assert.AreEqual(response.LegalEntityId, "LE322KH223222D5GG4C9J83RN"); + // Assert.AreEqual(response.Id, "SE576BH223222F5GJVKHH6BDT"); + // } + // /// + // /// Test updateTransferInstruments + // /// + // [TestMethod] + // public void UpdateTransferInstrumentsTest() + // { + // var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/legalentitymanagement/TransferInstrument.json"); + // var service = new TransferInstrumentsService(client); + // var transferInstrumentInfo = new TransferInstrumentInfo + // { + // LegalEntityId = "", + // Type = TransferInstrumentInfo.TypeEnum.BankAccount + // }; + // var task = service.UpdateTransferInstrumentAsync("SE576BH223222F5GJVKHH6BDT", transferInstrumentInfo); + // var response = task.Result; + // Assert.AreEqual(response.LegalEntityId, "LE322KH223222D5GG4C9J83RN"); + // Assert.AreEqual(response.Id, "SE576BH223222F5GJVKHH6BDT"); + // } + // #endregion + // + // #region HostedOnboarding + // /// + // /// Test hostedOnboarding + // /// + // [TestMethod] + // public void ListThemesTest() + // { + // var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/legalentitymanagement/OnboardingThemes.json"); + // var service = new HostedOnboardingService(client); + // var task = service.ListHostedOnboardingPageThemesAsync(); + // var response = task.Result; + // Assert.AreEqual(response.Themes[0].Id, "SE322KT223222D5FJ7TJN2986"); + // Assert.AreEqual(response.Themes[0].CreatedAt, DateTime.Parse("2022-10-31T01:30:00+01:00")); + // } + // #endregion + // + // #region LegalEntities + // /// + // /// Test update LegalEntities + // /// + // [TestMethod] + // public void UpdateLegalEntitiesTest() + // { + // var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/legalentitymanagement/LegalEntity.json"); + // var service = new LegalEntitiesService(client); + // var legalEntityInfo = new LegalEntityInfo + // { + // Organization = new Organization(), + // Type = LegalEntityInfo.TypeEnum.Individual, + // EntityAssociations = new List(), + // SoleProprietorship = new SoleProprietorship() + // }; + // var response = service.UpdateLegalEntity("LE322JV223222D5GG42KN6869", legalEntityInfo); + // Assert.AreEqual(response.Id, "LE322JV223222D5GG42KN6869"); + // Assert.AreEqual(response.Type, LegalEntity.TypeEnum.Individual); + // } + // #endregion + // + // #region LegalEntities + // /// + // /// Test update BusinessLines + // /// + // [TestMethod] + // public void UpdateBusinessLinesTest() + // { + // var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/legalentitymanagement/BusinessLine.json"); + // var service = new BusinessLinesService(client); + // var businessLine = new BusinessLineInfoUpdate + // { + // IndustryCode = "124rrdfer", + // SourceOfFunds = new SourceOfFunds() + // }; + // var response = service.UpdateBusinessLine("SE322KT223222D5FJ7TJN2986", businessLine); + // Assert.AreEqual(response.Id, "SE322KT223222D5FJ7TJN2986"); + // Assert.AreEqual(response.IndustryCode, "55"); + // } + // #endregion + // + // #region TermsOfService + // /// + // /// Test get TermsOfService Status + // /// + // [TestMethod] + // public void GetTermsOfServiceStatus() + // { + // var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/legalentitymanagement/TermsOfServiceStatus.json"); + // var service = new TermsOfServiceService(client); + // var response = service.GetTermsOfServiceInformationForLegalEntity("id123"); + // ClientInterfaceSubstitute.Received().RequestAsync( + // "https://kyc-test.adyen.com/lem/v3/legalEntities/id123/termsOfServiceAcceptanceInfos", + // null, + // null, + // new HttpMethod("GET"), default); + // Assert.AreEqual(response.Data[0].Type, TermsOfServiceAcceptanceInfo.TypeEnum.AdyenIssuing); + // } + // #endregion + } +} diff --git a/Adyen.Test/mocks/balanceplatform/AccountHolderWithUnknownEnum.json b/Adyen.Test/mocks/balanceplatform/AccountHolderWithUnknownEnum.json new file mode 100644 index 000000000..a16376ddc --- /dev/null +++ b/Adyen.Test/mocks/balanceplatform/AccountHolderWithUnknownEnum.json @@ -0,0 +1,21 @@ +{ + "balancePlatform": "BalandePlatformExample", + "contactDetails": { + "address": { + "city": "Amsterdam", + "country": "NL", + "houseNumberOrName": "274", + "postalCode": "1020CD", + "street": "Brannan Street" + }, + "email": "s.hopper@example.com", + "phone": { + "number": "+315551231234", + "type": "mobile" + } + }, + "legalEntityId": "LE322JV223222D5GG42KN6869", + "description": "S.Hopper - Staff 123", + "id": "AH32272223222B5CM4MWJ892H", + "status": "unknown-enum" +} \ No newline at end of file diff --git a/Adyen/Core/Client/UrlBuilderExtension.cs b/Adyen/Core/Client/UrlBuilderExtension.cs new file mode 100644 index 000000000..299f020c3 --- /dev/null +++ b/Adyen/Core/Client/UrlBuilderExtension.cs @@ -0,0 +1,75 @@ +using Adyen.Core.Options; + +namespace Adyen.Core.Client +{ + /// + /// Helper utility functions to construct the Adyen live-urls for our APIs. + /// + public static class UrlBuilderExtensions + { + /// + /// Constructs the Host URL based on the selected , used to populate the `HttpClient.BaseAddress`. + /// + /// . + /// The base URL of the API. + /// String with the Host URL. + /// + public static string ConstructHostUrl(AdyenOptions adyenOptions, string baseUrl) + { + if (adyenOptions.Environment == AdyenEnvironment.Live) + return ConstructLiveUrl(adyenOptions.LiveEndpointUrlPrefix, baseUrl); + + // Some Adyen OpenApi Specifications use the live-url, instead of the test-url, this line replaces "-live" with "-test". + // If you need to override this URL, you can do so by replacing the BASE_URL in ClientUtils.cs. + if (adyenOptions.Environment == AdyenEnvironment.Test) + return baseUrl.Replace("-live", "-test"); + + throw new ArgumentOutOfRangeException(adyenOptions.Environment.ToString()); + } + + /// + /// Construct LIVE BaseUrl, add the liveEndpointUrlPrefix it's the Checkout API or the Classic Payment API. + /// This helper function can be removed when all URLs (test & live) are included in the Adyen OpenApi Specifications: https://github.com/Adyen/adyen-openapi. + /// + /// The Live endpoint url prefix. + /// The base URL of the API. + /// baseUrl + /// + public static string ConstructLiveUrl(string liveEndpointUrlPrefix, string url) + { + // Change base url for Live environment + if (url.Contains("pal-")) // Payment API prefix + { + if (liveEndpointUrlPrefix == null) + { + throw new InvalidOperationException("LiveEndpointUrlPrefix is null - please configure your AdyenOptions.LiveEndpointUrlPrefix"); + } + + url = url.Replace("https://pal-test.adyen.com/pal/servlet/", + "https://" + liveEndpointUrlPrefix + "-pal-live.adyenpayments.com/pal/servlet/"); + } + else if (url.Contains("checkout-")) // Checkout API prefix + { + if (liveEndpointUrlPrefix == null) + { + throw new InvalidOperationException("LiveEndpointUrlPrefix is null - please configure your AdyenOptions.LiveEndpointUrlPrefix"); + } + + if (url.Contains("possdk")) + { + url = url.Replace("https://checkout-test.adyen.com/", + "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/"); + } + else + { + url = url.Replace("https://checkout-test.adyen.com/", + "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/"); + } + } + + // If no prefix is required, we replace "test" -> "live" + url = url.Replace("-test", "-live"); + return url; + } + } +} \ No newline at end of file diff --git a/Adyen/AdyenClient.cs b/Adyen/TerminalApi/AdyenClient.cs similarity index 100% rename from Adyen/AdyenClient.cs rename to Adyen/TerminalApi/AdyenClient.cs diff --git a/Adyen/Model/ApiError.cs b/Adyen/TerminalApi/ApiError.cs similarity index 100% rename from Adyen/Model/ApiError.cs rename to Adyen/TerminalApi/ApiError.cs diff --git a/Adyen/BaseUrlConfig.cs b/Adyen/TerminalApi/BaseUrlConfig.cs similarity index 100% rename from Adyen/BaseUrlConfig.cs rename to Adyen/TerminalApi/BaseUrlConfig.cs diff --git a/Adyen/Config.cs b/Adyen/TerminalApi/Config.cs similarity index 98% rename from Adyen/Config.cs rename to Adyen/TerminalApi/Config.cs index 25a1f4ba9..679c799ef 100644 --- a/Adyen/Config.cs +++ b/Adyen/TerminalApi/Config.cs @@ -1,80 +1,80 @@ -using System; -using System.Net; -using Adyen.Constants; -using Environment = Adyen.Model.Environment; - -namespace Adyen -{ - public class Config - { - public string Username { get; set; } - public string Password { get; set; } - public bool HasPassword => !string.IsNullOrEmpty(Password); - - public Environment Environment { get; set; } - public string LiveEndpointUrlPrefix { get; set; } - public string ApplicationName { get; set; } - public IWebProxy Proxy { get; set; } - - /// - /// Your Adyen API key. - /// - public string XApiKey { get; set; } - public bool HasApiKey => !string.IsNullOrEmpty(XApiKey); - - /// - /// HttpConnection Timeout in milliseconds (e.g. the time required to send the request and receive the response). - /// In > NET6.0, we recommend configuring your own and pass it in the constructor. - /// The values shown here are defaults, if no is provided. - /// - public int Timeout { get; set; } = 60000; - - /// - /// Only The amount of time it should take to establish the TCP Connection. - /// This value is only used in when no default was passed in the constructor. - /// In > NET6.0, we recommend configuring your own and pass it in the constructor. - /// The values shown here are defaults, if no is provided. - /// - public TimeSpan ConnectTimeout { get; set; } = TimeSpan.FromSeconds(15); - - /// - /// Force reconnection to refresh DNS and avoid stale connections. - /// Once a connection exceeds the specified lifetime, it is no longer considered reusable and it is closed and removed from the pool. - /// This value is only used in when no default was passed in the constructor. - /// In > NET6.0, we recommend configuring your own and pass it in the constructor. - /// The values shown here are defaults, if no is provided. - /// - public TimeSpan PooledConnectionLifetime { get; set; } = TimeSpan.FromMinutes(5); - - /// - /// Close idle connections after the specified time. - /// This value is only used in when no default was passed in the constructor. - /// In > NET6.0, we recommend configuring your own and pass it in the constructor. - /// The values shown here are defaults, if no is provided. - /// - public TimeSpan PooledConnectionIdleTimeout { get; set; }= TimeSpan.FromMinutes(2); - - /// - /// Maximum number of concurrent TCP connections per server. - /// This value is only used in when no default was passed in the constructor. - /// In > NET6.0, we recommend configuring your own and pass it in the constructor. - /// The values shown here are defaults, if no is provided. - /// - public int MaxConnectionsPerServer { get; set; } = 2; - - /// - /// The url of the Cloud Terminal Api endpoint. - /// This value is populated when specifying the in . - /// - public string CloudApiEndPoint { get; set; } - - /// - /// The url of the Terminal Api endpoint, can be overriden if you want to send local terminal-api requests. - /// - public string LocalTerminalApiEndpoint { get; set; } - - public BaseUrlConfig BaseUrlConfig { get; set; } - - public Region TerminalApiRegion { get; set; } - } +using System; +using System.Net; +using Adyen.Constants; +using Environment = Adyen.Model.Environment; + +namespace Adyen +{ + public class Config + { + public string Username { get; set; } + public string Password { get; set; } + public bool HasPassword => !string.IsNullOrEmpty(Password); + + public Environment Environment { get; set; } + public string LiveEndpointUrlPrefix { get; set; } + public string ApplicationName { get; set; } + public IWebProxy Proxy { get; set; } + + /// + /// Your Adyen API key. + /// + public string XApiKey { get; set; } + public bool HasApiKey => !string.IsNullOrEmpty(XApiKey); + + /// + /// HttpConnection Timeout in milliseconds (e.g. the time required to send the request and receive the response). + /// In > NET6.0, we recommend configuring your own and pass it in the constructor. + /// The values shown here are defaults, if no is provided. + /// + public int Timeout { get; set; } = 60000; + + /// + /// Only The amount of time it should take to establish the TCP Connection. + /// This value is only used in when no default was passed in the constructor. + /// In > NET6.0, we recommend configuring your own and pass it in the constructor. + /// The values shown here are defaults, if no is provided. + /// + public TimeSpan ConnectTimeout { get; set; } = TimeSpan.FromSeconds(15); + + /// + /// Force reconnection to refresh DNS and avoid stale connections. + /// Once a connection exceeds the specified lifetime, it is no longer considered reusable and it is closed and removed from the pool. + /// This value is only used in when no default was passed in the constructor. + /// In > NET6.0, we recommend configuring your own and pass it in the constructor. + /// The values shown here are defaults, if no is provided. + /// + public TimeSpan PooledConnectionLifetime { get; set; } = TimeSpan.FromMinutes(5); + + /// + /// Close idle connections after the specified time. + /// This value is only used in when no default was passed in the constructor. + /// In > NET6.0, we recommend configuring your own and pass it in the constructor. + /// The values shown here are defaults, if no is provided. + /// + public TimeSpan PooledConnectionIdleTimeout { get; set; }= TimeSpan.FromMinutes(2); + + /// + /// Maximum number of concurrent TCP connections per server. + /// This value is only used in when no default was passed in the constructor. + /// In > NET6.0, we recommend configuring your own and pass it in the constructor. + /// The values shown here are defaults, if no is provided. + /// + public int MaxConnectionsPerServer { get; set; } = 2; + + /// + /// The url of the Cloud Terminal Api endpoint. + /// This value is populated when specifying the in . + /// + public string CloudApiEndPoint { get; set; } + + /// + /// The url of the Terminal Api endpoint, can be overriden if you want to send local terminal-api requests. + /// + public string LocalTerminalApiEndpoint { get; set; } + + public BaseUrlConfig BaseUrlConfig { get; set; } + + public Region TerminalApiRegion { get; set; } + } } \ No newline at end of file diff --git a/Adyen/Model/Environment.cs b/Adyen/TerminalApi/Environment.cs similarity index 100% rename from Adyen/Model/Environment.cs rename to Adyen/TerminalApi/Environment.cs diff --git a/Adyen/Model/RequestOptions.cs b/Adyen/TerminalApi/RequestOptions.cs similarity index 100% rename from Adyen/Model/RequestOptions.cs rename to Adyen/TerminalApi/RequestOptions.cs diff --git a/Adyen/Util/Util.cs b/Adyen/Util/Util.cs deleted file mode 100644 index 6da184eee..000000000 --- a/Adyen/Util/Util.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Adyen.Util -{ - public class Util - { - public static string CalculateSessionValidity() - { - //+1day - var dateTime=DateTime.Now.AddDays(1); - return String.Format("{0:s}", dateTime); - - } - } -} diff --git a/Adyen/Model/Notification/NotificationRequest.cs b/Adyen/WebhookHandlers/Models/NotificationRequest.cs similarity index 100% rename from Adyen/Model/Notification/NotificationRequest.cs rename to Adyen/WebhookHandlers/Models/NotificationRequest.cs diff --git a/Adyen/Model/Notification/NotificationRequestConst.cs b/Adyen/WebhookHandlers/Models/NotificationRequestConst.cs similarity index 100% rename from Adyen/Model/Notification/NotificationRequestConst.cs rename to Adyen/WebhookHandlers/Models/NotificationRequestConst.cs diff --git a/Adyen/Model/Notification/NotificationRequestItem.cs b/Adyen/WebhookHandlers/Models/NotificationRequestItem.cs similarity index 100% rename from Adyen/Model/Notification/NotificationRequestItem.cs rename to Adyen/WebhookHandlers/Models/NotificationRequestItem.cs diff --git a/Adyen/Model/Notification/NotificationRequestItemContainer.cs b/Adyen/WebhookHandlers/Models/NotificationRequestItemContainer.cs similarity index 100% rename from Adyen/Model/Notification/NotificationRequestItemContainer.cs rename to Adyen/WebhookHandlers/Models/NotificationRequestItemContainer.cs diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 786ee7550..e4bdacd30 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -41,11 +41,6 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} /// This value can change when `ConfigureAdyenOptions` is called in ). The new value will be based on the .. /// public static string BASE_URL = "{{{basePath}}}"; - - /// - /// The relative path of the API after the `.com`. - /// - public static string RELATIVE_URL = "{{contextPath}}"; /// /// Instantiates the HostConfiguration (custom JsonConverters, Events, HttpClient) with the necessary dependencies to communicate with the API. @@ -115,7 +110,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} clientAction = null, Action{{nrt?}} builderAction = null) { if (clientAction == null) - clientAction = httpClient => httpClient.BaseAddress = new Uri(ConstructHostUrl()); + clientAction = httpClient => httpClient.BaseAddress = new Uri(UrlBuilderExtensions.ConstructHostUrl(_adyenOptions, BASE_URL)); List builders = new List(); @@ -159,68 +154,5 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} {{/hasApiKeyMethods}} return this; } - - /// - /// Constructs the Host URL based on the selected , used to populate the `HttpClient.BaseAddress`. - /// - /// String with the Host URL. - /// - private string ConstructHostUrl() - { - if (_adyenOptions.Environment == {{packageName}}Environment.Live) - return ConstructLiveUrl(_adyenOptions.LiveEndpointUrlPrefix, BASE_URL); - - // Some Adyen OpenApi Specifications use the live-url, instead of the test-url, this line replaces "-live" with "-test". - // If you need to override this URL, you can do so by replacing the BASE_URL in ClientUtils.cs. - if (_adyenOptions.Environment == {{packageName}}Environment.Test) - return BASE_URL.Replace("-live", "-test"); - - throw new ArgumentOutOfRangeException(_adyenOptions.Environment.ToString()); - } - - /// - /// Construct LIVE BaseUrl, add the liveEndpointUrlPrefix it's the Checkout API or the Classic Payment API. - /// This helper function can be removed when all URLs (test & live) are included in the Adyen OpenApi Specifications: https://github.com/Adyen/adyen-openapi. - /// - /// The Live EndpointUrlPrefix. - /// The Base URL . - /// baseUrl - /// - private string ConstructLiveUrl(string liveEndpointUrlPrefix, string url) - { - // Change base url for Live environment - if (url.Contains("pal-")) // Payment API prefix - { - if (liveEndpointUrlPrefix == null) - { - throw new InvalidOperationException("LiveEndpointUrlPrefix is null - please configure your AdyenOptions.LiveEndpointUrlPrefix"); - } - - url = url.Replace("https://pal-test.adyen.com/pal/servlet/", - "https://" + liveEndpointUrlPrefix + "-pal-live.adyenpayments.com/pal/servlet/"); - } - else if (url.Contains("checkout-")) // Checkout API prefix - { - if (liveEndpointUrlPrefix == null) - { - throw new InvalidOperationException("LiveEndpointUrlPrefix is null - please configure your AdyenOptions.LiveEndpointUrlPrefix"); - } - - if (url.Contains("possdk")) - { - url = url.Replace("https://checkout-test.adyen.com/", - "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/"); - } - else - { - url = url.Replace("https://checkout-test.adyen.com/", - "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/"); - } - } - - // If no prefix is required, we replace "test" -> "live" - url = url.Replace("-test", "-live"); - return url; - } } } diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index fbf7b5513..583505a2a 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -275,13 +275,6 @@ {{/required}} {{/allVars}} - {{#allVars}} - {{^isNullable}} - if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.IsSet && {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.Value == null) - throw new ArgumentNullException(nameof({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}), "Property is not nullable for class {{classname}}."); - - {{/isNullable}} - {{/allVars}} {{^vendorExtensions.x-duplicated-data-type}} {{#model.discriminator}} {{#model.hasDiscriminatorWithNonEmptyMapping}} @@ -314,7 +307,7 @@ {{#composedSchemas}} {{#oneOf}} {{^vendorExtensions.x-duplicated-data-type}} - if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} != null) + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}?.Type != null) return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}ParsedValue{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); {{/vendorExtensions.x-duplicated-data-type}} @@ -442,27 +435,13 @@ { {{#lambda.trimTrailingWithNewLine}} {{#lambda.trimLineBreaks}} - /* - {{! TODO: Removed guard checks for required properties I've commented this out}} - {{#allVars}} - {{^isDiscriminator}} - {{^isNullable}} - {{#vendorExtensions.x-is-reference-type}} - if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}._{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) - throw new ArgumentNullException(nameof({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}), "Property is required for class {{classname}}."); - - {{/vendorExtensions.x-is-reference-type}} - {{/isNullable}} - {{/isDiscriminator}} - {{/allVars}} - */ {{#allVars}} {{#isDiscriminator}} {{^model.composedSchemas.anyOf}} {{^model.composedSchemas.oneOf}} - - writer.WriteString("{{baseName}}", {{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{/isEnum}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}.ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}{{/required}}){{/isEnum}}); + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) + writer.WriteString("{{baseName}}", {{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{/isEnum}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}.ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}{{/required}}){{/isEnum}}); {{/model.composedSchemas.oneOf}} {{/model.composedSchemas.anyOf}} @@ -474,10 +453,12 @@ {{^isUuid}} {{#lambda.copyText}} {{#isDecimal}} - writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}.ToString()); + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}.ToString()); {{/isDecimal}} {{^isDecimal}} - writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}); + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}); {{/isDecimal}} {{/lambda.copyText}} {{#lambda.indent3}} From 9155da67baa1e195875b6d9767499f4c412171ad Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 29 Oct 2025 20:34:51 +0100 Subject: [PATCH 080/126] Add ByteArrayConverter and tests --- .../TransactionRules/TransactionRuleTest.cs | 3 +- Adyen.Test/Checkout/PaymentsServiceTest.cs | 170 +++++++++++------- Adyen.Test/Core/Converters/ByteArrayTest.cs | 114 ++++++++++++ Adyen/Core/Converters/ByteArrayConverter.cs | 29 +++ Adyen/Util/ByteArrayConverter.cs | 33 ++-- Adyen/Util/JsonOperation.cs | 4 +- .../generichost/HostConfiguration.mustache | 2 + 7 files changed, 268 insertions(+), 87 deletions(-) create mode 100644 Adyen.Test/Core/Converters/ByteArrayTest.cs create mode 100644 Adyen/Core/Converters/ByteArrayConverter.cs diff --git a/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs b/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs index 54ddbfbca..68fbeb7ef 100644 --- a/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs +++ b/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs @@ -57,8 +57,8 @@ public void Given_TransactionRule_Serialize_Correctly() // Assert JsonDocument jsonDoc = JsonDocument.Parse(result); - JsonElement root = jsonDoc.RootElement; + Assert.AreEqual("Allow only point-of-sale transactions", root.GetProperty("description").GetString()); Assert.AreEqual("YOUR_REFERENCE_4F7346", root.GetProperty("reference").GetString()); @@ -75,7 +75,6 @@ public void Given_TransactionRule_Serialize_Correctly() JsonElement.ArrayEnumerator values = processingTypes.GetProperty("value").EnumerateArray(); Assert.IsTrue(values.Any(v => v.GetString() == "pos") && values.Any(v => v.GetString() == "ecommerce")); - Assert.AreEqual("blockList", root.GetProperty("type").GetString()); } diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index 95216880b..4a581b0c0 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -1,4 +1,5 @@ using System.Text; +using System.Text.Json; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; @@ -14,10 +15,12 @@ namespace Adyen.Test.Checkout [TestClass] public class PaymentsServiceTest { - [TestMethod] - public async Task Given_PaymentMethodsResponse_When_Deserialized_Then_Result_Is_Not_Null() + private readonly IHost _hostTestEnv; + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public PaymentsServiceTest() { - IHost testHost = Host.CreateDefaultBuilder() + _hostTestEnv = Host.CreateDefaultBuilder() .ConfigureCheckout((context, services, config) => { config.ConfigureAdyenOptions(options => @@ -27,7 +30,13 @@ public async Task Given_PaymentMethodsResponse_When_Deserialized_Then_Result_Is_ }) .Build(); - var jsonSerializerOptionsProvider = testHost.Services.GetRequiredService(); + _jsonSerializerOptionsProvider = _hostTestEnv.Services.GetRequiredService(); + } + + [TestMethod] + public async Task Given_PaymentMethodsResponse_When_Deserialized_Then_Result_Is_Not_Null() + { + // Arrange string json = @" { ""paymentMethods"": [ @@ -183,7 +192,7 @@ public async Task Given_PaymentMethodsResponse_When_Deserialized_Then_Result_Is_ "; // Act - var result = JsonSerializer.Deserialize(json, jsonSerializerOptionsProvider.Options); + PaymentMethodsResponse result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); // Assert Assert.IsNotNull(result.PaymentMethods); @@ -191,6 +200,92 @@ public async Task Given_PaymentMethodsResponse_When_Deserialized_Then_Result_Is_ Assert.AreEqual(29, result.PaymentMethods.Count); } + [TestMethod] + public void Given_CreateCheckoutSessionRequest_When_Serialize_Result_Contains_Zeros() + { + // Arrange + CreateCheckoutSessionRequest checkoutSessionRequest = new CreateCheckoutSessionRequest( + amount: new Amount("EUR", 10000L), + merchantAccount: "merchantAccount", + reference: "TestReference", + returnUrl: "http://test-url.com", + channel: CreateCheckoutSessionRequest.ChannelEnum.Web, + countryCode: "NL", + lineItems: new List() { + new LineItem(quantity: 1, amountIncludingTax: 5000, description: "description1", amountExcludingTax: 0), + new LineItem(quantity: 1, amountIncludingTax: 5000, description: "description2", taxAmount: 0) + } + ); + + // Act + string result = JsonSerializer.Serialize(checkoutSessionRequest, _jsonSerializerOptionsProvider.Options); + + // Assert that long parameters set to zero are actually serialised (just like Int) + + using JsonDocument json = JsonDocument.Parse(result); + JsonElement lineItems = json.RootElement.GetProperty("lineItems"); + + lineItems[0].TryGetProperty("amountExcludingTax", out JsonElement amountExcludingTaxProp); + lineItems[1].TryGetProperty("taxAmount", out JsonElement taxAmountProp); + + Assert.AreEqual(0, amountExcludingTaxProp.GetInt32()); + Assert.AreEqual(0, taxAmountProp.GetInt32()); + } + + [TestMethod] + public void Given_CreateCheckoutSessionResponse_When_Deserialize_Returns_Not_Null() + { + // Arrange + string json = @"{""mode"": ""embedded"",""amount"": {""currency"": ""EUR"",""value"": 10000},""expiresAt"": ""2023-04-06T17:11:15+02:00"",""id"": ""CS0068299CB8DA273A"",""merchantAccount"": ""TestMerchantAccount"",""reference"": ""TestReference"",""returnUrl"": ""http://test-url.com"",""sessionData"": ""Ab02b4c0!BQABAgBoacRJuRbNM/typUKATopkZ3V+cINm0WTAvwl9uQJ2e8I00P2KFemlwp4nb1bOqqYh1zx48gDAHt0QDs2JTiQIqDQRizqopLFRk/wAJHFoCuam/GvOHflg9vwS3caHbkBToIolxcYcJoJheIN9o1fGmNIHZb9VrWfiKsXMgmYsSUifenayS2tkKCTquF7vguaAwk7q5ES1GDwzP/J2mChJGH04jGrVL4szPHGmznr897wIcFQyBSZe4Uifqoe0fpiIxZLNWadLMya6SnvQYNAQL1V6ti+7F4wHHyLwHWTCua993sttue70TE4918EV80HcAWx0LE1+uW6J5KBHCKdYNi9ESlGSZreRwLCpdNbmumB6MlyHZlz2umLiw0ZZJAEpdrwXA2NiyHzJDKDKfbAhd8uoTSACrbgwbrAXI1cvb1WjiOQjLn9MVW++fuJCq6vIeX+rUKMeltBAHMeBZyC54ndAucw9nS03uyckjphunE4tl4WTT475VkfUiyJCTT3S2IOVYS9V9M8pMQ1/GlDVNCLBJJfrYlVXoC8VX68QW1HERkhNYQbTgLQ9kI3cDeMP5d4TuUL3XR2Q6sNiOMdIPGDYQ9QFKFdOE3OQ5X9wxUYbX6j88wR2gRGJcS5agqFHOR1ZTNrjumOYrEkjL8ehFXEs/KluhURllfi0POUPGAwlUWBjDCZcKaeeR0kASnsia2V5IjoiQUYwQUFBMTAzQ0E1MzdFQUVEODdDMjRERDUzOTA5QjgwQTc4QTkyM0UzODIzRDY4REFDQzk0QjlGRjgzMDVEQyJ9E0Gs1T0RaO7NluuXP59fegcW6SQKq4BhC3ZzEKPm1vJuwAJ2gZUaicaXbRPW3IyadavKRlfGdFeAYt2B3ik8fGiK3ZkKU0CrZ0qL0IO5rrWrOg74HMnpxRAn1RhAHRHfGEk67FFPNjr0aLBJXSia7xZWiyKA+i4QU63roY2sxMI/q41mvJjRUz0rPKT3SbVDt1Of7K7BP8cmiboBkWexFBD/mkJyMOpYAOoFp/tKOUHTWZYcc1GpbyV1jInXVfEUhHROYCtS4p/xwF6DdT3bI0+HRU35/xNBTZH2yJN55u9i42Vb0ddCyhzOLZYQ3JVgglty6hLgVeQzuN4b2MoalhfTl11HsElJT1kB0mznVX8CL7UMTUp/2uSgL8DN6kB4owEZ45nWRxIR/2sCidMJ1tnSI1uSqkeqXRf1vat5qPq+BzpYE0Urn2ZZEmgJyb2u0ZLn2x1tfJyPtv+hqBoT7iqJ224dSbuB4HMT49YtcheUtR0jnrImJXm+M1TeIjWB3XWOScrNV8sWEJMAiIU="",""shopperLocale"": ""en-US""}"; + + // Act + CreateCheckoutSessionResponse response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNotNull(response.Id); + } + + + [TestMethod] + public void Given_Byte_Array_When_Serialize_Returns_Not_Null() + { + // Arrange + byte[] plainTextBytes = Encoding.ASCII.GetBytes("Bytes-To-Be-Encoded"); + string base64String = System.Convert.ToBase64String(plainTextBytes); + byte[] base64Bytes = Encoding.ASCII.GetBytes(base64String); + var threeDSecure = new ThreeDSecureData + { + Cavv = base64Bytes, + Xid = base64Bytes + }; + + // Act + string jsonRequest = JsonSerializer.Serialize(threeDSecure, _jsonSerializerOptionsProvider.Options); + + // Assert + string json = "{\"cavv\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\",\"xid\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\"}"; + Assert.AreEqual(json, jsonRequest); + } + + [TestMethod] + public void Given_Byte_Array_When_Deserialize_Result_ThreeDSecureData_Should_Deserialize_Correctly() + { + // Arrange + string json = "{\"cavv\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\",\"xid\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\"}"; + + // Act + ThreeDSecureData jsonRequest = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + string xid = Encoding.ASCII.GetString(jsonRequest.Xid); + string cavv = Encoding.ASCII.GetString(jsonRequest.Cavv); + string jsonElementBase64 = "Qnl0ZXMtVG8tQmUtRW5jb2RlZA=="; + Assert.AreEqual(jsonElementBase64, xid); + Assert.AreEqual(jsonElementBase64, cavv); + } + + #region Tests Live URL and LiveUrlPrefix + [TestMethod] public async Task Given_ConfigureCheckout_When_Environment_Is_Live_Then_HttpClient_BaseUrl_Is_Correct() { @@ -207,7 +302,7 @@ public async Task Given_ConfigureCheckout_When_Environment_Is_Live_Then_HttpClie .Build(); // Act - var paymentsApiService = liveHost.Services.GetRequiredService(); + IPaymentsService paymentsApiService = liveHost.Services.GetRequiredService(); string baseAddress = paymentsApiService.HttpClient.BaseAddress!.ToString(); // Assert @@ -230,7 +325,7 @@ public async Task Given_ConfigureCheckout_When_Environment_Is_Test_And_Prefix_Gi .Build(); // Act - var paymentsApiService = testHost.Services.GetRequiredService(); + IPaymentsService paymentsApiService = testHost.Services.GetRequiredService(); string baseAddress = paymentsApiService.HttpClient.BaseAddress!.ToString(); // Assert @@ -257,65 +352,6 @@ public async Task Given_ConfigureCheckout_When_No_Options_Provided_Then_HttpClie testHost.Services.GetRequiredService(); }); } - - // [TestMethod] - // public void Given_CreateCheckoutSessionRequest_When_Serialize_Result_Contains_Zeros() - // { - // var checkoutSessionRequest = new CreateCheckoutSessionRequest( - // amount: new Amount("EUR", 10000L), - // merchantAccount: "merchantAccount", - // reference: "TestReference", - // returnUrl: "http://test-url.com", - // channel: CreateCheckoutSessionRequest.ChannelEnum.Web, - // countryCode: "NL", - // lineItems: new List() { - // new LineItem(quantity: 1, amountIncludingTax: 5000, description: "description1", amountExcludingTax: 0), - // new LineItem(quantity: 1, amountIncludingTax: 5000, description: "description2", taxAmount: 0) - // } - // ); - // string result = JsonSerializer.Serialize(checkoutSessionRequest); - // - // // Assert that Long parameters set to zero are actually serialised (just like Int) - // Assert.IsTrue(result.Contains("amountExcludingTax\": 0,")); - // Assert.IsTrue(result.Contains("taxAmount\": 0")); - // } - - // [TestMethod] - // public void Given_CreateCheckoutSessionResponse_When_Deserialize_Returns_Correctly() - // { - // string json = @"{""mode"": ""embedded"",""amount"": {""currency"": ""EUR"",""value"": 10000},""expiresAt"": ""2023-04-06T17:11:15+02:00"",""id"": ""CS0068299CB8DA273A"",""merchantAccount"": ""TestMerchantAccount"",""reference"": ""TestReference"",""returnUrl"": ""http://test-url.com"",""sessionData"": ""Ab02b4c0!BQABAgBoacRJuRbNM/typUKATopkZ3V+cINm0WTAvwl9uQJ2e8I00P2KFemlwp4nb1bOqqYh1zx48gDAHt0QDs2JTiQIqDQRizqopLFRk/wAJHFoCuam/GvOHflg9vwS3caHbkBToIolxcYcJoJheIN9o1fGmNIHZb9VrWfiKsXMgmYsSUifenayS2tkKCTquF7vguaAwk7q5ES1GDwzP/J2mChJGH04jGrVL4szPHGmznr897wIcFQyBSZe4Uifqoe0fpiIxZLNWadLMya6SnvQYNAQL1V6ti+7F4wHHyLwHWTCua993sttue70TE4918EV80HcAWx0LE1+uW6J5KBHCKdYNi9ESlGSZreRwLCpdNbmumB6MlyHZlz2umLiw0ZZJAEpdrwXA2NiyHzJDKDKfbAhd8uoTSACrbgwbrAXI1cvb1WjiOQjLn9MVW++fuJCq6vIeX+rUKMeltBAHMeBZyC54ndAucw9nS03uyckjphunE4tl4WTT475VkfUiyJCTT3S2IOVYS9V9M8pMQ1/GlDVNCLBJJfrYlVXoC8VX68QW1HERkhNYQbTgLQ9kI3cDeMP5d4TuUL3XR2Q6sNiOMdIPGDYQ9QFKFdOE3OQ5X9wxUYbX6j88wR2gRGJcS5agqFHOR1ZTNrjumOYrEkjL8ehFXEs/KluhURllfi0POUPGAwlUWBjDCZcKaeeR0kASnsia2V5IjoiQUYwQUFBMTAzQ0E1MzdFQUVEODdDMjRERDUzOTA5QjgwQTc4QTkyM0UzODIzRDY4REFDQzk0QjlGRjgzMDVEQyJ9E0Gs1T0RaO7NluuXP59fegcW6SQKq4BhC3ZzEKPm1vJuwAJ2gZUaicaXbRPW3IyadavKRlfGdFeAYt2B3ik8fGiK3ZkKU0CrZ0qL0IO5rrWrOg74HMnpxRAn1RhAHRHfGEk67FFPNjr0aLBJXSia7xZWiyKA+i4QU63roY2sxMI/q41mvJjRUz0rPKT3SbVDt1Of7K7BP8cmiboBkWexFBD/mkJyMOpYAOoFp/tKOUHTWZYcc1GpbyV1jInXVfEUhHROYCtS4p/xwF6DdT3bI0+HRU35/xNBTZH2yJN55u9i42Vb0ddCyhzOLZYQ3JVgglty6hLgVeQzuN4b2MoalhfTl11HsElJT1kB0mznVX8CL7UMTUp/2uSgL8DN6kB4owEZ45nWRxIR/2sCidMJ1tnSI1uSqkeqXRf1vat5qPq+BzpYE0Urn2ZZEmgJyb2u0ZLn2x1tfJyPtv+hqBoT7iqJ224dSbuB4HMT49YtcheUtR0jnrImJXm+M1TeIjWB3XWOScrNV8sWEJMAiIU="",""shopperLocale"": ""en-US""}"; - // - // var response = JsonConvert.DeserializeObject(json); - // Assert.IsNotNull(response.Id); - // } - - - // [TestMethod] - // public void SerializeByteArrayTest() - // { - // byte[] plainTextBytes = Encoding.ASCII.GetBytes("Bytes-To-Be-Encoded"); - // string base64String = System.Convert.ToBase64String(plainTextBytes); - // var base64Bytes = Encoding.ASCII.GetBytes(base64String); - // var threeDSecure = new ThreeDSecureData - // { - // Cavv = base64Bytes, - // Xid = base64Bytes - // }; - // string jsonRequest = Util.JsonOperation.SerializeRequest(threeDSecure); - // string json = "{\"cavv\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\",\"xid\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\"}"; - // Assert.AreEqual(json, jsonRequest); - // } - - // [TestMethod] - // public void DeserializeByteArrayTest() - // { - // string json = "{\"cavv\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\",\"xid\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\"}"; - // ThreeDSecureData jsonRequest = Util.JsonOperation.Deserialize(json); - // string xid = Encoding.ASCII.GetString(jsonRequest.Xid); - // string cavv = Encoding.ASCII.GetString(jsonRequest.Cavv); - // string jsonElementBase64 = "Qnl0ZXMtVG8tQmUtRW5jb2RlZA=="; - // Assert.AreEqual(jsonElementBase64, xid); - // Assert.AreEqual(jsonElementBase64, cavv); - // } + #endregion } } \ No newline at end of file diff --git a/Adyen.Test/Core/Converters/ByteArrayTest.cs b/Adyen.Test/Core/Converters/ByteArrayTest.cs new file mode 100644 index 000000000..542775b8e --- /dev/null +++ b/Adyen.Test/Core/Converters/ByteArrayTest.cs @@ -0,0 +1,114 @@ +using System.Text; +using System.Text.Json; +using Adyen.Core.Converters; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.Core.Converters +{ + [TestClass] + public class ByteArrayTest + { + private readonly ByteArrayConverter _converter = new ByteArrayConverter(); + + [TestMethod] + public void Given_ByteArray_When_Write_Then_Result_Should_Write_UTF8_String() + { + // Arrange + byte[] bytes = Encoding.UTF8.GetBytes("adyen"); + using var stream = new MemoryStream(); + using var writer = new Utf8JsonWriter(stream); + + // Act + _converter.Write(writer, bytes, new JsonSerializerOptions()); + writer.Flush(); + string target = Encoding.UTF8.GetString(stream.ToArray()); + + // Assert + Assert.AreEqual("\"adyen\"", target); + } + + [TestMethod] + public void Given_ByteArray_Null_When_Write_Then_Result_Returns_Null() + { + // Arrange + using var stream = new MemoryStream(); + using var writer = new Utf8JsonWriter(stream); + + // Act + _converter.Write(writer, null, new JsonSerializerOptions()); + writer.Flush(); + string json = Encoding.UTF8.GetString(stream.ToArray()); + + // Assert + Assert.AreEqual("null", json); + } + + [TestMethod] + public void Given_Json_When_Read_And_Decoded_Then_Should_Return_ByteArray() + { + // Arrange + string json = "\"adyen\""; + var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); + reader.Read(); + + // Act + byte[] result = _converter.Read(ref reader, typeof(byte[]), new JsonSerializerOptions()); + string decoded = Encoding.UTF8.GetString(result); + + // Assert + Assert.AreEqual("adyen", decoded); + } + + [TestMethod] + public void Given_Json_Null_When_Read_Then_Returns_Null() + { + // Arrange + string json = "null"; + var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); + reader.Read(); + + // Act + byte[] result = _converter.Read(ref reader, typeof(byte[]), new JsonSerializerOptions()); + + // Assert + Assert.IsNull(result); + } + + [TestMethod] + public void Given_ByteArray_When_Write_And_Read_Then_Result_Returns_Original_Bytes() + { + // Arrange + byte[] original = Encoding.UTF8.GetBytes("adyen"); + using var stream = new MemoryStream(); + using var writer = new Utf8JsonWriter(stream); + + _converter.Write(writer, original, new JsonSerializerOptions()); + writer.Flush(); + string json = Encoding.UTF8.GetString(stream.ToArray()); + + var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); + reader.Read(); + + // Act + byte[] result = _converter.Read(ref reader, typeof(byte[]), new JsonSerializerOptions()); + + // Assert + CollectionAssert.AreEqual(original, result); + } + + [TestMethod] + public void Given_EmptyString_When_Read_Then_ShouldReturnEmptyByteArray() + { + // Arrange + string json = "\"\""; + Utf8JsonReader reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(json)); + reader.Read(); + + // Act + byte[] result = _converter.Read(ref reader, typeof(byte[]), new JsonSerializerOptions()); + + // Assert + Assert.AreEqual(Array.Empty(), result); + } + } +} \ No newline at end of file diff --git a/Adyen/Core/Converters/ByteArrayConverter.cs b/Adyen/Core/Converters/ByteArrayConverter.cs new file mode 100644 index 000000000..e222288a8 --- /dev/null +++ b/Adyen/Core/Converters/ByteArrayConverter.cs @@ -0,0 +1,29 @@ +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Adyen.Core.Converters +{ + public class ByteArrayConverter : JsonConverter + { + public override byte[] Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + return Encoding.UTF8.GetBytes(value); + } + + public override void Write(Utf8JsonWriter writer, byte[] value, JsonSerializerOptions options) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStringValue(Encoding.UTF8.GetString(value)); + } + } +} \ No newline at end of file diff --git a/Adyen/Util/ByteArrayConverter.cs b/Adyen/Util/ByteArrayConverter.cs index e10849389..0f031b907 100644 --- a/Adyen/Util/ByteArrayConverter.cs +++ b/Adyen/Util/ByteArrayConverter.cs @@ -1,28 +1,29 @@ -using System; -using System.Text; -using Newtonsoft.Json; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; namespace Adyen.Util { - internal class ByteArrayConverter : JsonConverter + internal class ByteArrayConverter : JsonConverter { - public override bool CanConvert(Type objectType) + public override byte[] Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - return objectType == typeof(byte[]); - } - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - if (reader.TokenType == JsonToken.Null) + if (reader.TokenType == JsonTokenType.Null) return null; - return Encoding.UTF8.GetBytes((string)reader.Value); + + string value = reader.GetString(); + return Encoding.UTF8.GetBytes(value); } - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + public override void Write(Utf8JsonWriter writer, byte[] value, JsonSerializerOptions options) { - byte[] bytes = (byte[])value; - writer.WriteValue(Encoding.UTF8.GetString(bytes)); + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStringValue(Encoding.UTF8.GetString(value)); } - } } \ No newline at end of file diff --git a/Adyen/Util/JsonOperation.cs b/Adyen/Util/JsonOperation.cs index 4cefb5981..6e1777c5d 100644 --- a/Adyen/Util/JsonOperation.cs +++ b/Adyen/Util/JsonOperation.cs @@ -13,7 +13,7 @@ public class JsonOperation public static T Deserialize(string response) { var jsonSettings = new JsonSerializerSettings(); - jsonSettings.Converters.Add(new ByteArrayConverter()); + //jsonSettings.Converters.Add(new ByteArrayConverter()); return JsonConvert.DeserializeObject(response, jsonSettings); } @@ -25,7 +25,7 @@ public static string SerializeRequest(object request) NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Include, }; - jsonSettings.Converters.Add(new ByteArrayConverter()); + //jsonSettings.Converters.Add(new ByteArrayConverter()); return JsonConvert.SerializeObject(request, Formatting.None, jsonSettings); } } diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index e4bdacd30..c7e8b070f 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -55,6 +55,8 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} _jsonOptions.Converters.Add(new DateTimeJsonConverter()); if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateTimeNullableJsonConverter)) == null) _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(ByteArrayConverter)) == null) + _jsonOptions.Converters.Add(new ByteArrayConverter()); {{#supportsDateOnly}} if (_jsonOptions.Converters.FirstOrDefault(x => x.GetType() == typeof(DateOnlyJsonConverter)) == null) _jsonOptions.Converters.Add(new DateOnlyJsonConverter()); From 622e81d6a1278ebad9849abc7cc3fce8f5d685bb Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 29 Oct 2025 20:55:22 +0100 Subject: [PATCH 081/126] Add tests for IEnum serialization/deserialization --- Adyen.Test/Core/IEnumTest.cs | 59 ++++++++++++++++++++++---------- Adyen/Adyen.csproj | 1 + Adyen/Util/ByteArrayConverter.cs | 33 +++++++++--------- Adyen/Util/JsonOperation.cs | 4 +-- 4 files changed, 59 insertions(+), 38 deletions(-) diff --git a/Adyen.Test/Core/IEnumTest.cs b/Adyen.Test/Core/IEnumTest.cs index 84957e3a7..a7c505a30 100644 --- a/Adyen.Test/Core/IEnumTest.cs +++ b/Adyen.Test/Core/IEnumTest.cs @@ -10,11 +10,32 @@ public class IEnumTest [TestClass] public class IEnumTestTests { + [TestMethod] + public void Given_Enums_When_Equal_Returns_Correct_True() + { + ExampleEnum? nullEnum = null; + + Assert.AreEqual(nullEnum, nullEnum); + Assert.AreEqual(ExampleEnum.A, ExampleEnum.A); + Assert.AreEqual(ExampleEnum.B, ExampleEnum.B); + } + + [TestMethod] + public void Given_Enums_When_NotEqual_Returns_Correct_False() + { + ExampleEnum? nullEnum = null; + + Assert.AreNotEqual(ExampleEnum.A, ExampleEnum.B); + Assert.AreNotEqual(ExampleEnum.B, nullEnum); + Assert.AreNotEqual(ExampleEnum.A, nullEnum); + } + [TestMethod] public void Given_ImplicitConversion_When_Initialized_Then_Returns_Correct_Values() { ExampleEnum? resultA = "a"; ExampleEnum? resultB = "b"; + Assert.AreEqual(ExampleEnum.A, resultA); Assert.AreEqual(ExampleEnum.B, resultB); } @@ -24,6 +45,7 @@ public void Given_ImplicitConversion_When_Null_Then_Returns_Null() { ExampleEnum? input = null; string? result = input; + Assert.IsNull(result); } @@ -37,31 +59,30 @@ public void Given_ToString_When_Called_Then_Returns_Correct_Value() [TestMethod] public void Given_ToString_When_Null_Then_Returns_Empty_String() { - ExampleEnum result = new ExampleEnum(null); - Assert.AreEqual(string.Empty, result.ToString()); + ExampleEnum result = ExampleEnum.FromStringOrDefault("this-is-not-a-valid-enum"); + + Assert.IsNull(result); } [TestMethod] public void Given_Equals_When_ComparingCaseInsensitive_Then_Returns_True() { - ExampleEnum result = new ExampleEnum("A"); + ExampleEnum result = ExampleEnum.A; + Assert.IsTrue(result.Equals(ExampleEnum.A)); Assert.IsFalse(result.Equals(ExampleEnum.B)); } [TestMethod] - public void Given_GetHashCode_When_Set_Then_Result_Matches_HashCodes() + public void Given_FromStringOrDefault_When_InvalidString_Then_Returns_Null() { - ExampleEnum result = new ExampleEnum("a"); - Assert.AreEqual("a".GetHashCode(), result.GetHashCode()); - ExampleEnum nullEnum = new ExampleEnum(null); - Assert.AreEqual(0, nullEnum.GetHashCode()); + Assert.IsNull(ExampleEnum.FromStringOrDefault("this-is-not-a-valid-enum")); } [TestMethod] public void Given_EqualityOperator_When_ComparingValues_Then_Returns_Correct_Values() { - ExampleEnum target = new ExampleEnum("a"); + ExampleEnum target = ExampleEnum.A; ExampleEnum otherA = ExampleEnum.A; ExampleEnum otherB = ExampleEnum.B; @@ -78,12 +99,7 @@ public void Given_FromStringOrDefault_When_ValidStrings_Then_Returns_Correct_Enu Assert.AreEqual(ExampleEnum.B, ExampleEnum.FromStringOrDefault("b")); } - [TestMethod] - public void Given_FromStringOrDefault_When_InvalidString_Then_Returns_Null() - { - Assert.IsNull(ExampleEnum.FromStringOrDefault("c")); - } - + #region ToJsonValue [TestMethod] public void Given_ToJsonValue_When_KnownEnum_Then_Returns_String() { @@ -100,10 +116,13 @@ public void Given_ToJsonValue_When_Null_Then_Returns_Null() [TestMethod] public void Given_ToJsonValue_When_CustomEnum_Then_Returns_Null() { - var custom = new ExampleEnum("custom"); + ExampleEnum custom = ExampleEnum.FromStringOrDefault("this-is-not-a-valid-enum"); Assert.IsNull(ExampleEnum.ToJsonValue(custom)); } - + #endregion + + + #region JsonSerialization and JsonDeserialization [TestMethod] public void Given_JsonSerialization_When_KnownEnum_Then_Serialize_and_Deserialize_Correctly() { @@ -129,7 +148,7 @@ public void Given_JsonSerialization_When_EnumNotInList_Then_Returns_Null() var options = new JsonSerializerOptions(); options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); - ExampleEnum? value = new ExampleEnum("not-in-list"); + ExampleEnum? value = ExampleEnum.FromStringOrDefault("not-in-list"); string serialized = JsonSerializer.Serialize(value, options); Assert.AreEqual("null", serialized); @@ -150,6 +169,8 @@ public void Given_JsonSerialization_When_Null_Value_Then_Serialize_And_Deseriali ExampleEnum? deserialized = JsonSerializer.Deserialize("null", options); Assert.IsNull(deserialized); } + #endregion + } } @@ -168,7 +189,7 @@ internal class ExampleEnum : IEnum /// public static readonly ExampleEnum B = new("b"); - internal ExampleEnum(string? value) + private ExampleEnum(string? value) { Value = value; } diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index f7f7a4088..9d617273d 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -58,6 +58,7 @@ + diff --git a/Adyen/Util/ByteArrayConverter.cs b/Adyen/Util/ByteArrayConverter.cs index 0f031b907..e10849389 100644 --- a/Adyen/Util/ByteArrayConverter.cs +++ b/Adyen/Util/ByteArrayConverter.cs @@ -1,29 +1,28 @@ -using System.Text; -using System.Text.Json; -using System.Text.Json.Serialization; +using System; +using System.Text; +using Newtonsoft.Json; namespace Adyen.Util { - internal class ByteArrayConverter : JsonConverter + internal class ByteArrayConverter : JsonConverter { - public override byte[] Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override bool CanConvert(Type objectType) { - if (reader.TokenType == JsonTokenType.Null) - return null; - - string value = reader.GetString(); - return Encoding.UTF8.GetBytes(value); + return objectType == typeof(byte[]); } - public override void Write(Utf8JsonWriter writer, byte[] value, JsonSerializerOptions options) + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { - if (value == null) - { - writer.WriteNullValue(); - return; - } + if (reader.TokenType == JsonToken.Null) + return null; + return Encoding.UTF8.GetBytes((string)reader.Value); + } - writer.WriteStringValue(Encoding.UTF8.GetString(value)); + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + byte[] bytes = (byte[])value; + writer.WriteValue(Encoding.UTF8.GetString(bytes)); } + } } \ No newline at end of file diff --git a/Adyen/Util/JsonOperation.cs b/Adyen/Util/JsonOperation.cs index 6e1777c5d..4cefb5981 100644 --- a/Adyen/Util/JsonOperation.cs +++ b/Adyen/Util/JsonOperation.cs @@ -13,7 +13,7 @@ public class JsonOperation public static T Deserialize(string response) { var jsonSettings = new JsonSerializerSettings(); - //jsonSettings.Converters.Add(new ByteArrayConverter()); + jsonSettings.Converters.Add(new ByteArrayConverter()); return JsonConvert.DeserializeObject(response, jsonSettings); } @@ -25,7 +25,7 @@ public static string SerializeRequest(object request) NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Include, }; - //jsonSettings.Converters.Add(new ByteArrayConverter()); + jsonSettings.Converters.Add(new ByteArrayConverter()); return JsonConvert.SerializeObject(request, Formatting.None, jsonSettings); } } From bba3bb462eb42957fb31cc3e38e6bc2c2c5562f8 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 29 Oct 2025 21:20:06 +0100 Subject: [PATCH 082/126] Add tests for IEnum serialization/deserialization Remove WebhookHandlers Move JsonOperations utility function --- Adyen.Test/BinLookupTest.cs | 7 +- Adyen.Test/CheckoutTest.cs | 2 +- Adyen.Test/UtilTest.cs | 424 +++---- .../BalancePlatformWebhookHandlerTest.cs | 1102 ++++++++--------- .../ManagementWebhookHandlerTest.cs | 248 ++-- .../WebhooksTests/WebhookHandlerTest.cs | 346 +++--- Adyen/Adyen.csproj | 1 - Adyen/Util/ByteArrayConverter.cs | 22 +- Adyen/Util/JsonOperation.cs | 34 +- .../BalancePlatformWebhookHandler.cs | 243 ---- .../ClassicPlatformWebhookHandler.cs | 386 ------ .../ManagementWebhookHandler.cs | 147 --- Adyen/WebhookHandlers/WebhookHandler.cs | 13 - .../Webhooks/BalancePlatformWebhookHandler.cs | 243 ++++ .../Webhooks/ClassicPlatformWebhookHandler.cs | 386 ++++++ .../HmacValidatorUtility.cs} | 53 +- Adyen/Webhooks/ManagementWebhookHandler.cs | 147 +++ Adyen/Webhooks/Models/Amount.cs | 29 + .../Models/NotificationRequest.cs | 10 +- .../Models/NotificationRequestConstants.cs} | 4 +- .../Models/NotificationRequestItem.cs | 3 +- .../NotificationRequestItemContainer.cs | 3 +- Adyen/Webhooks/WebhookHandler.cs | 45 + 23 files changed, 1974 insertions(+), 1924 deletions(-) delete mode 100644 Adyen/WebhookHandlers/BalancePlatformWebhookHandler.cs delete mode 100644 Adyen/WebhookHandlers/ClassicPlatformWebhookHandler.cs delete mode 100644 Adyen/WebhookHandlers/ManagementWebhookHandler.cs delete mode 100644 Adyen/WebhookHandlers/WebhookHandler.cs create mode 100644 Adyen/Webhooks/BalancePlatformWebhookHandler.cs create mode 100644 Adyen/Webhooks/ClassicPlatformWebhookHandler.cs rename Adyen/{Util/HMACValidator.cs => Webhooks/HmacValidatorUtility.cs} (65%) create mode 100644 Adyen/Webhooks/ManagementWebhookHandler.cs create mode 100644 Adyen/Webhooks/Models/Amount.cs rename Adyen/{WebhookHandlers => Webhooks}/Models/NotificationRequest.cs (86%) rename Adyen/{WebhookHandlers/Models/NotificationRequestConst.cs => Webhooks/Models/NotificationRequestConstants.cs} (97%) rename Adyen/{WebhookHandlers => Webhooks}/Models/NotificationRequestItem.cs (96%) rename Adyen/{WebhookHandlers => Webhooks}/Models/NotificationRequestItemContainer.cs (97%) create mode 100644 Adyen/Webhooks/WebhookHandler.cs diff --git a/Adyen.Test/BinLookupTest.cs b/Adyen.Test/BinLookupTest.cs index 59d8e4bc8..fe872f055 100644 --- a/Adyen.Test/BinLookupTest.cs +++ b/Adyen.Test/BinLookupTest.cs @@ -2,6 +2,7 @@ using Adyen.Model.BinLookup; using Adyen.Service; using Microsoft.VisualStudio.TestTools.UnitTesting; +using Newtonsoft.Json; namespace Adyen.Test { @@ -65,9 +66,9 @@ public void GetCostEstimateSuccessMockedTest() [TestMethod] public void GetCostEstimateSuccessGenerateShopperInteractionFromEnum() { - var ecommerce = Util.JsonOperation.SerializeRequest(CostEstimateRequest.ShopperInteractionEnum.Ecommerce); - var contAuth = Util.JsonOperation.SerializeRequest(CostEstimateRequest.ShopperInteractionEnum.ContAuth); - var moto = Util.JsonOperation.SerializeRequest(CostEstimateRequest.ShopperInteractionEnum.Moto); + var ecommerce = JsonConvert.SerializeObject(CostEstimateRequest.ShopperInteractionEnum.Ecommerce); + var contAuth = JsonConvert.SerializeObject(CostEstimateRequest.ShopperInteractionEnum.ContAuth); + var moto = JsonConvert.SerializeObject(CostEstimateRequest.ShopperInteractionEnum.Moto); Assert.AreEqual("\"Ecommerce\"", ecommerce); Assert.AreEqual("\"ContAuth\"", contAuth); Assert.AreEqual("\"Moto\"", moto); diff --git a/Adyen.Test/CheckoutTest.cs b/Adyen.Test/CheckoutTest.cs index 7a2be36af..9c2f66191 100644 --- a/Adyen.Test/CheckoutTest.cs +++ b/Adyen.Test/CheckoutTest.cs @@ -589,7 +589,7 @@ public void DragonpayDetailsDeserializationTest() { var json = "{\"issuer\":\"issuer\",\"shopperEmail\":\"test@test.com\",\"type\":\"dragonpay_ebanking\"}"; - var result = Util.JsonOperation.Deserialize(json); + var result = JsonConvert.DeserializeObject(json); Assert.IsInstanceOfType(result); Assert.AreEqual(result.Type, DragonpayDetails.TypeEnum.Ebanking); } diff --git a/Adyen.Test/UtilTest.cs b/Adyen.Test/UtilTest.cs index 8bea2e2cb..9384873d3 100644 --- a/Adyen.Test/UtilTest.cs +++ b/Adyen.Test/UtilTest.cs @@ -1,212 +1,212 @@ -using System.Collections.Generic; -using Adyen.Model.Notification; -using Adyen.Model.Payment; -using Adyen.Util; -using Adyen.Util.TerminalApi; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Newtonsoft.Json; - -namespace Adyen.Test -{ - [TestClass] - public class UtilTest : BaseTest - { - [TestMethod] - public void TestHmac() - { - var data = "countryCode:currencyCode:merchantAccount:merchantReference:paymentAmount:sessionValidity:skinCode:NL:EUR:MagentoMerchantTest2:TEST-PAYMENT-2017-02-01-14\\:02\\:05:199:2017-02-02T14\\:02\\:05+01\\:00:PKz2KML1"; - var hmacKey = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00"; - var hmacValidator = new HmacValidator(); - var hmacSignature = hmacValidator.CalculateHmac(data, hmacKey); - Assert.IsTrue(string.Equals(hmacSignature, "34oR8T1whkQWTv9P+SzKyp8zhusf9n0dpqrm9nsqSJs=")); - } - - [TestMethod] - public void TestBalancePlatformHmac() - { - var notification = - "{\"data\":{\"balancePlatform\":\"Integration_tools_test\",\"accountId\":\"BA32272223222H5HVKTBK4MLB\",\"sweep\":{\"id\":\"SWPC42272223222H5HVKV6H8C64DP5\",\"schedule\":{\"type\":\"balance\"},\"status\":\"active\",\"targetAmount\":{\"currency\":\"EUR\",\"value\":0},\"triggerAmount\":{\"currency\":\"EUR\",\"value\":0},\"type\":\"pull\",\"counterparty\":{\"balanceAccountId\":\"BA3227C223222H5HVKT3H9WLC\"},\"currency\":\"EUR\"}},\"environment\":\"test\",\"type\":\"balancePlatform.balanceAccountSweep.updated\"}"; - var hmacKey = "D7DD5BA6146493707BF0BE7496F6404EC7A63616B7158EC927B9F54BB436765F"; - var hmacSignature = "9Qz9S/0xpar1klkniKdshxpAhRKbiSAewPpWoxKefQA="; - var hmacValidator = new HmacValidator(); - bool response = hmacValidator.IsValidWebhook(hmacSignature, hmacKey, notification); - Assert.IsTrue(response); - } - - [TestMethod] - public void TestSerializationShopperInteractionDefaultIsZero() - { - var paymentRequest = MockPaymentData.CreateFullPaymentRequestWithShopperInteraction(default); - var serializedPaymentRequest = paymentRequest.ToJson(); - Assert.IsTrue(serializedPaymentRequest.Contains("\"shopperInteraction\": 0,")); - } - - [TestMethod] - public void TestNotificationRequestItemHmac() - { - var hmacKey = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00"; - var expectedSign = "ipnxGCaUZ4l8TUW75a71/ghd2Fe5ffvX0pV4TLTntIc="; - var additionalData = new Dictionary - { - { "hmacSignature", expectedSign } - }; - var notificationRequestItem = new NotificationRequestItem - { - PspReference = "pspReference", - OriginalReference = "originalReference", - MerchantAccountCode = "merchantAccount", - MerchantReference = "reference", - Amount = new Model.Checkout.Amount("EUR", 1000), - EventCode = "EVENT", - Success = true, - AdditionalData = additionalData - }; - var hmacValidator = new HmacValidator(); - var data = hmacValidator.GetDataToSign(notificationRequestItem); - Assert.AreEqual("pspReference:originalReference:merchantAccount:reference:1000:EUR:EVENT:true", data); - var encrypted = hmacValidator.CalculateHmac(notificationRequestItem, hmacKey); - Assert.AreEqual(expectedSign, encrypted); - Assert.IsTrue(hmacValidator.IsValidHmac(notificationRequestItem, hmacKey)); - notificationRequestItem.AdditionalData["hmacSignature"] = "notValidSign"; - Assert.IsFalse(hmacValidator.IsValidHmac(notificationRequestItem, hmacKey)); - } - - [TestMethod] - public void TestHmacCalculationNotificationRequestWithSpecialChars() - { - string hmacKey = "66B61474A0AA3736BA8789EDC6D6CD9EBA0C4F414A554E32A407F849C045C69D"; - var mockPath = GetMockFilePath("mocks/notification-response-refund-fail.json"); - var response = MockFileToString(mockPath); - var hmacValidator = new HmacValidator(); - var notificationRequest = JsonOperation.Deserialize(response); - var notificationItem = notificationRequest.NotificationItemContainers[0].NotificationItem; - var isValidHmac = hmacValidator.IsValidHmac(notificationItem, hmacKey); - Assert.IsTrue(isValidHmac); - } - - [TestMethod] - public void TestSerializationShopperInteractionMoto() - { - var paymentRequest = MockPaymentData.CreateFullPaymentRequestWithShopperInteraction(PaymentRequest.ShopperInteractionEnum.Moto); - var serializedPaymentRequest = JsonOperation.SerializeRequest(paymentRequest); - StringAssert.Contains(serializedPaymentRequest, nameof(PaymentRequest.ShopperInteractionEnum.Moto)); - } - - [TestMethod] - public void TestNullHmacValidator() - { - var hmacValidator = new HmacValidator(); - var notificationRequestItem = new NotificationRequestItem - { - PspReference = "pspReference", - OriginalReference = "originalReference", - MerchantAccountCode = "merchantAccount", - MerchantReference = "reference", - Amount = new Model.Checkout.Amount("EUR", 1000), - EventCode = "EVENT", - Success = true, - AdditionalData = null - }; - var isValidHmacAdditionalDataNull = hmacValidator.IsValidHmac(notificationRequestItem, "hmacKey"); - Assert.IsFalse(isValidHmacAdditionalDataNull); - notificationRequestItem.AdditionalData = new Dictionary(); - var isValidHmacAdditionalDataEmpty = hmacValidator.IsValidHmac(notificationRequestItem, "hmacKey"); - Assert.IsFalse(isValidHmacAdditionalDataEmpty); - } - - [TestMethod] - public void TestColonAndBackslashHmacValidator() - { - var hmacValidator = new HmacValidator(); - var jsonNotification = @"{ - 'additionalData': { - 'acquirerCode': 'TestPmmAcquirer', - 'acquirerReference': 'J8DXDJ2PV6P', - 'authCode': '052095', - 'avsResult': '5 No AVS data provided', - 'avsResultRaw': '5', - 'cardSummary': '1111', - 'checkout.cardAddedBrand': 'visa', - 'cvcResult': '1 Matches', - 'cvcResultRaw': 'M', - 'expiryDate': '03/2030', - 'hmacSignature': 'CZErGCNQaSsxbaQfZaJlakqo7KPP+mIa8a+wx3yNs9A=', - 'paymentMethod': 'visa', - 'refusalReasonRaw': 'AUTHORISED', - 'retry.attempt1.acquirer': 'TestPmmAcquirer', - 'retry.attempt1.acquirerAccount': 'TestPmmAcquirerAccount', - 'retry.attempt1.avsResultRaw': '5', - 'retry.attempt1.rawResponse': 'AUTHORISED', - 'retry.attempt1.responseCode': 'Approved', - 'retry.attempt1.scaExemptionRequested': 'lowValue', - 'scaExemptionRequested': 'lowValue' - }, - 'amount': { - 'currency': 'EUR', - 'value': 1000 - }, - 'eventCode': 'AUTHORISATION', - 'eventDate': '2023-01-10T13:42:29+01:00', - 'merchantAccountCode': 'AntoniStroinski', - 'merchantReference': '\\:/\\/slashes are fun', - 'operations': [ - 'CANCEL', - 'CAPTURE', - 'REFUND' - ], - 'paymentMethod': 'visa', - 'pspReference': 'ZVWN7D3WSMK2WN82', - 'reason': '052095:1111:03/2030', - 'success': 'true' - }"; - var notificationRequestItem = JsonConvert.DeserializeObject(jsonNotification); - var isValidHmac = hmacValidator.IsValidHmac(notificationRequestItem, "74F490DD33F7327BAECC88B2947C011FC02D014A473AAA33A8EC93E4DC069174"); - Assert.IsTrue(isValidHmac); - } - - [TestMethod] - public void TestCardAcquisitionAdditionalResponse() - { - string jsonString = @"{ - ""additionalData"": { - ""PaymentAccountReference"": ""Yv6zs1234567890ASDFGHJKL"", - ""alias"": ""G12345678"", - ""aliasType"": ""Default"", - ""applicationLabel"": ""ASDFGHJKL"", - ""applicationPreferredName"": ""ASDFGHJKL"", - ""backendGiftcardIndicator"": ""false"", - ""cardBin"": ""4111111"", - ""cardHolderName"": ""John Smith"" - }, - ""message"": ""CARD_ACQ_COMPLETED"", - ""store"": ""NL"" - }"; - string responseBased64 = "ewoiYWRkaXRpb25hbERhdGEiOnsKICJQYXltZW50QWNjb3VudFJlZmVyZW5jZSI6Ill2NnpzMTIzNDU2Nzg5MEFTREZHSEpLTCIsCiJhbGlhcyI6IkcxMjM0NTY3OCIsCiJhbGlhc1R5cGUiOiJEZWZhdWx0IiwKImFwcGxpY2F0aW9uTGFiZWwiOiJBU0RGR0hKS0wiLAoiYXBwbGljYXRpb25QcmVmZXJyZWROYW1lIjoiQVNERkdISktMIiwKICJiYWNrZW5kR2lmdGNhcmRJbmRpY2F0b3IiOiJmYWxzZSIsCiJjYXJkQmluIjoiNDExMTExMSIsCiJjYXJkSG9sZGVyTmFtZSI6IkpvaG4gU21pdGgiCgp9LAoibWVzc2FnZSI6IkNBUkRfQUNRX0NPTVBMRVRFRCIsCiJzdG9yZSI6Ik5MIgp9"; - var additionalResponse = CardAcquisitionUtil.AdditionalResponse(responseBased64); - Assert.AreEqual(additionalResponse.Message,"CARD_ACQ_COMPLETED"); - Assert.AreEqual(additionalResponse.Store,"NL"); - Assert.AreEqual(additionalResponse.AdditionalData["PaymentAccountReference"],"Yv6zs1234567890ASDFGHJKL"); - Assert.AreEqual(additionalResponse.AdditionalData["alias"],"G12345678"); - Assert.AreEqual(additionalResponse.AdditionalData["aliasType"],"Default"); - Assert.AreEqual(additionalResponse.AdditionalData["applicationLabel"],"ASDFGHJKL"); - Assert.AreEqual(additionalResponse.AdditionalData["applicationPreferredName"],"ASDFGHJKL"); - Assert.AreEqual(additionalResponse.AdditionalData["backendGiftcardIndicator"],"false"); - Assert.AreEqual(additionalResponse.AdditionalData["cardHolderName"],"John Smith"); - Assert.AreEqual(additionalResponse.AdditionalData["cardBin"],"4111111"); - - var additionalResponseFromJson = CardAcquisitionUtil.AdditionalResponse(jsonString); - Assert.AreEqual(additionalResponseFromJson.Message,"CARD_ACQ_COMPLETED"); - Assert.AreEqual(additionalResponseFromJson.Store,"NL"); - Assert.AreEqual(additionalResponseFromJson.AdditionalData["PaymentAccountReference"],"Yv6zs1234567890ASDFGHJKL"); - Assert.AreEqual(additionalResponseFromJson.AdditionalData["alias"],"G12345678"); - Assert.AreEqual(additionalResponseFromJson.AdditionalData["aliasType"],"Default"); - Assert.AreEqual(additionalResponseFromJson.AdditionalData["applicationLabel"],"ASDFGHJKL"); - Assert.AreEqual(additionalResponseFromJson.AdditionalData["applicationPreferredName"],"ASDFGHJKL"); - Assert.AreEqual(additionalResponseFromJson.AdditionalData["backendGiftcardIndicator"],"false"); - Assert.AreEqual(additionalResponseFromJson.AdditionalData["cardHolderName"],"John Smith"); - Assert.AreEqual(additionalResponseFromJson.AdditionalData["cardBin"],"4111111"); - - } - - } -} +// using System.Collections.Generic; +// using Adyen.Model.Notification; +// using Adyen.Model.Payment; +// using Adyen.Util; +// using Adyen.Util.TerminalApi; +// using Microsoft.VisualStudio.TestTools.UnitTesting; +// using Newtonsoft.Json; +// +// namespace Adyen.Test +// { +// [TestClass] +// public class UtilTest : BaseTest +// { +// [TestMethod] +// public void TestHmac() +// { +// var data = "countryCode:currencyCode:merchantAccount:merchantReference:paymentAmount:sessionValidity:skinCode:NL:EUR:MagentoMerchantTest2:TEST-PAYMENT-2017-02-01-14\\:02\\:05:199:2017-02-02T14\\:02\\:05+01\\:00:PKz2KML1"; +// var hmacKey = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00"; +// var hmacValidator = new HmacValidator(); +// var hmacSignature = hmacValidator.CalculateHmac(data, hmacKey); +// Assert.IsTrue(string.Equals(hmacSignature, "34oR8T1whkQWTv9P+SzKyp8zhusf9n0dpqrm9nsqSJs=")); +// } +// +// [TestMethod] +// public void TestBalancePlatformHmac() +// { +// var notification = +// "{\"data\":{\"balancePlatform\":\"Integration_tools_test\",\"accountId\":\"BA32272223222H5HVKTBK4MLB\",\"sweep\":{\"id\":\"SWPC42272223222H5HVKV6H8C64DP5\",\"schedule\":{\"type\":\"balance\"},\"status\":\"active\",\"targetAmount\":{\"currency\":\"EUR\",\"value\":0},\"triggerAmount\":{\"currency\":\"EUR\",\"value\":0},\"type\":\"pull\",\"counterparty\":{\"balanceAccountId\":\"BA3227C223222H5HVKT3H9WLC\"},\"currency\":\"EUR\"}},\"environment\":\"test\",\"type\":\"balancePlatform.balanceAccountSweep.updated\"}"; +// var hmacKey = "D7DD5BA6146493707BF0BE7496F6404EC7A63616B7158EC927B9F54BB436765F"; +// var hmacSignature = "9Qz9S/0xpar1klkniKdshxpAhRKbiSAewPpWoxKefQA="; +// var hmacValidator = new HmacValidator(); +// bool response = hmacValidator.IsValidWebhook(hmacSignature, hmacKey, notification); +// Assert.IsTrue(response); +// } +// +// [TestMethod] +// public void TestSerializationShopperInteractionDefaultIsZero() +// { +// var paymentRequest = MockPaymentData.CreateFullPaymentRequestWithShopperInteraction(default); +// var serializedPaymentRequest = paymentRequest.ToJson(); +// Assert.IsTrue(serializedPaymentRequest.Contains("\"shopperInteraction\": 0,")); +// } +// +// [TestMethod] +// public void TestNotificationRequestItemHmac() +// { +// var hmacKey = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00"; +// var expectedSign = "ipnxGCaUZ4l8TUW75a71/ghd2Fe5ffvX0pV4TLTntIc="; +// var additionalData = new Dictionary +// { +// { "hmacSignature", expectedSign } +// }; +// var notificationRequestItem = new NotificationRequestItem +// { +// PspReference = "pspReference", +// OriginalReference = "originalReference", +// MerchantAccountCode = "merchantAccount", +// MerchantReference = "reference", +// Amount = new Model.Checkout.Amount("EUR", 1000), +// EventCode = "EVENT", +// Success = true, +// AdditionalData = additionalData +// }; +// var hmacValidator = new HmacValidator(); +// var data = hmacValidator.GetDataToSign(notificationRequestItem); +// Assert.AreEqual("pspReference:originalReference:merchantAccount:reference:1000:EUR:EVENT:true", data); +// var encrypted = hmacValidator.CalculateHmac(notificationRequestItem, hmacKey); +// Assert.AreEqual(expectedSign, encrypted); +// Assert.IsTrue(hmacValidator.IsValidHmac(notificationRequestItem, hmacKey)); +// notificationRequestItem.AdditionalData["hmacSignature"] = "notValidSign"; +// Assert.IsFalse(hmacValidator.IsValidHmac(notificationRequestItem, hmacKey)); +// } +// +// [TestMethod] +// public void TestHmacCalculationNotificationRequestWithSpecialChars() +// { +// string hmacKey = "66B61474A0AA3736BA8789EDC6D6CD9EBA0C4F414A554E32A407F849C045C69D"; +// var mockPath = GetMockFilePath("mocks/notification-response-refund-fail.json"); +// var response = MockFileToString(mockPath); +// var hmacValidator = new HmacValidator(); +// var notificationRequest = JsonOperation.Deserialize(response); +// var notificationItem = notificationRequest.NotificationItemContainers[0].NotificationItem; +// var isValidHmac = hmacValidator.IsValidHmac(notificationItem, hmacKey); +// Assert.IsTrue(isValidHmac); +// } +// +// [TestMethod] +// public void TestSerializationShopperInteractionMoto() +// { +// var paymentRequest = MockPaymentData.CreateFullPaymentRequestWithShopperInteraction(PaymentRequest.ShopperInteractionEnum.Moto); +// var serializedPaymentRequest = JsonOperation.SerializeRequest(paymentRequest); +// StringAssert.Contains(serializedPaymentRequest, nameof(PaymentRequest.ShopperInteractionEnum.Moto)); +// } +// +// [TestMethod] +// public void TestNullHmacValidator() +// { +// var hmacValidator = new HmacValidator(); +// var notificationRequestItem = new NotificationRequestItem +// { +// PspReference = "pspReference", +// OriginalReference = "originalReference", +// MerchantAccountCode = "merchantAccount", +// MerchantReference = "reference", +// Amount = new Model.Checkout.Amount("EUR", 1000), +// EventCode = "EVENT", +// Success = true, +// AdditionalData = null +// }; +// var isValidHmacAdditionalDataNull = hmacValidator.IsValidHmac(notificationRequestItem, "hmacKey"); +// Assert.IsFalse(isValidHmacAdditionalDataNull); +// notificationRequestItem.AdditionalData = new Dictionary(); +// var isValidHmacAdditionalDataEmpty = hmacValidator.IsValidHmac(notificationRequestItem, "hmacKey"); +// Assert.IsFalse(isValidHmacAdditionalDataEmpty); +// } +// +// [TestMethod] +// public void TestColonAndBackslashHmacValidator() +// { +// var hmacValidator = new HmacValidator(); +// var jsonNotification = @"{ +// 'additionalData': { +// 'acquirerCode': 'TestPmmAcquirer', +// 'acquirerReference': 'J8DXDJ2PV6P', +// 'authCode': '052095', +// 'avsResult': '5 No AVS data provided', +// 'avsResultRaw': '5', +// 'cardSummary': '1111', +// 'checkout.cardAddedBrand': 'visa', +// 'cvcResult': '1 Matches', +// 'cvcResultRaw': 'M', +// 'expiryDate': '03/2030', +// 'hmacSignature': 'CZErGCNQaSsxbaQfZaJlakqo7KPP+mIa8a+wx3yNs9A=', +// 'paymentMethod': 'visa', +// 'refusalReasonRaw': 'AUTHORISED', +// 'retry.attempt1.acquirer': 'TestPmmAcquirer', +// 'retry.attempt1.acquirerAccount': 'TestPmmAcquirerAccount', +// 'retry.attempt1.avsResultRaw': '5', +// 'retry.attempt1.rawResponse': 'AUTHORISED', +// 'retry.attempt1.responseCode': 'Approved', +// 'retry.attempt1.scaExemptionRequested': 'lowValue', +// 'scaExemptionRequested': 'lowValue' +// }, +// 'amount': { +// 'currency': 'EUR', +// 'value': 1000 +// }, +// 'eventCode': 'AUTHORISATION', +// 'eventDate': '2023-01-10T13:42:29+01:00', +// 'merchantAccountCode': 'AntoniStroinski', +// 'merchantReference': '\\:/\\/slashes are fun', +// 'operations': [ +// 'CANCEL', +// 'CAPTURE', +// 'REFUND' +// ], +// 'paymentMethod': 'visa', +// 'pspReference': 'ZVWN7D3WSMK2WN82', +// 'reason': '052095:1111:03/2030', +// 'success': 'true' +// }"; +// var notificationRequestItem = JsonConvert.DeserializeObject(jsonNotification); +// var isValidHmac = hmacValidator.IsValidHmac(notificationRequestItem, "74F490DD33F7327BAECC88B2947C011FC02D014A473AAA33A8EC93E4DC069174"); +// Assert.IsTrue(isValidHmac); +// } +// +// [TestMethod] +// public void TestCardAcquisitionAdditionalResponse() +// { +// string jsonString = @"{ +// ""additionalData"": { +// ""PaymentAccountReference"": ""Yv6zs1234567890ASDFGHJKL"", +// ""alias"": ""G12345678"", +// ""aliasType"": ""Default"", +// ""applicationLabel"": ""ASDFGHJKL"", +// ""applicationPreferredName"": ""ASDFGHJKL"", +// ""backendGiftcardIndicator"": ""false"", +// ""cardBin"": ""4111111"", +// ""cardHolderName"": ""John Smith"" +// }, +// ""message"": ""CARD_ACQ_COMPLETED"", +// ""store"": ""NL"" +// }"; +// string responseBased64 = "ewoiYWRkaXRpb25hbERhdGEiOnsKICJQYXltZW50QWNjb3VudFJlZmVyZW5jZSI6Ill2NnpzMTIzNDU2Nzg5MEFTREZHSEpLTCIsCiJhbGlhcyI6IkcxMjM0NTY3OCIsCiJhbGlhc1R5cGUiOiJEZWZhdWx0IiwKImFwcGxpY2F0aW9uTGFiZWwiOiJBU0RGR0hKS0wiLAoiYXBwbGljYXRpb25QcmVmZXJyZWROYW1lIjoiQVNERkdISktMIiwKICJiYWNrZW5kR2lmdGNhcmRJbmRpY2F0b3IiOiJmYWxzZSIsCiJjYXJkQmluIjoiNDExMTExMSIsCiJjYXJkSG9sZGVyTmFtZSI6IkpvaG4gU21pdGgiCgp9LAoibWVzc2FnZSI6IkNBUkRfQUNRX0NPTVBMRVRFRCIsCiJzdG9yZSI6Ik5MIgp9"; +// var additionalResponse = CardAcquisitionUtil.AdditionalResponse(responseBased64); +// Assert.AreEqual(additionalResponse.Message,"CARD_ACQ_COMPLETED"); +// Assert.AreEqual(additionalResponse.Store,"NL"); +// Assert.AreEqual(additionalResponse.AdditionalData["PaymentAccountReference"],"Yv6zs1234567890ASDFGHJKL"); +// Assert.AreEqual(additionalResponse.AdditionalData["alias"],"G12345678"); +// Assert.AreEqual(additionalResponse.AdditionalData["aliasType"],"Default"); +// Assert.AreEqual(additionalResponse.AdditionalData["applicationLabel"],"ASDFGHJKL"); +// Assert.AreEqual(additionalResponse.AdditionalData["applicationPreferredName"],"ASDFGHJKL"); +// Assert.AreEqual(additionalResponse.AdditionalData["backendGiftcardIndicator"],"false"); +// Assert.AreEqual(additionalResponse.AdditionalData["cardHolderName"],"John Smith"); +// Assert.AreEqual(additionalResponse.AdditionalData["cardBin"],"4111111"); +// +// var additionalResponseFromJson = CardAcquisitionUtil.AdditionalResponse(jsonString); +// Assert.AreEqual(additionalResponseFromJson.Message,"CARD_ACQ_COMPLETED"); +// Assert.AreEqual(additionalResponseFromJson.Store,"NL"); +// Assert.AreEqual(additionalResponseFromJson.AdditionalData["PaymentAccountReference"],"Yv6zs1234567890ASDFGHJKL"); +// Assert.AreEqual(additionalResponseFromJson.AdditionalData["alias"],"G12345678"); +// Assert.AreEqual(additionalResponseFromJson.AdditionalData["aliasType"],"Default"); +// Assert.AreEqual(additionalResponseFromJson.AdditionalData["applicationLabel"],"ASDFGHJKL"); +// Assert.AreEqual(additionalResponseFromJson.AdditionalData["applicationPreferredName"],"ASDFGHJKL"); +// Assert.AreEqual(additionalResponseFromJson.AdditionalData["backendGiftcardIndicator"],"false"); +// Assert.AreEqual(additionalResponseFromJson.AdditionalData["cardHolderName"],"John Smith"); +// Assert.AreEqual(additionalResponseFromJson.AdditionalData["cardBin"],"4111111"); +// +// } +// +// } +// } diff --git a/Adyen.Test/WebhooksTests/BalancePlatformWebhookHandlerTest.cs b/Adyen.Test/WebhooksTests/BalancePlatformWebhookHandlerTest.cs index 4f23c9517..3872e1bc6 100644 --- a/Adyen.Test/WebhooksTests/BalancePlatformWebhookHandlerTest.cs +++ b/Adyen.Test/WebhooksTests/BalancePlatformWebhookHandlerTest.cs @@ -1,551 +1,551 @@ -using System; -using Adyen.Model.AcsWebhooks; -using Adyen.Model.ConfigurationWebhooks; -using Adyen.Model.NegativeBalanceWarningWebhooks; -using Adyen.Model.ReportWebhooks; -using Adyen.Model.TransactionWebhooks; -using Adyen.Webhooks; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Newtonsoft.Json; -using CapabilityProblemEntity = Adyen.Model.ConfigurationWebhooks.CapabilityProblemEntity; - -namespace Adyen.Test.WebhooksTests -{ - [TestClass] - public class BalancePlatformWebhookHandlerTest : BaseTest - { - private readonly BalancePlatformWebhookHandler _balancePlatformWebhookHandler = new BalancePlatformWebhookHandler(); - - [TestMethod] - [DataRow("balancePlatform.accountHolder.created", AccountHolderNotificationRequest.TypeEnum.Created)] - [DataRow("balancePlatform.accountHolder.updated", AccountHolderNotificationRequest.TypeEnum.Updated)] - public void Given_AccountHolder_Webhook_When_Type_Is_Provided_Result_Should_Deserialize(string type, AccountHolderNotificationRequest.TypeEnum expected) - { - // Arrange - string jsonPayload = @" -{ - 'data': { - 'balancePlatform': 'YOUR_BALANCE_PLATFORM', - 'accountHolder': { - 'contactDetails': { - 'address': { - 'country': 'NL', - 'houseNumberOrName': '274', - 'postalCode': '1020CD', - 'street': 'Brannan Street' - }, - 'email': 's.hopper@example.com', - 'phone': { - 'number': '+315551231234', - 'type': 'Mobile' - } - }, - 'description': 'S.Hopper - Staff 123', - 'id': 'AH00000000000000000000001', - 'status': 'Active' - } - }, - 'environment': 'test', - 'type': '" + type + "'" + -"}"; - // Act - _balancePlatformWebhookHandler.GetAccountHolderNotificationRequest(jsonPayload, out AccountHolderNotificationRequest target); - - // Assert - Assert.IsNotNull(target); - Assert.AreEqual("YOUR_BALANCE_PLATFORM", target.Data.BalancePlatform); - Assert.AreEqual("NL", target.Data.AccountHolder.ContactDetails.Address.Country); - Assert.AreEqual("274", target.Data.AccountHolder.ContactDetails.Address.HouseNumberOrName); - Assert.AreEqual("1020CD", target.Data.AccountHolder.ContactDetails.Address.PostalCode); - Assert.AreEqual("Brannan Street", target.Data.AccountHolder.ContactDetails.Address.Street); - Assert.AreEqual("s.hopper@example.com", target.Data.AccountHolder.ContactDetails.Email); - Assert.AreEqual("+315551231234", target.Data.AccountHolder.ContactDetails.Phone.Number); - Assert.AreEqual(Phone.TypeEnum.Mobile, target.Data.AccountHolder.ContactDetails.Phone.Type); - Assert.AreEqual("S.Hopper - Staff 123", target.Data.AccountHolder.Description); - Assert.AreEqual("AH00000000000000000000001", target.Data.AccountHolder.Id); - Assert.AreEqual(AccountHolder.StatusEnum.Active, target.Data.AccountHolder.Status); - Assert.AreEqual("test", target.Environment); - Assert.AreEqual(expected, target.Type); - } - - [TestMethod] - public void Given_AccountHolder_Webhook_When_Type_Is_Unknown_Result_Should_Be_Null() - { - string jsonPayload = @"{ 'type': 'unknowntype' }"; - bool response = _balancePlatformWebhookHandler.GetAccountHolderNotificationRequest(jsonPayload, out AccountHolderNotificationRequest target); - Assert.IsFalse(response); - Assert.IsNull(target); - } - - [TestMethod] - public void Given_AccountHolder_Webhook_When_Invalid_Json_Result_Should_Throw_JsonReaderException() - { - string jsonPayload = "{ invalid,.json; }"; - Assert.ThrowsException(() => _balancePlatformWebhookHandler.GetAccountHolderNotificationRequest(jsonPayload, out var _)); - } - - [TestMethod] - - public void Test_BalancePlatform_AccountHolderUpdated_LEM_V3() - { - // Note: We're using double-quotes here as some descriptions in the JSON payload contain single quotes ' - // Assert - const string jsonPayload = @" -{ - ""data"": { - ""balancePlatform"": ""YOUR_BALANCE_PLATFORM"", - ""accountHolder"": { - ""legalEntityId"": ""LE00000000000000000001"", - ""reference"": ""YOUR_REFERENCE-2412C"", - ""capabilities"": { - ""sendToTransferInstrument"": { - ""enabled"": true, - ""requested"": true, - ""allowed"": false, - ""problems"": [ - { - ""entity"": { - ""id"": ""LE00000000000000000001"", - ""type"": ""LegalEntity"" - }, - ""verificationErrors"": [ - { - ""code"": ""2_902"", - ""message"": ""Terms Of Service forms are not accepted."", - ""remediatingActions"": [ - { - ""code"": ""2_902"", - ""message"": ""Accept TOS"" - } - ], - ""type"": ""invalidInput"" - } - ] - }, - { - ""entity"": { - ""id"": ""SE00000000000000000001"", - ""type"": ""BankAccount"" - }, - ""verificationErrors"": [ - { - ""code"": ""2_8037"", - ""message"": ""'bankStatement' was missing."", - ""remediatingActions"": [ - { - ""code"": ""1_703"", - ""message"": ""Upload a bank statement"" - } - ], - ""type"": ""dataMissing"" - } - ] - }, - { - ""entity"": { - ""id"": ""SE00000000000000000002"", - ""type"": ""BankAccount"" - }, - ""verificationErrors"": [ - { - ""code"": ""2_8037"", - ""message"": ""'bankStatement' was missing."", - ""remediatingActions"": [ - { - ""code"": ""1_703"", - ""message"": ""Upload a bank statement"" - } - ], - ""type"": ""dataMissing"" - } - ] - }, - { - ""entity"": { - ""id"": ""LE00000000000000000001"", - ""type"": ""LegalEntity"" - }, - ""verificationErrors"": [ - { - ""code"": ""2_8189"", - ""message"": ""'UBO through control' was missing."", - ""remediatingActions"": [ - { - ""code"": ""2_151"", - ""message"": ""Add 'organization.entityAssociations' of type 'uboThroughControl' to legal entity"" - } - ], - ""type"": ""dataMissing"" - }, - { - ""code"": ""1_50"", - ""message"": ""Organization details couldn't be verified"", - ""subErrors"": [ - { - ""code"": ""1_5016"", - ""message"": ""The tax ID number couldn't be verified"", - ""remediatingActions"": [ - { - ""code"": ""1_500"", - ""message"": ""Update organization details"" - }, - { - ""code"": ""1_501"", - ""message"": ""Upload a registration document"" - } - ], - ""type"": ""invalidInput"" - } - ], - ""type"": ""invalidInput"" - }, - { - ""code"": ""2_8067"", - ""message"": ""'Signatory' was missing."", - ""remediatingActions"": [ - { - ""code"": ""2_124"", - ""message"": ""Add 'organization.entityAssociations' of type 'signatory' to legal entity"" - } - ], - ""type"": ""dataMissing"" - } - ] - } - ], - ""transferInstruments"": [ - { - ""enabled"": true, - ""requested"": true, - ""allowed"": false, - ""id"": ""SE00000000000000000001"", - ""verificationStatus"": ""pending"" - }, - { - ""enabled"": true, - ""requested"": true, - ""allowed"": false, - ""id"": ""SE00000000000000000002"", - ""verificationStatus"": ""pending"" - } - ], - ""verificationStatus"": ""pending"" - } - }, - ""id"": ""AH00000000000000000001"", - ""status"": ""active"" - } - }, - ""environment"": ""live"", - ""timestamp"": ""2024-12-15T15:42:03+01:00"", - ""type"": ""balancePlatform.accountHolder.updated"" -}"; - - _balancePlatformWebhookHandler.GetAccountHolderNotificationRequest(jsonPayload, out AccountHolderNotificationRequest accountHolderUpdatedWebhook); - - Assert.IsNotNull(accountHolderUpdatedWebhook); - Assert.AreEqual(accountHolderUpdatedWebhook.Type, AccountHolderNotificationRequest.TypeEnum.Updated); - Assert.AreEqual("YOUR_BALANCE_PLATFORM", accountHolderUpdatedWebhook.Data.BalancePlatform); - Assert.AreEqual("AH00000000000000000001", accountHolderUpdatedWebhook.Data.AccountHolder.Id); - Assert.AreEqual("LE00000000000000000001", accountHolderUpdatedWebhook.Data.AccountHolder.LegalEntityId); - Assert.AreEqual("YOUR_REFERENCE-2412C", accountHolderUpdatedWebhook.Data.AccountHolder.Reference); - Assert.AreEqual(AccountHolder.StatusEnum.Active, accountHolderUpdatedWebhook.Data.AccountHolder.Status); - Assert.IsTrue(accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities.TryGetValue("sendToTransferInstrument", out AccountHolderCapability capabilitiesData)); - Assert.AreEqual(true, capabilitiesData.Enabled); - Assert.AreEqual(true, capabilitiesData.Requested); - Assert.AreEqual(false, capabilitiesData.Allowed); - Assert.AreEqual(AccountHolderCapability.VerificationStatusEnum.Pending, capabilitiesData.VerificationStatus); - Assert.AreEqual(4, accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems.Count); - Assert.AreEqual("LE00000000000000000001", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[0].Entity.Id); - Assert.AreEqual(CapabilityProblemEntity.TypeEnum.LegalEntity, accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[0].Entity.Type); - Assert.AreEqual("2_902", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[0].VerificationErrors[0].Code); - Assert.AreEqual("Terms Of Service forms are not accepted.", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[0].VerificationErrors[0].Message); - Assert.AreEqual("Accept TOS", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[0].VerificationErrors[0].RemediatingActions[0].Message); - Assert.AreEqual("SE00000000000000000001", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[1].Entity.Id); - Assert.AreEqual(CapabilityProblemEntity.TypeEnum.BankAccount, accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[1].Entity.Type); - Assert.AreEqual("2_8037", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[1].VerificationErrors[0].Code); - Assert.AreEqual("'bankStatement' was missing.", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[1].VerificationErrors[0].Message); - Assert.AreEqual("Upload a bank statement", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[1].VerificationErrors[0].RemediatingActions[0].Message); - Assert.AreEqual("SE00000000000000000002", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[2].Entity.Id); - Assert.AreEqual(CapabilityProblemEntity.TypeEnum.BankAccount, accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[2].Entity.Type); - Assert.AreEqual("2_8037", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[2].VerificationErrors[0].Code); - Assert.AreEqual("'bankStatement' was missing.", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[2].VerificationErrors[0].Message); - Assert.AreEqual("Upload a bank statement", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[2].VerificationErrors[0].RemediatingActions[0].Message); - Assert.AreEqual("LE00000000000000000001", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[3].Entity.Id); - Assert.AreEqual(CapabilityProblemEntity.TypeEnum.LegalEntity, accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[3].Entity.Type); - Assert.AreEqual("2_8189", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[3].VerificationErrors[0].Code); - Assert.AreEqual("'UBO through control' was missing.", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[3].VerificationErrors[0].Message); - Assert.AreEqual("Add 'organization.entityAssociations' of type 'uboThroughControl' to legal entity", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[3].VerificationErrors[0].RemediatingActions[0].Message); - Assert.AreEqual("live", accountHolderUpdatedWebhook.Environment); - Assert.AreEqual(DateTime.Parse("2024-12-15T15:42:03+01:00"), accountHolderUpdatedWebhook.Timestamp); - } - - [TestMethod] - public void Test_POC_Integration() - { - string jsonPayload = @" -{ - 'data': { - 'balancePlatform': 'YOUR_BALANCE_PLATFORM', - 'accountHolder': { - 'contactDetails': { - 'address': { - 'country': 'NL', - 'houseNumberOrName': '274', - 'postalCode': '1020CD', - 'street': 'Brannan Street' - }, - 'email': 's.hopper@example.com', - 'phone': { - 'number': '+315551231234', - 'type': 'Mobile' - } - }, - 'description': 'S.Hopper - Staff 123', - 'id': 'AH00000000000000000000001', - 'status': 'Active' - } - }, - 'environment': 'test', - 'type': 'balancePlatform.accountHolder.created' -}"; - - var handler = new BalancePlatformWebhookHandler(); - var response = handler.GetGenericBalancePlatformWebhook(jsonPayload); - try - { - if (response.GetType() == typeof(AccountHolderNotificationRequest)) - { - var accountHolderNotificationRequest = (AccountHolderNotificationRequest)response; - Assert.AreEqual(accountHolderNotificationRequest.Environment, "test"); - } - - if (response.GetType() == typeof(BalanceAccountNotificationRequest)) - { - var balanceAccountNotificationRequest = (BalanceAccountNotificationRequest)response; - Assert.Fail(balanceAccountNotificationRequest.Data.BalancePlatform); - } - } - catch (System.Exception e) - { - Assert.Fail(); - throw new System.Exception(e.ToString()); - } - } - - [TestMethod] - public void Test_TransactionWebhook_V4() - { - // Arrange - const string jsonPayload = @" -{ - 'data': { - 'id': 'EVJN42272224222B5JB8BRC84N686ZEUR', - 'amount': { - 'value': 7000, - 'currency': 'EUR' - }, - 'status': 'booked', - 'transfer': { - 'id': 'JN4227222422265', - 'reference': 'Split_item_1', - }, - 'valueDate': '2023-03-01T00:00:00+02:00', - 'bookingDate': '2023-02-28T13:30:20+02:00', - 'creationDate': '2023-02-28T13:30:05+02:00', - 'accountHolder': { - 'id': 'AH00000000000000000000001', - 'description': 'Your description for the account holder', - 'reference': 'Your reference for the account holder' - }, - 'balanceAccount': { - 'id': 'BA00000000000000000000001', - 'description': 'Your description for the balance account', - 'reference': 'Your reference for the balance account' - }, - 'balancePlatform': 'YOUR_BALANCE_PLATFORM' - }, - 'type': 'balancePlatform.transaction.created', - 'environment': 'test' -}"; - Assert.IsFalse(_balancePlatformWebhookHandler.GetPaymentNotificationRequest(jsonPayload, out var _)); - - // Act - _balancePlatformWebhookHandler.GetTransactionNotificationRequestV4(jsonPayload, out TransactionNotificationRequestV4 target); - - // Assert - Assert.IsNotNull(target); - Assert.AreEqual(TransactionNotificationRequestV4.TypeEnum.BalancePlatformTransactionCreated, target.Type); - Assert.AreEqual(Transaction.StatusEnum.Booked, target.Data.Status); - Assert.AreEqual("BA00000000000000000000001", target.Data.BalanceAccount.Id); - Assert.IsTrue(target.Data.ValueDate.Equals(DateTime.Parse("2023-03-01T00:00:00+02:00"))); - Assert.AreEqual("YOUR_BALANCE_PLATFORM", target.Data.BalancePlatform); - Assert.AreEqual("AH00000000000000000000001", target.Data.AccountHolder.Id); - Assert.AreEqual("Your description for the account holder", target.Data.AccountHolder.Description); - Assert.AreEqual("Your reference for the account holder", target.Data.AccountHolder.Reference); - Assert.AreEqual("JN4227222422265", target.Data.Transfer.Id); - Assert.AreEqual("Split_item_1", target.Data.Transfer.Reference); - Assert.AreEqual(DateTime.Parse("2023-02-28T13:30:05+02:00"), target.Data.CreationDate); - Assert.AreEqual(DateTime.Parse("2023-02-28T13:30:20+02:00"), target.Data.BookingDate); - Assert.AreEqual(7000, target.Data.Amount.Value); - Assert.AreEqual("EUR", target.Data.Amount.Currency); - Assert.AreEqual("test", target.Environment); - } - - [TestMethod] - public void Test_ReportCreatedWebhook() - { - // Arrange - const string jsonPayload = @" -{ - 'data': { - 'balancePlatform': 'YOUR_BALANCE_PLATFORM', - 'creationDate': '2024-07-02T02:01:08+02:00', - 'id': 'balanceplatform_accounting_report_2024_07_01.csv', - 'downloadUrl': 'https://balanceplatform-test.adyen.com/balanceplatform/.../.../.../balanceplatform_accounting_report_2024_07_01.csv', - 'fileName': 'balanceplatform_accounting_report_2024_07_01.csv', - 'reportType': 'balanceplatform_accounting_report' - }, - 'environment': 'test', - 'timestamp': '2024-07-02T02:01:05+02:00', - 'type': 'balancePlatform.report.created' -}"; - - // Act - _balancePlatformWebhookHandler.GetReportNotificationRequest(jsonPayload, out ReportNotificationRequest target); - - // Assert - Assert.IsNotNull(target); - Assert.AreEqual(target.Type, ReportNotificationRequest.TypeEnum.BalancePlatformReportCreated); - Assert.AreEqual("YOUR_BALANCE_PLATFORM", target.Data.BalancePlatform); - Assert.AreEqual("balanceplatform_accounting_report_2024_07_01.csv", target.Data.Id); - Assert.AreEqual("balanceplatform_accounting_report_2024_07_01.csv", target.Data.FileName); - Assert.AreEqual("balanceplatform_accounting_report", target.Data.ReportType); - Assert.AreEqual(DateTime.Parse("2024-07-02T02:01:08+02:00"), target.Data.CreationDate); - Assert.AreEqual("https://balanceplatform-test.adyen.com/balanceplatform/.../.../.../balanceplatform_accounting_report_2024_07_01.csv", target.Data.DownloadUrl); - Assert.AreEqual("test", target.Environment); - Assert.AreEqual(DateTime.Parse("2024-07-02T02:01:05+02:00"), target.Timestamp); - } - - [TestMethod] - public void Test_AuthenticationCreatedWebhook() - { - // Arrange - const string jsonPayload = @" -{ - 'data': { - 'authentication': { - 'acsTransId': '6a4c1709-a42e-4c7f-96c7-1043adacfc97', - 'challenge': { - 'flow': 'OOB_TRIGGER_FL', - 'lastInteraction': '2022-12-22T15:49:03+01:00' - }, - 'challengeIndicator': '01', - 'createdAt': '2022-12-22T15:45:03+01:00', - 'deviceChannel': 'app', - 'dsTransID': 'a3b86754-444d-46ca-95a2-ada351d3f42c', - 'exemptionIndicator': 'lowValue', - 'inPSD2Scope': true, - 'messageCategory': 'payment', - 'messageVersion': '2.2.0', - 'riskScore': 0, - 'threeDSServerTransID': '6edcc246-23ee-4e94-ac5d-8ae620bea7d9', - 'transStatus': 'Y', - 'type': 'challenge' - }, - 'balancePlatform': 'YOUR_BALANCE_PLATFORM', - 'id': '497f6eca-6276-4993-bfeb-53cbbbba6f08', - 'paymentInstrumentId': 'PI3227C223222B5BPCMFXD2XG', - 'purchase': { - 'date': '2022-12-22T15:49:03+01:00', - 'merchantName': 'MyShop', - 'originalAmount': { - 'currency': 'EUR', - 'value': 1000 - } - }, - 'status': 'authenticated' - }, - 'environment': 'test', - 'timestamp': '2022-12-22T15:42:03+01:00', - 'type': 'balancePlatform.authentication.created' -}"; - - // Act - _balancePlatformWebhookHandler.GetAuthenticationNotificationRequest(jsonPayload, out AuthenticationNotificationRequest target); - - // Assert - Assert.IsNotNull(target); - Assert.AreEqual(target.Type, AuthenticationNotificationRequest.TypeEnum.BalancePlatformAuthenticationCreated); - Assert.AreEqual("YOUR_BALANCE_PLATFORM", target.Data.BalancePlatform); - Assert.AreEqual("497f6eca-6276-4993-bfeb-53cbbbba6f08", target.Data.Id); - Assert.AreEqual("PI3227C223222B5BPCMFXD2XG", target.Data.PaymentInstrumentId); - Assert.AreEqual(AuthenticationNotificationData.StatusEnum.Authenticated, target.Data.Status); - Assert.AreEqual("MyShop", target.Data.Purchase.MerchantName); - Assert.AreEqual("2022-12-22T15:49:03+01:00", target.Data.Purchase.Date); - Assert.AreEqual("EUR", target.Data.Purchase.OriginalAmount.Currency); - Assert.AreEqual(1000, target.Data.Purchase.OriginalAmount.Value); - Assert.AreEqual(DateTime.Parse("2022-12-22T15:45:03+01:00"), target.Data.Authentication.CreatedAt); - Assert.AreEqual(AuthenticationInfo.DeviceChannelEnum.App, target.Data.Authentication.DeviceChannel); - Assert.AreEqual(ChallengeInfo.FlowEnum.OOBTRIGGERFL, target.Data.Authentication.Challenge.Flow); - Assert.AreEqual(DateTime.Parse("2022-12-22T15:49:03+01:00"), target.Data.Authentication.Challenge.LastInteraction); - Assert.AreEqual(AuthenticationInfo.ChallengeIndicatorEnum._01, target.Data.Authentication.ChallengeIndicator); - Assert.AreEqual(AuthenticationInfo.ExemptionIndicatorEnum.LowValue, target.Data.Authentication.ExemptionIndicator); - Assert.AreEqual(true, target.Data.Authentication.InPSD2Scope); - Assert.AreEqual(AuthenticationInfo.MessageCategoryEnum.Payment, target.Data.Authentication.MessageCategory); - Assert.AreEqual("2.2.0", target.Data.Authentication.MessageVersion); - Assert.AreEqual(0, target.Data.Authentication.RiskScore); - Assert.AreEqual("6edcc246-23ee-4e94-ac5d-8ae620bea7d9", target.Data.Authentication.ThreeDSServerTransID); - Assert.AreEqual(AuthenticationInfo.TransStatusEnum.Y, target.Data.Authentication.TransStatus); - Assert.AreEqual("test", target.Environment); - Assert.AreEqual(DateTime.Parse("2022-12-22T15:42:03+01:00"), target.Timestamp); - } - - [TestMethod] - public void Test_NegativeBalanceCompensationWarningWebhook() - { - // Arrange - const string jsonPayload = @" -{ - 'data': { - 'balancePlatform': 'YOUR_BALANCE_PLATFORM', - 'creationDate': '2024-07-02T02:01:08+02:00', - 'id': 'BA00000000000000000001', - 'accountHolder': { - 'description': 'Description for the account holder.', - 'reference': 'YOUR_REFERENCE', - 'id': 'AH00000000000000000001' - }, - 'amount': { - 'currency': 'EUR', - 'value': -145050 - }, - 'liableBalanceAccountId': 'BA11111111111111111111', - 'negativeBalanceSince': '2024-10-19T00:33:13+02:00', - 'scheduledCompensationAt': '2024-12-01T01:00:00+01:00' - }, - 'environment': 'test', - 'timestamp': '2024-10-22T00:00:00+02:00', - 'type': 'balancePlatform.negativeBalanceCompensationWarning.scheduled' -}"; - - // Act - _balancePlatformWebhookHandler.GetNegativeBalanceCompensationWarningNotificationRequest(jsonPayload, out NegativeBalanceCompensationWarningNotificationRequest target); - - // Assert - Assert.IsNotNull(target); - Assert.AreEqual(NegativeBalanceCompensationWarningNotificationRequest.TypeEnum.BalancePlatformNegativeBalanceCompensationWarningScheduled, target.Type); - Assert.AreEqual("YOUR_BALANCE_PLATFORM", target.Data.BalancePlatform); - Assert.AreEqual(DateTime.Parse("2024-07-02T02:01:08+02:00"), target.Data.CreationDate); - Assert.AreEqual("BA00000000000000000001", target.Data.Id); - Assert.AreEqual("YOUR_REFERENCE", target.Data.AccountHolder.Reference); - Assert.AreEqual("EUR", target.Data.Amount.Currency); - Assert.AreEqual(-145050, target.Data.Amount.Value); - Assert.AreEqual("BA11111111111111111111", target.Data.LiableBalanceAccountId); - Assert.AreEqual(DateTime.Parse("2024-10-19T00:33:13+02:00"), target.Data.NegativeBalanceSince); - Assert.AreEqual(DateTime.Parse("2024-12-01T01:00:00+01:00"), target.Data.ScheduledCompensationAt); - Assert.AreEqual("test", target.Environment); - Assert.AreEqual(DateTime.Parse("2024-10-22T00:00:00+02:00"), target.Timestamp); - } - } -} \ No newline at end of file +// using System; +// using Adyen.Model.AcsWebhooks; +// using Adyen.Model.ConfigurationWebhooks; +// using Adyen.Model.NegativeBalanceWarningWebhooks; +// using Adyen.Model.ReportWebhooks; +// using Adyen.Model.TransactionWebhooks; +// using Adyen.Webhooks; +// using Microsoft.VisualStudio.TestTools.UnitTesting; +// using Newtonsoft.Json; +// using CapabilityProblemEntity = Adyen.Model.ConfigurationWebhooks.CapabilityProblemEntity; +// +// namespace Adyen.Test.WebhooksTests +// { +// [TestClass] +// public class BalancePlatformWebhookHandlerTest : BaseTest +// { +// private readonly BalancePlatformWebhookHandler _balancePlatformWebhookHandler = new BalancePlatformWebhookHandler(); +// +// [TestMethod] +// [DataRow("balancePlatform.accountHolder.created", AccountHolderNotificationRequest.TypeEnum.Created)] +// [DataRow("balancePlatform.accountHolder.updated", AccountHolderNotificationRequest.TypeEnum.Updated)] +// public void Given_AccountHolder_Webhook_When_Type_Is_Provided_Result_Should_Deserialize(string type, AccountHolderNotificationRequest.TypeEnum expected) +// { +// // Arrange +// string jsonPayload = @" +// { +// 'data': { +// 'balancePlatform': 'YOUR_BALANCE_PLATFORM', +// 'accountHolder': { +// 'contactDetails': { +// 'address': { +// 'country': 'NL', +// 'houseNumberOrName': '274', +// 'postalCode': '1020CD', +// 'street': 'Brannan Street' +// }, +// 'email': 's.hopper@example.com', +// 'phone': { +// 'number': '+315551231234', +// 'type': 'Mobile' +// } +// }, +// 'description': 'S.Hopper - Staff 123', +// 'id': 'AH00000000000000000000001', +// 'status': 'Active' +// } +// }, +// 'environment': 'test', +// 'type': '" + type + "'" + +// "}"; +// // Act +// _balancePlatformWebhookHandler.GetAccountHolderNotificationRequest(jsonPayload, out AccountHolderNotificationRequest target); +// +// // Assert +// Assert.IsNotNull(target); +// Assert.AreEqual("YOUR_BALANCE_PLATFORM", target.Data.BalancePlatform); +// Assert.AreEqual("NL", target.Data.AccountHolder.ContactDetails.Address.Country); +// Assert.AreEqual("274", target.Data.AccountHolder.ContactDetails.Address.HouseNumberOrName); +// Assert.AreEqual("1020CD", target.Data.AccountHolder.ContactDetails.Address.PostalCode); +// Assert.AreEqual("Brannan Street", target.Data.AccountHolder.ContactDetails.Address.Street); +// Assert.AreEqual("s.hopper@example.com", target.Data.AccountHolder.ContactDetails.Email); +// Assert.AreEqual("+315551231234", target.Data.AccountHolder.ContactDetails.Phone.Number); +// Assert.AreEqual(Phone.TypeEnum.Mobile, target.Data.AccountHolder.ContactDetails.Phone.Type); +// Assert.AreEqual("S.Hopper - Staff 123", target.Data.AccountHolder.Description); +// Assert.AreEqual("AH00000000000000000000001", target.Data.AccountHolder.Id); +// Assert.AreEqual(AccountHolder.StatusEnum.Active, target.Data.AccountHolder.Status); +// Assert.AreEqual("test", target.Environment); +// Assert.AreEqual(expected, target.Type); +// } +// +// [TestMethod] +// public void Given_AccountHolder_Webhook_When_Type_Is_Unknown_Result_Should_Be_Null() +// { +// string jsonPayload = @"{ 'type': 'unknowntype' }"; +// bool response = _balancePlatformWebhookHandler.GetAccountHolderNotificationRequest(jsonPayload, out AccountHolderNotificationRequest target); +// Assert.IsFalse(response); +// Assert.IsNull(target); +// } +// +// [TestMethod] +// public void Given_AccountHolder_Webhook_When_Invalid_Json_Result_Should_Throw_JsonReaderException() +// { +// string jsonPayload = "{ invalid,.json; }"; +// Assert.ThrowsException(() => _balancePlatformWebhookHandler.GetAccountHolderNotificationRequest(jsonPayload, out var _)); +// } +// +// [TestMethod] +// +// public void Test_BalancePlatform_AccountHolderUpdated_LEM_V3() +// { +// // Note: We're using double-quotes here as some descriptions in the JSON payload contain single quotes ' +// // Assert +// const string jsonPayload = @" +// { +// ""data"": { +// ""balancePlatform"": ""YOUR_BALANCE_PLATFORM"", +// ""accountHolder"": { +// ""legalEntityId"": ""LE00000000000000000001"", +// ""reference"": ""YOUR_REFERENCE-2412C"", +// ""capabilities"": { +// ""sendToTransferInstrument"": { +// ""enabled"": true, +// ""requested"": true, +// ""allowed"": false, +// ""problems"": [ +// { +// ""entity"": { +// ""id"": ""LE00000000000000000001"", +// ""type"": ""LegalEntity"" +// }, +// ""verificationErrors"": [ +// { +// ""code"": ""2_902"", +// ""message"": ""Terms Of Service forms are not accepted."", +// ""remediatingActions"": [ +// { +// ""code"": ""2_902"", +// ""message"": ""Accept TOS"" +// } +// ], +// ""type"": ""invalidInput"" +// } +// ] +// }, +// { +// ""entity"": { +// ""id"": ""SE00000000000000000001"", +// ""type"": ""BankAccount"" +// }, +// ""verificationErrors"": [ +// { +// ""code"": ""2_8037"", +// ""message"": ""'bankStatement' was missing."", +// ""remediatingActions"": [ +// { +// ""code"": ""1_703"", +// ""message"": ""Upload a bank statement"" +// } +// ], +// ""type"": ""dataMissing"" +// } +// ] +// }, +// { +// ""entity"": { +// ""id"": ""SE00000000000000000002"", +// ""type"": ""BankAccount"" +// }, +// ""verificationErrors"": [ +// { +// ""code"": ""2_8037"", +// ""message"": ""'bankStatement' was missing."", +// ""remediatingActions"": [ +// { +// ""code"": ""1_703"", +// ""message"": ""Upload a bank statement"" +// } +// ], +// ""type"": ""dataMissing"" +// } +// ] +// }, +// { +// ""entity"": { +// ""id"": ""LE00000000000000000001"", +// ""type"": ""LegalEntity"" +// }, +// ""verificationErrors"": [ +// { +// ""code"": ""2_8189"", +// ""message"": ""'UBO through control' was missing."", +// ""remediatingActions"": [ +// { +// ""code"": ""2_151"", +// ""message"": ""Add 'organization.entityAssociations' of type 'uboThroughControl' to legal entity"" +// } +// ], +// ""type"": ""dataMissing"" +// }, +// { +// ""code"": ""1_50"", +// ""message"": ""Organization details couldn't be verified"", +// ""subErrors"": [ +// { +// ""code"": ""1_5016"", +// ""message"": ""The tax ID number couldn't be verified"", +// ""remediatingActions"": [ +// { +// ""code"": ""1_500"", +// ""message"": ""Update organization details"" +// }, +// { +// ""code"": ""1_501"", +// ""message"": ""Upload a registration document"" +// } +// ], +// ""type"": ""invalidInput"" +// } +// ], +// ""type"": ""invalidInput"" +// }, +// { +// ""code"": ""2_8067"", +// ""message"": ""'Signatory' was missing."", +// ""remediatingActions"": [ +// { +// ""code"": ""2_124"", +// ""message"": ""Add 'organization.entityAssociations' of type 'signatory' to legal entity"" +// } +// ], +// ""type"": ""dataMissing"" +// } +// ] +// } +// ], +// ""transferInstruments"": [ +// { +// ""enabled"": true, +// ""requested"": true, +// ""allowed"": false, +// ""id"": ""SE00000000000000000001"", +// ""verificationStatus"": ""pending"" +// }, +// { +// ""enabled"": true, +// ""requested"": true, +// ""allowed"": false, +// ""id"": ""SE00000000000000000002"", +// ""verificationStatus"": ""pending"" +// } +// ], +// ""verificationStatus"": ""pending"" +// } +// }, +// ""id"": ""AH00000000000000000001"", +// ""status"": ""active"" +// } +// }, +// ""environment"": ""live"", +// ""timestamp"": ""2024-12-15T15:42:03+01:00"", +// ""type"": ""balancePlatform.accountHolder.updated"" +// }"; +// +// _balancePlatformWebhookHandler.GetAccountHolderNotificationRequest(jsonPayload, out AccountHolderNotificationRequest accountHolderUpdatedWebhook); +// +// Assert.IsNotNull(accountHolderUpdatedWebhook); +// Assert.AreEqual(accountHolderUpdatedWebhook.Type, AccountHolderNotificationRequest.TypeEnum.Updated); +// Assert.AreEqual("YOUR_BALANCE_PLATFORM", accountHolderUpdatedWebhook.Data.BalancePlatform); +// Assert.AreEqual("AH00000000000000000001", accountHolderUpdatedWebhook.Data.AccountHolder.Id); +// Assert.AreEqual("LE00000000000000000001", accountHolderUpdatedWebhook.Data.AccountHolder.LegalEntityId); +// Assert.AreEqual("YOUR_REFERENCE-2412C", accountHolderUpdatedWebhook.Data.AccountHolder.Reference); +// Assert.AreEqual(AccountHolder.StatusEnum.Active, accountHolderUpdatedWebhook.Data.AccountHolder.Status); +// Assert.IsTrue(accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities.TryGetValue("sendToTransferInstrument", out AccountHolderCapability capabilitiesData)); +// Assert.AreEqual(true, capabilitiesData.Enabled); +// Assert.AreEqual(true, capabilitiesData.Requested); +// Assert.AreEqual(false, capabilitiesData.Allowed); +// Assert.AreEqual(AccountHolderCapability.VerificationStatusEnum.Pending, capabilitiesData.VerificationStatus); +// Assert.AreEqual(4, accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems.Count); +// Assert.AreEqual("LE00000000000000000001", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[0].Entity.Id); +// Assert.AreEqual(CapabilityProblemEntity.TypeEnum.LegalEntity, accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[0].Entity.Type); +// Assert.AreEqual("2_902", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[0].VerificationErrors[0].Code); +// Assert.AreEqual("Terms Of Service forms are not accepted.", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[0].VerificationErrors[0].Message); +// Assert.AreEqual("Accept TOS", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[0].VerificationErrors[0].RemediatingActions[0].Message); +// Assert.AreEqual("SE00000000000000000001", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[1].Entity.Id); +// Assert.AreEqual(CapabilityProblemEntity.TypeEnum.BankAccount, accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[1].Entity.Type); +// Assert.AreEqual("2_8037", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[1].VerificationErrors[0].Code); +// Assert.AreEqual("'bankStatement' was missing.", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[1].VerificationErrors[0].Message); +// Assert.AreEqual("Upload a bank statement", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[1].VerificationErrors[0].RemediatingActions[0].Message); +// Assert.AreEqual("SE00000000000000000002", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[2].Entity.Id); +// Assert.AreEqual(CapabilityProblemEntity.TypeEnum.BankAccount, accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[2].Entity.Type); +// Assert.AreEqual("2_8037", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[2].VerificationErrors[0].Code); +// Assert.AreEqual("'bankStatement' was missing.", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[2].VerificationErrors[0].Message); +// Assert.AreEqual("Upload a bank statement", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[2].VerificationErrors[0].RemediatingActions[0].Message); +// Assert.AreEqual("LE00000000000000000001", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[3].Entity.Id); +// Assert.AreEqual(CapabilityProblemEntity.TypeEnum.LegalEntity, accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[3].Entity.Type); +// Assert.AreEqual("2_8189", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[3].VerificationErrors[0].Code); +// Assert.AreEqual("'UBO through control' was missing.", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[3].VerificationErrors[0].Message); +// Assert.AreEqual("Add 'organization.entityAssociations' of type 'uboThroughControl' to legal entity", accountHolderUpdatedWebhook.Data.AccountHolder.Capabilities["sendToTransferInstrument"].Problems[3].VerificationErrors[0].RemediatingActions[0].Message); +// Assert.AreEqual("live", accountHolderUpdatedWebhook.Environment); +// Assert.AreEqual(DateTime.Parse("2024-12-15T15:42:03+01:00"), accountHolderUpdatedWebhook.Timestamp); +// } +// +// [TestMethod] +// public void Test_POC_Integration() +// { +// string jsonPayload = @" +// { +// 'data': { +// 'balancePlatform': 'YOUR_BALANCE_PLATFORM', +// 'accountHolder': { +// 'contactDetails': { +// 'address': { +// 'country': 'NL', +// 'houseNumberOrName': '274', +// 'postalCode': '1020CD', +// 'street': 'Brannan Street' +// }, +// 'email': 's.hopper@example.com', +// 'phone': { +// 'number': '+315551231234', +// 'type': 'Mobile' +// } +// }, +// 'description': 'S.Hopper - Staff 123', +// 'id': 'AH00000000000000000000001', +// 'status': 'Active' +// } +// }, +// 'environment': 'test', +// 'type': 'balancePlatform.accountHolder.created' +// }"; +// +// var handler = new BalancePlatformWebhookHandler(); +// var response = handler.GetGenericBalancePlatformWebhook(jsonPayload); +// try +// { +// if (response.GetType() == typeof(AccountHolderNotificationRequest)) +// { +// var accountHolderNotificationRequest = (AccountHolderNotificationRequest)response; +// Assert.AreEqual(accountHolderNotificationRequest.Environment, "test"); +// } +// +// if (response.GetType() == typeof(BalanceAccountNotificationRequest)) +// { +// var balanceAccountNotificationRequest = (BalanceAccountNotificationRequest)response; +// Assert.Fail(balanceAccountNotificationRequest.Data.BalancePlatform); +// } +// } +// catch (System.Exception e) +// { +// Assert.Fail(); +// throw new System.Exception(e.ToString()); +// } +// } +// +// [TestMethod] +// public void Test_TransactionWebhook_V4() +// { +// // Arrange +// const string jsonPayload = @" +// { +// 'data': { +// 'id': 'EVJN42272224222B5JB8BRC84N686ZEUR', +// 'amount': { +// 'value': 7000, +// 'currency': 'EUR' +// }, +// 'status': 'booked', +// 'transfer': { +// 'id': 'JN4227222422265', +// 'reference': 'Split_item_1', +// }, +// 'valueDate': '2023-03-01T00:00:00+02:00', +// 'bookingDate': '2023-02-28T13:30:20+02:00', +// 'creationDate': '2023-02-28T13:30:05+02:00', +// 'accountHolder': { +// 'id': 'AH00000000000000000000001', +// 'description': 'Your description for the account holder', +// 'reference': 'Your reference for the account holder' +// }, +// 'balanceAccount': { +// 'id': 'BA00000000000000000000001', +// 'description': 'Your description for the balance account', +// 'reference': 'Your reference for the balance account' +// }, +// 'balancePlatform': 'YOUR_BALANCE_PLATFORM' +// }, +// 'type': 'balancePlatform.transaction.created', +// 'environment': 'test' +// }"; +// Assert.IsFalse(_balancePlatformWebhookHandler.GetPaymentNotificationRequest(jsonPayload, out var _)); +// +// // Act +// _balancePlatformWebhookHandler.GetTransactionNotificationRequestV4(jsonPayload, out TransactionNotificationRequestV4 target); +// +// // Assert +// Assert.IsNotNull(target); +// Assert.AreEqual(TransactionNotificationRequestV4.TypeEnum.BalancePlatformTransactionCreated, target.Type); +// Assert.AreEqual(Transaction.StatusEnum.Booked, target.Data.Status); +// Assert.AreEqual("BA00000000000000000000001", target.Data.BalanceAccount.Id); +// Assert.IsTrue(target.Data.ValueDate.Equals(DateTime.Parse("2023-03-01T00:00:00+02:00"))); +// Assert.AreEqual("YOUR_BALANCE_PLATFORM", target.Data.BalancePlatform); +// Assert.AreEqual("AH00000000000000000000001", target.Data.AccountHolder.Id); +// Assert.AreEqual("Your description for the account holder", target.Data.AccountHolder.Description); +// Assert.AreEqual("Your reference for the account holder", target.Data.AccountHolder.Reference); +// Assert.AreEqual("JN4227222422265", target.Data.Transfer.Id); +// Assert.AreEqual("Split_item_1", target.Data.Transfer.Reference); +// Assert.AreEqual(DateTime.Parse("2023-02-28T13:30:05+02:00"), target.Data.CreationDate); +// Assert.AreEqual(DateTime.Parse("2023-02-28T13:30:20+02:00"), target.Data.BookingDate); +// Assert.AreEqual(7000, target.Data.Amount.Value); +// Assert.AreEqual("EUR", target.Data.Amount.Currency); +// Assert.AreEqual("test", target.Environment); +// } +// +// [TestMethod] +// public void Test_ReportCreatedWebhook() +// { +// // Arrange +// const string jsonPayload = @" +// { +// 'data': { +// 'balancePlatform': 'YOUR_BALANCE_PLATFORM', +// 'creationDate': '2024-07-02T02:01:08+02:00', +// 'id': 'balanceplatform_accounting_report_2024_07_01.csv', +// 'downloadUrl': 'https://balanceplatform-test.adyen.com/balanceplatform/.../.../.../balanceplatform_accounting_report_2024_07_01.csv', +// 'fileName': 'balanceplatform_accounting_report_2024_07_01.csv', +// 'reportType': 'balanceplatform_accounting_report' +// }, +// 'environment': 'test', +// 'timestamp': '2024-07-02T02:01:05+02:00', +// 'type': 'balancePlatform.report.created' +// }"; +// +// // Act +// _balancePlatformWebhookHandler.GetReportNotificationRequest(jsonPayload, out ReportNotificationRequest target); +// +// // Assert +// Assert.IsNotNull(target); +// Assert.AreEqual(target.Type, ReportNotificationRequest.TypeEnum.BalancePlatformReportCreated); +// Assert.AreEqual("YOUR_BALANCE_PLATFORM", target.Data.BalancePlatform); +// Assert.AreEqual("balanceplatform_accounting_report_2024_07_01.csv", target.Data.Id); +// Assert.AreEqual("balanceplatform_accounting_report_2024_07_01.csv", target.Data.FileName); +// Assert.AreEqual("balanceplatform_accounting_report", target.Data.ReportType); +// Assert.AreEqual(DateTime.Parse("2024-07-02T02:01:08+02:00"), target.Data.CreationDate); +// Assert.AreEqual("https://balanceplatform-test.adyen.com/balanceplatform/.../.../.../balanceplatform_accounting_report_2024_07_01.csv", target.Data.DownloadUrl); +// Assert.AreEqual("test", target.Environment); +// Assert.AreEqual(DateTime.Parse("2024-07-02T02:01:05+02:00"), target.Timestamp); +// } +// +// [TestMethod] +// public void Test_AuthenticationCreatedWebhook() +// { +// // Arrange +// const string jsonPayload = @" +// { +// 'data': { +// 'authentication': { +// 'acsTransId': '6a4c1709-a42e-4c7f-96c7-1043adacfc97', +// 'challenge': { +// 'flow': 'OOB_TRIGGER_FL', +// 'lastInteraction': '2022-12-22T15:49:03+01:00' +// }, +// 'challengeIndicator': '01', +// 'createdAt': '2022-12-22T15:45:03+01:00', +// 'deviceChannel': 'app', +// 'dsTransID': 'a3b86754-444d-46ca-95a2-ada351d3f42c', +// 'exemptionIndicator': 'lowValue', +// 'inPSD2Scope': true, +// 'messageCategory': 'payment', +// 'messageVersion': '2.2.0', +// 'riskScore': 0, +// 'threeDSServerTransID': '6edcc246-23ee-4e94-ac5d-8ae620bea7d9', +// 'transStatus': 'Y', +// 'type': 'challenge' +// }, +// 'balancePlatform': 'YOUR_BALANCE_PLATFORM', +// 'id': '497f6eca-6276-4993-bfeb-53cbbbba6f08', +// 'paymentInstrumentId': 'PI3227C223222B5BPCMFXD2XG', +// 'purchase': { +// 'date': '2022-12-22T15:49:03+01:00', +// 'merchantName': 'MyShop', +// 'originalAmount': { +// 'currency': 'EUR', +// 'value': 1000 +// } +// }, +// 'status': 'authenticated' +// }, +// 'environment': 'test', +// 'timestamp': '2022-12-22T15:42:03+01:00', +// 'type': 'balancePlatform.authentication.created' +// }"; +// +// // Act +// _balancePlatformWebhookHandler.GetAuthenticationNotificationRequest(jsonPayload, out AuthenticationNotificationRequest target); +// +// // Assert +// Assert.IsNotNull(target); +// Assert.AreEqual(target.Type, AuthenticationNotificationRequest.TypeEnum.BalancePlatformAuthenticationCreated); +// Assert.AreEqual("YOUR_BALANCE_PLATFORM", target.Data.BalancePlatform); +// Assert.AreEqual("497f6eca-6276-4993-bfeb-53cbbbba6f08", target.Data.Id); +// Assert.AreEqual("PI3227C223222B5BPCMFXD2XG", target.Data.PaymentInstrumentId); +// Assert.AreEqual(AuthenticationNotificationData.StatusEnum.Authenticated, target.Data.Status); +// Assert.AreEqual("MyShop", target.Data.Purchase.MerchantName); +// Assert.AreEqual("2022-12-22T15:49:03+01:00", target.Data.Purchase.Date); +// Assert.AreEqual("EUR", target.Data.Purchase.OriginalAmount.Currency); +// Assert.AreEqual(1000, target.Data.Purchase.OriginalAmount.Value); +// Assert.AreEqual(DateTime.Parse("2022-12-22T15:45:03+01:00"), target.Data.Authentication.CreatedAt); +// Assert.AreEqual(AuthenticationInfo.DeviceChannelEnum.App, target.Data.Authentication.DeviceChannel); +// Assert.AreEqual(ChallengeInfo.FlowEnum.OOBTRIGGERFL, target.Data.Authentication.Challenge.Flow); +// Assert.AreEqual(DateTime.Parse("2022-12-22T15:49:03+01:00"), target.Data.Authentication.Challenge.LastInteraction); +// Assert.AreEqual(AuthenticationInfo.ChallengeIndicatorEnum._01, target.Data.Authentication.ChallengeIndicator); +// Assert.AreEqual(AuthenticationInfo.ExemptionIndicatorEnum.LowValue, target.Data.Authentication.ExemptionIndicator); +// Assert.AreEqual(true, target.Data.Authentication.InPSD2Scope); +// Assert.AreEqual(AuthenticationInfo.MessageCategoryEnum.Payment, target.Data.Authentication.MessageCategory); +// Assert.AreEqual("2.2.0", target.Data.Authentication.MessageVersion); +// Assert.AreEqual(0, target.Data.Authentication.RiskScore); +// Assert.AreEqual("6edcc246-23ee-4e94-ac5d-8ae620bea7d9", target.Data.Authentication.ThreeDSServerTransID); +// Assert.AreEqual(AuthenticationInfo.TransStatusEnum.Y, target.Data.Authentication.TransStatus); +// Assert.AreEqual("test", target.Environment); +// Assert.AreEqual(DateTime.Parse("2022-12-22T15:42:03+01:00"), target.Timestamp); +// } +// +// [TestMethod] +// public void Test_NegativeBalanceCompensationWarningWebhook() +// { +// // Arrange +// const string jsonPayload = @" +// { +// 'data': { +// 'balancePlatform': 'YOUR_BALANCE_PLATFORM', +// 'creationDate': '2024-07-02T02:01:08+02:00', +// 'id': 'BA00000000000000000001', +// 'accountHolder': { +// 'description': 'Description for the account holder.', +// 'reference': 'YOUR_REFERENCE', +// 'id': 'AH00000000000000000001' +// }, +// 'amount': { +// 'currency': 'EUR', +// 'value': -145050 +// }, +// 'liableBalanceAccountId': 'BA11111111111111111111', +// 'negativeBalanceSince': '2024-10-19T00:33:13+02:00', +// 'scheduledCompensationAt': '2024-12-01T01:00:00+01:00' +// }, +// 'environment': 'test', +// 'timestamp': '2024-10-22T00:00:00+02:00', +// 'type': 'balancePlatform.negativeBalanceCompensationWarning.scheduled' +// }"; +// +// // Act +// _balancePlatformWebhookHandler.GetNegativeBalanceCompensationWarningNotificationRequest(jsonPayload, out NegativeBalanceCompensationWarningNotificationRequest target); +// +// // Assert +// Assert.IsNotNull(target); +// Assert.AreEqual(NegativeBalanceCompensationWarningNotificationRequest.TypeEnum.BalancePlatformNegativeBalanceCompensationWarningScheduled, target.Type); +// Assert.AreEqual("YOUR_BALANCE_PLATFORM", target.Data.BalancePlatform); +// Assert.AreEqual(DateTime.Parse("2024-07-02T02:01:08+02:00"), target.Data.CreationDate); +// Assert.AreEqual("BA00000000000000000001", target.Data.Id); +// Assert.AreEqual("YOUR_REFERENCE", target.Data.AccountHolder.Reference); +// Assert.AreEqual("EUR", target.Data.Amount.Currency); +// Assert.AreEqual(-145050, target.Data.Amount.Value); +// Assert.AreEqual("BA11111111111111111111", target.Data.LiableBalanceAccountId); +// Assert.AreEqual(DateTime.Parse("2024-10-19T00:33:13+02:00"), target.Data.NegativeBalanceSince); +// Assert.AreEqual(DateTime.Parse("2024-12-01T01:00:00+01:00"), target.Data.ScheduledCompensationAt); +// Assert.AreEqual("test", target.Environment); +// Assert.AreEqual(DateTime.Parse("2024-10-22T00:00:00+02:00"), target.Timestamp); +// } +// } +// } \ No newline at end of file diff --git a/Adyen.Test/WebhooksTests/ManagementWebhookHandlerTest.cs b/Adyen.Test/WebhooksTests/ManagementWebhookHandlerTest.cs index 2e7d4d78b..0c891d80f 100644 --- a/Adyen.Test/WebhooksTests/ManagementWebhookHandlerTest.cs +++ b/Adyen.Test/WebhooksTests/ManagementWebhookHandlerTest.cs @@ -1,124 +1,124 @@ -using System; -using Adyen.Model.ManagementWebhooks; -using Adyen.Webhooks; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test.WebhooksTests -{ - [TestClass] - public class ManagementWebhookHandlerTest : BaseTest - { - private readonly ManagementWebhookHandler _managementWebhookHandler = new ManagementWebhookHandler(); - - [TestMethod] - public void Test_Management_Webhook_PaymentMethodCreated() - { - // Arrange - const string jsonPayload = @" -{ - 'createdAt': '2022-01-24T14:59:11+01:00', - 'data': { - 'id': 'PM3224R223224K5FH4M2K9B86', - 'merchantId': 'MERCHANT_ACCOUNT', - 'status': 'SUCCESS', - 'storeId': 'ST322LJ223223K5F4SQNR9XL5', - 'type': 'visa' - }, - 'environment': 'test', - 'type': 'paymentMethod.created' -}"; - // Act - _managementWebhookHandler.GetPaymentMethodCreatedNotificationRequest(jsonPayload, out PaymentMethodCreatedNotificationRequest paymentMethodCreatedWebhook); - - // Assert - Assert.IsNotNull(paymentMethodCreatedWebhook); - Assert.AreEqual(PaymentMethodCreatedNotificationRequest.TypeEnum.PaymentMethodCreated, paymentMethodCreatedWebhook.Type); - Assert.AreEqual(paymentMethodCreatedWebhook.Data.Id, "PM3224R223224K5FH4M2K9B86"); - Assert.AreEqual(paymentMethodCreatedWebhook.Data.MerchantId, "MERCHANT_ACCOUNT"); - Assert.AreEqual(paymentMethodCreatedWebhook.Data.Status, MidServiceNotificationData.StatusEnum.Success); - Assert.AreEqual(paymentMethodCreatedWebhook.Data.StoreId, "ST322LJ223223K5F4SQNR9XL5"); - Assert.AreEqual(paymentMethodCreatedWebhook.Data.Type, "visa"); - Assert.AreEqual(DateTime.Parse("2022-01-24T14:59:11+01:00"), paymentMethodCreatedWebhook.CreatedAt); - Assert.AreEqual("test", paymentMethodCreatedWebhook.Environment); - } - - [TestMethod] - public void Test_Management_Webhook_MerchantUpdated() - { - // Arrange - const string jsonPayload = @" -{ - 'type': 'merchant.updated', - 'environment': 'test', - 'createdAt': '2022-09-20T13:42:31+02:00', - 'data': { - 'capabilities': { - 'receivePayments': { - 'allowed': true, - 'requested': true, - 'requestedLevel': 'notApplicable', - 'verificationStatus': 'valid' - } - }, - 'legalEntityId': 'LE322KH223222F5GNNW694PZN', - 'merchantId': 'YOUR_MERCHANT_ID', - 'status': 'PreActive' - } -}"; - // Act - _managementWebhookHandler.GetMerchantUpdatedNotificationRequest(jsonPayload, out MerchantUpdatedNotificationRequest target); - - // Assert - Assert.IsNotNull(target); - Assert.AreEqual(target.Type, MerchantUpdatedNotificationRequest.TypeEnum.MerchantUpdated); - Assert.AreEqual("LE322KH223222F5GNNW694PZN", target.Data.LegalEntityId); - Assert.AreEqual("YOUR_MERCHANT_ID", target.Data.MerchantId); - Assert.AreEqual("PreActive", target.Data.Status); - Assert.AreEqual(DateTime.Parse("2022-09-20T13:42:31+02:00"), target.CreatedAt); - Assert.AreEqual("test", target.Environment); - - Assert.IsTrue(target.Data.Capabilities.TryGetValue("receivePayments", out AccountCapabilityData accountCapabilityData)); - Assert.AreEqual(true, accountCapabilityData.Requested); - Assert.AreEqual("notApplicable", accountCapabilityData.RequestedLevel); - } - - [TestMethod] - public void Test_Management_Webhook_MerchantCreated() - { - // Arrange - const string jsonPayload = @" -{ - 'type': 'merchant.created', - 'environment': 'test', - 'createdAt': '2022-08-12T10:50:01+02:00', - 'data': { - 'capabilities': { - 'sendToTransferInstrument': { - 'requested': true, - 'requestedLevel': 'notApplicable' - } - }, - 'companyId': 'YOUR_COMPANY_ID', - 'merchantId': 'MC3224X22322535GH8D537TJR', - 'status': 'PreActive' - } -}"; - Assert.IsFalse(_managementWebhookHandler.GetMerchantUpdatedNotificationRequest(jsonPayload, out _)); - - // Act - _managementWebhookHandler.GetMerchantCreatedNotificationRequest(jsonPayload, out MerchantCreatedNotificationRequest target); - - // Assert - Assert.IsNotNull(target); - Assert.AreEqual(MerchantCreatedNotificationRequest.TypeEnum.MerchantCreated, target.Type); - Assert.AreEqual("test", target.Environment); - Assert.AreEqual("YOUR_COMPANY_ID", target.Data.CompanyId); - Assert.AreEqual("MC3224X22322535GH8D537TJR", target.Data.MerchantId); - Assert.AreEqual("PreActive", target.Data.Status); - Assert.AreEqual(DateTime.Parse("2022-08-12T10:50:01+02:00"), target.CreatedAt); - Assert.IsTrue(target.Data.Capabilities.TryGetValue("sendToTransferInstrument", out AccountCapabilityData data)); - Assert.AreEqual("notApplicable", data.RequestedLevel); - Assert.AreEqual(true, data.Requested); - } - } -} \ No newline at end of file +// using System; +// using Adyen.Model.ManagementWebhooks; +// using Adyen.Webhooks; +// using Microsoft.VisualStudio.TestTools.UnitTesting; +// +// namespace Adyen.Test.WebhooksTests +// { +// [TestClass] +// public class ManagementWebhookHandlerTest : BaseTest +// { +// private readonly ManagementWebhookHandler _managementWebhookHandler = new ManagementWebhookHandler(); +// +// [TestMethod] +// public void Test_Management_Webhook_PaymentMethodCreated() +// { +// // Arrange +// const string jsonPayload = @" +// { +// 'createdAt': '2022-01-24T14:59:11+01:00', +// 'data': { +// 'id': 'PM3224R223224K5FH4M2K9B86', +// 'merchantId': 'MERCHANT_ACCOUNT', +// 'status': 'SUCCESS', +// 'storeId': 'ST322LJ223223K5F4SQNR9XL5', +// 'type': 'visa' +// }, +// 'environment': 'test', +// 'type': 'paymentMethod.created' +// }"; +// // Act +// _managementWebhookHandler.GetPaymentMethodCreatedNotificationRequest(jsonPayload, out PaymentMethodCreatedNotificationRequest paymentMethodCreatedWebhook); +// +// // Assert +// Assert.IsNotNull(paymentMethodCreatedWebhook); +// Assert.AreEqual(PaymentMethodCreatedNotificationRequest.TypeEnum.PaymentMethodCreated, paymentMethodCreatedWebhook.Type); +// Assert.AreEqual(paymentMethodCreatedWebhook.Data.Id, "PM3224R223224K5FH4M2K9B86"); +// Assert.AreEqual(paymentMethodCreatedWebhook.Data.MerchantId, "MERCHANT_ACCOUNT"); +// Assert.AreEqual(paymentMethodCreatedWebhook.Data.Status, MidServiceNotificationData.StatusEnum.Success); +// Assert.AreEqual(paymentMethodCreatedWebhook.Data.StoreId, "ST322LJ223223K5F4SQNR9XL5"); +// Assert.AreEqual(paymentMethodCreatedWebhook.Data.Type, "visa"); +// Assert.AreEqual(DateTime.Parse("2022-01-24T14:59:11+01:00"), paymentMethodCreatedWebhook.CreatedAt); +// Assert.AreEqual("test", paymentMethodCreatedWebhook.Environment); +// } +// +// [TestMethod] +// public void Test_Management_Webhook_MerchantUpdated() +// { +// // Arrange +// const string jsonPayload = @" +// { +// 'type': 'merchant.updated', +// 'environment': 'test', +// 'createdAt': '2022-09-20T13:42:31+02:00', +// 'data': { +// 'capabilities': { +// 'receivePayments': { +// 'allowed': true, +// 'requested': true, +// 'requestedLevel': 'notApplicable', +// 'verificationStatus': 'valid' +// } +// }, +// 'legalEntityId': 'LE322KH223222F5GNNW694PZN', +// 'merchantId': 'YOUR_MERCHANT_ID', +// 'status': 'PreActive' +// } +// }"; +// // Act +// _managementWebhookHandler.GetMerchantUpdatedNotificationRequest(jsonPayload, out MerchantUpdatedNotificationRequest target); +// +// // Assert +// Assert.IsNotNull(target); +// Assert.AreEqual(target.Type, MerchantUpdatedNotificationRequest.TypeEnum.MerchantUpdated); +// Assert.AreEqual("LE322KH223222F5GNNW694PZN", target.Data.LegalEntityId); +// Assert.AreEqual("YOUR_MERCHANT_ID", target.Data.MerchantId); +// Assert.AreEqual("PreActive", target.Data.Status); +// Assert.AreEqual(DateTime.Parse("2022-09-20T13:42:31+02:00"), target.CreatedAt); +// Assert.AreEqual("test", target.Environment); +// +// Assert.IsTrue(target.Data.Capabilities.TryGetValue("receivePayments", out AccountCapabilityData accountCapabilityData)); +// Assert.AreEqual(true, accountCapabilityData.Requested); +// Assert.AreEqual("notApplicable", accountCapabilityData.RequestedLevel); +// } +// +// [TestMethod] +// public void Test_Management_Webhook_MerchantCreated() +// { +// // Arrange +// const string jsonPayload = @" +// { +// 'type': 'merchant.created', +// 'environment': 'test', +// 'createdAt': '2022-08-12T10:50:01+02:00', +// 'data': { +// 'capabilities': { +// 'sendToTransferInstrument': { +// 'requested': true, +// 'requestedLevel': 'notApplicable' +// } +// }, +// 'companyId': 'YOUR_COMPANY_ID', +// 'merchantId': 'MC3224X22322535GH8D537TJR', +// 'status': 'PreActive' +// } +// }"; +// Assert.IsFalse(_managementWebhookHandler.GetMerchantUpdatedNotificationRequest(jsonPayload, out _)); +// +// // Act +// _managementWebhookHandler.GetMerchantCreatedNotificationRequest(jsonPayload, out MerchantCreatedNotificationRequest target); +// +// // Assert +// Assert.IsNotNull(target); +// Assert.AreEqual(MerchantCreatedNotificationRequest.TypeEnum.MerchantCreated, target.Type); +// Assert.AreEqual("test", target.Environment); +// Assert.AreEqual("YOUR_COMPANY_ID", target.Data.CompanyId); +// Assert.AreEqual("MC3224X22322535GH8D537TJR", target.Data.MerchantId); +// Assert.AreEqual("PreActive", target.Data.Status); +// Assert.AreEqual(DateTime.Parse("2022-08-12T10:50:01+02:00"), target.CreatedAt); +// Assert.IsTrue(target.Data.Capabilities.TryGetValue("sendToTransferInstrument", out AccountCapabilityData data)); +// Assert.AreEqual("notApplicable", data.RequestedLevel); +// Assert.AreEqual(true, data.Requested); +// } +// } +// } \ No newline at end of file diff --git a/Adyen.Test/WebhooksTests/WebhookHandlerTest.cs b/Adyen.Test/WebhooksTests/WebhookHandlerTest.cs index 0b60812e3..ae4f1e202 100644 --- a/Adyen.Test/WebhooksTests/WebhookHandlerTest.cs +++ b/Adyen.Test/WebhooksTests/WebhookHandlerTest.cs @@ -1,173 +1,173 @@ -using System; -using System.Linq; -using Adyen.ApiSerialization; -using Adyen.Model.TerminalApi; -using Adyen.Webhooks; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Adyen.Test.WebhooksTests -{ - [TestClass] - public class WebhookHandlerTest : BaseTest - { - [TestMethod] - public void TestAuthorisationSuccess() - { - var mockPath = GetMockFilePath("mocks/notification/authorisation-true.json"); - var jsonRequest = MockFileToString(mockPath); - var webhookHandler = new WebhookHandler(); - var handleNotificationRequest = webhookHandler.HandleNotificationRequest(jsonRequest); - var notificationRequestItemContainer = handleNotificationRequest.NotificationItemContainers.FirstOrDefault(); - if (notificationRequestItemContainer == null) - Assert.Fail("NotificationRequestItemContainer is null"); - var notificationItem = notificationRequestItemContainer.NotificationItem; - Assert.AreEqual("AUTHORISATION", notificationItem.EventCode); - Assert.AreEqual("1234", notificationItem.AdditionalData["authCode"]); - Assert.AreEqual("123456789", notificationItem.PspReference); - } - - [TestMethod] - public void TestMerchantWebhookPayload() - { - var mockPath = GetMockFilePath("mocks/notification/merchant-webhook-payload.json"); - var jsonRequest = MockFileToString(mockPath); - var webhookHandler = new WebhookHandler(); - var handleNotificationRequest = webhookHandler.HandleNotificationRequest(jsonRequest); - var json1 = JsonConvert.SerializeObject(handleNotificationRequest); - var json2 = jsonRequest; - Assert.IsTrue(JToken.DeepEquals(JToken.Parse(json1.ToLower()), JToken.Parse(json2.ToLower()))); - } - - [TestMethod] - public void TestCaptureSuccess() - { - var mockPath = GetMockFilePath("mocks/notification/capture-true.json"); - var jsonRequest = MockFileToString(mockPath); - var webhookHandler = new WebhookHandler(); - var handleNotificationRequest = webhookHandler.HandleNotificationRequest(jsonRequest); - var notificationRequestItemContainer = handleNotificationRequest.NotificationItemContainers.FirstOrDefault(); - if (notificationRequestItemContainer == null) - Assert.Fail("NotificationRequestItemContainer is null"); - var notificationItem = notificationRequestItemContainer.NotificationItem; - Assert.AreEqual("CAPTURE", notificationItem.EventCode); - Assert.AreEqual("qvS6I3Gdi1jx+jSh7IopAgcHtMoxvXlNL7DYQ+j1hd0=", notificationItem.AdditionalData["hmacSignature"]); - Assert.AreEqual("PSP_REFERENCE", notificationItem.PspReference); - Assert.AreEqual(23623, notificationItem.Amount.Value); - Assert.IsTrue(notificationItem.Success); - } - - [TestMethod] - public void TestCaptureFail() - { - var mockPath = GetMockFilePath("mocks/notification/capture-false.json"); - var jsonRequest = MockFileToString(mockPath); - var webhookHandler = new WebhookHandler(); - var handleNotificationRequest = webhookHandler.HandleNotificationRequest(jsonRequest); - var notificationRequestItemContainer = handleNotificationRequest.NotificationItemContainers.FirstOrDefault(); - if (notificationRequestItemContainer == null) - Assert.Fail("NotificationRequestItemContainer is null"); - var notificationItem = notificationRequestItemContainer.NotificationItem; - Assert.AreEqual("CAPTURE", notificationItem.EventCode); - Assert.AreEqual("KujHNqpyCAMdGefj7lfQ8AeD0Jke9Zs2bVAqScQDWi4=", notificationItem.AdditionalData["hmacSignature"]); - Assert.AreEqual("PSP_REFERENCE", notificationItem.PspReference); - Assert.AreEqual(23623, notificationItem.Amount.Value); - Assert.IsFalse(notificationItem.Success); - Assert.AreEqual("Insufficient balance on payment", notificationItem.Reason); - } - - [TestMethod] - public void TestRefundSuccess() - { - var mockPath = GetMockFilePath("mocks/notification/refund-true.json"); - var jsonRequest = MockFileToString(mockPath); - var webhookHandler = new WebhookHandler(); - var handleNotificationRequest = webhookHandler.HandleNotificationRequest(jsonRequest); - var notificationRequestItemContainer = handleNotificationRequest.NotificationItemContainers.FirstOrDefault(); - if (notificationRequestItemContainer == null) - Assert.Fail("NotificationRequestItemContainer is null"); - var notificationItem = notificationRequestItemContainer.NotificationItem; - Assert.AreEqual("REFUND", notificationItem.EventCode); - Assert.AreEqual("KJFhURWP8Pv9m8k+7NGHNJAupBj6X6J/VWAikFxeWhA=", notificationItem.AdditionalData["hmacSignature"]); - Assert.AreEqual("PSP_REFERENCE", notificationItem.PspReference); - Assert.AreEqual(1500, notificationItem.Amount.Value); - Assert.AreEqual("MagentoMerchantTest2", notificationItem.MerchantAccountCode); - Assert.IsTrue(notificationItem.Success); - } - - [TestMethod] - public void TestRefundFail() - { - var mockPath = GetMockFilePath("mocks/notification/refund-false.json"); - var jsonRequest = MockFileToString(mockPath); - var webhookHandler = new WebhookHandler(); - var handleNotificationRequest = webhookHandler.HandleNotificationRequest(jsonRequest); - var notificationRequestItemContainer = handleNotificationRequest.NotificationItemContainers.FirstOrDefault(); - if (notificationRequestItemContainer == null) - Assert.Fail("NotificationRequestItemContainer is null"); - var notificationItem = notificationRequestItemContainer.NotificationItem; - Assert.AreEqual("REFUND", notificationItem.EventCode); - Assert.AreEqual("HZXziBYopfDIzDhk49iC//yCfxmy/z0xWuvvTxFNUSA=", notificationItem.AdditionalData["hmacSignature"]); - Assert.AreEqual("PSP_REFERENCE", notificationItem.PspReference); - Assert.AreEqual(1500, notificationItem.Amount.Value); - Assert.IsFalse(notificationItem.Success); - Assert.AreEqual("Insufficient balance on payment", notificationItem.Reason); - } - - [TestMethod] - public void TestPOSDisplayNotification() - { - var notification = - "{\"SaleToPOIRequest\":{\"DisplayRequest\":{\"DisplayOutput\":[{\"Device\": \"CashierDisplay\",\"InfoQualify\": \"Status\",\"OutputContent\": {\"OutputFormat\": \"MessageRef\",\"PredefinedContent\": {\"ReferenceID\": \"TransactionID=oLkO001517998574000&TimeStamp=2018-02-07T10%3a16%3a14.000Z&event=TENDER_CREATED\"}},\"ResponseRequiredFlag\": false}]},\"MessageHeader\":{\"SaleID\":\"POSSystemID12345\",\"ProtocolVersion\":\"3.0\",\"MessageType\":\"Request\",\"POIID\":\"V400m-324688179\",\"ServiceID\":\"0207111617\",\"MessageClass\":\"Device\",\"MessageCategory\":\"Display\",\"DeviceID\":\"1517998562\"}}}"; - var serializer = new SaleToPoiMessageSerializer(); - var saleToPoiRequest = serializer.DeserializeNotification(notification); - var displayRequest = (DisplayRequest)saleToPoiRequest.MessagePayload; - Assert.AreEqual(displayRequest.DisplayOutput[0].OutputContent.OutputFormat, OutputFormatType.MessageRef); - Assert.AreEqual(displayRequest.DisplayOutput[0].Device, DeviceType.CashierDisplay); - } - - [TestMethod] - public void TestPOSEventNotification() - { - var notification = @"{ - 'SaleToPOIRequest':{ - 'EventNotification':{ - 'EventDetails':'newstate=IDLE&oldstate=START', - 'EventToNotify':'Shutdown', - 'TimeStamp':'2019-08-07T10:16:10.000Z' - }, - 'MessageHeader':{ - 'SaleID':'POSSystemID12345', - 'ProtocolVersion':'3.0', - 'MessageType':'Notification', - 'POIID':'V400m-324688179', - 'MessageClass':'Event', - 'MessageCategory':'Event', - 'DeviceID':'1517998561' - } - } - }"; - var serializer = new SaleToPoiMessageSerializer(); - var saleToPoiRequest = serializer.DeserializeNotification(notification); - var eventNotification = (EventNotification) saleToPoiRequest.MessagePayload; - Assert.AreEqual(eventNotification.EventDetails, "newstate=IDLE&oldstate=START"); - Assert.AreEqual(eventNotification.TimeStamp, new DateTime(2019, 8, 7, 10, 16, 10)); - } - - [TestMethod] - public void TestClassicPlatformWebhookParser() - { - var mockPath = GetMockFilePath("mocks/notification/classic-platform-webhook.json"); - var payload = MockFileToString(mockPath); - - var parser = new ClassicPlatformWebhookHandler(); - Assert.IsTrue(parser.GetTransferFundsNotification(payload, out var webhook)); - Assert.IsFalse(parser.GetAccountCloseNotification(payload, out _)); - - JObject expected = (JObject)JsonConvert.DeserializeObject(payload); - JObject result = (JObject)JsonConvert.DeserializeObject(webhook.ToJson()); - Assert.IsTrue(JToken.DeepEquals(expected, result)); - } - } -} +// using System; +// using System.Linq; +// using Adyen.ApiSerialization; +// using Adyen.Model.TerminalApi; +// using Adyen.Webhooks; +// using Microsoft.VisualStudio.TestTools.UnitTesting; +// using Newtonsoft.Json; +// using Newtonsoft.Json.Linq; +// +// namespace Adyen.Test.WebhooksTests +// { +// [TestClass] +// public class WebhookHandlerTest : BaseTest +// { +// [TestMethod] +// public void TestAuthorisationSuccess() +// { +// var mockPath = GetMockFilePath("mocks/notification/authorisation-true.json"); +// var jsonRequest = MockFileToString(mockPath); +// var webhookHandler = new WebhookHandler(); +// var handleNotificationRequest = webhookHandler.HandleNotificationRequest(jsonRequest); +// var notificationRequestItemContainer = handleNotificationRequest.NotificationItemContainers.FirstOrDefault(); +// if (notificationRequestItemContainer == null) +// Assert.Fail("NotificationRequestItemContainer is null"); +// var notificationItem = notificationRequestItemContainer.NotificationItem; +// Assert.AreEqual("AUTHORISATION", notificationItem.EventCode); +// Assert.AreEqual("1234", notificationItem.AdditionalData["authCode"]); +// Assert.AreEqual("123456789", notificationItem.PspReference); +// } +// +// [TestMethod] +// public void TestMerchantWebhookPayload() +// { +// var mockPath = GetMockFilePath("mocks/notification/merchant-webhook-payload.json"); +// var jsonRequest = MockFileToString(mockPath); +// var webhookHandler = new WebhookHandler(); +// var handleNotificationRequest = webhookHandler.HandleNotificationRequest(jsonRequest); +// var json1 = JsonConvert.SerializeObject(handleNotificationRequest); +// var json2 = jsonRequest; +// Assert.IsTrue(JToken.DeepEquals(JToken.Parse(json1.ToLower()), JToken.Parse(json2.ToLower()))); +// } +// +// [TestMethod] +// public void TestCaptureSuccess() +// { +// var mockPath = GetMockFilePath("mocks/notification/capture-true.json"); +// var jsonRequest = MockFileToString(mockPath); +// var webhookHandler = new WebhookHandler(); +// var handleNotificationRequest = webhookHandler.HandleNotificationRequest(jsonRequest); +// var notificationRequestItemContainer = handleNotificationRequest.NotificationItemContainers.FirstOrDefault(); +// if (notificationRequestItemContainer == null) +// Assert.Fail("NotificationRequestItemContainer is null"); +// var notificationItem = notificationRequestItemContainer.NotificationItem; +// Assert.AreEqual("CAPTURE", notificationItem.EventCode); +// Assert.AreEqual("qvS6I3Gdi1jx+jSh7IopAgcHtMoxvXlNL7DYQ+j1hd0=", notificationItem.AdditionalData["hmacSignature"]); +// Assert.AreEqual("PSP_REFERENCE", notificationItem.PspReference); +// Assert.AreEqual(23623, notificationItem.Amount.Value); +// Assert.IsTrue(notificationItem.Success); +// } +// +// [TestMethod] +// public void TestCaptureFail() +// { +// var mockPath = GetMockFilePath("mocks/notification/capture-false.json"); +// var jsonRequest = MockFileToString(mockPath); +// var webhookHandler = new WebhookHandler(); +// var handleNotificationRequest = webhookHandler.HandleNotificationRequest(jsonRequest); +// var notificationRequestItemContainer = handleNotificationRequest.NotificationItemContainers.FirstOrDefault(); +// if (notificationRequestItemContainer == null) +// Assert.Fail("NotificationRequestItemContainer is null"); +// var notificationItem = notificationRequestItemContainer.NotificationItem; +// Assert.AreEqual("CAPTURE", notificationItem.EventCode); +// Assert.AreEqual("KujHNqpyCAMdGefj7lfQ8AeD0Jke9Zs2bVAqScQDWi4=", notificationItem.AdditionalData["hmacSignature"]); +// Assert.AreEqual("PSP_REFERENCE", notificationItem.PspReference); +// Assert.AreEqual(23623, notificationItem.Amount.Value); +// Assert.IsFalse(notificationItem.Success); +// Assert.AreEqual("Insufficient balance on payment", notificationItem.Reason); +// } +// +// [TestMethod] +// public void TestRefundSuccess() +// { +// var mockPath = GetMockFilePath("mocks/notification/refund-true.json"); +// var jsonRequest = MockFileToString(mockPath); +// var webhookHandler = new WebhookHandler(); +// var handleNotificationRequest = webhookHandler.HandleNotificationRequest(jsonRequest); +// var notificationRequestItemContainer = handleNotificationRequest.NotificationItemContainers.FirstOrDefault(); +// if (notificationRequestItemContainer == null) +// Assert.Fail("NotificationRequestItemContainer is null"); +// var notificationItem = notificationRequestItemContainer.NotificationItem; +// Assert.AreEqual("REFUND", notificationItem.EventCode); +// Assert.AreEqual("KJFhURWP8Pv9m8k+7NGHNJAupBj6X6J/VWAikFxeWhA=", notificationItem.AdditionalData["hmacSignature"]); +// Assert.AreEqual("PSP_REFERENCE", notificationItem.PspReference); +// Assert.AreEqual(1500, notificationItem.Amount.Value); +// Assert.AreEqual("MagentoMerchantTest2", notificationItem.MerchantAccountCode); +// Assert.IsTrue(notificationItem.Success); +// } +// +// [TestMethod] +// public void TestRefundFail() +// { +// var mockPath = GetMockFilePath("mocks/notification/refund-false.json"); +// var jsonRequest = MockFileToString(mockPath); +// var webhookHandler = new WebhookHandler(); +// var handleNotificationRequest = webhookHandler.HandleNotificationRequest(jsonRequest); +// var notificationRequestItemContainer = handleNotificationRequest.NotificationItemContainers.FirstOrDefault(); +// if (notificationRequestItemContainer == null) +// Assert.Fail("NotificationRequestItemContainer is null"); +// var notificationItem = notificationRequestItemContainer.NotificationItem; +// Assert.AreEqual("REFUND", notificationItem.EventCode); +// Assert.AreEqual("HZXziBYopfDIzDhk49iC//yCfxmy/z0xWuvvTxFNUSA=", notificationItem.AdditionalData["hmacSignature"]); +// Assert.AreEqual("PSP_REFERENCE", notificationItem.PspReference); +// Assert.AreEqual(1500, notificationItem.Amount.Value); +// Assert.IsFalse(notificationItem.Success); +// Assert.AreEqual("Insufficient balance on payment", notificationItem.Reason); +// } +// +// [TestMethod] +// public void TestPOSDisplayNotification() +// { +// var notification = +// "{\"SaleToPOIRequest\":{\"DisplayRequest\":{\"DisplayOutput\":[{\"Device\": \"CashierDisplay\",\"InfoQualify\": \"Status\",\"OutputContent\": {\"OutputFormat\": \"MessageRef\",\"PredefinedContent\": {\"ReferenceID\": \"TransactionID=oLkO001517998574000&TimeStamp=2018-02-07T10%3a16%3a14.000Z&event=TENDER_CREATED\"}},\"ResponseRequiredFlag\": false}]},\"MessageHeader\":{\"SaleID\":\"POSSystemID12345\",\"ProtocolVersion\":\"3.0\",\"MessageType\":\"Request\",\"POIID\":\"V400m-324688179\",\"ServiceID\":\"0207111617\",\"MessageClass\":\"Device\",\"MessageCategory\":\"Display\",\"DeviceID\":\"1517998562\"}}}"; +// var serializer = new SaleToPoiMessageSerializer(); +// var saleToPoiRequest = serializer.DeserializeNotification(notification); +// var displayRequest = (DisplayRequest)saleToPoiRequest.MessagePayload; +// Assert.AreEqual(displayRequest.DisplayOutput[0].OutputContent.OutputFormat, OutputFormatType.MessageRef); +// Assert.AreEqual(displayRequest.DisplayOutput[0].Device, DeviceType.CashierDisplay); +// } +// +// [TestMethod] +// public void TestPOSEventNotification() +// { +// var notification = @"{ +// 'SaleToPOIRequest':{ +// 'EventNotification':{ +// 'EventDetails':'newstate=IDLE&oldstate=START', +// 'EventToNotify':'Shutdown', +// 'TimeStamp':'2019-08-07T10:16:10.000Z' +// }, +// 'MessageHeader':{ +// 'SaleID':'POSSystemID12345', +// 'ProtocolVersion':'3.0', +// 'MessageType':'Notification', +// 'POIID':'V400m-324688179', +// 'MessageClass':'Event', +// 'MessageCategory':'Event', +// 'DeviceID':'1517998561' +// } +// } +// }"; +// var serializer = new SaleToPoiMessageSerializer(); +// var saleToPoiRequest = serializer.DeserializeNotification(notification); +// var eventNotification = (EventNotification) saleToPoiRequest.MessagePayload; +// Assert.AreEqual(eventNotification.EventDetails, "newstate=IDLE&oldstate=START"); +// Assert.AreEqual(eventNotification.TimeStamp, new DateTime(2019, 8, 7, 10, 16, 10)); +// } +// +// [TestMethod] +// public void TestClassicPlatformWebhookParser() +// { +// var mockPath = GetMockFilePath("mocks/notification/classic-platform-webhook.json"); +// var payload = MockFileToString(mockPath); +// +// var parser = new ClassicPlatformWebhookHandler(); +// Assert.IsTrue(parser.GetTransferFundsNotification(payload, out var webhook)); +// Assert.IsFalse(parser.GetAccountCloseNotification(payload, out _)); +// +// JObject expected = (JObject)JsonConvert.DeserializeObject(payload); +// JObject result = (JObject)JsonConvert.DeserializeObject(webhook.ToJson()); +// Assert.IsTrue(JToken.DeepEquals(expected, result)); +// } +// } +// } diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index 9d617273d..f7f7a4088 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -58,7 +58,6 @@ - diff --git a/Adyen/Util/ByteArrayConverter.cs b/Adyen/Util/ByteArrayConverter.cs index e10849389..96dce3d5c 100644 --- a/Adyen/Util/ByteArrayConverter.cs +++ b/Adyen/Util/ByteArrayConverter.cs @@ -4,25 +4,5 @@ namespace Adyen.Util { - internal class ByteArrayConverter : JsonConverter - { - public override bool CanConvert(Type objectType) - { - return objectType == typeof(byte[]); - } - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - if (reader.TokenType == JsonToken.Null) - return null; - return Encoding.UTF8.GetBytes((string)reader.Value); - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - byte[] bytes = (byte[])value; - writer.WriteValue(Encoding.UTF8.GetString(bytes)); - } - - } + } \ No newline at end of file diff --git a/Adyen/Util/JsonOperation.cs b/Adyen/Util/JsonOperation.cs index 4cefb5981..2135a8613 100644 --- a/Adyen/Util/JsonOperation.cs +++ b/Adyen/Util/JsonOperation.cs @@ -4,29 +4,17 @@ namespace Adyen.Util { public class JsonOperation { - /// - /// Deserialize to an object T - /// - /// - /// - /// - public static T Deserialize(string response) - { - var jsonSettings = new JsonSerializerSettings(); - jsonSettings.Converters.Add(new ByteArrayConverter()); - - return JsonConvert.DeserializeObject(response, jsonSettings); - } + - public static string SerializeRequest(object request) - { - var jsonSettings = new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Include, - }; - jsonSettings.Converters.Add(new ByteArrayConverter()); - return JsonConvert.SerializeObject(request, Formatting.None, jsonSettings); - } + // public static string SerializeRequest(object request) + // { + // var jsonSettings = new JsonSerializerSettings + // { + // NullValueHandling = NullValueHandling.Ignore, + // DefaultValueHandling = DefaultValueHandling.Include, + // }; + // jsonSettings.Converters.Add(new ByteArrayConverter()); + // return JsonConvert.SerializeObject(request, Formatting.None, jsonSettings); + // } } } diff --git a/Adyen/WebhookHandlers/BalancePlatformWebhookHandler.cs b/Adyen/WebhookHandlers/BalancePlatformWebhookHandler.cs deleted file mode 100644 index 1e4a72b4e..000000000 --- a/Adyen/WebhookHandlers/BalancePlatformWebhookHandler.cs +++ /dev/null @@ -1,243 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Runtime.Serialization; -using Adyen.Model.AcsWebhooks; -using Adyen.Model.ReportWebhooks; -using Adyen.Model.ConfigurationWebhooks; -using Adyen.Model.NegativeBalanceWarningWebhooks; -using Adyen.Model.TransactionWebhooks; -using Adyen.Model.TransferWebhooks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Adyen.Webhooks -{ - public class BalancePlatformWebhookHandler - { - /// - /// Deserializes to a generic banking webhook from the . Use this either to catch the - /// webhook type if unknown or if the explicit type is not required. - /// - /// The json payload of the webhook. - /// The parsed webhook packaged in a dynamic object. - /// Throws when json is invalid. - public dynamic GetGenericBalancePlatformWebhook(string jsonPayload) - { - if (GetAuthenticationNotificationRequest(jsonPayload, out AuthenticationNotificationRequest authenticationNotificationRequest)) - { - return authenticationNotificationRequest; - } - - if (GetAccountHolderNotificationRequest(jsonPayload, out AccountHolderNotificationRequest accountHolderNotificationRequest)) - { - return accountHolderNotificationRequest; - } - - if (GetBalanceAccountNotificationRequest(jsonPayload, out BalanceAccountNotificationRequest balanceAccountNotificationRequest)) - { - return balanceAccountNotificationRequest; - } - - if (GetCardOrderNotificationRequest(jsonPayload, out CardOrderNotificationRequest cardOrderNotificationRequest)) - { - return cardOrderNotificationRequest; - } - - if (GetNegativeBalanceCompensationWarningNotificationRequest(jsonPayload, out NegativeBalanceCompensationWarningNotificationRequest negativeBalanceCompensationWarningNotificationRequest)) - { - return negativeBalanceCompensationWarningNotificationRequest; - } - - if (GetPaymentNotificationRequest(jsonPayload, out PaymentNotificationRequest paymentNotificationRequest)) - { - return paymentNotificationRequest; - } - - if (GetSweepConfigurationNotificationRequest(jsonPayload, out SweepConfigurationNotificationRequest sweepConfigurationNotificationRequest)) - { - return sweepConfigurationNotificationRequest; - } - - if (GetReportNotificationRequest(jsonPayload, out ReportNotificationRequest reportNotificationRequest)) - { - return reportNotificationRequest; - } - if (GetTransferNotificationRequest(jsonPayload, out TransferNotificationRequest transferNotificationRequest)) - { - return transferNotificationRequest; - } - if (GetTransactionNotificationRequestV4(jsonPayload, out TransactionNotificationRequestV4 transactionNotificationRequestV4)) - { - return transactionNotificationRequestV4; - } - throw new JsonReaderException("Could not parse webhook"); - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetAuthenticationNotificationRequest(string jsonPayload, out AuthenticationNotificationRequest result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetAccountHolderNotificationRequest(string jsonPayload, out AccountHolderNotificationRequest result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetBalanceAccountNotificationRequest(string jsonPayload, out BalanceAccountNotificationRequest result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetCardOrderNotificationRequest(string jsonPayload, out CardOrderNotificationRequest result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetPaymentNotificationRequest(string jsonPayload, out PaymentNotificationRequest result) // This class-name is confusing as it's referring to a paymentInstrument -> Rename to PaymentInstrumentNotificationRequest? - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetSweepConfigurationNotificationRequest(string jsonPayload, out SweepConfigurationNotificationRequest result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook.> - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetReportNotificationRequest(string jsonPayload, out ReportNotificationRequest result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetTransferNotificationRequest(string jsonPayload, out TransferNotificationRequest result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetTransactionNotificationRequestV4(string jsonPayload, out TransactionNotificationRequestV4 result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetNegativeBalanceCompensationWarningNotificationRequest(string jsonPayload, out NegativeBalanceCompensationWarningNotificationRequest result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Check if the JSON pyload contains TypeEnum value. - /// - /// The string JSON payload. - /// The TypeEnum of the class. - /// True if the enum is present. - private static bool ContainsValue(string jsonPayload) where T : struct, IConvertible - { - // Retrieve type from payload - JToken typeToken = JObject.Parse(jsonPayload).GetValue("type"); - string type = typeToken?.Value(); - List memberInfos = typeof(T).GetTypeInfo().DeclaredMembers.ToList(); - return memberInfos.Any(memberInfo => memberInfo?.GetCustomAttribute()?.Value == type); - } - } -} \ No newline at end of file diff --git a/Adyen/WebhookHandlers/ClassicPlatformWebhookHandler.cs b/Adyen/WebhookHandlers/ClassicPlatformWebhookHandler.cs deleted file mode 100644 index f488adab7..000000000 --- a/Adyen/WebhookHandlers/ClassicPlatformWebhookHandler.cs +++ /dev/null @@ -1,386 +0,0 @@ -using Adyen.Model.PlatformsWebhooks; -using Newtonsoft.Json; - -namespace Adyen.Webhooks -{ - public class ClassicPlatformWebhookHandler - { - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetAccountCreateNotification(string jsonPayload, out AccountCreateNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "ACCOUNT_CREATED".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetAccountCloseNotification(string jsonPayload, out AccountCloseNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "ACCOUNT_CLOSED".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetAccountFundsBelowThresholdNotification(string jsonPayload, out AccountFundsBelowThresholdNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "ACCOUNT_FUNDS_BELOW_THRESHOLD".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetAccountHolderCreateNotification(string jsonPayload, out AccountHolderCreateNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "ACCOUNT_HOLDER_CREATED".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetAccountHolderPayoutNotification(string jsonPayload, out AccountHolderPayoutNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "ACCOUNT_HOLDER_PAYOUT".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetAccountHolderStatusChangeNotification(string jsonPayload, out AccountHolderStatusChangeNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "ACCOUNT_HOLDER_STATUS_CHANGE".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetAccountHolderUpcomingDeadlineNotification(string jsonPayload, out AccountHolderUpcomingDeadlineNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "ACCOUNT_HOLDER_UPCOMING_DEADLINE".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetAccountHolderUpdateNotification(string jsonPayload, out AccountHolderUpdateNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "ACCOUNT_HOLDER_UPDATED".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetAccountHolderVerificationNotification(string jsonPayload, out AccountHolderVerificationNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "ACCOUNT_HOLDER_VERIFICATION".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetAccountUpdateNotification(string jsonPayload, out AccountUpdateNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "ACCOUNT_UPDATED".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetBeneficiarySetupNotification(string jsonPayload, out BeneficiarySetupNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "BENEFICIARY_SETUP".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetCompensateNegativeBalanceNotification(string jsonPayload, out CompensateNegativeBalanceNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "COMPENSATE_NEGATIVE_BALANCE".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetDirectDebitInitiatedNotification(string jsonPayload, out DirectDebitInitiatedNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "DIRECT_DEBIT_INITIATED".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetPaymentFailureNotification(string jsonPayload, out PaymentFailureNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "PAYMENT_FAILURE".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetRefundFundsTransferNotification(string jsonPayload, out RefundFundsTransferNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "REFUND_FUNDS_TRANSFER".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetReportAvailableNotification(string jsonPayload, out ReportAvailableNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "REPORT_AVAILABLE".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetScheduledRefundsNotification(string jsonPayload, out ScheduledRefundsNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "SCHEDULED_REFUNDS".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetTransferFundsNotification(string jsonPayload, out TransferFundsNotification result) - { - result = null; - try - { - result = JsonConvert.DeserializeObject(jsonPayload); - return "TRANSFER_FUNDS".Equals(result.EventType); - } - catch (JsonSerializationException) - { - return false; - } - } - } -} \ No newline at end of file diff --git a/Adyen/WebhookHandlers/ManagementWebhookHandler.cs b/Adyen/WebhookHandlers/ManagementWebhookHandler.cs deleted file mode 100644 index fbc8b1ee8..000000000 --- a/Adyen/WebhookHandlers/ManagementWebhookHandler.cs +++ /dev/null @@ -1,147 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Runtime.Serialization; -using Adyen.Model.ManagementWebhooks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Adyen.Webhooks -{ - public class ManagementWebhookHandler - { - /// - /// Deserializes to a generic management webhook from the . Use this either to catch the - /// webhook type if unknown or if the explicit type is not required. - /// - /// The json payload of the webhook. - /// The parsed webhook packaged in a dynamic object. - /// Throws when json is invalid. - public dynamic GetGenericManagementWebhook(string jsonPayload) - { - if (GetMerchantCreatedNotificationRequest(jsonPayload, out var merchantCreatedNotificationRequest)) - { - return merchantCreatedNotificationRequest; - } - - if (GetMerchantUpdatedNotificationRequest(jsonPayload, out var merchantUpdatedNotificationRequest)) - { - return merchantUpdatedNotificationRequest; - } - - if (GetPaymentMethodCreatedNotificationRequest(jsonPayload, out var paymentMethodCreatedNotificationRequest)) - { - return paymentMethodCreatedNotificationRequest; - } - - if (GetPaymentMethodRequestRemovedNotificationRequest(jsonPayload, out var PaymentMethodRequestRemovedNotificationRequest)) - { - return PaymentMethodRequestRemovedNotificationRequest; - } - - if (GetPaymentMethodScheduledForRemovalNotificationRequest(jsonPayload, out var PaymentMethodScheduledForRemovalNotificationRequest)) - { - return PaymentMethodScheduledForRemovalNotificationRequest; - } - - throw new JsonReaderException("Could not parse webhook"); - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetMerchantCreatedNotificationRequest(string jsonPayload, out MerchantCreatedNotificationRequest result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetMerchantUpdatedNotificationRequest(string jsonPayload, out MerchantUpdatedNotificationRequest result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetPaymentMethodCreatedNotificationRequest(string jsonPayload, out PaymentMethodCreatedNotificationRequest result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetPaymentMethodRequestRemovedNotificationRequest(string jsonPayload, out PaymentMethodRequestRemovedNotificationRequest result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - /// - /// Deserializes from the . - /// - /// The json payload of the webhook. - /// . - /// A return value indicates whether the deserialization succeeded. - /// Throws when json is invalid. - public bool GetPaymentMethodScheduledForRemovalNotificationRequest(string jsonPayload, out PaymentMethodScheduledForRemovalNotificationRequest result) - { - result = null; - if (!ContainsValue(jsonPayload)) return false; - result = JsonConvert.DeserializeObject(jsonPayload); - return true; - } - - // Check if the contains TypeEnum value - private static bool ContainsValue(string jsonPayload) where T : struct, IConvertible - { - // Retrieve type from payload - JToken typeToken = JObject.Parse(jsonPayload).GetValue("type"); - string type = typeToken?.Value(); - - // Search for type in .TypeEnum - List list = new List(); - var members = typeof(T) - .GetTypeInfo() - .DeclaredMembers; - foreach (var member in members) - { - var val = member?.GetCustomAttribute(false)?.Value; - if (!string.IsNullOrEmpty(val)) - list.Add(val); - } - - return list.Contains(type); - } - } -} \ No newline at end of file diff --git a/Adyen/WebhookHandlers/WebhookHandler.cs b/Adyen/WebhookHandlers/WebhookHandler.cs deleted file mode 100644 index 690c3cbff..000000000 --- a/Adyen/WebhookHandlers/WebhookHandler.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Adyen.Model.Notification; -using Adyen.Util; - -namespace Adyen.Webhooks -{ - public class WebhookHandler - { - public NotificationRequest HandleNotificationRequest(string jsonRequest) - { - return JsonOperation.Deserialize(jsonRequest); - } - } -} diff --git a/Adyen/Webhooks/BalancePlatformWebhookHandler.cs b/Adyen/Webhooks/BalancePlatformWebhookHandler.cs new file mode 100644 index 000000000..03b6fcf7d --- /dev/null +++ b/Adyen/Webhooks/BalancePlatformWebhookHandler.cs @@ -0,0 +1,243 @@ +// using System; +// using System.Collections.Generic; +// using System.Linq; +// using System.Reflection; +// using System.Runtime.Serialization; +// using Adyen.Model.AcsWebhooks; +// using Adyen.Model.ReportWebhooks; +// using Adyen.Model.ConfigurationWebhooks; +// using Adyen.Model.NegativeBalanceWarningWebhooks; +// using Adyen.Model.TransactionWebhooks; +// using Adyen.Model.TransferWebhooks; +// using Newtonsoft.Json; +// using Newtonsoft.Json.Linq; +// +// namespace Adyen.Webhooks +// { +// public class BalancePlatformWebhookHandler +// { +// /// +// /// Deserializes to a generic banking webhook from the . Use this either to catch the +// /// webhook type if unknown or if the explicit type is not required. +// /// +// /// The json payload of the webhook. +// /// The parsed webhook packaged in a dynamic object. +// /// Throws when json is invalid. +// public dynamic GetGenericBalancePlatformWebhook(string jsonPayload) +// { +// if (GetAuthenticationNotificationRequest(jsonPayload, out AuthenticationNotificationRequest authenticationNotificationRequest)) +// { +// return authenticationNotificationRequest; +// } +// +// if (GetAccountHolderNotificationRequest(jsonPayload, out AccountHolderNotificationRequest accountHolderNotificationRequest)) +// { +// return accountHolderNotificationRequest; +// } +// +// if (GetBalanceAccountNotificationRequest(jsonPayload, out BalanceAccountNotificationRequest balanceAccountNotificationRequest)) +// { +// return balanceAccountNotificationRequest; +// } +// +// if (GetCardOrderNotificationRequest(jsonPayload, out CardOrderNotificationRequest cardOrderNotificationRequest)) +// { +// return cardOrderNotificationRequest; +// } +// +// if (GetNegativeBalanceCompensationWarningNotificationRequest(jsonPayload, out NegativeBalanceCompensationWarningNotificationRequest negativeBalanceCompensationWarningNotificationRequest)) +// { +// return negativeBalanceCompensationWarningNotificationRequest; +// } +// +// if (GetPaymentNotificationRequest(jsonPayload, out PaymentNotificationRequest paymentNotificationRequest)) +// { +// return paymentNotificationRequest; +// } +// +// if (GetSweepConfigurationNotificationRequest(jsonPayload, out SweepConfigurationNotificationRequest sweepConfigurationNotificationRequest)) +// { +// return sweepConfigurationNotificationRequest; +// } +// +// if (GetReportNotificationRequest(jsonPayload, out ReportNotificationRequest reportNotificationRequest)) +// { +// return reportNotificationRequest; +// } +// if (GetTransferNotificationRequest(jsonPayload, out TransferNotificationRequest transferNotificationRequest)) +// { +// return transferNotificationRequest; +// } +// if (GetTransactionNotificationRequestV4(jsonPayload, out TransactionNotificationRequestV4 transactionNotificationRequestV4)) +// { +// return transactionNotificationRequestV4; +// } +// throw new JsonReaderException("Could not parse webhook"); +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetAuthenticationNotificationRequest(string jsonPayload, out AuthenticationNotificationRequest result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetAccountHolderNotificationRequest(string jsonPayload, out AccountHolderNotificationRequest result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetBalanceAccountNotificationRequest(string jsonPayload, out BalanceAccountNotificationRequest result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetCardOrderNotificationRequest(string jsonPayload, out CardOrderNotificationRequest result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetPaymentNotificationRequest(string jsonPayload, out PaymentNotificationRequest result) // This class-name is confusing as it's referring to a paymentInstrument -> Rename to PaymentInstrumentNotificationRequest? +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetSweepConfigurationNotificationRequest(string jsonPayload, out SweepConfigurationNotificationRequest result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook.> +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetReportNotificationRequest(string jsonPayload, out ReportNotificationRequest result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetTransferNotificationRequest(string jsonPayload, out TransferNotificationRequest result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetTransactionNotificationRequestV4(string jsonPayload, out TransactionNotificationRequestV4 result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetNegativeBalanceCompensationWarningNotificationRequest(string jsonPayload, out NegativeBalanceCompensationWarningNotificationRequest result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Check if the JSON pyload contains TypeEnum value. +// /// +// /// The string JSON payload. +// /// The TypeEnum of the class. +// /// True if the enum is present. +// private static bool ContainsValue(string jsonPayload) where T : struct, IConvertible +// { +// // Retrieve type from payload +// JToken typeToken = JObject.Parse(jsonPayload).GetValue("type"); +// string type = typeToken?.Value(); +// List memberInfos = typeof(T).GetTypeInfo().DeclaredMembers.ToList(); +// return memberInfos.Any(memberInfo => memberInfo?.GetCustomAttribute()?.Value == type); +// } +// } +// } \ No newline at end of file diff --git a/Adyen/Webhooks/ClassicPlatformWebhookHandler.cs b/Adyen/Webhooks/ClassicPlatformWebhookHandler.cs new file mode 100644 index 000000000..71e108871 --- /dev/null +++ b/Adyen/Webhooks/ClassicPlatformWebhookHandler.cs @@ -0,0 +1,386 @@ +// using Adyen.Model.PlatformsWebhooks; +// using Newtonsoft.Json; +// +// namespace Adyen.Webhooks +// { +// public class ClassicPlatformWebhookHandler +// { +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetAccountCreateNotification(string jsonPayload, out AccountCreateNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "ACCOUNT_CREATED".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetAccountCloseNotification(string jsonPayload, out AccountCloseNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "ACCOUNT_CLOSED".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetAccountFundsBelowThresholdNotification(string jsonPayload, out AccountFundsBelowThresholdNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "ACCOUNT_FUNDS_BELOW_THRESHOLD".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetAccountHolderCreateNotification(string jsonPayload, out AccountHolderCreateNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "ACCOUNT_HOLDER_CREATED".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetAccountHolderPayoutNotification(string jsonPayload, out AccountHolderPayoutNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "ACCOUNT_HOLDER_PAYOUT".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetAccountHolderStatusChangeNotification(string jsonPayload, out AccountHolderStatusChangeNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "ACCOUNT_HOLDER_STATUS_CHANGE".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetAccountHolderUpcomingDeadlineNotification(string jsonPayload, out AccountHolderUpcomingDeadlineNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "ACCOUNT_HOLDER_UPCOMING_DEADLINE".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetAccountHolderUpdateNotification(string jsonPayload, out AccountHolderUpdateNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "ACCOUNT_HOLDER_UPDATED".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetAccountHolderVerificationNotification(string jsonPayload, out AccountHolderVerificationNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "ACCOUNT_HOLDER_VERIFICATION".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetAccountUpdateNotification(string jsonPayload, out AccountUpdateNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "ACCOUNT_UPDATED".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetBeneficiarySetupNotification(string jsonPayload, out BeneficiarySetupNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "BENEFICIARY_SETUP".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetCompensateNegativeBalanceNotification(string jsonPayload, out CompensateNegativeBalanceNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "COMPENSATE_NEGATIVE_BALANCE".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetDirectDebitInitiatedNotification(string jsonPayload, out DirectDebitInitiatedNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "DIRECT_DEBIT_INITIATED".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetPaymentFailureNotification(string jsonPayload, out PaymentFailureNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "PAYMENT_FAILURE".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetRefundFundsTransferNotification(string jsonPayload, out RefundFundsTransferNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "REFUND_FUNDS_TRANSFER".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetReportAvailableNotification(string jsonPayload, out ReportAvailableNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "REPORT_AVAILABLE".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetScheduledRefundsNotification(string jsonPayload, out ScheduledRefundsNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "SCHEDULED_REFUNDS".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetTransferFundsNotification(string jsonPayload, out TransferFundsNotification result) +// { +// result = null; +// try +// { +// result = JsonConvert.DeserializeObject(jsonPayload); +// return "TRANSFER_FUNDS".Equals(result.EventType); +// } +// catch (JsonSerializationException) +// { +// return false; +// } +// } +// } +// } \ No newline at end of file diff --git a/Adyen/Util/HMACValidator.cs b/Adyen/Webhooks/HmacValidatorUtility.cs similarity index 65% rename from Adyen/Util/HMACValidator.cs rename to Adyen/Webhooks/HmacValidatorUtility.cs index 150f68e52..124d96c30 100644 --- a/Adyen/Util/HMACValidator.cs +++ b/Adyen/Webhooks/HmacValidatorUtility.cs @@ -1,16 +1,23 @@ -using System; -using System.Collections.Generic; -using System.Security.Cryptography; +using System.Security.Cryptography; using System.Text; -using Adyen.Model.Notification; +using Adyen.Webhooks.Models; -namespace Adyen.Util +namespace Adyen.Webhooks { - public class HmacValidator + /// + /// Utility class to help verify hmac signatures from incoming webhooks. + /// + public class HmacValidatorUtility { private const string HmacSignature = "hmacSignature"; - // Computes the Base64 encoded signature using the HMAC algorithm with the HMACSHA256 hashing function. + /// + /// Computes the Base64 encoded signature using the HMAC algorithm with the HMAC-SHA256 hashing function. + /// + /// The JSON payload. + /// The secret ADYEN_HMAC_KEY, retrieved from the Adyen Customer Area. + /// The HMAC string for the payload. + /// public string CalculateHmac(string payload, string hmacKey) { byte[] key = PackH(hmacKey); @@ -33,28 +40,44 @@ public string CalculateHmac(string payload, string hmacKey) } } + /// + /// Calculates HMAC for . + /// + /// . + /// The secret ADYEN_HMAC_KEY, retrieved from the Adyen Customer Area. + /// The HMAC string. public string CalculateHmac(NotificationRequestItem notificationRequestItem, string hmacKey) { var notificationRequestItemData = GetDataToSign(notificationRequestItem); return CalculateHmac(notificationRequestItemData, hmacKey); } - private byte[] PackH(string hex) + /// + /// Converts a hexadecimal into a byte array. + /// + /// The hexadecimal string. + /// An array of bytes that repesents the hexadecimalString. + private byte[] PackH(string hexadecimalString) { - if ((hex.Length % 2) == 1) + if ((hexadecimalString.Length % 2) == 1) { - hex += '0'; + hexadecimalString += '0'; } - byte[] bytes = new byte[hex.Length / 2]; - for (int i = 0; i < hex.Length; i += 2) + byte[] bytes = new byte[hexadecimalString.Length / 2]; + for (int i = 0; i < hexadecimalString.Length; i += 2) { - bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16); + bytes[i / 2] = Convert.ToByte(hexadecimalString.Substring(i, 2), 16); } return bytes; } + /// + /// Gets the data to sign. + /// + /// . + /// String joined by a colon. public string GetDataToSign(NotificationRequestItem notificationRequestItem) { var amount = notificationRequestItem.Amount; @@ -76,8 +99,8 @@ public string GetDataToSign(NotificationRequestItem notificationRequestItem) /// Validates a regular webhook with the given . /// /// . - /// The HMAC key, retrieved from the Adyen Customer Area. - /// A return value indicates the HMAC validation succeeded. + /// The secret ADYEN_HMAC_KEY, retrieved from the Adyen Customer Area. + /// Returns true indicates that the HMAC validation succeeded. public bool IsValidHmac(NotificationRequestItem notificationRequestItem, string hmacKey) { if (notificationRequestItem.AdditionalData == null) diff --git a/Adyen/Webhooks/ManagementWebhookHandler.cs b/Adyen/Webhooks/ManagementWebhookHandler.cs new file mode 100644 index 000000000..b362905c0 --- /dev/null +++ b/Adyen/Webhooks/ManagementWebhookHandler.cs @@ -0,0 +1,147 @@ +// using System; +// using System.Collections.Generic; +// using System.Reflection; +// using System.Runtime.Serialization; +// using Adyen.Model.ManagementWebhooks; +// using Newtonsoft.Json; +// using Newtonsoft.Json.Linq; +// +// namespace Adyen.Webhooks +// { +// public class ManagementWebhookHandler +// { +// /// +// /// Deserializes to a generic management webhook from the . Use this either to catch the +// /// webhook type if unknown or if the explicit type is not required. +// /// +// /// The json payload of the webhook. +// /// The parsed webhook packaged in a dynamic object. +// /// Throws when json is invalid. +// public dynamic GetGenericManagementWebhook(string jsonPayload) +// { +// if (GetMerchantCreatedNotificationRequest(jsonPayload, out var merchantCreatedNotificationRequest)) +// { +// return merchantCreatedNotificationRequest; +// } +// +// if (GetMerchantUpdatedNotificationRequest(jsonPayload, out var merchantUpdatedNotificationRequest)) +// { +// return merchantUpdatedNotificationRequest; +// } +// +// if (GetPaymentMethodCreatedNotificationRequest(jsonPayload, out var paymentMethodCreatedNotificationRequest)) +// { +// return paymentMethodCreatedNotificationRequest; +// } +// +// if (GetPaymentMethodRequestRemovedNotificationRequest(jsonPayload, out var PaymentMethodRequestRemovedNotificationRequest)) +// { +// return PaymentMethodRequestRemovedNotificationRequest; +// } +// +// if (GetPaymentMethodScheduledForRemovalNotificationRequest(jsonPayload, out var PaymentMethodScheduledForRemovalNotificationRequest)) +// { +// return PaymentMethodScheduledForRemovalNotificationRequest; +// } +// +// throw new JsonReaderException("Could not parse webhook"); +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetMerchantCreatedNotificationRequest(string jsonPayload, out MerchantCreatedNotificationRequest result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetMerchantUpdatedNotificationRequest(string jsonPayload, out MerchantUpdatedNotificationRequest result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetPaymentMethodCreatedNotificationRequest(string jsonPayload, out PaymentMethodCreatedNotificationRequest result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetPaymentMethodRequestRemovedNotificationRequest(string jsonPayload, out PaymentMethodRequestRemovedNotificationRequest result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// /// +// /// Deserializes from the . +// /// +// /// The json payload of the webhook. +// /// . +// /// A return value indicates whether the deserialization succeeded. +// /// Throws when json is invalid. +// public bool GetPaymentMethodScheduledForRemovalNotificationRequest(string jsonPayload, out PaymentMethodScheduledForRemovalNotificationRequest result) +// { +// result = null; +// if (!ContainsValue(jsonPayload)) return false; +// result = JsonConvert.DeserializeObject(jsonPayload); +// return true; +// } +// +// // Check if the contains TypeEnum value +// private static bool ContainsValue(string jsonPayload) where T : struct, IConvertible +// { +// // Retrieve type from payload +// JToken typeToken = JObject.Parse(jsonPayload).GetValue("type"); +// string type = typeToken?.Value(); +// +// // Search for type in .TypeEnum +// List list = new List(); +// var members = typeof(T) +// .GetTypeInfo() +// .DeclaredMembers; +// foreach (var member in members) +// { +// var val = member?.GetCustomAttribute(false)?.Value; +// if (!string.IsNullOrEmpty(val)) +// list.Add(val); +// } +// +// return list.Contains(type); +// } +// } +// } \ No newline at end of file diff --git a/Adyen/Webhooks/Models/Amount.cs b/Adyen/Webhooks/Models/Amount.cs new file mode 100644 index 000000000..05fcc574a --- /dev/null +++ b/Adyen/Webhooks/Models/Amount.cs @@ -0,0 +1,29 @@ +namespace Adyen.Webhooks.Models +{ + /// + /// The Amount, used for webhooks + /// + public class Amount + { + /// + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + /// + public string Currency { get; set; } + + /// + /// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + /// + public long? Value { get; set; } + + /// + /// Initializes a new instance of the class for webhooks. + /// + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + /// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + public Amount(string currency = default(string), long? value = default(long?)) + { + this.Currency = currency; + this.Value = value; + } + } +} \ No newline at end of file diff --git a/Adyen/WebhookHandlers/Models/NotificationRequest.cs b/Adyen/Webhooks/Models/NotificationRequest.cs similarity index 86% rename from Adyen/WebhookHandlers/Models/NotificationRequest.cs rename to Adyen/Webhooks/Models/NotificationRequest.cs index d537aaf78..64b6c0b32 100644 --- a/Adyen/WebhookHandlers/Models/NotificationRequest.cs +++ b/Adyen/Webhooks/Models/NotificationRequest.cs @@ -25,7 +25,7 @@ using System.Collections.Generic; using System.Text; -namespace Adyen.Model.Notification +namespace Adyen.Webhooks.Models { public class NotificationRequest { @@ -35,9 +35,9 @@ public class NotificationRequest public List NotificationItemContainers { get; set; } /// - /// Returns the string presentation of the object + /// Returns the string presentation of the object. /// - /// String presentation of the object + /// String presentation of the object. public override string ToString() { var sb = new StringBuilder(); @@ -50,9 +50,9 @@ public override string ToString() /// - /// Returns the JSON string presentation of the object + /// Returns the JSON string presentation of the object. /// - /// JSON string presentation of the object + /// JSON string presentation of the object. public string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); diff --git a/Adyen/WebhookHandlers/Models/NotificationRequestConst.cs b/Adyen/Webhooks/Models/NotificationRequestConstants.cs similarity index 97% rename from Adyen/WebhookHandlers/Models/NotificationRequestConst.cs rename to Adyen/Webhooks/Models/NotificationRequestConstants.cs index aba031e08..796c14dd9 100644 --- a/Adyen/WebhookHandlers/Models/NotificationRequestConst.cs +++ b/Adyen/Webhooks/Models/NotificationRequestConstants.cs @@ -21,9 +21,9 @@ // */ #endregion -namespace Adyen.Model.Notification +namespace Adyen.Webhooks.Models { - public class NotificationRequestConst + public class NotificationRequestConstants { //Event codes public const string EventCodeAuthorisation = "AUTHORISATION"; diff --git a/Adyen/WebhookHandlers/Models/NotificationRequestItem.cs b/Adyen/Webhooks/Models/NotificationRequestItem.cs similarity index 96% rename from Adyen/WebhookHandlers/Models/NotificationRequestItem.cs rename to Adyen/Webhooks/Models/NotificationRequestItem.cs index cbb4a6bd8..9efa46c4d 100644 --- a/Adyen/WebhookHandlers/Models/NotificationRequestItem.cs +++ b/Adyen/Webhooks/Models/NotificationRequestItem.cs @@ -22,9 +22,8 @@ #endregion using System.Collections.Generic; -using Adyen.Model.Checkout; -namespace Adyen.Model.Notification +namespace Adyen.Webhooks.Models { public class NotificationRequestItem { diff --git a/Adyen/WebhookHandlers/Models/NotificationRequestItemContainer.cs b/Adyen/Webhooks/Models/NotificationRequestItemContainer.cs similarity index 97% rename from Adyen/WebhookHandlers/Models/NotificationRequestItemContainer.cs rename to Adyen/Webhooks/Models/NotificationRequestItemContainer.cs index f21b226f5..f5a78114f 100644 --- a/Adyen/WebhookHandlers/Models/NotificationRequestItemContainer.cs +++ b/Adyen/Webhooks/Models/NotificationRequestItemContainer.cs @@ -24,7 +24,7 @@ using Adyen.Util; using System.Text; -namespace Adyen.Model.Notification +namespace Adyen.Webhooks.Models { using Newtonsoft.Json; @@ -37,7 +37,6 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class NotificationRequestItemContainer {\n"); - sb.Append(" notificationItem: ").Append(NotificationItem).Append("\n"); sb.Append("}"); return sb.ToString(); diff --git a/Adyen/Webhooks/WebhookHandler.cs b/Adyen/Webhooks/WebhookHandler.cs new file mode 100644 index 000000000..6c89363c8 --- /dev/null +++ b/Adyen/Webhooks/WebhookHandler.cs @@ -0,0 +1,45 @@ +using System.Text; +using Adyen.Util; +using Adyen.Webhooks.Models; +using Newtonsoft.Json; + +namespace Adyen.Webhooks +{ + /// + /// Utility function to deserialize . + /// + public class WebhookHandler + { + /// + /// Deserializes a object. + /// + /// The JSON payload. + /// . + /// . + public NotificationRequest DeserializeNotificationRequest(string jsonRequest, JsonSerializerSettings jsonSerializerSettings) + { + return JsonConvert.DeserializeObject(jsonRequest, jsonSerializerSettings); + } + } + + internal class ByteArrayConverter : JsonConverter + { + public override bool CanConvert(Type objectType) + { + return objectType == typeof(byte[]); + } + + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) + return null; + return Encoding.UTF8.GetBytes((string)reader.Value); + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + byte[] bytes = (byte[])value; + writer.WriteValue(Encoding.UTF8.GetString(bytes)); + } + } +} From a59a227e0266e4791e9f63999ac91813acbcd5b2 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 29 Oct 2025 22:20:19 +0100 Subject: [PATCH 083/126] Update function name from packH to HexadecimalToBytes --- Adyen/Webhooks/HmacValidatorUtility.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Adyen/Webhooks/HmacValidatorUtility.cs b/Adyen/Webhooks/HmacValidatorUtility.cs index 124d96c30..515356490 100644 --- a/Adyen/Webhooks/HmacValidatorUtility.cs +++ b/Adyen/Webhooks/HmacValidatorUtility.cs @@ -20,7 +20,7 @@ public class HmacValidatorUtility /// public string CalculateHmac(string payload, string hmacKey) { - byte[] key = PackH(hmacKey); + byte[] key = HexadecimalToBytes(hmacKey); byte[] data = Encoding.UTF8.GetBytes(payload); try @@ -57,7 +57,7 @@ public string CalculateHmac(NotificationRequestItem notificationRequestItem, str /// /// The hexadecimal string. /// An array of bytes that repesents the hexadecimalString. - private byte[] PackH(string hexadecimalString) + private byte[] HexadecimalToBytes(string hexadecimalString) { if ((hexadecimalString.Length % 2) == 1) { From 187d6480fc59c998e13db843159d8a7b1821c854 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 29 Oct 2025 23:38:22 +0100 Subject: [PATCH 084/126] Update docs with usage --- .../libraries/generichost/api_doc.mustache | 78 ++++++++++++++++--- 1 file changed, 66 insertions(+), 12 deletions(-) diff --git a/templates-v7/csharp/libraries/generichost/api_doc.mustache b/templates-v7/csharp/libraries/generichost/api_doc.mustache index ebd243414..bbed85ae0 100644 --- a/templates-v7/csharp/libraries/generichost/api_doc.mustache +++ b/templates-v7/csharp/libraries/generichost/api_doc.mustache @@ -1,9 +1,42 @@ -# {{packageName}}.{{apiPackage}}.{{classname}}{{#description}} +## {{packageName}}.{{apiPackage}}.{{classname}}{{#description}} {{.}}{{/description}} -### API Base-Path: **{{{basePath}}}** +#### API Base-Path: **{{{basePath}}}** -### Authorization: {{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +#### Authorization: {{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}{{#isApiKey}}{{^isKeyInCookie}}{{#isKeyInHeader}}{{{name}}}{{/isKeyInHeader}}{{/isKeyInCookie}}{{/isApiKey}}{{/authMethods}} + + +#### Initialization + + +```csharp +using {{packageName}}.{{corePackageName}}.Options; +using {{packageName}}.{{apiName}}.Extensions; +using {{packageName}}.{{apiName}}.Services; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +IHost host = Host.CreateDefaultBuilder() + .Configure{{apiName}}((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + // Set your ADYEN_API_KEY or use get it from your environment using context.Configuration["ADYEN_API_KEY"]. + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + + // Set your environment, e.g. `Test` or `Live`. + options.Environment = AdyenEnvironment.Test; + + // For the Live environment, additionally include your LiveEndpointUrlPrefix. + options.LiveEndpointUrlPrefix = "your-live-endpoint-url-prefix"; + }); + }) + .Build(); + + // You can inject this service in your constructor. + {{interfacePrefix}}{{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}} = host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); +``` | Method | HTTP request | Description | |--------|--------------|-------------| @@ -16,27 +49,48 @@ {{#operations}} {{#operation}} -# **{{httpMethod}}** **{{{path}}}** +### **{{httpMethod}}** **{{{path}}}** {{{summary}}} -```csharp -I{{returnType}}{{^returnType}}void{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -``` - -### Parameters +#### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} | Name | Type | Description | |------|------|-------------| {{/-last}} {{/allParams}} {{#allParams}} -| **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | +| **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}[{{dataType}}]{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}**{{dataType}}**{{/isFile}}{{/isPrimitiveType}} | {{description}} | {{/allParams}} -### Return type +#### Example usage + +```csharp +{{interfacePrefix}}{{returnType}}{{^returnType}}void{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}, CancellationToken cancellationToken = default) +``` + + +```csharp +using {{packageName}}.{{modelPackage}}; +using {{packageName}}.{{apiName}}.Services; + +// Example `{{classname}}.{{operationId}}` usage: +// Provide the following values: {{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}. +{{interfacePrefix}}{{returnType}} response = await {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{operationId}}Async( + {{#allParams}}{{paramName}}{{^required}}{{#optionalMethodArgument}}: null{{/optionalMethodArgument}}{{/required}}{{^-last}}, + {{/-last}}{{/allParams}}, + CancellationToken cancellationToken = default); + +if (response.TryDeserializeOkResponse(out {{returnType}} result)) +{ + // Handle result, if 200 OK response +} + +``` + +#### Return type +{{#returnType}}{{#returnTypeIsPrimitive}}[{{{returnType}}}]{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[{{returnType}}](){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} -{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} {{/operation}} {{/operations}} From 9fa1af99297962a72e12bab38194c76beeb68524 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 30 Oct 2025 14:44:48 +0100 Subject: [PATCH 085/126] Add tests for URLs & add sessionsAuthenticationUrl Check --- Adyen.Test/Checkout/PaymentsServiceTest.cs | 222 +----------------- .../Core/Client/UrlBuilderExtensionsTest.cs | 154 ++++++++++++ Adyen.Test/Core/IEnumTest.cs | 32 +-- .../checkout/payment-methods-response.json | 151 ++++++++++++ ...erExtension.cs => UrlBuilderExtensions.cs} | 5 + .../libraries/generichost/api_doc.mustache | 7 +- 6 files changed, 336 insertions(+), 235 deletions(-) create mode 100644 Adyen.Test/Core/Client/UrlBuilderExtensionsTest.cs create mode 100644 Adyen.Test/mocks/checkout/payment-methods-response.json rename Adyen/Core/Client/{UrlBuilderExtension.cs => UrlBuilderExtensions.cs} (93%) diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index 4a581b0c0..6c5895cd7 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -37,160 +37,7 @@ public PaymentsServiceTest() public async Task Given_PaymentMethodsResponse_When_Deserialized_Then_Result_Is_Not_Null() { // Arrange - string json = @" -{ - ""paymentMethods"": [ - { - ""name"": ""AliPay"", - ""type"": ""alipay"" - }, - { - ""brands"": [ - ""cartebancaire"", - ""amex"", - ""mc"", - ""visa"" - ], - ""configuration"": { - ""mcDpaId"": ""6d41d4d6-45b1-42c3-a5d0-a28c0e69d4b1_dpa2"", - ""visaSrcInitiatorId"": ""B9SECVKIQX2SOBQ6J9X721dVBBKHhJJl1nxxVbemHGn5oB6S8"", - ""mcSrcClientId"": ""6d41d4d6-45b1-42c3-a5d0-a28c0e69d4b1"", - ""visaSrciDpaId"": ""8e6e347c-254e-863f-0e6a-196bf2d9df02"" - }, - ""name"": ""Cards"", - ""type"": ""scheme"" - }, - { - ""configuration"": { - ""merchantId"": ""000000000202326"", - ""merchantName"": ""TestMerchantAccount"" - }, - ""name"": ""Apple Pay"", - ""type"": ""applepay"" - }, - { - ""name"": ""Payconiq by Bancontact"", - ""type"": ""bcmc_mobile"" - }, - { - ""name"": ""Boleto Bancario"", - ""type"": ""boletobancario"" - }, - { - ""name"": ""Online bank transfer."", - ""type"": ""directEbanking"" - }, - { - ""name"": ""DOKU"", - ""type"": ""doku"" - }, - { - ""name"": ""DOKU wallet"", - ""type"": ""doku_wallet"" - }, - { - ""brand"": ""***************"", - ""name"": ""Generic GiftCard"", - ""type"": ""giftcard"" - }, - { - ""brand"": ""*****"", - ""name"": ""Givex"", - ""type"": ""giftcard"" - }, - { - ""name"": ""GoPay Wallet"", - ""type"": ""gopay_wallet"" - }, - { - ""name"": ""GrabPay"", - ""type"": ""grabpay_SG"" - }, - { - ""issuers"": [ - { - ""id"": ""************"", - ""name"": ""*****"" - } - ], - ""name"": ""iDEAL"", - ""type"": ""ideal"" - }, - { - ""name"": ""Korea–issued cards"", - ""type"": ""kcp_creditcard"" - }, - { - ""name"": ""Pay later with Klarna."", - ""type"": ""klarna"" - }, - { - ""name"": ""Pay over time with Klarna."", - ""type"": ""klarna_account"" - }, - { - ""name"": ""Pay now with Klarna."", - ""type"": ""klarna_paynow"" - }, - { - ""name"": ""MB WAY"", - ""type"": ""mbway"" - }, - { - ""name"": ""MobilePay"", - ""type"": ""mobilepay"" - }, - { - ""configuration"": { - ""merchantId"": ""50"", - ""gatewayMerchantId"": ""TestMerchantAccount"" - }, - ""name"": ""Google Pay"", - ""type"": ""paywithgoogle"" - }, - { - ""name"": ""pix"", - ""type"": ""pix"" - }, - { - ""name"": ""SEPA Direct Debit"", - ""type"": ""sepadirectdebit"" - }, - { - ""brand"": ""***"", - ""name"": ""SVS"", - ""type"": ""giftcard"" - }, - { - ""name"": ""UPI Collect"", - ""type"": ""upi_collect"" - }, - { - ""name"": ""UPI Intent"", - ""type"": ""upi_intent"" - }, - { - ""name"": ""UPI QR"", - ""type"": ""upi_qr"" - }, - { - ""brand"": ""*********"", - ""name"": ""Valuelink"", - ""type"": ""giftcard"" - }, - { - ""name"": ""Vipps"", - ""type"": ""vipps"" - }, - { - ""brand"": ""***********"", - ""name"": ""VVV Giftcard"", - ""type"": ""giftcard"" - } - ] -} -"; - + string json = TestUtilities.GetTestFileContent("mocks/checkout/payment-methods-response.json"); // Act PaymentMethodsResponse result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); @@ -201,7 +48,7 @@ public async Task Given_PaymentMethodsResponse_When_Deserialized_Then_Result_Is_ } [TestMethod] - public void Given_CreateCheckoutSessionRequest_When_Serialize_Result_Contains_Zeros() + public void Given_CreateCheckoutSessionRequest_When_Serialize_Long__Result_Contains_Zeros() { // Arrange CreateCheckoutSessionRequest checkoutSessionRequest = new CreateCheckoutSessionRequest( @@ -220,16 +67,15 @@ public void Given_CreateCheckoutSessionRequest_When_Serialize_Result_Contains_Ze // Act string result = JsonSerializer.Serialize(checkoutSessionRequest, _jsonSerializerOptionsProvider.Options); - // Assert that long parameters set to zero are actually serialised (just like Int) - + // Assert using JsonDocument json = JsonDocument.Parse(result); JsonElement lineItems = json.RootElement.GetProperty("lineItems"); - lineItems[0].TryGetProperty("amountExcludingTax", out JsonElement amountExcludingTaxProp); - lineItems[1].TryGetProperty("taxAmount", out JsonElement taxAmountProp); + lineItems[0].TryGetProperty("amountExcludingTax", out JsonElement amountExcludingTax); + lineItems[1].TryGetProperty("taxAmount", out JsonElement taxAmount); - Assert.AreEqual(0, amountExcludingTaxProp.GetInt32()); - Assert.AreEqual(0, taxAmountProp.GetInt32()); + Assert.AreEqual(0, amountExcludingTax.GetInt32()); + Assert.AreEqual(0, taxAmount.GetInt32()); } [TestMethod] @@ -284,57 +130,8 @@ public void Given_Byte_Array_When_Deserialize_Result_ThreeDSecureData_Should_Des Assert.AreEqual(jsonElementBase64, cavv); } - #region Tests Live URL and LiveUrlPrefix - - [TestMethod] - public async Task Given_ConfigureCheckout_When_Environment_Is_Live_Then_HttpClient_BaseUrl_Is_Correct() - { - // Arrange - IHost liveHost = Host.CreateDefaultBuilder() - .ConfigureCheckout((context, services, config) => - { - config.ConfigureAdyenOptions(options => - { - options.Environment = AdyenEnvironment.Live; - options.LiveEndpointUrlPrefix = "prefix"; - }); - }) - .Build(); - - // Act - IPaymentsService paymentsApiService = liveHost.Services.GetRequiredService(); - string baseAddress = paymentsApiService.HttpClient.BaseAddress!.ToString(); - - // Assert - Assert.IsTrue(baseAddress.Contains("live")); - Assert.IsTrue(baseAddress.Contains("prefix")); - } - - [TestMethod] - public async Task Given_ConfigureCheckout_When_Environment_Is_Test_And_Prefix_Given_Then_HttpClient_BaseUrl_Does_Not_Contain_Prefix() - { - IHost testHost = Host.CreateDefaultBuilder() - .ConfigureCheckout((context, services, config) => - { - config.ConfigureAdyenOptions(options => - { - options.Environment = AdyenEnvironment.Test; - options.LiveEndpointUrlPrefix = "prefix"; - }); - }) - .Build(); - - // Act - IPaymentsService paymentsApiService = testHost.Services.GetRequiredService(); - string baseAddress = paymentsApiService.HttpClient.BaseAddress!.ToString(); - - // Assert - Assert.IsTrue(baseAddress.Contains("test")); - Assert.IsFalse(baseAddress.Contains("prefix")); - } - [TestMethod] - public async Task Given_ConfigureCheckout_When_No_Options_Provided_Then_HttpClient_Should_Contain_Test_Url_And_No_Prefix() + public async Task Given_Empty_ConfigureCheckout_When_No_AdyenOptions_Provided_Then_IPaymentService_Should_Throw_InvalidOperationException() { // Arrange IHost testHost = Host.CreateDefaultBuilder() @@ -343,7 +140,7 @@ public async Task Given_ConfigureCheckout_When_No_Options_Provided_Then_HttpClie // Empty }) .Build(); - + // Act // Assert Assert.Throws(() => @@ -352,6 +149,5 @@ public async Task Given_ConfigureCheckout_When_No_Options_Provided_Then_HttpClie testHost.Services.GetRequiredService(); }); } - #endregion } } \ No newline at end of file diff --git a/Adyen.Test/Core/Client/UrlBuilderExtensionsTest.cs b/Adyen.Test/Core/Client/UrlBuilderExtensionsTest.cs new file mode 100644 index 000000000..aeadc3c3a --- /dev/null +++ b/Adyen.Test/Core/Client/UrlBuilderExtensionsTest.cs @@ -0,0 +1,154 @@ +using Adyen.Core.Client; +using Adyen.Core.Options; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.Core.Client +{ + [TestClass] + public class UrlBuilderExtensionsTest + { + #region Checkout && POS-SDK + [TestMethod] + public async Task Given_ConstructHostUrl_When_Environment_Is_Live_Then_CheckoutUrl_Contains_Prefix_And_Live_String() + { + // Arrange + AdyenOptions adyenOptions = new AdyenOptions() + { + Environment = AdyenEnvironment.Live, + LiveEndpointUrlPrefix = "prefix", + }; + + // Act + string target = UrlBuilderExtensions.ConstructHostUrl(adyenOptions, "https://checkout-test.adyen.com/v71"); + + // Assert + Assert.AreEqual("https://prefix-checkout-live.adyenpayments.com/checkout/v71", target); + } + + [TestMethod] + public async Task Given_ConstructHostUrl_When_Environment_Is_Live_And_No_Prefix_For_Checkout_Throws_InvalidOperationException() + { + // Arrange + AdyenOptions adyenOptions = new AdyenOptions() + { + Environment = AdyenEnvironment.Live, + LiveEndpointUrlPrefix = null + }; + + // Act + // Assert + Assert.Throws(() => UrlBuilderExtensions.ConstructHostUrl(adyenOptions, "https://checkout-test.adyen.com/v71")); + } + + #endregion + + [TestMethod] + public async Task Given_ConstructHostUrl_When_Environment_Is_Live_Then_Checkout_POS_SDK_Contains_Prefix_And_Live_String_Without_Checkout() + { + // Arrange + AdyenOptions adyenOptions = new AdyenOptions() + { + Environment = AdyenEnvironment.Live, + LiveEndpointUrlPrefix = "prefix", + }; + + // Act + string target = UrlBuilderExtensions.ConstructHostUrl(adyenOptions, "https://checkout-test.adyen.com/checkout/possdk/v68"); + + // Assert + Assert.AreEqual("https://prefix-checkout-live.adyenpayments.com/checkout/possdk/v68", target); + } + + + #region Pal + [TestMethod] + public async Task Given_ConstructHostUrl_When_Environment_Is_Live_Then_PalUrl_Contains_Prefix_And_Live_String() + { + // Arrange + AdyenOptions adyenOptions = new AdyenOptions() + { + Environment = AdyenEnvironment.Live, + LiveEndpointUrlPrefix = "prefix", + }; + + // Act + string target = UrlBuilderExtensions.ConstructHostUrl(adyenOptions, "https://pal-test.adyen.com/pal/servlet/Payment/v68"); + + // Assert + Assert.AreEqual("https://prefix-pal-live.adyenpayments.com/pal/servlet/Payment/v68", target); + } + + [TestMethod] + public async Task Given_ConstructHostUrl_When_Environment_Is_Live_And_No_Prefix_For_Pal_Throws_InvalidOperationException() + { + // Arrange + AdyenOptions adyenOptions = new AdyenOptions() + { + Environment = AdyenEnvironment.Live, + LiveEndpointUrlPrefix = null + }; + + // Act + // Assert + Assert.Throws(() => UrlBuilderExtensions.ConstructHostUrl(adyenOptions, "https://pal-test.adyen.com/pal/servlet/Payment/v68")); + } + + #endregion + + + #region SessionAuthentication + [TestMethod] + public async Task Given_ConstructHostUrl_When_Environment_Is_Live_Then_SessionAuthentication_Url_Contains_Prefix_And_Live_String() + { + // Arrange + AdyenOptions adyenOptions = new AdyenOptions() + { + Environment = AdyenEnvironment.Live, + LiveEndpointUrlPrefix = "prefix", + }; + + // Act + string target = UrlBuilderExtensions.ConstructHostUrl(adyenOptions, "https://test.adyen.com/authe/api/v1"); + + // Assert + Assert.AreEqual("https://authe-live.adyen.com/authe/api/v1", target); + } + + #endregion + + [TestMethod] + public async Task Given_ConstructHostUrl_When_Environment_Is_Test_And_Prefix_Given_Then_Url_Does_Not_Contain_Prefix() + { + // Arrange + AdyenOptions adyenOptions = new AdyenOptions() + { + Environment = AdyenEnvironment.Test, + LiveEndpointUrlPrefix = "prefix", + }; + + // Act + string target = UrlBuilderExtensions.ConstructHostUrl(adyenOptions, "https://test.adyen.com"); + + // Assert + Assert.IsFalse(target.Contains("prefix")); + } + + [TestMethod] + public async Task Given_ConstructHostUrl_When_Environment_Is_Live_And_No_Prefix_Does_Not_Throw_InvalidOperationException_And_Contains_String_Value_Test() + { + // Arrange + AdyenOptions adyenOptions = new AdyenOptions() + { + Environment = AdyenEnvironment.Live, + LiveEndpointUrlPrefix = null + }; + + // Act + string target = UrlBuilderExtensions.ConstructHostUrl(adyenOptions, "https://test.adyen.com/"); + + // Assert + Assert.IsTrue(target.Contains("test")); + } + + } +} \ No newline at end of file diff --git a/Adyen.Test/Core/IEnumTest.cs b/Adyen.Test/Core/IEnumTest.cs index a7c505a30..ddd4adc38 100644 --- a/Adyen.Test/Core/IEnumTest.cs +++ b/Adyen.Test/Core/IEnumTest.cs @@ -11,7 +11,7 @@ public class IEnumTest public class IEnumTestTests { [TestMethod] - public void Given_Enums_When_Equal_Returns_Correct_True() + public async Task Given_Enums_When_Equal_Returns_Correct_True() { ExampleEnum? nullEnum = null; @@ -21,7 +21,7 @@ public void Given_Enums_When_Equal_Returns_Correct_True() } [TestMethod] - public void Given_Enums_When_NotEqual_Returns_Correct_False() + public async Task Given_Enums_When_NotEqual_Returns_Correct_False() { ExampleEnum? nullEnum = null; @@ -31,7 +31,7 @@ public void Given_Enums_When_NotEqual_Returns_Correct_False() } [TestMethod] - public void Given_ImplicitConversion_When_Initialized_Then_Returns_Correct_Values() + public async Task Given_ImplicitConversion_When_Initialized_Then_Returns_Correct_Values() { ExampleEnum? resultA = "a"; ExampleEnum? resultB = "b"; @@ -41,7 +41,7 @@ public void Given_ImplicitConversion_When_Initialized_Then_Returns_Correct_Value } [TestMethod] - public void Given_ImplicitConversion_When_Null_Then_Returns_Null() + public async Task Given_ImplicitConversion_When_Null_Then_Returns_Null() { ExampleEnum? input = null; string? result = input; @@ -50,14 +50,14 @@ public void Given_ImplicitConversion_When_Null_Then_Returns_Null() } [TestMethod] - public void Given_ToString_When_Called_Then_Returns_Correct_Value() + public async Task Given_ToString_When_Called_Then_Returns_Correct_Value() { Assert.AreEqual("a", ExampleEnum.A.ToString()); Assert.AreEqual("b", ExampleEnum.B.ToString()); } [TestMethod] - public void Given_ToString_When_Null_Then_Returns_Empty_String() + public async Task Given_ToString_When_Null_Then_Returns_Empty_String() { ExampleEnum result = ExampleEnum.FromStringOrDefault("this-is-not-a-valid-enum"); @@ -65,7 +65,7 @@ public void Given_ToString_When_Null_Then_Returns_Empty_String() } [TestMethod] - public void Given_Equals_When_ComparingCaseInsensitive_Then_Returns_True() + public async Task Given_Equals_When_ComparingCaseInsensitive_Then_Returns_True() { ExampleEnum result = ExampleEnum.A; @@ -74,13 +74,13 @@ public void Given_Equals_When_ComparingCaseInsensitive_Then_Returns_True() } [TestMethod] - public void Given_FromStringOrDefault_When_InvalidString_Then_Returns_Null() + public async Task Given_FromStringOrDefault_When_InvalidString_Then_Returns_Null() { Assert.IsNull(ExampleEnum.FromStringOrDefault("this-is-not-a-valid-enum")); } [TestMethod] - public void Given_EqualityOperator_When_ComparingValues_Then_Returns_Correct_Values() + public async Task Given_EqualityOperator_When_ComparingValues_Then_Returns_Correct_Values() { ExampleEnum target = ExampleEnum.A; ExampleEnum otherA = ExampleEnum.A; @@ -93,7 +93,7 @@ public void Given_EqualityOperator_When_ComparingValues_Then_Returns_Correct_Val } [TestMethod] - public void Given_FromStringOrDefault_When_ValidStrings_Then_Returns_Correct_Enum() + public async Task Given_FromStringOrDefault_When_ValidStrings_Then_Returns_Correct_Enum() { Assert.AreEqual(ExampleEnum.A, ExampleEnum.FromStringOrDefault("a")); Assert.AreEqual(ExampleEnum.B, ExampleEnum.FromStringOrDefault("b")); @@ -101,20 +101,20 @@ public void Given_FromStringOrDefault_When_ValidStrings_Then_Returns_Correct_Enu #region ToJsonValue [TestMethod] - public void Given_ToJsonValue_When_KnownEnum_Then_Returns_String() + public async Task Given_ToJsonValue_When_KnownEnum_Then_Returns_String() { Assert.AreEqual("a", ExampleEnum.ToJsonValue(ExampleEnum.A)); Assert.AreEqual("b", ExampleEnum.ToJsonValue(ExampleEnum.B)); } [TestMethod] - public void Given_ToJsonValue_When_Null_Then_Returns_Null() + public async Task Given_ToJsonValue_When_Null_Then_Returns_Null() { Assert.IsNull(ExampleEnum.ToJsonValue(null)); } [TestMethod] - public void Given_ToJsonValue_When_CustomEnum_Then_Returns_Null() + public async Task Given_ToJsonValue_When_CustomEnum_Then_Returns_Null() { ExampleEnum custom = ExampleEnum.FromStringOrDefault("this-is-not-a-valid-enum"); Assert.IsNull(ExampleEnum.ToJsonValue(custom)); @@ -124,7 +124,7 @@ public void Given_ToJsonValue_When_CustomEnum_Then_Returns_Null() #region JsonSerialization and JsonDeserialization [TestMethod] - public void Given_JsonSerialization_When_KnownEnum_Then_Serialize_and_Deserialize_Correctly() + public async Task Given_JsonSerialization_When_KnownEnum_Then_Serialize_and_Deserialize_Correctly() { JsonSerializerOptions options = new JsonSerializerOptions(); options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); @@ -143,7 +143,7 @@ public void Given_JsonSerialization_When_KnownEnum_Then_Serialize_and_Deserializ } [TestMethod] - public void Given_JsonSerialization_When_EnumNotInList_Then_Returns_Null() + public async Task Given_JsonSerialization_When_EnumNotInList_Then_Returns_Null() { var options = new JsonSerializerOptions(); options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); @@ -157,7 +157,7 @@ public void Given_JsonSerialization_When_EnumNotInList_Then_Returns_Null() } [TestMethod] - public void Given_JsonSerialization_When_Null_Value_Then_Serialize_And_Deserialize_Correctly() + public async Task Given_JsonSerialization_When_Null_Value_Then_Serialize_And_Deserialize_Correctly() { var options = new JsonSerializerOptions(); options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); diff --git a/Adyen.Test/mocks/checkout/payment-methods-response.json b/Adyen.Test/mocks/checkout/payment-methods-response.json new file mode 100644 index 000000000..693ce5251 --- /dev/null +++ b/Adyen.Test/mocks/checkout/payment-methods-response.json @@ -0,0 +1,151 @@ +{ + "paymentMethods": [ + { + "name": "AliPay", + "type": "alipay" + }, + { + "brands": [ + "cartebancaire", + "amex", + "mc", + "visa" + ], + "configuration": { + "mcDpaId": "6d41d4d6-45b1-42c3-a5d0-a28c0e69d4b1_dpa2", + "visaSrcInitiatorId": "B9SECVKIQX2SOBQ6J9X721dVBBKHhJJl1nxxVbemHGn5oB6S8", + "mcSrcClientId": "6d41d4d6-45b1-42c3-a5d0-a28c0e69d4b1", + "visaSrciDpaId": "8e6e347c-254e-863f-0e6a-196bf2d9df02" + }, + "name": "Cards", + "type": "scheme" + }, + { + "configuration": { + "merchantId": "000000000202326", + "merchantName": "TestMerchantAccount" + }, + "name": "Apple Pay", + "type": "applepay" + }, + { + "name": "Payconiq by Bancontact", + "type": "bcmc_mobile" + }, + { + "name": "Boleto Bancario", + "type": "boletobancario" + }, + { + "name": "Online bank transfer.", + "type": "directEbanking" + }, + { + "name": "DOKU", + "type": "doku" + }, + { + "name": "DOKU wallet", + "type": "doku_wallet" + }, + { + "brand": "***************", + "name": "Generic GiftCard", + "type": "giftcard" + }, + { + "brand": "*****", + "name": "Givex", + "type": "giftcard" + }, + { + "name": "GoPay Wallet", + "type": "gopay_wallet" + }, + { + "name": "GrabPay", + "type": "grabpay_SG" + }, + { + "issuers": [ + { + "id": "************", + "name": "*****" + } + ], + "name": "iDEAL", + "type": "ideal" + }, + { + "name": "Korea–issued cards", + "type": "kcp_creditcard" + }, + { + "name": "Pay later with Klarna.", + "type": "klarna" + }, + { + "name": "Pay over time with Klarna.", + "type": "klarna_account" + }, + { + "name": "Pay now with Klarna.", + "type": "klarna_paynow" + }, + { + "name": "MB WAY", + "type": "mbway" + }, + { + "name": "MobilePay", + "type": "mobilepay" + }, + { + "configuration": { + "merchantId": "50", + "gatewayMerchantId": "TestMerchantAccount" + }, + "name": "Google Pay", + "type": "paywithgoogle" + }, + { + "name": "pix", + "type": "pix" + }, + { + "name": "SEPA Direct Debit", + "type": "sepadirectdebit" + }, + { + "brand": "***", + "name": "SVS", + "type": "giftcard" + }, + { + "name": "UPI Collect", + "type": "upi_collect" + }, + { + "name": "UPI Intent", + "type": "upi_intent" + }, + { + "name": "UPI QR", + "type": "upi_qr" + }, + { + "brand": "*********", + "name": "Valuelink", + "type": "giftcard" + }, + { + "name": "Vipps", + "type": "vipps" + }, + { + "brand": "***********", + "name": "VVV Giftcard", + "type": "giftcard" + } + ] +} diff --git a/Adyen/Core/Client/UrlBuilderExtension.cs b/Adyen/Core/Client/UrlBuilderExtensions.cs similarity index 93% rename from Adyen/Core/Client/UrlBuilderExtension.cs rename to Adyen/Core/Client/UrlBuilderExtensions.cs index 299f020c3..a99aa23b6 100644 --- a/Adyen/Core/Client/UrlBuilderExtension.cs +++ b/Adyen/Core/Client/UrlBuilderExtensions.cs @@ -66,6 +66,11 @@ public static string ConstructLiveUrl(string liveEndpointUrlPrefix, string url) "https://" + liveEndpointUrlPrefix + "-checkout-live.adyenpayments.com/checkout/"); } } + else if (url.Contains("https://test.adyen.com/authe/api/")) // SessionAuthentication + { + url = url.Replace("https://test.adyen.com/authe/api/", + "https://authe-live.adyen.com/authe/api/"); + } // If no prefix is required, we replace "test" -> "live" url = url.Replace("-test", "-live"); diff --git a/templates-v7/csharp/libraries/generichost/api_doc.mustache b/templates-v7/csharp/libraries/generichost/api_doc.mustache index bbed85ae0..218feb13b 100644 --- a/templates-v7/csharp/libraries/generichost/api_doc.mustache +++ b/templates-v7/csharp/libraries/generichost/api_doc.mustache @@ -65,11 +65,6 @@ IHost host = Host.CreateDefaultBuilder() #### Example usage -```csharp -{{interfacePrefix}}{{returnType}}{{^returnType}}void{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}, CancellationToken cancellationToken = default) -``` - - ```csharp using {{packageName}}.{{modelPackage}}; using {{packageName}}.{{apiName}}.Services; @@ -77,7 +72,7 @@ using {{packageName}}.{{apiName}}.Services; // Example `{{classname}}.{{operationId}}` usage: // Provide the following values: {{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}. {{interfacePrefix}}{{returnType}} response = await {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{operationId}}Async( - {{#allParams}}{{paramName}}{{^required}}{{#optionalMethodArgument}}: null{{/optionalMethodArgument}}{{/required}}{{^-last}}, + {{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}, CancellationToken cancellationToken = default); From b1d9b91d5dbf708207b934b02dcb9a5a740f60c7 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 30 Oct 2025 16:07:57 +0100 Subject: [PATCH 086/126] Rename AdyenClient.cs back to the original Client.cs --- Adyen.IntegrationTest/BaseTest.cs | 4 +-- .../CancellationTokenTest.cs | 2 +- Adyen.IntegrationTest/CheckoutTest.cs | 22 ++++++------- Adyen.IntegrationTest/ErrorTest.cs | 8 ++--- Adyen.IntegrationTest/PaymentTest.cs | 2 +- Adyen.IntegrationTest/PayoutTest.cs | 10 +++--- Adyen.Test/BaseTest.cs | 24 +++++++------- Adyen.Test/CheckoutTest.cs | 8 ++--- .../{AdyenClientTest.cs => ClientTest.cs} | 32 +++++++++---------- Adyen.Test/ExtensionsTest.cs | 14 ++++---- Adyen.Test/ProxyTest.cs | 4 +-- Adyen.Test/RecurringTest.cs | 16 +++++----- .../TerminalApiAsyncServiceTest.cs | 20 ++++++------ .../TerminalApiLocalServiceTest.cs | 16 +++++----- .../TerminalApi/TerminalApiPosRequestTest.cs | 6 ++-- .../TerminalApi/TerminalApiSyncServiceTest.cs | 16 +++++----- Adyen/Service/BalanceControlService.cs | 2 +- .../BalancePlatform/AccountHoldersService.cs | 2 +- .../BalancePlatform/BalanceAccountsService.cs | 2 +- .../BankAccountValidationService.cs | 2 +- .../BalancePlatform/CardOrdersService.cs | 2 +- .../BalancePlatform/GrantAccountsService.cs | 2 +- .../BalancePlatform/GrantOffersService.cs | 2 +- .../BalancePlatform/ManageCardPINService.cs | 2 +- .../ManageSCADevicesService.cs | 2 +- .../BalancePlatform/NetworkTokensService.cs | 2 +- .../PaymentInstrumentGroupsService.cs | 2 +- .../PaymentInstrumentsService.cs | 2 +- .../BalancePlatform/PlatformService.cs | 2 +- .../TransactionRulesService.cs | 2 +- .../BalancePlatform/TransferRoutesService.cs | 2 +- Adyen/Service/BinLookupService.cs | 2 +- Adyen/Service/Checkout/DonationsService.cs | 2 +- .../Service/Checkout/ModificationsService.cs | 2 +- Adyen/Service/Checkout/OrdersService.cs | 2 +- Adyen/Service/Checkout/PaymentLinksService.cs | 2 +- Adyen/Service/Checkout/PaymentsService.cs | 2 +- Adyen/Service/Checkout/RecurringService.cs | 2 +- Adyen/Service/Checkout/UtilityService.cs | 2 +- Adyen/Service/DataProtectionService.cs | 2 +- Adyen/Service/DisputesService.cs | 2 +- .../BusinessLinesService.cs | 2 +- .../LegalEntityManagement/DocumentsService.cs | 2 +- .../HostedOnboardingService.cs | 2 +- .../LegalEntitiesService.cs | 2 +- .../PCIQuestionnairesService.cs | 2 +- .../TaxEDeliveryConsentService.cs | 2 +- .../TermsOfServiceService.cs | 2 +- .../TransferInstrumentsService.cs | 2 +- .../APICredentialsCompanyLevelService.cs | 2 +- .../APICredentialsMerchantLevelService.cs | 2 +- .../Management/APIKeyCompanyLevelService.cs | 2 +- .../Management/APIKeyMerchantLevelService.cs | 2 +- .../Management/AccountCompanyLevelService.cs | 2 +- .../Management/AccountMerchantLevelService.cs | 2 +- .../Management/AccountStoreLevelService.cs | 2 +- .../AllowedOriginsCompanyLevelService.cs | 2 +- .../AllowedOriginsMerchantLevelService.cs | 2 +- .../AndroidFilesCompanyLevelService.cs | 2 +- .../ClientKeyCompanyLevelService.cs | 2 +- .../ClientKeyMerchantLevelService.cs | 2 +- .../Management/MyAPICredentialService.cs | 2 +- .../PaymentMethodsMerchantLevelService.cs | 2 +- .../PayoutSettingsMerchantLevelService.cs | 2 +- .../SplitConfigurationMerchantLevelService.cs | 2 +- .../TerminalActionsCompanyLevelService.cs | 2 +- .../TerminalActionsTerminalLevelService.cs | 2 +- .../TerminalOrdersCompanyLevelService.cs | 2 +- .../TerminalOrdersMerchantLevelService.cs | 2 +- .../TerminalSettingsCompanyLevelService.cs | 2 +- .../TerminalSettingsMerchantLevelService.cs | 2 +- .../TerminalSettingsStoreLevelService.cs | 2 +- .../TerminalSettingsTerminalLevelService.cs | 2 +- .../TerminalsTerminalLevelService.cs | 2 +- .../Management/UsersCompanyLevelService.cs | 2 +- .../Management/UsersMerchantLevelService.cs | 2 +- .../Management/WebhooksCompanyLevelService.cs | 2 +- .../WebhooksMerchantLevelService.cs | 2 +- Adyen/Service/PaymentService.cs | 2 +- Adyen/Service/PaymentsAppService.cs | 2 +- Adyen/Service/Payout/InitializationService.cs | 2 +- Adyen/Service/Payout/InstantPayoutsService.cs | 2 +- Adyen/Service/Payout/ReviewingService.cs | 2 +- .../PlatformsAccount/AccountHoldersService.cs | 2 +- .../PlatformsAccount/AccountsService.cs | 2 +- .../PlatformsAccount/VerificationService.cs | 2 +- Adyen/Service/PlatformsFundService.cs | 2 +- .../HostedOnboardingPageService.cs | 2 +- .../PCIComplianceQuestionnairePageService.cs | 2 +- ...atformsNotificationConfigurationService.cs | 2 +- Adyen/Service/PosMobileService.cs | 2 +- Adyen/Service/PosTerminalManagementService.cs | 2 +- Adyen/Service/RecurringService.cs | 2 +- Adyen/Service/ServiceResource.cs | 8 ++--- Adyen/Service/StoredValueService.cs | 2 +- Adyen/Service/Transfers/CapitalService.cs | 2 +- .../Service/Transfers/TransactionsService.cs | 2 +- Adyen/Service/Transfers/TransfersService.cs | 2 +- .../TerminalApi/{AdyenClient.cs => Client.cs} | 12 +++---- Adyen/TerminalApi/Clients/TerminalApi.cs | 4 +-- .../Clients/TerminalApiAsyncClient.cs | 2 +- Adyen/TerminalApi/Clients/TerminalApiLocal.cs | 2 +- .../Clients/TerminalApiLocalClient.cs | 2 +- .../Clients/TerminalApiSyncClient.cs | 2 +- Adyen/TerminalApi/Config.cs | 31 +++++++++--------- Adyen/TerminalApi/Models/AbstractService.cs | 8 ++--- .../Services/TerminalApiAsyncService.cs | 18 +++++------ .../Services/TerminalApiLocalService.cs | 22 ++++++------- .../Services/TerminalApiSyncService.cs | 18 +++++------ .../TerminalApi/Services/TerminalCloudApi.cs | 22 ++++++------- .../TerminalApi/Services/TerminalLocalApi.cs | 12 +++---- .../Services/TerminalLocalApiUnencrypted.cs | 16 +++++----- 112 files changed, 273 insertions(+), 272 deletions(-) rename Adyen.Test/{AdyenClientTest.cs => ClientTest.cs} (85%) rename Adyen/TerminalApi/{AdyenClient.cs => Client.cs} (92%) diff --git a/Adyen.IntegrationTest/BaseTest.cs b/Adyen.IntegrationTest/BaseTest.cs index 341c64bf0..ecb866f49 100644 --- a/Adyen.IntegrationTest/BaseTest.cs +++ b/Adyen.IntegrationTest/BaseTest.cs @@ -141,14 +141,14 @@ protected AdjustAuthorisationRequest CreateAdjustAuthorisationtestRequest(string #endregion - protected AdyenClient CreateApiKeyTestClient() + protected Client CreateApiKeyTestClient() { var config = new Config() { XApiKey = ClientConstants.Xapikey, Environment = Environment.Test }; - return new AdyenClient(config); + return new Client(config); } private PaymentRequest CreateFullPaymentRequest() diff --git a/Adyen.IntegrationTest/CancellationTokenTest.cs b/Adyen.IntegrationTest/CancellationTokenTest.cs index b997f8589..594f25938 100644 --- a/Adyen.IntegrationTest/CancellationTokenTest.cs +++ b/Adyen.IntegrationTest/CancellationTokenTest.cs @@ -17,7 +17,7 @@ public class CancellationTokenTest : BaseTest [TestMethod] public void CancellationTokenDelayTest() { - var client = new AdyenClient(new Config()) + var client = new Client(new Config()) { HttpClient = new MyDelayedClient(new Config(), new System.Net.Http.HttpClient()) }; diff --git a/Adyen.IntegrationTest/CheckoutTest.cs b/Adyen.IntegrationTest/CheckoutTest.cs index f9fb18f98..1ca9a9c6f 100644 --- a/Adyen.IntegrationTest/CheckoutTest.cs +++ b/Adyen.IntegrationTest/CheckoutTest.cs @@ -12,7 +12,7 @@ namespace Adyen.IntegrationTest [TestClass] public class CheckoutTest : BaseTest { - private AdyenClient _adyenClient; + private Client _client; private PaymentsService _checkout; private RecurringService _recurring; private ModificationsService _modifications; @@ -23,19 +23,19 @@ public class CheckoutTest : BaseTest [TestInitialize] public void Init() { - _adyenClient = CreateApiKeyTestClient(); - _checkout = new PaymentsService(_adyenClient); - _recurring = new RecurringService(_adyenClient); - _modifications = new ModificationsService(_adyenClient); - _paymentLinksService = new PaymentLinksService(_adyenClient); + _client = CreateApiKeyTestClient(); + _checkout = new PaymentsService(_client); + _recurring = new RecurringService(_client); + _modifications = new ModificationsService(_client); + _paymentLinksService = new PaymentLinksService(_client); // _classicCheckoutSdkService = new ClassicCheckoutSDKService(_client); - _paymentsService = new PaymentsService(_adyenClient); + _paymentsService = new PaymentsService(_client); } [TestMethod] public void PaymentsFlowWithInvalidApiKey() { - _adyenClient.Config.XApiKey = "InvalidKey"; + _client.Config.XApiKey = "InvalidKey"; try { var paymentResponse = _checkout.Payments(CreatePaymentRequestCheckout()); @@ -49,7 +49,7 @@ public void PaymentsFlowWithInvalidApiKey() [TestMethod] public void PaymentsFlowWithEmptyApiKey() { - _adyenClient.Config.XApiKey = null; + _client.Config.XApiKey = null; try { var paymentResponse = _checkout.Payments(CreatePaymentRequestCheckout()); @@ -63,8 +63,8 @@ public void PaymentsFlowWithEmptyApiKey() [TestMethod] public void PaymentsFlowWithPartiallyCorrectKeyApiKey() { - var key = _adyenClient.Config.XApiKey; - _adyenClient.Config.XApiKey = "1" + key; + var key = _client.Config.XApiKey; + _client.Config.XApiKey = "1" + key; try { var paymentResponse = _checkout.Payments(CreatePaymentRequestCheckout()); diff --git a/Adyen.IntegrationTest/ErrorTest.cs b/Adyen.IntegrationTest/ErrorTest.cs index 12d3d5bbb..33eb905db 100644 --- a/Adyen.IntegrationTest/ErrorTest.cs +++ b/Adyen.IntegrationTest/ErrorTest.cs @@ -17,14 +17,14 @@ namespace Adyen.IntegrationTest [TestClass] public class ErrorTest : BaseTest { - private AdyenClient _adyenClient; + private Client _client; private static readonly string MerchantAccount = ClientConstants.MerchantAccount; private HttpClientWrapper _httpClientWrapper; [TestInitialize] public void Init() { - _adyenClient = CreateApiKeyTestClient(); + _client = CreateApiKeyTestClient(); _httpClientWrapper = new HttpClientWrapper(new Config() { Environment = Environment.Test, XApiKey = ClientConstants.Xapikey }, new System.Net.Http.HttpClient()); @@ -33,7 +33,7 @@ public void Init() [TestMethod] public void TestClassicPaymentErrorHandling() { - var payments = new PaymentService(_adyenClient); + var payments = new PaymentService(_client); var request = new PaymentRequest { Amount = new Amount(){ Value = 1500, @@ -69,7 +69,7 @@ public void TestClassicPaymentErrorHandling() [TestMethod] public void TestCheckoutErrorHandling() { - var payments = new PaymentsService(_adyenClient); + var payments = new PaymentsService(_client); var request = new Model.Checkout.PaymentRequest { Amount = new Model.Checkout.Amount(){ Value = 1500, diff --git a/Adyen.IntegrationTest/PaymentTest.cs b/Adyen.IntegrationTest/PaymentTest.cs index 3325f0e91..e4c0dcbb9 100644 --- a/Adyen.IntegrationTest/PaymentTest.cs +++ b/Adyen.IntegrationTest/PaymentTest.cs @@ -65,7 +65,7 @@ public void ApiIdemptotencyKeySuccessTest() [TestMethod] public void StoredValueIssueFailIntegrationTest() { - var client = new AdyenClient(new Config() + var client = new Client(new Config() { Environment = Environment.Test, XApiKey = ClientConstants.Xapikey diff --git a/Adyen.IntegrationTest/PayoutTest.cs b/Adyen.IntegrationTest/PayoutTest.cs index 3f36c1269..f4a8e593a 100644 --- a/Adyen.IntegrationTest/PayoutTest.cs +++ b/Adyen.IntegrationTest/PayoutTest.cs @@ -11,7 +11,7 @@ namespace Adyen.IntegrationTest [TestClass] public class PayoutTest : BaseTest { - private AdyenClient _adyenClient; + private Client _client; private InstantPayoutsService _instantPayoutsService; private InitializationService _initializationService; private ReviewingService _reviewingService; @@ -19,10 +19,10 @@ public class PayoutTest : BaseTest [TestInitialize] public void Init() { - _adyenClient = this.CreateApiKeyTestClient(); - _instantPayoutsService = new InstantPayoutsService(_adyenClient); - _initializationService = new InitializationService(_adyenClient); - _reviewingService = new ReviewingService(_adyenClient); + _client = this.CreateApiKeyTestClient(); + _instantPayoutsService = new InstantPayoutsService(_client); + _initializationService = new InitializationService(_client); + _reviewingService = new ReviewingService(_client); } [TestMethod] diff --git a/Adyen.Test/BaseTest.cs b/Adyen.Test/BaseTest.cs index 1348022aa..f9e195846 100644 --- a/Adyen.Test/BaseTest.cs +++ b/Adyen.Test/BaseTest.cs @@ -199,7 +199,7 @@ protected Amount.PaymentMethodsRequest CreatePaymentMethodRequest(string merchan /// Creates mock test client without any response ///
/// IClient implementation - protected AdyenClient CreateMockForAdyenClientTest(Config config) + protected Client CreateMockForAdyenClientTest(Config config) { //Create a mock interface ClientInterfaceSubstitute = Substitute.For(); @@ -208,7 +208,7 @@ protected AdyenClient CreateMockForAdyenClientTest(Config config) Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()).Returns(Task.FromResult("")); - var clientMock = new AdyenClient(config) + var clientMock = new Client(config) { HttpClient = ClientInterfaceSubstitute, Config = config @@ -221,7 +221,7 @@ protected AdyenClient CreateMockForAdyenClientTest(Config config) /// /// The file that is returned /// IClient implementation - protected AdyenClient CreateMockTestClientRequest(string fileName) + protected Client CreateMockTestClientRequest(string fileName) { var mockPath = GetMockFilePath(fileName); var response = MockFileToString(mockPath); @@ -236,7 +236,7 @@ protected AdyenClient CreateMockTestClientRequest(string fileName) { Environment = Model.Environment.Test }; - var clientMock = new AdyenClient(config) + var clientMock = new Client(config) { HttpClient = ClientInterfaceSubstitute, Config = new Config @@ -254,7 +254,7 @@ protected AdyenClient CreateMockTestClientRequest(string fileName) /// /// The file that is returned /// IClient implementation - protected AdyenClient CreateMockTestClientApiKeyBasedRequestAsync(string fileName) + protected Client CreateMockTestClientApiKeyBasedRequestAsync(string fileName) { var mockPath = GetMockFilePath(fileName); var response = MockFileToString(mockPath); @@ -268,7 +268,7 @@ protected AdyenClient CreateMockTestClientApiKeyBasedRequestAsync(string fileNam { Environment = Model.Environment.Test }; - var clientMock = new AdyenClient(config) + var clientMock = new Client(config) { HttpClient = ClientInterfaceSubstitute, Config = new Config @@ -286,7 +286,7 @@ protected AdyenClient CreateMockTestClientApiKeyBasedRequestAsync(string fileNam /// /// The file that is returned /// IClient implementation - protected AdyenClient CreateAsyncMockTestClientApiKeyBasedRequest(string fileName) + protected Client CreateAsyncMockTestClientApiKeyBasedRequest(string fileName) { var mockPath = GetMockFilePath(fileName); var response = MockFileToString(mockPath); @@ -307,7 +307,7 @@ protected AdyenClient CreateAsyncMockTestClientApiKeyBasedRequest(string fileNam { Environment = Model.Environment.Test }; - var clientMock = new AdyenClient(config) + var clientMock = new Client(config) { HttpClient = ClientInterfaceSubstitute, Config = configWithApiKey @@ -320,7 +320,7 @@ protected AdyenClient CreateAsyncMockTestClientApiKeyBasedRequest(string fileNam /// /// The file that is returned /// IClient implementation - protected AdyenClient CreateMockTestClientPosCloudApiRequest(string fileName) + protected Client CreateMockTestClientPosCloudApiRequest(string fileName) { var config = new Config { CloudApiEndPoint = ClientConfig.CloudApiEndPointTest }; var mockPath = GetMockFilePath(fileName); @@ -339,7 +339,7 @@ protected AdyenClient CreateMockTestClientPosCloudApiRequest(string fileName) { Environment = Model.Environment.Test }; - var clientMock = new AdyenClient(anyConfig) + var clientMock = new Client(anyConfig) { HttpClient = ClientInterfaceSubstitute, Config = config @@ -352,7 +352,7 @@ protected AdyenClient CreateMockTestClientPosCloudApiRequest(string fileName) /// /// The file that is returned /// IClient implementation - protected AdyenClient CreateMockTestClientPosLocalApiRequest(string fileName) + protected Client CreateMockTestClientPosLocalApiRequest(string fileName) { var config = new Config { @@ -375,7 +375,7 @@ protected AdyenClient CreateMockTestClientPosLocalApiRequest(string fileName) { Environment = Model.Environment.Test }; - var clientMock = new AdyenClient(anyConfig) + var clientMock = new Client(anyConfig) { HttpClient = ClientInterfaceSubstitute, Config = config diff --git a/Adyen.Test/CheckoutTest.cs b/Adyen.Test/CheckoutTest.cs index 9c2f66191..c90aa5f3c 100644 --- a/Adyen.Test/CheckoutTest.cs +++ b/Adyen.Test/CheckoutTest.cs @@ -60,7 +60,7 @@ public void CheckoutEndpointLiveEnvironmentSuccessTest() public void CheckoutEndpointLiveErrorTest() { var config = new Config(); - var client = new AdyenClient(config); + var client = new Client(config); client.SetEnvironment(Environment.Live, null); Assert.ThrowsException(() => new PaymentsService(client)); } @@ -71,7 +71,7 @@ public void CheckoutEndpointLiveErrorTest() [TestMethod] public void CheckoutEndpointLiveWithBasicAuthErrorTest() { - var client = new AdyenClient(new Config() + var client = new Client(new Config() { Username = "ws_*******", Password = "*******", @@ -1045,9 +1045,9 @@ public void CheckoutServiceInterfaceTest() public class MyRecurringService : IRecurringService { private readonly IClient _client; - public MyRecurringService(AdyenClient adyenClient) + public MyRecurringService(Client client) { - _client = adyenClient.HttpClient; + _client = client.HttpClient; } public void DeleteTokenForStoredPaymentDetails(string recurringId, string shopperReference = default, diff --git a/Adyen.Test/AdyenClientTest.cs b/Adyen.Test/ClientTest.cs similarity index 85% rename from Adyen.Test/AdyenClientTest.cs rename to Adyen.Test/ClientTest.cs index b4134201d..a592d91e0 100644 --- a/Adyen.Test/AdyenClientTest.cs +++ b/Adyen.Test/ClientTest.cs @@ -6,12 +6,12 @@ namespace Adyen.Test { [TestClass] - public class AdyenClientTest + public class ClientTest { [TestMethod] public void HttpClientFirstCallReturnsDefaultHttpClient() { - var client = new AdyenClient(new Config()); + var client = new Client(new Config()); var httpClient = client.HttpClient; Assert.IsNotNull(httpClient); } @@ -19,7 +19,7 @@ public void HttpClientFirstCallReturnsDefaultHttpClient() [TestMethod] public void TestSetEnvironment() { - var client = new AdyenClient(new Config()); + var client = new Client(new Config()); client.SetEnvironment(Environment.Live, "testPrefix.adyen.com"); Assert.AreEqual(Environment.Live, client.Config.Environment); @@ -32,14 +32,14 @@ public void TestSetEnvironment() Assert.AreEqual("https://terminal-api-test.adyen.com", client.Config.CloudApiEndPoint); } - AdyenClient _testAdyenClient; + Client _testClient; String logLine; [TestInitialize] public void TestSetup() { - _testAdyenClient = new AdyenClient(new Config()); - _testAdyenClient.LogCallback += new AdyenClient.CallbackLogHandler((message) => { + _testClient = new Client(new Config()); + _testClient.LogCallback += new Client.CallbackLogHandler((message) => { logLine = message; }); @@ -47,7 +47,7 @@ public void TestSetup() [TestMethod] public void TestLogLine() { - _testAdyenClient.LogLine("testMessage"); + _testClient.LogLine("testMessage"); Assert.AreEqual("testMessage", logLine); } @@ -63,7 +63,7 @@ public void When_Region_Specified_Returns_TerminalApi_LiveEndpointUrl(Environmen Environment = environment, TerminalApiRegion = region }; - var client = new AdyenClient(config); + var client = new Client(config); Assert.AreEqual(expectedEndpoint, client.Config.CloudApiEndPoint); } @@ -75,7 +75,7 @@ public void When_Region_Is_India_And_Environment_Is_Live_Throws_ArgumentOutOfRan Environment = Environment.Live, TerminalApiRegion = Region.IN }; - Assert.ThrowsException(() => new AdyenClient(config)); + Assert.ThrowsException(() => new Client(config)); } [DataTestMethod] @@ -91,7 +91,7 @@ public void Client_Should_Always_Return_TerminalApi_TestEndpointUrl(Environment Environment = environment, TerminalApiRegion = region }; - var client = new AdyenClient(config); + var client = new Client(config); Assert.AreEqual(expectedEndpoint, client.Config.CloudApiEndPoint); } @@ -114,26 +114,26 @@ public void When_Custom_CloudApiEndpoint_Is_Specified_And_Environment_Is_Test_Or TerminalApiRegion = region, CloudApiEndPoint = "https://localhost:443/nexo" }; - var client = new AdyenClient(config); + var client = new Client(config); Assert.AreEqual("https://localhost:443/nexo", client.Config.CloudApiEndPoint); } [TestMethod] public void TestSetTerminalApiRegion() { - var clientAU = new AdyenClient(new Config + var clientAU = new Client(new Config {Environment = Environment.Live, TerminalApiRegion = Region.AU}); Assert.AreEqual(clientAU.GetCloudApiEndpoint(), ClientConfig.CloudApiEndPointAULive); - var clientEU = new AdyenClient(new Config + var clientEU = new Client(new Config {Environment = Environment.Live, TerminalApiRegion = Region.EU}); Assert.AreEqual(clientEU.GetCloudApiEndpoint(), ClientConfig.CloudApiEndPointEULive); - var clientUS = new AdyenClient(new Config + var clientUS = new Client(new Config {Environment = Environment.Live, TerminalApiRegion = Region.US}); Assert.AreEqual(clientUS.GetCloudApiEndpoint(), ClientConfig.CloudApiEndPointUSLive); - var clientAPSE = new AdyenClient(new Config + var clientAPSE = new Client(new Config {Environment = Environment.Live, TerminalApiRegion = Region.APSE}); Assert.AreEqual(clientAPSE.GetCloudApiEndpoint(), ClientConfig.CloudApiEndPointAPSELive); - var clientDefault = new AdyenClient(new Config {Environment = Environment.Live}); + var clientDefault = new Client(new Config {Environment = Environment.Live}); Assert.AreEqual(clientDefault.GetCloudApiEndpoint(), ClientConfig.CloudApiEndPointEULive); } } diff --git a/Adyen.Test/ExtensionsTest.cs b/Adyen.Test/ExtensionsTest.cs index cf207eac8..defc01802 100644 --- a/Adyen.Test/ExtensionsTest.cs +++ b/Adyen.Test/ExtensionsTest.cs @@ -14,14 +14,14 @@ namespace Adyen.Test [TestClass] public class ExtensionsTest : BaseTest { - private AdyenClient _adyenClient; + private Client _client; [TestInitialize] public void Init() { - _adyenClient = CreateMockTestClientApiKeyBasedRequestAsync(""); - _adyenClient.Config.Environment = Environment.Live; - _adyenClient.Config.LiveEndpointUrlPrefix = "prefix"; + _client = CreateMockTestClientApiKeyBasedRequestAsync(""); + _client.Config.Environment = Environment.Live; + _client.Config.LiveEndpointUrlPrefix = "prefix"; } [TestMethod] @@ -40,7 +40,7 @@ public void TestDeviceRenderOptionsObjectListToString() [TestMethod] public void TestPalLiveEndPoint() { - var service = new BalanceControlService(_adyenClient); + var service = new BalanceControlService(_client); service.BalanceTransfer(new BalanceTransferRequest()); ClientInterfaceSubstitute.Received().RequestAsync( "https://prefix-pal-live.adyenpayments.com/pal/servlet/BalanceControl/v1/balanceTransfer", @@ -50,7 +50,7 @@ public void TestPalLiveEndPoint() [TestMethod] public void TestCheckoutLiveEndPoint() { - var service = new DonationsService(_adyenClient); + var service = new DonationsService(_client); service.Donations(new DonationPaymentRequest()); ClientInterfaceSubstitute.Received().RequestAsync( "https://prefix-checkout-live.adyenpayments.com/checkout/v71/donations", @@ -60,7 +60,7 @@ public void TestCheckoutLiveEndPoint() [TestMethod] public void TestBclLiveEndPoint() { - var service = new AccountHoldersService(_adyenClient); + var service = new AccountHoldersService(_client); service.GetAllBalanceAccountsOfAccountHolder("id", offset: 3, limit: 5); ClientInterfaceSubstitute.Received().RequestAsync( "https://balanceplatform-api-live.adyen.com/bcl/v2/accountHolders/id/balanceAccounts?offset=3&limit=5", diff --git a/Adyen.Test/ProxyTest.cs b/Adyen.Test/ProxyTest.cs index 39b5600ef..47b183ddb 100644 --- a/Adyen.Test/ProxyTest.cs +++ b/Adyen.Test/ProxyTest.cs @@ -11,7 +11,7 @@ public void CreateClientWithNullProxyConfiguration() { var config = new Config(); config.Proxy = null; - var client = new AdyenClient(config); + var client = new Client(config); Assert.AreEqual(client.Config.Proxy, config.Proxy); } @@ -20,7 +20,7 @@ public void CreateClientWithProxyConfiguration() { var config = new Config(); config.Proxy = new WebProxy(); - var client = new AdyenClient(config); + var client = new Client(config); Assert.AreEqual(client.Config.Proxy, config.Proxy); } } diff --git a/Adyen.Test/RecurringTest.cs b/Adyen.Test/RecurringTest.cs index d133952af..acdd8e621 100644 --- a/Adyen.Test/RecurringTest.cs +++ b/Adyen.Test/RecurringTest.cs @@ -60,8 +60,8 @@ public async Task TestDisableAsync() [TestMethod] public void NotifyShopperTest() { - AdyenClient adyenClient = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/notifyShopper-success.json"); - var recurring = new Service.RecurringService(adyenClient); + Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/notifyShopper-success.json"); + var recurring = new Service.RecurringService(client); NotifyShopperRequest request = CreateNotifyShopperRequest(); NotifyShopperResult result = recurring.NotifyShopper(request); Assert.IsNotNull(result); @@ -76,8 +76,8 @@ public void NotifyShopperTest() [TestMethod] public void CreatePermitTest() { - AdyenClient adyenClient = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/createPermit-success.json"); - var recurring = new Service.RecurringService(adyenClient); + Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/createPermit-success.json"); + var recurring = new Service.RecurringService(client); var createPermitResult = recurring.CreatePermit(new CreatePermitRequest()); Assert.IsNotNull(createPermitResult); Assert.AreEqual("string", createPermitResult.PspReference); @@ -87,8 +87,8 @@ public void CreatePermitTest() [TestMethod] public void DisablePermitTest() { - AdyenClient adyenClient = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/disablePermit-success.json"); - var recurring = new Service.RecurringService(adyenClient); + Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/disablePermit-success.json"); + var recurring = new Service.RecurringService(client); var disablePermitResult = recurring.DisablePermit(new DisablePermitRequest()); Assert.IsNotNull(disablePermitResult); Assert.AreEqual("string", disablePermitResult.PspReference); @@ -98,8 +98,8 @@ public void DisablePermitTest() [TestMethod] public void ScheduleAccountUpdaterTest() { - AdyenClient adyenClient = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/scheduleAccountUpdater-success.json"); - var recurring = new Service.RecurringService(adyenClient); + Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/scheduleAccountUpdater-success.json"); + var recurring = new Service.RecurringService(client); var scheduleAccountUpdaterResult = recurring.ScheduleAccountUpdater(new ScheduleAccountUpdaterRequest()); Assert.IsNotNull(scheduleAccountUpdaterResult); Assert.AreEqual("string", scheduleAccountUpdaterResult.PspReference); diff --git a/Adyen.Test/TerminalApi/TerminalApiAsyncServiceTest.cs b/Adyen.Test/TerminalApi/TerminalApiAsyncServiceTest.cs index e7d6f0772..916546171 100644 --- a/Adyen.Test/TerminalApi/TerminalApiAsyncServiceTest.cs +++ b/Adyen.Test/TerminalApi/TerminalApiAsyncServiceTest.cs @@ -22,8 +22,8 @@ public async Task RequestEncryptedAsync_Success() KeyIdentifier = "CryptoKeyIdentifier12345", Password = "p@ssw0rd123456" }; - AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); - ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); + ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); string response = await asyncService.RequestEncryptedAsync(saleToPoiRequest, encryptionCredentialDetails, new CancellationToken()); Assert.AreEqual(response, "ok"); } @@ -39,8 +39,8 @@ public void RequestEncrypted_Success() KeyIdentifier = "CryptoKeyIdentifier12345", Password = "p@ssw0rd123456" }; - AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); - ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); + ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); string response = asyncService.RequestEncrypted(saleToPoiRequest, encryptionCredentialDetails); Assert.AreEqual(response, "ok"); } @@ -49,8 +49,8 @@ public void RequestEncrypted_Success() public async Task RequestAsync_Success() { SaleToPOIRequest saleToPoiRequest = MockPosApiRequest.CreatePosPaymentRequest(); - AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); - ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); + ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); string response = await asyncService.RequestAsync(saleToPoiRequest, new CancellationToken()); Assert.AreEqual(response, "ok"); } @@ -60,8 +60,8 @@ public async Task RequestAsync_Success() public void Request_Success() { SaleToPOIRequest saleToPoiRequest = MockPosApiRequest.CreatePosPaymentRequest(); - AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); - ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-async-success.json"); + ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); string response = asyncService.Request(saleToPoiRequest); Assert.AreEqual(response, "ok"); } @@ -78,8 +78,8 @@ public void DecryptNotification_Success() string encryptedNotification = @"{""SaleToPOIRequest"":{""SecurityTrailer"":{""AdyenCryptoVersion"":1,""Nonce"":""Be6rAx+vRju2aCHwPh6lrg=="",""KeyIdentifier"":""ncrkey"",""Hmac"":""LG8A9Re1M8xLMr7rDUk0NwsnvAOX+VLjHv9sPHWTl34="",""KeyVersion"":1},""NexoBlob"":""x2DY8J2M9ZCyjOZ8Gt7JdLBA\/6bT\/KXvvAbJf9kzguqO8dWp1I1pPLQpLstpdIiAVqSwG3PR0PrP\/lF82UmhmCnUJGCuEXilqvBNF1tF\/yEgnFOklNc1myR2IPW\/+2oZOWKFXlTo\/gX89EbODXOOGUqaJfSdpDhlqjyMz7mGczobTPvPGqCVx2BDHU8VTxI9nicwQv+QV48GqVZzxnP8ZOdQOQ5cac+bcS0Y3l7SmWpIoQsoicnjahTY9ICosLJmN4DvDHsN4Kh2DAetFO5b9I9Lqgm\/dvnXUVhb9tPbM7Pn+ratjYpaNbonbO5M+Tm8rDEIyKoUUuFXPWISymrCXtCDVKEb2B5S5pilUmokrXVa9Ldtsv3BKG7rbrglYEuql4WVs6kzr6ybgAKh1Q0LsAXEve3pydt72ay4U3FOJSBxJ3gNqmnG8mVW2HCXQVo1RgVaZmP5TBWYuksCKXYypnMulu1PlRI++oeW\/J2qjQU="",""MessageHeader"":{""ProtocolVersion"":""3.0"",""SaleID"":""null"",""MessageClass"":""Event"",""MessageCategory"":""Event"",""POIID"":""P400Plus-275102806"",""MessageType"":""Notification"",""DeviceID"":""5""}}}"; string expectedDecryption = @"{ ""SaleToPOIRequest"": { ""EventNotification"": { ""EventDetails"": ""reference_id=9876"", ""TimeStamp"": ""2020-11-13T09:02:35.697Z"", ""EventToNotify"": ""SaleWakeUp"" }, ""MessageHeader"": { ""ProtocolVersion"": ""3.0"", ""SaleID"": ""null"", ""MessageClass"": ""Event"", ""MessageCategory"": ""Event"", ""POIID"": ""P400Plus-275102806"", ""MessageType"": ""Notification"", ""DeviceID"": ""5"" } } }"; - AdyenClient adyenClient = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); - ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + Client client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); + ITerminalApiAsyncService asyncService = new TerminalApiAsyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); string decryptedNotification = asyncService.DecryptNotification(encryptedNotification, encryptionCredentialDetails); Assert.AreEqual(decryptedNotification, expectedDecryption); } diff --git a/Adyen.Test/TerminalApi/TerminalApiLocalServiceTest.cs b/Adyen.Test/TerminalApi/TerminalApiLocalServiceTest.cs index ff3ae3f6b..ad119cf44 100644 --- a/Adyen.Test/TerminalApi/TerminalApiLocalServiceTest.cs +++ b/Adyen.Test/TerminalApi/TerminalApiLocalServiceTest.cs @@ -24,8 +24,8 @@ public async Task RequestEncryptedAsync_Success() KeyIdentifier = "CryptoKeyIdentifier12345", Password = "p@ssw0rd123456" }; - AdyenClient adyenClient = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); - ITerminalApiLocalService localService = new TerminalApiLocalService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + Client client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); + ITerminalApiLocalService localService = new TerminalApiLocalService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = await localService.RequestEncryptedAsync(saleToPoiRequest, encryptionCredentialDetails, new CancellationToken()); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); @@ -42,8 +42,8 @@ public void RequestEncrypted_Success() KeyIdentifier = "CryptoKeyIdentifier12345", Password = "p@ssw0rd123456" }; - AdyenClient adyenClient = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); - ITerminalApiLocalService localService = new TerminalApiLocalService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + Client client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); + ITerminalApiLocalService localService = new TerminalApiLocalService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = localService.RequestEncrypted(saleToPoiRequest, encryptionCredentialDetails); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); @@ -53,8 +53,8 @@ public void RequestEncrypted_Success() public async Task RequestAsync_Success() { SaleToPOIRequest saleToPoiRequest = MockPosApiRequest.CreatePosPaymentRequest(); - AdyenClient adyenClient = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-success.json"); - ITerminalApiLocalService localService = new TerminalApiLocalService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + Client client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-success.json"); + ITerminalApiLocalService localService = new TerminalApiLocalService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = await localService.RequestAsync(saleToPoiRequest, new CancellationToken()); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); @@ -64,8 +64,8 @@ public async Task RequestAsync_Success() public void Request_Success() { SaleToPOIRequest saleToPoiRequest = MockPosApiRequest.CreatePosPaymentRequest(); - AdyenClient adyenClient = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-success.json"); - ITerminalApiLocalService localService = new TerminalApiLocalService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + Client client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-success.json"); + ITerminalApiLocalService localService = new TerminalApiLocalService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = localService.Request(saleToPoiRequest); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); diff --git a/Adyen.Test/TerminalApi/TerminalApiPosRequestTest.cs b/Adyen.Test/TerminalApi/TerminalApiPosRequestTest.cs index 651f24a08..ecab163ca 100644 --- a/Adyen.Test/TerminalApi/TerminalApiPosRequestTest.cs +++ b/Adyen.Test/TerminalApi/TerminalApiPosRequestTest.cs @@ -32,7 +32,7 @@ public void TestTerminalApiRequest() //create a mock client var client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); var terminalLocalApi = new TerminalLocalApi(client); - var configEndpoint = terminalLocalApi.AdyenClient.Config.LocalTerminalApiEndpoint; + var configEndpoint = terminalLocalApi.Client.Config.LocalTerminalApiEndpoint; var saleToPoiResponse = terminalLocalApi.TerminalRequest(paymentRequest, _encryptionCredentialDetails); Assert.AreEqual(configEndpoint, @"https://_terminal_:8443/nexo/"); Assert.IsNotNull(saleToPoiResponse); @@ -53,7 +53,7 @@ public void TestTerminalApiAsyncRequest() //create a mock client var client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); var terminalLocalApi = new TerminalLocalApi(client); - var configEndpoint = terminalLocalApi.AdyenClient.Config.LocalTerminalApiEndpoint; + var configEndpoint = terminalLocalApi.Client.Config.LocalTerminalApiEndpoint; var saleToPoiResponse = terminalLocalApi.TerminalRequestAsync(paymentRequest, _encryptionCredentialDetails); Assert.AreEqual(configEndpoint, @"https://_terminal_:8443/nexo/"); Assert.IsNotNull(saleToPoiResponse); @@ -92,7 +92,7 @@ public void TestTerminalApiRequestEmptySecurityTrailer() //create a mock client var client = CreateMockTestClientPosLocalApiRequest("mocks/terminalapi/pospayment-no-security-trailer.json"); var terminalLocalApi = new TerminalLocalApi(client); - var configEndpoint = terminalLocalApi.AdyenClient.Config.LocalTerminalApiEndpoint; + var configEndpoint = terminalLocalApi.Client.Config.LocalTerminalApiEndpoint; var saleToPoiResponse = terminalLocalApi.TerminalRequest(paymentRequest, _encryptionCredentialDetails); Assert.AreEqual(configEndpoint, @"https://_terminal_:8443/nexo/"); } diff --git a/Adyen.Test/TerminalApi/TerminalApiSyncServiceTest.cs b/Adyen.Test/TerminalApi/TerminalApiSyncServiceTest.cs index dd34ac428..e154c4e78 100644 --- a/Adyen.Test/TerminalApi/TerminalApiSyncServiceTest.cs +++ b/Adyen.Test/TerminalApi/TerminalApiSyncServiceTest.cs @@ -23,8 +23,8 @@ public async Task RequestEncryptedAsync_Success() KeyIdentifier = "CryptoKeyIdentifier12345", Password = "p@ssw0rd123456" }; - AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); - ITerminalApiSyncService syncService = new TerminalApiSyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); + ITerminalApiSyncService syncService = new TerminalApiSyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = await syncService.RequestEncryptedAsync(saleToPoiRequest, encryptionCredentialDetails, new CancellationToken()); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); @@ -41,8 +41,8 @@ public void RequestEncrypted_Success() KeyIdentifier = "CryptoKeyIdentifier12345", Password = "p@ssw0rd123456" }; - AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); - ITerminalApiSyncService syncService = new TerminalApiSyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-encrypted-success.json"); + ITerminalApiSyncService syncService = new TerminalApiSyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = syncService.RequestEncrypted(saleToPoiRequest, encryptionCredentialDetails); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); @@ -52,8 +52,8 @@ public void RequestEncrypted_Success() public async Task RequestAsync_Success() { SaleToPOIRequest saleToPoiRequest = MockPosApiRequest.CreatePosPaymentRequest(); - AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-success.json"); - ITerminalApiSyncService syncService = new TerminalApiSyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-success.json"); + ITerminalApiSyncService syncService = new TerminalApiSyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = await syncService.RequestAsync(saleToPoiRequest, new CancellationToken()); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); @@ -63,8 +63,8 @@ public async Task RequestAsync_Success() public void Request_Success() { SaleToPOIRequest saleToPoiRequest = MockPosApiRequest.CreatePosPaymentRequest(); - AdyenClient adyenClient = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-success.json"); - ITerminalApiSyncService syncService = new TerminalApiSyncService(adyenClient, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); + Client client = CreateMockTestClientPosCloudApiRequest("mocks/terminalapi/pospayment-success.json"); + ITerminalApiSyncService syncService = new TerminalApiSyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = syncService.Request(saleToPoiRequest); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Assert.AreEqual(paymentResponse?.Response.Result, ResultType.Success); diff --git a/Adyen/Service/BalanceControlService.cs b/Adyen/Service/BalanceControlService.cs index d853a6f30..ef1052ff1 100644 --- a/Adyen/Service/BalanceControlService.cs +++ b/Adyen/Service/BalanceControlService.cs @@ -52,7 +52,7 @@ public class BalanceControlService : AbstractService, IBalanceControlService { private readonly string _baseUrl; - public BalanceControlService(AdyenClient adyenClient) : base(adyenClient) + public BalanceControlService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/BalanceControl/v1"); } diff --git a/Adyen/Service/BalancePlatform/AccountHoldersService.cs b/Adyen/Service/BalancePlatform/AccountHoldersService.cs index 03719d9ab..0bb03115c 100644 --- a/Adyen/Service/BalancePlatform/AccountHoldersService.cs +++ b/Adyen/Service/BalancePlatform/AccountHoldersService.cs @@ -145,7 +145,7 @@ public class AccountHoldersService : AbstractService, IAccountHoldersService { private readonly string _baseUrl; - public AccountHoldersService(AdyenClient adyenClient) : base(adyenClient) + public AccountHoldersService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/BalanceAccountsService.cs b/Adyen/Service/BalancePlatform/BalanceAccountsService.cs index 456d71447..36438a81d 100644 --- a/Adyen/Service/BalancePlatform/BalanceAccountsService.cs +++ b/Adyen/Service/BalancePlatform/BalanceAccountsService.cs @@ -223,7 +223,7 @@ public class BalanceAccountsService : AbstractService, IBalanceAccountsService { private readonly string _baseUrl; - public BalanceAccountsService(AdyenClient adyenClient) : base(adyenClient) + public BalanceAccountsService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/BankAccountValidationService.cs b/Adyen/Service/BalancePlatform/BankAccountValidationService.cs index 6557717e1..0eb5228d1 100644 --- a/Adyen/Service/BalancePlatform/BankAccountValidationService.cs +++ b/Adyen/Service/BalancePlatform/BankAccountValidationService.cs @@ -48,7 +48,7 @@ public class BankAccountValidationService : AbstractService, IBankAccountValidat { private readonly string _baseUrl; - public BankAccountValidationService(AdyenClient adyenClient) : base(adyenClient) + public BankAccountValidationService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/CardOrdersService.cs b/Adyen/Service/BalancePlatform/CardOrdersService.cs index 80466fa53..9db6ccf97 100644 --- a/Adyen/Service/BalancePlatform/CardOrdersService.cs +++ b/Adyen/Service/BalancePlatform/CardOrdersService.cs @@ -91,7 +91,7 @@ public class CardOrdersService : AbstractService, ICardOrdersService { private readonly string _baseUrl; - public CardOrdersService(AdyenClient adyenClient) : base(adyenClient) + public CardOrdersService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/GrantAccountsService.cs b/Adyen/Service/BalancePlatform/GrantAccountsService.cs index d3435a821..28bbcbc56 100644 --- a/Adyen/Service/BalancePlatform/GrantAccountsService.cs +++ b/Adyen/Service/BalancePlatform/GrantAccountsService.cs @@ -52,7 +52,7 @@ public class GrantAccountsService : AbstractService, IGrantAccountsService { private readonly string _baseUrl; - public GrantAccountsService(AdyenClient adyenClient) : base(adyenClient) + public GrantAccountsService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/GrantOffersService.cs b/Adyen/Service/BalancePlatform/GrantOffersService.cs index 0e3ab9ef9..347f55d5d 100644 --- a/Adyen/Service/BalancePlatform/GrantOffersService.cs +++ b/Adyen/Service/BalancePlatform/GrantOffersService.cs @@ -71,7 +71,7 @@ public class GrantOffersService : AbstractService, IGrantOffersService { private readonly string _baseUrl; - public GrantOffersService(AdyenClient adyenClient) : base(adyenClient) + public GrantOffersService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/ManageCardPINService.cs b/Adyen/Service/BalancePlatform/ManageCardPINService.cs index 83498c74b..01b16f43d 100644 --- a/Adyen/Service/BalancePlatform/ManageCardPINService.cs +++ b/Adyen/Service/BalancePlatform/ManageCardPINService.cs @@ -86,7 +86,7 @@ public class ManageCardPINService : AbstractService, IManageCardPINService { private readonly string _baseUrl; - public ManageCardPINService(AdyenClient adyenClient) : base(adyenClient) + public ManageCardPINService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/ManageSCADevicesService.cs b/Adyen/Service/BalancePlatform/ManageSCADevicesService.cs index bb889e710..be9278d7a 100644 --- a/Adyen/Service/BalancePlatform/ManageSCADevicesService.cs +++ b/Adyen/Service/BalancePlatform/ManageSCADevicesService.cs @@ -145,7 +145,7 @@ public class ManageSCADevicesService : AbstractService, IManageSCADevicesService { private readonly string _baseUrl; - public ManageSCADevicesService(AdyenClient adyenClient) : base(adyenClient) + public ManageSCADevicesService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/NetworkTokensService.cs b/Adyen/Service/BalancePlatform/NetworkTokensService.cs index 0fcb925e9..bc270a550 100644 --- a/Adyen/Service/BalancePlatform/NetworkTokensService.cs +++ b/Adyen/Service/BalancePlatform/NetworkTokensService.cs @@ -67,7 +67,7 @@ public class NetworkTokensService : AbstractService, INetworkTokensService { private readonly string _baseUrl; - public NetworkTokensService(AdyenClient adyenClient) : base(adyenClient) + public NetworkTokensService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs b/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs index a05c3c56d..9ec50ed2a 100644 --- a/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs +++ b/Adyen/Service/BalancePlatform/PaymentInstrumentGroupsService.cs @@ -84,7 +84,7 @@ public class PaymentInstrumentGroupsService : AbstractService, IPaymentInstrumen { private readonly string _baseUrl; - public PaymentInstrumentGroupsService(AdyenClient adyenClient) : base(adyenClient) + public PaymentInstrumentGroupsService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs b/Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs index 88c504b29..fa5fb9f7c 100644 --- a/Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs +++ b/Adyen/Service/BalancePlatform/PaymentInstrumentsService.cs @@ -154,7 +154,7 @@ public class PaymentInstrumentsService : AbstractService, IPaymentInstrumentsSer { private readonly string _baseUrl; - public PaymentInstrumentsService(AdyenClient adyenClient) : base(adyenClient) + public PaymentInstrumentsService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/PlatformService.cs b/Adyen/Service/BalancePlatform/PlatformService.cs index d76d89684..a1209432d 100644 --- a/Adyen/Service/BalancePlatform/PlatformService.cs +++ b/Adyen/Service/BalancePlatform/PlatformService.cs @@ -88,7 +88,7 @@ public class PlatformService : AbstractService, IPlatformService { private readonly string _baseUrl; - public PlatformService(AdyenClient adyenClient) : base(adyenClient) + public PlatformService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/TransactionRulesService.cs b/Adyen/Service/BalancePlatform/TransactionRulesService.cs index 6cbb731dd..9e1b02719 100644 --- a/Adyen/Service/BalancePlatform/TransactionRulesService.cs +++ b/Adyen/Service/BalancePlatform/TransactionRulesService.cs @@ -103,7 +103,7 @@ public class TransactionRulesService : AbstractService, ITransactionRulesService { private readonly string _baseUrl; - public TransactionRulesService(AdyenClient adyenClient) : base(adyenClient) + public TransactionRulesService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BalancePlatform/TransferRoutesService.cs b/Adyen/Service/BalancePlatform/TransferRoutesService.cs index 7f4fa3a66..2f64bb58f 100644 --- a/Adyen/Service/BalancePlatform/TransferRoutesService.cs +++ b/Adyen/Service/BalancePlatform/TransferRoutesService.cs @@ -50,7 +50,7 @@ public class TransferRoutesService : AbstractService, ITransferRoutesService { private readonly string _baseUrl; - public TransferRoutesService(AdyenClient adyenClient) : base(adyenClient) + public TransferRoutesService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); } diff --git a/Adyen/Service/BinLookupService.cs b/Adyen/Service/BinLookupService.cs index 5cf2734ee..2e77f2293 100644 --- a/Adyen/Service/BinLookupService.cs +++ b/Adyen/Service/BinLookupService.cs @@ -67,7 +67,7 @@ public class BinLookupService : AbstractService, IBinLookupService { private readonly string _baseUrl; - public BinLookupService(AdyenClient adyenClient) : base(adyenClient) + public BinLookupService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/BinLookup/v54"); } diff --git a/Adyen/Service/Checkout/DonationsService.cs b/Adyen/Service/Checkout/DonationsService.cs index ba1a57496..c9e869252 100644 --- a/Adyen/Service/Checkout/DonationsService.cs +++ b/Adyen/Service/Checkout/DonationsService.cs @@ -67,7 +67,7 @@ public class DonationsService : AbstractService, IDonationsService { private readonly string _baseUrl; - public DonationsService(AdyenClient client) : base(client) + public DonationsService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/Checkout/ModificationsService.cs b/Adyen/Service/Checkout/ModificationsService.cs index dd755c4c6..6a2c6ac91 100644 --- a/Adyen/Service/Checkout/ModificationsService.cs +++ b/Adyen/Service/Checkout/ModificationsService.cs @@ -145,7 +145,7 @@ public class ModificationsService : AbstractService, IModificationsService { private readonly string _baseUrl; - public ModificationsService(AdyenClient client) : base(client) + public ModificationsService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/Checkout/OrdersService.cs b/Adyen/Service/Checkout/OrdersService.cs index 61f1a97a3..d034ecd83 100644 --- a/Adyen/Service/Checkout/OrdersService.cs +++ b/Adyen/Service/Checkout/OrdersService.cs @@ -84,7 +84,7 @@ public class OrdersService : AbstractService, IOrdersService { private readonly string _baseUrl; - public OrdersService(AdyenClient client) : base(client) + public OrdersService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/Checkout/PaymentLinksService.cs b/Adyen/Service/Checkout/PaymentLinksService.cs index 943ce428d..bb88e898c 100644 --- a/Adyen/Service/Checkout/PaymentLinksService.cs +++ b/Adyen/Service/Checkout/PaymentLinksService.cs @@ -86,7 +86,7 @@ public class PaymentLinksService : AbstractService, IPaymentLinksService { private readonly string _baseUrl; - public PaymentLinksService(AdyenClient client) : base(client) + public PaymentLinksService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/Checkout/PaymentsService.cs b/Adyen/Service/Checkout/PaymentsService.cs index 6c29b22cb..363f8c1e5 100644 --- a/Adyen/Service/Checkout/PaymentsService.cs +++ b/Adyen/Service/Checkout/PaymentsService.cs @@ -137,7 +137,7 @@ public class PaymentsService : AbstractService, IPaymentsService { private readonly string _baseUrl; - public PaymentsService(AdyenClient client) : base(client) + public PaymentsService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/Checkout/RecurringService.cs b/Adyen/Service/Checkout/RecurringService.cs index 46f6571c0..2342ff512 100644 --- a/Adyen/Service/Checkout/RecurringService.cs +++ b/Adyen/Service/Checkout/RecurringService.cs @@ -88,7 +88,7 @@ public class RecurringService : AbstractService, IRecurringService { private readonly string _baseUrl; - public RecurringService(AdyenClient client) : base(client) + public RecurringService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/Checkout/UtilityService.cs b/Adyen/Service/Checkout/UtilityService.cs index 8edd07053..c6360aa89 100644 --- a/Adyen/Service/Checkout/UtilityService.cs +++ b/Adyen/Service/Checkout/UtilityService.cs @@ -86,7 +86,7 @@ public class UtilityService : AbstractService, IUtilityService { private readonly string _baseUrl; - public UtilityService(AdyenClient client) : base(client) + public UtilityService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/v71"); } diff --git a/Adyen/Service/DataProtectionService.cs b/Adyen/Service/DataProtectionService.cs index cb488a5c6..be6c11ea1 100644 --- a/Adyen/Service/DataProtectionService.cs +++ b/Adyen/Service/DataProtectionService.cs @@ -50,7 +50,7 @@ public class DataProtectionService : AbstractService, IDataProtectionService { private readonly string _baseUrl; - public DataProtectionService(AdyenClient adyenClient) : base(adyenClient) + public DataProtectionService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://ca-test.adyen.com/ca/services/DataProtectionService/v1"); } diff --git a/Adyen/Service/DisputesService.cs b/Adyen/Service/DisputesService.cs index f8b48ee16..4df6826b4 100644 --- a/Adyen/Service/DisputesService.cs +++ b/Adyen/Service/DisputesService.cs @@ -118,7 +118,7 @@ public class DisputesService : AbstractService, IDisputesService { private readonly string _baseUrl; - public DisputesService(AdyenClient adyenClient) : base(adyenClient) + public DisputesService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://ca-test.adyen.com/ca/services/DisputeService/v30"); } diff --git a/Adyen/Service/LegalEntityManagement/BusinessLinesService.cs b/Adyen/Service/LegalEntityManagement/BusinessLinesService.cs index be9b8f14a..b81bbbab4 100644 --- a/Adyen/Service/LegalEntityManagement/BusinessLinesService.cs +++ b/Adyen/Service/LegalEntityManagement/BusinessLinesService.cs @@ -101,7 +101,7 @@ public class BusinessLinesService : AbstractService, IBusinessLinesService { private readonly string _baseUrl; - public BusinessLinesService(AdyenClient adyenClient) : base(adyenClient) + public BusinessLinesService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/DocumentsService.cs b/Adyen/Service/LegalEntityManagement/DocumentsService.cs index e9bf605fd..938f74ebc 100644 --- a/Adyen/Service/LegalEntityManagement/DocumentsService.cs +++ b/Adyen/Service/LegalEntityManagement/DocumentsService.cs @@ -103,7 +103,7 @@ public class DocumentsService : AbstractService, IDocumentsService { private readonly string _baseUrl; - public DocumentsService(AdyenClient adyenClient) : base(adyenClient) + public DocumentsService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs b/Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs index 20e378143..447f2e34d 100644 --- a/Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs +++ b/Adyen/Service/LegalEntityManagement/HostedOnboardingService.cs @@ -84,7 +84,7 @@ public class HostedOnboardingService : AbstractService, IHostedOnboardingService { private readonly string _baseUrl; - public HostedOnboardingService(AdyenClient adyenClient) : base(adyenClient) + public HostedOnboardingService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs b/Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs index e2a60993c..ea6ee0e56 100644 --- a/Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs +++ b/Adyen/Service/LegalEntityManagement/LegalEntitiesService.cs @@ -137,7 +137,7 @@ public class LegalEntitiesService : AbstractService, ILegalEntitiesService { private readonly string _baseUrl; - public LegalEntitiesService(AdyenClient adyenClient) : base(adyenClient) + public LegalEntitiesService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs b/Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs index d1816bc70..dc818a201 100644 --- a/Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs +++ b/Adyen/Service/LegalEntityManagement/PCIQuestionnairesService.cs @@ -126,7 +126,7 @@ public class PCIQuestionnairesService : AbstractService, IPCIQuestionnairesServi { private readonly string _baseUrl; - public PCIQuestionnairesService(AdyenClient adyenClient) : base(adyenClient) + public PCIQuestionnairesService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs b/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs index 61fa8c407..0a58b369c 100644 --- a/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs +++ b/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentService.cs @@ -67,7 +67,7 @@ public class TaxEDeliveryConsentService : AbstractService, ITaxEDeliveryConsentS { private readonly string _baseUrl; - public TaxEDeliveryConsentService(AdyenClient adyenClient) : base(adyenClient) + public TaxEDeliveryConsentService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs b/Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs index 03b83de5e..0f4677a9a 100644 --- a/Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs +++ b/Adyen/Service/LegalEntityManagement/TermsOfServiceService.cs @@ -128,7 +128,7 @@ public class TermsOfServiceService : AbstractService, ITermsOfServiceService { private readonly string _baseUrl; - public TermsOfServiceService(AdyenClient adyenClient) : base(adyenClient) + public TermsOfServiceService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs b/Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs index 6f99079e9..7c09f1900 100644 --- a/Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs +++ b/Adyen/Service/LegalEntityManagement/TransferInstrumentsService.cs @@ -101,7 +101,7 @@ public class TransferInstrumentsService : AbstractService, ITransferInstrumentsS { private readonly string _baseUrl; - public TransferInstrumentsService(AdyenClient adyenClient) : base(adyenClient) + public TransferInstrumentsService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://kyc-test.adyen.com/lem/v3"); } diff --git a/Adyen/Service/Management/APICredentialsCompanyLevelService.cs b/Adyen/Service/Management/APICredentialsCompanyLevelService.cs index e13581cc2..55e6938d6 100644 --- a/Adyen/Service/Management/APICredentialsCompanyLevelService.cs +++ b/Adyen/Service/Management/APICredentialsCompanyLevelService.cs @@ -113,7 +113,7 @@ public class APICredentialsCompanyLevelService : AbstractService, IAPICredential { private readonly string _baseUrl; - public APICredentialsCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) + public APICredentialsCompanyLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/APICredentialsMerchantLevelService.cs b/Adyen/Service/Management/APICredentialsMerchantLevelService.cs index d562253c1..70c1f663b 100644 --- a/Adyen/Service/Management/APICredentialsMerchantLevelService.cs +++ b/Adyen/Service/Management/APICredentialsMerchantLevelService.cs @@ -113,7 +113,7 @@ public class APICredentialsMerchantLevelService : AbstractService, IAPICredentia { private readonly string _baseUrl; - public APICredentialsMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) + public APICredentialsMerchantLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/APIKeyCompanyLevelService.cs b/Adyen/Service/Management/APIKeyCompanyLevelService.cs index aea3e12ee..edef15239 100644 --- a/Adyen/Service/Management/APIKeyCompanyLevelService.cs +++ b/Adyen/Service/Management/APIKeyCompanyLevelService.cs @@ -52,7 +52,7 @@ public class APIKeyCompanyLevelService : AbstractService, IAPIKeyCompanyLevelSer { private readonly string _baseUrl; - public APIKeyCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) + public APIKeyCompanyLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/APIKeyMerchantLevelService.cs b/Adyen/Service/Management/APIKeyMerchantLevelService.cs index 9aca1ac7b..0770db10c 100644 --- a/Adyen/Service/Management/APIKeyMerchantLevelService.cs +++ b/Adyen/Service/Management/APIKeyMerchantLevelService.cs @@ -52,7 +52,7 @@ public class APIKeyMerchantLevelService : AbstractService, IAPIKeyMerchantLevelS { private readonly string _baseUrl; - public APIKeyMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) + public APIKeyMerchantLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/AccountCompanyLevelService.cs b/Adyen/Service/Management/AccountCompanyLevelService.cs index a5b8e2569..eea8789a0 100644 --- a/Adyen/Service/Management/AccountCompanyLevelService.cs +++ b/Adyen/Service/Management/AccountCompanyLevelService.cs @@ -90,7 +90,7 @@ public class AccountCompanyLevelService : AbstractService, IAccountCompanyLevelS { private readonly string _baseUrl; - public AccountCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) + public AccountCompanyLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/AccountMerchantLevelService.cs b/Adyen/Service/Management/AccountMerchantLevelService.cs index d66b56cf3..700286e5a 100644 --- a/Adyen/Service/Management/AccountMerchantLevelService.cs +++ b/Adyen/Service/Management/AccountMerchantLevelService.cs @@ -103,7 +103,7 @@ public class AccountMerchantLevelService : AbstractService, IAccountMerchantLeve { private readonly string _baseUrl; - public AccountMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) + public AccountMerchantLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/AccountStoreLevelService.cs b/Adyen/Service/Management/AccountStoreLevelService.cs index 7416394c1..2df2b47d7 100644 --- a/Adyen/Service/Management/AccountStoreLevelService.cs +++ b/Adyen/Service/Management/AccountStoreLevelService.cs @@ -191,7 +191,7 @@ public class AccountStoreLevelService : AbstractService, IAccountStoreLevelServi { private readonly string _baseUrl; - public AccountStoreLevelService(AdyenClient adyenClient) : base(adyenClient) + public AccountStoreLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs b/Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs index e26554fd4..c354522d6 100644 --- a/Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs +++ b/Adyen/Service/Management/AllowedOriginsCompanyLevelService.cs @@ -113,7 +113,7 @@ public class AllowedOriginsCompanyLevelService : AbstractService, IAllowedOrigin { private readonly string _baseUrl; - public AllowedOriginsCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) + public AllowedOriginsCompanyLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs b/Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs index a5487a5bd..f47988715 100644 --- a/Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs +++ b/Adyen/Service/Management/AllowedOriginsMerchantLevelService.cs @@ -113,7 +113,7 @@ public class AllowedOriginsMerchantLevelService : AbstractService, IAllowedOrigi { private readonly string _baseUrl; - public AllowedOriginsMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) + public AllowedOriginsMerchantLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/AndroidFilesCompanyLevelService.cs b/Adyen/Service/Management/AndroidFilesCompanyLevelService.cs index 77d3b8393..55e259b7d 100644 --- a/Adyen/Service/Management/AndroidFilesCompanyLevelService.cs +++ b/Adyen/Service/Management/AndroidFilesCompanyLevelService.cs @@ -153,7 +153,7 @@ public class AndroidFilesCompanyLevelService : AbstractService, IAndroidFilesCom { private readonly string _baseUrl; - public AndroidFilesCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) + public AndroidFilesCompanyLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/ClientKeyCompanyLevelService.cs b/Adyen/Service/Management/ClientKeyCompanyLevelService.cs index 33348f3c4..338b7f8d3 100644 --- a/Adyen/Service/Management/ClientKeyCompanyLevelService.cs +++ b/Adyen/Service/Management/ClientKeyCompanyLevelService.cs @@ -52,7 +52,7 @@ public class ClientKeyCompanyLevelService : AbstractService, IClientKeyCompanyLe { private readonly string _baseUrl; - public ClientKeyCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) + public ClientKeyCompanyLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/ClientKeyMerchantLevelService.cs b/Adyen/Service/Management/ClientKeyMerchantLevelService.cs index 892a88c62..5d6adce76 100644 --- a/Adyen/Service/Management/ClientKeyMerchantLevelService.cs +++ b/Adyen/Service/Management/ClientKeyMerchantLevelService.cs @@ -52,7 +52,7 @@ public class ClientKeyMerchantLevelService : AbstractService, IClientKeyMerchant { private readonly string _baseUrl; - public ClientKeyMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) + public ClientKeyMerchantLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/MyAPICredentialService.cs b/Adyen/Service/Management/MyAPICredentialService.cs index 4820dd9a0..208fb6997 100644 --- a/Adyen/Service/Management/MyAPICredentialService.cs +++ b/Adyen/Service/Management/MyAPICredentialService.cs @@ -127,7 +127,7 @@ public class MyAPICredentialService : AbstractService, IMyAPICredentialService { private readonly string _baseUrl; - public MyAPICredentialService(AdyenClient adyenClient) : base(adyenClient) + public MyAPICredentialService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs b/Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs index 03cd3ffe4..75d5ef32e 100644 --- a/Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs +++ b/Adyen/Service/Management/PaymentMethodsMerchantLevelService.cs @@ -155,7 +155,7 @@ public class PaymentMethodsMerchantLevelService : AbstractService, IPaymentMetho { private readonly string _baseUrl; - public PaymentMethodsMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) + public PaymentMethodsMerchantLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs b/Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs index 80451754c..aaa3a2586 100644 --- a/Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs +++ b/Adyen/Service/Management/PayoutSettingsMerchantLevelService.cs @@ -126,7 +126,7 @@ public class PayoutSettingsMerchantLevelService : AbstractService, IPayoutSettin { private readonly string _baseUrl; - public PayoutSettingsMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) + public PayoutSettingsMerchantLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs b/Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs index c6ed64047..6b217da75 100644 --- a/Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs +++ b/Adyen/Service/Management/SplitConfigurationMerchantLevelService.cs @@ -218,7 +218,7 @@ public class SplitConfigurationMerchantLevelService : AbstractService, ISplitCon { private readonly string _baseUrl; - public SplitConfigurationMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) + public SplitConfigurationMerchantLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalActionsCompanyLevelService.cs b/Adyen/Service/Management/TerminalActionsCompanyLevelService.cs index b4afb6f85..83e9cd364 100644 --- a/Adyen/Service/Management/TerminalActionsCompanyLevelService.cs +++ b/Adyen/Service/Management/TerminalActionsCompanyLevelService.cs @@ -77,7 +77,7 @@ public class TerminalActionsCompanyLevelService : AbstractService, ITerminalActi { private readonly string _baseUrl; - public TerminalActionsCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) + public TerminalActionsCompanyLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalActionsTerminalLevelService.cs b/Adyen/Service/Management/TerminalActionsTerminalLevelService.cs index 18424103e..b71d84041 100644 --- a/Adyen/Service/Management/TerminalActionsTerminalLevelService.cs +++ b/Adyen/Service/Management/TerminalActionsTerminalLevelService.cs @@ -50,7 +50,7 @@ public class TerminalActionsTerminalLevelService : AbstractService, ITerminalAct { private readonly string _baseUrl; - public TerminalActionsTerminalLevelService(AdyenClient adyenClient) : base(adyenClient) + public TerminalActionsTerminalLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs b/Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs index 4f6508fc3..c432551fa 100644 --- a/Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs +++ b/Adyen/Service/Management/TerminalOrdersCompanyLevelService.cs @@ -239,7 +239,7 @@ public class TerminalOrdersCompanyLevelService : AbstractService, ITerminalOrder { private readonly string _baseUrl; - public TerminalOrdersCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) + public TerminalOrdersCompanyLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs b/Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs index 87ae8b4c9..814550116 100644 --- a/Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs +++ b/Adyen/Service/Management/TerminalOrdersMerchantLevelService.cs @@ -239,7 +239,7 @@ public class TerminalOrdersMerchantLevelService : AbstractService, ITerminalOrde { private readonly string _baseUrl; - public TerminalOrdersMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) + public TerminalOrdersMerchantLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs b/Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs index b2b496b90..70215e735 100644 --- a/Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs +++ b/Adyen/Service/Management/TerminalSettingsCompanyLevelService.cs @@ -109,7 +109,7 @@ public class TerminalSettingsCompanyLevelService : AbstractService, ITerminalSet { private readonly string _baseUrl; - public TerminalSettingsCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) + public TerminalSettingsCompanyLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs b/Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs index 783824252..f03b250b3 100644 --- a/Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs +++ b/Adyen/Service/Management/TerminalSettingsMerchantLevelService.cs @@ -109,7 +109,7 @@ public class TerminalSettingsMerchantLevelService : AbstractService, ITerminalSe { private readonly string _baseUrl; - public TerminalSettingsMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) + public TerminalSettingsMerchantLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalSettingsStoreLevelService.cs b/Adyen/Service/Management/TerminalSettingsStoreLevelService.cs index df95ef214..8d894ba96 100644 --- a/Adyen/Service/Management/TerminalSettingsStoreLevelService.cs +++ b/Adyen/Service/Management/TerminalSettingsStoreLevelService.cs @@ -193,7 +193,7 @@ public class TerminalSettingsStoreLevelService : AbstractService, ITerminalSetti { private readonly string _baseUrl; - public TerminalSettingsStoreLevelService(AdyenClient adyenClient) : base(adyenClient) + public TerminalSettingsStoreLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs b/Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs index c46b785bd..34f045f70 100644 --- a/Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs +++ b/Adyen/Service/Management/TerminalSettingsTerminalLevelService.cs @@ -105,7 +105,7 @@ public class TerminalSettingsTerminalLevelService : AbstractService, ITerminalSe { private readonly string _baseUrl; - public TerminalSettingsTerminalLevelService(AdyenClient adyenClient) : base(adyenClient) + public TerminalSettingsTerminalLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/TerminalsTerminalLevelService.cs b/Adyen/Service/Management/TerminalsTerminalLevelService.cs index a90133e15..bd7299662 100644 --- a/Adyen/Service/Management/TerminalsTerminalLevelService.cs +++ b/Adyen/Service/Management/TerminalsTerminalLevelService.cs @@ -81,7 +81,7 @@ public class TerminalsTerminalLevelService : AbstractService, ITerminalsTerminal { private readonly string _baseUrl; - public TerminalsTerminalLevelService(AdyenClient adyenClient) : base(adyenClient) + public TerminalsTerminalLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/UsersCompanyLevelService.cs b/Adyen/Service/Management/UsersCompanyLevelService.cs index eb84799f0..1cf5d3828 100644 --- a/Adyen/Service/Management/UsersCompanyLevelService.cs +++ b/Adyen/Service/Management/UsersCompanyLevelService.cs @@ -115,7 +115,7 @@ public class UsersCompanyLevelService : AbstractService, IUsersCompanyLevelServi { private readonly string _baseUrl; - public UsersCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) + public UsersCompanyLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/UsersMerchantLevelService.cs b/Adyen/Service/Management/UsersMerchantLevelService.cs index d49fb6796..31213f25a 100644 --- a/Adyen/Service/Management/UsersMerchantLevelService.cs +++ b/Adyen/Service/Management/UsersMerchantLevelService.cs @@ -115,7 +115,7 @@ public class UsersMerchantLevelService : AbstractService, IUsersMerchantLevelSer { private readonly string _baseUrl; - public UsersMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) + public UsersMerchantLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/WebhooksCompanyLevelService.cs b/Adyen/Service/Management/WebhooksCompanyLevelService.cs index ae692d704..44907edb7 100644 --- a/Adyen/Service/Management/WebhooksCompanyLevelService.cs +++ b/Adyen/Service/Management/WebhooksCompanyLevelService.cs @@ -170,7 +170,7 @@ public class WebhooksCompanyLevelService : AbstractService, IWebhooksCompanyLeve { private readonly string _baseUrl; - public WebhooksCompanyLevelService(AdyenClient adyenClient) : base(adyenClient) + public WebhooksCompanyLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/Management/WebhooksMerchantLevelService.cs b/Adyen/Service/Management/WebhooksMerchantLevelService.cs index fdf01caf8..cf8867dbf 100644 --- a/Adyen/Service/Management/WebhooksMerchantLevelService.cs +++ b/Adyen/Service/Management/WebhooksMerchantLevelService.cs @@ -170,7 +170,7 @@ public class WebhooksMerchantLevelService : AbstractService, IWebhooksMerchantLe { private readonly string _baseUrl; - public WebhooksMerchantLevelService(AdyenClient adyenClient) : base(adyenClient) + public WebhooksMerchantLevelService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-test.adyen.com/v3"); } diff --git a/Adyen/Service/PaymentService.cs b/Adyen/Service/PaymentService.cs index 5d0f3931a..e4191c398 100644 --- a/Adyen/Service/PaymentService.cs +++ b/Adyen/Service/PaymentService.cs @@ -256,7 +256,7 @@ public class PaymentService : AbstractService, IPaymentService { private readonly string _baseUrl; - public PaymentService(AdyenClient adyenClient) : base(adyenClient) + public PaymentService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/Payment/v68"); } diff --git a/Adyen/Service/PaymentsAppService.cs b/Adyen/Service/PaymentsAppService.cs index 596d8259a..1944da24c 100644 --- a/Adyen/Service/PaymentsAppService.cs +++ b/Adyen/Service/PaymentsAppService.cs @@ -138,7 +138,7 @@ public class PaymentsAppService : AbstractService, IPaymentsAppService { private readonly string _baseUrl; - public PaymentsAppService(AdyenClient adyenClient) : base(adyenClient) + public PaymentsAppService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://management-live.adyen.com/v1"); } diff --git a/Adyen/Service/Payout/InitializationService.cs b/Adyen/Service/Payout/InitializationService.cs index 84fb4e6ef..d2984a7d6 100644 --- a/Adyen/Service/Payout/InitializationService.cs +++ b/Adyen/Service/Payout/InitializationService.cs @@ -84,7 +84,7 @@ public class InitializationService : AbstractService, IInitializationService { private readonly string _baseUrl; - public InitializationService(AdyenClient adyenClient) : base(adyenClient) + public InitializationService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/Payout/v68"); } diff --git a/Adyen/Service/Payout/InstantPayoutsService.cs b/Adyen/Service/Payout/InstantPayoutsService.cs index b35f1f73d..5f0ccc982 100644 --- a/Adyen/Service/Payout/InstantPayoutsService.cs +++ b/Adyen/Service/Payout/InstantPayoutsService.cs @@ -50,7 +50,7 @@ public class InstantPayoutsService : AbstractService, IInstantPayoutsService { private readonly string _baseUrl; - public InstantPayoutsService(AdyenClient adyenClient) : base(adyenClient) + public InstantPayoutsService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/Payout/v68"); } diff --git a/Adyen/Service/Payout/ReviewingService.cs b/Adyen/Service/Payout/ReviewingService.cs index a7a8a07db..b748df02f 100644 --- a/Adyen/Service/Payout/ReviewingService.cs +++ b/Adyen/Service/Payout/ReviewingService.cs @@ -67,7 +67,7 @@ public class ReviewingService : AbstractService, IReviewingService { private readonly string _baseUrl; - public ReviewingService(AdyenClient adyenClient) : base(adyenClient) + public ReviewingService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/Payout/v68"); } diff --git a/Adyen/Service/PlatformsAccount/AccountHoldersService.cs b/Adyen/Service/PlatformsAccount/AccountHoldersService.cs index 2d11253a4..947095844 100644 --- a/Adyen/Service/PlatformsAccount/AccountHoldersService.cs +++ b/Adyen/Service/PlatformsAccount/AccountHoldersService.cs @@ -186,7 +186,7 @@ public class AccountHoldersService : AbstractService, IAccountHoldersService { private readonly string _baseUrl; - public AccountHoldersService(AdyenClient adyenClient) : base(adyenClient) + public AccountHoldersService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Account/v6"); } diff --git a/Adyen/Service/PlatformsAccount/AccountsService.cs b/Adyen/Service/PlatformsAccount/AccountsService.cs index a215c1e1d..96d772086 100644 --- a/Adyen/Service/PlatformsAccount/AccountsService.cs +++ b/Adyen/Service/PlatformsAccount/AccountsService.cs @@ -84,7 +84,7 @@ public class AccountsService : AbstractService, IAccountsService { private readonly string _baseUrl; - public AccountsService(AdyenClient adyenClient) : base(adyenClient) + public AccountsService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Account/v6"); } diff --git a/Adyen/Service/PlatformsAccount/VerificationService.cs b/Adyen/Service/PlatformsAccount/VerificationService.cs index 8461c019d..4467d3d5f 100644 --- a/Adyen/Service/PlatformsAccount/VerificationService.cs +++ b/Adyen/Service/PlatformsAccount/VerificationService.cs @@ -169,7 +169,7 @@ public class VerificationService : AbstractService, IVerificationService { private readonly string _baseUrl; - public VerificationService(AdyenClient adyenClient) : base(adyenClient) + public VerificationService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Account/v6"); } diff --git a/Adyen/Service/PlatformsFundService.cs b/Adyen/Service/PlatformsFundService.cs index 0ac7fc929..5150e14ae 100644 --- a/Adyen/Service/PlatformsFundService.cs +++ b/Adyen/Service/PlatformsFundService.cs @@ -170,7 +170,7 @@ public class PlatformsFundService : AbstractService, IPlatformsFundService { private readonly string _baseUrl; - public PlatformsFundService(AdyenClient adyenClient) : base(adyenClient) + public PlatformsFundService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Fund/v6"); } diff --git a/Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs b/Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs index 3e749ce25..19f0a8d0c 100644 --- a/Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs +++ b/Adyen/Service/PlatformsHostedOnboardingPage/HostedOnboardingPageService.cs @@ -50,7 +50,7 @@ public class HostedOnboardingPageService : AbstractService, IHostedOnboardingPag { private readonly string _baseUrl; - public HostedOnboardingPageService(AdyenClient adyenClient) : base(adyenClient) + public HostedOnboardingPageService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Hop/v6"); } diff --git a/Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs b/Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs index 45b884cb8..b41a064ef 100644 --- a/Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs +++ b/Adyen/Service/PlatformsHostedOnboardingPage/PCIComplianceQuestionnairePageService.cs @@ -50,7 +50,7 @@ public class PCIComplianceQuestionnairePageService : AbstractService, IPCICompli { private readonly string _baseUrl; - public PCIComplianceQuestionnairePageService(AdyenClient adyenClient) : base(adyenClient) + public PCIComplianceQuestionnairePageService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Hop/v6"); } diff --git a/Adyen/Service/PlatformsNotificationConfigurationService.cs b/Adyen/Service/PlatformsNotificationConfigurationService.cs index e65b31115..013a66792 100644 --- a/Adyen/Service/PlatformsNotificationConfigurationService.cs +++ b/Adyen/Service/PlatformsNotificationConfigurationService.cs @@ -136,7 +136,7 @@ public class PlatformsNotificationConfigurationService : AbstractService, IPlatf { private readonly string _baseUrl; - public PlatformsNotificationConfigurationService(AdyenClient adyenClient) : base(adyenClient) + public PlatformsNotificationConfigurationService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://cal-test.adyen.com/cal/services/Notification/v6"); } diff --git a/Adyen/Service/PosMobileService.cs b/Adyen/Service/PosMobileService.cs index b3c01c479..eba474151 100644 --- a/Adyen/Service/PosMobileService.cs +++ b/Adyen/Service/PosMobileService.cs @@ -50,7 +50,7 @@ public class PosMobileService : AbstractService, IPosMobileService { private readonly string _baseUrl; - public PosMobileService(AdyenClient adyenClient) : base(adyenClient) + public PosMobileService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://checkout-test.adyen.com/checkout/possdk/v68"); } diff --git a/Adyen/Service/PosTerminalManagementService.cs b/Adyen/Service/PosTerminalManagementService.cs index 6aa83d0af..67df2e936 100644 --- a/Adyen/Service/PosTerminalManagementService.cs +++ b/Adyen/Service/PosTerminalManagementService.cs @@ -128,7 +128,7 @@ public class PosTerminalManagementService : AbstractService, IPosTerminalManagem { private readonly string _baseUrl; - public PosTerminalManagementService(AdyenClient adyenClient) : base(adyenClient) + public PosTerminalManagementService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://postfmapi-test.adyen.com/postfmapi/terminal/v1"); } diff --git a/Adyen/Service/RecurringService.cs b/Adyen/Service/RecurringService.cs index 5851376e6..21fcdc603 100644 --- a/Adyen/Service/RecurringService.cs +++ b/Adyen/Service/RecurringService.cs @@ -135,7 +135,7 @@ public class RecurringService : AbstractService, IRecurringService { private readonly string _baseUrl; - public RecurringService(AdyenClient adyenClient) : base(adyenClient) + public RecurringService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/Recurring/v68"); } diff --git a/Adyen/Service/ServiceResource.cs b/Adyen/Service/ServiceResource.cs index 43f161a92..fce890f9a 100644 --- a/Adyen/Service/ServiceResource.cs +++ b/Adyen/Service/ServiceResource.cs @@ -19,26 +19,26 @@ public ServiceResource(AbstractService abstractService, string endpoint) public string Request(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null) { - var clientInterface = _abstractService.AdyenClient.HttpClient; + var clientInterface = _abstractService.Client.HttpClient; return clientInterface.Request(Endpoint, json, requestOptions, httpMethod); } public T Request(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null) { - var clientInterface = _abstractService.AdyenClient.HttpClient; + var clientInterface = _abstractService.Client.HttpClient; var jsonResponse = clientInterface.Request(Endpoint, json, requestOptions, httpMethod); return JsonConvert.DeserializeObject(jsonResponse); } public async Task RequestAsync(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null, CancellationToken cancellationToken = default) { - var clientInterface = _abstractService.AdyenClient.HttpClient; + var clientInterface = _abstractService.Client.HttpClient; return await clientInterface.RequestAsync(Endpoint, json, requestOptions, httpMethod, cancellationToken).ConfigureAwait(false); } public async Task RequestAsync(string json, RequestOptions requestOptions = null, HttpMethod httpMethod = null, CancellationToken cancellationToken = default) { - var clientInterface = _abstractService.AdyenClient.HttpClient; + var clientInterface = _abstractService.Client.HttpClient; var jsonResponse = await clientInterface.RequestAsync(Endpoint, json, requestOptions, httpMethod, cancellationToken).ConfigureAwait(false); return JsonConvert.DeserializeObject(jsonResponse); } diff --git a/Adyen/Service/StoredValueService.cs b/Adyen/Service/StoredValueService.cs index 06b920333..574097af0 100644 --- a/Adyen/Service/StoredValueService.cs +++ b/Adyen/Service/StoredValueService.cs @@ -135,7 +135,7 @@ public class StoredValueService : AbstractService, IStoredValueService { private readonly string _baseUrl; - public StoredValueService(AdyenClient adyenClient) : base(adyenClient) + public StoredValueService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://pal-test.adyen.com/pal/servlet/StoredValue/v46"); } diff --git a/Adyen/Service/Transfers/CapitalService.cs b/Adyen/Service/Transfers/CapitalService.cs index 03bf51ae1..27eb9e95e 100644 --- a/Adyen/Service/Transfers/CapitalService.cs +++ b/Adyen/Service/Transfers/CapitalService.cs @@ -90,7 +90,7 @@ public class CapitalService : AbstractService, ICapitalService { private readonly string _baseUrl; - public CapitalService(AdyenClient adyenClient) : base(adyenClient) + public CapitalService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/btl/v4"); } diff --git a/Adyen/Service/Transfers/TransactionsService.cs b/Adyen/Service/Transfers/TransactionsService.cs index d2e001454..d9856add0 100644 --- a/Adyen/Service/Transfers/TransactionsService.cs +++ b/Adyen/Service/Transfers/TransactionsService.cs @@ -81,7 +81,7 @@ public class TransactionsService : AbstractService, ITransactionsService { private readonly string _baseUrl; - public TransactionsService(AdyenClient adyenClient) : base(adyenClient) + public TransactionsService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/btl/v4"); } diff --git a/Adyen/Service/Transfers/TransfersService.cs b/Adyen/Service/Transfers/TransfersService.cs index 57767e977..860a47fcb 100644 --- a/Adyen/Service/Transfers/TransfersService.cs +++ b/Adyen/Service/Transfers/TransfersService.cs @@ -151,7 +151,7 @@ public class TransfersService : AbstractService, ITransfersService { private readonly string _baseUrl; - public TransfersService(AdyenClient adyenClient) : base(adyenClient) + public TransfersService(Client client) : base(client) { _baseUrl = CreateBaseUrl("https://balanceplatform-api-test.adyen.com/btl/v4"); } diff --git a/Adyen/TerminalApi/AdyenClient.cs b/Adyen/TerminalApi/Client.cs similarity index 92% rename from Adyen/TerminalApi/AdyenClient.cs rename to Adyen/TerminalApi/Client.cs index dc6016bdb..4cc9717f1 100644 --- a/Adyen/TerminalApi/AdyenClient.cs +++ b/Adyen/TerminalApi/Client.cs @@ -7,7 +7,7 @@ namespace Adyen { - public class AdyenClient + public class Client { public Config Config { get; set; } @@ -19,7 +19,7 @@ public class AdyenClient private static System.Net.Http.HttpClient _httpClient; [Obsolete("Providing username and password are obsolete, please use Config instead.")] - public AdyenClient(string username, string password, Environment environment, string liveEndpointUrlPrefix = null) + public Client(string username, string password, Environment environment, string liveEndpointUrlPrefix = null) { Config = new Config { @@ -33,7 +33,7 @@ public AdyenClient(string username, string password, Environment environment, st } [Obsolete("Providing x-api-key is obsolete, please use Config instead.")] - public AdyenClient(string xapikey, Environment environment, string liveEndpointUrlPrefix = null) + public Client(string xapikey, Environment environment, string liveEndpointUrlPrefix = null) { Config = new Config { @@ -45,21 +45,21 @@ public AdyenClient(string xapikey, Environment environment, string liveEndpointU HttpClient = new HttpClientWrapper(Config, GetHttpClient()); } - public AdyenClient(Config config) + public Client(Config config) { Config = config; SetEnvironment(config.Environment, config.LiveEndpointUrlPrefix, config.TerminalApiRegion, config.CloudApiEndPoint); HttpClient = new HttpClientWrapper(config, GetHttpClient()); } - public AdyenClient(Config config, System.Net.Http.HttpClient httpClient) + public Client(Config config, System.Net.Http.HttpClient httpClient) { Config = config; SetEnvironment(config.Environment, config.LiveEndpointUrlPrefix, config.TerminalApiRegion, config.CloudApiEndPoint); HttpClient = new HttpClientWrapper(config, httpClient); } - public AdyenClient(Config config, IHttpClientFactory factory, string clientName = null) + public Client(Config config, IHttpClientFactory factory, string clientName = null) { Config = config; SetEnvironment(config.Environment, config.LiveEndpointUrlPrefix, config.TerminalApiRegion, config.CloudApiEndPoint); diff --git a/Adyen/TerminalApi/Clients/TerminalApi.cs b/Adyen/TerminalApi/Clients/TerminalApi.cs index 78f7efc39..cf566c9d5 100644 --- a/Adyen/TerminalApi/Clients/TerminalApi.cs +++ b/Adyen/TerminalApi/Clients/TerminalApi.cs @@ -10,9 +10,9 @@ public TerminalApi(AbstractService abstractService, bool asynchronous) : base(abstractService, null) { if (asynchronous) { - Endpoint = abstractService.AdyenClient.GetCloudApiEndpoint()+ "/async"; + Endpoint = abstractService.Client.GetCloudApiEndpoint()+ "/async"; } else { - Endpoint = abstractService.AdyenClient.GetCloudApiEndpoint() + "/sync"; + Endpoint = abstractService.Client.GetCloudApiEndpoint() + "/sync"; } } } diff --git a/Adyen/TerminalApi/Clients/TerminalApiAsyncClient.cs b/Adyen/TerminalApi/Clients/TerminalApiAsyncClient.cs index ea26de5e8..67728b0d9 100644 --- a/Adyen/TerminalApi/Clients/TerminalApiAsyncClient.cs +++ b/Adyen/TerminalApi/Clients/TerminalApiAsyncClient.cs @@ -10,7 +10,7 @@ public class TerminalApiAsyncClient : ServiceResource /// /// . public TerminalApiAsyncClient(AbstractService abstractService) - : base(abstractService, abstractService.AdyenClient.GetCloudApiEndpoint() + "/async") + : base(abstractService, abstractService.Client.GetCloudApiEndpoint() + "/async") { } } diff --git a/Adyen/TerminalApi/Clients/TerminalApiLocal.cs b/Adyen/TerminalApi/Clients/TerminalApiLocal.cs index 0d59b11f3..c8c3abb2e 100644 --- a/Adyen/TerminalApi/Clients/TerminalApiLocal.cs +++ b/Adyen/TerminalApi/Clients/TerminalApiLocal.cs @@ -7,7 +7,7 @@ public class TerminalApiLocal: ServiceResource { [Obsolete("Use TerminalApiLocalClient instead.")] public TerminalApiLocal(AbstractService abstractService) - : base(abstractService, abstractService.AdyenClient.Config.LocalTerminalApiEndpoint) + : base(abstractService, abstractService.Client.Config.LocalTerminalApiEndpoint) { } } diff --git a/Adyen/TerminalApi/Clients/TerminalApiLocalClient.cs b/Adyen/TerminalApi/Clients/TerminalApiLocalClient.cs index 656e2d335..f99ac8d84 100644 --- a/Adyen/TerminalApi/Clients/TerminalApiLocalClient.cs +++ b/Adyen/TerminalApi/Clients/TerminalApiLocalClient.cs @@ -10,7 +10,7 @@ public class TerminalApiLocalClient : ServiceResource /// /// . public TerminalApiLocalClient(AbstractService abstractService) - : base(abstractService, abstractService.AdyenClient.Config.LocalTerminalApiEndpoint) + : base(abstractService, abstractService.Client.Config.LocalTerminalApiEndpoint) { } } diff --git a/Adyen/TerminalApi/Clients/TerminalApiSyncClient.cs b/Adyen/TerminalApi/Clients/TerminalApiSyncClient.cs index 5e160b15b..11436aa44 100644 --- a/Adyen/TerminalApi/Clients/TerminalApiSyncClient.cs +++ b/Adyen/TerminalApi/Clients/TerminalApiSyncClient.cs @@ -7,7 +7,7 @@ public class TerminalApiSyncClient : ServiceResource /// /// . public TerminalApiSyncClient(AbstractService abstractService) - : base(abstractService, abstractService.AdyenClient.GetCloudApiEndpoint() + "/sync") + : base(abstractService, abstractService.Client.GetCloudApiEndpoint() + "/sync") { } } diff --git a/Adyen/TerminalApi/Config.cs b/Adyen/TerminalApi/Config.cs index 679c799ef..7daae70d9 100644 --- a/Adyen/TerminalApi/Config.cs +++ b/Adyen/TerminalApi/Config.cs @@ -10,18 +10,19 @@ public class Config public string Username { get; set; } public string Password { get; set; } public bool HasPassword => !string.IsNullOrEmpty(Password); - + public Environment Environment { get; set; } public string LiveEndpointUrlPrefix { get; set; } public string ApplicationName { get; set; } public IWebProxy Proxy { get; set; } - + /// /// Your Adyen API key. /// public string XApiKey { get; set; } + public bool HasApiKey => !string.IsNullOrEmpty(XApiKey); - + /// /// HttpConnection Timeout in milliseconds (e.g. the time required to send the request and receive the response). /// In > NET6.0, we recommend configuring your own and pass it in the constructor. @@ -31,32 +32,32 @@ public class Config /// /// Only The amount of time it should take to establish the TCP Connection. - /// This value is only used in when no default was passed in the constructor. + /// This value is only used in when no default was passed in the constructor. /// In > NET6.0, we recommend configuring your own and pass it in the constructor. /// The values shown here are defaults, if no is provided. /// public TimeSpan ConnectTimeout { get; set; } = TimeSpan.FromSeconds(15); - + /// /// Force reconnection to refresh DNS and avoid stale connections. /// Once a connection exceeds the specified lifetime, it is no longer considered reusable and it is closed and removed from the pool. - /// This value is only used in when no default was passed in the constructor. + /// This value is only used in when no default was passed in the constructor. /// In > NET6.0, we recommend configuring your own and pass it in the constructor. /// The values shown here are defaults, if no is provided. /// public TimeSpan PooledConnectionLifetime { get; set; } = TimeSpan.FromMinutes(5); - + /// /// Close idle connections after the specified time. - /// This value is only used in when no default was passed in the constructor. + /// This value is only used in when no default was passed in the constructor. /// In > NET6.0, we recommend configuring your own and pass it in the constructor. /// The values shown here are defaults, if no is provided. /// - public TimeSpan PooledConnectionIdleTimeout { get; set; }= TimeSpan.FromMinutes(2); + public TimeSpan PooledConnectionIdleTimeout { get; set; } = TimeSpan.FromMinutes(2); /// /// Maximum number of concurrent TCP connections per server. - /// This value is only used in when no default was passed in the constructor. + /// This value is only used in when no default was passed in the constructor. /// In > NET6.0, we recommend configuring your own and pass it in the constructor. /// The values shown here are defaults, if no is provided. /// @@ -64,17 +65,17 @@ public class Config /// /// The url of the Cloud Terminal Api endpoint. - /// This value is populated when specifying the in . + /// This value is populated when specifying the in . /// public string CloudApiEndPoint { get; set; } - + /// /// The url of the Terminal Api endpoint, can be overriden if you want to send local terminal-api requests. /// public string LocalTerminalApiEndpoint { get; set; } - + public BaseUrlConfig BaseUrlConfig { get; set; } - - public Region TerminalApiRegion { get; set; } + + public Region TerminalApiRegion { get; set; } } } \ No newline at end of file diff --git a/Adyen/TerminalApi/Models/AbstractService.cs b/Adyen/TerminalApi/Models/AbstractService.cs index a6c6e740e..b749dd706 100644 --- a/Adyen/TerminalApi/Models/AbstractService.cs +++ b/Adyen/TerminalApi/Models/AbstractService.cs @@ -9,14 +9,14 @@ namespace Adyen.Service { public class AbstractService { - public AdyenClient AdyenClient { get; set; } + public Client Client { get; set; } private const string PaymentPrefix = "pal-"; private const string CheckoutPrefix = "checkout-"; - protected AbstractService(AdyenClient adyenClient) + protected AbstractService(Client client) { - AdyenClient = adyenClient; + Client = client; } /// @@ -49,7 +49,7 @@ private protected static string ToQueryString(IDictionary queryP /// baseURL private protected string CreateBaseUrl(string url) { - var config = AdyenClient.Config; + var config = Client.Config; return config.Environment == Environment.Live ? ConstructLiveUrl(config, url) diff --git a/Adyen/TerminalApi/Services/TerminalApiAsyncService.cs b/Adyen/TerminalApi/Services/TerminalApiAsyncService.cs index 91ddf9a50..18d94d389 100644 --- a/Adyen/TerminalApi/Services/TerminalApiAsyncService.cs +++ b/Adyen/TerminalApi/Services/TerminalApiAsyncService.cs @@ -67,7 +67,7 @@ public class TerminalApiAsyncService : AbstractService, ITerminalApiAsyncService /// /// Service that sends requests to the Adyen Cloud Terminal API `https://terminal-api-test.adyen.com/async` endpoint. /// - public TerminalApiAsyncService(AdyenClient adyenClient, SaleToPoiMessageSerializer saleToPoiMessageSerializer, SaleToPoiMessageSecuredEncryptor saleToPoiMessageSecuredEncryptor, SaleToPoiMessageSecuredSerializer saleToPoiMessageSecuredSerializer) : base(adyenClient) + public TerminalApiAsyncService(Client client, SaleToPoiMessageSerializer saleToPoiMessageSerializer, SaleToPoiMessageSecuredEncryptor saleToPoiMessageSecuredEncryptor, SaleToPoiMessageSecuredSerializer saleToPoiMessageSecuredSerializer) : base(client) { _saleToPoiMessageSerializer = saleToPoiMessageSerializer; _saleToPoiMessageSecuredEncryptor = saleToPoiMessageSecuredEncryptor; @@ -79,11 +79,11 @@ public TerminalApiAsyncService(AdyenClient adyenClient, SaleToPoiMessageSerializ public async Task RequestEncryptedAsync(SaleToPOIRequest saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails, CancellationToken cancellationToken) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n"+ serializedMessage); + Client.LogLine("Request: \n"+ serializedMessage); SaleToPoiMessageSecured securedMessage = _saleToPoiMessageSecuredEncryptor.Encrypt(serializedMessage, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); string serializedSecuredMessage = _saleToPoiMessageSerializer.Serialize(securedMessage); string response = await _asyncClient.RequestAsync(serializedSecuredMessage, cancellationToken: cancellationToken); - AdyenClient.LogLine("Response: \n" + response); + Client.LogLine("Response: \n" + response); return response; } @@ -91,11 +91,11 @@ public async Task RequestEncryptedAsync(SaleToPOIRequest saleToPoiReques public string RequestEncrypted(SaleToPOIRequest saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n"+ serializedMessage); + Client.LogLine("Request: \n"+ serializedMessage); SaleToPoiMessageSecured securedMessage = _saleToPoiMessageSecuredEncryptor.Encrypt(serializedMessage, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); string serializedSecuredMessage = _saleToPoiMessageSerializer.Serialize(securedMessage); string response = _asyncClient.Request(serializedSecuredMessage); - AdyenClient.LogLine("Response: \n" + response); + Client.LogLine("Response: \n" + response); return response; } @@ -103,9 +103,9 @@ public string RequestEncrypted(SaleToPOIRequest saleToPoiRequest, EncryptionCre public async Task RequestAsync(SaleToPOIRequest saleToPoiRequest, CancellationToken cancellationToken) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + serializedMessage); + Client.LogLine("Request: \n" + serializedMessage); string response = await _asyncClient.RequestAsync(serializedMessage, cancellationToken: cancellationToken); - AdyenClient.LogLine("Response: \n" + response); + Client.LogLine("Response: \n" + response); return response; } @@ -113,9 +113,9 @@ public async Task RequestAsync(SaleToPOIRequest saleToPoiRequest, Cancel public string Request(SaleToPOIRequest saleToPoiRequest) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + serializedMessage); + Client.LogLine("Request: \n" + serializedMessage); string response = _asyncClient.Request(serializedMessage); - AdyenClient.LogLine("Response: \n" + response); + Client.LogLine("Response: \n" + response); return response; } diff --git a/Adyen/TerminalApi/Services/TerminalApiLocalService.cs b/Adyen/TerminalApi/Services/TerminalApiLocalService.cs index 9c52afed1..b1ce906db 100644 --- a/Adyen/TerminalApi/Services/TerminalApiLocalService.cs +++ b/Adyen/TerminalApi/Services/TerminalApiLocalService.cs @@ -38,7 +38,7 @@ public interface ITerminalApiLocalService /// /// Example: /// handler = new HttpClientHandler { ServerCertificateCustomValidationCallback = (message, certificate2, arg3, arg4) => true }; - /// var httpClient = new (, new (handler)); + /// var httpClient = new (, new (handler)); /// var terminalApiLocalService = new (httpClient, , , ); /// /// . @@ -52,7 +52,7 @@ public interface ITerminalApiLocalService /// /// Example: /// handler = new HttpClientHandler { ServerCertificateCustomValidationCallback = (message, certificate2, arg3, arg4) => true }; - /// var httpClient = new (, new (handler)); + /// var httpClient = new (, new (handler)); /// var terminalApiLocalService = new (httpClient, , , ); /// /// . @@ -81,7 +81,7 @@ public class TerminalApiLocalService: AbstractService, ITerminalApiLocalService /// /// Service that sends requests to the endpoint specified in (e.g. `https://198.51.100.1:8443/nexo`). /// - public TerminalApiLocalService(AdyenClient adyenClient, SaleToPoiMessageSerializer saleToPoiMessageSerializer, SaleToPoiMessageSecuredEncryptor saleToPoiMessageSecuredEncryptor, SaleToPoiMessageSecuredSerializer saleToPoiMessageSecuredSerializer) : base(adyenClient) + public TerminalApiLocalService(Client client, SaleToPoiMessageSerializer saleToPoiMessageSerializer, SaleToPoiMessageSecuredEncryptor saleToPoiMessageSecuredEncryptor, SaleToPoiMessageSecuredSerializer saleToPoiMessageSecuredSerializer) : base(client) { _saleToPoiMessageSerializer = saleToPoiMessageSerializer; _saleToPoiMessageSecuredEncryptor = saleToPoiMessageSecuredEncryptor; @@ -93,7 +93,7 @@ public TerminalApiLocalService(AdyenClient adyenClient, SaleToPoiMessageSerializ public async Task RequestEncryptedAsync(SaleToPOIRequest saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails, CancellationToken cancellationToken) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + serializedMessage); + Client.LogLine("Request: \n" + serializedMessage); SaleToPoiMessageSecured securedMessage = _saleToPoiMessageSecuredEncryptor.Encrypt(serializedMessage, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); string serializedSecuredMessage = _saleToPoiMessageSerializer.Serialize(securedMessage); string response = await _localClient.RequestAsync(serializedSecuredMessage, cancellationToken: cancellationToken); @@ -103,7 +103,7 @@ public async Task RequestEncryptedAsync(SaleToPOIRequest sale } SaleToPoiMessageSecured saleToPoiResponseSecured = _saleToPoiMessageSecuredSerializer.Deserialize(response); string decryptedResponse = _saleToPoiMessageSecuredEncryptor.Decrypt(saleToPoiResponseSecured, encryptionCredentialDetails); - AdyenClient.LogLine("Response: \n" + decryptedResponse); + Client.LogLine("Response: \n" + decryptedResponse); return _saleToPoiMessageSerializer.Deserialize(decryptedResponse); } @@ -111,7 +111,7 @@ public async Task RequestEncryptedAsync(SaleToPOIRequest sale public SaleToPOIResponse RequestEncrypted(SaleToPOIRequest saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + serializedMessage); + Client.LogLine("Request: \n" + serializedMessage); SaleToPoiMessageSecured securedMessage = _saleToPoiMessageSecuredEncryptor.Encrypt(serializedMessage, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); string serializedSecuredMessage = _saleToPoiMessageSerializer.Serialize(securedMessage); string response = _localClient.Request(serializedSecuredMessage); @@ -121,7 +121,7 @@ public SaleToPOIResponse RequestEncrypted(SaleToPOIRequest saleToPoiRequest, Enc } SaleToPoiMessageSecured saleToPoiResponseSecured = _saleToPoiMessageSecuredSerializer.Deserialize(response); string decryptedResponse = _saleToPoiMessageSecuredEncryptor.Decrypt(saleToPoiResponseSecured, encryptionCredentialDetails); - AdyenClient.LogLine("Response: \n" + decryptedResponse); + Client.LogLine("Response: \n" + decryptedResponse); return _saleToPoiMessageSerializer.Deserialize(decryptedResponse); } @@ -129,9 +129,9 @@ public SaleToPOIResponse RequestEncrypted(SaleToPOIRequest saleToPoiRequest, Enc public async Task RequestAsync(SaleToPOIRequest saleToPoiRequest, CancellationToken cancellationToken) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + serializedMessage); + Client.LogLine("Request: \n" + serializedMessage); string response = await _localClient.RequestAsync(serializedMessage, cancellationToken: cancellationToken); - AdyenClient.LogLine("Response: \n" + response); + Client.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; @@ -143,9 +143,9 @@ public async Task RequestAsync(SaleToPOIRequest saleToPoiRequ public SaleToPOIResponse Request(SaleToPOIRequest saleToPoiRequest) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + serializedMessage); + Client.LogLine("Request: \n" + serializedMessage); string response = _localClient.Request(serializedMessage); - AdyenClient.LogLine("Response: \n" + response); + Client.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; diff --git a/Adyen/TerminalApi/Services/TerminalApiSyncService.cs b/Adyen/TerminalApi/Services/TerminalApiSyncService.cs index e6525ae4e..2fbb95714 100644 --- a/Adyen/TerminalApi/Services/TerminalApiSyncService.cs +++ b/Adyen/TerminalApi/Services/TerminalApiSyncService.cs @@ -67,7 +67,7 @@ public class TerminalApiSyncService : AbstractService, ITerminalApiSyncService /// /// Service that sends requests to the Adyen Cloud Terminal API `https://terminal-api-test.adyen.com/sync` endpoint. /// - public TerminalApiSyncService(AdyenClient adyenClient, SaleToPoiMessageSerializer saleToPoiMessageSerializer, SaleToPoiMessageSecuredEncryptor saleToPoiMessageSecuredEncryptor, SaleToPoiMessageSecuredSerializer saleToPoiMessageSecuredSerializer) : base(adyenClient) + public TerminalApiSyncService(Client client, SaleToPoiMessageSerializer saleToPoiMessageSerializer, SaleToPoiMessageSecuredEncryptor saleToPoiMessageSecuredEncryptor, SaleToPoiMessageSecuredSerializer saleToPoiMessageSecuredSerializer) : base(client) { _saleToPoiMessageSerializer = saleToPoiMessageSerializer; _saleToPoiMessageSecuredEncryptor = saleToPoiMessageSecuredEncryptor; @@ -79,7 +79,7 @@ public TerminalApiSyncService(AdyenClient adyenClient, SaleToPoiMessageSerialize public async Task RequestEncryptedAsync(SaleToPOIRequest saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails, CancellationToken cancellationToken) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + serializedMessage); + Client.LogLine("Request: \n" + serializedMessage); SaleToPoiMessageSecured securedMessage = _saleToPoiMessageSecuredEncryptor.Encrypt(serializedMessage, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); string serializedSecuredMessage = _saleToPoiMessageSerializer.Serialize(securedMessage); string response = await _syncClient.RequestAsync(serializedSecuredMessage, cancellationToken: cancellationToken); @@ -89,7 +89,7 @@ public async Task RequestEncryptedAsync(SaleToPOIRequest sale } SaleToPoiMessageSecured saleToPoiResponseSecured = _saleToPoiMessageSecuredSerializer.Deserialize(response); string decryptedResponse = _saleToPoiMessageSecuredEncryptor.Decrypt(saleToPoiResponseSecured, encryptionCredentialDetails); - AdyenClient.LogLine("Response: \n" + decryptedResponse); + Client.LogLine("Response: \n" + decryptedResponse); return _saleToPoiMessageSerializer.Deserialize(decryptedResponse); } @@ -97,7 +97,7 @@ public async Task RequestEncryptedAsync(SaleToPOIRequest sale public SaleToPOIResponse RequestEncrypted(SaleToPOIRequest saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + serializedMessage); + Client.LogLine("Request: \n" + serializedMessage); SaleToPoiMessageSecured securedMessage = _saleToPoiMessageSecuredEncryptor.Encrypt(serializedMessage, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); string serializedSecuredMessage = _saleToPoiMessageSerializer.Serialize(securedMessage); string response = _syncClient.Request(serializedSecuredMessage); @@ -107,7 +107,7 @@ public SaleToPOIResponse RequestEncrypted(SaleToPOIRequest saleToPoiRequest, Enc } SaleToPoiMessageSecured saleToPoiResponseSecured = _saleToPoiMessageSecuredSerializer.Deserialize(response); string decryptedResponse = _saleToPoiMessageSecuredEncryptor.Decrypt(saleToPoiResponseSecured, encryptionCredentialDetails); - AdyenClient.LogLine("Response: \n" + decryptedResponse); + Client.LogLine("Response: \n" + decryptedResponse); return _saleToPoiMessageSerializer.Deserialize(decryptedResponse); } @@ -115,9 +115,9 @@ public SaleToPOIResponse RequestEncrypted(SaleToPOIRequest saleToPoiRequest, Enc public async Task RequestAsync(SaleToPOIRequest saleToPoiRequest, CancellationToken cancellationToken) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + serializedMessage); + Client.LogLine("Request: \n" + serializedMessage); string response = await _syncClient.RequestAsync(serializedMessage, cancellationToken: cancellationToken); - AdyenClient.LogLine("Response: \n" + response); + Client.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; @@ -129,9 +129,9 @@ public async Task RequestAsync(SaleToPOIRequest saleToPoiRequ public SaleToPOIResponse Request(SaleToPOIRequest saleToPoiRequest) { string serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + serializedMessage); + Client.LogLine("Request: \n" + serializedMessage); string response = _syncClient.Request(serializedMessage); - AdyenClient.LogLine("Response: \n" + response); + Client.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; diff --git a/Adyen/TerminalApi/Services/TerminalCloudApi.cs b/Adyen/TerminalApi/Services/TerminalCloudApi.cs index 5b948302e..0b116a77f 100644 --- a/Adyen/TerminalApi/Services/TerminalCloudApi.cs +++ b/Adyen/TerminalApi/Services/TerminalCloudApi.cs @@ -54,13 +54,13 @@ public class TerminalCloudApi : AbstractService, ITerminalCloudApi private readonly string _baseUrl; [Obsolete("Use TerminalApiSyncService or TerminalApiAsyncService instead.")] - public TerminalCloudApi(AdyenClient adyenClient) - : base(adyenClient) + public TerminalCloudApi(Client client) + : base(client) { _saleToPoiMessageSerializer = new SaleToPoiMessageSerializer(); _terminalApiAsync = new TerminalApi(this, true); _terminalApiSync = new TerminalApi(this, false); - _baseUrl = adyenClient.GetCloudApiEndpoint(); + _baseUrl = client.GetCloudApiEndpoint(); } @@ -68,9 +68,9 @@ public TerminalCloudApi(AdyenClient adyenClient) public SaleToPOIResponse TerminalRequestAsync(SaleToPOIMessage saleToPoiRequest) { var serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + serializedMessage); + Client.LogLine("Request: \n" + serializedMessage); var response = _terminalApiAsync.Request(serializedMessage); - AdyenClient.LogLine("Response: \n" + response); + Client.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; @@ -82,9 +82,9 @@ public SaleToPOIResponse TerminalRequestAsync(SaleToPOIMessage saleToPoiRequest) public SaleToPOIResponse TerminalRequestSync(SaleToPOIMessage saleToPoiRequest) { var serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n"+ serializedMessage); + Client.LogLine("Request: \n"+ serializedMessage); var response = _terminalApiSync.Request(serializedMessage); - AdyenClient.LogLine("Response: \n"+ response); + Client.LogLine("Response: \n"+ response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; @@ -96,9 +96,9 @@ public SaleToPOIResponse TerminalRequestSync(SaleToPOIMessage saleToPoiRequest) public async Task TerminalRequestAsynchronousAsync(SaleToPOIMessage saleToPoiRequest, CancellationToken cancellationToken = default) { var serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + serializedMessage); + Client.LogLine("Request: \n" + serializedMessage); var response = await _terminalApiAsync.RequestAsync(serializedMessage, cancellationToken: cancellationToken); - AdyenClient.LogLine("Response: \n" + response); + Client.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; @@ -110,9 +110,9 @@ public async Task TerminalRequestAsynchronousAsync(SaleToPOIM public async Task TerminalRequestSynchronousAsync(SaleToPOIMessage saleToPoiRequest, CancellationToken cancellationToken = default) { var serializedMessage = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + serializedMessage); + Client.LogLine("Request: \n" + serializedMessage); var response = await _terminalApiSync.RequestAsync(serializedMessage, cancellationToken: cancellationToken); - AdyenClient.LogLine("Response: \n" + response); + Client.LogLine("Response: \n" + response); if (string.IsNullOrEmpty(response) || string.Equals("ok", response)) { return null; diff --git a/Adyen/TerminalApi/Services/TerminalLocalApi.cs b/Adyen/TerminalApi/Services/TerminalLocalApi.cs index 7061029b1..1588fa049 100644 --- a/Adyen/TerminalApi/Services/TerminalLocalApi.cs +++ b/Adyen/TerminalApi/Services/TerminalLocalApi.cs @@ -59,8 +59,8 @@ public class TerminalLocalApi: AbstractService, ITerminalLocalApi private readonly SaleToPoiMessageSecuredSerializer _saleToPoiMessageSecuredSerializer; [Obsolete("Use TerminalApiLocalService instead.")] - public TerminalLocalApi(AdyenClient adyenClient) - : base(adyenClient) + public TerminalLocalApi(Client client) + : base(client) { _terminalApiLocal = new TerminalApiLocal(this); _saleToPoiMessageSerializer = new SaleToPoiMessageSerializer(); @@ -72,7 +72,7 @@ public TerminalLocalApi(AdyenClient adyenClient) public SaleToPOIResponse TerminalRequest(SaleToPOIMessage saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails) { var saleToPoiRequestMessageSerialized = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + saleToPoiRequestMessageSerialized); + Client.LogLine("Request: \n" + saleToPoiRequestMessageSerialized); var saleToPoiRequestMessageSecured = _messageSecuredEncryptor.Encrypt(saleToPoiRequestMessageSerialized, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); var serializeSaleToPoiRequestMessageSecured = _saleToPoiMessageSerializer.Serialize(saleToPoiRequestMessageSecured); var response = _terminalApiLocal.Request(serializeSaleToPoiRequestMessageSecured); @@ -82,7 +82,7 @@ public SaleToPOIResponse TerminalRequest(SaleToPOIMessage saleToPoiRequest, Encr } var saleToPoiResponseSecured = _saleToPoiMessageSecuredSerializer.Deserialize(response); var decryptResponse = _messageSecuredEncryptor.Decrypt(saleToPoiResponseSecured, encryptionCredentialDetails); - AdyenClient.LogLine("Response: \n" + decryptResponse); + Client.LogLine("Response: \n" + decryptResponse); return _saleToPoiMessageSerializer.Deserialize(decryptResponse); } @@ -90,7 +90,7 @@ public SaleToPOIResponse TerminalRequest(SaleToPOIMessage saleToPoiRequest, Encr public async Task TerminalRequestAsync(SaleToPOIMessage saleToPoiRequest, EncryptionCredentialDetails encryptionCredentialDetails, CancellationToken cancellationToken = default) { var saleToPoiRequestMessageSerialized = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + saleToPoiRequestMessageSerialized); + Client.LogLine("Request: \n" + saleToPoiRequestMessageSerialized); var saleToPoiRequestMessageSecured = _messageSecuredEncryptor.Encrypt(saleToPoiRequestMessageSerialized, saleToPoiRequest.MessageHeader, encryptionCredentialDetails); var serializeSaleToPoiRequestMessageSecured = _saleToPoiMessageSerializer.Serialize(saleToPoiRequestMessageSecured); var response = await _terminalApiLocal.RequestAsync(serializeSaleToPoiRequestMessageSecured, cancellationToken: cancellationToken).ConfigureAwait(false); @@ -100,7 +100,7 @@ public async Task TerminalRequestAsync(SaleToPOIMessage saleT } var saleToPoiResponseSecured = _saleToPoiMessageSecuredSerializer.Deserialize(response); var decryptResponse = _messageSecuredEncryptor.Decrypt(saleToPoiResponseSecured, encryptionCredentialDetails); - AdyenClient.LogLine("Response: \n" + decryptResponse); + Client.LogLine("Response: \n" + decryptResponse); return _saleToPoiMessageSerializer.Deserialize(decryptResponse); } diff --git a/Adyen/TerminalApi/Services/TerminalLocalApiUnencrypted.cs b/Adyen/TerminalApi/Services/TerminalLocalApiUnencrypted.cs index b5a251a82..720f16e6c 100644 --- a/Adyen/TerminalApi/Services/TerminalLocalApiUnencrypted.cs +++ b/Adyen/TerminalApi/Services/TerminalLocalApiUnencrypted.cs @@ -19,16 +19,16 @@ public class TerminalLocalApiUnencrypted : AbstractService /// [UNENCRYPTED] Local Terminal Api. /// Use this class (in TEST only) to experiment with the Local Terminal API separately from the encryption implementation required for live payments. Be sure to remove the encryption key details on the Customer Area as it will not work with encryption key details set up. /// - /// Client + /// Client /// [Obsolete("Use TerminalApiLocalService instead.")] - public TerminalLocalApiUnencrypted(AdyenClient adyenClient) - : base(adyenClient) + public TerminalLocalApiUnencrypted(Client client) + : base(client) { // Set default server certificate validation to true so no certificate check is performed var handler = new HttpClientHandler { ServerCertificateCustomValidationCallback = (message, certificate2, arg3, arg4) => true }; - AdyenClient = new AdyenClient(AdyenClient.Config, new System.Net.Http.HttpClient(handler)); + Client = new Client(Client.Config, new System.Net.Http.HttpClient(handler)); _terminalApiLocal = new TerminalApiLocal(this); _saleToPoiMessageSerializer = new SaleToPoiMessageSerializer(); } @@ -42,9 +42,9 @@ public TerminalLocalApiUnencrypted(AdyenClient adyenClient) public SaleToPOIResponse TerminalRequest(SaleToPOIMessage saleToPoiRequest) { var saleToPoiRequestJson = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + saleToPoiRequestJson); + Client.LogLine("Request: \n" + saleToPoiRequestJson); var response = _terminalApiLocal.Request(saleToPoiRequestJson); - AdyenClient.LogLine("Request: \n" + response); + Client.LogLine("Request: \n" + response); return string.IsNullOrEmpty(response) ? null : _saleToPoiMessageSerializer.Deserialize(response); } @@ -58,9 +58,9 @@ public SaleToPOIResponse TerminalRequest(SaleToPOIMessage saleToPoiRequest) public async Task TerminalRequestAsync(SaleToPOIMessage saleToPoiRequest, CancellationToken cancellationToken = default) { var saleToPoiRequestJson = _saleToPoiMessageSerializer.Serialize(saleToPoiRequest); - AdyenClient.LogLine("Request: \n" + saleToPoiRequestJson); + Client.LogLine("Request: \n" + saleToPoiRequestJson); var response = await _terminalApiLocal.RequestAsync(saleToPoiRequestJson, cancellationToken: cancellationToken).ConfigureAwait(false); - AdyenClient.LogLine("Response: \n" + response); + Client.LogLine("Response: \n" + response); return string.IsNullOrEmpty(response) ? null : _saleToPoiMessageSerializer.Deserialize(response); } } From 3a12eb41d40cf524476c0cf3268336505a9db051 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 31 Oct 2025 00:34:46 +0100 Subject: [PATCH 087/126] Rewrite old tests to use the new models Added PayoutTests, Management Tests, Utility, DataProtection, BinlookUp, BalanceControl, BalancePlatfor --- Adyen.Test/BalanceControlTest.cs | 21 - Adyen.Test/BalancePlatformTest.cs | 428 ------------------ Adyen.Test/BinLookup/BinLookupTest.cs | 23 +- Adyen.Test/BinLookupTest.cs | 77 ---- Adyen.Test/Checkout/PaymentsServiceTest.cs | 5 +- Adyen.Test/Checkout/UtilityServiceTest.cs | 40 ++ Adyen.Test/CheckoutUtilityTest.cs | 25 - .../DataProtection/DataProtectionTest.cs | 41 ++ Adyen.Test/DataProtectionTest.cs | 19 - Adyen.Test/HttpClientWrapperTest.cs | 25 - Adyen.Test/Management/ManagementTest.cs | 87 ++++ Adyen.Test/ManagementTest.cs | 77 ---- Adyen.Test/Payout/PayoutTest.cs | 122 +++++ Adyen.Test/PayoutTest.cs | 88 ---- .../{ => TerminalApi}/DeserializerTest.cs | 0 Adyen.Test/{ => TerminalApi}/ProxyTest.cs | 0 .../SaleToAcquirerDataTest.cs | 0 .../{Terminal => TerminalApi}/SplitTest.cs | 0 Adyen.Test/mockHttpClient.cs | 34 -- .../mocks/management/list-terminals.json | 16 + 20 files changed, 327 insertions(+), 801 deletions(-) delete mode 100644 Adyen.Test/BalanceControlTest.cs delete mode 100644 Adyen.Test/BalancePlatformTest.cs delete mode 100644 Adyen.Test/BinLookupTest.cs create mode 100644 Adyen.Test/Checkout/UtilityServiceTest.cs delete mode 100644 Adyen.Test/CheckoutUtilityTest.cs create mode 100644 Adyen.Test/DataProtection/DataProtectionTest.cs delete mode 100644 Adyen.Test/DataProtectionTest.cs delete mode 100644 Adyen.Test/HttpClientWrapperTest.cs create mode 100644 Adyen.Test/Management/ManagementTest.cs delete mode 100644 Adyen.Test/ManagementTest.cs create mode 100644 Adyen.Test/Payout/PayoutTest.cs delete mode 100644 Adyen.Test/PayoutTest.cs rename Adyen.Test/{ => TerminalApi}/DeserializerTest.cs (100%) rename Adyen.Test/{ => TerminalApi}/ProxyTest.cs (100%) rename Adyen.Test/{Terminal => TerminalApi}/SaleToAcquirerDataTest.cs (100%) rename Adyen.Test/{Terminal => TerminalApi}/SplitTest.cs (100%) delete mode 100644 Adyen.Test/mockHttpClient.cs diff --git a/Adyen.Test/BalanceControlTest.cs b/Adyen.Test/BalanceControlTest.cs deleted file mode 100644 index 64d3e92dd..000000000 --- a/Adyen.Test/BalanceControlTest.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using Adyen.Model.BalanceControl; -using Adyen.Service; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - [TestClass] - public class BalanceControlTest : BaseTest - { - [TestMethod] - public void BalanceTransferTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balance-control-transfer.json"); - var service = new BalanceControlService(client); - var response = service.BalanceTransfer(new BalanceTransferRequest()); - Assert.AreEqual(response.CreatedAt, new DateTime(2022,01, 24)); - Assert.AreEqual(response.Status, BalanceTransferResponse.StatusEnum.Transferred); - } - } -} \ No newline at end of file diff --git a/Adyen.Test/BalancePlatformTest.cs b/Adyen.Test/BalancePlatformTest.cs deleted file mode 100644 index 80f29789b..000000000 --- a/Adyen.Test/BalancePlatformTest.cs +++ /dev/null @@ -1,428 +0,0 @@ -using System; -using System.Net.Http; -using System.Threading; -using Adyen.Model.BalancePlatform; -using Adyen.Service.BalancePlatform; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NSubstitute; - -namespace Adyen.Test -{ - [TestClass] - public class BalancePlatformTest : BaseTest - { - #region AccountHolders - - /// - /// Test GetAccountHoldersId - /// - [TestMethod] - public void GetAccountHoldersIdTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/AccountHolder.json"); - var service = new AccountHoldersService(client); - - var response = service.GetAccountHolder("AH32272223222B5CM4MWJ892H"); - Assert.AreEqual(response.Status, AccountHolder.StatusEnum.Active); - Assert.AreEqual(response.Id, "AH32272223222B5CM4MWJ892H"); - } - - /// - /// Test PostAccountHolders - /// - [TestMethod] - public void PostAccountHoldersTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/AccountHolder.json"); - var service = new AccountHoldersService(client); - var accountHolder = new AccountHolderInfo() - { - BalancePlatform = "balance" - }; - var response = service.CreateAccountHolder(accountHolder); - Assert.AreEqual(response.Status, AccountHolder.StatusEnum.Active); - Assert.AreEqual(response.Id, "AH32272223222B5CM4MWJ892H"); - } - - /// - /// Test PatchAccountHoldersId - /// - [TestMethod] - public void PatchAccountHoldersIdTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/AccountHolder.json"); - var service = new AccountHoldersService(client); - var accountHolder = new AccountHolderUpdateRequest() - { - BalancePlatform = "balance" - }; - var response = service.UpdateAccountHolder("AH32272223222B5CM4MWJ892H", accountHolder); - Assert.AreEqual(response.Status, AccountHolder.StatusEnum.Active); - Assert.AreEqual(response.Id, "AH32272223222B5CM4MWJ892H"); - } - - /// - /// Test GetAccountHoldersIdBalanceAccountsAsync - /// - [TestMethod] - public void GetAccountHoldersIdBalanceAccountsAsyncTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/PaginatedBalanceAccountsResponse.json"); - var service = new AccountHoldersService(client); - - var response = service.GetAllBalanceAccountsOfAccountHolderAsync("id", offset: 1, limit: 3).Result; - Assert.AreEqual("BA32272223222B5CTDNB66W2Z", response.BalanceAccounts[0].Id); - Assert.AreEqual(BalanceAccountBase.StatusEnum.Active, response.BalanceAccounts[1].Status); - ClientInterfaceSubstitute.Received() - .RequestAsync( - "https://balanceplatform-api-test.adyen.com/bcl/v2/accountHolders/id/balanceAccounts?offset=1&limit=3", - null, null, HttpMethod.Get, default); - } - - #endregion - - #region BalanceAccounts - - /// - /// Test GetBalanceAccountsId - /// - [TestMethod] - public void GetBalanceAccountsIdTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/BalanceAccount.json"); - var service = new BalanceAccountsService(client); - - var response = service.GetBalanceAccount("AH32272223222B5CM4MWJ892H"); - Assert.AreEqual(response.Status, BalanceAccount.StatusEnum.Active); - Assert.AreEqual(response.Id, "BA3227C223222H5J4DCGQ9V9L"); - } - - /// - /// Test GetBalanceAccountsId - /// - [TestMethod] - public void PostBalanceAccountsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/BalanceAccount.json"); - var service = new BalanceAccountsService(client); - var balanceAccountInfo = new BalanceAccountInfo() - { - AccountHolderId = "accountHolderId" - }; - var response = service.CreateBalanceAccount(balanceAccountInfo); - Assert.AreEqual(response.Status, BalanceAccount.StatusEnum.Active); - Assert.AreEqual(response.Id, "BA3227C223222H5J4DCGQ9V9L"); - } - - /// - /// Test PatchBalanceAccountsIdAsync - /// - [TestMethod] - public void PatchBalanceAccountsIdAsyncTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/BalanceAccount.json"); - var service = new BalanceAccountsService(client); - var response = service.UpdateBalanceAccountAsync("BA3227C223222H5J4DCGQ9V9L", new BalanceAccountUpdateRequest()).Result; - Assert.AreEqual(response.Status, BalanceAccount.StatusEnum.Active); - Assert.AreEqual(response.Id, "BA3227C223222H5J4DCGQ9V9L"); - } - - /// - /// Test PostBalanceAccountsBalanceAccountIdSweeps - /// - [TestMethod] - public void PostBalanceAccountsBalanceAccountIdSweepsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/SweepConfiguration.json"); - var service = new BalanceAccountsService(client); - - var response = service.CreateSweep("1245yhgeswkrw", new CreateSweepConfigurationV2()); - Assert.AreEqual(response.Status, SweepConfigurationV2.StatusEnum.Active); - Assert.AreEqual(response.Type, SweepConfigurationV2.TypeEnum.Pull); - } - - /// - /// Test GetBalanceAccountsBalanceAccountIdSweeps - /// - [TestMethod] - public void GetBalanceAccountsBalanceAccountIdSweepsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/BalanceSweepConfigurationsResponse.json"); - var service = new BalanceAccountsService(client); - - var response = service.GetAllSweepsForBalanceAccount("balanceAccountId"); - Assert.AreEqual(response.Sweeps[0].Status, SweepConfigurationV2.StatusEnum.Active); - Assert.AreEqual(response.Sweeps[0].Id, "SWPC4227C224555B5FTD2NT2JV4WN5"); - var schedule = response.Sweeps[0].Schedule.Type; - Assert.AreEqual(schedule, SweepSchedule.TypeEnum.Daily); - ClientInterfaceSubstitute.Received().RequestAsync( - "https://balanceplatform-api-test.adyen.com/bcl/v2/balanceAccounts/balanceAccountId/sweeps", - null, - null, HttpMethod.Get, new CancellationToken()); - } - - /// - /// Test PatchBalanceAccountsBalanceAccountIdSweepsSweepId - /// - [TestMethod] - public void PatchBalanceAccountsBalanceAccountIdSweepsSweepIdTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/SweepConfiguration.json"); - var service = new BalanceAccountsService(client); - - var response = service.UpdateSweep("balanceID", "sweepId",new UpdateSweepConfigurationV2()); - Assert.AreEqual(response.Status, SweepConfigurationV2.StatusEnum.Active); - Assert.AreEqual(response.Type, SweepConfigurationV2.TypeEnum.Pull); - } - - /// - /// Test DeleteBalanceAccountsBalanceAccountIdSweepsSweepId - /// - [TestMethod] - public void DeleteBalanceAccountsBalanceAccountIdSweepsSweepIdTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/SweepConfiguration.json"); - var service = new BalanceAccountsService(client); - service.DeleteSweep("balanceID", "sweepId"); - } - - /// - /// Test PatchBalanceAccountsBalanceAccountIdSweepsSweepId - /// - [TestMethod] - public void GetBalanceAccountsIdPaymentInstrumentsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/PaginatedPaymentInstrumentsResponse.json"); - var service = new BalanceAccountsService(client); - - var response = service.GetPaymentInstrumentsLinkedToBalanceAccount("balanceID"); - Assert.AreEqual(response.PaymentInstruments[0].Status, PaymentInstrument.StatusEnum.Active); - Assert.AreEqual(response.PaymentInstruments[0].Id, "PI32272223222B59M5TM658DT"); - } - #endregion - - #region General - - /// - /// Test GetBalancePlatformsId - /// - [TestMethod] - public void GetBalancePlatformsIdTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/BalancePlatform.json"); - var service = new PlatformService(client); - - var response = service.GetBalancePlatform("uniqueIdentifier"); - Assert.AreEqual(response.Status, "Active"); - Assert.AreEqual(response.Id, "YOUR_BALANCE_PLATFORM"); - } - - /// - /// Test GetBalancePlatformsIdAccountHolders - /// - [TestMethod] - public void GetBalancePlatformsIdAccountHoldersTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/PaginatedAccountHoldersResponse.json"); - var service = new PlatformService(client); - - var response = service.GetAllAccountHoldersUnderBalancePlatform("uniqueIdentifier"); - Assert.AreEqual(response.AccountHolders[0].Id, "AH32272223222B5GFSNSXFFL9"); - Assert.AreEqual(response.AccountHolders[0].Status, AccountHolder.StatusEnum.Active); - } - - #endregion - - #region PaymentInstrumentGroups - - /// - /// Test GetPaymentInstrumentGroupsId - /// - [TestMethod] - public void GetPaymentInstrumentGroupsIdTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/PaymentInstrumentGroup.json"); - var service = new PaymentInstrumentGroupsService(client); - - var response = service.GetPaymentInstrumentGroup("uniqueIdentifier"); - Assert.AreEqual(response.Id, "PG3227C223222B5CMD3FJFKGZ"); - Assert.AreEqual(response.BalancePlatform, "YOUR_BALANCE_PLATFORM"); - } - - /// - /// Test PostPaymentInstrumentGroups - /// - [TestMethod] - public void PostPaymentInstrumentGroupsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/PaymentInstrumentGroup.json"); - var service = new PaymentInstrumentGroupsService(client); - - var response = service.CreatePaymentInstrumentGroup(new PaymentInstrumentGroupInfo()); - Assert.AreEqual(response.Id, "PG3227C223222B5CMD3FJFKGZ"); - Assert.AreEqual(response.BalancePlatform, "YOUR_BALANCE_PLATFORM"); - } - - /// - /// Test GetPaymentInstrumentGroupsIdTransactionRules - /// - [TestMethod] - public void GetPaymentInstrumentGroupsIdTransactionRulesTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/TransactionRulesResponse.json"); - var service = new PaymentInstrumentGroupsService(client); - - var response = service.GetAllTransactionRulesForPaymentInstrumentGroup("id"); - Assert.AreEqual(response.TransactionRules[0].Type, TransactionRule.TypeEnum.Velocity); - Assert.AreEqual(response.TransactionRules[0].Id, "TR3227C223222C5GXR3XP596N"); - } - - #endregion - - #region PaymenInstruments - - /// - /// Test GetPaymentInstrumentGroupsId - /// - [TestMethod] - public void PostPaymentInstrumentsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/PaymentInstrument.json"); - var service = new PaymentInstrumentsService(client); - - var response = service.CreatePaymentInstrument(new PaymentInstrumentInfo()); - Assert.AreEqual(response.BalanceAccountId, "BA3227C223222B5CTBLR8BWJB"); - Assert.AreEqual(response.Type, PaymentInstrument.TypeEnum.BankAccount); - } - - /// - /// Test PatchPaymentInstrumentsId - /// - [TestMethod] - public void PatchPaymentInstrumentsIdTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/PaymentInstrument.json"); - var service = new PaymentInstrumentsService(client); - - var response = service.UpdatePaymentInstrument("id", new PaymentInstrumentUpdateRequest()); - Assert.AreEqual(response.BalanceAccountId, "BA3227C223222B5CTBLR8BWJB"); - Assert.AreEqual(response.Type, UpdatePaymentInstrument.TypeEnum.BankAccount); - } - - /// - /// Test GetPaymentInstrumentsId - /// - [TestMethod] - public void GetPaymentInstrumentsIdTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/PaymentInstrument.json"); - var service = new PaymentInstrumentsService(client); - - var response = service.GetPaymentInstrument("id"); - Assert.AreEqual(response.BalanceAccountId, "BA3227C223222B5CTBLR8BWJB"); - Assert.AreEqual(response.Type, PaymentInstrument.TypeEnum.BankAccount); - } - - /// - /// Test GetPaymentInstrumentsIdTransactionRules - /// - [TestMethod] - public void GetPaymentInstrumentsIdTransactionRulesTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/TransactionRulesResponse.json"); - var service = new PaymentInstrumentsService(client); - - var response = service.GetAllTransactionRulesForPaymentInstrument("id"); - Assert.AreEqual(response.TransactionRules[0].Id, "TR3227C223222C5GXR3XP596N"); - Assert.AreEqual(response.TransactionRules[0].Type, TransactionRule.TypeEnum.Velocity); - } - - #endregion - - #region TransactionRules - - /// - /// Test PostTransactionRules - /// - [TestMethod] - public void PostTransactionRulesTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/TransactionRule.json"); - var service = new TransactionRulesService(client); - - var response = service.CreateTransactionRule(new TransactionRuleInfo()); - Assert.AreEqual(response.EntityKey.EntityReference, "PI3227C223222B5BPCMFXD2XG"); - Assert.AreEqual(response.EntityKey.EntityType, "paymentInstrument"); - Assert.AreEqual(response.Interval.Type, TransactionRuleInterval.TypeEnum.PerTransaction); - } - - /// - /// Test PatchTransactionRulesTransactionRuleId - /// - [TestMethod] - public void PatchTransactionRulesTransactionRuleIdTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/TransactionRule.json"); - var service = new TransactionRulesService(client); - - var response = service.UpdateTransactionRule("transactionRuleId", new TransactionRuleInfo()); - Assert.AreEqual(response.EntityKey.EntityReference, "PI3227C223222B5BPCMFXD2XG"); - Assert.AreEqual(response.EntityKey.EntityType, "paymentInstrument"); - Assert.AreEqual(response.Interval.Type, TransactionRuleInterval.TypeEnum.PerTransaction); - } - - /// - /// Test GetTransactionRulesTransactionRuleId - /// - [TestMethod] - public void GetTransactionRulesTransactionRuleIdTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/TransactionRuleResponse.json"); - var service = new TransactionRulesService(client); - - var response = service.GetTransactionRule("transactionRuleId"); - Assert.AreEqual(response.TransactionRule.Id, "TR32272223222B5GFSGFLFCHM"); - Assert.AreEqual(response.TransactionRule.Interval.Type, TransactionRuleInterval.TypeEnum.PerTransaction); - } - - /// - /// Test DeleteTransactionRulesTransactionRuleId - /// - [TestMethod] - public void DeleteTransactionRulesTransactionRuleIdTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/TransactionRuleResponse.json"); - var service = new TransactionRulesService(client); - var response = service.DeleteTransactionRule("transactionRuleId"); - - } - #endregion - - #region BankAccountValidation - /// - /// Test /validateBankAccountIdentification - /// - [TestMethod] - public void ValidateBankAccountTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/balanceplatform/TransactionRuleResponse.json"); - var service = new BankAccountValidationService(client); - var bankAccountIdentificationValidationRequest = new BankAccountIdentificationValidationRequest - { - AccountIdentification = new BankAccountIdentificationValidationRequestAccountIdentification( - new CZLocalAccountIdentification - { - AccountNumber = "123456789", - BankCode = "bankCode", - Type = CZLocalAccountIdentification.TypeEnum.CzLocal - }) - }; - service.ValidateBankAccountIdentification(bankAccountIdentificationValidationRequest); - ClientInterfaceSubstitute.Received().RequestAsync( - "https://balanceplatform-api-test.adyen.com/bcl/v2/validateBankAccountIdentification", - Arg.Any(), - null, HttpMethod.Post, new CancellationToken()); - } - #endregion - } -} \ No newline at end of file diff --git a/Adyen.Test/BinLookup/BinLookupTest.cs b/Adyen.Test/BinLookup/BinLookupTest.cs index 51c7613f1..a091222a4 100644 --- a/Adyen.Test/BinLookup/BinLookupTest.cs +++ b/Adyen.Test/BinLookup/BinLookupTest.cs @@ -31,7 +31,7 @@ public BinLookupTest() } [TestMethod] - public void Get3dsAvailabilitySuccessMockedTest() + public void Given_Deserialize_When_ThreeDSAvailabilityResponse_Result_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/binlookup/get3dsavailability-success.json"); @@ -46,12 +46,12 @@ public void Get3dsAvailabilitySuccessMockedTest() Assert.AreEqual("411111111111", response.ThreeDS2CardRangeDetails[0].EndRange); Assert.AreEqual("2.1.0", response.ThreeDS2CardRangeDetails[0].ThreeDS2Versions.FirstOrDefault()); Assert.AreEqual("https://pal-test.adyen.com/threeds2simulator/acs/startMethod.shtml", response.ThreeDS2CardRangeDetails[0].ThreeDSMethodURL); - Assert.AreEqual(true, response.ThreeDS1Supported); - Assert.AreEqual(true, response.ThreeDS2supported); + Assert.IsTrue(response.ThreeDS1Supported); + Assert.IsTrue(response.ThreeDS2supported); } [TestMethod] - public void GetCostEstimateSuccessMockedTest() + public void Given_Deserialize_When_CostEstimateResponse_Result_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/binlookup/getcostestimate-success.json"); @@ -63,5 +63,20 @@ public void GetCostEstimateSuccessMockedTest() Assert.AreEqual("1111", response.CardBin.Summary); Assert.AreEqual("Unsupported", response.ResultCode); } + + [TestMethod] + public void Given_Serialize_When_CostEstimateRequest_ShopperInteractionEnums_Result_Should_Return_Correct_String() + { + // Arrange + // Act + string ecommerce = JsonSerializer.Serialize(CostEstimateRequest.ShopperInteractionEnum.Ecommerce, _jsonSerializerOptionsProvider.Options); + string contAuth = JsonSerializer.Serialize(CostEstimateRequest.ShopperInteractionEnum.ContAuth, _jsonSerializerOptionsProvider.Options); + string moto = JsonSerializer.Serialize(CostEstimateRequest.ShopperInteractionEnum.Moto, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(@"""Ecommerce""", ecommerce); + Assert.AreEqual(@"""ContAuth""", contAuth); + Assert.AreEqual(@"""Moto""", moto); + } } } diff --git a/Adyen.Test/BinLookupTest.cs b/Adyen.Test/BinLookupTest.cs deleted file mode 100644 index fe872f055..000000000 --- a/Adyen.Test/BinLookupTest.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.Linq; -using Adyen.Model.BinLookup; -using Adyen.Service; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Newtonsoft.Json; - -namespace Adyen.Test -{ - [TestClass] - public class BinLookupTest : BaseTest - { - [TestMethod] - public void Get3dsAvailabilitySuccessMockedTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/binlookup/get3dsavailability-success.json"); - var binLookup = new BinLookupService(client); - var threeDsAvailabilityRequest = new ThreeDSAvailabilityRequest - { - MerchantAccount = "merchantAccount", - CardNumber = "4111111111111111" - }; - var threeDsAvailabilityResponse = binLookup.Get3dsAvailability(threeDsAvailabilityRequest); - Assert.AreEqual("F013371337", threeDsAvailabilityResponse.DsPublicKeys[0].DirectoryServerId); - Assert.AreEqual("visa", threeDsAvailabilityResponse.DsPublicKeys[0].Brand); - Assert.AreEqual("411111111111", threeDsAvailabilityResponse.ThreeDS2CardRangeDetails[0].StartRange); - Assert.AreEqual("411111111111", threeDsAvailabilityResponse.ThreeDS2CardRangeDetails[0].EndRange); - Assert.AreEqual("2.1.0", threeDsAvailabilityResponse.ThreeDS2CardRangeDetails[0].ThreeDS2Versions.FirstOrDefault()); - Assert.AreEqual("https://pal-test.adyen.com/threeds2simulator/acs/startMethod.shtml", threeDsAvailabilityResponse.ThreeDS2CardRangeDetails[0].ThreeDSMethodURL); - Assert.AreEqual(true, threeDsAvailabilityResponse.ThreeDS1Supported); - Assert.AreEqual(true, threeDsAvailabilityResponse.ThreeDS2supported); - } - - [TestMethod] - public void GetCostEstimateSuccessMockedTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/binlookup/getcostestimate-success.json"); - var binLookup = new BinLookupService(client); - var costEstimateRequest = new CostEstimateRequest(); - var amount = new Amount - { - Currency = "EUR", - Value = 1000 - }; - costEstimateRequest.Amount = amount; - var costEstimateAssumptions = new CostEstimateAssumptions - { - AssumeLevel3Data = true, - Assume3DSecureAuthenticated = true - }; - costEstimateRequest.Assumptions = costEstimateAssumptions; - costEstimateRequest.CardNumber = "4111111111111111"; - costEstimateRequest.MerchantAccount = "merchantAccount"; - var merchantDetails = new MerchantDetails - { - CountryCode = "NL", - Mcc = "7411", - EnrolledIn3DSecure = true - }; - costEstimateRequest.MerchantDetails = (merchantDetails); - costEstimateRequest.ShopperInteraction = CostEstimateRequest.ShopperInteractionEnum.Ecommerce; - var costEstimateResponse = binLookup.GetCostEstimate(costEstimateRequest); - Assert.AreEqual("1111", costEstimateResponse.CardBin.Summary); - Assert.AreEqual("Unsupported", costEstimateResponse.ResultCode); - } - - [TestMethod] - public void GetCostEstimateSuccessGenerateShopperInteractionFromEnum() - { - var ecommerce = JsonConvert.SerializeObject(CostEstimateRequest.ShopperInteractionEnum.Ecommerce); - var contAuth = JsonConvert.SerializeObject(CostEstimateRequest.ShopperInteractionEnum.ContAuth); - var moto = JsonConvert.SerializeObject(CostEstimateRequest.ShopperInteractionEnum.Moto); - Assert.AreEqual("\"Ecommerce\"", ecommerce); - Assert.AreEqual("\"ContAuth\"", contAuth); - Assert.AreEqual("\"Moto\"", moto); - } - } -} diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index 6c5895cd7..a0079fd4a 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -1,5 +1,3 @@ -using System.Text; -using System.Text.Json; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; @@ -8,7 +6,8 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; using Adyen.Core.Options; -using JsonSerializer = System.Text.Json.JsonSerializer; +using System.Text; +using System.Text.Json; namespace Adyen.Test.Checkout { diff --git a/Adyen.Test/Checkout/UtilityServiceTest.cs b/Adyen.Test/Checkout/UtilityServiceTest.cs new file mode 100644 index 000000000..2a44e4040 --- /dev/null +++ b/Adyen.Test/Checkout/UtilityServiceTest.cs @@ -0,0 +1,40 @@ +using Adyen.Checkout.Extensions; +using Adyen.Checkout.Models; +using Adyen.Checkout.Client; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.Extensions.Hosting; +using Adyen.Core.Options; +using System.Text.Json; + +namespace Adyen.Test.Checkout +{ + [TestClass] + public class UtilityServiceTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public UtilityServiceTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_Deserialize_When_UtilityResponse_For_OriginKeys_Returns_Success() + { + string json = TestUtilities.GetTestFileContent("mocks/checkoututility/originkeys-success.json"); + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + Assert.AreEqual("pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4xLmNvbQ.UEwIBmW9-c_uXo5wSEr2w8Hz8hVIpujXPHjpcEse3xI", response.OriginKeys["https://www.your-domain1.com"]); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/CheckoutUtilityTest.cs b/Adyen.Test/CheckoutUtilityTest.cs deleted file mode 100644 index 70515889c..000000000 --- a/Adyen.Test/CheckoutUtilityTest.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Collections.Generic; -using Adyen.Model.Checkout; -using Adyen.Service.Checkout; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - [TestClass] - public class CheckoutUtilityTest : BaseTest - { - /// - /// Test success flow for - ///POST /originKeys - /// - [TestMethod] - public void OriginKeysSuccessTest() - { - var checkoutUtilityRequest = new UtilityRequest(originDomains: new List { "www.test.com", "https://www.your-domain2.com" }); - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkoututility/originkeys-success.json"); - var _checkout = new UtilityService(client); - var originKeysResponse = _checkout.OriginKeys(checkoutUtilityRequest); - Assert.AreEqual("pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4xLmNvbQ.UEwIBmW9-c_uXo5wSEr2w8Hz8hVIpujXPHjpcEse3xI", originKeysResponse.OriginKeys["https://www.your-domain1.com"]); - } - } -} diff --git a/Adyen.Test/DataProtection/DataProtectionTest.cs b/Adyen.Test/DataProtection/DataProtectionTest.cs new file mode 100644 index 000000000..24a62db26 --- /dev/null +++ b/Adyen.Test/DataProtection/DataProtectionTest.cs @@ -0,0 +1,41 @@ +using Adyen.Core.Options; +using Adyen.DataProtection.Client; +using Adyen.DataProtection.Models; +using Adyen.DataProtection.Extensions; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Text.Json; + +namespace Adyen.Test.DataProtection +{ + [TestClass] + public class DataProtectionTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public DataProtectionTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureDataProtection((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_Deserialize_When_SubjectErasureResponse_Returns_Not_Null_And_Correct_Enum() + { + string json = TestUtilities.GetTestFileContent("mocks/data-protection-response.json"); + + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + Assert.AreEqual(response.Result, SubjectErasureResponse.ResultEnum.ACTIVERECURRINGTOKENEXISTS); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/DataProtectionTest.cs b/Adyen.Test/DataProtectionTest.cs deleted file mode 100644 index 84d5eca6f..000000000 --- a/Adyen.Test/DataProtectionTest.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Adyen.Model.DataProtection; -using Adyen.Service; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - [TestClass] - public class DataProtectionTest : BaseTest - { - [TestMethod] - public void TestRequestSubjectErasure() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/data-protection-response.json"); - var service = new DataProtectionService(client); - var response = service.RequestSubjectErasure(new SubjectErasureByPspReferenceRequest()); - Assert.AreEqual(response.Result, SubjectErasureResponse.ResultEnum.ACTIVERECURRINGTOKENEXISTS); - } - } -} \ No newline at end of file diff --git a/Adyen.Test/HttpClientWrapperTest.cs b/Adyen.Test/HttpClientWrapperTest.cs deleted file mode 100644 index 0704beec8..000000000 --- a/Adyen.Test/HttpClientWrapperTest.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Adyen.HttpClient; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - [TestClass] - public class HttpClientWrapperTest : BaseTest - { - [TestMethod] - public void EmptyRequestBodyPostTest() - { - var configWithApiKey = new Config - { - Environment = Model.Environment.Test, - XApiKey = "AQEyhmfxK....LAG84XwzP5pSpVd" - }; - var mockHttpMessageHandler = new MockHttpMessageHandler("{}", System.Net.HttpStatusCode.OK); - var httpClient = new System.Net.Http.HttpClient(mockHttpMessageHandler); - var httpClientWrapper = new HttpClientWrapper(configWithApiKey, httpClient); - var _ = httpClientWrapper.Request("https://test.com/testpath", null, null, HttpMethod.Post); - Assert.AreEqual("{}", mockHttpMessageHandler.Input); - } - - } -} \ No newline at end of file diff --git a/Adyen.Test/Management/ManagementTest.cs b/Adyen.Test/Management/ManagementTest.cs new file mode 100644 index 000000000..7555a4bd9 --- /dev/null +++ b/Adyen.Test/Management/ManagementTest.cs @@ -0,0 +1,87 @@ +using Adyen.Core.Options; +using Adyen.Management.Client; +using Adyen.Management.Extensions; +using Adyen.Management.Models; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Text.Json; + +namespace Adyen.Test.Management +{ + [TestClass] + public class ManagementTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public ManagementTest() + { + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureManagement((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + _jsonSerializerOptionsProvider = testHost.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_Deserialize_When_MeApiCredential_Result_Return_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/management/me.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("S2-6262224667", response.Id); + Assert.IsTrue(response.Active); + Assert.AreEqual("Management API - Users read and write", response.Roles[0]); + } + + [TestMethod] + public void Given_Deserialize_When_ListMerchantResponse_Returns_Correct_Data() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/management/list-merchant-accounts.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(22, response.ItemsTotal); + Assert.AreEqual("YOUR_MERCHANT_ACCOUNT_1", response.Data[0].Id); + } + + [TestMethod] + public async Task Given_Deserialize_When_UpdateResource_Returns_Data_String() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/management/logo.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("BASE-64_ENCODED_STRING_FROM_THE_REQUEST", response.Data); + } + + [TestMethod] + public void Given_Deserialize_When_ListTerminalsResponse_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/management/list-terminals.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(2, response.Data.Count); + Assert.AreEqual("V400m-080020970", response.Data.First(o => o.SerialNumber == "080-020-970").Id); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/ManagementTest.cs b/Adyen.Test/ManagementTest.cs deleted file mode 100644 index 010c79ba1..000000000 --- a/Adyen.Test/ManagementTest.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.Linq; -using System.Net.Http; -using System.Threading.Tasks; -using Adyen.Model.Management; -using Adyen.Service.Management; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NSubstitute; - -namespace Adyen.Test -{ - [TestClass] - public class ManagementTest : BaseTest - { - [TestMethod] - public void Me() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/management/me.json"); - var service = new MyAPICredentialService(client); - - var response = service.GetApiCredentialDetails(); - - Assert.AreEqual("S2-6262224667", response.Id); - Assert.IsTrue(response.Active); - Assert.AreEqual("Management API - Users read and write", response.Roles[0]); - } - - [TestMethod] - public void ListMerchantAccounts() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/management/list-merchant-accounts.json"); - var service = new AccountCompanyLevelService(client); - - var response = service.ListMerchantAccounts("ABC123", 1, 10); - - Assert.AreEqual(22, response.ItemsTotal); - Assert.AreEqual("YOUR_MERCHANT_ACCOUNT_1", response.Data[0].Id); - ClientInterfaceSubstitute.Received().RequestAsync( - "https://management-test.adyen.com/v3/companies/ABC123/merchants?pageNumber=1&pageSize=10", null, null, - HttpMethod.Get, default); - } - - [TestMethod] - public async Task UpdateResource() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/management/logo.json"); - var service = new TerminalSettingsCompanyLevelService(client); - - var logo = await service.UpdateTerminalLogoAsync("123ABC", "E355", new Logo("base64")); - - Assert.AreEqual("BASE-64_ENCODED_STRING_FROM_THE_REQUEST", logo.Data); - await ClientInterfaceSubstitute.Received().RequestAsync( - "https://management-test.adyen.com/v3/companies/123ABC/terminalLogos?model=E355", - Arg.Any(), - null, - new HttpMethod("PATCH"), default); - } - - [TestMethod] - public void ListTerminals() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/management/list-terminals.json"); - var service = new TerminalsTerminalLevelService(client); - - var terminals = service.ListTerminals(searchQuery: "ABC OR 123", pageSize: 2); - - Assert.AreEqual(2, terminals.Data.Count); - ClientInterfaceSubstitute.Received().RequestAsync( - "https://management-test.adyen.com/v3/terminals?searchQuery=ABC+OR+123&pageSize=2", - null, null, new HttpMethod("GET"), default); - var terminal = - from o in terminals.Data - where o.SerialNumber == "080-020-970" - select o; - Assert.AreEqual("V400m-080020970", terminal.First().Id); - } - } -} \ No newline at end of file diff --git a/Adyen.Test/Payout/PayoutTest.cs b/Adyen.Test/Payout/PayoutTest.cs new file mode 100644 index 000000000..894872a3a --- /dev/null +++ b/Adyen.Test/Payout/PayoutTest.cs @@ -0,0 +1,122 @@ +using Adyen.Core.Options; +using Adyen.Payout.Client; +using Adyen.Payout.Models; +using Adyen.Payout.Extensions; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Text.Json; + +namespace Adyen.Test +{ + [TestClass] + public class PayoutTest : BaseTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public PayoutTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigurePayout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_Deserialize_When_StoreDetailAndSubmitThirdParty_Returns_Not_Null() + { + // Arrange + string client = TestUtilities.GetTestFileContent("mocks/payout/storeDetailAndSubmitThirdParty-success.json"); + + // Act + var response = JsonSerializer.Deserialize(client, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("[payout-submit-received]", response.ResultCode); + Assert.AreEqual("8515131751004933", response.PspReference); + Assert.AreEqual("GREEN", response.AdditionalData["fraudResultType"]); + Assert.AreEqual("false", response.AdditionalData["fraudManualReview"]); + } + + [TestMethod] + public void Given_Deserialize_When_StoreDetail_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/payout/storeDetail-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("Success", response.ResultCode); + Assert.AreEqual("8515136787207087", response.PspReference); + Assert.AreEqual("8415088571022720", response.RecurringDetailReference); + } + + [TestMethod] + public void Given_Deserialize_When_ConfirmThirdParty_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/payout/modifyResponse-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("[payout-confirm-received]", response.Response); + Assert.AreEqual("8815131762537886", response.PspReference); + } + + [TestMethod] + public void Given_Deserialize_When_SubmitThirdParty_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/payout/submitResponse-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("[payout-submit-received]", response.ResultCode); + Assert.AreEqual("8815131768219992", response.PspReference); + Assert.AreEqual("GREEN", response.AdditionalData["fraudResultType"]); + Assert.AreEqual("false", response.AdditionalData["fraudManualReview"]); + } + + [TestMethod] + public void Given_Deserialize_When_DeclineThirdParty_ModifyResponse_Then_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/payout/modifyResponse-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("[payout-confirm-received]", response.Response); + Assert.AreEqual("8815131762537886", response.PspReference); + } + + [TestMethod] + public void PayoutSuccessTest() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/payout/payout-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("8814689190961342", response.PspReference); + Assert.AreEqual("12345", response.AuthCode); + } + } +} + diff --git a/Adyen.Test/PayoutTest.cs b/Adyen.Test/PayoutTest.cs deleted file mode 100644 index 08ed3c12e..000000000 --- a/Adyen.Test/PayoutTest.cs +++ /dev/null @@ -1,88 +0,0 @@ -using Adyen.Model.Payout; -using Adyen.Service.Payout; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - [TestClass] - public class PayoutTest : BaseTest - { - [TestMethod] - public void StoreDetailAndSubmitThirdPartySuccessTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/payout/storeDetailAndSubmitThirdParty-success.json"); - var payout = new InitializationService(client); - - var request = new StoreDetailAndSubmitRequest(); - var result = payout.StoreDetailAndSubmitThirdParty(request); - - Assert.AreEqual("[payout-submit-received]", result.ResultCode); - Assert.AreEqual("8515131751004933", result.PspReference); - Assert.AreEqual("GREEN", result.AdditionalData["fraudResultType"]); - Assert.AreEqual("false", result.AdditionalData["fraudManualReview"]); - } - - [TestMethod] - public void StoreDetailSuccessTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/payout/storeDetail-success.json"); - var payout = new InitializationService(client); - - var request = new StoreDetailRequest(); - var result = payout.StoreDetail(request); - - Assert.AreEqual("Success", result.ResultCode); - Assert.AreEqual("8515136787207087", result.PspReference); - Assert.AreEqual("8415088571022720", result.RecurringDetailReference); - } - - [TestMethod] - public void ConfirmThirdPartySuccessTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/payout/modifyResponse-success.json"); - var payout = new ReviewingService(client); - - var request = new ModifyRequest(); - var result = payout.ConfirmThirdParty(request); - - Assert.AreEqual("[payout-confirm-received]", result.Response); - Assert.AreEqual("8815131762537886", result.PspReference); - } - - [TestMethod] - public void SubmitThirdPartySuccessTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/payout/submitResponse-success.json"); - var payout = new InitializationService(client); - var request = new SubmitRequest(); - var result = payout.SubmitThirdParty(request); - Assert.AreEqual("[payout-submit-received]", result.ResultCode); - Assert.AreEqual("8815131768219992", result.PspReference); - Assert.AreEqual("GREEN", result.AdditionalData["fraudResultType"]); - Assert.AreEqual("false", result.AdditionalData["fraudManualReview"]); - } - - [TestMethod] - public void DeclineThirdPartySuccessTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/payout/modifyResponse-success.json"); - var payout = new ReviewingService(client); - var request = new ModifyRequest(); - var result = payout.DeclineThirdParty(request); - Assert.AreEqual("[payout-confirm-received]", result.Response); - Assert.AreEqual("8815131762537886", result.PspReference); - } - - [TestMethod] - public void PayoutSuccessTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/payout/payout-success.json"); - var payout = new InstantPayoutsService(client); - var request = new PayoutRequest(); - var result = payout.Payout(request); - Assert.AreEqual("8814689190961342", result.PspReference); - Assert.AreEqual("12345", result.AuthCode); - } - } -} - diff --git a/Adyen.Test/DeserializerTest.cs b/Adyen.Test/TerminalApi/DeserializerTest.cs similarity index 100% rename from Adyen.Test/DeserializerTest.cs rename to Adyen.Test/TerminalApi/DeserializerTest.cs diff --git a/Adyen.Test/ProxyTest.cs b/Adyen.Test/TerminalApi/ProxyTest.cs similarity index 100% rename from Adyen.Test/ProxyTest.cs rename to Adyen.Test/TerminalApi/ProxyTest.cs diff --git a/Adyen.Test/Terminal/SaleToAcquirerDataTest.cs b/Adyen.Test/TerminalApi/SaleToAcquirerDataTest.cs similarity index 100% rename from Adyen.Test/Terminal/SaleToAcquirerDataTest.cs rename to Adyen.Test/TerminalApi/SaleToAcquirerDataTest.cs diff --git a/Adyen.Test/Terminal/SplitTest.cs b/Adyen.Test/TerminalApi/SplitTest.cs similarity index 100% rename from Adyen.Test/Terminal/SplitTest.cs rename to Adyen.Test/TerminalApi/SplitTest.cs diff --git a/Adyen.Test/mockHttpClient.cs b/Adyen.Test/mockHttpClient.cs deleted file mode 100644 index 978a21c89..000000000 --- a/Adyen.Test/mockHttpClient.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Net; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; - -public class MockHttpMessageHandler : HttpMessageHandler -{ - private readonly string _response; - private readonly HttpStatusCode _statusCode; - - public string Input { get; private set; } - public int NumberOfCalls { get; private set; } - - public MockHttpMessageHandler(string response, HttpStatusCode statusCode) - { - _response = response; - _statusCode = statusCode; - } - - protected override async Task SendAsync(HttpRequestMessage request, - CancellationToken cancellationToken) - { - NumberOfCalls++; - if (request.Content != null) // Could be a GET-request without a body - { - Input = await request.Content.ReadAsStringAsync(); - } - return new HttpResponseMessage - { - StatusCode = _statusCode, - Content = new StringContent(_response) - }; - } -} \ No newline at end of file diff --git a/Adyen.Test/mocks/management/list-terminals.json b/Adyen.Test/mocks/management/list-terminals.json index 9f50ff321..3625f6f40 100644 --- a/Adyen.Test/mocks/management/list-terminals.json +++ b/Adyen.Test/mocks/management/list-terminals.json @@ -1,4 +1,20 @@ { + "_links": { + "first": { + "href": "https://management-test.adyen.com/v3/terminals?pageNumber=1&pageSize=20" + }, + "last": { + "href": "https://management-test.adyen.com/v3/terminals?pageNumber=1&pageSize=20" + }, + "next": { + "href": "https://management-test.adyen.com/v3/terminals?pageNumber=1&pageSize=20" + }, + "self": { + "href": "https://management-test.adyen.com/v3/terminals?pageNumber=0&pageSize=20" + } + }, + "itemsTotal": 1, + "pagesTotal": 1, "data": [ { "id": "S1F2-000150183300032", From 946b8e7d35342c026e245a4924bdc6dbc007d719 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 31 Oct 2025 14:10:46 +0100 Subject: [PATCH 088/126] Update TransferWebhooksTest.cs --- Adyen.Test/TransferWebhooks/TransferWebhooksTest.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Adyen.Test/TransferWebhooks/TransferWebhooksTest.cs b/Adyen.Test/TransferWebhooks/TransferWebhooksTest.cs index 4a2b7922d..42314fc9e 100644 --- a/Adyen.Test/TransferWebhooks/TransferWebhooksTest.cs +++ b/Adyen.Test/TransferWebhooks/TransferWebhooksTest.cs @@ -1,15 +1,10 @@ - -using System.Text.Json; -using Adyen.Transfers.Models; using Adyen.TransferWebhooks.Client; using Adyen.TransferWebhooks.Extensions; using Adyen.TransferWebhooks.Models; using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; -using PlatformPayment = Adyen.TransferWebhooks.Models.PlatformPayment; -using TransferData = Adyen.TransferWebhooks.Models.TransferData; -using TransferEvent = Adyen.TransferWebhooks.Models.TransferEvent; +using System.Text.Json; namespace Adyen.Test.TransferWebhooks { @@ -31,7 +26,7 @@ public TransferWebhooksTest() } [TestMethod] - public async Task Deserialize_Transfer_Webhook_Notification_Of_Chargeback_Returns_Not_Null() + public async Task Given_Deserialize_When_Transfer_Webhook_Notification_Of_Chargeback_Returns_Not_Null() { // Arrange string json = @" From a9fc23eaa1b90ec4741562fd8eb10dd7df61f48a Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 31 Oct 2025 14:29:58 +0100 Subject: [PATCH 089/126] Move DisputeTests --- Adyen.Test/Disputes/DisputesTest.cs | 106 ++++++++++++++++++ Adyen.Test/DisputesTest.cs | 64 ----------- ...cept-disputes.json => accept-dispute.json} | 0 ... retrieve-applicable-defense-reasons.json} | 0 4 files changed, 106 insertions(+), 64 deletions(-) create mode 100644 Adyen.Test/Disputes/DisputesTest.cs delete mode 100644 Adyen.Test/DisputesTest.cs rename Adyen.Test/mocks/disputes/{accept-disputes.json => accept-dispute.json} (100%) rename Adyen.Test/mocks/disputes/{retrieve-appicable-defense-reasons.json => retrieve-applicable-defense-reasons.json} (100%) diff --git a/Adyen.Test/Disputes/DisputesTest.cs b/Adyen.Test/Disputes/DisputesTest.cs new file mode 100644 index 000000000..cde9d032b --- /dev/null +++ b/Adyen.Test/Disputes/DisputesTest.cs @@ -0,0 +1,106 @@ +using System.Text.Json; +using Adyen.Core.Options; +using Adyen.Disputes.Client; +using Adyen.Disputes.Extensions; +using Adyen.Disputes.Models; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.Disputes +{ + [TestClass] + public class DisputesTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public DisputesTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureDisputes((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_Deserialize_AcceptDispute_Returns_Success() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/disputes/accept-dispute.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsTrue(response.DisputeServiceResult.Success); + } + + [TestMethod] + public void Given_Deserialize_DefendDispute_Returns_Success() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/disputes/defend-dispute.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsTrue(response.DisputeServiceResult.Success); + } + + [TestMethod] + public void Given_Deserialize_DeleteDefenseDocumentResponse_Returns_Success() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/disputes/delete-dispute.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsTrue(response.DisputeServiceResult.Success); + } + + [TestMethod] + public void Given_Deserialize_DefenseReasonsResponse_RetrieveApplicableDefenseReasons_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/disputes/retrieve-applicable-defense-reasons.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsTrue(response.DisputeServiceResult.Success); + Assert.IsTrue(response.DefenseReasons.Count!=0); + Assert.AreEqual(response.DefenseReasons[0].DefenseDocumentTypes[0].DefenseDocumentTypeCode, "TIDorInvoice"); + Assert.IsFalse(response.DefenseReasons[0].DefenseDocumentTypes[0].Available); + Assert.AreEqual(response.DefenseReasons[0].DefenseDocumentTypes[0].RequirementLevel, "Optional"); + Assert.AreEqual(response.DefenseReasons[0].DefenseDocumentTypes[1].DefenseDocumentTypeCode, "GoodsNotReturned"); + Assert.IsFalse(response.DefenseReasons[0].DefenseDocumentTypes[1].Available); + Assert.AreEqual(response.DefenseReasons[0].DefenseDocumentTypes[1].RequirementLevel, "Required"); + Assert.AreEqual(response.DefenseReasons[0].DefenseReasonCode, "GoodsNotReturned"); + Assert.IsFalse(response.DefenseReasons[0].Satisfied); + } + + [TestMethod] + public void SupplyDisputesDefenceDocumentSuccess() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/disputes/supply-dispute-defense-document.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsTrue(response.DisputeServiceResult.Success); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/DisputesTest.cs b/Adyen.Test/DisputesTest.cs deleted file mode 100644 index e7cf1594c..000000000 --- a/Adyen.Test/DisputesTest.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Adyen.Model.Disputes; -using Adyen.Service; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - [TestClass] - public class DisputesTest: BaseTest - { - [TestMethod] - public void AcceptDisputesSuccess() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/disputes/accept-disputes.json"); - var disputes = new DisputesService(client); - var response = disputes.AcceptDispute(new AcceptDisputeRequest()); - Assert.IsTrue(response.DisputeServiceResult.Success); - } - - [TestMethod] - public void DefendDisputesSuccess() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/disputes/defend-dispute.json"); - var disputes = new DisputesService(client); - var response = disputes.DefendDispute(new DefendDisputeRequest()); - Assert.IsTrue(response.DisputeServiceResult.Success); - } - - [TestMethod] - public void DeleteDisputesSuccess() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/disputes/delete-dispute.json"); - var disputes = new DisputesService(client); - var response = disputes.DeleteDisputeDefenseDocument(new DeleteDefenseDocumentRequest()); - Assert.IsTrue(response.DisputeServiceResult.Success); - } - - [TestMethod] - public void RetrieveApplicableDefenseReasonsSuccess() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/disputes/retrieve-appicable-defense-reasons.json"); - var disputes = new DisputesService(client); - var response = disputes.RetrieveApplicableDefenseReasons(new DefenseReasonsRequest()); - Assert.IsTrue(response.DisputeServiceResult.Success); - Assert.IsTrue(response.DefenseReasons.Count!=0); - Assert.AreEqual(response.DefenseReasons[0].DefenseDocumentTypes[0].DefenseDocumentTypeCode, "TIDorInvoice"); - Assert.IsFalse(response.DefenseReasons[0].DefenseDocumentTypes[0].Available); - Assert.AreEqual(response.DefenseReasons[0].DefenseDocumentTypes[0].RequirementLevel, "Optional"); - Assert.AreEqual(response.DefenseReasons[0].DefenseDocumentTypes[1].DefenseDocumentTypeCode, "GoodsNotReturned"); - Assert.IsFalse(response.DefenseReasons[0].DefenseDocumentTypes[1].Available); - Assert.AreEqual(response.DefenseReasons[0].DefenseDocumentTypes[1].RequirementLevel, "Required"); - Assert.AreEqual(response.DefenseReasons[0].DefenseReasonCode, "GoodsNotReturned"); - Assert.IsFalse(response.DefenseReasons[0].Satisfied); - } - - [TestMethod] - public void SupplyDisputesDefenceDocumentSuccess() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/disputes/supply-dispute-defense-document.json"); - var disputes = new DisputesService(client); - var response = disputes.SupplyDefenseDocument(new SupplyDefenseDocumentRequest()); - Assert.IsTrue(response.DisputeServiceResult.Success); - } - } -} \ No newline at end of file diff --git a/Adyen.Test/mocks/disputes/accept-disputes.json b/Adyen.Test/mocks/disputes/accept-dispute.json similarity index 100% rename from Adyen.Test/mocks/disputes/accept-disputes.json rename to Adyen.Test/mocks/disputes/accept-dispute.json diff --git a/Adyen.Test/mocks/disputes/retrieve-appicable-defense-reasons.json b/Adyen.Test/mocks/disputes/retrieve-applicable-defense-reasons.json similarity index 100% rename from Adyen.Test/mocks/disputes/retrieve-appicable-defense-reasons.json rename to Adyen.Test/mocks/disputes/retrieve-applicable-defense-reasons.json From 41e19eb83d1227e744c07051becfd84c5e90e213 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 31 Oct 2025 14:30:42 +0100 Subject: [PATCH 090/126] Add DisputeTests --- Adyen.Test/Disputes/DisputesTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Adyen.Test/Disputes/DisputesTest.cs b/Adyen.Test/Disputes/DisputesTest.cs index cde9d032b..dcf8e279a 100644 --- a/Adyen.Test/Disputes/DisputesTest.cs +++ b/Adyen.Test/Disputes/DisputesTest.cs @@ -69,7 +69,7 @@ public void Given_Deserialize_DeleteDefenseDocumentResponse_Returns_Success() } [TestMethod] - public void Given_Deserialize_DefenseReasonsResponse_RetrieveApplicableDefenseReasons_Returns_Not_Null() + public void Given_Deserialize_DefenseReasonsResponse_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/disputes/retrieve-applicable-defense-reasons.json"); @@ -91,7 +91,7 @@ public void Given_Deserialize_DefenseReasonsResponse_RetrieveApplicableDefenseRe } [TestMethod] - public void SupplyDisputesDefenceDocumentSuccess() + public void Given_Deserialize_SupplyDefenceDocumentResponse_Returns_Success() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/disputes/supply-dispute-defense-document.json"); From 1e95b2996b7d7f60bc6faf374f851cc1b33a4982 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 31 Oct 2025 17:07:18 +0100 Subject: [PATCH 091/126] Added transfer tests --- Adyen.Test/GrantsTest.cs | 22 --- Adyen.Test/Transfers/TransfersTest.cs | 87 ++++++++++++ Adyen.Test/TransfersTest.cs | 47 ------- .../mocks/transfers/get-all-transactions.json | 131 +++++++++++------- 4 files changed, 171 insertions(+), 116 deletions(-) delete mode 100644 Adyen.Test/GrantsTest.cs create mode 100644 Adyen.Test/Transfers/TransfersTest.cs delete mode 100644 Adyen.Test/TransfersTest.cs diff --git a/Adyen.Test/GrantsTest.cs b/Adyen.Test/GrantsTest.cs deleted file mode 100644 index 3728fcc48..000000000 --- a/Adyen.Test/GrantsTest.cs +++ /dev/null @@ -1,22 +0,0 @@ - -using Adyen.Model.Transfers; -using Adyen.Service.Transfers; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - public class GrantsTest : BaseTest - { - [TestMethod] - public void StoredValueIssueTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/grants/post-grants-success.json"); - var service = new CapitalService(client); - var response = service.RequestGrantPayout(new CapitalGrantInfo()); - Assert.AreEqual(response.Id, "CG00000000000000000000001"); - Assert.AreEqual(response.GrantAccountId, "CG00000000000000000000001"); - Assert.AreEqual(response.Status, CapitalGrant.StatusEnum.Pending); - Assert.IsNotNull(response.Balances); - } - } -} \ No newline at end of file diff --git a/Adyen.Test/Transfers/TransfersTest.cs b/Adyen.Test/Transfers/TransfersTest.cs new file mode 100644 index 000000000..841ef53f5 --- /dev/null +++ b/Adyen.Test/Transfers/TransfersTest.cs @@ -0,0 +1,87 @@ +using Adyen.Core.Options; +using Adyen.Transfers.Models; +using Adyen.Transfers.Client; +using Adyen.Transfers.Extensions; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Text.Json; + +namespace Adyen.Test.Transfers +{ + [TestClass] + public class TransfersTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public TransfersTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureTransfers((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public async Task Given_Deserialize_When_TransactionSearchResponse_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/transfers/get-all-transactions.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Links.Next.Href, "https://balanceplatform-api-test.adyen.com/btl/v4/transactions?balancePlatform=TestBalancePlatform&createdUntil=2023-08-20T13%3A07%3A40Z&createdSince=2023-08-10T10%3A50%3A40Z&cursor=S2B-c0p1N0tdN0l6RGhYK1YpM0lgOTUyMDlLXElyKE9LMCtyaFEuMj1NMHgidCsrJi1ZNnhqXCtqVi5JPGpRK1F2fCFqWzU33JTojSVNJc1J1VXhncS10QDd6JX9FQFl5Zn0uNyUvSXJNQTo"); + } + + [TestMethod] + public async Task Given_Deserialize_When_TransferTransaction_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/transfers/get-transaction.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Status, Transaction.StatusEnum.Booked); + Assert.AreEqual(response.Transfer.Id, "48TYZO5ZVURJ2FCW"); + } + + [TestMethod] + public async Task Given_Deserialize_When_Transfer_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/transfers/transfer-funds.json"); + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + Assert.AreEqual(response.Status, Transfer.StatusEnum.Authorised); + Assert.AreEqual(response.Category, Transfer.CategoryEnum.Bank); + } + + #region Grants + [TestMethod] + public async Task Given_Deserialize_When_CapitalGrant_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/grants/post-grants-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Id, "GR00000000000000000000001"); + Assert.AreEqual(response.GrantAccountId, "CG00000000000000000000001"); + Assert.AreEqual(response.Status, CapitalGrant.StatusEnum.Pending); + Assert.IsNotNull(response.Balances); + } + #endregion + } +} \ No newline at end of file diff --git a/Adyen.Test/TransfersTest.cs b/Adyen.Test/TransfersTest.cs deleted file mode 100644 index 8656af648..000000000 --- a/Adyen.Test/TransfersTest.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Net.Http; -using System.Threading; -using Adyen.Model; -using Adyen.Model.Transfers; -using Adyen.Service.Transfers; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NSubstitute; - -namespace Adyen.Test -{ - [TestClass] - public class TransfersTest : BaseTest - { - [TestMethod] - public void GetAllTransactionsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/transfers/get-all-transactions.json"); - var service = new TransactionsService(client); - var response = service.GetAllTransactions(new DateTime(), new DateTime(), balancePlatform:"balance", accountHolderId:"id"); - ClientInterfaceSubstitute.Received().RequestAsync( - "https://balanceplatform-api-test.adyen.com/btl/v4/transactions?balancePlatform=balance&accountHolderId=id&createdSince=0001-01-01T00%3a00%3a00Z&createdUntil=0001-01-01T00%3a00%3a00Z", - null, null, HttpMethod.Get, CancellationToken.None); - Assert.AreEqual(response.Links.Next.Href, "https://balanceplatform-api-test.adyen.com/btl/v2/transactions?balancePlatform=Bastronaut&createdUntil=2022-03-21T00%3A00%3A00Z&createdSince=2022-03-11T00%3A00%3A00Z&limit=3&cursor=S2B-TSAjOkIrYlIlbjdqe0RreHRyM32lKRSxubXBHRkhHL2E32XitQQz5SfzpucD5HbHwpM1p6NDR1eXVQLFF6MmY33J32sobDxQYT90MHIud1hwLnd6JitcX32xJ"); - } - - [TestMethod] - public void GetSpecificTransactionTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/transfers/get-transaction.json"); - var service = new TransactionsService(client); - var response = service.GetTransaction("id"); - Assert.AreEqual(response.Status, Transaction.StatusEnum.Booked); - Assert.AreEqual(response.Transfer.Id, "48TYZO5ZVURJ2FCW"); - } - - [TestMethod] - public void PostTransferFundsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/transfers/transfer-funds.json"); - var service = new TransfersService(client); - var response = service.TransferFunds(new TransferInfo()); - Assert.AreEqual(response.Status, Transfer.StatusEnum.Authorised); - Assert.AreEqual(response.Category, Transfer.CategoryEnum.Bank); - } - } -} \ No newline at end of file diff --git a/Adyen.Test/mocks/transfers/get-all-transactions.json b/Adyen.Test/mocks/transfers/get-all-transactions.json index b55e6c2e7..c253e2bed 100644 --- a/Adyen.Test/mocks/transfers/get-all-transactions.json +++ b/Adyen.Test/mocks/transfers/get-all-transactions.json @@ -1,72 +1,109 @@ { "data": [ { - "accountHolderId": "AHA1B2C3D4E5F6G7H8I9J0", + "balancePlatform": "YOUR_BALANCE_PLATFORM", + "creationDate": "2023-08-10T14:51:20+02:00", + "id": "EVJN42272224222B5JB8BRC84N686ZEUR", + "accountHolder": { + "description": "Your description for the account holder", + "id": "AH00000000000000000000001" + }, "amount": { - "currency": "EUR", - "value": -9 + "currency": "USD", + "value": -1000 }, - "balanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4", - "balancePlatform": "YOUR_BALANCE_PLATFORM", - "bookingDate": "2022-03-11T11:21:24+01:00", - "category": "internal", - "createdAt": "2022-03-11T11:21:24+01:00", - "id": "1VVF0D5U66PIUIVP", - "instructedAmount": { - "currency": "EUR", - "value": -9 - }, - "reference": "REFERENCE_46e8c40e", + "balanceAccount": { + "description": "Your description for the account holder", + "id": "BA00000000000000000000001" + }, + "bookingDate": "2023-08-10T14:51:33+02:00", + "eventId": "EVJN42272224222B5JB8BRC84N686Z", "status": "booked", - "transferId": "1VVF0D5U66PIUIVP", - "type": "fee", - "valueDate": "2022-03-11T11:21:24+01:00" + "transfer": { + "id": "3JNC3O5ZVFLLGV4B", + "reference": "Your internal reference for the transfer" + }, + "valueDate": "2023-08-10T14:51:20+02:00" }, { - "accountHolderId": "AHA1B2C3D4E5F6G7H8I9J0", + "balancePlatform": "YOUR_BALANCE_PLATFORM", + "creationDate": "2023-08-10T15:34:31+02:00", + "id": "EVJN4227C224222B5JB8G3Q89N2NB6EUR", + "accountHolder": { + "description": "Your description for the account holder", + "id": "AH00000000000000000000001" + }, "amount": { - "currency": "EUR", - "value": -46 + "currency": "USD", + "value": 123 }, - "balanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4", - "balancePlatform": "YOUR_BALANCE_PLATFORM", - "bookingDate": "2022-03-12T14:22:52+01:00", - "category": "internal", - "createdAt": "2022-03-12T14:22:52+01:00", - "id": "1WEPGD5U6MS1CFK3", - "instructedAmount": { - "currency": "EUR", - "value": -46 - }, - "reference": "YOUR_REFERENCE", + "balanceAccount": { + "description": "Your description for the account holder", + "id": "BA00000000000000000000001" + }, + "bookingDate": "2023-08-10T15:34:40+02:00", + "eventId": "EVJN4227C224222B5JB8G3Q89N2NB6", "status": "booked", - "transferId": "1WEPGD5U6MS1CFK3", - "type": "fee", - "valueDate": "2022-03-12T14:22:52+01:00" + "transfer": { + "id": "48POO45ZVG11166J", + "reference": "Your internal reference for the transfer" + }, + "valueDate": "2023-08-10T15:34:31+02:00" }, { - "accountHolderId": "AHA1B2C3D4E5F6G7H8I9J0", + "balancePlatform": "YOUR_BALANCE_PLATFORM", + "creationDate": "2023-08-11T13:45:46+02:00", + "id": "EVJN4227C224222B5JBD3XHF8P3L8GUSD", + "accountHolder": { + "description": "Your description for the account holder", + "id": "AH00000000000000000000001" + }, "amount": { - "currency": "EUR", - "value": -8 + "currency": "USD", + "value": -10000 + }, + "balanceAccount": { + "description": "Your description for the account holder", + "id": "BA00000000000000000000001" }, - "balanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4", + "bookingDate": "2023-08-11T13:45:57+02:00", + "eventId": "EVJN4227C224222B5JBD3XHF8P3L8G", + "status": "booked", + "transfer": { + "id": "48RTTW5ZVT8KU9DV", + "reference": "my-reference" + }, + "valueDate": "2023-08-11T13:45:46+02:00" + }, + { "balancePlatform": "YOUR_BALANCE_PLATFORM", - "bookingDate": "2022-03-14T21:00:48+01:00", - "createdAt": "2022-03-14T15:00:00+01:00", - "description": "YOUR_DESCRIPTION_2", - "id": "2QP32A5U7IWC5WKG", - "instructedAmount": { - "currency": "EUR", - "value": -8 + "creationDate": "2023-08-11T13:45:51+02:00", + "id": "EVJN42272224222B5JBD3XJGHF4J26USD", + "accountHolder": { + "description": "Your description for the account holder", + "id": "AH00000000000000000000001" + }, + "amount": { + "currency": "USD", + "value": 1000 }, + "balanceAccount": { + "description": "Your description for the account holder", + "id": "BA00000000000000000000001" + }, + "bookingDate": "2023-08-11T13:45:58+02:00", + "eventId": "EVJN42272224222B5JBD3XJGHF4J26", "status": "booked", - "valueDate": "2022-03-14T21:00:48+01:00" + "transfer": { + "id": "48TYZO5ZVT8M1K47", + "reference": "my-reference" + }, + "valueDate": "2023-08-11T13:45:51+02:00" } ], "_links": { "next": { - "href": "https://balanceplatform-api-test.adyen.com/btl/v2/transactions?balancePlatform=Bastronaut&createdUntil=2022-03-21T00%3A00%3A00Z&createdSince=2022-03-11T00%3A00%3A00Z&limit=3&cursor=S2B-TSAjOkIrYlIlbjdqe0RreHRyM32lKRSxubXBHRkhHL2E32XitQQz5SfzpucD5HbHwpM1p6NDR1eXVQLFF6MmY33J32sobDxQYT90MHIud1hwLnd6JitcX32xJ" + "href": "https://balanceplatform-api-test.adyen.com/btl/v4/transactions?balancePlatform=TestBalancePlatform&createdUntil=2023-08-20T13%3A07%3A40Z&createdSince=2023-08-10T10%3A50%3A40Z&cursor=S2B-c0p1N0tdN0l6RGhYK1YpM0lgOTUyMDlLXElyKE9LMCtyaFEuMj1NMHgidCsrJi1ZNnhqXCtqVi5JPGpRK1F2fCFqWzU33JTojSVNJc1J1VXhncS10QDd6JX9FQFl5Zn0uNyUvSXJNQTo" } } } \ No newline at end of file From a9beefabfe38d92a51f5c27207e859512b607401 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 31 Oct 2025 21:08:14 +0100 Subject: [PATCH 092/126] Added PosMobileTests --- Adyen.Test/PosMobile/PosMobileTest.cs | 45 +++++++++++++++ Adyen.Test/PosMobileTest.cs | 28 --------- Adyen.Test/Transfers/TransfersTest.cs | 6 ++ .../libraries/generichost/api_test.mustache | 57 ++++++++++++------- 4 files changed, 87 insertions(+), 49 deletions(-) create mode 100644 Adyen.Test/PosMobile/PosMobileTest.cs delete mode 100644 Adyen.Test/PosMobileTest.cs diff --git a/Adyen.Test/PosMobile/PosMobileTest.cs b/Adyen.Test/PosMobile/PosMobileTest.cs new file mode 100644 index 000000000..a47c88fac --- /dev/null +++ b/Adyen.Test/PosMobile/PosMobileTest.cs @@ -0,0 +1,45 @@ +using Adyen.Core.Options; +using Adyen.PosMobile.Models; +using Adyen.PosMobile.Client; +using Adyen.PosMobile.Extensions; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Text.Json; + +namespace Adyen.Test.PosMobile +{ + [TestClass] + public class PosMobileTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public PosMobileTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigurePosMobile((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public async Task Given_Deserialize_When_CreateSessionResponse_Returns_Correct_Id() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/posmobile/create-session.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Id, "CS451F2AB1ED897A94"); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/PosMobileTest.cs b/Adyen.Test/PosMobileTest.cs deleted file mode 100644 index fb038a8e8..000000000 --- a/Adyen.Test/PosMobileTest.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Net.Http; -using Adyen.Model.PosMobile; -using Adyen.Service; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NSubstitute; -using Environment = Adyen.Model.Environment; - -namespace Adyen.Test -{ - [TestClass] - public class PosMobileTest : BaseTest - { - [TestMethod] - public void TestPosMobileCreateSession() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/posmobile/create-session.json"); - client.Config.Environment = Environment.Live; - client.Config.LiveEndpointUrlPrefix = "prefix"; - var service = new PosMobileService(client); - var response = service.CreateCommunicationSession(new CreateSessionRequest()); - Assert.AreEqual(response.Id, "CS451F2AB1ED897A94"); - ClientInterfaceSubstitute.Received().RequestAsync( - "https://prefix-checkout-live.adyenpayments.com/checkout/possdk/v68/sessions", - Arg.Any(), null, new HttpMethod("POST"), default); - } - } -} \ No newline at end of file diff --git a/Adyen.Test/Transfers/TransfersTest.cs b/Adyen.Test/Transfers/TransfersTest.cs index 841ef53f5..a3f6e51d9 100644 --- a/Adyen.Test/Transfers/TransfersTest.cs +++ b/Adyen.Test/Transfers/TransfersTest.cs @@ -61,12 +61,17 @@ public async Task Given_Deserialize_When_Transfer_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/transfers/transfer-funds.json"); + + // Act var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert Assert.AreEqual(response.Status, Transfer.StatusEnum.Authorised); Assert.AreEqual(response.Category, Transfer.CategoryEnum.Bank); } #region Grants + [TestMethod] public async Task Given_Deserialize_When_CapitalGrant_Returns_Not_Null() { @@ -82,6 +87,7 @@ public async Task Given_Deserialize_When_CapitalGrant_Returns_Not_Null() Assert.AreEqual(response.Status, CapitalGrant.StatusEnum.Pending); Assert.IsNotNull(response.Balances); } + #endregion } } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/api_test.mustache b/templates-v7/csharp/libraries/generichost/api_test.mustache index 32eb2b769..d54244957 100644 --- a/templates-v7/csharp/libraries/generichost/api_test.mustache +++ b/templates-v7/csharp/libraries/generichost/api_test.mustache @@ -1,51 +1,66 @@ {{>partial_header}} -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Xunit; -using Microsoft.Extensions.DependencyInjection; -using {{packageName}}.{{apiPackage}};{{#hasImport}} +using {{packageName}}.Core.Options;{{#hasImport}} using {{packageName}}.{{modelPackage}};{{/hasImport}} - +using {{packageName}}.{{apiName}}.{{clientPackageName}}; +using {{packageName}}.{{apiName}}.Extensions; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Text.Json; {{>testInstructions}} - namespace {{packageName}}.Test.{{apiPackage}} { /// /// Class for testing {{classname}} /// - public sealed class {{classname}}Tests : ApiTestsBase + [TestClass] + public sealed class {{classname}}Test { - private readonly {{interfacePrefix}}{{classname}} _instance; + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; - public {{classname}}Tests(): base(Array.Empty()) + public {{classname}}Test() { - _instance = _host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + IHost host = Host.CreateDefaultBuilder() + .Configure{{classname}}((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); } {{#operations}} {{#operation}} /// - /// Test {{operationId}} + /// Test {{operationId}}. /// - [Fact (Skip = "not implemented")] - public async Task {{operationId}}AsyncTest() + public async Task Given_Deserialize_When_{{operationId}}_Successfully_Deserializes() { + // Arrange + // TODO: Insert your example code from open-api here + var client = TestUtilities.GetTestFileContent("mocks/posmobile/create-session.json"); + {{#allParams}} {{^required}}Client.Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} = default{{nrt!}}; {{/allParams}} {{#responses}} {{#-first}} {{#dataType}} - var response = await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - var model = response.{{vendorExtensions.x-http-status}}(); - Assert.IsType<{{{.}}}>(model); - {{/dataType}} - {{^dataType}} - await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + + // Act + // TODO: Prefill the ResponseType + // IDEALLY: We insert the SERVICE and then we call it using the right parameters (this gets tricky with query params* but very doable!) + var response = JsonSerializer.Deserialize<{{name}}Response}>(json, _jsonSerializerOptionsProvider); + + // Assert + Assert.IsNotNull(response); {{/dataType}} {{/-first}} {{/responses}} From d9148104c17c73a867566cbbc18dff02f2e4f5f8 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 31 Oct 2025 21:09:15 +0100 Subject: [PATCH 093/126] Use logger override in constructor, only if none is provided, we create a default one using the ILoggerFactory --- templates-v7/csharp/libraries/generichost/api.mustache | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 53c41c84d..40a259290 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -199,7 +199,6 @@ namespace {{packageName}}.{{apiPackage}} /// /// Initializes a new instance of the class. /// - /// public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, System.Net.Http.HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, ITokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, ITokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpSignatureMethods}}, @@ -209,7 +208,7 @@ namespace {{packageName}}.{{apiPackage}} { _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; LoggerFactory = loggerFactory; - Logger = LoggerFactory.CreateLogger<{{classname}}>(); + Logger = logger == null ? LoggerFactory.CreateLogger<{{classname}}>() : logger; HttpClient = httpClient; Events = {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}};{{#hasApiKeyMethods}} ApiKeyProvider = apiKeyProvider;{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} From c13e2c017f7db20f72da2f13d8a8acaf1ce051a7 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 31 Oct 2025 22:38:42 +0100 Subject: [PATCH 094/126] Moved extensions tests to respective /service endpoints --- .../BalanceControl/BalanceControlTest.cs | 36 +- .../AccountHolders/AccountHolderTest.cs | 24 +- .../BalancePlatform/BalancePlatformTest.cs | 4 +- Adyen.Test/Checkout/PaymentsServiceTest.cs | 66 +++- Adyen.Test/ExtensionsTest.cs | 70 ---- Adyen.Test/{ => Recurring}/RecurringTest.cs | 308 ++++++++++-------- 6 files changed, 276 insertions(+), 232 deletions(-) delete mode 100644 Adyen.Test/ExtensionsTest.cs rename Adyen.Test/{ => Recurring}/RecurringTest.cs (86%) diff --git a/Adyen.Test/BalanceControl/BalanceControlTest.cs b/Adyen.Test/BalanceControl/BalanceControlTest.cs index 65b3bf4db..dde1fe5ed 100644 --- a/Adyen.Test/BalanceControl/BalanceControlTest.cs +++ b/Adyen.Test/BalanceControl/BalanceControlTest.cs @@ -1,37 +1,33 @@ -using System; -using System.Text.Json; -using System.Text.Json.Serialization; using Adyen.BalanceControl.Client; using Adyen.BalanceControl.Extensions; using Adyen.BalanceControl.Models; using Adyen.BalanceControl.Services; -using Adyen.Core.Auth; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Text.Json; namespace Adyen.Test.BalanceControl { [TestClass] public class BalanceControlTest { - private readonly IBalanceControlService _balanceControlService; private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; public BalanceControlTest() - { IHost host = Host.CreateDefaultBuilder() + { + IHost host = Host.CreateDefaultBuilder() .ConfigureBalanceControl((context, services, config) => { config.ConfigureAdyenOptions(options => { - options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; options.Environment = AdyenEnvironment.Test; }); }) .Build(); - _balanceControlService = host.Services.GetRequiredService(); + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); } @@ -48,5 +44,29 @@ public async Task DeserializeBalanceControlTest() Assert.AreEqual(response.CreatedAt, new DateTime(2022,01, 24)); Assert.AreEqual(response.Status, BalanceTransferResponse.StatusEnum.Transferred); } + + [TestMethod] + public void Given_IBalanceControlService_When_Live_Url_And_Prefix_Are_Set_Returns_Correct_Live_Url_Endpoint() + { + // Arrange + IHost liveHost = Host.CreateDefaultBuilder() + .ConfigureBalanceControl((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = "your-live-api-key"; + options.Environment = AdyenEnvironment.Live; + options.LiveEndpointUrlPrefix = "prefix"; + }); + }) + .Build(); + + // Act + var balanceControlService = liveHost.Services.GetRequiredService(); + + // Assert + Assert.AreEqual("https://prefix-pal-live.adyenpayments.com/pal/servlet/BalanceControl/v1", balanceControlService.HttpClient.BaseAddress.ToString()); + } + } } \ No newline at end of file diff --git a/Adyen.Test/BalancePlatform/AccountHolders/AccountHolderTest.cs b/Adyen.Test/BalancePlatform/AccountHolders/AccountHolderTest.cs index 3631ced4e..3e31dd17f 100644 --- a/Adyen.Test/BalancePlatform/AccountHolders/AccountHolderTest.cs +++ b/Adyen.Test/BalancePlatform/AccountHolders/AccountHolderTest.cs @@ -7,7 +7,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.VisualStudio.TestTools.UnitTesting; -using NSubstitute; namespace Adyen.Test.BalancePlatform.AccountHolders { @@ -74,5 +73,28 @@ public async Task Given_PaginatedBalanceAccountsResponse_Deserialize_Correctly() Assert.AreEqual(response.AccountHolders[0].Id, "AH32272223222B5GFSNSXFFL9"); Assert.AreEqual(response.AccountHolders[0].Status, AccountHolder.StatusEnum.Active); } + + [TestMethod] + public async Task Given_IAccountHolderService_When_Live_Url_And_Prefix_Are_Set_Returns_Correct_Live_Url_Endpoint_And_No_Prefix() + { + // Arrange + IHost liveHost = Host.CreateDefaultBuilder() + .ConfigureBalancePlatform((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = "your-live-api-key"; + options.Environment = AdyenEnvironment.Live; + options.LiveEndpointUrlPrefix = "prefix"; + }); + }) + .Build(); + + // Act + var accountHoldersService = liveHost.Services.GetRequiredService(); + + // Assert + Assert.AreEqual("https://balanceplatform-api-live.adyen.com/bcl/v2", accountHoldersService.HttpClient.BaseAddress.ToString()); + } } } \ No newline at end of file diff --git a/Adyen.Test/BalancePlatform/BalancePlatformTest.cs b/Adyen.Test/BalancePlatform/BalancePlatformTest.cs index 491bca82c..e3056971a 100644 --- a/Adyen.Test/BalancePlatform/BalancePlatformTest.cs +++ b/Adyen.Test/BalancePlatform/BalancePlatformTest.cs @@ -31,7 +31,7 @@ public BalancePlatformTest() } [TestMethod] - public void Given_BalancePlatform_Deserialize_Correctly() + public async Task Given_BalancePlatform_Deserialize_Correctly() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/BalancePlatform.json"); @@ -45,7 +45,7 @@ public void Given_BalancePlatform_Deserialize_Correctly() } [TestMethod] - public void Given_PaginatedAccountHoldersResponse_Deserialize_Correctly() + public async Task Given_PaginatedAccountHoldersResponse_Deserialize_Correctly() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/PaginatedBalanceAccountsResponse.json"); diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index a0079fd4a..f36e05a8e 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -1,3 +1,4 @@ +using Adyen.Core.Options; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; @@ -5,7 +6,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; -using Adyen.Core.Options; using System.Text; using System.Text.Json; @@ -14,12 +14,11 @@ namespace Adyen.Test.Checkout [TestClass] public class PaymentsServiceTest { - private readonly IHost _hostTestEnv; private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; public PaymentsServiceTest() { - _hostTestEnv = Host.CreateDefaultBuilder() + IHost testHost = Host.CreateDefaultBuilder() .ConfigureCheckout((context, services, config) => { config.ConfigureAdyenOptions(options => @@ -29,7 +28,7 @@ public PaymentsServiceTest() }) .Build(); - _jsonSerializerOptionsProvider = _hostTestEnv.Services.GetRequiredService(); + _jsonSerializerOptionsProvider = testHost.Services.GetRequiredService(); } [TestMethod] @@ -47,7 +46,7 @@ public async Task Given_PaymentMethodsResponse_When_Deserialized_Then_Result_Is_ } [TestMethod] - public void Given_CreateCheckoutSessionRequest_When_Serialize_Long__Result_Contains_Zeros() + public async Task Given_CreateCheckoutSessionRequest_When_Serialize_Long__Result_Contains_Zeros() { // Arrange CreateCheckoutSessionRequest checkoutSessionRequest = new CreateCheckoutSessionRequest( @@ -78,7 +77,7 @@ public void Given_CreateCheckoutSessionRequest_When_Serialize_Long__Result_Conta } [TestMethod] - public void Given_CreateCheckoutSessionResponse_When_Deserialize_Returns_Not_Null() + public async Task Given_CreateCheckoutSessionResponse_When_Deserialize_Returns_Not_Null() { // Arrange string json = @"{""mode"": ""embedded"",""amount"": {""currency"": ""EUR"",""value"": 10000},""expiresAt"": ""2023-04-06T17:11:15+02:00"",""id"": ""CS0068299CB8DA273A"",""merchantAccount"": ""TestMerchantAccount"",""reference"": ""TestReference"",""returnUrl"": ""http://test-url.com"",""sessionData"": ""Ab02b4c0!BQABAgBoacRJuRbNM/typUKATopkZ3V+cINm0WTAvwl9uQJ2e8I00P2KFemlwp4nb1bOqqYh1zx48gDAHt0QDs2JTiQIqDQRizqopLFRk/wAJHFoCuam/GvOHflg9vwS3caHbkBToIolxcYcJoJheIN9o1fGmNIHZb9VrWfiKsXMgmYsSUifenayS2tkKCTquF7vguaAwk7q5ES1GDwzP/J2mChJGH04jGrVL4szPHGmznr897wIcFQyBSZe4Uifqoe0fpiIxZLNWadLMya6SnvQYNAQL1V6ti+7F4wHHyLwHWTCua993sttue70TE4918EV80HcAWx0LE1+uW6J5KBHCKdYNi9ESlGSZreRwLCpdNbmumB6MlyHZlz2umLiw0ZZJAEpdrwXA2NiyHzJDKDKfbAhd8uoTSACrbgwbrAXI1cvb1WjiOQjLn9MVW++fuJCq6vIeX+rUKMeltBAHMeBZyC54ndAucw9nS03uyckjphunE4tl4WTT475VkfUiyJCTT3S2IOVYS9V9M8pMQ1/GlDVNCLBJJfrYlVXoC8VX68QW1HERkhNYQbTgLQ9kI3cDeMP5d4TuUL3XR2Q6sNiOMdIPGDYQ9QFKFdOE3OQ5X9wxUYbX6j88wR2gRGJcS5agqFHOR1ZTNrjumOYrEkjL8ehFXEs/KluhURllfi0POUPGAwlUWBjDCZcKaeeR0kASnsia2V5IjoiQUYwQUFBMTAzQ0E1MzdFQUVEODdDMjRERDUzOTA5QjgwQTc4QTkyM0UzODIzRDY4REFDQzk0QjlGRjgzMDVEQyJ9E0Gs1T0RaO7NluuXP59fegcW6SQKq4BhC3ZzEKPm1vJuwAJ2gZUaicaXbRPW3IyadavKRlfGdFeAYt2B3ik8fGiK3ZkKU0CrZ0qL0IO5rrWrOg74HMnpxRAn1RhAHRHfGEk67FFPNjr0aLBJXSia7xZWiyKA+i4QU63roY2sxMI/q41mvJjRUz0rPKT3SbVDt1Of7K7BP8cmiboBkWexFBD/mkJyMOpYAOoFp/tKOUHTWZYcc1GpbyV1jInXVfEUhHROYCtS4p/xwF6DdT3bI0+HRU35/xNBTZH2yJN55u9i42Vb0ddCyhzOLZYQ3JVgglty6hLgVeQzuN4b2MoalhfTl11HsElJT1kB0mznVX8CL7UMTUp/2uSgL8DN6kB4owEZ45nWRxIR/2sCidMJ1tnSI1uSqkeqXRf1vat5qPq+BzpYE0Urn2ZZEmgJyb2u0ZLn2x1tfJyPtv+hqBoT7iqJ224dSbuB4HMT49YtcheUtR0jnrImJXm+M1TeIjWB3XWOScrNV8sWEJMAiIU="",""shopperLocale"": ""en-US""}"; @@ -90,9 +89,37 @@ public void Given_CreateCheckoutSessionResponse_When_Deserialize_Returns_Not_Nul Assert.IsNotNull(response.Id); } + [TestMethod] + public void Given_Serialize_When_DeviceRenderOptions_Returns_MultiSelect_And_OtherHtml() + { + // Arrange + DeviceRenderOptions deviceRenderOptions = new DeviceRenderOptions + { + SdkInterface = DeviceRenderOptions.SdkInterfaceEnum.Native, + SdkUiType = new List() + { + DeviceRenderOptions.SdkUiTypeEnum.MultiSelect, + DeviceRenderOptions.SdkUiTypeEnum.OtherHtml + } + }; + + // Act + string result = JsonSerializer.Serialize(deviceRenderOptions, _jsonSerializerOptionsProvider.Options); + + // Assert + using JsonDocument json = JsonDocument.Parse(result); + JsonElement root = json.RootElement; + + JsonElement sdkInterface = root.GetProperty("sdkInterface"); + Assert.AreEqual("native", sdkInterface.GetString()); + + JsonElement sdkUiTypes = root.GetProperty("sdkUiType"); + Assert.AreEqual("multiSelect", sdkUiTypes[0].GetString()); + Assert.AreEqual("otherHtml", sdkUiTypes[1].GetString()); + } [TestMethod] - public void Given_Byte_Array_When_Serialize_Returns_Not_Null() + public async Task Given_Byte_Array_When_Serialize_Returns_Not_Null() { // Arrange byte[] plainTextBytes = Encoding.ASCII.GetBytes("Bytes-To-Be-Encoded"); @@ -113,7 +140,7 @@ public void Given_Byte_Array_When_Serialize_Returns_Not_Null() } [TestMethod] - public void Given_Byte_Array_When_Deserialize_Result_ThreeDSecureData_Should_Deserialize_Correctly() + public async Task Given_Byte_Array_When_Deserialize_Result_ThreeDSecureData_Should_Deserialize_Correctly() { // Arrange string json = "{\"cavv\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\",\"xid\":\"Qnl0ZXMtVG8tQmUtRW5jb2RlZA==\"}"; @@ -148,5 +175,28 @@ public async Task Given_Empty_ConfigureCheckout_When_No_AdyenOptions_Provided_Th testHost.Services.GetRequiredService(); }); } + + [TestMethod] + public async Task Given_IPaymentsService_When_Live_Url_And_Prefix_Are_Set_Returns_Correct_Live_Url_Endpoint_And_No_Prefix() + { + // Arrange + IHost liveHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = "your-live-api-key"; + options.Environment = AdyenEnvironment.Live; + options.LiveEndpointUrlPrefix = "prefix"; + }); + }) + .Build(); + + // Act + var paymentsService = liveHost.Services.GetRequiredService(); + + // Assert + Assert.AreEqual("https://prefix-checkout-live.adyenpayments.com/checkout/v71", paymentsService.HttpClient.BaseAddress.ToString()); + } } } \ No newline at end of file diff --git a/Adyen.Test/ExtensionsTest.cs b/Adyen.Test/ExtensionsTest.cs deleted file mode 100644 index defc01802..000000000 --- a/Adyen.Test/ExtensionsTest.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.Collections.Generic; -using System.Net.Http; -using Adyen.Model.BalanceControl; -using Adyen.Model.Checkout; -using Adyen.Service; -using Adyen.Service.BalancePlatform; -using Adyen.Service.Checkout; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NSubstitute; -using Environment = Adyen.Model.Environment; - -namespace Adyen.Test -{ - [TestClass] - public class ExtensionsTest : BaseTest - { - private Client _client; - - [TestInitialize] - public void Init() - { - _client = CreateMockTestClientApiKeyBasedRequestAsync(""); - _client.Config.Environment = Environment.Live; - _client.Config.LiveEndpointUrlPrefix = "prefix"; - } - - [TestMethod] - public void TestDeviceRenderOptionsObjectListToString() - { - var deviceRenderOptions = new DeviceRenderOptions - { - SdkInterface = DeviceRenderOptions.SdkInterfaceEnum.Native, - SdkUiType = new List - { DeviceRenderOptions.SdkUiTypeEnum.MultiSelect, DeviceRenderOptions.SdkUiTypeEnum.OtherHtml } - }; - var expected = "\"multiSelect\""; - Assert.IsTrue(deviceRenderOptions.ToJson().Contains(expected)); - } - - [TestMethod] - public void TestPalLiveEndPoint() - { - var service = new BalanceControlService(_client); - service.BalanceTransfer(new BalanceTransferRequest()); - ClientInterfaceSubstitute.Received().RequestAsync( - "https://prefix-pal-live.adyenpayments.com/pal/servlet/BalanceControl/v1/balanceTransfer", - "{}", null, HttpMethod.Post, default); - } - - [TestMethod] - public void TestCheckoutLiveEndPoint() - { - var service = new DonationsService(_client); - service.Donations(new DonationPaymentRequest()); - ClientInterfaceSubstitute.Received().RequestAsync( - "https://prefix-checkout-live.adyenpayments.com/checkout/v71/donations", - Arg.Any(), null, HttpMethod.Post, default); - } - - [TestMethod] - public void TestBclLiveEndPoint() - { - var service = new AccountHoldersService(_client); - service.GetAllBalanceAccountsOfAccountHolder("id", offset: 3, limit: 5); - ClientInterfaceSubstitute.Received().RequestAsync( - "https://balanceplatform-api-live.adyen.com/bcl/v2/accountHolders/id/balanceAccounts?offset=3&limit=5", - null, null, HttpMethod.Get, default); - } - } -} diff --git a/Adyen.Test/RecurringTest.cs b/Adyen.Test/Recurring/RecurringTest.cs similarity index 86% rename from Adyen.Test/RecurringTest.cs rename to Adyen.Test/Recurring/RecurringTest.cs index acdd8e621..41177a53f 100644 --- a/Adyen.Test/RecurringTest.cs +++ b/Adyen.Test/Recurring/RecurringTest.cs @@ -1,143 +1,165 @@ -using System.Threading.Tasks; -using Adyen.Model.Recurring; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - [TestClass] - public class RecurringTest : BaseTest - { - - [TestMethod] - public void TestListRecurringDetails() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/listRecurringDetails-success.json"); - var recurring = new Service.RecurringService(client); - var recurringDetailsRequest = CreateRecurringDetailsRequest(); - var recurringDetailsResult = recurring.ListRecurringDetails(recurringDetailsRequest); - Assert.AreEqual(3L, recurringDetailsResult.Details.Count); - var recurringDetail = recurringDetailsResult.Details[0].RecurringDetail; - - Assert.AreEqual("BFXCHLC5L6KXWD82", recurringDetail.RecurringDetailReference); - Assert.AreEqual("K652534298119846", recurringDetail.Alias); - Assert.AreEqual("0002", recurringDetail.Card.Number); - } - - [TestMethod] - public async Task TestListRecurringDetailsAsync() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/listRecurringDetails-success.json"); - var recurring = new Service.RecurringService(client); - var recurringDetailsRequest = CreateRecurringDetailsRequest(); - var recurringDetailsResult = await recurring.ListRecurringDetailsAsync(recurringDetailsRequest); - Assert.AreEqual(3L, recurringDetailsResult.Details.Count); - var recurringDetail = recurringDetailsResult.Details[1].RecurringDetail; - Assert.AreEqual("JW6RTP5PL6KXWD82", recurringDetail.RecurringDetailReference); - Assert.AreEqual("Wirecard", recurringDetail.Bank.BankName); - Assert.AreEqual("sepadirectdebit", recurringDetail.Variant); - } - - [TestMethod] - public void TestDisable() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/disable-success.json"); - var recurring = new Service.RecurringService(client); - var disableRequest = CreateDisableRequest(); - var disableResult = recurring.Disable(disableRequest); - Assert.AreEqual("[detail-successfully-disabled]", disableResult.Response); - } - - [TestMethod] - public async Task TestDisableAsync() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/disable-success.json"); - var recurring = new Service.RecurringService(client); - var disableRequest = CreateDisableRequest(); - var disableResult = await recurring.DisableAsync(disableRequest); - Assert.AreEqual("[detail-successfully-disabled]", disableResult.Response); - } - - [TestMethod] - public void NotifyShopperTest() - { - Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/notifyShopper-success.json"); - var recurring = new Service.RecurringService(client); - NotifyShopperRequest request = CreateNotifyShopperRequest(); - NotifyShopperResult result = recurring.NotifyShopper(request); - Assert.IsNotNull(result); - Assert.AreEqual("Example displayed reference", result.DisplayedReference); - Assert.AreEqual("8516167336214570", result.PspReference); - Assert.AreEqual("Request processed successfully", result.Message); - Assert.AreEqual("Example reference", result.Reference); - Assert.AreEqual("Success", result.ResultCode); - Assert.AreEqual("IA0F7500002462", result.ShopperNotificationReference); - } - - [TestMethod] - public void CreatePermitTest() - { - Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/createPermit-success.json"); - var recurring = new Service.RecurringService(client); - var createPermitResult = recurring.CreatePermit(new CreatePermitRequest()); - Assert.IsNotNull(createPermitResult); - Assert.AreEqual("string", createPermitResult.PspReference); - Assert.AreEqual(1,createPermitResult.PermitResultList.Count); - } - - [TestMethod] - public void DisablePermitTest() - { - Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/disablePermit-success.json"); - var recurring = new Service.RecurringService(client); - var disablePermitResult = recurring.DisablePermit(new DisablePermitRequest()); - Assert.IsNotNull(disablePermitResult); - Assert.AreEqual("string", disablePermitResult.PspReference); - Assert.AreEqual("disabled",disablePermitResult.Status); - } - - [TestMethod] - public void ScheduleAccountUpdaterTest() - { - Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/scheduleAccountUpdater-success.json"); - var recurring = new Service.RecurringService(client); - var scheduleAccountUpdaterResult = recurring.ScheduleAccountUpdater(new ScheduleAccountUpdaterRequest()); - Assert.IsNotNull(scheduleAccountUpdaterResult); - Assert.AreEqual("string", scheduleAccountUpdaterResult.PspReference); - Assert.AreEqual("string",scheduleAccountUpdaterResult.Result); - } - - private RecurringDetailsRequest CreateRecurringDetailsRequest() - { - var request = new RecurringDetailsRequest - { - ShopperReference = "test-123", - MerchantAccount = "DotNetAlexandros", - Recurring = new Model.Recurring.Recurring(Model.Recurring.Recurring.ContractEnum.RECURRING) - }; - return request; - } - - private DisableRequest CreateDisableRequest() - { - var request = new DisableRequest - { - ShopperReference = "test-123", - MerchantAccount = "DotNetAlexandros" - }; - return request; - } - - private NotifyShopperRequest CreateNotifyShopperRequest() - { - return new NotifyShopperRequest - { - MerchantAccount = "TestMerchant", - RecurringDetailReference = "8316158654144897", - Reference = "Example reference", - ShopperReference = "1234567", - BillingDate = "2021-03-31", - DisplayedReference = "Example displayed reference" - }; - } - } -} +using Adyen.Core.Options; +using Adyen.Recurring.Client; +using Adyen.Recurring.Models; +using Adyen.Recurring.Extensions; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Text.Json; + +namespace Adyen.Test.Recurring +{ + [TestClass] + public class RecurringTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public RecurringTest() + { // TODO + IHost host = Host.CreateDefaultBuilder() + .ConfigureRecurring((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public void TestListRecurringDetails() + { + // Arrange + var json = TestUtilities.GetTestFileContent("mocks/recurring/listRecurringDetails-success.json"); + var recurring = new Service.RecurringService(client); + var recurringDetailsRequest = CreateRecurringDetailsRequest(); + var recurringDetailsResult = recurring.ListRecurringDetails(recurringDetailsRequest); + Assert.AreEqual(3L, recurringDetailsResult.Details.Count); + var recurringDetail = recurringDetailsResult.Details[0].RecurringDetail; + + Assert.AreEqual("BFXCHLC5L6KXWD82", recurringDetail.RecurringDetailReference); + Assert.AreEqual("K652534298119846", recurringDetail.Alias); + Assert.AreEqual("0002", recurringDetail.Card.Number); + } + + [TestMethod] + public async Task TestListRecurringDetailsAsync() + { + var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/listRecurringDetails-success.json"); + var recurring = new Service.RecurringService(client); + var recurringDetailsRequest = CreateRecurringDetailsRequest(); + var recurringDetailsResult = await recurring.ListRecurringDetailsAsync(recurringDetailsRequest); + Assert.AreEqual(3L, recurringDetailsResult.Details.Count); + var recurringDetail = recurringDetailsResult.Details[1].RecurringDetail; + Assert.AreEqual("JW6RTP5PL6KXWD82", recurringDetail.RecurringDetailReference); + Assert.AreEqual("Wirecard", recurringDetail.Bank.BankName); + Assert.AreEqual("sepadirectdebit", recurringDetail.Variant); + } + + [TestMethod] + public void TestDisable() + { + var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/disable-success.json"); + var recurring = new Service.RecurringService(client); + var disableRequest = CreateDisableRequest(); + var disableResult = recurring.Disable(disableRequest); + Assert.AreEqual("[detail-successfully-disabled]", disableResult.Response); + } + + [TestMethod] + public async Task TestDisableAsync() + { + var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/disable-success.json"); + var recurring = new Service.RecurringService(client); + var disableRequest = CreateDisableRequest(); + var disableResult = await recurring.DisableAsync(disableRequest); + Assert.AreEqual("[detail-successfully-disabled]", disableResult.Response); + } + + [TestMethod] + public void NotifyShopperTest() + { + Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/notifyShopper-success.json"); + var recurring = new Service.RecurringService(client); + NotifyShopperRequest request = CreateNotifyShopperRequest(); + NotifyShopperResult result = recurring.NotifyShopper(request); + Assert.IsNotNull(result); + Assert.AreEqual("Example displayed reference", result.DisplayedReference); + Assert.AreEqual("8516167336214570", result.PspReference); + Assert.AreEqual("Request processed successfully", result.Message); + Assert.AreEqual("Example reference", result.Reference); + Assert.AreEqual("Success", result.ResultCode); + Assert.AreEqual("IA0F7500002462", result.ShopperNotificationReference); + } + + [TestMethod] + public void CreatePermitTest() + { + Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/createPermit-success.json"); + var recurring = new Service.RecurringService(client); + var createPermitResult = recurring.CreatePermit(new CreatePermitRequest()); + Assert.IsNotNull(createPermitResult); + Assert.AreEqual("string", createPermitResult.PspReference); + Assert.AreEqual(1,createPermitResult.PermitResultList.Count); + } + + [TestMethod] + public void DisablePermitTest() + { + Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/disablePermit-success.json"); + var recurring = new Service.RecurringService(client); + var disablePermitResult = recurring.DisablePermit(new DisablePermitRequest()); + Assert.IsNotNull(disablePermitResult); + Assert.AreEqual("string", disablePermitResult.PspReference); + Assert.AreEqual("disabled",disablePermitResult.Status); + } + + [TestMethod] + public void ScheduleAccountUpdaterTest() + { + Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/scheduleAccountUpdater-success.json"); + var recurring = new Service.RecurringService(client); + var scheduleAccountUpdaterResult = recurring.ScheduleAccountUpdater(new ScheduleAccountUpdaterRequest()); + Assert.IsNotNull(scheduleAccountUpdaterResult); + Assert.AreEqual("string", scheduleAccountUpdaterResult.PspReference); + Assert.AreEqual("string",scheduleAccountUpdaterResult.Result); + } + + private RecurringDetailsRequest CreateRecurringDetailsRequest() + { + var request = new RecurringDetailsRequest + { + ShopperReference = "test-123", + MerchantAccount = "DotNetAlexandros", + Recurring = new Model.Recurring.Recurring(Model.Recurring.Recurring.ContractEnum.RECURRING) + }; + return request; + } + + private DisableRequest CreateDisableRequest() + { + var request = new DisableRequest + { + ShopperReference = "test-123", + MerchantAccount = "DotNetAlexandros" + }; + return request; + } + + private NotifyShopperRequest CreateNotifyShopperRequest() + { + return new NotifyShopperRequest + { + MerchantAccount = "TestMerchant", + RecurringDetailReference = "8316158654144897", + Reference = "Example reference", + ShopperReference = "1234567", + BillingDate = "2021-03-31", + DisplayedReference = "Example displayed reference" + }; + } + } +} From 2253133d5fcdb1acd2143ddc4c7daa722fc08f87 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 1 Nov 2025 00:02:25 +0100 Subject: [PATCH 095/126] Added and moved RecurringTests --- Adyen.Test/Recurring/RecurringTest.cs | 177 +++++++----------- Adyen.Test/{Utilities => }/TestUtilities.cs | 5 + .../libraries/generichost/AsModel.mustache | 1 - .../csharp/libraries/generichost/api.mustache | 16 +- 4 files changed, 87 insertions(+), 112 deletions(-) rename Adyen.Test/{Utilities => }/TestUtilities.cs (62%) diff --git a/Adyen.Test/Recurring/RecurringTest.cs b/Adyen.Test/Recurring/RecurringTest.cs index 41177a53f..de3ef2ebe 100644 --- a/Adyen.Test/Recurring/RecurringTest.cs +++ b/Adyen.Test/Recurring/RecurringTest.cs @@ -15,7 +15,7 @@ public class RecurringTest private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; public RecurringTest() - { // TODO + { IHost host = Host.CreateDefaultBuilder() .ConfigureRecurring((context, services, config) => { @@ -30,136 +30,97 @@ public RecurringTest() } [TestMethod] - public void TestListRecurringDetails() + public void Given_Deserialize_When_ListRecurringDetails_Result_Returns_Not_Null() { // Arrange - var json = TestUtilities.GetTestFileContent("mocks/recurring/listRecurringDetails-success.json"); - var recurring = new Service.RecurringService(client); - var recurringDetailsRequest = CreateRecurringDetailsRequest(); - var recurringDetailsResult = recurring.ListRecurringDetails(recurringDetailsRequest); - Assert.AreEqual(3L, recurringDetailsResult.Details.Count); - var recurringDetail = recurringDetailsResult.Details[0].RecurringDetail; - - Assert.AreEqual("BFXCHLC5L6KXWD82", recurringDetail.RecurringDetailReference); - Assert.AreEqual("K652534298119846", recurringDetail.Alias); - Assert.AreEqual("0002", recurringDetail.Card.Number); + string json = TestUtilities.GetTestFileContent("mocks/recurring/listRecurringDetails-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(3L, response.Details.Count); + + Assert.AreEqual("BFXCHLC5L6KXWD82", response.Details[0].RecurringDetail.RecurringDetailReference); + Assert.AreEqual("K652534298119846", response.Details[0].RecurringDetail.Alias); + Assert.AreEqual("0002", response.Details[0].RecurringDetail.Card.Number); + + Assert.AreEqual("JW6RTP5PL6KXWD82", response.Details[1].RecurringDetail.RecurringDetailReference); + Assert.AreEqual("Wirecard", response.Details[1].RecurringDetail.Bank.BankName); + Assert.AreEqual("sepadirectdebit", response.Details[1].RecurringDetail.Variant); } [TestMethod] - public async Task TestListRecurringDetailsAsync() + public void Given_Deserialize_When_Disable_Result_Returns_Not_Null() { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/listRecurringDetails-success.json"); - var recurring = new Service.RecurringService(client); - var recurringDetailsRequest = CreateRecurringDetailsRequest(); - var recurringDetailsResult = await recurring.ListRecurringDetailsAsync(recurringDetailsRequest); - Assert.AreEqual(3L, recurringDetailsResult.Details.Count); - var recurringDetail = recurringDetailsResult.Details[1].RecurringDetail; - Assert.AreEqual("JW6RTP5PL6KXWD82", recurringDetail.RecurringDetailReference); - Assert.AreEqual("Wirecard", recurringDetail.Bank.BankName); - Assert.AreEqual("sepadirectdebit", recurringDetail.Variant); - } - - [TestMethod] - public void TestDisable() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/disable-success.json"); - var recurring = new Service.RecurringService(client); - var disableRequest = CreateDisableRequest(); - var disableResult = recurring.Disable(disableRequest); - Assert.AreEqual("[detail-successfully-disabled]", disableResult.Response); - } - - [TestMethod] - public async Task TestDisableAsync() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/disable-success.json"); - var recurring = new Service.RecurringService(client); - var disableRequest = CreateDisableRequest(); - var disableResult = await recurring.DisableAsync(disableRequest); - Assert.AreEqual("[detail-successfully-disabled]", disableResult.Response); + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/recurring/disable-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("[detail-successfully-disabled]", response.Response); } [TestMethod] - public void NotifyShopperTest() + public void Given_Deserialize_When_NotifyShopper_Result_Returns_Not_Null() { - Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/notifyShopper-success.json"); - var recurring = new Service.RecurringService(client); - NotifyShopperRequest request = CreateNotifyShopperRequest(); - NotifyShopperResult result = recurring.NotifyShopper(request); - Assert.IsNotNull(result); - Assert.AreEqual("Example displayed reference", result.DisplayedReference); - Assert.AreEqual("8516167336214570", result.PspReference); - Assert.AreEqual("Request processed successfully", result.Message); - Assert.AreEqual("Example reference", result.Reference); - Assert.AreEqual("Success", result.ResultCode); - Assert.AreEqual("IA0F7500002462", result.ShopperNotificationReference); + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/recurring/notifyShopper-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("Example displayed reference", response.DisplayedReference); + Assert.AreEqual("8516167336214570", response.PspReference); + Assert.AreEqual("Request processed successfully", response.Message); + Assert.AreEqual("Example reference", response.Reference); + Assert.AreEqual("Success", response.ResultCode); + Assert.AreEqual("IA0F7500002462", response.ShopperNotificationReference); } [TestMethod] - public void CreatePermitTest() + public void Given_Deserialize_When_CreatePermit_Result_Returns_Not_Null() { - Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/createPermit-success.json"); - var recurring = new Service.RecurringService(client); - var createPermitResult = recurring.CreatePermit(new CreatePermitRequest()); - Assert.IsNotNull(createPermitResult); - Assert.AreEqual("string", createPermitResult.PspReference); - Assert.AreEqual(1,createPermitResult.PermitResultList.Count); + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/recurring/createPermit-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("string", response.PspReference); + Assert.AreEqual(1, response.PermitResultList.Count); } [TestMethod] - public void DisablePermitTest() + public void Given_Deserialize_When_DisablePermit_Result_Returns_Not_Null() { - Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/disablePermit-success.json"); - var recurring = new Service.RecurringService(client); - var disablePermitResult = recurring.DisablePermit(new DisablePermitRequest()); - Assert.IsNotNull(disablePermitResult); - Assert.AreEqual("string", disablePermitResult.PspReference); - Assert.AreEqual("disabled",disablePermitResult.Status); + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/recurring/disablePermit-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("string", response.PspReference); + Assert.AreEqual("disabled",response.Status); } - + [TestMethod] - public void ScheduleAccountUpdaterTest() + public void Given_Deserialize_When_ScheduleAccountUpdater_Result_Returns_Not_Null() { - Client client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/recurring/scheduleAccountUpdater-success.json"); - var recurring = new Service.RecurringService(client); - var scheduleAccountUpdaterResult = recurring.ScheduleAccountUpdater(new ScheduleAccountUpdaterRequest()); - Assert.IsNotNull(scheduleAccountUpdaterResult); - Assert.AreEqual("string", scheduleAccountUpdaterResult.PspReference); - Assert.AreEqual("string",scheduleAccountUpdaterResult.Result); - } - - private RecurringDetailsRequest CreateRecurringDetailsRequest() - { - var request = new RecurringDetailsRequest - { - ShopperReference = "test-123", - MerchantAccount = "DotNetAlexandros", - Recurring = new Model.Recurring.Recurring(Model.Recurring.Recurring.ContractEnum.RECURRING) - }; - return request; - } + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/recurring/scheduleAccountUpdater-success.json"); - private DisableRequest CreateDisableRequest() - { - var request = new DisableRequest - { - ShopperReference = "test-123", - MerchantAccount = "DotNetAlexandros" - }; - return request; - } + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); - private NotifyShopperRequest CreateNotifyShopperRequest() - { - return new NotifyShopperRequest - { - MerchantAccount = "TestMerchant", - RecurringDetailReference = "8316158654144897", - Reference = "Example reference", - ShopperReference = "1234567", - BillingDate = "2021-03-31", - DisplayedReference = "Example displayed reference" - }; + // Assert + Assert.AreEqual("string", response.PspReference); + Assert.AreEqual("string", response.Result); } } } diff --git a/Adyen.Test/Utilities/TestUtilities.cs b/Adyen.Test/TestUtilities.cs similarity index 62% rename from Adyen.Test/Utilities/TestUtilities.cs rename to Adyen.Test/TestUtilities.cs index 15694e0d7..26d4a3748 100644 --- a/Adyen.Test/Utilities/TestUtilities.cs +++ b/Adyen.Test/TestUtilities.cs @@ -2,6 +2,11 @@ namespace Adyen.Test { internal static class TestUtilities { + /// + /// Utility function, used to read (mock json) files. + /// + /// The relative file to the file. + /// The file contents in string. public static string GetTestFileContent(string relativePath) { string rootPath = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "../../../")); diff --git a/templates-v7/csharp/libraries/generichost/AsModel.mustache b/templates-v7/csharp/libraries/generichost/AsModel.mustache index 3c3d96a3f..f98d3ad57 100644 --- a/templates-v7/csharp/libraries/generichost/AsModel.mustache +++ b/templates-v7/csharp/libraries/generichost/AsModel.mustache @@ -1,4 +1,3 @@ -// This logic may be modified with the AsModel.mustache template return Is{{vendorExtensions.x-http-status}} ? {{#isBinary}}ContentStream{{/isBinary}}{{^isBinary}}System.Text.Json.JsonSerializer.Deserialize<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}>(RawContent, _jsonSerializerOptions){{/isBinary}} : {{#net60OrLater}}null{{/net60OrLater}}{{^net60OrLater}}default{{/net60OrLater}}; diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 40a259290..47c36aceb 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -61,7 +61,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} - /// Cancellation Token to cancel the request. + /// . /// <> {{#isDeprecated}} [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] @@ -77,6 +77,8 @@ namespace {{packageName}}.{{apiPackage}} /// /// The . + /// **Usage:** Use `.TryDeserializeOk(out var result)` to get the result from the API: + /// . /// {{>visibility}} interface {{interfacePrefix}}{{operationId}}ApiResponse : {{#lambda.joinWithComma}}{{packageName}}.{{corePackageName}}.{{clientPackage}}.{{interfacePrefix}}ApiResponse {{#responses}}{{#dataType}}{{interfacePrefix}}{{vendorExtensions.x-http-status}}<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{/dataType}}{{/responses}}{{/lambda.joinWithComma}} { @@ -312,12 +314,20 @@ namespace {{packageName}}.{{apiPackage}} /// /// {{summary}} {{notes}} /// + /// + /// Use TryDeserializeOk(out result)) to retrieve the API result, when 200 OK response. + /// + /// + /// // Usage: + /// var response = await {{operationId}}Async(...); + /// if (response.TryDeserializeOk(out result)); + /// /// Thrown when fails to make API call. {{#allParams}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - /// Cancellation Token to cancel the request. - /// <> + /// . + /// of - If 200 OK response wraps the when `TryDeserializeOk(...)` is called. public async Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}) { {{#lambda.trimLineBreaks}} From 441e2879c8455cb5c4d896c2b48c4eba985a687c Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 1 Nov 2025 00:23:29 +0100 Subject: [PATCH 096/126] Added StoredValueTests --- Adyen.Test/StoredValue/StoredValueTest.cs | 116 ++++++++++++++++++ Adyen.Test/StoredValueTest.cs | 70 ----------- .../generichost/modelInnerEnum.mustache | 2 +- 3 files changed, 117 insertions(+), 71 deletions(-) create mode 100644 Adyen.Test/StoredValue/StoredValueTest.cs delete mode 100644 Adyen.Test/StoredValueTest.cs diff --git a/Adyen.Test/StoredValue/StoredValueTest.cs b/Adyen.Test/StoredValue/StoredValueTest.cs new file mode 100644 index 000000000..d9646cfde --- /dev/null +++ b/Adyen.Test/StoredValue/StoredValueTest.cs @@ -0,0 +1,116 @@ +using Adyen.Core.Options; +using Adyen.StoredValue.Client; +using Adyen.StoredValue.Models; +using Adyen.StoredValue.Extensions; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Text.Json; + +namespace Adyen.Test.StoredValue +{ + [TestClass] + public class StoredValueTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public StoredValueTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureStoredValue((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_Deserialize_When_StoredValueIssue_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/storedvalue/issue-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.ResultCode, StoredValueIssueResponse.ResultCodeEnum.Success); + Assert.AreEqual(response.AuthCode, "authCode"); + } + + [TestMethod] + public void Given_Deserialize_When_ChangeStatus_StoredValueStatusChangeResponse_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/storedvalue/changeStatus-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.ResultCode, StoredValueStatusChangeResponse.ResultCodeEnum.Refused); + Assert.AreEqual(response.AuthCode, "authCode"); + } + + [TestMethod] + public void Given_Deserialize_When_StoredValueLoad_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/storedvalue/load-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.ResultCode, StoredValueLoadResponse.ResultCodeEnum.Success); + Assert.AreEqual(response.AuthCode, "authCode"); + } + + [TestMethod] + public void Given_Deserialize_When_StoredValueCheckBalance_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/storedvalue/checkBalance-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.ResultCode, StoredValueBalanceCheckResponse.ResultCodeEnum.Success); + Assert.AreEqual(response.CurrentBalance.Value, 0); + } + + [TestMethod] + public void Given_Deserialize_When_StoredValueMergeBalance_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/storedvalue/mergeBalance-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.ResultCode, StoredValueBalanceMergeResponse.ResultCodeEnum.Success); + Assert.AreEqual(response.CurrentBalance.Value, 0); + } + + [TestMethod] + public void Given_Deserialize_When_StoredValueVoidRequest_Returns_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/storedvalue/mergeBalance-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.ResultCode, StoredValueVoidResponse.ResultCodeEnum.Success); + Assert.AreEqual(response.CurrentBalance.Value, 0); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/StoredValueTest.cs b/Adyen.Test/StoredValueTest.cs deleted file mode 100644 index cb0f0e3d3..000000000 --- a/Adyen.Test/StoredValueTest.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Adyen.Model.StoredValue; -using Adyen.Service; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - [TestClass] - public class StoredValueTest : BaseTest - { - [TestMethod] - public void StoredValueIssueTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/storedvalue/issue-success.json"); - var service = new StoredValueService(client); - var response = service.Issue(new StoredValueIssueRequest()); - Assert.AreEqual(response.ResultCode, StoredValueIssueResponse.ResultCodeEnum.Success); - Assert.AreEqual(response.AuthCode, "authCode"); - } - - [TestMethod] - public void StoredValueChangeStatusTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/storedvalue/changeStatus-success.json"); - var service = new StoredValueService(client); - var response = service.ChangeStatus(new StoredValueStatusChangeRequest()); - Assert.AreEqual(response.ResultCode, StoredValueStatusChangeResponse.ResultCodeEnum.Refused); - Assert.AreEqual(response.AuthCode, "authCode"); - } - - [TestMethod] - public void StoredValueLoadTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/storedvalue/load-success.json"); - var service = new StoredValueService(client); - var response = service.Load(new StoredValueLoadRequest()); - Assert.AreEqual(response.ResultCode, StoredValueLoadResponse.ResultCodeEnum.Success); - Assert.AreEqual(response.AuthCode, "authCode"); - } - - [TestMethod] - public void StoredValueCheckBalanceTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/storedvalue/checkBalance-success.json"); - var service = new StoredValueService(client); - var response = service.CheckBalance(new StoredValueBalanceCheckRequest()); - Assert.AreEqual(response.ResultCode, StoredValueBalanceCheckResponse.ResultCodeEnum.Success); - Assert.AreEqual(response.CurrentBalance.Value, 0); - } - - [TestMethod] - public void StoredValueMergeBalanceTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/storedvalue/mergeBalance-success.json"); - var service = new StoredValueService(client); - var response = service.MergeBalance(new StoredValueBalanceMergeRequest()); - Assert.AreEqual(response.ResultCode, StoredValueBalanceMergeResponse.ResultCodeEnum.Success); - Assert.AreEqual(response.CurrentBalance.Value, 0); - } - - [TestMethod] - public void StoredValueVoidTransactionTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/storedvalue/mergeBalance-success.json"); - var service = new StoredValueService(client); - var response = service.VoidTransactionAsync(new StoredValueVoidRequest()).Result; - Assert.AreEqual(response.ResultCode, StoredValueVoidResponse.ResultCodeEnum.Success); - Assert.AreEqual(response.CurrentBalance.Value, 0); - } - } -} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/modelInnerEnum.mustache b/templates-v7/csharp/libraries/generichost/modelInnerEnum.mustache index fba690e47..ce5cd2324 100644 --- a/templates-v7/csharp/libraries/generichost/modelInnerEnum.mustache +++ b/templates-v7/csharp/libraries/generichost/modelInnerEnum.mustache @@ -10,7 +10,7 @@ [JsonConverter(typeof({{datatypeWithEnum}}JsonConverter))] {{/useGenericHost}} {{/isString}} - {{>visibility}} class {{datatypeWithEnum}}: IEnum + {{>visibility}} class {{datatypeWithEnum}} : IEnum { /// /// Returns the value of the {{datatypeWithEnum}}. From c15072bba8825622a32474855fd3b50358f9448d Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 1 Nov 2025 00:28:53 +0100 Subject: [PATCH 097/126] Update StoredValueTests --- Adyen.Test/StoredValue/StoredValueTest.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Adyen.Test/StoredValue/StoredValueTest.cs b/Adyen.Test/StoredValue/StoredValueTest.cs index d9646cfde..95a9f4286 100644 --- a/Adyen.Test/StoredValue/StoredValueTest.cs +++ b/Adyen.Test/StoredValue/StoredValueTest.cs @@ -30,7 +30,7 @@ public StoredValueTest() } [TestMethod] - public void Given_Deserialize_When_StoredValueIssue_Returns_Not_Null() + public async Task Given_Deserialize_When_StoredValueIssue_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/storedvalue/issue-success.json"); @@ -44,7 +44,7 @@ public void Given_Deserialize_When_StoredValueIssue_Returns_Not_Null() } [TestMethod] - public void Given_Deserialize_When_ChangeStatus_StoredValueStatusChangeResponse_Returns_Not_Null() + public async Task Given_Deserialize_When_ChangeStatus_StoredValueStatusChange_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/storedvalue/changeStatus-success.json"); @@ -58,7 +58,7 @@ public void Given_Deserialize_When_ChangeStatus_StoredValueStatusChangeResponse_ } [TestMethod] - public void Given_Deserialize_When_StoredValueLoad_Returns_Not_Null() + public async Task Given_Deserialize_When_StoredValueLoad_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/storedvalue/load-success.json"); @@ -72,7 +72,7 @@ public void Given_Deserialize_When_StoredValueLoad_Returns_Not_Null() } [TestMethod] - public void Given_Deserialize_When_StoredValueCheckBalance_Returns_Not_Null() + public async Task Given_Deserialize_When_StoredValueBalanceCheck_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/storedvalue/checkBalance-success.json"); @@ -86,7 +86,7 @@ public void Given_Deserialize_When_StoredValueCheckBalance_Returns_Not_Null() } [TestMethod] - public void Given_Deserialize_When_StoredValueMergeBalance_Returns_Not_Null() + public async Task Given_Deserialize_When_StoredValueBalanceMerge_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/storedvalue/mergeBalance-success.json"); @@ -100,7 +100,7 @@ public void Given_Deserialize_When_StoredValueMergeBalance_Returns_Not_Null() } [TestMethod] - public void Given_Deserialize_When_StoredValueVoidRequest_Returns_Not_Null() + public async Task Given_Deserialize_When_StoredValueVoid_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/storedvalue/mergeBalance-success.json"); From 7c610729d2a2d4f567beb500bceb5332107638a8 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 1 Nov 2025 01:21:29 +0100 Subject: [PATCH 098/126] Add PosTerminalManagement tests --- .../PosTerminalManagementTest.cs | 129 +++++++++++++++++ Adyen.Test/PosTerminalManagementTest.cs | 131 ------------------ ....json => assigning-terminals-success.json} | 0 ...json => get-terminal-details-success.json} | 0 4 files changed, 129 insertions(+), 131 deletions(-) create mode 100644 Adyen.Test/PosTerminalManagement/PosTerminalManagementTest.cs delete mode 100644 Adyen.Test/PosTerminalManagementTest.cs rename Adyen.Test/mocks/pos-terminal-management/{assing-terminals-success.json => assigning-terminals-success.json} (100%) rename Adyen.Test/mocks/pos-terminal-management/{get-terminals-details-success.json => get-terminal-details-success.json} (100%) diff --git a/Adyen.Test/PosTerminalManagement/PosTerminalManagementTest.cs b/Adyen.Test/PosTerminalManagement/PosTerminalManagementTest.cs new file mode 100644 index 000000000..fcfb566ee --- /dev/null +++ b/Adyen.Test/PosTerminalManagement/PosTerminalManagementTest.cs @@ -0,0 +1,129 @@ +using Adyen.Core.Options; +using Adyen.PosTerminalManagement.Client; +using Adyen.PosTerminalManagement.Models; +using Adyen.PosTerminalManagement.Extensions; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Text.Json; + +namespace Adyen.Test.PosTerminalManagement +{ + [TestClass] + public class PosTerminalManagementTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public PosTerminalManagementTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigurePosTerminalManagement((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_Deserialize_When_FindTerminal_Result_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/pos-terminal-management/find-terminals-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Terminal, "V400m-123456789"); + Assert.AreEqual(response.CompanyAccount, "TestCompany"); + Assert.AreEqual(response.MerchantAccount, "TestMerchant"); + Assert.AreEqual(response.Store, "MyStore"); + Assert.AreEqual(response.MerchantInventory, false); + } + + [TestMethod] + public void Given_Deserialize_When_AssignTerminals_Result_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/pos-terminal-management/assigning-terminals-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Results["V400m-123456789"], "ActionScheduled"); + Assert.AreEqual(response.Results["P400Plus-123456789"], "Done"); + } + + [TestMethod] + public void Given_Deserialize_When_GetTerminalsUnderAccount_Result_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/pos-terminal-management/get-terminals-under-account-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.CompanyAccount, "TestCompany"); + Assert.AreEqual(response.MerchantAccounts[0].VarMerchantAccount, "TestMerchantPOS_EU"); + Assert.AreEqual(response.MerchantAccounts[1].VarMerchantAccount, "TestMerchantPOS_US"); + Assert.AreEqual(response.InventoryTerminals[0], "V400m-123456789"); + Assert.AreEqual(response.InventoryTerminals[1], "P400Plus-123456789"); + Assert.AreEqual(response.MerchantAccounts[0].VarMerchantAccount, "TestMerchantPOS_EU"); + Assert.AreEqual(response.MerchantAccounts[0].InventoryTerminals[0], "M400-123456789"); + Assert.AreEqual(response.MerchantAccounts[0].InventoryTerminals[1], "VX820-123456789"); + Assert.AreEqual(response.MerchantAccounts[0].InStoreTerminals[0], "E355-123456789"); + Assert.AreEqual(response.MerchantAccounts[0].InStoreTerminals[1], "V240mPlus-123456789"); + Assert.AreEqual(response.MerchantAccounts[0].Stores[0].VarStore, "TestStore"); + Assert.AreEqual(response.MerchantAccounts[0].Stores[0].InStoreTerminals[0], "MX925-123456789"); + Assert.AreEqual(response.MerchantAccounts[1].InStoreTerminals[0], "VX820-123456789"); + Assert.AreEqual(response.MerchantAccounts[1].InStoreTerminals[1], "VX690-123456789"); + } + + [TestMethod] + public void Given_Deserialize_When_GetTerminalDetails_Result_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/pos-terminal-management/get-terminal-details-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.CompanyAccount, "YOUR_COMPANY_ACCOUNT"); + Assert.AreEqual(response.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); + Assert.AreEqual(response.MerchantInventory, false); + Assert.AreEqual(response.Terminal, "P400Plus-275479597"); + Assert.AreEqual(response.DeviceModel, "P400Plus"); + Assert.AreEqual(response.SerialNumber, "275-479-597"); + Assert.AreEqual(response.PermanentTerminalId, "12000000"); + Assert.AreEqual(response.FirmwareVersion, "Verifone_VOS 1.50.7"); + Assert.AreEqual(response.TerminalStatus, GetTerminalDetailsResponse.TerminalStatusEnum.ReAssignToInventoryPending); + Assert.AreEqual(response.Country, "NETHERLANDS"); + Assert.AreEqual(response.DhcpEnabled, false); + } + + [TestMethod] + public void Given_Deserialize_When_GetStoresUnderAccount_Result_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/pos-terminal-management/get-stores-under-account-success.json"); + + // Act + var response =JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.Stores[0].MerchantAccountCode, "YOUR_MERCHANT_ACCOUNT"); + Assert.AreEqual(response.Stores[0].VarStore, "YOUR_STORE"); + Assert.AreEqual(response.Stores[0].Description, "YOUR_STORE"); + Assert.AreEqual(response.Stores[0].Status, "Active"); + + } + } +} diff --git a/Adyen.Test/PosTerminalManagementTest.cs b/Adyen.Test/PosTerminalManagementTest.cs deleted file mode 100644 index 6dc9c511b..000000000 --- a/Adyen.Test/PosTerminalManagementTest.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System.Collections.Generic; -using Adyen.Model.PosTerminalManagement; -using Adyen.Service; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - [TestClass] - public class PosTerminalManagementTest : BaseTest - { - /// - /// Test post /findTerminals - /// - [TestMethod] - public void FindTerminalSuccess() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/pos-terminal-management/find-terminals-success.json"); - var posTerminalManagement = new PosTerminalManagementService(client); - var findTerminalRequest = new FindTerminalRequest - { - Terminal = "V400m-123456789" - }; - var findTerminalResponse = posTerminalManagement.FindTerminal(findTerminalRequest); - Assert.AreEqual(findTerminalResponse.Terminal, "V400m-123456789"); - Assert.AreEqual(findTerminalResponse.CompanyAccount, "TestCompany"); - Assert.AreEqual(findTerminalResponse.MerchantAccount, "TestMerchant"); - Assert.AreEqual(findTerminalResponse.Store, "MyStore"); - Assert.AreEqual(findTerminalResponse.MerchantInventory, false); - } - /// - /// Test post /assignTerminals - /// - [TestMethod] - public void AssignTerminalsSuccess() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/pos-terminal-management/assing-terminals-success.json"); - var posTerminalManagement = new PosTerminalManagementService(client); - var assignTerminalsRequest = new AssignTerminalsRequest - { - MerchantAccount = "TestMerchant", - CompanyAccount = "TestMerchantAccount", - MerchantInventory = true, - Terminals = new List { "P400Plus-123456789" } - }; - var assignTerminalsResponse = posTerminalManagement.AssignTerminals(assignTerminalsRequest); - Assert.AreEqual(assignTerminalsResponse.Results["V400m-123456789"], "ActionScheduled"); - Assert.AreEqual(assignTerminalsResponse.Results["P400Plus-123456789"], "Done"); - } - - /// - /// Test post /getTerminalsUnderAccountResponse - /// - [TestMethod] - public void GetTerminalsUnderAccountSuccess() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/pos-terminal-management/get-terminals-under-account-success.json"); - var posTerminalManagement = new PosTerminalManagementService(client); - var getTerminalsUnderAccountRequest = new GetTerminalsUnderAccountRequest - { - CompanyAccount = "TestCompany", - }; - var getTerminalsUnderAccountResponse = posTerminalManagement.GetTerminalsUnderAccount(getTerminalsUnderAccountRequest); - Assert.AreEqual(getTerminalsUnderAccountResponse.CompanyAccount, "TestCompany"); - Assert.AreEqual(getTerminalsUnderAccountResponse.MerchantAccounts[0]._MerchantAccount, "TestMerchantPOS_EU"); - Assert.AreEqual(getTerminalsUnderAccountResponse.MerchantAccounts[1]._MerchantAccount, "TestMerchantPOS_US"); - Assert.AreEqual(getTerminalsUnderAccountResponse.InventoryTerminals[0], "V400m-123456789"); - Assert.AreEqual(getTerminalsUnderAccountResponse.InventoryTerminals[1], "P400Plus-123456789"); - Assert.AreEqual(getTerminalsUnderAccountResponse.MerchantAccounts[0]._MerchantAccount, "TestMerchantPOS_EU"); - Assert.AreEqual(getTerminalsUnderAccountResponse.MerchantAccounts[0].InventoryTerminals[0], "M400-123456789"); - Assert.AreEqual(getTerminalsUnderAccountResponse.MerchantAccounts[0].InventoryTerminals[1], "VX820-123456789"); - Assert.AreEqual(getTerminalsUnderAccountResponse.MerchantAccounts[0].InStoreTerminals[0], "E355-123456789"); - Assert.AreEqual(getTerminalsUnderAccountResponse.MerchantAccounts[0].InStoreTerminals[1], "V240mPlus-123456789"); - Assert.AreEqual(getTerminalsUnderAccountResponse.MerchantAccounts[0].Stores[0]._Store, "TestStore"); - Assert.AreEqual(getTerminalsUnderAccountResponse.MerchantAccounts[0].Stores[0].InStoreTerminals[0], "MX925-123456789"); - Assert.AreEqual(getTerminalsUnderAccountResponse.MerchantAccounts[1].InStoreTerminals[0], "VX820-123456789"); - Assert.AreEqual(getTerminalsUnderAccountResponse.MerchantAccounts[1].InStoreTerminals[1], "VX690-123456789"); - } - - /// - /// Test post /getTerminalDetails - /// - [TestMethod] - public void GetTerminalDetailsSuccess() - { - var client = - CreateMockTestClientApiKeyBasedRequestAsync( - "mocks/pos-terminal-management/get-terminals-details-success.json"); - var posTerminalManagement = new PosTerminalManagementService(client); - var getTerminalDetailsRequest = new GetTerminalDetailsRequest - { - Terminal = "P400Plus-275479597", - }; - var getTerminalDetailsResponse = - posTerminalManagement.GetTerminalDetails(getTerminalDetailsRequest); - Assert.AreEqual(getTerminalDetailsResponse.CompanyAccount, "YOUR_COMPANY_ACCOUNT"); - Assert.AreEqual(getTerminalDetailsResponse.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); - Assert.AreEqual(getTerminalDetailsResponse.MerchantInventory, false); - Assert.AreEqual(getTerminalDetailsResponse.Terminal, "P400Plus-275479597"); - Assert.AreEqual(getTerminalDetailsResponse.DeviceModel, "P400Plus"); - Assert.AreEqual(getTerminalDetailsResponse.SerialNumber, "275-479-597"); - Assert.AreEqual(getTerminalDetailsResponse.PermanentTerminalId, "12000000"); - Assert.AreEqual(getTerminalDetailsResponse.FirmwareVersion, "Verifone_VOS 1.50.7"); - Assert.AreEqual(getTerminalDetailsResponse.TerminalStatus, GetTerminalDetailsResponse.TerminalStatusEnum.ReAssignToInventoryPending); - Assert.AreEqual(getTerminalDetailsResponse.Country, "NETHERLANDS"); - Assert.AreEqual(getTerminalDetailsResponse.DhcpEnabled, false); - } - - /// - /// Test post /getStoresUnderAccount - /// - [TestMethod] - public void GetStoresUnderAccountSuccess() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync( - "mocks/pos-terminal-management/get-stores-under-account-success.json"); - var posTerminalManagement = new PosTerminalManagementService(client); - var getStoresUnderAccountSuccessRequest = new GetStoresUnderAccountRequest - { - CompanyAccount = "MockCompanyAccount", - MerchantAccount = "TestMerchantAccount", - }; - var getStoresUnderAccountSuccessResponse = - posTerminalManagement.GetStoresUnderAccount(getStoresUnderAccountSuccessRequest); - Assert.AreEqual(getStoresUnderAccountSuccessResponse.Stores[0].MerchantAccountCode, "YOUR_MERCHANT_ACCOUNT"); - Assert.AreEqual(getStoresUnderAccountSuccessResponse.Stores[0]._Store, "YOUR_STORE"); - Assert.AreEqual(getStoresUnderAccountSuccessResponse.Stores[0].Description, "YOUR_STORE"); - Assert.AreEqual(getStoresUnderAccountSuccessResponse.Stores[0].Status, "Active"); - - } - } -} diff --git a/Adyen.Test/mocks/pos-terminal-management/assing-terminals-success.json b/Adyen.Test/mocks/pos-terminal-management/assigning-terminals-success.json similarity index 100% rename from Adyen.Test/mocks/pos-terminal-management/assing-terminals-success.json rename to Adyen.Test/mocks/pos-terminal-management/assigning-terminals-success.json diff --git a/Adyen.Test/mocks/pos-terminal-management/get-terminals-details-success.json b/Adyen.Test/mocks/pos-terminal-management/get-terminal-details-success.json similarity index 100% rename from Adyen.Test/mocks/pos-terminal-management/get-terminals-details-success.json rename to Adyen.Test/mocks/pos-terminal-management/get-terminal-details-success.json From d2a2ea0e40c08b3ccb464a3f546e956e811656d5 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 1 Nov 2025 01:37:11 +0100 Subject: [PATCH 099/126] Add Payout, PaymentsApp tests --- .../BalanceControl/BalanceControlTest.cs | 2 +- .../BalanceAccounts/BalanceAccountTest.cs | 8 +- .../PaymentInstrumentGroupTest.cs | 4 +- .../PaymentInstrumentTest.cs | 2 +- .../TransactionRules/TransactionRuleTest.cs | 6 +- Adyen.Test/BinLookup/BinLookupTest.cs | 6 +- Adyen.Test/Checkout/PaymentsServiceTest.cs | 20 +- Adyen.Test/Checkout/UtilityServiceTest.cs | 2 +- Adyen.Test/Core/Auth/TokenProviderTest.cs | 4 +- Adyen.Test/Core/Client/ApiResponseTest.cs | 8 +- .../DataProtection/DataProtectionTest.cs | 2 +- Adyen.Test/Disputes/DisputesTest.cs | 10 +- Adyen.Test/Management/ManagementTest.cs | 6 +- .../PaymentsApp/PaymentsAppServiceTest.cs | 60 ++ Adyen.Test/PaymentsAppServiceTest.cs | 37 - Adyen.Test/Payout/PayoutTest.cs | 12 +- .../PosTerminalManagementTest.cs | 11 +- Adyen.Test/Recurring/RecurringTest.cs | 12 +- Adyen.Test/{ => TerminalApi}/BaseTest.cs | 878 +++++++++--------- .../NotificationDecryptionTest.cs | 0 Adyen.Test/UtilTest.cs | 212 ----- .../BalancePlatformWebhookHandlerTest.cs | 0 .../Webhooks/HmacValidatorUtilityTest.cs | 193 ++++ .../ManagementWebhookHandlerTest.cs | 0 .../WebhookHandlerTest.cs | 0 25 files changed, 758 insertions(+), 737 deletions(-) create mode 100644 Adyen.Test/PaymentsApp/PaymentsAppServiceTest.cs delete mode 100644 Adyen.Test/PaymentsAppServiceTest.cs rename Adyen.Test/{ => TerminalApi}/BaseTest.cs (97%) rename Adyen.Test/{ => TerminalApi}/NotificationDecryptionTest.cs (100%) delete mode 100644 Adyen.Test/UtilTest.cs rename Adyen.Test/{WebhooksTests => Webhooks}/BalancePlatformWebhookHandlerTest.cs (100%) create mode 100644 Adyen.Test/Webhooks/HmacValidatorUtilityTest.cs rename Adyen.Test/{WebhooksTests => Webhooks}/ManagementWebhookHandlerTest.cs (100%) rename Adyen.Test/{WebhooksTests => Webhooks}/WebhookHandlerTest.cs (100%) diff --git a/Adyen.Test/BalanceControl/BalanceControlTest.cs b/Adyen.Test/BalanceControl/BalanceControlTest.cs index dde1fe5ed..bebbe64e1 100644 --- a/Adyen.Test/BalanceControl/BalanceControlTest.cs +++ b/Adyen.Test/BalanceControl/BalanceControlTest.cs @@ -46,7 +46,7 @@ public async Task DeserializeBalanceControlTest() } [TestMethod] - public void Given_IBalanceControlService_When_Live_Url_And_Prefix_Are_Set_Returns_Correct_Live_Url_Endpoint() + public async Task Given_IBalanceControlService_When_Live_Url_And_Prefix_Are_Set_Returns_Correct_Live_Url_Endpoint() { // Arrange IHost liveHost = Host.CreateDefaultBuilder() diff --git a/Adyen.Test/BalancePlatform/BalanceAccounts/BalanceAccountTest.cs b/Adyen.Test/BalancePlatform/BalanceAccounts/BalanceAccountTest.cs index 8af1ae251..7ea908037 100644 --- a/Adyen.Test/BalancePlatform/BalanceAccounts/BalanceAccountTest.cs +++ b/Adyen.Test/BalancePlatform/BalanceAccounts/BalanceAccountTest.cs @@ -47,7 +47,7 @@ public async Task Given_BalanceAccounts_Deserialize_Correctly() } [TestMethod] - public void Given_SweepConfigurationV2_Deserialize_Correctly() + public async Task Given_SweepConfigurationV2_Deserialize_Correctly() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/SweepConfiguration.json"); @@ -62,7 +62,7 @@ public void Given_SweepConfigurationV2_Deserialize_Correctly() } [TestMethod] - public void Given_BalanceSweepConfigurationsResponse_Deserialize_Correctly() + public async Task Given_BalanceSweepConfigurationsResponse_Deserialize_Correctly() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/BalanceSweepConfigurationsResponse.json"); @@ -77,7 +77,7 @@ public void Given_BalanceSweepConfigurationsResponse_Deserialize_Correctly() } [TestMethod] - public void Given_UpdateSweepConfigurationV2_Deserialize_Correctly() + public async Task Given_UpdateSweepConfigurationV2_Deserialize_Correctly() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/SweepConfiguration.json"); @@ -92,7 +92,7 @@ public void Given_UpdateSweepConfigurationV2_Deserialize_Correctly() } [TestMethod] - public void GetBalanceAccountsIdPaymentInstrumentsTest() + public async Task GetBalanceAccountsIdPaymentInstrumentsTest() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/PaginatedPaymentInstrumentsResponse.json"); diff --git a/Adyen.Test/BalancePlatform/PaymentInstrumentGroups/PaymentInstrumentGroupTest.cs b/Adyen.Test/BalancePlatform/PaymentInstrumentGroups/PaymentInstrumentGroupTest.cs index 5ce4454c1..f7cc1f109 100644 --- a/Adyen.Test/BalancePlatform/PaymentInstrumentGroups/PaymentInstrumentGroupTest.cs +++ b/Adyen.Test/BalancePlatform/PaymentInstrumentGroups/PaymentInstrumentGroupTest.cs @@ -33,7 +33,7 @@ public PaymentInstrumentGroupTest() } [TestMethod] - public void Given_PaymentInstrumentGroup_Deserialize_Correctly() + public async Task Given_PaymentInstrumentGroup_Deserialize_Correctly() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/PaymentInstrumentGroup.json"); @@ -47,7 +47,7 @@ public void Given_PaymentInstrumentGroup_Deserialize_Correctly() } [TestMethod] - public void Given_TransactionRulesResponse_Deserialize_Correctly() + public async Task Given_TransactionRulesResponse_Deserialize_Correctly() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/TransactionRulesResponse.json"); diff --git a/Adyen.Test/BalancePlatform/PaymentInstruments/PaymentInstrumentTest.cs b/Adyen.Test/BalancePlatform/PaymentInstruments/PaymentInstrumentTest.cs index 304744f6e..2e8ccd257 100644 --- a/Adyen.Test/BalancePlatform/PaymentInstruments/PaymentInstrumentTest.cs +++ b/Adyen.Test/BalancePlatform/PaymentInstruments/PaymentInstrumentTest.cs @@ -33,7 +33,7 @@ public PaymentInstrumentTest() } [TestMethod] - public void Given_PaymentInstrument_Deserialize_Correctly() + public async Task Given_PaymentInstrument_Deserialize_Correctly() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/PaymentInstrument.json"); diff --git a/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs b/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs index 68fbeb7ef..82b13cf91 100644 --- a/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs +++ b/Adyen.Test/BalancePlatform/TransactionRules/TransactionRuleTest.cs @@ -31,7 +31,7 @@ public TransactionRuleTest() } [TestMethod] - public void Given_TransactionRule_Serialize_Correctly() + public async Task Given_TransactionRule_Serialize_Correctly() { // Arrange var target = new TransactionRule( @@ -79,7 +79,7 @@ public void Given_TransactionRule_Serialize_Correctly() } [TestMethod] - public void Given_TransactionRule_Deserialize_Correctly() + public async Task Given_TransactionRule_Deserialize_Correctly() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/TransactionRule.json"); @@ -95,7 +95,7 @@ public void Given_TransactionRule_Deserialize_Correctly() } [TestMethod] - public void Given_TransactionRuleResponse_Deserialize_Correctly() + public async Task Given_TransactionRuleResponse_Deserialize_Correctly() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/TransactionRuleResponse.json"); diff --git a/Adyen.Test/BinLookup/BinLookupTest.cs b/Adyen.Test/BinLookup/BinLookupTest.cs index a091222a4..335b68430 100644 --- a/Adyen.Test/BinLookup/BinLookupTest.cs +++ b/Adyen.Test/BinLookup/BinLookupTest.cs @@ -31,7 +31,7 @@ public BinLookupTest() } [TestMethod] - public void Given_Deserialize_When_ThreeDSAvailabilityResponse_Result_Not_Null() + public async Task Given_Deserialize_When_ThreeDSAvailabilityResponse_Result_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/binlookup/get3dsavailability-success.json"); @@ -51,7 +51,7 @@ public void Given_Deserialize_When_ThreeDSAvailabilityResponse_Result_Not_Null() } [TestMethod] - public void Given_Deserialize_When_CostEstimateResponse_Result_Not_Null() + public async Task Given_Deserialize_When_CostEstimateResponse_Result_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/binlookup/getcostestimate-success.json"); @@ -65,7 +65,7 @@ public void Given_Deserialize_When_CostEstimateResponse_Result_Not_Null() } [TestMethod] - public void Given_Serialize_When_CostEstimateRequest_ShopperInteractionEnums_Result_Should_Return_Correct_String() + public async Task Given_Serialize_When_CostEstimateRequest_ShopperInteractionEnums_Result_Should_Return_Correct_String() { // Arrange // Act diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index f36e05a8e..0694f49bb 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -90,7 +90,7 @@ public async Task Given_CreateCheckoutSessionResponse_When_Deserialize_Returns_N } [TestMethod] - public void Given_Serialize_When_DeviceRenderOptions_Returns_MultiSelect_And_OtherHtml() + public async Task Given_Serialize_When_DeviceRenderOptions_Returns_MultiSelect_And_OtherHtml() { // Arrange DeviceRenderOptions deviceRenderOptions = new DeviceRenderOptions @@ -198,5 +198,23 @@ public async Task Given_IPaymentsService_When_Live_Url_And_Prefix_Are_Set_Return // Assert Assert.AreEqual("https://prefix-checkout-live.adyenpayments.com/checkout/v71", paymentsService.HttpClient.BaseAddress.ToString()); } + + ////TODO: Chained calls, extract these and move it to Payments + // [TestMethod] + // public void TestSerializationShopperInteractionMoto() + // { + // var paymentRequest = MockPaymentData.CreateFullPaymentRequestWithShopperInteraction(PaymentRequest.ShopperInteractionEnum.Moto); + // var serializedPaymentRequest = JsonConvert.SerializeObject(paymentRequest); + // StringAssert.Contains(serializedPaymentRequest, nameof(PaymentRequest.ShopperInteractionEnum.Moto)); + // } + // + // [TestMethod] + // public void TestSerializationShopperInteractionDefaultIsZero() + // { + // PaymentRequest paymentRequest = MockPaymentData.CreateFullPaymentRequestWithShopperInteraction(default); + // string serializedPaymentRequest = paymentRequest.ToJson(); + // Assert.IsTrue(serializedPaymentRequest.Contains("\"shopperInteraction\": 0,")); + // } + } } \ No newline at end of file diff --git a/Adyen.Test/Checkout/UtilityServiceTest.cs b/Adyen.Test/Checkout/UtilityServiceTest.cs index 2a44e4040..e00d3392f 100644 --- a/Adyen.Test/Checkout/UtilityServiceTest.cs +++ b/Adyen.Test/Checkout/UtilityServiceTest.cs @@ -30,7 +30,7 @@ public UtilityServiceTest() } [TestMethod] - public void Given_Deserialize_When_UtilityResponse_For_OriginKeys_Returns_Success() + public async Task Given_Deserialize_When_UtilityResponse_For_OriginKeys_Returns_Success() { string json = TestUtilities.GetTestFileContent("mocks/checkoututility/originkeys-success.json"); var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); diff --git a/Adyen.Test/Core/Auth/TokenProviderTest.cs b/Adyen.Test/Core/Auth/TokenProviderTest.cs index 8c03f7eee..db8862722 100644 --- a/Adyen.Test/Core/Auth/TokenProviderTest.cs +++ b/Adyen.Test/Core/Auth/TokenProviderTest.cs @@ -17,7 +17,7 @@ internal TestToken(string value) } [TestMethod] - public void Given_TokenProviderWithToken_When_GetCalled_Then_SameInstanceAndValueAreReturned() + public async Task Given_TokenProviderWithToken_When_GetCalled_Then_SameInstanceAndValueAreReturned() { // Arrange var token = new TestToken("apikey"); @@ -32,7 +32,7 @@ public void Given_TokenProviderWithToken_When_GetCalled_Then_SameInstanceAndValu } [TestMethod] - public void Given_TokenProvider_When_GetCalledMultipleTimes_Then_SameInstanceReturnedEachTime() + public async Task Given_TokenProvider_When_GetCalledMultipleTimes_Then_SameInstanceReturnedEachTime() { // Arrange var token = new TestToken("apikey"); diff --git a/Adyen.Test/Core/Client/ApiResponseTest.cs b/Adyen.Test/Core/Client/ApiResponseTest.cs index 5d2f37d41..d89d88f50 100644 --- a/Adyen.Test/Core/Client/ApiResponseTest.cs +++ b/Adyen.Test/Core/Client/ApiResponseTest.cs @@ -31,7 +31,7 @@ private HttpResponseMessage CreateResponse(HttpStatusCode statusCode, string rea [DataRow(HttpStatusCode.TooManyRequests, false)] [DataRow(HttpStatusCode.UnprocessableEntity, false)] [DataRow(HttpStatusCode.InternalServerError, false)] - public void Given_ApiResponse_When_SuccessStatusCode_Then_Result_ShouldMatchHttpResponseMessage(HttpStatusCode code, bool expected) + public async Task Given_ApiResponse_When_SuccessStatusCode_Then_Result_ShouldMatchHttpResponseMessage(HttpStatusCode code, bool expected) { // Arrange // Act @@ -41,7 +41,7 @@ public void Given_ApiResponse_When_SuccessStatusCode_Then_Result_ShouldMatchHttp } [TestMethod] - public void Given_ApiResponse_When_Properties_Are_Set_Then_Object_Should_Return_Correct_Values() + public async Task Given_ApiResponse_When_Properties_Are_Set_Then_Object_Should_Return_Correct_Values() { // Arrange var request = CreateRequest("https://adyen.com/"); @@ -61,7 +61,7 @@ public void Given_ApiResponse_When_Properties_Are_Set_Then_Object_Should_Return_ } [TestMethod] - public void Given_ApiResponse_When_ContentStream_Is_Set_Then_Return_ContentStream_And_Empty_RawContent() + public async Task Given_ApiResponse_When_ContentStream_Is_Set_Then_Return_ContentStream_And_Empty_RawContent() { // Arrange var request = CreateRequest(); @@ -119,7 +119,7 @@ public TestApiResponse(HttpRequestMessage message, HttpResponseMessage response, private record TestModel(string Foo); [TestMethod] - public void Given_ApiResponse_When_TypedResponses_Then_Deserialize_Correctly() + public async Task Given_ApiResponse_When_TypedResponses_Then_Deserialize_Correctly() { // Arrange var model = new TestModel("adyen"); diff --git a/Adyen.Test/DataProtection/DataProtectionTest.cs b/Adyen.Test/DataProtection/DataProtectionTest.cs index 24a62db26..d120b20e2 100644 --- a/Adyen.Test/DataProtection/DataProtectionTest.cs +++ b/Adyen.Test/DataProtection/DataProtectionTest.cs @@ -30,7 +30,7 @@ public DataProtectionTest() } [TestMethod] - public void Given_Deserialize_When_SubjectErasureResponse_Returns_Not_Null_And_Correct_Enum() + public async Task Given_Deserialize_When_SubjectErasureResponse_Returns_Not_Null_And_Correct_Enum() { string json = TestUtilities.GetTestFileContent("mocks/data-protection-response.json"); diff --git a/Adyen.Test/Disputes/DisputesTest.cs b/Adyen.Test/Disputes/DisputesTest.cs index dcf8e279a..9bcff9e7c 100644 --- a/Adyen.Test/Disputes/DisputesTest.cs +++ b/Adyen.Test/Disputes/DisputesTest.cs @@ -30,7 +30,7 @@ public DisputesTest() } [TestMethod] - public void Given_Deserialize_AcceptDispute_Returns_Success() + public async Task Given_Deserialize_AcceptDispute_Returns_Success() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/disputes/accept-dispute.json"); @@ -43,7 +43,7 @@ public void Given_Deserialize_AcceptDispute_Returns_Success() } [TestMethod] - public void Given_Deserialize_DefendDispute_Returns_Success() + public async Task Given_Deserialize_DefendDispute_Returns_Success() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/disputes/defend-dispute.json"); @@ -56,7 +56,7 @@ public void Given_Deserialize_DefendDispute_Returns_Success() } [TestMethod] - public void Given_Deserialize_DeleteDefenseDocumentResponse_Returns_Success() + public async Task Given_Deserialize_DeleteDefenseDocumentResponse_Returns_Success() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/disputes/delete-dispute.json"); @@ -69,7 +69,7 @@ public void Given_Deserialize_DeleteDefenseDocumentResponse_Returns_Success() } [TestMethod] - public void Given_Deserialize_DefenseReasonsResponse_Returns_Not_Null() + public async Task Given_Deserialize_DefenseReasonsResponse_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/disputes/retrieve-applicable-defense-reasons.json"); @@ -91,7 +91,7 @@ public void Given_Deserialize_DefenseReasonsResponse_Returns_Not_Null() } [TestMethod] - public void Given_Deserialize_SupplyDefenceDocumentResponse_Returns_Success() + public async Task Given_Deserialize_SupplyDefenceDocumentResponse_Returns_Success() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/disputes/supply-dispute-defense-document.json"); diff --git a/Adyen.Test/Management/ManagementTest.cs b/Adyen.Test/Management/ManagementTest.cs index 7555a4bd9..c125d8cf6 100644 --- a/Adyen.Test/Management/ManagementTest.cs +++ b/Adyen.Test/Management/ManagementTest.cs @@ -29,7 +29,7 @@ public ManagementTest() } [TestMethod] - public void Given_Deserialize_When_MeApiCredential_Result_Return_Not_Null() + public async Task Given_Deserialize_When_MeApiCredential_Result_Return_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/management/me.json"); @@ -44,7 +44,7 @@ public void Given_Deserialize_When_MeApiCredential_Result_Return_Not_Null() } [TestMethod] - public void Given_Deserialize_When_ListMerchantResponse_Returns_Correct_Data() + public async Task Given_Deserialize_When_ListMerchantResponse_Returns_Correct_Data() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/management/list-merchant-accounts.json"); @@ -71,7 +71,7 @@ public async Task Given_Deserialize_When_UpdateResource_Returns_Data_String() } [TestMethod] - public void Given_Deserialize_When_ListTerminalsResponse_Returns_Not_Null() + public async Task Given_Deserialize_When_ListTerminalsResponse_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/management/list-terminals.json"); diff --git a/Adyen.Test/PaymentsApp/PaymentsAppServiceTest.cs b/Adyen.Test/PaymentsApp/PaymentsAppServiceTest.cs new file mode 100644 index 000000000..6e73390c7 --- /dev/null +++ b/Adyen.Test/PaymentsApp/PaymentsAppServiceTest.cs @@ -0,0 +1,60 @@ +using Adyen.Core.Options; +using Adyen.PaymentsApp.Client; +using Adyen.PaymentsApp.Models; +using Adyen.PaymentsApp.Extensions; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Text.Json; +using Adyen.PaymentsApp.Services; + +namespace Adyen.Test.PaymentsApp +{ + [TestClass] + public class PaymentsAppTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + private readonly IPaymentsAppService _paymentsAppService; + + public PaymentsAppTest() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigurePaymentsApp((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); + _paymentsAppService = host.Services.GetRequiredService(); + } + [TestMethod] + public async Task PaymentsAppServiceTESTUrlTest() + { + _paymentsAppService.RevokePaymentsAppAsync("{merchantId}", "{installationId}") + + var client = CreateMockForAdyenClientTest(new Config()); + client.SetEnvironment(Environment.Test, "companyUrl"); + var checkout = new PaymentsAppService(client); + checkout.RevokePaymentsAppAsync().GetAwaiter(); + + ClientInterfaceSubstitute.Received().RequestAsync("https://management-test.adyen.com/v1/merchants/{merchantId}/paymentsApps/{installationId}/revoke", + Arg.Any(), null, new HttpMethod("POST"), default); + } + + [TestMethod] + public void PaymentsAppServiceLIVEUrlTest() + { + var client = CreateMockForAdyenClientTest(new Config()); + client.SetEnvironment(Environment.Live, "companyUrl"); + var checkout = new PaymentsAppService(client); + checkout.RevokePaymentsAppAsync("{merchantId}", "{installationId}").GetAwaiter(); + + ClientInterfaceSubstitute.Received().RequestAsync("https://management-live.adyen.com/v1/merchants/{merchantId}/paymentsApps/{installationId}/revoke", + Arg.Any(), null, new HttpMethod("POST"), default); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/PaymentsAppServiceTest.cs b/Adyen.Test/PaymentsAppServiceTest.cs deleted file mode 100644 index b9b412296..000000000 --- a/Adyen.Test/PaymentsAppServiceTest.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Net.Http; -using Adyen.Model; -using Adyen.Service; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NSubstitute; -using Environment = Adyen.Model.Environment; - -namespace Adyen.Test -{ - [TestClass] - public class PaymentsAppServiceTest : BaseTest - { - [TestMethod] - public void PaymentsAppServiceTESTUrlTest() - { - var client = CreateMockForAdyenClientTest(new Config()); - client.SetEnvironment(Environment.Test, "companyUrl"); - var checkout = new PaymentsAppService(client); - checkout.RevokePaymentsAppAsync("{merchantId}", "{installationId}").GetAwaiter(); - - ClientInterfaceSubstitute.Received().RequestAsync("https://management-test.adyen.com/v1/merchants/{merchantId}/paymentsApps/{installationId}/revoke", - Arg.Any(), null, new HttpMethod("POST"), default); - } - - [TestMethod] - public void PaymentsAppServiceLIVEUrlTest() - { - var client = CreateMockForAdyenClientTest(new Config()); - client.SetEnvironment(Environment.Live, "companyUrl"); - var checkout = new PaymentsAppService(client); - checkout.RevokePaymentsAppAsync("{merchantId}", "{installationId}").GetAwaiter(); - - ClientInterfaceSubstitute.Received().RequestAsync("https://management-live.adyen.com/v1/merchants/{merchantId}/paymentsApps/{installationId}/revoke", - Arg.Any(), null, new HttpMethod("POST"), default); - } - } -} \ No newline at end of file diff --git a/Adyen.Test/Payout/PayoutTest.cs b/Adyen.Test/Payout/PayoutTest.cs index 894872a3a..ac764d4c0 100644 --- a/Adyen.Test/Payout/PayoutTest.cs +++ b/Adyen.Test/Payout/PayoutTest.cs @@ -30,7 +30,7 @@ public PayoutTest() } [TestMethod] - public void Given_Deserialize_When_StoreDetailAndSubmitThirdParty_Returns_Not_Null() + public async Task Given_Deserialize_When_StoreDetailAndSubmitThirdParty_Returns_Not_Null() { // Arrange string client = TestUtilities.GetTestFileContent("mocks/payout/storeDetailAndSubmitThirdParty-success.json"); @@ -46,7 +46,7 @@ public void Given_Deserialize_When_StoreDetailAndSubmitThirdParty_Returns_Not_Nu } [TestMethod] - public void Given_Deserialize_When_StoreDetail_Returns_Not_Null() + public async Task Given_Deserialize_When_StoreDetail_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/payout/storeDetail-success.json"); @@ -61,7 +61,7 @@ public void Given_Deserialize_When_StoreDetail_Returns_Not_Null() } [TestMethod] - public void Given_Deserialize_When_ConfirmThirdParty_Returns_Not_Null() + public async Task Given_Deserialize_When_ConfirmThirdParty_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/payout/modifyResponse-success.json"); @@ -75,7 +75,7 @@ public void Given_Deserialize_When_ConfirmThirdParty_Returns_Not_Null() } [TestMethod] - public void Given_Deserialize_When_SubmitThirdParty_Returns_Not_Null() + public async Task Given_Deserialize_When_SubmitThirdParty_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/payout/submitResponse-success.json"); @@ -91,7 +91,7 @@ public void Given_Deserialize_When_SubmitThirdParty_Returns_Not_Null() } [TestMethod] - public void Given_Deserialize_When_DeclineThirdParty_ModifyResponse_Then_Returns_Not_Null() + public async Task Given_Deserialize_When_DeclineThirdParty_ModifyResponse_Then_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/payout/modifyResponse-success.json"); @@ -105,7 +105,7 @@ public void Given_Deserialize_When_DeclineThirdParty_ModifyResponse_Then_Returns } [TestMethod] - public void PayoutSuccessTest() + public async Task PayoutSuccessTest() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/payout/payout-success.json"); diff --git a/Adyen.Test/PosTerminalManagement/PosTerminalManagementTest.cs b/Adyen.Test/PosTerminalManagement/PosTerminalManagementTest.cs index fcfb566ee..faadcca2a 100644 --- a/Adyen.Test/PosTerminalManagement/PosTerminalManagementTest.cs +++ b/Adyen.Test/PosTerminalManagement/PosTerminalManagementTest.cs @@ -30,7 +30,7 @@ public PosTerminalManagementTest() } [TestMethod] - public void Given_Deserialize_When_FindTerminal_Result_Not_Null() + public async Task Given_Deserialize_When_FindTerminal_Result_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/pos-terminal-management/find-terminals-success.json"); @@ -47,7 +47,7 @@ public void Given_Deserialize_When_FindTerminal_Result_Not_Null() } [TestMethod] - public void Given_Deserialize_When_AssignTerminals_Result_Not_Null() + public async Task Given_Deserialize_When_AssignTerminals_Result_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/pos-terminal-management/assigning-terminals-success.json"); @@ -61,7 +61,7 @@ public void Given_Deserialize_When_AssignTerminals_Result_Not_Null() } [TestMethod] - public void Given_Deserialize_When_GetTerminalsUnderAccount_Result_Not_Null() + public async Task Given_Deserialize_When_GetTerminalsUnderAccount_Result_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/pos-terminal-management/get-terminals-under-account-success.json"); @@ -87,7 +87,7 @@ public void Given_Deserialize_When_GetTerminalsUnderAccount_Result_Not_Null() } [TestMethod] - public void Given_Deserialize_When_GetTerminalDetails_Result_Not_Null() + public async Task Given_Deserialize_When_GetTerminalDetails_Result_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/pos-terminal-management/get-terminal-details-success.json"); @@ -110,7 +110,7 @@ public void Given_Deserialize_When_GetTerminalDetails_Result_Not_Null() } [TestMethod] - public void Given_Deserialize_When_GetStoresUnderAccount_Result_Not_Null() + public async Task Given_Deserialize_When_GetStoresUnderAccount_Result_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/pos-terminal-management/get-stores-under-account-success.json"); @@ -123,7 +123,6 @@ public void Given_Deserialize_When_GetStoresUnderAccount_Result_Not_Null() Assert.AreEqual(response.Stores[0].VarStore, "YOUR_STORE"); Assert.AreEqual(response.Stores[0].Description, "YOUR_STORE"); Assert.AreEqual(response.Stores[0].Status, "Active"); - } } } diff --git a/Adyen.Test/Recurring/RecurringTest.cs b/Adyen.Test/Recurring/RecurringTest.cs index de3ef2ebe..c642b98df 100644 --- a/Adyen.Test/Recurring/RecurringTest.cs +++ b/Adyen.Test/Recurring/RecurringTest.cs @@ -30,7 +30,7 @@ public RecurringTest() } [TestMethod] - public void Given_Deserialize_When_ListRecurringDetails_Result_Returns_Not_Null() + public async Task Given_Deserialize_When_ListRecurringDetails_Result_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/recurring/listRecurringDetails-success.json"); @@ -51,7 +51,7 @@ public void Given_Deserialize_When_ListRecurringDetails_Result_Returns_Not_Null( } [TestMethod] - public void Given_Deserialize_When_Disable_Result_Returns_Not_Null() + public async Task Given_Deserialize_When_Disable_Result_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/recurring/disable-success.json"); @@ -64,7 +64,7 @@ public void Given_Deserialize_When_Disable_Result_Returns_Not_Null() } [TestMethod] - public void Given_Deserialize_When_NotifyShopper_Result_Returns_Not_Null() + public async Task Given_Deserialize_When_NotifyShopper_Result_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/recurring/notifyShopper-success.json"); @@ -82,7 +82,7 @@ public void Given_Deserialize_When_NotifyShopper_Result_Returns_Not_Null() } [TestMethod] - public void Given_Deserialize_When_CreatePermit_Result_Returns_Not_Null() + public async Task Given_Deserialize_When_CreatePermit_Result_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/recurring/createPermit-success.json"); @@ -96,7 +96,7 @@ public void Given_Deserialize_When_CreatePermit_Result_Returns_Not_Null() } [TestMethod] - public void Given_Deserialize_When_DisablePermit_Result_Returns_Not_Null() + public async Task Given_Deserialize_When_DisablePermit_Result_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/recurring/disablePermit-success.json"); @@ -110,7 +110,7 @@ public void Given_Deserialize_When_DisablePermit_Result_Returns_Not_Null() } [TestMethod] - public void Given_Deserialize_When_ScheduleAccountUpdater_Result_Returns_Not_Null() + public async Task Given_Deserialize_When_ScheduleAccountUpdater_Result_Returns_Not_Null() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/recurring/scheduleAccountUpdater-success.json"); diff --git a/Adyen.Test/BaseTest.cs b/Adyen.Test/TerminalApi/BaseTest.cs similarity index 97% rename from Adyen.Test/BaseTest.cs rename to Adyen.Test/TerminalApi/BaseTest.cs index f9e195846..01087ad5a 100644 --- a/Adyen.Test/BaseTest.cs +++ b/Adyen.Test/TerminalApi/BaseTest.cs @@ -1,439 +1,439 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Net.Http; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Adyen.Constants; -using Adyen.HttpClient.Interfaces; -using Adyen.Model; -using Adyen.Model.TerminalApi; -using Adyen.Model.Payment; -using Adyen.Service; -using NSubstitute; -using Amount = Adyen.Model.Checkout; -using Environment = System.Environment; -using PaymentResult = Adyen.Model.Payment.PaymentResult; - -namespace Adyen.Test -{ - public class BaseTest - { - private protected IClient ClientInterfaceSubstitute; - - #region Payment request - /// - /// Payment with basic authentication - /// - /// - /// - protected PaymentResult CreatePaymentResultFromFile(string fileName) - { - var client = CreateMockTestClientApiKeyBasedRequestAsync(fileName); - var payment = new PaymentService(client); - var paymentRequest = MockPaymentData.CreateFullPaymentRequest(); - var paymentResult = payment.Authorise(paymentRequest); - return paymentResult; - } - - protected PaymentResult CreatePaymentApiKeyBasedResultFromFile(string fileName) - { - var client = CreateMockTestClientApiKeyBasedRequestAsync(fileName); - var payment = new PaymentService(client); - var paymentRequest = MockPaymentData.CreateFullPaymentRequest(); - - var paymentResult = payment.Authorise(paymentRequest); - return paymentResult; - } - #endregion - - #region Modification objects - - protected CaptureRequest CreateCaptureTestRequest(string pspReference) - { - var captureRequest = new CaptureRequest - { - MerchantAccount = "MerchantAccount", - ModificationAmount = new Model.Payment.Amount("EUR", 150), - Reference = "capture - " + DateTime.Now.ToString("yyyyMMdd"), - OriginalReference = pspReference, - AdditionalData = new Dictionary {{"authorisationType", "PreAuth"}} - }; - return captureRequest; - } - - - protected CancelOrRefundRequest CreateCancelOrRefundTestRequest(string pspReference) - { - var cancelOrRefundRequest = new CancelOrRefundRequest - { - MerchantAccount = "MerchantAccount", - Reference = "cancelOrRefund - " + DateTime.Now.ToString("yyyyMMdd"), - OriginalReference = pspReference - }; - return cancelOrRefundRequest; - } - - protected RefundRequest CreateRefundTestRequest(string pspReference) - { - var refundRequest = new RefundRequest - { - MerchantAccount = "MerchantAccount", - ModificationAmount = new Model.Payment.Amount("EUR", 150), - Reference = "refund - " + DateTime.Now.ToString("yyyyMMdd"), - OriginalReference = pspReference - }; - return refundRequest; - } - - protected CancelRequest CreateCancelTestRequest(string pspReference) - { - var cancelRequest = new CancelRequest - { - MerchantAccount = "MerchantAccount", - Reference = "cancel - " + DateTime.Now.ToString("yyyyMMdd"), - OriginalReference = pspReference - }; - return cancelRequest; - } - - protected AdjustAuthorisationRequest CreateAdjustAuthorisationRequest(string pspReference) - { - var adjustAuthorisationRequest = new AdjustAuthorisationRequest - { - MerchantAccount = "MerchantAccount", - ModificationAmount = new Model.Payment.Amount("EUR", 150), - Reference = "adjustAuthorisationRequest - " + DateTime.Now.ToString("yyyyMMdd"), - OriginalReference = pspReference, - }; - return adjustAuthorisationRequest; - } - #endregion - - #region Checkout - /// - /// Check out payment request - /// - /// - /// - public Model.Checkout.PaymentRequest CreatePaymentRequestCheckout() - { - var amount = new Model.Checkout.Amount("USD", 1000); - var paymentsRequest = new Model.Checkout.PaymentRequest - { - Reference = "Your order number ", - ReturnUrl = @"https://your-company.com/...", - MerchantAccount = "MerchantAccount", - CaptureDelayHours = 0 - }; - var cardDetails = new Amount.CardDetails - { - Number = "4111111111111111", - ExpiryMonth = "10", - ExpiryYear = "2020", - HolderName = "John Smith" - }; - paymentsRequest.Amount = amount; - paymentsRequest.PaymentMethod = new Amount.CheckoutPaymentMethod(cardDetails); - paymentsRequest.ApplicationInfo = new Model.Checkout.ApplicationInfo(adyenLibrary: new Amount.CommonField()); - return paymentsRequest; - } - - - /// - /// 3DS2 payments request - /// - /// - public Model.Checkout.PaymentRequest CreatePaymentRequest3DS2() - { - var amount = new Model.Checkout.Amount("USD", 1000); - var paymentsRequest = new Model.Checkout.PaymentRequest - { - Reference = "Your order number ", - Amount = amount, - ReturnUrl = @"https://your-company.com/...", - MerchantAccount = "MerchantAccount", - Channel = Model.Checkout.PaymentRequest.ChannelEnum.Web - }; - var cardDetails = new Amount.CardDetails - { - Number = "4111111111111111", - ExpiryMonth = "10", - ExpiryYear = "2020", - HolderName = "John Smith" - }; - paymentsRequest.PaymentMethod = new Amount.CheckoutPaymentMethod(cardDetails); - return paymentsRequest; - } - - /// - ///Checkout Details request - /// - /// Returns a sample PaymentsDetailsRequest object with test data - protected Amount.PaymentDetailsRequest CreateDetailsRequest() - { - var paymentData = "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj..."; - var details = new Amount.PaymentCompletionDetails - { - MD= "sdfsdfsdf...", - PaReq = "sdfsdfsdf..." - }; - var paymentsDetailsRequest = new Amount.PaymentDetailsRequest(details: details, paymentData: paymentData); - - return paymentsDetailsRequest; - } - - /// - /// Checkout paymentMethodsRequest - /// - /// - protected Amount.PaymentMethodsRequest CreatePaymentMethodRequest(string merchantAccount) - { - return new Amount.PaymentMethodsRequest(merchantAccount: merchantAccount); - } - - #endregion - - /// - /// Creates mock test client without any response - /// - /// IClient implementation - protected Client CreateMockForAdyenClientTest(Config config) - { - //Create a mock interface - ClientInterfaceSubstitute = Substitute.For(); - - ClientInterfaceSubstitute.RequestAsync(Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any()).Returns(Task.FromResult("")); - - var clientMock = new Client(config) - { - HttpClient = ClientInterfaceSubstitute, - Config = config - }; - return clientMock; - } - - /// - /// Creates mock test client - /// - /// The file that is returned - /// IClient implementation - protected Client CreateMockTestClientRequest(string fileName) - { - var mockPath = GetMockFilePath(fileName); - var response = MockFileToString(mockPath); - - ClientInterfaceSubstitute = Substitute.For(); - - ClientInterfaceSubstitute.RequestAsync(Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any()).Returns(response); - - var config = new Config - { - Environment = Model.Environment.Test - }; - var clientMock = new Client(config) - { - HttpClient = ClientInterfaceSubstitute, - Config = new Config - { - Username = "Username", - Password = "Password", - ApplicationName = "Appname" - } - }; - return clientMock; - } - - /// - /// Creates mock test client - /// - /// The file that is returned - /// IClient implementation - protected Client CreateMockTestClientApiKeyBasedRequestAsync(string fileName) - { - var mockPath = GetMockFilePath(fileName); - var response = MockFileToString(mockPath); - //Create a mock interface - ClientInterfaceSubstitute = Substitute.For(); - - ClientInterfaceSubstitute.RequestAsync(Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any()).Returns(response); - var config = new Config - { - Environment = Model.Environment.Test - }; - var clientMock = new Client(config) - { - HttpClient = ClientInterfaceSubstitute, - Config = new Config - { - Username = "Username", - Password = "Password", - ApplicationName = "Appname" - } - }; - return clientMock; - } - - /// - /// Creates async mock test client - /// - /// The file that is returned - /// IClient implementation - protected Client CreateAsyncMockTestClientApiKeyBasedRequest(string fileName) - { - var mockPath = GetMockFilePath(fileName); - var response = MockFileToString(mockPath); - - var configWithApiKey = new Config - { - Environment = Model.Environment.Test, - XApiKey = "AQEyhmfxK....LAG84XwzP5pSpVd" - }; - - ClientInterfaceSubstitute = Substitute.For(); - - ClientInterfaceSubstitute.RequestAsync(Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any(), - Arg.Any()).Returns(response); - - var config = new Config - { - Environment = Model.Environment.Test - }; - var clientMock = new Client(config) - { - HttpClient = ClientInterfaceSubstitute, - Config = configWithApiKey - }; - return clientMock; - } - - /// - /// Creates mock test client for POS cloud. In case of cloud api the xapi should be included - /// - /// The file that is returned - /// IClient implementation - protected Client CreateMockTestClientPosCloudApiRequest(string fileName) - { - var config = new Config { CloudApiEndPoint = ClientConfig.CloudApiEndPointTest }; - var mockPath = GetMockFilePath(fileName); - var response = MockFileToString(mockPath); - - //Create a mock interface - ClientInterfaceSubstitute = Substitute.For(); - - ClientInterfaceSubstitute.Request(Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()).Returns(response); - - ClientInterfaceSubstitute.RequestAsync(Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()).Returns(Task.FromResult(response)); - - var anyConfig = new Config - { - Environment = Model.Environment.Test - }; - var clientMock = new Client(anyConfig) - { - HttpClient = ClientInterfaceSubstitute, - Config = config - }; - return clientMock; - } - - /// - /// Creates mock test client for terminal api. - /// - /// The file that is returned - /// IClient implementation - protected Client CreateMockTestClientPosLocalApiRequest(string fileName) - { - var config = new Config - { - Environment = Model.Environment.Test, - LocalTerminalApiEndpoint = @"https://_terminal_:8443/nexo/" - }; - var mockPath = GetMockFilePath(fileName); - var response = MockFileToString(mockPath); - //Create a mock interface - ClientInterfaceSubstitute = Substitute.For(); - - ClientInterfaceSubstitute.Request(Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()).Returns(response); - - ClientInterfaceSubstitute.RequestAsync(Arg.Any(), - Arg.Any(), Arg.Any(), Arg.Any()).Returns(Task.FromResult(response)); - - - var anyConfig = new Config - { - Environment = Model.Environment.Test - }; - var clientMock = new Client(anyConfig) - { - HttpClient = ClientInterfaceSubstitute, - Config = config - }; - return clientMock; - } - - protected string MockFileToString(string fileName) - { - string text = ""; - - if (String.IsNullOrEmpty(fileName)) - { - return text; - } - try - { - using (var streamReader = new StreamReader(fileName, Encoding.UTF8)) - { - text = streamReader.ReadToEnd(); - } - } - catch (Exception exception) - { - throw exception; - } - - return text; - } - - /// - /// Create dummy Nexo message header - /// - /// - protected MessageHeader MockNexoMessageHeaderRequest() - { - var header = new MessageHeader - { - MessageType = MessageType.Request, - MessageClass = MessageClassType.Service, - MessageCategory = MessageCategoryType.Payment, - SaleID = "POSSystemID12345", - POIID = "MX915-284251016", - - ServiceID = (new Random()).Next(1, 9999).ToString() - }; - return header; - } - - protected static string GetMockFilePath(string fileName) - { - if (string.IsNullOrEmpty(fileName)) - { - return ""; - } - var projectPath = Directory.GetParent(Environment.CurrentDirectory).Parent.Parent.FullName; - var mockPath = Path.Combine(projectPath, fileName); - return mockPath; - } - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Net.Http; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Adyen.Constants; +using Adyen.HttpClient.Interfaces; +using Adyen.Model; +using Adyen.Model.TerminalApi; +using Adyen.Model.Payment; +using Adyen.Service; +using NSubstitute; +using Amount = Adyen.Model.Checkout; +using Environment = System.Environment; +using PaymentResult = Adyen.Model.Payment.PaymentResult; + +namespace Adyen.Test +{ + public class BaseTest + { + private protected IClient ClientInterfaceSubstitute; + + #region Payment request + /// + /// Payment with basic authentication + /// + /// + /// + protected PaymentResult CreatePaymentResultFromFile(string fileName) + { + var client = CreateMockTestClientApiKeyBasedRequestAsync(fileName); + var payment = new PaymentService(client); + var paymentRequest = MockPaymentData.CreateFullPaymentRequest(); + var paymentResult = payment.Authorise(paymentRequest); + return paymentResult; + } + + protected PaymentResult CreatePaymentApiKeyBasedResultFromFile(string fileName) + { + var client = CreateMockTestClientApiKeyBasedRequestAsync(fileName); + var payment = new PaymentService(client); + var paymentRequest = MockPaymentData.CreateFullPaymentRequest(); + + var paymentResult = payment.Authorise(paymentRequest); + return paymentResult; + } + #endregion + + #region Modification objects + + protected CaptureRequest CreateCaptureTestRequest(string pspReference) + { + var captureRequest = new CaptureRequest + { + MerchantAccount = "MerchantAccount", + ModificationAmount = new Model.Payment.Amount("EUR", 150), + Reference = "capture - " + DateTime.Now.ToString("yyyyMMdd"), + OriginalReference = pspReference, + AdditionalData = new Dictionary {{"authorisationType", "PreAuth"}} + }; + return captureRequest; + } + + + protected CancelOrRefundRequest CreateCancelOrRefundTestRequest(string pspReference) + { + var cancelOrRefundRequest = new CancelOrRefundRequest + { + MerchantAccount = "MerchantAccount", + Reference = "cancelOrRefund - " + DateTime.Now.ToString("yyyyMMdd"), + OriginalReference = pspReference + }; + return cancelOrRefundRequest; + } + + protected RefundRequest CreateRefundTestRequest(string pspReference) + { + var refundRequest = new RefundRequest + { + MerchantAccount = "MerchantAccount", + ModificationAmount = new Model.Payment.Amount("EUR", 150), + Reference = "refund - " + DateTime.Now.ToString("yyyyMMdd"), + OriginalReference = pspReference + }; + return refundRequest; + } + + protected CancelRequest CreateCancelTestRequest(string pspReference) + { + var cancelRequest = new CancelRequest + { + MerchantAccount = "MerchantAccount", + Reference = "cancel - " + DateTime.Now.ToString("yyyyMMdd"), + OriginalReference = pspReference + }; + return cancelRequest; + } + + protected AdjustAuthorisationRequest CreateAdjustAuthorisationRequest(string pspReference) + { + var adjustAuthorisationRequest = new AdjustAuthorisationRequest + { + MerchantAccount = "MerchantAccount", + ModificationAmount = new Model.Payment.Amount("EUR", 150), + Reference = "adjustAuthorisationRequest - " + DateTime.Now.ToString("yyyyMMdd"), + OriginalReference = pspReference, + }; + return adjustAuthorisationRequest; + } + #endregion + + #region Checkout + /// + /// Check out payment request + /// + /// + /// + public Model.Checkout.PaymentRequest CreatePaymentRequestCheckout() + { + var amount = new Model.Checkout.Amount("USD", 1000); + var paymentsRequest = new Model.Checkout.PaymentRequest + { + Reference = "Your order number ", + ReturnUrl = @"https://your-company.com/...", + MerchantAccount = "MerchantAccount", + CaptureDelayHours = 0 + }; + var cardDetails = new Amount.CardDetails + { + Number = "4111111111111111", + ExpiryMonth = "10", + ExpiryYear = "2020", + HolderName = "John Smith" + }; + paymentsRequest.Amount = amount; + paymentsRequest.PaymentMethod = new Amount.CheckoutPaymentMethod(cardDetails); + paymentsRequest.ApplicationInfo = new Model.Checkout.ApplicationInfo(adyenLibrary: new Amount.CommonField()); + return paymentsRequest; + } + + + /// + /// 3DS2 payments request + /// + /// + public Model.Checkout.PaymentRequest CreatePaymentRequest3DS2() + { + var amount = new Model.Checkout.Amount("USD", 1000); + var paymentsRequest = new Model.Checkout.PaymentRequest + { + Reference = "Your order number ", + Amount = amount, + ReturnUrl = @"https://your-company.com/...", + MerchantAccount = "MerchantAccount", + Channel = Model.Checkout.PaymentRequest.ChannelEnum.Web + }; + var cardDetails = new Amount.CardDetails + { + Number = "4111111111111111", + ExpiryMonth = "10", + ExpiryYear = "2020", + HolderName = "John Smith" + }; + paymentsRequest.PaymentMethod = new Amount.CheckoutPaymentMethod(cardDetails); + return paymentsRequest; + } + + /// + ///Checkout Details request + /// + /// Returns a sample PaymentsDetailsRequest object with test data + protected Amount.PaymentDetailsRequest CreateDetailsRequest() + { + var paymentData = "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj..."; + var details = new Amount.PaymentCompletionDetails + { + MD= "sdfsdfsdf...", + PaReq = "sdfsdfsdf..." + }; + var paymentsDetailsRequest = new Amount.PaymentDetailsRequest(details: details, paymentData: paymentData); + + return paymentsDetailsRequest; + } + + /// + /// Checkout paymentMethodsRequest + /// + /// + protected Amount.PaymentMethodsRequest CreatePaymentMethodRequest(string merchantAccount) + { + return new Amount.PaymentMethodsRequest(merchantAccount: merchantAccount); + } + + #endregion + + /// + /// Creates mock test client without any response + /// + /// IClient implementation + protected Client CreateMockForAdyenClientTest(Config config) + { + //Create a mock interface + ClientInterfaceSubstitute = Substitute.For(); + + ClientInterfaceSubstitute.RequestAsync(Arg.Any(), + Arg.Any(), Arg.Any(), Arg.Any(), + Arg.Any()).Returns(Task.FromResult("")); + + var clientMock = new Client(config) + { + HttpClient = ClientInterfaceSubstitute, + Config = config + }; + return clientMock; + } + + /// + /// Creates mock test client + /// + /// The file that is returned + /// IClient implementation + protected Client CreateMockTestClientRequest(string fileName) + { + var mockPath = GetMockFilePath(fileName); + var response = MockFileToString(mockPath); + + ClientInterfaceSubstitute = Substitute.For(); + + ClientInterfaceSubstitute.RequestAsync(Arg.Any(), + Arg.Any(), Arg.Any(), Arg.Any(), + Arg.Any()).Returns(response); + + var config = new Config + { + Environment = Model.Environment.Test + }; + var clientMock = new Client(config) + { + HttpClient = ClientInterfaceSubstitute, + Config = new Config + { + Username = "Username", + Password = "Password", + ApplicationName = "Appname" + } + }; + return clientMock; + } + + /// + /// Creates mock test client + /// + /// The file that is returned + /// IClient implementation + protected Client CreateMockTestClientApiKeyBasedRequestAsync(string fileName) + { + var mockPath = GetMockFilePath(fileName); + var response = MockFileToString(mockPath); + //Create a mock interface + ClientInterfaceSubstitute = Substitute.For(); + + ClientInterfaceSubstitute.RequestAsync(Arg.Any(), + Arg.Any(), Arg.Any(), Arg.Any(), + Arg.Any()).Returns(response); + var config = new Config + { + Environment = Model.Environment.Test + }; + var clientMock = new Client(config) + { + HttpClient = ClientInterfaceSubstitute, + Config = new Config + { + Username = "Username", + Password = "Password", + ApplicationName = "Appname" + } + }; + return clientMock; + } + + /// + /// Creates async mock test client + /// + /// The file that is returned + /// IClient implementation + protected Client CreateAsyncMockTestClientApiKeyBasedRequest(string fileName) + { + var mockPath = GetMockFilePath(fileName); + var response = MockFileToString(mockPath); + + var configWithApiKey = new Config + { + Environment = Model.Environment.Test, + XApiKey = "AQEyhmfxK....LAG84XwzP5pSpVd" + }; + + ClientInterfaceSubstitute = Substitute.For(); + + ClientInterfaceSubstitute.RequestAsync(Arg.Any(), + Arg.Any(), Arg.Any(), Arg.Any(), + Arg.Any()).Returns(response); + + var config = new Config + { + Environment = Model.Environment.Test + }; + var clientMock = new Client(config) + { + HttpClient = ClientInterfaceSubstitute, + Config = configWithApiKey + }; + return clientMock; + } + + /// + /// Creates mock test client for POS cloud. In case of cloud api the xapi should be included + /// + /// The file that is returned + /// IClient implementation + protected Client CreateMockTestClientPosCloudApiRequest(string fileName) + { + var config = new Config { CloudApiEndPoint = ClientConfig.CloudApiEndPointTest }; + var mockPath = GetMockFilePath(fileName); + var response = MockFileToString(mockPath); + + //Create a mock interface + ClientInterfaceSubstitute = Substitute.For(); + + ClientInterfaceSubstitute.Request(Arg.Any(), + Arg.Any(), Arg.Any(), Arg.Any()).Returns(response); + + ClientInterfaceSubstitute.RequestAsync(Arg.Any(), + Arg.Any(), Arg.Any(), Arg.Any()).Returns(Task.FromResult(response)); + + var anyConfig = new Config + { + Environment = Model.Environment.Test + }; + var clientMock = new Client(anyConfig) + { + HttpClient = ClientInterfaceSubstitute, + Config = config + }; + return clientMock; + } + + /// + /// Creates mock test client for terminal api. + /// + /// The file that is returned + /// IClient implementation + protected Client CreateMockTestClientPosLocalApiRequest(string fileName) + { + var config = new Config + { + Environment = Model.Environment.Test, + LocalTerminalApiEndpoint = @"https://_terminal_:8443/nexo/" + }; + var mockPath = GetMockFilePath(fileName); + var response = MockFileToString(mockPath); + //Create a mock interface + ClientInterfaceSubstitute = Substitute.For(); + + ClientInterfaceSubstitute.Request(Arg.Any(), + Arg.Any(), Arg.Any(), Arg.Any()).Returns(response); + + ClientInterfaceSubstitute.RequestAsync(Arg.Any(), + Arg.Any(), Arg.Any(), Arg.Any()).Returns(Task.FromResult(response)); + + + var anyConfig = new Config + { + Environment = Model.Environment.Test + }; + var clientMock = new Client(anyConfig) + { + HttpClient = ClientInterfaceSubstitute, + Config = config + }; + return clientMock; + } + + protected string MockFileToString(string fileName) + { + string text = ""; + + if (String.IsNullOrEmpty(fileName)) + { + return text; + } + try + { + using (var streamReader = new StreamReader(fileName, Encoding.UTF8)) + { + text = streamReader.ReadToEnd(); + } + } + catch (Exception exception) + { + throw exception; + } + + return text; + } + + /// + /// Create dummy Nexo message header + /// + /// + protected MessageHeader MockNexoMessageHeaderRequest() + { + var header = new MessageHeader + { + MessageType = MessageType.Request, + MessageClass = MessageClassType.Service, + MessageCategory = MessageCategoryType.Payment, + SaleID = "POSSystemID12345", + POIID = "MX915-284251016", + + ServiceID = (new Random()).Next(1, 9999).ToString() + }; + return header; + } + + protected static string GetMockFilePath(string fileName) + { + if (string.IsNullOrEmpty(fileName)) + { + return ""; + } + var projectPath = Directory.GetParent(Environment.CurrentDirectory).Parent.Parent.FullName; + var mockPath = Path.Combine(projectPath, fileName); + return mockPath; + } + } +} diff --git a/Adyen.Test/NotificationDecryptionTest.cs b/Adyen.Test/TerminalApi/NotificationDecryptionTest.cs similarity index 100% rename from Adyen.Test/NotificationDecryptionTest.cs rename to Adyen.Test/TerminalApi/NotificationDecryptionTest.cs diff --git a/Adyen.Test/UtilTest.cs b/Adyen.Test/UtilTest.cs deleted file mode 100644 index 9384873d3..000000000 --- a/Adyen.Test/UtilTest.cs +++ /dev/null @@ -1,212 +0,0 @@ -// using System.Collections.Generic; -// using Adyen.Model.Notification; -// using Adyen.Model.Payment; -// using Adyen.Util; -// using Adyen.Util.TerminalApi; -// using Microsoft.VisualStudio.TestTools.UnitTesting; -// using Newtonsoft.Json; -// -// namespace Adyen.Test -// { -// [TestClass] -// public class UtilTest : BaseTest -// { -// [TestMethod] -// public void TestHmac() -// { -// var data = "countryCode:currencyCode:merchantAccount:merchantReference:paymentAmount:sessionValidity:skinCode:NL:EUR:MagentoMerchantTest2:TEST-PAYMENT-2017-02-01-14\\:02\\:05:199:2017-02-02T14\\:02\\:05+01\\:00:PKz2KML1"; -// var hmacKey = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00"; -// var hmacValidator = new HmacValidator(); -// var hmacSignature = hmacValidator.CalculateHmac(data, hmacKey); -// Assert.IsTrue(string.Equals(hmacSignature, "34oR8T1whkQWTv9P+SzKyp8zhusf9n0dpqrm9nsqSJs=")); -// } -// -// [TestMethod] -// public void TestBalancePlatformHmac() -// { -// var notification = -// "{\"data\":{\"balancePlatform\":\"Integration_tools_test\",\"accountId\":\"BA32272223222H5HVKTBK4MLB\",\"sweep\":{\"id\":\"SWPC42272223222H5HVKV6H8C64DP5\",\"schedule\":{\"type\":\"balance\"},\"status\":\"active\",\"targetAmount\":{\"currency\":\"EUR\",\"value\":0},\"triggerAmount\":{\"currency\":\"EUR\",\"value\":0},\"type\":\"pull\",\"counterparty\":{\"balanceAccountId\":\"BA3227C223222H5HVKT3H9WLC\"},\"currency\":\"EUR\"}},\"environment\":\"test\",\"type\":\"balancePlatform.balanceAccountSweep.updated\"}"; -// var hmacKey = "D7DD5BA6146493707BF0BE7496F6404EC7A63616B7158EC927B9F54BB436765F"; -// var hmacSignature = "9Qz9S/0xpar1klkniKdshxpAhRKbiSAewPpWoxKefQA="; -// var hmacValidator = new HmacValidator(); -// bool response = hmacValidator.IsValidWebhook(hmacSignature, hmacKey, notification); -// Assert.IsTrue(response); -// } -// -// [TestMethod] -// public void TestSerializationShopperInteractionDefaultIsZero() -// { -// var paymentRequest = MockPaymentData.CreateFullPaymentRequestWithShopperInteraction(default); -// var serializedPaymentRequest = paymentRequest.ToJson(); -// Assert.IsTrue(serializedPaymentRequest.Contains("\"shopperInteraction\": 0,")); -// } -// -// [TestMethod] -// public void TestNotificationRequestItemHmac() -// { -// var hmacKey = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00"; -// var expectedSign = "ipnxGCaUZ4l8TUW75a71/ghd2Fe5ffvX0pV4TLTntIc="; -// var additionalData = new Dictionary -// { -// { "hmacSignature", expectedSign } -// }; -// var notificationRequestItem = new NotificationRequestItem -// { -// PspReference = "pspReference", -// OriginalReference = "originalReference", -// MerchantAccountCode = "merchantAccount", -// MerchantReference = "reference", -// Amount = new Model.Checkout.Amount("EUR", 1000), -// EventCode = "EVENT", -// Success = true, -// AdditionalData = additionalData -// }; -// var hmacValidator = new HmacValidator(); -// var data = hmacValidator.GetDataToSign(notificationRequestItem); -// Assert.AreEqual("pspReference:originalReference:merchantAccount:reference:1000:EUR:EVENT:true", data); -// var encrypted = hmacValidator.CalculateHmac(notificationRequestItem, hmacKey); -// Assert.AreEqual(expectedSign, encrypted); -// Assert.IsTrue(hmacValidator.IsValidHmac(notificationRequestItem, hmacKey)); -// notificationRequestItem.AdditionalData["hmacSignature"] = "notValidSign"; -// Assert.IsFalse(hmacValidator.IsValidHmac(notificationRequestItem, hmacKey)); -// } -// -// [TestMethod] -// public void TestHmacCalculationNotificationRequestWithSpecialChars() -// { -// string hmacKey = "66B61474A0AA3736BA8789EDC6D6CD9EBA0C4F414A554E32A407F849C045C69D"; -// var mockPath = GetMockFilePath("mocks/notification-response-refund-fail.json"); -// var response = MockFileToString(mockPath); -// var hmacValidator = new HmacValidator(); -// var notificationRequest = JsonOperation.Deserialize(response); -// var notificationItem = notificationRequest.NotificationItemContainers[0].NotificationItem; -// var isValidHmac = hmacValidator.IsValidHmac(notificationItem, hmacKey); -// Assert.IsTrue(isValidHmac); -// } -// -// [TestMethod] -// public void TestSerializationShopperInteractionMoto() -// { -// var paymentRequest = MockPaymentData.CreateFullPaymentRequestWithShopperInteraction(PaymentRequest.ShopperInteractionEnum.Moto); -// var serializedPaymentRequest = JsonOperation.SerializeRequest(paymentRequest); -// StringAssert.Contains(serializedPaymentRequest, nameof(PaymentRequest.ShopperInteractionEnum.Moto)); -// } -// -// [TestMethod] -// public void TestNullHmacValidator() -// { -// var hmacValidator = new HmacValidator(); -// var notificationRequestItem = new NotificationRequestItem -// { -// PspReference = "pspReference", -// OriginalReference = "originalReference", -// MerchantAccountCode = "merchantAccount", -// MerchantReference = "reference", -// Amount = new Model.Checkout.Amount("EUR", 1000), -// EventCode = "EVENT", -// Success = true, -// AdditionalData = null -// }; -// var isValidHmacAdditionalDataNull = hmacValidator.IsValidHmac(notificationRequestItem, "hmacKey"); -// Assert.IsFalse(isValidHmacAdditionalDataNull); -// notificationRequestItem.AdditionalData = new Dictionary(); -// var isValidHmacAdditionalDataEmpty = hmacValidator.IsValidHmac(notificationRequestItem, "hmacKey"); -// Assert.IsFalse(isValidHmacAdditionalDataEmpty); -// } -// -// [TestMethod] -// public void TestColonAndBackslashHmacValidator() -// { -// var hmacValidator = new HmacValidator(); -// var jsonNotification = @"{ -// 'additionalData': { -// 'acquirerCode': 'TestPmmAcquirer', -// 'acquirerReference': 'J8DXDJ2PV6P', -// 'authCode': '052095', -// 'avsResult': '5 No AVS data provided', -// 'avsResultRaw': '5', -// 'cardSummary': '1111', -// 'checkout.cardAddedBrand': 'visa', -// 'cvcResult': '1 Matches', -// 'cvcResultRaw': 'M', -// 'expiryDate': '03/2030', -// 'hmacSignature': 'CZErGCNQaSsxbaQfZaJlakqo7KPP+mIa8a+wx3yNs9A=', -// 'paymentMethod': 'visa', -// 'refusalReasonRaw': 'AUTHORISED', -// 'retry.attempt1.acquirer': 'TestPmmAcquirer', -// 'retry.attempt1.acquirerAccount': 'TestPmmAcquirerAccount', -// 'retry.attempt1.avsResultRaw': '5', -// 'retry.attempt1.rawResponse': 'AUTHORISED', -// 'retry.attempt1.responseCode': 'Approved', -// 'retry.attempt1.scaExemptionRequested': 'lowValue', -// 'scaExemptionRequested': 'lowValue' -// }, -// 'amount': { -// 'currency': 'EUR', -// 'value': 1000 -// }, -// 'eventCode': 'AUTHORISATION', -// 'eventDate': '2023-01-10T13:42:29+01:00', -// 'merchantAccountCode': 'AntoniStroinski', -// 'merchantReference': '\\:/\\/slashes are fun', -// 'operations': [ -// 'CANCEL', -// 'CAPTURE', -// 'REFUND' -// ], -// 'paymentMethod': 'visa', -// 'pspReference': 'ZVWN7D3WSMK2WN82', -// 'reason': '052095:1111:03/2030', -// 'success': 'true' -// }"; -// var notificationRequestItem = JsonConvert.DeserializeObject(jsonNotification); -// var isValidHmac = hmacValidator.IsValidHmac(notificationRequestItem, "74F490DD33F7327BAECC88B2947C011FC02D014A473AAA33A8EC93E4DC069174"); -// Assert.IsTrue(isValidHmac); -// } -// -// [TestMethod] -// public void TestCardAcquisitionAdditionalResponse() -// { -// string jsonString = @"{ -// ""additionalData"": { -// ""PaymentAccountReference"": ""Yv6zs1234567890ASDFGHJKL"", -// ""alias"": ""G12345678"", -// ""aliasType"": ""Default"", -// ""applicationLabel"": ""ASDFGHJKL"", -// ""applicationPreferredName"": ""ASDFGHJKL"", -// ""backendGiftcardIndicator"": ""false"", -// ""cardBin"": ""4111111"", -// ""cardHolderName"": ""John Smith"" -// }, -// ""message"": ""CARD_ACQ_COMPLETED"", -// ""store"": ""NL"" -// }"; -// string responseBased64 = "ewoiYWRkaXRpb25hbERhdGEiOnsKICJQYXltZW50QWNjb3VudFJlZmVyZW5jZSI6Ill2NnpzMTIzNDU2Nzg5MEFTREZHSEpLTCIsCiJhbGlhcyI6IkcxMjM0NTY3OCIsCiJhbGlhc1R5cGUiOiJEZWZhdWx0IiwKImFwcGxpY2F0aW9uTGFiZWwiOiJBU0RGR0hKS0wiLAoiYXBwbGljYXRpb25QcmVmZXJyZWROYW1lIjoiQVNERkdISktMIiwKICJiYWNrZW5kR2lmdGNhcmRJbmRpY2F0b3IiOiJmYWxzZSIsCiJjYXJkQmluIjoiNDExMTExMSIsCiJjYXJkSG9sZGVyTmFtZSI6IkpvaG4gU21pdGgiCgp9LAoibWVzc2FnZSI6IkNBUkRfQUNRX0NPTVBMRVRFRCIsCiJzdG9yZSI6Ik5MIgp9"; -// var additionalResponse = CardAcquisitionUtil.AdditionalResponse(responseBased64); -// Assert.AreEqual(additionalResponse.Message,"CARD_ACQ_COMPLETED"); -// Assert.AreEqual(additionalResponse.Store,"NL"); -// Assert.AreEqual(additionalResponse.AdditionalData["PaymentAccountReference"],"Yv6zs1234567890ASDFGHJKL"); -// Assert.AreEqual(additionalResponse.AdditionalData["alias"],"G12345678"); -// Assert.AreEqual(additionalResponse.AdditionalData["aliasType"],"Default"); -// Assert.AreEqual(additionalResponse.AdditionalData["applicationLabel"],"ASDFGHJKL"); -// Assert.AreEqual(additionalResponse.AdditionalData["applicationPreferredName"],"ASDFGHJKL"); -// Assert.AreEqual(additionalResponse.AdditionalData["backendGiftcardIndicator"],"false"); -// Assert.AreEqual(additionalResponse.AdditionalData["cardHolderName"],"John Smith"); -// Assert.AreEqual(additionalResponse.AdditionalData["cardBin"],"4111111"); -// -// var additionalResponseFromJson = CardAcquisitionUtil.AdditionalResponse(jsonString); -// Assert.AreEqual(additionalResponseFromJson.Message,"CARD_ACQ_COMPLETED"); -// Assert.AreEqual(additionalResponseFromJson.Store,"NL"); -// Assert.AreEqual(additionalResponseFromJson.AdditionalData["PaymentAccountReference"],"Yv6zs1234567890ASDFGHJKL"); -// Assert.AreEqual(additionalResponseFromJson.AdditionalData["alias"],"G12345678"); -// Assert.AreEqual(additionalResponseFromJson.AdditionalData["aliasType"],"Default"); -// Assert.AreEqual(additionalResponseFromJson.AdditionalData["applicationLabel"],"ASDFGHJKL"); -// Assert.AreEqual(additionalResponseFromJson.AdditionalData["applicationPreferredName"],"ASDFGHJKL"); -// Assert.AreEqual(additionalResponseFromJson.AdditionalData["backendGiftcardIndicator"],"false"); -// Assert.AreEqual(additionalResponseFromJson.AdditionalData["cardHolderName"],"John Smith"); -// Assert.AreEqual(additionalResponseFromJson.AdditionalData["cardBin"],"4111111"); -// -// } -// -// } -// } diff --git a/Adyen.Test/WebhooksTests/BalancePlatformWebhookHandlerTest.cs b/Adyen.Test/Webhooks/BalancePlatformWebhookHandlerTest.cs similarity index 100% rename from Adyen.Test/WebhooksTests/BalancePlatformWebhookHandlerTest.cs rename to Adyen.Test/Webhooks/BalancePlatformWebhookHandlerTest.cs diff --git a/Adyen.Test/Webhooks/HmacValidatorUtilityTest.cs b/Adyen.Test/Webhooks/HmacValidatorUtilityTest.cs new file mode 100644 index 000000000..600808fd8 --- /dev/null +++ b/Adyen.Test/Webhooks/HmacValidatorUtilityTest.cs @@ -0,0 +1,193 @@ +using Adyen.Webhooks; +using Adyen.Webhooks.Models; +using Adyen.Util.TerminalApi; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Newtonsoft.Json; + +namespace Adyen.Test.Webhooks +{ + [TestClass] + public class HmacValidatorUtilityTest : BaseTest + { + [TestMethod] + public void TestHmac() + { + string data = "countryCode:currencyCode:merchantAccount:merchantReference:paymentAmount:sessionValidity:skinCode:NL:EUR:MagentoMerchantTest2:TEST-PAYMENT-2017-02-01-14\\:02\\:05:199:2017-02-02T14\\:02\\:05+01\\:00:PKz2KML1"; + string hmacKey = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00"; + var hmacValidator = new HmacValidatorUtility(); + string hmacSignature = hmacValidator.CalculateHmac(data, hmacKey); + Assert.IsTrue(string.Equals(hmacSignature, "34oR8T1whkQWTv9P+SzKyp8zhusf9n0dpqrm9nsqSJs=")); + } + + [TestMethod] + public void TestBalancePlatformHmac() + { + string notification = + "{\"data\":{\"balancePlatform\":\"Integration_tools_test\",\"accountId\":\"BA32272223222H5HVKTBK4MLB\",\"sweep\":{\"id\":\"SWPC42272223222H5HVKV6H8C64DP5\",\"schedule\":{\"type\":\"balance\"},\"status\":\"active\",\"targetAmount\":{\"currency\":\"EUR\",\"value\":0},\"triggerAmount\":{\"currency\":\"EUR\",\"value\":0},\"type\":\"pull\",\"counterparty\":{\"balanceAccountId\":\"BA3227C223222H5HVKT3H9WLC\"},\"currency\":\"EUR\"}},\"environment\":\"test\",\"type\":\"balancePlatform.balanceAccountSweep.updated\"}"; + string hmacKey = "D7DD5BA6146493707BF0BE7496F6404EC7A63616B7158EC927B9F54BB436765F"; + string hmacSignature = "9Qz9S/0xpar1klkniKdshxpAhRKbiSAewPpWoxKefQA="; + var hmacValidator = new HmacValidatorUtility(); + bool response = hmacValidator.IsValidWebhook(hmacSignature, hmacKey, notification); + Assert.IsTrue(response); + } + + + [TestMethod] + public void TestNotificationRequestItemHmac() + { + string hmacKey = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00"; + string expectedSign = "ipnxGCaUZ4l8TUW75a71/ghd2Fe5ffvX0pV4TLTntIc="; + var additionalData = new Dictionary + { + { "hmacSignature", expectedSign } + }; + var notificationRequestItem = new NotificationRequestItem + { + PspReference = "pspReference", + OriginalReference = "originalReference", + MerchantAccountCode = "merchantAccount", + MerchantReference = "reference", + Amount = new Amount("EUR", 1000), + EventCode = "EVENT", + Success = true, + AdditionalData = additionalData + }; + var hmacValidator = new HmacValidatorUtility(); + string data = hmacValidator.GetDataToSign(notificationRequestItem); + Assert.AreEqual("pspReference:originalReference:merchantAccount:reference:1000:EUR:EVENT:true", data); + string encrypted = hmacValidator.CalculateHmac(notificationRequestItem, hmacKey); + Assert.AreEqual(expectedSign, encrypted); + Assert.IsTrue(hmacValidator.IsValidHmac(notificationRequestItem, hmacKey)); + notificationRequestItem.AdditionalData["hmacSignature"] = "notValidSign"; + Assert.IsFalse(hmacValidator.IsValidHmac(notificationRequestItem, hmacKey)); + } + + [TestMethod] + public void TestHmacCalculationNotificationRequestWithSpecialChars() + { + string hmacKey = "66B61474A0AA3736BA8789EDC6D6CD9EBA0C4F414A554E32A407F849C045C69D"; + string mockPath = GetMockFilePath("mocks/notification-response-refund-fail.json"); + string response = MockFileToString(mockPath); + var hmacValidator = new HmacValidatorUtility(); + NotificationRequest notificationRequest = JsonConvert.DeserializeObject(response); + NotificationRequestItem notificationItem = notificationRequest.NotificationItemContainers[0].NotificationItem; + bool isValidHmac = hmacValidator.IsValidHmac(notificationItem, hmacKey); + Assert.IsTrue(isValidHmac); + } + + [TestMethod] + public void TestNullHmacValidator() + { + var hmacValidator = new HmacValidatorUtility(); + var notificationRequestItem = new NotificationRequestItem + { + PspReference = "pspReference", + OriginalReference = "originalReference", + MerchantAccountCode = "merchantAccount", + MerchantReference = "reference", + Amount = new Amount("EUR", 1000), + EventCode = "EVENT", + Success = true, + AdditionalData = null + }; + bool isValidHmacAdditionalDataNull = hmacValidator.IsValidHmac(notificationRequestItem, "hmacKey"); + Assert.IsFalse(isValidHmacAdditionalDataNull); + notificationRequestItem.AdditionalData = new Dictionary(); + bool isValidHmacAdditionalDataEmpty = hmacValidator.IsValidHmac(notificationRequestItem, "hmacKey"); + Assert.IsFalse(isValidHmacAdditionalDataEmpty); + } + + [TestMethod] + public void TestColonAndBackslashHmacValidator() + { + var hmacValidator = new HmacValidatorUtility(); + string jsonNotification = @"{ + 'additionalData': { + 'acquirerCode': 'TestPmmAcquirer', + 'acquirerReference': 'J8DXDJ2PV6P', + 'authCode': '052095', + 'avsResult': '5 No AVS data provided', + 'avsResultRaw': '5', + 'cardSummary': '1111', + 'checkout.cardAddedBrand': 'visa', + 'cvcResult': '1 Matches', + 'cvcResultRaw': 'M', + 'expiryDate': '03/2030', + 'hmacSignature': 'CZErGCNQaSsxbaQfZaJlakqo7KPP+mIa8a+wx3yNs9A=', + 'paymentMethod': 'visa', + 'refusalReasonRaw': 'AUTHORISED', + 'retry.attempt1.acquirer': 'TestPmmAcquirer', + 'retry.attempt1.acquirerAccount': 'TestPmmAcquirerAccount', + 'retry.attempt1.avsResultRaw': '5', + 'retry.attempt1.rawResponse': 'AUTHORISED', + 'retry.attempt1.responseCode': 'Approved', + 'retry.attempt1.scaExemptionRequested': 'lowValue', + 'scaExemptionRequested': 'lowValue' + }, + 'amount': { + 'currency': 'EUR', + 'value': 1000 + }, + 'eventCode': 'AUTHORISATION', + 'eventDate': '2023-01-10T13:42:29+01:00', + 'merchantAccountCode': 'AntoniStroinski', + 'merchantReference': '\\:/\\/slashes are fun', + 'operations': [ + 'CANCEL', + 'CAPTURE', + 'REFUND' + ], + 'paymentMethod': 'visa', + 'pspReference': 'ZVWN7D3WSMK2WN82', + 'reason': '052095:1111:03/2030', + 'success': 'true' + }"; + NotificationRequestItem notificationRequestItem = JsonConvert.DeserializeObject(jsonNotification); + bool isValidHmac = hmacValidator.IsValidHmac(notificationRequestItem, "74F490DD33F7327BAECC88B2947C011FC02D014A473AAA33A8EC93E4DC069174"); + Assert.IsTrue(isValidHmac); + } + + [TestMethod] + public void TestCardAcquisitionAdditionalResponse() + { + string jsonString = @"{ + ""additionalData"": { + ""PaymentAccountReference"": ""Yv6zs1234567890ASDFGHJKL"", + ""alias"": ""G12345678"", + ""aliasType"": ""Default"", + ""applicationLabel"": ""ASDFGHJKL"", + ""applicationPreferredName"": ""ASDFGHJKL"", + ""backendGiftcardIndicator"": ""false"", + ""cardBin"": ""4111111"", + ""cardHolderName"": ""John Smith"" + }, + ""message"": ""CARD_ACQ_COMPLETED"", + ""store"": ""NL"" + }"; + string responseBased64 = "ewoiYWRkaXRpb25hbERhdGEiOnsKICJQYXltZW50QWNjb3VudFJlZmVyZW5jZSI6Ill2NnpzMTIzNDU2Nzg5MEFTREZHSEpLTCIsCiJhbGlhcyI6IkcxMjM0NTY3OCIsCiJhbGlhc1R5cGUiOiJEZWZhdWx0IiwKImFwcGxpY2F0aW9uTGFiZWwiOiJBU0RGR0hKS0wiLAoiYXBwbGljYXRpb25QcmVmZXJyZWROYW1lIjoiQVNERkdISktMIiwKICJiYWNrZW5kR2lmdGNhcmRJbmRpY2F0b3IiOiJmYWxzZSIsCiJjYXJkQmluIjoiNDExMTExMSIsCiJjYXJkSG9sZGVyTmFtZSI6IkpvaG4gU21pdGgiCgp9LAoibWVzc2FnZSI6IkNBUkRfQUNRX0NPTVBMRVRFRCIsCiJzdG9yZSI6Ik5MIgp9"; + AdditionalResponse additionalResponse = CardAcquisitionUtil.AdditionalResponse(responseBased64); + Assert.AreEqual(additionalResponse.Message,"CARD_ACQ_COMPLETED"); + Assert.AreEqual(additionalResponse.Store,"NL"); + Assert.AreEqual(additionalResponse.AdditionalData["PaymentAccountReference"],"Yv6zs1234567890ASDFGHJKL"); + Assert.AreEqual(additionalResponse.AdditionalData["alias"],"G12345678"); + Assert.AreEqual(additionalResponse.AdditionalData["aliasType"],"Default"); + Assert.AreEqual(additionalResponse.AdditionalData["applicationLabel"],"ASDFGHJKL"); + Assert.AreEqual(additionalResponse.AdditionalData["applicationPreferredName"],"ASDFGHJKL"); + Assert.AreEqual(additionalResponse.AdditionalData["backendGiftcardIndicator"],"false"); + Assert.AreEqual(additionalResponse.AdditionalData["cardHolderName"],"John Smith"); + Assert.AreEqual(additionalResponse.AdditionalData["cardBin"],"4111111"); + + AdditionalResponse additionalResponseFromJson = CardAcquisitionUtil.AdditionalResponse(jsonString); + Assert.AreEqual(additionalResponseFromJson.Message,"CARD_ACQ_COMPLETED"); + Assert.AreEqual(additionalResponseFromJson.Store,"NL"); + Assert.AreEqual(additionalResponseFromJson.AdditionalData["PaymentAccountReference"],"Yv6zs1234567890ASDFGHJKL"); + Assert.AreEqual(additionalResponseFromJson.AdditionalData["alias"],"G12345678"); + Assert.AreEqual(additionalResponseFromJson.AdditionalData["aliasType"],"Default"); + Assert.AreEqual(additionalResponseFromJson.AdditionalData["applicationLabel"],"ASDFGHJKL"); + Assert.AreEqual(additionalResponseFromJson.AdditionalData["applicationPreferredName"],"ASDFGHJKL"); + Assert.AreEqual(additionalResponseFromJson.AdditionalData["backendGiftcardIndicator"],"false"); + Assert.AreEqual(additionalResponseFromJson.AdditionalData["cardHolderName"],"John Smith"); + Assert.AreEqual(additionalResponseFromJson.AdditionalData["cardBin"],"4111111"); + } + } +} diff --git a/Adyen.Test/WebhooksTests/ManagementWebhookHandlerTest.cs b/Adyen.Test/Webhooks/ManagementWebhookHandlerTest.cs similarity index 100% rename from Adyen.Test/WebhooksTests/ManagementWebhookHandlerTest.cs rename to Adyen.Test/Webhooks/ManagementWebhookHandlerTest.cs diff --git a/Adyen.Test/WebhooksTests/WebhookHandlerTest.cs b/Adyen.Test/Webhooks/WebhookHandlerTest.cs similarity index 100% rename from Adyen.Test/WebhooksTests/WebhookHandlerTest.cs rename to Adyen.Test/Webhooks/WebhookHandlerTest.cs From 7697b258ef5b752897223cc179b3df2728171522 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 1 Nov 2025 01:50:50 +0100 Subject: [PATCH 100/126] Moved tests for PaymentsApp to ensure url is correct --- Adyen.Test/Checkout/PaymentsServiceTest.cs | 25 ++++++- .../PaymentsApp/PaymentsAppServiceTest.cs | 70 ++++++++++++------- Adyen/Core/Options/AdyenOptions.cs | 3 +- 3 files changed, 70 insertions(+), 28 deletions(-) diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index 0694f49bb..472dde156 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -175,7 +175,30 @@ public async Task Given_Empty_ConfigureCheckout_When_No_AdyenOptions_Provided_Th testHost.Services.GetRequiredService(); }); } - + + [TestMethod] + public async Task Given_IPaymentsService_When_Prefix_Not_Set_Throws_InvalidOperationException() + { + // Arrange + var liveHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = "your-live-api-key"; + options.Environment = AdyenEnvironment.Live; + }); + }) + .Build(); + + // Act + // Assert + Assert.ThrowsException(() => + { + liveHost.Services.GetRequiredService(); + }); + } + [TestMethod] public async Task Given_IPaymentsService_When_Live_Url_And_Prefix_Are_Set_Returns_Correct_Live_Url_Endpoint_And_No_Prefix() { diff --git a/Adyen.Test/PaymentsApp/PaymentsAppServiceTest.cs b/Adyen.Test/PaymentsApp/PaymentsAppServiceTest.cs index 6e73390c7..3553dd343 100644 --- a/Adyen.Test/PaymentsApp/PaymentsAppServiceTest.cs +++ b/Adyen.Test/PaymentsApp/PaymentsAppServiceTest.cs @@ -13,12 +13,12 @@ namespace Adyen.Test.PaymentsApp [TestClass] public class PaymentsAppTest { - private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; - private readonly IPaymentsAppService _paymentsAppService; - - public PaymentsAppTest() + [TestMethod] + public async Task Given_PaymentsAppService_When_Initialized_Result_Should_Return_Management_Test_Url() { - IHost host = Host.CreateDefaultBuilder() + // Arrange + // Act + IHost testHost = Host.CreateDefaultBuilder() .ConfigurePaymentsApp((context, services, config) => { config.ConfigureAdyenOptions(options => @@ -27,34 +27,54 @@ public PaymentsAppTest() }); }) .Build(); - - _jsonSerializerOptionsProvider = host.Services.GetRequiredService(); - _paymentsAppService = host.Services.GetRequiredService(); + + var paymentsAppService = testHost.Services.GetRequiredService(); + + // Assert + Assert.AreEqual("https://management-test.adyen.com/v1", paymentsAppService.HttpClient.BaseAddress.ToString()); } + [TestMethod] - public async Task PaymentsAppServiceTESTUrlTest() + public void Given_PaymentsAppService_When_Initialized_Result_Should_Return_Management_Live_Url() { - _paymentsAppService.RevokePaymentsAppAsync("{merchantId}", "{installationId}") + // Arrange + // Act + IHost testHost = Host.CreateDefaultBuilder() + .ConfigurePaymentsApp((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Live; + }); + }) + .Build(); - var client = CreateMockForAdyenClientTest(new Config()); - client.SetEnvironment(Environment.Test, "companyUrl"); - var checkout = new PaymentsAppService(client); - checkout.RevokePaymentsAppAsync().GetAwaiter(); - - ClientInterfaceSubstitute.Received().RequestAsync("https://management-test.adyen.com/v1/merchants/{merchantId}/paymentsApps/{installationId}/revoke", - Arg.Any(), null, new HttpMethod("POST"), default); + var paymentsAppService = testHost.Services.GetRequiredService(); + + // Assert + Assert.AreEqual("https://management-live.adyen.com/v1", paymentsAppService.HttpClient.BaseAddress.ToString()); } [TestMethod] - public void PaymentsAppServiceLIVEUrlTest() + public void Given_PaymentsAppService_When_Initialized_Result_Should_Return_Management_Live_Url_And_No_Prefix() { - var client = CreateMockForAdyenClientTest(new Config()); - client.SetEnvironment(Environment.Live, "companyUrl"); - var checkout = new PaymentsAppService(client); - checkout.RevokePaymentsAppAsync("{merchantId}", "{installationId}").GetAwaiter(); - - ClientInterfaceSubstitute.Received().RequestAsync("https://management-live.adyen.com/v1/merchants/{merchantId}/paymentsApps/{installationId}/revoke", - Arg.Any(), null, new HttpMethod("POST"), default); + // Arrange + // Act + IHost testHost = Host.CreateDefaultBuilder() + .ConfigurePaymentsApp((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Live; + options.LiveEndpointUrlPrefix = "prefix"; + }); + }) + .Build(); + + var paymentsAppService = testHost.Services.GetRequiredService(); + + // Assert + Assert.AreEqual("https://management-live.adyen.com/v1", paymentsAppService.HttpClient.BaseAddress.ToString()); } } } \ No newline at end of file diff --git a/Adyen/Core/Options/AdyenOptions.cs b/Adyen/Core/Options/AdyenOptions.cs index d07bd02d0..045f004fe 100644 --- a/Adyen/Core/Options/AdyenOptions.cs +++ b/Adyen/Core/Options/AdyenOptions.cs @@ -9,11 +9,10 @@ public class AdyenOptions /// /// Used in the LIVE environment only. - /// Default value: empty string. /// This prefix is appended to HttpClient.BaseAddress when is set to `AdyenEnvironment.Live` /// See: https://docs.adyen.com/development-resources/live-endpoints/ /// - public string LiveEndpointUrlPrefix { get; set; } = string.Empty; + public string LiveEndpointUrlPrefix { get; set; } /// /// The `ADYEN_API_KEY` is an Adyen API authentication token that must be included in the HTTP request header and allows your application to securely communicate with the Adyen APIs. From 4ae88eb3cb8c89f0ad8fb90c1c46d3161a736a5e Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 1 Nov 2025 01:51:56 +0100 Subject: [PATCH 101/126] Rename var --- Adyen.Test/Checkout/PaymentsServiceTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index 472dde156..8aa2a1632 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -180,7 +180,7 @@ public async Task Given_Empty_ConfigureCheckout_When_No_AdyenOptions_Provided_Th public async Task Given_IPaymentsService_When_Prefix_Not_Set_Throws_InvalidOperationException() { // Arrange - var liveHost = Host.CreateDefaultBuilder() + IHost liveHost = Host.CreateDefaultBuilder() .ConfigureCheckout((context, services, config) => { config.ConfigureAdyenOptions(options => From a8957b1e1147082ef850ffc294cb2341e3b6d112 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 3 Nov 2025 23:20:50 +0100 Subject: [PATCH 102/126] Allow HttpClient and timeouts to be configurable --- .../PaymentsServiceIntegrationTest.cs | 15 ++++---- Adyen.Test/Checkout/PaymentsServiceTest.cs | 24 +++++++++++++ .../generichost/HostConfiguration.mustache | 29 +++++++++------ .../IHostBuilderExtensions.mustache | 36 ++++++++++--------- .../IServiceCollectionExtensions.mustache | 29 +++++---------- 5 files changed, 78 insertions(+), 55 deletions(-) diff --git a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index de1b76f2f..87813f544 100644 --- a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -16,14 +16,15 @@ public class PaymentsServiceIntegrationTest public PaymentsServiceIntegrationTest() { IHost host = Host.CreateDefaultBuilder() - .ConfigureCheckout((context, services, config) => - { - config.ConfigureAdyenOptions(options => + .ConfigureCheckout( + (context, services, config) => { - options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; - options.Environment = AdyenEnvironment.Test; - }); - }) + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) .Build(); _paymentsApiService = host.Services.GetRequiredService(); diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index 8aa2a1632..1c3b92e59 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -156,6 +156,30 @@ public async Task Given_Byte_Array_When_Deserialize_Result_ThreeDSecureData_Shou Assert.AreEqual(jsonElementBase64, cavv); } + [TestMethod] + public async Task Given_ConfigureCheckout_When_Timeout_Is_Provided_Then_Timeout_Is_Set() + { + // Arrange + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }, client => + { + client.Timeout = TimeSpan.FromSeconds(42); + }) + .Build(); + + // Act + var httpClient = testHost.Services.GetService().HttpClient; + + // Assert + Assert.AreEqual(httpClient.Timeout, TimeSpan.FromSeconds(42)); + } + [TestMethod] public async Task Given_Empty_ConfigureCheckout_When_No_AdyenOptions_Provided_Then_IPaymentService_Should_Throw_InvalidOperationException() { diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index c7e8b070f..73008ab09 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -104,23 +104,30 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} } /// - /// Configures the HttpClients. + /// Configures the and . /// - /// - /// - /// - public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} clientAction = null, Action{{nrt?}} builderAction = null) + /// + /// + /// . + public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} httpClientDelegate = null, Action{{nrt?}} httpClientBuilderDelegate = null) { - if (clientAction == null) - clientAction = httpClient => httpClient.BaseAddress = new Uri(UrlBuilderExtensions.ConstructHostUrl(_adyenOptions, BASE_URL)); + Action httpClientAction = httpClient => + { + // Configure HttpClient set by the user. + httpClientDelegate?.Invoke(httpClient); + // Set BaseAddress if it's not set + if (httpClient.BaseAddress == null) + httpClient.BaseAddress = new Uri(UrlBuilderExtensions.ConstructHostUrl(_adyenOptions, BASE_URL)); + }; + List builders = new List(); - {{#apiInfo}}{{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, {{classname}}>(clientAction)); + {{#apiInfo}}{{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, {{classname}}>(httpClientAction)); {{/apis}}{{/apiInfo}} - if (builderAction != null) - foreach (IHttpClientBuilder instance in builders) - builderAction(instance); + if (httpClientBuilderDelegate != null) + foreach (IHttpClientBuilder builder in builders) + httpClientBuilderDelegate(builder); HttpClientsAdded = true; diff --git a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache index d00410da0..5adeea435 100644 --- a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache @@ -16,41 +16,45 @@ namespace {{packageName}}.{{apiName}}.Extensions /// {{>visibility}} static class HostBuilderExtensions { - {{^hasAuthMethods}} /// - /// Add the API services to your host builder. + /// Add the {{apiName}} API services to . /// - /// - public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder) + /// . + /// . + public static IHostBuilder Configure{{apiName}}(this IHostBuilder hostBuilder, Action hostConfigurationDelegate) { - builder.ConfigureServices((context, services) => + hostBuilder.ConfigureServices((context, services) => { HostConfiguration config = new HostConfiguration(services); - ServiceCollectionExtensions.Add{{apiName}}Services(services, config); + hostConfigurationDelegate(context, services, config); + + ServiceCollectionExtensions.Add{{apiName}}Services(services, config, null, null); }); - return builder; + return hostBuilder; } - {{/hasAuthMethods}} /// - /// Add the API services to your host builder. + /// Add the {{apiName}} API services to . + /// Overloaded method to configure the and . /// - /// - /// - public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder, Action options) + /// . + /// . + /// . + /// . + public static IHostBuilder Configure{{apiName}}(this IHostBuilder hostBuilder, Action hostConfigurationDelegate, Action httpClientDelegate, Action? httpClientBuilderDelegate = null) { - builder.ConfigureServices((context, services) => + hostBuilder.ConfigureServices((context, services) => { HostConfiguration config = new HostConfiguration(services); - options(context, services, config); + hostConfigurationDelegate(context, services, config); - ServiceCollectionExtensions.Add{{apiName}}Services(services, config); + ServiceCollectionExtensions.Add{{apiName}}Services(services, config, httpClientDelegate, httpClientBuilderDelegate); }); - return builder; + return hostBuilder; } } } diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index 665d2fe6c..964d7c776 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -16,35 +16,22 @@ namespace {{packageName}}.{{apiName}}.Extensions /// {{>visibility}} static class ServiceCollectionExtensions { - {{^hasAuthMethods}} /// - /// Add the {{packageName}} {{apiName}} API services to your host builder. + /// Add the {{packageName}} {{apiName}} API services to your host builder and . /// - /// - public static void Add{{apiName}}Services(this IServiceCollection services) + /// . + /// Configure your . + public static void Add{{apiName}}Services(this IServiceCollection services, Action hostConfigurationDelegate) { HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); + hostConfigurationDelegate(config); Add{{apiName}}Services(services, config); } - {{/hasAuthMethods}} - - /// - /// Add the {{packageName}} {{apiName}} API services to your host builder. - /// - /// - /// - public static void Add{{apiName}}Services(this IServiceCollection services, Action options) - { - HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); - options(config); - Add{{apiName}}Services(services, config); - } - - internal static void Add{{apiName}}Services(IServiceCollection services, HostConfiguration host) + internal static void Add{{apiName}}Services(IServiceCollection services, HostConfiguration hostConfiguration, Action? httpClientDelegate = null, Action? httpClientBuilderDelegate = null) { - if (!host.HttpClientsAdded) - host.Add{{apiName}}HttpClients(); + if (!hostConfiguration.HttpClientsAdded) + hostConfiguration.Add{{apiName}}HttpClients(httpClientDelegate, httpClientBuilderDelegate); {{#models}} {{#model.vendorExtensions.x-webhook-root}} From 473e756a606a0540c3c2b3b97768bad6e6ae1a2c Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Tue, 4 Nov 2025 00:05:53 +0100 Subject: [PATCH 103/126] Rename variables and better guide developer to use HttpClientBuilderExtensions --- .../Extensions/HttpClientBuilderExtensions.cs | 63 ++++++++++--------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/Adyen/Core/Client/Extensions/HttpClientBuilderExtensions.cs b/Adyen/Core/Client/Extensions/HttpClientBuilderExtensions.cs index 28bae0131..92c15543b 100644 --- a/Adyen/Core/Client/Extensions/HttpClientBuilderExtensions.cs +++ b/Adyen/Core/Client/Extensions/HttpClientBuilderExtensions.cs @@ -17,51 +17,52 @@ public static class HttpClientBuilderExtensions /// /// Adds a Polly retry policy to your clients. /// - /// - /// - /// - public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + /// . + /// The number of retries. + /// . + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder httpClient, int numberOfRetries) { - client.AddPolicyHandler(RetryPolicy(retries)); - return client; + httpClient.AddPolicyHandler(RetryPolicy(numberOfRetries)); + return httpClient; } + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int numberOfRetries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(numberOfRetries); + /// /// Adds a Polly timeout policy to your clients. + /// Use this when you need resilient policies (using the ) and want to combine this with a retry & circuit breaker. /// - /// - /// - /// - public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + /// . + /// . + /// . + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder httpClient, TimeSpan timeout) { - client.AddPolicyHandler(TimeoutPolicy(timeout)); - return client; + httpClient.AddPolicyHandler(TimeoutPolicy(timeout)); + return httpClient; } - + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + /// /// Adds a Polly circuit breaker to your clients. /// - /// - /// - /// - /// - public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + /// . + /// Example: if set to 3 - if 3 consecutive request fail, Polly will open the circuit for the duration of . + /// . + /// . + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder httpClient, int numberOfEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) { - client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); - return client; + httpClient.AddTransientHttpErrorPolicy(policyBuilder => CircuitBreakerPolicy(policyBuilder, numberOfEventsAllowedBeforeBreaking, durationOfBreak)); + return httpClient; } - private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) - => HttpPolicyExtensions - .HandleTransientHttpError() - .Or() - .RetryAsync(retries); - - private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) - => Policy.TimeoutAsync(timeout); - private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( - PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) - => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + PolicyBuilder policyBuilder, int numberOfEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => policyBuilder.CircuitBreakerAsync(numberOfEventsAllowedBeforeBreaking, durationOfBreak); } } From 427dfa25c593d262e53be16ba930a2413fe33784 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Tue, 4 Nov 2025 00:18:08 +0100 Subject: [PATCH 104/126] Renames of variables, cleanup local functions and add documentation --- Adyen.Test/Checkout/PaymentsServiceTest.cs | 4 ++++ .../generichost/HostConfiguration.mustache | 22 +++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index 1c3b92e59..c0df93978 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -1,4 +1,5 @@ using Adyen.Core.Options; +using Adyen.Core.Client.Extensions; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; @@ -25,6 +26,9 @@ public PaymentsServiceTest() { options.Environment = AdyenEnvironment.Test; }); + }, null, builder => + { + builder.AddCircuitBreakerPolicy(3, TimeSpan.MaxValue); }) .Build(); diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 73008ab09..20ffcba6c 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -106,8 +106,8 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} /// /// Configures the and . /// - /// - /// + /// + /// /// . public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} httpClientDelegate = null, Action{{nrt?}} httpClientBuilderDelegate = null) { @@ -137,23 +137,23 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} /// /// Configures the . /// - /// - /// - public HostConfiguration ConfigureJsonOptions(Action optionsAction) + /// . + /// . + public HostConfiguration ConfigureJsonOptions(Action jsonSerializerOptionsDelegate) { - optionsAction(_jsonOptions); + jsonSerializerOptionsDelegate(_jsonOptions); return this; } /// - /// Configures the Adyen Settings, e.g. Environment, LiveEndpointPrefix and more. + /// Configures the (e.g. Environment, LiveEndpointPrefix). /// - /// - /// - public HostConfiguration ConfigureAdyenOptions(Action optionsAction) + /// + /// . + public HostConfiguration ConfigureAdyenOptions(Action adyenOptionsDelegate) { - optionsAction(_adyenOptions); + adyenOptionsDelegate(_adyenOptions); {{#hasApiKeyMethods}} _services.AddSingleton>( new TokenProvider( From ebc79e2deaa04e340cb18f9d4b07098316bc9d3d Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Tue, 4 Nov 2025 00:19:54 +0100 Subject: [PATCH 105/126] Add documentation --- Adyen/Core/Client/Extensions/HttpClientBuilderExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adyen/Core/Client/Extensions/HttpClientBuilderExtensions.cs b/Adyen/Core/Client/Extensions/HttpClientBuilderExtensions.cs index 92c15543b..bc5187d30 100644 --- a/Adyen/Core/Client/Extensions/HttpClientBuilderExtensions.cs +++ b/Adyen/Core/Client/Extensions/HttpClientBuilderExtensions.cs @@ -52,7 +52,7 @@ private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan ti /// Adds a Polly circuit breaker to your clients. /// /// . - /// Example: if set to 3 - if 3 consecutive request fail, Polly will open the circuit for the duration of . + /// Example: if set to 3 - if 3 consecutive request fail, Polly will 'open' the circuit for the duration of and fail all incoming requests. After that, the circuit will be 'half-open'. /// . /// . public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder httpClient, int numberOfEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) From a3a5368b4882bf2223690a74b5cf58da48a22a9e Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Tue, 4 Nov 2025 00:23:09 +0100 Subject: [PATCH 106/126] Update Hostbuilder's documentation summary --- .../libraries/generichost/IHostBuilderExtensions.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache index 5adeea435..21a4af253 100644 --- a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache @@ -17,7 +17,7 @@ namespace {{packageName}}.{{apiName}}.Extensions {{>visibility}} static class HostBuilderExtensions { /// - /// Add the {{apiName}} API services to . + /// Add the {{apiName}} API services to /// . /// . @@ -36,14 +36,14 @@ namespace {{packageName}}.{{apiName}}.Extensions } /// - /// Add the {{apiName}} API services to . + /// Add the {{apiName}} API services to . /// Overloaded method to configure the and . /// /// . /// . - /// . + /// . /// . - public static IHostBuilder Configure{{apiName}}(this IHostBuilder hostBuilder, Action hostConfigurationDelegate, Action httpClientDelegate, Action? httpClientBuilderDelegate = null) + public static IHostBuilder Configure{{apiName}}(this IHostBuilder hostBuilder, Action hostConfigurationDelegate, Action httpClientDelegate?, Action? httpClientBuilderDelegate = null) { hostBuilder.ConfigureServices((context, services) => { From 4b32873f37083edf31c2ebf3821f490cbcf9ee8c Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Tue, 4 Nov 2025 00:23:37 +0100 Subject: [PATCH 107/126] Update IHostBuilderExtensions documentation --- .../libraries/generichost/IHostBuilderExtensions.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache index 21a4af253..c6538f9cb 100644 --- a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache @@ -43,7 +43,7 @@ namespace {{packageName}}.{{apiName}}.Extensions /// . /// . /// . - public static IHostBuilder Configure{{apiName}}(this IHostBuilder hostBuilder, Action hostConfigurationDelegate, Action httpClientDelegate?, Action? httpClientBuilderDelegate = null) + public static IHostBuilder Configure{{apiName}}(this IHostBuilder hostBuilder, Action hostConfigurationDelegate, Action? httpClientDelegate, Action? httpClientBuilderDelegate = null) { hostBuilder.ConfigureServices((context, services) => { From a590662ac96898787d6fe088eae31884bae2eb60 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Tue, 4 Nov 2025 00:25:08 +0100 Subject: [PATCH 108/126] Update Hostconfiguration.mustache fix doc --- .../csharp/libraries/generichost/HostConfiguration.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index 20ffcba6c..f274027b7 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -106,7 +106,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} /// /// Configures the and . /// - /// + /// /// /// . public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} httpClientDelegate = null, Action{{nrt?}} httpClientBuilderDelegate = null) From d7c21b3c4a0b1cca53041b7482052c6037ff9675 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Tue, 4 Nov 2025 12:11:20 +0100 Subject: [PATCH 109/126] Added some extra deserialization tests from raw string --- .../PaymentsServiceIntegrationTest.cs | 1 + Adyen.Test/Core/IEnumTest.cs | 107 ++++++++++++++++++ .../generichost/JsonConverter.mustache | 6 +- .../generichost/modelGeneric.mustache | 4 +- 4 files changed, 113 insertions(+), 5 deletions(-) diff --git a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index 87813f544..c3097674e 100644 --- a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -1,6 +1,7 @@ using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; +using Adyen.Core.Client.Extensions; using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; diff --git a/Adyen.Test/Core/IEnumTest.cs b/Adyen.Test/Core/IEnumTest.cs index ddd4adc38..4d73262fd 100644 --- a/Adyen.Test/Core/IEnumTest.cs +++ b/Adyen.Test/Core/IEnumTest.cs @@ -169,6 +169,113 @@ public async Task Given_JsonSerialization_When_Null_Value_Then_Serialize_And_Des ExampleEnum? deserialized = JsonSerializer.Deserialize("null", options); Assert.IsNull(deserialized); } + + [TestMethod] + public async Task Given_JsonDeserialization_When_ExampleEnum_Is_Null_Then_Deserialize_Correctly_And_Not_Throw_Exception() + { + // Arrange + string json = @" +{ + ""exampleEnum"": null +}"; + var options = new JsonSerializerOptions(); + options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); + options.Converters.Add(new ExampleModelResponse.ExampleModelResponseJsonConverter()); + + // Act + ExampleModelResponse result = JsonSerializer.Deserialize(json, options); + + // Assert + Assert.IsNull(result.ExampleEnum); + } + + [TestMethod] + public async Task Given_JsonDeserialization_When_ExampleEnum_Is_A_Then_Deserialize_Correctly_To_A() + { + // Arrange + string json = @" +{ + ""exampleEnum"": ""a"" +}"; + var options = new JsonSerializerOptions(); + options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); + options.Converters.Add(new ExampleModelResponse.ExampleModelResponseJsonConverter()); + + // Act + ExampleModelResponse result = JsonSerializer.Deserialize(json, options); + + // Assert + Assert.AreEqual(ExampleEnum.A, result.ExampleEnum); + } + + + internal class ExampleModelResponse + { + /// + /// The optional enum to test. + /// + [JsonPropertyName("exampleEnum")] + public ExampleEnum? ExampleEnum { get { return this._ExampleEnumOption; } set { this._ExampleEnumOption = new(value); } } + + /// + /// Used to track if an optional field is set. If so, set the . + /// + [JsonIgnore] + public Option _ExampleEnumOption { get; private set; } + + [JsonConstructor] + public ExampleModelResponse(Option exampleEnum) + { + this._ExampleEnumOption = exampleEnum; + } + + internal class ExampleModelResponseJsonConverter : JsonConverter + { + public override ExampleModelResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option exampleEnum = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? jsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (jsonPropertyName) + { + case "exampleEnum": + exampleEnum = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + return new ExampleModelResponse(exampleEnum); + } + + public override void Write(Utf8JsonWriter writer, ExampleModelResponse response, JsonSerializerOptions jsonSerializerOptions) + { + writer.WritePropertyName("exampleEnum"); + JsonSerializer.Serialize(writer, response.ExampleEnum, jsonSerializerOptions); + } + } + } #endregion } diff --git a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache index 583505a2a..391e00e66 100644 --- a/templates-v7/csharp/libraries/generichost/JsonConverter.mustache +++ b/templates-v7/csharp/libraries/generichost/JsonConverter.mustache @@ -22,10 +22,10 @@ /// /// Deserializes json to . /// - /// - /// + /// . + /// . /// The , initialized from . - /// + /// . /// public override {{classname}} Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { diff --git a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache index 5f78eb722..ca87c3197 100644 --- a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache +++ b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache @@ -110,8 +110,8 @@ {{^isDiscriminator}} {{#isEnum}} {{^required}} - /// - /// Used to track whether {{{name}}} is set or not. + /// + /// Used to track if an optional field is set. If set, will be populated. /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] From c7ffaf62f6659f403da83dcc5243d7c46b292e55 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Tue, 4 Nov 2025 17:01:30 +0100 Subject: [PATCH 110/126] Add UserAgent to our HttpClient and moved tests --- .../Client/HttpRequestMessageExtensions.cs | 95 ++++ Adyen.Test/Core/IEnumTest.cs | 454 +++++++++--------- Adyen.Test/{ => TerminalApi}/ClientTest.cs | 0 .../HttpRequestMessageExtensions.cs | 63 +++ .../csharp/libraries/generichost/api.mustache | 5 + 5 files changed, 391 insertions(+), 226 deletions(-) create mode 100644 Adyen.Test/Core/Client/HttpRequestMessageExtensions.cs rename Adyen.Test/{ => TerminalApi}/ClientTest.cs (100%) create mode 100644 Adyen/Core/Client/Extensions/HttpRequestMessageExtensions.cs diff --git a/Adyen.Test/Core/Client/HttpRequestMessageExtensions.cs b/Adyen.Test/Core/Client/HttpRequestMessageExtensions.cs new file mode 100644 index 000000000..a7652c36e --- /dev/null +++ b/Adyen.Test/Core/Client/HttpRequestMessageExtensions.cs @@ -0,0 +1,95 @@ +using Adyen.Core.Client.Extensions; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.Core.Client +{ + [TestClass] + public class HttpRequestMessageExtensionsTest + { + [TestMethod] + public void Given_AddUserAgentToHeaders_When_ApplicationName_Is_Null_Returns_adyen_dotnet_api_library_And_AdyenLibraryVersion() + { + // Arrange + HttpRequestMessageExtensions.ApplicationName = null; + var request = new HttpRequestMessage(); + + // Act + request.AddUserAgentToHeaders(); + + // Assert + string target = request.Headers.GetValues("UserAgent").First(); + Assert.AreEqual($"adyen-dotnet-api-library/{HttpRequestMessageExtensions.AdyenLibraryVersion}", target); + } + + [TestMethod] + public void Given_AddUserAgentToHeaders_When_ApplicationName_Is_Set_Returns_MyApp_adyen_dotnet_api_library_And_AdyenLibraryVersion() + { + // Arrange + var request = new HttpRequestMessage(); + HttpRequestMessageExtensions.ApplicationName = "MyApp"; + + // Act + request.AddUserAgentToHeaders(); + + // Assert + string target = request.Headers.GetValues("UserAgent").First(); + Assert.AreEqual($"MyApp adyen-dotnet-api-library/{HttpRequestMessageExtensions.AdyenLibraryVersion}", target); + } + + [TestMethod] + public void Given_AddLibraryNameToHeader_When_Provided_Returns_adyen_dotnet_api_library() + { + // Arrange + HttpRequestMessageExtensions.ApplicationName = null; + var request = new HttpRequestMessage(); + + // Act + request.AddLibraryNameToHeader(); + + // Assert + string target = request.Headers.GetValues("adyen-library-name").First(); + Assert.AreEqual("adyen-dotnet-api-library", target); + } + + [TestMethod] + public void Given_AddLibraryNameToHeader_When_Provided_Returns_AdyenLibraryVersion() + { + // Arrange + HttpRequestMessageExtensions.ApplicationName = null; + var request = new HttpRequestMessage(); + + // Act + request.AddLibraryVersionToHeader(); + + // Assert + string target = request.Headers.GetValues("adyen-library-version").First(); + Assert.AreEqual(HttpRequestMessageExtensions.AdyenLibraryVersion, target); + } + + [TestMethod] + public void Given_AddUserAgentToHeaders_When_Called_MultipleTimes_Should_Not_Throw_Any_Exceptions() + { + // Arrange + HttpRequestMessageExtensions.ApplicationName = null; + var request = new HttpRequestMessage(); + + // Act + // Assert + try + { + request.AddUserAgentToHeaders(); + request.AddUserAgentToHeaders(); + + request.AddLibraryNameToHeader(); + request.AddLibraryNameToHeader(); + + request.AddLibraryVersionToHeader(); + request.AddLibraryVersionToHeader(); + } + catch (Exception e) + { + Assert.Fail(); + } + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Core/IEnumTest.cs b/Adyen.Test/Core/IEnumTest.cs index 4d73262fd..1923dea98 100644 --- a/Adyen.Test/Core/IEnumTest.cs +++ b/Adyen.Test/Core/IEnumTest.cs @@ -5,282 +5,283 @@ namespace Adyen.Test.Core { + [TestClass] public class IEnumTest { - [TestClass] - public class IEnumTestTests + [TestMethod] + public async Task Given_Enums_When_Equal_Returns_Correct_True() { - [TestMethod] - public async Task Given_Enums_When_Equal_Returns_Correct_True() - { - ExampleEnum? nullEnum = null; - - Assert.AreEqual(nullEnum, nullEnum); - Assert.AreEqual(ExampleEnum.A, ExampleEnum.A); - Assert.AreEqual(ExampleEnum.B, ExampleEnum.B); - } - - [TestMethod] - public async Task Given_Enums_When_NotEqual_Returns_Correct_False() - { - ExampleEnum? nullEnum = null; - - Assert.AreNotEqual(ExampleEnum.A, ExampleEnum.B); - Assert.AreNotEqual(ExampleEnum.B, nullEnum); - Assert.AreNotEqual(ExampleEnum.A, nullEnum); - } - - [TestMethod] - public async Task Given_ImplicitConversion_When_Initialized_Then_Returns_Correct_Values() - { - ExampleEnum? resultA = "a"; - ExampleEnum? resultB = "b"; - - Assert.AreEqual(ExampleEnum.A, resultA); - Assert.AreEqual(ExampleEnum.B, resultB); - } + ExampleEnum? nullEnum = null; - [TestMethod] - public async Task Given_ImplicitConversion_When_Null_Then_Returns_Null() - { - ExampleEnum? input = null; - string? result = input; - - Assert.IsNull(result); - } + Assert.AreEqual(nullEnum, nullEnum); + Assert.AreEqual(ExampleEnum.A, ExampleEnum.A); + Assert.AreEqual(ExampleEnum.B, ExampleEnum.B); + } - [TestMethod] - public async Task Given_ToString_When_Called_Then_Returns_Correct_Value() - { - Assert.AreEqual("a", ExampleEnum.A.ToString()); - Assert.AreEqual("b", ExampleEnum.B.ToString()); - } + [TestMethod] + public async Task Given_Enums_When_NotEqual_Returns_Correct_False() + { + ExampleEnum? nullEnum = null; - [TestMethod] - public async Task Given_ToString_When_Null_Then_Returns_Empty_String() - { - ExampleEnum result = ExampleEnum.FromStringOrDefault("this-is-not-a-valid-enum"); - - Assert.IsNull(result); - } + Assert.AreNotEqual(ExampleEnum.A, ExampleEnum.B); + Assert.AreNotEqual(ExampleEnum.B, nullEnum); + Assert.AreNotEqual(ExampleEnum.A, nullEnum); + } - [TestMethod] - public async Task Given_Equals_When_ComparingCaseInsensitive_Then_Returns_True() - { - ExampleEnum result = ExampleEnum.A; - - Assert.IsTrue(result.Equals(ExampleEnum.A)); - Assert.IsFalse(result.Equals(ExampleEnum.B)); - } + [TestMethod] + public async Task Given_ImplicitConversion_When_Initialized_Then_Returns_Correct_Values() + { + ExampleEnum? resultA = "a"; + ExampleEnum? resultB = "b"; - [TestMethod] - public async Task Given_FromStringOrDefault_When_InvalidString_Then_Returns_Null() - { - Assert.IsNull(ExampleEnum.FromStringOrDefault("this-is-not-a-valid-enum")); - } + Assert.AreEqual(ExampleEnum.A, resultA); + Assert.AreEqual(ExampleEnum.B, resultB); + } - [TestMethod] - public async Task Given_EqualityOperator_When_ComparingValues_Then_Returns_Correct_Values() - { - ExampleEnum target = ExampleEnum.A; - ExampleEnum otherA = ExampleEnum.A; - ExampleEnum otherB = ExampleEnum.B; - - Assert.IsTrue(target == otherA); - Assert.IsFalse(target == otherB); - Assert.IsTrue(target != otherB); - Assert.IsFalse(target != otherA); - } + [TestMethod] + public async Task Given_ImplicitConversion_When_Null_Then_Returns_Null() + { + ExampleEnum? input = null; + string? result = input; - [TestMethod] - public async Task Given_FromStringOrDefault_When_ValidStrings_Then_Returns_Correct_Enum() - { - Assert.AreEqual(ExampleEnum.A, ExampleEnum.FromStringOrDefault("a")); - Assert.AreEqual(ExampleEnum.B, ExampleEnum.FromStringOrDefault("b")); - } + Assert.IsNull(result); + } - #region ToJsonValue - [TestMethod] - public async Task Given_ToJsonValue_When_KnownEnum_Then_Returns_String() - { - Assert.AreEqual("a", ExampleEnum.ToJsonValue(ExampleEnum.A)); - Assert.AreEqual("b", ExampleEnum.ToJsonValue(ExampleEnum.B)); - } + [TestMethod] + public async Task Given_ToString_When_Called_Then_Returns_Correct_Value() + { + Assert.AreEqual("a", ExampleEnum.A.ToString()); + Assert.AreEqual("b", ExampleEnum.B.ToString()); + } - [TestMethod] - public async Task Given_ToJsonValue_When_Null_Then_Returns_Null() - { - Assert.IsNull(ExampleEnum.ToJsonValue(null)); - } + [TestMethod] + public async Task Given_ToString_When_Null_Then_Returns_Empty_String() + { + ExampleEnum result = ExampleEnum.FromStringOrDefault("this-is-not-a-valid-enum"); - [TestMethod] - public async Task Given_ToJsonValue_When_CustomEnum_Then_Returns_Null() - { - ExampleEnum custom = ExampleEnum.FromStringOrDefault("this-is-not-a-valid-enum"); - Assert.IsNull(ExampleEnum.ToJsonValue(custom)); - } - #endregion - - - #region JsonSerialization and JsonDeserialization - [TestMethod] - public async Task Given_JsonSerialization_When_KnownEnum_Then_Serialize_and_Deserialize_Correctly() - { - JsonSerializerOptions options = new JsonSerializerOptions(); - options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); + Assert.IsNull(result); + } - string serializedA = JsonSerializer.Serialize(ExampleEnum.A, options); - string serializedB = JsonSerializer.Serialize(ExampleEnum.B, options); + [TestMethod] + public async Task Given_Equals_When_ComparingCaseInsensitive_Then_Returns_True() + { + ExampleEnum result = ExampleEnum.A; - Assert.AreEqual("\"a\"", serializedA); - Assert.AreEqual("\"b\"", serializedB); + Assert.IsTrue(result.Equals(ExampleEnum.A)); + Assert.IsFalse(result.Equals(ExampleEnum.B)); + } - ExampleEnum? deserializedA = JsonSerializer.Deserialize(serializedA, options); - ExampleEnum? deserializedB = JsonSerializer.Deserialize(serializedB, options); + [TestMethod] + public async Task Given_FromStringOrDefault_When_InvalidString_Then_Returns_Null() + { + Assert.IsNull(ExampleEnum.FromStringOrDefault("this-is-not-a-valid-enum")); + } - Assert.AreEqual(ExampleEnum.A, deserializedA); - Assert.AreEqual(ExampleEnum.B, deserializedB); - } + [TestMethod] + public async Task Given_EqualityOperator_When_ComparingValues_Then_Returns_Correct_Values() + { + ExampleEnum target = ExampleEnum.A; + ExampleEnum otherA = ExampleEnum.A; + ExampleEnum otherB = ExampleEnum.B; + + Assert.IsTrue(target == otherA); + Assert.IsFalse(target == otherB); + Assert.IsTrue(target != otherB); + Assert.IsFalse(target != otherA); + } - [TestMethod] - public async Task Given_JsonSerialization_When_EnumNotInList_Then_Returns_Null() - { - var options = new JsonSerializerOptions(); - options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); + [TestMethod] + public async Task Given_FromStringOrDefault_When_ValidStrings_Then_Returns_Correct_Enum() + { + Assert.AreEqual(ExampleEnum.A, ExampleEnum.FromStringOrDefault("a")); + Assert.AreEqual(ExampleEnum.B, ExampleEnum.FromStringOrDefault("b")); + } + + [TestMethod] + public async Task Given_ToJsonValue_When_KnownEnum_Then_Returns_String() + { + Assert.AreEqual("a", ExampleEnum.ToJsonValue(ExampleEnum.A)); + Assert.AreEqual("b", ExampleEnum.ToJsonValue(ExampleEnum.B)); + } - ExampleEnum? value = ExampleEnum.FromStringOrDefault("not-in-list"); - string serialized = JsonSerializer.Serialize(value, options); - Assert.AreEqual("null", serialized); + [TestMethod] + public async Task Given_ToJsonValue_When_Null_Then_Returns_Null() + { + Assert.IsNull(ExampleEnum.ToJsonValue(null)); + } - ExampleEnum? deserialized = JsonSerializer.Deserialize(serialized, options); - Assert.AreEqual(null, deserialized); - } + [TestMethod] + public async Task Given_ToJsonValue_When_CustomEnum_Then_Returns_Null() + { + ExampleEnum custom = ExampleEnum.FromStringOrDefault("this-is-not-a-valid-enum"); + Assert.IsNull(ExampleEnum.ToJsonValue(custom)); + } - [TestMethod] - public async Task Given_JsonSerialization_When_Null_Value_Then_Serialize_And_Deserialize_Correctly() - { - var options = new JsonSerializerOptions(); - options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); + [TestMethod] + public async Task Given_JsonSerialization_When_KnownEnum_Then_Serialize_and_Deserialize_Correctly() + { + JsonSerializerOptions options = new JsonSerializerOptions(); + options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); - ExampleEnum? value = null; - string serialized = JsonSerializer.Serialize(value, options); - Assert.AreEqual("null", serialized); + string serializedA = JsonSerializer.Serialize(ExampleEnum.A, options); + string serializedB = JsonSerializer.Serialize(ExampleEnum.B, options); - ExampleEnum? deserialized = JsonSerializer.Deserialize("null", options); - Assert.IsNull(deserialized); - } + Assert.AreEqual("\"a\"", serializedA); + Assert.AreEqual("\"b\"", serializedB); - [TestMethod] - public async Task Given_JsonDeserialization_When_ExampleEnum_Is_Null_Then_Deserialize_Correctly_And_Not_Throw_Exception() - { - // Arrange - string json = @" + ExampleEnum? deserializedA = JsonSerializer.Deserialize(serializedA, options); + ExampleEnum? deserializedB = JsonSerializer.Deserialize(serializedB, options); + + Assert.AreEqual(ExampleEnum.A, deserializedA); + Assert.AreEqual(ExampleEnum.B, deserializedB); + } + + [TestMethod] + public async Task Given_JsonSerialization_When_EnumNotInList_Then_Returns_Null() + { + var options = new JsonSerializerOptions(); + options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); + + ExampleEnum? value = ExampleEnum.FromStringOrDefault("not-in-list"); + string serialized = JsonSerializer.Serialize(value, options); + Assert.AreEqual("null", serialized); + + ExampleEnum? deserialized = JsonSerializer.Deserialize(serialized, options); + Assert.AreEqual(null, deserialized); + } + + [TestMethod] + public async Task Given_JsonSerialization_When_Null_Value_Then_Serialize_And_Deserialize_Correctly() + { + var options = new JsonSerializerOptions(); + options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); + + ExampleEnum? value = null; + string serialized = JsonSerializer.Serialize(value, options); + Assert.AreEqual("null", serialized); + + ExampleEnum? deserialized = JsonSerializer.Deserialize("null", options); + Assert.IsNull(deserialized); + } + + + #region Arrange ExampleModelResponse for testing (an example) model deserialization + + [TestMethod] + public async Task Given_JsonDeserialization_When_ExampleEnum_Is_Null_Then_Deserialize_Correctly_And_Not_Throw_Exception() + { + // Arrange + string json = @" { ""exampleEnum"": null }"; - var options = new JsonSerializerOptions(); - options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); - options.Converters.Add(new ExampleModelResponse.ExampleModelResponseJsonConverter()); - - // Act - ExampleModelResponse result = JsonSerializer.Deserialize(json, options); - - // Assert - Assert.IsNull(result.ExampleEnum); - } - - [TestMethod] - public async Task Given_JsonDeserialization_When_ExampleEnum_Is_A_Then_Deserialize_Correctly_To_A() - { - // Arrange - string json = @" + var options = new JsonSerializerOptions(); + options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); + options.Converters.Add(new ExampleModelResponse.ExampleModelResponseJsonConverter()); + + // Act + ExampleModelResponse result = JsonSerializer.Deserialize(json, options); + + // Assert + Assert.IsNull(result.ExampleEnum); + } + + [TestMethod] + public async Task Given_JsonDeserialization_When_ExampleEnum_Is_A_Then_Deserialize_Correctly_To_A() + { + // Arrange + string json = @" { ""exampleEnum"": ""a"" }"; - var options = new JsonSerializerOptions(); - options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); - options.Converters.Add(new ExampleModelResponse.ExampleModelResponseJsonConverter()); - - // Act - ExampleModelResponse result = JsonSerializer.Deserialize(json, options); - - // Assert - Assert.AreEqual(ExampleEnum.A, result.ExampleEnum); + var options = new JsonSerializerOptions(); + options.Converters.Add(new ExampleEnum.ExampleJsonConverter()); + options.Converters.Add(new ExampleModelResponse.ExampleModelResponseJsonConverter()); + + // Act + ExampleModelResponse result = JsonSerializer.Deserialize(json, options); + + // Assert + Assert.AreEqual(ExampleEnum.A, result.ExampleEnum); + } + + internal class ExampleModelResponse + { + /// + /// The optional enum to test. + /// + [JsonPropertyName("exampleEnum")] + public ExampleEnum? ExampleEnum + { + get { return this._ExampleEnumOption; } + set { this._ExampleEnumOption = new(value); } } - - internal class ExampleModelResponse + /// + /// Used to track if an optional field is set. If so, set the . + /// + [JsonIgnore] + public Option _ExampleEnumOption { get; private set; } + + [JsonConstructor] + public ExampleModelResponse(Option exampleEnum) { - /// - /// The optional enum to test. - /// - [JsonPropertyName("exampleEnum")] - public ExampleEnum? ExampleEnum { get { return this._ExampleEnumOption; } set { this._ExampleEnumOption = new(value); } } - - /// - /// Used to track if an optional field is set. If so, set the . - /// - [JsonIgnore] - public Option _ExampleEnumOption { get; private set; } - - [JsonConstructor] - public ExampleModelResponse(Option exampleEnum) - { - this._ExampleEnumOption = exampleEnum; - } + this._ExampleEnumOption = exampleEnum; + } - internal class ExampleModelResponseJsonConverter : JsonConverter + internal class ExampleModelResponseJsonConverter : JsonConverter + { + public override ExampleModelResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - public override ExampleModelResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) - { - int currentDepth = utf8JsonReader.CurrentDepth; + int currentDepth = utf8JsonReader.CurrentDepth; - if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) - throw new JsonException(); + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); - JsonTokenType startingTokenType = utf8JsonReader.TokenType; + JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Option exampleEnum = default; + Option exampleEnum = default; - while (utf8JsonReader.Read()) - { - if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) - break; + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; - if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) - break; + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? jsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); - if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + switch (jsonPropertyName) { - string? jsonPropertyName = utf8JsonReader.GetString(); - utf8JsonReader.Read(); - - switch (jsonPropertyName) - { - case "exampleEnum": - exampleEnum = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - default: - break; - } + case "exampleEnum": + exampleEnum = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; } } - - return new ExampleModelResponse(exampleEnum); } - public override void Write(Utf8JsonWriter writer, ExampleModelResponse response, JsonSerializerOptions jsonSerializerOptions) - { - writer.WritePropertyName("exampleEnum"); - JsonSerializer.Serialize(writer, response.ExampleEnum, jsonSerializerOptions); - } + return new ExampleModelResponse(exampleEnum); } - } - #endregion - + + public override void Write(Utf8JsonWriter writer, ExampleModelResponse response, JsonSerializerOptions jsonSerializerOptions) + { + writer.WritePropertyName("exampleEnum"); + JsonSerializer.Serialize(writer, response.ExampleEnum, jsonSerializerOptions); + } + } } + + #endregion } + #region Arrange ExampleEnum for testing + [JsonConverter(typeof(ExampleJsonConverter))] internal class ExampleEnum : IEnum { @@ -354,4 +355,5 @@ public override void Write(Utf8JsonWriter writer, ExampleEnum value, JsonSeriali } } } + #endregion } \ No newline at end of file diff --git a/Adyen.Test/ClientTest.cs b/Adyen.Test/TerminalApi/ClientTest.cs similarity index 100% rename from Adyen.Test/ClientTest.cs rename to Adyen.Test/TerminalApi/ClientTest.cs diff --git a/Adyen/Core/Client/Extensions/HttpRequestMessageExtensions.cs b/Adyen/Core/Client/Extensions/HttpRequestMessageExtensions.cs new file mode 100644 index 000000000..9ddf330eb --- /dev/null +++ b/Adyen/Core/Client/Extensions/HttpRequestMessageExtensions.cs @@ -0,0 +1,63 @@ +namespace Adyen.Core.Client.Extensions +{ + /// + /// Extension function that adds custom headers and UserAgent to the . + /// + public static class HttpRequestMessageExtensions + { + /// + /// The name of the application. This will be sent as part of , if not null. + /// + public static string ApplicationName { get; set; } + + /// + /// Name of this library. This will be sent as a part of the headers. + /// + public const string AdyenLibraryName = "adyen-dotnet-api-library"; + + /// + /// Version of this library. This will be sent as part of , if not null. + /// + public const string AdyenLibraryVersion = "32.2.1"; // TODO replace this with the actual version. + + /// + /// Adds the UserAgent to the headers of the object. + /// + /// . + /// . + public static HttpRequestMessage AddUserAgentToHeaders(this HttpRequestMessage httpRequestMessage) + { + // Add application name if set. + if (!string.IsNullOrWhiteSpace(ApplicationName)) + { + httpRequestMessage.Headers.Add("UserAgent", $"{ApplicationName} {AdyenLibraryName}/{AdyenLibraryVersion}"); + return httpRequestMessage; + } + + httpRequestMessage.Headers.Add("UserAgent", $"{AdyenLibraryName}/{AdyenLibraryVersion}"); + return httpRequestMessage; + } + + /// + /// Adds the to the headers of the object. + /// + /// . + /// . + public static HttpRequestMessage AddLibraryNameToHeader(this HttpRequestMessage httpRequestMessage) + { + httpRequestMessage.Headers.Add("adyen-library-name", AdyenLibraryName); + return httpRequestMessage; + } + + /// + /// Adds the to the headers of the object. + /// + /// . + /// . + public static HttpRequestMessage AddLibraryVersionToHeader(this HttpRequestMessage httpRequestMessage) + { + httpRequestMessage.Headers.Add("adyen-library-version", AdyenLibraryVersion); + return httpRequestMessage; + } + } +} \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 47c36aceb..b4099ec33 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -28,6 +28,7 @@ using System.Text.Json; using {{packageName}}.{{corePackageName}}; using {{packageName}}.{{corePackageName}}.Auth; using {{packageName}}.{{corePackageName}}.Client; +using {{packageName}}.{{corePackageName}}.Client.Extensions; using {{packageName}}.{{apiName}}.{{clientPackage}}; {{#hasImport}} using {{packageName}}.{{modelPackage}}; @@ -525,6 +526,10 @@ namespace {{packageName}}.{{apiPackage}} {{#consumes}} {{#-first}} + httpRequestMessage.AddUserAgentToHeaders(); + httpRequestMessage.AddLibraryNameToHeader(); + httpRequestMessage.AddLibraryVersionToHeader(); + string{{nrt?}} contentType = ClientUtils.SelectHeaderContentType(contentTypes); if (contentType != null && httpRequestMessage.Content != null) From 5523699821307fac3f7a2960a6124bd5780ea770 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Tue, 4 Nov 2025 17:17:12 +0100 Subject: [PATCH 111/126] Added examples for timeout and retry, circuitbreaker tests --- .../PaymentsServiceIntegrationTest.cs | 65 +++++++++++++++---- .../IHostBuilderExtensions.mustache | 2 +- 2 files changed, 54 insertions(+), 13 deletions(-) diff --git a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index c3097674e..6d69cd976 100644 --- a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -17,16 +17,16 @@ public class PaymentsServiceIntegrationTest public PaymentsServiceIntegrationTest() { IHost host = Host.CreateDefaultBuilder() - .ConfigureCheckout( - (context, services, config) => - { - config.ConfigureAdyenOptions(options => - { - options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; - options.Environment = AdyenEnvironment.Test; - }); - }) - .Build(); + .ConfigureCheckout( + (context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); _paymentsApiService = host.Services.GetRequiredService(); } @@ -48,13 +48,54 @@ public async Task Given_Payments_When_CardDetails_Provided_Returns_OK() encryptedExpiryYear: "test_2030", encryptedSecurityCode: "test_737", holderName: "John Smith" + ) ) - ) - ); + ); IPaymentsApiResponse response = await _paymentsApiService.PaymentsAsync(Guid.NewGuid().ToString(), request); response.TryDeserializeOkResponse(out var result); Assert.AreEqual(result?.MerchantReference, "reference"); } + + [TestMethod] + public void HttpClientBuilderExtensions_Polly_Retry_CircuitBreaker_Timeout_Example() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureCheckout( + (context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }, + httpClientBuilderDelegate: (IHttpClientBuilder builder) => + { + builder.AddRetryPolicy(5); + builder.AddCircuitBreakerPolicy(3, TimeSpan.FromSeconds(30)); + builder.AddTimeoutPolicy(TimeSpan.FromMinutes(5)); + }) + .Build(); + } + + [TestMethod] + public void HttpClientBuilderExtensions_Regular_Timeout_Modify_HttpClient_Example() + { + IHost host = Host.CreateDefaultBuilder() + .ConfigureCheckout( + (context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }, client => + { + client.Timeout = TimeSpan.FromMinutes(1); + }) + .Build(); + } } } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache index c6538f9cb..779e2fed4 100644 --- a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache @@ -43,7 +43,7 @@ namespace {{packageName}}.{{apiName}}.Extensions /// . /// . /// . - public static IHostBuilder Configure{{apiName}}(this IHostBuilder hostBuilder, Action hostConfigurationDelegate, Action? httpClientDelegate, Action? httpClientBuilderDelegate = null) + public static IHostBuilder Configure{{apiName}}(this IHostBuilder hostBuilder, Action hostConfigurationDelegate, Action? httpClientDelegate = null, Action? httpClientBuilderDelegate = null) { hostBuilder.ConfigureServices((context, services) => { From 8405737de91992300aa0f6331787a73589bae0d3 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Tue, 4 Nov 2025 17:29:22 +0100 Subject: [PATCH 112/126] Moved tests for headers (UserAgent) and idempotency key tests for old client --- Adyen.Test/{ => TerminalApi}/HeaderRequestTest.cs | 9 +++++---- .../Client/Extensions/HttpRequestMessageExtensions.cs | 4 ++-- Adyen/TerminalApi/HttpClient/HttpClientWrapper.cs | 9 +++++---- 3 files changed, 12 insertions(+), 10 deletions(-) rename Adyen.Test/{ => TerminalApi}/HeaderRequestTest.cs (92%) diff --git a/Adyen.Test/HeaderRequestTest.cs b/Adyen.Test/TerminalApi/HeaderRequestTest.cs similarity index 92% rename from Adyen.Test/HeaderRequestTest.cs rename to Adyen.Test/TerminalApi/HeaderRequestTest.cs index 5b9282498..fe9804606 100644 --- a/Adyen.Test/HeaderRequestTest.cs +++ b/Adyen.Test/TerminalApi/HeaderRequestTest.cs @@ -1,6 +1,7 @@ using System.Linq; using System.Net.Http; using Adyen.Constants; +using Adyen.Core.Client.Extensions; using Adyen.HttpClient; using Adyen.Model; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -165,7 +166,7 @@ public void UserAgentPresentWhenApplicationNameIsProvidedTest() var client = new HttpClientWrapper(config, new System.Net.Http.HttpClient()); HttpRequestMessage httpWebRequest = client.GetHttpRequestMessage(_endpoint, "requestBody", null, null); - Assert.AreEqual(httpWebRequest.Headers.GetValues("UserAgent").FirstOrDefault(), $"YourApplicationName {ClientConfig.LibName}/{ClientConfig.LibVersion}"); + Assert.AreEqual(httpWebRequest.Headers.GetValues("UserAgent").FirstOrDefault(), $"YourApplicationName {HttpRequestMessageExtensions.AdyenLibraryName}/{HttpRequestMessageExtensions.AdyenLibraryVersion}"); } [TestMethod] @@ -181,7 +182,7 @@ public void UserAgentPresentWhenApplicationNameIsNotProvidedTest() var client = new HttpClientWrapper(config, new System.Net.Http.HttpClient()); HttpRequestMessage httpWebRequest = client.GetHttpRequestMessage(_endpoint, "requestBody", null, null); - Assert.AreEqual(httpWebRequest.Headers.GetValues("UserAgent").FirstOrDefault(), $"{ClientConfig.LibName}/{ClientConfig.LibVersion}"); + Assert.AreEqual(httpWebRequest.Headers.GetValues("UserAgent").FirstOrDefault(), $"{HttpRequestMessageExtensions.AdyenLibraryName}/{HttpRequestMessageExtensions.AdyenLibraryVersion}"); } [TestMethod] @@ -198,9 +199,9 @@ public void LibraryAnalysisConstantsInHeaderTest() HttpRequestMessage httpWebRequest = client.GetHttpRequestMessage(_endpoint, "requestBody", null, null); Assert.IsNotNull(httpWebRequest.Headers.GetValues(ApiConstants.AdyenLibraryName)); - Assert.AreEqual(ClientConfig.LibName, httpWebRequest.Headers.GetValues(ApiConstants.AdyenLibraryName).FirstOrDefault()); + Assert.AreEqual(HttpRequestMessageExtensions.AdyenLibraryName, httpWebRequest.Headers.GetValues("adyen-library-name").FirstOrDefault()); Assert.IsNotNull(httpWebRequest.Headers.GetValues(ApiConstants.AdyenLibraryVersion)); - Assert.AreEqual(ClientConfig.LibVersion, httpWebRequest.Headers.GetValues(ApiConstants.AdyenLibraryVersion).FirstOrDefault()); + Assert.AreEqual(HttpRequestMessageExtensions.AdyenLibraryVersion, httpWebRequest.Headers.GetValues("adyen-library-version").FirstOrDefault()); } } } diff --git a/Adyen/Core/Client/Extensions/HttpRequestMessageExtensions.cs b/Adyen/Core/Client/Extensions/HttpRequestMessageExtensions.cs index 9ddf330eb..077af8da6 100644 --- a/Adyen/Core/Client/Extensions/HttpRequestMessageExtensions.cs +++ b/Adyen/Core/Client/Extensions/HttpRequestMessageExtensions.cs @@ -6,7 +6,7 @@ namespace Adyen.Core.Client.Extensions public static class HttpRequestMessageExtensions { /// - /// The name of the application. This will be sent as part of , if not null. + /// The name of the application. /// public static string ApplicationName { get; set; } @@ -16,7 +16,7 @@ public static class HttpRequestMessageExtensions public const string AdyenLibraryName = "adyen-dotnet-api-library"; /// - /// Version of this library. This will be sent as part of , if not null. + /// Version of this library. /// public const string AdyenLibraryVersion = "32.2.1"; // TODO replace this with the actual version. diff --git a/Adyen/TerminalApi/HttpClient/HttpClientWrapper.cs b/Adyen/TerminalApi/HttpClient/HttpClientWrapper.cs index c393a1169..c7b16621e 100644 --- a/Adyen/TerminalApi/HttpClient/HttpClientWrapper.cs +++ b/Adyen/TerminalApi/HttpClient/HttpClientWrapper.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using System.Web; using Adyen.Constants; +using Adyen.Core.Client.Extensions; using Adyen.HttpClient.Interfaces; using Adyen.Model; @@ -68,11 +69,11 @@ public HttpRequestMessage GetHttpRequestMessage(string endpoint, string requestB if (!string.IsNullOrWhiteSpace(_config.ApplicationName)) { - httpRequestMessage.Headers.Add("UserAgent", $"{_config.ApplicationName} {ClientConfig.UserAgentSuffix}{ClientConfig.LibVersion}"); + httpRequestMessage.Headers.Add("UserAgent", $"{_config.ApplicationName} {HttpRequestMessageExtensions.AdyenLibraryName}/{HttpRequestMessageExtensions.AdyenLibraryVersion}"); } else { - httpRequestMessage.Headers.Add("UserAgent", $"{ClientConfig.UserAgentSuffix}{ClientConfig.LibVersion}"); + httpRequestMessage.Headers.Add("UserAgent", $"{HttpRequestMessageExtensions.AdyenLibraryName}/{HttpRequestMessageExtensions.AdyenLibraryVersion}"); } if (!string.IsNullOrWhiteSpace(requestOptions?.IdempotencyKey)) @@ -94,8 +95,8 @@ public HttpRequestMessage GetHttpRequestMessage(string endpoint, string requestB } // Add library name and version to request for analysis - httpRequestMessage.Headers.Add(ApiConstants.AdyenLibraryName, ClientConfig.LibName); - httpRequestMessage.Headers.Add(ApiConstants.AdyenLibraryVersion, ClientConfig.LibVersion); + httpRequestMessage.Headers.Add("adyen-library-name", HttpRequestMessageExtensions.AdyenLibraryName); + httpRequestMessage.Headers.Add("adyen-library-version", HttpRequestMessageExtensions.AdyenLibraryVersion); return httpRequestMessage; } From 4d3b07dc4204878b01dc443ddeabc74fe472928a Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Wed, 5 Nov 2025 17:31:24 +0100 Subject: [PATCH 113/126] Clean-up, removed functions that are overkill --- .../PaymentsServiceIntegrationTest.cs | 124 ++++++++++++++++++ Adyen/Core/Client/ApiResponse.cs | 68 ++++++---- Adyen/Core/Client/ApiResponseEventArgs.cs | 8 +- Adyen/Core/Client/UrlBuilderExtensions.cs | 4 +- Adyen/Core/Options/AdyenOptions.cs | 5 + .../csharp/libraries/generichost/api.mustache | 64 ++------- 6 files changed, 184 insertions(+), 89 deletions(-) diff --git a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index 6d69cd976..9a69fa891 100644 --- a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -56,6 +56,76 @@ public async Task Given_Payments_When_CardDetails_Provided_Returns_OK() response.TryDeserializeOkResponse(out var result); Assert.AreEqual(result?.MerchantReference, "reference"); } + + [TestMethod] + public async Task Given_Payments_When_CardDetails_Without_Idempotency_Key_Provided_Returns_DifferentRefs() + { + // Test when no idempotency key is provided + var request = new PaymentRequest( + amount: new Amount("EUR", 1999), + merchantAccount: "HeapUnderflowECOM", + reference: "ref1-original-request-1", + returnUrl: "https://adyen.com/", + paymentMethod: new CheckoutPaymentMethod( + new CardDetails( + type: CardDetails.TypeEnum.Scheme, + encryptedCardNumber: "test_4111111111111111", + encryptedExpiryMonth: "test_03", + encryptedExpiryYear: "test_2030", + encryptedSecurityCode: "test_737", + holderName: "John Smith" + ) + ) + ); + IPaymentsApiResponse response = await _paymentsApiService.PaymentsAsync(paymentRequest: request); + + response.TryDeserializeOkResponse(out PaymentResponse result); + Assert.AreEqual(result?.MerchantReference, "ref1-original-request-1"); + + + // Test when no idempotency key is provided + var request2 = new PaymentRequest( + amount: new Amount("EUR", 1999), + merchantAccount: "HeapUnderflowECOM", + reference: "ref2-should-be-different", + returnUrl: "https://adyen.com/", + paymentMethod: new CheckoutPaymentMethod( + new CardDetails( + type: CardDetails.TypeEnum.Scheme, + encryptedCardNumber: "test_4111111111111111", + encryptedExpiryMonth: "test_03", + encryptedExpiryYear: "test_2030", + encryptedSecurityCode: "test_737", + holderName: "John Smith" + ) + ) + ); + IPaymentsApiResponse response2 = await _paymentsApiService.PaymentsAsync(paymentRequest: request2); + + response2.TryDeserializeOkResponse(out PaymentResponse result2); + Assert.AreEqual(result2?.MerchantReference, "ref2-should-be-different"); + + // Test when null is explicitly provided. + var request3 = new PaymentRequest( + amount: new Amount("EUR", 1999), + merchantAccount: "HeapUnderflowECOM", + reference: "ref3-should-be-very-different", + returnUrl: "https://adyen.com/", + paymentMethod: new CheckoutPaymentMethod( + new CardDetails( + type: CardDetails.TypeEnum.Scheme, + encryptedCardNumber: "test_4111111111111111", + encryptedExpiryMonth: "test_03", + encryptedExpiryYear: "test_2030", + encryptedSecurityCode: "test_737", + holderName: "John Smith" + ) + ) + ); + IPaymentsApiResponse response3 = await _paymentsApiService.PaymentsAsync(null, request3); + response3.TryDeserializeOkResponse(out PaymentResponse result3); + Assert.AreEqual(result3?.MerchantReference, "ref3-should-be-very-different"); + } [TestMethod] public void HttpClientBuilderExtensions_Polly_Retry_CircuitBreaker_Timeout_Example() @@ -97,5 +167,59 @@ public void HttpClientBuilderExtensions_Regular_Timeout_Modify_HttpClient_Exampl }) .Build(); } + + [TestMethod] + public async Task PaymentsServiceEvents_Override_Delegates_Example() + { + // Arrange + IHost host = Host.CreateDefaultBuilder() + .ConfigureCheckout( + (context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + var request = new PaymentRequest( + amount: new Amount("EUR", 1999), + merchantAccount: "HeapUnderflowECOM", + reference: "reference", + returnUrl: "https://adyen.com/", + paymentMethod: new CheckoutPaymentMethod( + new CardDetails( + type: CardDetails.TypeEnum.Scheme, + encryptedCardNumber: "test_4111111111111111", + encryptedExpiryMonth: "test_03", + encryptedExpiryYear: "test_2030", + encryptedSecurityCode: "test_737", + holderName: "John Smith" + ) + ) + ); + + + PaymentsServiceEvents paymentsServiceEvents = host.Services.GetRequiredService(); + IPaymentsService paymentsApiService = host.Services.GetRequiredService(); + + bool isCalled = false; + + // Example override using a delegate: + paymentsServiceEvents.OnPayments += (sender, args) => + { + Console.WriteLine("OnPayments event received - IsSuccessStateCode: " + args.ApiResponse.IsSuccessStatusCode); + isCalled = true; + }; + + + // Act + await paymentsApiService.PaymentsAsync(Guid.NewGuid().ToString(), request); + + // Assert + Assert.IsTrue(isCalled); + } } } \ No newline at end of file diff --git a/Adyen/Core/Client/ApiResponse.cs b/Adyen/Core/Client/ApiResponse.cs index a96e6c014..080868a51 100644 --- a/Adyen/Core/Client/ApiResponse.cs +++ b/Adyen/Core/Client/ApiResponse.cs @@ -11,12 +11,12 @@ namespace Adyen.Core.Client public partial interface IApiResponse { /// - /// The IsSuccessStatusCode from the api response + /// The IsSuccessStatusCode from the api response. /// bool IsSuccessStatusCode { get; } /// - /// Gets the status code (HTTP status code) + /// Gets the status code (). /// /// The status code. HttpStatusCode StatusCode { get; } @@ -27,7 +27,7 @@ public partial interface IApiResponse string RawContent { get; } /// - /// The raw binary stream (only set for binary responses) + /// The raw binary stream (only set for binary responses). /// System.IO.Stream? ContentStream { get; } @@ -37,7 +37,7 @@ public partial interface IApiResponse DateTime DownloadedAt { get; } /// - /// The headers contained in the api response + /// The headers contained in the api response. /// System.Net.Http.Headers.HttpResponseHeaders Headers { get; } @@ -47,7 +47,7 @@ public partial interface IApiResponse string Path { get; } /// - /// The reason phrase contained in the api response + /// The reason phrase contained in the API response. /// string? ReasonPhrase { get; } @@ -74,27 +74,37 @@ public partial class ApiResponse : IApiResponse public HttpStatusCode StatusCode { get; } /// - /// The raw data + /// The raw data. /// public string RawContent { get; protected set; } /// - /// The raw binary stream (only set for binary responses) + /// The . + /// + public HttpRequestMessage HttpRequestMessage { get; } + + /// + /// The . + /// + public HttpResponseMessage HttpResponseMessage { get; } + + /// + /// The raw binary stream (only set for binary responses). /// public System.IO.Stream? ContentStream { get; protected set; } /// - /// The IsSuccessStatusCode from the api response + /// The IsSuccessStatusCode from the API response. /// public bool IsSuccessStatusCode { get; } /// - /// The reason phrase contained in the api response + /// The reason phrase contained in the API response. /// public string? ReasonPhrase { get; } /// - /// The headers contained in the api response + /// The headers contained in the API response. /// public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } @@ -119,21 +129,23 @@ public partial class ApiResponse : IApiResponse public Uri? RequestUri { get; } /// - /// The + /// The . /// protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; /// - /// Construct the response using an HttpResponseMessage + /// Construct the response using the and . /// - /// - /// - /// - /// - /// - /// + /// . + /// + /// The raw data. + /// The path used when making the request. + /// The DateTime.UtcNow when the request was sent. + /// The . public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) { + HttpRequestMessage = httpRequestMessage; + HttpResponseMessage = httpResponseMessage; StatusCode = httpResponseMessage.StatusCode; Headers = httpResponseMessage.Headers; IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; @@ -143,20 +155,21 @@ public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage RequestUri = httpRequestMessage.RequestUri; RequestedAt = requestedAt; _jsonSerializerOptions = jsonSerializerOptions; - OnCreated(httpRequestMessage, httpResponseMessage); } /// - /// Construct the response using an HttpResponseMessage. + /// Construct the response using the and . /// - /// - /// - /// - /// - /// - /// + /// . + /// . + /// The raw binary stream (only set for binary responses). + /// The path used when making the request. + /// The DateTime.UtcNow when the request was sent. + /// The . public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) { + HttpRequestMessage = httpRequestMessage; + HttpResponseMessage = httpResponseMessage; StatusCode = httpResponseMessage.StatusCode; Headers = httpResponseMessage.Headers; IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; @@ -167,10 +180,7 @@ public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage RequestUri = httpRequestMessage.RequestUri; RequestedAt = requestedAt; _jsonSerializerOptions = jsonSerializerOptions; - OnCreated(httpRequestMessage, httpResponseMessage); } - - partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); } /// diff --git a/Adyen/Core/Client/ApiResponseEventArgs.cs b/Adyen/Core/Client/ApiResponseEventArgs.cs index baf9e69e6..35a1e8bb4 100644 --- a/Adyen/Core/Client/ApiResponseEventArgs.cs +++ b/Adyen/Core/Client/ApiResponseEventArgs.cs @@ -3,19 +3,19 @@ namespace Adyen.Core.Client { /// - /// Useful for tracking server health + /// Used for tracking server health. /// public class ApiResponseEventArgs : EventArgs { /// - /// The ApiResponse + /// The ApiResponse. /// public ApiResponse ApiResponse { get; } /// - /// The ApiResponseEventArgs + /// The . /// - /// + /// . public ApiResponseEventArgs(ApiResponse apiResponse) { ApiResponse = apiResponse; diff --git a/Adyen/Core/Client/UrlBuilderExtensions.cs b/Adyen/Core/Client/UrlBuilderExtensions.cs index a99aa23b6..37885f81a 100644 --- a/Adyen/Core/Client/UrlBuilderExtensions.cs +++ b/Adyen/Core/Client/UrlBuilderExtensions.cs @@ -12,7 +12,7 @@ public static class UrlBuilderExtensions /// /// . /// The base URL of the API. - /// String with the Host URL. + /// String containing the Host URL. /// public static string ConstructHostUrl(AdyenOptions adyenOptions, string baseUrl) { @@ -33,7 +33,7 @@ public static string ConstructHostUrl(AdyenOptions adyenOptions, string baseUrl) /// /// The Live endpoint url prefix. /// The base URL of the API. - /// baseUrl + /// String containing the LIVE URL. /// public static string ConstructLiveUrl(string liveEndpointUrlPrefix, string url) { diff --git a/Adyen/Core/Options/AdyenOptions.cs b/Adyen/Core/Options/AdyenOptions.cs index 045f004fe..3da6480b9 100644 --- a/Adyen/Core/Options/AdyenOptions.cs +++ b/Adyen/Core/Options/AdyenOptions.cs @@ -21,5 +21,10 @@ public class AdyenOptions /// 2. For Platforms & Financial Services, visit: https://docs.adyen.com/adyen-for-platforms-model to get started. /// public string AdyenApiKey { get; set; } + + /// + /// If this is set to true, we log every + /// + public bool IsLogInformationServices { get; set; } = false; } } \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index b4099ec33..956da7419 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -222,43 +222,6 @@ namespace {{packageName}}.{{apiPackage}} } {{#operation}} - {{#allParams}} - {{#-first}} - partial void Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - - {{/-first}} - {{/allParams}} - {{#vendorExtensions.x-has-not-nullable-reference-types}} - /// - /// Validates the request parameters. - /// - {{#vendorExtensions.x-not-nullable-reference-types}} - /// - {{/vendorExtensions.x-not-nullable-reference-types}} - /// - private void Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}) - { - {{#lambda.trimTrailingWithNewLine}} - {{#vendorExtensions.x-not-nullable-reference-types}} - {{#required}} - {{^vendorExtensions.x-is-value-type}} - if ({{paramName}} == null) - throw new ArgumentNullException(nameof({{paramName}})); - - {{/vendorExtensions.x-is-value-type}} - {{/required}} - {{^required}} - {{^vendorExtensions.x-is-value-type}} - if ({{paramName}}.IsSet && {{paramName}}.Value == null) - throw new ArgumentNullException(nameof({{paramName}})); - - {{/vendorExtensions.x-is-value-type}} - {{/required}} - {{/vendorExtensions.x-not-nullable-reference-types}} - {{/lambda.trimTrailingWithNewLine}} - } - - {{/vendorExtensions.x-has-not-nullable-reference-types}} /// /// Processes the server response. /// @@ -266,10 +229,10 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - private void After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponse {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + private void OnAfterRequestSent({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponse {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) { bool suppressDefaultLog = false; - After{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog apiResponse {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + OnAfterRequestSent({{#lambda.joinWithComma}}ref suppressDefaultLog apiResponse {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); {{>AfterOperationDefaultImplementation}} } @@ -281,7 +244,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponse {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + partial void OnAfterRequestSent({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponse {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); /// /// Logs exceptions that occur while retrieving the server response. @@ -336,16 +299,6 @@ namespace {{packageName}}.{{apiPackage}} try { - {{#vendorExtensions.x-has-not-nullable-reference-types}} - Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}); - - {{/vendorExtensions.x-has-not-nullable-reference-types}} - {{#allParams}} - {{#-first}} - Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - - {{/-first}} - {{/allParams}} using (HttpRequestMessage httpRequestMessage = new HttpRequestMessage()) { {{^servers}} @@ -430,7 +383,7 @@ namespace {{packageName}}.{{apiPackage}} {{/required}} {{^required}} - if ({{paramName}}.IsSet) + if ({{paramName}}.IsSet && {{paramName}}.Value != null) httpRequestMessage.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value)); {{/required}} @@ -486,8 +439,9 @@ namespace {{packageName}}.{{apiPackage}} {{! Only use API Keys that are appended to the HTTP-headers }} {{^isKeyInCookie}} {{#isKeyInHeader}} - ApiKeyToken apiKeyToken{{-index}} = (ApiKeyToken) ApiKeyProvider.Get(); - apiKeyToken{{-index}}.AddTokenToHttpRequestMessageHeader(httpRequestMessage); + // Add authorization token to your HttpRequestMessage header + ApiKeyProvider.Get().AddTokenToHttpRequestMessageHeader(httpRequestMessage); + {{/isKeyInHeader}} {{/isKeyInCookie}} {{/isApiKey}} @@ -495,10 +449,12 @@ namespace {{packageName}}.{{apiPackage}} httpRequestMessage.RequestUri = uriBuilder.Uri; {{#authMethods}} {{#isBasicBearer}} + // Not supported, you'll have to add the BearerToken class and fetch is similar to the ApiKeyProvider. BearerToken bearerToken{{-index}} = (BearerToken) await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); bearerToken{{-index}}.UseInHeader(httpRequestMessage, "{{keyParamName}}"); {{/isBasicBearer}} {{#isOAuth}} + // Not supported (yet), you'll have to add the BearerToken class and fetch is similar to the ApiKeyProvider. OAuthToken oauthToken{{-index}} = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); oauthToken{{-index}}.UseInHeader(httpRequestMessage, "{{keyParamName}}"); {{/isOAuth}} @@ -598,7 +554,7 @@ namespace {{packageName}}.{{apiPackage}} } } - After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponse {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + OnAfterRequestSent({{#lambda.joinWithComma}}apiResponse {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); Events.ExecuteOn{{operationId}}(apiResponse); From 2c82522b327814af0aac7f553d8c9a5cf2027844 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 6 Nov 2025 00:30:20 +0100 Subject: [PATCH 114/126] Cleaned-up templates --- .../PaymentsServiceIntegrationTest.cs | 7 +- Adyen/Core/Client/ApiResponse.cs | 20 +---- Adyen/Core/Client/ApiResponseEventArgs.cs | 6 +- ...terOperationDefaultImplementation.mustache | 2 - .../generichost/HostConfiguration.mustache | 8 +- .../IServiceCollectionExtensions.mustache | 7 +- .../OnErrorDefaultImplementation.mustache | 2 - .../csharp/libraries/generichost/api.mustache | 75 +++---------------- 8 files changed, 23 insertions(+), 104 deletions(-) delete mode 100644 templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache delete mode 100644 templates-v7/csharp/libraries/generichost/OnErrorDefaultImplementation.mustache diff --git a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index 9a69fa891..c7fe996d1 100644 --- a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -205,21 +205,20 @@ public async Task PaymentsServiceEvents_Override_Delegates_Example() PaymentsServiceEvents paymentsServiceEvents = host.Services.GetRequiredService(); IPaymentsService paymentsApiService = host.Services.GetRequiredService(); - bool isCalled = false; + int isCalledOnce = 0; // Example override using a delegate: paymentsServiceEvents.OnPayments += (sender, args) => { Console.WriteLine("OnPayments event received - IsSuccessStateCode: " + args.ApiResponse.IsSuccessStatusCode); - isCalled = true; + isCalledOnce++; }; - // Act await paymentsApiService.PaymentsAsync(Guid.NewGuid().ToString(), request); // Assert - Assert.IsTrue(isCalled); + Assert.IsTrue(isCalledOnce == 1); } } } \ No newline at end of file diff --git a/Adyen/Core/Client/ApiResponse.cs b/Adyen/Core/Client/ApiResponse.cs index 080868a51..4ac2c12ea 100644 --- a/Adyen/Core/Client/ApiResponse.cs +++ b/Adyen/Core/Client/ApiResponse.cs @@ -78,16 +78,6 @@ public partial class ApiResponse : IApiResponse /// public string RawContent { get; protected set; } - /// - /// The . - /// - public HttpRequestMessage HttpRequestMessage { get; } - - /// - /// The . - /// - public HttpResponseMessage HttpResponseMessage { get; } - /// /// The raw binary stream (only set for binary responses). /// @@ -134,18 +124,16 @@ public partial class ApiResponse : IApiResponse protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; /// - /// Construct the response using the and . + /// Construct the response using an HttpResponseMessage. /// /// . /// /// The raw data. /// The path used when making the request. - /// The DateTime.UtcNow when the request was sent. + /// The when the request was sent. /// The . public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) { - HttpRequestMessage = httpRequestMessage; - HttpResponseMessage = httpResponseMessage; StatusCode = httpResponseMessage.StatusCode; Headers = httpResponseMessage.Headers; IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; @@ -158,7 +146,7 @@ public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage } /// - /// Construct the response using the and . + /// Construct the response using an HttpResponseMessage. /// /// . /// . @@ -168,8 +156,6 @@ public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage /// The . public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) { - HttpRequestMessage = httpRequestMessage; - HttpResponseMessage = httpResponseMessage; StatusCode = httpResponseMessage.StatusCode; Headers = httpResponseMessage.Headers; IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; diff --git a/Adyen/Core/Client/ApiResponseEventArgs.cs b/Adyen/Core/Client/ApiResponseEventArgs.cs index 35a1e8bb4..7f6d48f23 100644 --- a/Adyen/Core/Client/ApiResponseEventArgs.cs +++ b/Adyen/Core/Client/ApiResponseEventArgs.cs @@ -3,17 +3,17 @@ namespace Adyen.Core.Client { /// - /// Used for tracking server health. + /// This class is used for wrapping the . /// public class ApiResponseEventArgs : EventArgs { /// - /// The ApiResponse. + /// The . /// public ApiResponse ApiResponse { get; } /// - /// The . + /// The constructed from the Adyen . /// /// . public ApiResponseEventArgs(ApiResponse apiResponse) diff --git a/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache b/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache deleted file mode 100644 index b6d7d48fa..000000000 --- a/templates-v7/csharp/libraries/generichost/AfterOperationDefaultImplementation.mustache +++ /dev/null @@ -1,2 +0,0 @@ - if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponse.DownloadedAt - apiResponse.RequestedAt).TotalSeconds, apiResponse.StatusCode, apiResponse.Path); diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index f274027b7..eb4d76ad9 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -33,8 +33,6 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} private readonly IServiceCollection _services; private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); private readonly AdyenOptions _adyenOptions = new AdyenOptions(); - - internal bool HttpClientsAdded { get; private set; } /// /// The base path of the API, it includes the http(s)-scheme, the host domain name, and the base path. @@ -116,7 +114,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} // Configure HttpClient set by the user. httpClientDelegate?.Invoke(httpClient); - // Set BaseAddress if it's not set + // Set BaseAddress if it's not set. if (httpClient.BaseAddress == null) httpClient.BaseAddress = new Uri(UrlBuilderExtensions.ConstructHostUrl(_adyenOptions, BASE_URL)); }; @@ -128,9 +126,7 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} if (httpClientBuilderDelegate != null) foreach (IHttpClientBuilder builder in builders) httpClientBuilderDelegate(builder); - - HttpClientsAdded = true; - + return this; } diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index 964d7c776..01e756186 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -21,17 +21,16 @@ namespace {{packageName}}.{{apiName}}.Extensions /// /// . /// Configure your . - public static void Add{{apiName}}Services(this IServiceCollection services, Action hostConfigurationDelegate) + public static void Add{{apiName}}Services(this IServiceCollection services, Action hostConfigurationDelegate, Action? httpClientDelegate = null, Action? httpClientBuilderDelegate = null) { HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); hostConfigurationDelegate(config); - Add{{apiName}}Services(services, config); + Add{{apiName}}Services(services, config, httpClientDelegate, httpClientBuilderDelegate); } internal static void Add{{apiName}}Services(IServiceCollection services, HostConfiguration hostConfiguration, Action? httpClientDelegate = null, Action? httpClientBuilderDelegate = null) { - if (!hostConfiguration.HttpClientsAdded) - hostConfiguration.Add{{apiName}}HttpClients(httpClientDelegate, httpClientBuilderDelegate); + hostConfiguration.Add{{apiName}}HttpClients(httpClientDelegate, httpClientBuilderDelegate); {{#models}} {{#model.vendorExtensions.x-webhook-root}} diff --git a/templates-v7/csharp/libraries/generichost/OnErrorDefaultImplementation.mustache b/templates-v7/csharp/libraries/generichost/OnErrorDefaultImplementation.mustache deleted file mode 100644 index 7af8e0760..000000000 --- a/templates-v7/csharp/libraries/generichost/OnErrorDefaultImplementation.mustache +++ /dev/null @@ -1,2 +0,0 @@ - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while sending the request to the server."); \ No newline at end of file diff --git a/templates-v7/csharp/libraries/generichost/api.mustache b/templates-v7/csharp/libraries/generichost/api.mustache index 956da7419..82eb96f3d 100644 --- a/templates-v7/csharp/libraries/generichost/api.mustache +++ b/templates-v7/csharp/libraries/generichost/api.mustache @@ -60,10 +60,10 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call. {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + /// {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// . - /// <> + /// of . {{#isDeprecated}} [Obsolete("{{#vendorExtensions.x-deprecatedInVersion}}Deprecated since {{#appName}}{{{.}}}{{/appName}} v{{#vendorExtensions.x-deprecatedInVersion}}{{.}}{{/vendorExtensions.x-deprecatedInVersion}}.{{/vendorExtensions.x-deprecatedInVersion}}{{#vendorExtensions.x-deprecatedMessage}} {{{.}}}{{/vendorExtensions.x-deprecatedMessage}}")] {{/isDeprecated}} @@ -221,60 +221,6 @@ namespace {{packageName}}.{{apiPackage}} CookieContainer = cookieContainer;{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}} } {{#operation}} - - /// - /// Processes the server response. - /// - /// - {{#allParams}} - /// - {{/allParams}} - private void OnAfterRequestSent({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponse {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) - { - bool suppressDefaultLog = false; - OnAfterRequestSent({{#lambda.joinWithComma}}ref suppressDefaultLog apiResponse {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); -{{>AfterOperationDefaultImplementation}} - } - - /// - /// Processes the server response. - /// - /// - /// - {{#allParams}} - /// - {{/allParams}} - partial void OnAfterRequestSent({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponse {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); - - /// - /// Logs exceptions that occur while retrieving the server response. - /// - /// - /// - /// - {{#allParams}} - /// - {{/allParams}} - private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exception string pathFormat string path {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) - { - bool suppressDefaultLog = false; - OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog exception pathFormat path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); -{{>OnErrorDefaultImplementation}} - - } - - /// - /// A partial method that gives developers a way to provide customized exception handling. - /// - /// - /// - /// - /// - {{#allParams}} - /// - {{/allParams}} - partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog Exception exception string pathFormat string path {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); - /// /// {{summary}} {{notes}} /// @@ -553,11 +499,8 @@ namespace {{packageName}}.{{apiPackage}} break; } } - - OnAfterRequestSent({{#lambda.joinWithComma}}apiResponse {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); - + Events.ExecuteOn{{operationId}}(apiResponse); - {{#net80OrLater}} {{#responses}} {{#vendorExtensions.x-set-cookie}} @@ -595,10 +538,9 @@ namespace {{packageName}}.{{apiPackage}} } } } - catch(Exception e) + catch(Exception exception) { - OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}e "{{{path}}}" uriBuilder.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); - Events.ExecuteOnError{{operationId}}(e); + Events.ExecuteOnError{{operationId}}(exception); throw; } {{/lambda.trimLineBreaks}} @@ -706,9 +648,9 @@ namespace {{packageName}}.{{apiPackage}} { result = {{vendorExtensions.x-http-status}}(); } - catch (Exception e) + catch (Exception exception) { - OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode){{#vendorExtensions.x-http-status-range}}{{.}}{{/vendorExtensions.x-http-status-range}}{{^vendorExtensions.x-http-status-range}}{{code}}{{/vendorExtensions.x-http-status-range}}); + OnDeserializationError(exception, (HttpStatusCode){{#vendorExtensions.x-http-status-range}}{{.}}{{/vendorExtensions.x-http-status-range}}{{^vendorExtensions.x-http-status-range}}{{code}}{{/vendorExtensions.x-http-status-range}}); } return result != null; @@ -716,7 +658,7 @@ namespace {{packageName}}.{{apiPackage}} {{/dataType}} {{#-last}} - private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + private void OnDeserializationError(Exception exception, HttpStatusCode httpStatusCode) { bool suppressDefaultLog = false; OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); @@ -731,6 +673,7 @@ namespace {{packageName}}.{{apiPackage}} {{/-last}} {{/responses}} } + {{/-first}} {{/responses}} {{/vendorExtensions.x-duplicates}} From 8cac881829479ec0acfbe28b828272360bbc5d09 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 6 Nov 2025 00:33:29 +0100 Subject: [PATCH 115/126] Add documentation to Core classes --- Adyen/Core/Client/ApiResponse.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Adyen/Core/Client/ApiResponse.cs b/Adyen/Core/Client/ApiResponse.cs index 4ac2c12ea..1eb24e24b 100644 --- a/Adyen/Core/Client/ApiResponse.cs +++ b/Adyen/Core/Client/ApiResponse.cs @@ -11,7 +11,7 @@ namespace Adyen.Core.Client public partial interface IApiResponse { /// - /// The IsSuccessStatusCode from the api response. + /// The IsSuccessStatusCode from the API response. /// bool IsSuccessStatusCode { get; } @@ -37,7 +37,7 @@ public partial interface IApiResponse DateTime DownloadedAt { get; } /// - /// The headers contained in the api response. + /// The headers contained in the API response. /// System.Net.Http.Headers.HttpResponseHeaders Headers { get; } @@ -68,7 +68,7 @@ public partial interface IApiResponse public partial class ApiResponse : IApiResponse { /// - /// Gets the status code (HTTP status code) + /// Gets the status code (HTTP status code). /// /// The status code. public HttpStatusCode StatusCode { get; } @@ -99,7 +99,7 @@ public partial class ApiResponse : IApiResponse public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } /// - /// The DateTime when the request was retrieved. + /// The DateTime (default: UtcNow) when the request was retrieved. /// public DateTime DownloadedAt { get; } = DateTime.UtcNow; @@ -114,7 +114,7 @@ public partial class ApiResponse : IApiResponse public string Path { get; } /// - /// The Uri used when making the request. + /// The used when making the request. /// public Uri? RequestUri { get; } @@ -146,7 +146,7 @@ public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage } /// - /// Construct the response using an HttpResponseMessage. + /// Construct the response using the . /// /// . /// . From bf3141b9db039b546b5700f9d2e2e41cd6afc1c9 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 6 Nov 2025 00:36:30 +0100 Subject: [PATCH 116/126] Move mock data tests --- Adyen.Test/MockOpenInvoicePayment.cs | 86 ------------- Adyen.Test/MockPaymentData.cs | 114 ---------------- Adyen.Test/PaymentTest.cs | 186 ++++++++++++++++++++++++++- 3 files changed, 185 insertions(+), 201 deletions(-) delete mode 100644 Adyen.Test/MockOpenInvoicePayment.cs delete mode 100644 Adyen.Test/MockPaymentData.cs diff --git a/Adyen.Test/MockOpenInvoicePayment.cs b/Adyen.Test/MockOpenInvoicePayment.cs deleted file mode 100644 index 36549db78..000000000 --- a/Adyen.Test/MockOpenInvoicePayment.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using Adyen.Model.Payment; - -namespace Adyen.Test -{ - public class MockOpenInvoicePayment - { - public static PaymentRequest CreateOpenInvoicePaymentRequest() - { - - DateTime dateOfBirth = DateTime.Parse("1970-07-10"); - - PaymentRequest paymentRequest = MockPaymentData.CreateFullPaymentRequest(); - - // Set Shopper Data - paymentRequest.ShopperEmail = "youremail@email.com"; - paymentRequest.DateOfBirth = dateOfBirth; - paymentRequest.TelephoneNumber = "0612345678"; - paymentRequest.ShopperReference = "4"; - - // Set Shopper Info - Name shopperName = new Name - { - FirstName = "Testperson-nl", - LastName = "Approved" - }; - paymentRequest.ShopperName = shopperName; - - // Set Billing and Delivery address - Address address = new Address - { - City = "Gravenhage", - Country = "NL", - HouseNumberOrName = "1", - PostalCode = "2521VA", - StateOrProvince = "Zuid-Holland", - Street = "Neherkade" - }; - paymentRequest.DeliveryAddress = address; - paymentRequest.BillingAddress = address; - - // Use OpenInvoice Provider (klarna, ratepay) - paymentRequest.SelectedBrand = "klarna"; - - long itemAmount = long.Parse("9000"); - long itemVatAmount = long.Parse("1000"); - long itemVatPercentage = long.Parse("1000"); - - List invoiceLines = new List(); - - // invoiceLine1 - AdditionalDataOpenInvoice invoiceLine = new AdditionalDataOpenInvoice - { - OpeninvoicedataLineItemNrCurrencyCode = ("EUR"), - OpeninvoicedataLineItemNrDescription = ("Test product"), - OpeninvoicedataLineItemNrItemVatAmount = ("1000"), - OpeninvoicedataLineItemNrItemAmount = (itemAmount).ToString(), - OpeninvoicedataLineItemNrItemVatPercentage = (itemVatPercentage).ToString(), - OpeninvoicedataLineItemNrNumberOfItems = (1).ToString(), - OpeninvoicedataLineItemNrItemId = ("1234") - }; - - // invoiceLine2 - // invoiceLine1 - AdditionalDataOpenInvoice invoiceLine2 = new AdditionalDataOpenInvoice - { - OpeninvoicedataLineItemNrCurrencyCode = ("EUR"), - OpeninvoicedataLineItemNrDescription = ("Test product2"), - OpeninvoicedataLineItemNrItemVatAmount = (itemVatAmount).ToString(), - OpeninvoicedataLineItemNrItemAmount = (itemAmount).ToString(), - OpeninvoicedataLineItemNrItemVatPercentage = (itemVatPercentage).ToString(), - OpeninvoicedataLineItemNrNumberOfItems = (1).ToString(), - OpeninvoicedataLineItemNrItemId = ("456") - }; - - invoiceLines.Add(invoiceLine); - invoiceLines.Add(invoiceLine2); - - /*paymentRequest.AdditionalData(invoiceLines);*/ - - return paymentRequest; - } - - } -} diff --git a/Adyen.Test/MockPaymentData.cs b/Adyen.Test/MockPaymentData.cs deleted file mode 100644 index 687c0ef98..000000000 --- a/Adyen.Test/MockPaymentData.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using System.Collections.Generic; -using Adyen.Constants; -using Adyen.Model.Payment; -using Environment = Adyen.Model.Environment; - -namespace Adyen.Test -{ - internal class MockPaymentData - { - #region Mock payment data - - public static Config CreateConfigApiKeyBasedMock() - { - return new Config - { - Environment = Environment.Test, - XApiKey = "AQEyhmfxK....LAG84XwzP5pSpVd"//mock api key - }; - } - - public static PaymentRequest CreateFullPaymentRequest() - { - var paymentRequest = new PaymentRequest - { - ApplicationInfo = new ApplicationInfo - { - AdyenLibrary = new CommonField(name: ClientConfig.LibName, version: ClientConfig.LibVersion) - }, - MerchantAccount = "MerchantAccount", - Amount = new Amount("EUR", 1500), - Card = CreateTestCard(), - Reference = "payment - " + DateTime.Now.ToString("yyyyMMdd"), - AdditionalData = CreateAdditionalData() - }; - return paymentRequest; - } - - public static PaymentRequest3ds2 CreateFullPaymentRequest3DS2() - { - var paymentRequest = new PaymentRequest3ds2 - { - MerchantAccount = "MerchantAccount", - Amount = new Amount("EUR", 1500), - Reference = "payment - " + DateTime.Now.ToString("yyyyMMdd"), - AdditionalData = CreateAdditionalData(), - ThreeDS2RequestData = new ThreeDS2RequestData(threeDSCompInd: "Y", - deviceChannel: "browser"), - BrowserInfo = CreateMockBrowserInfo(), - }; - return paymentRequest; - } - - public static PaymentRequest CreateFullPaymentRequestWithShopperInteraction(PaymentRequest.ShopperInteractionEnum shopperInteraction) - { - var paymentRequest = CreateFullPaymentRequest(); - paymentRequest.ShopperInteraction = shopperInteraction; - return paymentRequest; - } - - protected static Dictionary CreateAdditionalData() - { - return new Dictionary - { - { "liabilityShift", "true"}, - { "fraudResultType", "GREEN"}, - { "authCode", "43733"}, - { "avsResult", "4 AVS not supported for this card type"} - }; - } - - public static PaymentRequest3d CreateFullPaymentRequest3D() - { - var paymentRequest = new PaymentRequest3d - { - ApplicationInfo = new ApplicationInfo - { - AdyenLibrary = new CommonField(name: ClientConfig.LibName, version: ClientConfig.LibVersion) - }, - MerchantAccount = "MerchantAccount", - BrowserInfo = CreateMockBrowserInfo(), - Reference = "payment - " + DateTime.Now.ToString("yyyyMMdd"), - CaptureDelayHours = 0 - }; - return paymentRequest; - } - - - public static BrowserInfo CreateMockBrowserInfo() - { - return new BrowserInfo - { - UserAgent = "User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36", - AcceptHeader = "*/*" - }; - } - - public static Card CreateTestCard() - { - return new Card(number: "4111111111111111", expiryMonth: "08", expiryYear: "2018", cvc: "737", holderName: "John Smith"); - } - - public static Card CreateTestCard3D() - { - return new Card(number: "5212345678901234", expiryMonth: "08", expiryYear: "2018", cvc: "737", holderName: "John Smith"); - } - - public static string GetTestPspReferenceMocked() - { - return "8514836072314693"; - } - #endregion - } -} diff --git a/Adyen.Test/PaymentTest.cs b/Adyen.Test/PaymentTest.cs index 0e2ea1b7c..793437701 100644 --- a/Adyen.Test/PaymentTest.cs +++ b/Adyen.Test/PaymentTest.cs @@ -119,17 +119,95 @@ public void TestAuthoriseCseSuccessMocked() var paymentResult = CreatePaymentResultFromFile("mocks/authorise-success-cse.json"); Assert.AreEqual(PaymentResult.ResultCodeEnum.Authorised, paymentResult.ResultCode); } + [Ignore] // Fix this test -> not sure how to add additionalDataOpenInvoice class to paymentrequest [TestMethod] public void TestOpenInvoice() { var client = CreateMockTestClientRequest("mocks/authorise-success-klarna.json"); var payment = new PaymentService(client); - var paymentRequest = MockOpenInvoicePayment.CreateOpenInvoicePaymentRequest(); + PaymentRequest paymentRequest = CreateOpenInvoicePaymentRequest(); var paymentResult = payment.Authorise(paymentRequest); Assert.AreEqual("2374421290", paymentResult.AdditionalData["additionalData.acquirerReference"]); Assert.AreEqual("klarna", paymentResult.AdditionalData["paymentMethodVariant"]); } + + private static PaymentRequest CreateOpenInvoicePaymentRequest() + { + + DateTime dateOfBirth = DateTime.Parse("1970-07-10"); + + PaymentRequest paymentRequest = MockPaymentData.CreateFullPaymentRequest(); + + // Set Shopper Data + paymentRequest.ShopperEmail = "youremail@email.com"; + paymentRequest.DateOfBirth = dateOfBirth; + paymentRequest.TelephoneNumber = "0612345678"; + paymentRequest.ShopperReference = "4"; + + // Set Shopper Info + Name shopperName = new Name + { + FirstName = "Testperson-nl", + LastName = "Approved" + }; + paymentRequest.ShopperName = shopperName; + + // Set Billing and Delivery address + Address address = new Address + { + City = "Gravenhage", + Country = "NL", + HouseNumberOrName = "1", + PostalCode = "2521VA", + StateOrProvince = "Zuid-Holland", + Street = "Neherkade" + }; + paymentRequest.DeliveryAddress = address; + paymentRequest.BillingAddress = address; + + // Use OpenInvoice Provider (klarna, ratepay) + paymentRequest.SelectedBrand = "klarna"; + + long itemAmount = long.Parse("9000"); + long itemVatAmount = long.Parse("1000"); + long itemVatPercentage = long.Parse("1000"); + + List invoiceLines = new List(); + + // invoiceLine1 + AdditionalDataOpenInvoice invoiceLine = new AdditionalDataOpenInvoice + { + OpeninvoicedataLineItemNrCurrencyCode = ("EUR"), + OpeninvoicedataLineItemNrDescription = ("Test product"), + OpeninvoicedataLineItemNrItemVatAmount = ("1000"), + OpeninvoicedataLineItemNrItemAmount = (itemAmount).ToString(), + OpeninvoicedataLineItemNrItemVatPercentage = (itemVatPercentage).ToString(), + OpeninvoicedataLineItemNrNumberOfItems = (1).ToString(), + OpeninvoicedataLineItemNrItemId = ("1234") + }; + + // invoiceLine2 + // invoiceLine1 + AdditionalDataOpenInvoice invoiceLine2 = new AdditionalDataOpenInvoice + { + OpeninvoicedataLineItemNrCurrencyCode = ("EUR"), + OpeninvoicedataLineItemNrDescription = ("Test product2"), + OpeninvoicedataLineItemNrItemVatAmount = (itemVatAmount).ToString(), + OpeninvoicedataLineItemNrItemAmount = (itemAmount).ToString(), + OpeninvoicedataLineItemNrItemVatPercentage = (itemVatPercentage).ToString(), + OpeninvoicedataLineItemNrNumberOfItems = (1).ToString(), + OpeninvoicedataLineItemNrItemId = ("456") + }; + + invoiceLines.Add(invoiceLine); + invoiceLines.Add(invoiceLine2); + + /*paymentRequest.AdditionalData(invoiceLines);*/ + + return paymentRequest; + } + [TestMethod] public void TestPaymentRequestApplicationInfo() @@ -204,4 +282,110 @@ private string GetAdditionalData(Dictionary additionalData, stri return result; } } + + internal class MockPaymentData + { + #region Mock payment data + + public static Config CreateConfigApiKeyBasedMock() + { + return new Config + { + Environment = Adyen.Model.Environment.Test, + XApiKey = "AQEyhmfxK....LAG84XwzP5pSpVd"//mock api key + }; + } + + public static PaymentRequest CreateFullPaymentRequest() + { + var paymentRequest = new PaymentRequest + { + ApplicationInfo = new ApplicationInfo + { + AdyenLibrary = new CommonField(name: ClientConfig.LibName, version: ClientConfig.LibVersion) + }, + MerchantAccount = "MerchantAccount", + Amount = new Amount("EUR", 1500), + Card = CreateTestCard(), + Reference = "payment - " + DateTime.Now.ToString("yyyyMMdd"), + AdditionalData = CreateAdditionalData() + }; + return paymentRequest; + } + + public static PaymentRequest3ds2 CreateFullPaymentRequest3DS2() + { + var paymentRequest = new PaymentRequest3ds2 + { + MerchantAccount = "MerchantAccount", + Amount = new Amount("EUR", 1500), + Reference = "payment - " + DateTime.Now.ToString("yyyyMMdd"), + AdditionalData = CreateAdditionalData(), + ThreeDS2RequestData = new ThreeDS2RequestData(threeDSCompInd: "Y", + deviceChannel: "browser"), + BrowserInfo = CreateMockBrowserInfo(), + }; + return paymentRequest; + } + + public static PaymentRequest CreateFullPaymentRequestWithShopperInteraction(PaymentRequest.ShopperInteractionEnum shopperInteraction) + { + var paymentRequest = CreateFullPaymentRequest(); + paymentRequest.ShopperInteraction = shopperInteraction; + return paymentRequest; + } + + protected static Dictionary CreateAdditionalData() + { + return new Dictionary + { + { "liabilityShift", "true"}, + { "fraudResultType", "GREEN"}, + { "authCode", "43733"}, + { "avsResult", "4 AVS not supported for this card type"} + }; + } + + public static PaymentRequest3d CreateFullPaymentRequest3D() + { + var paymentRequest = new PaymentRequest3d + { + ApplicationInfo = new ApplicationInfo + { + AdyenLibrary = new CommonField(name: ClientConfig.LibName, version: ClientConfig.LibVersion) + }, + MerchantAccount = "MerchantAccount", + BrowserInfo = CreateMockBrowserInfo(), + Reference = "payment - " + DateTime.Now.ToString("yyyyMMdd"), + CaptureDelayHours = 0 + }; + return paymentRequest; + } + + + public static BrowserInfo CreateMockBrowserInfo() + { + return new BrowserInfo + { + UserAgent = "User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36", + AcceptHeader = "*/*" + }; + } + + public static Card CreateTestCard() + { + return new Card(number: "4111111111111111", expiryMonth: "08", expiryYear: "2018", cvc: "737", holderName: "John Smith"); + } + + public static Card CreateTestCard3D() + { + return new Card(number: "5212345678901234", expiryMonth: "08", expiryYear: "2018", cvc: "737", holderName: "John Smith"); + } + + public static string GetTestPspReferenceMocked() + { + return "8514836072314693"; + } + #endregion + } } From 8088c0091d0287e2b21d1648f4eefc7ddc8aabc0 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Thu, 6 Nov 2025 00:43:50 +0100 Subject: [PATCH 117/126] Add logging override (events) example --- .../PaymentsServiceIntegrationTest.cs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index c7fe996d1..7f599d8ae 100644 --- a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -1,11 +1,14 @@ +using System.Diagnostics.Tracing; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; +using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Extensions.Hosting; using Adyen.Core.Options; +using Microsoft.Extensions.Logging; namespace Adyen.IntegrationTest.Checkout { @@ -29,6 +32,25 @@ public PaymentsServiceIntegrationTest() .Build(); _paymentsApiService = host.Services.GetRequiredService(); + + // Example how to do logging for IPaymentsService and the PaymensServiceEvents. + ILogger logger = host.Services.GetRequiredService>(); + + PaymentsServiceEvents events = host.Services.GetRequiredService(); + + // On /payments + events.OnPayments += (sender, eventArgs) => + { + ApiResponse apiResponse = eventArgs.ApiResponse; + logger.LogInformation("{TotalSeconds,-9} | {Path} | {StatusCode} |", (apiResponse.DownloadedAt - apiResponse.RequestedAt).TotalSeconds, apiResponse.StatusCode, apiResponse.Path); + }; + + // OnError /payments. + events.OnErrorPayments += (sender, eventArgs) => + { + logger.LogError(eventArgs.Exception, "An error occurred after sending the request to the server."); + }; + } [TestMethod] From 90d64bd29b962de2c63f96e6e9642f2d4dce9d4a Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 7 Nov 2025 00:03:21 +0100 Subject: [PATCH 118/126] Added more documentation --- .../PaymentsServiceIntegrationTest.cs | 2 +- Adyen.Test/Checkout/PaymentsServiceTest.cs | 24 ++++++++++-- .../generichost/HostConfiguration.mustache | 24 ++++++------ .../IHostBuilderExtensions.mustache | 39 +++++-------------- .../IServiceCollectionExtensions.mustache | 28 +++++-------- 5 files changed, 53 insertions(+), 64 deletions(-) diff --git a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs index 7f599d8ae..f63fcd9ec 100644 --- a/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs +++ b/Adyen.IntegrationTest/Checkout/PaymentsServiceIntegrationTest.cs @@ -162,7 +162,7 @@ public void HttpClientBuilderExtensions_Polly_Retry_CircuitBreaker_Timeout_Examp options.Environment = AdyenEnvironment.Test; }); }, - httpClientBuilderDelegate: (IHttpClientBuilder builder) => + httpClientBuilderOptions: (IHttpClientBuilder builder) => { builder.AddRetryPolicy(5); builder.AddCircuitBreakerPolicy(3, TimeSpan.FromSeconds(30)); diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsServiceTest.cs index c0df93978..1cd5c978a 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsServiceTest.cs @@ -26,9 +26,6 @@ public PaymentsServiceTest() { options.Environment = AdyenEnvironment.Test; }); - }, null, builder => - { - builder.AddCircuitBreakerPolicy(3, TimeSpan.MaxValue); }) .Build(); @@ -249,6 +246,27 @@ public async Task Given_IPaymentsService_When_Live_Url_And_Prefix_Are_Set_Return // Assert Assert.AreEqual("https://prefix-checkout-live.adyenpayments.com/checkout/v71", paymentsService.HttpClient.BaseAddress.ToString()); } + + [TestMethod] + public async Task Given_IPaymentsService_When_Test_Url_Returns_Correct_Test_Url_Endpoint_And_No_Prefix() + { + // Arrange + IHost liveHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + // Act + var paymentsService = liveHost.Services.GetRequiredService(); + + // Assert + Assert.AreEqual("https://checkout-test.adyen.com/v71", paymentsService.HttpClient.BaseAddress.ToString()); + } ////TODO: Chained calls, extract these and move it to Payments // [TestMethod] diff --git a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache index eb4d76ad9..b1723804f 100644 --- a/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache +++ b/templates-v7/csharp/libraries/generichost/HostConfiguration.mustache @@ -104,15 +104,15 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} /// /// Configures the and . /// - /// - /// + /// Configures the . + /// Configures the . /// . - public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} httpClientDelegate = null, Action{{nrt?}} httpClientBuilderDelegate = null) + public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} httpClientOptions = null, Action{{nrt?}} httpClientBuilderOptions = null) { Action httpClientAction = httpClient => { // Configure HttpClient set by the user. - httpClientDelegate?.Invoke(httpClient); + httpClientOptions?.Invoke(httpClient); // Set BaseAddress if it's not set. if (httpClient.BaseAddress == null) @@ -123,9 +123,9 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} {{#apiInfo}}{{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, {{classname}}>(httpClientAction)); {{/apis}}{{/apiInfo}} - if (httpClientBuilderDelegate != null) + if (httpClientBuilderOptions != null) foreach (IHttpClientBuilder builder in builders) - httpClientBuilderDelegate(builder); + httpClientBuilderOptions(builder); return this; } @@ -133,11 +133,11 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} /// /// Configures the . /// - /// . + /// Configures the . /// . - public HostConfiguration ConfigureJsonOptions(Action jsonSerializerOptionsDelegate) + public HostConfiguration ConfigureJsonOptions(Action jsonSerializerOptions) { - jsonSerializerOptionsDelegate(_jsonOptions); + jsonSerializerOptions(_jsonOptions); return this; } @@ -145,11 +145,11 @@ namespace {{packageName}}.{{apiName}}.{{clientPackage}} /// /// Configures the (e.g. Environment, LiveEndpointPrefix). /// - /// + /// Configures the . /// . - public HostConfiguration ConfigureAdyenOptions(Action adyenOptionsDelegate) + public HostConfiguration ConfigureAdyenOptions(Action adyenOptions) { - adyenOptionsDelegate(_adyenOptions); + adyenOptions(_adyenOptions); {{#hasApiKeyMethods}} _services.AddSingleton>( new TokenProvider( diff --git a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache index 779e2fed4..b3df192b6 100644 --- a/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IHostBuilderExtensions.mustache @@ -17,41 +17,22 @@ namespace {{packageName}}.{{apiName}}.Extensions {{>visibility}} static class HostBuilderExtensions { /// - /// Add the {{apiName}} API services to . + /// You can optionally configure the and . /// /// . - /// . - public static IHostBuilder Configure{{apiName}}(this IHostBuilder hostBuilder, Action hostConfigurationDelegate) + /// Configures the , , and . + /// Configures the . + /// Configures the . + public static IHostBuilder Configure{{apiName}}(this IHostBuilder hostBuilder, Action hostConfigurationOptions, Action? httpClientOptions = null, Action? httpClientBuilderOptions = null) { hostBuilder.ConfigureServices((context, services) => { - HostConfiguration config = new HostConfiguration(services); + HostConfiguration hostConfiguration = new HostConfiguration(services); - hostConfigurationDelegate(context, services, config); - - ServiceCollectionExtensions.Add{{apiName}}Services(services, config, null, null); - }); - - return hostBuilder; - } - - /// - /// Add the {{apiName}} API services to . - /// Overloaded method to configure the and . - /// - /// . - /// . - /// . - /// . - public static IHostBuilder Configure{{apiName}}(this IHostBuilder hostBuilder, Action hostConfigurationDelegate, Action? httpClientDelegate = null, Action? httpClientBuilderDelegate = null) - { - hostBuilder.ConfigureServices((context, services) => - { - HostConfiguration config = new HostConfiguration(services); - - hostConfigurationDelegate(context, services, config); - - ServiceCollectionExtensions.Add{{apiName}}Services(services, config, httpClientDelegate, httpClientBuilderDelegate); + hostConfigurationOptions(context, services, hostConfiguration); + + hostConfiguration.Add{{apiName}}HttpClients(httpClientOptions, httpClientBuilderOptions); }); return hostBuilder; diff --git a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache index 01e756186..3f366532c 100644 --- a/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/templates-v7/csharp/libraries/generichost/IServiceCollectionExtensions.mustache @@ -12,32 +12,22 @@ using {{packageName}}.{{apiName}}.{{clientPackage}}; namespace {{packageName}}.{{apiName}}.Extensions { /// - /// Extension methods for ServiceCollection + /// Extension methods for . /// {{>visibility}} static class ServiceCollectionExtensions { /// - /// Add the {{packageName}} {{apiName}} API services to your host builder and . + /// Add the {{packageName}} {{apiName}} API services to your . /// /// . - /// Configure your . - public static void Add{{apiName}}Services(this IServiceCollection services, Action hostConfigurationDelegate, Action? httpClientDelegate = null, Action? httpClientBuilderDelegate = null) + /// Configures the . + /// Configures the . + /// Configures the . + public static void Add{{apiName}}Services(this IServiceCollection services, Action hostConfigurationOptions, Action? httpClientOptions = null, Action? httpClientBuilderOptions = null) { - HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); - hostConfigurationDelegate(config); - Add{{apiName}}Services(services, config, httpClientDelegate, httpClientBuilderDelegate); - } - - internal static void Add{{apiName}}Services(IServiceCollection services, HostConfiguration hostConfiguration, Action? httpClientDelegate = null, Action? httpClientBuilderDelegate = null) - { - hostConfiguration.Add{{apiName}}HttpClients(httpClientDelegate, httpClientBuilderDelegate); - - {{#models}} - {{#model.vendorExtensions.x-webhook-root}} - // Adds utility handler for deserializing webhooks. - services.AddSingleton<{{packageName}}.{{apiName}}.Handlers.{{interfacePrefix}}{{apiName}}Handler, {{packageName}}.{{apiName}}.Handlers.{{apiName}}Handler>(); - {{/model.vendorExtensions.x-webhook-root}} - {{/models}} + HostConfiguration hostConfiguration = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); + hostConfigurationOptions(hostConfiguration); + hostConfiguration.Add{{apiName}}HttpClients(httpClientOptions, httpClientBuilderOptions); } } } From 6b8da311777060c5326eca45b817e27935145ed4 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 7 Nov 2025 01:41:06 +0100 Subject: [PATCH 119/126] nit: Use Given_When_Then in tests naming --- Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs | 2 +- Adyen.Test/BalanceControl/BalanceControlTest.cs | 2 +- .../BalancePlatform/BalanceAccounts/BalanceAccountTest.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs b/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs index 6fa6fa0e3..3fe638a98 100644 --- a/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs +++ b/Adyen.Test/AcsWebhooks/AcsWebhooksTest.cs @@ -25,7 +25,7 @@ public AcsWebhooksTest() } [TestMethod] - public async Task Deserialize_Authentication_Webhook_OOB_TRIGGER_FL_Returns_Object() + public async Task Given_Deserialize_Authentication_Webhook_WHen_OOB_TRIGGER_FL_Returns_Correct_Challenge_Flow() { // Arrange string json = @" diff --git a/Adyen.Test/BalanceControl/BalanceControlTest.cs b/Adyen.Test/BalanceControl/BalanceControlTest.cs index bebbe64e1..a71c543fa 100644 --- a/Adyen.Test/BalanceControl/BalanceControlTest.cs +++ b/Adyen.Test/BalanceControl/BalanceControlTest.cs @@ -32,7 +32,7 @@ public BalanceControlTest() } [TestMethod] - public async Task DeserializeBalanceControlTest() + public async Task Given_Deserialize_When_BalanceControlTransfer_Returns_Correct_Status() { // Arrange var json = TestUtilities.GetTestFileContent("mocks/balance-control-transfer.json"); diff --git a/Adyen.Test/BalancePlatform/BalanceAccounts/BalanceAccountTest.cs b/Adyen.Test/BalancePlatform/BalanceAccounts/BalanceAccountTest.cs index 7ea908037..2c24c10b5 100644 --- a/Adyen.Test/BalancePlatform/BalanceAccounts/BalanceAccountTest.cs +++ b/Adyen.Test/BalancePlatform/BalanceAccounts/BalanceAccountTest.cs @@ -92,7 +92,7 @@ public async Task Given_UpdateSweepConfigurationV2_Deserialize_Correctly() } [TestMethod] - public async Task GetBalanceAccountsIdPaymentInstrumentsTest() + public async Task Given_Deserialize_When_PaginatedPaymentInstrumentsResponse_Returns_Correct_Object() { // Arrange string json = TestUtilities.GetTestFileContent("mocks/balanceplatform/PaginatedPaymentInstrumentsResponse.json"); From 358937efb759fe3e660fcab8468f0912d7331818 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Fri, 7 Nov 2025 18:41:09 +0100 Subject: [PATCH 120/126] Remove RateLimiterProvider template (we use Polly instead) --- .../generichost/RateLimitProvider.mustache | 96 ------------------- 1 file changed, 96 deletions(-) delete mode 100644 templates-v7/csharp/libraries/generichost/RateLimitProvider.mustache diff --git a/templates-v7/csharp/libraries/generichost/RateLimitProvider.mustache b/templates-v7/csharp/libraries/generichost/RateLimitProvider.mustache deleted file mode 100644 index 7458dbd80..000000000 --- a/templates-v7/csharp/libraries/generichost/RateLimitProvider.mustache +++ /dev/null @@ -1,96 +0,0 @@ -// -{{>partial_header}} - -{{#nrt}} -#nullable enable - -{{/nrt}} -using System; -using System.Collections.Generic; -using System.Linq; - -namespace {{packageName}}.{{clientPackage}} -{ - /// - /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. - /// - /// - {{>visibility}} class RateLimitProvider : TokenProvider where TTokenBase : TokenBase - { - internal Dictionary> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary>{{/net70OrLater}}(); - - /// - /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. - /// - /// - public RateLimitProvider(TokenContainer container) : base(container.Tokens) - { - foreach(TTokenBase token in _tokens) - token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); - - {{#lambda.copy}} - global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length) - { - FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite - }; - - AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded(options)); - {{/lambda.copy}} - {{#hasApiKeyMethods}} - if (container is TokenContainer apiKeyTokenContainer) - { - string[] headers = apiKeyTokenContainer.Tokens.Select(t => ClientUtils.ApiKeyHeaderToString(t.Header)).Distinct().ToArray(); - - foreach (string header in headers) - { - global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) - { - FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite - }; - - AvailableTokens.Add(header, global::System.Threading.Channels.Channel.CreateBounded(options)); - } - } - else - { - {{#lambda.indentAll1}} - {{#lambda.paste}} - {{/lambda.paste}} - {{/lambda.indentAll1}} - } - {{/hasApiKeyMethods}} - {{^hasApiKeyMethods}} - {{#lambda.paste}} - {{/lambda.paste}} - {{/hasApiKeyMethods}} - - foreach (var availableToken in AvailableTokens) - foreach(TTokenBase token in _tokens) - { - {{#hasApiKeyMethods}} - if (token is ApiKeyToken apiKeyToken) - { - if (ClientUtils.ApiKeyHeaderToString(apiKeyToken.Header) == availableToken.Key) - { - token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); - } - } else - { - token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); - } - {{/hasApiKeyMethods}} - {{^hasApiKeyMethods}} - token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); - {{/hasApiKeyMethods}} - } - } - - internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) - { - if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel{{nrt?}} tokens)) - throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); - - return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); - } - } -} From 2971dadf01810c74af234ce6086853f50158299b Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sat, 8 Nov 2025 01:09:09 +0100 Subject: [PATCH 121/126] Moved all CheckoutTests --- Adyen.Test/Checkout/CheckoutTest.cs | 425 +++++++ Adyen.Test/Checkout/DonationsTest.cs | 46 + Adyen.Test/Checkout/ModificationTest.cs | 116 ++ ...PaymentsServiceTest.cs => PaymentsTest.cs} | 78 +- Adyen.Test/Checkout/UtilityServiceTest.cs | 39 + Adyen.Test/CheckoutTest.cs | 1090 ----------------- .../mocks/checkout/card-details-success.json | 9 +- .../mocks/checkout/payment-links-success.json | 2 + ...aymentlinks-recurring-payment-success.json | 10 - .../paymentmethods-error-forbidden-403.json | 6 - .../mocks/checkout/payments-success.json | 83 +- ...aymentsdetails-error-invalid-data-422.json | 6 - .../paymentsresult-multibanco-success.json | 21 - 13 files changed, 714 insertions(+), 1217 deletions(-) create mode 100644 Adyen.Test/Checkout/CheckoutTest.cs create mode 100644 Adyen.Test/Checkout/DonationsTest.cs create mode 100644 Adyen.Test/Checkout/ModificationTest.cs rename Adyen.Test/Checkout/{PaymentsServiceTest.cs => PaymentsTest.cs} (88%) delete mode 100644 Adyen.Test/CheckoutTest.cs delete mode 100644 Adyen.Test/mocks/checkout/paymentlinks-recurring-payment-success.json delete mode 100644 Adyen.Test/mocks/checkout/paymentmethods-error-forbidden-403.json delete mode 100644 Adyen.Test/mocks/checkout/paymentsdetails-error-invalid-data-422.json delete mode 100644 Adyen.Test/mocks/checkout/paymentsresult-multibanco-success.json diff --git a/Adyen.Test/Checkout/CheckoutTest.cs b/Adyen.Test/Checkout/CheckoutTest.cs new file mode 100644 index 000000000..2a7a97694 --- /dev/null +++ b/Adyen.Test/Checkout/CheckoutTest.cs @@ -0,0 +1,425 @@ +using Adyen.Core.Options; +using Adyen.Checkout.Extensions; +using Adyen.Checkout.Models; +using Adyen.Checkout.Client; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.Extensions.Hosting; +using System.Text.Json; + +namespace Adyen.Test.Checkout +{ + [TestClass] + public class CheckoutTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public CheckoutTest() + { + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = testHost.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_Deserialize_When_Payment_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/payments-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("8535296650153317", response.PspReference); + Assert.AreEqual(PaymentResponse.ResultCodeEnum.Authorised, response.ResultCode); + Assert.IsNotNull(response.AdditionalData); + Assert.AreEqual(9, response.AdditionalData.Count); + Assert.AreEqual("8/2018", response.AdditionalData["expiryDate"]); + Assert.AreEqual("GREEN", response.AdditionalData["fraudResultType"]); + Assert.AreEqual("411111", response.AdditionalData["cardBin"]); + Assert.AreEqual("1111", response.AdditionalData["cardSummary"]); + Assert.AreEqual("false", response.AdditionalData["fraudManualReview"]); + Assert.AreEqual("Default", response.AdditionalData["aliasType"]); + Assert.AreEqual("H167852639363479", response.AdditionalData["alias"]); + Assert.AreEqual("visa", response.AdditionalData["cardPaymentMethod"]); + Assert.AreEqual("NL", response.AdditionalData["cardIssuingCountry"]); + } + + [TestMethod] + public void Given_Deserialize_When_Payment3DS2_CheckoutThreeDS2Action_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/payments-3DS2-IdentifyShopper.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(PaymentResponse.ResultCodeEnum.IdentifyShopper, response.ResultCode); + Assert.AreEqual("threeDS2", response.Action.CheckoutThreeDS2Action.Type.ToString()); + Assert.IsNotNull(response.Action.CheckoutThreeDS2Action.PaymentData); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentError_Result_ServiceError_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/payments-error-invalid-data-422.json"); + + // Act + var serviceErrorResponse = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNull(serviceErrorResponse.PspReference); + Assert.AreEqual("Reference Missing", serviceErrorResponse.Message); + Assert.AreEqual("validation", serviceErrorResponse.ErrorType); + Assert.AreEqual("130", serviceErrorResponse.ErrorCode); + Assert.AreEqual(422, serviceErrorResponse.Status); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentDetailsResponse_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/paymentsdetails-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("8515232733321252", response.PspReference); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentDetailsActionResponse_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/paymentsdetails-action-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("8515232733321252", response.PspReference); + Assert.AreEqual(PaymentDetailsResponse.ResultCodeEnum.Authorised, response.ResultCode); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentMethods_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/paymentmethods-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.PaymentMethods.Count, 32); + Assert.IsNotNull(response.PaymentMethods[12].Issuers); + Assert.AreEqual(response.PaymentMethods[12].Issuers[0].Id, "66"); + Assert.AreEqual(response.PaymentMethods[12].Issuers[0].Name, "Bank Nowy BFG S.A."); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentMethods__Result_Brands_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/paymentmethods-brands-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(7, response.PaymentMethods.Count); + Assert.AreEqual(5, response.PaymentMethods[0].Brands.Count); + Assert.AreEqual("visa", response.PaymentMethods[0].Brands[0]); + Assert.AreEqual("mc", response.PaymentMethods[0].Brands[1]); + Assert.AreEqual("amex", response.PaymentMethods[0].Brands[2]); + Assert.AreEqual("bcmc", response.PaymentMethods[0].Brands[3]); + Assert.AreEqual("maestro", response.PaymentMethods[0].Brands[4]); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentMethods_Result_Without_Brands_Is_Exactly_50() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/paymentmethods-without-brands-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(response.PaymentMethods.Count, 50); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentLinks_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/payment-links-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("your-id", response.Id); + Assert.AreEqual(PaymentLinkResponse.StatusEnum.Active, response.Status); + Assert.AreEqual("https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=YW1vdW50TWlub3JW...JRA", response.Url); + Assert.AreEqual(new DateTimeOffset(2019, 12, 17, 10, 05, 29, TimeSpan.Zero), response.ExpiresAt); + Assert.AreEqual("YOUR_ORDER_NUMBER", response.Reference); + Assert.AreEqual(1250, response.Amount.Value); + Assert.AreEqual("BRL", response.Amount.Currency); + } + + [TestMethod] + public void Given_Deserialize_When_Payments_PayPal_Result_CheckoutSDKAction_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/payments-success-paypal.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNotNull(response.Action.CheckoutSDKAction); + Assert.AreEqual("EC-42N19135GM6949000", response.Action.CheckoutSDKAction.SdkData["orderID"]); + Assert.AreEqual("Ab02b4c0!BQABAgARb1TvUJa4nwS0Z1nOmxoYfD9+z...", response.Action.CheckoutSDKAction.PaymentData); + Assert.AreEqual("paypal", response.Action.CheckoutSDKAction.PaymentMethodType); + } + + [TestMethod] + public void Given_Deserialize_When_ApplePayDetails_Result_Is_Not_Null() + { + // Arrange + string json = "{\"type\": \"applepay\",\"applePayToken\": \"VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU...\"}"; + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual( ApplePayDetails.TypeEnum.Applepay, response.Type); + Assert.AreEqual("VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU...", response.ApplePayToken); + } + + [TestMethod] + public void Given_Deserialize_When_ApplePayDetails_With_Unknown_Value_Result_Is_Not_Null() + { + // Arrange + string json = "{\"type\": \"applepay\",\"someValue\": \"notInSpec\",\"applePayToken\": \"VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU...\"}"; + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(ApplePayDetails.TypeEnum.Applepay, response.Type); + Assert.AreEqual("VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU...", response.ApplePayToken); + } + + [TestMethod] + public void Given_Deserialize_When_PayWithGoogleDetails_Returns_Not_Null() + { + // Arrange + string json = "{\"type\": \"paywithgoogle\",\"someValue\": \"notInSpec\",\"googlePayToken\": \"==Payload as retrieved from Google Pay response==\"}"; + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(PayWithGoogleDetails.TypeEnum.Paywithgoogle, response.Type); + Assert.AreEqual(response.GooglePayToken, "==Payload as retrieved from Google Pay response=="); + } + + [TestMethod] + public void Given_Deserialize_When_BlikCode_Result_Is_Not_Null() + { + // Arrange + string json = "{\"type\":\"blik\",\"blikCode\":\"blikCode\"}"; + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(BlikDetails.TypeEnum.Blik, response.Type); + Assert.AreEqual("blikCode", response.BlikCode); + } + + [TestMethod] + public void Given_Deserialize_When_DragonpayDetails_Result_Is_Not_Null() + { + // Arrange + string json = "{\"issuer\":\"issuer\",\"shopperEmail\":\"test@adyen.com\",\"type\":\"dragonpay_ebanking\"}"; + + // Act + var result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(DragonpayDetails.TypeEnum.DragonpayEbanking, result.Type); + Assert.AreEqual("issuer", result.Issuer); + Assert.AreEqual("test@adyen.com", result.ShopperEmail); + } + + [TestMethod] + public void Given_Deserialize_When_AfterPayDetails_Result_Is_Not_Null() + { + // Arrange + string json = @" +{ + ""resultCode"":""RedirectShopper"", + ""action"":{ + ""paymentMethodType"":""afterpaytouch"", + ""method"":""GET"", + ""url"":""https://checkoutshopper-test.adyen.com/checkoutshopper/checkoutPaymentRedirect?redirectData=..."", + ""type"":""redirect"" + } +}"; + // Act + var result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(PaymentResponse.ResultCodeEnum.RedirectShopper, result.ResultCode); + Assert.AreEqual("afterpaytouch", result.Action.CheckoutRedirectAction.PaymentMethodType); + Assert.AreEqual(CheckoutRedirectAction.TypeEnum.Redirect, result.Action.CheckoutRedirectAction.Type); + Assert.AreEqual("https://checkoutshopper-test.adyen.com/checkoutshopper/checkoutPaymentRedirect?redirectData=...", result.Action.CheckoutRedirectAction.Url); + Assert.AreEqual("GET", result.Action.CheckoutRedirectAction.Method); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentResponse_3DS_ChallengeShopper_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/paymentResponse-3DS-ChallengeShopper.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(CheckoutThreeDS2Action.TypeEnum.ThreeDS2, response.Action.CheckoutThreeDS2Action.Type); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentMethodsResponse_StoredPaymentMethods_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/paymentmethods-storedpaymentmethods.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(4, response.StoredPaymentMethods.Count); + Assert.AreEqual("NL32ABNA0515071439", response.StoredPaymentMethods[0].Iban); + Assert.AreEqual("Adyen", response.StoredPaymentMethods[0].OwnerName); + Assert.AreEqual("sepadirectdebit", response.StoredPaymentMethods[0].Type); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentResponse_3DS2_IdentifyShopper_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/paymentResponse-3DS2-Action.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(PaymentResponse.ResultCodeEnum.IdentifyShopper, response.ResultCode); + Assert.AreEqual(CheckoutThreeDS2Action.TypeEnum.ThreeDS2, response.Action.CheckoutThreeDS2Action.Type); + } + + [TestMethod] + public void Given_Serialize_When_CheckoutSessionRequest_Result_Contains_DateOnly_And_DateTimeOffset() + { + // Arrange + CreateCheckoutSessionRequest checkoutSessionRequest = new CreateCheckoutSessionRequest( + merchantAccount: "TestMerchant", + reference: "TestReference", + returnUrl: "http://test-url.com", + amount: new Amount("EUR", 10000L), + dateOfBirth: new DateOnly(1998, 1, 1), + expiresAt: new DateTimeOffset(2023, 4, 1, 1, 1, 1, TimeSpan.Zero) + ); + + // Act + string target = JsonSerializer.Serialize(checkoutSessionRequest); + + // Assert + Assert.IsTrue(target.Contains("1998-01-01")); + Assert.IsTrue(target.Contains("2023-04-01T01:01:01+00:00")); + + Assert.IsTrue(target.Contains("TestMerchant")); + Assert.IsTrue(target.Contains("TestReference")); + Assert.IsTrue(target.Contains("http://test-url.com")); + Assert.IsTrue(target.Contains("EUR")); + Assert.IsTrue(target.Contains("10000")); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentMethodsBalance_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/paymentmethods-balance-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(BalanceCheckResponse.ResultCodeEnum.Success, response.ResultCode); + Assert.AreEqual("EUR", response.Balance.Currency); + Assert.AreEqual("2500", response.Balance.Value.ToString()); + } + + [TestMethod] + public void Given_Deserialize_When_CreateOrderResponse_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/orders-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(CreateOrderResponse.ResultCodeEnum.Success, response.ResultCode); + Assert.AreEqual("8515930288670953", response.PspReference); + Assert.AreEqual("Ab02b4c0!BQABAgBqxSuFhuXUF7IvIRvSw5bDPHN...", response.OrderData); + Assert.AreEqual("EUR", response.RemainingAmount.Currency); + Assert.AreEqual("2500", response.RemainingAmount.Value.ToString()); + } + + [TestMethod] + public void Given_Deserialize_When_CancelOrderResponse_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/orders-cancel-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("Received", response.ResultCode.ToString()); + Assert.AreEqual("8515931182066678", response.PspReference); + } + + [TestMethod] + public void Given_Deserialize_When_GetStoredPaymentMethods_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/get-storedPaymentMethod-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("string", response.StoredPaymentMethods[0].Type); + Assert.AreEqual("merchantAccount", response.MerchantAccount); + } + } +} diff --git a/Adyen.Test/Checkout/DonationsTest.cs b/Adyen.Test/Checkout/DonationsTest.cs new file mode 100644 index 000000000..41cc3398f --- /dev/null +++ b/Adyen.Test/Checkout/DonationsTest.cs @@ -0,0 +1,46 @@ +using Adyen.Core.Options; +using Adyen.Checkout.Extensions; +using Adyen.Checkout.Models; +using Adyen.Checkout.Client; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.Extensions.Hosting; +using System.Text.Json; + +namespace Adyen.Test.Checkout +{ + [TestClass] + public class DonationsTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public DonationsTest() + { + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = testHost.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_Deserialize_When_Donations_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/donations-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(DonationPaymentResponse.StatusEnum.Completed, response.Status); + Assert.AreEqual("10720de4-7c5d-4a17-9161-fa4abdcaa5c4", response.Reference); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Checkout/ModificationTest.cs b/Adyen.Test/Checkout/ModificationTest.cs new file mode 100644 index 000000000..15b30d7de --- /dev/null +++ b/Adyen.Test/Checkout/ModificationTest.cs @@ -0,0 +1,116 @@ +using Adyen.Core.Options; +using Adyen.Checkout.Extensions; +using Adyen.Checkout.Models; +using Adyen.Checkout.Client; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.Extensions.Hosting; +using System.Text.Json; + +namespace Adyen.Test.Checkout +{ + [TestClass] + public class ModificationTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public ModificationTest() + { + IHost testHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = testHost.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentCaptureResponse_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/captures-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(PaymentCaptureResponse.StatusEnum.Received, response.Status); + Assert.AreEqual("my_reference", response.Reference); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentCancelResponse_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/cancels-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(PaymentCancelResponse.StatusEnum.Received, response.Status); + Assert.AreEqual("my_reference", response.Reference); + } + + [TestMethod] + public void Given_Deserialize_When_StandalonePaymentCancelResponse_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/standalone-cancels-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(StandalonePaymentCancelResponse.StatusEnum.Received, response.Status); + Assert.AreEqual("861633338418518C", response.PspReference); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentRefundResponse_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/refunds-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(PaymentRefundResponse.StatusEnum.Received, response.Status); + Assert.AreEqual("my_reference", response.Reference); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentReversalResponse_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/reversals-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(PaymentReversalResponse.StatusEnum.Received, response.Status); + Assert.AreEqual("my_reference", response.Reference); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentAmountUpdateResponse_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/reversals-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(PaymentAmountUpdateResponse.StatusEnum.Received, response.Status); + Assert.AreEqual("my_reference", response.Reference); + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Checkout/PaymentsServiceTest.cs b/Adyen.Test/Checkout/PaymentsTest.cs similarity index 88% rename from Adyen.Test/Checkout/PaymentsServiceTest.cs rename to Adyen.Test/Checkout/PaymentsTest.cs index 1cd5c978a..c8db57c4d 100644 --- a/Adyen.Test/Checkout/PaymentsServiceTest.cs +++ b/Adyen.Test/Checkout/PaymentsTest.cs @@ -202,7 +202,7 @@ public async Task Given_Empty_ConfigureCheckout_When_No_AdyenOptions_Provided_Th } [TestMethod] - public async Task Given_IPaymentsService_When_Prefix_Not_Set_Throws_InvalidOperationException() + public async Task Given_IPaymentsService_When_Live_Url_And_Prefix_Are_Set_Returns_Correct_Live_Url_Endpoint_And_No_Prefix() { // Arrange IHost liveHost = Host.CreateDefaultBuilder() @@ -212,20 +212,41 @@ public async Task Given_IPaymentsService_When_Prefix_Not_Set_Throws_InvalidOpera { options.AdyenApiKey = "your-live-api-key"; options.Environment = AdyenEnvironment.Live; + options.LiveEndpointUrlPrefix = "prefix"; }); }) .Build(); // Act + var paymentsService = liveHost.Services.GetRequiredService(); + // Assert - Assert.ThrowsException(() => - { - liveHost.Services.GetRequiredService(); - }); + Assert.AreEqual("https://prefix-checkout-live.adyenpayments.com/checkout/v71", paymentsService.HttpClient.BaseAddress.ToString()); } + + [TestMethod] + public async Task Given_IPaymentsService_When_Test_Url_Returns_Correct_Test_Url_Endpoint_And_No_Prefix() + { + // Arrange + IHost liveHost = Host.CreateDefaultBuilder() + .ConfigureCheckout((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + // Act + var paymentsService = liveHost.Services.GetRequiredService(); + // Assert + Assert.AreEqual("https://checkout-test.adyen.com/v71", paymentsService.HttpClient.BaseAddress.ToString()); + } + [TestMethod] - public async Task Given_IPaymentsService_When_Live_Url_And_Prefix_Are_Set_Returns_Correct_Live_Url_Endpoint_And_No_Prefix() + public async Task Given_IPaymentsService_When_Live_Url_And_Prefix_Not_Set_Throws_InvalidOperationException() { // Arrange IHost liveHost = Host.CreateDefaultBuilder() @@ -235,20 +256,20 @@ public async Task Given_IPaymentsService_When_Live_Url_And_Prefix_Are_Set_Return { options.AdyenApiKey = "your-live-api-key"; options.Environment = AdyenEnvironment.Live; - options.LiveEndpointUrlPrefix = "prefix"; }); }) .Build(); // Act - var paymentsService = liveHost.Services.GetRequiredService(); - // Assert - Assert.AreEqual("https://prefix-checkout-live.adyenpayments.com/checkout/v71", paymentsService.HttpClient.BaseAddress.ToString()); + Assert.ThrowsException(() => + { + liveHost.Services.GetRequiredService(); + }); } - + [TestMethod] - public async Task Given_IPaymentsService_When_Test_Url_Returns_Correct_Test_Url_Endpoint_And_No_Prefix() + public async Task Given_ConfigureCheckout_When_Live_Url_And_Prefix_Not_Set_Throws_InvalidOperationException() { // Arrange IHost liveHost = Host.CreateDefaultBuilder() @@ -256,17 +277,42 @@ public async Task Given_IPaymentsService_When_Test_Url_Returns_Correct_Test_Url_ { config.ConfigureAdyenOptions(options => { - options.Environment = AdyenEnvironment.Test; + options.Environment = AdyenEnvironment.Live; }); }) .Build(); // Act - var paymentsService = liveHost.Services.GetRequiredService(); - // Assert - Assert.AreEqual("https://checkout-test.adyen.com/v71", paymentsService.HttpClient.BaseAddress.ToString()); + Assert.Throws(() => + liveHost.Services.GetRequiredService() + ); + + Assert.Throws(() => + liveHost.Services.GetRequiredService() + ); + + Assert.Throws(() => + liveHost.Services.GetRequiredService() + ); + + Assert.Throws(() => + liveHost.Services.GetRequiredService() + ); + + Assert.Throws(() => + liveHost.Services.GetRequiredService() + ); + + Assert.Throws(() => + liveHost.Services.GetRequiredService() + ); + + Assert.Throws(() => + liveHost.Services.GetRequiredService() + ); } + ////TODO: Chained calls, extract these and move it to Payments // [TestMethod] diff --git a/Adyen.Test/Checkout/UtilityServiceTest.cs b/Adyen.Test/Checkout/UtilityServiceTest.cs index e00d3392f..b4aca2758 100644 --- a/Adyen.Test/Checkout/UtilityServiceTest.cs +++ b/Adyen.Test/Checkout/UtilityServiceTest.cs @@ -32,9 +32,48 @@ public UtilityServiceTest() [TestMethod] public async Task Given_Deserialize_When_UtilityResponse_For_OriginKeys_Returns_Success() { + // Arrange string json = TestUtilities.GetTestFileContent("mocks/checkoututility/originkeys-success.json"); + + // Act var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert Assert.AreEqual("pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4xLmNvbQ.UEwIBmW9-c_uXo5wSEr2w8Hz8hVIpujXPHjpcEse3xI", response.OriginKeys["https://www.your-domain1.com"]); } + + [TestMethod] + public void Given_Deserialize_When_CardDetailsResponse_Returns_Not_Null() + { + // Arrange + var json = TestUtilities.GetTestFileContent("mocks/checkout/card-details-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsFalse(response.IsCardCommercial); + Assert.AreEqual("CREDIT", response.FundingSource); + Assert.AreEqual("FR", response.IssuingCountryCode); + + Assert.AreEqual("visa", response.Brands[0].Type); + Assert.IsTrue(response.Brands[0].Supported); + + Assert.AreEqual("cartebancaire", response.Brands[1].Type); + Assert.IsFalse(response.Brands[1].Supported); + } + + [TestMethod] + public void Given_Deserialize_When_ApplePaySessionResponse_Result_Is_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/checkout/apple-pay-sessions-success.json"); + + // Act + var response = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual("eyJ2Z...340278gdflkaswer", response.Data); + } } } \ No newline at end of file diff --git a/Adyen.Test/CheckoutTest.cs b/Adyen.Test/CheckoutTest.cs deleted file mode 100644 index c90aa5f3c..000000000 --- a/Adyen.Test/CheckoutTest.cs +++ /dev/null @@ -1,1090 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using Adyen.HttpClient.Interfaces; -using Adyen.Model; -using Adyen.Model.Checkout; -using Adyen.Service.Checkout; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using NSubstitute; -using static Adyen.Model.Checkout.PaymentResponse; -using ApplicationInfo = Adyen.Model.ApplicationInformation.ApplicationInfo; -using Environment = Adyen.Model.Environment; -using IRecurringService = Adyen.Service.Checkout.IRecurringService; -using RecurringService = Adyen.Service.Checkout.RecurringService; - -namespace Adyen.Test -{ - [TestClass] - public class CheckoutTest : BaseTest - { - /// - /// Tests successful checkout client Test URL generation. - /// - [TestMethod] - public void CheckoutEndpointTestEnvironmentSuccessTest() - { - var client = CreateMockForAdyenClientTest(new Config()); - client.SetEnvironment(Environment.Test, "companyUrl"); - var checkout = new PaymentsService(client); - checkout.PaymentsAsync(new PaymentRequest()).GetAwaiter(); - - ClientInterfaceSubstitute.Received().RequestAsync("https://checkout-test.adyen.com/v71/payments", - Arg.Any(), null, new HttpMethod("POST"), default); - } - - /// - /// Tests successful checkout client Live URL generation. - /// - [TestMethod] - public void CheckoutEndpointLiveEnvironmentSuccessTest() - { - var client = CreateMockForAdyenClientTest(new Config()); - client.SetEnvironment(Environment.Live, "companyUrl"); - var checkout = new PaymentsService(client); - checkout.PaymentsAsync(new PaymentRequest()).GetAwaiter(); - - ClientInterfaceSubstitute.Received().RequestAsync( - "https://companyUrl-checkout-live.adyenpayments.com/checkout/v71/payments", - Arg.Any(), null, new HttpMethod("POST"), Arg.Any()); - } - - /// - /// Tests unsuccessful checkout client Live URL generation. - /// - [TestMethod] - public void CheckoutEndpointLiveErrorTest() - { - var config = new Config(); - var client = new Client(config); - client.SetEnvironment(Environment.Live, null); - Assert.ThrowsException(() => new PaymentsService(client)); - } - - /// - /// Tests unsuccessful checkout client Live URL generation. - /// - [TestMethod] - public void CheckoutEndpointLiveWithBasicAuthErrorTest() - { - var client = new Client(new Config() - { - Username = "ws_*******", - Password = "*******", - Environment = Environment.Live - - }); - Assert.ThrowsException( - () => new PaymentsService(client)); - } - - /// - /// Tests successful checkout client Live URL generation with basic auth. - /// - [TestMethod] - public void CheckoutEndpointLiveWithBasicAuthTest() - { - var client = CreateMockForAdyenClientTest( - new Config - { - Username = "ws_*******", - Password = "******", - Environment = Environment.Live, - LiveEndpointUrlPrefix = "live-url" - }); - var checkout = new PaymentsService(client); - checkout.PaymentsAsync(new PaymentRequest()).GetAwaiter(); - ClientInterfaceSubstitute.Received().RequestAsync("https://live-url-checkout-live.adyenpayments.com/checkout/v71/payments", - Arg.Any(), null, new HttpMethod("POST"), default); - } - - /// - /// Tests successful checkout client Live URL generation with API key. - /// - [TestMethod] - public void CheckoutEndpointLiveWithAPIKeyTest() - { - var client = CreateMockForAdyenClientTest( - new Config - { - XApiKey = "xapikey", - Environment = Environment.Live, - LiveEndpointUrlPrefix = "live-url" - }); - var checkout = new PaymentsService(client); - checkout.PaymentsAsync(new PaymentRequest()).GetAwaiter(); - ClientInterfaceSubstitute.Received().RequestAsync("https://live-url-checkout-live.adyenpayments.com/checkout/v71/payments", - Arg.Any(), null, new HttpMethod("POST"), Arg.Any()); - } - - /// - /// Test success flow for - /// POST /payments - /// - [TestMethod] - public void PaymentsAdditionalDataParsingTest() - { - var paymentRequest = CreatePaymentRequestCheckout(); - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/payments-success.json"); - var checkout = new PaymentsService(client); - var paymentResponse = checkout.Payments(paymentRequest); - Assert.AreEqual("8535296650153317", paymentResponse.PspReference); - Assert.AreEqual(ResultCodeEnum.Authorised, paymentResponse.ResultCode); - Assert.IsNotNull(paymentResponse.AdditionalData); - Assert.AreEqual(9, paymentResponse.AdditionalData.Count); - Assert.AreEqual("8/2018", paymentResponse.AdditionalData["expiryDate"]); - Assert.AreEqual("GREEN", paymentResponse.AdditionalData["fraudResultType"]); - Assert.AreEqual("411111", paymentResponse.AdditionalData["cardBin"]); - Assert.AreEqual("1111", paymentResponse.AdditionalData["cardSummary"]); - Assert.AreEqual("false", paymentResponse.AdditionalData["fraudManualReview"]); - Assert.AreEqual("Default", paymentResponse.AdditionalData["aliasType"]); - Assert.AreEqual("H167852639363479", paymentResponse.AdditionalData["alias"]); - Assert.AreEqual("visa", paymentResponse.AdditionalData["cardPaymentMethod"]); - Assert.AreEqual("NL", paymentResponse.AdditionalData["cardIssuingCountry"]); - } - - /// - /// Test success flow for async - /// POST /payments - /// - [TestMethod] - public async Task PaymentsAsyncAdditionalDataParsingTest() - { - var paymentRequest = CreatePaymentRequestCheckout(); - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/payments-success.json"); - var checkout = new PaymentsService(client); - var paymentResponse = await checkout.PaymentsAsync(paymentRequest); - Assert.AreEqual("8535296650153317", paymentResponse.PspReference); - Assert.AreEqual(ResultCodeEnum.Authorised, paymentResponse.ResultCode); - Assert.IsNotNull(paymentResponse.AdditionalData); - Assert.AreEqual(9, paymentResponse.AdditionalData.Count); - Assert.AreEqual("8/2018", paymentResponse.AdditionalData["expiryDate"]); - Assert.AreEqual("GREEN", paymentResponse.AdditionalData["fraudResultType"]); - Assert.AreEqual("411111", paymentResponse.AdditionalData["cardBin"]); - Assert.AreEqual("1111", paymentResponse.AdditionalData["cardSummary"]); - Assert.AreEqual("false", paymentResponse.AdditionalData["fraudManualReview"]); - Assert.AreEqual("Default", paymentResponse.AdditionalData["aliasType"]); - Assert.AreEqual("H167852639363479", paymentResponse.AdditionalData["alias"]); - Assert.AreEqual("visa", paymentResponse.AdditionalData["cardPaymentMethod"]); - Assert.AreEqual("NL", paymentResponse.AdditionalData["cardIssuingCountry"]); - } - - /// - /// Test success flow for 3DS2 - /// POST /payments - /// - [TestMethod] - public void Payments3DS2Test() - { - var payment3DS2Request = CreatePaymentRequest3DS2(); - var client = - CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/payments-3DS2-IdentifyShopper.json"); - var checkout = new PaymentsService(client); - var paymentResponse = checkout.Payments(payment3DS2Request); - Assert.AreEqual(paymentResponse.ResultCode, ResultCodeEnum.IdentifyShopper); - Assert.AreEqual(paymentResponse.Action.GetCheckoutThreeDS2Action().Type.ToString(), "ThreeDS2"); - Assert.IsNotNull(paymentResponse.Action.GetCheckoutThreeDS2Action().PaymentData); - } - - /// - /// Test error flow for - /// POST /payments - /// - [TestMethod] - public void PaymentsErrorTest() - { - var paymentMethodsRequest = CreatePaymentRequestCheckout(); - var client = - CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/payments-error-invalid-data-422.json"); - var checkout = new PaymentsService(client); - var paymentResponse = checkout.Payments(paymentMethodsRequest); - Assert.IsNull(paymentResponse.PspReference); - } - - /// - /// Test success flow for - /// POST /payments/details - /// - [TestMethod] - public void PaymentDetailsTest() - { - var detailsRequest = CreateDetailsRequest(); - detailsRequest.Details = - new PaymentCompletionDetails( - payload: "Ab02b4c0!BQABAgBQn96RxfJHpp2RXhqQBuhQFWgE...gfGHb4IZSP4IpoCC2==RXhqQBuhQ"); - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentsdetails-success.json"); - var checkout = new PaymentsService(client); - var paymentResponse = checkout.PaymentsDetails(detailsRequest); - Assert.AreEqual("8515232733321252", paymentResponse.PspReference); - } - - /// - /// Test success flow for async - /// POST /payments/details - /// - [TestMethod] - public async Task PaymentDetailsAsyncTest() - { - var detailsRequest = CreateDetailsRequest(); - detailsRequest.Details = - new PaymentCompletionDetails( - payload: "Ab02b4c0!BQABAgBQn96RxfJHpp2RXhqQBuhQFWgE...gfGHb4IZSP4IpoCC2==RXhqQBuhQ"); - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentsdetails-success.json"); - var checkout = new PaymentsService(client); - var paymentResponse = await checkout.PaymentsDetailsAsync(detailsRequest); - Assert.AreEqual("8515232733321252", paymentResponse.PspReference); - } - - /// - /// Test error flow for - /// POST /payments/details - /// - [TestMethod] - public void PaymentDetailsErrorTest() - { - var detailsRequest = CreateDetailsRequest(); - detailsRequest.Details = - new PaymentCompletionDetails( - payload: "Ab02b4c0!BQABAgBQn96RxfJHpp2RXhqQBuhQFWgE...gfGHb4IZSP4IpoCC2==RXhqQBuhQ"); - var client = - CreateMockTestClientApiKeyBasedRequestAsync( - "mocks/checkout/paymentsdetails-error-invalid-data-422.json"); - var checkout = new PaymentsService(client); - var paymentResponse = checkout.PaymentsDetails(detailsRequest); - Assert.IsNull(paymentResponse.ResultCode); - } - - /// - /// Test success deserialization for - /// POST /payments/details - /// - [TestMethod] - public void PaymentDetailsResponseDeserializeTest() - { - var detailsRequest = CreateDetailsRequest(); - detailsRequest.Details = - new PaymentCompletionDetails( - payload: "Ab02b4c0!BQABAgBQn96RxfJHpp2RXhqQBuhQFWgE...gfGHb4IZSP4IpoCC2==RXhqQBuhQ"); - var client = - CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentsdetails-action-success.json"); - var checkout = new PaymentsService(client); - var paymentResponse = checkout.PaymentsDetails(detailsRequest); - Assert.AreEqual(paymentResponse.PspReference, "8515232733321252"); - Assert.AreEqual(paymentResponse.ResultCode, PaymentDetailsResponse.ResultCodeEnum.Authorised); - } - - /// - /// Test success flow for - /// POST /paymentMethods - /// - [TestMethod] - public void PaymentMethodsTest() - { - var paymentMethodsRequest = CreatePaymentMethodRequest("YourMerchantAccount"); - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentmethods-success.json"); - var checkout = new PaymentsService(client); - var paymentMethodsResponse = checkout.PaymentMethods(paymentMethodsRequest); - Assert.AreEqual(paymentMethodsResponse.PaymentMethods.Count, 32); - } - - /// - /// Test success flow for - /// POST /paymentMethods - /// - [TestMethod] - public void PaymentMethodsIssuersTest() - { - var paymentMethodsRequest = CreatePaymentMethodRequest("YourMerchantAccount"); - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentmethods-success.json"); - var checkout = new PaymentsService(client); - var paymentMethodsResponse = checkout.PaymentMethods(paymentMethodsRequest); - Assert.IsNotNull(paymentMethodsResponse.PaymentMethods[12].Issuers); - Assert.AreEqual(paymentMethodsResponse.PaymentMethods[12].Issuers[0].Id, "66"); - Assert.AreEqual(paymentMethodsResponse.PaymentMethods[12].Issuers[0].Name, "Bank Nowy BFG S.A."); - } - - /// - /// Test success flow for - /// POST /paymentMethods - /// - [TestMethod] - public void PaymentMethodsStoreValueTest() - { - var paymentMethodsRequest = CreatePaymentMethodRequest("YourMerchantAccount"); - paymentMethodsRequest.Store = "MerchantStore"; - Assert.AreEqual(paymentMethodsRequest.Store, "MerchantStore"); - } - - /// - /// Test success flow for async - /// POST /paymentMethods - /// - [TestMethod] - public async Task PaymentMethodsAsyncTest() - { - var paymentMethodsRequest = CreatePaymentMethodRequest("YourMerchantAccount"); - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentmethods-success.json"); - var checkout = new PaymentsService(client); - var paymentMethodsResponse = await checkout.PaymentMethodsAsync(paymentMethodsRequest); - Assert.AreEqual(paymentMethodsResponse.PaymentMethods.Count, 32); - } - - /// - /// Test error flow for - /// POST /paymentMethods - /// - [TestMethod] - public void PaymentMethodsErrorTest() - { - var paymentMethodsRequest = CreatePaymentMethodRequest("YourMerchantAccount"); - var client = - CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentmethods-error-forbidden-403.json"); - var checkout = new PaymentsService(client); - var paymentMethodsResponse = checkout.PaymentMethods(paymentMethodsRequest); - Assert.IsNull(paymentMethodsResponse.PaymentMethods); - } - - /// - /// Test success flow including brands check for - /// POST /paymentMethods - /// - [TestMethod] - public void PaymentMethodsWithBrandsTest() - { - var paymentMethodsRequest = CreatePaymentMethodRequest("YourMerchantAccount"); - var client = - CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentmethods-brands-success.json"); - var checkout = new PaymentsService(client); - var paymentMethodsResponse = checkout.PaymentMethods(paymentMethodsRequest); - Assert.AreEqual(paymentMethodsResponse.PaymentMethods.Count, 7); - Assert.AreEqual(paymentMethodsResponse.PaymentMethods[0].Brands.Count, 5); - Assert.AreEqual(paymentMethodsResponse.PaymentMethods[0].Brands[0], "visa"); - Assert.AreEqual(paymentMethodsResponse.PaymentMethods[0].Brands[1], "mc"); - Assert.AreEqual(paymentMethodsResponse.PaymentMethods[0].Brands[2], "amex"); - Assert.AreEqual(paymentMethodsResponse.PaymentMethods[0].Brands[3], "bcmc"); - Assert.AreEqual(paymentMethodsResponse.PaymentMethods[0].Brands[4], "maestro"); - } - - /// - /// Test flow without including brands check for - /// POST /paymentMethods - /// - [TestMethod] - public void PaymentMethodsWithoutBrandsTest() - { - var paymentMethodsRequest = CreatePaymentMethodRequest("YourMerchantAccount"); - var client = - CreateMockTestClientApiKeyBasedRequestAsync( - "mocks/checkout/paymentmethods-without-brands-success.json"); - var checkout = new PaymentsService(client); - var paymentMethodsResponse = checkout.PaymentMethods(paymentMethodsRequest); - Assert.AreEqual(paymentMethodsResponse.PaymentMethods.Count, 50); - } - - [TestMethod] - public void ApplicationInfoTest() - { - ApplicationInfo applicationInfo = new ApplicationInfo(); - Assert.AreEqual(applicationInfo.AdyenLibrary.Name, Constants.ClientConfig.LibName); - Assert.AreEqual(applicationInfo.AdyenLibrary.Version, Constants.ClientConfig.LibVersion); - } - - [Ignore] // The adyen library info will not be added anymore by default, let's investigate if we should. - [TestMethod] - public void PaymentRequestApplicationInfoTest() - { - var paymentRequest = CreatePaymentRequestCheckout(); - var name = paymentRequest.ApplicationInfo.AdyenLibrary.Name; - var version = paymentRequest.ApplicationInfo.AdyenLibrary.Version; - Assert.AreEqual(version, Constants.ClientConfig.LibVersion); - Assert.AreEqual(name, Constants.ClientConfig.LibName); - } - - [TestMethod] - public void PaymentRequestAppInfoExternalTest() - { - var externalPlatform = new ExternalPlatform(); - var merchantApplication = new CommonField(); - externalPlatform.Integrator = "TestExternalPlatformIntegration"; - externalPlatform.Name = "TestExternalPlatformName"; - externalPlatform.Version = "TestExternalPlatformVersion"; - merchantApplication.Name = "MerchantApplicationName"; - merchantApplication.Version = "MerchantApplicationVersion"; - var paymentRequest = CreatePaymentRequestCheckout(); - paymentRequest.ApplicationInfo = new Model.Checkout.ApplicationInfo - { - ExternalPlatform = externalPlatform, - MerchantApplication = merchantApplication - }; - Assert.AreEqual(paymentRequest.ApplicationInfo.ExternalPlatform.Integrator, - "TestExternalPlatformIntegration"); - Assert.AreEqual(paymentRequest.ApplicationInfo.ExternalPlatform.Name, "TestExternalPlatformName"); - Assert.AreEqual(paymentRequest.ApplicationInfo.ExternalPlatform.Version, "TestExternalPlatformVersion"); - Assert.AreEqual(paymentRequest.ApplicationInfo.MerchantApplication.Name, "MerchantApplicationName"); - Assert.AreEqual(paymentRequest.ApplicationInfo.MerchantApplication.Version, "MerchantApplicationVersion"); - } - - - [TestMethod] - public void PaymentsOriginTest() - { - var paymentMethodsRequest = CreatePaymentRequestCheckout(); - paymentMethodsRequest.Origin = "https://localhost:8080"; - Assert.AreEqual(paymentMethodsRequest.Origin, "https://localhost:8080"); - } - - /// - /// Test CreatePaymentLinkRequest - /// POST /payments/result - /// - [TestMethod] - public void CreatePaymentLinkSuccess() - { - var createPaymentLinkRequest = new PaymentLinkRequest(store: "TheDemoStore", - amount: new Amount(currency: "EUR", 1000), merchantAccount: "MerchantAccount", reference: "reference"); - Assert.AreEqual(createPaymentLinkRequest.Store, "TheDemoStore"); - } - - /// - /// Test success flow for - /// POST /payments/result - /// - [TestMethod] - public void PaymentLinksSuccess() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/payment-links-success.json"); - var checkout = new PaymentLinksService(client); - var createPaymentLinkRequest = new PaymentLinkRequest(amount: new Amount(currency: "EUR", 1000), - merchantAccount: "MerchantAccount", reference: "YOUR_ORDER_NUMBER"); - var paymentLinksResponse = checkout.PaymentLinks(createPaymentLinkRequest); - Assert.AreEqual(paymentLinksResponse.Url, - "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=YW1vdW50TWlub3JW...JRA"); - Assert.AreEqual(paymentLinksResponse.ExpiresAt, new DateTime(2019,12,17,10,05,29)); - Assert.AreEqual(paymentLinksResponse.Reference, "YOUR_ORDER_NUMBER"); - Assert.IsNotNull(paymentLinksResponse.Amount); - } - - /// - /// Test success flow for creation of a payment link with recurring payment - /// POST /paymentLinks - /// - [TestMethod] - public void CreateRecurringPaymentLinkSuccessTest() - { - var client = - CreateMockTestClientApiKeyBasedRequestAsync( - "mocks/checkout/paymentlinks-recurring-payment-success.json"); - var checkout = new PaymentLinksService(client); - - var createPaymentLinkRequest = new PaymentLinkRequest(amount: new Amount(currency: "EUR", 100), - merchantAccount: "MerchantAccount", reference: "REFERENCE_NUMBER") - { - CountryCode = "GR", - ShopperLocale = "GR", - ShopperReference = "ShopperReference", - StorePaymentMethodMode = PaymentLinkRequest.StorePaymentMethodModeEnum.Enabled, - RecurringProcessingModel = PaymentLinkRequest.RecurringProcessingModelEnum.Subscription - }; - - var paymentLinksResponse = checkout.PaymentLinks(createPaymentLinkRequest); - - Assert.AreEqual(createPaymentLinkRequest.Reference, paymentLinksResponse.Reference); - Assert.AreEqual( - "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=YW1vdW50TWlub3JW...JRA", - paymentLinksResponse.Url); - Assert.AreEqual(createPaymentLinkRequest.Amount.Currency, paymentLinksResponse.Amount.Currency); - Assert.AreEqual(createPaymentLinkRequest.Amount.Value, paymentLinksResponse.Amount.Value); - } - - /// - /// Test success flow for multibanco - /// Post /payments - /// - [Ignore] - [TestMethod] - public void MultibancoPaymentSuccessMockedTest() - { - var client = - CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentsresult-multibanco-success.json"); - var checkout = new PaymentsService(client); - var paymentRequest = CreatePaymentRequestCheckout(); - var paymentResponse = checkout.Payments(paymentRequest); - var paymentResponseAction = paymentResponse.Action.GetCheckoutVoucherAction(); - Assert.AreEqual(paymentResponseAction.PaymentMethodType, "multibanco"); - Assert.AreEqual(paymentResponseAction.ExpiresAt, "01/12/2020 09:37:49"); - Assert.AreEqual(paymentResponseAction.Reference, "501 422 944"); - Assert.AreEqual(paymentResponseAction.Entity, "12101"); - } - - /// - /// Test RiskData - Clientdata flow for - /// POST /payments - /// - [TestMethod] - public void PaymentClientdataParsingTest() - { - var paymentRequest = CreatePaymentRequestCheckout(); - var riskdata = new RiskData - { - ClientData = "IOfW3k9G2PvXFu2j" - }; - paymentRequest.RiskData = riskdata; - Assert.AreEqual(paymentRequest.RiskData.ClientData, "IOfW3k9G2PvXFu2j"); - } - - /// - /// Test success flow for paypal - /// Post /payments - /// - [TestMethod] - public void PaypalPaymentSuccessTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/payments-success-paypal.json"); - var checkout = new PaymentsService(client); - var paymentRequest = CreatePaymentRequestCheckout(); - var paymentResponse = checkout.Payments(paymentRequest); - var result = paymentResponse.Action.GetCheckoutSDKAction(); - Assert.IsNotNull(result); - Assert.AreEqual("EC-42N19135GM6949000", result.SdkData["orderID"]); - Assert.AreEqual("Ab02b4c0!BQABAgARb1TvUJa4nwS0Z1nOmxoYfD9+z...", result.PaymentData); - Assert.AreEqual("paypal", result.PaymentMethodType); - } - - [TestMethod] - public void ApplePayDetailsDeserializationTest() - { - var json = "{\"type\": \"applepay\",\"applePayToken\": \"VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU...\"}"; - var result = CheckoutPaymentMethod.FromJson(json); - Assert.IsInstanceOfType(result.ActualInstance); - Assert.AreEqual(result.GetApplePayDetails().Type, ApplePayDetails.TypeEnum.Applepay); - } - - [TestMethod] - public void CheckoutPaymentMethodDeserializationWithUnknownValuesTest() - { - var json = "{\"type\": \"applepay\",\"someValue\": \"notInSpec\",\"applePayToken\": \"VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU...\"}"; - var result = CheckoutPaymentMethod.FromJson(json); - var json2 = "{\"type\": \"paywithgoogle\",\"someValue\": \"notInSpec\",\"googlePayToken\": \"==Payload as retrieved from Google Pay response==\"}"; - var result2 = CheckoutPaymentMethod.FromJson(json2); - Assert.IsInstanceOfType(result.ActualInstance); - Assert.IsInstanceOfType(result2.ActualInstance); - Assert.AreEqual(result2.GetPayWithGoogleDetails().GooglePayToken, "==Payload as retrieved from Google Pay response=="); - } - - [TestMethod] - public void BlikDetailsDeserializationTest() - { - var json = "{\"type\":\"blik\",\"blikCode\":\"blikCode\"}"; - var result = JsonConvert.DeserializeObject(json); - Assert.IsInstanceOfType(result); - Assert.AreEqual(result.Type, BlikDetails.TypeEnum.Blik); - } - - [TestMethod] - public void DragonpayDetailsDeserializationTest() - { - var json = - "{\"issuer\":\"issuer\",\"shopperEmail\":\"test@test.com\",\"type\":\"dragonpay_ebanking\"}"; - var result = JsonConvert.DeserializeObject(json); - Assert.IsInstanceOfType(result); - Assert.AreEqual(result.Type, DragonpayDetails.TypeEnum.Ebanking); - } - - [TestMethod] - public void AfterPayDetailsDeserializationTest() - { - var json = @"{ - 'resultCode':'RedirectShopper', - 'action':{ - 'paymentMethodType':'afterpaytouch', - 'method':'GET', - 'url':'https://checkoutshopper-test.adyen.com/checkoutshopper/checkoutPaymentRedirect?redirectData=...', - 'type':'redirect' - } - }"; - var result = JsonConvert.DeserializeObject(json); - Assert.IsInstanceOfType(result.Action.GetCheckoutRedirectAction()); - Assert.AreEqual(result.Action.GetCheckoutRedirectAction().PaymentMethodType, "afterpaytouch"); - } - - [TestMethod] - public void AfterPayDetailsSerializationTest() - { - var json = @"{ - 'paymentMethod':{ - 'type':'afterpaytouch' - }, - 'amount':{ - 'value':1000, - 'currency':'AUD' - }, - 'shopperName':{ - 'firstName':'Simon', - 'lastName':'Hopper' - }, - 'shopperEmail':'s.hopper@example.com', - 'shopperReference':'YOUR_UNIQUE_SHOPPER_ID', - 'reference':'YOUR_ORDER_REFERENCE', - 'merchantAccount':'YOUR_MERCHANT_ACCOUNT', - 'returnUrl':'https://your-company.com/checkout?shopperOrder=12xy..', - 'countryCode':'AU', - 'telephoneNumber':'+61 2 8520 3890', - 'billingAddress':{ - 'city':'Sydney', - 'country':'AU', - 'houseNumberOrName':'123', - 'postalCode':'2000', - 'stateOrProvince':'NSW', - 'street':'Happy Street' - }, - 'deliveryAddress':{ - 'city':'Sydney', - 'country':'AU', - 'houseNumberOrName':'123', - 'postalCode':'2000', - 'stateOrProvince':'NSW', - 'street':'Happy Street' - }, - 'lineItems':[ - { - 'description':'Shoes', - 'quantity':'1', - 'amountIncludingTax':'400', - 'amountExcludingTax': '331', - 'taxAmount': '69', - 'id':'Item #1' - }, - { - 'description':'Socks', - 'quantity':'2', - 'amountIncludingTax':'300', - 'amountExcludingTax': '248', - 'taxAmount': '52', - 'id':'Item #2' - } - ] - }"; - - var result = JsonConvert.DeserializeObject(json); - Assert.IsInstanceOfType(result.PaymentMethod.GetAfterpayDetails()); - Assert.AreEqual(result.PaymentMethod.GetAfterpayDetails().Type, AfterpayDetails.TypeEnum.Afterpaytouch); - } - - /// - /// Test toJson() that includes the type in the action - /// - [TestMethod] - public void PaymentsResponseToJsonTest() - { - var paymentRequest = CreatePaymentRequestCheckout(); - var client = - CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentResponse-3DS-ChallengeShopper.json"); - var checkout = new PaymentsService(client); - var paymentResponse = checkout.Payments(paymentRequest); - var paymentResponseToJson = paymentResponse.ToJson(); - var jObject = JObject.Parse(paymentResponseToJson); - Assert.AreEqual(jObject["action"]["type"], "threeDS2"); - } - - [TestMethod] - public void StoredPaymentMethodsTest() - { - var client = - CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentmethods-storedpaymentmethods.json"); - var checkout = new PaymentsService(client); - var paymentMethodsRequest = new PaymentMethodsRequest(merchantAccount: "TestMerchant"); - var paymentMethodsResponse = checkout.PaymentMethods(paymentMethodsRequest); - Assert.AreEqual(4, paymentMethodsResponse.StoredPaymentMethods.Count); - Assert.AreEqual("NL32ABNA0515071439", paymentMethodsResponse.StoredPaymentMethods[0].Iban); - Assert.AreEqual("Adyen", paymentMethodsResponse.StoredPaymentMethods[0].OwnerName); - Assert.AreEqual("sepadirectdebit", paymentMethodsResponse.StoredPaymentMethods[0].Type); - } - - /// - /// Test if the fraud result are properly deseriazed - /// POST /payments - /// - [TestMethod] - public void ThreeDS2Test() - { - var paymentRequest = CreatePaymentRequestCheckout(); - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentResponse-3DS2-Action.json"); - var checkout = new PaymentsService(client); - var paymentResponse = checkout.Payments(paymentRequest); - var paymentResponseThreeDs2Action = paymentResponse.Action.GetCheckoutThreeDS2Action(); - Assert.AreEqual(ResultCodeEnum.IdentifyShopper, paymentResponse.ResultCode); - Assert.AreEqual(CheckoutThreeDS2Action.TypeEnum.ThreeDS2, paymentResponseThreeDs2Action.Type); - } - - [TestMethod] - public void CheckoutLocalDateSerializationTest() - { - var checkoutSessionRequest = new CreateCheckoutSessionRequest - { - MerchantAccount = "merchant", - Reference = "TestReference", - ReturnUrl = "http://test-url.com", - Amount = new Amount("EUR", 10000L), - DateOfBirth = new DateTime(1998, 1, 1, 1, 1, 1), - ExpiresAt = new DateTime(2023, 4, 1, 1, 1, 1) - }; - // Create a DateTime object with minutes and seconds and verify it gets omitted - Assert.IsTrue(checkoutSessionRequest.ToJson().Contains("1998-01-01")); - // Opposite; check that it keeps full ISO string for other Date parameters - Assert.IsTrue(checkoutSessionRequest.ToJson().Contains("2023-04-01T01:01:01")); - } - - /// - /// Test success sessions - /// POST /sessions - /// - [TestMethod] - public void CheckoutSessionSuccessTest() - { - var checkoutSessionRequest = new CreateCheckoutSessionRequest - { - MerchantAccount = "TestMerchant", - Reference = "TestReference", - ReturnUrl = "http://test-url.com", - Amount = new Amount("EUR", 10000L), - Store = "My Store" - }; - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/sessions-success.json"); - var checkout = new PaymentsService(client); - var checkoutSessionResponse = checkout.Sessions(checkoutSessionRequest); - Assert.AreEqual("TestMerchant", checkoutSessionResponse.MerchantAccount); - Assert.AreEqual("TestReference", checkoutSessionResponse.Reference); - Assert.AreEqual("http://test-url.com", checkoutSessionResponse.ReturnUrl); - Assert.AreEqual("EUR", checkoutSessionResponse.Amount.Currency); - Assert.AreEqual("1000", checkoutSessionResponse.Amount.Value.ToString()); - Assert.AreEqual("My Store", checkoutSessionResponse.Store); - - } - - /// - /// Test success orders - /// POST /paymentMethods/balance - /// - [TestMethod] - public void CheckoutPaymentMethodsBalanceSuccessTest() - { - var checkoutBalanceCheckRequest = new BalanceCheckRequest - (amount: new Amount("EUR", 10000L), - merchantAccount: "TestMerchant", - reference: "TestReference", - paymentMethod: new Dictionary - { - { "type", "givex" }, - { "number", "4126491073027401" }, - { "cvc", "737" } - }); - var client = - CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/paymentmethods-balance-success.json"); - var checkout = new OrdersService(client); - var checkoutBalanceCheckResponse = checkout.GetBalanceOfGiftCard(checkoutBalanceCheckRequest); - Assert.AreEqual(BalanceCheckResponse.ResultCodeEnum.Success, - checkoutBalanceCheckResponse.ResultCode); - Assert.AreEqual("EUR", checkoutBalanceCheckResponse.Balance.Currency); - Assert.AreEqual("2500", checkoutBalanceCheckResponse.Balance.Value.ToString()); - } - - /// - /// Test success orders - /// POST /orders - /// - [TestMethod] - public void CheckoutOrderSuccessTest() - { - var checkoutCreateOrderRequest = new CreateOrderRequest - (amount: new Amount("EUR", 10000L), - merchantAccount: "TestMerchant", - reference: "TestReference"); - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/orders-success.json"); - var checkout = new OrdersService(client); - var checkoutOrdersResponse = checkout.Orders(checkoutCreateOrderRequest); - Assert.AreEqual(CreateOrderResponse.ResultCodeEnum.Success, checkoutOrdersResponse.ResultCode); - Assert.AreEqual("8515930288670953", checkoutOrdersResponse.PspReference); - Assert.AreEqual("Ab02b4c0!BQABAgBqxSuFhuXUF7IvIRvSw5bDPHN...", checkoutOrdersResponse.OrderData); - Assert.AreEqual("EUR", checkoutOrdersResponse.RemainingAmount.Currency); - Assert.AreEqual("2500", checkoutOrdersResponse.RemainingAmount.Value.ToString()); - } - - /// - /// Test success orders cancel - /// POST /orders/cancel - /// - [TestMethod] - public void CheckoutOrdersCancelSuccessTest() - { - var checkoutCancelOrderRequest = new CancelOrderRequest - (merchantAccount: "TestMerchant", - order: new EncryptedOrderData(orderData: "823fh892f8f18f4...148f13f9f3f", pspReference: "8815517812932012")); - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/orders-cancel-success.json"); - var checkout = new OrdersService(client); - var checkoutOrdersCancelResponse = checkout.CancelOrder(checkoutCancelOrderRequest); - Assert.AreEqual("Received", checkoutOrdersCancelResponse.ResultCode.ToString()); - Assert.AreEqual("8515931182066678", checkoutOrdersCancelResponse.PspReference); - } - - /// - /// Test success orders cancel - /// GET /storedPaymentMethods - /// - [TestMethod] - public void GetStoredPaymentMethodsTest() - { - var client = - CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/get-storedPaymentMethod-success.json"); - var checkout = new RecurringService(client); - var listStoredPaymentMethodsResponse = - checkout.GetTokensForStoredPaymentDetails("shopperRef", "merchantAccount"); - Assert.AreEqual("string", listStoredPaymentMethodsResponse.StoredPaymentMethods[0].Type); - Assert.AreEqual("merchantAccount", listStoredPaymentMethodsResponse.MerchantAccount); - } - - /// - /// Test success orders cancel - /// GET /storedPaymentMethods - /// - [TestMethod] - public void DeleteStoredPaymentMethodsTest() - { - var client = - CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/get-storedPaymentMethod-success.json"); - var checkout = new RecurringService(client); - checkout.DeleteTokenForStoredPaymentDetails("recurringId","shopperRef", "merchantAccount"); - } - - #region Modification endpoints tests - - /// - /// Test success capture - /// POST /payments/{paymentPspReference}/captures - /// - [TestMethod] - public void PaymentsCapturesTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/captures-success.json"); - var checkout = new ModificationsService(client); - var createPaymentCaptureRequest = new PaymentCaptureRequest(amount: new Amount("EUR", 1000L), - merchantAccount: "test_merchant_account"); - var paymentCaptureResource = checkout.CaptureAuthorisedPayment("12321A", createPaymentCaptureRequest); - Assert.AreEqual(PaymentCaptureResponse.StatusEnum.Received, paymentCaptureResource.Status); - Assert.AreEqual("my_reference", paymentCaptureResource.Reference); - } - - /// - /// Test success payments cancels - /// POST /payments/{paymentPspReference}/cancels - /// - [TestMethod] - public void PaymentsCancelsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/cancels-success.json"); - var checkout = new ModificationsService(client); - var createPaymentCancelRequest = new PaymentCancelRequest(merchantAccount: "test_merchant_account"); - var paymentCancelResource = - checkout.CancelAuthorisedPaymentByPspReference("12321A", createPaymentCancelRequest); - Assert.AreEqual(PaymentCancelResponse.StatusEnum.Received, paymentCancelResource.Status); - Assert.AreEqual("my_reference", paymentCancelResource.Reference); - } - - /// - /// Test success cancels - /// POST /cancels - /// - [TestMethod] - public void CancelsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/standalone-cancels-success.json"); - var checkout = new ModificationsService(client); - var createStandalonePaymentCancelRequest = - new StandalonePaymentCancelRequest(merchantAccount: "test_merchant_account"); - var standalonePaymentCancelResource = - checkout.CancelAuthorisedPayment(createStandalonePaymentCancelRequest); - Assert.AreEqual(StandalonePaymentCancelResponse.StatusEnum.Received, - standalonePaymentCancelResource.Status); - Assert.AreEqual("861633338418518C", standalonePaymentCancelResource.PspReference); - } - - /// - /// Test success payments refunds - /// POST /payments/{paymentPspReference}/refunds - /// - [TestMethod] - public void TestPaymentsRefunds() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/refunds-success.json"); - var checkout = new ModificationsService(client); - var createPaymentRefundRequest = new PaymentRefundRequest(amount: new Amount("EUR", 1000L), - merchantAccount: "test_merchant_account"); - var paymentRefundResource = checkout.RefundCapturedPayment("12321A", createPaymentRefundRequest); - Assert.AreEqual(PaymentRefundResponse.StatusEnum.Received, paymentRefundResource.Status); - Assert.AreEqual("my_reference", paymentRefundResource.Reference); - } - - /// - /// Test success payments reversals - /// POST /payments/{paymentPspReference}/reversals - /// - [TestMethod] - public void PaymentsReversalsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/reversals-success.json"); - var checkout = new ModificationsService(client); - var createPaymentReversalRequest = - new PaymentReversalRequest(merchantAccount: "test_merchant_account"); - var paymentReversalResource = checkout.RefundOrCancelPayment("12321A", createPaymentReversalRequest); - Assert.AreEqual(PaymentReversalResponse.StatusEnum.Received, paymentReversalResource.Status); - Assert.AreEqual("my_reference", paymentReversalResource.Reference); - } - - /// - /// Test success payments cancels - /// POST /payments/{paymentPspReference}/amountUpdates - /// - [TestMethod] - public void PaymentsAmountUpdatesTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/amount-updates-success.json"); - var checkout = new ModificationsService(client); - var createPaymentAmountUpdateRequest = new PaymentAmountUpdateRequest( - amount: new Amount("EUR", 1000L), - merchantAccount: "test_merchant_account"); - var paymentAmountUpdateResource = - checkout.UpdateAuthorisedAmount("12321A", createPaymentAmountUpdateRequest); - Assert.AreEqual(PaymentAmountUpdateResponse.StatusEnum.Received, paymentAmountUpdateResource.Status); - Assert.AreEqual("my_reference", paymentAmountUpdateResource.Reference); - } - - /// - /// Test success donations - /// POST /donations - /// - [TestMethod] - public void DonationsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/donations-success.json"); - var checkout = new DonationsService(client); - var paymentDonationRequest = - new DonationPaymentRequest( - merchantAccount: "test_merchant_account", - amount: new Amount("USD", 5), - donationAccount: "Charity_TEST", - paymentMethod: new DonationPaymentMethod(new CardDonations()), - reference: "179761FE-1913-4226-9F43-E475DE634BBA", - returnUrl: "https://your-company.com/..."); - var donationResponse = checkout.Donations(paymentDonationRequest); - Assert.AreEqual(DonationPaymentResponse.StatusEnum.Completed, - donationResponse.Status); - Assert.AreEqual("10720de4-7c5d-4a17-9161-fa4abdcaa5c4", donationResponse.Reference); - } - - /// - /// Test success donations - /// POST /donations - /// - [TestMethod] - public void CardDetailsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/card-details-success.json"); - var checkout = new PaymentsService(client); - var cardDetailRequest = - new CardDetailsRequest - { - MerchantAccount = "TestMerchant", - CardNumber = "1234567890", - CountryCode = "NL" - }; - var cardDetailResponse = checkout.CardDetails(cardDetailRequest); - Assert.AreEqual("visa", cardDetailResponse.Brands[0].Type); - Assert.AreEqual("cartebancaire", cardDetailResponse.Brands[1].Type); - } - - /// - /// Test success donations - /// POST /donations - /// - [TestMethod] - public void ApplePaySessionsTest() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/apple-pay-sessions-success.json"); - var checkout = new UtilityService(client); - var applePaySessionRequest = new ApplePaySessionRequest() - { - DisplayName = "YOUR_MERCHANT_NAME", - DomainName = "domainName", - MerchantIdentifier = "234tvsadh34fsghlker3..w35sgfs" - - }; - var applePayResponse = checkout.GetApplePaySessionAsync(applePaySessionRequest).Result; - Assert.AreEqual("eyJ2Z...340278gdflkaswer", applePayResponse.Data); - } - - #endregion - - /// - /// Test success orders cancel - /// GET /storedPaymentMethods - /// - [TestMethod] - public void CheckoutServiceInterfaceTest() - { - var client = - CreateMockTestClientApiKeyBasedRequestAsync("mocks/checkout/get-storedPaymentMethod-success.json"); - var checkout = new MyRecurringService(client); - checkout.DeleteTokenForStoredPaymentDetails("shopperRef", "merchantAccount"); - } - } - - // Implementation to test the Recurring Service Interface - public class MyRecurringService : IRecurringService - { - private readonly IClient _client; - public MyRecurringService(Client client) - { - _client = client.HttpClient; - } - - public void DeleteTokenForStoredPaymentDetails(string recurringId, string shopperReference = default, - string merchantAccount = default, RequestOptions requestOptions = default) - { - var response = _client.Request("", "json", requestOptions, HttpMethod.Delete); - } - - public Task DeleteTokenForStoredPaymentDetailsAsync(string recurringId, string shopperReference = default, - string merchantAccount = default, RequestOptions requestOptions = default, - CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - public ListStoredPaymentMethodsResponse GetTokensForStoredPaymentDetails(string shopperReference = default, - string merchantAccount = default, RequestOptions requestOptions = default) - { - throw new NotImplementedException(); - } - - public Task GetTokensForStoredPaymentDetailsAsync(string shopperReference = default, string merchantAccount = default, - RequestOptions requestOptions = default, CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - public StoredPaymentMethodResource StoredPaymentMethods(StoredPaymentMethodRequest storedPaymentMethodRequest = default, - RequestOptions requestOptions = default) - { - throw new NotImplementedException(); - } - - public Task StoredPaymentMethodsAsync(StoredPaymentMethodRequest storedPaymentMethodRequest = default, - RequestOptions requestOptions = default, CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - } -} diff --git a/Adyen.Test/mocks/checkout/card-details-success.json b/Adyen.Test/mocks/checkout/card-details-success.json index 5945d09d7..697b8abfa 100644 --- a/Adyen.Test/mocks/checkout/card-details-success.json +++ b/Adyen.Test/mocks/checkout/card-details-success.json @@ -2,11 +2,14 @@ "brands": [ { "type": "visa", - "supported": "true" + "supported": true }, { "type": "cartebancaire", - "supported": "true" + "supported": false } - ] + ], + "fundingSource": "CREDIT", + "isCardCommercial": false, + "issuingCountryCode": "FR" } \ No newline at end of file diff --git a/Adyen.Test/mocks/checkout/payment-links-success.json b/Adyen.Test/mocks/checkout/payment-links-success.json index 2787a6788..ebf4be12c 100644 --- a/Adyen.Test/mocks/checkout/payment-links-success.json +++ b/Adyen.Test/mocks/checkout/payment-links-success.json @@ -1,4 +1,6 @@ { + "id": "your-id", + "status": "active", "amount": { "currency": "BRL", "value": 1250 diff --git a/Adyen.Test/mocks/checkout/paymentlinks-recurring-payment-success.json b/Adyen.Test/mocks/checkout/paymentlinks-recurring-payment-success.json deleted file mode 100644 index 628896bea..000000000 --- a/Adyen.Test/mocks/checkout/paymentlinks-recurring-payment-success.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "amount": { - "currency": "EUR", - "value": 100 - }, - "expiresAt": "2020-10-28T12:00:00Z", - "reference": "REFERENCE_NUMBER", - "url": "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=YW1vdW50TWlub3JW...JRA", - "merchantAccount": "YOUR_MERCHANT_ACCOUNT" -} \ No newline at end of file diff --git a/Adyen.Test/mocks/checkout/paymentmethods-error-forbidden-403.json b/Adyen.Test/mocks/checkout/paymentmethods-error-forbidden-403.json deleted file mode 100644 index 28afc9887..000000000 --- a/Adyen.Test/mocks/checkout/paymentmethods-error-forbidden-403.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "status": 403, - "errorCode": "901", - "message": "Invalid Merchant Account", - "errorType": "security" -} \ No newline at end of file diff --git a/Adyen.Test/mocks/checkout/payments-success.json b/Adyen.Test/mocks/checkout/payments-success.json index 0deff7d1a..25b34868f 100644 --- a/Adyen.Test/mocks/checkout/payments-success.json +++ b/Adyen.Test/mocks/checkout/payments-success.json @@ -14,81 +14,34 @@ "accountScore": 25, "results": [ { - "FraudCheckResult": { - "accountScore": 0, - "checkId": 2, - "name": "CardChunkUsage" - } + "accountScore": 0, + "checkId": 2, + "name": "CardChunkUsage" }, { - "FraudCheckResult": { - "accountScore": 0, - "checkId": 3, - "name": "PaymentDetailUsage" - } + "accountScore": 0, + "checkId": 3, + "name": "PaymentDetailUsage" }, { - "FraudCheckResult": { - "accountScore": 0, - "checkId": 4, - "name": "HolderNameUsage" - } + "accountScore": 0, + "checkId": 4, + "name": "HolderNameUsage" }, { - "FraudCheckResult": { - "accountScore": 0, - "checkId": 1, - "name": "PaymentDetailRefCheck" - } + "accountScore": 0, + "checkId": 1, + "name": "PaymentDetailRefCheck" }, { - "FraudCheckResult": { - "accountScore": 0, - "checkId": 13, - "name": "IssuerRefCheck" - } + "accountScore": 0, + "checkId": 13, + "name": "IssuerRefCheck" }, { - "FraudCheckResult": { - "accountScore": 0, - "checkId": 15, - "name": "IssuingCountryReferral" - } - }, - { - "FraudCheckResult": { - "accountScore": 0, - "checkId": 27, - "name": "PmOwnerRefCheck" - } - }, - { - "FraudCheckResult": { - "accountScore": 0, - "checkId": 10, - "name": "HolderNameContainsNumber" - } - }, - { - "FraudCheckResult": { - "accountScore": 0, - "checkId": 11, - "name": "HolderNameIsOneWord" - } - }, - { - "FraudCheckResult": { - "accountScore": 0, - "checkId": 82, - "name": "CustomFieldCheck" - } - }, - { - "FraudCheckResult": { - "accountScore": 0, - "checkId": 25, - "name": "CVCAuthResultCheck" - } + "accountScore": 0, + "checkId": 15, + "name": "IssuingCountryReferral" } ] }, diff --git a/Adyen.Test/mocks/checkout/paymentsdetails-error-invalid-data-422.json b/Adyen.Test/mocks/checkout/paymentsdetails-error-invalid-data-422.json deleted file mode 100644 index ce814f1ef..000000000 --- a/Adyen.Test/mocks/checkout/paymentsdetails-error-invalid-data-422.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "status": 422, - "errorCode": "101", - "message": "Invalid card number", - "errorType": "validation" -} \ No newline at end of file diff --git a/Adyen.Test/mocks/checkout/paymentsresult-multibanco-success.json b/Adyen.Test/mocks/checkout/paymentsresult-multibanco-success.json deleted file mode 100644 index 5e2c9d09c..000000000 --- a/Adyen.Test/mocks/checkout/paymentsresult-multibanco-success.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "resultCode": "PresentToShopper", - "action": { - "paymentMethodType": "multibanco", - "type": "voucher", - "entity": "12101", - "expiresAt": "2020-01-12T09:37:49", - "initialAmount": { - "currency": "EUR", - "value": 1000 - }, - "merchantName": "YOUR_MERCHANT", - "merchantReference": "YOUR_ORDER_NUMBER", - "reference": "501 422 944", - "totalAmount": { - "currency": "EUR", - "value": 1000 - }, - "action": "voucher" - } -} \ No newline at end of file From 5b0bd17c3c36ab58ca2069a9d5ad9a00ec4656e7 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Sun, 9 Nov 2025 16:27:38 +0100 Subject: [PATCH 122/126] Move all old classic payments tests to /Payment --- Adyen.Test/Checkout/PaymentsTest.cs | 213 +++++++++- Adyen.Test/ModificationTest.cs | 128 ------ Adyen.Test/Payment/ModificationTest.cs | 119 ++++++ Adyen.Test/Payment/PaymentTest.cs | 379 +++++++++++++++++ Adyen.Test/PaymentMethodDetailsTest.cs | 180 -------- Adyen.Test/PaymentTest.cs | 391 ------------------ Adyen.Test/TerminalApi/BaseTest.cs | 26 -- .../generichost/modelGeneric.mustache | 13 + 8 files changed, 705 insertions(+), 744 deletions(-) delete mode 100644 Adyen.Test/ModificationTest.cs create mode 100644 Adyen.Test/Payment/ModificationTest.cs create mode 100644 Adyen.Test/Payment/PaymentTest.cs delete mode 100644 Adyen.Test/PaymentMethodDetailsTest.cs delete mode 100644 Adyen.Test/PaymentTest.cs diff --git a/Adyen.Test/Checkout/PaymentsTest.cs b/Adyen.Test/Checkout/PaymentsTest.cs index c8db57c4d..1ce3d327b 100644 --- a/Adyen.Test/Checkout/PaymentsTest.cs +++ b/Adyen.Test/Checkout/PaymentsTest.cs @@ -1,5 +1,4 @@ using Adyen.Core.Options; -using Adyen.Core.Client.Extensions; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; @@ -13,11 +12,11 @@ namespace Adyen.Test.Checkout { [TestClass] - public class PaymentsServiceTest + public class PaymentsTest { private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; - public PaymentsServiceTest() + public PaymentsTest() { IHost testHost = Host.CreateDefaultBuilder() .ConfigureCheckout((context, services, config) => @@ -313,23 +312,199 @@ public async Task Given_ConfigureCheckout_When_Live_Url_And_Prefix_Not_Set_Throw ); } + [TestMethod] + public void Given_PaymentRequest_When_PaymentMethod_Is_AchDetails_Result_Is_Not_Null() + { + // Arrange + // Act + var achDetails = new AchDetails + { + Type = AchDetails.TypeEnum.Ach, + BankAccountNumber = "1234567", + BankLocationId = "1234567", + EncryptedBankAccountNumber = "1234asdfg", + OwnerName = "John Smith" + }; + + var paymentRequest = new PaymentRequest( + merchantAccount: "YOUR_MERCHANT_ACCOUNT", + amount: new Amount("EUR", 1000), reference: "ACH test", + paymentMethod: new CheckoutPaymentMethod(achDetails), + shopperIP: "192.0.2.1", + channel: PaymentRequest.ChannelEnum.Web, origin: "https://your-company.com", + returnUrl: "https://your-company.com/checkout?shopperOrder=12xy.." + ); + + // Assert + AchDetails paymentMethodDetails = paymentRequest.PaymentMethod.AchDetails; + Assert.AreEqual(paymentMethodDetails.Type, AchDetails.TypeEnum.Ach); + Assert.AreEqual(paymentMethodDetails.BankAccountNumber, "1234567"); + Assert.AreEqual(paymentMethodDetails.BankLocationId, "1234567"); + Assert.AreEqual(paymentMethodDetails.EncryptedBankAccountNumber, "1234asdfg"); + Assert.AreEqual(paymentMethodDetails.OwnerName, "John Smith"); + Assert.AreEqual(paymentRequest.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); + Assert.AreEqual(paymentRequest.Reference, "ACH test"); + Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); + } - ////TODO: Chained calls, extract these and move it to Payments - // [TestMethod] - // public void TestSerializationShopperInteractionMoto() - // { - // var paymentRequest = MockPaymentData.CreateFullPaymentRequestWithShopperInteraction(PaymentRequest.ShopperInteractionEnum.Moto); - // var serializedPaymentRequest = JsonConvert.SerializeObject(paymentRequest); - // StringAssert.Contains(serializedPaymentRequest, nameof(PaymentRequest.ShopperInteractionEnum.Moto)); - // } - // - // [TestMethod] - // public void TestSerializationShopperInteractionDefaultIsZero() - // { - // PaymentRequest paymentRequest = MockPaymentData.CreateFullPaymentRequestWithShopperInteraction(default); - // string serializedPaymentRequest = paymentRequest.ToJson(); - // Assert.IsTrue(serializedPaymentRequest.Contains("\"shopperInteraction\": 0,")); - // } + [TestMethod] + public void Given_PaymentRequest_When_PaymentMethod_Is_ApplePayDetails_Result_Is_Not_Null() + { + // Arrange + // Act + var applePay = new ApplePayDetails( + type: ApplePayDetails.TypeEnum.Applepay, + applePayToken: "VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU..." + ); + + var paymentRequest = new PaymentRequest( + merchantAccount: "YOUR_MERCHANT_ACCOUNT", + amount: new Amount("EUR", 1000), + reference: "apple pay test", + paymentMethod: new CheckoutPaymentMethod(applePay), + returnUrl: "https://your-company.com/checkout?shopperOrder=12xy.." + ); + + // Assert + ApplePayDetails paymentMethodDetails = paymentRequest.PaymentMethod.ApplePayDetails; + Assert.AreEqual(paymentMethodDetails.Type, ApplePayDetails.TypeEnum.Applepay); + Assert.AreEqual(paymentMethodDetails.ApplePayToken, "VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU..."); + Assert.AreEqual(paymentRequest.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); + Assert.AreEqual(paymentRequest.Reference, "apple pay test"); + Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); + } + + [TestMethod] + public void Given_PaymentRequest_When_PaymentMethod_Is_GooglePayDetails_Result_Is_Not_Null() + { + // Arrange + // Act + var paymentRequest = new PaymentRequest( + merchantAccount: "YOUR_MERCHANT_ACCOUNT", + amount: new Amount("EUR", 1000), + reference: "google pay test", + paymentMethod: new CheckoutPaymentMethod( + new GooglePayDetails( + type: GooglePayDetails.TypeEnum.Googlepay, + googlePayToken: "==Payload as retrieved from Google Pay response==", + fundingSource: GooglePayDetails.FundingSourceEnum.Debit + ) + ), + returnUrl: "https://your-company.com/checkout?shopperOrder=12xy.."); + + // Assert + GooglePayDetails paymentMethodDetails = paymentRequest.PaymentMethod.GooglePayDetails; + Assert.AreEqual(paymentMethodDetails.Type, GooglePayDetails.TypeEnum.Googlepay); + Assert.AreEqual(paymentMethodDetails.GooglePayToken, "==Payload as retrieved from Google Pay response=="); + Assert.AreEqual(paymentMethodDetails.FundingSource, GooglePayDetails.FundingSourceEnum.Debit); + Assert.AreEqual(paymentRequest.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); + Assert.AreEqual(paymentRequest.Reference, "google pay test"); + Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); + } + + [TestMethod] + public void Given_PaymentRequest_When_PaymentMethod_Is_iDEAL_Result_Is_Not_Null() + { + // Arrange + // Act + var paymentRequest = new PaymentRequest( + merchantAccount: "YOUR_MERCHANT_ACCOUNT", + amount: new Amount("EUR", 1000), + reference: "ideal test", + paymentMethod: new CheckoutPaymentMethod(new IdealDetails( + type: IdealDetails.TypeEnum.Ideal, + issuer: "1121") + ), + returnUrl: "https://your-company.com/checkout?shopperOrder=12xy.." ); + + // Assert + IdealDetails paymentMethodDetails = paymentRequest.PaymentMethod.IdealDetails; + Assert.AreEqual(paymentMethodDetails.Type, IdealDetails.TypeEnum.Ideal); + Assert.AreEqual(paymentRequest.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); + Assert.AreEqual(paymentRequest.Reference, "ideal test"); + Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); + } + + [TestMethod] + public void Given_PaymentRequest_When_PaymentMethod_Is_BacsDirectDebitDetails_Result_Is_Not_Null() + { + // Arrange + // Act + var paymentRequest = new PaymentRequest + { + MerchantAccount = "YOUR_MERCHANT_ACCOUNT", + Amount = new Amount("GBP", 1000), + Reference = "bacs direct debit test", + PaymentMethod = new CheckoutPaymentMethod(new BacsDirectDebitDetails + { + Type = BacsDirectDebitDetails.TypeEnum.DirectdebitGB, + BankAccountNumber = "NL0123456789", + BankLocationId = "121000358", + HolderName = "John Smith" + }), + ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy.." + }; + + // Assert + BacsDirectDebitDetails paymentMethodDetails = paymentRequest.PaymentMethod.BacsDirectDebitDetails; + Assert.AreEqual(paymentMethodDetails.Type, BacsDirectDebitDetails.TypeEnum.DirectdebitGB); + Assert.AreEqual(paymentMethodDetails.BankAccountNumber, "NL0123456789"); + Assert.AreEqual(paymentMethodDetails.BankLocationId, "121000358"); + Assert.AreEqual(paymentMethodDetails.HolderName, "John Smith"); + Assert.AreEqual(paymentRequest.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); + Assert.AreEqual(paymentRequest.Reference, "bacs direct debit test"); + Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); + } + + [TestMethod] + public void Given_PaymentRequest_When_PaymentMethod_Is_PayPalDetails_Result_Is_Not_Null() + { + // Arrange + // Act + var paymentRequest = new PaymentRequest + { + MerchantAccount = "YOUR_MERCHANT_ACCOUNT", + Amount = new Amount("USD", 1000), + Reference = "paypal test", + PaymentMethod = new CheckoutPaymentMethod(new PayPalDetails + { + Type = PayPalDetails.TypeEnum.Paypal, + Subtype = PayPalDetails.SubtypeEnum.Sdk, + StoredPaymentMethodId = "2345654212345432345" + }), + ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy.." + }; + + // Assert + PayPalDetails paymentMethodDetails = paymentRequest.PaymentMethod.PayPalDetails; + Assert.AreEqual(paymentMethodDetails.Type, PayPalDetails.TypeEnum.Paypal); + Assert.AreEqual(paymentMethodDetails.Subtype, PayPalDetails.SubtypeEnum.Sdk); + } + + [TestMethod] + public void Given_PaymentRequest_When_PaymentMethod_Is_ZipDetails_Result_Is_Not_Null() + { + // Arrange + // Act + var paymentRequest = new PaymentRequest + { + MerchantAccount = "YOUR_MERCHANT_ACCOUNT", + Amount = new Amount("USD", 1000), + Reference = "zip test", + PaymentMethod = new CheckoutPaymentMethod(new ZipDetails + { + Type = ZipDetails.TypeEnum.Zip + }), + ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy..", + }; + + // Assert + ZipDetails paymentMethodDetails = paymentRequest.PaymentMethod.ZipDetails; + Assert.AreEqual(paymentMethodDetails.Type, ZipDetails.TypeEnum.Zip); + Assert.AreEqual(paymentRequest.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); + Assert.AreEqual(paymentRequest.Reference, "zip test"); + Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); + } } } \ No newline at end of file diff --git a/Adyen.Test/ModificationTest.cs b/Adyen.Test/ModificationTest.cs deleted file mode 100644 index b1864bd42..000000000 --- a/Adyen.Test/ModificationTest.cs +++ /dev/null @@ -1,128 +0,0 @@ -using Adyen.Model.Payment; -using Adyen.Service; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - [TestClass] - public class ModificationTest : BaseTest - { - [TestMethod] - public void TestCaptureMockedSuccess() - { - var paymentResultPspReference = MockPaymentData.GetTestPspReferenceMocked(); - //Call authorization test - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/capture-success.json"); - var modification = new PaymentService(client); - //Send capture call with psp refernce - var captureRequest = CreateCaptureTestRequest(paymentResultPspReference); - var captureResult = modification.Capture(captureRequest); - Assert.AreEqual(captureResult.Response, ModificationResult.ResponseEnum.CaptureReceived); - Assert.AreEqual(captureRequest.AdditionalData["authorisationType"],"PreAuth"); - } - - [TestMethod] - public void TestCancelOrRefundReceivedMocked() - { - var paymentResultPspReference = MockPaymentData.GetTestPspReferenceMocked(); - //Call authorization test - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/cancelOrRefund-received.json"); - var modification = new PaymentService(client); - var cancelOrRefundRequest = CreateCancelOrRefundTestRequest(pspReference: paymentResultPspReference); - var cancelOrRefundResult = modification.CancelOrRefund(cancelOrRefundRequest); - Assert.AreEqual(cancelOrRefundResult.Response, ModificationResult.ResponseEnum.CancelOrRefundReceived); - } - - [TestMethod] - public void TestRefundReceivedMocked() - { - var paymentResultPspReference = MockPaymentData.GetTestPspReferenceMocked(); - //Call authorization test - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/refund-received.json"); - var modification = new PaymentService(client); - var refundRequest = CreateRefundTestRequest(pspReference: paymentResultPspReference); - var refundResult = modification.Refund(refundRequest); - Assert.AreEqual(refundResult.Response, ModificationResult.ResponseEnum.RefundReceived); - } - - [TestMethod] - public void TestCancelReceivedMocked() - { - var paymentResultPspReference = MockPaymentData.GetTestPspReferenceMocked(); - //Call authorization test - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/cancel-received.json"); - var modification = new PaymentService(client); - var cancelRequest = CreateCancelTestRequest(pspReference: paymentResultPspReference); - var cancelResult = modification.Cancel(cancelRequest); - Assert.AreEqual(cancelResult.Response, ModificationResult.ResponseEnum.CancelReceived); - } - - [TestMethod] - public void TestAdjustAuthorisationReceivedMocked() - { - var paymentResultPspReference = MockPaymentData.GetTestPspReferenceMocked(); - //Call authorization test - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/adjustAuthorisation-received.json"); - var modification = new PaymentService(client); - var authorisationRequest = CreateAdjustAuthorisationRequest(pspReference: paymentResultPspReference); - var adjustAuthorisationResult = modification.AdjustAuthorisation(authorisationRequest); - Assert.AreEqual(adjustAuthorisationResult.Response, ModificationResult.ResponseEnum.AdjustAuthorisationReceived); - Assert.AreEqual(adjustAuthorisationResult.PspReference, "853569123456789D"); - Assert.AreEqual(adjustAuthorisationResult.AdditionalData["merchantReference"], "payment - 20190901"); - } - - [TestMethod] - public void TestCaptureRequest() - { - var paymentResultPspReference = MockPaymentData.GetTestPspReferenceMocked(); - var captureRequest = CreateCaptureTestRequest(paymentResultPspReference); - Assert.IsNotNull(captureRequest.AdditionalData); - } - - [TestMethod] - public void TestCancelOrRefundRequest() - { - var paymentResultPspReference = MockPaymentData.GetTestPspReferenceMocked(); - var cancelOrRefundRequest = CreateCancelOrRefundTestRequest(pspReference: paymentResultPspReference); - Assert.IsNull(cancelOrRefundRequest.AdditionalData); - Assert.AreEqual(cancelOrRefundRequest.MerchantAccount, "MerchantAccount"); - } - - [TestMethod] - public void TestRefundRequest() - { - var paymentResultPspReference = MockPaymentData.GetTestPspReferenceMocked(); - var refundRequest = CreateRefundTestRequest(pspReference: paymentResultPspReference); - Assert.IsNull(refundRequest.AdditionalData); - Assert.AreEqual(refundRequest.MerchantAccount, "MerchantAccount"); - } - - [TestMethod] - public void TestAdjustAuthorisationRequest() - { - var paymentResultPspReference = MockPaymentData.GetTestPspReferenceMocked(); - var authorisationRequest = CreateAdjustAuthorisationRequest(pspReference: paymentResultPspReference); - Assert.IsNull(authorisationRequest.AdditionalData); - Assert.AreEqual(authorisationRequest.ModificationAmount, new Amount("EUR",150)); - } - - [TestMethod] - public void TestCancelRequest() - { - var paymentResultPspReference = MockPaymentData.GetTestPspReferenceMocked(); - var cancelRequest = CreateCancelTestRequest(pspReference: paymentResultPspReference); - Assert.IsNull(cancelRequest.AdditionalData); - Assert.AreEqual(cancelRequest.MerchantAccount, "MerchantAccount"); - } - - [TestMethod] - public void TestPendingRefundReceived() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/voidPendingRefund-received.json"); - var modification = new PaymentService(client); - var voidPendingRefundRequest = new VoidPendingRefundRequest(); - var modificationResult = modification.VoidPendingRefund(voidPendingRefundRequest); - Assert.AreEqual(modificationResult.Response, ModificationResult.ResponseEnum.VoidPendingRefundReceived); - } - } -} diff --git a/Adyen.Test/Payment/ModificationTest.cs b/Adyen.Test/Payment/ModificationTest.cs new file mode 100644 index 000000000..6e70f9a10 --- /dev/null +++ b/Adyen.Test/Payment/ModificationTest.cs @@ -0,0 +1,119 @@ +using Adyen.Core.Options; +using Adyen.Payment.Extensions; +using Adyen.Payment.Client; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.Extensions.Hosting; +using System.Text.Json; +using Adyen.Constants; +using Adyen.Core; +using Adyen.Payment.Models; + +namespace Adyen.Test.Payment +{ + /// + /// ClassicPayments - Modification. + /// + [TestClass] + public class ModificationTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public ModificationTest() + { + IHost testHost = Host.CreateDefaultBuilder() + .ConfigurePayment((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = testHost.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_Deserialize_When_ModificationResult_Result_Is_CaptureReceived() + { + //Assert.AreEqual(json.Contains(AdditionalData["authorisationType"],"PreAuth"); + + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/capture-success.json"); + + // Act + var captureResult = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(captureResult.Response, ModificationResult.ResponseEnum.CaptureReceived); + } + + [TestMethod] + public void Given_Deserialize_When_ModificationResult_Result_Is_CancelOrRefundReceived() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/cancelOrRefund-received.json"); + + // Act + var cancelOrRefundResult = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(cancelOrRefundResult.Response, ModificationResult.ResponseEnum.CancelOrRefundReceived); + } + + [TestMethod] + public void Given_Deserialize_When_ModificationResult_Result_Is_RefundReceived() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/refund-received.json"); + + // Act + var refundResult = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(refundResult.Response, ModificationResult.ResponseEnum.RefundReceived); + } + + [TestMethod] + public void Given_Deserialize_When_ModificationResult_Result_Is_CancelReceived() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/cancel-received.json"); + + // Act + var cancelResult = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(cancelResult.Response, ModificationResult.ResponseEnum.CancelReceived); + } + + [TestMethod] + public void Given_Deserialize_When_ModificationResult_Result_Is_AdjustAuthorisationReceived() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/adjustAuthorisation-received.json"); + + // Act + var adjustAuthorisationResult = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(adjustAuthorisationResult.Response, ModificationResult.ResponseEnum.AdjustAuthorisationReceived); + Assert.AreEqual(adjustAuthorisationResult.PspReference, "853569123456789D"); + Assert.AreEqual(adjustAuthorisationResult.AdditionalData["merchantReference"], "payment - 20190901"); + } + + [TestMethod] + public void Given_Deserialize_When_ModificationResult_Result_Is_VoidPendingRefundReceived() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/voidPendingRefund-received.json"); + + // Act + var modificationResult = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(modificationResult.Response, ModificationResult.ResponseEnum.VoidPendingRefundReceived); + } + } +} diff --git a/Adyen.Test/Payment/PaymentTest.cs b/Adyen.Test/Payment/PaymentTest.cs new file mode 100644 index 000000000..e4173b136 --- /dev/null +++ b/Adyen.Test/Payment/PaymentTest.cs @@ -0,0 +1,379 @@ +using Adyen.Core.Options; +using Adyen.Payment.Extensions; +using Adyen.Payment.Client; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.Extensions.Hosting; +using System.Text.Json; +using Adyen.Constants; +using Adyen.Payment.Models; + +namespace Adyen.Test.Payment +{ + /// + /// Classic Payments - Payment. + /// + [TestClass] + public class PaymentTest + { + private readonly JsonSerializerOptionsProvider _jsonSerializerOptionsProvider; + + public PaymentTest() + { + IHost testHost = Host.CreateDefaultBuilder() + .ConfigurePayment((context, services, config) => + { + config.ConfigureAdyenOptions(options => + { + options.Environment = AdyenEnvironment.Test; + }); + }) + .Build(); + + _jsonSerializerOptionsProvider = testHost.Services.GetRequiredService(); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentResult_Result_Is_Authorised() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/authorise-success.json"); + + // Act + var result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(result.ResultCode, PaymentResult.ResultCodeEnum.Authorised); + Assert.AreEqual("411111", GetAdditionalData(result.AdditionalData, "cardBin")); + Assert.AreEqual("43733", GetAdditionalData(result.AdditionalData, "authCode")); + Assert.AreEqual("4 AVS not supported for this card type", GetAdditionalData(result.AdditionalData, "avsResult")); + Assert.AreEqual("1 Matches", GetAdditionalData(result.AdditionalData, "cvcResult")); + Assert.AreEqual("visa", GetAdditionalData(result.AdditionalData, "paymentMethod")); + } + + + [TestMethod] + public void Given_Deserialize_When_PaymentResult_3D_Result_Is_Authorise_Success() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/authorise-success-3d.json"); + + // Act + var result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNotNull(result.Md); + Assert.IsNotNull(result.IssuerUrl); + Assert.IsNotNull(result.PaRequest); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentResult_3DS_IdentifyShopper_Result_Is_IdentifyShopper() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/threedsecure2/authorise-response-identifyshopper.json"); + + // Act + var result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(result.ResultCode, PaymentResult.ResultCodeEnum.IdentifyShopper); + Assert.IsNotNull(result.PspReference); + Assert.AreEqual("74044f6c-7d79-4dd1-9859-3b2879a32fb0", GetAdditionalData(result.AdditionalData, "threeds2.threeDSServerTransID")); + Assert.AreEqual(@"https://pal-test.adyen.com/threeds2simulator/acs/startMethod.shtml", GetAdditionalData(result.AdditionalData, "threeds2.threeDSMethodURL")); + Assert.AreEqual("[token]", GetAdditionalData(result.AdditionalData, "threeds2.threeDS2Token")); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentResult_3DS2_ChallengeShopper_Result_Is_ChallengerShopper() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/threedsecure2/authorise3ds2-response-challengeshopper.json"); + + // Act + var paymentResult = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(paymentResult.ResultCode, PaymentResult.ResultCodeEnum.ChallengeShopper); + Assert.IsNotNull(paymentResult.PspReference); + + Assert.AreEqual("C", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.transStatus")); + Assert.AreEqual("Y", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.acsChallengeMandated")); + Assert.AreEqual("https://pal-test.adyen.com/threeds2simulator/acs/challenge.shtml", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.acsURL")); + Assert.AreEqual("74044f6c-7d79-4dd1-9859-3b2879a32fb1", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.threeDSServerTransID")); + Assert.AreEqual("01", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.authenticationType")); + Assert.AreEqual("2.1.0", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.messageVersion")); + Assert.AreEqual("[token]", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2Token")); + Assert.AreEqual("ba961c4b-33f2-4830-3141-744b8586aeb0", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.acsTransID")); + Assert.AreEqual("ADYEN-ACS-SIMULATOR", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.acsReferenceNumber")); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentResult_Authorise_3DS2_Result_Is_Authorised() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/threedsecure2/authorise3ds2-success.json"); + + // Act + var result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(result.ResultCode, PaymentResult.ResultCodeEnum.Authorised); + Assert.IsNotNull(result.PspReference); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentResult_Authorise_3D_Result_Is_Authorised() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/authorise3d-success.json"); + + // Act + var result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(result.ResultCode, PaymentResult.ResultCodeEnum.Authorised); + Assert.IsNotNull(result.PspReference); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentResult_CVC_Declined_Result_Is_Refused() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/authorise-error-cvc-declined.json"); + + // Act + var result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(PaymentResult.ResultCodeEnum.Refused, result.ResultCode); + } + + [TestMethod] + public void Given_Deserialize_When_PaymentResult_CSE_Result_Is_Authorised() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/authorise-success-cse.json"); + + // Act + var result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.AreEqual(PaymentResult.ResultCodeEnum.Authorised, result.ResultCode); + } + + [TestMethod] + public void Given_CreatePaymentRequest_When_AdyenLibraryName_And_AdyenLibraryVersion_Are_Set_Returns_ApplicationInfo() + { + // Arrange + // Act + var paymentRequest = MockPaymentData.CreateFullPaymentRequest(); + + // Assert + Assert.IsNotNull(paymentRequest.ApplicationInfo); + Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Name, ClientConfig.LibName); + Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Version, ClientConfig.LibVersion); + } + + [TestMethod] + public void Given_CreatePaymentRequest3D_When_AdyenLibraryName_And_AdyenLibraryVersion_Are_Set_Returns_ApplicationInfo() + { + // Arrange + // Act + PaymentRequest3d paymentRequest = MockPaymentData.CreateFullPaymentRequest3D(); + + // Assert + Assert.IsNotNull(paymentRequest.ApplicationInfo); + Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Name, ClientConfig.LibName); + Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Version, ClientConfig.LibVersion); + } + + [TestMethod] + public void Given_Serialize_When_PaymentRequest3D_With_CaptureDelaysHours_And_FraudOffSet_Result_Should_Contain_0() + { + // Arrange + var paymentRequest = MockPaymentData.CreateFullPaymentRequest3D(); + + // Act + string target = JsonSerializer.Serialize(paymentRequest); + + // Assert + using var jsonDoc = JsonDocument.Parse(target); + JsonElement root = jsonDoc.RootElement; + Assert.AreEqual(0, root.GetProperty("captureDelayHours").GetInt32()); + Assert.AreEqual(0, root.GetProperty("fraudOffset").GetInt32()); + } + + [TestMethod] + public void Given_Deserialize_When_AuthenticationResultResponse_Result_3DS1_Success_And_3DS2_Is_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/authentication-result-success-3ds1.json"); + + // Act + var authenticationResultResponse = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Arrange + Assert.IsNotNull(authenticationResultResponse); + Assert.IsNotNull(authenticationResultResponse.ThreeDS1Result); + Assert.IsNull(authenticationResultResponse.ThreeDS2Result); + } + + [TestMethod] + public void Given_Deserialize_When_AuthenticationResultResponse_Result_3DS2_Is_Success_And_3DS1_Is_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/authentication-result-success-3ds2.json"); + + // Act + var authenticationResultResponse = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNotNull(authenticationResultResponse); + Assert.IsNull(authenticationResultResponse.ThreeDS1Result); + Assert.IsNotNull(authenticationResultResponse.ThreeDS2Result); + } + + [TestMethod] + public void Given_Deserialize_When_AuthenticationResultResponse_Result_ThreeDSServerTransId_And_Ds_TransID_Not_Null() + { + // Arrange + string json = TestUtilities.GetTestFileContent("mocks/ThreeDS2Result.json"); + + // Act + var threeDs2Result = JsonSerializer.Deserialize(json, _jsonSerializerOptionsProvider.Options); + + // Assert + Assert.IsNotNull(threeDs2Result); + Assert.AreEqual("f04ec32b-f46b-46ef-9ccd-44be42fb0d7e", threeDs2Result.ThreeDS2Result.ThreeDSServerTransID); + Assert.AreEqual("80a16fa0-4eea-43c9-8de5-b0470d09d14d", threeDs2Result.ThreeDS2Result.DsTransID); + } + + [TestMethod] + public void Given_Serialize_When_PaymentRequest_With_ShopperInteraction_Moto_Result_Should_Be_Moto() + { + // Arrange + var paymentRequest = MockPaymentData.CreateFullPaymentRequestWithShopperInteraction(PaymentRequest.ShopperInteractionEnum.Moto); + + // Act + string target = JsonSerializer.Serialize(paymentRequest); + + // Assert + using var jsonDoc = JsonDocument.Parse(target); + JsonElement root = jsonDoc.RootElement; + Assert.AreEqual("Moto", root.GetProperty("shopperInteraction").GetString()); + } + + [TestMethod] + public void Given_Serialize_When_PaymentRequest_With_ShopperInteraction_Result_Should_Be_Null() + { + // Arrange + var paymentRequest = MockPaymentData.CreateFullPaymentRequestWithShopperInteraction(null); + + // Act + string target = JsonSerializer.Serialize(paymentRequest); + + // Assert + using var jsonDoc = JsonDocument.Parse(target); + JsonElement root = jsonDoc.RootElement; + Assert.IsNull(root.GetProperty("shopperInteraction").GetString()); + } + + private string GetAdditionalData(Dictionary additionalData, string assertKey) + { + string result = ""; + if (additionalData.ContainsKey(assertKey)) + { + result = additionalData[assertKey]; + } + return result; + } + } + + internal class MockPaymentData + { + #region Mock payment data + + public static PaymentRequest CreateFullPaymentRequest() + { + PaymentRequest paymentRequest = new PaymentRequest( + applicationInfo: new ApplicationInfo(adyenLibrary: new CommonField(name: ClientConfig.LibName, version: ClientConfig.LibVersion)), + merchantAccount: "MerchantAccount", + amount: new Amount("EUR", 1500), card: CreateTestCard(), + reference: "payment - " + DateTime.Now.ToString("yyyyMMdd"), + additionalData: CreateAdditionalData()); + return paymentRequest; + } + + public static PaymentRequest3ds2 CreateFullPaymentRequest3DS2() + { + PaymentRequest3ds2 paymentRequest = new PaymentRequest3ds2( + amount: new Amount("EUR", 1500), + merchantAccount: "MerchantAccount", + reference: "payment - " + DateTime.Now.ToString("yyyyMMdd"), + additionalData: CreateAdditionalData(), + threeDS2RequestData: new ThreeDS2RequestData(threeDSCompInd: "Y", + deviceChannel: "browser"), + browserInfo: CreateMockBrowserInfo() ); + return paymentRequest; + } + + public static PaymentRequest CreateFullPaymentRequestWithShopperInteraction(PaymentRequest.ShopperInteractionEnum shopperInteraction) + { + PaymentRequest paymentRequest = CreateFullPaymentRequest(); + paymentRequest.ShopperInteraction = shopperInteraction; + return paymentRequest; + } + + protected static Dictionary CreateAdditionalData() + { + return new Dictionary + { + { "liabilityShift", "true"}, + { "fraudResultType", "GREEN"}, + { "authCode", "43733"}, + { "avsResult", "4 AVS not supported for this card type"} + }; + } + + public static PaymentRequest3d CreateFullPaymentRequest3D() + { + PaymentRequest3d paymentRequest = new PaymentRequest3d( + md: "md", + merchantAccount: "MerchantAccount", + paResponse: "paResponse", + applicationInfo: new ApplicationInfo(adyenLibrary: new CommonField(name: ClientConfig.LibName, version: ClientConfig.LibVersion)), + browserInfo: CreateMockBrowserInfo(), + reference: "payment - " + DateTime.Now.ToString("yyyyMMdd"), + captureDelayHours: 0, + fraudOffset: 0); + return paymentRequest; + } + + + public static BrowserInfo CreateMockBrowserInfo() + { + return new BrowserInfo + { + UserAgent = "User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36", + AcceptHeader = "*/*" + }; + } + + public static Card CreateTestCard() + { + return new Card(number: "4111111111111111", expiryMonth: "08", expiryYear: "2018", cvc: "737", holderName: "John Smith"); + } + + public static Card CreateTestCard3D() + { + return new Card(number: "5212345678901234", expiryMonth: "08", expiryYear: "2018", cvc: "737", holderName: "John Smith"); + } + + public static string GetTestPspReferenceMocked() + { + return "8514836072314693"; + } + #endregion + } +} diff --git a/Adyen.Test/PaymentMethodDetailsTest.cs b/Adyen.Test/PaymentMethodDetailsTest.cs deleted file mode 100644 index 2612d880d..000000000 --- a/Adyen.Test/PaymentMethodDetailsTest.cs +++ /dev/null @@ -1,180 +0,0 @@ -using Adyen.Model.Checkout; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - [TestClass] - public class PaymentMethodDetailsTest - { - [TestMethod] - public void TestAchPaymentMethod() - { - var achDetails = new AchDetails - { - BankAccountNumber = "1234567", - BankLocationId = "1234567", - EncryptedBankAccountNumber = "1234asdfg", - OwnerName = "John Smith" - }; - var paymentRequest = new PaymentRequest - { - MerchantAccount = "YOUR_MERCHANT_ACCOUNT", - Amount = new Amount("EUR", 1000), - Reference = "ACH test", - PaymentMethod = new CheckoutPaymentMethod(achDetails), - ShopperIP = "192.0.2.1", - Channel = PaymentRequest.ChannelEnum.Web, - Origin = "https://your-company.com", - ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy..", - - }; - var paymentMethodDetails = paymentRequest.PaymentMethod.GetAchDetails(); - Assert.AreEqual(paymentMethodDetails.Type, AchDetails.TypeEnum.Ach); - Assert.AreEqual(paymentMethodDetails.BankAccountNumber, "1234567"); - Assert.AreEqual(paymentMethodDetails.BankLocationId, "1234567"); - Assert.AreEqual(paymentMethodDetails.EncryptedBankAccountNumber, "1234asdfg"); - Assert.AreEqual(paymentMethodDetails.OwnerName, "John Smith"); - Assert.AreEqual(paymentRequest.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); - Assert.AreEqual(paymentRequest.Reference, "ACH test"); - Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); - } - - - [TestMethod] - public void TestApplePayPaymentMethod() - { - var applePay = new ApplePayDetails - { - ApplePayToken = "VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU..." - }; - var paymentRequest = new PaymentRequest - { - MerchantAccount = "YOUR_MERCHANT_ACCOUNT", - Amount = new Amount("EUR", 1000), - Reference = "apple pay test", - PaymentMethod = new CheckoutPaymentMethod(applePay), - ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy.." - }; - var paymentMethodDetails = paymentRequest.PaymentMethod.GetApplePayDetails(); - Assert.AreEqual(paymentMethodDetails.Type, ApplePayDetails.TypeEnum.Applepay); - Assert.AreEqual(paymentMethodDetails.ApplePayToken, "VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU..."); - Assert.AreEqual(paymentRequest.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); - Assert.AreEqual(paymentRequest.Reference, "apple pay test"); - Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); - } - - [TestMethod] - public void TestGooglePayPaymentMethod() - { - var paymentRequest = new PaymentRequest - { - MerchantAccount = "YOUR_MERCHANT_ACCOUNT", - Amount = new Amount("EUR", 1000), - Reference = "google pay test", - PaymentMethod = new CheckoutPaymentMethod(new GooglePayDetails - { - GooglePayToken = "==Payload as retrieved from Google Pay response==", - FundingSource = GooglePayDetails.FundingSourceEnum.Debit - }), - ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy.." - }; - var paymentMethodDetails = (GooglePayDetails)paymentRequest.PaymentMethod.ActualInstance; - Assert.AreEqual(paymentMethodDetails.Type, GooglePayDetails.TypeEnum.Googlepay); - Assert.AreEqual(paymentMethodDetails.GooglePayToken, "==Payload as retrieved from Google Pay response=="); - Assert.AreEqual(paymentMethodDetails.FundingSource, GooglePayDetails.FundingSourceEnum.Debit); - Assert.AreEqual(paymentRequest.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); - Assert.AreEqual(paymentRequest.Reference, "google pay test"); - Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); - } - - [TestMethod] - public void TestIdealPaymentMethod() - { - - var paymentRequest = new PaymentRequest - { - MerchantAccount = "YOUR_MERCHANT_ACCOUNT", - Amount = new Amount("EUR", 1000), - Reference = "ideal test", - PaymentMethod = new CheckoutPaymentMethod(new IdealDetails - { - Issuer = "1121" - }), - ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy.." - }; - var paymentMethodDetails = paymentRequest.PaymentMethod.GetIdealDetails(); - Assert.AreEqual(paymentMethodDetails.Type, IdealDetails.TypeEnum.Ideal); - Assert.AreEqual(paymentRequest.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); - Assert.AreEqual(paymentRequest.Reference, "ideal test"); - Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); - } - - [TestMethod] - public void TestBacsDirectDebitDetails() - { - var paymentRequest = new PaymentRequest - { - MerchantAccount = "YOUR_MERCHANT_ACCOUNT", - Amount = new Amount("GBP", 1000), - Reference = "bacs direct debit test", - PaymentMethod = new CheckoutPaymentMethod(new BacsDirectDebitDetails - { - BankAccountNumber = "NL0123456789", - BankLocationId = "121000358", - HolderName = "John Smith" - }), - ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy.." - }; - var paymentMethodDetails = paymentRequest.PaymentMethod.GetBacsDirectDebitDetails(); - Assert.AreEqual(paymentMethodDetails.Type, BacsDirectDebitDetails.TypeEnum.DirectdebitGB); - Assert.AreEqual(paymentMethodDetails.BankAccountNumber, "NL0123456789"); - Assert.AreEqual(paymentMethodDetails.BankLocationId, "121000358"); - Assert.AreEqual(paymentMethodDetails.HolderName, "John Smith"); - Assert.AreEqual(paymentRequest.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); - Assert.AreEqual(paymentRequest.Reference, "bacs direct debit test"); - Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); - } - - - [TestMethod] - public void TestPaypalSuccess() - { - var paymentRequest = new PaymentRequest - { - MerchantAccount = "YOUR_MERCHANT_ACCOUNT", - Amount = new Amount("USD", 1000), - Reference = "paypal test", - PaymentMethod = new CheckoutPaymentMethod( new PayPalDetails - { - Subtype = PayPalDetails.SubtypeEnum.Sdk, - StoredPaymentMethodId = "2345654212345432345" - }), - ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy.." - }; - var paymentMethodDetails = (PayPalDetails)paymentRequest.PaymentMethod.ActualInstance; - Assert.AreEqual(paymentMethodDetails.Type, PayPalDetails.TypeEnum.Paypal); - Assert.AreEqual(paymentMethodDetails.Subtype, PayPalDetails.SubtypeEnum.Sdk); - } - - [TestMethod] - public void TestZipSuccess() - { - var paymentRequest = new PaymentRequest - { - MerchantAccount = "YOUR_MERCHANT_ACCOUNT", - Amount = new Amount("USD", 1000), - Reference = "zip test", - PaymentMethod = new CheckoutPaymentMethod(new ZipDetails - { - Type = ZipDetails.TypeEnum.Zip - }), - ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy..", - }; - var paymentMethodDetails = (ZipDetails)paymentRequest.PaymentMethod.ActualInstance; - Assert.AreEqual(paymentMethodDetails.Type, ZipDetails.TypeEnum.Zip); - Assert.AreEqual(paymentRequest.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); - Assert.AreEqual(paymentRequest.Reference, "zip test"); - Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); - } - } -} diff --git a/Adyen.Test/PaymentTest.cs b/Adyen.Test/PaymentTest.cs deleted file mode 100644 index 793437701..000000000 --- a/Adyen.Test/PaymentTest.cs +++ /dev/null @@ -1,391 +0,0 @@ -using System.Collections.Generic; -using Adyen.Constants; -using Adyen.Model.Payment; -using Adyen.Service; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Adyen.Test -{ - [TestClass] - public class PaymentTest : BaseTest - { - [TestMethod] - public void TestAuthoriseBasicAuthenticationSuccessMockedResponse() - { - var paymentResult = CreatePaymentResultFromFile("mocks/authorise-success.json"); - Assert.AreEqual(paymentResult.ResultCode, PaymentResult.ResultCodeEnum.Authorised); - Assert.AreEqual("411111", GetAdditionalData(paymentResult.AdditionalData, "cardBin")); - Assert.AreEqual("43733", GetAdditionalData(paymentResult.AdditionalData, "authCode")); - Assert.AreEqual("4 AVS not supported for this card type", GetAdditionalData(paymentResult.AdditionalData, "avsResult")); - Assert.AreEqual("1 Matches", GetAdditionalData(paymentResult.AdditionalData, "cvcResult")); - Assert.AreEqual("visa", GetAdditionalData(paymentResult.AdditionalData, "paymentMethod")); - } - - [TestMethod] - public void TestAuthoriseApiKeyBasedSuccessMockedResponse() - { - var paymentResult = CreatePaymentApiKeyBasedResultFromFile("mocks/authorise-success.json"); - Assert.AreEqual(paymentResult.ResultCode, PaymentResult.ResultCodeEnum.Authorised); - Assert.AreEqual("411111", GetAdditionalData(paymentResult.AdditionalData, "cardBin")); - Assert.AreEqual("43733", GetAdditionalData(paymentResult.AdditionalData, "authCode")); - Assert.AreEqual("4 AVS not supported for this card type", GetAdditionalData(paymentResult.AdditionalData, "avsResult")); - Assert.AreEqual("1 Matches", GetAdditionalData(paymentResult.AdditionalData, "cvcResult")); - Assert.AreEqual("visa", GetAdditionalData(paymentResult.AdditionalData, "paymentMethod")); - } - - [TestMethod] - public void TestAuthoriseSuccess3DMocked() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/authorise-success-3d.json"); - var payment = new PaymentService(client); - var paymentRequest = MockPaymentData.CreateFullPaymentRequest(); - var paymentResult = payment.Authorise(paymentRequest); - Assert.IsNotNull(paymentResult.Md); - Assert.IsNotNull(paymentResult.IssuerUrl); - Assert.IsNotNull(paymentResult.PaRequest); - } - - [TestMethod] - public void TestAuthorise3DS2IdentifyShopperMocked() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/threedsecure2/authorise-response-identifyshopper.json"); - var payment = new PaymentService(client); - var paymentRequest = MockPaymentData.CreateFullPaymentRequest3DS2(); - var paymentResult = payment.Authorise3ds2(paymentRequest); - - Assert.AreEqual(paymentResult.ResultCode, PaymentResult.ResultCodeEnum.IdentifyShopper); - Assert.IsNotNull(paymentResult.PspReference); - - Assert.AreEqual("74044f6c-7d79-4dd1-9859-3b2879a32fb0", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDSServerTransID")); - Assert.AreEqual(@"https://pal-test.adyen.com/threeds2simulator/acs/startMethod.shtml", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDSMethodURL")); - Assert.AreEqual("[token]", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2Token")); - } - - [TestMethod] - public void TestAuthorise3DS2ChallengeShopperMocked() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/threedsecure2/authorise3ds2-response-challengeshopper.json"); - var payment = new PaymentService(client); - var paymentRequest = MockPaymentData.CreateFullPaymentRequest3DS2(); - var paymentResult = payment.Authorise3ds2(paymentRequest); - - Assert.AreEqual(paymentResult.ResultCode, PaymentResult.ResultCodeEnum.ChallengeShopper); - Assert.IsNotNull(paymentResult.PspReference); - - Assert.AreEqual("C", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.transStatus")); - Assert.AreEqual("Y", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.acsChallengeMandated")); - Assert.AreEqual("https://pal-test.adyen.com/threeds2simulator/acs/challenge.shtml", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.acsURL")); - Assert.AreEqual("74044f6c-7d79-4dd1-9859-3b2879a32fb1", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.threeDSServerTransID")); - Assert.AreEqual("01", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.authenticationType")); - Assert.AreEqual("2.1.0", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.messageVersion")); - Assert.AreEqual("[token]", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2Token")); - Assert.AreEqual("ba961c4b-33f2-4830-3141-744b8586aeb0", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.acsTransID")); - Assert.AreEqual("ADYEN-ACS-SIMULATOR", GetAdditionalData(paymentResult.AdditionalData, "threeds2.threeDS2ResponseData.acsReferenceNumber")); - } - - [TestMethod] - public void TestAuthorise3DS2SuccessMocked() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/threedsecure2/authorise3ds2-success.json"); - var payment = new PaymentService(client); - var paymentRequest = MockPaymentData.CreateFullPaymentRequest3DS2(); - var paymentResult = payment.Authorise3ds2(paymentRequest); - - Assert.AreEqual(paymentResult.ResultCode, PaymentResult.ResultCodeEnum.Authorised); - Assert.IsNotNull(paymentResult.PspReference); - } - - [TestMethod] - public void TestAuthorise3DSuccessMocked() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/authorise3d-success.json"); - var payment = new PaymentService(client); - var paymentRequest = MockPaymentData.CreateFullPaymentRequest3D(); - var paymentResult = payment.Authorise3d(paymentRequest); - Assert.AreEqual(paymentResult.ResultCode, PaymentResult.ResultCodeEnum.Authorised); - Assert.IsNotNull(paymentResult.PspReference); - } - - [TestMethod] - public void TestAuthoriseErrorCvcDeclinedMocked() - { - var paymentResult = CreatePaymentResultFromFile("mocks/authorise-error-cvc-declined.json"); - Assert.AreEqual(PaymentResult.ResultCodeEnum.Refused, paymentResult.ResultCode); - } - - [TestMethod] - public void TestAuthoriseCseSuccessMocked() - { - var paymentResult = CreatePaymentResultFromFile("mocks/authorise-success-cse.json"); - Assert.AreEqual(PaymentResult.ResultCodeEnum.Authorised, paymentResult.ResultCode); - } - - [Ignore] // Fix this test -> not sure how to add additionalDataOpenInvoice class to paymentrequest - [TestMethod] - public void TestOpenInvoice() - { - var client = CreateMockTestClientRequest("mocks/authorise-success-klarna.json"); - var payment = new PaymentService(client); - PaymentRequest paymentRequest = CreateOpenInvoicePaymentRequest(); - var paymentResult = payment.Authorise(paymentRequest); - Assert.AreEqual("2374421290", paymentResult.AdditionalData["additionalData.acquirerReference"]); - Assert.AreEqual("klarna", paymentResult.AdditionalData["paymentMethodVariant"]); - } - - private static PaymentRequest CreateOpenInvoicePaymentRequest() - { - - DateTime dateOfBirth = DateTime.Parse("1970-07-10"); - - PaymentRequest paymentRequest = MockPaymentData.CreateFullPaymentRequest(); - - // Set Shopper Data - paymentRequest.ShopperEmail = "youremail@email.com"; - paymentRequest.DateOfBirth = dateOfBirth; - paymentRequest.TelephoneNumber = "0612345678"; - paymentRequest.ShopperReference = "4"; - - // Set Shopper Info - Name shopperName = new Name - { - FirstName = "Testperson-nl", - LastName = "Approved" - }; - paymentRequest.ShopperName = shopperName; - - // Set Billing and Delivery address - Address address = new Address - { - City = "Gravenhage", - Country = "NL", - HouseNumberOrName = "1", - PostalCode = "2521VA", - StateOrProvince = "Zuid-Holland", - Street = "Neherkade" - }; - paymentRequest.DeliveryAddress = address; - paymentRequest.BillingAddress = address; - - // Use OpenInvoice Provider (klarna, ratepay) - paymentRequest.SelectedBrand = "klarna"; - - long itemAmount = long.Parse("9000"); - long itemVatAmount = long.Parse("1000"); - long itemVatPercentage = long.Parse("1000"); - - List invoiceLines = new List(); - - // invoiceLine1 - AdditionalDataOpenInvoice invoiceLine = new AdditionalDataOpenInvoice - { - OpeninvoicedataLineItemNrCurrencyCode = ("EUR"), - OpeninvoicedataLineItemNrDescription = ("Test product"), - OpeninvoicedataLineItemNrItemVatAmount = ("1000"), - OpeninvoicedataLineItemNrItemAmount = (itemAmount).ToString(), - OpeninvoicedataLineItemNrItemVatPercentage = (itemVatPercentage).ToString(), - OpeninvoicedataLineItemNrNumberOfItems = (1).ToString(), - OpeninvoicedataLineItemNrItemId = ("1234") - }; - - // invoiceLine2 - // invoiceLine1 - AdditionalDataOpenInvoice invoiceLine2 = new AdditionalDataOpenInvoice - { - OpeninvoicedataLineItemNrCurrencyCode = ("EUR"), - OpeninvoicedataLineItemNrDescription = ("Test product2"), - OpeninvoicedataLineItemNrItemVatAmount = (itemVatAmount).ToString(), - OpeninvoicedataLineItemNrItemAmount = (itemAmount).ToString(), - OpeninvoicedataLineItemNrItemVatPercentage = (itemVatPercentage).ToString(), - OpeninvoicedataLineItemNrNumberOfItems = (1).ToString(), - OpeninvoicedataLineItemNrItemId = ("456") - }; - - invoiceLines.Add(invoiceLine); - invoiceLines.Add(invoiceLine2); - - /*paymentRequest.AdditionalData(invoiceLines);*/ - - return paymentRequest; - } - - - [TestMethod] - public void TestPaymentRequestApplicationInfo() - { - var paymentRequest = MockPaymentData.CreateFullPaymentRequest(); - Assert.IsNotNull(paymentRequest.ApplicationInfo); - Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Name, ClientConfig.LibName); - Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Version, ClientConfig.LibVersion); - } - - [TestMethod] - public void TestPaymentRequest3DApplicationInfo() - { - var paymentRequest = MockPaymentData.CreateFullPaymentRequest3D(); - Assert.IsNotNull(paymentRequest.ApplicationInfo); - Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Name, ClientConfig.LibName); - Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Version, ClientConfig.LibVersion); - } - - [TestMethod] - public void TestCaptureDelaySerialization() - { - var paymentRequest = MockPaymentData.CreateFullPaymentRequest3D(); - string jsonString = paymentRequest.ToJson(); - Assert.IsTrue(jsonString.Contains("\"captureDelayHours\": 0,")); - Assert.IsFalse(jsonString.Contains("\"fraudOffset\": 0")); - } - - [TestMethod] - public void TestAuthenticationResult3ds1Success() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/authentication-result-success-3ds1.json"); - var payment = new PaymentService(client); - var authenticationResultRequest = new AuthenticationResultRequest(); - var authenticationResultResponse = payment.GetAuthenticationResult(authenticationResultRequest); - Assert.IsNotNull(authenticationResultResponse); - Assert.IsNotNull(authenticationResultResponse.ThreeDS1Result); - Assert.IsNull(authenticationResultResponse.ThreeDS2Result); - } - - [TestMethod] - public void TestAuthenticationResult3ds2Success() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/authentication-result-success-3ds2.json"); - var payment = new PaymentService(client); - var authenticationResultRequest = new AuthenticationResultRequest(); - var authenticationResultResponse = payment.GetAuthenticationResult(authenticationResultRequest); - Assert.IsNotNull(authenticationResultResponse); - Assert.IsNull(authenticationResultResponse.ThreeDS1Result); - Assert.IsNotNull(authenticationResultResponse.ThreeDS2Result); - } - - [TestMethod] - public void TestRetrieve3ds2ResultSuccess() - { - var client = CreateMockTestClientApiKeyBasedRequestAsync("mocks/ThreeDS2Result.json"); - var payment = new PaymentService(client); - var authenticationResultRequest = new AuthenticationResultRequest(); - var ThreeDSTwoResult = payment.GetAuthenticationResult(authenticationResultRequest); - Assert.AreEqual("f04ec32b-f46b-46ef-9ccd-44be42fb0d7e", ThreeDSTwoResult.ThreeDS2Result.ThreeDSServerTransID); - Assert.AreEqual("80a16fa0-4eea-43c9-8de5-b0470d09d14d", ThreeDSTwoResult.ThreeDS2Result.DsTransID); - Assert.IsNotNull(ThreeDSTwoResult); - } - - private string GetAdditionalData(Dictionary additionalData, string assertKey) - { - string result = ""; - if (additionalData.ContainsKey(assertKey)) - { - result = additionalData[assertKey]; - } - return result; - } - } - - internal class MockPaymentData - { - #region Mock payment data - - public static Config CreateConfigApiKeyBasedMock() - { - return new Config - { - Environment = Adyen.Model.Environment.Test, - XApiKey = "AQEyhmfxK....LAG84XwzP5pSpVd"//mock api key - }; - } - - public static PaymentRequest CreateFullPaymentRequest() - { - var paymentRequest = new PaymentRequest - { - ApplicationInfo = new ApplicationInfo - { - AdyenLibrary = new CommonField(name: ClientConfig.LibName, version: ClientConfig.LibVersion) - }, - MerchantAccount = "MerchantAccount", - Amount = new Amount("EUR", 1500), - Card = CreateTestCard(), - Reference = "payment - " + DateTime.Now.ToString("yyyyMMdd"), - AdditionalData = CreateAdditionalData() - }; - return paymentRequest; - } - - public static PaymentRequest3ds2 CreateFullPaymentRequest3DS2() - { - var paymentRequest = new PaymentRequest3ds2 - { - MerchantAccount = "MerchantAccount", - Amount = new Amount("EUR", 1500), - Reference = "payment - " + DateTime.Now.ToString("yyyyMMdd"), - AdditionalData = CreateAdditionalData(), - ThreeDS2RequestData = new ThreeDS2RequestData(threeDSCompInd: "Y", - deviceChannel: "browser"), - BrowserInfo = CreateMockBrowserInfo(), - }; - return paymentRequest; - } - - public static PaymentRequest CreateFullPaymentRequestWithShopperInteraction(PaymentRequest.ShopperInteractionEnum shopperInteraction) - { - var paymentRequest = CreateFullPaymentRequest(); - paymentRequest.ShopperInteraction = shopperInteraction; - return paymentRequest; - } - - protected static Dictionary CreateAdditionalData() - { - return new Dictionary - { - { "liabilityShift", "true"}, - { "fraudResultType", "GREEN"}, - { "authCode", "43733"}, - { "avsResult", "4 AVS not supported for this card type"} - }; - } - - public static PaymentRequest3d CreateFullPaymentRequest3D() - { - var paymentRequest = new PaymentRequest3d - { - ApplicationInfo = new ApplicationInfo - { - AdyenLibrary = new CommonField(name: ClientConfig.LibName, version: ClientConfig.LibVersion) - }, - MerchantAccount = "MerchantAccount", - BrowserInfo = CreateMockBrowserInfo(), - Reference = "payment - " + DateTime.Now.ToString("yyyyMMdd"), - CaptureDelayHours = 0 - }; - return paymentRequest; - } - - - public static BrowserInfo CreateMockBrowserInfo() - { - return new BrowserInfo - { - UserAgent = "User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36", - AcceptHeader = "*/*" - }; - } - - public static Card CreateTestCard() - { - return new Card(number: "4111111111111111", expiryMonth: "08", expiryYear: "2018", cvc: "737", holderName: "John Smith"); - } - - public static Card CreateTestCard3D() - { - return new Card(number: "5212345678901234", expiryMonth: "08", expiryYear: "2018", cvc: "737", holderName: "John Smith"); - } - - public static string GetTestPspReferenceMocked() - { - return "8514836072314693"; - } - #endregion - } -} diff --git a/Adyen.Test/TerminalApi/BaseTest.cs b/Adyen.Test/TerminalApi/BaseTest.cs index 01087ad5a..7c1911280 100644 --- a/Adyen.Test/TerminalApi/BaseTest.cs +++ b/Adyen.Test/TerminalApi/BaseTest.cs @@ -22,32 +22,6 @@ public class BaseTest { private protected IClient ClientInterfaceSubstitute; - #region Payment request - /// - /// Payment with basic authentication - /// - /// - /// - protected PaymentResult CreatePaymentResultFromFile(string fileName) - { - var client = CreateMockTestClientApiKeyBasedRequestAsync(fileName); - var payment = new PaymentService(client); - var paymentRequest = MockPaymentData.CreateFullPaymentRequest(); - var paymentResult = payment.Authorise(paymentRequest); - return paymentResult; - } - - protected PaymentResult CreatePaymentApiKeyBasedResultFromFile(string fileName) - { - var client = CreateMockTestClientApiKeyBasedRequestAsync(fileName); - var payment = new PaymentService(client); - var paymentRequest = MockPaymentData.CreateFullPaymentRequest(); - - var paymentResult = payment.Authorise(paymentRequest); - return paymentResult; - } - #endregion - #region Modification objects protected CaptureRequest CreateCaptureTestRequest(string pspReference) diff --git a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache index ca87c3197..23c1d3f9f 100644 --- a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache +++ b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache @@ -88,6 +88,19 @@ {{/allVars}} OnCreated(); } + + {{#allVars}} + {{^isDiscriminator}} + {{#-first}} + /// + /// Best practice: Use the parameterized constructor above to initialize your objects to understand which parameters are required. + /// + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}() + { + } + {{/-first}} + {{/isDiscriminator}} + {{/allVars}} {{/composedSchemas.oneOf}} partial void OnCreated(); From 0d33bf38935b6391aa65099bebb63245f690b34f Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 10 Nov 2025 11:34:22 +0100 Subject: [PATCH 123/126] Use constant from Core Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryName Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion --- Adyen.Test/Payment/PaymentTest.cs | 12 +++++------ .../TerminalApi/SaleToAcquirerDataTest.cs | 4 ++-- .../ApplicationInformation/ApplicationInfo.cs | 4 ++-- Adyen/TerminalApi/Constants/ClientConfig.cs | 20 ++++++++++++++++--- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/Adyen.Test/Payment/PaymentTest.cs b/Adyen.Test/Payment/PaymentTest.cs index e4173b136..b436efe2c 100644 --- a/Adyen.Test/Payment/PaymentTest.cs +++ b/Adyen.Test/Payment/PaymentTest.cs @@ -171,8 +171,8 @@ public void Given_CreatePaymentRequest_When_AdyenLibraryName_And_AdyenLibraryVer // Assert Assert.IsNotNull(paymentRequest.ApplicationInfo); - Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Name, ClientConfig.LibName); - Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Version, ClientConfig.LibVersion); + Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Name, Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryName); + Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Version, Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion); } [TestMethod] @@ -184,8 +184,8 @@ public void Given_CreatePaymentRequest3D_When_AdyenLibraryName_And_AdyenLibraryV // Assert Assert.IsNotNull(paymentRequest.ApplicationInfo); - Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Name, ClientConfig.LibName); - Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Version, ClientConfig.LibVersion); + Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Name, Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryName); + Assert.AreEqual(paymentRequest.ApplicationInfo.AdyenLibrary.Version, Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion); } [TestMethod] @@ -297,7 +297,7 @@ internal class MockPaymentData public static PaymentRequest CreateFullPaymentRequest() { PaymentRequest paymentRequest = new PaymentRequest( - applicationInfo: new ApplicationInfo(adyenLibrary: new CommonField(name: ClientConfig.LibName, version: ClientConfig.LibVersion)), + applicationInfo: new ApplicationInfo(adyenLibrary: new CommonField(name: Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryName, version: Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion)), merchantAccount: "MerchantAccount", amount: new Amount("EUR", 1500), card: CreateTestCard(), reference: "payment - " + DateTime.Now.ToString("yyyyMMdd"), @@ -342,7 +342,7 @@ public static PaymentRequest3d CreateFullPaymentRequest3D() md: "md", merchantAccount: "MerchantAccount", paResponse: "paResponse", - applicationInfo: new ApplicationInfo(adyenLibrary: new CommonField(name: ClientConfig.LibName, version: ClientConfig.LibVersion)), + applicationInfo: new ApplicationInfo(adyenLibrary: new CommonField(name: Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryName, version: Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion)), browserInfo: CreateMockBrowserInfo(), reference: "payment - " + DateTime.Now.ToString("yyyyMMdd"), captureDelayHours: 0, diff --git a/Adyen.Test/TerminalApi/SaleToAcquirerDataTest.cs b/Adyen.Test/TerminalApi/SaleToAcquirerDataTest.cs index dea0b56fd..4c7248eb6 100644 --- a/Adyen.Test/TerminalApi/SaleToAcquirerDataTest.cs +++ b/Adyen.Test/TerminalApi/SaleToAcquirerDataTest.cs @@ -15,13 +15,13 @@ public class SaleToAcquirerDataTest { private readonly string json = "{\"metadata\":{\"key\":\"value\"},\"shopperEmail\":\"myemail@mail.com\",\"shopperReference\":\"13164308\",\"recurringProcessingModel\":\"Subscription\",\"recurringContract\":\"RECURRING,ONECLICK\",\"shopperStatement\":\"YOUR SHOPPER STATEMENT\",\"recurringDetailName\":\"VALUE\",\"recurringTokenService\":\"VALUE\",\"store\":\"store value\",\"scc\":null,\"merchantAccount\":\"merchantAccount\",\"currency\":\"EUR\",\"applicationInfo\":{\"adyenLibrary\":{\"name\":\"adyen-dotnet-api-library\",\"version\":\"" + - ClientConfig.LibVersion + + Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion + "\"},\"externalPlatform\":{\"integrator\":\"externalPlatformIntegrator\",\"name\":\"externalPlatformName\",\"version\":\"2.0.0\"},\"merchantDevice\":{\"os\":\"merchantDeviceOS\",\"osVersion\":\"10.12.6\",\"reference\":\"4c32759faaa7\"}},\"tenderOption\":\"ReceiptHandler,AllowPartialAuthorisation,AskGratuity\",\"authorisationType\":\"PreAuth\",\"additionalData\":{\"key.key\":\"value\",\"key.keyTwo\":\"value2\"}}"; private readonly string splitJson = "{\"metadata\":{\"key\":\"value\"},\"shopperEmail\":\"myemail@mail.com\",\"shopperReference\":\"13164308\",\"recurringProcessingModel\":\"Subscription\",\"recurringContract\":\"RECURRING,ONECLICK\",\"shopperStatement\":\"YOUR SHOPPER STATEMENT\",\"recurringDetailName\":\"VALUE\",\"recurringTokenService\":\"VALUE\",\"store\":\"store value\",\"scc\":null,\"merchantAccount\":\"merchantAccount\",\"currency\":\"EUR\",\"applicationInfo\":{\"adyenLibrary\":{\"name\":\"adyen-dotnet-api-library\",\"version\":\"" + - ClientConfig.LibVersion + + Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion + "\"},\"externalPlatform\":{\"integrator\":\"externalPlatformIntegrator\",\"name\":\"externalPlatformName\",\"version\":\"2.0.0\"},\"merchantDevice\":{\"os\":\"merchantDeviceOS\",\"osVersion\":\"10.12.6\",\"reference\":\"4c32759faaa7\"}},\"tenderOption\":\"ReceiptHandler,AllowPartialAuthorisation,AskGratuity\",\"authorisationType\":\"PreAuth\"," + "\"additionalData\":{\"key.key\":\"value\",\"key.keyTwo\":\"value2\",\"split.api\":\"1\",\"split.nrOfItems\":\"3\",\"split.totalAmount\":\"62000\",\"split.currencyCode\":\"EUR\",\"split.item1.amount\":\"60000\",\"split.item1.type\":\"BalanceAccount\",\"split.item1.account\":\"BA00000000000000000000001\",\"split.item1.reference\":\"reference_split_1\",\"split.item1.description\":\"description_split_1\",\"split.item2.amount\":\"2000\",\"split.item2.type\":\"Commission\",\"split.item2.reference\":\"reference_commission\",\"split.item2.description\":\"description_commission\",\"split.item3.type\":\"PaymentFee\",\"split.item3.account\":\"BA00000000000000000000001\",\"split.item3.reference\":\"reference_PaymentFee\",\"split.item3.description\":\"description_PaymentFee\"}}"; diff --git a/Adyen/Model/ApplicationInformation/ApplicationInfo.cs b/Adyen/Model/ApplicationInformation/ApplicationInfo.cs index 0427270a9..4ec27e18a 100644 --- a/Adyen/Model/ApplicationInformation/ApplicationInfo.cs +++ b/Adyen/Model/ApplicationInformation/ApplicationInfo.cs @@ -21,8 +21,8 @@ public ApplicationInfo() { AdyenLibrary = new CommonField { - Name = ClientConfig.LibName, - Version = ClientConfig.LibVersion + Name = Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryName, + Version = Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion }; } diff --git a/Adyen/TerminalApi/Constants/ClientConfig.cs b/Adyen/TerminalApi/Constants/ClientConfig.cs index 8e6ce0e55..204125fef 100644 --- a/Adyen/TerminalApi/Constants/ClientConfig.cs +++ b/Adyen/TerminalApi/Constants/ClientConfig.cs @@ -11,10 +11,24 @@ public class ClientConfig public const string CloudApiEndPointUSLive = "https://terminal-api-live-us.adyen.com"; public const string CloudApiEndPointAPSELive = "https://terminal-api-live-apse.adyen.com"; - public const string UserAgentSuffix = "adyen-dotnet-api-library/"; public const string NexoProtocolVersion = "3.0"; + + /// + /// Moved to . + /// + [Obsolete("Use Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion/ instead.")] + public const string UserAgentSuffix = Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryName + "/"; - public const string LibName = "adyen-dotnet-api-library"; - public const string LibVersion = "32.0.0"; + /// + /// Moved to . + /// + [Obsolete("Use Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion instead.")] + public const string LibName = Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryName; + + /// + /// Moved to . + /// + [Obsolete("Use Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion instead.")] + public const string LibVersion = Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion; } } From 469ab2f9b7ef18de917d2a70903a026520d9d10c Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 10 Nov 2025 12:02:49 +0100 Subject: [PATCH 124/126] Escape {{{description}}} Small summary/comments fixes --- templates-v7/csharp/ValidateRegex.mustache | 2 +- .../generichost/modelGeneric.mustache | 36 +++++++++---------- .../generichost/modelInnerEnum.mustache | 2 +- templates-v7/csharp/validatable.mustache | 10 +++--- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/templates-v7/csharp/ValidateRegex.mustache b/templates-v7/csharp/ValidateRegex.mustache index 15cf626dc..d05be8a97 100644 --- a/templates-v7/csharp/ValidateRegex.mustache +++ b/templates-v7/csharp/ValidateRegex.mustache @@ -1,4 +1,4 @@ -// {{{name}}} ({{{dataType}}}) pattern +// {{{name}}} ({{{dataType}}}) pattern. Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); if (!regex{{{name}}}.Match(this.{{{name}}}{{#isUuid}}.ToString(){{/isUuid}}).Success) { diff --git a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache index 23c1d3f9f..00f340413 100644 --- a/templates-v7/csharp/libraries/generichost/modelGeneric.mustache +++ b/templates-v7/csharp/libraries/generichost/modelGeneric.mustache @@ -1,5 +1,5 @@ /// - /// {{description}}{{^description}}{{classname}}{{/description}}. + /// {{{description}}}{{^description}}{{classname}}{{/description}}. /// {{>visibility}} partial class {{classname}}{{#lambda.firstDot}}{{#parent}} : .{{/parent}}{{#validatable}} : .{{/validatable}}{{#equatable}}{{#readOnlyVars}}{{#-first}} : .{{/-first}}{{/readOnlyVars}}{{/equatable}}{{/lambda.firstDot}}{{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{>ImplementsIEquatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} { @@ -93,7 +93,7 @@ {{^isDiscriminator}} {{#-first}} /// - /// Best practice: Use the parameterized constructor above to initialize your objects to understand which parameters are required. + /// Best practice: Use the constructor to initialize your objects to understand which parameters are required/optional. /// {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}() { @@ -123,8 +123,8 @@ {{^isDiscriminator}} {{#isEnum}} {{^required}} - /// - /// Used to track if an optional field is set. If set, will be populated. + /// + /// This is used to track if an optional field is set. If set, will be populated. /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] @@ -132,7 +132,7 @@ {{/required}} /// - /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + /// {{{description}}}{{^description}}.{{/description}} /// {{#description}} /// {{.}} @@ -153,7 +153,7 @@ {{^vendorExtensions.x-duplicated-data-type}} {{^required}} /// - /// Used to track the state of {{{name}}}. + /// This is used to track if an optional field is set. If set, will be populated. /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] @@ -161,7 +161,7 @@ {{/required}} /// - /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{/description}} + /// {{{description}}}{{^description}}.{{/description}} /// {{#description}} /// {{.}}{{/description}} {{#example}} @@ -177,7 +177,7 @@ {{#composedSchemas.oneOf}} {{^vendorExtensions.x-duplicated-data-type}} /// - /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{/description}}. + /// {{{description}}}{{^description}}.{{/description}}. /// {{#description}} /// {{.}}{{/description}} {{#example}} @@ -195,7 +195,7 @@ {{^model.composedSchemas.anyOf}} {{^model.composedSchemas.oneOf}} /// - /// The discriminator + /// The discriminator. /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] @@ -210,7 +210,7 @@ {{#isNew}} {{^required}} /// - /// Used to track the state of {{{name}}} + /// This is used to track if an optional field is set. If set, will be populated. /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] @@ -218,7 +218,7 @@ {{/required}} /// - /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + /// {{{description}}}{{^description}}.{{/description}} /// {{#description}} /// {{.}}{{/description}} {{#example}} @@ -235,7 +235,7 @@ {{^isInherited}} {{^required}} /// - /// Used to track the state of {{{name}}} + /// This is used to track if an optional field is set. If set, will be populated. /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] @@ -243,9 +243,9 @@ {{/required}} /// - /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + /// {{description}}{{^description}}.{{/description}} /// {{#description}} - /// {{.}}{{/description}} + /// {{{description}}}{{/description}} {{#example}} /* {{.}} */ {{/example}} @@ -262,7 +262,7 @@ {{#isAdditionalPropertiesTrue}} {{^parentModel}} /// - /// Gets or Sets additional properties + /// Gets or sets additional properties /// [JsonExtensionData] public Dictionary AdditionalProperties { get; } = new Dictionary(); @@ -302,7 +302,7 @@ {{#-first}} /// - /// Returns true if objects are equal + /// Returns true if objects are equal. /// /// Object to be compared /// Boolean @@ -317,7 +317,7 @@ } /// - /// Returns true if {{classname}} instances are equal + /// Returns true if {{classname}} instances are equal. /// /// Instance of {{classname}} to be compared /// Boolean @@ -356,7 +356,7 @@ } /// - /// Gets the hash code + /// Gets the hash code. /// /// Hash code public override int GetHashCode() diff --git a/templates-v7/csharp/libraries/generichost/modelInnerEnum.mustache b/templates-v7/csharp/libraries/generichost/modelInnerEnum.mustache index ce5cd2324..572d0f136 100644 --- a/templates-v7/csharp/libraries/generichost/modelInnerEnum.mustache +++ b/templates-v7/csharp/libraries/generichost/modelInnerEnum.mustache @@ -1,6 +1,6 @@ {{^isContainer}} /// - /// {{description}}{{^description}}Defines {{{name}}}{{/description}} + /// {{{description}}}{{^description}}Defines {{{name}}}.{{/description}} /// {{#description}} /// {{.}} diff --git a/templates-v7/csharp/validatable.mustache b/templates-v7/csharp/validatable.mustache index 547821a4f..d8b0f2512 100644 --- a/templates-v7/csharp/validatable.mustache +++ b/templates-v7/csharp/validatable.mustache @@ -1,6 +1,6 @@ {{#discriminator}} /// - /// To validate all properties of the instance + /// To validate all properties of the instance. /// /// Validation context /// Validation Result @@ -10,7 +10,7 @@ } /// - /// To validate all properties of the instance + /// To validate all properties of the instance. /// /// Validation context /// Validation Result @@ -20,7 +20,7 @@ {{^discriminator}} {{#parent}} /// - /// To validate all properties of the instance + /// To validate all properties of the instance. /// /// Validation context /// Validation Result @@ -30,7 +30,7 @@ } /// - /// To validate all properties of the instance + /// To validate all properties of the instance. /// /// Validation context /// Validation Result @@ -39,7 +39,7 @@ {{/parent}} {{^parent}} /// - /// To validate all properties of the instance + /// To validate all properties of the instance. /// /// Validation context /// Validation Result From 2ebe37c6d74ce6b7bd400b51da16c8693fa5fb85 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 10 Nov 2025 12:21:17 +0100 Subject: [PATCH 125/126] Move to correct terminal api folder so that when /Model and /Service is removed it compiles Remove /Util folder, no longer used in root --- Adyen/TerminalApi/ApiError.cs | 141 ----------------- Adyen/TerminalApi/Models/ApiException.cs | 18 --- .../ApplicationInformation/ApplicationInfo.cs | 6 +- .../ApplicationInformation/CommonField.cs | 4 +- .../ExternalPlatform.cs | 142 ++++++++++++++++++ .../ApplicationInformation/MerchantDevice.cs | 142 ++++++++++++++++++ .../ShopperInteractionDevice.cs | 141 +++++++++++++++++ .../Services}/ServiceResource.cs | 0 Adyen/Util/ByteArrayConverter.cs | 8 - Adyen/Util/JsonOperation.cs | 20 --- 10 files changed, 430 insertions(+), 192 deletions(-) delete mode 100644 Adyen/TerminalApi/ApiError.cs delete mode 100644 Adyen/TerminalApi/Models/ApiException.cs rename Adyen/{Model => TerminalApi/Models}/ApplicationInformation/ApplicationInfo.cs (98%) rename Adyen/{Model => TerminalApi/Models}/ApplicationInformation/CommonField.cs (99%) create mode 100644 Adyen/TerminalApi/Models/ApplicationInformation/ExternalPlatform.cs create mode 100644 Adyen/TerminalApi/Models/ApplicationInformation/MerchantDevice.cs create mode 100644 Adyen/TerminalApi/Models/ApplicationInformation/ShopperInteractionDevice.cs rename Adyen/{Service => TerminalApi/Services}/ServiceResource.cs (100%) delete mode 100644 Adyen/Util/ByteArrayConverter.cs delete mode 100644 Adyen/Util/JsonOperation.cs diff --git a/Adyen/TerminalApi/ApiError.cs b/Adyen/TerminalApi/ApiError.cs deleted file mode 100644 index fb26ab339..000000000 --- a/Adyen/TerminalApi/ApiError.cs +++ /dev/null @@ -1,141 +0,0 @@ -#region License -// /* -// * ###### -// * ###### -// * ############ ####( ###### #####. ###### ############ ############ -// * ############# #####( ###### #####. ###### ############# ############# -// * ###### #####( ###### #####. ###### ##### ###### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ###### -// * ############# ############# ############# ############# ##### ###### -// * ############ ############ ############# ############ ##### ###### -// * ###### -// * ############# -// * ############ -// * -// * Adyen Dotnet API Library -// * -// * Copyright (c) 2020 Adyen B.V. -// * This file is open source and available under the MIT license. -// * See the LICENSE file for more info. -// */ -#endregion - -using Adyen.Model.Recurring; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; - -namespace Adyen.Model -{ - public class ApiError : IEquatable, IValidatableObject - { - public int Status { get; set; } - public string ErrorCode { get; set; } - public string Message { get; set; } - public string ErrorType { get; set; } - public string PspReference { get; set; } - - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ApiError {\n"); - sb.Append(" ErrorCode: ").Append(ErrorCode).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); - sb.Append(" ErrorType: ").Append(ErrorType).Append("\n"); - sb.Append(" PspReference: ").Append(PspReference).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as RecurringDetailsResult); - } - - /// - /// Returns true if RecurringDetailsResult instances are equal - /// - /// Instance of RecurringDetailsResult to be compared - /// Boolean - public bool Equals(ApiError other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.Status == other.Status || - - this.Status.Equals(other.Status) - ) && - ( - this.ErrorCode == other.ErrorCode || - this.ErrorCode != null && - this.ErrorCode.Equals(other.ErrorCode) - ) && - ( - this.Message == other.Message || - this.Message != null && - this.Message.Equals(other.Message) - ) && - ( - this.ErrorType == other.ErrorType || - this.ErrorType != null && - this.ErrorType.Equals(other.ErrorType) - ) && - ( - this.PspReference == other.PspReference || - this.PspReference != null && - this.PspReference.Equals(other.PspReference) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - hash = hash * 59 + this.Status.GetHashCode(); - if (this.ErrorCode != null) - hash = hash * 59 + this.ErrorCode.GetHashCode(); - if (this.Message != null) - hash = hash * 59 + this.Message.GetHashCode(); - if (this.ErrorType != null) - hash = hash * 59 + this.ErrorType.GetHashCode(); - if (this.PspReference != null) - hash = hash * 59 + this.PspReference.GetHashCode(); - return hash; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } -} diff --git a/Adyen/TerminalApi/Models/ApiException.cs b/Adyen/TerminalApi/Models/ApiException.cs deleted file mode 100644 index b254228f3..000000000 --- a/Adyen/TerminalApi/Models/ApiException.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using Adyen.Model; - -namespace Adyen.Service -{ - public class ApiException:Exception - { - public int StatusCode { get; set; } - - public ApiError ApiError{ get; set; } - - public ApiException(int statusCode,string message) - :base(message) - { - StatusCode = statusCode; - } - } -} diff --git a/Adyen/Model/ApplicationInformation/ApplicationInfo.cs b/Adyen/TerminalApi/Models/ApplicationInformation/ApplicationInfo.cs similarity index 98% rename from Adyen/Model/ApplicationInformation/ApplicationInfo.cs rename to Adyen/TerminalApi/Models/ApplicationInformation/ApplicationInfo.cs index 4ec27e18a..c43d151ab 100644 --- a/Adyen/Model/ApplicationInformation/ApplicationInfo.cs +++ b/Adyen/TerminalApi/Models/ApplicationInformation/ApplicationInfo.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; @@ -22,7 +22,7 @@ public ApplicationInfo() AdyenLibrary = new CommonField { Name = Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryName, - Version = Adyen.Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryVersion + Version = Core.Client.Extensions.HttpRequestMessageExtensions.AdyenLibraryName }; } @@ -178,4 +178,4 @@ IEnumerable IValidatableObject.Validate(ValidationContext vali } } -} +} \ No newline at end of file diff --git a/Adyen/Model/ApplicationInformation/CommonField.cs b/Adyen/TerminalApi/Models/ApplicationInformation/CommonField.cs similarity index 99% rename from Adyen/Model/ApplicationInformation/CommonField.cs rename to Adyen/TerminalApi/Models/ApplicationInformation/CommonField.cs index e1884260c..1ff4bc3f1 100644 --- a/Adyen/Model/ApplicationInformation/CommonField.cs +++ b/Adyen/TerminalApi/Models/ApplicationInformation/CommonField.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; @@ -121,4 +121,4 @@ IEnumerable IValidatableObject.Validate(ValidationContext vali yield break; } } -} +} \ No newline at end of file diff --git a/Adyen/TerminalApi/Models/ApplicationInformation/ExternalPlatform.cs b/Adyen/TerminalApi/Models/ApplicationInformation/ExternalPlatform.cs new file mode 100644 index 000000000..b97ac85ab --- /dev/null +++ b/Adyen/TerminalApi/Models/ApplicationInformation/ExternalPlatform.cs @@ -0,0 +1,142 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.ApplicationInformation +{ + /// + /// ExternalPlatform + /// + [DataContract] + public class ExternalPlatform : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// External platform integrator.. + /// Name of the field. For example, Name of External Platform.. + /// Version of the field. For example, Version of External Platform.. + public ExternalPlatform(string Integrator = default(string), string Name = default(string), string Version = default(string)) + { + this.Integrator = Integrator; + this.Name = Name; + this.Version = Version; + } + + /// + /// External platform integrator. + /// + /// External platform integrator. + [DataMember(Name="integrator", EmitDefaultValue=false)] + public string Integrator { get; set; } + + /// + /// Name of the field. For example, Name of External Platform. + /// + /// Name of the field. For example, Name of External Platform. + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Version of the field. For example, Version of External Platform. + /// + /// Version of the field. For example, Version of External Platform. + [DataMember(Name="version", EmitDefaultValue=false)] + public string Version { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ExternalPlatform {\n"); + sb.Append(" Integrator: ").Append(Integrator).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Version: ").Append(Version).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return Equals(input as ExternalPlatform); + } + + /// + /// Returns true if ExternalPlatform instances are equal + /// + /// Instance of ExternalPlatform to be compared + /// Boolean + public bool Equals(ExternalPlatform input) + { + if (input == null) + return false; + + return + ( + Integrator == input.Integrator || + (Integrator != null && + Integrator.Equals(input.Integrator)) + ) && + ( + Name == input.Name || + (Name != null && + Name.Equals(input.Name)) + ) && + ( + Version == input.Version || + (Version != null && + Version.Equals(input.Version)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (Integrator != null) + hashCode = hashCode * 59 + Integrator.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (Version != null) + hashCode = hashCode * 59 + Version.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} \ No newline at end of file diff --git a/Adyen/TerminalApi/Models/ApplicationInformation/MerchantDevice.cs b/Adyen/TerminalApi/Models/ApplicationInformation/MerchantDevice.cs new file mode 100644 index 000000000..bbcd6ebd7 --- /dev/null +++ b/Adyen/TerminalApi/Models/ApplicationInformation/MerchantDevice.cs @@ -0,0 +1,142 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.ApplicationInformation +{ + /// + /// MerchantDevice + /// + [DataContract] + public class MerchantDevice : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Operating system running on the merchant device.. + /// Version of the operating system on the merchant device.. + /// Merchant device reference.. + public MerchantDevice(string Os = default(string), string OsVersion = default(string), string Reference = default(string)) + { + this.Os = Os; + this.OsVersion = OsVersion; + this.Reference = Reference; + } + + /// + /// Operating system running on the merchant device. + /// + /// Operating system running on the merchant device. + [DataMember(Name="os", EmitDefaultValue=false)] + public string Os { get; set; } + + /// + /// Version of the operating system on the merchant device. + /// + /// Version of the operating system on the merchant device. + [DataMember(Name="osVersion", EmitDefaultValue=false)] + public string OsVersion { get; set; } + + /// + /// Merchant device reference. + /// + /// Merchant device reference. + [DataMember(Name="reference", EmitDefaultValue=false)] + public string Reference { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MerchantDevice {\n"); + sb.Append(" Os: ").Append(Os).Append("\n"); + sb.Append(" OsVersion: ").Append(OsVersion).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return Equals(input as MerchantDevice); + } + + /// + /// Returns true if MerchantDevice instances are equal + /// + /// Instance of MerchantDevice to be compared + /// Boolean + public bool Equals(MerchantDevice input) + { + if (input == null) + return false; + + return + ( + Os == input.Os || + (Os != null && + Os.Equals(input.Os)) + ) && + ( + OsVersion == input.OsVersion || + (OsVersion != null && + OsVersion.Equals(input.OsVersion)) + ) && + ( + Reference == input.Reference || + (Reference != null && + Reference.Equals(input.Reference)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (Os != null) + hashCode = hashCode * 59 + Os.GetHashCode(); + if (OsVersion != null) + hashCode = hashCode * 59 + OsVersion.GetHashCode(); + if (Reference != null) + hashCode = hashCode * 59 + Reference.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} \ No newline at end of file diff --git a/Adyen/TerminalApi/Models/ApplicationInformation/ShopperInteractionDevice.cs b/Adyen/TerminalApi/Models/ApplicationInformation/ShopperInteractionDevice.cs new file mode 100644 index 000000000..40a6ea25d --- /dev/null +++ b/Adyen/TerminalApi/Models/ApplicationInformation/ShopperInteractionDevice.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.ApplicationInformation +{ + /// + /// ShopperInteractionDevice + /// + [DataContract] + public class ShopperInteractionDevice : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Locale on the shopper interaction device.. + /// Operating system running on the shopper interaction device.. + /// Version of the operating system on the shopper interaction device.. + public ShopperInteractionDevice(string Locale = default(string), string Os = default(string), string OsVersion = default(string)) + { + this.Locale = Locale; + this.Os = Os; + this.OsVersion = OsVersion; + } + + /// + /// Locale on the shopper interaction device. + /// + /// Locale on the shopper interaction device. + [DataMember(Name="locale", EmitDefaultValue=false)] + public string Locale { get; set; } + + /// + /// Operating system running on the shopper interaction device. + /// + /// Operating system running on the shopper interaction device. + [DataMember(Name="os", EmitDefaultValue=false)] + public string Os { get; set; } + + /// + /// Version of the operating system on the shopper interaction device. + /// + /// Version of the operating system on the shopper interaction device. + [DataMember(Name="osVersion", EmitDefaultValue=false)] + public string OsVersion { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PaymentMethodsApplicationInfoShopperInteractionDevice {\n"); + sb.Append(" Locale: ").Append(Locale).Append("\n"); + sb.Append(" Os: ").Append(Os).Append("\n"); + sb.Append(" OsVersion: ").Append(OsVersion).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return Equals(input as ShopperInteractionDevice); + } + + /// + /// Returns true if PaymentMethodsApplicationInfoShopperInteractionDevice instances are equal + /// + /// Instance of PaymentMethodsApplicationInfoShopperInteractionDevice to be compared + /// Boolean + public bool Equals(ShopperInteractionDevice input) + { + if (input == null) + return false; + + return + ( + Locale == input.Locale || + (Locale != null && + Locale.Equals(input.Locale)) + ) && + ( + Os == input.Os || + (Os != null && + Os.Equals(input.Os)) + ) && + ( + OsVersion == input.OsVersion || + (OsVersion != null && + OsVersion.Equals(input.OsVersion)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (Locale != null) + hashCode = hashCode * 59 + Locale.GetHashCode(); + if (Os != null) + hashCode = hashCode * 59 + Os.GetHashCode(); + if (OsVersion != null) + hashCode = hashCode * 59 + OsVersion.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Service/ServiceResource.cs b/Adyen/TerminalApi/Services/ServiceResource.cs similarity index 100% rename from Adyen/Service/ServiceResource.cs rename to Adyen/TerminalApi/Services/ServiceResource.cs diff --git a/Adyen/Util/ByteArrayConverter.cs b/Adyen/Util/ByteArrayConverter.cs deleted file mode 100644 index 96dce3d5c..000000000 --- a/Adyen/Util/ByteArrayConverter.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; -using System.Text; -using Newtonsoft.Json; - -namespace Adyen.Util -{ - -} \ No newline at end of file diff --git a/Adyen/Util/JsonOperation.cs b/Adyen/Util/JsonOperation.cs deleted file mode 100644 index 2135a8613..000000000 --- a/Adyen/Util/JsonOperation.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Newtonsoft.Json; - -namespace Adyen.Util -{ - public class JsonOperation - { - - - // public static string SerializeRequest(object request) - // { - // var jsonSettings = new JsonSerializerSettings - // { - // NullValueHandling = NullValueHandling.Ignore, - // DefaultValueHandling = DefaultValueHandling.Include, - // }; - // jsonSettings.Converters.Add(new ByteArrayConverter()); - // return JsonConvert.SerializeObject(request, Formatting.None, jsonSettings); - // } - } -} From 9842abfe2fe0ef64adc833edcc7033d7db4392d5 Mon Sep 17 00:00:00 2001 From: Kwok He <105217051+Kwok-he-Chu@users.noreply.github.com> Date: Mon, 10 Nov 2025 12:23:32 +0100 Subject: [PATCH 126/126] Remove ApplicationInformation, this is moved to /TerminalApi --- .../ExternalPlatform.cs | 142 ------------------ .../ApplicationInformation/MerchantDevice.cs | 142 ------------------ .../ShopperInteractionDevice.cs | 141 ----------------- 3 files changed, 425 deletions(-) delete mode 100644 Adyen/Model/ApplicationInformation/ExternalPlatform.cs delete mode 100644 Adyen/Model/ApplicationInformation/MerchantDevice.cs delete mode 100644 Adyen/Model/ApplicationInformation/ShopperInteractionDevice.cs diff --git a/Adyen/Model/ApplicationInformation/ExternalPlatform.cs b/Adyen/Model/ApplicationInformation/ExternalPlatform.cs deleted file mode 100644 index dfd53c0fd..000000000 --- a/Adyen/Model/ApplicationInformation/ExternalPlatform.cs +++ /dev/null @@ -1,142 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text; -using Newtonsoft.Json; - -namespace Adyen.Model.ApplicationInformation -{ - /// - /// ExternalPlatform - /// - [DataContract] - public class ExternalPlatform : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// External platform integrator.. - /// Name of the field. For example, Name of External Platform.. - /// Version of the field. For example, Version of External Platform.. - public ExternalPlatform(string Integrator = default(string), string Name = default(string), string Version = default(string)) - { - this.Integrator = Integrator; - this.Name = Name; - this.Version = Version; - } - - /// - /// External platform integrator. - /// - /// External platform integrator. - [DataMember(Name="integrator", EmitDefaultValue=false)] - public string Integrator { get; set; } - - /// - /// Name of the field. For example, Name of External Platform. - /// - /// Name of the field. For example, Name of External Platform. - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } - - /// - /// Version of the field. For example, Version of External Platform. - /// - /// Version of the field. For example, Version of External Platform. - [DataMember(Name="version", EmitDefaultValue=false)] - public string Version { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ExternalPlatform {\n"); - sb.Append(" Integrator: ").Append(Integrator).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Version: ").Append(Version).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return Equals(input as ExternalPlatform); - } - - /// - /// Returns true if ExternalPlatform instances are equal - /// - /// Instance of ExternalPlatform to be compared - /// Boolean - public bool Equals(ExternalPlatform input) - { - if (input == null) - return false; - - return - ( - Integrator == input.Integrator || - (Integrator != null && - Integrator.Equals(input.Integrator)) - ) && - ( - Name == input.Name || - (Name != null && - Name.Equals(input.Name)) - ) && - ( - Version == input.Version || - (Version != null && - Version.Equals(input.Version)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (Integrator != null) - hashCode = hashCode * 59 + Integrator.GetHashCode(); - if (Name != null) - hashCode = hashCode * 59 + Name.GetHashCode(); - if (Version != null) - hashCode = hashCode * 59 + Version.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/Adyen/Model/ApplicationInformation/MerchantDevice.cs b/Adyen/Model/ApplicationInformation/MerchantDevice.cs deleted file mode 100644 index 799a29e69..000000000 --- a/Adyen/Model/ApplicationInformation/MerchantDevice.cs +++ /dev/null @@ -1,142 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text; -using Newtonsoft.Json; - -namespace Adyen.Model.ApplicationInformation -{ - /// - /// MerchantDevice - /// - [DataContract] - public class MerchantDevice : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// Operating system running on the merchant device.. - /// Version of the operating system on the merchant device.. - /// Merchant device reference.. - public MerchantDevice(string Os = default(string), string OsVersion = default(string), string Reference = default(string)) - { - this.Os = Os; - this.OsVersion = OsVersion; - this.Reference = Reference; - } - - /// - /// Operating system running on the merchant device. - /// - /// Operating system running on the merchant device. - [DataMember(Name="os", EmitDefaultValue=false)] - public string Os { get; set; } - - /// - /// Version of the operating system on the merchant device. - /// - /// Version of the operating system on the merchant device. - [DataMember(Name="osVersion", EmitDefaultValue=false)] - public string OsVersion { get; set; } - - /// - /// Merchant device reference. - /// - /// Merchant device reference. - [DataMember(Name="reference", EmitDefaultValue=false)] - public string Reference { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class MerchantDevice {\n"); - sb.Append(" Os: ").Append(Os).Append("\n"); - sb.Append(" OsVersion: ").Append(OsVersion).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return Equals(input as MerchantDevice); - } - - /// - /// Returns true if MerchantDevice instances are equal - /// - /// Instance of MerchantDevice to be compared - /// Boolean - public bool Equals(MerchantDevice input) - { - if (input == null) - return false; - - return - ( - Os == input.Os || - (Os != null && - Os.Equals(input.Os)) - ) && - ( - OsVersion == input.OsVersion || - (OsVersion != null && - OsVersion.Equals(input.OsVersion)) - ) && - ( - Reference == input.Reference || - (Reference != null && - Reference.Equals(input.Reference)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (Os != null) - hashCode = hashCode * 59 + Os.GetHashCode(); - if (OsVersion != null) - hashCode = hashCode * 59 + OsVersion.GetHashCode(); - if (Reference != null) - hashCode = hashCode * 59 + Reference.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/Adyen/Model/ApplicationInformation/ShopperInteractionDevice.cs b/Adyen/Model/ApplicationInformation/ShopperInteractionDevice.cs deleted file mode 100644 index 57b152246..000000000 --- a/Adyen/Model/ApplicationInformation/ShopperInteractionDevice.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text; -using Newtonsoft.Json; - -namespace Adyen.Model.ApplicationInformation -{ - /// - /// ShopperInteractionDevice - /// - [DataContract] - public class ShopperInteractionDevice : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// Locale on the shopper interaction device.. - /// Operating system running on the shopper interaction device.. - /// Version of the operating system on the shopper interaction device.. - public ShopperInteractionDevice(string Locale = default(string), string Os = default(string), string OsVersion = default(string)) - { - this.Locale = Locale; - this.Os = Os; - this.OsVersion = OsVersion; - } - - /// - /// Locale on the shopper interaction device. - /// - /// Locale on the shopper interaction device. - [DataMember(Name="locale", EmitDefaultValue=false)] - public string Locale { get; set; } - - /// - /// Operating system running on the shopper interaction device. - /// - /// Operating system running on the shopper interaction device. - [DataMember(Name="os", EmitDefaultValue=false)] - public string Os { get; set; } - - /// - /// Version of the operating system on the shopper interaction device. - /// - /// Version of the operating system on the shopper interaction device. - [DataMember(Name="osVersion", EmitDefaultValue=false)] - public string OsVersion { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class PaymentMethodsApplicationInfoShopperInteractionDevice {\n"); - sb.Append(" Locale: ").Append(Locale).Append("\n"); - sb.Append(" Os: ").Append(Os).Append("\n"); - sb.Append(" OsVersion: ").Append(OsVersion).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return Equals(input as ShopperInteractionDevice); - } - - /// - /// Returns true if PaymentMethodsApplicationInfoShopperInteractionDevice instances are equal - /// - /// Instance of PaymentMethodsApplicationInfoShopperInteractionDevice to be compared - /// Boolean - public bool Equals(ShopperInteractionDevice input) - { - if (input == null) - return false; - - return - ( - Locale == input.Locale || - (Locale != null && - Locale.Equals(input.Locale)) - ) && - ( - Os == input.Os || - (Os != null && - Os.Equals(input.Os)) - ) && - ( - OsVersion == input.OsVersion || - (OsVersion != null && - OsVersion.Equals(input.OsVersion)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (Locale != null) - hashCode = hashCode * 59 + Locale.GetHashCode(); - if (Os != null) - hashCode = hashCode * 59 + Os.GetHashCode(); - if (OsVersion != null) - hashCode = hashCode * 59 + OsVersion.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } -}